Index: /issm/oecreview/Archive/12678-13393/Date.tex
===================================================================
--- /issm/oecreview/Archive/12678-13393/Date.tex	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/Date.tex	(revision 13394)
@@ -0,0 +1,1 @@
+Sep-19-2012
Index: /issm/oecreview/Archive/12678-13393/ISSM-12682-12683.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12682-12683.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12682-12683.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 12682)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 12683)
+@@ -97,7 +97,7 @@
+ #footer
+ cat <<END >> $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp
+ 	/*If we reach this point, the string provided has not been found*/
+-   _error_("Enum %s not found",name);
++	_error2_("Enum " << name << " not found");
+ }
+ END
+ #}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-12683-12684.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12683-12684.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12683-12684.diff	(revision 13394)
@@ -0,0 +1,11 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12683)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12684)
+@@ -477,5 +477,5 @@
+          else stage=5;
+    }
+ 	/*If we reach this point, the string provided has not been found*/
+-   _error2_("Enum " << name << " not found");
++	_error2_("Enum " << name << " not found");
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-12684-12685.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12684-12685.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12684-12685.diff	(revision 13394)
@@ -0,0 +1,4631 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsSmbPosMinEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsSmbPosMinEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsSmbPosMinEnum.m	(revision 12685)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsSmbPosMinEnum()
++%SURFACEFORCINGSSMBPOSMINENUM - Enum of SurfaceforcingsSmbPosMin
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsSmbPosMinEnum()
++
++macro=StringToEnum('SurfaceforcingsSmbPosMin');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsHcEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsHcEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsHcEnum.m	(revision 12685)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsHcEnum()
++%SURFACEFORCINGSHCENUM - Enum of SurfaceforcingsHc
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsHcEnum()
++
++macro=StringToEnum('SurfaceforcingsHc');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsBPosEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsBPosEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsBPosEnum.m	(revision 12685)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsBPosEnum()
++%SURFACEFORCINGSBPOSENUM - Enum of SurfaceforcingsBPos
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsBPosEnum()
++
++macro=StringToEnum('SurfaceforcingsBPos');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsBNegEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsBNegEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsBNegEnum.m	(revision 12685)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsBNegEnum()
++%SURFACEFORCINGSBNEGENUM - Enum of SurfaceforcingsBNeg
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsBNegEnum()
++
++macro=StringToEnum('SurfaceforcingsBNeg');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsSmbPosMaxEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsSmbPosMaxEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsSmbPosMaxEnum.m	(revision 12685)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsSmbPosMaxEnum()
++%SURFACEFORCINGSSMBPOSMAXENUM - Enum of SurfaceforcingsSmbPosMax
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsSmbPosMaxEnum()
++
++macro=StringToEnum('SurfaceforcingsSmbPosMax');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12685)
+@@ -0,0 +1,4498 @@
++"""
++
++   WARNING: DO NOT MODIFY THIS FILE
++            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++            Please read src/c/EnumDefinitions/README for more information
++
++"""
++
++def AutodiffForwardEnum():
++	"""
++	AUTODIFFFORWARDENUM - Enum of AutodiffForward
++
++	   Usage:
++	      macro=AutodiffForwardEnum()
++	"""
++
++	return StringToEnum('AutodiffForward')
++
++def AutodiffIsautodiffEnum():
++	"""
++	AUTODIFFISAUTODIFFENUM - Enum of AutodiffIsautodiff
++
++	   Usage:
++	      macro=AutodiffIsautodiffEnum()
++	"""
++
++	return StringToEnum('AutodiffIsautodiff')
++
++def AutodiffReverseEnum():
++	"""
++	AUTODIFFREVERSEENUM - Enum of AutodiffReverse
++
++	   Usage:
++	      macro=AutodiffReverseEnum()
++	"""
++
++	return StringToEnum('AutodiffReverse')
++
++def BalancethicknessSpcthicknessEnum():
++	"""
++	BALANCETHICKNESSSPCTHICKNESSENUM - Enum of BalancethicknessSpcthickness
++
++	   Usage:
++	      macro=BalancethicknessSpcthicknessEnum()
++	"""
++
++	return StringToEnum('BalancethicknessSpcthickness')
++
++def BalancethicknessStabilizationEnum():
++	"""
++	BALANCETHICKNESSSTABILIZATIONENUM - Enum of BalancethicknessStabilization
++
++	   Usage:
++	      macro=BalancethicknessStabilizationEnum()
++	"""
++
++	return StringToEnum('BalancethicknessStabilization')
++
++def BalancethicknessThickeningRateEnum():
++	"""
++	BALANCETHICKNESSTHICKENINGRATEENUM - Enum of BalancethicknessThickeningRate
++
++	   Usage:
++	      macro=BalancethicknessThickeningRateEnum()
++	"""
++
++	return StringToEnum('BalancethicknessThickeningRate')
++
++def BasalforcingsGeothermalfluxEnum():
++	"""
++	BASALFORCINGSGEOTHERMALFLUXENUM - Enum of BasalforcingsGeothermalflux
++
++	   Usage:
++	      macro=BasalforcingsGeothermalfluxEnum()
++	"""
++
++	return StringToEnum('BasalforcingsGeothermalflux')
++
++def BasalforcingsMeltingRateCorrectionEnum():
++	"""
++	BASALFORCINGSMELTINGRATECORRECTIONENUM - Enum of BasalforcingsMeltingRateCorrection
++
++	   Usage:
++	      macro=BasalforcingsMeltingRateCorrectionEnum()
++	"""
++
++	return StringToEnum('BasalforcingsMeltingRateCorrection')
++
++def BasalforcingsMeltingRateEnum():
++	"""
++	BASALFORCINGSMELTINGRATEENUM - Enum of BasalforcingsMeltingRate
++
++	   Usage:
++	      macro=BasalforcingsMeltingRateEnum()
++	"""
++
++	return StringToEnum('BasalforcingsMeltingRate')
++
++def BathymetryEnum():
++	"""
++	BATHYMETRYENUM - Enum of Bathymetry
++
++	   Usage:
++	      macro=BathymetryEnum()
++	"""
++
++	return StringToEnum('Bathymetry')
++
++def BedEnum():
++	"""
++	BEDENUM - Enum of Bed
++
++	   Usage:
++	      macro=BedEnum()
++	"""
++
++	return StringToEnum('Bed')
++
++def ConstantsGEnum():
++	"""
++	CONSTANTSGENUM - Enum of ConstantsG
++
++	   Usage:
++	      macro=ConstantsGEnum()
++	"""
++
++	return StringToEnum('ConstantsG')
++
++def ConstantsReferencetemperatureEnum():
++	"""
++	CONSTANTSREFERENCETEMPERATUREENUM - Enum of ConstantsReferencetemperature
++
++	   Usage:
++	      macro=ConstantsReferencetemperatureEnum()
++	"""
++
++	return StringToEnum('ConstantsReferencetemperature')
++
++def ConstantsYtsEnum():
++	"""
++	CONSTANTSYTSENUM - Enum of ConstantsYts
++
++	   Usage:
++	      macro=ConstantsYtsEnum()
++	"""
++
++	return StringToEnum('ConstantsYts')
++
++def DiagnosticAbstolEnum():
++	"""
++	DIAGNOSTICABSTOLENUM - Enum of DiagnosticAbstol
++
++	   Usage:
++	      macro=DiagnosticAbstolEnum()
++	"""
++
++	return StringToEnum('DiagnosticAbstol')
++
++def DiagnosticIcefrontEnum():
++	"""
++	DIAGNOSTICICEFRONTENUM - Enum of DiagnosticIcefront
++
++	   Usage:
++	      macro=DiagnosticIcefrontEnum()
++	"""
++
++	return StringToEnum('DiagnosticIcefront')
++
++def DiagnosticIsnewtonEnum():
++	"""
++	DIAGNOSTICISNEWTONENUM - Enum of DiagnosticIsnewton
++
++	   Usage:
++	      macro=DiagnosticIsnewtonEnum()
++	"""
++
++	return StringToEnum('DiagnosticIsnewton')
++
++def DiagnosticMaxiterEnum():
++	"""
++	DIAGNOSTICMAXITERENUM - Enum of DiagnosticMaxiter
++
++	   Usage:
++	      macro=DiagnosticMaxiterEnum()
++	"""
++
++	return StringToEnum('DiagnosticMaxiter')
++
++def DiagnosticNumRequestedOutputsEnum():
++	"""
++	DIAGNOSTICNUMREQUESTEDOUTPUTSENUM - Enum of DiagnosticNumRequestedOutputs
++
++	   Usage:
++	      macro=DiagnosticNumRequestedOutputsEnum()
++	"""
++
++	return StringToEnum('DiagnosticNumRequestedOutputs')
++
++def DiagnosticPenaltyFactorEnum():
++	"""
++	DIAGNOSTICPENALTYFACTORENUM - Enum of DiagnosticPenaltyFactor
++
++	   Usage:
++	      macro=DiagnosticPenaltyFactorEnum()
++	"""
++
++	return StringToEnum('DiagnosticPenaltyFactor')
++
++def DiagnosticReferentialEnum():
++	"""
++	DIAGNOSTICREFERENTIALENUM - Enum of DiagnosticReferential
++
++	   Usage:
++	      macro=DiagnosticReferentialEnum()
++	"""
++
++	return StringToEnum('DiagnosticReferential')
++
++def DiagnosticReltolEnum():
++	"""
++	DIAGNOSTICRELTOLENUM - Enum of DiagnosticReltol
++
++	   Usage:
++	      macro=DiagnosticReltolEnum()
++	"""
++
++	return StringToEnum('DiagnosticReltol')
++
++def DiagnosticRequestedOutputsEnum():
++	"""
++	DIAGNOSTICREQUESTEDOUTPUTSENUM - Enum of DiagnosticRequestedOutputs
++
++	   Usage:
++	      macro=DiagnosticRequestedOutputsEnum()
++	"""
++
++	return StringToEnum('DiagnosticRequestedOutputs')
++
++def DiagnosticRestolEnum():
++	"""
++	DIAGNOSTICRESTOLENUM - Enum of DiagnosticRestol
++
++	   Usage:
++	      macro=DiagnosticRestolEnum()
++	"""
++
++	return StringToEnum('DiagnosticRestol')
++
++def DiagnosticRiftPenaltyLockEnum():
++	"""
++	DIAGNOSTICRIFTPENALTYLOCKENUM - Enum of DiagnosticRiftPenaltyLock
++
++	   Usage:
++	      macro=DiagnosticRiftPenaltyLockEnum()
++	"""
++
++	return StringToEnum('DiagnosticRiftPenaltyLock')
++
++def DiagnosticRiftPenaltyThresholdEnum():
++	"""
++	DIAGNOSTICRIFTPENALTYTHRESHOLDENUM - Enum of DiagnosticRiftPenaltyThreshold
++
++	   Usage:
++	      macro=DiagnosticRiftPenaltyThresholdEnum()
++	"""
++
++	return StringToEnum('DiagnosticRiftPenaltyThreshold')
++
++def DiagnosticShelfDampeningEnum():
++	"""
++	DIAGNOSTICSHELFDAMPENINGENUM - Enum of DiagnosticShelfDampening
++
++	   Usage:
++	      macro=DiagnosticShelfDampeningEnum()
++	"""
++
++	return StringToEnum('DiagnosticShelfDampening')
++
++def DiagnosticSpcvxEnum():
++	"""
++	DIAGNOSTICSPCVXENUM - Enum of DiagnosticSpcvx
++
++	   Usage:
++	      macro=DiagnosticSpcvxEnum()
++	"""
++
++	return StringToEnum('DiagnosticSpcvx')
++
++def DiagnosticSpcvyEnum():
++	"""
++	DIAGNOSTICSPCVYENUM - Enum of DiagnosticSpcvy
++
++	   Usage:
++	      macro=DiagnosticSpcvyEnum()
++	"""
++
++	return StringToEnum('DiagnosticSpcvy')
++
++def DiagnosticSpcvzEnum():
++	"""
++	DIAGNOSTICSPCVZENUM - Enum of DiagnosticSpcvz
++
++	   Usage:
++	      macro=DiagnosticSpcvzEnum()
++	"""
++
++	return StringToEnum('DiagnosticSpcvz')
++
++def DiagnosticStokesreconditioningEnum():
++	"""
++	DIAGNOSTICSTOKESRECONDITIONINGENUM - Enum of DiagnosticStokesreconditioning
++
++	   Usage:
++	      macro=DiagnosticStokesreconditioningEnum()
++	"""
++
++	return StringToEnum('DiagnosticStokesreconditioning')
++
++def DiagnosticVertexPairingEnum():
++	"""
++	DIAGNOSTICVERTEXPAIRINGENUM - Enum of DiagnosticVertexPairing
++
++	   Usage:
++	      macro=DiagnosticVertexPairingEnum()
++	"""
++
++	return StringToEnum('DiagnosticVertexPairing')
++
++def DiagnosticViscosityOvershootEnum():
++	"""
++	DIAGNOSTICVISCOSITYOVERSHOOTENUM - Enum of DiagnosticViscosityOvershoot
++
++	   Usage:
++	      macro=DiagnosticViscosityOvershootEnum()
++	"""
++
++	return StringToEnum('DiagnosticViscosityOvershoot')
++
++def FlowequationBordermacayealEnum():
++	"""
++	FLOWEQUATIONBORDERMACAYEALENUM - Enum of FlowequationBordermacayeal
++
++	   Usage:
++	      macro=FlowequationBordermacayealEnum()
++	"""
++
++	return StringToEnum('FlowequationBordermacayeal')
++
++def FlowequationBorderpattynEnum():
++	"""
++	FLOWEQUATIONBORDERPATTYNENUM - Enum of FlowequationBorderpattyn
++
++	   Usage:
++	      macro=FlowequationBorderpattynEnum()
++	"""
++
++	return StringToEnum('FlowequationBorderpattyn')
++
++def FlowequationBorderstokesEnum():
++	"""
++	FLOWEQUATIONBORDERSTOKESENUM - Enum of FlowequationBorderstokes
++
++	   Usage:
++	      macro=FlowequationBorderstokesEnum()
++	"""
++
++	return StringToEnum('FlowequationBorderstokes')
++
++def FlowequationElementEquationEnum():
++	"""
++	FLOWEQUATIONELEMENTEQUATIONENUM - Enum of FlowequationElementEquation
++
++	   Usage:
++	      macro=FlowequationElementEquationEnum()
++	"""
++
++	return StringToEnum('FlowequationElementEquation')
++
++def FlowequationIshutterEnum():
++	"""
++	FLOWEQUATIONISHUTTERENUM - Enum of FlowequationIshutter
++
++	   Usage:
++	      macro=FlowequationIshutterEnum()
++	"""
++
++	return StringToEnum('FlowequationIshutter')
++
++def FlowequationIsmacayealpattynEnum():
++	"""
++	FLOWEQUATIONISMACAYEALPATTYNENUM - Enum of FlowequationIsmacayealpattyn
++
++	   Usage:
++	      macro=FlowequationIsmacayealpattynEnum()
++	"""
++
++	return StringToEnum('FlowequationIsmacayealpattyn')
++
++def FlowequationIsstokesEnum():
++	"""
++	FLOWEQUATIONISSTOKESENUM - Enum of FlowequationIsstokes
++
++	   Usage:
++	      macro=FlowequationIsstokesEnum()
++	"""
++
++	return StringToEnum('FlowequationIsstokes')
++
++def FlowequationVertexEquationEnum():
++	"""
++	FLOWEQUATIONVERTEXEQUATIONENUM - Enum of FlowequationVertexEquation
++
++	   Usage:
++	      macro=FlowequationVertexEquationEnum()
++	"""
++
++	return StringToEnum('FlowequationVertexEquation')
++
++def FrictionCoefficientEnum():
++	"""
++	FRICTIONCOEFFICIENTENUM - Enum of FrictionCoefficient
++
++	   Usage:
++	      macro=FrictionCoefficientEnum()
++	"""
++
++	return StringToEnum('FrictionCoefficient')
++
++def FrictionPEnum():
++	"""
++	FRICTIONPENUM - Enum of FrictionP
++
++	   Usage:
++	      macro=FrictionPEnum()
++	"""
++
++	return StringToEnum('FrictionP')
++
++def FrictionQEnum():
++	"""
++	FRICTIONQENUM - Enum of FrictionQ
++
++	   Usage:
++	      macro=FrictionQEnum()
++	"""
++
++	return StringToEnum('FrictionQ')
++
++def GeometryHydrostaticRatioEnum():
++	"""
++	GEOMETRYHYDROSTATICRATIOENUM - Enum of GeometryHydrostaticRatio
++
++	   Usage:
++	      macro=GeometryHydrostaticRatioEnum()
++	"""
++
++	return StringToEnum('GeometryHydrostaticRatio')
++
++def HydrologyCREnum():
++	"""
++	HYDROLOGYCRENUM - Enum of HydrologyCR
++
++	   Usage:
++	      macro=HydrologyCREnum()
++	"""
++
++	return StringToEnum('HydrologyCR')
++
++def HydrologyKnEnum():
++	"""
++	HYDROLOGYKNENUM - Enum of HydrologyKn
++
++	   Usage:
++	      macro=HydrologyKnEnum()
++	"""
++
++	return StringToEnum('HydrologyKn')
++
++def HydrologyNEnum():
++	"""
++	HYDROLOGYNENUM - Enum of HydrologyN
++
++	   Usage:
++	      macro=HydrologyNEnum()
++	"""
++
++	return StringToEnum('HydrologyN')
++
++def HydrologyPEnum():
++	"""
++	HYDROLOGYPENUM - Enum of HydrologyP
++
++	   Usage:
++	      macro=HydrologyPEnum()
++	"""
++
++	return StringToEnum('HydrologyP')
++
++def HydrologyQEnum():
++	"""
++	HYDROLOGYQENUM - Enum of HydrologyQ
++
++	   Usage:
++	      macro=HydrologyQEnum()
++	"""
++
++	return StringToEnum('HydrologyQ')
++
++def HydrologySpcwatercolumnEnum():
++	"""
++	HYDROLOGYSPCWATERCOLUMNENUM - Enum of HydrologySpcwatercolumn
++
++	   Usage:
++	      macro=HydrologySpcwatercolumnEnum()
++	"""
++
++	return StringToEnum('HydrologySpcwatercolumn')
++
++def HydrologyStabilizationEnum():
++	"""
++	HYDROLOGYSTABILIZATIONENUM - Enum of HydrologyStabilization
++
++	   Usage:
++	      macro=HydrologyStabilizationEnum()
++	"""
++
++	return StringToEnum('HydrologyStabilization')
++
++def InversionControlParametersEnum():
++	"""
++	INVERSIONCONTROLPARAMETERSENUM - Enum of InversionControlParameters
++
++	   Usage:
++	      macro=InversionControlParametersEnum()
++	"""
++
++	return StringToEnum('InversionControlParameters')
++
++def InversionCostFunctionEnum():
++	"""
++	INVERSIONCOSTFUNCTIONENUM - Enum of InversionCostFunction
++
++	   Usage:
++	      macro=InversionCostFunctionEnum()
++	"""
++
++	return StringToEnum('InversionCostFunction')
++
++def InversionCostFunctionThresholdEnum():
++	"""
++	INVERSIONCOSTFUNCTIONTHRESHOLDENUM - Enum of InversionCostFunctionThreshold
++
++	   Usage:
++	      macro=InversionCostFunctionThresholdEnum()
++	"""
++
++	return StringToEnum('InversionCostFunctionThreshold')
++
++def InversionCostFunctionsCoefficientsEnum():
++	"""
++	INVERSIONCOSTFUNCTIONSCOEFFICIENTSENUM - Enum of InversionCostFunctionsCoefficients
++
++	   Usage:
++	      macro=InversionCostFunctionsCoefficientsEnum()
++	"""
++
++	return StringToEnum('InversionCostFunctionsCoefficients')
++
++def InversionCostFunctionsEnum():
++	"""
++	INVERSIONCOSTFUNCTIONSENUM - Enum of InversionCostFunctions
++
++	   Usage:
++	      macro=InversionCostFunctionsEnum()
++	"""
++
++	return StringToEnum('InversionCostFunctions')
++
++def InversionGradientOnlyEnum():
++	"""
++	INVERSIONGRADIENTONLYENUM - Enum of InversionGradientOnly
++
++	   Usage:
++	      macro=InversionGradientOnlyEnum()
++	"""
++
++	return StringToEnum('InversionGradientOnly')
++
++def InversionGradientScalingEnum():
++	"""
++	INVERSIONGRADIENTSCALINGENUM - Enum of InversionGradientScaling
++
++	   Usage:
++	      macro=InversionGradientScalingEnum()
++	"""
++
++	return StringToEnum('InversionGradientScaling')
++
++def InversionIscontrolEnum():
++	"""
++	INVERSIONISCONTROLENUM - Enum of InversionIscontrol
++
++	   Usage:
++	      macro=InversionIscontrolEnum()
++	"""
++
++	return StringToEnum('InversionIscontrol')
++
++def InversionTaoEnum():
++	"""
++	INVERSIONTAOENUM - Enum of InversionTao
++
++	   Usage:
++	      macro=InversionTaoEnum()
++	"""
++
++	return StringToEnum('InversionTao')
++
++def InversionIncompleteAdjointEnum():
++	"""
++	INVERSIONINCOMPLETEADJOINTENUM - Enum of InversionIncompleteAdjoint
++
++	   Usage:
++	      macro=InversionIncompleteAdjointEnum()
++	"""
++
++	return StringToEnum('InversionIncompleteAdjoint')
++
++def InversionMaxParametersEnum():
++	"""
++	INVERSIONMAXPARAMETERSENUM - Enum of InversionMaxParameters
++
++	   Usage:
++	      macro=InversionMaxParametersEnum()
++	"""
++
++	return StringToEnum('InversionMaxParameters')
++
++def InversionMaxiterPerStepEnum():
++	"""
++	INVERSIONMAXITERPERSTEPENUM - Enum of InversionMaxiterPerStep
++
++	   Usage:
++	      macro=InversionMaxiterPerStepEnum()
++	"""
++
++	return StringToEnum('InversionMaxiterPerStep')
++
++def InversionMinParametersEnum():
++	"""
++	INVERSIONMINPARAMETERSENUM - Enum of InversionMinParameters
++
++	   Usage:
++	      macro=InversionMinParametersEnum()
++	"""
++
++	return StringToEnum('InversionMinParameters')
++
++def InversionNstepsEnum():
++	"""
++	INVERSIONNSTEPSENUM - Enum of InversionNsteps
++
++	   Usage:
++	      macro=InversionNstepsEnum()
++	"""
++
++	return StringToEnum('InversionNsteps')
++
++def InversionNumControlParametersEnum():
++	"""
++	INVERSIONNUMCONTROLPARAMETERSENUM - Enum of InversionNumControlParameters
++
++	   Usage:
++	      macro=InversionNumControlParametersEnum()
++	"""
++
++	return StringToEnum('InversionNumControlParameters')
++
++def InversionNumCostFunctionsEnum():
++	"""
++	INVERSIONNUMCOSTFUNCTIONSENUM - Enum of InversionNumCostFunctions
++
++	   Usage:
++	      macro=InversionNumCostFunctionsEnum()
++	"""
++
++	return StringToEnum('InversionNumCostFunctions')
++
++def InversionStepThresholdEnum():
++	"""
++	INVERSIONSTEPTHRESHOLDENUM - Enum of InversionStepThreshold
++
++	   Usage:
++	      macro=InversionStepThresholdEnum()
++	"""
++
++	return StringToEnum('InversionStepThreshold')
++
++def InversionThicknessObsEnum():
++	"""
++	INVERSIONTHICKNESSOBSENUM - Enum of InversionThicknessObs
++
++	   Usage:
++	      macro=InversionThicknessObsEnum()
++	"""
++
++	return StringToEnum('InversionThicknessObs')
++
++def InversionVelObsEnum():
++	"""
++	INVERSIONVELOBSENUM - Enum of InversionVelObs
++
++	   Usage:
++	      macro=InversionVelObsEnum()
++	"""
++
++	return StringToEnum('InversionVelObs')
++
++def InversionVxObsEnum():
++	"""
++	INVERSIONVXOBSENUM - Enum of InversionVxObs
++
++	   Usage:
++	      macro=InversionVxObsEnum()
++	"""
++
++	return StringToEnum('InversionVxObs')
++
++def InversionVyObsEnum():
++	"""
++	INVERSIONVYOBSENUM - Enum of InversionVyObs
++
++	   Usage:
++	      macro=InversionVyObsEnum()
++	"""
++
++	return StringToEnum('InversionVyObs')
++
++def InversionVzObsEnum():
++	"""
++	INVERSIONVZOBSENUM - Enum of InversionVzObs
++
++	   Usage:
++	      macro=InversionVzObsEnum()
++	"""
++
++	return StringToEnum('InversionVzObs')
++
++def MaskElementonfloatingiceEnum():
++	"""
++	MASKELEMENTONFLOATINGICEENUM - Enum of MaskElementonfloatingice
++
++	   Usage:
++	      macro=MaskElementonfloatingiceEnum()
++	"""
++
++	return StringToEnum('MaskElementonfloatingice')
++
++def MaskElementongroundediceEnum():
++	"""
++	MASKELEMENTONGROUNDEDICEENUM - Enum of MaskElementongroundedice
++
++	   Usage:
++	      macro=MaskElementongroundediceEnum()
++	"""
++
++	return StringToEnum('MaskElementongroundedice')
++
++def MaskElementonwaterEnum():
++	"""
++	MASKELEMENTONWATERENUM - Enum of MaskElementonwater
++
++	   Usage:
++	      macro=MaskElementonwaterEnum()
++	"""
++
++	return StringToEnum('MaskElementonwater')
++
++def MaskVertexonfloatingiceEnum():
++	"""
++	MASKVERTEXONFLOATINGICEENUM - Enum of MaskVertexonfloatingice
++
++	   Usage:
++	      macro=MaskVertexonfloatingiceEnum()
++	"""
++
++	return StringToEnum('MaskVertexonfloatingice')
++
++def MaskVertexongroundediceEnum():
++	"""
++	MASKVERTEXONGROUNDEDICEENUM - Enum of MaskVertexongroundedice
++
++	   Usage:
++	      macro=MaskVertexongroundediceEnum()
++	"""
++
++	return StringToEnum('MaskVertexongroundedice')
++
++def MaskVertexonwaterEnum():
++	"""
++	MASKVERTEXONWATERENUM - Enum of MaskVertexonwater
++
++	   Usage:
++	      macro=MaskVertexonwaterEnum()
++	"""
++
++	return StringToEnum('MaskVertexonwater')
++
++def MaterialsBetaEnum():
++	"""
++	MATERIALSBETAENUM - Enum of MaterialsBeta
++
++	   Usage:
++	      macro=MaterialsBetaEnum()
++	"""
++
++	return StringToEnum('MaterialsBeta')
++
++def MaterialsHeatcapacityEnum():
++	"""
++	MATERIALSHEATCAPACITYENUM - Enum of MaterialsHeatcapacity
++
++	   Usage:
++	      macro=MaterialsHeatcapacityEnum()
++	"""
++
++	return StringToEnum('MaterialsHeatcapacity')
++
++def MaterialsLatentheatEnum():
++	"""
++	MATERIALSLATENTHEATENUM - Enum of MaterialsLatentheat
++
++	   Usage:
++	      macro=MaterialsLatentheatEnum()
++	"""
++
++	return StringToEnum('MaterialsLatentheat')
++
++def MaterialsMeltingpointEnum():
++	"""
++	MATERIALSMELTINGPOINTENUM - Enum of MaterialsMeltingpoint
++
++	   Usage:
++	      macro=MaterialsMeltingpointEnum()
++	"""
++
++	return StringToEnum('MaterialsMeltingpoint')
++
++def MaterialsMixedLayerCapacityEnum():
++	"""
++	MATERIALSMIXEDLAYERCAPACITYENUM - Enum of MaterialsMixedLayerCapacity
++
++	   Usage:
++	      macro=MaterialsMixedLayerCapacityEnum()
++	"""
++
++	return StringToEnum('MaterialsMixedLayerCapacity')
++
++def MaterialsRheologyBEnum():
++	"""
++	MATERIALSRHEOLOGYBENUM - Enum of MaterialsRheologyB
++
++	   Usage:
++	      macro=MaterialsRheologyBEnum()
++	"""
++
++	return StringToEnum('MaterialsRheologyB')
++
++def MaterialsRheologyBbarEnum():
++	"""
++	MATERIALSRHEOLOGYBBARENUM - Enum of MaterialsRheologyBbar
++
++	   Usage:
++	      macro=MaterialsRheologyBbarEnum()
++	"""
++
++	return StringToEnum('MaterialsRheologyBbar')
++
++def MaterialsRheologyLawEnum():
++	"""
++	MATERIALSRHEOLOGYLAWENUM - Enum of MaterialsRheologyLaw
++
++	   Usage:
++	      macro=MaterialsRheologyLawEnum()
++	"""
++
++	return StringToEnum('MaterialsRheologyLaw')
++
++def MaterialsRheologyNEnum():
++	"""
++	MATERIALSRHEOLOGYNENUM - Enum of MaterialsRheologyN
++
++	   Usage:
++	      macro=MaterialsRheologyNEnum()
++	"""
++
++	return StringToEnum('MaterialsRheologyN')
++
++def MaterialsRhoIceEnum():
++	"""
++	MATERIALSRHOICEENUM - Enum of MaterialsRhoIce
++
++	   Usage:
++	      macro=MaterialsRhoIceEnum()
++	"""
++
++	return StringToEnum('MaterialsRhoIce')
++
++def MaterialsRhoWaterEnum():
++	"""
++	MATERIALSRHOWATERENUM - Enum of MaterialsRhoWater
++
++	   Usage:
++	      macro=MaterialsRhoWaterEnum()
++	"""
++
++	return StringToEnum('MaterialsRhoWater')
++
++def MaterialsRhoFreshwaterEnum():
++	"""
++	MATERIALSRHOFRESHWATERENUM - Enum of MaterialsRhoFreshwater
++
++	   Usage:
++	      macro=MaterialsRhoFreshwaterEnum()
++	"""
++
++	return StringToEnum('MaterialsRhoFreshwater')
++
++def MaterialsMuWaterEnum():
++	"""
++	MATERIALSMUWATERENUM - Enum of MaterialsMuWater
++
++	   Usage:
++	      macro=MaterialsMuWaterEnum()
++	"""
++
++	return StringToEnum('MaterialsMuWater')
++
++def MaterialsThermalExchangeVelocityEnum():
++	"""
++	MATERIALSTHERMALEXCHANGEVELOCITYENUM - Enum of MaterialsThermalExchangeVelocity
++
++	   Usage:
++	      macro=MaterialsThermalExchangeVelocityEnum()
++	"""
++
++	return StringToEnum('MaterialsThermalExchangeVelocity')
++
++def MaterialsThermalconductivityEnum():
++	"""
++	MATERIALSTHERMALCONDUCTIVITYENUM - Enum of MaterialsThermalconductivity
++
++	   Usage:
++	      macro=MaterialsThermalconductivityEnum()
++	"""
++
++	return StringToEnum('MaterialsThermalconductivity')
++
++def MeshAverageVertexConnectivityEnum():
++	"""
++	MESHAVERAGEVERTEXCONNECTIVITYENUM - Enum of MeshAverageVertexConnectivity
++
++	   Usage:
++	      macro=MeshAverageVertexConnectivityEnum()
++	"""
++
++	return StringToEnum('MeshAverageVertexConnectivity')
++
++def MeshDimensionEnum():
++	"""
++	MESHDIMENSIONENUM - Enum of MeshDimension
++
++	   Usage:
++	      macro=MeshDimensionEnum()
++	"""
++
++	return StringToEnum('MeshDimension')
++
++def MeshEdgesEnum():
++	"""
++	MESHEDGESENUM - Enum of MeshEdges
++
++	   Usage:
++	      macro=MeshEdgesEnum()
++	"""
++
++	return StringToEnum('MeshEdges')
++
++def MeshElementconnectivityEnum():
++	"""
++	MESHELEMENTCONNECTIVITYENUM - Enum of MeshElementconnectivity
++
++	   Usage:
++	      macro=MeshElementconnectivityEnum()
++	"""
++
++	return StringToEnum('MeshElementconnectivity')
++
++def MeshElementonbedEnum():
++	"""
++	MESHELEMENTONBEDENUM - Enum of MeshElementonbed
++
++	   Usage:
++	      macro=MeshElementonbedEnum()
++	"""
++
++	return StringToEnum('MeshElementonbed')
++
++def MeshElementonsurfaceEnum():
++	"""
++	MESHELEMENTONSURFACEENUM - Enum of MeshElementonsurface
++
++	   Usage:
++	      macro=MeshElementonsurfaceEnum()
++	"""
++
++	return StringToEnum('MeshElementonsurface')
++
++def MeshElements2dEnum():
++	"""
++	MESHELEMENTS2DENUM - Enum of MeshElements2d
++
++	   Usage:
++	      macro=MeshElements2dEnum()
++	"""
++
++	return StringToEnum('MeshElements2d')
++
++def MeshElementsEnum():
++	"""
++	MESHELEMENTSENUM - Enum of MeshElements
++
++	   Usage:
++	      macro=MeshElementsEnum()
++	"""
++
++	return StringToEnum('MeshElements')
++
++def MeshLowerelementsEnum():
++	"""
++	MESHLOWERELEMENTSENUM - Enum of MeshLowerelements
++
++	   Usage:
++	      macro=MeshLowerelementsEnum()
++	"""
++
++	return StringToEnum('MeshLowerelements')
++
++def MeshNumberofedgesEnum():
++	"""
++	MESHNUMBEROFEDGESENUM - Enum of MeshNumberofedges
++
++	   Usage:
++	      macro=MeshNumberofedgesEnum()
++	"""
++
++	return StringToEnum('MeshNumberofedges')
++
++def MeshNumberofelements2dEnum():
++	"""
++	MESHNUMBEROFELEMENTS2DENUM - Enum of MeshNumberofelements2d
++
++	   Usage:
++	      macro=MeshNumberofelements2dEnum()
++	"""
++
++	return StringToEnum('MeshNumberofelements2d')
++
++def MeshNumberofelementsEnum():
++	"""
++	MESHNUMBEROFELEMENTSENUM - Enum of MeshNumberofelements
++
++	   Usage:
++	      macro=MeshNumberofelementsEnum()
++	"""
++
++	return StringToEnum('MeshNumberofelements')
++
++def MeshNumberoflayersEnum():
++	"""
++	MESHNUMBEROFLAYERSENUM - Enum of MeshNumberoflayers
++
++	   Usage:
++	      macro=MeshNumberoflayersEnum()
++	"""
++
++	return StringToEnum('MeshNumberoflayers')
++
++def MeshNumberofvertices2dEnum():
++	"""
++	MESHNUMBEROFVERTICES2DENUM - Enum of MeshNumberofvertices2d
++
++	   Usage:
++	      macro=MeshNumberofvertices2dEnum()
++	"""
++
++	return StringToEnum('MeshNumberofvertices2d')
++
++def MeshNumberofverticesEnum():
++	"""
++	MESHNUMBEROFVERTICESENUM - Enum of MeshNumberofvertices
++
++	   Usage:
++	      macro=MeshNumberofverticesEnum()
++	"""
++
++	return StringToEnum('MeshNumberofvertices')
++
++def MeshUpperelementsEnum():
++	"""
++	MESHUPPERELEMENTSENUM - Enum of MeshUpperelements
++
++	   Usage:
++	      macro=MeshUpperelementsEnum()
++	"""
++
++	return StringToEnum('MeshUpperelements')
++
++def MeshVertexonbedEnum():
++	"""
++	MESHVERTEXONBEDENUM - Enum of MeshVertexonbed
++
++	   Usage:
++	      macro=MeshVertexonbedEnum()
++	"""
++
++	return StringToEnum('MeshVertexonbed')
++
++def MeshVertexonsurfaceEnum():
++	"""
++	MESHVERTEXONSURFACEENUM - Enum of MeshVertexonsurface
++
++	   Usage:
++	      macro=MeshVertexonsurfaceEnum()
++	"""
++
++	return StringToEnum('MeshVertexonsurface')
++
++def MeshXEnum():
++	"""
++	MESHXENUM - Enum of MeshX
++
++	   Usage:
++	      macro=MeshXEnum()
++	"""
++
++	return StringToEnum('MeshX')
++
++def MeshYEnum():
++	"""
++	MESHYENUM - Enum of MeshY
++
++	   Usage:
++	      macro=MeshYEnum()
++	"""
++
++	return StringToEnum('MeshY')
++
++def MeshZEnum():
++	"""
++	MESHZENUM - Enum of MeshZ
++
++	   Usage:
++	      macro=MeshZEnum()
++	"""
++
++	return StringToEnum('MeshZ')
++
++def MiscellaneousNameEnum():
++	"""
++	MISCELLANEOUSNAMEENUM - Enum of MiscellaneousName
++
++	   Usage:
++	      macro=MiscellaneousNameEnum()
++	"""
++
++	return StringToEnum('MiscellaneousName')
++
++def PrognosticHydrostaticAdjustmentEnum():
++	"""
++	PROGNOSTICHYDROSTATICADJUSTMENTENUM - Enum of PrognosticHydrostaticAdjustment
++
++	   Usage:
++	      macro=PrognosticHydrostaticAdjustmentEnum()
++	"""
++
++	return StringToEnum('PrognosticHydrostaticAdjustment')
++
++def PrognosticMinThicknessEnum():
++	"""
++	PROGNOSTICMINTHICKNESSENUM - Enum of PrognosticMinThickness
++
++	   Usage:
++	      macro=PrognosticMinThicknessEnum()
++	"""
++
++	return StringToEnum('PrognosticMinThickness')
++
++def PrognosticPenaltyFactorEnum():
++	"""
++	PROGNOSTICPENALTYFACTORENUM - Enum of PrognosticPenaltyFactor
++
++	   Usage:
++	      macro=PrognosticPenaltyFactorEnum()
++	"""
++
++	return StringToEnum('PrognosticPenaltyFactor')
++
++def PrognosticSpcthicknessEnum():
++	"""
++	PROGNOSTICSPCTHICKNESSENUM - Enum of PrognosticSpcthickness
++
++	   Usage:
++	      macro=PrognosticSpcthicknessEnum()
++	"""
++
++	return StringToEnum('PrognosticSpcthickness')
++
++def PrognosticStabilizationEnum():
++	"""
++	PROGNOSTICSTABILIZATIONENUM - Enum of PrognosticStabilization
++
++	   Usage:
++	      macro=PrognosticStabilizationEnum()
++	"""
++
++	return StringToEnum('PrognosticStabilization')
++
++def PrognosticVertexPairingEnum():
++	"""
++	PROGNOSTICVERTEXPAIRINGENUM - Enum of PrognosticVertexPairing
++
++	   Usage:
++	      macro=PrognosticVertexPairingEnum()
++	"""
++
++	return StringToEnum('PrognosticVertexPairing')
++
++def QmuIsdakotaEnum():
++	"""
++	QMUISDAKOTAENUM - Enum of QmuIsdakota
++
++	   Usage:
++	      macro=QmuIsdakotaEnum()
++	"""
++
++	return StringToEnum('QmuIsdakota')
++
++def QmuMassFluxSegmentsEnum():
++	"""
++	QMUMASSFLUXSEGMENTSENUM - Enum of QmuMassFluxSegments
++
++	   Usage:
++	      macro=QmuMassFluxSegmentsEnum()
++	"""
++
++	return StringToEnum('QmuMassFluxSegments')
++
++def QmuNumberofpartitionsEnum():
++	"""
++	QMUNUMBEROFPARTITIONSENUM - Enum of QmuNumberofpartitions
++
++	   Usage:
++	      macro=QmuNumberofpartitionsEnum()
++	"""
++
++	return StringToEnum('QmuNumberofpartitions')
++
++def QmuNumberofresponsesEnum():
++	"""
++	QMUNUMBEROFRESPONSESENUM - Enum of QmuNumberofresponses
++
++	   Usage:
++	      macro=QmuNumberofresponsesEnum()
++	"""
++
++	return StringToEnum('QmuNumberofresponses')
++
++def QmuPartitionEnum():
++	"""
++	QMUPARTITIONENUM - Enum of QmuPartition
++
++	   Usage:
++	      macro=QmuPartitionEnum()
++	"""
++
++	return StringToEnum('QmuPartition')
++
++def QmuResponsedescriptorsEnum():
++	"""
++	QMURESPONSEDESCRIPTORSENUM - Enum of QmuResponsedescriptors
++
++	   Usage:
++	      macro=QmuResponsedescriptorsEnum()
++	"""
++
++	return StringToEnum('QmuResponsedescriptors')
++
++def QmuVariabledescriptorsEnum():
++	"""
++	QMUVARIABLEDESCRIPTORSENUM - Enum of QmuVariabledescriptors
++
++	   Usage:
++	      macro=QmuVariabledescriptorsEnum()
++	"""
++
++	return StringToEnum('QmuVariabledescriptors')
++
++def RiftsNumriftsEnum():
++	"""
++	RIFTSNUMRIFTSENUM - Enum of RiftsNumrifts
++
++	   Usage:
++	      macro=RiftsNumriftsEnum()
++	"""
++
++	return StringToEnum('RiftsNumrifts')
++
++def RiftsRiftstructEnum():
++	"""
++	RIFTSRIFTSTRUCTENUM - Enum of RiftsRiftstruct
++
++	   Usage:
++	      macro=RiftsRiftstructEnum()
++	"""
++
++	return StringToEnum('RiftsRiftstruct')
++
++def SettingsIoGatherEnum():
++	"""
++	SETTINGSIOGATHERENUM - Enum of SettingsIoGather
++
++	   Usage:
++	      macro=SettingsIoGatherEnum()
++	"""
++
++	return StringToEnum('SettingsIoGather')
++
++def SettingsLowmemEnum():
++	"""
++	SETTINGSLOWMEMENUM - Enum of SettingsLowmem
++
++	   Usage:
++	      macro=SettingsLowmemEnum()
++	"""
++
++	return StringToEnum('SettingsLowmem')
++
++def SettingsOutputFrequencyEnum():
++	"""
++	SETTINGSOUTPUTFREQUENCYENUM - Enum of SettingsOutputFrequency
++
++	   Usage:
++	      macro=SettingsOutputFrequencyEnum()
++	"""
++
++	return StringToEnum('SettingsOutputFrequency')
++
++def SettingsResultsAsPatchesEnum():
++	"""
++	SETTINGSRESULTSASPATCHESENUM - Enum of SettingsResultsAsPatches
++
++	   Usage:
++	      macro=SettingsResultsAsPatchesEnum()
++	"""
++
++	return StringToEnum('SettingsResultsAsPatches')
++
++def SettingsWaitonlockEnum():
++	"""
++	SETTINGSWAITONLOCKENUM - Enum of SettingsWaitonlock
++
++	   Usage:
++	      macro=SettingsWaitonlockEnum()
++	"""
++
++	return StringToEnum('SettingsWaitonlock')
++
++def DebugPetscProfilingEnum():
++	"""
++	DEBUGPETSCPROFILINGENUM - Enum of DebugPetscProfiling
++
++	   Usage:
++	      macro=DebugPetscProfilingEnum()
++	"""
++
++	return StringToEnum('DebugPetscProfiling')
++
++def PetscProfilingCurrentMemEnum():
++	"""
++	PETSCPROFILINGCURRENTMEMENUM - Enum of PetscProfilingCurrentMem
++
++	   Usage:
++	      macro=PetscProfilingCurrentMemEnum()
++	"""
++
++	return StringToEnum('PetscProfilingCurrentMem')
++
++def PetscProfilingCurrentFlopsEnum():
++	"""
++	PETSCPROFILINGCURRENTFLOPSENUM - Enum of PetscProfilingCurrentFlops
++
++	   Usage:
++	      macro=PetscProfilingCurrentFlopsEnum()
++	"""
++
++	return StringToEnum('PetscProfilingCurrentFlops')
++
++def PetscProfilingSolutionTimeEnum():
++	"""
++	PETSCPROFILINGSOLUTIONTIMEENUM - Enum of PetscProfilingSolutionTime
++
++	   Usage:
++	      macro=PetscProfilingSolutionTimeEnum()
++	"""
++
++	return StringToEnum('PetscProfilingSolutionTime')
++
++def MaxIterationConvergenceFlagEnum():
++	"""
++	MAXITERATIONCONVERGENCEFLAGENUM - Enum of MaxIterationConvergenceFlag
++
++	   Usage:
++	      macro=MaxIterationConvergenceFlagEnum()
++	"""
++
++	return StringToEnum('MaxIterationConvergenceFlag')
++
++def SteadystateMaxiterEnum():
++	"""
++	STEADYSTATEMAXITERENUM - Enum of SteadystateMaxiter
++
++	   Usage:
++	      macro=SteadystateMaxiterEnum()
++	"""
++
++	return StringToEnum('SteadystateMaxiter')
++
++def SteadystateNumRequestedOutputsEnum():
++	"""
++	STEADYSTATENUMREQUESTEDOUTPUTSENUM - Enum of SteadystateNumRequestedOutputs
++
++	   Usage:
++	      macro=SteadystateNumRequestedOutputsEnum()
++	"""
++
++	return StringToEnum('SteadystateNumRequestedOutputs')
++
++def SteadystateReltolEnum():
++	"""
++	STEADYSTATERELTOLENUM - Enum of SteadystateReltol
++
++	   Usage:
++	      macro=SteadystateReltolEnum()
++	"""
++
++	return StringToEnum('SteadystateReltol')
++
++def SteadystateRequestedOutputsEnum():
++	"""
++	STEADYSTATEREQUESTEDOUTPUTSENUM - Enum of SteadystateRequestedOutputs
++
++	   Usage:
++	      macro=SteadystateRequestedOutputsEnum()
++	"""
++
++	return StringToEnum('SteadystateRequestedOutputs')
++
++def SurfaceEnum():
++	"""
++	SURFACEENUM - Enum of Surface
++
++	   Usage:
++	      macro=SurfaceEnum()
++	"""
++
++	return StringToEnum('Surface')
++
++def SurfaceforcingsPrecipitationEnum():
++	"""
++	SURFACEFORCINGSPRECIPITATIONENUM - Enum of SurfaceforcingsPrecipitation
++
++	   Usage:
++	      macro=SurfaceforcingsPrecipitationEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsPrecipitation')
++
++def SurfaceforcingsMassBalanceEnum():
++	"""
++	SURFACEFORCINGSMASSBALANCEENUM - Enum of SurfaceforcingsMassBalance
++
++	   Usage:
++	      macro=SurfaceforcingsMassBalanceEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsMassBalance')
++
++def SurfaceforcingsIspddEnum():
++	"""
++	SURFACEFORCINGSISPDDENUM - Enum of SurfaceforcingsIspdd
++
++	   Usage:
++	      macro=SurfaceforcingsIspddEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsIspdd')
++
++def SurfaceforcingsIssmbgradientsEnum():
++	"""
++	SURFACEFORCINGSISSMBGRADIENTSENUM - Enum of SurfaceforcingsIssmbgradients
++
++	   Usage:
++	      macro=SurfaceforcingsIssmbgradientsEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsIssmbgradients')
++
++def SurfaceforcingsMonthlytemperaturesEnum():
++	"""
++	SURFACEFORCINGSMONTHLYTEMPERATURESENUM - Enum of SurfaceforcingsMonthlytemperatures
++
++	   Usage:
++	      macro=SurfaceforcingsMonthlytemperaturesEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsMonthlytemperatures')
++
++def SurfaceforcingsHcEnum():
++	"""
++	SURFACEFORCINGSHCENUM - Enum of SurfaceforcingsHc
++
++	   Usage:
++	      macro=SurfaceforcingsHcEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsHc')
++
++def SurfaceforcingsSmbPosMaxEnum():
++	"""
++	SURFACEFORCINGSSMBPOSMAXENUM - Enum of SurfaceforcingsSmbPosMax
++
++	   Usage:
++	      macro=SurfaceforcingsSmbPosMaxEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsSmbPosMax')
++
++def SurfaceforcingsSmbPosMinEnum():
++	"""
++	SURFACEFORCINGSSMBPOSMINENUM - Enum of SurfaceforcingsSmbPosMin
++
++	   Usage:
++	      macro=SurfaceforcingsSmbPosMinEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsSmbPosMin')
++
++def SurfaceforcingsAPosEnum():
++	"""
++	SURFACEFORCINGSAPOSENUM - Enum of SurfaceforcingsAPos
++
++	   Usage:
++	      macro=SurfaceforcingsAPosEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsAPos')
++
++def SurfaceforcingsBPosEnum():
++	"""
++	SURFACEFORCINGSBPOSENUM - Enum of SurfaceforcingsBPos
++
++	   Usage:
++	      macro=SurfaceforcingsBPosEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsBPos')
++
++def SurfaceforcingsANegEnum():
++	"""
++	SURFACEFORCINGSANEGENUM - Enum of SurfaceforcingsANeg
++
++	   Usage:
++	      macro=SurfaceforcingsANegEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsANeg')
++
++def SurfaceforcingsBNegEnum():
++	"""
++	SURFACEFORCINGSBNEGENUM - Enum of SurfaceforcingsBNeg
++
++	   Usage:
++	      macro=SurfaceforcingsBNegEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsBNeg')
++
++def ThermalMaxiterEnum():
++	"""
++	THERMALMAXITERENUM - Enum of ThermalMaxiter
++
++	   Usage:
++	      macro=ThermalMaxiterEnum()
++	"""
++
++	return StringToEnum('ThermalMaxiter')
++
++def ThermalPenaltyFactorEnum():
++	"""
++	THERMALPENALTYFACTORENUM - Enum of ThermalPenaltyFactor
++
++	   Usage:
++	      macro=ThermalPenaltyFactorEnum()
++	"""
++
++	return StringToEnum('ThermalPenaltyFactor')
++
++def ThermalPenaltyLockEnum():
++	"""
++	THERMALPENALTYLOCKENUM - Enum of ThermalPenaltyLock
++
++	   Usage:
++	      macro=ThermalPenaltyLockEnum()
++	"""
++
++	return StringToEnum('ThermalPenaltyLock')
++
++def ThermalPenaltyThresholdEnum():
++	"""
++	THERMALPENALTYTHRESHOLDENUM - Enum of ThermalPenaltyThreshold
++
++	   Usage:
++	      macro=ThermalPenaltyThresholdEnum()
++	"""
++
++	return StringToEnum('ThermalPenaltyThreshold')
++
++def ThermalSpctemperatureEnum():
++	"""
++	THERMALSPCTEMPERATUREENUM - Enum of ThermalSpctemperature
++
++	   Usage:
++	      macro=ThermalSpctemperatureEnum()
++	"""
++
++	return StringToEnum('ThermalSpctemperature')
++
++def ThermalStabilizationEnum():
++	"""
++	THERMALSTABILIZATIONENUM - Enum of ThermalStabilization
++
++	   Usage:
++	      macro=ThermalStabilizationEnum()
++	"""
++
++	return StringToEnum('ThermalStabilization')
++
++def ThermalIsenthalpyEnum():
++	"""
++	THERMALISENTHALPYENUM - Enum of ThermalIsenthalpy
++
++	   Usage:
++	      macro=ThermalIsenthalpyEnum()
++	"""
++
++	return StringToEnum('ThermalIsenthalpy')
++
++def ThicknessEnum():
++	"""
++	THICKNESSENUM - Enum of Thickness
++
++	   Usage:
++	      macro=ThicknessEnum()
++	"""
++
++	return StringToEnum('Thickness')
++
++def TimesteppingStartTimeEnum():
++	"""
++	TIMESTEPPINGSTARTTIMEENUM - Enum of TimesteppingStartTime
++
++	   Usage:
++	      macro=TimesteppingStartTimeEnum()
++	"""
++
++	return StringToEnum('TimesteppingStartTime')
++
++def TimesteppingFinalTimeEnum():
++	"""
++	TIMESTEPPINGFINALTIMEENUM - Enum of TimesteppingFinalTime
++
++	   Usage:
++	      macro=TimesteppingFinalTimeEnum()
++	"""
++
++	return StringToEnum('TimesteppingFinalTime')
++
++def TimesteppingCflCoefficientEnum():
++	"""
++	TIMESTEPPINGCFLCOEFFICIENTENUM - Enum of TimesteppingCflCoefficient
++
++	   Usage:
++	      macro=TimesteppingCflCoefficientEnum()
++	"""
++
++	return StringToEnum('TimesteppingCflCoefficient')
++
++def TimesteppingTimeAdaptEnum():
++	"""
++	TIMESTEPPINGTIMEADAPTENUM - Enum of TimesteppingTimeAdapt
++
++	   Usage:
++	      macro=TimesteppingTimeAdaptEnum()
++	"""
++
++	return StringToEnum('TimesteppingTimeAdapt')
++
++def TimesteppingTimeStepEnum():
++	"""
++	TIMESTEPPINGTIMESTEPENUM - Enum of TimesteppingTimeStep
++
++	   Usage:
++	      macro=TimesteppingTimeStepEnum()
++	"""
++
++	return StringToEnum('TimesteppingTimeStep')
++
++def TransientIsdiagnosticEnum():
++	"""
++	TRANSIENTISDIAGNOSTICENUM - Enum of TransientIsdiagnostic
++
++	   Usage:
++	      macro=TransientIsdiagnosticEnum()
++	"""
++
++	return StringToEnum('TransientIsdiagnostic')
++
++def TransientIsgroundinglineEnum():
++	"""
++	TRANSIENTISGROUNDINGLINEENUM - Enum of TransientIsgroundingline
++
++	   Usage:
++	      macro=TransientIsgroundinglineEnum()
++	"""
++
++	return StringToEnum('TransientIsgroundingline')
++
++def TransientIsprognosticEnum():
++	"""
++	TRANSIENTISPROGNOSTICENUM - Enum of TransientIsprognostic
++
++	   Usage:
++	      macro=TransientIsprognosticEnum()
++	"""
++
++	return StringToEnum('TransientIsprognostic')
++
++def TransientIsthermalEnum():
++	"""
++	TRANSIENTISTHERMALENUM - Enum of TransientIsthermal
++
++	   Usage:
++	      macro=TransientIsthermalEnum()
++	"""
++
++	return StringToEnum('TransientIsthermal')
++
++def TransientNumRequestedOutputsEnum():
++	"""
++	TRANSIENTNUMREQUESTEDOUTPUTSENUM - Enum of TransientNumRequestedOutputs
++
++	   Usage:
++	      macro=TransientNumRequestedOutputsEnum()
++	"""
++
++	return StringToEnum('TransientNumRequestedOutputs')
++
++def TransientRequestedOutputsEnum():
++	"""
++	TRANSIENTREQUESTEDOUTPUTSENUM - Enum of TransientRequestedOutputs
++
++	   Usage:
++	      macro=TransientRequestedOutputsEnum()
++	"""
++
++	return StringToEnum('TransientRequestedOutputs')
++
++def SolutionTypeEnum():
++	"""
++	SOLUTIONTYPEENUM - Enum of SolutionType
++
++	   Usage:
++	      macro=SolutionTypeEnum()
++	"""
++
++	return StringToEnum('SolutionType')
++
++def AnalysisTypeEnum():
++	"""
++	ANALYSISTYPEENUM - Enum of AnalysisType
++
++	   Usage:
++	      macro=AnalysisTypeEnum()
++	"""
++
++	return StringToEnum('AnalysisType')
++
++def ConfigurationTypeEnum():
++	"""
++	CONFIGURATIONTYPEENUM - Enum of ConfigurationType
++
++	   Usage:
++	      macro=ConfigurationTypeEnum()
++	"""
++
++	return StringToEnum('ConfigurationType')
++
++def AdjointBalancethicknessAnalysisEnum():
++	"""
++	ADJOINTBALANCETHICKNESSANALYSISENUM - Enum of AdjointBalancethicknessAnalysis
++
++	   Usage:
++	      macro=AdjointBalancethicknessAnalysisEnum()
++	"""
++
++	return StringToEnum('AdjointBalancethicknessAnalysis')
++
++def AdjointHorizAnalysisEnum():
++	"""
++	ADJOINTHORIZANALYSISENUM - Enum of AdjointHorizAnalysis
++
++	   Usage:
++	      macro=AdjointHorizAnalysisEnum()
++	"""
++
++	return StringToEnum('AdjointHorizAnalysis')
++
++def AdjointSolutionEnum():
++	"""
++	ADJOINTSOLUTIONENUM - Enum of AdjointSolution
++
++	   Usage:
++	      macro=AdjointSolutionEnum()
++	"""
++
++	return StringToEnum('AdjointSolution')
++
++def AnalysisCounterEnum():
++	"""
++	ANALYSISCOUNTERENUM - Enum of AnalysisCounter
++
++	   Usage:
++	      macro=AnalysisCounterEnum()
++	"""
++
++	return StringToEnum('AnalysisCounter')
++
++def BalancethicknessAnalysisEnum():
++	"""
++	BALANCETHICKNESSANALYSISENUM - Enum of BalancethicknessAnalysis
++
++	   Usage:
++	      macro=BalancethicknessAnalysisEnum()
++	"""
++
++	return StringToEnum('BalancethicknessAnalysis')
++
++def BalancethicknessSolutionEnum():
++	"""
++	BALANCETHICKNESSSOLUTIONENUM - Enum of BalancethicknessSolution
++
++	   Usage:
++	      macro=BalancethicknessSolutionEnum()
++	"""
++
++	return StringToEnum('BalancethicknessSolution')
++
++def BedSlopeAnalysisEnum():
++	"""
++	BEDSLOPEANALYSISENUM - Enum of BedSlopeAnalysis
++
++	   Usage:
++	      macro=BedSlopeAnalysisEnum()
++	"""
++
++	return StringToEnum('BedSlopeAnalysis')
++
++def BedSlopeSolutionEnum():
++	"""
++	BEDSLOPESOLUTIONENUM - Enum of BedSlopeSolution
++
++	   Usage:
++	      macro=BedSlopeSolutionEnum()
++	"""
++
++	return StringToEnum('BedSlopeSolution')
++
++def BedSlopeXAnalysisEnum():
++	"""
++	BEDSLOPEXANALYSISENUM - Enum of BedSlopeXAnalysis
++
++	   Usage:
++	      macro=BedSlopeXAnalysisEnum()
++	"""
++
++	return StringToEnum('BedSlopeXAnalysis')
++
++def BedSlopeYAnalysisEnum():
++	"""
++	BEDSLOPEYANALYSISENUM - Enum of BedSlopeYAnalysis
++
++	   Usage:
++	      macro=BedSlopeYAnalysisEnum()
++	"""
++
++	return StringToEnum('BedSlopeYAnalysis')
++
++def DiagnosticHorizAnalysisEnum():
++	"""
++	DIAGNOSTICHORIZANALYSISENUM - Enum of DiagnosticHorizAnalysis
++
++	   Usage:
++	      macro=DiagnosticHorizAnalysisEnum()
++	"""
++
++	return StringToEnum('DiagnosticHorizAnalysis')
++
++def DiagnosticHutterAnalysisEnum():
++	"""
++	DIAGNOSTICHUTTERANALYSISENUM - Enum of DiagnosticHutterAnalysis
++
++	   Usage:
++	      macro=DiagnosticHutterAnalysisEnum()
++	"""
++
++	return StringToEnum('DiagnosticHutterAnalysis')
++
++def DiagnosticSolutionEnum():
++	"""
++	DIAGNOSTICSOLUTIONENUM - Enum of DiagnosticSolution
++
++	   Usage:
++	      macro=DiagnosticSolutionEnum()
++	"""
++
++	return StringToEnum('DiagnosticSolution')
++
++def DiagnosticVertAnalysisEnum():
++	"""
++	DIAGNOSTICVERTANALYSISENUM - Enum of DiagnosticVertAnalysis
++
++	   Usage:
++	      macro=DiagnosticVertAnalysisEnum()
++	"""
++
++	return StringToEnum('DiagnosticVertAnalysis')
++
++def EnthalpyAnalysisEnum():
++	"""
++	ENTHALPYANALYSISENUM - Enum of EnthalpyAnalysis
++
++	   Usage:
++	      macro=EnthalpyAnalysisEnum()
++	"""
++
++	return StringToEnum('EnthalpyAnalysis')
++
++def EnthalpySolutionEnum():
++	"""
++	ENTHALPYSOLUTIONENUM - Enum of EnthalpySolution
++
++	   Usage:
++	      macro=EnthalpySolutionEnum()
++	"""
++
++	return StringToEnum('EnthalpySolution')
++
++def FlaimAnalysisEnum():
++	"""
++	FLAIMANALYSISENUM - Enum of FlaimAnalysis
++
++	   Usage:
++	      macro=FlaimAnalysisEnum()
++	"""
++
++	return StringToEnum('FlaimAnalysis')
++
++def FlaimSolutionEnum():
++	"""
++	FLAIMSOLUTIONENUM - Enum of FlaimSolution
++
++	   Usage:
++	      macro=FlaimSolutionEnum()
++	"""
++
++	return StringToEnum('FlaimSolution')
++
++def HydrologyAnalysisEnum():
++	"""
++	HYDROLOGYANALYSISENUM - Enum of HydrologyAnalysis
++
++	   Usage:
++	      macro=HydrologyAnalysisEnum()
++	"""
++
++	return StringToEnum('HydrologyAnalysis')
++
++def HydrologySolutionEnum():
++	"""
++	HYDROLOGYSOLUTIONENUM - Enum of HydrologySolution
++
++	   Usage:
++	      macro=HydrologySolutionEnum()
++	"""
++
++	return StringToEnum('HydrologySolution')
++
++def MeltingAnalysisEnum():
++	"""
++	MELTINGANALYSISENUM - Enum of MeltingAnalysis
++
++	   Usage:
++	      macro=MeltingAnalysisEnum()
++	"""
++
++	return StringToEnum('MeltingAnalysis')
++
++def NoneAnalysisEnum():
++	"""
++	NONEANALYSISENUM - Enum of NoneAnalysis
++
++	   Usage:
++	      macro=NoneAnalysisEnum()
++	"""
++
++	return StringToEnum('NoneAnalysis')
++
++def PrognosticAnalysisEnum():
++	"""
++	PROGNOSTICANALYSISENUM - Enum of PrognosticAnalysis
++
++	   Usage:
++	      macro=PrognosticAnalysisEnum()
++	"""
++
++	return StringToEnum('PrognosticAnalysis')
++
++def PrognosticSolutionEnum():
++	"""
++	PROGNOSTICSOLUTIONENUM - Enum of PrognosticSolution
++
++	   Usage:
++	      macro=PrognosticSolutionEnum()
++	"""
++
++	return StringToEnum('PrognosticSolution')
++
++def SteadystateSolutionEnum():
++	"""
++	STEADYSTATESOLUTIONENUM - Enum of SteadystateSolution
++
++	   Usage:
++	      macro=SteadystateSolutionEnum()
++	"""
++
++	return StringToEnum('SteadystateSolution')
++
++def SurfaceSlopeAnalysisEnum():
++	"""
++	SURFACESLOPEANALYSISENUM - Enum of SurfaceSlopeAnalysis
++
++	   Usage:
++	      macro=SurfaceSlopeAnalysisEnum()
++	"""
++
++	return StringToEnum('SurfaceSlopeAnalysis')
++
++def SurfaceSlopeSolutionEnum():
++	"""
++	SURFACESLOPESOLUTIONENUM - Enum of SurfaceSlopeSolution
++
++	   Usage:
++	      macro=SurfaceSlopeSolutionEnum()
++	"""
++
++	return StringToEnum('SurfaceSlopeSolution')
++
++def SurfaceSlopeXAnalysisEnum():
++	"""
++	SURFACESLOPEXANALYSISENUM - Enum of SurfaceSlopeXAnalysis
++
++	   Usage:
++	      macro=SurfaceSlopeXAnalysisEnum()
++	"""
++
++	return StringToEnum('SurfaceSlopeXAnalysis')
++
++def SurfaceSlopeYAnalysisEnum():
++	"""
++	SURFACESLOPEYANALYSISENUM - Enum of SurfaceSlopeYAnalysis
++
++	   Usage:
++	      macro=SurfaceSlopeYAnalysisEnum()
++	"""
++
++	return StringToEnum('SurfaceSlopeYAnalysis')
++
++def ThermalAnalysisEnum():
++	"""
++	THERMALANALYSISENUM - Enum of ThermalAnalysis
++
++	   Usage:
++	      macro=ThermalAnalysisEnum()
++	"""
++
++	return StringToEnum('ThermalAnalysis')
++
++def ThermalSolutionEnum():
++	"""
++	THERMALSOLUTIONENUM - Enum of ThermalSolution
++
++	   Usage:
++	      macro=ThermalSolutionEnum()
++	"""
++
++	return StringToEnum('ThermalSolution')
++
++def TransientSolutionEnum():
++	"""
++	TRANSIENTSOLUTIONENUM - Enum of TransientSolution
++
++	   Usage:
++	      macro=TransientSolutionEnum()
++	"""
++
++	return StringToEnum('TransientSolution')
++
++def ApproximationEnum():
++	"""
++	APPROXIMATIONENUM - Enum of Approximation
++
++	   Usage:
++	      macro=ApproximationEnum()
++	"""
++
++	return StringToEnum('Approximation')
++
++def HutterApproximationEnum():
++	"""
++	HUTTERAPPROXIMATIONENUM - Enum of HutterApproximation
++
++	   Usage:
++	      macro=HutterApproximationEnum()
++	"""
++
++	return StringToEnum('HutterApproximation')
++
++def MacAyealApproximationEnum():
++	"""
++	MACAYEALAPPROXIMATIONENUM - Enum of MacAyealApproximation
++
++	   Usage:
++	      macro=MacAyealApproximationEnum()
++	"""
++
++	return StringToEnum('MacAyealApproximation')
++
++def MacAyealPattynApproximationEnum():
++	"""
++	MACAYEALPATTYNAPPROXIMATIONENUM - Enum of MacAyealPattynApproximation
++
++	   Usage:
++	      macro=MacAyealPattynApproximationEnum()
++	"""
++
++	return StringToEnum('MacAyealPattynApproximation')
++
++def MacAyealStokesApproximationEnum():
++	"""
++	MACAYEALSTOKESAPPROXIMATIONENUM - Enum of MacAyealStokesApproximation
++
++	   Usage:
++	      macro=MacAyealStokesApproximationEnum()
++	"""
++
++	return StringToEnum('MacAyealStokesApproximation')
++
++def NoneApproximationEnum():
++	"""
++	NONEAPPROXIMATIONENUM - Enum of NoneApproximation
++
++	   Usage:
++	      macro=NoneApproximationEnum()
++	"""
++
++	return StringToEnum('NoneApproximation')
++
++def PattynApproximationEnum():
++	"""
++	PATTYNAPPROXIMATIONENUM - Enum of PattynApproximation
++
++	   Usage:
++	      macro=PattynApproximationEnum()
++	"""
++
++	return StringToEnum('PattynApproximation')
++
++def PattynStokesApproximationEnum():
++	"""
++	PATTYNSTOKESAPPROXIMATIONENUM - Enum of PattynStokesApproximation
++
++	   Usage:
++	      macro=PattynStokesApproximationEnum()
++	"""
++
++	return StringToEnum('PattynStokesApproximation')
++
++def StokesApproximationEnum():
++	"""
++	STOKESAPPROXIMATIONENUM - Enum of StokesApproximation
++
++	   Usage:
++	      macro=StokesApproximationEnum()
++	"""
++
++	return StringToEnum('StokesApproximation')
++
++def ConstraintsEnum():
++	"""
++	CONSTRAINTSENUM - Enum of Constraints
++
++	   Usage:
++	      macro=ConstraintsEnum()
++	"""
++
++	return StringToEnum('Constraints')
++
++def LoadsEnum():
++	"""
++	LOADSENUM - Enum of Loads
++
++	   Usage:
++	      macro=LoadsEnum()
++	"""
++
++	return StringToEnum('Loads')
++
++def MaterialsEnum():
++	"""
++	MATERIALSENUM - Enum of Materials
++
++	   Usage:
++	      macro=MaterialsEnum()
++	"""
++
++	return StringToEnum('Materials')
++
++def NodesEnum():
++	"""
++	NODESENUM - Enum of Nodes
++
++	   Usage:
++	      macro=NodesEnum()
++	"""
++
++	return StringToEnum('Nodes')
++
++def ParametersEnum():
++	"""
++	PARAMETERSENUM - Enum of Parameters
++
++	   Usage:
++	      macro=ParametersEnum()
++	"""
++
++	return StringToEnum('Parameters')
++
++def VerticesEnum():
++	"""
++	VERTICESENUM - Enum of Vertices
++
++	   Usage:
++	      macro=VerticesEnum()
++	"""
++
++	return StringToEnum('Vertices')
++
++def ResultsEnum():
++	"""
++	RESULTSENUM - Enum of Results
++
++	   Usage:
++	      macro=ResultsEnum()
++	"""
++
++	return StringToEnum('Results')
++
++def BoolInputEnum():
++	"""
++	BOOLINPUTENUM - Enum of BoolInput
++
++	   Usage:
++	      macro=BoolInputEnum()
++	"""
++
++	return StringToEnum('BoolInput')
++
++def BoolParamEnum():
++	"""
++	BOOLPARAMENUM - Enum of BoolParam
++
++	   Usage:
++	      macro=BoolParamEnum()
++	"""
++
++	return StringToEnum('BoolParam')
++
++def ContourEnum():
++	"""
++	CONTOURENUM - Enum of Contour
++
++	   Usage:
++	      macro=ContourEnum()
++	"""
++
++	return StringToEnum('Contour')
++
++def ControlInputEnum():
++	"""
++	CONTROLINPUTENUM - Enum of ControlInput
++
++	   Usage:
++	      macro=ControlInputEnum()
++	"""
++
++	return StringToEnum('ControlInput')
++
++def DatasetInputEnum():
++	"""
++	DATASETINPUTENUM - Enum of DatasetInput
++
++	   Usage:
++	      macro=DatasetInputEnum()
++	"""
++
++	return StringToEnum('DatasetInput')
++
++def DofIndexingEnum():
++	"""
++	DOFINDEXINGENUM - Enum of DofIndexing
++
++	   Usage:
++	      macro=DofIndexingEnum()
++	"""
++
++	return StringToEnum('DofIndexing')
++
++def DoubleInputEnum():
++	"""
++	DOUBLEINPUTENUM - Enum of DoubleInput
++
++	   Usage:
++	      macro=DoubleInputEnum()
++	"""
++
++	return StringToEnum('DoubleInput')
++
++def DoubleMatArrayParamEnum():
++	"""
++	DOUBLEMATARRAYPARAMENUM - Enum of DoubleMatArrayParam
++
++	   Usage:
++	      macro=DoubleMatArrayParamEnum()
++	"""
++
++	return StringToEnum('DoubleMatArrayParam')
++
++def DoubleMatParamEnum():
++	"""
++	DOUBLEMATPARAMENUM - Enum of DoubleMatParam
++
++	   Usage:
++	      macro=DoubleMatParamEnum()
++	"""
++
++	return StringToEnum('DoubleMatParam')
++
++def DoubleParamEnum():
++	"""
++	DOUBLEPARAMENUM - Enum of DoubleParam
++
++	   Usage:
++	      macro=DoubleParamEnum()
++	"""
++
++	return StringToEnum('DoubleParam')
++
++def DoubleVecParamEnum():
++	"""
++	DOUBLEVECPARAMENUM - Enum of DoubleVecParam
++
++	   Usage:
++	      macro=DoubleVecParamEnum()
++	"""
++
++	return StringToEnum('DoubleVecParam')
++
++def ElementEnum():
++	"""
++	ELEMENTENUM - Enum of Element
++
++	   Usage:
++	      macro=ElementEnum()
++	"""
++
++	return StringToEnum('Element')
++
++def ElementResultEnum():
++	"""
++	ELEMENTRESULTENUM - Enum of ElementResult
++
++	   Usage:
++	      macro=ElementResultEnum()
++	"""
++
++	return StringToEnum('ElementResult')
++
++def ExternalResultEnum():
++	"""
++	EXTERNALRESULTENUM - Enum of ExternalResult
++
++	   Usage:
++	      macro=ExternalResultEnum()
++	"""
++
++	return StringToEnum('ExternalResult')
++
++def FileParamEnum():
++	"""
++	FILEPARAMENUM - Enum of FileParam
++
++	   Usage:
++	      macro=FileParamEnum()
++	"""
++
++	return StringToEnum('FileParam')
++
++def HookEnum():
++	"""
++	HOOKENUM - Enum of Hook
++
++	   Usage:
++	      macro=HookEnum()
++	"""
++
++	return StringToEnum('Hook')
++
++def IcefrontEnum():
++	"""
++	ICEFRONTENUM - Enum of Icefront
++
++	   Usage:
++	      macro=IcefrontEnum()
++	"""
++
++	return StringToEnum('Icefront')
++
++def InputEnum():
++	"""
++	INPUTENUM - Enum of Input
++
++	   Usage:
++	      macro=InputEnum()
++	"""
++
++	return StringToEnum('Input')
++
++def IntInputEnum():
++	"""
++	INTINPUTENUM - Enum of IntInput
++
++	   Usage:
++	      macro=IntInputEnum()
++	"""
++
++	return StringToEnum('IntInput')
++
++def IntParamEnum():
++	"""
++	INTPARAMENUM - Enum of IntParam
++
++	   Usage:
++	      macro=IntParamEnum()
++	"""
++
++	return StringToEnum('IntParam')
++
++def IntVecParamEnum():
++	"""
++	INTVECPARAMENUM - Enum of IntVecParam
++
++	   Usage:
++	      macro=IntVecParamEnum()
++	"""
++
++	return StringToEnum('IntVecParam')
++
++def MacAyeal2dIceFrontEnum():
++	"""
++	MACAYEAL2DICEFRONTENUM - Enum of MacAyeal2dIceFront
++
++	   Usage:
++	      macro=MacAyeal2dIceFrontEnum()
++	"""
++
++	return StringToEnum('MacAyeal2dIceFront')
++
++def MacAyeal3dIceFrontEnum():
++	"""
++	MACAYEAL3DICEFRONTENUM - Enum of MacAyeal3dIceFront
++
++	   Usage:
++	      macro=MacAyeal3dIceFrontEnum()
++	"""
++
++	return StringToEnum('MacAyeal3dIceFront')
++
++def MaticeEnum():
++	"""
++	MATICEENUM - Enum of Matice
++
++	   Usage:
++	      macro=MaticeEnum()
++	"""
++
++	return StringToEnum('Matice')
++
++def MatparEnum():
++	"""
++	MATPARENUM - Enum of Matpar
++
++	   Usage:
++	      macro=MatparEnum()
++	"""
++
++	return StringToEnum('Matpar')
++
++def NodeEnum():
++	"""
++	NODEENUM - Enum of Node
++
++	   Usage:
++	      macro=NodeEnum()
++	"""
++
++	return StringToEnum('Node')
++
++def NumericalfluxEnum():
++	"""
++	NUMERICALFLUXENUM - Enum of Numericalflux
++
++	   Usage:
++	      macro=NumericalfluxEnum()
++	"""
++
++	return StringToEnum('Numericalflux')
++
++def ParamEnum():
++	"""
++	PARAMENUM - Enum of Param
++
++	   Usage:
++	      macro=ParamEnum()
++	"""
++
++	return StringToEnum('Param')
++
++def PattynIceFrontEnum():
++	"""
++	PATTYNICEFRONTENUM - Enum of PattynIceFront
++
++	   Usage:
++	      macro=PattynIceFrontEnum()
++	"""
++
++	return StringToEnum('PattynIceFront')
++
++def PengridEnum():
++	"""
++	PENGRIDENUM - Enum of Pengrid
++
++	   Usage:
++	      macro=PengridEnum()
++	"""
++
++	return StringToEnum('Pengrid')
++
++def PenpairEnum():
++	"""
++	PENPAIRENUM - Enum of Penpair
++
++	   Usage:
++	      macro=PenpairEnum()
++	"""
++
++	return StringToEnum('Penpair')
++
++def PentaEnum():
++	"""
++	PENTAENUM - Enum of Penta
++
++	   Usage:
++	      macro=PentaEnum()
++	"""
++
++	return StringToEnum('Penta')
++
++def PentaP1InputEnum():
++	"""
++	PENTAP1INPUTENUM - Enum of PentaP1Input
++
++	   Usage:
++	      macro=PentaP1InputEnum()
++	"""
++
++	return StringToEnum('PentaP1Input')
++
++def MatrixParamEnum():
++	"""
++	MATRIXPARAMENUM - Enum of MatrixParam
++
++	   Usage:
++	      macro=MatrixParamEnum()
++	"""
++
++	return StringToEnum('MatrixParam')
++
++def VectorParamEnum():
++	"""
++	VECTORPARAMENUM - Enum of VectorParam
++
++	   Usage:
++	      macro=VectorParamEnum()
++	"""
++
++	return StringToEnum('VectorParam')
++
++def RiftfrontEnum():
++	"""
++	RIFTFRONTENUM - Enum of Riftfront
++
++	   Usage:
++	      macro=RiftfrontEnum()
++	"""
++
++	return StringToEnum('Riftfront')
++
++def SegmentEnum():
++	"""
++	SEGMENTENUM - Enum of Segment
++
++	   Usage:
++	      macro=SegmentEnum()
++	"""
++
++	return StringToEnum('Segment')
++
++def SegmentRiftfrontEnum():
++	"""
++	SEGMENTRIFTFRONTENUM - Enum of SegmentRiftfront
++
++	   Usage:
++	      macro=SegmentRiftfrontEnum()
++	"""
++
++	return StringToEnum('SegmentRiftfront')
++
++def SpcDynamicEnum():
++	"""
++	SPCDYNAMICENUM - Enum of SpcDynamic
++
++	   Usage:
++	      macro=SpcDynamicEnum()
++	"""
++
++	return StringToEnum('SpcDynamic')
++
++def SpcStaticEnum():
++	"""
++	SPCSTATICENUM - Enum of SpcStatic
++
++	   Usage:
++	      macro=SpcStaticEnum()
++	"""
++
++	return StringToEnum('SpcStatic')
++
++def SpcTransientEnum():
++	"""
++	SPCTRANSIENTENUM - Enum of SpcTransient
++
++	   Usage:
++	      macro=SpcTransientEnum()
++	"""
++
++	return StringToEnum('SpcTransient')
++
++def StokesIceFrontEnum():
++	"""
++	STOKESICEFRONTENUM - Enum of StokesIceFront
++
++	   Usage:
++	      macro=StokesIceFrontEnum()
++	"""
++
++	return StringToEnum('StokesIceFront')
++
++def StringArrayParamEnum():
++	"""
++	STRINGARRAYPARAMENUM - Enum of StringArrayParam
++
++	   Usage:
++	      macro=StringArrayParamEnum()
++	"""
++
++	return StringToEnum('StringArrayParam')
++
++def StringParamEnum():
++	"""
++	STRINGPARAMENUM - Enum of StringParam
++
++	   Usage:
++	      macro=StringParamEnum()
++	"""
++
++	return StringToEnum('StringParam')
++
++def TriaEnum():
++	"""
++	TRIAENUM - Enum of Tria
++
++	   Usage:
++	      macro=TriaEnum()
++	"""
++
++	return StringToEnum('Tria')
++
++def TriaP1InputEnum():
++	"""
++	TRIAP1INPUTENUM - Enum of TriaP1Input
++
++	   Usage:
++	      macro=TriaP1InputEnum()
++	"""
++
++	return StringToEnum('TriaP1Input')
++
++def VertexEnum():
++	"""
++	VERTEXENUM - Enum of Vertex
++
++	   Usage:
++	      macro=VertexEnum()
++	"""
++
++	return StringToEnum('Vertex')
++
++def AirEnum():
++	"""
++	AIRENUM - Enum of Air
++
++	   Usage:
++	      macro=AirEnum()
++	"""
++
++	return StringToEnum('Air')
++
++def IceEnum():
++	"""
++	ICEENUM - Enum of Ice
++
++	   Usage:
++	      macro=IceEnum()
++	"""
++
++	return StringToEnum('Ice')
++
++def MelangeEnum():
++	"""
++	MELANGEENUM - Enum of Melange
++
++	   Usage:
++	      macro=MelangeEnum()
++	"""
++
++	return StringToEnum('Melange')
++
++def WaterEnum():
++	"""
++	WATERENUM - Enum of Water
++
++	   Usage:
++	      macro=WaterEnum()
++	"""
++
++	return StringToEnum('Water')
++
++def ClosedEnum():
++	"""
++	CLOSEDENUM - Enum of Closed
++
++	   Usage:
++	      macro=ClosedEnum()
++	"""
++
++	return StringToEnum('Closed')
++
++def FreeEnum():
++	"""
++	FREEENUM - Enum of Free
++
++	   Usage:
++	      macro=FreeEnum()
++	"""
++
++	return StringToEnum('Free')
++
++def OpenEnum():
++	"""
++	OPENENUM - Enum of Open
++
++	   Usage:
++	      macro=OpenEnum()
++	"""
++
++	return StringToEnum('Open')
++
++def AdjointpEnum():
++	"""
++	ADJOINTPENUM - Enum of Adjointp
++
++	   Usage:
++	      macro=AdjointpEnum()
++	"""
++
++	return StringToEnum('Adjointp')
++
++def AdjointxEnum():
++	"""
++	ADJOINTXENUM - Enum of Adjointx
++
++	   Usage:
++	      macro=AdjointxEnum()
++	"""
++
++	return StringToEnum('Adjointx')
++
++def AdjointyEnum():
++	"""
++	ADJOINTYENUM - Enum of Adjointy
++
++	   Usage:
++	      macro=AdjointyEnum()
++	"""
++
++	return StringToEnum('Adjointy')
++
++def AdjointzEnum():
++	"""
++	ADJOINTZENUM - Enum of Adjointz
++
++	   Usage:
++	      macro=AdjointzEnum()
++	"""
++
++	return StringToEnum('Adjointz')
++
++def BedSlopeXEnum():
++	"""
++	BEDSLOPEXENUM - Enum of BedSlopeX
++
++	   Usage:
++	      macro=BedSlopeXEnum()
++	"""
++
++	return StringToEnum('BedSlopeX')
++
++def BedSlopeYEnum():
++	"""
++	BEDSLOPEYENUM - Enum of BedSlopeY
++
++	   Usage:
++	      macro=BedSlopeYEnum()
++	"""
++
++	return StringToEnum('BedSlopeY')
++
++def BoundaryEnum():
++	"""
++	BOUNDARYENUM - Enum of Boundary
++
++	   Usage:
++	      macro=BoundaryEnum()
++	"""
++
++	return StringToEnum('Boundary')
++
++def ConstantEnum():
++	"""
++	CONSTANTENUM - Enum of Constant
++
++	   Usage:
++	      macro=ConstantEnum()
++	"""
++
++	return StringToEnum('Constant')
++
++def ConvergedEnum():
++	"""
++	CONVERGEDENUM - Enum of Converged
++
++	   Usage:
++	      macro=ConvergedEnum()
++	"""
++
++	return StringToEnum('Converged')
++
++def ExtToIuEnum():
++	"""
++	EXTTOIUENUM - Enum of ExtToIu
++
++	   Usage:
++	      macro=ExtToIuEnum()
++	"""
++
++	return StringToEnum('ExtToIu')
++
++def FillEnum():
++	"""
++	FILLENUM - Enum of Fill
++
++	   Usage:
++	      macro=FillEnum()
++	"""
++
++	return StringToEnum('Fill')
++
++def FractionIncrementEnum():
++	"""
++	FRACTIONINCREMENTENUM - Enum of FractionIncrement
++
++	   Usage:
++	      macro=FractionIncrementEnum()
++	"""
++
++	return StringToEnum('FractionIncrement')
++
++def FrictionEnum():
++	"""
++	FRICTIONENUM - Enum of Friction
++
++	   Usage:
++	      macro=FrictionEnum()
++	"""
++
++	return StringToEnum('Friction')
++
++def GroundinglineMeltingRateEnum():
++	"""
++	GROUNDINGLINEMELTINGRATEENUM - Enum of GroundinglineMeltingRate
++
++	   Usage:
++	      macro=GroundinglineMeltingRateEnum()
++	"""
++
++	return StringToEnum('GroundinglineMeltingRate')
++
++def InternalEnum():
++	"""
++	INTERNALENUM - Enum of Internal
++
++	   Usage:
++	      macro=InternalEnum()
++	"""
++
++	return StringToEnum('Internal')
++
++def IuToExtEnum():
++	"""
++	IUTOEXTENUM - Enum of IuToExt
++
++	   Usage:
++	      macro=IuToExtEnum()
++	"""
++
++	return StringToEnum('IuToExt')
++
++def MassFluxEnum():
++	"""
++	MASSFLUXENUM - Enum of MassFlux
++
++	   Usage:
++	      macro=MassFluxEnum()
++	"""
++
++	return StringToEnum('MassFlux')
++
++def MaxPenetrationEnum():
++	"""
++	MAXPENETRATIONENUM - Enum of MaxPenetration
++
++	   Usage:
++	      macro=MaxPenetrationEnum()
++	"""
++
++	return StringToEnum('MaxPenetration')
++
++def MeltingOffsetEnum():
++	"""
++	MELTINGOFFSETENUM - Enum of MeltingOffset
++
++	   Usage:
++	      macro=MeltingOffsetEnum()
++	"""
++
++	return StringToEnum('MeltingOffset')
++
++def MisfitEnum():
++	"""
++	MISFITENUM - Enum of Misfit
++
++	   Usage:
++	      macro=MisfitEnum()
++	"""
++
++	return StringToEnum('Misfit')
++
++def NumberNodeToElementConnectivityEnum():
++	"""
++	NUMBERNODETOELEMENTCONNECTIVITYENUM - Enum of NumberNodeToElementConnectivity
++
++	   Usage:
++	      macro=NumberNodeToElementConnectivityEnum()
++	"""
++
++	return StringToEnum('NumberNodeToElementConnectivity')
++
++def PressureEnum():
++	"""
++	PRESSUREENUM - Enum of Pressure
++
++	   Usage:
++	      macro=PressureEnum()
++	"""
++
++	return StringToEnum('Pressure')
++
++def PressurePicardEnum():
++	"""
++	PRESSUREPICARDENUM - Enum of PressurePicard
++
++	   Usage:
++	      macro=PressurePicardEnum()
++	"""
++
++	return StringToEnum('PressurePicard')
++
++def QmuPressureEnum():
++	"""
++	QMUPRESSUREENUM - Enum of QmuPressure
++
++	   Usage:
++	      macro=QmuPressureEnum()
++	"""
++
++	return StringToEnum('QmuPressure')
++
++def QmuVxEnum():
++	"""
++	QMUVXENUM - Enum of QmuVx
++
++	   Usage:
++	      macro=QmuVxEnum()
++	"""
++
++	return StringToEnum('QmuVx')
++
++def QmuVyEnum():
++	"""
++	QMUVYENUM - Enum of QmuVy
++
++	   Usage:
++	      macro=QmuVyEnum()
++	"""
++
++	return StringToEnum('QmuVy')
++
++def QmuVzEnum():
++	"""
++	QMUVZENUM - Enum of QmuVz
++
++	   Usage:
++	      macro=QmuVzEnum()
++	"""
++
++	return StringToEnum('QmuVz')
++
++def QmuThicknessEnum():
++	"""
++	QMUTHICKNESSENUM - Enum of QmuThickness
++
++	   Usage:
++	      macro=QmuThicknessEnum()
++	"""
++
++	return StringToEnum('QmuThickness')
++
++def QmuBedEnum():
++	"""
++	QMUBEDENUM - Enum of QmuBed
++
++	   Usage:
++	      macro=QmuBedEnum()
++	"""
++
++	return StringToEnum('QmuBed')
++
++def QmuSurfaceEnum():
++	"""
++	QMUSURFACEENUM - Enum of QmuSurface
++
++	   Usage:
++	      macro=QmuSurfaceEnum()
++	"""
++
++	return StringToEnum('QmuSurface')
++
++def QmuMeltingEnum():
++	"""
++	QMUMELTINGENUM - Enum of QmuMelting
++
++	   Usage:
++	      macro=QmuMeltingEnum()
++	"""
++
++	return StringToEnum('QmuMelting')
++
++def ResetPenaltiesEnum():
++	"""
++	RESETPENALTIESENUM - Enum of ResetPenalties
++
++	   Usage:
++	      macro=ResetPenaltiesEnum()
++	"""
++
++	return StringToEnum('ResetPenalties')
++
++def SegmentOnIceShelfEnum():
++	"""
++	SEGMENTONICESHELFENUM - Enum of SegmentOnIceShelf
++
++	   Usage:
++	      macro=SegmentOnIceShelfEnum()
++	"""
++
++	return StringToEnum('SegmentOnIceShelf')
++
++def SurfaceAbsVelMisfitEnum():
++	"""
++	SURFACEABSVELMISFITENUM - Enum of SurfaceAbsVelMisfit
++
++	   Usage:
++	      macro=SurfaceAbsVelMisfitEnum()
++	"""
++
++	return StringToEnum('SurfaceAbsVelMisfit')
++
++def SurfaceAreaEnum():
++	"""
++	SURFACEAREAENUM - Enum of SurfaceArea
++
++	   Usage:
++	      macro=SurfaceAreaEnum()
++	"""
++
++	return StringToEnum('SurfaceArea')
++
++def SurfaceAverageVelMisfitEnum():
++	"""
++	SURFACEAVERAGEVELMISFITENUM - Enum of SurfaceAverageVelMisfit
++
++	   Usage:
++	      macro=SurfaceAverageVelMisfitEnum()
++	"""
++
++	return StringToEnum('SurfaceAverageVelMisfit')
++
++def SurfaceLogVelMisfitEnum():
++	"""
++	SURFACELOGVELMISFITENUM - Enum of SurfaceLogVelMisfit
++
++	   Usage:
++	      macro=SurfaceLogVelMisfitEnum()
++	"""
++
++	return StringToEnum('SurfaceLogVelMisfit')
++
++def SurfaceLogVxVyMisfitEnum():
++	"""
++	SURFACELOGVXVYMISFITENUM - Enum of SurfaceLogVxVyMisfit
++
++	   Usage:
++	      macro=SurfaceLogVxVyMisfitEnum()
++	"""
++
++	return StringToEnum('SurfaceLogVxVyMisfit')
++
++def SurfaceRelVelMisfitEnum():
++	"""
++	SURFACERELVELMISFITENUM - Enum of SurfaceRelVelMisfit
++
++	   Usage:
++	      macro=SurfaceRelVelMisfitEnum()
++	"""
++
++	return StringToEnum('SurfaceRelVelMisfit')
++
++def SurfaceSlopeXEnum():
++	"""
++	SURFACESLOPEXENUM - Enum of SurfaceSlopeX
++
++	   Usage:
++	      macro=SurfaceSlopeXEnum()
++	"""
++
++	return StringToEnum('SurfaceSlopeX')
++
++def SurfaceSlopeYEnum():
++	"""
++	SURFACESLOPEYENUM - Enum of SurfaceSlopeY
++
++	   Usage:
++	      macro=SurfaceSlopeYEnum()
++	"""
++
++	return StringToEnum('SurfaceSlopeY')
++
++def TemperatureEnum():
++	"""
++	TEMPERATUREENUM - Enum of Temperature
++
++	   Usage:
++	      macro=TemperatureEnum()
++	"""
++
++	return StringToEnum('Temperature')
++
++def TemperatureOldEnum():
++	"""
++	TEMPERATUREOLDENUM - Enum of TemperatureOld
++
++	   Usage:
++	      macro=TemperatureOldEnum()
++	"""
++
++	return StringToEnum('TemperatureOld')
++
++def TemperaturePicardEnum():
++	"""
++	TEMPERATUREPICARDENUM - Enum of TemperaturePicard
++
++	   Usage:
++	      macro=TemperaturePicardEnum()
++	"""
++
++	return StringToEnum('TemperaturePicard')
++
++def ThicknessAbsMisfitEnum():
++	"""
++	THICKNESSABSMISFITENUM - Enum of ThicknessAbsMisfit
++
++	   Usage:
++	      macro=ThicknessAbsMisfitEnum()
++	"""
++
++	return StringToEnum('ThicknessAbsMisfit')
++
++def TypeEnum():
++	"""
++	TYPEENUM - Enum of Type
++
++	   Usage:
++	      macro=TypeEnum()
++	"""
++
++	return StringToEnum('Type')
++
++def VelEnum():
++	"""
++	VELENUM - Enum of Vel
++
++	   Usage:
++	      macro=VelEnum()
++	"""
++
++	return StringToEnum('Vel')
++
++def VelocityEnum():
++	"""
++	VELOCITYENUM - Enum of Velocity
++
++	   Usage:
++	      macro=VelocityEnum()
++	"""
++
++	return StringToEnum('Velocity')
++
++def VxAverageEnum():
++	"""
++	VXAVERAGEENUM - Enum of VxAverage
++
++	   Usage:
++	      macro=VxAverageEnum()
++	"""
++
++	return StringToEnum('VxAverage')
++
++def VxEnum():
++	"""
++	VXENUM - Enum of Vx
++
++	   Usage:
++	      macro=VxEnum()
++	"""
++
++	return StringToEnum('Vx')
++
++def VxPicardEnum():
++	"""
++	VXPICARDENUM - Enum of VxPicard
++
++	   Usage:
++	      macro=VxPicardEnum()
++	"""
++
++	return StringToEnum('VxPicard')
++
++def VyAverageEnum():
++	"""
++	VYAVERAGEENUM - Enum of VyAverage
++
++	   Usage:
++	      macro=VyAverageEnum()
++	"""
++
++	return StringToEnum('VyAverage')
++
++def VyEnum():
++	"""
++	VYENUM - Enum of Vy
++
++	   Usage:
++	      macro=VyEnum()
++	"""
++
++	return StringToEnum('Vy')
++
++def VyPicardEnum():
++	"""
++	VYPICARDENUM - Enum of VyPicard
++
++	   Usage:
++	      macro=VyPicardEnum()
++	"""
++
++	return StringToEnum('VyPicard')
++
++def VzEnum():
++	"""
++	VZENUM - Enum of Vz
++
++	   Usage:
++	      macro=VzEnum()
++	"""
++
++	return StringToEnum('Vz')
++
++def VzMacAyealEnum():
++	"""
++	VZMACAYEALENUM - Enum of VzMacAyeal
++
++	   Usage:
++	      macro=VzMacAyealEnum()
++	"""
++
++	return StringToEnum('VzMacAyeal')
++
++def VzPattynEnum():
++	"""
++	VZPATTYNENUM - Enum of VzPattyn
++
++	   Usage:
++	      macro=VzPattynEnum()
++	"""
++
++	return StringToEnum('VzPattyn')
++
++def VzPicardEnum():
++	"""
++	VZPICARDENUM - Enum of VzPicard
++
++	   Usage:
++	      macro=VzPicardEnum()
++	"""
++
++	return StringToEnum('VzPicard')
++
++def VzStokesEnum():
++	"""
++	VZSTOKESENUM - Enum of VzStokes
++
++	   Usage:
++	      macro=VzStokesEnum()
++	"""
++
++	return StringToEnum('VzStokes')
++
++def VxMeshEnum():
++	"""
++	VXMESHENUM - Enum of VxMesh
++
++	   Usage:
++	      macro=VxMeshEnum()
++	"""
++
++	return StringToEnum('VxMesh')
++
++def VyMeshEnum():
++	"""
++	VYMESHENUM - Enum of VyMesh
++
++	   Usage:
++	      macro=VyMeshEnum()
++	"""
++
++	return StringToEnum('VyMesh')
++
++def VzMeshEnum():
++	"""
++	VZMESHENUM - Enum of VzMesh
++
++	   Usage:
++	      macro=VzMeshEnum()
++	"""
++
++	return StringToEnum('VzMesh')
++
++def EnthalpyEnum():
++	"""
++	ENTHALPYENUM - Enum of Enthalpy
++
++	   Usage:
++	      macro=EnthalpyEnum()
++	"""
++
++	return StringToEnum('Enthalpy')
++
++def EnthalpyPicardEnum():
++	"""
++	ENTHALPYPICARDENUM - Enum of EnthalpyPicard
++
++	   Usage:
++	      macro=EnthalpyPicardEnum()
++	"""
++
++	return StringToEnum('EnthalpyPicard')
++
++def ThicknessAbsGradientEnum():
++	"""
++	THICKNESSABSGRADIENTENUM - Enum of ThicknessAbsGradient
++
++	   Usage:
++	      macro=ThicknessAbsGradientEnum()
++	"""
++
++	return StringToEnum('ThicknessAbsGradient')
++
++def StepResponsesEnum():
++	"""
++	STEPRESPONSESENUM - Enum of StepResponses
++
++	   Usage:
++	      macro=StepResponsesEnum()
++	"""
++
++	return StringToEnum('StepResponses')
++
++def IntMatParamEnum():
++	"""
++	INTMATPARAMENUM - Enum of IntMatParam
++
++	   Usage:
++	      macro=IntMatParamEnum()
++	"""
++
++	return StringToEnum('IntMatParam')
++
++def RheologyBbarAbsGradientEnum():
++	"""
++	RHEOLOGYBBARABSGRADIENTENUM - Enum of RheologyBbarAbsGradient
++
++	   Usage:
++	      macro=RheologyBbarAbsGradientEnum()
++	"""
++
++	return StringToEnum('RheologyBbarAbsGradient')
++
++def DragCoefficientAbsGradientEnum():
++	"""
++	DRAGCOEFFICIENTABSGRADIENTENUM - Enum of DragCoefficientAbsGradient
++
++	   Usage:
++	      macro=DragCoefficientAbsGradientEnum()
++	"""
++
++	return StringToEnum('DragCoefficientAbsGradient')
++
++def TransientInputEnum():
++	"""
++	TRANSIENTINPUTENUM - Enum of TransientInput
++
++	   Usage:
++	      macro=TransientInputEnum()
++	"""
++
++	return StringToEnum('TransientInput')
++
++def OutputfilenameEnum():
++	"""
++	OUTPUTFILENAMEENUM - Enum of Outputfilename
++
++	   Usage:
++	      macro=OutputfilenameEnum()
++	"""
++
++	return StringToEnum('Outputfilename')
++
++def WaterfractionEnum():
++	"""
++	WATERFRACTIONENUM - Enum of Waterfraction
++
++	   Usage:
++	      macro=WaterfractionEnum()
++	"""
++
++	return StringToEnum('Waterfraction')
++
++def WatercolumnEnum():
++	"""
++	WATERCOLUMNENUM - Enum of Watercolumn
++
++	   Usage:
++	      macro=WatercolumnEnum()
++	"""
++
++	return StringToEnum('Watercolumn')
++
++def BasalFrictionEnum():
++	"""
++	BASALFRICTIONENUM - Enum of BasalFriction
++
++	   Usage:
++	      macro=BasalFrictionEnum()
++	"""
++
++	return StringToEnum('BasalFriction')
++
++def ViscousHeatingEnum():
++	"""
++	VISCOUSHEATINGENUM - Enum of ViscousHeating
++
++	   Usage:
++	      macro=ViscousHeatingEnum()
++	"""
++
++	return StringToEnum('ViscousHeating')
++
++def QmuTemperatureEnum():
++	"""
++	QMUTEMPERATUREENUM - Enum of QmuTemperature
++
++	   Usage:
++	      macro=QmuTemperatureEnum()
++	"""
++
++	return StringToEnum('QmuTemperature')
++
++def HydrologyWaterVxEnum():
++	"""
++	HYDROLOGYWATERVXENUM - Enum of HydrologyWaterVx
++
++	   Usage:
++	      macro=HydrologyWaterVxEnum()
++	"""
++
++	return StringToEnum('HydrologyWaterVx')
++
++def HydrologyWaterVyEnum():
++	"""
++	HYDROLOGYWATERVYENUM - Enum of HydrologyWaterVy
++
++	   Usage:
++	      macro=HydrologyWaterVyEnum()
++	"""
++
++	return StringToEnum('HydrologyWaterVy')
++
++def StressTensorEnum():
++	"""
++	STRESSTENSORENUM - Enum of StressTensor
++
++	   Usage:
++	      macro=StressTensorEnum()
++	"""
++
++	return StringToEnum('StressTensor')
++
++def StressTensorxxEnum():
++	"""
++	STRESSTENSORXXENUM - Enum of StressTensorxx
++
++	   Usage:
++	      macro=StressTensorxxEnum()
++	"""
++
++	return StringToEnum('StressTensorxx')
++
++def StressTensorxyEnum():
++	"""
++	STRESSTENSORXYENUM - Enum of StressTensorxy
++
++	   Usage:
++	      macro=StressTensorxyEnum()
++	"""
++
++	return StringToEnum('StressTensorxy')
++
++def StressTensorxzEnum():
++	"""
++	STRESSTENSORXZENUM - Enum of StressTensorxz
++
++	   Usage:
++	      macro=StressTensorxzEnum()
++	"""
++
++	return StringToEnum('StressTensorxz')
++
++def StressTensoryyEnum():
++	"""
++	STRESSTENSORYYENUM - Enum of StressTensoryy
++
++	   Usage:
++	      macro=StressTensoryyEnum()
++	"""
++
++	return StringToEnum('StressTensoryy')
++
++def StressTensoryzEnum():
++	"""
++	STRESSTENSORYZENUM - Enum of StressTensoryz
++
++	   Usage:
++	      macro=StressTensoryzEnum()
++	"""
++
++	return StringToEnum('StressTensoryz')
++
++def StressTensorzzEnum():
++	"""
++	STRESSTENSORZZENUM - Enum of StressTensorzz
++
++	   Usage:
++	      macro=StressTensorzzEnum()
++	"""
++
++	return StringToEnum('StressTensorzz')
++
++def IceVolumeEnum():
++	"""
++	ICEVOLUMEENUM - Enum of IceVolume
++
++	   Usage:
++	      macro=IceVolumeEnum()
++	"""
++
++	return StringToEnum('IceVolume')
++
++def P0Enum():
++	"""
++	P0ENUM - Enum of P0
++
++	   Usage:
++	      macro=P0Enum()
++	"""
++
++	return StringToEnum('P0')
++
++def P1Enum():
++	"""
++	P1ENUM - Enum of P1
++
++	   Usage:
++	      macro=P1Enum()
++	"""
++
++	return StringToEnum('P1')
++
++def P1DGEnum():
++	"""
++	P1DGENUM - Enum of P1DG
++
++	   Usage:
++	      macro=P1DGEnum()
++	"""
++
++	return StringToEnum('P1DG')
++
++def SaveResultsEnum():
++	"""
++	SAVERESULTSENUM - Enum of SaveResults
++
++	   Usage:
++	      macro=SaveResultsEnum()
++	"""
++
++	return StringToEnum('SaveResults')
++
++def BoolElementResultEnum():
++	"""
++	BOOLELEMENTRESULTENUM - Enum of BoolElementResult
++
++	   Usage:
++	      macro=BoolElementResultEnum()
++	"""
++
++	return StringToEnum('BoolElementResult')
++
++def BoolExternalResultEnum():
++	"""
++	BOOLEXTERNALRESULTENUM - Enum of BoolExternalResult
++
++	   Usage:
++	      macro=BoolExternalResultEnum()
++	"""
++
++	return StringToEnum('BoolExternalResult')
++
++def DoubleElementResultEnum():
++	"""
++	DOUBLEELEMENTRESULTENUM - Enum of DoubleElementResult
++
++	   Usage:
++	      macro=DoubleElementResultEnum()
++	"""
++
++	return StringToEnum('DoubleElementResult')
++
++def DoubleExternalResultEnum():
++	"""
++	DOUBLEEXTERNALRESULTENUM - Enum of DoubleExternalResult
++
++	   Usage:
++	      macro=DoubleExternalResultEnum()
++	"""
++
++	return StringToEnum('DoubleExternalResult')
++
++def DoubleMatExternalResultEnum():
++	"""
++	DOUBLEMATEXTERNALRESULTENUM - Enum of DoubleMatExternalResult
++
++	   Usage:
++	      macro=DoubleMatExternalResultEnum()
++	"""
++
++	return StringToEnum('DoubleMatExternalResult')
++
++def DoubleVecExternalResultEnum():
++	"""
++	DOUBLEVECEXTERNALRESULTENUM - Enum of DoubleVecExternalResult
++
++	   Usage:
++	      macro=DoubleVecExternalResultEnum()
++	"""
++
++	return StringToEnum('DoubleVecExternalResult')
++
++def IntExternalResultEnum():
++	"""
++	INTEXTERNALRESULTENUM - Enum of IntExternalResult
++
++	   Usage:
++	      macro=IntExternalResultEnum()
++	"""
++
++	return StringToEnum('IntExternalResult')
++
++def JEnum():
++	"""
++	JENUM - Enum of J
++
++	   Usage:
++	      macro=JEnum()
++	"""
++
++	return StringToEnum('J')
++
++def PatchEnum():
++	"""
++	PATCHENUM - Enum of Patch
++
++	   Usage:
++	      macro=PatchEnum()
++	"""
++
++	return StringToEnum('Patch')
++
++def PatchNodesEnum():
++	"""
++	PATCHNODESENUM - Enum of PatchNodes
++
++	   Usage:
++	      macro=PatchNodesEnum()
++	"""
++
++	return StringToEnum('PatchNodes')
++
++def PatchVerticesEnum():
++	"""
++	PATCHVERTICESENUM - Enum of PatchVertices
++
++	   Usage:
++	      macro=PatchVerticesEnum()
++	"""
++
++	return StringToEnum('PatchVertices')
++
++def PentaP1ElementResultEnum():
++	"""
++	PENTAP1ELEMENTRESULTENUM - Enum of PentaP1ElementResult
++
++	   Usage:
++	      macro=PentaP1ElementResultEnum()
++	"""
++
++	return StringToEnum('PentaP1ElementResult')
++
++def PetscVecExternalResultEnum():
++	"""
++	PETSCVECEXTERNALRESULTENUM - Enum of PetscVecExternalResult
++
++	   Usage:
++	      macro=PetscVecExternalResultEnum()
++	"""
++
++	return StringToEnum('PetscVecExternalResult')
++
++def StringExternalResultEnum():
++	"""
++	STRINGEXTERNALRESULTENUM - Enum of StringExternalResult
++
++	   Usage:
++	      macro=StringExternalResultEnum()
++	"""
++
++	return StringToEnum('StringExternalResult')
++
++def StepEnum():
++	"""
++	STEPENUM - Enum of Step
++
++	   Usage:
++	      macro=StepEnum()
++	"""
++
++	return StringToEnum('Step')
++
++def TimeEnum():
++	"""
++	TIMEENUM - Enum of Time
++
++	   Usage:
++	      macro=TimeEnum()
++	"""
++
++	return StringToEnum('Time')
++
++def TriaP1ElementResultEnum():
++	"""
++	TRIAP1ELEMENTRESULTENUM - Enum of TriaP1ElementResult
++
++	   Usage:
++	      macro=TriaP1ElementResultEnum()
++	"""
++
++	return StringToEnum('TriaP1ElementResult')
++
++def WaterColumnOldEnum():
++	"""
++	WATERCOLUMNOLDENUM - Enum of WaterColumnOld
++
++	   Usage:
++	      macro=WaterColumnOldEnum()
++	"""
++
++	return StringToEnum('WaterColumnOld')
++
++def MinVelEnum():
++	"""
++	MINVELENUM - Enum of MinVel
++
++	   Usage:
++	      macro=MinVelEnum()
++	"""
++
++	return StringToEnum('MinVel')
++
++def MaxVelEnum():
++	"""
++	MAXVELENUM - Enum of MaxVel
++
++	   Usage:
++	      macro=MaxVelEnum()
++	"""
++
++	return StringToEnum('MaxVel')
++
++def MinVxEnum():
++	"""
++	MINVXENUM - Enum of MinVx
++
++	   Usage:
++	      macro=MinVxEnum()
++	"""
++
++	return StringToEnum('MinVx')
++
++def MaxVxEnum():
++	"""
++	MAXVXENUM - Enum of MaxVx
++
++	   Usage:
++	      macro=MaxVxEnum()
++	"""
++
++	return StringToEnum('MaxVx')
++
++def MaxAbsVxEnum():
++	"""
++	MAXABSVXENUM - Enum of MaxAbsVx
++
++	   Usage:
++	      macro=MaxAbsVxEnum()
++	"""
++
++	return StringToEnum('MaxAbsVx')
++
++def MinVyEnum():
++	"""
++	MINVYENUM - Enum of MinVy
++
++	   Usage:
++	      macro=MinVyEnum()
++	"""
++
++	return StringToEnum('MinVy')
++
++def MaxVyEnum():
++	"""
++	MAXVYENUM - Enum of MaxVy
++
++	   Usage:
++	      macro=MaxVyEnum()
++	"""
++
++	return StringToEnum('MaxVy')
++
++def MaxAbsVyEnum():
++	"""
++	MAXABSVYENUM - Enum of MaxAbsVy
++
++	   Usage:
++	      macro=MaxAbsVyEnum()
++	"""
++
++	return StringToEnum('MaxAbsVy')
++
++def MinVzEnum():
++	"""
++	MINVZENUM - Enum of MinVz
++
++	   Usage:
++	      macro=MinVzEnum()
++	"""
++
++	return StringToEnum('MinVz')
++
++def MaxVzEnum():
++	"""
++	MAXVZENUM - Enum of MaxVz
++
++	   Usage:
++	      macro=MaxVzEnum()
++	"""
++
++	return StringToEnum('MaxVz')
++
++def MaxAbsVzEnum():
++	"""
++	MAXABSVZENUM - Enum of MaxAbsVz
++
++	   Usage:
++	      macro=MaxAbsVzEnum()
++	"""
++
++	return StringToEnum('MaxAbsVz')
++
++def RelativeEnum():
++	"""
++	RELATIVEENUM - Enum of Relative
++
++	   Usage:
++	      macro=RelativeEnum()
++	"""
++
++	return StringToEnum('Relative')
++
++def AbsoluteEnum():
++	"""
++	ABSOLUTEENUM - Enum of Absolute
++
++	   Usage:
++	      macro=AbsoluteEnum()
++	"""
++
++	return StringToEnum('Absolute')
++
++def IncrementalEnum():
++	"""
++	INCREMENTALENUM - Enum of Incremental
++
++	   Usage:
++	      macro=IncrementalEnum()
++	"""
++
++	return StringToEnum('Incremental')
++
++def AgressiveMigrationEnum():
++	"""
++	AGRESSIVEMIGRATIONENUM - Enum of AgressiveMigration
++
++	   Usage:
++	      macro=AgressiveMigrationEnum()
++	"""
++
++	return StringToEnum('AgressiveMigration')
++
++def NoneEnum():
++	"""
++	NONEENUM - Enum of None
++
++	   Usage:
++	      macro=NoneEnum()
++	"""
++
++	return StringToEnum('None')
++
++def SoftMigrationEnum():
++	"""
++	SOFTMIGRATIONENUM - Enum of SoftMigration
++
++	   Usage:
++	      macro=SoftMigrationEnum()
++	"""
++
++	return StringToEnum('SoftMigration')
++
++def StokesSolverEnum():
++	"""
++	STOKESSOLVERENUM - Enum of StokesSolver
++
++	   Usage:
++	      macro=StokesSolverEnum()
++	"""
++
++	return StringToEnum('StokesSolver')
++
++def AdjointEnum():
++	"""
++	ADJOINTENUM - Enum of Adjoint
++
++	   Usage:
++	      macro=AdjointEnum()
++	"""
++
++	return StringToEnum('Adjoint')
++
++def ColinearEnum():
++	"""
++	COLINEARENUM - Enum of Colinear
++
++	   Usage:
++	      macro=ColinearEnum()
++	"""
++
++	return StringToEnum('Colinear')
++
++def ControlSteadyEnum():
++	"""
++	CONTROLSTEADYENUM - Enum of ControlSteady
++
++	   Usage:
++	      macro=ControlSteadyEnum()
++	"""
++
++	return StringToEnum('ControlSteady')
++
++def FsetEnum():
++	"""
++	FSETENUM - Enum of Fset
++
++	   Usage:
++	      macro=FsetEnum()
++	"""
++
++	return StringToEnum('Fset')
++
++def Gradient1Enum():
++	"""
++	GRADIENT1ENUM - Enum of Gradient1
++
++	   Usage:
++	      macro=Gradient1Enum()
++	"""
++
++	return StringToEnum('Gradient1')
++
++def Gradient2Enum():
++	"""
++	GRADIENT2ENUM - Enum of Gradient2
++
++	   Usage:
++	      macro=Gradient2Enum()
++	"""
++
++	return StringToEnum('Gradient2')
++
++def Gradient3Enum():
++	"""
++	GRADIENT3ENUM - Enum of Gradient3
++
++	   Usage:
++	      macro=Gradient3Enum()
++	"""
++
++	return StringToEnum('Gradient3')
++
++def GradientEnum():
++	"""
++	GRADIENTENUM - Enum of Gradient
++
++	   Usage:
++	      macro=GradientEnum()
++	"""
++
++	return StringToEnum('Gradient')
++
++def GroundinglineMigrationEnum():
++	"""
++	GROUNDINGLINEMIGRATIONENUM - Enum of GroundinglineMigration
++
++	   Usage:
++	      macro=GroundinglineMigrationEnum()
++	"""
++
++	return StringToEnum('GroundinglineMigration')
++
++def GsetEnum():
++	"""
++	GSETENUM - Enum of Gset
++
++	   Usage:
++	      macro=GsetEnum()
++	"""
++
++	return StringToEnum('Gset')
++
++def IndexEnum():
++	"""
++	INDEXENUM - Enum of Index
++
++	   Usage:
++	      macro=IndexEnum()
++	"""
++
++	return StringToEnum('Index')
++
++def IndexedEnum():
++	"""
++	INDEXEDENUM - Enum of Indexed
++
++	   Usage:
++	      macro=IndexedEnum()
++	"""
++
++	return StringToEnum('Indexed')
++
++def IntersectEnum():
++	"""
++	INTERSECTENUM - Enum of Intersect
++
++	   Usage:
++	      macro=IntersectEnum()
++	"""
++
++	return StringToEnum('Intersect')
++
++def NodalEnum():
++	"""
++	NODALENUM - Enum of Nodal
++
++	   Usage:
++	      macro=NodalEnum()
++	"""
++
++	return StringToEnum('Nodal')
++
++def OldGradientEnum():
++	"""
++	OLDGRADIENTENUM - Enum of OldGradient
++
++	   Usage:
++	      macro=OldGradientEnum()
++	"""
++
++	return StringToEnum('OldGradient')
++
++def OutputFilePointerEnum():
++	"""
++	OUTPUTFILEPOINTERENUM - Enum of OutputFilePointer
++
++	   Usage:
++	      macro=OutputFilePointerEnum()
++	"""
++
++	return StringToEnum('OutputFilePointer')
++
++def PetscOptionsAnalysesEnum():
++	"""
++	PETSCOPTIONSANALYSESENUM - Enum of PetscOptionsAnalyses
++
++	   Usage:
++	      macro=PetscOptionsAnalysesEnum()
++	"""
++
++	return StringToEnum('PetscOptionsAnalyses')
++
++def PetscOptionsStringsEnum():
++	"""
++	PETSCOPTIONSSTRINGSENUM - Enum of PetscOptionsStrings
++
++	   Usage:
++	      macro=PetscOptionsStringsEnum()
++	"""
++
++	return StringToEnum('PetscOptionsStrings')
++
++def QmuErrNameEnum():
++	"""
++	QMUERRNAMEENUM - Enum of QmuErrName
++
++	   Usage:
++	      macro=QmuErrNameEnum()
++	"""
++
++	return StringToEnum('QmuErrName')
++
++def QmuInNameEnum():
++	"""
++	QMUINNAMEENUM - Enum of QmuInName
++
++	   Usage:
++	      macro=QmuInNameEnum()
++	"""
++
++	return StringToEnum('QmuInName')
++
++def QmuOutNameEnum():
++	"""
++	QMUOUTNAMEENUM - Enum of QmuOutName
++
++	   Usage:
++	      macro=QmuOutNameEnum()
++	"""
++
++	return StringToEnum('QmuOutName')
++
++def RegularEnum():
++	"""
++	REGULARENUM - Enum of Regular
++
++	   Usage:
++	      macro=RegularEnum()
++	"""
++
++	return StringToEnum('Regular')
++
++def ScaledEnum():
++	"""
++	SCALEDENUM - Enum of Scaled
++
++	   Usage:
++	      macro=ScaledEnum()
++	"""
++
++	return StringToEnum('Scaled')
++
++def SeparateEnum():
++	"""
++	SEPARATEENUM - Enum of Separate
++
++	   Usage:
++	      macro=SeparateEnum()
++	"""
++
++	return StringToEnum('Separate')
++
++def SsetEnum():
++	"""
++	SSETENUM - Enum of Sset
++
++	   Usage:
++	      macro=SsetEnum()
++	"""
++
++	return StringToEnum('Sset')
++
++def VerboseEnum():
++	"""
++	VERBOSEENUM - Enum of Verbose
++
++	   Usage:
++	      macro=VerboseEnum()
++	"""
++
++	return StringToEnum('Verbose')
++
++def TriangleInterpEnum():
++	"""
++	TRIANGLEINTERPENUM - Enum of TriangleInterp
++
++	   Usage:
++	      macro=TriangleInterpEnum()
++	"""
++
++	return StringToEnum('TriangleInterp')
++
++def BilinearInterpEnum():
++	"""
++	BILINEARINTERPENUM - Enum of BilinearInterp
++
++	   Usage:
++	      macro=BilinearInterpEnum()
++	"""
++
++	return StringToEnum('BilinearInterp')
++
++def NearestInterpEnum():
++	"""
++	NEARESTINTERPENUM - Enum of NearestInterp
++
++	   Usage:
++	      macro=NearestInterpEnum()
++	"""
++
++	return StringToEnum('NearestInterp')
++
++def XYEnum():
++	"""
++	XYENUM - Enum of XY
++
++	   Usage:
++	      macro=XYEnum()
++	"""
++
++	return StringToEnum('XY')
++
++def XYZPEnum():
++	"""
++	XYZPENUM - Enum of XYZP
++
++	   Usage:
++	      macro=XYZPEnum()
++	"""
++
++	return StringToEnum('XYZP')
++
++def OptionEnum():
++	"""
++	OPTIONENUM - Enum of Option
++
++	   Usage:
++	      macro=OptionEnum()
++	"""
++
++	return StringToEnum('Option')
++
++def OptionCellEnum():
++	"""
++	OPTIONCELLENUM - Enum of OptionCell
++
++	   Usage:
++	      macro=OptionCellEnum()
++	"""
++
++	return StringToEnum('OptionCell')
++
++def OptionCharEnum():
++	"""
++	OPTIONCHARENUM - Enum of OptionChar
++
++	   Usage:
++	      macro=OptionCharEnum()
++	"""
++
++	return StringToEnum('OptionChar')
++
++def OptionStructEnum():
++	"""
++	OPTIONSTRUCTENUM - Enum of OptionStruct
++
++	   Usage:
++	      macro=OptionStructEnum()
++	"""
++
++	return StringToEnum('OptionStruct')
++
++def OptionDoubleEnum():
++	"""
++	OPTIONDOUBLEENUM - Enum of OptionDouble
++
++	   Usage:
++	      macro=OptionDoubleEnum()
++	"""
++
++	return StringToEnum('OptionDouble')
++
++def OptionLogicalEnum():
++	"""
++	OPTIONLOGICALENUM - Enum of OptionLogical
++
++	   Usage:
++	      macro=OptionLogicalEnum()
++	"""
++
++	return StringToEnum('OptionLogical')
++
++def PatersonEnum():
++	"""
++	PATERSONENUM - Enum of Paterson
++
++	   Usage:
++	      macro=PatersonEnum()
++	"""
++
++	return StringToEnum('Paterson')
++
++def ArrheniusEnum():
++	"""
++	ARRHENIUSENUM - Enum of Arrhenius
++
++	   Usage:
++	      macro=ArrheniusEnum()
++	"""
++
++	return StringToEnum('Arrhenius')
++
++def MaximumNumberOfEnums():
++	"""
++	MAXIMUMNUMBEROFENUMS - Enum of MaximumNumberOfEnums
++
++	   Usage:
++	      macro=MaximumNumberOfEnums()
++	"""
++
++	return 448
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsAPosEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsAPosEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsAPosEnum.m	(revision 12685)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsAPosEnum()
++%SURFACEFORCINGSAPOSENUM - Enum of SurfaceforcingsAPos
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsAPosEnum()
++
++macro=StringToEnum('SurfaceforcingsAPos');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsANegEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsANegEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsANegEnum.m	(revision 12685)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsANegEnum()
++%SURFACEFORCINGSANEGENUM - Enum of SurfaceforcingsANeg
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsANegEnum()
++
++macro=StringToEnum('SurfaceforcingsANeg');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsIssmbgradientsEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsIssmbgradientsEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsIssmbgradientsEnum.m	(revision 12685)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsIssmbgradientsEnum()
++%SURFACEFORCINGSISSMBGRADIENTSENUM - Enum of SurfaceforcingsIssmbgradients
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsIssmbgradientsEnum()
++
++macro=StringToEnum('SurfaceforcingsIssmbgradients');
Index: /issm/oecreview/Archive/12678-13393/ISSM-12685-12686.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12685-12686.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12685-12686.diff	(revision 13394)
@@ -0,0 +1,20 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 12685)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 12686)
+@@ -28,7 +28,6 @@
+ 			if file.find(".pyc") == -1:
+ 				#add to path 
+ 				sys.path.append(root)
+-				print root, "\n"
+ 				file=os.path.splitext(file)[0]
+ 				#__import__(file)
+ 
+@@ -40,7 +39,6 @@
+ 			if file.find(".pyc") == -1:
+ 				#add to path 
+ 				sys.path.append(root)
+-				print root, "\n"
+ 				file=os.path.splitext(file)[0]
+ 				#__import__(file)
+ 				
Index: /issm/oecreview/Archive/12678-13393/ISSM-12686-12687.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12686-12687.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12686-12687.diff	(revision 13394)
@@ -0,0 +1,52 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh	(revision 12686)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh	(revision 12687)
+@@ -200,3 +200,15 @@
+ 
+ #GIT
+ GIT_DIR="$ISSM_DIR/externalpackages/git"
++
++#NCVIEW
++NCVIEW_DIR="$ISSM_DIR/externalpackages/ncview"
++
++#TCLX
++TCLX_DIR="$ISSM_DIR/externalpackages/tclx/install/lib/tclx8.4"
++
++#ASPELL
++ASPELL_DIR="$ISSM_DIR/externalpackages/aspell/"
++
++#HDF5
++export HDF5_DIR=$ISSM_DIR/externalpackages/hdf5/install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12686)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12687)
+@@ -269,3 +269,27 @@
+ 
+ #GIT
+ export PATH="$PATH:$GIT_DIR/install/bin"
++
++#NCVIEW
++export PATH="$PATH:$NCVIEW_DIR/install"
++
++#TCLX
++export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TCLX_DIR"
++export LD_RUN_PATH="$LD_RUN_PATH:$TCLX_DIR"
++
++
++#ASPELL
++export PATH="$ASPELL_DIR/install/bin:$PATH"
++
++
++#ESMF
++export ESMF_DIR=$ISSM_DIR/externalpackages/esmf/esmf
++export ESMF_COMPILER=gfortran
++export ESMF_COMM=mpich2
++
++#HDF5
++export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$HDF5_DIR/lib"
++export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HDF5_DIR/lib"
++export LIBRARY_PATH="$LIBRARY_PATH:$HDF5_DIR/lib"
++export C_INCLUDE_PATH="$C_INCLUDE_PATH:$HDF5_DIR/include"
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12687-12688.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12687-12688.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12687-12688.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/ad/todo
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/ad/todo	(revision 12687)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/ad/todo	(revision 12688)
+@@ -40,3 +40,5 @@
+ 
+ Create an alloc layer with template functions for new and delete.
+ Check that the new code  is modular --without-kml, options are up to date.
++
++Replace memcpy, realloc with x layers.  Replace all calls to malloc and free in the code.
Index: /issm/oecreview/Archive/12678-13393/ISSM-12688-12689.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12688-12689.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12688-12689.diff	(revision 13394)
@@ -0,0 +1,49 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh	(revision 12688)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh	(revision 12689)
+@@ -1,24 +1,8 @@
+ #!/bin/sh
+ 
+-#petsc 3.2
+-#mpich 1.4
+-
+ ./configure \
+-	--with-serial=no\
+ 	--prefix=$ISSM_DIR \
+-	--with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
+-	--with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
+-	--with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
+-	--without-blas-lapack-dir \
+-	--with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install \
+-	--with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
+-	--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+-	--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-adic2-dir=$ISSM_DIR/externalpackages/adic/install/ \
+-	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install/ \
+-	--with-numthreads=8 \
++	--without-modules\
+ 	--without-thermal \
+ 	--without-control \
+ 	--without-hydrology \
+@@ -30,14 +14,7 @@
+ 	--without-steadystate \
+ 	--without-transient \
+ 	--without-3d \
+-	--without-groundingline
+- 
+-#--without-prognostic \
+-#--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
+-#--with-petsc-arch=$ISSM_ARCH \
+-#--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+-#--with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+-#--with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
+-#--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+-#--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+-#--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--without-groundingline \
++	--without-kriging  \
++	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install
++	#--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install\
Index: /issm/oecreview/Archive/12678-13393/ISSM-12689-12690.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12689-12690.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12689-12690.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/exp2kml.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/exp2kml.m	(revision 12689)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/exp2kml.m	(revision 12690)
+@@ -7,7 +7,7 @@
+ 
+ 
+ %First, read exp file
+-domain=expread(input,1);
++domain=expread(input);
+ 
+ 
+ %then transform: 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12690-12691.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12690-12691.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12690-12691.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcontract.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcontract.m	(revision 12690)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcontract.m	(revision 12691)
+@@ -7,7 +7,7 @@
+ %   See also EXPMASTER, EXPDOC
+ 
+ 
+-contour=expread(oldfile,1);
++contour=expread(oldfile);
+ num=numel(contour.x);
+ 
+ normal=zeros(num-1,2);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12691-12692.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12691-12692.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12691-12692.diff	(revision 13394)
@@ -0,0 +1,26 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/isbasin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/isbasin.m	(revision 12691)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/isbasin.m	(revision 12692)
+@@ -8,7 +8,7 @@
+ 
+ 
+ %First, load basin names:
+-load([issmdir '/projects/ModelData/Names/Names.mat']);
++load([jplsvn '/projects/ModelData/Names/Names.mat']);
+ 
+ 
+ %go through names: 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/showbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/showbasins.m	(revision 12691)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/showbasins.m	(revision 12692)
+@@ -44,7 +44,7 @@
+ end
+ 
+ %Ok, find basin we are talking about: 
+-load([issmdir '/projects/ModelData/Names/Names.mat']);
++load([jplsvn '/projects/ModelData/Names/Names.mat']);
+ 
+ %Get xlim and ylim, and convert into lat,long: 
+ xlimits=xlim; x0=xlimits(1); x1=xlimits(2);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12692-12693.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12692-12693.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12692-12693.diff	(revision 13394)
@@ -0,0 +1,34 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install.sh	(revision 12693)
+@@ -0,0 +1,23 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/modules-3.2.9c.tar.gz modules-3.2.9c.tar.gz
++
++#Untar and move python into install directory
++tar -zxvf  modules-3.2.9c.tar.gz
++mv modules-3.2.9 install
++
++exit 1
++
++#Configure doxygen
++cd install
++./configure \
++  --prefix "$ISSM_DIR/externalpackages/modules/install" \
++  --without-x
++
++#compile and install
++make
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12694-12695.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12694-12695.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12694-12695.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install.sh	(revision 12694)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install.sh	(revision 12695)
+@@ -10,8 +10,6 @@
+ tar -zxvf  modules-3.2.9c.tar.gz
+ mv modules-3.2.9 install
+ 
+-exit 1
+-
+ #Configure doxygen
+ cd install
+ ./configure \
Index: /issm/oecreview/Archive/12678-13393/ISSM-12695-12696.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12695-12696.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12695-12696.diff	(revision 13394)
@@ -0,0 +1,499 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 12696)
+@@ -34,10 +34,10 @@
+ 	IssmPDouble   start_init, finish_init;
+ 	int      ierr;
+ 
+-	/*PETSc profiling*/   
+-	bool petsc_profiling = false;
+-	PetscLogDouble petscTime_start, petscTime_finish;
+-	PetscLogDouble petsc_memUse, petscFlops_start, petscFlops_finish;
++	/*profiling*/   
++	bool profiling = false;
++	IssmPDouble Time_start, Flops_start;
++	IssmPDouble Solution_time, Memory_use, Current_flops;
+ 
+ 	ISSMBOOT();
+ 
+@@ -98,7 +98,7 @@
+ 	femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
+ 	femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
+ 	femmodel->parameters->FindParam(&tao_analysis,InversionTaoEnum);
+-   femmodel->parameters->FindParam(&petsc_profiling,DebugPetscProfilingEnum); 
++	femmodel->parameters->FindParam(&profiling,DebugProfilingEnum); 
+ 
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime();
+@@ -113,10 +113,7 @@
+ 	start_core=(IssmPDouble)clock();
+ 	#endif
+ 	
+-	if(petsc_profiling){
+-		PetscGetTime(&petscTime_start);
+-		PetscGetFlops(&petscFlops_start);
+-	}
++	if(profiling)ProfilingStart(&Time_start,&Flops_start);
+ 
+ 	if(dakota_analysis){
+ 		#ifdef _HAVE_DAKOTA_
+@@ -139,20 +136,14 @@
+ 		solutioncore(femmodel);
+ 	}
+ 
+-	if(petsc_profiling){
+-		PetscGetTime(&petscTime_finish);
+-		PetscGetFlops(&petscFlops_finish);
+-		PetscMemoryGetCurrentUsage(&petsc_memUse);
+-
+-		_pprintLine_("PETSc elapsed time  : " << (petscTime_finish-petscTime_start) << "  Seconds");
+-		_pprintLine_("PETSc elapsed flops : " << (petscFlops_finish-petscFlops_start) << "  Flops");
+-		_pprintLine_("PETSc memory used   : " << petsc_memUse << "  Bytes");
+-		
+-		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, PetscProfilingSolutionTimeEnum, (petscTime_finish-petscTime_start), 1, 0));
+-		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, PetscProfilingCurrentMemEnum, petsc_memUse, 1, 0));
+-		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, PetscProfilingCurrentFlopsEnum, (petscFlops_finish-petscFlops_start), 1, 0));
++	if(profiling){
++		ProfilingEnd(&Solution_time,&Memory_use,&Current_flops,Time_start,Flops_start);
++		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, ProfilingSolutionTimeEnum, Solution_time, 1, 0));
++		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, ProfilingCurrentMemEnum, Memory_use, 1, 0));
++		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, ProfilingCurrentFlopsEnum, Current_flops, 1, 0));
+ 	}
+ 
++
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
+ 	#else
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12696)
+@@ -148,10 +148,10 @@
+ 	SettingsOutputFrequencyEnum,
+ 	SettingsResultsAsPatchesEnum,
+ 	SettingsWaitonlockEnum,
+-	DebugPetscProfilingEnum,
+-	PetscProfilingCurrentMemEnum,
+-	PetscProfilingCurrentFlopsEnum,
+-	PetscProfilingSolutionTimeEnum,
++	DebugProfilingEnum,
++	ProfilingCurrentMemEnum,
++	ProfilingCurrentFlopsEnum,
++	ProfilingSolutionTimeEnum,
+ 	MaxIterationConvergenceFlagEnum,
+ 	SteadystateMaxiterEnum,
+ 	SteadystateNumRequestedOutputsEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/shared.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/shared.h	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/shared.h	(revision 12696)
+@@ -8,16 +8,17 @@
+ #include "Alloc/alloc.h"
+ #include "Alloc/alloc_module.h"
+ #include "Alloc/xNewDelete.h"
+-#include "MemOps/xMemCpy.h"
++#include "Bamg/shared.h"
++#include "Elements/elements.h"
+ #include "Exceptions/exceptions.h"
+ #include "Exp/exp.h"
+-#include "TriMesh/trimesh.h"
+-#include "Sorting/sorting.h"
+-#include "Elements/elements.h"
+ #include "Matrix/matrix.h"
++#include "MemOps/xMemCpy.h"
+ #include "Numerics/numerics.h"
++#include "Sorting/sorting.h"
++#include "Sys/sys.h"
+ #include "Threads/issm_threads.h"
+-#include "Bamg/shared.h"
++#include "TriMesh/trimesh.h"
+ #include "Wrapper/wrappershared.h"
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp	(revision 12696)
+@@ -0,0 +1,42 @@
++/*!\file:  ProfilingEnd.cpp
++ * \brief ProfilingEnd.c: finalize profiling after calling a routine. Needs to mirror a ProfilingStart routine.
++ */
++
++/*Include files: {{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++#include "../../include/macros.h"
++#include "../shared.h"
++/*}}}*/
++
++void ProfilingEnd(double* pSolution_time, double* pMemory_use, double* pCurrent_flops, double Time_start, double Flops_start){
++
++	double Solution_time, Memory_use, Current_flops;
++	double Time_finish, Flops_finish, memUse;
++	
++	#ifdef _HAVE_PETSC_
++	PetscGetTime(&Time_finish);
++	PetscGetFlops(&Flops_finish);
++	PetscMemoryGetCurrentUsage(&memUse);
++	
++	Solution_time=Time_finish-Time_start;
++	Current_flops=Flops_finish-Flops_start;
++	_pprintLine_("PETSc elapsed time  : " << Solution_time << "  Seconds");
++	_pprintLine_("PETSc elapsed flops : " << Current_flops << "  Flops");
++	_pprintLine_("PETSc memory used   : " << memUse << "  Bytes");
++	#else
++		_error_("Profiling not supported under this numerical toolkit");
++	#endif
++
++	/*Assign pointers: */
++	*pSolution_time=Solution_time;
++	*pMemory_use=memUse;
++	*pCurrent_flops=Current_flops;
++	return;
++}
++
++
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/sys.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/sys.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/sys.h	(revision 12696)
+@@ -0,0 +1,12 @@
++/* \file sys.h
++ * \brief: header file for ISSM system routines (profiling, timing, etc ...)
++ */
++
++
++#ifndef _ISSM_SYS_H_
++#define _ISSM_SYS_H_
++
++void ProfilingEnd(double* pSolution_time, double* pMemory_use, double* pCurrent_flops, double Time_start, double Flops_start);
++void ProfilingStart(double* pTime_start, double* pFlops_start);
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp	(revision 12696)
+@@ -0,0 +1,31 @@
++/*!\file:  ProfilingStart.cpp
++ * \brief ProfilingStart.c: initialize profiling before calling a routine
++ */
++
++
++/*Include files: {{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++#include "../../include/macros.h"
++#include "../shared.h"
++/*}}}*/
++
++void ProfilingStart(double* pTime_start, double* pFlops_start){
++	
++	double Time_start, Flops_start;
++	
++	#ifdef _HAVE_PETSC_
++		PetscGetTime(&Time_start);
++		PetscGetFlops(&Flops_start );
++	#else
++		_error_("Profiling not supported under this numerical toolkit");
++	#endif
++
++	/*Assign pointers: */
++	*pTime_start=Time_start;
++	*pFlops_start=Flops_start;
++	return;
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12696)
+@@ -157,10 +157,10 @@
+ 	      else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
+ 	      else if (strcmp(name,"SettingsResultsAsPatches")==0) return SettingsResultsAsPatchesEnum;
+ 	      else if (strcmp(name,"SettingsWaitonlock")==0) return SettingsWaitonlockEnum;
+-	      else if (strcmp(name,"DebugPetscProfiling")==0) return DebugPetscProfilingEnum;
+-	      else if (strcmp(name,"PetscProfilingCurrentMem")==0) return PetscProfilingCurrentMemEnum;
+-	      else if (strcmp(name,"PetscProfilingCurrentFlops")==0) return PetscProfilingCurrentFlopsEnum;
+-	      else if (strcmp(name,"PetscProfilingSolutionTime")==0) return PetscProfilingSolutionTimeEnum;
++	      else if (strcmp(name,"DebugProfiling")==0) return DebugProfilingEnum;
++	      else if (strcmp(name,"ProfilingCurrentMem")==0) return ProfilingCurrentMemEnum;
++	      else if (strcmp(name,"ProfilingCurrentFlops")==0) return ProfilingCurrentFlopsEnum;
++	      else if (strcmp(name,"ProfilingSolutionTime")==0) return ProfilingSolutionTimeEnum;
+ 	      else if (strcmp(name,"MaxIterationConvergenceFlag")==0) return MaxIterationConvergenceFlagEnum;
+ 	      else if (strcmp(name,"SteadystateMaxiter")==0) return SteadystateMaxiterEnum;
+ 	      else if (strcmp(name,"SteadystateNumRequestedOutputs")==0) return SteadystateNumRequestedOutputsEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12696)
+@@ -153,10 +153,10 @@
+ 		case SettingsOutputFrequencyEnum : return "SettingsOutputFrequency";
+ 		case SettingsResultsAsPatchesEnum : return "SettingsResultsAsPatches";
+ 		case SettingsWaitonlockEnum : return "SettingsWaitonlock";
+-		case DebugPetscProfilingEnum : return "DebugPetscProfiling";
+-		case PetscProfilingCurrentMemEnum : return "PetscProfilingCurrentMem";
+-		case PetscProfilingCurrentFlopsEnum : return "PetscProfilingCurrentFlops";
+-		case PetscProfilingSolutionTimeEnum : return "PetscProfilingSolutionTime";
++		case DebugProfilingEnum : return "DebugProfiling";
++		case ProfilingCurrentMemEnum : return "ProfilingCurrentMem";
++		case ProfilingCurrentFlopsEnum : return "ProfilingCurrentFlops";
++		case ProfilingSolutionTimeEnum : return "ProfilingSolutionTime";
+ 		case MaxIterationConvergenceFlagEnum : return "MaxIterationConvergenceFlag";
+ 		case SteadystateMaxiterEnum : return "SteadystateMaxiter";
+ 		case SteadystateNumRequestedOutputsEnum : return "SteadystateNumRequestedOutputs";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 12696)
+@@ -56,7 +56,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject(PrognosticPenaltyFactorEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(ThermalPenaltyFactorEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(SettingsLowmemEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject(DebugPetscProfilingEnum));
++	parameters->AddObject(iomodel->CopyConstantObject(DebugProfilingEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(MeshAverageVertexConnectivityEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(ConstantsReferencetemperatureEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(BalancethicknessStabilizationEnum));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12696)
+@@ -208,6 +208,9 @@
+ 					./shared/Wrapper/wrappershared.h\
+ 					./shared/Wrapper/ModuleBoot.cpp\
+ 					./shared/Wrapper/ModuleEnd.cpp\
++					./shared/Sys/sys.h\
++					./shared/Sys/ProfilingStart.cpp\
++					./shared/Sys/ProfilingEnd.cpp\
+ 					./toolkits/metis/metisincludes.h\
+ 					./toolkits/issm/issmtoolkit.h\
+ 					./toolkits/issm/SeqVec.h\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/PetscProfilingSolutionTimeEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/PetscProfilingSolutionTimeEnum.m	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/PetscProfilingSolutionTimeEnum.m	(revision 12696)
+@@ -1,11 +0,0 @@
+-function macro=PetscProfilingSolutionTimeEnum()
+-%PETSCPROFILINGSOLUTIONTIMEENUM - Enum of PetscProfilingSolutionTime
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+-%            Please read src/c/EnumDefinitions/README for more information
+-%
+-%   Usage:
+-%      macro=PetscProfilingSolutionTimeEnum()
+-
+-macro=StringToEnum('PetscProfilingSolutionTime');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/PetscProfilingCurrentFlopsEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/PetscProfilingCurrentFlopsEnum.m	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/PetscProfilingCurrentFlopsEnum.m	(revision 12696)
+@@ -1,11 +0,0 @@
+-function macro=PetscProfilingCurrentFlopsEnum()
+-%PETSCPROFILINGCURRENTFLOPSENUM - Enum of PetscProfilingCurrentFlops
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+-%            Please read src/c/EnumDefinitions/README for more information
+-%
+-%   Usage:
+-%      macro=PetscProfilingCurrentFlopsEnum()
+-
+-macro=StringToEnum('PetscProfilingCurrentFlops');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/PetscProfilingCurrentMemEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/PetscProfilingCurrentMemEnum.m	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/PetscProfilingCurrentMemEnum.m	(revision 12696)
+@@ -1,11 +0,0 @@
+-function macro=PetscProfilingCurrentMemEnum()
+-%PETSCPROFILINGCURRENTMEMENUM - Enum of PetscProfilingCurrentMem
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+-%            Please read src/c/EnumDefinitions/README for more information
+-%
+-%   Usage:
+-%      macro=PetscProfilingCurrentMemEnum()
+-
+-macro=StringToEnum('PetscProfilingCurrentMem');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/DebugPetscProfilingEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/DebugPetscProfilingEnum.m	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/DebugPetscProfilingEnum.m	(revision 12696)
+@@ -1,11 +0,0 @@
+-function macro=DebugPetscProfilingEnum()
+-%DEBUGPETSCPROFILINGENUM - Enum of DebugPetscProfiling
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+-%            Please read src/c/EnumDefinitions/README for more information
+-%
+-%   Usage:
+-%      macro=DebugPetscProfilingEnum()
+-
+-macro=StringToEnum('DebugPetscProfiling');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/DebugProfilingEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/DebugProfilingEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/DebugProfilingEnum.m	(revision 12696)
+@@ -0,0 +1,11 @@
++function macro=DebugProfilingEnum()
++%DEBUGPROFILINGENUM - Enum of DebugProfiling
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=DebugProfilingEnum()
++
++macro=StringToEnum('DebugProfiling');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ProfilingSolutionTimeEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ProfilingSolutionTimeEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ProfilingSolutionTimeEnum.m	(revision 12696)
+@@ -0,0 +1,11 @@
++function macro=ProfilingSolutionTimeEnum()
++%PROFILINGSOLUTIONTIMEENUM - Enum of ProfilingSolutionTime
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=ProfilingSolutionTimeEnum()
++
++macro=StringToEnum('ProfilingSolutionTime');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ProfilingCurrentFlopsEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ProfilingCurrentFlopsEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ProfilingCurrentFlopsEnum.m	(revision 12696)
+@@ -0,0 +1,11 @@
++function macro=ProfilingCurrentFlopsEnum()
++%PROFILINGCURRENTFLOPSENUM - Enum of ProfilingCurrentFlops
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=ProfilingCurrentFlopsEnum()
++
++macro=StringToEnum('ProfilingCurrentFlops');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ProfilingCurrentMemEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ProfilingCurrentMemEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ProfilingCurrentMemEnum.m	(revision 12696)
+@@ -0,0 +1,11 @@
++function macro=ProfilingCurrentMemEnum()
++%PROFILINGCURRENTMEMENUM - Enum of ProfilingCurrentMem
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=ProfilingCurrentMemEnum()
++
++macro=StringToEnum('ProfilingCurrentMem');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12696)
+@@ -1376,45 +1376,45 @@
+ 
+ 	return StringToEnum('SettingsWaitonlock')
+ 
+-def DebugPetscProfilingEnum():
++def DebugProfilingEnum():
+ 	"""
+-	DEBUGPETSCPROFILINGENUM - Enum of DebugPetscProfiling
++	DEBUGPROFILINGENUM - Enum of DebugProfiling
+ 
+ 	   Usage:
+-	      macro=DebugPetscProfilingEnum()
++	      macro=DebugProfilingEnum()
+ 	"""
+ 
+-	return StringToEnum('DebugPetscProfiling')
++	return StringToEnum('DebugProfiling')
+ 
+-def PetscProfilingCurrentMemEnum():
++def ProfilingCurrentMemEnum():
+ 	"""
+-	PETSCPROFILINGCURRENTMEMENUM - Enum of PetscProfilingCurrentMem
++	PROFILINGCURRENTMEMENUM - Enum of ProfilingCurrentMem
+ 
+ 	   Usage:
+-	      macro=PetscProfilingCurrentMemEnum()
++	      macro=ProfilingCurrentMemEnum()
+ 	"""
+ 
+-	return StringToEnum('PetscProfilingCurrentMem')
++	return StringToEnum('ProfilingCurrentMem')
+ 
+-def PetscProfilingCurrentFlopsEnum():
++def ProfilingCurrentFlopsEnum():
+ 	"""
+-	PETSCPROFILINGCURRENTFLOPSENUM - Enum of PetscProfilingCurrentFlops
++	PROFILINGCURRENTFLOPSENUM - Enum of ProfilingCurrentFlops
+ 
+ 	   Usage:
+-	      macro=PetscProfilingCurrentFlopsEnum()
++	      macro=ProfilingCurrentFlopsEnum()
+ 	"""
+ 
+-	return StringToEnum('PetscProfilingCurrentFlops')
++	return StringToEnum('ProfilingCurrentFlops')
+ 
+-def PetscProfilingSolutionTimeEnum():
++def ProfilingSolutionTimeEnum():
+ 	"""
+-	PETSCPROFILINGSOLUTIONTIMEENUM - Enum of PetscProfilingSolutionTime
++	PROFILINGSOLUTIONTIMEENUM - Enum of ProfilingSolutionTime
+ 
+ 	   Usage:
+-	      macro=PetscProfilingSolutionTimeEnum()
++	      macro=ProfilingSolutionTimeEnum()
+ 	"""
+ 
+-	return StringToEnum('PetscProfilingSolutionTime')
++	return StringToEnum('ProfilingSolutionTime')
+ 
+ def MaxIterationConvergenceFlagEnum():
+ 	"""
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/debug.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/debug.m	(revision 12695)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/debug.m	(revision 12696)
+@@ -7,7 +7,7 @@
+ 	properties (SetAccess=public) 
+ 		valgrind = false;
+ 		gprof    = false;
+-		petsc_profiling = false;
++		profiling = false;
+ 	end
+ 	methods
+ 		function obj = debug(varargin) % {{{
+@@ -26,11 +26,11 @@
+ 
+ 			fielddisplay(obj,'valgrind','use Valgrind to debug (0 or 1)');
+ 			fielddisplay(obj,'gprof','use gnu-profiler to find out where the time is spent');
+-			fielddisplay(obj,'petsc_profiling','enables PETSc profiling (memory, flops, time)');
++			fielddisplay(obj,'profiling','enables profiling (memory, flops, time)');
+ 
+ 		end % }}}
+ 		function marshall(obj,fid) % {{{
+-			WriteData(fid,'object',obj,'fieldname','petsc_profiling','format','Boolean');
++			WriteData(fid,'object',obj,'fieldname','profiling','format','Boolean');
+ 		end % }}}
+ 	end
+ end
Index: /issm/oecreview/Archive/12678-13393/ISSM-12696-12697.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12696-12697.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12696-12697.diff	(revision 13394)
@@ -0,0 +1,47 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh	(revision 12696)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh	(revision 12697)
+@@ -9,42 +9,3 @@
+ 
+ cd $ISSM_DIR
+ autoreconf -iv -I m4
+-
+-exit 0
+-
+-ACLOCAL="$ISSM_DIR/externalpackages/automake/install/bin/aclocal"
+-AUTOCONF="$ISSM_DIR/externalpackages/autoconf/install/bin/autoconf"
+-AUTOHEAD="$ISSM_DIR/externalpackages/autoconf/install/bin/autoheader"
+-AUTOMAKE="$ISSM_DIR/externalpackages/automake/install/bin/automake"
+-
+-echo "removing config.cach"
+-rm -rf config.cach
+-rm -rf aclocal.m4
+-
+-if [ ! -f "$ACLOCAL" ]
+-then echo "issm aclocal not found, calling default aclocal" 
+-	aclocal -I m4
+-else echo "Calling aclocal" 
+-	$ACLOCAL -I m4
+-fi
+-
+-if [ ! -f "$AUTOCONF" ]
+-then echo "issm autoconf not found, calling default aclocal" 
+-	autoconf
+-else echo "Calling autoconf" 
+-	$AUTOCONF
+-fi
+-
+-if [ ! -f "$AUTOHEAD" ]
+-then echo "issm autoheader not found, calling default aclocal" 
+-	autoheader
+-else echo "Calling autoheader" 
+-	$AUTOHEAD
+-fi
+-
+-if [ ! -f "$AUTOMAKE" ]
+-then echo "issm automake  not found, calling default aclocal" 
+-	automake
+-else echo "Calling automake " 
+-	$AUTOMAKE -a
+-fi
Index: /issm/oecreview/Archive/12678-13393/ISSM-12697-12698.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12697-12698.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12697-12698.diff	(revision 13394)
@@ -0,0 +1,59 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12697)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12698)
+@@ -171,6 +171,7 @@
+ 	case 352, name='SquareSheetConstrainedEnthalpyTranParallel';
+ 	case 353, name='SquareSheetConstrainedTransP3dEnthSerial';
+ 	case 354, name='SquareSheetConstrainedTransP3dEnthParallel';
++	case 356, name='SquareSheetConstrainedSmbGradients2dParallel';
+ 	case 401, name='SquareSheetShelfDiagM2dSerial';
+ 	case 402, name='SquareSheetShelfDiagM2dParallel';
+ 	case 403, name='SquareSheetShelfDiagM3dSerial';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m	(revision 12698)
+@@ -0,0 +1,42 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.surfaceforcings.issmbgradients=1;
++md.surfaceforcings.smb_pos_max=5000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
++md.surfaceforcings.smb_pos_min=1250. + 0.00005*md.mesh.x -0.0001*md.mesh.y;
++md.surfaceforcings.a_pos=15000. - 0.000051*md.mesh.x + 0.00011*md.mesh.y;
++md.surfaceforcings.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y;
++md.surfaceforcings.a_neg=-20000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
++md.surfaceforcings.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y;
++md.surfaceforcings.hc=(md.surfaceforcings.a_pos-md.surfaceforcings.a_neg)./(md.surfaceforcings.b_neg-md.surfaceforcings.b_pos);
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Bed1','Surface1','Thickness1','SMB1','Vx2','Vy2','Vel2','Bed2','Surface2','Thickness2','SMB2','Vx3','Vy3','Vel3','Bed3','Surface3','Thickness3','SMB3'};
++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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	};
Index: /issm/oecreview/Archive/12678-13393/ISSM-12698-12699.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12698-12699.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12698-12699.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m	(revision 12698)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m	(revision 12699)
+@@ -34,7 +34,6 @@
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vel),...
+-	(md.results.TransientSolution(3).Pressure),...
+ 	(md.results.TransientSolution(3).Bed),...
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
Index: /issm/oecreview/Archive/12678-13393/ISSM-12699-12700.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12699-12700.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12699-12700.diff	(revision 13394)
@@ -0,0 +1,68 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test358.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test358.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test358.m	(revision 12700)
+@@ -0,0 +1,51 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.surfaceforcings.issmbgradients=1;
++md.surfaceforcings.smb_pos_max=5000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
++md.surfaceforcings.smb_pos_min=1250. + 0.00005*md.mesh.x -0.0001*md.mesh.y;
++md.surfaceforcings.a_pos=15000. - 0.000051*md.mesh.x + 0.00011*md.mesh.y;
++md.surfaceforcings.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y;
++md.surfaceforcings.a_neg=-20000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
++md.surfaceforcings.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y;
++md.surfaceforcings.hc=(md.surfaceforcings.a_pos-md.surfaceforcings.a_neg)./(md.surfaceforcings.b_neg-md.surfaceforcings.b_pos);
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Bed1','Surface1','Thickness1','Temperature1','SMB1','Vx2','Vy2','Vz2','Vel2','Bed2','Surface2','Thickness2','Temperature2','SMB2','Vx3','Vy3','Vz3','Vel3','Bed3','Surface3','Thickness3','Temperature3','SMB3'};
++field_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++						1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++						1e-09,5e-10,1e-10,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).Vz),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12699)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12700)
+@@ -172,6 +172,7 @@
+ 	case 353, name='SquareSheetConstrainedTransP3dEnthSerial';
+ 	case 354, name='SquareSheetConstrainedTransP3dEnthParallel';
+ 	case 356, name='SquareSheetConstrainedSmbGradients2dParallel';
++	case 358, name='SquareSheetConstrainedSmbGradients3dParallel';
+ 	case 401, name='SquareSheetShelfDiagM2dSerial';
+ 	case 402, name='SquareSheetShelfDiagM2dParallel';
+ 	case 403, name='SquareSheetShelfDiagM3dSerial';
Index: /issm/oecreview/Archive/12678-13393/ISSM-12700-12701.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12700-12701.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12700-12701.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp	(revision 12700)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp	(revision 12701)
+@@ -10,6 +10,7 @@
+ #endif
+ #include "../../include/macros.h"
+ #include "../shared.h"
++#include "../../io/io.h"
+ /*}}}*/
+ 
+ void ProfilingEnd(double* pSolution_time, double* pMemory_use, double* pCurrent_flops, double Time_start, double Flops_start){
Index: /issm/oecreview/Archive/12678-13393/ISSM-12701-12702.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12701-12702.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12701-12702.diff	(revision 13394)
@@ -0,0 +1,28 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive358.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive358.mat
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive358.mat	(revision 12701)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive358.mat	(revision 12702)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive358.mat
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive356.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive356.mat
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive356.mat	(revision 12701)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive356.mat	(revision 12702)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive356.mat
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12702-12703.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12702-12703.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12702-12703.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12702)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12703)
+@@ -1,7 +1,7 @@
+ # Process this file with autoconf to produce a configure script.
+ 
+ #AUTOCONF
+-AC_INIT([ISSM],[4.2],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
++AC_INIT([ISSM],[4.2.1],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
+ AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
+ AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
+ AC_CANONICAL_TARGET                       #Determine the system type
Index: /issm/oecreview/Archive/12678-13393/ISSM-12703-12704.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12703-12704.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12703-12704.diff	(revision 13394)
@@ -0,0 +1,1193 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12704)
+@@ -705,16 +705,6 @@
+ syn keyword cConstant SurfaceEnum
+ syn keyword cConstant SurfaceforcingsPrecipitationEnum
+ syn keyword cConstant SurfaceforcingsMassBalanceEnum
+-syn keyword cConstant SurfaceforcingsIspddEnum
+-syn keyword cConstant SurfaceforcingsIssmbgradientsEnum
+-syn keyword cConstant SurfaceforcingsMonthlytemperaturesEnum
+-syn keyword cConstant SurfaceforcingsHcEnum
+-syn keyword cConstant SurfaceforcingsSmbPosMaxEnum
+-syn keyword cConstant SurfaceforcingsSmbPosMinEnum
+-syn keyword cConstant SurfaceforcingsAPosEnum
+-syn keyword cConstant SurfaceforcingsBPosEnum
+-syn keyword cConstant SurfaceforcingsANegEnum
+-syn keyword cConstant SurfaceforcingsBNegEnum
+ syn keyword cConstant ThermalMaxiterEnum
+ syn keyword cConstant ThermalPenaltyFactorEnum
+ syn keyword cConstant ThermalPenaltyLockEnum
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 12704)
+@@ -7,13 +7,13 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
++#include <cstring> 
++#include <mex.h>
+ #include "../../shared/shared.h"
+ #include "../../io/io.h"
+ #include "../../include/include.h"
+ #include "./matlabio.h"
+ 
+-#include <mex.h>
+-
+ /*FUNCTION OptionDoubleParse {{{*/
+ OptionDouble* OptionDoubleParse( char* name, const mxArray* prhs[]){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 12704)
+@@ -236,7 +236,7 @@
+ 
+ 			for(int j=0;j<this->Size();j++){
+ 				Element* element=(Element*)this->GetObjectByOffset(j);
+-				element->GetVectorFromResults(vector,i,resultssizes[i]);
++				element->GetVectorFromResults(vector,i,resultsenums[i],resultssizes[i]);
+ 			}
+ 			vector->Assemble();
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h	(revision 12704)
+@@ -12,6 +12,7 @@
+ 
+ IssmDouble Paterson(IssmDouble temperature);
+ IssmDouble Arrhenius(IssmDouble temperature,IssmDouble depth,IssmDouble n);
++IssmDouble PddSurfaceMassBlance(IssmDouble* monthlytemperatures,  IssmDouble* monthlyprec, IssmDouble* pdds, IssmDouble* pds, IssmDouble signorm, IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble rho_ice, IssmDouble rho_water);
+ void   GetVerticesCoordinates(IssmDouble* xyz,  Node** nodes, int numvertices);
+ int    GetNumberOfDofs( Node** nodes,int numnodes,int setenum,int approximation_enum);
+ int*   GetLocalDofList( Node** nodes,int numnodes,int setenum,int approximation_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 12704)
+@@ -0,0 +1,205 @@
++/* file:  PddSurfaceMassBlance.cpp
++   Calculating the surface mass balance using the positive degree day method.
++ */
++
++#include "./elements.h"
++
++double PddSurfaceMassBlance(double* monthlytemperatures, double* monthlyprec, double* pdds, double* pds, double signorm, double yts, double h, double s, double rho_ice, double rho_water){
++
++  // output:
++  double B;    // surface mass balance, melt+accumulation
++
++  int    iqj,imonth, j;
++  
++  double saccu;     // yearly surface accumulation
++  double smelt;     // yearly melt
++  double precrunoff;      // yearly runoff
++  double prect; // total precipitation during 1 year taking into account des. ef.
++  double water; //water=rain + snowmelt 
++  double runoff; //meltwater only, does not include rain 
++  double sconv; //rhow_rain/rhoi / 12 months
++  
++  double density;
++  double lapser=6.5/1000., sealev=0.;    // lapse rate. degrees per meter. 7.5 lev's 99 paper, 9 Marshall 99 paper
++  double desfac = 0.5;                 // desert elevation factor
++  double s0p=0.;         // should be set to elevation from precip source
++  double s0t=0.;         // should be set to elevation from temperature source
++  double st;             // elevation between altitude of the temp record and current altitude
++  double sp;             // elevation between altitude of the prec record and current altitude
++  
++  // PDD and PD constants and variables
++  double siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
++  double signormc = signorm - 0.5;     // sigma of the temperature distribution for cloudy day
++  double siglimc, siglim0, siglim0c;
++  double PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C)
++  double DT = 0.02;
++  double pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
++  
++  double q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
++  double qm = 0.;        // snow part of the precipitation 
++  double qmt = 0.;       // precipitation without desertification effect adjustment
++  double qmp = 0.;       // desertification taken into account
++  double pdd = 0.;     
++  double frzndd = 0.;  
++  
++  double tstar;                        // monthly mean surface temp
++  double Tsum= 0.;       // average summer (JJA) temperature
++  double Tsurf = 0.;     // average annual temperature    
++  
++
++  double deltm=1./12.;
++  int    ismon[12]={11,0,1,2,3,4,5,6,7,8,9,10};
++  
++  double snwm;  // snow that could have been melted in a year.
++  double snwmf; //  ablation factor for snow per positive degree day.
++  double smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
++  
++  double dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
++  double supice,supcap,diffndd;
++  double fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
++  double pddtj, hmx2;
++  
++  sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months
++  
++  /*PDD constant*/
++  siglim = 2.5*signorm; 
++  siglimc = 2.5*signormc;
++  siglim0 = siglim/DT + 0.5;
++  siglim0c = siglimc/DT + 0.5;
++  PDup = siglimc+PDCUT;
++  
++  // seasonal loop
++    for (iqj = 0; iqj < 12; iqj++){
++      imonth =  ismon[iqj];
++  
++      st=(s-s0t)/1000.;
++      tstar = monthlytemperatures[imonth] - lapser *max(st,sealev);
++      Tsurf = tstar*deltm+Tsurf;        
++      
++      /*********compute PD ****************/
++      if (tstar < PDup){
++	pd = 1.;
++	if (tstar >= -siglimc){ pd = pds[int(tstar/DT + siglim0c)];}}
++      else { 
++	pd = 0.;}
++      
++      /******exp des/elev precip reduction*******/
++      sp=(s-s0p)/1000.; // deselev effect is wrt chng in topo
++      if (sp>0.0){q = exp(-desfac*sp);}
++      else {q = 1.0;}
++      
++      qmt= qmt + monthlyprec[imonth]*sconv;  //*sconv to convert in m of ice equivalent per month
++      qmpt= q*monthlyprec[imonth]*sconv;           
++      qmp= qmp + qmpt;
++      qm= qm + qmpt*pd;
++      
++      /*********compute PDD************/
++      // ndd(month)=-(tstar-pdd(month)) since ndd+pdd gives expectation of
++      // gaussian=T_m, so ndd=-(Tsurf-pdd)
++      if (iqj>5 &&  iqj<9){ Tsum=Tsum+tstar;} 
++      if (tstar >= siglim) {pdd = pdd + tstar*deltm;}
++      else if (tstar> -siglim){
++	pddsig=pdds[int(tstar/DT + siglim0)];
++	pdd = pdd + pddsig*deltm;
++	frzndd = frzndd - (tstar-pddsig)*deltm;}
++      else{frzndd = frzndd - tstar*deltm; }
++  } // end of seasonal loop 
++  
++  //******************************************************************
++    saccu = qm;
++    prect = qmp;     // total precipitation during 1 year taking into account des. ef.
++    Tsum=Tsum/3;
++    
++    /***** determine PDD factors *****/
++    if(Tsum< -1.) {
++      snwmf=2.65*0.001;   //  ablation factor for snow per positive degree day.*0.001 to go from mm to m/ppd
++      smf=17.22*0.001;    //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002)
++    } 
++    else if(Tsum< 10){
++      snwmf = (0.15*Tsum + 2.8)*0.001;
++      smf = (0.0067*pow((10.-Tsum),3) + 8.3)*0.001;
++    }
++    else{
++      snwmf=4.3*0.001;
++      smf=8.3*0.001;
++    }
++    snwmf=0.95*snwmf;
++    smf=0.95*smf;
++    
++    /*****  compute PDD ablation and refreezing *****/
++    pddt = pdd *365;
++    snwm = snwmf*pddt;       // snow that could have been melted in a year
++    hmx2 = min(h,dfrz);   // refreeze active layer max depth: dfrz
++    
++    if(snwm < saccu) {
++      water=prect-saccu + snwm; //water=rain + snowmelt
++      //     l 2.2= capillary factor
++      //     Should refreezing be controlled by frzndd or by mean annual Tsurf?
++      //     dCovrLm concept is of warming of active layer (thickness =d@=1-
++      //     >2m)
++      //     problem with water seepage into ice: should be sealed after
++      //     refreezing
++      //     so everything needs to be predicated on 1 year scale, except for
++      //     thermal
++      //     conductivity through ice
++      //     also, need to account that melt season has low accum, so what's
++      //     going to
++      //     hold the meltwater around for refreezing? And melt-time will have
++      //     low seasonal frzndd
++      
++      //      Superimposed ice :  Pfeffer et al. 1991, Tarasov 2002
++      
++      supice= min(hmx2*CovrLm*frzndd+2.2*(saccu-snwm), water); // superimposed ice
++      supcap=min(2.2*(saccu-snwm),water);
++      runoff=snwm - supice;  //meltwater only, does not include rain
++    }
++    else {  //all snow melted
++      supice= min(hmx2*CovrLm*frzndd, prect );
++      runoff= saccu + smf*(pddt-saccu/snwmf) - supice;
++      supcap=0;
++    }
++    //     pdd melting doesn't cool Tsurf, so ndd refreeze shouldn't warm it
++    //     except pdd melt heat source is atmosphere, while refreeze is
++    //     ground/ice stored interim
++    //     assume pdd=ndd, then melt should equal refreeze and Tsurf should=0
++    //     assume ndd=2*pdd, then all supice is refrozen, but Tsurf should be
++    //     <0
++    //     assume ndd>pdd, little melt => little supice 
++    //     bottom line: compare for Tsurf<0 : supice and no supice case,
++    //     expect Tsurf difference
++    //     except some of cooling flux comes from atmosphere//
++    //     1 dm supice should not raise Tsurf by 1/dCovrLm = 16.675C
++    //     does supice make sense when H< 0.1m? then d=thermoactive ice layer ////
++    //     < 0.1 
++    
++    //     make more sense to just use residual pdd-ndd except that pdd
++    //     residual not clear yet
++    //     frzndd should not be used up by refreezing in snow, so stick in
++    //     supcap.
++    diffndd=0;
++    if (frzndd>0) {
++      diffndd=fsupndd*min((supice-supcap)/dCovrLm ,frzndd);
++      frzndd=frzndd-diffndd;
++    }
++    if(runoff<0){
++      saccu= saccu -runoff;
++      smelt = 0;
++      precrunoff=prect-saccu;
++      //here assume pdd residual is 0, => 
++      Tsurf= max(Tsurf,-frzndd);
++    }
++    else {
++      smelt = runoff;
++      precrunoff=prect-max(0.,supice)-saccu;}
++    //here really need pdd balance, try 0.5 fudge factor?
++    //at least runoff>0 => it's fairly warm, so Tsurf is !<<0,
++    //yet from site plots, can be ice free with Tsurf=-5.5C
++    if(Tsurf<0) {
++      Tsurf= min(Tsurf+fsupT*diffndd , 0.);}
++    
++    B = -smelt+saccu;
++    B = B/yts;
++    pddtj=pddt;
++  
++  return B;
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 12704)
+@@ -6,6 +6,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <cstring> 
+ #include "../Alloc/alloc.h"
+ #include "../../include/include.h"
+ #include "../../objects/objects.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp	(revision 12704)
+@@ -63,7 +63,7 @@
+     //    tstar = REAL(it)*DT-siglim;
+     tstar = it*DT-siglim;
+     tint = tsint;
+-    pddt = 0;
++    pddt = 0.;
+     for ( jj = 0; jj < 600; jj++){
+       if (tint > (tstar+siglim)){break;}
+       pddt = pddt + tint*exp(sigfac*(pow((tint-tstar),2)))*tstep;
+@@ -89,7 +89,7 @@
+     tstar = it*DT-siglimc;
+     //    tstar = REAL(it)*DT-siglimc;
+     tint = tsint;          // start against upper bound
+-    pd = 0;
++    pd = 0.;
+     for (jj = 0; jj < 600; jj++){
+       if (tint<(tstar-siglimc)) {break;}
+       pd = pd + exp(sigfac*(pow((tint-tstar),2)))*tstepc;
+@@ -97,7 +97,7 @@
+     }
+     pds[it] = pd*snormfac;  // gaussian integral lookup table for snow fraction
+   }
+-  pds[itm+1] = 0;
++  pds[itm+1] = 0.;
+   //     *******END initialize PDD
+   
+   for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12704)
+@@ -204,6 +204,7 @@
+ 					./shared/Elements/GetLocalDofList.cpp\
+ 					./shared/Elements/GetGlobalDofList.cpp\
+ 					./shared/Elements/GetNumberOfDofs.cpp\
++					./shared/Elements/PddSurfaceMassBalance.cpp\
+ 					./shared/String/sharedstring.h\
+ 					./shared/Wrapper/wrappershared.h\
+ 					./shared/Wrapper/ModuleBoot.cpp\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.cpp	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.cpp	(revision 12704)
+@@ -125,3 +125,13 @@
+ 
+ }
+ /*}}}*/
++/*FUNCTION DoubleElementResult::GetVectorFromResults{{{1*/
++void DoubleElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
++
++	_error_("cannot return vector on vertices");
++} /*}}}*/
++/*FUNCTION DoubleElementResult::GetElementVectorFromResults{{{1*/
++void DoubleElementResult::GetElementVectorFromResults(Vector* vector,int dof){
++
++	vector->SetValue(dof,value,INS_VAL);
++} /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h	(revision 12704)
+@@ -47,8 +47,8 @@
+ 		/*}}}*/
+ 		/*DoubleElementResult management: {{{*/
+ 		int   InstanceEnum();
+-		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){_error2_("not implemented");};
+-		void GetElementVectorFromResults(Vector* vector,int dof){_error2_("not implemented");};
++		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
++		void GetElementVectorFromResults(Vector* vector,int dof);
+ 		/*}}}*/
+ };
+ #endif  /* _DOUBLEELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h	(revision 12704)
+@@ -62,7 +62,7 @@
+ 		virtual int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units)=0;
+ 		virtual void   InputScale(int enum_type,IssmDouble scale_factor)=0;
+ 		virtual void   GetVectorFromInputs(Vector* vector, int name_enum)=0;
+-		virtual void   GetVectorFromResults(Vector* vector,int id,int interp)=0;
++		virtual void   GetVectorFromResults(Vector* vector,int id,int enum_in,int interp)=0;
+ 		virtual void   InputArtificialNoise(int enum_type,IssmDouble min,IssmDouble max)=0;
+ 		virtual bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums)=0;
+ 		virtual void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12704)
+@@ -1191,10 +1191,13 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GetVectorFromResults{{{*/
+-void  Tria::GetVectorFromResults(Vector* vector,int offset,int interp){
++void  Tria::GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp){
+ 
+ 	/*Get result*/
+ 	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
++	if(elementresult->InstanceEnum()!=enum_in){
++		_error_("Results of offset %i is %s, when %s was expected",offset,EnumToStringx(elementresult->InstanceEnum()),EnumToStringx(enum_in));
++	}
+ 	if(interp==P1Enum){
+ 		int doflist1[NUMVERTICES];
+ 		int connectivity[NUMVERTICES];
+@@ -2085,236 +2088,44 @@
+ /*FUNCTION Tria::PositiveDegreeDay{{{*/
+ void  Tria::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm){
+ 
+-   int    i,iqj,imonth;
+    IssmDouble agd[NUMVERTICES];             // surface mass balance
+-   IssmDouble saccu[NUMVERTICES] = {0};     // yearly surface accumulation
+-   IssmDouble smelt[NUMVERTICES] = {0};     // yearly melt
+-   IssmDouble precrunoff[NUMVERTICES];      // yearly runoff
+-   IssmDouble prect; // total precipitation during 1 year taking into account des. ef.
+-   IssmDouble water; //water=rain + snowmelt 
+-   IssmDouble runoff; //meltwater only, does not include rain 
+-   IssmDouble sconv; //rhow_rain/rhoi / 12 months
++   IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
++   IssmDouble h[NUMVERTICES],s[NUMVERTICES]; // ,b
++   IssmDouble rho_water,rho_ice;
+ 
+-   IssmDouble rho_water,rho_ice,density;
+-   IssmDouble lapser=6.5/1000, sealev=0;    // lapse rate. degrees per meter. 7.5 lev's 99 paper, 9 Marshall 99 paper
+-   IssmDouble desfac = 0.5;                 // desert elevation factor
+-   IssmDouble s0p[NUMVERTICES]={0};         // should be set to elevation from precip source
+-   IssmDouble s0t[NUMVERTICES]={0};         // should be set to elevation from temperature source
+-   IssmDouble st;             // elevation between altitude of the temp record and current altitude
+-   IssmDouble sp;             // elevation between altitude of the prec record and current altitude
++   /*Recover monthly temperatures and precipitation*/
++   Input*     input=inputs->GetInput(SurfaceforcingsMonthlytemperaturesEnum); _assert_(input);
++   Input*     input2=inputs->GetInput(SurfaceforcingsPrecipitationEnum); _assert_(input2);
++   GaussTria* gauss=new GaussTria();
++   IssmDouble time,yts;
++   this->parameters->FindParam(&time,TimeEnum);
++   this->parameters->FindParam(&yts,ConstantsYtsEnum);
++   for(int month=0;month<12;month++) {
++     for(int iv=0;iv<NUMVERTICES;iv++) {
++       gauss->GaussVertex(iv);
++       input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts);
++       monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius
++       input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts);
++       monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++     }
++   }
+ 
+-   // PDD and PD constants and variables
+-   IssmDouble siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
+-   IssmDouble signormc = signorm - 0.5;     // sigma of the temperature distribution for cloudy day
+-   IssmDouble siglimc, siglim0, siglim0c;
+-   IssmDouble PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C)
+-   IssmDouble DT = 0.02;
+-   IssmDouble pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
+-   
+-   IssmDouble q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
+-   IssmDouble qm[NUMVERTICES] = {0};        // snow part of the precipitation 
+-   IssmDouble qmt[NUMVERTICES] = {0};       // precipitation without desertification effect adjustment
+-   IssmDouble qmp[NUMVERTICES] = {0};       // desertification taken into account
+-   IssmDouble pdd[NUMVERTICES] = {0};     
+-   IssmDouble frzndd[NUMVERTICES] = {0};  
++  /*Recover info at the vertices: */
++  GetInputListOnVertices(&h[0],ThicknessEnum);
++  GetInputListOnVertices(&s[0],SurfaceEnum);
+ 
+-   IssmDouble tstar;                        // monthly mean surface temp
+-   IssmDouble Tsum[NUMVERTICES]= {0};       // average summer (JJA) temperature
+-   IssmDouble Tsurf[NUMVERTICES] = {0};     // average annual temperature    
+-   
+-   IssmDouble h[NUMVERTICES],s[NUMVERTICES],ttmp[NUMVERTICES],prectmp[NUMVERTICES]; // ,b[NUMVERTICES]
+-   IssmDouble t[NUMVERTICES+1][12],prec[NUMVERTICES+1][12];
+-   IssmDouble deltm=1/12;
+-   int    ismon[12]={12,1,2,3,4,5,6,7,8,9,10,11};
++  /*Get material parameters :*/
++  rho_ice=matpar->GetRhoIce();
++  rho_water=matpar->GetRhoFreshwater();
+ 
+-   IssmDouble snwm;  // snow that could have been melted in a year.
+-   IssmDouble snwmf; //  ablation factor for snow per positive degree day.
+-   IssmDouble smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
+-
+-   IssmDouble dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
+-   IssmDouble supice,supcap,diffndd;
+-   IssmDouble fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
+-   IssmDouble pddtj[NUMVERTICES], hmx2;
+-
+-   /*Recover info at the vertices: */
+-   GetInputListOnVertices(&h[0],ThicknessEnum);
+-   GetInputListOnVertices(&s[0],SurfaceEnum);
+-   GetInputListOnVertices(&ttmp[0],ThermalSpctemperatureEnum);
+-   GetInputListOnVertices(&prectmp[0],SurfaceforcingsPrecipitationEnum);
+-
+-	/*Recover monthly temperatures*/
+-	Input*     input=inputs->GetInput(SurfaceforcingsMonthlytemperaturesEnum); _assert_(input);
+-	GaussTria* gauss=new GaussTria();
+-	IssmDouble time,yts;
+-	this->parameters->FindParam(&time,TimeEnum);
+-	this->parameters->FindParam(&yts,ConstantsYtsEnum);
+-	for(int month=0;month<12;month++){
+-		for(int iv=0;iv<NUMVERTICES;iv++){
+-			gauss->GaussVertex(iv);
+-			input->GetInputValue(&t[iv][month],gauss,time+month/12*yts);
+-			t[iv][month]=t[iv][month]-273.15; // conversion from Kelvin to celcius
+-		}
+-	}
+-
+-   for(i=0;i<NUMVERTICES;i++)
+-     for(imonth=0;imonth<12;imonth++){
+-       t[i][imonth]=ttmp[i];
+-       prec[i][imonth]=prectmp[i];
++   /*measure the surface mass balance*/
++   for (int iv = 0; iv<NUMVERTICES; iv++){
++     agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], pdds, pds, signorm, yts, h[iv], s[iv], rho_ice, rho_water);
+    }
+ 
+-   /*Get material parameters :*/
+-   rho_ice=matpar->GetRhoIce();
+-   rho_water=matpar->GetRhoFreshwater();
+-   
+-   sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months
+-     
+-     /*PDD constant*/
+-   siglim = 2.5*signorm; 
+-   siglimc = 2.5*signormc; 
+-   siglim0 =  siglim/DT + 0.5;
+-   siglim0c =  siglimc/DT + 0.5;
+-   PDup = siglimc+PDCUT;
+-   
+-   // seasonal loop
+-   for (iqj = 0; iqj < 12; iqj++){
+-     imonth =  ismon[iqj];
+-     for (i = 0; i < NUMVERTICES; i++){
+-       st=(s[i]-s0t[i])/1000;
+-       tstar = t[i][imonth] - lapser *max(st,sealev);
+-       Tsurf[i] = tstar*deltm+Tsurf[i];        
+-       
+-       /*********compute PD ****************/
+-       if (tstar < PDup){
+-	 pd = 1;
+-	 if (tstar >= -siglimc){ pd = pds[reCast<int,IssmDouble>(tstar/DT + siglim0c)];}}
+-       else { 
+-	 pd = 0;}
+-       
+-       /******exp des/elev precip reduction*******/
+-       sp=(s[i]-s0p[i])/1000; // deselev effect is wrt chng in topo
+-       if (sp>0.0){q = exp(-desfac*sp);}
+-       else {q = 1.0;}
+-       
+-       qmt[i]= qmt[i] + prec[i][imonth]*sconv;  //*sconv to convert in m of ice equivalent per month
+-       qmpt= q*prec[i][imonth]*sconv;           
+-       qmp[i]= qmp[i] + qmpt;
+-       qm[i]= qm[i] + qmpt*pd;
+-       
+-       /*********compute PDD************/
+-       // ndd(month)=-(tstar-pdd(month)) since ndd+pdd gives expectation of
+-       // gaussian=T_m, so ndd=-(Tsurf-pdd)
+-       if (iqj>6 &&  iqj<10){ Tsum[i]=Tsum[i]+tstar;} 
+-       if (tstar >= siglim) {pdd[i] = pdd[i] + tstar*deltm;}
+-       else if (tstar> -siglim){
+-	 pddsig=pdds[reCast<int,IssmDouble>(tstar/DT + siglim0)];
+-	 pdd[i] = pdd[i] + pddsig*deltm;
+-	 frzndd[i] = frzndd[i] - (tstar-pddsig)*deltm;}
+-       else{frzndd[i] = frzndd[i] - tstar*deltm; }
+-     }
+-   } // end of seasonal loop 
+-   
+-   //******************************************************************
+-   for(i=0;i<NUMVERTICES;i++){
+-     saccu[i] = qm[i];
+-     prect = qmp[i];     // total precipitation during 1 year taking into account des. ef.
+-     Tsum[i]=Tsum[i]/3;
+-     
+-     /***** determine PDD factors *****/
+-     if(Tsum[i]< -1.) {
+-       snwmf=2.65*0.001;   //  ablation factor for snow per positive degree day.*0.001 to go from mm to m/ppd
+-       smf=17.22*0.001;    //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002)
+-     }
+-     else if(Tsum[i]< 10){
+-       snwmf = (0.15*Tsum[i] + 2.8)*0.001;
+-       smf = (0.0067*pow((10.-Tsum[i]),3) + 8.3)*0.001;
+-     }
+-     else{
+-       snwmf=4.3*0.001;
+-       smf=8.3*0.001;
+-     }
+-     snwmf=0.95*snwmf;
+-     smf=0.95*smf;
+-     
+-     /*****  compute PDD ablation and refreezing *****/
+-     pddt = pdd[i] *365;
+-     snwm = snwmf*pddt;       // snow that could have been melted in a year
+-     hmx2 = min(h[i],dfrz);   // refreeze active layer max depth: dfrz
+-     
+-     if(snwm < saccu[i]) {
+-       water=prect-saccu[i] + snwm; //water=rain + snowmelt
+-       //     l 2.2= capillary factor
+-       //     Should refreezing be controlled by frzndd or by mean annual Tsurf?
+-       //     dCovrLm concept is of warming of active layer (thickness =d@=1-
+-       //     >2m)
+-       //     problem with water seepage into ice: should be sealed after
+-       //     refreezing
+-       //     so everything needs to be predicated on 1 year scale, except for
+-       //     thermal
+-       //     conductivity through ice
+-       //     also, need to account that melt season has low accum, so what's
+-       //     going to
+-       //     hold the meltwater around for refreezing? And melt-time will have
+-       //     low seasonal frzndd
+-       
+-       //      Superimposed ice :  Pfeffer et al. 1991, Tarasov 2002
+-       
+-       supice= min(hmx2*CovrLm*frzndd[i]+2.2*(saccu[i]-snwm), water); // superimposed ice
+-       supcap=min(2.2*(saccu[i]-snwm),water);
+-       runoff=snwm - supice;  //meltwater only, does not include rain
+-     }
+-     else {  //all snow melted
+-       supice= min(hmx2*CovrLm*frzndd[i], prect );
+-       runoff= saccu[i] + smf*(pddt-saccu[i]/snwmf) - supice;
+-       supcap=0;
+-     }
+-     //     pdd melting doesn't cool Tsurf, so ndd refreeze shouldn't warm it
+-     //     except pdd melt heat source is atmosphere, while refreeze is
+-     //     ground/ice stored interim
+-     //     assume pdd=ndd, then melt should equal refreeze and Tsurf should=0
+-     //     assume ndd=2*pdd, then all supice is refrozen, but Tsurf should be
+-     //     <0
+-     //     assume ndd>pdd, little melt => little supice 
+-     //     bottom line: compare for Tsurf<0 : supice and no supice case,
+-     //     expect Tsurf difference
+-     //     except some of cooling flux comes from atmosphere//
+-     //     1 dm supice should not raise Tsurf by 1/dCovrLm = 16.675C
+-     //     does supice make sense when H< 0.1m? then d=thermoactive ice layer ////
+-     //     < 0.1 
+-     
+-     //     make more sense to just use residual pdd-ndd except that pdd
+-     //     residual not clear yet
+-     //     frzndd should not be used up by refreezing in snow, so stick in
+-     //     supcap.
+-     diffndd=0;
+-     if (frzndd[i]>0) {
+-       diffndd=fsupndd*min((supice-supcap)/dCovrLm ,frzndd[i]);
+-       frzndd[i]=frzndd[i]-diffndd;
+-     }
+-     if(runoff<0){
+-       saccu[i]= saccu[i] -runoff;
+-       smelt[i] = 0;
+-       precrunoff[i]=prect-saccu[i];
+-       //here assume pdd residual is 0, => 
+-       Tsurf[i]= max(Tsurf[i],-frzndd[i]);
+-     }
+-     else {
+-       smelt[i] = runoff;
+-       precrunoff[i]=prect-max(0.,supice)-saccu[i];}
+-     //here really need pdd balance, try 0.5 fudge factor?
+-     //at least runoff>0 => it's fairly warm, so Tsurf is !<<0,
+-     //yet from site plots, can be ice free with Tsurf=-5.5C
+-     if(Tsurf[i]<0) {
+-       Tsurf[i]= min(Tsurf[i]+fsupT*diffndd , 0.);}
+-     
+-     agd[i] = -smelt[i]+saccu[i];
+-     pddtj[i]=pddt;
+-     
+-     /*Update inputs*/    
+-     this->inputs->AddInput(new TriaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0])); ////////verifier le nom
+-     // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
+-     this->inputs->AddInput(new TriaP1Input(ThermalSpctemperatureEnum,&Tsurf[0]));
+-     
+-   }       //end of the for loop over the vertices
++   /*Update inputs*/    
++   this->inputs->AddInput(new TriaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0]));
++   // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
+ }
+ /*}}}*/
+ /*FUNCTION Tria::ProcessResultsUnits{{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h	(revision 12704)
+@@ -88,7 +88,7 @@
+ 		bool   IsOnWater(); 
+ 		void   GetSolutionFromInputs(Vector* solution);
+ 		void   GetVectorFromInputs(Vector* vector, int name_enum);
+-		void   GetVectorFromResults(Vector* vector,int offset,int interp);
++		void   GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp);
+ 		void   InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max);
+ 		bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums);
+ 		void   InputCreate(IssmDouble scalar,int name,int code);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12704)
+@@ -1079,10 +1079,13 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetVectorFromResults{{{*/
+-void  Penta::GetVectorFromResults(Vector* vector,int offset,int interp){
++void  Penta::GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp){
+ 
+ 	/*Get result*/
+ 	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
++	if(elementresult->InstanceEnum()!=enum_in){
++		_error_("Results of offset %i is %s, when %s was expected",offset,EnumToStringx(elementresult->InstanceEnum()),EnumToStringx(enum_in));
++	}  
+ 	if(interp==P1Enum){
+ 		int doflist1[NUMVERTICES];
+ 		int connectivity[NUMVERTICES];
+@@ -2254,226 +2257,45 @@
+ /*FUNCTION Penta::PositiveDegreeDay{{{*/
+ void  Penta::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm){
+ 
++   IssmDouble agd[NUMVERTICES];             // surface mass balance
++   IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
++   IssmDouble h[NUMVERTICES],s[NUMVERTICES]; // ,b
++   IssmDouble rho_water,rho_ice;
+ 
+-   int    i,iqj,imonth;
+-   IssmDouble agd[NUMVERTICES];  // surface and basal
+-   IssmDouble saccu[NUMVERTICES] = {0};     // yearly surface accumulation
+-   IssmDouble smelt[NUMVERTICES] = {0};     // yearly melt
+-   IssmDouble precrunoff[NUMVERTICES];      // yearly runoff
+-   IssmDouble prect; // total precipitation during 1 year taking into account des. ef.
+-   IssmDouble water; //water=rain + snowmelt 
+-   IssmDouble runoff; //meltwater only, does not include rain 
+-   IssmDouble sconv; //rhow_rain/rhoi / 12 months
++   /*Recover monthly temperatures and precipitation*/
++   Input*     input=inputs->GetInput(SurfaceforcingsMonthlytemperaturesEnum); _assert_(input);
++   Input*     input2=inputs->GetInput(SurfaceforcingsPrecipitationEnum); _assert_(input2);
++   GaussPenta* gauss=new GaussPenta();
++   IssmDouble time,yts;
++   this->parameters->FindParam(&time,TimeEnum);
++   this->parameters->FindParam(&yts,ConstantsYtsEnum);
++   for(int month=0;month<12;month++) {
++     for(int iv=0;iv<NUMVERTICES;iv++) {
++       gauss->GaussVertex(iv);
++       input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts);
++       monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius
++       input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts);
++       monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++     }
++   } 
+ 
+-   IssmDouble  rho_water,rho_ice,density;
+-   IssmDouble lapser=6.5/1000, sealev=0;    // lapse rate. degrees per meter.
+-   IssmDouble desfac = 0.5;                 //desert elevation factor
+-   IssmDouble s0p[NUMVERTICES]={0};         //should be set to elevation from precip source
+-   IssmDouble s0t[NUMVERTICES]={0};         //should be set to elevation from temperature source
+-   IssmDouble st;             // elevation between altitude of the temp record and current altitude
+-   IssmDouble sp;             // elevation between altitude of the prec record and current altitude
++  /*Recover info at the vertices: */
++  GetInputListOnVertices(&h[0],ThicknessEnum);
++  GetInputListOnVertices(&s[0],SurfaceEnum);
+ 
++  /*Get material parameters :*/
++  rho_ice=matpar->GetRhoIce();
++  rho_water=matpar->GetRhoFreshwater();
+ 
+-   // PDD and PD constants and variables
+-   IssmDouble siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
+-   IssmDouble signormc = signorm - 0.5;     // sigma of the temperature distribution for cloudy day
+-   IssmDouble siglimc, siglim0, siglim0c;
+-   IssmDouble PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C)
+-   IssmDouble DT = 0.02;
+-   IssmDouble pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
+-   
+-   IssmDouble q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
+-   IssmDouble qm[NUMVERTICES] = {0};        // snow part of the precipitation 
+-   IssmDouble qmt[NUMVERTICES] = {0};       // precipitation without desertification effect adjustment
+-   IssmDouble qmp[NUMVERTICES] = {0};       // desertification taken into account
+-   IssmDouble pdd[NUMVERTICES] = {0};     
+-   IssmDouble frzndd[NUMVERTICES] = {0};  
+-
+-   IssmDouble tstar;                        // monthly mean surface temp
+-   IssmDouble Tsum[NUMVERTICES]= {0};       // average summer (JJA) temperature
+-   IssmDouble Tsurf[NUMVERTICES] = {0};     // average annual temperature    
+-   
+-   IssmDouble h[NUMVERTICES],s[NUMVERTICES],ttmp[NUMVERTICES],prectmp[NUMVERTICES]; // ,b[NUMVERTICES]
+-   IssmDouble t[NUMVERTICES][12],prec[NUMVERTICES][12];
+-   IssmDouble deltm=1/12;
+-   int    ismon[12]={12,1,2,3,4,5,6,7,8,9,10,11};
+-
+-   IssmDouble snwm;  // snow that could have been melted in a year.
+-   IssmDouble snwmf; //  ablation factor for snow per positive degree day.
+-   IssmDouble smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
+-
+-   IssmDouble dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
+-   IssmDouble supice,supcap,diffndd;
+-   IssmDouble fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
+-   IssmDouble pddtj[NUMVERTICES], hmx2;
+-
+-   /*Recover info at the vertices: */
+-   GetInputListOnVertices(&h[0],ThicknessEnum);
+-   GetInputListOnVertices(&s[0],SurfaceEnum);
+-   GetInputListOnVertices(&ttmp[0],ThermalSpctemperatureEnum);
+-   GetInputListOnVertices(&prectmp[0],SurfaceforcingsPrecipitationEnum);
+-
+-   for(i=0;i<NUMVERTICES;i++) ttmp[i]=ttmp[i]-273.15; // convertion from Kelvin to celcius
+-
+-   for(i=0;i<NUMVERTICES;i++)
+-     for(imonth=0;imonth<12;imonth++){
+-       t[i][imonth]=ttmp[i];
+-       prec[i][imonth]=prectmp[i];
++   /*measure the surface mass balance*/
++   for (int iv = 0; iv < NUMVERTICES; iv++){
++     agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], pdds, pds, signorm, yts, h[iv], s[iv], rho_ice, rho_water);
+    }
+ 
+-   /*Get material parameters :*/
+-   rho_ice=matpar->GetRhoIce();
+-   //rho_freshwater=matpar->GetRhoWater();
+-   
+-   sconv=(1000/rho_ice)/12.; //rhow_rain/rhoi / 12 months
+-     
+-     /*PDD constant*/
+-   siglim = 2.5*signorm; 
+-   siglimc = 2.5*signormc;
+-   siglim0 =  siglim/DT + 0.5;
+-   siglim0c =  siglimc/DT + 0.5;
+-   PDup = siglimc+PDCUT;
+-   
+-   // seasonal loop
+-   for (iqj = 0; iqj < 12; iqj++){
+-     imonth =  ismon[iqj];
+-     for (i = 0; i < NUMVERTICES; i++){
+-       st=(s[i]-s0t[i])/1000;
+-       tstar = t[i][imonth] - lapser *max(st,sealev);
+-       Tsurf[i] = tstar*deltm+Tsurf[i];        
+-       
+-       /*********compute PD ****************/
+-       if (tstar < PDup){
+-	 pd = 1;
+-	 if (tstar >= -siglimc){ pd = pds[int(tstar/DT + siglim0c)];}}
+-       else { 
+-	 pd = 0;}
+-       
+-       /******exp des/elev precip reduction*******/
+-       sp=(s[i]-s0p[i])/1000; // deselev effect is wrt chng in topo
+-       if (sp>0.0){q = exp(-desfac*sp);}
+-       else {q = 1.0;}
+-       
+-       qmt[i]= qmt[i] + prec[i][imonth]*sconv;  //*sconv to convert in m of ice equivalent 
+-       qmpt= q*prec[i][imonth]*sconv;           
+-       qmp[i]= qmp[i] + qmpt;
+-       qm[i]= qm[i] + qmpt*pd;
+-       
+-       /*********compute PDD************/
+-       // ndd(month)=-(tstar-pdd(month)) since ndd+pdd gives expectation of
+-       // gaussian=T_m, so ndd=-(Tsurf-pdd)
+-       if (iqj>6 &&  iqj<10){ Tsum[i]=Tsum[i]+tstar;} 
+-       if (tstar >= siglim) {pdd[i] = pdd[i] + tstar*deltm;}
+-       else if (tstar> -siglim){
+-	 pddsig=pdds[int(tstar/DT + siglim0)];
+-	 pdd[i] = pdd[i] + pddsig*deltm;
+-	 frzndd[i] = frzndd[i] - (tstar-pddsig)*deltm;}
+-       else{frzndd[i] = frzndd[i] - tstar*deltm; }
+-     }
+-   } // end of seasonal loop 
+-   
+-   //******************************************************************
+-   for(i=0;i<NUMVERTICES;i++){
+-     saccu[i] = qm[i];
+-     prect = qmp[i];     // total precipitation during 1 year taking into account des. ef.
+-     Tsum[i]=Tsum[i]/3;
+-     
+-     /***** determine PDD factors *****/
+-     if(Tsum[i]< -1.) {
+-       snwmf=2.65*0.001;   //  ablation factor for snow per positive degree day.*0.001 to go from mm to m/ppd
+-       smf=17.22*0.001;    //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002)
+-     }
+-     else if(Tsum[i]< 10){
+-       snwmf = (0.15*Tsum[i] + 2.8)*0.001;
+-       smf = (0.0067*pow((10.-Tsum[i]),3) + 8.3)*0.001;
+-     }
+-     else{
+-       snwmf=4.3*0.001;
+-       smf=8.3*0.001;
+-     }
+-     snwmf=0.95*snwmf;
+-     smf=0.95*smf;
+-     
+-     /*****  compute PDD ablation and refreezing *****/
+-     pddt = pdd[i] *365;
+-     snwm = snwmf*pddt;       // snow that could have been melted in a year
+-     hmx2 = min(h[i],dfrz);   // refreeze active layer max depth: dfrz
+-     
+-     if(snwm < saccu[i]) {
+-       water=prect-saccu[i] + snwm; //water=rain + snowmelt
+-       //     l 2.2= capillary factor
+-       //     Should refreezing be controlled by frzndd or by mean annual Tsurf?
+-       //     dCovrLm concept is of warming of active layer (thickness =d@=1-
+-       //     >2m)
+-       //     problem with water seepage into ice: should be sealed after
+-       //     refreezing
+-       //     so everything needs to be predicated on 1 year scale, except for
+-       //     thermal
+-       //     conductivity through ice
+-       //     also, need to account that melt season has low accum, so what's
+-       //     going to
+-       //     hold the meltwater around for refreezing? And melt-time will have
+-       //     low seasonal frzndd
+-       
+-       //      Superimposed ice :  Pfeffer et al. 1991, Tarasov 2002
+-       
+-       supice= min(hmx2*CovrLm*frzndd[i]+2.2*(saccu[i]-snwm), water); // superimposed ice
+-       supcap=min(2.2*(saccu[i]-snwm),water);
+-       runoff=snwm - supice;  //meltwater only, does not include rain
+-     }
+-     else {  //all snow melted
+-       supice= min(hmx2*CovrLm*frzndd[i], prect );
+-       runoff= saccu[i] + smf*(pddt-saccu[i]/snwmf) - supice;
+-       supcap=0;
+-     }
+-     //     pdd melting doesn't cool Tsurf, so ndd refreeze shouldn't warm it
+-     //     except pdd melt heat source is atmosphere, while refreeze is
+-     //     ground/ice stored interim
+-     //     assume pdd=ndd, then melt should equal refreeze and Tsurf should=0
+-     //     assume ndd=2*pdd, then all supice is refrozen, but Tsurf should be
+-     //     <0
+-     //     assume ndd>pdd, little melt => little supice 
+-     //     bottom line: compare for Tsurf<0 : supice and no supice case,
+-     //     expect Tsurf difference
+-     //     except some of cooling flux comes from atmosphere//
+-     //     1 dm supice should not raise Tsurf by 1/dCovrLm = 16.675C
+-     //     does supice make sense when H< 0.1m? then d=thermoactive ice layer ////
+-     //     < 0.1 
+-     
+-     //     make more sense to just use residual pdd-ndd except that pdd
+-     //     residual not clear yet
+-     //     frzndd should not be used up by refreezing in snow, so stick in
+-     //     supcap.
+-     diffndd=0;
+-     if (frzndd[i]>0) {
+-       diffndd=fsupndd*min((supice-supcap)/dCovrLm ,frzndd[i]);
+-       frzndd[i]=frzndd[i]-diffndd;
+-     }
+-     if(runoff<0){
+-       saccu[i]= saccu[i] -runoff;
+-       smelt[i] = 0;
+-       precrunoff[i]=prect-saccu[i];
+-       //here assume pdd residual is 0, => 
+-       Tsurf[i]= max(Tsurf[i],-frzndd[i]);
+-     }
+-     else {
+-       smelt[i] = runoff;
+-       precrunoff[i]=prect-max(0.,supice)-saccu[i];}
+-     //here really need pdd balance, try 0.5 fudge factor?
+-     //at least runoff>0 => it's fairly warm, so Tsurf is !<<0,
+-     //yet from site plots, can be ice free with Tsurf=-5.5C
+-     if(Tsurf[i]<0) {
+-       Tsurf[i]= min(Tsurf[i]+fsupT*diffndd , 0.);}
+-     
+-     agd[i] = -smelt[i]+saccu[i];
+-     pddtj[i]=pddt;
+-     
+-     /*Update inputs*/    
+-     this->inputs->AddInput(new PentaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0])); ////////verifier le nom
+-     // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
+-     this->inputs->AddInput(new PentaP1Input(ThermalSpctemperatureEnum,&Tsurf[0]));
+-     
+-   }       //end of the for loop over the vertices
++   /*Update inputs*/    
++   this->inputs->AddInput(new PentaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0]));
++   //this->inputs->AddInput(new PentaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
++   this->InputExtrude(SurfaceforcingsMassBalanceEnum,ElementEnum);
+ }
+ /*}}}*/
+ /*FUNCTION Penta::PotentialSheetUngrounding{{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h	(revision 12704)
+@@ -88,7 +88,7 @@
+ 		void   GetSolutionFromInputs(Vector* solution);
+ 		IssmDouble GetZcoord(GaussPenta* gauss);
+ 		void   GetVectorFromInputs(Vector* vector,int name_enum);
+-		void   GetVectorFromResults(Vector* vector,int offset,int interp);
++		void   GetVectorFromResults(Vector* vector,int offset,int name_enum,int interp);
+ 		
+ 		int    Sid();
+ 		void   InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DoubleInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DoubleInput.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DoubleInput.h	(revision 12704)
+@@ -47,8 +47,9 @@
+ 		void GetInputValue(int* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/Input.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/Input.h	(revision 12704)
+@@ -20,14 +20,15 @@
+ 	public: 
+ 		
+ 		virtual        ~Input(){};
+-		/*Virtual functions:{{{*/
++
+ 		virtual int  InstanceEnum()=0; 
+ 		virtual void GetInputValue(bool* pvalue)=0;
+ 		virtual void GetInputValue(int* pvalue)=0;
+ 		virtual void GetInputValue(IssmDouble* pvalue)=0;
+ 		virtual void GetInputValue(IssmDouble* pvalue,GaussTria* gauss)=0;
++		virtual void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss)=0;
+ 		virtual void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time)=0;
+-		virtual void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss)=0;
++		virtual void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time)=0;
+ 		virtual void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index)=0;
+ 		virtual void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index)=0;
+ 		virtual void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss)=0;
+@@ -64,8 +65,5 @@
+ 		virtual Input* PointwiseMax(Input* inputmax)=0;
+ 		virtual Input* PointwiseMin(Input* inputmin)=0;
+ 		virtual ElementResult* SpawnResult(int step, IssmDouble time)=0;
+-
+-		/*}}}*/
+-
+ };
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/ControlInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/ControlInput.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/ControlInput.h	(revision 12704)
+@@ -53,8 +53,9 @@
+ 		void GetInputValue(int* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DatasetInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DatasetInput.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DatasetInput.h	(revision 12704)
+@@ -43,13 +43,14 @@
+ 		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+-		/*numeriics: {{{*/
++		/*numerics: {{{*/
+ 		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
+ 		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/IntInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/IntInput.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/IntInput.h	(revision 12704)
+@@ -48,8 +48,9 @@
+ 		void GetInputValue(int* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/BoolInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/BoolInput.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/BoolInput.h	(revision 12704)
+@@ -48,8 +48,9 @@
+ 		void GetInputValue(int* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TriaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TriaP1Input.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TriaP1Input.h	(revision 12704)
+@@ -48,8 +48,9 @@
+ 		void GetInputValue(int* pvalue){_error2_("not implemented yet");}
+ 		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");}
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.cpp	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.cpp	(revision 12704)
+@@ -171,6 +171,22 @@
+ 	delete input;
+ }
+ /*}}}*/
++/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
++void TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){
++	IssmDouble time;
++
++	/*First, recover current time from parameters: */
++	this->parameters->FindParam(&time,TimeEnum);
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	input->GetInputValue(pvalue,gauss);
++
++	delete input;
++}
++/*}}}*/
+ /*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){{{*/
+ void TransientInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){
+ 
+@@ -183,6 +199,18 @@
+ 	delete input;
+ }
+ /*}}}*/
++/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){{{*/
++void TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	input->GetInputValue(pvalue,gauss);
++
++	delete input;
++}
++/*}}}*/
+ /*FUNCTION TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+ void TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussTria* gauss){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.h	(revision 12704)
+@@ -50,8 +50,9 @@
+ 		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/PentaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/PentaP1Input.h	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/PentaP1Input.h	(revision 12704)
+@@ -48,8 +48,9 @@
+ 		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrude.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrude.m	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrude.m	(revision 12704)
+@@ -142,6 +142,7 @@
+ md.surfaceforcings.mass_balance=project3d(md,'vector',md.surfaceforcings.mass_balance,'type','node');
+ md.surfaceforcings.precipitation=project3d(md,'vector',md.surfaceforcings.precipitation,'type','node');
+ md.balancethickness.thickening_rate=project3d(md,'vector',md.balancethickness.thickening_rate,'type','node');
++md.surfaceforcings.monthlytemperatures=project3d(md,'vector',md.surfaceforcings.monthlytemperatures,'type','node');
+ 
+ %results
+ if ~isnan(md.initialization.vx),md.initialization.vx=project3d(md,'vector',md.initialization.vx,'type','node');end;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl	(revision 12703)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl	(revision 12704)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl
+___________________________________________________________________
+Modified: svn:mergeinfo
+   Merged /issm/trunk:r12339-12703
Index: /issm/oecreview/Archive/12678-13393/ISSM-12704-12705.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12704-12705.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12704-12705.diff	(revision 13394)
@@ -0,0 +1,120 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 12704)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 12705)
+@@ -4,60 +4,60 @@
+ 
+ #include "./elements.h"
+ 
+-double PddSurfaceMassBlance(double* monthlytemperatures, double* monthlyprec, double* pdds, double* pds, double signorm, double yts, double h, double s, double rho_ice, double rho_water){
++IssmDouble PddSurfaceMassBlance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec, IssmDouble* pdds, IssmDouble* pds, IssmDouble signorm, IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble rho_ice, IssmDouble rho_water){
+ 
+   // output:
+-  double B;    // surface mass balance, melt+accumulation
++  IssmDouble B;    // surface mass balance, melt+accumulation
+ 
+   int    iqj,imonth, j;
+   
+-  double saccu;     // yearly surface accumulation
+-  double smelt;     // yearly melt
+-  double precrunoff;      // yearly runoff
+-  double prect; // total precipitation during 1 year taking into account des. ef.
+-  double water; //water=rain + snowmelt 
+-  double runoff; //meltwater only, does not include rain 
+-  double sconv; //rhow_rain/rhoi / 12 months
++  IssmDouble saccu;     // yearly surface accumulation
++  IssmDouble smelt;     // yearly melt
++  IssmDouble precrunoff;      // yearly runoff
++  IssmDouble prect; // total precipitation during 1 year taking into account des. ef.
++  IssmDouble water; //water=rain + snowmelt 
++  IssmDouble runoff; //meltwater only, does not include rain 
++  IssmDouble sconv; //rhow_rain/rhoi / 12 months
+   
+-  double density;
+-  double lapser=6.5/1000., sealev=0.;    // lapse rate. degrees per meter. 7.5 lev's 99 paper, 9 Marshall 99 paper
+-  double desfac = 0.5;                 // desert elevation factor
+-  double s0p=0.;         // should be set to elevation from precip source
+-  double s0t=0.;         // should be set to elevation from temperature source
+-  double st;             // elevation between altitude of the temp record and current altitude
+-  double sp;             // elevation between altitude of the prec record and current altitude
++  IssmDouble density;
++  IssmDouble lapser=6.5/1000., sealev=0.;    // lapse rate. degrees per meter. 7.5 lev's 99 paper, 9 Marshall 99 paper
++  IssmDouble desfac = 0.5;                 // desert elevation factor
++  IssmDouble s0p=0.;         // should be set to elevation from precip source
++  IssmDouble s0t=0.;         // should be set to elevation from temperature source
++  IssmDouble st;             // elevation between altitude of the temp record and current altitude
++  IssmDouble sp;             // elevation between altitude of the prec record and current altitude
+   
+   // PDD and PD constants and variables
+-  double siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
+-  double signormc = signorm - 0.5;     // sigma of the temperature distribution for cloudy day
+-  double siglimc, siglim0, siglim0c;
+-  double PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C)
+-  double DT = 0.02;
+-  double pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
++  IssmDouble siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
++  IssmDouble signormc = signorm - 0.5;     // sigma of the temperature distribution for cloudy day
++  IssmDouble siglimc, siglim0, siglim0c;
++  IssmDouble PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C)
++  IssmDouble DT = 0.02;
++  IssmDouble pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
+   
+-  double q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
+-  double qm = 0.;        // snow part of the precipitation 
+-  double qmt = 0.;       // precipitation without desertification effect adjustment
+-  double qmp = 0.;       // desertification taken into account
+-  double pdd = 0.;     
+-  double frzndd = 0.;  
++  IssmDouble q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
++  IssmDouble qm = 0.;        // snow part of the precipitation 
++  IssmDouble qmt = 0.;       // precipitation without desertification effect adjustment
++  IssmDouble qmp = 0.;       // desertification taken into account
++  IssmDouble pdd = 0.;     
++  IssmDouble frzndd = 0.;  
+   
+-  double tstar;                        // monthly mean surface temp
+-  double Tsum= 0.;       // average summer (JJA) temperature
+-  double Tsurf = 0.;     // average annual temperature    
++  IssmDouble tstar;                        // monthly mean surface temp
++  IssmDouble Tsum= 0.;       // average summer (JJA) temperature
++  IssmDouble Tsurf = 0.;     // average annual temperature    
+   
+ 
+-  double deltm=1./12.;
++  IssmDouble deltm=1./12.;
+   int    ismon[12]={11,0,1,2,3,4,5,6,7,8,9,10};
+   
+-  double snwm;  // snow that could have been melted in a year.
+-  double snwmf; //  ablation factor for snow per positive degree day.
+-  double smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
++  IssmDouble snwm;  // snow that could have been melted in a year.
++  IssmDouble snwmf; //  ablation factor for snow per positive degree day.
++  IssmDouble smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
+   
+-  double dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
+-  double supice,supcap,diffndd;
+-  double fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
+-  double pddtj, hmx2;
++  IssmDouble dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
++  IssmDouble supice,supcap,diffndd;
++  IssmDouble fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
++  IssmDouble pddtj, hmx2;
+   
+   sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months
+   
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.h	(revision 12704)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.h	(revision 12705)
+@@ -50,9 +50,9 @@
+ 		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12710-12711.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12710-12711.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12710-12711.diff	(revision 13394)
@@ -0,0 +1,49 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install-macosx64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install-macosx64.sh	(revision 12711)
+@@ -0,0 +1,38 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf install
++rm -rf modules-3.2.9
++mkdir install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/modules-3.2.9.tar.gz' 'modules-3.2.9.tar.gz'
++
++#Untar 
++tar -zxvf  modules-3.2.9.tar.gz
++
++#Move modules into src directory
++
++#Configure modules
++cd modules-3.2.9
++./configure \
++	--prefix=$ISSM_DIR/externalpackages/modules/install\
++	--with-module-path=$ISSM_DIR/externalpackages/modules/install/modules/files\
++	--with-version-path=$ISSM_DIR/externalpackages/modules/install/modules/versions\
++	--with-tcl-lib=$ISSM_DIR/externalpackages/tcl/install/Library/Frameworks/Tcl.framework/Versions/8.5\
++	--with-tcl-inc=$ISSM_DIR/externalpackages/tcl/install/Library/Frameworks/Tcl.framework/Versions/8.5/Headers\
++	--with-tcl-ver=8.5\
++	--with-tclx-lib=$ISSM_DIR/externalpackages/tclx/install/lib/tclx8.4\
++    --with-tclx-inc=$ISSM_DIR/externalpackages/tclx/install/include\
++	--with-tclx-ver=8.4\
++	--with-etc-path=$ISSM_DIR/externalpackages/modules/install/modules/etc\
++	--with-skel-path=$ISSM_DIR/externalpackages/modules/install/modules/etc/skel\
++	--disable-dependency-tracking
++
++#Compile and install modules
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install-macosx64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12711-12712.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12711-12712.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12711-12712.diff	(revision 13394)
@@ -0,0 +1,54 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx/install.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx/install.sh	(revision 12712)
+@@ -0,0 +1,31 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf src
++rm -rf install
++rm -rf tclx8.4
++mkdir src install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/tclx8.4.tar.gz' 'tclx8.4.tar.gz'
++
++#Untar 
++tar -zxvf  tclx8.4.tar.gz
++
++#Move tclx into src directory
++mv tclx8.4/* src
++rm -rf tclx8.4
++
++#Configure tclx
++cd src
++./configure --prefix="$ISSM_DIR/externalpackages/tclx/install"  \
++			--exec-prefix="$ISSM_DIR/externalpackages/tclx/install"  \
++	        --with-tcl=$ISSM_DIR/externalpackages/tcl/install/Library/Frameworks/Tcl.framework
++
++#Compile and install tclx
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx	(revision 12711)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx	(revision 12712)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++src
++install
++*.gz
Index: /issm/oecreview/Archive/12678-13393/ISSM-12712-12713.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12712-12713.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12712-12713.diff	(revision 13394)
@@ -0,0 +1,11 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/esmf
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/esmf	(revision 12712)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/esmf	(revision 12713)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/esmf
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++esmf
++*.gz
Index: /issm/oecreview/Archive/12678-13393/ISSM-12713-12714.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12713-12714.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12713-12714.diff	(revision 13394)
@@ -0,0 +1,40 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ncview
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ncview	(revision 12713)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ncview	(revision 12714)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ncview
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,5 ##
++*.gz
++udunits.tar
++install
++genoverlay
++README
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf	(revision 12713)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf	(revision 12714)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf
+___________________________________________________________________
+Modified: svn:ignore
+## -1 +1,4 ##
++*.gz
+ install
++install-*
++src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/automake
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/automake	(revision 12713)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/automake	(revision 12714)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/automake
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
+ install
+ src
+ .ignore.txt
++*.gz
Index: /issm/oecreview/Archive/12678-13393/ISSM-12714-12715.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12714-12715.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12714-12715.diff	(revision 13394)
@@ -0,0 +1,49 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh	(revision 12714)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh	(revision 12715)
+@@ -2,7 +2,7 @@
+ 
+ #Some cleanup
+ version=3.6.1
+-rm -rf src install octave-$version octave-$version.tar.gz
++rm -rf src install octave-$version 
+ mkdir install src
+ 
+ #Download from ISSM server
+@@ -17,14 +17,13 @@
+ 
+ #install
+ cd src 
++./configure --prefix=$ISSM_DIR/externalpackages/octave/install --disable-readline
+ 
+-exit
+-make 
+-
+-#Compile 
+-cd ../install
+-mkdir lib
+-cd lib
+-cp ../../src/*.a .
+-ln -s octave_LINUX.a octave.a
+-ln -s octave_LINUX.a liboctave.a
++if [ -z $NUMCPUS ];
++then
++	make
++	make install
++else
++	make -j $NUMCPUS
++	make -j $NUMCPUS install
++fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave	(revision 12714)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave	(revision 12715)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++*.gz
++install
++src
Index: /issm/oecreview/Archive/12678-13393/ISSM-12715-12716.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12715-12716.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12715-12716.diff	(revision 13394)
@@ -0,0 +1,23 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf-python
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf-python	(revision 12715)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf-python	(revision 12716)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf-python
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++install
++*.gz
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl	(revision 12715)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl	(revision 12716)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl
+___________________________________________________________________
+Modified: svn:ignore
+## -1,2 +1,3 ##
++*.gz
+ install
+ src
Index: /issm/oecreview/Archive/12678-13393/ISSM-12716-12717.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12716-12717.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12716-12717.diff	(revision 13394)
@@ -0,0 +1,27 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/aspell/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/aspell/install.sh	(revision 12716)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/aspell/install.sh	(revision 12717)
+@@ -3,7 +3,7 @@
+ #0: cleanup
+ #1:  install aspell
+ #2:  install en dictionary
+-step=0
++step=2
+ 
+ 
+ #Some cleanup
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/aspell
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/aspell	(revision 12716)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/aspell	(revision 12717)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/aspell
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,5 ##
++src 
++install
++dicts
++*.gz
++src
Index: /issm/oecreview/Archive/12678-13393/ISSM-12717-12718.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12717-12718.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12717-12718.diff	(revision 13394)
@@ -0,0 +1,25 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install.sh	(revision 12717)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install.sh	(revision 12718)
+@@ -21,6 +21,7 @@
+ ./configure \
+ 	--prefix="$ISSM_DIR/externalpackages/gdal/install" \
+ 	--without-python \
++	--without-png \
+ 	--with-netcdf=no \
+ 	--with-jasper=no \
+ 	--without-ld-shared \
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal	(revision 12717)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal	(revision 12718)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++*.gz
+ install*
+ src
+ .ignore.txt
Index: /issm/oecreview/Archive/12678-13393/ISSM-12718-12719.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12718-12719.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12718-12719.diff	(revision 13394)
@@ -0,0 +1,44 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh	(revision 12719)
+@@ -0,0 +1,23 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf src
++rm -rf install
++rm -rf tcl8.5.11
++mkdir src install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/tcl8.5.11.tar.gz' 'tcl8.5.11.tar.gz'
++
++#Untar 
++tar -zxvf  tcl8.5.11.tar.gz
++
++#Move tcl into src directory
++mv tcl8.5.11/* src
++rm -rf tcl8.5.11
++
++#Configure tcl
++ver="8.4.12"
++
++cd src
++make -C ./macosx install INSTALL_ROOT="$ISSM_DIR/externalpackages/tcl/install"
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl	(revision 12718)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl	(revision 12719)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1 ##
++*.gz
Index: /issm/oecreview/Archive/12678-13393/ISSM-12719-12720.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12719-12720.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12719-12720.diff	(revision 13394)
@@ -0,0 +1,68 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-snowleopard.sh	(revision 12719)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-snowleopard.sh	(revision 12720)
+@@ -26,6 +26,8 @@
+ # --enable-framework needs to have the form "$SOME_PATH/Library/Frameworks" to avoid installing components in /Applications directory
+ # --prefix is recognized as $SOME_PATH as long as this form is taken, so it's not necessary to include
+ ./configure --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
++
++#make
+ if [ -z $1 ]; then
+ 	make
+ else
+@@ -47,4 +49,8 @@
+ 	cd ../install
+ 	ln -s Library/Frameworks/Python.framework/Headers include
+ 	ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
++	
++	#Patch pyport.h:
++	cd include
++	patch pyport.h ../patch/pyport.h.patch
+ fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-lion.sh	(revision 12719)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-lion.sh	(revision 12720)
+@@ -22,7 +22,11 @@
+ 
+ #Configure doxygen
+ cd src 
+-./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-framework="$ISSM_DIR/externalpackages/python/install"
++./configure --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
++#obsolete? 
++#./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-framework="$ISSM_DIR/externalpackages/python/install"
++
++#make
+ if [ -z $1 ]; then
+ 	make
+ else
+@@ -37,6 +41,15 @@
+ 	cd ../
+ 	ln -s Python.framework/Versions/3.2/include/python3.2m include
+ 	ln -s Python.framework/Versions/3.2/lib/ lib
++fi
+ 
++#Some modifications to be done in case version is 2.7
++if [[ $version == "2.7.2" ]]; then 
++	cd ../install
++	ln -s Library/Frameworks/Python.framework/Headers include
++	ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
+ 
++	#Patch pyport.h:
++	cd include
++	patch pyport.h ../patch/pyport.h.patch
+ fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python	(revision 12719)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python	(revision 12720)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
+ install
++install-python*
+ src
+ *.tgz
Index: /issm/oecreview/Archive/12678-13393/ISSM-12720-12721.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12720-12721.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12720-12721.diff	(revision 13394)
@@ -0,0 +1,30 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-emulators
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-emulators	(revision 12720)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-emulators	(revision 12721)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-emulators
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1 ##
++Android-*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-ndk
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-ndk	(revision 12720)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-ndk	(revision 12721)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-ndk
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1 ##
++install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android	(revision 12720)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android	(revision 12721)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1 ##
++arm-linux*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12721-12722.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12721-12722.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12721-12722.diff	(revision 13394)
@@ -0,0 +1,109 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules	(revision 12721)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules	(revision 12722)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++modules-*
++install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autoconf
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autoconf	(revision 12721)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autoconf	(revision 12722)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autoconf
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++*.gz
+ install
+ src
+ .ignore.txt
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl	(revision 12721)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl	(revision 12722)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl
+___________________________________________________________________
+Modified: svn:ignore
+## -1 +1,4 ##
+ *.gz
++build
++src
++install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/hdf5
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/hdf5	(revision 12721)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/hdf5	(revision 12722)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/hdf5
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++install
++src
++*.gz
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pcre
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pcre	(revision 12721)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pcre	(revision 12722)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pcre
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++install
++*.gz
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool	(revision 12721)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool	(revision 12722)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++*.gz
+ install
+ src
+ .ignore.txt
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc	(revision 12721)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc	(revision 12722)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++*.gz
+ install*
+ src
+ configure.sh
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/h5py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/h5py	(revision 12721)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/h5py	(revision 12722)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/h5py
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++*.gz
++install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages	(revision 12721)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages	(revision 12722)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages
+___________________________________________________________________
+Modified: svn:ignore
+## -1,2 +1,3 ##
+ MITgcm
+ OpenAD
++ivins
Index: /issm/oecreview/Archive/12678-13393/ISSM-12722-12723.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12722-12723.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12722-12723.diff	(revision 13394)
@@ -0,0 +1,47 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh	(revision 12723)
+@@ -0,0 +1,36 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf install petsc-3.3-p2 src
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.3-p2.tar.gz' 'petsc-3.3-p2.tar.gz'
++
++#Untar and move petsc to install directory
++tar -zxvf  petsc-3.3-p2.tar.gz
++mv petsc-3.3-p2/* src/
++rm -rf petsc-3.3-p2
++
++#configure
++cd src
++./config/configure.py \
++	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
++	--with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
++	--PETSC_ARCH=linux-gnu-amd64 \
++	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
++	--with-debugging=0 \
++	--with-shared-libraries=0 \
++	--download-mumps=yes \
++	--download-scalapack=yes \
++	--download-blacs=yes \
++	--download-blas=yes \
++	--download-f-blas-lapack=yes \
++	--download-plapack=yes \
++	--download-parmetis=yes \
++	--download-metis=yes \
++	--with-pic=1
++
++#Compile petsc and install it
++make
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12723-12724.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12723-12724.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12723-12724.diff	(revision 13394)
@@ -0,0 +1,95 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install.sh	(revision 12723)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install.sh	(revision 12724)
+@@ -1,22 +0,0 @@
+-#!/bin/bash
+-#http://www.mcs.anl.gov/research/projects/tao/download/index.html
+-#wget http://www.mcs.anl.gov/research/projects/tao/download/tao-2.0-p3.tar.gz
+-
+-#Some cleanup
+-rm -rf install tao-2.0-p3
+-mkdir install
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/tao-2.0-p3.tar.gz' 'tao-2.0-p3.tar.gz'
+-
+-#Untar 
+-tar -zxvf  tao-2.0-p3.tar.gz
+-
+-#move into place
+-mv tao-2.0-p3/* install/
+-rm -rf tao-2.0-p3
+-cd install
+-export TAO_DIR="$ISSM_DIR/externalpackages/tao/install/"
+-
+-#petsc needs to be compiled with --with-clanguage=C++
+-make
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.0.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.0.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.0.sh	(revision 12724)
+@@ -0,0 +1,23 @@
++#!/bin/bash
++#http://www.mcs.anl.gov/research/projects/tao/download/index.html
++
++#Compatible with PETSc 3.2
++
++#Some cleanup
++rm -rf install tao-2.0-p3
++mkdir install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/tao-2.0-p3.tar.gz' 'tao-2.0-p3.tar.gz'
++
++#Untar 
++tar -zxvf  tao-2.0-p3.tar.gz
++
++#move into place
++mv tao-2.0-p3/* install/
++rm -rf tao-2.0-p3
++cd install
++export TAO_DIR="$ISSM_DIR/externalpackages/tao/install/"
++
++#petsc needs to be compiled with --with-clanguage=C++
++make
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.0.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.1.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.1.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.1.sh	(revision 12724)
+@@ -0,0 +1,23 @@
++#!/bin/bash
++#http://www.mcs.anl.gov/research/projects/tao/download/index.html
++
++#compatible with PETSc 3.3
++
++#Some cleanup
++rm -rf install tao-2.1-p0
++mkdir install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/tao-2.1-p0.tar.gz' 'tao-2.1-p0.tar.gz'
++
++#Untar 
++tar -zxvf  tao-2.1-p0.tar.gz
++
++#move into place
++mv tao-2.1-p0/* install/
++rm -rf tao-2.1-p0
++cd install
++export TAO_DIR="$ISSM_DIR/externalpackages/tao/install/"
++
++#petsc needs to be compiled with --with-clanguage=C++
++make
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.1.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12724-12725.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12724-12725.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12724-12725.diff	(revision 13394)
@@ -0,0 +1,27 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp	(revision 12724)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp	(revision 12725)
+@@ -5320,8 +5320,8 @@
+ 
+ 		int i; 
+ 		for (i=0;i<Gh.nbv;i++) if (Gh[i].Required()) NbVerticesOnGeomVertex++;
++		printf("\n");
+ 		if(NbVerticesOnGeomVertex >= maxnbv){
+-			delete [] bcurve;
+ 			_error2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
+ 		}
+ 
+@@ -5347,10 +5347,10 @@
+ 				BamgVertex *bv = vog;
+ 				_assert_(gv->MeshVertexHook); // use of Geom -> Th
+ 				VertexOnBThVertex[NbVertexOnBThVertex++]=VertexOnVertex(gv->MeshVertexHook,bv);
+-				gv->MeshVertexHook->m = bv->m; // for taking the metrix of the background mesh
++				gv->MeshVertexHook->m = bv->m; // for taking the metric of the background mesh
+ 			}
+ 		}
+-		_assert_(NbVertexOnBThVertex==NbVerticesOnGeomVertex);
++		_assert_(NbVertexOnBThVertex==NbVerticesOnGeomVertex); /*This might be due to MaxCornerAngle too small*/
+ 
+ 		/*STEP 2: reseed boundary edges*/
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12725-12726.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12725-12726.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12725-12726.diff	(revision 13394)
@@ -0,0 +1,24 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 12725)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 12726)
+@@ -41,7 +41,6 @@
+ 	int          xi,yi;
+ 	IssmDouble       xmin,xmax,ymin,ymax;
+ 	IssmDouble       offset,minlength,minspacing,mintrimming,maxtrimming;
+-	int         *indices     = NULL;
+ 	Observation *observation = NULL;
+ 
+ 	/*Get extrema*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.h	(revision 12725)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.h	(revision 12726)
+@@ -11,7 +11,6 @@
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ 
+ /*forward declarations */
+-
+ class Elements;
+ class Loads;
+ class Nodes;
Index: /issm/oecreview/Archive/12678-13393/ISSM-12726-12727.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12726-12727.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12726-12727.diff	(revision 13394)
@@ -0,0 +1,45 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 12726)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 12727)
+@@ -95,6 +95,8 @@
+ 		xDelete<double>(gate.percent);
+ 	}
+ 	else if(strcmp(output,"idw")==0){ //Inverse distance weighting
++		double power;
++		options->Get(&power,"power",2.);
+ 		/*initialize thread parameters: */
+ 		gate.n_interp     = n_interp;
+ 		gate.x_interp     = x_interp;
+@@ -107,6 +109,7 @@
+ 		gate.predictions  = predictions;
+ 		gate.error        = error;
+ 		gate.percent      = xNewZeroInit<double>(num);
++		gate.power        = power;
+ 
+ 		/*launch the thread manager with Krigingxt as a core: */
+ 		LaunchThread(idwt,(void*)&gate,num);
+@@ -269,10 +272,10 @@
+ 	double       *predictions  = gate->predictions;
+ 	double       *error        = gate->error;
+ 	double       *percent      = gate->percent;
++	double        power        = gate->power;
+ 
+ 	/*Intermediaries*/
+ 	double localpercent;
+-	double  power = 2.;
+ 
+ 	/*partition loop across threads: */
+ 	PartitionRange(&i0,&i1,n_interp,num_threads,my_thread);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.h	(revision 12726)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.h	(revision 12727)
+@@ -28,6 +28,7 @@
+ 	double       *predictions;
+ 	double       *error;
+ 	double       *percent;
++	double        power;//for idw
+ }KrigingxThreadStruct;
+ 
+ void* Krigingxt(void*);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12727-12728.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12727-12728.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12727-12728.diff	(revision 13394)
@@ -0,0 +1,48 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 12727)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 12728)
+@@ -19,6 +19,7 @@
+ 	double* data_interp=NULL;
+ 
+ 	/*Intermediary*/
++	double xmin,xmax,ymin,ymax;
+ 	bool   isdefault;
+ 	double defaultvalue;
+ 	R2     r;
+@@ -56,9 +57,27 @@
+ 	Th.TriangleReferenceList(reft);
+ 	Th.CreateSingleVertexToTriangleConnectivity();
+ 
++	/*Get domain boundaries*/
++	xmin=x_data[0]; ymin=y_data[0];
++	xmax=x_data[0]; ymax=y_data[0];
++	for(i=1;i<nods_data;i++){
++		if(x_data[i]<xmin) xmin=x_data[i];
++		if(x_data[i]>xmax) xmax=x_data[i];
++		if(y_data[i]<ymin) ymin=y_data[i];
++		if(y_data[i]>ymax) ymax=y_data[i];
++	}
++
+ 	/*Loop over output nodes*/
+ 	for(i=0;i<N_interp;i++){
++		//if(i%100==0) _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<double(i)/double(N_interp)*100.<<"%");
+ 
++		if(isdefault){
++			if(x_interp[i]<xmin || x_interp[i]>xmax || y_interp[i]<ymin || y_interp[i]>ymax){
++				for(j=0;j<N_data;j++) data_interp[i*N_data+j]=defaultvalue;
++				continue;
++			}
++		}
++
+ 		/*Get current point coordinates*/
+ 		r.x=x_interp[i]; r.y=y_interp[i];
+ 		I2 I=Th.R2ToI2(r);
+@@ -124,6 +143,7 @@
+ 			}
+ 		}
+ 	}
++	//if(N_interp>=100) _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
+ 
+ 	/*clean-up and return*/
+ 	xDelete<long>(reft);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12728-12729.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12728-12729.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12728-12729.diff	(revision 13394)
@@ -0,0 +1,56 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 12728)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 12729)
+@@ -47,14 +47,14 @@
+ 		if (strcmp(type,"mpiaij")==0){
+ 			d_nz=0;
+ 			o_nz=0;
+-			#ifdef _HAVE_PETSCDEV_
++			#if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 2
+ 			MatCreateAIJ(MPI_COMM_WORLD,PETSC_DETERMINE,PETSC_DETERMINE, 0,0,d_nz,PETSC_NULL,o_nz,PETSC_NULL,&outmatrix);
+ 			#else
+ 			MatCreateMPIAIJ(MPI_COMM_WORLD,PETSC_DETERMINE,PETSC_DETERMINE, 0,0,d_nz,PETSC_NULL,o_nz,PETSC_NULL,&outmatrix);
+ 			#endif
+ 		}
+ 		else if (strcmp(type,"mpidense")==0){
+-			#ifdef _HAVE_PETSCDEV_
++			#if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 2
+ 			MatCreateDense(MPI_COMM_WORLD,PETSC_DETERMINE,PETSC_DETERMINE, 0,0,PETSC_NULL,&outmatrix);
+ 			#else
+ 			MatCreateMPIDense(MPI_COMM_WORLD,PETSC_DETERMINE,PETSC_DETERMINE, 0,0,PETSC_NULL,&outmatrix);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 12728)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 12729)
+@@ -89,7 +89,7 @@
+ 		}
+ 	}
+ 
+-#ifdef _HAVE_PETSCDEV_
++#if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 2
+ 	PetscTokenDestroy(&token);
+ #else
+ 	PetscTokenDestroy(token);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp	(revision 12728)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp	(revision 12729)
+@@ -38,7 +38,7 @@
+ 	d_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
+ 	o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
+ 
+-	#ifdef _HAVE_PETSCDEV_
++	#if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 2
+ 	MatCreateAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 
+ 	#else
+ 	MatCreateMPIAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 
+@@ -66,7 +66,7 @@
+ 	d_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
+ 	o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
+ 
+-	#ifdef _HAVE_PETSCDEV_
++	#if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 2
+ 	if(sparsity==1){
+ 		MatCreateDense(MPI_COMM_WORLD,m,n,M,N,NULL,&outmatrix); 
+ 	}
Index: /issm/oecreview/Archive/12678-13393/ISSM-12729-12730.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12729-12730.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12729-12730.diff	(revision 13394)
@@ -0,0 +1,44 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-petsc3.3.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-petsc3.3.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-petsc3.3.sh	(revision 12730)
+@@ -0,0 +1,33 @@
++#!/bin/sh
++
++#External packages versions:
++#petsc 3.3
++#mpich 1.4
++
++./configure \
++ --prefix=$ISSM_DIR \
++ --with-matlab-dir=$MATLAB_DIR \
++ --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
++ --with-metis-dir=$ISSM_DIR/externalpackages/petsc/src/externalpackages/metis-5.0.2-p3 \
++ --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
++ --with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
++ --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
++ --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich -lmpl " \
++ --with-petsc-arch=$ISSM_ARCH \
++ --with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
++ --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
++ --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
++ --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
++ --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
++ --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++ --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++ --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++ --with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
++ --with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
++ --with-shapelib-dir="$ISSM_DIR/externalpackages/shapelib/install" \
++ --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" \
++ --with-graphics-lib=/usr/lib64/libX11.so \
++ --with-cxxoptflags="-march=opteron -O2" \
++ --with-numthreads=16 \
++ --enable-debugging
++ #--with-serial=no \
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-petsc3.3.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12730-12731.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12730-12731.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12730-12731.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 12730)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 12731)
+@@ -54,6 +54,10 @@
+ 	METIS_PartMeshNodal(pnumberofelements,pnumberofnodes, eptr, index,
+ 			NULL, NULL, pnum_procs, tpwgts, options, &objval,epart, npart);
+ 
++	/*clean-up*/
++	xDelete<idx_t>(eptr);
++	xDelete<real_t>(tpwgts);
++
+ 	#else
+ 	_error2_("METIS version not supported yet");
+ 	#endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-12731-12732.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12731-12732.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12731-12732.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_gridded.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_gridded.m	(revision 12731)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_gridded.m	(revision 12732)
+@@ -49,7 +49,7 @@
+ data_grid(isnan(data_grid))=white;
+ 
+ %Select plot area 
+-subplot(plotlines,plotcols,i);
++subplotmodel(plotlines,plotcols,i,options);
+ 
+ %shading interp;
+ h=imagesc(xlim,ylim,data_grid);set(gca,'YDir','normal');
Index: /issm/oecreview/Archive/12678-13393/ISSM-12732-12733.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12732-12733.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12732-12733.diff	(revision 13394)
@@ -0,0 +1,522 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.m	(revision 12732)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.m	(revision 12733)
+@@ -171,7 +171,7 @@
+ end
+ % }}}
+ function result=ReadDataDimensions(fid) % {{{
+-%READDATA - read data dimensions, step and time, but not the data itself.
++%READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
+ %
+ %   Usage:
+ %      field=ReadDataDimensions(fid)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 12732)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 12733)
+@@ -15,10 +15,9 @@
+ 
+ 	#open file for binary writing
+ 	try:
+-		fid=open(md.miscellaneous.name+'.bin','wb');
++		fid=open(md.miscellaneous.name+'.bin','wb')
+ 	except IOError as e:
+-		print "marshall error message: could not open '%s.bin' file for binary writing." % md.miscellaneous.name
+-		raise IOError(e)
++		raise IOError("marshall error message: could not open '%s.bin' file for binary writing." % md.miscellaneous.name)
+ 
+ 	#First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
+ 	WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean')
+@@ -44,6 +43,5 @@
+ 	try:
+ 		f.close(fid)
+ 	except IOError as e:
+-		print "marshall error message: could not close file '%s.bin'." % md.miscellaneous.name
+-		raise IOError(e)
++		raise IOError("marshall error message: could not close file '%s.bin'." % md.miscellaneous.name)
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py	(revision 12733)
+@@ -0,0 +1,20 @@
++"""
++PROCESSPATCH - create a structure from a patch
++ 
++    Usage:
++       Result=ProcessPatch(Result);
++"""
++
++def MatlabProcessPatch(structure):
++
++	#loop over steps
++	for structurei in structure.itervalues():
++
++		#return if there is no field Patch
++		if not 'Patch' in structurei:
++			continue
++
++		raise SystemError("MatlabProcessPatch not implemented in Python.")
++
++	return structure
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py	(revision 12733)
+@@ -0,0 +1,61 @@
++"""
++LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
++ 
++    Usage:
++       md=loadresultsfromdisk(md=False,filename=False);
++"""
++
++import os
++
++def loadresultsfromdisk(md,filename):
++
++	#check number of inputs/outputs
++	if not md or not filename:
++		raise ValueError("loadresultsfromdisk: error message.")
++
++	if not md.qmu.isdakota:
++
++		#Check that file exists
++		if not os.path.exists(filename):
++			raise ValueError("binary file '%s' not found." % filename)
++
++		#initialize md.results if not a structure yet
++		if not isinstance(md.results,dict):
++			md.results={}
++
++		#load results onto model
++		structure=parseresultsfromdisk(filename,~md.settings.io_gather)
++		if not len(structure):
++			raise RuntimeError("No result found in binary file '%s'. Check for solution crash." % filename)
++		end
++		md.results[structure[1]['SolutionType']]=structure;
++
++		#recover solution_type from results
++		md.private.solution=structure[1]['SolutionType']
++
++		#read log files onto fields
++		if os.path.exists(md.miscellaneous.name+'.errlog'):
++			with open(md.miscellaneous.name+'.errlog','r') as f:
++				md.results[structure[1]['SolutionType']]['errlog']=[line[:-1] for line in f]
++		else:
++			md.results[structure[1]['SolutionType']]['errlog']=[]
++
++		if os.path.exists(md.miscellaneous.name+'.outlog'):
++			with open(md.miscellaneous.name+'.outlog','r') as f:
++				md.results[structure[1]['SolutionType']]['outlog']=[line[:-1] for line in f]
++		else:
++			md.results[structure[1]['SolutionType']]['outlog']=[]
++
++		if len(md.results[structure[1]['SolutionType']]['errlog']):
++			print ("loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields.")
++
++	#post processes qmu results if necessary
++	else:
++
++		if not isinstance(md.private.solution,str):
++			md.private.solution=EnumToString(md.private.solution)
++		md=postqmu(md)
++		os.chdir('..')
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py	(revision 12733)
+@@ -0,0 +1,62 @@
++"""
++LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
++ 
++    Usage:
++       md=loadresultsfromcluster(md,runtimename);
++"""
++
++import os
++import platform
++import socket
++from MatlabFuncs import *
++
++def loadresultsfromcluster(md,runtimename=False):
++
++	#retrieve cluster, to be able to call its methods
++	cluster=md.cluster
++
++	if runtimename:
++		md.private.runtimename=runtimename
++	end
++
++	#Download outputs from the cluster
++	filelist=[md.miscellaneous.name+'.outlog',md.miscellaneous.name+'.errlog']
++	if md.qmu.isdakota:
++		filelist.append(md.miscellaneous.name+'.qmu.err')
++		filelist.append(md.miscellaneous.name+'.qmu.out')
++		if 'tabular_graphics_data' in md.qmu.params:
++			if md.qmu.params['tabular_graphics_data']:
++				filelist.append('dakota_tabular.dat')
++		filelist.append(md.miscellaneous.name+'.outbin')
++	Download(cluster,md.private.runtimename,filelist)
++
++	#If we are here, no errors in the solution sequence, call loadresultsfromdisk.
++	md=loadresultsfromdisk(md,md.miscellaneous.name+'.outbin')
++
++	#erase the log and output files
++	if md.qmu.isdakota:
++		os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.outlog'))
++		os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.errlog'))
++	else:
++		os.remove(md.miscellaneous.name+'.outlog')
++		os.remove(md.miscellaneous.name+'.errlog')
++		os.remove(md.miscellaneous.name+'.outbin')
++		if not 'Windows' in platform.system():
++			os.remove(md.private.runtimename+'.tar.gz')
++
++	#erase input file if run was carried out on same platform.
++	hostname=socket.gethostname().lower().split('.')[0]
++	if strcmpi(hostname,cluster.name):
++		if md.qmu.isdakota:
++			os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.bin'))
++			os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.queue'))
++		else:
++			os.remove(md.miscellaneous.name+'.bin')
++			os.remove(md.miscellaneous.name+'.petsc')
++			if not 'Windows' in platform.system():
++				os.remove(md.miscellaneous.name+'.queue')
++			else:
++				os.remove(md.miscellaneous.name+'.bat')
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.py	(revision 12733)
+@@ -0,0 +1,235 @@
++import struct
++import numpy
++from MatlabFuncs import *
++from MatlabProcessPatch import *
++
++def parseresultsfromdisk(filename,iosplit):
++	"""
++	PARSERESULTSFROMDISK - ...
++	 
++	    Usage:
++	       results=parseresultsfromdisk(filename,iosplit)
++	"""
++
++	if iosplit:
++		results=parseresultsfromdiskiosplit(filename)
++	else:
++		results=parseresultsfromdiskioserial(filename)
++
++	#process patch if necessary
++	results=MatlabProcessPatch(results)
++
++	return results
++
++def parseresultsfromdiskioserial(filename):    # {{{
++	"""
++	PARSERESULTSFROMDISK - ...
++	 
++	    Usage:
++	       results=parseresultsfromdiskioserial(filename)
++	"""
++
++	#Open file
++	try:
++		fid=open(filename,'rb')
++	except IOError as e:
++		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
++
++	results={}
++
++	#Read fields until the end of the file.
++	result=ReadData(fid)
++	while result:
++		#Get time and step
++		if not result['step'] in results:
++			results[result['step']]={}
++			results[result['step']]['step']=result['step']
++			results[result['step']]['time']=result['time'] 
++	
++		#Add result
++		if result['step'] in results and \
++		   result['fieldname'] in results[result['step']] and \
++		   not strcmp(result['fieldname'],'SolutionType'):
++			results[result['step']][result['fieldname']]=numpy.concatenate((results[result['step']][result['fieldname']],result['field']),axis=0)
++		else:
++			results[result['step']][result['fieldname']]=result['field']
++
++		#read next result
++		result=ReadData(fid)
++
++	fid.close()
++
++	return results
++	# }}}
++
++def parseresultsfromdiskiosplit(filename):    # {{{
++	"""
++	PARSERESULTSFROMDISKIOSPLIT - ...
++	 
++	    Usage:
++	       results=parseresultsfromdiskiosplit(filename)
++	"""
++
++	#Open file
++	try:
++		fid=open(filename,'rb')
++	except IOError as e:
++		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
++
++	results={}
++
++	#if we have done split I/O, ie, we have results that are fragmented across patches, 
++	#do a first pass, and figure out the structure of results
++	result=ReadDataDimensions(fid)
++	while result:
++
++		#Get time and step
++		if not result['step'] in results:
++			results[result['step']]={}
++			results[result['step']]['step']=result['step']
++			results[result['step']]['time']=result['time'] 
++
++		#Add result
++		if strcmpi(result['fieldname'],'Patch'):
++			results[result['step']][result['fieldname']]=[0,result['N']]
++		else:
++			results[result['step']][result['fieldname']]=float('NaN')
++
++		#read next result
++		result=ReadDataDimensions(fid)
++
++	#do a second pass, and figure out the size of the patches
++	fid.seek(0)    #rewind
++	result=ReadDataDimensions(fid)
++	while result:
++
++		#Add result
++		if strcmpi(result['fieldname'],'Patch'):
++			patchdimensions=results[result['step']][result['fieldname']]
++			results[result['step']][result['fieldname']]=[patchdimensions[0]+result['M'],result['N']]
++
++		#read next result
++		result=ReadDataDimensions(fid)
++
++	#allocate patches
++	for result in results.itervalues():
++		if 'Patch' in result:
++			result['Patch']=numpy.zeros(shape=(result['Patch'][0],result['Patch'][1]),dtype=float)
++			result['counter']=0    #use to index into the patch
++
++	#third pass, this time to read the real information
++	fid.seek(0)    #rewind
++	result=ReadData(fid)
++	while result:
++
++		#Get time and step
++		if not result['step'] in results:
++			results[result['step']]={}
++			results[result['step']]['step']=result['step']
++			results[result['step']]['time']=result['time'] 
++
++		#Add result
++		if strcmpi(result['fieldname'],'Patch'):
++			counter=results[result['step']]['counter']
++			counter2=counter+result['field'].shape[0]-1
++			results[result['step']][result['fieldname']][counter:counter2,:]=result['field']
++
++			#increment counter: 
++			results[result['step']]['counter']=counter2+1
++		else:
++			results[result['step']][result['fieldname']]=result['field']
++
++		#read next result
++		result=ReadData(fid)
++
++	#close file
++	fid.close()
++
++	return results
++	# }}}
++
++def ReadData(fid):    # {{{
++	"""
++	READDATA - ...
++	 
++	    Usage:
++	       field=ReadData(fid)
++	"""
++
++	#read field
++	try:
++		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
++		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
++		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		if   type==1:
++			field=numpy.array(struct.unpack('%dd' % M,fid.read(M*struct.calcsize('d'))),dtype=float)
++		elif type==2:
++			field=struct.unpack('%ds' % M,fid.read(M))[0][:-1]
++		elif type==3:
++			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++#			field=transpose(fread(fid,[N M],'double'));
++			field=numpy.zeros(shape=(M,N),dtype=float)
++			for i in xrange(M):
++				field[i,:]=struct.unpack('%dd' % N,fid.read(N*struct.calcsize('d')))
++		else:
++			raise TypeError("cannot read data of type %d" % type)
++
++		result={}
++		result['fieldname']=fieldname
++		result['time']=time
++		result['step']=step
++		result['field']=field
++
++	except struct.error as e:
++		result={}
++
++	return result
++	# }}}
++
++def ReadDataDimensions(fid):    # {{{
++	"""
++	READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
++	 
++	    Usage:
++	       field=ReadDataDimensions(fid)
++	"""
++
++	#read field
++	try:
++		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
++		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
++		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		N=1    #default
++		if   type==1:
++			fid.seek(M*8,1)
++		elif type==2:
++			fid.seek(M,1)
++		elif type==3:
++			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++			fid.seek(N*M*8,1)
++		else:
++			raise TypeError("cannot read data of type %d" % type)
++
++		result={}
++		result['fieldname']=fieldname
++		result['time']=time
++		result['step']=step
++		result['M']=M
++		result['N']=N
++
++	except struct.error as e:
++		result={}
++
++	return result
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.m	(revision 12732)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.m	(revision 12733)
+@@ -4,7 +4,7 @@
+ %   Usage:
+ %      Result=ProcessPatch(Result);
+ 
+-%return if there is no fiel Patch
++%return if there is no field Patch
+ if (~isfield(structure,'Patch')),
+ 	return;
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12733)
+@@ -0,0 +1,38 @@
++"""
++%ISPETSC - figure out if PETSC package was compiled with ISSM
++%
++%   Usage:
++%       flag=ispetsc();
++"""
++
++import os
++from issmdir import *
++from MatlabFuncs import *
++
++def ispetsc():
++
++	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
++	if not os.path.exists(configfile):
++		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
++
++	#go through the file, and recover the line we want
++	flag=2
++	try:
++		fid=open(configfile,'r')
++	except IOError as e:
++		print "could not open file: '%s'" % configfile
++		raise IOError(e)
++
++	for tline in fid:
++		if strncmp(tline,'/* #undef _HAVE_PETSC_ */',25):
++			flag=0
++			break
++		if  strncmp(tline,'#define _HAVE_PETSC_',20):
++			flag=1
++			break
++
++	fid.close()
++	if flag==2:
++		raise RuntimeError("could not determine whether PETSC was or was not compiled.")
++
++	return flag
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py	(revision 12733)
+@@ -0,0 +1,25 @@
++"""
++ISSMDIR - Get ISSM_DIR environment variable
++ 
++    Usage:
++       ISSM_DIR=issmdir()
++"""
++
++import platform
++import os
++from MatlabFuncs import *
++
++def issmdir():
++
++	if not 'Windows' in platform.system():
++		ISSM_DIR =os.environ['ISSM_DIR']
++	else:
++		ISSM_DIR =os.environ['ISSM_DIR_WIN']
++		if strcmpi(ISSM_DIR[-1],'/') or strcmpi(ISSM_DIR[-1],'\\'):
++			ISSM_DIR = ISSM_DIR[:-1]    #shave off the last '/'
++
++	if not ISSM_DIR:
++		raise RuntimeError("issmdir error message: 'ISSM_DIR' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!")
++
++	return ISSM_DIR
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12733-12734.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12733-12734.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12733-12734.diff	(revision 13394)
@@ -0,0 +1,117 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patch/pyport.h.patch
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patch/pyport.h.patch	(revision 12733)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patch/pyport.h.patch	(revision 12734)
+@@ -1,42 +0,0 @@
+-Index: Include/pyport.h
+-===================================================================
+---- Include/pyport.h (revision 933)
+-+++ Include/pyport.h (working copy)
+-@@ -514,22 +514,40 @@
+-#if __FreeBSD_version > 500039
+-#include <ctype.h>
+-#include <wctype.h>
+-+/* If the source file #includes <cctype> before "Python.h" then
+-+ * these macros will not be defined at this point and we
+-+ * should not define them either.
+-+ */
+-+#ifdef isalnum
+-#undef isalnum
+-#define isalnum(c) iswalnum(btowc(c))
+-+#endif
+-+#ifdef isalpha
+-#undef isalpha
+-#define isalpha(c) iswalpha(btowc(c))
+-+#endif
+-+#ifdef islower
+-#undef islower
+-#define islower(c) iswlower(btowc(c))
+-+#endif
+-+#ifdef isspace
+-#undef isspace
+-#define isspace(c) iswspace(btowc(c))
+-+#endif
+-+#ifdef isupper
+-#undef isupper
+-#define isupper(c) iswupper(btowc(c))
+-+#endif
+-+#ifdef tolower
+-#undef tolower
+-#define tolower(c) towlower(btowc(c))
+-+#endif
+-+#ifdef toupper
+-#undef toupper
+-#define toupper(c) towupper(btowc(c))
+-#endif
+-#endif
+-+#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patch/pyport.h.patch.bugreport
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patch/pyport.h.patch.bugreport	(revision 12733)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patch/pyport.h.patch.bugreport	(revision 12734)
+@@ -1 +0,0 @@
+-http://bugs.python.org/issue10910
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-lion.sh	(revision 12733)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-lion.sh	(revision 12734)
+@@ -1,6 +1,5 @@
+ #!/bin/bash
+ #wget http://python.org/ftp/python/version/Python-version.tgz
+-
+ #version=3.2.2
+ version=2.7.2
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patches/pyport.h.patch
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patches/pyport.h.patch	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patches/pyport.h.patch	(revision 12734)
+@@ -0,0 +1,42 @@
++Index: Include/pyport.h
++===================================================================
++--- Include/pyport.h (revision 933)
+++++ Include/pyport.h (working copy)
++@@ -514,22 +514,40 @@
++#if __FreeBSD_version > 500039
++#include <ctype.h>
++#include <wctype.h>
+++/* If the source file #includes <cctype> before "Python.h" then
+++ * these macros will not be defined at this point and we
+++ * should not define them either.
+++ */
+++#ifdef isalnum
++#undef isalnum
++#define isalnum(c) iswalnum(btowc(c))
+++#endif
+++#ifdef isalpha
++#undef isalpha
++#define isalpha(c) iswalpha(btowc(c))
+++#endif
+++#ifdef islower
++#undef islower
++#define islower(c) iswlower(btowc(c))
+++#endif
+++#ifdef isspace
++#undef isspace
++#define isspace(c) iswspace(btowc(c))
+++#endif
+++#ifdef isupper
++#undef isupper
++#define isupper(c) iswupper(btowc(c))
+++#endif
+++#ifdef tolower
++#undef tolower
++#define tolower(c) towlower(btowc(c))
+++#endif
+++#ifdef toupper
++#undef toupper
++#define toupper(c) towupper(btowc(c))
++#endif
++#endif
+++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patches/pyport.h.patch.bugreport
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patches/pyport.h.patch.bugreport	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patches/pyport.h.patch.bugreport	(revision 12734)
+@@ -0,0 +1 @@
++http://bugs.python.org/issue10910
Index: /issm/oecreview/Archive/12678-13393/ISSM-12734-12735.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12734-12735.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12734-12735.diff	(revision 13394)
@@ -0,0 +1,469 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-snowleopard.sh	(revision 12734)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-snowleopard.sh	(revision 12735)
+@@ -1,56 +0,0 @@
+-#!/bin/bash
+-#wget http://python.org/ftp/python/version/Python-version.tgz
+-
+-#version=3.2.2
+-version=2.7.2
+-
+-#Some cleanup
+-rm -rf install src
+-rm -rf Python-$version
+-mkdir install src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-$version.tgz Python-$version.tgz
+-
+-#exports
+-export CC
+-export MACOSX_DEPLOYMENT_TARGET=10.6
+-
+-#Untar and move python into install directory
+-tar -zxvf  Python-$version.tgz
+-mv Python-$version/* src
+-rm -rf Python-$version
+-
+-#Configure doxygen
+-cd src 
+-# --enable-framework needs to have the form "$SOME_PATH/Library/Frameworks" to avoid installing components in /Applications directory
+-# --prefix is recognized as $SOME_PATH as long as this form is taken, so it's not necessary to include
+-./configure --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
+-
+-#make
+-if [ -z $1 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make install
+-
+-#Some modifications to be done in case version is 3.2: 
+-if [[ $version == "3.2.2" ]]; then 
+-	cd install/bin
+-	ln -s python3.2 python 
+-	cd ../
+-	ln -s Python.framework/Versions/3.2/include/python3.2m include
+-	ln -s Python.framework/Versions/3.2/lib/ lib
+-fi
+-
+-#Some modifications to be done in case version is 2.7
+-if [[ $version == "2.7.2" ]]; then 
+-	cd ../install
+-	ln -s Library/Frameworks/Python.framework/Headers include
+-	ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
+-	
+-	#Patch pyport.h:
+-	cd include
+-	patch pyport.h ../patch/pyport.h.patch
+-fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-lion.sh	(revision 12734)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-macosx-lion.sh	(revision 12735)
+@@ -1,54 +0,0 @@
+-#!/bin/bash
+-#wget http://python.org/ftp/python/version/Python-version.tgz
+-#version=3.2.2
+-version=2.7.2
+-
+-#Some cleanup
+-rm -rf install src
+-rm -rf Python-$version
+-mkdir install src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-$version.tgz Python-$version.tgz
+-
+-#exports
+-export CC
+-
+-#Untar and move python into install directory
+-tar -zxvf  Python-$version.tgz
+-mv Python-$version/* src
+-rm -rf Python-$version
+-
+-#Configure doxygen
+-cd src 
+-./configure --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
+-#obsolete? 
+-#./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-framework="$ISSM_DIR/externalpackages/python/install"
+-
+-#make
+-if [ -z $1 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make install
+-
+-#Some modifications to be done in case version is 3.2: 
+-if [[ $version == "3.2.2" ]]; then 
+-	cd install/bin
+-	ln -s python3.2 python 
+-	cd ../
+-	ln -s Python.framework/Versions/3.2/include/python3.2m include
+-	ln -s Python.framework/Versions/3.2/lib/ lib
+-fi
+-
+-#Some modifications to be done in case version is 2.7
+-if [[ $version == "2.7.2" ]]; then 
+-	cd ../install
+-	ln -s Library/Frameworks/Python.framework/Headers include
+-	ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
+-
+-	#Patch pyport.h:
+-	cd include
+-	patch pyport.h ../patch/pyport.h.patch
+-fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-linux64-astrid.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-linux64-astrid.sh	(revision 12734)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-linux64-astrid.sh	(revision 12735)
+@@ -1,48 +0,0 @@
+-#!/bin/bash
+-#wget http://python.org/ftp/python/version/Python-version.tgz
+-
+-#version=3.2.2
+-version=2.7.2
+-
+-#Some cleanup
+-rm -rf install src
+-rm -rf Python-$version
+-mkdir install src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-$version.tgz Python-$version.tgz
+-
+-#exports
+-export CC
+-
+-#Untar and move python into install directory
+-tar -zxvf  Python-$version.tgz
+-mv Python-$version/* src
+-rm -rf Python-$version
+-
+-#Configure python
+-cd src 
+-./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-shared
+-
+-if [ -z $1 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make install
+-
+-#Some modifications to be done in case version is 3.2: 
+-if [[ $version == "3.2.2" ]]; then 
+-	cd ../install/bin
+-	ln -s python3.2 python 
+-	cd ../
+-	ln -s Python.framework/Versions/3.2/include/python3.2m include
+-	ln -s Python.framework/Versions/3.2/lib/ lib
+-fi
+-if [[ $version == "2.7.2" ]]; then 
+-	cd ../install/include
+-	cp python2.7/* ./
+-	cd ../lib
+-	ln -s  libpython2.7.so.1.0 libpython.so
+-	
+-fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh	(revision 12735)
+@@ -0,0 +1,39 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf install src
++rm -rf Python-3.2.2
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-3.2.2.tgz Python-3.2.2.tgz
++
++#exports
++export CC
++export MACOSX_DEPLOYMENT_TARGET=10.6
++
++#Untar and move python into install directory
++tar -zxvf  Python-3.2.2.tgz
++mv Python-3.2.2/* src
++rm -rf Python-3.2.2
++
++#Configure doxygen
++cd src 
++# --enable-framework needs to have the form "$SOME_PATH/Library/Frameworks" to avoid installing components in /Applications directory
++# --prefix is recognized as $SOME_PATH as long as this form is taken, so it's not necessary to include
++./configure \
++ --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
++
++#make
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
++
++cd install/bin
++ln -s python3.2 python 
++cd ../
++ln -s Python.framework/Versions/3.2/include/python3.2m include
++ln -s Python.framework/Versions/3.2/lib/ lib
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh	(revision 12735)
+@@ -0,0 +1,40 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf install src
++rm -rf Python-2.7.2
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.2.tgz Python-2.7.2.tgz
++
++#exports
++export CC
++export MACOSX_DEPLOYMENT_TARGET=10.6
++
++#Untar and move python into install directory
++tar -zxvf  Python-2.7.2.tgz
++mv Python-2.7.2/* src
++rm -rf Python-2.7.2
++
++#Configure doxygen
++cd src 
++# --enable-framework needs to have the form "$SOME_PATH/Library/Frameworks" to avoid installing components in /Applications directory
++# --prefix is recognized as $SOME_PATH as long as this form is taken, so it's not necessary to include
++./configure --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
++
++#make
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
++
++cd ../install
++ln -s Library/Frameworks/Python.framework/Headers include
++ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
++
++#Patch pyport.h:
++cd include
++patch pyport.h ../patch/pyport.h.patch
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh	(revision 12735)
+@@ -0,0 +1,36 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf install src
++rm -rf Python-3.2.2
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-3.2.2.tgz Python-3.2.2.tgz
++
++#exports
++export CC
++
++#Untar and move python into install directory
++tar -zxvf  Python-3.2.2.tgz
++mv Python-3.2.2/* src
++rm -rf Python-3.2.2
++
++#Configure python
++cd src 
++./configure \
++ --prefix="$ISSM_DIR/externalpackages/python/install" \
++ --enable-shared
++
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
++
++cd ../install/bin
++ln -s python3.2 python 
++cd ../
++ln -s Python.framework/Versions/3.2/include/python3.2m include
++ln -s Python.framework/Versions/3.2/lib/ lib
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh	(revision 12735)
+@@ -0,0 +1,39 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf install src
++rm -rf Python-3.2.2
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-3.2.2.tgz Python-3.2.2.tgz
++
++#exports
++export CC
++
++#Untar and move python into install directory
++tar -zxvf  Python-3.2.2.tgz
++mv Python-3.2.2/* src
++rm -rf Python-3.2.2
++
++#Configure doxygen
++cd src 
++./configure \
++ --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
++
++#obsolete? 
++#./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-framework="$ISSM_DIR/externalpackages/python/install"
++
++#make
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
++
++cd install/bin
++ln -s python3.2 python 
++cd ../
++ln -s Python.framework/Versions/3.2/include/python3.2m include
++ln -s Python.framework/Versions/3.2/lib/ lib
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh	(revision 12735)
+@@ -0,0 +1,35 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf install src
++rm -rf Python-2.7.2
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.2.tgz Python-2.7.2.tgz
++
++#exports
++export CC
++
++#Untar and move python into install directory
++tar -zxvf  Python-2.7.2.tgz
++mv Python-2.7.2/* src
++rm -rf Python-2.7.2
++
++#Configure python
++cd src 
++./configure \
++ --prefix="$ISSM_DIR/externalpackages/python/install" \
++ --enable-shared
++
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
++
++cd ../install/include
++cp python2.7/* ./
++cd ../lib
++ln -s  libpython2.7.so.1.0 libpython.so
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 12735)
+@@ -0,0 +1,41 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf install src
++rm -rf Python-2.7.2
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.2.tgz Python-2.7.2.tgz
++
++#exports
++export CC
++
++#Untar and move python into install directory
++tar -zxvf  Python-2.7.2.tgz
++mv Python-2.7.2/* src
++rm -rf Python-2.7.2
++
++#Configure doxygen
++cd src 
++./configure \
++ --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
++
++#obsolete? 
++#./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-framework="$ISSM_DIR/externalpackages/python/install"
++
++#make
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
++
++cd ../install
++ln -s Library/Frameworks/Python.framework/Headers include
++ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
++
++#Patch pyport.h:
++cd include
++patch pyport.h ../patch/pyport.h.patch
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12735-12736.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12735-12736.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12735-12736.diff	(revision 13394)
@@ -0,0 +1,114 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install.sh	(revision 12735)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install.sh	(revision 12736)
+@@ -1,35 +0,0 @@
+-#!/bin/bash
+-
+-version=4.0.1
+-#version=4.2
+-
+-#for versions 4.2, you need hdf5 compiled, as well as doxygen for the 
+-#documentation!
+-
+-#Some cleanup
+-rm -rf src install netcdf-$version
+-mkdir install src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py "http://issm.jpl.nasa.gov/files/externalpackages/netcdf-$version.tar.gz" "netcdf-$version.tar.gz"
+-
+-#Untar 
+-tar -zxvf  netcdf-$version.tar.gz
+-
+-#Move netcdf to install directory
+-rm -rf src/*
+-mv netcdf-$version/* src/
+-rm -rf netcdf-$version
+-
+-#Configure and compile
+-cd src
+-
+-#version dependent: 
+-./configure  --prefix="$ISSM_DIR/externalpackages/netcdf/install"  
+-
+-if [ -z $1 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh	(revision 12736)
+@@ -0,0 +1,28 @@
++#!/bin/bash
++
++#you need hdf5 compiled, as well as doxygen for the documentation
++
++#Some cleanup
++rm -rf src install netcdf-4.2
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py "http://issm.jpl.nasa.gov/files/externalpackages/netcdf-4.2.tar.gz" "netcdf-4.2.tar.gz"
++
++#Untar 
++tar -zxvf  netcdf-4.2.tar.gz
++
++#Move netcdf to install directory
++rm -rf src/*
++mv netcdf-4.2/* src/
++rm -rf netcdf-4.2
++
++#Configure and compile
++cd src
++./configure  --prefix="$ISSM_DIR/externalpackages/netcdf/install"  
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.0.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.0.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.0.sh	(revision 12736)
+@@ -0,0 +1,26 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf src install netcdf-4.0.1
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py "http://issm.jpl.nasa.gov/files/externalpackages/netcdf-4.0.1.tar.gz" "netcdf-4.0.1.tar.gz"
++
++#Untar 
++tar -zxvf  netcdf-4.0.1.tar.gz
++
++#Move netcdf to install directory
++rm -rf src/*
++mv netcdf-4.0.1/* src/
++rm -rf netcdf-4.0.1
++
++#Configure and compile
++cd src
++./configure  --prefix="$ISSM_DIR/externalpackages/netcdf/install"  
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.0.sh
+___________________________________________________________________
+Added: svn:executable
Index: /issm/oecreview/Archive/12678-13393/ISSM-12736-12737.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12736-12737.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12736-12737.diff	(revision 13394)
@@ -0,0 +1,36 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh	(revision 12736)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh	(revision 12737)
+@@ -1,23 +1,24 @@
+ #!/bin/bash
+ 
+ #Some cleanup
+-version=3.6.1
+-rm -rf src install octave-$version 
++rm -rf src install octave-3.6.2 
+ mkdir install src
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py "http://issm.jpl.nasa.gov/files/externalpackages/octave-$version.tar.gz" "octave-$version.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.py "http://issm.jpl.nasa.gov/files/externalpackages/octave-3.6.2.tar.gz" "octave-3.6.2.tar.gz"
+ 
+ #Untar 
+-tar -zxvf  octave-$version.tar.gz
++tar -zxvf  octave-3.6.2.tar.gz
+ 
+ #Move octave into install directory
+-mv octave-$version/* src
+-rm -rf octave-$version
++mv octave-3.6.2/* src
++rm -rf octave-3.6.2
+ 
+ #install
+ cd src 
+-./configure --prefix=$ISSM_DIR/externalpackages/octave/install --disable-readline
++./configure \
++ --prefix=$ISSM_DIR/externalpackages/octave/install \
++ --disable-readline
+ 
+ if [ -z $NUMCPUS ];
+ then
Index: /issm/oecreview/Archive/12678-13393/ISSM-12737-12738.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12737-12738.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12737-12738.diff	(revision 13394)
@@ -0,0 +1,4614 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/libtool.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/libtool.m4	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/libtool.m4	(revision 12738)
+@@ -1,7 +1,8 @@
+ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
++#                 Foundation, Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ # This file is free software; the Free Software Foundation gives
+@@ -10,7 +11,8 @@
+ 
+ m4_define([_LT_COPYING], [dnl
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
++#                 Foundation, Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -37,7 +39,7 @@
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ ])
+ 
+-# serial 56 LT_INIT
++# serial 57 LT_INIT
+ 
+ 
+ # LT_PREREQ(VERSION)
+@@ -66,6 +68,7 @@
+ # ------------------
+ AC_DEFUN([LT_INIT],
+ [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
++AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+ AC_BEFORE([$0], [LT_LANG])dnl
+ AC_BEFORE([$0], [LT_OUTPUT])dnl
+ AC_BEFORE([$0], [LTDL_INIT])dnl
+@@ -82,6 +85,8 @@
+ AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+ m4_require([_LT_PROG_LTMAIN])dnl
+ 
++_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
++
+ dnl Parse OPTIONS
+ _LT_SET_OPTIONS([$0], [$1])
+ 
+@@ -118,7 +123,7 @@
+     *) break;;
+   esac
+ done
+-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
++cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+ ])
+ 
+ 
+@@ -138,6 +143,11 @@
+ m4_defun([_LT_SETUP],
+ [AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
++AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
++
++_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
++dnl
+ _LT_DECL([], [host_alias], [0], [The host system])dnl
+ _LT_DECL([], [host], [0])dnl
+ _LT_DECL([], [host_os], [0])dnl
+@@ -160,10 +170,13 @@
+ dnl
+ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_CHECK_SHELL_FEATURES])dnl
++m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+ m4_require([_LT_CMD_RELOAD])dnl
+ m4_require([_LT_CHECK_MAGIC_METHOD])dnl
++m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+ m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+ m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
++m4_require([_LT_WITH_SYSROOT])dnl
+ 
+ _LT_CONFIG_LIBTOOL_INIT([
+ # See if we are running on zsh, and set the options which allow our
+@@ -179,7 +192,6 @@
+ _LT_CHECK_OBJDIR
+ 
+ m4_require([_LT_TAG_COMPILER])dnl
+-_LT_PROG_ECHO_BACKSLASH
+ 
+ case $host_os in
+ aix3*)
+@@ -193,23 +205,6 @@
+   ;;
+ esac
+ 
+-# Sed substitution that helps us do robust quoting.  It backslashifies
+-# metacharacters that are still active within double-quoted strings.
+-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+-
+-# Same as above, but do not quote variable references.
+-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+-
+-# Sed substitution to delay expansion of an escaped shell variable in a
+-# double_quote_subst'ed string.
+-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+-
+-# Sed substitution to delay expansion of an escaped single quote.
+-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+-
+-# Sed substitution to avoid accidental globbing in evaled expressions
+-no_glob_subst='s/\*/\\\*/g'
+-
+ # Global variables:
+ ofile=libtool
+ can_build_shared=yes
+@@ -250,6 +245,28 @@
+ ])# _LT_SETUP
+ 
+ 
++# _LT_PREPARE_SED_QUOTE_VARS
++# --------------------------
++# Define a few sed substitution that help us do robust quoting.
++m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
++[# Backslashify metacharacters that are still active within
++# double-quoted strings.
++sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
++
++# Same as above, but do not quote variable references.
++double_quote_subst='s/\([["`\\]]\)/\\\1/g'
++
++# Sed substitution to delay expansion of an escaped shell variable in a
++# double_quote_subst'ed string.
++delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
++
++# Sed substitution to delay expansion of an escaped single quote.
++delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
++
++# Sed substitution to avoid accidental globbing in evaled expressions
++no_glob_subst='s/\*/\\\*/g'
++])
++
+ # _LT_PROG_LTMAIN
+ # ---------------
+ # Note that this code is called both from `configure', and `config.status'
+@@ -408,7 +425,7 @@
+ # declaration there will have the same value as in `configure'.  VARNAME
+ # must have a single quote delimited value for this to work.
+ m4_define([_LT_CONFIG_STATUS_DECLARE],
+-[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
++[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+ 
+ 
+ # _LT_CONFIG_STATUS_DECLARATIONS
+@@ -418,7 +435,7 @@
+ # embedded single quotes properly.  In configure, this macro expands
+ # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+ #
+-#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
++#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+ m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+ [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+     [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+@@ -517,12 +534,20 @@
+ LTCFLAGS='$LTCFLAGS'
+ compiler='$compiler_DEFAULT'
+ 
++# A function that is used when there is no print builtin or printf.
++func_fallback_echo ()
++{
++  eval 'cat <<_LTECHO_EOF
++\$[]1
++_LTECHO_EOF'
++}
++
+ # Quote evaled strings.
+ for var in lt_decl_all_varnames([[ \
+ ]], lt_decl_quote_varnames); do
+-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
++    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+     *[[\\\\\\\`\\"\\\$]]*)
+-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
++      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+       ;;
+     *)
+       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+@@ -533,9 +558,9 @@
+ # Double-quote double-evaled strings.
+ for var in lt_decl_all_varnames([[ \
+ ]], lt_decl_dquote_varnames); do
+-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
++    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+     *[[\\\\\\\`\\"\\\$]]*)
+-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
++      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+       ;;
+     *)
+       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+@@ -543,16 +568,38 @@
+     esac
+ done
+ 
+-# Fix-up fallback echo if it was mangled by the above quoting rules.
+-case \$lt_ECHO in
+-*'\\\[$]0 --fallback-echo"')dnl "
+-  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+-  ;;
+-esac
+-
+ _LT_OUTPUT_LIBTOOL_INIT
+ ])
+ 
++# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
++# ------------------------------------
++# Generate a child script FILE with all initialization necessary to
++# reuse the environment learned by the parent script, and make the
++# file executable.  If COMMENT is supplied, it is inserted after the
++# `#!' sequence but before initialization text begins.  After this
++# macro, additional text can be appended to FILE to form the body of
++# the child script.  The macro ends with non-zero status if the
++# file could not be fully written (such as if the disk is full).
++m4_ifdef([AS_INIT_GENERATED],
++[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
++[m4_defun([_LT_GENERATED_FILE_INIT],
++[m4_require([AS_PREPARE])]dnl
++[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
++[lt_write_fail=0
++cat >$1 <<_ASEOF || lt_write_fail=1
++#! $SHELL
++# Generated by $as_me.
++$2
++SHELL=\${CONFIG_SHELL-$SHELL}
++export SHELL
++_ASEOF
++cat >>$1 <<\_ASEOF || lt_write_fail=1
++AS_SHELL_SANITIZE
++_AS_PREPARE
++exec AS_MESSAGE_FD>&1
++_ASEOF
++test $lt_write_fail = 0 && chmod +x $1[]dnl
++m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+ 
+ # LT_OUTPUT
+ # ---------
+@@ -562,20 +609,11 @@
+ AC_DEFUN([LT_OUTPUT],
+ [: ${CONFIG_LT=./config.lt}
+ AC_MSG_NOTICE([creating $CONFIG_LT])
+-cat >"$CONFIG_LT" <<_LTEOF
+-#! $SHELL
+-# Generated by $as_me.
+-# Run this file to recreate a libtool stub with the current configuration.
++_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
++[# Run this file to recreate a libtool stub with the current configuration.])
+ 
++cat >>"$CONFIG_LT" <<\_LTEOF
+ lt_cl_silent=false
+-SHELL=\${CONFIG_SHELL-$SHELL}
+-_LTEOF
+-
+-cat >>"$CONFIG_LT" <<\_LTEOF
+-AS_SHELL_SANITIZE
+-_AS_PREPARE
+-
+-exec AS_MESSAGE_FD>&1
+ exec AS_MESSAGE_LOG_FD>>config.log
+ {
+   echo
+@@ -601,7 +639,7 @@
+ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+ configured by $[0], generated by m4_PACKAGE_STRING.
+ 
+-Copyright (C) 2008 Free Software Foundation, Inc.
++Copyright (C) 2011 Free Software Foundation, Inc.
+ This config.lt script is free software; the Free Software Foundation
+ gives unlimited permision to copy, distribute and modify it."
+ 
+@@ -646,15 +684,13 @@
+ # appending to config.log, which fails on DOS, as config.log is still kept
+ # open by configure.  Here we exec the FD to /dev/null, effectively closing
+ # config.log, so it can be properly (re)opened and appended to by config.lt.
+-if test "$no_create" != yes; then
+-  lt_cl_success=:
+-  test "$silent" = yes &&
+-    lt_config_lt_args="$lt_config_lt_args --quiet"
+-  exec AS_MESSAGE_LOG_FD>/dev/null
+-  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+-  exec AS_MESSAGE_LOG_FD>>config.log
+-  $lt_cl_success || AS_EXIT(1)
+-fi
++lt_cl_success=:
++test "$silent" = yes &&
++  lt_config_lt_args="$lt_config_lt_args --quiet"
++exec AS_MESSAGE_LOG_FD>/dev/null
++$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
++exec AS_MESSAGE_LOG_FD>>config.log
++$lt_cl_success || AS_EXIT(1)
+ ])# LT_OUTPUT
+ 
+ 
+@@ -717,15 +753,12 @@
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
+ 
+-  _LT_PROG_XSI_SHELLFNS
++  _LT_PROG_REPLACE_SHELLFNS
+ 
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ ],
+@@ -770,6 +803,7 @@
+ m4_case([$1],
+   [C],			[_LT_LANG(C)],
+   [C++],		[_LT_LANG(CXX)],
++  [Go],			[_LT_LANG(GO)],
+   [Java],		[_LT_LANG(GCJ)],
+   [Fortran 77],		[_LT_LANG(F77)],
+   [Fortran],		[_LT_LANG(FC)],
+@@ -791,6 +825,31 @@
+ ])# _LT_LANG
+ 
+ 
++m4_ifndef([AC_PROG_GO], [
++############################################################
++# NOTE: This macro has been submitted for inclusion into   #
++#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
++#  a released version of Autoconf we should remove this    #
++#  macro and use it instead.                               #
++############################################################
++m4_defun([AC_PROG_GO],
++[AC_LANG_PUSH(Go)dnl
++AC_ARG_VAR([GOC],     [Go compiler command])dnl
++AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
++_AC_ARG_VAR_LDFLAGS()dnl
++AC_CHECK_TOOL(GOC, gccgo)
++if test -z "$GOC"; then
++  if test -n "$ac_tool_prefix"; then
++    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
++  fi
++fi
++if test -z "$GOC"; then
++  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
++fi
++])#m4_defun
++])#m4_ifndef
++
++
+ # _LT_LANG_DEFAULT_CONFIG
+ # -----------------------
+ m4_defun([_LT_LANG_DEFAULT_CONFIG],
+@@ -821,6 +880,10 @@
+        m4_ifdef([LT_PROG_GCJ],
+ 	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+ 
++AC_PROVIDE_IFELSE([AC_PROG_GO],
++  [LT_LANG(GO)],
++  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
++
+ AC_PROVIDE_IFELSE([LT_PROG_RC],
+   [LT_LANG(RC)],
+   [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+@@ -831,11 +894,13 @@
+ AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+ AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+ AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
++AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+ dnl aclocal-1.4 backwards compatibility:
+ dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+ dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+ dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+ dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
++dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+ 
+ 
+ # _LT_TAG_COMPILER
+@@ -921,7 +986,13 @@
+ 	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ 	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+         _lt_result=$?
+-	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
++	# If there is a non-empty error log, and "single_module"
++	# appears in it, assume the flag caused a linker warning
++        if test -s conftest.err && $GREP single_module conftest.err; then
++	  cat conftest.err >&AS_MESSAGE_LOG_FD
++	# Otherwise, if the output was created with a 0 exit code from
++	# the compiler, it worked.
++	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ 	  lt_cv_apple_cc_single_mod=yes
+ 	else
+ 	  cat conftest.err >&AS_MESSAGE_LOG_FD
+@@ -929,6 +1000,7 @@
+ 	rm -rf libconftest.dylib*
+ 	rm -f conftest.*
+       fi])
++
+     AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+       [lt_cv_ld_exported_symbols_list],
+       [lt_cv_ld_exported_symbols_list=no
+@@ -940,6 +1012,34 @@
+ 	[lt_cv_ld_exported_symbols_list=no])
+ 	LDFLAGS="$save_LDFLAGS"
+     ])
++
++    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
++      [lt_cv_ld_force_load=no
++      cat > conftest.c << _LT_EOF
++int forced_loaded() { return 2;}
++_LT_EOF
++      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
++      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
++      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
++      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
++      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
++      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
++      cat > conftest.c << _LT_EOF
++int main() { return 0;}
++_LT_EOF
++      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
++      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
++      _lt_result=$?
++      if test -s conftest.err && $GREP force_load conftest.err; then
++	cat conftest.err >&AS_MESSAGE_LOG_FD
++      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
++	lt_cv_ld_force_load=yes
++      else
++	cat conftest.err >&AS_MESSAGE_LOG_FD
++      fi
++        rm -f conftest.err libconftest.a conftest conftest.c
++        rm -rf conftest.dSYM
++    ])
+     case $host_os in
+     rhapsody* | darwin1.[[012]])
+       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+@@ -967,7 +1067,7 @@
+     else
+       _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+     fi
+-    if test "$DSYMUTIL" != ":"; then
++    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+       _lt_dsymutil='~$DSYMUTIL $lib || :'
+     else
+       _lt_dsymutil=
+@@ -977,8 +1077,8 @@
+ ])
+ 
+ 
+-# _LT_DARWIN_LINKER_FEATURES
+-# --------------------------
++# _LT_DARWIN_LINKER_FEATURES([TAG])
++# ---------------------------------
+ # Checks for linker and compiler features on darwin
+ m4_defun([_LT_DARWIN_LINKER_FEATURES],
+ [
+@@ -987,7 +1087,13 @@
+   _LT_TAGVAR(hardcode_direct, $1)=no
+   _LT_TAGVAR(hardcode_automatic, $1)=yes
+   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+-  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
++  if test "$lt_cv_ld_force_load" = "yes"; then
++    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
++    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
++                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
++  else
++    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
++  fi
+   _LT_TAGVAR(link_all_deplibs, $1)=yes
+   _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+   case $cc_basename in
+@@ -995,7 +1101,7 @@
+      *) _lt_dar_can_shared=$GCC ;;
+   esac
+   if test "$_lt_dar_can_shared" = "yes"; then
+-    output_verbose_link_cmd=echo
++    output_verbose_link_cmd=func_echo_all
+     _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+     _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+     _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+@@ -1011,203 +1117,142 @@
+   fi
+ ])
+ 
+-# _LT_SYS_MODULE_PATH_AIX
+-# -----------------------
++# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
++# ----------------------------------
+ # Links a minimal program and checks the executable
+ # for the system default hardcoded library path. In most cases,
+ # this is /usr/lib:/lib, but when the MPI compilers are used
+ # the location of the communication and MPI libs are included too.
+ # If we don't find anything, use the default library path according
+ # to the aix ld manual.
++# Store the results from the different compilers for each TAGNAME.
++# Allow to override them for all tags through lt_cv_aix_libpath.
+ m4_defun([_LT_SYS_MODULE_PATH_AIX],
+ [m4_require([_LT_DECL_SED])dnl
+-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi],[])
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
++  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
++  lt_aix_libpath_sed='[
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }]'
++  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
++    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi],[])
++  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
++    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
++  fi
++  ])
++  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
++fi
+ ])# _LT_SYS_MODULE_PATH_AIX
+ 
+ 
+ # _LT_SHELL_INIT(ARG)
+ # -------------------
+ m4_define([_LT_SHELL_INIT],
+-[ifdef([AC_DIVERSION_NOTICE],
+-	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+-	 [AC_DIVERT_PUSH(NOTICE)])
+-$1
+-AC_DIVERT_POP
+-])# _LT_SHELL_INIT
++[m4_divert_text([M4SH-INIT], [$1
++])])# _LT_SHELL_INIT
+ 
+ 
++
+ # _LT_PROG_ECHO_BACKSLASH
+ # -----------------------
+-# Add some code to the start of the generated configure script which
+-# will find an echo command which doesn't interpret backslashes.
++# Find how we can fake an echo command that does not interpret backslash.
++# In particular, with Autoconf 2.60 or later we add some code to the start
++# of the generated configure script which will find a shell with a builtin
++# printf (which we can use as an echo command).
+ m4_defun([_LT_PROG_ECHO_BACKSLASH],
+-[_LT_SHELL_INIT([
+-# Check that we are running under the correct shell.
+-SHELL=${CONFIG_SHELL-/bin/sh}
++[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
++ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
++ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ 
+-case X$lt_ECHO in
+-X*--fallback-echo)
+-  # Remove one level of quotation (which was required for Make).
+-  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+-  ;;
+-esac
+-
+-ECHO=${lt_ECHO-echo}
+-if test "X[$]1" = X--no-reexec; then
+-  # Discard the --no-reexec flag, and continue.
+-  shift
+-elif test "X[$]1" = X--fallback-echo; then
+-  # Avoid inline document here, it may be left over
+-  :
+-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+-  # Yippee, $ECHO works!
+-  :
++AC_MSG_CHECKING([how to print strings])
++# Test print first, because it will be a builtin if present.
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
++   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
++  ECHO='print -r --'
++elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
++  ECHO='printf %s\n'
+ else
+-  # Restart under the correct shell.
+-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
++  # Use this function as a fallback that always works.
++  func_fallback_echo ()
++  {
++    eval 'cat <<_LTECHO_EOF
++$[]1
++_LTECHO_EOF'
++  }
++  ECHO='func_fallback_echo'
+ fi
+ 
+-if test "X[$]1" = X--fallback-echo; then
+-  # used as fallback echo
+-  shift
+-  cat <<_LT_EOF
+-[$]*
+-_LT_EOF
+-  exit 0
+-fi
++# func_echo_all arg...
++# Invoke $ECHO with all args, space-separated.
++func_echo_all ()
++{
++    $ECHO "$*" 
++}
+ 
+-# The HP-UX ksh and POSIX shell print the target directory to stdout
+-# if CDPATH is set.
+-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
++case "$ECHO" in
++  printf*) AC_MSG_RESULT([printf]) ;;
++  print*) AC_MSG_RESULT([print -r]) ;;
++  *) AC_MSG_RESULT([cat]) ;;
++esac
+ 
+-if test -z "$lt_ECHO"; then
+-  if test "X${echo_test_string+set}" != Xset; then
+-    # find a string as large as possible, as long as the shell can cope with it
+-    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+-      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+-      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+-	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+-      then
+-        break
+-      fi
+-    done
+-  fi
++m4_ifdef([_AS_DETECT_SUGGESTED],
++[_AS_DETECT_SUGGESTED([
++  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
++    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
++    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
++    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
++    PATH=/empty FPATH=/empty; export PATH FPATH
++    test "X`printf %s $ECHO`" = "X$ECHO" \
++      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+ 
+-  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+-     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+-     test "X$echo_testing_string" = "X$echo_test_string"; then
+-    :
+-  else
+-    # The Solaris, AIX, and Digital Unix default echo programs unquote
+-    # backslashes.  This makes it impossible to quote backslashes using
+-    #   echo "$something" | sed 's/\\/\\\\/g'
+-    #
+-    # So, first we look for a working echo in the user's PATH.
++_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
++_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
++])# _LT_PROG_ECHO_BACKSLASH
+ 
+-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+-    for dir in $PATH /usr/ucb; do
+-      IFS="$lt_save_ifs"
+-      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+-         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+-         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+-         test "X$echo_testing_string" = "X$echo_test_string"; then
+-        ECHO="$dir/echo"
+-        break
+-      fi
+-    done
+-    IFS="$lt_save_ifs"
+ 
+-    if test "X$ECHO" = Xecho; then
+-      # We didn't find a better echo, so look for alternatives.
+-      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+-         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+-         test "X$echo_testing_string" = "X$echo_test_string"; then
+-        # This shell has a builtin print -r that does the trick.
+-        ECHO='print -r'
+-      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+-	   test "X$CONFIG_SHELL" != X/bin/ksh; then
+-        # If we have ksh, try running configure again with it.
+-        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+-        export ORIGINAL_CONFIG_SHELL
+-        CONFIG_SHELL=/bin/ksh
+-        export CONFIG_SHELL
+-        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+-      else
+-        # Try using printf.
+-        ECHO='printf %s\n'
+-        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+-	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+-	   test "X$echo_testing_string" = "X$echo_test_string"; then
+-	  # Cool, printf works
+-	  :
+-        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+-	     test "X$echo_testing_string" = 'X\t' &&
+-	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+-	     test "X$echo_testing_string" = "X$echo_test_string"; then
+-	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+-	  export CONFIG_SHELL
+-	  SHELL="$CONFIG_SHELL"
+-	  export SHELL
+-	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+-        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+-	     test "X$echo_testing_string" = 'X\t' &&
+-	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+-	     test "X$echo_testing_string" = "X$echo_test_string"; then
+-	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+-        else
+-	  # maybe with a smaller string...
+-	  prev=:
++# _LT_WITH_SYSROOT
++# ----------------
++AC_DEFUN([_LT_WITH_SYSROOT],
++[AC_MSG_CHECKING([for sysroot])
++AC_ARG_WITH([sysroot],
++[  --with-sysroot[=DIR] Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).],
++[], [with_sysroot=no])
+ 
+-	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+-	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+-	    then
+-	      break
+-	    fi
+-	    prev="$cmd"
+-	  done
++dnl lt_sysroot will always be passed unquoted.  We quote it here
++dnl in case the user passed a directory name.
++lt_sysroot=
++case ${with_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   AC_MSG_RESULT([${with_sysroot}])
++   AC_MSG_ERROR([The sysroot must be an absolute path.])
++   ;;
++esac
+ 
+-	  if test "$prev" != 'sed 50q "[$]0"'; then
+-	    echo_test_string=`eval $prev`
+-	    export echo_test_string
+-	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+-	  else
+-	    # Oops.  We lost completely, so just stick with echo.
+-	    ECHO=echo
+-	  fi
+-        fi
+-      fi
+-    fi
+-  fi
+-fi
++ AC_MSG_RESULT([${lt_sysroot:-no}])
++_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
++[dependent libraries, and in which our libraries should be installed.])])
+ 
+-# Copy echo and quote the copy suitably for passing to libtool from
+-# the Makefile, instead of quoting the original, which is used later.
+-lt_ECHO=$ECHO
+-if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+-   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+-fi
+-
+-AC_SUBST(lt_ECHO)
+-])
+-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+-_LT_DECL([], [ECHO], [1],
+-    [An echo program that does not interpret backslashes])
+-])# _LT_PROG_ECHO_BACKSLASH
+-
+-
+ # _LT_ENABLE_LOCK
+ # ---------------
+ m4_defun([_LT_ENABLE_LOCK],
+@@ -1236,7 +1281,7 @@
+   ;;
+ *-*-irix6*)
+   # Find out which ABI we are using.
+-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
++  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+   if AC_TRY_EVAL(ac_compile); then
+     if test "$lt_cv_prog_gnu_ld" = yes; then
+       case `/usr/bin/file conftest.$ac_objext` in
+@@ -1329,14 +1374,27 @@
+     CFLAGS="$SAVE_CFLAGS"
+   fi
+   ;;
+-sparc*-*solaris*)
++*-*solaris*)
+   # Find out which ABI we are using.
+   echo 'int i;' > conftest.$ac_ext
+   if AC_TRY_EVAL(ac_compile); then
+     case `/usr/bin/file conftest.o` in
+     *64-bit*)
+       case $lt_cv_prog_gnu_ld in
+-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
++      yes*)
++        case $host in
++        i?86-*-solaris*)
++          LD="${LD-ld} -m elf_x86_64"
++          ;;
++        sparc*-*-solaris*)
++          LD="${LD-ld} -m elf64_sparc"
++          ;;
++        esac
++        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
++        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
++          LD="${LD-ld}_sol2"
++        fi
++        ;;
+       *)
+ 	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ 	  LD="${LD-ld} -64"
+@@ -1354,14 +1412,47 @@
+ ])# _LT_ENABLE_LOCK
+ 
+ 
++# _LT_PROG_AR
++# -----------
++m4_defun([_LT_PROG_AR],
++[AC_CHECK_TOOLS(AR, [ar], false)
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++_LT_DECL([], [AR], [1], [The archiver])
++_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
++
++AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
++  [lt_cv_ar_at_file=no
++   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
++     [echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
++      AC_TRY_EVAL([lt_ar_try])
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	AC_TRY_EVAL([lt_ar_try])
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
++     ])
++  ])
++
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
++_LT_DECL([], [archiver_list_spec], [1],
++  [How to feed a file listing to the archiver])
++])# _LT_PROG_AR
++
++
+ # _LT_CMD_OLD_ARCHIVE
+ # -------------------
+ m4_defun([_LT_CMD_OLD_ARCHIVE],
+-[AC_CHECK_TOOL(AR, ar, false)
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
+-_LT_DECL([], [AR], [1], [The archiver])
+-_LT_DECL([], [AR_FLAGS], [1])
++[_LT_PROG_AR
+ 
+ AC_CHECK_TOOL(STRIP, strip, :)
+ test -z "$STRIP" && STRIP=:
+@@ -1380,18 +1471,27 @@
+ if test -n "$RANLIB"; then
+   case $host_os in
+   openbsd*)
+-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
++    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+     ;;
+   *)
+-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
++    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+     ;;
+   esac
+-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
++  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+ fi
++
++case $host_os in
++  darwin*)
++    lock_old_archive_extraction=yes ;;
++  *)
++    lock_old_archive_extraction=no ;;
++esac
+ _LT_DECL([], [old_postinstall_cmds], [2])
+ _LT_DECL([], [old_postuninstall_cmds], [2])
+ _LT_TAGDECL([], [old_archive_cmds], [2],
+     [Commands used to build an old-style archive])
++_LT_DECL([], [lock_old_archive_extraction], [0],
++    [Whether to use a lock for old archive extraction])
+ ])# _LT_CMD_OLD_ARCHIVE
+ 
+ 
+@@ -1416,15 +1516,15 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
++   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&AS_MESSAGE_LOG_FD
+-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
++   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
++     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+        $2=yes
+@@ -1464,7 +1564,7 @@
+      if test -s conftest.err; then
+        # Append any errors to the config.log.
+        cat conftest.err 1>&AS_MESSAGE_LOG_FD
+-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
++       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+        if diff conftest.exp conftest.er2 >/dev/null; then
+          $2=yes
+@@ -1527,6 +1627,11 @@
+     lt_cv_sys_max_cmd_len=8192;
+     ;;
+ 
++  mint*)
++    # On MiNT this can take a long time and run out of memory.
++    lt_cv_sys_max_cmd_len=8192;
++    ;;
++
+   amigaos*)
+     # On AmigaOS with pdksh, this test takes hours, literally.
+     # So we just punt and use a minimum line length of 8192.
+@@ -1552,6 +1657,11 @@
+     lt_cv_sys_max_cmd_len=196608
+     ;;
+ 
++  os2*)
++    # The test takes a long time on OS/2.
++    lt_cv_sys_max_cmd_len=8192
++    ;;
++
+   osf*)
+     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+@@ -1591,8 +1701,8 @@
+       # If test is not a shell built-in, we'll probably end up computing a
+       # maximum length that is only half of the actual maximum length, but
+       # we can't tell.
+-      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+-	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
++      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
++	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ 	      test $i != 17 # 1/2 MB should be enough
+       do
+         i=`expr $i + 1`
+@@ -1643,7 +1753,7 @@
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-[#line __oline__ "configure"
++[#line $LINENO "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -1684,7 +1794,13 @@
+ #  endif
+ #endif
+ 
+-void fnord() { int i=42;}
++/* When -fvisbility=hidden is used, assume the code has been annotated
++   correspondingly for the symbols needed.  */
++#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
++int fnord () __attribute__((visibility("default")));
++#endif
++
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -1693,7 +1809,11 @@
+   if (self)
+     {
+       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
++      else
++        {
++	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
++          else puts (dlerror ());
++	}
+       /* dlclose (self); */
+     }
+   else
+@@ -1869,16 +1989,16 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
++   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+    (eval "$lt_compile" 2>out/conftest.err)
+    ac_status=$?
+    cat out/conftest.err >&AS_MESSAGE_LOG_FD
+-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
++   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+    if (exit $ac_status) && test -s out/conftest2.$ac_objext
+    then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings
+-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
++     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+        _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+@@ -2037,6 +2157,7 @@
+ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_DECL_OBJDUMP])dnl
+ m4_require([_LT_DECL_SED])dnl
++m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+ AC_MSG_CHECKING([dynamic linker characteristics])
+ m4_if([$1],
+ 	[], [
+@@ -2045,16 +2166,23 @@
+     darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+     *) lt_awk_arg="/^libraries:/" ;;
+   esac
+-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+-  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
++  case $host_os in
++    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
++    *) lt_sed_strip_eq="s,=/,/,g" ;;
++  esac
++  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
++  case $lt_search_path_spec in
++  *\;*)
+     # if the path contains ";" then we assume it to be the separator
+     # otherwise default to the standard path separator (i.e. ":") - it is
+     # assumed that no part of a normal pathname contains ";" but that should
+     # okay in the real world where ";" in dirpaths is itself problematic.
+-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+-  else
+-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+-  fi
++    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
++    ;;
++  *)
++    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
++    ;;
++  esac
+   # Ok, now we have the path, separated by spaces, we can step through it
+   # and add multilib dir if necessary.
+   lt_tmp_lt_search_path_spec=
+@@ -2067,7 +2195,7 @@
+ 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+     fi
+   done
+-  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
++  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+ BEGIN {RS=" "; FS="/|\n";} {
+   lt_foo="";
+   lt_count=0;
+@@ -2087,7 +2215,13 @@
+   if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+   if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+ }'`
+-  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
++  # AWK program above erroneously prepends '/' to C:/dos/paths
++  # for these hosts.
++  case $host_os in
++    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
++      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
++  esac
++  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+ else
+   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ fi])
+@@ -2113,7 +2247,7 @@
+ 
+ case $host_os in
+ aix3*)
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+   shlibpath_var=LIBPATH
+ 
+@@ -2122,7 +2256,7 @@
+   ;;
+ 
+ aix[[4-9]]*)
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   need_lib_prefix=no
+   need_version=no
+   hardcode_into_libs=yes
+@@ -2175,7 +2309,7 @@
+   m68k)
+     library_names_spec='$libname.ixlibrary $libname.a'
+     # Create ${libname}_ixlibrary.a entries in /sys/libs.
+-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
++    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+     ;;
+   esac
+   ;;
+@@ -2187,7 +2321,7 @@
+   ;;
+ 
+ bsdi[[45]]*)
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   need_version=no
+   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+   soname_spec='${libname}${release}${shared_ext}$major'
+@@ -2206,8 +2340,9 @@
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -2228,36 +2363,83 @@
+     cygwin*)
+       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
++m4_if([$1], [],[
++      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+       ;;
+     mingw* | cegcc*)
+       # MinGW DLLs use traditional 'lib' prefix
+       soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+-        # It is most probably a Windows format PATH printed by
+-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+-        # path with ; separators, and with drive letters. We can handle the
+-        # drive letters (cygwin fileutils understands them), so leave them,
+-        # especially as we might pass files found there to a mingw objdump,
+-        # which wouldn't understand a cygwinified path. Ahh.
+-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+-      else
+-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+-      fi
+       ;;
+     pw32*)
+       # pw32 DLLs use 'pw' prefix rather than 'lib'
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
+     ;;
+ 
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
++    ;;
++
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -2278,7 +2460,7 @@
+   ;;
+ 
+ dgux*)
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   need_lib_prefix=no
+   need_version=no
+   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+@@ -2286,10 +2468,6 @@
+   shlibpath_var=LD_LIBRARY_PATH
+   ;;
+ 
+-freebsd1*)
+-  dynamic_linker=no
+-  ;;
+-
+ freebsd* | dragonfly*)
+   # DragonFly does not have aout.  When/if they implement a new
+   # versioning mechanism, adjust this.
+@@ -2297,7 +2475,7 @@
+     objformat=`/usr/bin/objformat`
+   else
+     case $host_os in
+-    freebsd[[123]]*) objformat=aout ;;
++    freebsd[[23]].*) objformat=aout ;;
+     *) objformat=elf ;;
+     esac
+   fi
+@@ -2315,7 +2493,7 @@
+   esac
+   shlibpath_var=LD_LIBRARY_PATH
+   case $host_os in
+-  freebsd2*)
++  freebsd2.*)
+     shlibpath_overrides_runpath=yes
+     ;;
+   freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+@@ -2335,15 +2513,29 @@
+   ;;
+ 
+ gnu*)
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   need_lib_prefix=no
+   need_version=no
+   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=no
+   hardcode_into_libs=yes
+   ;;
+ 
++haiku*)
++  version_type=linux # correct to gnu/linux during the next big refactor
++  need_lib_prefix=no
++  need_version=no
++  dynamic_linker="$host_os runtime_loader"
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LIBRARY_PATH
++  shlibpath_overrides_runpath=yes
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
++  hardcode_into_libs=yes
++  ;;
++
+ hpux9* | hpux10* | hpux11*)
+   # Give a soname corresponding to the major version so that dld.sl refuses to
+   # link against other versions.
+@@ -2386,12 +2578,14 @@
+     soname_spec='${libname}${release}${shared_ext}$major'
+     ;;
+   esac
+-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
++  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+   postinstall_cmds='chmod 555 $lib'
++  # or fails outright, so override atomically:
++  install_override_mode=555
+   ;;
+ 
+ interix[[3-9]]*)
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   need_lib_prefix=no
+   need_version=no
+   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+@@ -2407,7 +2601,7 @@
+     nonstopux*) version_type=nonstopux ;;
+     *)
+ 	if test "$lt_cv_prog_gnu_ld" = yes; then
+-		version_type=linux
++		version_type=linux # correct to gnu/linux during the next big refactor
+ 	else
+ 		version_type=irix
+ 	fi ;;
+@@ -2444,9 +2638,9 @@
+   dynamic_linker=no
+   ;;
+ 
+-# This must be Linux ELF.
+-linux* | k*bsd*-gnu)
+-  version_type=linux
++# This must be glibc/ELF.
++linux* | k*bsd*-gnu | kopensolaris*-gnu)
++  version_type=linux # correct to gnu/linux during the next big refactor
+   need_lib_prefix=no
+   need_version=no
+   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+@@ -2454,16 +2648,21 @@
+   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+   shlibpath_var=LD_LIBRARY_PATH
+   shlibpath_overrides_runpath=no
++
+   # Some binutils ld are patched to set DT_RUNPATH
+-  save_LDFLAGS=$LDFLAGS
+-  save_libdir=$libdir
+-  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+-       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+-  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+-    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+-       [shlibpath_overrides_runpath=yes])])
+-  LDFLAGS=$save_LDFLAGS
+-  libdir=$save_libdir
++  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
++    [lt_cv_shlibpath_overrides_runpath=no
++    save_LDFLAGS=$LDFLAGS
++    save_libdir=$libdir
++    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
++	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
++    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
++      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
++	 [lt_cv_shlibpath_overrides_runpath=yes])])
++    LDFLAGS=$save_LDFLAGS
++    libdir=$save_libdir
++    ])
++  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+ 
+   # This implies no fast_install, which is unacceptable.
+   # Some rework will be needed to allow for fast_install
+@@ -2472,7 +2671,7 @@
+ 
+   # Append ld.so.conf contents to the search path
+   if test -f /etc/ld.so.conf; then
+-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
++    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+   fi
+ 
+@@ -2504,7 +2703,7 @@
+   ;;
+ 
+ newsos6)
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+   shlibpath_var=LD_LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+@@ -2573,7 +2772,7 @@
+   ;;
+ 
+ solaris*)
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   need_lib_prefix=no
+   need_version=no
+   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+@@ -2598,7 +2797,7 @@
+   ;;
+ 
+ sysv4 | sysv4.3*)
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LD_LIBRARY_PATH
+@@ -2622,7 +2821,7 @@
+ 
+ sysv4*MP*)
+   if test -d /usr/nec ;then
+-    version_type=linux
++    version_type=linux # correct to gnu/linux during the next big refactor
+     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+     soname_spec='$libname${shared_ext}.$major'
+     shlibpath_var=LD_LIBRARY_PATH
+@@ -2653,7 +2852,7 @@
+ 
+ tpf*)
+   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   need_lib_prefix=no
+   need_version=no
+   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+@@ -2663,7 +2862,7 @@
+   ;;
+ 
+ uts4*)
+-  version_type=linux
++  version_type=linux # correct to gnu/linux during the next big refactor
+   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LD_LIBRARY_PATH
+@@ -2705,6 +2904,8 @@
+     The last name is the one that the linker finds with -lNAME]])
+ _LT_DECL([], [soname_spec], [1],
+     [[The coded name of the library, if different from the real name]])
++_LT_DECL([], [install_override_mode], [1],
++    [Permission mode override for installation of shared libraries])
+ _LT_DECL([], [postinstall_cmds], [2],
+     [Command to use after installation of a shared archive])
+ _LT_DECL([], [postuninstall_cmds], [2],
+@@ -2817,6 +3018,7 @@
+ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ m4_require([_LT_DECL_SED])dnl
+ m4_require([_LT_DECL_EGREP])dnl
++m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+ 
+ AC_ARG_WITH([gnu-ld],
+     [AS_HELP_STRING([--with-gnu-ld],
+@@ -2938,6 +3140,11 @@
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -2946,8 +3153,8 @@
+     fi
+     ;;
+ esac
+-_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+-_LT_DECL([], [reload_cmds], [2])dnl
++_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
++_LT_TAGDECL([], [reload_cmds], [2])dnl
+ ])# _LT_CMD_RELOAD
+ 
+ 
+@@ -2999,16 +3206,18 @@
+   # Base MSYS/MinGW do not provide the 'file' command needed by
+   # func_win32_libid shell function, so use a weaker test based on 'objdump',
+   # unless we find 'file', for example because we are cross-compiling.
+-  if ( file / ) >/dev/null 2>&1; then
++  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
++  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+ 
+-cegcc)
++cegcc*)
+   # use the weaker test based on 'objdump'. See mingw*.
+   lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+   lt_cv_file_magic_cmd='$OBJDUMP -f'
+@@ -3038,6 +3247,10 @@
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
++haiku*)
++  lt_cv_deplibs_check_method=pass_all
++  ;;
++
+ hpux10.20* | hpux11*)
+   lt_cv_file_magic_cmd=/usr/bin/file
+   case $host_cpu in
+@@ -3046,11 +3259,11 @@
+     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+     ;;
+   hppa*64*)
+-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
++    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+     ;;
+   *)
+-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
++    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+     lt_cv_file_magic_test_file=/usr/lib/libc.sl
+     ;;
+   esac
+@@ -3071,8 +3284,8 @@
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+-# This must be Linux ELF.
+-linux* | k*bsd*-gnu)
++# This must be glibc/ELF.
++linux* | k*bsd*-gnu | kopensolaris*-gnu)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+@@ -3150,6 +3363,21 @@
+   ;;
+ esac
+ ])
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -3157,7 +3385,11 @@
+ _LT_DECL([], [deplibs_check_method], [1],
+     [Method to check whether dependent libraries are shared objects])
+ _LT_DECL([], [file_magic_cmd], [1],
+-    [Command to use when deplibs_check_method == "file_magic"])
++    [Command to use when deplibs_check_method = "file_magic"])
++_LT_DECL([], [file_magic_glob], [1],
++    [How to find potential files when deplibs_check_method = "file_magic"])
++_LT_DECL([], [want_nocaseglob], [1],
++    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+ ])# _LT_CHECK_MAGIC_METHOD
+ 
+ 
+@@ -3214,7 +3446,19 @@
+   NM="$lt_cv_path_NM"
+ else
+   # Didn't find any BSD compatible name lister, look for dumpbin.
+-  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
++  if test -n "$DUMPBIN"; then :
++    # Let the user override the test.
++  else
++    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
++    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
++    *COFF*)
++      DUMPBIN="$DUMPBIN -symbols"
++      ;;
++    *)
++      DUMPBIN=:
++      ;;
++    esac
++  fi
+   AC_SUBST([DUMPBIN])
+   if test "$DUMPBIN" != ":"; then
+     NM="$DUMPBIN"
+@@ -3227,13 +3471,13 @@
+ AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+   [lt_cv_nm_interface="BSD nm"
+   echo "int some_variable = 0;" > conftest.$ac_ext
+-  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
++  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$ac_compile" 2>conftest.err)
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+-  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
++  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+-  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
++  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+   cat conftest.out >&AS_MESSAGE_LOG_FD
+   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+     lt_cv_nm_interface="MS dumpbin"
+@@ -3248,7 +3492,68 @@
+ dnl AC_DEFUN([AM_PROG_NM], [])
+ dnl AC_DEFUN([AC_PROG_NM], [])
+ 
++# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
++# --------------------------------
++# how to determine the name of the shared library
++# associated with a specific link library.
++#  -- PORTME fill in with the dynamic library characteristics
++m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
++[m4_require([_LT_DECL_EGREP])
++m4_require([_LT_DECL_OBJDUMP])
++m4_require([_LT_DECL_DLLTOOL])
++AC_CACHE_CHECK([how to associate runtime and link libraries],
++lt_cv_sharedlib_from_linklib_cmd,
++[lt_cv_sharedlib_from_linklib_cmd='unknown'
+ 
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++])
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
++    [Command to associate shared and link libraries])
++])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
++
++
++# _LT_PATH_MANIFEST_TOOL
++# ----------------------
++# locate the manifest tool
++m4_defun([_LT_PATH_MANIFEST_TOOL],
++[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
++  [lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&AS_MESSAGE_LOG_FD
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*])
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
++])# _LT_PATH_MANIFEST_TOOL
++
++
+ # LT_LIB_M
+ # --------
+ # check for math library
+@@ -3256,7 +3561,7 @@
+ [AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ LIBM=
+ case $host in
+-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
++*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+   # These system don't have libm, or don't need it
+   ;;
+ *-ncr-sysv4.3*)
+@@ -3284,7 +3589,12 @@
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ 
+ if test "$GCC" = yes; then
+-  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
++  case $cc_basename in
++  nvcc*)
++    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
++  *)
++    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
++  esac
+ 
+   _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+     lt_cv_prog_compiler_rtti_exceptions,
+@@ -3301,6 +3611,7 @@
+ m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+ [AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_PROG_AWK])dnl
+ AC_REQUIRE([LT_PATH_NM])dnl
+ AC_REQUIRE([LT_PATH_LD])dnl
+ m4_require([_LT_DECL_SED])dnl
+@@ -3368,8 +3679,8 @@
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -3393,6 +3704,7 @@
+     # which start with @ or ?.
+     lt_cv_sys_global_symbol_pipe="$AWK ['"\
+ "     {last_section=section; section=\$ 3};"\
++"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+ "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+ "     \$ 0!~/External *\|/{next};"\
+ "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+@@ -3405,6 +3717,7 @@
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -3426,7 +3739,7 @@
+   if AC_TRY_EVAL(ac_compile); then
+     # Now try to grab the symbols.
+     nlist=conftest.nm
+-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
++    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+       # Try sorting and uniquifying the output.
+       if sort "$nlist" | uniq > "$nlist"T; then
+ 	mv -f "$nlist"T "$nlist"
+@@ -3438,6 +3751,18 @@
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT@&t@_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT@&t@_DLSYM_CONST
++#else
++# define LT@&t@_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -3449,7 +3774,7 @@
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT@&t@_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -3475,15 +3800,15 @@
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ 	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ 	fi
+@@ -3516,6 +3841,13 @@
+   AC_MSG_RESULT(ok)
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
+ _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+     [Take the output of nm and produce a listing of raw symbols and C names])
+ _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+@@ -3526,6 +3858,8 @@
+ _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+     [Transform the output of nm in a C name address pair when lib prefix is needed])
++_LT_DECL([], [nm_file_list_spec], [1],
++    [Specify filename containing input files for $NM])
+ ]) # _LT_CMD_GLOBAL_SYMBOLS
+ 
+ 
+@@ -3537,7 +3871,6 @@
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ 
+-AC_MSG_CHECKING([for $compiler option to produce PIC])
+ m4_if([$1], [CXX], [
+   # C++ specific cases for pic, static, wl, etc.
+   if test "$GXX" = yes; then
+@@ -3588,6 +3921,11 @@
+       # DJGPP does not support shared libraries at all
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+       ;;
++    haiku*)
++      # PIC is the default for Haiku.
++      # The "-static" flag exists, but is broken.
++      _LT_TAGVAR(lt_prog_compiler_static, $1)=
++      ;;
+     interix[[3-9]]*)
+       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+       # Instead, we relocate shared libraries at runtime.
+@@ -3637,6 +3975,12 @@
+ 	  ;;
+ 	esac
+ 	;;
++      mingw* | cygwin* | os2* | pw32* | cegcc*)
++	# This hack is so that the source file can tell whether it is being
++	# built for inclusion in a dll (and should export symbols for example).
++	m4_if([$1], [GCJ], [],
++	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
++	;;
+       dgux*)
+ 	case $cc_basename in
+ 	  ec++*)
+@@ -3693,7 +4037,7 @@
+ 	    ;;
+ 	esac
+ 	;;
+-      linux* | k*bsd*-gnu)
++      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ 	case $cc_basename in
+ 	  KCC*)
+ 	    # KAI C++ Compiler
+@@ -3726,8 +4070,8 @@
+ 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ 	    ;;
+-	  xlc* | xlC*)
+-	    # IBM XL 8.0 on PPC
++	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
++	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+ 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+@@ -3789,7 +4133,7 @@
+ 	;;
+       solaris*)
+ 	case $cc_basename in
+-	  CC*)
++	  CC* | sunCC*)
+ 	    # Sun C++ 4.2, 5.x and Centerline C++
+ 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+@@ -3893,6 +4237,12 @@
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+       ;;
+ 
++    haiku*)
++      # PIC is the default for Haiku.
++      # The "-static" flag exists, but is broken.
++      _LT_TAGVAR(lt_prog_compiler_static, $1)=
++      ;;
++
+     hpux*)
+       # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+       # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+@@ -3935,6 +4285,15 @@
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+     esac
++
++    case $cc_basename in
++    nvcc*) # Cuda Compiler Driver 2.2
++      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
++      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
++        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
++      fi
++      ;;
++    esac
+   else
+     # PORTME Check for flag to pass linker flags through the system compiler.
+     case $host_os in
+@@ -3977,7 +4336,7 @@
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+       ;;
+ 
+-    linux* | k*bsd*-gnu)
++    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+       case $cc_basename in
+       # old Intel for x86_64 which still supported -KPIC.
+       ecc*)
+@@ -3998,7 +4357,13 @@
+ 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ 	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ 	;;
+-      pgcc* | pgf77* | pgf90* | pgf95*)
++      nagfor*)
++	# NAG Fortran compiler
++	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
++	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
++	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++	;;
++      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+ 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+@@ -4010,25 +4375,40 @@
+         # All Alpha code is PIC.
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+         ;;
+-      xl*)
+-	# IBM XL C 8.0/Fortran 10.1 on PPC
++      xl* | bgxl* | bgf* | mpixl*)
++	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ 	;;
+       *)
+ 	case `$CC -V 2>&1 | sed 5q` in
++	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
++	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
++	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
++	  ;;
++	*Sun\ F* | *Sun*Fortran*)
++	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
++	  ;;
+ 	*Sun\ C*)
+ 	  # Sun C 5.9
+ 	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ 	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ 	  ;;
+-	*Sun\ F*)
+-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++        *Intel*\ [[CF]]*Compiler*)
++	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
++	  ;;
++	*Portland\ Group*)
++	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ 	  ;;
+ 	esac
+ 	;;
+@@ -4060,7 +4440,7 @@
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+       *)
+ 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+@@ -4117,10 +4497,12 @@
+     _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+     ;;
+ esac
+-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+-	[How to pass a linker flag through the compiler])
+ 
++AC_CACHE_CHECK([for $compiler option to produce PIC],
++  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
++  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
++_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
++
+ #
+ # Check to make sure the PIC flag actually works.
+ #
+@@ -4138,6 +4520,8 @@
+ _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ 	[Additional compiler flags for building library objects])
+ 
++_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
++	[How to pass a linker flag through the compiler])
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -4158,6 +4542,7 @@
+ m4_defun([_LT_LINKER_SHLIBS],
+ [AC_REQUIRE([LT_PATH_LD])dnl
+ AC_REQUIRE([LT_PATH_NM])dnl
++m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_DECL_EGREP])dnl
+ m4_require([_LT_DECL_SED])dnl
+@@ -4166,27 +4551,37 @@
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ m4_if([$1], [CXX], [
+   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+   case $host_os in
+   aix[[4-9]]*)
+     # If we're using GNU nm, then we don't want the "-C" option.
+     # -C means demangle to AIX nm, but means don't demangle with GNU nm
++    # Also, AIX nm treats weak defined symbols like other global defined
++    # symbols, whereas GNU nm marks them as "W".
+     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
++      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+     else
+       _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+     fi
+     ;;
+   pw32*)
+     _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+-  ;;
++    ;;
+   cygwin* | mingw* | cegcc*)
+-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+-  ;;
++    case $cc_basename in
++    cl*)
++      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
++      ;;
++    *)
++      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
++      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
++      ;;
++    esac
++    ;;
+   *)
+     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+-  ;;
++    ;;
+   esac
+-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ ], [
+   runpath_var=
+   _LT_TAGVAR(allow_undefined_flag, $1)=
+@@ -4201,7 +4596,6 @@
+   _LT_TAGVAR(hardcode_direct, $1)=no
+   _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+   _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+-  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+   _LT_TAGVAR(hardcode_libdir_separator, $1)=
+   _LT_TAGVAR(hardcode_minus_L, $1)=no
+   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+@@ -4249,7 +4643,33 @@
+   esac
+ 
+   _LT_TAGVAR(ld_shlibs, $1)=yes
++
++  # On some targets, GNU ld is compatible enough with the native linker
++  # that we're better off using the native interface for both.
++  lt_use_gnu_ld_interface=no
+   if test "$with_gnu_ld" = yes; then
++    case $host_os in
++      aix*)
++	# The AIX port of GNU ld has always aspired to compatibility
++	# with the native linker.  However, as the warning in the GNU ld
++	# block says, versions before 2.19.5* couldn't really create working
++	# shared libraries, regardless of the interface used.
++	case `$LD -v 2>&1` in
++	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
++	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
++	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
++	  *)
++	    lt_use_gnu_ld_interface=yes
++	    ;;
++	esac
++	;;
++      *)
++	lt_use_gnu_ld_interface=yes
++	;;
++    esac
++  fi
++
++  if test "$lt_use_gnu_ld_interface" = yes; then
+     # If archive_cmds runs LD, not CC, wlarc should be empty
+     wlarc='${wl}'
+ 
+@@ -4267,6 +4687,7 @@
+     fi
+     supports_anon_versioning=no
+     case `$LD -v 2>&1` in
++      *GNU\ gold*) supports_anon_versioning=yes ;;
+       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+       *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -4282,11 +4703,12 @@
+ 	_LT_TAGVAR(ld_shlibs, $1)=no
+ 	cat <<_LT_EOF 1>&2
+ 
+-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
++*** Warning: the GNU linker, at least up to release 2.19, is reported
+ *** to be unable to reliably create shared libraries on AIX.
+ *** Therefore, libtool is disabling shared libraries support.  If you
+-*** really care for shared libraries, you may want to modify your PATH
+-*** so that a non-GNU linker is found, and then restart.
++*** really care for shared libraries, you may want to install binutils
++*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
++*** You will then need to restart the configuration process.
+ 
+ _LT_EOF
+       fi
+@@ -4322,10 +4744,12 @@
+       # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+       # as there is no search path for DLLs.
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       _LT_TAGVAR(always_export_symbols, $1)=no
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
++      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
++      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -4343,6 +4767,11 @@
+       fi
+       ;;
+ 
++    haiku*)
++      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++      _LT_TAGVAR(link_all_deplibs, $1)=yes
++      ;;
++
+     interix[[3-9]]*)
+       _LT_TAGVAR(hardcode_direct, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+@@ -4358,7 +4787,7 @@
+       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       ;;
+ 
+-    gnu* | linux* | tpf* | k*bsd*-gnu)
++    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+       tmp_diet=no
+       if test "$host_os" = linux-dietlibc; then
+ 	case $cc_basename in
+@@ -4368,15 +4797,16 @@
+       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ 	 && test "$tmp_diet" = no
+       then
+-	tmp_addflag=
++	tmp_addflag=' $pic_flag'
+ 	tmp_sharedflag='-shared'
+ 	case $cc_basename,$host_cpu in
+         pgcc*)				# Portland Group C compiler
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
++	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ 	  tmp_addflag=' $pic_flag'
+ 	  ;;
+-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
++	pgf77* | pgf90* | pgf95* | pgfortran*)
++					# Portland Group f77 and f90 compilers
++	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ 	  tmp_addflag=' $pic_flag -Mnomain' ;;
+ 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+ 	  tmp_addflag=' -i_dynamic' ;;
+@@ -4387,13 +4817,17 @@
+ 	lf95*)				# Lahey Fortran 8.1
+ 	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ 	  tmp_sharedflag='--shared' ;;
+-	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
++	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ 	  tmp_sharedflag='-qmkshrobj'
+ 	  tmp_addflag= ;;
++	nvcc*)	# Cuda Compiler Driver 2.2
++	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
++	  _LT_TAGVAR(compiler_needs_object, $1)=yes
++	  ;;
+ 	esac
+ 	case `$CC -V 2>&1 | sed 5q` in
+ 	*Sun\ C*)			# Sun C 5.9
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
++	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+ 	  tmp_sharedflag='-G' ;;
+ 	*Sun\ F*)			# Sun Fortran 8.3
+@@ -4409,17 +4843,16 @@
+         fi
+ 
+ 	case $cc_basename in
+-	xlf*)
++	xlf* | bgf* | bgxlf* | mpixlf*)
+ 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+-	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -4433,8 +4866,8 @@
+ 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -4452,8 +4885,8 @@
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	_LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+@@ -4499,8 +4932,8 @@
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	_LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+@@ -4540,8 +4973,10 @@
+       else
+ 	# If we're using GNU nm, then we don't want the "-C" option.
+ 	# -C means demangle to AIX nm, but means don't demangle with GNU nm
++	# Also, AIX nm treats weak defined symbols like other global
++	# defined symbols, whereas GNU nm marks them as "W".
+ 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
++	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ 	else
+ 	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ 	fi
+@@ -4628,9 +5063,9 @@
+ 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        _LT_SYS_MODULE_PATH_AIX
++        _LT_SYS_MODULE_PATH_AIX([$1])
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
++        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+ 	if test "$host_cpu" = ia64; then
+ 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+@@ -4639,14 +5074,19 @@
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 _LT_SYS_MODULE_PATH_AIX
++	 _LT_SYS_MODULE_PATH_AIX([$1])
+ 	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+ 	  # -berok will link without error, but may produce a broken library.
+ 	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ 	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+-	  # Exported symbols can be pulled into shared objects from archives
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
++	  if test "$with_gnu_ld" = yes; then
++	    # We only use this code for GNU lds that support --whole-archive.
++	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
++	  else
++	    # Exported symbols can be pulled into shared objects from archives
++	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
++	  fi
+ 	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ 	  # This is similar to how AIX traditionally builds its shared libraries.
+ 	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+@@ -4678,20 +5118,64 @@
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+-      # FIXME: Should let the user specify the lib program.
+-      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	_LT_TAGVAR(always_export_symbols, $1)=yes
++	_LT_TAGVAR(file_list_spec, $1)='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
++	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
++	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++	# FIXME: Should let the user specify the lib program.
++	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -4704,10 +5188,6 @@
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       ;;
+ 
+-    freebsd1*)
+-      _LT_TAGVAR(ld_shlibs, $1)=no
+-      ;;
+-
+     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+     # support.  Future versions do this automatically, but an explicit c++rt0.o
+     # does not break anything, and helps significantly (at the cost of a little
+@@ -4720,7 +5200,7 @@
+       ;;
+ 
+     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+-    freebsd2*)
++    freebsd2.*)
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_minus_L, $1)=yes
+@@ -4729,7 +5209,7 @@
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+@@ -4737,7 +5217,7 @@
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -4752,14 +5232,13 @@
+       ;;
+ 
+     hpux10*)
+-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+       if test "$with_gnu_ld" = no; then
+ 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+-	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ 	_LT_TAGVAR(hardcode_direct, $1)=yes
+ 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+@@ -4771,16 +5250,16 @@
+       ;;
+ 
+     hpux11*)
+-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
++      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ 	case $host_cpu in
+ 	hppa*64*)
+ 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -4792,7 +5271,14 @@
+ 	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	m4_if($1, [], [
++	  # Older versions of the 11.00 compiler do not understand -b yet
++	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
++	  _LT_LINKER_OPTION([if $CC understands -b],
++	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
++	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
++	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
++	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ 	  ;;
+ 	esac
+       fi
+@@ -4820,19 +5306,34 @@
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        AC_LINK_IFELSE(int foo(void) {},
+-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-        )
+-        LDFLAGS="$save_LDFLAGS"
++	# This should be the same for all languages, so no per-tag cache variable.
++	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
++	  [lt_cv_irix_exported_symbol],
++	  [save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   AC_LINK_IFELSE(
++	     [AC_LANG_SOURCE(
++	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
++			      [C++], [[int foo (void) { return 0; }]],
++			      [Fortran 77], [[
++      subroutine foo
++      end]],
++			      [Fortran], [[
++      subroutine foo
++      end]])])],
++	      [lt_cv_irix_exported_symbol=yes],
++	      [lt_cv_irix_exported_symbol=no])
++           LDFLAGS="$save_LDFLAGS"])
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
++	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+       fi
+       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+@@ -4894,17 +5395,17 @@
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+       _LT_TAGVAR(hardcode_minus_L, $1)=yes
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
++      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+       _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+       ;;
+ 
+     osf3*)
+       if test "$GCC" = yes; then
+ 	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       else
+ 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       fi
+       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+@@ -4914,13 +5415,13 @@
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+       else
+ 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
++	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+ 
+ 	# Both c and cxx compiler support -rpath directly
+ 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+@@ -4933,9 +5434,9 @@
+       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -5111,36 +5612,38 @@
+       # Test whether the compiler implicitly links with -lc since on some
+       # systems, -lgcc has to come before -lc. If gcc already passes -lc
+       # to ld, don't add -lc before -lgcc.
+-      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+-      $RM conftest*
+-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
++      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
++	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
++	[$RM conftest*
++	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ 
+-      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+-        soname=conftest
+-        lib=conftest
+-        libobjs=conftest.$ac_objext
+-        deplibs=
+-        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+-	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+-        compiler_flags=-v
+-        linker_flags=-v
+-        verstring=
+-        output_objdir=.
+-        libname=conftest
+-        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+-        _LT_TAGVAR(allow_undefined_flag, $1)=
+-        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+-        then
+-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-        else
+-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+-        fi
+-        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+-      else
+-        cat conftest.err 1>&5
+-      fi
+-      $RM conftest*
+-      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
++	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
++	  soname=conftest
++	  lib=conftest
++	  libobjs=conftest.$ac_objext
++	  deplibs=
++	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
++	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
++	  compiler_flags=-v
++	  linker_flags=-v
++	  verstring=
++	  output_objdir=.
++	  libname=conftest
++	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
++	  _LT_TAGVAR(allow_undefined_flag, $1)=
++	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
++	  then
++	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
++	  else
++	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
++	  fi
++	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
++	else
++	  cat conftest.err 1>&5
++	fi
++	$RM conftest*
++	])
++      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+       ;;
+     esac
+   fi
+@@ -5177,9 +5680,6 @@
+ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+     [Flag to hardcode $libdir into a binary during linking.
+     This must work even if $libdir does not exist])
+-_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+-    [[If ld is used when linking, flag to hardcode $libdir into a binary
+-    during linking.  This must work even if $libdir does not exist]])
+ _LT_TAGDECL([], [hardcode_libdir_separator], [1],
+     [Whether we need a single "-rpath" flag with a separated argument])
+ _LT_TAGDECL([], [hardcode_direct], [0],
+@@ -5205,8 +5705,6 @@
+     to runtime path list])
+ _LT_TAGDECL([], [link_all_deplibs], [0],
+     [Whether libtool must link a program against all its dependency libraries])
+-_LT_TAGDECL([], [fix_srcfile_path], [1],
+-    [Fix the shell variable $srcfile for the compiler])
+ _LT_TAGDECL([], [always_export_symbols], [0],
+     [Set to "yes" if exported symbols are required])
+ _LT_TAGDECL([], [export_symbols_cmds], [2],
+@@ -5217,6 +5715,8 @@
+     [Symbols that must always be exported])
+ _LT_TAGDECL([], [prelink_cmds], [2],
+     [Commands necessary for linking programs (against libraries) with templates])
++_LT_TAGDECL([], [postlink_cmds], [2],
++    [Commands necessary for finishing linking programs])
+ _LT_TAGDECL([], [file_list_spec], [1],
+     [Specify filename containing input files])
+ dnl FIXME: Not yet implemented
+@@ -5310,14 +5810,15 @@
+ ])# _LT_LANG_C_CONFIG
+ 
+ 
+-# _LT_PROG_CXX
+-# ------------
+-# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+-# compiler, we have our own version here.
+-m4_defun([_LT_PROG_CXX],
+-[
+-pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+-AC_PROG_CXX
++# _LT_LANG_CXX_CONFIG([TAG])
++# --------------------------
++# Ensure that the configuration variables for a C++ compiler are suitably
++# defined.  These variables are subsequently used by _LT_CONFIG to write
++# the compiler configuration to `libtool'.
++m4_defun([_LT_LANG_CXX_CONFIG],
++[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
++m4_require([_LT_DECL_EGREP])dnl
++m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+     ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+     (test "X$CXX" != "Xg++"))) ; then
+@@ -5325,23 +5826,7 @@
+ else
+   _lt_caught_CXX_error=yes
+ fi
+-popdef([AC_MSG_ERROR])
+-])# _LT_PROG_CXX
+ 
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([_LT_PROG_CXX], [])
+-
+-
+-# _LT_LANG_CXX_CONFIG([TAG])
+-# --------------------------
+-# Ensure that the configuration variables for a C++ compiler are suitably
+-# defined.  These variables are subsequently used by _LT_CONFIG to write
+-# the compiler configuration to `libtool'.
+-m4_defun([_LT_LANG_CXX_CONFIG],
+-[AC_REQUIRE([_LT_PROG_CXX])dnl
+-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-m4_require([_LT_DECL_EGREP])dnl
+-
+ AC_LANG_PUSH(C++)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+@@ -5352,7 +5837,6 @@
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+@@ -5362,6 +5846,8 @@
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
++_LT_TAGVAR(reload_flag, $1)=$reload_flag
++_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+ _LT_TAGVAR(no_undefined_flag, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+@@ -5393,6 +5879,7 @@
+ 
+   # Allow CC to be a program name with arguments.
+   lt_save_CC=$CC
++  lt_save_CFLAGS=$CFLAGS
+   lt_save_LD=$LD
+   lt_save_GCC=$GCC
+   GCC=$GXX
+@@ -5410,6 +5897,7 @@
+   fi
+   test -z "${LDCXX+set}" || LD=$LDCXX
+   CC=${CXX-"c++"}
++  CFLAGS=$CXXFLAGS
+   compiler=$CC
+   _LT_TAGVAR(compiler, $1)=$CC
+   _LT_CC_BASENAME([$compiler])
+@@ -5431,8 +5919,8 @@
+       # Check if GNU C++ uses GNU ld as the underlying linker, since the
+       # archiving commands below assume that GNU ld is being used.
+       if test "$with_gnu_ld" = yes; then
+-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
++        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ 
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+@@ -5464,7 +5952,7 @@
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
++      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ 
+     else
+       GXX=no
+@@ -5573,10 +6061,10 @@
+           _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+           # Determine the default libpath from the value encoded in an empty
+           # executable.
+-          _LT_SYS_MODULE_PATH_AIX
++          _LT_SYS_MODULE_PATH_AIX([$1])
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 
+-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
++          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+         else
+           if test "$host_cpu" = ia64; then
+ 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+@@ -5585,14 +6073,19 @@
+           else
+ 	    # Determine the default libpath from the value encoded in an
+ 	    # empty executable.
+-	    _LT_SYS_MODULE_PATH_AIX
++	    _LT_SYS_MODULE_PATH_AIX([$1])
+ 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	    # Warning - without using the other run time loading flags,
+ 	    # -berok will link without error, but may produce a broken library.
+ 	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ 	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+-	    # Exported symbols can be pulled into shared objects from archives
+-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
++	    if test "$with_gnu_ld" = yes; then
++	      # We only use this code for GNU lds that support --whole-archive.
++	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
++	    else
++	      # Exported symbols can be pulled into shared objects from archives
++	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
++	    fi
+ 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ 	    # This is similar to how AIX traditionally builds its shared
+ 	    # libraries.
+@@ -5622,28 +6115,75 @@
+         ;;
+ 
+       cygwin* | mingw* | pw32* | cegcc*)
+-        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+-        # as there is no search path for DLLs.
+-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-        _LT_TAGVAR(always_export_symbols, $1)=no
+-        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++	case $GXX,$cc_basename in
++	,cl* | no,cl*)
++	  # Native MSVC
++	  # hardcode_libdir_flag_spec is actually meaningless, as there is
++	  # no search path for DLLs.
++	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	  _LT_TAGVAR(always_export_symbols, $1)=yes
++	  _LT_TAGVAR(file_list_spec, $1)='@'
++	  # Tell ltmain to make .lib files, not .a files.
++	  libext=lib
++	  # Tell ltmain to make .dll files, not .so files.
++	  shrext_cmds=".dll"
++	  # FIXME: Setting linknames here is a bad hack.
++	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	    else
++	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	    fi~
++	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	    linknames='
++	  # The linker will not automatically build a static lib if we build a DLL.
++	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++	  # Don't use ranlib
++	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
++	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
++	    lt_tool_outputfile="@TOOL_OUTPUT@"~
++	    case $lt_outputfile in
++	      *.exe|*.EXE) ;;
++	      *)
++		lt_outputfile="$lt_outputfile.exe"
++		lt_tool_outputfile="$lt_tool_outputfile.exe"
++		;;
++	    esac~
++	    func_to_tool_file "$lt_outputfile"~
++	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	      $RM "$lt_outputfile.manifest";
++	    fi'
++	  ;;
++	*)
++	  # g++
++	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
++	  # as there is no search path for DLLs.
++	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
++	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	  _LT_TAGVAR(always_export_symbols, $1)=no
++	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ 
+-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+-          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-          # If the export-symbols file already is a .def file (1st line
+-          # is EXPORTS), use it as is; otherwise, prepend...
+-          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+-	    cp $export_symbols $output_objdir/$soname.def;
+-          else
+-	    echo EXPORTS > $output_objdir/$soname.def;
+-	    cat $export_symbols >> $output_objdir/$soname.def;
+-          fi~
+-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-        else
+-          _LT_TAGVAR(ld_shlibs, $1)=no
+-        fi
+-        ;;
++	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
++	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	    # If the export-symbols file already is a .def file (1st line
++	    # is EXPORTS), use it as is; otherwise, prepend...
++	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	      cp $export_symbols $output_objdir/$soname.def;
++	    else
++	      echo EXPORTS > $output_objdir/$soname.def;
++	      cat $export_symbols >> $output_objdir/$soname.def;
++	    fi~
++	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	  else
++	    _LT_TAGVAR(ld_shlibs, $1)=no
++	  fi
++	  ;;
++	esac
++	;;
+       darwin* | rhapsody*)
+         _LT_DARWIN_LINKER_FEATURES($1)
+ 	;;
+@@ -5666,7 +6206,7 @@
+         esac
+         ;;
+ 
+-      freebsd[[12]]*)
++      freebsd2.*)
+         # C++ shared libraries reported to be fairly broken before
+ 	# switch to ELF
+         _LT_TAGVAR(ld_shlibs, $1)=no
+@@ -5685,6 +6225,11 @@
+       gnu*)
+         ;;
+ 
++      haiku*)
++        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++        _LT_TAGVAR(link_all_deplibs, $1)=yes
++        ;;
++
+       hpux9*)
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+@@ -5709,11 +6254,11 @@
+             # explicitly linking system object files so we need to strip them
+             # from the output so that they don't get included in the library
+             # dependencies.
+-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
++            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+             ;;
+           *)
+             if test "$GXX" = yes; then
+-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+             else
+               # FIXME: insert proper C++ library support
+               _LT_TAGVAR(ld_shlibs, $1)=no
+@@ -5774,7 +6319,7 @@
+ 	    # explicitly linking system object files so we need to strip them
+ 	    # from the output so that they don't get included in the library
+ 	    # dependencies.
+-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
++	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ 	    ;;
+           *)
+ 	    if test "$GXX" = yes; then
+@@ -5784,10 +6329,10 @@
+ 	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	          ia64*)
+-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	          *)
+-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	        esac
+ 	      fi
+@@ -5817,7 +6362,7 @@
+         case $cc_basename in
+           CC*)
+ 	    # SGI C++
+-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
++	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 
+ 	    # Archives containing C++ object files must be created using
+ 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+@@ -5828,9 +6373,9 @@
+           *)
+ 	    if test "$GXX" = yes; then
+ 	      if test "$with_gnu_ld" = no; then
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	      else
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ 	      fi
+ 	    fi
+ 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+@@ -5841,7 +6386,7 @@
+         _LT_TAGVAR(inherit_rpath, $1)=yes
+         ;;
+ 
+-      linux* | k*bsd*-gnu)
++      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+         case $cc_basename in
+           KCC*)
+ 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+@@ -5859,7 +6404,7 @@
+ 	    # explicitly linking system object files so we need to strip them
+ 	    # from the output so that they don't get included in the library
+ 	    # dependencies.
+-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
++	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ 
+ 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+@@ -5896,26 +6441,26 @@
+           pgCC* | pgcpp*)
+             # Portland Group C++ compiler
+ 	    case `$CC -V` in
+-	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
++	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
++		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
++		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ 		$RANLIB $oldlib'
+ 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
++		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
++		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ 	      ;;
+-	    *) # Version 6 will use weak symbols
++	    *) # Version 6 and above use weak symbols
+ 	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ 	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ 	      ;;
+@@ -5923,7 +6468,7 @@
+ 
+ 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
++	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+             ;;
+ 	  cxx*)
+ 	    # Compaq C++
+@@ -5942,9 +6487,9 @@
+ 	    # explicitly linking system object files so we need to strip them
+ 	    # from the output so that they don't get included in the library
+ 	    # dependencies.
+-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
++	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ 	    ;;
+-	  xl*)
++	  xl* | mpixl* | bgxl*)
+ 	    # IBM XL 8.0 on PPC, with GNU ld
+ 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+@@ -5964,13 +6509,13 @@
+ 	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
++	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ 	      _LT_TAGVAR(compiler_needs_object, $1)=yes
+ 
+ 	      # Not sure whether something based on
+ 	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ 	      # would be better.
+-	      output_verbose_link_cmd='echo'
++	      output_verbose_link_cmd='func_echo_all'
+ 
+ 	      # Archives containing C++ object files must be created using
+ 	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+@@ -6039,7 +6584,7 @@
+ 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ 	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ 	  fi
+-	  output_verbose_link_cmd=echo
++	  output_verbose_link_cmd=func_echo_all
+ 	else
+ 	  _LT_TAGVAR(ld_shlibs, $1)=no
+ 	fi
+@@ -6074,15 +6619,15 @@
+ 	    case $host in
+ 	      osf3*)
+ 	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ 		;;
+ 	      *)
+ 	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ 	          echo "-hidden">> $lib.exp~
+-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
++	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ 	          $RM $lib.exp'
+ 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ 		;;
+@@ -6098,17 +6643,17 @@
+ 	    # explicitly linking system object files so we need to strip them
+ 	    # from the output so that they don't get included in the library
+ 	    # dependencies.
+-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
++	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ 	    ;;
+ 	  *)
+ 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ 	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ 	      case $host in
+ 	        osf3*)
+-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 		  ;;
+ 	        *)
+-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 		  ;;
+ 	      esac
+ 
+@@ -6118,7 +6663,7 @@
+ 	      # Commands to make compiler produce verbose output that lists
+ 	      # what "hidden" libraries, object files and flags are used when
+ 	      # linking a shared library.
+-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
++	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ 
+ 	    else
+ 	      # FIXME: insert proper C++ library support
+@@ -6154,7 +6699,7 @@
+ 
+       solaris*)
+         case $cc_basename in
+-          CC*)
++          CC* | sunCC*)
+ 	    # Sun C++ 4.2, 5.x and Centerline C++
+             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+@@ -6175,7 +6720,7 @@
+ 	    esac
+ 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+ 
+-	    output_verbose_link_cmd='echo'
++	    output_verbose_link_cmd='func_echo_all'
+ 
+ 	    # Archives containing C++ object files must be created using
+ 	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+@@ -6195,14 +6740,14 @@
+ 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ 	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
++		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+ 
+ 	        # Commands to make compiler produce verbose output that lists
+ 	        # what "hidden" libraries, object files and flags are used when
+ 	        # linking a shared library.
+-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
++	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ 	      else
+ 	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ 	        # platform.
+@@ -6213,7 +6758,7 @@
+ 	        # Commands to make compiler produce verbose output that lists
+ 	        # what "hidden" libraries, object files and flags are used when
+ 	        # linking a shared library.
+-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
++	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ 	      fi
+ 
+ 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+@@ -6267,6 +6812,10 @@
+           CC*)
+ 	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
++	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
++	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
++	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
++	      '"$_LT_TAGVAR(reload_cmds, $1)"
+ 	    ;;
+ 	  *)
+ 	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+@@ -6322,6 +6871,7 @@
+   fi # test -n "$compiler"
+ 
+   CC=$lt_save_CC
++  CFLAGS=$lt_save_CFLAGS
+   LDCXX=$LD
+   LD=$lt_save_LD
+   GCC=$lt_save_GCC
+@@ -6336,6 +6886,29 @@
+ ])# _LT_LANG_CXX_CONFIG
+ 
+ 
++# _LT_FUNC_STRIPNAME_CNF
++# ----------------------
++# func_stripname_cnf prefix suffix name
++# strip PREFIX and SUFFIX off of NAME.
++# PREFIX and SUFFIX must not contain globbing or regex special
++# characters, hashes, percent signs, but SUFFIX may contain a leading
++# dot (in which case that matches only a dot).
++#
++# This function is identical to the (non-XSI) version of func_stripname,
++# except this one can be used by m4 code that may be executed by configure,
++# rather than the libtool script.
++m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
++AC_REQUIRE([_LT_DECL_SED])
++AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
++func_stripname_cnf ()
++{
++  case ${2} in
++  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++  esac
++} # func_stripname_cnf
++])# _LT_FUNC_STRIPNAME_CNF
++
+ # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+ # ---------------------------------
+ # Figure out "hidden" library dependencies from verbose
+@@ -6344,6 +6917,7 @@
+ # objects, libraries and library flags.
+ m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+ [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
++AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+ # Dependencies to place before and after the object being linked:
+ _LT_TAGVAR(predep_objects, $1)=
+ _LT_TAGVAR(postdep_objects, $1)=
+@@ -6393,7 +6967,20 @@
+   }
+ };
+ _LT_EOF
++], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
++package foo
++func foo() {
++}
++_LT_EOF
+ ])
++
++_lt_libdeps_save_CFLAGS=$CFLAGS
++case "$CC $CFLAGS " in #(
++*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
++*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
++*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
++esac
++
+ dnl Parse the compiler output and extract the necessary
+ dnl objects, libraries and library flags.
+ if AC_TRY_EVAL(ac_compile); then
+@@ -6405,7 +6992,7 @@
+   pre_test_object_deps_done=no
+ 
+   for p in `eval "$output_verbose_link_cmd"`; do
+-    case $p in
++    case ${prev}${p} in
+ 
+     -L* | -R* | -l*)
+        # Some compilers place space between "-{L,R}" and the path.
+@@ -6414,13 +7001,22 @@
+           test $p = "-R"; then
+ 	 prev=$p
+ 	 continue
+-       else
+-	 prev=
+        fi
+ 
++       # Expand the sysroot to ease extracting the directories later.
++       if test -z "$prev"; then
++         case $p in
++         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
++         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
++         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
++         esac
++       fi
++       case $p in
++       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
++       esac
+        if test "$pre_test_object_deps_done" = no; then
+-	 case $p in
+-	 -L* | -R*)
++	 case ${prev} in
++	 -L | -R)
+ 	   # Internal compiler library paths should come after those
+ 	   # provided the user.  The postdeps already come after the
+ 	   # user supplied libs so there is no need to process them.
+@@ -6440,8 +7036,10 @@
+ 	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ 	 fi
+        fi
++       prev=
+        ;;
+ 
++    *.lto.$objext) ;; # Ignore GCC LTO objects
+     *.$objext)
+        # This assumes that the test object file only shows up
+        # once in the compiler output.
+@@ -6477,6 +7075,7 @@
+ fi
+ 
+ $RM -f confest.$objext
++CFLAGS=$_lt_libdeps_save_CFLAGS
+ 
+ # PORTME: override above test on systems where it is broken
+ m4_if([$1], [CXX],
+@@ -6513,7 +7112,7 @@
+ 
+ solaris*)
+   case $cc_basename in
+-  CC*)
++  CC* | sunCC*)
+     # The more standards-conforming stlport4 library is
+     # incompatible with the Cstd library. Avoid specifying
+     # it if it's in CXXFLAGS. Ignore libCrun as
+@@ -6557,32 +7156,16 @@
+ ])# _LT_SYS_HIDDEN_LIBDEPS
+ 
+ 
+-# _LT_PROG_F77
+-# ------------
+-# Since AC_PROG_F77 is broken, in that it returns the empty string
+-# if there is no fortran compiler, we have our own version here.
+-m4_defun([_LT_PROG_F77],
+-[
+-pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+-AC_PROG_F77
+-if test -z "$F77" || test "X$F77" = "Xno"; then
+-  _lt_disable_F77=yes
+-fi
+-popdef([AC_MSG_ERROR])
+-])# _LT_PROG_F77
+-
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([_LT_PROG_F77], [])
+-
+-
+ # _LT_LANG_F77_CONFIG([TAG])
+ # --------------------------
+ # Ensure that the configuration variables for a Fortran 77 compiler are
+ # suitably defined.  These variables are subsequently used by _LT_CONFIG
+ # to write the compiler configuration to `libtool'.
+ m4_defun([_LT_LANG_F77_CONFIG],
+-[AC_REQUIRE([_LT_PROG_F77])dnl
+-AC_LANG_PUSH(Fortran 77)
++[AC_LANG_PUSH(Fortran 77)
++if test -z "$F77" || test "X$F77" = "Xno"; then
++  _lt_disable_F77=yes
++fi
+ 
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+@@ -6592,7 +7175,6 @@
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+@@ -6601,6 +7183,8 @@
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
++_LT_TAGVAR(reload_flag, $1)=$reload_flag
++_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+ _LT_TAGVAR(no_undefined_flag, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+@@ -6640,7 +7224,9 @@
+   # Allow CC to be a program name with arguments.
+   lt_save_CC="$CC"
+   lt_save_GCC=$GCC
++  lt_save_CFLAGS=$CFLAGS
+   CC=${F77-"f77"}
++  CFLAGS=$FFLAGS
+   compiler=$CC
+   _LT_TAGVAR(compiler, $1)=$CC
+   _LT_CC_BASENAME([$compiler])
+@@ -6694,39 +7280,25 @@
+ 
+   GCC=$lt_save_GCC
+   CC="$lt_save_CC"
++  CFLAGS="$lt_save_CFLAGS"
+ fi # test "$_lt_disable_F77" != yes
+ 
+ AC_LANG_POP
+ ])# _LT_LANG_F77_CONFIG
+ 
+ 
+-# _LT_PROG_FC
+-# -----------
+-# Since AC_PROG_FC is broken, in that it returns the empty string
+-# if there is no fortran compiler, we have our own version here.
+-m4_defun([_LT_PROG_FC],
+-[
+-pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+-AC_PROG_FC
+-if test -z "$FC" || test "X$FC" = "Xno"; then
+-  _lt_disable_FC=yes
+-fi
+-popdef([AC_MSG_ERROR])
+-])# _LT_PROG_FC
+-
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([_LT_PROG_FC], [])
+-
+-
+ # _LT_LANG_FC_CONFIG([TAG])
+ # -------------------------
+ # Ensure that the configuration variables for a Fortran compiler are
+ # suitably defined.  These variables are subsequently used by _LT_CONFIG
+ # to write the compiler configuration to `libtool'.
+ m4_defun([_LT_LANG_FC_CONFIG],
+-[AC_REQUIRE([_LT_PROG_FC])dnl
+-AC_LANG_PUSH(Fortran)
++[AC_LANG_PUSH(Fortran)
+ 
++if test -z "$FC" || test "X$FC" = "Xno"; then
++  _lt_disable_FC=yes
++fi
++
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+@@ -6735,7 +7307,6 @@
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+@@ -6744,6 +7315,8 @@
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
++_LT_TAGVAR(reload_flag, $1)=$reload_flag
++_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+ _LT_TAGVAR(no_undefined_flag, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+@@ -6783,7 +7356,9 @@
+   # Allow CC to be a program name with arguments.
+   lt_save_CC="$CC"
+   lt_save_GCC=$GCC
++  lt_save_CFLAGS=$CFLAGS
+   CC=${FC-"f95"}
++  CFLAGS=$FCFLAGS
+   compiler=$CC
+   GCC=$ac_cv_fc_compiler_gnu
+ 
+@@ -6839,7 +7414,8 @@
+   fi # test -n "$compiler"
+ 
+   GCC=$lt_save_GCC
+-  CC="$lt_save_CC"
++  CC=$lt_save_CC
++  CFLAGS=$lt_save_CFLAGS
+ fi # test "$_lt_disable_FC" != yes
+ 
+ AC_LANG_POP
+@@ -6876,10 +7452,12 @@
+ _LT_LINKER_BOILERPLATE
+ 
+ # Allow CC to be a program name with arguments.
+-lt_save_CC="$CC"
++lt_save_CC=$CC
++lt_save_CFLAGS=$CFLAGS
+ lt_save_GCC=$GCC
+ GCC=yes
+ CC=${GCJ-"gcj"}
++CFLAGS=$GCJFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_TAGVAR(LD, $1)="$LD"
+@@ -6889,6 +7467,8 @@
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ 
+ _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
++_LT_TAGVAR(reload_flag, $1)=$reload_flag
++_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+ 
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+@@ -6908,10 +7488,82 @@
+ AC_LANG_RESTORE
+ 
+ GCC=$lt_save_GCC
+-CC="$lt_save_CC"
++CC=$lt_save_CC
++CFLAGS=$lt_save_CFLAGS
+ ])# _LT_LANG_GCJ_CONFIG
+ 
+ 
++# _LT_LANG_GO_CONFIG([TAG])
++# --------------------------
++# Ensure that the configuration variables for the GNU Go compiler
++# are suitably defined.  These variables are subsequently used by _LT_CONFIG
++# to write the compiler configuration to `libtool'.
++m4_defun([_LT_LANG_GO_CONFIG],
++[AC_REQUIRE([LT_PROG_GO])dnl
++AC_LANG_SAVE
++
++# Source file extension for Go test sources.
++ac_ext=go
++
++# Object file extension for compiled Go test sources.
++objext=o
++_LT_TAGVAR(objext, $1)=$objext
++
++# Code to be used in simple compile tests
++lt_simple_compile_test_code="package main; func main() { }"
++
++# Code to be used in simple link tests
++lt_simple_link_test_code='package main; func main() { }'
++
++# ltmain only uses $CC for tagged configurations so make sure $CC is set.
++_LT_TAG_COMPILER
++
++# save warnings/boilerplate of simple test code
++_LT_COMPILER_BOILERPLATE
++_LT_LINKER_BOILERPLATE
++
++# Allow CC to be a program name with arguments.
++lt_save_CC=$CC
++lt_save_CFLAGS=$CFLAGS
++lt_save_GCC=$GCC
++GCC=yes
++CC=${GOC-"gccgo"}
++CFLAGS=$GOFLAGS
++compiler=$CC
++_LT_TAGVAR(compiler, $1)=$CC
++_LT_TAGVAR(LD, $1)="$LD"
++_LT_CC_BASENAME([$compiler])
++
++# Go did not exist at the time GCC didn't implicitly link libc in.
++_LT_TAGVAR(archive_cmds_need_lc, $1)=no
++
++_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
++_LT_TAGVAR(reload_flag, $1)=$reload_flag
++_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
++
++## CAVEAT EMPTOR:
++## There is no encapsulation within the following macros, do not change
++## the running order or otherwise move them around unless you know exactly
++## what you are doing...
++if test -n "$compiler"; then
++  _LT_COMPILER_NO_RTTI($1)
++  _LT_COMPILER_PIC($1)
++  _LT_COMPILER_C_O($1)
++  _LT_COMPILER_FILE_LOCKS($1)
++  _LT_LINKER_SHLIBS($1)
++  _LT_LINKER_HARDCODE_LIBPATH($1)
++
++  _LT_CONFIG($1)
++fi
++
++AC_LANG_RESTORE
++
++GCC=$lt_save_GCC
++CC=$lt_save_CC
++CFLAGS=$lt_save_CFLAGS
++])# _LT_LANG_GO_CONFIG
++
++
+ # _LT_LANG_RC_CONFIG([TAG])
+ # -------------------------
+ # Ensure that the configuration variables for the Windows resource compiler
+@@ -6943,9 +7595,11 @@
+ 
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
++lt_save_CFLAGS=$CFLAGS
+ lt_save_GCC=$GCC
+ GCC=
+ CC=${RC-"windres"}
++CFLAGS=
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+@@ -6958,7 +7612,8 @@
+ 
+ GCC=$lt_save_GCC
+ AC_LANG_RESTORE
+-CC="$lt_save_CC"
++CC=$lt_save_CC
++CFLAGS=$lt_save_CFLAGS
+ ])# _LT_LANG_RC_CONFIG
+ 
+ 
+@@ -6978,6 +7633,13 @@
+ dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+ 
+ 
++# LT_PROG_GO
++# ----------
++AC_DEFUN([LT_PROG_GO],
++[AC_CHECK_TOOL(GOC, gccgo,)
++])
++
++
+ # LT_PROG_RC
+ # ----------
+ AC_DEFUN([LT_PROG_RC],
+@@ -7017,6 +7679,15 @@
+ AC_SUBST([OBJDUMP])
+ ])
+ 
++# _LT_DECL_DLLTOOL
++# ----------------
++# Ensure DLLTOOL variable is set.
++m4_defun([_LT_DECL_DLLTOOL],
++[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
++AC_SUBST([DLLTOOL])
++])
+ 
+ # _LT_DECL_SED
+ # ------------
+@@ -7110,8 +7781,8 @@
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -7150,208 +7821,162 @@
+ ])# _LT_CHECK_SHELL_FEATURES
+ 
+ 
+-# _LT_PROG_XSI_SHELLFNS
+-# ---------------------
+-# Bourne and XSI compatible variants of some useful shell functions.
+-m4_defun([_LT_PROG_XSI_SHELLFNS],
+-[case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
++# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
++# ------------------------------------------------------
++# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
++# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
++m4_defun([_LT_PROG_FUNCTION_REPLACE],
++[dnl {
++sed -e '/^$1 ()$/,/^} # $1 /c\
++$1 ()\
++{\
++m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
++} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++])
+ 
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+ 
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
++# _LT_PROG_REPLACE_SHELLFNS
++# -------------------------
++# Replace existing portable implementations of several shell functions with
++# equivalent extended shell implementations where those features are available..
++m4_defun([_LT_PROG_REPLACE_SHELLFNS],
++[if test x"$xsi_shell" = xyes; then
++  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
++    case ${1} in
++      */*) func_dirname_result="${1%/*}${2}" ;;
++      *  ) func_dirname_result="${3}" ;;
++    esac])
+ 
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
++    func_basename_result="${1##*/}"])
+ 
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
++    case ${1} in
++      */*) func_dirname_result="${1%/*}${2}" ;;
++      *  ) func_dirname_result="${3}" ;;
++    esac
++    func_basename_result="${1##*/}"])
+ 
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
++    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
++    # positional parameters, so assign one to ordinary parameter first.
++    func_stripname_result=${3}
++    func_stripname_result=${func_stripname_result#"${1}"}
++    func_stripname_result=${func_stripname_result%"${2}"}])
+ 
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
++    func_split_long_opt_name=${1%%=*}
++    func_split_long_opt_arg=${1#*=}])
+ 
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
++    func_split_short_opt_arg=${1#??}
++    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+ 
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $[*] ))
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
++    case ${1} in
++      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
++      *)    func_lo2o_result=${1} ;;
++    esac])
+ 
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+ 
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
++  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+ 
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
++fi
+ 
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+-}
++if test x"$lt_shell_append" = xyes; then
++  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+ 
+-dnl func_dirname_and_basename
+-dnl A portable version of this function is already defined in general.m4sh
+-dnl so there is no need for it here.
++  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
++    func_quote_for_eval "${2}"
++dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
++    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+ 
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "X${3}" \
+-           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "X${3}" \
+-           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+-  esac
+-}
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
+ 
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[[^=]]*=//'
++if test x"$_lt_function_replace_fail" = x":"; then
++  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
++fi
++])
+ 
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$[@]"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
++# _LT_PATH_CONVERSION_FUNCTIONS
++# -----------------------------
++# Determine which file name conversion functions should be used by
++# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
++# for certain cross-compile configurations and native mingw.
++m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
++[AC_REQUIRE([AC_CANONICAL_HOST])dnl
++AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++AC_MSG_CHECKING([how to convert $build file names to $host format])
++AC_CACHE_VAL(lt_cv_to_host_file_cmd,
++[case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
+ esac
++])
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
++_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
++         [0], [convert $build file names to $host format])dnl
+ 
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$[1]+=\$[2]"
+-}
+-_LT_EOF
++AC_MSG_CHECKING([how to convert $build file names to toolchain format])
++AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
++[#assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
+     ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$[1]=\$$[1]\$[2]"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
++esac
+ ])
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
++_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
++         [0], [convert $build files to toolchain format])dnl
++])# _LT_PATH_CONVERSION_FUNCTIONS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltversion.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltversion.m4	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltversion.m4	(revision 12738)
+@@ -7,17 +7,17 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ 
+-# Generated from ltversion.in.
++# @configure_input@
+ 
+-# serial 3017 ltversion.m4
++# serial 3337 ltversion.m4
+ # This file is part of GNU Libtool
+ 
+-m4_define([LT_PACKAGE_VERSION], [2.2.6b])
+-m4_define([LT_PACKAGE_REVISION], [1.3017])
++m4_define([LT_PACKAGE_VERSION], [2.4.2])
++m4_define([LT_PACKAGE_REVISION], [1.3337])
+ 
+ AC_DEFUN([LTVERSION_VERSION],
+-[macro_version='2.2.6b'
+-macro_revision='1.3017'
++[macro_version='2.4.2'
++macro_revision='1.3337'
+ _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+ _LT_DECL(, macro_revision, 0)
+ ])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 12738)
+@@ -11,7 +11,16 @@
+ 	if test "x$enable_debugging" = xyes; then
+ 		AC_DEFINE([_ISSM_DEBUG_],[1],[Macro to enable debugging in ISSM])
+ 	fi
++
+ 	dnl }}}
++    dnl shared build {{{
++    AC_ARG_ENABLE([shared],                                                dnl feature
++        AS_HELP_STRING([--enable-shared], [produce libISSM.so.0]),         dnl help string
++        [enable_shared=$enableval],                                        dnl action if given
++        [enable_shared=no])                                                dnl action if not given
++    AM_CONDITIONAL([SHARED], [test $enable_shared = yes])
++    dnl }}}
++
+ 	dnl Modules build {{{
+ 	AC_ARG_WITH([modules],
+ 		AS_HELP_STRING([--with-modules = value],[modules compilation. ]),
+@@ -492,7 +501,7 @@
+ 		dnl defaults
+ 		HAVE_GSL=yes
+ 		GSLINCL="-I$GSL_ROOT/include"
+-		GSLLIB="-L$GSL_ROOT/lib/ -lgsl -lgslcblas -lm"
++		GSLLIB="-dy -L$GSL_ROOT/lib/ -lgsl -lgslcblas -lm"
+ 
+ 		AC_DEFINE([_HAVE_GSL_],[1],[with gsl in ISSM src])
+ 		AC_SUBST([GSLINCL])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/lt~obsolete.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/lt~obsolete.m4	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/lt~obsolete.m4	(revision 12738)
+@@ -1,13 +1,13 @@
+ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+ #
+-#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
++#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+ #   Written by Scott James Remnant, 2004.
+ #
+ # This file is free software; the Free Software Foundation gives
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ 
+-# serial 4 lt~obsolete.m4
++# serial 5 lt~obsolete.m4
+ 
+ # These exist entirely to fool aclocal when bootstrapping libtool.
+ #
+@@ -77,7 +77,6 @@
+ m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+ m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+ m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+-m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
+ m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+ m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+ m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+@@ -90,3 +89,10 @@
+ m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+ m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+ m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
++m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
++m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
++m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
++m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
++m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
++m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
++m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltoptions.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltoptions.m4	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltoptions.m4	(revision 12738)
+@@ -1,13 +1,14 @@
+ # Helper functions for option handling.                    -*- Autoconf -*-
+ #
+-#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
++#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
++#   Inc.
+ #   Written by Gary V. Vaughan, 2004
+ #
+ # This file is free software; the Free Software Foundation gives
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ 
+-# serial 6 ltoptions.m4
++# serial 7 ltoptions.m4
+ 
+ # This is to help aclocal find these macros, as it can't see m4_define.
+ AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+@@ -125,7 +126,7 @@
+ [enable_win32_dll=yes
+ 
+ case $host in
+-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
++*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+   AC_CHECK_TOOL(AS, as, false)
+   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+   AC_CHECK_TOOL(OBJDUMP, objdump, false)
+@@ -133,13 +134,13 @@
+ esac
+ 
+ test -z "$AS" && AS=as
+-_LT_DECL([], [AS],      [0], [Assembler program])dnl
++_LT_DECL([], [AS],      [1], [Assembler program])dnl
+ 
+ test -z "$DLLTOOL" && DLLTOOL=dlltool
+-_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
++_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+ 
+ test -z "$OBJDUMP" && OBJDUMP=objdump
+-_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
++_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+ ])# win32-dll
+ 
+ AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+@@ -325,9 +326,24 @@
+ # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+ m4_define([_LT_WITH_PIC],
+ [AC_ARG_WITH([pic],
+-    [AS_HELP_STRING([--with-pic],
++    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ 	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+-    [pic_mode="$withval"],
++    [lt_p=${PACKAGE-default}
++    case $withval in
++    yes|no) pic_mode=$withval ;;
++    *)
++      pic_mode=default
++      # Look at the argument we got.  We use all the common list separators.
++      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
++      for lt_pkg in $withval; do
++	IFS="$lt_save_ifs"
++	if test "X$lt_pkg" = "X$lt_p"; then
++	  pic_mode=yes
++	fi
++      done
++      IFS="$lt_save_ifs"
++      ;;
++    esac],
+     [pic_mode=default])
+ 
+ test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android_variables.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android_variables.sh	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android_variables.sh	(revision 12738)
+@@ -1,5 +0,0 @@
+-sdk_rev=20
+-ndk_rev=8
+-api_levels="android-14,android-15,android-16"
+-host_triplet="arm-linux-androideabi"
+-default_droid="android-4.1"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-sdk/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-sdk/install.sh	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-sdk/install.sh	(revision 12738)
+@@ -1,60 +1,54 @@
+-#This installs the Android SDK (Software Development Kit)
+-#which is needed for the compilation of the Java project. 
+-source $ANDROID_DIR/android_variables.sh
++#!/bin/bash
+ 
+-step=1;
++# This installs the Android SDK (Software Development Kit)
++# which is needed for the compilation of the Java project. 
+ 
+-#Different steps here. 
+-#1: install sdk, ant and sdk tools
+-#2: install an emulator.
+-#3: test the emulator
+-#4: cleanup
++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"
+ 
+-((tmp=$1 )) 
++if [[ $step == "1" || $step == "0" ]]; then
+ 
+-if [[ $tmp -ge "1" && $tmp -le "4" ]]; then
+-    step=$1
+-else
+-    echo "Using default step: " $step
+-fi
+-
+-if [[ $step == "1" ]]; then
+-
+-	#Cleanup the install
++	# Cleanup the install
+ 	rm -rf install-sdk
+ 
+-	#Download from ISSM server
++	# Download from ISSM server
+ 	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/android-sdk_r'$sdk_rev'-macosx.zip' 'android-sdk_r'${sdk_rev}'-macosx.zip'
+ 
+ 	# Install Android SDK and NDK.
+ 	unzip -o android-sdk_r${sdk_rev}-macosx.zip
+ 
+-	#Move to install
++	# Move to install
+ 	mv -f android-sdk-macosx install-sdk
+ 
+-	#Post_install configuration: 
+-	#We need specific settings for specific platforms, for the SDK to 
+-	#function properly
++	# 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. 
++	# 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-sdk/tools/ && source ./android update sdk -t platform-tool,${api_levels},system-image --no-ui
+ 
+ fi
+ 
+-if [[ $step == "2" ]]; then
++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
++	# 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.
++	# Here we delete the Android-4.0.3 device if it already exists.
+ 	cd $present_dir/install-sdk/tools
+ 
+     if [ -e $ANDROID_DIR/android-emulators/$default_droid ] 
+@@ -63,31 +57,26 @@
+ 	    ./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 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" ]]; 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.
++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-sdk/tools
+ 	./emulator -avd $default_droid -sdcard $ANDROID_DIR/android-emulators/$sd_card.img &
+ 
+     cd ../platform-tools
+     ./adb wait-for-device shell
+-    #./adb wait-for-device shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
+-    #./adb wait-for-device shell
+-    #./adb push $ISSM_TIER/src/c/issm.exe /data/issm.exe
+-    #./adb shell chmod 777 /data/issm.exe
+-    #./adb shell /data/issm.exe
+ fi
+ 
+-if [[ $step == "4" ]]; then
++if [[ $step == "4" || $step == "0" ]]; then
+ 	rm -rf install-sdk
+ fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android_aux.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android_aux.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android_aux.sh	(revision 12738)
+@@ -0,0 +1,30 @@
++#!/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=20
++ndk_rev=8
++api_levels="android-14,android-15,android-16"
++host_triplet="arm-linux-androideabi"
++default_droid="android-4.1"
++
++step=0;
++j=1;
++
++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" =~ -j=([0-9])* ]]; then
++        j=${BASH_REMATCH[1]}; 
++        echo "Number of jobs set to: " $j
++    else
++        echo "Option not recognized"
++    fi
++done
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-ndk/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-ndk/install.sh	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-ndk/install.sh	(revision 12738)
+@@ -1,27 +1,31 @@
+-#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.
++#!/bin/bash
+ 
+-#The android-ndk-r8-darwin-x86.tar.bz2 ndk.tar.bz2 file was downloaded 
+-#from the android developer website: 
+-source $ANDROID_DIR/android_variables.sh
++# 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.
+ 
+-#Cleanup the install
+-rm -rf install
+-rm -rf $ANDROID_DIR/arm-linux-android-${default_droid}
++# 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
+ 
+-#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'
++if [[ $step == "1" || $step == "0" ]]; then
++    # Cleanup the install
++    rm -rf install
++    rm -rf $ANDROID_DIR/arm-linux-android-${default_droid}
+ 
+-# Install Android SDK and NDK.
+-bunzip2 ndk.tar.bz2
+-tar -xvf ndk.tar
+-rm -rf ndk.tar ndk.tar.bz2
++    # 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'
+ 
+-#Move to install
+-mv android-ndk-r${ndk_rev} install
++    # Untar
++    tar -zxvf ndk.tar.bz2
++    rm -rf ndk.tar ndk.tar.bz2
+ 
+-#Create Standalone Development Directory
+-#Note: API-14 corresponds to Android 4.0 although we are
+-#calling our toolchain 4.1 to agree with our device.
+-$ANDROID_NDK_DIR/build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$ANDROID_DIR/arm-linux-android-4.0
++    # Move to install
++    mv android-ndk-r${ndk_rev} install
++fi
++
++# Create Standalone Development Directory
++# Note: API-14 corresponds to Android 4.0.
++if [[ $step == "2" || $step == "0" ]]; then
++    $ANDROID_NDK_DIR/build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$ANDROID_DIR/arm-linux-android-4.0
++fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh	(revision 12738)
+@@ -1,33 +1,43 @@
+ #!/bin/bash
+-source $ANDROID_DIR/android_variables.sh
+ 
+-#Some cleanup
+-rm -rf src install gsl-1.15
+-mkdir src install
++source $ANDROID_DIR/android_aux.sh
+ 
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
++if [[ $step == "1" || $step == "0" ]]; then
+ 
+-#Untar 
+-tar -zxvf  gsl-1.15.tar.gz
++    #Some cleanup
++    rm -rf src install gsl-1.15
++    mkdir src install
+ 
+-#Move gsl into src directory
+-mv gsl-1.15/* src
+-rm -rf gsl-1.15
++    #Download from ISSM server
++    $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
+ 
++    #Untar 
++    tar -zxvf  gsl-1.15.tar.gz
++
++    #Move gsl into src directory
++    mv gsl-1.15/* src
++    rm -rf gsl-1.15
++fi
++
+ #Configure gsl
+-cd src
++if [[ $step == "2" || $step == "0" ]]; then
++    cd src
++    
++    autoreconf -iv --force -I "$ISSM_DIR/m4/"
+ 
+-./configure \
+-    --build="i386-apple-darwin10.8.0" \
+-    --host=$host_triplet\
+-	--prefix="$ISSM_DIR/externalpackages/gsl/install" 
++    ./configure \
++        --build="i386-apple-darwin10.8.0" \
++        --host=$host_triplet\
++	    --prefix="$ISSM_DIR/externalpackages/gsl/install/" 
++fi
+ 
+ #Compile gsl
+-if [ -z $1 ]; then
+-	make
+-else
+-	make -j $1
++if [[ $step == "3" || $step == "0" ]]; then
++    if [ -z $1 ]; then
++	    make 12
++    else
++	    make -j 12
++    fi
++
++    make install
+ fi
+-
+-make install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-android.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-android.sh	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-android.sh	(revision 12738)
+@@ -1,35 +1,34 @@
+ #!/bin/bash
+-source $ANDROID_DIR/android_variables.sh
+-export toolchain_path
++source $ANDROID_DIR/android_aux.sh
+ 
+-#use matlab? 
++# use matlab? 
+ matlab=0
+ 
+-#Some cleanup 
++# Some cleanup 
+ rm -rf install triangle
+ mkdir install
+ 
+-#Download from ISSM server
++# Download from ISSM server
+ $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+ 
+-#Untar 
++# Untar 
+ cd install
+ cp ../triangle.zip ./
+ unzip triangle.zip
+ 
+-#copy new makefile
++# copy new makefile
+ cp ../configs//android/configure.make ./
+ cp ../makefile ./
+ 
+-#Patch triangle.c 
++# Patch triangle.c 
+ if [[ $matlab == "1" ]];then
+ 	patch triangle.c ../triangle.c.patch.matlab
+ else
+ 	patch triangle.c ../triangle.c.patch.python
+ fi
+ 
+-#Compile triangle
+-make
++# Compile triangle
++make -j $j
+ 
+-#Patch triangle.h
++# Patch triangle.h
+ patch triangle.h ../triangle.h.patch
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12738)
+@@ -4,6 +4,10 @@
+ 
+ #Library declaration {{{
+ lib_LIBRARIES = libISSMCore.a libISSMOverload.a
++
++if SHARED
++lib_LTLIBRARIES = libISSM.la libISSMCore.la libISSMOverload.la
++endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+@@ -997,6 +1001,15 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
++if SHARED
++libISSM_la_SOURCES = solutions/issm.cpp
++libISSM_la_LIBADD = @LTLIBOBJS@
++libISSM_la_LDFLAGS = -prefer-pic
++
++libISSMCore_la_SOURCES  = $(issm_sources)
++libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++endif
++
+ if MODULES
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-arm-linux.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-arm-linux.sh	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-arm-linux.sh	(revision 12738)
+@@ -4,6 +4,7 @@
+ 	--prefix=$ISSM_DIR \
+     --build="i386-apple-darwin10.8.0" \
+     --host="arm-linux-androideabi" \
++    --enable-shared \
+     --without-fortran \
+ 	--without-modules \
+ 	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12738)
+@@ -11,7 +11,6 @@
+ AC_PROG_CXX([cccl cl icl g++])
+ AC_PROG_F77([ifort g77 gfortran])
+ #Libraries and linking
+-AC_PROG_RANLIB
+ AC_F77_LIBRARY_LDFLAGS
+ AC_PATH_XTRA      #figure out X library and include paths
+ 
+@@ -22,15 +21,18 @@
+ AM_SILENT_RULES([yes])           #Do not show compilation command by default
+ AM_PROG_CC_C_O
+ 
+-##LIBTOOL?
+-#AC_PROG_LIBTOOL
++AM_PROG_AR
++
++# To produce shared libraries uncomment LT_INIT. In theory, Libtool can be initialized
++# even if all linking is static, since, if not shared libraries are to be produce, libtool
++# will act simply as a wrapper around AR and Ranlib.
++#
+ #LT_INIT
+ 
+ #Run issm_options.m4
+ ISSM_OPTIONS
+ 
+ #AM_PROG_AR must be placed after ISSM_OPTIONS
+-AM_PROG_AR
+ 
+ #List all Makefiles
+ AC_CONFIG_FILES([Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am	(revision 12738)
+@@ -1,3 +1,3 @@
+-EXTRA_DIST = reconf  scripts test m4 examples cron etc doc packages contributors.txt 
++EXTRA_DIST = reconf scripts test m4 examples cron etc doc packages contributors.txt 
+ SUBDIRS = src bin
+ bin_SCRIPTS=config.h startup.m README.rtf
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh	(revision 12737)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh	(revision 12738)
+@@ -181,9 +181,6 @@
+ #android-sdk
+ ANDROID_SDK_DIR="$ANDROID_DIR/android-sdk/install-sdk"
+ 
+-#android-ant
+-ANDROID_ANT_DIR="$ANDROID_DIR/android-sdk/install-ant"
+-
+ #gsl
+ GSL_DIR="$ISSM_DIR/externalpackages/gsl/install"
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12738-12739.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12738-12739.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12738-12739.diff	(revision 13394)
@@ -0,0 +1,25 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 12738)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 12739)
+@@ -541,10 +541,10 @@
+ 	  AS_HELP_STRING([--with-metis-dir=DIR],[metis root directory. necessary for serial build]),
+ 	  [METIS_ROOT=$withval],[METIS_ROOT=""])
+ 
++   AC_MSG_CHECKING(for metis headers and libraries in $METIS_ROOT)
++
+ 	if test -d "$METIS_ROOT"; then
+ 
+-		AC_MSG_CHECKING(for metis headers and libraries in $METIS_ROOT)
+-
+ 		dnl first figure out version of metis: does the VERSION file exist?
+ 		if test -e "$METIS_ROOT/VERSION"; then
+ 			METIS_VERSION=4
+@@ -597,6 +597,7 @@
+ 		HAVE_METIS=no
+ 	fi
+ 	AM_CONDITIONAL([METIS], [test x$HAVE_METIS = xyes])
++	AC_MSG_RESULT($HAVE_METIS)
+ 	dnl }}}
+ 	dnl mpi{{{
+ 	AC_MSG_CHECKING(for mpi)
Index: /issm/oecreview/Archive/12678-13393/ISSM-12739-12740.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12739-12740.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12739-12740.diff	(revision 13394)
@@ -0,0 +1,42 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12739)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12740)
+@@ -3,11 +3,11 @@
+ EXEEXT=$(ISSMEXT)
+ 
+ #Library declaration {{{
+-lib_LIBRARIES = libISSMCore.a libISSMOverload.a
++#lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+-if SHARED
+-lib_LTLIBRARIES = libISSM.la libISSMCore.la libISSMOverload.la
+-endif
++#if SHARED
++#lib_LTLIBRARIES = libISSM.la libISSMCore.la libISSMOverload.la
++#endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+@@ -1001,14 +1001,14 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
+-if SHARED
+-libISSM_la_SOURCES = solutions/issm.cpp
+-libISSM_la_LIBADD = @LTLIBOBJS@
+-libISSM_la_LDFLAGS = -prefer-pic
++#if SHARED
++#libISSM_la_SOURCES = solutions/issm.cpp
++#libISSM_la_LIBADD = @LTLIBOBJS@
++#libISSM_la_LDFLAGS = -prefer-pic
+ 
+-libISSMCore_la_SOURCES  = $(issm_sources)
+-libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
+-endif
++#libISSMCore_la_SOURCES  = $(issm_sources)
++#libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++#endif
+ 
+ if MODULES
+ libISSMModules_a_SOURCES = $(module_sources)
Index: /issm/oecreview/Archive/12678-13393/ISSM-12740-12741.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12740-12741.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12740-12741.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12740)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12741)
+@@ -3,7 +3,7 @@
+ EXEEXT=$(ISSMEXT)
+ 
+ #Library declaration {{{
+-#lib_LIBRARIES = libISSMCore.a libISSMOverload.a
++lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+ #if SHARED
+ #lib_LTLIBRARIES = libISSM.la libISSMCore.la libISSMOverload.la
Index: /issm/oecreview/Archive/12678-13393/ISSM-12741-12742.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12741-12742.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12741-12742.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12741)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12742)
+@@ -22,6 +22,7 @@
+ AM_PROG_CC_C_O
+ 
+ AM_PROG_AR
++AC_PROG_RANLIB
+ 
+ # To produce shared libraries uncomment LT_INIT. In theory, Libtool can be initialized
+ # even if all linking is static, since, if not shared libraries are to be produce, libtool
Index: /issm/oecreview/Archive/12678-13393/ISSM-12742-12743.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12742-12743.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12742-12743.diff	(revision 13394)
@@ -0,0 +1,246 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py	(revision 12743)
+@@ -0,0 +1,79 @@
++"""
++SCPIN get packages from host, using scp on unix, and pscp on windows
++ 
++    usage: scpin(host,packages,path)
++ 
++ 
++"""
++
++import socket
++import platform
++import subprocess
++import os
++import shutil
++from MatlabFuncs import *
++
++def scpin(host, login,port,path, packages):
++
++	#first get hostname
++	hostname=socket.gethostname().lower().split('.')[0]
++
++	#first be sure packages are not in the current directory, this could conflict with pscp on windows. 
++	#remove warnings in case the files do not exist
++	for package in packages:
++		try:
++			os.remove(package)
++		except OSError as e:
++			pass
++
++	#if hostname and host are the same, do a simple copy
++	if strcmpi(hostname,host):
++
++		for package in packages:
++			try:
++				shutil.copy(os.path.join(path,package),os.getcwd())    #keep going, even if success=0
++			except OSError as e:
++				pass
++
++	else:
++
++		if 'Windows' in platform.system():
++			#use the putty project pscp.exe: it should be in the path.
++		
++			#get ISSM_DIR variable
++			if 'ISSM_DIR_WIN' in os.environ:
++				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
++			else:
++				raise OSError("scpin error message: could not find ISSM_DIR_WIN environment variable.")
++
++			username=raw_input('Username: (quoted string) ')
++			key=raw_input('Key: (quoted string) ')
++
++			for package in packages:
++				try:
++					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s:%s %s' % (ISSM_DIR,username,key,host,os.path.join(path,package),os.getcwd()),shell=True)
++				except CalledProcessError as e:
++					raise CalledProcessError("scpin error message: could not call putty pscp.")
++
++		else:
++			#just use standard unix scp
++			#string to copy multiple files using scp: 
++			if len(packages)==1:
++				string=packages[0]
++			else:
++				string='{'
++				for package in packages:
++					string+=packages[i]+','
++				string=string[:-1]+'}'
++
++
++			if port:
++				subprocess.call('scp -P %d %s@localhost:%s %s' % (port,login,os.path.join(path,string),os.getcwd),shell=True)
++			else:
++				subprocess.call('scp %s@%s:%s %s' % (login,host,os.path.join(path,string),os.getcwd),shell=True)
++		
++			#check scp worked
++			for package in packages:
++				if not os.path.exists(os.path.join('.',package)):
++					raise OSError("scpin error message: could not call scp on *nix system.")
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py	(revision 12743)
+@@ -0,0 +1,61 @@
++"""
++SCPOUT send packages to a host, using scp on unix, and pscp on windows
++ 
++    usage: scpout(host,path,packages)
++ 
++ 
++"""
++
++import socket
++import platform
++import subprocess
++import os
++import shutil
++from MatlabFuncs import *
++
++def issmscpout(host,path,login,port,packages):
++
++	#get hostname
++	hostname=socket.gethostname().lower().split('.')[0]
++
++	#if hostname and host are the same, do a simple copy
++
++	if strcmpi(host,hostname):
++		for package in packages:
++			here=os.getcwd()
++			os.chdir(path)
++			shutil.rmtree(package)
++			subprocess.call('ln -s %s %s' % (os.path.join(here,package),path),shell=True)
++			os.chdir(here)
++	else:
++		if 'Windows' in platform.system():
++			#use the putty project pscp.exe: it should be in the path.
++		
++			#get ISSM_DIR variable
++			if 'ISSM_DIR_WIN' in os.environ:
++				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
++			else:
++				raise OSError("scpout error message: could not find ISSM_DIR_WIN environment variable.")
++
++			username=raw_input('Username: (quoted string) ')
++			key=raw_input('Key: (quoted string) ')
++
++			for package in packages:
++				try:
++					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s %s:%s' % (ISSM_DIR,username,key,package,host,path),shell=True)
++				except CalledProcessError as e:
++					raise CalledProcessError("scpout error message: could not call putty pscp.")
++
++		else:
++			#just use standard unix scp
++			#create string of packages being sent
++			string=''
++			for package in packages:
++				string+=' '+package
++			string+=' '
++		
++			if port:
++				subprocess.call('scp -P %d %s %s@localhost:%s' % (port,string,login,path),shell=True)
++			else:
++				subprocess.call('scp %s %s@%s:%s' % (string,login,host,path),shell=True)
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py	(revision 12743)
+@@ -0,0 +1,43 @@
++"""
++ISSMSSH - wrapper for OS independent ssh command.
++ 
++    usage: 
++       issmssh(host,command)
++"""
++
++import socket
++import platform
++import subprocess
++import os
++from MatlabFuncs import *
++
++def issmssh(host,login,port,command):
++
++	#first get hostname 
++	hostname=socket.gethostname().lower().split('.')[0]
++
++	#if same as host, just run the command. 
++	if strcmpi(host,hostname):
++		subprocess.call(command,shell=True)
++	else:
++		if 'Windows' in platform.system():
++			#use the putty project plink.exe: it should be in the path.
++		
++			#get ISSM_DIR variable
++			if 'ISSM_DIR_WIN' in os.environ:
++				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
++			else:
++				raise OSError("issmssh error message: could not find ISSM_DIR_WIN environment variable.")
++
++			username=raw_input('Username: (quoted string) ')
++			key=raw_input('Key: (quoted string) ')
++
++			subprocess.call('%s/externalpackages/ssh/plink.exe -ssh -l "%s" -pw "%s" %s "%s"' % (ISSM_DIR,username,key,host,command),shell=True);
++
++		else:
++			#just use standard unix ssh
++			if port:
++				subprocess.call('ssh -l %s -p %d localhost "%s"' % (login,port,command),shell=True)
++			else:
++				subprocess.call('ssh -l %s %s "%s"' % (login,host,command),shell=True)
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12742)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12743)
+@@ -36,3 +36,4 @@
+ 		raise RuntimeError("could not determine whether PETSC was or was not compiled.")
+ 
+ 	return flag
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.m	(revision 12742)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.m	(revision 12743)
+@@ -34,7 +34,7 @@
+ 		%get ISSM_DIR variable
+ 		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+ 		if status, 
+-			error('scpin error message: could not find ISSM_DIR_WIN envirnoment variable');
++			error('scpin error message: could not find ISSM_DIR_WIN environment variable');
+ 		end
+ 		ISSM_DIR=ISSM_DIR(2:end-2);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.m	(revision 12742)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.m	(revision 12743)
+@@ -25,7 +25,7 @@
+ 		%get ISSM_DIR variable
+ 		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+ 		if status, 
+-			error('scpout error message: could not find ISSM_DIR_WIN envirnoment variable');
++			error('scpout error message: could not find ISSM_DIR_WIN environment variable');
+ 		end
+ 		ISSM_DIR=ISSM_DIR(2:end-2);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.m	(revision 12742)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.m	(revision 12743)
+@@ -17,7 +17,7 @@
+ 		%get ISSM_DIR variable
+ 		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+ 		if status, 
+-			error('issmssh error message: could not find ISSM_DIR_WIN envirnoment variable');
++			error('issmssh error message: could not find ISSM_DIR_WIN environment variable');
+ 		end
+ 		ISSM_DIR=ISSM_DIR(2:end-2);
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12743-12744.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12743-12744.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12743-12744.diff	(revision 13394)
@@ -0,0 +1,1157 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12744)
+@@ -269,6 +269,7 @@
+ 	IntInputEnum,
+ 	IntParamEnum,
+ 	IntVecParamEnum,
++	TransientParamEnum,
+ 	MacAyeal2dIceFrontEnum,
+ 	MacAyeal3dIceFrontEnum,
+ 	MaticeEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12744)
+@@ -273,6 +273,7 @@
+ 	      else if (strcmp(name,"IntInput")==0) return IntInputEnum;
+ 	      else if (strcmp(name,"IntParam")==0) return IntParamEnum;
+ 	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
++	      else if (strcmp(name,"TransientParam")==0) return TransientParamEnum;
+ 	      else if (strcmp(name,"MacAyeal2dIceFront")==0) return MacAyeal2dIceFrontEnum;
+ 	      else if (strcmp(name,"MacAyeal3dIceFront")==0) return MacAyeal3dIceFrontEnum;
+ 	      else if (strcmp(name,"Matice")==0) return MaticeEnum;
+@@ -382,11 +383,11 @@
+ 	      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 stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
++	      if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
++	      else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
+ 	      else if (strcmp(name,"StressTensor")==0) return StressTensorEnum;
+ 	      else if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum;
+ 	      else if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12744)
+@@ -266,6 +266,7 @@
+ 		case IntInputEnum : return "IntInput";
+ 		case IntParamEnum : return "IntParam";
+ 		case IntVecParamEnum : return "IntVecParam";
++		case TransientParamEnum : return "TransientParam";
+ 		case MacAyeal2dIceFrontEnum : return "MacAyeal2dIceFront";
+ 		case MacAyeal3dIceFrontEnum : return "MacAyeal3dIceFront";
+ 		case MaticeEnum : return "Matice";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12744)
+@@ -153,6 +153,8 @@
+ 					./objects/Params/MatrixParam.cpp\
+ 					./objects/Params/VectorParam.h\
+ 					./objects/Params/VectorParam.cpp\
++					./objects/Params/TransientParam.h\
++					./objects/Params/TransientParam.cpp\
+ 					./Container/Container.h\
+ 					./Container/Constraints.h\
+ 					./Container/Constraints.cpp\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleVecParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleVecParam.h	(revision 12744)
+@@ -42,33 +42,34 @@
+ 		/*}}}*/
+ 		/*Param virtual functions definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+ 		void  GetParameterValue(int** pintarray,int* pM);
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");};
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");};
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+ 		void  SetValue(IssmDouble* IssmDoublearray,int M);
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble mat array");}
+-		void  SetValue(int* intarray,int M){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int mat array");};
+-		void  SetValue(int* pintarray,int M,int N){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 		
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleParam.h	(revision 12744)
+@@ -47,28 +47,29 @@
+ 		void  GetParameterValue(int** pintarray,int* pM);
+ 		void  GetParameterValue(int** pintarray,int* pM,int* pN);
+ 		void  GetParameterValue(IssmDouble* pIssmDouble){*pIssmDouble=value;}
+-		void  GetParameterValue(char** pstring){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){this->value=(IssmDouble)boolean;}
+ 		void  SetValue(int integer){this->value=(IssmDouble)integer;}
+ 		void  SetValue(IssmDouble scalar){this->value=(IssmDouble)scalar;}
+-		void  SetValue(char* string){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h	(revision 12744)
+@@ -44,31 +44,32 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims);
+-		void  GetParameterValue(Vector** pvec){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble vec array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble mat array");}
+-		void  SetValue(int* intarray,int M){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int vec array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("DoubleMatArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble vec array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble mat array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");}
++		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a int mat array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array);
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.h	(revision 12744)
+@@ -43,33 +43,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+ 		void  GetParameterValue(int** pintarray,int* pM,int* pN);
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN);
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble vec array");}
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
+ 		void  SetValue(IssmDouble* IssmDoublearray,int M,int N);
+-		void  SetValue(int* intarray,int M){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int vec array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int mat array");};
+-		void  SetValue(Vector* vec){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("DoubleMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}
++		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 		IssmDouble* GetPointer(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/Param.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/Param.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/Param.h	(revision 12744)
+@@ -31,6 +31,7 @@
+ 		virtual void  GetParameterValue(int** pintarray,int* pM)=0;
+ 		virtual void  GetParameterValue(int** pintarray,int* pM,int* pN)=0;
+ 		virtual void  GetParameterValue(IssmDouble* pIssmDouble)=0;
++		virtual void  GetParameterValue(IssmDouble* pdouble,IssmDouble time)=0;
+ 		virtual void  GetParameterValue(char** pstring)=0;
+ 		virtual void  GetParameterValue(char*** pstringarray,int* pM)=0;
+ 		virtual void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM)=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/FileParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/FileParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/FileParam.h	(revision 12744)
+@@ -41,31 +41,32 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){  _error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
++		void  GetParameterValue(bool* pbool){  _error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){*pfid=value;};
+ 
+-		void  SetValue(bool boolean){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(int integer){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(IssmDouble scalar){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char* string){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("FileParam of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntVecParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntVecParam.h	(revision 12744)
+@@ -43,33 +43,34 @@
+ 		/*}}}*/
+ 		/*Param virtual functions definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+ 		void  GetParameterValue(int** pintarray,int* pM);
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array (maybe in serial?)");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array (maybe in serial?)");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble mat array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble mat array");}
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
+ 		void  SetValue(int* intarray,int M);
+-		void  SetValue(int* pintarray,int M,int N){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("IntVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 		
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntParam.h	(revision 12744)
+@@ -42,33 +42,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+ 		void  GetParameterValue(int* pinteger){*pinteger=value;}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a bool");}
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a bool");}
+ 		void  SetValue(int integer){this->value=integer;}
+-		void  SetValue(int* intarray,int M){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an int array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an int array");}
+-		void  SetValue(IssmDouble scalar){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an IssmDouble");}
+-		void  SetValue(char* string){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(Vector* vec){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Int param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}
++		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an IssmDouble");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/BoolParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/BoolParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/BoolParam.h	(revision 12744)
+@@ -42,32 +42,33 @@
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+ 		void  GetParameterValue(bool* pbool){*pbool=value;}
+-		void  GetParameterValue(int* pinteger){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){this->value=boolean;}
+-		void  SetValue(int integer){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an int");}
+-		void  SetValue(IssmDouble scalar){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an IssmPDouble");}
+-		void  SetValue(char* string){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an int");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an IssmPDouble");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 		
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntMatParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntMatParam.h	(revision 12744)
+@@ -43,33 +43,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+ 		void  GetParameterValue(int** pintarray,int* pM,int* pN);
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");};
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");};
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble vec array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble vec array");};
+-		void  SetValue(int* intarray,int M){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int vec array");};
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");};
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");};
+ 		void  SetValue(int* intarray,int M,int N);
+-		void  SetValue(Vector* vec){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("IntMat param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.cpp	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.cpp	(revision 12744)
+@@ -23,7 +23,6 @@
+ 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){
+ }
+ /*}}}*/
+-
+ /*FUNCTION DoubleTransientMatParam::UnitConversion{{{*/
+ void  DoubleTransientMatParam::UnitConversion(int direction_enum){
+ 	::UnitConversion(this->value,(this->M-1)*this->N,direction_enum,this->enum_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.cpp	(revision 12744)
+@@ -0,0 +1,158 @@
++/*!\file TransientParam.c
++ * \brief: implementation of the TransientParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*TransientParam constructors and destructor*/
++/*FUNCTION 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){
++
++	_assert_(in_values && in_time);
++
++	enum_type=in_enum_type;
++	N=in_N;
++
++	values=xNew<IssmDouble>(N);
++	xMemCpy<IssmDouble>(values,in_values,N);
++
++	timesteps=xNew<IssmDouble>(N);
++	xMemCpy<IssmDouble>(timesteps,in_time,N);
++}
++/*}}}*/
++/*FUNCTION TransientParam::~TransientParam(){{{*/
++TransientParam::~TransientParam(){
++	xDelete<IssmDouble>(values);
++	xDelete<IssmDouble>(timesteps);
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION TransientParam::Echo {{{*/
++void TransientParam::Echo(void){
++
++	_printLine_("TransientParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   size: " << this->N);
++
++}
++/*}}}*/
++/*FUNCTION TransientParam::DeepEcho{{{*/
++void TransientParam::DeepEcho(void){
++
++	int i,j;
++	
++	_printLine_("TransientParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   size: " << this->N);
++	for(i=0;i<this->N;i++){
++		_printLine_(   "time: " << this->timesteps[i] << " value: " << this->values[i]);
++	}
++}
++/*}}}*/
++/*FUNCTION TransientParam::Id{{{*/
++int    TransientParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION TransientParam::MyRank{{{*/
++int    TransientParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION TransientParam::ObjectEnum{{{*/
++int TransientParam::ObjectEnum(void){
++
++	return TransientParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION TransientParam::copy{{{*/
++Object* TransientParam::copy() {
++	
++	return new TransientParam(this->enum_type,this->values,this->timesteps,this->N);
++
++}
++/*}}}*/
++
++/*TransientParam virtual functions definitions: */
++/*FUNCTION TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){{{*/
++void  TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){
++
++	double output;
++	bool   found;
++
++	/*Ok, we have the time, go through the timesteps, and figure out which interval we 
++	 *fall within. Then interpolate the values on this interval: */
++	if(time<this->timesteps[0]){
++		/*get values for the first time: */
++		output=this->values[0];
++		found=true;
++	}
++	else if(time>this->timesteps[this->N-1]){
++		/*get values for the last time: */
++		output=this->values[this->N-1];
++		found=true;
++	}
++	else{
++		/*Find which interval we fall within: */
++		for(int i=0;i<this->N;i++){
++			if(time==this->timesteps[i]){
++				/*We are right on one step time: */
++				output=this->values[i];
++				found=true;
++				break; //we are done with the time interpolation.
++			}
++			else{
++				if(this->timesteps[i]<time && time<this->timesteps[i+1]){
++					/*ok, we have the interval ]i:i+1[. Interpolate linearly for now: */
++					IssmDouble deltat=this->timesteps[i+1]-this->timesteps[i];
++					IssmDouble alpha=(time-this->timesteps[i])/deltat;
++					output=(1.0-alpha)*this->values[i] + alpha*this->values[i+1];
++					found=true;
++					break;
++				}
++				else continue; //keep looking on the next interval
++			}
++		}
++	}
++	if(!found)_error2_("did not find time interval on which to interpolate values");
++	*pdouble=output;
++}
++/*}}}*/
++/*FUNCTION TransientParam::GetParameterName{{{*/
++void TransientParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION TransientParam::UnitConversion{{{*/
++void  TransientParam::UnitConversion(int direction_enum){
++	::UnitConversion(this->values,this->N,direction_enum,this->enum_type);
++}
++/*}}}*/
++		
++/*diverse: */
++/*FUNCTION TransientParam::GetPointer{{{*/
++IssmDouble* TransientParam::GetPointer(void){
++	return this->values;
++}
++/*}}}*/
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.cpp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/VectorParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/VectorParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/VectorParam.h	(revision 12744)
+@@ -42,17 +42,18 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(Vector** poutput);
+ 		void  GetParameterValue(FILE** pfid){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
+ 
+@@ -68,7 +69,7 @@
+ 		void  SetValue(Vector* vec);
+ 		void  SetValue(Matrix* mat){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Vector param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.h	(revision 12744)
+@@ -1,5 +1,5 @@
+ /*! \file DoubleTransientMatParam.h 
+- *  \brief: header file for triavertexinput object
++ *  \brief: header file for DoubleTransientMatParam object
+  */
+ 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/MatrixParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/MatrixParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/MatrixParam.h	(revision 12744)
+@@ -42,33 +42,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a vec");}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");}
+ 		void  GetParameterValue(Matrix** poutput);
+-		void  GetParameterValue(FILE** pfid){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+ 		void  SetValue(Matrix* mat);
+-		void  SetValue(FILE* fid){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Matrix param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringArrayParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringArrayParam.h	(revision 12744)
+@@ -44,33 +44,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(char** pstring){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string");}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+ 		void  GetParameterValue(char*** pstringarray,int* pM);
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Vec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+ 		void  SetValue(char** stringarray,int M);
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("StringArray param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringParam.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringParam.h	(revision 12744)
+@@ -42,33 +42,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+ 		void  GetParameterValue(char** pstring);
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a Mat");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+ 		void  SetValue(char* string);
+-		void  SetValue(char** stringarray,int M){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("String param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h	(revision 12744)
+@@ -0,0 +1,81 @@
++/*! \file TransientParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _TRANSIENTPARAM_H_
++#define _TRANSIENTPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class TransientParam: public Param{
++
++	protected: 
++		int enum_type;
++		int N;
++		IssmDouble* values;
++		IssmDouble* timesteps;
++
++	public:
++		/*TransientParam constructors, destructors: {{{*/
++		TransientParam();
++		TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,int in_N);
++		~TransientParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time);
++		void  GetParameterValue(char** pstring){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N);
++		void  SetValue(int* intarray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");}
++		void  SetValue(int* intarray,int M,int N){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int mat array");};
++		void  SetValue(Vector* vec){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++		IssmDouble* GetPointer(void);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _TRANSIENTPARAM_H */
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/objects.h	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/objects.h	(revision 12744)
+@@ -139,6 +139,7 @@
+ #include "./Params/VectorParam.h"
+ #include "./Params/StringArrayParam.h"
+ #include "./Params/StringParam.h"
++#include "./Params/TransientParam.h"
+ 
+ /*C objects: */
+ #include "./Contour.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.cpp	(revision 12743)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.cpp	(revision 12744)
+@@ -457,7 +457,7 @@
+ 					/*ok, we have the interval ]i:i+1[. Interpolate linearly for now: */
+ 					deltat=this->timesteps[i+1]-this->timesteps[i];
+ 					alpha2=(intime-this->timesteps[i])/deltat;
+-					alpha1=(1-alpha2);
++					alpha1=(1.0-alpha2);
+ 
+ 					input1=(Input*)this->inputs->GetObjectByOffset(i); 
+ 					input2=(Input*)this->inputs->GetObjectByOffset(i+1);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12744-12745.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12744-12745.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12744-12745.diff	(revision 13394)
@@ -0,0 +1,54 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 12744)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 12745)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=448;
++macro=449;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/TransientParamEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/TransientParamEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/TransientParamEnum.m	(revision 12745)
+@@ -0,0 +1,11 @@
++function macro=TransientParamEnum()
++%TRANSIENTPARAMENUM - Enum of TransientParam
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=TransientParamEnum()
++
++macro=StringToEnum('TransientParam');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12744)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12745)
+@@ -2506,6 +2506,16 @@
+ 
+ 	return StringToEnum('IntVecParam')
+ 
++def TransientParamEnum():
++	"""
++	TRANSIENTPARAMENUM - Enum of TransientParam
++
++	   Usage:
++	      macro=TransientParamEnum()
++	"""
++
++	return StringToEnum('TransientParam')
++
+ def MacAyeal2dIceFrontEnum():
+ 	"""
+ 	MACAYEAL2DICEFRONTENUM - Enum of MacAyeal2dIceFront
+@@ -4494,5 +4504,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 448
++	return 449
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12745-12746.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12745-12746.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12745-12746.diff	(revision 13394)
@@ -0,0 +1,61 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp	(revision 12745)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp	(revision 12746)
+@@ -101,6 +101,23 @@
+ 	_error2_("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);
++
++	vector<Object*>::iterator object;
++	Param* param=NULL;
++
++	for ( object=objects.begin() ; object < objects.end(); object++ ){
++
++		param=(Param*)(*object);
++		if(param->InstanceEnum()==enum_type){
++			param->GetParameterValue(pscalar,time);
++			return;
++		}
++	}
++	_error2_("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);
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.h	(revision 12745)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.h	(revision 12746)
+@@ -22,16 +22,17 @@
+ 
+ 	public:
+ 
+-		/*constructors, destructors: {{{*/
++		/*constructors, destructors*/ 
+ 		Parameters();
+ 		~Parameters();
+-		/*}}}*/
+-		/*numerics: {{{*/
++
++		/*numerics*/
+ 		bool  Exist(int enum_type);
+ 
+ 		void  FindParam(bool* pinteger,int enum_type);
+ 		void  FindParam(int* pinteger,int enum_type);
+ 		void  FindParam(IssmDouble* pscalar, int enum_type);
++		void  FindParam(IssmDouble* pscalar, int enum_type,IssmDouble time);
+ 		void  FindParam(char** pstring,int enum_type);
+ 		void  FindParam(char*** pstringarray,int* pM,int enum_type);
+ 		void  FindParam(int** pintarray,int* pM,int enum_type);
+@@ -58,7 +59,6 @@
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		Object* FindParamObject(int enum_type);
+-		/*}}}*/
+ 
+ };
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12746-12747.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12746-12747.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12746-12747.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h	(revision 12746)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h	(revision 12747)
+@@ -64,7 +64,7 @@
+ 		void  SetValue(char* string){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string");}
+ 		void  SetValue(char** stringarray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string array");}
+ 		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M,int N);
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+ 		void  SetValue(int* intarray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");}
+ 		void  SetValue(int* intarray,int M,int N){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int mat array");};
+ 		void  SetValue(Vector* vec){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}
Index: /issm/oecreview/Archive/12678-13393/ISSM-12747-12748.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12747-12748.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12747-12748.diff	(revision 13394)
@@ -0,0 +1,911 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 12748)
+@@ -4,12 +4,14 @@
+ rm -rf install
+ 
+ #Select or create a new simlink
+-ln -s /usr/local/pkgs/matlab-7.6/ install
++#ln -s /usr/local/pkgs/matlab-7.6/ install
+ #ln -s /discover/vis/mathworks/matlab_r2011b/ install
+ #ln -s /usr/local/matlab704/ install
+ #ln -s /usr/local/matlab711/ install
+ #ln -s /usr/local/matlab712/ install
+ 
++ln -s /home/kevin/perso.dir/matlab10 install
++
+ # Macintosh (OSX) simlink 
+ #ln -s /Applications/MATLAB_R2008a/ install
+ #ln -s /Applications/MATLAB_R2009a.app/ install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp	(revision 12748)
+@@ -15,7 +15,6 @@
+ 
+ 	/*parameters: */
+ 	bool save_results;
+-	bool ispdd;
+ 	bool issmbgradients;
+ 
+ 	/*activate formulation: */
+@@ -23,13 +22,8 @@
+ 	
+ 	/*recover parameters: */
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+-	femmodel->parameters->FindParam(&ispdd,SurfaceforcingsIspddEnum);
+ 	femmodel->parameters->FindParam(&issmbgradients,SurfaceforcingsIssmbgradientsEnum);
+ 
+-	if(ispdd){
+-	  if(VerboseSolution()) _pprintLine_("   call positive degree day module");
+-	  PositiveDegreeDayx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+-	}
+ 
+ 	if(issmbgradients){
+ 	  _printf_(VerboseSolution(),"	call smb gradients module\n");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12748)
+@@ -23,7 +23,7 @@
+ 
+ 	/*parameters: */
+ 	IssmDouble starttime,finaltime,dt,yts;
+-	bool   isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy;
++	bool   isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy,ispdd,isdelta18o;
+ 	bool   save_results,dakota_analysis;
+ 	bool   time_adapt=false;
+ 	int    output_frequency;
+@@ -52,6 +52,8 @@
+ 	if(isgroundingline) femmodel->parameters->FindParam(&groundingline_migration,GroundinglineMigrationEnum);
+ 	femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum);
+ 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,TransientRequestedOutputsEnum);
++	femmodel->parameters->FindParam(&ispdd,SurfaceforcingsIspddEnum);
++	femmodel->parameters->FindParam(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
+ 
+ 	/*initialize: */
+ 	step=0;
+@@ -105,6 +107,15 @@
+ 			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
+ 			#endif
+ 		}
++		
++		if(ispdd){
++		        if(isdelta18o){
++		                if(VerboseSolution()) _pprintLine_("   call Delta18oParametrization module");
++		                Delta18oParameterizationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
++			} 
++		        if(VerboseSolution()) _pprintLine_("   call positive degree day module");
++		        PositiveDegreeDayx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
++		}
+ 
+ 		if(isdiagnostic){
+ 			if(VerboseSolution()) _pprintLine_("   computing new velocity");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12748)
+@@ -148,6 +148,12 @@
+ 	SettingsOutputFrequencyEnum,
+ 	SettingsResultsAsPatchesEnum,
+ 	SettingsWaitonlockEnum,
++	SurfaceforcingsDelta18oEnum,
++	SurfaceforcingsDelta18oTemperaturesPresentdayEnum,
++	SurfaceforcingsDelta18oTemperaturesLgmEnum,
++	SurfaceforcingsDelta18oSurfaceEnum,
++	SurfaceforcingsIsdelta18oEnum,
++	SurfaceforcingsPrecipitationsPresentdayEnum,
+ 	DebugProfilingEnum,
+ 	ProfilingCurrentMemEnum,
+ 	ProfilingCurrentFlopsEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h	(revision 12748)
+@@ -12,7 +12,13 @@
+ 
+ IssmDouble Paterson(IssmDouble temperature);
+ IssmDouble Arrhenius(IssmDouble temperature,IssmDouble depth,IssmDouble n);
+-IssmDouble PddSurfaceMassBlance(IssmDouble* monthlytemperatures,  IssmDouble* monthlyprec, IssmDouble* pdds, IssmDouble* pds, IssmDouble signorm, IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble rho_ice, IssmDouble rho_water);
++IssmDouble PddSurfaceMassBlance(IssmDouble* monthlytemperatures,  IssmDouble* monthlyprec, IssmDouble* pdds, IssmDouble* pds, 
++				IssmDouble signorm, IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble rho_ice, IssmDouble rho_water);
++void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
++				     IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime, 
++				     IssmDouble* PrecipitationsPresentday,
++				     IssmDouble* Delta18oTemperaturesLgm, IssmDouble* Delta18oTemperaturesPresentday, 
++					     IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout);
+ void   GetVerticesCoordinates(IssmDouble* xyz,  Node** nodes, int numvertices);
+ int    GetNumberOfDofs( Node** nodes,int numnodes,int setenum,int approximation_enum);
+ int*   GetLocalDofList( Node** nodes,int numnodes,int setenum,int approximation_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 12748)
+@@ -0,0 +1,30 @@
++/* file:  ComputeTemperaturePrecipitation.cpp
++   Compute the temperature and precipitation at time t from 
++   the data at present day and delta18O
++ */
++
++#include "./elements.h"
++
++void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
++				     IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime, 
++				     IssmDouble* PrecipitationsPresentday,
++				     IssmDouble* Delta18oTemperaturesLgm, IssmDouble* Delta18oTemperaturesPresentday, 
++				     IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout){
++
++  IssmDouble monthlytemperaturestmp[12],monthlyprectmp[12];
++  IssmDouble delta18oLapseRate=-6.2*pow(10.,-3);
++  IssmDouble glacialindex; // used to vary present day temperature
++
++  glacialindex = (Delta18oTime-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceTime-Delta18oSurfacePresent))
++    /(Delta18oLgm-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceLgm-Delta18oSurfacePresent));
++  
++  for (int imonth = 0; imonth<12; imonth++){  
++    monthlytemperaturestmp[imonth] = glacialindex*Delta18oTemperaturesLgm[imonth] + (1-glacialindex)*Delta18oTemperaturesPresentday[imonth];
++    monthlyprectmp[imonth] = 1.5*pow(2,((monthlytemperaturestmp[imonth]-0)/10)); //equation from rob's paper
++    /*Assign output pointer*/
++    *(monthlytemperaturesout+imonth) = monthlytemperaturestmp[imonth];
++    *(monthlyprecout+imonth) = monthlyprectmp[imonth];
++  }
++
++
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 12748)
+@@ -42,7 +42,7 @@
+   IssmDouble pdd = 0.;     
+   IssmDouble frzndd = 0.;  
+   
+-  IssmDouble tstar;                        // monthly mean surface temp
++  IssmDouble tstar;          // monthly mean surface temp
+   IssmDouble Tsum= 0.;       // average summer (JJA) temperature
+   IssmDouble Tsurf = 0.;     // average annual temperature    
+   
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12748)
+@@ -157,6 +157,12 @@
+ 	      else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
+ 	      else if (strcmp(name,"SettingsResultsAsPatches")==0) return SettingsResultsAsPatchesEnum;
+ 	      else if (strcmp(name,"SettingsWaitonlock")==0) return SettingsWaitonlockEnum;
++	      else if (strcmp(name,"SurfaceforcingsDelta18o")==0) return SurfaceforcingsDelta18oEnum;
++	      else if (strcmp(name,"SurfaceforcingsDelta18oTemperaturesPresentday")==0) return SurfaceforcingsDelta18oTemperaturesPresentdayEnum;
++	      else if (strcmp(name,"SurfaceforcingsDelta18oTemperaturesLgm")==0) return SurfaceforcingsDelta18oTemperaturesLgmEnum;
++	      else if (strcmp(name,"SurfaceforcingsDelta18oSurface")==0) return SurfaceforcingsDelta18oSurfaceEnum;
++	      else if (strcmp(name,"SurfaceforcingsIsdelta18o")==0) return SurfaceforcingsIsdelta18oEnum;
++	      else if (strcmp(name,"SurfaceforcingsPrecipitationsPresentday")==0) return SurfaceforcingsPrecipitationsPresentdayEnum;
+ 	      else if (strcmp(name,"DebugProfiling")==0) return DebugProfilingEnum;
+ 	      else if (strcmp(name,"ProfilingCurrentMem")==0) return ProfilingCurrentMemEnum;
+ 	      else if (strcmp(name,"ProfilingCurrentFlops")==0) return ProfilingCurrentFlopsEnum;
+@@ -254,16 +260,16 @@
+ 	      else if (strcmp(name,"Contour")==0) return ContourEnum;
+ 	      else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
+ 	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
+-	      else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
++         else stage=3;
++   }
++   if(stage==3){
++	      if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
+ 	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
+ 	      else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
+ 	      else if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum;
+ 	      else if (strcmp(name,"DoubleParam")==0) return DoubleParamEnum;
+ 	      else if (strcmp(name,"DoubleVecParam")==0) return DoubleVecParamEnum;
+-         else stage=3;
+-   }
+-   if(stage==3){
+-	      if (strcmp(name,"Element")==0) return ElementEnum;
++	      else if (strcmp(name,"Element")==0) return ElementEnum;
+ 	      else if (strcmp(name,"ElementResult")==0) return ElementResultEnum;
+ 	      else if (strcmp(name,"ExternalResult")==0) return ExternalResultEnum;
+ 	      else if (strcmp(name,"FileParam")==0) return FileParamEnum;
+@@ -377,16 +383,16 @@
+ 	      else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
+ 	      else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
+ 	      else if (strcmp(name,"TransientInput")==0) return TransientInputEnum;
+-	      else if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum;
++         else stage=4;
++   }
++   if(stage==4){
++	      if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum;
+ 	      else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum;
+ 	      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 stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
++	      else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
+ 	      else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
+ 	      else if (strcmp(name,"StressTensor")==0) return StressTensorEnum;
+ 	      else if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12748)
+@@ -153,6 +153,12 @@
+ 		case SettingsOutputFrequencyEnum : return "SettingsOutputFrequency";
+ 		case SettingsResultsAsPatchesEnum : return "SettingsResultsAsPatches";
+ 		case SettingsWaitonlockEnum : return "SettingsWaitonlock";
++		case SurfaceforcingsDelta18oEnum : return "SurfaceforcingsDelta18o";
++		case SurfaceforcingsDelta18oTemperaturesPresentdayEnum : return "SurfaceforcingsDelta18oTemperaturesPresentday";
++		case SurfaceforcingsDelta18oTemperaturesLgmEnum : return "SurfaceforcingsDelta18oTemperaturesLgm";
++		case SurfaceforcingsDelta18oSurfaceEnum : return "SurfaceforcingsDelta18oSurface";
++		case SurfaceforcingsIsdelta18oEnum : return "SurfaceforcingsIsdelta18o";
++		case SurfaceforcingsPrecipitationsPresentdayEnum : return "SurfaceforcingsPrecipitationsPresentday";
+ 		case DebugProfilingEnum : return "DebugProfiling";
+ 		case ProfilingCurrentMemEnum : return "ProfilingCurrentMem";
+ 		case ProfilingCurrentFlopsEnum : return "ProfilingCurrentFlops";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h	(revision 12748)
+@@ -24,6 +24,7 @@
+ #include "./CostFunctionx/CostFunctionx.h"
+ #include "./CreateNodalConstraintsx/CreateNodalConstraintsx.h"
+ #include "./DakotaResponsesx/DakotaResponsesx.h"
++#include "./Delta18oParameterizationx/Delta18oParameterizationx.h"
+ #include "./DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h"
+ #include "./ElementConnectivityx/ElementConnectivityx.h"
+ #include "./EnumToStringx/EnumToStringx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 12748)
+@@ -19,7 +19,6 @@
+ 	int    numberofelements;
+ 	int    stabilization;
+ 	bool   dakota_analysis;
+-	bool   ispdd;
+ 	bool   issmbgradients;
+ 
+ 	/*Fetch data needed: */
+@@ -28,7 +27,6 @@
+ 	iomodel->Constant(&stabilization,PrognosticStabilizationEnum);
+ 	iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum);
+ 	iomodel->FetchData(1,MeshElementsEnum);
+-	iomodel->Constant(&ispdd,SurfaceforcingsIspddEnum);
+ 	iomodel->Constant(&issmbgradients,SurfaceforcingsIssmbgradientsEnum);
+ 
+ 	/*Update elements: */
+@@ -68,24 +66,18 @@
+ 		iomodel->FetchDataToInput(elements,PressureEnum);
+ 		iomodel->FetchDataToInput(elements,TemperatureEnum);
+ 	}
+-	if(ispdd){
+-	  iomodel->FetchDataToInput(elements,VyEnum); 
+-	  iomodel->FetchDataToInput(elements,ThermalSpctemperatureEnum);
+-	  iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationEnum);
+-	  iomodel->FetchDataToInput(elements,SurfaceforcingsMonthlytemperaturesEnum);
+-	}
+ 	if(issmbgradients){
+-	  iomodel->FetchDataToInput(elements,SurfaceforcingsHcEnum);
+-	  iomodel->FetchDataToInput(elements,SurfaceforcingsSmbPosMaxEnum);
+-	  iomodel->FetchDataToInput(elements,SurfaceforcingsSmbPosMinEnum);
+-	  iomodel->FetchDataToInput(elements,SurfaceforcingsAPosEnum);
+-	  iomodel->FetchDataToInput(elements,SurfaceforcingsBPosEnum);
+-	  iomodel->FetchDataToInput(elements,SurfaceforcingsANegEnum);
+-	  iomodel->FetchDataToInput(elements,SurfaceforcingsBNegEnum);
++	        iomodel->FetchDataToInput(elements,SurfaceforcingsHcEnum);
++	        iomodel->FetchDataToInput(elements,SurfaceforcingsSmbPosMaxEnum);
++	        iomodel->FetchDataToInput(elements,SurfaceforcingsSmbPosMinEnum);
++	        iomodel->FetchDataToInput(elements,SurfaceforcingsAPosEnum);
++	        iomodel->FetchDataToInput(elements,SurfaceforcingsBPosEnum);
++	        iomodel->FetchDataToInput(elements,SurfaceforcingsANegEnum);
++	        iomodel->FetchDataToInput(elements,SurfaceforcingsBNegEnum);
+ 	}
+-	else{
+-		iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
+-	}
++	//else{
++	//	iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
++	//}
+ 
+ 	/*Free data: */
+ 	iomodel->DeleteData(1,MeshElementsEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp	(revision 12748)
+@@ -15,6 +15,30 @@
+ 
+ void	UpdateElementsTransient(Elements* elements, Parameters* parameters,IoModel* iomodel,int analysis_counter,int analysis_type){
+ 
+-	/*nothing for now: */
++	bool   ispdd;
++	bool   isdelta18o;
++	IssmDouble *size, Delta18oTimeSerie,Delta18oSurfaceTimeSerie ;
+ 
++	/*Fetch data needed: */
++	iomodel->Constant(&ispdd,SurfaceforcingsIspddEnum);
++	iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
++
++	if(ispdd){
++	        iomodel->FetchDataToInput(elements,ThermalSpctemperatureEnum);
++	        if(isdelta18o){
++	                  iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oEnum);
++	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oSurfaceEnum);
++ 
++	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oTemperaturesLgmEnum);
++	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oTemperaturesPresentdayEnum);
++	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationsPresentdayEnum);
++	        }
++	        else{
++	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationEnum);
++	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsMonthlytemperaturesEnum);
++	        }
++	}
++	else{
++		iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
++	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 12748)
+@@ -24,7 +24,10 @@
+ 	int         numoutputs;
+ 	Parameters *parameters       = NULL;
+ 	IssmDouble     *requestedoutputs = NULL;
+-	
++	bool   isdelta18o;
++	IssmDouble *Delta18oT, *Delta18oSurfaceT;
++	int nlinesD18o, ncolsD18o, nlinesD18osurf, ncolsD18osurf;
++
+ 	if(*pparameters)return; //do not create parameters twice!
+ 
+ 	/*Initialize dataset: */
+@@ -89,8 +92,20 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject(InversionIscontrolEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(InversionTaoEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIspddEnum));
++	parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIsdelta18oEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIssmbgradientsEnum));
+ 
++	iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
++	if(isdelta18o){
++	        iomodel->FetchData(&Delta18oT,&nlinesD18o,&ncolsD18o,SurfaceforcingsDelta18oEnum);
++	        _assert_(nlinesD18o==2);
++	        parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oEnum,&Delta18oT[0],&Delta18oT[ncolsD18o],ncolsD18o));
++	          
++	        iomodel->FetchData(&Delta18oSurfaceT,&nlinesD18osurf,&ncolsD18osurf,SurfaceforcingsDelta18oSurfaceEnum);
++	        _assert_(nlinesD18osurf==2);
++	        parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oSurfaceEnum,&Delta18oSurfaceT[0],&Delta18oSurfaceT[ncolsD18osurf],ncolsD18osurf));
++	}
++
+ 	/*some parameters that did not come with the iomodel: */
+ 	parameters->AddObject(new IntParam(SolutionTypeEnum,solution_type));
+ 	parameters->AddObject(new IntParam(AnalysisTypeEnum,analysis_type));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp	(revision 12748)
+@@ -0,0 +1,23 @@
++/*!\file Delta18oParameterizationx
++ * \brief: Create past temperature field from present day fields
++ */
++
++#include "./Delta18oParameterizationx.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../io/io.h"
++#include "../../toolkits/toolkits.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++void Delta18oParameterizationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){
++
++  /*Intermediary*/
++  int    i;
++  Element* element = NULL;
++ 
++  /*Compute temperature and precipitation fields: */
++  for(i=0;i<elements->Size();i++){
++    element=(Element*)elements->GetObjectByOffset(i);
++    element->Delta18oParameterization();
++  }  
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h	(revision 12748)
+@@ -0,0 +1,14 @@
++/*!\file:  Delta18oParameterizationx.cpp
++ * \brief header file for 
++ */ 
++
++#ifndef _DELTA18OPARAMETERIZATIONX_H
++#define _DELTA18OPARAMETERIZATIONX_H
++
++#include "../../Container/Container.h"
++#include "../../objects/objects.h"
++
++/* local prototypes: */
++void Delta18oParameterizationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
++
++#endif  /* _DELTA18OPARAMETERIZATIONX_H*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12748)
+@@ -211,6 +211,7 @@
+ 					./shared/Elements/GetGlobalDofList.cpp\
+ 					./shared/Elements/GetNumberOfDofs.cpp\
+ 					./shared/Elements/PddSurfaceMassBalance.cpp\
++					./shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp\
+ 					./shared/String/sharedstring.h\
+ 					./shared/Wrapper/wrappershared.h\
+ 					./shared/Wrapper/ModuleBoot.cpp\
+@@ -293,6 +294,8 @@
+ 					./modules/SpcNodesx/SpcNodesx.cpp\
+ 					./modules/PositiveDegreeDayx/PositiveDegreeDayx.h\
+ 					./modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp\
++					./modules/Delta18oParameterizationx/Delta18oParameterizationx.h\
++					./modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp\
+ 					./modules/SmbGradientsx/SmbGradientsx.h\
+ 					./modules/SmbGradientsx/SmbGradientsx.cpp\
+ 					./modules/UpdateConstraintsx/UpdateConstraintsx.h\
+@@ -817,7 +820,7 @@
+ #Matlab and Petsc sources  {{{
+ matlabpetsc_sources= ./matlab/io/MatlabMatrixToPetscMatrix.cpp\
+ 					 ./matlab/io/MatlabVectorToPetscVector.cpp
+-	
++
+ #}}}
+ #Modules sources{{{
+ module_sources= ./objects/Options/Option.cpp\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h	(revision 12748)
+@@ -71,6 +71,7 @@
+ 		virtual void   MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding)=0;
+ 		virtual void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding)=0;
+ 		virtual void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm)=0;
++		virtual void   Delta18oParameterization(void)=0;
+ 		virtual void   SmbGradients()=0;
+ 		virtual int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
+ 		virtual void   ResetCoordinateSystem()=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12748)
+@@ -907,6 +907,66 @@
+ 
+ }
+ /*}}}*/
++/*FUNCTION Tria::Delta18oParameterization{{{*/
++void  Tria::Delta18oParameterization(void){
++
++        IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
++	IssmDouble Delta18oTemperaturesPresentday[NUMVERTICES][12],Delta18oTemperaturesLgm[NUMVERTICES][12];
++	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
++	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
++	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
++        IssmDouble time,yts,finaltime;
++        this->parameters->FindParam(&time,TimeEnum);
++        this->parameters->FindParam(&yts,ConstantsYtsEnum);
++        this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
++
++        /*Recover present day temperature and precipitation*/
++        Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
++        Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
++        Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
++        GaussTria* gauss=new GaussTria();
++        for(int month=0;month<12;month++) {
++                for(int iv=0;iv<NUMVERTICES;iv++) {
++                	gauss->GaussVertex(iv);
++                	input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
++                	input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
++                	input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
++                	monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++                }
++        }
++
++        /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
++	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
++	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
++	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
++	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
++	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
++	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
++   
++        /*Compute the temperature and precipitation*/
++        for(int iv=0;iv<NUMVERTICES;iv++){
++          ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
++        				      Delta18oPresent, Delta18oLgm, Delta18oTime,
++        				      &PrecipitationsPresentday[iv][0], 
++        				      &Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
++        				      &monthlytemperatures[iv][0], &monthlyprec[iv][0]);
++        }
++  
++        /*Update inputs*/ 
++	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
++	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
++	for (int imonth=0;imonth<12;imonth++) {
++                for(int iv=0;iv<NUMVERTICES;iv++) {
++	                TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
++		        NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
++	                TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
++		        NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
++		}
++	}
++	this->inputs->AddInput(NewTemperatureInput);
++	this->inputs->AddInput(NewPrecipitationInput);
++}
++/*}}}*/
+ /*FUNCTION Tria::Echo{{{*/
+ void Tria::Echo(void){
+ 	_printLine_("Tria:");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h	(revision 12748)
+@@ -79,6 +79,7 @@
+ 		void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
+ 		void   CreatePVector(Vector* pf);
+ 		void   CreateJacobianMatrix(Matrix* Jff);
++		void   Delta18oParameterization(void);
+ 		int    GetNodeIndex(Node* node);
+ 		int    Sid();
+ 		bool   IsOnBed();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12748)
+@@ -684,6 +684,66 @@
+ 
+ }
+ /*}}}*/
++/*FUNCTION Penta::Delta18oParameterization{{{*/
++void  Penta::Delta18oParameterization(void){
++
++        IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
++	IssmDouble Delta18oTemperaturesPresentday[NUMVERTICES][12],Delta18oTemperaturesLgm[NUMVERTICES][12];
++	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
++	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
++	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
++        IssmDouble time,yts,finaltime;
++        this->parameters->FindParam(&time,TimeEnum);
++        this->parameters->FindParam(&yts,ConstantsYtsEnum);
++        this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
++
++        /*Recover present day temperature and precipitation*/
++        Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
++        Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
++        Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
++        GaussPenta* gauss=new GaussPenta();
++        for(int month=0;month<12;month++) {
++          for(int iv=0;iv<NUMVERTICES;iv++) {
++        	gauss->GaussVertex(iv);
++        	input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
++        	input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
++        	input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
++        	monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++          }
++        }
++        
++        /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
++	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
++	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
++	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
++	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
++	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
++	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
++
++        /*Compute the temperature and precipitation*/
++        for(int iv=0;iv<NUMVERTICES;iv++){
++          ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
++        				      Delta18oPresent, Delta18oLgm, Delta18oTime,
++        				      &PrecipitationsPresentday[iv][0], 
++        				      &Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
++        				      &monthlytemperatures[iv][0], &monthlyprec[iv][0]);
++        }
++  
++        /*Update inputs*/ 
++	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
++	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
++	for (int imonth=0;imonth<12;imonth++) {
++                for(int iv=0;iv<NUMVERTICES;iv++) {
++	                PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
++		        NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
++	                PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
++		        NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
++		}
++	}
++	this->inputs->AddInput(NewTemperatureInput);
++	this->inputs->AddInput(NewPrecipitationInput);
++}
++/*}}}*/
+ /*FUNCTION Penta::Echo{{{*/
+ 
+ void Penta::Echo(void){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h	(revision 12748)
+@@ -83,6 +83,7 @@
+ 		void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
+ 		void   CreatePVector(Vector* pf);
+ 		void   CreateJacobianMatrix(Matrix* Jff);
++		void   Delta18oParameterization(void);
+ 		void   DeleteResults(void);
+ 		int    GetNodeIndex(Node* node);
+ 		void   GetSolutionFromInputs(Vector* solution);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsIsdelta18oEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsIsdelta18oEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsIsdelta18oEnum.m	(revision 12748)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsIsdelta18oEnum()
++%SURFACEFORCINGSISDELTA18OENUM - Enum of SurfaceforcingsIsdelta18o
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsIsdelta18oEnum()
++
++macro=StringToEnum('SurfaceforcingsIsdelta18o');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oEnum.m	(revision 12748)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsDelta18oEnum()
++%SURFACEFORCINGSDELTA18OENUM - Enum of SurfaceforcingsDelta18o
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsDelta18oEnum()
++
++macro=StringToEnum('SurfaceforcingsDelta18o');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oSurfaceEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oSurfaceEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oSurfaceEnum.m	(revision 12748)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsDelta18oSurfaceEnum()
++%SURFACEFORCINGSDELTA18OSURFACEENUM - Enum of SurfaceforcingsDelta18oSurface
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsDelta18oSurfaceEnum()
++
++macro=StringToEnum('SurfaceforcingsDelta18oSurface');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsPrecipitationsPresentdayEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsPrecipitationsPresentdayEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsPrecipitationsPresentdayEnum.m	(revision 12748)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsPrecipitationsPresentdayEnum()
++%SURFACEFORCINGSPRECIPITATIONSPRESENTDAYENUM - Enum of SurfaceforcingsPrecipitationsPresentday
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsPrecipitationsPresentdayEnum()
++
++macro=StringToEnum('SurfaceforcingsPrecipitationsPresentday');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m	(revision 12748)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsDelta18oTemperaturesPresentdayEnum()
++%SURFACEFORCINGSDELTA18OTEMPERATURESPRESENTDAYENUM - Enum of SurfaceforcingsDelta18oTemperaturesPresentday
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsDelta18oTemperaturesPresentdayEnum()
++
++macro=StringToEnum('SurfaceforcingsDelta18oTemperaturesPresentday');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m	(revision 12748)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsDelta18oTemperaturesLgmEnum()
++%SURFACEFORCINGSDELTA18OTEMPERATURESLGMENUM - Enum of SurfaceforcingsDelta18oTemperaturesLgm
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsDelta18oTemperaturesLgmEnum()
++
++macro=StringToEnum('SurfaceforcingsDelta18oTemperaturesLgm');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 12748)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=449;
++macro=455;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12748)
+@@ -1376,6 +1376,66 @@
+ 
+ 	return StringToEnum('SettingsWaitonlock')
+ 
++def SurfaceforcingsDelta18oEnum():
++	"""
++	SURFACEFORCINGSDELTA18OENUM - Enum of SurfaceforcingsDelta18o
++
++	   Usage:
++	      macro=SurfaceforcingsDelta18oEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsDelta18o')
++
++def SurfaceforcingsDelta18oTemperaturesPresentdayEnum():
++	"""
++	SURFACEFORCINGSDELTA18OTEMPERATURESPRESENTDAYENUM - Enum of SurfaceforcingsDelta18oTemperaturesPresentday
++
++	   Usage:
++	      macro=SurfaceforcingsDelta18oTemperaturesPresentdayEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsDelta18oTemperaturesPresentday')
++
++def SurfaceforcingsDelta18oTemperaturesLgmEnum():
++	"""
++	SURFACEFORCINGSDELTA18OTEMPERATURESLGMENUM - Enum of SurfaceforcingsDelta18oTemperaturesLgm
++
++	   Usage:
++	      macro=SurfaceforcingsDelta18oTemperaturesLgmEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsDelta18oTemperaturesLgm')
++
++def SurfaceforcingsDelta18oSurfaceEnum():
++	"""
++	SURFACEFORCINGSDELTA18OSURFACEENUM - Enum of SurfaceforcingsDelta18oSurface
++
++	   Usage:
++	      macro=SurfaceforcingsDelta18oSurfaceEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsDelta18oSurface')
++
++def SurfaceforcingsIsdelta18oEnum():
++	"""
++	SURFACEFORCINGSISDELTA18OENUM - Enum of SurfaceforcingsIsdelta18o
++
++	   Usage:
++	      macro=SurfaceforcingsIsdelta18oEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsIsdelta18o')
++
++def SurfaceforcingsPrecipitationsPresentdayEnum():
++	"""
++	SURFACEFORCINGSPRECIPITATIONSPRESENTDAYENUM - Enum of SurfaceforcingsPrecipitationsPresentday
++
++	   Usage:
++	      macro=SurfaceforcingsPrecipitationsPresentdayEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsPrecipitationsPresentday')
++
+ def DebugProfilingEnum():
+ 	"""
+ 	DEBUGPROFILINGENUM - Enum of DebugProfiling
+@@ -4504,5 +4564,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 449
++	return 455
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m	(revision 12747)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m	(revision 12748)
+@@ -9,6 +9,7 @@
+ 		mass_balance  = NaN;
+ 		ispdd = 0;
+ 		issmbgradients = 0;
++		isdelta18o = 0;
+ 	   hc = NaN;
+ 		smb_pos_max = NaN;
+ 		smb_pos_min = NaN;
+@@ -17,6 +18,11 @@
+ 		a_neg = NaN;
+ 		b_neg = NaN;
+ 		monthlytemperatures = NaN;
++		delta18o = NaN;
++		delta18o_surface = NaN;
++		temperatures_presentday = NaN;
++		temperatures_lgm = NaN;
++		precipitations_presentday = NaN;
+ 	end
+ 	methods
+ 		function obj = surfaceforcings(varargin) % {{{
+@@ -32,6 +38,7 @@
+ 		  %pdd method not used in default mode
+ 		  obj.ispdd=0;
+ 		  obj.issmbgradients=0;
++		  obj.isdelta18o=0;
+ 
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+@@ -40,7 +47,16 @@
+ 				md = checkfield(md,'surfaceforcings.ispdd','numel',1,'values',[0 1]);
+ 				checkfield(md,'surfaceforcings.issmbgradients','numel',1,'values',[0 1]);
+ 				if(obj.ispdd)
+-					md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1);
++				        if(obj.isdelta18o==0)
++				        	md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1);
++				        	md = checkfield(md,'surfaceforcings.precipitation','forcing',1,'NaN',1);
++			                else
++				                md = checkfield(md,'surfaceforcings.delta18o','NaN',1);
++				        	md = checkfield(md,'surfaceforcings.delta18o_surface','NaN',1);
++				        	md = checkfield(md,'surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1);
++				        	md = checkfield(md,'surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1);
++				        	md = checkfield(md,'surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1);
++				        end
+ 				elseif(obj.issmbgradients)
+ 					checkfield(md,'surfaceforcings.hc','forcing',1,'NaN',1);
+ 					checkfield(md,'surfaceforcings.smb_pos_max','forcing',1,'NaN',1);
+@@ -60,10 +76,15 @@
+ 		function disp(obj) % {{{
+ 			disp(sprintf('   surface forcings parameters:'));
+ 
+-			fielddisplay(obj,'precipitation','surface precipitation [m/yr water eq]');
+ 			fielddisplay(obj,'mass_balance','surface mass balance [m/yr ice eq]');
+ 			fielddisplay(obj,'ispdd','is pdd activated (0 or 1, default is 0)');
+-			fielddisplay(obj,'monthlytemperatures','monthly surface temperatures required if pdd is activated');
++			fielddisplay(obj,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)');
++			fielddisplay(obj,'monthlytemperatures','monthly surface temperatures [Kelvin], required if pdd is activated and delta18o not activated');
++			fielddisplay(obj,'precipitation','surface precipitation [m/yr water eq]');
++			fielddisplay(obj,'temperatures_presentday','monthly present day surface temperatures [Kelvin], required if pdd is activated and delta18o activated');
++			fielddisplay(obj,'temperatures_lgm','monthly LGM surface temperatures [Kelvin], required if pdd is activated and delta18o activated');
++			fielddisplay(obj,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o activated');
++			fielddisplay(obj,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated');
+ 			fielddisplay(obj,'issmbgradients','is smb gradients method activated (0 or 1, default is 0)');
+ 			fielddisplay(obj,'hc',' elevation of intersection between accumulation and ablation regime required if smb gradients is activated');
+ 			fielddisplay(obj,'smb_pos_max',' maximum value of positive smb required if smb gradients is activated');
+@@ -78,8 +99,17 @@
+ 			WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','mass_balance','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','ispdd','format','Boolean');
++			WriteData(fid,'object',obj,'fieldname','isdelta18o','format','Boolean');
+ 			if obj.ispdd,
++			  if obj.isdelta18o
++			        WriteData(fid,'object',obj,'fieldname','temperatures_presentday','format','DoubleMat','mattype',1);
++			        WriteData(fid,'object',obj,'fieldname','temperatures_lgm','format','DoubleMat','mattype',1);
++			        WriteData(fid,'object',obj,'fieldname','precipitations_presentday','format','DoubleMat','mattype',1);
++			        WriteData(fid,'object',obj,'fieldname','delta18o_surface','format','DoubleMat','mattype',1);
++			  else
+ 				WriteData(fid,'object',obj,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1);
++				WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1);
++			  end
+ 			end
+ 			WriteData(fid,'object',obj,'fieldname','issmbgradients','format','Boolean');
+ 			if obj.issmbgradients,
Index: /issm/oecreview/Archive/12678-13393/ISSM-12748-12749.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12748-12749.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12748-12749.diff	(revision 13394)
@@ -0,0 +1,20 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 12748)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 12749)
+@@ -4,14 +4,12 @@
+ rm -rf install
+ 
+ #Select or create a new simlink
+-#ln -s /usr/local/pkgs/matlab-7.6/ install
++ln -s /usr/local/pkgs/matlab-7.6/ install
+ #ln -s /discover/vis/mathworks/matlab_r2011b/ install
+ #ln -s /usr/local/matlab704/ install
+ #ln -s /usr/local/matlab711/ install
+ #ln -s /usr/local/matlab712/ install
+ 
+-ln -s /home/kevin/perso.dir/matlab10 install
+-
+ # Macintosh (OSX) simlink 
+ #ln -s /Applications/MATLAB_R2008a/ install
+ #ln -s /Applications/MATLAB_R2009a.app/ install
Index: /issm/oecreview/Archive/12678-13393/ISSM-12749-12750.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12749-12750.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12749-12750.diff	(revision 13394)
@@ -0,0 +1,24 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12749)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12750)
+@@ -1748,6 +1748,7 @@
+ 
+ 		/*Recover vertices ids needed to initialize inputs*/
+ 		for(i=0;i<3;i++){ 
++			_assert_(iomodel->Data(MeshElementsEnum));
+ 			tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab
+ 		}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12749)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12750)
+@@ -1277,6 +1277,7 @@
+ 
+ 		/*Recover vertices ids needed to initialize inputs*/
+ 		for(i=0;i<6;i++){ 
++			_assert_(iomodel->Data(MeshElementsEnum));
+ 			penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
+ 		}
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12750-12751.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12750-12751.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12750-12751.diff	(revision 13394)
@@ -0,0 +1,20 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp	(revision 12750)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp	(revision 12751)
+@@ -22,6 +22,7 @@
+ 	/*Fetch data needed: */
+ 	iomodel->Constant(&ispdd,SurfaceforcingsIspddEnum);
+ 	iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
++	iomodel->FetchData(1,MeshElementsEnum);
+ 
+ 	if(ispdd){
+ 	        iomodel->FetchDataToInput(elements,ThermalSpctemperatureEnum);
+@@ -41,4 +42,7 @@
+ 	else{
+ 		iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
+ 	}
++
++	/*Free data: */
++	iomodel->DeleteData(1,MeshElementsEnum);
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-12751-12752.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12751-12752.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12751-12752.diff	(revision 13394)
@@ -0,0 +1,272 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12751)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12752)
+@@ -910,61 +910,64 @@
+ /*FUNCTION Tria::Delta18oParameterization{{{*/
+ void  Tria::Delta18oParameterization(void){
+ 
+-        IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
++	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+ 	IssmDouble Delta18oTemperaturesPresentday[NUMVERTICES][12],Delta18oTemperaturesLgm[NUMVERTICES][12];
+ 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
+ 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
+ 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
+-        IssmDouble time,yts,finaltime;
+-        this->parameters->FindParam(&time,TimeEnum);
+-        this->parameters->FindParam(&yts,ConstantsYtsEnum);
+-        this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
++	IssmDouble time,yts,finaltime;
++	this->parameters->FindParam(&time,TimeEnum);
++	this->parameters->FindParam(&yts,ConstantsYtsEnum);
++	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+ 
+-        /*Recover present day temperature and precipitation*/
+-        Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
+-        Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
+-        Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
+-        GaussTria* gauss=new GaussTria();
+-        for(int month=0;month<12;month++) {
+-                for(int iv=0;iv<NUMVERTICES;iv++) {
+-                	gauss->GaussVertex(iv);
+-                	input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
+-                	input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
+-                	input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
+-                	monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
+-                }
+-        }
++	/*Recover present day temperature and precipitation*/
++	Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
++	Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
++	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
++	GaussTria* gauss=new GaussTria();
++	for(int month=0;month<12;month++) {
++		for(int iv=0;iv<NUMVERTICES;iv++) {
++			gauss->GaussVertex(iv);
++			input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
++			input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
++			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
++			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++		}
++	}
+ 
+-        /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
++	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
+ 	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
+ 	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
+ 	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
+ 	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
+ 	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
+ 	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
+-   
+-        /*Compute the temperature and precipitation*/
+-        for(int iv=0;iv<NUMVERTICES;iv++){
+-          ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
+-        				      Delta18oPresent, Delta18oLgm, Delta18oTime,
+-        				      &PrecipitationsPresentday[iv][0], 
+-        				      &Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
+-        				      &monthlytemperatures[iv][0], &monthlyprec[iv][0]);
+-        }
+-  
+-        /*Update inputs*/ 
++
++	/*Compute the temperature and precipitation*/
++	for(int iv=0;iv<NUMVERTICES;iv++){
++		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
++					Delta18oPresent, Delta18oLgm, Delta18oTime,
++					&PrecipitationsPresentday[iv][0], 
++					&Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
++					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
++	}
++
++	/*Update inputs*/ 
+ 	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
+ 	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
+ 	for (int imonth=0;imonth<12;imonth++) {
+-                for(int iv=0;iv<NUMVERTICES;iv++) {
+-	                TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
+-		        NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
+-	                TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
+-		        NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
++		for(int iv=0;iv<NUMVERTICES;iv++) {
++			TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
++			NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
++			TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
++			NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
+ 		}
+ 	}
+ 	this->inputs->AddInput(NewTemperatureInput);
+ 	this->inputs->AddInput(NewPrecipitationInput);
++
++	/*clean-up*/
++	delete gauss;
+ }
+ /*}}}*/
+ /*FUNCTION Tria::Echo{{{*/
+@@ -2038,18 +2041,17 @@
+ /*FUNCTION Tria::NodalValue {{{*/
+ int    Tria::NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units){
+ 
+-	int i;
+-	int found=0;
+-	IssmDouble value;
+-	Input* data=NULL;
+-	GaussTria *gauss                            = NULL;
++	int         found = 0;
++	IssmDouble  value;
++	Input      *data  = NULL;
++	GaussTria  *gauss = NULL;
+ 
+ 	/*First, serarch the input: */
+ 	data=inputs->GetInput(natureofdataenum); 
+ 
+ 	/*figure out if we have the vertex id: */
+ 	found=0;
+-	for(i=0;i<NUMVERTICES;i++){
++	for(int i=0;i<NUMVERTICES;i++){
+ 		if(index==nodes[i]->GetVertexId()){
+ 			/*Do we have natureofdataenum in our inputs? :*/
+ 			if(data){
+@@ -2062,6 +2064,9 @@
+ 		}
+ 	}
+ 
++	/*clean-up*/
++	delete gauss;
++
+ 	if(found)*pvalue=value;
+ 	return found;
+ }
+@@ -2187,6 +2192,9 @@
+    /*Update inputs*/    
+    this->inputs->AddInput(new TriaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0]));
+    // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
++
++	/*clean-up*/
++	delete gauss;
+ }
+ /*}}}*/
+ /*FUNCTION Tria::ProcessResultsUnits{{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12751)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12752)
+@@ -687,32 +687,32 @@
+ /*FUNCTION Penta::Delta18oParameterization{{{*/
+ void  Penta::Delta18oParameterization(void){
+ 
+-        IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
++	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+ 	IssmDouble Delta18oTemperaturesPresentday[NUMVERTICES][12],Delta18oTemperaturesLgm[NUMVERTICES][12];
+ 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
+ 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
+ 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
+-        IssmDouble time,yts,finaltime;
+-        this->parameters->FindParam(&time,TimeEnum);
+-        this->parameters->FindParam(&yts,ConstantsYtsEnum);
+-        this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
++	IssmDouble time,yts,finaltime;
++	this->parameters->FindParam(&time,TimeEnum);
++	this->parameters->FindParam(&yts,ConstantsYtsEnum);
++	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+ 
+-        /*Recover present day temperature and precipitation*/
+-        Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
+-        Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
+-        Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
+-        GaussPenta* gauss=new GaussPenta();
+-        for(int month=0;month<12;month++) {
+-          for(int iv=0;iv<NUMVERTICES;iv++) {
+-        	gauss->GaussVertex(iv);
+-        	input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
+-        	input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
+-        	input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
+-        	monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
+-          }
+-        }
+-        
+-        /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
++	/*Recover present day temperature and precipitation*/
++	Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
++	Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
++	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
++	GaussPenta* gauss=new GaussPenta();
++	for(int month=0;month<12;month++) {
++		for(int iv=0;iv<NUMVERTICES;iv++) {
++			gauss->GaussVertex(iv);
++			input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
++			input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
++			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
++			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++		}
++	}
++
++	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
+ 	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
+ 	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
+ 	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
+@@ -720,28 +720,31 @@
+ 	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
+ 	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
+ 
+-        /*Compute the temperature and precipitation*/
+-        for(int iv=0;iv<NUMVERTICES;iv++){
+-          ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
+-        				      Delta18oPresent, Delta18oLgm, Delta18oTime,
+-        				      &PrecipitationsPresentday[iv][0], 
+-        				      &Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
+-        				      &monthlytemperatures[iv][0], &monthlyprec[iv][0]);
+-        }
+-  
+-        /*Update inputs*/ 
++	/*Compute the temperature and precipitation*/
++	for(int iv=0;iv<NUMVERTICES;iv++){
++		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
++					Delta18oPresent, Delta18oLgm, Delta18oTime,
++					&PrecipitationsPresentday[iv][0], 
++					&Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
++					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
++	}
++
++	/*Update inputs*/ 
+ 	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
+ 	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
+ 	for (int imonth=0;imonth<12;imonth++) {
+-                for(int iv=0;iv<NUMVERTICES;iv++) {
+-	                PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
+-		        NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
+-	                PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
+-		        NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
++		for(int iv=0;iv<NUMVERTICES;iv++) {
++			PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
++			NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
++			PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
++			NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
+ 		}
+ 	}
+ 	this->inputs->AddInput(NewTemperatureInput);
+ 	this->inputs->AddInput(NewPrecipitationInput);
++
++	/*clean-up*/
++	delete gauss;
+ }
+ /*}}}*/
+ /*FUNCTION Penta::Echo{{{*/
+@@ -2260,6 +2263,7 @@
+ 		}
+ 	}
+ 
++	delete gauss;
+ 	if(found)*pvalue=value;
+ 	return found;
+ }
+@@ -2357,6 +2361,9 @@
+    this->inputs->AddInput(new PentaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0]));
+    //this->inputs->AddInput(new PentaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
+    this->InputExtrude(SurfaceforcingsMassBalanceEnum,ElementEnum);
++
++	/*clean-up*/
++	delete gauss;
+ }
+ /*}}}*/
+ /*FUNCTION Penta::PotentialSheetUngrounding{{{*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-12752-12753.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12752-12753.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12752-12753.diff	(revision 13394)
@@ -0,0 +1,545 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12752)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12753)
+@@ -1,37 +1,184 @@
+-#GENERIC cluster class definition
+-#
+-#   Usage:
+-#      cluster=generic('name','astrid',);
+-#      cluster=generic('name','astrid','np',3);
+-#      cluster=generic('name',oshostname(),'np',3,'login','username');
++"""
++GENERIC cluster class definition
++ 
++    Usage:
++       cluster=generic('name','astrid','np',3);
++       cluster=generic('name',oshostname(),'np',3,'login','username');
++"""
+ 
++import socket
++import os
++import math
++import platform
++import subprocess
++from issmdir import *
++from pairoptions import *
++from issmssh import *
++from issmscpin import *
++from issmscpout import *
+ 
+-class generic:
+-	#properties
+-	def __init__(self):
+-		# {{{ Properties
++class generic(object):
++	def __init__(self,*args):    # {{{
++
+ 		self.name=''
+ 		self.login=''
+ 		self.np=1
+ 		self.port=0
+ 		self.interactive=1
+-		self.codepath=issmdir() + '/bin'
+-		self.executionpath=issmdir() + '/execution'
+-		self.valgrind=issmdir() + '/externalpackages/valgrind/install/bin/valgrind'
+-		self.valgrindlib=issmdir() + '/externalpackages/valgrind/install/lib/libmpidebug.so'
+-		self.valgrindsup=issmdir() + '/externalpackages/valgrind/issm.supp'
+-		#}}}
+-	def __repr__(obj):
+-		# {{{ Display
+-		
+-		string="class 'generic' object:"
+-		string="%s\n\n%s"%(string,"%s%s"%('    name: ',obj.name))
+-		string="%s\n%s"%(string,"%s%i"%('    np: ',obj.np))
+-		string="%s\n%s"%(string,"%s%i"%('    port: ',obj.port))
+-		string="%s\n%s"%(string,"%s%s"%('    codepath: ',obj.codepath))
+-		string="%s\n%s"%(string,"%s%s"%('    executionpath: ',obj.executionpath))
+-		string="%s\n%s"%(string,"%s%s"%('    valgrind: ',obj.valgrind))
+-		string="%s\n%s"%(string,"%s%s"%('    valgrindlib: ',obj.valgrindlib))
+-		string="%s\n%s"%(string,"%s%s"%('    valgrindsup: ',obj.valgrindsup))
+-		return string
+-		#}}}
++		self.codepath=issmdir()+'/bin'
++		self.executionpath=issmdir()+'/execution'
++		self.valgrind=issmdir()+'/externalpackages/valgrind/install/bin/valgrind'
++		self.valgrindlib=issmdir()+'/externalpackages/valgrind/install/lib/libmpidebug.so'
++		self.valgrindsup=issmdir()+'/externalpackages/valgrind/issm.supp'
++
++		#use provided options to change fields
++		options=pairoptions(*args)
++
++		#get name
++		self.name=options.getfieldvalue('name',socket.gethostname().lower().split('.')[0])
++
++		#initialize cluster using user settings if provided
++		if os.path.exists(self.name+'_settings.py'):
++			execfile(self.name+'_settings.py',globals())
++
++		#OK get other fields
++		cluster=options.AssignObjectFields(cluster)
++	# }}}
++
++	def __repr__(self):    # {{{
++		#  display the object
++		print "class '%s' object '%s' = " % (type(self),'self')
++		print "    name: %s" % self.name
++		print "    login: %s" % self.login
++		print "    np: %i" % self.np
++		print "    port: %i" % self.port
++		print "    codepath: %s" % self.codepath
++		print "    executionpath: %s" % self.executionpath
++		print "    valgrind: %s" % self.valgrind
++		print "    valgrindlib: %s" % self.valgrindlib
++		print "    valgrindsup: %s" % self.valgrindsup
++	# }}}
++
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		if self.np<1:
++			md = checkmessage(md,'number of processors should be at least 1')
++		if math.isnan(self.np):
++			md = checkmessage(md,'number of processors should not be NaN!')
++
++		return md
++	# }}}
++
++	def BuildQueueScript(self,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
++
++		#write queuing script 
++		if not 'Windows' in platform.system():
++
++			fid=open(modelname+'.queue','w')
++			fid.write('#!/bin/sh\n')
++			if not isvalgrind:
++				if self.interactive:
++					fid.write('mpiexec -np %i %s/issm.exe %s %s %s ' % (self.np,self.codepath,EnumToString(solution),self.executionpath,modelname))
++				else:
++					fid.write('mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
++			elif isgprof:
++				fid.write('\n gprof %s/issm.exe gmon.out > %s.performance' % (self.codepath,modelname))
++			else:
++				#Add --gen-suppressions=all to get suppression lines
++				fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
++				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % \
++					(self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
++			if not io_gather:    #concatenate the output files:
++				fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname))
++			fid.close()
++
++		else:    # Windows
++
++			fid=open(modelname+'.bat','w')
++			fid.write('@echo off\n')
++			if self.interactive:
++				fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution),self.executionpath,modelname))
++			else:
++				fid.write('"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog' % \
++					(self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
++			fid.close()
++
++		#in interactive mode, create a run file, and errlog and outlog file
++		if self.interactive:
++			fid=open(modelname+'.errlog','w')
++			fid.close()
++			fid=open(modelname+'.outlog','w')
++			fid.close()
++	# }}}
++
++	def BuildKrigingQueueScript(self,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
++
++		#write queuing script 
++		if not 'Windows' in platform.system():
++
++			fid=open(modelname+'.queue','w')
++			fid.write('#!/bin/sh\n')
++			if not isvalgrind:
++				if self.interactive:
++					fid.write('mpiexec -np %i %s/kriging.exe %s %s ' % (self.np,self.codepath,self.executionpath,modelname))
++				else:
++					fid.write('mpiexec -np %i %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,self.executionpath,modelname,modelname,modelname))
++			elif isgprof:
++				fid.write('\n gprof %s/kriging.exe gmon.out > %s.performance' & (self.codepath,modelname))
++			else:
++				#Add --gen-suppressions=all to get suppression lines
++				fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
++				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ' % \
++					(self.np,self.valgrind,self.valgrindsup,self.codepath,self.executionpath,modelname,modelname,modelname))
++			if not io_gather:    #concatenate the output files:
++				fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname))
++			fid.close()
++
++		else:    # Windows
++
++			fid=open(modelname+'.bat','w')
++			fid.write('@echo off\n')
++			if self.interactive:
++				fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution),self.executionpath,modelname))
++			else:
++				fid.write('"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog' % \
++					(self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
++			fid.close()
++
++		#in interactive mode, create a run file, and errlog and outlog file
++		if self.interactive:
++			fid=open(modelname+'.errlog','w')
++			fid.close()
++			fid=open(modelname+'.outlog','w')
++			fid.close()
++	# }}}
++
++	def LaunchQueueJob(self,modelname,dirname,filelist):    # {{{
++
++		#compress the files into one zip.
++		compressstring='tar -zcf %s.tar.gz ' % dirname
++		for file in filelist:
++			compressstring += ' %s' % file
++		if self.interactive:
++			compressstring += ' %s.errlog %s.outlog ' % (modelname,modelname)
++		subprocess.call(compressstring,shell=True)
++
++		print 'uploading input file and queueing script'
++		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
++
++		print 'launching solution sequence on remote cluster'
++		launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && source  %s.queue ' % \
++			(self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname)
++		issmssh(self.name,self.login,self.port,launchcommand)
++	# }}}
++
++	def Download(self,dirname,filelist):     # {{{
++
++		if 'Windows' in platform.system():
++			#do nothing
++			return
++
++		#copy files from cluster to current directory
++		directory='%s/%s/' % (self.executionpath,dirname)
++		issmscpin(self.name,self.login,self.port,directory,filelist)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 12752)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 12753)
+@@ -5,172 +5,172 @@
+ %      cluster=generic('name',oshostname(),'np',3,'login','username');
+ 
+ classdef generic
+-    properties (SetAccess=public) 
+-		 % {{{
+-		 name='';
+-		 login='';
+-		 np=1;
+-		 port=0;
+-		 interactive=1;
+-		 codepath=[issmdir() '/bin'];
+-		 executionpath=[issmdir() '/execution'];
+-		 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
+-		 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
+-		 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
+-		 %}}}
+-	 end
+-	 methods
+-		 function cluster=generic(varargin) % {{{
++	properties (SetAccess=public) 
++		% {{{
++		name='';
++		login='';
++		np=1;
++		port=0;
++		interactive=1;
++		codepath=[issmdir() '/bin'];
++		executionpath=[issmdir() '/execution'];
++		valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
++		valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
++		valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
++		%}}}
++	end
++	methods
++		function cluster=generic(varargin) % {{{
+ 
+-			 %use provided options to change fields
+-			 options=pairoptions(varargin{:});
++			%use provided options to change fields
++			options=pairoptions(varargin{:});
+ 
+-			 %get name
+-			 cluster.name=getfieldvalue(options,'name',oshostname());
++			%get name
++			cluster.name=getfieldvalue(options,'name',oshostname());
+ 
+-			 %initialize cluster using user settings if provided
+-			 if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end
++			%initialize cluster using user settings if provided
++			if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end
+ 
+-			 %OK get other fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    np: %i',cluster.np));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    valgrind: %s',cluster.valgrind));
+-			 disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
+-			 disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+-			 if cluster.np<1
+-				 md = checkmessage(md,['number of processors should be at least 1']);
+-			 end
+-			 if isnan(cluster.np),
+-				 checkessage('number of processors should not be NaN!');
+-			 end
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++			%OK get other fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    np: %i',cluster.np));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    valgrind: %s',cluster.valgrind));
++			disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
++			disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
++			if cluster.np<1
++				md = checkmessage(md,['number of processors should be at least 1']);
++			end
++			if isnan(cluster.np),
++				checkessage('number of processors should not be NaN!');
++			end
++		end
++		%}}}
++		function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+-			 %write queuing script 
+-			 if ~ispc,
++			%write queuing script 
++			if ~ispc,
+ 
+-				 fid=fopen([modelname '.queue'],'w');
+-				 fprintf(fid,'#!/bin/sh\n');
+-				 if ~isvalgrind,
+-					 if cluster.interactive
+-						 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+-					 else
+-						 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+-					 end
+-				 elseif isgprof,
+-					 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
+-				 else
+-					 %Add --gen-suppressions=all to get suppression lines
+-					 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+-					 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
+-						 cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+-				 end
+-				 if ~io_gather, %concatenate the output files:
+-					 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
+-				 end
+-				 fclose(fid);
++				fid=fopen([modelname '.queue'],'w');
++				fprintf(fid,'#!/bin/sh\n');
++				if ~isvalgrind,
++					if cluster.interactive
++						fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++					else
++						fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++					end
++				elseif isgprof,
++					fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
++				else
++					%Add --gen-suppressions=all to get suppression lines
++					fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
++					fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
++						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++				end
++				if ~io_gather, %concatenate the output files:
++					fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
++				end
++				fclose(fid);
+ 
+-			 else % Windows
++			else % Windows
+ 
+-				 fid=fopen([modelname '.bat'],'w');
+-				 fprintf(fid,'@echo off\n');
+-				 if cluster.interactive
+-					 fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+-				 else
+-					 fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
+-						 cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+-				 end
+-				 fclose(fid);
+-			 end
++				fid=fopen([modelname '.bat'],'w');
++				fprintf(fid,'@echo off\n');
++				if cluster.interactive
++					fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++				else
++					fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
++						cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++				end
++				fclose(fid);
++			end
+ 
+-			 %in interactive mode, create a run file, and errlog and outlog file
+-			 if cluster.interactive,
+-				 fid=fopen([modelname '.errlog'],'w'); fclose(fid);
+-				 fid=fopen([modelname '.outlog'],'w'); fclose(fid);
+-			 end
+-		 end
+-		 %}}}
+-		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++			%in interactive mode, create a run file, and errlog and outlog file
++			if cluster.interactive,
++				fid=fopen([modelname '.errlog'],'w'); fclose(fid);
++				fid=fopen([modelname '.outlog'],'w'); fclose(fid);
++			end
++		end
++		%}}}
++		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+-			 %write queuing script 
+-			 if ~ispc,
++			%write queuing script 
++			if ~ispc,
+ 
+-				 fid=fopen([modelname '.queue'],'w');
+-				 fprintf(fid,'#!/bin/sh\n');
+-				 if ~isvalgrind,
+-					 if cluster.interactive
+-						 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s ',cluster.np,cluster.codepath,cluster.executionpath,modelname);
+-					 else
+-						 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
+-					 end
+-				 elseif isgprof,
+-					 fprintf(fid,'\n gprof %s/kriging.exe gmon.out > %s.performance',cluster.codepath,modelname);
+-				 else
+-					 %Add --gen-suppressions=all to get suppression lines
+-					 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+-					 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',...
+-						 cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
+-				 end
+-				 if ~io_gather, %concatenate the output files:
+-					 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
+-				 end
+-				 fclose(fid);
++				fid=fopen([modelname '.queue'],'w');
++				fprintf(fid,'#!/bin/sh\n');
++				if ~isvalgrind,
++					if cluster.interactive
++						fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s ',cluster.np,cluster.codepath,cluster.executionpath,modelname);
++					else
++						fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
++					end
++				elseif isgprof,
++					fprintf(fid,'\n gprof %s/kriging.exe gmon.out > %s.performance',cluster.codepath,modelname);
++				else
++					%Add --gen-suppressions=all to get suppression lines
++					fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
++					fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',...
++						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
++				end
++				if ~io_gather, %concatenate the output files:
++					fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
++				end
++				fclose(fid);
+ 
+-			 else % Windows
++			else % Windows
+ 
+-				 fid=fopen([modelname '.bat'],'w');
+-				 fprintf(fid,'@echo off\n');
+-				 if cluster.interactive
+-					 fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+-				 else
+-					 fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
+-						 cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+-				 end
+-				 fclose(fid);
+-			 end
++				fid=fopen([modelname '.bat'],'w');
++				fprintf(fid,'@echo off\n');
++				if cluster.interactive
++					fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++				else
++					fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
++						cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++				end
++				fclose(fid);
++			end
+ 
+-			 %in interactive mode, create a run file, and errlog and outlog file
+-			 if cluster.interactive,
+-				 fid=fopen([modelname '.errlog'],'w'); fclose(fid);
+-				 fid=fopen([modelname '.outlog'],'w'); fclose(fid);
+-			 end
+-		 end
+-		 %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist)% {{{
++			%in interactive mode, create a run file, and errlog and outlog file
++			if cluster.interactive,
++				fid=fopen([modelname '.errlog'],'w'); fclose(fid);
++				fid=fopen([modelname '.outlog'],'w'); fclose(fid);
++			end
++		end
++		%}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist)% {{{
+ 
+-			 %compress the files into one zip.
+-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			 for i=1:numel(filelist),
+-				 compressstring = [compressstring ' ' filelist{i}];
+-			 end
+-			 if cluster.interactive,
+-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+-			 end
+-			 system(compressstring);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			if cluster.interactive,
++				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			disp('uploading input file and queueing script');
++			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+-			 disp('launching solution sequence on remote cluster');
+-			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-				 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++			disp('launching solution sequence on remote cluster');
++			launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++				' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end %}}}
++		function Download(cluster,dirname,filelist)% {{{
+ 
+ 			if ispc,
+ 				%do nothing
Index: /issm/oecreview/Archive/12678-13393/ISSM-12753-12754.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12753-12754.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12753-12754.diff	(revision 13394)
@@ -0,0 +1,38 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12753)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12754)
+@@ -42,21 +42,22 @@
+ 			execfile(self.name+'_settings.py',globals())
+ 
+ 		#OK get other fields
+-		cluster=options.AssignObjectFields(cluster)
++		self=options.AssignObjectFields(self)
+ 	# }}}
+ 
+ 	def __repr__(self):    # {{{
+ 		#  display the object
+-		print "class '%s' object '%s' = " % (type(self),'self')
+-		print "    name: %s" % self.name
+-		print "    login: %s" % self.login
+-		print "    np: %i" % self.np
+-		print "    port: %i" % self.port
+-		print "    codepath: %s" % self.codepath
+-		print "    executionpath: %s" % self.executionpath
+-		print "    valgrind: %s" % self.valgrind
+-		print "    valgrindlib: %s" % self.valgrindlib
+-		print "    valgrindsup: %s" % self.valgrindsup
++		s ="class '%s' object '%s' = \n" % (type(self),'self')
++		s+="    name: %s\n" % self.name
++		s+="    login: %s\n" % self.login
++		s+="    np: %i\n" % self.np
++		s+="    port: %i\n" % self.port
++		s+="    codepath: %s\n" % self.codepath
++		s+="    executionpath: %s\n" % self.executionpath
++		s+="    valgrind: %s\n" % self.valgrind
++		s+="    valgrindlib: %s\n" % self.valgrindlib
++		s+="    valgrindsup: %s\n" % self.valgrindsup
++		return s
+ 	# }}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
Index: /issm/oecreview/Archive/12678-13393/ISSM-12754-12755.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12754-12755.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12754-12755.diff	(revision 13394)
@@ -0,0 +1,174 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12755)
+@@ -0,0 +1,116 @@
++"""
++SOLVE - apply solution sequence for this model
++ 
++    Usage:
++       md=solve(md,solutionenum,varargin)
++       where varargin is a list of paired arguments of string OR enums
++ 
++    solution types available comprise:
++ 		 - DiagnosticSolutionEnum
++ 		 - PrognosticSolutionEnum
++ 		 - ThermalSolutionEnum
++ 		 - SteadystateSolutionEnum
++ 		 - TransientSolutionEnum...
++ 		 - BalancethicknessSolutionEnum
++ 		 - BedSlopeSolutionEnum
++ 		 - SurfaceSlopeSolutionEnum
++ 		 - HydrologySolutionEnum
++ 		 - FlaimSolutionEnum
++ 
++   extra options:
++       - loadonly : does not solve. only load results
++ 
++    Examples:
++       md=solve(md,DiagnosticSolutionEnum);
++"""
++
++import datetime
++import os
++import shutil
++
++def solve(md,solutionenum,*args):
++
++	#recover and process solve options
++	options=pairoptions('solution_type',solutionenum,*args)
++	options=process_solve_options(options)
++
++	#recover some fields
++	md.private.solution=options['solution_type']
++	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)
++
++	#First, build a runtime name that is unique
++	c=datetime.datetime.now()
++	md.private.runtimename="%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name,c.month,c.day,c.year,c.hour,c.minute,c.second,os.getpid())
++
++	#if running qmu analysis, some preprocessing of dakota files using models
++	#fields needs to be carried out. 
++	if md.qmu.isdakota:
++		md=preqmu(md,options)
++
++	#flaim analysis
++	if options['solution_type'] == FlaimSolutionEnum:
++		md=flaim_sol(md,options)
++		md.private.solution=EnumToString(options['solution_type'])
++		return md
++
++	#Do we load results only?
++	if options['loadonly']:  
++		md=loadresultsfromcluster(md)
++		return md
++
++	#Wite all input files
++	marshall(md)                                           # bin file
++	md.solver.PetscFile(md.miscellaneous.name+'.petsc')    # petsc file
++	cluster.BuildQueueScript(md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
++
++	#we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
++	if not ispetsc:
++		print "PETSC support not included, running on 1 cpu only!"
++		cluster.np=1
++
++	#Stop here if batch mode
++	if strcmpi(options['batch'],'yes'):
++		print 'batch mode requested: not launching job interactively'
++		print 'launch solution sequence on remote cluster by hand'
++		return md
++
++	#Launch job
++	modelname = md.miscellaneous.name
++	filelist  = [modelname+'.bin ',modelname+'.petsc ',modelname+'.queue ']
++	if md.qmu.isdakota:
++		filelist.append(modelname+'.qmu.in')
++	cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist)
++
++	#did we even try to run? if so, wait on lock
++	if strcmpi(options['upload'],'on'):
++		print 'solve done uploading test decks'
++		return md
++
++	#wait on lock
++	if md.settings.waitonlock>0:
++		#we wait for the done file
++		islock=waitonlock(md)
++		if islock==0:    #no results to be loaded
++			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
++		else:            #load results
++			print 'loading results from cluster'
++			md=loadresultsfromcluster(md)
++
++	#post processes qmu results if necessary
++	if md.qmu.isdakota:
++		if not strncmpi(options['keep'],'y',1):
++			shutil.rmtree('qmu'+str(os.getpid()))
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12755)
+@@ -0,0 +1,35 @@
++"""
++ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
++ 
++    Usage:
++       ismodelselfconsistent(md),
++"""
++
++def ismodelselfconsistent(md):
++
++	#initialize consistency as true
++	md.private.isconsistent=true
++
++	#Get solution and associated analyses
++	solution=md.private.solution
++	analyses,numanalyses=AnalysisConfiguration(solution)
++
++	#Go through a model fields, check that it is a class, and call checkconsistency
++	fields=variables('model')
++	for field in fields:
++
++		#Some properties do not need to be checked
++		if field in ['results','debug','radaroverlay']:
++			continue
++
++		#Check that current field is an object
++		if not hasattr(getattr(md,field),'checkconsistency'):
++			md=checkmessage(md,"field '%s' is not an object." % field)
++
++		#Check consistency of the object
++		exec("md.%s.checkconsistency(md,solution,analyses)" % field)
++
++	#error message if mode is not consistent
++	if not md.private.isconsistent:
++		raise RuntimeError('Model not consistent, see messages above.')
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.m	(revision 12754)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.m	(revision 12755)
+@@ -11,7 +11,7 @@
+ solution=md.private.solution;
+ [analyses,numanalyses]=AnalysisConfiguration(solution);
+ 
+-%Go through al model field check that it is a class and call checkconsistency
++%Go through a model field, check that it is a class, and call checkconsistency
+ fields=properties('model');
+ for i=1:length(fields),
+ 	field=fields{i};
Index: /issm/oecreview/Archive/12678-13393/ISSM-12755-12756.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12755-12756.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12755-12756.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 12755)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 12756)
+@@ -54,7 +54,7 @@
+ 				md = checkmessage(md,['number of processors should be at least 1']);
+ 			end
+ 			if isnan(cluster.np),
+-				checkessage('number of processors should not be NaN!');
++				md = checkmessage(md,'number of processors should not be NaN!');
+ 			end
+ 		end
+ 		%}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-12756-12757.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12756-12757.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12756-12757.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12756)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12757)
+@@ -15,7 +15,7 @@
+ 	analyses,numanalyses=AnalysisConfiguration(solution)
+ 
+ 	#Go through a model fields, check that it is a class, and call checkconsistency
+-	fields=variables('model')
++	fields=vars('model')
+ 	for field in fields:
+ 
+ 		#Some properties do not need to be checked
Index: /issm/oecreview/Archive/12678-13393/ISSM-12757-12758.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12757-12758.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12757-12758.diff	(revision 13394)
@@ -0,0 +1,44 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py	(revision 12758)
+@@ -0,0 +1,39 @@
++"""
++%ISMUMPS - figure out if MUMPS package was compiled with ISSM
++%
++%   Usage:
++%       flag=ismumps();
++"""
++
++import os
++from issmdir import *
++from MatlabFuncs import *
++
++def ismumps():
++
++	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
++	if not os.path.exists(configfile):
++		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
++
++	#go through the file, and recover the line we want
++	flag=2
++	try:
++		fid=open(configfile,'r')
++	except IOError as e:
++		print "could not open file: '%s'" % configfile
++		raise IOError(e)
++
++	for tline in fid:
++		if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25):
++			flag=0
++			break
++		if  strncmp(tline,'#define _HAVE_MUMPS_',20):
++			flag=1
++			break
++
++	fid.close()
++	if flag==2:
++		raise RuntimeError("could not determine whether MUMPS was or was not compiled.")
++
++	return flag
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12758-12759.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12758-12759.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12758-12759.diff	(revision 13394)
@@ -0,0 +1,170 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp	(revision 12758)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp	(revision 12759)
+@@ -15,7 +15,7 @@
+ 
+ 	/*parameters: */
+ 	bool save_results;
+-	bool issmbgradients;
++	bool issmbgradients,ispdd,isdelta18o;
+ 
+ 	/*activate formulation: */
+ 	femmodel->SetCurrentConfiguration(PrognosticAnalysisEnum);
+@@ -23,13 +23,23 @@
+ 	/*recover parameters: */
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+ 	femmodel->parameters->FindParam(&issmbgradients,SurfaceforcingsIssmbgradientsEnum);
++	femmodel->parameters->FindParam(&ispdd,SurfaceforcingsIspddEnum);
++	femmodel->parameters->FindParam(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
+ 
+-
+ 	if(issmbgradients){
+ 	  _printf_(VerboseSolution(),"	call smb gradients module\n");
+ 	  SmbGradientsx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+ 	}
++	if(ispdd){
++		if(isdelta18o){
++			if(VerboseSolution()) _pprintLine_("   call Delta18oParametrization module");
++			Delta18oParameterizationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
++		} 
++		if(VerboseSolution()) _pprintLine_("   call positive degree day module");
++		PositiveDegreeDayx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
++	}
+ 
++
+ 	if(VerboseSolution()) _pprintLine_("   call computational core");
+ 	solver_linear(femmodel);
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12758)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12759)
+@@ -23,7 +23,7 @@
+ 
+ 	/*parameters: */
+ 	IssmDouble starttime,finaltime,dt,yts;
+-	bool   isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy,ispdd,isdelta18o;
++	bool   isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy;
+ 	bool   save_results,dakota_analysis;
+ 	bool   time_adapt=false;
+ 	int    output_frequency;
+@@ -52,8 +52,6 @@
+ 	if(isgroundingline) femmodel->parameters->FindParam(&groundingline_migration,GroundinglineMigrationEnum);
+ 	femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum);
+ 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,TransientRequestedOutputsEnum);
+-	femmodel->parameters->FindParam(&ispdd,SurfaceforcingsIspddEnum);
+-	femmodel->parameters->FindParam(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
+ 
+ 	/*initialize: */
+ 	step=0;
+@@ -108,15 +106,6 @@
+ 			#endif
+ 		}
+ 		
+-		if(ispdd){
+-		        if(isdelta18o){
+-		                if(VerboseSolution()) _pprintLine_("   call Delta18oParametrization module");
+-		                Delta18oParameterizationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+-			} 
+-		        if(VerboseSolution()) _pprintLine_("   call positive degree day module");
+-		        PositiveDegreeDayx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+-		}
+-
+ 		if(isdiagnostic){
+ 			if(VerboseSolution()) _pprintLine_("   computing new velocity");
+ 			#ifdef _HAVE_DIAGNOSTIC_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 12758)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 12759)
+@@ -20,14 +20,19 @@
+ 	int    stabilization;
+ 	bool   dakota_analysis;
+ 	bool   issmbgradients;
++	bool   ispdd;
++	bool   isdelta18o;
++	IssmDouble *size, Delta18oTimeSerie,Delta18oSurfaceTimeSerie ;
+ 
+ 	/*Fetch data needed: */
+ 	iomodel->Constant(&dim,MeshDimensionEnum);
+ 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
+ 	iomodel->Constant(&stabilization,PrognosticStabilizationEnum);
+ 	iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum);
++	iomodel->Constant(&ispdd,SurfaceforcingsIspddEnum);
++	iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
++	iomodel->Constant(&issmbgradients,SurfaceforcingsIssmbgradientsEnum);
+ 	iomodel->FetchData(1,MeshElementsEnum);
+-	iomodel->Constant(&issmbgradients,SurfaceforcingsIssmbgradientsEnum);
+ 
+ 	/*Update elements: */
+ 	int counter=0;
+@@ -75,10 +80,25 @@
+ 	        iomodel->FetchDataToInput(elements,SurfaceforcingsANegEnum);
+ 	        iomodel->FetchDataToInput(elements,SurfaceforcingsBNegEnum);
+ 	}
+-	//else{
+-	//	iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
+-	//}
++	if(ispdd){
++		iomodel->FetchDataToInput(elements,ThermalSpctemperatureEnum);
++		if(isdelta18o){
++			iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oEnum);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oSurfaceEnum);
+ 
++			iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oTemperaturesLgmEnum);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oTemperaturesPresentdayEnum);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationsPresentdayEnum);
++		}
++		else{
++			iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationEnum);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsMonthlytemperaturesEnum);
++		}
++	}
++	if(~ispdd & ~issmbgradients){
++		iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
++	}
++
+ 	/*Free data: */
+ 	iomodel->DeleteData(1,MeshElementsEnum);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp	(revision 12758)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp	(revision 12759)
+@@ -14,35 +14,4 @@
+ #include "../ModelProcessorx.h"
+ 
+ void	UpdateElementsTransient(Elements* elements, Parameters* parameters,IoModel* iomodel,int analysis_counter,int analysis_type){
+-
+-	bool   ispdd;
+-	bool   isdelta18o;
+-	IssmDouble *size, Delta18oTimeSerie,Delta18oSurfaceTimeSerie ;
+-
+-	/*Fetch data needed: */
+-	iomodel->Constant(&ispdd,SurfaceforcingsIspddEnum);
+-	iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
+-	iomodel->FetchData(1,MeshElementsEnum);
+-
+-	if(ispdd){
+-	        iomodel->FetchDataToInput(elements,ThermalSpctemperatureEnum);
+-	        if(isdelta18o){
+-	                  iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oEnum);
+-	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oSurfaceEnum);
+- 
+-	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oTemperaturesLgmEnum);
+-	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oTemperaturesPresentdayEnum);
+-	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationsPresentdayEnum);
+-	        }
+-	        else{
+-	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationEnum);
+-	        	  iomodel->FetchDataToInput(elements,SurfaceforcingsMonthlytemperaturesEnum);
+-	        }
+-	}
+-	else{
+-		iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
+-	}
+-
+-	/*Free data: */
+-	iomodel->DeleteData(1,MeshElementsEnum);
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-12759-12760.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12759-12760.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12759-12760.diff	(revision 13394)
@@ -0,0 +1,54 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.h	(revision 12759)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.h	(revision 12760)
+@@ -72,7 +72,6 @@
+ 		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+-		IssmDouble* GetPointer(void);
+ 
+ 		void GetParameterName(char**pname);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.cpp	(revision 12759)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.cpp	(revision 12760)
+@@ -149,10 +149,3 @@
+ 	::UnitConversion(this->values,this->N,direction_enum,this->enum_type);
+ }
+ /*}}}*/
+-		
+-/*diverse: */
+-/*FUNCTION TransientParam::GetPointer{{{*/
+-IssmDouble* TransientParam::GetPointer(void){
+-	return this->values;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp	(revision 12759)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp	(revision 12760)
+@@ -134,10 +134,3 @@
+ 	::UnitConversion(this->value,this->M*this->N,direction_enum,this->enum_type);
+ }
+ /*}}}*/
+-		
+-/*diverse: */
+-/*FUNCTION DoubleMatParam::GetPointer{{{*/
+-IssmDouble* DoubleMatParam::GetPointer(void){
+-	return this->value;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h	(revision 12759)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h	(revision 12760)
+@@ -72,7 +72,6 @@
+ 		void  SetValue(FILE* fid){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+-		IssmDouble* GetPointer(void);
+ 
+ 		void GetParameterName(char**pname);
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12760-12761.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12760-12761.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12760-12761.diff	(revision 13394)
@@ -0,0 +1,43 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 12760)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 12761)
+@@ -23,10 +23,8 @@
+ 	int         i;
+ 	int         numoutputs;
+ 	Parameters *parameters       = NULL;
+-	IssmDouble     *requestedoutputs = NULL;
+-	bool   isdelta18o;
+-	IssmDouble *Delta18oT, *Delta18oSurfaceT;
+-	int nlinesD18o, ncolsD18o, nlinesD18osurf, ncolsD18osurf;
++	IssmDouble *requestedoutputs = NULL;
++	bool        isdelta18o;
+ 
+ 	if(*pparameters)return; //do not create parameters twice!
+ 
+@@ -97,13 +95,18 @@
+ 
+ 	iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
+ 	if(isdelta18o){
+-	        iomodel->FetchData(&Delta18oT,&nlinesD18o,&ncolsD18o,SurfaceforcingsDelta18oEnum);
+-	        _assert_(nlinesD18o==2);
+-	        parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oEnum,&Delta18oT[0],&Delta18oT[ncolsD18o],ncolsD18o));
+-	          
+-	        iomodel->FetchData(&Delta18oSurfaceT,&nlinesD18osurf,&ncolsD18osurf,SurfaceforcingsDelta18oSurfaceEnum);
+-	        _assert_(nlinesD18osurf==2);
+-	        parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oSurfaceEnum,&Delta18oSurfaceT[0],&Delta18oSurfaceT[ncolsD18osurf],ncolsD18osurf));
++		IssmDouble *temp = NULL;
++		int         N,M;
++
++		iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oEnum);
++		_assert_(N==2);
++		parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oEnum,&temp[0],&temp[M],M));
++		xDelete<IssmDouble>(temp);
++
++		iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oSurfaceEnum);
++		_assert_(N==2);
++		parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oSurfaceEnum,&temp[0],&temp[M],M));
++		xDelete<IssmDouble>(temp);
+ 	}
+ 
+ 	/*some parameters that did not come with the iomodel: */
Index: /issm/oecreview/Archive/12678-13393/ISSM-12761-12762.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12761-12762.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12761-12762.diff	(revision 13394)
@@ -0,0 +1,79 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py	(revision 12762)
+@@ -0,0 +1,33 @@
++"""
++PETSCVERSION - recover petsc version number, inside config.h file
++ 
++    Usage:
++        PETSC_VERSION=petscversion();
++"""
++
++import os
++from issmdir import *
++from MatlabFuncs import *
++
++def petscversion():
++
++	#default
++	PETSC_VERSION=3
++
++	configfile=os.path.joint(issmdir(),'/config.h')
++	if not os.path.exists(configfile):
++		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
++
++	%go through the file, and recover the line we want
++	try:
++		fid=open(configfile,'r')
++	except IOError as e:
++		raise IOerror("could not open file: '%s'" % configfile)
++
++	for tline in fid:
++		if strncmp(tline,'#define _PETSC_MAJOR_',21):
++			PETSC_VERSION=int(tline[22])
++			break
++
++	fid.close()
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12761)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12762)
+@@ -20,8 +20,7 @@
+ 	try:
+ 		fid=open(configfile,'r')
+ 	except IOError as e:
+-		print "could not open file: '%s'" % configfile
+-		raise IOError(e)
++		raise IOError("could not open file: '%s'" % configfile)
+ 
+ 	for tline in fid:
+ 		if strncmp(tline,'/* #undef _HAVE_PETSC_ */',25):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py	(revision 12761)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py	(revision 12762)
+@@ -20,8 +20,7 @@
+ 	try:
+ 		fid=open(configfile,'r')
+ 	except IOError as e:
+-		print "could not open file: '%s'" % configfile
+-		raise IOError(e)
++		raise IOError("could not open file: '%s'" % configfile)
+ 
+ 	for tline in fid:
+ 		if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 12761)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 12762)
+@@ -32,7 +32,7 @@
+ from miscellaneous import miscellaneous
+ from private import private
+ #}}}
+-class model:
++class model(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
Index: /issm/oecreview/Archive/12678-13393/ISSM-12762-12763.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12762-12763.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12762-12763.diff	(revision 13394)
@@ -0,0 +1,434 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12762)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12763)
+@@ -6,292 +6,154 @@
+ 
+ switch id,
+ 
+-	case 101, name='SquareShelfConstrainedDiagM2dSerial';
+-	case 102, name='SquareShelfConstrainedDiagM2dParallel';
+-	case 103, name='SquareShelfConstrainedDiagM3dSerial';
+-	case 104, name='SquareShelfConstrainedDiagM3dParallel';
+-	case 105, name='SquareShelfConstrainedDiagP3dSerial';
+-	case 106, name='SquareShelfConstrainedDiagP3dParallel';
+-	case 107, name='SquareShelfConstrainedDiagS3dSerial';
+-	case 108, name='SquareShelfConstrainedDiagS3dParallel';
+-	case 109, name='SquareShelfConstrainedProg2dSerial';
+-	case 110, name='SquareShelfConstrainedProg2dParallel';
+-	case 111, name='SquareShelfConstrainedProg2dDGSerial';
+-	case 112, name='SquareShelfConstrainedProg2dDGParallel';
+-	case 113, name='SquareShelfConstrainedProg3dSerial';
+-	case 114, name='SquareShelfConstrainedProg3dParallel';
+-	case 115, name='SquareShelfConstrainedTherSteaSerial';
+-	case 116, name='SquareShelfConstrainedTherSteaParallel';
+-	case 117, name='SquareShelfConstrainedTherTranSerial';
+-	case 118, name='SquareShelfConstrainedTherTranParallel';
+-	case 119, name='SquareShelfConstrainedTranM2dSerial';
+-	case 120, name='SquareShelfConstrainedTranM2dParallel';
+-	case 121, name='SquareShelfConstrainedTranP3dSerial';
+-	case 122, name='SquareShelfConstrainedTranP3dParallel';
+-	case 123, name='SquareShelfConstrainedSurfSlop2dSerial';
+-	case 124, name='SquareShelfConstrainedSurfSlop2dParallel';
+-	case 125, name='SquareShelfConstrainedSurfSlop3dSerial';
+-	case 126, name='SquareShelfConstrainedSurfSlope3dParallel';
+-	case 127, name='SquareShelfConstrainedBedSlop2dSerial';
+-	case 128, name='SquareShelfConstrainedBedSlop2dParallel';
+-	case 129, name='SquareShelfConstrainedBedSlop3dSerial';
+-	case 130, name='SquareShelfConstrainedBedSlop3dParallel';
+-	case 131, name='SquareShelfConstrainedBalThic2dSerial';
+-	case 132, name='SquareShelfConstrainedBalThic2dParallel';
+-	case 133, name='SquareShelfConstrainedBalThic3dSerial';
+-	case 134, name='SquareShelfConstrainedBalThic3dParallel';
+-	case 135, name='SquareShelfConstrainedBalThic2dDGSerial';
+-	case 136, name='SquareShelfConstrainedBalThic2dDGParallel';
++	case 102, name='SquareShelfConstrainedDiagM2d';
++	case 104, name='SquareShelfConstrainedDiagM3d';
++	case 106, name='SquareShelfConstrainedDiagP3d';
++	case 108, name='SquareShelfConstrainedDiagS3d';
++	case 110, name='SquareShelfConstrainedProg2d';
++	case 112, name='SquareShelfConstrainedProg2dDG';
++	case 114, name='SquareShelfConstrainedProg3d';
++	case 116, name='SquareShelfConstrainedTherStea';
++	case 118, name='SquareShelfConstrainedTherTran';
++	case 120, name='SquareShelfConstrainedTranM2d';
++	case 122, name='SquareShelfConstrainedTranP3d';
++	case 124, name='SquareShelfConstrainedSurfSlop2d';
++	case 126, name='SquareShelfConstrainedSurfSlope3d';
++	case 128, name='SquareShelfConstrainedBedSlop2d';
++	case 130, name='SquareShelfConstrainedBedSlop3d';
++	case 132, name='SquareShelfConstrainedBalThic2d';
++	case 134, name='SquareShelfConstrainedBalThic3d';
++	case 136, name='SquareShelfConstrainedBalThic2dDG';
+ 	case 137, name='SquareBamgMesh';
+-	case 139, name='SquareShelfConstrainedEnthalpySteaSerial';
+-	case 140, name='SquareShelfConstrainedEnthalpySteaParallel';
+-	case 141, name='SquareShelfConstrainedEnthalpyTranSerial';
+-	case 142, name='SquareShelfConstrainedEnthalpyTranParallel';
+-	case 143, name='SquareShelfConstrainedTransP3dEnthSerial';
+-	case 144, name='SquareShelfConstrainedTransP3dEnthParallel';
+-	case 201, name='SquareShelfDiagM2dSerial';
+-	case 202, name='SquareShelfDiagM2dParallel';
+-	case 203, name='SquareShelfDiagM3dSerial';
+-	case 204, name='SquareShelfDiagM3dParallel';
+-	case 205, name='SquareShelfDiagP3dSerial';
+-	case 206, name='SquareShelfDiagP3dParallel';
+-	case 207, name='SquareShelfDiagS3dSerial';
+-	case 208, name='SquareShelfDiagS3dParallel';
+-	case 209, name='SquareShelfDiagMP3dPenaltiesSerial';
+-	case 210, name='SquareShelfDiagMP3dPenaltiesParallel';
+-	case 211, name='SquareShelfTherSteaSerial';
+-	case 212, name='SquareShelfTherSteaParallel';
+-	case 213, name='SquareShelfTherTranSerial';
+-	case 214, name='SquareShelfTherTranParallel';
+-	case 215, name='SquareShelfTranM2dSerial';
+-	case 216, name='SquareShelfTranM2dParallel';
+-	case 217, name='SquareShelfTranM3dSerial';
+-	case 218, name='SquareShelfTranM3dParallel';
+-	case 219, name='SquareShelfTranP3dSerial';
+-	case 220, name='SquareShelfTranP3dParallel';
+-	case 221, name='SquareShelfTranS3dSerial';
+-	case 222, name='SquareShelfTranS3dParallel';
+-	case 223, name='SquareShelfCMBM2dSerial';
+-	case 224, name='SquareShelfCMBM2dParallel';
+-	case 225, name='SquareShelfCMBM3dSerial';
+-	case 226, name='SquareShelfCMBM3dParallel';
+-	case 227, name='SquareShelfCMBP3dSerial';
+-	case 228, name='SquareShelfCMBP3dParallel';
+-	case 229, name='SquareShelfCMBS3dSerial';
+-	case 230, name='SquareShelfCMBS3dParallel';
+-	case 231, name='SquareShelfDiagM2dRiftSerial';
+-	case 232, name='SquareShelfDiagM2dRiftParallel';
+-	case 233, name='SquareShelfConstrainedSerial';
+-	case 234, name='SquareShelfConstrainedParallel';
+-	case 235, name='SquareShelfConstrainedDakotaBSerial';
+-	case 236, name='SquareShelfConstrainedDakotaBParallel';
+-	case 237, name='SquareShelfDiagMP3dTilingSerial';
+-	case 238, name='SquareShelfDiagMP3dTilingParallel';
+-	case 239, name='SquareShelfDiagPS3dTilingSerial';
+-	case 240, name='SquareShelfDiagPS3dTilingParallel';
+-	case 241, name='SquareShelfDiagMS3dTilingSerial';
+-	case 242, name='SquareShelfDiagMS3dTilingParallel';
+-	case 243, name='SquareShelfDiagM2dTransientIncrHydroSerial';
+-	case 244, name='SquareShelfDiagM2dTransientIncrHydroParallel';
+-	case 245, name='SquareShelfDiagM2dTransientIncrNonHydroSerial';
+-	case 246, name='SquareShelfDiagM2dTransientIncrNonHydroParallel';
+-	case 247, name='SquareShelfDiagP3dTransientIncrHydroSerial';
+-	case 248, name='SquareShelfDiagP3dTransientIncrHydroParallel';
+-	case 249, name='SquareShelfDiagP3dTransientIncrNonHydroSerial';
+-	case 250, name='SquareShelfDiagP3dTransientIncrNonHydroParallel';
+-	case 251, name='SquareShelfTranCflM2dSerial';
+-	case 252, name='SquareShelfTranCflM2dParallel';
+-	case 253, name='SquareShelfTranCflP3dSerial';
+-	case 254, name='SquareShelfTranCflP3dParallel';
+-	case 255, name='SquareShelfTranForceNeg2dSerial';
+-	case 256, name='SquareShelfTranForceNeg2dParallel';
+-	case 257, name='SquareShelfTranForcePos2dSerial';
+-	case 258, name='SquareShelfTranForcePos2dParallel';
+-	case 259, name='SquareShelfTranForceNeg3dSerial';
+-	case 260, name='SquareShelfTranForceNeg3dParallel';
+-	case 261, name='SquareShelfTranForcePos3dSerial';
+-	case 262, name='SquareShelfTranForcePos3dParallel';
+-	case 263, name='SquareShelfTherTranForcTempSerial';
+-	case 264, name='SquareShelfTherTranForcTempParallel';
+-	case 265, name='SquareShelfTranP3dForcTempSerial';
+-	case 266, name='SquareShelfTranP3dForcTempParallel';
++	case 140, name='SquareShelfConstrainedEnthalpyStea';
++	case 142, name='SquareShelfConstrainedEnthalpyTran';
++	case 144, name='SquareShelfConstrainedTransP3dEnth';
++	case 202, name='SquareShelfDiagM2d';
++	case 204, name='SquareShelfDiagM3d';
++	case 206, name='SquareShelfDiagP3d';
++	case 208, name='SquareShelfDiagS3d';
++	case 210, name='SquareShelfDiagMP3dPenalties';
++	case 212, name='SquareShelfTherStea';
++	case 214, name='SquareShelfTherTran';
++	case 216, name='SquareShelfTranM2d';
++	case 218, name='SquareShelfTranM3d';
++	case 220, name='SquareShelfTranP3d';
++	case 222, name='SquareShelfTranS3d';
++	case 224, name='SquareShelfCMBM2d';
++	case 226, name='SquareShelfCMBM3d';
++	case 228, name='SquareShelfCMBP3d';
++	case 230, name='SquareShelfCMBS3d';
++	case 232, name='SquareShelfDiagM2dRift';
++	case 234, name='SquareShelfConstrained';
++	case 236, name='SquareShelfConstrainedDakotaB';
++	case 238, name='SquareShelfDiagMP3dTiling';
++	case 240, name='SquareShelfDiagPS3dTiling';
++	case 242, name='SquareShelfDiagMS3dTiling';
++	case 244, name='SquareShelfDiagM2dTransientIncrHydro';
++	case 246, name='SquareShelfDiagM2dTransientIncrNonHydro';
++	case 248, name='SquareShelfDiagP3dTransientIncrHydro';
++	case 250, name='SquareShelfDiagP3dTransientIncrNonHydro';
++	case 252, name='SquareShelfTranCflM2d';
++	case 254, name='SquareShelfTranCflP3d';
++	case 256, name='SquareShelfTranForceNeg2d';
++	case 258, name='SquareShelfTranForcePos2d';
++	case 260, name='SquareShelfTranForceNeg3d';
++	case 262, name='SquareShelfTranForcePos3d';
++	case 264, name='SquareShelfTherTranForcTemp';
++	case 266, name='SquareShelfTranP3dForcTemp';
+ 	case 268, name='SquareShelfTranForceNeg2dDakotaSamp';
+ 	case 270, name='SquareShelfTranForceNeg2dDakotaLocal';
+-	case 301, name='SquareSheetConstrainedDiagM2dSerial';
+-	case 302, name='SquareSheetConstrainedDiagM2dParallel';
+-	case 303, name='SquareSheetConstrainedDiagH2dSerial';
+-	case 304, name='SquareSheetConstrainedDiagH2dParallel';
+-	case 305, name='SquareSheetConstrainedDiagHM2dSerial';
+-	case 306, name='SquareSheetConstrainedDiagHM2dParallel';
+-	case 307, name='SquareSheetConstrainedDiagM3dSerial';
+-	case 308, name='SquareSheetConstrainedDiagM3dParallel';
+-	case 309, name='SquareSheetConstrainedDiagH3dSerial';
+-	case 310, name='SquareSheetConstrainedDiagH3dParallel';
+-	case 311, name='SquareSheetConstrainedDiagHM3dSerial';
+-	case 312, name='SquareSheetConstrainedDiagHM3dParallel';
+-	case 313, name='SquareSheetConstrainedDiagP3dSerial';
+-	case 314, name='SquareSheetConstrainedDiagP3dParallel';
+-	case 315, name='SquareSheetConstrainedDiagS3dSerial';
+-	case 316, name='SquareSheetConstrainedDiagS3dParallel';
+-	case 317, name='SquareSheetConstrainedProg2dSerial';
+-	case 318, name='SquareSheetConstrainedProg2dParallel';
+-	case 319, name='SquareSheetConstrainedProg2dDGSerial';
+-	case 320, name='SquareSheetConstrainedProg2dDGParallel';
+-	case 321, name='SquareSheetConstrainedProg3dSerial';
+-	case 322, name='SquareSheetConstrainedProg3dParallel';
+-	case 323, name='SquareSheetConstrainedTherSteaSerial';
+-	case 324, name='SquareSheetConstrainedTherSteaParallel';
+-	case 325, name='SquareSheetConstrainedTherTranSerial';
+-	case 326, name='SquareSheetConstrainedTherTranParallel';
+-	case 327, name='SquareSheetConstrainedTranH2dSerial';
+-	case 328, name='SquareSheetConstrainedTranH2dParallel';
+-	case 329, name='SquareSheetConstrainedTranH3dSerial';
+-	case 330, name='SquareSheetConstrainedTranH3dParallel';
+-	case 331, name='SquareSheetConstrainedTranM2dSerial';
+-	case 332, name='SquareSheetConstrainedTranM2dParallel';
+-	case 333, name='SquareSheetConstrainedTranP3dSerial';
+-	case 334, name='SquareSheetConstrainedTranP3dParallel';
+-	case 335, name='SquareSheetConstrainedSteaH3dSerial';
+-	case 336, name='SquareSheetConstrainedSteaH3dParallel';
+-	case 337, name='SquareSheetConstrainedCMDragM2dSerial';
+-	case 338, name='SquareSheetConstrainedCMDragM2dParallel';
+-	case 339, name='SquareSheetConstrainedCMDragM3dSerial';
+-	case 340, name='SquareSheetConstrainedCMDragM3dParallel';
+-	case 341, name='SquareSheetConstrainedCMDragP3dSerial';
+-	case 342, name='SquareSheetConstrainedCMDragP3dParallel';
+-	case 343, name='SquareSheetConstrainedCMDragS3dSerial';
+-	case 344, name='SquareSheetConstrainedCMDragS3dParallel';
+-	case 345, name='SquareSheetConstrainedTranCflM2dSerial';
+-	case 346, name='SquareSheetConstrainedTranCflM2dParallel';
+-	case 347, name='SquareSheetConstrainedTranCflH3dSerial';
+-	case 348, name='SquareSheetConstrainedTranCflH3dParallel';
+-	case 349, name='SquareSheetConstrainedEnthalpySteaSerial';
+-	case 350, name='SquareSheetConstrainedEnthalpySteaParallel';
+-	case 351, name='SquareSheetConstrainedEnthalpyTranSerial';
+-	case 352, name='SquareSheetConstrainedEnthalpyTranParallel';
+-	case 353, name='SquareSheetConstrainedTransP3dEnthSerial';
+-	case 354, name='SquareSheetConstrainedTransP3dEnthParallel';
+-	case 356, name='SquareSheetConstrainedSmbGradients2dParallel';
+-	case 358, name='SquareSheetConstrainedSmbGradients3dParallel';
+-	case 401, name='SquareSheetShelfDiagM2dSerial';
+-	case 402, name='SquareSheetShelfDiagM2dParallel';
+-	case 403, name='SquareSheetShelfDiagM3dSerial';
+-	case 404, name='SquareSheetShelfDiagM3dParallel';
+-	case 405, name='SquareSheetShelfDiagP3dSerial';
+-	case 406, name='SquareSheetShelfDiagP3dParallel';
+-	case 407, name='SquareSheetShelfDiagS3dSerial';
+-	case 408, name='SquareSheetShelfDiagS3dParallel';
+-	case 409, name='SquareSheetShelfDiagMP3dPenaltiesSerial';
+-	case 410, name='SquareSheetShelfDiagMP3dPenaltiesParallel';
+-	case 411, name='SquareSheetShelfTherSteaSerial';
+-	case 412, name='SquareSheetShelfTherSteaParallel';
+-	case 413, name='SquareSheetShelfTherTranSerial';
+-	case 414, name='SquareSheetShelfTherTranParallel';
+-	case 415, name='SquareSheetShelfTranM2dSerial';
+-	case 416, name='SquareSheetShelfTranM2dParallel';
+-	case 417, name='SquareSheetShelfTranMP3dPenaltiesSerial';
+-	case 418, name='SquareSheetShelfTranMP3dPenaltiesParallel';
+-	case 419, name='SquareSheetShelfSteaM3dSerial';
+-	case 420, name='SquareSheetShelfSteaM3dParallel';
+-	case 421, name='SquareSheetShelfSteaP3dSerial';
+-	case 422, name='SquareSheetShelfSteaP3dParallel';
+-	case 423, name='SquareSheetShelfDiadM3dDakotaSerial';
+-	case 424, name='SquareSheetShelfDiadM3dDakotaParallel';
+-	case 425, name='SquareSheetShelfDiadM3dDakotaPartSerial';
+-	case 426, name='SquareSheetShelfDiadM3dDakotaPartParallel';
+-	case 427, name='SquareSheetShelfDiadM3dDakotaMassFluxSerial';
+-	case 428, name='SquareSheetShelfDiadM3dDakotaMassFluxParallel';
+-	case 429, name='SquareSheetShelfCMDragSteaM3dSerial';
+-	case 430, name='SquareSheetShelfCMDragSteaM3dParallel';
+-	case 431, name='SquareSheetShelfCMDragSteaP3dSerial';
+-	case 432, name='SquareSheetShelfCMDragSteaP3dParallel';
++	case 302, name='SquareSheetConstrainedDiagM2d';
++	case 304, name='SquareSheetConstrainedDiagH2d';
++	case 306, name='SquareSheetConstrainedDiagHM2d';
++	case 308, name='SquareSheetConstrainedDiagM3d';
++	case 310, name='SquareSheetConstrainedDiagH3d';
++	case 312, name='SquareSheetConstrainedDiagHM3d';
++	case 314, name='SquareSheetConstrainedDiagP3d';
++	case 316, name='SquareSheetConstrainedDiagS3d';
++	case 318, name='SquareSheetConstrainedProg2d';
++	case 320, name='SquareSheetConstrainedProg2dDG';
++	case 322, name='SquareSheetConstrainedProg3d';
++	case 324, name='SquareSheetConstrainedTherStea';
++	case 326, name='SquareSheetConstrainedTherTran';
++	case 328, name='SquareSheetConstrainedTranH2d';
++	case 330, name='SquareSheetConstrainedTranH3d';
++	case 332, name='SquareSheetConstrainedTranM2d';
++	case 334, name='SquareSheetConstrainedTranP3d';
++	case 336, name='SquareSheetConstrainedSteaH3d';
++	case 338, name='SquareSheetConstrainedCMDragM2d';
++	case 340, name='SquareSheetConstrainedCMDragM3d';
++	case 342, name='SquareSheetConstrainedCMDragP3d';
++	case 344, name='SquareSheetConstrainedCMDragS3d';
++	case 346, name='SquareSheetConstrainedTranCflM2d';
++	case 348, name='SquareSheetConstrainedTranCflH3d';
++	case 350, name='SquareSheetConstrainedEnthalpyStea';
++	case 352, name='SquareSheetConstrainedEnthalpyTran';
++	case 354, name='SquareSheetConstrainedTransP3dEnth';
++	case 356, name='SquareSheetConstrainedSmbGradients2d';
++	case 358, name='SquareSheetConstrainedSmbGradients3d';
++	case 402, name='SquareSheetShelfDiagM2d';
++	case 404, name='SquareSheetShelfDiagM3d';
++	case 406, name='SquareSheetShelfDiagP3d';
++	case 408, name='SquareSheetShelfDiagS3d';
++	case 410, name='SquareSheetShelfDiagMP3dPenalties';
++	case 412, name='SquareSheetShelfTherStea';
++	case 414, name='SquareSheetShelfTherTran';
++	case 416, name='SquareSheetShelfTranM2d';
++	case 418, name='SquareSheetShelfTranMP3dPenalties';
++	case 420, name='SquareSheetShelfSteaM3d';
++	case 422, name='SquareSheetShelfSteaP3d';
++	case 424, name='SquareSheetShelfDiadM3dDakota';
++	case 426, name='SquareSheetShelfDiadM3dDakotaPart';
++	case 428, name='SquareSheetShelfDiadM3dDakotaMassFlux';
++	case 430, name='SquareSheetShelfCMDragSteaM3d';
++	case 432, name='SquareSheetShelfCMDragSteaP3d';
+ 	case 434, name='SquareSheetShelfDiadM3dDakotaSamp';
+ 	case 436, name='SquareSheetShelfDiadM3dDakotaAreaAverage';
+-	case 437, name='SquareSheetShelfDiagMP3dTilingSerial';
+-	case 438, name='SquareSheetShelfDiagMP3dTilingParallel';
++	case 438, name='SquareSheetShelfDiagMP3dTiling';
+ 	case 439, name='SquareSheetShelfDakotaScaledResponse';
+ 	case 440, name='SquareSheetShelfDakotaScaledResponse';
+-	case 441, name='SquareSheetShelfDiagPS3dTilingSerial';
+-	case 442, name='SquareSheetShelfDiagPS3dTilingParallel';
+-	case 443, name='SquareSheetShelfDiagMS3dTilingSerial';
+-	case 444, name='SquareSheetShelfDiagMS3dTilingParallel';
+-	case 445, name='RoundSheetShelfGLMigrationM2dSerial';
+-	case 446, name='RoundSheetShelfGLMigrationM2dParallel';
+-	case 447, name='SquareSheetShelfGroundingLine2dAgressiceSerial';
+-	case 448, name='SquareSheetShelfGroundingLine2dAgressiceParallel';
+-	case 449, name='SquareSheetShelfGroundingLine2dSoftSerial';
+-	case 450, name='SquareSheetShelfGroundingLine2dSoftParallel';
+-	case 451, name='SquareSheetShelfGroundingLine3dAgressiceSerial';
+-	case 452, name='SquareSheetShelfGroundingLine3dAgressiceParallel';
+-	case 453, name='SquareSheetShelfGroundingLine3dSoftSerial';
+-	case 454, name='SquareSheetShelfGroundingLine3dSoftParallel';
+-	case 455, name='SquareSheetShelfDiagM2dNewtonSerial';
+-	case 456, name='SquareSheetShelfDiagM2dNewtonParallel';
+-	case 457, name='SquareSheetShelfDiagP3dNewtonSerial';
+-	case 458, name='SquareSheetShelfDiagP3dNewtonParallel';
+-	case 459, name='SquareSheetShelfDiagS3dNewtonSerial';
+-	case 460, name='SquareSheetShelfDiagS3dNewtonParallel';
+-	case 461, name='SquareSheetShelfSteaEnthalpyM3dSerial';
+-	case 462, name='SquareSheetShelfSteaEnthalpyM3dParallel';
+-	case 463, name='SquareSheetShelfSteaEnthalpyP3dSerial';
+-	case 464, name='SquareSheetShelfSteaEnthalpyP3dParallel';
+-	case 501, name='PigDiagM2dSerial';
+-	case 502, name='PigDiagM2dParallel';
+-	case 503, name='PigDiagP3dSerial';
+-	case 504, name='PigDiagP3dParallel';
+-	case 505, name='PigDiagS3dSerial';
+-	case 506, name='PigDiagS3dParallel';
+-	case 507, name='PigTranM2dSerial';
+-	case 508, name='PigTranM2dParallel';
+-	case 509, name='PigTranM3dSerial';
+-	case 510, name='PigTranM3dParallel';
+-	case 511, name='PigTranP3dSerial';
+-	case 512, name='PigTranP3dParallel';
+-	case 513, name='PigTranS3dSerial';
+-	case 514, name='PigTranS3dParallel';
+-	case 515, name='PigSteaM3dSerial';
+-	case 516, name='PigSteaM3dParallel';
+-	case 517, name='PigSteaP3dSerial';
+-	case 518, name='PigSteaP3dParallel';
+-	case 519, name='PigSteaS3dSerial';
+-	case 520, name='PigSteaS3dParallel';
+-	case 521, name='PigCMBS3dSerial';
++	case 442, name='SquareSheetShelfDiagPS3dTiling';
++	case 444, name='SquareSheetShelfDiagMS3dTiling';
++	case 446, name='RoundSheetShelfGLMigrationM2d';
++	case 448, name='SquareSheetShelfGroundingLine2dAgressice';
++	case 450, name='SquareSheetShelfGroundingLine2dSoft';
++	case 452, name='SquareSheetShelfGroundingLine3dAgressice';
++	case 454, name='SquareSheetShelfGroundingLine3dSoft';
++	case 456, name='SquareSheetShelfDiagM2dNewton';
++	case 458, name='SquareSheetShelfDiagP3dNewton';
++	case 460, name='SquareSheetShelfDiagS3dNewton';
++	case 462, name='SquareSheetShelfSteaEnthalpyM3d';
++	case 464, name='SquareSheetShelfSteaEnthalpyP3d';
++	case 502, name='PigDiagM2d';
++	case 504, name='PigDiagP3d';
++	case 506, name='PigDiagS3d';
++	case 508, name='PigTranM2d';
++	case 510, name='PigTranM3d';
++	case 512, name='PigTranP3d';
++	case 514, name='PigTranS3d';
++	case 516, name='PigSteaM3d';
++	case 518, name='PigSteaP3d';
++	case 520, name='PigSteaS3d';
+ 	case 522, name='PigCMBS3dparallel';
+-	case 523, name='PigCMDragP3dSerial';
+ 	case 524, name='PigCMDragP3dparallel';
+-	case 525, name='PigCMDragSteaM3dSerial';
+ 	case 526, name='PigCMDragSteaM3dparallel';
+ 	case 527, name='PigBamgMesh';
+-	case 529, name='PigTherTranSUPGSerial';
+-	case 530, name='PigTherTranSUPGParallel';
+-	case 531, name='PigTherSteaSUPGSerial';
+-	case 532, name='PigTherSteaSUPGParallel';
+-	case 601, name='79NorthProg2dSerial';
+-	case 602, name='79NorthProg2dParallel';
+-	case 603, name='79NorthProg2dDGSerial';
+-	case 604, name='79NorthProg2dDGParallel';
+-	case 605, name='79NorthProg3dSerial';
+-	case 606, name='79NorthProg3dParallel';
+-	case 607, name='79NorthSurfSlop2dSerial';
+-	case 608, name='79NorthSurfSlop2dParallel';
+-	case 609, name='79NorthSurfSlop3dSerial';
+-	case 610, name='79NorthSurfSlop3dParallel';
+-	case 611, name='79NorthBedSlop2dSerial';
+-	case 612, name='79NorthBedSlop2dParallel';
+-	case 613, name='79NorthBedSlop3dSerial';
+-	case 614, name='79NorthBedSlop3dParallel';
+-	case 615, name='79NorthBalThic2dSerial';
+-	case 616, name='79NorthBalThic2dParallel';
+-	case 617, name='79NorthBalThic2dDGSerial';
+-	case 618, name='79NorthBalThic2dDGParallel';
+-	case 619, name='79NorthBalThic3dSerial';
+-	case 620, name='79NorthBalThic3dParallel';
+-	case 621, name='79NorthCMBalThic2dCGSerial';
+-	case 622, name='79NorthCMBalThic2dCGParallel';
+-	case 623, name='79NorthCMBalThic2dDGSerial';
+-	case 624, name='79NorthCMBalThic2dDGParallel';
+-	case 625, name='79NorthCMBalThicVxVyParallel';
+-	case 626, name='79NorthCMBalThicVxVySerial';
++	case 530, name='PigTherTranSUPG';
++	case 532, name='PigTherSteaSUPG';
++	case 602, name='79NorthProg2d';
++	case 604, name='79NorthProg2dDG';
++	case 606, name='79NorthProg3d';
++	case 608, name='79NorthSurfSlop2d';
++	case 610, name='79NorthSurfSlop3d';
++	case 612, name='79NorthBedSlop2d';
++	case 614, name='79NorthBedSlop3d';
++	case 616, name='79NorthBalThic2d';
++	case 618, name='79NorthBalThic2dDG';
++	case 620, name='79NorthBalThic3d';
++	case 622, name='79NorthCMBalThic2dCG';
++	case 624, name='79NorthCMBalThic2dDG';
++	case 626, name='79NorthCMBalThicVxVyParalle';
+ 	case 1101, name='ISMIPAPattyn';
+ 	case 1102, name='ISMIPAStokes';
+ 	case 1103, name='ISMIPBPattyn';
Index: /issm/oecreview/Archive/12678-13393/ISSM-12763-12764.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12763-12764.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12763-12764.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12763)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12764)
+@@ -135,9 +135,9 @@
+ 	case 516, name='PigSteaM3d';
+ 	case 518, name='PigSteaP3d';
+ 	case 520, name='PigSteaS3d';
+-	case 522, name='PigCMBS3dparallel';
+-	case 524, name='PigCMDragP3dparallel';
+-	case 526, name='PigCMDragSteaM3dparallel';
++	case 522, name='PigCMBS3d';
++	case 524, name='PigCMDragP3d';
++	case 526, name='PigCMDragSteaM3d';
+ 	case 527, name='PigBamgMesh';
+ 	case 530, name='PigTherTranSUPG';
+ 	case 532, name='PigTherSteaSUPG';
Index: /issm/oecreview/Archive/12678-13393/ISSM-12764-12765.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12764-12765.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12764-12765.diff	(revision 13394)
@@ -0,0 +1,119 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/petscversion.2.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/petscversion.2.py	(revision 12764)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/petscversion.2.py	(revision 12765)
+@@ -1,39 +0,0 @@
+-#PETSCVERSION - recover petsc version number, inside config.h file
+-#
+-#   Usage:
+-#       PETSC_VERSION=petscversion();
+-
+-#Module imports {{{
+-import os
+-import sys
+-from issmtier import *
+-#}}}
+-
+-def petscversion():
+-
+-	#default
+-	PETSC_VERSION=3;
+-	
+-	configfile=issmtier() + "/bin/config.h" #should find it in the install target
+-	
+-	if not os.path.isfile(configfile):
+-		raise RuntimeError("%s%s%s"%("File ",configfile," not found. ISSM has not been configured yet!"))
+-
+-	#go through the file, and recover the line we want
+-	fid=open(configfile,'r');
+-
+-	tline=fid.readline()
+-	while tline:
+-
+-		if tline=='': 
+-			break
+-		
+-		if tline[0:21]=="#define _PETSC_MAJOR_":
+-			PETSC_VERSION=int(tline[22])
+-			break
+-		
+-		tline=fid.readline()
+-	
+-	fid.close();
+-
+-	return PETSC_VERSION
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/utils/OS/ismumps.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/utils/OS/ismumps.py	(revision 12764)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/utils/OS/ismumps.py	(revision 12765)
+@@ -1,41 +0,0 @@
+-#ISMUMPS - figure out if MUMPS package was compiled with ISSM
+-#
+-#   Usage:
+-#       flag=ismumps();
+-
+-#Module imports {{{
+-import os
+-import sys
+-from issmtier import *
+-#}}}
+-
+-def ismumps():
+-
+-	configfile=issmtier() + "/bin/config.h" #should find it in the install target
+-	
+-	if not os.path.isfile(configfile):
+-		raise RuntimeError("%s%s%s"%("File ",configfile," not found. ISSM has not been configured yet!"))
+-	
+-	#%go through the file, and recover the line we want
+-	flag=2;
+-	fid=open(configfile,'r');
+-
+-	tline=fid.readline()
+-	while tline:
+-		
+-		if tline=='': 
+-			break
+-		if tline[0:25]=="/* #undef _HAVE_MUMPS_ */":
+-			flag=0;
+-			break
+-		if tline[0:20]=="#define _HAVE_MUMPS_":
+-			flag=1
+-			break
+-		tline=fid.readline()
+-
+-	fid.close();
+-
+-	if flag==2:
+-		raise RuntimeError('could not determine whether MUMPS was or was not compiled')
+-
+-	return flag
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/utils/Shell/issmtier.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/utils/Shell/issmtier.py	(revision 12764)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/utils/Shell/issmtier.py	(revision 12765)
+@@ -1,24 +0,0 @@
+-
+-#ISSMTIER - Get ISSM_TIER environment variable contents.
+-#
+-#   Usage:
+-#      ISSM_TIER=issmtier()
+-
+-
+-#Module imports
+-import os
+-
+-def issmtier():
+-
+-	if os.name =="posix":
+-		ISSM_TIER =os.getenv('ISSM_TIER')
+-	else:
+-		ISSM_TIER =os.getenv('ISSM_TIER_WIN')
+-
+-	if(ISSM_TIER[-1]=="/") or (ISSM_TIER[-1]=="\\"):
+-		ISSM_TIER = ISSM_TIER[:-2]; #shave off the last '/'
+-
+-	if ISSM_TIER == "":
+-		raise RuntimeError("issmdir error message: ''ISSM_TIER'' environment variable is empty! You should define ISSM_TIER in your .cshrc or .bashrc!")
+-		
+-	return ISSM_TIER
Index: /issm/oecreview/Archive/12678-13393/ISSM-12765-12766.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12765-12766.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12765-12766.diff	(revision 13394)
@@ -0,0 +1,24 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py	(revision 12765)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py	(revision 12766)
+@@ -14,11 +14,11 @@
+ 	#default
+ 	PETSC_VERSION=3
+ 
+-	configfile=os.path.joint(issmdir(),'/config.h')
++	configfile=os.path.join(issmdir(),'config.h')
+ 	if not os.path.exists(configfile):
+ 		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
+ 
+-	%go through the file, and recover the line we want
++	#go through the file, and recover the line we want
+ 	try:
+ 		fid=open(configfile,'r')
+ 	except IOError as e:
+@@ -31,3 +31,5 @@
+ 
+ 	fid.close()
+ 
++	return PETSC_VERSION
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12766-12767.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12766-12767.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12766-12767.diff	(revision 13394)
@@ -0,0 +1,74 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 12766)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 12767)
+@@ -55,6 +55,15 @@
+ 	IS_INSTALL=1
+ fi
+ 
++IS_TABLE=0
++if [ $NUM_TOT -gt 1 ];
++then
++	if [ $NUM_SUC -ne $NUM_TOT  ];
++	then
++		IS_TABLE=1
++	fi
++fi
++
+ #-------------------#
+ # build report.html #
+ #-------------------#
+@@ -95,9 +104,10 @@
+ END
+ 
+ #update status
+-if [ $IS_INSTALL -eq 1 ]
++echo $CRASH
++if [ $IS_INSTALL -eq 1 ];
+ then
+-	if [ $CRASH -eq 0 ]
++	if [ $CRASH -eq 0 ];
+ 	then
+ 		cat summary.html | sed -e "s/STATUS/<span style=\"color:#008000\">all test desks have been run<\/span>/g" > summary2.html
+ 	else
+@@ -109,7 +119,7 @@
+ mv summary2.html summary.html
+ 
+ #report table
+-if [ $IS_INSTALL -eq 1 ];
++if [ $IS_TABLE -eq 1 ];
+ then
+ 	cat << END > content.html
+ <table $(echo $H2_STYLE)><tr><td $(echo $H2_FONT)>List of tests</td></tr></table>
+@@ -136,25 +146,25 @@
+ 		  FONTL=$(echo "$BODY_FONTL bgcolor=#ffff00");
+ 		  echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" '
+ 		  { printf("<td %s id=FAILURE>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n\n",FONTL,$1,FONTC,$3,FONTC,$6,FONTL,$9,FONTL,$11);}
+-			  '; 
++		  '; 
+ 
+-		  else
++	  else
+ 
+ 		  #SUCCESS
+ 		  if [ "$STATUS" = "SUCCESS" ]
+ 		  then
+ 			  FONTC=$(echo "$BODY_FONTC bgcolor=#ddffdd")
+ 			  FONTL=$(echo "$BODY_FONTL bgcolor=#ddffdd")
++			  #do not write anything
+ 		  #ERROR
+ 		  else
+ 			  FONTC=$(echo "$BODY_FONTC bgcolor=#ffdddd id=ERROR")
+ 			  FONTL=$(echo "$BODY_FONTL bgcolor=#ffdddd")
++			  echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" '
++			  { printf("<td %s>%s</td>\n<td %s>%s%s%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n\n",FONTL,$1,FONTL,$3,$4,$5,FONTC,$8,FONTL,$11,FONTL,$13);}
++			  '; 
+ 		  fi
+ 
+-
+-		  echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" '
+-		  { printf("<td %s>%s</td>\n<td %s>%s%s%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n\n",FONTL,$1,FONTL,$3,$4,$5,FONTC,$8,FONTL,$11,FONTL,$13);}
+-			  '; 
+ 	  fi
+ 
+ 	  echo "</tr>"
Index: /issm/oecreview/Archive/12678-13393/ISSM-12767-12768.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12767-12768.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12767-12768.diff	(revision 13394)
@@ -0,0 +1,31 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 12767)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 12768)
+@@ -18,6 +18,7 @@
+ 
+ #Process matlab_log.log
+ cat matlab_log.log        | egrep 'ERROR|SUCCESS|FAILURE' | grep -v "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > matlab.log
++cat matlab.log        | grep -v "SUCCESS" > matlab_short.log
+ cat matlab_log.log        | grep "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > petscerror.log
+ NUM_TOT=`wc -l matlab.log | awk '{print $1}'`
+ NUM_ERR=`cat matlab.log | grep 'ERROR'   | grep -v "PETSC" | wc -l`
+@@ -131,7 +132,7 @@
+ <th $(echo $BODY_FONT)>Test name</th> 
+ <th $(echo $BODY_FONT)>Field checked</th>
+ </tr>
+-$(cat matlab.log | while read line
++$(cat matlab_short.log | while read line
+   do
+ 	  echo "<tr>"
+ 
+@@ -166,9 +167,7 @@
+ 		  fi
+ 
+ 	  fi
+-
+ 	  echo "</tr>"
+-
+   done
+ 	  )
+ </table>
Index: /issm/oecreview/Archive/12678-13393/ISSM-12768-12769.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12768-12769.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12768-12769.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 12768)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 12769)
+@@ -105,7 +105,6 @@
+ END
+ 
+ #update status
+-echo $CRASH
+ if [ $IS_INSTALL -eq 1 ];
+ then
+ 	if [ $CRASH -eq 0 ];
Index: /issm/oecreview/Archive/12678-13393/ISSM-12769-12770.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12769-12770.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12769-12770.diff	(revision 13394)
@@ -0,0 +1,9 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/Makefile.am	(revision 12769)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/Makefile.am	(revision 12770)
+@@ -1,2 +1,2 @@
+-EXTRA_DIST =  perl  pro 
+-SUBDIRS = c modules m  py
++EXTRA_DIST =  perl  pro  py
++SUBDIRS = c modules m
Index: /issm/oecreview/Archive/12678-13393/ISSM-12770-12771.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12770-12771.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12770-12771.diff	(revision 13394)
@@ -0,0 +1,356 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12771)
+@@ -28,6 +28,8 @@
+ 	case 140, name='SquareShelfConstrainedEnthalpyStea';
+ 	case 142, name='SquareShelfConstrainedEnthalpyTran';
+ 	case 144, name='SquareShelfConstrainedTransP3dEnth';
++	case 146, name='SquareShelfConstrainedTranIspddIsdeltaM2d';
++	case 148, name='SquareShelfConstrainedTranIspddIsdeltaP3d';
+ 	case 202, name='SquareShelfDiagM2d';
+ 	case 204, name='SquareShelfDiagM3d';
+ 	case 206, name='SquareShelfDiagP3d';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp	(revision 12771)
+@@ -38,8 +38,6 @@
+ 		if(VerboseSolution()) _pprintLine_("   call positive degree day module");
+ 		PositiveDegreeDayx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+ 	}
+-
+-
+ 	if(VerboseSolution()) _pprintLine_("   call computational core");
+ 	solver_linear(femmodel);
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12771)
+@@ -149,11 +149,11 @@
+ 	SettingsResultsAsPatchesEnum,
+ 	SettingsWaitonlockEnum,
+ 	SurfaceforcingsDelta18oEnum,
+-	SurfaceforcingsDelta18oTemperaturesPresentdayEnum,
+-	SurfaceforcingsDelta18oTemperaturesLgmEnum,
+ 	SurfaceforcingsDelta18oSurfaceEnum,
+ 	SurfaceforcingsIsdelta18oEnum,
+ 	SurfaceforcingsPrecipitationsPresentdayEnum,
++	SurfaceforcingsTemperaturesPresentdayEnum,
++	SurfaceforcingsTemperaturesLgmEnum,
+ 	DebugProfilingEnum,
+ 	ProfilingCurrentMemEnum,
+ 	ProfilingCurrentFlopsEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h	(revision 12771)
+@@ -17,7 +17,7 @@
+ void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
+ 				     IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime, 
+ 				     IssmDouble* PrecipitationsPresentday,
+-				     IssmDouble* Delta18oTemperaturesLgm, IssmDouble* Delta18oTemperaturesPresentday, 
++				     IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday, 
+ 					     IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout);
+ void   GetVerticesCoordinates(IssmDouble* xyz,  Node** nodes, int numvertices);
+ int    GetNumberOfDofs( Node** nodes,int numnodes,int setenum,int approximation_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 12771)
+@@ -8,7 +8,7 @@
+ void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
+ 				     IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime, 
+ 				     IssmDouble* PrecipitationsPresentday,
+-				     IssmDouble* Delta18oTemperaturesLgm, IssmDouble* Delta18oTemperaturesPresentday, 
++				     IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday, 
+ 				     IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout){
+ 
+   IssmDouble monthlytemperaturestmp[12],monthlyprectmp[12];
+@@ -19,12 +19,10 @@
+     /(Delta18oLgm-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceLgm-Delta18oSurfacePresent));
+   
+   for (int imonth = 0; imonth<12; imonth++){  
+-    monthlytemperaturestmp[imonth] = glacialindex*Delta18oTemperaturesLgm[imonth] + (1-glacialindex)*Delta18oTemperaturesPresentday[imonth];
++    monthlytemperaturestmp[imonth] = glacialindex*TemperaturesLgm[imonth] + (1-glacialindex)*TemperaturesPresentday[imonth];
+     monthlyprectmp[imonth] = 1.5*pow(2,((monthlytemperaturestmp[imonth]-0)/10)); //equation from rob's paper
+     /*Assign output pointer*/
+     *(monthlytemperaturesout+imonth) = monthlytemperaturestmp[imonth];
+     *(monthlyprecout+imonth) = monthlyprectmp[imonth];
+   }
+-
+-
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12771)
+@@ -158,11 +158,11 @@
+ 	      else if (strcmp(name,"SettingsResultsAsPatches")==0) return SettingsResultsAsPatchesEnum;
+ 	      else if (strcmp(name,"SettingsWaitonlock")==0) return SettingsWaitonlockEnum;
+ 	      else if (strcmp(name,"SurfaceforcingsDelta18o")==0) return SurfaceforcingsDelta18oEnum;
+-	      else if (strcmp(name,"SurfaceforcingsDelta18oTemperaturesPresentday")==0) return SurfaceforcingsDelta18oTemperaturesPresentdayEnum;
+-	      else if (strcmp(name,"SurfaceforcingsDelta18oTemperaturesLgm")==0) return SurfaceforcingsDelta18oTemperaturesLgmEnum;
+ 	      else if (strcmp(name,"SurfaceforcingsDelta18oSurface")==0) return SurfaceforcingsDelta18oSurfaceEnum;
+ 	      else if (strcmp(name,"SurfaceforcingsIsdelta18o")==0) return SurfaceforcingsIsdelta18oEnum;
+ 	      else if (strcmp(name,"SurfaceforcingsPrecipitationsPresentday")==0) return SurfaceforcingsPrecipitationsPresentdayEnum;
++	      else if (strcmp(name,"SurfaceforcingsTemperaturesPresentday")==0) return SurfaceforcingsTemperaturesPresentdayEnum;
++	      else if (strcmp(name,"SurfaceforcingsTemperaturesLgm")==0) return SurfaceforcingsTemperaturesLgmEnum;
+ 	      else if (strcmp(name,"DebugProfiling")==0) return DebugProfilingEnum;
+ 	      else if (strcmp(name,"ProfilingCurrentMem")==0) return ProfilingCurrentMemEnum;
+ 	      else if (strcmp(name,"ProfilingCurrentFlops")==0) return ProfilingCurrentFlopsEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12771)
+@@ -154,11 +154,11 @@
+ 		case SettingsResultsAsPatchesEnum : return "SettingsResultsAsPatches";
+ 		case SettingsWaitonlockEnum : return "SettingsWaitonlock";
+ 		case SurfaceforcingsDelta18oEnum : return "SurfaceforcingsDelta18o";
+-		case SurfaceforcingsDelta18oTemperaturesPresentdayEnum : return "SurfaceforcingsDelta18oTemperaturesPresentday";
+-		case SurfaceforcingsDelta18oTemperaturesLgmEnum : return "SurfaceforcingsDelta18oTemperaturesLgm";
+ 		case SurfaceforcingsDelta18oSurfaceEnum : return "SurfaceforcingsDelta18oSurface";
+ 		case SurfaceforcingsIsdelta18oEnum : return "SurfaceforcingsIsdelta18o";
+ 		case SurfaceforcingsPrecipitationsPresentdayEnum : return "SurfaceforcingsPrecipitationsPresentday";
++		case SurfaceforcingsTemperaturesPresentdayEnum : return "SurfaceforcingsTemperaturesPresentday";
++		case SurfaceforcingsTemperaturesLgmEnum : return "SurfaceforcingsTemperaturesLgm";
+ 		case DebugProfilingEnum : return "DebugProfiling";
+ 		case ProfilingCurrentMemEnum : return "ProfilingCurrentMem";
+ 		case ProfilingCurrentFlopsEnum : return "ProfilingCurrentFlops";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 12771)
+@@ -83,11 +83,8 @@
+ 	if(ispdd){
+ 		iomodel->FetchDataToInput(elements,ThermalSpctemperatureEnum);
+ 		if(isdelta18o){
+-			iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oEnum);
+-			iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oSurfaceEnum);
+-
+-			iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oTemperaturesLgmEnum);
+-			iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oTemperaturesPresentdayEnum);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsTemperaturesLgmEnum);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsTemperaturesPresentdayEnum);
+ 			iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationsPresentdayEnum);
+ 		}
+ 		else{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12771)
+@@ -909,9 +909,8 @@
+ /*}}}*/
+ /*FUNCTION Tria::Delta18oParameterization{{{*/
+ void  Tria::Delta18oParameterization(void){
+-
+ 	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+-	IssmDouble Delta18oTemperaturesPresentday[NUMVERTICES][12],Delta18oTemperaturesLgm[NUMVERTICES][12];
++	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
+ 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
+ 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
+ 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
+@@ -921,20 +920,19 @@
+ 	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+ 
+ 	/*Recover present day temperature and precipitation*/
+-	Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
+-	Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
++	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
++	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
+ 	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
+ 	GaussTria* gauss=new GaussTria();
+ 	for(int month=0;month<12;month++) {
+ 		for(int iv=0;iv<NUMVERTICES;iv++) {
+ 			gauss->GaussVertex(iv);
+-			input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
+-			input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
++			input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);
++			input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
+ 			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
+ 			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
+ 		}
+ 	}
+-
+ 	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
+ 	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
+ 	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
+@@ -948,10 +946,9 @@
+ 		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
+ 					Delta18oPresent, Delta18oLgm, Delta18oTime,
+ 					&PrecipitationsPresentday[iv][0], 
+-					&Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
++					&TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 
+ 					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
+ 	}
+-
+ 	/*Update inputs*/ 
+ 	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
+ 	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12771)
+@@ -688,7 +688,7 @@
+ void  Penta::Delta18oParameterization(void){
+ 
+ 	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+-	IssmDouble Delta18oTemperaturesPresentday[NUMVERTICES][12],Delta18oTemperaturesLgm[NUMVERTICES][12];
++	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
+ 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
+ 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
+ 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
+@@ -698,15 +698,15 @@
+ 	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+ 
+ 	/*Recover present day temperature and precipitation*/
+-	Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
+-	Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
++	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
++	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
+ 	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
+ 	GaussPenta* gauss=new GaussPenta();
+ 	for(int month=0;month<12;month++) {
+ 		for(int iv=0;iv<NUMVERTICES;iv++) {
+ 			gauss->GaussVertex(iv);
+-			input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
+-			input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
++			input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);
++			input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
+ 			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
+ 			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
+ 		}
+@@ -725,7 +725,7 @@
+ 		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
+ 					Delta18oPresent, Delta18oLgm, Delta18oTime,
+ 					&PrecipitationsPresentday[iv][0], 
+-					&Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
++					&TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 
+ 					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrude.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrude.m	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrude.m	(revision 12771)
+@@ -222,6 +222,9 @@
+ if ~isnan(md.inversion.min_parameters),md.inversion.min_parameters=project3d(md,'vector',md.inversion.min_parameters,'type','node');end;
+ if ~isnan(md.inversion.max_parameters),md.inversion.max_parameters=project3d(md,'vector',md.inversion.max_parameters,'type','node');end;
+ if ~isnan(md.qmu.partition),md.qmu.partition=project3d(md,'vector',md.qmu.partition','type','node');end
++if(md.surfaceforcings.isdelta18o),md.surfaceforcings.temperatures_lgm=project3d(md,'vector',md.surfaceforcings.temperatures_lgm,'type','node');end
++if(md.surfaceforcings.isdelta18o),md.surfaceforcings.temperatures_presentday=project3d(md,'vector',md.surfaceforcings.temperatures_presentday,'type','node');end
++if(md.surfaceforcings.isdelta18o),md.surfaceforcings.precipitations_presentday=project3d(md,'vector',md.surfaceforcings.precipitations_presentday,'type','node');end
+ 
+ %Put lithostatic pressure if there is an existing pressure
+ if ~isnan(md.initialization.pressure),
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m	(revision 12771)
+@@ -1,11 +0,0 @@
+-function macro=SurfaceforcingsDelta18oTemperaturesPresentdayEnum()
+-%SURFACEFORCINGSDELTA18OTEMPERATURESPRESENTDAYENUM - Enum of SurfaceforcingsDelta18oTemperaturesPresentday
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+-%            Please read src/c/EnumDefinitions/README for more information
+-%
+-%   Usage:
+-%      macro=SurfaceforcingsDelta18oTemperaturesPresentdayEnum()
+-
+-macro=StringToEnum('SurfaceforcingsDelta18oTemperaturesPresentday');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m	(revision 12771)
+@@ -1,11 +0,0 @@
+-function macro=SurfaceforcingsDelta18oTemperaturesLgmEnum()
+-%SURFACEFORCINGSDELTA18OTEMPERATURESLGMENUM - Enum of SurfaceforcingsDelta18oTemperaturesLgm
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+-%            Please read src/c/EnumDefinitions/README for more information
+-%
+-%   Usage:
+-%      macro=SurfaceforcingsDelta18oTemperaturesLgmEnum()
+-
+-macro=StringToEnum('SurfaceforcingsDelta18oTemperaturesLgm');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12771)
+@@ -1386,26 +1386,6 @@
+ 
+ 	return StringToEnum('SurfaceforcingsDelta18o')
+ 
+-def SurfaceforcingsDelta18oTemperaturesPresentdayEnum():
+-	"""
+-	SURFACEFORCINGSDELTA18OTEMPERATURESPRESENTDAYENUM - Enum of SurfaceforcingsDelta18oTemperaturesPresentday
+-
+-	   Usage:
+-	      macro=SurfaceforcingsDelta18oTemperaturesPresentdayEnum()
+-	"""
+-
+-	return StringToEnum('SurfaceforcingsDelta18oTemperaturesPresentday')
+-
+-def SurfaceforcingsDelta18oTemperaturesLgmEnum():
+-	"""
+-	SURFACEFORCINGSDELTA18OTEMPERATURESLGMENUM - Enum of SurfaceforcingsDelta18oTemperaturesLgm
+-
+-	   Usage:
+-	      macro=SurfaceforcingsDelta18oTemperaturesLgmEnum()
+-	"""
+-
+-	return StringToEnum('SurfaceforcingsDelta18oTemperaturesLgm')
+-
+ def SurfaceforcingsDelta18oSurfaceEnum():
+ 	"""
+ 	SURFACEFORCINGSDELTA18OSURFACEENUM - Enum of SurfaceforcingsDelta18oSurface
+@@ -1436,6 +1416,26 @@
+ 
+ 	return StringToEnum('SurfaceforcingsPrecipitationsPresentday')
+ 
++def SurfaceforcingsTemperaturesPresentdayEnum():
++	"""
++	SURFACEFORCINGSTEMPERATURESPRESENTDAYENUM - Enum of SurfaceforcingsTemperaturesPresentday
++
++	   Usage:
++	      macro=SurfaceforcingsTemperaturesPresentdayEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsTemperaturesPresentday')
++
++def SurfaceforcingsTemperaturesLgmEnum():
++	"""
++	SURFACEFORCINGSTEMPERATURESLGMENUM - Enum of SurfaceforcingsTemperaturesLgm
++
++	   Usage:
++	      macro=SurfaceforcingsTemperaturesLgmEnum()
++	"""
++
++	return StringToEnum('SurfaceforcingsTemperaturesLgm')
++
+ def DebugProfilingEnum():
+ 	"""
+ 	DEBUGPROFILINGENUM - Enum of DebugProfiling
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m	(revision 12770)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m	(revision 12771)
+@@ -84,6 +84,7 @@
+ 			fielddisplay(obj,'temperatures_presentday','monthly present day surface temperatures [Kelvin], required if pdd is activated and delta18o activated');
+ 			fielddisplay(obj,'temperatures_lgm','monthly LGM surface temperatures [Kelvin], required if pdd is activated and delta18o activated');
+ 			fielddisplay(obj,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o activated');
++			fielddisplay(obj,'delta18o','delta18o, required if pdd is activated and delta18o activated');
+ 			fielddisplay(obj,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated');
+ 			fielddisplay(obj,'issmbgradients','is smb gradients method activated (0 or 1, default is 0)');
+ 			fielddisplay(obj,'hc',' elevation of intersection between accumulation and ablation regime required if smb gradients is activated');
+@@ -106,6 +107,7 @@
+ 			        WriteData(fid,'object',obj,'fieldname','temperatures_lgm','format','DoubleMat','mattype',1);
+ 			        WriteData(fid,'object',obj,'fieldname','precipitations_presentday','format','DoubleMat','mattype',1);
+ 			        WriteData(fid,'object',obj,'fieldname','delta18o_surface','format','DoubleMat','mattype',1);
++			        WriteData(fid,'object',obj,'fieldname','delta18o','format','DoubleMat','mattype',1);
+ 			  else
+ 				WriteData(fid,'object',obj,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1);
+ 				WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12771-12772.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12771-12772.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12771-12772.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12771)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12772)
+@@ -28,8 +28,6 @@
+ 	case 140, name='SquareShelfConstrainedEnthalpyStea';
+ 	case 142, name='SquareShelfConstrainedEnthalpyTran';
+ 	case 144, name='SquareShelfConstrainedTransP3dEnth';
+-	case 146, name='SquareShelfConstrainedTranIspddIsdeltaM2d';
+-	case 148, name='SquareShelfConstrainedTranIspddIsdeltaP3d';
+ 	case 202, name='SquareShelfDiagM2d';
+ 	case 204, name='SquareShelfDiagM3d';
+ 	case 206, name='SquareShelfDiagP3d';
Index: /issm/oecreview/Archive/12678-13393/ISSM-12772-12773.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12772-12773.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12772-12773.diff	(revision 13394)
@@ -0,0 +1,390 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 12773)
+@@ -4,7 +4,7 @@
+ rm -rf install
+ 
+ #Select or create a new simlink
+-ln -s /usr/local/pkgs/matlab-7.6/ install
++#ln -s /usr/local/pkgs/matlab-7.6/ install
+ #ln -s /discover/vis/mathworks/matlab_r2011b/ install
+ #ln -s /usr/local/matlab704/ install
+ #ln -s /usr/local/matlab711/ install
+@@ -15,4 +15,5 @@
+ #ln -s /Applications/MATLAB_R2009a.app/ install
+ #ln -s /Applications/MATLAB_R2010a.app/ install
+ #ln -s /Applications/MATLAB_R2012a.app/ install
++ln -s /Applications/MATLAB_R2011a.app/ install
+ #ln -s /Applications/MATLAB*.app/ install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12773)
+@@ -693,10 +693,16 @@
+ syn keyword cConstant SettingsOutputFrequencyEnum
+ syn keyword cConstant SettingsResultsAsPatchesEnum
+ syn keyword cConstant SettingsWaitonlockEnum
+-syn keyword cConstant DebugPetscProfilingEnum
+-syn keyword cConstant PetscProfilingCurrentMemEnum
+-syn keyword cConstant PetscProfilingCurrentFlopsEnum
+-syn keyword cConstant PetscProfilingSolutionTimeEnum
++syn keyword cConstant SurfaceforcingsDelta18oEnum
++syn keyword cConstant SurfaceforcingsDelta18oTemperaturesPresentdayEnum
++syn keyword cConstant SurfaceforcingsDelta18oTemperaturesLgmEnum
++syn keyword cConstant SurfaceforcingsDelta18oSurfaceEnum
++syn keyword cConstant SurfaceforcingsIsdelta18oEnum
++syn keyword cConstant SurfaceforcingsPrecipitationsPresentdayEnum
++syn keyword cConstant DebugProfilingEnum
++syn keyword cConstant ProfilingCurrentMemEnum
++syn keyword cConstant ProfilingCurrentFlopsEnum
++syn keyword cConstant ProfilingSolutionTimeEnum
+ syn keyword cConstant MaxIterationConvergenceFlagEnum
+ syn keyword cConstant SteadystateMaxiterEnum
+ syn keyword cConstant SteadystateNumRequestedOutputsEnum
+@@ -796,6 +802,7 @@
+ syn keyword cConstant IntInputEnum
+ syn keyword cConstant IntParamEnum
+ syn keyword cConstant IntVecParamEnum
++syn keyword cConstant TransientParamEnum
+ syn keyword cConstant MacAyeal2dIceFrontEnum
+ syn keyword cConstant MacAyeal3dIceFrontEnum
+ syn keyword cConstant MaticeEnum
+@@ -915,6 +922,7 @@
+ syn keyword cConstant StressTensoryzEnum
+ syn keyword cConstant StressTensorzzEnum
+ syn keyword cConstant IceVolumeEnum
++syn keyword cConstant TotalSmbEnum
+ syn keyword cConstant P0Enum
+ syn keyword cConstant P1Enum
+ syn keyword cConstant P1DGEnum
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12773)
+@@ -401,6 +401,7 @@
+ 	StressTensoryzEnum,
+ 	StressTensorzzEnum,
+ 	IceVolumeEnum,
++	TotalSmbEnum,
+ 	/*}}}*/
+ 	/*Element Interpolations{{{1*/
+ 	P0Enum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 12773)
+@@ -73,6 +73,7 @@
+ 		case SurfaceforcingsBNegEnum:						scale=yts;break; //m/yr
+ 		case MisfitEnum:                             scale=pow(yts,2);break; //(m/yr)^2
+ 		case MassFluxEnum:                           scale=pow((IssmDouble)10,-12)*yts;break; // (GigaTon/year)
++		case TotalSmbEnum:                           scale=pow((IssmDouble)10,-12)*yts;break; // (GigaTon/year)
+ 		default: scale=1.0; break;
+ 	}
+ 	return scale;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12773)
+@@ -402,6 +402,7 @@
+ 	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
+ 	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
+ 	      else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
++	      else if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum;
+ 	      else if (strcmp(name,"P0")==0) return P0Enum;
+ 	      else if (strcmp(name,"P1")==0) return P1Enum;
+ 	      else if (strcmp(name,"P1DG")==0) return P1DGEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 12773)
+@@ -40,6 +40,7 @@
+ 		case SurfaceAverageVelMisfitEnum:SurfaceAverageVelMisfitx( responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+ 		case ThicknessAbsMisfitEnum:     ThicknessAbsMisfitx(      responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+ 		case ThicknessAbsGradientEnum:   ThicknessAbsGradientx(    responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
++		case TotalSmbEnum:					TotalSmbx(                responses, elements,nodes, vertices, loads, materials, parameters,process_units); break;
+ 		case RheologyBbarAbsGradientEnum:RheologyBbarAbsGradientx( responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+ 		case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+ 		case MaterialsRheologyBbarEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,MaterialsRheologyBbarEnum,process_units); break;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12773)
+@@ -392,6 +392,7 @@
+ 		case StressTensoryzEnum : return "StressTensoryz";
+ 		case StressTensorzzEnum : return "StressTensorzz";
+ 		case IceVolumeEnum : return "IceVolume";
++		case TotalSmbEnum : return "TotalSmb";
+ 		case P0Enum : return "P0";
+ 		case P1Enum : return "P1";
+ 		case P1DGEnum : return "P1DG";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h	(revision 12773)
+@@ -36,6 +36,7 @@
+ #include "./Gradjx/Gradjx.h"
+ #include "./GroundinglineMigrationx/GroundinglineMigrationx.h"
+ #include "./HoleFillerx/HoleFillerx.h"
++#include "./TotalSmbx/TotalSmbx.h"
+ #include "./IceVolumex/IceVolumex.h"
+ #include "./InputControlUpdatex/InputControlUpdatex.h"
+ #include "./InputConvergencex/InputConvergencex.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp	(revision 12773)
+@@ -31,6 +31,10 @@
+ 					Responsex(&output_value,elements,nodes,vertices,loads,materials,parameters,"IceVolume",false,0);
+ 					results->AddObject(new DoubleExternalResult(results->Size()+1,IceVolumeEnum,output_value,step,time));
+ 					break;
++				case TotalSmbEnum:
++					Responsex(&output_value,elements,nodes,vertices,loads,materials,parameters,"TotalSmb",false,0);
++					results->AddObject(new DoubleExternalResult(results->Size()+1,TotalSmbEnum,output_value,step,time));
++					break;
+ 				default:
+ 					/*create this output in the element inputs, and then transfer to results:*/
+ 					for(int j=0;j<elements->Size();j++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h	(revision 12773)
+@@ -0,0 +1,14 @@
++/*!\file:  TotalSmbx.h
++ * \brief header file for inverse methods misfit computation
++ */ 
++
++#ifndef _TOTALSMBX_H
++#define _TOTALSMBX_H
++
++#include "../../Container/Container.h"
++#include "../../objects/objects.h"
++
++/* local prototypes: */
++void TotalSmbx(double* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.cpp	(revision 12773)
+@@ -0,0 +1,30 @@
++/*!\file TotalSmbx
++ * \brief: compute total ice sheet surface mass balance 
++ */
++
++#include "./TotalSmbx.h"
++
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../toolkits/toolkits.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++void TotalSmbx(double* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++
++	double local_smb = 0;
++	double total_smb;
++
++	for(int i=0;i<elements->Size();i++){
++		Element* element=(Element*)elements->GetObjectByOffset(i);
++		local_smb+=element->TotalSmb();
++	}
++	#ifdef _HAVE_MPI_
++	MPI_Reduce(&local_smb,&total_smb,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
++	MPI_Bcast(&total_smb,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
++	#else
++	total_smb=local_smb;
++	#endif
++
++	/*Assign output pointers: */
++	*pSmb=total_smb;
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12773)
+@@ -527,6 +527,8 @@
+ 					     ./modules/MinVyx/MinVyx.cpp\
+ 					     ./modules/MinVzx/MinVzx.h\
+ 					     ./modules/MinVzx/MinVzx.cpp\
++					     ./modules/TotalSmbx/TotalSmbx.h\
++					     ./modules/TotalSmbx/TotalSmbx.cpp\
+ 					     ./modules/IceVolumex/IceVolumex.h\
+ 					     ./modules/IceVolumex/IceVolumex.cpp\
+ 					     ./modules/ElementResponsex/ElementResponsex.h\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h	(revision 12773)
+@@ -92,6 +92,7 @@
+ 		virtual IssmDouble MassFlux(IssmDouble* segment,bool process_units)=0;
+ 		virtual void   ElementResponse(IssmDouble* presponse,int response_enum,bool process_units)=0;
+ 		virtual IssmDouble IceVolume(void)=0;
++		virtual IssmDouble TotalSmb(void)=0;
+ 		#endif
+ 
+ 		#ifdef _HAVE_CONTROL_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12773)
+@@ -2805,6 +2805,38 @@
+ 
+ }
+ /*}}}*/
++/*FUNCTION Tria::TotalSmb {{{*/
++IssmDouble Tria::TotalSmb(void){
++
++	/*The smb[kg yr-1] of one element is area[m2] * smb [kg m^-2 yr^-1]*/
++	IssmDouble base,smb,rho_ice;
++	IssmDouble Total_Smb=0;
++	IssmDouble xyz_list[NUMVERTICES][3];
++
++	/*Get material parameters :*/
++	rho_ice=matpar->GetRhoIce();
++
++   if(IsOnWater())return 0;
++
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*First calculate the area of the base (cross section triangle)
++	 * http://en.wikipedia.org/wiki/Triangle
++	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
++	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));	// area of element in m2
++
++	/*Now get the average SMB over the element*/
++	Input* smb_input = inputs->GetInput(SurfaceforcingsMassBalanceEnum); _assert_(smb_input);
++	smb_input->GetInputAverage(&smb);																								// average smb on element in m ice s-1
++   Total_Smb=rho_ice*base*smb;																											// smb on element in kg s-1
++	
++	/*Process units: */
++	Total_Smb=UnitConversion(Total_Smb,IuToExtEnum,TotalSmbEnum);																// smb on element in GigaTon yr-1
++	
++	/*Return: */
++	return Total_Smb;
++}
++/*}}}*/
+ #endif
+ 
+ #ifdef _HAVE_DIAGNOSTIC_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h	(revision 12773)
+@@ -120,6 +120,7 @@
+ 
+ 		#ifdef _HAVE_RESPONSES_
+ 		IssmDouble IceVolume(void);
++		IssmDouble TotalSmb(void);
+ 		void   MinVel(IssmDouble* pminvel, bool process_units);
+ 		void   MinVx(IssmDouble* pminvx, bool process_units);
+ 		void   MinVy(IssmDouble* pminvy, bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12773)
+@@ -3234,6 +3234,38 @@
+ 
+ }
+ /*}}}*/
++/*FUNCTION Penta::TotalSmb {{{*/
++IssmDouble Penta::TotalSmb(void){
++
++	/*The smb[Gt yr-1] of one element is area[m2] * smb [ m ice yr^-1] * rho_ice [kg m-3] / 1e+10^12 */
++	IssmDouble base,smb,rho_ice;
++	IssmDouble Total_Smb=0;
++	IssmDouble xyz_list[NUMVERTICES][3];
++
++	/*Get material parameters :*/
++	rho_ice=matpar->GetRhoIce();
++
++	if(IsOnWater())return 0;
++
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*First calculate the area of the base (cross section triangle)
++	 * http://en.wikipedia.org/wiki/Triangle
++	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
++	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
++
++	/*Now get the average SMB over the element*/
++	Input* smb_input = inputs->GetInput(SurfaceforcingsMassBalanceEnum); _assert_(smb_input);
++	smb_input->GetInputAverage(&smb);
++	Total_Smb=rho_ice*base*smb;																											// smb on element in kg s-1
++	
++	/*Process units: */
++	Total_Smb=UnitConversion(Total_Smb,IuToExtEnum,TotalSmbEnum);																// smb on element in GigaTon yr-1
++	
++	/*Return: */
++	return Total_Smb;
++}
++/*}}}*/
+ #endif
+ 
+ #ifdef _HAVE_THERMAL_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h	(revision 12773)
+@@ -122,6 +122,7 @@
+ 
+ 		 #ifdef _HAVE_RESPONSES_
+ 		IssmDouble IceVolume(void);
++		IssmDouble TotalSmb(void);
+ 		void   MinVel(IssmDouble* pminvel, bool process_units);
+ 		void   MinVx(IssmDouble* pminvx, bool process_units);
+ 		void   MinVy(IssmDouble* pminvy, bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 12773)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=455;
++macro=456;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12772)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12773)
+@@ -3766,6 +3766,16 @@
+ 
+ 	return StringToEnum('IceVolume')
+ 
++def TotalSmbEnum():
++	"""
++	TOTALSMBENUM - Enum of TotalSmb
++
++	   Usage:
++	      macro=TotalSmbEnum()
++	"""
++
++	return StringToEnum('TotalSmb')
++
+ def P0Enum():
+ 	"""
+ 	P0ENUM - Enum of P0
+@@ -4564,5 +4574,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 455
++	return 456
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/TotalSmbEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/TotalSmbEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/TotalSmbEnum.m	(revision 12773)
+@@ -0,0 +1,11 @@
++function macro=TotalSmbEnum()
++%TOTALSMBENUM - Enum of TotalSmb
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=TotalSmbEnum()
++
++macro=StringToEnum('TotalSmb');
Index: /issm/oecreview/Archive/12678-13393/ISSM-12773-12774.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12773-12774.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12773-12774.diff	(revision 13394)
@@ -0,0 +1,20 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 12773)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 12774)
+@@ -4,7 +4,7 @@
+ rm -rf install
+ 
+ #Select or create a new simlink
+-#ln -s /usr/local/pkgs/matlab-7.6/ install
++ln -s /usr/local/pkgs/matlab-7.6/ install
+ #ln -s /discover/vis/mathworks/matlab_r2011b/ install
+ #ln -s /usr/local/matlab704/ install
+ #ln -s /usr/local/matlab711/ install
+@@ -15,5 +15,5 @@
+ #ln -s /Applications/MATLAB_R2009a.app/ install
+ #ln -s /Applications/MATLAB_R2010a.app/ install
+ #ln -s /Applications/MATLAB_R2012a.app/ install
+-ln -s /Applications/MATLAB_R2011a.app/ install
++#ln -s /Applications/MATLAB_R2011a.app/ install
+ #ln -s /Applications/MATLAB*.app/ install
Index: /issm/oecreview/Archive/12678-13393/ISSM-12774-12775.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12774-12775.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12774-12775.diff	(revision 13394)
@@ -0,0 +1,27 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h	(revision 12774)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h	(revision 12775)
+@@ -52,19 +52,19 @@
+    do{std::cout << StreamArgs << std::endl;}while(0)
+ /*}}}*/
+ /* _printString_ {{{*/
+-/* macro to print some string, adds std::ends */
++/* macro to print some string */
+ #define _printString_(StreamArgs)\
+    do{std::cout << StreamArgs;}while(0)
+ /*}}}*/
+ /* _pprintLine_ {{{*/
+-/* macro to print a line, adds std::endl */
++/* macro to print a line, adds std::endl, only on cpu 0 */
+ #define _pprintLine_(StreamArgs)\
+   do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+ 	  aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
+ 	  PrintfFunction(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+ /*}}}*/
+ /* _pprintString_ {{{*/
+-/* macro to print some string, adds std::ends */
++/* macro to print some string. Only on cpu0 */
+ #define _pprintString_(StreamArgs)\
+   do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+ 	  aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
Index: /issm/oecreview/Archive/12678-13393/ISSM-12775-12776.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12775-12776.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12775-12776.diff	(revision 13394)
@@ -0,0 +1,89 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 12775)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 12776)
+@@ -46,10 +46,12 @@
+ //void FetchData(Parameters** pparameters, DataHandle py_ref);
+ void FetchData(double** pvector,int* pM,PyObject* py_ref);
+ void FetchData(double** pmatrix,int* pM,int *pN,PyObject* py_array);
++void FetchData(int** pmatrix,int* pM,int *pN,PyObject* py_matrix);
+ void FetchData(char** pstring,PyObject* py_unicode);
+ void FetchData(double* pscalar,PyObject* py_float);
+ void FetchData(int* pinteger,PyObject* py_long);
+ void FetchData(bool* pbool,PyObject* py_boolean);
++void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments);
+ 
+ int CheckNumPythonArguments(PyObject* inputs,int NRHS, void (*function)( void ));
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 12775)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 12776)
+@@ -14,6 +14,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../include/include.h"
+ #include "../../shared/shared.h"
++#include "../../io/io.h"
+ 
+ /*Primitive data types*/
+ /*FUNCTION FetchData(double* pscalar,PyObject* py_float){{{*/
+@@ -80,6 +81,38 @@
+ 	if(pmatrix)*pmatrix=matrix;
+ }
+ /*}}}*/
++/*FUNCTION FetchData(int** pmatrix,int* pM, int* pN, PyObject* py_matrix){{{*/
++void FetchData(int** pmatrix,int* pM,int *pN,PyObject* py_matrix){
++
++	/*output: */
++	double* dmatrix=NULL;
++	int* matrix=NULL;
++	int M,N;
++
++	/*intermediary:*/
++	int i;
++	int ndim;
++	npy_intp*  dims=NULL;
++
++	/*retrive dimensions: */
++	ndim=PyArray_NDIM((const PyArrayObject*)py_matrix);
++	if(ndim!=2)_error2_("expecting an MxN matrix in input!");
++	dims=PyArray_DIMS((PyArrayObject*)py_matrix);
++	M=dims[0]; N=dims[1];
++	
++	/*retrieve internal value: */
++	dmatrix=(double*)PyArray_DATA((PyArrayObject*)py_matrix);
++
++	/*transform into integer matrix: */
++	matrix=xNew<int>(M*N);
++	for(i=0;i<M*N;i++)matrix[i]=(int)dmatrix[i];
++
++	/*output: */
++	if(pM)*pM=M;
++	if(pN)*pN=N;
++	if(pmatrix)*pmatrix=matrix;
++}
++/*}}}*/
+ /*FUNCTION FetchData(double** pvector,int* pM, PyObject* py_vector){{{*/
+ void FetchData(double** pvector,int* pM,PyObject* py_vector){
+ 
+@@ -103,7 +136,20 @@
+ 	if(pvector)*pvector=vector;
+ }
+ /*}}}*/
++/*FUNCTION FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments){{{*/
++void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments){
+ 
++	/*Initialize output*/
++	Options* options=new Options();
++
++	_pprintLine_("FetchData for Options not implemented yet, ignoring them!");
++
++	/*Assign output pointers:*/
++	*poptions=options;
++
++}
++/*}}}*/
++
+ /*Python version dependent: */
+ #if _PYTHON_MAJOR_ >= 3 
+ /*FUNCTION FetchData(char** pstring,PyObject* py_unicode){{{*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-12776-12777.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12776-12777.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12776-12777.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp	(revision 12776)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp	(revision 12777)
+@@ -11,6 +11,7 @@
+ #endif
+ #include "../../include/macros.h"
+ #include "../shared.h"
++#include "../../io/io.h"
+ /*}}}*/
+ 
+ void ProfilingStart(double* pTime_start, double* pFlops_start){
Index: /issm/oecreview/Archive/12678-13393/ISSM-12777-12778.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12777-12778.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12777-12778.diff	(revision 13394)
@@ -0,0 +1,33 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp	(revision 12777)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp	(revision 12778)
+@@ -43,7 +43,7 @@
+ 	FetchData(&data,&M_data,&N_data,DATA);    if(M_data*N_data<1) _error2_("data is empty");
+ 	FetchData(&x_interp,&N_interp,XINTERP);   if(N_interp<1) _error2_("no interpolation requested");
+ 	FetchData(&y_interp,&test,YINTERP);       if(test!=N_interp) _error2_("vectors x_interp and y_interp should have the same length");
+-	FetchData(&options,NRHS,nrhs,prhs);
++	FetchData(&options,NRHS,nrhs,ARGUMENTS);
+ 
+ 	/*Run core computations*/
+ 	InterpFromMeshToMesh2dx(&data_interp,index,x_data,y_data,nods_data,nels_data,data,M_data,N_data,x_interp,y_interp,N_interp,options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h	(revision 12777)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h	(revision 12778)
+@@ -41,6 +41,7 @@
+ #define DATA prhs[3]
+ #define XINTERP prhs[4]
+ #define YINTERP prhs[5]
++#define ARGUMENTS prhs
+ 
+ /* serial output macros: */
+ #define DATAINTERP (mxArray**)&plhs[0]
+@@ -54,6 +55,7 @@
+ #define DATA PyTuple_GetItem(args,3)
+ #define XINTERP PyTuple_GetItem(args,4)
+ #define YINTERP PyTuple_GetItem(args,5)
++#define ARGUMENTS args
+ 
+ /* serial output macros: */
+ #define DATAINTERP output,0
Index: /issm/oecreview/Archive/12678-13393/ISSM-12778-12779.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12778-12779.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12778-12779.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh	(revision 12778)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh	(revision 12779)
+@@ -188,6 +188,7 @@
+ GMAKE_DIR="$ISSM_DIR/externalpackages/gmake/install"
+ 
+ #PYTHON
++PYTHON_VER=2.7
+ PYTHON_DIR="$ISSM_DIR/externalpackages/python/install"
+ PYTHONSTARTUP="$ISSM_DIR/startup.py"
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12779-12780.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12779-12780.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12779-12780.diff	(revision 13394)
@@ -0,0 +1,20 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-python.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-python.sh	(revision 12779)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-python.sh	(revision 12780)
+@@ -3,11 +3,14 @@
+ #petsc 3.2
+ #mpich 1.4
+ 
++pythonversion=2.7
++
+ ./configure \
+ 	--prefix=$ISSM_DIR \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+ 	--with-python-dir=$ISSM_DIR/externalpackages/python/install\
+-	--with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy\
++	--with-python-version=$pythonversion \
++	--with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/lib/python$pythonversion/site-packages/numpy/core/include/numpy\
+ 	--with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
+ 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
+ 	--with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
Index: /issm/oecreview/Archive/12678-13393/ISSM-12780-12781.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12780-12781.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12780-12781.diff	(revision 13394)
@@ -0,0 +1,87 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test358.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test358.m	(revision 12780)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test358.m	(revision 12781)
+@@ -11,14 +11,15 @@
+ md.surfaceforcings.a_neg=-20000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
+ md.surfaceforcings.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y;
+ md.surfaceforcings.hc=(md.surfaceforcings.a_pos-md.surfaceforcings.a_neg)./(md.surfaceforcings.b_neg-md.surfaceforcings.b_pos);
++md.transient.requested_outputs=TotalSmbEnum();
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Bed1','Surface1','Thickness1','Temperature1','SMB1','Vx2','Vy2','Vz2','Vel2','Bed2','Surface2','Thickness2','Temperature2','SMB2','Vx3','Vy3','Vz3','Vel3','Bed3','Surface3','Thickness3','Temperature3','SMB3'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-						1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-						1e-09,5e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Bed1','Surface1','Thickness1','Temperature1','SMB1','TotalSmb1','Vx2','Vy2','Vz2','Vel2','Bed2','Surface2','Thickness2','Temperature2','SMB2','TotalSmb1','Vx3','Vy3','Vz3','Vel3','Bed3','Surface3','Thickness3','Temperature3','SMB3','TotalSmb1'};
++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-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++						1e-09,5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
+ 
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+@@ -30,6 +31,7 @@
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+ 	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(1).TotalSmb),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -39,6 +41,7 @@
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+ 	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(2).TotalSmb),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -48,4 +51,5 @@
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+ 	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(3).TotalSmb),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m	(revision 12780)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m	(revision 12781)
+@@ -10,12 +10,13 @@
+ md.surfaceforcings.a_neg=-20000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
+ md.surfaceforcings.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y;
+ md.surfaceforcings.hc=(md.surfaceforcings.a_pos-md.surfaceforcings.a_neg)./(md.surfaceforcings.b_neg-md.surfaceforcings.b_pos);
++md.transient.requested_outputs=TotalSmbEnum();
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vel1','Bed1','Surface1','Thickness1','SMB1','Vx2','Vy2','Vel2','Bed2','Surface2','Thickness2','SMB2','Vx3','Vy3','Vel3','Bed3','Surface3','Thickness3','SMB3'};
+-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_names     ={'Vx1','Vy1','Vel1','Bed1','Surface1','Thickness1','SMB1','TotalSmb1','Vx2','Vy2','Vel2','Bed2','Surface2','Thickness2','SMB2','TotalSmb2','Vx3','Vy3','Vel3','Bed3','Surface3','Thickness3','SMB3','TotalSmb3'};
++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};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+ 	(md.results.TransientSolution(1).Vy),...
+@@ -24,12 +25,14 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(1).TotalSmb),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vel),...
+ 	(md.results.TransientSolution(2).Bed),...
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).TotalSmb),...
+ 	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+@@ -38,4 +41,5 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(3).TotalSmb),...
+ 	};
Index: /issm/oecreview/Archive/12678-13393/ISSM-12781-12782.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12781-12782.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12781-12782.diff	(revision 13394)
@@ -0,0 +1,8 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive358.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive356.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12782-12783.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12782-12783.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12782-12783.diff	(revision 13394)
@@ -0,0 +1,14 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12782)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12783)
+@@ -3246,7 +3246,8 @@
+ 	rho_ice=matpar->GetRhoIce();
+ 
+ 	if(IsOnWater())return 0;
+-
++	if(IsOnWater() || !IsOnSurface())return 0;
++	
+ 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+ 
+ 	/*First calculate the area of the base (cross section triangle)
Index: /issm/oecreview/Archive/12678-13393/ISSM-12783-12784.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12783-12784.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12783-12784.diff	(revision 13394)
@@ -0,0 +1,27 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12783)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12784)
+@@ -3245,8 +3245,7 @@
+ 	/*Get material parameters :*/
+ 	rho_ice=matpar->GetRhoIce();
+ 
+-	if(IsOnWater())return 0;
+-	if(IsOnWater() || !IsOnSurface())return 0;
++	if(IsOnWater() || !IsOnSurface()) return 0.;
+ 	
+ 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+ 
+@@ -3258,10 +3257,10 @@
+ 	/*Now get the average SMB over the element*/
+ 	Input* smb_input = inputs->GetInput(SurfaceforcingsMassBalanceEnum); _assert_(smb_input);
+ 	smb_input->GetInputAverage(&smb);
+-	Total_Smb=rho_ice*base*smb;																											// smb on element in kg s-1
++	Total_Smb=rho_ice*base*smb;// smb on element in kg s-1
+ 	
+ 	/*Process units: */
+-	Total_Smb=UnitConversion(Total_Smb,IuToExtEnum,TotalSmbEnum);																// smb on element in GigaTon yr-1
++	Total_Smb=UnitConversion(Total_Smb,IuToExtEnum,TotalSmbEnum);// smb on element in GigaTon yr-1
+ 	
+ 	/*Return: */
+ 	return Total_Smb;
Index: /issm/oecreview/Archive/12678-13393/ISSM-12784-12785.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12784-12785.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12784-12785.diff	(revision 13394)
@@ -0,0 +1,58 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 12784)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 12785)
+@@ -323,7 +323,24 @@
+ 	
+ 	if test -d "$PYTHON_ROOT"; then
+ 		dnl defaults
++		HAVE_PYTHON3="no"
+ 		HAVE_PYTHON=yes
++		
++		AC_ARG_WITH([python-version],
++		  AS_HELP_STRING([--with-python-version = PYTHONVERSION],[python version.]),
++		  [PYTHONVERSION=$withval],[PYTHONVERSION=""])
++		AC_MSG_CHECKING(for python version)
++
++		dnl recover major: 
++		PYTHON_MAJOR=${PYTHONVERSION%.*}
++
++		if test x$PYTHON_MAJOR = x3; then
++			dnl are we running python 3?
++			HAVE_PYTHON3="yes"
++		fi
++		AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_],$PYTHON_MAJOR,[python version major])
++		AC_MSG_RESULT($PYTHON_MAJOR)
++
+ 		PYTHONINCL=-I$PYTHON_ROOT/include
+ 		PYTHONLIB="-L$PYTHON_ROOT/lib -lpython$PYTHONVERSION"
+ 		PYTHONEXT=.so
+@@ -350,27 +367,9 @@
+ 		HAVE_PYTHON=no
+ 	fi
+ 	AM_CONDITIONAL([PYTHON], [test x$HAVE_PYTHON = xyes])
++	AM_CONDITIONAL([PYTHON3], [test x$HAVE_PYTHON3 = xyes])
+ 	AC_MSG_RESULT($HAVE_PYTHON)
+ 
+-	dnl python-version
+-	HAVE_PYTHON3="no"
+-	if test x$HAVE_PYTHON = xyes; then
+-		AC_ARG_WITH([python-version],
+-		  AS_HELP_STRING([--with-python-version = PYTHONVERSION],[python version.]),
+-		  [PYTHONVERSION=$withval],[PYTHONVERSION=""])
+-		AC_MSG_CHECKING(for python version)
+-
+-		dnl recover major: 
+-		PYTHON_MAJOR=${PYTHONVERSION%.*}
+-
+-		if test x$PYTHON_MAJOR = x3; then
+-			dnl are we running python 3?
+-			HAVE_PYTHON3="yes"
+-		fi
+-		AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_],$PYTHON_MAJOR,[python version major])
+-		AC_MSG_RESULT($PYTHON_MAJOR)
+-	fi
+-	AM_CONDITIONAL([PYTHON3], [test x$HAVE_PYTHON3 = xyes])
+ 	dnl }}}
+ 	dnl python-numpy{{{
+ 	AC_ARG_WITH([python-numpy-dir],
Index: /issm/oecreview/Archive/12678-13393/ISSM-12785-12786.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12785-12786.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12785-12786.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 12785)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 12786)
+@@ -67,7 +67,6 @@
+ from debug import *
+ from settings import *
+ from solver import *
+-from issmtier  import * 
+ from ismumps  import * 
+ from pairoptions  import * 
+ from petscversion  import * 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12786-12787.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12786-12787.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12786-12787.diff	(revision 13394)
@@ -0,0 +1,433 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12786)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12787)
+@@ -8,290 +8,152 @@
+ 
+ def IdToName(id):
+ 	idname={
+-		101 : 'SquareShelfConstrainedDiagM2dSerial',
+-		102 : 'SquareShelfConstrainedDiagM2dParallel',
+-		103 : 'SquareShelfConstrainedDiagM3dSerial',
+-		104 : 'SquareShelfConstrainedDiagM3dParallel',
+-		105 : 'SquareShelfConstrainedDiagP3dSerial',
+-		106 : 'SquareShelfConstrainedDiagP3dParallel',
+-		107 : 'SquareShelfConstrainedDiagS3dSerial',
+-		108 : 'SquareShelfConstrainedDiagS3dParallel',
+-		109 : 'SquareShelfConstrainedProg2dSerial',
+-		110 : 'SquareShelfConstrainedProg2dParallel',
+-		111 : 'SquareShelfConstrainedProg2dDGSerial',
+-		112 : 'SquareShelfConstrainedProg2dDGParallel',
+-		113 : 'SquareShelfConstrainedProg3dSerial',
+-		114 : 'SquareShelfConstrainedProg3dParallel',
+-		115 : 'SquareShelfConstrainedTherSteaSerial',
+-		116 : 'SquareShelfConstrainedTherSteaParallel',
+-		117 : 'SquareShelfConstrainedTherTranSerial',
+-		118 : 'SquareShelfConstrainedTherTranParallel',
+-		119 : 'SquareShelfConstrainedTranM2dSerial',
+-		120 : 'SquareShelfConstrainedTranM2dParallel',
+-		121 : 'SquareShelfConstrainedTranP3dSerial',
+-		122 : 'SquareShelfConstrainedTranP3dParallel',
+-		123 : 'SquareShelfConstrainedSurfSlop2dSerial',
+-		124 : 'SquareShelfConstrainedSurfSlop2dParallel',
+-		125 : 'SquareShelfConstrainedSurfSlop3dSerial',
+-		126 : 'SquareShelfConstrainedSurfSlope3dParallel',
+-		127 : 'SquareShelfConstrainedBedSlop2dSerial',
+-		128 : 'SquareShelfConstrainedBedSlop2dParallel',
+-		129 : 'SquareShelfConstrainedBedSlop3dSerial',
+-		130 : 'SquareShelfConstrainedBedSlop3dParallel',
+-		131 : 'SquareShelfConstrainedBalThic2dSerial',
+-		132 : 'SquareShelfConstrainedBalThic2dParallel',
+-		133 : 'SquareShelfConstrainedBalThic3dSerial',
+-		134 : 'SquareShelfConstrainedBalThic3dParallel',
+-		135 : 'SquareShelfConstrainedBalThic2dDGSerial',
+-		136 : 'SquareShelfConstrainedBalThic2dDGParallel',
++		102 : 'SquareShelfConstrainedDiagM2d',
++		104 : 'SquareShelfConstrainedDiagM3d',
++		106 : 'SquareShelfConstrainedDiagP3d',
++		108 : 'SquareShelfConstrainedDiagS3d',
++		110 : 'SquareShelfConstrainedProg2d',
++		112 : 'SquareShelfConstrainedProg2dDG',
++		114 : 'SquareShelfConstrainedProg3d',
++		116 : 'SquareShelfConstrainedTherStea',
++		118 : 'SquareShelfConstrainedTherTran',
++		120 : 'SquareShelfConstrainedTranM2d',
++		122 : 'SquareShelfConstrainedTranP3d',
++		124 : 'SquareShelfConstrainedSurfSlop2d',
++		126 : 'SquareShelfConstrainedSurfSlope3d',
++		128 : 'SquareShelfConstrainedBedSlop2d',
++		130 : 'SquareShelfConstrainedBedSlop3d',
++		132 : 'SquareShelfConstrainedBalThic2d',
++		134 : 'SquareShelfConstrainedBalThic3d',
++		136 : 'SquareShelfConstrainedBalThic2dDG',
+ 		137 : 'SquareBamgMesh',
+-		139 : 'SquareShelfConstrainedEnthalpySteaSerial',
+-		140 : 'SquareShelfConstrainedEnthalpySteaParallel',
+-		141 : 'SquareShelfConstrainedEnthalpyTranSerial',
+-		142 : 'SquareShelfConstrainedEnthalpyTranParallel',
+-		143 : 'SquareShelfConstrainedTransP3dEnthSerial',
+-		144 : 'SquareShelfConstrainedTransP3dEnthParallel',
+-		201 : 'SquareShelfDiagM2dSerial',
+-		202 : 'SquareShelfDiagM2dParallel',
+-		203 : 'SquareShelfDiagM3dSerial',
+-		204 : 'SquareShelfDiagM3dParallel',
+-		205 : 'SquareShelfDiagP3dSerial',
+-		206 : 'SquareShelfDiagP3dParallel',
+-		207 : 'SquareShelfDiagS3dSerial',
+-		208 : 'SquareShelfDiagS3dParallel',
+-		209 : 'SquareShelfDiagMP3dPenaltiesSerial',
+-		210 : 'SquareShelfDiagMP3dPenaltiesParallel',
+-		211 : 'SquareShelfTherSteaSerial',
+-		212 : 'SquareShelfTherSteaParallel',
+-		213 : 'SquareShelfTherTranSerial',
+-		214 : 'SquareShelfTherTranParallel',
+-		215 : 'SquareShelfTranM2dSerial',
+-		216 : 'SquareShelfTranM2dParallel',
+-		217 : 'SquareShelfTranM3dSerial',
+-		218 : 'SquareShelfTranM3dParallel',
+-		219 : 'SquareShelfTranP3dSerial',
+-		220 : 'SquareShelfTranP3dParallel',
+-		221 : 'SquareShelfTranS3dSerial',
+-		222 : 'SquareShelfTranS3dParallel',
+-		223 : 'SquareShelfCMBM2dSerial',
+-		224 : 'SquareShelfCMBM2dParallel',
+-		225 : 'SquareShelfCMBM3dSerial',
+-		226 : 'SquareShelfCMBM3dParallel',
+-		227 : 'SquareShelfCMBP3dSerial',
+-		228 : 'SquareShelfCMBP3dParallel',
+-		229 : 'SquareShelfCMBS3dSerial',
+-		230 : 'SquareShelfCMBS3dParallel',
+-		231 : 'SquareShelfDiagM2dRiftSerial',
+-		232 : 'SquareShelfDiagM2dRiftParallel',
+-		233 : 'SquareShelfConstrainedSerial',
+-		234 : 'SquareShelfConstrainedParallel',
+-		235 : 'SquareShelfConstrainedDakotaBSerial',
+-		236 : 'SquareShelfConstrainedDakotaBParallel',
+-		237 : 'SquareShelfDiagMP3dTilingSerial',
+-		238 : 'SquareShelfDiagMP3dTilingParallel',
+-		239 : 'SquareShelfDiagPS3dTilingSerial',
+-		240 : 'SquareShelfDiagPS3dTilingParallel',
+-		241 : 'SquareShelfDiagMS3dTilingSerial',
+-		242 : 'SquareShelfDiagMS3dTilingParallel',
+-		243 : 'SquareShelfDiagM2dTransientIncrHydroSerial',
+-		244 : 'SquareShelfDiagM2dTransientIncrHydroParallel',
+-		245 : 'SquareShelfDiagM2dTransientIncrNonHydroSerial',
+-		246 : 'SquareShelfDiagM2dTransientIncrNonHydroParallel',
+-		247 : 'SquareShelfDiagP3dTransientIncrHydroSerial',
+-		248 : 'SquareShelfDiagP3dTransientIncrHydroParallel',
+-		249 : 'SquareShelfDiagP3dTransientIncrNonHydroSerial',
+-		250 : 'SquareShelfDiagP3dTransientIncrNonHydroParallel',
+-		251 : 'SquareShelfTranCflM2dSerial',
+-		252 : 'SquareShelfTranCflM2dParallel',
+-		253 : 'SquareShelfTranCflP3dSerial',
+-		254 : 'SquareShelfTranCflP3dParallel',
+-		255 : 'SquareShelfTranForceNeg2dSerial',
+-		256 : 'SquareShelfTranForceNeg2dParallel',
+-		257 : 'SquareShelfTranForcePos2dSerial',
+-		258 : 'SquareShelfTranForcePos2dParallel',
+-		259 : 'SquareShelfTranForceNeg3dSerial',
+-		260 : 'SquareShelfTranForceNeg3dParallel',
+-		261 : 'SquareShelfTranForcePos3dSerial',
+-		262 : 'SquareShelfTranForcePos3dParallel',
+-		263 : 'SquareShelfTherTranForcTempSerial',
+-		264 : 'SquareShelfTherTranForcTempParallel',
+-		265 : 'SquareShelfTranP3dForcTempSerial',
+-		266 : 'SquareShelfTranP3dForcTempParallel',
++		140 : 'SquareShelfConstrainedEnthalpyStea',
++		142 : 'SquareShelfConstrainedEnthalpyTran',
++		144 : 'SquareShelfConstrainedTransP3dEnth',
++		202 : 'SquareShelfDiagM2d',
++		204 : 'SquareShelfDiagM3d',
++		206 : 'SquareShelfDiagP3d',
++		208 : 'SquareShelfDiagS3d',
++		210 : 'SquareShelfDiagMP3dPenalties',
++		212 : 'SquareShelfTherStea',
++		214 : 'SquareShelfTherTran',
++		216 : 'SquareShelfTranM2d',
++		218 : 'SquareShelfTranM3d',
++		220 : 'SquareShelfTranP3d',
++		222 : 'SquareShelfTranS3d',
++		224 : 'SquareShelfCMBM2d',
++		226 : 'SquareShelfCMBM3d',
++		228 : 'SquareShelfCMBP3d',
++		230 : 'SquareShelfCMBS3d',
++		232 : 'SquareShelfDiagM2dRift',
++		234 : 'SquareShelfConstrained',
++		236 : 'SquareShelfConstrainedDakotaB',
++		238 : 'SquareShelfDiagMP3dTiling',
++		240 : 'SquareShelfDiagPS3dTiling',
++		242 : 'SquareShelfDiagMS3dTiling',
++		244 : 'SquareShelfDiagM2dTransientIncrHydro',
++		246 : 'SquareShelfDiagM2dTransientIncrNonHydro',
++		248 : 'SquareShelfDiagP3dTransientIncrHydro',
++		250 : 'SquareShelfDiagP3dTransientIncrNonHydro',
++		252 : 'SquareShelfTranCflM2d',
++		254 : 'SquareShelfTranCflP3d',
++		256 : 'SquareShelfTranForceNeg2d',
++		258 : 'SquareShelfTranForcePos2d',
++		260 : 'SquareShelfTranForceNeg3d',
++		262 : 'SquareShelfTranForcePos3d',
++		264 : 'SquareShelfTherTranForcTemp',
++		266 : 'SquareShelfTranP3dForcTemp',
+ 		267 : 'SquareShelfTranForceNeg2dDakotaSamp',
+    	268 : 'SquareShelfTranForceNeg2dDakotaLocal',
+-		301 : 'SquareSheetConstrainedDiagM2dSerial',
+-		302 : 'SquareSheetConstrainedDiagM2dParallel',
+-		303 : 'SquareSheetConstrainedDiagH2dSerial',
+-		304 : 'SquareSheetConstrainedDiagH2dParallel',
+-		305 : 'SquareSheetConstrainedDiagHM2dSerial',
+-		306 : 'SquareSheetConstrainedDiagHM2dParallel',
+-		307 : 'SquareSheetConstrainedDiagM3dSerial',
+-		308 : 'SquareSheetConstrainedDiagM3dParallel',
+-		309 : 'SquareSheetConstrainedDiagH3dSerial',
+-		310 : 'SquareSheetConstrainedDiagH3dParallel',
+-		311 : 'SquareSheetConstrainedDiagHM3dSerial',
+-		312 : 'SquareSheetConstrainedDiagHM3dParallel',
+-		313 : 'SquareSheetConstrainedDiagP3dSerial',
+-		314 : 'SquareSheetConstrainedDiagP3dParallel',
+-		315 : 'SquareSheetConstrainedDiagS3dSerial',
+-		316 : 'SquareSheetConstrainedDiagS3dParallel',
+-		317 : 'SquareSheetConstrainedProg2dSerial',
+-		318 : 'SquareSheetConstrainedProg2dParallel',
+-		319 : 'SquareSheetConstrainedProg2dDGSerial',
+-		320 : 'SquareSheetConstrainedProg2dDGParallel',
+-		321 : 'SquareSheetConstrainedProg3dSerial',
+-		322 : 'SquareSheetConstrainedProg3dParallel',
+-		323 : 'SquareSheetConstrainedTherSteaSerial',
+-		324 : 'SquareSheetConstrainedTherSteaParallel',
+-		325 : 'SquareSheetConstrainedTherTranSerial',
+-		326 : 'SquareSheetConstrainedTherTranParallel',
+-		327 : 'SquareSheetConstrainedTranH2dSerial',
+-		328 : 'SquareSheetConstrainedTranH2dParallel',
+-		329 : 'SquareSheetConstrainedTranH3dSerial',
+-		330 : 'SquareSheetConstrainedTranH3dParallel',
+-		331 : 'SquareSheetConstrainedTranM2dSerial',
+-		332 : 'SquareSheetConstrainedTranM2dParallel',
+-		333 : 'SquareSheetConstrainedTranP3dSerial',
+-		334 : 'SquareSheetConstrainedTranP3dParallel',
+-		335 : 'SquareSheetConstrainedSteaH3dSerial',
+-		336 : 'SquareSheetConstrainedSteaH3dParallel',
+-		337 : 'SquareSheetConstrainedCMDragM2dSerial',
+-		338 : 'SquareSheetConstrainedCMDragM2dParallel',
+-		339 : 'SquareSheetConstrainedCMDragM3dSerial',
+-		340 : 'SquareSheetConstrainedCMDragM3dParallel',
+-		341 : 'SquareSheetConstrainedCMDragP3dSerial',
+-		342 : 'SquareSheetConstrainedCMDragP3dParallel',
+-		343 : 'SquareSheetConstrainedCMDragS3dSerial',
+-		344 : 'SquareSheetConstrainedCMDragS3dParallel',
+-		345 : 'SquareSheetConstrainedTranCflM2dSerial',
+-		346 : 'SquareSheetConstrainedTranCflM2dParallel',
+-		347 : 'SquareSheetConstrainedTranCflH3dSerial',
+-		348 : 'SquareSheetConstrainedTranCflH3dParallel',
+-		349 : 'SquareSheetConstrainedEnthalpySteaSerial',
+-		350 : 'SquareSheetConstrainedEnthalpySteaParallel',
+-		351 : 'SquareSheetConstrainedEnthalpyTranSerial',
+-		352 : 'SquareSheetConstrainedEnthalpyTranParallel',
+-		353 : 'SquareSheetConstrainedTransP3dEnthSerial',
+-		354 : 'SquareSheetConstrainedTransP3dEnthParallel',
+-		401 : 'SquareSheetShelfDiagM2dSerial',
+-		402 : 'SquareSheetShelfDiagM2dParallel',
+-		403 : 'SquareSheetShelfDiagM3dSerial',
+-		404 : 'SquareSheetShelfDiagM3dParallel',
+-		405 : 'SquareSheetShelfDiagP3dSerial',
+-		406 : 'SquareSheetShelfDiagP3dParallel',
+-		407 : 'SquareSheetShelfDiagS3dSerial',
+-		408 : 'SquareSheetShelfDiagS3dParallel',
+-		409 : 'SquareSheetShelfDiagMP3dPenaltiesSerial',
+-		410 : 'SquareSheetShelfDiagMP3dPenaltiesParallel',
+-		411 : 'SquareSheetShelfTherSteaSerial',
+-		412 : 'SquareSheetShelfTherSteaParallel',
+-		413 : 'SquareSheetShelfTherTranSerial',
+-		414 : 'SquareSheetShelfTherTranParallel',
+-		415 : 'SquareSheetShelfTranM2dSerial',
+-		416 : 'SquareSheetShelfTranM2dParallel',
+-		417 : 'SquareSheetShelfTranMP3dPenaltiesSerial',
+-		418 : 'SquareSheetShelfTranMP3dPenaltiesParallel',
+-		419 : 'SquareSheetShelfSteaM3dSerial',
+-		420 : 'SquareSheetShelfSteaM3dParallel',
+-		421 : 'SquareSheetShelfSteaP3dSerial',
+-		422 : 'SquareSheetShelfSteaP3dParallel',
+-		423 : 'SquareSheetShelfDiadM3dDakotaSerial',
+-		424 : 'SquareSheetShelfDiadM3dDakotaParallel',
+-		425 : 'SquareSheetShelfDiadM3dDakotaPartSerial',
+-		426 : 'SquareSheetShelfDiadM3dDakotaPartParallel',
+-		427 : 'SquareSheetShelfDiadM3dDakotaMassFluxSerial',
+-		428 : 'SquareSheetShelfDiadM3dDakotaMassFluxParallel',
+-		429 : 'SquareSheetShelfCMDragSteaM3dSerial',
+-		430 : 'SquareSheetShelfCMDragSteaM3dParallel',
+-		431 : 'SquareSheetShelfCMDragSteaP3dSerial',
+-		432 : 'SquareSheetShelfCMDragSteaP3dParallel',
++		302 : 'SquareSheetConstrainedDiagM2d',
++		304 : 'SquareSheetConstrainedDiagH2d',
++		306 : 'SquareSheetConstrainedDiagHM2d',
++		308 : 'SquareSheetConstrainedDiagM3d',
++		310 : 'SquareSheetConstrainedDiagH3d',
++		312 : 'SquareSheetConstrainedDiagHM3d',
++		314 : 'SquareSheetConstrainedDiagP3d',
++		316 : 'SquareSheetConstrainedDiagS3d',
++		318 : 'SquareSheetConstrainedProg2d',
++		320 : 'SquareSheetConstrainedProg2dDG',
++		322 : 'SquareSheetConstrainedProg3d',
++		324 : 'SquareSheetConstrainedTherStea',
++		326 : 'SquareSheetConstrainedTherTran',
++		328 : 'SquareSheetConstrainedTranH2d',
++		330 : 'SquareSheetConstrainedTranH3d',
++		332 : 'SquareSheetConstrainedTranM2d',
++		334 : 'SquareSheetConstrainedTranP3d',
++		336 : 'SquareSheetConstrainedSteaH3d',
++		338 : 'SquareSheetConstrainedCMDragM2d',
++		340 : 'SquareSheetConstrainedCMDragM3d',
++		342 : 'SquareSheetConstrainedCMDragP3d',
++		344 : 'SquareSheetConstrainedCMDragS3d',
++		346 : 'SquareSheetConstrainedTranCflM2d',
++		348 : 'SquareSheetConstrainedTranCflH3d',
++		350 : 'SquareSheetConstrainedEnthalpyStea',
++		352 : 'SquareSheetConstrainedEnthalpyTran',
++		354 : 'SquareSheetConstrainedTransP3dEnth',
++		402 : 'SquareSheetShelfDiagM2d',
++		404 : 'SquareSheetShelfDiagM3d',
++		406 : 'SquareSheetShelfDiagP3d',
++		408 : 'SquareSheetShelfDiagS3d',
++		410 : 'SquareSheetShelfDiagMP3dPenalties',
++		412 : 'SquareSheetShelfTherStea',
++		414 : 'SquareSheetShelfTherTran',
++		416 : 'SquareSheetShelfTranM2d',
++		418 : 'SquareSheetShelfTranMP3dPenalties',
++		420 : 'SquareSheetShelfSteaM3d',
++		422 : 'SquareSheetShelfSteaP3d',
++		424 : 'SquareSheetShelfDiadM3dDakota',
++		426 : 'SquareSheetShelfDiadM3dDakotaPart',
++		428 : 'SquareSheetShelfDiadM3dDakotaMassFlux',
++		430 : 'SquareSheetShelfCMDragSteaM3d',
++		432 : 'SquareSheetShelfCMDragSteaP3d',
+ 		434 : 'SquareSheetShelfDiadM3dDakotaSamp',
+ 		435 : 'SquareSheetShelfDiadM3dDakotaAreaAverage',
+-		437 : 'SquareSheetShelfDiagMP3dTilingSerial',
+-		438 : 'SquareSheetShelfDiagMP3dTilingParallel',
++		438 : 'SquareSheetShelfDiagMP3dTiling',
+ 		439 : 'SquareSheetShelfDakotaScaledResponse',
+ 		440 : 'SquareSheetShelfDakotaScaledResponse',
+-		441 : 'SquareSheetShelfDiagPS3dTilingSerial',
+-		442 : 'SquareSheetShelfDiagPS3dTilingParallel',
+-		443 : 'SquareSheetShelfDiagMS3dTilingSerial',
+-		444 : 'SquareSheetShelfDiagMS3dTilingParallel',
+-		445 : 'RoundSheetShelfGLMigrationM2dSerial',
+-		446 : 'RoundSheetShelfGLMigrationM2dParallel',
+-		447 : 'SquareSheetShelfGroundingLine2dAgressiceSerial',
+-		448 : 'SquareSheetShelfGroundingLine2dAgressiceParallel',
+-		449 : 'SquareSheetShelfGroundingLine2dSoftSerial',
+-		450 : 'SquareSheetShelfGroundingLine2dSoftParallel',
+-		451 : 'SquareSheetShelfGroundingLine3dAgressiceSerial',
+-		452 : 'SquareSheetShelfGroundingLine3dAgressiceParallel',
+-		453 : 'SquareSheetShelfGroundingLine3dSoftSerial',
+-		454 : 'SquareSheetShelfGroundingLine3dSoftParallel',
+-		455 : 'SquareSheetShelfDiagM2dNewtonSerial',
+-		456 : 'SquareSheetShelfDiagM2dNewtonParallel',
+-		457 : 'SquareSheetShelfDiagP3dNewtonSerial',
+-		458 : 'SquareSheetShelfDiagP3dNewtonParallel',
+-		459 : 'SquareSheetShelfDiagS3dNewtonSerial',
+-		460 : 'SquareSheetShelfDiagS3dNewtonParallel',
+-		461 : 'SquareSheetShelfSteaEnthalpyM3dSerial',
+-		462 : 'SquareSheetShelfSteaEnthalpyM3dParallel',
+-		463 : 'SquareSheetShelfSteaEnthalpyP3dSerial',
+-		464 : 'SquareSheetShelfSteaEnthalpyP3dParallel',
+-		501 : 'PigDiagM2dSerial',
+-		502 : 'PigDiagM2dParallel',
+-		503 : 'PigDiagP3dSerial',
+-		504 : 'PigDiagP3dParallel',
+-		505 : 'PigDiagS3dSerial',
+-		506 : 'PigDiagS3dParallel',
+-		507 : 'PigTranM2dSerial',
+-		508 : 'PigTranM2dParallel',
+-		509 : 'PigTranM3dSerial',
+-		510 : 'PigTranM3dParallel',
+-		511 : 'PigTranP3dSerial',
+-		512 : 'PigTranP3dParallel',
+-		513 : 'PigTranS3dSerial',
+-		514 : 'PigTranS3dParallel',
+-		515 : 'PigSteaM3dSerial',
+-		516 : 'PigSteaM3dParallel',
+-		517 : 'PigSteaP3dSerial',
+-		518 : 'PigSteaP3dParallel',
+-		519 : 'PigSteaS3dSerial',
+-		520 : 'PigSteaS3dParallel',
+-		521 : 'PigCMBS3dSerial',
+-		522 : 'PigCMBS3dparallel',
+-		523 : 'PigCMDragP3dSerial',
+-		524 : 'PigCMDragP3dparallel',
+-		525 : 'PigCMDragSteaM3dSerial',
+-		526 : 'PigCMDragSteaM3dparallel',
++		442 : 'SquareSheetShelfDiagPS3dTiling',
++		444 : 'SquareSheetShelfDiagMS3dTiling',
++		446 : 'RoundSheetShelfGLMigrationM2d',
++		448 : 'SquareSheetShelfGroundingLine2dAgressice',
++		450 : 'SquareSheetShelfGroundingLine2dSoft',
++		452 : 'SquareSheetShelfGroundingLine3dAgressice',
++		454 : 'SquareSheetShelfGroundingLine3dSoft',
++		456 : 'SquareSheetShelfDiagM2dNewton',
++		458 : 'SquareSheetShelfDiagP3dNewton',
++		460 : 'SquareSheetShelfDiagS3dNewton',
++		462 : 'SquareSheetShelfSteaEnthalpyM3d',
++		464 : 'SquareSheetShelfSteaEnthalpyP3d',
++		502 : 'PigDiagM2d',
++		504 : 'PigDiagP3d',
++		506 : 'PigDiagS3d',
++		508 : 'PigTranM2d',
++		510 : 'PigTranM3d',
++		512 : 'PigTranP3d',
++		514 : 'PigTranS3d',
++		516 : 'PigSteaM3d',
++		518 : 'PigSteaP3d',
++		520 : 'PigSteaS3d',
++		522 : 'PigCMBS3d',
++		524 : 'PigCMDragP3d',
++		526 : 'PigCMDragSteaM3d',
+ 		527 : 'PigBamgMesh',
+-		529 : 'PigTherTranSUPGSerial',
+-		530 : 'PigTherTranSUPGParallel',
+-		531 : 'PigTherSteaSUPGSerial',
+-		532 : 'PigTherSteaSUPGParallel',
+-		601 : '79NorthProg2dSerial',
+-		602 : '79NorthProg2dParallel',
+-		603 : '79NorthProg2dDGSerial',
+-		604 : '79NorthProg2dDGParallel',
+-		605 : '79NorthProg3dSerial',
+-		606 : '79NorthProg3dParallel',
+-		607 : '79NorthSurfSlop2dSerial',
+-		608 : '79NorthSurfSlop2dParallel',
+-		609 : '79NorthSurfSlop3dSerial',
+-		610 : '79NorthSurfSlop3dParallel',
+-		611 : '79NorthBedSlop2dSerial',
+-		612 : '79NorthBedSlop2dParallel',
+-		613 : '79NorthBedSlop3dSerial',
+-		614 : '79NorthBedSlop3dParallel',
+-		615 : '79NorthBalThic2dSerial',
+-		616 : '79NorthBalThic2dParallel',
+-		617 : '79NorthBalThic2dDGSerial',
+-		618 : '79NorthBalThic2dDGParallel',
+-		619 : '79NorthBalThic3dSerial',
+-		620 : '79NorthBalThic3dParallel',
+-		621 : '79NorthCMBalThic2dCGSerial',
+-		622 : '79NorthCMBalThic2dCGParallel',
+-		623 : '79NorthCMBalThic2dDGSerial',
+-		624 : '79NorthCMBalThic2dDGParallel',
+-		625 : '79NorthCMBalThicVxVyParallel',
+-		626 : '79NorthCMBalThicVxVySerial',
++		530 : 'PigTherTranSUPG',
++		532 : 'PigTherSteaSUPG',
++		602 : '79NorthProg2d',
++		604 : '79NorthProg2dDG',
++		606 : '79NorthProg3d',
++		608 : '79NorthSurfSlop2d',
++		610 : '79NorthSurfSlop3d',
++		612 : '79NorthBedSlop2d',
++		614 : '79NorthBedSlop3d',
++		616 : '79NorthBalThic2d',
++		618 : '79NorthBalThic2dDG',
++		620 : '79NorthBalThic3d',
++		622 : '79NorthCMBalThic2dCG',
++		624 : '79NorthCMBalThic2dDG',
++		626 : '79NorthCMBalThicVxVy',
+ 		1101 : 'ISMIPAPattyn',
+ 		1102 : 'ISMIPAStokes',
+ 		1103 : 'ISMIPBPattyn',
Index: /issm/oecreview/Archive/12678-13393/ISSM-12787-12788.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12787-12788.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12787-12788.diff	(revision 13394)
@@ -0,0 +1,1146 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test124.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test124.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test124.m	(revision 12788)
+@@ -1,14 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,SurfaceSlopeSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'SurfaceSlopeX','SurfaceSlopeY'};
+-field_tolerances={1e-13,1e-13};
+-field_values={...
+-	(md.results.SurfaceSlopeSolution.SurfaceSlopeX),...
+-	(md.results.SurfaceSlopeSolution.SurfaceSlopeY),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test128.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test128.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test128.m	(revision 12788)
+@@ -1,14 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BedSlopeSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'BedSlopeX','BedSlopeY'};
+-field_tolerances={1e-13,1e-13};
+-field_values={...
+-	(md.results.BedSlopeSolution.BedSlopeX),...
+-	(md.results.BedSlopeSolution.BedSlopeY),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test137.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test137.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test137.m	(revision 12788)
+@@ -1,25 +0,0 @@
+-
+-%Simple mesh
+-md=bamg(model,'domain','../Exp/Square.exp','hmax',100000);
+-x1=md.mesh.x;
+-y1=md.mesh.y;
+-
+-%hVertices
+-md=bamg(model,'domain','../Exp/Square.exp','hmax',300000,'hvertices',[10000 100000 400000 100000]');
+-x2=md.mesh.x;
+-y2=md.mesh.y;
+-
+-%big mesh
+-t0=clock;
+-md=bamg(model,'domain','../Exp/Square.exp','hmax',3000);
+-nbelements=md.mesh.numberofelements;
+-elapsedtime=etime(clock,t0);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'x1' 'y1' 'x2' 'y2' 'nbelements' 'elapsed time'};
+-field_tolerances={1e-13 1e-13 1e-13 1e-13 1e-13 0.5};
+-field_values={...
+-	x1, y1,...
+-	x2, y2,...
+-	nbelements,elapsedtime...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test142.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test142.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test142.m	(revision 12788)
+@@ -1,30 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+-md.transient.isdiagnostic=0;
+-md.transient.isprognostic=0;
+-md.transient.isthermal=1;
+-md.transient.isgroundingline=0;
+-md.thermal.isenthalpy=1;
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Enthalpy1','Waterfraction1','Temperature1',...
+-	'Enthalpy2','Waterfraction2','Temperature2',...
+-	'Enthalpy3','Waterfraction3','Temperature3'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-10,1e-13};
+-field_values={...
+-	(md.results.TransientSolution(1).Enthalpy),...
+-	(md.results.TransientSolution(1).Waterfraction),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(2).Enthalpy),...
+-	(md.results.TransientSolution(2).Waterfraction),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(3).Enthalpy),...
+-	(md.results.TransientSolution(3).Waterfraction),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test102.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test102.py	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test102.py	(revision 12788)
+@@ -1,24 +0,0 @@
+-from model import *
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-
+-md=model()
+-md=triangle(md,'../Exp/Square.exp',50000)
+-md=setmask(md,'all','')
+-md=parameterize(md,'../Par/SquareShelfConstrained.py')
+-
+-#Fields and tolerances to track changes
+-field_names     =['Vx','Vy','Vel','Pressure',\
+-	'StressTensorxx','StressTensoryy','StressTensorxy']
+-field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
+-	1e-13,1e-13,1e-13]
+-field_values=[\
+-	[md.results.DiagnosticSolution.Vx],\
+-	[md.results.DiagnosticSolution.Vy],\
+-	[md.results.DiagnosticSolution.Vel],\
+-	[md.results.DiagnosticSolution.Pressure],\
+-	[md.results.DiagnosticSolution.StressTensorxx],\
+-	[md.results.DiagnosticSolution.StressTensoryy],\
+-	[md.results.DiagnosticSolution.StressTensorxy],\
+-	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test130.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test130.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test130.m	(revision 12788)
+@@ -1,15 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=extrude(md,5,1);
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BedSlopeSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'BedSlopeX','BedSlopeY'};
+-field_tolerances={1e-13,1e-13};
+-field_values={...
+-	(md.results.BedSlopeSolution.BedSlopeX),...
+-	(md.results.BedSlopeSolution.BedSlopeY),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test134.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test134.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test134.m	(revision 12788)
+@@ -1,17 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=extrude(md,5,1);
+-%Add boundary conditions on thickness on the border
+-pos=find(md.mesh.vertexonboundary);
+-md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BalancethicknessSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
+-field_values={...
+-	(md.results.BalancethicknessSolution.Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test126.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test126.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test126.m	(revision 12788)
+@@ -1,15 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=extrude(md,5,1);
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,SurfaceSlopeSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'SurfaceSlopeX','SurfaceSlopeY'};
+-field_tolerances={1e-13,1e-13};
+-field_values={...
+-	(md.results.SurfaceSlopeSolution.SurfaceSlopeX),...
+-	(md.results.SurfaceSlopeSolution.SurfaceSlopeY),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test140.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test140.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test140.m	(revision 12788)
+@@ -1,18 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-md.timestepping.time_step=0;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+-md=solve(md,EnthalpySolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Enthalpy','Waterfraction','Temperature'};
+-field_tolerances={1e-13,1e-10,1e-13};
+-field_values={...
+-	(md.results.EnthalpySolution.Enthalpy),...
+-	(md.results.EnthalpySolution.Waterfraction),...
+-	(md.results.EnthalpySolution.Temperature),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test144.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test144.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test144.m	(revision 12788)
+@@ -1,54 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+-md.thermal.isenthalpy=1;
+-md.thermal.stabilization=2;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','Enthalpy1','Waterfraction1', ...
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2', ...
+-					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3'};
+-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-09,1e-08,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-09,1e-09};
+-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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).Enthalpy),...
+-	(md.results.TransientSolution(1).Waterfraction),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).Enthalpy),...
+-	(md.results.TransientSolution(2).Waterfraction),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).Enthalpy),...
+-	(md.results.TransientSolution(3).Waterfraction),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test132.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test132.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test132.m	(revision 12788)
+@@ -1,16 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-%Add boundary conditions on thickness on the border
+-pos=find(md.mesh.vertexonboundary);
+-md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BalancethicknessSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
+-field_values={...
+-	(md.results.BalancethicknessSolution.Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test136.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test136.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test136.m	(revision 12788)
+@@ -1,16 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=meshconvert(md);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md.balancethickness.stabilization=3;
+-md.initialization.vy=md.initialization.vy+400;
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BalancethicknessSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
+-field_values={...
+-	(md.results.BalancethicknessSolution.Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py	(revision 12788)
+@@ -0,0 +1,24 @@
++from model import *
++from triangle import *
++from setmask import *
++from parameterize import *
++
++md=model()
++md=triangle(md,'../Exp/Square.exp',50000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++
++#Fields and tolerances to track changes
++field_names     =['Vx','Vy','Vel','Pressure',\
++	'StressTensorxx','StressTensoryy','StressTensorxy']
++field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
++	1e-13,1e-13,1e-13]
++field_values=[\
++	[md.results.DiagnosticSolution.Vx],\
++	[md.results.DiagnosticSolution.Vy],\
++	[md.results.DiagnosticSolution.Vel],\
++	[md.results.DiagnosticSolution.Pressure],\
++	[md.results.DiagnosticSolution.StressTensorxx],\
++	[md.results.DiagnosticSolution.StressTensoryy],\
++	[md.results.DiagnosticSolution.StressTensorxy],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test120.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test120.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test120.m	(revision 12788)
+@@ -1,36 +1,18 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,1);
+ md=setflowequation(md,'macayeal','all');
++md.timestepping.time_step=0;
+ md.cluster=generic('name',oshostname(),'np',3);
++md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
++md=solve(md,EnthalpySolutionEnum);
+ 
+-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_names     ={'Enthalpy','Waterfraction','Temperature'};
++field_tolerances={1e-13,1e-10,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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
++	(md.results.EnthalpySolution.Enthalpy),...
++	(md.results.EnthalpySolution.Waterfraction),...
++	(md.results.EnthalpySolution.Temperature),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test103.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test103.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test103.m	(revision 12788)
+@@ -0,0 +1,27 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,2);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.diagnostic.requested_outputs=StressTensorEnum;
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure',...
++	'StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,...
++	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.StressTensorxx),...
++	(md.results.DiagnosticSolution.StressTensoryy),...
++	(md.results.DiagnosticSolution.StressTensorzz),...
++	(md.results.DiagnosticSolution.StressTensorxy),...
++	(md.results.DiagnosticSolution.StressTensorxz),...
++	(md.results.DiagnosticSolution.StressTensoryz),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test107.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test107.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test107.m	(revision 12788)
+@@ -0,0 +1,14 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md=extrude(md,5,3);
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,PrognosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.PrognosticSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test112.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test112.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test112.m	(revision 12788)
+@@ -1,16 +1,14 @@
+ md=triangle(model,'../Exp/Square.exp',150000);
+-md=meshconvert(md);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.prognostic.stabilization=3;
+-md.prognostic.spcthickness=md.geometry.thickness;
+-md=solve(md,PrognosticSolutionEnum);
++md=solve(md,SurfaceSlopeSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
++field_names     ={'SurfaceSlopeX','SurfaceSlopeY'};
++field_tolerances={1e-13,1e-13};
+ field_values={...
+-	(md.results.PrognosticSolution.Thickness),...
++	(md.results.SurfaceSlopeSolution.SurfaceSlopeX),...
++	(md.results.SurfaceSlopeSolution.SurfaceSlopeY),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test116.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test116.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test116.m	(revision 12788)
+@@ -1,16 +1,16 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=extrude(md,3,1);
++%Add boundary conditions on thickness on the border
++pos=find(md.mesh.vertexonboundary);
++md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
+ md=setflowequation(md,'macayeal','all');
+-md.timestepping.time_step=0;
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,ThermalSolutionEnum);
++md=solve(md,BalancethicknessSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-13,1e-13};
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
+ field_values={...
+-	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++	(md.results.BalancethicknessSolution.Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test121.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test121.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test121.m	(revision 12788)
+@@ -0,0 +1,30 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
++md.transient.isdiagnostic=0;
++md.transient.isprognostic=0;
++md.transient.isthermal=1;
++md.transient.isgroundingline=0;
++md.thermal.isenthalpy=1;
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Enthalpy1','Waterfraction1','Temperature1',...
++	'Enthalpy2','Waterfraction2','Temperature2',...
++	'Enthalpy3','Waterfraction3','Temperature3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-10,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Enthalpy),...
++	(md.results.TransientSolution(1).Waterfraction),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(2).Enthalpy),...
++	(md.results.TransientSolution(2).Waterfraction),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(3).Enthalpy),...
++	(md.results.TransientSolution(3).Waterfraction),...
++	(md.results.TransientSolution(3).Temperature),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test104.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test104.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test104.m	(revision 12788)
+@@ -2,13 +2,13 @@
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+ md=extrude(md,3,2);
+-md=setflowequation(md,'macayeal','all');
++md=setflowequation(md,'stokes','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
++field_tolerances={1e-08,1e-08,1e-07,1e-08,1e-08};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test108.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test108.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test108.m	(revision 12788)
+@@ -1,18 +1,16 @@
+ md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=extrude(md,3,2);
+-md=setflowequation(md,'stokes','all');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.timestepping.time_step=0;
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,ThermalSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-08,1e-08,1e-07,1e-08,1e-08};
++field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-13,1e-13};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.ThermalSolution.Temperature),...
++	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test113.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test113.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test113.m	(revision 12788)
+@@ -0,0 +1,15 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,5,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,SurfaceSlopeSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'SurfaceSlopeX','SurfaceSlopeY'};
++field_tolerances={1e-13,1e-13};
++field_values={...
++	(md.results.SurfaceSlopeSolution.SurfaceSlopeX),...
++	(md.results.SurfaceSlopeSolution.SurfaceSlopeY),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test117.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test117.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test117.m	(revision 12788)
+@@ -0,0 +1,17 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,5,1);
++%Add boundary conditions on thickness on the border
++pos=find(md.mesh.vertexonboundary);
++md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,BalancethicknessSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.BalancethicknessSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12788)
+@@ -6,28 +6,28 @@
+ 
+ switch id,
+ 
+-	case 102, name='SquareShelfConstrainedDiagM2d';
+-	case 104, name='SquareShelfConstrainedDiagM3d';
+-	case 106, name='SquareShelfConstrainedDiagP3d';
+-	case 108, name='SquareShelfConstrainedDiagS3d';
+-	case 110, name='SquareShelfConstrainedProg2d';
+-	case 112, name='SquareShelfConstrainedProg2dDG';
+-	case 114, name='SquareShelfConstrainedProg3d';
+-	case 116, name='SquareShelfConstrainedTherStea';
+-	case 118, name='SquareShelfConstrainedTherTran';
+-	case 120, name='SquareShelfConstrainedTranM2d';
+-	case 122, name='SquareShelfConstrainedTranP3d';
+-	case 124, name='SquareShelfConstrainedSurfSlop2d';
+-	case 126, name='SquareShelfConstrainedSurfSlope3d';
+-	case 128, name='SquareShelfConstrainedBedSlop2d';
+-	case 130, name='SquareShelfConstrainedBedSlop3d';
+-	case 132, name='SquareShelfConstrainedBalThic2d';
+-	case 134, name='SquareShelfConstrainedBalThic3d';
+-	case 136, name='SquareShelfConstrainedBalThic2dDG';
+-	case 137, name='SquareBamgMesh';
+-	case 140, name='SquareShelfConstrainedEnthalpyStea';
+-	case 142, name='SquareShelfConstrainedEnthalpyTran';
+-	case 144, name='SquareShelfConstrainedTransP3dEnth';
++	case 101, name='SquareShelfConstrainedDiagM2d';
++	case 102, name='SquareShelfConstrainedDiagM3d';
++	case 103, name='SquareShelfConstrainedDiagP3d';
++	case 104, name='SquareShelfConstrainedDiagS3d';
++	case 105, name='SquareShelfConstrainedProg2d';
++	case 106, name='SquareShelfConstrainedProg2dDG';
++	case 107, name='SquareShelfConstrainedProg3d';
++	case 108, name='SquareShelfConstrainedTherStea';
++	case 109, name='SquareShelfConstrainedTherTran';
++	case 110, name='SquareShelfConstrainedTranM2d';
++	case 111, name='SquareShelfConstrainedTranP3d';
++	case 112, name='SquareShelfConstrainedSurfSlop2d';
++	case 113, name='SquareShelfConstrainedSurfSlope3d';
++	case 114, name='SquareShelfConstrainedBedSlop2d';
++	case 115, name='SquareShelfConstrainedBedSlop3d';
++	case 116, name='SquareShelfConstrainedBalThic2d';
++	case 117, name='SquareShelfConstrainedBalThic3d';
++	case 118, name='SquareShelfConstrainedBalThic2dDG';
++	case 119, name='SquareBamgMesh';
++	case 120, name='SquareShelfConstrainedEnthalpyStea';
++	case 121, name='SquareShelfConstrainedEnthalpyTran';
++	case 122, name='SquareShelfConstrainedTransP3dEnth';
+ 	case 202, name='SquareShelfDiagM2d';
+ 	case 204, name='SquareShelfDiagM3d';
+ 	case 206, name='SquareShelfDiagP3d';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.m	(revision 12788)
+@@ -0,0 +1,22 @@
++md=triangle(model,'../Exp/Square.exp',50000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.diagnostic.requested_outputs=StressTensorEnum;
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure',...
++	'StressTensorxx','StressTensoryy','StressTensorxy'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,...
++	1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.StressTensorxx),...
++	(md.results.DiagnosticSolution.StressTensoryy),...
++	(md.results.DiagnosticSolution.StressTensorxy),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test122.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test122.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test122.m	(revision 12788)
+@@ -3,18 +3,20 @@
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+ md=extrude(md,3,1);
+ md=setflowequation(md,'pattyn','all');
++md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
++md.thermal.isenthalpy=1;
++md.thermal.stabilization=2;
+ md.cluster=generic('name',oshostname(),'np',3);
+ 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','Enthalpy1','Waterfraction1', ...
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2', ...
++					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3'};
+ field_tolerances={...
+-	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
+-	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
+-	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
++	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-09,1e-08,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-09,1e-09};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+ 	(md.results.TransientSolution(1).Vy),...
+@@ -25,7 +27,8 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).Enthalpy),...
++	(md.results.TransientSolution(1).Waterfraction),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -35,7 +38,8 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).Enthalpy),...
++	(md.results.TransientSolution(2).Waterfraction),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -45,5 +49,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).Enthalpy),...
++	(md.results.TransientSolution(3).Waterfraction),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test105.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test105.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test105.m	(revision 12788)
+@@ -0,0 +1,13 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,PrognosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.PrognosticSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test109.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test109.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test109.m	(revision 12788)
+@@ -0,0 +1,19 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.isdiagnostic=0;
++md.transient.isprognostic=0;
++md.transient.isthermal=1;
++md.transient.isgroundingline=0;
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test110.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test110.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test110.m	(revision 12788)
+@@ -3,11 +3,34 @@
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,PrognosticSolutionEnum);
+ 
++md=solve(md,TransientSolutionEnum);
++
+ %Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
++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.PrognosticSolution.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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test114.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test114.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test114.m	(revision 12788)
+@@ -2,13 +2,13 @@
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+ md=setflowequation(md,'macayeal','all');
+-md=extrude(md,5,3);
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,PrognosticSolutionEnum);
++md=solve(md,BedSlopeSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
++field_names     ={'BedSlopeX','BedSlopeY'};
++field_tolerances={1e-13,1e-13};
+ field_values={...
+-	(md.results.PrognosticSolution.Thickness),...
++	(md.results.BedSlopeSolution.BedSlopeX),...
++	(md.results.BedSlopeSolution.BedSlopeY),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test118.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test118.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test118.m	(revision 12788)
+@@ -1,19 +1,16 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
++md=meshconvert(md);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=extrude(md,3,1);
++md.balancethickness.stabilization=3;
++md.initialization.vy=md.initialization.vy+400;
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.transient.isdiagnostic=0;
+-md.transient.isprognostic=0;
+-md.transient.isthermal=1;
+-md.transient.isgroundingline=0;
+-md=solve(md,TransientSolutionEnum);
++md=solve(md,BalancethicknessSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-13,1e-13};
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
+ field_values={...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.BalancethicknessSolution.Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test102.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test102.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test102.m	(revision 12788)
+@@ -1,22 +1,18 @@
+-md=triangle(model,'../Exp/Square.exp',50000);
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,2);
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.diagnostic.requested_outputs=StressTensorEnum;
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vel','Pressure',...
+-	'StressTensorxx','StressTensoryy','StressTensorxy'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,...
+-	1e-13,1e-13,1e-13};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
+ 	(md.results.DiagnosticSolution.Vel),...
+ 	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.StressTensorxx),...
+-	(md.results.DiagnosticSolution.StressTensoryy),...
+-	(md.results.DiagnosticSolution.StressTensorxy),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test106.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test106.m	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test106.m	(revision 12788)
+@@ -1,27 +1,16 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
++md=meshconvert(md);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md=extrude(md,3,2);
+-md=setflowequation(md,'pattyn','all');
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.diagnostic.requested_outputs=StressTensorEnum;
+-md=solve(md,DiagnosticSolutionEnum);
++md.prognostic.stabilization=3;
++md.prognostic.spcthickness=md.geometry.thickness;
++md=solve(md,PrognosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure',...
+-	'StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,...
+-	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09};
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.StressTensorxx),...
+-	(md.results.DiagnosticSolution.StressTensoryy),...
+-	(md.results.DiagnosticSolution.StressTensorzz),...
+-	(md.results.DiagnosticSolution.StressTensorxy),...
+-	(md.results.DiagnosticSolution.StressTensorxz),...
+-	(md.results.DiagnosticSolution.StressTensoryz),...
++	(md.results.PrognosticSolution.Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12787)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12788)
+@@ -8,28 +8,28 @@
+ 
+ def IdToName(id):
+ 	idname={
+-		102 : 'SquareShelfConstrainedDiagM2d',
+-		104 : 'SquareShelfConstrainedDiagM3d',
+-		106 : 'SquareShelfConstrainedDiagP3d',
+-		108 : 'SquareShelfConstrainedDiagS3d',
+-		110 : 'SquareShelfConstrainedProg2d',
+-		112 : 'SquareShelfConstrainedProg2dDG',
+-		114 : 'SquareShelfConstrainedProg3d',
+-		116 : 'SquareShelfConstrainedTherStea',
+-		118 : 'SquareShelfConstrainedTherTran',
+-		120 : 'SquareShelfConstrainedTranM2d',
+-		122 : 'SquareShelfConstrainedTranP3d',
+-		124 : 'SquareShelfConstrainedSurfSlop2d',
+-		126 : 'SquareShelfConstrainedSurfSlope3d',
+-		128 : 'SquareShelfConstrainedBedSlop2d',
+-		130 : 'SquareShelfConstrainedBedSlop3d',
+-		132 : 'SquareShelfConstrainedBalThic2d',
+-		134 : 'SquareShelfConstrainedBalThic3d',
+-		136 : 'SquareShelfConstrainedBalThic2dDG',
+-		137 : 'SquareBamgMesh',
+-		140 : 'SquareShelfConstrainedEnthalpyStea',
+-		142 : 'SquareShelfConstrainedEnthalpyTran',
+-		144 : 'SquareShelfConstrainedTransP3dEnth',
++		101 : 'SquareShelfConstrainedDiagM2d',
++		102 : 'SquareShelfConstrainedDiagM3d',
++		103 : 'SquareShelfConstrainedDiagP3d',
++		104 : 'SquareShelfConstrainedDiagS3d',
++		105 : 'SquareShelfConstrainedProg2d',
++		106 : 'SquareShelfConstrainedProg2dDG',
++		107 : 'SquareShelfConstrainedProg3d',
++		108 : 'SquareShelfConstrainedTherStea',
++		109 : 'SquareShelfConstrainedTherTran',
++		110 : 'SquareShelfConstrainedTranM2d',
++		111 : 'SquareShelfConstrainedTranP3d',
++		112 : 'SquareShelfConstrainedSurfSlop2d',
++		113 : 'SquareShelfConstrainedSurfSlope3d',
++		114 : 'SquareShelfConstrainedBedSlop2d',
++		115 : 'SquareShelfConstrainedBedSlop3d',
++		116 : 'SquareShelfConstrainedBalThic2d',
++		117 : 'SquareShelfConstrainedBalThic3d',
++		118 : 'SquareShelfConstrainedBalThic2dDG',
++		119 : 'SquareBamgMesh',
++		120 : 'SquareShelfConstrainedEnthalpyStea',
++		121 : 'SquareShelfConstrainedEnthalpyTran',
++		122 : 'SquareShelfConstrainedTransP3dEnth',
+ 		202 : 'SquareShelfDiagM2d',
+ 		204 : 'SquareShelfDiagM3d',
+ 		206 : 'SquareShelfDiagP3d',
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m	(revision 12788)
+@@ -0,0 +1,49 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++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_tolerances={...
++	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
++	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
++	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
++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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test115.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test115.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test115.m	(revision 12788)
+@@ -0,0 +1,15 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,5,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,BedSlopeSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'BedSlopeX','BedSlopeY'};
++field_tolerances={1e-13,1e-13};
++field_values={...
++	(md.results.BedSlopeSolution.BedSlopeX),...
++	(md.results.BedSlopeSolution.BedSlopeY),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test119.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test119.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test119.m	(revision 12788)
+@@ -0,0 +1,25 @@
++
++%Simple mesh
++md=bamg(model,'domain','../Exp/Square.exp','hmax',100000);
++x1=md.mesh.x;
++y1=md.mesh.y;
++
++%hVertices
++md=bamg(model,'domain','../Exp/Square.exp','hmax',300000,'hvertices',[10000 100000 400000 100000]');
++x2=md.mesh.x;
++y2=md.mesh.y;
++
++%big mesh
++t0=clock;
++md=bamg(model,'domain','../Exp/Square.exp','hmax',3000);
++nbelements=md.mesh.numberofelements;
++elapsedtime=etime(clock,t0);
++
++%Fields and tolerances to track changes
++field_names     ={'x1' 'y1' 'x2' 'y2' 'nbelements' 'elapsed time'};
++field_tolerances={1e-13 1e-13 1e-13 1e-13 1e-13 0.5};
++field_values={...
++	x1, y1,...
++	x2, y2,...
++	nbelements,elapsedtime...
++	};
Index: /issm/oecreview/Archive/12678-13393/ISSM-12788-12789.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12788-12789.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12788-12789.diff	(revision 13394)
@@ -0,0 +1,172 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive123.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive127.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive132.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive136.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive141.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive124.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive128.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive133.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive137.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive142.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive125.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive129.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive130.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive134.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive143.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive126.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive131.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive135.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive139.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive140.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive144.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive110.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive114.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive118.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive102.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive106.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive111.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive115.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive119.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive120.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive103.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive107.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive112.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive116.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive121.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive104.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive108.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive113.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive117.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive122.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive101.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive105.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive109.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12789-12790.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12789-12790.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12789-12790.diff	(revision 13394)
@@ -0,0 +1,88 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive110.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive114.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive118.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive102.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive106.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive111.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive115.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive119.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive120.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive103.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive107.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive112.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive116.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive121.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive104.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive108.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive113.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive117.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive122.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive101.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive105.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive109.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12790-12791.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12790-12791.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12790-12791.diff	(revision 13394)
@@ -0,0 +1,3038 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test260.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test260.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test260.m	(revision 12791)
+@@ -1,69 +0,0 @@
+-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,'macayeal','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.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','SurfaceMassbalance4'};
+-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(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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(4).Surface),...
+-	(md.results.TransientSolution(4).Thickness),...
+-	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test264.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test264.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test264.m	(revision 12791)
+@@ -1,28 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.thermal.spctemperature=[md.thermal.spctemperature, md.thermal.spctemperature+5, md.thermal.spctemperature+10, md.thermal.spctemperature+15; 1.5 2.5 3.5 4];
+-md.timestepping.time_step=1;
+-md.timestepping.final_time=4;
+-md.transient.isdiagnostic=0;
+-md.transient.isprognostic=0;
+-md.transient.isthermal=1;
+-md.transient.isgroundingline=0;
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Temperature1','BasalforcingsMeltingRate1','Temperature2','BasalforcingsMeltingRate2','Temperature3','BasalforcingsMeltingRate3','Temperature4','BasalforcingsMeltingRate4'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+-field_values={...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+-	(md.results.TransientSolution(4).Temperature),...
+-	(md.results.TransientSolution(4).BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test268.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test268.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test268.m	(revision 12791)
+@@ -1,72 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-
+-md.timestepping.time_step=1;
+-md.settings.output_frequency=1;
+-md.timestepping.final_time=4;
+-
+-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;
+-%Dakota options
+-
+-%partitioning
+-md.qmu.numberofpartitions=20;
+-md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
+-md.qmu.partition=md.qmu.partition-1;
+-
+-%variables
+-md.qmu.variables.surface_mass_balance=normal_uncertain('scaled_SurfaceforcingsMassBalance',1,0.1);
+-
+-%responses
+-md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-md.qmu.responses.IceVolume=response_function('IceVolume',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-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]);
+-
+-%mass flux profiles
+-md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp'};
+-md.qmu.mass_flux_profile_directory=pwd;
+-
+-%%  nond_sampling study
+-md.qmu.method=dakota_method('nond_samp');
+-md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),'seed',1234,'samples',20,'sample_type','lhs');
+-
+-%parameters
+-md.qmu.params.direct=true;
+-md.qmu.params.analysis_driver='';
+-md.qmu.params.analysis_components='';
+-md.qmu.params.evaluation_concurrency=1;
+-md.qmu.params.interval_type='forward';
+-md.qmu.isdakota=1;
+-
+-md.diagnostic.reltol=10^-5; %tighten for qmu analyses
+-md.transient.requested_outputs=IceVolumeEnum();
+-
+-%solve
+-md=solve(md,TransientSolutionEnum,'overwrite','y');
+-md=tres(md,'dakota');
+-
+-%Fields and tolerances to track changes
+-md.results.dakota.importancefactors=[];
+-for i=1:8,
+-	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).mean];
+-end
+-for i=1:8,
+-	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).stddev];
+-end
+-field_names     ={'importancefactors'};
+-field_tolerances={1e-11};
+-field_values={...
+-         md.results.dakota.importancefactors,...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test252.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test252.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test252.m	(revision 12791)
+@@ -1,35 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_adapt=1;
+-md.timestepping.final_time=10;
+-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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test256.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test256.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test256.m	(revision 12791)
+@@ -1,64 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=setflowequation(md,'macayeal','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.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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(4).Surface),...
+-	(md.results.TransientSolution(4).Thickness),...
+-	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test240.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test240.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test240.m	(revision 12791)
+@@ -1,18 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',120000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,2,1);
+-md=setflowequation(md,'stokes','../Exp/SquareHalfRight.exp','fill','pattyn');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-06,1e-09,1e-09};
+-field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test244.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test244.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test244.m	(revision 12791)
+@@ -1,34 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.prognostic.hydrostatic_adjustment='Incremental';
+-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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test248.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test248.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test248.m	(revision 12791)
+@@ -1,49 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.prognostic.hydrostatic_adjustment='Incremental';
+-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_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-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
+-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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test270.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test270.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test270.m	(revision 12791)
+@@ -1,72 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-
+-md.timestepping.time_step=1;
+-md.settings.output_frequency=1;
+-md.timestepping.final_time=4;
+-
+-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;
+-%Dakota options
+-
+-%partitioning
+-md.qmu.numberofpartitions=20;
+-md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
+-md.qmu.partition=md.qmu.partition-1;
+-
+-%variables
+-md.qmu.variables.surface_mass_balance=normal_uncertain('scaled_SurfaceforcingsMassBalance',1,100);
+-
+-%responses
+-md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-md.qmu.responses.IceVolume=response_function('IceVolume',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-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]);
+-
+-%mass flux profiles
+-md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp'};
+-md.qmu.mass_flux_profile_directory=pwd;
+-
+-%method
+-md.qmu.method     =dakota_method('nond_l');
+-
+-%parameters
+-md.qmu.params.direct=true;
+-md.qmu.params.analysis_driver='';
+-md.qmu.params.analysis_components='';
+-md.qmu.params.evaluation_concurrency=1;
+-md.qmu.params.interval_type='forward';
+-md.qmu.params.fd_gradient_step_size='0.1';
+-md.qmu.isdakota=1;
+-
+-md.diagnostic.reltol=10^-5; %tighten for qmu analyses
+-md.transient.requested_outputs=IceVolumeEnum();
+-
+-%solve
+-md=solve(md,TransientSolutionEnum,'overwrite','y');
+-md=tres(md,'dakota');
+-
+-%Fields and tolerances to track changes
+-md.results.dakota.importancefactors=[];
+-for i=1:8,
+-	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).mean];
+-end
+-for i=1:8,
+-	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).stddev];
+-end
+-field_names     ={'importancefactors'};
+-field_tolerances={1e-11};
+-field_values={...
+-         md.results.dakota.importancefactors,...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test236.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test236.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test236.m	(revision 12791)
+@@ -1,92 +0,0 @@
+-md=squaremesh(model,1000000,1000000,5,5);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-
+-%redo the parameter file for this special shelf. 
+-%constant thickness, constrained (vy=0) flow into an icefront, 
+-%from 0 m/yr at the grounding line.
+-
+-%needed later
+-ymin=min(md.mesh.y);
+-ymax=max(md.mesh.y);
+-xmin=min(md.mesh.x);
+-xmax=max(md.mesh.x);
+-
+-di=md.materials.rho_ice/md.materials.rho_water;
+-
+-h=1000;
+-md.geometry.thickness=h*ones(md.mesh.numberofvertices,1);
+-md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
+-md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+-
+-%Initial velocity and pressure
+-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);
+-
+-%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);
+-
+-%Boundary conditions:
+-md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
+-
+-%constrain flanks to 0 normal velocity
+-pos=find(md.mesh.x==xmin | md.mesh.x==xmax);
+-md.diagnostic.spcvx(pos)=0;
+-md.diagnostic.spcvz(pos)=NaN;
+-
+-%constrain grounding line to 0 velocity
+-pos=find(md.mesh.y==ymin);
+-md.diagnostic.spcvx(pos)=0;
+-md.diagnostic.spcvy(pos)=0;
+-
+-%icefront
+-nodeonicefront=zeros(md.mesh.numberofvertices,1);
+-pos=find(md.mesh.y==ymax); nodeonicefront(pos)=1;
+-pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2))); diagnostic.icefront=md.mesh.segments(pos,:);
+-diagnostic.icefront=[diagnostic.icefront 1*md.mask.elementonfloatingice(diagnostic.icefront(:,end))];
+-md.diagnostic.icefront=diagnostic.icefront;
+-
+-%partitioning
+-md.qmu.numberofpartitions=md.mesh.numberofvertices;
+-md=partitioner(md,'package','linear','npart',md.qmu.numberofpartitions);
+-md.qmu.partition=md.qmu.partition-1;
+-
+-%Dakota options
+-%variables
+-md.qmu.variables.rheology_B=normal_uncertain('scaled_MaterialsRheologyB',1,.05);
+-
+-%responses
+-md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-
+-%method
+-md.qmu.method     =dakota_method('nond_l');
+-
+-%parameters
+-md.qmu.params.direct=true;
+-md.qmu.params.analysis_driver='diagnostic';
+-md.qmu.params.evaluation_concurrency=1;
+-md.qmu.params.interval_type='forward';
+-
+-%imperative! 
+-md.diagnostic.reltol=10^-10; %tighten for qmu analysese
+-md.qmu.isdakota=1;
+-
+-%solve
+-md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+-
+-%Fields and tolerances to track changes
+-md=tres(md,'dakota');
+-md.results.dakota.importancefactors=importancefactors(md,'scaled_MaterialsRheologyB','MaxVel')';
+-field_names     ={'importancefactors'};
+-field_tolerances={1e-10};
+-field_values={...
+-         md.results.dakota.importancefactors,...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test262.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test262.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test262.m	(revision 12791)
+@@ -1,69 +0,0 @@
+-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,'macayeal','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*2 ];
+-
+-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','SurfaceMassbalance4'};
+-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(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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(4).Surface),...
+-	(md.results.TransientSolution(4).Thickness),...
+-	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test266.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test266.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test266.m	(revision 12791)
+@@ -1,62 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.thermal.spctemperature=[md.thermal.spctemperature, md.thermal.spctemperature+5; 1 2];
+-md.timestepping.time_step=0.5;
+-md.timestepping.final_time=2;
+-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_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-07, ...
+-						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};
+-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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(4).Surface),...
+-	(md.results.TransientSolution(4).Thickness),...
+-	(md.results.TransientSolution(4).Temperature),...
+-	(md.results.TransientSolution(4).BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test250.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test250.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test250.m	(revision 12791)
+@@ -1,50 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.geometry.bed=md.geometry.bed+50; md.geometry.surface=md.geometry.surface+50;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.prognostic.hydrostatic_adjustment='Incremental';
+-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_tolerances={...
+-	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
+-	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
+-	1e-09,1e-09,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
+-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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test254.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test254.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test254.m	(revision 12791)
+@@ -1,50 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_adapt=1;
+-md.timestepping.final_time=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'};
+-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-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
+-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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test258.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test258.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test258.m	(revision 12791)
+@@ -1,64 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=setflowequation(md,'macayeal','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*2 ];
+-
+-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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(4).Surface),...
+-	(md.results.TransientSolution(4).Thickness),...
+-	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test242.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test242.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test242.m	(revision 12791)
+@@ -1,19 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',120000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,2,1);
+-md=setflowequation(md,'stokes','../Exp/SquareHalfRight.exp','fill','macayeal');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.diagnostic.viscosity_overshoot=0;
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-06,1e-09,1e-09};
+-field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test246.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test246.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test246.m	(revision 12791)
+@@ -1,35 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.geometry.bed=md.geometry.bed+50; md.geometry.surface=md.geometry.surface+50;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.prognostic.hydrostatic_adjustment='Incremental';
+-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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test238.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test238.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test238.m	(revision 12791)
+@@ -1,18 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,2);
+-md=setflowequation(md,'pattyn','../Exp/SquareHalfRight.exp','fill','macayeal');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-13};
+-field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test201.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test201.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test201.m	(revision 12791)
+@@ -0,0 +1,16 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test222.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test222.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test222.m	(revision 12791)
+@@ -1,50 +1,34 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
++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,'stokes','all');
+-md.diagnostic.reltol=NaN;
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
++md.prognostic.hydrostatic_adjustment='Incremental';
+ 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_tolerances={...
+-	1e-08,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,...
+-	1e-08,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06,...
+-	1e-07,1e-07,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06};
++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).Vz),...
+ 	(md.results.TransientSolution(1).Vel),...
+ 	(md.results.TransientSolution(1).Pressure),...
+ 	(md.results.TransientSolution(1).Bed),...
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+ 	(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).Bed),...
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+ 	(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).Bed),...
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test205.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test205.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test205.m	(revision 12791)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,2);
++md=setflowequation(md,'pattyn','../Exp/SquareHalfRight.exp','fill','macayeal','coupling','penalties');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-05,1e-05,1e-05,1e-05,1e-05};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test226.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test226.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test226.m	(revision 12791)
+@@ -1,34 +1,35 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
++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,'macayeal','all');
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-md.inversion.control_parameters={'MaterialsRheologyBbar'};
+-md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
+-md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=101*ones(md.inversion.nsteps,1);
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md.timestepping.time_adapt=1;
++md.timestepping.final_time=10;
++md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++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.DiagnosticSolution.Gradient1),...
+-	md.results.DiagnosticSolution.J,...
+-	(md.results.DiagnosticSolution.MaterialsRheologyB),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy)
+-};
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test209.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test209.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test209.m	(revision 12791)
+@@ -0,0 +1,48 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++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_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,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,...
++	1e-13,1e-13,1e-08,1e-13,1e-13,1e-10,1e-10,1e-10,1e-13,1e-8};
++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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test210.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test210.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test210.m	(revision 12791)
+@@ -1,18 +1,48 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',200000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,2);
+-md=setflowequation(md,'pattyn','../Exp/SquareHalfRight.exp','fill','macayeal','coupling','penalties');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-05,1e-05,1e-05,1e-05,1e-05};
++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_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-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test231.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test231.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test231.m	(revision 12791)
+@@ -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,'macayeal','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*2 ];
++
++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','SurfaceMassbalance4'};
++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(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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test214.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test214.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test214.m	(revision 12791)
+@@ -1,23 +1,34 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',200000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+ md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
++md=setflowequation(md,'pattyn','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++md.inversion.control_parameters={'MaterialsRheologyBbar'};
++md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
++md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=101*ones(md.inversion.nsteps,1);
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.transient.isdiagnostic=0;
+-md.transient.isprognostic=0;
+-md.transient.isthermal=1;
+-md.transient.isgroundingline=0;
+-md=solve(md,TransientSolutionEnum);
++md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature1','BasalforcingsMeltingRate1','Temperature2','BasalforcingsMeltingRate2','Temperature3','BasalforcingsMeltingRate3'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_names     ={'Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy'};
++field_tolerances={1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08};
+ field_values={...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+-	};
++	(md.results.DiagnosticSolution.Gradient1),...
++	md.results.DiagnosticSolution.J,...
++	(md.results.DiagnosticSolution.MaterialsRheologyB),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test235.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test235.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test235.m	(revision 12791)
+@@ -0,0 +1,72 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++md.timestepping.time_step=1;
++md.settings.output_frequency=1;
++md.timestepping.final_time=4;
++
++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;
++%Dakota options
++
++%partitioning
++md.qmu.numberofpartitions=20;
++md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
++md.qmu.partition=md.qmu.partition-1;
++
++%variables
++md.qmu.variables.surface_mass_balance=normal_uncertain('scaled_SurfaceforcingsMassBalance',1,100);
++
++%responses
++md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++md.qmu.responses.IceVolume=response_function('IceVolume',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++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]);
++
++%mass flux profiles
++md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp'};
++md.qmu.mass_flux_profile_directory=pwd;
++
++%method
++md.qmu.method     =dakota_method('nond_l');
++
++%parameters
++md.qmu.params.direct=true;
++md.qmu.params.analysis_driver='';
++md.qmu.params.analysis_components='';
++md.qmu.params.evaluation_concurrency=1;
++md.qmu.params.interval_type='forward';
++md.qmu.params.fd_gradient_step_size='0.1';
++md.qmu.isdakota=1;
++
++md.diagnostic.reltol=10^-5; %tighten for qmu analyses
++md.transient.requested_outputs=IceVolumeEnum();
++
++%solve
++md=solve(md,TransientSolutionEnum,'overwrite','y');
++md=tres(md,'dakota');
++
++%Fields and tolerances to track changes
++md.results.dakota.importancefactors=[];
++for i=1:8,
++	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).mean];
++end
++for i=1:8,
++	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).stddev];
++end
++field_names     ={'importancefactors'};
++field_tolerances={1e-11};
++field_values={...
++         md.results.dakota.importancefactors,...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test218.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test218.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test218.m	(revision 12791)
+@@ -1,48 +1,92 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=squaremesh(model,1000000,1000000,5,5);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,1);
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
+ 
++%redo the parameter file for this special shelf. 
++%constant thickness, constrained (vy=0) flow into an icefront, 
++%from 0 m/yr at the grounding line.
++
++%needed later
++ymin=min(md.mesh.y);
++ymax=max(md.mesh.y);
++xmin=min(md.mesh.x);
++xmax=max(md.mesh.x);
++
++di=md.materials.rho_ice/md.materials.rho_water;
++
++h=1000;
++md.geometry.thickness=h*ones(md.mesh.numberofvertices,1);
++md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
++%Initial velocity and pressure
++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);
++
++%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);
++
++%Boundary conditions:
++md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++
++%constrain flanks to 0 normal velocity
++pos=find(md.mesh.x==xmin | md.mesh.x==xmax);
++md.diagnostic.spcvx(pos)=0;
++md.diagnostic.spcvz(pos)=NaN;
++
++%constrain grounding line to 0 velocity
++pos=find(md.mesh.y==ymin);
++md.diagnostic.spcvx(pos)=0;
++md.diagnostic.spcvy(pos)=0;
++
++%icefront
++nodeonicefront=zeros(md.mesh.numberofvertices,1);
++pos=find(md.mesh.y==ymax); nodeonicefront(pos)=1;
++pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2))); diagnostic.icefront=md.mesh.segments(pos,:);
++diagnostic.icefront=[diagnostic.icefront 1*md.mask.elementonfloatingice(diagnostic.icefront(:,end))];
++md.diagnostic.icefront=diagnostic.icefront;
++
++%partitioning
++md.qmu.numberofpartitions=md.mesh.numberofvertices;
++md=partitioner(md,'package','linear','npart',md.qmu.numberofpartitions);
++md.qmu.partition=md.qmu.partition-1;
++
++%Dakota options
++%variables
++md.qmu.variables.rheology_B=normal_uncertain('scaled_MaterialsRheologyB',1,.05);
++
++%responses
++md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++
++%method
++md.qmu.method     =dakota_method('nond_l');
++
++%parameters
++md.qmu.params.direct=true;
++md.qmu.params.analysis_driver='diagnostic';
++md.qmu.params.evaluation_concurrency=1;
++md.qmu.params.interval_type='forward';
++
++%imperative! 
++md.diagnostic.reltol=10^-10; %tighten for qmu analysese
++md.qmu.isdakota=1;
++
++%solve
++md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
++
+ %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_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,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,...
+-	1e-13,1e-13,1e-08,1e-13,1e-13,1e-10,1e-10,1e-10,1e-13,1e-8};
++md=tres(md,'dakota');
++md.results.dakota.importancefactors=importancefactors(md,'scaled_MaterialsRheologyB','MaxVel')';
++field_names     ={'importancefactors'};
++field_tolerances={1e-10};
+ 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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++         md.results.dakota.importancefactors,...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test202.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test202.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test202.m	(revision 12791)
+@@ -1,16 +1,18 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,2);
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
+ 	(md.results.DiagnosticSolution.Vel),...
+ 	(md.results.DiagnosticSolution.Pressure),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test223.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test223.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test223.m	(revision 12791)
+@@ -0,0 +1,35 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'macayeal','all');
++md.geometry.bed=md.geometry.bed+50; md.geometry.surface=md.geometry.surface+50;
++md.cluster=generic('name',oshostname(),'np',3);
++md.prognostic.hydrostatic_adjustment='Incremental';
++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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test206.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test206.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test206.m	(revision 12791)
+@@ -1,18 +1,16 @@
+ md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,2);
+-md=setflowequation(md,'pattyn','all');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.timestepping.time_step=0;
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,ThermalSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
++field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-13,1e-13};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.ThermalSolution.Temperature),...
++	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test227.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test227.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test227.m	(revision 12791)
+@@ -0,0 +1,50 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.timestepping.time_adapt=1;
++md.timestepping.final_time=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'};
++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-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
++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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test211.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test211.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test211.m	(revision 12791)
+@@ -0,0 +1,50 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'stokes','all');
++md.diagnostic.reltol=NaN;
++md.cluster=generic('name',oshostname(),'np',3);
++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_tolerances={...
++	1e-08,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,...
++	1e-08,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06,...
++	1e-07,1e-07,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06};
++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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test232.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test232.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test232.m	(revision 12791)
+@@ -1,24 +1,28 @@
+-md=triangle(model,'../Exp/SquareHole.exp','../Exp/Rifts.exp',50000);
+-md=meshprocessrifts(md,'../Exp/Square.exp');
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1);
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
++md.thermal.spctemperature=[md.thermal.spctemperature, md.thermal.spctemperature+5, md.thermal.spctemperature+10, md.thermal.spctemperature+15; 1.5 2.5 3.5 4];
++md.timestepping.time_step=1;
++md.timestepping.final_time=4;
++md.transient.isdiagnostic=0;
++md.transient.isprognostic=0;
++md.transient.isthermal=1;
++md.transient.isgroundingline=0;
++md=solve(md,TransientSolutionEnum);
+ 
+-%rift settings
+-md.rifts.riftstruct.fill=MelangeEnum();
+-md.rifts.riftstruct.fraction=0;
+-md.diagnostic.rift_penalty_lock=2;
+-md.diagnostic.rift_penalty_threshold=0;
+-md.rifts.riftstruct.fractionincrement=.1;
+-md=solve(md,DiagnosticSolutionEnum);
+-
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vel','Pressure'};
+-field_tolerances={1e-11,1e-11,1e-11,1e-11};
++field_names     ={'Temperature1','BasalforcingsMeltingRate1','Temperature2','BasalforcingsMeltingRate2','Temperature3','BasalforcingsMeltingRate3','Temperature4','BasalforcingsMeltingRate4'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(4).Temperature),...
++	(md.results.TransientSolution(4).BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test215.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test215.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test215.m	(revision 12791)
+@@ -0,0 +1,34 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'stokes','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++md.inversion.control_parameters={'MaterialsRheologyBbar'};
++md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
++md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=101*ones(md.inversion.nsteps,1);
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy'};
++field_tolerances={1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Gradient1),...
++	md.results.DiagnosticSolution.J,...
++	(md.results.DiagnosticSolution.MaterialsRheologyB),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test219.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test219.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test219.m	(revision 12791)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,2);
++md=setflowequation(md,'pattyn','../Exp/SquareHalfRight.exp','fill','macayeal');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12791)
+@@ -28,41 +28,41 @@
+ 	case 120, name='SquareShelfConstrainedEnthalpyStea';
+ 	case 121, name='SquareShelfConstrainedEnthalpyTran';
+ 	case 122, name='SquareShelfConstrainedTransP3dEnth';
+-	case 202, name='SquareShelfDiagM2d';
+-	case 204, name='SquareShelfDiagM3d';
+-	case 206, name='SquareShelfDiagP3d';
+-	case 208, name='SquareShelfDiagS3d';
+-	case 210, name='SquareShelfDiagMP3dPenalties';
+-	case 212, name='SquareShelfTherStea';
+-	case 214, name='SquareShelfTherTran';
+-	case 216, name='SquareShelfTranM2d';
+-	case 218, name='SquareShelfTranM3d';
+-	case 220, name='SquareShelfTranP3d';
+-	case 222, name='SquareShelfTranS3d';
+-	case 224, name='SquareShelfCMBM2d';
+-	case 226, name='SquareShelfCMBM3d';
+-	case 228, name='SquareShelfCMBP3d';
+-	case 230, name='SquareShelfCMBS3d';
+-	case 232, name='SquareShelfDiagM2dRift';
+-	case 234, name='SquareShelfConstrained';
+-	case 236, name='SquareShelfConstrainedDakotaB';
+-	case 238, name='SquareShelfDiagMP3dTiling';
+-	case 240, name='SquareShelfDiagPS3dTiling';
+-	case 242, name='SquareShelfDiagMS3dTiling';
+-	case 244, name='SquareShelfDiagM2dTransientIncrHydro';
+-	case 246, name='SquareShelfDiagM2dTransientIncrNonHydro';
+-	case 248, name='SquareShelfDiagP3dTransientIncrHydro';
+-	case 250, name='SquareShelfDiagP3dTransientIncrNonHydro';
+-	case 252, name='SquareShelfTranCflM2d';
+-	case 254, name='SquareShelfTranCflP3d';
+-	case 256, name='SquareShelfTranForceNeg2d';
+-	case 258, name='SquareShelfTranForcePos2d';
+-	case 260, name='SquareShelfTranForceNeg3d';
+-	case 262, name='SquareShelfTranForcePos3d';
+-	case 264, name='SquareShelfTherTranForcTemp';
+-	case 266, name='SquareShelfTranP3dForcTemp';
+-	case 268, name='SquareShelfTranForceNeg2dDakotaSamp';
+-	case 270, name='SquareShelfTranForceNeg2dDakotaLocal';
++	case 201, name='SquareShelfDiagM2d';
++	case 202, name='SquareShelfDiagM3d';
++	case 203, name='SquareShelfDiagP3d';
++	case 204, name='SquareShelfDiagS3d';
++	case 205, name='SquareShelfDiagMP3dPenalties';
++	case 206, name='SquareShelfTherStea';
++	case 207, name='SquareShelfTherTran';
++	case 208, name='SquareShelfTranM2d';
++	case 209, name='SquareShelfTranM3d';
++	case 210, name='SquareShelfTranP3d';
++	case 211, name='SquareShelfTranS3d';
++	case 212, name='SquareShelfCMBM2d';
++	case 213, name='SquareShelfCMBM3d';
++	case 214, name='SquareShelfCMBP3d';
++	case 215, name='SquareShelfCMBS3d';
++	case 216, name='SquareShelfDiagM2dRift';
++	case 217, name='SquareShelfConstrained';
++	case 218, name='SquareShelfConstrainedDakotaB';
++	case 219, name='SquareShelfDiagMP3dTiling';
++	case 220, name='SquareShelfDiagPS3dTiling';
++	case 221, name='SquareShelfDiagMS3dTiling';
++	case 222, name='SquareShelfDiagM2dTransientIncrHydro';
++	case 223, name='SquareShelfDiagM2dTransientIncrNonHydro';
++	case 224, name='SquareShelfDiagP3dTransientIncrHydro';
++	case 225, name='SquareShelfDiagP3dTransientIncrNonHydro';
++	case 226, name='SquareShelfTranCflM2d';
++	case 227, name='SquareShelfTranCflP3d';
++	case 228, name='SquareShelfTranForceNeg2d';
++	case 229, name='SquareShelfTranForcePos2d';
++	case 230, name='SquareShelfTranForceNeg3d';
++	case 231, name='SquareShelfTranForcePos3d';
++	case 232, name='SquareShelfTherTranForcTemp';
++	case 233, name='SquareShelfTranP3dForcTemp';
++	case 234, name='SquareShelfTranForceNeg2dDakotaSamp';
++	case 235, name='SquareShelfTranForceNeg2dDakotaLocal';
+ 	case 302, name='SquareSheetConstrainedDiagM2d';
+ 	case 304, name='SquareSheetConstrainedDiagH2d';
+ 	case 306, name='SquareSheetConstrainedDiagHM2d';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test220.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test220.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test220.m	(revision 12791)
+@@ -1,48 +1,18 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
++md=triangle(model,'../Exp/Square.exp',120000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
++md=extrude(md,2,1);
++md=setflowequation(md,'stokes','../Exp/SquareHalfRight.exp','fill','pattyn');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
++md=solve(md,DiagnosticSolutionEnum);
+ 
+ %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_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-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-09,1e-09,1e-06,1e-09,1e-09};
+ 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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test203.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test203.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test203.m	(revision 12791)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,2);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test224.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test224.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test224.m	(revision 12791)
+@@ -1,33 +1,49 @@
+ md=triangle(model,'../Exp/Square.exp',200000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-md.inversion.control_parameters={'MaterialsRheologyBbar'};
+-md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
+-md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=101*ones(md.inversion.nsteps,1);
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md.prognostic.hydrostatic_adjustment='Incremental';
++md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++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_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-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
+ field_values={...
+-	(md.results.DiagnosticSolution.Gradient1),...
+-	md.results.DiagnosticSolution.J,...
+-	(md.results.DiagnosticSolution.MaterialsRheologyBbar),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy)
+-};
++	(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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test207.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test207.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test207.m	(revision 12791)
+@@ -0,0 +1,23 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.isdiagnostic=0;
++md.transient.isprognostic=0;
++md.transient.isthermal=1;
++md.transient.isgroundingline=0;
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Temperature1','BasalforcingsMeltingRate1','Temperature2','BasalforcingsMeltingRate2','Temperature3','BasalforcingsMeltingRate3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test228.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test228.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test228.m	(revision 12791)
+@@ -1,34 +1,64 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
++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,'pattyn','all');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
+ 
+-%control parameters
+-md.inversion.iscontrol=1;
+-md.inversion.control_parameters={'MaterialsRheologyBbar'};
+-md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
+-md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=101*ones(md.inversion.nsteps,1);
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++md.timestepping.time_step=1;
++md.settings.output_frequency=1;
++md.timestepping.final_time=4;
+ 
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++%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     ={'Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy'};
+-field_tolerances={1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08};
++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.DiagnosticSolution.Gradient1),...
+-	md.results.DiagnosticSolution.J,...
+-	(md.results.DiagnosticSolution.MaterialsRheologyB),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy)
+-};
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test212.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test212.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test212.m	(revision 12791)
+@@ -1,16 +1,33 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',200000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,1);
+ md=setflowequation(md,'macayeal','all');
+-md.timestepping.time_step=0;
++
++%control parameters
++md.inversion.iscontrol=1;
++md.inversion.control_parameters={'MaterialsRheologyBbar'};
++md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
++md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=101*ones(md.inversion.nsteps,1);
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,ThermalSolutionEnum);
++md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-13,1e-13};
++field_names     ={'Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+ field_values={...
+-	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
+-	};
++	(md.results.DiagnosticSolution.Gradient1),...
++	md.results.DiagnosticSolution.J,...
++	(md.results.DiagnosticSolution.MaterialsRheologyBbar),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test233.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test233.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test233.m	(revision 12791)
+@@ -0,0 +1,62 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.thermal.spctemperature=[md.thermal.spctemperature, md.thermal.spctemperature+5; 1 2];
++md.timestepping.time_step=0.5;
++md.timestepping.final_time=2;
++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_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-07, ...
++						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};
++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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).Temperature),...
++	(md.results.TransientSolution(4).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test216.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test216.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test216.m	(revision 12791)
+@@ -1,33 +1,24 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/SquareHole.exp','../Exp/Rifts.exp',50000);
++md=meshprocessrifts(md,'../Exp/Square.exp');
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
+ 
++%rift settings
++md.rifts.riftstruct.fill=MelangeEnum();
++md.rifts.riftstruct.fraction=0;
++md.diagnostic.rift_penalty_lock=2;
++md.diagnostic.rift_penalty_threshold=0;
++md.rifts.riftstruct.fractionincrement=.1;
++md=solve(md,DiagnosticSolutionEnum);
++
+ %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_names     ={'Vx','Vy','Vel','Pressure'};
++field_tolerances={1e-11,1e-11,1e-11,1e-11};
+ 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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test221.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test221.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test221.m	(revision 12791)
+@@ -0,0 +1,19 @@
++md=triangle(model,'../Exp/Square.exp',120000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,2,1);
++md=setflowequation(md,'stokes','../Exp/SquareHalfRight.exp','fill','macayeal');
++md.cluster=generic('name',oshostname(),'np',3);
++md.diagnostic.viscosity_overshoot=0;
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-09,1e-09,1e-06,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test204.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test204.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test204.m	(revision 12791)
+@@ -2,13 +2,13 @@
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+ md=extrude(md,3,2);
+-md=setflowequation(md,'macayeal','all');
++md=setflowequation(md,'stokes','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
++field_tolerances={1e-08,1e-08,1e-07,1e-08,1e-08};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test225.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test225.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test225.m	(revision 12791)
+@@ -0,0 +1,50 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.geometry.bed=md.geometry.bed+50; md.geometry.surface=md.geometry.surface+50;
++md.cluster=generic('name',oshostname(),'np',3);
++md.prognostic.hydrostatic_adjustment='Incremental';
++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_tolerances={...
++	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
++	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
++	1e-09,1e-09,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
++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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test208.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test208.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test208.m	(revision 12791)
+@@ -1,18 +1,33 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,3,2);
+-md=setflowequation(md,'stokes','all');
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-08,1e-08,1e-07,1e-08,1e-08};
++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.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test229.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test229.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test229.m	(revision 12791)
+@@ -0,0 +1,64 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'macayeal','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*2 ];
++
++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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test230.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test230.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test230.m	(revision 12791)
+@@ -1,34 +1,69 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
++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,'stokes','all');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
+ 
+-%control parameters
+-md.inversion.iscontrol=1;
+-md.inversion.control_parameters={'MaterialsRheologyBbar'};
+-md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
+-md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=101*ones(md.inversion.nsteps,1);
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++md.timestepping.time_step=1;
++md.settings.output_frequency=1;
++md.timestepping.final_time=4;
+ 
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++%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     ={'Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy'};
+-field_tolerances={1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09};
++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','SurfaceMassbalance4'};
++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.DiagnosticSolution.Gradient1),...
+-	md.results.DiagnosticSolution.J,...
+-	(md.results.DiagnosticSolution.MaterialsRheologyB),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy)
+-};
++	(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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test213.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test213.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test213.m	(revision 12791)
+@@ -0,0 +1,34 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++md.inversion.control_parameters={'MaterialsRheologyBbar'};
++md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
++md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=101*ones(md.inversion.nsteps,1);
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Gradient1),...
++	md.results.DiagnosticSolution.J,...
++	(md.results.DiagnosticSolution.MaterialsRheologyB),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test234.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test234.m	(revision 12790)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test234.m	(revision 12791)
+@@ -1,69 +1,72 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ 
+-%redo the parameter file for this special shelf. 
+-%constant thickness, constrained (vy=0) flow into an icefront, 
+-%from 0 m/yr at the grounding line.
++md.timestepping.time_step=1;
++md.settings.output_frequency=1;
++md.timestepping.final_time=4;
+ 
+-%tighten
+-md.diagnostic.restol=10^-4;
++smb = ones(md.mesh.numberofvertices,1)*3.6;
++smb=[ smb smb*-1 ];
+ 
+-%needed later
+-ymin=min(md.mesh.y);
+-ymax=max(md.mesh.y);
+-xmin=min(md.mesh.x);
+-xmax=max(md.mesh.x);
++md.surfaceforcings.mass_balance= smb;
++md.surfaceforcings.mass_balance(end+1,:)=[1.5 3];
++md.transient.isthermal=0;
++%Dakota options
+ 
+-di=md.materials.rho_ice/md.materials.rho_water;
++%partitioning
++md.qmu.numberofpartitions=20;
++md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
++md.qmu.partition=md.qmu.partition-1;
+ 
+-h=1000;
+-md.geometry.thickness=h*ones(md.mesh.numberofvertices,1);
+-md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
+-md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++%variables
++md.qmu.variables.surface_mass_balance=normal_uncertain('scaled_SurfaceforcingsMassBalance',1,0.1);
+ 
+-%Initial velocity and pressure
+-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);
++%responses
++md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++md.qmu.responses.IceVolume=response_function('IceVolume',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++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]);
+ 
+-%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);
++%mass flux profiles
++md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp'};
++md.qmu.mass_flux_profile_directory=pwd;
+ 
+-%Boundary conditions:
+-md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++%%  nond_sampling study
++md.qmu.method=dakota_method('nond_samp');
++md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),'seed',1234,'samples',20,'sample_type','lhs');
+ 
+-%constrain flanks to 0 normal velocity
+-pos=find(md.mesh.x==xmin | md.mesh.x==xmax);
+-md.diagnostic.spcvx(pos)=0;
+-md.diagnostic.spcvz(pos)=NaN;
++%parameters
++md.qmu.params.direct=true;
++md.qmu.params.analysis_driver='';
++md.qmu.params.analysis_components='';
++md.qmu.params.evaluation_concurrency=1;
++md.qmu.params.interval_type='forward';
++md.qmu.isdakota=1;
+ 
+-%constrain grounding line to 0 velocity
+-pos=find(md.mesh.y==ymin);
+-md.diagnostic.spcvx(pos)=0;
+-md.diagnostic.spcvy(pos)=0;
++md.diagnostic.reltol=10^-5; %tighten for qmu analyses
++md.transient.requested_outputs=IceVolumeEnum();
+ 
+-%icefront
+-nodeonicefront=zeros(md.mesh.numberofvertices,1);
+-pos=find(md.mesh.y==ymax); nodeonicefront(pos)=1;
+-pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2))); diagnostic.icefront=md.mesh.segments(pos,:);
+-diagnostic.icefront=[diagnostic.icefront 1*md.mask.elementonfloatingice(diagnostic.icefront(:,end))];
+-md.diagnostic.icefront=diagnostic.icefront;
++%solve
++md=solve(md,TransientSolutionEnum,'overwrite','y');
++md=tres(md,'dakota');
+ 
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292.
+-%ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3;
+-%vy_c=ey_c.*md.mesh.y*md.constants.yts;
+-
+ %Fields and tolerances to track changes
+-field_names     ={'Vy'};
+-field_tolerances={1e-13};
+-field_values={(md.results.DiagnosticSolution.Vy)};
++md.results.dakota.importancefactors=[];
++for i=1:8,
++	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).mean];
++end
++for i=1:8,
++	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).stddev];
++end
++field_names     ={'importancefactors'};
++field_tolerances={1e-11};
++field_values={...
++         md.results.dakota.importancefactors,...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test217.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test217.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test217.m	(revision 12791)
+@@ -0,0 +1,69 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++%redo the parameter file for this special shelf. 
++%constant thickness, constrained (vy=0) flow into an icefront, 
++%from 0 m/yr at the grounding line.
++
++%tighten
++md.diagnostic.restol=10^-4;
++
++%needed later
++ymin=min(md.mesh.y);
++ymax=max(md.mesh.y);
++xmin=min(md.mesh.x);
++xmax=max(md.mesh.x);
++
++di=md.materials.rho_ice/md.materials.rho_water;
++
++h=1000;
++md.geometry.thickness=h*ones(md.mesh.numberofvertices,1);
++md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
++%Initial velocity and pressure
++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);
++
++%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);
++
++%Boundary conditions:
++md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++
++%constrain flanks to 0 normal velocity
++pos=find(md.mesh.x==xmin | md.mesh.x==xmax);
++md.diagnostic.spcvx(pos)=0;
++md.diagnostic.spcvz(pos)=NaN;
++
++%constrain grounding line to 0 velocity
++pos=find(md.mesh.y==ymin);
++md.diagnostic.spcvx(pos)=0;
++md.diagnostic.spcvy(pos)=0;
++
++%icefront
++nodeonicefront=zeros(md.mesh.numberofvertices,1);
++pos=find(md.mesh.y==ymax); nodeonicefront(pos)=1;
++pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2))); diagnostic.icefront=md.mesh.segments(pos,:);
++diagnostic.icefront=[diagnostic.icefront 1*md.mask.elementonfloatingice(diagnostic.icefront(:,end))];
++md.diagnostic.icefront=diagnostic.icefront;
++
++md=solve(md,DiagnosticSolutionEnum);
++
++%create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292.
++%ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3;
++%vy_c=ey_c.*md.mesh.y*md.constants.yts;
++
++%Fields and tolerances to track changes
++field_names     ={'Vy'};
++field_tolerances={1e-13};
++field_values={(md.results.DiagnosticSolution.Vy)};
Index: /issm/oecreview/Archive/12678-13393/ISSM-12791-12792.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12791-12792.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12791-12792.diff	(revision 13394)
@@ -0,0 +1,136 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive230.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive234.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive204.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive208.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive213.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive217.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive222.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive226.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive235.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive201.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive205.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive209.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive210.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive214.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive218.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive223.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive227.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive232.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive202.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive206.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive211.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive215.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive219.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive220.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive224.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive228.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive233.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive203.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive207.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive212.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive216.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive221.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive225.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive229.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12792-12793.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12792-12793.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12792-12793.diff	(revision 13394)
@@ -0,0 +1,136 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive238.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive243.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive247.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive252.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive256.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive261.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive265.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive270.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive239.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive240.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive244.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive248.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive253.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive257.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive262.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive266.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive241.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive245.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive249.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive250.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive254.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive258.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive263.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive267.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive242.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive246.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive251.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive255.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive259.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive260.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive264.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive268.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12793-12794.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12793-12794.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12793-12794.diff	(revision 13394)
@@ -0,0 +1,81 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12793)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12794)
+@@ -30,41 +30,41 @@
+ 		120 : 'SquareShelfConstrainedEnthalpyStea',
+ 		121 : 'SquareShelfConstrainedEnthalpyTran',
+ 		122 : 'SquareShelfConstrainedTransP3dEnth',
+-		202 : 'SquareShelfDiagM2d',
+-		204 : 'SquareShelfDiagM3d',
+-		206 : 'SquareShelfDiagP3d',
+-		208 : 'SquareShelfDiagS3d',
+-		210 : 'SquareShelfDiagMP3dPenalties',
+-		212 : 'SquareShelfTherStea',
+-		214 : 'SquareShelfTherTran',
+-		216 : 'SquareShelfTranM2d',
+-		218 : 'SquareShelfTranM3d',
+-		220 : 'SquareShelfTranP3d',
+-		222 : 'SquareShelfTranS3d',
+-		224 : 'SquareShelfCMBM2d',
+-		226 : 'SquareShelfCMBM3d',
+-		228 : 'SquareShelfCMBP3d',
+-		230 : 'SquareShelfCMBS3d',
+-		232 : 'SquareShelfDiagM2dRift',
+-		234 : 'SquareShelfConstrained',
+-		236 : 'SquareShelfConstrainedDakotaB',
+-		238 : 'SquareShelfDiagMP3dTiling',
+-		240 : 'SquareShelfDiagPS3dTiling',
+-		242 : 'SquareShelfDiagMS3dTiling',
+-		244 : 'SquareShelfDiagM2dTransientIncrHydro',
+-		246 : 'SquareShelfDiagM2dTransientIncrNonHydro',
+-		248 : 'SquareShelfDiagP3dTransientIncrHydro',
+-		250 : 'SquareShelfDiagP3dTransientIncrNonHydro',
+-		252 : 'SquareShelfTranCflM2d',
+-		254 : 'SquareShelfTranCflP3d',
+-		256 : 'SquareShelfTranForceNeg2d',
+-		258 : 'SquareShelfTranForcePos2d',
+-		260 : 'SquareShelfTranForceNeg3d',
+-		262 : 'SquareShelfTranForcePos3d',
+-		264 : 'SquareShelfTherTranForcTemp',
+-		266 : 'SquareShelfTranP3dForcTemp',
+-		267 : 'SquareShelfTranForceNeg2dDakotaSamp',
+-   	268 : 'SquareShelfTranForceNeg2dDakotaLocal',
++		201 : 'SquareShelfDiagM2d',
++		202 : 'SquareShelfDiagM3d',
++		203 : 'SquareShelfDiagP3d',
++		204 : 'SquareShelfDiagS3d',
++		205 : 'SquareShelfDiagMP3dPenalties',
++		206 : 'SquareShelfTherStea',
++		207 : 'SquareShelfTherTran',
++		208 : 'SquareShelfTranM2d',
++		209 : 'SquareShelfTranM3d',
++		210 : 'SquareShelfTranP3d',
++		211 : 'SquareShelfTranS3d',
++		212 : 'SquareShelfCMBM2d',
++		213 : 'SquareShelfCMBM3d',
++		214 : 'SquareShelfCMBP3d',
++		215 : 'SquareShelfCMBS3d',
++		216 : 'SquareShelfDiagM2dRift',
++		217 : 'SquareShelfConstrained',
++		218 : 'SquareShelfConstrainedDakotaB',
++		219 : 'SquareShelfDiagMP3dTiling',
++		220 : 'SquareShelfDiagPS3dTiling',
++		221 : 'SquareShelfDiagMS3dTiling',
++		222 : 'SquareShelfDiagM2dTransientIncrHydro',
++		223 : 'SquareShelfDiagM2dTransientIncrNonHydro',
++		224 : 'SquareShelfDiagP3dTransientIncrHydro',
++		225 : 'SquareShelfDiagP3dTransientIncrNonHydro',
++		226 : 'SquareShelfTranCflM2d',
++		227 : 'SquareShelfTranCflP3d',
++		228 : 'SquareShelfTranForceNeg2d',
++		229 : 'SquareShelfTranForcePos2d',
++		230 : 'SquareShelfTranForceNeg3d',
++		231 : 'SquareShelfTranForcePos3d',
++		232 : 'SquareShelfTherTranForcTemp',
++		233 : 'SquareShelfTranP3dForcTemp',
++		234 : 'SquareShelfTranForceNeg2dDakotaSamp',
++   	235 : 'SquareShelfTranForceNeg2dDakotaLocal',
+ 		302 : 'SquareSheetConstrainedDiagM2d',
+ 		304 : 'SquareSheetConstrainedDiagH2d',
+ 		306 : 'SquareSheetConstrainedDiagHM2d',
Index: /issm/oecreview/Archive/12678-13393/ISSM-12794-12795.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12794-12795.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12794-12795.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12794)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12795)
+@@ -38,7 +38,7 @@
+ 
+ #PETSC
+ export PETSC_DIR
+-export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PETSC_DIR/lib/$ISSM_ARCH"
++export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PETSC_DIR/lib/$ISSM_ARCH:$PETSC_DIR/lib"
+ export LD_RUN_PATH="$LD_RUN_PATH:$PETSC_DIR/lib/$ISSM_ARCH"
+ 
+ #SLEPC
Index: /issm/oecreview/Archive/12678-13393/ISSM-12795-12796.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12795-12796.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12795-12796.diff	(revision 13394)
@@ -0,0 +1,26 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-python.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-python.sh	(revision 12795)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-python.sh	(revision 12796)
+@@ -12,21 +12,12 @@
+  --with-python-version=2.7\
+  --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
+  --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+- --with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
+  --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
+  --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich " \
+  --with-petsc-arch=$ISSM_ARCH \
+- --with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
+- --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+  --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+- --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+- --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
+  --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+- --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+  --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+- --with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
+- --with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
+- --with-shapelib-dir="$ISSM_DIR/externalpackages/shapelib/install" \
+  --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" \
+  --with-graphics-lib=/usr/lib64/libX11.so \
+  --with-cxxoptflags="-march=opteron -O2 -lutil" \
Index: /issm/oecreview/Archive/12678-13393/ISSM-12796-12797.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12796-12797.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12796-12797.diff	(revision 13394)
@@ -0,0 +1,40 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 12796)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 12797)
+@@ -1,5 +1,9 @@
+ #!/bin/bash
+ 
++#use matlab? 
++matlab=1
++
++
+ #Some cleanup 
+ rm -rf install triangle
+ mkdir install
+@@ -17,7 +21,11 @@
+ cp ../makefile ./
+ 
+ #Patch triangle.c 
+-patch triangle.c ../triangle.c.patch
++if [[ $matlab == "1" ]];then
++	patch triangle.c ../triangle.c.patch.matlab
++else
++	patch triangle.c ../triangle.c.patch.python
++fi
+ 
+ #Compile triangle
+ make
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle	(revision 12796)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle	(revision 12797)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++*.zip
+ install
+ install-matlab
+ install-python
Index: /issm/oecreview/Archive/12678-13393/ISSM-12797-12798.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12797-12798.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12797-12798.diff	(revision 13394)
@@ -0,0 +1,25 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/configs/linux64/make.inc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/configs/linux64/make.inc	(revision 12797)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/configs/linux64/make.inc	(revision 12798)
+@@ -15,7 +15,7 @@
+ FORTRAN  = gfortran 
+ OPTS     = -fPIC -O2
+ DRVOPTS  = $(OPTS)
+-NOOPT    = -O0
++NOOPT    = -fPIC -O0
+ LOADER   = gfortran
+ LOADOPTS =
+ #
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack	(revision 12797)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack	(revision 12798)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++*.tgz
++install
++src
Index: /issm/oecreview/Archive/12678-13393/ISSM-12798-12799.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12798-12799.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12798-12799.diff	(revision 13394)
@@ -0,0 +1,26 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh	(revision 12798)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh	(revision 12799)
+@@ -21,7 +21,7 @@
+ 	--PETSC_ARCH=linux-gnu-amd64 \
+ 	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+ 	--with-debugging=0 \
+-	--with-shared-libraries=0 \
++	--with-shared-libraries=1 \
+ 	--download-mumps=yes \
+ 	--download-scalapack=yes \
+ 	--download-blacs=yes \
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc	(revision 12798)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc	(revision 12799)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++*.tgz
+ install
+ install-3.1
+ src
Index: /issm/oecreview/Archive/12678-13393/ISSM-12799-12800.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12799-12800.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12799-12800.diff	(revision 13394)
@@ -0,0 +1,89 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python	(revision 12799)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python	(revision 12800)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++install-*
+ install
+ install-python*
+ src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas	(revision 12799)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas	(revision 12800)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++src
++install
++*.tgz
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2	(revision 12799)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2	(revision 12800)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2
+___________________________________________________________________
+Modified: svn:ignore
+## -1,2 +1,3 ##
++*.gz
+ install
+ src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose	(revision 12799)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose	(revision 12800)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose
+___________________________________________________________________
+Modified: svn:ignore
+## -1,2 +1,4 ##
++*.gz
+ py3k
++src
+ src-*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git	(revision 12799)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git	(revision 12800)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++install
++src
++*.gz
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython	(revision 12799)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython	(revision 12800)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython
+___________________________________________________________________
+Modified: svn:ignore
+## -1,2 +1,4 ##
++src
+ src-*
++*.gz
+ install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc	(revision 12799)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc	(revision 12800)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc
+___________________________________________________________________
+Modified: svn:ignore
+## -1,4 +1,5 ##
+ *.tgz
++*.gz
+ install
+ install-3.1
+ src
Index: /issm/oecreview/Archive/12678-13393/ISSM-12800-12801.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12800-12801.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12800-12801.diff	(revision 13394)
@@ -0,0 +1,64 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python	(revision 12800)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python	(revision 12801)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python
+___________________________________________________________________
+Modified: svn:ignore
+## -1 +1,3 ##
++*.deps
++Makefile.in
+ Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab	(revision 12800)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab	(revision 12801)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab
+___________________________________________________________________
+Modified: svn:ignore
+## -1,6 +1,7 ##
+ *.obj
+ Makefile
+ *.lib
++*.mexa64
+ *.mexw64
+ *.manifest
+ *.exp
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model	(revision 12800)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model	(revision 12801)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model
+___________________________________________________________________
+Modified: svn:ignore
+## -1,2 +1,3 ##
+ Makefile
++Makefile.in
+ __pycache__
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py	(revision 12800)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py	(revision 12801)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py
+___________________________________________________________________
+Modified: svn:ignore
+## -1 +1,2 ##
+ Makefile
++Makefile.in
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin	(revision 12800)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin	(revision 12801)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++*.exe
+ *.mexa64
+ *.mexw64
+ *.mexw32
Index: /issm/oecreview/Archive/12678-13393/ISSM-12801-12802.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12801-12802.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12801-12802.diff	(revision 13394)
@@ -0,0 +1,101 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-matlab.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-matlab.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-matlab.sh	(revision 12802)
+@@ -0,0 +1,26 @@
++#!/bin/bash
++
++#Some 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
++
++#copy new makefile
++cp ../configs/linux64/configure.make ./
++cp ../makefile ./
++
++#Patch triangle.c 
++patch triangle.c ../triangle.c.patch.matlab
++
++#Compile triangle
++make
++
++#Patch triangle.h
++patch triangle.h ../triangle.h.patch
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-matlab.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 12801)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 12802)
+@@ -1,9 +1,5 @@
+ #!/bin/bash
+ 
+-#use matlab? 
+-matlab=1
+-
+-
+ #Some cleanup 
+ rm -rf install triangle
+ mkdir install
+@@ -21,11 +17,7 @@
+ cp ../makefile ./
+ 
+ #Patch triangle.c 
+-if [[ $matlab == "1" ]];then
+-	patch triangle.c ../triangle.c.patch.matlab
+-else
+-	patch triangle.c ../triangle.c.patch.python
+-fi
++patch triangle.c ../triangle.c.patch.matlab
+ 
+ #Compile triangle
+ make
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-python.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-python.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-python.sh	(revision 12802)
+@@ -0,0 +1,26 @@
++#!/bin/bash
++
++#Some 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
++
++#copy new makefile
++cp ../configs/linux64/configure.make ./
++cp ../makefile ./
++
++#Patch triangle.c 
++patch triangle.c ../triangle.c.patch.python
++
++#Compile triangle
++make
++
++#Patch triangle.h
++patch triangle.h ../triangle.h.patch
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-python.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12802-12803.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12802-12803.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12802-12803.diff	(revision 13394)
@@ -0,0 +1,2051 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test350.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test350.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test350.m	(revision 12803)
+@@ -1,18 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-md.timestepping.time_step=0;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+-md=solve(md,EnthalpySolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Enthalpy','Waterfraction','Temperature'};
+-field_tolerances={1e-13,1e-13,1e-13};
+-field_values={...
+-	(md.results.EnthalpySolution.Enthalpy),...
+-	(md.results.EnthalpySolution.Waterfraction),...
+-	(md.results.EnthalpySolution.Temperature),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test354.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test354.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test354.m	(revision 12803)
+@@ -1,55 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+-md.initialization.temperature(:)=272;
+-md.thermal.spctemperature(find(md.mesh.vertexonsurface))=272;
+-md.thermal.isenthalpy=1;
+-md.basalforcings.geothermalflux(:)=5;
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','Enthalpy1','Waterfraction1', ...
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2', ...
+-					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-						1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-						1e-09,5e-10,1e-10,1e-10,1e-10,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).Vz),...
+-	(md.results.TransientSolution(1).Vel),...
+-	(md.results.TransientSolution(1).Pressure),...
+-	(md.results.TransientSolution(1).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).Enthalpy),...
+-	(md.results.TransientSolution(1).Waterfraction),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).Enthalpy),...
+-	(md.results.TransientSolution(2).Waterfraction),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).Enthalpy),...
+-	(md.results.TransientSolution(3).Waterfraction),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test358.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test358.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test358.m	(revision 12803)
+@@ -1,55 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.surfaceforcings.issmbgradients=1;
+-md.surfaceforcings.smb_pos_max=5000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
+-md.surfaceforcings.smb_pos_min=1250. + 0.00005*md.mesh.x -0.0001*md.mesh.y;
+-md.surfaceforcings.a_pos=15000. - 0.000051*md.mesh.x + 0.00011*md.mesh.y;
+-md.surfaceforcings.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y;
+-md.surfaceforcings.a_neg=-20000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
+-md.surfaceforcings.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y;
+-md.surfaceforcings.hc=(md.surfaceforcings.a_pos-md.surfaceforcings.a_neg)./(md.surfaceforcings.b_neg-md.surfaceforcings.b_pos);
+-md.transient.requested_outputs=TotalSmbEnum();
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Bed1','Surface1','Thickness1','Temperature1','SMB1','TotalSmb1','Vx2','Vy2','Vz2','Vel2','Bed2','Surface2','Thickness2','Temperature2','SMB2','TotalSmb1','Vx3','Vy3','Vz3','Vel3','Bed3','Surface3','Thickness3','Temperature3','SMB3','TotalSmb1'};
+-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-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-						1e-09,5e-09,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).Vz),...
+-	(md.results.TransientSolution(1).Vel),...
+-	(md.results.TransientSolution(1).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
+-	(md.results.TransientSolution(1).TotalSmb),...
+-	(md.results.TransientSolution(2).Vx),...
+-	(md.results.TransientSolution(2).Vy),...
+-	(md.results.TransientSolution(2).Vz),...
+-	(md.results.TransientSolution(2).Vel),...
+-	(md.results.TransientSolution(2).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
+-	(md.results.TransientSolution(2).TotalSmb),...
+-	(md.results.TransientSolution(3).Vx),...
+-	(md.results.TransientSolution(3).Vy),...
+-	(md.results.TransientSolution(3).Vz),...
+-	(md.results.TransientSolution(3).Vel),...
+-	(md.results.TransientSolution(3).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
+-	(md.results.TransientSolution(3).TotalSmb),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test342.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test342.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test342.m	(revision 12803)
+@@ -1,34 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-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);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=[102*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
+-md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy'};
+-field_tolerances={1e-08,1e-07,1e-10,1e-10,1e-09,1e-09,1e-09};
+-field_values={...
+-	(md.results.DiagnosticSolution.Gradient1),...
+-	md.results.DiagnosticSolution.J,...
+-	(md.results.DiagnosticSolution.FrictionCoefficient),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy)
+-};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test346.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test346.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test346.m	(revision 12803)
+@@ -1,35 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_adapt=1;
+-md.timestepping.final_time=600;
+-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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test330.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test330.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test330.m	(revision 12803)
+@@ -1,47 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,5,1.2);
+-md=setflowequation(md,'hutter','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-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_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,  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).Vz),...
+-	(md.results.TransientSolution(1).Vel),...
+-	(md.results.TransientSolution(1).Pressure),...
+-	(md.results.TransientSolution(1).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test334.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test334.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test334.m	(revision 12803)
+@@ -1,47 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-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_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-						1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-						1e-09,5e-10,1e-10,1e-10,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).Vz),...
+-	(md.results.TransientSolution(1).Vel),...
+-	(md.results.TransientSolution(1).Pressure),...
+-	(md.results.TransientSolution(1).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test338.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test338.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test338.m	(revision 12803)
+@@ -1,33 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=setflowequation(md,'macayeal','all');
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-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);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=[103*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
+-md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy'};
+-field_tolerances={1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+-field_values={...
+-	(md.results.DiagnosticSolution.Gradient1),...
+-	md.results.DiagnosticSolution.J,...
+-	(md.results.DiagnosticSolution.FrictionCoefficient),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy)
+-};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test352.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test352.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test352.m	(revision 12803)
+@@ -1,30 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+-md.transient.isdiagnostic=0;
+-md.transient.isprognostic=0;
+-md.transient.isthermal=1;
+-md.transient.isgroundingline=0;
+-md.thermal.isenthalpy=1;
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Enthalpy1','Waterfraction1','Temperature1',...
+-	'Enthalpy2','Waterfraction2','Temperature2',...
+-	'Enthalpy3','Waterfraction3','Temperature3'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+-field_values={...
+-	(md.results.TransientSolution(1).Enthalpy),...
+-	(md.results.TransientSolution(1).Waterfraction),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(2).Enthalpy),...
+-	(md.results.TransientSolution(2).Waterfraction),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(3).Enthalpy),...
+-	(md.results.TransientSolution(3).Waterfraction),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test356.m	(revision 12803)
+@@ -1,45 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=setflowequation(md,'macayeal','all');
+-md.surfaceforcings.issmbgradients=1;
+-md.surfaceforcings.smb_pos_max=5000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
+-md.surfaceforcings.smb_pos_min=1250. + 0.00005*md.mesh.x -0.0001*md.mesh.y;
+-md.surfaceforcings.a_pos=15000. - 0.000051*md.mesh.x + 0.00011*md.mesh.y;
+-md.surfaceforcings.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y;
+-md.surfaceforcings.a_neg=-20000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
+-md.surfaceforcings.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y;
+-md.surfaceforcings.hc=(md.surfaceforcings.a_pos-md.surfaceforcings.a_neg)./(md.surfaceforcings.b_neg-md.surfaceforcings.b_pos);
+-md.transient.requested_outputs=TotalSmbEnum();
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vel1','Bed1','Surface1','Thickness1','SMB1','TotalSmb1','Vx2','Vy2','Vel2','Bed2','Surface2','Thickness2','SMB2','TotalSmb2','Vx3','Vy3','Vel3','Bed3','Surface3','Thickness3','SMB3','TotalSmb3'};
+-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};
+-field_values={...
+-	(md.results.TransientSolution(1).Vx),...
+-	(md.results.TransientSolution(1).Vy),...
+-	(md.results.TransientSolution(1).Vel),...
+-	(md.results.TransientSolution(1).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
+-	(md.results.TransientSolution(1).TotalSmb),...
+-	(md.results.TransientSolution(2).Vx),...
+-	(md.results.TransientSolution(2).Vy),...
+-	(md.results.TransientSolution(2).Vel),...
+-	(md.results.TransientSolution(2).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).TotalSmb),...
+-	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
+-	(md.results.TransientSolution(3).Vx),...
+-	(md.results.TransientSolution(3).Vy),...
+-	(md.results.TransientSolution(3).Vel),...
+-	(md.results.TransientSolution(3).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
+-	(md.results.TransientSolution(3).TotalSmb),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test340.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test340.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test340.m	(revision 12803)
+@@ -1,34 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-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);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=[103*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
+-md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy'};
+-field_tolerances={1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
+-field_values={...
+-	(md.results.DiagnosticSolution.Gradient1),...
+-	md.results.DiagnosticSolution.J,...
+-	(md.results.DiagnosticSolution.FrictionCoefficient),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy)
+-};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test344.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test344.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test344.m	(revision 12803)
+@@ -1,34 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'stokes','all');
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-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);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=[104*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
+-md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy'};
+-field_tolerances={1e-06,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09};
+-field_values={...
+-	(md.results.DiagnosticSolution.Gradient1),...
+-	md.results.DiagnosticSolution.J,...
+-	(md.results.DiagnosticSolution.FrictionCoefficient),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy)
+-};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test348.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test348.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test348.m	(revision 12803)
+@@ -1,49 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,5,1.2);
+-md=setflowequation(md,'hutter','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_adapt=1;
+-md.timestepping.final_time=500;
+-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_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};
+-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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-%	(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).Bed),...
+-%	(md.results.TransientSolution(3).Surface),...
+-%	(md.results.TransientSolution(3).Thickness),...
+-%	(md.results.TransientSolution(3).Temperature),...
+-%	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test332.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test332.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test332.m	(revision 12803)
+@@ -1,33 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-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).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test336.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test336.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test336.m	(revision 12803)
+@@ -1,22 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'','');
+-md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,4,1);
+-md=setflowequation(md,'hutter','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_step=0;
+-md=solve(md,SteadystateSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13
+-};
+-field_values={...
+-	(md.results.SteadystateSolution.Vx),...
+-	(md.results.SteadystateSolution.Vy),...
+-	(md.results.SteadystateSolution.Vz),...
+-	(md.results.SteadystateSolution.Vel),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test320.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test320.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test320.m	(revision 12803)
+@@ -1,16 +1,34 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=meshconvert(md);
++md=triangle(model,'../Exp/Square.exp',200000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,3,1);
+ md=setflowequation(md,'macayeal','all');
+-md.prognostic.stabilization=3;
+-md.prognostic.spcthickness=md.geometry.thickness;
++
++%control parameters
++md.inversion.iscontrol=1;
++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);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=[103*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
++md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,PrognosticSolutionEnum);
++md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
++field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy'};
++field_tolerances={1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
+ field_values={...
+-	(md.results.PrognosticSolution.Thickness),...
+-	};
++	(md.results.DiagnosticSolution.Gradient1),...
++	md.results.DiagnosticSolution.J,...
++	(md.results.DiagnosticSolution.FrictionCoefficient),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test303.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test303.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test303.m	(revision 12803)
+@@ -0,0 +1,16 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'hutter','../Exp/SquareHalfRight.exp','fill','macayeal');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test324.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test324.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test324.m	(revision 12803)
+@@ -1,16 +1,49 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-md.timestepping.time_step=0;
++md=extrude(md,5,1.2);
++md=setflowequation(md,'hutter','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,ThermalSolutionEnum);
++md.timestepping.time_adapt=1;
++md.timestepping.final_time=500;
++md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-13,1e-13};
++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_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};
+ field_values={...
+-	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++%	(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).Bed),...
++%	(md.results.TransientSolution(3).Surface),...
++%	(md.results.TransientSolution(3).Thickness),...
++%	(md.results.TransientSolution(3).Temperature),...
++%	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test307.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test307.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test307.m	(revision 12803)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-09,1e-09,1e-10,2e-10,1e-10};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test328.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test328.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test328.m	(revision 12803)
+@@ -1,33 +1,45 @@
+ md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=setflowequation(md,'hutter','all');
++md=setflowequation(md,'macayeal','all');
++md.surfaceforcings.issmbgradients=1;
++md.surfaceforcings.smb_pos_max=5000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
++md.surfaceforcings.smb_pos_min=1250. + 0.00005*md.mesh.x -0.0001*md.mesh.y;
++md.surfaceforcings.a_pos=15000. - 0.000051*md.mesh.x + 0.00011*md.mesh.y;
++md.surfaceforcings.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y;
++md.surfaceforcings.a_neg=-20000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
++md.surfaceforcings.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y;
++md.surfaceforcings.hc=(md.surfaceforcings.a_pos-md.surfaceforcings.a_neg)./(md.surfaceforcings.b_neg-md.surfaceforcings.b_pos);
++md.transient.requested_outputs=TotalSmbEnum();
+ md.cluster=generic('name',oshostname(),'np',3);
+ 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-10,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};
++field_names     ={'Vx1','Vy1','Vel1','Bed1','Surface1','Thickness1','SMB1','TotalSmb1','Vx2','Vy2','Vel2','Bed2','Surface2','Thickness2','SMB2','TotalSmb2','Vx3','Vy3','Vel3','Bed3','Surface3','Thickness3','SMB3','TotalSmb3'};
++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};
+ 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).Bed),...
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(1).TotalSmb),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vel),...
+-	(md.results.TransientSolution(2).Pressure),...
+ 	(md.results.TransientSolution(2).Bed),...
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(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).Bed),...
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(3).TotalSmb),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test312.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test312.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test312.m	(revision 12803)
+@@ -1,18 +1,16 @@
+ md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,4,2);
+-md=setflowequation(md,'hutter','../Exp/SquareHalfRight.exp','fill','macayeal');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.timestepping.time_step=0;
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,ThermalSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
++field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-13,1e-13};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.ThermalSolution.Temperature),...
++	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test316.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test316.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test316.m	(revision 12803)
+@@ -1,18 +1,33 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'stokes','all');
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
++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.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test321.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test321.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test321.m	(revision 12803)
+@@ -0,0 +1,34 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++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);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=[102*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
++md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy'};
++field_tolerances={1e-08,1e-07,1e-10,1e-10,1e-09,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Gradient1),...
++	md.results.DiagnosticSolution.J,...
++	(md.results.DiagnosticSolution.FrictionCoefficient),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test304.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test304.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test304.m	(revision 12803)
+@@ -1,16 +1,18 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=setflowequation(md,'hutter','all');
++md=extrude(md,3,2);
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
+ 	(md.results.DiagnosticSolution.Vel),...
+ 	(md.results.DiagnosticSolution.Pressure),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test325.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test325.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test325.m	(revision 12803)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.timestepping.time_step=0;
++md.cluster=generic('name',oshostname(),'np',3);
++md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
++md=solve(md,EnthalpySolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Enthalpy','Waterfraction','Temperature'};
++field_tolerances={1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.EnthalpySolution.Enthalpy),...
++	(md.results.EnthalpySolution.Waterfraction),...
++	(md.results.EnthalpySolution.Temperature),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test308.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test308.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test308.m	(revision 12803)
+@@ -1,14 +1,14 @@
+ md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,2);
+-md=setflowequation(md,'macayeal','all');
++md=extrude(md,3,1);
++md=setflowequation(md,'stokes','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test329.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test329.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test329.m	(revision 12803)
+@@ -0,0 +1,55 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.surfaceforcings.issmbgradients=1;
++md.surfaceforcings.smb_pos_max=5000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
++md.surfaceforcings.smb_pos_min=1250. + 0.00005*md.mesh.x -0.0001*md.mesh.y;
++md.surfaceforcings.a_pos=15000. - 0.000051*md.mesh.x + 0.00011*md.mesh.y;
++md.surfaceforcings.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y;
++md.surfaceforcings.a_neg=-20000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
++md.surfaceforcings.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y;
++md.surfaceforcings.hc=(md.surfaceforcings.a_pos-md.surfaceforcings.a_neg)./(md.surfaceforcings.b_neg-md.surfaceforcings.b_pos);
++md.transient.requested_outputs=TotalSmbEnum();
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Bed1','Surface1','Thickness1','Temperature1','SMB1','TotalSmb1','Vx2','Vy2','Vz2','Vel2','Bed2','Surface2','Thickness2','Temperature2','SMB2','TotalSmb1','Vx3','Vy3','Vz3','Vel3','Bed3','Surface3','Thickness3','Temperature3','SMB3','TotalSmb1'};
++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-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++						1e-09,5e-09,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).Vz),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(1).TotalSmb),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vz),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vz),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(3).TotalSmb),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test313.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test313.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test313.m	(revision 12803)
+@@ -0,0 +1,20 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.verbose=verbose('convergence',true,'solution',true);
++md.transient.isdiagnostic=0;
++md.transient.isprognostic=0;
++md.transient.isthermal=1;
++md.transient.isgroundingline=0;
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test317.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test317.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test317.m	(revision 12803)
+@@ -0,0 +1,47 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++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_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++						1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++						1e-09,5e-10,1e-10,1e-10,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).Vz),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12803)
+@@ -63,35 +63,35 @@
+ 	case 233, name='SquareShelfTranP3dForcTemp';
+ 	case 234, name='SquareShelfTranForceNeg2dDakotaSamp';
+ 	case 235, name='SquareShelfTranForceNeg2dDakotaLocal';
+-	case 302, name='SquareSheetConstrainedDiagM2d';
+-	case 304, name='SquareSheetConstrainedDiagH2d';
+-	case 306, name='SquareSheetConstrainedDiagHM2d';
+-	case 308, name='SquareSheetConstrainedDiagM3d';
+-	case 310, name='SquareSheetConstrainedDiagH3d';
+-	case 312, name='SquareSheetConstrainedDiagHM3d';
+-	case 314, name='SquareSheetConstrainedDiagP3d';
+-	case 316, name='SquareSheetConstrainedDiagS3d';
+-	case 318, name='SquareSheetConstrainedProg2d';
++	case 301, name='SquareSheetConstrainedDiagM2d';
++	case 302, name='SquareSheetConstrainedDiagH2d';
++	case 303, name='SquareSheetConstrainedDiagHM2d';
++	case 304, name='SquareSheetConstrainedDiagM3d';
++	case 305, name='SquareSheetConstrainedDiagH3d';
++	case 306, name='SquareSheetConstrainedDiagHM3d';
++	case 307, name='SquareSheetConstrainedDiagP3d';
++	case 308, name='SquareSheetConstrainedDiagS3d';
++	case 309, name='SquareSheetConstrainedProg2d';
+ 	case 320, name='SquareSheetConstrainedProg2dDG';
+-	case 322, name='SquareSheetConstrainedProg3d';
+-	case 324, name='SquareSheetConstrainedTherStea';
+-	case 326, name='SquareSheetConstrainedTherTran';
+-	case 328, name='SquareSheetConstrainedTranH2d';
+-	case 330, name='SquareSheetConstrainedTranH3d';
+-	case 332, name='SquareSheetConstrainedTranM2d';
+-	case 334, name='SquareSheetConstrainedTranP3d';
+-	case 336, name='SquareSheetConstrainedSteaH3d';
+-	case 338, name='SquareSheetConstrainedCMDragM2d';
+-	case 340, name='SquareSheetConstrainedCMDragM3d';
+-	case 342, name='SquareSheetConstrainedCMDragP3d';
+-	case 344, name='SquareSheetConstrainedCMDragS3d';
+-	case 346, name='SquareSheetConstrainedTranCflM2d';
+-	case 348, name='SquareSheetConstrainedTranCflH3d';
+-	case 350, name='SquareSheetConstrainedEnthalpyStea';
+-	case 352, name='SquareSheetConstrainedEnthalpyTran';
+-	case 354, name='SquareSheetConstrainedTransP3dEnth';
+-	case 356, name='SquareSheetConstrainedSmbGradients2d';
+-	case 358, name='SquareSheetConstrainedSmbGradients3d';
++	case 311, name='SquareSheetConstrainedProg3d';
++	case 312, name='SquareSheetConstrainedTherStea';
++	case 313, name='SquareSheetConstrainedTherTran';
++	case 314, name='SquareSheetConstrainedTranH2d';
++	case 315, name='SquareSheetConstrainedTranH3d';
++	case 316, name='SquareSheetConstrainedTranM2d';
++	case 317, name='SquareSheetConstrainedTranP3d';
++	case 318, name='SquareSheetConstrainedSteaH3d';
++	case 319, name='SquareSheetConstrainedCMDragM2d';
++	case 320, name='SquareSheetConstrainedCMDragM3d';
++	case 321, name='SquareSheetConstrainedCMDragP3d';
++	case 322, name='SquareSheetConstrainedCMDragS3d';
++	case 323, name='SquareSheetConstrainedTranCflM2d';
++	case 324, name='SquareSheetConstrainedTranCflH3d';
++	case 325, name='SquareSheetConstrainedEnthalpyStea';
++	case 326, name='SquareSheetConstrainedEnthalpyTran';
++	case 327, name='SquareSheetConstrainedTransP3dEnth';
++	case 328, name='SquareSheetConstrainedSmbGradients2d';
++	case 329, name='SquareSheetConstrainedSmbGradients3d';
+ 	case 402, name='SquareSheetShelfDiagM2d';
+ 	case 404, name='SquareSheetShelfDiagM3d';
+ 	case 406, name='SquareSheetShelfDiagP3d';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test301.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test301.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test301.m	(revision 12803)
+@@ -0,0 +1,16 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test322.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test322.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test322.m	(revision 12803)
+@@ -1,14 +1,34 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',200000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=setflowequation(md,'macayeal','all');
+-md=extrude(md,5,0.5);
++md=extrude(md,3,1);
++md=setflowequation(md,'stokes','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++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);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=[104*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
++md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,PrognosticSolutionEnum);
++md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
++field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy'};
++field_tolerances={1e-06,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09};
+ field_values={...
+-	(md.results.PrognosticSolution.Thickness),...
+-	};
++	(md.results.DiagnosticSolution.Gradient1),...
++	md.results.DiagnosticSolution.J,...
++	(md.results.DiagnosticSolution.FrictionCoefficient),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test305.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test305.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test305.m	(revision 12803)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,5,2);
++md=setflowequation(md,'hutter','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test326.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test326.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test326.m	(revision 12803)
+@@ -4,17 +4,27 @@
+ md=extrude(md,3,1);
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.verbose=verbose('convergence',true,'solution',true);
++md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+ md.transient.isdiagnostic=0;
+ md.transient.isprognostic=0;
+ md.transient.isthermal=1;
+ md.transient.isgroundingline=0;
++md.thermal.isenthalpy=1;
+ md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-13,1e-13};
++field_names     ={'Enthalpy1','Waterfraction1','Temperature1',...
++	'Enthalpy2','Waterfraction2','Temperature2',...
++	'Enthalpy3','Waterfraction3','Temperature3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+ field_values={...
++	(md.results.TransientSolution(1).Enthalpy),...
++	(md.results.TransientSolution(1).Waterfraction),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).Enthalpy),...
++	(md.results.TransientSolution(2).Waterfraction),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(3).Enthalpy),...
++	(md.results.TransientSolution(3).Waterfraction),...
++	(md.results.TransientSolution(3).Temperature),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test309.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test309.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test309.m	(revision 12803)
+@@ -0,0 +1,13 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,PrognosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.PrognosticSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test310.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test310.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test310.m	(revision 12803)
+@@ -1,18 +1,16 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
++md=meshconvert(md);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,5,2);
+-md=setflowequation(md,'hutter','all');
++md=setflowequation(md,'macayeal','all');
++md.prognostic.stabilization=3;
++md.prognostic.spcthickness=md.geometry.thickness;
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,PrognosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.PrognosticSolution.Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test314.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test314.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test314.m	(revision 12803)
+@@ -1,18 +1,33 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
++md=setflowequation(md,'hutter','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-10,2e-10,1e-10};
++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-10,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};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test318.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test318.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test318.m	(revision 12803)
+@@ -1,13 +1,22 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=setflowequation(md,'macayeal','all');
++md=extrude(md,4,1);
++md=setflowequation(md,'hutter','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,PrognosticSolutionEnum);
++md.timestepping.time_step=0;
++md=solve(md,SteadystateSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13
++};
+ field_values={...
+-	(md.results.PrognosticSolution.Thickness),...
++	(md.results.SteadystateSolution.Vx),...
++	(md.results.SteadystateSolution.Vy),...
++	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Pressure),...
++	(md.results.SteadystateSolution.Temperature),...
++	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test302.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test302.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test302.m	(revision 12803)
+@@ -1,7 +1,7 @@
+ md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+-md=setflowequation(md,'macayeal','all');
++md=setflowequation(md,'hutter','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test323.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test323.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test323.m	(revision 12803)
+@@ -0,0 +1,35 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.timestepping.time_adapt=1;
++md.timestepping.final_time=600;
++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).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test306.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test306.m	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test306.m	(revision 12803)
+@@ -1,16 +1,18 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,4,2);
+ md=setflowequation(md,'hutter','../Exp/SquareHalfRight.exp','fill','macayeal');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
+ 	(md.results.DiagnosticSolution.Vel),...
+ 	(md.results.DiagnosticSolution.Pressure),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test327.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test327.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test327.m	(revision 12803)
+@@ -0,0 +1,55 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
++md.initialization.temperature(:)=272;
++md.thermal.spctemperature(find(md.mesh.vertexonsurface))=272;
++md.thermal.isenthalpy=1;
++md.basalforcings.geothermalflux(:)=5;
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','Enthalpy1','Waterfraction1', ...
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2', ...
++					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3'};
++field_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++						1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++						1e-09,5e-10,1e-10,1e-10,1e-10,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).Vz),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).Enthalpy),...
++	(md.results.TransientSolution(1).Waterfraction),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).Enthalpy),...
++	(md.results.TransientSolution(2).Waterfraction),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).Enthalpy),...
++	(md.results.TransientSolution(3).Waterfraction),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12802)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12803)
+@@ -65,33 +65,35 @@
+ 		233 : 'SquareShelfTranP3dForcTemp',
+ 		234 : 'SquareShelfTranForceNeg2dDakotaSamp',
+    	235 : 'SquareShelfTranForceNeg2dDakotaLocal',
+-		302 : 'SquareSheetConstrainedDiagM2d',
+-		304 : 'SquareSheetConstrainedDiagH2d',
+-		306 : 'SquareSheetConstrainedDiagHM2d',
+-		308 : 'SquareSheetConstrainedDiagM3d',
+-		310 : 'SquareSheetConstrainedDiagH3d',
+-		312 : 'SquareSheetConstrainedDiagHM3d',
+-		314 : 'SquareSheetConstrainedDiagP3d',
+-		316 : 'SquareSheetConstrainedDiagS3d',
+-		318 : 'SquareSheetConstrainedProg2d',
+-		320 : 'SquareSheetConstrainedProg2dDG',
+-		322 : 'SquareSheetConstrainedProg3d',
+-		324 : 'SquareSheetConstrainedTherStea',
+-		326 : 'SquareSheetConstrainedTherTran',
+-		328 : 'SquareSheetConstrainedTranH2d',
+-		330 : 'SquareSheetConstrainedTranH3d',
+-		332 : 'SquareSheetConstrainedTranM2d',
+-		334 : 'SquareSheetConstrainedTranP3d',
+-		336 : 'SquareSheetConstrainedSteaH3d',
+-		338 : 'SquareSheetConstrainedCMDragM2d',
+-		340 : 'SquareSheetConstrainedCMDragM3d',
+-		342 : 'SquareSheetConstrainedCMDragP3d',
+-		344 : 'SquareSheetConstrainedCMDragS3d',
+-		346 : 'SquareSheetConstrainedTranCflM2d',
+-		348 : 'SquareSheetConstrainedTranCflH3d',
+-		350 : 'SquareSheetConstrainedEnthalpyStea',
+-		352 : 'SquareSheetConstrainedEnthalpyTran',
+-		354 : 'SquareSheetConstrainedTransP3dEnth',
++		301 : 'SquareSheetConstrainedDiagM2d',
++		302 : 'SquareSheetConstrainedDiagH2d',
++		303 : 'SquareSheetConstrainedDiagHM2d',
++		304 : 'SquareSheetConstrainedDiagM3d',
++		305 : 'SquareSheetConstrainedDiagH3d',
++		306 : 'SquareSheetConstrainedDiagHM3d',
++		307 : 'SquareSheetConstrainedDiagP3d',
++		308 : 'SquareSheetConstrainedDiagS3d',
++		309 : 'SquareSheetConstrainedProg2d',
++		310 : 'SquareSheetConstrainedProg2dDG',
++		311 : 'SquareSheetConstrainedProg3d',
++		312 : 'SquareSheetConstrainedTherStea',
++		313 : 'SquareSheetConstrainedTherTran',
++		314 : 'SquareSheetConstrainedTranH2d',
++		315 : 'SquareSheetConstrainedTranH3d',
++		316 : 'SquareSheetConstrainedTranM2d',
++		317 : 'SquareSheetConstrainedTranP3d',
++		318 : 'SquareSheetConstrainedSteaH3d',
++		319 : 'SquareSheetConstrainedCMDragM2d',
++		320 : 'SquareSheetConstrainedCMDragM3d',
++		321 : 'SquareSheetConstrainedCMDragP3d',
++		322 : 'SquareSheetConstrainedCMDragS3d',
++		323 : 'SquareSheetConstrainedTranCflM2d',
++		324 : 'SquareSheetConstrainedTranCflH3d',
++		325 : 'SquareSheetConstrainedEnthalpyStea',
++		326 : 'SquareSheetConstrainedEnthalpyTran',
++		327 : 'SquareSheetConstrainedTransP3dEnth',
++		328 : 'SquareSheetConstrainedSmbGradients2d';
++		329 : 'SquareSheetConstrainedSmbGradients3d';
+ 		402 : 'SquareSheetShelfDiagM2d',
+ 		404 : 'SquareSheetShelfDiagM3d',
+ 		406 : 'SquareSheetShelfDiagP3d',
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test311.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test311.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test311.m	(revision 12803)
+@@ -0,0 +1,14 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md=extrude(md,5,0.5);
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,PrognosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.PrognosticSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test315.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test315.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test315.m	(revision 12803)
+@@ -0,0 +1,47 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=extrude(md,5,1.2);
++md=setflowequation(md,'hutter','all');
++md.cluster=generic('name',oshostname(),'np',3);
++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_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,  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).Vz),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test319.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test319.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test319.m	(revision 12803)
+@@ -0,0 +1,33 @@
++md=triangle(model,'../Exp/Square.exp',200000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'macayeal','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++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);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=[103*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
++md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy'};
++field_tolerances={1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Gradient1),...
++	md.results.DiagnosticSolution.J,...
++	(md.results.DiagnosticSolution.FrictionCoefficient),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive350.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive354.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive358.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive333.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive337.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive342.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive346.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive351.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive330.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive334.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive338.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive343.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive347.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive352.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive356.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive331.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive335.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive339.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive340.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive344.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive348.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive353.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive332.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive336.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive341.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive345.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive349.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive311.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive313.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive315.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive317.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive319.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive320.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive322.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive324.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive326.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive328.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive301.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive303.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive305.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive307.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive309.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive310.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive312.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive314.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive316.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive318.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive321.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive323.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive325.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive327.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive329.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive302.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive304.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive306.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive308.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12803-12804.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12803-12804.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12803-12804.diff	(revision 13394)
@@ -0,0 +1,2476 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test460.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test460.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test460.m	(revision 12804)
+@@ -1,20 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'stokes','all');
+-md.diagnostic.isnewton=1;
+-md.diagnostic.restol=0.0001;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-07,1e-07,1e-06,1e-07,1e-07};
+-field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test464.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test464.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test464.m	(revision 12804)
+@@ -1,24 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,3,2);
+-md=setflowequation(md,'pattyn','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_step=0;
+-md.thermal.isenthalpy=1;
+-md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+-md=solve(md,SteadystateSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','Water fraction','Enthalpy'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-13,1e-10,1e-10,1e-10};
+-field_values={...
+-	(md.results.SteadystateSolution.Vx),...
+-	(md.results.SteadystateSolution.Vy),...
+-	(md.results.SteadystateSolution.Vz),...
+-	(md.results.SteadystateSolution.Vel),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.Waterfraction),...
+-	(md.results.SteadystateSolution.Enthalpy),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test452.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test452.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test452.m	(revision 12804)
+@@ -1,42 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',350000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md.initialization.vx(:)=0;
+-md.initialization.vy(:)=0;
+-md.initialization.vel(:)=0;
+-md.geometry.bed=-700-abs(md.mesh.y-500000)/1000;
+-md.geometry.bathymetry=-700-abs(md.mesh.y-500000)/1000;
+-md.geometry.thickness(:)=1000;
+-md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+-md.surfaceforcings.mass_balance(:)=100;
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-
+-md.transient.isdiagnostic=0;
+-md.transient.isgroundingline=1;
+-md.groundingline.migration='AgressiveMigration';
+-md.cluster=generic('name',oshostname(),'np',3);
+-
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Bed1','Surface1','Thickness1','Floatingice1',...
+-	'Bed2','Surface2','Thickness2','Floatingice2',...
+-	'Bed3','Surface3','Thickness3','Floatingice3'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,...
+-	1e-11,1e-11,1e-11,1e-13,...
+-	1e-10,1e-10,1e-10,1e-13};
+-field_values={...
+-	(md.results.TransientSolution(1).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).MaskElementonfloatingice),...
+-	(md.results.TransientSolution(2).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).MaskElementonfloatingice),...
+-	(md.results.TransientSolution(3).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).MaskElementonfloatingice),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test456.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test456.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test456.m	(revision 12804)
+@@ -1,18 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.diagnostic.isnewton=1;
+-md.diagnostic.restol=0.0001;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13};
+-field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test440.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test440.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test440.m	(revision 12804)
+@@ -1,49 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',200000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-
+-%partitioning
+-md.qmu.numberofpartitions=10;
+-md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions);
+-md.qmu.partition=md.qmu.partition-1;
+-md.qmu.isdakota=1;
+-
+-%Dakota options
+-%variables
+-md.qmu.variables.rho_ice=normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01);
+-
+-%responses
+-md.qmu.responses.MaxVel=response_function('scaled_Thickness',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-
+-%method
+-md.qmu.method     =dakota_method('nond_l');
+-
+-%parameters
+-md.qmu.params.direct=true;
+-md.qmu.params.analysis_driver='diagnostic';
+-md.qmu.params.evaluation_concurrency=1;
+-md.qmu.params.interval_type='forward';
+-
+-
+-%imperative! 
+-md.diagnostic.reltol=10^-5; %tighten for qmu analysese
+-
+-%solve
+-md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+-md=tres(md,'dakota');
+-
+-%test on thickness
+-h=zeros(md.qmu.numberofpartitions,1);
+-for i=1:md.qmu.numberofpartitions,
+-	h(i)=md.qmu.results.dresp_out(i).mean;
+-end
+-
+-%project onto grid
+-thickness=h(md.qmu.partition+1);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-10};
+-field_values={thickness};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test444.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test444.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test444.m	(revision 12804)
+@@ -1,19 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,5,1);
+-md=setflowequation(md,'stokes','../Exp/SquareHalfRight.exp','fill','macayeal');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.diagnostic.reltol=0.4;
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-06,1e-09,1e-09};
+-field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test448.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test448.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test448.m	(revision 12804)
+@@ -1,40 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.initialization.vx(:)=0;
+-md.initialization.vy(:)=0;
+-md.initialization.vel(:)=0;
+-md.geometry.bed=-700-abs(md.mesh.y-500000)/1000;
+-md.geometry.bathymetry=-700-abs(md.mesh.y-500000)/1000;
+-md.geometry.thickness(:)=1000;
+-md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+-md.surfaceforcings.mass_balance(:)=100;
+-md.transient.isdiagnostic=0;
+-md.transient.isgroundingline=1;
+-md.groundingline.migration='AgressiveMigration';
+-
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Bed1','Surface1','Thickness1','Floatingice1',...
+-	'Bed2','Surface2','Thickness2','Floatingice2',...
+-	'Bed3','Surface3','Thickness3','Floatingice3'};
+-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};
+-field_values={...
+-	(md.results.TransientSolution(1).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).MaskElementonfloatingice),...
+-	(md.results.TransientSolution(2).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).MaskElementonfloatingice),...
+-	(md.results.TransientSolution(3).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).MaskElementonfloatingice),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test436.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test436.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test436.m	(revision 12804)
+@@ -1,21 +0,0 @@
+-%test partitioning, and partition averaging
+-md=triangle(model,'../Exp/Square.exp',30000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-
+-%partitioning
+-md.qmu.numberofpartitions=100;
+-md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions);
+-md.qmu.partition=md.qmu.partition-1;
+-
+-vector=(1:1:md.mesh.numberofvertices)';
+-vector_on_partition=AreaAverageOntoPartition(md,vector);
+-vector_on_nodes=vector_on_partition(md.qmu.partition+1);
+-
+-field_names     ={'vector_on_nodes'};
+-field_tolerances={1e-11};
+-field_values={...
+-         vector_on_nodes,...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test462.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test462.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test462.m	(revision 12804)
+@@ -1,24 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,3,2);
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_step=0;
+-md.thermal.isenthalpy=1;
+-md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+-md=solve(md,SteadystateSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','Water fraction','Enthalpy'};
+-field_tolerances={1e-10,1e-10,1e-09,1e-10,1e-13,1e-10,1e-10,1e-10};
+-field_values={...
+-	(md.results.SteadystateSolution.Vx),...
+-	(md.results.SteadystateSolution.Vy),...
+-	(md.results.SteadystateSolution.Vz),...
+-	(md.results.SteadystateSolution.Vel),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.Waterfraction),...
+-	(md.results.SteadystateSolution.Enthalpy),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test450.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test450.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test450.m	(revision 12804)
+@@ -1,40 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.initialization.vx(:)=0;
+-md.initialization.vy(:)=0;
+-md.initialization.vel(:)=0;
+-md.geometry.bed=-700-abs(md.mesh.y-500000)/1000;
+-md.geometry.bathymetry=-700-abs(md.mesh.y-500000)/1000;
+-md.geometry.thickness(:)=1300;
+-md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+-md.surfaceforcings.mass_balance(:)=-150;
+-md.transient.isdiagnostic=0;
+-md.transient.isgroundingline=1;
+-md.groundingline.migration='SoftMigration';
+-
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Bed1','Surface1','Thickness1','Floatingice1',...
+-	'Bed2','Surface2','Thickness2','Floatingice2',...
+-	'Bed3','Surface3','Thickness3','Floatingice3'};
+-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};
+-field_values={...
+-	(md.results.TransientSolution(1).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).MaskElementonfloatingice),...
+-	(md.results.TransientSolution(2).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).MaskElementonfloatingice),...
+-	(md.results.TransientSolution(3).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).MaskElementonfloatingice),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test454.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test454.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test454.m	(revision 12804)
+@@ -1,41 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md.initialization.vx(:)=0;
+-md.initialization.vy(:)=0;
+-md.initialization.vel(:)=0;
+-md.geometry.bed=-700-abs(md.mesh.y-500000)/1000;
+-md.geometry.bathymetry=-700-abs(md.mesh.y-500000)/1000;
+-md.geometry.thickness(:)=1300;
+-md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+-md=setflowequation(md,'macayeal','all');
+-md=extrude(md,3,1);
+-
+-md.surfaceforcings.mass_balance(:)=-150;
+-md.transient.isdiagnostic=0;
+-md.transient.isgroundingline=1;
+-md.groundingline.migration='SoftMigration';
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Bed1','Surface1','Thickness1','Floatingice1',...
+-	'Bed2','Surface2','Thickness2','Floatingice2',...
+-	'Bed3','Surface3','Thickness3','Floatingice3'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,...
+-	1e-13,1e-13,1e-13,1e-13,...
+-	1e-10,1e-11,1e-10,1e-13};
+-field_values={...
+-	(md.results.TransientSolution(1).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).MaskElementonfloatingice),...
+-	(md.results.TransientSolution(2).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).MaskElementonfloatingice),...
+-	(md.results.TransientSolution(3).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).MaskElementonfloatingice),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test458.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test458.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test458.m	(revision 12804)
+@@ -1,20 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,5,1);
+-md=setflowequation(md,'pattyn','all');
+-md.diagnostic.isnewton=1;
+-md.diagnostic.restol=0.0001;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
+-field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test442.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test442.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test442.m	(revision 12804)
+@@ -1,18 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,5,1);
+-md=setflowequation(md,'stokes','../Exp/SquareHalfRight.exp','fill','pattyn');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-08,1e-09,1e-05,1e-09,1e-09};
+-field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test446.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test446.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test446.m	(revision 12804)
+@@ -1,37 +0,0 @@
+-radius=1e6;
+-shelfextent=2e5;
+-
+-md=roundmesh(model,radius,50000);
+-%fix center node to 0,0
+-rad=sqrt(md.mesh.x.^2+md.mesh.y.^2);
+-pos=find(rad==min(rad));
+-md.mesh.x(pos)=0; md.mesh.y(pos)=0; %the closest node to the center is changed to be exactly at the center
+-xelem=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+-yelem=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+-rad=sqrt(xelem.^2+yelem.^2);
+-flags=zeros(md.mesh.numberofelements,1);
+-pos=find(rad>=(radius-shelfextent));
+-flags(pos)=1;
+-md=setmask(md,flags,''); 
+-md=parameterize(md,'../Par/RoundSheetShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-
+-md.transient.isthermal=0;
+-md.transient.isprognostic=0;
+-md.transient.isdiagnostic=0;
+-md.transient.isgroundingline=1;
+-
+-%test different grounding line dynamics.
+-md.groundingline.migration='AgressiveMigration';
+-md=solve(md,TransientSolutionEnum);
+-element_on_iceshelf_agressive=(md.results.TransientSolution.MaskElementonfloatingice);
+-
+-md.groundingline.migration='SoftMigration';
+-md=solve(md,TransientSolutionEnum);
+-element_on_iceshelf_soft=(md.results.TransientSolution.MaskElementonfloatingice);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'ElementOnIceShelfAgressive','ElementOnIceShelfSoft'};
+-field_tolerances={1e-13,1e-13};
+-field_values={element_on_iceshelf_agressive,element_on_iceshelf_soft};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test434.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test434.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test434.m	(revision 12804)
+@@ -1,73 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.materials.rho_ice=10^7; %involved in the mass flux, make it easy
+-md.geometry.thickness(:)=1; %make it easy
+-
+-%constrain all velocities to 1 m/yr, in the y-direction
+-md.diagnostic.spcvx(:)=0;
+-md.diagnostic.spcvy(:)=1;
+-md.diagnostic.spcvz(:)=0;
+-
+-%Dakota options
+-md.qmu.variables.drag_coefficient=normal_uncertain('scaled_FrictionCoefficient',1,0.01);
+-
+-md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-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]);
+-
+-%mass flux profiles
+-md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp','../Exp/Square.exp'};
+-md.qmu.mass_flux_profile_directory=pwd;
+-
+-
+-%%  nond_sampling study
+-
+-md.qmu.method     =dakota_method('nond_samp');
+-md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
+-'seed',1234,...
+-'samples',20,...
+-'sample_type','lhs');
+-
+-%%  a variety of parameters
+-md.qmu.params.evaluation_concurrency=1;
+-md.qmu.params.analysis_driver='';
+-md.qmu.params.analysis_components='';
+-
+-%partitioning
+-md.qmu.numberofpartitions=20;
+-md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
+-md.qmu.partition=md.qmu.partition-1;
+-md.qmu.isdakota=1;
+-
+-md.diagnostic.reltol=10^-5; %tighten for qmu analyses
+-
+-md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+-
+-%Fields and tolerances to track changes
+-md=tres(md,'dakota');
+-
+-%ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
+-%we recover those mass fluxes through the mean of the response.
+-%also, we recover the max velo, which should be 1m/yr. 
+-%we put all that data in the montecarlo field, which we will use to test for success.
+-%also, check that the stddev are 0.
+-md.results.dakota.montecarlo=[];
+-for i=1:8,
+-	md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).mean];
+-end
+-for i=1:8,
+-	md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).stddev];
+-end
+-field_names     ={'montecarlo'};
+-field_tolerances={1e-11};
+-field_values={...
+-         md.results.dakota.montecarlo,...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test438.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test438.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test438.m	(revision 12804)
+@@ -1,18 +0,0 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
+-md=setmask(md,'../Exp/SquareShelf.exp','');
+-md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,5,1);
+-md=setflowequation(md,'macayeal','../Exp/SquareHalfRight.exp','fill','pattyn');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
+-field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test401.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test401.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test401.m	(revision 12804)
+@@ -0,0 +1,16 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test422.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test422.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test422.m	(revision 12804)
+@@ -1,22 +1,19 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,3,2);
+-md=setflowequation(md,'pattyn','all');
++md=extrude(md,5,1);
++md=setflowequation(md,'stokes','../Exp/SquareHalfRight.exp','fill','macayeal');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_step=0;
+-md=solve(md,SteadystateSolutionEnum);
++md.diagnostic.reltol=0.4;
++md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-09,1e-09,1e-08,1e-09,1e-09,1e-08,1e-05
+-};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-09,1e-09,1e-06,1e-09,1e-09};
+ field_values={...
+-	(md.results.SteadystateSolution.Vx),...
+-	(md.results.SteadystateSolution.Vy),...
+-	(md.results.SteadystateSolution.Vz),...
+-	(md.results.SteadystateSolution.Vel),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test405.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test405.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test405.m	(revision 12804)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,5,1);
++md=setflowequation(md,'macayeal','../Exp/SquareHalfRight.exp','fill','pattyn','coupling','penalties');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-05,1e-05,1e-05,1e-05,1e-05};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test426.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test426.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test426.m	(revision 12804)
+@@ -1,45 +1,42 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',350000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
++md.initialization.vx(:)=0;
++md.initialization.vy(:)=0;
++md.initialization.vel(:)=0;
++md.geometry.bed=-700-abs(md.mesh.y-500000)/1000;
++md.geometry.bathymetry=-700-abs(md.mesh.y-500000)/1000;
++md.geometry.thickness(:)=1000;
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++md.surfaceforcings.mass_balance(:)=100;
++md=extrude(md,3,1);
+ md=setflowequation(md,'macayeal','all');
++
++md.transient.isdiagnostic=0;
++md.transient.isgroundingline=1;
++md.groundingline.migration='AgressiveMigration';
+ md.cluster=generic('name',oshostname(),'np',3);
+ 
+-%Dakota options
++md=solve(md,TransientSolutionEnum);
+ 
+-%partitioning
+-md.qmu.numberofpartitions=20;
+-md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
+-md.qmu.partition=md.qmu.partition-1;
+-
+-%variables
+-md.qmu.variables.rho_ice=normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01);
+-md.qmu.variables.drag_coefficient=normal_uncertain('scaled_FrictionCoefficient',1,0.01);
+-
+-%responses
+-md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-
+-%method
+-md.qmu.method     =dakota_method('nond_l');
+-
+-%parameters
+-md.qmu.params.direct=true;
+-md.qmu.params.analysis_driver='diagnostic';
+-md.qmu.params.evaluation_concurrency=1;
+-md.qmu.params.interval_type='forward';
+-
+-
+-%imperative!
+-md.diagnostic.reltol=10^-5; %tighten for qmu analyses
+-md.qmu.isdakota=1;
+-
+-%solve
+-md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+-
+ %Fields and tolerances to track changes
+-md=tres(md,'dakota');
+-md.results.dakota.importancefactors=importancefactors(md,'scaled_FrictionCoefficient','MaxVel')';
+-field_names     ={'importancefactors'};
+-field_tolerances={1e-10};
++field_names     ={'Bed1','Surface1','Thickness1','Floatingice1',...
++	'Bed2','Surface2','Thickness2','Floatingice2',...
++	'Bed3','Surface3','Thickness3','Floatingice3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,...
++	1e-11,1e-11,1e-11,1e-13,...
++	1e-10,1e-10,1e-10,1e-13};
+ field_values={...
+-         md.results.dakota.importancefactors,...
++	(md.results.TransientSolution(1).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).MaskElementonfloatingice),...
++	(md.results.TransientSolution(2).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).MaskElementonfloatingice),...
++	(md.results.TransientSolution(3).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).MaskElementonfloatingice),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test409.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test409.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test409.m	(revision 12804)
+@@ -0,0 +1,48 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','../Exp/SquareHalfRight.exp','fill','pattyn','coupling','penalties');
++md.cluster=generic('name',oshostname(),'np',3);
++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_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,...
++	1e-02,1e-02,1e-01,1e-02,1e-01,1e-04,1e-04,1e-04,1e-04,1e-01};
++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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test410.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test410.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test410.m	(revision 12804)
+@@ -1,18 +1,21 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,5,1);
+-md=setflowequation(md,'macayeal','../Exp/SquareHalfRight.exp','fill','pattyn','coupling','penalties');
++md=extrude(md,3,2);
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md.timestepping.time_step=0;
++md=solve(md,SteadystateSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-05,1e-05,1e-05,1e-05,1e-05};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-10,1e-10,1e-09,1e-10,1e-13,1e-10,1e-06};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.SteadystateSolution.Vx),...
++	(md.results.SteadystateSolution.Vy),...
++	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Pressure),...
++	(md.results.SteadystateSolution.Temperature),...
++	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test431.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test431.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test431.m	(revision 12804)
+@@ -0,0 +1,24 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,3,2);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.timestepping.time_step=0;
++md.thermal.isenthalpy=1;
++md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
++md=solve(md,SteadystateSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','Water fraction','Enthalpy'};
++field_tolerances={1e-10,1e-10,1e-09,1e-10,1e-13,1e-10,1e-10,1e-10};
++field_values={...
++	(md.results.SteadystateSolution.Vx),...
++	(md.results.SteadystateSolution.Vy),...
++	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Pressure),...
++	(md.results.SteadystateSolution.Temperature),...
++	(md.results.SteadystateSolution.Waterfraction),...
++	(md.results.SteadystateSolution.Enthalpy),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test414.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test414.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test414.m	(revision 12804)
+@@ -1,19 +1,70 @@
+ md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,4,1);
+-md=setflowequation(md,'pattyn','all');
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.transient.isdiagnostic=0;
+-md.transient.isprognostic=0;
+-md.transient.isthermal=1;
+-md.transient.isgroundingline=0;
+-md=solve(md,TransientSolutionEnum);
++md.materials.rho_ice=10^7; %involved in the mass flux, make it easy
++md.geometry.thickness(:)=1; %make it easy
+ 
++%constrain all velocities to 1 m/yr, in the y-direction
++md.diagnostic.spcvx=zeros(md.mesh.numberofvertices,1);
++md.diagnostic.spcvy=ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvz=zeros(md.mesh.numberofvertices,1);
++
++%Dakota options
++
++%partitioning
++md.qmu.numberofpartitions=20;
++md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
++md.qmu.partition=md.qmu.partition-1;
++
++%variables
++md.qmu.variables.drag_coefficient=normal_uncertain('scaled_FrictionCoefficient',1,0.01);
++
++%responses
++md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++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]);
++
++%mass flux profiles
++md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp','../Exp/Square.exp'};
++md.qmu.mass_flux_profile_directory=pwd;
++
++%method
++md.qmu.method     =dakota_method('nond_l');
++
++%parameters
++md.qmu.params.direct=true;
++md.qmu.params.analysis_driver='diagnostic';
++md.qmu.params.evaluation_concurrency=1;
++md.qmu.params.interval_type='forward';
++md.qmu.isdakota=1;
++md.diagnostic.reltol=10^-5; %tighten for qmu analyses
++
++%solve
++md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
++md=tres(md,'dakota');
++
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-13,1e-13};
++%ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
++%we recover those mass fluxes through the mean of the response.
++%also, we recover the max velo, which should be 1m/yr. 
++%we put all that data in the importancefactors, which we will use to test for success.
++%also, check that the stddev are 0.
++md.results.dakota.importancefactors=[];
++for i=1:8,
++	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).mean];
++end
++for i=1:8,
++	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).stddev];
++end
++field_names     ={'importancefactors'};
++field_tolerances={1e-11};
+ field_values={...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++         md.results.dakota.importancefactors,...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test418.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test418.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test418.m	(revision 12804)
+@@ -1,48 +1,21 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++%test partitioning, and partition averaging
++md=triangle(model,'../Exp/Square.exp',30000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','../Exp/SquareHalfRight.exp','fill','pattyn','coupling','penalties');
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-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_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,...
+-	1e-02,1e-02,1e-01,1e-02,1e-01,1e-04,1e-04,1e-04,1e-04,1e-01};
++%partitioning
++md.qmu.numberofpartitions=100;
++md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions);
++md.qmu.partition=md.qmu.partition-1;
++
++vector=(1:1:md.mesh.numberofvertices)';
++vector_on_partition=AreaAverageOntoPartition(md,vector);
++vector_on_nodes=vector_on_partition(md.qmu.partition+1);
++
++field_names     ={'vector_on_nodes'};
++field_tolerances={1e-11};
+ 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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++         vector_on_nodes,...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test402.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test402.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test402.m	(revision 12804)
+@@ -1,16 +1,18 @@
+ md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,4,1);
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
+ 	(md.results.DiagnosticSolution.Vel),...
+ 	(md.results.DiagnosticSolution.Pressure),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test423.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test423.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test423.m	(revision 12804)
+@@ -0,0 +1,37 @@
++radius=1e6;
++shelfextent=2e5;
++
++md=roundmesh(model,radius,50000);
++%fix center node to 0,0
++rad=sqrt(md.mesh.x.^2+md.mesh.y.^2);
++pos=find(rad==min(rad));
++md.mesh.x(pos)=0; md.mesh.y(pos)=0; %the closest node to the center is changed to be exactly at the center
++xelem=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
++yelem=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
++rad=sqrt(xelem.^2+yelem.^2);
++flags=zeros(md.mesh.numberofelements,1);
++pos=find(rad>=(radius-shelfextent));
++flags(pos)=1;
++md=setmask(md,flags,''); 
++md=parameterize(md,'../Par/RoundSheetShelf.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++md.transient.isthermal=0;
++md.transient.isprognostic=0;
++md.transient.isdiagnostic=0;
++md.transient.isgroundingline=1;
++
++%test different grounding line dynamics.
++md.groundingline.migration='AgressiveMigration';
++md=solve(md,TransientSolutionEnum);
++element_on_iceshelf_agressive=(md.results.TransientSolution.MaskElementonfloatingice);
++
++md.groundingline.migration='SoftMigration';
++md=solve(md,TransientSolutionEnum);
++element_on_iceshelf_soft=(md.results.TransientSolution.MaskElementonfloatingice);
++
++%Fields and tolerances to track changes
++field_names     ={'ElementOnIceShelfAgressive','ElementOnIceShelfSoft'};
++field_tolerances={1e-13,1e-13};
++field_values={element_on_iceshelf_agressive,element_on_iceshelf_soft};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test406.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test406.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test406.m	(revision 12804)
+@@ -1,18 +1,16 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,5,1);
++md=extrude(md,4,1);
+ md=setflowequation(md,'pattyn','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md.timestepping.time_step=0;
++md=solve(md,ThermalSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
++field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-13,1e-13};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.ThermalSolution.Temperature),...
++	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test427.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test427.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test427.m	(revision 12804)
+@@ -0,0 +1,41 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md.initialization.vx(:)=0;
++md.initialization.vy(:)=0;
++md.initialization.vel(:)=0;
++md.geometry.bed=-700-abs(md.mesh.y-500000)/1000;
++md.geometry.bathymetry=-700-abs(md.mesh.y-500000)/1000;
++md.geometry.thickness(:)=1300;
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++md=setflowequation(md,'macayeal','all');
++md=extrude(md,3,1);
++
++md.surfaceforcings.mass_balance(:)=-150;
++md.transient.isdiagnostic=0;
++md.transient.isgroundingline=1;
++md.groundingline.migration='SoftMigration';
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Bed1','Surface1','Thickness1','Floatingice1',...
++	'Bed2','Surface2','Thickness2','Floatingice2',...
++	'Bed3','Surface3','Thickness3','Floatingice3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,...
++	1e-13,1e-13,1e-13,1e-13,...
++	1e-10,1e-11,1e-10,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).MaskElementonfloatingice),...
++	(md.results.TransientSolution(2).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).MaskElementonfloatingice),...
++	(md.results.TransientSolution(3).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).MaskElementonfloatingice),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test411.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test411.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test411.m	(revision 12804)
+@@ -0,0 +1,22 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,3,2);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.timestepping.time_step=0;
++md=solve(md,SteadystateSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-09,1e-09,1e-08,1e-09,1e-09,1e-08,1e-05
++};
++field_values={...
++	(md.results.SteadystateSolution.Vx),...
++	(md.results.SteadystateSolution.Vy),...
++	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Pressure),...
++	(md.results.SteadystateSolution.Temperature),...
++	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test432.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test432.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test432.m	(revision 12804)
+@@ -1,38 +1,24 @@
+-md=triangle(model,'../Exp/Square.exp',170000);
++md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,3,1);
++md=extrude(md,3,2);
+ md=setflowequation(md,'pattyn','all');
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-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);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=[102*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
+-md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.cluster=generic('name',oshostname(),'np',3);
+ md.timestepping.time_step=0;
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-
+-md.cluster=generic('name',oshostname(),'np',3);
++md.thermal.isenthalpy=1;
++md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+ md=solve(md,SteadystateSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'BasalforcingsMeltingRate'};
+-field_tolerances={1e-08,1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-07,1e-08,1e-05};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','Water fraction','Enthalpy'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-13,1e-10,1e-10,1e-10};
+ field_values={...
+-	(md.results.SteadystateSolution.Gradient1),...
+-	md.results.SteadystateSolution.J,...
+-	(md.results.SteadystateSolution.FrictionCoefficient),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Vel),...
+ 	(md.results.SteadystateSolution.Vx),...
+ 	(md.results.SteadystateSolution.Vy),...
+ 	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Pressure),...
+ 	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate)
+-};
++	(md.results.SteadystateSolution.Waterfraction),...
++	(md.results.SteadystateSolution.Enthalpy),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test415.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test415.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test415.m	(revision 12804)
+@@ -0,0 +1,38 @@
++md=triangle(model,'../Exp/Square.exp',170000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++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);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=[103*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
++md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.timestepping.time_step=0;
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,SteadystateSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'BasalforcingsMeltingRate'};
++field_tolerances={1e-10,1e-10,1e-11,1e-13,1e-10,1e-09,1e-10,1e-8,1e-09,1e-6};
++field_values={...
++	(md.results.SteadystateSolution.Gradient1),...
++	md.results.SteadystateSolution.J,...
++	(md.results.SteadystateSolution.FrictionCoefficient),...
++	(md.results.SteadystateSolution.Pressure),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Vx),...
++	(md.results.SteadystateSolution.Vy),...
++	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Temperature),...
++	(md.results.SteadystateSolution.BasalforcingsMeltingRate)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test419.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test419.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test419.m	(revision 12804)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,5,1);
++md=setflowequation(md,'macayeal','../Exp/SquareHalfRight.exp','fill','pattyn');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12804)
+@@ -92,39 +92,38 @@
+ 	case 327, name='SquareSheetConstrainedTransP3dEnth';
+ 	case 328, name='SquareSheetConstrainedSmbGradients2d';
+ 	case 329, name='SquareSheetConstrainedSmbGradients3d';
+-	case 402, name='SquareSheetShelfDiagM2d';
+-	case 404, name='SquareSheetShelfDiagM3d';
+-	case 406, name='SquareSheetShelfDiagP3d';
+-	case 408, name='SquareSheetShelfDiagS3d';
+-	case 410, name='SquareSheetShelfDiagMP3dPenalties';
+-	case 412, name='SquareSheetShelfTherStea';
+-	case 414, name='SquareSheetShelfTherTran';
+-	case 416, name='SquareSheetShelfTranM2d';
+-	case 418, name='SquareSheetShelfTranMP3dPenalties';
+-	case 420, name='SquareSheetShelfSteaM3d';
+-	case 422, name='SquareSheetShelfSteaP3d';
+-	case 424, name='SquareSheetShelfDiadM3dDakota';
+-	case 426, name='SquareSheetShelfDiadM3dDakotaPart';
+-	case 428, name='SquareSheetShelfDiadM3dDakotaMassFlux';
+-	case 430, name='SquareSheetShelfCMDragSteaM3d';
+-	case 432, name='SquareSheetShelfCMDragSteaP3d';
+-	case 434, name='SquareSheetShelfDiadM3dDakotaSamp';
+-	case 436, name='SquareSheetShelfDiadM3dDakotaAreaAverage';
+-	case 438, name='SquareSheetShelfDiagMP3dTiling';
+-	case 439, name='SquareSheetShelfDakotaScaledResponse';
+-	case 440, name='SquareSheetShelfDakotaScaledResponse';
+-	case 442, name='SquareSheetShelfDiagPS3dTiling';
+-	case 444, name='SquareSheetShelfDiagMS3dTiling';
+-	case 446, name='RoundSheetShelfGLMigrationM2d';
+-	case 448, name='SquareSheetShelfGroundingLine2dAgressice';
+-	case 450, name='SquareSheetShelfGroundingLine2dSoft';
+-	case 452, name='SquareSheetShelfGroundingLine3dAgressice';
+-	case 454, name='SquareSheetShelfGroundingLine3dSoft';
+-	case 456, name='SquareSheetShelfDiagM2dNewton';
+-	case 458, name='SquareSheetShelfDiagP3dNewton';
+-	case 460, name='SquareSheetShelfDiagS3dNewton';
+-	case 462, name='SquareSheetShelfSteaEnthalpyM3d';
+-	case 464, name='SquareSheetShelfSteaEnthalpyP3d';
++	case 401, name='SquareSheetShelfDiagM2d';
++	case 402, name='SquareSheetShelfDiagM3d';
++	case 403, name='SquareSheetShelfDiagP3d';
++	case 404, name='SquareSheetShelfDiagS3d';
++	case 405, name='SquareSheetShelfDiagMP3dPenalties';
++	case 406, name='SquareSheetShelfTherStea';
++	case 407, name='SquareSheetShelfTherTran';
++	case 408, name='SquareSheetShelfTranM2d';
++	case 409, name='SquareSheetShelfTranMP3dPenalties';
++	case 410, name='SquareSheetShelfSteaM3d';
++	case 411, name='SquareSheetShelfSteaP3d';
++	case 412, name='SquareSheetShelfDiadM3dDakota';
++	case 413, name='SquareSheetShelfDiadM3dDakotaPart';
++	case 414, name='SquareSheetShelfDiadM3dDakotaMassFlux';
++	case 415, name='SquareSheetShelfCMDragSteaM3d';
++	case 416, name='SquareSheetShelfCMDragSteaP3d';
++	case 417, name='SquareSheetShelfDiadM3dDakotaSamp';
++	case 418, name='SquareSheetShelfDiadM3dDakotaAreaAverage';
++	case 419, name='SquareSheetShelfDiagMP3dTiling';
++	case 420, name='SquareSheetShelfDakotaScaledResponse';
++	case 421, name='SquareSheetShelfDiagPS3dTiling';
++	case 422, name='SquareSheetShelfDiagMS3dTiling';
++	case 423, name='RoundSheetShelfGLMigrationM2d';
++	case 424, name='SquareSheetShelfGroundingLine2dAgressice';
++	case 425, name='SquareSheetShelfGroundingLine2dSoft';
++	case 426, name='SquareSheetShelfGroundingLine3dAgressice';
++	case 427, name='SquareSheetShelfGroundingLine3dSoft';
++	case 428, name='SquareSheetShelfDiagM2dNewton';
++	case 429, name='SquareSheetShelfDiagP3dNewton';
++	case 430, name='SquareSheetShelfDiagS3dNewton';
++	case 431, name='SquareSheetShelfSteaEnthalpyM3d';
++	case 432, name='SquareSheetShelfSteaEnthalpyP3d';
+ 	case 502, name='PigDiagM2d';
+ 	case 504, name='PigDiagP3d';
+ 	case 506, name='PigDiagS3d';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test420.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test420.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test420.m	(revision 12804)
+@@ -1,21 +1,49 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',200000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,3,2);
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_step=0;
+-md=solve(md,SteadystateSolutionEnum);
+ 
++%partitioning
++md.qmu.numberofpartitions=10;
++md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions);
++md.qmu.partition=md.qmu.partition-1;
++md.qmu.isdakota=1;
++
++%Dakota options
++%variables
++md.qmu.variables.rho_ice=normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01);
++
++%responses
++md.qmu.responses.MaxVel=response_function('scaled_Thickness',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++
++%method
++md.qmu.method     =dakota_method('nond_l');
++
++%parameters
++md.qmu.params.direct=true;
++md.qmu.params.analysis_driver='diagnostic';
++md.qmu.params.evaluation_concurrency=1;
++md.qmu.params.interval_type='forward';
++
++
++%imperative! 
++md.diagnostic.reltol=10^-5; %tighten for qmu analysese
++
++%solve
++md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
++md=tres(md,'dakota');
++
++%test on thickness
++h=zeros(md.qmu.numberofpartitions,1);
++for i=1:md.qmu.numberofpartitions,
++	h(i)=md.qmu.results.dresp_out(i).mean;
++end
++
++%project onto grid
++thickness=h(md.qmu.partition+1);
++
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-10,1e-10,1e-09,1e-10,1e-13,1e-10,1e-06};
+-field_values={...
+-	(md.results.SteadystateSolution.Vx),...
+-	(md.results.SteadystateSolution.Vy),...
+-	(md.results.SteadystateSolution.Vz),...
+-	(md.results.SteadystateSolution.Vel),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
+-	};
++field_names     ={'Thickness'};
++field_tolerances={1e-10};
++field_values={thickness};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test403.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test403.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test403.m	(revision 12804)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,5,1);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test424.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test424.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test424.m	(revision 12804)
+@@ -1,44 +1,40 @@
+-md=triangle(model,'../Exp/Square.exp',300000);
++md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+ md=setflowequation(md,'macayeal','all');
++md.initialization.vx(:)=0;
++md.initialization.vy(:)=0;
++md.initialization.vel(:)=0;
++md.geometry.bed=-700-abs(md.mesh.y-500000)/1000;
++md.geometry.bathymetry=-700-abs(md.mesh.y-500000)/1000;
++md.geometry.thickness(:)=1000;
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++md.surfaceforcings.mass_balance(:)=100;
++md.transient.isdiagnostic=0;
++md.transient.isgroundingline=1;
++md.groundingline.migration='AgressiveMigration';
++
+ md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,TransientSolutionEnum);
+ 
+-%partitioning
+-md.qmu.numberofpartitions=md.mesh.numberofvertices;
+-md=partitioner(md,'package','linear','npart',md.qmu.numberofpartitions);
+-md.qmu.partition=md.qmu.partition-1;
+-md.qmu.isdakota=1;
+-
+-
+-%Dakota options
+-%variables
+-md.qmu.variables.rho_ice=normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01);
+-md.qmu.variables.drag_coefficient=normal_uncertain('scaled_FrictionCoefficient',1,0.01);
+-
+-%responses
+-md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-
+-%method
+-md.qmu.method     =dakota_method('nond_l');
+-
+-%parameters
+-md.qmu.params.direct=true;
+-md.qmu.params.analysis_driver='diagnostic';
+-md.qmu.params.evaluation_concurrency=1;
+-md.qmu.params.interval_type='forward';
+-
+-%imperative! 
+-md.diagnostic.reltol=10^-5; %tighten for qmu analysese
+-
+-%solve
+-md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+-
+ %Fields and tolerances to track changes
+-md=tres(md,'dakota');
+-md.results.dakota.importancefactors=importancefactors(md,'scaled_FrictionCoefficient','MaxVel')';
+-field_names     ={'importancefactors'};
+-field_tolerances={1e-10};
++field_names     ={'Bed1','Surface1','Thickness1','Floatingice1',...
++	'Bed2','Surface2','Thickness2','Floatingice2',...
++	'Bed3','Surface3','Thickness3','Floatingice3'};
++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};
+ field_values={...
+-         md.results.dakota.importancefactors,...
++	(md.results.TransientSolution(1).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).MaskElementonfloatingice),...
++	(md.results.TransientSolution(2).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).MaskElementonfloatingice),...
++	(md.results.TransientSolution(3).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).MaskElementonfloatingice),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test407.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test407.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test407.m	(revision 12804)
+@@ -0,0 +1,19 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,4,1);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.isdiagnostic=0;
++md.transient.isprognostic=0;
++md.transient.isthermal=1;
++md.transient.isgroundingline=0;
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test428.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test428.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test428.m	(revision 12804)
+@@ -2,69 +2,17 @@
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+ md=setflowequation(md,'macayeal','all');
++md.diagnostic.isnewton=1;
++md.diagnostic.restol=0.0001;
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.materials.rho_ice=10^7; %involved in the mass flux, make it easy
+-md.geometry.thickness(:)=1; %make it easy
++md=solve(md,DiagnosticSolutionEnum);
+ 
+-%constrain all velocities to 1 m/yr, in the y-direction
+-md.diagnostic.spcvx=zeros(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvy=ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvz=zeros(md.mesh.numberofvertices,1);
+-
+-%Dakota options
+-
+-%partitioning
+-md.qmu.numberofpartitions=20;
+-md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
+-md.qmu.partition=md.qmu.partition-1;
+-
+-%variables
+-md.qmu.variables.drag_coefficient=normal_uncertain('scaled_FrictionCoefficient',1,0.01);
+-
+-%responses
+-md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-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]);
+-
+-%mass flux profiles
+-md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp','../Exp/Square.exp'};
+-md.qmu.mass_flux_profile_directory=pwd;
+-
+-%method
+-md.qmu.method     =dakota_method('nond_l');
+-
+-%parameters
+-md.qmu.params.direct=true;
+-md.qmu.params.analysis_driver='diagnostic';
+-md.qmu.params.evaluation_concurrency=1;
+-md.qmu.params.interval_type='forward';
+-md.qmu.isdakota=1;
+-md.diagnostic.reltol=10^-5; %tighten for qmu analyses
+-
+-%solve
+-md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+-md=tres(md,'dakota');
+-
+ %Fields and tolerances to track changes
+-%ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
+-%we recover those mass fluxes through the mean of the response.
+-%also, we recover the max velo, which should be 1m/yr. 
+-%we put all that data in the importancefactors, which we will use to test for success.
+-%also, check that the stddev are 0.
+-md.results.dakota.importancefactors=[];
+-for i=1:8,
+-	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).mean];
+-end
+-for i=1:8,
+-	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).stddev];
+-end
+-field_names     ={'importancefactors'};
+-field_tolerances={1e-11};
++field_names     ={'Vx','Vy','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
+ field_values={...
+-         md.results.dakota.importancefactors,...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test412.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test412.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test412.m	(revision 12804)
+@@ -1,16 +1,44 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',300000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,4,1);
+-md=setflowequation(md,'pattyn','all');
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_step=0;
+-md=solve(md,ThermalSolutionEnum);
+ 
++%partitioning
++md.qmu.numberofpartitions=md.mesh.numberofvertices;
++md=partitioner(md,'package','linear','npart',md.qmu.numberofpartitions);
++md.qmu.partition=md.qmu.partition-1;
++md.qmu.isdakota=1;
++
++
++%Dakota options
++%variables
++md.qmu.variables.rho_ice=normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01);
++md.qmu.variables.drag_coefficient=normal_uncertain('scaled_FrictionCoefficient',1,0.01);
++
++%responses
++md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++
++%method
++md.qmu.method     =dakota_method('nond_l');
++
++%parameters
++md.qmu.params.direct=true;
++md.qmu.params.analysis_driver='diagnostic';
++md.qmu.params.evaluation_concurrency=1;
++md.qmu.params.interval_type='forward';
++
++%imperative! 
++md.diagnostic.reltol=10^-5; %tighten for qmu analysese
++
++%solve
++md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
++
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-13,1e-13};
++md=tres(md,'dakota');
++md.results.dakota.importancefactors=importancefactors(md,'scaled_FrictionCoefficient','MaxVel')';
++field_names     ={'importancefactors'};
++field_tolerances={1e-10};
+ field_values={...
+-	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++         md.results.dakota.importancefactors,...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test416.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test416.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test416.m	(revision 12804)
+@@ -1,33 +1,38 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',170000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=setflowequation(md,'macayeal','all');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++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);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=[102*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
++md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.timestepping.time_step=0;
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
++md=solve(md,SteadystateSolutionEnum);
+ 
+ %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_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'BasalforcingsMeltingRate'};
++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.TransientSolution(1).Vx),...
+-	(md.results.TransientSolution(1).Vy),...
+-	(md.results.TransientSolution(1).Vel),...
+-	(md.results.TransientSolution(1).Pressure),...
+-	(md.results.TransientSolution(1).Bed),...
+-	(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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(3).Surface),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	};
++	(md.results.SteadystateSolution.Gradient1),...
++	md.results.SteadystateSolution.J,...
++	(md.results.SteadystateSolution.FrictionCoefficient),...
++	(md.results.SteadystateSolution.Pressure),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Vx),...
++	(md.results.SteadystateSolution.Vy),...
++	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Temperature),...
++	(md.results.SteadystateSolution.BasalforcingsMeltingRate)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test421.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test421.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test421.m	(revision 12804)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,5,1);
++md=setflowequation(md,'stokes','../Exp/SquareHalfRight.exp','fill','pattyn');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-08,1e-09,1e-05,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test404.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test404.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test404.m	(revision 12804)
+@@ -1,14 +1,14 @@
+-md=triangle(model,'../Exp/Square.exp',150000);
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,4,1);
+-md=setflowequation(md,'macayeal','all');
++md=extrude(md,3,1);
++md=setflowequation(md,'stokes','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
++field_tolerances={1e-07,1e-07,1e-06,1e-07,1e-07};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test425.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test425.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test425.m	(revision 12804)
+@@ -0,0 +1,40 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=setflowequation(md,'macayeal','all');
++md.initialization.vx(:)=0;
++md.initialization.vy(:)=0;
++md.initialization.vel(:)=0;
++md.geometry.bed=-700-abs(md.mesh.y-500000)/1000;
++md.geometry.bathymetry=-700-abs(md.mesh.y-500000)/1000;
++md.geometry.thickness(:)=1300;
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++md.surfaceforcings.mass_balance(:)=-150;
++md.transient.isdiagnostic=0;
++md.transient.isgroundingline=1;
++md.groundingline.migration='SoftMigration';
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Bed1','Surface1','Thickness1','Floatingice1',...
++	'Bed2','Surface2','Thickness2','Floatingice2',...
++	'Bed3','Surface3','Thickness3','Floatingice3'};
++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};
++field_values={...
++	(md.results.TransientSolution(1).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).MaskElementonfloatingice),...
++	(md.results.TransientSolution(2).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).MaskElementonfloatingice),...
++	(md.results.TransientSolution(3).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).MaskElementonfloatingice),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test408.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test408.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test408.m	(revision 12804)
+@@ -1,18 +1,33 @@
+-md=triangle(model,'../Exp/Square.exp',180000);
++md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'stokes','all');
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-07,1e-07,1e-06,1e-07,1e-07};
++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.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(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).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test429.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test429.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test429.m	(revision 12804)
+@@ -0,0 +1,20 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=extrude(md,5,1);
++md=setflowequation(md,'pattyn','all');
++md.diagnostic.isnewton=1;
++md.diagnostic.restol=0.0001;
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12804)
+@@ -94,39 +94,38 @@
+ 		327 : 'SquareSheetConstrainedTransP3dEnth',
+ 		328 : 'SquareSheetConstrainedSmbGradients2d';
+ 		329 : 'SquareSheetConstrainedSmbGradients3d';
+-		402 : 'SquareSheetShelfDiagM2d',
+-		404 : 'SquareSheetShelfDiagM3d',
+-		406 : 'SquareSheetShelfDiagP3d',
+-		408 : 'SquareSheetShelfDiagS3d',
+-		410 : 'SquareSheetShelfDiagMP3dPenalties',
+-		412 : 'SquareSheetShelfTherStea',
+-		414 : 'SquareSheetShelfTherTran',
+-		416 : 'SquareSheetShelfTranM2d',
+-		418 : 'SquareSheetShelfTranMP3dPenalties',
+-		420 : 'SquareSheetShelfSteaM3d',
+-		422 : 'SquareSheetShelfSteaP3d',
+-		424 : 'SquareSheetShelfDiadM3dDakota',
+-		426 : 'SquareSheetShelfDiadM3dDakotaPart',
+-		428 : 'SquareSheetShelfDiadM3dDakotaMassFlux',
+-		430 : 'SquareSheetShelfCMDragSteaM3d',
+-		432 : 'SquareSheetShelfCMDragSteaP3d',
+-		434 : 'SquareSheetShelfDiadM3dDakotaSamp',
+-		435 : 'SquareSheetShelfDiadM3dDakotaAreaAverage',
+-		438 : 'SquareSheetShelfDiagMP3dTiling',
+-		439 : 'SquareSheetShelfDakotaScaledResponse',
+-		440 : 'SquareSheetShelfDakotaScaledResponse',
+-		442 : 'SquareSheetShelfDiagPS3dTiling',
+-		444 : 'SquareSheetShelfDiagMS3dTiling',
+-		446 : 'RoundSheetShelfGLMigrationM2d',
+-		448 : 'SquareSheetShelfGroundingLine2dAgressice',
+-		450 : 'SquareSheetShelfGroundingLine2dSoft',
+-		452 : 'SquareSheetShelfGroundingLine3dAgressice',
+-		454 : 'SquareSheetShelfGroundingLine3dSoft',
+-		456 : 'SquareSheetShelfDiagM2dNewton',
+-		458 : 'SquareSheetShelfDiagP3dNewton',
+-		460 : 'SquareSheetShelfDiagS3dNewton',
+-		462 : 'SquareSheetShelfSteaEnthalpyM3d',
+-		464 : 'SquareSheetShelfSteaEnthalpyP3d',
++		401 : 'SquareSheetShelfDiagM2d',
++		402 : 'SquareSheetShelfDiagM3d',
++		403 : 'SquareSheetShelfDiagP3d',
++		404 : 'SquareSheetShelfDiagS3d',
++		405 : 'SquareSheetShelfDiagMP3dPenalties',
++		406 : 'SquareSheetShelfTherStea',
++		407 : 'SquareSheetShelfTherTran',
++		408 : 'SquareSheetShelfTranM2d',
++		409 : 'SquareSheetShelfTranMP3dPenalties',
++		410 : 'SquareSheetShelfSteaM3d',
++		411 : 'SquareSheetShelfSteaP3d',
++		412 : 'SquareSheetShelfDiadM3dDakota',
++		413 : 'SquareSheetShelfDiadM3dDakotaPart',
++		414 : 'SquareSheetShelfDiadM3dDakotaMassFlux',
++		415 : 'SquareSheetShelfCMDragSteaM3d',
++		416 : 'SquareSheetShelfCMDragSteaP3d',
++		417 : 'SquareSheetShelfDiadM3dDakotaSamp',
++		418 : 'SquareSheetShelfDiadM3dDakotaAreaAverage',
++		419 : 'SquareSheetShelfDiagMP3dTiling',
++		420 : 'SquareSheetShelfDakotaScaledResponse',
++		421 : 'SquareSheetShelfDiagPS3dTiling',
++		422 : 'SquareSheetShelfDiagMS3dTiling',
++		423 : 'RoundSheetShelfGLMigrationM2d',
++		424 : 'SquareSheetShelfGroundingLine2dAgressice',
++		425 : 'SquareSheetShelfGroundingLine2dSoft',
++		426 : 'SquareSheetShelfGroundingLine3dAgressice',
++		427 : 'SquareSheetShelfGroundingLine3dSoft',
++		428 : 'SquareSheetShelfDiagM2dNewton',
++		439 : 'SquareSheetShelfDiagP3dNewton',
++		430 : 'SquareSheetShelfDiagS3dNewton',
++		431 : 'SquareSheetShelfSteaEnthalpyM3d',
++		432 : 'SquareSheetShelfSteaEnthalpyP3d',
+ 		502 : 'PigDiagM2d',
+ 		504 : 'PigDiagP3d',
+ 		506 : 'PigDiagS3d',
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test430.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test430.m	(revision 12803)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test430.m	(revision 12804)
+@@ -1,38 +1,20 @@
+-md=triangle(model,'../Exp/Square.exp',170000);
++md=triangle(model,'../Exp/Square.exp',180000);
+ md=setmask(md,'../Exp/SquareShelf.exp','');
+ md=parameterize(md,'../Par/SquareSheetShelf.par');
+ md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-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);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=[103*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
+-md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+-md.timestepping.time_step=0;
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-
++md=setflowequation(md,'stokes','all');
++md.diagnostic.isnewton=1;
++md.diagnostic.restol=0.0001;
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,SteadystateSolutionEnum);
++md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'BasalforcingsMeltingRate'};
+-field_tolerances={1e-10,1e-10,1e-11,1e-13,1e-10,1e-09,1e-10,1e-8,1e-09,1e-6};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-07,1e-07,1e-06,1e-07,1e-07};
+ field_values={...
+-	(md.results.SteadystateSolution.Gradient1),...
+-	md.results.SteadystateSolution.J,...
+-	(md.results.SteadystateSolution.FrictionCoefficient),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Vel),...
+-	(md.results.SteadystateSolution.Vx),...
+-	(md.results.SteadystateSolution.Vy),...
+-	(md.results.SteadystateSolution.Vz),...
+-	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate)
+-};
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test413.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test413.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test413.m	(revision 12804)
+@@ -0,0 +1,45 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++%Dakota options
++
++%partitioning
++md.qmu.numberofpartitions=20;
++md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
++md.qmu.partition=md.qmu.partition-1;
++
++%variables
++md.qmu.variables.rho_ice=normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01);
++md.qmu.variables.drag_coefficient=normal_uncertain('scaled_FrictionCoefficient',1,0.01);
++
++%responses
++md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++
++%method
++md.qmu.method     =dakota_method('nond_l');
++
++%parameters
++md.qmu.params.direct=true;
++md.qmu.params.analysis_driver='diagnostic';
++md.qmu.params.evaluation_concurrency=1;
++md.qmu.params.interval_type='forward';
++
++
++%imperative!
++md.diagnostic.reltol=10^-5; %tighten for qmu analyses
++md.qmu.isdakota=1;
++
++%solve
++md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
++
++%Fields and tolerances to track changes
++md=tres(md,'dakota');
++md.results.dakota.importancefactors=importancefactors(md,'scaled_FrictionCoefficient','MaxVel')';
++field_names     ={'importancefactors'};
++field_tolerances={1e-10};
++field_values={...
++         md.results.dakota.importancefactors,...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test417.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test417.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test417.m	(revision 12804)
+@@ -0,0 +1,73 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.materials.rho_ice=10^7; %involved in the mass flux, make it easy
++md.geometry.thickness(:)=1; %make it easy
++
++%constrain all velocities to 1 m/yr, in the y-direction
++md.diagnostic.spcvx(:)=0;
++md.diagnostic.spcvy(:)=1;
++md.diagnostic.spcvz(:)=0;
++
++%Dakota options
++md.qmu.variables.drag_coefficient=normal_uncertain('scaled_FrictionCoefficient',1,0.01);
++
++md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++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]);
++
++%mass flux profiles
++md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp','../Exp/Square.exp'};
++md.qmu.mass_flux_profile_directory=pwd;
++
++
++%%  nond_sampling study
++
++md.qmu.method     =dakota_method('nond_samp');
++md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
++'seed',1234,...
++'samples',20,...
++'sample_type','lhs');
++
++%%  a variety of parameters
++md.qmu.params.evaluation_concurrency=1;
++md.qmu.params.analysis_driver='';
++md.qmu.params.analysis_components='';
++
++%partitioning
++md.qmu.numberofpartitions=20;
++md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
++md.qmu.partition=md.qmu.partition-1;
++md.qmu.isdakota=1;
++
++md.diagnostic.reltol=10^-5; %tighten for qmu analyses
++
++md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
++
++%Fields and tolerances to track changes
++md=tres(md,'dakota');
++
++%ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
++%we recover those mass fluxes through the mean of the response.
++%also, we recover the max velo, which should be 1m/yr. 
++%we put all that data in the montecarlo field, which we will use to test for success.
++%also, check that the stddev are 0.
++md.results.dakota.montecarlo=[];
++for i=1:8,
++	md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).mean];
++end
++for i=1:8,
++	md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).stddev];
++end
++field_names     ={'montecarlo'};
++field_tolerances={1e-11};
++field_values={...
++         md.results.dakota.montecarlo,...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive435.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive437.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive439.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive440.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive442.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive444.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive446.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive448.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive451.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive453.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive455.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive457.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive459.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive460.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive462.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive464.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive434.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive436.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive438.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive441.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive443.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive445.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive447.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive449.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive450.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive452.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive454.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive456.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive458.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive461.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive463.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive431.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive401.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive403.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive405.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive407.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive409.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive410.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive412.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive414.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive416.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive418.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive421.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive423.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive425.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive427.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive429.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive430.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive432.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive402.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive404.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive406.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive408.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive411.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive413.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive415.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive417.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive419.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive420.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive422.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive424.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive426.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive428.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12804-12805.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12804-12805.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12804-12805.diff	(revision 13394)
@@ -0,0 +1,1179 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test520.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test520.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test520.m	(revision 12805)
+@@ -1,22 +0,0 @@
+-md=triangle(model,'../Exp/Pig.exp',20000);
+-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+-md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,2,1);
+-md=setflowequation(md,'stokes','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_step=0;
+-md=solve(md,SteadystateSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06
+-};
+-field_values={...
+-	(md.results.SteadystateSolution.Vx),...
+-	(md.results.SteadystateSolution.Vy),...
+-	(md.results.SteadystateSolution.Vz),...
+-	(md.results.SteadystateSolution.Vel),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test524.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test524.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test524.m	(revision 12805)
+@@ -1,34 +0,0 @@
+-md=triangle(model,'../Exp/Pig.exp',20000);
+-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+-md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-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);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=[103*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
+-md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy'};
+-field_tolerances={1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11};
+-field_values={...
+-	(md.results.DiagnosticSolution.Gradient1),...
+-	md.results.DiagnosticSolution.J,...
+-	(md.results.DiagnosticSolution.FrictionCoefficient),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy)
+-};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test530.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test530.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test530.m	(revision 12805)
+@@ -1,23 +0,0 @@
+-md=triangle(model,'../Exp/Pig.exp',30000);
+-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+-md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.thermal.stabilization=2;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.transient.isdiagnostic=0;
+-md.transient.isprognostic=0;
+-md.transient.isthermal=1;
+-md.transient.isgroundingline=0;
+-md=solve(md,TransientSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Temperature1','BasalforcingsMeltingRate1', ...
+-				      'Temperature2','BasalforcingsMeltingRate2'};
+-field_tolerances={1e-13,1e-8,1e-13,1e-8};
+-field_values={...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test522.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test522.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test522.m	(revision 12805)
+@@ -1,39 +0,0 @@
+-md=triangle(model,'../Exp/Pig.exp',10000);
+-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+-md=parameterize(md,'../Par/Pig.par');
+-
+-%impose hydrostatic equilibrium (required by Stokes)
+-md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
+-md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+-md=extrude(md,3,1);
+-md=setflowequation(md,'stokes','all');
+-md=modelextract(md,md.mask.elementonfloatingice);
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-md.inversion.control_parameters={'MaterialsRheologyBbar'};
+-md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
+-md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=101*ones(md.inversion.nsteps,1);
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-md.inversion.gradient_scaling=10^8*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'MaterialsRheologyB' 'Pressure' 'Vel' 'Vx' 'Vy'};
+-field_tolerances={1e-11,1e-12,1e-12,1e-09,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
+-field_values={...
+-	(md.results.DiagnosticSolution.Gradient1),...
+-	md.results.DiagnosticSolution.J,...
+-	(md.results.DiagnosticSolution.MaterialsRheologyB),...
+-	(md.results.DiagnosticSolution.Pressure),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy)
+-};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test526.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test526.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test526.m	(revision 12805)
+@@ -1,39 +0,0 @@
+-md=triangle(model,'../Exp/Pig.exp',30000);
+-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+-md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-
+-%control parameters
+-md.inversion.iscontrol=1;
+-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);
+-md.inversion.nsteps=2;
+-md.inversion.cost_functions=[103*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
+-md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
+-md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+-md.timestepping.time_step=0;
+-
+-md.thermal.penalty_lock=5;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,SteadystateSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'BasalforcingsMeltingRate'};
+-field_tolerances={1e-10,1e-10,1e-10,1e-10,1e-6,1e-6,1e-6,1e-6,1e-6,1e-06};
+-field_values={...
+-	(md.results.SteadystateSolution.Gradient1),...
+-	md.results.SteadystateSolution.J,...
+-	(md.results.SteadystateSolution.FrictionCoefficient),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Vel),...
+-	(md.results.SteadystateSolution.Vx),...
+-	(md.results.SteadystateSolution.Vy),...
+-	(md.results.SteadystateSolution.Vz),...
+-	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate)
+-};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test518.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test518.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test518.m	(revision 12805)
+@@ -1,22 +0,0 @@
+-md=triangle(model,'../Exp/Pig.exp',30000);
+-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+-md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_step=0;
+-md=solve(md,SteadystateSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06
+-};
+-field_values={...
+-	(md.results.SteadystateSolution.Vx),...
+-	(md.results.SteadystateSolution.Vy),...
+-	(md.results.SteadystateSolution.Vz),...
+-	(md.results.SteadystateSolution.Vel),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test527.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test527.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test527.m	(revision 12805)
+@@ -1,56 +0,0 @@
+-%Simple mesh 1
+-hVertices=10000*ones(27,1);
+-hVertices(1:5)=1000;
+-md=bamg(model,'domain','../Exp/Pig.exp','hmax',20000,'hVertices',hVertices,'gradation',3,'geometricalmetric',1);
+-x1=md.mesh.x;
+-y1=md.mesh.y;
+-
+-%Simple mesh 2
+-md=bamg(model,'domain','../Exp/Pig.exp','hmax',10000);
+-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+-md=parameterize(md,'../Par/Pig.par');
+-x2=md.mesh.x;
+-y2=md.mesh.y;
+-
+-%refine existing mesh 1
+-hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vy_obs,'node');
+-metric=ComputeMetric(hessian,2/9,1,1000,25*10^3,[]);
+-md.miscellaneous.dummy=metric;
+-md2=bamg(md,'metric',md.miscellaneous.dummy,'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1);
+-x3=md2.mesh.x;
+-y3=md2.mesh.y;
+-
+-%refine existing mesh 2
+-md2=bamg(md,'metric',md.miscellaneous.dummy,'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1,'anisomax',1);
+-x4=md2.mesh.x;
+-y4=md2.mesh.y;
+-
+-%refine existing mesh 3
+-hVertices=NaN*ones(md.mesh.numberofvertices,1);
+-hVertices(find(md.mesh.vertexonboundary))=500;
+-md2=bamg(md,'metric',md.miscellaneous.dummy,'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1,'anisomax',1,'hVertices',hVertices);
+-x5=md2.mesh.x;
+-y5=md2.mesh.y;
+-
+-%refine existing mesh 4
+-md2=bamg(md,'field',md.inversion.vy_obs,'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1,'Hessiantype',0,'err',1);
+-x6=md2.mesh.x;
+-y6=md2.mesh.y;
+-
+-%refine existing mesh 5
+-md2=bamg(md,'field',[md.inversion.vy_obs md.geometry.thickness],'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1,'Hessiantype',1,'err',[10 100]); 
+-x7=md2.mesh.x;
+-y7=md2.mesh.y;
+-
+-%Fields and tolerances to track changes
+-field_names     ={'x1' 'y1' 'x2' 'y2' 'x3' 'y3' 'x4' 'y4' 'x5' 'y5' 'x6' 'y6'  'x7' 'y7' };
+-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};
+-field_values={...
+-	x1, y1,...
+-	y2, y2,...
+-	y3, y3,...
+-	y4, y4,...
+-	y5, y5,...
+-	y6, y6,...
+-	y7, y7,...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test532.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test532.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test532.m	(revision 12805)
+@@ -1,18 +0,0 @@
+-md=triangle(model,'../Exp/Pig.exp',30000);
+-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+-md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'pattyn','all');
+-md.thermal.stabilization=2;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.timestepping.time_step=0;
+-md.thermal.penalty_threshold=40;
+-md=solve(md,ThermalSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-11,1e-11};
+-field_values={...
+-	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test503.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test503.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test503.m	(revision 12805)
+@@ -0,0 +1,18 @@
++md=triangle(model,'../Exp/Pig.exp',20000);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=extrude(md,3,0.9);
++md=setflowequation(md,'stokes','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test507.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test507.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test507.m	(revision 12805)
+@@ -0,0 +1,35 @@
++md=triangle(model,'../Exp/Pig.exp',30000);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=extrude(md,2,1);
++md=setflowequation(md,'stokes','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++%The thickness wants to be lower than 1 so we contrain it to 1
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2'};
++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(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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test512.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test512.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test512.m	(revision 12805)
+@@ -1,35 +1,34 @@
+-md=triangle(model,'../Exp/Pig.exp',30000);
++md=triangle(model,'../Exp/Pig.exp',20000);
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+ md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,2,1);
++md=extrude(md,3,1);
+ md=setflowequation(md,'pattyn','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++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);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=[103*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
++md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
++md=solve(md,DiagnosticSolutionEnum);
+ 
+ %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_tolerances={1e-10,1e-10,1e-10,1e-10,1e-12,1e-11,1e-12,1e-11,1e-12,1e-12,...
+-						1e-11,1e-11,1e-09,1e-11,1e-11,1e-10,1e-11,1e-10,1e-11,1e-08};
++field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy'};
++field_tolerances={1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11};
+ 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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+-	};
++	(md.results.DiagnosticSolution.Gradient1),...
++	md.results.DiagnosticSolution.J,...
++	(md.results.DiagnosticSolution.FrictionCoefficient),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test516.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test516.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test516.m	(revision 12805)
+@@ -1,22 +1,18 @@
+ md=triangle(model,'../Exp/Pig.exp',30000);
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+ md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,4,1.1);
+-md=setflowequation(md,'macayeal','all');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.thermal.stabilization=2;
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.timestepping.time_step=0;
+-md=solve(md,SteadystateSolutionEnum);
++md.thermal.penalty_threshold=40;
++md=solve(md,ThermalSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-08
+-};
++field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-11,1e-11};
+ field_values={...
+-	(md.results.SteadystateSolution.Vx),...
+-	(md.results.SteadystateSolution.Vy),...
+-	(md.results.SteadystateSolution.Vz),...
+-	(md.results.SteadystateSolution.Vel),...
+-	(md.results.SteadystateSolution.Pressure),...
+-	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
++	(md.results.ThermalSolution.Temperature),...
++	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test504.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test504.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test504.m	(revision 12805)
+@@ -1,18 +1,26 @@
+ md=triangle(model,'../Exp/Pig.exp',20000);
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+ md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,3,0.9);
+-md=setflowequation(md,'pattyn','all');
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-08,1e-08,1e-08,1e-08,1e-08};
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2'};
++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};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test508.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test508.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test508.m	(revision 12805)
+@@ -1,26 +1,22 @@
+-md=triangle(model,'../Exp/Pig.exp',20000);
++md=triangle(model,'../Exp/Pig.exp',30000);
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+ md=parameterize(md,'../Par/Pig.par');
++md=extrude(md,4,1.1);
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
++md.timestepping.time_step=0;
++md=solve(md,SteadystateSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2'};
+-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};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-08
++};
+ 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).Bed),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
++	(md.results.SteadystateSolution.Vx),...
++	(md.results.SteadystateSolution.Vy),...
++	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Pressure),...
++	(md.results.SteadystateSolution.Temperature),...
++	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test513.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test513.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test513.m	(revision 12805)
+@@ -0,0 +1,39 @@
++md=triangle(model,'../Exp/Pig.exp',30000);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++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);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=[103*ones(md.inversion.nsteps,1)  501*ones(md.inversion.nsteps,1)];
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2*10^-7;
++md.inversion.gradient_scaling=3*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++md.timestepping.time_step=0;
++
++md.thermal.penalty_lock=5;
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,SteadystateSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'BasalforcingsMeltingRate'};
++field_tolerances={1e-10,1e-10,1e-10,1e-10,1e-6,1e-6,1e-6,1e-6,1e-6,1e-06};
++field_values={...
++	(md.results.SteadystateSolution.Gradient1),...
++	md.results.SteadystateSolution.J,...
++	(md.results.SteadystateSolution.FrictionCoefficient),...
++	(md.results.SteadystateSolution.Pressure),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Vx),...
++	(md.results.SteadystateSolution.Vy),...
++	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Temperature),...
++	(md.results.SteadystateSolution.BasalforcingsMeltingRate)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12805)
+@@ -124,22 +124,22 @@
+ 	case 430, name='SquareSheetShelfDiagS3dNewton';
+ 	case 431, name='SquareSheetShelfSteaEnthalpyM3d';
+ 	case 432, name='SquareSheetShelfSteaEnthalpyP3d';
+-	case 502, name='PigDiagM2d';
+-	case 504, name='PigDiagP3d';
+-	case 506, name='PigDiagS3d';
+-	case 508, name='PigTranM2d';
+-	case 510, name='PigTranM3d';
+-	case 512, name='PigTranP3d';
+-	case 514, name='PigTranS3d';
+-	case 516, name='PigSteaM3d';
+-	case 518, name='PigSteaP3d';
+-	case 520, name='PigSteaS3d';
+-	case 522, name='PigCMBS3d';
+-	case 524, name='PigCMDragP3d';
+-	case 526, name='PigCMDragSteaM3d';
+-	case 527, name='PigBamgMesh';
+-	case 530, name='PigTherTranSUPG';
+-	case 532, name='PigTherSteaSUPG';
++	case 501, name='PigDiagM2d';
++	case 502, name='PigDiagP3d';
++	case 503, name='PigDiagS3d';
++	case 504, name='PigTranM2d';
++	case 505, name='PigTranM3d';
++	case 506, name='PigTranP3d';
++	case 507, name='PigTranS3d';
++	case 508, name='PigSteaM3d';
++	case 509, name='PigSteaP3d';
++	case 510, name='PigSteaS3d';
++	case 511, name='PigCMBS3d';
++	case 512, name='PigCMDragP3d';
++	case 513, name='PigCMDragSteaM3d';
++	case 514, name='PigBamgMesh';
++	case 515, name='PigTherTranSUPG';
++	case 516, name='PigTherSteaSUPG';
+ 	case 602, name='79NorthProg2d';
+ 	case 604, name='79NorthProg2dDG';
+ 	case 606, name='79NorthProg3d';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test501.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test501.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test501.m	(revision 12805)
+@@ -0,0 +1,16 @@
++md=triangle(model,'../Exp/Pig.exp',20000);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test505.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test505.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test505.m	(revision 12805)
+@@ -0,0 +1,34 @@
++md=triangle(model,'../Exp/Pig.exp',30000);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++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_tolerances={1e-12,1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-12,1e-12,1e-12,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).Vz),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test509.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test509.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test509.m	(revision 12805)
+@@ -0,0 +1,22 @@
++md=triangle(model,'../Exp/Pig.exp',30000);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.timestepping.time_step=0;
++md=solve(md,SteadystateSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06
++};
++field_values={...
++	(md.results.SteadystateSolution.Vx),...
++	(md.results.SteadystateSolution.Vy),...
++	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Pressure),...
++	(md.results.SteadystateSolution.Temperature),...
++	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test510.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test510.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test510.m	(revision 12805)
+@@ -1,34 +1,22 @@
+-md=triangle(model,'../Exp/Pig.exp',30000);
++md=triangle(model,'../Exp/Pig.exp',20000);
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+ md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
++md=extrude(md,2,1);
++md=setflowequation(md,'stokes','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
++md.timestepping.time_step=0;
++md=solve(md,SteadystateSolutionEnum);
+ 
+ %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_tolerances={1e-12,1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06
++};
+ 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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.SteadystateSolution.Vx),...
++	(md.results.SteadystateSolution.Vy),...
++	(md.results.SteadystateSolution.Vz),...
++	(md.results.SteadystateSolution.Vel),...
++	(md.results.SteadystateSolution.Pressure),...
++	(md.results.SteadystateSolution.Temperature),...
++	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test514.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test514.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test514.m	(revision 12805)
+@@ -1,35 +1,56 @@
+-md=triangle(model,'../Exp/Pig.exp',30000);
++%Simple mesh 1
++hVertices=10000*ones(27,1);
++hVertices(1:5)=1000;
++md=bamg(model,'domain','../Exp/Pig.exp','hmax',20000,'hVertices',hVertices,'gradation',3,'geometricalmetric',1);
++x1=md.mesh.x;
++y1=md.mesh.y;
++
++%Simple mesh 2
++md=bamg(model,'domain','../Exp/Pig.exp','hmax',10000);
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+ md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,2,1);
+-md=setflowequation(md,'stokes','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,TransientSolutionEnum);
++x2=md.mesh.x;
++y2=md.mesh.y;
+ 
++%refine existing mesh 1
++hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vy_obs,'node');
++metric=ComputeMetric(hessian,2/9,1,1000,25*10^3,[]);
++md.miscellaneous.dummy=metric;
++md2=bamg(md,'metric',md.miscellaneous.dummy,'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1);
++x3=md2.mesh.x;
++y3=md2.mesh.y;
++
++%refine existing mesh 2
++md2=bamg(md,'metric',md.miscellaneous.dummy,'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1,'anisomax',1);
++x4=md2.mesh.x;
++y4=md2.mesh.y;
++
++%refine existing mesh 3
++hVertices=NaN*ones(md.mesh.numberofvertices,1);
++hVertices(find(md.mesh.vertexonboundary))=500;
++md2=bamg(md,'metric',md.miscellaneous.dummy,'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1,'anisomax',1,'hVertices',hVertices);
++x5=md2.mesh.x;
++y5=md2.mesh.y;
++
++%refine existing mesh 4
++md2=bamg(md,'field',md.inversion.vy_obs,'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1,'Hessiantype',0,'err',1);
++x6=md2.mesh.x;
++y6=md2.mesh.y;
++
++%refine existing mesh 5
++md2=bamg(md,'field',[md.inversion.vy_obs md.geometry.thickness],'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1,'Hessiantype',1,'err',[10 100]); 
++x7=md2.mesh.x;
++y7=md2.mesh.y;
++
+ %Fields and tolerances to track changes
+-%The thickness wants to be lower than 1 so we contrain it to 1
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2'};
+-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_names     ={'x1' 'y1' 'x2' 'y2' 'x3' 'y3' 'x4' 'y4' 'x5' 'y5' 'x6' 'y6'  'x7' 'y7' };
++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};
+ 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).Bed),...
+-	(md.results.TransientSolution(1).Surface),...
+-	(md.results.TransientSolution(1).Thickness),...
+-	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
+-	(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).Bed),...
+-	(md.results.TransientSolution(2).Surface),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	x1, y1,...
++	y2, y2,...
++	y3, y3,...
++	y4, y4,...
++	y5, y5,...
++	y6, y6,...
++	y7, y7,...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test502.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test502.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test502.m	(revision 12805)
+@@ -1,16 +1,18 @@
+ md=triangle(model,'../Exp/Pig.exp',20000);
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+ md=parameterize(md,'../Par/Pig.par');
+-md=setflowequation(md,'macayeal','all');
++md=extrude(md,3,0.9);
++md=setflowequation(md,'pattyn','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vel','Pressure'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-08,1e-08,1e-08,1e-08,1e-08};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
+ 	(md.results.DiagnosticSolution.Vel),...
+ 	(md.results.DiagnosticSolution.Pressure),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test506.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test506.m	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test506.m	(revision 12805)
+@@ -1,18 +1,35 @@
+-md=triangle(model,'../Exp/Pig.exp',20000);
++md=triangle(model,'../Exp/Pig.exp',30000);
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+ md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,3,0.9);
+-md=setflowequation(md,'stokes','all');
++md=extrude(md,2,1);
++md=setflowequation(md,'pattyn','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2'};
++field_tolerances={1e-10,1e-10,1e-10,1e-10,1e-12,1e-11,1e-12,1e-11,1e-12,1e-12,...
++						1e-11,1e-11,1e-09,1e-11,1e-11,1e-10,1e-11,1e-10,1e-11,1e-08};
+ field_values={...
+-	(md.results.DiagnosticSolution.Vx),...
+-	(md.results.DiagnosticSolution.Vy),...
+-	(md.results.DiagnosticSolution.Vz),...
+-	(md.results.DiagnosticSolution.Vel),...
+-	(md.results.DiagnosticSolution.Pressure),...
++	(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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12804)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12805)
+@@ -126,22 +126,22 @@
+ 		430 : 'SquareSheetShelfDiagS3dNewton',
+ 		431 : 'SquareSheetShelfSteaEnthalpyM3d',
+ 		432 : 'SquareSheetShelfSteaEnthalpyP3d',
+-		502 : 'PigDiagM2d',
+-		504 : 'PigDiagP3d',
+-		506 : 'PigDiagS3d',
+-		508 : 'PigTranM2d',
+-		510 : 'PigTranM3d',
+-		512 : 'PigTranP3d',
+-		514 : 'PigTranS3d',
+-		516 : 'PigSteaM3d',
+-		518 : 'PigSteaP3d',
+-		520 : 'PigSteaS3d',
+-		522 : 'PigCMBS3d',
+-		524 : 'PigCMDragP3d',
+-		526 : 'PigCMDragSteaM3d',
+-		527 : 'PigBamgMesh',
+-		530 : 'PigTherTranSUPG',
+-		532 : 'PigTherSteaSUPG',
++		501 : 'PigDiagM2d',
++		502 : 'PigDiagP3d',
++		503 : 'PigDiagS3d',
++		504 : 'PigTranM2d',
++		505 : 'PigTranM3d',
++		506 : 'PigTranP3d',
++		507 : 'PigTranS3d',
++		508 : 'PigSteaM3d',
++		509 : 'PigSteaP3d',
++		510 : 'PigSteaS3d',
++		511 : 'PigCMBS3d',
++		512 : 'PigCMDragP3d',
++		513 : 'PigCMDragSteaM3d',
++		514 : 'PigBamgMesh',
++		515 : 'PigTherTranSUPG',
++		516 : 'PigTherSteaSUPG',
+ 		602 : '79NorthProg2d',
+ 		604 : '79NorthProg2dDG',
+ 		606 : '79NorthProg3d',
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test511.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test511.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test511.m	(revision 12805)
+@@ -0,0 +1,39 @@
++md=triangle(model,'../Exp/Pig.exp',10000);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++
++%impose hydrostatic equilibrium (required by Stokes)
++md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++md=extrude(md,3,1);
++md=setflowequation(md,'stokes','all');
++md=modelextract(md,md.mask.elementonfloatingice);
++
++%control parameters
++md.inversion.iscontrol=1;
++md.inversion.control_parameters={'MaterialsRheologyBbar'};
++md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
++md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=101*ones(md.inversion.nsteps,1);
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++md.inversion.gradient_scaling=10^8*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient' 'Misfits' 'MaterialsRheologyB' 'Pressure' 'Vel' 'Vx' 'Vy'};
++field_tolerances={1e-11,1e-12,1e-12,1e-09,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
++field_values={...
++	(md.results.DiagnosticSolution.Gradient1),...
++	md.results.DiagnosticSolution.J,...
++	(md.results.DiagnosticSolution.MaterialsRheologyB),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test515.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test515.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test515.m	(revision 12805)
+@@ -0,0 +1,23 @@
++md=triangle(model,'../Exp/Pig.exp',30000);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'pattyn','all');
++md.thermal.stabilization=2;
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.isdiagnostic=0;
++md.transient.isprognostic=0;
++md.transient.isthermal=1;
++md.transient.isgroundingline=0;
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Temperature1','BasalforcingsMeltingRate1', ...
++				      'Temperature2','BasalforcingsMeltingRate2'};
++field_tolerances={1e-13,1e-8,1e-13,1e-8};
++field_values={...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive518.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive521.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive523.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive525.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive527.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive529.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive530.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive532.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive517.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive519.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive520.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive522.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive524.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive526.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive531.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive510.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive512.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive514.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive516.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive502.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive504.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive506.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive508.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive511.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive513.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive515.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive501.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive503.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive505.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive507.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive509.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12805-12806.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12805-12806.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12805-12806.diff	(revision 13394)
@@ -0,0 +1,708 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test622.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test622.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test622.m	(revision 12806)
+@@ -1,31 +0,0 @@
+-md=triangle(model,'../Exp/79North.exp',10000);
+-md=setmask(md,'../Exp/79NorthShelf.exp','');
+-md=parameterize(md,'../Par/79North.par');
+-md=setflowequation(md,'macayeal','all');
+-
+-%control parameters
+-md.inversion.nsteps=2;
+-md.prognostic.stabilization=1;
+-md.inversion.iscontrol=1;
+-md.inversion.control_parameters={'BalancethicknessThickeningRate'};
+-md.inversion.thickness_obs=md.geometry.thickness;
+-md.inversion.min_parameters=-50*ones(md.mesh.numberofvertices,1);
+-md.inversion.max_parameters=50*ones(md.mesh.numberofvertices,1);
+-md.inversion.cost_functions=201*ones(md.inversion.nsteps,1);
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-md.inversion.gradient_scaling=10/md.constants.yts*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=4*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
+-
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BalancethicknessSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'BalancethicknessThickeningRate' 'Thickness'};
+-field_tolerances={1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
+-field_values={...
+-	(md.results.BalancethicknessSolution.Gradient1),...
+-	md.results.BalancethicknessSolution.J,...
+-	(md.results.BalancethicknessSolution.BalancethicknessThickeningRate),...
+-	(md.results.BalancethicknessSolution.Thickness)
+-};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test626.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test626.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test626.m	(revision 12806)
+@@ -1,41 +0,0 @@
+-md=triangle(model,'../Exp/79North.exp',10000);
+-md=meshconvert(md);
+-md=setmask(md,'../Exp/79NorthShelf.exp','');
+-md=parameterize(md,'../Par/79North.par');
+-md=setflowequation(md,'macayeal','all');
+-
+-%Ice sheet only
+-md=modelextract(md,md.mask.elementongroundedice);
+-pos=find(md.mesh.vertexonboundary);
+-md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
+-
+-%control parameters
+-md.inversion.thickness_obs=md.geometry.thickness;
+-md.inversion.iscontrol=1;
+-md.inversion.thickness_obs=md.geometry.thickness;
+-md.inversion.nsteps=2;
+-md.inversion.control_parameters={'Vx' 'Vy'};
+-md.balancethickness.stabilization=1;
+-md.inversion.gradient_scaling=[10/md.constants.yts*ones(md.inversion.nsteps,1) 10/md.constants.yts*ones(md.inversion.nsteps,1)];
+-md.inversion.min_parameters=[-2000*ones(md.mesh.numberofvertices,1) -2000*ones(md.mesh.numberofvertices,1)];
+-md.inversion.max_parameters=[+2000*ones(md.mesh.numberofvertices,1) +2000*ones(md.mesh.numberofvertices,1)];
+-md.inversion.cost_functions=201*ones(md.inversion.nsteps,1);
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-md.inversion.maxiter_per_step=4*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
+-
+-md.verbose.control=1;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BalancethicknessSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Gradient1' 'Gradient2' 'Misfits' 'Vx' 'Vy' 'Thickness'};
+-field_tolerances={1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
+-field_values={...
+-	(md.results.BalancethicknessSolution.Gradient1),...
+-	(md.results.BalancethicknessSolution.Gradient2),...
+-	md.results.BalancethicknessSolution.J,...
+-	(md.results.BalancethicknessSolution.Vx),...
+-	(md.results.BalancethicknessSolution.Vy),...
+-	(md.results.BalancethicknessSolution.Thickness)
+-};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test614.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test614.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test614.m	(revision 12806)
+@@ -1,15 +0,0 @@
+-md=triangle(model,'../Exp/79North.exp',10000);
+-md=setmask(md,'../Exp/79NorthShelf.exp','');
+-md=parameterize(md,'../Par/79North.par');
+-md=extrude(md,2,1);
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BedSlopeSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'BedSlopeX','BedSlopeY'};
+-field_tolerances={1e-13,1e-13};
+-field_values={...
+-	(md.results.BedSlopeSolution.BedSlopeX),...
+-	(md.results.BedSlopeSolution.BedSlopeY),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test618.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test618.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test618.m	(revision 12806)
+@@ -1,15 +0,0 @@
+-md=triangle(model,'../Exp/79North.exp',10000);
+-md=meshconvert(md);
+-md=setmask(md,'../Exp/79NorthShelf.exp','');
+-md=parameterize(md,'../Par/79North.par');
+-md=setflowequation(md,'macayeal','all');
+-md.balancethickness.stabilization=3;
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BalancethicknessSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
+-field_values={...
+-	(md.results.BalancethicknessSolution.Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test620.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test620.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test620.m	(revision 12806)
+@@ -1,14 +0,0 @@
+-md=triangle(model,'../Exp/79North.exp',10000);
+-md=setmask(md,'../Exp/79NorthShelf.exp','');
+-md=parameterize(md,'../Par/79North.par');
+-md=extrude(md,3,1);
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BalancethicknessSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
+-field_values={...
+-	(md.results.BalancethicknessSolution.Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test624.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test624.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test624.m	(revision 12806)
+@@ -1,32 +0,0 @@
+-md=triangle(model,'../Exp/79North.exp',10000);
+-md=meshconvert(md);
+-md=setmask(md,'../Exp/79NorthShelf.exp','');
+-md=parameterize(md,'../Par/79North.par');
+-md=setflowequation(md,'macayeal','all');
+-
+-%control parameters
+-md.inversion.nsteps=2;
+-md.balancethickness.stabilization=3;
+-md.inversion.iscontrol=1;
+-md.inversion.control_parameters={'BalancethicknessThickeningRate'};
+-md.inversion.thickness_obs=md.geometry.thickness;
+-md.inversion.min_parameters=-50*ones(md.mesh.numberofvertices,1);
+-md.inversion.max_parameters=50*ones(md.mesh.numberofvertices,1);
+-md.inversion.cost_functions=201*ones(md.inversion.nsteps,1);
+-md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-md.inversion.gradient_scaling=10/md.constants.yts*ones(md.inversion.nsteps,1);
+-md.inversion.maxiter_per_step=4*ones(md.inversion.nsteps,1);
+-md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
+-
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BalancethicknessSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Gradient' 'Misfits' 'BalancethicknessThickeningRate' 'Thickness'};
+-field_tolerances={1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
+-field_values={...
+-	(md.results.BalancethicknessSolution.Gradient1),...
+-	md.results.BalancethicknessSolution.J,...
+-	(md.results.BalancethicknessSolution.BalancethicknessThickeningRate),...
+-	(md.results.BalancethicknessSolution.Thickness)
+-};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test616.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test616.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test616.m	(revision 12806)
+@@ -1,13 +0,0 @@
+-md=triangle(model,'../Exp/79North.exp',10000);
+-md=setmask(md,'../Exp/79NorthShelf.exp','');
+-md=parameterize(md,'../Par/79North.par');
+-md=setflowequation(md,'macayeal','all');
+-md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BalancethicknessSolutionEnum);
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
+-field_values={...
+-	(md.results.BalancethicknessSolution.Thickness),...
+-	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test601.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test601.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test601.m	(revision 12806)
+@@ -0,0 +1,13 @@
++md=triangle(model,'../Exp/79North.exp',10000);
++md=setmask(md,'../Exp/79NorthShelf.exp','');
++md=parameterize(md,'../Par/79North.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,PrognosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.PrognosticSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test605.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test605.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test605.m	(revision 12806)
+@@ -0,0 +1,15 @@
++md=triangle(model,'../Exp/79North.exp',10000);
++md=setmask(md,'../Exp/79NorthShelf.exp','');
++md=parameterize(md,'../Par/79North.par');
++md=extrude(md,5,1.5);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,SurfaceSlopeSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'SurfaceSlopeX','SurfaceSlopeY'};
++field_tolerances={1e-13,1e-13};
++field_values={...
++	(md.results.SurfaceSlopeSolution.SurfaceSlopeX),...
++	(md.results.SurfaceSlopeSolution.SurfaceSlopeY),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test609.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test609.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test609.m	(revision 12806)
+@@ -0,0 +1,15 @@
++md=triangle(model,'../Exp/79North.exp',10000);
++md=meshconvert(md);
++md=setmask(md,'../Exp/79NorthShelf.exp','');
++md=parameterize(md,'../Par/79North.par');
++md=setflowequation(md,'macayeal','all');
++md.balancethickness.stabilization=3;
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,BalancethicknessSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.BalancethicknessSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test610.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test610.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test610.m	(revision 12806)
+@@ -1,15 +1,14 @@
+ md=triangle(model,'../Exp/79North.exp',10000);
+ md=setmask(md,'../Exp/79NorthShelf.exp','');
+ md=parameterize(md,'../Par/79North.par');
+-md=extrude(md,5,1.5);
+-md=setflowequation(md,'pattyn','all');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,SurfaceSlopeSolutionEnum);
++md=solve(md,BalancethicknessSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'SurfaceSlopeX','SurfaceSlopeY'};
+-field_tolerances={1e-13,1e-13};
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
+ field_values={...
+-	(md.results.SurfaceSlopeSolution.SurfaceSlopeX),...
+-	(md.results.SurfaceSlopeSolution.SurfaceSlopeY),...
++	(md.results.BalancethicknessSolution.Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test602.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test602.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test602.m	(revision 12806)
+@@ -1,7 +1,10 @@
+ md=triangle(model,'../Exp/79North.exp',10000);
++md=meshconvert(md);
+ md=setmask(md,'../Exp/79NorthShelf.exp','');
+ md=parameterize(md,'../Par/79North.par');
+ md=setflowequation(md,'macayeal','all');
++md.prognostic.stabilization=3;
++md.prognostic.spcthickness=md.geometry.thickness;
+ md.cluster=generic('name',oshostname(),'np',3);
+ md=solve(md,PrognosticSolutionEnum);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test606.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test606.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test606.m	(revision 12806)
+@@ -1,14 +1,14 @@
+ md=triangle(model,'../Exp/79North.exp',10000);
+ md=setmask(md,'../Exp/79NorthShelf.exp','');
+ md=parameterize(md,'../Par/79North.par');
+-md=extrude(md,6,1);
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,PrognosticSolutionEnum);
++md=solve(md,BedSlopeSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
++field_names     ={'BedSlopeX','BedSlopeY'};
++field_tolerances={1e-13,1e-13};
+ field_values={...
+-	(md.results.PrognosticSolution.Thickness),...
++	(md.results.BedSlopeSolution.BedSlopeX),...
++	(md.results.BedSlopeSolution.BedSlopeY),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test611.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test611.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test611.m	(revision 12806)
+@@ -0,0 +1,31 @@
++md=triangle(model,'../Exp/79North.exp',10000);
++md=setmask(md,'../Exp/79NorthShelf.exp','');
++md=parameterize(md,'../Par/79North.par');
++md=setflowequation(md,'macayeal','all');
++
++%control parameters
++md.inversion.nsteps=2;
++md.prognostic.stabilization=1;
++md.inversion.iscontrol=1;
++md.inversion.control_parameters={'BalancethicknessThickeningRate'};
++md.inversion.thickness_obs=md.geometry.thickness;
++md.inversion.min_parameters=-50*ones(md.mesh.numberofvertices,1);
++md.inversion.max_parameters=50*ones(md.mesh.numberofvertices,1);
++md.inversion.cost_functions=201*ones(md.inversion.nsteps,1);
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++md.inversion.gradient_scaling=10/md.constants.yts*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=4*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,BalancethicknessSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient' 'Misfits' 'BalancethicknessThickeningRate' 'Thickness'};
++field_tolerances={1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
++field_values={...
++	(md.results.BalancethicknessSolution.Gradient1),...
++	md.results.BalancethicknessSolution.J,...
++	(md.results.BalancethicknessSolution.BalancethicknessThickeningRate),...
++	(md.results.BalancethicknessSolution.Thickness)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12806)
+@@ -140,19 +140,19 @@
+ 	case 514, name='PigBamgMesh';
+ 	case 515, name='PigTherTranSUPG';
+ 	case 516, name='PigTherSteaSUPG';
+-	case 602, name='79NorthProg2d';
+-	case 604, name='79NorthProg2dDG';
+-	case 606, name='79NorthProg3d';
+-	case 608, name='79NorthSurfSlop2d';
+-	case 610, name='79NorthSurfSlop3d';
+-	case 612, name='79NorthBedSlop2d';
+-	case 614, name='79NorthBedSlop3d';
+-	case 616, name='79NorthBalThic2d';
+-	case 618, name='79NorthBalThic2dDG';
+-	case 620, name='79NorthBalThic3d';
+-	case 622, name='79NorthCMBalThic2dCG';
+-	case 624, name='79NorthCMBalThic2dDG';
+-	case 626, name='79NorthCMBalThicVxVyParalle';
++	case 601, name='79NorthProg2d';
++	case 602, name='79NorthProg2dDG';
++	case 603, name='79NorthProg3d';
++	case 604, name='79NorthSurfSlop2d';
++	case 605, name='79NorthSurfSlop3d';
++	case 606, name='79NorthBedSlop2d';
++	case 607, name='79NorthBedSlop3d';
++	case 608, name='79NorthBalThic2d';
++	case 609, name='79NorthBalThic2dDG';
++	case 610, name='79NorthBalThic3d';
++	case 611, name='79NorthCMBalThic2dCG';
++	case 612, name='79NorthCMBalThic2dDG';
++	case 613, name='79NorthCMBalThicVxVyParalle';
+ 	case 1101, name='ISMIPAPattyn';
+ 	case 1102, name='ISMIPAStokes';
+ 	case 1103, name='ISMIPBPattyn';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test603.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test603.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test603.m	(revision 12806)
+@@ -0,0 +1,14 @@
++md=triangle(model,'../Exp/79North.exp',10000);
++md=setmask(md,'../Exp/79NorthShelf.exp','');
++md=parameterize(md,'../Par/79North.par');
++md=extrude(md,6,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,PrognosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.PrognosticSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test607.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test607.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test607.m	(revision 12806)
+@@ -0,0 +1,15 @@
++md=triangle(model,'../Exp/79North.exp',10000);
++md=setmask(md,'../Exp/79NorthShelf.exp','');
++md=parameterize(md,'../Par/79North.par');
++md=extrude(md,2,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,BedSlopeSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'BedSlopeX','BedSlopeY'};
++field_tolerances={1e-13,1e-13};
++field_values={...
++	(md.results.BedSlopeSolution.BedSlopeX),...
++	(md.results.BedSlopeSolution.BedSlopeY),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test612.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test612.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test612.m	(revision 12806)
+@@ -1,14 +1,32 @@
+ md=triangle(model,'../Exp/79North.exp',10000);
++md=meshconvert(md);
+ md=setmask(md,'../Exp/79NorthShelf.exp','');
+ md=parameterize(md,'../Par/79North.par');
+ md=setflowequation(md,'macayeal','all');
++
++%control parameters
++md.inversion.nsteps=2;
++md.balancethickness.stabilization=3;
++md.inversion.iscontrol=1;
++md.inversion.control_parameters={'BalancethicknessThickeningRate'};
++md.inversion.thickness_obs=md.geometry.thickness;
++md.inversion.min_parameters=-50*ones(md.mesh.numberofvertices,1);
++md.inversion.max_parameters=50*ones(md.mesh.numberofvertices,1);
++md.inversion.cost_functions=201*ones(md.inversion.nsteps,1);
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++md.inversion.gradient_scaling=10/md.constants.yts*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=4*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
++
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,BedSlopeSolutionEnum);
++md=solve(md,BalancethicknessSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'BedSlopeX','BedSlopeY'};
+-field_tolerances={1e-13,1e-13};
++field_names     ={'Gradient' 'Misfits' 'BalancethicknessThickeningRate' 'Thickness'};
++field_tolerances={1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
+ field_values={...
+-	(md.results.BedSlopeSolution.BedSlopeX),...
+-	(md.results.BedSlopeSolution.BedSlopeY),...
+-	};
++	(md.results.BalancethicknessSolution.Gradient1),...
++	md.results.BalancethicknessSolution.J,...
++	(md.results.BalancethicknessSolution.BalancethicknessThickeningRate),...
++	(md.results.BalancethicknessSolution.Thickness)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test604.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test604.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test604.m	(revision 12806)
+@@ -1,16 +1,14 @@
+ md=triangle(model,'../Exp/79North.exp',10000);
+-md=meshconvert(md);
+ md=setmask(md,'../Exp/79NorthShelf.exp','');
+ md=parameterize(md,'../Par/79North.par');
+ md=setflowequation(md,'macayeal','all');
+-md.prognostic.stabilization=3;
+-md.prognostic.spcthickness=md.geometry.thickness;
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,PrognosticSolutionEnum);
++md=solve(md,SurfaceSlopeSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Thickness'};
+-field_tolerances={1e-13};
++field_names     ={'SurfaceSlopeX','SurfaceSlopeY'};
++field_tolerances={1e-13,1e-13};
+ field_values={...
+-	(md.results.PrognosticSolution.Thickness),...
++	(md.results.SurfaceSlopeSolution.SurfaceSlopeX),...
++	(md.results.SurfaceSlopeSolution.SurfaceSlopeY),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test608.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test608.m	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test608.m	(revision 12806)
+@@ -3,12 +3,11 @@
+ md=parameterize(md,'../Par/79North.par');
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md=solve(md,SurfaceSlopeSolutionEnum);
++md=solve(md,BalancethicknessSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'SurfaceSlopeX','SurfaceSlopeY'};
+-field_tolerances={1e-13,1e-13};
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
+ field_values={...
+-	(md.results.SurfaceSlopeSolution.SurfaceSlopeX),...
+-	(md.results.SurfaceSlopeSolution.SurfaceSlopeY),...
++	(md.results.BalancethicknessSolution.Thickness),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12805)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12806)
+@@ -142,19 +142,19 @@
+ 		514 : 'PigBamgMesh',
+ 		515 : 'PigTherTranSUPG',
+ 		516 : 'PigTherSteaSUPG',
+-		602 : '79NorthProg2d',
+-		604 : '79NorthProg2dDG',
+-		606 : '79NorthProg3d',
+-		608 : '79NorthSurfSlop2d',
+-		610 : '79NorthSurfSlop3d',
+-		612 : '79NorthBedSlop2d',
+-		614 : '79NorthBedSlop3d',
+-		616 : '79NorthBalThic2d',
+-		618 : '79NorthBalThic2dDG',
+-		620 : '79NorthBalThic3d',
+-		622 : '79NorthCMBalThic2dCG',
+-		624 : '79NorthCMBalThic2dDG',
+-		626 : '79NorthCMBalThicVxVy',
++		601 : '79NorthProg2d',
++		602 : '79NorthProg2dDG',
++		603 : '79NorthProg3d',
++		604 : '79NorthSurfSlop2d',
++		605 : '79NorthSurfSlop3d',
++		606 : '79NorthBedSlop2d',
++		607 : '79NorthBedSlop3d',
++		608 : '79NorthBalThic2d',
++		609 : '79NorthBalThic2dDG',
++		610 : '79NorthBalThic3d',
++		611 : '79NorthCMBalThic2dCG',
++		612 : '79NorthCMBalThic2dDG',
++		613 : '79NorthCMBalThicVxVy',
+ 		1101 : 'ISMIPAPattyn',
+ 		1102 : 'ISMIPAStokes',
+ 		1103 : 'ISMIPBPattyn',
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test613.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test613.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test613.m	(revision 12806)
+@@ -0,0 +1,41 @@
++md=triangle(model,'../Exp/79North.exp',10000);
++md=meshconvert(md);
++md=setmask(md,'../Exp/79NorthShelf.exp','');
++md=parameterize(md,'../Par/79North.par');
++md=setflowequation(md,'macayeal','all');
++
++%Ice sheet only
++md=modelextract(md,md.mask.elementongroundedice);
++pos=find(md.mesh.vertexonboundary);
++md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
++
++%control parameters
++md.inversion.thickness_obs=md.geometry.thickness;
++md.inversion.iscontrol=1;
++md.inversion.thickness_obs=md.geometry.thickness;
++md.inversion.nsteps=2;
++md.inversion.control_parameters={'Vx' 'Vy'};
++md.balancethickness.stabilization=1;
++md.inversion.gradient_scaling=[10/md.constants.yts*ones(md.inversion.nsteps,1) 10/md.constants.yts*ones(md.inversion.nsteps,1)];
++md.inversion.min_parameters=[-2000*ones(md.mesh.numberofvertices,1) -2000*ones(md.mesh.numberofvertices,1)];
++md.inversion.max_parameters=[+2000*ones(md.mesh.numberofvertices,1) +2000*ones(md.mesh.numberofvertices,1)];
++md.inversion.cost_functions=201*ones(md.inversion.nsteps,1);
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++md.inversion.maxiter_per_step=4*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
++
++md.verbose.control=1;
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,BalancethicknessSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient1' 'Gradient2' 'Misfits' 'Vx' 'Vy' 'Thickness'};
++field_tolerances={1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
++field_values={...
++	(md.results.BalancethicknessSolution.Gradient1),...
++	(md.results.BalancethicknessSolution.Gradient2),...
++	md.results.BalancethicknessSolution.J,...
++	(md.results.BalancethicknessSolution.Vx),...
++	(md.results.BalancethicknessSolution.Vy),...
++	(md.results.BalancethicknessSolution.Thickness)
++};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive615.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive617.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive619.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive620.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive622.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive624.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive626.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive614.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive616.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive618.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive621.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive623.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive625.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive602.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive604.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive606.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive608.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive611.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive613.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive601.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive603.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive605.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive607.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive609.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive610.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive612.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12806-12807.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12806-12807.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12806-12807.diff	(revision 13394)
@@ -0,0 +1,14 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.mat
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.mat	(revision 12806)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.mat	(revision 12807)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.mat
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12807-12808.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12807-12808.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12807-12808.diff	(revision 13394)
@@ -0,0 +1,105 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test110.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test110.m	(revision 12807)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test110.m	(revision 12808)
+@@ -3,14 +3,15 @@
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs=IceVolumeEnum();
+ 
+ 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_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Volume3'};
++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};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+ 	(md.results.TransientSolution(1).Vy),...
+@@ -19,6 +20,7 @@
+ 	(md.results.TransientSolution(1).Bed),...
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).IceVolume),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vel),...
+@@ -26,6 +28,7 @@
+ 	(md.results.TransientSolution(2).Bed),...
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).IceVolume),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vel),...
+@@ -33,4 +36,5 @@
+ 	(md.results.TransientSolution(3).Bed),...
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).IceVolume),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m	(revision 12807)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m	(revision 12808)
+@@ -4,17 +4,18 @@
+ md=extrude(md,3,1);
+ md=setflowequation(md,'pattyn','all');
+ md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs=IceVolumeEnum();
+ 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'};
++	'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'};
+ field_tolerances={...
+-	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
+-	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
+-	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
++	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-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-13,...
++	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-13};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+ 	(md.results.TransientSolution(1).Vy),...
+@@ -26,6 +27,7 @@
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+ 	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).IceVolume),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -36,6 +38,7 @@
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+ 	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).IceVolume),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -46,4 +49,5 @@
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+ 	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).IceVolume),...
+ 	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive110.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive111.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12808-12809.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12808-12809.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12808-12809.diff	(revision 13394)
@@ -0,0 +1,32 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsTemperaturesLgmEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsTemperaturesLgmEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsTemperaturesLgmEnum.m	(revision 12809)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsTemperaturesLgmEnum()
++%SURFACEFORCINGSTEMPERATURESLGMENUM - Enum of SurfaceforcingsTemperaturesLgm
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsTemperaturesLgmEnum()
++
++macro=StringToEnum('SurfaceforcingsTemperaturesLgm');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsTemperaturesPresentdayEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsTemperaturesPresentdayEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsTemperaturesPresentdayEnum.m	(revision 12809)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsTemperaturesPresentdayEnum()
++%SURFACEFORCINGSTEMPERATURESPRESENTDAYENUM - Enum of SurfaceforcingsTemperaturesPresentday
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsTemperaturesPresentdayEnum()
++
++macro=StringToEnum('SurfaceforcingsTemperaturesPresentday');
Index: /issm/oecreview/Archive/12678-13393/ISSM-12809-12810.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12809-12810.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12809-12810.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m	(revision 12809)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m	(revision 12810)
+@@ -14,8 +14,8 @@
+ 	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3','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-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-13,...
+-	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-13};
++	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-12,...
++	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-11};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+ 	(md.results.TransientSolution(1).Vy),...
Index: /issm/oecreview/Archive/12678-13393/ISSM-12810-12811.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12810-12811.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12810-12811.diff	(revision 13394)
@@ -0,0 +1,40 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test307.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test307.m	(revision 12810)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test307.m	(revision 12811)
+@@ -8,7 +8,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-09,1e-09,1e-10,2e-10,1e-10};
++field_tolerances={1e-09,1e-09,2e-10,2e-10,1e-10};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test1108.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test1108.m	(revision 12810)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test1108.m	(revision 12811)
+@@ -73,7 +73,7 @@
+ field_tolerances={...
+ 	1e-07,1e-07,1e-07,...
+ 	1e-08,1e-08,1e-08,...
+-	1e-08,1e-07,1e-08,...
++	1e-08,1e-07,1e-07,...
+ 	1e-08,1e-08,1e-08,...
+ 	1e-08,1e-07,1e-07,...
+ 	1e-07,1e-06,1e-07,...
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test1107.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test1107.m	(revision 12810)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test1107.m	(revision 12811)
+@@ -130,8 +130,8 @@
+ 	'Vx160km','Vy160km','Vz160km'
+ };
+ field_tolerances={...
++	1e-07,1e-08,1e-06,...
+ 	1e-08,1e-08,1e-06,...
+-	1e-08,1e-08,1e-06,...
+ 	1e-08,1e-08,1e-07,...
+ 	1e-08,1e-08,1e-07,...
+ 	1e-08,1e-08,1e-07,...
Index: /issm/oecreview/Archive/12678-13393/ISSM-12811-12812.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12811-12812.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12811-12812.diff	(revision 13394)
@@ -0,0 +1,27 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 12811)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 12812)
+@@ -96,15 +96,18 @@
+ 	iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
+ 	if(isdelta18o){
+ 		IssmDouble *temp = NULL;
++		IssmDouble  yts;
+ 		int         N,M;
+ 
+-		iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oEnum);
+-		_assert_(N==2);
++		iomodel->Constant(&yts,ConstantsYtsEnum);
++
++		iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oEnum); _assert_(N==2);
++		for(i=0;i<M;i++) temp[M+i]=yts*temp[M+i];
+ 		parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oEnum,&temp[0],&temp[M],M));
+ 		xDelete<IssmDouble>(temp);
+ 
+-		iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oSurfaceEnum);
+-		_assert_(N==2);
++		iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oSurfaceEnum); _assert_(N==2);
++		for(i=0;i<M;i++) temp[M+i]=yts*temp[M+i];
+ 		parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oSurfaceEnum,&temp[0],&temp[M],M));
+ 		xDelete<IssmDouble>(temp);
+ 	}
Index: /issm/oecreview/Archive/12678-13393/ISSM-12812-12813.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12812-12813.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12812-12813.diff	(revision 13394)
@@ -0,0 +1,60 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh	(revision 12812)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh	(revision 12813)
+@@ -21,7 +21,7 @@
+ 	--PETSC_ARCH=linux-gnu-amd64 \
+ 	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+ 	--with-debugging=0 \
+-	--with-shared-libraries=1 \
++	--with-shared-libraries=0 \
+ 	--download-mumps=yes \
+ 	--download-scalapack=yes \
+ 	--download-blacs=yes \
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh	(revision 12813)
+@@ -0,0 +1,36 @@
++#!/bin/bash
++
++#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" \
++	--with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
++	--with-clanguage=C++ \
++	--PETSC_ARCH=linux-gnu-amd64 \
++	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
++	--with-debugging=0 \
++	--with-shared-libraries=1 \
++	--download-mumps=yes \
++	--download-scalapack=yes \
++	--download-blacs=yes \
++	--download-blas=yes \
++	--download-f-blas-lapack=yes \
++	--download-plapack=yes \
++	--download-parmetis=yes \
++	--with-pic=1
++
++#Compile petsc and install it
++make
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12813-12814.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12813-12814.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12813-12814.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh	(revision 12813)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh	(revision 12814)
+@@ -21,7 +21,7 @@
+ 	--PETSC_ARCH=linux-gnu-amd64 \
+ 	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+ 	--with-debugging=0 \
+-	--with-shared-libraries=0 \
++	--with-shared-libraries=1 \
+ 	--download-mumps=yes \
+ 	--download-scalapack=yes \
+ 	--download-blacs=yes \
Index: /issm/oecreview/Archive/12678-13393/ISSM-12814-12815.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12814-12815.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12814-12815.diff	(revision 13394)
@@ -0,0 +1,446 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/triangle.c.patch.matlab
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/triangle.c.patch.matlab	(revision 12814)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/triangle.c.patch.matlab	(revision 12815)
+@@ -1,164 +0,0 @@
+-0a1,10
+-> /*Notes for the Ice code: 
+->  * to be able to compile Triangle within a mex function that can run within 
+->  * matlab, we had to change the allocation routine trimalloc, as well as the 
+->  * double precision activation in exactinit(); The rest is not changed. 
+->  * We also created the ice_makefile to compile Triangle into a library. */
+-> #include <mat.h>
+-> #include <matrix.h>
+-> #define ANSI_DECLARATORS
+-> #define NO_TIMER
+-> 
+-347a358
+-> #ifndef _WIN_
+-348a360
+-> #endif
+-641d652
+-< 
+-817a829,922
+-> /*Some missing prototypes: */
+-> int scale_expansion_zeroelim(int elen, REAL *e, REAL b, REAL *h);
+-> int fast_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f, REAL *h);
+-> void poolzero(struct memorypool *pool);
+-> int triunsuitable(vertex triorg, vertex tridest, vertex triapex, REAL area);
+-> triangle *triangletraverse(struct mesh *m);
+-> void pooldeinit(struct memorypool *pool);
+-> void printtriangle(struct mesh *m, struct behavior *b, struct otri *t);
+-> VOID *poolalloc(struct memorypool *pool);
+-> void enqueuebadtriang(struct mesh *m, struct behavior *b,
+->                       struct badtriang *badtri);
+-> void triangulatepolygon(struct mesh *m, struct behavior *b,
+->                         struct otri *firstedge, struct otri *lastedge,
+->                         int edgecount, int doflip, int triflaws);
+-> void triangledealloc(struct mesh *m, triangle *dyingtriangle);
+-> void unflip(struct mesh *m, struct behavior *b, struct otri *flipedge);
+-> void vertexmedian(vertex *sortarray, int arraysize, int median, int axis);
+-> REAL counterclockwiseadapt(vertex pa, vertex pb, vertex pc, REAL detsum);
+-> REAL incircleadapt(vertex pa, vertex pb, vertex pc, vertex pd, REAL permanent);
+-> void enqueuebadtri(struct mesh *m, struct behavior *b, struct otri *enqtri,
+->                    REAL minedge, vertex enqapex, vertex enqorg, vertex enqdest);
+-> void alternateaxes(vertex *sortarray, int arraysize, int axis);
+-> REAL incircleadapt(vertex pa, vertex pb, vertex pc, vertex pd, REAL permanent);
+-> void maketriangle(struct mesh *m, struct behavior *b, struct otri *newotri);
+-> REAL counterclockwise(struct mesh *m, struct behavior *b,
+->                       vertex pa, vertex pb, vertex pc);
+-> vertex vertextraverse(struct mesh *m);
+-> void mergehulls(struct mesh *m, struct behavior *b, struct otri *farleft,
+->                 struct otri *innerleft, struct otri *innerright,
+->                 struct otri *farright, int axis);
+-> REAL incircle(struct mesh *m, struct behavior *b,
+->               vertex pa, vertex pb, vertex pc, vertex pd);
+-> void poolrestart(struct memorypool *pool);
+-> void trifree(VOID *memptr);
+-> struct splaynode *splay(struct mesh *m, struct splaynode *splaytree,
+->                         vertex searchpoint, struct otri *searchtri);
+-> void eventheapdelete(struct event **heap, int heapsize, int eventnum);
+-> void eventheapdelete(struct event **heap, int heapsize, int eventnum);
+-> void flip(struct mesh *m, struct behavior *b, struct otri *flipedge);
+-> void check4deadevent(struct otri *checktri, struct event **freeevents,
+->                      struct event **eventheap, int *heapsize);
+-> REAL orient3d(struct mesh *m, struct behavior *b,
+->               vertex pa, vertex pb, vertex pc, vertex pd,
+->               REAL aheight, REAL bheight, REAL cheight, REAL dheight);
+-> REAL circletop(struct mesh *m, vertex pa, vertex pb, vertex pc, REAL ccwabc);
+-> void poolinit(struct memorypool *pool, int bytecount, int itemcount,
+->               int firstitemcount, int alignment);
+-> void eventheapinsert(struct event **heap, int heapsize, struct event *newevent);
+-> int rightofhyperbola(struct mesh *m, struct otri *fronttri, vertex newsite);
+-> void insertsubseg(struct mesh *m, struct behavior *b, struct otri *tri,
+->                   int subsegmark);
+-> int scoutsegment(struct mesh *m, struct behavior *b, struct otri *searchtri,
+->                  vertex endpoint2, int newmark);
+-> vertex getvertex(struct mesh *m, struct behavior *b, int number);
+-> void internalerror();
+-> unsigned long randomnation(unsigned int choices);
+-> struct splaynode *splayinsert(struct mesh *m, struct splaynode *splayroot,
+->                               struct otri *newkey, vertex searchpoint);
+-> void delaunayfixup(struct mesh *m, struct behavior *b,
+->                    struct otri *fixuptri, int leftside);
+-> void traversalinit(struct memorypool *pool);
+-> enum insertvertexresult insertvertex(struct mesh *m, struct behavior *b,
+->                                      vertex newvertex, struct otri *searchtri,
+->                                      struct osub *splitseg,
+->                                      int segmentflaws, int triflaws);
+-> void conformingedge(struct mesh *m, struct behavior *b,
+->                     vertex endpoint1, vertex endpoint2, int newmark);
+-> enum finddirectionresult finddirection(struct mesh *m, struct behavior *b,
+->                                        struct otri *searchtri,
+->                                        vertex searchpoint);
+-> VOID *traverse(struct memorypool *pool);
+-> void deletevertex(struct mesh *m, struct behavior *b, struct otri *deltri);
+-> void pooldealloc(struct memorypool *pool, VOID *dyingitem);
+-> int checkseg4encroach(struct mesh *m, struct behavior *b,
+->                       struct osub *testsubseg);
+-> void badsubsegdealloc(struct mesh *m, struct badsubseg *dyingseg);
+-> void vertexdealloc(struct mesh *m, vertex dyingvertex);
+-> void vertexsort(vertex *sortarray, int arraysize);
+-> void tallyencs(struct mesh *m, struct behavior *b);
+-> void splittriangle(struct mesh *m, struct behavior *b,
+->                    struct badtriang *badtri);
+-> subseg *subsegtraverse(struct mesh *m);
+-> enum locateresult locate(struct mesh *m, struct behavior *b,
+->                          vertex searchpoint, struct otri *searchtri);
+-> void writenodes(struct mesh *m, struct behavior *b, REAL **pointlist,
+->                 REAL **pointattriblist, int **pointmarkerlist);
+-> void writevoronoi(struct mesh *m, struct behavior *b, REAL **vpointlist,
+->                   REAL **vpointattriblist, int **vpointmarkerlist,
+->                   int **vedgelist, int **vedgemarkerlist, REAL **vnormlist);
+-> void writeneighbors(struct mesh *m, struct behavior *b, int **neighborlist);
+-> void testtriangle(struct mesh *m, struct behavior *b, struct otri *testtri);
+-> void triangleinit(struct mesh *m);
+-> 
+-> 
+-1408a1514
+-> void triexit(int status);
+-1410d1515
+-< #ifdef ANSI_DECLARATORS
+-1412,1416d1516
+-< #else /* not ANSI_DECLARATORS */
+-< void triexit(status)
+-< int status;
+-< #endif /* not ANSI_DECLARATORS */
+-< 
+-1421c1521
+-< #ifdef ANSI_DECLARATORS
+----
+-> VOID *trimalloc(int size);
+-1423,1427d1522
+-< #else /* not ANSI_DECLARATORS */
+-< VOID *trimalloc(size)
+-< int size;
+-< #endif /* not ANSI_DECLARATORS */
+-< 
+-1431c1526,1527
+-<   memptr = (VOID *) malloc((unsigned int) size);
+----
+->   memptr = (VOID *) mxMalloc((unsigned int) size);
+->   //memptr = (VOID *) malloc((unsigned int) size);
+-1447c1543,1544
+-<   free(memptr);
+----
+->   //free(memptr);
+->   mxFree(memptr);
+-3665,3670c3762,3767
+-< void printtriangle(struct mesh *m, struct behavior *b, struct otri *t)
+-< #else /* not ANSI_DECLARATORS */
+-< void printtriangle(m, b, t)
+-< struct mesh *m;
+-< struct behavior *b;
+-< struct otri *t;
+----
+-> void printtriangle(struct mesh *m, struct behavior *b, struct otri *t){
+-> //#else /* not ANSI_DECLARATORS */
+-> //void printtriangle(m, b, t)
+-> //struct mesh *m;
+-> //struct behavior *b;
+-> //struct otri *t;
+-3673c3770
+-< {
+----
+-> //{
+-4910c5007
+-<   _FPU_SETCW(cword);
+----
+->   //_FPU_SETCW(cword); //taken care of by Matlab
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-matlab.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-matlab.sh	(revision 12814)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-matlab.sh	(revision 12815)
+@@ -1,26 +0,0 @@
+-#!/bin/bash
+-
+-#Some 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
+-
+-#copy new makefile
+-cp ../configs/linux64/configure.make ./
+-cp ../makefile ./
+-
+-#Patch triangle.c 
+-patch triangle.c ../triangle.c.patch.matlab
+-
+-#Compile triangle
+-make
+-
+-#Patch triangle.h
+-patch triangle.h ../triangle.h.patch
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/triangle.c.patch.python
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/triangle.c.patch.python	(revision 12814)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/triangle.c.patch.python	(revision 12815)
+@@ -1,164 +0,0 @@
+-0a1,10
+-> /*Notes for the Ice code: 
+->  * to be able to compile Triangle within a mex function that can run within 
+->  * matlab, we had to change the allocation routine trimalloc, as well as the 
+->  * double precision activation in exactinit(); The rest is not changed. 
+->  * We also created the ice_makefile to compile Triangle into a library. */
+-> /* #include <mat.h>
+-> #include <matrix.h> */
+-> #define ANSI_DECLARATORS
+-> #define NO_TIMER
+-> 
+-347a358
+-> #ifndef _WIN_
+-348a360
+-> #endif
+-641d652
+-< 
+-817a829,922
+-> /*Some missing prototypes: */
+-> int scale_expansion_zeroelim(int elen, REAL *e, REAL b, REAL *h);
+-> int fast_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f, REAL *h);
+-> void poolzero(struct memorypool *pool);
+-> int triunsuitable(vertex triorg, vertex tridest, vertex triapex, REAL area);
+-> triangle *triangletraverse(struct mesh *m);
+-> void pooldeinit(struct memorypool *pool);
+-> void printtriangle(struct mesh *m, struct behavior *b, struct otri *t);
+-> VOID *poolalloc(struct memorypool *pool);
+-> void enqueuebadtriang(struct mesh *m, struct behavior *b,
+->                       struct badtriang *badtri);
+-> void triangulatepolygon(struct mesh *m, struct behavior *b,
+->                         struct otri *firstedge, struct otri *lastedge,
+->                         int edgecount, int doflip, int triflaws);
+-> void triangledealloc(struct mesh *m, triangle *dyingtriangle);
+-> void unflip(struct mesh *m, struct behavior *b, struct otri *flipedge);
+-> void vertexmedian(vertex *sortarray, int arraysize, int median, int axis);
+-> REAL counterclockwiseadapt(vertex pa, vertex pb, vertex pc, REAL detsum);
+-> REAL incircleadapt(vertex pa, vertex pb, vertex pc, vertex pd, REAL permanent);
+-> void enqueuebadtri(struct mesh *m, struct behavior *b, struct otri *enqtri,
+->                    REAL minedge, vertex enqapex, vertex enqorg, vertex enqdest);
+-> void alternateaxes(vertex *sortarray, int arraysize, int axis);
+-> REAL incircleadapt(vertex pa, vertex pb, vertex pc, vertex pd, REAL permanent);
+-> void maketriangle(struct mesh *m, struct behavior *b, struct otri *newotri);
+-> REAL counterclockwise(struct mesh *m, struct behavior *b,
+->                       vertex pa, vertex pb, vertex pc);
+-> vertex vertextraverse(struct mesh *m);
+-> void mergehulls(struct mesh *m, struct behavior *b, struct otri *farleft,
+->                 struct otri *innerleft, struct otri *innerright,
+->                 struct otri *farright, int axis);
+-> REAL incircle(struct mesh *m, struct behavior *b,
+->               vertex pa, vertex pb, vertex pc, vertex pd);
+-> void poolrestart(struct memorypool *pool);
+-> void trifree(VOID *memptr);
+-> struct splaynode *splay(struct mesh *m, struct splaynode *splaytree,
+->                         vertex searchpoint, struct otri *searchtri);
+-> void eventheapdelete(struct event **heap, int heapsize, int eventnum);
+-> void eventheapdelete(struct event **heap, int heapsize, int eventnum);
+-> void flip(struct mesh *m, struct behavior *b, struct otri *flipedge);
+-> void check4deadevent(struct otri *checktri, struct event **freeevents,
+->                      struct event **eventheap, int *heapsize);
+-> REAL orient3d(struct mesh *m, struct behavior *b,
+->               vertex pa, vertex pb, vertex pc, vertex pd,
+->               REAL aheight, REAL bheight, REAL cheight, REAL dheight);
+-> REAL circletop(struct mesh *m, vertex pa, vertex pb, vertex pc, REAL ccwabc);
+-> void poolinit(struct memorypool *pool, int bytecount, int itemcount,
+->               int firstitemcount, int alignment);
+-> void eventheapinsert(struct event **heap, int heapsize, struct event *newevent);
+-> int rightofhyperbola(struct mesh *m, struct otri *fronttri, vertex newsite);
+-> void insertsubseg(struct mesh *m, struct behavior *b, struct otri *tri,
+->                   int subsegmark);
+-> int scoutsegment(struct mesh *m, struct behavior *b, struct otri *searchtri,
+->                  vertex endpoint2, int newmark);
+-> vertex getvertex(struct mesh *m, struct behavior *b, int number);
+-> void internalerror();
+-> unsigned long randomnation(unsigned int choices);
+-> struct splaynode *splayinsert(struct mesh *m, struct splaynode *splayroot,
+->                               struct otri *newkey, vertex searchpoint);
+-> void delaunayfixup(struct mesh *m, struct behavior *b,
+->                    struct otri *fixuptri, int leftside);
+-> void traversalinit(struct memorypool *pool);
+-> enum insertvertexresult insertvertex(struct mesh *m, struct behavior *b,
+->                                      vertex newvertex, struct otri *searchtri,
+->                                      struct osub *splitseg,
+->                                      int segmentflaws, int triflaws);
+-> void conformingedge(struct mesh *m, struct behavior *b,
+->                     vertex endpoint1, vertex endpoint2, int newmark);
+-> enum finddirectionresult finddirection(struct mesh *m, struct behavior *b,
+->                                        struct otri *searchtri,
+->                                        vertex searchpoint);
+-> VOID *traverse(struct memorypool *pool);
+-> void deletevertex(struct mesh *m, struct behavior *b, struct otri *deltri);
+-> void pooldealloc(struct memorypool *pool, VOID *dyingitem);
+-> int checkseg4encroach(struct mesh *m, struct behavior *b,
+->                       struct osub *testsubseg);
+-> void badsubsegdealloc(struct mesh *m, struct badsubseg *dyingseg);
+-> void vertexdealloc(struct mesh *m, vertex dyingvertex);
+-> void vertexsort(vertex *sortarray, int arraysize);
+-> void tallyencs(struct mesh *m, struct behavior *b);
+-> void splittriangle(struct mesh *m, struct behavior *b,
+->                    struct badtriang *badtri);
+-> subseg *subsegtraverse(struct mesh *m);
+-> enum locateresult locate(struct mesh *m, struct behavior *b,
+->                          vertex searchpoint, struct otri *searchtri);
+-> void writenodes(struct mesh *m, struct behavior *b, REAL **pointlist,
+->                 REAL **pointattriblist, int **pointmarkerlist);
+-> void writevoronoi(struct mesh *m, struct behavior *b, REAL **vpointlist,
+->                   REAL **vpointattriblist, int **vpointmarkerlist,
+->                   int **vedgelist, int **vedgemarkerlist, REAL **vnormlist);
+-> void writeneighbors(struct mesh *m, struct behavior *b, int **neighborlist);
+-> void testtriangle(struct mesh *m, struct behavior *b, struct otri *testtri);
+-> void triangleinit(struct mesh *m);
+-> 
+-> 
+-1408a1514
+-> void triexit(int status);
+-1410d1515
+-< #ifdef ANSI_DECLARATORS
+-1412,1416d1516
+-< #else /* not ANSI_DECLARATORS */
+-< void triexit(status)
+-< int status;
+-< #endif /* not ANSI_DECLARATORS */
+-< 
+-1421c1521
+-< #ifdef ANSI_DECLARATORS
+----
+-> VOID *trimalloc(int size);
+-1423,1427d1522
+-< #else /* not ANSI_DECLARATORS */
+-< VOID *trimalloc(size)
+-< int size;
+-< #endif /* not ANSI_DECLARATORS */
+-< 
+-1431c1526,1527
+-<   memptr = (VOID *) malloc((unsigned int) size);
+----
+->   //memptr = (VOID *) mxMalloc((unsigned int) size);
+->   memptr = (VOID *) malloc((unsigned int) size);
+-1447c1543,1544
+-<   free(memptr);
+----
+->   free(memptr);
+->   //mxFree(memptr);
+-3665,3670c3762,3767
+-< void printtriangle(struct mesh *m, struct behavior *b, struct otri *t)
+-< #else /* not ANSI_DECLARATORS */
+-< void printtriangle(m, b, t)
+-< struct mesh *m;
+-< struct behavior *b;
+-< struct otri *t;
+----
+-> void printtriangle(struct mesh *m, struct behavior *b, struct otri *t){
+-> //#else /* not ANSI_DECLARATORS */
+-> //void printtriangle(m, b, t)
+-> //struct mesh *m;
+-> //struct behavior *b;
+-> //struct otri *t;
+-3673c3770
+-< {
+----
+-> //{
+-4910c5007
+-<   _FPU_SETCW(cword);
+----
+->   //_FPU_SETCW(cword); //taken care of by Matlab
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-python.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-python.sh	(revision 12814)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64-python.sh	(revision 12815)
+@@ -1,26 +0,0 @@
+-#!/bin/bash
+-
+-#Some 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
+-
+-#copy new makefile
+-cp ../configs/linux64/configure.make ./
+-cp ../makefile ./
+-
+-#Patch triangle.c 
+-patch triangle.c ../triangle.c.patch.python
+-
+-#Compile triangle
+-make
+-
+-#Patch triangle.h
+-patch triangle.h ../triangle.h.patch
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/triangle.c.patch
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/triangle.c.patch	(revision 12814)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/triangle.c.patch	(revision 12815)
+@@ -4,8 +4,8 @@
+ >  * matlab, we had to change the allocation routine trimalloc, as well as the 
+ >  * double precision activation in exactinit(); The rest is not changed. 
+ >  * We also created the ice_makefile to compile Triangle into a library. */
+-> #include <mat.h>
+-> #include <matrix.h>
++> /* #include <mat.h>
++> #include <matrix.h> */
+ > #define ANSI_DECLARATORS
+ > #define NO_TIMER
+ > 
+@@ -133,13 +133,13 @@
+ 1431c1526,1527
+ <   memptr = (VOID *) malloc((unsigned int) size);
+ ---
+->   memptr = (VOID *) mxMalloc((unsigned int) size);
+->   //memptr = (VOID *) malloc((unsigned int) size);
++>   //memptr = (VOID *) mxMalloc((unsigned int) size);
++>   memptr = (VOID *) malloc((unsigned int) size);
+ 1447c1543,1544
+ <   free(memptr);
+ ---
+->   //free(memptr);
+->   mxFree(memptr);
++>   free(memptr);
++>   //mxFree(memptr);
+ 3665,3670c3762,3767
+ < void printtriangle(struct mesh *m, struct behavior *b, struct otri *t)
+ < #else /* not ANSI_DECLARATORS */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 12814)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 12815)
+@@ -17,7 +17,7 @@
+ cp ../makefile ./
+ 
+ #Patch triangle.c 
+-patch triangle.c ../triangle.c.patch.matlab
++patch triangle.c ../triangle.c.patch
+ 
+ #Compile triangle
+ make
Index: /issm/oecreview/Archive/12678-13393/ISSM-12815-12816.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12815-12816.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12815-12816.diff	(revision 13394)
@@ -0,0 +1,59 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-macosx64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-macosx64.sh	(revision 12816)
+@@ -0,0 +1,35 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf install petsc-3.3-p2 src
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.3-p2.tar.gz' 'petsc-3.3-p2.tar.gz'
++
++#Untar and move petsc to install directory
++tar -zxvf  petsc-3.3-p2.tar.gz
++mv petsc-3.3-p2/* src/
++rm -rf petsc-3.3-p2
++
++#configure
++cd src
++./config/configure.py \
++	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
++	--with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
++	--PETSC_ARCH="macosx-gnu" \
++	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
++	--with-debugging=0 \
++	--with-shared-libraries=1 \
++	--download-mumps=yes \
++	--download-scalapack=yes \
++	--download-blacs=yes \
++	--download-blas=yes \
++	--download-f-blas-lapack=yes \
++	--download-plapack=yes \
++	--download-parmetis=yes \
++	--download-metis=yes 
++
++#Compile petsc and install it
++make
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-macosx64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh	(revision 12815)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh	(revision 12816)
+@@ -20,7 +20,7 @@
+ 	--PETSC_ARCH=linux-gnu-amd64 \
+ 	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+ 	--with-debugging=0 \
+-	--with-shared-libraries=0 \
++	--with-shared-libraries=1 \
+ 	--download-mumps=yes \
+ 	--download-scalapack=yes \
+ 	--download-blacs=yes \
Index: /issm/oecreview/Archive/12678-13393/ISSM-12816-12817.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12816-12817.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12816-12817.diff	(revision 13394)
@@ -0,0 +1,31 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 12816)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 12817)
+@@ -1,5 +1,9 @@
+ #!/bin/bash
+ 
++#use matlab? 
++matlab=0
++
++
+ #Some cleanup 
+ rm -rf install triangle
+ mkdir install
+@@ -16,9 +20,15 @@
+ cp ../configs/linux64/configure.make ./
+ cp ../makefile ./
+ 
++
+ #Patch triangle.c 
+-patch triangle.c ../triangle.c.patch
++if [[ $matlab == "1" ]];then
++	patch triangle.c ../triangle.c.patch.matlab
++else
++	patch triangle.c ../triangle.c.patch.python
++fi
+ 
++
+ #Compile triangle
+ make
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12817-12818.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12817-12818.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12817-12818.diff	(revision 13394)
@@ -0,0 +1,31 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 12817)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 12818)
+@@ -1,9 +1,5 @@
+ #!/bin/bash
+ 
+-#use matlab? 
+-matlab=0
+-
+-
+ #Some cleanup 
+ rm -rf install triangle
+ mkdir install
+@@ -20,15 +16,9 @@
+ cp ../configs/linux64/configure.make ./
+ cp ../makefile ./
+ 
+-
+ #Patch triangle.c 
+-if [[ $matlab == "1" ]];then
+-	patch triangle.c ../triangle.c.patch.matlab
+-else
+-	patch triangle.c ../triangle.c.patch.python
+-fi
++patch triangle.c ../triangle.c.patch
+ 
+-
+ #Compile triangle
+ make
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12818-12819.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12818-12819.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12818-12819.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12818)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12819)
+@@ -92,8 +92,8 @@
+ 		325 : 'SquareSheetConstrainedEnthalpyStea',
+ 		326 : 'SquareSheetConstrainedEnthalpyTran',
+ 		327 : 'SquareSheetConstrainedTransP3dEnth',
+-		328 : 'SquareSheetConstrainedSmbGradients2d';
+-		329 : 'SquareSheetConstrainedSmbGradients3d';
++		328 : 'SquareSheetConstrainedSmbGradients2d',
++		329 : 'SquareSheetConstrainedSmbGradients3d',
+ 		401 : 'SquareSheetShelfDiagM2d',
+ 		402 : 'SquareSheetShelfDiagM3d',
+ 		403 : 'SquareSheetShelfDiagP3d',
Index: /issm/oecreview/Archive/12678-13393/ISSM-12820-12821.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12820-12821.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12820-12821.diff	(revision 13394)
@@ -0,0 +1,36284 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Contour.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Contour.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Contour.h	(revision 12821)
+@@ -1,43 +0,0 @@
+-/*!\file Contour.h
+- * \brief: header file for Contour object
+- */
+-
+-#ifndef _CONTOUR_H_
+-#define _CONTOUR_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Object.h"
+-#include "../shared/Exceptions/exceptions.h"
+-#include "../toolkits/toolkits.h"
+-#include "../include/include.h"
+-/*}}}*/
+-
+-class Contour: public Object{
+-
+-	public: 
+-
+-		int     id;
+-		int	  nods;  //number of vertices in the contour
+-		IssmDouble* x;
+-		IssmDouble* y;
+-		bool    closed; //is this contour closed?
+-
+-		/*Contour constructors, destructors {{{*/
+-		Contour();
+-		Contour(int id, int nods, IssmDouble* x, IssmDouble* y,bool closed);
+-		~Contour();
+-		/*}}}*/
+-		/*Object virtual functions{{{*/
+-		void  Echo(void);
+-		void  DeepEcho(void);
+-		int   Id(void);
+-		int   MyRank(void);
+-		int   ObjectEnum(void);
+-		Object* copy(void);
+-		/*}}}*/
+-
+-
+-};
+-
+-#endif  /* _CONTOUR_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DofIndexing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DofIndexing.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DofIndexing.cpp	(revision 12821)
+@@ -1,210 +0,0 @@
+-/*!\file DofIndexing.c
+- * \brief: implementation of the DofIndexing object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include "./objects.h"
+-#include <string.h>
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-#include "../shared/shared.h"
+-#include "../Container/Container.h"
+-#include "../include/include.h"
+-
+-/*DofIndexing constructors and destructor*/
+-/*FUNCTION DofIndexing::DofIndexing(){{{*/
+-DofIndexing::DofIndexing(){
+-
+-	this->gsize=UNDEF;
+-	this->fsize=UNDEF;
+-	this->ssize=UNDEF;
+-	this->clone=0;
+-	this->f_set=NULL;
+-	this->s_set=NULL;
+-	this->svalues=NULL;
+-	this->doftype=NULL;
+-	this->gdoflist=NULL;
+-	this->fdoflist=NULL;
+-	this->sdoflist=NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DofIndexing::DofIndexing(int gsize){{{*/
+-DofIndexing::DofIndexing(int in_gsize){
+-	this->Init(in_gsize,NULL);
+-}
+-/*}}}*/
+-/*FUNCTION DofIndexing::DofIndexing(DofIndexing* in)  -> copy{{{*/
+-DofIndexing::DofIndexing(DofIndexing* in){ //copy constructor
+-
+-	int i;
+-	this->gsize=in->gsize;
+-	this->fsize=in->fsize;
+-	this->ssize=in->ssize;
+-	
+-	this->clone=in->clone;
+-
+-	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); 
+-		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->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->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 && 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));
+-
+-}
+-/*}}}*/
+-/*FUNCTION DofIndexing::~DofIndexing() {{{*/
+-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);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DofIndexing::Init{{{*/
+-void DofIndexing::Init(int in_gsize,int* in_doftype){
+-
+-	int i;
+-	this->gsize=in_gsize;
+-	
+-	this->clone=0;
+-
+-	/*allocate: */
+-	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);
+-		this->gdoflist=xNew<int>(this->gsize);
+-	}
+-
+-	for (i=0;i<this->gsize;i++){
+-		/*assume dof is free, no constraints, no rigid body constraint: */
+-		this->f_set[i]=true;
+-		this->s_set[i]=false;
+-		if(this->doftype)this->doftype[i]=in_doftype[i];
+-		this->svalues[i]=0; //0 constraint is the default value
+-		this->gdoflist[i]=UNDEF;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION DofIndexing::InitSet{{{*/
+-void DofIndexing::InitSet(int setenum){
+-
+-	int i;
+-	int size=0;
+-
+-	/*go through sets, and figure out how many dofs belong to this set, except for g-set, 
+-	 * which has already been initialized: */
+-	if(setenum==FsetEnum){
+-		size=0;
+-		for(i=0;i<this->gsize;i++) if(f_set[i])size++;
+-		this->fsize=size;
+-		xDelete<int>(this->fdoflist);
+-		if(this->fsize)this->fdoflist=xNew<int>(size);
+-		else this->fdoflist=NULL;
+-	}
+-	else if(setenum==SsetEnum){
+-		size=0;
+-		for(i=0;i<this->gsize;i++) if(s_set[i])size++;
+-		this->ssize=size;
+-		xDelete<int>(this->sdoflist);
+-		if(this->ssize)this->sdoflist=xNew<int>(size);
+-		else this->sdoflist=NULL;
+-	}
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-}
+-/*}}}*/
+-
+-/*Some of the Object functionality: */
+-/*FUNCTION DofIndexing::Echo{{{*/
+-void DofIndexing::Echo(void){
+-
+-	int i;
+-
+-	_printLine_("DofIndexing:");
+-	_printLine_("   gsize: " << gsize);
+-	_printLine_("   clone: " << clone);
+-}
+-/*}}}*/
+-/*FUNCTION DofIndexing::DeepEcho{{{*/
+-void DofIndexing::DeepEcho(void){
+-
+-	int i;
+-
+-	_printLine_("DofIndexing:");
+-	_printLine_("   gsize: " << gsize);
+-	_printLine_("   fsize: " << fsize);
+-	_printLine_("   ssize: " << ssize);
+-	_printLine_("   clone: " << clone);
+-	
+-	_printLine_("   set membership: f,s sets ");
+-	for(i=0;i<gsize;i++){
+-		_printLine_("      dof " << i << ": " <<(f_set[i]?"true":"false")<< " " <<(s_set[i]?"true":"false"));
+-	}
+-
+-	_printString_("   svalues (" << this->ssize << "): |");
+-	for(i=0;i<this->gsize;i++){
+-		if(this->s_set[i])_printString_(" " << svalues[i] << " |");
+-	}
+-	_printLine_("");
+-
+-	if(doftype){
+-		_printString_("   doftype: |");
+-		for(i=0;i<gsize;i++){
+-			_printString_(" " << doftype[i] << " |");
+-		}
+-		_printLine_("");
+-	}
+-	else _printLine_("   doftype: NULL");
+-
+-	_printString_("   g_doflist (" << this->gsize << "): |");
+-	for(i=0;i<this->gsize;i++){
+-		_printString_(" " << gdoflist[i] << " |");
+-	}
+-	_printLine_("");
+-
+-	_printString_("   f_doflist (" << this->fsize << "): |");
+-	for(i=0;i<this->fsize;i++){
+-		_printString_(" " << fdoflist[i] << " |");
+-	}
+-	_printLine_("");
+-
+-	_printString_("   s_doflist (" << this->ssize << "): |");
+-	for(i=0;i<this->ssize;i++){
+-		_printString_(" " << sdoflist[i] << " |");
+-	}
+-	_printLine_("");
+-}		
+-/*}}}*/
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Segment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Segment.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Segment.cpp	(revision 12821)
+@@ -1,86 +0,0 @@
+-/*!\file Segment.c
+- * \brief: implementation of the Segment object
+- */
+-
+-/*Include files: {{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "./objects.h"
+-#include "../Container/Container.h"
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-#include "../shared/shared.h"
+-#include "../include/include.h"
+-/*}}}*/
+-
+-/*Segment constructors and destructors:*/
+-/*FUNCTION Segment::Segment() default constructor {{{*/
+-Segment::Segment(){
+-	this->eid=UNDEF;
+-	this->x1=UNDEF;
+-	this->y1=UNDEF;
+-	this->x2=UNDEF;
+-	this->y2=UNDEF;
+-}
+-/*}}}*/
+-/*FUNCTION Segment::Segment(int eid, IssmDouble x1,IssmDouble y1,IssmDouble x2, IssmDouble y2){{{*/
+-Segment::Segment(int segment_eid, IssmDouble segment_x1,IssmDouble segment_y1,IssmDouble segment_x2, IssmDouble segment_y2){
+-
+-	this->eid=segment_eid;
+-	this->x1=segment_x1;
+-	this->y1=segment_y1;
+-	this->x2=segment_x2;
+-	this->y2=segment_y2;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Segment::~Segment(){{{*/
+-Segment::~Segment(){
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Segment::Echo{{{*/
+-void Segment::Echo(void){
+-
+-	_printLine_("Segment:");
+-	_printLine_("   eid: " << eid);
+-	_printLine_("   node 1: " << this->x1 << "|" << this->y1);
+-	_printLine_("   node 2: " << this->x2 << "|" << this->y2);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Segment::DeepEcho{{{*/
+-void Segment::DeepEcho(void){
+-	this->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION Segment::Id{{{*/
+-int    Segment::Id(void){ return eid; }
+-/*}}}*/
+-/*FUNCTION Segment::MyRank{{{*/
+-int    Segment::MyRank(void){ 
+-	extern int my_rank;
+-
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Segment::ObjectEnum{{{*/
+-int Segment::ObjectEnum(void){
+-
+-	return SegmentEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Segment::copy {{{*/
+-Object* Segment::copy() {
+-	return new Segment(this->eid,this->x1,this->y1,this->x2,this->y2);
+-
+-}
+-
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Patch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Patch.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Patch.h	(revision 12821)
+@@ -1,46 +0,0 @@
+-/*!\file: Patch.h
+- * \brief prototypes for Patch.h
+- */ 
+-
+-/*A Patch object is used to store all results held in elements, in a serial way, and to dump them to disk. 
+-	
+-	Each row of the Patch object is made of the following information: 
+-	- the result enum_type, 
+-	- the step and time, 
+-	- the id of the element, 
+-	- the interpolation type, 
+-	- the vertices ids, 
+-	- and the values at the nodes (could be different from the vertices).
+-	
+-	For ex: 
+-	1. on a Beam element, Vx, at step 1, time .5, element id 1, interpolation type P0 (constant), vertices ids 1 and 2, one constant value 4.5
+-	   VxEnum 1  .5  1 P0  1 2       4.5 NaN  NaN
+-	2. on a Tria element, Vz, at step 2, time .8, element id 2, interpolation type P1 (linear), vertices ids 1 3 and 4, with values at 3 nodes 4.5, 3.2, 2.5
+-	   VzEnum 2  .8  2 P1  1 3 4     4.5 3.2  2.5
+-*/
+-
+-
+-#ifndef _PATCH_H_
+-#define  _PATCH_H_
+-
+-/*Headers:*/
+-class Patch{
+-
+-	public:
+-
+-		int     numrows; //number of results held in Patch object
+-		int     numcols; //number of columns
+-		int     maxvertices; //maxvertices corresponds to largest amount of vertices on a given element, determined by the geometry.
+-		int     maxnodes;    // maxnodes corresponds to the largest amout of nodes on a given element, determined by the interpolation type.
+-		
+-		IssmDouble* values;  //result values
+-
+-		Patch();
+-		Patch(int numrows, int maxvertices, int maxnodes);
+-		~Patch();
+-		void fillelementinfo(int row, int element_id, int* vertices_ids, int num_vertices);
+-		void fillresultinfo(int row,int enum_type,int step, IssmDouble time, int interpolation, IssmDouble* nodal_values, int num_nodes);
+-		void Gather(void);
+-
+-};
+-#endif //ifndef _PATCH_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Hook.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Hook.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Hook.h	(revision 12821)
+@@ -1,50 +0,0 @@
+-/*!\file Hook.h
+- * \brief: header file for hook object.
+- * A hook is a class  that can store the id, offset, and object corresponding to this id and offset into a dataset.
+- * For example, an element has a hook to its nodes. A node has a hook to its vertex.  The hook abstracts the need for having
+- * ids and offsets (necesarry for proper configuration of an object) in our objects. 
+- */
+-
+-#ifndef _HOOK_H_
+-#define _HOOK_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Object.h"
+-class DataSet;
+-/*}}}*/
+-
+-class Hook{
+-
+-	private: 
+-
+-		int	   num; //number of objects being hooked onto
+-		Object**	   objects; //list of object pointers. we do not allocate objects, just a list a pointers, that will get to point to the real objects from a dataset.
+-		int*   ids;     //list of object ids, to go look for them in datasets.
+-		int*   offsets;  //list of object offsets into datasets, to speed up lookup.
+-
+-	public:
+-
+-		/*Hook constructors, destructors: {{{*/
+-		Hook();
+-		Hook(int* ids, int num);
+-		~Hook();
+-		/*}}}*/
+-		/*Object like functionality:{{{*/
+-		void       Echo(void);
+-		void       DeepEcho(void);
+-		Object*    copy(void);
+-		/*}}}*/
+-		/*Hook management: {{{*/
+-		Object*    delivers(void); //single object deliver
+-		Object**   deliverp(void); //deliver all objects
+-		void       configure(DataSet* dataset);
+-		Hook*      Spawn(int* indices, int numindices);
+-		Object**   GetObjects(void);
+-		int*       Ids(void);
+-		int*       GetOffsets(void);
+-		int        GetNum(void);
+-		/*}}}*/
+-};
+-
+-#endif  /* _HOOK_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Vertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Vertex.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Vertex.cpp	(revision 12821)
+@@ -1,218 +0,0 @@
+-/*!\file Vertex.c
+- * \brief: implementation of the Vertex object
+- */
+-
+-/*Include files: {{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <string.h>
+-#include "./objects.h"
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-#include "../shared/shared.h"
+-#include "../include/include.h"
+-/*}}}*/
+-
+-/*Vertex constructors and destructor:*/
+-/*FUNCTION Vertex::Vertex() {{{*/
+-Vertex::Vertex(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::Vertex(int vertex_id, IssmDouble vertex_x, IssmDouble vertex_y, IssmDouble vertex_z, IssmDouble vertex_sigma){{{*/
+-Vertex::Vertex(int vertex_id, int vertex_sid,IssmDouble vertex_x, IssmDouble vertex_y, IssmDouble vertex_z, IssmDouble vertex_sigma,int vertex_connectivity){
+-	this->Init(vertex_id, vertex_sid,vertex_x, vertex_y, vertex_z, vertex_sigma,vertex_connectivity);
+-}
+-/*}}}*/
+-/*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){
+-
+-	_assert_(iomodel->Data(MeshXEnum) && iomodel->Data(MeshYEnum) && iomodel->Data(MeshZEnum));
+-	_assert_(iomodel->Data(BedEnum) && iomodel->Data(ThicknessEnum) && iomodel->numbernodetoelementconnectivity);
+-
+-	this->Init(vertex_id, vertex_sid, iomodel->Data(MeshXEnum)[i],iomodel->Data(MeshYEnum)[i],iomodel->Data(MeshZEnum)[i],(iomodel->Data(MeshZEnum)[i]-iomodel->Data(BedEnum)[i])/(iomodel->Data(ThicknessEnum)[i]),iomodel->numbernodetoelementconnectivity[i]);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::~Vertex() {{{*/
+-Vertex::~Vertex(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::Init{{{*/
+-void Vertex::Init(int vertex_id, int vertex_sid,IssmDouble vertex_x, IssmDouble vertex_y, IssmDouble vertex_z, IssmDouble vertex_sigma,int vertex_connectivity){
+-
+-	/*all the initialization has been done by the initializer, just fill in the id: */
+-	this->id=vertex_id;
+-	this->sid=vertex_sid;
+-	this->x=vertex_x;
+-	this->y=vertex_y;
+-	this->z=vertex_z;
+-	this->sigma=vertex_sigma;
+-	this->connectivity=vertex_connectivity;
+-	this->dof=UNDEF;
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Vertex::Echo{{{*/
+-void Vertex::Echo(void){
+-
+-	_printLine_("Vertex:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   sid: " << sid);
+-	_printLine_("   x: " << x);
+-	_printLine_("   y: " << y);
+-	_printLine_("   z: " << z);
+-	_printLine_("   sigma: " << sigma);
+-	_printLine_("   connectivity: " << connectivity);
+-	_printLine_("   dof: " << dof);
+-	_printLine_("   clone: " << clone);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::DeepEcho{{{*/
+-void Vertex::DeepEcho(void){
+-	this->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::Id{{{*/
+-int    Vertex::Id(void){ return id; }
+-/*}}}*/
+-/*FUNCTION Vertex::MyRank {{{*/
+-int    Vertex::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::ObjectEnum{{{*/
+-int Vertex::ObjectEnum(void){
+-
+-	return VertexEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::copy {{{*/
+-Object* Vertex::copy() {
+-
+-	return new Vertex(*this); 
+-
+-}
+-/*}}}*/
+-
+-/* DofObject routines: */
+-/*FUNCTION Vertex::DistributeDofs{{{*/
+-void  Vertex::DistributeDofs(int* pdofcount){
+-
+-	int i;
+-	extern int my_rank;
+-	int dofcount;
+-
+-	dofcount=*pdofcount;
+-	
+-	if(this->clone){
+-		/*This vertex is a clone! Don't distribute dofs, it will get them from another cpu!*/
+-		return;
+-	}
+-
+-	/*This vertex should distribute his dof, go ahead: */
+-	this->dof=dofcount;
+-	dofcount++;
+-
+-	/*Assign output pointers: */
+-	*pdofcount=dofcount;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::OffsetDofs{{{*/
+-void  Vertex::OffsetDofs(int dofcount){
+-	
+-	int i;
+-	extern int my_rank;
+-	
+-	if(this->clone){
+-		/*This vertex is a clone, don't offset the dofs!: */
+-		return;
+-	}
+-
+-	/*This vertex should offset his dof, go ahead: */
+-	this->dof+=dofcount;
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::ShowTrueDofs{{{*/
+-void  Vertex::ShowTrueDofs(int* truedofs){
+-
+-	int j;
+-	extern int my_rank;
+-	
+-	/*Are we a clone? : */
+-	if(this->clone)return;
+-
+-	/*Ok, we are not a clone, just plug our dof into truedofs: */
+-	truedofs[this->id-1]=this->dof;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::UpdateCloneDofs{{{*/
+-void  Vertex::UpdateCloneDofs(int* alltruedofs){
+-
+-	int j;
+-	extern int my_rank;
+-	
+-	/*If we are not a clone, don't update, we already have dofs!: */
+-	if(this->clone==0)return;
+-
+-	/*Ok, we are a clone node, but we did not create the dof for this vertex 
+-	 * Therefore, our dof is garbage right now. Go pick it up in the alltruedofs: */
+-	this->dof=alltruedofs[id-1];
+-}
+-/*}}}*/
+-/*FUNCTION Vertex::SetClone {{{*/
+-void  Vertex::SetClone(int* minranks){
+-
+-	extern int my_rank;
+-
+-	if (minranks[id-1]==my_rank){
+-		this->clone=0;
+-	}
+-	else{
+-		/*!there is a cpu with lower rank that has the same vertex, 
+-		therefore, I am a clone*/
+-		this->clone=1; 	
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Vertex management: */
+-/*FUNCTION Vertex::Connectivity{{{*/
+-int    Vertex::Connectivity(void){return connectivity;}
+-/*}}}*/
+-/*FUNCTION Vertex::Sid{{{*/
+-int    Vertex::Sid(void){ return sid; }
+-/*}}}*/
+-/*FUNCTION Vertex::UpdateVertexPosition {{{*/
+-void  Vertex::UpdatePosition(Vector* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed){
+-
+-	IssmDouble oldz,newz;
+-	IssmDouble dt,velz;
+-
+-	/*Get time stepping*/
+-	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-
+-	/*sigma remains constant. z=bed+sigma*thickness*/
+-	oldz = this->z;
+-	newz = bed[this->dof]+sigma*thickness[this->dof];
+-	velz = (newz-oldz)/dt;
+-	this->z = newz;
+-
+-	/*put vz in vector*/
+-	vz->SetValue(this->dof,velz,INS_VAL);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DakotaPlugin.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DakotaPlugin.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DakotaPlugin.cpp	(revision 12821)
+@@ -1,118 +0,0 @@
+-/*!\file:  DakotaPlugin.cpp (see DakotaPlugin.h for explanations)
+- * \brief  header file for derived DirectApplicInterface class. 
+- * \sa SpwanCore.cpp and \sa qmu.cpp
+- *
+- * This class needs to be understood simultaneously with qmu.cpp and SpwanCore.cpp. 
+- * This call is derived from the Dakota DirectApplicInterface class. This is the 
+- * only way to plug ISSM's own routines into the Dakota engine. The derived class 
+- * has one function called derived_map_ac, which is called by Dakota to drive the 
+- * entire snesitivity analysis. 
+- *
+- * We use this routine (which gets variables, variable_descriptors from the Dakota 
+- * engine, and requests responses from the ISSM solution sequences), to call our 
+- * own solutoin cores. This routines calls the SpawnCore routine, which will drive 
+- * the entire computations. 
+- */ 
+-
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-/*Standard ISSM includes: */
+-#include "../shared/shared.h"
+-#include "../include/include.h"
+-#include "../objects/objects.h"
+-#include "../modules/Dakotax/Dakotax.h"
+-
+-/*Standard includes: */
+-#include <string>
+-
+-#ifdef _HAVE_DAKOTA_ //only works if dakota library has been compiled in.
+-
+-//Dakota headers
+-#include "DakotaResponse.H"
+-#include "ParamResponsePair.H"
+-#include "DakotaPlugin.h"
+-#include "system_defs.h"
+-#include "ProblemDescDB.H"
+-#include "ParallelLibrary.H"
+-
+-namespace SIM {
+-
+-//constructor
+-DakotaPlugin::DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* in_femmodel):Dakota::DirectApplicInterface(problem_db){
+-
+-
+-	femmodel=in_femmodel;
+-	counter=0;
+-}
+-
+-//destructor
+-DakotaPlugin::~DakotaPlugin(){ /* Virtual destructor handles referenceCount at Interface level. */ }
+-
+-int DakotaPlugin::derived_map_ac(const Dakota::String& driver) {
+-
+-	int i;
+-	IssmDouble* variables=NULL;
+-	char** variable_descriptors=NULL;
+-	char*  variable_descriptor=NULL;
+-	IssmDouble* responses=NULL;
+-
+-	/*increae counter: */
+-	counter++;
+-
+-	/*Before launching analysis, we need to transfer the dakota inputs into Issm 
+-	 *readable variables: */
+-
+-	/*First, the variables: */
+-	variables=xNew<IssmDouble>(numACV);
+-	for(i=0;i<numACV;i++){
+-		variables[i]=xC[i];
+-	}
+-	/*The descriptors: */
+-	variable_descriptors=xNew<char*>(numACV);
+-	for(i=0;i<numACV;i++){
+-		string label=xCLabels[i];
+-		variable_descriptor=xNew<char>(strlen(label.c_str())+1);
+-		memcpy(variable_descriptor,label.c_str(),(strlen(label.c_str())+1)*sizeof(char));
+-
+-		
+-		variable_descriptors[i]=variable_descriptor;
+-	}
+-
+-	/*Initialize responses: */
+-	responses=xNewZeroInit<IssmDouble>(numFns);
+-
+-	/*run core solution: */
+-	SpawnCore(responses,numFns, variables,variable_descriptors,numACV,femmodel,counter);
+-
+-	/*populate responses: */
+-	for(i=0;i<numFns;i++){
+-		fnVals[i]=responses[i];
+-	}
+-
+-
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(variables);
+-	for(i=0;i<numACV;i++){
+-		variable_descriptor=variable_descriptors[i];
+-		xDelete<char>(variable_descriptor);
+-	}
+-	xDelete<char*>(variable_descriptors);
+-	xDelete<IssmDouble>(responses);
+-
+-	return 0;
+-}
+-  
+-
+-int DakotaPlugin::GetCounter(){
+-	return counter;
+-}
+-
+-} // namespace SIM
+-
+-
+-#endif //only works if dakota library has been compiled in.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomSubDomain.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomSubDomain.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomSubDomain.h	(revision 12821)
+@@ -1,23 +0,0 @@
+-#ifndef _GEOMETRICALSUBDOMAIN_H_
+-#define _GEOMETRICALSUBDOMAIN_H_
+-
+-#include "./include.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class GeomEdge;
+-	class Geometry;
+-
+-	class GeomSubDomain {
+-		public:
+-			GeomEdge *edge;
+-			int              direction;   // -1 or 1
+-			long             ReferenceNumber;
+-
+-			//Methods
+-			void Set(const GeomSubDomain &,const Geometry & ,const Geometry &);
+-	};
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Geometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Geometry.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Geometry.h	(revision 12821)
+@@ -1,68 +0,0 @@
+-#ifndef _GEOMETRY_H_
+-#define _GEOMETRY_H_
+-
+-#include "./include.h"
+-#include "./BamgGeom.h"
+-#include "./BamgOpts.h"
+-#include "./GeomVertex.h"
+-#include "./GeomEdge.h"
+-#include "./Curve.h"
+-
+-namespace bamg {
+-
+-	class Triangle;
+-	class BamgQuadtree;
+-	class GeomSubDomain;
+-	class Edge;
+-
+-	class Geometry { 
+-
+-		public:
+-
+-			long           NbRef;                 // counter of ref on the this class if 0 we can delete
+-			long           nbv;                   // number of vertices
+-			long           nbe;                   // number of edges
+-			long           nbsubdomains;
+-			long           nbcurves;
+-			GeomVertex    *vertices;
+-			GeomEdge      *edges;
+-			BamgQuadtree  *quadtree;
+-			GeomSubDomain *subdomains;
+-			Curve         *curves;
+-			R2             pmin,pmax;             // domain extrema coordinates
+-			double         coefIcoor;             // coef to integer Icoor1;
+-			double         MaxCornerAngle;
+-
+-			//Constructor/Destructors
+-			~Geometry(); 
+-			Geometry();
+-			Geometry(const Geometry & Gh);
+-			Geometry(BamgGeom* bamggeom, BamgOpts* bamgopts);
+-
+-			//Operators
+-			const GeomVertex &operator[](long i) const { return vertices[i]; };
+-			GeomVertex       &operator[](long i) { return vertices[i];       };
+-			const GeomEdge   &operator()(long i) const { return edges[i];    };
+-			GeomEdge         &operator()(long  i) { return edges[i];         };
+-
+-			//Methods
+-			void             Echo();
+-			I2               R2ToI2(const R2 &P) const;
+-			double           MinimalHmin();
+-			double           MaximalHmax();
+-			void             ReadGeometry(BamgGeom *bamggeom, BamgOpts*bamgopts);
+-			void             Init(void);
+-			void             PostRead();
+-			long             GetId(const GeomVertex &t) const;
+-			long             GetId(const GeomVertex *t) const;
+-			long             GetId(const GeomEdge &t) const;
+-			long             GetId(const GeomEdge *t) const;
+-			long             GetId(const Curve *c) const;
+-			void             UnMarkEdges();
+-			GeomEdge *ProjectOnCurve(const Edge &,double,BamgVertex &,VertexOnGeom &) const;
+-			GeomEdge *Containing(const R2 P, GeomEdge *start) const;
+-			void             WriteGeometry(BamgGeom *bamggeom, BamgOpts*bamgopts);
+-	};
+-	
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.cpp	(revision 12821)
+@@ -1,425 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "../objects.h"
+-
+-namespace bamg {
+-
+-	/*Constructors Destructors*/
+-	/*FUNCTION ListofIntersectionTriangles::ListofIntersectionTriangles{{{*/
+-	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(){
+-		if (lIntTria) delete [] lIntTria,lIntTria=0;
+-		if (lSegsI) delete [] lSegsI,lSegsI=0;
+-	} 
+-	/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION ListofIntersectionTriangles::Init{{{*/
+-	void ListofIntersectionTriangles::Init(void){
+-		state=0;
+-		len=0;
+-		Size=0;
+-	}
+-	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::Length{{{*/
+-	double  ListofIntersectionTriangles::Length(){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Length)*/
+-
+-		// computation of the length
+-
+-		// check Size
+-		if (Size<=0){
+-			_error2_("Size<=0");
+-		}
+-
+-		Metric Mx,My;
+-		int ii,jj;
+-		R2 x,y,xy;
+-
+-		SegInterpolation* SegI=lSegsI;
+-		SegI=lSegsI;
+-		lSegsI[NbSeg].last=Size;
+-		int EndSeg=Size;
+-
+-		y = lIntTria[0].x;
+-		double sxy, s = 0;
+-		lIntTria[0].s =0;
+-		SegI->lBegin=s;
+-
+-		for (jj=0,ii=1;ii<Size;jj=ii++) {  
+-			// seg jj,ii
+-			x  = y;
+-			y  = lIntTria[ii].x;
+-			xy = y-x;
+-			Mx = lIntTria[ii].m;
+-			My = lIntTria[jj].m;
+-			sxy= LengthInterpole(Mx,My,xy);
+-			s += sxy;
+-			lIntTria[ii].s = s;
+-			if (ii == EndSeg){
+-				SegI->lEnd=s;
+-				SegI++;
+-				EndSeg=SegI->last;
+-				SegI->lBegin=s;
+-			}
+-		}
+-		len = s;
+-		SegI->lEnd=s;
+-
+-		return s;
+-	}
+-	/*}}}*/
+-	/*FUNCTION 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)*/
+-
+-		register int n;
+-		R2 x(0,0);
+-		if ( d0) x =      (*tt)[0].r * d0;
+-		if ( d1) x = x +  (*tt)[1].r * d1;
+-		if ( d2) x = x +  (*tt)[2].r * d2;
+-		// newer add same point 
+-		if(!Size ||  Norme2_2(lIntTria[Size-1].x-x)) {
+-			if (Size==MaxSize) ReShape();
+-			lIntTria[Size].t=tt;
+-			lIntTria[Size].bary[0]=d0;
+-			lIntTria[Size].bary[1]=d1;
+-			lIntTria[Size].bary[2]=d2;
+-			lIntTria[Size].x = x;
+-			Metric m0,m1,m2;
+-			register BamgVertex * v;
+-			if ((v=(*tt)(0))) m0    = v->m;
+-			if ((v=(*tt)(1))) m1    = v->m;
+-			if ((v=(*tt)(2))) m2    = v->m;
+-			lIntTria[Size].m =  Metric(lIntTria[Size].bary,m0,m1,m2);
+-			n=Size++;}
+-		else n=Size-1;
+-		return n;
+-	}
+-	/*}}}*/
+-	/*FUNCTION 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)*/
+-
+-		register int n;
+-		if(!Size ||  Norme2_2(lIntTria[Size-1].x-A)) {
+-			if (Size==MaxSize) ReShape();
+-			lIntTria[Size].t=0;
+-			lIntTria[Size].x=A;
+-			lIntTria[Size].m=mm;
+-			n=Size++;
+-		}
+-		else  n=Size-1;
+-		return  n; 
+-	}
+-	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::NewPoints{{{*/
+-	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
+-		double s=Length();
+-		if (s<1.5) return 0;
+-
+-		const long nbvold=nbv;
+-		int ii = 1 ;
+-		R2 y,x;
+-		Metric My,Mx ;
+-		double sx =0,sy;
+-		int nbi=Max(2,(int) (s+0.5));
+-		double sint=s/nbi;
+-		double si  =sint;
+-
+-		int EndSeg=Size;
+-		SegInterpolation* SegI=NULL;
+-		if (NbSeg) SegI=lSegsI,EndSeg=SegI->last;
+-
+-		for (int k=1;k<nbi;k++){
+-			while ((ii < Size) && ( lIntTria[ii].s <= si )){
+-				if (ii++ == EndSeg){
+-					SegI++;
+-					EndSeg=SegI->last;
+-				}
+-			}
+-
+-			int ii1=ii-1;
+-			x  =lIntTria[ii1].x;
+-			sx =lIntTria[ii1].s;
+-			Metric Mx=lIntTria[ii1].m;
+-			y  =lIntTria[ii].x;
+-			sy =lIntTria[ii].s;
+-			Metric My=lIntTria[ii].m;
+-			double lxy = sy-sx;
+-			double cy = abscisseInterpole(Mx,My,y-x,(si-sx)/lxy);
+-
+-			R2 C;
+-			double cx = 1-cy;
+-			C = SegI ? SegI->F(si): x * cx + y *cy;
+-			//C.Echo();
+-			//x.Echo();
+-			//y.Echo();
+-			//_printLine_("cx = " << cx << ", cy=" << cy);
+-
+-			si += sint;
+-			if ( nbv<maxnbv) {
+-				vertices[nbv].r = C;
+-				vertices[nbv++].m = Metric(cx,lIntTria[ii-1].m,cy,lIntTria[ii].m);
+-			}
+-			else return nbv-nbvold;
+-		  }
+-		return nbv-nbvold;
+-	}
+-	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::NewSubSeg{{{*/
+-	void  ListofIntersectionTriangles::NewSubSeg(GeomEdge *e,double s0,double s1){ 
+-		long int verbosity=0;
+-		if (NbSeg>=MaxNbSeg) {
+-			int mneo= MaxNbSeg;
+-			MaxNbSeg *= 2;
+-			if (verbosity>3){
+-				_printLine_("   reshape lSegsI from " << mneo << " to " << MaxNbSeg);
+-			}
+-			_assert_(lSegsI && NbSeg<MaxNbSeg);
+-			SegInterpolation * lEn =  new SegInterpolation[MaxNbSeg];
+-			for (int i=0;i< NbSeg;i++) lEn[i] = lSegsI[MaxNbSeg]; // copy old to new            
+-			delete []  lSegsI; // remove old
+-			lSegsI = lEn;        
+-		}
+-		if (NbSeg) lSegsI[NbSeg-1].last=Size;
+-		lSegsI[NbSeg].e=e;
+-		lSegsI[NbSeg].sBegin=s0;
+-		lSegsI[NbSeg].sEnd=s1;     
+-		NbSeg++;           
+-	}
+-	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::ReShape{{{*/
+-	void ListofIntersectionTriangles::ReShape(){ 
+-
+-		register int newsize = MaxSize*2;
+-		IntersectionTriangles* nw = new IntersectionTriangles[newsize];
+-		_assert_(nw);
+-
+-		// recopy
+-		for (int i=0;i<MaxSize;i++) nw[i] = lIntTria[i];       
+-		long int verbosity=0;
+-		if(verbosity>3) _printLine_("   ListofIntersectionTriangles  ReShape Maxsize " << MaxSize << " -> " << MaxNbSeg);
+-		MaxSize = newsize; 
+-		delete [] lIntTria;// remove old
+-		lIntTria = nw; // copy pointer
+-	}
+-	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::SplitEdge{{{*/
+-	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;
+-
+-		long int verbose=2;
+-		Icoor2 deta[3], deti,detj;
+-		double ba[3];
+-		int nbt =0,ifirst=-1,ilast;
+-		int i0,i1,i2;
+-		int ocut,i,j,k=-1;
+-		//  int OnAVertices =0;
+-		Icoor2 dt[3];
+-		I2 a = Bh.R2ToI2(A) ,b= Bh.R2ToI2(B);// compute  the Icoor a,b
+-		I2 vi,vj;  
+-		int iedge =-1;// not a edge
+-
+-		if(nbegin)  {// optimisation 
+-			// we suppose  knowing the starting  triangle
+-			t=tbegin=lIntTria[ilast=(Size-1)].t;
+-			if (tbegin->det>=0) 
+-			 ifirst = ilast;}  
+-		else {// not optimisation 
+-			Init();
+-			t=tbegin = Bh.TriangleFindFromCoord(a,deta);
+-			if( t->det>=0)
+-			 ilast=NewItem(t,double(deta[0])/t->det,double(deta[1])/t->det,double(deta[2])/t->det);
+-			else 
+-			  {// find the nearest boundary edge  of the vertex A
+-				// find a edge or such normal projection a the edge IJ is on the edge
+-				//   <=> IJ.IA >=0 && IJ.AJ >=0
+-				ilast=ifirst;
+-				double ba,bb;
+-				AdjacentTriangle edge=CloseBoundaryEdge(a,t,ba,bb);
+-				BamgVertex & v0 = *edge.EdgeVertex(0), & v1 = *edge.EdgeVertex(1);
+-				NewItem(A,Metric(ba,v0,bb,v1));
+-				t=edge;
+-				// test if the point b is in the same side
+-				if (det(v0.i,v1.i,b)>=0) {
+-					AdjacentTriangle edge=CloseBoundaryEdge(a,t,ba,bb);
+-					BamgVertex & v0 = *edge.EdgeVertex(0), & v1 = *edge.EdgeVertex(1);
+-					NewItem(A,Metric(ba,v0,bb,v1));
+-					return;
+-				}
+-			  } // find the nearest boundary edge  of the vertex A
+-		} // end not optimisation 
+-		if (t->det<0) {  // outside departure
+-			while (t->det <0) { // intersection boundary edge and a,b,
+-				k=(*t)(0) ?  ((  (*t)(1) ? ( (*t)(2) ? -1 : 2) : 1  )) : 0;
+-				if (k<0){
+-					_error2_("k<0");
+-				}
+-				ocut = OppositeEdge[k];
+-				i=VerticesOfTriangularEdge[ocut][0];
+-				j=VerticesOfTriangularEdge[ocut][1];
+-				vi=(*t)[i];
+-				vj=(*t)[j];
+-				deti = bamg::det(a,b,vi);
+-				detj = bamg::det(a,b,vj);
+-				if (deti>0) // go to  i direction on gamma
+-				 ocut = PreviousEdge[ocut];      
+-				else if (detj<=0) // go to j direction on gamma
+-				 ocut = NextEdge[ocut];         
+-				AdjacentTriangle tadj =t->Adj(ocut);
+-				t = tadj;
+-				iedge= tadj; 
+-				if (t == tbegin) { // 
+-					double ba,bb;
+-					long int verbose=2;
+-					AdjacentTriangle edge=CloseBoundaryEdge(a,t,ba,bb);
+-					BamgVertex & v0 = *edge.EdgeVertex(0), & v1 = *edge.EdgeVertex(1);
+-					NewItem(A,Metric(ba,v0,bb,v1));
+-					return;
+-				}
+-			} //  end while (t->det <0)
+-			// theoriticaly we have: deti =<0 and detj>0
+-
+-			// computation of barycentric coor
+-			// test if the point b is on size on t
+-			// we revert vi,vj because vi,vj is def in Adj triangle
+-			if ( det(vi,vj,b)>=0) {
+-				t=tbegin;
+-				double ba,bb;
+-				AdjacentTriangle edge=CloseBoundaryEdge(b,t,ba,bb);
+-				NewItem(B,Metric(ba,*edge.EdgeVertex(0),bb,*edge.EdgeVertex(1)));
+-				return;
+-			}
+-			else
+-			  {
+-				k = OppositeVertex[iedge];
+-				i=VerticesOfTriangularEdge[iedge][0];
+-				j=VerticesOfTriangularEdge[iedge][1];
+-				double dij = detj-deti;
+-				if (i+j+k != 0 + 1 +2){
+-					_error2_("i+j+k != 0 + 1 +2");
+-				}
+-				ba[j] =  detj/dij;
+-				ba[i] = -deti/dij;
+-				ba[k] = 0;
+-				ilast=NewItem(t,ba[0],ba[1],ba[2]); }
+-		}  //  outside departure
+-
+-
+-
+-		// recherche the intersection of [a,b] with Bh Mesh.
+-		// we know  a triangle ta contening the vertex a
+-		// we have 2 case for intersection [a,b] with a edge [A,B] of Bh
+-		// 1) the intersection point is in ]A,B[
+-		// 2)                        is A or B
+-		// first version --- 
+-		for (;;) {
+-			//    t->Draw();
+-			if (iedge < 0) {
+-				i0 =0;i1=1;i2=2;
+-				dt[0] =bamg::det(a,b,(*t)[0]);
+-				dt[1] =bamg::det(a,b,(*t)[1]);
+-				dt[2] =bamg::det(a,b,(*t)[2]);}
+-			else {
+-				i2 = iedge;
+-				i0 = NextEdge[i2];
+-				i1 = NextEdge[i0]; 
+-				dt[VerticesOfTriangularEdge[iedge][0]] = detj;// we revert i,j because
+-				dt[VerticesOfTriangularEdge[iedge][1]] = deti;// we take the Triangle by the other side
+-				dt[iedge] = det(a,b,(*t)[OppositeVertex[iedge]]);}
+-
+-				// so we have just to see the transition from - to + of the det0..2 on edge of t
+-				// because we are going from a to b
+-				if       ((dt[i=VerticesOfTriangularEdge[i0][0]] <  0) &&
+-							( dt[j=VerticesOfTriangularEdge[i0][1]] > 0))
+-				 ocut =i0;
+-				else  if ((dt[i=VerticesOfTriangularEdge[i1][0]] <  0) &&
+-							(dt[j=VerticesOfTriangularEdge[i1][1]] >  0))
+-				 ocut =i1;
+-				else  if ((dt[i=VerticesOfTriangularEdge[i2][0]] <  0) && 
+-							(dt[j=VerticesOfTriangularEdge[i2][1]] >  0))
+-				 ocut =i2;
+-				else if   ((dt[i=VerticesOfTriangularEdge[i0][0]] == 0) &&
+-							( dt[j=VerticesOfTriangularEdge[i0][1]] >  0))
+-				 ocut =i0;
+-				else  if ((dt[i=VerticesOfTriangularEdge[i1][0]] == 0) &&
+-							(dt[j=VerticesOfTriangularEdge[i1][1]] >  0))
+-				 ocut =i1;
+-				else  if ((dt[i=VerticesOfTriangularEdge[i2][0]] == 0) && 
+-							(dt[j=VerticesOfTriangularEdge[i2][1]] >  0))
+-				 ocut =i2;
+-				else if   ((dt[i=VerticesOfTriangularEdge[i0][0]] <  0) &&
+-							( dt[j=VerticesOfTriangularEdge[i0][1]] == 0))
+-				 ocut =i0;
+-				else  if ((dt[i=VerticesOfTriangularEdge[i1][0]] <  0) &&
+-							(dt[j=VerticesOfTriangularEdge[i1][1]] == 0))
+-				 ocut =i1;
+-				else  if ((dt[i=VerticesOfTriangularEdge[i2][0]] <  0) && 
+-							(dt[j=VerticesOfTriangularEdge[i2][1]] == 0))
+-				 ocut =i2;
+-				else { //  On a edge (2 zero)
+-					k =0;
+-					if (dt[0]) ocut=0,k++; 
+-					if (dt[1]) ocut=1,k++; 
+-					if (dt[2]) ocut=2,k++;
+-					if(k == 1) {
+-						if (dt[ocut] >0) // triangle upper AB
+-						 ocut = NextEdge[ocut];
+-						i= VerticesOfTriangularEdge[ocut][0];
+-						j= VerticesOfTriangularEdge[ocut][1];
+-					}
+-					else {
+-						_error2_("Bug Split Edge");
+-					}
+-				}
+-
+-				k = OppositeVertex[ocut];
+-
+-				Icoor2 detbij = bamg::det((*t)[i],(*t)[j],b);
+-
+-
+-				if (detbij >= 0) { //we find the triangle contening b
+-					dt[0]=bamg::det((*t)[1],(*t)[2],b);
+-					dt[1]=bamg::det((*t)[2],(*t)[0],b);
+-					dt[2]=bamg::det((*t)[0],(*t)[1],b);
+-					double dd = t->det;
+-					NewItem(t,dt[0]/dd,dt[1]/dd,dt[2]/dd);      
+-					return ;}
+-				else { // next triangle by  adjacent by edge ocut 
+-					deti = dt[i];
+-					detj = dt[j];
+-					double dij = detj-deti;
+-					ba[i] =  detj/dij;
+-					ba[j] = -deti/dij;
+-					ba[3-i-j ] = 0;
+-					ilast=NewItem(t, ba[0],ba[1],ba[2]);      
+-
+-					AdjacentTriangle ta =t->Adj(ocut);
+-					t = ta;
+-					iedge= ta; 
+-					if (t->det <= 0)  {
+-						double ba,bb;
+-						AdjacentTriangle edge=CloseBoundaryEdge(b,t,ba,bb);
+-						NewItem(B,Metric(ba,*edge.EdgeVertex(0),bb,*edge.EdgeVertex(1)));
+-						return;
+-					}
+-				}// we  go outside of omega 
+-		} // for(;;)
+-	}
+-	/*}}}*/
+-
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnEdge.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnEdge.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnEdge.h	(revision 12821)
+@@ -1,36 +0,0 @@
+-#ifndef _VERTEXONEDGE_H_
+-#define _VERTEXONEDGE_H_
+-
+-#include "./include.h"
+-#include "./Edge.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class Mesh;
+-	class BamgVertex;
+-
+-	class VertexOnEdge {
+-
+-		public:
+-			BamgVertex* v;
+-			Edge*   be;
+-			double abcisse;
+-
+-			//Constructors
+-			VertexOnEdge(BamgVertex * w, Edge *bw,double s) :v(w),be(bw),abcisse(s) {};
+-			VertexOnEdge(){};
+-
+-			//Operators
+-			operator double () const { return abcisse;}
+-			operator BamgVertex* () const { return v;}  
+-			operator Edge* () const { return be;}  
+-			BamgVertex & operator[](int i) const { return (*be)[i];}
+-
+-			//Methods
+-			void SetOnBTh();
+-			void Set(const Mesh &,long,Mesh &);  
+-	};
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/AdjacentTriangle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/AdjacentTriangle.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/AdjacentTriangle.h	(revision 12821)
+@@ -1,46 +0,0 @@
+-#ifndef _TRIANGLEADJACENT_H_
+-#define _TRIANGLEADJACENT_H_
+-
+-#include "./include.h"
+-#include "./BamgVertex.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class Triangle;
+-	class Triangle;
+-
+-	class AdjacentTriangle {
+-
+-		public:
+-			Triangle* t; //pointer toward the triangle
+-			int  a;      //Edge number
+-
+-			//Constructors
+-			AdjacentTriangle():a(0),t(NULL) {};
+-			AdjacentTriangle(Triangle* tt,int  aa): t(tt),a(aa &3) {};
+-
+-			//Operators
+-			operator Triangle * () const {return t;}
+-			operator Triangle & () const {return *t;}
+-			operator int() const {return a;}
+-			AdjacentTriangle & operator++(){ a= NextEdge[a]; return *this; }
+-			AdjacentTriangle operator--(){ a= PreviousEdge[a]; return *this; }
+-
+-			//Methods
+-
+-			//Methods
+-			int  Locked() const;
+-			int  MarkUnSwap() const;
+-			int  GetAllFlag_UnSwap() const;
+-			void SetLock();
+-			void SetAdj2(const AdjacentTriangle &ta, int l=0);
+-			int  swap();
+-			AdjacentTriangle Adj() const;
+-			BamgVertex* EdgeVertex(const int & i) const;
+-			BamgVertex* OppositeVertex() const;
+-			Icoor2& det() const;
+-	};
+-}
+-#endif
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Triangle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Triangle.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Triangle.cpp	(revision 12821)
+@@ -1,491 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "../objects.h"
+-
+-namespace bamg {
+-
+-	/*Constructors/Destructors*/
+-	/*FUNCTION Triangle(){{{*/
+-	Triangle::Triangle(void){
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION 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){
+-			_error2_("i<0 || j<0 || k<0");
+-		}
+-		if (i>=nbv || j>=nbv || k>=nbv){
+-			_error2_("i>=nbv || j>=nbv || k>=nbv");
+-		}
+-		vertices[0]=v+i;
+-		vertices[1]=v+j;
+-		vertices[2]=v+k;
+-		adj[0]=adj[1]=adj[2]=0;
+-		AdjEdgeIndex[0]=AdjEdgeIndex[1]=AdjEdgeIndex[2]=0;
+-		det=0;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Triangle(BamgVertex *v0,BamgVertex *v1,BamgVertex *v2) {{{*/
+-	Triangle::Triangle(BamgVertex *v0,BamgVertex *v1,BamgVertex *v2){
+-		vertices[0]=v0;
+-		vertices[1]=v1;
+-		vertices[2]=v2;
+-		adj[0]=adj[1]=adj[2]=0;
+-		AdjEdgeIndex[0]=AdjEdgeIndex[1]=AdjEdgeIndex[2]=0;
+-		if (v0) det=0;
+-		else {
+-			det=-1;
+-			link=NULL;};  
+-	}
+-	/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION Triangle::Adj{{{*/
+-	AdjacentTriangle Triangle::Adj(int i)  const {
+-		return AdjacentTriangle(adj[i],AdjEdgeIndex[i]&3);
+-	};/*}}}*/
+-	/*FUNCTION Triangle::Anisotropy{{{*/
+-	double Triangle::Anisotropy() const{
+-
+-		double lmin,lmax;
+-
+-		/*Get three vertices A,B and C*/
+-		R2 A=*this->vertices[0];
+-		R2 B=*this->vertices[1];
+-		R2 C=*this->vertices[2];
+-
+-		/*Compute edges*/
+-		R2 e1=B-A;
+-		R2 e2=C-A;
+-		R2 e3=B-C;
+-
+-		/*Compute edge length*/
+-		double l1=Norme2(e1);
+-		double l2=Norme2(e2);
+-		double l3=Norme2(e3);
+-
+-		lmin=l1;
+-		lmin=min(lmin,l2);
+-		lmin=min(lmin,l3);
+-		lmax=l1;
+-		lmax=max(lmax,l2);
+-		lmax=max(lmax,l3);
+-
+-		return lmax/lmin;
+-	};/*}}}*/
+-	/*FUNCTION Triangle::Length{{{*/
+-	double Triangle::Length() const{
+-
+-		double l;
+-
+-		/*Get three vertices A,B and C*/
+-		R2 A=*this->vertices[0];
+-		R2 B=*this->vertices[1];
+-		R2 C=*this->vertices[2];
+-
+-		/*Compute edges*/
+-		R2 e1=B-A;
+-		R2 e2=C-A;
+-		R2 e3=B-C;
+-
+-		/*Compute edge length*/
+-		l=Norme2(e1);
+-		l=max(l,Norme2(e2));
+-		l=max(l,Norme2(e3));
+-
+-		return l;
+-	};/*}}}*/
+-	/*FUNCTION Triangle::Echo {{{*/
+-	void Triangle::Echo(void){
+-
+-		int i;
+-
+-		_printLine_("Triangle:");
+-		_printLine_("   vertices pointer towards three vertices");
+-		_printLine_("      vertices[0] vertices[1] vertices[2] = " << vertices[0] << " " << vertices[1] << " " << vertices[2]);
+-		_printLine_("   adj pointer towards three adjacent triangles");
+-		_printLine_("      adj[0] adj[1] adj[2] = " << adj[0] << " " << adj[1] << " " << adj[2]);
+-		_printLine_("   det (integer triangle determinant) = " << det);
+-		if (link){
+-			_printLine_("   link (pointer toward duplicate triangle)= " << link);
+-		}
+-		else{
+-			_printLine_("   color = " << color);
+-		}
+-
+-		_printLine_("\nThree vertices:");
+-		for(i=0;i<3;i++){
+-			if (vertices[i]){
+-				vertices[i]->Echo();
+-			}
+-			else{
+-				_printLine_("   vertex " << i+1 << " does not exist");
+-			}
+-		}
+-
+-		return;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Triangle::FindBoundaryEdge{{{*/
+-	AdjacentTriangle Triangle::FindBoundaryEdge(int i) const{
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/FindBoundaryEdge)*/
+-
+-		/*Intermediary*/
+-		Triangle* ttc=NULL;
+-		int k,j,jc;
+-
+-		// call current triangle t
+-		Triangle* t = (Triangle*)this;
+-
+-		//is the current triangle inside or outside?
+-		int outside=!link  ;
+-
+-		// EdgesVertexTriangle[3][2] = {{1,2},{2,0},{0,1}};
+-		// initialize j as the first vertex of the ith edge
+-		j=EdgesVertexTriangle[i][0];
+-
+-		//Loop over the adjacent triangle of t
+-		k=0;
+-		do{
+-			//keep track of outside
+-			int outsidep = outside;
+-			//increment k
+-			k++;
+-			//Get ttc, adjacent triangle of t with respect to vertex j
+-			ttc =  t->adj[j];
+-			//is the current triangle inside or outside?
+-			outside = !ttc->link;
+-			//if both previous triangle are outside, return
+-			if (outside+outsidep == 1) return AdjacentTriangle(t,j);
+-
+-			//update t and j
+-			t = ttc;
+-			//NextEdge[3] = {1,2,0};
+-			jc = NextEdge[t->AdjEdgeIndex[j]&3];
+-			j = NextEdge[jc];
+-
+-			//check number of iterations
+-			if (k>=2000){
+-				_error2_("too many iteration in Triangle::FindBoundaryEdge (k>=2000)");
+-			}
+-		} while (this!= t);
+-		//not found, return empty triangle
+-		return AdjacentTriangle(NULL,0);
+-	}
+-	/*}}}*/
+-	/*FUNCTION Triangle::GetAllflag{{{*/
+-	int    Triangle::GetAllflag(int a){
+-		return AdjEdgeIndex[a] & 1020;
+-	}/*}}}*/
+-	/*FUNCTION Triangle::Hidden{{{*/
+-	int    Triangle::Hidden(int a)const {
+-		return AdjEdgeIndex[a]&16;
+-	} /*}}}*/
+-	/*FUNCTION Triangle::Locked{{{*/
+-	int    Triangle::Locked(int a)const {
+-		return AdjEdgeIndex[a]&4;
+-	} /*}}}*/
+-	/*FUNCTION Triangle::NuEdgeTriangleAdj{{{*/
+-	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) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Optim)*/
+-
+-		// turn around (positive direction)
+-		Triangle *t=this;
+-		long NbSwap =0;
+-		int  k = 0;
+-		int  j = OppositeEdge[i];
+-		int  jp= PreviousEdge[j];
+-
+-		// initialize tp, jp the previous triangle & edge
+-		Triangle *tp=adj[jp];
+-		jp = AdjEdgeIndex[jp]&3;
+-		do {
+-			while (t->swap(j,koption)){
+-				if (k>=20000) _error2_("k>=20000");
+-				NbSwap++;
+-				k++;
+-				t=  tp->adj[jp];      // set unchange t qnd j for previous triangles
+-				j=  NextEdge[tp->AdjEdgeIndex[jp]&3];
+-			}
+-			// end on this  Triangle 
+-			tp = t;
+-			jp = NextEdge[j];
+-
+-			t=  tp->adj[jp];      // set unchange t qnd j for previous triangles
+-			j=  NextEdge[tp->AdjEdgeIndex[jp]&3];
+-
+-		} while( t != this);
+-		return NbSwap;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Triangle::Quadrangle {{{*/
+-	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) {
+-			int a=-1;
+-			if (AdjEdgeIndex[0] & 16 ) a=0;
+-			if (AdjEdgeIndex[1] & 16 ) a=1;
+-			if (AdjEdgeIndex[2] & 16 ) a=2;
+-			if (a>=0) {
+-				t = adj[a];
+-				//  if (t-this<0) return 0;
+-				v2 = vertices[VerticesOfTriangularEdge[a][0]];
+-				v0 = vertices[VerticesOfTriangularEdge[a][1]];
+-				v1 = vertices[OppositeEdge[a]];
+-				v3 = t->vertices[OppositeEdge[AdjEdgeIndex[a]&3]];
+-			}
+-		}
+-		return t;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Triangle::QualityQuad {{{*/
+-	double   Triangle::QualityQuad(int a,int option) const{
+-		double q;
+-		if (!link || AdjEdgeIndex[a] &4)
+-		 q=  -1;
+-		else {
+-			Triangle * t = adj[a];
+-			if (t-this<0) q=  -1;// because we do 2 times 
+-			else if (!t->link ) q=  -1;
+-			else if (AdjEdgeIndex[0] & 16 || AdjEdgeIndex[1] & 16  || AdjEdgeIndex[2] & 16 || t->AdjEdgeIndex[0] & 16 || t->AdjEdgeIndex[1] & 16 || t->AdjEdgeIndex[2] & 16 )
+-			 q= -1;
+-			else if(option){ 
+-				const BamgVertex & v2 = *vertices[VerticesOfTriangularEdge[a][0]];
+-				const BamgVertex & v0 = *vertices[VerticesOfTriangularEdge[a][1]];
+-				const BamgVertex & v1 = *vertices[OppositeEdge[a]];
+-				const BamgVertex & v3 = * t->vertices[OppositeEdge[AdjEdgeIndex[a]&3]];
+-				q =  QuadQuality(v0,v1,v2,v3); // do the float part
+-			}
+-			else q= 1;
+-		}
+-		return  q;
+-	}
+-	/*}}}*/
+-	/*FUNCTION 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){
+-		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){ 
+-		*this = rec;
+-		if ( vertices[0] ) vertices[0] = ThNew.vertices +  Th.GetId(vertices[0]);
+-		if ( vertices[1] ) vertices[1] = ThNew.vertices +  Th.GetId(vertices[1]);
+-		if ( vertices[2] ) vertices[2] = ThNew.vertices +  Th.GetId(vertices[2]);
+-		if(adj[0]) adj[0] =  ThNew.triangles + Th.GetId(adj[0]);
+-		if(adj[1]) adj[1] =  ThNew.triangles + Th.GetId(adj[1]);
+-		if(adj[2]) adj[2] =  ThNew.triangles + Th.GetId(adj[2]);
+-		if (link  >= Th.triangles && link  < Th.triangles + Th.nbt)
+-		 link = ThNew.triangles + Th.GetId(link);
+-	}
+-	/*}}}*/
+-	/*FUNCTION Triangle::SetAdjAdj{{{*/
+-	void Triangle::SetAdjAdj(short a){
+-		// Copy all the mark 
+-		a &= 3;
+-		register Triangle *tt=adj[a];
+-		AdjEdgeIndex [a] &= 55; // remove MarkUnSwap
+-		register short aatt = AdjEdgeIndex[a] & 3;
+-		if(tt){ 
+-			tt->adj[aatt]=this;
+-			tt->AdjEdgeIndex[aatt]=a + (AdjEdgeIndex[a] & 60 ) ;
+-		}
+-	}/*}}}*/
+-	/*FUNCTION Triangle::SetAdj2{{{*/
+-	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
+-		 * - aat is the index of the same edge in the adjacent triangle*/
+-		adj[a]=t;
+-		AdjEdgeIndex[a]=aat;
+-		if(t){ //if t!=NULL add adjacent triangle to t (this)
+-			t->adj[aat]=this;
+-			t->AdjEdgeIndex[aat]=a;
+-		}
+-	}/*}}}*/
+-	/*FUNCTION Triangle::SetAllFlag{{{*/
+-	void   Triangle::SetAllFlag(int a,int f){
+-		AdjEdgeIndex[a] = (AdjEdgeIndex[a] &3) + (1020 & f);
+-	}/*}}}*/
+-	/*FUNCTION Triangle::SetDet{{{*/
+-	void Triangle::SetDet() {
+-		if(vertices[0] && vertices[1] && vertices[2])    det = bamg::det(*vertices[0],*vertices[1],*vertices[2]);
+-		else det = -1; 
+-	}/*}}}*/
+-	/*FUNCTION Triangle::SetHidden{{{*/
+-	void Triangle::SetHidden(int a){
+-		//Get Adjacent Triangle number a
+-		register Triangle* t = adj[a];
+-		//if it exist
+-		//C|=D -> C=(C|D) bitwise inclusive OR
+-		if(t) t->AdjEdgeIndex[AdjEdgeIndex[a] & 3] |=16;
+-		AdjEdgeIndex[a] |= 16;
+-	}/*}}}*/
+-	/*FUNCTION Triangle::SetLocked{{{*/
+-	void Triangle::SetLocked(int a){
+-		//mark the edge as on Boundary
+-		register Triangle * t = adj[a];
+-		t->AdjEdgeIndex[AdjEdgeIndex[a] & 3] |=4;
+-		AdjEdgeIndex[a] |= 4;
+-	}/*}}}*/
+-	/*FUNCTION Triangle::SetMarkUnSwap{{{*/
+-	void Triangle::SetMarkUnSwap(int a){
+-		register Triangle * t = adj[a];
+-		t->AdjEdgeIndex[AdjEdgeIndex[a] & 3] |=8;
+-		AdjEdgeIndex[a] |=8 ;
+-	}/*}}}*/
+-	/*FUNCTION 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){ 
+-		register 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){
+-		/*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
+-
+-		register Triangle *t1=this,*t2=adj[a];// les 2 triangles adjacent
+-		register short a1=a,a2=AdjEdgeIndex[a];// les 2 numero de l arete dans les 2 triangles
+-		if(a2/4 !=0) return 0; // arete lock or MarkUnSwap
+-
+-		register BamgVertex  *sa=t1->vertices[VerticesOfTriangularEdge[a1][0]];
+-		register BamgVertex  *sb=t1->vertices[VerticesOfTriangularEdge[a1][1]];
+-		register BamgVertex  *s1=t1->vertices[OppositeVertex[a1]];
+-		register BamgVertex  *s2=t2->vertices[OppositeVertex[a2]];
+-
+-		Icoor2 det1=t1->det , det2=t2->det ;
+-		Icoor2 detT = det1+det2;
+-		Icoor2 detA = Abs(det1) + Abs(det2);
+-		Icoor2 detMin = Min(det1,det2);
+-
+-		int OnSwap = 0;       
+-		// si 2 triangle infini (bord) => detT = -2;
+-		if (sa == 0) {// les deux triangles sont frontieres
+-			det2=bamg::det(s2->i,sb->i,s1->i);
+-			OnSwap = det2 >0;}
+-		else if (sb == 0) { // les deux triangles sont frontieres
+-			det1=bamg::det(s1->i,sa->i,s2->i);
+-			OnSwap = det1 >0;}
+-		else if(( s1 != 0) && (s2 != 0) ) {
+-			det1 = bamg::det(s1->i,sa->i,s2->i);
+-			det2 = detT - det1;
+-			OnSwap = (Abs(det1) + Abs(det2)) < detA;
+-
+-			Icoor2 detMinNew=Min(det1,det2);
+-			//     if (detMin<0 && (Abs(det1) + Abs(det2) == detA)) OnSwap=BinaryRand();// just for test   
+-			if (! OnSwap &&(detMinNew>0)) {
+-				OnSwap = detMin ==0;
+-				if (! OnSwap) {
+-					int  kopt = koption;
+-					while (1)
+-					 if(kopt) {
+-						 // critere de Delaunay pure isotrope
+-						 register Icoor2 xb1 = sb->i.x - s1->i.x,
+-									 x21 = s2->i.x - s1->i.x,
+-									 yb1 = sb->i.y - s1->i.y,
+-									 y21 = s2->i.y - s1->i.y,
+-									 xba = sb->i.x - sa->i.x, 
+-									 x2a = s2->i.x - sa->i.x,
+-									 yba = sb->i.y - sa->i.y,
+-									 y2a = s2->i.y - sa->i.y;
+-						 register double
+-							cosb12 =  double(xb1*x21 + yb1*y21),
+-									 cosba2 =  double(xba*x2a + yba*y2a) ,
+-									 sinb12 = double(det2),
+-									 sinba2 = double(t2->det);
+-
+-
+-						 // angle b12 > angle ba2 => cotg(angle b12) < cotg(angle ba2)
+-						 OnSwap =  ((double) cosb12 * (double)  sinba2) <  ((double) cosba2 * (double) sinb12);
+-						 break;
+-					 }
+-					 else {	
+-						 // critere de Delaunay anisotrope 
+-						 double som;
+-						 I2 AB=(I2) *sb - (I2) *sa;
+-						 I2 MAB2=((I2) *sb + (I2) *sa);
+-						 R2 MAB(MAB2.x*0.5,MAB2.y*0.5);
+-						 I2 A1=(I2) *s1 - (I2) *sa;
+-						 I2 D = (I2) * s1 - (I2) * sb ;
+-						 R2 S2(s2->i.x,s2->i.y);
+-						 R2 S1(s1->i.x,s1->i.y);
+-							{
+-							 Metric M=s1->m;
+-							 R2 ABo = M.Orthogonal(AB);
+-							 R2 A1o = M.Orthogonal(A1);
+-							 // (A+B)+ x ABo = (S1+B)/2+ y A1 
+-							 // ABo x - A1o y =  (S1+B)/2-(A+B)/2 = (S1-B)/2 = D/2
+-							 double dd = Abs(ABo.x*A1o.y)+Abs(ABo.y*A1o.x);
+-							 double d = (ABo.x*A1o.y - ABo.y*A1o.x)*2; // because D/2
+-							 if (Abs(d) > dd*1.e-3) {
+-								 R2 C(MAB+ABo*((D.x*A1o.y - D.y*A1o.x)/d));
+-								 som  = M(C - S2)/M(C - S1);
+-							 } else 
+-								{kopt=1;continue;}
+-
+-							}
+-							{
+-							 Metric M=s2->m;
+-							 R2 ABo = M.Orthogonal(AB);
+-							 R2 A1o = M.Orthogonal(A1);
+-							 // (A+B)+ x ABo = (S1+B)/2+ y A1 
+-							 // ABo x - A1o y =  (S1+B)/2-(A+B)/2 = (S1-B)/2 = D/2 
+-							 double dd = Abs(ABo.x*A1o.y)+Abs(ABo.y*A1o.x);
+-							 double d = (ABo.x*A1o.y - ABo.y*A1o.x)*2; // because D/2
+-							 if(Abs(d) > dd*1.e-3) {
+-								 R2 C(MAB+ABo*((D.x*A1o.y - D.y*A1o.x)/d));
+-								 som  += M(C - S2)/M(C -  S1);
+-							 } else 
+-								{kopt=1;continue;}
+-							}
+-						 OnSwap = som < 2;
+-						 break;
+-					 }
+-
+-				} // OnSwap 
+-			} // (! OnSwap &&(det1 > 0) && (det2 > 0) )
+-		}
+-		if( OnSwap ) 
+-		 bamg::swap(t1,a1,t2,a2,s1,s2,det1,det2);
+-		else {
+-			t1->SetMarkUnSwap(a1);     
+-		}
+-		return OnSwap;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Triangle::TriangleAdj{{{*/
+-	Triangle* Triangle::TriangleAdj(int i) const {
+-		return adj[i&3];
+-	}/*}}}*/
+-
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgQuadtree.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgQuadtree.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgQuadtree.h	(revision 12821)
+@@ -1,60 +0,0 @@
+-/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, BamgQuadtree.h)*/
+-#ifndef _BAMGQUADTREE_H
+-#define _BAMGQUADTREE_H
+-
+-#include "./include.h"
+-
+-namespace bamg {
+-
+-	const int  MaxDepth = 30;
+-	const long MaxISize = ( 1L << MaxDepth);  // = 2^30 : 010000000000..000 (bitwise operation)
+-
+-	class BamgVertex;
+-
+-	class BamgQuadtree{
+-
+-		private:
+-
+-			/*A quadtree box contains a maximum of 4 vertices. 4 other quadtree boxes are
+-			 * created if a fifth vertex is added to the same box. A Quadtree box is therefore
+-			 * composed of EITHER:
+-			 * - up to 4 vertices
+-			 * - 4 "sub" quadtree boxes*/
+-			class BamgQuadtreeBox: public Object{ 
+-				public:
+-					int nbitems; // number of current vertices in the box
+-					union{
+-						BamgQuadtreeBox* b[4];
+-						BamgVertex*  v[4];
+-					};
+-					/*Object functions*/
+-					void    Echo()       {_error2_("not implemented yet"); };
+-					void    DeepEcho()   {_error2_("not implemented yet"); };
+-					int     Id()         {_error2_("not implemented yet"); };
+-					int     MyRank()     {_error2_("not implemented yet"); };
+-					int     ObjectEnum() {_error2_("not implemented yet"); };
+-					Object *copy()       {_error2_("not implemented yet"); };
+-			};
+-
+-			/*BamgQuadtree private Fields*/
+-			DataSet* boxcontainer;
+-
+-		public:
+-
+-			/*BamgQuadtree public Fields*/
+-			BamgQuadtreeBox* root;
+-			long         NbBamgQuadtreeBox;
+-			long         NbVertices;
+-
+-			BamgQuadtree();
+-			BamgQuadtree(Mesh *t,long nbv=-1);
+-			~BamgQuadtree();
+-
+-			BamgVertex      *NearestVertex(Icoor1 i,Icoor1 j);
+-			BamgVertex      *NearestVertexWithNormal(Icoor1  i,Icoor1 j);
+-			BamgQuadtreeBox *NewBamgQuadtreeBox(void);
+-			BamgVertex      *ToClose(BamgVertex &,double ,Icoor1,Icoor1);
+-			void             Add(BamgVertex &w);
+-	};
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnVertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnVertex.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnVertex.cpp	(revision 12821)
+@@ -1,34 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "VertexOnVertex.h"
+-#include "Mesh.h"
+-
+-namespace bamg {
+-
+-	/*Constructors/Destructors*/
+-	/*FUNCTION 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){
+-	
+-	}/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION VertexOnVertex::Set{{{*/
+-	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(){
+-		v->BackgroundVertexHook=bv;v->IndexInTriangle=IsVertexOnVertex;
+-	}/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgVertex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgVertex.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgVertex.h	(revision 12821)
+@@ -1,58 +0,0 @@
+-#ifndef _BAMGVERTEX_H_
+-#define _BAMGVERTEX_H_
+-
+-#include "./include.h"
+-#include "./Metric.h"
+-#include "./Direction.h"
+-#include "./BamgOpts.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class Triangle;
+-	class Mesh;
+-	class VertexOnGeom;
+-	class VertexOnEdge;
+-
+-	class BamgVertex {
+-
+-		public:
+-
+-			/*Fields*/
+-			I2        i;                 // integer coordinates
+-			R2        r;                 // real coordinates
+-			Metric    m;
+-			long      ReferenceNumber;
+-			Direction DirOfSearch;
+-			short     IndexInTriangle;              // the vertex number in triangle; varies between 0 and 2 in t
+-
+-			union {
+-				Triangle     *t;                      // one triangle which is containing the vertex
+-				long          color;
+-				BamgVertex   *MeshVertexHook;         // used in geometry BamgVertex to know the Mesh Vertex associated
+-				VertexOnGeom *GeomEdgeHook;    // if IndexInTriangle == 8; // set with Mesh::SetVertexFieldOn()
+-				BamgVertex   *BackgroundVertexHook;   // if IndexInTriangle == 16 on Background vertex Mesh::SetVertexFieldOnBTh()
+-				VertexOnEdge *BackgroundEdgeHook;     // if IndexInTriangle == 32 on Background edge
+-			};
+-
+-			/*Operators*/
+-			operator I2() const {return i;}             // Cast operator
+-			operator const R2 & () const {return r;}    // Cast operator
+-			operator Metric () const {return m;}        // Cast operator
+-			double operator()(R2 x) const { return m(x);} // Get x in the metric m
+-
+-			/*methods (No constructor and no destructors...)*/
+-			double Smoothing(Mesh & ,const Mesh & ,Triangle  * & ,double =1);
+-			void   MetricFromHessian(const double Hxx,const double Hyx, const double Hyy, const double smin,const double smax,const double s,const double err,BamgOpts* bamgopts);
+-			void   Echo();
+-			int    GetReferenceNumber() const;
+-			long   Optim(int =1,int =0); 
+-
+-			//inline functions
+-			inline void Set(const BamgVertex &rec,const Mesh & ,Mesh & ){*this=rec;}
+-	};
+-
+-	//Intermediary
+-	double QuadQuality(const BamgVertex &,const BamgVertex &,const BamgVertex &,const BamgVertex &);
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Edge.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Edge.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Edge.h	(revision 12821)
+@@ -1,38 +0,0 @@
+-#ifndef _EDGE_H_
+-#define _EDGE_H_
+-
+-#include "./include.h"
+-#include "./BamgVertex.h"
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "./GeomEdge.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class Mesh;
+-	
+-	class Edge {
+-
+-		public:
+-			BamgVertex      *v[2];
+-			long             ReferenceNumber;
+-			GeomEdge *GeomEdgeHook;
+-			Edge            *adj[2];       // the 2 adj edges if on the same curve
+-
+-			//Operators
+-			BamgVertex       &operator[](int i){return *v[i];   };
+-			BamgVertex       *operator()(int     i){return v[i];};
+-			R2                operator()(double  t) const;// return the point
+-			const BamgVertex &operator[](int i) const{return *v[i];};
+-
+-			//Methods
+-			void Renumbering(BamgVertex *vb,BamgVertex *ve, long *renu);
+-			int  Intersection(const  Edge & e);
+-			void Set(const Mesh &,long,Mesh &);
+-			void Echo(void);
+-
+-	};
+-}
+-#endif
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgOpts.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgOpts.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgOpts.cpp	(revision 12821)
+@@ -1,89 +0,0 @@
+-#include <stdio.h>
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../objects.h"
+-#include "../../io/io.h"
+-
+-/*Constructors/Destructors*/
+-/*FUNCTION BamgOpts::BamgOpts() {{{*/
+-BamgOpts::BamgOpts(){
+-
+-	this->anisomax=0;
+-	this->cutoff=0;
+-	this->coeff=0;
+-	this->errg=0;
+-	this->gradation=0;
+-	this->Hessiantype=0;
+-	this->MaxCornerAngle=0;
+-	this->maxnbv=0;
+-	this->maxsubdiv=0;
+-	this->Metrictype=0;
+-	this->nbjacobi=0;
+-	this->nbsmooth=0;
+-	this->omega=0;
+-	this->power=0;
+-	this->verbose=0;
+-
+-	this->Crack=0;
+-	this->geometricalmetric=0;
+-	this->KeepVertices=0;
+-	this->splitcorners=0;
+-
+-	this->hmin=0;
+-	this->hmax=0;
+-	this->hminVertices=NULL; this->hminVerticesSize[0]=this->hminVerticesSize[1]=0;
+-	this->hmaxVertices=NULL; this->hmaxVerticesSize[0]=this->hmaxVerticesSize[1]=0;
+-	this->hVertices=NULL;    this->hVerticesSize[0]=this->hVerticesSize[1]=0;
+-	this->metric=NULL;       this->metricSize[0]=this->metricSize[1]=0;
+-	this->field=NULL;        this->fieldSize[0]=this->fieldSize[1]=0;
+-	this->err=NULL;          this->errSize[0]=this->errSize[1]=0;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BamgOpts::~BamgOpts() {{{*/
+-BamgOpts::~BamgOpts(){
+-
+-	xDelete<double>(this->hminVertices);
+-	xDelete<double>(this->hmaxVertices);
+-	xDelete<double>(this->hVertices);
+-	xDelete<double>(this->metric);
+-	xDelete<double>(this->field);
+-	xDelete<double>(this->err);
+-
+-}
+-/*}}}*/
+-
+-/*Methods*/
+-/*FUNCTION BamgOpts::Check{{{*/
+-void BamgOpts::Check(void){
+-
+-	int i;
+-
+-	if (this->anisomax<1) _error2_("'anisomax' option should be >=1");
+-	if (this->coeff==0) _error2_("'coeff' should be positive");
+-	if (this->errg<0) _error2_("'errg' option should be >0");
+-	if (this->gradation<1) _error2_("'gradation' option should be >=1");
+-	if (this->Hessiantype!=0  && this->Hessiantype!=1) _error2_("'Hessiantype' supported options are 0 and 1");
+-	if (this->maxnbv<3) _error2_("'maxnbv' option should be >3");
+-	if (this->maxsubdiv<=1) _error2_("'maxsubdiv' should be >1");
+-	if (this->Metrictype!=0   && this->Metrictype!=1 && this->Metrictype!=2) _error2_("'Metrictype' supported options are 0, 1 and 2");
+-	if (this->nbjacobi<=0) _error2_("'nbjacobi' option should be >0");
+-	if (this->nbsmooth<=0) _error2_("'nbsmooth' option should be >0");
+-
+-	if (this->Crack!=0  && this->Crack!=1) _error2_("'Crack' supported options are 0 and 1");
+-	if (this->KeepVertices!=0 && this->KeepVertices!=1) _error2_("'KeepVertices' supported options are 0 and 1");
+-	if (this->geometricalmetric!=0  && this->geometricalmetric!=1) _error2_("'geometricalmetric' supported options are 0 and 1");
+-
+-	if (this->hmin<=0) _error2_("'hmin' option should be >0");
+-	if (this->hmax<=0 || this->hmax<this->hmin) _error2_("'hmax' option should be between 0 and hmin=" << this->hmin);
+-	if (this->hminVertices && this->hminVerticesSize[1]!=1) _error2_("'hminVertices' should be a column");
+-	if (this->hmaxVertices && this->hmaxVerticesSize[1]!=1) _error2_("'hmaxVertices' should be a column");
+-	if (this->hVertices && this->hVerticesSize[1]!=1) _error2_("'hVertices' should be a column");
+-	if (this->metric && (this->metricSize[1]!=1 && this->metricSize[1]!=3)) _error2_("'metric' should have either 1 (iso) or 3 (aniso) columns.");
+-	if (this->field){
+-		if (this->errSize[0]!=1 || this->errSize[1]!=this->fieldSize[1]) _error2_("'err' should be of size " << 1 << " x " << this->fieldSize[1]);
+-		for (i=0;i<this->fieldSize[1];i++) {if (this->err[i]<=0) _error2_("'err' option should be >0");};
+-	}
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SetOfE4.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SetOfE4.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SetOfE4.h	(revision 12821)
+@@ -1,42 +0,0 @@
+-#ifndef _SetOfEdge4_h
+-#define _SetOfEdge4_h
+-
+-namespace bamg {
+-
+-	class SetOfEdges4;
+-
+-	class IntEdge{
+-		friend class SetOfEdges4;
+-		public:
+-		long i,j;
+-		long next; 
+-	};
+-
+-	class SetOfEdges4 {
+-
+-		private:
+-			long nx,nbax,NbOfEdges;
+-			long* head; 
+-			IntEdge* Edges;
+-
+-		public:
+-
+-			// Constructors
+-			SetOfEdges4(long ,long);// nb Edges mx , nb de sommet 
+-			~SetOfEdges4() {delete [] head; delete [] Edges;}
+-
+-			//operators
+-			IntEdge & operator[](long k){return  Edges[k];}
+-
+-			//Methods
+-			long add (long ii,long jj);
+-			long SortAndAdd (long ii,long jj);
+-			long nb();
+-			long find (long ii,long jj);
+-			long SortAndFind (long ii,long jj);
+-			long i(long k);
+-			long j(long k);
+-			long newarete(long k);
+-	};
+-}
+-#endif 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgGeom.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgGeom.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgGeom.cpp	(revision 12821)
+@@ -1,34 +0,0 @@
+-#include <stdio.h>
+-#include "../objects.h"
+-#include "../../io/io.h"
+-#include "../../shared/shared.h"
+-
+-/*Constructors/Destructors*/
+-/*FUNCTION 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;
+-	this->TangentAtEdgesSize[0]=0,    this->TangentAtEdgesSize[1]=0;    this->TangentAtEdges=NULL;
+-	this->CornersSize[0]=0,           this->CornersSize[1]=0;           this->Corners=NULL;
+-	this->RequiredVerticesSize[0]=0,  this->RequiredVerticesSize[1]=0;  this->RequiredVertices=NULL;
+-	this->RequiredEdgesSize[0]=0,     this->RequiredEdgesSize[1]=0;     this->RequiredEdges=NULL;
+-	this->CrackedEdgesSize[0]=0,      this->CrackedEdgesSize[1]=0;      this->CrackedEdges=NULL;
+-	this->SubDomainsSize[0]=0,        this->SubDomainsSize[1]=0;        this->SubDomains=NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BamgGeom::~BamgGeom(){{{*/
+-BamgGeom::~BamgGeom(){
+-
+-	xDelete<double>(this->Vertices);
+-	xDelete<double>(this->Edges);
+-	xDelete<double>(this->TangentAtEdges);
+-	xDelete<double>(this->Corners);
+-	xDelete<double>(this->RequiredVertices);
+-	xDelete<double>(this->RequiredEdges);
+-	xDelete<double>(this->CrackedEdges);
+-	xDelete<double>(this->SubDomains);
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/CrackedEdge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/CrackedEdge.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/CrackedEdge.cpp	(revision 12821)
+@@ -1,33 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "CrackedEdge.h"
+-
+-namespace bamg {
+-
+-	/*Constructors/Destructors*/
+-	/*FUNCTION CrackedEdge() {{{*/
+-	CrackedEdge::CrackedEdge() {
+-		a=NULL;
+-		b=NULL;
+-		E=NULL;
+-		e1=NULL;
+-		e2=NULL;
+-		indexa[0]=-1;
+-		indexa[1]=-1;
+-		indexa[2]=-1;
+-		indexb[0]=-1;
+-		indexb[1]=-1;
+-		indexb[2]=-1;
+-		length=0;
+-		normal.x=0;
+-		normal.y=0;
+-
+-	}
+-	/*}}}*/
+-
+-	/*Methods*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomEdge.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomEdge.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomEdge.h	(revision 12821)
+@@ -1,47 +0,0 @@
+-#ifndef _GEOMETRICALEDGE_H_
+-#define _GEOMETRICALEDGE_H_
+-
+-#include "./include.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class GeomVertex;
+-	class Geometry;
+-
+-	class GeomEdge {
+-
+-		public:
+-			GeomVertex *v[2];
+-			long               ReferenceNumber;
+-			long               CurveNumber;
+-			R2                 tg[2];              // the 2 tangentes (tg[0] =0 => no continuity)
+-			GeomEdge   *Adj[2];
+-			int                AdjVertexIndex[2]; // for a given vertex, this gives the index of the vertex in the adjacent edge (0 or 1)
+-			int                type;
+-
+-			//Operators
+-			GeomVertex       & operator[](int i){return *v[i];};
+-			const GeomVertex & operator[](int i) const { return *v[i];};
+-			GeomVertex       * operator()(int i){return v[i];};  
+-
+-			//Methods
+-			R2     F(double theta) const ; // parametrization of the curve edge
+-			double R1tg(double theta,R2 &t) const ; // 1/radius of curvature + tangente
+-			int    Tg(int i) const;
+-			int    Cracked() const;
+-			int    TgA()     const;
+-			int    TgB()     const;
+-			int    Mark()    const;
+-			int    Required();
+-			void   SetCracked();
+-			void   SetTgA();
+-			void   SetTgB();
+-			void   SetMark();
+-			void   SetUnMark();
+-			void   SetRequired();
+-			void   Set(const GeomEdge & rec,const Geometry & Th ,Geometry & ThNew);
+-	};
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SubDomain.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SubDomain.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SubDomain.cpp	(revision 12821)
+@@ -1,28 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "SubDomain.h"
+-#include "Mesh.h"
+-
+-namespace bamg {
+-
+-	/*Constructors/Destructors*/
+-
+-	/*Methods*/
+-	/*FUNCTION SubDomain::Set {{{*/
+-	void SubDomain::Set(const Mesh & Th ,long i,Mesh & ThNew){
+-		*this = Th.subdomains[i];
+-		if ( head-Th.triangles<0 || head-Th.triangles>=Th.nbt){
+-			_error2_("head-Th.triangles<0 || head-Th.triangles>=Th.nbt");
+-		}
+-		head = ThNew.triangles + Th.GetId(head) ; 
+-		if (edge-Th.edges<0 || edge-Th.edges>=Th.nbe);{
+-			_error2_("edge-Th.edges<0 || edge-Th.edges>=Th.nbe");
+-		}
+-		edge = ThNew.edges+ Th.GetId(edge);
+-	}
+-	/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgMesh.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgMesh.cpp	(revision 12821)
+@@ -1,56 +0,0 @@
+-#include <stdio.h>
+-#include "../objects.h"
+-#include "../../io/io.h"
+-#include "../../shared/shared.h"
+-
+-/*Constructors/Destructors*/
+-/*FUNCTION 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;
+-	this->TrianglesSize[0]=0,                 this->TrianglesSize[1]=0;                this->Triangles=NULL;
+-	this->QuadrilateralsSize[0]=0,            this->QuadrilateralsSize[1]=0;           this->Quadrilaterals=NULL;
+-
+-	this->SubDomainsSize[0]=0,                this->SubDomainsSize[1]=0;               this->SubDomains=NULL;
+-	this->SubDomainsFromGeomSize[0]=0,        this->SubDomainsFromGeomSize[1]=0;       this->SubDomainsFromGeom=NULL;
+-	this->CrackedVerticesSize[0]=0,           this->CrackedVerticesSize[1]=0;          this->CrackedVertices=NULL;
+-	this->CrackedEdgesSize[0]=0,              this->CrackedEdgesSize[1]=0;             this->CrackedEdges=NULL;
+-
+-	this->VerticesOnGeomVertexSize[0]=0,      this->VerticesOnGeomVertexSize[1]=0;     this->VerticesOnGeomVertex=NULL;
+-	this->VerticesOnGeomEdgeSize[0]=0,        this->VerticesOnGeomEdgeSize[1]=0;       this->VerticesOnGeomEdge=NULL;
+-	this->EdgesOnGeomEdgeSize[0]=0,           this->EdgesOnGeomEdgeSize[1]=0;          this->EdgesOnGeomEdge=NULL;
+-
+-	this->IssmEdgesSize[0]=0,                 this->IssmEdgesSize[1]=0;                this->IssmEdges=NULL;
+-	this->IssmSegmentsSize[0]=0,              this->IssmSegmentsSize[1]=0;             this->IssmSegments=NULL;
+-
+-	this->ElementConnectivitySize[0]=0,       this->ElementConnectivitySize[1]=0;      this->ElementConnectivity=NULL;
+-	this->NodalConnectivitySize[0]=0,         this->NodalConnectivitySize[1]=0;        this->NodalConnectivity=NULL;
+-	this->NodalElementConnectivitySize[0]=0,  this->NodalElementConnectivitySize[1]=0; this->NodalElementConnectivity=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION BamgMesh::~BamgMesh(){{{*/
+-BamgMesh::~BamgMesh(){
+-
+-	xDelete<double>(this->Vertices);
+-	xDelete<double>(this->Edges);
+-	xDelete<double>(this->Triangles);
+-	xDelete<double>(this->Quadrilaterals);
+-
+-	xDelete<double>(this->SubDomains);
+-	xDelete<double>(this->SubDomainsFromGeom);
+-	xDelete<double>(this->CrackedVertices);
+-	xDelete<double>(this->CrackedEdges);
+-
+-	xDelete<double>(this->VerticesOnGeomVertex);
+-	xDelete<double>(this->VerticesOnGeomEdge);
+-	xDelete<double>(this->EdgesOnGeomEdge);
+-
+-	xDelete<double>(this->IssmEdges);
+-	xDelete<double>(this->IssmSegments);
+-
+-	xDelete<double>(this->ElementConnectivity);
+-	xDelete<double>(this->NodalConnectivity);
+-	xDelete<double>(this->NodalElementConnectivity);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Metric.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Metric.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Metric.cpp	(revision 12821)
+@@ -1,353 +0,0 @@
+-#include <cstdio>
+-#include <string.h>
+-#include <cmath>
+-
+-#include "Metric.h"
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-
+-using namespace std;
+-
+-namespace bamg {
+-
+-	SaveMetricInterpole  LastMetricInterpole;
+-
+-	/*Constructor/Destructor*/
+-	/*FUNCTION Metric::Metric(double 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){
+-	
+-	}/*}}}*/
+-	/*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 ){
+-		/*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,
+-					a[0]*m0.a21 + a[1]*m1.a21 + a[2]*m2.a21,
+-					a[0]*m0.a22 + a[1]*m1.a22 + a[2]*m2.a22);
+-
+-		EigenMetric vab(mab);
+-
+-		R2 v1(vab.v.x,vab.v.y);
+-		R2 v2(-v1.y,v1.x);
+-
+-		double h1 = a[0] / m0(v1) + a[1] / m1(v1) + a[2] / m2(v1);
+-		double h2 = a[0] / m0(v2) + a[1] / m1(v2) + a[2] / m2(v2);
+-
+-		vab.lambda1 =  1 / (h1*h1);
+-		vab.lambda2 =  1 / (h2*h2);
+-		*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) { 
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/EigenMetric)*/
+-
+-		/*Compute metric (linear combination of ma and mb)*/
+-		Metric mab(a*ma.a11+b*mb.a11,a*ma.a21+b*mb.a21,a*ma.a22+b*mb.a22);
+-
+-		/*Get Eigen values and vectors*/
+-		EigenMetric vab(mab);
+-		R2 v1(vab.v.x,vab.v.y);
+-		R2 v2(-v1.y,v1.x);
+-
+-		/*Modify eigen values (a+b=1)*/
+-		double h1 = a/ma(v1) + b/mb(v1);
+-		double h2 = a/ma(v2) + b/mb(v2);
+-		vab.lambda1 =  1/(h1*h1);
+-		vab.lambda2 =  1/(h2*h2);
+-		*this=vab;
+-	}
+-	/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION Metric::det{{{*/
+-	double Metric::det() const {
+-		return a11*a22-a21*a21;
+-	}  /*}}}*/
+-	/*FUNCTION Metric::Echo {{{*/
+-	void Metric::Echo(void){
+-
+-		_printLine_("Metric:");
+-		_printLine_("   [a11 a21 a22]: [" << a11 << " " << a21 << " " << a22 << "]");
+-
+-		return;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Metric::IntersectWith{{{*/
+-	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)
+-		 * and a new metric given in input M2 using a 
+-		 * Simultaneous Matrix Reduction:
+-		 * If M1 and M2 are 2 metrics, we must build N=M1^-1 M2 (Alauzet2003 p16) 
+-		 * the eigen vectors of N form a matrix P
+-		 * The new metric M = M1 inter M2 is then given by:
+-		 *
+-		 *      -T [ max(lambda1, mu1)          0         ]  -1				 
+-		 * M = P   [                                      ] P		 
+-		 *         [        0            max(lambda2, mu2)] 
+-		 *
+-		 * where lambdai and mui can be computed using Rayleigh formula: 
+-		 *    lambdai = vi' M1 vi
+-		 * with vi eigen vectors of N (columns of P)
+-		 */
+-
+-		int         change=0;
+-		Metric &M1=*this;
+-		D2xD2       P;
+-
+-		//Get P, eigen vectors of N=inv(M1) M2
+-		SimultaneousMatrixReduction(*this,M2,P);
+-
+-		//extract the eigen vectors of P (columns)
+-		R2 v1(P.x.x,P.y.x);
+-		R2 v2(P.x.y,P.y.y);
+-
+-		//compute lambdai mui
+-		double lambda1=M1(v1,v1);
+-		double lambda2=M1(v2,v2);
+-		double mu1=M2(v1,v1);
+-		double mu2=M2(v2,v2);
+-
+-		//check where any change needs to be done on M1
+-		if ( lambda1 < mu1 )  change=1,lambda1=mu1;
+-		if ( lambda2 < mu2 )  change=1,lambda2=mu2; 
+-
+-		//update M1 if necessary
+-		if (change) {
+-			D2xD2 invP(P.inv());
+-			D2xD2 D(lambda1,0,0,lambda2); 
+-			D2xD2 M(invP.t()*D*invP);
+-			a11=M.x.x;
+-			a21=0.5*(M.x.y+M.y.x);
+-			a22=M.y.y;
+-		}
+-		return change;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Metric::mul{{{*/
+-	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) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/LengthInterpole)*/
+-
+-		double k=1./2.;
+-		int level=0;
+-		static int kkk=0;
+-		static  Metric Ms1[32],Ms2[32];
+-		static double lMs1[32],lMs2[32];
+-		static double K[32];
+-		double l=0,sss=0;
+-		Ms1[level]=Ma;
+-		Ms2[level]=Mb;
+-		double sa =  Ma(AB);
+-		double sb =  Mb(AB);
+-		lMs1[level]=sa;
+-		lMs2[level]=sb;
+-		K[level]=k;
+-		level++;
+-		int i=0;
+-		double * L= LastMetricInterpole.L, *S = LastMetricInterpole.S;
+-		double  sstop = 0.1; // Max(0.6,(sa+sb)/5000);
+-		while (level) {
+-			level--;
+-			Metric M1=Ms1[level];
+-			Metric M2=Ms2[level];
+-			k=K[level];
+-			double s1=  lMs1[level];
+-			double s2=  lMs2[level];
+-
+-			double s= (s1+s2)*k;
+-			if( s > sstop   && level < 30 && i < 500-level ) {
+-				Metric Mi(0.5,M1,0.5,M2);
+-				double si = Mi(AB);
+-				if( Abs((s1+s2)-(si+si)) > s1*0.001) 
+-				  {
+-					k=k/2;
+-					// we begin by the end to walk in the correct direction from a to b
+-					// due to the stack 
+-					Ms1[level]=Mi;
+-					Ms2[level]=M2;
+-					lMs1[level]=si;
+-					lMs2[level]=s2;
+-					K[level]=k;
+-					level++;
+-					Ms1[level]=M1;
+-					Ms2[level]=Mi;
+-					lMs1[level]=s1;
+-					lMs2[level]=si;
+-					K[level]=k;
+-					level++;
+-				  }
+-				else
+-				 L[i]= l += s,S[i]=sss+=k,i++;
+-			}
+-			else 
+-			 L[i]= l += s,S[i]=sss+=k,i++;
+-		}
+-		// warning for optimisation S is in [0:0.5] not in [0:1]
+-		if (i>=512){
+-			_error2_("i>=512");
+-		}
+-		LastMetricInterpole.lab=l;
+-		LastMetricInterpole.opt=i;
+-		if (i>200 && kkk++<10) _printLine_("WARNING: LengthInterpole: ( i=" << i << " l=" << l << " sss=" << sss << " ) " << sstop); 
+-		return l;
+-	}
+-	/*}}}*/
+-	/*FUNCTION SimultaneousMatrixReduction{{{*/
+-	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 
+-		 * eigen vectors of N=inv(M1) M2.
+-		 * Instead of looking at N directly, we are going to use the fact that
+-		 * M1 and M2 are symmetrical, positive definite. 
+-		 * The eigen values of N are given by solving
+-		 *    inv(M1) M2 V = lambda V
+-		 * which is equivalent to
+-		 *    M2 V = lambda M1 V
+-		 * and we will hence solve
+-		 *    (M2 - lambda M1) V = 0
+-		 */
+-
+-		//M1 and M2 components
+-		double a11=M1.a11,a21=M1.a21,a22=M1.a22;
+-		double b11=M2.a11,b21=M2.a21,b22=M2.a22;
+-
+-		/*To get the eigen values, we solve the following problem:
+-		 *    det(M2-lambda M1) = 0
+-		 *    (b11 - lambda a11)(b22-lambda a22) - (b21-lambda a21)^2
+-		 * and we have the following trinome:
+-		 *    a lambda^2 + b lambda + c =0
+-		 * with:
+-		 *    a = a11 a22 - a21 a21 (=det(M1))
+-		 *    b = -a11 b22 -b11 a22 + 2 b21 a21
+-		 *    c = b11 b22 - b21 b21 (=det(M2))
+-		 *    */
+-		const double a= a11*a22  - a21*a21;
+-		const double b=-a11*b22 - b11*a22+2*b21*a21;
+-		const double c=-b21*b21 + b11*b22;
+-		const double bb=b*b,ac=a*c;
+-		const double delta= bb-4*ac;
+-
+-		// first, case of a double root if:
+-		//  - all the terms are very small (a??)
+-		//  - or : delta is very small
+-		if ( (bb + Abs(ac) < 1.0e-34 ) ||  (delta < 1.0e-6*bb) ){
+-			//all vectors are eigen vectors -> choose 1,0 and 0,1
+-			V= D2xD2(1,0,0,1);
+-		}
+-
+-		//general case: two distinct roots: lambda1 and lambda2
+-		else {
+-
+-			/*Compute eigen values*/
+-			const double delta2 = sqrt(delta);
+-			double lambda[2];
+-			lambda[0]= (-b - delta2)/(2*a);
+-			lambda[1]= (-b + delta2)/(2*a);
+-
+-			/*compute eigen vectors*/
+-			double vp[2][2];
+-			double v0,v1,v2;
+-			double s0,s1;
+-
+-			for(int i=0;i<2;i++){
+-				/*Now, one must find the eigen vectors. For that we use the 
+-				 * following property of the inner product
+-				 *    (Ax,b) = transp(b) Ax = transp(x) transp(A) b
+-				 *           = (transp(A) b ,x)
+-				 * Here we are dealing with A= M2 - lambda M1 which is symmetrical:
+-				 *    for all (x,y) in R2 
+-				 *       ((M2 - lambda M1)x,y)=((M2 - lambda M1)y,x)
+-				 * If y is in Ker(M2 - lambda M1):
+-				 *    for all x in R2
+-				 *       ((M2 - lambda M1)y,x)=0
+-				 * This shows that:
+-				 *    Ker(M2 - lambda M1) is orthogonal to Im(M2 - lambda M1)
+-				 * To find the eigen vectors, we only have to find two vectors
+-				 * of the image and take their perpendicular as long as they are
+-				 * not 0.
+-				 * To do that, we take (1,0) and (0,1) and take the larger norm*/
+-
+-				//compute V = M2 - lambdai M1
+-				v0 = b11 - lambda[i]*a11;
+-				v1 = b21 - lambda[i]*a21;
+-				v2 = b22 - lambda[i]*a22;
+-
+-				// compute s1=norm(V(1,0)) and s0=norm(V(0,1))
+-				s0 = v0*v0 + v1*v1;
+-				s1 = v1*v1 + v2*v2;
+-
+-				//compute vp1 = (vp1x,vp1y)
+-				if(s1 < s0){
+-					s0=sqrt(s0);
+-					vp[0][i]=   v1/s0;
+-					vp[1][i]= - v0/s0;
+-				}
+-				else{
+-					s1=sqrt(s1);
+-					vp[0][i]=   v2/s1;
+-					vp[1][i]= - v1/s1;
+-				}
+-			}
+-
+-			//compute V from vp
+-			V=D2xD2(vp[0][0],vp[0][1],vp[1][0],vp[1][1]);
+-		}
+-	}
+-	/*}}}*/
+-	/*FUNCTION abscisseInterpole{{{*/
+-	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);
+-		double l  = s* LastMetricInterpole.lab,r;
+-		int j=LastMetricInterpole.opt-1;
+-
+-		double * L= LastMetricInterpole.L, *S = LastMetricInterpole.S;
+-		// warning for optimisation S is the abcisse in [0:0.5]
+-		// and L is le lenght 
+-		if(l<=L[0]){
+-			r=2*S[0]*l/L[0];
+-		}
+-		else if (l>=L[j]){
+-			r=1;
+-		}
+-		else{
+-			int i=0;
+-			while (j-i>1){
+-				int k;
+-				k= (i+j)/2;
+-				if(l<=L[k]){
+-					j=k;// l<=L[j] 
+-				}
+-				else{
+-					i=k; //  L[i]<l
+-				}
+-			};
+-			if (i==j){
+-				r = 2*S[i];
+-			}
+-			else{
+-				r =  2*(S[i]*(L[j]-l)+ S[j]*(l-L[i]))/(L[j]-L[i]);
+-			}
+-		}
+-		if (r>1 || r<0){
+-			_error2_("r>1 || r<0");
+-		}
+-		return r ;
+-	}
+-	/*}}}*/
+-
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Curve.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Curve.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Curve.cpp	(revision 12821)
+@@ -1,37 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "Curve.h"
+-#include "Geometry.h"
+-
+-namespace bamg {
+-
+-	/*Constructors/Destructors*/
+-	/*FUNCTION Curve::Curve(){{{*/
+-	Curve::Curve(){
+-		FirstEdge=NULL;
+-		LastEdge=NULL;
+-		FirstVertexIndex=0;
+-		LastVertexIndex=0;
+-	} 
+-	/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION Curve::Reverse {{{*/
+-	void Curve::Reverse() {
+-		/*reverse the direction of the curve */
+-		Exchange(FirstEdge,LastEdge);
+-		Exchange(FirstVertexIndex,LastVertexIndex);
+-	}
+-	/*}}}*/
+-	/*FUNCTION Curve::Set {{{*/
+-	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: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomVertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomVertex.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomVertex.cpp	(revision 12821)
+@@ -1,38 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "GeomVertex.h"
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-
+-namespace bamg {
+-
+-	/*Constructors/Destructors*/
+-	//See header file
+-
+-	/*Methods*/
+-	/*FUNCTION GeomVertex::Corner {{{*/
+-	int  GeomVertex::Corner() const {
+-		return type & 4;
+-	}
+-	/*}}}*/
+-	/*FUNCTION GeomVertex::Required {{{*/
+-	int  GeomVertex::Required()const {
+-		// a corner is required
+-		return type & 6;
+-	}
+-	/*}}}*/
+-	/*FUNCTION GeomVertex::SetCorner {{{*/
+-	void GeomVertex::SetCorner(){
+-		type |= 4;
+-	}
+-	/*}}}*/
+-	/*FUNCTION GeomVertex::SetRequired {{{*/
+-	void GeomVertex::SetRequired(){
+-		type |= 2;
+-	}
+-	/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Direction.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Direction.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Direction.h	(revision 12821)
+@@ -1,21 +0,0 @@
+-#ifndef _DIRECTION_H_
+-#define _DIRECTION_H_
+-
+-#include "./include.h"
+-#include "../../shared/Bamg/shared.h"
+-
+-namespace bamg {
+-
+-	class Direction {
+-		private:
+-			Icoor1 dir;
+-
+-		public:
+-			//Methods
+-			Direction();
+-			Direction(Icoor1 i,Icoor1 j);
+-			int direction(Icoor1 i,Icoor1 j);
+-	};
+-}
+-#endif
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnGeom.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnGeom.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnGeom.h	(revision 12821)
+@@ -1,46 +0,0 @@
+-#ifndef _VERTEXONGEOM_H_
+-#define _VERTEXONGEOM_H_
+-
+-#include "./include.h"
+-#include "./GeomVertex.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class Mesh;
+-	class BamgVertex;
+-	class GeomEdge;
+-
+-	class VertexOnGeom{
+-
+-		public:
+-
+-			BamgVertex* meshvertex;
+-			double curvilincoord;  
+-			union{ 
+-				GeomVertex* gv; // if curvilincoord <0; 
+-				GeomEdge*   ge; // if curvilincoord in [0..1]
+-			};
+-
+-			//Constructors/Destructors
+-			VertexOnGeom();
+-			VertexOnGeom(BamgVertex & m,GeomVertex &g);
+-			VertexOnGeom(BamgVertex & m,GeomEdge &g,double s);
+-
+-			//Operators
+-			operator BamgVertex*() const  {return meshvertex;}
+-			operator GeomVertex * () const  {return gv;}
+-			operator GeomEdge * () const  {return ge;}
+-			operator const double & () const {return curvilincoord;}
+-
+-			//Methods
+-			int  OnGeomVertex()const;
+-			int  OnGeomEdge() const;
+-			int  IsRequiredVertex();
+-			void SetOn();
+-
+-			//Inline methods
+-			void Set(const VertexOnGeom&,const Mesh &,Mesh &);  
+-	};
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/R2.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/R2.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/R2.h	(revision 12821)
+@@ -1,105 +0,0 @@
+-/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, R2.h)*/
+-#ifndef _R2_H
+-#define _R2_H
+-
+-#include <cstdio>
+-
+-namespace bamg {
+-
+-	template <class R,class RR> class P2{
+-
+-		  public:  
+-
+-			  //fields
+-			  R x,y;
+-
+-			  //functions
+-			  P2 () :x(0),y(0) {};
+-			  P2 (R a,R b)  :x(a),y(b)  {}
+-			  P2 (P2 A,P2 B) : x(B.x-A.x),y(B.y-A.y) {}
+-			  void Echo(){
+-				  printf("Member of P2:\n");
+-				  printf("   x: %g or %i\n",x,x);
+-				  printf("   y: %g or %i\n",y,y);
+-			  }
+-			  //operators
+-			  RR       operator,(const P2<R,RR> & cc) const {return  (RR) x* (RR) cc.x+(RR) y* (RR) cc.y;} //scalar product
+-			  P2<R,RR> operator+(const P2<R,RR> & cc) const {return P2<R,RR>(x+cc.x,y+cc.y);}
+-			  P2<R,RR> operator-(const P2<R,RR> & cc) const {return P2<R,RR>(x-cc.x,y-cc.y);}
+-			  P2<R,RR> operator-()  const{return P2<R,RR>(-x,-y);}
+-			  P2<R,RR> operator*(R  cc) const {return P2<R,RR>(x*cc,y*cc);}
+-			  P2<R,RR> operator/(R  cc) const {return P2<R,RR>(x/cc,y/cc);}
+-			  P2<R,RR> operator+=(const  P2<R,RR> & cc) {x += cc.x;y += cc.y;return *this;}
+-			  P2<R,RR> operator/=(const  R r) {x /= r;y /= r;return *this;}
+-			  P2<R,RR> operator*=(const  R r) {x *= r;y *= r;return *this;}
+-			  P2<R,RR> operator-=(const  P2<R,RR> & cc) {x -= cc.x;y -= cc.y;return *this;}
+-
+-	  };
+-
+-	template <class R,class RR> class P2xP2{
+-
+-		  private:
+-
+-			  friend P2<R,RR> operator*(P2<R,RR> c,P2xP2<R,RR> cc){
+-				  return P2<R,RR>(c.x*cc.x.x + c.y*cc.y.x, c.x*cc.x.y + c.y*cc.y.y);
+-			  } 
+-		  public:
+-
+-			  //fields
+-			  P2<R,RR> x,y; 
+-
+-			  //functions
+-			  P2xP2 (): x(),y()  {}
+-			  P2xP2 (P2<R,RR> a,P2<R,RR> b): x(a),y(b) {}
+-			  P2xP2 (P2<R,RR> a,P2<R,RR> b,P2<R,RR> c ): x(b-a),y(c-a) {}
+-			  P2xP2 (R xx,R xy,R yx,R yy) :x(xx,xy),y(yx,yy) {}
+-			  void Echo(){
+-				  printf("Member of P2xP2:\n");
+-				  printf("   x.x: %g   x.y: %g\n",x.x,x.y);
+-				  printf("   y.x: %g   y.x: %g\n",y.x,y.y);
+-			  }
+-			  RR          det() const {return (RR) x.x* (RR) y.y - (RR) x.y * (RR) y.x;}
+-			  P2xP2<R,RR> inv()  const{
+-				  RR d = (*this).det(); 
+-				  return P2xP2<R,RR>((R)( y.y /d) ,(R)(-x.y/d),(R)( -y.x/d) ,(R)( x.x/d) );
+-			  };
+-			  P2xP2<R,RR> t()  {return P2xP2<R,RR>(x.x,y.x,x.y,y.y);} //transposer 
+-			  P2<R,RR>    tx() {return P2<R,RR>(x.x,y.x);} 
+-			  P2<R,RR>    ty() {return P2<R,RR>(x.y,y.y);} 
+-			  //Operators
+-			  P2<R,RR>     operator*(const P2<R,RR>& c) const {return P2<R,RR>(x.x*c.x + x.y*c.y, y.x*c.x + y.y*c.y);}
+-			  P2xP2<R,RR>  operator*(P2xP2<R,RR> c) const{
+-				  return  P2xP2<R,RR>(x.x*c.x.x + x.y*c.y.x,
+-							  x.x*c.x.y + x.y*c.y.y,
+-							  y.x*c.x.x + y.y*c.y.x,
+-							  y.x*c.x.y + y.y*c.y.y);
+-			  }
+-	  };  
+-
+-	//inline functions
+-	template  <class R,class RR>  
+-	  inline RR Det(const P2<R,RR> x,const P2<R,RR> y) {
+-		  return (RR) x.x * (RR) y.y - (RR) x.y * (RR) y.x ;
+-	  } 
+-	template  <class R,class RR>  
+-	  inline RR Area2 (const P2<R,RR> a,const P2<R,RR> b,const P2<R,RR> c) {
+-		  return Det(b-a,c-a) ;
+-	  }
+-	template  <class R,class RR>  
+-	  inline R Norme1 (const P2<R,RR> x) {
+-		  return (Abs(x.x)+Abs(x.y)) ;
+-	  } 
+-	template  <class R,class RR>  
+-	  inline RR Norme2_2 (const P2<R,RR> x) {
+-		  return (RR)x.x*(RR)x.x + (RR)x.y*(RR)x.y ;
+-	  } 
+-	template  <class R,class RR>  
+-	  inline RR Norme2 (const P2<R,RR> x) {
+-		  return sqrt((RR)x.x*(RR)x.x + (RR)x.y*(RR)x.y) ;
+-	  } 
+-	template  <class R,class RR>  
+-	  inline P2<R,RR> Orthogonal (const P2<R,RR> x) {
+-		  return  P2<R,RR>(-x.y,x.x);
+-	  } 
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomSubDomain.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomSubDomain.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomSubDomain.cpp	(revision 12821)
+@@ -1,20 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "GeomSubDomain.h"
+-#include "Geometry.h"
+-
+-namespace bamg {
+-
+-	/*Constructors/Destructors*/
+-
+-	/*Methods*/
+-	/*FUNCTION GeomSubDomain::Set {{{*/
+-	void GeomSubDomain::Set(const GeomSubDomain & rec,const Geometry & Gh ,const Geometry & GhNew){
+-		*this = rec;
+-		edge = Gh.GetId(edge) + GhNew.edges;
+-	}/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Geometry.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Geometry.cpp	(revision 12821)
+@@ -1,971 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "../objects.h"
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-
+-namespace bamg {
+-
+-	static const  Direction NoDirOfSearch=Direction();
+-
+-	/*Constructors/Destructors*/
+-	/*FUNCTION Geometry::Geometry(){{{*/
+-	Geometry::Geometry(){
+-		Init();
+-	}
+-	/*}}}*/
+-	/*FUNCTION 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) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Geometry)*/
+-
+-		long i;
+-		*this = Gh;
+-		NbRef =0;
+-		quadtree=0;
+-		vertices = nbv ? new GeomVertex[nbv] : NULL;
+-		edges = nbe ? new GeomEdge[nbe]:NULL;
+-		curves= nbcurves ? new Curve[nbcurves]:NULL;
+-		subdomains = nbsubdomains ? new GeomSubDomain[nbsubdomains]:NULL;
+-		for (i=0;i<nbe;i++)
+-		 edges[i].Set(Gh.edges[i],Gh,*this);
+-		for (i=0;i<nbcurves;i++)
+-		 curves[i].Set(Gh.curves[i],Gh,*this);
+-		for (i=0;i<nbsubdomains;i++)
+-		 subdomains[i].Set(Gh.subdomains[i],Gh,*this);
+-	}
+-	/*}}}*/
+-	/*FUNCTION Geometry::~Geometry(){{{*/
+-	Geometry::~Geometry() {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/~Geometry)*/
+-		if(NbRef>0){   _printString_("Trying to delete geometry and NbRef>0, probably due to an error"); return;}
+-		if(vertices)   delete [] vertices;  vertices=0;
+-		if(edges)      delete [] edges;     edges=0;
+-		if(quadtree)   delete    quadtree;  quadtree=0;
+-		if(curves)     delete [] curves;    curves=0;nbcurves=0;
+-		if(subdomains) delete [] subdomains;subdomains=0;
+-		Init();
+-	}
+-	/*}}}*/
+-
+-	/*IO*/
+-	/*FUNCTION Geometry::ReadGeometry{{{*/
+-	void Geometry::ReadGeometry(BamgGeom* bamggeom,BamgOpts* bamgopts){
+-
+-		int verbose;
+-		nbv=0;
+-		nbe=0;
+-		nbcurves=0;
+-
+-		double Hmin = HUGE_VAL;// the infinie value 
+-		int i,j,k,n,i0,i1,i2,i3;
+-
+-		/*initialize some variables*/
+-		verbose= bamgopts->verbose;
+-		nbv    = bamggeom->VerticesSize[0];
+-		nbe    = bamggeom->EdgesSize[0];
+-
+-		//some checks
+-		if (bamggeom->Vertices==NULL) _error2_("the domain provided does not contain any vertex");
+-		if (bamggeom->Edges==NULL) _error2_("the domain provided does not contain any edge");
+-
+-		//Vertices
+-		if (bamggeom->Vertices){
+-			if(verbose>5) _printLine_("      processing Vertices");
+-			if (bamggeom->VerticesSize[1]!=3) _error2_("Vertices should have 3 columns");
+-			vertices = new GeomVertex[nbv];
+-			for (i=0;i<nbv;i++) {
+-				vertices[i].r.x=(double)bamggeom->Vertices[i*3+0];
+-				vertices[i].r.y=(double)bamggeom->Vertices[i*3+1];
+-				vertices[i].ReferenceNumber=(long)bamggeom->Vertices[i*3+2];
+-				vertices[i].DirOfSearch=NoDirOfSearch;
+-				vertices[i].color =0;
+-				vertices[i].type=0;
+-			}
+-			/*find domain extrema (pmin,pmax) that will define the square box used for by the quadtree*/
+-			pmin =  vertices[0].r;
+-			pmax =  vertices[0].r;
+-			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);
+-			}
+-			/*Offset pmin and pmax to avoid round-off errors*/
+-			R2 offset = (pmax-pmin)*0.05;
+-			pmin -= offset;
+-			pmax += offset;
+-			/*coefIcoor is the coefficient used for integer coordinates:
+-			 *                       (x-pmin.x)
+-			 * Icoor x = (2^30 -1) ------------ 
+-			 *                          D
+-			 * where D is the longest side of the domain (direction x or y)
+-			 * so that (x-pmin.x)/D is in ]0 1[
+-			 *
+-			 * coefIcoor = (2^30 -1)/D
+-			 */
+-			coefIcoor=(MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
+-			if(coefIcoor<=0) _error2_("coefIcoor should be positive");
+-		}
+-		else{
+-			_error2_("No BamgVertex provided");
+-		}
+-
+-		//Edges
+-		if (bamggeom->Edges){
+-			R2      zerovector(0,0);
+-			double* verticeslength=NULL;
+-
+-			if(verbose>5) _printLine_("      processing Edges");
+-			if (bamggeom->EdgesSize[1]!=3) _error2_("Edges should have 3 columns");
+-			edges = new GeomEdge[nbe];
+-
+-			//initialize verticeslength (sum of the lengths of the edges holding vertex)
+-			verticeslength = new double[nbv];
+-			for(i=0;i<nbv;i++) verticeslength[i]=0;
+-
+-			/*Loop over the edges*/
+-			for (i=0;i<nbe;i++){
+-
+-				i1=(int)bamggeom->Edges[i*3+0]-1; //-1 for C indexing
+-				i2=(int)bamggeom->Edges[i*3+1]-1; //-1 for C indexing
+-				edges[i].v[0]= vertices + i1;     //pointer toward vertex i1 (=&vertices[i1])
+-				edges[i].v[1]= vertices + i2;     //pointer toward vertex i2
+-				edges[i].ReferenceNumber=(long)bamggeom->Edges[i*3+2];
+-
+-				//get length of edge
+-				R2     x12=vertices[i2].r-vertices[i1].r;
+-				double l12=sqrt((x12,x12));
+-				Hmin=Min(Hmin,l12);
+-
+-				//initialize other fields
+-				edges[i].tg[0]=zerovector;
+-				edges[i].tg[1]=zerovector;
+-				edges[i].AdjVertexIndex[0] = edges[i].AdjVertexIndex[1] = -1;
+-				edges[i].Adj[0] = edges[i].Adj[1] = NULL;
+-				edges[i].type = 0;
+-
+-				//Cracked?
+-				if (edges[i].ReferenceNumber!=1) edges[i].SetCracked();
+-
+-				//prepare metric
+-				vertices[i1].color++;
+-				vertices[i2].color++;
+-				verticeslength[i1] += l12;
+-				verticeslength[i2] += l12;
+-			}
+-
+-			// definition the default of the given mesh size 
+-			for (i=0;i<nbv;i++) {
+-				if (vertices[i].color > 0) 
+-				 vertices[i].m=Metric(verticeslength[i] /(double) vertices[i].color);
+-				else 
+-				 vertices[i].m=Metric(Hmin);
+-			}
+-			delete [] verticeslength;
+-			
+-		}
+-		else{
+-			_error2_("No edges provided");
+-		}
+-
+-		//hVertices
+-		if(bamgopts->hVertices && bamgopts->hVerticesSize[0]==nbv){
+-			if(verbose>5) _printLine_("      processing hVertices");
+-			for (i=0;i< nbv;i++){
+-				if (!xIsNan<IssmDouble>(bamgopts->hVertices[i])){
+-					vertices[i].m=Metric((double)bamgopts->hVertices[i]);
+-				}
+-			}
+-		}
+-
+-		//MetricVertices
+-		if(bamgopts->metric && bamgopts->metric[0]==nbv){
+-			if(verbose>5) _printLine_("      processing MetricVertices");
+-			for (i=0;i< nbv;i++) {
+-				vertices[i].m = Metric((double)bamgopts->metric[i*3+0],(double)bamgopts->metric[i*3+1],(double)bamgopts->metric[i*3+2]);
+-			}
+-		}
+-
+-		//MaxCornerAngle
+-		if (bamgopts->MaxCornerAngle){
+-			if(verbose>5) _printLine_("      processing MaxCornerAngle");
+-			MaxCornerAngle=bamgopts->MaxCornerAngle*Pi/180;
+-		}
+-
+-		//TangentAtEdges
+-		if (bamggeom->TangentAtEdges){
+-			if(verbose>5) _printString_("      processing TangentAtEdges");
+-			if (bamggeom->TangentAtEdgesSize[1]!=4) _error2_("TangentAtEdges should have 4 columns");
+-			int n,i,j,k;
+-			R2 tg;
+-
+-			n=bamggeom->TangentAtEdgesSize[0];
+-			for (k=0;k<n;k++) {
+-				i=(int)bamggeom->TangentAtEdges[k*4+0]-1; //for C indexing
+-				j=(int)bamggeom->TangentAtEdges[k*4+1]-1; //for C indexing
+-				tg.x=bamggeom->TangentAtEdges[k*4+2];
+-				tg.y=bamggeom->TangentAtEdges[k*4+3];
+-				if (i<0 || i>=nbe) _error2_("TangentAtEdges first index exceeds matrix dimension");
+-				if (j!=0 && j!=1)  _error2_("TangentAtEdges second index should be 1 or 2 only");
+-				edges[i].tg[j] = tg;
+-			}
+-		}
+-
+-		//Corners
+-		if(bamggeom->Corners){
+-			if(verbose>5) _printString_("      processing Corners");
+-			if (bamggeom->CornersSize[1]!=1) _error2_("Corners should have 1 column");
+-			n=bamggeom->CornersSize[0];
+-			for (i=0;i<n;i++) {     
+-				j=(int)bamggeom->Corners[i]-1; //for C indexing
+-				if (j>nbv-1 || j<0) _error2_("Bad corner definition: should in [0 " << nbv << "]");
+-				/*Required => at the same time SetRequired and SetCorner*/
+-				vertices[j].SetCorner();
+-				vertices[j].SetRequired();
+-			}
+-		}
+-
+-		//RequiredVertices
+-		if(bamggeom->RequiredVertices){
+-			if(verbose>5) _printLine_("      processing RequiredVertices");
+-			if (bamggeom->RequiredVerticesSize[1]!=1) _error2_("RequiredVertices should have 1 column");
+-			n=bamggeom->RequiredVerticesSize[0];
+-			for (i=0;i<n;i++) {     
+-				j=(int)bamggeom->RequiredVertices[i]-1; //for C indexing
+-				if (j>nbv-1 || j<0) _error2_("Bad RequiredVerticess  definition: should in [0 " << nbv << "]");
+-				vertices[j].SetRequired();
+-			}
+-		}
+-
+-		//RequiredEdges
+-		if(bamggeom->RequiredEdges){
+-			if(verbose>5) _printLine_("      processing RequiredEdges");
+-			if (bamggeom->RequiredEdgesSize[1]!=1) _error2_("RequiredEdges should have 1 column");
+-			n=bamggeom->RequiredEdgesSize[0];
+-			for (i=0;i<n;i++) {     
+-				j=(int)bamggeom->RequiredEdges[i]-1; //for C indexing
+-				if (j>nbe-1 || j<0) _error2_("Bad RequiredEdges definition: should in [0 " << nbe << "]");
+-				edges[j].SetRequired();  
+-			}
+-		}
+-
+-		//SubDomain
+-		if(bamggeom->SubDomains){
+-			if(verbose>5) _printLine_("      processing SubDomains");
+-			if (bamggeom->SubDomainsSize[1]!=4) _error2_("SubDomains should have 4 columns");
+-			nbsubdomains=bamggeom->SubDomainsSize[0];
+-			subdomains = new GeomSubDomain[nbsubdomains];
+-			for (i=0;i<nbsubdomains;i++){
+-				i0=(int)bamggeom->SubDomains[i*4+0];
+-				i1=(int)bamggeom->SubDomains[i*4+1];
+-				i2=(int)bamggeom->SubDomains[i*4+2];
+-				i3=(int)bamggeom->SubDomains[i*4+3];
+-				if (i0!=2) _error2_("Bad Subdomain definition: first number should be 2 (for Edges)");
+-				if (i1>nbe || i1<=0) _error2_("Bad Subdomain definition: second number should in [1 " << nbe << "] (edge number)");
+-				subdomains[i].edge=edges + (i1-1);
+-				subdomains[i].direction = (int) i2;
+-				subdomains[i].ReferenceNumber = i3;
+-			}
+-		}
+-	}
+-	/*}}}*/
+-	/*FUNCTION Geometry::WriteGeometry{{{*/
+-	void Geometry::WriteGeometry(BamgGeom* bamggeom, BamgOpts* bamgopts){
+-
+-		int verbose;
+-		int nbreq=0;
+-		int nbreqv=0;
+-		int nbtan=0;
+-		int nbcracked=0;
+-		int i,count;
+-
+-		/*Get options*/
+-		verbose=bamgopts->verbose;
+-
+-		/*Vertices*/
+-		if(verbose>5) _printLine_("      writing Vertices");
+-		bamggeom->VerticesSize[0]=nbv;
+-		bamggeom->VerticesSize[1]=3;
+-		if (nbv){
+-			bamggeom->Vertices=xNew<double>(3*nbv);
+-			for (i=0;i<nbv;i++){
+-				bamggeom->Vertices[i*3+0]=vertices[i].r.x;
+-				bamggeom->Vertices[i*3+1]=vertices[i].r.y;
+-				bamggeom->Vertices[i*3+2]=vertices[i].GetReferenceNumber();
+-
+-				//update counters
+-				if (vertices[i].Required()) nbreqv++;
+-			}
+-		}
+-
+-		/*Edges*/
+-		if(verbose>5) _printLine_("      writing Edges");
+-		bamggeom->EdgesSize[0]=nbe;
+-		bamggeom->EdgesSize[1]=3;
+-		if (nbe){
+-			bamggeom->Edges=xNew<double>(3*nbe);
+-			for (i=0;i<nbe;i++){
+-				bamggeom->Edges[i*3+0]=GetId(edges[i][0])+1; //back to Matlab indexing
+-				bamggeom->Edges[i*3+1]=GetId(edges[i][1])+1; //back to Matlab indexing
+-				bamggeom->Edges[i*3+2]=(double)edges[i].ReferenceNumber;
+-
+-				//update counters
+-				if (edges[i].Required()) nbreq++;
+-				if (edges[i].TgA() && edges[i][0].Corner()) nbtan++;
+-				if (edges[i].TgB() && edges[i][1].Corner()) nbtan++;
+-			}
+-		}
+-
+-		/*RequiredEdges*/
+-		if(verbose>5) _printLine_("      writing " << nbreq << " RequiredEdges");
+-		bamggeom->RequiredEdgesSize[0]=nbreq;
+-		bamggeom->RequiredEdgesSize[1]=1;
+-		if (nbreq){
+-			bamggeom->RequiredEdges=xNew<double>(1*nbreq);
+-			count=0;
+-			for (i=0;i<nbe;i++){
+-				if (edges[i].Required()){
+-					bamggeom->RequiredEdges[count]=i+1; //back to Matlab indexing
+-					count=count+1;
+-				}
+-			}
+-		}
+-
+-		//No corners
+-
+-		/*RequiredVertices*/
+-		if(verbose>5) _printLine_("      writing " << nbreqv << " RequiredVertices");
+-		bamggeom->RequiredVerticesSize[0]=nbreqv;
+-		bamggeom->RequiredVerticesSize[1]=1;
+-		if (nbreqv){
+-			bamggeom->RequiredVertices=xNew<double>(1*nbreqv);
+-			count=0;
+-			for (i=0;i<nbv;i++){
+-				if (vertices[i].Required()){
+-					bamggeom->RequiredVertices[count]=i+1; //back to Matlab indexing
+-					count=count+1;
+-				}
+-			}
+-		}
+-
+-		/*SubDomains*/
+-		if(verbose>5) _printLine_("      writing SubDomains");
+-		bamggeom->SubDomainsSize[0]=nbsubdomains;
+-		bamggeom->SubDomainsSize[1]=4;
+-		if (nbsubdomains){
+-			bamggeom->SubDomains=xNew<double>(4*nbsubdomains);
+-			for (i=0;i<nbsubdomains;i++){
+-				bamggeom->SubDomains[4*i+0]=2;
+-				bamggeom->SubDomains[4*i+1]=GetId(subdomains[i].edge)+1; //back to Matlab indexing
+-				bamggeom->SubDomains[4*i+2]=subdomains[i].direction;
+-				bamggeom->SubDomains[4*i+3]=subdomains[i].ReferenceNumber;
+-			}
+-		}
+-
+-		/*TangentAtEdges*/
+-		if(verbose>5) _printLine_("      writing TangentAtEdges");
+-		bamggeom->TangentAtEdgesSize[0]=nbtan;
+-		bamggeom->TangentAtEdgesSize[1]=4;
+-		if (nbtan){
+-			bamggeom->TangentAtEdges=xNew<double>(4*nbtan);
+-			count=0;
+-			for (i=0;i<nbe;i++){
+-				if (edges[i].TgA() && edges[i][0].Corner()){
+-					bamggeom->TangentAtEdges[4*i+0]=i+1; //back to Matlab indexing
+-					bamggeom->TangentAtEdges[4*i+1]=1;
+-					bamggeom->TangentAtEdges[4*i+2]=edges[i].tg[0].x;
+-					bamggeom->TangentAtEdges[4*i+3]=edges[i].tg[0].y;
+-				}
+-				if (edges[i].TgB() && edges[i][1].Corner()){
+-					bamggeom->TangentAtEdges[4*i+0]=i+1; //back to Matlab indexing
+-					bamggeom->TangentAtEdges[4*i+1]=2;
+-					bamggeom->TangentAtEdges[4*i+2]=edges[i].tg[1].x;
+-					bamggeom->TangentAtEdges[4*i+3]=edges[i].tg[1].y;
+-				}
+-				count=count+1;
+-			}
+-		}
+-	}
+-	/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION Geometry::Echo {{{*/
+-	void Geometry::Echo(void){
+-
+-		_printLine_("Geometry:");
+-		_printLine_("   nbv  (number of vertices) : " << nbv);
+-		_printLine_("   nbe  (number of edges)    : " << nbe);
+-		_printLine_("   nbsubdomains: " << nbsubdomains);
+-		_printLine_("   nbcurves: " << nbcurves);
+-		_printLine_("   vertices: " << vertices);
+-		_printLine_("   edges: " << edges);
+-		_printLine_("   quadtree: " << quadtree);
+-		_printLine_("   subdomains: " << subdomains);
+-		_printLine_("   curves: " << curves);
+-		_printLine_("   pmin (x,y): (" << pmin.x << " " << pmin.y << ")");
+-		_printLine_("   pmax (x,y): (" << pmax.x << " " << pmax.y << ")");
+-		_printLine_("   coefIcoor: " << coefIcoor);
+-		_printLine_("   MaxCornerAngle: " << MaxCornerAngle);
+-
+-		return;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Geometry::Init{{{*/
+-	void Geometry::Init(void){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/EmptyGeometry)*/
+-
+-		NbRef=0;
+-		nbv=0;
+-		nbe=0;
+-		quadtree=NULL;
+-		curves=NULL;
+-		edges=NULL;
+-		vertices=NULL;
+-		nbsubdomains=0;
+-		nbcurves=0;
+-		subdomains=NULL;
+-		MaxCornerAngle = 10*Pi/180; //default is 10 degres
+-	}
+-	/*}}}*/
+-	/*FUNCTION 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() {
+-		return Max(pmax.x-pmin.x,pmax.y-pmin.y);
+-	}/*}}}*/
+-	/*FUNCTION Geometry::GetId(const GeomVertex &t){{{*/
+-	long Geometry::GetId(const GeomVertex & t) const  {
+-		return &t - vertices;
+-	}/*}}}*/
+-	/*FUNCTION Geometry::GetId(const GeomVertex * t){{{*/
+-	long Geometry::GetId(const GeomVertex * t) const  {
+-		return t - vertices;
+-	}/*}}}*/
+-	/*FUNCTION Geometry::GetId(const GeomEdge & t){{{*/
+-	long Geometry::GetId(const GeomEdge & t) const  {
+-		return &t - edges;
+-	}/*}}}*/
+-	/*FUNCTION Geometry::GetId(const GeomEdge * t){{{*/
+-	long Geometry::GetId(const GeomEdge * t) const  {
+-		return t - edges;
+-	}/*}}}*/
+-	/*FUNCTION Geometry::GetId(const Curve * c){{{*/
+-	long Geometry::GetId(const Curve * c) const  {
+-		return c - curves;
+-	}/*}}}*/
+-	/*FUNCTION Geometry::Containing{{{*/
+-	GeomEdge* Geometry::Containing(const R2 P,  GeomEdge * start) const {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Contening)*/
+-
+-		GeomEdge* on =start,* pon=0;
+-		// walk with the cos on geometry
+-		int counter=0;
+-		while(pon != on){  
+-			counter++;
+-			_assert_(counter<100);
+-			pon = on;
+-			R2 A= (*on)[0];
+-			R2 B= (*on)[1];
+-			R2 AB = B-A;
+-			R2 AP = P-A;
+-			R2 BP = P-B;
+-			if ( (AB,AP) < 0) 
+-			 on = on->Adj[0];
+-			else if ( (AB,BP)  > 0) 
+-			 on = on->Adj[1];
+-			else
+-			 return on;
+-		}
+-		return on;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Geometry::PostRead{{{*/
+-	void Geometry::PostRead(){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/AfterRead)*/
+-
+-		long               i,j,k;
+-		int                jj;
+-		long              *head_v   = new long[nbv];
+-		long              *next_p   = new long[2*nbe];
+-		float             *eangle   = new float[nbe];
+-		double             eps      = 1e-20;
+-		BamgQuadtree           quadtree; // build quadtree to find duplicates
+-		BamgVertex        *v0       = vertices;
+-		GeomVertex *v0g      = (GeomVertex*) (void*)v0;
+-
+-		k=0;
+-
+-		//build quadtree for this geometry
+-		for (i=0;i<nbv;i++){
+-
+-			/*build integer coordinates (non unique)
+-			  these coordinates are used by the quadtree to group
+-			  the vertices by groups of 5:
+-			  All the coordinates are transformed to ]0,1[^2
+-			  then, the integer coordinates are computed using 
+-			  the transformation ]0,1[^2 -> [0 2^30-1[^2 for a quadtree of depth 30*/
+-			vertices[i].i=R2ToI2(vertices[i].r); 
+-
+-			/*find nearest vertex already present in the quadtree (NULL if empty)*/
+-			BamgVertex* v=quadtree.NearestVertex(vertices[i].i.x,vertices[i].i.y); 
+-
+-			/*if there is a vertex found that is to close to vertices[i] -> error*/
+-			if( v && Norme1(v->r - vertices[i].r) < eps ){
+-				_printLine_("reference numbers: " << v->ReferenceNumber << " " << vertices[i].ReferenceNumber);
+-				_printLine_("Id: " << i+1);
+-				delete [] next_p;
+-				delete [] head_v;
+-				delete [] eangle;
+-				_error2_("two points of the geometry are very closed to each other (see reference numbers above)");
+-			}
+-
+-			/*Add vertices[i] to the quadtree*/
+-			quadtree.Add(vertices[i]);
+-		}
+-
+-		/* Here we use a powerful chaining algorithm
+-		 *
+-		 * 1. What is a chaining algorithm?
+-		 *
+-		 * If F is a function that goes from i in [0 n] to j in [0 m]
+-		 * and we want to compute the reciprocal function F-1 of F
+-		 * (what are the antecedents of a given j in Im(F) )
+-		 * We use 2 lists:
+-		 *    head_F[j] that holds the head of lists
+-		 *    next_F[i] that holds the list of elements that have the same image
+-		 *
+-		 * Example:
+-		 *    i1, i2, ..., ip in [0,n] are all antecedents of a given j in [0 m]
+-		 *    head_F[j] = ip
+-		 *    next_F[ip]= ip-1
+-		 *    ....
+-		 *    next_F[i2]= i1
+-		 *    next_F[i1]= -1  //end of the list
+-		 *
+-		 * Algorithm:
+-		 *    for(j=0;j<m;j++)  head_F[j] = -1 //initialization
+-		 *    for(i=0;i<n;i++){
+-		 *       j=F[i];
+-		 *       next_F[i]= head_F[j];
+-		 *       head_F[j]=i;
+-		 *    }
+-		 * 
+-		 *    Then, we can go through all the elements that have for image j:
+-		 *    for(i=head_F[j]; i!=-1; i=next_F[i])
+-		 *    initialization of i by i=head_F[j]
+-		 *    stop the loop when i=-1 (end of the chain)
+-		 *    iterate using i=next_F[i] (next element that have for image j)
+-		 * 
+-		 * 2. How to use this algorithm here?
+-		 * 
+-		 * Here F is a function that associates two vertices v0 and v1 for a given edge E
+-		 * We want to build the reciprocal function: what are the edges that contains
+-		 * a vertex v?
+-		 * To do so, we use the same chaining algorithm but there is a difficulty
+-		 * coming from the fact that for F we have a couple of vertices and not one 
+-		 * vertex.
+-		 * To overcome this difficulty, we use a global indexing exactly like in 
+-		 * C/C++ so that
+-		 * a member of a 2-column-table can be described by one index p=i*2+j
+-		 * i=(int)p/2 line number of p
+-		 * j=p%2      column number of p
+-		 *
+-		 * Algorithm:
+-		 *    for(i=0;i<nbv;i++)  head_v[i] = -1 //initialization
+-		 *    for(i=0;i<nbe;i++){
+-		 *       for(j=0;j<2;j++){
+-		 *          p=2*i+j;
+-		 *          v=edges(i,j);
+-		 *          next_p[p]= head_v[v];
+-		 *          head_v[v]=p;
+-		 *       }
+-		 *    }
+-		 */
+-
+-		//initialize head_v as -1
+-		for (i=0;i<nbv;i++) head_v[i]=-1;
+-		k=0;
+-		for (i=0;i<nbe;i++) {
+-			//compute vector of edge i that goes from vertex 0 to vertex 1
+-			R2 v10=edges[i].v[1]->r - edges[i].v[0]->r;
+-			double lv10=Norme2(v10);
+-			//check that its length is not 0
+-			if(lv10==0){
+-				delete [] next_p;
+-				delete [] head_v;
+-				delete [] eangle;
+-				_error2_("Length of edge " << i << " is 0");
+-			}
+-			//compute angle in [-Pi Pi]
+-			eangle[i] = atan2(v10.y,v10.x);
+-			//build chains head_v and next_p
+-			for (j=0;j<2;j++){
+-				long v=GetId(edges[i].v[j]);
+-				next_p[k]=head_v[v];
+-				head_v[v]=k++; //post increment: head_v[v]=k; and then k=k+1;
+-			}
+-		}
+-
+-		//sort head_v by order of increasing edges angle
+-		for (i=0;i<nbv;i++) {
+-			int exch=1,ord=0;      
+-
+-			//exchange vertices position in head_v and next_p till tey are sorted
+-			while (exch){
+-				long *p=head_v+i;               
+-				long *po=p;                     
+-				long  n=*p;                     
+-				register float angleold=-1000 ; // angle = - infinity
+-				ord=0; exch=0;
+-
+-				// loop over the edges that contain the vertex i (till -1)
+-				while (n >=0){
+-					ord++;
+-					long  i1=n/2;       // i1 = floor (n/2)      -> Edge number
+-					long  j1=n%2;       // j1 = 1 if n is odd    -> Vertex index for this edge (0 or 1)
+-					long* pn=next_p+n;
+-
+-					//Next vertex index
+-					n=*pn;                       
+-
+-					//compute angle between horizontal axis and v0->v1
+-					float angle = j1 ? OppositeAngle(eangle[i1]):  eangle[i1]; 
+-
+-					//exchange if the current edge angle is smaller than the previous one
+-					if (angleold > angle){
+-						exch=1;
+-						*pn=*po;  // next_p[n] = n + 1
+-						*po=*p;   // 
+-						*p=n;     // next_p[n+1] = n
+-						po=pn;    // po now point toward pn (invert next and current)
+-					}
+-
+-					//else, continue going to the next edge position
+-					else{                        //  to have : po -> p -> pn
+-						angleold=angle; // update maximum angle
+-						po=p;           // po now point toward p  (current position)
+-						p=pn;           // p  now point toward pn (next position)
+-					}
+-				}
+-			}
+-
+-			// angular test on current vertex to guess whether it is a corner (ord = number of edges holding i)
+-			if(ord==2) { 
+-				long  n1 = head_v[i];
+-				long  n2 = next_p[n1];
+-				long  i1 = n1/2, i2 = n2/2; // edge number
+-				long  j1 = n1%2, j2 = n2%2; // vertex in the edge 
+-				float angle1=  j1 ? OppositeAngle(eangle[i1]) : eangle[i1];
+-				float angle2= !j2 ? OppositeAngle(eangle[i2]) : eangle[i2];
+-				float da12 = Abs(angle2-angle1);
+-				if (( da12 >= MaxCornerAngle ) && (da12 <= 2*Pi -MaxCornerAngle)) {
+-					vertices[i].SetCorner() ; 
+-				}
+-				// if the edge type/referencenumber a changing then is SetRequired();
+-				if (edges[i1].type != edges[i2].type || edges[i1].Required()){
+-					vertices[i].SetRequired();
+-				}
+-				if (edges[i1].ReferenceNumber != edges[i2].ReferenceNumber) {
+-					vertices[i].SetRequired();
+-				}
+-			}
+-			if(ord != 2) {
+-				vertices[i].SetCorner();
+-			}
+-
+-			/*close the list around the vertex to have a circular loop*/
+-			long no=-1, ne = head_v[i];
+-			while (ne >=0) ne = next_p[no=ne];        
+-			if(no>=0) next_p[no] = head_v[i];
+-		}
+-
+-		/*Check that the list makes sense (we have all the time the same vertex)
+-		 * and build adjacent edges*/
+-		k =0;
+-		for (i=0;i<nbe;i++){
+-			for (j=0;j<2;j++){
+-
+-				long n1 = next_p[k++]; 
+-				long i1 = n1/2 ,j1=n1%2;
+-
+-				if( edges[i1].v[j1] != edges[i].v[j]) _error2_("Problem while processing edges: check the edge list");
+-
+-				edges[i1].Adj[j1] = edges + i;
+-				edges[i1].AdjVertexIndex[j1] = j;
+-			}
+-		}
+-
+-		/* generation of  all the tangents*/
+-		for (i=0;i<nbe;i++) {
+-			R2    AB =edges[i].v[1]->r -edges[i].v[0]->r;// AB = vertex0 -> vertex1
+-			double lAB=Norme2(AB);                       // Get length of AB
+-			double ltg2[2]={0.0};                        // initialize tangent
+-
+-			//loop over the 2 vertices of the edge
+-			for (j=0;j<2;j++) {
+-				R2     tg =edges[i].tg[j];
+-				double ltg=Norme2(tg);
+-
+-				//by default, tangent=[0 0]
+-				if(ltg==0){
+-					//if the current vertex of the edge is not a corner
+-					if(!edges[i].v[j]->Corner()){
+-						/*The tangent is set as the vector between the
+-						 * previous and next vertices connected to current vertex
+-						 * normed by the edge length*/
+-						tg = edges[i].v[1-j]->r - edges[i].Adj[j]->v[1-edges[i].AdjVertexIndex[j]]->r;
+-						ltg= Norme2(tg);
+-						tg = tg *(lAB/ltg);
+-						ltg= lAB;
+-					}
+-					//else:  a Corner no tangent => nothing to do    
+-				}
+-				else{
+-					//tangent has already been computed
+-					tg = tg*(lAB/ltg),ltg=lAB;
+-				}
+-
+-				ltg2[j] = ltg;
+-
+-				if ((tg,AB)<0) tg = -tg;
+-
+-				edges[i].tg[j]=tg;
+-			}
+-			if (ltg2[0]!=0) edges[i].SetTgA();
+-			if (ltg2[1]!=0) edges[i].SetTgB();
+-		} 
+-
+-		/* generation of  all curves (from corner to corner)*/
+-		/*We proceed in 2 steps: first allocate, second build*/
+-		for (int step=0;step<2;step++){
+-
+-			//unmark all edges
+-			for (i=0;i<nbe;i++) edges[i].SetUnMark();
+-			long  nb_marked_edges=0;
+-
+-			//initialize number of curves
+-			nbcurves = 0;
+-
+-			for (int level=0;level<2 && nb_marked_edges!=nbe;level++){
+-				for (i=0;i<nbe;i++){
+-
+-					GeomEdge & ei=edges[i];   
+-					for(j=0;j<2;j++){
+-						/*If current edge ei is unmarked and (level=1 or vertex i is required (corner)):
+-						 * we do have the first edge of a new curve*/
+-						if (!ei.Mark() && (level || ei[j].Required())) { 
+-							int k0=j,k1;
+-							GeomEdge   *e=&ei;
+-							GeomVertex *a=(*e)(k0); // begin 
+-							if(curves){
+-								curves[nbcurves].FirstEdge=e;
+-								curves[nbcurves].FirstVertexIndex=k0;
+-							}
+-							int nee=0;
+-							for(;;){ 
+-								nee++;
+-								k1 = 1-k0; // next vertex of the edge 
+-								e->SetMark();
+-								nb_marked_edges++;
+-								e->CurveNumber=nbcurves;
+-								GeomVertex *b=(*e)(k1);
+-
+-								//break if we have reached the other end of the curve
+-								if (a==b || b->Required()){
+-									if(curves){
+-										curves[nbcurves].LastEdge=e;
+-										curves[nbcurves].LastVertexIndex=k1;
+-									}
+-									break;
+-								}
+-								//else: go to next edge (adjacent)
+-								else{
+-									k0 = e->AdjVertexIndex[k1];//  vertex in next edge
+-									e  = e->Adj[k1]; // next edge
+-								}
+-							}
+-							nbcurves++;
+-							if(level) a->SetRequired();
+-						}
+-					}
+-				} 
+-			}
+-			_assert_(nb_marked_edges && nbe);
+-			//allocate if first step
+-			if(step==0) curves=new Curve[nbcurves];
+-		} 
+-
+-		/*clean up*/
+-		delete [] next_p;
+-		delete [] head_v;
+-		delete [] eangle;
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION Geometry::ProjectOnCurve {{{*/
+-	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*/
+-
+-		double save_s=s;
+-		int NbTry=0;
+-
+-retry:
+-
+-		s=save_s;
+-		GeomEdge* on=e.GeomEdgeHook;
+-		if (!on){
+-			_error2_("ProjectOnCurve error message: edge provided should be on geometry");
+-		}
+-		if (!e[0].GeomEdgeHook ||  !e[1].GeomEdgeHook){
+-			_error2_("ProjectOnCurve error message: at least one of the vertex of the edge provided is not on geometry");
+-		}
+-
+-		//Get the two vertices of the edge
+-		const BamgVertex &v0=e[0];
+-		const BamgVertex &v1=e[1];
+-
+-		//Get position of V0, V1 and vector v0->v1
+-		R2 V0=v0,V1=v1,V01=V1-V0;
+-
+-		//Get geometrical vertices corresponding to v0 and v1
+-		VertexOnGeom  vg0=*v0.GeomEdgeHook,  vg1=*v1.GeomEdgeHook;
+-
+-		//build two pointers towrad current geometrical edge
+-		GeomEdge *eg0=on, *eg1=on;
+-
+-		//Get edge direction and swap v0 and v1 if necessary
+-		R2 Ag=(R2)(*on)[0],Bg=(R2)(*on)[1],AB=Bg-Ag; 
+-		int OppositeSens = (V01,AB)<0;
+-		int direction0=0,direction1=1;
+-		if (OppositeSens) s=1-s,Exchange(vg0,vg1),Exchange(V0,V1);
+-
+-		//Compute metric of new vertex as a linear interpolation of the two others
+-		V.m=Metric(1.0-s,v0,s,v1);
+-
+-		const int mxe=100;
+-		GeomEdge* ge[mxe+1];
+-		int     directionge[mxe+1];
+-		double  lge[mxe+1];
+-		int bge=mxe/2,tge=bge;
+-		ge[bge] = e.GeomEdgeHook;
+-		directionge[bge]=1;
+-
+-		while (eg0!=(GeomEdge*)vg0 && (*eg0)(direction0)!=(GeomVertex*)vg0){ 
+-			if (bge<=0) {
+-				if(NbTry) {
+-					_printLine_("Fatal Error: on the class Mesh before call Geometry::ProjectOnCurve");
+-					_printLine_("That bug might come from:");
+-					_printLine_(" 1)  a mesh edge  containing more than " << mxe/2 << " geometrical edges");
+-					_printLine_(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before");
+-					_printLine_("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)");
+-					_error2_("see above");
+-				}
+-				NbTry++;
+-				goto retry;
+-			}
+-			GeomEdge* tmpge = eg0;
+-			ge[--bge] =eg0 = eg0->Adj[direction0];
+-			_assert_(bge>=0 && bge<=mxe);
+-			direction0 = 1-( directionge[bge] = tmpge->AdjVertexIndex[direction0]);
+-		}
+-		while (eg1 != (GeomEdge*) vg1  &&  (*eg1)(direction1) != (GeomVertex*) vg1) { 
+-			if(tge>=mxe ) { 
+-				_printLine_("WARNING: on the class Mesh before call Geometry::ProjectOnCurve is having issues (isn't it Eric?)");
+-				NbTry++;
+-				if (NbTry<2) goto retry;
+-				_printLine_("Fatal Error: on the class Mesh before call Geometry::ProjectOnCurve");
+-				_printLine_("That bug might come from:");
+-				_printLine_(" 1)  a mesh edge  contening more than " << mxe/2 << " geometrical edges");
+-				_printLine_(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before");
+-				_printLine_("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)");
+-				_error2_("see above");
+-			}
+-			GeomEdge* tmpge = eg1;
+-			ge[++tge] =eg1 = eg1->Adj[direction1];
+-			directionge[tge]= direction1 = 1-tmpge->AdjVertexIndex[direction1];
+-			_assert_(tge>=0 && tge<=mxe);
+-		}
+-
+-
+-		if ((*eg0)(direction0)==(GeomVertex*)vg0)
+-		 vg0=VertexOnGeom(*(BamgVertex*) vg0,*eg0,direction0); //vg0 = absisce
+-
+-		if ((*eg1)(direction1)==(GeomVertex*)vg1)
+-		 vg1=VertexOnGeom(*(BamgVertex*) vg1,*eg1,direction1);
+-
+-		double sg;
+-		if (eg0 == eg1) { 
+-			register double s0=vg0,s1=vg1;
+-			sg =  s0*(1.0-s) +  s*s1;
+-			on=eg0;
+-		}
+-		else {
+-			R2 AA=V0,BB;
+-			double s0,s1;
+-			int i=bge;
+-			double ll=0;
+-			for(i=bge;i<tge;i++){
+-				_assert_(i>=0 && i<=mxe);
+-				BB =  (*ge[i])[directionge[i]];
+-				lge[i]=ll += Norme2(AA-BB);
+-				AA=BB ;}
+-				lge[tge]=ll+=Norme2(AA-V1); 
+-				// search the geometrical edge
+-				_assert_(s<=1.0);
+-				double ls= s*ll;
+-				on =0;
+-				s0 = vg0;
+-				s1= directionge[bge];
+-				double l0=0,l1;
+-				i=bge;
+-				while (  (l1=lge[i]) < ls ) {
+-					_assert_(i>=0 && i<=mxe);
+-					i++,s0=1-(s1=directionge[i]),l0=l1;
+-				}
+-				on=ge[i];
+-				if (i==tge) 
+-				 s1=vg1;
+-
+-				s  =(ls-l0)/(l1-l0);
+-				sg =s0*(1.0-s)+s*s1;    
+-		} 
+-		_assert_(on);
+-		V.r= on->F(sg);
+-		GV=VertexOnGeom(V,*on,sg);
+-		return on;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Geometry::R2ToI2{{{*/
+-	I2 Geometry::R2ToI2(const R2 & P) const {
+-		/*coefIcoor is the coefficient used for integer coordinates:
+-		 *                       (x-pmin.x)
+-		 * Icoor x = (2^30 -1) ------------ 
+-		 *                          D
+-		 * where D is the longest side of the domain (direction x or y)
+-		 * so that (x-pmin.x)/D is in ]0 1[
+-		 *
+-		 * coefIcoor = (2^30 -1)/D
+-		 */
+-		return  I2( (Icoor1) (coefIcoor*(P.x-pmin.x)) ,(Icoor1) (coefIcoor*(P.y-pmin.y)) );
+-	}/*}}}*/
+-	/*FUNCTION Geometry::UnMarkEdges{{{*/
+-	void Geometry::UnMarkEdges() {
+-		for (int i=0;i<nbe;i++) edges[i].SetUnMark();
+-	}/*}}}*/
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/AdjacentTriangle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/AdjacentTriangle.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/AdjacentTriangle.cpp	(revision 12821)
+@@ -1,76 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "AdjacentTriangle.h"
+-#include "Mesh.h"
+-
+-namespace bamg {
+-
+-
+-	/*Constructors/Destructors*/
+-	//See header file
+-
+-	/*Methods*/
+-	/*FUNCTION AdjacentTriangle::Locked {{{*/
+-	int  AdjacentTriangle::Locked() const {
+-		return t->AdjEdgeIndex[a] & 4;
+-	}
+-	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::MarkUnSwap {{{*/
+-	int  AdjacentTriangle::MarkUnSwap() const {
+-		return t->AdjEdgeIndex[a] & 8;
+-	}
+-	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::GetAllFlag_UnSwap {{{*/
+-	int  AdjacentTriangle::GetAllFlag_UnSwap() const {
+-		// take all flag except MarkUnSwap
+-		return t->AdjEdgeIndex[a] & 1012;
+-	}
+-	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::SetLock {{{*/
+-	void AdjacentTriangle::SetLock(){
+-		t->SetLocked(a);
+-	}
+-	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::Adj {{{*/
+-	AdjacentTriangle AdjacentTriangle::Adj() const {
+-		return  t->Adj(a);
+-	}
+-	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::EdgeVertex {{{*/
+-	BamgVertex* AdjacentTriangle::EdgeVertex(const int & i) const {
+-		return t->vertices[VerticesOfTriangularEdge[a][i]];
+-	}
+-	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::OppositeVertex {{{*/
+-	BamgVertex* AdjacentTriangle::OppositeVertex() const {
+-		return t->vertices[bamg::OppositeVertex[a]]; 
+-	}
+-	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::det {{{*/
+-	Icoor2 & AdjacentTriangle::det() const {
+-		return t->det;
+-	}
+-	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::swap {{{*/
+-	int AdjacentTriangle::swap(){
+-		return  t->swap(a);
+-	}
+-	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::SetAdj2 {{{*/
+-	void AdjacentTriangle::SetAdj2(const AdjacentTriangle & ta, int l  ){
+-		//set Adjacent Triangle of a triangle
+-		if(t) {
+-			t->adj[a]=ta.t;
+-			t->AdjEdgeIndex[a]=ta.a|l;
+-		}
+-		if(ta.t) {
+-			ta.t->adj[ta.a] = t ;
+-			ta.t->AdjEdgeIndex[ta.a] = a| l ;
+-		}
+-	}
+-	/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnEdge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnEdge.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnEdge.cpp	(revision 12821)
+@@ -1,25 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "VertexOnEdge.h"
+-#include "Mesh.h"
+-
+-namespace bamg {
+-
+-	/*Methods*/
+-	/*FUNCTION VertexOnEdge::Set {{{*/
+-	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(){
+-		v->BackgroundEdgeHook=this;
+-		v->IndexInTriangle=IsVertexOnEdge;  
+-	}
+-	/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgQuadtree.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgQuadtree.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgQuadtree.cpp	(revision 12821)
+@@ -1,598 +0,0 @@
+-#include <limits.h>
+-#include <string.h>
+-#include <stdlib.h>
+-
+-#include "../objects.h"
+-
+-namespace bamg {
+-
+-	/*MACROS {{{*/
+-	/* 
+-	 * 
+-	 *    J    j
+-	 *    ^    ^
+-	 *    |    | +--------+--------+
+-	 *    |    | |        |        |
+-	 * 1X |    | |   2    |   3    |
+-	 *    |    | |        |        |
+-	 *    |    | +--------+--------+
+-	 *    |    | |        |        |
+-	 * 0X |    | |   0    |   1    |
+-	 *    |    | |        |        |
+-	 *    |    | +--------+--------+
+-	 *    |    +-----------------------> i
+-	 *    |         
+-	 *    |----------------------------> I
+-	 *              X0        X1  
+-	 *
+-	 * box 0 -> I=0 J=0 IJ=00  = 0
+-	 * box 1 -> I=1 J=0 IJ=01  = 1
+-	 * box 2 -> I=0 J=1 IJ=10  = 2
+-	 * box 3 -> I=1 J=1 IJ=11  = 3
+-	 */
+-#define INTER_SEG(a,b,x,y) (((y) > (a)) && ((x) <(b)))
+-#define ABS(i) ((i)<0 ?-(i) :(i))
+-#define MAX1(i,j) ((i)>(j) ?(i) :(j))
+-#define NORM(i1,j1,i2,j2) MAX1(ABS((i1)-(j1)),ABS((i2)-(j2)))
+-
+-	//IJ(i,j,l) returns the box number of i and j with respect to l
+-	//if !j&l and !i&l -> 0 (box zero: lower left )
+-	//if !j&l and  i&l -> 1 (box one:  lower right)
+-	//if  j&l and !i&l -> 2 (box two:  upper left )
+-	//if  j&l and  i&l -> 3 (box three:upper right)
+-#define IJ(i,j,l)  ((j&l) ? ((i&l) ? 3:2 ) :((i&l) ? 1:0 ))
+-
+-	//I_IJ(k,l) returns l if first  bit of k is 1, else 0
+-#define I_IJ(k,l)  ((k&1) ? l:0)
+-	//J_IJ(k,l) returns l if second bit of k is 1, else 0
+-#define J_IJ(k,l)  ((k&2) ? l:0)
+-	/*}}}*/
+-	/*DOCUMENTATION What is a BamgQuadtree? {{{
+-	 * A Quadtree is a very simple way to group vertices according
+-	 * to their locations. A square that holds all the points of the mesh
+-	 * (or the geometry) is divided into 4 boxes. As soon as one box
+-	 * hold more than 4 vertices, it is divided into 4 new boxes, etc...
+-	 * There cannot be more than MAXDEEP (=30) subdivision.
+-	 * This process is like a Dichotomy in dimension 2
+-	 *
+-	 *  + - -  -    - -    -    - - + -   - + - + - + - -     - - +
+-	 *  |                           |       |   | X |             |
+-	 *                                      + - + - +
+-	 *  |                           |       |   |   |             |
+-	 *                              + -   - + - + - +             +
+-	 *  |                           |       |       |             |
+-	 *                         
+-	 *  |                           |       |       |             |
+-	 *  + - -  -    - -    -    - - + -   - + -   - + - -     - - +
+-	 *  |                           |               |             |
+-	 *                         
+-	 *  |                           |               |             |
+-	 *                         
+-	 *  |                           |               |             |
+-	 *  |                           |               |             |
+-	 *  + - -  -    - -    -    - - + -   -   -   - + - -     - - +
+-	 *  |                           |                             |
+-	 *                         
+-	 *  |                           |                             |
+-	 *                         
+-	 *  |                           |                             |
+-	 *                         
+-	 *  |                           |                             |
+-	 *  |                           |                             |
+-	 *  |                           |                             |
+-	 *  |                           |                             |
+-	 *  |                           |                             |
+-	 *  + - -  -    - -    -    - - + -   -   -   -   - -     - - +
+-	 *
+-	 * The coordinate system used in a quadtree are integers to avoid
+-	 * round-off errors. The vertex in the lower left box has the coordinates
+-	 * (0 0) 
+-	 * The upper right vertex has the follwing coordinates:
+-	 * 2^30 -1           2^30 -1        in decimal
+-	 * 0 1 1 1 .... 1    0 1 1 1 .... 1 in binary
+-	 *  \--   29  --/     \--   29  --/
+-	 * Using binaries is therefore very easy to locate a vertex in a box:
+-	 * we just need to look at the bits from the left to the right (See ::Add)
+-	 }}}*/
+-
+-	/*Constructors/Destructors*/
+-	/*FUNCTION BamgQuadtree::BamgQuadtree(){{{*/
+-	BamgQuadtree::BamgQuadtree(){
+-
+-		/*Number of boxes and vertices*/
+-		NbBamgQuadtreeBox=0;
+-		NbVertices=0;
+-
+-		/*Create container*/
+-		boxcontainer=new DataSet();
+-
+-		/*Create Root, pointer toward the main box*/
+-		root=NewBamgQuadtreeBox();
+-
+-		}
+-	/*}}}*/
+-	/*FUNCTION BamgQuadtree::BamgQuadtree(Mesh * t,long nbv){{{*/
+-	BamgQuadtree::BamgQuadtree(Mesh * t,long nbv){ 
+-
+-		/*Number of boxes and vertices*/
+-		NbBamgQuadtreeBox=0;
+-		NbVertices=0;
+-
+-		/*Create container*/
+-		boxcontainer=new DataSet();
+-
+-		/*Create Root, pointer toward the main box*/
+-		root=NewBamgQuadtreeBox();
+-
+-		/*Check Sizes*/
+-		_assert_(MaxISize>MaxICoor);
+-
+-		/*Add all vertices of the mesh*/
+-		if (nbv==-1) nbv=t->nbv;
+-		for (int i=0;i<nbv;i++) Add(t->vertices[i]);
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION BamgQuadtree::~BamgQuadtree(){{{*/
+-	BamgQuadtree::~BamgQuadtree() {
+-		delete boxcontainer;
+-		root=NULL;
+-	}
+-	/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION BamgQuadtree::Add{{{*/
+-	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;
+-
+-		/*Get integer coodinate of current point w*/
+-		register long i=w.i.x, j=w.i.y;
+-
+-		/*Initialize level*/
+-		register long level=MaxISize;
+-
+-		/*Get inital box (the largest)*/
+-		pb = &root;
+-
+-		/*Find the smallest box where w is located*/
+-		while((b=*pb) && (b->nbitems<0)){ 
+-
+-			//shift b->nbitems by -1
+-			b->nbitems--;
+-
+-			//shifted righ by one bit: level=00000010 -> 00000001
+-			level >>= 1;
+-
+-			//Get next subbox according to the bit value (level)
+-			pb = &b->b[IJ(i,j,level)];
+-		}
+-
+-		/*OK, we have found b, a Subbox holding vertices (might be full)
+-		  check that the vertex is not already in the box*/
+-		if (b){      
+-			if (b->nbitems > 3 &&  b->v[3] == &w) return;
+-			if (b->nbitems > 2 &&  b->v[2] == &w) return;
+-			if (b->nbitems > 1 &&  b->v[1] == &w) return;
+-			if (b->nbitems > 0 &&  b->v[0] == &w) return;
+-		}
+-
+-		/*check that l is not 0 (this should not happen as MaxDepth = 30)*/
+-		_assert_(level>0);
+-
+-		/*Now, try to add the vertex, if the subbox is full (nbitems=4), we have to divide it
+-		  in 4 new subboxes*/
+-		while ((b= *pb) && (b->nbitems == 4)){ // the BamgQuadtreeBox is full
+-
+-			/*Copy the 4 vertices in the current BamgQuadtreebox*/
+-			BamgVertex* v4[4];
+-			v4[0]= b->v[0];
+-			v4[1]= b->v[1];
+-			v4[2]= b->v[2];
+-			v4[3]= b->v[3];
+-
+-			/*set nbitems as negative 
+-			 * (box full -> holds 4 pointers toward subboxes and not 4 vertices)*/
+-			b->nbitems = -b->nbitems;
+-
+-			/*Initialize the 4 pointers toward the 4 subboxes*/
+-			b->b[0]=b->b[1]=b->b[2]=b->b[3]=NULL;
+-
+-			/*level = 0010000 -> 0001000*/
+-			level >>= 1;
+-
+-			/*Put the four vertices in the new boxes*/
+-			for (int k=0;k<4;k++){
+-
+-				int          ij;
+-				/*bb is the new "sub"box of b where v4[k] is located*/
+-				BamgQuadtreeBox *bb = b->b[ij=IJ(v4[k]->i.x,v4[k]->i.y,level)];
+-
+-				// alloc the BamgQuadtreeBox
+-				if (!bb) bb=b->b[ij]=NewBamgQuadtreeBox(); 
+-
+-				/*Copy the current vertex*/
+-				bb->v[bb->nbitems++] = v4[k];
+-			}
+-
+-			/*Get the subbox where w (i,j) is located*/
+-			pb = &b->b[IJ(i,j,level)];
+-		}
+-
+-		/*alloc the BamgQuadtreeBox if necessary*/
+-		if (!(b=*pb)) b=*pb= NewBamgQuadtreeBox();
+-
+-		/*Add w*/
+-		b->v[b->nbitems++]=&w;
+-
+-		//Increase NbVertices by one (we have one new vertex)
+-		NbVertices++;
+-	}
+-	/*}}}*/
+-	/*FUNCTION BamgQuadtree::NearestVertex{{{*/
+-	BamgVertex*  BamgQuadtree::NearestVertex(Icoor1 i,Icoor1 j) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, BamgQuadtree.cpp/NearestVertex)*/
+-
+-		/*Intermediaries*/
+-		BamgQuadtreeBox *pb[MaxDepth];
+-		int          pi[MaxDepth];
+-		Icoor1       ii[MaxDepth];
+-		Icoor1       jj[MaxDepth];
+-		int          level;
+-		long         n0;
+-		BamgQuadtreeBox *b;
+-		long         h0;
+-		long         h = MaxISize;
+-		long         hb= MaxISize;
+-		Icoor1       i0=0,j0=0;
+-
+-		/*initial output as NULL (no vertex found)*/
+-		BamgVertex*  nearest_v=NULL;
+-
+-		/*Project w coordinates (i,j) onto [0,MaxISize-1] x [0,MaxISize-1] -> (iplus,jplus)*/
+-		Icoor1 iplus( i<MaxISize ? (i<0?0:i) : MaxISize-1);
+-		Icoor1 jplus( j<MaxISize ? (j<0?0:j) : MaxISize-1);
+-
+-		/*Get initial Quadtree box (largest)*/
+-		b = root;
+-
+-		/*if the tree is empty, return NULL pointer*/
+-		if (!root->nbitems) return nearest_v; 
+-
+-		/*else, find the smallest non-empty BamgQuadtreeBox containing  the point (i,j)*/
+-		while((n0=b->nbitems)<0){
+-
+-			Icoor1       hb2 = hb >> 1;             //size of the current box
+-			int          k   = IJ(iplus,jplus,hb2); //box number (0,1,2 or 3)
+-			BamgQuadtreeBox *b0  = b->b[k];             //pointer toward current box
+-
+-			/* break if NULL box or empty (Keep previous box b)*/
+-			if (( b0 == NULL) || (b0->nbitems == 0)) break;
+-
+-			/*Get next Quadtree box*/
+-			b=b0;	
+-			i0 += I_IJ(k,hb2); // i orign of BamgQuadtreeBox (macro)
+-			j0 += J_IJ(k,hb2); // j orign of BamgQuadtreeBox 
+-			hb = hb2;          // size of the box (in Int)
+-		}
+-
+-		/*The box b, is the smallest box containing the point (i,j) and
+-		 * has the following properties:
+-		 * - n0: number of items (>0 if vertices, else boxes)
+-		 * - hb: box size (int)
+-		 * - i0: x coordinate of the lower left corner
+-		 * - j0: y coordinate of the lower left corner*/
+-
+-		/* if the current subbox is holding vertices, we are almost done*/
+-		if (n0>0){  
+-			//loop over the vertices of the box and find the closest vertex
+-			for(int k=0;k<n0;k++){
+-
+-				/*get integer coordinates of current vertex*/
+-				I2 i2=b->v[k]->i;
+-
+-				/*Compute norm with w*/
+-				h0=NORM(iplus,i2.x,jplus,i2.y);
+-
+-				/*is it smaller than previous value*/
+-				if (h0<h){
+-					h = h0;
+-					nearest_v = b->v[k];
+-				}
+-			}
+-			/*return closest vertex*/
+-			return nearest_v;
+-		}
+-
+-		/* general case: the current box is empty, we have to go backwards
+-			and find the closest not-empty box and find the closest vertex*/
+-
+-		/*Initialize search variables*/
+-		pb[0]=b;                             //pointer toward the box b
+-		pi[0]=b->nbitems>0?(int)b->nbitems:4;//number of boxes in b
+-		ii[0]=i0;                            //i coordinate of the box lowest left corner
+-		jj[0]=j0;                            //j coordinate of the box lowest left corner
+-
+-		/*initialize h: smallest box size, containing a vertex close to w*/
+-		h=hb;
+-
+-		/*Main loop*/
+-		level=0;
+-		do {
+-
+-			/*get current box*/
+-			b= pb[level];
+-
+-			/*Loop over the items in current box (if not empty!)*/
+-			while (pi[level]){
+-
+-				/*We are looping now over the items of b. k is the current index (in [0 3])*/
+-				pi[level]--;
+-				int k=pi[level];
+-
+-				/*if the current subbox is holding vertices (b->nbitems<0 is subboxes)*/
+-				if (b->nbitems>0){
+-					I2 i2=b->v[k]->i;
+-					h0 = NORM(iplus,i2.x,jplus,i2.y);
+-					if (h0<h){
+-						h=h0;
+-						nearest_v=b->v[k];
+-					}
+-				}
+-				/*else: current box b is pointing toward 4 boxes
+-				 * test sub-box k and go deeper into the tree if it is non empty
+-				 * and contains the point w modulo a size h that is either the size of the smallest
+-				 * non empty box containing w, or the closest point to w (so far) */
+-				else{
+-					BamgQuadtreeBox* b0=b;
+-
+-					/*if the next box exists:*/
+-					if (b=b->b[k]){
+-
+-						/*Get size (hb) and coordinates of the current sub-box lowest left corner*/
+-						hb>>=1;
+-						Icoor1 iii = ii[level]+I_IJ(k,hb);
+-						Icoor1 jjj = jj[level]+J_IJ(k,hb);
+-
+-						/*if the current point (iplus,jplus) is in b (modulo h), this box is good:
+-						 * it is holding vertices that are close to w */
+-						if (INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)){
+-							level++;
+-							pb[level]= b;
+-							pi[level]= b->nbitems>0 ?(int)  b->nbitems : 4  ;
+-							ii[level]= iii;
+-							jj[level]= jjj;
+-						}
+-
+-						//else go backwards
+-						else{
+-							//shifted righ by one bit: hb=001000000 -> 01000000
+-							b=b0;
+-							hb<<=1;
+-						}
+-					}
+-					else{
+-						/*Current box is NULL, go to next subbox of b (k=k-1)*/
+-						b=b0;
+-					}
+-				}
+-			}
+-
+-			/*We have found a vertex, now, let's try the other boxes of the previous level
+-			 * in case there is a vertex closest to w that has not yet been tested*/
+-			hb <<= 1;
+-		} while (level--);
+-
+-		/*return nearest_v, nearest vertex*/
+-		return nearest_v;
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION BamgQuadtree::NearestVertexWithNormal{{{*/
+-	BamgVertex*  BamgQuadtree::NearestVertexWithNormal(Icoor1 i,Icoor1 j) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, BamgQuadtree.cpp/NearestVertexWithNormal)*/
+-
+-		BamgQuadtreeBox * pb[ MaxDepth ];
+-		int  pi[ MaxDepth  ];
+-		Icoor1 ii[  MaxDepth ], jj [ MaxDepth];
+-		int l; // level
+-		BamgQuadtreeBox * b;
+-		long     h =MaxISize,h0;
+-		long     hb=MaxISize;
+-		Icoor1  i0=0,j0=0;
+-		Icoor1  iplus( i<MaxISize?(i<0?0:i):MaxISize-1);
+-		Icoor1  jplus( j<MaxISize?(j<0?0:j):MaxISize-1);
+-
+-		BamgVertex *vn=0;
+-
+-		// init for optimisation ---
+-		b = root;
+-		register long  n0;
+-		if (!root->nbitems)
+-		 return vn; // empty tree 
+-
+-		while( (n0 = b->nbitems) < 0) 
+-		  {
+-			// search the non empty 
+-			// BamgQuadtreeBox containing  the point (i,j)
+-			register Icoor1 hb2 = hb >> 1 ;
+-			register  int k = IJ(iplus,jplus,hb2);// BamgQuadtreeBox number of size hb2 contening i;j
+-			register BamgQuadtreeBox * b0= b->b[k];
+-			if ( ( b0 == 0) || (b0->nbitems == 0) ) 
+-			 break; // null box or empty   => break 	    
+-			b=b0;	
+-			i0 += I_IJ(k,hb2); // i orign of BamgQuadtreeBox
+-			j0 += J_IJ(k,hb2); // j orign of BamgQuadtreeBox 
+-			hb = hb2; 
+-		  }
+-
+-
+-		if ( n0 > 0) 
+-		  {  
+-			for(register int k=0;k<n0;k++)
+-			  {
+-				I2 i2 =  b->v[k]->i;
+-				//   try if is in the right direction -- 
+-				h0 = NORM(iplus,i2.x,jplus,i2.y);
+-				if (h0 <h) {
+-					h = h0;
+-					vn = b->v[k];}
+-			  }
+-			if (vn) return vn; 
+-		  }
+-		// general case -----
+-		// INITIALISATION OF THE HEAP 
+-		l =0; // level 
+-		pb[0]= b;
+-		pi[0]=b->nbitems>0 ?(int)  b->nbitems : 4  ;
+-		ii[0]=i0;
+-		jj[0]=j0;
+-		h=hb;
+-		do {   // walk on the tree  
+-			b= pb[l];
+-			while (pi[l]--) // loop on 4 element of the box
+-			  { 	      
+-				int k = pi[l];
+-
+-				if (b->nbitems>0) // BamgVertex BamgQuadtreeBox none empty
+-				  { 
+-					I2 i2 =  b->v[k]->i;
+-					// if good direction when try -- 
+-
+-					h0 = NORM(iplus,i2.x,jplus,i2.y);
+-					if (h0 <h) 
+-					  {
+-						h = h0;
+-						vn = b->v[k];
+-					  }
+-				  }
+-				else // Pointer BamgQuadtreeBox 
+-				  { 
+-					register BamgQuadtreeBox *b0=b;
+-					if ((b=b->b[k])) 
+-					  {
+-						hb >>=1 ; // div by 2
+-						register Icoor1 iii = ii[l]+I_IJ(k,hb);
+-						register Icoor1 jjj = jj[l]+J_IJ(k,hb);
+-
+-						if  (INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)) 
+-						  {
+-							pb[++l]=  b;
+-							pi[l]= b->nbitems>0 ?(int)  b->nbitems : 4  ;
+-							ii[l]= iii;
+-							jj[l]= jjj;
+-
+-						  }
+-						else
+-						 b=b0, hb <<=1 ;
+-					  }
+-					else
+-					 b=b0;
+-				  }
+-			  }
+-			hb <<= 1; // mul by 2 
+-		} while (l--);
+-
+-		return vn;
+-	}
+-	/*}}}*/
+-	/*FUNCTION BamgQuadtree::NewBamgQuadtreeBox {{{*/
+-	BamgQuadtree::BamgQuadtreeBox* BamgQuadtree::NewBamgQuadtreeBox(void){
+-
+-		/*Output*/
+-		BamgQuadtreeBox* newbox=NULL;
+-
+-		/*Create and initialize a new box*/
+-		newbox=new BamgQuadtreeBox;
+-		newbox->nbitems=0;
+-		newbox->b[0]=NULL;
+-		newbox->b[1]=NULL;
+-		newbox->b[2]=NULL;
+-		newbox->b[3]=NULL;
+-
+-		/*Add root to the container*/
+-		boxcontainer->AddObject(newbox);
+-
+-		/*Increase counter*/
+-		NbBamgQuadtreeBox++;
+-
+-		/*currentbox now points toward next quadtree box*/
+-		return newbox;
+-	}/*}}}*/
+-	/*FUNCTION BamgQuadtree::ToClose {{{*/
+-	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;
+-		const Icoor1 j=v.i.y;
+-		const R2 X(v.r);
+-		const Metric  Mx(v.m);
+-
+-		BamgQuadtreeBox * pb[ MaxDepth ];
+-		int  pi[ MaxDepth  ];
+-		Icoor1 ii[  MaxDepth ], jj [ MaxDepth];
+-		register int l=0; // level
+-		register BamgQuadtreeBox * b;
+-		Icoor1 h=MaxISize;
+-		Icoor1 hb =  MaxISize;
+-		Icoor1 i0=0,j0=0;
+-
+-		//  BamgVertex *vn=0;
+-
+-		if (!root->nbitems)
+-		 return 0; // empty tree 
+-
+-		// general case -----
+-		pb[0]=root;
+-		pi[0]=root->nbitems>0 ?(int)  root->nbitems : 4  ;
+-		ii[0]=i0;
+-		jj[0]=j0;
+-		h=hb;
+-		do {    
+-			b= pb[l];
+-			while (pi[l]--){ 	      
+-				register int k = pi[l];
+-
+-				if (b->nbitems>0){ // BamgVertex BamgQuadtreeBox none empty
+-					I2 i2 =  b->v[k]->i;
+-					if ( ABS(i-i2.x) <hx && ABS(j-i2.y) <hy )
+-					  {
+-						R2 XY(X,b->v[k]->r);
+-						double dd;
+-						if( (dd= LengthInterpole(Mx(XY), b->v[k]->m(XY)))  < seuil ){
+-							return b->v[k]; 
+-						}
+-					  }
+-				}
+-				else{ // Pointer BamgQuadtreeBox 
+-					register BamgQuadtreeBox *b0=b;
+-					if ((b=b->b[k])){
+-						hb >>=1 ; // div by 2
+-						register long iii = ii[l]+I_IJ(k,hb);
+-						register long jjj = jj[l]+J_IJ(k,hb);
+-
+-						if  (INTER_SEG(iii,iii+hb,i-hx,i+hx) && INTER_SEG(jjj,jjj+hb,j-hy,j+hy)){
+-							pb[++l]=  b;
+-							pi[l]= b->nbitems>0 ?(int)  b->nbitems : 4  ;
+-							ii[l]= iii;
+-							jj[l]= jjj;
+-
+-						}
+-						else{
+-							b=b0;
+-							hb <<=1 ;
+-						}
+-					}
+-					else{
+-						b=b0;
+-					}
+-				}
+-			}
+-			hb <<= 1; // mul by 2 
+-		} while (l--);
+-
+-		return 0;
+-	}
+-	/*}}}*/
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.h	(revision 12821)
+@@ -1,194 +0,0 @@
+-#ifndef _MESH_H_
+-#define _MESH_H_
+-
+-#include "./include.h"
+-#include "./BamgOpts.h"
+-#include "./BamgMesh.h"
+-#include "./BamgGeom.h"
+-#include "./Triangle.h"
+-#include "./VertexOnGeom.h"
+-#include "./VertexOnVertex.h"
+-#include "./VertexOnEdge.h"
+-#include "./ListofIntersectionTriangles.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class Geometry;
+-	class CrackedEdge;
+-	class BamgQuadtree;
+-	class SubDomain;
+-
+-	class Mesh {
+-
+-		public:
+-
+-			Geometry                    & Gh;                    // Geometry
+-			Mesh                        & BTh;                   // Background Mesh Bth== *this =>no background
+-			BamgVertex                   *vertices;
+-			Triangle                     *triangles;
+-			Edge                         *edges;
+-			BamgQuadtree                 *quadtree;
+-			BamgVertex                  **orderedvertices;
+-			SubDomain                    *subdomains;
+-			long                          NbRef;                 // counter of ref on the this class if 0 we can delete
+-			long                          maxnbv,maxnbt;         // nombre max de sommets , de triangles
+-			long                          nbv,nbt,nbe,nbq;       // nb of vertices, of triangles, of edges and quadrilaterals
+-			long                          nbsubdomains;
+-			long                          nbtout;                // Nb of oudeside triangle
+-
+-			R2                            pmin,pmax;             // extrema
+-			double                        coefIcoor;             // coef to integer Icoor1;
+-			ListofIntersectionTriangles   lIntTria;
+-
+-			long                          NbVerticesOnGeomVertex;
+-			VertexOnGeom                 *VerticesOnGeomVertex;
+-			long                          NbVerticesOnGeomEdge;
+-			VertexOnGeom                 *VerticesOnGeomEdge;
+-			long                          NbVertexOnBThVertex;
+-			VertexOnVertex               *VertexOnBThVertex;
+-			long                          NbVertexOnBThEdge;
+-			VertexOnEdge                 *VertexOnBThEdge;
+-			long                          NbCrackedVertices;
+-			long                         *CrackedVertices;
+-			long                          NbCrackedEdges;
+-			CrackedEdge                  *CrackedEdges;
+-
+-			//Constructors/Destructors
+-			Mesh(BamgGeom* bamggeom,BamgMesh* bamgmesh,BamgOpts* bamgopts);
+-			Mesh(int* index,double* x,double* y,int nods,int nels);/*MeshConvert*/
+-			Mesh(double* x,double* y,int nods); /*BamgTriangulate*/
+-			Mesh(Mesh &,Geometry * pGh=0,Mesh* pBTh=0,long maxnbv_in=0 ); //copy operator
+-			Mesh(const Mesh &,const int *flag,const int *bb,BamgOpts* bamgopts); // truncature
+-			Mesh(long maxnbv,Mesh & BT,BamgOpts* bamgopts,int keepBackVertices=1);
+-			Mesh(long maxnbv,Geometry & G,BamgOpts* bamgopts);
+-			~Mesh(); 
+-
+-			//Operators
+-			const BamgVertex &operator[](long i) const { return vertices[i];  };
+-			BamgVertex       &operator[](long i) { return vertices[i];        };
+-			const Triangle   &operator()(long i) const { return triangles[i]; };
+-			Triangle         &operator()(long  i) { return triangles[i];             };
+-
+-			//Methods
+-			void SetIntCoor(const char * from =0);
+-			double MinimalHmin();
+-			double MaximalHmax();
+-			I2 R2ToI2(const R2 & P) const;
+-			R2 I2ToR2(const I2 & P) const;
+-			void AddVertex(BamgVertex & s,Triangle * t,Icoor2 *  =0) ;
+-			void Insert();
+-			void Echo(void);
+-			void ForceBoundary();
+-			void FindSubDomain(int OutSide=0);
+-			long TriangleReferenceList(long*) const;
+-			void TriangleIntNumbering(long* renumbering);
+-			void ShowHistogram() const;
+-			void CrackMesh(BamgOpts* bamgopts);
+-			void ShowRegulaty() const;
+-			void SmoothMetric(double raisonmax) ;
+-			void BoundAnisotropy(double anisomax,double hminaniso= 1e-100) ;
+-			void MaxSubDivision(double maxsubdiv);
+-			Edge** MakeGeomEdgeToEdge();
+-			long SplitInternalEdgeWithBorderVertices();
+-			void MakeQuadrangles(double costheta);
+-			int  SplitElement(int choice);
+-			void MakeBamgQuadtree();
+-			void NewPoints(Mesh &,BamgOpts* bamgopts,int KeepVertices=1);
+-			long InsertNewPoints(long nbvold,long & NbTSwap) ; 
+-			void TrianglesRenumberBySubDomain(bool justcompress=false);
+-			void VerticesRenumber(long * renu);
+-			void SmoothingVertex(int =3,double=0.3);
+-			Metric MetricAt (const R2 &) const;
+-			GeomEdge* ProjectOnCurve( Edge & AB, BamgVertex &  A, BamgVertex & B,double theta, BamgVertex & R,VertexOnEdge & BR,VertexOnGeom & GR);
+-			long GetId(const Triangle & t) const;
+-			long GetId(const Triangle * t) const;
+-			long GetId(const BamgVertex & t) const;
+-			long GetId(const BamgVertex * t) const;
+-			long GetId(const Edge & t) const;
+-			long GetId(const Edge * t) const;
+-			BamgVertex* NearestVertex(Icoor1 i,Icoor1 j) ;
+-			Triangle* TriangleFindFromCoord(const I2 & ,Icoor2 [3],Triangle *tstart=0) const;
+-			void ReadMesh(int* index,double* x,double* y,int nods,int nels);
+-			void ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts);
+-			void WriteMesh(BamgMesh* bamgmesh,BamgOpts* bamgopts);
+-			void ReadMetric(const BamgOpts* bamgopts);
+-			void WriteMetric(BamgOpts* bamgopts);
+-			void WriteIndex(int** pindex,int* pnels);
+-			void AddMetric(BamgOpts* bamgopts);
+-			void BuildMetric0(BamgOpts* bamgopts);
+-			void BuildMetric1(BamgOpts* bamgopts);
+-			void AddGeometryMetric(BamgOpts* bamgopts);
+-			int  isCracked() const;
+-			void BuildGeometryFromMesh(BamgOpts* bamgopts=NULL);
+-			void ReconstructExistingMesh();
+-
+-			//Inline methods
+-			inline  void CreateSingleVertexToTriangleConnectivity(){
+-				for (int i=0;i<nbv;i++) vertices[i].IndexInTriangle=0, vertices[i].t=NULL;
+-				for (int i=0;i<nbt;i++) triangles[i].SetSingleVertexToTriangleConnectivity();
+-			}
+-			inline  void  UnMarkUnSwapTriangle(){
+-				for (int i=0;i<nbt;i++)
+-				 for(int j=0;j<3;j++)
+-				  triangles[i].SetUnMarkUnSwap(j);
+-			  }
+-			inline  void  SetVertexFieldOn(){
+-				for (int i=0;i<nbv;i++)                    vertices[i].GeomEdgeHook=NULL;
+-				for (int j=0;j<NbVerticesOnGeomVertex;j++) VerticesOnGeomVertex[j].SetOn();
+-				for (int k=0;k<NbVerticesOnGeomEdge;k++ )  VerticesOnGeomEdge[k].SetOn();
+-			}	       
+-			inline  void   SetVertexFieldOnBTh(){
+-				for (int i=0;i<nbv;i++)                 vertices[i].GeomEdgeHook=NULL;
+-				for (int j=0;j<NbVertexOnBThVertex;j++) VertexOnBThVertex[j].SetOnBTh();
+-				for (int k=0;k<NbVertexOnBThEdge;k++ )  VertexOnBThEdge[k].SetOnBTh();
+-			}
+-
+-		private:
+-			void TriangulateFromGeom1(BamgOpts* bamgopts,int KeepVertices=1);// the real constructor mesh adaption
+-			void TriangulateFromGeom0(BamgOpts* bamgopts);// the real constructor mesh generator
+-			void Triangulate(double* x,double* y,int nods);
+-			void Init(long);
+-	};
+-
+-	/*Intermediary*/
+-	AdjacentTriangle CloseBoundaryEdge(I2 ,Triangle *, double &,double &) ;
+-	AdjacentTriangle CloseBoundaryEdgeV2(I2 A,Triangle *t, double &a,double &b);
+-	void  swap(Triangle *t1,short a1,
+-				Triangle *t2,short a2,
+-				BamgVertex *s1,BamgVertex *s2,Icoor2 det1,Icoor2 det2);
+-	int SwapForForcingEdge(BamgVertex   *  & pva ,BamgVertex  * &   pvb ,
+-				AdjacentTriangle & tt1,Icoor2 & dets1,
+-				Icoor2 & detsa,Icoor2 & detsb, int & nbswap);
+-	int ForceEdge(BamgVertex &a, BamgVertex & b,AdjacentTriangle & taret) ;
+-	inline AdjacentTriangle Previous(const AdjacentTriangle & ta){
+-		return AdjacentTriangle(ta.t,PreviousEdge[ta.a]);
+-	}
+-	inline AdjacentTriangle Next(const AdjacentTriangle & ta){
+-		return AdjacentTriangle(ta.t,NextEdge[ta.a]);
+-	}
+-	inline  AdjacentTriangle Adj(const AdjacentTriangle & a){
+-		return  a.Adj();
+-	}
+-	inline void Adj(GeomEdge * & on,int &i){
+-		int j=i;i=on->AdjVertexIndex[i];on=on->Adj[j];
+-	}
+-	inline double qualite(const BamgVertex &va,const BamgVertex &vb,const BamgVertex &vc){
+-		double ret; 
+-		I2 ia=va,ib=vb,ic=vc;
+-		I2 ab=ib-ia,bc=ic-ib,ac=ic-ia;
+-		Icoor2 deta=Det(ab,ac);
+-		if (deta <=0) ret = -1;
+-		else {
+-			double a = sqrt((double) (ac,ac)),
+-					 b = sqrt((double) (bc,bc)),
+-					 c = sqrt((double) (ab,ab)),
+-					 p = a+b+c;
+-			double h= Max(Max(a,b),c),ro=deta/p;
+-			ret = ro/h;
+-		}
+-		return ret;
+-	}
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Edge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Edge.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Edge.cpp	(revision 12821)
+@@ -1,54 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "Edge.h"
+-#include "Mesh.h"
+-#include "Geometry.h"
+-
+-namespace bamg {
+-
+-	/*Constructors/Destructors*/
+-
+-	/*Methods*/
+-	/*FUNCTION Edge::Set {{{*/
+-	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]);
+-		if (GeomEdgeHook) 
+-		 GeomEdgeHook =  ThNew.Gh.edges+Th.Gh.GetId(GeomEdgeHook);
+-		if (adj[0]) adj[0] =   ThNew.edges +   Th.GetId(adj[0]);
+-		if (adj[1]) adj[1] =   ThNew.edges +   Th.GetId(adj[1]);
+-	}
+-	/*}}}*/
+-	/*FUNCTION Edge::Echo {{{*/
+-	void Edge::Echo(void){ 
+-		_printLine_("Edge:");
+-		_printLine_("   pointers towards two vertices: " << v[0] << " " << v[1]);
+-		_printLine_("   ReferenceNumber = " << ReferenceNumber);
+-		_printLine_("   GeomEdgeHook = " << GeomEdgeHook);
+-		_printLine_("   two adjacent edges on the same curve: " << adj[0] << " " << adj[1]);
+-	}
+-	/*}}}*/
+-	/*FUNCTION Edge::Renumbering{{{*/
+-	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){ 
+-
+-		/*some shecks*/
+-		if (!(adj[0]==&e || adj[1]==&e)){ _error2_("Intersection bug"); }
+-		_assert_(adj[0]==&e || adj[1]==&e);
+-
+-		return adj[0]==&e?0:1;
+-	}
+-	/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgVertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgVertex.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgVertex.cpp	(revision 12821)
+@@ -1,256 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "../objects.h"
+-
+-namespace bamg {
+-
+-	/*Methods*/
+-	/*FUNCTION BamgVertex::Echo {{{*/
+-
+-	void BamgVertex::Echo(void){
+-
+-		_printLine_("Vertex:");
+-		_printLine_("  integer   coordinates i.x: " << i.x << ", i.y: " << i.y);
+-		_printLine_("  Euclidean coordinates r.x: " << r.x << ", r.y: " << r.y);
+-		_printLine_("  ReferenceNumber = " << ReferenceNumber);
+-		m.Echo();
+-
+-		return;
+-	}
+-	/*}}}*/
+-	/*FUNCTION BamgVertex::GetReferenceNumber{{{*/
+-	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){
+-		/*Compute Metric from Hessian*/
+-
+-		/*get options*/
+-		double power=(bamgopts->power);
+-		double anisomax=(bamgopts->anisomax);
+-		double CutOff=bamgopts->cutoff;
+-		double hmin=(bamgopts->hmin);
+-		double hmax=(bamgopts->hmax);
+-		double coef=bamgopts->coeff;
+-		int    Metrictype=(bamgopts->Metrictype);
+-
+-		/*Intermediary*/
+-		double ci;
+-
+-		/*compute multiplicative coefficient depending on Metric Type (2/9 because it is 2d)*/
+-
+-		//Absolute Error
+-		/*
+-		 *            2         1       
+-		 *Metric M = ---  ------------   Abs(Hessian)
+-		 *            9   err * coeff^2  
+-		 */
+-		if (Metrictype==0){
+-			ci= 2.0/9.0 * 1/(err*coef*coef);
+-		}
+-
+-		//Relative Error
+-		/*
+-		 *            2         1            Abs(Hessian)
+-		 *Metric M = ---  ------------  ----------------------
+-		 *            9   err * coeff^2  max( |s| , cutoff*max(|s|) )
+-		 *
+-		 */
+-		else if (Metrictype==1){
+-			ci= 2.0/9.0 * 1/(err*coef*coef) * 1/Max( Abs(s), CutOff*(Max(Abs(smin),Abs(smax))));
+-		}
+-
+-		//Rescaled absolute error
+-		/*
+-		 *            2         1            Abs(Hessian)
+-		 *Metric M = ---  ------------  ---------------------- 
+-		 *            9   err * coeff^2       (smax-smin)
+-		 */
+-		else if (Metrictype==2){
+-			ci= 2.0/9.0 * 1/(err*coef*coef) * 1/(smax-smin);
+-		}
+-		else{
+-			_error2_("Metrictype " << Metrictype << " not supported yet (use 0,1 or 2(default))");
+-		}
+-
+-		//initialize metric Miv with ci*H
+-		Metric Miv(Hxx*ci,Hyx*ci,Hyy*ci);
+-
+-		//Get eigen values and vectors of Miv
+-		EigenMetric Vp(Miv);
+-
+-		//move eigen valuse to their absolute values
+-		Vp.Abs();
+-
+-		//Apply a power if requested by user
+-		if(power!=1.0) Vp.pow(power);
+-
+-		//modify eigen values according to hmin and hmax
+-		Vp.Maxh(hmax);
+-		Vp.Minh(hmin);
+-
+-		//Bound anisotropy by 1/(anisomax)^2
+-		Vp.BoundAniso2(1/(anisomax*anisomax));
+-
+-		//rebuild Metric from Vp
+-		Metric MVp(Vp);
+-
+-		//Apply Metric to vertex
+-		m.IntersectWith(MVp);
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION BamgVertex::Optim {{{*/
+-	long BamgVertex::Optim(int i,int koption){ 
+-		long ret=0;
+-		if ( t && (IndexInTriangle >= 0 ) && (IndexInTriangle <3) ){
+-			ret = t->Optim(IndexInTriangle,koption);
+-			if(!i){
+-				t =0; // for no future optime 
+-				IndexInTriangle= 0;
+-			}
+-		}
+-		return ret;
+-	}
+-	/*}}}*/
+-	/*FUNCTION BamgVertex::Smoothing{{{*/
+-	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)*/
+-
+-		register BamgVertex* s=this;
+-		BamgVertex &vP = *s,vPsave=vP;
+-
+-		register Triangle* tbegin= t , *tria = t , *ttc;
+-
+-		register int k=0,kk=0,j = EdgesVertexTriangle[IndexInTriangle][0],jc;
+-		R2 P(s->r),PNew(0,0);
+-		do {
+-			k++; 
+-
+-			if (!tria->Hidden(j)){
+-				BamgVertex &vQ = (*tria)[VerticesOfTriangularEdge[j][0]]; 
+-
+-				R2 Q = vQ,QP(P-Q);
+-				double lQP = LengthInterpole(vP,vQ,QP);
+-				PNew += Q+QP/Max(lQP,1e-20);
+-				kk ++;
+-			}
+-			ttc =  tria->TriangleAdj(j);
+-			jc = NextEdge[tria->NuEdgeTriangleAdj(j)];
+-			tria = ttc;
+-			j = NextEdge[jc];
+-			if (k>=2000){
+-				_error2_("k>=2000 (Maximum number of iterations reached)");
+-			}
+-		} while ( tbegin != tria); 
+-		if (kk<4) return 0;
+-		PNew = PNew/(double)kk;
+-		R2 Xmove((PNew-P)*omega);
+-		PNew = P+Xmove;
+-		double delta=Norme2_2(Xmove); 
+-
+-		Icoor2 deta[3];
+-		I2 IBTh  = BTh.R2ToI2(PNew);
+-
+-		tstart=BTh.TriangleFindFromCoord(IBTh,deta,tstart);  
+-
+-		if (tstart->det <0){ // outside
+-			double ba,bb;
+-			AdjacentTriangle edge= CloseBoundaryEdge(IBTh,tstart,ba,bb) ;
+-			tstart = edge;
+-			vP.m= Metric(ba,*edge.EdgeVertex(0),bb,*edge.EdgeVertex(1));
+-		}
+-		else { // inside
+-			double   aa[3];
+-			double s = deta[0]+deta[1]+deta[2];
+-			aa[0]=deta[0]/s;
+-			aa[1]=deta[1]/s;
+-			aa[2]=deta[2]/s;
+-			vP.m = Metric(aa,(*tstart)[0],(*tstart)[1],(*tstart)[2]);
+-		}
+-
+-		// recompute the det of the triangle
+-		vP.r = PNew;
+-
+-		vP.i = Th.R2ToI2(PNew);
+-
+-		BamgVertex vPnew = vP;
+-
+-		int ok=1;
+-		int loop=1;
+-		k=0;
+-		while (ok){
+-			ok =0;
+-			do {
+-				k++; 
+-				double detold = tria->det;
+-				tria->det =  bamg::det( (*tria)[0],(*tria)[1]  ,(*tria)[2]);
+-				if (loop) {
+-					BamgVertex *v0,*v1,*v2,*v3;
+-					if (tria->det<0) ok =1;			       
+-					else if (tria->Quadrangle(v0,v1,v2,v3))
+-					  {
+-						vP = vPsave;
+-						double qold =QuadQuality(*v0,*v1,*v2,*v3);
+-						vP = vPnew;
+-						double qnew =QuadQuality(*v0,*v1,*v2,*v3);
+-						if (qnew<qold) ok = 1;
+-					  }
+-					else if ( (double)tria->det < detold/2 ) ok=1;
+-
+-				}
+-				tria->SetUnMarkUnSwap(0);
+-				tria->SetUnMarkUnSwap(1);
+-				tria->SetUnMarkUnSwap(2);
+-				ttc =  tria->TriangleAdj(j);
+-				jc = NextEdge[tria->NuEdgeTriangleAdj(j)];
+-				tria = ttc;
+-				j = NextEdge[jc];
+-				if (k>=2000){
+-					_error2_("k>=2000");
+-				}
+-			}while ( tbegin != tria); 
+-
+-			if (ok && loop) vP=vPsave; // no move 
+-			loop=0;
+-		}
+-		return delta;
+-	}
+-	/*}}}*/
+-
+-	/*Intermediary*/
+-	/*FUNCTION QuadQuality{{{*/
+-	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 --
+-		R2 A((R2)a),B((R2)b),C((R2)c),D((R2)d);
+-		R2 AB(B-A),BC(C-B),CD(D-C),DA(A-D);
+-		//  Move(A),Line(B),Line(C),Line(D),Line(A);
+-		const Metric & Ma  = a;
+-		const Metric & Mb  = b;
+-		const Metric & Mc  = c;
+-		const Metric & Md  = d;
+-
+-		double lAB=Norme2(AB);
+-		double lBC=Norme2(BC);
+-		double lCD=Norme2(CD);
+-		double lDA=Norme2(DA);
+-		AB /= lAB;  BC /= lBC;  CD /= lCD;  DA /= lDA;
+-		// version aniso 
+-		double cosDAB= Ma(DA,AB)/(Ma(DA)*Ma(AB)),sinDAB= Det(DA,AB);
+-		double cosABC= Mb(AB,BC)/(Mb(AB)*Mb(BC)),sinABC= Det(AB,BC);
+-		double cosBCD= Mc(BC,CD)/(Mc(BC)*Mc(CD)),sinBCD= Det(BC,CD);
+-		double cosCDA= Md(CD,DA)/(Md(CD)*Md(DA)),sinCDA= Det(CD,DA);
+-		double sinmin=Min(Min(sinDAB,sinABC),Min(sinBCD,sinCDA));
+-		if (sinmin<=0) return sinmin;
+-		return 1.0-Max(Max(Abs(cosDAB),Abs(cosABC)),Max(Abs(cosBCD),Abs(cosCDA)));
+-	}
+-	/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.h	(revision 12821)
+@@ -1,73 +0,0 @@
+-#ifndef _LISTOFINTERSECTIONTRIANGLES_H_
+-#define _LISTOFINTERSECTIONTRIANGLES_H_
+-
+-#include "./include.h"
+-
+-namespace bamg {
+-
+-	class Triangle;
+-
+-	class ListofIntersectionTriangles {
+-
+-		class IntersectionTriangles {
+-
+-			public: 
+-				Triangle *t;
+-				double    bary[3];   // use if t != 0
+-				R2        x;
+-				Metric    m;
+-				double    s;         // curvilinear coordinate
+-				double    sp;        // length of the previous segment in m
+-				double    sn;        // length of the next segment in m
+-		};
+-
+-		class SegInterpolation {
+-
+-			public:
+-				GeomEdge *e;
+-				double           sBegin  ,sEnd; // abscisse of the seg on edge parameter
+-				double           lBegin  ,lEnd; // length abscisse set in ListofIntersectionTriangles::Length
+-				int              last;          // last index in ListofIntersectionTriangles for this Sub seg of edge
+-
+-				//Methods
+-				R2 F(double s){ 
+-					double c01=lEnd-lBegin, c0=(lEnd-s)/c01, c1=(s-lBegin)/c01;
+-					if (lBegin>s || s>lEnd){
+-						_error2_("lBegin>s || s>lEnd");
+-					}
+-					return e->F(sBegin*c0+sEnd*c1);
+-				}
+-		};
+-
+-		public:
+-
+-			int                    MaxSize;
+-			int                    Size;
+-			double                 len;
+-			int                    state;
+-			IntersectionTriangles *lIntTria;
+-			int                    NbSeg;
+-			int                    MaxNbSeg;
+-			SegInterpolation      *lSegsI;
+-
+-			//Constructors/Destructors
+-			ListofIntersectionTriangles(int n=256,int m=16);
+-			~ListofIntersectionTriangles();
+-
+-			//Operators
+-			IntersectionTriangles & operator[](int i) {return lIntTria[i];}
+-			operator int&() {return Size;}
+-
+-			//Methods
+-			void   Init();
+-			int    NewItem(Triangle *tt,double d0,double d1,double d2);
+-			int    NewItem(R2 ,const Metric &);
+-			void   SplitEdge(const Mesh &,const R2 &,const R2 &,int nbegin=0);
+-			double Length();
+-			long   NewPoints(BamgVertex *,long &nbv,long maxnbv);
+-			void   NewSubSeg(GeomEdge *e,double s0,double s1);
+-			void   ReShape();
+-	};
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SetOfE4.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SetOfE4.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SetOfE4.cpp	(revision 12821)
+@@ -1,120 +0,0 @@
+-#include "../objects.h"
+-
+-using namespace std;
+-namespace bamg {
+-
+-	/*Constructor*/
+-	/*FUNCTION  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*/
+-		int i;
+-
+-		//initialize fields
+-		nx   =nnx;   //number of vertices
+-		nbax =mmx;   // 3 * number of triangles
+-		NbOfEdges=0;
+-		head = new long [nx];
+-		Edges= new IntEdge[nbax];
+-
+-		//initialize head (-1 everywhere)
+-		i=nx;
+-		while(i--) head[i]=-1;
+-	}
+-	/*}}}*/
+-
+-	/*Methods*/ 
+-	/*FUNCTION  SetOfEdges4::add{{{*/
+-	long SetOfEdges4::add(long ii,long jj) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, SetOfEdges4.cpp/add)*/
+-
+-		/*Intermediary*/
+-		int h,n;
+-
+-		//get n from h (usually h=ii)
+-		_assert_(head);
+-		n=head[h=Abs(ii)%nx];
+-
+-		//go through the existing edges that holds h (=ii) and check that 
+-		//the edge ii jj is not already in Edge
+-		while (n >= 0){
+-
+-			//if the edge ii jj is already in Edges, return n
+-			if (ii == Edges[n].i && jj == Edges[n].j) return n;
+-
+-			//else go to next edge that holds ii
+-			else n = Edges[n].next;
+-		}
+-
+-		//check that nbax <=NbOfEdges
+-		if (nbax <=NbOfEdges ) {
+-			_error2_("SetOfEdges4::add overflow: NbOfEdges=" << NbOfEdges << " > nbax=" << nbax);
+-		}
+-
+-		//update chain
+-		Edges[NbOfEdges].i=ii;
+-		Edges[NbOfEdges].j=jj;
+-		Edges[NbOfEdges].next= head[h];
+-		head[h] = NbOfEdges;
+-		return NbOfEdges ++;
+-	}
+-	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::find {{{*/
+-	long SetOfEdges4::find(long ii,long jj) { 
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, SetOfEdges4.cpp/find)*/
+-
+-		/*Intermediary*/
+-		int n;
+-
+-		//check that head is not empty
+-		_assert_(head);
+-
+-		//get n from h (usually h=ii)
+-		n=head[Abs(ii)%nx];
+-
+-		//go through the existing edges that holds h (=ii) and return position in Edge
+-		while (n >= 0){
+-
+-			//if the edge ii jj is already in Edges, return n
+-			if (ii == Edges[n].i && jj == Edges[n].j) return n;
+-
+-			//else go to next edge that holds ii
+-			else n = Edges[n].next;
+-		}
+-
+-		//if we reach this point, the edge does not exist return -1
+-		return -1;
+-	}
+-	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::i{{{*/
+-	long SetOfEdges4::i(long k){
+-		return Edges[k].i;
+-	}
+-	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::j{{{*/
+-	long SetOfEdges4::j(long k){
+-		return Edges[k].j;
+-	}
+-	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::nb{{{*/
+-	long SetOfEdges4::nb(){
+-		return NbOfEdges;
+-	}
+-	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::newarete{{{*/
+-	long SetOfEdges4::newarete(long k){
+-		return NbOfEdges == k+1;
+-	}
+-	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::SortAndAdd{{{*/
+-	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) {
+-		return ii <=jj ? find (ii,jj)  : find (jj,ii) ;
+-	}
+-	/*}}}*/
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Triangle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Triangle.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Triangle.h	(revision 12821)
+@@ -1,76 +0,0 @@
+-#ifndef _TRIANGLE_H_
+-#define _TRIANGLE_H_
+-
+-#include "./include.h"
+-#include "AdjacentTriangle.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class Mesh;
+-	class BamgVertex;
+-	class Triangle;
+-
+-	class Triangle {
+-
+-		friend class AdjacentTriangle;
+-
+-		private:
+-			BamgVertex *vertices[3];        // 3 vertices if t is triangle, t[i] allowed by access function, (*t)[i] if pointer
+-			Triangle   *adj[3];             // 3 pointers toward the adjacent triangles
+-			short       AdjEdgeIndex[3];   // edge id in the adjacent triangles. The edge number 1 is the edge number AdjEdgeIndex[1] in the Adjacent triangle 1
+-
+-		public: 
+-			Icoor2 det; //Integer determinant (twice its area)
+-			union { 
+-				Triangle *link;
+-				long      color;
+-			};
+-
+-			//Constructors/Destructors
+-			Triangle();
+-			Triangle(Mesh *Th,long i,long j,long k);
+-			Triangle(BamgVertex *v0,BamgVertex *v1,BamgVertex *v2);
+-
+-			//Operators
+-			const BamgVertex & operator[](int i) const {return *vertices[i];};
+-			BamgVertex & operator[](int i)  {return *vertices[i];};
+-			const BamgVertex * operator()(int i) const {return vertices[i];};
+-			BamgVertex * & operator()(int i)  {return vertices[i];};
+-
+-			//Methods
+-			void              Echo();
+-			double            Anisotropy() const;
+-			double            Length() const;
+-			int               swap(short a1,int=0);
+-			long              Optim(short a,int =0);
+-			int               Locked(int a)const;
+-			int               Hidden(int a)const;
+-			int               GetAllflag(int a);
+-			void              SetAllFlag(int a,int f);
+-			double            QualityQuad(int a,int option=1) const;
+-			short             NuEdgeTriangleAdj(int i) const;
+-			AdjacentTriangle  FindBoundaryEdge(int  i) const;
+-			AdjacentTriangle  Adj(int i) const;
+-			Triangle         *TriangleAdj(int i) const;
+-			Triangle         *Quadrangle(BamgVertex  *& v0,BamgVertex *& v1,BamgVertex *& v2,BamgVertex *& v3) const;
+-			void              Renumbering(Triangle   *tb,Triangle *te, long *renu);
+-			void              Renumbering(BamgVertex *vb,BamgVertex *ve, long *renu);
+-			void              SetAdjAdj(short a);
+-			void              SetAdj2(short a,Triangle *t,short aat);
+-			void              SetSingleVertexToTriangleConnectivity();
+-			void              SetHidden(int a);
+-			void              SetLocked(int a);
+-			void              SetMarkUnSwap(int a);
+-			void              SetUnMarkUnSwap(int a);
+-			void              SetDet();
+-
+-			//Inline methods
+-			double qualite() ;
+-			void  Set(const Triangle &,const Mesh &,Mesh &);
+-			int   In(BamgVertex *v) const { return vertices[0]==v || vertices[1]==v || vertices[2]==v ;}
+-
+-	};
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomEdge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomEdge.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomEdge.cpp	(revision 12821)
+@@ -1,190 +0,0 @@
+-#include <cstdio>
+-#include <string.h>
+-#include <cmath>
+-
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-
+-#include "GeomEdge.h"
+-#include "Geometry.h"
+-
+-using namespace std;
+-
+-namespace bamg {
+-
+-	/*Constructor/Destructor*/
+-
+-	/*Methods*/
+-	/*FUNCTION GeomEdge::Cracked{{{*/
+-	int    GeomEdge::Cracked() const  {
+-		return type &1;  
+-	}/*}}}*/
+-	/*FUNCTION GeomEdge::F{{{*/
+-	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
+-
+-	   R2 A=v[0]->r,B=v[1]->r;
+-		double ca,cb,cta,ctb;
+-
+-		//Check that theta is in [0 1]
+-		_assert_(theta>-1e-12 && theta<1+1e-12);
+-
+-		if (TgA()){ 
+-			if (TgB()){ //Hermite interpolation
+-				cb =  theta*theta*(3-2*theta);
+-				ca =  1-cb;     
+-				cta = (1-theta)*(1-theta)*theta;
+-				ctb = (theta-1)*theta*theta ;
+-			}
+-			else {
+-				double t = theta;
+-				cb = t*t;
+-				ca = 1-cb;
+-				cta= t-cb;
+-				ctb=0;    
+-			}
+-		}
+-		else{
+-			if (TgB()){
+-				double t = 1-theta;
+-				ca = t*t;
+-				cb = 1-ca;
+-				ctb= -t+ca;
+-				cta=0;    
+-			}
+-			else { // lagrange P1
+-				ca =(1-theta);
+-				cb = theta;
+-				cta=ctb=0;
+-			}
+-		}
+-		return A*ca + B*cb + tg[0]*cta + tg[1]*ctb;
+-	  }
+-	/*}}}*/
+-	/*FUNCTION GeomEdge::Mark{{{*/
+-	int    GeomEdge::Mark()    const  {
+-		return type &16; 
+-	}/*}}}*/
+-	/*FUNCTION GeomEdge::R1tg{{{*/
+-	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
+-
+-		R2 A=v[0]->r,B=v[1]->r;
+-		double dca,dcb,dcta,dctb;
+-		double ddca,ddcb,ddcta,ddctb;
+-		double tt = theta*theta;
+-
+-		//check theta
+-		_assert_(theta>=0 && theta<=1);
+-
+-		if (TgA()){ 
+-			if (TgB()){
+-				// Tangent A and B provided:
+-				// interpolation d'hermite
+-				dcb = 6*theta*(1-theta);
+-				ddcb = 6*(1-2*theta);
+-				dca = -dcb;
+-				ddca = -ddcb;
+-				dcta =  (3*theta - 4)*theta + 1;
+-				ddcta=6*theta-4;
+-				dctb = 3*tt - 2*theta;
+-				ddctb = 6*theta-2;
+-			}
+-			else {
+-				//Tangent A provided but tangent B not provided
+-				// 1-t*t, t-t*t, t*t
+-				double t = theta;
+-				dcb = 2*t;
+-				ddcb = 2;
+-				dca = -dcb;
+-				ddca = -2;
+-				dcta = 1-dcb;
+-				ddcta = -ddcb;
+-				dctb=0;    
+-				ddctb=0;    
+-			}
+-		}
+-		else{
+-			if (TgB()){
+-				//Tangent B provided but tangent A not provided
+-				double t = 1-theta;
+-				dca = -2*t;
+-				ddca = 2;
+-				dcb = -dca;
+-				ddcb = -2;
+-				dctb = 1+dca;
+-				ddctb= ddca;
+-				dcta =0;
+-				ddcta =0;
+-			}
+-			else {
+-				//Neither thangent A nor tangent B provided
+-				// lagrange P1
+-				t=B-A;
+-				return 0;
+-			} 
+-		}
+-		R2 d  =  A*dca  + B*dcb  + tg[0]* dcta  + tg[1] * dctb;
+-		R2 dd =  A*ddca + B*ddcb + tg[0]* ddcta + tg[1] * ddctb;
+-		double d2=(d,d);
+-		double sd2 = sqrt(d2);
+-		t=d;
+-		if(d2>1.0e-20){
+-			t/=sd2;
+-			return Abs(Det(d,dd))/(d2*sd2);
+-		}
+-		else return 0;
+-	}
+-	/*}}}*/
+-	/*FUNCTION GeomEdge::Required{{{*/
+-	int    GeomEdge::Required()       {
+-		return type &64; 
+-	}/*}}}*/
+-	/*FUNCTION GeomEdge::Set {{{*/
+-	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]); 
+-		if (Adj[0]) Adj[0] =  GhNew.edges + Gh.GetId(Adj[0]);     
+-		if (Adj[1]) Adj[1] =  GhNew.edges + Gh.GetId(Adj[1]);     
+-	}
+-	/*}}}*/
+-	/*FUNCTION GeomEdge::SetCracked{{{*/
+-	void   GeomEdge::SetCracked()     { 
+-		type |= 1;/*=>1st digit to 1*/
+-	}/*}}}*/
+-	/*FUNCTION GeomEdge::SetTgA{{{*/
+-	void   GeomEdge::SetTgA()         { 
+-		type |=4; /*=>2d digit to 1*/
+-	}/*}}}*/
+-	/*FUNCTION GeomEdge::SetTgB{{{*/
+-	void   GeomEdge::SetTgB()         { 
+-		type |=8; /*=> 3d digit to 1*/
+-	}/*}}}*/
+-	/*FUNCTION GeomEdge::SetMark{{{*/
+-	void   GeomEdge::SetMark()        { 
+-		type |=16;/*=> 4th digiy to 1*/
+-	}/*}}}*/
+-	/*FUNCTION GeomEdge::SetUnMark{{{*/
+-	void   GeomEdge::SetUnMark()      { 
+-		type &= 1007 /* 1023-16 = 000111110111 => 4th digit to 0*/;
+-	}/*}}}*/
+-	/*FUNCTION GeomEdge::SetRequired{{{*/
+-	void   GeomEdge::SetRequired()    { 
+-		type |= 64;/*=>6th digit to 1*/ 
+-	}/*}}}*/
+-	  /*FUNCTION GeomEdge::Tg{{{*/
+-	int    GeomEdge::Tg(int i) const  {
+-		return i==0 ? TgA() : TgB();
+-	}/*}}}*/
+-	/*FUNCTION GeomEdge::TgA{{{*/
+-	int    GeomEdge::TgA()     const  {
+-		return type &4;  
+-	}/*}}}*/
+-	/*FUNCTION GeomEdge::TgB{{{*/
+-	int    GeomEdge::TgB()     const  {
+-		return type &8;  
+-	}/*}}}*/
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/DoubleAndInt.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/DoubleAndInt.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/DoubleAndInt.h	(revision 12821)
+@@ -1,19 +0,0 @@
+-#ifndef _DOUBLEANDINT_H_
+-#define _DOUBLEANDINT_H_
+-
+-#include "./include.h"
+-
+-namespace bamg {
+-
+-	class DoubleAndInt {
+-		//class used by Mesh::MakeQuadrangles
+-
+-		public:
+-			double q;
+-			long i3j;
+-
+-			//Operators
+-			int operator<(DoubleAndInt a){return q > a.q;}
+-	};
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnVertex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnVertex.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnVertex.h	(revision 12821)
+@@ -1,28 +0,0 @@
+-#ifndef _VERTEXONVERTEX_H_
+-#define _VERTEXONVERTEX_H_
+-
+-#include "./include.h"
+-#include "./BamgVertex.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class Mesh;
+-
+-	class VertexOnVertex {
+-
+-		public:
+-			BamgVertex* v;
+-			BamgVertex* bv;
+-
+-			//Constructors
+-			VertexOnVertex();
+-			VertexOnVertex(BamgVertex * w,BamgVertex *bw);
+-
+-			//Methods
+-			void SetOnBTh();
+-			void Set(const Mesh &,long,Mesh &);
+-	};
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Direction.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Direction.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Direction.cpp	(revision 12821)
+@@ -1,36 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "Direction.h"
+-
+-namespace bamg {
+-
+-	/*Constructors/Destructors*/
+-	/*FUNCTION Direction() {{{*/
+-	Direction::Direction():
+-		dir(MaxICoor){
+-
+-	}/*}}}*/
+-	/*FUNCTION 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 
+-		dir = (j>0) ? r1 : r1+1;          // odd-> j>0 even-> j<0
+-	}/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION Direction::direction{{{*/
+-	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);
+-			r = (x*i + y*j) >=0;
+-		}
+-		return r;
+-	}
+-	/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgOpts.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgOpts.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgOpts.h	(revision 12821)
+@@ -1,57 +0,0 @@
+-/*!\file:  BamgOpts.h
+- * \brief place holder for optimization function arguments
+- */ 
+-
+-#ifndef _BAMGOPTS_H_
+-#define _BAMGOPTS_H_
+-
+-class BamgOpts{
+-
+-	public:
+-
+-		/*Parameters*/
+-		double  anisomax;
+-		double  cutoff;
+-		double  coeff;
+-		double  errg;
+-		double  gradation;
+-		int     Hessiantype;
+-		double  MaxCornerAngle;
+-		int     maxnbv;
+-		double  maxsubdiv;
+-		int     Metrictype;
+-		int     nbjacobi;
+-		int     nbsmooth;
+-		double  omega;
+-		double  power;
+-		int     verbose;
+-
+-		/*Flags*/
+-		int     Crack;
+-		int     geometricalmetric;
+-		int     KeepVertices;
+-		int     splitcorners;
+-
+-		/*Metric related*/
+-		double  hmin;
+-		double  hmax;
+-		int     hminVerticesSize[2];
+-		double* hminVertices;
+-		int     hmaxVerticesSize[2];
+-		double* hmaxVertices;
+-		int     hVerticesSize[2];
+-		double* hVertices;
+-		int     metricSize[2];
+-		double* metric;
+-		int     fieldSize[2];
+-		double* field;
+-		int     errSize[2];
+-		double* err;
+-
+-		BamgOpts();
+-		~BamgOpts();
+-
+-		void Check(void);
+-
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnGeom.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnGeom.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/VertexOnGeom.cpp	(revision 12821)
+@@ -1,70 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "VertexOnGeom.h"
+-#include "Mesh.h"
+-#include "Geometry.h"
+-
+-namespace bamg {
+-
+-	/*Constructors/Destructors*/
+-	/*FUNCTION VertexOnGeom::VertexOnGeom(){{{*/
+-	VertexOnGeom::VertexOnGeom(){
+-		meshvertex=NULL;
+-		curvilincoord=0;
+-		gv=0;
+-	} 
+-	/*}}}*/
+-	/*FUNCTION 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){
+-		meshvertex=&m;
+-		curvilincoord=s;
+-		ge=&g;
+-	}
+-	/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION VertexOnGeom::Set {{{*/
+-	void VertexOnGeom::Set(const VertexOnGeom & rec,const Mesh & Th ,Mesh & ThNew){
+-		*this = rec;  
+-		meshvertex = ThNew.vertices + Th.GetId(meshvertex);
+-		if (gv)
+-		 if (curvilincoord < 0 )
+-		  gv = ThNew.Gh.vertices + Th.Gh.GetId(gv);
+-		 else
+-		  ge = ThNew.Gh.edges + Th.Gh.GetId(ge);
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION VertexOnGeom::OnGeomVertex{{{*/
+-	int VertexOnGeom::OnGeomVertex()const{
+-		return this? curvilincoord <0 :0;
+-	}
+-	/*}}}*/
+-	/*FUNCTION VertexOnGeom::OnGeomEdge{{{*/
+-	int VertexOnGeom::OnGeomEdge() const{
+-		return this? curvilincoord >=0 :0;
+-	}
+-	/*}}}*/
+-	/*FUNCTION VertexOnGeom::IsRequiredVertex{{{*/
+-	int VertexOnGeom::IsRequiredVertex() {
+-		return this? ((curvilincoord<0 ? (gv?gv->Required():0):0 )) : 0;
+-	}
+-	/*}}}*/
+-	/*FUNCTION VertexOnGeom::SetOn{{{*/
+-	void VertexOnGeom::SetOn(){
+-		meshvertex->GeomEdgeHook=this;
+-		meshvertex->IndexInTriangle=IsVertexOnGeom;
+-	}
+-	/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgGeom.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgGeom.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgGeom.h	(revision 12821)
+@@ -1,31 +0,0 @@
+-/*!\file:  BamgGeom.h
+- */ 
+-
+-#ifndef _BAMGGEOM_H_
+-#define _BAMGGEOM_H_
+-
+-class BamgGeom{
+-
+-	public:
+-		int     VerticesSize[2];
+-		double* Vertices;
+-		int     EdgesSize[2];
+-		double* Edges;
+-		int     TangentAtEdgesSize[2];
+-		double* TangentAtEdges;
+-		int     CornersSize[2];
+-		double* Corners;
+-		int     RequiredVerticesSize[2];
+-		double* RequiredVertices;
+-		int     RequiredEdgesSize[2];
+-		double* RequiredEdges;
+-		int     CrackedEdgesSize[2];
+-		double* CrackedEdges;
+-		int     SubDomainsSize[2];
+-		double* SubDomains;
+-
+-		BamgGeom();
+-		~BamgGeom();
+-};
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/CrackedEdge.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/CrackedEdge.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/CrackedEdge.h	(revision 12821)
+@@ -1,31 +0,0 @@
+-#ifndef _CRACKEDEDGE_H_
+-#define _CRACKEDEDGE_H_
+-
+-#include "./typedefs.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class Triangle;
+-	class GeomEdge;
+-	class Edge;
+-
+-	class CrackedEdge {
+-
+-		public:
+-			Triangle* a;
+-			Triangle* b; 
+-			GeomEdge* E;
+-			Edge* e1;
+-			Edge* e2;
+-			double length;
+-			R2     normal;
+-			long   indexa[3];
+-			long   indexb[3];
+-
+-			//Constructors
+-			CrackedEdge();
+-	};
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SubDomain.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SubDomain.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/SubDomain.h	(revision 12821)
+@@ -1,27 +0,0 @@
+-#ifndef _SUBDOMAIN_H_
+-#define _SUBDOMAIN_H_
+-
+-#include "./include.h"
+-#include "./Edge.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class Triangle;
+-	class Mesh;
+-
+-	class SubDomain {
+-
+-		public:
+-
+-			Triangle *head;
+-			long      ReferenceNumber;
+-			int       direction;   // -1 or 1
+-			Edge     *edge;        // to geometrical
+-
+-			//Methods
+-			void Set(const Mesh &,long,Mesh &);
+-	};
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgMesh.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/BamgMesh.h	(revision 12821)
+@@ -1,52 +0,0 @@
+-/*!\file:  BamgMesh.h
+- */ 
+-
+-#ifndef _BAMGMESH_H_
+-#define _BAMGMESH_H_
+-
+-class BamgMesh{
+-
+-	public:
+-
+-		int     VerticesSize[2];
+-		double* Vertices;
+-		int     EdgesSize[2];
+-		double* Edges;
+-		int     TrianglesSize[2];
+-		double* Triangles;
+-		int     QuadrilateralsSize[2];
+-		double* Quadrilaterals;
+-
+-		int     VerticesOnGeomVertexSize[2];
+-		double* VerticesOnGeomVertex;
+-		int     VerticesOnGeomEdgeSize[2];
+-		double* VerticesOnGeomEdge;
+-		int     EdgesOnGeomEdgeSize[2];
+-		double* EdgesOnGeomEdge;
+-
+-		int     SubDomainsSize[2];
+-		double* SubDomains;
+-		int     SubDomainsFromGeomSize[2];
+-		double* SubDomainsFromGeom;
+-		int     CrackedVerticesSize[2];
+-		double* CrackedVertices;
+-		int     CrackedEdgesSize[2];
+-		double* CrackedEdges;
+-
+-		/*Output for ISSM*/
+-		int     IssmEdgesSize[2];
+-		double* IssmEdges;
+-		int     IssmSegmentsSize[2];
+-		double* IssmSegments;
+-		int     ElementConnectivitySize[2];
+-		double* ElementConnectivity;
+-		int     NodalConnectivitySize[2];
+-		double* NodalConnectivity;
+-		int     NodalElementConnectivitySize[2];
+-		double* NodalElementConnectivity;
+-
+-		BamgMesh();
+-		~BamgMesh();
+-};
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Metric.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Metric.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Metric.h	(revision 12821)
+@@ -1,138 +0,0 @@
+-#ifndef _METRIC_H
+-#define _METRIC_H
+-
+-#include "./include.h"
+-#include "../../shared/Bamg/shared.h"
+-#include "R2.h"
+-#include <math.h>
+-
+-namespace bamg {
+-
+-	typedef P2<double,double>    D2;
+-	typedef P2xP2<double,double> D2xD2;
+-
+-	class Metric;
+-	class EigenMetric;
+-
+-	class Metric{
+-
+-		public:
+-
+-			//fields
+-			double a11,a21,a22;
+-
+-			//friends
+-			friend class EigenMetric;
+-
+-			//functions
+-			Metric():a11(0),a21(0),a22(0){};
+-			Metric(const EigenMetric&);
+-			Metric(double a);
+-			Metric(double a,double b,double c);
+-			Metric( double  a,const  Metric& ma, double  b,const  Metric& mb);
+-			Metric(const double  a[3],const  Metric& m0,const  Metric& m1,const  Metric& m2 );
+-			void        Echo();
+-			R2          mul(const R2 x)const;
+-			double      det() const;
+-			int         IntersectWith(const  Metric& M2);
+-			inline void Box(double &hx,double &hy) const;
+-
+-			/*The following functions must remain the the header file because it is called before Metric
+-			 * is compiled by other classes*/
+-			R2 Orthogonal(const R2 x){ return R2(-(a21*x.x+a22*x.y),a11*x.x+a21*x.y); }
+-			R2 Orthogonal(const I2 x){ return R2(-(a21*x.x+a22*x.y),a11*x.x+a21*x.y); }
+-
+-			//operators
+-			Metric operator*(double c) const {double c2=c*c;return  Metric(a11*c2,a21*c2,a22*c2);} 
+-			Metric operator/(double c) const {double c2=1/(c*c);return  Metric(a11*c2,a21*c2,a22*c2);} 
+-			operator D2xD2(){ return D2xD2(a11,a21,a21,a22);}
+-			double  operator()(R2 x) const { return sqrt(x.x*x.x*a11+2*x.x*x.y*a21+x.y*x.y*a22);};        // length of x in metric sqrt(<Mx,x>)
+-			double  operator()(R2 x,R2 y) const { return x.x*y.x*a11+(x.x*x.y+x.y*y.x)*a21+x.y*y.y*a22;};
+-
+-	};
+-
+-	class EigenMetric{
+-		public:
+-
+-			//fields
+-			double lambda1,lambda2;
+-			D2     v;
+-
+-			//friends
+-			friend  class Metric;
+-
+-			//functions
+-			EigenMetric(const Metric& );
+-			EigenMetric(double r1,double r2,const D2& vp1);
+-			void   Echo();
+-			void   Abs();
+-			void   pow(double  p);
+-			void   Min(double  a);
+-			void   Max(double  a);
+-			void   Minh(double h);
+-			void   Maxh(double h);
+-			void   Isotrope();
+-			double hmin()   const;
+-			double hmax()   const;
+-			double lmax()   const;
+-			double lmin()   const;
+-			double Aniso2() const;
+-			double Aniso()  const;
+-			void   BoundAniso(const  double c);
+-			inline void BoundAniso2(const double coef);
+-
+-			//operators
+-			void operator *=(double coef){ lambda1*=coef;lambda2*=coef;}
+-	};
+-
+-	class SaveMetricInterpole {
+-		friend double LengthInterpole(const Metric& Ma,const  Metric& Mb, R2 AB);
+-		friend double abscisseInterpole(const Metric& Ma ,const  Metric& Mb, R2 ,double s,int optim);
+-		public:
+-		int opt;
+-		double lab;
+-		double L[1024],S[1024];
+-	};
+-
+-	extern SaveMetricInterpole  LastMetricInterpole; // for optimization 
+-	//Functions
+-	void  SimultaneousMatrixReduction( Metric M1,  Metric M2,D2xD2 &V);
+-	double LengthInterpole(const Metric& Ma,const  Metric& Mb, R2 AB);
+-	double abscisseInterpole(const Metric& Ma,const  Metric& Mb, R2 AB,double s,int optim=0);
+-
+-	//inlines
+-	inline void  EigenMetric::BoundAniso2(const double coef){
+-		if (coef<=1.00000000001){
+-			if (lambda1 < lambda2)
+-			 lambda1 = bamg::Max(lambda1,lambda2*coef);
+-			else
+-			 lambda2 = bamg::Max(lambda2,lambda1*coef);
+-		}
+-		else{  //TO BE CHECKED
+-			if (lambda1 > lambda2)
+-			 lambda1 = bamg::Min(lambda1,lambda2*coef);
+-			else
+-			 lambda2 = bamg::Min(lambda2,lambda1*coef);
+-		}
+-	}
+-	inline Metric::Metric(const EigenMetric& M) {
+-		double v00=M.v.x*M.v.x;
+-		double v11=M.v.y*M.v.y;
+-		double v01=M.v.x*M.v.y;
+-		a11=v00*M.lambda1+v11*M.lambda2;
+-		a21=v01*(M.lambda1-M.lambda2);
+-		a22=v00*M.lambda2+v11*M.lambda1;
+-	}
+-	inline   void  Metric::Box(double &hx,double &hy) const {
+-		double d=  a11*a22-a21*a21;
+-		hx = sqrt(a22/d);
+-		hy = sqrt(a11/d);
+-	}
+-	inline double LengthInterpole(double la,double lb) {
+-		return ( Abs(la - lb) < 1.0e-6*Max3(la,lb,1.0e-20) ) ?  (la+lb)/2  : la*lb*log(la/lb)/(la-lb);
+-	}
+-	inline double abscisseInterpole(double la,double lb,double lab,double s){
+-		return ( Abs(la - lb) <1.0e-6*Max3(la,lb,1.0e-20))  ? s : (exp(s*lab*(la-lb)/(la*lb))-1)*lb/(la-lb);
+-	}
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/include.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/include.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/include.h	(revision 12821)
+@@ -1,12 +0,0 @@
+-/*!\file: include.h
+- * \brief prototypes for include.h
+- */ 
+-
+-#ifndef _INCLUDE2_H_
+-#define  _INCLUDE2_H_
+-
+-#include "../../include/macros.h"
+-#include "./macros.h"
+-#include "./typedefs.h"
+-
+-#endif //ifndef _INCLUDE2_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/typedefs.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/typedefs.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/typedefs.h	(revision 12821)
+@@ -1,21 +0,0 @@
+-#ifndef _BAMGTYPEDEFS_H
+-#define _BAMGTYPEDEFS_H
+-
+-#include "./R2.h"
+-
+-namespace bamg {
+-
+-	/*Integer coordinates types*/
+-	typedef int  Icoor1; 
+-	#if LONG_BIT > 63 //64 bits or more
+-	typedef long Icoor2;
+-	#else //32 bits
+-	typedef double Icoor2;
+-	#endif
+-
+-	/*I2 and R2*/
+-	typedef P2<Icoor1,Icoor2>  I2;
+-	typedef P2<double,double>  R2;
+-}
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Curve.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Curve.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Curve.h	(revision 12821)
+@@ -1,27 +0,0 @@
+-#ifndef _CURVE_H_
+-#define _CURVE_H_
+-
+-#include "../../shared/Bamg/shared.h"
+-
+-namespace bamg {
+-
+-	//classes
+-	class GeomEdge;
+-	class Curve;
+-	class Geometry;
+-
+-	class Curve {
+-		public:
+-			GeomEdge *FirstEdge; //First edge of the curve
+-			GeomEdge *LastEdge;  //Last edge of the curve
+-			int FirstVertexIndex;       //Last vertex index in the last edge
+-			int LastVertexIndex;        //First Vertex index in the first edge
+-
+-			//Methods
+-			Curve();
+-			void Reverse(void);
+-			void Set(const Curve & rec,const Geometry & Th ,Geometry & ThNew);
+-	};
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/macros.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/macros.h	(revision 12821)
+@@ -1,29 +0,0 @@
+-#ifndef _BAMGMACROS_H
+-#define _BAMGMACROS_H
+-
+-#include "./typedefs.h"
+-
+-namespace bamg {
+-
+-	const double Pi =3.141592653589793238462643383279502884197169399375105820974944592308;
+-	const float  fPi=3.141592653589793238462643383279502884197169399375105820974944592308;
+-	const  int   IsVertexOnGeom = 8;
+-	const  int   IsVertexOnVertex = 16;
+-	const  int   IsVertexOnEdge = 32;
+-	static const short VerticesOfTriangularEdge[3][2] = {{1,2},{2,0},{0,1}};
+-	static const short EdgesVertexTriangle[3][2] = {{1,2},{2,0},{0,1}};
+-	static const short OppositeVertex[3] = {0,1,2};
+-	static const short OppositeEdge[3] =  {0,1,2};
+-	static const short NextEdge[3] = {1,2,0};
+-	static const short PreviousEdge[3] = {2,0,1};
+-	static const short NextVertex[3] = {1,2,0};
+-	static const short PreviousVertex[3] = {2,0,1};
+-	#if LONG_BIT > 63
+-	const  Icoor1 MaxICoor   = 1073741823; // 2^30-1 =111...111 (29 times)
+-	#else
+-	const  Icoor1 MaxICoor   = 8388608;    // 2^23
+-	#endif
+-	const  Icoor2 MaxICoor22 = Icoor2(2)*Icoor2(MaxICoor) * Icoor2(MaxICoor) ;
+-}
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomVertex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomVertex.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/GeomVertex.h	(revision 12821)
+@@ -1,30 +0,0 @@
+-#ifndef _GEOMETRICALVERTEX_H_
+-#define _GEOMETRICALVERTEX_H_
+-
+-#include "./include.h"
+-#include "BamgVertex.h"
+-
+-namespace bamg {
+-
+-	class Geometry;
+-
+-	class GeomVertex : public BamgVertex { 
+-
+-		public:
+-			friend class Geometry;
+-
+-			int type;
+-
+-			//Constructors
+-			GeomVertex():type(0){};
+-
+-			//Methods
+-			int  Corner() const;
+-			int  Required()const;
+-			void SetCorner();
+-			void SetRequired();
+-
+-	};
+-
+-}
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/EigenMetric.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/EigenMetric.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/EigenMetric.cpp	(revision 12821)
+@@ -1,168 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "Metric.h"
+-
+-namespace bamg {
+-
+-	/*Constructor*/
+-	/*FUNCTION 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*/
+-		double a11=M.a11,a21=M.a21,a22=M.a22;
+-		double normM;
+-		double delta,b;
+-
+-		/*To get the eigen values, we must solve the following equation:
+-		 *     | a11 - lambda    a21        |
+-		 * det |                            | = 0
+-		 *     | a21             a22-lambda |
+-		 *
+-		 * We have to solve the following polynom:
+-		 *  lamda^2 + ( -a11 -a22)*lambda + (a11*a22-a21*a21) = 0*/
+-
+-		/*Compute polynom determinant*/
+-		b=-a11-a22;
+-		delta=b*b - 4*(a11*a22-a21*a21);
+-
+-
+-		/*Compute norm of M to avoid round off errors*/
+-		normM=a11*a11 + a22*a22 + a21*a21;
+-
+-		/*1: normM too small: eigen values = 0*/
+-		if(normM<1.e-30){
+-			lambda1=0;
+-			lambda2=0;
+-			v.x=1;
+-			v.y=0;
+-		}
+-		/*2: delta is small -> double root*/
+-		else if (delta < 1.e-5*normM){
+-			lambda1=-b/2;
+-			lambda2=-b/2;
+-			v.x=1;
+-			v.y=0;
+-		}
+-		/*3: general case -> two roots*/
+-		else{
+-			delta     = sqrt(delta);
+-			lambda1   = (-b-delta)/2.0;
+-			lambda2   = (-b+delta)/2.0;
+-
+-			/*Now, one must find the eigen vectors. For that we use the following property of the inner product
+-			 *    <Ax,y> = <x,tAy>
+-			 * Here, M'(M-lambda*Id) is symmetrical, which gives:
+-			 *    ∀(x,y)∈R²xR² <M'x,y> = <M'y,x>
+-			 * And we have the following:
+-			 *    if y∈Ker(M'), ∀x∈R² <M'x,y> = <x,M'y> = 0
+-			 * We have shown that
+-			 *    Im(M') ⊥ Ker(M')
+-			 *
+-			 * To find the eigen vectors of M, we only have to find two vectors
+-			 * of the image of M' and take their perpendicular as long as they are
+-			 * not 0.
+-			 * To do that, we take the images (1,0) and (0,1):
+-			 *  x1 = (a11 - lambda)      x2 = a21
+-			 *  y1 = a21                 y2 = (a22-lambda)
+-			 *
+-			 * We take the vector that has the larger norm and take its perpendicular.*/
+-
+-			double norm1 = (a11-lambda1)*(a11-lambda1) + a21*a21; 
+-			double norm2 = a21*a21 + (a22-lambda1)*(a22-lambda1);
+-
+-			if (norm2<norm1){
+-				norm1=sqrt(norm1);
+-				v.x = - a21/norm1;
+-				v.y = (a11-lambda1)/norm1;
+-			}
+-			else{
+-				norm2=sqrt(norm2);
+-				v.x = - (a22-lambda1)/norm2;
+-				v.y = a21/norm2;
+-			}
+-		}
+-
+-	}
+-	/*}}}*/
+-	/*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){
+-
+-	}/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION EigenMetric::Abs{{{*/
+-	void   EigenMetric::Abs(){
+-		lambda1=bamg::Abs(lambda1),lambda2=bamg::Abs(lambda2);
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::Aniso{{{*/
+-	double EigenMetric::Aniso() const  { 
+-		return sqrt( Aniso2());
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::Aniso2{{{*/
+-	double EigenMetric::Aniso2() const  { 
+-		return lmax()/lmin();
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::BoundAniso{{{*/
+-	void   EigenMetric::BoundAniso(const double c){ 
+-		BoundAniso2(1/(c*c));
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::Echo {{{*/
+-	void EigenMetric::Echo(void){
+-
+-		_printLine_("EigenMetric:");
+-		_printLine_("   lambda1: " << lambda1);
+-		_printLine_("   lambda2: " << lambda2);
+-		_printLine_("   v.x: " << v.x);
+-		_printLine_("   v.y: " << v.y);
+-
+-		return;
+-	}
+-	/*}}}*/
+-	/*FUNCTION EigenMetric::hmin{{{*/
+-	double EigenMetric::hmin() const {
+-		return sqrt(1/bamg::Max3(lambda1,lambda2,1e-30));
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::hmax{{{*/
+-	double EigenMetric::hmax() const {
+-		return sqrt(1/bamg::Max(bamg::Min(lambda1,lambda2),1e-30));
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::Isotrope{{{*/
+-	void   EigenMetric::Isotrope() {
+-		lambda1=lambda2=bamg::Max(lambda1,lambda2);
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::lmax{{{*/
+-	double EigenMetric::lmax() const {
+-		return bamg::Max3(lambda1,lambda2,1e-30);
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::lmin{{{*/
+-	double EigenMetric::lmin() const {
+-		return bamg::Max(bamg::Min(lambda1,lambda2),1e-30);
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::Min{{{*/
+-	void   EigenMetric::Min(double a) { 
+-		lambda1=bamg::Min(a,lambda1); lambda2=bamg::Min(a,lambda2) ;
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::Max{{{*/
+-	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) {
+-		Min(1.0/(h*h));
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::Maxh{{{*/
+-	void   EigenMetric::Maxh(double h) {
+-		//Call Max function
+-		Max(1.0/(h*h));
+-	}/*}}}*/
+-	/*FUNCTION EigenMetric::pow{{{*/
+-	void   EigenMetric::pow(double p){
+-		lambda1=::pow(lambda1,p);lambda2=::pow(lambda2,p);
+-	}/*}}}*/
+-
+-} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp	(revision 12821)
+@@ -1,6006 +0,0 @@
+-#include <cstdio>
+-#include <cstring>
+-#include <cmath>
+-#include <ctime>
+-
+-#include "../objects.h"
+-
+-namespace bamg {
+-
+-	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){ 
+-
+-		/*Initialize fields*/
+-		Init(0);
+-
+-		/*Read Geometry if provided*/
+-		if(bamggeom->Edges) {
+-			Gh.ReadGeometry(bamggeom,bamgopts);
+-			Gh.PostRead();
+-		}
+-
+-		/*Read background mesh*/
+-		ReadMesh(bamgmesh,bamgopts);
+-
+-		/*Build Geometry if not provided*/
+-		if(bamggeom->Edges==NULL) {
+-			/*Recreate geometry if needed*/
+-			_printLine_("WARNING: mesh present but no geometry found. Reconstructing...");
+-			BuildGeometryFromMesh(bamgopts);
+-			Gh.PostRead();
+-		}
+-
+-		/*Set integer coordinates*/
+-		SetIntCoor();
+-
+-		/*Fill holes and generate mesh properties*/
+-		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){
+-
+-		Init(0);
+-		ReadMesh(index,x,y,nods,nels);
+-		SetIntCoor();
+-		ReconstructExistingMesh();
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::Mesh(double* x,double* y,int nods){{{*/
+-	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) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Triangles)*/
+-
+-		  int i,k,itadj;
+-		  int kt=0;
+-		  int * kk    = new int [Tho.nbv];
+-		  long * reft = new long[Tho.nbt];
+-		  long nbInT =    Tho.TriangleReferenceList(reft);
+-		  long * refv = new long[Tho.nbv];
+-
+-		  for (i=0;i<Tho.nbv;i++)
+-			kk[i]=-1;
+-		  for (i=0;i<Tho.nbv;i++)
+-			refv[i]=0;
+-		  int nbNewBedge =0;
+-		  //  int nbOldBedge =0;  
+-		  for (i=0;i<Tho.nbt;i++)
+-			if(  reft[i] >=0 && flag[i]) 
+-			  {
+-				const Triangle & t = Tho.triangles[i];
+-				kt++;
+-				kk[Tho.GetId(t[0])]=1;
+-				kk[Tho.GetId(t[1])]=1;
+-				kk[Tho.GetId(t[2])]=1;
+-				itadj=Tho.GetId(t.TriangleAdj(0));
+-				if (  reft[itadj] >=0 && !flag[itadj])
+-				  { nbNewBedge++;
+-					refv[Tho.GetId(t[VerticesOfTriangularEdge[0][0]])]=bb[i];
+-					refv[Tho.GetId(t[VerticesOfTriangularEdge[0][1]])]=bb[i];
+-				  }
+-				itadj=Tho.GetId(t.TriangleAdj(1));
+-				if (  reft[itadj] >=0 && !flag[itadj])
+-				  { nbNewBedge++;
+-					refv[Tho.GetId(t[VerticesOfTriangularEdge[1][0]])]=bb[i];
+-					refv[Tho.GetId(t[VerticesOfTriangularEdge[1][1]])]=bb[i];}
+-					itadj=Tho.GetId(t.TriangleAdj(2));
+-					if (  reft[itadj] >=0 && !flag[itadj])
+-					  { nbNewBedge++;
+-						refv[Tho.GetId(t[VerticesOfTriangularEdge[2][0]])]=bb[i];
+-						refv[Tho.GetId(t[VerticesOfTriangularEdge[2][1]])]=bb[i];}
+-			  }
+-		  k=0;
+-		  for (i=0;i<Tho.nbv;i++){
+-			  if (kk[i]>=0) kk[i]=k++;
+-			}
+-		  _printLine_("   number of vertices " << k << ", remove = " << Tho.nbv - k);
+-		  _printLine_("   number of triangles " << kt << ", remove = " << nbInT-kt);
+-		  _printLine_("   number of New boundary edge " << nbNewBedge);
+-		  long imaxnbv =k;
+-		  Init(imaxnbv);
+-		  for (i=0;i<Tho.nbv;i++)
+-			if (kk[i]>=0) 
+-			  {
+-				vertices[nbv] = Tho.vertices[i];
+-				if (!vertices[nbv].GetReferenceNumber())
+-				 vertices[nbv].ReferenceNumber = refv[i];
+-				nbv++;
+-			  }
+-		  if (imaxnbv != nbv){
+-			  delete [] kk;
+-			  delete [] refv;
+-			  _error2_("imaxnbv != nbv");
+-		  }
+-		  for (i=0;i<Tho.nbt;i++)
+-			if(  reft[i] >=0 && flag[i]) 
+-			  {
+-				const Triangle & t = Tho.triangles[i];
+-				int i0 = Tho.GetId(t[0]);
+-				int i1 = Tho.GetId(t[1]);
+-				int i2 = Tho.GetId(t[2]);
+-				if (i0<0 || i1<0 || i2<0){
+-					delete [] refv;
+-					_error2_("i0<0 || i1<0 || i2< 0");
+-				}
+-				if (i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv){
+-					_error2_("i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv");
+-				}
+-				triangles[nbt] = Triangle(this,kk[i0],kk[i1],kk[i2]);
+-				triangles[nbt].color = Tho.subdomains[reft[i]].ReferenceNumber; 
+-				nbt++;           
+-			  }
+-		  if (kt!=nbt){
+-			  _error2_("kt!=nbt");
+-		  }
+-		  if (nbt==0 && nbv==0) {
+-			  _error2_("All triangles have been removed");
+-		  }
+-		  delete [] kk;
+-		  delete [] reft;
+-		  delete [] refv;
+-		  //double cutoffradian = 10.0/180.0*Pi;
+-		  BuildGeometryFromMesh(bamgopts);
+-		  Gh.PostRead(); 
+-		  SetIntCoor();
+-		  ReconstructExistingMesh();
+-
+-		  if (!nbsubdomains){
+-			  _error2_("nbsubdomains==0");
+-		  }
+-		  if (!subdomains[0].head || !subdomains[0].head->link){
+-			  _error2_("!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)
+-	  : 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++;
+-		  maxnbv_in = Max(maxnbv_in,Th.nbv); 
+-		  long i;
+-		  // do all the allocation to be sure all the pointer existe
+-
+-		  Init(maxnbv_in);// to make the allocation 
+-		  // copy of triangles
+-		  nbv = Th.nbv;
+-		  nbt = Th.nbt;
+-		  nbe = Th.nbe;
+-		  nbsubdomains = Th.nbsubdomains;
+-		  nbtout = Th.nbtout;
+-		  nbq =  Th.nbq ;
+-		  NbVerticesOnGeomVertex = Th.NbVerticesOnGeomVertex;
+-		  if(NbVerticesOnGeomVertex)
+-			VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex];
+-		  NbVerticesOnGeomEdge = Th.NbVerticesOnGeomEdge;
+-		  if (NbVerticesOnGeomEdge)
+-			VerticesOnGeomEdge = new VertexOnGeom[NbVerticesOnGeomEdge] ;
+-		  if (& BTh == & Th.BTh){ // same background 
+-			  BTh.NbRef++;
+-			  NbVertexOnBThVertex = Th.NbVertexOnBThVertex;
+-			  if(NbVertexOnBThVertex)
+-				VertexOnBThVertex = new VertexOnVertex[NbVertexOnBThVertex];
+-			  NbVertexOnBThEdge = Th.NbVertexOnBThEdge;
+-			  if(NbVertexOnBThEdge)
+-				VertexOnBThEdge = new VertexOnEdge[NbVertexOnBThEdge];
+-			 }
+-		  else { // no add on background mesh 
+-			  BTh.NbRef++;
+-			  NbVertexOnBThVertex=0;
+-			  VertexOnBThVertex=0;
+-			  NbVertexOnBThEdge=0;
+-			  VertexOnBThEdge=0;
+-			 }
+-
+-
+-		  if(nbe)
+-			edges = new Edge[nbe];
+-		  if(nbsubdomains)
+-			subdomains = new SubDomain[nbsubdomains];
+-		  pmin = Th.pmin;
+-		  pmax = Th.pmax;
+-		  coefIcoor = Th.coefIcoor;
+-		  for(i=0;i<nbt;i++)
+-			triangles[i].Set(Th.triangles[i],Th,*this);
+-		  for(i=0;i<nbe;i++)
+-			edges[i].Set(Th,i,*this);
+-		  for(i=0;i<nbv;i++)
+-			vertices[i].Set(Th.vertices[i],Th,*this);
+-		  for(i=0;i<nbsubdomains;i++)  
+-			subdomains[i].Set(Th,i,*this);
+-		  for (i=0;i<NbVerticesOnGeomVertex;i++)
+-			VerticesOnGeomVertex[i].Set(Th.VerticesOnGeomVertex[i],Th,*this);
+-		  for (i=0;i<NbVerticesOnGeomEdge;i++)
+-			VerticesOnGeomEdge[i].Set(Th.VerticesOnGeomEdge[i],Th,*this);
+-		  quadtree=0;
+-
+-	  }
+-	/*}}}*/
+-	/*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) {
+-		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){
+-		Init(imaxnbv);
+-		TriangulateFromGeom0(bamgopts);
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::~Mesh(){{{*/
+-	Mesh::~Mesh() {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Triangles)*/
+-
+-		//if (vertices)             delete [] vertices;
+-		if (edges)                delete [] edges;
+-		if (triangles)            delete [] triangles;
+-		if (quadtree)             delete    quadtree;
+-		//if (orderedvertices)                delete [] orderedvertices;
+-		if (subdomains)           delete []  subdomains;
+-		if (VerticesOnGeomEdge)   delete [] VerticesOnGeomEdge;
+-		if (VerticesOnGeomVertex) delete [] VerticesOnGeomVertex;
+-		if (VertexOnBThVertex)    delete [] VertexOnBThVertex;
+-		if (VertexOnBThEdge)      delete [] VertexOnBThEdge;
+-
+-		if (&Gh) {
+-			if (Gh.NbRef>0) Gh.NbRef--;
+-			else if (Gh.NbRef==0) delete &Gh;
+-		}
+-		if (&BTh && (&BTh != this)) {
+-			if (BTh.NbRef>0) BTh.NbRef--;
+-			else if (BTh.NbRef==0) delete &BTh;
+-		}
+-		Init(0); // set all to zero 
+-	}
+-	/*}}}*/
+-
+-	/*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){
+-
+-		double Hmin = HUGE_VAL;// the infinie value 
+-		long i1,i2,i3;
+-		long i,j;
+-		Metric M1(1);
+-		int verbose=0;
+-		bool* nodeflags=NULL;
+-
+-		nbv=nods;
+-		maxnbv=nbv;
+-		nbt=nels;
+-
+-		//Vertices
+-		if (verbose) _printLine_("Reading vertices (" << nbv << ")");
+-		vertices=xNew<BamgVertex>(nbv);
+-		orderedvertices=xNew<BamgVertex*>(nbv);
+-		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 
+-
+-		//Triangles
+-		if (verbose) _printLine_("Reading triangles (" << nbt << ")");
+-		triangles =new Triangle[maxnbt]; //we cannot allocate only nbt triangles since 
+-		nodeflags=xNew<bool>(nbv);
+-		for(i=0;i<nbv;i++) nodeflags[i]=false;
+-		//other triangles will be added for each edge
+-		for (i=0;i<nbt;i++){
+-			Triangle & t = triangles[i];
+-			i1=(long)index[i*3+0]-1; //for C indexing
+-			i2=(long)index[i*3+1]-1; //for C indexing
+-			i3=(long)index[i*3+2]-1; //for C indexing
+-			t=Triangle(this,i1,i2,i3);
+-			t.color=1;
+-			nodeflags[i1]=nodeflags[i2]=nodeflags[i3]=true;
+-		}
+-
+-		/*Recreate geometry: */
+-		if (verbose) _printLine_("Building Geometry");
+-		BuildGeometryFromMesh();
+-		if (verbose) _printLine_("Completing geometry");
+-		Gh.PostRead();
+-
+-		/*Check that there is no orphan*/
+-		bool isorphan=false;
+-		for(i=0;i<nbv;i++){
+-			if(!nodeflags[i]){
+-				_printLine_("Vertex " << i+1 << " does not belong to any element");
+-				isorphan=true;
+-			}
+-		}
+-		if(isorphan) _error2_("Orphan found in mesh, see ids above");
+-
+-		/*Clean up*/
+-		xDelete<bool>(nodeflags);
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts){{{*/
+-	void Mesh::ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts){
+-
+-		int    verbose;
+-		double Hmin = HUGE_VAL;    // the infinie value
+-		long   i1,i2,i3;
+-		long   i,j;
+-		Metric M1(1);
+-
+-		verbose=bamgopts->verbose;
+-
+-		nbv=bamgmesh->VerticesSize[0];
+-		maxnbv=nbv;
+-		nbt=bamgmesh->TrianglesSize[0];
+-
+-		//Vertices
+-		if(bamgmesh->Vertices){
+-			if(verbose>5) _printLine_("      processing Vertices");
+-
+-			vertices=xNew<BamgVertex>(nbv);
+-			orderedvertices=xNew<BamgVertex*>(nbv);
+-
+-			for (i=0;i<nbv;i++){
+-				vertices[i].r.x=bamgmesh->Vertices[i*3+0];
+-				vertices[i].r.y=bamgmesh->Vertices[i*3+1];
+-				vertices[i].ReferenceNumber=(long)bamgmesh->Vertices[i*3+2];
+-				vertices[i].DirOfSearch =NoDirOfSearch;
+-				vertices[i].m=M1;
+-				vertices[i].color=0;
+-			}
+-			maxnbt=2*maxnbv-2; // for filling The Holes and quadrilaterals 
+-		}
+-		else{
+-			if(verbose>5) _error2_("no Vertices found in the initial mesh");
+-		}
+-
+-		//Triangles
+-		if(bamgmesh->Triangles){
+-			if(verbose>5) _printLine_("      processing Triangles");
+-			triangles =new Triangle[maxnbt]; //we cannot allocate only nbt triangles since 
+-			//other triangles will be added for each edge
+-			for (i=0;i<nbt;i++){
+-				Triangle &t=triangles[i];
+-				i1=(long)bamgmesh->Triangles[i*4+0]-1; //for C indexing
+-				i2=(long)bamgmesh->Triangles[i*4+1]-1; //for C indexing
+-				i3=(long)bamgmesh->Triangles[i*4+2]-1; //for C indexing
+-				t=Triangle(this,i1,i2,i3);
+-				t.color=(long)bamgmesh->Triangles[i*4+3];
+-			}
+-		}
+-		else{
+-			if(verbose>5) _error2_("no Triangles found in the initial mesh");
+-		}
+-
+-		//Quadrilaterals
+-		if(bamgmesh->Quadrilaterals){
+-			if(verbose>5) _printLine_("      processing Quadrilaterals");
+-			long i1,i2,i3,i4,iref;
+-			triangles =new Triangle[nbt];
+-			for (i=0;i<bamgmesh->QuadrilateralsSize[0];i++){
+-				//divide the quad into two triangles
+-				Triangle & t1 = triangles[2*i];
+-				Triangle & t2 = triangles[2*i+1];
+-				i1=(long)bamgmesh->Quadrilaterals[i*5+0]-1; //for C indexing
+-				i2=(long)bamgmesh->Quadrilaterals[i*5+1]-1; //for C indexing
+-				i3=(long)bamgmesh->Quadrilaterals[i*5+2]-1; //for C indexing
+-				i4=(long)bamgmesh->Quadrilaterals[i*5+3]-1; //for C indexing
+-				t1=Triangle(this,i1,i2,i3);
+-				t2=Triangle(this,i3,i4,i1);
+-				t1.color=(long)bamgmesh->Quadrilaterals[i*5+4];
+-				t2.color=(long)bamgmesh->Quadrilaterals[i*5+4];
+-				t1.SetHidden(OppositeEdge[1]); // two times  because the adj was not created 
+-				t2.SetHidden(OppositeEdge[1]); 
+-			}
+-		}
+-
+-		//VerticesOnGeomEdge
+-		if(bamgmesh->VerticesOnGeomEdge){
+-			if(verbose>5) _printLine_("      processing VerticesOnGeomEdge");
+-			NbVerticesOnGeomEdge=bamgmesh->VerticesOnGeomEdgeSize[0];
+-			VerticesOnGeomEdge= new  VertexOnGeom[NbVerticesOnGeomEdge] ;
+-			for (i=0;i<NbVerticesOnGeomEdge;i++){
+-				long  i1,i2;
+-				double s;
+-				i1=(long)  bamgmesh->VerticesOnGeomEdge[i*3+0]-1; //for C indexing
+-				i2=(long)  bamgmesh->VerticesOnGeomEdge[i*3+1]-1; //for C indexing
+-				s =(double)bamgmesh->VerticesOnGeomEdge[i*3+2];
+-				VerticesOnGeomEdge[i]=VertexOnGeom(vertices[i1],Gh.edges[i2],s);
+-			}
+-		}
+-
+-		//VerticesOnGeomVertex
+-		if(bamgmesh->VerticesOnGeomVertexSize[0]){
+-			if(verbose>5) _printLine_("      processing VerticesOnGeomVertex");
+-			NbVerticesOnGeomVertex=bamgmesh->VerticesOnGeomVertexSize[0];
+-			VerticesOnGeomVertex  = new  VertexOnGeom[NbVerticesOnGeomVertex] ;
+-			for (i=0;i<NbVerticesOnGeomVertex;i++){
+-				long  i1,i2;
+-				i1=(long)bamgmesh->VerticesOnGeomVertex[i*2+0]-1; //for C indexing
+-				i2=(long)bamgmesh->VerticesOnGeomVertex[i*2+1]-1; //for C indexing
+-				VerticesOnGeomVertex[i]=VertexOnGeom(vertices[i1],Gh.vertices[i2]);
+-			}
+-		}
+-
+-		//Edges
+-		if (bamgmesh->Edges){
+-			int i1,i2;
+-			double* len=NULL;
+-
+-			if(verbose>5) _printLine_("      processing Edges");
+-			nbe=bamgmesh->EdgesSize[0];
+-			edges= new Edge[nbe];
+-			//initialize length of each edge (used to provided metric)
+-			len= new double[nbv];
+-			for(i=0;i<nbv;i++) len[i]=0;
+-
+-			for (i=0;i<nbe;i++){
+-				i1=(int)bamgmesh->Edges[i*3+0]-1; //-1 for C indexing
+-				i2=(int)bamgmesh->Edges[i*3+1]-1; //-1 for C indexing
+-				edges[i].ReferenceNumber=(long)bamgmesh->Edges[i*3+2];
+-				edges[i].v[0]= vertices +i1;
+-				edges[i].v[1]= vertices +i2;
+-				edges[i].adj[0]=NULL;
+-				edges[i].adj[1]=NULL;
+-				R2 x12=vertices[i2].r-vertices[i1].r;
+-				double l12=sqrt((x12,x12));
+-
+-				//prepare metric
+-				vertices[i1].color++;
+-				vertices[i2].color++;
+-				len[i1]+=l12;
+-				len[i2]+=l12;
+-				Hmin = Min(Hmin,l12);
+-			}
+-
+-			// definition  the default of the given mesh size 
+-			for (i=0;i<nbv;i++){
+-				if (vertices[i].color>0) 
+-				 vertices[i].m=Metric(len[i]/(double)vertices[i].color);
+-				else 
+-				 vertices[i].m=Metric(Hmin);
+-			}
+-			delete [] len;
+-
+-			// construction of edges[].adj 
+-			for (i=0;i<nbv;i++){ 
+-				vertices[i].color=(vertices[i].color ==2) ?-1:-2;
+-			}
+-			for (i=0;i<nbe;i++){
+-				for (j=0;j<2;j++) { 
+-					BamgVertex *v=edges[i].v[j];
+-					long i0=v->color,j0;
+-					if(i0==-1){
+-						v->color=i*2+j;
+-					}
+-					else if (i0>=0) {// i and i0 edge are adjacent by the vertex v
+-						j0 = i0%2;
+-						i0 = i0/2;
+-						_assert_(v==edges[i0 ].v[j0]);
+-						edges[i ].adj[j ] =edges +i0;
+-						edges[i0].adj[j0] =edges +i ;
+-						v->color = -3;
+-					}
+-				}
+-			}
+-		}
+-
+-		//EdgeOnGeomEdge
+-		if(bamgmesh->EdgesOnGeomEdge){
+-			if(verbose>5) _printLine_("      processing EdgesOnGeomEdge");
+-			int i1,i2,i,j;
+-			i2=bamgmesh->EdgesOnGeomEdgeSize[0];
+-			for (i1=0;i1<i2;i1++) {
+-				i=(int)bamgmesh->EdgesOnGeomEdge[i1*2+0]-1; //C indexing
+-				j=(int)bamgmesh->EdgesOnGeomEdge[i1*2+1]-1; //C indexing
+-				//Check value
+-				if(!(i>=0 && j>=0 && i<nbe && j<Gh.nbe)) {
+-					_error2_("ReadMesh error: EdgesOnGeomEdge edge provided (line " << i1+1 << ": [" << i+1 << " " << j+1 << "]) is incorrect (must be positive, [0<i<nbe=" << nbe << " 0<j<Gh.nbe=" << Gh.nbe << "]");
+-				}
+-				edges[i].GeomEdgeHook=Gh.edges+j;
+-			}
+-		}
+-
+-		//SubDomain
+-		if(bamgmesh->SubDomains){
+-			long i3,head,direction;
+-			if(verbose>5) _printLine_("      processing SubDomains");
+-			nbsubdomains=bamgmesh->SubDomainsSize[0];
+-			subdomains = new SubDomain [ nbsubdomains ];
+-			for (i=0;i<nbsubdomains;i++) {
+-				i3  =(int)bamgmesh->SubDomains[i*3+0];
+-				head=(int)bamgmesh->SubDomains[i*3+1]-1;//C indexing
+-				direction=(int)bamgmesh->SubDomains[i*3+2];
+-				if (i3!=23) _error2_("Bad Subdomain definition: first number should be 3");
+-				if (head<0 || head>=nbt) _error2_("Bad Subdomain definition: head should in [1 " << nbt << "] (triangle number)");
+-				subdomains[i].head = triangles+head;
+-			}
+-		}
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::WriteMesh {{{*/
+-	void Mesh::WriteMesh(BamgMesh* bamgmesh,BamgOpts* bamgopts){
+-
+-		/*Intermediary*/
+-		int i,j,k,num,i1,i2;
+-		long n;
+-		int* head_1=NULL;
+-		int* next_1=NULL;
+-		int* connectivitysize_1=NULL;
+-		int  connectivitymax_1=0;
+-
+-		/*Get options*/
+-		int verbose=bamgopts->verbose;
+-
+-		/*Build reft that holds the number the subdomain number of each triangle, and the real numbering of the elements*/
+-		long* reft = new long[nbt];
+-		long* numt = new long[nbt];
+-		long nbInT = TriangleReferenceList(reft);
+-		TriangleIntNumbering(numt);
+-
+-		/*Chaining algorithm used to generate connectivity tables and other outputs*/
+-
+-		//Memory Allocation
+-		head_1=xNew<int>(nbv);
+-		next_1=xNew<int>(3*nbt);
+-		connectivitysize_1=xNew<int>(nbv);
+-
+-		//Initialization
+-		for (i=0;i<nbv;i++) head_1[i]=-1;
+-		for (i=0;i<nbv;i++) connectivitysize_1[i]=0;
+-		k=0;
+-		//Chains generation
+-		for (i=0;i<nbt;i++) {
+-			//Do not take into account outside triangles (reft<0)
+-			if (reft[i]>=0){
+-				for (j=0;j<3;j++){
+-					int v=GetId(triangles[i][j]); //jth vertex of the ith triangle
+-					if (k>3*nbt-1 || k<0) _error2_("k = " << k << ", nbt = " << nbt);
+-					next_1[k]=head_1[v];
+-					if (v>nbv-1 || v<0)   _error2_("v = " << v << ", nbv = " << nbv);
+-					head_1[v]=k++;
+-					connectivitysize_1[v]+=1;
+-				}
+-			}
+-		}
+-		//Get maximum connectivity
+-		connectivitymax_1=0;
+-		for (i=0;i<nbv;i++){
+-			if (connectivitysize_1[i]>connectivitymax_1) connectivitymax_1=connectivitysize_1[i];
+-		}
+-
+-		/*OK, now build outputs*/
+-
+-		/*Vertices*/
+-		if(verbose>5) _printLine_("      writing Vertices");
+-		bamgmesh->VerticesSize[0]=nbv;
+-		bamgmesh->VerticesSize[1]=3;
+-		if (nbv){
+-			bamgmesh->Vertices=xNew<double>(3*nbv);
+-			for (i=0;i<nbv;i++){
+-				bamgmesh->Vertices[i*3+0]=vertices[i].r.x;
+-				bamgmesh->Vertices[i*3+1]=vertices[i].r.y;
+-				bamgmesh->Vertices[i*3+2]=vertices[i].GetReferenceNumber();
+-			}
+-		}
+-
+-		/*Edges*/
+-		if(verbose>5) _printLine_("      writing Edges");
+-		bamgmesh->EdgesSize[0]=nbe;
+-		bamgmesh->EdgesSize[1]=3;
+-		int NumIssmSegments=0;
+-		if (nbe){
+-			bamgmesh->Edges=xNew<double>(3*nbe);
+-			for (i=0;i<nbe;i++){
+-				bamgmesh->Edges[i*3+0]=GetId(edges[i][0])+1; //back to M indexing
+-				bamgmesh->Edges[i*3+1]=GetId(edges[i][1])+1; //back to M indexing
+-				bamgmesh->Edges[i*3+2]=edges[i].ReferenceNumber;
+-				if(edges[i].GeomEdgeHook){
+-					NumIssmSegments++;
+-				}
+-			}
+-		}
+-
+-		/*Element edges*/
+-		if(verbose>5) _printLine_("      writing element edges");
+-		SetOfEdges4* edge4=new SetOfEdges4(nbt*3,nbv);
+-		double* elemedge=NULL;
+-		elemedge=xNew<double>(3*nbt);
+-		for (i=0;i<3*nbt;i++) elemedge[i]=-2.;//will become -1
+-		k=0;
+-		for (i=0;i<nbt;i++){
+-			//Do not take into account outside triangles (reft<0)
+-			if (reft[i]>=0){
+-				for  (j=0;j<3;j++) {
+-					i1=GetId(triangles[i][VerticesOfTriangularEdge[j][0]]);
+-					i2=GetId(triangles[i][VerticesOfTriangularEdge[j][1]]);
+-					n =edge4->SortAndFind(i1,i2);
+-					if (n==-1){
+-						//first time
+-						n=edge4->SortAndAdd(i1,i2);
+-						elemedge[n*2+0]=double(k);
+-					}
+-					else{
+-						//second time
+-						elemedge[n*2+1]=double(k);
+-					}
+-				}
+-				k++;
+-			}
+-		}
+-		bamgmesh->IssmEdgesSize[0]=edge4->nb();
+-		bamgmesh->IssmEdgesSize[1]=4;
+-		bamgmesh->IssmEdges=xNew<double>(4*edge4->nb());
+-		for (i=0;i<edge4->nb();i++){
+-			/*Invert first two vertices if necessary*/
+-			bool found=false;
+-			for (j=0;j<3;j++){
+-				if (triangles[(int)elemedge[2*i+0]](j)==vertices+edge4->i(i)){
+-					if (triangles[(int)elemedge[2*i+0]]((j+1)%3)==vertices+edge4->j(i)){
+-						//trigonometric direction
+-						bamgmesh->IssmEdges[i*4+0]=edge4->i(i)+1;// back to M indexing
+-						bamgmesh->IssmEdges[i*4+1]=edge4->j(i)+1;// back to M indexing
+-					}
+-					else{
+-						bamgmesh->IssmEdges[i*4+0]=edge4->j(i)+1;// back to M indexing
+-						bamgmesh->IssmEdges[i*4+1]=edge4->i(i)+1;// back to M indexing
+-					}
+-					found=true;
+-					break;
+-				}
+-			}
+-			_assert_(found);
+-			bamgmesh->IssmEdges[i*4+2]=elemedge[2*i+0]+1; // back to M indexing
+-			bamgmesh->IssmEdges[i*4+3]=elemedge[2*i+1]+1; // back to M indexing
+-		}
+-		//clean up
+-		delete edge4;
+-		xDelete<double>(elemedge);
+-
+-		/*IssmSegments*/
+-		if(verbose>5) _printLine_("      writing IssmSegments");
+-		bamgmesh->IssmSegmentsSize[0]=NumIssmSegments;
+-		bamgmesh->IssmSegmentsSize[1]=4;
+-		bamgmesh->IssmSegments=xNew<double>(4*NumIssmSegments);
+-		num=0;
+-		for (i=0;i<nbe;i++){
+-			if(edges[i].GeomEdgeHook){
+-				//build segment
+-				int i1=GetId(edges[i][0]);
+-				int i2=GetId(edges[i][1]);
+-				bool stop=false;
+-				for(j=head_1[i1];j!=-1;j=next_1[j]){
+-					for(k=0;k<3;k++){
+-						if (GetId(triangles[(int)j/3][k])==i1){
+-							if (GetId(triangles[(int)j/3][(int)((k+1)%3)])==i2){
+-								bamgmesh->IssmSegments[num*4+0]=GetId(edges[i][0])+1; //back to M indexing
+-								bamgmesh->IssmSegments[num*4+1]=GetId(edges[i][1])+1; //back to M indexing
+-								bamgmesh->IssmSegments[num*4+2]=(int)j/3+1;            //back to M indexing
+-								bamgmesh->IssmSegments[num*4+3]=edges[i].ReferenceNumber;
+-								num+=1;
+-								stop=true;
+-								break;
+-							}
+-							if (GetId(triangles[(int)j/3][(int)((k+2)%3)])==i2){
+-								bamgmesh->IssmSegments[num*4+0]=GetId(edges[i][1])+1; //back to M indexing
+-								bamgmesh->IssmSegments[num*4+1]=GetId(edges[i][0])+1; //back to M indexing
+-								bamgmesh->IssmSegments[num*4+2]=(int)j/3+1;            //back to M indexing
+-								bamgmesh->IssmSegments[num*4+3]=edges[i].ReferenceNumber;
+-								num+=1;
+-								stop=true;
+-								break;
+-							}
+-						}
+-					}
+-					if(stop) break;
+-				}
+-				if (!stop){
+-					_error2_("Element holding segment [" << i1+1 << " " << i2+1 << "] not found...");
+-				}
+-			}
+-		}
+-
+-		/*Triangles*/
+-		if(verbose>5) _printLine_("      writing Triangles");
+-		k=nbInT-nbq*2;
+-		num=0;
+-		bamgmesh->TrianglesSize[0]=k;
+-		bamgmesh->TrianglesSize[1]=4;
+-		if (k){
+-			bamgmesh->Triangles=xNew<double>(4*k);
+-			for (i=0;i<nbt;i++){
+-				Triangle &t=triangles[i];
+-				//reft[i]=-1 for outside triangle
+-				if (reft[i]>=0 && !( t.Hidden(0) || t.Hidden(1) || t.Hidden(2) )){
+-					bamgmesh->Triangles[num*4+0]=GetId(t[0])+1; //back to M indexing
+-					bamgmesh->Triangles[num*4+1]=GetId(t[1])+1; //back to M indexing
+-					bamgmesh->Triangles[num*4+2]=GetId(t[2])+1; //back to M indexing
+-					bamgmesh->Triangles[num*4+3]=subdomains[reft[i]].ReferenceNumber;
+-					num=num+1;
+-				}
+-			}
+-		}
+-
+-		/*Quadrilaterals*/
+-		if(verbose>5) _printLine_("      writing Quadrilaterals");
+-		bamgmesh->QuadrilateralsSize[0]=nbq;
+-		bamgmesh->QuadrilateralsSize[1]=5;
+-		if (nbq){
+-			bamgmesh->Quadrilaterals=xNew<double>(5*nbq);
+-			for (i=0;i<nbt;i++){
+-				Triangle &t =triangles[i];
+-				Triangle* ta;
+-				BamgVertex *v0,*v1,*v2,*v3;
+-				if (reft[i]<0) continue;
+-				if ((ta=t.Quadrangle(v0,v1,v2,v3)) !=0 && &t<ta) { 
+-					bamgmesh->Quadrilaterals[i*5+0]=GetId(v0)+1; //back to M indexing
+-					bamgmesh->Quadrilaterals[i*5+1]=GetId(v1)+1; //back to M indexing
+-					bamgmesh->Quadrilaterals[i*5+2]=GetId(v2)+1; //back to M indexing
+-					bamgmesh->Quadrilaterals[i*5+3]=GetId(v3)+1; //back to M indexing
+-					bamgmesh->Quadrilaterals[i*5+4]=subdomains[reft[i]].ReferenceNumber;
+-				}
+-			}
+-		}
+-
+-		/*SubDomains*/
+-		if(verbose>5) _printLine_("      writing SubDomains");
+-		bamgmesh->SubDomainsSize[0]=nbsubdomains;
+-		bamgmesh->SubDomainsSize[1]=4;
+-		if (nbsubdomains){
+-			bamgmesh->SubDomains=xNew<double>(4*nbsubdomains);
+-			for (i=0;i<nbsubdomains;i++){
+-				bamgmesh->SubDomains[i*4+0]=3;
+-				bamgmesh->SubDomains[i*4+1]=reft[GetId(subdomains[i].head)];
+-				bamgmesh->SubDomains[i*4+2]=1;
+-				bamgmesh->SubDomains[i*4+3]=subdomains[i].ReferenceNumber;
+-			}
+-		}
+-
+-		/*SubDomainsFromGeom*/
+-		if(verbose>5) _printLine_("      writing SubDomainsFromGeom");
+-		bamgmesh->SubDomainsFromGeomSize[0]=Gh.nbsubdomains;
+-		bamgmesh->SubDomainsFromGeomSize[1]=4;
+-		if (Gh.nbsubdomains){
+-			bamgmesh->SubDomainsFromGeom=xNew<double>(4*Gh.nbsubdomains);
+-			for (i=0;i<Gh.nbsubdomains;i++){
+-				bamgmesh->SubDomainsFromGeom[i*4+0]=2;
+-				bamgmesh->SubDomainsFromGeom[i*4+1]=GetId(subdomains[i].edge)+1; //back to Matlab indexing
+-				bamgmesh->SubDomainsFromGeom[i*4+2]=subdomains[i].direction;
+-				bamgmesh->SubDomainsFromGeom[i*4+3]=Gh.subdomains[i].ReferenceNumber;
+-			}
+-		}
+-
+-		/*VerticesOnGeomVertex*/
+-		if(verbose>5) _printLine_("      writing VerticesOnGeomVertex");
+-		bamgmesh->VerticesOnGeomVertexSize[0]=NbVerticesOnGeomVertex;
+-		bamgmesh->VerticesOnGeomVertexSize[1]=2;
+-		if (NbVerticesOnGeomVertex){
+-			bamgmesh->VerticesOnGeomVertex=xNew<double>(2*NbVerticesOnGeomVertex);
+-			for (i=0;i<NbVerticesOnGeomVertex;i++){
+-				VertexOnGeom &v=VerticesOnGeomVertex[i];
+-				_assert_(v.OnGeomVertex());
+-				bamgmesh->VerticesOnGeomVertex[i*2+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing
+-				bamgmesh->VerticesOnGeomVertex[i*2+1]=Gh.GetId((GeomVertex*)v)+1; //back to Matlab indexing
+-			}
+-		}
+-
+-		/*VertexOnGeomEdge*/
+-		if(verbose>5) _printLine_("      writing VerticesOnGeomEdge");
+-		bamgmesh->VerticesOnGeomEdgeSize[0]=NbVerticesOnGeomEdge;
+-		bamgmesh->VerticesOnGeomEdgeSize[1]=3;
+-		if (NbVerticesOnGeomEdge){
+-			bamgmesh->VerticesOnGeomEdge=xNew<double>(3*NbVerticesOnGeomEdge);
+-			for (i=0;i<NbVerticesOnGeomEdge;i++){
+-				const VertexOnGeom &v=VerticesOnGeomEdge[i];
+-				if (!v.OnGeomEdge()){
+-					_error2_("A vertices supposed to be OnGeomEdge is actually not");
+-				}
+-				bamgmesh->VerticesOnGeomEdge[i*3+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing
+-				bamgmesh->VerticesOnGeomEdge[i*3+1]=Gh.GetId((const GeomEdge*)v)+1; //back to Matlab indexing
+-				bamgmesh->VerticesOnGeomEdge[i*3+2]=(double)v; //absisce
+-			}
+-		}
+-
+-		/*EdgesOnGeomEdge*/
+-		if(verbose>5) _printLine_("      writing EdgesOnGeomEdge");
+-		k=0;
+-		for (i=0;i<nbe;i++){
+-			if (edges[i].GeomEdgeHook) k=k+1;
+-		}
+-		bamgmesh->EdgesOnGeomEdgeSize[0]=k;
+-		bamgmesh->EdgesOnGeomEdgeSize[1]=2;
+-		if (k){
+-			bamgmesh->EdgesOnGeomEdge=xNew<double>(2*(int)k);
+-			int count=0;
+-			for (i=0;i<nbe;i++){
+-				if (edges[i].GeomEdgeHook){
+-					bamgmesh->EdgesOnGeomEdge[count*2+0]=(double)i+1; //back to Matlab indexing
+-					bamgmesh->EdgesOnGeomEdge[count*2+1]=(double)Gh.GetId(edges[i].GeomEdgeHook)+1; //back to Matlab indexing
+-					count=count+1;
+-				}
+-			}
+-		}
+-
+-		/*Element Connectivity*/
+-		if(verbose>5) _printLine_("      writing Element connectivity");
+-		bamgmesh->ElementConnectivitySize[0]=nbt-nbtout;
+-		bamgmesh->ElementConnectivitySize[1]=3;
+-		bamgmesh->ElementConnectivity=xNew<double>(3*(nbt-nbtout));
+-		for (i=0;i<3*(nbt-nbtout);i++) bamgmesh->ElementConnectivity[i]=NAN;
+-		num=0;
+-		for (i=0;i<nbt;i++){
+-			if (reft[i]>=0){
+-				for (j=0;j<3;j++){
+-					k=GetId(triangles[i].TriangleAdj(j));
+-					if (reft[k]>=0){
+-						_assert_(3*num+j<3*(nbt-nbtout));
+-						bamgmesh->ElementConnectivity[3*num+j]=k+1; // back to Matlab indexing
+-					}
+-				}
+-				num+=1;
+-			}
+-		}
+-
+-		/*ElementNodal Connectivity*/
+-		if(verbose>5) _printLine_("      writing Nodal element connectivity");
+-		bamgmesh->NodalElementConnectivitySize[0]=nbv;
+-		bamgmesh->NodalElementConnectivitySize[1]=connectivitymax_1;
+-		bamgmesh->NodalElementConnectivity=xNew<double>(connectivitymax_1*nbv);
+-		for (i=0;i<connectivitymax_1*nbv;i++) bamgmesh->NodalElementConnectivity[i]=NAN;
+-		for (i=0;i<nbv;i++){
+-			k=0;
+-			for(j=head_1[i];j!=-1;j=next_1[j]){
+-				_assert_(connectivitymax_1*i+k < connectivitymax_1*nbv);
+-				bamgmesh->NodalElementConnectivity[connectivitymax_1*i+k]=floor((double)j/3)+1;
+-				k++;
+-			}
+-		}
+-
+-		/*Nodal Connectivity*/
+-		if(verbose>5) _printLine_("      writing Nodal connectivity");
+-		//chaining algorithm (again...)
+-		int* head_2=NULL;
+-		int* next_2=NULL;
+-		int* connectivitysize_2=NULL;
+-		int  connectivitymax_2=0;
+-		i1=bamgmesh->IssmEdgesSize[0];
+-		i2=bamgmesh->IssmEdgesSize[1];
+-		head_2=xNew<int>(nbv);
+-		next_2=xNew<int>(2*i1);
+-		connectivitysize_2=xNew<int>(nbv);
+-		//Initialization
+-		for (i=0;i<nbv;i++) head_2[i]=-1;
+-		for (i=0;i<nbv;i++) connectivitysize_2[i]=0;
+-		k=0;
+-		//Chains generation
+-		for (i=0;i<i1;i++) {
+-			for (j=0;j<2;j++){
+-				int v=(int)bamgmesh->IssmEdges[i*i2+j]-1; //back to C indexing
+-				if (k>2*i1-1 || k<0) _error2_("Index exceed matrix dimensions (k=" << k << " not in [0 " << 2*i1-1 << "]");
+-				next_2[k]=head_2[v];
+-				if (v>nbv-1 || v<0)   _error2_("Index exceed matrix dimensions (v=" << v << " not in [0 " << nbv-1 << "])");
+-				head_2[v]=k++;
+-				connectivitysize_2[v]+=1;
+-			}
+-		}
+-		//Get maximum connectivity
+-		for (i=0;i<nbv;i++){
+-			if (connectivitysize_2[i]>connectivitymax_2) connectivitymax_2=connectivitysize_2[i];
+-		}
+-		//Build output
+-		bamgmesh->NodalConnectivitySize[0]=nbv;
+-		bamgmesh->NodalConnectivitySize[1]=connectivitymax_2;
+-		bamgmesh->NodalConnectivity=xNew<double>(connectivitymax_2*nbv);
+-		for (i=0;i<connectivitymax_2*nbv;i++) bamgmesh->NodalConnectivity[i]=NAN;
+-		for (i=0;i<nbv;i++){
+-			k=0;
+-			for(j=head_2[i];j!=-1;j=next_2[j]){
+-				_assert_(connectivitymax_2*i+k < connectivitymax_2*nbv);
+-				num=(int)bamgmesh->IssmEdges[int(j/2)*i2+0];
+-				if (i+1==num){ //carefull, ElementEdge is in M indexing
+-					//i is the first vertex of the edge, it is therefore connected to the second vertex
+-					bamgmesh->NodalConnectivity[connectivitymax_2*i+k]=bamgmesh->IssmEdges[int(j/2)*i2+1];
+-				}
+-				else{
+-					bamgmesh->NodalConnectivity[connectivitymax_2*i+k]=num;
+-				}
+-				k++;
+-			}
+-		}
+-
+-		/*Cracked vertices*/
+-		if(verbose>5) _printLine_("      writing Cracked vertices");
+-		bamgmesh->CrackedVerticesSize[0]=NbCrackedVertices;
+-		bamgmesh->CrackedVerticesSize[1]=2;
+-		if (NbCrackedVertices){
+-			bamgmesh->CrackedVertices=xNew<double>(2*NbCrackedVertices);
+-			for (i=0;i<NbCrackedVertices;i++){
+-				bamgmesh->CrackedVertices[i*2+0]=CrackedVertices[i*2+0]+1; //M indexing
+-				bamgmesh->CrackedVertices[i*2+1]=CrackedVertices[i*2+1]+1; //M indexing
+-			}
+-		}
+-
+-		/*Cracked vertices*/
+-		if(verbose>5) _printLine_("      writing Cracked vertices");
+-		bamgmesh->CrackedEdgesSize[0]=NbCrackedEdges;
+-		bamgmesh->CrackedEdgesSize[1]=4;
+-		if (NbCrackedEdges){
+-			bamgmesh->CrackedEdges=xNew<double>(2*NbCrackedEdges);
+-			for (i=0;i<NbCrackedEdges;i++){
+-				bamgmesh->CrackedEdges[i*2+0]=0;//CrackedEdges[i]->+1; //M indexing
+-				bamgmesh->CrackedEdges[i*2+1]=0;//CrackedEdges[i]-]->+1; //M indexing
+-			}
+-		}
+-
+-		//clean up
+-		xDelete<int>(connectivitysize_1);
+-		xDelete<int>(head_1);
+-		xDelete<int>(next_1);
+-		xDelete<int>(connectivitysize_2);
+-		xDelete<int>(head_2);
+-		xDelete<int>(next_2);
+-		delete [] reft;
+-		delete [] numt;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::ReadMetric{{{*/
+-	void Mesh::ReadMetric(const BamgOpts* bamgopts) {
+-
+-		/*Intermediary*/
+-		int  i,j;
+-
+-		if(bamgopts->verbose>3) _printLine_("      processing metric");
+-		double hmin = Max(bamgopts->hmin,MinimalHmin());
+-		double hmax = Min(bamgopts->hmax,MaximalHmax());
+-		double coef = bamgopts->coeff;
+-
+-		//for now we only use j==3
+-		j=3;
+-
+-		for (i=0;i<nbv;i++){
+-			double h;
+-			if (j == 1){
+-				h=bamgopts->metric[i];
+-				vertices[i].m=Metric(Max(hmin,Min(hmax, h*coef)));
+-			}
+-			else if (j==3){
+-				//do not erase metric computed by hVertices
+-				if (vertices[i].m.a11==1 && vertices[i].m.a21==0 && vertices[i].m.a22==1){
+-					double a,b,c;	     
+-					a=bamgopts->metric[i*3+0];
+-					b=bamgopts->metric[i*3+1];
+-					c=bamgopts->metric[i*3+2];
+-					Metric M(a,b,c);
+-					EigenMetric Vp(M/coef);
+-
+-					Vp.Maxh(hmax);
+-					Vp.Minh(hmin);
+-					vertices[i].m = Vp;
+-				}
+-			}
+-		}
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::WriteMetric{{{*/
+-	void Mesh::WriteMetric(BamgOpts* bamgopts) {
+-		int i;
+-		xDelete<double>(bamgopts->metric);
+-		bamgopts->metric=xNew<double>(3*nbv);
+-		for (i=0;i<nbv;i++){
+-			bamgopts->metric[i*3+0]=vertices[i].m.a11;
+-			bamgopts->metric[i*3+1]=vertices[i].m.a21;
+-			bamgopts->metric[i*3+2]=vertices[i].m.a22;
+-		}
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::WriteIndex{{{*/
+-	void Mesh::WriteIndex(int** pindex,int* pnels){
+-
+-		/*Intermediary*/
+-		int i,k,num;
+-		int verbose=0;
+-
+-		/*output*/
+-		int* index=NULL;
+-
+-		/*Get number of triangles*/
+-		k=0;
+-		for (i=0;i<nbt;i++){
+-			Triangle &t=triangles[i];
+-			if(t.det>0) k++;
+-		}
+-
+-		if (k){
+-			index=xNew<int>(3*k);
+-			num=0;
+-			for (i=0;i<nbt;i++){
+-				Triangle &t=triangles[i];
+-				if (t.det>0 && !(t.Hidden(0)||t.Hidden(1) || t.Hidden(2) )){
+-					//if(t.Anisotropy()<2 & t.Length()<1.e+5){
+-						index[num*3+0]=GetId(t[0])+1; //back to M indexing
+-						index[num*3+1]=GetId(t[1])+1; //back to M indexing
+-						index[num*3+2]=GetId(t[2])+1; //back to M indexing
+-						num=num+1;
+-					//}
+-				}
+-			}
+-		}
+-
+-		/*Assign output pointers*/
+-		*pindex=index;
+-		*pnels=num;
+-	}
+-	/*}}}*/
+-
+-	/*Methods*/
+-	/*FUNCTION Mesh::AddGeometryMetric{{{*/
+-	void Mesh::AddGeometryMetric(BamgOpts* bamgopts){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/IntersectGeomMetric)*/
+-
+-		/*Get options*/
+-		int    verbose=bamgopts->verbose;
+-		double anisomax =bamgopts->anisomax;
+-		double errg     =bamgopts->errg;
+-
+-		double ss[2]={0.00001,0.99999};
+-		double errC = 2*sqrt(2*errg);
+-		double hmax = Gh.MaximalHmax();
+-		double hmin = Gh.MinimalHmin();
+-
+-		//check that hmax is positive
+-		if (hmax<=0){
+-			_error2_("hmax<=0");
+-		}
+-
+-		//errC cannot be higher than 1
+-		if (errC>1) errC=1;
+-
+-		//Set all vertices to "on"
+-		SetVertexFieldOn();
+-
+-		//loop over all the vertices on edges
+-		for (int  i=0;i<nbe;i++){
+-			for (int j=0;j<2;j++){
+-
+-				BamgVertex V;
+-				VertexOnGeom GV;
+-				Gh.ProjectOnCurve(edges[i],ss[j],V,GV);
+-
+-				GeomEdge* eg = GV;
+-				double s = GV;
+-				R2 tg;
+-				double  R1= eg->R1tg(s,tg);
+-				double  ht=hmax;
+-				// err relative to the length of the edge
+-				if (R1>1.0e-20) {  
+-					ht = Min(Max(errC/R1,hmin),hmax);
+-				}
+-				double hn=Min(hmax,ht*anisomax);
+-
+-				if (ht<=0 || hn<=0){
+-					_error2_("ht<=0 || hn<=0");
+-				}
+-				EigenMetric Vp(1/(ht*ht),1/(hn*hn),tg);
+-				Metric MVp(Vp);
+-				edges[i][j].m.IntersectWith(MVp);
+-			}
+-		}
+-		// the problem is for the vertex on vertex 
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::AddMetric{{{*/
+-	void Mesh::AddMetric(BamgOpts* bamgopts){
+-		//  Hessiantype = 0 =>  H is computed using double P2 projection
+-		//  Hessiantype = 1 =>  H is computed with green formula
+-
+-		/*Options*/
+-		int Hessiantype=bamgopts->Hessiantype;
+-
+-		if (Hessiantype==0){
+-			BuildMetric0(bamgopts);
+-		}
+-		else if (Hessiantype==1){
+-			BuildMetric1(bamgopts);
+-		}
+-		else{
+-			_error2_("Hessiantype " << Hessiantype << " not supported yet (1->use Green formula, 0-> double P2 projection)");
+-		}
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::AddVertex{{{*/
+-	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
+-		//                               !
+-		//             /|\               !
+-		//            / | \              !
+-		//           /  |  \             !
+-		//    tt1   /   |   \ tt0        !
+-		//         /    |s   \           !
+-		//        /     .     \          !
+-		//       /  .      `   \         !
+-		//      / .           ` \        !
+-		//      ----------------         !
+-		//   s0       tt2       s1
+-		//-------------------------------
+-
+-		/*Intermediaries*/
+-		Triangle* tt[3];       //the three triangles
+-		Icoor2 det3local[3];   //three determinants (integer)
+-		int nbzerodet =0;      //number of zeros in det3
+-		int izerodet=-1;       //egde containing the vertex s
+-		int iedge; 
+-
+-		/*three vertices of t*/
+-		BamgVertex &s0=(*t)[0];
+-		BamgVertex &s1=(*t)[1];
+-		BamgVertex &s2=(*t)[2];
+-
+-		//determinant of t
+-		Icoor2 detOld=t->det;
+-
+-		/* infvertexindex = index of the infinite vertex (NULL)
+-			if no infinite vertex (NULL) infvertexindex=-1
+-			else if v_i is infinite, infvertexindex=i*/
+-		int infvertexindex = &s0 ?  ((  &s1 ? ( &s2  ? -1 : 2) : 1  )) : 0;
+-
+-		//some checks
+-		if (( infvertexindex <0 ) && (detOld <0) ||  ( infvertexindex >=0  ) && (detOld >0) ){
+-			_error2_("inconsistent configuration (Contact ISSM developers)");
+-		}
+-
+-		// if det3 does not exist, build it 
+-		if (!det3){ 
+-			//allocate
+-			det3 = det3local;
+-			//if no infinite vertex
+-			if (infvertexindex<0 ) {
+-				det3[0]=bamg::det(s ,s1,s2);
+-				det3[1]=bamg::det(s0,s ,s2);
+-				det3[2]=bamg::det(s0,s1,s );}
+-			else { 
+-				// one of &s1  &s2  &s0 is NULL
+-				det3[0]= &s0 ? -1 : bamg::det(s ,s1,s2) ;
+-				det3[1]= &s1 ? -1 : bamg::det(s0,s ,s2) ;
+-				det3[2]= &s2 ? -1 : bamg::det(s0,s1,s ) ;
+-			}
+-		}
+-
+-		if (!det3[0]) izerodet=0,nbzerodet++;
+-		if (!det3[1]) izerodet=1,nbzerodet++;
+-		if (!det3[2]) izerodet=2,nbzerodet++;
+-
+-		//if nbzerodet>0, point s is on an egde or on a vertex 
+-		if  (nbzerodet>0){ 
+-			/*s is on an edge*/
+-			if (nbzerodet==1) {
+-				iedge = OppositeEdge[izerodet];
+-				AdjacentTriangle ta = t->Adj(iedge);
+-
+-				/*if the point is one the boundary 
+-				  add the point in outside part */
+-				if (t->det>=0){ // inside triangle
+-					if (((Triangle*)ta)->det<0 ) {
+-						// add in outside triangle 
+-						AddVertex(s,( Triangle *)ta);
+-						return;
+-					}
+-				}
+-			}
+-			else{
+-				_error2_("Cannot add a vertex more than once. Check duplicates");
+-			}
+-		}
+-
+-		// remove de MarkUnSwap edge
+-		t->SetUnMarkUnSwap(0);
+-		t->SetUnMarkUnSwap(1);
+-		t->SetUnMarkUnSwap(2);
+-
+-		tt[0]= t;
+-		tt[1]= &triangles[nbt++];
+-		tt[2]= &triangles[nbt++];
+-
+-		if (nbt>maxnbt) _error2_("Not enough triangles");
+-
+-		*tt[1]=*tt[2]=*t;
+-		tt[0]->link=tt[1];
+-		tt[1]->link=tt[2]; 
+-
+-		(*tt[0])(OppositeVertex[0])=&s;
+-		(*tt[1])(OppositeVertex[1])=&s;
+-		(*tt[2])(OppositeVertex[2])=&s;
+-
+-		tt[0]->det=det3[0];
+-		tt[1]->det=det3[1];
+-		tt[2]->det=det3[2];         
+-
+-		//  update adj des triangles externe 
+-		tt[0]->SetAdjAdj(0);
+-		tt[1]->SetAdjAdj(1);
+-		tt[2]->SetAdjAdj(2);
+-		//  update des adj des 3 triangle interne
+-		const int i0 = 0;
+-		const int i1= NextEdge[i0];
+-		const int i2 = PreviousEdge[i0];
+-
+-		tt[i0]->SetAdj2(i2,tt[i2],i0);
+-		tt[i1]->SetAdj2(i0,tt[i0],i1);
+-		tt[i2]->SetAdj2(i1,tt[i1],i2);
+-
+-		tt[0]->SetSingleVertexToTriangleConnectivity();
+-		tt[1]->SetSingleVertexToTriangleConnectivity();
+-		tt[2]->SetSingleVertexToTriangleConnectivity();
+-
+-
+-		// swap if the point s is on a edge
+-		if(izerodet>=0) {
+-			int rswap=tt[izerodet]->swap(iedge);
+-
+-			if (!rswap) {
+-				_error2_("swap the point s is on a edge");
+-			}
+-		}
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::BoundAnisotropy{{{*/
+-	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;
+-		double lminaniso = 1/ (Max(hminaniso*hminaniso,1e-100));
+-
+-		//display info
+-		if (verbose > 1)  _printLine_("   BoundAnisotropy by " << anisomax);
+-
+-		double h1=1.e30,h2=1e-30;
+-		double coef = 1./(anisomax*anisomax);
+-		double hn1=1.e30,hn2=1e-30,rnx =1.e-30,rx=0;  
+-
+-		//loop over all vertices
+-		for (int i=0;i<nbv;i++){
+-			EigenMetric Vp(vertices[i]);
+-			double lmax=Vp.lmax();
+-			Vp*=Min(lminaniso,lmax)/lmax;
+-			Vp.BoundAniso2(coef);
+-			vertices[i].m = Vp;
+-
+-			//info to be displayed
+-			if (verbose>2){
+-				h1 =Min(h1,Vp.lmin());
+-				h2 =Max(h2,Vp.lmax());
+-				hn1=Min(hn1,Vp.lmin());
+-				hn2=Max(hn2,Vp.lmax());
+-				rx =Max(rx,Vp.Aniso2());
+-				rnx= Max(rnx,Vp.Aniso2());
+-			}
+-		}
+-
+-		//display info
+-		if (verbose>2){
+-			_printLine_("      input:  Hmin = " << pow(h2,-0.5)  << ", Hmax = " << pow(h1,-0.5) << ", factor of anisotropy max  = " << pow(rx,0.5));
+-			_printLine_("      output: Hmin = " << pow(hn2,-0.5) << ", Hmax = " << pow(hn1,-0.5)<< ", factor of anisotropy max  = " <<pow(rnx,0.5));
+-		}
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::BuildGeometryFromMesh{{{*/
+-	void Mesh::BuildGeometryFromMesh(BamgOpts* bamgopts){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/ConsGeometry)*/
+-
+-		/*Reconstruct Geometry from Mesh*/
+-
+-		/*Intermediary*/
+-		int i,j,k,kk,it,jt;
+-		int    verbose=0;
+-		double cutoffradian=10*Pi/180;
+-
+-		/*Recover options*/
+-		if (bamgopts){
+-			verbose=bamgopts->verbose;
+-			cutoffradian=bamgopts->MaxCornerAngle*Pi/180;
+-		}
+-
+-		//display info
+-		if (verbose>1) _printLine_("   construction of the geometry from the 2d mesh");
+-
+-		//check that the mesh is not empty
+-		if (nbt<=0 || nbv <=0 ) {
+-			_error2_("nbt or nbv is negative (Mesh empty?)");
+-		}
+-
+-		//Gh is the geometry of the mesh (this), initialize MaxCornerAngle
+-		if (cutoffradian>=0) Gh.MaxCornerAngle = cutoffradian;
+-
+-		/*Construction of the edges*/
+-
+-		//initialize st and edge4
+-		SetOfEdges4* edge4= new SetOfEdges4(nbt*3,nbv);
+-		long*        st   = new long[nbt*3];
+-
+-		//initialize st as -1 (chaining algorithm)
+-		for (i=0;i<nbt*3;i++) st[i]=-1;
+-
+-		//build edge4 (chain)
+-		for (i=0;i<nbe;i++){
+-			edge4->SortAndAdd(GetId(edges[i][0]),GetId(edges[i][1]));
+-		}
+-		//check that there is no double edge
+-		if (nbe !=  edge4->nb()){ 
+-			delete [] st;
+-			_error2_("Some Double edge in the mesh, the number is " << nbe << ", nbe4=" << edge4->nb()); 
+-		}
+-		//keep nbe in nbeold
+-		long nbeold = nbe;
+-
+-		//Go through the triangles and ass the edges in edge4 if they are not there yet
+-		for (i=0;i<nbt;i++){
+-			//3 edges per triangle
+-			for  (j=0;j<3;j++) {
+-				//Add Edge to edge4 (k=numberofedges in edge4)
+-				long k =edge4->SortAndAdd(GetId(triangles[i][VerticesOfTriangularEdge[j][0]]), GetId(triangles[i][VerticesOfTriangularEdge[j][1]]));
+-				long invisible = triangles[i].Hidden(j);
+-
+-				//if st[k] has not been changed yet, add 3*i+j (= vertex position in the index)
+-				if(st[k]==-1) st[k]=3*i+j;
+-
+-				//else st[k]>=0 -> the edge already exist, check
+-				else if(st[k]>=0) {
+-					//check that it is not an edge on boundary (should not already exist)
+-					if (triangles[i].TriangleAdj(j) || triangles[st[k]/3].TriangleAdj((int) (st[k]%3))){
+-						_error2_("problem in Geometry reconstruction: an edge on boundary is duplicated (double element?)");
+-					}
+-					//OK, the element is not on boundary, is belongs to 2 triangles -> build Adjacent triangles list
+-					triangles[i].SetAdj2(j,triangles + st[k] / 3,(int) (st[k]%3));
+-					if (invisible)  triangles[i].SetHidden(j);
+-					// if k < nbe mark the edge as on Boundary (Locked)
+-					if (k<nbe) {
+-						triangles[i].SetLocked(j);
+-					}
+-					//set st[k] as negative so that the edge should not be called again
+-					st[k]=-2-st[k]; 
+-				}
+-				//else (see 3 lines above), the edge has been called more than twice: return error
+-				else {
+-					_printLine_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << "," << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles (" << k << ")");
+-					_printLine_("Edge " << j << " of triangle " << i);
+-					_printLine_("Edge " << (-st[k]+2)%3 << " of triangle " << (-st[k]+2)/3);
+-					_printLine_("Edge " << triangles[(-st[k]+2)/3].NuEdgeTriangleAdj((int)((-st[k]+2)%3)) << " of triangle " << GetId(triangles[(-st[k]+2)/3].TriangleAdj((int)((-st[k]+2)%3))));
+-					_error2_("An edge belongs to more than 2 triangles");
+-				}	
+-			}
+-		}
+-
+-		//delete edge4
+-		long nbedges = edge4->nb(); // the total number of edges 
+-		delete edge4; edge4=NULL;
+-
+-		//display info
+-		if(verbose>5) {
+-			_printLine_("         info on Mesh:");
+-			_printLine_("            - number of vertices    = " << nbv); 
+-			_printLine_("            - number of triangles   = " << nbt); 
+-			_printLine_("            - number of given edges = " << nbe); 
+-			_printLine_("            - number of all edges   = " << nbedges); 
+-			_printLine_("            - Euler number 1 - nb of holes = " << nbt-nbedges+nbv); 
+-		}
+-
+-		// check consistency of edge[].adj and geometrical required  vertices
+-		k=0; kk=0;
+-		for (i=0;i<nbedges;i++){
+-			//internal edge
+-			if (st[i] <-1) {
+-				//get triangle number back
+-				it =  (-2-st[i])/3;
+-				//get edge position back
+-				j  =  (int) ((-2-st[i])%3);
+-				Triangle &tt=*triangles[it].TriangleAdj(j);
+-				if (triangles[it].color != tt.color|| i < nbeold) k++;
+-			}
+-			//boundary edge (alone)
+-			else if (st[i] >=0) 
+-			 kk++;
+-		}
+-
+-		/*Constructions of edges*/
+-
+-		k += kk;
+-		kk=0;
+-		if (k) {
+-			nbe = k;
+-			Edge* edgessave=edges;
+-			edges = new Edge[nbe];
+-			k =0;
+-
+-			//display info
+-			if(verbose>4) _printLine_("   Construction of the edges " << nbe);
+-
+-			for (i=0;i<nbedges;i++){ 
+-				long  add= -1;
+-
+-				//internal edge (belongs to two triangles)
+-				if (st[i] <-1){ 
+-					it =  (-2-st[i])/3;
+-					j  =  (int) ((-2-st[i])%3);
+-					Triangle & tt = * triangles[it].TriangleAdj(j);
+-					if (triangles[it].color !=  tt.color || i < nbeold) add=k++;
+-				}
+-				//boundary edge
+-				else if (st[i] >=0){
+-					it = st[i]/3;
+-					j  = (int) (st[i]%3);
+-					add=k++;
+-				}
+-				if (add>=0 && add < nbe){
+-					edges[add].v[0] = &triangles[it][VerticesOfTriangularEdge[j][0]];
+-					edges[add].v[1] = &triangles[it][VerticesOfTriangularEdge[j][1]];
+-					edges[add].GeomEdgeHook=NULL; 
+-					//if already existed
+-					if (i<nbeold){
+-						edges[add].ReferenceNumber=edgessave[i].ReferenceNumber; 		      
+-						edges[add].GeomEdgeHook=edgessave[i].GeomEdgeHook; //  HACK to get required edges
+-						_printLine_("oh no...");
+-					}
+-					else
+-					 edges[add].ReferenceNumber=Min(edges[add].v[0]->GetReferenceNumber(),edges[add].v[1]->GetReferenceNumber());
+-				  }
+-			}
+-
+-			//check that we have been through all edges
+-			if (k!=nbe){
+-				_error2_("problem in edge construction process: k!=nbe (should not happen)");
+-			}
+-			//delete edgessave
+-			if (edgessave) delete [] edgessave;
+-		}
+-
+-		/*Color the vertices*/
+-
+-		//initialize color of all vertices as 0
+-		for (i=0;i<nbv;i++) vertices[i].color =0;
+-
+-		//go through the edges and add a color to corresponding vertices
+-		//(A vertex in 4 edges will have a color 4)
+-		for (i=0;i<nbe;i++){
+-		 for (j=0;j<2;j++) edges[i].v[j]->color++;
+-		}
+-
+-		//change the color: if a vertex belongs to 2 edges -1, else -2
+-		for (i=0;i<nbv;i++) {
+-			vertices[i].color=(vertices[i].color ==2)? -1 : -2;
+-		}
+-
+-		/*Build edges[i].adj: adjacency of each edge (if on the same curve)*/
+-		for (i=0;i<nbe;i++){
+-			for (j=0;j<2;j++){ 
+-				//get current vertex
+-				BamgVertex* v=edges[i].v[j];
+-				//get vertex color (i0)
+-				long i0=v->color;
+-				long j0;
+-
+-				//if color<0 (first time), no adjacent edge
+-				if(i0<0) edges[i].adj[j]=NULL;
+-
+-				//if color=-1 (corner),change the vertex color as 2*i+j (position of the vertex in edges)
+-				if(i0==-1) v->color=i*2+j;
+-
+-				//if color>=0 (i and i0 edge are adjacent by the vertex v)
+-				else if (i0>=0) {
+-					//get position of v in edges back
+-					j0 =  i0%2; //column in edges
+-					i0 =  i0/2; //line in edges
+-
+-					//check that we have the correct vertex
+-					if (v!=edges[i0 ].v[j0]){
+-						_error2_("v!=edges[i0 ].v[j0]: this should not happen as the vertex belongs to this edge");
+-					}
+-
+-					//Add adjacence
+-					edges[i ].adj[j ]=edges +i0;
+-					edges[i0].adj[j0]=edges +i ;
+-
+-					//change color to -3
+-					v->color = -3;
+-				}
+-			}
+-		}
+-
+-		/*Reconstruct subdomains info*/
+-
+-		//check that nbsubdomains is empty
+-		if (nbsubdomains){
+-			_error2_("nbsubdomains should be 0");
+-		}
+-		nbsubdomains=0;
+-
+-		//color the subdomains
+-		long* colorT= new long[nbt];
+-		Triangle *tt,*t;
+-
+-		//initialize the color of each triangle as -1
+-		for (it=0;it<nbt;it++) colorT[it]=-1;
+-
+-		//loop over the triangles
+-		for (it=0;it<nbt;it++){
+-
+-			//if the triangle has not been colored yet:
+-			if (colorT[it]<0){
+-
+-				//color = number of subdomains
+-				colorT[it]=nbsubdomains;
+-
+-				//color all the adjacent triangles of T that share a non marked edge
+-				int level =1;
+-				int kolor=triangles[it].color;
+-				st[0]=it; // stack 
+-				st[1]=0;
+-				k=1;
+-				while (level>0){
+-					if( (j=st[level]++)<3 ){ 
+-						t = &triangles[st[level-1]];
+-						tt=t->TriangleAdj((int)j);
+-
+-						//color the adjacent triangle
+-						if ( ! t->Locked(j) && tt && (colorT[jt = GetId(tt)] == -1) && ( tt->color==kolor)) {
+-							colorT[jt]=nbsubdomains;
+-							st[++level]=jt;
+-							st[++level]=0;
+-							k++;
+-						}
+-					}
+-					else level-=2;
+-				}
+-				nbsubdomains++;
+-			}
+-		}
+-		if (verbose> 3) _printLine_("      The Number of sub domain = " << nbsubdomains); 
+-
+-		//build subdomains
+-		long isd;
+-		subdomains = new SubDomain[nbsubdomains];
+-
+-		//initialize subdomains[isd].head as 0
+-		for (isd=0;isd<nbsubdomains;isd++) subdomains[isd].head =0;
+-		  
+-		k=0;
+-		for (it=0;it<nbt;it++){
+-			for (int j=0;j<3;j++){
+-				tt=triangles[it].TriangleAdj(j);
+-				if ((!tt || tt->color != triangles[it].color) && !subdomains[isd=colorT[it]].head){
+-					subdomains[isd].head = triangles+it;
+-					subdomains[isd].ReferenceNumber =  triangles[it].color;
+-					subdomains[isd].direction = j; // hack
+-					subdomains[isd].edge = 0;
+-					k++;
+-				}
+-			}
+-		}
+-		//check that we have been through all subdomains
+-		if (k!= nbsubdomains){
+-			delete [] colorT;
+-			_error2_("k!= nbsubdomains");
+-		}
+-		//delete colorT and st
+-		delete [] colorT;
+-		delete [] st;
+-
+-		/*Reconstruct Geometry Gh*/
+-
+-		//build colorV -1 for all vertex and 0 for the vertices belonging to edges
+-		long* colorV = new long[nbv];
+-		for (i=0;i<nbv;i++) colorV[i]=-1;
+-		for (i=0;i<nbe;i++){
+-		 for ( j=0;j<2;j++) colorV[GetId(edges[i][j])]=0;
+-		}
+-		//number the vertices belonging to edges
+-		k=0;
+-		for (i=0;i<nbv;i++){
+-		 if(!colorV[i]) colorV[i]=k++;
+-		}
+-
+-		//Build Gh
+-		Gh.nbv=k;
+-		Gh.nbe = nbe;
+-		Gh.vertices = new GeomVertex[k];
+-		Gh.edges = new GeomEdge[nbe];
+-		Gh.nbsubdomains = nbsubdomains;
+-		Gh.subdomains = new GeomSubDomain[nbsubdomains];
+-		if (verbose>3) _printLine_("   number of vertices = " << Gh.nbv << "\n   number of edges = " << Gh.nbe);
+-		NbVerticesOnGeomVertex = Gh.nbv;
+-		VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex];
+-		NbVerticesOnGeomEdge =0;
+-		VerticesOnGeomEdge =0;
+-
+-		//Build VertexOnGeom
+-		for (i=0;i<nbv;i++){
+-			if((j=colorV[i])>=0){
+-				BamgVertex & v = Gh.vertices[j];
+-				v = vertices[i];
+-				v.color =0;
+-				VerticesOnGeomVertex[j] = VertexOnGeom(vertices[i], Gh.vertices[j]);
+-			}
+-		}
+-
+-		//Buid pmin and pmax of Gh (extrema coordinates)
+-		Gh.pmin =  Gh.vertices[0].r;
+-		Gh.pmax =  Gh.vertices[0].r;
+-		// recherche des extrema des vertices pmin,pmax
+-		for (i=0;i<Gh.nbv;i++) {
+-			Gh.pmin.x = Min(Gh.pmin.x,Gh.vertices[i].r.x);
+-			Gh.pmin.y = Min(Gh.pmin.y,Gh.vertices[i].r.y);
+-			Gh.pmax.x = Max(Gh.pmax.x,Gh.vertices[i].r.x);
+-			Gh.pmax.y = Max(Gh.pmax.y,Gh.vertices[i].r.y);
+-		}
+-		R2 DD05 = (Gh.pmax-Gh.pmin)*0.05;
+-		Gh.pmin -=  DD05;
+-		Gh.pmax +=  DD05;
+-
+-		//Build Gh.coefIcoor
+-		Gh.coefIcoor= (MaxICoor)/(Max(Gh.pmax.x-Gh.pmin.x,Gh.pmax.y-Gh.pmin.y));
+-		if (Gh.coefIcoor<=0){
+-			delete [] colorV;
+-			_error2_("Gh.coefIcoor<=0 in infered Geometry (this should not happen)");
+-		}
+-
+-		/*Build Gh.edges*/
+-
+-		//initialize len as 0
+-		double * len = new double[Gh.nbv];
+-		for(i=0;i<Gh.nbv;i++) len[i]=0;
+-
+-		//initialize edge4 again
+-		edge4= new SetOfEdges4(nbe,nbv);  
+-		double hmin = HUGE_VAL;
+-		int kreq=0;
+-		for (i=0;i<nbe;i++){
+-
+-			long i0 = GetId(edges[i][0]);
+-			long i1 = GetId(edges[i][1]);
+-			long j0 = colorV[i0];
+-			long j1 = colorV[i1];
+-
+-			Gh.edges[i].v[0] = Gh.vertices +  j0;
+-			Gh.edges[i].v[1] = Gh.vertices +  j1;
+-
+-			Gh.edges[i].type = 0;
+-
+-			Gh.edges[i].tg[0]=R2();
+-			Gh.edges[i].tg[1]=R2();
+-
+-			bool required= edges[i].GeomEdgeHook; 
+-			if(required) kreq++;
+-			edges[i].GeomEdgeHook =  Gh.edges + i;
+-			if(required){
+-				Gh.edges[i].v[0]->SetRequired();
+-				Gh.edges[i].v[1]->SetRequired();
+-				Gh.edges[i].SetRequired();
+-			}
+-
+-			R2 x12 = Gh.vertices[j0].r-Gh.vertices[j1].r;
+-			double l12=Norme2(x12);        
+-			hmin = Min(hmin,l12);
+-
+-			Gh.vertices[j1].color++;
+-			Gh.vertices[j0].color++;
+-
+-			len[j0]+= l12;
+-			len[j1] += l12;
+-			hmin = Min(hmin,l12);
+-			Gh.edges[i].ReferenceNumber  = edges[i].ReferenceNumber;
+-
+-			k = edge4->SortAndAdd(i0,i1);
+-			if (k != i){
+-				delete [] len;
+-				delete [] colorV;
+-				_error2_("problem in Edge4 construction: k != i");
+-			}
+-		}
+-
+-		//Build metric for all vertices of Gh
+-		for (i=0;i<Gh.nbv;i++){
+-		 if (Gh.vertices[i].color > 0) 
+-		  Gh.vertices[i].m=  Metric(len[i] /(double) Gh.vertices[i].color);
+-		 else 
+-		  Gh.vertices[i].m=  Metric(hmin);
+-		}
+-		//delete len
+-		delete [] len;
+-
+-		//Build Gh.subdomains
+-		for (i=0;i<nbsubdomains;i++){
+-			it = GetId(subdomains[i].head);
+-			j = subdomains[i].direction;
+-			long i0 = GetId(triangles[it][VerticesOfTriangularEdge[j][0]]);
+-			long i1 = GetId(triangles[it][VerticesOfTriangularEdge[j][1]]);
+-			k = edge4->SortAndFind(i0,i1);
+-			if(k>=0){
+-				subdomains[i].direction = (vertices + i0 == edges[k].v[0]) ? 1 : -1;
+-				subdomains[i].edge = edges+k;
+-				Gh.subdomains[i].edge = Gh.edges + k;
+-				Gh.subdomains[i].direction  =  subdomains[i].direction;
+-				Gh.subdomains[i].ReferenceNumber =  subdomains[i].ReferenceNumber;
+-			}
+-			else
+-			 _error2_("%i should be >=0");
+-		  }
+-
+-		delete edge4;
+-		delete [] colorV;
+-
+-		//unset adj
+-		for (i=0;i<nbt;i++){
+-			for ( j=0;j<3;j++){
+-				triangles[i].SetAdj2(j,0,triangles[i].GetAllflag(j));
+-			}
+-		}
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::BuildMetric0 (double P2 projection){{{*/
+-	void Mesh::BuildMetric0(BamgOpts* bamgopts){
+-
+-		/*Options*/
+-		double* s=NULL;
+-		long    nbsol;
+-		int     verbose;
+-
+-		int   i,j,k,iA,iB,iC;
+-		int   iv;
+-
+-		/*Recover options*/
+-		verbose=bamgopts->verbose;
+-
+-		/*Get and process fields*/
+-		s=bamgopts->field;
+-		nbsol=bamgopts->fieldSize[1];
+-
+-		/*Check size*/
+-		if (bamgopts->fieldSize[0] != nbv) _error2_("'field' should have " << nbv << " rows");
+-
+-		//initialization of some variables
+-		double* ss=(double*)s;
+-		double  sA,sB,sC;
+-		double*  detT = new double[nbt];
+-		double*  sumareas = new double[nbv];
+-		double*  alpha= new double[nbt*3];
+-		double*  beta = new double[nbt*3];
+-		double*  dx_elem    = new double[nbt];
+-		double*  dy_elem    = new double[nbt];
+-		double*  dx_vertex  = new double[nbv];
+-		double*  dy_vertex  = new double[nbv];
+-		double*  dxdx_elem  = new double[nbt];
+-		double*  dxdy_elem  = new double[nbt];
+-		double*  dydy_elem  = new double[nbt];
+-		double*  dxdx_vertex= new double[nbv];
+-		double*  dxdy_vertex= new double[nbv];
+-		double*  dydy_vertex= new double[nbv];
+-
+-		//display infos
+-		if(verbose>1) {
+-			_printLine_("   Construction of Metric: number of field: " << nbsol << " (nbt=" << nbt << ", nbv=" << nbv << ")");
+-		}
+-
+-		//first, build the chains that will be used for the Hessian computation, as weel as the area of each element
+-		int* head_s=NULL;
+-		head_s=xNew<int>(nbv);
+-		int* next_p=NULL;
+-		next_p=xNew<int>(3*nbt);
+-		int  p=0;
+-		//initialization
+-		for(i=0;i<nbv;i++){
+-			sumareas[i]=0;
+-			head_s[i]=-1;
+-		}
+-		for(i=0;i<nbt;i++){
+-
+-			//lopp over the real triangles (no boundary elements)
+-			if(triangles[i].link){ 
+-
+-				//get current triangle t
+-				const Triangle &t=triangles[i];
+-
+-				// coor of 3 vertices 
+-				R2 A=t[0];
+-				R2 B=t[1];
+-				R2 C=t[2];
+-
+-				//compute triangle determinant (2*Area)
+-				double dett = bamg::Area2(A,B,C);
+-				detT[i]=dett;
+-
+-				/*The nodal functions are such that for a vertex A:
+-				 *    N_A(x,y)=alphaA x + beta_A y +gamma_A
+-				 *    N_A(A) = 1,   N_A(B) = 0,   N_A(C) = 0
+-				 * solving this system of equation (determinant = 2Area(T) != 0 if A,B and C are not inlined)
+-				 * leads to:
+-				 *    N_A = (xB yC - xC yB + x(yB-yC) +y(xC-xB))/(2*Area(T))
+-				 * and this gives:
+-				 *    alpha_A = (yB-yC)/(2*Area(T))*/
+-				alpha[i*3+0]=(B.y-C.y)/dett;
+-				alpha[i*3+1]=(C.y-A.y)/dett;
+-				alpha[i*3+2]=(A.y-B.y)/dett;
+-				beta[ i*3+0]=(C.x-B.x)/dett;
+-				beta[ i*3+1]=(A.x-C.x)/dett;
+-				beta[ i*3+2]=(B.x-A.x)/dett;
+-
+-				//compute chains
+-				for(j=0;j<3;j++){
+-					k=GetId(triangles[i][j]);
+-					next_p[p]=head_s[k];
+-					head_s[k]=p++;
+-
+-					//add area to sumareas
+-					sumareas[k]+=dett;
+-				}
+-
+-			}
+-		}
+-
+-		//for all Solutions
+-		for (int nusol=0;nusol<nbsol;nusol++) {
+-			double smin=ss[nusol],smax=ss[nusol];
+-
+-			//get min(s), max(s) and initialize Hessian (dxdx,dxdy,dydy)
+-			for ( iv=0,k=0; iv<nbv; iv++){
+-				smin=Min(smin,ss[iv*nbsol+nusol]);
+-				smax=Max(smax,ss[iv*nbsol+nusol]);
+-			}
+-			double sdelta=smax-smin;
+-			double absmax=Max(Abs(smin),Abs(smax));
+-
+-			//display info
+-			if(verbose>2) _printLine_("      Solution " << nusol << ", Min = " << smin << ", Max = " << smax << ", Delta = " << sdelta);
+-
+-			//skip constant field
+-			if (sdelta < 1.0e-10*Max(absmax,1e-20)){
+-				_printLine_("      Solution " << nusol << " is constant, skipping...");
+-				continue;
+-			}
+-
+-			//initialize the hessian and gradient matrices
+-			for ( iv=0,k=0; iv<nbv; iv++) dxdx_vertex[iv]=dxdy_vertex[iv]=dydy_vertex[iv]=dx_vertex[iv]=dy_vertex[iv]=0;
+-
+-			//1: Compute gradient for each element (exact)
+-			for (i=0;i<nbt;i++){
+-				if(triangles[i].link){
+-					// number of the 3 vertices
+-					iA = GetId(triangles[i][0]);
+-					iB = GetId(triangles[i][1]);
+-					iC = GetId(triangles[i][2]);
+-
+-					// value of the P1 fonction on 3 vertices 
+-					sA = ss[iA*nbsol+nusol];
+-					sB = ss[iB*nbsol+nusol];
+-					sC = ss[iC*nbsol+nusol];
+-
+-					//gradient = (sum alpha_i s_i, sum_i beta_i s_i)
+-					dx_elem[i]=sA*alpha[3*i+0]+sB*alpha[3*i+1]+sC*alpha[3*i+2];
+-					dy_elem[i]=sA*beta[ 3*i+0]+sB*beta[ 3*i+1]+sC*beta[ 3*i+2];
+-				}
+-			}
+-
+-			//2: then compute a gradient for each vertex using a P2 projection
+-			for(i=0;i<nbv;i++){
+-				for(p=head_s[i];p!=-1;p=next_p[p]){
+-					//Get triangle number
+-					k=(long)(p/3);
+-					dx_vertex[i]+=dx_elem[k]*detT[k]/sumareas[i];
+-					dy_vertex[i]+=dy_elem[k]*detT[k]/sumareas[i];
+-				}
+-			}
+-
+-			//3: compute Hessian matrix on each element
+-			for (i=0;i<nbt;i++){
+-				if(triangles[i].link){
+-					// number of the 3 vertices
+-					iA = GetId(triangles[i][0]);
+-					iB = GetId(triangles[i][1]);
+-					iC = GetId(triangles[i][2]);
+-
+-					//Hessian
+-					dxdx_elem[i]=dx_vertex[iA]*alpha[3*i+0]+dx_vertex[iB]*alpha[3*i+1]+dx_vertex[iC]*alpha[3*i+2];
+-					dxdy_elem[i]=dy_vertex[iA]*alpha[3*i+0]+dy_vertex[iB]*alpha[3*i+1]+dy_vertex[iC]*alpha[3*i+2];
+-					dydy_elem[i]=dy_vertex[iA]*beta[3*i+0]+dy_vertex[iB]*beta[3*i+1]+dy_vertex[iC]*beta[3*i+2];
+-				}
+-			}
+-
+-			//4: finaly compute Hessian on each vertex using the second P2 projection
+-			for(i=0;i<nbv;i++){
+-				for(p=head_s[i];p!=-1;p=next_p[p]){
+-					//Get triangle number
+-					k=(long)(p/3);
+-					dxdx_vertex[i]+=dxdx_elem[k]*detT[k]/sumareas[i];
+-					dxdy_vertex[i]+=dxdy_elem[k]*detT[k]/sumareas[i];
+-					dydy_vertex[i]+=dydy_elem[k]*detT[k]/sumareas[i];
+-				}
+-			}
+-
+-			/*Compute Metric from Hessian*/
+-			for ( iv=0;iv<nbv;iv++){
+-				vertices[iv].MetricFromHessian(dxdx_vertex[iv],dxdy_vertex[iv],dydy_vertex[iv],smin,smax,ss[iv*nbsol+nusol],bamgopts->err[nusol],bamgopts);
+-			}
+-
+-		}//for all solutions
+-
+-		//clean up
+-		xDelete<int>(head_s);
+-		xDelete<int>(next_p);
+-		delete [] detT;
+-		delete [] alpha;
+-		delete [] beta;
+-		delete [] sumareas;
+-		delete [] dx_elem;
+-		delete [] dy_elem;
+-		delete [] dx_vertex;
+-		delete [] dy_vertex;
+-		delete [] dxdx_elem;
+-		delete [] dxdy_elem;
+-		delete [] dydy_elem;
+-		delete [] dxdx_vertex;
+-		delete [] dxdy_vertex;
+-		delete [] dydy_vertex;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::BuildMetric1 (Green formula){{{*/
+-	void Mesh::BuildMetric1(BamgOpts* bamgopts){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/IntersectConsMetric)*/
+-
+-		/*Options*/
+-		double* s=NULL;
+-		long nbsol;
+-		int NbJacobi;
+-		int verbose;
+-
+-		/*Recover options*/
+-		verbose=bamgopts->verbose;
+-		NbJacobi=bamgopts->nbjacobi;
+-
+-		/*Get and process fields*/
+-		s=bamgopts->field;
+-		nbsol=bamgopts->fieldSize[1];
+-
+-		/*Check size*/
+-		if (bamgopts->fieldSize[0] != nbv) _error2_("'field' should have " << nbv << " rows");
+-
+-		//initialization of some variables
+-		long    i,k,iA,iB,iC,iv;
+-		R2      O(0,0);
+-		double* ss=(double*)s;
+-		double  sA,sB,sC;
+-		double*  detT = new double[nbt];
+-		double*  Mmass= new double[nbv];
+-		double*  Mmassxx= new double[nbv];
+-		double*  dxdx= new double[nbv];
+-		double*  dxdy= new double[nbv];
+-		double*  dydy= new double[nbv];
+-		double*  workT= new double[nbt];
+-		double*  workV= new double[nbv];
+-		int*    OnBoundary = new int[nbv];
+-
+-		//display infos
+-		if(verbose>1) {
+-			_printLine_("   Construction of Metric: number of field: " << nbsol << " (nbt=" << nbt << ", nbv=" << nbv << ")");
+-		}
+-
+-		//initialize Mmass, OnBoundary and Massxx by zero
+-		for (iv=0;iv<nbv;iv++){
+-			Mmass[iv]=0;
+-			OnBoundary[iv]=0;
+-			Mmassxx[iv]=0;
+-		}
+-
+-		//Build detT Mmas Mmassxx workT and OnBoundary
+-		for (i=0;i<nbt;i++){ 
+-
+-			//lopp over the real triangles (no boundary elements)
+-			if(triangles[i].link){ 
+-
+-				//get current triangle t
+-				const Triangle &t=triangles[i];
+-
+-				// coor of 3 vertices 
+-				R2 A=t[0];
+-				R2 B=t[1];
+-				R2 C=t[2];
+-
+-				// number of the 3 vertices
+-				iA = GetId(t[0]);
+-				iB = GetId(t[1]);
+-				iC = GetId(t[2]);
+-
+-				//compute triangle determinant (2*Area)
+-				double dett = bamg::Area2(A,B,C);
+-				detT[i]=dett;
+-				dett /= 6;
+-
+-				// construction of OnBoundary (flag=1 if on boundary, else 0)
+-				int nbb=0;
+-				for(int j=0;j<3;j++){
+-					//get adjacent triangle
+-					Triangle *ta=t.Adj(j);
+-					//if there is no adjacent triangle, the edge of the triangle t is on boundary
+-					if ( !ta || !ta->link){
+-						//mark the two vertices of the edge as OnBoundary
+-						OnBoundary[GetId(t[VerticesOfTriangularEdge[j][0]])]=1;
+-						OnBoundary[GetId(t[VerticesOfTriangularEdge[j][1]])]=1;
+-						nbb++;
+-					}
+-				}
+-
+-				//number of vertices on boundary for current triangle t
+-				workT[i] = nbb;
+-
+-				//Build Mmass Mmass[i] = Mmass[i] + Area/3
+-				Mmass[iA] += dett;
+-				Mmass[iB] += dett;
+-				Mmass[iC] += dett;
+-
+-				//Build Massxx = Mmass
+-				Mmassxx[iA] += dett;
+-				Mmassxx[iB] += dett;
+-				Mmassxx[iC] += dett;
+-			}
+-
+-			//else: the triangle is a boundary triangle -> workT=-1
+-			else workT[i]=-1;
+-		}
+-
+-		//for all Solution  
+-		for (int nusol=0;nusol<nbsol;nusol++) {
+-
+-			double smin=ss[nusol],smax=ss[nusol];
+-			double h1=1.e30,h2=1e-30,rx=0;
+-			double hn1=1.e30,hn2=1e-30,rnx =1.e-30;  
+-
+-			//get min(s), max(s) and initialize Hessian (dxdx,dxdy,dydy)
+-			for ( iv=0,k=0; iv<nbv; iv++ ){
+-				dxdx[iv]=dxdy[iv]=dydy[iv]=0;
+-				smin=Min(smin,ss[iv*nbsol+nusol]);
+-				smax=Max(smax,ss[iv*nbsol+nusol]);
+-			}
+-			double sdelta=smax-smin;
+-			double absmax=Max(Abs(smin),Abs(smax));
+-
+-			//display info
+-			if(verbose>2) _printLine_("      Solution " << nusol << ", Min = " << smin << ", Max = " << smax << ", Delta = " << sdelta << ", number of fields = " << nbsol);
+-
+-			//skip constant field
+-			if (sdelta < 1.0e-10*Max(absmax,1e-20) ){
+-				if (verbose>2) _printLine_("      Solution " << nusol << " is constant, skipping...");
+-				continue;
+-			}
+-
+-			//pointer toward ss that is also a pointer toward s (solutions)
+-			double* sf=ss; 
+-
+-				//initialize the hessian matrix
+-				for ( iv=0,k=0; iv<nbv; iv++) dxdx[iv]=dxdy[iv]=dydy[iv]=0;
+-
+-				//loop over the triangles
+-				for (i=0;i<nbt;i++){
+-
+-					//for real all triangles 
+-					if(triangles[i].link){
+-
+-						// coor of 3 vertices 
+-						R2 A=triangles[i][0];
+-						R2 B=triangles[i][1];
+-						R2 C=triangles[i][2];
+-
+-						//warning: the normal is internal and the size is the length of the edge
+-						R2 nAB = Orthogonal(B-A);
+-						R2 nBC = Orthogonal(C-B);
+-						R2 nCA = Orthogonal(A-C);
+-						//note that :  nAB + nBC + nCA == 0 
+-
+-						// number of the 3 vertices
+-						iA = GetId(triangles[i][0]);
+-						iB = GetId(triangles[i][1]);
+-						iC = GetId(triangles[i][2]);
+-
+-						// for the test of  boundary edge
+-						// the 3 adj triangles 
+-						Triangle *tBC = triangles[i].TriangleAdj(OppositeEdge[0]);
+-						Triangle *tCA = triangles[i].TriangleAdj(OppositeEdge[1]);
+-						Triangle *tAB = triangles[i].TriangleAdj(OppositeEdge[2]);
+-
+-						// value of the P1 fonction on 3 vertices 
+-						sA = ss[iA*nbsol+nusol];
+-						sB = ss[iB*nbsol+nusol];
+-						sC = ss[iC*nbsol+nusol];
+-
+-						/*The nodal functions are such that for a vertex A:
+-						  N_A(x,y)=alphaA x + beta_A y +gamma_A
+-						  N_A(A) = 1,   N_A(B) = 0,   N_A(C) = 0
+-						  solving this system of equation (determinant = 2Area(T) != 0 if A,B and C are not inlined)
+-						  leads to:
+-						  N_A = (xB yC - xC yB + x(yB-yC) +y(xC-xB))/(2*Area(T))
+-						  and this gives:
+-						  alpha_A = (yB-yC)/(2*Area(T))
+-						  beta_A = (xC-xB)/(2*Area(T))
+-						  and therefore:
+-						  grad N_A = nA / detT
+-						  for an interpolation of a solution s:
+-						  grad(s) = s * sum_{i=A,B,C} grad(N_i) */
+-
+-						R2 Grads=(nAB*sC+nBC*sA+nCA*sB)/detT[i];
+-
+-						//Use Green to compute Hessian Matrix
+-
+-						// if edge on boundary no contribution  => normal = 0
+-						if ( !tBC || !tBC->link ) nBC=O;
+-						if ( !tCA || !tCA->link ) nCA=O;
+-						if ( !tAB || !tAB->link ) nAB=O;
+-
+-						// remark we forgot a 1/2 because
+-						//       int_{edge} w_i = 1/2 if i is in edge 
+-						//                         0  if not
+-						// if we don't take the  boundary 
+-						dxdx[iA] += ( nCA.x + nAB.x ) *Grads.x;
+-						dxdx[iB] += ( nAB.x + nBC.x ) *Grads.x;
+-						dxdx[iC] += ( nBC.x + nCA.x ) *Grads.x;
+-
+-						//warning optimization (1) the division by 2 is done on the metric construction
+-						dxdy[iA] += (( nCA.y + nAB.y ) *Grads.x + ( nCA.x + nAB.x ) *Grads.y) ;
+-						dxdy[iB] += (( nAB.y + nBC.y ) *Grads.x + ( nAB.x + nBC.x ) *Grads.y) ;
+-						dxdy[iC] += (( nBC.y + nCA.y ) *Grads.x + ( nBC.x + nCA.x ) *Grads.y) ; 
+-
+-						dydy[iA] += ( nCA.y + nAB.y ) *Grads.y;
+-						dydy[iB] += ( nAB.y + nBC.y ) *Grads.y;
+-						dydy[iC] += ( nBC.y + nCA.y ) *Grads.y;
+-
+-					} // for real all triangles 
+-				}
+-
+-				long kk=0;
+-				for ( iv=0,k=0 ; iv<nbv; iv++){
+-					if(Mmassxx[iv]>0){
+-						dxdx[iv] /= 2*Mmassxx[iv];
+-						// warning optimization (1) on term dxdy[iv]*ci/2 
+-						dxdy[iv] /= 4*Mmassxx[iv];
+-						dydy[iv] /= 2*Mmassxx[iv];
+-						// Compute the matrix with abs(eigen value)
+-						Metric M(dxdx[iv], dxdy[iv], dydy[iv]);
+-						EigenMetric Vp(M);
+-						Vp.Abs();
+-						M = Vp;
+-						dxdx[iv] = M.a11;
+-						dxdy[iv] = M.a21;
+-						dydy[iv] = M.a22;
+-					}
+-					else kk++;
+-				}
+-
+-				// correction of second derivative
+-				// by a laplacien
+-				double* d2[3] = {dxdx, dxdy, dydy};
+-				double* dd;
+-				for (int xy = 0;xy<3;xy++) {
+-					dd = d2[xy];
+-					// do leat 2 iteration for boundary problem
+-					for (int ijacobi=0;ijacobi<Max(NbJacobi,2);ijacobi++){
+-						for (i=0;i<nbt;i++) 
+-						 if(triangles[i].link){// the real triangles 
+-							 // number of the 3 vertices
+-							 iA = GetId(triangles[i][0]);
+-							 iB = GetId(triangles[i][1]);
+-							 iC = GetId(triangles[i][2]);
+-							 double cc=3;
+-							 if(ijacobi==0)
+-							  cc = Max((double) ((Mmassxx[iA]>0)+(Mmassxx[iB]>0)+(Mmassxx[iC]>0)),1.);
+-							 workT[i] = (dd[iA]+dd[iB]+dd[iC])/cc;
+-						 }
+-						for (iv=0;iv<nbv;iv++) workV[iv]=0;
+-
+-						for (i=0;i<nbt;i++){ 
+-							if(triangles[i].link){ // the real triangles 
+-								// number of the 3 vertices
+-								iA = GetId(triangles[i][0]);
+-								iB = GetId(triangles[i][1]);
+-								iC = GetId(triangles[i][2]);
+-								double cc =  workT[i]*detT[i];
+-								workV[iA] += cc;
+-								workV[iB] += cc;
+-								workV[iC] += cc;
+-							}
+-						}
+-
+-						for (iv=0;iv<nbv;iv++){
+-							if( ijacobi<NbJacobi || OnBoundary[iv]){
+-								dd[iv] = workV[iv]/(Mmass[iv]*6);
+-							}
+-						}
+-					}
+-				}
+-
+-				/*Compute Metric from Hessian*/
+-				for ( iv=0;iv<nbv;iv++){
+-					vertices[iv].MetricFromHessian(dxdx[iv],dxdy[iv],dydy[iv],smin,smax,ss[iv*nbsol+nusol],bamgopts->err[nusol],bamgopts);
+-				}
+-
+-		}// end for all solution 
+-
+-		delete [] detT;
+-		delete [] Mmass;
+-		delete [] dxdx;
+-		delete [] dxdy;
+-		delete [] dydy;
+-		delete []  workT;
+-		delete [] workV;
+-		delete [] Mmassxx;
+-		delete []  OnBoundary;
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::CrackMesh{{{*/
+-	void Mesh::CrackMesh(BamgOpts* bamgopts) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/CrackMesh)*/
+-
+-		/*Intermediary*/
+-		int i,j,k,num,count;
+-		int i1,i2;
+-		int j1,j2;
+-
+-		/*Options*/
+-		int verbose=bamgopts->verbose;
+-
+-		//  computed the number of cracked edge
+-		for (k=i=0;i<nbe;i++){
+-			if(edges[i].GeomEdgeHook->Cracked()) k++;
+-		}
+-
+-		//Return if no edge is cracked
+-		if(k==0) return;
+-		if (verbose>4) _printLine_("      number of Cracked Edges = " << k);
+-
+-		//Initialize Cracked edge
+-		NbCrackedEdges=k;
+-		CrackedEdges=new CrackedEdge[k];
+-
+-		//Compute number of Cracked Vertices
+-		k=0;
+-		NbCrackedVertices=0;
+-
+-		int* splitvertex=new int[nbv];
+-		for (i=0;i<nbv;i++) splitvertex[i]=0;
+-
+-		for (i=0;i<nbe;i++){
+-			if(edges[i].GeomEdgeHook->Cracked()){
+-
+-				//Fill edges fields of CrackedEdges
+-				CrackedEdges[k  ].E =edges[i].GeomEdgeHook;
+-				CrackedEdges[k++].e1=&edges[i];
+-
+-				//Get number of the two vertices on the edge
+-				i1=GetId(edges[i][0]);
+-				i2=GetId(edges[i][1]);
+-				_assert_(i1>=0 && i1<nbv && i2>=0 && i2<nbv);
+-				splitvertex[i1]++;
+-				splitvertex[i2]++;
+-
+-				//If the vertex has already been flagged once, it is a cracked vertex (tip otherwise)
+-				if (splitvertex[i1]==2) NbCrackedVertices++;
+-				if (splitvertex[i2]==2) NbCrackedVertices++;
+-
+-				//The vertex cannot be marked more than twice
+-				if (splitvertex[i1]==3 || splitvertex[i2]==3){
+-					delete [] splitvertex;
+-					_error2_("Crossing rifts not supported yet");
+-				}
+-			}
+-		}
+-		_assert_(k==NbCrackedEdges);
+-
+-		//Add new vertices
+-		if (verbose>4) _printLine_("      number of Cracked Vertices = " << NbCrackedVertices);
+-		if (NbCrackedVertices){
+-			CrackedVertices=xNew<long>(2*NbCrackedVertices);
+-			num=0;
+-			for (i=0;i<nbv;i++){
+-				if (splitvertex[i]==2){
+-					CrackedVertices[num*2+0]=i;      //index of first vertex
+-					CrackedVertices[num*2+1]=nbv+num;//index of new vertex
+-					num++;
+-				}
+-			}
+-			_assert_(num==NbCrackedVertices);
+-		}
+-		delete [] splitvertex;
+-
+-		//Now, find the triangles that hold a cracked edge
+-		CreateSingleVertexToTriangleConnectivity();
+-
+-		long* Edgeflags=new long[NbCrackedEdges];
+-		for(i=0;i<NbCrackedEdges;i++) Edgeflags[i]=0;
+-
+-		for(i=0;i<NbCrackedEdges;i++){
+-			//Get the numbers of the 2 vertices of the crren cracked edge
+-			i1=GetId((*CrackedEdges[i].e1)[0]);
+-			i2=GetId((*CrackedEdges[i].e1)[1]);
+-
+-			//find a triangle holding the vertex i1 (first vertex of the ith cracked edge)
+-			Triangle* tbegin=vertices[i1].t;
+-			k=vertices[i1].IndexInTriangle;//local number of i in triangle tbegin
+-			_assert_(GetId((*tbegin)[k])==GetId(vertices[i1]));
+-
+-			//Now, we are going to go through the adjacent triangle that hold i1 till
+-			//we find one that has the cracked edge
+-			AdjacentTriangle ta(tbegin,EdgesVertexTriangle[k][0]);
+-			count=0;
+-			do {
+-				for(j=0;j<3;j++){
+-					//Find the position of i1 in the triangle index
+-					if (GetId((*ta.t)[j])==i1){
+-						j1=j;
+-						break;
+-					}
+-				}
+-				for(j=0;j<3;j++){
+-					//Check wether i2 is also in the triangle index
+-					if (GetId((*ta.t)[j])==i2){
+-						j2=j;
+-						//Invert j1 and j2 if necessary
+-						if ((j1+1)%3==j2){
+-							int j3=j1;
+-							j1=j2;
+-							j2=j3;
+-						}
+-						if (Edgeflags[i]==0){
+-							//first element
+-							CrackedEdges[i].a=ta.t;
+-							CrackedEdges[i].length=Norme2((*ta.t)[j1].r-(*ta.t)[j2].r);
+-							CrackedEdges[i].normal=Orthogonal((*ta.t)[j1].r-(*ta.t)[j2].r);
+-						}
+-						else{
+-							//Second element -> to renumber
+-							CrackedEdges[i].b=ta.t;
+-							CrackedEdges[i].length=Norme2((*ta.t)[j1].r-(*ta.t)[j2].r);
+-							CrackedEdges[i].normal=Orthogonal((*ta.t)[j1].r-(*ta.t)[j2].r);
+-						}
+-						Edgeflags[i]++;
+-						break;
+-					}
+-				}
+-				//_printLine_(element_renu[GetId(ta.t)] << " -> " << GetId((*ta.t)[0])+1 << " " << GetId((*ta.t)[1])+1 << " " << GetId((*ta.t)[2])+1 << ", edge [" << i1 << "->" << j1 << " " << i2 << "->" << j2 << "]");
+-				ta = Next(ta).Adj(); 
+-				if (count++>50) _error2_("Maximum number of iteration exceeded");
+-			}while ((tbegin != ta)); 
+-		}
+-
+-		//Check EdgeFlag
+-		for(i=0;i<NbCrackedEdges;i++){
+-			if (Edgeflags[i]!=2){
+-				_error2_("A problem occured: at least one crack edge (number " << i+1 << ") does not belong to 2 elements");
+-			}
+-		}
+-		delete [] Edgeflags;
+-
+-		//Reset BamgVertex to On
+-		SetVertexFieldOn();
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::Echo{{{*/
+-	void Mesh::Echo(void) {
+-
+-		int i;
+-
+-		_printLine_("Mesh Echo:");
+-		_printLine_("   nbv = " << nbv);
+-		_printLine_("   nbt = " << nbt);
+-		_printLine_("   nbe = " << nbe);
+-		_printLine_("   nbq = " << nbq);
+-		_printLine_("   index:");
+-		for (i=0;i<nbt;i++){
+-			_printLine_("   " << setw(4) << i+1 << ": [" 
+-						<< setw(4) << (((BamgVertex *)triangles[i](0))?GetId(triangles[i][0])+1:0) << " " 
+-						<< setw(4) << (((BamgVertex *)triangles[i](0))?GetId(triangles[i][1])+1:0) << " " 
+-						<< setw(4) << (((BamgVertex *)triangles[i](0))?GetId(triangles[i][2])+1:0) << "]");
+-		}
+-		_printLine_("   coordinates:");
+-		for (i=0;i<nbv;i++){
+-			_printLine_("   " << setw(4) << i+1 << ": [" << vertices[i].r.x << " " << vertices[i].r.y << "]");
+-		}
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::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;
+-
+-			//display
+-			if (verbose > 2) _printLine_("   ForceBoundary  nb of edge: " << nbe);
+-
+-			//check that there is no triangle with 0 determinant
+-			for (int t = 0; t < nbt; t++){
+-				if (!triangles[t].det) k++;
+-			}
+-			if (k!=0) {
+-				_error2_("there is " << k << " triangles of mes = 0");
+-			}
+-
+-			//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;
+-
+-				if (nbswp) nbfe++;
+-				if ( nbswp < 0 && k < 5){
+-					_error2_("Missing Edge " << i << ", v0=" << GetId(edges[i][0]) << ",v1=" << GetId(edges[i][1]));
+-				}
+-			}
+-
+-			if (k!=0) {
+-				_error2_("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) _printLine_("      number of inforced edge = " << nbfe << ", number of swap= " << Nbswap); 
+-		}
+-	/*}}}*/
+-	/*FUNCTION Mesh::FindSubDomain{{{*/
+-	void Mesh::FindSubDomain(int OutSide) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/FindSubDomain)*/
+-
+-		long int verbose=0;
+-
+-		if (verbose >2){
+-			if (OutSide) _printLine_("   Find all external sub-domain"); 
+-			else _printLine_("   Find all internal sub-domain");
+-		  }
+-		short * HeapArete = new short[nbt];
+-		Triangle  **  HeapTriangle = new Triangle*  [nbt];
+-		Triangle *t,*t1;
+-		long k,it;
+-
+-		for (int itt=0;itt<nbt;itt++) 
+-		 triangles[itt].link=0; // par defaut pas de couleur
+-
+-		long  NbSubDomTot =0;
+-		for ( it=0;it<nbt;it++)  { 
+-			if ( ! triangles[it].link  ) {
+-				t = triangles + it;
+-				NbSubDomTot++;; // new composante connexe
+-				long i = 0; // niveau de la pile 
+-				t->link = t ; // sd forme d'un triangle cicular link
+-
+-				HeapTriangle[i] =t ; 
+-				HeapArete[i] = 3;
+-
+-				while (i >= 0) // boucle sur la pile
+-				  { while ( HeapArete[i]--) // boucle sur les 3 aretes 
+-					  { 
+-						int na =  HeapArete[i];
+-						Triangle * tc =  HeapTriangle[i]; // triangle courant
+-						if( ! tc->Locked(na)) // arete non frontiere
+-						  {
+-							Triangle * ta = tc->TriangleAdj(na) ; // næ triangle adjacent
+-							if (ta->link == 0 ) // non deja chainer => on enpile
+-							  { 
+-								i++;
+-								ta->link = t->link ;  // on chaine les triangles
+-								t->link = ta ;  // d'un meme sous domaine          
+-								HeapArete[i] = 3; // pour les 3 triangles adjacents
+-								HeapTriangle[i] = ta;
+-							  }}
+-					  } // deplie fin de boucle sur les 3 adjacences
+-					i--;
+-				  }          
+-			}      
+-		}
+-
+-		// supression de tous les sous domaine infini <=>  contient le sommet NULL
+-		it =0;
+-		nbtout = 0;
+-		while (it<nbt) {
+-			if (triangles[it].link) 
+-			  { 
+-				if (!( triangles[it](0) &&  triangles[it](1) &&  triangles[it](2) )) 
+-				  {
+-					// infini triangle 
+-					NbSubDomTot --;
+-					t=&triangles[it];
+-					nbtout--;  // on fait un coup de trop. 
+-					while  (t){
+-						nbtout++;
+-						t1=t;
+-						t=t->link;
+-						t1->link=0;
+-					}
+-				  }
+-			  }   
+-			it++;} // end while (it<nbt)
+-			if (nbt == nbtout ||  !NbSubDomTot) {
+-				delete [] HeapArete;
+-				_error2_("The boundary is not close: all triangles are outside");
+-			}
+-
+-			delete [] HeapArete;
+-			delete [] HeapTriangle;
+-
+-
+-			if (OutSide|| !Gh.subdomains || !Gh.nbsubdomains ) 
+-			  { // No geom sub domain
+-				long i;
+-				if (subdomains) delete [] subdomains;
+-				subdomains = new SubDomain[ NbSubDomTot];
+-				nbsubdomains=  NbSubDomTot;
+-				for ( i=0;i<nbsubdomains;i++) {
+-					subdomains[i].head=NULL;
+-					subdomains[i].ReferenceNumber=i+1;
+-				}
+-				long * mark = new long[nbt];
+-				for (it=0;it<nbt;it++)
+-				 mark[it]=triangles[it].link ? -1 : -2;
+-
+-				it =0;
+-				k = 0;
+-				while (it<nbt) {
+-					if (mark[it] == -1) {
+-						t1 = & triangles[it];
+-						t = t1->link;
+-						mark[it]=k;
+-						subdomains[k].head = t1;
+-						do {
+-							mark[GetId(t)]=k;
+-							t=t->link;
+-						} while (t!=t1);
+-						mark[it]=k++;}
+-						//    else if(mark[it] == -2 ) triangles[it].Draw(999);
+-						it++;} // end white (it<nbt)
+-						if (k!=nbsubdomains){
+-							delete [] mark;
+-							_error2_("k!=nbsubdomains");
+-						}
+-						if(OutSide) 
+-						  {
+-							//  to remove all the sub domain by parity adjacents
+-							//  because in this case we have only the true boundary edge
+-							// so teh boundary is manifold
+-							long nbk = nbsubdomains;
+-							while (nbk)
+-							 for (it=0;it<nbt && nbk ;it++)
+-							  for (int na=0;na<3 && nbk ;na++)
+-								 {
+-								  Triangle *ta = triangles[it].TriangleAdj(na);
+-								  long kl = ta ? mark[GetId(ta)] : -2;
+-								  long kr = mark[it];
+-								  if(kr !=kl) {
+-									  if (kl >=0 && subdomains[kl].ReferenceNumber <0 && kr >=0 && subdomains[kr].ReferenceNumber>=0)
+-										nbk--,subdomains[kr].ReferenceNumber=subdomains[kl].ReferenceNumber-1;
+-									  if (kr >=0 && subdomains[kr].ReferenceNumber <0 && kl >=0 && subdomains[kl].ReferenceNumber>=0)
+-										nbk--,subdomains[kl].ReferenceNumber=subdomains[kr].ReferenceNumber-1;
+-									  if(kr<0 && kl >=0 && subdomains[kl].ReferenceNumber>=0)
+-										nbk--,subdomains[kl].ReferenceNumber=-1;
+-									  if(kl<0 && kr >=0 && subdomains[kr].ReferenceNumber>=0)
+-										nbk--,subdomains[kr].ReferenceNumber=-1;
+-								  }
+-								 }
+-							long  j=0;
+-							for ( i=0;i<nbsubdomains;i++)
+-							 if((-subdomains[i].ReferenceNumber) %2) { // good 
+-								 if(i != j) 
+-								  Exchange(subdomains[i],subdomains[j]);
+-								 j++;}
+-							 else{ 
+-								 t= subdomains[i].head;
+-								 while (t){
+-									 nbtout++;
+-									 t1=t;
+-									 t=t->link;
+-									 t1->link=0;
+-								 }//while (t)
+-								}
+-							if(verbose>4) _printLine_("      Number of removes subdomains (OutSideMesh) = " << nbsubdomains-j);
+-							nbsubdomains=j;
+-						  }
+-
+-						delete []  mark; 
+-
+-			  }
+-			else
+-			  { // find the head for all sub domaine
+-				if (Gh.nbsubdomains != nbsubdomains && subdomains)
+-				 delete [] subdomains, subdomains=0;
+-				if (! subdomains  ) 
+-				 subdomains = new SubDomain[ Gh.nbsubdomains];
+-				nbsubdomains =Gh.nbsubdomains;
+-				long err=0;
+-				CreateSingleVertexToTriangleConnectivity();
+-				long * mark = new long[nbt];
+-				Edge **GeomEdgetoEdge = MakeGeomEdgeToEdge();
+-
+-				for (it=0;it<nbt;it++)
+-				 mark[it]=triangles[it].link ? -1 : -2;
+-				long inew =0;
+-				for (int i=0;i<nbsubdomains;i++) {
+-					GeomEdge &eg = *Gh.subdomains[i].edge;
+-					subdomains[i].ReferenceNumber = Gh.subdomains[i].ReferenceNumber;
+-					int ssdlab = subdomains[i].ReferenceNumber;
+-					// by carefull is not easy to find a edge create from a GeomEdge 
+-					// see routine MakeGeomEdgeToEdge
+-					Edge &e = *GeomEdgetoEdge[Gh.GetId(eg)];
+-					_assert_(&e);
+-					BamgVertex * v0 =  e(0),*v1 = e(1);
+-					Triangle *t  = v0->t;
+-					int direction = Gh.subdomains[i].direction;
+-					// test if ge and e is in the same direction 
+-					if (((eg[0].r-eg[1].r),(e[0].r-e[1].r))<0) direction = -direction ;
+-					subdomains[i].direction = direction;
+-					subdomains[i].edge = &e;
+-					_assert_(t && direction);
+-
+-					AdjacentTriangle  ta(t,EdgesVertexTriangle[v0->IndexInTriangle][0]);// previous edges
+-
+-					while (1) {
+-						_assert_(v0==ta.EdgeVertex(1));
+-						if (ta.EdgeVertex(0) == v1) { // ok we find the edge
+-							if (direction>0)  
+-							 subdomains[i].head=t=Adj(ta);
+-							else 
+-							 subdomains[i].head=t=ta;
+-							if(t<triangles || t >= triangles+nbt || t->det < 0 || t->link == 0) {
+-								_error2_("bad definition of SubSomain " << i);
+-							}
+-							long it = GetId(t);
+-							if (mark[it] >=0) {
+-								break;
+-							}
+-							if(i != inew) 
+-							 Exchange(subdomains[i],subdomains[inew]);
+-							inew++;
+-							Triangle *tt=t;
+-							long kkk=0;
+-							do 
+-							  {
+-								kkk++;
+-								if (mark[GetId(tt)]>=0){
+-									_error2_("mark[GetId(tt)]>=0");
+-								}
+-								mark[GetId(tt)]=i;
+-								tt=tt->link;
+-							  } while (tt!=t);
+-							break;
+-						}
+-						ta = Previous(Adj(ta));         
+-						if(t == (Triangle *) ta) {
+-							_error2_("bad definition of SubSomain " << i);
+-						}
+-					}
+-				}
+-
+-				if (inew < nbsubdomains) {
+-					if (verbose>5) _printLine_("WARNING: " << nbsubdomains-inew << " SubDomains are being removed");
+-					nbsubdomains=inew;}
+-
+-
+-					for (it=0;it<nbt;it++)
+-					 if ( mark[it] ==-1 ) 
+-					  nbtout++,triangles[it].link =0;
+-					delete [] GeomEdgetoEdge;
+-					delete [] mark;
+-
+-			  }
+-			nbtout=0;
+-			for (it=0;it<nbt;it++) 
+-			 if(!triangles[it].link)  nbtout++;
+-	}
+-	/*}}}*/
+-	/*FUNCTION 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  { 
+-		return t - triangles;
+-	}
+-	/*}}}*/
+-	/*FUNCTION 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  { 
+-		return t - vertices;
+-	}
+-	/*}}}*/
+-	/*FUNCTION 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  { 
+-		return t - edges;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::Init{{{*/
+-	void Mesh::Init(long maxnbv_in) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/PreInit)*/
+-
+-		/* initialize random seed: */
+-		srand(19999999);
+-
+-		/*Initialize fields*/
+-		NbRef=0;
+-		quadtree=NULL;
+-		nbv=0;
+-		nbt=0;
+-		nbe=0;
+-		edges=NULL;
+-		nbq=0;
+-		nbsubdomains=0;
+-		subdomains=NULL;
+-		maxnbv=maxnbv_in;
+-		maxnbt=2 *maxnbv_in-2;
+-		NbVertexOnBThVertex=0;
+-		VertexOnBThVertex=NULL;
+-		NbVertexOnBThEdge=0;
+-		VertexOnBThEdge=NULL;
+-		NbCrackedVertices=0;
+-		CrackedVertices =NULL;
+-		NbCrackedEdges =0;
+-		CrackedEdges =NULL;
+-		NbVerticesOnGeomVertex=0;
+-		VerticesOnGeomVertex=NULL;
+-		NbVerticesOnGeomEdge=0;
+-		VerticesOnGeomEdge=NULL;
+-
+-		/*Allocate if maxnbv_in>0*/
+-		if (maxnbv_in) {
+-			vertices=new BamgVertex[maxnbv];
+-			_assert_(vertices);
+-			orderedvertices=new (BamgVertex* [maxnbv]);
+-			_assert_(orderedvertices);
+-			triangles=new Triangle[maxnbt];
+-			_assert_(triangles);
+-		}
+-		else {
+-			vertices=NULL;
+-			orderedvertices=NULL;
+-			triangles=NULL;
+-			maxnbt=0;
+-		} 
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::Insert{{{*/
+-	void Mesh::Insert() {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Insert)*/
+-
+-		/*Insert points in the existing Geometry*/
+-
+-		//Intermediary
+-		int i;
+-
+-		/*Get options*/
+-		long int verbose=2;
+-
+-		//Display info
+-		if (verbose>2) _printLine_("   Insert initial " << nbv << " vertices");
+-
+-		//Compute integer coordinates for the existing vertices
+-		SetIntCoor();
+-
+-		/*Now we want to build a list (orderedvertices) of the vertices in a random
+-		 * order. To do so, we use the following method:
+-		 *
+-		 * From an initial k0 in [0 nbv[ random (vertex number)
+-		 * the next k (vertex number) is computed using a big
+-		 * prime number (PN>>nbv) following:
+-		 *
+-		 * k_{i+1} = k_i + PN  [nbv]
+-		 *
+-		 * let's show that:
+-		 *
+-		 *   for all j in [0 nbv[, ∃! i in [0 nbv[ such that k_i=j
+-		 *
+-		 * Let's assume that there are 2 distinct j1 and j2 such that
+-		 * k_j1 = k_j2
+-		 *
+-		 * This means that
+-		 *  
+-		 *  k0+j1*PN = k0+j2*PN [nbv]
+-		 *  (j1-j2)*PN =0       [nbv]
+-		 * since PN is a prime number larger than nbv, and nbv!=1
+-		 *  j1-j2=0             [nbv]
+-		 * BUT
+-		 *  j1 and j2 are in [0 nbv[ which is impossible.
+-		 *
+-		 *  We hence have built a random list of nbv elements of
+-		 *  [0 nbv[ all distincts*/
+-
+-		//Get Prime number
+-		const long PrimeNumber= BigPrimeNumber(nbv);
+-		int   k0=rand()%nbv; 
+-
+-		//Build orderedvertices
+-		for (i=0; i<nbv; i++){
+-			orderedvertices[i]=&vertices[k0=(k0+PrimeNumber)%nbv];
+-		}
+-
+-		/*Modify orderedvertices such that the first 3 vertices form a triangle*/
+-
+-		//get first vertex i such that [0,1,i] are not aligned
+-		for (i=2; det(orderedvertices[0]->i,orderedvertices[1]->i,orderedvertices[i]->i)==0;){
+-			//if i is higher than nbv, it means that all the determinants are 0,
+-			//all vertices are aligned!
+-			if  (++i>=nbv) _error2_("all the vertices are aligned");
+-		}
+-		// exchange i et 2 in "orderedvertices" so that
+-		// the first 3 vertices are not aligned (real triangle)
+-		Exchange(orderedvertices[2], orderedvertices[i]);
+-
+-		/*Take the first edge formed by the first two vertices and build
+-		 * the initial simple mesh from this edge and 2 boundary triangles*/
+-
+-		BamgVertex *v0=orderedvertices[0], *v1=orderedvertices[1];
+-
+-		nbt = 2;
+-		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;
+-
+-		//Build adjacence
+-		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 triangle: det = -1
+-		triangles[1].det = -1;  //boundary triangle: det = -1
+-
+-		triangles[0].SetSingleVertexToTriangleConnectivity();
+-		triangles[1].SetSingleVertexToTriangleConnectivity();
+-
+-		triangles[0].link=&triangles[1];
+-		triangles[1].link=&triangles[0];
+-
+-		//build quadtree
+-		if (!quadtree)  quadtree = new BamgQuadtree(this,0);
+-		quadtree->Add(*v0);
+-		quadtree->Add(*v1);
+-
+-		/*Now, add the vertices One by One*/
+-		long NbSwap=0;
+-		if (verbose>3) _printLine_("   Begining of insertion process...");
+-
+-		for (int icount=2; icount<nbv; icount++) {
+-
+-			//Get new vertex
+-			BamgVertex *newvertex=orderedvertices[icount];
+-
+-			//Find the triangle in which newvertex is located
+-			Icoor2 det3[3];
+-			Triangle* tcvi = TriangleFindFromCoord(newvertex->i,det3); //(newvertex->i = integer coordinates)
+-
+-			//Add newvertex to the quadtree
+-			quadtree->Add(*newvertex); 
+-
+-			//Add newvertex to the existing mesh
+-			AddVertex(*newvertex,tcvi,det3);
+-
+-			//Make the mesh Delaunay around newvertex by swaping the edges
+-			NbSwap += newvertex->Optim(1,0);
+-		}
+-
+-		//Display info
+-		if (verbose>3) {
+-			_printLine_("      NbSwap of insertion: " << NbSwap);
+-			_printLine_("      NbSwap/nbv:          " << NbSwap/nbv);
+-		}
+-
+-#ifdef NBLOOPOPTIM
+-
+-		k0 = rand()%nbv ; 
+-		for (int is4=0; is4<nbv; is4++) 
+-		 orderedvertices[is4]= &vertices[k0 = (k0 + PrimeNumber)% nbv];
+-
+-		for(int Nbloop=0;Nbloop<NBLOOPOPTIM;Nbloop++){
+-			long  NbSwap = 0;
+-			for (int is1=0; is1<nbv; is1++) 
+-			 NbSwap += orderedvertices[is1]->Optim(0,0);
+-			if (verbose>3) {
+-				_printLine_("      Optim Loop: " << Nbloop);
+-				_printLine_("      NbSwap/nbv:          " << NbSwap/nbv);
+-			}
+-			if(!NbSwap) break;
+-		}
+-		CreateSingleVertexToTriangleConnectivity(); 
+-		// because we break the TriangleContainingTheVertex
+-#endif
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::InsertNewPoints{{{*/
+-	long Mesh::InsertNewPoints(long nbvold,long & NbTSwap) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/InsertNewPoints)*/
+-
+-		long int verbose=0;
+-		double seuil= 1.414/2 ;// for two close point 
+-		long i;
+-		long NbSwap=0;
+-		Icoor2 det3[3];
+-
+-		//number of new points
+-		const long nbvnew=nbv-nbvold;
+-
+-		//display info if required
+-		if (verbose>5) _printLine_("      Try to Insert " << nbvnew << " new points");
+-
+-		//return if no new points
+-		if (!nbvnew) return 0; 
+-
+-		/*construction of a random order*/
+-		const long PrimeNumber= BigPrimeNumber(nbv)  ;
+-		//remainder of the division of rand() by nbvnew
+-		long k3 = rand()%nbvnew;
+-		//loop over the new points
+-		for (int is3=0; is3<nbvnew; is3++){
+-			register long j=nbvold +(k3 = (k3+PrimeNumber)%nbvnew);
+-			register long i=nbvold+is3; 
+-			orderedvertices[i]= vertices + j;
+-			orderedvertices[i]->ReferenceNumber=i;
+-		}
+-
+-		// for all the new point
+-		long iv=nbvold;
+-		for (i=nbvold;i<nbv;i++){
+-			BamgVertex &vi=*orderedvertices[i];
+-			vi.i=R2ToI2(vi.r);
+-			vi.r=I2ToR2(vi.i);
+-			double hx,hy;
+-			vi.m.Box(hx,hy);
+-			Icoor1 hi=(Icoor1) (hx*coefIcoor),hj=(Icoor1) (hy*coefIcoor);
+-			if (!quadtree->ToClose(vi,seuil,hi,hj)){
+-				// a good new point 
+-				BamgVertex &vj = vertices[iv];
+-				long  j=vj.ReferenceNumber; 
+-				if (&vj!=orderedvertices[j]){
+-					_error2_("&vj!= orderedvertices[j]");
+-				}
+-				if(i!=j){ 
+-					Exchange(vi,vj);
+-					Exchange(orderedvertices[j],orderedvertices[i]);
+-				}
+-				vj.ReferenceNumber=0; 
+-				Triangle *tcvj=TriangleFindFromCoord(vj.i,det3);
+-				if (tcvj && !tcvj->link){
+-					tcvj->Echo();
+-					_error2_("problem inserting point in InsertNewPoints (tcvj=" << tcvj << " and tcvj->link=" << tcvj->link << ")");
+-				}
+-				quadtree->Add(vj);
+-				AddVertex(vj,tcvj,det3);
+-				NbSwap += vj.Optim(1);          
+-				iv++;
+-			}
+-		} 
+-		if (verbose>3) {
+-			_printLine_("         number of new points: " << iv);
+-			_printLine_("         number of to close (?) points: " << nbv-iv);
+-			_printLine_("         number of swap after: " << NbSwap);
+-		}
+-		nbv = iv;
+-
+-		for (i=nbvold;i<nbv;i++) NbSwap += vertices[i].Optim(1);  
+-		if (verbose>3) _printLine_("   NbSwap=" << NbSwap);
+-
+-		NbTSwap +=  NbSwap ;
+-		return nbv-nbvold;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::isCracked{{{*/
+-	int Mesh::isCracked() const {
+-		return NbCrackedVertices != 0;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::MakeGeomEdgeToEdge{{{*/
+-	Edge** Mesh::MakeGeomEdgeToEdge() {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeGeomEdgeToEdge)*/
+-
+-		if (!Gh.nbe){
+-			_error2_("!Gh.nbe");
+-		}
+-		Edge **e= new (Edge* [Gh.nbe]);
+-
+-		long i;
+-		for ( i=0;i<Gh.nbe ; i++)
+-		 e[i]=NULL;
+-		for ( i=0;i<nbe ; i++) 
+-		  { 
+-			Edge * ei = edges+i;
+-			GeomEdge *GeomEdgeHook = ei->GeomEdgeHook; 
+-			e[Gh.GetId(GeomEdgeHook)] = ei;    
+-		  }
+-		for ( i=0;i<nbe ; i++) 
+-		 for (int ii=0;ii<2;ii++) { 
+-			 Edge * ei = edges+i;
+-			 GeomEdge *GeomEdgeHook = ei->GeomEdgeHook;
+-			 int j= ii;
+-			 while (!(*GeomEdgeHook)[j].Required()) { 
+-				 Adj(GeomEdgeHook,j); // next geom edge
+-				 j=1-j;
+-				 if (e[Gh.GetId(GeomEdgeHook)])  break; // optimisation
+-				 e[Gh.GetId(GeomEdgeHook)] = ei; 
+-			 }
+-		 }
+-
+-		int kk=0;
+-		for ( i=0;i<Gh.nbe ; i++){
+-			if (!e[i]){
+-				kk++;
+-				if(kk<10) _printLine_("BUG: the geometrical edge " << i << " is on no edge curve");
+-			}
+-		}
+-		if(kk) _error2_("See above");
+-
+-		return e;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::MakeQuadrangles{{{*/
+-	void Mesh::MakeQuadrangles(double costheta){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeQuadrangles)*/
+-
+-		long int verbose=0;
+-
+-		if (verbose>2) _printLine_("MakeQuadrangles costheta = " << costheta);
+-
+-		if (costheta >1) {
+-			if (verbose>5) _printLine_("   do nothing: costheta > 1");
+-		}
+-
+-
+-			long nbqq = (nbt*3)/2;
+-			DoubleAndInt *qq = new DoubleAndInt[nbqq];
+-
+-			long i,ij;
+-			int j;
+-			long k=0;
+-			for (i=0;i<nbt;i++)
+-			 for (j=0;j<3;j++)
+-			  if ((qq[k].q=triangles[i].QualityQuad(j))>=costheta)
+-				qq[k++].i3j=i*3+j;
+-			//  sort  qq
+-			HeapSort(qq,k);
+-
+-			long kk=0;
+-			for (ij=0;ij<k;ij++) { 
+-				i=qq[ij].i3j/3;
+-				j=(int) (qq[ij].i3j%3);
+-				// optisamition no float computation  
+-				if (triangles[i].QualityQuad(j,0) >=costheta) 
+-				 triangles[i].SetHidden(j),kk++;
+-			  }
+-			nbq = kk;
+-			if (verbose>2){
+-				_printLine_("   number of quadrilaterals    = " << nbq);
+-				_printLine_("   number of triangles         = " << nbt-nbtout- nbq*2);
+-				_printLine_("   number of outside triangles = " << nbtout);
+-			}
+-			delete [] qq;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::MakeBamgQuadtree{{{*/
+-	void Mesh::MakeBamgQuadtree() {  
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeBamgQuadtree)*/
+-
+-		long int verbose=0;
+-		if (  !quadtree )  quadtree = new BamgQuadtree(this);
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::MaxinalHmax{{{*/
+-	double Mesh::MaximalHmax() {
+-		return Max(pmax.x-pmin.x,pmax.y-pmin.y);
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::MaxSubDivision{{{*/
+-	void  Mesh::MaxSubDivision(double maxsubdiv) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/MaxSubDivision)*/
+-
+-		long int verbose=0;
+-
+-		const  double maxsubdiv2 = maxsubdiv*maxsubdiv;
+-		if(verbose>1) _printLine_("   Limit the subdivision of a edges in the new mesh by " << maxsubdiv);
+-		// for all the edges 
+-		// if the len of the edge is to long 
+-		long it,nbchange=0;    
+-		double lmax=0;
+-		for (it=0;it<nbt;it++){
+-			Triangle &t=triangles[it];
+-			for (int j=0;j<3;j++){
+-				Triangle &tt = *t.TriangleAdj(j);
+-				if ( ! &tt ||  it < GetId(tt) && ( tt.link || t.link)){
+-					BamgVertex &v0 = t[VerticesOfTriangularEdge[j][0]];
+-					BamgVertex &v1 = t[VerticesOfTriangularEdge[j][1]];
+-					R2 AB= (R2) v1-(R2) v0;
+-					Metric M = v0;
+-					double l = M(AB,AB);
+-					lmax = Max(lmax,l);
+-					if(l> maxsubdiv2){
+-					  R2 AC = M.Orthogonal(AB);// the ortogonal vector of AB in M
+-						double lc = M(AC,AC);
+-						D2xD2 Rt(AB,AC);// Rt.x = AB , Rt.y = AC;
+-						D2xD2 Rt1(Rt.inv());
+-						D2xD2 D(maxsubdiv2,0,0,lc);
+-						D2xD2 MM = Rt1*D*Rt1.t();
+-						v0.m =  M = Metric(MM.x.x,MM.y.x,MM.y.y);
+-						nbchange++;
+-					}
+-					M = v1;
+-					l = M(AB,AB);
+-					lmax = Max(lmax,l);
+-					if(l> maxsubdiv2){
+-					  R2 AC = M.Orthogonal(AB);// the ortogonal vector of AB in M
+-						double lc = M(AC,AC);
+-						D2xD2 Rt(AB,AC);// Rt.x = AB , Rt.y = AC;
+-						D2xD2 Rt1(Rt.inv());
+-						D2xD2 D(maxsubdiv2,0,0,lc);
+-						D2xD2  MM = Rt1*D*Rt1.t();
+-						v1.m =  M = Metric(MM.x.x,MM.y.x,MM.y.y);
+-						nbchange++;
+-					}
+-				}
+-			}
+-		}
+-		if(verbose>3){
+-			_printLine_("      number of metric changes = " << nbchange << ", maximum number of subdivision of a edges before change = " << pow(lmax,0.5));
+-		}
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::MetricAt{{{*/
+-	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);
+-		Icoor2 deta[3];
+-		Triangle * t =TriangleFindFromCoord(a,deta);
+-		if (t->det <0) { // outside
+-			double ba,bb;
+-			AdjacentTriangle edge= CloseBoundaryEdge(a,t,ba,bb) ;
+-			return Metric(ba,*edge.EdgeVertex(0),bb,*edge.EdgeVertex(1));}
+-		else { // inside
+-			double   aa[3];
+-			double s = deta[0]+deta[1]+deta[2];
+-			aa[0]=deta[0]/s;
+-			aa[1]=deta[1]/s;
+-			aa[2]=deta[2]/s;
+-			return Metric(aa,(*t)[0],(*t)[1],(*t)[2]);
+-		}
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::MininalHmin{{{*/
+-	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){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/NewPoints)*/
+-
+-		int i,j,k;
+-		long NbTSwap=0;
+-		long nbtold=nbt;
+-		long nbvold=nbv;
+-		long Headt=0;
+-		long next_t;
+-		long* first_np_or_next_t=new long[maxnbt];
+-		Triangle* t=NULL;
+-
+-		/*Recover options*/
+-		int verbose=bamgopts->verbose;
+-
+-		/*First, insert old points if requested*/
+-		if (KeepVertices && (&Bh != this) && (nbv+Bh.nbv< maxnbv)){
+-			if (verbose>5) _printLine_("         Inserting initial mesh points");
+-			for (i=0;i<Bh.nbv;i++){ 
+-				BamgVertex &bv=Bh[i];
+-				if (!bv.GeomEdgeHook){
+-					vertices[nbv].r   = bv.r;
+-					vertices[nbv++].m = bv.m;
+-				}
+-			}
+-			Bh.CreateSingleVertexToTriangleConnectivity();     
+-			InsertNewPoints(nbvold,NbTSwap)   ;            
+-		}  
+-		else Bh.CreateSingleVertexToTriangleConnectivity();     
+-
+-		// generation of the list of next Triangle 
+-		for(i=0;i<nbt;i++) first_np_or_next_t[i]=-(i+1);
+-		// the next traingle of i is -first_np_or_next_t[i]
+-
+-		// Big loop (most time consuming)
+-		int iter=0;
+-		if (verbose>5) _printLine_("         Big loop");
+-		do {
+-			/*Update variables*/
+-			iter++;
+-			nbtold=nbt;
+-			nbvold=nbv;
+-
+-			/*We test all triangles*/
+-			i=Headt;
+-			next_t=-first_np_or_next_t[i];
+-			for(t=&triangles[i];i<nbt;t=&triangles[i=next_t],next_t=-first_np_or_next_t[i]){
+-
+-				//check i
+-				if (i<0 || i>=nbt ){
+-					_error2_("Index problem in NewPoints (i=" << i << " not in [0 " << nbt-1 << "])");
+-				}
+-				//change first_np_or_next_t[i]
+-				first_np_or_next_t[i] = iter; 
+-
+-				//Loop over the edges of t
+-				for(j=0;j<3;j++){
+-					AdjacentTriangle tj(t,j);
+-					BamgVertex &vA = *tj.EdgeVertex(0);
+-					BamgVertex &vB = *tj.EdgeVertex(1);
+-
+-					//if t is a boundary triangle, or tj locked, continue
+-					if (!t->link)     continue;
+-					if (t->det <0)    continue;
+-					if (t->Locked(j)) continue;
+-
+-					AdjacentTriangle tadjj = t->Adj(j);	  
+-					Triangle* ta=tadjj;
+-
+-					//if the adjacent triangle is a boundary triangle, continur
+-					if (ta->det<0) continue;	  
+-
+-					R2 A=vA;
+-					R2 B=vB;
+-					k=GetId(ta);
+-
+-					//if this edge has already been done, go to next edge of triangle
+-					if(first_np_or_next_t[k]==iter) continue;
+-
+-					lIntTria.SplitEdge(Bh,A,B);
+-					lIntTria.NewPoints(vertices,nbv,maxnbv);
+-				  } // end loop for each edge 
+-			  }// for triangle   
+-
+-			if (!InsertNewPoints(nbvold,NbTSwap)) break;
+-			for (i=nbtold;i<nbt;i++) first_np_or_next_t[i]=iter;
+-			Headt = nbt; // empty list 
+-
+-			// for all the triangle containing the vertex i
+-			for (i=nbvold;i<nbv;i++){ 
+-				BamgVertex*          s  = vertices + i;
+-				AdjacentTriangle ta(s->t, EdgesVertexTriangle[s->IndexInTriangle][1]);
+-				Triangle*        tbegin= (Triangle*) ta;
+-				long kt;
+-				do { 
+-					kt = GetId((Triangle*) ta);
+-					if (first_np_or_next_t[kt]>0){
+-						first_np_or_next_t[kt]=-Headt;
+-						Headt=kt;
+-					}
+-					if (ta.EdgeVertex(0)!=s){
+-						_error2_("ta.EdgeVertex(0)!=s");
+-					}
+-					ta = Next(Adj(ta));
+-				} while ( (tbegin != (Triangle*) ta)); 
+-			}
+-
+-		} while (nbv!=nbvold);
+-
+-		delete []  first_np_or_next_t;
+-
+-		long NbSwapf =0,NbSwp;
+-
+-		NbSwp = NbSwapf;
+-		for (i=0;i<nbv;i++)
+-		 NbSwapf += vertices[i].Optim(0);
+-		NbTSwap +=  NbSwapf ;
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::ProjectOnCurve{{{*/
+-	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)*/
+-
+-		void *pA=0,*pB=0;
+-		double tA=0,tB=0;
+-		R2 A=vA,B=vB;
+-		BamgVertex * pvA=&vA, * pvB=&vB;
+-		if (vA.IndexInTriangle == IsVertexOnVertex){
+-			pA=vA.BackgroundVertexHook;
+-		}
+-		else if (vA.IndexInTriangle == IsVertexOnEdge){
+-			pA=vA.BackgroundEdgeHook->be;
+-			tA=vA.BackgroundEdgeHook->abcisse;
+-		}
+-		else {
+-			_error2_("ProjectOnCurve On BamgVertex " << BTh.GetId(vA) << " forget call to SetVertexFieldOnBTh");
+-		} 
+-
+-		if (vB.IndexInTriangle == IsVertexOnVertex){
+-			pB=vB.BackgroundVertexHook;
+-		}
+-		else if(vB.IndexInTriangle == IsVertexOnEdge){
+-			pB=vB.BackgroundEdgeHook->be;
+-			tB=vB.BackgroundEdgeHook->abcisse;
+-		}
+-		else {
+-			_error2_("ProjectOnCurve On BamgVertex " << BTh.GetId(vB) << " forget call to SetVertexFieldOnBTh");
+-		} 
+-		Edge * e = &BhAB;
+-		if (!pA || !pB || !e){
+-			_error2_("!pA || !pB || !e");
+-		}
+-		// be carefull the back ground edge e is on same geom edge 
+-		// of the initiale edge def by the 2 vertex A B;
+-		//check Is a background Mesh;   
+-		if (e<BTh.edges || e>=BTh.edges+BTh.nbe){
+-			_error2_("e<BTh.edges || e>=BTh.edges+BTh.nbe");
+-		}
+-		// walk on BTh edge 
+-		//not finish ProjectOnCurve with BackGround Mesh);
+-		// 1 first find a back ground edge contening the vertex A
+-		// 2 walk n back gound boundary to find the final vertex B
+-
+-		if( vA.IndexInTriangle == IsVertexOnEdge) 
+-		  { // find the start edge 
+-			e = vA.BackgroundEdgeHook->be;	 
+-
+-		  } 
+-		else if (vB.IndexInTriangle == IsVertexOnEdge) 
+-		  {
+-			theta = 1-theta;
+-			Exchange(tA,tB);
+-			Exchange(pA,pB);
+-			Exchange(pvA,pvB);
+-			Exchange(A,B);
+-			e =  vB.BackgroundEdgeHook->be;
+-
+-		  } 
+-		else{ // do the search by walking 
+-			_error2_("case not supported yet");
+-		  }
+-
+-		// find the direction of walking with direction of edge and pA,PB;
+-		R2 AB=B-A;
+-
+-		double cosE01AB = (( (R2) (*e)[1] - (R2) (*e)[0] ) , AB);
+-		int kkk=0;
+-		int direction = (cosE01AB>0) ? 1 : 0;
+-
+-		//   double l=0; // length of the edge AB
+-		double abscisse = -1;
+-
+-		for (int step=0;step<2;step++){
+-			// 2 times algo:
+-			//    1 for computing the length l
+-			//    2 for find the vertex 
+-			int  iii;
+-			BamgVertex  *v0=pvA,*v1; 
+-			Edge *neee,*eee;
+-			double lg =0; // length of the curve 
+-			double te0;
+-			// we suppose take the curve's abcisse 
+-			for ( eee=e,iii=direction,te0=tA;
+-						eee && ((( void*) eee) != pB) && (( void*) (v1=&((*eee)[iii]))) != pB ;
+-						neee = eee->adj[iii],iii = 1-neee->Intersection(*eee),eee = neee,v0=v1,te0=1-iii ) { 
+-
+-				kkk=kkk+1;
+-				_assert_(kkk<100);
+-				_assert_(eee);
+-				double lg0 = lg;
+-				double dp = LengthInterpole(v0->m,v1->m,(R2) *v1 - (R2) *v0);
+-				lg += dp;
+-				if (step && abscisse <= lg) { // ok we find the geom edge 
+-					double sss  =   (abscisse-lg0)/dp;
+-					double thetab = te0*(1-sss)+ sss*iii;
+-					_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)
+-				 tB = iii;
+-
+-				double lg0 = lg;
+-				_assert_(eee);
+-				v1 = pvB;
+-				double dp = LengthInterpole(v0->m,v1->m,(R2) *v1 - (R2) *v0);
+-				lg += dp;	
+-				abscisse = lg*theta;
+-				if (abscisse <= lg && abscisse >= lg0 ) // small optimisation we know the lenght because end
+-				  { // ok we find the geom edge 
+-					double sss  =   (abscisse-lg0)/dp;
+-					double thetab = te0*(1-sss)+ sss*tB;
+-					_assert_(thetab>=0 && thetab<=1);
+-					BR = VertexOnEdge(&R,eee,thetab);
+-					return  Gh.ProjectOnCurve(*eee,thetab,R,GR);
+-				  }
+-			  }
+-			abscisse = lg*theta;
+-
+-		  }
+-		_error2_("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)*/
+-
+-	/*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;
+-
+-	// generation of the integer coordinate
+-
+-	// find extrema coordinates of vertices pmin,pmax
+-	long i;
+-	if(verbose>2) _printLine_("      Reconstruct mesh of " << nbv << " vertices"); 
+-
+-	//initialize orderedvertices
+-	_assert_(orderedvertices);
+-	for (i=0;i<nbv;i++) orderedvertices[i]=0;
+-
+-	//Initialize nbsubdomains
+-	nbsubdomains =0;
+-
+-	/* 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){ 
+-		_error2_("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 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);
+-
+-			//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)));
+-
+-				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]; 
+-			}
+-
+-			//An edge belongs to 2 triangles
+-			else {
+-				_error2_("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) {
+-		_printLine_("         info of Mesh:");
+-		_printLine_("            - number of vertices    = " << nbv << " "); 
+-		_printLine_("            - number of triangles   = " << nbt << " "); 
+-		_printLine_("            - number of given edges = " << nbe << " "); 
+-		_printLine_("            - number of all edges   = " << edge4->nb()); 
+-		_printLine_("            - Euler number 1 - nb of holes = " << nbt-edge4->nb()+nbv); 
+-	}
+-
+-	//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
+-					_printLine_("Lost boundary edges " << i << " : " << edge4->i(i) << " " << edge4->j(i));
+-				}
+-				else if (k==10){
+-					_printLine_("Other lost boundary edges not shown...");
+-				}
+-			}
+-		}
+-	}
+-	if(k) {
+-		_error2_(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];
+-	}
+-
+-	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;
+-
+-	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) {
+-		 _error2_("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];
+-
+-	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[0].det = -1;  // boundary triangles
+-	triangles[1].det = -1;  // boundary triangles
+-
+-	triangles[0].SetSingleVertexToTriangleConnectivity();
+-	triangles[1].SetSingleVertexToTriangleConnectivity();
+-
+-	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);
+-
+-	// 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++;
+-			}
+-		}
+-	}
+-	if(nbloss) {
+-		_error2_("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);
+-
+-					_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;
+-		}
+-		else{
+-			triangles[i].color= savenbt+ NbTfillHoll++;
+-		}
+-	}
+-	_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++;
+-		}
+-	}
+-	// 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) {
+-		_error2_("number of triangles edges alone = " << k);
+-	}
+-	FindSubDomain();
+-
+-	delete edge4;
+-	delete [] st;
+-	for (i=0;i<nbv;i++) quadtree->Add(vertices[i]);
+-
+-	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()){
+-						_printLine_("ReconstructExistingMesh error message: problem with the edge number " << i+1 << ": [" << GetId(edges[i][0])+1 << " " << GetId(edges[i][1])+1 << "]");
+-						_printLine_("This edge is on geometrical edge number " << Gh.GetId(edges[i].GeomEdgeHook)+1);
+-						if (edges[i][j].GeomEdgeHook->OnGeomVertex())
+-						 _printLine_("the vertex number " << GetId(edges[i][j])+1 << " of this edge is a geometric BamgVertex number " << Gh.GetId(edges[i][j].GeomEdgeHook->gv)+1);
+-						else if (edges[i][j].GeomEdgeHook->OnGeomEdge())
+-						 _printLine_("the vertex number " << GetId(edges[i][j])+1 << " of this edge is a geometric Edge number " << Gh.GetId(edges[i][j].GeomEdgeHook->ge)+1);
+-						else
+-						 _printLine_("Its pointer is " << edges[i][j].GeomEdgeHook);
+-
+-						_printLine_("This edge is on geometry and has no adjacent edge (open curve) and one of the tip is not required");
+-						_error2_("See above (might be cryptic...)");
+-					}
+-				}
+-			}
+-		}
+-	}
+-}
+-/*}}}*/
+-	/*FUNCTION Mesh::TrianglesRenumberBySubDomain{{{*/
+-	void Mesh::TrianglesRenumberBySubDomain(bool justcompress){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ReNumberingTheTriangleBySubDomain)*/
+-
+-		long int verbose=0;
+-		long *renu= new long[nbt];
+-		register Triangle *t0,*t,*te=triangles+nbt;
+-		register long k=0,it,i,j;
+-
+-		for ( it=0;it<nbt;it++) 
+-		 renu[it]=-1; // outside triangle 
+-		for ( i=0;i<nbsubdomains;i++)
+-		  { 
+-			t=t0=subdomains[i].head;
+-			if (!t0){ // not empty sub domain
+-				_error2_("!t0");
+-			}
+-			do { 
+-				long kt = GetId(t);
+-				if (kt<0 || kt >= nbt ){
+-					_error2_("kt<0 || kt >= nbt");
+-				}
+-				if (renu[kt]!=-1){
+-					_error2_("renu[kt]!=-1");
+-				}
+-				renu[kt]=k++;
+-			}
+-			while (t0 != (t=t->link));
+-		  }
+-		// take is same numbering if possible    
+-		if(justcompress)
+-		 for ( k=0,it=0;it<nbt;it++) 
+-		  if(renu[it] >=0 ) 
+-			renu[it]=k++;
+-
+-		// put the outside triangles at the end
+-		for ( it=0;it<nbt;it++){
+-			if (renu[it]==-1) renu[it]=k++;
+-		}
+-		if (k != nbt){
+-			_error2_("k != nbt");
+-		}
+-		// do the change on all the pointeur 
+-		for ( it=0;it<nbt;it++)
+-		 triangles[it].Renumbering(triangles,te,renu);
+-
+-		for ( i=0;i<nbsubdomains;i++)
+-		 subdomains[i].head=triangles+renu[GetId(subdomains[i].head)];
+-
+-		// move the Triangles  without a copy of the array 
+-		// be carefull not trivial code 
+-		for ( it=0;it<nbt;it++) // for all sub cycles of the permutation renu
+-		 if (renu[it] >= 0) // a new sub cycle
+-			{ 
+-			 i=it;
+-			 Triangle ti=triangles[i],tj;
+-			 while ( (j=renu[i]) >= 0) 
+-				{ // i is old, and j is new 
+-				 renu[i] = -1; // mark 
+-				 tj = triangles[j]; // save new
+-				 triangles[j]= ti; // new <- old
+-				 i=j;     // next 
+-				 ti = tj;
+-				}  
+-			}
+-		delete [] renu;
+-
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::VerticesRenumber{{{*/
+-	void Mesh::VerticesRenumber(long * renu) {
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ReNumberingVertex)*/
+-
+-		// warning be carfull because pointer
+-		// from on mesh to over mesh 
+-		//  --  so do ReNumbering at the beginning
+-		BamgVertex * ve = vertices+nbv;
+-		long it,ie,i;
+-
+-		_printLine_("renumbering triangles");
+-		for ( it=0;it<nbt;it++) 
+-		 triangles[it].Renumbering(vertices,ve,renu);
+-
+-		_printLine_("renumbering edges");
+-		for ( ie=0;ie<nbe;ie++) 
+-		 edges[ie].Renumbering(vertices,ve,renu);
+-
+-		_printLine_("renumbering vertices on geom");
+-		for (i=0;i< NbVerticesOnGeomVertex;i++)
+-		  {
+-			BamgVertex *v = VerticesOnGeomVertex[i].meshvertex;
+-			if (v>=vertices && v < ve)
+-			 VerticesOnGeomVertex[i].meshvertex=vertices+renu[GetId(v)];
+-		  }
+-
+-		_printLine_("renumbering vertices on edge");
+-		for (i=0;i< NbVerticesOnGeomEdge;i++)
+-		  {
+-			BamgVertex *v =VerticesOnGeomEdge[i].meshvertex;
+-			if (v>=vertices && v < ve)
+-			 VerticesOnGeomEdge[i].meshvertex=vertices+renu[GetId(v)];
+-		  }
+-
+-		_printLine_("renumbering vertices on Bth vertex");
+-		for (i=0;i< NbVertexOnBThVertex;i++)
+-		  {
+-			BamgVertex *v=VertexOnBThVertex[i].v;
+-			if (v>=vertices && v < ve)
+-			 VertexOnBThVertex[i].v=vertices+renu[GetId(v)];
+-		  }
+-
+-		for (i=0;i< NbVertexOnBThEdge;i++)
+-		  {
+-			BamgVertex *v=VertexOnBThEdge[i].v;
+-			if (v>=vertices && v < ve)
+-			 VertexOnBThEdge[i].v=vertices+renu[GetId(v)];
+-		  }
+-
+-		// move the Vertices without a copy of the array 
+-		// be carefull not trivial code 
+-		long j;
+-		for ( it=0;it<nbv;it++) // for all sub cycles of the permutation renu
+-		 if (renu[it] >= 0) // a new sub cycle
+-			{ 
+-			 i=it;
+-			 BamgVertex ti=vertices[i],tj;
+-			 while ( (j=renu[i]) >= 0){
+-				 // i is old, and j is new 
+-				 renu[i] = -1-renu[i]; // mark 
+-				 tj = vertices[j];     // save new
+-				 vertices[j]= ti;      // new <- old
+-				 i=j;     // next 
+-				 ti = tj;
+-				}  
+-			}
+-		if (quadtree){
+-			delete quadtree;
+-			quadtree = new BamgQuadtree(this);
+-		}
+-
+-		for ( it=0;it<nbv;it++) renu[i]= -renu[i]-1;
+-	}
+-	/*}}}*/
+-/*FUNCTION Mesh::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*/
+-
+-	//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){
+-		_error2_("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);    
+-	}
+-
+-	// 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 ){
+-
+-			/*Compute determinant*/
+-			triangles[i].det= det(v0,v1,v2);
+-
+-			/*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){
+-					_printLine_("Area of Triangle " << i+1 << " < 0 (det=" << triangles[i].det << ")");
+-				}
+-			}
+-		}
+-
+-		//else, set as -1
+-		else triangles[i].det=-1;
+-	}
+-
+-	if (number_of_errors) _error2_("Fatal error: some triangles have negative areas, see above");
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::ShowRegulaty{{{*/
+-void  Mesh::ShowRegulaty() const {
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr>*/
+-
+-	const  double  sqrt32=sqrt(3.)*0.5; 
+-	const double  aireKh=sqrt32*0.5;
+-	D2  Beq(1,0),Heq(0.5,sqrt32);
+-	D2xD2 Br(D2xD2(Beq,Heq).t());
+-	D2xD2 B1r(Br.inv());
+-	double gammamn=1e100,hmin=1e100;
+-	double gammamx=0,hmax=0;
+-	double beta=1e100;
+-	double beta0=0;
+-	double  alpha2=0;
+-	double area=0,Marea=0;
+-	// double cf= double(coefIcoor);
+-	// double cf2= 6.*cf*cf;
+-	int nt=0;
+-	for (int it=0;it<nbt;it++)
+-	 if ( triangles[it].link){
+-		 Triangle &K=triangles[it];
+-		 double  area3= Area2((R2) K[0],(R2) K[1],(R2) K[2])/6.;
+-		 area+= area3;
+-		 D2xD2 B_Kt(K[0],K[1],K[2]);
+-		 D2xD2 B_K(B_Kt.t());
+-		 D2xD2 B1K = Br*B_K.inv();
+-		 D2xD2 BK =  B_K*B1r;
+-		 D2xD2 B1B1 = B1K.t()*B1K;
+-		 Metric MK(B1B1.x.x,B1B1.x.y,B1B1.y.y);
+-		 EigenMetric VMK(MK);
+-		 alpha2 = Max(alpha2,Max(VMK.lambda1/VMK.lambda2,VMK.lambda2/VMK.lambda1));
+-		 double betaK=0;
+-
+-		 for (int j=0;j<3;j++)
+-			{
+-			 double he= Norme2(R2(K[j],K[(j+1)%3]));
+-			 hmin=Min(hmin,he);
+-			 hmax=Max(hmax,he);
+-			 BamgVertex & v=K[j];
+-			 D2xD2 M((Metric)v);
+-			 betaK += sqrt(M.det());
+-
+-			 D2xD2 BMB = BK.t()*M*BK;
+-			 Metric M1(BMB.x.x,BMB.x.y,BMB.y.y);
+-			 EigenMetric VM1(M1);
+-			 gammamn=Min3(gammamn,VM1.lambda1,VM1.lambda2);
+-			 gammamx=Max3(gammamx,VM1.lambda1,VM1.lambda2);		
+-			}
+-		 betaK *= area3;//  1/2 (somme sqrt(det))* area(K)
+-		 Marea+= betaK;
+-		 beta=min(beta,betaK);
+-		 beta0=max(beta0,betaK);
+-		}   
+-	area*=3; 
+-	gammamn=sqrt(gammamn);
+-	gammamx=sqrt(gammamx);    
+-	_printLine_("   Adaptmesh info:");
+-	_printLine_("      number of triangles = " << nt);
+-	_printLine_("      hmin = " << hmin << ", hmax=" << hmax);
+-	_printLine_("      area = " << area << ", M area = " << Marea << ", M area/( |Khat| nt) = " <<  Marea/(aireKh*nt));
+-	_printLine_("      infinite-regularity(?): min = " << gammamn << ", max = " << gammamx);
+-	_printLine_("      anisomax = " << pow(alpha2,0.5) << ", beta max = " << 1./pow(beta/aireKh,0.5) << ", min = " << 1./pow(beta0/aireKh,0.5));
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::ShowHistogram{{{*/
+-void  Mesh::ShowHistogram() const {
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ShowHistogram)*/
+-
+-	const long kmax=10;
+-	const double llmin = 0.5,llmax=2;
+-	const double lmin=log(llmin),lmax=log(llmax),delta= kmax/(lmax-lmin);
+-	long histo[kmax+1];
+-	long i,it,k, nbedges =0;
+-	for (i=0;i<=kmax;i++) histo[i]=0;
+-	for (it=0;it<nbt;it++)
+-	 if ( triangles[it].link) 
+-		{
+-
+-		 for (int j=0;j<3;j++)
+-			{
+-			 Triangle *ta = triangles[it].TriangleAdj(j);
+-			 if ( !ta || !ta->link || GetId(ta) >= it) 
+-				{ 
+-				 BamgVertex & vP = triangles[it][VerticesOfTriangularEdge[j][0]];
+-				 BamgVertex & vQ = triangles[it][VerticesOfTriangularEdge[j][1]];
+-				 if ( !& vP || !&vQ) continue;
+-				 R2 PQ = vQ.r - vP.r;
+-				 double l = log(LengthInterpole(vP,vQ,PQ));
+-				 nbedges++;
+-				 k = (int) ((l - lmin)*delta);
+-				 k = Min(Max(k,0L),kmax);
+-				 histo[k]++;
+-				}
+-			}
+-		}  
+-	_printLine_(" --- Histogram of the unit mesh,  nb of edges = " << nbedges);
+-	_printLine_("      length of edge in   | %% of edge  | Nb of edges "); 
+-	_printLine_("      --------------------+-------------+-------------"); 
+-	for   (i=0;i<=kmax;i++){ 
+-		if (i==0) _printString_( "      " << setw(10) << 0.);
+-		else      _printString_( "      " << setw(10) << exp(lmin+i/delta));
+-		if (i==kmax) _printString_("          +inf   ");
+-		else      _printString_( "      " << setw(10) << exp(lmin+(i+1)/delta));
+-		_printLine_("|  " << setw(10) << (long((10000. * histo[i])/ nbedges)/100.) << " |");
+-		_printLine_("  " << histo[i]);
+-	}
+-	_printLine_("      --------------------+-------------+-------------"); 
+-}
+-/*}}}*/
+-/*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) _printLine_("   SmoothingVertex: nb Iteration = " << nbiter << ", Omega=" << omega);
+-	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) _printLine_("      move max = " << pow(delta,0.5) << ", iteration = " << k << ", nb of swap = " << NbSwap);
+-	  }
+-
+-	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)*/
+-
+-	long int verbose=0;
+-
+-	if(raisonmax<1.1) return;
+-	if(verbose > 1) _printLine_("   Mesh::SmoothMetric raisonmax = " << raisonmax);
+-	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
+-			register Triangle* t= vertices[i].t;
+-			if (!t){
+-				_error2_("!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)){
+-					_error2_("vertices+i != ta.EdgeVertex(1)");
+-				}
+-				BamgVertex & vj = *(ta.EdgeVertex(0));
+-				if ( &vj ) {
+-					j= &vj-vertices;
+-					if (j<0 || j >= nbv){
+-						_error2_("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 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;
+-			}
+-		}
+-		Head0 = Head1;
+-		Head1 = -1;
+-		Exchange(first_np_or_next_t0,first_np_or_next_t1);
+-	}
+-	if(verbose>2) _printLine_("      number of iterations = " << kch); 
+-	delete [] first_np_or_next_t0;
+-	delete [] first_np_or_next_t1;
+-}
+-/*}}}*/
+-	/*FUNCTION Mesh::SplitElement{{{*/
+-	int  Mesh::SplitElement(int choice){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshQuad.cpp/SplitElement)*/
+-
+-		long int verbose=0;
+-
+-		Direction NoDirOfSearch;
+-		const  int withBackground = &BTh != this && &BTh;
+-
+-		TrianglesRenumberBySubDomain();
+-		//int nswap =0;
+-		const long nfortria( choice ? 4 : 6);
+-		if(withBackground) 
+-		  {
+-			BTh.SetVertexFieldOn();
+-			SetVertexFieldOnBTh();
+-		  }
+-		else
+-		 BTh.SetVertexFieldOn();
+-
+-		long newnbt=0,newnbv=0;
+-		long * kedge = 0;
+-		long newnbq=nbq;
+-		long * ksplit= 0, * ksplitarray=0;
+-		long kkk=0;
+-		int ret =0;
+-		if (maxnbv<nbv+nbe) return 1;//   
+-		// 1) create  the new points by spliting the internal edges 
+-		// set the 
+-		long nbvold = nbv;
+-		long nbtold = nbt;
+-		long nbtoutold  = nbtout;
+-		long  NbEdgeOnGeom=0;
+-		long i;
+-
+-		nbt = nbt - nbtout; // remove all the  the ouside triangles 
+-		long nbtsave = nbt;
+-		Triangle * lastT = triangles + nbt;
+-		for (i=0;i<nbe;i++)
+-		 if(edges[i].GeomEdgeHook) NbEdgeOnGeom++;
+-		long newnbe=nbe+nbe;
+-		//  long newNbVerticesOnGeomVertex=NbVerticesOnGeomVertex;
+-		long newNbVerticesOnGeomEdge=NbVerticesOnGeomEdge+NbEdgeOnGeom;
+-		// long newNbVertexOnBThVertex=NbVertexOnBThVertex;
+-		long newNbVertexOnBThEdge=withBackground ? NbVertexOnBThEdge+NbEdgeOnGeom:0;
+-
+-		// do allocation for pointeur to the geometry and background
+-		VertexOnGeom * newVerticesOnGeomEdge = new VertexOnGeom[newNbVerticesOnGeomEdge];
+-		VertexOnEdge *newVertexOnBThEdge = newNbVertexOnBThEdge ?  new VertexOnEdge[newNbVertexOnBThEdge]:0;
+-		if (NbVerticesOnGeomEdge)
+-		 memcpy(newVerticesOnGeomEdge,VerticesOnGeomEdge,sizeof(VertexOnGeom)*NbVerticesOnGeomEdge);
+-		if (NbVertexOnBThEdge)
+-		 memcpy(newVertexOnBThEdge,VertexOnBThEdge,sizeof(VertexOnEdge)*NbVertexOnBThEdge);
+-		Edge *newedges = new Edge [newnbe];
+-		//  memcpy(newedges,edges,sizeof(Edge)*nbe);
+-		SetOfEdges4 * edge4= new SetOfEdges4(nbe,nbv);
+-		long k=nbv;
+-		long kk=0;
+-		long kvb = NbVertexOnBThEdge;
+-		long kvg = NbVerticesOnGeomEdge;
+-		long ie =0;
+-		Edge ** edgesGtoB=0;
+-		if (withBackground)
+-		 edgesGtoB= BTh.MakeGeomEdgeToEdge();
+-		long ferr=0;
+-		for (i=0;i<nbe;i++)
+-		 newedges[ie].GeomEdgeHook=0;
+-
+-		for (i=0;i<nbe;i++)
+-		  {
+-			GeomEdge *ong =  edges[i].GeomEdgeHook;
+-
+-			newedges[ie]=edges[i];
+-			newedges[ie].adj[0]=newedges+(edges[i].adj[0]-edges) ;
+-			newedges[ie].adj[1]=newedges + ie +1;
+-			R2 A = edges[i][0],B = edges[i][1];
+-
+-
+-			kk += (i == edge4->SortAndAdd(GetId(edges[i][0]),GetId(edges[i][1])));
+-			if (ong) // a geometrical edges 
+-			  { 
+-				if (withBackground){
+-					// walk on back ground mesh 
+-					//  newVertexOnBThEdge[ibe++] = VertexOnEdge(vertices[k],bedge,absicsseonBedge); 
+-					// a faire -- difficile 
+-					// the first PB is to now a background edge between the 2 vertices
+-					if (!edgesGtoB){
+-						_error2_("!edgesGtoB");
+-					}
+-					ong= ProjectOnCurve(*edgesGtoB[Gh.GetId(edges[i].GeomEdgeHook)],
+-								edges[i][0],edges[i][1],0.5,vertices[k],
+-								newVertexOnBThEdge[kvb],
+-								newVerticesOnGeomEdge[kvg++]);
+-					vertices[k].ReferenceNumber= edges[i].ReferenceNumber;
+-					vertices[k].DirOfSearch =   NoDirOfSearch;        
+-					;
+-					// get the Info on background mesh 
+-					double s =        newVertexOnBThEdge[kvb];
+-					BamgVertex &  bv0  = newVertexOnBThEdge[kvb][0];
+-					BamgVertex &  bv1  = newVertexOnBThEdge[kvb][1];
+-					// compute the metrix of the new points 
+-					vertices[k].m =  Metric(1-s,bv0,s,bv1); 
+-					kvb++;
+-				  }
+-				else 
+-				  {
+-					ong=Gh.ProjectOnCurve(edges[i],
+-								0.5,vertices[k],newVerticesOnGeomEdge[kvg++]);
+-					// vertices[k].i = R2ToI2( vertices[k].r);
+-					vertices[k].ReferenceNumber = edges[i].ReferenceNumber;
+-					vertices[k].DirOfSearch = NoDirOfSearch;
+-					vertices[k].m =  Metric(0.5,edges[i][0],0.5,edges[i][1]);	      
+-				  }  
+-			  }
+-			else // straigth line edge ---
+-			  { 
+-				vertices[k].r = ((R2) edges[i][0] + (R2)  edges[i][1] )*0.5;
+-				vertices[k].m =  Metric(0.5,edges[i][0],0.5,edges[i][1]);
+-				vertices[k].GeomEdgeHook = 0;
+-			  }
+-			//vertices[k].i = R2ToI2( vertices[k].r);
+-			R2 AB =  vertices[k].r;
+-			R2 AA = (A+AB)*0.5;
+-			R2 BB = (AB+B)*0.5;
+-			vertices[k].ReferenceNumber = edges[i].ReferenceNumber;
+-			vertices[k].DirOfSearch = NoDirOfSearch;
+-
+-			newedges[ie].GeomEdgeHook = Gh.Containing(AA,ong);
+-			newedges[ie++].v[1]=vertices+k;
+-
+-			newedges[ie]=edges[i];
+-			newedges[ie].adj[0]=newedges + ie -1;
+-			newedges[ie].adj[1]=newedges+(edges[i].adj[1]-edges) ;
+-			newedges[ie].GeomEdgeHook =  Gh.Containing(BB,ong);
+-			newedges[ie++].v[0]=vertices+k;
+-			k++;
+-		  }
+-		if (edgesGtoB) delete [] edgesGtoB;
+-		edgesGtoB=0;
+-
+-		newnbv=k;
+-		newNbVerticesOnGeomEdge=kvg;
+-		if (newnbv> maxnbv) goto Error;// bug 
+-
+-		nbv = k;
+-
+-
+-		kedge = new long[3*nbt+1];
+-		ksplitarray = new long[nbt+1];
+-		ksplit = ksplitarray +1; // because ksplit[-1] == ksplitarray[0]
+-
+-		for (i=0;i<3*nbt;i++)
+-		 kedge[i]=-1;
+-
+-		//  
+-
+-		for (i=0;i<nbt;i++) {
+-			Triangle & t = triangles[i];
+-			if (!t.link){
+-				_error2_("!t.link");
+-			}
+-			for(int j=0;j<3;j++)
+-			  {
+-				const AdjacentTriangle ta = t.Adj(j);
+-				const Triangle & tt = ta;
+-				if (&tt >= lastT)
+-				 t.SetAdj2(j,0,0);// unset adj
+-				const BamgVertex & v0 = t[VerticesOfTriangularEdge[j][0]];
+-				const BamgVertex & v1 = t[VerticesOfTriangularEdge[j][1]];
+-				long  ke =edge4->SortAndFind(GetId(v0),GetId(v1));
+-				if (ke>0) 
+-				  {
+-					long ii = GetId(tt);
+-					int  jj = ta;
+-					long ks = ke + nbvold;
+-					kedge[3*i+j] = ks;
+-					if (ii<nbt) // good triangle
+-					 kedge[3*ii+jj] = ks;
+-					BamgVertex &A=vertices[ks];
+-					double aa,bb,cc,dd;
+-					if ((dd=Area2(v0.r,v1.r,A.r)) >=0){
+-						// warning PB roundoff error 
+-						if (t.link && ( (aa=Area2( A.r    , t[1].r , t[2].r )) < 0.0 
+-										||   (bb=Area2( t[0].r , A.r    , t[2].r )) < 0.0  
+-										||   (cc=Area2( t[0].r , t[1].r , A.r    )) < 0.0)){
+-							_printLine_(ke + nbvold << " not in triangle " << i << " In= " << !!t.link << " " << aa << " " << bb << " " << cc << " " << dd);
+-							_error2_("Number of triangles with P2 interpolation Problem");
+-						}
+-					}
+-					else {
+-						if (tt.link && ( (aa=Area2( A.r     , tt[1].r , tt[2].r )) < 0 
+-										||   (bb=Area2( tt[0].r , A.r     , tt[2].r )) < 0 
+-										||   (cc=Area2( tt[0].r , tt[1].r , A.r     )) < 0)){
+-							_printLine_(ke + nbvold << " not in triangle " << ii << " In= " << !!tt.link << " " << aa << " " << bb << " " << cc << " " << dd);
+-							_error2_("Number of triangles with P2 interpolation Problem");
+-						}
+-					} 
+-				  }
+-			  }
+-		}
+-
+-		for (i=0;i<nbt;i++){
+-			ksplit[i]=1; // no split by default
+-			const Triangle & t = triangles[ i];
+-			int nbsplitedge =0;
+-			int nbinvisible =0;
+-			int invisibleedge=0;
+-			int kkk[3];      
+-			for (int j=0;j<3;j++)
+-			  {
+-				if (t.Hidden(j)) invisibleedge=j,nbinvisible++;
+-
+-				const AdjacentTriangle ta = t.Adj(j);
+-				const Triangle & tt = ta;
+-
+-
+-				const BamgVertex & v0 = t[VerticesOfTriangularEdge[j][0]];
+-				const BamgVertex & v1 = t[VerticesOfTriangularEdge[j][1]];
+-				if ( kedge[3*i+j] < 0) 
+-				  {
+-					long  ke =edge4->SortAndFind(GetId(v0),GetId(v1));
+-					if (ke<0) // new 
+-					  {
+-						if (&tt) // internal triangles all the boundary 
+-						  { // new internal edges 
+-							long ii = GetId(tt);
+-							int  jj = ta;
+-
+-							kedge[3*i+j]=k;// save the vertex number 
+-							kedge[3*ii+jj]=k;
+-							if (k<maxnbv) 
+-							  {
+-								vertices[k].r = ((R2) v0+(R2) v1 )/2;
+-								//vertices[k].i = R2ToI2( vertices[k].r);
+-								vertices[k].ReferenceNumber=0;
+-								vertices[k].DirOfSearch =NoDirOfSearch;
+-								vertices[k].m =  Metric(0.5,v0,0.5,v1);
+-							  }
+-							k++;
+-							kkk[nbsplitedge++]=j;		      
+-						  } // tt 
+-						else
+-						 _error2_("Bug...");
+-					  } // ke<0	       
+-					else
+-					  { // ke >=0
+-						kedge[3*i+j]=nbvold+ke;
+-						kkk[nbsplitedge++]=j;// previously splited
+-					  }
+-				  }
+-				else 
+-				 kkk[nbsplitedge++]=j;// previously splited
+-
+-			  } 
+-			if (nbinvisible>=2){
+-				_error2_("nbinvisible>=2");
+-			}
+-			switch (nbsplitedge) {
+-				case 0: ksplit[i]=10; newnbt++; break;   // nosplit
+-				case 1: ksplit[i]=20+kkk[0];newnbt += 2; break; // split in 2 
+-				case 2: ksplit[i]=30+3-kkk[0]-kkk[1];newnbt += 3; break; // split in 3 
+-				case 3:
+-						  if (nbinvisible) ksplit[i]=40+invisibleedge,newnbt += 4;
+-						  else   ksplit[i]=10*nfortria,newnbt+=nfortria;
+-						  break;
+-			} 
+-			if (ksplit[i]<40){
+-				_error2_("ksplit[i]<40");
+-			}
+-		  }
+-		//  now do the element split
+-		newnbq = 4*nbq;
+-		nbv = k;
+-		kkk = nbt;
+-		ksplit[-1] = nbt;
+-		// look on  old true  triangles 
+-
+-		for (i=0;i<nbtsave;i++){
+-			int  nbmkadj=0;
+-			long mkadj [100];
+-			mkadj[0]=i;
+-			long kk=ksplit[i]/10;
+-			int  ke=(int) (ksplit[i]%10);
+-			if (kk>=7 || kk<=0){
+-				_error2_("kk>=7 || kk<=0");
+-			}
+-
+-			// def the numbering   k (edge) i vertex 
+-			int k0 = ke;
+-			int k1 = NextEdge[k0];
+-			int k2 = PreviousEdge[k0];
+-			int i0 = OppositeVertex[k0];
+-			int i1 = OppositeVertex[k1];
+-			int i2 = OppositeVertex[k2];
+-
+-			Triangle &t0=triangles[i];
+-			BamgVertex * v0=t0(i0);           
+-			BamgVertex * v1=t0(i1);           
+-			BamgVertex * v2=t0(i2);
+-
+-			if (nbmkadj>=10){
+-				_error2_("nbmkadj>=10");
+-			}
+-			// --------------------------
+-			AdjacentTriangle ta0(t0.Adj(i0)),ta1(t0.Adj(i1)),ta2(t0.Adj(i2));
+-			// save the flag Hidden
+-			int hid[]={t0.Hidden(0),t0.Hidden(1),t0.Hidden(2)};
+-			// un set all adj -- save Hidden flag --
+-			t0.SetAdj2(0,0,hid[0]);
+-			t0.SetAdj2(1,0,hid[1]);
+-			t0.SetAdj2(2,0,hid[2]);
+-			// --  remake 
+-			switch  (kk) {
+-				case 1: break;// nothing 
+-				case 2: // 
+-						  {
+-							Triangle &t1=triangles[kkk++];
+-							t1=t0;
+-							if (kedge[3*i+i0]<0){
+-								_error2_("kedge[3*i+i0]<0");
+-							}
+-							BamgVertex * v3 = vertices + kedge[3*i+k0];
+-
+-							t0(i2) = v3;
+-							t1(i1) = v3;
+-							t0.SetAllFlag(k2,0);
+-							t1.SetAllFlag(k1,0);
+-						  } 
+-						break; 
+-				case 3: //
+-						  {
+-							Triangle &t1=triangles[kkk++];
+-							Triangle &t2=triangles[kkk++];
+-							t2=t1=t0;
+-							if (kedge[3*i+k1]<0){
+-								_error2_("kedge[3*i+k1]<0");
+-							}
+-							if (kedge[3*i+k2]<0){
+-								_error2_("kedge[3*i+k2]<0");
+-							}
+-
+-							BamgVertex * v01 = vertices + kedge[3*i+k2];
+-							BamgVertex * v02 = vertices + kedge[3*i+k1]; 
+-							t0(i1) = v01; 
+-							t0(i2) = v02; 
+-							t1(i2) = v02;
+-							t1(i0) = v01; 
+-							t2(i0) = v02; 
+-							t0.SetAllFlag(k0,0);
+-							t1.SetAllFlag(k1,0);
+-							t1.SetAllFlag(k0,0);
+-							t2.SetAllFlag(k2,0);
+-						  } 
+-						break;
+-				case 4: // 
+-				case 6: // split in 4 
+-						  {
+-							Triangle &t1=triangles[kkk++];
+-							Triangle &t2=triangles[kkk++];
+-							Triangle &t3=triangles[kkk++];
+-							t3=t2=t1=t0;
+-							if (kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0){
+-								_error2_("kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0");
+-							}
+-							BamgVertex * v12 = vertices + kedge[3*i+k0];
+-							BamgVertex * v02 = vertices + kedge[3*i+k1]; 
+-							BamgVertex * v01 = vertices + kedge[3*i+k2];
+-							t0(i1) = v01;
+-							t0(i2) = v02;
+-							t0.SetAllFlag(k0,hid[k0]);
+-
+-							t1(i0) = v01;
+-							t1(i2) = v12;
+-							t0.SetAllFlag(k1,hid[k1]);
+-
+-							t2(i0) = v02;
+-							t2(i1) = v12;
+-							t2.SetAllFlag(k2,hid[k2]);
+-
+-							t3(i0) = v12;
+-							t3(i1) = v02;
+-							t3(i2) = v01;
+-
+-							t3.SetAllFlag(0,hid[0]);	   
+-							t3.SetAllFlag(1,hid[1]);	   
+-							t3.SetAllFlag(2,hid[2]);
+-
+-							if ( kk == 6)
+-							  {
+-
+-								Triangle &t4=triangles[kkk++];
+-								Triangle &t5=triangles[kkk++];
+-
+-								t4 = t3;
+-								t5 = t3;
+-
+-								t0.SetHidden(k0);
+-								t1.SetHidden(k1);
+-								t2.SetHidden(k2);
+-								t3.SetHidden(0);
+-								t4.SetHidden(1);
+-								t5.SetHidden(2);
+-
+-								if (nbv < maxnbv ) 
+-								  {
+-									vertices[nbv].r = ((R2) *v01 + (R2) *v12  + (R2) *v02 ) / 3.0;
+-									vertices[nbv].ReferenceNumber =0;
+-									vertices[nbv].DirOfSearch =NoDirOfSearch;
+-									//vertices[nbv].i = R2ToI2(vertices[nbv].r);
+-									double a3[]={1./3.,1./3.,1./3.};
+-									vertices[nbv].m = Metric(a3,v0->m,v1->m,v2->m);
+-									BamgVertex * vc =  vertices +nbv++;
+-									t3(i0) = vc;
+-									t4(i1) = vc;
+-									t5(i2) = vc;
+-
+-								  }
+-								else
+-								 goto Error; 
+-							  }
+-
+-						  } 
+-						break;         
+-			}
+-
+-			// save all the new triangles
+-			mkadj[nbmkadj++]=i;
+-			long jj;
+-			if (t0.link) 
+-			 for (jj=nbt;jj<kkk;jj++)
+-				{
+-				 triangles[jj].link=t0.link;
+-				 t0.link= triangles+jj;
+-				 mkadj[nbmkadj++]=jj;
+-				}
+-			if (nbmkadj>13){// 13 = 6 + 4 +
+-				_error2_("nbmkadj>13");
+-			}
+-
+-			if (kk==6)  newnbq+=3;
+-			for (jj=ksplit[i-1];jj<kkk;jj++) nbt = kkk;
+-			ksplit[i]= nbt; // save last adresse of the new triangles
+-			kkk = nbt;
+-		  }
+-
+-		for (i=0;i<nbv;i++) vertices[i].m = vertices[i].m*2.;
+-
+-		if(withBackground)
+-		 for (i=0;i<BTh.nbv;i++)
+-		  BTh.vertices[i].m =  BTh.vertices[i].m*2.;
+-
+-
+-		ret = 2;
+-		if (nbt>= maxnbt) goto Error; // bug 
+-		if (nbv>= maxnbv) goto Error; // bug 
+-		// generation of the new triangles 
+-
+-		SetIntCoor("In SplitElement"); 
+-
+-		CreateSingleVertexToTriangleConnectivity();
+-		if(withBackground)
+-		 BTh.CreateSingleVertexToTriangleConnectivity();
+-
+-		delete [] edges;
+-		edges = newedges;
+-		nbe = newnbe;
+-		nbq = newnbq;
+-
+-		for (i=0;i<nbsubdomains;i++)
+-		  { 
+-			long k = subdomains[i].edge- edges;
+-			subdomains[i].edge =  edges+2*k; // spilt all edge in 2 
+-		  }
+-
+-		if (ksplitarray) delete [] ksplitarray;
+-		if (kedge) delete [] kedge;
+-		if (edge4) delete edge4;
+-		if (VerticesOnGeomEdge) delete [] VerticesOnGeomEdge;
+-		VerticesOnGeomEdge= newVerticesOnGeomEdge;
+-		if(VertexOnBThEdge) delete []  VertexOnBThEdge;
+-		VertexOnBThEdge = newVertexOnBThEdge;
+-		NbVerticesOnGeomEdge = newNbVerticesOnGeomEdge;
+-		NbVertexOnBThEdge=newNbVertexOnBThEdge;
+-		//  CreateSingleVertexToTriangleConnectivity();
+-
+-		ReconstructExistingMesh();
+-
+-		if (verbose>2){
+-			_printLine_("   number of quadrilaterals    = " << nbq);
+-			_printLine_("   number of triangles         = " << nbt-nbtout- nbq*2);
+-			_printLine_("   number of outside triangles = " << nbtout);
+-		}
+-
+-		return 0; //ok
+-
+-Error:
+-		nbv = nbvold;
+-		nbt = nbtold;
+-		nbtout = nbtoutold;
+-		// cleaning memory ---
+-		delete [] newedges;
+-		if (ksplitarray) delete [] ksplitarray;
+-		if (kedge) delete [] kedge;
+-		if (newVerticesOnGeomEdge) delete [] newVerticesOnGeomEdge;
+-		if (edge4) delete edge4;
+-		if(newVertexOnBThEdge) delete []  newVertexOnBThEdge;
+-
+-		return ret; // ok 
+-	}
+-	/*}}}*/
+-/*FUNCTION Mesh::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 ;
+-					  }
+-					  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);
+-
+-			// a good new point 
+-			vi.ReferenceNumber=0; 
+-			vi.DirOfSearch =NoDirOfSearch;
+-			Triangle *tcvi = TriangleFindFromCoord(vi.i,det3);
+-			if (tcvi && !tcvi->link) {
+-				_printLine_("problem inserting point in SplitInternalEdgeWithBorderVertices (tcvj && !tcvj->link)");
+-			}
+-
+-			quadtree->Add(vi);
+-			if (!tcvi || tcvi->det<0){// internal
+-				_error2_("!tcvi || tcvi->det < 0");
+-			}
+-			AddVertex(vi,tcvi,det3);
+-			NbSwap += vi.Optim(1);          
+-			iv++;
+-			//      }
+-	}
+-	if (verbose>3) {
+-		_printLine_("   number of points: " << iv);
+-		_printLine_("   number of swap to  split internal edges with border vertices: " << NbSwap);
+-		nbv = iv;
+-	}
+-}
+-if (NbSplitEdge>nbv-nbvold) _printLine_("WARNING: not enough vertices  to split all internal edges, we lost " << NbSplitEdge - ( nbv-nbvold) << " edges...");
+-if (verbose>2) _printLine_("SplitInternalEdgeWithBorderVertices: Number of splited edge " << NbSplitEdge);
+-
+-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;
+-
+-	/*Get starting triangle. Take tsart if provided*/
+-	if (tstart) t=tstart;
+-
+-	/*Else find the closest Triangle using the quadtree*/
+-	else {
+-
+-		/*Check that the quadtree does exist*/
+-		if (!quadtree) _error2_("no starting triangle provided and no quadtree available");
+-
+-		/*Call NearestVertex*/
+-		BamgVertex *a = quadtree->NearestVertex(B.x,B.y) ;
+-
+-		/*Check output (Vertex a)*/
+-		if (!a)    _error2_("problem while trying to find nearest vertex from a given point. No output found");
+-		if (!a->t) _error2_("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);
+-	}
+-
+-	Icoor2  detop ;
+-
+-	/*initialize number of test triangle*/
+-	counter=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);
+-	}
+-
+-	jj=0;
+-	detop = det(*(*t)(VerticesOfTriangularEdge[jj][0]),*(*t)(VerticesOfTriangularEdge[jj][1]),B);
+-
+-	while(t->det>0) { 
+-
+-		/*Increase counter*/
+-		if (++counter>=10000) _error2_("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];
+-
+-		// 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 (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;
+-	}
+-	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 int verbose=0;
+-	register Triangle *t0,*t;
+-	register long k=0, num;   
+-
+-	//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++){ 
+-
+-		//first triangle of the subdomain i
+-		t=t0=subdomains[i].head;
+-
+-		//check that the subdomain is not empty
+-		if (!t0){ _error2_("At least one subdomain is empty");}
+-
+-		//loop
+-		do{
+-			k++;
+-
+-			//get current triangle number
+-			num = GetId(t);
+-
+-			//check that num is in [0 nbt[
+-			_assert_(num>=0 && num<nbt);
+-
+-			//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
+-
+-	}
+-	return k;   
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::Triangulate{{{*/
+-void Mesh::Triangulate(double* x,double* y,int nods){
+-
+-	int verbose=0;
+-	int i;
+-	Metric M1(1);
+-
+-	/*Initialize mesh*/
+-	Init(nods);//this resets nbv to 0
+-	nbv=nods;
+-
+-	//Vertices
+-	if(verbose) _printLine_("Reading vertices (" << nbv << ")");
+-	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();
+-}
+-/*}}}*/
+-	/*FUNCTION Mesh::TriangulateFromGeom0{{{*/
+-	void Mesh::TriangulateFromGeom0(BamgOpts* bamgopts){
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/GeomToTriangles0)*/
+-		/*Generate mesh from geometry*/
+-
+-		/*Intermediaries*/
+-		int                i,j,k;
+-		int                nbcurves    = 0;
+-		int                NbNewPoints,NbEdgeCurve;
+-		double             lcurve,lstep,s;
+-		const int          MaxSubEdge  = 10;
+-
+-		R2          AB;
+-		GeomVertex *a, *b;
+-		BamgVertex *va,*vb;
+-		GeomEdge   *e;
+-
+-		// add a ref to GH to make sure that it is not destroyed by mistake
+-		Gh.NbRef++;
+-
+-		/*Get options*/
+-		int verbose=bamgopts->verbose;
+-
+-		//build background mesh flag (1 if background, else 0)
+-		bool background=(&BTh != this);
+-
+-		/*Build VerticesOnGeomVertex*/
+-
+-		//Compute the number of geometrical vertices that we are going to use to mesh
+-		for (i=0;i<Gh.nbv;i++){
+-			if (Gh[i].Required()) NbVerticesOnGeomVertex++;
+-		}
+-		//allocate
+-		VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex];  
+-		if(NbVerticesOnGeomVertex >= maxnbv) _error2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
+-		_assert_(nbv==0);
+-		//Build VerticesOnGeomVertex
+-		for (i=0;i<Gh.nbv;i++){
+-			/* Add vertex only if required*/
+-			if (Gh[i].Required()) {//Gh  vertices Required
+-
+-				//Add the vertex
+-				_assert_(nbv<maxnbv);
+-				vertices[nbv]=Gh[i];
+-				
+-				//Add pointer from geometry (Gh) to vertex from mesh (Th)
+-				Gh[i].MeshVertexHook=vertices+nbv;
+-
+-				//Build VerticesOnGeomVertex for current point
+-				VerticesOnGeomVertex[nbv]=VertexOnGeom(*Gh[i].MeshVertexHook,Gh[i]);
+-
+-				//nbv increment
+-				nbv++;
+-			}
+-		}
+-
+-		/*Build VerticesOnGeomEdge*/
+-
+-		//check that edges is still empty (Init)
+-		_assert_(!edges);
+-
+-		/* Now we are going to create the first edges corresponding
+-		 * to the one present in the geometry provided.
+-		 * We proceed in 2 steps
+-		 *  -step 0: we count all the edges
+-		 *           we allocate the number of edges at the end of step 0
+-		 *  -step 1: the edges are created */
+-		for (int step=0;step<2;step++){
+-
+-			//initialize number of edges and number of edges max
+-			long nbex=0;
+-			nbe=0;
+-			long NbVerticesOnGeomEdge0=NbVerticesOnGeomEdge;
+-			Gh.UnMarkEdges();	
+-			nbcurves=0;
+-
+-			//go through the edges of the geometry
+-			for (i=0;i<Gh.nbe;i++){
+-
+-				//ei = current Geometrical edge
+-				GeomEdge &ei=Gh.edges[i];   
+-
+-				//loop over the two vertices of the edge ei
+-				for(int j=0;j<2;j++) {
+-
+-					/*Take only required vertices (corner->beginning of a new curve)*/
+-					if (!ei.Mark() && ei[j].Required()){ 
+-
+-						long  nbvend=0;
+-						Edge* PreviousNewEdge=NULL;
+-						lstep = -1;
+-
+-						/*If Edge is required (do that only once for the 2 vertices)*/
+-						if(ei.Required()){
+-							if (j==0){
+-								//do not create internal points if required (take it as is)
+-								if(step==0) nbe++;
+-								else{ 
+-									e=&ei;
+-									a=ei(0);
+-									b=ei(1);
+-
+-									//check that edges has been allocated
+-									_assert_(edges);
+-									edges[nbe].v[0]=a->MeshVertexHook;
+-									edges[nbe].v[1]=b->MeshVertexHook;;
+-									edges[nbe].ReferenceNumber = e->ReferenceNumber;
+-									edges[nbe].GeomEdgeHook = e;
+-									edges[nbe].adj[0] = 0;
+-									edges[nbe].adj[1] = 0;
+-									nbe++;
+-								}
+-							}
+-						}
+-
+-						/*If Edge is not required: we are on a curve*/
+-						else {
+-							for (int kstep=0;kstep<=step;kstep++){
+-								//kstep=0, compute number of edges (discretize curve)
+-								//kstep=1  create the points and edge
+-								PreviousNewEdge=0;
+-								NbNewPoints=0;
+-								NbEdgeCurve=0;
+-								if (nbvend>=maxnbv) _error2_("maximum number of vertices too low! Check the domain outline or increase maxnbv");
+-								lcurve =0;
+-								s = lstep; //-1 initially, then length of each sub edge
+-
+-								/*reminder: i = edge number, j=[0;1] vertex index in edge*/
+-								k=j;            // k = vertex index in edge (0 or 1)
+-								e=&ei;          // e = reference of current edge
+-								a=ei(k);        // a = pointer toward the kth vertex of the current edge
+-								va = a->MeshVertexHook; // va = pointer toward mesh vertex associated
+-								e->SetMark();   // Mark edge
+-
+-								/*Loop until we reach the end of the curve*/
+-								for(;;){ 
+-									k = 1-k;            // other vertx index of the curve
+-									b = (*e)(k);        // b = pointer toward the other vertex of the current edge
+-									AB= b->r - a->r;   // AB = vector of the current edge
+-									Metric MA = background ? BTh.MetricAt(a->r) :a->m ;  //Get metric associated to A
+-									Metric MB = background ? BTh.MetricAt(b->r) :b->m ;  //Get metric associated to B
+-									double ledge = (MA(AB) + MB(AB))/2;                  //Get edge length in metric
+-
+-									/* We are now creating the mesh edges from the geometrical edge selected above.
+-									 * The edge will be divided according to the metric previously computed and cannot
+-									 * be divided more than 10 times (MaxSubEdge). */
+-
+-									//By default, there is only one subedge that is the geometrical edge itself
+-									int NbSubEdge = 1;
+-
+-									//initialize lSubEdge, holding the length of each subedge (cannot be higher than 10)
+-									double lSubEdge[MaxSubEdge];
+-
+-									//Build Subedges according to the edge length
+-									if (ledge < 1.5){
+-										//if ledge < 1.5 (between one and 2), take the edge as is
+-										lSubEdge[0] = ledge;
+-									}
+-									//else, divide the edge
+-									else {
+-										//compute number of subedges (division of the edge), Maximum is 10
+-										NbSubEdge = Min( MaxSubEdge, (int) (ledge +0.5));
+-										/*Now, we are going to divide the edge according to the metric.
+-										 * Get segment by sement along the edge.
+-										 * Build lSubEdge, which holds the distance between the first vertex
+-										 * of the edge and the next point on the edge according to the 
+-										 * discretization (each SubEdge is AB)*/
+-										R2 A,B;
+-										A=a->r;
+-										Metric MAs=MA,MBs;
+-										ledge=0; 
+-										double x =0, xstep= 1./NbSubEdge;
+-										for (int kk=0; kk < NbSubEdge; kk++,A=B,MAs=MBs ) {
+-											x += xstep;
+-											B =  e->F(k ? x : 1-x);
+-											MBs= background ? BTh.MetricAt(B) : Metric(1-x,MA,x,MB);
+-											AB = A-B;
+-											lSubEdge[kk]=(ledge+=(MAs(AB)+MBs(AB))/2);
+-										}
+-									}
+-
+-									double lcurveb = lcurve+ledge;
+-
+-									/*Now, create corresponding points*/
+-									while(s>=lcurve && s<=lcurveb && nbv<nbvend){
+-
+-										/*Schematic of current curve
+-										 *
+-										 *  a                   vb                  b          // vertex
+-										 *  0              ll0     ll1              ledge      // length from a
+-										 *  + --- + - ... - + --S-- + --- + - ... - +          // where is S
+-										 *  0              kk0     kk1              NbSubEdge  // Sub edge index
+-										 *
+-										 */
+-
+-										double ss = s-lcurve;
+-
+-										/*Find the SubEdge containing ss using Dichotomy*/
+-										int kk0=-1,kk1=NbSubEdge-1,kkk;
+-										double ll0=0,ll1=ledge,llk;
+-										while (kk1-kk0>1){
+-											if (ss < (llk=lSubEdge[kkk=(kk0+kk1)/2]))
+-											 kk1=kkk,ll1=llk;
+-											else
+-											 kk0=kkk,ll0=llk;
+-										}
+-										_assert_(kk1!=kk0);
+-
+-										/*Curvilinear coordinate in [0 1] of ss in current edge*/
+-										// WARNING: This is what we would do
+-										// ssa = (ss-ll0)/(ll1-ll0);
+-										// aa = (kk0+ssa)/NbSubEdge
+-										// This is what Bamg does:
+-										double sbb = (ss-ll0)/(ll1-ll0);
+-										/*Curvilinear coordinate in [0 1] of ss in current curve*/
+-										double bb = (kk1+sbb)/NbSubEdge;
+-										double aa = 1-bb;
+-
+-										// new vertex on edge
+-										vb = &vertices[nbv++];
+-										vb->m = Metric(aa,a->m,bb,b->m);
+-										vb->ReferenceNumber = e->ReferenceNumber;
+-										vb->DirOfSearch =NoDirOfSearch;
+-										double abcisse = k ? bb : aa;
+-										vb->r =  e->F(abcisse);
+-										VerticesOnGeomEdge[NbVerticesOnGeomEdge++]= VertexOnGeom(*vb,*e,abcisse);        
+-
+-										// to take into account the direction of the edge
+-										s += lstep;
+-										edges[nbe].v[0]=va;
+-										edges[nbe].v[1]=vb;
+-										edges[nbe].ReferenceNumber =e->ReferenceNumber;
+-										edges[nbe].GeomEdgeHook = e;
+-										edges[nbe].adj[0] = PreviousNewEdge;
+-										if(PreviousNewEdge) PreviousNewEdge->adj[1]=&edges[nbe];
+-										PreviousNewEdge=edges+nbe;
+-										nbe++;
+-										va = vb;
+-									}
+-									
+-									/*We just added one edge to the curve: Go to the next one*/
+-									lcurve = lcurveb;
+-									e->SetMark();
+-									a=b;
+-
+-									/*If b is required, we are on a new curve->break*/
+-									if (b->Required()) break;
+-									int kprev=k;
+-									k = e->AdjVertexIndex[kprev];// next vertices
+-									e = e->Adj[kprev];
+-									_assert_(e);
+-								}// for(;;)
+-								vb = b->MeshVertexHook;
+-
+-								/*Number of edges in the last disretized curve*/
+-								NbEdgeCurve = Max((long) (lcurve +0.5), (long) 1);
+-								/*Number of internal vertices in the last disretized curve*/
+-								NbNewPoints = NbEdgeCurve-1;
+-								if(!kstep){
+-									NbVerticesOnGeomEdge0 += NbNewPoints;
+-									nbcurves++;
+-								}
+-								nbvend=nbv+NbNewPoints; 
+-								lstep = lcurve / NbEdgeCurve; //approximately one
+-							}// end of curve --
+-							if (edges) { // last edges of the curves 
+-								edges[nbe].v[0]=va;
+-								edges[nbe].v[1]=vb;
+-								edges[nbe].ReferenceNumber = e->ReferenceNumber;
+-								edges[nbe].GeomEdgeHook = e;
+-								edges[nbe].adj[0] = PreviousNewEdge;
+-								edges[nbe].adj[1] = 0;
+-								if(PreviousNewEdge) PreviousNewEdge->adj[1] = & edges[nbe];
+-								nbe++;
+-							}
+-							else nbe += NbEdgeCurve;
+-						} // end on  curve ---
+-					}
+-				}
+-			} // for (i=0;i<nbe;i++)
+-			if(!step) {
+-				_assert_(!edges);
+-				_assert_(!VerticesOnGeomEdge);
+-
+-				edges = new Edge[nbex=nbe];
+-				if(NbVerticesOnGeomEdge0) VerticesOnGeomEdge = new VertexOnGeom[NbVerticesOnGeomEdge0];
+-
+-				// do the vertex on a geometrical vertex
+-				_assert_(VerticesOnGeomEdge || NbVerticesOnGeomEdge0==0);
+-				NbVerticesOnGeomEdge0 = NbVerticesOnGeomEdge;       
+-			}
+-			else{
+-				_assert_(NbVerticesOnGeomEdge==NbVerticesOnGeomEdge0);
+-			}
+-		}
+-
+-		//Insert points inside existing triangles
+-		if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
+-		if (verbose>3) _printLine_("      Creating initial Constrained Delaunay Triangulation...");
+-		if (verbose>3) _printLine_("         Inserting boundary points");
+-		Insert();
+-
+-		//Force the boundary
+-		if (verbose>3) _printLine_("         Forcing boundaries");
+-		ForceBoundary();
+-
+-		//Extract SubDomains
+-		if (verbose>3) _printLine_("         Extracting subdomains");
+-		FindSubDomain();
+-
+-		if (verbose>3) _printLine_("      Inserting internal points");
+-		NewPoints(*this,bamgopts,0) ;
+-		if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
+-	}
+-	/*}}}*/
+-	/*FUNCTION Mesh::TriangulateFromGeom1{{{*/
+-	void Mesh::TriangulateFromGeom1(BamgOpts* bamgopts,int KeepVertices){ 
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/GeomToTriangles1)*/
+-
+-		/*Get options*/
+-		int verbose=bamgopts->verbose;
+-
+-		Gh.NbRef++;// add a ref to Gh
+-
+-		/************************************************************************* 
+-		 * method in 2 steps
+-		 * 1 - compute the number of new edges to allocate
+-		 * 2 - construct the edges
+-		 * remark:
+-		 * in this part we suppose to have a background mesh with the same geometry 
+-		 * 
+-		 * To construct the discretization of the new mesh we have to 
+-		 * rediscretize the boundary of background Mesh 
+-		 * because we have only the pointeur from the background mesh to the geometry.
+-		 * We need the abcisse of the background mesh vertices on geometry
+-		 * so a vertex is 
+-		 * 0 on GeomVertex ;
+-		 * 1 on GeomEdge + abcisse
+-		 * 2 internal 
+-		 *************************************************************************/
+-
+-		//Check that background mesh and current mesh do have the same geometry
+-		_assert_(&BTh.Gh==&Gh);
+-		BTh.NbRef++; // add a ref to BackGround Mesh
+-
+-		//Initialize new mesh
+-		BTh.SetVertexFieldOn();
+-		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 */
+-
+-		NbVerticesOnGeomVertex=0;
+-		NbVerticesOnGeomEdge=0;
+-
+-		/*STEP 1 copy of Required vertices*/
+-
+-		int i; 
+-		for (i=0;i<Gh.nbv;i++) if (Gh[i].Required()) NbVerticesOnGeomVertex++;
+-		printf("\n");
+-		if(NbVerticesOnGeomVertex >= maxnbv){
+-			_error2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
+-		}
+-
+-		VerticesOnGeomVertex = new VertexOnGeom[  NbVerticesOnGeomVertex];
+-		VertexOnBThVertex    = new VertexOnVertex[NbVerticesOnGeomVertex];
+-
+-		//At this point there is NO vertex but vertices should have been allocated by Init
+-		_assert_(vertices);
+-		for (i=0;i<Gh.nbv;i++){
+-			if (Gh[i].Required()) {//Gh vertices Required
+-				vertices[nbv]  =Gh[i];
+-				vertices[nbv].i=I2(0,0);
+-				Gh[i].MeshVertexHook = vertices + nbv;// save Geom -> Th
+-				VerticesOnGeomVertex[nbv]= VertexOnGeom(vertices[nbv],Gh[i]);
+-				nbv++;
+-			}
+-			else Gh[i].MeshVertexHook=0;
+-		} 
+-		for (i=0;i<BTh.NbVerticesOnGeomVertex;i++){ 
+-			VertexOnGeom &vog=BTh.VerticesOnGeomVertex[i];
+-			if (vog.IsRequiredVertex()){
+-				GeomVertex* gv=vog;
+-				BamgVertex *bv = vog;
+-				_assert_(gv->MeshVertexHook); // use of Geom -> Th
+-				VertexOnBThVertex[NbVertexOnBThVertex++]=VertexOnVertex(gv->MeshVertexHook,bv);
+-				gv->MeshVertexHook->m = bv->m; // for taking the metric of the background mesh
+-			}
+-		}
+-		_assert_(NbVertexOnBThVertex==NbVerticesOnGeomVertex); /*This might be due to MaxCornerAngle too small*/
+-
+-		/*STEP 2: reseed boundary edges*/
+-
+-		//  find the begining of the curve in BTh
+-		Gh.UnMarkEdges();	
+-		int bfind=0;
+-		for (int i=0;i<Gh.nbcurves;i++) bcurve[i]=-1; 
+-
+-		/*Loop over the backgrounf mesh BTh edges*/
+-		for (int iedge=0;iedge<BTh.nbe;iedge++){      
+-			Edge &ei = BTh.edges[iedge];
+-
+-			/*Loop over the 2 vertices of the current edge*/
+-			for(int je=0;je<2;je++){
+-
+-				/* If one of the vertex is required we are in a new curve*/
+-				if (ei[je].GeomEdgeHook->IsRequiredVertex()){ 
+-
+-					/*Get curve number*/
+-					int nc=ei.GeomEdgeHook->CurveNumber;
+-					
+-					//_printLine_("Dealing with curve number " << nc);
+-					//_printLine_("edge on geometry is same as GhCurve? " << (ei.GeomEdgeHook==Gh.curves[nc].FirstEdge || ei.GeomEdgeHook==Gh.curves[nc].LastEdge)?"yes":"no");
+-					//if(ei.GeomEdgeHook==Gh.curves[nc].FirstEdge || ei.GeomEdgeHook==Gh.curves[nc].LastEdge){
+-					//	_printLine_("Do we have the right extremity? curve first vertex -> " << ((GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex])?"yes":"no");
+-					//	_printLine_("Do we have the right extremity? curve last  vertex -> " << ((GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex])?"yes":"no");
+-					//}
+-					//BUG FIX from original bamg
+-					/*Check that we are on the same edge and right vertex (0 or 1) */
+-					if(ei.GeomEdgeHook==Gh.curves[nc].FirstEdge  && (GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex]){
+-						bcurve[nc]=iedge*2+je;
+-						bfind++;	
+-					}
+-					else if ((ei.GeomEdgeHook==Gh.curves[nc].LastEdge  && (GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex]) && bcurve[nc]==-1){
+-						bcurve[nc]=iedge*2+je;
+-						bfind++;	
+-					}
+-				}
+-			}
+-		} 
+-		if (bfind!=Gh.nbcurves){
+-			delete [] bcurve;
+-			_error2_("problem generating number of curves (" << Gh.nbcurves << " found in the geometry but " << bfind << " curve found in the mesh)");
+-		}
+-
+-		// method in 2 + 1 step 
+-		//  0.0) compute the length and the number of vertex to do allocation
+-		//  1.0) recompute the length
+-		//  1.1) compute the  vertex 
+-
+-		long nbex=0,NbVerticesOnGeomEdgex=0;
+-		for (int step=0; step <2;step++){
+-
+-			long NbOfNewPoints=0;
+-			long NbOfNewEdge=0;
+-			long iedge;
+-			Gh.UnMarkEdges();	
+-			double L=0;
+-
+-			/*Go through all geometrical curve*/
+-			for (int icurve=0;icurve<Gh.nbcurves;icurve++){ 
+-
+-				/*Get edge and vertex (index) of background mesh on this curve*/
+-				iedge=bcurve[icurve]/2;
+-				int jedge=bcurve[icurve]%2;
+-
+-				/*Get edge of Bth with index iedge*/
+-				Edge &ei = BTh.edges[iedge];
+-			
+-				/*Initialize variables*/
+-				double Lstep=0,Lcurve=0;    // step between two points   (phase==1) 
+-				long NbCreatePointOnCurve=0;// Nb of new points on curve (phase==1) 
+-
+-				/*Do phase 0 to step*/
+-				for(int phase=0;phase<=step;phase++){
+-
+-					/*Current curve pointer*/
+-					Curve *curve= Gh.curves+icurve;
+-
+-					/*Get index of current curve*/
+-					int icurveequi= Gh.GetId(curve);
+-
+-					/*For phase 0, check that we are at the begining of the curve only*/
+-					if(phase==0 &&  icurveequi!=icurve)  continue;
+-
+-					int   k0=jedge,k1;
+-					Edge* pe=  BTh.edges+iedge;
+-					int   iedgeequi=bcurve[icurveequi]/2;
+-					int   jedgeequi=bcurve[icurveequi]%2;
+-
+-					int k0equi=jedgeequi,k1equi;		  
+-					Edge * peequi= BTh.edges+iedgeequi;
+-					GeomEdge *ongequi = peequi->GeomEdgeHook;
+-
+-					double sNew=Lstep;// abscisse of the new points (phase==1) 
+-					L=0;// length of the curve
+-					long i=0;// index of new points on the curve
+-					register GeomVertex * GA0 = *(*peequi)[k0equi].GeomEdgeHook;
+-					BamgVertex *A0;
+-					A0 = GA0->MeshVertexHook;  // the vertex in new mesh
+-					BamgVertex *A1;
+-					VertexOnGeom *GA1;
+-					Edge* PreviousNewEdge = 0;
+-
+-					// New Curve phase 
+-					_assert_(A0-vertices>=0 && A0-vertices<nbv);
+-					if(ongequi->Required()){
+-						GeomVertex *GA1 = *(*peequi)[1-k0equi].GeomEdgeHook;
+-						A1 = GA1->MeshVertexHook;  //
+-					}       
+-					else {
+-						for(;;){
+-							Edge &ee=*pe; 
+-							Edge &eeequi=*peequi; 
+-							k1 = 1-k0; // next vertex of the edge 
+-							k1equi= 1 - k0equi;
+-							_assert_(pe && ee.GeomEdgeHook);
+-							ee.GeomEdgeHook->SetMark();
+-							BamgVertex & v0=ee[0], & v1=ee[1];
+-							R2 AB=(R2)v1-(R2)v0;
+-							double L0=L,LAB;
+-							LAB=LengthInterpole(v0.m,v1.m,AB);
+-							L+= LAB;
+-
+-							if (phase){
+-								// computation of the new points for the given curve
+-								while ((i!=NbCreatePointOnCurve) && sNew<=L) { 
+-
+-									//some checks
+-									_assert_(sNew>=L0);
+-									_assert_(LAB);
+-									_assert_(vertices && nbv<maxnbv);
+-									_assert_(edges && nbe<nbex);
+-									_assert_(VerticesOnGeomEdge && NbVerticesOnGeomEdge<NbVerticesOnGeomEdgex);
+-
+-									// new vertex on edge
+-									A1=vertices+nbv++;
+-									GA1=VerticesOnGeomEdge+NbVerticesOnGeomEdge;
+-									Edge* e = edges + nbe++;
+-									double se= (sNew-L0)/LAB;
+-									if (se<0 || se>=1.000000001){
+-										_error2_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");
+-									}
+-									se = abscisseInterpole(v0.m,v1.m,AB,se,1);
+-									if (se<0 || se>1){
+-										_error2_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");
+-									}
+-									se = k1         ? se : 1. - se;
+-									se = k1==k1equi ? se : 1. - se;
+-									VertexOnBThEdge[NbVerticesOnGeomEdge++] = VertexOnEdge(A1,&eeequi,se); // save 
+-									ongequi=Gh.ProjectOnCurve(eeequi,se,*A1,*GA1); 
+-									A1->ReferenceNumber = eeequi.ReferenceNumber;
+-									A1->DirOfSearch =NoDirOfSearch;
+-									e->GeomEdgeHook = ongequi;
+-									e->v[0]=A0;
+-									e->v[1]=A1;
+-									e->ReferenceNumber = eeequi.ReferenceNumber;
+-									e->adj[0]=PreviousNewEdge;
+-
+-									if (PreviousNewEdge) PreviousNewEdge->adj[1]=e;
+-									PreviousNewEdge=e;
+-									A0=A1;
+-									sNew += Lstep;
+-									if (++i== NbCreatePointOnCurve) break;
+-								}
+-							}
+-
+-							//some checks
+-							_assert_(ee.GeomEdgeHook->CurveNumber==ei.GeomEdgeHook->CurveNumber);
+-							if (ee[k1].GeomEdgeHook->IsRequiredVertex()) {
+-								_assert_(eeequi[k1equi].GeomEdgeHook->IsRequiredVertex());
+-								register GeomVertex * GA1 = *eeequi[k1equi].GeomEdgeHook;
+-								A1=GA1->MeshVertexHook;// the vertex in new mesh
+-								_assert_(A1-vertices>=0 && A1-vertices<nbv);
+-								break;
+-							}
+-							if (!ee.adj[k1]) {
+-								_error2_("adj edge " << BTh.GetId(ee) << ", nbe=" << nbe << ", Gh.vertices=" << Gh.vertices);
+-							}
+-							pe = ee.adj[k1]; // next edge
+-							k0 = pe->Intersection(ee); 
+-							peequi= eeequi.adj[k1equi];  // next edge
+-							k0equi=peequi->Intersection(eeequi);            
+-						}// for(;;) end of the curve
+-					}
+-
+-
+-					if (phase){ // construction of the last edge
+-						Edge* e=edges + nbe++;
+-						e->GeomEdgeHook  = ongequi;
+-						e->v[0]=A0;
+-						e->v[1]=A1;
+-						e->ReferenceNumber = peequi->ReferenceNumber;
+-						e->adj[0]=PreviousNewEdge;
+-						e->adj[1]=0;
+-						if (PreviousNewEdge) PreviousNewEdge->adj[1]=e;
+-						PreviousNewEdge = e;
+-
+-						_assert_(i==NbCreatePointOnCurve);
+-					}
+-
+-					if (!phase)  { // 
+-						long NbSegOnCurve = Max((long)(L+0.5),(long) 1);// nb of seg
+-						Lstep = L/NbSegOnCurve; 
+-						Lcurve = L;
+-						NbCreatePointOnCurve = NbSegOnCurve-1;
+-						NbOfNewEdge += NbSegOnCurve;
+-						NbOfNewPoints += NbCreatePointOnCurve;
+-					}
+-				}
+-			}//  end of curve loop 
+-
+-			//Allocate memory
+-			if(step==0){
+-				if(nbv+NbOfNewPoints > maxnbv) {
+-					_error2_("too many vertices on geometry: " << nbv+NbOfNewPoints << " >= " << maxnbv);
+-				}
+-				edges = new Edge[NbOfNewEdge];
+-				nbex = NbOfNewEdge;
+-				if(NbOfNewPoints) {
+-					VerticesOnGeomEdge    = new VertexOnGeom[NbOfNewPoints];
+-					NbVertexOnBThEdge     = NbOfNewPoints;
+-					VertexOnBThEdge       = new  VertexOnEdge[NbOfNewPoints];
+-					NbVerticesOnGeomEdgex = NbOfNewPoints;
+-				}
+-				NbOfNewPoints =0;
+-				NbOfNewEdge = 0;
+-			}
+-		}
+-		_assert_(nbe!=0);
+-		delete [] bcurve;
+-
+-		//Insert points inside existing triangles
+-		if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
+-		if (verbose>3) _printLine_("      Creating initial Constrained Delaunay Triangulation...");
+-		if (verbose>3) _printLine_("         Inserting boundary points");
+-		Insert();
+-
+-		//Force the boundary
+-		if (verbose>3) _printLine_("         Forcing boundaries");
+-		ForceBoundary();
+-
+-		//Extract SubDomains
+-		if (verbose>3) _printLine_("         Extracting subdomains");
+-		FindSubDomain();
+-
+-		if (verbose>3) _printLine_("      Inserting internal points");
+-		NewPoints(BTh,bamgopts,KeepVertices) ;
+-		if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
+-	}
+-	/*}}}*/
+-
+-	/*Intermediary*/
+-	/*FUNCTION CloseBoundaryEdge{{{*/
+-	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;
+-		int dir=0;
+-		if (k<0){
+-			_error2_("k<0");
+-		}
+-		int kkk=0;  
+-		Icoor2 IJ_IA,IJ_AJ;
+-		AdjacentTriangle edge(t,OppositeEdge[k]);          
+-		for (;;edge = dir >0 ? Next(Adj(Next(edge))) : Previous(Adj(Previous(edge)))) {  
+-			kkk++;
+-			if (kkk>=1000){
+-				_error2_("kkk>=1000");
+-			}
+-			BamgVertex  &vI =  *edge.EdgeVertex(0);
+-			BamgVertex  &vJ =  *edge.EdgeVertex(1);
+-			I2 I=vI, J=vJ, IJ= J-I;
+-			IJ_IA = (IJ ,(A-I));
+-			if (IJ_IA<0) {
+-				if (dir>0) {a=1;b=0;return edge;}// change of signe => I
+-				else {dir=-1;
+-					continue;}};// go in direction i 
+-					IJ_AJ = (IJ ,(J-A));
+-					if (IJ_AJ<0) {
+-						if(dir<0)  {a=0;b=1;return edge;}            
+-						else {dir = 1;
+-							continue;}}// go in direction j
+-							double IJ2 = IJ_IA + IJ_AJ;
+-							if (IJ2==0){
+-								_error2_("IJ2==0");
+-							}
+-							a= IJ_AJ/IJ2;
+-							b= IJ_IA/IJ2;
+-							return edge;
+-		  } 
+-	}
+-	/*}}}*/
+-	/*FUNCTION CloseBoundaryEdgeV2{{{*/
+-	AdjacentTriangle CloseBoundaryEdgeV2(I2 C,Triangle *t, double &a,double &b) { 
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/CloseBoundaryEdgeV2)*/
+-		// walk around the vertex 
+-		// version 2 for remove the probleme if we fill the hole
+-		//int bug=1;
+-		//  Triangle *torigine = t;
+-		// restart:
+-		//   int dir=0;
+-		if (t->link != 0){
+-			_error2_("t->link != 0");
+-		}
+-		// to have a starting edges 
+-		// try the 3 edge bourna-- in case of internal hole 
+-		// and choice  the best 
+-		// 
+-		// the probleme is in case of  the fine and long internal hole
+-		// for exemple neart the training edge of a wing
+-		BamgVertex * s=0,*s1=0, *s0=0;
+-		Icoor2 imax = MaxICoor22;
+-		Icoor2 l0 = imax,l1 = imax;
+-		double dd2 =  imax;// infinity
+-		AdjacentTriangle er; 
+-		int  cas=-2;
+-		for (int j=0;j<3;j++)
+-		  { 
+-			AdjacentTriangle ta=t->FindBoundaryEdge(j);
+-			if  (! (Triangle *) ta) continue;
+-			s0 = ta.EdgeVertex(0);
+-			s1 = ta.EdgeVertex(1);
+-			I2 A = * s0;
+-			I2 B = *ta.EdgeVertex(1);
+-			I2 AB = B-A,AC=C-A,BC=B-C;
+-			Icoor2  ACAC = (AC,AC), BCBC = (BC,BC);
+-			Icoor2  AB2  =   Norme2_2(AB); //  ||AB||^2
+-			Icoor2  ABAC  =   (AB,AC);         //  AB.AC|
+-
+-			double d2;
+-			if ( ABAC < 0 )   // DIST A
+-			  {
+-				if ( (d2=(double) ACAC)  <  dd2) 
+-				  {
+-					er = ta;
+-					l0 = ACAC;
+-					l1 = BCBC;
+-					cas = 0;
+-					s = s0;
+-				  }
+-			  }
+-			else if (ABAC > AB2)  // DIST B
+-			  {
+-				if ( (d2=(double) BCBC)  <  dd2) 
+-				  {
+-					dd2 = d2;
+-					er = Adj(ta); // other direction
+-					l0 = BCBC;
+-					l1 = ACAC;
+-					cas = 1;
+-					s = s1;
+-				  }
+-			  }
+-			else  // DIST AB
+-			  { 
+-
+-				double det_2 =  (double) Det(AB,AC); 
+-				det_2 *= det_2; // square of area*2 of triangle ABC
+-				d2 = det_2/ (double) AB2; // hauteur^2 in C of of triangle ABC      
+-
+-				if (d2 < dd2) 
+-				  {
+-					dd2 = d2;
+-					er = ta;
+-					l0 = (AC,AC);
+-					l1 = (BC,BC);
+-					s = 0;
+-					cas = -1;
+-					b = ((double) ABAC/(double) AB2);
+-					a = 1 - b;
+-				  }
+-			  }
+-		  }
+-		if (cas ==-2){
+-			_error2_("cas==-2");
+-		}
+-		// l1 = ||C s1||  , l0 = ||C s0||
+-		// where s0,s1 are the vertex of the edge er
+-
+-		if ( s) 
+-		  { 
+-			t=er;
+-			AdjacentTriangle edge(er); 
+-
+-			int kkk=0;  
+-			int linkp = t->link == 0;
+-
+-			Triangle * tt=t=edge=Adj(Previous(edge));
+-			do  {  // loop over vertex s
+-				kkk++;
+-				if (edge.EdgeVertex(0)!=s && kkk>=10000){
+-					_error2_("edge.EdgeVertex(0)!=s && kkk>=10000");
+-				}
+-
+-				int link = tt->link == 0;
+-				if ((link + linkp) == 1) 
+-				  { // a boundary edge 
+-					BamgVertex * st = edge.EdgeVertex(1);
+-					I2 I=*st;
+-					Icoor2  ll = Norme2_2 (C-I);
+-					if (ll < l1) {  // the other vertex is neart 
+-						s1=st;
+-						l1=ll;
+-						er = edge;
+-						if(ll<l0) { // change of direction --
+-							s1=s;
+-							l1=l0;
+-							s=st;
+-							l0=ll;
+-							t=tt;
+-							edge=Adj(edge);
+-							link=linkp;
+-							er = edge;
+-						}
+-					}
+-				  }
+-
+-				linkp=link;
+-				edge=Adj(Previous(edge));
+-				tt = edge;
+-			} while (t!=tt);
+-
+-			if (!(Triangle *) er){
+-				_error2_("!(Triangle *) er");
+-			}
+-			I2 A((I2)*er.EdgeVertex(0));
+-			I2 B((I2)*er.EdgeVertex(1));
+-			I2 AB=B-A,AC=C-A,CB=B-C;
+-			double aa =  (double) (AB,AC);
+-			double bb =  (double) (AB,CB);
+-			if (aa<0)       a=1,b=0;
+-			else if(bb<0)   a=0,b=1;
+-			else  
+-			  {
+-				a  = bb/(aa+bb);
+-				b  = aa/(aa+bb);
+-			  }
+-		  }
+-		return er;
+-	} 
+-	/*}}}*/
+-/*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 NbSwap =0;
+-	if (!a.t || !b.t){ // the 2 vertex is in a mesh
+-		_error2_("!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  
+-
+-	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){
+-			_error2_("!v2");
+-		}
+-		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; 
+-
+-		if((det1 < 0) && (det2 >0)) { 
+-			// try to force the edge 
+-			BamgVertex * va = &a, *vb = &b;
+-			tc = Previous(tc);
+-			if (!v1 || !v2){
+-				_error2_("!v1 || !v2");
+-			}
+-			Icoor2 detss = 0,l=0,ks;
+-			while ((ks=SwapForForcingEdge(  va,  vb, tc, detss, det1,det2,NbSwap)))
+-			 if(l++ > 10000000) {
+-				 _error2_("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
+-			  }
+-		}
+-		tta = tc;
+-		k++;
+-		if (k>=2000){
+-			_error2_("k>=2000");
+-		}
+-		if ( vbegin == v2 ) return -1;// error 
+-	}
+-
+-	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->SetSingleVertexToTriangleConnectivity();
+-	t2->SetSingleVertexToTriangleConnectivity();
+-} // end swap 
+-/*}}}*/
+-	/*FUNCTION SwapForForcingEdge{{{*/
+-	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
+-		// on cherche l'arete suivante 
+-		// on suppose que detsa >0 et detsb <0
+-		// attention la routine echange pva et pvb 
+-
+-		if(tt1.Locked()) return 0; // frontiere croise 
+-
+-		AdjacentTriangle tt2 = Adj(tt1);
+-		Triangle *t1=tt1,*t2=tt2;// les 2 triangles adjacent
+-		short a1=tt1,a2=tt2;// les 2 numero de l arete dans les 2 triangles
+-		if ( a1<0 || a1>=3 ){
+-			_error2_("a1<0 || a1>=3");
+-		}
+-
+-		BamgVertex & sa= (* t1)[VerticesOfTriangularEdge[a1][0]];
+-		BamgVertex & s1= (*t1)[OppositeVertex[a1]];
+-		BamgVertex & s2= (*t2)[OppositeVertex[a2]];
+-
+-
+-		Icoor2 dets2 = det(*pva,*pvb,s2);
+-		Icoor2 det1=t1->det , det2=t2->det ;
+-		Icoor2 detT = det1+det2;
+-		if ((det1<=0 ) || (det2<=0)){
+-			_error2_("(det1<=0 ) || (det2<=0)");
+-		}
+-		if ( (detsa>=0) || (detsb<=0) ){ // [a,b] cut infinite line va,bb
+-			_error2_("(detsa>=0) || (detsb<=0)");
+-		}
+-		Icoor2 ndet1 = bamg::det(s1,sa,s2);
+-		Icoor2 ndet2 = detT - ndet1;
+-
+-		int ToSwap =0; //pas de swap
+-		if ((ndet1 >0) && (ndet2 >0)) 
+-		  { // on peut swaper  
+-			if ((dets1 <=0 && dets2 <=0) || (dets2 >=0 && detsb >=0))
+-			 ToSwap =1; 
+-			else // swap alleatoire 
+-			 if (BinaryRand()) 
+-			  ToSwap =2; 
+-		  }
+-		if (ToSwap) NbSwap++,
+-		 bamg::swap(t1,a1,t2,a2,&s1,&s2,ndet1,ndet2);
+-
+-		int ret=1;
+-
+-		if (dets2 < 0) {// haut
+-			dets1 = ToSwap ? dets1 : detsa ;
+-			detsa = dets2; 
+-			tt1 =  Previous(tt2) ;}
+-		else if (dets2 > 0){// bas 
+-			dets1 = ToSwap ? dets1 : detsb ;
+-			detsb = dets2;
+-			//xxxx tt1 = ToSwap ? tt1 : Next(tt2);
+-			if(!ToSwap) tt1 =  Next(tt2);
+-		}
+-		else { // changement de direction 
+-			ret = -1;
+-			Exchange(pva,pvb);
+-			Exchange(detsa,detsb);
+-			Exchange(dets1,dets2);
+-			Exchange(tt1,tt2);
+-			dets1=-dets1;
+-			dets2=-dets2;
+-			detsa=-detsa;
+-			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;}
+-
+-		}
+-		return ret;
+-	}
+-	/*}}}*/
+-
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Update.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Update.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Update.h	(revision 12821)
+@@ -1,35 +0,0 @@
+-/*!\file: Update.h: abstract class used by some objects to update their properties
+- * \brief prototypes for Update.h
+- */ 
+-
+-#ifndef _UPDATE_H_
+-#define  _UPDATE_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../shared/shared.h"
+-/*}}}*/
+-
+-class Update{
+-
+-	public:
+-
+-		virtual void  InputUpdateFromVector(IssmDouble* vector, int name, int type)=0;
+-		virtual void  InputUpdateFromVector(int* vector, int name, int type)=0;
+-		virtual void  InputUpdateFromVector(bool* vector, int name, int type)=0; 
+-		#ifdef _HAVE_DAKOTA_
+-		virtual void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int rows, int ncols, int name, int type)=0;
+-		virtual void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type)=0;
+-		virtual void  InputUpdateFromVectorDakota(int* vector, int name, int type)=0;
+-		virtual void  InputUpdateFromVectorDakota(bool* vector, int name, int type)=0;
+-		#endif
+-		virtual void  InputUpdateFromConstant(IssmDouble constant, int name)=0;
+-		virtual void  InputUpdateFromConstant(int constant, int name)=0;
+-		virtual void  InputUpdateFromConstant(bool constant, int name)=0;
+-		virtual void  InputUpdateFromSolution(IssmDouble* solution)=0;
+-		virtual void  InputUpdateFromIoModel(int index, IoModel* iomodel)=0;
+-
+-};
+-
+-#endif //ifndef _UPDATE_H_
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/FemModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/FemModel.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/FemModel.cpp	(revision 12821)
+@@ -1,159 +0,0 @@
+-/*!\file FemModel.c
+- * \brief: implementation of the FemModel object
+- */
+-
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include "../Container/Container.h"
+-#include "../modules/ModelProcessorx/ModelProcessorx.h"
+-#include "../io/io.h"
+-#include "./objects.h"
+-#include "../include/include.h"
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-#include "../modules/modules.h"
+-
+-/*Object constructors and destructor*/
+-/*FUNCTION FemModel::constructor {{{*/
+-FemModel::FemModel(char* inputfilename, char* outputfilename, const int in_solution_type,const int* analyses,const int nummodels){
+-
+-	/*intermediary*/
+-	int         i;
+-	int         analysis_type;
+-	FILE       *IOMODEL = NULL;
+-	extern int  my_rank;
+-
+-	/*Open input file on cpu 0: */
+-	if(my_rank==0) IOMODEL = pfopen(inputfilename ,"rb");
+-
+-	/*Initialize internal data: */
+-	this->nummodels=nummodels;
+-	this->solution_type=in_solution_type;
+-	this->analysis_counter=nummodels-1; //point to last analysis_type carried out.
+-	this->results=new Results(); //not initialized by CreateDataSets
+-	
+-	/*Dynamically allocate whatever is a list of length nummodels: */
+-	analysis_type_list=xNew<int>(nummodels);
+-
+-	/*Initialize: */
+-	for(i=0;i<nummodels;i++)analysis_type_list[i]=analyses[i];
+-
+-	/*create datasets for all analyses*/
+-	ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,IOMODEL,this->solution_type,nummodels,analyses);
+-
+-	/*do the post-processing of the datasets to get an FemModel that can actually run analyses: */
+-	for(i=0;i<nummodels;i++){
+-
+-		if(VerboseMProcessor()) _pprintLine_("   Processing finite element model of analysis " << EnumToStringx(analysis_type_list[i]) << ":");
+-		analysis_type=analysis_type_list[i];
+-		this->SetCurrentConfiguration(analysis_type);
+-	
+-		if(i==0){
+-			if(VerboseMProcessor()) _pprintLine_("      creating vertex degrees of freedom");
+-			VerticesDofx(vertices,parameters); //only call once, we only have one set of vertices
+-		}
+-
+-		if(VerboseMProcessor()) _pprintLine_("      resolving node constraints");
+-		SpcNodesx(nodes,constraints,parameters,analysis_type); 
+-
+-		if(VerboseMProcessor()) _pprintLine_("      creating nodal degrees of freedom");
+-		NodesDofx(nodes,parameters,analysis_type);
+-	
+-		if(VerboseMProcessor()) _pprintLine_("      configuring element and loads");
+-		ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters);
+-	}
+-	
+-	/*Close input file descriptors: */
+-	if(my_rank==0) pfclose(IOMODEL,inputfilename);
+-
+-	/*Add output file name to parameters: */
+-	this->parameters->AddObject(new StringParam(OutputfilenameEnum,outputfilename));
+-
+-}
+-
+-/*}}}*/
+-/*FUNCTION FemModel::destructor {{{*/
+-FemModel::~FemModel(){
+-
+-	/*Intermediary*/
+-	int i;
+-
+-	/*Delete all the datasets: */
+-	xDelete<int>(analysis_type_list);
+-	delete elements;
+-	delete nodes;
+-	delete vertices;
+-	delete constraints;
+-	delete loads;
+-	delete materials;
+-	delete parameters;
+-	delete results;
+-
+-}
+-/*}}}*/
+-
+-/*Object management*/
+-/*FUNCTION FemModel::Echo {{{*/
+-void FemModel::Echo(void){
+-
+-	_printLine_("FemModel echo: ");
+-	_printLine_("   number of fem models: " << nummodels);
+-	_printLine_("   analysis_type_list: ");
+-	for(int i=0;i<nummodels;i++)_printLine_("     " << i << ": " << EnumToStringx(analysis_type_list[i]));
+-	_printLine_("   current analysis_type: ");
+-	_printLine_("     " << analysis_counter << ": " << EnumToStringx(analysis_type_list[analysis_counter]));
+-
+-}
+-/*}}}*/
+-
+-/*Numerics: */
+-/*FUNCTION 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 
+-	 * analyses. For example: do a SurfaceSlopeX, SurfaceSlopeY, BedSlopeX and BedSlopeY analysis using the 
+-	 * Slope configuration.*/
+-
+-	int found=-1;
+-	for(int i=0;i<nummodels;i++){
+-		if (analysis_type_list[i]==configuration_type){
+-			found=i;
+-			break;
+-		}
+-	}
+-	if(found!=-1) analysis_counter=found;
+-	else _error2_("Could not find alias for analysis_type " << EnumToStringx(configuration_type) << " in list of FemModel analyses");
+-
+-	/*Now, plug analysis_counter and analysis_type inside the parameters: */
+-	this->parameters->SetParam(analysis_counter,AnalysisCounterEnum);
+-	this->parameters->SetParam(analysis_type,AnalysisTypeEnum);
+-	this->parameters->SetParam(configuration_type,ConfigurationTypeEnum);
+-
+-	/*configure elements, loads and nodes, for this new analysis: */
+-	this->elements->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters);
+-	this->nodes->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters);
+-	this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters);
+-
+-	#ifdef _HAVE_PETSC_
+-	/*take care of petsc options, that depend on this analysis type (present only after model processor)*/
+-	if(this->parameters->Exist(PetscOptionsStringsEnum)){
+-		PetscOptionsFromAnalysis(this->parameters,analysis_type);
+-		if(VerboseSolver()) _pprintLine_("      petsc Options set for analysis type: " << EnumToStringx(analysis_type));
+-	}
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION FemModel::SetCurrentConfiguration(int configuration_type){{{*/
+-void FemModel::SetCurrentConfiguration(int configuration_type){
+-
+-	/*overload: analysis_type = configuration_type: */
+-	this->SetCurrentConfiguration(configuration_type,configuration_type);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Contour.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Contour.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Contour.cpp	(revision 12821)
+@@ -1,95 +0,0 @@
+-/*! \file Contour.c
+- *  \sa Contour.h
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <string.h>
+-#include "./objects.h"
+-#include "../include/include.h"
+-#include "../io/io.h"
+-
+-/*Contour constructors and destructors:*/
+-/*FUNCTION Contour::Contour() default constructor {{{*/
+-Contour::Contour(){
+-	this->id=0;
+-	this->nods=0;
+-	this->x=NULL;
+-	this->y=NULL;
+-	this->closed=false;
+-}
+-/*}}}*/
+-/*FUNCTION Contour::Contour(int pid, int nods, IssmDouble* x, IssmDouble* y,bool closed) {{{*/
+-Contour::Contour(int pid,int pnods, IssmDouble* px, IssmDouble* py,bool pclosed){
+-	
+-	this->id=pid;
+-	this->nods=pnods;
+-	this->closed=pclosed;
+-	if(nods){
+-		this->x=xNew<IssmDouble>(nods);
+-		xMemCpy<IssmDouble>(this->x,px,nods);
+-		this->y=xNew<IssmDouble>(nods);
+-		xMemCpy<IssmDouble>(this->y,py,nods);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Contour::Contour() default constructor {{{*/
+-Contour::~Contour(){
+-	xDelete<IssmDouble>(this->x);
+-	xDelete<IssmDouble>(this->y);
+-}
+-/*}}}*/
+-
+-
+-/*Object virtual function resolutoin: */
+-/*FUNCTION Contour::Echo(){{{*/
+-void Contour::Echo(void){
+-
+-	int i;
+-
+-	_printLine_("Contour: " << id);
+-	_printLine_("   nods: " << nods);
+-	_printLine_("   closed: " << (closed?"true":"false"));
+-	if(nods){
+-	        _printLine_("   x,y:");
+-		for(i=0;i<nods;i++){
+-		        _printLine_(i << ": " << x[i] << "|" << y[i]);
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Contour::DeepEcho(){{{*/
+-void Contour::DeepEcho(void){
+-	this->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION Contour::Id(){{{*/
+-int Contour::Id(void){
+-	return id;
+-}
+-/*}}}*/
+-/*FUNCTION Contour::MyRank{{{*/
+-int    Contour::MyRank(void){ 
+-	extern int my_rank;
+-
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Contour::ObjectEnum{{{*/
+-int Contour::ObjectEnum(void){
+-
+-	return ContourEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Contour::copy {{{*/
+-Object* Contour::copy() {
+-
+-	return new Contour(*this); 
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Node.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Node.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Node.h	(revision 12821)
+@@ -1,113 +0,0 @@
+-/*!\file Node.h
+- * \brief: header file for node object
+- */
+-
+-#ifndef _NODE_H_
+-#define _NODE_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Object.h"
+-#include "../shared/shared.h"
+-class  Inputs;
+-class  Hook;
+-class  DofIndexing;
+-class  IoModel;
+-class  DataSet;
+-class  Vertices;
+-class  Vector;
+-class  Matrix;
+-#include "./Update.h"
+-/*}}}*/
+-
+-class Node: public Object ,public Update{
+-
+-	public: 
+-
+-		int	    id;  //unique arbitrary id.
+-		int     sid; //sid for "serial" id, ie the rank of this node in the nodes dataset, if the dataset was serial on 1 cpu.
+-				
+-		DofIndexing    indexing;
+-		Hook*          hvertex;
+-		Inputs*        inputs; //properties of this node
+-		int            analysis_type;
+-		IssmDouble         coord_system[3][3];
+-
+-		/*Node constructors, destructors {{{*/
+-		Node();
+-		Node(int node_id,int node_sid, int vertex_id,int io_index, IoModel* iomodel,int analysis_type);
+-		~Node();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy(){_error2_("Not implemented yet (similar to Elements)");};
+-		/*}}}*/
+-		/*Update virtual functions definitions: {{{*/
+-		
+-		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVector(int* vector, int name, int type);
+-		void  InputUpdateFromVector(bool* vector, int name, int type);
+-		void  InputUpdateFromMatrixDakota(IssmDouble* matrix,int nrows, int ncols, int name, int type);
+-		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
+-		void  InputUpdateFromConstant(IssmDouble constant, int name);
+-		void  InputUpdateFromConstant(int constant, int name);
+-		void  InputUpdateFromConstant(bool constant, int name);
+-		void  InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("Not implemented yet!");}
+-		/*}}}*/
+-		/*Node numerical routines {{{*/
+-		void   Configure(DataSet* nodes,Vertices* vertices);
+-		void   CreateNodalConstraints(Vector* ys);
+-		void   SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
+-		int    Sid(void); 
+-		int    GetVertexDof(void);
+-		int    GetVertexId(void);
+-#ifdef _HAVE_DIAGNOSTIC_
+-		void   GetCoordinateSystem(IssmDouble* coord_system_out);
+-#endif
+-		void   SetVertexDof(int in_dof);
+-		bool   InAnalysis(int analysis_type);
+-		int    GetApproximation();
+-		int    GetNumberOfDofs(int approximation_enum,int setenum);
+-		int    IsClone();
+-		void   ApplyConstraint(int dof,IssmDouble value);
+-		void   RelaxConstraint(int dof);
+-		void   DofInSSet(int dof);
+-		void   DofInFSet(int dof);
+-		int    GetDof(int dofindex,int setenum);
+-		void   CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s);
+-		int    GetConnectivity();
+-		void   GetDofList(int* poutdoflist,int approximation_enum,int setenum);
+-		void   GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
+-		int    GetDofList1(void);
+-		int    GetSidList(void);
+-		IssmDouble GetX();
+-		IssmDouble GetY();
+-		IssmDouble GetZ();
+-		IssmDouble GetSigma();
+-		int    IsOnBed();
+-		int    IsOnSurface();
+-		void   FreezeDof(int dof);
+-		int    IsFloating();
+-		int    IsGrounded();
+-		void   UpdateSpcs(IssmDouble* ys);
+-		void   VecMerge(Vector* ug, IssmDouble* vector_serial,int setenum);
+-		void   VecReduce(Vector* vector, IssmDouble* ug_serial,int setnum);
+-		
+-		/*}}}*/
+-		/*Dof Object routines {{{*/
+-		void  DistributeDofs(int* pdofcount,int setenum);
+-		void  OffsetDofs(int dofcount,int setenum);
+-		void  ShowTrueDofs(int* truerows,int ncols,int setenum);
+-		void  UpdateCloneDofs(int* alltruerows,int ncols,int setenum);
+-		void  SetClone(int* minranks);
+-		/*}}}*/
+-};
+-
+-#endif  /* _NODE_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/objects.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/objects.h	(revision 12821)
+@@ -1,185 +0,0 @@
+-/* \file objects.h
+- * \brief: prototype header for all objects.
+- */
+-
+-#ifndef ALL_OBJECTS_H_
+-#define ALL_OBJECTS_H_
+-
+-/*Abstract classes: */
+-#include "./Object.h"
+-
+-/*Objects: */
+-#include "./Hook.h"
+-#include "./DofIndexing.h"
+-#include "./Vertex.h"
+-#include "./Node.h"
+-#include "./Segment.h"
+-#include "./IoModel.h"
+-#include "./Patch.h"
+-#include "./Update.h"
+-
+-/*Constraints: */
+-#include "./Constraints/Constraint.h"
+-#include "./Constraints/SpcStatic.h"
+-#include "./Constraints/SpcTransient.h"
+-#include "./Constraints/SpcDynamic.h"
+-
+-/*Gauss*/
+-#include "./Gauss/GaussTria.h"
+-#include "./Gauss/GaussPenta.h"
+-
+-/*Loads: */
+-#include "./Loads/Load.h"
+-#include "./Loads/Friction.h"
+-#include "./Loads/Icefront.h"
+-#include "./Loads/Numericalflux.h"
+-#include "./Loads/Riftfront.h"
+-#include "./Loads/Penpair.h"
+-#include "./Loads/Pengrid.h"
+-
+-/*Elements: */
+-#include "./Elements/Element.h"
+-#include "./Elements/Penta.h"
+-#include "./Elements/PentaHook.h"
+-#include "./Elements/PentaRef.h"
+-#include "./Elements/Tria.h"
+-#include "./Elements/TriaHook.h"
+-#include "./Elements/TriaRef.h"
+-
+-/*KML parsing objects: */
+-#include "./KML/KML_Attribute.h"
+-#include "./KML/KML_Comment.h"
+-#include "./KML/KML_ColorStyle.h"
+-#include "./KML/KML_Container.h"
+-#include "./KML/KML_Document.h"
+-#include "./KML/KML_Feature.h"
+-#include "./KML/KML_File.h"
+-#include "./KML/KML_Folder.h"
+-#include "./KML/KML_Geometry.h"
+-#include "./KML/KML_GroundOverlay.h"
+-#include "./KML/KML_Icon.h"
+-#include "./KML/KML_LatLonBox.h"
+-#include "./KML/KML_LinearRing.h"
+-#include "./KML/KML_LineString.h"
+-#include "./KML/KML_LineStyle.h"
+-#include "./KML/KML_MultiGeometry.h"
+-#include "./KML/KML_Object.h"
+-#include "./KML/KML_Overlay.h"
+-#include "./KML/KML_Point.h"
+-#include "./KML/KML_Placemark.h"
+-#include "./KML/KML_Polygon.h"
+-#include "./KML/KML_PolyStyle.h"
+-#include "./KML/KML_Style.h"
+-#include "./KML/KML_StyleSelector.h"
+-#include "./KML/KML_SubStyle.h"
+-#include "./KML/KML_Unknown.h"
+-#include "./KML/KMLFileReadUtils.h"
+-
+-/*Option parsing objects: */
+-#include "./Options/Option.h"
+-#include "./Options/OptionDouble.h"
+-#include "./Options/OptionLogical.h"
+-#include "./Options/OptionChar.h"
+-#include "./Options/OptionStruct.h"
+-#include "./Options/OptionCell.h"
+-#include "./Options/OptionUtilities.h"
+-
+-/*Inputs: */
+-#include "./Inputs/Input.h"
+-#include "./Inputs/BoolInput.h"
+-#include "./Inputs/DoubleInput.h"
+-#include "./Inputs/IntInput.h"
+-#include "./Inputs/PentaP1Input.h"
+-#include "./Inputs/TriaP1Input.h"
+-#include "./Inputs/ControlInput.h"
+-#include "./Inputs/DatasetInput.h"
+-#include "./Inputs/TransientInput.h"
+-
+-/*ElementResults: */
+-#include "./ElementResults/ElementResult.h"
+-#include "./ElementResults/DoubleElementResult.h"
+-#include "./ElementResults/TriaP1ElementResult.h"
+-#include "./ElementResults/PentaP1ElementResult.h" 
+-#include "./ElementResults/BoolElementResult.h"
+-
+-/*ExternalResults: */
+-#include "./ExternalResults/ExternalResult.h"
+-#include "./ExternalResults/BoolExternalResult.h"
+-#include "./ExternalResults/DoubleExternalResult.h"
+-#include "./ExternalResults/DoubleVecExternalResult.h"
+-#include "./ExternalResults/DoubleMatExternalResult.h"
+-#include "./ExternalResults/IntExternalResult.h"
+-#include "./ExternalResults/PetscVecExternalResult.h"
+-#include "./ExternalResults/StringExternalResult.h"
+-
+-/*Materials: */
+-#include "./Materials/Material.h"
+-#include "./Materials/Matice.h"
+-#include "./Materials/Matpar.h"
+-
+-/*Numerics:*/
+-#include "./Numerics/ElementMatrix.h"
+-#include "./Numerics/ElementVector.h"
+-#include "./Numerics/Vector.h"
+-#include "./Numerics/Matrix.h"
+-
+-/*Params: */
+-#include "./Params/BoolParam.h"
+-#include "./Params/DoubleMatParam.h"
+-#include "./Params/DoubleTransientMatParam.h"
+-#include "./Params/DoubleMatArrayParam.h"
+-#include "./Params/DoubleParam.h"
+-#include "./Params/DoubleVecParam.h"
+-#include "./Params/IntParam.h"
+-#include "./Params/IntVecParam.h"
+-#include "./Params/IntMatParam.h"
+-#include "./Params/FileParam.h"
+-#include "./Params/Param.h"
+-#include "./Params/MatrixParam.h"
+-#include "./Params/VectorParam.h"
+-#include "./Params/StringArrayParam.h"
+-#include "./Params/StringParam.h"
+-#include "./Params/TransientParam.h"
+-
+-/*C objects: */
+-#include "./Contour.h"
+-#include "./FemModel.h"
+-#include "./OptArgs.h"
+-#include "./OptPars.h"
+-
+-/*Bamg: */
+-#include "./Bamg/BamgOpts.h"
+-#include "./Bamg/BamgGeom.h"
+-#include "./Bamg/BamgMesh.h"
+-#include "./Bamg/Metric.h"
+-#include "./Bamg/DoubleAndInt.h"
+-#include "./Bamg/Direction.h"
+-#include "./Bamg/BamgVertex.h"
+-#include "./Bamg/AdjacentTriangle.h"
+-#include "./Bamg/Edge.h"
+-#include "./Bamg/GeomVertex.h"
+-#include "./Bamg/GeomEdge.h"
+-#include "./Bamg/Curve.h"
+-#include "./Bamg/Triangle.h"
+-#include "./Bamg/ListofIntersectionTriangles.h"
+-#include "./Bamg/GeomSubDomain.h"
+-#include "./Bamg/SubDomain.h"
+-#include "./Bamg/VertexOnGeom.h"
+-#include "./Bamg/VertexOnVertex.h"
+-#include "./Bamg/VertexOnEdge.h"
+-#include "./Bamg/CrackedEdge.h"
+-#include "./Bamg/Mesh.h"
+-#include "./Bamg/Geometry.h"
+-#include "./Bamg/BamgQuadtree.h"
+-#include "./Bamg/SetOfE4.h"
+-
+-/*Kriging*/
+-#include "./Kriging/Variogram.h"
+-#include "./Kriging/GaussianVariogram.h"
+-#include "./Kriging/ExponentialVariogram.h"
+-#include "./Kriging/SphericalVariogram.h"
+-#include "./Kriging/PowerVariogram.h"
+-#include "./Kriging/Quadtree.h"
+-#include "./Kriging/Observation.h"
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Patch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Patch.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Patch.cpp	(revision 12821)
+@@ -1,175 +0,0 @@
+-/*!\file Patch.c
+- * \brief: implementation of the Patch object
+- */
+-
+-/*Include files: {{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include <math.h>
+-#include "./objects.h"
+-#include "../Container/Container.h"
+-#include "../io/io.h"
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-#include "../shared/shared.h"
+-#include "../include/include.h"
+-/*}}}*/
+-
+-/*Object constructors and destructors:*/
+-/*FUNCTION Patch::Patch() default constructor {{{*/
+-Patch::Patch(){
+-	this->numrows=0;
+-	this->numcols=0;
+-	this->maxvertices=0;
+-	this->maxnodes=0;
+-	this->values=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION Patch::Patch(int numrows, int maxvertices, int maxnodes){{{*/
+-Patch::Patch(int in_numrows, int in_maxvertices, int in_maxnodes){
+-
+-	int i,j;
+-	this->numrows=in_numrows;
+-	this->maxvertices=in_maxvertices;
+-	this->maxnodes=in_maxnodes;
+-    
+-	this->numcols=1  //enum_type
+-		+1           //step
+-		+1           //time 
+-		+1           //element id
+-		+1           //interpolation type
+-		+maxvertices //vertices
+-		+maxnodes;   //nodes
+-
+-	//Allocate values and fill with NaN:
+-	if (this->numcols*this->numrows==0){
+-		this->values=NULL;
+-	}
+-	else{
+-	        this->values=xNew<IssmDouble>(this->numcols*this->numrows);
+-		for(i=0;i<this->numrows;i++){
+-			for(j=0;j<this->numcols;j++){
+-				this->values[i*this->numcols+j]=NAN;
+-			}
+-		}
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Patch::~Patch(){{{*/
+-Patch::~Patch(){
+-	xDelete<IssmDouble>(values);
+-}
+-/*}}}*/
+-
+-/*Object methods*/
+-/*FUNCTION Patch::fillelementinfo{{{*/
+-void Patch::fillelementinfo(int count, int element_id, int* vertices_ids, int num_vertices){
+-
+-	int i;
+-	IssmDouble* row=NULL;
+-
+-	/*point to the start of the row: */
+-	row=this->values+count*this->numcols;
+-
+-	/*Let's remember what is on a row: 
+-	 enum_type step time element_id interpolation vertices_ids nodal_values
+-	 */
+-	row[3]=element_id;
+-	for(i=0;i<num_vertices;i++){
+-		row[5+i]=vertices_ids[i];
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Patch::fillresultinfo{{{*/
+-void Patch::fillresultinfo(int count,int enum_type,int step, IssmDouble time, int interpolation, IssmDouble* nodal_values, int num_nodes){
+-
+-	int i;
+-	IssmDouble* row=NULL;
+-
+-	/*point to the start of the row: */
+-	row=this->values+count*this->numcols;
+-
+-	/*Let's remember what is on a row: 
+-	 enum_type step time element_id interpolation vertices_ids nodal_values
+-	 */
+-	row[0]=enum_type;
+-	row[1]=(IssmDouble)step;
+-	row[2]=time;
+-	row[4]=interpolation;
+-	for(i=0;i<num_nodes;i++){
+-		row[5+this->maxvertices+i]=nodal_values[i];
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Patch::Gather{{{*/
+-void Patch::Gather(void){
+-
+-	int         i;
+-	int         count;
+-	extern int  my_rank;
+-	extern int  num_procs;
+-	int         total_numrows;
+-	int         node_numrows;
+-	IssmDouble     *total_values  = NULL;
+-	#ifdef _HAVE_MPI_
+-	MPI_Status  status;
+-	#endif
+-
+-	/*First, figure out total number of rows combining all the cpus: */
+-	#ifdef _HAVE_MPI_
+-	MPI_Reduce(&this->numrows,&total_numrows,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
+-	MPI_Bcast(&total_numrows,1,MPI_INT,0,MPI_COMM_WORLD);
+-	#else
+-	total_numrows=this->numrows;
+-	#endif
+-
+-	/*return if patch empty*/
+-	if(total_numrows==0) return;
+-
+-	/*Now, allocate buffer to holds all the values, on node 0: */
+-	if(my_rank==0)total_values=xNew<IssmDouble>(this->numcols*total_numrows);
+-
+-	/*Start by copying node 0 values onto total_values: */
+-	if(my_rank==0){
+-		count=0;
+-		xMemCpy<IssmDouble>(total_values+count,this->values,this->numcols*this->numrows);
+-		count+=this->numrows*this->numcols;
+-	}
+-
+-	/*Now, ask other nodes to send their values: */
+-	#ifdef _HAVE_MPI_
+-	for (i=1;i<num_procs;i++){
+-		if (my_rank==i){ 
+-			MPI_Send(&this->numrows,1,MPI_INT,0,1,MPI_COMM_WORLD);   
+-			if (this->numrows)MPI_Send(this->values,this->numrows*this->numcols,MPI_DOUBLE,0,1,MPI_COMM_WORLD); 
+-		}
+-		if (my_rank==0){
+-			MPI_Recv(&node_numrows,1,MPI_INT,i,1,MPI_COMM_WORLD,&status); 
+-			if (node_numrows)MPI_Recv(total_values+count,node_numrows*this->numcols,MPI_DOUBLE,i,1,MPI_COMM_WORLD,&status);
+-			count+=node_numrows*this->numcols;
+-		}
+-	}	
+-	#endif
+-
+-	/*Now, node 0 has total_values, of size total_numrows*this->numcols. Update the fields in the patch, to reflect this new 
+-	 * reality. For other cpus, no point in keeping their data anymore: */
+-	if(my_rank==0){
+-		this->numrows=total_numrows;
+-		xDelete<IssmDouble>(this->values);
+-		this->values=total_values;
+-	}
+-	#ifdef _HAVE_MPI_
+-	else{
+-		this->numrows=0;
+-		xDelete<IssmDouble>(this->values);
+-	}
+-	#endif
+-}/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Hook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Hook.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Hook.cpp	(revision 12821)
+@@ -1,266 +0,0 @@
+-/*!\file Hook.cpp
+- * \brief: implementation of the Hook object: see Hook.h for more explanations.
+- */
+-
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "./objects.h"
+-#include "../Container/Container.h"
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-#include "../shared/shared.h"
+-#include "../include/include.h"
+-
+-
+-/*Constructor/Destructors*/
+-/*FUNCTION Hook::Hook(){{{*/
+-Hook::Hook(){
+-	this->num=0;
+-	this->objects=NULL;
+-	this->ids=NULL;
+-	this->offsets=NULL;
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Hook::Hook(int* ids, int num){{{*/
+-Hook::Hook(int* in_ids, int in_num){
+-
+-	/*Intermediaries*/
+-	int i;
+-
+-	/*Get number of objects to hook*/
+-	this->num=in_num;
+-
+-	/*Get out if num=0*/
+-	if (num==0){
+-		/*Empty hook*/
+-		this->ids=NULL;
+-		this->objects=NULL;
+-		this->offsets=NULL;
+-	}
+-	else{
+-		/*Allocate: */
+-		this->objects=xNew<Object*>(this->num);
+-		this->ids=xNew<int>(this->num);
+-		this->offsets=xNew<int>(this->num);
+-
+-		/*Copy ids: */
+-		for (i=0;i<this->num;i++){
+-			this->ids[i]=in_ids[i];
+-			this->objects[i]=NULL;
+-			this->offsets[i]=0;
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Hook::~Hook(){{{*/
+-Hook::~Hook(){
+-	/*deallocate: */
+-	xDelete<Object*>(this->objects);
+-	xDelete<int>(this->ids);
+-	xDelete<int>(this->offsets);
+-	return;
+-}
+-/*}}}*/
+-
+-/*Some of the Object functionality: */
+-/*FUNCTION Hook::Echo{{{*/
+-void Hook::Echo(void){
+-
+-	int i;
+-	if (num){
+-		_printLine_("   Hook: ");
+-		_printLine_("      num=" << this->num);
+-		_printString_("      ids: ");
+-		for (i=0;i<this->num;i++) _printString_(this->ids[i] << " ");
+-		_printLine_("");
+-		_printString_("      offsets: ");
+-		for (i=0;i<this->num;i++) _printString_(this->offsets[i] << " ");
+-		_printLine_("");
+-	}
+-	else{
+-		_printLine_("   Hook: num=0 ");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Hook::DeepEcho{{{*/
+-void Hook::DeepEcho(void){
+-
+-	int i;
+-	if (num){
+-		_printLine_("   Hook: ");
+-		_printLine_("      num=" << this->num);
+-		_printString_("      ids: ");
+-		for (i=0;i<this->num;i++) _printString_(this->ids[i] << " ");
+-		_printLine_("");
+-		_printString_("      offsets: ");
+-		for (i=0;i<this->num;i++) _printString_(this->offsets[i] << " ");
+-		_printLine_("");
+-		if (!objects) _printLine_("      warning: object not hooked yet");
+-		else{
+-			_printString_("      objects:\n   ");
+-			for (i=0;i<this->num;i++){
+-				_printLine_("         object " << i);
+-				if(objects[i]) objects[i]->DeepEcho();
+-				else           _printLine_("            no object hooked yet (not configured)");
+-			}
+-		}
+-	}
+-	else{
+-		_printLine_("   Hook: num=0 ");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Hook::copy {{{*/
+-Object* Hook::copy(void){
+-
+-	int i;
+-
+-	/*output: */
+-	Hook* output=NULL;
+-
+-	/*initalize output: */
+-	output=new Hook();
+-
+-	/*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(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;
+-}
+-/*}}}*/
+-
+-/*Hook management: */
+-/*FUNCTION Hook::configure{{{*/
+-void Hook::configure(DataSet* dataset){
+-
+-	/*intermediary: */
+-	Object* object=NULL;
+-	int i;
+-
+-	/*Checks if debugging mode*/
+-	_assert_(this->num==0 || this->ids!=NULL);
+-
+-	for(i=0;i<this->num;i++){
+-
+-		/*is this object id -1? If so, drop this search, it was not requested: */
+-		if (this->ids[i]==-1) continue;
+-
+-		/*Check whether existing this->objects are correct: */
+-		if(this->objects[i]){
+-			if(this->objects[i]->Id()==this->ids[i]) continue; //this node is good.
+-			else this->objects[i]=NULL; //this node was incorrect, reset it.
+-		}
+-
+-		/*May be the object this->offsets into this->objects are valid?: */
+-		if(this->offsets[i]!=UNDEF){
+-			/* Look at the this->offsets[i]'th node in the nodes dataset. If it has the correct id, 
+-			 * we are good: */
+-			object=(Object*)dataset->GetObjectByOffset(this->offsets[i]);
+-			if (object->Id()==this->ids[i]){
+-				this->objects[i]=object;
+-				continue;
+-			}
+-			else this->offsets[i]=UNDEF; //object offset was wrong, reset it.
+-		}
+-
+-		/*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){
+-			this->objects[i]=(Object*)dataset->GetObjectById(this->offsets+i,this->ids[i]); //remember the offset for later on.
+-			/*check the id is correct!: */
+-			if (this->objects[i]->Id()!=this->ids[i]) _error2_("wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << "  in resolved pointer!");
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Hook::delivers{{{*/
+-Object* Hook::delivers(void){
+-	
+-	/*first, check that we only have one T object in our object list: */
+-	if (this->num!=1) _error2_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");
+-
+-	/*check NULL: */
+-	if (this->objects==NULL) _error2_("hook is not pointing to any object, objects pointer is NULL");
+-
+-	return *objects;
+-}
+-
+-/*}}}*/
+-/*FUNCTION Hook::deliverp{{{*/
+-Object** Hook::deliverp(void){
+-	return objects;
+-}
+-/*}}}*/
+-/*FUNCTION Hook::Ids{{{*/
+-int* Hook::Ids(void){
+-	return this->ids;
+-}
+-/*}}}*/
+-/*FUNCTION Hook::GetNum{{{*/
+-int Hook::GetNum(void){
+-	return this->num;
+-}
+-/*}}}*/
+-/*FUNCTION Hook::GetObjects{{{*/
+-Object** Hook::GetObjects(void){
+-	return this->objects;
+-}
+-/*}}}*/
+-/*FUNCTION Hook::GetOffsets{{{*/
+-int* Hook::GetOffsets(void){
+-	return this->offsets;
+-}
+-/*}}}*/
+-/*FUNCTION Hook::Spawn{{{*/
+-Hook* Hook::Spawn(int* indices, int numindices){
+-
+-	int i;
+-
+-	/*output: */
+-	Hook* output=NULL;
+-
+-	/*allocate: */
+-	output=new Hook();
+-
+-	/*If this Hook is empty, simply return*/
+-	if(this->num==0){
+-		output->num=0;
+-		return output;
+-	}
+-
+-	/*Else, check that we are requesting a half of num*/
+-	if (numindices>this->num) _error2_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects");
+-
+-	/*go pickup the correct objects, ids and offsets :*/
+-	output->num=numindices;
+-	if(output->num<1) _error2_("Trying to spawn an empty ElementProperties!");
+-
+-	output->objects=xNew<Object*>(output->num);
+-	output->ids=xNew<int>(output->num);
+-	output->offsets=xNew<int>(output->num);
+-
+-	for(i=0;i<output->num;i++){
+-		output->objects[i]=this->objects[indices[i]];
+-		output->ids[i]=this->ids[indices[i]];
+-		output->offsets[i]=this->offsets[indices[i]];
+-	}
+-
+-	return output;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DofIndexing.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DofIndexing.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DofIndexing.h	(revision 12821)
+@@ -1,54 +0,0 @@
+-/*!\file: DofIndexing.h
+- * \brief prototype for DofIndexing.h
+- */ 
+-
+-#ifndef _DOFINDEXING_H_
+-#define  _DOFINDEXING_H_
+-
+-#include "../include/include.h"
+-
+-class DofIndexing{
+-	
+-	public:
+-
+-		/*sizes: */
+-		int gsize; //number of dofs for a node
+-		int fsize; //number of dofs solver for
+-		int ssize; //number of constrained dofs
+-
+-		/*partitioning: */
+-		int     clone;   //this node is replicated from another one 
+-
+-		/*boundary conditions sets: */
+-		bool*     f_set; //is dof on f-set (on which we solve)
+-		bool*     s_set; //is dof on s-set (on which boundary conditions -dirichlet- are applied)
+-		IssmDouble*   svalues; //list of constraint values. size g_size, for ease of use.
+-
+-		/*types of dofs: */
+-		int*     doftype; //approximation type of the dofs (used only for coupling), size g_size
+-		
+-		/*list of degrees of freedom: */
+-		int*     gdoflist; //dof list in g_set
+-		int*     fdoflist; //dof list in f_set
+-		int*     sdoflist; //dof list in s_set
+-
+-
+-		/*DofIndexing constructors, destructors {{{*/
+-		DofIndexing();
+-		DofIndexing(int g_size);
+-		void Init(int g_size,int* doftype);
+-		void InitSet(int setenum);
+-		DofIndexing(DofIndexing* properties);
+-		~DofIndexing();
+-		/*}}}*/
+-		/*Object like functionality: {{{*/
+-		void  Echo(void); 
+-		void  DeepEcho(void); 
+-		void  copy(DofIndexing* properties);
+-		/*}}}*/
+-		/*DofIndexing management: {{{*/
+-		DofIndexing* Spawn(int* indices, int numindices);
+-		/*}}}*/
+-
+-};
+-#endif //ifndef _DOFINDEXING_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Segment.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Segment.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Segment.h	(revision 12821)
+@@ -1,37 +0,0 @@
+-/*!\file Segment.h
+- * \brief: header file for node object
+- */
+-
+-#ifndef _SEGMENT_H_
+-#define _SEGMENT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Object.h"
+-/*}}}*/
+-
+-class Segment: public Object{
+-
+-	public:
+-		int eid;
+-		IssmDouble x1;
+-		IssmDouble y1;
+-		IssmDouble x2;
+-		IssmDouble y2;
+-
+-		/*Segment constructors, destructors {{{*/
+-		Segment();
+-		Segment(int eid,IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2);
+-		~Segment();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-};
+-
+-#endif  /* _SEGMENT_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.cpp	(revision 12821)
+@@ -1,95 +0,0 @@
+-/*!\file ExponentialVariogram.c
+- * \brief: implementation of the ExponentialVariogram object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-
+-/*ExponentialVariogram constructors and destructor*/
+-/*FUNCTION ExponentialVariogram::ExponentialVariogram(){{{*/
+-ExponentialVariogram::ExponentialVariogram(){
+-	this->nugget = 0.2;
+-	this->sill   = 1;
+-	this->range  = SQRT3;
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION ExponentialVariogram::ExponentialVariogram(Options* options){{{*/
+-ExponentialVariogram::ExponentialVariogram(Options* options){
+-
+-	/*Defaults*/
+-	this->nugget = 0.2;
+-	this->sill   = 1;
+-	this->range  = SQRT3;
+-
+-	/*Overwrite from options*/
+-	if(options->GetOption("nugget")) options->Get(&this->nugget,"nugget");
+-	if(options->GetOption("sill"))   options->Get(&this->sill,"sill");
+-	if(options->GetOption("range"))  options->Get(&this->range,"range");
+-
+-	/*Checks*/
+-	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+-}
+-/*}}}*/
+-/*FUNCTION ExponentialVariogram::~ExponentialVariogram(){{{*/
+-ExponentialVariogram::~ExponentialVariogram(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION ExponentialVariogram::Echo {{{*/
+-void ExponentialVariogram::Echo(void){
+-	_printLine_("ExponentialVariogram");
+-	_printLine_("   nugget: " << this->nugget);
+-	_printLine_("   sill  : " << this->sill);
+-	_printLine_("   range : " << this->range);
+-}
+-/*}}}*/
+-
+-/*Variogram function*/
+-/*FUNCTION ExponentialVariogram::Covariance{{{*/
+-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)
+-	 * so
+-	 *    C(h) = sill - gamma                                            */
+-	double h,a,cova;
+-
+-	/*Calculate length*/
+-	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
+-
+-	/*If h is too small, return sill*/
+-	if(h<0.0000001) return sill;
+-
+-	/*compute covariance*/
+-	a     = 1./3.;
+-	cova = (sill-nugget)*exp(-h/(a*range));
+-	return cova;
+-}
+-/*}}}*/
+-/*FUNCTION ExponentialVariogram::SemiVariogram{{{*/
+-double ExponentialVariogram::SemiVariogram(double deltax,double deltay){
+-	/*http://en.wikipedia.org/wiki/Variogram*/
+-	double h,a,gamma;
+-
+-	/*Calculate length*/
+-	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
+-
+-	/*return semi-variogram*/
+-	a     = 1./3.;
+-	gamma = (sill-nugget)*(1-exp(-h/(a*range))) + nugget;
+-	return gamma;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Quadtree.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Quadtree.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Quadtree.h	(revision 12821)
+@@ -1,66 +0,0 @@
+-
+-#ifndef _QUADTREE_H
+-#define _QUADTREE_H
+-
+-class Observation;
+-
+-class Quadtree{
+-
+-	private:
+-		/* A quadtree box contains up to 4 points (locations). 4 new quadtree boxes are
+-		 * created if a fifth point is added to the same box. A Quadtree box is therefore
+-		 * composed of EITHER:
+-		 * - up to 4 vertices
+-		 * - 4 "sub" quadtree boxes*/
+-
+-		class QuadtreeBox: public Object{ 
+-			public:
+-				int    nbitems; // number of current vertices in the box
+-				double xcenter; // x position of the center (double)
+-				double ycenter; // x position of the center (double)
+-				double length;  // width of the box
+-				union{
+-					QuadtreeBox *box[4];
+-					Observation *obs[4];
+-				};
+-
+-				/*Object functions (Needed because the Quadtree uses a Container*/
+-				void    Echo();
+-				void    DeepEcho()  {_error2_("not implemented yet"); };
+-				int     Id()        {_error2_("not implemented yet"); };
+-				int     MyRank()    {_error2_("not implemented yet"); };
+-				int     ObjectEnum(){_error2_("not implemented yet"); };
+-				Object *copy()      {_error2_("not implemented yet"); };
+-
+-				/*Methods*/
+-				int          IsWithinRange(double  x,double y,double range);
+-				void         RangeSearch(int *indices,int *pnobs,double x,double y,double range);
+-				void         WriteObservations(int *indices,int *pnobs);
+-
+-		};
+-
+-		/*Quadtree private Fields*/
+-		DataSet* boxcontainer;
+-
+-	public:
+-		int          MaxDepth;          // maximum number of subdivision
+-		QuadtreeBox *root;              // main box
+-		int          NbQuadtreeBox;     // total number of boxes
+-		int          NbObs;             // number of points
+-
+-		Quadtree();
+-		Quadtree(double xmin,double xmax,double ymin,double ymax,int maxdepth_in);
+-		~Quadtree();
+-		void         Add(Observation *observation);
+-		void         AddAndAverage(double x,double y,double value);
+-		void         ClosestObs(int *pindex,double x,double y);
+-		void         DeepEcho(void);
+-		void         Echo(void);
+-		void         IntergerCoordinates(int *xi,int *yi,double x,double y);
+-		QuadtreeBox *NewQuadtreeBox(double xcenter,double ycenter,double length);
+-		QuadtreeBox *NewQuadtreeBox(QuadtreeBox* master,int index);
+-		void         QuadtreeDepth(int *A,int xi,int yi);
+-		void         QuadtreeDepth2(int *A,int xi,int yi);
+-		void         RangeSearch(int **pindices,int *pnobs,double x,double y,double range);
+-};
+-#endif //_QUADTREE_H
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Observation.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Observation.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Observation.h	(revision 12821)
+@@ -1,35 +0,0 @@
+-/*! \file Observation.h 
+- *  \brief: header file for Observation object
+- */
+-
+-#ifndef _OBSERVATION_H_
+-#define _OBSERVATION_H_
+-
+-#include "../Object.h"
+-
+-class Observation: public Object{
+-
+-	public:
+-		double x,y;
+-		int    xi,yi;
+-		int    index;
+-		double weight;
+-		double value;
+-
+-		/*Observation constructors, destructors*/
+-		Observation();
+-		Observation(double x_in,double y_in,int xi_in,int yi_in,int index_in,double value_in);
+-		~Observation();
+-
+-		/*Object virtual functions definitions*/
+-		void    Echo();
+-		void    DeepEcho()  {_error2_("Not implemented yet"); };
+-		int     Id()        {_error2_("Not implemented yet"); };
+-		int     MyRank()    {_error2_("Not implemented yet"); };
+-		int     ObjectEnum(){_error2_("Not implemented yet"); };
+-		Object *copy()      {_error2_("Not implemented yet"); };
+-
+-		/*Management*/
+-		void WriteXYObs(double* px,double* py,double* pobs);
+-};
+-#endif  /* _OBSERVATION_*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/GaussianVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/GaussianVariogram.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/GaussianVariogram.cpp	(revision 12821)
+@@ -1,99 +0,0 @@
+-/*!\file GaussianVariogram.c
+- * \brief: implementation of the GaussianVariogram object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-
+-/*GaussianVariogram constructors and destructor*/
+-/*FUNCTION GaussianVariogram::GaussianVariogram(){{{*/
+-GaussianVariogram::GaussianVariogram(){
+-	this->nugget = 0.2;
+-	this->sill   = 1;
+-	this->range  = SQRT3;
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION GaussianVariogram::GaussianVariogram(Options* options){{{*/
+-GaussianVariogram::GaussianVariogram(Options* options){
+-
+-	/*Defaults*/
+-	this->nugget = 0.2;
+-	this->sill   = 1;
+-	this->range  = SQRT3;
+-
+-	/*Overwrite from options*/
+-	if(options->GetOption("nugget")) options->Get(&this->nugget,"nugget");
+-	if(options->GetOption("sill"))   options->Get(&this->sill,"sill");
+-	if(options->GetOption("range"))  options->Get(&this->range,"range");
+-
+-	/*Checks*/
+-	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+-}
+-/*}}}*/
+-/*FUNCTION GaussianVariogram::~GaussianVariogram(){{{*/
+-GaussianVariogram::~GaussianVariogram(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION GaussianVariogram::Echo {{{*/
+-void GaussianVariogram::Echo(void){
+-	_printLine_("GaussianVariogram");
+-	_printLine_("   nugget: " << this->nugget);
+-	_printLine_("   sill  : " << this->sill);
+-	_printLine_("   range : " << this->range);
+-}
+-/*}}}*/
+-
+-/*Variogram function*/
+-/*FUNCTION GaussianVariogram::Covariance{{{*/
+-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)
+-	 * so
+-	 *    C(h) = sill - gamma                                            */
+-	double h2,a,cova;
+-
+-	/*Calculate length square*/
+-	h2=pow(deltax,2.)+pow(deltay,2.);
+-
+-	/*If h is too small, return sill*/
+-	if(h2<0.0000001) return sill;
+-
+-	/*compute covariance*/
+-	a     = 1./3.;
+-	cova = (sill-nugget)*exp(-h2/(a*range*range));
+-
+-	return cova;
+-}
+-/*}}}*/
+-/*FUNCTION GaussianVariogram::SemiVariogram{{{*/
+-double GaussianVariogram::SemiVariogram(double deltax,double deltay){
+-	/*http://en.wikipedia.org/wiki/Variogram*/
+-	double h2,a,gamma;
+-
+-	/*Calculate length square*/
+-	h2=pow(deltax,2.)+pow(deltay,2.);
+-
+-	/*return semi-variogram*/
+-	a     = 1./3.;
+-	gamma = (sill-nugget)*(1.-exp(-h2/(a*range*range))) + nugget;
+-
+-	//if(h2>1000*1000) _printLine_("gamma = " << gamma << " h= " << sqrt(h2));
+-	_printLine_("h = " << sqrt(h2) << " gamma = " << gamma);
+-	return gamma;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/SphericalVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/SphericalVariogram.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/SphericalVariogram.cpp	(revision 12821)
+@@ -1,98 +0,0 @@
+-/*!\file SphericalVariogram.c
+- * \brief: implementation of the SphericalVariogram object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-
+-/*SphericalVariogram constructors and destructor*/
+-/*FUNCTION SphericalVariogram::SphericalVariogram(){{{*/
+-SphericalVariogram::SphericalVariogram(){
+-	this->nugget = 0.2;
+-	this->sill   = 1;
+-	this->range  = SQRT3;
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION SphericalVariogram::SphericalVariogram(Options* options){{{*/
+-SphericalVariogram::SphericalVariogram(Options* options){
+-
+-	/*Defaults*/
+-	this->nugget = 0.2;
+-	this->sill   = 1;
+-	this->range  = SQRT3;
+-
+-	/*Overwrite from options*/
+-	if(options->GetOption("nugget")) options->Get(&this->nugget,"nugget");
+-	if(options->GetOption("sill"))   options->Get(&this->sill,"sill");
+-	if(options->GetOption("range"))  options->Get(&this->range,"range");
+-
+-	/*Checks*/
+-	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+-}
+-/*}}}*/
+-/*FUNCTION SphericalVariogram::~SphericalVariogram(){{{*/
+-SphericalVariogram::~SphericalVariogram(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION SphericalVariogram::Echo {{{*/
+-void SphericalVariogram::Echo(void){
+-	_printLine_("SphericalVariogram");
+-	_printLine_("   nugget: " << this->nugget);
+-	_printLine_("   sill  : " << this->sill);
+-	_printLine_("   range : " << this->range);
+-}
+-/*}}}*/
+-
+-/*Variogram function*/
+-/*FUNCTION SphericalVariogram::Covariance{{{*/
+-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)
+-	 * so
+-	 *    C(h) = sill - gamma                                            */
+-	double h,cova;
+-
+-	/*Calculate length square*/
+-	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
+-
+-	/*return covariance*/
+-	if(h<=range)
+-	 cova = (sill-nugget)*(1 - (3*h)/(2*range) + pow(h,3.)/(2*pow(range,3.)) );
+-	else
+-	 cova = 0.;
+-
+-	return cova;
+-}
+-/*}}}*/
+-/*FUNCTION SphericalVariogram::SemiVariogram{{{*/
+-double SphericalVariogram::SemiVariogram(double deltax,double deltay){
+-	/*http://en.wikipedia.org/wiki/Variogram*/
+-	double h,gamma;
+-
+-	/*Calculate length square*/
+-	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
+-
+-	/*return semi-variogram*/
+-	if(h<=range)
+-	 gamma = (sill-nugget)*( (3*h)/(2*range) - pow(h,3.)/(2*pow(range,3.)) ) + nugget;
+-	else
+-	 gamma = sill;
+-
+-	return gamma;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.h	(revision 12821)
+@@ -1,35 +0,0 @@
+-/*! \file ExponentialVariogram.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-#ifndef _EXPONENTIALVARIOGRAM_H_
+-#define _EXPONENTIALVARIOGRAM_H_
+-
+-/*Headers:*/
+-#include "./Variogram.h"
+-
+-class ExponentialVariogram: public Variogram{
+-
+-	public:
+-		double nugget; //The height of the jump of the semivariogram at the discontinuity at the origin
+-		double sill;   //Limit of the variogram tending to infinity lag distances
+-		double range;  //The distance in which the difference of the variogram from the sill becomes negligible
+-
+-		/*ExponentialVariogram constructors, destructors*/
+-		ExponentialVariogram();
+-		ExponentialVariogram(Options* options);
+-		~ExponentialVariogram();
+-
+-		/*Object virtual functions definitions*/
+-		void  Echo();
+-		void  DeepEcho(){_error2_("Not implemented yet");};
+-		int   Id(){_error2_("Not implemented yet");}; 
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){_error2_("Not implemented yet");};
+-		Object* copy(){_error2_("Not implemented yet");};
+-
+-		/*Variogram functions*/
+-		double SemiVariogram(double deltax,double deltay);
+-		double Covariance(double deltax,double deltay);
+-};
+-#endif  /* _EXPONENTIALVARIOGRAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/PowerVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/PowerVariogram.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/PowerVariogram.cpp	(revision 12821)
+@@ -1,94 +0,0 @@
+-/*!\file PowerVariogram.c
+- * \brief: implementation of the PowerVariogram object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-
+-/*PowerVariogram constructors and destructor*/
+-/*FUNCTION PowerVariogram::PowerVariogram(){{{*/
+-PowerVariogram::PowerVariogram(){
+-	this->nugget = 0.2;
+-	this->slope  = 1.;
+-	this->power  = 1.;
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION PowerVariogram::PowerVariogram(Options* options){{{*/
+-PowerVariogram::PowerVariogram(Options* options){
+-
+-	/*Defaults*/
+-	this->nugget = 0.2;
+-	this->slope  = 1.;
+-	this->power  = 1.;
+-
+-	/*Overwrite from options*/
+-	if(options->GetOption("nugget")) options->Get(&this->nugget,"nugget");
+-	if(options->GetOption("slope"))  options->Get(&this->slope,"slope");
+-	if(options->GetOption("power"))  options->Get(&this->power,"power");
+-
+-	/*Checks*/
+-	if(power<=0 || power>=2) _error2_("power must be betwwen 0 and 2 (0 < power < 2)");
+-	if(slope<=0) _error2_("slope must be positive");
+-}
+-/*}}}*/
+-/*FUNCTION PowerVariogram::~PowerVariogram(){{{*/
+-PowerVariogram::~PowerVariogram(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION PowerVariogram::Echo {{{*/
+-void PowerVariogram::Echo(void){
+-	_printLine_("PowerVariogram");
+-	_printLine_("   nugget: " << this->nugget);
+-	_printLine_("   slope : " << this->slope);
+-	_printLine_("   power : " << this->power);
+-}
+-/*}}}*/
+-
+-/*Variogram function*/
+-/*FUNCTION PowerVariogram::Covariance{{{*/
+-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)
+-	 * so
+-	 *    C(h) = sill - gamma                                            */
+-	double h,cova;
+-
+-	/*Calculate length square*/
+-	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
+-
+-	/*return covariance*/
+-	cova = 9999. - this->slope*pow(h,this->power);
+-
+-	return cova;
+-}
+-/*}}}*/
+-/*FUNCTION PowerVariogram::SemiVariogram{{{*/
+-double PowerVariogram::SemiVariogram(double deltax,double deltay){
+-	/*http://en.wikipedia.org/wiki/Variogram*/
+-	double h,gamma;
+-
+-	/*Calculate length square*/
+-	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
+-
+-	/*return semi-variogram*/
+-	gamma = this->nugget + this->slope*pow(h,this->power);
+-
+-	//if(h>1000) _printLine_("gamma = " << gamma << " h=" << h);
+-	return gamma;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/GaussianVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/GaussianVariogram.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/GaussianVariogram.h	(revision 12821)
+@@ -1,35 +0,0 @@
+-/*! \file GaussianVariogram.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-#ifndef _GAUSSIANVARIOGRAM_H_
+-#define _GAUSSIANVARIOGRAM_H_
+-
+-/*Headers:*/
+-#include "./Variogram.h"
+-
+-class GaussianVariogram: public Variogram{
+-
+-	public:
+-		double nugget; //The height of the jump of the semivariogram at the discontinuity at the origin
+-		double sill;   //Limit of the variogram tending to infinity lag distances
+-		double range;  //The distance in which the difference of the variogram from the sill becomes negligible
+-
+-		/*GaussianVariogram constructors, destructors*/
+-		GaussianVariogram();
+-		GaussianVariogram(Options* options);
+-		~GaussianVariogram();
+-
+-		/*Object virtual functions definitions*/
+-		void  Echo();
+-		void  DeepEcho(){_error2_("Not implemented yet");};
+-		int   Id(){_error2_("Not implemented yet");}; 
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){_error2_("Not implemented yet");};
+-		Object* copy(){_error2_("Not implemented yet");};
+-
+-		/*Variogram functions*/
+-		double SemiVariogram(double deltax,double deltay);
+-		double Covariance(double deltax,double deltay);
+-};
+-#endif  /* _GAUSSIANVARIOGRAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/SphericalVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/SphericalVariogram.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/SphericalVariogram.h	(revision 12821)
+@@ -1,35 +0,0 @@
+-/*! \file SphericalVariogram.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-#ifndef _SPHERICALVARIOGRAM_H_
+-#define _SPHERICALVARIOGRAM_H_
+-
+-/*Headers:*/
+-#include "./Variogram.h"
+-
+-class SphericalVariogram: public Variogram{
+-
+-	public:
+-		double nugget; //The height of the jump of the semivariogram at the discontinuity at the origin
+-		double sill;   //Limit of the variogram tending to infinity lag distances
+-		double range;  //The distance in which the difference of the variogram from the sill becomes negligible
+-
+-		/*SphericalVariogram constructors, destructors*/
+-		SphericalVariogram();
+-		SphericalVariogram(Options* options);
+-		~SphericalVariogram();
+-
+-		/*Object virtual functions definitions*/
+-		void  Echo();
+-		void  DeepEcho(){_error2_("Not implemented yet");};
+-		int   Id(){_error2_("Not implemented yet");}; 
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){_error2_("Not implemented yet");};
+-		Object* copy(){_error2_("Not implemented yet");};
+-
+-		/*Variogram functions*/
+-		double SemiVariogram(double deltax,double deltay);
+-		double Covariance(double deltax,double deltay);
+-};
+-#endif  /* _SPHERICALVARIOGRAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/PowerVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/PowerVariogram.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/PowerVariogram.h	(revision 12821)
+@@ -1,35 +0,0 @@
+-/*! \file PowerVariogram.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-#ifndef _POWERVARIOGRAM_H_
+-#define _POWERVARIOGRAM_H_
+-
+-/*Headers:*/
+-#include "./Variogram.h"
+-
+-class PowerVariogram: public Variogram{
+-
+-	public:
+-		double nugget; //The height of the jump of the semivariogram at the discontinuity at the origin
+-		double slope;  
+-		double power; 
+-
+-		/*PowerVariogram constructors, destructors*/
+-		PowerVariogram();
+-		PowerVariogram(Options* options);
+-		~PowerVariogram();
+-
+-		/*Object virtual functions definitions*/
+-		void  Echo();
+-		void  DeepEcho(){_error2_("Not implemented yet");};
+-		int   Id(){_error2_("Not implemented yet");}; 
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){_error2_("Not implemented yet");};
+-		Object* copy(){_error2_("Not implemented yet");};
+-
+-		/*Variogram functions*/
+-		double SemiVariogram(double deltax,double deltay);
+-		double Covariance(double deltax,double deltay);
+-};
+-#endif  /* _POWERVARIOGRAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Quadtree.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Quadtree.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Quadtree.cpp	(revision 12821)
+@@ -1,607 +0,0 @@
+-#include "../objects.h"
+-
+-/*DOCUMENTATION What is a Quadtree? {{{
+- * A Quadtree is a very simple way to group vertices according
+- * to their locations. A square that holds all the points of the mesh
+- * (or the geometry) is divided into 4 boxes. As soon as one box
+- * hold more than 4 vertices, it is divided into 4 new boxes, etc...
+- * There cannot be more than MAXDEEP (=30) subdivision.
+- * This process is like a Dichotomy in dimension 2
+- *
+- *  + - -  -    - -    -    - - + -   - + - + - + - -     - - +
+- *  |                           |       |   | X |             |
+- *                                      + - + - +
+- *  |                           |       |   |   |             |
+- *                              + -   - + - + - +             +
+- *  |                           |       |       |             |
+- *                         
+- *  |                           |       |       |             |
+- *  + - -  -    - -    -    - - + -   - + -   - + - -     - - +
+- *  |                           |               |             |
+- *                         
+- *  |                           |               |             |
+- *                         
+- *  |                           |               |             |
+- *  |                           |               |             |
+- *  + - -  -    - -    -    - - + -   -   -   - + - -     - - +
+- *  |                           |                             |
+- *                         
+- *  |                           |                             |
+- *                         
+- *  |                           |                             |
+- *                         
+- *  |                           |                             |
+- *  |                           |                             |
+- *  |                           |                             |
+- *  |                           |                             |
+- *  |                           |                             |
+- *  + - -  -    - -    -    - - + -   -   -   -   - -     - - +
+- *
+- * The coordinate system used in a quadtree are integers to avoid
+- * round-off errors. The vertex in the lower left box has the coordinates
+- * (0 0) 
+- * The upper right vertex has the follwing coordinates:
+- * 2^30 -1           2^30 -1        in decimal
+- * 0 1 1 1 .... 1    0 1 1 1 .... 1 in binary
+- *  \--   29  --/     \--   29  --/
+- * Using binaries is therefore very easy to locate a vertex in a box:
+- * we just need to look at the bits from the left to the right (See ::Add)
+- }}}*/
+-/*MACROS {{{*/
+-/* 
+- * 
+- *    J    j
+- *    ^    ^
+- *    |    | +--------+--------+
+- *    |    | |        |        |
+- * 1X |    | |   2    |   3    |
+- *    |    | |        |        |
+- *    |    | +--------+--------+
+- *    |    | |        |        |
+- * 0X |    | |   0    |   1    |
+- *    |    | |        |        |
+- *    |    | +--------+--------+
+- *    |    +-----------------------> i
+- *    |         
+- *    |----------------------------> I
+- *              X0        X1  
+- *
+- * box 0 -> I=0 J=0 IJ=00  = 0
+- * box 1 -> I=1 J=0 IJ=01  = 1
+- * box 2 -> I=0 J=1 IJ=10  = 2
+- * box 3 -> I=1 J=1 IJ=11  = 3
+- */
+-//IJ(i,j,l) returns the box number of i and j with respect to l
+-//if !j&l and !i&l -> 0 (box zero: lower left )
+-//if !j&l and  i&l -> 1 (box one:  lower right)
+-//if  j&l and !i&l -> 2 (box two:  upper left )
+-//if  j&l and  i&l -> 3 (box three:upper right)
+-#define IJ(i,j,l)  ((j&l) ? ((i&l) ? 3:2 ) :((i&l) ? 1:0 ))
+-/*}}}*/
+-
+-	/*Constructors/Destructors*/
+-/*FUNCTION Quadtree::Quadtree(){{{*/
+-Quadtree::Quadtree(){
+-	_error2_("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){
+-
+-	/*Intermediaries*/
+-	double length;
+-
+-	/*Initialize fields*/
+-	this->MaxDepth=maxdepth;
+-	this->NbQuadtreeBox=0;
+-	this->NbObs=0;
+-
+-	/*Create container*/
+-	this->boxcontainer=new DataSet();
+-
+-	/*Create Root, pointer toward the main box*/
+-	length=max(xmax-xmin,ymax-ymin);
+-	this->root=NewQuadtreeBox(xmin+length/2,ymin+length/2,length);
+-}
+-/*}}}*/
+-	/*FUNCTION Quadtree::~Quadtree(){{{*/
+-	Quadtree::~Quadtree(){
+-
+-		delete boxcontainer;
+-		root=NULL;
+-
+-	}
+-	/*}}}*/
+-
+-	/*Methods*/
+-/*FUNCTION Quadtree::Add{{{*/
+-void  Quadtree::Add(Observation* observation){
+-
+-	/*Intermediaries*/
+-	int          xi,yi,ij,level,levelbin;
+-	QuadtreeBox **pbox    = NULL; // pointer toward current box b
+-	QuadtreeBox **pmaster = NULL; // pointer toward master of b
+-	QuadtreeBox  *box     = NULL; // current box b
+-	QuadtreeBox  *slave   = NULL; // suslaveox of b (if necessary)
+-	Observation  *obs[4];
+-
+-	/*Get integer coodinates*/
+-	xi = observation->xi;
+-	yi = observation->yi;
+-
+-	/*Initialize levels*/
+-	level    = 0;
+-	levelbin = (1L<<this->MaxDepth);// = 2^30
+-
+-	/*Get inital box (the largest)*/
+-	pmaster = &root;
+-	pbox    = &root;
+-
+-	/*Find the smallest box where the observation is located*/
+-	while((box=*pbox) && (box->nbitems<0)){ 
+-
+-		/*Go down one level (levelbin = 00100 -> 00010)*/
+-		levelbin>>=1; level+=1; _assert_(level<this->MaxDepth);
+-
+-		/*Get next box according to the bit value (levelbin)*/
+-		pmaster = pbox;
+-		pbox    = &box->box[IJ(xi,yi,levelbin)];
+-	}
+-	_assert_(levelbin>0);
+-
+-	/*Now, try to add the vertex, if the box is full (nbitems=4), we have to divide it in 4 new boxes*/
+-	while((box=*pbox) && (box->nbitems==4)){
+-
+-		/*Copy the 4 observation in the current Quadtreebox*/
+-		obs[0] = box->obs[0];
+-		obs[1] = box->obs[1];
+-		obs[2] = box->obs[2];
+-		obs[3] = box->obs[3];
+-
+-		/*set nbitems as -1 (now holding boxes instead of observations)*/
+-		box->nbitems = -1;
+-		box->box[0]  = NULL;
+-		box->box[1]  = NULL;
+-		box->box[2]  = NULL;
+-		box->box[3]  = NULL;
+-
+-		/*Go down one level (levelbin = 00010 -> 00001)*/
+-		levelbin>>=1; level+=1; _assert_(level<this->MaxDepth);
+-
+-		/*Put the four observations in the new boxes*/
+-		for (int k=0;k<4;k++){
+-
+-			/*Get box for observation number k*/
+-			ij    = IJ(obs[k]->xi,obs[k]->yi,levelbin);
+-			slave = box->box[ij];
+-			if(!slave){
+-				box->box[ij] = NewQuadtreeBox(box,ij);
+-				slave        = box->box[ij];
+-			}
+-			slave->obs[slave->nbitems++] = obs[k];
+-		}
+-
+-		/*Get the suslaveox where the current observation is located*/
+-		ij      = IJ(xi,yi,levelbin);
+-		pmaster = pbox;
+-		pbox    = &box->box[ij];
+-	}
+-
+-	/*alloc the QuadtreeBox if necessary and add current observation*/
+-	box = *pbox;
+-	if(!box){
+-		ij  = IJ(xi,yi,levelbin);
+-		box = *pbox = NewQuadtreeBox(*pmaster,ij);
+-	}
+-	box->obs[box->nbitems++]=observation;
+-	NbObs++;
+-
+-}/*}}}*/
+-/*FUNCTION Quadtree::AddAndAverage{{{*/
+-void Quadtree::AddAndAverage(double x,double y,double value){
+-
+-	QuadtreeBox **pbox = NULL;
+-	QuadtreeBox  *box  = NULL;
+-	int           xi,yi;
+-	int           level,levelbin;
+-	int           index;
+-	double        length,length2;
+-
+-	/*Get integer coodinates*/
+-	this->IntergerCoordinates(&xi,&yi,x,y);
+-
+-	/*Initialize levels*/
+-	level    = 0;
+-	levelbin = (1L<<this->MaxDepth);// = 2^30
+-
+-	/*Get inital box (the largest)*/
+-	pbox=&root;
+-
+-	/*Find the smallest box where this point is located*/
+-	while((box=*pbox) && (box->nbitems<0)){ 
+-
+-		levelbin>>=1; level+=1; 
+-
+-		pbox = &box->box[IJ(xi,yi,levelbin)];
+-	}
+-
+-	/*Add obervation in this box (should be full)*/
+-	if(box && box->nbitems==4){
+-		index  = 0;
+-		length = pow(box->obs[0]->x - x,2.) + pow(box->obs[0]->y - y,2.);
+-		for(int i=1;i<4;i++){
+-			length2 = pow(box->obs[i]->x - x,2.) + pow(box->obs[i]->y - y,2.);
+-			if(length2<length){
+-				index  = i;
+-				length = length2;
+-			}
+-		}
+-
+-		/*We found the closest observation, now average observation (do not change xi and yi to avoid round off errors*/
+-		box->obs[index]->x = (box->obs[index]->weight*box->obs[index]->x + x)/(box->obs[index]->weight+1);
+-		box->obs[index]->y = (box->obs[index]->weight*box->obs[index]->y + y)/(box->obs[index]->weight+1);
+-		box->obs[index]->xi= int((box->obs[index]->weight*double(box->obs[index]->xi) + double(xi))/(box->obs[index]->weight+1));
+-		box->obs[index]->yi= int((box->obs[index]->weight*double(box->obs[index]->yi) + double(yi))/(box->obs[index]->weight+1));
+-		box->obs[index]->value   = (box->obs[index]->weight*box->obs[index]->value + value)/(box->obs[index]->weight+1);
+-		box->obs[index]->weight += 1;
+-	}
+-	else{
+-		_error2_("Box is not full");
+-	}
+-}/*}}}*/
+-/*FUNCTION Quadtree::ClosestObs{{{*/
+-void Quadtree::ClosestObs(int *pindex,double x,double y){
+-
+-	QuadtreeBox **pbox = NULL;
+-	QuadtreeBox  *box  = NULL;
+-	int           xi,yi;
+-	int           level,levelbin;
+-	int           index = -1;
+-	double        length,length2;
+-
+-	/*Get integer coodinates*/
+-	this->IntergerCoordinates(&xi,&yi,x,y);
+-
+-	/*Initialize levels*/
+-	level    = 0;
+-	levelbin = (1L<<this->MaxDepth);// = 2^30
+-
+-	/*Get inital box (the largest)*/
+-	pbox=&root;
+-
+-	/*Find the smallest box where this point is located*/
+-	while((box=*pbox) && (box->nbitems<0)){ 
+-
+-		levelbin>>=1; level+=1; 
+-
+-		pbox = &box->box[IJ(xi,yi,levelbin)];
+-	}
+-
+-	/*Add obervation in this box (should be full)*/
+-	if(box && box->nbitems>0){
+-		index  = box->obs[0]->index;
+-		length = pow(box->obs[0]->x - x,2.) + pow(box->obs[0]->y - y,2.);
+-		for(int i=1;i<box->nbitems;i++){
+-			length2 = pow(box->obs[i]->x - x,2.) + pow(box->obs[i]->y - y,2.);
+-			if(length2<length){
+-				index  = box->obs[i]->index;
+-				length = length2;
+-			}
+-		}
+-	}
+-
+-	*pindex=index;
+-}/*}}}*/
+-/*FUNCTION Quadtree::Echo{{{*/
+-void  Quadtree::Echo(void){
+-
+-	_printLine_("Quadtree:");
+-	_printLine_("   MaxDepth      = " << this->MaxDepth);
+-	_printLine_("   NbQuadtreeBox = " << this->NbQuadtreeBox);
+-	_printLine_("   NbObs         = " << this->NbObs);
+-	_printLine_("   root          = " << this->root);
+-
+-}/*}}}*/
+-/*FUNCTION Quadtree::DeepEcho{{{*/
+-void  Quadtree::DeepEcho(void){
+-
+-	_printLine_("Quadtree:");
+-	_printLine_("   MaxDepth      = " << this->MaxDepth);
+-	_printLine_("   NbQuadtreeBox = " << this->NbQuadtreeBox);
+-	_printLine_("   NbObs         = " << this->NbObs);
+-	_printLine_("   root          = " << this->root);
+-	boxcontainer->Echo();
+-
+-}/*}}}*/
+-/*FUNCTION Quadtree::IntergerCoordinates{{{*/
+-void  Quadtree::IntergerCoordinates(int *xi,int *yi,double x,double y){
+-
+-	/*Intermediaries*/
+-	double coefficient;
+-	double xmin,ymin;
+-
+-	/*Checks in debugging mode*/
+-	_assert_(xi && yi);
+-	_assert_(this->root);
+-
+-	/*coeffIcoor is the coefficient used for integer coordinates:
+-	 *                (x-xmin)
+-	 * xi = (2^30 -1) --------- 
+-	 *                 length
+-	 * coefficient = (2^30 -1)/length
+-	 */
+-	coefficient = double((1L<<this->MaxDepth)-1)/(this->root->length);
+-	xmin        = this->root->xcenter - this->root->length/2;
+-	ymin        = this->root->ycenter - this->root->length/2;
+-
+-	*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){
+-
+-	/*Output*/
+-	QuadtreeBox* newbox=NULL;
+-
+-	/*Create and initialize a new box*/
+-	newbox=new QuadtreeBox();
+-	newbox->nbitems=0;
+-	newbox->xcenter=xcenter;
+-	newbox->ycenter=ycenter;
+-	newbox->length=length;
+-	newbox->box[0]=NULL;
+-	newbox->box[1]=NULL;
+-	newbox->box[2]=NULL;
+-	newbox->box[3]=NULL;
+-
+-	/*Add to container*/
+-	this->boxcontainer->AddObject(newbox);
+-	NbQuadtreeBox++;
+-
+-	/*currentbox now points toward next quadtree box*/
+-	return newbox;
+-}/*}}}*/
+-/*FUNCTION Quadtree::NewQuadtreeBox(QuadtreeBox* master,int index) {{{*/
+-Quadtree::QuadtreeBox* Quadtree::NewQuadtreeBox(QuadtreeBox* master,int index){
+-
+-	/*Output*/
+-	QuadtreeBox* newbox=NULL;
+-
+-	/*Checks in debugging mode*/
+-	_assert_(master);
+-
+-	/*Create and initialize a new box*/
+-	newbox=new QuadtreeBox();
+-	newbox->nbitems=0;
+-	newbox->box[0]=NULL;
+-	newbox->box[1]=NULL;
+-	newbox->box[2]=NULL;
+-	newbox->box[3]=NULL;
+-	switch(index){
+-		case 0:
+-			newbox->xcenter=master->xcenter - master->length/4;
+-			newbox->ycenter=master->ycenter - master->length/4;
+-			break;
+-		case 1:
+-			newbox->xcenter=master->xcenter + master->length/4;
+-			newbox->ycenter=master->ycenter - master->length/4;
+-			break;
+-		case 2:
+-			newbox->xcenter=master->xcenter - master->length/4;
+-			newbox->ycenter=master->ycenter + master->length/4;
+-			break;
+-		case 3:
+-			newbox->xcenter=master->xcenter + master->length/4;
+-			newbox->ycenter=master->ycenter + master->length/4;
+-			break;
+-		default:
+-			_error2_("Case " << index << " not supported");
+-	}
+-	newbox->length=master->length/2;
+-
+-	/*Add to container*/
+-	this->boxcontainer->AddObject(newbox);
+-	NbQuadtreeBox++;
+-
+-	/*currentbox now points toward next quadtree box*/
+-	return newbox;
+-}/*}}}*/
+-/*FUNCTION Quadtree::QuadtreeDepth{{{*/
+-void Quadtree::QuadtreeDepth(int* A,int xi,int yi){
+-
+-	QuadtreeBox **pbox = NULL;
+-	QuadtreeBox  *box  = NULL;
+-	int           level,levelbin;
+-
+-	/*Initialize levels*/
+-	level    = 0;
+-	levelbin = (1L<<this->MaxDepth);// = 2^30
+-
+-	/*Get inital box (the largest)*/
+-	pbox=&root;
+-
+-	/*Find the smallest box where this point is located*/
+-	while((box=*pbox) && (box->nbitems<0)){ 
+-
+-		levelbin>>=1; level+=1; _assert_(level<this->MaxDepth);
+-
+-		pbox = &box->box[IJ(xi,yi,levelbin)];
+-	}
+-	if(box && box->nbitems>0){
+-		/*This box is not empty, add one level*/
+-		level+=1;
+-	}
+-
+-	*A=level;
+-}/*}}}*/
+-/*FUNCTION Quadtree::QuadtreeDepth2{{{*/
+-void Quadtree::QuadtreeDepth2(int* A,int xi,int yi){
+-
+-	QuadtreeBox **pbox = NULL;
+-	QuadtreeBox  *box  = NULL;
+-	int           level,levelbin;
+-
+-	/*Initialize levels*/
+-	level    = 0;
+-	levelbin = (1L<<this->MaxDepth);// = 2^30
+-
+-	/*Get inital box (the largest)*/
+-	pbox=&root;
+-
+-	/*Find the smallest box where this point is located*/
+-	while((box=*pbox) && (box->nbitems<0)){ 
+-
+-		levelbin>>=1; level+=1; 
+-
+-		pbox = &box->box[IJ(xi,yi,levelbin)];
+-	}
+-	if(box && box->nbitems>0){
+-		/*This box is not empty, add one level*/
+-		level+=1;
+-	}
+-
+-	/*If we were to add the vertex, get level*/
+-	if(box && box->nbitems==4){
+-		int ij;
+-		bool flag=true;
+-		while(flag){
+-
+-			levelbin>>=1; level+=1;
+-			if(level>this->MaxDepth){
+-				level+=1;
+-				break;
+-			}
+-
+-			/*loop over the four observations*/
+-			ij=IJ(box->obs[0]->xi,box->obs[0]->yi,levelbin);
+-			for (int k=1;k<4;k++){
+-				if(IJ(box->obs[k]->xi,box->obs[k]->yi,levelbin) != ij){
+-					flag = false;
+-				}
+-			}
+-			if(IJ(xi,yi,levelbin)!=ij){
+-				flag = false;
+-			}
+-		}
+-	}
+-
+-	*A=level;
+-}/*}}}*/
+-/*FUNCTION Quadtree::RangeSearch{{{*/
+-void Quadtree::RangeSearch(int **pindices,int *pnobs,double x,double y,double range){
+-
+-	/*Intermediaries*/
+-	int  nobs;
+-	int *indices = NULL;
+-
+-	/*Allocate indices (maximum by default*/
+-	if(this->NbObs) indices = xNew<int>(this->NbObs);
+-	nobs = 0;
+-
+-	if(this->root) this->root->RangeSearch(indices,&nobs,x,y,range);
+-
+-	/*Clean-up and return*/
+-	*pnobs=nobs;
+-	*pindices=indices;
+-
+-}/*}}}*/
+-
+-/*QuadtreeBox methos*/
+-/*FUNCTION QuadtreeBox::Echo{{{*/
+-void  Quadtree::QuadtreeBox::Echo(void){
+-
+-	_printLine_("QuadtreeBox:");
+-	_printLine_("   nbitems = " << this->nbitems);
+-	_printLine_("   xcenter = " << this->xcenter);
+-	_printLine_("   ycenter = " << this->ycenter);
+-	_printLine_("   length  = " << this->length);
+-
+-}/*}}}*/
+-/*FUNCTION QuadtreeBox::IsWithinRange{{{*/
+-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;
+-	if(this->xcenter-this->length/2 > x+range) return 0;
+-	if(this->ycenter+this->length/2 < y-range) return 0;
+-	if(this->ycenter-this->length/2 > y+range) return 0;
+-
+-	/*Return 2 if the this box is included in the range*/
+-	if(this->xcenter+this->length/2 <= x+range &&
+-		this->ycenter+this->length/2 <= y+range &&
+-		this->xcenter-this->length/2 >= x-range &&
+-		this->ycenter-this->length/2 >= y-range) return 2;
+-
+-	/*This is a simple overlap*/
+-	return 1;
+-
+-}/*}}}*/
+-/*FUNCTION QuadtreeBox::RangeSearch{{{*/
+-void Quadtree::QuadtreeBox::RangeSearch(int* indices,int *pnobs,double x,double y,double range){
+-
+-	/*Intermediaries*/
+-	int i,nobs;
+-
+-	/*Recover current number of observations*/
+-	nobs = *pnobs;
+-
+-	switch(this->IsWithinRange(x,y,range)){
+-		case 0:
+-			/*If this box is not within range, return*/
+-			break;
+-		case 2:
+-			/*This box is included in range*/
+-			this->WriteObservations(indices,&nobs);
+-			break;
+-		case 1:
+-			/*This box is partly included*/
+-			if(this->nbitems>0){
+-				/*If this box has only observations, add indices that are within range*/
+-				for(i=0;i<this->nbitems;i++){
+-					if(fabs(this->obs[i]->x-x) <= range && fabs(this->obs[i]->y-y) <= range){
+-						indices[nobs++]=this->obs[i]->index;
+-					}
+-				}
+-			}
+-			else{
+-				/*This box points toward boxes*/
+-				if(this->box[0]) this->box[0]->RangeSearch(indices,&nobs,x,y,range);
+-				if(this->box[1]) this->box[1]->RangeSearch(indices,&nobs,x,y,range);
+-				if(this->box[2]) this->box[2]->RangeSearch(indices,&nobs,x,y,range);
+-				if(this->box[3]) this->box[3]->RangeSearch(indices,&nobs,x,y,range);
+-			}
+-			break;
+-		default:
+-			_error2_("Case " << this->IsWithinRange(x,y,range) << " not supported");
+-	}
+-
+-	/*Assign output pointers: */
+-	*pnobs=nobs;
+-}/*}}}*/
+-/*FUNCTION QuadtreeBox::WriteObservations{{{*/
+-void Quadtree::QuadtreeBox::WriteObservations(int* indices,int *pnobs){
+-
+-	/*Intermediaries*/
+-	int i,nobs;
+-
+-	/*Recover current number of observations*/
+-	nobs = *pnobs;
+-
+-	if(this->nbitems>0){
+-		/*If this box has only observations, add all indices*/
+-		for(i=0;i<this->nbitems;i++){
+-			indices[nobs++]=this->obs[i]->index;
+-		}
+-	}
+-	else{
+-		/*This box points toward boxes, */
+-		if(this->box[0]) this->box[0]->WriteObservations(indices,&nobs);
+-		if(this->box[1]) this->box[1]->WriteObservations(indices,&nobs);
+-		if(this->box[2]) this->box[2]->WriteObservations(indices,&nobs);
+-		if(this->box[3]) this->box[3]->WriteObservations(indices,&nobs);
+-	}
+-
+-	/*Assign output pointers: */
+-	*pnobs=nobs;
+-}/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Observation.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Observation.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Observation.cpp	(revision 12821)
+@@ -1,57 +0,0 @@
+-/*!\file Observation.c
+- * \brief: implementation of the Observation object
+- */
+-
+-#include <stdlib.h>
+-#include "../objects.h"
+-
+-/*Observation constructors and destructor*/
+-/*FUNCTION 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){
+-
+-	this->x      = x_in;
+-	this->y      = y_in;
+-	this->xi     = xi_in;
+-	this->yi     = yi_in;
+-	this->index  = index_in;
+-	this->value  = value_in;
+-	this->weight = 1.;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Observation::~Observation(){{{*/
+-Observation::~Observation(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Observation::Echo {{{*/
+-void Observation::Echo(void){
+-
+-	int  bit;
+-
+-	_printLine_("Observation");
+-	_printLine_("   index : " << this->index);
+-	_printLine_("   x     : " << this->x);
+-	_printLine_("   y     : " << this->y);
+-	_printLine_("   xi    : "); printbinary(this->xi); _printLine_("");
+-	_printLine_("   yi    : "); printbinary(this->yi); _printLine_("");
+-	_printLine_("   weight: " << this->weight);
+-	_printLine_("   value : " << this->value);
+-}
+-/*}}}*/
+-
+-/*Observations functions*/
+-/*FUNCTION 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: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Variogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Variogram.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Kriging/Variogram.h	(revision 12821)
+@@ -1,18 +0,0 @@
+-/*!\file:  Variogram.h
+- * \brief abstract class for Variogram object
+- */ 
+-
+-#ifndef _VARIOGRAM_H_
+-#define _VARIOGRAM_H_
+-
+-#include "../Object.h"
+-
+-class Variogram: public Object{
+-
+-	public: 
+-		virtual ~Variogram(){};
+-		virtual double SemiVariogram(double deltax,double deltay)=0;
+-		virtual double Covariance(double deltax,double deltay)=0;
+-
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Object.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Object.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Object.h	(revision 12821)
+@@ -1,27 +0,0 @@
+-/*
+- * Object.h:
+- * \brief prototype for abstract Object class
+- * \file Object.h
+- * This prototype describes the Object class. This is an abstract class, parent 
+- * to any other objects (Quad, Tria, Node , etc ...), that can be included in a 
+- * DataSet.
+- */
+-
+-
+-#ifndef _OBJECT_H_
+-#define _OBJECT_H_
+-
+-class Object {
+-
+-	public: 
+-
+-		virtual       ~Object() {};
+-		virtual void  Echo()=0;
+-		virtual void  DeepEcho()=0;
+-		virtual int   Id()=0;
+-		virtual int   MyRank()=0;
+-		virtual int   ObjectEnum()=0;
+-		virtual Object* copy()=0;
+-
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Vertex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Vertex.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Vertex.h	(revision 12821)
+@@ -1,65 +0,0 @@
+-/*! \file Vertex.h 
+- *  \brief: header file for vertex object
+- */
+-
+-#ifndef _VERTEX_H_
+-#define _VERTEX_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Object.h"
+-class IoModel;
+-class Vector;
+-class Parameters;
+-#include "../shared/Exceptions/exceptions.h"
+-#include "../toolkits/toolkits.h"
+-#include "../include/include.h"
+-
+-/*}}}*/
+-
+-
+-class Vertex: public Object{
+-
+-	public: 
+-
+-		int    id;
+-		int    sid;            //sid for "serial" id, ie the rank of this vertex in the vertices dataset, if the dataset was serial on 1 cpu.
+-		IssmDouble x;
+-		IssmDouble y;
+-		IssmDouble z;
+-		IssmDouble sigma;          //sigma coordinate: (z-bed)/thickness
+-		int    connectivity;   //number of vertices connected to this vertex
+-
+-		/*dof management: */
+-		int    clone;
+-		int    dof; //dof to recover values in a vertex indexed vector
+-
+-		/*Vertex constructors, destructors {{{*/
+-		Vertex();
+-		Vertex(int id, int sid,IssmDouble x, IssmDouble y, IssmDouble z, IssmDouble sigma, int connectivity); 
+-		void Init(int id, int sid, IssmDouble x, IssmDouble y, IssmDouble z, IssmDouble sigma,int connectivity);
+-		Vertex(int id, int sid, int i, IoModel* iomodel);
+-		~Vertex();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*DofObject routines {{{*/
+-		void  DistributeDofs(int* pdofcount);
+-		void  OffsetDofs(int dofcount);
+-		void  ShowTrueDofs(int* borderdofs);
+-		void  UpdateCloneDofs(int* allborderdofs);
+-		void  SetClone(int* minranks);
+-		/*}}}*/
+-		/*Vertex management: {{{*/
+-		int   Sid(void); 
+-		int   Connectivity(void); 
+-		void  UpdatePosition(Vector* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
+-		/*}}}*/
+-};
+-#endif  /* _VERTEX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Node.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Node.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Node.cpp	(revision 12821)
+@@ -1,1012 +0,0 @@
+-/*!\file Node.c
+- * \brief: implementation of the Node object
+- */
+-
+-/*Include files: {{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "./objects.h"
+-#include "../Container/Container.h"
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-#include "../shared/shared.h"
+-#include "../include/include.h"
+-#include "../modules/modules.h"
+-/*}}}*/
+-
+-/*Node constructors and destructors:*/
+-/*FUNCTION Node::Node() default constructor {{{*/
+-Node::Node(){
+-		 this->inputs=NULL;
+-		 this->hvertex=NULL;
+-		 return;
+-}
+-/*}}}*/
+-/*FUNCTION Node::Node(int node_id,int node_sid,int vertex_id,int io_index, IoModel* iomodel,int analysis_type) {{{*/
+-Node::Node(int node_id,int node_sid,int vertex_id,int io_index, IoModel* iomodel,int analysis_type){
+-
+-	/*Intermediary*/
+-	int k,l;
+-	int gsize;
+-	int dim;
+-
+-	/*Fetch parameters: */
+-	iomodel->Constant(&dim,MeshDimensionEnum);
+-
+-	/*id: */
+-	this->id=node_id; 
+-	this->sid=node_sid; 
+-	this->analysis_type=analysis_type;
+-
+-	/*Initialize coord_system: Identity matrix by default*/
+-	for(k=0;k<3;k++) for(l=0;l<3;l++) this->coord_system[k][l]=0.0;
+-	for(k=0;k<3;k++) this->coord_system[k][k]=1.0;
+-
+-	/*indexing:*/
+-	DistributeNumDofs(&this->indexing,analysis_type,iomodel->Data(FlowequationVertexEquationEnum)+io_index); //number of dofs per node
+-	gsize=this->indexing.gsize;
+-
+-	/*Hooks*/
+-	this->hvertex=new Hook(&vertex_id,1); //node id is the same as the vertex id, continuous galerkin!
+-
+-	//intialize inputs, and add as many inputs per element as requested: 
+-	this->inputs=new Inputs();
+-	if (iomodel->Data(MeshVertexonbedEnum))
+-	 this->inputs->AddInput(new BoolInput(MeshVertexonbedEnum,reCast<IssmBool>(iomodel->Data(MeshVertexonbedEnum)[io_index])));
+-	if (iomodel->Data(MeshVertexonsurfaceEnum))
+-	 this->inputs->AddInput(new BoolInput(MeshVertexonsurfaceEnum,reCast<IssmBool>(iomodel->Data(MeshVertexonsurfaceEnum)[io_index])));
+-	if (iomodel->Data(MaskVertexonfloatingiceEnum))
+-	 this->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,reCast<IssmBool>(iomodel->Data(MaskVertexonfloatingiceEnum)[io_index])));
+-	if (iomodel->Data(MaskVertexongroundediceEnum))
+-	  this->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,reCast<IssmBool>(iomodel->Data(MaskVertexongroundediceEnum)[io_index])));
+-	if (analysis_type==DiagnosticHorizAnalysisEnum)
+-	 this->inputs->AddInput(new IntInput(ApproximationEnum,reCast<IssmInt>(iomodel->Data(FlowequationVertexEquationEnum)[io_index])));
+-	/*set single point constraints: */
+-
+-	/*spc all nodes on water*/
+-	if (!iomodel->Data(MaskVertexonwaterEnum)) _error2_("iomodel->nodeonwater is NULL");
+-	if (reCast<IssmBool>(iomodel->Data(MaskVertexonwaterEnum)[io_index])){
+-		for(k=1;k<=gsize;k++){
+-			this->FreezeDof(k);
+-		}
+-	}
+-
+-	/*Diagnostic Horiz*/
+-	#ifdef _HAVE_DIAGNOSTIC_
+-	if (analysis_type==DiagnosticHorizAnalysisEnum){
+-
+-		/*Coordinate system provided, convert to coord_system matrix*/
+-		_assert_(iomodel->Data(DiagnosticReferentialEnum)); 
+-		XZvectorsToCoordinateSystem(&this->coord_system[0][0],iomodel->Data(DiagnosticReferentialEnum)+io_index*6);
+-
+-		if (dim==3){
+-			/*We have a  3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
+-			_assert_(iomodel->Data(MeshVertexonbedEnum)); 
+-			_assert_(iomodel->Data(FlowequationVertexEquationEnum));
+-			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealApproximationEnum && !iomodel->Data(MeshVertexonbedEnum)[io_index]){
+-				for(k=1;k<=gsize;k++) this->FreezeDof(k);
+-			}
+-			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealPattynApproximationEnum && iomodel->Data(FlowequationBordermacayealEnum)[io_index]){
+-				if(!iomodel->Data(MeshVertexonbedEnum)[io_index]){
+-					for(k=1;k<=gsize;k++) this->FreezeDof(k);
+-				}
+-			}
+-			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealStokesApproximationEnum && iomodel->Data(FlowequationBordermacayealEnum)[io_index]){
+-				if(!iomodel->Data(MeshVertexonbedEnum)[io_index]){
+-					for(k=1;k<=2;k++) this->FreezeDof(k);
+-				}
+-			}
+-		}
+-		/*spc all nodes on hutter*/
+-		if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==HutterApproximationEnum){
+-			for(k=1;k<=gsize;k++){
+-				this->FreezeDof(k);
+-			}
+-		}
+-	}
+-	#endif
+-
+-	/*Diagnostic Hutter*/
+-	if (analysis_type==DiagnosticHutterAnalysisEnum){
+-		if (!iomodel->Data(FlowequationVertexEquationEnum)) _error2_("iomodel->vertices_type is NULL");
+-		/*Constrain all nodes that are not Hutter*/
+-		if (reCast<int>(iomodel->Data(FlowequationVertexEquationEnum)[io_index])!=HutterApproximationEnum){
+-			for(k=1;k<=gsize;k++){
+-				this->FreezeDof(k);
+-			}
+-		}
+-	}
+-
+-	/*Prognostic/ Melting/ Slopecompute/ Balancethickness*/
+-	if (
+-				analysis_type==PrognosticAnalysisEnum || 
+-				analysis_type==MeltingAnalysisEnum || 
+-				analysis_type==BedSlopeAnalysisEnum || 
+-				analysis_type==SurfaceSlopeAnalysisEnum || 
+-				analysis_type==BalancethicknessAnalysisEnum
+-				){
+-		if (dim==3){
+-			/*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
+-			_assert_(iomodel->Data(MeshVertexonbedEnum));
+-			if (!(reCast<IssmBool>(iomodel->Data(MeshVertexonbedEnum)[io_index]))){
+-				for(k=1;k<=gsize;k++){
+-					this->FreezeDof(k);
+-				}
+-			}
+-		}
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::~Node(){{{*/
+-Node::~Node(){
+-	delete inputs;
+-	delete hvertex;
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Node::Echo{{{*/
+-void Node::Echo(void){
+-
+-	_printLine_("Node:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   sid: " << sid);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	indexing.Echo();
+-	_printLine_("   hvertex:     not displayed");
+-	_printLine_("   inputs:      " << inputs);
+-
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::DeepEcho{{{*/
+-void Node::DeepEcho(void){
+-
+-	_printLine_("Node:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   sid: " << sid);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	indexing.DeepEcho();
+-	_printLine_("Vertex:");
+-	hvertex->DeepEcho();
+-	_printLine_("   inputs");
+-
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::Id{{{*/
+-int    Node::Id(void){ return id; }
+-/*}}}*/
+-/*FUNCTION Node::MyRank{{{*/
+-int    Node::MyRank(void){ 
+-	extern int my_rank;
+-
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Node::ObjectEnum{{{*/
+-int Node::ObjectEnum(void){
+-
+-	return NodeEnum;
+-
+-}
+-/*}}}*/
+-
+-/*Node management:*/
+-/*FUNCTION Node::Configure {{{*/
+-void  Node::Configure(DataSet* nodesin,Vertices* verticesin){
+-
+-	int i;
+-
+-	/*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 off_sets hidden in hooks: */
+-	hvertex->configure(verticesin);
+-
+-}
+-/*FUNCTION Node::SetCurrentConfiguration {{{*/
+-void  Node::SetCurrentConfiguration(DataSet* nodesin,Vertices* verticesin){
+-
+-}
+-/*FUNCTION Node::GetDof {{{*/
+-int   Node::GetDof(int dofindex,int setenum){
+-
+-	if(setenum==GsetEnum){
+-		_assert_(dofindex>=0 && dofindex<indexing.gsize);
+-		return indexing.gdoflist[dofindex];
+-	}
+-	else if(setenum==FsetEnum){
+-		_assert_(dofindex>=0 && dofindex<indexing.fsize);
+-		return indexing.fdoflist[dofindex];
+-	}
+-	else if(setenum==SsetEnum){
+-		_assert_(dofindex>=0 && dofindex<indexing.ssize);
+-		return indexing.sdoflist[dofindex];
+-	}
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetDofList1{{{*/
+-int  Node::GetDofList1(void){
+-
+-	Vertex* vertex=NULL;
+-
+-	vertex=(Vertex*)this->hvertex->delivers();
+-
+-	return vertex->dof;
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetDofList{{{*/
+-void  Node::GetDofList(int* outdoflist,int approximation_enum,int setenum){
+-	int i;
+-	int count=0;
+-	int count2=0;
+-		
+-	if(approximation_enum==NoneApproximationEnum){
+-		if(setenum==GsetEnum)for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=indexing.gdoflist[i];
+-		if(setenum==FsetEnum)for(i=0;i<this->indexing.fsize;i++) outdoflist[i]=indexing.fdoflist[i];
+-		if(setenum==SsetEnum)for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i];
+-	}
+-	else{
+-
+-		if(setenum==GsetEnum){
+-			if(indexing.doftype){
+-				count=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if(indexing.doftype[i]==approximation_enum){
+-						outdoflist[count]=indexing.gdoflist[i];
+-						count++;
+-					}
+-				}
+-				_assert_(count); //at least one dof should be the approximation requested
+-			}
+-			else for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=indexing.gdoflist[i];
+-		}
+-		else if(setenum==FsetEnum){
+-			if(indexing.doftype){
+-				count=0;
+-				count2=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if(indexing.f_set[i]){
+-						if(indexing.doftype[i]==approximation_enum){
+-							outdoflist[count]=indexing.fdoflist[count2];
+-							count++;
+-						}
+-						count2++;
+-					}
+-				}
+-			}
+-			else for(i=0;i<this->indexing.fsize;i++) outdoflist[i]=indexing.fdoflist[i];
+-		}
+-		else if(setenum==SsetEnum){
+-			if(indexing.doftype){
+-				count=0;
+-				count2=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if(indexing.s_set[i]){
+-						if(indexing.doftype[i]==approximation_enum){
+-							outdoflist[count]=indexing.sdoflist[count2];
+-							count++;
+-						}
+-						count2++;
+-					}
+-				}
+-			}
+-			else for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i];
+-		}
+-		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetSidList{{{*/
+-int  Node::GetSidList(void){
+-
+-	Vertex* vertex=NULL;
+-
+-	vertex=(Vertex*)this->hvertex->delivers();
+-
+-	return vertex->sid;
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetLocalDofList{{{*/
+-void  Node::GetLocalDofList(int* outdoflist,int approximation_enum,int setenum){
+-	int i;
+-	int count=0;
+-	int count2=0;
+-		
+-	if(approximation_enum==NoneApproximationEnum){
+-		if(setenum==GsetEnum)for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=i;
+-		else if(setenum==FsetEnum){
+-			count=0;
+-			for(i=0;i<this->indexing.gsize;i++){
+-				if(indexing.f_set[i]){
+-					outdoflist[count]=i;
+-					count++;
+-				}
+-			}
+-		}
+-		else if(setenum==SsetEnum){
+-			count=0;
+-			for(i=0;i<this->indexing.gsize;i++){
+-				if(indexing.s_set[i]){
+-					outdoflist[count]=i;
+-					count++;
+-				}
+-			}
+-		}
+-		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-	}
+-	else{
+-
+-		if(setenum==GsetEnum){
+-			if(indexing.doftype){
+-				count=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if(indexing.doftype[i]==approximation_enum){
+-						outdoflist[count]=count;
+-						count++;
+-					}
+-				}
+-				_assert_(count);
+-			}
+-			else for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=i;
+-		}
+-		else if(setenum==FsetEnum){
+-
+-			if(indexing.doftype){
+-				count=0;
+-				count2=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if(indexing.doftype[i]==approximation_enum){
+-						if(indexing.f_set[i]){
+-							outdoflist[count]=count2;
+-							count++;
+-						}
+-						count2++;
+-					}
+-				}
+-				_assert_(count2);
+-			}
+-			else{
+-
+-				count=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if(indexing.f_set[i]){
+-						outdoflist[count]=i;
+-						count++;
+-					}
+-				}
+-			}
+-		}
+-		else if(setenum==SsetEnum){
+-			if(indexing.doftype){
+-				count=0;
+-				count2=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if(indexing.doftype[i]==approximation_enum){
+-						if(indexing.s_set[i]){
+-							outdoflist[count]=count2;
+-							count++;
+-						}
+-						count2++;
+-					}
+-				}
+-				_assert_(count2);
+-			}
+-			else{
+-				count=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if(indexing.s_set[i]){
+-						outdoflist[count]=i;
+-						count++;
+-					}
+-				}
+-			}
+-		}
+-		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Node::Sid{{{*/
+-int    Node::Sid(void){ return sid; }
+-/*}}}*/
+-/*FUNCTION Node::GetVertexId {{{*/
+-int   Node::GetVertexId(void){
+-
+-	Vertex*  vertex=NULL;
+-
+-	vertex=(Vertex*)hvertex->delivers();
+-	return vertex->id;
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetVertexDof {{{*/
+-int   Node::GetVertexDof(void){
+-
+-	Vertex*  vertex=NULL;
+-
+-	vertex=(Vertex*)hvertex->delivers();
+-	return vertex->dof;
+-}
+-/*}}}*/
+-#ifdef _HAVE_DIAGNOSTIC_
+-/*FUNCTION Node::GetCoordinateSystem{{{*/
+-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];
+-
+-}
+-/*}}}*/
+-#endif
+-/*FUNCTION Node::SetVertexDof {{{*/
+-void   Node::SetVertexDof(int in_dof){
+-
+-	Vertex*  vertex=NULL;
+-
+-	vertex=(Vertex*)hvertex->delivers();
+-	vertex->dof=in_dof;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::InAnalysis{{{*/
+-bool Node::InAnalysis(int in_analysis_type){
+-	if (in_analysis_type==this->analysis_type) return true;
+-	else return false;
+-}
+-/*}}}*/
+-
+-/*Node numerics:*/
+-/*FUNCTION Node::ApplyConstraints{{{*/
+-void  Node::ApplyConstraint(int dof,IssmDouble value){
+-
+-	int index;
+-
+-	/*Dof should be added in the s set, describing which 
+-	 * dofs are constrained to a certain value (dirichlet boundary condition*/
+-	DofInSSet(dof-1);
+-	this->indexing.svalues[dof-1]=value;
+-}
+-/*}}}*/
+-/*FUNCTION Node::RelaxConstraint{{{*/
+-void  Node::RelaxConstraint(int dof){
+-
+-	/*Dof should be added to the f-set, and taken out of the s-set:*/
+-	DofInFSet(dof-1);
+-	this->indexing.svalues[dof-1]=NAN;
+-}
+-/*}}}*/
+-/*FUNCTION Node::CreateVecSets {{{*/
+-void  Node::CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s){
+-
+-	IssmDouble gvalue=1.0; //all nodes are in the g set;
+-	IssmDouble value;
+-
+-	int i;
+-
+-	for(i=0;i<this->indexing.gsize;i++){
+-
+-		/*g set: */
+-		pv_g->SetValue(indexing.gdoflist[i],gvalue,INS_VAL);
+-		
+-		/*f set: */
+-		value=(IssmDouble)this->indexing.f_set[i];
+-		pv_f->SetValue(indexing.gdoflist[i],value,INS_VAL);
+-
+-		/*s set: */
+-		value=(IssmDouble)this->indexing.s_set[i];
+-		pv_s->SetValue(indexing.gdoflist[i],value,INS_VAL);
+-
+-	}
+-
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::CreateNodalConstraints{{{*/
+-void  Node::CreateNodalConstraints(Vector* ys){
+-
+-	int i;
+-	IssmDouble* values=NULL;
+-	int count;
+-
+-	/*Recover values for s set and plug them in constraints vector: */
+-	if(this->indexing.ssize){
+-		values=xNew<IssmDouble>(this->indexing.ssize);
+-		count=0;
+-		for(i=0;i<this->indexing.gsize;i++){
+-			if(this->indexing.s_set[i]){
+-				values[count]=this->indexing.svalues[i];
+-				_assert_(!xIsNan<IssmDouble>(values[count]));
+-				count++;
+-			}
+-		}
+-		
+-		/*Add values into constraint vector: */
+-		ys->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
+-	}
+-
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(values);
+-
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::DofInSSet {{{*/
+-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. */
+-
+-	this->indexing.f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
+-	this->indexing.s_set[dof]=1;
+-}
+-/*}}}*/
+-/*FUNCTION Node::DofInFSet {{{*/
+-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. */
+-
+-	this->indexing.f_set[dof]=1; 
+-	this->indexing.s_set[dof]=0;
+-}
+-/*}}}*/
+-/*FUNCTION Node::FreezeDof{{{*/
+-void  Node::FreezeDof(int dof){
+-	
+-	DofInSSet(dof-1); //with 0 displacement for this dof.
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetApproximation {{{*/
+-int   Node::GetApproximation(){
+-
+-	int approximation;
+-
+-	/*recover parameters: */
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	return approximation;
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetConnectivity {{{*/
+-int Node::GetConnectivity(){
+-
+-	Vertex*  vertex=NULL;
+-	vertex=(Vertex*)hvertex->delivers();
+-	return vertex->connectivity;
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetNumberOfDofs{{{*/
+-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: */
+-	
+-	int i;
+-	int numdofs=0;
+-
+-	if(approximation_enum==NoneApproximationEnum){
+-		if (setenum==GsetEnum) numdofs=this->indexing.gsize;
+-		else if (setenum==FsetEnum) numdofs=this->indexing.fsize;
+-		else if (setenum==SsetEnum) numdofs=this->indexing.ssize;
+-		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-	}
+-	else{
+-		if(setenum==GsetEnum){
+-			if(this->indexing.doftype){
+-				numdofs=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if(this->indexing.doftype[i]==approximation_enum) numdofs++;
+-				}
+-			}
+-			else numdofs=this->indexing.gsize;
+-		}
+-		else if (setenum==FsetEnum){
+-			if(this->indexing.doftype){
+-				numdofs=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if((this->indexing.doftype[i]==approximation_enum) && (this->indexing.f_set[i])) numdofs++;
+-				}
+-			}
+-			else numdofs=this->indexing.fsize;
+-		}
+-		else if (setenum==SsetEnum){
+-			if(this->indexing.doftype){
+-				numdofs=0;
+-				for(i=0;i<this->indexing.gsize;i++){
+-					if((this->indexing.doftype[i]==approximation_enum) && (this->indexing.s_set[i])) numdofs++;
+-				}
+-			}
+-			else numdofs=this->indexing.ssize;
+-		}
+-		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-	}
+-	return numdofs;
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetSigma {{{*/
+-IssmDouble Node::GetSigma(){
+-	Vertex* vertex=NULL;
+-
+-	vertex=(Vertex*)hvertex->delivers();
+-	return vertex->sigma;
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetX {{{*/
+-IssmDouble Node::GetX(){
+-	Vertex* vertex=NULL;
+-
+-	vertex=(Vertex*)hvertex->delivers();
+-	return vertex->x;
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetY {{{*/
+-IssmDouble Node::GetY(){
+-	Vertex* vertex=NULL;
+-
+-	vertex=(Vertex*)hvertex->delivers();
+-	return vertex->y;
+-}
+-/*}}}*/
+-/*FUNCTION Node::GetZ {{{*/
+-IssmDouble Node::GetZ(){
+-	Vertex* vertex=NULL;
+-
+-	vertex=(Vertex*)hvertex->delivers();
+-	return vertex->z;
+-}
+-/*}}}*/
+-/*FUNCTION Node::IsClone {{{*/
+-int   Node::IsClone(){
+-	
+-	return indexing.clone;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::IsOnBed {{{*/
+-int   Node::IsOnBed(){
+-
+-	bool onbed;
+-
+-	/*recover parameters: */
+-	inputs->GetInputValue(&onbed,MeshVertexonbedEnum);
+-
+-	return onbed;
+-}
+-/*}}}*/
+-/*FUNCTION Node::IsGrounded {{{*/
+-int   Node::IsGrounded(){
+-
+-	bool onsheet;
+-
+-	/*recover parameters: */
+-	inputs->GetInputValue(&onsheet,MaskVertexongroundediceEnum);
+-
+-	return onsheet;
+-}		
+-/*}}}*/
+-/*FUNCTION Node::IsFloating {{{*/
+-int   Node::IsFloating(){
+-	
+-	bool onshelf;
+-
+-	/*recover parameters: */
+-	inputs->GetInputValue(&onshelf,MaskVertexonfloatingiceEnum);
+-
+-	return onshelf;
+-}
+-/*}}}*/
+-/*FUNCTION Node::IsOnSurface {{{*/
+-int   Node::IsOnSurface(){
+-
+-	bool onsurface;
+-
+-	/*recover parameters: */
+-	inputs->GetInputValue(&onsurface,MeshVertexonsurfaceEnum);
+-
+-	return onsurface;
+-}
+-/*}}}*/
+-/*FUNCTION Node::InputUpdateFromVector(IssmDouble* vector, int name, int type){{{*/
+-void  Node::InputUpdateFromVector(IssmDouble* vector, int name, int type){
+-
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Node::InputUpdateFromVector(int* vector, int name, int type){{{*/
+-void  Node::InputUpdateFromVector(int* vector, int name, int type){
+-
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Node::InputUpdateFromVector(bool* vector, int name, int type){{{*/
+-void  Node::InputUpdateFromVector(bool* vector, int name, int type){
+-
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Node::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){{{*/
+-void  Node::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
+-
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Node::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){{{*/
+-void  Node::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
+-
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Node::InputUpdateFromVectorDakota(int* vector, int name, int type){{{*/
+-void  Node::InputUpdateFromVectorDakota(int* vector, int name, int type){
+-
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Node::InputUpdateFromVectorDakota(bool* vector, int name, int type){{{*/
+-void  Node::InputUpdateFromVectorDakota(bool* vector, int name, int type){
+-
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Node::InputUpdateFromConstant(IssmDouble constant, int name){{{*/
+-void  Node::InputUpdateFromConstant(IssmDouble constant, int name){
+-
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Node::InputUpdateFromConstant(int constant, int name){{{*/
+-void  Node::InputUpdateFromConstant(int constant, int name){
+-
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Node::InputUpdateFromConstant(bool constant, int name){{{*/
+-void  Node::InputUpdateFromConstant(bool constant, int name){
+-
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Node::UpdateSpcs {{{*/
+-void   Node::UpdateSpcs(IssmDouble* ys){
+-
+-	int     count=0;
+-	int     i;
+-
+-	count=0;
+-	for(i=0;i<this->indexing.gsize;i++){
+-		if(this->indexing.s_set[i]){
+-			this->indexing.svalues[i]=ys[this->indexing.sdoflist[count]];
+-			count++;
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Node::VecMerge {{{*/
+-void   Node::VecMerge(Vector* ug, IssmDouble* vector_serial,int setenum){
+-
+-	IssmDouble* values=NULL;
+-	int*    indices=NULL;
+-	int     count=0;
+-	int     i;
+-
+-	if(setenum==FsetEnum){
+-		if(this->indexing.fsize){
+-			indices=xNew<int>(this->indexing.fsize);
+- 			values=xNew<IssmDouble>(this->indexing.fsize);
+-
+-			for(i=0;i<this->indexing.gsize;i++){
+-				if(this->indexing.f_set[i]){
+-					_assert_(vector_serial);
+-					values[count]=vector_serial[this->indexing.fdoflist[count]];
+-					indices[count]=this->indexing.gdoflist[i];
+-					count++;
+-				}
+-			}
+-
+-			/*Add values into ug: */
+-			ug->SetValues(this->indexing.fsize,indices,values,INS_VAL);
+-		}
+-	}
+-	else if(setenum==SsetEnum){
+-		if(this->indexing.ssize){
+-			indices=xNew<int>(this->indexing.ssize);
+-			values=xNew<IssmDouble>(this->indexing.ssize);
+-
+-			for(i=0;i<this->indexing.gsize;i++){
+-				if(this->indexing.s_set[i]){
+-					_assert_(vector_serial);
+-					values[count]=vector_serial[this->indexing.sdoflist[count]];
+-					indices[count]=this->indexing.gdoflist[i];
+-					count++;
+-				}
+-			}
+-
+-			/*Add values into ug: */
+-			ug->SetValues(this->indexing.ssize,indices,values,INS_VAL);
+-		}
+-	}
+-	else _error2_("VecMerge can only merge from the s or f-set onto the g-set!");
+-
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(values);
+-	xDelete<int>(indices);
+-}
+-/*}}}*/
+-/*FUNCTION Node::VecReduce {{{*/
+-void   Node::VecReduce(Vector* vector, IssmDouble* ug_serial,int setenum){
+-
+-	IssmDouble* values=NULL;
+-	int     count=0;
+-	int     i;
+-
+-	if(setenum==FsetEnum){
+-		if(this->indexing.fsize){
+- 			values=xNew<IssmDouble>(this->indexing.fsize);
+-
+-			for(i=0;i<this->indexing.gsize;i++){
+-				if(this->indexing.f_set[i]){
+-					_assert_(ug_serial);
+-					values[count]=ug_serial[this->indexing.gdoflist[i]];
+-					count++;
+-				}
+-			}
+-
+-			/*Add values into ug: */
+-			vector->SetValues(this->indexing.fsize,this->indexing.fdoflist,values,INS_VAL);
+-		}
+-	}
+-	else if(setenum==SsetEnum){
+-		if(this->indexing.ssize){
+-			values=xNew<IssmDouble>(this->indexing.ssize);
+-
+-			for(i=0;i<this->indexing.gsize;i++){
+-				if(this->indexing.s_set[i]){
+-					_assert_(ug_serial);
+-					values[count]=ug_serial[this->indexing.gdoflist[i]];
+-					count++;
+-				}
+-			}
+-
+-			/*Add values into ug: */
+-			vector->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
+-		}
+-	}
+-	else _error2_("VecReduce can only merge from the s or f-set onto the g-set!");
+-
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(values);
+-}
+-/*}}}*/
+-
+-/* DofObject routines:*/
+-/*FUNCTION Node::DistributeDofs{{{*/
+-void  Node::DistributeDofs(int* pdofcount,int setenum){
+-
+-	int i;
+-	extern int my_rank;
+-	int dofcount;
+-
+-	dofcount=*pdofcount;
+-
+-	/*Initialize: */
+-	if(setenum==FsetEnum) this->indexing.InitSet(setenum);
+-	if(setenum==SsetEnum) this->indexing.InitSet(setenum);
+-	
+-		
+-	/*For clone nodfs, don't distribute dofs, we will get them from another cpu in UpdateCloneDofs!*/
+-	if(indexing.clone){
+-		return;
+-	}
+-
+-	/*This node should distribute dofs for setenum set (eg, f_set or s_set), go ahead: */
+-
+-	if(setenum==GsetEnum){
+-		for(i=0;i<this->indexing.gsize;i++){
+-			indexing.gdoflist[i]=dofcount+i;
+-		}
+-		dofcount+=this->indexing.gsize;
+-	}
+-	else if(setenum==FsetEnum){
+-		for(i=0;i<this->indexing.fsize;i++){
+-			indexing.fdoflist[i]=dofcount+i;
+-		}
+-		dofcount+=this->indexing.fsize;
+-	}
+-	else if(setenum==SsetEnum){
+-		for(i=0;i<this->indexing.ssize;i++){
+-			indexing.sdoflist[i]=dofcount+i;
+-		}
+-		dofcount+=this->indexing.ssize;
+-	}
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-
+-
+-	/*Assign output pointers: */
+-	*pdofcount=dofcount;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::Off_setDofs{{{*/
+-void  Node::OffsetDofs(int dofcount,int setenum){
+-	
+-	int i;
+-	extern int my_rank;
+-	
+-	if(indexing.clone){
+-		/*This node is a clone, don't off_set the dofs!: */
+-		return;
+-	}
+-
+-	/*This node should off_set the dofs, go ahead: */
+-	if(setenum==GsetEnum){
+-		for(i=0;i<this->indexing.gsize;i++) indexing.gdoflist[i]+=dofcount;
+-	}
+-	else if(setenum==FsetEnum){
+-		for(i=0;i<this->indexing.fsize;i++) indexing.fdoflist[i]+=dofcount;
+-	}
+-	else if(setenum==SsetEnum){
+-		for(i=0;i<this->indexing.ssize;i++) indexing.sdoflist[i]+=dofcount;
+-	}
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Node::ShowTrueDofs{{{*/
+-void  Node::ShowTrueDofs(int* truedofs, int ncols,int setenum){
+-
+-	int j;
+-	extern int my_rank;
+-	
+-	/*Are we a clone? : */
+-	if(indexing.clone)return;
+-
+-	/*Ok, we are not a clone, just plug our dofs into truedofs: */
+-	if(setenum==GsetEnum)for(j=0;j<this->indexing.gsize;j++)  *(truedofs+ncols*sid+j)=indexing.gdoflist[j];
+-	else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++)  *(truedofs+ncols*sid+j)=indexing.fdoflist[j];
+-	else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++)  *(truedofs+ncols*sid+j)=indexing.sdoflist[j];
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::UpdateCloneDofs{{{*/
+-void  Node::UpdateCloneDofs(int* alltruedofs,int ncols,int setenum){
+-
+-	int j;
+-	extern int my_rank;
+-	
+-	/*If we are not a clone, don't update, we already have dofs!: */
+-	if(indexing.clone==0)return;
+-
+-
+-	/*Ok, we are a clone node, but we did not create the dofs for this node.
+-	 *      * Therefore, our doflist is garbage right now. Go pick it up in the alltruedofs: */
+-	if(setenum==GsetEnum)for(j=0;j<this->indexing.gsize;j++) indexing.gdoflist[j]=*(alltruedofs+ncols*sid+j);
+-	else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++) indexing.fdoflist[j]=*(alltruedofs+ncols*sid+j);
+-	else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++) indexing.sdoflist[j]=*(alltruedofs+ncols*sid+j);
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Node::SetClone {{{*/
+-void  Node::SetClone(int* minranks){
+-
+-	extern int my_rank;
+-
+-	if (minranks[sid]==my_rank){
+-		indexing.clone=0;
+-	}
+-	else{
+-		/*!there is a cpu with lower rank that has the same node, 
+-		therefore, I am a clone*/
+-		indexing.clone=1; 	
+-	}
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DakotaPlugin.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DakotaPlugin.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/DakotaPlugin.h	(revision 12821)
+@@ -1,55 +0,0 @@
+-/*!\file:  DakotaPlugin.h:
+- */ 
+-
+-#ifndef _DAKOTAPLUGIN_H
+-#define _DAKOTAPLUGIN_H
+-
+-
+-#ifdef _HAVE_DAKOTA_ //only works if dakota library has been compiled in.
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-
+-#include "DirectApplicInterface.H"
+-#include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
+-
+-/*}}}*/
+-
+-namespace SIM {
+-
+-class DakotaPlugin: public Dakota::DirectApplicInterface
+-{
+-public:
+-
+-	DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* model);
+-	~DakotaPlugin();
+-
+-	/*these fields are used by core solutions: */
+-	void* femmodel;
+-
+-	int counter;
+-
+-protected:
+-
+-  // execute the input filter portion of a direct evaluation invocation
+-  //int derived_map_if(const Dakota::String& if_name);
+-  /// execute an analysis code portion of a direct evaluation invocation
+-  int derived_map_ac(const Dakota::String& ac_name);
+-  // execute the output filter portion of a direct evaluation invocation
+-  //int derived_map_of(const Dakota::String& of_name);
+-
+-  /*add for issm: */
+-  int GetCounter();
+-
+-private:
+-
+-};
+-
+-} // namespace SIM
+-
+-#endif //only works if dakota library has been compiled in.
+-
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/FemModel.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/FemModel.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/FemModel.h	(revision 12821)
+@@ -1,51 +0,0 @@
+-/*
+- * FemModel.h: 
+- */
+-
+-#ifndef _FEMMODEL_H_
+-#define _FEMMODEL_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Object.h"
+-#include "../toolkits/toolkits.h"
+-class DataSet;
+-class Parameters;
+-class NodeSets;
+-/*}}}*/
+-
+-
+-class FemModel {
+-
+-	/*no private members, as we need access to these datasets quite often!:*/
+-
+-	public:
+-
+-		int                 nummodels;
+-		int                 solution_type;
+-		int*                analysis_type_list; //list of analyses this femmodel is going to carry out
+-		int                 analysis_counter; //counter into analysis_type_list
+-		
+-		Elements*           elements; //elements (one set for all analyses)
+-		Nodes*              nodes; //one set of nodes
+-		Vertices*           vertices; //one set of vertices
+-		Constraints*        constraints; //one set of constraints. each constraint knows which analysis_type it handles
+-		Loads*              loads;  //one set of constraints. each constraint knows which analysis_type it handles
+-		Materials*          materials;  //one set of materials, for each element
+-		Parameters*         parameters; //one set of parameters, independent of the analysis_type
+-		Results*            results; //results that cannot be fit into the elements (such as one time constants, arrays, strings, etc ...)
+-
+-		/*constructors, destructors: */
+-		FemModel(char* inputfilename, char* outputfilename, const int solution_type,const int* analyses,const int nummodels);
+-		~FemModel();
+-
+-		/*Methods: */
+-		void Echo();
+-
+-		/*Fem: */
+-		void  SetCurrentConfiguration(int configuration_type);
+-		void  SetCurrentConfiguration(int configuration_type,int analysis_type);
+-
+-};
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp	(revision 12821)
+@@ -1,496 +0,0 @@
+-/*!\file ElementMatrix.cpp
+- * \brief: implementation of the ElementMatrix object, used to plug values from element into global stiffness matrix
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*ElementMatrix constructors and destructor*/
+-/*FUNCTION ElementMatrix::ElementMatrix(){{{*/
+-ElementMatrix::ElementMatrix(){
+-
+-	this->nrows=0;
+-	this->ncols=0;
+-	this->values=NULL;
+-	this->dofsymmetrical=false;
+-
+-	this->row_fsize=0;
+-	this->row_flocaldoflist=NULL;
+-	this->row_fglobaldoflist=NULL;
+-	this->row_ssize=0;
+-	this->row_slocaldoflist=NULL;
+-	this->row_sglobaldoflist=NULL;
+-
+-	this->col_fsize=0;
+-	this->col_flocaldoflist=NULL;
+-	this->col_fglobaldoflist=NULL;
+-	this->col_ssize=0;
+-	this->col_slocaldoflist=NULL;
+-	this->col_sglobaldoflist=NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION ElementMatrix::ElementMatrix(ElementMatrix* Ke){{{*/
+-ElementMatrix::ElementMatrix(ElementMatrix* Ke){
+-
+-	if(!Ke) _error2_("Input Element Matrix is a NULL pointer");
+-	this->Init(Ke);
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION ElementMatrix::ElementMatrix(ElementMatrix* Ke1, ElementMatrix* Ke2){{{*/
+-ElementMatrix::ElementMatrix(ElementMatrix* Ke1, ElementMatrix* Ke2){
+-
+-	/*intermediaries*/
+-	int i,j,counter;
+-	int gsize,fsize,ssize;
+-	int* P=NULL;
+-	bool found;
+-
+-	/*If one of the two matrix is NULL, we copy the other one*/
+-	if(!Ke1 && !Ke2){
+-		_error2_("Two input element matrices are NULL");
+-	}
+-	else if(!Ke1){
+-		this->Init(Ke2);
+-		return;
+-	}
+-	else if(!Ke2){
+-		this->Init(Ke1);
+-		return;
+-	}
+-
+-	/*General Case: Ke1 and Ke2 are not empty*/
+-	if(!Ke1->dofsymmetrical || !Ke2->dofsymmetrical) _error2_("merging 2 non dofsymmetrical matrices not implemented yet");
+-
+-	/*Initialize itransformation matrix Ke[P[i]] = Ke2[i]*/
+-	P=xNew<int>(Ke2->nrows);
+-
+-	/*1: Get the new numbering of Ke2 and get size of the new matrix*/
+-	gsize=Ke1->nrows;
+-	for(i=0;i<Ke2->nrows;i++){
+-		found=false;
+-		for(j=0;j<Ke1->nrows;j++){
+-			if(Ke2->gglobaldoflist[i]==Ke1->gglobaldoflist[j]){
+-				found=true; P[i]=j; break;
+-			}
+-		}
+-		if(!found){
+-			P[i]=gsize; gsize++;
+-		}
+-	}
+-
+-	/*2: Initialize static fields*/
+-	this->nrows=gsize;
+-	this->ncols=gsize;
+-	this->dofsymmetrical=true;
+-
+-	/*Gset and values*/
+-	this->gglobaldoflist=xNew<int>(this->nrows);
+-	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->ncols);
+-	for(i=0;i<Ke1->nrows;i++){
+-		for(j=0;j<Ke1->ncols;j++){
+-			this->values[i*this->ncols+j] += Ke1->values[i*Ke1->ncols+j];
+-		}
+-		this->gglobaldoflist[i]=Ke1->gglobaldoflist[i];
+-	}
+-	for(i=0;i<Ke2->nrows;i++){
+-		for(j=0;j<Ke2->ncols;j++){
+-			this->values[P[i]*this->ncols+P[j]] += Ke2->values[i*Ke2->ncols+j];
+-		}
+-		this->gglobaldoflist[P[i]]=Ke2->gglobaldoflist[i];
+-	}
+-
+-	/*Fset*/
+-	fsize=Ke1->row_fsize;
+-	for(i=0;i<Ke2->row_fsize;i++){
+-		if(P[Ke2->row_flocaldoflist[i]] >= Ke1->nrows) fsize++;
+-	}
+-	this->row_fsize=fsize;
+-	if(fsize){
+-		this->row_flocaldoflist =xNew<int>(fsize);
+-		this->row_fglobaldoflist=xNew<int>(fsize);
+-		for(i=0;i<Ke1->row_fsize;i++){
+-			this->row_flocaldoflist[i] =Ke1->row_flocaldoflist[i];
+-			this->row_fglobaldoflist[i]=Ke1->row_fglobaldoflist[i];
+-		}
+-		counter=Ke1->row_fsize;
+-		for(i=0;i<Ke2->row_fsize;i++){
+-			if(P[Ke2->row_flocaldoflist[i]] >= Ke1->nrows){
+-				this->row_flocaldoflist[counter] =P[Ke2->row_flocaldoflist[i]];
+-				this->row_fglobaldoflist[counter]=Ke2->row_fglobaldoflist[i];
+-				counter++;
+-			}
+-		}
+-	}
+-	else{
+-		this->row_flocaldoflist=NULL;
+-		this->row_fglobaldoflist=NULL;
+-	}
+-
+-	/*Sset*/
+-	ssize=Ke1->row_ssize;
+-	for(i=0;i<Ke2->row_ssize;i++){
+-		if(P[Ke2->row_slocaldoflist[i]] >= Ke1->nrows) ssize++;
+-	}
+-	this->row_ssize=ssize;
+-	if(ssize){
+-		this->row_slocaldoflist =xNew<int>(ssize);
+-		this->row_sglobaldoflist=xNew<int>(ssize);
+-		for(i=0;i<Ke1->row_ssize;i++){
+-			this->row_slocaldoflist[i] =Ke1->row_slocaldoflist[i];
+-			this->row_sglobaldoflist[i]=Ke1->row_sglobaldoflist[i];
+-		}
+-		counter=Ke1->row_ssize;
+-		for(i=0;i<Ke2->row_ssize;i++){
+-			if(P[Ke2->row_slocaldoflist[i]] >= Ke1->nrows){
+-				this->row_slocaldoflist[counter] =P[Ke2->row_slocaldoflist[i]];
+-				this->row_sglobaldoflist[counter]=Ke2->row_sglobaldoflist[i];
+-				counter++;
+-			}
+-		}
+-	}
+-	else{
+-		this->row_slocaldoflist=NULL;
+-		this->row_sglobaldoflist=NULL;
+-	}
+-
+-	/*don't do cols, we can pick them up from the rows: */
+-	this->col_fsize=0;
+-	this->col_flocaldoflist=NULL;
+-	this->col_fglobaldoflist=NULL;
+-	this->col_ssize=0;
+-	this->col_slocaldoflist=NULL;
+-	this->col_sglobaldoflist=NULL;
+-
+-	/*clean-up*/
+-	xDelete<int>(P);
+-}
+-/*}}}*/
+-/*FUNCTION 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);
+-	ElementMatrix* Ke123=new ElementMatrix(Ke12,Ke3);
+-
+-	/*Initialize current object with this matrix*/
+-	this->Init(Ke123);
+-
+-	/*clean-up*/
+-	delete Ke12;
+-	delete Ke123;
+-}
+-/*}}}*/
+-/*FUNCTION 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;
+-	this->nrows=GetNumberOfDofs(nodes,numnodes,GsetEnum,approximation);
+-	this->ncols=this->nrows;
+-
+-	/*fill values with 0: */
+-	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->ncols);
+-
+-	/*g list*/
+-	this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
+-
+-	/*get dof lists for f and s set: */
+-	this->row_fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
+-	this->row_flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
+-	this->row_fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
+-	this->row_ssize=GetNumberOfDofs(nodes,numnodes,SsetEnum,approximation);
+-	this->row_slocaldoflist =GetLocalDofList( nodes,numnodes,SsetEnum,approximation);
+-	this->row_sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation);
+-
+-	/*Because this matrix is "dofsymmetrical" don't do cols, we can pick them up from the rows: */
+-	this->col_fsize=0;
+-	this->col_flocaldoflist=NULL;
+-	this->col_fglobaldoflist=NULL;
+-	this->col_ssize=0;
+-	this->col_slocaldoflist=NULL;
+-	this->col_sglobaldoflist=NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION ElementMatrix::~ElementMatrix(){{{*/
+-ElementMatrix::~ElementMatrix(){
+-	
+-	xDelete<IssmDouble>(this->values);
+-	xDelete<int>(this->gglobaldoflist);
+-	xDelete<int>(this->row_flocaldoflist);
+-	xDelete<int>(this->row_fglobaldoflist);
+-	xDelete<int>(this->row_slocaldoflist);
+-	xDelete<int>(this->row_sglobaldoflist);
+-	xDelete<int>(this->col_flocaldoflist);
+-	xDelete<int>(this->col_fglobaldoflist);
+-	xDelete<int>(this->col_slocaldoflist);
+-	xDelete<int>(this->col_sglobaldoflist);
+-}
+-/*}}}*/
+-
+-/*ElementMatrix specific routines: */
+-/*FUNCTION ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){{{*/
+-void ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){
+-
+-	int i,j;
+-	IssmDouble* localvalues=NULL;
+-
+-	/*If Kfs is not provided, call the other function*/
+-	if(!Kfs){
+-		this->AddToGlobal(Kff);
+-		return;
+-	}
+-
+-	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+-	this->CheckConsistency();
+-
+-	if(this->dofsymmetrical){
+-		/*only use row dofs to add values into global matrices: */
+-
+-		if(this->row_fsize){
+-			/*first, retrieve values that are in the f-set from the g-set values matrix: */
+-			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
+-			for(i=0;i<this->row_fsize;i++){
+-				for(j=0;j<this->row_fsize;j++){
+-					*(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);
+-				}
+-			}
+-			/*add local values into global  matrix, using the fglobaldoflist: */
+-			Kff->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
+-
+-			/*Free ressources:*/
+-			xDelete<IssmDouble>(localvalues);
+-		}
+-
+-
+-		if((this->row_ssize!=0) && (this->row_fsize!=0)){
+-			/*first, retrieve values that are in the f and s-set from the g-set values matrix: */
+-			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_ssize);
+-			for(i=0;i<this->row_fsize;i++){
+-				for(j=0;j<this->row_ssize;j++){
+-					*(localvalues+this->row_ssize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]);
+-				}
+-			}
+-			/*add local values into global  matrix, using the fglobaldoflist: */
+-			Kfs->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_ssize,this->row_sglobaldoflist,localvalues,ADD_VAL);
+-
+-			/*Free ressources:*/
+-			xDelete<IssmDouble>(localvalues);
+-		}
+-	}
+-	else{
+-		_error2_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION ElementMatrix::AddToGlobal(Matrix* Jff){{{*/
+-void ElementMatrix::AddToGlobal(Matrix* Jff){
+-
+-	int i,j;
+-	IssmDouble* localvalues=NULL;
+-
+-	/*Check that Jff is not NULL*/
+-	_assert_(Jff); 
+-
+-	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+-	this->CheckConsistency();
+-
+-	if(this->dofsymmetrical){
+-		/*only use row dofs to add values into global matrices: */
+-
+-		if(this->row_fsize){
+-			/*first, retrieve values that are in the f-set from the g-set values matrix: */
+-			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
+-			for(i=0;i<this->row_fsize;i++){
+-				for(j=0;j<this->row_fsize;j++){
+-					*(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);
+-				}
+-			}
+-			/*add local values into global  matrix, using the fglobaldoflist: */
+-			Jff->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
+-
+-			/*Free ressources:*/
+-			xDelete<IssmDouble>(localvalues);
+-		}
+-
+-	}
+-	else{
+-		_error2_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION ElementMatrix::CheckConsistency{{{*/
+-void ElementMatrix::CheckConsistency(void){
+-	/*Check element matrix values, only in debugging mode*/
+-	#ifdef _ISSM_DEBUG_ 
+-	for (int i=0;i<this->nrows;i++){
+-		for(int j=0;j<this->ncols;j++){
+-			if (xIsNan<IssmDouble>(this->values[i*this->ncols+j])) _error2_("NaN found in Element Matrix");
+-			if (fabs(this->values[i*this->ncols+j])>1.e+50) _error2_("Element Matrix values exceeds 1.e+50");
+-		}
+-	}
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION ElementMatrix::Transpose{{{*/
+-void ElementMatrix::Transpose(void){
+-
+-	/*Intermediaries*/
+-	ElementMatrix* Ke_copy=new ElementMatrix(this);
+-
+-	/*Update sizes*/
+-	this->nrows=Ke_copy->ncols;
+-	this->ncols=Ke_copy->nrows;
+-
+-	/*Transpose values*/
+-	for (int i=0;i<this->nrows;i++) for(int j=0;j<this->ncols;j++) this->values[i*this->ncols+j]=Ke_copy->values[j*Ke_copy->ncols+i];
+-
+-	/*Transpose indices*/
+-	if(!dofsymmetrical){
+-		_error2_("not supported yet");
+-	}
+-
+-	/*Clean up and return*/
+-	delete Ke_copy;
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION ElementMatrix::Echo{{{*/
+-void ElementMatrix::Echo(void){
+-
+-	int i,j;
+-	_printLine_("Element Matrix echo:");
+-	_printLine_("   nrows: " << nrows);
+-	_printLine_("   ncols: " << nrows);
+-	_printLine_("   dofsymmetrical: " << (dofsymmetrical?"true":"false"));
+-
+-	_printLine_("   values:");
+-	for(i=0;i<nrows;i++){
+-		_printString_(setw(4) << right << i << ": ");
+-		for(j=0;j<ncols;j++) _printString_( " " << setw(11) << setprecision (5) << right << values[i*ncols+j]);
+-		_printLine_("");
+-	}
+-
+-	_printString_("   gglobaldoflist (" << gglobaldoflist << "): ");
+-	if(gglobaldoflist) for(i=0;i<nrows;i++) _printString_(" " << gglobaldoflist[i]); _printLine_("");
+-
+-	_printLine_("   row_fsize: " << row_fsize);
+-	_printString_("   row_flocaldoflist  (" << row_flocaldoflist << "): ");
+-	if(row_flocaldoflist) for(i=0;i<row_fsize;i++) _printString_(" " << row_flocaldoflist[i]); _printLine_(" ");
+-	_printString_("   row_fglobaldoflist  (" << row_fglobaldoflist << "): ");
+-	if(row_fglobaldoflist) for(i=0;i<row_fsize;i++) _printString_(" " << row_fglobaldoflist[i]); _printLine_(" ");
+-
+-	_printLine_("   row_ssize: " << row_ssize);
+-	_printString_("   row_slocaldoflist  (" << row_slocaldoflist << "): ");
+-	if(row_slocaldoflist) for(i=0;i<row_ssize;i++) _printString_(" " << row_slocaldoflist[i]); _printLine_(" ");
+-	_printString_("   row_sglobaldoflist  (" << row_sglobaldoflist << "): ");
+-	if(row_sglobaldoflist) for(i=0;i<row_ssize;i++) _printString_(" " << row_sglobaldoflist[i]); _printLine_(" ");
+-
+-	if(!dofsymmetrical){
+-		_printLine_("   col_fsize: " << col_fsize);
+-		_printString_("   col_flocaldoflist  (" << col_flocaldoflist << "): ");
+-		if(col_flocaldoflist) for(i=0;i<col_fsize;i++) _printString_(" " << col_flocaldoflist[i]); _printLine_(" ");
+-		_printString_("   col_fglobaldoflist  (" << col_fglobaldoflist << "): ");
+-		if(col_fglobaldoflist) for(i=0;i<col_fsize;i++) _printString_(" " << col_fglobaldoflist[i]); _printLine_(" ");
+-
+-		_printLine_("   col_ssize: " << col_ssize);
+-		_printString_("   col_slocaldoflist  (" << col_slocaldoflist << "): ");
+-		if(col_slocaldoflist) for(i=0;i<col_ssize;i++) _printString_(" " << col_slocaldoflist[i]); _printLine_(" ");
+-		_printString_("   col_sglobaldoflist  (" << col_sglobaldoflist << "): ");
+-		if(col_sglobaldoflist) for(i=0;i<col_ssize;i++) _printString_(" " << col_sglobaldoflist[i]); _printLine_(" ");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION ElementMatrix::Init{{{*/
+-void ElementMatrix::Init(ElementMatrix* Ke){
+-
+-	_assert_(Ke);
+-
+-	this->nrows =Ke->nrows;
+-	this->ncols =Ke->ncols;
+-	this->dofsymmetrical=Ke->dofsymmetrical;
+-
+-	this->values=xNew<IssmDouble>(this->nrows*this->ncols);
+-	xMemCpy<IssmDouble>(this->values,Ke->values,this->nrows*this->ncols);
+-
+-	this->gglobaldoflist=xNew<int>(this->nrows);
+-	xMemCpy<int>(this->gglobaldoflist,Ke->gglobaldoflist,this->nrows);
+-
+-	this->row_fsize=Ke->row_fsize;
+-	if(this->row_fsize){
+-		this->row_flocaldoflist=xNew<int>(this->row_fsize);
+-		xMemCpy<int>(this->row_flocaldoflist,Ke->row_flocaldoflist,this->row_fsize);
+-		this->row_fglobaldoflist=xNew<int>(this->row_fsize);
+-		xMemCpy<int>(this->row_fglobaldoflist,Ke->row_fglobaldoflist,this->row_fsize);
+-	}
+-	else{
+-		this->row_flocaldoflist=NULL;
+-		this->row_fglobaldoflist=NULL;
+-	}
+-
+-	this->row_ssize=Ke->row_ssize;
+-	if(this->row_ssize){
+-		this->row_slocaldoflist=xNew<int>(this->row_ssize);
+-		xMemCpy<int>(this->row_slocaldoflist,Ke->row_slocaldoflist,this->row_ssize);
+-		this->row_sglobaldoflist=xNew<int>(this->row_ssize);
+-		xMemCpy<int>(this->row_sglobaldoflist,Ke->row_sglobaldoflist,this->row_ssize);
+-	}
+-	else{
+-		this->row_slocaldoflist=NULL;
+-		this->row_sglobaldoflist=NULL;
+-	}
+-
+-	this->col_fsize=Ke->col_fsize;
+-	if(this->col_fsize){
+-		this->col_flocaldoflist=xNew<int>(this->col_fsize);
+-		xMemCpy<int>(this->col_flocaldoflist,Ke->col_flocaldoflist,this->col_fsize);
+-		this->col_fglobaldoflist=xNew<int>(this->col_fsize);
+-		xMemCpy<int>(this->col_fglobaldoflist,Ke->col_fglobaldoflist,this->col_fsize);
+-	}
+-	else{
+-		this->col_flocaldoflist=NULL;
+-		this->col_fglobaldoflist=NULL;
+-	}
+-
+-	this->col_ssize=Ke->col_ssize;
+-	if(this->col_ssize){
+-		this->col_slocaldoflist=xNew<int>(this->col_ssize);
+-		xMemCpy<int>(this->col_slocaldoflist,Ke->col_slocaldoflist,this->col_ssize);
+-		this->col_sglobaldoflist=xNew<int>(this->col_ssize);
+-		xMemCpy<int>(this->col_sglobaldoflist,Ke->col_sglobaldoflist,this->col_ssize);
+-	}
+-	else{
+-		this->col_slocaldoflist=NULL;
+-		this->col_sglobaldoflist=NULL;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION ElementMatrix::SetDiag{{{*/
+-void ElementMatrix::SetDiag(IssmDouble scalar){
+-
+-	int i;
+-
+-	if(this->nrows!=this->ncols)_error2_("need square matrix in input!");
+-
+-	for(i=0;i<this->nrows;i++){
+-		this->values[this->ncols*i+i]=scalar;
+-	}
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementVector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementVector.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementVector.h	(revision 12821)
+@@ -1,51 +0,0 @@
+-/*!\file:  ElementVector.h
+- * \brief container for information needed to plug element vector generated by elements 
+- * into the pf global load vector. 
+- * This object will hold the element vector on the g-set, the local as well as global 
+- * dof lists in the f set
+- */ 
+-
+-#ifndef _ELEMENT_VECTOR_H_
+-#define _ELEMENT_VECTOR_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Object.h"
+-#include "../../toolkits/toolkits.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-class Node;
+-/*}}}*/
+-
+-class ElementVector{
+-
+-	public:
+-	
+-		int      nrows;
+-		IssmDouble*  values;
+-		
+-		//gset
+-		int*     gglobaldoflist;
+-
+-		//fset
+-		int      fsize;
+-		int*     flocaldoflist;
+-		int*     fglobaldoflist;
+-		
+-		/*ElementVector constructors, destructors {{{*/
+-		ElementVector();
+-		ElementVector(ElementVector* pe1,ElementVector* pe2);
+-		ElementVector(ElementVector* pe1,ElementVector* pe2,ElementVector* pe3);
+-		ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
+-		~ElementVector();
+-		/*}}}*/
+-		/*ElementVector specific routines {{{*/
+-		void AddToGlobal(Vector* pf);
+-		void InsertIntoGlobal(Vector* pf);
+-		void Echo(void);
+-		void CheckConsistency(void);
+-		void Init(ElementVector* pe);
+-		void SetValue(IssmDouble scalar);
+-		/*}}}*/
+-};
+-#endif //#ifndef _ELEMENT_VECTOR_H_
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Vector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Vector.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Vector.cpp	(revision 12821)
+@@ -1,347 +0,0 @@
+-/*!\file Vector.cpp
+- * \brief: implementation of the Vector object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-#include "../../toolkits/toolkits.h"
+-#include "./Vector.h"
+-/*}}}*/
+-
+-/*Vector constructors and destructor*/
+-/*FUNCTION Vector::Vector(){{{*/
+-Vector::Vector(){
+-
+-	#ifdef _HAVE_PETSC_
+-	this->vector=NULL;
+-	#else
+-	this->vector=NULL;
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->avector=NULL;
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Vector(int M,bool fromlocalsize){{{*/
+-Vector::Vector(int pM,bool fromlocalsize){
+-
+-	#ifdef _HAVE_PETSC_
+-	this->vector=NewVec(pM,fromlocalsize);
+-	#else
+-	this->vector=new SeqVec(pM,fromlocalsize);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->avector=xNew<IssmDouble>(pM);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Vector(IssmDouble* serial_vec,int M){{{*/
+-Vector::Vector(IssmDouble* serial_vec,int M){
+-
+-	#ifdef _HAVE_PETSC_
+-		int* idxm=xNew<int>(M);
+-		for(int i=0;i<M;i++) idxm[i]=i;
+-
+-		this->vector=NewVec(M);
+-		VecSetValues(this->vector,M,idxm,serial_vec,INSERT_VALUES);
+-		VecAssemblyBegin(this->vector);
+-		VecAssemblyEnd(this->vector);
+-
+-		xDelete<int>(idxm);
+-	#else
+-		this->vector=new SeqVec(serial_vec,M);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-		this->avector=xNew<IssmDouble>(M);
+-	#endif
+-}
+-/*}}}*/
+-#ifdef _HAVE_PETSC_
+-/*FUNCTION Vector::Vector(Vec petsc_vec){{{*/
+-Vector::Vector(Vec petsc_vec){
+-
+-	if(petsc_vec==NULL){
+-		this->vector=NewVec(0);
+-	}
+-	else{
+-		/*copy vector*/
+-		VecDuplicate(petsc_vec,&this->vector);
+-		VecCopy(petsc_vec,this->vector);
+-	}
+-
+-}
+-/*}}}*/
+-#endif
+-#if defined(_HAVE_GSL_) && !defined(_HAVE_PETSC_)
+-/*FUNCTION Vector::Vector(SeqVec* seq_vec){{{*/
+-Vector::Vector(SeqVec*  seq_vec){
+-
+-	if(seq_vec==NULL){
+-		this->vector=NULL;
+-	}
+-	else{
+-		/*copy vector*/
+-		this->vector=seq_vec->Duplicate();
+-	}
+-}
+-/*}}}*/
+-#endif
+-
+-		/*FUNCTION Vector::~Vector(){{{*/
+-Vector::~Vector(){
+-
+- 	#ifdef _HAVE_PETSC_
+-	VecFree(&this->vector);
+-	#else
+-	delete this->vector;
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	xDelete<IssmDouble>(this->avector);
+-	#endif
+-}
+-/*}}}*/
+-
+-/*Vector specific routines: */
+-/*FUNCTION Vector::Echo{{{*/
+-void Vector::Echo(void){
+-
+-	int i;
+-
+-	#ifdef _HAVE_PETSC_
+-	_assert_(this->vector);
+-	VecView(this->vector,PETSC_VIEWER_STDOUT_WORLD);
+-	#else
+-	this->vector->Echo();
+-	#endif
+-
+-	#ifdef _HAVE_ADOLC_
+-	/*do nothing for now: */
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Assemble{{{*/
+-void Vector::Assemble(void){
+-		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecAssemblyBegin(this->vector); 
+-		VecAssemblyEnd(this->vector);
+-	#else
+-		this->vector->Assemble();
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::SetValues{{{*/
+-void Vector::SetValues(int ssize, int* list, IssmDouble* values, InsMode mode){
+-		
+-		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecSetValues(this->vector,ssize,list,values,ISSMToPetscInsertMode(mode));
+-	#else
+-		this->vector->SetValues(ssize,list,values,mode);
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::SetValue{{{*/
+-void Vector::SetValue(int dof, IssmDouble value, InsMode mode){
+-		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecSetValues(this->vector,1,&dof,&value,ISSMToPetscInsertMode(mode));
+-	#else
+-		this->vector->SetValue(dof,value,mode);
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::GetValue{{{*/
+-void Vector::GetValue(IssmDouble* pvalue,int dof){
+-		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecGetValues(this->vector,1,&dof,pvalue);
+-	#else
+-	this->vector->GetValue(pvalue,dof);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Vector::GetSize{{{*/
+-void Vector::GetSize(int* pM){
+-		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecGetSize(this->vector,pM);
+-	#else
+-		this->vector->GetSize(pM);
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::IsEmpty{{{*/
+-bool Vector::IsEmpty(void){
+-
+-	int M;
+-
+-	_assert_(this->vector);
+-	this->GetSize(&M);
+-
+-	if(M==0) 
+-	 return true;
+-	else
+-	 return false;
+-}
+-/*}}}*/
+-/*FUNCTION Vector::GetLocalSize{{{*/
+-void Vector::GetLocalSize(int* pM){
+-		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecGetLocalSize(this->vector,pM);
+-	#else
+-		this->vector->GetLocalSize(pM);
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Duplicate{{{*/
+-Vector* Vector::Duplicate(void){
+-	
+-	Vector* output=NULL;
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		Vec vec_output=NULL;
+-		VecDuplicate(this->vector,&vec_output);
+-		output=new Vector(vec_output);
+-		VecFree(&vec_output);
+-	#else
+-		output=new Vector();
+-		output->vector=this->vector->Duplicate();
+-	#endif
+-	return output;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Set{{{*/
+-void Vector::Set(IssmDouble value){
+-	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecSet(this->vector,value);
+-	#else
+-		this->vector->Set(value);
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::AXPY{{{*/
+-void Vector::AXPY(Vector* X, IssmDouble a){
+-	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecAXPY(this->vector,a,X->vector);
+-	#else
+-		this->vector->AXPY(X->vector,a);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Vector::AYPX{{{*/
+-void Vector::AYPX(Vector* X, IssmDouble a){
+-	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecAYPX(this->vector,a,X->vector);
+-	#else
+-		this->vector->AYPX(X->vector,a);
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::ToMPISerial{{{*/
+-IssmDouble* Vector::ToMPISerial(void){
+-
+-	IssmDouble* vec_serial=NULL;
+-
+-	#ifdef _HAVE_PETSC_
+-		VecToMPISerial(&vec_serial, this->vector);
+-	#else
+-		vec_serial=this->vector->ToMPISerial();
+-	#endif
+-
+-	return vec_serial;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Copy{{{*/
+-void Vector::Copy(Vector* to){
+-
+-	#ifdef _HAVE_PETSC_
+-		if(this->vector) VecCopy(this->vector,to->vector);
+-	#else
+-		this->vector->Copy(to->vector);
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Norm{{{*/
+-IssmDouble Vector::Norm(NormMode norm_type){
+-	
+-	IssmDouble norm=0;
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecNorm(this->vector,ISSMToPetscNormMode(norm_type),&norm);
+-	#else
+-		norm=this->vector->Norm(norm_type);
+-	#endif
+-	return norm;
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Scale{{{*/
+-void Vector::Scale(IssmDouble scale_factor){
+-	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecScale(this->vector,scale_factor); 
+-	#else
+-		this->vector->Scale(scale_factor);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Dot{{{*/
+-IssmDouble Vector::Dot(Vector* vector){
+-
+-	IssmDouble dot;
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecDot(this->vector,vector->vector,&dot);
+-	#else
+-		dot=this->vector->Dot(vector->vector);
+-	#endif
+-	return dot;
+-}
+-/*}}}*/
+-/*FUNCTION Vector::PointwiseDivide{{{*/
+-void Vector::PointwiseDivide(Vector* x,Vector* y){
+-
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecPointwiseDivide(this->vector,x->vector,y->vector);
+-	#else
+-		this->vector->PointwiseDivide(x->vector,y->vector);
+-	#endif
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.h	(revision 12821)
+@@ -1,69 +0,0 @@
+-/*!\file:  ElementMatrix.h
+- * \brief container for information needed to plug element matrix generated by elements 
+- * into the Kff and Kfs global matrices. 
+- * This object will hold the element matrix on the g-set, the local as well as global 
+- * dof lists in the f and s sets.
+- */ 
+-
+-#ifndef _ELEMENT_MATRIX_H_
+-#define _ELEMENT_MATRIX_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Object.h"
+-#include "../../toolkits/toolkits.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-class Node;
+-/*}}}*/
+-
+-class ElementMatrix{
+-
+-	public:
+-	
+-		int      nrows;
+-		int      ncols;
+-		bool     dofsymmetrical;
+-		IssmDouble*  values;
+-
+-		//gset
+-		int*     gglobaldoflist;
+-
+-		/*row wise: */
+-		//fset
+-		int      row_fsize;
+-		int*     row_flocaldoflist;
+-		int*     row_fglobaldoflist;
+-		//sset
+-		int      row_ssize;
+-		int*     row_slocaldoflist;
+-		int*     row_sglobaldoflist;
+-
+-		/*column wise: */
+-		//fset
+-		int      col_fsize;
+-		int*     col_flocaldoflist;
+-		int*     col_fglobaldoflist;
+-		//sset
+-		int      col_ssize;
+-		int*     col_slocaldoflist;
+-		int*     col_sglobaldoflist;
+-
+-		/*ElementMatrix constructors, destructors {{{*/
+-		ElementMatrix();
+-		ElementMatrix(ElementMatrix* Ke);
+-		ElementMatrix(ElementMatrix* Ke1,ElementMatrix* Ke2);
+-		ElementMatrix(ElementMatrix* Ke1,ElementMatrix* Ke2,ElementMatrix* Ke3);
+-		ElementMatrix(Node** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
+-		~ElementMatrix();
+-		/*}}}*/
+-		/*ElementMatrix specific routines {{{*/
+-		void AddToGlobal(Matrix* Kff, Matrix* Kfs);
+-		void AddToGlobal(Matrix* Jff);
+-		void Echo(void);
+-		void CheckConsistency(void);
+-		void Transpose(void);
+-		void Init(ElementMatrix* Ke);
+-		void SetDiag(IssmDouble scalar);
+-		/*}}}*/
+-};
+-#endif //#ifndef _ELEMENT_MATRIX_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Matrix.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Matrix.cpp	(revision 12821)
+@@ -1,253 +0,0 @@
+-/*!\file Matrix.cpp
+- * \brief: implementation of the Matrix object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-#include "../../toolkits/toolkits.h"
+-#include "./Matrix.h"
+-	
+-/*}}}*/
+-
+-/*Matrix constructors and destructor*/
+-/*FUNCTION Matrix::Matrix(){{{*/
+-Matrix::Matrix(){
+-
+-	#ifdef _HAVE_PETSC_
+-	this->matrix=NULL;
+-	#else
+-	this->matrix=NULL;
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->amatrix=NULL;
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Matrix(int M,int N){{{*/
+-Matrix::Matrix(int M,int N){
+-
+-	#ifdef _HAVE_PETSC_
+-	this->matrix=NewMat(M,N);
+-	#else
+-	this->matrix=new SeqMat(M,N);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->amatrix=xNew<IssmDouble>(M*N);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Matrix(int M,int N,IssmDouble sparsity){{{*/
+-Matrix::Matrix(int M,int N,IssmDouble sparsity){
+-
+-	#ifdef _HAVE_PETSC_
+-	this->matrix=NewMat(M,N,sparsity);
+-	#else
+-	this->matrix=new SeqMat(M,N,sparsity);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+- 	this->amatrix=xNew<IssmDouble>(M*N);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity){{{*/
+-Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity){
+-
+-	#ifdef _HAVE_PETSC_
+-	int     i;
+-
+-
+-	int* idxm=xNew<int>(M);
+-	int* idxn=xNew<int>(N);
+-	for(i=0;i<M;i++)idxm[i]=i;
+-	for(i=0;i<N;i++)idxn[i]=i;
+-
+-	this->matrix=NewMat(M,N,sparsity);
+-	MatSetValues(this->matrix,M,idxm,N,idxn,serial_mat,INSERT_VALUES);
+-	MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
+-	MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
+-
+-	xDelete<int>(idxm);
+-	xDelete<int>(idxn);
+-	#else
+-	this->matrix=new SeqMat(serial_mat,M,N,sparsity);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->amatrix=xNew<IssmDouble>(M*N);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode){{{*/
+-Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode){
+-	
+-	#ifdef _HAVE_PETSC_
+-	this->matrix=NewMat(M,N,connectivity,numberofdofspernode);
+-	#else
+-	this->matrix=new SeqMat(M,N,connectivity,numberofdofspernode);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->amatrix=xNew<IssmDouble>(M*N);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::~Matrix(){{{*/
+-Matrix::~Matrix(){
+-
+- 	#ifdef _HAVE_PETSC_
+-	MatFree(&this->matrix);
+-	#else
+-	delete this->matrix;
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	xDelete<IssmDouble>(this->amatrix);
+-	#endif
+-}
+-/*}}}*/
+-
+-/*Matrix specific routines: */
+-/*FUNCTION Matrix::Echo{{{*/
+-void Matrix::Echo(void){
+-
+-	int i,j;
+-
+-	#ifdef _HAVE_PETSC_
+-	MatView(this->matrix,PETSC_VIEWER_STDOUT_WORLD);
+-	#else
+-	this->matrix->Echo();
+-	#endif
+-
+-	#ifdef _HAVE_ADOLC_
+-	/*Not sure about that one. Should we use the overloaded operator >>?*/
+-	_printString_("ADOLC Matrix equivalent:" );
+-//	for(i=0;i<M;i++){
+-//		for(j=0;j<N;j++){
+-//			_printString_(*(amatrix+N*i+j) << " ");
+-//		}
+-//		_printLine_("");
+-//	}
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Assemble{{{*/
+-void Matrix::Assemble(void){
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
+-		MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
+-		#if _PETSC_MAJOR_ == 2 
+-			MatCompress(this->matrix);
+-		#endif
+-	#else
+-		this->matrix->Assemble();
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Norm{{{*/
+-IssmDouble Matrix::Norm(NormMode norm_type){
+-	
+-	IssmDouble norm=0;
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		MatNorm(this->matrix,ISSMToPetscNormMode(norm_type),&norm);
+-	#else
+-		norm=this->matrix->Norm(norm_type);
+-	#endif
+-	return norm;
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::GetSize{{{*/
+-void Matrix::GetSize(int* pM,int* pN){
+-	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		MatGetSize(this->matrix,pM,pN);
+-	#else
+-		this->matrix->GetSize(pM,pN);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::GetLocalSize{{{*/
+-void Matrix::GetLocalSize(int* pM,int* pN){
+-	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		MatGetLocalSize(this->matrix,pM,pN);
+-	#else
+-		this->matrix->GetLocalSize(pM,pN);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::MatMult{{{*/
+-void Matrix::MatMult(Vector* X,Vector* AX){
+-
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		_assert_(X->vector);
+-		MatMultPatch(this->matrix,X->vector,AX->vector);
+-	#else
+-		this->matrix->MatMult(X->vector,AX->vector);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Duplicate{{{*/
+-Matrix* Matrix::Duplicate(void){
+-
+-	Matrix* output=NULL;
+-
+-	output=new Matrix();
+-
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		MatDuplicate(this->matrix,MAT_COPY_VALUES,&output->matrix);
+-	#else
+-		output->matrix=this->matrix->Duplicate();
+-	#endif
+-	
+-	return output;
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::ToSerial{{{*/
+-IssmDouble* Matrix::ToSerial(void){
+-
+-	IssmDouble* output=NULL;
+-
+-	#ifdef _HAVE_PETSC_
+-		MatToSerial(&output,this->matrix);
+-	#else
+-		output=this->matrix->ToSerial();
+-	#endif
+-	return output;
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::SetValues{{{*/
+-void Matrix::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){
+-
+-	#ifdef _HAVE_PETSC_
+-		MatSetValues(this->matrix,m,idxm,n,idxn,values,ISSMToPetscInsertMode(mode));
+-	#else
+-		this->matrix->SetValues(m,idxm,n,idxn,values,mode);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Convert{{{*/
+-void Matrix::Convert(MatrixType type){
+-
+-	#ifdef _HAVE_PETSC_
+-		MatConvert(this->matrix,ISSMToPetscMatrixType(type),MAT_REUSE_MATRIX,&this->matrix);
+-	#else
+-		this->matrix->Convert(type);
+-	#endif
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Vector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Vector.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Vector.h	(revision 12821)
+@@ -1,69 +0,0 @@
+-/*!\file:  Vector.h
+- * \brief wrapper to vector objects. The goal is to control which API (PETSc,Scalpack, Plapack?) 
+- * implements our underlying vector format.
+- */ 
+-
+-#ifndef _VECTOR_H_
+-#define _VECTOR_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-#include "../../toolkits/toolkits.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-/*}}}*/
+-
+-class Vector{
+-
+-	public:
+-	
+-		#ifdef _HAVE_PETSC_
+-			Vec vector; 
+-		#else
+-			SeqVec* vector;
+-		#endif
+-		#ifdef _HAVE_ADOLC_
+-			IssmDouble* avector;
+-		#endif
+-
+-		/*Vector constructors, destructors {{{*/
+-		Vector();
+-		Vector(int M,bool fromlocalsize=false);
+-		Vector(IssmDouble* serial_vec,int pM);
+-		#ifdef _HAVE_PETSC_
+-		Vector(Vec petsc_vec);
+-		#endif
+-		#if defined(_HAVE_GSL_) && !defined(_HAVE_PETSC_)
+-		Vector(SeqVec*  seq_vec);
+-		#endif
+-		~Vector();
+-		/*}}}*/
+-		/*Vector specific routines {{{*/
+-		void Echo(void);
+-		void    AXPY(Vector *X, IssmDouble a);
+-		void    AYPX(Vector *X, IssmDouble a);
+-		void    Assemble(void);
+-		void    Copy(Vector *to);
+-		IssmDouble  Dot(Vector *vector);
+-		Vector *Duplicate(void);
+-		void    GetValue(IssmDouble *pvalue, int dof);
+-		void    GetSize(int *pM);
+-		void    GetLocalSize(int *pM);
+-		bool    IsEmpty(void);
+-		IssmDouble  Norm(NormMode norm_type);
+-		void    PointwiseDivide(Vector  *x,Vector*y);
+-		void    Scale(IssmDouble scale_factor);
+-		void    Set(IssmDouble value);
+-		void    SetValues(int ssize, int *list, IssmDouble*values, InsMode mode);
+-		void    SetValue(int dof, IssmDouble value, InsMode mode);
+-		IssmDouble *ToMPISerial(void);
+-		/*}}}*/
+-};
+-
+-
+-#endif //#ifndef _VECTOR_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Matrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Matrix.h	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/Matrix.h	(revision 12821)
+@@ -1,59 +0,0 @@
+-/*!\file:  Matrix.h
+- * \brief wrapper to matrix objects. The goal is to control which API (PETSc,Scalpack, Plapack?) 
+- * implements our underlying matrix format.
+- */ 
+-
+-#ifndef _MATRIX_H_
+-#define _MATRIX_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-#include "../../toolkits/toolkits.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-class Vector;
+-
+-/*}}}*/
+-
+-class Matrix{
+-
+-	public:
+-	
+-		#ifdef _HAVE_PETSC_
+-		Mat matrix; 
+-		#else
+-		SeqMat* matrix; 
+-		#endif
+-		#ifdef _HAVE_ADOLC_
+-		IssmDouble* amatrix;
+-		#endif
+-
+-		/*Matrix constructors, destructors {{{*/
+-		Matrix();
+-		Matrix(int M,int N);
+-		Matrix(int M,int N,IssmDouble sparsity);
+-		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity);
+-		Matrix(int M,int N,int connectivity,int numberofdofspernode);
+-		~Matrix();
+-		/*}}}*/
+-		/*Matrix specific routines {{{*/
+-		void Echo(void);
+-		void Assemble(void);
+-		IssmDouble Norm(NormMode norm_type);
+-		void GetSize(int* pM,int* pN);
+-		void GetLocalSize(int* pM,int* pN);
+-		void MatMult(Vector* X,Vector* AX);
+-		Matrix* Duplicate(void);
+-		IssmDouble* ToSerial(void);
+-		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode);
+-		void Convert(MatrixType type);
+-		/*}}}*/
+-
+-};
+-
+-#endif //#ifndef _MATRIX_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementVector.cpp	(revision 12820)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementVector.cpp	(revision 12821)
+@@ -1,276 +0,0 @@
+-/*!\file ElementVector.cpp
+- * \brief: implementation of the ElementVector object, used to plug values from element into global load
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*ElementVector constructors and destructor*/
+-/*FUNCTION ElementVector::ElementVector(){{{*/
+-ElementVector::ElementVector(){
+-
+-	this->nrows=0;
+-	this->values=NULL;
+-	this->fsize=0;
+-	this->flocaldoflist=NULL;
+-	this->fglobaldoflist=NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){{{*/
+-ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){
+-
+-	/*intermediaries*/
+-	int i,j,counter;
+-	int gsize,fsize,ssize;
+-	int* P=NULL;
+-	bool found;
+-
+-	/*If one of the two matrix is NULL, we copy the other one*/
+-	if(!pe1 && !pe2){
+-		_error2_("Two input element matrices are NULL");
+-	}
+-	else if(!pe1){
+-		this->Init(pe2);
+-		return;
+-	}
+-	else if(!pe2){
+-		this->Init(pe1);
+-		return;
+-	}
+-
+-	/*Initialize itransformation matrix pe[P[i]] = pe2[i]*/
+-	P=xNew<int>(pe2->nrows);
+-
+-	/*1: Get the new numbering of pe2 and get size of the new matrix*/
+-	gsize=pe1->nrows;
+-	for(i=0;i<pe2->nrows;i++){
+-		found=false;
+-		for(j=0;j<pe1->nrows;j++){
+-			if(pe2->gglobaldoflist[i]==pe1->gglobaldoflist[j]){
+-				found=true; P[i]=j; break;
+-			}
+-		}
+-		if(!found){
+-			P[i]=gsize; gsize++;
+-		}
+-	}
+-
+-	/*2: Initialize static fields*/
+-	this->nrows=gsize;
+-
+-	/*Gset and values*/
+-	this->gglobaldoflist=xNew<int>(this->nrows);
+-	this->values=xNewZeroInit<IssmDouble>(this->nrows);
+-	for(i=0;i<pe1->nrows;i++){
+-		this->values[i] += pe1->values[i];
+-		this->gglobaldoflist[i]=pe1->gglobaldoflist[i];
+-	}
+-	for(i=0;i<pe2->nrows;i++){
+-		this->values[P[i]] += pe2->values[i];
+-		this->gglobaldoflist[P[i]]=pe2->gglobaldoflist[i];
+-	}
+-
+-	/*Fset*/
+-	fsize=pe1->fsize;
+-	for(i=0;i<pe2->fsize;i++){
+-		if(P[pe2->flocaldoflist[i]] >= pe1->nrows) fsize++;
+-	}
+-	this->fsize=fsize;
+-	if(fsize){
+-		this->flocaldoflist =xNew<int>(fsize);
+-		this->fglobaldoflist=xNew<int>(fsize);
+-		for(i=0;i<pe1->fsize;i++){
+-			this->flocaldoflist[i] =pe1->flocaldoflist[i];
+-			this->fglobaldoflist[i]=pe1->fglobaldoflist[i];
+-		}
+-		counter=pe1->fsize;
+-		for(i=0;i<pe2->fsize;i++){
+-			if(P[pe2->flocaldoflist[i]] >= pe1->nrows){
+-				this->flocaldoflist[counter] =P[pe2->flocaldoflist[i]];
+-				this->fglobaldoflist[counter]=pe2->fglobaldoflist[i];
+-				counter++;
+-			}
+-		}
+-	}
+-	else{
+-		this->flocaldoflist=NULL;
+-		this->fglobaldoflist=NULL;
+-	}
+-
+-	/*clean-up*/
+-	xDelete<int>(P);
+-}
+-/*}}}*/
+-/*FUNCTION 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);
+-	ElementVector* pe123=new ElementVector(pe12,pe3);
+-
+-	/*Initialize current object with this matrix*/
+-	this->Init(pe123);
+-
+-	/*clean-up*/
+-	delete pe12;
+-	delete pe123;
+-}
+-/*}}}*/
+-/*FUNCTION 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);
+-
+-	/*fill values with 0: */
+-	this->values=xNewZeroInit<IssmDouble>(this->nrows);
+-	
+-	/*g list*/
+-	this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
+-
+-	/*Get fsize*/
+-	this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
+-	this->flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
+-	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
+-}
+-/*}}}*/
+-/*FUNCTION ElementVector::~ElementVector(){{{*/
+-ElementVector::~ElementVector(){
+-	
+-	xDelete<IssmDouble>(this->values);
+-	xDelete<int>(this->gglobaldoflist);
+-	xDelete<int>(this->flocaldoflist);
+-	xDelete<int>(this->fglobaldoflist);
+-}
+-/*}}}*/
+-
+-/*ElementVector specific routines: */
+-/*FUNCTION ElementVector::AddToGlobal(Vector* pf){{{*/
+-void ElementVector::AddToGlobal(Vector* pf){
+-
+-	int i;
+-	IssmDouble* localvalues=NULL;
+-
+-	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+-	this->CheckConsistency();
+-
+-	if(this->fsize){
+-		/*first, retrieve values that are in the f-set from the g-set values vector: */
+-		localvalues=xNew<IssmDouble>(this->fsize);
+-		for(i=0;i<this->fsize;i++){
+-			localvalues[i]=this->values[this->flocaldoflist[i]];
+-		}
+-		/*add local values into global  vector, using the fglobaldoflist: */
+-		pf->SetValues(this->fsize,this->fglobaldoflist,localvalues,ADD_VAL);
+-
+-		/*Free ressources:*/
+-		xDelete<IssmDouble>(localvalues);
+-	}
+-	
+-}
+-/*}}}*/
+-/*FUNCTION ElementVector::InsertIntoGlobal(Vector* pf){{{*/
+-void ElementVector::InsertIntoGlobal(Vector* pf){
+-
+-	int i;
+-	IssmDouble* localvalues=NULL;
+-
+-	if(this->fsize){
+-		/*first, retrieve values that are in the f-set from the g-set values vector: */
+-		localvalues=xNew<IssmDouble>(this->fsize);
+-		for(i=0;i<this->fsize;i++){
+-			localvalues[i]=this->values[this->flocaldoflist[i]];
+-		}
+-		/*add local values into global  vector, using the fglobaldoflist: */
+-		pf->SetValues(this->fsize,this->fglobaldoflist,localvalues,INS_VAL);
+-
+-		/*Free ressources:*/
+-		xDelete<IssmDouble>(localvalues);
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION ElementVector::CheckConsistency{{{*/
+-void ElementVector::CheckConsistency(void){
+-	/*Check element matrix values, only in debugging mode*/
+-#ifdef _ISSM_DEBUG_ 
+-	for (int i=0;i<this->nrows;i++){
+-		if (xIsNan<IssmDouble>(this->values[i])) _error2_("NaN found in Element Vector");
+-		if (fabs( this->values[i])>1.e+50) _error2_("Element Vector values exceeds 1.e+50");
+-	}
+-#endif
+-}
+-/*}}}*/
+-/*FUNCTION ElementVector::Echo{{{*/
+-void ElementVector::Echo(void){
+-
+-	int i,j;
+-	_printLine_("Element Vector echo:");
+-	_printLine_("   nrows: " << nrows);
+-	_printLine_("   values:");
+-	for(i=0;i<nrows;i++){
+-		_printLine_(setw(4) << right << i << ": " << setw(10) << values[i]);
+-	}
+-
+-	_printString_("   gglobaldoflist (" << gglobaldoflist << "): ");
+-	if(gglobaldoflist) for(i=0;i<nrows;i++) _printString_(" " << gglobaldoflist[i] );
+-	_printLine_(" ");
+-
+-	_printLine_("   fsize: " << fsize);
+-	_printString_("   flocaldoflist  (" << flocaldoflist << "): ");
+-	if(flocaldoflist) for(i=0;i<fsize;i++) _printString_(" " << flocaldoflist[i] );
+-	_printLine_(" ");
+-	_printString_("   fglobaldoflist (" << fglobaldoflist << "): ");
+-	if(fglobaldoflist) for(i=0;i<fsize;i++) _printString_(" " << fglobaldoflist[i] );
+-	_printLine_(" ");
+-}
+-/*}}}*/
+-/*FUNCTION ElementVector::Init{{{*/
+-void ElementVector::Init(ElementVector* pe){
+-
+-	_assert_(pe);
+-
+-	this->nrows =pe->nrows;
+-
+-	this->values=xNew<IssmDouble>(this->nrows);
+-	xMemCpy<IssmDouble>(this->values,pe->values,this->nrows);
+-
+-	this->gglobaldoflist=xNew<int>(this->nrows);
+-	xMemCpy<int>(this->gglobaldoflist,pe->gglobaldoflist,this->nrows);
+-
+-	this->fsize=pe->fsize;
+-	if(this->fsize){
+-		this->flocaldoflist=xNew<int>(this->fsize);
+-		xMemCpy<int>(this->flocaldoflist,pe->flocaldoflist,this->fsize);
+-		this->fglobaldoflist=xNew<int>(this->fsize);
+-		xMemCpy<int>(this->fglobaldoflist,pe->fglobaldoflist,this->fsize);
+-	}
+-	else{
+-		this->flocaldoflist=NULL;
+-		this->fglobaldoflist=NULL;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION ElementVector::SetValue{{{*/
+-void ElementVector::SetValue(IssmDouble scalar){
+-
+-	int i;
+-
+-	for(i=0;i<this->nrows;i++)this->values[i]=scalar;
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 12821)
+@@ -0,0 +1,210 @@
++/*!\file DofIndexing.c
++ * \brief: implementation of the DofIndexing object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include "./objects.h"
++#include <string.h>
++#include "../EnumDefinitions/EnumDefinitions.h"
++#include "../shared/shared.h"
++#include "../Container/Container.h"
++#include "../include/include.h"
++
++/*DofIndexing constructors and destructor*/
++/*FUNCTION DofIndexing::DofIndexing(){{{*/
++DofIndexing::DofIndexing(){
++
++	this->gsize=UNDEF;
++	this->fsize=UNDEF;
++	this->ssize=UNDEF;
++	this->clone=0;
++	this->f_set=NULL;
++	this->s_set=NULL;
++	this->svalues=NULL;
++	this->doftype=NULL;
++	this->gdoflist=NULL;
++	this->fdoflist=NULL;
++	this->sdoflist=NULL;
++
++}
++/*}}}*/
++/*FUNCTION DofIndexing::DofIndexing(int gsize){{{*/
++DofIndexing::DofIndexing(int in_gsize){
++	this->Init(in_gsize,NULL);
++}
++/*}}}*/
++/*FUNCTION DofIndexing::DofIndexing(DofIndexing* in)  -> copy{{{*/
++DofIndexing::DofIndexing(DofIndexing* in){ //copy constructor
++
++	int i;
++	this->gsize=in->gsize;
++	this->fsize=in->fsize;
++	this->ssize=in->ssize;
++	
++	this->clone=in->clone;
++
++	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); 
++		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->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->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 && 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));
++
++}
++/*}}}*/
++/*FUNCTION DofIndexing::~DofIndexing() {{{*/
++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);
++
++}
++/*}}}*/
++/*FUNCTION DofIndexing::Init{{{*/
++void DofIndexing::Init(int in_gsize,int* in_doftype){
++
++	int i;
++	this->gsize=in_gsize;
++	
++	this->clone=0;
++
++	/*allocate: */
++	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);
++		this->gdoflist=xNew<int>(this->gsize);
++	}
++
++	for (i=0;i<this->gsize;i++){
++		/*assume dof is free, no constraints, no rigid body constraint: */
++		this->f_set[i]=true;
++		this->s_set[i]=false;
++		if(this->doftype)this->doftype[i]=in_doftype[i];
++		this->svalues[i]=0; //0 constraint is the default value
++		this->gdoflist[i]=UNDEF;
++	}
++}
++/*}}}*/
++/*FUNCTION DofIndexing::InitSet{{{*/
++void DofIndexing::InitSet(int setenum){
++
++	int i;
++	int size=0;
++
++	/*go through sets, and figure out how many dofs belong to this set, except for g-set, 
++	 * which has already been initialized: */
++	if(setenum==FsetEnum){
++		size=0;
++		for(i=0;i<this->gsize;i++) if(f_set[i])size++;
++		this->fsize=size;
++		xDelete<int>(this->fdoflist);
++		if(this->fsize)this->fdoflist=xNew<int>(size);
++		else this->fdoflist=NULL;
++	}
++	else if(setenum==SsetEnum){
++		size=0;
++		for(i=0;i<this->gsize;i++) if(s_set[i])size++;
++		this->ssize=size;
++		xDelete<int>(this->sdoflist);
++		if(this->ssize)this->sdoflist=xNew<int>(size);
++		else this->sdoflist=NULL;
++	}
++	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++}
++/*}}}*/
++
++/*Some of the Object functionality: */
++/*FUNCTION DofIndexing::Echo{{{*/
++void DofIndexing::Echo(void){
++
++	int i;
++
++	_printLine_("DofIndexing:");
++	_printLine_("   gsize: " << gsize);
++	_printLine_("   clone: " << clone);
++}
++/*}}}*/
++/*FUNCTION DofIndexing::DeepEcho{{{*/
++void DofIndexing::DeepEcho(void){
++
++	int i;
++
++	_printLine_("DofIndexing:");
++	_printLine_("   gsize: " << gsize);
++	_printLine_("   fsize: " << fsize);
++	_printLine_("   ssize: " << ssize);
++	_printLine_("   clone: " << clone);
++	
++	_printLine_("   set membership: f,s sets ");
++	for(i=0;i<gsize;i++){
++		_printLine_("      dof " << i << ": " <<(f_set[i]?"true":"false")<< " " <<(s_set[i]?"true":"false"));
++	}
++
++	_printString_("   svalues (" << this->ssize << "): |");
++	for(i=0;i<this->gsize;i++){
++		if(this->s_set[i])_printString_(" " << svalues[i] << " |");
++	}
++	_printLine_("");
++
++	if(doftype){
++		_printString_("   doftype: |");
++		for(i=0;i<gsize;i++){
++			_printString_(" " << doftype[i] << " |");
++		}
++		_printLine_("");
++	}
++	else _printLine_("   doftype: NULL");
++
++	_printString_("   g_doflist (" << this->gsize << "): |");
++	for(i=0;i<this->gsize;i++){
++		_printString_(" " << gdoflist[i] << " |");
++	}
++	_printLine_("");
++
++	_printString_("   f_doflist (" << this->fsize << "): |");
++	for(i=0;i<this->fsize;i++){
++		_printString_(" " << fdoflist[i] << " |");
++	}
++	_printLine_("");
++
++	_printString_("   s_doflist (" << this->ssize << "): |");
++	for(i=0;i<this->ssize;i++){
++		_printString_(" " << sdoflist[i] << " |");
++	}
++	_printLine_("");
++}		
++/*}}}*/
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects.h	(revision 12821)
+@@ -0,0 +1,185 @@
++/* \file objects.h
++ * \brief: prototype header for all objects.
++ */
++
++#ifndef ALL_OBJECTS_H_
++#define ALL_OBJECTS_H_
++
++/*Abstract classes: */
++#include "./Object.h"
++
++/*Objects: */
++#include "./Hook.h"
++#include "./DofIndexing.h"
++#include "./Vertex.h"
++#include "./Node.h"
++#include "./Segment.h"
++#include "./IoModel.h"
++#include "./Patch.h"
++#include "./Update.h"
++
++/*Constraints: */
++#include "./Constraints/Constraint.h"
++#include "./Constraints/SpcStatic.h"
++#include "./Constraints/SpcTransient.h"
++#include "./Constraints/SpcDynamic.h"
++
++/*Gauss*/
++#include "./Gauss/GaussTria.h"
++#include "./Gauss/GaussPenta.h"
++
++/*Loads: */
++#include "./Loads/Load.h"
++#include "./Loads/Friction.h"
++#include "./Loads/Icefront.h"
++#include "./Loads/Numericalflux.h"
++#include "./Loads/Riftfront.h"
++#include "./Loads/Penpair.h"
++#include "./Loads/Pengrid.h"
++
++/*Elements: */
++#include "./Elements/Element.h"
++#include "./Elements/Penta.h"
++#include "./Elements/PentaHook.h"
++#include "./Elements/PentaRef.h"
++#include "./Elements/Tria.h"
++#include "./Elements/TriaHook.h"
++#include "./Elements/TriaRef.h"
++
++/*KML parsing objects: */
++#include "./KML/KML_Attribute.h"
++#include "./KML/KML_Comment.h"
++#include "./KML/KML_ColorStyle.h"
++#include "./KML/KML_Container.h"
++#include "./KML/KML_Document.h"
++#include "./KML/KML_Feature.h"
++#include "./KML/KML_File.h"
++#include "./KML/KML_Folder.h"
++#include "./KML/KML_Geometry.h"
++#include "./KML/KML_GroundOverlay.h"
++#include "./KML/KML_Icon.h"
++#include "./KML/KML_LatLonBox.h"
++#include "./KML/KML_LinearRing.h"
++#include "./KML/KML_LineString.h"
++#include "./KML/KML_LineStyle.h"
++#include "./KML/KML_MultiGeometry.h"
++#include "./KML/KML_Object.h"
++#include "./KML/KML_Overlay.h"
++#include "./KML/KML_Point.h"
++#include "./KML/KML_Placemark.h"
++#include "./KML/KML_Polygon.h"
++#include "./KML/KML_PolyStyle.h"
++#include "./KML/KML_Style.h"
++#include "./KML/KML_StyleSelector.h"
++#include "./KML/KML_SubStyle.h"
++#include "./KML/KML_Unknown.h"
++#include "./KML/KMLFileReadUtils.h"
++
++/*Option parsing objects: */
++#include "./Options/Option.h"
++#include "./Options/OptionDouble.h"
++#include "./Options/OptionLogical.h"
++#include "./Options/OptionChar.h"
++#include "./Options/OptionStruct.h"
++#include "./Options/OptionCell.h"
++#include "./Options/OptionUtilities.h"
++
++/*Inputs: */
++#include "./Inputs/Input.h"
++#include "./Inputs/BoolInput.h"
++#include "./Inputs/DoubleInput.h"
++#include "./Inputs/IntInput.h"
++#include "./Inputs/PentaP1Input.h"
++#include "./Inputs/TriaP1Input.h"
++#include "./Inputs/ControlInput.h"
++#include "./Inputs/DatasetInput.h"
++#include "./Inputs/TransientInput.h"
++
++/*ElementResults: */
++#include "./ElementResults/ElementResult.h"
++#include "./ElementResults/DoubleElementResult.h"
++#include "./ElementResults/TriaP1ElementResult.h"
++#include "./ElementResults/PentaP1ElementResult.h" 
++#include "./ElementResults/BoolElementResult.h"
++
++/*ExternalResults: */
++#include "./ExternalResults/ExternalResult.h"
++#include "./ExternalResults/BoolExternalResult.h"
++#include "./ExternalResults/DoubleExternalResult.h"
++#include "./ExternalResults/DoubleVecExternalResult.h"
++#include "./ExternalResults/DoubleMatExternalResult.h"
++#include "./ExternalResults/IntExternalResult.h"
++#include "./ExternalResults/PetscVecExternalResult.h"
++#include "./ExternalResults/StringExternalResult.h"
++
++/*Materials: */
++#include "./Materials/Material.h"
++#include "./Materials/Matice.h"
++#include "./Materials/Matpar.h"
++
++/*Numerics:*/
++#include "./Numerics/ElementMatrix.h"
++#include "./Numerics/ElementVector.h"
++#include "./Numerics/Vector.h"
++#include "./Numerics/Matrix.h"
++
++/*Params: */
++#include "./Params/BoolParam.h"
++#include "./Params/DoubleMatParam.h"
++#include "./Params/DoubleTransientMatParam.h"
++#include "./Params/DoubleMatArrayParam.h"
++#include "./Params/DoubleParam.h"
++#include "./Params/DoubleVecParam.h"
++#include "./Params/IntParam.h"
++#include "./Params/IntVecParam.h"
++#include "./Params/IntMatParam.h"
++#include "./Params/FileParam.h"
++#include "./Params/Param.h"
++#include "./Params/MatrixParam.h"
++#include "./Params/VectorParam.h"
++#include "./Params/StringArrayParam.h"
++#include "./Params/StringParam.h"
++#include "./Params/TransientParam.h"
++
++/*C objects: */
++#include "./Contour.h"
++#include "./FemModel.h"
++#include "./OptArgs.h"
++#include "./OptPars.h"
++
++/*Bamg: */
++#include "./Bamg/BamgOpts.h"
++#include "./Bamg/BamgGeom.h"
++#include "./Bamg/BamgMesh.h"
++#include "./Bamg/Metric.h"
++#include "./Bamg/DoubleAndInt.h"
++#include "./Bamg/Direction.h"
++#include "./Bamg/BamgVertex.h"
++#include "./Bamg/AdjacentTriangle.h"
++#include "./Bamg/Edge.h"
++#include "./Bamg/GeomVertex.h"
++#include "./Bamg/GeomEdge.h"
++#include "./Bamg/Curve.h"
++#include "./Bamg/Triangle.h"
++#include "./Bamg/ListofIntersectionTriangles.h"
++#include "./Bamg/GeomSubDomain.h"
++#include "./Bamg/SubDomain.h"
++#include "./Bamg/VertexOnGeom.h"
++#include "./Bamg/VertexOnVertex.h"
++#include "./Bamg/VertexOnEdge.h"
++#include "./Bamg/CrackedEdge.h"
++#include "./Bamg/Mesh.h"
++#include "./Bamg/Geometry.h"
++#include "./Bamg/BamgQuadtree.h"
++#include "./Bamg/SetOfE4.h"
++
++/*Kriging*/
++#include "./Kriging/Variogram.h"
++#include "./Kriging/GaussianVariogram.h"
++#include "./Kriging/ExponentialVariogram.h"
++#include "./Kriging/SphericalVariogram.h"
++#include "./Kriging/PowerVariogram.h"
++#include "./Kriging/Quadtree.h"
++#include "./Kriging/Observation.h"
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Patch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Patch.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Patch.cpp	(revision 12821)
+@@ -0,0 +1,175 @@
++/*!\file Patch.c
++ * \brief: implementation of the Patch object
++ */
++
++/*Include files: {{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include <math.h>
++#include "./objects.h"
++#include "../Container/Container.h"
++#include "../io/io.h"
++#include "../EnumDefinitions/EnumDefinitions.h"
++#include "../shared/shared.h"
++#include "../include/include.h"
++/*}}}*/
++
++/*Object constructors and destructors:*/
++/*FUNCTION Patch::Patch() default constructor {{{*/
++Patch::Patch(){
++	this->numrows=0;
++	this->numcols=0;
++	this->maxvertices=0;
++	this->maxnodes=0;
++	this->values=NULL;
++}
++/*}}}*/
++/*FUNCTION Patch::Patch(int numrows, int maxvertices, int maxnodes){{{*/
++Patch::Patch(int in_numrows, int in_maxvertices, int in_maxnodes){
++
++	int i,j;
++	this->numrows=in_numrows;
++	this->maxvertices=in_maxvertices;
++	this->maxnodes=in_maxnodes;
++    
++	this->numcols=1  //enum_type
++		+1           //step
++		+1           //time 
++		+1           //element id
++		+1           //interpolation type
++		+maxvertices //vertices
++		+maxnodes;   //nodes
++
++	//Allocate values and fill with NaN:
++	if (this->numcols*this->numrows==0){
++		this->values=NULL;
++	}
++	else{
++	        this->values=xNew<IssmDouble>(this->numcols*this->numrows);
++		for(i=0;i<this->numrows;i++){
++			for(j=0;j<this->numcols;j++){
++				this->values[i*this->numcols+j]=NAN;
++			}
++		}
++	}
++
++}
++/*}}}*/
++/*FUNCTION Patch::~Patch(){{{*/
++Patch::~Patch(){
++	xDelete<IssmDouble>(values);
++}
++/*}}}*/
++
++/*Object methods*/
++/*FUNCTION Patch::fillelementinfo{{{*/
++void Patch::fillelementinfo(int count, int element_id, int* vertices_ids, int num_vertices){
++
++	int i;
++	IssmDouble* row=NULL;
++
++	/*point to the start of the row: */
++	row=this->values+count*this->numcols;
++
++	/*Let's remember what is on a row: 
++	 enum_type step time element_id interpolation vertices_ids nodal_values
++	 */
++	row[3]=element_id;
++	for(i=0;i<num_vertices;i++){
++		row[5+i]=vertices_ids[i];
++	}
++
++}
++/*}}}*/
++/*FUNCTION Patch::fillresultinfo{{{*/
++void Patch::fillresultinfo(int count,int enum_type,int step, IssmDouble time, int interpolation, IssmDouble* nodal_values, int num_nodes){
++
++	int i;
++	IssmDouble* row=NULL;
++
++	/*point to the start of the row: */
++	row=this->values+count*this->numcols;
++
++	/*Let's remember what is on a row: 
++	 enum_type step time element_id interpolation vertices_ids nodal_values
++	 */
++	row[0]=enum_type;
++	row[1]=(IssmDouble)step;
++	row[2]=time;
++	row[4]=interpolation;
++	for(i=0;i<num_nodes;i++){
++		row[5+this->maxvertices+i]=nodal_values[i];
++	}
++
++}
++/*}}}*/
++/*FUNCTION Patch::Gather{{{*/
++void Patch::Gather(void){
++
++	int         i;
++	int         count;
++	extern int  my_rank;
++	extern int  num_procs;
++	int         total_numrows;
++	int         node_numrows;
++	IssmDouble     *total_values  = NULL;
++	#ifdef _HAVE_MPI_
++	MPI_Status  status;
++	#endif
++
++	/*First, figure out total number of rows combining all the cpus: */
++	#ifdef _HAVE_MPI_
++	MPI_Reduce(&this->numrows,&total_numrows,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
++	MPI_Bcast(&total_numrows,1,MPI_INT,0,MPI_COMM_WORLD);
++	#else
++	total_numrows=this->numrows;
++	#endif
++
++	/*return if patch empty*/
++	if(total_numrows==0) return;
++
++	/*Now, allocate buffer to holds all the values, on node 0: */
++	if(my_rank==0)total_values=xNew<IssmDouble>(this->numcols*total_numrows);
++
++	/*Start by copying node 0 values onto total_values: */
++	if(my_rank==0){
++		count=0;
++		xMemCpy<IssmDouble>(total_values+count,this->values,this->numcols*this->numrows);
++		count+=this->numrows*this->numcols;
++	}
++
++	/*Now, ask other nodes to send their values: */
++	#ifdef _HAVE_MPI_
++	for (i=1;i<num_procs;i++){
++		if (my_rank==i){ 
++			MPI_Send(&this->numrows,1,MPI_INT,0,1,MPI_COMM_WORLD);   
++			if (this->numrows)MPI_Send(this->values,this->numrows*this->numcols,MPI_DOUBLE,0,1,MPI_COMM_WORLD); 
++		}
++		if (my_rank==0){
++			MPI_Recv(&node_numrows,1,MPI_INT,i,1,MPI_COMM_WORLD,&status); 
++			if (node_numrows)MPI_Recv(total_values+count,node_numrows*this->numcols,MPI_DOUBLE,i,1,MPI_COMM_WORLD,&status);
++			count+=node_numrows*this->numcols;
++		}
++	}	
++	#endif
++
++	/*Now, node 0 has total_values, of size total_numrows*this->numcols. Update the fields in the patch, to reflect this new 
++	 * reality. For other cpus, no point in keeping their data anymore: */
++	if(my_rank==0){
++		this->numrows=total_numrows;
++		xDelete<IssmDouble>(this->values);
++		this->values=total_values;
++	}
++	#ifdef _HAVE_MPI_
++	else{
++		this->numrows=0;
++		xDelete<IssmDouble>(this->values);
++	}
++	#endif
++}/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp	(revision 12821)
+@@ -0,0 +1,266 @@
++/*!\file Hook.cpp
++ * \brief: implementation of the Hook object: see Hook.h for more explanations.
++ */
++
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "./objects.h"
++#include "../Container/Container.h"
++#include "../EnumDefinitions/EnumDefinitions.h"
++#include "../shared/shared.h"
++#include "../include/include.h"
++
++
++/*Constructor/Destructors*/
++/*FUNCTION Hook::Hook(){{{*/
++Hook::Hook(){
++	this->num=0;
++	this->objects=NULL;
++	this->ids=NULL;
++	this->offsets=NULL;
++	return;
++}
++/*}}}*/
++/*FUNCTION Hook::Hook(int* ids, int num){{{*/
++Hook::Hook(int* in_ids, int in_num){
++
++	/*Intermediaries*/
++	int i;
++
++	/*Get number of objects to hook*/
++	this->num=in_num;
++
++	/*Get out if num=0*/
++	if (num==0){
++		/*Empty hook*/
++		this->ids=NULL;
++		this->objects=NULL;
++		this->offsets=NULL;
++	}
++	else{
++		/*Allocate: */
++		this->objects=xNew<Object*>(this->num);
++		this->ids=xNew<int>(this->num);
++		this->offsets=xNew<int>(this->num);
++
++		/*Copy ids: */
++		for (i=0;i<this->num;i++){
++			this->ids[i]=in_ids[i];
++			this->objects[i]=NULL;
++			this->offsets[i]=0;
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION Hook::~Hook(){{{*/
++Hook::~Hook(){
++	/*deallocate: */
++	xDelete<Object*>(this->objects);
++	xDelete<int>(this->ids);
++	xDelete<int>(this->offsets);
++	return;
++}
++/*}}}*/
++
++/*Some of the Object functionality: */
++/*FUNCTION Hook::Echo{{{*/
++void Hook::Echo(void){
++
++	int i;
++	if (num){
++		_printLine_("   Hook: ");
++		_printLine_("      num=" << this->num);
++		_printString_("      ids: ");
++		for (i=0;i<this->num;i++) _printString_(this->ids[i] << " ");
++		_printLine_("");
++		_printString_("      offsets: ");
++		for (i=0;i<this->num;i++) _printString_(this->offsets[i] << " ");
++		_printLine_("");
++	}
++	else{
++		_printLine_("   Hook: num=0 ");
++	}
++}
++/*}}}*/
++/*FUNCTION Hook::DeepEcho{{{*/
++void Hook::DeepEcho(void){
++
++	int i;
++	if (num){
++		_printLine_("   Hook: ");
++		_printLine_("      num=" << this->num);
++		_printString_("      ids: ");
++		for (i=0;i<this->num;i++) _printString_(this->ids[i] << " ");
++		_printLine_("");
++		_printString_("      offsets: ");
++		for (i=0;i<this->num;i++) _printString_(this->offsets[i] << " ");
++		_printLine_("");
++		if (!objects) _printLine_("      warning: object not hooked yet");
++		else{
++			_printString_("      objects:\n   ");
++			for (i=0;i<this->num;i++){
++				_printLine_("         object " << i);
++				if(objects[i]) objects[i]->DeepEcho();
++				else           _printLine_("            no object hooked yet (not configured)");
++			}
++		}
++	}
++	else{
++		_printLine_("   Hook: num=0 ");
++	}
++}
++/*}}}*/
++/*FUNCTION Hook::copy {{{*/
++Object* Hook::copy(void){
++
++	int i;
++
++	/*output: */
++	Hook* output=NULL;
++
++	/*initalize output: */
++	output=new Hook();
++
++	/*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(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;
++}
++/*}}}*/
++
++/*Hook management: */
++/*FUNCTION Hook::configure{{{*/
++void Hook::configure(DataSet* dataset){
++
++	/*intermediary: */
++	Object* object=NULL;
++	int i;
++
++	/*Checks if debugging mode*/
++	_assert_(this->num==0 || this->ids!=NULL);
++
++	for(i=0;i<this->num;i++){
++
++		/*is this object id -1? If so, drop this search, it was not requested: */
++		if (this->ids[i]==-1) continue;
++
++		/*Check whether existing this->objects are correct: */
++		if(this->objects[i]){
++			if(this->objects[i]->Id()==this->ids[i]) continue; //this node is good.
++			else this->objects[i]=NULL; //this node was incorrect, reset it.
++		}
++
++		/*May be the object this->offsets into this->objects are valid?: */
++		if(this->offsets[i]!=UNDEF){
++			/* Look at the this->offsets[i]'th node in the nodes dataset. If it has the correct id, 
++			 * we are good: */
++			object=(Object*)dataset->GetObjectByOffset(this->offsets[i]);
++			if (object->Id()==this->ids[i]){
++				this->objects[i]=object;
++				continue;
++			}
++			else this->offsets[i]=UNDEF; //object offset was wrong, reset it.
++		}
++
++		/*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){
++			this->objects[i]=(Object*)dataset->GetObjectById(this->offsets+i,this->ids[i]); //remember the offset for later on.
++			/*check the id is correct!: */
++			if (this->objects[i]->Id()!=this->ids[i]) _error2_("wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << "  in resolved pointer!");
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION Hook::delivers{{{*/
++Object* Hook::delivers(void){
++	
++	/*first, check that we only have one T object in our object list: */
++	if (this->num!=1) _error2_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");
++
++	/*check NULL: */
++	if (this->objects==NULL) _error2_("hook is not pointing to any object, objects pointer is NULL");
++
++	return *objects;
++}
++
++/*}}}*/
++/*FUNCTION Hook::deliverp{{{*/
++Object** Hook::deliverp(void){
++	return objects;
++}
++/*}}}*/
++/*FUNCTION Hook::Ids{{{*/
++int* Hook::Ids(void){
++	return this->ids;
++}
++/*}}}*/
++/*FUNCTION Hook::GetNum{{{*/
++int Hook::GetNum(void){
++	return this->num;
++}
++/*}}}*/
++/*FUNCTION Hook::GetObjects{{{*/
++Object** Hook::GetObjects(void){
++	return this->objects;
++}
++/*}}}*/
++/*FUNCTION Hook::GetOffsets{{{*/
++int* Hook::GetOffsets(void){
++	return this->offsets;
++}
++/*}}}*/
++/*FUNCTION Hook::Spawn{{{*/
++Hook* Hook::Spawn(int* indices, int numindices){
++
++	int i;
++
++	/*output: */
++	Hook* output=NULL;
++
++	/*allocate: */
++	output=new Hook();
++
++	/*If this Hook is empty, simply return*/
++	if(this->num==0){
++		output->num=0;
++		return output;
++	}
++
++	/*Else, check that we are requesting a half of num*/
++	if (numindices>this->num) _error2_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects");
++
++	/*go pickup the correct objects, ids and offsets :*/
++	output->num=numindices;
++	if(output->num<1) _error2_("Trying to spawn an empty ElementProperties!");
++
++	output->objects=xNew<Object*>(output->num);
++	output->ids=xNew<int>(output->num);
++	output->offsets=xNew<int>(output->num);
++
++	for(i=0;i<output->num;i++){
++		output->objects[i]=this->objects[indices[i]];
++		output->ids[i]=this->ids[indices[i]];
++		output->offsets[i]=this->offsets[indices[i]];
++	}
++
++	return output;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.cpp	(revision 12821)
+@@ -0,0 +1,118 @@
++/*!\file:  DakotaPlugin.cpp (see DakotaPlugin.h for explanations)
++ * \brief  header file for derived DirectApplicInterface class. 
++ * \sa SpwanCore.cpp and \sa qmu.cpp
++ *
++ * This class needs to be understood simultaneously with qmu.cpp and SpwanCore.cpp. 
++ * This call is derived from the Dakota DirectApplicInterface class. This is the 
++ * only way to plug ISSM's own routines into the Dakota engine. The derived class 
++ * has one function called derived_map_ac, which is called by Dakota to drive the 
++ * entire snesitivity analysis. 
++ *
++ * We use this routine (which gets variables, variable_descriptors from the Dakota 
++ * engine, and requests responses from the ISSM solution sequences), to call our 
++ * own solutoin cores. This routines calls the SpawnCore routine, which will drive 
++ * the entire computations. 
++ */ 
++
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++/*Standard ISSM includes: */
++#include "../shared/shared.h"
++#include "../include/include.h"
++#include "../objects/objects.h"
++#include "../modules/Dakotax/Dakotax.h"
++
++/*Standard includes: */
++#include <string>
++
++#ifdef _HAVE_DAKOTA_ //only works if dakota library has been compiled in.
++
++//Dakota headers
++#include "DakotaResponse.H"
++#include "ParamResponsePair.H"
++#include "DakotaPlugin.h"
++#include "system_defs.h"
++#include "ProblemDescDB.H"
++#include "ParallelLibrary.H"
++
++namespace SIM {
++
++//constructor
++DakotaPlugin::DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* in_femmodel):Dakota::DirectApplicInterface(problem_db){
++
++
++	femmodel=in_femmodel;
++	counter=0;
++}
++
++//destructor
++DakotaPlugin::~DakotaPlugin(){ /* Virtual destructor handles referenceCount at Interface level. */ }
++
++int DakotaPlugin::derived_map_ac(const Dakota::String& driver) {
++
++	int i;
++	IssmDouble* variables=NULL;
++	char** variable_descriptors=NULL;
++	char*  variable_descriptor=NULL;
++	IssmDouble* responses=NULL;
++
++	/*increae counter: */
++	counter++;
++
++	/*Before launching analysis, we need to transfer the dakota inputs into Issm 
++	 *readable variables: */
++
++	/*First, the variables: */
++	variables=xNew<IssmDouble>(numACV);
++	for(i=0;i<numACV;i++){
++		variables[i]=xC[i];
++	}
++	/*The descriptors: */
++	variable_descriptors=xNew<char*>(numACV);
++	for(i=0;i<numACV;i++){
++		string label=xCLabels[i];
++		variable_descriptor=xNew<char>(strlen(label.c_str())+1);
++		memcpy(variable_descriptor,label.c_str(),(strlen(label.c_str())+1)*sizeof(char));
++
++		
++		variable_descriptors[i]=variable_descriptor;
++	}
++
++	/*Initialize responses: */
++	responses=xNewZeroInit<IssmDouble>(numFns);
++
++	/*run core solution: */
++	SpawnCore(responses,numFns, variables,variable_descriptors,numACV,femmodel,counter);
++
++	/*populate responses: */
++	for(i=0;i<numFns;i++){
++		fnVals[i]=responses[i];
++	}
++
++
++	/*Free ressources:*/
++	xDelete<IssmDouble>(variables);
++	for(i=0;i<numACV;i++){
++		variable_descriptor=variable_descriptors[i];
++		xDelete<char>(variable_descriptor);
++	}
++	xDelete<char*>(variable_descriptors);
++	xDelete<IssmDouble>(responses);
++
++	return 0;
++}
++  
++
++int DakotaPlugin::GetCounter(){
++	return counter;
++}
++
++} // namespace SIM
++
++
++#endif //only works if dakota library has been compiled in.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.h	(revision 12821)
+@@ -0,0 +1,55 @@
++/*!\file:  DakotaPlugin.h:
++ */ 
++
++#ifndef _DAKOTAPLUGIN_H
++#define _DAKOTAPLUGIN_H
++
++
++#ifdef _HAVE_DAKOTA_ //only works if dakota library has been compiled in.
++
++/*Headers:*/
++/*{{{*/
++
++
++#include "DirectApplicInterface.H"
++#include "../toolkits/toolkits.h"
++#include "../objects/objects.h"
++
++/*}}}*/
++
++namespace SIM {
++
++class DakotaPlugin: public Dakota::DirectApplicInterface
++{
++public:
++
++	DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* model);
++	~DakotaPlugin();
++
++	/*these fields are used by core solutions: */
++	void* femmodel;
++
++	int counter;
++
++protected:
++
++  // execute the input filter portion of a direct evaluation invocation
++  //int derived_map_if(const Dakota::String& if_name);
++  /// execute an analysis code portion of a direct evaluation invocation
++  int derived_map_ac(const Dakota::String& ac_name);
++  // execute the output filter portion of a direct evaluation invocation
++  //int derived_map_of(const Dakota::String& of_name);
++
++  /*add for issm: */
++  int GetCounter();
++
++private:
++
++};
++
++} // namespace SIM
++
++#endif //only works if dakota library has been compiled in.
++
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.h	(revision 12821)
+@@ -0,0 +1,54 @@
++/*!\file: DofIndexing.h
++ * \brief prototype for DofIndexing.h
++ */ 
++
++#ifndef _DOFINDEXING_H_
++#define  _DOFINDEXING_H_
++
++#include "../include/include.h"
++
++class DofIndexing{
++	
++	public:
++
++		/*sizes: */
++		int gsize; //number of dofs for a node
++		int fsize; //number of dofs solver for
++		int ssize; //number of constrained dofs
++
++		/*partitioning: */
++		int     clone;   //this node is replicated from another one 
++
++		/*boundary conditions sets: */
++		bool*     f_set; //is dof on f-set (on which we solve)
++		bool*     s_set; //is dof on s-set (on which boundary conditions -dirichlet- are applied)
++		IssmDouble*   svalues; //list of constraint values. size g_size, for ease of use.
++
++		/*types of dofs: */
++		int*     doftype; //approximation type of the dofs (used only for coupling), size g_size
++		
++		/*list of degrees of freedom: */
++		int*     gdoflist; //dof list in g_set
++		int*     fdoflist; //dof list in f_set
++		int*     sdoflist; //dof list in s_set
++
++
++		/*DofIndexing constructors, destructors {{{*/
++		DofIndexing();
++		DofIndexing(int g_size);
++		void Init(int g_size,int* doftype);
++		void InitSet(int setenum);
++		DofIndexing(DofIndexing* properties);
++		~DofIndexing();
++		/*}}}*/
++		/*Object like functionality: {{{*/
++		void  Echo(void); 
++		void  DeepEcho(void); 
++		void  copy(DofIndexing* properties);
++		/*}}}*/
++		/*DofIndexing management: {{{*/
++		DofIndexing* Spawn(int* indices, int numindices);
++		/*}}}*/
++
++};
++#endif //ifndef _DOFINDEXING_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 12821)
+@@ -0,0 +1,496 @@
++/*!\file ElementMatrix.cpp
++ * \brief: implementation of the ElementMatrix object, used to plug values from element into global stiffness matrix
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*ElementMatrix constructors and destructor*/
++/*FUNCTION ElementMatrix::ElementMatrix(){{{*/
++ElementMatrix::ElementMatrix(){
++
++	this->nrows=0;
++	this->ncols=0;
++	this->values=NULL;
++	this->dofsymmetrical=false;
++
++	this->row_fsize=0;
++	this->row_flocaldoflist=NULL;
++	this->row_fglobaldoflist=NULL;
++	this->row_ssize=0;
++	this->row_slocaldoflist=NULL;
++	this->row_sglobaldoflist=NULL;
++
++	this->col_fsize=0;
++	this->col_flocaldoflist=NULL;
++	this->col_fglobaldoflist=NULL;
++	this->col_ssize=0;
++	this->col_slocaldoflist=NULL;
++	this->col_sglobaldoflist=NULL;
++
++}
++/*}}}*/
++/*FUNCTION ElementMatrix::ElementMatrix(ElementMatrix* Ke){{{*/
++ElementMatrix::ElementMatrix(ElementMatrix* Ke){
++
++	if(!Ke) _error2_("Input Element Matrix is a NULL pointer");
++	this->Init(Ke);
++	return;
++}
++/*}}}*/
++/*FUNCTION ElementMatrix::ElementMatrix(ElementMatrix* Ke1, ElementMatrix* Ke2){{{*/
++ElementMatrix::ElementMatrix(ElementMatrix* Ke1, ElementMatrix* Ke2){
++
++	/*intermediaries*/
++	int i,j,counter;
++	int gsize,fsize,ssize;
++	int* P=NULL;
++	bool found;
++
++	/*If one of the two matrix is NULL, we copy the other one*/
++	if(!Ke1 && !Ke2){
++		_error2_("Two input element matrices are NULL");
++	}
++	else if(!Ke1){
++		this->Init(Ke2);
++		return;
++	}
++	else if(!Ke2){
++		this->Init(Ke1);
++		return;
++	}
++
++	/*General Case: Ke1 and Ke2 are not empty*/
++	if(!Ke1->dofsymmetrical || !Ke2->dofsymmetrical) _error2_("merging 2 non dofsymmetrical matrices not implemented yet");
++
++	/*Initialize itransformation matrix Ke[P[i]] = Ke2[i]*/
++	P=xNew<int>(Ke2->nrows);
++
++	/*1: Get the new numbering of Ke2 and get size of the new matrix*/
++	gsize=Ke1->nrows;
++	for(i=0;i<Ke2->nrows;i++){
++		found=false;
++		for(j=0;j<Ke1->nrows;j++){
++			if(Ke2->gglobaldoflist[i]==Ke1->gglobaldoflist[j]){
++				found=true; P[i]=j; break;
++			}
++		}
++		if(!found){
++			P[i]=gsize; gsize++;
++		}
++	}
++
++	/*2: Initialize static fields*/
++	this->nrows=gsize;
++	this->ncols=gsize;
++	this->dofsymmetrical=true;
++
++	/*Gset and values*/
++	this->gglobaldoflist=xNew<int>(this->nrows);
++	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->ncols);
++	for(i=0;i<Ke1->nrows;i++){
++		for(j=0;j<Ke1->ncols;j++){
++			this->values[i*this->ncols+j] += Ke1->values[i*Ke1->ncols+j];
++		}
++		this->gglobaldoflist[i]=Ke1->gglobaldoflist[i];
++	}
++	for(i=0;i<Ke2->nrows;i++){
++		for(j=0;j<Ke2->ncols;j++){
++			this->values[P[i]*this->ncols+P[j]] += Ke2->values[i*Ke2->ncols+j];
++		}
++		this->gglobaldoflist[P[i]]=Ke2->gglobaldoflist[i];
++	}
++
++	/*Fset*/
++	fsize=Ke1->row_fsize;
++	for(i=0;i<Ke2->row_fsize;i++){
++		if(P[Ke2->row_flocaldoflist[i]] >= Ke1->nrows) fsize++;
++	}
++	this->row_fsize=fsize;
++	if(fsize){
++		this->row_flocaldoflist =xNew<int>(fsize);
++		this->row_fglobaldoflist=xNew<int>(fsize);
++		for(i=0;i<Ke1->row_fsize;i++){
++			this->row_flocaldoflist[i] =Ke1->row_flocaldoflist[i];
++			this->row_fglobaldoflist[i]=Ke1->row_fglobaldoflist[i];
++		}
++		counter=Ke1->row_fsize;
++		for(i=0;i<Ke2->row_fsize;i++){
++			if(P[Ke2->row_flocaldoflist[i]] >= Ke1->nrows){
++				this->row_flocaldoflist[counter] =P[Ke2->row_flocaldoflist[i]];
++				this->row_fglobaldoflist[counter]=Ke2->row_fglobaldoflist[i];
++				counter++;
++			}
++		}
++	}
++	else{
++		this->row_flocaldoflist=NULL;
++		this->row_fglobaldoflist=NULL;
++	}
++
++	/*Sset*/
++	ssize=Ke1->row_ssize;
++	for(i=0;i<Ke2->row_ssize;i++){
++		if(P[Ke2->row_slocaldoflist[i]] >= Ke1->nrows) ssize++;
++	}
++	this->row_ssize=ssize;
++	if(ssize){
++		this->row_slocaldoflist =xNew<int>(ssize);
++		this->row_sglobaldoflist=xNew<int>(ssize);
++		for(i=0;i<Ke1->row_ssize;i++){
++			this->row_slocaldoflist[i] =Ke1->row_slocaldoflist[i];
++			this->row_sglobaldoflist[i]=Ke1->row_sglobaldoflist[i];
++		}
++		counter=Ke1->row_ssize;
++		for(i=0;i<Ke2->row_ssize;i++){
++			if(P[Ke2->row_slocaldoflist[i]] >= Ke1->nrows){
++				this->row_slocaldoflist[counter] =P[Ke2->row_slocaldoflist[i]];
++				this->row_sglobaldoflist[counter]=Ke2->row_sglobaldoflist[i];
++				counter++;
++			}
++		}
++	}
++	else{
++		this->row_slocaldoflist=NULL;
++		this->row_sglobaldoflist=NULL;
++	}
++
++	/*don't do cols, we can pick them up from the rows: */
++	this->col_fsize=0;
++	this->col_flocaldoflist=NULL;
++	this->col_fglobaldoflist=NULL;
++	this->col_ssize=0;
++	this->col_slocaldoflist=NULL;
++	this->col_sglobaldoflist=NULL;
++
++	/*clean-up*/
++	xDelete<int>(P);
++}
++/*}}}*/
++/*FUNCTION 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);
++	ElementMatrix* Ke123=new ElementMatrix(Ke12,Ke3);
++
++	/*Initialize current object with this matrix*/
++	this->Init(Ke123);
++
++	/*clean-up*/
++	delete Ke12;
++	delete Ke123;
++}
++/*}}}*/
++/*FUNCTION 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;
++	this->nrows=GetNumberOfDofs(nodes,numnodes,GsetEnum,approximation);
++	this->ncols=this->nrows;
++
++	/*fill values with 0: */
++	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->ncols);
++
++	/*g list*/
++	this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
++
++	/*get dof lists for f and s set: */
++	this->row_fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
++	this->row_flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
++	this->row_fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
++	this->row_ssize=GetNumberOfDofs(nodes,numnodes,SsetEnum,approximation);
++	this->row_slocaldoflist =GetLocalDofList( nodes,numnodes,SsetEnum,approximation);
++	this->row_sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation);
++
++	/*Because this matrix is "dofsymmetrical" don't do cols, we can pick them up from the rows: */
++	this->col_fsize=0;
++	this->col_flocaldoflist=NULL;
++	this->col_fglobaldoflist=NULL;
++	this->col_ssize=0;
++	this->col_slocaldoflist=NULL;
++	this->col_sglobaldoflist=NULL;
++
++}
++/*}}}*/
++/*FUNCTION ElementMatrix::~ElementMatrix(){{{*/
++ElementMatrix::~ElementMatrix(){
++	
++	xDelete<IssmDouble>(this->values);
++	xDelete<int>(this->gglobaldoflist);
++	xDelete<int>(this->row_flocaldoflist);
++	xDelete<int>(this->row_fglobaldoflist);
++	xDelete<int>(this->row_slocaldoflist);
++	xDelete<int>(this->row_sglobaldoflist);
++	xDelete<int>(this->col_flocaldoflist);
++	xDelete<int>(this->col_fglobaldoflist);
++	xDelete<int>(this->col_slocaldoflist);
++	xDelete<int>(this->col_sglobaldoflist);
++}
++/*}}}*/
++
++/*ElementMatrix specific routines: */
++/*FUNCTION ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){{{*/
++void ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){
++
++	int i,j;
++	IssmDouble* localvalues=NULL;
++
++	/*If Kfs is not provided, call the other function*/
++	if(!Kfs){
++		this->AddToGlobal(Kff);
++		return;
++	}
++
++	/*In debugging mode, check consistency (no NaN, and values not too big)*/
++	this->CheckConsistency();
++
++	if(this->dofsymmetrical){
++		/*only use row dofs to add values into global matrices: */
++
++		if(this->row_fsize){
++			/*first, retrieve values that are in the f-set from the g-set values matrix: */
++			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
++			for(i=0;i<this->row_fsize;i++){
++				for(j=0;j<this->row_fsize;j++){
++					*(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);
++				}
++			}
++			/*add local values into global  matrix, using the fglobaldoflist: */
++			Kff->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
++
++			/*Free ressources:*/
++			xDelete<IssmDouble>(localvalues);
++		}
++
++
++		if((this->row_ssize!=0) && (this->row_fsize!=0)){
++			/*first, retrieve values that are in the f and s-set from the g-set values matrix: */
++			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_ssize);
++			for(i=0;i<this->row_fsize;i++){
++				for(j=0;j<this->row_ssize;j++){
++					*(localvalues+this->row_ssize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]);
++				}
++			}
++			/*add local values into global  matrix, using the fglobaldoflist: */
++			Kfs->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_ssize,this->row_sglobaldoflist,localvalues,ADD_VAL);
++
++			/*Free ressources:*/
++			xDelete<IssmDouble>(localvalues);
++		}
++	}
++	else{
++		_error2_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
++	}
++
++}
++/*}}}*/
++/*FUNCTION ElementMatrix::AddToGlobal(Matrix* Jff){{{*/
++void ElementMatrix::AddToGlobal(Matrix* Jff){
++
++	int i,j;
++	IssmDouble* localvalues=NULL;
++
++	/*Check that Jff is not NULL*/
++	_assert_(Jff); 
++
++	/*In debugging mode, check consistency (no NaN, and values not too big)*/
++	this->CheckConsistency();
++
++	if(this->dofsymmetrical){
++		/*only use row dofs to add values into global matrices: */
++
++		if(this->row_fsize){
++			/*first, retrieve values that are in the f-set from the g-set values matrix: */
++			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
++			for(i=0;i<this->row_fsize;i++){
++				for(j=0;j<this->row_fsize;j++){
++					*(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);
++				}
++			}
++			/*add local values into global  matrix, using the fglobaldoflist: */
++			Jff->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
++
++			/*Free ressources:*/
++			xDelete<IssmDouble>(localvalues);
++		}
++
++	}
++	else{
++		_error2_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
++	}
++
++}
++/*}}}*/
++/*FUNCTION ElementMatrix::CheckConsistency{{{*/
++void ElementMatrix::CheckConsistency(void){
++	/*Check element matrix values, only in debugging mode*/
++	#ifdef _ISSM_DEBUG_ 
++	for (int i=0;i<this->nrows;i++){
++		for(int j=0;j<this->ncols;j++){
++			if (xIsNan<IssmDouble>(this->values[i*this->ncols+j])) _error2_("NaN found in Element Matrix");
++			if (fabs(this->values[i*this->ncols+j])>1.e+50) _error2_("Element Matrix values exceeds 1.e+50");
++		}
++	}
++	#endif
++}
++/*}}}*/
++/*FUNCTION ElementMatrix::Transpose{{{*/
++void ElementMatrix::Transpose(void){
++
++	/*Intermediaries*/
++	ElementMatrix* Ke_copy=new ElementMatrix(this);
++
++	/*Update sizes*/
++	this->nrows=Ke_copy->ncols;
++	this->ncols=Ke_copy->nrows;
++
++	/*Transpose values*/
++	for (int i=0;i<this->nrows;i++) for(int j=0;j<this->ncols;j++) this->values[i*this->ncols+j]=Ke_copy->values[j*Ke_copy->ncols+i];
++
++	/*Transpose indices*/
++	if(!dofsymmetrical){
++		_error2_("not supported yet");
++	}
++
++	/*Clean up and return*/
++	delete Ke_copy;
++	return;
++}
++/*}}}*/
++/*FUNCTION ElementMatrix::Echo{{{*/
++void ElementMatrix::Echo(void){
++
++	int i,j;
++	_printLine_("Element Matrix echo:");
++	_printLine_("   nrows: " << nrows);
++	_printLine_("   ncols: " << nrows);
++	_printLine_("   dofsymmetrical: " << (dofsymmetrical?"true":"false"));
++
++	_printLine_("   values:");
++	for(i=0;i<nrows;i++){
++		_printString_(setw(4) << right << i << ": ");
++		for(j=0;j<ncols;j++) _printString_( " " << setw(11) << setprecision (5) << right << values[i*ncols+j]);
++		_printLine_("");
++	}
++
++	_printString_("   gglobaldoflist (" << gglobaldoflist << "): ");
++	if(gglobaldoflist) for(i=0;i<nrows;i++) _printString_(" " << gglobaldoflist[i]); _printLine_("");
++
++	_printLine_("   row_fsize: " << row_fsize);
++	_printString_("   row_flocaldoflist  (" << row_flocaldoflist << "): ");
++	if(row_flocaldoflist) for(i=0;i<row_fsize;i++) _printString_(" " << row_flocaldoflist[i]); _printLine_(" ");
++	_printString_("   row_fglobaldoflist  (" << row_fglobaldoflist << "): ");
++	if(row_fglobaldoflist) for(i=0;i<row_fsize;i++) _printString_(" " << row_fglobaldoflist[i]); _printLine_(" ");
++
++	_printLine_("   row_ssize: " << row_ssize);
++	_printString_("   row_slocaldoflist  (" << row_slocaldoflist << "): ");
++	if(row_slocaldoflist) for(i=0;i<row_ssize;i++) _printString_(" " << row_slocaldoflist[i]); _printLine_(" ");
++	_printString_("   row_sglobaldoflist  (" << row_sglobaldoflist << "): ");
++	if(row_sglobaldoflist) for(i=0;i<row_ssize;i++) _printString_(" " << row_sglobaldoflist[i]); _printLine_(" ");
++
++	if(!dofsymmetrical){
++		_printLine_("   col_fsize: " << col_fsize);
++		_printString_("   col_flocaldoflist  (" << col_flocaldoflist << "): ");
++		if(col_flocaldoflist) for(i=0;i<col_fsize;i++) _printString_(" " << col_flocaldoflist[i]); _printLine_(" ");
++		_printString_("   col_fglobaldoflist  (" << col_fglobaldoflist << "): ");
++		if(col_fglobaldoflist) for(i=0;i<col_fsize;i++) _printString_(" " << col_fglobaldoflist[i]); _printLine_(" ");
++
++		_printLine_("   col_ssize: " << col_ssize);
++		_printString_("   col_slocaldoflist  (" << col_slocaldoflist << "): ");
++		if(col_slocaldoflist) for(i=0;i<col_ssize;i++) _printString_(" " << col_slocaldoflist[i]); _printLine_(" ");
++		_printString_("   col_sglobaldoflist  (" << col_sglobaldoflist << "): ");
++		if(col_sglobaldoflist) for(i=0;i<col_ssize;i++) _printString_(" " << col_sglobaldoflist[i]); _printLine_(" ");
++	}
++}
++/*}}}*/
++/*FUNCTION ElementMatrix::Init{{{*/
++void ElementMatrix::Init(ElementMatrix* Ke){
++
++	_assert_(Ke);
++
++	this->nrows =Ke->nrows;
++	this->ncols =Ke->ncols;
++	this->dofsymmetrical=Ke->dofsymmetrical;
++
++	this->values=xNew<IssmDouble>(this->nrows*this->ncols);
++	xMemCpy<IssmDouble>(this->values,Ke->values,this->nrows*this->ncols);
++
++	this->gglobaldoflist=xNew<int>(this->nrows);
++	xMemCpy<int>(this->gglobaldoflist,Ke->gglobaldoflist,this->nrows);
++
++	this->row_fsize=Ke->row_fsize;
++	if(this->row_fsize){
++		this->row_flocaldoflist=xNew<int>(this->row_fsize);
++		xMemCpy<int>(this->row_flocaldoflist,Ke->row_flocaldoflist,this->row_fsize);
++		this->row_fglobaldoflist=xNew<int>(this->row_fsize);
++		xMemCpy<int>(this->row_fglobaldoflist,Ke->row_fglobaldoflist,this->row_fsize);
++	}
++	else{
++		this->row_flocaldoflist=NULL;
++		this->row_fglobaldoflist=NULL;
++	}
++
++	this->row_ssize=Ke->row_ssize;
++	if(this->row_ssize){
++		this->row_slocaldoflist=xNew<int>(this->row_ssize);
++		xMemCpy<int>(this->row_slocaldoflist,Ke->row_slocaldoflist,this->row_ssize);
++		this->row_sglobaldoflist=xNew<int>(this->row_ssize);
++		xMemCpy<int>(this->row_sglobaldoflist,Ke->row_sglobaldoflist,this->row_ssize);
++	}
++	else{
++		this->row_slocaldoflist=NULL;
++		this->row_sglobaldoflist=NULL;
++	}
++
++	this->col_fsize=Ke->col_fsize;
++	if(this->col_fsize){
++		this->col_flocaldoflist=xNew<int>(this->col_fsize);
++		xMemCpy<int>(this->col_flocaldoflist,Ke->col_flocaldoflist,this->col_fsize);
++		this->col_fglobaldoflist=xNew<int>(this->col_fsize);
++		xMemCpy<int>(this->col_fglobaldoflist,Ke->col_fglobaldoflist,this->col_fsize);
++	}
++	else{
++		this->col_flocaldoflist=NULL;
++		this->col_fglobaldoflist=NULL;
++	}
++
++	this->col_ssize=Ke->col_ssize;
++	if(this->col_ssize){
++		this->col_slocaldoflist=xNew<int>(this->col_ssize);
++		xMemCpy<int>(this->col_slocaldoflist,Ke->col_slocaldoflist,this->col_ssize);
++		this->col_sglobaldoflist=xNew<int>(this->col_ssize);
++		xMemCpy<int>(this->col_sglobaldoflist,Ke->col_sglobaldoflist,this->col_ssize);
++	}
++	else{
++		this->col_slocaldoflist=NULL;
++		this->col_sglobaldoflist=NULL;
++	}
++}
++/*}}}*/
++/*FUNCTION ElementMatrix::SetDiag{{{*/
++void ElementMatrix::SetDiag(IssmDouble scalar){
++
++	int i;
++
++	if(this->nrows!=this->ncols)_error2_("need square matrix in input!");
++
++	for(i=0;i<this->nrows;i++){
++		this->values[this->ncols*i+i]=scalar;
++	}
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 12821)
+@@ -0,0 +1,51 @@
++/*!\file:  ElementVector.h
++ * \brief container for information needed to plug element vector generated by elements 
++ * into the pf global load vector. 
++ * This object will hold the element vector on the g-set, the local as well as global 
++ * dof lists in the f set
++ */ 
++
++#ifndef _ELEMENT_VECTOR_H_
++#define _ELEMENT_VECTOR_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Object.h"
++#include "../../toolkits/toolkits.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++class Node;
++/*}}}*/
++
++class ElementVector{
++
++	public:
++	
++		int      nrows;
++		IssmDouble*  values;
++		
++		//gset
++		int*     gglobaldoflist;
++
++		//fset
++		int      fsize;
++		int*     flocaldoflist;
++		int*     fglobaldoflist;
++		
++		/*ElementVector constructors, destructors {{{*/
++		ElementVector();
++		ElementVector(ElementVector* pe1,ElementVector* pe2);
++		ElementVector(ElementVector* pe1,ElementVector* pe2,ElementVector* pe3);
++		ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
++		~ElementVector();
++		/*}}}*/
++		/*ElementVector specific routines {{{*/
++		void AddToGlobal(Vector* pf);
++		void InsertIntoGlobal(Vector* pf);
++		void Echo(void);
++		void CheckConsistency(void);
++		void Init(ElementVector* pe);
++		void SetValue(IssmDouble scalar);
++		/*}}}*/
++};
++#endif //#ifndef _ELEMENT_VECTOR_H_
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 12821)
+@@ -0,0 +1,347 @@
++/*!\file Vector.cpp
++ * \brief: implementation of the Vector object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++#include "../../toolkits/toolkits.h"
++#include "./Vector.h"
++/*}}}*/
++
++/*Vector constructors and destructor*/
++/*FUNCTION Vector::Vector(){{{*/
++Vector::Vector(){
++
++	#ifdef _HAVE_PETSC_
++	this->vector=NULL;
++	#else
++	this->vector=NULL;
++	#endif
++	#ifdef _HAVE_ADOLC_
++	this->avector=NULL;
++	#endif
++}
++/*}}}*/
++/*FUNCTION Vector::Vector(int M,bool fromlocalsize){{{*/
++Vector::Vector(int pM,bool fromlocalsize){
++
++	#ifdef _HAVE_PETSC_
++	this->vector=NewVec(pM,fromlocalsize);
++	#else
++	this->vector=new SeqVec(pM,fromlocalsize);
++	#endif
++	#ifdef _HAVE_ADOLC_
++	this->avector=xNew<IssmDouble>(pM);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Vector::Vector(IssmDouble* serial_vec,int M){{{*/
++Vector::Vector(IssmDouble* serial_vec,int M){
++
++	#ifdef _HAVE_PETSC_
++		int* idxm=xNew<int>(M);
++		for(int i=0;i<M;i++) idxm[i]=i;
++
++		this->vector=NewVec(M);
++		VecSetValues(this->vector,M,idxm,serial_vec,INSERT_VALUES);
++		VecAssemblyBegin(this->vector);
++		VecAssemblyEnd(this->vector);
++
++		xDelete<int>(idxm);
++	#else
++		this->vector=new SeqVec(serial_vec,M);
++	#endif
++	#ifdef _HAVE_ADOLC_
++		this->avector=xNew<IssmDouble>(M);
++	#endif
++}
++/*}}}*/
++#ifdef _HAVE_PETSC_
++/*FUNCTION Vector::Vector(Vec petsc_vec){{{*/
++Vector::Vector(Vec petsc_vec){
++
++	if(petsc_vec==NULL){
++		this->vector=NewVec(0);
++	}
++	else{
++		/*copy vector*/
++		VecDuplicate(petsc_vec,&this->vector);
++		VecCopy(petsc_vec,this->vector);
++	}
++
++}
++/*}}}*/
++#endif
++#if defined(_HAVE_GSL_) && !defined(_HAVE_PETSC_)
++/*FUNCTION Vector::Vector(SeqVec* seq_vec){{{*/
++Vector::Vector(SeqVec*  seq_vec){
++
++	if(seq_vec==NULL){
++		this->vector=NULL;
++	}
++	else{
++		/*copy vector*/
++		this->vector=seq_vec->Duplicate();
++	}
++}
++/*}}}*/
++#endif
++
++		/*FUNCTION Vector::~Vector(){{{*/
++Vector::~Vector(){
++
++ 	#ifdef _HAVE_PETSC_
++	VecFree(&this->vector);
++	#else
++	delete this->vector;
++	#endif
++	#ifdef _HAVE_ADOLC_
++	xDelete<IssmDouble>(this->avector);
++	#endif
++}
++/*}}}*/
++
++/*Vector specific routines: */
++/*FUNCTION Vector::Echo{{{*/
++void Vector::Echo(void){
++
++	int i;
++
++	#ifdef _HAVE_PETSC_
++	_assert_(this->vector);
++	VecView(this->vector,PETSC_VIEWER_STDOUT_WORLD);
++	#else
++	this->vector->Echo();
++	#endif
++
++	#ifdef _HAVE_ADOLC_
++	/*do nothing for now: */
++	#endif
++}
++/*}}}*/
++/*FUNCTION Vector::Assemble{{{*/
++void Vector::Assemble(void){
++		
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecAssemblyBegin(this->vector); 
++		VecAssemblyEnd(this->vector);
++	#else
++		this->vector->Assemble();
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION Vector::SetValues{{{*/
++void Vector::SetValues(int ssize, int* list, IssmDouble* values, InsMode mode){
++		
++		
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecSetValues(this->vector,ssize,list,values,ISSMToPetscInsertMode(mode));
++	#else
++		this->vector->SetValues(ssize,list,values,mode);
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION Vector::SetValue{{{*/
++void Vector::SetValue(int dof, IssmDouble value, InsMode mode){
++		
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecSetValues(this->vector,1,&dof,&value,ISSMToPetscInsertMode(mode));
++	#else
++		this->vector->SetValue(dof,value,mode);
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION Vector::GetValue{{{*/
++void Vector::GetValue(IssmDouble* pvalue,int dof){
++		
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecGetValues(this->vector,1,&dof,pvalue);
++	#else
++	this->vector->GetValue(pvalue,dof);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Vector::GetSize{{{*/
++void Vector::GetSize(int* pM){
++		
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecGetSize(this->vector,pM);
++	#else
++		this->vector->GetSize(pM);
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION Vector::IsEmpty{{{*/
++bool Vector::IsEmpty(void){
++
++	int M;
++
++	_assert_(this->vector);
++	this->GetSize(&M);
++
++	if(M==0) 
++	 return true;
++	else
++	 return false;
++}
++/*}}}*/
++/*FUNCTION Vector::GetLocalSize{{{*/
++void Vector::GetLocalSize(int* pM){
++		
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecGetLocalSize(this->vector,pM);
++	#else
++		this->vector->GetLocalSize(pM);
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION Vector::Duplicate{{{*/
++Vector* Vector::Duplicate(void){
++	
++	Vector* output=NULL;
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		Vec vec_output=NULL;
++		VecDuplicate(this->vector,&vec_output);
++		output=new Vector(vec_output);
++		VecFree(&vec_output);
++	#else
++		output=new Vector();
++		output->vector=this->vector->Duplicate();
++	#endif
++	return output;
++
++}
++/*}}}*/
++/*FUNCTION Vector::Set{{{*/
++void Vector::Set(IssmDouble value){
++	
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecSet(this->vector,value);
++	#else
++		this->vector->Set(value);
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION Vector::AXPY{{{*/
++void Vector::AXPY(Vector* X, IssmDouble a){
++	
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecAXPY(this->vector,a,X->vector);
++	#else
++		this->vector->AXPY(X->vector,a);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Vector::AYPX{{{*/
++void Vector::AYPX(Vector* X, IssmDouble a){
++	
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecAYPX(this->vector,a,X->vector);
++	#else
++		this->vector->AYPX(X->vector,a);
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION Vector::ToMPISerial{{{*/
++IssmDouble* Vector::ToMPISerial(void){
++
++	IssmDouble* vec_serial=NULL;
++
++	#ifdef _HAVE_PETSC_
++		VecToMPISerial(&vec_serial, this->vector);
++	#else
++		vec_serial=this->vector->ToMPISerial();
++	#endif
++
++	return vec_serial;
++
++}
++/*}}}*/
++/*FUNCTION Vector::Copy{{{*/
++void Vector::Copy(Vector* to){
++
++	#ifdef _HAVE_PETSC_
++		if(this->vector) VecCopy(this->vector,to->vector);
++	#else
++		this->vector->Copy(to->vector);
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION Vector::Norm{{{*/
++IssmDouble Vector::Norm(NormMode norm_type){
++	
++	IssmDouble norm=0;
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecNorm(this->vector,ISSMToPetscNormMode(norm_type),&norm);
++	#else
++		norm=this->vector->Norm(norm_type);
++	#endif
++	return norm;
++}
++/*}}}*/
++/*FUNCTION Vector::Scale{{{*/
++void Vector::Scale(IssmDouble scale_factor){
++	
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecScale(this->vector,scale_factor); 
++	#else
++		this->vector->Scale(scale_factor);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Vector::Dot{{{*/
++IssmDouble Vector::Dot(Vector* vector){
++
++	IssmDouble dot;
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecDot(this->vector,vector->vector,&dot);
++	#else
++		dot=this->vector->Dot(vector->vector);
++	#endif
++	return dot;
++}
++/*}}}*/
++/*FUNCTION Vector::PointwiseDivide{{{*/
++void Vector::PointwiseDivide(Vector* x,Vector* y){
++
++	#ifdef _HAVE_PETSC_
++		_assert_(this->vector);
++		VecPointwiseDivide(this->vector,x->vector,y->vector);
++	#else
++		this->vector->PointwiseDivide(x->vector,y->vector);
++	#endif
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 12821)
+@@ -0,0 +1,69 @@
++/*!\file:  ElementMatrix.h
++ * \brief container for information needed to plug element matrix generated by elements 
++ * into the Kff and Kfs global matrices. 
++ * This object will hold the element matrix on the g-set, the local as well as global 
++ * dof lists in the f and s sets.
++ */ 
++
++#ifndef _ELEMENT_MATRIX_H_
++#define _ELEMENT_MATRIX_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Object.h"
++#include "../../toolkits/toolkits.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++class Node;
++/*}}}*/
++
++class ElementMatrix{
++
++	public:
++	
++		int      nrows;
++		int      ncols;
++		bool     dofsymmetrical;
++		IssmDouble*  values;
++
++		//gset
++		int*     gglobaldoflist;
++
++		/*row wise: */
++		//fset
++		int      row_fsize;
++		int*     row_flocaldoflist;
++		int*     row_fglobaldoflist;
++		//sset
++		int      row_ssize;
++		int*     row_slocaldoflist;
++		int*     row_sglobaldoflist;
++
++		/*column wise: */
++		//fset
++		int      col_fsize;
++		int*     col_flocaldoflist;
++		int*     col_fglobaldoflist;
++		//sset
++		int      col_ssize;
++		int*     col_slocaldoflist;
++		int*     col_sglobaldoflist;
++
++		/*ElementMatrix constructors, destructors {{{*/
++		ElementMatrix();
++		ElementMatrix(ElementMatrix* Ke);
++		ElementMatrix(ElementMatrix* Ke1,ElementMatrix* Ke2);
++		ElementMatrix(ElementMatrix* Ke1,ElementMatrix* Ke2,ElementMatrix* Ke3);
++		ElementMatrix(Node** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
++		~ElementMatrix();
++		/*}}}*/
++		/*ElementMatrix specific routines {{{*/
++		void AddToGlobal(Matrix* Kff, Matrix* Kfs);
++		void AddToGlobal(Matrix* Jff);
++		void Echo(void);
++		void CheckConsistency(void);
++		void Transpose(void);
++		void Init(ElementMatrix* Ke);
++		void SetDiag(IssmDouble scalar);
++		/*}}}*/
++};
++#endif //#ifndef _ELEMENT_MATRIX_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12821)
+@@ -0,0 +1,253 @@
++/*!\file Matrix.cpp
++ * \brief: implementation of the Matrix object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++#include "../../toolkits/toolkits.h"
++#include "./Matrix.h"
++	
++/*}}}*/
++
++/*Matrix constructors and destructor*/
++/*FUNCTION Matrix::Matrix(){{{*/
++Matrix::Matrix(){
++
++	#ifdef _HAVE_PETSC_
++	this->matrix=NULL;
++	#else
++	this->matrix=NULL;
++	#endif
++	#ifdef _HAVE_ADOLC_
++	this->amatrix=NULL;
++	#endif
++}
++/*}}}*/
++/*FUNCTION Matrix::Matrix(int M,int N){{{*/
++Matrix::Matrix(int M,int N){
++
++	#ifdef _HAVE_PETSC_
++	this->matrix=NewMat(M,N);
++	#else
++	this->matrix=new SeqMat(M,N);
++	#endif
++	#ifdef _HAVE_ADOLC_
++	this->amatrix=xNew<IssmDouble>(M*N);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Matrix::Matrix(int M,int N,IssmDouble sparsity){{{*/
++Matrix::Matrix(int M,int N,IssmDouble sparsity){
++
++	#ifdef _HAVE_PETSC_
++	this->matrix=NewMat(M,N,sparsity);
++	#else
++	this->matrix=new SeqMat(M,N,sparsity);
++	#endif
++	#ifdef _HAVE_ADOLC_
++ 	this->amatrix=xNew<IssmDouble>(M*N);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity){{{*/
++Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity){
++
++	#ifdef _HAVE_PETSC_
++	int     i;
++
++
++	int* idxm=xNew<int>(M);
++	int* idxn=xNew<int>(N);
++	for(i=0;i<M;i++)idxm[i]=i;
++	for(i=0;i<N;i++)idxn[i]=i;
++
++	this->matrix=NewMat(M,N,sparsity);
++	MatSetValues(this->matrix,M,idxm,N,idxn,serial_mat,INSERT_VALUES);
++	MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
++	MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
++
++	xDelete<int>(idxm);
++	xDelete<int>(idxn);
++	#else
++	this->matrix=new SeqMat(serial_mat,M,N,sparsity);
++	#endif
++	#ifdef _HAVE_ADOLC_
++	this->amatrix=xNew<IssmDouble>(M*N);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode){{{*/
++Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode){
++	
++	#ifdef _HAVE_PETSC_
++	this->matrix=NewMat(M,N,connectivity,numberofdofspernode);
++	#else
++	this->matrix=new SeqMat(M,N,connectivity,numberofdofspernode);
++	#endif
++	#ifdef _HAVE_ADOLC_
++	this->amatrix=xNew<IssmDouble>(M*N);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Matrix::~Matrix(){{{*/
++Matrix::~Matrix(){
++
++ 	#ifdef _HAVE_PETSC_
++	MatFree(&this->matrix);
++	#else
++	delete this->matrix;
++	#endif
++	#ifdef _HAVE_ADOLC_
++	xDelete<IssmDouble>(this->amatrix);
++	#endif
++}
++/*}}}*/
++
++/*Matrix specific routines: */
++/*FUNCTION Matrix::Echo{{{*/
++void Matrix::Echo(void){
++
++	int i,j;
++
++	#ifdef _HAVE_PETSC_
++	MatView(this->matrix,PETSC_VIEWER_STDOUT_WORLD);
++	#else
++	this->matrix->Echo();
++	#endif
++
++	#ifdef _HAVE_ADOLC_
++	/*Not sure about that one. Should we use the overloaded operator >>?*/
++	_printString_("ADOLC Matrix equivalent:" );
++//	for(i=0;i<M;i++){
++//		for(j=0;j<N;j++){
++//			_printString_(*(amatrix+N*i+j) << " ");
++//		}
++//		_printLine_("");
++//	}
++	#endif
++}
++/*}}}*/
++/*FUNCTION Matrix::Assemble{{{*/
++void Matrix::Assemble(void){
++	#ifdef _HAVE_PETSC_
++		_assert_(this->matrix);
++		MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
++		MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
++		#if _PETSC_MAJOR_ == 2 
++			MatCompress(this->matrix);
++		#endif
++	#else
++		this->matrix->Assemble();
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION Matrix::Norm{{{*/
++IssmDouble Matrix::Norm(NormMode norm_type){
++	
++	IssmDouble norm=0;
++	#ifdef _HAVE_PETSC_
++		_assert_(this->matrix);
++		MatNorm(this->matrix,ISSMToPetscNormMode(norm_type),&norm);
++	#else
++		norm=this->matrix->Norm(norm_type);
++	#endif
++	return norm;
++}
++/*}}}*/
++/*FUNCTION Matrix::GetSize{{{*/
++void Matrix::GetSize(int* pM,int* pN){
++	
++	#ifdef _HAVE_PETSC_
++		_assert_(this->matrix);
++		MatGetSize(this->matrix,pM,pN);
++	#else
++		this->matrix->GetSize(pM,pN);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Matrix::GetLocalSize{{{*/
++void Matrix::GetLocalSize(int* pM,int* pN){
++	
++	#ifdef _HAVE_PETSC_
++		_assert_(this->matrix);
++		MatGetLocalSize(this->matrix,pM,pN);
++	#else
++		this->matrix->GetLocalSize(pM,pN);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Matrix::MatMult{{{*/
++void Matrix::MatMult(Vector* X,Vector* AX){
++
++	#ifdef _HAVE_PETSC_
++		_assert_(this->matrix);
++		_assert_(X->vector);
++		MatMultPatch(this->matrix,X->vector,AX->vector);
++	#else
++		this->matrix->MatMult(X->vector,AX->vector);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Matrix::Duplicate{{{*/
++Matrix* Matrix::Duplicate(void){
++
++	Matrix* output=NULL;
++
++	output=new Matrix();
++
++	#ifdef _HAVE_PETSC_
++		_assert_(this->matrix);
++		MatDuplicate(this->matrix,MAT_COPY_VALUES,&output->matrix);
++	#else
++		output->matrix=this->matrix->Duplicate();
++	#endif
++	
++	return output;
++}
++/*}}}*/
++/*FUNCTION Matrix::ToSerial{{{*/
++IssmDouble* Matrix::ToSerial(void){
++
++	IssmDouble* output=NULL;
++
++	#ifdef _HAVE_PETSC_
++		MatToSerial(&output,this->matrix);
++	#else
++		output=this->matrix->ToSerial();
++	#endif
++	return output;
++}
++/*}}}*/
++/*FUNCTION Matrix::SetValues{{{*/
++void Matrix::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){
++
++	#ifdef _HAVE_PETSC_
++		MatSetValues(this->matrix,m,idxm,n,idxn,values,ISSMToPetscInsertMode(mode));
++	#else
++		this->matrix->SetValues(m,idxm,n,idxn,values,mode);
++	#endif
++}
++/*}}}*/
++/*FUNCTION Matrix::Convert{{{*/
++void Matrix::Convert(MatrixType type){
++
++	#ifdef _HAVE_PETSC_
++		MatConvert(this->matrix,ISSMToPetscMatrixType(type),MAT_REUSE_MATRIX,&this->matrix);
++	#else
++		this->matrix->Convert(type);
++	#endif
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 12821)
+@@ -0,0 +1,69 @@
++/*!\file:  Vector.h
++ * \brief wrapper to vector objects. The goal is to control which API (PETSc,Scalpack, Plapack?) 
++ * implements our underlying vector format.
++ */ 
++
++#ifndef _VECTOR_H_
++#define _VECTOR_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++#include "../../toolkits/toolkits.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++/*}}}*/
++
++class Vector{
++
++	public:
++	
++		#ifdef _HAVE_PETSC_
++			Vec vector; 
++		#else
++			SeqVec* vector;
++		#endif
++		#ifdef _HAVE_ADOLC_
++			IssmDouble* avector;
++		#endif
++
++		/*Vector constructors, destructors {{{*/
++		Vector();
++		Vector(int M,bool fromlocalsize=false);
++		Vector(IssmDouble* serial_vec,int pM);
++		#ifdef _HAVE_PETSC_
++		Vector(Vec petsc_vec);
++		#endif
++		#if defined(_HAVE_GSL_) && !defined(_HAVE_PETSC_)
++		Vector(SeqVec*  seq_vec);
++		#endif
++		~Vector();
++		/*}}}*/
++		/*Vector specific routines {{{*/
++		void Echo(void);
++		void    AXPY(Vector *X, IssmDouble a);
++		void    AYPX(Vector *X, IssmDouble a);
++		void    Assemble(void);
++		void    Copy(Vector *to);
++		IssmDouble  Dot(Vector *vector);
++		Vector *Duplicate(void);
++		void    GetValue(IssmDouble *pvalue, int dof);
++		void    GetSize(int *pM);
++		void    GetLocalSize(int *pM);
++		bool    IsEmpty(void);
++		IssmDouble  Norm(NormMode norm_type);
++		void    PointwiseDivide(Vector  *x,Vector*y);
++		void    Scale(IssmDouble scale_factor);
++		void    Set(IssmDouble value);
++		void    SetValues(int ssize, int *list, IssmDouble*values, InsMode mode);
++		void    SetValue(int dof, IssmDouble value, InsMode mode);
++		IssmDouble *ToMPISerial(void);
++		/*}}}*/
++};
++
++
++#endif //#ifndef _VECTOR_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 12821)
+@@ -0,0 +1,59 @@
++/*!\file:  Matrix.h
++ * \brief wrapper to matrix objects. The goal is to control which API (PETSc,Scalpack, Plapack?) 
++ * implements our underlying matrix format.
++ */ 
++
++#ifndef _MATRIX_H_
++#define _MATRIX_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++#include "../../toolkits/toolkits.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++class Vector;
++
++/*}}}*/
++
++class Matrix{
++
++	public:
++	
++		#ifdef _HAVE_PETSC_
++		Mat matrix; 
++		#else
++		SeqMat* matrix; 
++		#endif
++		#ifdef _HAVE_ADOLC_
++		IssmDouble* amatrix;
++		#endif
++
++		/*Matrix constructors, destructors {{{*/
++		Matrix();
++		Matrix(int M,int N);
++		Matrix(int M,int N,IssmDouble sparsity);
++		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity);
++		Matrix(int M,int N,int connectivity,int numberofdofspernode);
++		~Matrix();
++		/*}}}*/
++		/*Matrix specific routines {{{*/
++		void Echo(void);
++		void Assemble(void);
++		IssmDouble Norm(NormMode norm_type);
++		void GetSize(int* pM,int* pN);
++		void GetLocalSize(int* pM,int* pN);
++		void MatMult(Vector* X,Vector* AX);
++		Matrix* Duplicate(void);
++		IssmDouble* ToSerial(void);
++		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode);
++		void Convert(MatrixType type);
++		/*}}}*/
++
++};
++
++#endif //#ifndef _MATRIX_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 12821)
+@@ -0,0 +1,276 @@
++/*!\file ElementVector.cpp
++ * \brief: implementation of the ElementVector object, used to plug values from element into global load
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*ElementVector constructors and destructor*/
++/*FUNCTION ElementVector::ElementVector(){{{*/
++ElementVector::ElementVector(){
++
++	this->nrows=0;
++	this->values=NULL;
++	this->fsize=0;
++	this->flocaldoflist=NULL;
++	this->fglobaldoflist=NULL;
++
++}
++/*}}}*/
++/*FUNCTION ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){{{*/
++ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){
++
++	/*intermediaries*/
++	int i,j,counter;
++	int gsize,fsize,ssize;
++	int* P=NULL;
++	bool found;
++
++	/*If one of the two matrix is NULL, we copy the other one*/
++	if(!pe1 && !pe2){
++		_error2_("Two input element matrices are NULL");
++	}
++	else if(!pe1){
++		this->Init(pe2);
++		return;
++	}
++	else if(!pe2){
++		this->Init(pe1);
++		return;
++	}
++
++	/*Initialize itransformation matrix pe[P[i]] = pe2[i]*/
++	P=xNew<int>(pe2->nrows);
++
++	/*1: Get the new numbering of pe2 and get size of the new matrix*/
++	gsize=pe1->nrows;
++	for(i=0;i<pe2->nrows;i++){
++		found=false;
++		for(j=0;j<pe1->nrows;j++){
++			if(pe2->gglobaldoflist[i]==pe1->gglobaldoflist[j]){
++				found=true; P[i]=j; break;
++			}
++		}
++		if(!found){
++			P[i]=gsize; gsize++;
++		}
++	}
++
++	/*2: Initialize static fields*/
++	this->nrows=gsize;
++
++	/*Gset and values*/
++	this->gglobaldoflist=xNew<int>(this->nrows);
++	this->values=xNewZeroInit<IssmDouble>(this->nrows);
++	for(i=0;i<pe1->nrows;i++){
++		this->values[i] += pe1->values[i];
++		this->gglobaldoflist[i]=pe1->gglobaldoflist[i];
++	}
++	for(i=0;i<pe2->nrows;i++){
++		this->values[P[i]] += pe2->values[i];
++		this->gglobaldoflist[P[i]]=pe2->gglobaldoflist[i];
++	}
++
++	/*Fset*/
++	fsize=pe1->fsize;
++	for(i=0;i<pe2->fsize;i++){
++		if(P[pe2->flocaldoflist[i]] >= pe1->nrows) fsize++;
++	}
++	this->fsize=fsize;
++	if(fsize){
++		this->flocaldoflist =xNew<int>(fsize);
++		this->fglobaldoflist=xNew<int>(fsize);
++		for(i=0;i<pe1->fsize;i++){
++			this->flocaldoflist[i] =pe1->flocaldoflist[i];
++			this->fglobaldoflist[i]=pe1->fglobaldoflist[i];
++		}
++		counter=pe1->fsize;
++		for(i=0;i<pe2->fsize;i++){
++			if(P[pe2->flocaldoflist[i]] >= pe1->nrows){
++				this->flocaldoflist[counter] =P[pe2->flocaldoflist[i]];
++				this->fglobaldoflist[counter]=pe2->fglobaldoflist[i];
++				counter++;
++			}
++		}
++	}
++	else{
++		this->flocaldoflist=NULL;
++		this->fglobaldoflist=NULL;
++	}
++
++	/*clean-up*/
++	xDelete<int>(P);
++}
++/*}}}*/
++/*FUNCTION 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);
++	ElementVector* pe123=new ElementVector(pe12,pe3);
++
++	/*Initialize current object with this matrix*/
++	this->Init(pe123);
++
++	/*clean-up*/
++	delete pe12;
++	delete pe123;
++}
++/*}}}*/
++/*FUNCTION 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);
++
++	/*fill values with 0: */
++	this->values=xNewZeroInit<IssmDouble>(this->nrows);
++	
++	/*g list*/
++	this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
++
++	/*Get fsize*/
++	this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
++	this->flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
++	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
++}
++/*}}}*/
++/*FUNCTION ElementVector::~ElementVector(){{{*/
++ElementVector::~ElementVector(){
++	
++	xDelete<IssmDouble>(this->values);
++	xDelete<int>(this->gglobaldoflist);
++	xDelete<int>(this->flocaldoflist);
++	xDelete<int>(this->fglobaldoflist);
++}
++/*}}}*/
++
++/*ElementVector specific routines: */
++/*FUNCTION ElementVector::AddToGlobal(Vector* pf){{{*/
++void ElementVector::AddToGlobal(Vector* pf){
++
++	int i;
++	IssmDouble* localvalues=NULL;
++
++	/*In debugging mode, check consistency (no NaN, and values not too big)*/
++	this->CheckConsistency();
++
++	if(this->fsize){
++		/*first, retrieve values that are in the f-set from the g-set values vector: */
++		localvalues=xNew<IssmDouble>(this->fsize);
++		for(i=0;i<this->fsize;i++){
++			localvalues[i]=this->values[this->flocaldoflist[i]];
++		}
++		/*add local values into global  vector, using the fglobaldoflist: */
++		pf->SetValues(this->fsize,this->fglobaldoflist,localvalues,ADD_VAL);
++
++		/*Free ressources:*/
++		xDelete<IssmDouble>(localvalues);
++	}
++	
++}
++/*}}}*/
++/*FUNCTION ElementVector::InsertIntoGlobal(Vector* pf){{{*/
++void ElementVector::InsertIntoGlobal(Vector* pf){
++
++	int i;
++	IssmDouble* localvalues=NULL;
++
++	if(this->fsize){
++		/*first, retrieve values that are in the f-set from the g-set values vector: */
++		localvalues=xNew<IssmDouble>(this->fsize);
++		for(i=0;i<this->fsize;i++){
++			localvalues[i]=this->values[this->flocaldoflist[i]];
++		}
++		/*add local values into global  vector, using the fglobaldoflist: */
++		pf->SetValues(this->fsize,this->fglobaldoflist,localvalues,INS_VAL);
++
++		/*Free ressources:*/
++		xDelete<IssmDouble>(localvalues);
++	}
++
++}
++/*}}}*/
++/*FUNCTION ElementVector::CheckConsistency{{{*/
++void ElementVector::CheckConsistency(void){
++	/*Check element matrix values, only in debugging mode*/
++#ifdef _ISSM_DEBUG_ 
++	for (int i=0;i<this->nrows;i++){
++		if (xIsNan<IssmDouble>(this->values[i])) _error2_("NaN found in Element Vector");
++		if (fabs( this->values[i])>1.e+50) _error2_("Element Vector values exceeds 1.e+50");
++	}
++#endif
++}
++/*}}}*/
++/*FUNCTION ElementVector::Echo{{{*/
++void ElementVector::Echo(void){
++
++	int i,j;
++	_printLine_("Element Vector echo:");
++	_printLine_("   nrows: " << nrows);
++	_printLine_("   values:");
++	for(i=0;i<nrows;i++){
++		_printLine_(setw(4) << right << i << ": " << setw(10) << values[i]);
++	}
++
++	_printString_("   gglobaldoflist (" << gglobaldoflist << "): ");
++	if(gglobaldoflist) for(i=0;i<nrows;i++) _printString_(" " << gglobaldoflist[i] );
++	_printLine_(" ");
++
++	_printLine_("   fsize: " << fsize);
++	_printString_("   flocaldoflist  (" << flocaldoflist << "): ");
++	if(flocaldoflist) for(i=0;i<fsize;i++) _printString_(" " << flocaldoflist[i] );
++	_printLine_(" ");
++	_printString_("   fglobaldoflist (" << fglobaldoflist << "): ");
++	if(fglobaldoflist) for(i=0;i<fsize;i++) _printString_(" " << fglobaldoflist[i] );
++	_printLine_(" ");
++}
++/*}}}*/
++/*FUNCTION ElementVector::Init{{{*/
++void ElementVector::Init(ElementVector* pe){
++
++	_assert_(pe);
++
++	this->nrows =pe->nrows;
++
++	this->values=xNew<IssmDouble>(this->nrows);
++	xMemCpy<IssmDouble>(this->values,pe->values,this->nrows);
++
++	this->gglobaldoflist=xNew<int>(this->nrows);
++	xMemCpy<int>(this->gglobaldoflist,pe->gglobaldoflist,this->nrows);
++
++	this->fsize=pe->fsize;
++	if(this->fsize){
++		this->flocaldoflist=xNew<int>(this->fsize);
++		xMemCpy<int>(this->flocaldoflist,pe->flocaldoflist,this->fsize);
++		this->fglobaldoflist=xNew<int>(this->fsize);
++		xMemCpy<int>(this->fglobaldoflist,pe->fglobaldoflist,this->fsize);
++	}
++	else{
++		this->flocaldoflist=NULL;
++		this->fglobaldoflist=NULL;
++	}
++}
++/*}}}*/
++/*FUNCTION ElementVector::SetValue{{{*/
++void ElementVector::SetValue(IssmDouble scalar){
++
++	int i;
++
++	for(i=0;i<this->nrows;i++)this->values[i]=scalar;
++
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Patch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Patch.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Patch.h	(revision 12821)
+@@ -0,0 +1,46 @@
++/*!\file: Patch.h
++ * \brief prototypes for Patch.h
++ */ 
++
++/*A Patch object is used to store all results held in elements, in a serial way, and to dump them to disk. 
++	
++	Each row of the Patch object is made of the following information: 
++	- the result enum_type, 
++	- the step and time, 
++	- the id of the element, 
++	- the interpolation type, 
++	- the vertices ids, 
++	- and the values at the nodes (could be different from the vertices).
++	
++	For ex: 
++	1. on a Beam element, Vx, at step 1, time .5, element id 1, interpolation type P0 (constant), vertices ids 1 and 2, one constant value 4.5
++	   VxEnum 1  .5  1 P0  1 2       4.5 NaN  NaN
++	2. on a Tria element, Vz, at step 2, time .8, element id 2, interpolation type P1 (linear), vertices ids 1 3 and 4, with values at 3 nodes 4.5, 3.2, 2.5
++	   VzEnum 2  .8  2 P1  1 3 4     4.5 3.2  2.5
++*/
++
++
++#ifndef _PATCH_H_
++#define  _PATCH_H_
++
++/*Headers:*/
++class Patch{
++
++	public:
++
++		int     numrows; //number of results held in Patch object
++		int     numcols; //number of columns
++		int     maxvertices; //maxvertices corresponds to largest amount of vertices on a given element, determined by the geometry.
++		int     maxnodes;    // maxnodes corresponds to the largest amout of nodes on a given element, determined by the interpolation type.
++		
++		IssmDouble* values;  //result values
++
++		Patch();
++		Patch(int numrows, int maxvertices, int maxnodes);
++		~Patch();
++		void fillelementinfo(int row, int element_id, int* vertices_ids, int num_vertices);
++		void fillresultinfo(int row,int enum_type,int step, IssmDouble time, int interpolation, IssmDouble* nodal_values, int num_nodes);
++		void Gather(void);
++
++};
++#endif //ifndef _PATCH_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.h	(revision 12821)
+@@ -0,0 +1,50 @@
++/*!\file Hook.h
++ * \brief: header file for hook object.
++ * A hook is a class  that can store the id, offset, and object corresponding to this id and offset into a dataset.
++ * For example, an element has a hook to its nodes. A node has a hook to its vertex.  The hook abstracts the need for having
++ * ids and offsets (necesarry for proper configuration of an object) in our objects. 
++ */
++
++#ifndef _HOOK_H_
++#define _HOOK_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Object.h"
++class DataSet;
++/*}}}*/
++
++class Hook{
++
++	private: 
++
++		int	   num; //number of objects being hooked onto
++		Object**	   objects; //list of object pointers. we do not allocate objects, just a list a pointers, that will get to point to the real objects from a dataset.
++		int*   ids;     //list of object ids, to go look for them in datasets.
++		int*   offsets;  //list of object offsets into datasets, to speed up lookup.
++
++	public:
++
++		/*Hook constructors, destructors: {{{*/
++		Hook();
++		Hook(int* ids, int num);
++		~Hook();
++		/*}}}*/
++		/*Object like functionality:{{{*/
++		void       Echo(void);
++		void       DeepEcho(void);
++		Object*    copy(void);
++		/*}}}*/
++		/*Hook management: {{{*/
++		Object*    delivers(void); //single object deliver
++		Object**   deliverp(void); //deliver all objects
++		void       configure(DataSet* dataset);
++		Hook*      Spawn(int* indices, int numindices);
++		Object**   GetObjects(void);
++		int*       Ids(void);
++		int*       GetOffsets(void);
++		int        GetNum(void);
++		/*}}}*/
++};
++
++#endif  /* _HOOK_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomSubDomain.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomSubDomain.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomSubDomain.h	(revision 12821)
+@@ -0,0 +1,23 @@
++#ifndef _GEOMETRICALSUBDOMAIN_H_
++#define _GEOMETRICALSUBDOMAIN_H_
++
++#include "./include.h"
++
++namespace bamg {
++
++	//classes
++	class GeomEdge;
++	class Geometry;
++
++	class GeomSubDomain {
++		public:
++			GeomEdge *edge;
++			int              direction;   // -1 or 1
++			long             ReferenceNumber;
++
++			//Methods
++			void Set(const GeomSubDomain &,const Geometry & ,const Geometry &);
++	};
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.cpp	(revision 12821)
+@@ -0,0 +1,425 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "../objects.h"
++
++namespace bamg {
++
++	/*Constructors Destructors*/
++	/*FUNCTION ListofIntersectionTriangles::ListofIntersectionTriangles{{{*/
++	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(){
++		if (lIntTria) delete [] lIntTria,lIntTria=0;
++		if (lSegsI) delete [] lSegsI,lSegsI=0;
++	} 
++	/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION ListofIntersectionTriangles::Init{{{*/
++	void ListofIntersectionTriangles::Init(void){
++		state=0;
++		len=0;
++		Size=0;
++	}
++	/*}}}*/
++	/*FUNCTION ListofIntersectionTriangles::Length{{{*/
++	double  ListofIntersectionTriangles::Length(){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Length)*/
++
++		// computation of the length
++
++		// check Size
++		if (Size<=0){
++			_error2_("Size<=0");
++		}
++
++		Metric Mx,My;
++		int ii,jj;
++		R2 x,y,xy;
++
++		SegInterpolation* SegI=lSegsI;
++		SegI=lSegsI;
++		lSegsI[NbSeg].last=Size;
++		int EndSeg=Size;
++
++		y = lIntTria[0].x;
++		double sxy, s = 0;
++		lIntTria[0].s =0;
++		SegI->lBegin=s;
++
++		for (jj=0,ii=1;ii<Size;jj=ii++) {  
++			// seg jj,ii
++			x  = y;
++			y  = lIntTria[ii].x;
++			xy = y-x;
++			Mx = lIntTria[ii].m;
++			My = lIntTria[jj].m;
++			sxy= LengthInterpole(Mx,My,xy);
++			s += sxy;
++			lIntTria[ii].s = s;
++			if (ii == EndSeg){
++				SegI->lEnd=s;
++				SegI++;
++				EndSeg=SegI->last;
++				SegI->lBegin=s;
++			}
++		}
++		len = s;
++		SegI->lEnd=s;
++
++		return s;
++	}
++	/*}}}*/
++	/*FUNCTION 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)*/
++
++		register int n;
++		R2 x(0,0);
++		if ( d0) x =      (*tt)[0].r * d0;
++		if ( d1) x = x +  (*tt)[1].r * d1;
++		if ( d2) x = x +  (*tt)[2].r * d2;
++		// newer add same point 
++		if(!Size ||  Norme2_2(lIntTria[Size-1].x-x)) {
++			if (Size==MaxSize) ReShape();
++			lIntTria[Size].t=tt;
++			lIntTria[Size].bary[0]=d0;
++			lIntTria[Size].bary[1]=d1;
++			lIntTria[Size].bary[2]=d2;
++			lIntTria[Size].x = x;
++			Metric m0,m1,m2;
++			register BamgVertex * v;
++			if ((v=(*tt)(0))) m0    = v->m;
++			if ((v=(*tt)(1))) m1    = v->m;
++			if ((v=(*tt)(2))) m2    = v->m;
++			lIntTria[Size].m =  Metric(lIntTria[Size].bary,m0,m1,m2);
++			n=Size++;}
++		else n=Size-1;
++		return n;
++	}
++	/*}}}*/
++	/*FUNCTION 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)*/
++
++		register int n;
++		if(!Size ||  Norme2_2(lIntTria[Size-1].x-A)) {
++			if (Size==MaxSize) ReShape();
++			lIntTria[Size].t=0;
++			lIntTria[Size].x=A;
++			lIntTria[Size].m=mm;
++			n=Size++;
++		}
++		else  n=Size-1;
++		return  n; 
++	}
++	/*}}}*/
++	/*FUNCTION ListofIntersectionTriangles::NewPoints{{{*/
++	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
++		double s=Length();
++		if (s<1.5) return 0;
++
++		const long nbvold=nbv;
++		int ii = 1 ;
++		R2 y,x;
++		Metric My,Mx ;
++		double sx =0,sy;
++		int nbi=Max(2,(int) (s+0.5));
++		double sint=s/nbi;
++		double si  =sint;
++
++		int EndSeg=Size;
++		SegInterpolation* SegI=NULL;
++		if (NbSeg) SegI=lSegsI,EndSeg=SegI->last;
++
++		for (int k=1;k<nbi;k++){
++			while ((ii < Size) && ( lIntTria[ii].s <= si )){
++				if (ii++ == EndSeg){
++					SegI++;
++					EndSeg=SegI->last;
++				}
++			}
++
++			int ii1=ii-1;
++			x  =lIntTria[ii1].x;
++			sx =lIntTria[ii1].s;
++			Metric Mx=lIntTria[ii1].m;
++			y  =lIntTria[ii].x;
++			sy =lIntTria[ii].s;
++			Metric My=lIntTria[ii].m;
++			double lxy = sy-sx;
++			double cy = abscisseInterpole(Mx,My,y-x,(si-sx)/lxy);
++
++			R2 C;
++			double cx = 1-cy;
++			C = SegI ? SegI->F(si): x * cx + y *cy;
++			//C.Echo();
++			//x.Echo();
++			//y.Echo();
++			//_printLine_("cx = " << cx << ", cy=" << cy);
++
++			si += sint;
++			if ( nbv<maxnbv) {
++				vertices[nbv].r = C;
++				vertices[nbv++].m = Metric(cx,lIntTria[ii-1].m,cy,lIntTria[ii].m);
++			}
++			else return nbv-nbvold;
++		  }
++		return nbv-nbvold;
++	}
++	/*}}}*/
++	/*FUNCTION ListofIntersectionTriangles::NewSubSeg{{{*/
++	void  ListofIntersectionTriangles::NewSubSeg(GeomEdge *e,double s0,double s1){ 
++		long int verbosity=0;
++		if (NbSeg>=MaxNbSeg) {
++			int mneo= MaxNbSeg;
++			MaxNbSeg *= 2;
++			if (verbosity>3){
++				_printLine_("   reshape lSegsI from " << mneo << " to " << MaxNbSeg);
++			}
++			_assert_(lSegsI && NbSeg<MaxNbSeg);
++			SegInterpolation * lEn =  new SegInterpolation[MaxNbSeg];
++			for (int i=0;i< NbSeg;i++) lEn[i] = lSegsI[MaxNbSeg]; // copy old to new            
++			delete []  lSegsI; // remove old
++			lSegsI = lEn;        
++		}
++		if (NbSeg) lSegsI[NbSeg-1].last=Size;
++		lSegsI[NbSeg].e=e;
++		lSegsI[NbSeg].sBegin=s0;
++		lSegsI[NbSeg].sEnd=s1;     
++		NbSeg++;           
++	}
++	/*}}}*/
++	/*FUNCTION ListofIntersectionTriangles::ReShape{{{*/
++	void ListofIntersectionTriangles::ReShape(){ 
++
++		register int newsize = MaxSize*2;
++		IntersectionTriangles* nw = new IntersectionTriangles[newsize];
++		_assert_(nw);
++
++		// recopy
++		for (int i=0;i<MaxSize;i++) nw[i] = lIntTria[i];       
++		long int verbosity=0;
++		if(verbosity>3) _printLine_("   ListofIntersectionTriangles  ReShape Maxsize " << MaxSize << " -> " << MaxNbSeg);
++		MaxSize = newsize; 
++		delete [] lIntTria;// remove old
++		lIntTria = nw; // copy pointer
++	}
++	/*}}}*/
++	/*FUNCTION ListofIntersectionTriangles::SplitEdge{{{*/
++	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;
++
++		long int verbose=2;
++		Icoor2 deta[3], deti,detj;
++		double ba[3];
++		int nbt =0,ifirst=-1,ilast;
++		int i0,i1,i2;
++		int ocut,i,j,k=-1;
++		//  int OnAVertices =0;
++		Icoor2 dt[3];
++		I2 a = Bh.R2ToI2(A) ,b= Bh.R2ToI2(B);// compute  the Icoor a,b
++		I2 vi,vj;  
++		int iedge =-1;// not a edge
++
++		if(nbegin)  {// optimisation 
++			// we suppose  knowing the starting  triangle
++			t=tbegin=lIntTria[ilast=(Size-1)].t;
++			if (tbegin->det>=0) 
++			 ifirst = ilast;}  
++		else {// not optimisation 
++			Init();
++			t=tbegin = Bh.TriangleFindFromCoord(a,deta);
++			if( t->det>=0)
++			 ilast=NewItem(t,double(deta[0])/t->det,double(deta[1])/t->det,double(deta[2])/t->det);
++			else 
++			  {// find the nearest boundary edge  of the vertex A
++				// find a edge or such normal projection a the edge IJ is on the edge
++				//   <=> IJ.IA >=0 && IJ.AJ >=0
++				ilast=ifirst;
++				double ba,bb;
++				AdjacentTriangle edge=CloseBoundaryEdge(a,t,ba,bb);
++				BamgVertex & v0 = *edge.EdgeVertex(0), & v1 = *edge.EdgeVertex(1);
++				NewItem(A,Metric(ba,v0,bb,v1));
++				t=edge;
++				// test if the point b is in the same side
++				if (det(v0.i,v1.i,b)>=0) {
++					AdjacentTriangle edge=CloseBoundaryEdge(a,t,ba,bb);
++					BamgVertex & v0 = *edge.EdgeVertex(0), & v1 = *edge.EdgeVertex(1);
++					NewItem(A,Metric(ba,v0,bb,v1));
++					return;
++				}
++			  } // find the nearest boundary edge  of the vertex A
++		} // end not optimisation 
++		if (t->det<0) {  // outside departure
++			while (t->det <0) { // intersection boundary edge and a,b,
++				k=(*t)(0) ?  ((  (*t)(1) ? ( (*t)(2) ? -1 : 2) : 1  )) : 0;
++				if (k<0){
++					_error2_("k<0");
++				}
++				ocut = OppositeEdge[k];
++				i=VerticesOfTriangularEdge[ocut][0];
++				j=VerticesOfTriangularEdge[ocut][1];
++				vi=(*t)[i];
++				vj=(*t)[j];
++				deti = bamg::det(a,b,vi);
++				detj = bamg::det(a,b,vj);
++				if (deti>0) // go to  i direction on gamma
++				 ocut = PreviousEdge[ocut];      
++				else if (detj<=0) // go to j direction on gamma
++				 ocut = NextEdge[ocut];         
++				AdjacentTriangle tadj =t->Adj(ocut);
++				t = tadj;
++				iedge= tadj; 
++				if (t == tbegin) { // 
++					double ba,bb;
++					long int verbose=2;
++					AdjacentTriangle edge=CloseBoundaryEdge(a,t,ba,bb);
++					BamgVertex & v0 = *edge.EdgeVertex(0), & v1 = *edge.EdgeVertex(1);
++					NewItem(A,Metric(ba,v0,bb,v1));
++					return;
++				}
++			} //  end while (t->det <0)
++			// theoriticaly we have: deti =<0 and detj>0
++
++			// computation of barycentric coor
++			// test if the point b is on size on t
++			// we revert vi,vj because vi,vj is def in Adj triangle
++			if ( det(vi,vj,b)>=0) {
++				t=tbegin;
++				double ba,bb;
++				AdjacentTriangle edge=CloseBoundaryEdge(b,t,ba,bb);
++				NewItem(B,Metric(ba,*edge.EdgeVertex(0),bb,*edge.EdgeVertex(1)));
++				return;
++			}
++			else
++			  {
++				k = OppositeVertex[iedge];
++				i=VerticesOfTriangularEdge[iedge][0];
++				j=VerticesOfTriangularEdge[iedge][1];
++				double dij = detj-deti;
++				if (i+j+k != 0 + 1 +2){
++					_error2_("i+j+k != 0 + 1 +2");
++				}
++				ba[j] =  detj/dij;
++				ba[i] = -deti/dij;
++				ba[k] = 0;
++				ilast=NewItem(t,ba[0],ba[1],ba[2]); }
++		}  //  outside departure
++
++
++
++		// recherche the intersection of [a,b] with Bh Mesh.
++		// we know  a triangle ta contening the vertex a
++		// we have 2 case for intersection [a,b] with a edge [A,B] of Bh
++		// 1) the intersection point is in ]A,B[
++		// 2)                        is A or B
++		// first version --- 
++		for (;;) {
++			//    t->Draw();
++			if (iedge < 0) {
++				i0 =0;i1=1;i2=2;
++				dt[0] =bamg::det(a,b,(*t)[0]);
++				dt[1] =bamg::det(a,b,(*t)[1]);
++				dt[2] =bamg::det(a,b,(*t)[2]);}
++			else {
++				i2 = iedge;
++				i0 = NextEdge[i2];
++				i1 = NextEdge[i0]; 
++				dt[VerticesOfTriangularEdge[iedge][0]] = detj;// we revert i,j because
++				dt[VerticesOfTriangularEdge[iedge][1]] = deti;// we take the Triangle by the other side
++				dt[iedge] = det(a,b,(*t)[OppositeVertex[iedge]]);}
++
++				// so we have just to see the transition from - to + of the det0..2 on edge of t
++				// because we are going from a to b
++				if       ((dt[i=VerticesOfTriangularEdge[i0][0]] <  0) &&
++							( dt[j=VerticesOfTriangularEdge[i0][1]] > 0))
++				 ocut =i0;
++				else  if ((dt[i=VerticesOfTriangularEdge[i1][0]] <  0) &&
++							(dt[j=VerticesOfTriangularEdge[i1][1]] >  0))
++				 ocut =i1;
++				else  if ((dt[i=VerticesOfTriangularEdge[i2][0]] <  0) && 
++							(dt[j=VerticesOfTriangularEdge[i2][1]] >  0))
++				 ocut =i2;
++				else if   ((dt[i=VerticesOfTriangularEdge[i0][0]] == 0) &&
++							( dt[j=VerticesOfTriangularEdge[i0][1]] >  0))
++				 ocut =i0;
++				else  if ((dt[i=VerticesOfTriangularEdge[i1][0]] == 0) &&
++							(dt[j=VerticesOfTriangularEdge[i1][1]] >  0))
++				 ocut =i1;
++				else  if ((dt[i=VerticesOfTriangularEdge[i2][0]] == 0) && 
++							(dt[j=VerticesOfTriangularEdge[i2][1]] >  0))
++				 ocut =i2;
++				else if   ((dt[i=VerticesOfTriangularEdge[i0][0]] <  0) &&
++							( dt[j=VerticesOfTriangularEdge[i0][1]] == 0))
++				 ocut =i0;
++				else  if ((dt[i=VerticesOfTriangularEdge[i1][0]] <  0) &&
++							(dt[j=VerticesOfTriangularEdge[i1][1]] == 0))
++				 ocut =i1;
++				else  if ((dt[i=VerticesOfTriangularEdge[i2][0]] <  0) && 
++							(dt[j=VerticesOfTriangularEdge[i2][1]] == 0))
++				 ocut =i2;
++				else { //  On a edge (2 zero)
++					k =0;
++					if (dt[0]) ocut=0,k++; 
++					if (dt[1]) ocut=1,k++; 
++					if (dt[2]) ocut=2,k++;
++					if(k == 1) {
++						if (dt[ocut] >0) // triangle upper AB
++						 ocut = NextEdge[ocut];
++						i= VerticesOfTriangularEdge[ocut][0];
++						j= VerticesOfTriangularEdge[ocut][1];
++					}
++					else {
++						_error2_("Bug Split Edge");
++					}
++				}
++
++				k = OppositeVertex[ocut];
++
++				Icoor2 detbij = bamg::det((*t)[i],(*t)[j],b);
++
++
++				if (detbij >= 0) { //we find the triangle contening b
++					dt[0]=bamg::det((*t)[1],(*t)[2],b);
++					dt[1]=bamg::det((*t)[2],(*t)[0],b);
++					dt[2]=bamg::det((*t)[0],(*t)[1],b);
++					double dd = t->det;
++					NewItem(t,dt[0]/dd,dt[1]/dd,dt[2]/dd);      
++					return ;}
++				else { // next triangle by  adjacent by edge ocut 
++					deti = dt[i];
++					detj = dt[j];
++					double dij = detj-deti;
++					ba[i] =  detj/dij;
++					ba[j] = -deti/dij;
++					ba[3-i-j ] = 0;
++					ilast=NewItem(t, ba[0],ba[1],ba[2]);      
++
++					AdjacentTriangle ta =t->Adj(ocut);
++					t = ta;
++					iedge= ta; 
++					if (t->det <= 0)  {
++						double ba,bb;
++						AdjacentTriangle edge=CloseBoundaryEdge(b,t,ba,bb);
++						NewItem(B,Metric(ba,*edge.EdgeVertex(0),bb,*edge.EdgeVertex(1)));
++						return;
++					}
++				}// we  go outside of omega 
++		} // for(;;)
++	}
++	/*}}}*/
++
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.h	(revision 12821)
+@@ -0,0 +1,68 @@
++#ifndef _GEOMETRY_H_
++#define _GEOMETRY_H_
++
++#include "./include.h"
++#include "./BamgGeom.h"
++#include "./BamgOpts.h"
++#include "./GeomVertex.h"
++#include "./GeomEdge.h"
++#include "./Curve.h"
++
++namespace bamg {
++
++	class Triangle;
++	class BamgQuadtree;
++	class GeomSubDomain;
++	class Edge;
++
++	class Geometry { 
++
++		public:
++
++			long           NbRef;                 // counter of ref on the this class if 0 we can delete
++			long           nbv;                   // number of vertices
++			long           nbe;                   // number of edges
++			long           nbsubdomains;
++			long           nbcurves;
++			GeomVertex    *vertices;
++			GeomEdge      *edges;
++			BamgQuadtree  *quadtree;
++			GeomSubDomain *subdomains;
++			Curve         *curves;
++			R2             pmin,pmax;             // domain extrema coordinates
++			double         coefIcoor;             // coef to integer Icoor1;
++			double         MaxCornerAngle;
++
++			//Constructor/Destructors
++			~Geometry(); 
++			Geometry();
++			Geometry(const Geometry & Gh);
++			Geometry(BamgGeom* bamggeom, BamgOpts* bamgopts);
++
++			//Operators
++			const GeomVertex &operator[](long i) const { return vertices[i]; };
++			GeomVertex       &operator[](long i) { return vertices[i];       };
++			const GeomEdge   &operator()(long i) const { return edges[i];    };
++			GeomEdge         &operator()(long  i) { return edges[i];         };
++
++			//Methods
++			void             Echo();
++			I2               R2ToI2(const R2 &P) const;
++			double           MinimalHmin();
++			double           MaximalHmax();
++			void             ReadGeometry(BamgGeom *bamggeom, BamgOpts*bamgopts);
++			void             Init(void);
++			void             PostRead();
++			long             GetId(const GeomVertex &t) const;
++			long             GetId(const GeomVertex *t) const;
++			long             GetId(const GeomEdge &t) const;
++			long             GetId(const GeomEdge *t) const;
++			long             GetId(const Curve *c) const;
++			void             UnMarkEdges();
++			GeomEdge *ProjectOnCurve(const Edge &,double,BamgVertex &,VertexOnGeom &) const;
++			GeomEdge *Containing(const R2 P, GeomEdge *start) const;
++			void             WriteGeometry(BamgGeom *bamggeom, BamgOpts*bamgopts);
++	};
++	
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/AdjacentTriangle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/AdjacentTriangle.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/AdjacentTriangle.h	(revision 12821)
+@@ -0,0 +1,46 @@
++#ifndef _TRIANGLEADJACENT_H_
++#define _TRIANGLEADJACENT_H_
++
++#include "./include.h"
++#include "./BamgVertex.h"
++
++namespace bamg {
++
++	//classes
++	class Triangle;
++	class Triangle;
++
++	class AdjacentTriangle {
++
++		public:
++			Triangle* t; //pointer toward the triangle
++			int  a;      //Edge number
++
++			//Constructors
++			AdjacentTriangle():a(0),t(NULL) {};
++			AdjacentTriangle(Triangle* tt,int  aa): t(tt),a(aa &3) {};
++
++			//Operators
++			operator Triangle * () const {return t;}
++			operator Triangle & () const {return *t;}
++			operator int() const {return a;}
++			AdjacentTriangle & operator++(){ a= NextEdge[a]; return *this; }
++			AdjacentTriangle operator--(){ a= PreviousEdge[a]; return *this; }
++
++			//Methods
++
++			//Methods
++			int  Locked() const;
++			int  MarkUnSwap() const;
++			int  GetAllFlag_UnSwap() const;
++			void SetLock();
++			void SetAdj2(const AdjacentTriangle &ta, int l=0);
++			int  swap();
++			AdjacentTriangle Adj() const;
++			BamgVertex* EdgeVertex(const int & i) const;
++			BamgVertex* OppositeVertex() const;
++			Icoor2& det() const;
++	};
++}
++#endif
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnEdge.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnEdge.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnEdge.h	(revision 12821)
+@@ -0,0 +1,36 @@
++#ifndef _VERTEXONEDGE_H_
++#define _VERTEXONEDGE_H_
++
++#include "./include.h"
++#include "./Edge.h"
++
++namespace bamg {
++
++	//classes
++	class Mesh;
++	class BamgVertex;
++
++	class VertexOnEdge {
++
++		public:
++			BamgVertex* v;
++			Edge*   be;
++			double abcisse;
++
++			//Constructors
++			VertexOnEdge(BamgVertex * w, Edge *bw,double s) :v(w),be(bw),abcisse(s) {};
++			VertexOnEdge(){};
++
++			//Operators
++			operator double () const { return abcisse;}
++			operator BamgVertex* () const { return v;}  
++			operator Edge* () const { return be;}  
++			BamgVertex & operator[](int i) const { return (*be)[i];}
++
++			//Methods
++			void SetOnBTh();
++			void Set(const Mesh &,long,Mesh &);  
++	};
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Triangle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Triangle.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Triangle.cpp	(revision 12821)
+@@ -0,0 +1,491 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "../objects.h"
++
++namespace bamg {
++
++	/*Constructors/Destructors*/
++	/*FUNCTION Triangle(){{{*/
++	Triangle::Triangle(void){
++
++	}
++	/*}}}*/
++	/*FUNCTION 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){
++			_error2_("i<0 || j<0 || k<0");
++		}
++		if (i>=nbv || j>=nbv || k>=nbv){
++			_error2_("i>=nbv || j>=nbv || k>=nbv");
++		}
++		vertices[0]=v+i;
++		vertices[1]=v+j;
++		vertices[2]=v+k;
++		adj[0]=adj[1]=adj[2]=0;
++		AdjEdgeIndex[0]=AdjEdgeIndex[1]=AdjEdgeIndex[2]=0;
++		det=0;
++	}
++	/*}}}*/
++	/*FUNCTION Triangle(BamgVertex *v0,BamgVertex *v1,BamgVertex *v2) {{{*/
++	Triangle::Triangle(BamgVertex *v0,BamgVertex *v1,BamgVertex *v2){
++		vertices[0]=v0;
++		vertices[1]=v1;
++		vertices[2]=v2;
++		adj[0]=adj[1]=adj[2]=0;
++		AdjEdgeIndex[0]=AdjEdgeIndex[1]=AdjEdgeIndex[2]=0;
++		if (v0) det=0;
++		else {
++			det=-1;
++			link=NULL;};  
++	}
++	/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION Triangle::Adj{{{*/
++	AdjacentTriangle Triangle::Adj(int i)  const {
++		return AdjacentTriangle(adj[i],AdjEdgeIndex[i]&3);
++	};/*}}}*/
++	/*FUNCTION Triangle::Anisotropy{{{*/
++	double Triangle::Anisotropy() const{
++
++		double lmin,lmax;
++
++		/*Get three vertices A,B and C*/
++		R2 A=*this->vertices[0];
++		R2 B=*this->vertices[1];
++		R2 C=*this->vertices[2];
++
++		/*Compute edges*/
++		R2 e1=B-A;
++		R2 e2=C-A;
++		R2 e3=B-C;
++
++		/*Compute edge length*/
++		double l1=Norme2(e1);
++		double l2=Norme2(e2);
++		double l3=Norme2(e3);
++
++		lmin=l1;
++		lmin=min(lmin,l2);
++		lmin=min(lmin,l3);
++		lmax=l1;
++		lmax=max(lmax,l2);
++		lmax=max(lmax,l3);
++
++		return lmax/lmin;
++	};/*}}}*/
++	/*FUNCTION Triangle::Length{{{*/
++	double Triangle::Length() const{
++
++		double l;
++
++		/*Get three vertices A,B and C*/
++		R2 A=*this->vertices[0];
++		R2 B=*this->vertices[1];
++		R2 C=*this->vertices[2];
++
++		/*Compute edges*/
++		R2 e1=B-A;
++		R2 e2=C-A;
++		R2 e3=B-C;
++
++		/*Compute edge length*/
++		l=Norme2(e1);
++		l=max(l,Norme2(e2));
++		l=max(l,Norme2(e3));
++
++		return l;
++	};/*}}}*/
++	/*FUNCTION Triangle::Echo {{{*/
++	void Triangle::Echo(void){
++
++		int i;
++
++		_printLine_("Triangle:");
++		_printLine_("   vertices pointer towards three vertices");
++		_printLine_("      vertices[0] vertices[1] vertices[2] = " << vertices[0] << " " << vertices[1] << " " << vertices[2]);
++		_printLine_("   adj pointer towards three adjacent triangles");
++		_printLine_("      adj[0] adj[1] adj[2] = " << adj[0] << " " << adj[1] << " " << adj[2]);
++		_printLine_("   det (integer triangle determinant) = " << det);
++		if (link){
++			_printLine_("   link (pointer toward duplicate triangle)= " << link);
++		}
++		else{
++			_printLine_("   color = " << color);
++		}
++
++		_printLine_("\nThree vertices:");
++		for(i=0;i<3;i++){
++			if (vertices[i]){
++				vertices[i]->Echo();
++			}
++			else{
++				_printLine_("   vertex " << i+1 << " does not exist");
++			}
++		}
++
++		return;
++	}
++	/*}}}*/
++	/*FUNCTION Triangle::FindBoundaryEdge{{{*/
++	AdjacentTriangle Triangle::FindBoundaryEdge(int i) const{
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/FindBoundaryEdge)*/
++
++		/*Intermediary*/
++		Triangle* ttc=NULL;
++		int k,j,jc;
++
++		// call current triangle t
++		Triangle* t = (Triangle*)this;
++
++		//is the current triangle inside or outside?
++		int outside=!link  ;
++
++		// EdgesVertexTriangle[3][2] = {{1,2},{2,0},{0,1}};
++		// initialize j as the first vertex of the ith edge
++		j=EdgesVertexTriangle[i][0];
++
++		//Loop over the adjacent triangle of t
++		k=0;
++		do{
++			//keep track of outside
++			int outsidep = outside;
++			//increment k
++			k++;
++			//Get ttc, adjacent triangle of t with respect to vertex j
++			ttc =  t->adj[j];
++			//is the current triangle inside or outside?
++			outside = !ttc->link;
++			//if both previous triangle are outside, return
++			if (outside+outsidep == 1) return AdjacentTriangle(t,j);
++
++			//update t and j
++			t = ttc;
++			//NextEdge[3] = {1,2,0};
++			jc = NextEdge[t->AdjEdgeIndex[j]&3];
++			j = NextEdge[jc];
++
++			//check number of iterations
++			if (k>=2000){
++				_error2_("too many iteration in Triangle::FindBoundaryEdge (k>=2000)");
++			}
++		} while (this!= t);
++		//not found, return empty triangle
++		return AdjacentTriangle(NULL,0);
++	}
++	/*}}}*/
++	/*FUNCTION Triangle::GetAllflag{{{*/
++	int    Triangle::GetAllflag(int a){
++		return AdjEdgeIndex[a] & 1020;
++	}/*}}}*/
++	/*FUNCTION Triangle::Hidden{{{*/
++	int    Triangle::Hidden(int a)const {
++		return AdjEdgeIndex[a]&16;
++	} /*}}}*/
++	/*FUNCTION Triangle::Locked{{{*/
++	int    Triangle::Locked(int a)const {
++		return AdjEdgeIndex[a]&4;
++	} /*}}}*/
++	/*FUNCTION Triangle::NuEdgeTriangleAdj{{{*/
++	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) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Optim)*/
++
++		// turn around (positive direction)
++		Triangle *t=this;
++		long NbSwap =0;
++		int  k = 0;
++		int  j = OppositeEdge[i];
++		int  jp= PreviousEdge[j];
++
++		// initialize tp, jp the previous triangle & edge
++		Triangle *tp=adj[jp];
++		jp = AdjEdgeIndex[jp]&3;
++		do {
++			while (t->swap(j,koption)){
++				if (k>=20000) _error2_("k>=20000");
++				NbSwap++;
++				k++;
++				t=  tp->adj[jp];      // set unchange t qnd j for previous triangles
++				j=  NextEdge[tp->AdjEdgeIndex[jp]&3];
++			}
++			// end on this  Triangle 
++			tp = t;
++			jp = NextEdge[j];
++
++			t=  tp->adj[jp];      // set unchange t qnd j for previous triangles
++			j=  NextEdge[tp->AdjEdgeIndex[jp]&3];
++
++		} while( t != this);
++		return NbSwap;
++	}
++	/*}}}*/
++	/*FUNCTION Triangle::Quadrangle {{{*/
++	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) {
++			int a=-1;
++			if (AdjEdgeIndex[0] & 16 ) a=0;
++			if (AdjEdgeIndex[1] & 16 ) a=1;
++			if (AdjEdgeIndex[2] & 16 ) a=2;
++			if (a>=0) {
++				t = adj[a];
++				//  if (t-this<0) return 0;
++				v2 = vertices[VerticesOfTriangularEdge[a][0]];
++				v0 = vertices[VerticesOfTriangularEdge[a][1]];
++				v1 = vertices[OppositeEdge[a]];
++				v3 = t->vertices[OppositeEdge[AdjEdgeIndex[a]&3]];
++			}
++		}
++		return t;
++	}
++	/*}}}*/
++	/*FUNCTION Triangle::QualityQuad {{{*/
++	double   Triangle::QualityQuad(int a,int option) const{
++		double q;
++		if (!link || AdjEdgeIndex[a] &4)
++		 q=  -1;
++		else {
++			Triangle * t = adj[a];
++			if (t-this<0) q=  -1;// because we do 2 times 
++			else if (!t->link ) q=  -1;
++			else if (AdjEdgeIndex[0] & 16 || AdjEdgeIndex[1] & 16  || AdjEdgeIndex[2] & 16 || t->AdjEdgeIndex[0] & 16 || t->AdjEdgeIndex[1] & 16 || t->AdjEdgeIndex[2] & 16 )
++			 q= -1;
++			else if(option){ 
++				const BamgVertex & v2 = *vertices[VerticesOfTriangularEdge[a][0]];
++				const BamgVertex & v0 = *vertices[VerticesOfTriangularEdge[a][1]];
++				const BamgVertex & v1 = *vertices[OppositeEdge[a]];
++				const BamgVertex & v3 = * t->vertices[OppositeEdge[AdjEdgeIndex[a]&3]];
++				q =  QuadQuality(v0,v1,v2,v3); // do the float part
++			}
++			else q= 1;
++		}
++		return  q;
++	}
++	/*}}}*/
++	/*FUNCTION 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){
++		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){ 
++		*this = rec;
++		if ( vertices[0] ) vertices[0] = ThNew.vertices +  Th.GetId(vertices[0]);
++		if ( vertices[1] ) vertices[1] = ThNew.vertices +  Th.GetId(vertices[1]);
++		if ( vertices[2] ) vertices[2] = ThNew.vertices +  Th.GetId(vertices[2]);
++		if(adj[0]) adj[0] =  ThNew.triangles + Th.GetId(adj[0]);
++		if(adj[1]) adj[1] =  ThNew.triangles + Th.GetId(adj[1]);
++		if(adj[2]) adj[2] =  ThNew.triangles + Th.GetId(adj[2]);
++		if (link  >= Th.triangles && link  < Th.triangles + Th.nbt)
++		 link = ThNew.triangles + Th.GetId(link);
++	}
++	/*}}}*/
++	/*FUNCTION Triangle::SetAdjAdj{{{*/
++	void Triangle::SetAdjAdj(short a){
++		// Copy all the mark 
++		a &= 3;
++		register Triangle *tt=adj[a];
++		AdjEdgeIndex [a] &= 55; // remove MarkUnSwap
++		register short aatt = AdjEdgeIndex[a] & 3;
++		if(tt){ 
++			tt->adj[aatt]=this;
++			tt->AdjEdgeIndex[aatt]=a + (AdjEdgeIndex[a] & 60 ) ;
++		}
++	}/*}}}*/
++	/*FUNCTION Triangle::SetAdj2{{{*/
++	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
++		 * - aat is the index of the same edge in the adjacent triangle*/
++		adj[a]=t;
++		AdjEdgeIndex[a]=aat;
++		if(t){ //if t!=NULL add adjacent triangle to t (this)
++			t->adj[aat]=this;
++			t->AdjEdgeIndex[aat]=a;
++		}
++	}/*}}}*/
++	/*FUNCTION Triangle::SetAllFlag{{{*/
++	void   Triangle::SetAllFlag(int a,int f){
++		AdjEdgeIndex[a] = (AdjEdgeIndex[a] &3) + (1020 & f);
++	}/*}}}*/
++	/*FUNCTION Triangle::SetDet{{{*/
++	void Triangle::SetDet() {
++		if(vertices[0] && vertices[1] && vertices[2])    det = bamg::det(*vertices[0],*vertices[1],*vertices[2]);
++		else det = -1; 
++	}/*}}}*/
++	/*FUNCTION Triangle::SetHidden{{{*/
++	void Triangle::SetHidden(int a){
++		//Get Adjacent Triangle number a
++		register Triangle* t = adj[a];
++		//if it exist
++		//C|=D -> C=(C|D) bitwise inclusive OR
++		if(t) t->AdjEdgeIndex[AdjEdgeIndex[a] & 3] |=16;
++		AdjEdgeIndex[a] |= 16;
++	}/*}}}*/
++	/*FUNCTION Triangle::SetLocked{{{*/
++	void Triangle::SetLocked(int a){
++		//mark the edge as on Boundary
++		register Triangle * t = adj[a];
++		t->AdjEdgeIndex[AdjEdgeIndex[a] & 3] |=4;
++		AdjEdgeIndex[a] |= 4;
++	}/*}}}*/
++	/*FUNCTION Triangle::SetMarkUnSwap{{{*/
++	void Triangle::SetMarkUnSwap(int a){
++		register Triangle * t = adj[a];
++		t->AdjEdgeIndex[AdjEdgeIndex[a] & 3] |=8;
++		AdjEdgeIndex[a] |=8 ;
++	}/*}}}*/
++	/*FUNCTION 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){ 
++		register 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){
++		/*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
++
++		register Triangle *t1=this,*t2=adj[a];// les 2 triangles adjacent
++		register short a1=a,a2=AdjEdgeIndex[a];// les 2 numero de l arete dans les 2 triangles
++		if(a2/4 !=0) return 0; // arete lock or MarkUnSwap
++
++		register BamgVertex  *sa=t1->vertices[VerticesOfTriangularEdge[a1][0]];
++		register BamgVertex  *sb=t1->vertices[VerticesOfTriangularEdge[a1][1]];
++		register BamgVertex  *s1=t1->vertices[OppositeVertex[a1]];
++		register BamgVertex  *s2=t2->vertices[OppositeVertex[a2]];
++
++		Icoor2 det1=t1->det , det2=t2->det ;
++		Icoor2 detT = det1+det2;
++		Icoor2 detA = Abs(det1) + Abs(det2);
++		Icoor2 detMin = Min(det1,det2);
++
++		int OnSwap = 0;       
++		// si 2 triangle infini (bord) => detT = -2;
++		if (sa == 0) {// les deux triangles sont frontieres
++			det2=bamg::det(s2->i,sb->i,s1->i);
++			OnSwap = det2 >0;}
++		else if (sb == 0) { // les deux triangles sont frontieres
++			det1=bamg::det(s1->i,sa->i,s2->i);
++			OnSwap = det1 >0;}
++		else if(( s1 != 0) && (s2 != 0) ) {
++			det1 = bamg::det(s1->i,sa->i,s2->i);
++			det2 = detT - det1;
++			OnSwap = (Abs(det1) + Abs(det2)) < detA;
++
++			Icoor2 detMinNew=Min(det1,det2);
++			//     if (detMin<0 && (Abs(det1) + Abs(det2) == detA)) OnSwap=BinaryRand();// just for test   
++			if (! OnSwap &&(detMinNew>0)) {
++				OnSwap = detMin ==0;
++				if (! OnSwap) {
++					int  kopt = koption;
++					while (1)
++					 if(kopt) {
++						 // critere de Delaunay pure isotrope
++						 register Icoor2 xb1 = sb->i.x - s1->i.x,
++									 x21 = s2->i.x - s1->i.x,
++									 yb1 = sb->i.y - s1->i.y,
++									 y21 = s2->i.y - s1->i.y,
++									 xba = sb->i.x - sa->i.x, 
++									 x2a = s2->i.x - sa->i.x,
++									 yba = sb->i.y - sa->i.y,
++									 y2a = s2->i.y - sa->i.y;
++						 register double
++							cosb12 =  double(xb1*x21 + yb1*y21),
++									 cosba2 =  double(xba*x2a + yba*y2a) ,
++									 sinb12 = double(det2),
++									 sinba2 = double(t2->det);
++
++
++						 // angle b12 > angle ba2 => cotg(angle b12) < cotg(angle ba2)
++						 OnSwap =  ((double) cosb12 * (double)  sinba2) <  ((double) cosba2 * (double) sinb12);
++						 break;
++					 }
++					 else {	
++						 // critere de Delaunay anisotrope 
++						 double som;
++						 I2 AB=(I2) *sb - (I2) *sa;
++						 I2 MAB2=((I2) *sb + (I2) *sa);
++						 R2 MAB(MAB2.x*0.5,MAB2.y*0.5);
++						 I2 A1=(I2) *s1 - (I2) *sa;
++						 I2 D = (I2) * s1 - (I2) * sb ;
++						 R2 S2(s2->i.x,s2->i.y);
++						 R2 S1(s1->i.x,s1->i.y);
++							{
++							 Metric M=s1->m;
++							 R2 ABo = M.Orthogonal(AB);
++							 R2 A1o = M.Orthogonal(A1);
++							 // (A+B)+ x ABo = (S1+B)/2+ y A1 
++							 // ABo x - A1o y =  (S1+B)/2-(A+B)/2 = (S1-B)/2 = D/2
++							 double dd = Abs(ABo.x*A1o.y)+Abs(ABo.y*A1o.x);
++							 double d = (ABo.x*A1o.y - ABo.y*A1o.x)*2; // because D/2
++							 if (Abs(d) > dd*1.e-3) {
++								 R2 C(MAB+ABo*((D.x*A1o.y - D.y*A1o.x)/d));
++								 som  = M(C - S2)/M(C - S1);
++							 } else 
++								{kopt=1;continue;}
++
++							}
++							{
++							 Metric M=s2->m;
++							 R2 ABo = M.Orthogonal(AB);
++							 R2 A1o = M.Orthogonal(A1);
++							 // (A+B)+ x ABo = (S1+B)/2+ y A1 
++							 // ABo x - A1o y =  (S1+B)/2-(A+B)/2 = (S1-B)/2 = D/2 
++							 double dd = Abs(ABo.x*A1o.y)+Abs(ABo.y*A1o.x);
++							 double d = (ABo.x*A1o.y - ABo.y*A1o.x)*2; // because D/2
++							 if(Abs(d) > dd*1.e-3) {
++								 R2 C(MAB+ABo*((D.x*A1o.y - D.y*A1o.x)/d));
++								 som  += M(C - S2)/M(C -  S1);
++							 } else 
++								{kopt=1;continue;}
++							}
++						 OnSwap = som < 2;
++						 break;
++					 }
++
++				} // OnSwap 
++			} // (! OnSwap &&(det1 > 0) && (det2 > 0) )
++		}
++		if( OnSwap ) 
++		 bamg::swap(t1,a1,t2,a2,s1,s2,det1,det2);
++		else {
++			t1->SetMarkUnSwap(a1);     
++		}
++		return OnSwap;
++	}
++	/*}}}*/
++	/*FUNCTION Triangle::TriangleAdj{{{*/
++	Triangle* Triangle::TriangleAdj(int i) const {
++		return adj[i&3];
++	}/*}}}*/
++
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h	(revision 12821)
+@@ -0,0 +1,60 @@
++/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, BamgQuadtree.h)*/
++#ifndef _BAMGQUADTREE_H
++#define _BAMGQUADTREE_H
++
++#include "./include.h"
++
++namespace bamg {
++
++	const int  MaxDepth = 30;
++	const long MaxISize = ( 1L << MaxDepth);  // = 2^30 : 010000000000..000 (bitwise operation)
++
++	class BamgVertex;
++
++	class BamgQuadtree{
++
++		private:
++
++			/*A quadtree box contains a maximum of 4 vertices. 4 other quadtree boxes are
++			 * created if a fifth vertex is added to the same box. A Quadtree box is therefore
++			 * composed of EITHER:
++			 * - up to 4 vertices
++			 * - 4 "sub" quadtree boxes*/
++			class BamgQuadtreeBox: public Object{ 
++				public:
++					int nbitems; // number of current vertices in the box
++					union{
++						BamgQuadtreeBox* b[4];
++						BamgVertex*  v[4];
++					};
++					/*Object functions*/
++					void    Echo()       {_error2_("not implemented yet"); };
++					void    DeepEcho()   {_error2_("not implemented yet"); };
++					int     Id()         {_error2_("not implemented yet"); };
++					int     MyRank()     {_error2_("not implemented yet"); };
++					int     ObjectEnum() {_error2_("not implemented yet"); };
++					Object *copy()       {_error2_("not implemented yet"); };
++			};
++
++			/*BamgQuadtree private Fields*/
++			DataSet* boxcontainer;
++
++		public:
++
++			/*BamgQuadtree public Fields*/
++			BamgQuadtreeBox* root;
++			long         NbBamgQuadtreeBox;
++			long         NbVertices;
++
++			BamgQuadtree();
++			BamgQuadtree(Mesh *t,long nbv=-1);
++			~BamgQuadtree();
++
++			BamgVertex      *NearestVertex(Icoor1 i,Icoor1 j);
++			BamgVertex      *NearestVertexWithNormal(Icoor1  i,Icoor1 j);
++			BamgQuadtreeBox *NewBamgQuadtreeBox(void);
++			BamgVertex      *ToClose(BamgVertex &,double ,Icoor1,Icoor1);
++			void             Add(BamgVertex &w);
++	};
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnVertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnVertex.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnVertex.cpp	(revision 12821)
+@@ -0,0 +1,34 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "VertexOnVertex.h"
++#include "Mesh.h"
++
++namespace bamg {
++
++	/*Constructors/Destructors*/
++	/*FUNCTION 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){
++	
++	}/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION VertexOnVertex::Set{{{*/
++	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(){
++		v->BackgroundVertexHook=bv;v->IndexInTriangle=IsVertexOnVertex;
++	}/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Edge.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Edge.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Edge.h	(revision 12821)
+@@ -0,0 +1,38 @@
++#ifndef _EDGE_H_
++#define _EDGE_H_
++
++#include "./include.h"
++#include "./BamgVertex.h"
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "./GeomEdge.h"
++
++namespace bamg {
++
++	//classes
++	class Mesh;
++	
++	class Edge {
++
++		public:
++			BamgVertex      *v[2];
++			long             ReferenceNumber;
++			GeomEdge *GeomEdgeHook;
++			Edge            *adj[2];       // the 2 adj edges if on the same curve
++
++			//Operators
++			BamgVertex       &operator[](int i){return *v[i];   };
++			BamgVertex       *operator()(int     i){return v[i];};
++			R2                operator()(double  t) const;// return the point
++			const BamgVertex &operator[](int i) const{return *v[i];};
++
++			//Methods
++			void Renumbering(BamgVertex *vb,BamgVertex *ve, long *renu);
++			int  Intersection(const  Edge & e);
++			void Set(const Mesh &,long,Mesh &);
++			void Echo(void);
++
++	};
++}
++#endif
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgVertex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgVertex.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgVertex.h	(revision 12821)
+@@ -0,0 +1,58 @@
++#ifndef _BAMGVERTEX_H_
++#define _BAMGVERTEX_H_
++
++#include "./include.h"
++#include "./Metric.h"
++#include "./Direction.h"
++#include "./BamgOpts.h"
++
++namespace bamg {
++
++	//classes
++	class Triangle;
++	class Mesh;
++	class VertexOnGeom;
++	class VertexOnEdge;
++
++	class BamgVertex {
++
++		public:
++
++			/*Fields*/
++			I2        i;                 // integer coordinates
++			R2        r;                 // real coordinates
++			Metric    m;
++			long      ReferenceNumber;
++			Direction DirOfSearch;
++			short     IndexInTriangle;              // the vertex number in triangle; varies between 0 and 2 in t
++
++			union {
++				Triangle     *t;                      // one triangle which is containing the vertex
++				long          color;
++				BamgVertex   *MeshVertexHook;         // used in geometry BamgVertex to know the Mesh Vertex associated
++				VertexOnGeom *GeomEdgeHook;    // if IndexInTriangle == 8; // set with Mesh::SetVertexFieldOn()
++				BamgVertex   *BackgroundVertexHook;   // if IndexInTriangle == 16 on Background vertex Mesh::SetVertexFieldOnBTh()
++				VertexOnEdge *BackgroundEdgeHook;     // if IndexInTriangle == 32 on Background edge
++			};
++
++			/*Operators*/
++			operator I2() const {return i;}             // Cast operator
++			operator const R2 & () const {return r;}    // Cast operator
++			operator Metric () const {return m;}        // Cast operator
++			double operator()(R2 x) const { return m(x);} // Get x in the metric m
++
++			/*methods (No constructor and no destructors...)*/
++			double Smoothing(Mesh & ,const Mesh & ,Triangle  * & ,double =1);
++			void   MetricFromHessian(const double Hxx,const double Hyx, const double Hyy, const double smin,const double smax,const double s,const double err,BamgOpts* bamgopts);
++			void   Echo();
++			int    GetReferenceNumber() const;
++			long   Optim(int =1,int =0); 
++
++			//inline functions
++			inline void Set(const BamgVertex &rec,const Mesh & ,Mesh & ){*this=rec;}
++	};
++
++	//Intermediary
++	double QuadQuality(const BamgVertex &,const BamgVertex &,const BamgVertex &,const BamgVertex &);
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgOpts.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgOpts.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgOpts.cpp	(revision 12821)
+@@ -0,0 +1,89 @@
++#include <stdio.h>
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../objects.h"
++#include "../../io/io.h"
++
++/*Constructors/Destructors*/
++/*FUNCTION BamgOpts::BamgOpts() {{{*/
++BamgOpts::BamgOpts(){
++
++	this->anisomax=0;
++	this->cutoff=0;
++	this->coeff=0;
++	this->errg=0;
++	this->gradation=0;
++	this->Hessiantype=0;
++	this->MaxCornerAngle=0;
++	this->maxnbv=0;
++	this->maxsubdiv=0;
++	this->Metrictype=0;
++	this->nbjacobi=0;
++	this->nbsmooth=0;
++	this->omega=0;
++	this->power=0;
++	this->verbose=0;
++
++	this->Crack=0;
++	this->geometricalmetric=0;
++	this->KeepVertices=0;
++	this->splitcorners=0;
++
++	this->hmin=0;
++	this->hmax=0;
++	this->hminVertices=NULL; this->hminVerticesSize[0]=this->hminVerticesSize[1]=0;
++	this->hmaxVertices=NULL; this->hmaxVerticesSize[0]=this->hmaxVerticesSize[1]=0;
++	this->hVertices=NULL;    this->hVerticesSize[0]=this->hVerticesSize[1]=0;
++	this->metric=NULL;       this->metricSize[0]=this->metricSize[1]=0;
++	this->field=NULL;        this->fieldSize[0]=this->fieldSize[1]=0;
++	this->err=NULL;          this->errSize[0]=this->errSize[1]=0;
++
++}
++/*}}}*/
++/*FUNCTION BamgOpts::~BamgOpts() {{{*/
++BamgOpts::~BamgOpts(){
++
++	xDelete<double>(this->hminVertices);
++	xDelete<double>(this->hmaxVertices);
++	xDelete<double>(this->hVertices);
++	xDelete<double>(this->metric);
++	xDelete<double>(this->field);
++	xDelete<double>(this->err);
++
++}
++/*}}}*/
++
++/*Methods*/
++/*FUNCTION BamgOpts::Check{{{*/
++void BamgOpts::Check(void){
++
++	int i;
++
++	if (this->anisomax<1) _error2_("'anisomax' option should be >=1");
++	if (this->coeff==0) _error2_("'coeff' should be positive");
++	if (this->errg<0) _error2_("'errg' option should be >0");
++	if (this->gradation<1) _error2_("'gradation' option should be >=1");
++	if (this->Hessiantype!=0  && this->Hessiantype!=1) _error2_("'Hessiantype' supported options are 0 and 1");
++	if (this->maxnbv<3) _error2_("'maxnbv' option should be >3");
++	if (this->maxsubdiv<=1) _error2_("'maxsubdiv' should be >1");
++	if (this->Metrictype!=0   && this->Metrictype!=1 && this->Metrictype!=2) _error2_("'Metrictype' supported options are 0, 1 and 2");
++	if (this->nbjacobi<=0) _error2_("'nbjacobi' option should be >0");
++	if (this->nbsmooth<=0) _error2_("'nbsmooth' option should be >0");
++
++	if (this->Crack!=0  && this->Crack!=1) _error2_("'Crack' supported options are 0 and 1");
++	if (this->KeepVertices!=0 && this->KeepVertices!=1) _error2_("'KeepVertices' supported options are 0 and 1");
++	if (this->geometricalmetric!=0  && this->geometricalmetric!=1) _error2_("'geometricalmetric' supported options are 0 and 1");
++
++	if (this->hmin<=0) _error2_("'hmin' option should be >0");
++	if (this->hmax<=0 || this->hmax<this->hmin) _error2_("'hmax' option should be between 0 and hmin=" << this->hmin);
++	if (this->hminVertices && this->hminVerticesSize[1]!=1) _error2_("'hminVertices' should be a column");
++	if (this->hmaxVertices && this->hmaxVerticesSize[1]!=1) _error2_("'hmaxVertices' should be a column");
++	if (this->hVertices && this->hVerticesSize[1]!=1) _error2_("'hVertices' should be a column");
++	if (this->metric && (this->metricSize[1]!=1 && this->metricSize[1]!=3)) _error2_("'metric' should have either 1 (iso) or 3 (aniso) columns.");
++	if (this->field){
++		if (this->errSize[0]!=1 || this->errSize[1]!=this->fieldSize[1]) _error2_("'err' should be of size " << 1 << " x " << this->fieldSize[1]);
++		for (i=0;i<this->fieldSize[1];i++) {if (this->err[i]<=0) _error2_("'err' option should be >0");};
++	}
++
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgGeom.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgGeom.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgGeom.cpp	(revision 12821)
+@@ -0,0 +1,34 @@
++#include <stdio.h>
++#include "../objects.h"
++#include "../../io/io.h"
++#include "../../shared/shared.h"
++
++/*Constructors/Destructors*/
++/*FUNCTION 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;
++	this->TangentAtEdgesSize[0]=0,    this->TangentAtEdgesSize[1]=0;    this->TangentAtEdges=NULL;
++	this->CornersSize[0]=0,           this->CornersSize[1]=0;           this->Corners=NULL;
++	this->RequiredVerticesSize[0]=0,  this->RequiredVerticesSize[1]=0;  this->RequiredVertices=NULL;
++	this->RequiredEdgesSize[0]=0,     this->RequiredEdgesSize[1]=0;     this->RequiredEdges=NULL;
++	this->CrackedEdgesSize[0]=0,      this->CrackedEdgesSize[1]=0;      this->CrackedEdges=NULL;
++	this->SubDomainsSize[0]=0,        this->SubDomainsSize[1]=0;        this->SubDomains=NULL;
++
++}
++/*}}}*/
++/*FUNCTION BamgGeom::~BamgGeom(){{{*/
++BamgGeom::~BamgGeom(){
++
++	xDelete<double>(this->Vertices);
++	xDelete<double>(this->Edges);
++	xDelete<double>(this->TangentAtEdges);
++	xDelete<double>(this->Corners);
++	xDelete<double>(this->RequiredVertices);
++	xDelete<double>(this->RequiredEdges);
++	xDelete<double>(this->CrackedEdges);
++	xDelete<double>(this->SubDomains);
++
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SetOfE4.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SetOfE4.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SetOfE4.h	(revision 12821)
+@@ -0,0 +1,42 @@
++#ifndef _SetOfEdge4_h
++#define _SetOfEdge4_h
++
++namespace bamg {
++
++	class SetOfEdges4;
++
++	class IntEdge{
++		friend class SetOfEdges4;
++		public:
++		long i,j;
++		long next; 
++	};
++
++	class SetOfEdges4 {
++
++		private:
++			long nx,nbax,NbOfEdges;
++			long* head; 
++			IntEdge* Edges;
++
++		public:
++
++			// Constructors
++			SetOfEdges4(long ,long);// nb Edges mx , nb de sommet 
++			~SetOfEdges4() {delete [] head; delete [] Edges;}
++
++			//operators
++			IntEdge & operator[](long k){return  Edges[k];}
++
++			//Methods
++			long add (long ii,long jj);
++			long SortAndAdd (long ii,long jj);
++			long nb();
++			long find (long ii,long jj);
++			long SortAndFind (long ii,long jj);
++			long i(long k);
++			long j(long k);
++			long newarete(long k);
++	};
++}
++#endif 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomEdge.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomEdge.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomEdge.h	(revision 12821)
+@@ -0,0 +1,47 @@
++#ifndef _GEOMETRICALEDGE_H_
++#define _GEOMETRICALEDGE_H_
++
++#include "./include.h"
++
++namespace bamg {
++
++	//classes
++	class GeomVertex;
++	class Geometry;
++
++	class GeomEdge {
++
++		public:
++			GeomVertex *v[2];
++			long               ReferenceNumber;
++			long               CurveNumber;
++			R2                 tg[2];              // the 2 tangentes (tg[0] =0 => no continuity)
++			GeomEdge   *Adj[2];
++			int                AdjVertexIndex[2]; // for a given vertex, this gives the index of the vertex in the adjacent edge (0 or 1)
++			int                type;
++
++			//Operators
++			GeomVertex       & operator[](int i){return *v[i];};
++			const GeomVertex & operator[](int i) const { return *v[i];};
++			GeomVertex       * operator()(int i){return v[i];};  
++
++			//Methods
++			R2     F(double theta) const ; // parametrization of the curve edge
++			double R1tg(double theta,R2 &t) const ; // 1/radius of curvature + tangente
++			int    Tg(int i) const;
++			int    Cracked() const;
++			int    TgA()     const;
++			int    TgB()     const;
++			int    Mark()    const;
++			int    Required();
++			void   SetCracked();
++			void   SetTgA();
++			void   SetTgB();
++			void   SetMark();
++			void   SetUnMark();
++			void   SetRequired();
++			void   Set(const GeomEdge & rec,const Geometry & Th ,Geometry & ThNew);
++	};
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/CrackedEdge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/CrackedEdge.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/CrackedEdge.cpp	(revision 12821)
+@@ -0,0 +1,33 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "CrackedEdge.h"
++
++namespace bamg {
++
++	/*Constructors/Destructors*/
++	/*FUNCTION CrackedEdge() {{{*/
++	CrackedEdge::CrackedEdge() {
++		a=NULL;
++		b=NULL;
++		E=NULL;
++		e1=NULL;
++		e2=NULL;
++		indexa[0]=-1;
++		indexa[1]=-1;
++		indexa[2]=-1;
++		indexb[0]=-1;
++		indexb[1]=-1;
++		indexb[2]=-1;
++		length=0;
++		normal.x=0;
++		normal.y=0;
++
++	}
++	/*}}}*/
++
++	/*Methods*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SubDomain.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SubDomain.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SubDomain.cpp	(revision 12821)
+@@ -0,0 +1,28 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "SubDomain.h"
++#include "Mesh.h"
++
++namespace bamg {
++
++	/*Constructors/Destructors*/
++
++	/*Methods*/
++	/*FUNCTION SubDomain::Set {{{*/
++	void SubDomain::Set(const Mesh & Th ,long i,Mesh & ThNew){
++		*this = Th.subdomains[i];
++		if ( head-Th.triangles<0 || head-Th.triangles>=Th.nbt){
++			_error2_("head-Th.triangles<0 || head-Th.triangles>=Th.nbt");
++		}
++		head = ThNew.triangles + Th.GetId(head) ; 
++		if (edge-Th.edges<0 || edge-Th.edges>=Th.nbe);{
++			_error2_("edge-Th.edges<0 || edge-Th.edges>=Th.nbe");
++		}
++		edge = ThNew.edges+ Th.GetId(edge);
++	}
++	/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Metric.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Metric.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Metric.cpp	(revision 12821)
+@@ -0,0 +1,353 @@
++#include <cstdio>
++#include <string.h>
++#include <cmath>
++
++#include "Metric.h"
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++
++using namespace std;
++
++namespace bamg {
++
++	SaveMetricInterpole  LastMetricInterpole;
++
++	/*Constructor/Destructor*/
++	/*FUNCTION Metric::Metric(double 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){
++	
++	}/*}}}*/
++	/*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 ){
++		/*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,
++					a[0]*m0.a21 + a[1]*m1.a21 + a[2]*m2.a21,
++					a[0]*m0.a22 + a[1]*m1.a22 + a[2]*m2.a22);
++
++		EigenMetric vab(mab);
++
++		R2 v1(vab.v.x,vab.v.y);
++		R2 v2(-v1.y,v1.x);
++
++		double h1 = a[0] / m0(v1) + a[1] / m1(v1) + a[2] / m2(v1);
++		double h2 = a[0] / m0(v2) + a[1] / m1(v2) + a[2] / m2(v2);
++
++		vab.lambda1 =  1 / (h1*h1);
++		vab.lambda2 =  1 / (h2*h2);
++		*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) { 
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/EigenMetric)*/
++
++		/*Compute metric (linear combination of ma and mb)*/
++		Metric mab(a*ma.a11+b*mb.a11,a*ma.a21+b*mb.a21,a*ma.a22+b*mb.a22);
++
++		/*Get Eigen values and vectors*/
++		EigenMetric vab(mab);
++		R2 v1(vab.v.x,vab.v.y);
++		R2 v2(-v1.y,v1.x);
++
++		/*Modify eigen values (a+b=1)*/
++		double h1 = a/ma(v1) + b/mb(v1);
++		double h2 = a/ma(v2) + b/mb(v2);
++		vab.lambda1 =  1/(h1*h1);
++		vab.lambda2 =  1/(h2*h2);
++		*this=vab;
++	}
++	/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION Metric::det{{{*/
++	double Metric::det() const {
++		return a11*a22-a21*a21;
++	}  /*}}}*/
++	/*FUNCTION Metric::Echo {{{*/
++	void Metric::Echo(void){
++
++		_printLine_("Metric:");
++		_printLine_("   [a11 a21 a22]: [" << a11 << " " << a21 << " " << a22 << "]");
++
++		return;
++	}
++	/*}}}*/
++	/*FUNCTION Metric::IntersectWith{{{*/
++	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)
++		 * and a new metric given in input M2 using a 
++		 * Simultaneous Matrix Reduction:
++		 * If M1 and M2 are 2 metrics, we must build N=M1^-1 M2 (Alauzet2003 p16) 
++		 * the eigen vectors of N form a matrix P
++		 * The new metric M = M1 inter M2 is then given by:
++		 *
++		 *      -T [ max(lambda1, mu1)          0         ]  -1				 
++		 * M = P   [                                      ] P		 
++		 *         [        0            max(lambda2, mu2)] 
++		 *
++		 * where lambdai and mui can be computed using Rayleigh formula: 
++		 *    lambdai = vi' M1 vi
++		 * with vi eigen vectors of N (columns of P)
++		 */
++
++		int         change=0;
++		Metric &M1=*this;
++		D2xD2       P;
++
++		//Get P, eigen vectors of N=inv(M1) M2
++		SimultaneousMatrixReduction(*this,M2,P);
++
++		//extract the eigen vectors of P (columns)
++		R2 v1(P.x.x,P.y.x);
++		R2 v2(P.x.y,P.y.y);
++
++		//compute lambdai mui
++		double lambda1=M1(v1,v1);
++		double lambda2=M1(v2,v2);
++		double mu1=M2(v1,v1);
++		double mu2=M2(v2,v2);
++
++		//check where any change needs to be done on M1
++		if ( lambda1 < mu1 )  change=1,lambda1=mu1;
++		if ( lambda2 < mu2 )  change=1,lambda2=mu2; 
++
++		//update M1 if necessary
++		if (change) {
++			D2xD2 invP(P.inv());
++			D2xD2 D(lambda1,0,0,lambda2); 
++			D2xD2 M(invP.t()*D*invP);
++			a11=M.x.x;
++			a21=0.5*(M.x.y+M.y.x);
++			a22=M.y.y;
++		}
++		return change;
++	}
++	/*}}}*/
++	/*FUNCTION Metric::mul{{{*/
++	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) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/LengthInterpole)*/
++
++		double k=1./2.;
++		int level=0;
++		static int kkk=0;
++		static  Metric Ms1[32],Ms2[32];
++		static double lMs1[32],lMs2[32];
++		static double K[32];
++		double l=0,sss=0;
++		Ms1[level]=Ma;
++		Ms2[level]=Mb;
++		double sa =  Ma(AB);
++		double sb =  Mb(AB);
++		lMs1[level]=sa;
++		lMs2[level]=sb;
++		K[level]=k;
++		level++;
++		int i=0;
++		double * L= LastMetricInterpole.L, *S = LastMetricInterpole.S;
++		double  sstop = 0.1; // Max(0.6,(sa+sb)/5000);
++		while (level) {
++			level--;
++			Metric M1=Ms1[level];
++			Metric M2=Ms2[level];
++			k=K[level];
++			double s1=  lMs1[level];
++			double s2=  lMs2[level];
++
++			double s= (s1+s2)*k;
++			if( s > sstop   && level < 30 && i < 500-level ) {
++				Metric Mi(0.5,M1,0.5,M2);
++				double si = Mi(AB);
++				if( Abs((s1+s2)-(si+si)) > s1*0.001) 
++				  {
++					k=k/2;
++					// we begin by the end to walk in the correct direction from a to b
++					// due to the stack 
++					Ms1[level]=Mi;
++					Ms2[level]=M2;
++					lMs1[level]=si;
++					lMs2[level]=s2;
++					K[level]=k;
++					level++;
++					Ms1[level]=M1;
++					Ms2[level]=Mi;
++					lMs1[level]=s1;
++					lMs2[level]=si;
++					K[level]=k;
++					level++;
++				  }
++				else
++				 L[i]= l += s,S[i]=sss+=k,i++;
++			}
++			else 
++			 L[i]= l += s,S[i]=sss+=k,i++;
++		}
++		// warning for optimisation S is in [0:0.5] not in [0:1]
++		if (i>=512){
++			_error2_("i>=512");
++		}
++		LastMetricInterpole.lab=l;
++		LastMetricInterpole.opt=i;
++		if (i>200 && kkk++<10) _printLine_("WARNING: LengthInterpole: ( i=" << i << " l=" << l << " sss=" << sss << " ) " << sstop); 
++		return l;
++	}
++	/*}}}*/
++	/*FUNCTION SimultaneousMatrixReduction{{{*/
++	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 
++		 * eigen vectors of N=inv(M1) M2.
++		 * Instead of looking at N directly, we are going to use the fact that
++		 * M1 and M2 are symmetrical, positive definite. 
++		 * The eigen values of N are given by solving
++		 *    inv(M1) M2 V = lambda V
++		 * which is equivalent to
++		 *    M2 V = lambda M1 V
++		 * and we will hence solve
++		 *    (M2 - lambda M1) V = 0
++		 */
++
++		//M1 and M2 components
++		double a11=M1.a11,a21=M1.a21,a22=M1.a22;
++		double b11=M2.a11,b21=M2.a21,b22=M2.a22;
++
++		/*To get the eigen values, we solve the following problem:
++		 *    det(M2-lambda M1) = 0
++		 *    (b11 - lambda a11)(b22-lambda a22) - (b21-lambda a21)^2
++		 * and we have the following trinome:
++		 *    a lambda^2 + b lambda + c =0
++		 * with:
++		 *    a = a11 a22 - a21 a21 (=det(M1))
++		 *    b = -a11 b22 -b11 a22 + 2 b21 a21
++		 *    c = b11 b22 - b21 b21 (=det(M2))
++		 *    */
++		const double a= a11*a22  - a21*a21;
++		const double b=-a11*b22 - b11*a22+2*b21*a21;
++		const double c=-b21*b21 + b11*b22;
++		const double bb=b*b,ac=a*c;
++		const double delta= bb-4*ac;
++
++		// first, case of a double root if:
++		//  - all the terms are very small (a??)
++		//  - or : delta is very small
++		if ( (bb + Abs(ac) < 1.0e-34 ) ||  (delta < 1.0e-6*bb) ){
++			//all vectors are eigen vectors -> choose 1,0 and 0,1
++			V= D2xD2(1,0,0,1);
++		}
++
++		//general case: two distinct roots: lambda1 and lambda2
++		else {
++
++			/*Compute eigen values*/
++			const double delta2 = sqrt(delta);
++			double lambda[2];
++			lambda[0]= (-b - delta2)/(2*a);
++			lambda[1]= (-b + delta2)/(2*a);
++
++			/*compute eigen vectors*/
++			double vp[2][2];
++			double v0,v1,v2;
++			double s0,s1;
++
++			for(int i=0;i<2;i++){
++				/*Now, one must find the eigen vectors. For that we use the 
++				 * following property of the inner product
++				 *    (Ax,b) = transp(b) Ax = transp(x) transp(A) b
++				 *           = (transp(A) b ,x)
++				 * Here we are dealing with A= M2 - lambda M1 which is symmetrical:
++				 *    for all (x,y) in R2 
++				 *       ((M2 - lambda M1)x,y)=((M2 - lambda M1)y,x)
++				 * If y is in Ker(M2 - lambda M1):
++				 *    for all x in R2
++				 *       ((M2 - lambda M1)y,x)=0
++				 * This shows that:
++				 *    Ker(M2 - lambda M1) is orthogonal to Im(M2 - lambda M1)
++				 * To find the eigen vectors, we only have to find two vectors
++				 * of the image and take their perpendicular as long as they are
++				 * not 0.
++				 * To do that, we take (1,0) and (0,1) and take the larger norm*/
++
++				//compute V = M2 - lambdai M1
++				v0 = b11 - lambda[i]*a11;
++				v1 = b21 - lambda[i]*a21;
++				v2 = b22 - lambda[i]*a22;
++
++				// compute s1=norm(V(1,0)) and s0=norm(V(0,1))
++				s0 = v0*v0 + v1*v1;
++				s1 = v1*v1 + v2*v2;
++
++				//compute vp1 = (vp1x,vp1y)
++				if(s1 < s0){
++					s0=sqrt(s0);
++					vp[0][i]=   v1/s0;
++					vp[1][i]= - v0/s0;
++				}
++				else{
++					s1=sqrt(s1);
++					vp[0][i]=   v2/s1;
++					vp[1][i]= - v1/s1;
++				}
++			}
++
++			//compute V from vp
++			V=D2xD2(vp[0][0],vp[0][1],vp[1][0],vp[1][1]);
++		}
++	}
++	/*}}}*/
++	/*FUNCTION abscisseInterpole{{{*/
++	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);
++		double l  = s* LastMetricInterpole.lab,r;
++		int j=LastMetricInterpole.opt-1;
++
++		double * L= LastMetricInterpole.L, *S = LastMetricInterpole.S;
++		// warning for optimisation S is the abcisse in [0:0.5]
++		// and L is le lenght 
++		if(l<=L[0]){
++			r=2*S[0]*l/L[0];
++		}
++		else if (l>=L[j]){
++			r=1;
++		}
++		else{
++			int i=0;
++			while (j-i>1){
++				int k;
++				k= (i+j)/2;
++				if(l<=L[k]){
++					j=k;// l<=L[j] 
++				}
++				else{
++					i=k; //  L[i]<l
++				}
++			};
++			if (i==j){
++				r = 2*S[i];
++			}
++			else{
++				r =  2*(S[i]*(L[j]-l)+ S[j]*(l-L[i]))/(L[j]-L[i]);
++			}
++		}
++		if (r>1 || r<0){
++			_error2_("r>1 || r<0");
++		}
++		return r ;
++	}
++	/*}}}*/
++
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgMesh.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgMesh.cpp	(revision 12821)
+@@ -0,0 +1,56 @@
++#include <stdio.h>
++#include "../objects.h"
++#include "../../io/io.h"
++#include "../../shared/shared.h"
++
++/*Constructors/Destructors*/
++/*FUNCTION 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;
++	this->TrianglesSize[0]=0,                 this->TrianglesSize[1]=0;                this->Triangles=NULL;
++	this->QuadrilateralsSize[0]=0,            this->QuadrilateralsSize[1]=0;           this->Quadrilaterals=NULL;
++
++	this->SubDomainsSize[0]=0,                this->SubDomainsSize[1]=0;               this->SubDomains=NULL;
++	this->SubDomainsFromGeomSize[0]=0,        this->SubDomainsFromGeomSize[1]=0;       this->SubDomainsFromGeom=NULL;
++	this->CrackedVerticesSize[0]=0,           this->CrackedVerticesSize[1]=0;          this->CrackedVertices=NULL;
++	this->CrackedEdgesSize[0]=0,              this->CrackedEdgesSize[1]=0;             this->CrackedEdges=NULL;
++
++	this->VerticesOnGeomVertexSize[0]=0,      this->VerticesOnGeomVertexSize[1]=0;     this->VerticesOnGeomVertex=NULL;
++	this->VerticesOnGeomEdgeSize[0]=0,        this->VerticesOnGeomEdgeSize[1]=0;       this->VerticesOnGeomEdge=NULL;
++	this->EdgesOnGeomEdgeSize[0]=0,           this->EdgesOnGeomEdgeSize[1]=0;          this->EdgesOnGeomEdge=NULL;
++
++	this->IssmEdgesSize[0]=0,                 this->IssmEdgesSize[1]=0;                this->IssmEdges=NULL;
++	this->IssmSegmentsSize[0]=0,              this->IssmSegmentsSize[1]=0;             this->IssmSegments=NULL;
++
++	this->ElementConnectivitySize[0]=0,       this->ElementConnectivitySize[1]=0;      this->ElementConnectivity=NULL;
++	this->NodalConnectivitySize[0]=0,         this->NodalConnectivitySize[1]=0;        this->NodalConnectivity=NULL;
++	this->NodalElementConnectivitySize[0]=0,  this->NodalElementConnectivitySize[1]=0; this->NodalElementConnectivity=NULL;
++}
++/*}}}*/
++/*FUNCTION BamgMesh::~BamgMesh(){{{*/
++BamgMesh::~BamgMesh(){
++
++	xDelete<double>(this->Vertices);
++	xDelete<double>(this->Edges);
++	xDelete<double>(this->Triangles);
++	xDelete<double>(this->Quadrilaterals);
++
++	xDelete<double>(this->SubDomains);
++	xDelete<double>(this->SubDomainsFromGeom);
++	xDelete<double>(this->CrackedVertices);
++	xDelete<double>(this->CrackedEdges);
++
++	xDelete<double>(this->VerticesOnGeomVertex);
++	xDelete<double>(this->VerticesOnGeomEdge);
++	xDelete<double>(this->EdgesOnGeomEdge);
++
++	xDelete<double>(this->IssmEdges);
++	xDelete<double>(this->IssmSegments);
++
++	xDelete<double>(this->ElementConnectivity);
++	xDelete<double>(this->NodalConnectivity);
++	xDelete<double>(this->NodalElementConnectivity);
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Curve.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Curve.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Curve.cpp	(revision 12821)
+@@ -0,0 +1,37 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "Curve.h"
++#include "Geometry.h"
++
++namespace bamg {
++
++	/*Constructors/Destructors*/
++	/*FUNCTION Curve::Curve(){{{*/
++	Curve::Curve(){
++		FirstEdge=NULL;
++		LastEdge=NULL;
++		FirstVertexIndex=0;
++		LastVertexIndex=0;
++	} 
++	/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION Curve::Reverse {{{*/
++	void Curve::Reverse() {
++		/*reverse the direction of the curve */
++		Exchange(FirstEdge,LastEdge);
++		Exchange(FirstVertexIndex,LastVertexIndex);
++	}
++	/*}}}*/
++	/*FUNCTION Curve::Set {{{*/
++	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: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Direction.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Direction.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Direction.h	(revision 12821)
+@@ -0,0 +1,21 @@
++#ifndef _DIRECTION_H_
++#define _DIRECTION_H_
++
++#include "./include.h"
++#include "../../shared/Bamg/shared.h"
++
++namespace bamg {
++
++	class Direction {
++		private:
++			Icoor1 dir;
++
++		public:
++			//Methods
++			Direction();
++			Direction(Icoor1 i,Icoor1 j);
++			int direction(Icoor1 i,Icoor1 j);
++	};
++}
++#endif
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomVertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomVertex.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomVertex.cpp	(revision 12821)
+@@ -0,0 +1,38 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "GeomVertex.h"
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++
++namespace bamg {
++
++	/*Constructors/Destructors*/
++	//See header file
++
++	/*Methods*/
++	/*FUNCTION GeomVertex::Corner {{{*/
++	int  GeomVertex::Corner() const {
++		return type & 4;
++	}
++	/*}}}*/
++	/*FUNCTION GeomVertex::Required {{{*/
++	int  GeomVertex::Required()const {
++		// a corner is required
++		return type & 6;
++	}
++	/*}}}*/
++	/*FUNCTION GeomVertex::SetCorner {{{*/
++	void GeomVertex::SetCorner(){
++		type |= 4;
++	}
++	/*}}}*/
++	/*FUNCTION GeomVertex::SetRequired {{{*/
++	void GeomVertex::SetRequired(){
++		type |= 2;
++	}
++	/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnGeom.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnGeom.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnGeom.h	(revision 12821)
+@@ -0,0 +1,46 @@
++#ifndef _VERTEXONGEOM_H_
++#define _VERTEXONGEOM_H_
++
++#include "./include.h"
++#include "./GeomVertex.h"
++
++namespace bamg {
++
++	//classes
++	class Mesh;
++	class BamgVertex;
++	class GeomEdge;
++
++	class VertexOnGeom{
++
++		public:
++
++			BamgVertex* meshvertex;
++			double curvilincoord;  
++			union{ 
++				GeomVertex* gv; // if curvilincoord <0; 
++				GeomEdge*   ge; // if curvilincoord in [0..1]
++			};
++
++			//Constructors/Destructors
++			VertexOnGeom();
++			VertexOnGeom(BamgVertex & m,GeomVertex &g);
++			VertexOnGeom(BamgVertex & m,GeomEdge &g,double s);
++
++			//Operators
++			operator BamgVertex*() const  {return meshvertex;}
++			operator GeomVertex * () const  {return gv;}
++			operator GeomEdge * () const  {return ge;}
++			operator const double & () const {return curvilincoord;}
++
++			//Methods
++			int  OnGeomVertex()const;
++			int  OnGeomEdge() const;
++			int  IsRequiredVertex();
++			void SetOn();
++
++			//Inline methods
++			void Set(const VertexOnGeom&,const Mesh &,Mesh &);  
++	};
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/R2.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/R2.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/R2.h	(revision 12821)
+@@ -0,0 +1,105 @@
++/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, R2.h)*/
++#ifndef _R2_H
++#define _R2_H
++
++#include <cstdio>
++
++namespace bamg {
++
++	template <class R,class RR> class P2{
++
++		  public:  
++
++			  //fields
++			  R x,y;
++
++			  //functions
++			  P2 () :x(0),y(0) {};
++			  P2 (R a,R b)  :x(a),y(b)  {}
++			  P2 (P2 A,P2 B) : x(B.x-A.x),y(B.y-A.y) {}
++			  void Echo(){
++				  printf("Member of P2:\n");
++				  printf("   x: %g or %i\n",x,x);
++				  printf("   y: %g or %i\n",y,y);
++			  }
++			  //operators
++			  RR       operator,(const P2<R,RR> & cc) const {return  (RR) x* (RR) cc.x+(RR) y* (RR) cc.y;} //scalar product
++			  P2<R,RR> operator+(const P2<R,RR> & cc) const {return P2<R,RR>(x+cc.x,y+cc.y);}
++			  P2<R,RR> operator-(const P2<R,RR> & cc) const {return P2<R,RR>(x-cc.x,y-cc.y);}
++			  P2<R,RR> operator-()  const{return P2<R,RR>(-x,-y);}
++			  P2<R,RR> operator*(R  cc) const {return P2<R,RR>(x*cc,y*cc);}
++			  P2<R,RR> operator/(R  cc) const {return P2<R,RR>(x/cc,y/cc);}
++			  P2<R,RR> operator+=(const  P2<R,RR> & cc) {x += cc.x;y += cc.y;return *this;}
++			  P2<R,RR> operator/=(const  R r) {x /= r;y /= r;return *this;}
++			  P2<R,RR> operator*=(const  R r) {x *= r;y *= r;return *this;}
++			  P2<R,RR> operator-=(const  P2<R,RR> & cc) {x -= cc.x;y -= cc.y;return *this;}
++
++	  };
++
++	template <class R,class RR> class P2xP2{
++
++		  private:
++
++			  friend P2<R,RR> operator*(P2<R,RR> c,P2xP2<R,RR> cc){
++				  return P2<R,RR>(c.x*cc.x.x + c.y*cc.y.x, c.x*cc.x.y + c.y*cc.y.y);
++			  } 
++		  public:
++
++			  //fields
++			  P2<R,RR> x,y; 
++
++			  //functions
++			  P2xP2 (): x(),y()  {}
++			  P2xP2 (P2<R,RR> a,P2<R,RR> b): x(a),y(b) {}
++			  P2xP2 (P2<R,RR> a,P2<R,RR> b,P2<R,RR> c ): x(b-a),y(c-a) {}
++			  P2xP2 (R xx,R xy,R yx,R yy) :x(xx,xy),y(yx,yy) {}
++			  void Echo(){
++				  printf("Member of P2xP2:\n");
++				  printf("   x.x: %g   x.y: %g\n",x.x,x.y);
++				  printf("   y.x: %g   y.x: %g\n",y.x,y.y);
++			  }
++			  RR          det() const {return (RR) x.x* (RR) y.y - (RR) x.y * (RR) y.x;}
++			  P2xP2<R,RR> inv()  const{
++				  RR d = (*this).det(); 
++				  return P2xP2<R,RR>((R)( y.y /d) ,(R)(-x.y/d),(R)( -y.x/d) ,(R)( x.x/d) );
++			  };
++			  P2xP2<R,RR> t()  {return P2xP2<R,RR>(x.x,y.x,x.y,y.y);} //transposer 
++			  P2<R,RR>    tx() {return P2<R,RR>(x.x,y.x);} 
++			  P2<R,RR>    ty() {return P2<R,RR>(x.y,y.y);} 
++			  //Operators
++			  P2<R,RR>     operator*(const P2<R,RR>& c) const {return P2<R,RR>(x.x*c.x + x.y*c.y, y.x*c.x + y.y*c.y);}
++			  P2xP2<R,RR>  operator*(P2xP2<R,RR> c) const{
++				  return  P2xP2<R,RR>(x.x*c.x.x + x.y*c.y.x,
++							  x.x*c.x.y + x.y*c.y.y,
++							  y.x*c.x.x + y.y*c.y.x,
++							  y.x*c.x.y + y.y*c.y.y);
++			  }
++	  };  
++
++	//inline functions
++	template  <class R,class RR>  
++	  inline RR Det(const P2<R,RR> x,const P2<R,RR> y) {
++		  return (RR) x.x * (RR) y.y - (RR) x.y * (RR) y.x ;
++	  } 
++	template  <class R,class RR>  
++	  inline RR Area2 (const P2<R,RR> a,const P2<R,RR> b,const P2<R,RR> c) {
++		  return Det(b-a,c-a) ;
++	  }
++	template  <class R,class RR>  
++	  inline R Norme1 (const P2<R,RR> x) {
++		  return (Abs(x.x)+Abs(x.y)) ;
++	  } 
++	template  <class R,class RR>  
++	  inline RR Norme2_2 (const P2<R,RR> x) {
++		  return (RR)x.x*(RR)x.x + (RR)x.y*(RR)x.y ;
++	  } 
++	template  <class R,class RR>  
++	  inline RR Norme2 (const P2<R,RR> x) {
++		  return sqrt((RR)x.x*(RR)x.x + (RR)x.y*(RR)x.y) ;
++	  } 
++	template  <class R,class RR>  
++	  inline P2<R,RR> Orthogonal (const P2<R,RR> x) {
++		  return  P2<R,RR>(-x.y,x.x);
++	  } 
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomSubDomain.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomSubDomain.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomSubDomain.cpp	(revision 12821)
+@@ -0,0 +1,20 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "GeomSubDomain.h"
++#include "Geometry.h"
++
++namespace bamg {
++
++	/*Constructors/Destructors*/
++
++	/*Methods*/
++	/*FUNCTION GeomSubDomain::Set {{{*/
++	void GeomSubDomain::Set(const GeomSubDomain & rec,const Geometry & Gh ,const Geometry & GhNew){
++		*this = rec;
++		edge = Gh.GetId(edge) + GhNew.edges;
++	}/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp	(revision 12821)
+@@ -0,0 +1,971 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "../objects.h"
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++
++namespace bamg {
++
++	static const  Direction NoDirOfSearch=Direction();
++
++	/*Constructors/Destructors*/
++	/*FUNCTION Geometry::Geometry(){{{*/
++	Geometry::Geometry(){
++		Init();
++	}
++	/*}}}*/
++	/*FUNCTION 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) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Geometry)*/
++
++		long i;
++		*this = Gh;
++		NbRef =0;
++		quadtree=0;
++		vertices = nbv ? new GeomVertex[nbv] : NULL;
++		edges = nbe ? new GeomEdge[nbe]:NULL;
++		curves= nbcurves ? new Curve[nbcurves]:NULL;
++		subdomains = nbsubdomains ? new GeomSubDomain[nbsubdomains]:NULL;
++		for (i=0;i<nbe;i++)
++		 edges[i].Set(Gh.edges[i],Gh,*this);
++		for (i=0;i<nbcurves;i++)
++		 curves[i].Set(Gh.curves[i],Gh,*this);
++		for (i=0;i<nbsubdomains;i++)
++		 subdomains[i].Set(Gh.subdomains[i],Gh,*this);
++	}
++	/*}}}*/
++	/*FUNCTION Geometry::~Geometry(){{{*/
++	Geometry::~Geometry() {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/~Geometry)*/
++		if(NbRef>0){   _printString_("Trying to delete geometry and NbRef>0, probably due to an error"); return;}
++		if(vertices)   delete [] vertices;  vertices=0;
++		if(edges)      delete [] edges;     edges=0;
++		if(quadtree)   delete    quadtree;  quadtree=0;
++		if(curves)     delete [] curves;    curves=0;nbcurves=0;
++		if(subdomains) delete [] subdomains;subdomains=0;
++		Init();
++	}
++	/*}}}*/
++
++	/*IO*/
++	/*FUNCTION Geometry::ReadGeometry{{{*/
++	void Geometry::ReadGeometry(BamgGeom* bamggeom,BamgOpts* bamgopts){
++
++		int verbose;
++		nbv=0;
++		nbe=0;
++		nbcurves=0;
++
++		double Hmin = HUGE_VAL;// the infinie value 
++		int i,j,k,n,i0,i1,i2,i3;
++
++		/*initialize some variables*/
++		verbose= bamgopts->verbose;
++		nbv    = bamggeom->VerticesSize[0];
++		nbe    = bamggeom->EdgesSize[0];
++
++		//some checks
++		if (bamggeom->Vertices==NULL) _error2_("the domain provided does not contain any vertex");
++		if (bamggeom->Edges==NULL) _error2_("the domain provided does not contain any edge");
++
++		//Vertices
++		if (bamggeom->Vertices){
++			if(verbose>5) _printLine_("      processing Vertices");
++			if (bamggeom->VerticesSize[1]!=3) _error2_("Vertices should have 3 columns");
++			vertices = new GeomVertex[nbv];
++			for (i=0;i<nbv;i++) {
++				vertices[i].r.x=(double)bamggeom->Vertices[i*3+0];
++				vertices[i].r.y=(double)bamggeom->Vertices[i*3+1];
++				vertices[i].ReferenceNumber=(long)bamggeom->Vertices[i*3+2];
++				vertices[i].DirOfSearch=NoDirOfSearch;
++				vertices[i].color =0;
++				vertices[i].type=0;
++			}
++			/*find domain extrema (pmin,pmax) that will define the square box used for by the quadtree*/
++			pmin =  vertices[0].r;
++			pmax =  vertices[0].r;
++			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);
++			}
++			/*Offset pmin and pmax to avoid round-off errors*/
++			R2 offset = (pmax-pmin)*0.05;
++			pmin -= offset;
++			pmax += offset;
++			/*coefIcoor is the coefficient used for integer coordinates:
++			 *                       (x-pmin.x)
++			 * Icoor x = (2^30 -1) ------------ 
++			 *                          D
++			 * where D is the longest side of the domain (direction x or y)
++			 * so that (x-pmin.x)/D is in ]0 1[
++			 *
++			 * coefIcoor = (2^30 -1)/D
++			 */
++			coefIcoor=(MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
++			if(coefIcoor<=0) _error2_("coefIcoor should be positive");
++		}
++		else{
++			_error2_("No BamgVertex provided");
++		}
++
++		//Edges
++		if (bamggeom->Edges){
++			R2      zerovector(0,0);
++			double* verticeslength=NULL;
++
++			if(verbose>5) _printLine_("      processing Edges");
++			if (bamggeom->EdgesSize[1]!=3) _error2_("Edges should have 3 columns");
++			edges = new GeomEdge[nbe];
++
++			//initialize verticeslength (sum of the lengths of the edges holding vertex)
++			verticeslength = new double[nbv];
++			for(i=0;i<nbv;i++) verticeslength[i]=0;
++
++			/*Loop over the edges*/
++			for (i=0;i<nbe;i++){
++
++				i1=(int)bamggeom->Edges[i*3+0]-1; //-1 for C indexing
++				i2=(int)bamggeom->Edges[i*3+1]-1; //-1 for C indexing
++				edges[i].v[0]= vertices + i1;     //pointer toward vertex i1 (=&vertices[i1])
++				edges[i].v[1]= vertices + i2;     //pointer toward vertex i2
++				edges[i].ReferenceNumber=(long)bamggeom->Edges[i*3+2];
++
++				//get length of edge
++				R2     x12=vertices[i2].r-vertices[i1].r;
++				double l12=sqrt((x12,x12));
++				Hmin=Min(Hmin,l12);
++
++				//initialize other fields
++				edges[i].tg[0]=zerovector;
++				edges[i].tg[1]=zerovector;
++				edges[i].AdjVertexIndex[0] = edges[i].AdjVertexIndex[1] = -1;
++				edges[i].Adj[0] = edges[i].Adj[1] = NULL;
++				edges[i].type = 0;
++
++				//Cracked?
++				if (edges[i].ReferenceNumber!=1) edges[i].SetCracked();
++
++				//prepare metric
++				vertices[i1].color++;
++				vertices[i2].color++;
++				verticeslength[i1] += l12;
++				verticeslength[i2] += l12;
++			}
++
++			// definition the default of the given mesh size 
++			for (i=0;i<nbv;i++) {
++				if (vertices[i].color > 0) 
++				 vertices[i].m=Metric(verticeslength[i] /(double) vertices[i].color);
++				else 
++				 vertices[i].m=Metric(Hmin);
++			}
++			delete [] verticeslength;
++			
++		}
++		else{
++			_error2_("No edges provided");
++		}
++
++		//hVertices
++		if(bamgopts->hVertices && bamgopts->hVerticesSize[0]==nbv){
++			if(verbose>5) _printLine_("      processing hVertices");
++			for (i=0;i< nbv;i++){
++				if (!xIsNan<IssmDouble>(bamgopts->hVertices[i])){
++					vertices[i].m=Metric((double)bamgopts->hVertices[i]);
++				}
++			}
++		}
++
++		//MetricVertices
++		if(bamgopts->metric && bamgopts->metric[0]==nbv){
++			if(verbose>5) _printLine_("      processing MetricVertices");
++			for (i=0;i< nbv;i++) {
++				vertices[i].m = Metric((double)bamgopts->metric[i*3+0],(double)bamgopts->metric[i*3+1],(double)bamgopts->metric[i*3+2]);
++			}
++		}
++
++		//MaxCornerAngle
++		if (bamgopts->MaxCornerAngle){
++			if(verbose>5) _printLine_("      processing MaxCornerAngle");
++			MaxCornerAngle=bamgopts->MaxCornerAngle*Pi/180;
++		}
++
++		//TangentAtEdges
++		if (bamggeom->TangentAtEdges){
++			if(verbose>5) _printString_("      processing TangentAtEdges");
++			if (bamggeom->TangentAtEdgesSize[1]!=4) _error2_("TangentAtEdges should have 4 columns");
++			int n,i,j,k;
++			R2 tg;
++
++			n=bamggeom->TangentAtEdgesSize[0];
++			for (k=0;k<n;k++) {
++				i=(int)bamggeom->TangentAtEdges[k*4+0]-1; //for C indexing
++				j=(int)bamggeom->TangentAtEdges[k*4+1]-1; //for C indexing
++				tg.x=bamggeom->TangentAtEdges[k*4+2];
++				tg.y=bamggeom->TangentAtEdges[k*4+3];
++				if (i<0 || i>=nbe) _error2_("TangentAtEdges first index exceeds matrix dimension");
++				if (j!=0 && j!=1)  _error2_("TangentAtEdges second index should be 1 or 2 only");
++				edges[i].tg[j] = tg;
++			}
++		}
++
++		//Corners
++		if(bamggeom->Corners){
++			if(verbose>5) _printString_("      processing Corners");
++			if (bamggeom->CornersSize[1]!=1) _error2_("Corners should have 1 column");
++			n=bamggeom->CornersSize[0];
++			for (i=0;i<n;i++) {     
++				j=(int)bamggeom->Corners[i]-1; //for C indexing
++				if (j>nbv-1 || j<0) _error2_("Bad corner definition: should in [0 " << nbv << "]");
++				/*Required => at the same time SetRequired and SetCorner*/
++				vertices[j].SetCorner();
++				vertices[j].SetRequired();
++			}
++		}
++
++		//RequiredVertices
++		if(bamggeom->RequiredVertices){
++			if(verbose>5) _printLine_("      processing RequiredVertices");
++			if (bamggeom->RequiredVerticesSize[1]!=1) _error2_("RequiredVertices should have 1 column");
++			n=bamggeom->RequiredVerticesSize[0];
++			for (i=0;i<n;i++) {     
++				j=(int)bamggeom->RequiredVertices[i]-1; //for C indexing
++				if (j>nbv-1 || j<0) _error2_("Bad RequiredVerticess  definition: should in [0 " << nbv << "]");
++				vertices[j].SetRequired();
++			}
++		}
++
++		//RequiredEdges
++		if(bamggeom->RequiredEdges){
++			if(verbose>5) _printLine_("      processing RequiredEdges");
++			if (bamggeom->RequiredEdgesSize[1]!=1) _error2_("RequiredEdges should have 1 column");
++			n=bamggeom->RequiredEdgesSize[0];
++			for (i=0;i<n;i++) {     
++				j=(int)bamggeom->RequiredEdges[i]-1; //for C indexing
++				if (j>nbe-1 || j<0) _error2_("Bad RequiredEdges definition: should in [0 " << nbe << "]");
++				edges[j].SetRequired();  
++			}
++		}
++
++		//SubDomain
++		if(bamggeom->SubDomains){
++			if(verbose>5) _printLine_("      processing SubDomains");
++			if (bamggeom->SubDomainsSize[1]!=4) _error2_("SubDomains should have 4 columns");
++			nbsubdomains=bamggeom->SubDomainsSize[0];
++			subdomains = new GeomSubDomain[nbsubdomains];
++			for (i=0;i<nbsubdomains;i++){
++				i0=(int)bamggeom->SubDomains[i*4+0];
++				i1=(int)bamggeom->SubDomains[i*4+1];
++				i2=(int)bamggeom->SubDomains[i*4+2];
++				i3=(int)bamggeom->SubDomains[i*4+3];
++				if (i0!=2) _error2_("Bad Subdomain definition: first number should be 2 (for Edges)");
++				if (i1>nbe || i1<=0) _error2_("Bad Subdomain definition: second number should in [1 " << nbe << "] (edge number)");
++				subdomains[i].edge=edges + (i1-1);
++				subdomains[i].direction = (int) i2;
++				subdomains[i].ReferenceNumber = i3;
++			}
++		}
++	}
++	/*}}}*/
++	/*FUNCTION Geometry::WriteGeometry{{{*/
++	void Geometry::WriteGeometry(BamgGeom* bamggeom, BamgOpts* bamgopts){
++
++		int verbose;
++		int nbreq=0;
++		int nbreqv=0;
++		int nbtan=0;
++		int nbcracked=0;
++		int i,count;
++
++		/*Get options*/
++		verbose=bamgopts->verbose;
++
++		/*Vertices*/
++		if(verbose>5) _printLine_("      writing Vertices");
++		bamggeom->VerticesSize[0]=nbv;
++		bamggeom->VerticesSize[1]=3;
++		if (nbv){
++			bamggeom->Vertices=xNew<double>(3*nbv);
++			for (i=0;i<nbv;i++){
++				bamggeom->Vertices[i*3+0]=vertices[i].r.x;
++				bamggeom->Vertices[i*3+1]=vertices[i].r.y;
++				bamggeom->Vertices[i*3+2]=vertices[i].GetReferenceNumber();
++
++				//update counters
++				if (vertices[i].Required()) nbreqv++;
++			}
++		}
++
++		/*Edges*/
++		if(verbose>5) _printLine_("      writing Edges");
++		bamggeom->EdgesSize[0]=nbe;
++		bamggeom->EdgesSize[1]=3;
++		if (nbe){
++			bamggeom->Edges=xNew<double>(3*nbe);
++			for (i=0;i<nbe;i++){
++				bamggeom->Edges[i*3+0]=GetId(edges[i][0])+1; //back to Matlab indexing
++				bamggeom->Edges[i*3+1]=GetId(edges[i][1])+1; //back to Matlab indexing
++				bamggeom->Edges[i*3+2]=(double)edges[i].ReferenceNumber;
++
++				//update counters
++				if (edges[i].Required()) nbreq++;
++				if (edges[i].TgA() && edges[i][0].Corner()) nbtan++;
++				if (edges[i].TgB() && edges[i][1].Corner()) nbtan++;
++			}
++		}
++
++		/*RequiredEdges*/
++		if(verbose>5) _printLine_("      writing " << nbreq << " RequiredEdges");
++		bamggeom->RequiredEdgesSize[0]=nbreq;
++		bamggeom->RequiredEdgesSize[1]=1;
++		if (nbreq){
++			bamggeom->RequiredEdges=xNew<double>(1*nbreq);
++			count=0;
++			for (i=0;i<nbe;i++){
++				if (edges[i].Required()){
++					bamggeom->RequiredEdges[count]=i+1; //back to Matlab indexing
++					count=count+1;
++				}
++			}
++		}
++
++		//No corners
++
++		/*RequiredVertices*/
++		if(verbose>5) _printLine_("      writing " << nbreqv << " RequiredVertices");
++		bamggeom->RequiredVerticesSize[0]=nbreqv;
++		bamggeom->RequiredVerticesSize[1]=1;
++		if (nbreqv){
++			bamggeom->RequiredVertices=xNew<double>(1*nbreqv);
++			count=0;
++			for (i=0;i<nbv;i++){
++				if (vertices[i].Required()){
++					bamggeom->RequiredVertices[count]=i+1; //back to Matlab indexing
++					count=count+1;
++				}
++			}
++		}
++
++		/*SubDomains*/
++		if(verbose>5) _printLine_("      writing SubDomains");
++		bamggeom->SubDomainsSize[0]=nbsubdomains;
++		bamggeom->SubDomainsSize[1]=4;
++		if (nbsubdomains){
++			bamggeom->SubDomains=xNew<double>(4*nbsubdomains);
++			for (i=0;i<nbsubdomains;i++){
++				bamggeom->SubDomains[4*i+0]=2;
++				bamggeom->SubDomains[4*i+1]=GetId(subdomains[i].edge)+1; //back to Matlab indexing
++				bamggeom->SubDomains[4*i+2]=subdomains[i].direction;
++				bamggeom->SubDomains[4*i+3]=subdomains[i].ReferenceNumber;
++			}
++		}
++
++		/*TangentAtEdges*/
++		if(verbose>5) _printLine_("      writing TangentAtEdges");
++		bamggeom->TangentAtEdgesSize[0]=nbtan;
++		bamggeom->TangentAtEdgesSize[1]=4;
++		if (nbtan){
++			bamggeom->TangentAtEdges=xNew<double>(4*nbtan);
++			count=0;
++			for (i=0;i<nbe;i++){
++				if (edges[i].TgA() && edges[i][0].Corner()){
++					bamggeom->TangentAtEdges[4*i+0]=i+1; //back to Matlab indexing
++					bamggeom->TangentAtEdges[4*i+1]=1;
++					bamggeom->TangentAtEdges[4*i+2]=edges[i].tg[0].x;
++					bamggeom->TangentAtEdges[4*i+3]=edges[i].tg[0].y;
++				}
++				if (edges[i].TgB() && edges[i][1].Corner()){
++					bamggeom->TangentAtEdges[4*i+0]=i+1; //back to Matlab indexing
++					bamggeom->TangentAtEdges[4*i+1]=2;
++					bamggeom->TangentAtEdges[4*i+2]=edges[i].tg[1].x;
++					bamggeom->TangentAtEdges[4*i+3]=edges[i].tg[1].y;
++				}
++				count=count+1;
++			}
++		}
++	}
++	/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION Geometry::Echo {{{*/
++	void Geometry::Echo(void){
++
++		_printLine_("Geometry:");
++		_printLine_("   nbv  (number of vertices) : " << nbv);
++		_printLine_("   nbe  (number of edges)    : " << nbe);
++		_printLine_("   nbsubdomains: " << nbsubdomains);
++		_printLine_("   nbcurves: " << nbcurves);
++		_printLine_("   vertices: " << vertices);
++		_printLine_("   edges: " << edges);
++		_printLine_("   quadtree: " << quadtree);
++		_printLine_("   subdomains: " << subdomains);
++		_printLine_("   curves: " << curves);
++		_printLine_("   pmin (x,y): (" << pmin.x << " " << pmin.y << ")");
++		_printLine_("   pmax (x,y): (" << pmax.x << " " << pmax.y << ")");
++		_printLine_("   coefIcoor: " << coefIcoor);
++		_printLine_("   MaxCornerAngle: " << MaxCornerAngle);
++
++		return;
++	}
++	/*}}}*/
++	/*FUNCTION Geometry::Init{{{*/
++	void Geometry::Init(void){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/EmptyGeometry)*/
++
++		NbRef=0;
++		nbv=0;
++		nbe=0;
++		quadtree=NULL;
++		curves=NULL;
++		edges=NULL;
++		vertices=NULL;
++		nbsubdomains=0;
++		nbcurves=0;
++		subdomains=NULL;
++		MaxCornerAngle = 10*Pi/180; //default is 10 degres
++	}
++	/*}}}*/
++	/*FUNCTION 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() {
++		return Max(pmax.x-pmin.x,pmax.y-pmin.y);
++	}/*}}}*/
++	/*FUNCTION Geometry::GetId(const GeomVertex &t){{{*/
++	long Geometry::GetId(const GeomVertex & t) const  {
++		return &t - vertices;
++	}/*}}}*/
++	/*FUNCTION Geometry::GetId(const GeomVertex * t){{{*/
++	long Geometry::GetId(const GeomVertex * t) const  {
++		return t - vertices;
++	}/*}}}*/
++	/*FUNCTION Geometry::GetId(const GeomEdge & t){{{*/
++	long Geometry::GetId(const GeomEdge & t) const  {
++		return &t - edges;
++	}/*}}}*/
++	/*FUNCTION Geometry::GetId(const GeomEdge * t){{{*/
++	long Geometry::GetId(const GeomEdge * t) const  {
++		return t - edges;
++	}/*}}}*/
++	/*FUNCTION Geometry::GetId(const Curve * c){{{*/
++	long Geometry::GetId(const Curve * c) const  {
++		return c - curves;
++	}/*}}}*/
++	/*FUNCTION Geometry::Containing{{{*/
++	GeomEdge* Geometry::Containing(const R2 P,  GeomEdge * start) const {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Contening)*/
++
++		GeomEdge* on =start,* pon=0;
++		// walk with the cos on geometry
++		int counter=0;
++		while(pon != on){  
++			counter++;
++			_assert_(counter<100);
++			pon = on;
++			R2 A= (*on)[0];
++			R2 B= (*on)[1];
++			R2 AB = B-A;
++			R2 AP = P-A;
++			R2 BP = P-B;
++			if ( (AB,AP) < 0) 
++			 on = on->Adj[0];
++			else if ( (AB,BP)  > 0) 
++			 on = on->Adj[1];
++			else
++			 return on;
++		}
++		return on;
++	}
++	/*}}}*/
++	/*FUNCTION Geometry::PostRead{{{*/
++	void Geometry::PostRead(){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/AfterRead)*/
++
++		long               i,j,k;
++		int                jj;
++		long              *head_v   = new long[nbv];
++		long              *next_p   = new long[2*nbe];
++		float             *eangle   = new float[nbe];
++		double             eps      = 1e-20;
++		BamgQuadtree           quadtree; // build quadtree to find duplicates
++		BamgVertex        *v0       = vertices;
++		GeomVertex *v0g      = (GeomVertex*) (void*)v0;
++
++		k=0;
++
++		//build quadtree for this geometry
++		for (i=0;i<nbv;i++){
++
++			/*build integer coordinates (non unique)
++			  these coordinates are used by the quadtree to group
++			  the vertices by groups of 5:
++			  All the coordinates are transformed to ]0,1[^2
++			  then, the integer coordinates are computed using 
++			  the transformation ]0,1[^2 -> [0 2^30-1[^2 for a quadtree of depth 30*/
++			vertices[i].i=R2ToI2(vertices[i].r); 
++
++			/*find nearest vertex already present in the quadtree (NULL if empty)*/
++			BamgVertex* v=quadtree.NearestVertex(vertices[i].i.x,vertices[i].i.y); 
++
++			/*if there is a vertex found that is to close to vertices[i] -> error*/
++			if( v && Norme1(v->r - vertices[i].r) < eps ){
++				_printLine_("reference numbers: " << v->ReferenceNumber << " " << vertices[i].ReferenceNumber);
++				_printLine_("Id: " << i+1);
++				delete [] next_p;
++				delete [] head_v;
++				delete [] eangle;
++				_error2_("two points of the geometry are very closed to each other (see reference numbers above)");
++			}
++
++			/*Add vertices[i] to the quadtree*/
++			quadtree.Add(vertices[i]);
++		}
++
++		/* Here we use a powerful chaining algorithm
++		 *
++		 * 1. What is a chaining algorithm?
++		 *
++		 * If F is a function that goes from i in [0 n] to j in [0 m]
++		 * and we want to compute the reciprocal function F-1 of F
++		 * (what are the antecedents of a given j in Im(F) )
++		 * We use 2 lists:
++		 *    head_F[j] that holds the head of lists
++		 *    next_F[i] that holds the list of elements that have the same image
++		 *
++		 * Example:
++		 *    i1, i2, ..., ip in [0,n] are all antecedents of a given j in [0 m]
++		 *    head_F[j] = ip
++		 *    next_F[ip]= ip-1
++		 *    ....
++		 *    next_F[i2]= i1
++		 *    next_F[i1]= -1  //end of the list
++		 *
++		 * Algorithm:
++		 *    for(j=0;j<m;j++)  head_F[j] = -1 //initialization
++		 *    for(i=0;i<n;i++){
++		 *       j=F[i];
++		 *       next_F[i]= head_F[j];
++		 *       head_F[j]=i;
++		 *    }
++		 * 
++		 *    Then, we can go through all the elements that have for image j:
++		 *    for(i=head_F[j]; i!=-1; i=next_F[i])
++		 *    initialization of i by i=head_F[j]
++		 *    stop the loop when i=-1 (end of the chain)
++		 *    iterate using i=next_F[i] (next element that have for image j)
++		 * 
++		 * 2. How to use this algorithm here?
++		 * 
++		 * Here F is a function that associates two vertices v0 and v1 for a given edge E
++		 * We want to build the reciprocal function: what are the edges that contains
++		 * a vertex v?
++		 * To do so, we use the same chaining algorithm but there is a difficulty
++		 * coming from the fact that for F we have a couple of vertices and not one 
++		 * vertex.
++		 * To overcome this difficulty, we use a global indexing exactly like in 
++		 * C/C++ so that
++		 * a member of a 2-column-table can be described by one index p=i*2+j
++		 * i=(int)p/2 line number of p
++		 * j=p%2      column number of p
++		 *
++		 * Algorithm:
++		 *    for(i=0;i<nbv;i++)  head_v[i] = -1 //initialization
++		 *    for(i=0;i<nbe;i++){
++		 *       for(j=0;j<2;j++){
++		 *          p=2*i+j;
++		 *          v=edges(i,j);
++		 *          next_p[p]= head_v[v];
++		 *          head_v[v]=p;
++		 *       }
++		 *    }
++		 */
++
++		//initialize head_v as -1
++		for (i=0;i<nbv;i++) head_v[i]=-1;
++		k=0;
++		for (i=0;i<nbe;i++) {
++			//compute vector of edge i that goes from vertex 0 to vertex 1
++			R2 v10=edges[i].v[1]->r - edges[i].v[0]->r;
++			double lv10=Norme2(v10);
++			//check that its length is not 0
++			if(lv10==0){
++				delete [] next_p;
++				delete [] head_v;
++				delete [] eangle;
++				_error2_("Length of edge " << i << " is 0");
++			}
++			//compute angle in [-Pi Pi]
++			eangle[i] = atan2(v10.y,v10.x);
++			//build chains head_v and next_p
++			for (j=0;j<2;j++){
++				long v=GetId(edges[i].v[j]);
++				next_p[k]=head_v[v];
++				head_v[v]=k++; //post increment: head_v[v]=k; and then k=k+1;
++			}
++		}
++
++		//sort head_v by order of increasing edges angle
++		for (i=0;i<nbv;i++) {
++			int exch=1,ord=0;      
++
++			//exchange vertices position in head_v and next_p till tey are sorted
++			while (exch){
++				long *p=head_v+i;               
++				long *po=p;                     
++				long  n=*p;                     
++				register float angleold=-1000 ; // angle = - infinity
++				ord=0; exch=0;
++
++				// loop over the edges that contain the vertex i (till -1)
++				while (n >=0){
++					ord++;
++					long  i1=n/2;       // i1 = floor (n/2)      -> Edge number
++					long  j1=n%2;       // j1 = 1 if n is odd    -> Vertex index for this edge (0 or 1)
++					long* pn=next_p+n;
++
++					//Next vertex index
++					n=*pn;                       
++
++					//compute angle between horizontal axis and v0->v1
++					float angle = j1 ? OppositeAngle(eangle[i1]):  eangle[i1]; 
++
++					//exchange if the current edge angle is smaller than the previous one
++					if (angleold > angle){
++						exch=1;
++						*pn=*po;  // next_p[n] = n + 1
++						*po=*p;   // 
++						*p=n;     // next_p[n+1] = n
++						po=pn;    // po now point toward pn (invert next and current)
++					}
++
++					//else, continue going to the next edge position
++					else{                        //  to have : po -> p -> pn
++						angleold=angle; // update maximum angle
++						po=p;           // po now point toward p  (current position)
++						p=pn;           // p  now point toward pn (next position)
++					}
++				}
++			}
++
++			// angular test on current vertex to guess whether it is a corner (ord = number of edges holding i)
++			if(ord==2) { 
++				long  n1 = head_v[i];
++				long  n2 = next_p[n1];
++				long  i1 = n1/2, i2 = n2/2; // edge number
++				long  j1 = n1%2, j2 = n2%2; // vertex in the edge 
++				float angle1=  j1 ? OppositeAngle(eangle[i1]) : eangle[i1];
++				float angle2= !j2 ? OppositeAngle(eangle[i2]) : eangle[i2];
++				float da12 = Abs(angle2-angle1);
++				if (( da12 >= MaxCornerAngle ) && (da12 <= 2*Pi -MaxCornerAngle)) {
++					vertices[i].SetCorner() ; 
++				}
++				// if the edge type/referencenumber a changing then is SetRequired();
++				if (edges[i1].type != edges[i2].type || edges[i1].Required()){
++					vertices[i].SetRequired();
++				}
++				if (edges[i1].ReferenceNumber != edges[i2].ReferenceNumber) {
++					vertices[i].SetRequired();
++				}
++			}
++			if(ord != 2) {
++				vertices[i].SetCorner();
++			}
++
++			/*close the list around the vertex to have a circular loop*/
++			long no=-1, ne = head_v[i];
++			while (ne >=0) ne = next_p[no=ne];        
++			if(no>=0) next_p[no] = head_v[i];
++		}
++
++		/*Check that the list makes sense (we have all the time the same vertex)
++		 * and build adjacent edges*/
++		k =0;
++		for (i=0;i<nbe;i++){
++			for (j=0;j<2;j++){
++
++				long n1 = next_p[k++]; 
++				long i1 = n1/2 ,j1=n1%2;
++
++				if( edges[i1].v[j1] != edges[i].v[j]) _error2_("Problem while processing edges: check the edge list");
++
++				edges[i1].Adj[j1] = edges + i;
++				edges[i1].AdjVertexIndex[j1] = j;
++			}
++		}
++
++		/* generation of  all the tangents*/
++		for (i=0;i<nbe;i++) {
++			R2    AB =edges[i].v[1]->r -edges[i].v[0]->r;// AB = vertex0 -> vertex1
++			double lAB=Norme2(AB);                       // Get length of AB
++			double ltg2[2]={0.0};                        // initialize tangent
++
++			//loop over the 2 vertices of the edge
++			for (j=0;j<2;j++) {
++				R2     tg =edges[i].tg[j];
++				double ltg=Norme2(tg);
++
++				//by default, tangent=[0 0]
++				if(ltg==0){
++					//if the current vertex of the edge is not a corner
++					if(!edges[i].v[j]->Corner()){
++						/*The tangent is set as the vector between the
++						 * previous and next vertices connected to current vertex
++						 * normed by the edge length*/
++						tg = edges[i].v[1-j]->r - edges[i].Adj[j]->v[1-edges[i].AdjVertexIndex[j]]->r;
++						ltg= Norme2(tg);
++						tg = tg *(lAB/ltg);
++						ltg= lAB;
++					}
++					//else:  a Corner no tangent => nothing to do    
++				}
++				else{
++					//tangent has already been computed
++					tg = tg*(lAB/ltg),ltg=lAB;
++				}
++
++				ltg2[j] = ltg;
++
++				if ((tg,AB)<0) tg = -tg;
++
++				edges[i].tg[j]=tg;
++			}
++			if (ltg2[0]!=0) edges[i].SetTgA();
++			if (ltg2[1]!=0) edges[i].SetTgB();
++		} 
++
++		/* generation of  all curves (from corner to corner)*/
++		/*We proceed in 2 steps: first allocate, second build*/
++		for (int step=0;step<2;step++){
++
++			//unmark all edges
++			for (i=0;i<nbe;i++) edges[i].SetUnMark();
++			long  nb_marked_edges=0;
++
++			//initialize number of curves
++			nbcurves = 0;
++
++			for (int level=0;level<2 && nb_marked_edges!=nbe;level++){
++				for (i=0;i<nbe;i++){
++
++					GeomEdge & ei=edges[i];   
++					for(j=0;j<2;j++){
++						/*If current edge ei is unmarked and (level=1 or vertex i is required (corner)):
++						 * we do have the first edge of a new curve*/
++						if (!ei.Mark() && (level || ei[j].Required())) { 
++							int k0=j,k1;
++							GeomEdge   *e=&ei;
++							GeomVertex *a=(*e)(k0); // begin 
++							if(curves){
++								curves[nbcurves].FirstEdge=e;
++								curves[nbcurves].FirstVertexIndex=k0;
++							}
++							int nee=0;
++							for(;;){ 
++								nee++;
++								k1 = 1-k0; // next vertex of the edge 
++								e->SetMark();
++								nb_marked_edges++;
++								e->CurveNumber=nbcurves;
++								GeomVertex *b=(*e)(k1);
++
++								//break if we have reached the other end of the curve
++								if (a==b || b->Required()){
++									if(curves){
++										curves[nbcurves].LastEdge=e;
++										curves[nbcurves].LastVertexIndex=k1;
++									}
++									break;
++								}
++								//else: go to next edge (adjacent)
++								else{
++									k0 = e->AdjVertexIndex[k1];//  vertex in next edge
++									e  = e->Adj[k1]; // next edge
++								}
++							}
++							nbcurves++;
++							if(level) a->SetRequired();
++						}
++					}
++				} 
++			}
++			_assert_(nb_marked_edges && nbe);
++			//allocate if first step
++			if(step==0) curves=new Curve[nbcurves];
++		} 
++
++		/*clean up*/
++		delete [] next_p;
++		delete [] head_v;
++		delete [] eangle;
++
++	}
++	/*}}}*/
++	/*FUNCTION Geometry::ProjectOnCurve {{{*/
++	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*/
++
++		double save_s=s;
++		int NbTry=0;
++
++retry:
++
++		s=save_s;
++		GeomEdge* on=e.GeomEdgeHook;
++		if (!on){
++			_error2_("ProjectOnCurve error message: edge provided should be on geometry");
++		}
++		if (!e[0].GeomEdgeHook ||  !e[1].GeomEdgeHook){
++			_error2_("ProjectOnCurve error message: at least one of the vertex of the edge provided is not on geometry");
++		}
++
++		//Get the two vertices of the edge
++		const BamgVertex &v0=e[0];
++		const BamgVertex &v1=e[1];
++
++		//Get position of V0, V1 and vector v0->v1
++		R2 V0=v0,V1=v1,V01=V1-V0;
++
++		//Get geometrical vertices corresponding to v0 and v1
++		VertexOnGeom  vg0=*v0.GeomEdgeHook,  vg1=*v1.GeomEdgeHook;
++
++		//build two pointers towrad current geometrical edge
++		GeomEdge *eg0=on, *eg1=on;
++
++		//Get edge direction and swap v0 and v1 if necessary
++		R2 Ag=(R2)(*on)[0],Bg=(R2)(*on)[1],AB=Bg-Ag; 
++		int OppositeSens = (V01,AB)<0;
++		int direction0=0,direction1=1;
++		if (OppositeSens) s=1-s,Exchange(vg0,vg1),Exchange(V0,V1);
++
++		//Compute metric of new vertex as a linear interpolation of the two others
++		V.m=Metric(1.0-s,v0,s,v1);
++
++		const int mxe=100;
++		GeomEdge* ge[mxe+1];
++		int     directionge[mxe+1];
++		double  lge[mxe+1];
++		int bge=mxe/2,tge=bge;
++		ge[bge] = e.GeomEdgeHook;
++		directionge[bge]=1;
++
++		while (eg0!=(GeomEdge*)vg0 && (*eg0)(direction0)!=(GeomVertex*)vg0){ 
++			if (bge<=0) {
++				if(NbTry) {
++					_printLine_("Fatal Error: on the class Mesh before call Geometry::ProjectOnCurve");
++					_printLine_("That bug might come from:");
++					_printLine_(" 1)  a mesh edge  containing more than " << mxe/2 << " geometrical edges");
++					_printLine_(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before");
++					_printLine_("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)");
++					_error2_("see above");
++				}
++				NbTry++;
++				goto retry;
++			}
++			GeomEdge* tmpge = eg0;
++			ge[--bge] =eg0 = eg0->Adj[direction0];
++			_assert_(bge>=0 && bge<=mxe);
++			direction0 = 1-( directionge[bge] = tmpge->AdjVertexIndex[direction0]);
++		}
++		while (eg1 != (GeomEdge*) vg1  &&  (*eg1)(direction1) != (GeomVertex*) vg1) { 
++			if(tge>=mxe ) { 
++				_printLine_("WARNING: on the class Mesh before call Geometry::ProjectOnCurve is having issues (isn't it Eric?)");
++				NbTry++;
++				if (NbTry<2) goto retry;
++				_printLine_("Fatal Error: on the class Mesh before call Geometry::ProjectOnCurve");
++				_printLine_("That bug might come from:");
++				_printLine_(" 1)  a mesh edge  contening more than " << mxe/2 << " geometrical edges");
++				_printLine_(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before");
++				_printLine_("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)");
++				_error2_("see above");
++			}
++			GeomEdge* tmpge = eg1;
++			ge[++tge] =eg1 = eg1->Adj[direction1];
++			directionge[tge]= direction1 = 1-tmpge->AdjVertexIndex[direction1];
++			_assert_(tge>=0 && tge<=mxe);
++		}
++
++
++		if ((*eg0)(direction0)==(GeomVertex*)vg0)
++		 vg0=VertexOnGeom(*(BamgVertex*) vg0,*eg0,direction0); //vg0 = absisce
++
++		if ((*eg1)(direction1)==(GeomVertex*)vg1)
++		 vg1=VertexOnGeom(*(BamgVertex*) vg1,*eg1,direction1);
++
++		double sg;
++		if (eg0 == eg1) { 
++			register double s0=vg0,s1=vg1;
++			sg =  s0*(1.0-s) +  s*s1;
++			on=eg0;
++		}
++		else {
++			R2 AA=V0,BB;
++			double s0,s1;
++			int i=bge;
++			double ll=0;
++			for(i=bge;i<tge;i++){
++				_assert_(i>=0 && i<=mxe);
++				BB =  (*ge[i])[directionge[i]];
++				lge[i]=ll += Norme2(AA-BB);
++				AA=BB ;}
++				lge[tge]=ll+=Norme2(AA-V1); 
++				// search the geometrical edge
++				_assert_(s<=1.0);
++				double ls= s*ll;
++				on =0;
++				s0 = vg0;
++				s1= directionge[bge];
++				double l0=0,l1;
++				i=bge;
++				while (  (l1=lge[i]) < ls ) {
++					_assert_(i>=0 && i<=mxe);
++					i++,s0=1-(s1=directionge[i]),l0=l1;
++				}
++				on=ge[i];
++				if (i==tge) 
++				 s1=vg1;
++
++				s  =(ls-l0)/(l1-l0);
++				sg =s0*(1.0-s)+s*s1;    
++		} 
++		_assert_(on);
++		V.r= on->F(sg);
++		GV=VertexOnGeom(V,*on,sg);
++		return on;
++	}
++	/*}}}*/
++	/*FUNCTION Geometry::R2ToI2{{{*/
++	I2 Geometry::R2ToI2(const R2 & P) const {
++		/*coefIcoor is the coefficient used for integer coordinates:
++		 *                       (x-pmin.x)
++		 * Icoor x = (2^30 -1) ------------ 
++		 *                          D
++		 * where D is the longest side of the domain (direction x or y)
++		 * so that (x-pmin.x)/D is in ]0 1[
++		 *
++		 * coefIcoor = (2^30 -1)/D
++		 */
++		return  I2( (Icoor1) (coefIcoor*(P.x-pmin.x)) ,(Icoor1) (coefIcoor*(P.y-pmin.y)) );
++	}/*}}}*/
++	/*FUNCTION Geometry::UnMarkEdges{{{*/
++	void Geometry::UnMarkEdges() {
++		for (int i=0;i<nbe;i++) edges[i].SetUnMark();
++	}/*}}}*/
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnEdge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnEdge.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnEdge.cpp	(revision 12821)
+@@ -0,0 +1,25 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "VertexOnEdge.h"
++#include "Mesh.h"
++
++namespace bamg {
++
++	/*Methods*/
++	/*FUNCTION VertexOnEdge::Set {{{*/
++	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(){
++		v->BackgroundEdgeHook=this;
++		v->IndexInTriangle=IsVertexOnEdge;  
++	}
++	/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/AdjacentTriangle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/AdjacentTriangle.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/AdjacentTriangle.cpp	(revision 12821)
+@@ -0,0 +1,76 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "AdjacentTriangle.h"
++#include "Mesh.h"
++
++namespace bamg {
++
++
++	/*Constructors/Destructors*/
++	//See header file
++
++	/*Methods*/
++	/*FUNCTION AdjacentTriangle::Locked {{{*/
++	int  AdjacentTriangle::Locked() const {
++		return t->AdjEdgeIndex[a] & 4;
++	}
++	/*}}}*/
++	/*FUNCTION AdjacentTriangle::MarkUnSwap {{{*/
++	int  AdjacentTriangle::MarkUnSwap() const {
++		return t->AdjEdgeIndex[a] & 8;
++	}
++	/*}}}*/
++	/*FUNCTION AdjacentTriangle::GetAllFlag_UnSwap {{{*/
++	int  AdjacentTriangle::GetAllFlag_UnSwap() const {
++		// take all flag except MarkUnSwap
++		return t->AdjEdgeIndex[a] & 1012;
++	}
++	/*}}}*/
++	/*FUNCTION AdjacentTriangle::SetLock {{{*/
++	void AdjacentTriangle::SetLock(){
++		t->SetLocked(a);
++	}
++	/*}}}*/
++	/*FUNCTION AdjacentTriangle::Adj {{{*/
++	AdjacentTriangle AdjacentTriangle::Adj() const {
++		return  t->Adj(a);
++	}
++	/*}}}*/
++	/*FUNCTION AdjacentTriangle::EdgeVertex {{{*/
++	BamgVertex* AdjacentTriangle::EdgeVertex(const int & i) const {
++		return t->vertices[VerticesOfTriangularEdge[a][i]];
++	}
++	/*}}}*/
++	/*FUNCTION AdjacentTriangle::OppositeVertex {{{*/
++	BamgVertex* AdjacentTriangle::OppositeVertex() const {
++		return t->vertices[bamg::OppositeVertex[a]]; 
++	}
++	/*}}}*/
++	/*FUNCTION AdjacentTriangle::det {{{*/
++	Icoor2 & AdjacentTriangle::det() const {
++		return t->det;
++	}
++	/*}}}*/
++	/*FUNCTION AdjacentTriangle::swap {{{*/
++	int AdjacentTriangle::swap(){
++		return  t->swap(a);
++	}
++	/*}}}*/
++	/*FUNCTION AdjacentTriangle::SetAdj2 {{{*/
++	void AdjacentTriangle::SetAdj2(const AdjacentTriangle & ta, int l  ){
++		//set Adjacent Triangle of a triangle
++		if(t) {
++			t->adj[a]=ta.t;
++			t->AdjEdgeIndex[a]=ta.a|l;
++		}
++		if(ta.t) {
++			ta.t->adj[ta.a] = t ;
++			ta.t->AdjEdgeIndex[ta.a] = a| l ;
++		}
++	}
++	/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.h	(revision 12821)
+@@ -0,0 +1,194 @@
++#ifndef _MESH_H_
++#define _MESH_H_
++
++#include "./include.h"
++#include "./BamgOpts.h"
++#include "./BamgMesh.h"
++#include "./BamgGeom.h"
++#include "./Triangle.h"
++#include "./VertexOnGeom.h"
++#include "./VertexOnVertex.h"
++#include "./VertexOnEdge.h"
++#include "./ListofIntersectionTriangles.h"
++
++namespace bamg {
++
++	//classes
++	class Geometry;
++	class CrackedEdge;
++	class BamgQuadtree;
++	class SubDomain;
++
++	class Mesh {
++
++		public:
++
++			Geometry                    & Gh;                    // Geometry
++			Mesh                        & BTh;                   // Background Mesh Bth== *this =>no background
++			BamgVertex                   *vertices;
++			Triangle                     *triangles;
++			Edge                         *edges;
++			BamgQuadtree                 *quadtree;
++			BamgVertex                  **orderedvertices;
++			SubDomain                    *subdomains;
++			long                          NbRef;                 // counter of ref on the this class if 0 we can delete
++			long                          maxnbv,maxnbt;         // nombre max de sommets , de triangles
++			long                          nbv,nbt,nbe,nbq;       // nb of vertices, of triangles, of edges and quadrilaterals
++			long                          nbsubdomains;
++			long                          nbtout;                // Nb of oudeside triangle
++
++			R2                            pmin,pmax;             // extrema
++			double                        coefIcoor;             // coef to integer Icoor1;
++			ListofIntersectionTriangles   lIntTria;
++
++			long                          NbVerticesOnGeomVertex;
++			VertexOnGeom                 *VerticesOnGeomVertex;
++			long                          NbVerticesOnGeomEdge;
++			VertexOnGeom                 *VerticesOnGeomEdge;
++			long                          NbVertexOnBThVertex;
++			VertexOnVertex               *VertexOnBThVertex;
++			long                          NbVertexOnBThEdge;
++			VertexOnEdge                 *VertexOnBThEdge;
++			long                          NbCrackedVertices;
++			long                         *CrackedVertices;
++			long                          NbCrackedEdges;
++			CrackedEdge                  *CrackedEdges;
++
++			//Constructors/Destructors
++			Mesh(BamgGeom* bamggeom,BamgMesh* bamgmesh,BamgOpts* bamgopts);
++			Mesh(int* index,double* x,double* y,int nods,int nels);/*MeshConvert*/
++			Mesh(double* x,double* y,int nods); /*BamgTriangulate*/
++			Mesh(Mesh &,Geometry * pGh=0,Mesh* pBTh=0,long maxnbv_in=0 ); //copy operator
++			Mesh(const Mesh &,const int *flag,const int *bb,BamgOpts* bamgopts); // truncature
++			Mesh(long maxnbv,Mesh & BT,BamgOpts* bamgopts,int keepBackVertices=1);
++			Mesh(long maxnbv,Geometry & G,BamgOpts* bamgopts);
++			~Mesh(); 
++
++			//Operators
++			const BamgVertex &operator[](long i) const { return vertices[i];  };
++			BamgVertex       &operator[](long i) { return vertices[i];        };
++			const Triangle   &operator()(long i) const { return triangles[i]; };
++			Triangle         &operator()(long  i) { return triangles[i];             };
++
++			//Methods
++			void SetIntCoor(const char * from =0);
++			double MinimalHmin();
++			double MaximalHmax();
++			I2 R2ToI2(const R2 & P) const;
++			R2 I2ToR2(const I2 & P) const;
++			void AddVertex(BamgVertex & s,Triangle * t,Icoor2 *  =0) ;
++			void Insert();
++			void Echo(void);
++			void ForceBoundary();
++			void FindSubDomain(int OutSide=0);
++			long TriangleReferenceList(long*) const;
++			void TriangleIntNumbering(long* renumbering);
++			void ShowHistogram() const;
++			void CrackMesh(BamgOpts* bamgopts);
++			void ShowRegulaty() const;
++			void SmoothMetric(double raisonmax) ;
++			void BoundAnisotropy(double anisomax,double hminaniso= 1e-100) ;
++			void MaxSubDivision(double maxsubdiv);
++			Edge** MakeGeomEdgeToEdge();
++			long SplitInternalEdgeWithBorderVertices();
++			void MakeQuadrangles(double costheta);
++			int  SplitElement(int choice);
++			void MakeBamgQuadtree();
++			void NewPoints(Mesh &,BamgOpts* bamgopts,int KeepVertices=1);
++			long InsertNewPoints(long nbvold,long & NbTSwap) ; 
++			void TrianglesRenumberBySubDomain(bool justcompress=false);
++			void VerticesRenumber(long * renu);
++			void SmoothingVertex(int =3,double=0.3);
++			Metric MetricAt (const R2 &) const;
++			GeomEdge* ProjectOnCurve( Edge & AB, BamgVertex &  A, BamgVertex & B,double theta, BamgVertex & R,VertexOnEdge & BR,VertexOnGeom & GR);
++			long GetId(const Triangle & t) const;
++			long GetId(const Triangle * t) const;
++			long GetId(const BamgVertex & t) const;
++			long GetId(const BamgVertex * t) const;
++			long GetId(const Edge & t) const;
++			long GetId(const Edge * t) const;
++			BamgVertex* NearestVertex(Icoor1 i,Icoor1 j) ;
++			Triangle* TriangleFindFromCoord(const I2 & ,Icoor2 [3],Triangle *tstart=0) const;
++			void ReadMesh(int* index,double* x,double* y,int nods,int nels);
++			void ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts);
++			void WriteMesh(BamgMesh* bamgmesh,BamgOpts* bamgopts);
++			void ReadMetric(const BamgOpts* bamgopts);
++			void WriteMetric(BamgOpts* bamgopts);
++			void WriteIndex(int** pindex,int* pnels);
++			void AddMetric(BamgOpts* bamgopts);
++			void BuildMetric0(BamgOpts* bamgopts);
++			void BuildMetric1(BamgOpts* bamgopts);
++			void AddGeometryMetric(BamgOpts* bamgopts);
++			int  isCracked() const;
++			void BuildGeometryFromMesh(BamgOpts* bamgopts=NULL);
++			void ReconstructExistingMesh();
++
++			//Inline methods
++			inline  void CreateSingleVertexToTriangleConnectivity(){
++				for (int i=0;i<nbv;i++) vertices[i].IndexInTriangle=0, vertices[i].t=NULL;
++				for (int i=0;i<nbt;i++) triangles[i].SetSingleVertexToTriangleConnectivity();
++			}
++			inline  void  UnMarkUnSwapTriangle(){
++				for (int i=0;i<nbt;i++)
++				 for(int j=0;j<3;j++)
++				  triangles[i].SetUnMarkUnSwap(j);
++			  }
++			inline  void  SetVertexFieldOn(){
++				for (int i=0;i<nbv;i++)                    vertices[i].GeomEdgeHook=NULL;
++				for (int j=0;j<NbVerticesOnGeomVertex;j++) VerticesOnGeomVertex[j].SetOn();
++				for (int k=0;k<NbVerticesOnGeomEdge;k++ )  VerticesOnGeomEdge[k].SetOn();
++			}	       
++			inline  void   SetVertexFieldOnBTh(){
++				for (int i=0;i<nbv;i++)                 vertices[i].GeomEdgeHook=NULL;
++				for (int j=0;j<NbVertexOnBThVertex;j++) VertexOnBThVertex[j].SetOnBTh();
++				for (int k=0;k<NbVertexOnBThEdge;k++ )  VertexOnBThEdge[k].SetOnBTh();
++			}
++
++		private:
++			void TriangulateFromGeom1(BamgOpts* bamgopts,int KeepVertices=1);// the real constructor mesh adaption
++			void TriangulateFromGeom0(BamgOpts* bamgopts);// the real constructor mesh generator
++			void Triangulate(double* x,double* y,int nods);
++			void Init(long);
++	};
++
++	/*Intermediary*/
++	AdjacentTriangle CloseBoundaryEdge(I2 ,Triangle *, double &,double &) ;
++	AdjacentTriangle CloseBoundaryEdgeV2(I2 A,Triangle *t, double &a,double &b);
++	void  swap(Triangle *t1,short a1,
++				Triangle *t2,short a2,
++				BamgVertex *s1,BamgVertex *s2,Icoor2 det1,Icoor2 det2);
++	int SwapForForcingEdge(BamgVertex   *  & pva ,BamgVertex  * &   pvb ,
++				AdjacentTriangle & tt1,Icoor2 & dets1,
++				Icoor2 & detsa,Icoor2 & detsb, int & nbswap);
++	int ForceEdge(BamgVertex &a, BamgVertex & b,AdjacentTriangle & taret) ;
++	inline AdjacentTriangle Previous(const AdjacentTriangle & ta){
++		return AdjacentTriangle(ta.t,PreviousEdge[ta.a]);
++	}
++	inline AdjacentTriangle Next(const AdjacentTriangle & ta){
++		return AdjacentTriangle(ta.t,NextEdge[ta.a]);
++	}
++	inline  AdjacentTriangle Adj(const AdjacentTriangle & a){
++		return  a.Adj();
++	}
++	inline void Adj(GeomEdge * & on,int &i){
++		int j=i;i=on->AdjVertexIndex[i];on=on->Adj[j];
++	}
++	inline double qualite(const BamgVertex &va,const BamgVertex &vb,const BamgVertex &vc){
++		double ret; 
++		I2 ia=va,ib=vb,ic=vc;
++		I2 ab=ib-ia,bc=ic-ib,ac=ic-ia;
++		Icoor2 deta=Det(ab,ac);
++		if (deta <=0) ret = -1;
++		else {
++			double a = sqrt((double) (ac,ac)),
++					 b = sqrt((double) (bc,bc)),
++					 c = sqrt((double) (ab,ab)),
++					 p = a+b+c;
++			double h= Max(Max(a,b),c),ro=deta/p;
++			ret = ro/h;
++		}
++		return ret;
++	}
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.cpp	(revision 12821)
+@@ -0,0 +1,598 @@
++#include <limits.h>
++#include <string.h>
++#include <stdlib.h>
++
++#include "../objects.h"
++
++namespace bamg {
++
++	/*MACROS {{{*/
++	/* 
++	 * 
++	 *    J    j
++	 *    ^    ^
++	 *    |    | +--------+--------+
++	 *    |    | |        |        |
++	 * 1X |    | |   2    |   3    |
++	 *    |    | |        |        |
++	 *    |    | +--------+--------+
++	 *    |    | |        |        |
++	 * 0X |    | |   0    |   1    |
++	 *    |    | |        |        |
++	 *    |    | +--------+--------+
++	 *    |    +-----------------------> i
++	 *    |         
++	 *    |----------------------------> I
++	 *              X0        X1  
++	 *
++	 * box 0 -> I=0 J=0 IJ=00  = 0
++	 * box 1 -> I=1 J=0 IJ=01  = 1
++	 * box 2 -> I=0 J=1 IJ=10  = 2
++	 * box 3 -> I=1 J=1 IJ=11  = 3
++	 */
++#define INTER_SEG(a,b,x,y) (((y) > (a)) && ((x) <(b)))
++#define ABS(i) ((i)<0 ?-(i) :(i))
++#define MAX1(i,j) ((i)>(j) ?(i) :(j))
++#define NORM(i1,j1,i2,j2) MAX1(ABS((i1)-(j1)),ABS((i2)-(j2)))
++
++	//IJ(i,j,l) returns the box number of i and j with respect to l
++	//if !j&l and !i&l -> 0 (box zero: lower left )
++	//if !j&l and  i&l -> 1 (box one:  lower right)
++	//if  j&l and !i&l -> 2 (box two:  upper left )
++	//if  j&l and  i&l -> 3 (box three:upper right)
++#define IJ(i,j,l)  ((j&l) ? ((i&l) ? 3:2 ) :((i&l) ? 1:0 ))
++
++	//I_IJ(k,l) returns l if first  bit of k is 1, else 0
++#define I_IJ(k,l)  ((k&1) ? l:0)
++	//J_IJ(k,l) returns l if second bit of k is 1, else 0
++#define J_IJ(k,l)  ((k&2) ? l:0)
++	/*}}}*/
++	/*DOCUMENTATION What is a BamgQuadtree? {{{
++	 * A Quadtree is a very simple way to group vertices according
++	 * to their locations. A square that holds all the points of the mesh
++	 * (or the geometry) is divided into 4 boxes. As soon as one box
++	 * hold more than 4 vertices, it is divided into 4 new boxes, etc...
++	 * There cannot be more than MAXDEEP (=30) subdivision.
++	 * This process is like a Dichotomy in dimension 2
++	 *
++	 *  + - -  -    - -    -    - - + -   - + - + - + - -     - - +
++	 *  |                           |       |   | X |             |
++	 *                                      + - + - +
++	 *  |                           |       |   |   |             |
++	 *                              + -   - + - + - +             +
++	 *  |                           |       |       |             |
++	 *                         
++	 *  |                           |       |       |             |
++	 *  + - -  -    - -    -    - - + -   - + -   - + - -     - - +
++	 *  |                           |               |             |
++	 *                         
++	 *  |                           |               |             |
++	 *                         
++	 *  |                           |               |             |
++	 *  |                           |               |             |
++	 *  + - -  -    - -    -    - - + -   -   -   - + - -     - - +
++	 *  |                           |                             |
++	 *                         
++	 *  |                           |                             |
++	 *                         
++	 *  |                           |                             |
++	 *                         
++	 *  |                           |                             |
++	 *  |                           |                             |
++	 *  |                           |                             |
++	 *  |                           |                             |
++	 *  |                           |                             |
++	 *  + - -  -    - -    -    - - + -   -   -   -   - -     - - +
++	 *
++	 * The coordinate system used in a quadtree are integers to avoid
++	 * round-off errors. The vertex in the lower left box has the coordinates
++	 * (0 0) 
++	 * The upper right vertex has the follwing coordinates:
++	 * 2^30 -1           2^30 -1        in decimal
++	 * 0 1 1 1 .... 1    0 1 1 1 .... 1 in binary
++	 *  \--   29  --/     \--   29  --/
++	 * Using binaries is therefore very easy to locate a vertex in a box:
++	 * we just need to look at the bits from the left to the right (See ::Add)
++	 }}}*/
++
++	/*Constructors/Destructors*/
++	/*FUNCTION BamgQuadtree::BamgQuadtree(){{{*/
++	BamgQuadtree::BamgQuadtree(){
++
++		/*Number of boxes and vertices*/
++		NbBamgQuadtreeBox=0;
++		NbVertices=0;
++
++		/*Create container*/
++		boxcontainer=new DataSet();
++
++		/*Create Root, pointer toward the main box*/
++		root=NewBamgQuadtreeBox();
++
++		}
++	/*}}}*/
++	/*FUNCTION BamgQuadtree::BamgQuadtree(Mesh * t,long nbv){{{*/
++	BamgQuadtree::BamgQuadtree(Mesh * t,long nbv){ 
++
++		/*Number of boxes and vertices*/
++		NbBamgQuadtreeBox=0;
++		NbVertices=0;
++
++		/*Create container*/
++		boxcontainer=new DataSet();
++
++		/*Create Root, pointer toward the main box*/
++		root=NewBamgQuadtreeBox();
++
++		/*Check Sizes*/
++		_assert_(MaxISize>MaxICoor);
++
++		/*Add all vertices of the mesh*/
++		if (nbv==-1) nbv=t->nbv;
++		for (int i=0;i<nbv;i++) Add(t->vertices[i]);
++
++	}
++	/*}}}*/
++	/*FUNCTION BamgQuadtree::~BamgQuadtree(){{{*/
++	BamgQuadtree::~BamgQuadtree() {
++		delete boxcontainer;
++		root=NULL;
++	}
++	/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION BamgQuadtree::Add{{{*/
++	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;
++
++		/*Get integer coodinate of current point w*/
++		register long i=w.i.x, j=w.i.y;
++
++		/*Initialize level*/
++		register long level=MaxISize;
++
++		/*Get inital box (the largest)*/
++		pb = &root;
++
++		/*Find the smallest box where w is located*/
++		while((b=*pb) && (b->nbitems<0)){ 
++
++			//shift b->nbitems by -1
++			b->nbitems--;
++
++			//shifted righ by one bit: level=00000010 -> 00000001
++			level >>= 1;
++
++			//Get next subbox according to the bit value (level)
++			pb = &b->b[IJ(i,j,level)];
++		}
++
++		/*OK, we have found b, a Subbox holding vertices (might be full)
++		  check that the vertex is not already in the box*/
++		if (b){      
++			if (b->nbitems > 3 &&  b->v[3] == &w) return;
++			if (b->nbitems > 2 &&  b->v[2] == &w) return;
++			if (b->nbitems > 1 &&  b->v[1] == &w) return;
++			if (b->nbitems > 0 &&  b->v[0] == &w) return;
++		}
++
++		/*check that l is not 0 (this should not happen as MaxDepth = 30)*/
++		_assert_(level>0);
++
++		/*Now, try to add the vertex, if the subbox is full (nbitems=4), we have to divide it
++		  in 4 new subboxes*/
++		while ((b= *pb) && (b->nbitems == 4)){ // the BamgQuadtreeBox is full
++
++			/*Copy the 4 vertices in the current BamgQuadtreebox*/
++			BamgVertex* v4[4];
++			v4[0]= b->v[0];
++			v4[1]= b->v[1];
++			v4[2]= b->v[2];
++			v4[3]= b->v[3];
++
++			/*set nbitems as negative 
++			 * (box full -> holds 4 pointers toward subboxes and not 4 vertices)*/
++			b->nbitems = -b->nbitems;
++
++			/*Initialize the 4 pointers toward the 4 subboxes*/
++			b->b[0]=b->b[1]=b->b[2]=b->b[3]=NULL;
++
++			/*level = 0010000 -> 0001000*/
++			level >>= 1;
++
++			/*Put the four vertices in the new boxes*/
++			for (int k=0;k<4;k++){
++
++				int          ij;
++				/*bb is the new "sub"box of b where v4[k] is located*/
++				BamgQuadtreeBox *bb = b->b[ij=IJ(v4[k]->i.x,v4[k]->i.y,level)];
++
++				// alloc the BamgQuadtreeBox
++				if (!bb) bb=b->b[ij]=NewBamgQuadtreeBox(); 
++
++				/*Copy the current vertex*/
++				bb->v[bb->nbitems++] = v4[k];
++			}
++
++			/*Get the subbox where w (i,j) is located*/
++			pb = &b->b[IJ(i,j,level)];
++		}
++
++		/*alloc the BamgQuadtreeBox if necessary*/
++		if (!(b=*pb)) b=*pb= NewBamgQuadtreeBox();
++
++		/*Add w*/
++		b->v[b->nbitems++]=&w;
++
++		//Increase NbVertices by one (we have one new vertex)
++		NbVertices++;
++	}
++	/*}}}*/
++	/*FUNCTION BamgQuadtree::NearestVertex{{{*/
++	BamgVertex*  BamgQuadtree::NearestVertex(Icoor1 i,Icoor1 j) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, BamgQuadtree.cpp/NearestVertex)*/
++
++		/*Intermediaries*/
++		BamgQuadtreeBox *pb[MaxDepth];
++		int          pi[MaxDepth];
++		Icoor1       ii[MaxDepth];
++		Icoor1       jj[MaxDepth];
++		int          level;
++		long         n0;
++		BamgQuadtreeBox *b;
++		long         h0;
++		long         h = MaxISize;
++		long         hb= MaxISize;
++		Icoor1       i0=0,j0=0;
++
++		/*initial output as NULL (no vertex found)*/
++		BamgVertex*  nearest_v=NULL;
++
++		/*Project w coordinates (i,j) onto [0,MaxISize-1] x [0,MaxISize-1] -> (iplus,jplus)*/
++		Icoor1 iplus( i<MaxISize ? (i<0?0:i) : MaxISize-1);
++		Icoor1 jplus( j<MaxISize ? (j<0?0:j) : MaxISize-1);
++
++		/*Get initial Quadtree box (largest)*/
++		b = root;
++
++		/*if the tree is empty, return NULL pointer*/
++		if (!root->nbitems) return nearest_v; 
++
++		/*else, find the smallest non-empty BamgQuadtreeBox containing  the point (i,j)*/
++		while((n0=b->nbitems)<0){
++
++			Icoor1       hb2 = hb >> 1;             //size of the current box
++			int          k   = IJ(iplus,jplus,hb2); //box number (0,1,2 or 3)
++			BamgQuadtreeBox *b0  = b->b[k];             //pointer toward current box
++
++			/* break if NULL box or empty (Keep previous box b)*/
++			if (( b0 == NULL) || (b0->nbitems == 0)) break;
++
++			/*Get next Quadtree box*/
++			b=b0;	
++			i0 += I_IJ(k,hb2); // i orign of BamgQuadtreeBox (macro)
++			j0 += J_IJ(k,hb2); // j orign of BamgQuadtreeBox 
++			hb = hb2;          // size of the box (in Int)
++		}
++
++		/*The box b, is the smallest box containing the point (i,j) and
++		 * has the following properties:
++		 * - n0: number of items (>0 if vertices, else boxes)
++		 * - hb: box size (int)
++		 * - i0: x coordinate of the lower left corner
++		 * - j0: y coordinate of the lower left corner*/
++
++		/* if the current subbox is holding vertices, we are almost done*/
++		if (n0>0){  
++			//loop over the vertices of the box and find the closest vertex
++			for(int k=0;k<n0;k++){
++
++				/*get integer coordinates of current vertex*/
++				I2 i2=b->v[k]->i;
++
++				/*Compute norm with w*/
++				h0=NORM(iplus,i2.x,jplus,i2.y);
++
++				/*is it smaller than previous value*/
++				if (h0<h){
++					h = h0;
++					nearest_v = b->v[k];
++				}
++			}
++			/*return closest vertex*/
++			return nearest_v;
++		}
++
++		/* general case: the current box is empty, we have to go backwards
++			and find the closest not-empty box and find the closest vertex*/
++
++		/*Initialize search variables*/
++		pb[0]=b;                             //pointer toward the box b
++		pi[0]=b->nbitems>0?(int)b->nbitems:4;//number of boxes in b
++		ii[0]=i0;                            //i coordinate of the box lowest left corner
++		jj[0]=j0;                            //j coordinate of the box lowest left corner
++
++		/*initialize h: smallest box size, containing a vertex close to w*/
++		h=hb;
++
++		/*Main loop*/
++		level=0;
++		do {
++
++			/*get current box*/
++			b= pb[level];
++
++			/*Loop over the items in current box (if not empty!)*/
++			while (pi[level]){
++
++				/*We are looping now over the items of b. k is the current index (in [0 3])*/
++				pi[level]--;
++				int k=pi[level];
++
++				/*if the current subbox is holding vertices (b->nbitems<0 is subboxes)*/
++				if (b->nbitems>0){
++					I2 i2=b->v[k]->i;
++					h0 = NORM(iplus,i2.x,jplus,i2.y);
++					if (h0<h){
++						h=h0;
++						nearest_v=b->v[k];
++					}
++				}
++				/*else: current box b is pointing toward 4 boxes
++				 * test sub-box k and go deeper into the tree if it is non empty
++				 * and contains the point w modulo a size h that is either the size of the smallest
++				 * non empty box containing w, or the closest point to w (so far) */
++				else{
++					BamgQuadtreeBox* b0=b;
++
++					/*if the next box exists:*/
++					if (b=b->b[k]){
++
++						/*Get size (hb) and coordinates of the current sub-box lowest left corner*/
++						hb>>=1;
++						Icoor1 iii = ii[level]+I_IJ(k,hb);
++						Icoor1 jjj = jj[level]+J_IJ(k,hb);
++
++						/*if the current point (iplus,jplus) is in b (modulo h), this box is good:
++						 * it is holding vertices that are close to w */
++						if (INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)){
++							level++;
++							pb[level]= b;
++							pi[level]= b->nbitems>0 ?(int)  b->nbitems : 4  ;
++							ii[level]= iii;
++							jj[level]= jjj;
++						}
++
++						//else go backwards
++						else{
++							//shifted righ by one bit: hb=001000000 -> 01000000
++							b=b0;
++							hb<<=1;
++						}
++					}
++					else{
++						/*Current box is NULL, go to next subbox of b (k=k-1)*/
++						b=b0;
++					}
++				}
++			}
++
++			/*We have found a vertex, now, let's try the other boxes of the previous level
++			 * in case there is a vertex closest to w that has not yet been tested*/
++			hb <<= 1;
++		} while (level--);
++
++		/*return nearest_v, nearest vertex*/
++		return nearest_v;
++
++	}
++	/*}}}*/
++	/*FUNCTION BamgQuadtree::NearestVertexWithNormal{{{*/
++	BamgVertex*  BamgQuadtree::NearestVertexWithNormal(Icoor1 i,Icoor1 j) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, BamgQuadtree.cpp/NearestVertexWithNormal)*/
++
++		BamgQuadtreeBox * pb[ MaxDepth ];
++		int  pi[ MaxDepth  ];
++		Icoor1 ii[  MaxDepth ], jj [ MaxDepth];
++		int l; // level
++		BamgQuadtreeBox * b;
++		long     h =MaxISize,h0;
++		long     hb=MaxISize;
++		Icoor1  i0=0,j0=0;
++		Icoor1  iplus( i<MaxISize?(i<0?0:i):MaxISize-1);
++		Icoor1  jplus( j<MaxISize?(j<0?0:j):MaxISize-1);
++
++		BamgVertex *vn=0;
++
++		// init for optimisation ---
++		b = root;
++		register long  n0;
++		if (!root->nbitems)
++		 return vn; // empty tree 
++
++		while( (n0 = b->nbitems) < 0) 
++		  {
++			// search the non empty 
++			// BamgQuadtreeBox containing  the point (i,j)
++			register Icoor1 hb2 = hb >> 1 ;
++			register  int k = IJ(iplus,jplus,hb2);// BamgQuadtreeBox number of size hb2 contening i;j
++			register BamgQuadtreeBox * b0= b->b[k];
++			if ( ( b0 == 0) || (b0->nbitems == 0) ) 
++			 break; // null box or empty   => break 	    
++			b=b0;	
++			i0 += I_IJ(k,hb2); // i orign of BamgQuadtreeBox
++			j0 += J_IJ(k,hb2); // j orign of BamgQuadtreeBox 
++			hb = hb2; 
++		  }
++
++
++		if ( n0 > 0) 
++		  {  
++			for(register int k=0;k<n0;k++)
++			  {
++				I2 i2 =  b->v[k]->i;
++				//   try if is in the right direction -- 
++				h0 = NORM(iplus,i2.x,jplus,i2.y);
++				if (h0 <h) {
++					h = h0;
++					vn = b->v[k];}
++			  }
++			if (vn) return vn; 
++		  }
++		// general case -----
++		// INITIALISATION OF THE HEAP 
++		l =0; // level 
++		pb[0]= b;
++		pi[0]=b->nbitems>0 ?(int)  b->nbitems : 4  ;
++		ii[0]=i0;
++		jj[0]=j0;
++		h=hb;
++		do {   // walk on the tree  
++			b= pb[l];
++			while (pi[l]--) // loop on 4 element of the box
++			  { 	      
++				int k = pi[l];
++
++				if (b->nbitems>0) // BamgVertex BamgQuadtreeBox none empty
++				  { 
++					I2 i2 =  b->v[k]->i;
++					// if good direction when try -- 
++
++					h0 = NORM(iplus,i2.x,jplus,i2.y);
++					if (h0 <h) 
++					  {
++						h = h0;
++						vn = b->v[k];
++					  }
++				  }
++				else // Pointer BamgQuadtreeBox 
++				  { 
++					register BamgQuadtreeBox *b0=b;
++					if ((b=b->b[k])) 
++					  {
++						hb >>=1 ; // div by 2
++						register Icoor1 iii = ii[l]+I_IJ(k,hb);
++						register Icoor1 jjj = jj[l]+J_IJ(k,hb);
++
++						if  (INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)) 
++						  {
++							pb[++l]=  b;
++							pi[l]= b->nbitems>0 ?(int)  b->nbitems : 4  ;
++							ii[l]= iii;
++							jj[l]= jjj;
++
++						  }
++						else
++						 b=b0, hb <<=1 ;
++					  }
++					else
++					 b=b0;
++				  }
++			  }
++			hb <<= 1; // mul by 2 
++		} while (l--);
++
++		return vn;
++	}
++	/*}}}*/
++	/*FUNCTION BamgQuadtree::NewBamgQuadtreeBox {{{*/
++	BamgQuadtree::BamgQuadtreeBox* BamgQuadtree::NewBamgQuadtreeBox(void){
++
++		/*Output*/
++		BamgQuadtreeBox* newbox=NULL;
++
++		/*Create and initialize a new box*/
++		newbox=new BamgQuadtreeBox;
++		newbox->nbitems=0;
++		newbox->b[0]=NULL;
++		newbox->b[1]=NULL;
++		newbox->b[2]=NULL;
++		newbox->b[3]=NULL;
++
++		/*Add root to the container*/
++		boxcontainer->AddObject(newbox);
++
++		/*Increase counter*/
++		NbBamgQuadtreeBox++;
++
++		/*currentbox now points toward next quadtree box*/
++		return newbox;
++	}/*}}}*/
++	/*FUNCTION BamgQuadtree::ToClose {{{*/
++	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;
++		const Icoor1 j=v.i.y;
++		const R2 X(v.r);
++		const Metric  Mx(v.m);
++
++		BamgQuadtreeBox * pb[ MaxDepth ];
++		int  pi[ MaxDepth  ];
++		Icoor1 ii[  MaxDepth ], jj [ MaxDepth];
++		register int l=0; // level
++		register BamgQuadtreeBox * b;
++		Icoor1 h=MaxISize;
++		Icoor1 hb =  MaxISize;
++		Icoor1 i0=0,j0=0;
++
++		//  BamgVertex *vn=0;
++
++		if (!root->nbitems)
++		 return 0; // empty tree 
++
++		// general case -----
++		pb[0]=root;
++		pi[0]=root->nbitems>0 ?(int)  root->nbitems : 4  ;
++		ii[0]=i0;
++		jj[0]=j0;
++		h=hb;
++		do {    
++			b= pb[l];
++			while (pi[l]--){ 	      
++				register int k = pi[l];
++
++				if (b->nbitems>0){ // BamgVertex BamgQuadtreeBox none empty
++					I2 i2 =  b->v[k]->i;
++					if ( ABS(i-i2.x) <hx && ABS(j-i2.y) <hy )
++					  {
++						R2 XY(X,b->v[k]->r);
++						double dd;
++						if( (dd= LengthInterpole(Mx(XY), b->v[k]->m(XY)))  < seuil ){
++							return b->v[k]; 
++						}
++					  }
++				}
++				else{ // Pointer BamgQuadtreeBox 
++					register BamgQuadtreeBox *b0=b;
++					if ((b=b->b[k])){
++						hb >>=1 ; // div by 2
++						register long iii = ii[l]+I_IJ(k,hb);
++						register long jjj = jj[l]+J_IJ(k,hb);
++
++						if  (INTER_SEG(iii,iii+hb,i-hx,i+hx) && INTER_SEG(jjj,jjj+hb,j-hy,j+hy)){
++							pb[++l]=  b;
++							pi[l]= b->nbitems>0 ?(int)  b->nbitems : 4  ;
++							ii[l]= iii;
++							jj[l]= jjj;
++
++						}
++						else{
++							b=b0;
++							hb <<=1 ;
++						}
++					}
++					else{
++						b=b0;
++					}
++				}
++			}
++			hb <<= 1; // mul by 2 
++		} while (l--);
++
++		return 0;
++	}
++	/*}}}*/
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgVertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgVertex.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgVertex.cpp	(revision 12821)
+@@ -0,0 +1,256 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "../objects.h"
++
++namespace bamg {
++
++	/*Methods*/
++	/*FUNCTION BamgVertex::Echo {{{*/
++
++	void BamgVertex::Echo(void){
++
++		_printLine_("Vertex:");
++		_printLine_("  integer   coordinates i.x: " << i.x << ", i.y: " << i.y);
++		_printLine_("  Euclidean coordinates r.x: " << r.x << ", r.y: " << r.y);
++		_printLine_("  ReferenceNumber = " << ReferenceNumber);
++		m.Echo();
++
++		return;
++	}
++	/*}}}*/
++	/*FUNCTION BamgVertex::GetReferenceNumber{{{*/
++	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){
++		/*Compute Metric from Hessian*/
++
++		/*get options*/
++		double power=(bamgopts->power);
++		double anisomax=(bamgopts->anisomax);
++		double CutOff=bamgopts->cutoff;
++		double hmin=(bamgopts->hmin);
++		double hmax=(bamgopts->hmax);
++		double coef=bamgopts->coeff;
++		int    Metrictype=(bamgopts->Metrictype);
++
++		/*Intermediary*/
++		double ci;
++
++		/*compute multiplicative coefficient depending on Metric Type (2/9 because it is 2d)*/
++
++		//Absolute Error
++		/*
++		 *            2         1       
++		 *Metric M = ---  ------------   Abs(Hessian)
++		 *            9   err * coeff^2  
++		 */
++		if (Metrictype==0){
++			ci= 2.0/9.0 * 1/(err*coef*coef);
++		}
++
++		//Relative Error
++		/*
++		 *            2         1            Abs(Hessian)
++		 *Metric M = ---  ------------  ----------------------
++		 *            9   err * coeff^2  max( |s| , cutoff*max(|s|) )
++		 *
++		 */
++		else if (Metrictype==1){
++			ci= 2.0/9.0 * 1/(err*coef*coef) * 1/Max( Abs(s), CutOff*(Max(Abs(smin),Abs(smax))));
++		}
++
++		//Rescaled absolute error
++		/*
++		 *            2         1            Abs(Hessian)
++		 *Metric M = ---  ------------  ---------------------- 
++		 *            9   err * coeff^2       (smax-smin)
++		 */
++		else if (Metrictype==2){
++			ci= 2.0/9.0 * 1/(err*coef*coef) * 1/(smax-smin);
++		}
++		else{
++			_error2_("Metrictype " << Metrictype << " not supported yet (use 0,1 or 2(default))");
++		}
++
++		//initialize metric Miv with ci*H
++		Metric Miv(Hxx*ci,Hyx*ci,Hyy*ci);
++
++		//Get eigen values and vectors of Miv
++		EigenMetric Vp(Miv);
++
++		//move eigen valuse to their absolute values
++		Vp.Abs();
++
++		//Apply a power if requested by user
++		if(power!=1.0) Vp.pow(power);
++
++		//modify eigen values according to hmin and hmax
++		Vp.Maxh(hmax);
++		Vp.Minh(hmin);
++
++		//Bound anisotropy by 1/(anisomax)^2
++		Vp.BoundAniso2(1/(anisomax*anisomax));
++
++		//rebuild Metric from Vp
++		Metric MVp(Vp);
++
++		//Apply Metric to vertex
++		m.IntersectWith(MVp);
++
++	}
++	/*}}}*/
++	/*FUNCTION BamgVertex::Optim {{{*/
++	long BamgVertex::Optim(int i,int koption){ 
++		long ret=0;
++		if ( t && (IndexInTriangle >= 0 ) && (IndexInTriangle <3) ){
++			ret = t->Optim(IndexInTriangle,koption);
++			if(!i){
++				t =0; // for no future optime 
++				IndexInTriangle= 0;
++			}
++		}
++		return ret;
++	}
++	/*}}}*/
++	/*FUNCTION BamgVertex::Smoothing{{{*/
++	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)*/
++
++		register BamgVertex* s=this;
++		BamgVertex &vP = *s,vPsave=vP;
++
++		register Triangle* tbegin= t , *tria = t , *ttc;
++
++		register int k=0,kk=0,j = EdgesVertexTriangle[IndexInTriangle][0],jc;
++		R2 P(s->r),PNew(0,0);
++		do {
++			k++; 
++
++			if (!tria->Hidden(j)){
++				BamgVertex &vQ = (*tria)[VerticesOfTriangularEdge[j][0]]; 
++
++				R2 Q = vQ,QP(P-Q);
++				double lQP = LengthInterpole(vP,vQ,QP);
++				PNew += Q+QP/Max(lQP,1e-20);
++				kk ++;
++			}
++			ttc =  tria->TriangleAdj(j);
++			jc = NextEdge[tria->NuEdgeTriangleAdj(j)];
++			tria = ttc;
++			j = NextEdge[jc];
++			if (k>=2000){
++				_error2_("k>=2000 (Maximum number of iterations reached)");
++			}
++		} while ( tbegin != tria); 
++		if (kk<4) return 0;
++		PNew = PNew/(double)kk;
++		R2 Xmove((PNew-P)*omega);
++		PNew = P+Xmove;
++		double delta=Norme2_2(Xmove); 
++
++		Icoor2 deta[3];
++		I2 IBTh  = BTh.R2ToI2(PNew);
++
++		tstart=BTh.TriangleFindFromCoord(IBTh,deta,tstart);  
++
++		if (tstart->det <0){ // outside
++			double ba,bb;
++			AdjacentTriangle edge= CloseBoundaryEdge(IBTh,tstart,ba,bb) ;
++			tstart = edge;
++			vP.m= Metric(ba,*edge.EdgeVertex(0),bb,*edge.EdgeVertex(1));
++		}
++		else { // inside
++			double   aa[3];
++			double s = deta[0]+deta[1]+deta[2];
++			aa[0]=deta[0]/s;
++			aa[1]=deta[1]/s;
++			aa[2]=deta[2]/s;
++			vP.m = Metric(aa,(*tstart)[0],(*tstart)[1],(*tstart)[2]);
++		}
++
++		// recompute the det of the triangle
++		vP.r = PNew;
++
++		vP.i = Th.R2ToI2(PNew);
++
++		BamgVertex vPnew = vP;
++
++		int ok=1;
++		int loop=1;
++		k=0;
++		while (ok){
++			ok =0;
++			do {
++				k++; 
++				double detold = tria->det;
++				tria->det =  bamg::det( (*tria)[0],(*tria)[1]  ,(*tria)[2]);
++				if (loop) {
++					BamgVertex *v0,*v1,*v2,*v3;
++					if (tria->det<0) ok =1;			       
++					else if (tria->Quadrangle(v0,v1,v2,v3))
++					  {
++						vP = vPsave;
++						double qold =QuadQuality(*v0,*v1,*v2,*v3);
++						vP = vPnew;
++						double qnew =QuadQuality(*v0,*v1,*v2,*v3);
++						if (qnew<qold) ok = 1;
++					  }
++					else if ( (double)tria->det < detold/2 ) ok=1;
++
++				}
++				tria->SetUnMarkUnSwap(0);
++				tria->SetUnMarkUnSwap(1);
++				tria->SetUnMarkUnSwap(2);
++				ttc =  tria->TriangleAdj(j);
++				jc = NextEdge[tria->NuEdgeTriangleAdj(j)];
++				tria = ttc;
++				j = NextEdge[jc];
++				if (k>=2000){
++					_error2_("k>=2000");
++				}
++			}while ( tbegin != tria); 
++
++			if (ok && loop) vP=vPsave; // no move 
++			loop=0;
++		}
++		return delta;
++	}
++	/*}}}*/
++
++	/*Intermediary*/
++	/*FUNCTION QuadQuality{{{*/
++	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 --
++		R2 A((R2)a),B((R2)b),C((R2)c),D((R2)d);
++		R2 AB(B-A),BC(C-B),CD(D-C),DA(A-D);
++		//  Move(A),Line(B),Line(C),Line(D),Line(A);
++		const Metric & Ma  = a;
++		const Metric & Mb  = b;
++		const Metric & Mc  = c;
++		const Metric & Md  = d;
++
++		double lAB=Norme2(AB);
++		double lBC=Norme2(BC);
++		double lCD=Norme2(CD);
++		double lDA=Norme2(DA);
++		AB /= lAB;  BC /= lBC;  CD /= lCD;  DA /= lDA;
++		// version aniso 
++		double cosDAB= Ma(DA,AB)/(Ma(DA)*Ma(AB)),sinDAB= Det(DA,AB);
++		double cosABC= Mb(AB,BC)/(Mb(AB)*Mb(BC)),sinABC= Det(AB,BC);
++		double cosBCD= Mc(BC,CD)/(Mc(BC)*Mc(CD)),sinBCD= Det(BC,CD);
++		double cosCDA= Md(CD,DA)/(Md(CD)*Md(DA)),sinCDA= Det(CD,DA);
++		double sinmin=Min(Min(sinDAB,sinABC),Min(sinBCD,sinCDA));
++		if (sinmin<=0) return sinmin;
++		return 1.0-Max(Max(Abs(cosDAB),Abs(cosABC)),Max(Abs(cosBCD),Abs(cosCDA)));
++	}
++	/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Edge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Edge.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Edge.cpp	(revision 12821)
+@@ -0,0 +1,54 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "Edge.h"
++#include "Mesh.h"
++#include "Geometry.h"
++
++namespace bamg {
++
++	/*Constructors/Destructors*/
++
++	/*Methods*/
++	/*FUNCTION Edge::Set {{{*/
++	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]);
++		if (GeomEdgeHook) 
++		 GeomEdgeHook =  ThNew.Gh.edges+Th.Gh.GetId(GeomEdgeHook);
++		if (adj[0]) adj[0] =   ThNew.edges +   Th.GetId(adj[0]);
++		if (adj[1]) adj[1] =   ThNew.edges +   Th.GetId(adj[1]);
++	}
++	/*}}}*/
++	/*FUNCTION Edge::Echo {{{*/
++	void Edge::Echo(void){ 
++		_printLine_("Edge:");
++		_printLine_("   pointers towards two vertices: " << v[0] << " " << v[1]);
++		_printLine_("   ReferenceNumber = " << ReferenceNumber);
++		_printLine_("   GeomEdgeHook = " << GeomEdgeHook);
++		_printLine_("   two adjacent edges on the same curve: " << adj[0] << " " << adj[1]);
++	}
++	/*}}}*/
++	/*FUNCTION Edge::Renumbering{{{*/
++	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){ 
++
++		/*some shecks*/
++		if (!(adj[0]==&e || adj[1]==&e)){ _error2_("Intersection bug"); }
++		_assert_(adj[0]==&e || adj[1]==&e);
++
++		return adj[0]==&e?0:1;
++	}
++	/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.h	(revision 12821)
+@@ -0,0 +1,73 @@
++#ifndef _LISTOFINTERSECTIONTRIANGLES_H_
++#define _LISTOFINTERSECTIONTRIANGLES_H_
++
++#include "./include.h"
++
++namespace bamg {
++
++	class Triangle;
++
++	class ListofIntersectionTriangles {
++
++		class IntersectionTriangles {
++
++			public: 
++				Triangle *t;
++				double    bary[3];   // use if t != 0
++				R2        x;
++				Metric    m;
++				double    s;         // curvilinear coordinate
++				double    sp;        // length of the previous segment in m
++				double    sn;        // length of the next segment in m
++		};
++
++		class SegInterpolation {
++
++			public:
++				GeomEdge *e;
++				double           sBegin  ,sEnd; // abscisse of the seg on edge parameter
++				double           lBegin  ,lEnd; // length abscisse set in ListofIntersectionTriangles::Length
++				int              last;          // last index in ListofIntersectionTriangles for this Sub seg of edge
++
++				//Methods
++				R2 F(double s){ 
++					double c01=lEnd-lBegin, c0=(lEnd-s)/c01, c1=(s-lBegin)/c01;
++					if (lBegin>s || s>lEnd){
++						_error2_("lBegin>s || s>lEnd");
++					}
++					return e->F(sBegin*c0+sEnd*c1);
++				}
++		};
++
++		public:
++
++			int                    MaxSize;
++			int                    Size;
++			double                 len;
++			int                    state;
++			IntersectionTriangles *lIntTria;
++			int                    NbSeg;
++			int                    MaxNbSeg;
++			SegInterpolation      *lSegsI;
++
++			//Constructors/Destructors
++			ListofIntersectionTriangles(int n=256,int m=16);
++			~ListofIntersectionTriangles();
++
++			//Operators
++			IntersectionTriangles & operator[](int i) {return lIntTria[i];}
++			operator int&() {return Size;}
++
++			//Methods
++			void   Init();
++			int    NewItem(Triangle *tt,double d0,double d1,double d2);
++			int    NewItem(R2 ,const Metric &);
++			void   SplitEdge(const Mesh &,const R2 &,const R2 &,int nbegin=0);
++			double Length();
++			long   NewPoints(BamgVertex *,long &nbv,long maxnbv);
++			void   NewSubSeg(GeomEdge *e,double s0,double s1);
++			void   ReShape();
++	};
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SetOfE4.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SetOfE4.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SetOfE4.cpp	(revision 12821)
+@@ -0,0 +1,120 @@
++#include "../objects.h"
++
++using namespace std;
++namespace bamg {
++
++	/*Constructor*/
++	/*FUNCTION  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*/
++		int i;
++
++		//initialize fields
++		nx   =nnx;   //number of vertices
++		nbax =mmx;   // 3 * number of triangles
++		NbOfEdges=0;
++		head = new long [nx];
++		Edges= new IntEdge[nbax];
++
++		//initialize head (-1 everywhere)
++		i=nx;
++		while(i--) head[i]=-1;
++	}
++	/*}}}*/
++
++	/*Methods*/ 
++	/*FUNCTION  SetOfEdges4::add{{{*/
++	long SetOfEdges4::add(long ii,long jj) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, SetOfEdges4.cpp/add)*/
++
++		/*Intermediary*/
++		int h,n;
++
++		//get n from h (usually h=ii)
++		_assert_(head);
++		n=head[h=Abs(ii)%nx];
++
++		//go through the existing edges that holds h (=ii) and check that 
++		//the edge ii jj is not already in Edge
++		while (n >= 0){
++
++			//if the edge ii jj is already in Edges, return n
++			if (ii == Edges[n].i && jj == Edges[n].j) return n;
++
++			//else go to next edge that holds ii
++			else n = Edges[n].next;
++		}
++
++		//check that nbax <=NbOfEdges
++		if (nbax <=NbOfEdges ) {
++			_error2_("SetOfEdges4::add overflow: NbOfEdges=" << NbOfEdges << " > nbax=" << nbax);
++		}
++
++		//update chain
++		Edges[NbOfEdges].i=ii;
++		Edges[NbOfEdges].j=jj;
++		Edges[NbOfEdges].next= head[h];
++		head[h] = NbOfEdges;
++		return NbOfEdges ++;
++	}
++	/*}}}*/
++	/*FUNCTION  SetOfEdges4::find {{{*/
++	long SetOfEdges4::find(long ii,long jj) { 
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, SetOfEdges4.cpp/find)*/
++
++		/*Intermediary*/
++		int n;
++
++		//check that head is not empty
++		_assert_(head);
++
++		//get n from h (usually h=ii)
++		n=head[Abs(ii)%nx];
++
++		//go through the existing edges that holds h (=ii) and return position in Edge
++		while (n >= 0){
++
++			//if the edge ii jj is already in Edges, return n
++			if (ii == Edges[n].i && jj == Edges[n].j) return n;
++
++			//else go to next edge that holds ii
++			else n = Edges[n].next;
++		}
++
++		//if we reach this point, the edge does not exist return -1
++		return -1;
++	}
++	/*}}}*/
++	/*FUNCTION  SetOfEdges4::i{{{*/
++	long SetOfEdges4::i(long k){
++		return Edges[k].i;
++	}
++	/*}}}*/
++	/*FUNCTION  SetOfEdges4::j{{{*/
++	long SetOfEdges4::j(long k){
++		return Edges[k].j;
++	}
++	/*}}}*/
++	/*FUNCTION  SetOfEdges4::nb{{{*/
++	long SetOfEdges4::nb(){
++		return NbOfEdges;
++	}
++	/*}}}*/
++	/*FUNCTION  SetOfEdges4::newarete{{{*/
++	long SetOfEdges4::newarete(long k){
++		return NbOfEdges == k+1;
++	}
++	/*}}}*/
++	/*FUNCTION  SetOfEdges4::SortAndAdd{{{*/
++	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) {
++		return ii <=jj ? find (ii,jj)  : find (jj,ii) ;
++	}
++	/*}}}*/
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Triangle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Triangle.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Triangle.h	(revision 12821)
+@@ -0,0 +1,76 @@
++#ifndef _TRIANGLE_H_
++#define _TRIANGLE_H_
++
++#include "./include.h"
++#include "AdjacentTriangle.h"
++
++namespace bamg {
++
++	//classes
++	class Mesh;
++	class BamgVertex;
++	class Triangle;
++
++	class Triangle {
++
++		friend class AdjacentTriangle;
++
++		private:
++			BamgVertex *vertices[3];        // 3 vertices if t is triangle, t[i] allowed by access function, (*t)[i] if pointer
++			Triangle   *adj[3];             // 3 pointers toward the adjacent triangles
++			short       AdjEdgeIndex[3];   // edge id in the adjacent triangles. The edge number 1 is the edge number AdjEdgeIndex[1] in the Adjacent triangle 1
++
++		public: 
++			Icoor2 det; //Integer determinant (twice its area)
++			union { 
++				Triangle *link;
++				long      color;
++			};
++
++			//Constructors/Destructors
++			Triangle();
++			Triangle(Mesh *Th,long i,long j,long k);
++			Triangle(BamgVertex *v0,BamgVertex *v1,BamgVertex *v2);
++
++			//Operators
++			const BamgVertex & operator[](int i) const {return *vertices[i];};
++			BamgVertex & operator[](int i)  {return *vertices[i];};
++			const BamgVertex * operator()(int i) const {return vertices[i];};
++			BamgVertex * & operator()(int i)  {return vertices[i];};
++
++			//Methods
++			void              Echo();
++			double            Anisotropy() const;
++			double            Length() const;
++			int               swap(short a1,int=0);
++			long              Optim(short a,int =0);
++			int               Locked(int a)const;
++			int               Hidden(int a)const;
++			int               GetAllflag(int a);
++			void              SetAllFlag(int a,int f);
++			double            QualityQuad(int a,int option=1) const;
++			short             NuEdgeTriangleAdj(int i) const;
++			AdjacentTriangle  FindBoundaryEdge(int  i) const;
++			AdjacentTriangle  Adj(int i) const;
++			Triangle         *TriangleAdj(int i) const;
++			Triangle         *Quadrangle(BamgVertex  *& v0,BamgVertex *& v1,BamgVertex *& v2,BamgVertex *& v3) const;
++			void              Renumbering(Triangle   *tb,Triangle *te, long *renu);
++			void              Renumbering(BamgVertex *vb,BamgVertex *ve, long *renu);
++			void              SetAdjAdj(short a);
++			void              SetAdj2(short a,Triangle *t,short aat);
++			void              SetSingleVertexToTriangleConnectivity();
++			void              SetHidden(int a);
++			void              SetLocked(int a);
++			void              SetMarkUnSwap(int a);
++			void              SetUnMarkUnSwap(int a);
++			void              SetDet();
++
++			//Inline methods
++			double qualite() ;
++			void  Set(const Triangle &,const Mesh &,Mesh &);
++			int   In(BamgVertex *v) const { return vertices[0]==v || vertices[1]==v || vertices[2]==v ;}
++
++	};
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomEdge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomEdge.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomEdge.cpp	(revision 12821)
+@@ -0,0 +1,190 @@
++#include <cstdio>
++#include <string.h>
++#include <cmath>
++
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++
++#include "GeomEdge.h"
++#include "Geometry.h"
++
++using namespace std;
++
++namespace bamg {
++
++	/*Constructor/Destructor*/
++
++	/*Methods*/
++	/*FUNCTION GeomEdge::Cracked{{{*/
++	int    GeomEdge::Cracked() const  {
++		return type &1;  
++	}/*}}}*/
++	/*FUNCTION GeomEdge::F{{{*/
++	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
++
++	   R2 A=v[0]->r,B=v[1]->r;
++		double ca,cb,cta,ctb;
++
++		//Check that theta is in [0 1]
++		_assert_(theta>-1e-12 && theta<1+1e-12);
++
++		if (TgA()){ 
++			if (TgB()){ //Hermite interpolation
++				cb =  theta*theta*(3-2*theta);
++				ca =  1-cb;     
++				cta = (1-theta)*(1-theta)*theta;
++				ctb = (theta-1)*theta*theta ;
++			}
++			else {
++				double t = theta;
++				cb = t*t;
++				ca = 1-cb;
++				cta= t-cb;
++				ctb=0;    
++			}
++		}
++		else{
++			if (TgB()){
++				double t = 1-theta;
++				ca = t*t;
++				cb = 1-ca;
++				ctb= -t+ca;
++				cta=0;    
++			}
++			else { // lagrange P1
++				ca =(1-theta);
++				cb = theta;
++				cta=ctb=0;
++			}
++		}
++		return A*ca + B*cb + tg[0]*cta + tg[1]*ctb;
++	  }
++	/*}}}*/
++	/*FUNCTION GeomEdge::Mark{{{*/
++	int    GeomEdge::Mark()    const  {
++		return type &16; 
++	}/*}}}*/
++	/*FUNCTION GeomEdge::R1tg{{{*/
++	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
++
++		R2 A=v[0]->r,B=v[1]->r;
++		double dca,dcb,dcta,dctb;
++		double ddca,ddcb,ddcta,ddctb;
++		double tt = theta*theta;
++
++		//check theta
++		_assert_(theta>=0 && theta<=1);
++
++		if (TgA()){ 
++			if (TgB()){
++				// Tangent A and B provided:
++				// interpolation d'hermite
++				dcb = 6*theta*(1-theta);
++				ddcb = 6*(1-2*theta);
++				dca = -dcb;
++				ddca = -ddcb;
++				dcta =  (3*theta - 4)*theta + 1;
++				ddcta=6*theta-4;
++				dctb = 3*tt - 2*theta;
++				ddctb = 6*theta-2;
++			}
++			else {
++				//Tangent A provided but tangent B not provided
++				// 1-t*t, t-t*t, t*t
++				double t = theta;
++				dcb = 2*t;
++				ddcb = 2;
++				dca = -dcb;
++				ddca = -2;
++				dcta = 1-dcb;
++				ddcta = -ddcb;
++				dctb=0;    
++				ddctb=0;    
++			}
++		}
++		else{
++			if (TgB()){
++				//Tangent B provided but tangent A not provided
++				double t = 1-theta;
++				dca = -2*t;
++				ddca = 2;
++				dcb = -dca;
++				ddcb = -2;
++				dctb = 1+dca;
++				ddctb= ddca;
++				dcta =0;
++				ddcta =0;
++			}
++			else {
++				//Neither thangent A nor tangent B provided
++				// lagrange P1
++				t=B-A;
++				return 0;
++			} 
++		}
++		R2 d  =  A*dca  + B*dcb  + tg[0]* dcta  + tg[1] * dctb;
++		R2 dd =  A*ddca + B*ddcb + tg[0]* ddcta + tg[1] * ddctb;
++		double d2=(d,d);
++		double sd2 = sqrt(d2);
++		t=d;
++		if(d2>1.0e-20){
++			t/=sd2;
++			return Abs(Det(d,dd))/(d2*sd2);
++		}
++		else return 0;
++	}
++	/*}}}*/
++	/*FUNCTION GeomEdge::Required{{{*/
++	int    GeomEdge::Required()       {
++		return type &64; 
++	}/*}}}*/
++	/*FUNCTION GeomEdge::Set {{{*/
++	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]); 
++		if (Adj[0]) Adj[0] =  GhNew.edges + Gh.GetId(Adj[0]);     
++		if (Adj[1]) Adj[1] =  GhNew.edges + Gh.GetId(Adj[1]);     
++	}
++	/*}}}*/
++	/*FUNCTION GeomEdge::SetCracked{{{*/
++	void   GeomEdge::SetCracked()     { 
++		type |= 1;/*=>1st digit to 1*/
++	}/*}}}*/
++	/*FUNCTION GeomEdge::SetTgA{{{*/
++	void   GeomEdge::SetTgA()         { 
++		type |=4; /*=>2d digit to 1*/
++	}/*}}}*/
++	/*FUNCTION GeomEdge::SetTgB{{{*/
++	void   GeomEdge::SetTgB()         { 
++		type |=8; /*=> 3d digit to 1*/
++	}/*}}}*/
++	/*FUNCTION GeomEdge::SetMark{{{*/
++	void   GeomEdge::SetMark()        { 
++		type |=16;/*=> 4th digiy to 1*/
++	}/*}}}*/
++	/*FUNCTION GeomEdge::SetUnMark{{{*/
++	void   GeomEdge::SetUnMark()      { 
++		type &= 1007 /* 1023-16 = 000111110111 => 4th digit to 0*/;
++	}/*}}}*/
++	/*FUNCTION GeomEdge::SetRequired{{{*/
++	void   GeomEdge::SetRequired()    { 
++		type |= 64;/*=>6th digit to 1*/ 
++	}/*}}}*/
++	  /*FUNCTION GeomEdge::Tg{{{*/
++	int    GeomEdge::Tg(int i) const  {
++		return i==0 ? TgA() : TgB();
++	}/*}}}*/
++	/*FUNCTION GeomEdge::TgA{{{*/
++	int    GeomEdge::TgA()     const  {
++		return type &4;  
++	}/*}}}*/
++	/*FUNCTION GeomEdge::TgB{{{*/
++	int    GeomEdge::TgB()     const  {
++		return type &8;  
++	}/*}}}*/
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/DoubleAndInt.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/DoubleAndInt.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/DoubleAndInt.h	(revision 12821)
+@@ -0,0 +1,19 @@
++#ifndef _DOUBLEANDINT_H_
++#define _DOUBLEANDINT_H_
++
++#include "./include.h"
++
++namespace bamg {
++
++	class DoubleAndInt {
++		//class used by Mesh::MakeQuadrangles
++
++		public:
++			double q;
++			long i3j;
++
++			//Operators
++			int operator<(DoubleAndInt a){return q > a.q;}
++	};
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnVertex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnVertex.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnVertex.h	(revision 12821)
+@@ -0,0 +1,28 @@
++#ifndef _VERTEXONVERTEX_H_
++#define _VERTEXONVERTEX_H_
++
++#include "./include.h"
++#include "./BamgVertex.h"
++
++namespace bamg {
++
++	//classes
++	class Mesh;
++
++	class VertexOnVertex {
++
++		public:
++			BamgVertex* v;
++			BamgVertex* bv;
++
++			//Constructors
++			VertexOnVertex();
++			VertexOnVertex(BamgVertex * w,BamgVertex *bw);
++
++			//Methods
++			void SetOnBTh();
++			void Set(const Mesh &,long,Mesh &);
++	};
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Direction.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Direction.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Direction.cpp	(revision 12821)
+@@ -0,0 +1,36 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "Direction.h"
++
++namespace bamg {
++
++	/*Constructors/Destructors*/
++	/*FUNCTION Direction() {{{*/
++	Direction::Direction():
++		dir(MaxICoor){
++
++	}/*}}}*/
++	/*FUNCTION 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 
++		dir = (j>0) ? r1 : r1+1;          // odd-> j>0 even-> j<0
++	}/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION Direction::direction{{{*/
++	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);
++			r = (x*i + y*j) >=0;
++		}
++		return r;
++	}
++	/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgOpts.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgOpts.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgOpts.h	(revision 12821)
+@@ -0,0 +1,57 @@
++/*!\file:  BamgOpts.h
++ * \brief place holder for optimization function arguments
++ */ 
++
++#ifndef _BAMGOPTS_H_
++#define _BAMGOPTS_H_
++
++class BamgOpts{
++
++	public:
++
++		/*Parameters*/
++		double  anisomax;
++		double  cutoff;
++		double  coeff;
++		double  errg;
++		double  gradation;
++		int     Hessiantype;
++		double  MaxCornerAngle;
++		int     maxnbv;
++		double  maxsubdiv;
++		int     Metrictype;
++		int     nbjacobi;
++		int     nbsmooth;
++		double  omega;
++		double  power;
++		int     verbose;
++
++		/*Flags*/
++		int     Crack;
++		int     geometricalmetric;
++		int     KeepVertices;
++		int     splitcorners;
++
++		/*Metric related*/
++		double  hmin;
++		double  hmax;
++		int     hminVerticesSize[2];
++		double* hminVertices;
++		int     hmaxVerticesSize[2];
++		double* hmaxVertices;
++		int     hVerticesSize[2];
++		double* hVertices;
++		int     metricSize[2];
++		double* metric;
++		int     fieldSize[2];
++		double* field;
++		int     errSize[2];
++		double* err;
++
++		BamgOpts();
++		~BamgOpts();
++
++		void Check(void);
++
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnGeom.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnGeom.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/VertexOnGeom.cpp	(revision 12821)
+@@ -0,0 +1,70 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "VertexOnGeom.h"
++#include "Mesh.h"
++#include "Geometry.h"
++
++namespace bamg {
++
++	/*Constructors/Destructors*/
++	/*FUNCTION VertexOnGeom::VertexOnGeom(){{{*/
++	VertexOnGeom::VertexOnGeom(){
++		meshvertex=NULL;
++		curvilincoord=0;
++		gv=0;
++	} 
++	/*}}}*/
++	/*FUNCTION 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){
++		meshvertex=&m;
++		curvilincoord=s;
++		ge=&g;
++	}
++	/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION VertexOnGeom::Set {{{*/
++	void VertexOnGeom::Set(const VertexOnGeom & rec,const Mesh & Th ,Mesh & ThNew){
++		*this = rec;  
++		meshvertex = ThNew.vertices + Th.GetId(meshvertex);
++		if (gv)
++		 if (curvilincoord < 0 )
++		  gv = ThNew.Gh.vertices + Th.Gh.GetId(gv);
++		 else
++		  ge = ThNew.Gh.edges + Th.Gh.GetId(ge);
++
++	}
++	/*}}}*/
++	/*FUNCTION VertexOnGeom::OnGeomVertex{{{*/
++	int VertexOnGeom::OnGeomVertex()const{
++		return this? curvilincoord <0 :0;
++	}
++	/*}}}*/
++	/*FUNCTION VertexOnGeom::OnGeomEdge{{{*/
++	int VertexOnGeom::OnGeomEdge() const{
++		return this? curvilincoord >=0 :0;
++	}
++	/*}}}*/
++	/*FUNCTION VertexOnGeom::IsRequiredVertex{{{*/
++	int VertexOnGeom::IsRequiredVertex() {
++		return this? ((curvilincoord<0 ? (gv?gv->Required():0):0 )) : 0;
++	}
++	/*}}}*/
++	/*FUNCTION VertexOnGeom::SetOn{{{*/
++	void VertexOnGeom::SetOn(){
++		meshvertex->GeomEdgeHook=this;
++		meshvertex->IndexInTriangle=IsVertexOnGeom;
++	}
++	/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgGeom.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgGeom.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgGeom.h	(revision 12821)
+@@ -0,0 +1,31 @@
++/*!\file:  BamgGeom.h
++ */ 
++
++#ifndef _BAMGGEOM_H_
++#define _BAMGGEOM_H_
++
++class BamgGeom{
++
++	public:
++		int     VerticesSize[2];
++		double* Vertices;
++		int     EdgesSize[2];
++		double* Edges;
++		int     TangentAtEdgesSize[2];
++		double* TangentAtEdges;
++		int     CornersSize[2];
++		double* Corners;
++		int     RequiredVerticesSize[2];
++		double* RequiredVertices;
++		int     RequiredEdgesSize[2];
++		double* RequiredEdges;
++		int     CrackedEdgesSize[2];
++		double* CrackedEdges;
++		int     SubDomainsSize[2];
++		double* SubDomains;
++
++		BamgGeom();
++		~BamgGeom();
++};
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/CrackedEdge.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/CrackedEdge.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/CrackedEdge.h	(revision 12821)
+@@ -0,0 +1,31 @@
++#ifndef _CRACKEDEDGE_H_
++#define _CRACKEDEDGE_H_
++
++#include "./typedefs.h"
++
++namespace bamg {
++
++	//classes
++	class Triangle;
++	class GeomEdge;
++	class Edge;
++
++	class CrackedEdge {
++
++		public:
++			Triangle* a;
++			Triangle* b; 
++			GeomEdge* E;
++			Edge* e1;
++			Edge* e2;
++			double length;
++			R2     normal;
++			long   indexa[3];
++			long   indexb[3];
++
++			//Constructors
++			CrackedEdge();
++	};
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SubDomain.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SubDomain.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SubDomain.h	(revision 12821)
+@@ -0,0 +1,27 @@
++#ifndef _SUBDOMAIN_H_
++#define _SUBDOMAIN_H_
++
++#include "./include.h"
++#include "./Edge.h"
++
++namespace bamg {
++
++	//classes
++	class Triangle;
++	class Mesh;
++
++	class SubDomain {
++
++		public:
++
++			Triangle *head;
++			long      ReferenceNumber;
++			int       direction;   // -1 or 1
++			Edge     *edge;        // to geometrical
++
++			//Methods
++			void Set(const Mesh &,long,Mesh &);
++	};
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgMesh.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgMesh.h	(revision 12821)
+@@ -0,0 +1,52 @@
++/*!\file:  BamgMesh.h
++ */ 
++
++#ifndef _BAMGMESH_H_
++#define _BAMGMESH_H_
++
++class BamgMesh{
++
++	public:
++
++		int     VerticesSize[2];
++		double* Vertices;
++		int     EdgesSize[2];
++		double* Edges;
++		int     TrianglesSize[2];
++		double* Triangles;
++		int     QuadrilateralsSize[2];
++		double* Quadrilaterals;
++
++		int     VerticesOnGeomVertexSize[2];
++		double* VerticesOnGeomVertex;
++		int     VerticesOnGeomEdgeSize[2];
++		double* VerticesOnGeomEdge;
++		int     EdgesOnGeomEdgeSize[2];
++		double* EdgesOnGeomEdge;
++
++		int     SubDomainsSize[2];
++		double* SubDomains;
++		int     SubDomainsFromGeomSize[2];
++		double* SubDomainsFromGeom;
++		int     CrackedVerticesSize[2];
++		double* CrackedVertices;
++		int     CrackedEdgesSize[2];
++		double* CrackedEdges;
++
++		/*Output for ISSM*/
++		int     IssmEdgesSize[2];
++		double* IssmEdges;
++		int     IssmSegmentsSize[2];
++		double* IssmSegments;
++		int     ElementConnectivitySize[2];
++		double* ElementConnectivity;
++		int     NodalConnectivitySize[2];
++		double* NodalConnectivity;
++		int     NodalElementConnectivitySize[2];
++		double* NodalElementConnectivity;
++
++		BamgMesh();
++		~BamgMesh();
++};
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Metric.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Metric.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Metric.h	(revision 12821)
+@@ -0,0 +1,138 @@
++#ifndef _METRIC_H
++#define _METRIC_H
++
++#include "./include.h"
++#include "../../shared/Bamg/shared.h"
++#include "R2.h"
++#include <math.h>
++
++namespace bamg {
++
++	typedef P2<double,double>    D2;
++	typedef P2xP2<double,double> D2xD2;
++
++	class Metric;
++	class EigenMetric;
++
++	class Metric{
++
++		public:
++
++			//fields
++			double a11,a21,a22;
++
++			//friends
++			friend class EigenMetric;
++
++			//functions
++			Metric():a11(0),a21(0),a22(0){};
++			Metric(const EigenMetric&);
++			Metric(double a);
++			Metric(double a,double b,double c);
++			Metric( double  a,const  Metric& ma, double  b,const  Metric& mb);
++			Metric(const double  a[3],const  Metric& m0,const  Metric& m1,const  Metric& m2 );
++			void        Echo();
++			R2          mul(const R2 x)const;
++			double      det() const;
++			int         IntersectWith(const  Metric& M2);
++			inline void Box(double &hx,double &hy) const;
++
++			/*The following functions must remain the the header file because it is called before Metric
++			 * is compiled by other classes*/
++			R2 Orthogonal(const R2 x){ return R2(-(a21*x.x+a22*x.y),a11*x.x+a21*x.y); }
++			R2 Orthogonal(const I2 x){ return R2(-(a21*x.x+a22*x.y),a11*x.x+a21*x.y); }
++
++			//operators
++			Metric operator*(double c) const {double c2=c*c;return  Metric(a11*c2,a21*c2,a22*c2);} 
++			Metric operator/(double c) const {double c2=1/(c*c);return  Metric(a11*c2,a21*c2,a22*c2);} 
++			operator D2xD2(){ return D2xD2(a11,a21,a21,a22);}
++			double  operator()(R2 x) const { return sqrt(x.x*x.x*a11+2*x.x*x.y*a21+x.y*x.y*a22);};        // length of x in metric sqrt(<Mx,x>)
++			double  operator()(R2 x,R2 y) const { return x.x*y.x*a11+(x.x*x.y+x.y*y.x)*a21+x.y*y.y*a22;};
++
++	};
++
++	class EigenMetric{
++		public:
++
++			//fields
++			double lambda1,lambda2;
++			D2     v;
++
++			//friends
++			friend  class Metric;
++
++			//functions
++			EigenMetric(const Metric& );
++			EigenMetric(double r1,double r2,const D2& vp1);
++			void   Echo();
++			void   Abs();
++			void   pow(double  p);
++			void   Min(double  a);
++			void   Max(double  a);
++			void   Minh(double h);
++			void   Maxh(double h);
++			void   Isotrope();
++			double hmin()   const;
++			double hmax()   const;
++			double lmax()   const;
++			double lmin()   const;
++			double Aniso2() const;
++			double Aniso()  const;
++			void   BoundAniso(const  double c);
++			inline void BoundAniso2(const double coef);
++
++			//operators
++			void operator *=(double coef){ lambda1*=coef;lambda2*=coef;}
++	};
++
++	class SaveMetricInterpole {
++		friend double LengthInterpole(const Metric& Ma,const  Metric& Mb, R2 AB);
++		friend double abscisseInterpole(const Metric& Ma ,const  Metric& Mb, R2 ,double s,int optim);
++		public:
++		int opt;
++		double lab;
++		double L[1024],S[1024];
++	};
++
++	extern SaveMetricInterpole  LastMetricInterpole; // for optimization 
++	//Functions
++	void  SimultaneousMatrixReduction( Metric M1,  Metric M2,D2xD2 &V);
++	double LengthInterpole(const Metric& Ma,const  Metric& Mb, R2 AB);
++	double abscisseInterpole(const Metric& Ma,const  Metric& Mb, R2 AB,double s,int optim=0);
++
++	//inlines
++	inline void  EigenMetric::BoundAniso2(const double coef){
++		if (coef<=1.00000000001){
++			if (lambda1 < lambda2)
++			 lambda1 = bamg::Max(lambda1,lambda2*coef);
++			else
++			 lambda2 = bamg::Max(lambda2,lambda1*coef);
++		}
++		else{  //TO BE CHECKED
++			if (lambda1 > lambda2)
++			 lambda1 = bamg::Min(lambda1,lambda2*coef);
++			else
++			 lambda2 = bamg::Min(lambda2,lambda1*coef);
++		}
++	}
++	inline Metric::Metric(const EigenMetric& M) {
++		double v00=M.v.x*M.v.x;
++		double v11=M.v.y*M.v.y;
++		double v01=M.v.x*M.v.y;
++		a11=v00*M.lambda1+v11*M.lambda2;
++		a21=v01*(M.lambda1-M.lambda2);
++		a22=v00*M.lambda2+v11*M.lambda1;
++	}
++	inline   void  Metric::Box(double &hx,double &hy) const {
++		double d=  a11*a22-a21*a21;
++		hx = sqrt(a22/d);
++		hy = sqrt(a11/d);
++	}
++	inline double LengthInterpole(double la,double lb) {
++		return ( Abs(la - lb) < 1.0e-6*Max3(la,lb,1.0e-20) ) ?  (la+lb)/2  : la*lb*log(la/lb)/(la-lb);
++	}
++	inline double abscisseInterpole(double la,double lb,double lab,double s){
++		return ( Abs(la - lb) <1.0e-6*Max3(la,lb,1.0e-20))  ? s : (exp(s*lab*(la-lb)/(la*lb))-1)*lb/(la-lb);
++	}
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/include.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/include.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/include.h	(revision 12821)
+@@ -0,0 +1,12 @@
++/*!\file: include.h
++ * \brief prototypes for include.h
++ */ 
++
++#ifndef _INCLUDE2_H_
++#define  _INCLUDE2_H_
++
++#include "../../include/macros.h"
++#include "./macros.h"
++#include "./typedefs.h"
++
++#endif //ifndef _INCLUDE2_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h	(revision 12821)
+@@ -0,0 +1,21 @@
++#ifndef _BAMGTYPEDEFS_H
++#define _BAMGTYPEDEFS_H
++
++#include "./R2.h"
++
++namespace bamg {
++
++	/*Integer coordinates types*/
++	typedef int  Icoor1; 
++	#if LONG_BIT > 63 //64 bits or more
++	typedef long Icoor2;
++	#else //32 bits
++	typedef double Icoor2;
++	#endif
++
++	/*I2 and R2*/
++	typedef P2<Icoor1,Icoor2>  I2;
++	typedef P2<double,double>  R2;
++}
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Curve.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Curve.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Curve.h	(revision 12821)
+@@ -0,0 +1,27 @@
++#ifndef _CURVE_H_
++#define _CURVE_H_
++
++#include "../../shared/Bamg/shared.h"
++
++namespace bamg {
++
++	//classes
++	class GeomEdge;
++	class Curve;
++	class Geometry;
++
++	class Curve {
++		public:
++			GeomEdge *FirstEdge; //First edge of the curve
++			GeomEdge *LastEdge;  //Last edge of the curve
++			int FirstVertexIndex;       //Last vertex index in the last edge
++			int LastVertexIndex;        //First Vertex index in the first edge
++
++			//Methods
++			Curve();
++			void Reverse(void);
++			void Set(const Curve & rec,const Geometry & Th ,Geometry & ThNew);
++	};
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h	(revision 12821)
+@@ -0,0 +1,29 @@
++#ifndef _BAMGMACROS_H
++#define _BAMGMACROS_H
++
++#include "./typedefs.h"
++
++namespace bamg {
++
++	const double Pi =3.141592653589793238462643383279502884197169399375105820974944592308;
++	const float  fPi=3.141592653589793238462643383279502884197169399375105820974944592308;
++	const  int   IsVertexOnGeom = 8;
++	const  int   IsVertexOnVertex = 16;
++	const  int   IsVertexOnEdge = 32;
++	static const short VerticesOfTriangularEdge[3][2] = {{1,2},{2,0},{0,1}};
++	static const short EdgesVertexTriangle[3][2] = {{1,2},{2,0},{0,1}};
++	static const short OppositeVertex[3] = {0,1,2};
++	static const short OppositeEdge[3] =  {0,1,2};
++	static const short NextEdge[3] = {1,2,0};
++	static const short PreviousEdge[3] = {2,0,1};
++	static const short NextVertex[3] = {1,2,0};
++	static const short PreviousVertex[3] = {2,0,1};
++	#if LONG_BIT > 63
++	const  Icoor1 MaxICoor   = 1073741823; // 2^30-1 =111...111 (29 times)
++	#else
++	const  Icoor1 MaxICoor   = 8388608;    // 2^23
++	#endif
++	const  Icoor2 MaxICoor22 = Icoor2(2)*Icoor2(MaxICoor) * Icoor2(MaxICoor) ;
++}
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomVertex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomVertex.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/GeomVertex.h	(revision 12821)
+@@ -0,0 +1,30 @@
++#ifndef _GEOMETRICALVERTEX_H_
++#define _GEOMETRICALVERTEX_H_
++
++#include "./include.h"
++#include "BamgVertex.h"
++
++namespace bamg {
++
++	class Geometry;
++
++	class GeomVertex : public BamgVertex { 
++
++		public:
++			friend class Geometry;
++
++			int type;
++
++			//Constructors
++			GeomVertex():type(0){};
++
++			//Methods
++			int  Corner() const;
++			int  Required()const;
++			void SetCorner();
++			void SetRequired();
++
++	};
++
++}
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/EigenMetric.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/EigenMetric.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/EigenMetric.cpp	(revision 12821)
+@@ -0,0 +1,168 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "Metric.h"
++
++namespace bamg {
++
++	/*Constructor*/
++	/*FUNCTION 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*/
++		double a11=M.a11,a21=M.a21,a22=M.a22;
++		double normM;
++		double delta,b;
++
++		/*To get the eigen values, we must solve the following equation:
++		 *     | a11 - lambda    a21        |
++		 * det |                            | = 0
++		 *     | a21             a22-lambda |
++		 *
++		 * We have to solve the following polynom:
++		 *  lamda^2 + ( -a11 -a22)*lambda + (a11*a22-a21*a21) = 0*/
++
++		/*Compute polynom determinant*/
++		b=-a11-a22;
++		delta=b*b - 4*(a11*a22-a21*a21);
++
++
++		/*Compute norm of M to avoid round off errors*/
++		normM=a11*a11 + a22*a22 + a21*a21;
++
++		/*1: normM too small: eigen values = 0*/
++		if(normM<1.e-30){
++			lambda1=0;
++			lambda2=0;
++			v.x=1;
++			v.y=0;
++		}
++		/*2: delta is small -> double root*/
++		else if (delta < 1.e-5*normM){
++			lambda1=-b/2;
++			lambda2=-b/2;
++			v.x=1;
++			v.y=0;
++		}
++		/*3: general case -> two roots*/
++		else{
++			delta     = sqrt(delta);
++			lambda1   = (-b-delta)/2.0;
++			lambda2   = (-b+delta)/2.0;
++
++			/*Now, one must find the eigen vectors. For that we use the following property of the inner product
++			 *    <Ax,y> = <x,tAy>
++			 * Here, M'(M-lambda*Id) is symmetrical, which gives:
++			 *    ∀(x,y)∈R²xR² <M'x,y> = <M'y,x>
++			 * And we have the following:
++			 *    if y∈Ker(M'), ∀x∈R² <M'x,y> = <x,M'y> = 0
++			 * We have shown that
++			 *    Im(M') ⊥ Ker(M')
++			 *
++			 * To find the eigen vectors of M, we only have to find two vectors
++			 * of the image of M' and take their perpendicular as long as they are
++			 * not 0.
++			 * To do that, we take the images (1,0) and (0,1):
++			 *  x1 = (a11 - lambda)      x2 = a21
++			 *  y1 = a21                 y2 = (a22-lambda)
++			 *
++			 * We take the vector that has the larger norm and take its perpendicular.*/
++
++			double norm1 = (a11-lambda1)*(a11-lambda1) + a21*a21; 
++			double norm2 = a21*a21 + (a22-lambda1)*(a22-lambda1);
++
++			if (norm2<norm1){
++				norm1=sqrt(norm1);
++				v.x = - a21/norm1;
++				v.y = (a11-lambda1)/norm1;
++			}
++			else{
++				norm2=sqrt(norm2);
++				v.x = - (a22-lambda1)/norm2;
++				v.y = a21/norm2;
++			}
++		}
++
++	}
++	/*}}}*/
++	/*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){
++
++	}/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION EigenMetric::Abs{{{*/
++	void   EigenMetric::Abs(){
++		lambda1=bamg::Abs(lambda1),lambda2=bamg::Abs(lambda2);
++	}/*}}}*/
++	/*FUNCTION EigenMetric::Aniso{{{*/
++	double EigenMetric::Aniso() const  { 
++		return sqrt( Aniso2());
++	}/*}}}*/
++	/*FUNCTION EigenMetric::Aniso2{{{*/
++	double EigenMetric::Aniso2() const  { 
++		return lmax()/lmin();
++	}/*}}}*/
++	/*FUNCTION EigenMetric::BoundAniso{{{*/
++	void   EigenMetric::BoundAniso(const double c){ 
++		BoundAniso2(1/(c*c));
++	}/*}}}*/
++	/*FUNCTION EigenMetric::Echo {{{*/
++	void EigenMetric::Echo(void){
++
++		_printLine_("EigenMetric:");
++		_printLine_("   lambda1: " << lambda1);
++		_printLine_("   lambda2: " << lambda2);
++		_printLine_("   v.x: " << v.x);
++		_printLine_("   v.y: " << v.y);
++
++		return;
++	}
++	/*}}}*/
++	/*FUNCTION EigenMetric::hmin{{{*/
++	double EigenMetric::hmin() const {
++		return sqrt(1/bamg::Max3(lambda1,lambda2,1e-30));
++	}/*}}}*/
++	/*FUNCTION EigenMetric::hmax{{{*/
++	double EigenMetric::hmax() const {
++		return sqrt(1/bamg::Max(bamg::Min(lambda1,lambda2),1e-30));
++	}/*}}}*/
++	/*FUNCTION EigenMetric::Isotrope{{{*/
++	void   EigenMetric::Isotrope() {
++		lambda1=lambda2=bamg::Max(lambda1,lambda2);
++	}/*}}}*/
++	/*FUNCTION EigenMetric::lmax{{{*/
++	double EigenMetric::lmax() const {
++		return bamg::Max3(lambda1,lambda2,1e-30);
++	}/*}}}*/
++	/*FUNCTION EigenMetric::lmin{{{*/
++	double EigenMetric::lmin() const {
++		return bamg::Max(bamg::Min(lambda1,lambda2),1e-30);
++	}/*}}}*/
++	/*FUNCTION EigenMetric::Min{{{*/
++	void   EigenMetric::Min(double a) { 
++		lambda1=bamg::Min(a,lambda1); lambda2=bamg::Min(a,lambda2) ;
++	}/*}}}*/
++	/*FUNCTION EigenMetric::Max{{{*/
++	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) {
++		Min(1.0/(h*h));
++	}/*}}}*/
++	/*FUNCTION EigenMetric::Maxh{{{*/
++	void   EigenMetric::Maxh(double h) {
++		//Call Max function
++		Max(1.0/(h*h));
++	}/*}}}*/
++	/*FUNCTION EigenMetric::pow{{{*/
++	void   EigenMetric::pow(double p){
++		lambda1=::pow(lambda1,p);lambda2=::pow(lambda2,p);
++	}/*}}}*/
++
++} 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp	(revision 12821)
+@@ -0,0 +1,6006 @@
++#include <cstdio>
++#include <cstring>
++#include <cmath>
++#include <ctime>
++
++#include "../objects.h"
++
++namespace bamg {
++
++	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){ 
++
++		/*Initialize fields*/
++		Init(0);
++
++		/*Read Geometry if provided*/
++		if(bamggeom->Edges) {
++			Gh.ReadGeometry(bamggeom,bamgopts);
++			Gh.PostRead();
++		}
++
++		/*Read background mesh*/
++		ReadMesh(bamgmesh,bamgopts);
++
++		/*Build Geometry if not provided*/
++		if(bamggeom->Edges==NULL) {
++			/*Recreate geometry if needed*/
++			_printLine_("WARNING: mesh present but no geometry found. Reconstructing...");
++			BuildGeometryFromMesh(bamgopts);
++			Gh.PostRead();
++		}
++
++		/*Set integer coordinates*/
++		SetIntCoor();
++
++		/*Fill holes and generate mesh properties*/
++		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){
++
++		Init(0);
++		ReadMesh(index,x,y,nods,nels);
++		SetIntCoor();
++		ReconstructExistingMesh();
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::Mesh(double* x,double* y,int nods){{{*/
++	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) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Triangles)*/
++
++		  int i,k,itadj;
++		  int kt=0;
++		  int * kk    = new int [Tho.nbv];
++		  long * reft = new long[Tho.nbt];
++		  long nbInT =    Tho.TriangleReferenceList(reft);
++		  long * refv = new long[Tho.nbv];
++
++		  for (i=0;i<Tho.nbv;i++)
++			kk[i]=-1;
++		  for (i=0;i<Tho.nbv;i++)
++			refv[i]=0;
++		  int nbNewBedge =0;
++		  //  int nbOldBedge =0;  
++		  for (i=0;i<Tho.nbt;i++)
++			if(  reft[i] >=0 && flag[i]) 
++			  {
++				const Triangle & t = Tho.triangles[i];
++				kt++;
++				kk[Tho.GetId(t[0])]=1;
++				kk[Tho.GetId(t[1])]=1;
++				kk[Tho.GetId(t[2])]=1;
++				itadj=Tho.GetId(t.TriangleAdj(0));
++				if (  reft[itadj] >=0 && !flag[itadj])
++				  { nbNewBedge++;
++					refv[Tho.GetId(t[VerticesOfTriangularEdge[0][0]])]=bb[i];
++					refv[Tho.GetId(t[VerticesOfTriangularEdge[0][1]])]=bb[i];
++				  }
++				itadj=Tho.GetId(t.TriangleAdj(1));
++				if (  reft[itadj] >=0 && !flag[itadj])
++				  { nbNewBedge++;
++					refv[Tho.GetId(t[VerticesOfTriangularEdge[1][0]])]=bb[i];
++					refv[Tho.GetId(t[VerticesOfTriangularEdge[1][1]])]=bb[i];}
++					itadj=Tho.GetId(t.TriangleAdj(2));
++					if (  reft[itadj] >=0 && !flag[itadj])
++					  { nbNewBedge++;
++						refv[Tho.GetId(t[VerticesOfTriangularEdge[2][0]])]=bb[i];
++						refv[Tho.GetId(t[VerticesOfTriangularEdge[2][1]])]=bb[i];}
++			  }
++		  k=0;
++		  for (i=0;i<Tho.nbv;i++){
++			  if (kk[i]>=0) kk[i]=k++;
++			}
++		  _printLine_("   number of vertices " << k << ", remove = " << Tho.nbv - k);
++		  _printLine_("   number of triangles " << kt << ", remove = " << nbInT-kt);
++		  _printLine_("   number of New boundary edge " << nbNewBedge);
++		  long imaxnbv =k;
++		  Init(imaxnbv);
++		  for (i=0;i<Tho.nbv;i++)
++			if (kk[i]>=0) 
++			  {
++				vertices[nbv] = Tho.vertices[i];
++				if (!vertices[nbv].GetReferenceNumber())
++				 vertices[nbv].ReferenceNumber = refv[i];
++				nbv++;
++			  }
++		  if (imaxnbv != nbv){
++			  delete [] kk;
++			  delete [] refv;
++			  _error2_("imaxnbv != nbv");
++		  }
++		  for (i=0;i<Tho.nbt;i++)
++			if(  reft[i] >=0 && flag[i]) 
++			  {
++				const Triangle & t = Tho.triangles[i];
++				int i0 = Tho.GetId(t[0]);
++				int i1 = Tho.GetId(t[1]);
++				int i2 = Tho.GetId(t[2]);
++				if (i0<0 || i1<0 || i2<0){
++					delete [] refv;
++					_error2_("i0<0 || i1<0 || i2< 0");
++				}
++				if (i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv){
++					_error2_("i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv");
++				}
++				triangles[nbt] = Triangle(this,kk[i0],kk[i1],kk[i2]);
++				triangles[nbt].color = Tho.subdomains[reft[i]].ReferenceNumber; 
++				nbt++;           
++			  }
++		  if (kt!=nbt){
++			  _error2_("kt!=nbt");
++		  }
++		  if (nbt==0 && nbv==0) {
++			  _error2_("All triangles have been removed");
++		  }
++		  delete [] kk;
++		  delete [] reft;
++		  delete [] refv;
++		  //double cutoffradian = 10.0/180.0*Pi;
++		  BuildGeometryFromMesh(bamgopts);
++		  Gh.PostRead(); 
++		  SetIntCoor();
++		  ReconstructExistingMesh();
++
++		  if (!nbsubdomains){
++			  _error2_("nbsubdomains==0");
++		  }
++		  if (!subdomains[0].head || !subdomains[0].head->link){
++			  _error2_("!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)
++	  : 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++;
++		  maxnbv_in = Max(maxnbv_in,Th.nbv); 
++		  long i;
++		  // do all the allocation to be sure all the pointer existe
++
++		  Init(maxnbv_in);// to make the allocation 
++		  // copy of triangles
++		  nbv = Th.nbv;
++		  nbt = Th.nbt;
++		  nbe = Th.nbe;
++		  nbsubdomains = Th.nbsubdomains;
++		  nbtout = Th.nbtout;
++		  nbq =  Th.nbq ;
++		  NbVerticesOnGeomVertex = Th.NbVerticesOnGeomVertex;
++		  if(NbVerticesOnGeomVertex)
++			VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex];
++		  NbVerticesOnGeomEdge = Th.NbVerticesOnGeomEdge;
++		  if (NbVerticesOnGeomEdge)
++			VerticesOnGeomEdge = new VertexOnGeom[NbVerticesOnGeomEdge] ;
++		  if (& BTh == & Th.BTh){ // same background 
++			  BTh.NbRef++;
++			  NbVertexOnBThVertex = Th.NbVertexOnBThVertex;
++			  if(NbVertexOnBThVertex)
++				VertexOnBThVertex = new VertexOnVertex[NbVertexOnBThVertex];
++			  NbVertexOnBThEdge = Th.NbVertexOnBThEdge;
++			  if(NbVertexOnBThEdge)
++				VertexOnBThEdge = new VertexOnEdge[NbVertexOnBThEdge];
++			 }
++		  else { // no add on background mesh 
++			  BTh.NbRef++;
++			  NbVertexOnBThVertex=0;
++			  VertexOnBThVertex=0;
++			  NbVertexOnBThEdge=0;
++			  VertexOnBThEdge=0;
++			 }
++
++
++		  if(nbe)
++			edges = new Edge[nbe];
++		  if(nbsubdomains)
++			subdomains = new SubDomain[nbsubdomains];
++		  pmin = Th.pmin;
++		  pmax = Th.pmax;
++		  coefIcoor = Th.coefIcoor;
++		  for(i=0;i<nbt;i++)
++			triangles[i].Set(Th.triangles[i],Th,*this);
++		  for(i=0;i<nbe;i++)
++			edges[i].Set(Th,i,*this);
++		  for(i=0;i<nbv;i++)
++			vertices[i].Set(Th.vertices[i],Th,*this);
++		  for(i=0;i<nbsubdomains;i++)  
++			subdomains[i].Set(Th,i,*this);
++		  for (i=0;i<NbVerticesOnGeomVertex;i++)
++			VerticesOnGeomVertex[i].Set(Th.VerticesOnGeomVertex[i],Th,*this);
++		  for (i=0;i<NbVerticesOnGeomEdge;i++)
++			VerticesOnGeomEdge[i].Set(Th.VerticesOnGeomEdge[i],Th,*this);
++		  quadtree=0;
++
++	  }
++	/*}}}*/
++	/*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) {
++		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){
++		Init(imaxnbv);
++		TriangulateFromGeom0(bamgopts);
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::~Mesh(){{{*/
++	Mesh::~Mesh() {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Triangles)*/
++
++		//if (vertices)             delete [] vertices;
++		if (edges)                delete [] edges;
++		if (triangles)            delete [] triangles;
++		if (quadtree)             delete    quadtree;
++		//if (orderedvertices)                delete [] orderedvertices;
++		if (subdomains)           delete []  subdomains;
++		if (VerticesOnGeomEdge)   delete [] VerticesOnGeomEdge;
++		if (VerticesOnGeomVertex) delete [] VerticesOnGeomVertex;
++		if (VertexOnBThVertex)    delete [] VertexOnBThVertex;
++		if (VertexOnBThEdge)      delete [] VertexOnBThEdge;
++
++		if (&Gh) {
++			if (Gh.NbRef>0) Gh.NbRef--;
++			else if (Gh.NbRef==0) delete &Gh;
++		}
++		if (&BTh && (&BTh != this)) {
++			if (BTh.NbRef>0) BTh.NbRef--;
++			else if (BTh.NbRef==0) delete &BTh;
++		}
++		Init(0); // set all to zero 
++	}
++	/*}}}*/
++
++	/*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){
++
++		double Hmin = HUGE_VAL;// the infinie value 
++		long i1,i2,i3;
++		long i,j;
++		Metric M1(1);
++		int verbose=0;
++		bool* nodeflags=NULL;
++
++		nbv=nods;
++		maxnbv=nbv;
++		nbt=nels;
++
++		//Vertices
++		if (verbose) _printLine_("Reading vertices (" << nbv << ")");
++		vertices=xNew<BamgVertex>(nbv);
++		orderedvertices=xNew<BamgVertex*>(nbv);
++		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 
++
++		//Triangles
++		if (verbose) _printLine_("Reading triangles (" << nbt << ")");
++		triangles =new Triangle[maxnbt]; //we cannot allocate only nbt triangles since 
++		nodeflags=xNew<bool>(nbv);
++		for(i=0;i<nbv;i++) nodeflags[i]=false;
++		//other triangles will be added for each edge
++		for (i=0;i<nbt;i++){
++			Triangle & t = triangles[i];
++			i1=(long)index[i*3+0]-1; //for C indexing
++			i2=(long)index[i*3+1]-1; //for C indexing
++			i3=(long)index[i*3+2]-1; //for C indexing
++			t=Triangle(this,i1,i2,i3);
++			t.color=1;
++			nodeflags[i1]=nodeflags[i2]=nodeflags[i3]=true;
++		}
++
++		/*Recreate geometry: */
++		if (verbose) _printLine_("Building Geometry");
++		BuildGeometryFromMesh();
++		if (verbose) _printLine_("Completing geometry");
++		Gh.PostRead();
++
++		/*Check that there is no orphan*/
++		bool isorphan=false;
++		for(i=0;i<nbv;i++){
++			if(!nodeflags[i]){
++				_printLine_("Vertex " << i+1 << " does not belong to any element");
++				isorphan=true;
++			}
++		}
++		if(isorphan) _error2_("Orphan found in mesh, see ids above");
++
++		/*Clean up*/
++		xDelete<bool>(nodeflags);
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts){{{*/
++	void Mesh::ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts){
++
++		int    verbose;
++		double Hmin = HUGE_VAL;    // the infinie value
++		long   i1,i2,i3;
++		long   i,j;
++		Metric M1(1);
++
++		verbose=bamgopts->verbose;
++
++		nbv=bamgmesh->VerticesSize[0];
++		maxnbv=nbv;
++		nbt=bamgmesh->TrianglesSize[0];
++
++		//Vertices
++		if(bamgmesh->Vertices){
++			if(verbose>5) _printLine_("      processing Vertices");
++
++			vertices=xNew<BamgVertex>(nbv);
++			orderedvertices=xNew<BamgVertex*>(nbv);
++
++			for (i=0;i<nbv;i++){
++				vertices[i].r.x=bamgmesh->Vertices[i*3+0];
++				vertices[i].r.y=bamgmesh->Vertices[i*3+1];
++				vertices[i].ReferenceNumber=(long)bamgmesh->Vertices[i*3+2];
++				vertices[i].DirOfSearch =NoDirOfSearch;
++				vertices[i].m=M1;
++				vertices[i].color=0;
++			}
++			maxnbt=2*maxnbv-2; // for filling The Holes and quadrilaterals 
++		}
++		else{
++			if(verbose>5) _error2_("no Vertices found in the initial mesh");
++		}
++
++		//Triangles
++		if(bamgmesh->Triangles){
++			if(verbose>5) _printLine_("      processing Triangles");
++			triangles =new Triangle[maxnbt]; //we cannot allocate only nbt triangles since 
++			//other triangles will be added for each edge
++			for (i=0;i<nbt;i++){
++				Triangle &t=triangles[i];
++				i1=(long)bamgmesh->Triangles[i*4+0]-1; //for C indexing
++				i2=(long)bamgmesh->Triangles[i*4+1]-1; //for C indexing
++				i3=(long)bamgmesh->Triangles[i*4+2]-1; //for C indexing
++				t=Triangle(this,i1,i2,i3);
++				t.color=(long)bamgmesh->Triangles[i*4+3];
++			}
++		}
++		else{
++			if(verbose>5) _error2_("no Triangles found in the initial mesh");
++		}
++
++		//Quadrilaterals
++		if(bamgmesh->Quadrilaterals){
++			if(verbose>5) _printLine_("      processing Quadrilaterals");
++			long i1,i2,i3,i4,iref;
++			triangles =new Triangle[nbt];
++			for (i=0;i<bamgmesh->QuadrilateralsSize[0];i++){
++				//divide the quad into two triangles
++				Triangle & t1 = triangles[2*i];
++				Triangle & t2 = triangles[2*i+1];
++				i1=(long)bamgmesh->Quadrilaterals[i*5+0]-1; //for C indexing
++				i2=(long)bamgmesh->Quadrilaterals[i*5+1]-1; //for C indexing
++				i3=(long)bamgmesh->Quadrilaterals[i*5+2]-1; //for C indexing
++				i4=(long)bamgmesh->Quadrilaterals[i*5+3]-1; //for C indexing
++				t1=Triangle(this,i1,i2,i3);
++				t2=Triangle(this,i3,i4,i1);
++				t1.color=(long)bamgmesh->Quadrilaterals[i*5+4];
++				t2.color=(long)bamgmesh->Quadrilaterals[i*5+4];
++				t1.SetHidden(OppositeEdge[1]); // two times  because the adj was not created 
++				t2.SetHidden(OppositeEdge[1]); 
++			}
++		}
++
++		//VerticesOnGeomEdge
++		if(bamgmesh->VerticesOnGeomEdge){
++			if(verbose>5) _printLine_("      processing VerticesOnGeomEdge");
++			NbVerticesOnGeomEdge=bamgmesh->VerticesOnGeomEdgeSize[0];
++			VerticesOnGeomEdge= new  VertexOnGeom[NbVerticesOnGeomEdge] ;
++			for (i=0;i<NbVerticesOnGeomEdge;i++){
++				long  i1,i2;
++				double s;
++				i1=(long)  bamgmesh->VerticesOnGeomEdge[i*3+0]-1; //for C indexing
++				i2=(long)  bamgmesh->VerticesOnGeomEdge[i*3+1]-1; //for C indexing
++				s =(double)bamgmesh->VerticesOnGeomEdge[i*3+2];
++				VerticesOnGeomEdge[i]=VertexOnGeom(vertices[i1],Gh.edges[i2],s);
++			}
++		}
++
++		//VerticesOnGeomVertex
++		if(bamgmesh->VerticesOnGeomVertexSize[0]){
++			if(verbose>5) _printLine_("      processing VerticesOnGeomVertex");
++			NbVerticesOnGeomVertex=bamgmesh->VerticesOnGeomVertexSize[0];
++			VerticesOnGeomVertex  = new  VertexOnGeom[NbVerticesOnGeomVertex] ;
++			for (i=0;i<NbVerticesOnGeomVertex;i++){
++				long  i1,i2;
++				i1=(long)bamgmesh->VerticesOnGeomVertex[i*2+0]-1; //for C indexing
++				i2=(long)bamgmesh->VerticesOnGeomVertex[i*2+1]-1; //for C indexing
++				VerticesOnGeomVertex[i]=VertexOnGeom(vertices[i1],Gh.vertices[i2]);
++			}
++		}
++
++		//Edges
++		if (bamgmesh->Edges){
++			int i1,i2;
++			double* len=NULL;
++
++			if(verbose>5) _printLine_("      processing Edges");
++			nbe=bamgmesh->EdgesSize[0];
++			edges= new Edge[nbe];
++			//initialize length of each edge (used to provided metric)
++			len= new double[nbv];
++			for(i=0;i<nbv;i++) len[i]=0;
++
++			for (i=0;i<nbe;i++){
++				i1=(int)bamgmesh->Edges[i*3+0]-1; //-1 for C indexing
++				i2=(int)bamgmesh->Edges[i*3+1]-1; //-1 for C indexing
++				edges[i].ReferenceNumber=(long)bamgmesh->Edges[i*3+2];
++				edges[i].v[0]= vertices +i1;
++				edges[i].v[1]= vertices +i2;
++				edges[i].adj[0]=NULL;
++				edges[i].adj[1]=NULL;
++				R2 x12=vertices[i2].r-vertices[i1].r;
++				double l12=sqrt((x12,x12));
++
++				//prepare metric
++				vertices[i1].color++;
++				vertices[i2].color++;
++				len[i1]+=l12;
++				len[i2]+=l12;
++				Hmin = Min(Hmin,l12);
++			}
++
++			// definition  the default of the given mesh size 
++			for (i=0;i<nbv;i++){
++				if (vertices[i].color>0) 
++				 vertices[i].m=Metric(len[i]/(double)vertices[i].color);
++				else 
++				 vertices[i].m=Metric(Hmin);
++			}
++			delete [] len;
++
++			// construction of edges[].adj 
++			for (i=0;i<nbv;i++){ 
++				vertices[i].color=(vertices[i].color ==2) ?-1:-2;
++			}
++			for (i=0;i<nbe;i++){
++				for (j=0;j<2;j++) { 
++					BamgVertex *v=edges[i].v[j];
++					long i0=v->color,j0;
++					if(i0==-1){
++						v->color=i*2+j;
++					}
++					else if (i0>=0) {// i and i0 edge are adjacent by the vertex v
++						j0 = i0%2;
++						i0 = i0/2;
++						_assert_(v==edges[i0 ].v[j0]);
++						edges[i ].adj[j ] =edges +i0;
++						edges[i0].adj[j0] =edges +i ;
++						v->color = -3;
++					}
++				}
++			}
++		}
++
++		//EdgeOnGeomEdge
++		if(bamgmesh->EdgesOnGeomEdge){
++			if(verbose>5) _printLine_("      processing EdgesOnGeomEdge");
++			int i1,i2,i,j;
++			i2=bamgmesh->EdgesOnGeomEdgeSize[0];
++			for (i1=0;i1<i2;i1++) {
++				i=(int)bamgmesh->EdgesOnGeomEdge[i1*2+0]-1; //C indexing
++				j=(int)bamgmesh->EdgesOnGeomEdge[i1*2+1]-1; //C indexing
++				//Check value
++				if(!(i>=0 && j>=0 && i<nbe && j<Gh.nbe)) {
++					_error2_("ReadMesh error: EdgesOnGeomEdge edge provided (line " << i1+1 << ": [" << i+1 << " " << j+1 << "]) is incorrect (must be positive, [0<i<nbe=" << nbe << " 0<j<Gh.nbe=" << Gh.nbe << "]");
++				}
++				edges[i].GeomEdgeHook=Gh.edges+j;
++			}
++		}
++
++		//SubDomain
++		if(bamgmesh->SubDomains){
++			long i3,head,direction;
++			if(verbose>5) _printLine_("      processing SubDomains");
++			nbsubdomains=bamgmesh->SubDomainsSize[0];
++			subdomains = new SubDomain [ nbsubdomains ];
++			for (i=0;i<nbsubdomains;i++) {
++				i3  =(int)bamgmesh->SubDomains[i*3+0];
++				head=(int)bamgmesh->SubDomains[i*3+1]-1;//C indexing
++				direction=(int)bamgmesh->SubDomains[i*3+2];
++				if (i3!=23) _error2_("Bad Subdomain definition: first number should be 3");
++				if (head<0 || head>=nbt) _error2_("Bad Subdomain definition: head should in [1 " << nbt << "] (triangle number)");
++				subdomains[i].head = triangles+head;
++			}
++		}
++
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::WriteMesh {{{*/
++	void Mesh::WriteMesh(BamgMesh* bamgmesh,BamgOpts* bamgopts){
++
++		/*Intermediary*/
++		int i,j,k,num,i1,i2;
++		long n;
++		int* head_1=NULL;
++		int* next_1=NULL;
++		int* connectivitysize_1=NULL;
++		int  connectivitymax_1=0;
++
++		/*Get options*/
++		int verbose=bamgopts->verbose;
++
++		/*Build reft that holds the number the subdomain number of each triangle, and the real numbering of the elements*/
++		long* reft = new long[nbt];
++		long* numt = new long[nbt];
++		long nbInT = TriangleReferenceList(reft);
++		TriangleIntNumbering(numt);
++
++		/*Chaining algorithm used to generate connectivity tables and other outputs*/
++
++		//Memory Allocation
++		head_1=xNew<int>(nbv);
++		next_1=xNew<int>(3*nbt);
++		connectivitysize_1=xNew<int>(nbv);
++
++		//Initialization
++		for (i=0;i<nbv;i++) head_1[i]=-1;
++		for (i=0;i<nbv;i++) connectivitysize_1[i]=0;
++		k=0;
++		//Chains generation
++		for (i=0;i<nbt;i++) {
++			//Do not take into account outside triangles (reft<0)
++			if (reft[i]>=0){
++				for (j=0;j<3;j++){
++					int v=GetId(triangles[i][j]); //jth vertex of the ith triangle
++					if (k>3*nbt-1 || k<0) _error2_("k = " << k << ", nbt = " << nbt);
++					next_1[k]=head_1[v];
++					if (v>nbv-1 || v<0)   _error2_("v = " << v << ", nbv = " << nbv);
++					head_1[v]=k++;
++					connectivitysize_1[v]+=1;
++				}
++			}
++		}
++		//Get maximum connectivity
++		connectivitymax_1=0;
++		for (i=0;i<nbv;i++){
++			if (connectivitysize_1[i]>connectivitymax_1) connectivitymax_1=connectivitysize_1[i];
++		}
++
++		/*OK, now build outputs*/
++
++		/*Vertices*/
++		if(verbose>5) _printLine_("      writing Vertices");
++		bamgmesh->VerticesSize[0]=nbv;
++		bamgmesh->VerticesSize[1]=3;
++		if (nbv){
++			bamgmesh->Vertices=xNew<double>(3*nbv);
++			for (i=0;i<nbv;i++){
++				bamgmesh->Vertices[i*3+0]=vertices[i].r.x;
++				bamgmesh->Vertices[i*3+1]=vertices[i].r.y;
++				bamgmesh->Vertices[i*3+2]=vertices[i].GetReferenceNumber();
++			}
++		}
++
++		/*Edges*/
++		if(verbose>5) _printLine_("      writing Edges");
++		bamgmesh->EdgesSize[0]=nbe;
++		bamgmesh->EdgesSize[1]=3;
++		int NumIssmSegments=0;
++		if (nbe){
++			bamgmesh->Edges=xNew<double>(3*nbe);
++			for (i=0;i<nbe;i++){
++				bamgmesh->Edges[i*3+0]=GetId(edges[i][0])+1; //back to M indexing
++				bamgmesh->Edges[i*3+1]=GetId(edges[i][1])+1; //back to M indexing
++				bamgmesh->Edges[i*3+2]=edges[i].ReferenceNumber;
++				if(edges[i].GeomEdgeHook){
++					NumIssmSegments++;
++				}
++			}
++		}
++
++		/*Element edges*/
++		if(verbose>5) _printLine_("      writing element edges");
++		SetOfEdges4* edge4=new SetOfEdges4(nbt*3,nbv);
++		double* elemedge=NULL;
++		elemedge=xNew<double>(3*nbt);
++		for (i=0;i<3*nbt;i++) elemedge[i]=-2.;//will become -1
++		k=0;
++		for (i=0;i<nbt;i++){
++			//Do not take into account outside triangles (reft<0)
++			if (reft[i]>=0){
++				for  (j=0;j<3;j++) {
++					i1=GetId(triangles[i][VerticesOfTriangularEdge[j][0]]);
++					i2=GetId(triangles[i][VerticesOfTriangularEdge[j][1]]);
++					n =edge4->SortAndFind(i1,i2);
++					if (n==-1){
++						//first time
++						n=edge4->SortAndAdd(i1,i2);
++						elemedge[n*2+0]=double(k);
++					}
++					else{
++						//second time
++						elemedge[n*2+1]=double(k);
++					}
++				}
++				k++;
++			}
++		}
++		bamgmesh->IssmEdgesSize[0]=edge4->nb();
++		bamgmesh->IssmEdgesSize[1]=4;
++		bamgmesh->IssmEdges=xNew<double>(4*edge4->nb());
++		for (i=0;i<edge4->nb();i++){
++			/*Invert first two vertices if necessary*/
++			bool found=false;
++			for (j=0;j<3;j++){
++				if (triangles[(int)elemedge[2*i+0]](j)==vertices+edge4->i(i)){
++					if (triangles[(int)elemedge[2*i+0]]((j+1)%3)==vertices+edge4->j(i)){
++						//trigonometric direction
++						bamgmesh->IssmEdges[i*4+0]=edge4->i(i)+1;// back to M indexing
++						bamgmesh->IssmEdges[i*4+1]=edge4->j(i)+1;// back to M indexing
++					}
++					else{
++						bamgmesh->IssmEdges[i*4+0]=edge4->j(i)+1;// back to M indexing
++						bamgmesh->IssmEdges[i*4+1]=edge4->i(i)+1;// back to M indexing
++					}
++					found=true;
++					break;
++				}
++			}
++			_assert_(found);
++			bamgmesh->IssmEdges[i*4+2]=elemedge[2*i+0]+1; // back to M indexing
++			bamgmesh->IssmEdges[i*4+3]=elemedge[2*i+1]+1; // back to M indexing
++		}
++		//clean up
++		delete edge4;
++		xDelete<double>(elemedge);
++
++		/*IssmSegments*/
++		if(verbose>5) _printLine_("      writing IssmSegments");
++		bamgmesh->IssmSegmentsSize[0]=NumIssmSegments;
++		bamgmesh->IssmSegmentsSize[1]=4;
++		bamgmesh->IssmSegments=xNew<double>(4*NumIssmSegments);
++		num=0;
++		for (i=0;i<nbe;i++){
++			if(edges[i].GeomEdgeHook){
++				//build segment
++				int i1=GetId(edges[i][0]);
++				int i2=GetId(edges[i][1]);
++				bool stop=false;
++				for(j=head_1[i1];j!=-1;j=next_1[j]){
++					for(k=0;k<3;k++){
++						if (GetId(triangles[(int)j/3][k])==i1){
++							if (GetId(triangles[(int)j/3][(int)((k+1)%3)])==i2){
++								bamgmesh->IssmSegments[num*4+0]=GetId(edges[i][0])+1; //back to M indexing
++								bamgmesh->IssmSegments[num*4+1]=GetId(edges[i][1])+1; //back to M indexing
++								bamgmesh->IssmSegments[num*4+2]=(int)j/3+1;            //back to M indexing
++								bamgmesh->IssmSegments[num*4+3]=edges[i].ReferenceNumber;
++								num+=1;
++								stop=true;
++								break;
++							}
++							if (GetId(triangles[(int)j/3][(int)((k+2)%3)])==i2){
++								bamgmesh->IssmSegments[num*4+0]=GetId(edges[i][1])+1; //back to M indexing
++								bamgmesh->IssmSegments[num*4+1]=GetId(edges[i][0])+1; //back to M indexing
++								bamgmesh->IssmSegments[num*4+2]=(int)j/3+1;            //back to M indexing
++								bamgmesh->IssmSegments[num*4+3]=edges[i].ReferenceNumber;
++								num+=1;
++								stop=true;
++								break;
++							}
++						}
++					}
++					if(stop) break;
++				}
++				if (!stop){
++					_error2_("Element holding segment [" << i1+1 << " " << i2+1 << "] not found...");
++				}
++			}
++		}
++
++		/*Triangles*/
++		if(verbose>5) _printLine_("      writing Triangles");
++		k=nbInT-nbq*2;
++		num=0;
++		bamgmesh->TrianglesSize[0]=k;
++		bamgmesh->TrianglesSize[1]=4;
++		if (k){
++			bamgmesh->Triangles=xNew<double>(4*k);
++			for (i=0;i<nbt;i++){
++				Triangle &t=triangles[i];
++				//reft[i]=-1 for outside triangle
++				if (reft[i]>=0 && !( t.Hidden(0) || t.Hidden(1) || t.Hidden(2) )){
++					bamgmesh->Triangles[num*4+0]=GetId(t[0])+1; //back to M indexing
++					bamgmesh->Triangles[num*4+1]=GetId(t[1])+1; //back to M indexing
++					bamgmesh->Triangles[num*4+2]=GetId(t[2])+1; //back to M indexing
++					bamgmesh->Triangles[num*4+3]=subdomains[reft[i]].ReferenceNumber;
++					num=num+1;
++				}
++			}
++		}
++
++		/*Quadrilaterals*/
++		if(verbose>5) _printLine_("      writing Quadrilaterals");
++		bamgmesh->QuadrilateralsSize[0]=nbq;
++		bamgmesh->QuadrilateralsSize[1]=5;
++		if (nbq){
++			bamgmesh->Quadrilaterals=xNew<double>(5*nbq);
++			for (i=0;i<nbt;i++){
++				Triangle &t =triangles[i];
++				Triangle* ta;
++				BamgVertex *v0,*v1,*v2,*v3;
++				if (reft[i]<0) continue;
++				if ((ta=t.Quadrangle(v0,v1,v2,v3)) !=0 && &t<ta) { 
++					bamgmesh->Quadrilaterals[i*5+0]=GetId(v0)+1; //back to M indexing
++					bamgmesh->Quadrilaterals[i*5+1]=GetId(v1)+1; //back to M indexing
++					bamgmesh->Quadrilaterals[i*5+2]=GetId(v2)+1; //back to M indexing
++					bamgmesh->Quadrilaterals[i*5+3]=GetId(v3)+1; //back to M indexing
++					bamgmesh->Quadrilaterals[i*5+4]=subdomains[reft[i]].ReferenceNumber;
++				}
++			}
++		}
++
++		/*SubDomains*/
++		if(verbose>5) _printLine_("      writing SubDomains");
++		bamgmesh->SubDomainsSize[0]=nbsubdomains;
++		bamgmesh->SubDomainsSize[1]=4;
++		if (nbsubdomains){
++			bamgmesh->SubDomains=xNew<double>(4*nbsubdomains);
++			for (i=0;i<nbsubdomains;i++){
++				bamgmesh->SubDomains[i*4+0]=3;
++				bamgmesh->SubDomains[i*4+1]=reft[GetId(subdomains[i].head)];
++				bamgmesh->SubDomains[i*4+2]=1;
++				bamgmesh->SubDomains[i*4+3]=subdomains[i].ReferenceNumber;
++			}
++		}
++
++		/*SubDomainsFromGeom*/
++		if(verbose>5) _printLine_("      writing SubDomainsFromGeom");
++		bamgmesh->SubDomainsFromGeomSize[0]=Gh.nbsubdomains;
++		bamgmesh->SubDomainsFromGeomSize[1]=4;
++		if (Gh.nbsubdomains){
++			bamgmesh->SubDomainsFromGeom=xNew<double>(4*Gh.nbsubdomains);
++			for (i=0;i<Gh.nbsubdomains;i++){
++				bamgmesh->SubDomainsFromGeom[i*4+0]=2;
++				bamgmesh->SubDomainsFromGeom[i*4+1]=GetId(subdomains[i].edge)+1; //back to Matlab indexing
++				bamgmesh->SubDomainsFromGeom[i*4+2]=subdomains[i].direction;
++				bamgmesh->SubDomainsFromGeom[i*4+3]=Gh.subdomains[i].ReferenceNumber;
++			}
++		}
++
++		/*VerticesOnGeomVertex*/
++		if(verbose>5) _printLine_("      writing VerticesOnGeomVertex");
++		bamgmesh->VerticesOnGeomVertexSize[0]=NbVerticesOnGeomVertex;
++		bamgmesh->VerticesOnGeomVertexSize[1]=2;
++		if (NbVerticesOnGeomVertex){
++			bamgmesh->VerticesOnGeomVertex=xNew<double>(2*NbVerticesOnGeomVertex);
++			for (i=0;i<NbVerticesOnGeomVertex;i++){
++				VertexOnGeom &v=VerticesOnGeomVertex[i];
++				_assert_(v.OnGeomVertex());
++				bamgmesh->VerticesOnGeomVertex[i*2+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing
++				bamgmesh->VerticesOnGeomVertex[i*2+1]=Gh.GetId((GeomVertex*)v)+1; //back to Matlab indexing
++			}
++		}
++
++		/*VertexOnGeomEdge*/
++		if(verbose>5) _printLine_("      writing VerticesOnGeomEdge");
++		bamgmesh->VerticesOnGeomEdgeSize[0]=NbVerticesOnGeomEdge;
++		bamgmesh->VerticesOnGeomEdgeSize[1]=3;
++		if (NbVerticesOnGeomEdge){
++			bamgmesh->VerticesOnGeomEdge=xNew<double>(3*NbVerticesOnGeomEdge);
++			for (i=0;i<NbVerticesOnGeomEdge;i++){
++				const VertexOnGeom &v=VerticesOnGeomEdge[i];
++				if (!v.OnGeomEdge()){
++					_error2_("A vertices supposed to be OnGeomEdge is actually not");
++				}
++				bamgmesh->VerticesOnGeomEdge[i*3+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing
++				bamgmesh->VerticesOnGeomEdge[i*3+1]=Gh.GetId((const GeomEdge*)v)+1; //back to Matlab indexing
++				bamgmesh->VerticesOnGeomEdge[i*3+2]=(double)v; //absisce
++			}
++		}
++
++		/*EdgesOnGeomEdge*/
++		if(verbose>5) _printLine_("      writing EdgesOnGeomEdge");
++		k=0;
++		for (i=0;i<nbe;i++){
++			if (edges[i].GeomEdgeHook) k=k+1;
++		}
++		bamgmesh->EdgesOnGeomEdgeSize[0]=k;
++		bamgmesh->EdgesOnGeomEdgeSize[1]=2;
++		if (k){
++			bamgmesh->EdgesOnGeomEdge=xNew<double>(2*(int)k);
++			int count=0;
++			for (i=0;i<nbe;i++){
++				if (edges[i].GeomEdgeHook){
++					bamgmesh->EdgesOnGeomEdge[count*2+0]=(double)i+1; //back to Matlab indexing
++					bamgmesh->EdgesOnGeomEdge[count*2+1]=(double)Gh.GetId(edges[i].GeomEdgeHook)+1; //back to Matlab indexing
++					count=count+1;
++				}
++			}
++		}
++
++		/*Element Connectivity*/
++		if(verbose>5) _printLine_("      writing Element connectivity");
++		bamgmesh->ElementConnectivitySize[0]=nbt-nbtout;
++		bamgmesh->ElementConnectivitySize[1]=3;
++		bamgmesh->ElementConnectivity=xNew<double>(3*(nbt-nbtout));
++		for (i=0;i<3*(nbt-nbtout);i++) bamgmesh->ElementConnectivity[i]=NAN;
++		num=0;
++		for (i=0;i<nbt;i++){
++			if (reft[i]>=0){
++				for (j=0;j<3;j++){
++					k=GetId(triangles[i].TriangleAdj(j));
++					if (reft[k]>=0){
++						_assert_(3*num+j<3*(nbt-nbtout));
++						bamgmesh->ElementConnectivity[3*num+j]=k+1; // back to Matlab indexing
++					}
++				}
++				num+=1;
++			}
++		}
++
++		/*ElementNodal Connectivity*/
++		if(verbose>5) _printLine_("      writing Nodal element connectivity");
++		bamgmesh->NodalElementConnectivitySize[0]=nbv;
++		bamgmesh->NodalElementConnectivitySize[1]=connectivitymax_1;
++		bamgmesh->NodalElementConnectivity=xNew<double>(connectivitymax_1*nbv);
++		for (i=0;i<connectivitymax_1*nbv;i++) bamgmesh->NodalElementConnectivity[i]=NAN;
++		for (i=0;i<nbv;i++){
++			k=0;
++			for(j=head_1[i];j!=-1;j=next_1[j]){
++				_assert_(connectivitymax_1*i+k < connectivitymax_1*nbv);
++				bamgmesh->NodalElementConnectivity[connectivitymax_1*i+k]=floor((double)j/3)+1;
++				k++;
++			}
++		}
++
++		/*Nodal Connectivity*/
++		if(verbose>5) _printLine_("      writing Nodal connectivity");
++		//chaining algorithm (again...)
++		int* head_2=NULL;
++		int* next_2=NULL;
++		int* connectivitysize_2=NULL;
++		int  connectivitymax_2=0;
++		i1=bamgmesh->IssmEdgesSize[0];
++		i2=bamgmesh->IssmEdgesSize[1];
++		head_2=xNew<int>(nbv);
++		next_2=xNew<int>(2*i1);
++		connectivitysize_2=xNew<int>(nbv);
++		//Initialization
++		for (i=0;i<nbv;i++) head_2[i]=-1;
++		for (i=0;i<nbv;i++) connectivitysize_2[i]=0;
++		k=0;
++		//Chains generation
++		for (i=0;i<i1;i++) {
++			for (j=0;j<2;j++){
++				int v=(int)bamgmesh->IssmEdges[i*i2+j]-1; //back to C indexing
++				if (k>2*i1-1 || k<0) _error2_("Index exceed matrix dimensions (k=" << k << " not in [0 " << 2*i1-1 << "]");
++				next_2[k]=head_2[v];
++				if (v>nbv-1 || v<0)   _error2_("Index exceed matrix dimensions (v=" << v << " not in [0 " << nbv-1 << "])");
++				head_2[v]=k++;
++				connectivitysize_2[v]+=1;
++			}
++		}
++		//Get maximum connectivity
++		for (i=0;i<nbv;i++){
++			if (connectivitysize_2[i]>connectivitymax_2) connectivitymax_2=connectivitysize_2[i];
++		}
++		//Build output
++		bamgmesh->NodalConnectivitySize[0]=nbv;
++		bamgmesh->NodalConnectivitySize[1]=connectivitymax_2;
++		bamgmesh->NodalConnectivity=xNew<double>(connectivitymax_2*nbv);
++		for (i=0;i<connectivitymax_2*nbv;i++) bamgmesh->NodalConnectivity[i]=NAN;
++		for (i=0;i<nbv;i++){
++			k=0;
++			for(j=head_2[i];j!=-1;j=next_2[j]){
++				_assert_(connectivitymax_2*i+k < connectivitymax_2*nbv);
++				num=(int)bamgmesh->IssmEdges[int(j/2)*i2+0];
++				if (i+1==num){ //carefull, ElementEdge is in M indexing
++					//i is the first vertex of the edge, it is therefore connected to the second vertex
++					bamgmesh->NodalConnectivity[connectivitymax_2*i+k]=bamgmesh->IssmEdges[int(j/2)*i2+1];
++				}
++				else{
++					bamgmesh->NodalConnectivity[connectivitymax_2*i+k]=num;
++				}
++				k++;
++			}
++		}
++
++		/*Cracked vertices*/
++		if(verbose>5) _printLine_("      writing Cracked vertices");
++		bamgmesh->CrackedVerticesSize[0]=NbCrackedVertices;
++		bamgmesh->CrackedVerticesSize[1]=2;
++		if (NbCrackedVertices){
++			bamgmesh->CrackedVertices=xNew<double>(2*NbCrackedVertices);
++			for (i=0;i<NbCrackedVertices;i++){
++				bamgmesh->CrackedVertices[i*2+0]=CrackedVertices[i*2+0]+1; //M indexing
++				bamgmesh->CrackedVertices[i*2+1]=CrackedVertices[i*2+1]+1; //M indexing
++			}
++		}
++
++		/*Cracked vertices*/
++		if(verbose>5) _printLine_("      writing Cracked vertices");
++		bamgmesh->CrackedEdgesSize[0]=NbCrackedEdges;
++		bamgmesh->CrackedEdgesSize[1]=4;
++		if (NbCrackedEdges){
++			bamgmesh->CrackedEdges=xNew<double>(2*NbCrackedEdges);
++			for (i=0;i<NbCrackedEdges;i++){
++				bamgmesh->CrackedEdges[i*2+0]=0;//CrackedEdges[i]->+1; //M indexing
++				bamgmesh->CrackedEdges[i*2+1]=0;//CrackedEdges[i]-]->+1; //M indexing
++			}
++		}
++
++		//clean up
++		xDelete<int>(connectivitysize_1);
++		xDelete<int>(head_1);
++		xDelete<int>(next_1);
++		xDelete<int>(connectivitysize_2);
++		xDelete<int>(head_2);
++		xDelete<int>(next_2);
++		delete [] reft;
++		delete [] numt;
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::ReadMetric{{{*/
++	void Mesh::ReadMetric(const BamgOpts* bamgopts) {
++
++		/*Intermediary*/
++		int  i,j;
++
++		if(bamgopts->verbose>3) _printLine_("      processing metric");
++		double hmin = Max(bamgopts->hmin,MinimalHmin());
++		double hmax = Min(bamgopts->hmax,MaximalHmax());
++		double coef = bamgopts->coeff;
++
++		//for now we only use j==3
++		j=3;
++
++		for (i=0;i<nbv;i++){
++			double h;
++			if (j == 1){
++				h=bamgopts->metric[i];
++				vertices[i].m=Metric(Max(hmin,Min(hmax, h*coef)));
++			}
++			else if (j==3){
++				//do not erase metric computed by hVertices
++				if (vertices[i].m.a11==1 && vertices[i].m.a21==0 && vertices[i].m.a22==1){
++					double a,b,c;	     
++					a=bamgopts->metric[i*3+0];
++					b=bamgopts->metric[i*3+1];
++					c=bamgopts->metric[i*3+2];
++					Metric M(a,b,c);
++					EigenMetric Vp(M/coef);
++
++					Vp.Maxh(hmax);
++					Vp.Minh(hmin);
++					vertices[i].m = Vp;
++				}
++			}
++		}
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::WriteMetric{{{*/
++	void Mesh::WriteMetric(BamgOpts* bamgopts) {
++		int i;
++		xDelete<double>(bamgopts->metric);
++		bamgopts->metric=xNew<double>(3*nbv);
++		for (i=0;i<nbv;i++){
++			bamgopts->metric[i*3+0]=vertices[i].m.a11;
++			bamgopts->metric[i*3+1]=vertices[i].m.a21;
++			bamgopts->metric[i*3+2]=vertices[i].m.a22;
++		}
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::WriteIndex{{{*/
++	void Mesh::WriteIndex(int** pindex,int* pnels){
++
++		/*Intermediary*/
++		int i,k,num;
++		int verbose=0;
++
++		/*output*/
++		int* index=NULL;
++
++		/*Get number of triangles*/
++		k=0;
++		for (i=0;i<nbt;i++){
++			Triangle &t=triangles[i];
++			if(t.det>0) k++;
++		}
++
++		if (k){
++			index=xNew<int>(3*k);
++			num=0;
++			for (i=0;i<nbt;i++){
++				Triangle &t=triangles[i];
++				if (t.det>0 && !(t.Hidden(0)||t.Hidden(1) || t.Hidden(2) )){
++					//if(t.Anisotropy()<2 & t.Length()<1.e+5){
++						index[num*3+0]=GetId(t[0])+1; //back to M indexing
++						index[num*3+1]=GetId(t[1])+1; //back to M indexing
++						index[num*3+2]=GetId(t[2])+1; //back to M indexing
++						num=num+1;
++					//}
++				}
++			}
++		}
++
++		/*Assign output pointers*/
++		*pindex=index;
++		*pnels=num;
++	}
++	/*}}}*/
++
++	/*Methods*/
++	/*FUNCTION Mesh::AddGeometryMetric{{{*/
++	void Mesh::AddGeometryMetric(BamgOpts* bamgopts){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/IntersectGeomMetric)*/
++
++		/*Get options*/
++		int    verbose=bamgopts->verbose;
++		double anisomax =bamgopts->anisomax;
++		double errg     =bamgopts->errg;
++
++		double ss[2]={0.00001,0.99999};
++		double errC = 2*sqrt(2*errg);
++		double hmax = Gh.MaximalHmax();
++		double hmin = Gh.MinimalHmin();
++
++		//check that hmax is positive
++		if (hmax<=0){
++			_error2_("hmax<=0");
++		}
++
++		//errC cannot be higher than 1
++		if (errC>1) errC=1;
++
++		//Set all vertices to "on"
++		SetVertexFieldOn();
++
++		//loop over all the vertices on edges
++		for (int  i=0;i<nbe;i++){
++			for (int j=0;j<2;j++){
++
++				BamgVertex V;
++				VertexOnGeom GV;
++				Gh.ProjectOnCurve(edges[i],ss[j],V,GV);
++
++				GeomEdge* eg = GV;
++				double s = GV;
++				R2 tg;
++				double  R1= eg->R1tg(s,tg);
++				double  ht=hmax;
++				// err relative to the length of the edge
++				if (R1>1.0e-20) {  
++					ht = Min(Max(errC/R1,hmin),hmax);
++				}
++				double hn=Min(hmax,ht*anisomax);
++
++				if (ht<=0 || hn<=0){
++					_error2_("ht<=0 || hn<=0");
++				}
++				EigenMetric Vp(1/(ht*ht),1/(hn*hn),tg);
++				Metric MVp(Vp);
++				edges[i][j].m.IntersectWith(MVp);
++			}
++		}
++		// the problem is for the vertex on vertex 
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::AddMetric{{{*/
++	void Mesh::AddMetric(BamgOpts* bamgopts){
++		//  Hessiantype = 0 =>  H is computed using double P2 projection
++		//  Hessiantype = 1 =>  H is computed with green formula
++
++		/*Options*/
++		int Hessiantype=bamgopts->Hessiantype;
++
++		if (Hessiantype==0){
++			BuildMetric0(bamgopts);
++		}
++		else if (Hessiantype==1){
++			BuildMetric1(bamgopts);
++		}
++		else{
++			_error2_("Hessiantype " << Hessiantype << " not supported yet (1->use Green formula, 0-> double P2 projection)");
++		}
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::AddVertex{{{*/
++	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
++		//                               !
++		//             /|\               !
++		//            / | \              !
++		//           /  |  \             !
++		//    tt1   /   |   \ tt0        !
++		//         /    |s   \           !
++		//        /     .     \          !
++		//       /  .      `   \         !
++		//      / .           ` \        !
++		//      ----------------         !
++		//   s0       tt2       s1
++		//-------------------------------
++
++		/*Intermediaries*/
++		Triangle* tt[3];       //the three triangles
++		Icoor2 det3local[3];   //three determinants (integer)
++		int nbzerodet =0;      //number of zeros in det3
++		int izerodet=-1;       //egde containing the vertex s
++		int iedge; 
++
++		/*three vertices of t*/
++		BamgVertex &s0=(*t)[0];
++		BamgVertex &s1=(*t)[1];
++		BamgVertex &s2=(*t)[2];
++
++		//determinant of t
++		Icoor2 detOld=t->det;
++
++		/* infvertexindex = index of the infinite vertex (NULL)
++			if no infinite vertex (NULL) infvertexindex=-1
++			else if v_i is infinite, infvertexindex=i*/
++		int infvertexindex = &s0 ?  ((  &s1 ? ( &s2  ? -1 : 2) : 1  )) : 0;
++
++		//some checks
++		if (( infvertexindex <0 ) && (detOld <0) ||  ( infvertexindex >=0  ) && (detOld >0) ){
++			_error2_("inconsistent configuration (Contact ISSM developers)");
++		}
++
++		// if det3 does not exist, build it 
++		if (!det3){ 
++			//allocate
++			det3 = det3local;
++			//if no infinite vertex
++			if (infvertexindex<0 ) {
++				det3[0]=bamg::det(s ,s1,s2);
++				det3[1]=bamg::det(s0,s ,s2);
++				det3[2]=bamg::det(s0,s1,s );}
++			else { 
++				// one of &s1  &s2  &s0 is NULL
++				det3[0]= &s0 ? -1 : bamg::det(s ,s1,s2) ;
++				det3[1]= &s1 ? -1 : bamg::det(s0,s ,s2) ;
++				det3[2]= &s2 ? -1 : bamg::det(s0,s1,s ) ;
++			}
++		}
++
++		if (!det3[0]) izerodet=0,nbzerodet++;
++		if (!det3[1]) izerodet=1,nbzerodet++;
++		if (!det3[2]) izerodet=2,nbzerodet++;
++
++		//if nbzerodet>0, point s is on an egde or on a vertex 
++		if  (nbzerodet>0){ 
++			/*s is on an edge*/
++			if (nbzerodet==1) {
++				iedge = OppositeEdge[izerodet];
++				AdjacentTriangle ta = t->Adj(iedge);
++
++				/*if the point is one the boundary 
++				  add the point in outside part */
++				if (t->det>=0){ // inside triangle
++					if (((Triangle*)ta)->det<0 ) {
++						// add in outside triangle 
++						AddVertex(s,( Triangle *)ta);
++						return;
++					}
++				}
++			}
++			else{
++				_error2_("Cannot add a vertex more than once. Check duplicates");
++			}
++		}
++
++		// remove de MarkUnSwap edge
++		t->SetUnMarkUnSwap(0);
++		t->SetUnMarkUnSwap(1);
++		t->SetUnMarkUnSwap(2);
++
++		tt[0]= t;
++		tt[1]= &triangles[nbt++];
++		tt[2]= &triangles[nbt++];
++
++		if (nbt>maxnbt) _error2_("Not enough triangles");
++
++		*tt[1]=*tt[2]=*t;
++		tt[0]->link=tt[1];
++		tt[1]->link=tt[2]; 
++
++		(*tt[0])(OppositeVertex[0])=&s;
++		(*tt[1])(OppositeVertex[1])=&s;
++		(*tt[2])(OppositeVertex[2])=&s;
++
++		tt[0]->det=det3[0];
++		tt[1]->det=det3[1];
++		tt[2]->det=det3[2];         
++
++		//  update adj des triangles externe 
++		tt[0]->SetAdjAdj(0);
++		tt[1]->SetAdjAdj(1);
++		tt[2]->SetAdjAdj(2);
++		//  update des adj des 3 triangle interne
++		const int i0 = 0;
++		const int i1= NextEdge[i0];
++		const int i2 = PreviousEdge[i0];
++
++		tt[i0]->SetAdj2(i2,tt[i2],i0);
++		tt[i1]->SetAdj2(i0,tt[i0],i1);
++		tt[i2]->SetAdj2(i1,tt[i1],i2);
++
++		tt[0]->SetSingleVertexToTriangleConnectivity();
++		tt[1]->SetSingleVertexToTriangleConnectivity();
++		tt[2]->SetSingleVertexToTriangleConnectivity();
++
++
++		// swap if the point s is on a edge
++		if(izerodet>=0) {
++			int rswap=tt[izerodet]->swap(iedge);
++
++			if (!rswap) {
++				_error2_("swap the point s is on a edge");
++			}
++		}
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::BoundAnisotropy{{{*/
++	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;
++		double lminaniso = 1/ (Max(hminaniso*hminaniso,1e-100));
++
++		//display info
++		if (verbose > 1)  _printLine_("   BoundAnisotropy by " << anisomax);
++
++		double h1=1.e30,h2=1e-30;
++		double coef = 1./(anisomax*anisomax);
++		double hn1=1.e30,hn2=1e-30,rnx =1.e-30,rx=0;  
++
++		//loop over all vertices
++		for (int i=0;i<nbv;i++){
++			EigenMetric Vp(vertices[i]);
++			double lmax=Vp.lmax();
++			Vp*=Min(lminaniso,lmax)/lmax;
++			Vp.BoundAniso2(coef);
++			vertices[i].m = Vp;
++
++			//info to be displayed
++			if (verbose>2){
++				h1 =Min(h1,Vp.lmin());
++				h2 =Max(h2,Vp.lmax());
++				hn1=Min(hn1,Vp.lmin());
++				hn2=Max(hn2,Vp.lmax());
++				rx =Max(rx,Vp.Aniso2());
++				rnx= Max(rnx,Vp.Aniso2());
++			}
++		}
++
++		//display info
++		if (verbose>2){
++			_printLine_("      input:  Hmin = " << pow(h2,-0.5)  << ", Hmax = " << pow(h1,-0.5) << ", factor of anisotropy max  = " << pow(rx,0.5));
++			_printLine_("      output: Hmin = " << pow(hn2,-0.5) << ", Hmax = " << pow(hn1,-0.5)<< ", factor of anisotropy max  = " <<pow(rnx,0.5));
++		}
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::BuildGeometryFromMesh{{{*/
++	void Mesh::BuildGeometryFromMesh(BamgOpts* bamgopts){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/ConsGeometry)*/
++
++		/*Reconstruct Geometry from Mesh*/
++
++		/*Intermediary*/
++		int i,j,k,kk,it,jt;
++		int    verbose=0;
++		double cutoffradian=10*Pi/180;
++
++		/*Recover options*/
++		if (bamgopts){
++			verbose=bamgopts->verbose;
++			cutoffradian=bamgopts->MaxCornerAngle*Pi/180;
++		}
++
++		//display info
++		if (verbose>1) _printLine_("   construction of the geometry from the 2d mesh");
++
++		//check that the mesh is not empty
++		if (nbt<=0 || nbv <=0 ) {
++			_error2_("nbt or nbv is negative (Mesh empty?)");
++		}
++
++		//Gh is the geometry of the mesh (this), initialize MaxCornerAngle
++		if (cutoffradian>=0) Gh.MaxCornerAngle = cutoffradian;
++
++		/*Construction of the edges*/
++
++		//initialize st and edge4
++		SetOfEdges4* edge4= new SetOfEdges4(nbt*3,nbv);
++		long*        st   = new long[nbt*3];
++
++		//initialize st as -1 (chaining algorithm)
++		for (i=0;i<nbt*3;i++) st[i]=-1;
++
++		//build edge4 (chain)
++		for (i=0;i<nbe;i++){
++			edge4->SortAndAdd(GetId(edges[i][0]),GetId(edges[i][1]));
++		}
++		//check that there is no double edge
++		if (nbe !=  edge4->nb()){ 
++			delete [] st;
++			_error2_("Some Double edge in the mesh, the number is " << nbe << ", nbe4=" << edge4->nb()); 
++		}
++		//keep nbe in nbeold
++		long nbeold = nbe;
++
++		//Go through the triangles and ass the edges in edge4 if they are not there yet
++		for (i=0;i<nbt;i++){
++			//3 edges per triangle
++			for  (j=0;j<3;j++) {
++				//Add Edge to edge4 (k=numberofedges in edge4)
++				long k =edge4->SortAndAdd(GetId(triangles[i][VerticesOfTriangularEdge[j][0]]), GetId(triangles[i][VerticesOfTriangularEdge[j][1]]));
++				long invisible = triangles[i].Hidden(j);
++
++				//if st[k] has not been changed yet, add 3*i+j (= vertex position in the index)
++				if(st[k]==-1) st[k]=3*i+j;
++
++				//else st[k]>=0 -> the edge already exist, check
++				else if(st[k]>=0) {
++					//check that it is not an edge on boundary (should not already exist)
++					if (triangles[i].TriangleAdj(j) || triangles[st[k]/3].TriangleAdj((int) (st[k]%3))){
++						_error2_("problem in Geometry reconstruction: an edge on boundary is duplicated (double element?)");
++					}
++					//OK, the element is not on boundary, is belongs to 2 triangles -> build Adjacent triangles list
++					triangles[i].SetAdj2(j,triangles + st[k] / 3,(int) (st[k]%3));
++					if (invisible)  triangles[i].SetHidden(j);
++					// if k < nbe mark the edge as on Boundary (Locked)
++					if (k<nbe) {
++						triangles[i].SetLocked(j);
++					}
++					//set st[k] as negative so that the edge should not be called again
++					st[k]=-2-st[k]; 
++				}
++				//else (see 3 lines above), the edge has been called more than twice: return error
++				else {
++					_printLine_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << "," << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles (" << k << ")");
++					_printLine_("Edge " << j << " of triangle " << i);
++					_printLine_("Edge " << (-st[k]+2)%3 << " of triangle " << (-st[k]+2)/3);
++					_printLine_("Edge " << triangles[(-st[k]+2)/3].NuEdgeTriangleAdj((int)((-st[k]+2)%3)) << " of triangle " << GetId(triangles[(-st[k]+2)/3].TriangleAdj((int)((-st[k]+2)%3))));
++					_error2_("An edge belongs to more than 2 triangles");
++				}	
++			}
++		}
++
++		//delete edge4
++		long nbedges = edge4->nb(); // the total number of edges 
++		delete edge4; edge4=NULL;
++
++		//display info
++		if(verbose>5) {
++			_printLine_("         info on Mesh:");
++			_printLine_("            - number of vertices    = " << nbv); 
++			_printLine_("            - number of triangles   = " << nbt); 
++			_printLine_("            - number of given edges = " << nbe); 
++			_printLine_("            - number of all edges   = " << nbedges); 
++			_printLine_("            - Euler number 1 - nb of holes = " << nbt-nbedges+nbv); 
++		}
++
++		// check consistency of edge[].adj and geometrical required  vertices
++		k=0; kk=0;
++		for (i=0;i<nbedges;i++){
++			//internal edge
++			if (st[i] <-1) {
++				//get triangle number back
++				it =  (-2-st[i])/3;
++				//get edge position back
++				j  =  (int) ((-2-st[i])%3);
++				Triangle &tt=*triangles[it].TriangleAdj(j);
++				if (triangles[it].color != tt.color|| i < nbeold) k++;
++			}
++			//boundary edge (alone)
++			else if (st[i] >=0) 
++			 kk++;
++		}
++
++		/*Constructions of edges*/
++
++		k += kk;
++		kk=0;
++		if (k) {
++			nbe = k;
++			Edge* edgessave=edges;
++			edges = new Edge[nbe];
++			k =0;
++
++			//display info
++			if(verbose>4) _printLine_("   Construction of the edges " << nbe);
++
++			for (i=0;i<nbedges;i++){ 
++				long  add= -1;
++
++				//internal edge (belongs to two triangles)
++				if (st[i] <-1){ 
++					it =  (-2-st[i])/3;
++					j  =  (int) ((-2-st[i])%3);
++					Triangle & tt = * triangles[it].TriangleAdj(j);
++					if (triangles[it].color !=  tt.color || i < nbeold) add=k++;
++				}
++				//boundary edge
++				else if (st[i] >=0){
++					it = st[i]/3;
++					j  = (int) (st[i]%3);
++					add=k++;
++				}
++				if (add>=0 && add < nbe){
++					edges[add].v[0] = &triangles[it][VerticesOfTriangularEdge[j][0]];
++					edges[add].v[1] = &triangles[it][VerticesOfTriangularEdge[j][1]];
++					edges[add].GeomEdgeHook=NULL; 
++					//if already existed
++					if (i<nbeold){
++						edges[add].ReferenceNumber=edgessave[i].ReferenceNumber; 		      
++						edges[add].GeomEdgeHook=edgessave[i].GeomEdgeHook; //  HACK to get required edges
++						_printLine_("oh no...");
++					}
++					else
++					 edges[add].ReferenceNumber=Min(edges[add].v[0]->GetReferenceNumber(),edges[add].v[1]->GetReferenceNumber());
++				  }
++			}
++
++			//check that we have been through all edges
++			if (k!=nbe){
++				_error2_("problem in edge construction process: k!=nbe (should not happen)");
++			}
++			//delete edgessave
++			if (edgessave) delete [] edgessave;
++		}
++
++		/*Color the vertices*/
++
++		//initialize color of all vertices as 0
++		for (i=0;i<nbv;i++) vertices[i].color =0;
++
++		//go through the edges and add a color to corresponding vertices
++		//(A vertex in 4 edges will have a color 4)
++		for (i=0;i<nbe;i++){
++		 for (j=0;j<2;j++) edges[i].v[j]->color++;
++		}
++
++		//change the color: if a vertex belongs to 2 edges -1, else -2
++		for (i=0;i<nbv;i++) {
++			vertices[i].color=(vertices[i].color ==2)? -1 : -2;
++		}
++
++		/*Build edges[i].adj: adjacency of each edge (if on the same curve)*/
++		for (i=0;i<nbe;i++){
++			for (j=0;j<2;j++){ 
++				//get current vertex
++				BamgVertex* v=edges[i].v[j];
++				//get vertex color (i0)
++				long i0=v->color;
++				long j0;
++
++				//if color<0 (first time), no adjacent edge
++				if(i0<0) edges[i].adj[j]=NULL;
++
++				//if color=-1 (corner),change the vertex color as 2*i+j (position of the vertex in edges)
++				if(i0==-1) v->color=i*2+j;
++
++				//if color>=0 (i and i0 edge are adjacent by the vertex v)
++				else if (i0>=0) {
++					//get position of v in edges back
++					j0 =  i0%2; //column in edges
++					i0 =  i0/2; //line in edges
++
++					//check that we have the correct vertex
++					if (v!=edges[i0 ].v[j0]){
++						_error2_("v!=edges[i0 ].v[j0]: this should not happen as the vertex belongs to this edge");
++					}
++
++					//Add adjacence
++					edges[i ].adj[j ]=edges +i0;
++					edges[i0].adj[j0]=edges +i ;
++
++					//change color to -3
++					v->color = -3;
++				}
++			}
++		}
++
++		/*Reconstruct subdomains info*/
++
++		//check that nbsubdomains is empty
++		if (nbsubdomains){
++			_error2_("nbsubdomains should be 0");
++		}
++		nbsubdomains=0;
++
++		//color the subdomains
++		long* colorT= new long[nbt];
++		Triangle *tt,*t;
++
++		//initialize the color of each triangle as -1
++		for (it=0;it<nbt;it++) colorT[it]=-1;
++
++		//loop over the triangles
++		for (it=0;it<nbt;it++){
++
++			//if the triangle has not been colored yet:
++			if (colorT[it]<0){
++
++				//color = number of subdomains
++				colorT[it]=nbsubdomains;
++
++				//color all the adjacent triangles of T that share a non marked edge
++				int level =1;
++				int kolor=triangles[it].color;
++				st[0]=it; // stack 
++				st[1]=0;
++				k=1;
++				while (level>0){
++					if( (j=st[level]++)<3 ){ 
++						t = &triangles[st[level-1]];
++						tt=t->TriangleAdj((int)j);
++
++						//color the adjacent triangle
++						if ( ! t->Locked(j) && tt && (colorT[jt = GetId(tt)] == -1) && ( tt->color==kolor)) {
++							colorT[jt]=nbsubdomains;
++							st[++level]=jt;
++							st[++level]=0;
++							k++;
++						}
++					}
++					else level-=2;
++				}
++				nbsubdomains++;
++			}
++		}
++		if (verbose> 3) _printLine_("      The Number of sub domain = " << nbsubdomains); 
++
++		//build subdomains
++		long isd;
++		subdomains = new SubDomain[nbsubdomains];
++
++		//initialize subdomains[isd].head as 0
++		for (isd=0;isd<nbsubdomains;isd++) subdomains[isd].head =0;
++		  
++		k=0;
++		for (it=0;it<nbt;it++){
++			for (int j=0;j<3;j++){
++				tt=triangles[it].TriangleAdj(j);
++				if ((!tt || tt->color != triangles[it].color) && !subdomains[isd=colorT[it]].head){
++					subdomains[isd].head = triangles+it;
++					subdomains[isd].ReferenceNumber =  triangles[it].color;
++					subdomains[isd].direction = j; // hack
++					subdomains[isd].edge = 0;
++					k++;
++				}
++			}
++		}
++		//check that we have been through all subdomains
++		if (k!= nbsubdomains){
++			delete [] colorT;
++			_error2_("k!= nbsubdomains");
++		}
++		//delete colorT and st
++		delete [] colorT;
++		delete [] st;
++
++		/*Reconstruct Geometry Gh*/
++
++		//build colorV -1 for all vertex and 0 for the vertices belonging to edges
++		long* colorV = new long[nbv];
++		for (i=0;i<nbv;i++) colorV[i]=-1;
++		for (i=0;i<nbe;i++){
++		 for ( j=0;j<2;j++) colorV[GetId(edges[i][j])]=0;
++		}
++		//number the vertices belonging to edges
++		k=0;
++		for (i=0;i<nbv;i++){
++		 if(!colorV[i]) colorV[i]=k++;
++		}
++
++		//Build Gh
++		Gh.nbv=k;
++		Gh.nbe = nbe;
++		Gh.vertices = new GeomVertex[k];
++		Gh.edges = new GeomEdge[nbe];
++		Gh.nbsubdomains = nbsubdomains;
++		Gh.subdomains = new GeomSubDomain[nbsubdomains];
++		if (verbose>3) _printLine_("   number of vertices = " << Gh.nbv << "\n   number of edges = " << Gh.nbe);
++		NbVerticesOnGeomVertex = Gh.nbv;
++		VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex];
++		NbVerticesOnGeomEdge =0;
++		VerticesOnGeomEdge =0;
++
++		//Build VertexOnGeom
++		for (i=0;i<nbv;i++){
++			if((j=colorV[i])>=0){
++				BamgVertex & v = Gh.vertices[j];
++				v = vertices[i];
++				v.color =0;
++				VerticesOnGeomVertex[j] = VertexOnGeom(vertices[i], Gh.vertices[j]);
++			}
++		}
++
++		//Buid pmin and pmax of Gh (extrema coordinates)
++		Gh.pmin =  Gh.vertices[0].r;
++		Gh.pmax =  Gh.vertices[0].r;
++		// recherche des extrema des vertices pmin,pmax
++		for (i=0;i<Gh.nbv;i++) {
++			Gh.pmin.x = Min(Gh.pmin.x,Gh.vertices[i].r.x);
++			Gh.pmin.y = Min(Gh.pmin.y,Gh.vertices[i].r.y);
++			Gh.pmax.x = Max(Gh.pmax.x,Gh.vertices[i].r.x);
++			Gh.pmax.y = Max(Gh.pmax.y,Gh.vertices[i].r.y);
++		}
++		R2 DD05 = (Gh.pmax-Gh.pmin)*0.05;
++		Gh.pmin -=  DD05;
++		Gh.pmax +=  DD05;
++
++		//Build Gh.coefIcoor
++		Gh.coefIcoor= (MaxICoor)/(Max(Gh.pmax.x-Gh.pmin.x,Gh.pmax.y-Gh.pmin.y));
++		if (Gh.coefIcoor<=0){
++			delete [] colorV;
++			_error2_("Gh.coefIcoor<=0 in infered Geometry (this should not happen)");
++		}
++
++		/*Build Gh.edges*/
++
++		//initialize len as 0
++		double * len = new double[Gh.nbv];
++		for(i=0;i<Gh.nbv;i++) len[i]=0;
++
++		//initialize edge4 again
++		edge4= new SetOfEdges4(nbe,nbv);  
++		double hmin = HUGE_VAL;
++		int kreq=0;
++		for (i=0;i<nbe;i++){
++
++			long i0 = GetId(edges[i][0]);
++			long i1 = GetId(edges[i][1]);
++			long j0 = colorV[i0];
++			long j1 = colorV[i1];
++
++			Gh.edges[i].v[0] = Gh.vertices +  j0;
++			Gh.edges[i].v[1] = Gh.vertices +  j1;
++
++			Gh.edges[i].type = 0;
++
++			Gh.edges[i].tg[0]=R2();
++			Gh.edges[i].tg[1]=R2();
++
++			bool required= edges[i].GeomEdgeHook; 
++			if(required) kreq++;
++			edges[i].GeomEdgeHook =  Gh.edges + i;
++			if(required){
++				Gh.edges[i].v[0]->SetRequired();
++				Gh.edges[i].v[1]->SetRequired();
++				Gh.edges[i].SetRequired();
++			}
++
++			R2 x12 = Gh.vertices[j0].r-Gh.vertices[j1].r;
++			double l12=Norme2(x12);        
++			hmin = Min(hmin,l12);
++
++			Gh.vertices[j1].color++;
++			Gh.vertices[j0].color++;
++
++			len[j0]+= l12;
++			len[j1] += l12;
++			hmin = Min(hmin,l12);
++			Gh.edges[i].ReferenceNumber  = edges[i].ReferenceNumber;
++
++			k = edge4->SortAndAdd(i0,i1);
++			if (k != i){
++				delete [] len;
++				delete [] colorV;
++				_error2_("problem in Edge4 construction: k != i");
++			}
++		}
++
++		//Build metric for all vertices of Gh
++		for (i=0;i<Gh.nbv;i++){
++		 if (Gh.vertices[i].color > 0) 
++		  Gh.vertices[i].m=  Metric(len[i] /(double) Gh.vertices[i].color);
++		 else 
++		  Gh.vertices[i].m=  Metric(hmin);
++		}
++		//delete len
++		delete [] len;
++
++		//Build Gh.subdomains
++		for (i=0;i<nbsubdomains;i++){
++			it = GetId(subdomains[i].head);
++			j = subdomains[i].direction;
++			long i0 = GetId(triangles[it][VerticesOfTriangularEdge[j][0]]);
++			long i1 = GetId(triangles[it][VerticesOfTriangularEdge[j][1]]);
++			k = edge4->SortAndFind(i0,i1);
++			if(k>=0){
++				subdomains[i].direction = (vertices + i0 == edges[k].v[0]) ? 1 : -1;
++				subdomains[i].edge = edges+k;
++				Gh.subdomains[i].edge = Gh.edges + k;
++				Gh.subdomains[i].direction  =  subdomains[i].direction;
++				Gh.subdomains[i].ReferenceNumber =  subdomains[i].ReferenceNumber;
++			}
++			else
++			 _error2_("%i should be >=0");
++		  }
++
++		delete edge4;
++		delete [] colorV;
++
++		//unset adj
++		for (i=0;i<nbt;i++){
++			for ( j=0;j<3;j++){
++				triangles[i].SetAdj2(j,0,triangles[i].GetAllflag(j));
++			}
++		}
++
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::BuildMetric0 (double P2 projection){{{*/
++	void Mesh::BuildMetric0(BamgOpts* bamgopts){
++
++		/*Options*/
++		double* s=NULL;
++		long    nbsol;
++		int     verbose;
++
++		int   i,j,k,iA,iB,iC;
++		int   iv;
++
++		/*Recover options*/
++		verbose=bamgopts->verbose;
++
++		/*Get and process fields*/
++		s=bamgopts->field;
++		nbsol=bamgopts->fieldSize[1];
++
++		/*Check size*/
++		if (bamgopts->fieldSize[0] != nbv) _error2_("'field' should have " << nbv << " rows");
++
++		//initialization of some variables
++		double* ss=(double*)s;
++		double  sA,sB,sC;
++		double*  detT = new double[nbt];
++		double*  sumareas = new double[nbv];
++		double*  alpha= new double[nbt*3];
++		double*  beta = new double[nbt*3];
++		double*  dx_elem    = new double[nbt];
++		double*  dy_elem    = new double[nbt];
++		double*  dx_vertex  = new double[nbv];
++		double*  dy_vertex  = new double[nbv];
++		double*  dxdx_elem  = new double[nbt];
++		double*  dxdy_elem  = new double[nbt];
++		double*  dydy_elem  = new double[nbt];
++		double*  dxdx_vertex= new double[nbv];
++		double*  dxdy_vertex= new double[nbv];
++		double*  dydy_vertex= new double[nbv];
++
++		//display infos
++		if(verbose>1) {
++			_printLine_("   Construction of Metric: number of field: " << nbsol << " (nbt=" << nbt << ", nbv=" << nbv << ")");
++		}
++
++		//first, build the chains that will be used for the Hessian computation, as weel as the area of each element
++		int* head_s=NULL;
++		head_s=xNew<int>(nbv);
++		int* next_p=NULL;
++		next_p=xNew<int>(3*nbt);
++		int  p=0;
++		//initialization
++		for(i=0;i<nbv;i++){
++			sumareas[i]=0;
++			head_s[i]=-1;
++		}
++		for(i=0;i<nbt;i++){
++
++			//lopp over the real triangles (no boundary elements)
++			if(triangles[i].link){ 
++
++				//get current triangle t
++				const Triangle &t=triangles[i];
++
++				// coor of 3 vertices 
++				R2 A=t[0];
++				R2 B=t[1];
++				R2 C=t[2];
++
++				//compute triangle determinant (2*Area)
++				double dett = bamg::Area2(A,B,C);
++				detT[i]=dett;
++
++				/*The nodal functions are such that for a vertex A:
++				 *    N_A(x,y)=alphaA x + beta_A y +gamma_A
++				 *    N_A(A) = 1,   N_A(B) = 0,   N_A(C) = 0
++				 * solving this system of equation (determinant = 2Area(T) != 0 if A,B and C are not inlined)
++				 * leads to:
++				 *    N_A = (xB yC - xC yB + x(yB-yC) +y(xC-xB))/(2*Area(T))
++				 * and this gives:
++				 *    alpha_A = (yB-yC)/(2*Area(T))*/
++				alpha[i*3+0]=(B.y-C.y)/dett;
++				alpha[i*3+1]=(C.y-A.y)/dett;
++				alpha[i*3+2]=(A.y-B.y)/dett;
++				beta[ i*3+0]=(C.x-B.x)/dett;
++				beta[ i*3+1]=(A.x-C.x)/dett;
++				beta[ i*3+2]=(B.x-A.x)/dett;
++
++				//compute chains
++				for(j=0;j<3;j++){
++					k=GetId(triangles[i][j]);
++					next_p[p]=head_s[k];
++					head_s[k]=p++;
++
++					//add area to sumareas
++					sumareas[k]+=dett;
++				}
++
++			}
++		}
++
++		//for all Solutions
++		for (int nusol=0;nusol<nbsol;nusol++) {
++			double smin=ss[nusol],smax=ss[nusol];
++
++			//get min(s), max(s) and initialize Hessian (dxdx,dxdy,dydy)
++			for ( iv=0,k=0; iv<nbv; iv++){
++				smin=Min(smin,ss[iv*nbsol+nusol]);
++				smax=Max(smax,ss[iv*nbsol+nusol]);
++			}
++			double sdelta=smax-smin;
++			double absmax=Max(Abs(smin),Abs(smax));
++
++			//display info
++			if(verbose>2) _printLine_("      Solution " << nusol << ", Min = " << smin << ", Max = " << smax << ", Delta = " << sdelta);
++
++			//skip constant field
++			if (sdelta < 1.0e-10*Max(absmax,1e-20)){
++				_printLine_("      Solution " << nusol << " is constant, skipping...");
++				continue;
++			}
++
++			//initialize the hessian and gradient matrices
++			for ( iv=0,k=0; iv<nbv; iv++) dxdx_vertex[iv]=dxdy_vertex[iv]=dydy_vertex[iv]=dx_vertex[iv]=dy_vertex[iv]=0;
++
++			//1: Compute gradient for each element (exact)
++			for (i=0;i<nbt;i++){
++				if(triangles[i].link){
++					// number of the 3 vertices
++					iA = GetId(triangles[i][0]);
++					iB = GetId(triangles[i][1]);
++					iC = GetId(triangles[i][2]);
++
++					// value of the P1 fonction on 3 vertices 
++					sA = ss[iA*nbsol+nusol];
++					sB = ss[iB*nbsol+nusol];
++					sC = ss[iC*nbsol+nusol];
++
++					//gradient = (sum alpha_i s_i, sum_i beta_i s_i)
++					dx_elem[i]=sA*alpha[3*i+0]+sB*alpha[3*i+1]+sC*alpha[3*i+2];
++					dy_elem[i]=sA*beta[ 3*i+0]+sB*beta[ 3*i+1]+sC*beta[ 3*i+2];
++				}
++			}
++
++			//2: then compute a gradient for each vertex using a P2 projection
++			for(i=0;i<nbv;i++){
++				for(p=head_s[i];p!=-1;p=next_p[p]){
++					//Get triangle number
++					k=(long)(p/3);
++					dx_vertex[i]+=dx_elem[k]*detT[k]/sumareas[i];
++					dy_vertex[i]+=dy_elem[k]*detT[k]/sumareas[i];
++				}
++			}
++
++			//3: compute Hessian matrix on each element
++			for (i=0;i<nbt;i++){
++				if(triangles[i].link){
++					// number of the 3 vertices
++					iA = GetId(triangles[i][0]);
++					iB = GetId(triangles[i][1]);
++					iC = GetId(triangles[i][2]);
++
++					//Hessian
++					dxdx_elem[i]=dx_vertex[iA]*alpha[3*i+0]+dx_vertex[iB]*alpha[3*i+1]+dx_vertex[iC]*alpha[3*i+2];
++					dxdy_elem[i]=dy_vertex[iA]*alpha[3*i+0]+dy_vertex[iB]*alpha[3*i+1]+dy_vertex[iC]*alpha[3*i+2];
++					dydy_elem[i]=dy_vertex[iA]*beta[3*i+0]+dy_vertex[iB]*beta[3*i+1]+dy_vertex[iC]*beta[3*i+2];
++				}
++			}
++
++			//4: finaly compute Hessian on each vertex using the second P2 projection
++			for(i=0;i<nbv;i++){
++				for(p=head_s[i];p!=-1;p=next_p[p]){
++					//Get triangle number
++					k=(long)(p/3);
++					dxdx_vertex[i]+=dxdx_elem[k]*detT[k]/sumareas[i];
++					dxdy_vertex[i]+=dxdy_elem[k]*detT[k]/sumareas[i];
++					dydy_vertex[i]+=dydy_elem[k]*detT[k]/sumareas[i];
++				}
++			}
++
++			/*Compute Metric from Hessian*/
++			for ( iv=0;iv<nbv;iv++){
++				vertices[iv].MetricFromHessian(dxdx_vertex[iv],dxdy_vertex[iv],dydy_vertex[iv],smin,smax,ss[iv*nbsol+nusol],bamgopts->err[nusol],bamgopts);
++			}
++
++		}//for all solutions
++
++		//clean up
++		xDelete<int>(head_s);
++		xDelete<int>(next_p);
++		delete [] detT;
++		delete [] alpha;
++		delete [] beta;
++		delete [] sumareas;
++		delete [] dx_elem;
++		delete [] dy_elem;
++		delete [] dx_vertex;
++		delete [] dy_vertex;
++		delete [] dxdx_elem;
++		delete [] dxdy_elem;
++		delete [] dydy_elem;
++		delete [] dxdx_vertex;
++		delete [] dxdy_vertex;
++		delete [] dydy_vertex;
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::BuildMetric1 (Green formula){{{*/
++	void Mesh::BuildMetric1(BamgOpts* bamgopts){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/IntersectConsMetric)*/
++
++		/*Options*/
++		double* s=NULL;
++		long nbsol;
++		int NbJacobi;
++		int verbose;
++
++		/*Recover options*/
++		verbose=bamgopts->verbose;
++		NbJacobi=bamgopts->nbjacobi;
++
++		/*Get and process fields*/
++		s=bamgopts->field;
++		nbsol=bamgopts->fieldSize[1];
++
++		/*Check size*/
++		if (bamgopts->fieldSize[0] != nbv) _error2_("'field' should have " << nbv << " rows");
++
++		//initialization of some variables
++		long    i,k,iA,iB,iC,iv;
++		R2      O(0,0);
++		double* ss=(double*)s;
++		double  sA,sB,sC;
++		double*  detT = new double[nbt];
++		double*  Mmass= new double[nbv];
++		double*  Mmassxx= new double[nbv];
++		double*  dxdx= new double[nbv];
++		double*  dxdy= new double[nbv];
++		double*  dydy= new double[nbv];
++		double*  workT= new double[nbt];
++		double*  workV= new double[nbv];
++		int*    OnBoundary = new int[nbv];
++
++		//display infos
++		if(verbose>1) {
++			_printLine_("   Construction of Metric: number of field: " << nbsol << " (nbt=" << nbt << ", nbv=" << nbv << ")");
++		}
++
++		//initialize Mmass, OnBoundary and Massxx by zero
++		for (iv=0;iv<nbv;iv++){
++			Mmass[iv]=0;
++			OnBoundary[iv]=0;
++			Mmassxx[iv]=0;
++		}
++
++		//Build detT Mmas Mmassxx workT and OnBoundary
++		for (i=0;i<nbt;i++){ 
++
++			//lopp over the real triangles (no boundary elements)
++			if(triangles[i].link){ 
++
++				//get current triangle t
++				const Triangle &t=triangles[i];
++
++				// coor of 3 vertices 
++				R2 A=t[0];
++				R2 B=t[1];
++				R2 C=t[2];
++
++				// number of the 3 vertices
++				iA = GetId(t[0]);
++				iB = GetId(t[1]);
++				iC = GetId(t[2]);
++
++				//compute triangle determinant (2*Area)
++				double dett = bamg::Area2(A,B,C);
++				detT[i]=dett;
++				dett /= 6;
++
++				// construction of OnBoundary (flag=1 if on boundary, else 0)
++				int nbb=0;
++				for(int j=0;j<3;j++){
++					//get adjacent triangle
++					Triangle *ta=t.Adj(j);
++					//if there is no adjacent triangle, the edge of the triangle t is on boundary
++					if ( !ta || !ta->link){
++						//mark the two vertices of the edge as OnBoundary
++						OnBoundary[GetId(t[VerticesOfTriangularEdge[j][0]])]=1;
++						OnBoundary[GetId(t[VerticesOfTriangularEdge[j][1]])]=1;
++						nbb++;
++					}
++				}
++
++				//number of vertices on boundary for current triangle t
++				workT[i] = nbb;
++
++				//Build Mmass Mmass[i] = Mmass[i] + Area/3
++				Mmass[iA] += dett;
++				Mmass[iB] += dett;
++				Mmass[iC] += dett;
++
++				//Build Massxx = Mmass
++				Mmassxx[iA] += dett;
++				Mmassxx[iB] += dett;
++				Mmassxx[iC] += dett;
++			}
++
++			//else: the triangle is a boundary triangle -> workT=-1
++			else workT[i]=-1;
++		}
++
++		//for all Solution  
++		for (int nusol=0;nusol<nbsol;nusol++) {
++
++			double smin=ss[nusol],smax=ss[nusol];
++			double h1=1.e30,h2=1e-30,rx=0;
++			double hn1=1.e30,hn2=1e-30,rnx =1.e-30;  
++
++			//get min(s), max(s) and initialize Hessian (dxdx,dxdy,dydy)
++			for ( iv=0,k=0; iv<nbv; iv++ ){
++				dxdx[iv]=dxdy[iv]=dydy[iv]=0;
++				smin=Min(smin,ss[iv*nbsol+nusol]);
++				smax=Max(smax,ss[iv*nbsol+nusol]);
++			}
++			double sdelta=smax-smin;
++			double absmax=Max(Abs(smin),Abs(smax));
++
++			//display info
++			if(verbose>2) _printLine_("      Solution " << nusol << ", Min = " << smin << ", Max = " << smax << ", Delta = " << sdelta << ", number of fields = " << nbsol);
++
++			//skip constant field
++			if (sdelta < 1.0e-10*Max(absmax,1e-20) ){
++				if (verbose>2) _printLine_("      Solution " << nusol << " is constant, skipping...");
++				continue;
++			}
++
++			//pointer toward ss that is also a pointer toward s (solutions)
++			double* sf=ss; 
++
++				//initialize the hessian matrix
++				for ( iv=0,k=0; iv<nbv; iv++) dxdx[iv]=dxdy[iv]=dydy[iv]=0;
++
++				//loop over the triangles
++				for (i=0;i<nbt;i++){
++
++					//for real all triangles 
++					if(triangles[i].link){
++
++						// coor of 3 vertices 
++						R2 A=triangles[i][0];
++						R2 B=triangles[i][1];
++						R2 C=triangles[i][2];
++
++						//warning: the normal is internal and the size is the length of the edge
++						R2 nAB = Orthogonal(B-A);
++						R2 nBC = Orthogonal(C-B);
++						R2 nCA = Orthogonal(A-C);
++						//note that :  nAB + nBC + nCA == 0 
++
++						// number of the 3 vertices
++						iA = GetId(triangles[i][0]);
++						iB = GetId(triangles[i][1]);
++						iC = GetId(triangles[i][2]);
++
++						// for the test of  boundary edge
++						// the 3 adj triangles 
++						Triangle *tBC = triangles[i].TriangleAdj(OppositeEdge[0]);
++						Triangle *tCA = triangles[i].TriangleAdj(OppositeEdge[1]);
++						Triangle *tAB = triangles[i].TriangleAdj(OppositeEdge[2]);
++
++						// value of the P1 fonction on 3 vertices 
++						sA = ss[iA*nbsol+nusol];
++						sB = ss[iB*nbsol+nusol];
++						sC = ss[iC*nbsol+nusol];
++
++						/*The nodal functions are such that for a vertex A:
++						  N_A(x,y)=alphaA x + beta_A y +gamma_A
++						  N_A(A) = 1,   N_A(B) = 0,   N_A(C) = 0
++						  solving this system of equation (determinant = 2Area(T) != 0 if A,B and C are not inlined)
++						  leads to:
++						  N_A = (xB yC - xC yB + x(yB-yC) +y(xC-xB))/(2*Area(T))
++						  and this gives:
++						  alpha_A = (yB-yC)/(2*Area(T))
++						  beta_A = (xC-xB)/(2*Area(T))
++						  and therefore:
++						  grad N_A = nA / detT
++						  for an interpolation of a solution s:
++						  grad(s) = s * sum_{i=A,B,C} grad(N_i) */
++
++						R2 Grads=(nAB*sC+nBC*sA+nCA*sB)/detT[i];
++
++						//Use Green to compute Hessian Matrix
++
++						// if edge on boundary no contribution  => normal = 0
++						if ( !tBC || !tBC->link ) nBC=O;
++						if ( !tCA || !tCA->link ) nCA=O;
++						if ( !tAB || !tAB->link ) nAB=O;
++
++						// remark we forgot a 1/2 because
++						//       int_{edge} w_i = 1/2 if i is in edge 
++						//                         0  if not
++						// if we don't take the  boundary 
++						dxdx[iA] += ( nCA.x + nAB.x ) *Grads.x;
++						dxdx[iB] += ( nAB.x + nBC.x ) *Grads.x;
++						dxdx[iC] += ( nBC.x + nCA.x ) *Grads.x;
++
++						//warning optimization (1) the division by 2 is done on the metric construction
++						dxdy[iA] += (( nCA.y + nAB.y ) *Grads.x + ( nCA.x + nAB.x ) *Grads.y) ;
++						dxdy[iB] += (( nAB.y + nBC.y ) *Grads.x + ( nAB.x + nBC.x ) *Grads.y) ;
++						dxdy[iC] += (( nBC.y + nCA.y ) *Grads.x + ( nBC.x + nCA.x ) *Grads.y) ; 
++
++						dydy[iA] += ( nCA.y + nAB.y ) *Grads.y;
++						dydy[iB] += ( nAB.y + nBC.y ) *Grads.y;
++						dydy[iC] += ( nBC.y + nCA.y ) *Grads.y;
++
++					} // for real all triangles 
++				}
++
++				long kk=0;
++				for ( iv=0,k=0 ; iv<nbv; iv++){
++					if(Mmassxx[iv]>0){
++						dxdx[iv] /= 2*Mmassxx[iv];
++						// warning optimization (1) on term dxdy[iv]*ci/2 
++						dxdy[iv] /= 4*Mmassxx[iv];
++						dydy[iv] /= 2*Mmassxx[iv];
++						// Compute the matrix with abs(eigen value)
++						Metric M(dxdx[iv], dxdy[iv], dydy[iv]);
++						EigenMetric Vp(M);
++						Vp.Abs();
++						M = Vp;
++						dxdx[iv] = M.a11;
++						dxdy[iv] = M.a21;
++						dydy[iv] = M.a22;
++					}
++					else kk++;
++				}
++
++				// correction of second derivative
++				// by a laplacien
++				double* d2[3] = {dxdx, dxdy, dydy};
++				double* dd;
++				for (int xy = 0;xy<3;xy++) {
++					dd = d2[xy];
++					// do leat 2 iteration for boundary problem
++					for (int ijacobi=0;ijacobi<Max(NbJacobi,2);ijacobi++){
++						for (i=0;i<nbt;i++) 
++						 if(triangles[i].link){// the real triangles 
++							 // number of the 3 vertices
++							 iA = GetId(triangles[i][0]);
++							 iB = GetId(triangles[i][1]);
++							 iC = GetId(triangles[i][2]);
++							 double cc=3;
++							 if(ijacobi==0)
++							  cc = Max((double) ((Mmassxx[iA]>0)+(Mmassxx[iB]>0)+(Mmassxx[iC]>0)),1.);
++							 workT[i] = (dd[iA]+dd[iB]+dd[iC])/cc;
++						 }
++						for (iv=0;iv<nbv;iv++) workV[iv]=0;
++
++						for (i=0;i<nbt;i++){ 
++							if(triangles[i].link){ // the real triangles 
++								// number of the 3 vertices
++								iA = GetId(triangles[i][0]);
++								iB = GetId(triangles[i][1]);
++								iC = GetId(triangles[i][2]);
++								double cc =  workT[i]*detT[i];
++								workV[iA] += cc;
++								workV[iB] += cc;
++								workV[iC] += cc;
++							}
++						}
++
++						for (iv=0;iv<nbv;iv++){
++							if( ijacobi<NbJacobi || OnBoundary[iv]){
++								dd[iv] = workV[iv]/(Mmass[iv]*6);
++							}
++						}
++					}
++				}
++
++				/*Compute Metric from Hessian*/
++				for ( iv=0;iv<nbv;iv++){
++					vertices[iv].MetricFromHessian(dxdx[iv],dxdy[iv],dydy[iv],smin,smax,ss[iv*nbsol+nusol],bamgopts->err[nusol],bamgopts);
++				}
++
++		}// end for all solution 
++
++		delete [] detT;
++		delete [] Mmass;
++		delete [] dxdx;
++		delete [] dxdy;
++		delete [] dydy;
++		delete []  workT;
++		delete [] workV;
++		delete [] Mmassxx;
++		delete []  OnBoundary;
++
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::CrackMesh{{{*/
++	void Mesh::CrackMesh(BamgOpts* bamgopts) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/CrackMesh)*/
++
++		/*Intermediary*/
++		int i,j,k,num,count;
++		int i1,i2;
++		int j1,j2;
++
++		/*Options*/
++		int verbose=bamgopts->verbose;
++
++		//  computed the number of cracked edge
++		for (k=i=0;i<nbe;i++){
++			if(edges[i].GeomEdgeHook->Cracked()) k++;
++		}
++
++		//Return if no edge is cracked
++		if(k==0) return;
++		if (verbose>4) _printLine_("      number of Cracked Edges = " << k);
++
++		//Initialize Cracked edge
++		NbCrackedEdges=k;
++		CrackedEdges=new CrackedEdge[k];
++
++		//Compute number of Cracked Vertices
++		k=0;
++		NbCrackedVertices=0;
++
++		int* splitvertex=new int[nbv];
++		for (i=0;i<nbv;i++) splitvertex[i]=0;
++
++		for (i=0;i<nbe;i++){
++			if(edges[i].GeomEdgeHook->Cracked()){
++
++				//Fill edges fields of CrackedEdges
++				CrackedEdges[k  ].E =edges[i].GeomEdgeHook;
++				CrackedEdges[k++].e1=&edges[i];
++
++				//Get number of the two vertices on the edge
++				i1=GetId(edges[i][0]);
++				i2=GetId(edges[i][1]);
++				_assert_(i1>=0 && i1<nbv && i2>=0 && i2<nbv);
++				splitvertex[i1]++;
++				splitvertex[i2]++;
++
++				//If the vertex has already been flagged once, it is a cracked vertex (tip otherwise)
++				if (splitvertex[i1]==2) NbCrackedVertices++;
++				if (splitvertex[i2]==2) NbCrackedVertices++;
++
++				//The vertex cannot be marked more than twice
++				if (splitvertex[i1]==3 || splitvertex[i2]==3){
++					delete [] splitvertex;
++					_error2_("Crossing rifts not supported yet");
++				}
++			}
++		}
++		_assert_(k==NbCrackedEdges);
++
++		//Add new vertices
++		if (verbose>4) _printLine_("      number of Cracked Vertices = " << NbCrackedVertices);
++		if (NbCrackedVertices){
++			CrackedVertices=xNew<long>(2*NbCrackedVertices);
++			num=0;
++			for (i=0;i<nbv;i++){
++				if (splitvertex[i]==2){
++					CrackedVertices[num*2+0]=i;      //index of first vertex
++					CrackedVertices[num*2+1]=nbv+num;//index of new vertex
++					num++;
++				}
++			}
++			_assert_(num==NbCrackedVertices);
++		}
++		delete [] splitvertex;
++
++		//Now, find the triangles that hold a cracked edge
++		CreateSingleVertexToTriangleConnectivity();
++
++		long* Edgeflags=new long[NbCrackedEdges];
++		for(i=0;i<NbCrackedEdges;i++) Edgeflags[i]=0;
++
++		for(i=0;i<NbCrackedEdges;i++){
++			//Get the numbers of the 2 vertices of the crren cracked edge
++			i1=GetId((*CrackedEdges[i].e1)[0]);
++			i2=GetId((*CrackedEdges[i].e1)[1]);
++
++			//find a triangle holding the vertex i1 (first vertex of the ith cracked edge)
++			Triangle* tbegin=vertices[i1].t;
++			k=vertices[i1].IndexInTriangle;//local number of i in triangle tbegin
++			_assert_(GetId((*tbegin)[k])==GetId(vertices[i1]));
++
++			//Now, we are going to go through the adjacent triangle that hold i1 till
++			//we find one that has the cracked edge
++			AdjacentTriangle ta(tbegin,EdgesVertexTriangle[k][0]);
++			count=0;
++			do {
++				for(j=0;j<3;j++){
++					//Find the position of i1 in the triangle index
++					if (GetId((*ta.t)[j])==i1){
++						j1=j;
++						break;
++					}
++				}
++				for(j=0;j<3;j++){
++					//Check wether i2 is also in the triangle index
++					if (GetId((*ta.t)[j])==i2){
++						j2=j;
++						//Invert j1 and j2 if necessary
++						if ((j1+1)%3==j2){
++							int j3=j1;
++							j1=j2;
++							j2=j3;
++						}
++						if (Edgeflags[i]==0){
++							//first element
++							CrackedEdges[i].a=ta.t;
++							CrackedEdges[i].length=Norme2((*ta.t)[j1].r-(*ta.t)[j2].r);
++							CrackedEdges[i].normal=Orthogonal((*ta.t)[j1].r-(*ta.t)[j2].r);
++						}
++						else{
++							//Second element -> to renumber
++							CrackedEdges[i].b=ta.t;
++							CrackedEdges[i].length=Norme2((*ta.t)[j1].r-(*ta.t)[j2].r);
++							CrackedEdges[i].normal=Orthogonal((*ta.t)[j1].r-(*ta.t)[j2].r);
++						}
++						Edgeflags[i]++;
++						break;
++					}
++				}
++				//_printLine_(element_renu[GetId(ta.t)] << " -> " << GetId((*ta.t)[0])+1 << " " << GetId((*ta.t)[1])+1 << " " << GetId((*ta.t)[2])+1 << ", edge [" << i1 << "->" << j1 << " " << i2 << "->" << j2 << "]");
++				ta = Next(ta).Adj(); 
++				if (count++>50) _error2_("Maximum number of iteration exceeded");
++			}while ((tbegin != ta)); 
++		}
++
++		//Check EdgeFlag
++		for(i=0;i<NbCrackedEdges;i++){
++			if (Edgeflags[i]!=2){
++				_error2_("A problem occured: at least one crack edge (number " << i+1 << ") does not belong to 2 elements");
++			}
++		}
++		delete [] Edgeflags;
++
++		//Reset BamgVertex to On
++		SetVertexFieldOn();
++
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::Echo{{{*/
++	void Mesh::Echo(void) {
++
++		int i;
++
++		_printLine_("Mesh Echo:");
++		_printLine_("   nbv = " << nbv);
++		_printLine_("   nbt = " << nbt);
++		_printLine_("   nbe = " << nbe);
++		_printLine_("   nbq = " << nbq);
++		_printLine_("   index:");
++		for (i=0;i<nbt;i++){
++			_printLine_("   " << setw(4) << i+1 << ": [" 
++						<< setw(4) << (((BamgVertex *)triangles[i](0))?GetId(triangles[i][0])+1:0) << " " 
++						<< setw(4) << (((BamgVertex *)triangles[i](0))?GetId(triangles[i][1])+1:0) << " " 
++						<< setw(4) << (((BamgVertex *)triangles[i](0))?GetId(triangles[i][2])+1:0) << "]");
++		}
++		_printLine_("   coordinates:");
++		for (i=0;i<nbv;i++){
++			_printLine_("   " << setw(4) << i+1 << ": [" << vertices[i].r.x << " " << vertices[i].r.y << "]");
++		}
++
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::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;
++
++			//display
++			if (verbose > 2) _printLine_("   ForceBoundary  nb of edge: " << nbe);
++
++			//check that there is no triangle with 0 determinant
++			for (int t = 0; t < nbt; t++){
++				if (!triangles[t].det) k++;
++			}
++			if (k!=0) {
++				_error2_("there is " << k << " triangles of mes = 0");
++			}
++
++			//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;
++
++				if (nbswp) nbfe++;
++				if ( nbswp < 0 && k < 5){
++					_error2_("Missing Edge " << i << ", v0=" << GetId(edges[i][0]) << ",v1=" << GetId(edges[i][1]));
++				}
++			}
++
++			if (k!=0) {
++				_error2_("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) _printLine_("      number of inforced edge = " << nbfe << ", number of swap= " << Nbswap); 
++		}
++	/*}}}*/
++	/*FUNCTION Mesh::FindSubDomain{{{*/
++	void Mesh::FindSubDomain(int OutSide) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/FindSubDomain)*/
++
++		long int verbose=0;
++
++		if (verbose >2){
++			if (OutSide) _printLine_("   Find all external sub-domain"); 
++			else _printLine_("   Find all internal sub-domain");
++		  }
++		short * HeapArete = new short[nbt];
++		Triangle  **  HeapTriangle = new Triangle*  [nbt];
++		Triangle *t,*t1;
++		long k,it;
++
++		for (int itt=0;itt<nbt;itt++) 
++		 triangles[itt].link=0; // par defaut pas de couleur
++
++		long  NbSubDomTot =0;
++		for ( it=0;it<nbt;it++)  { 
++			if ( ! triangles[it].link  ) {
++				t = triangles + it;
++				NbSubDomTot++;; // new composante connexe
++				long i = 0; // niveau de la pile 
++				t->link = t ; // sd forme d'un triangle cicular link
++
++				HeapTriangle[i] =t ; 
++				HeapArete[i] = 3;
++
++				while (i >= 0) // boucle sur la pile
++				  { while ( HeapArete[i]--) // boucle sur les 3 aretes 
++					  { 
++						int na =  HeapArete[i];
++						Triangle * tc =  HeapTriangle[i]; // triangle courant
++						if( ! tc->Locked(na)) // arete non frontiere
++						  {
++							Triangle * ta = tc->TriangleAdj(na) ; // næ triangle adjacent
++							if (ta->link == 0 ) // non deja chainer => on enpile
++							  { 
++								i++;
++								ta->link = t->link ;  // on chaine les triangles
++								t->link = ta ;  // d'un meme sous domaine          
++								HeapArete[i] = 3; // pour les 3 triangles adjacents
++								HeapTriangle[i] = ta;
++							  }}
++					  } // deplie fin de boucle sur les 3 adjacences
++					i--;
++				  }          
++			}      
++		}
++
++		// supression de tous les sous domaine infini <=>  contient le sommet NULL
++		it =0;
++		nbtout = 0;
++		while (it<nbt) {
++			if (triangles[it].link) 
++			  { 
++				if (!( triangles[it](0) &&  triangles[it](1) &&  triangles[it](2) )) 
++				  {
++					// infini triangle 
++					NbSubDomTot --;
++					t=&triangles[it];
++					nbtout--;  // on fait un coup de trop. 
++					while  (t){
++						nbtout++;
++						t1=t;
++						t=t->link;
++						t1->link=0;
++					}
++				  }
++			  }   
++			it++;} // end while (it<nbt)
++			if (nbt == nbtout ||  !NbSubDomTot) {
++				delete [] HeapArete;
++				_error2_("The boundary is not close: all triangles are outside");
++			}
++
++			delete [] HeapArete;
++			delete [] HeapTriangle;
++
++
++			if (OutSide|| !Gh.subdomains || !Gh.nbsubdomains ) 
++			  { // No geom sub domain
++				long i;
++				if (subdomains) delete [] subdomains;
++				subdomains = new SubDomain[ NbSubDomTot];
++				nbsubdomains=  NbSubDomTot;
++				for ( i=0;i<nbsubdomains;i++) {
++					subdomains[i].head=NULL;
++					subdomains[i].ReferenceNumber=i+1;
++				}
++				long * mark = new long[nbt];
++				for (it=0;it<nbt;it++)
++				 mark[it]=triangles[it].link ? -1 : -2;
++
++				it =0;
++				k = 0;
++				while (it<nbt) {
++					if (mark[it] == -1) {
++						t1 = & triangles[it];
++						t = t1->link;
++						mark[it]=k;
++						subdomains[k].head = t1;
++						do {
++							mark[GetId(t)]=k;
++							t=t->link;
++						} while (t!=t1);
++						mark[it]=k++;}
++						//    else if(mark[it] == -2 ) triangles[it].Draw(999);
++						it++;} // end white (it<nbt)
++						if (k!=nbsubdomains){
++							delete [] mark;
++							_error2_("k!=nbsubdomains");
++						}
++						if(OutSide) 
++						  {
++							//  to remove all the sub domain by parity adjacents
++							//  because in this case we have only the true boundary edge
++							// so teh boundary is manifold
++							long nbk = nbsubdomains;
++							while (nbk)
++							 for (it=0;it<nbt && nbk ;it++)
++							  for (int na=0;na<3 && nbk ;na++)
++								 {
++								  Triangle *ta = triangles[it].TriangleAdj(na);
++								  long kl = ta ? mark[GetId(ta)] : -2;
++								  long kr = mark[it];
++								  if(kr !=kl) {
++									  if (kl >=0 && subdomains[kl].ReferenceNumber <0 && kr >=0 && subdomains[kr].ReferenceNumber>=0)
++										nbk--,subdomains[kr].ReferenceNumber=subdomains[kl].ReferenceNumber-1;
++									  if (kr >=0 && subdomains[kr].ReferenceNumber <0 && kl >=0 && subdomains[kl].ReferenceNumber>=0)
++										nbk--,subdomains[kl].ReferenceNumber=subdomains[kr].ReferenceNumber-1;
++									  if(kr<0 && kl >=0 && subdomains[kl].ReferenceNumber>=0)
++										nbk--,subdomains[kl].ReferenceNumber=-1;
++									  if(kl<0 && kr >=0 && subdomains[kr].ReferenceNumber>=0)
++										nbk--,subdomains[kr].ReferenceNumber=-1;
++								  }
++								 }
++							long  j=0;
++							for ( i=0;i<nbsubdomains;i++)
++							 if((-subdomains[i].ReferenceNumber) %2) { // good 
++								 if(i != j) 
++								  Exchange(subdomains[i],subdomains[j]);
++								 j++;}
++							 else{ 
++								 t= subdomains[i].head;
++								 while (t){
++									 nbtout++;
++									 t1=t;
++									 t=t->link;
++									 t1->link=0;
++								 }//while (t)
++								}
++							if(verbose>4) _printLine_("      Number of removes subdomains (OutSideMesh) = " << nbsubdomains-j);
++							nbsubdomains=j;
++						  }
++
++						delete []  mark; 
++
++			  }
++			else
++			  { // find the head for all sub domaine
++				if (Gh.nbsubdomains != nbsubdomains && subdomains)
++				 delete [] subdomains, subdomains=0;
++				if (! subdomains  ) 
++				 subdomains = new SubDomain[ Gh.nbsubdomains];
++				nbsubdomains =Gh.nbsubdomains;
++				long err=0;
++				CreateSingleVertexToTriangleConnectivity();
++				long * mark = new long[nbt];
++				Edge **GeomEdgetoEdge = MakeGeomEdgeToEdge();
++
++				for (it=0;it<nbt;it++)
++				 mark[it]=triangles[it].link ? -1 : -2;
++				long inew =0;
++				for (int i=0;i<nbsubdomains;i++) {
++					GeomEdge &eg = *Gh.subdomains[i].edge;
++					subdomains[i].ReferenceNumber = Gh.subdomains[i].ReferenceNumber;
++					int ssdlab = subdomains[i].ReferenceNumber;
++					// by carefull is not easy to find a edge create from a GeomEdge 
++					// see routine MakeGeomEdgeToEdge
++					Edge &e = *GeomEdgetoEdge[Gh.GetId(eg)];
++					_assert_(&e);
++					BamgVertex * v0 =  e(0),*v1 = e(1);
++					Triangle *t  = v0->t;
++					int direction = Gh.subdomains[i].direction;
++					// test if ge and e is in the same direction 
++					if (((eg[0].r-eg[1].r),(e[0].r-e[1].r))<0) direction = -direction ;
++					subdomains[i].direction = direction;
++					subdomains[i].edge = &e;
++					_assert_(t && direction);
++
++					AdjacentTriangle  ta(t,EdgesVertexTriangle[v0->IndexInTriangle][0]);// previous edges
++
++					while (1) {
++						_assert_(v0==ta.EdgeVertex(1));
++						if (ta.EdgeVertex(0) == v1) { // ok we find the edge
++							if (direction>0)  
++							 subdomains[i].head=t=Adj(ta);
++							else 
++							 subdomains[i].head=t=ta;
++							if(t<triangles || t >= triangles+nbt || t->det < 0 || t->link == 0) {
++								_error2_("bad definition of SubSomain " << i);
++							}
++							long it = GetId(t);
++							if (mark[it] >=0) {
++								break;
++							}
++							if(i != inew) 
++							 Exchange(subdomains[i],subdomains[inew]);
++							inew++;
++							Triangle *tt=t;
++							long kkk=0;
++							do 
++							  {
++								kkk++;
++								if (mark[GetId(tt)]>=0){
++									_error2_("mark[GetId(tt)]>=0");
++								}
++								mark[GetId(tt)]=i;
++								tt=tt->link;
++							  } while (tt!=t);
++							break;
++						}
++						ta = Previous(Adj(ta));         
++						if(t == (Triangle *) ta) {
++							_error2_("bad definition of SubSomain " << i);
++						}
++					}
++				}
++
++				if (inew < nbsubdomains) {
++					if (verbose>5) _printLine_("WARNING: " << nbsubdomains-inew << " SubDomains are being removed");
++					nbsubdomains=inew;}
++
++
++					for (it=0;it<nbt;it++)
++					 if ( mark[it] ==-1 ) 
++					  nbtout++,triangles[it].link =0;
++					delete [] GeomEdgetoEdge;
++					delete [] mark;
++
++			  }
++			nbtout=0;
++			for (it=0;it<nbt;it++) 
++			 if(!triangles[it].link)  nbtout++;
++	}
++	/*}}}*/
++	/*FUNCTION 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  { 
++		return t - triangles;
++	}
++	/*}}}*/
++	/*FUNCTION 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  { 
++		return t - vertices;
++	}
++	/*}}}*/
++	/*FUNCTION 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  { 
++		return t - edges;
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::Init{{{*/
++	void Mesh::Init(long maxnbv_in) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/PreInit)*/
++
++		/* initialize random seed: */
++		srand(19999999);
++
++		/*Initialize fields*/
++		NbRef=0;
++		quadtree=NULL;
++		nbv=0;
++		nbt=0;
++		nbe=0;
++		edges=NULL;
++		nbq=0;
++		nbsubdomains=0;
++		subdomains=NULL;
++		maxnbv=maxnbv_in;
++		maxnbt=2 *maxnbv_in-2;
++		NbVertexOnBThVertex=0;
++		VertexOnBThVertex=NULL;
++		NbVertexOnBThEdge=0;
++		VertexOnBThEdge=NULL;
++		NbCrackedVertices=0;
++		CrackedVertices =NULL;
++		NbCrackedEdges =0;
++		CrackedEdges =NULL;
++		NbVerticesOnGeomVertex=0;
++		VerticesOnGeomVertex=NULL;
++		NbVerticesOnGeomEdge=0;
++		VerticesOnGeomEdge=NULL;
++
++		/*Allocate if maxnbv_in>0*/
++		if (maxnbv_in) {
++			vertices=new BamgVertex[maxnbv];
++			_assert_(vertices);
++			orderedvertices=new (BamgVertex* [maxnbv]);
++			_assert_(orderedvertices);
++			triangles=new Triangle[maxnbt];
++			_assert_(triangles);
++		}
++		else {
++			vertices=NULL;
++			orderedvertices=NULL;
++			triangles=NULL;
++			maxnbt=0;
++		} 
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::Insert{{{*/
++	void Mesh::Insert() {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Insert)*/
++
++		/*Insert points in the existing Geometry*/
++
++		//Intermediary
++		int i;
++
++		/*Get options*/
++		long int verbose=2;
++
++		//Display info
++		if (verbose>2) _printLine_("   Insert initial " << nbv << " vertices");
++
++		//Compute integer coordinates for the existing vertices
++		SetIntCoor();
++
++		/*Now we want to build a list (orderedvertices) of the vertices in a random
++		 * order. To do so, we use the following method:
++		 *
++		 * From an initial k0 in [0 nbv[ random (vertex number)
++		 * the next k (vertex number) is computed using a big
++		 * prime number (PN>>nbv) following:
++		 *
++		 * k_{i+1} = k_i + PN  [nbv]
++		 *
++		 * let's show that:
++		 *
++		 *   for all j in [0 nbv[, ∃! i in [0 nbv[ such that k_i=j
++		 *
++		 * Let's assume that there are 2 distinct j1 and j2 such that
++		 * k_j1 = k_j2
++		 *
++		 * This means that
++		 *  
++		 *  k0+j1*PN = k0+j2*PN [nbv]
++		 *  (j1-j2)*PN =0       [nbv]
++		 * since PN is a prime number larger than nbv, and nbv!=1
++		 *  j1-j2=0             [nbv]
++		 * BUT
++		 *  j1 and j2 are in [0 nbv[ which is impossible.
++		 *
++		 *  We hence have built a random list of nbv elements of
++		 *  [0 nbv[ all distincts*/
++
++		//Get Prime number
++		const long PrimeNumber= BigPrimeNumber(nbv);
++		int   k0=rand()%nbv; 
++
++		//Build orderedvertices
++		for (i=0; i<nbv; i++){
++			orderedvertices[i]=&vertices[k0=(k0+PrimeNumber)%nbv];
++		}
++
++		/*Modify orderedvertices such that the first 3 vertices form a triangle*/
++
++		//get first vertex i such that [0,1,i] are not aligned
++		for (i=2; det(orderedvertices[0]->i,orderedvertices[1]->i,orderedvertices[i]->i)==0;){
++			//if i is higher than nbv, it means that all the determinants are 0,
++			//all vertices are aligned!
++			if  (++i>=nbv) _error2_("all the vertices are aligned");
++		}
++		// exchange i et 2 in "orderedvertices" so that
++		// the first 3 vertices are not aligned (real triangle)
++		Exchange(orderedvertices[2], orderedvertices[i]);
++
++		/*Take the first edge formed by the first two vertices and build
++		 * the initial simple mesh from this edge and 2 boundary triangles*/
++
++		BamgVertex *v0=orderedvertices[0], *v1=orderedvertices[1];
++
++		nbt = 2;
++		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;
++
++		//Build adjacence
++		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 triangle: det = -1
++		triangles[1].det = -1;  //boundary triangle: det = -1
++
++		triangles[0].SetSingleVertexToTriangleConnectivity();
++		triangles[1].SetSingleVertexToTriangleConnectivity();
++
++		triangles[0].link=&triangles[1];
++		triangles[1].link=&triangles[0];
++
++		//build quadtree
++		if (!quadtree)  quadtree = new BamgQuadtree(this,0);
++		quadtree->Add(*v0);
++		quadtree->Add(*v1);
++
++		/*Now, add the vertices One by One*/
++		long NbSwap=0;
++		if (verbose>3) _printLine_("   Begining of insertion process...");
++
++		for (int icount=2; icount<nbv; icount++) {
++
++			//Get new vertex
++			BamgVertex *newvertex=orderedvertices[icount];
++
++			//Find the triangle in which newvertex is located
++			Icoor2 det3[3];
++			Triangle* tcvi = TriangleFindFromCoord(newvertex->i,det3); //(newvertex->i = integer coordinates)
++
++			//Add newvertex to the quadtree
++			quadtree->Add(*newvertex); 
++
++			//Add newvertex to the existing mesh
++			AddVertex(*newvertex,tcvi,det3);
++
++			//Make the mesh Delaunay around newvertex by swaping the edges
++			NbSwap += newvertex->Optim(1,0);
++		}
++
++		//Display info
++		if (verbose>3) {
++			_printLine_("      NbSwap of insertion: " << NbSwap);
++			_printLine_("      NbSwap/nbv:          " << NbSwap/nbv);
++		}
++
++#ifdef NBLOOPOPTIM
++
++		k0 = rand()%nbv ; 
++		for (int is4=0; is4<nbv; is4++) 
++		 orderedvertices[is4]= &vertices[k0 = (k0 + PrimeNumber)% nbv];
++
++		for(int Nbloop=0;Nbloop<NBLOOPOPTIM;Nbloop++){
++			long  NbSwap = 0;
++			for (int is1=0; is1<nbv; is1++) 
++			 NbSwap += orderedvertices[is1]->Optim(0,0);
++			if (verbose>3) {
++				_printLine_("      Optim Loop: " << Nbloop);
++				_printLine_("      NbSwap/nbv:          " << NbSwap/nbv);
++			}
++			if(!NbSwap) break;
++		}
++		CreateSingleVertexToTriangleConnectivity(); 
++		// because we break the TriangleContainingTheVertex
++#endif
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::InsertNewPoints{{{*/
++	long Mesh::InsertNewPoints(long nbvold,long & NbTSwap) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/InsertNewPoints)*/
++
++		long int verbose=0;
++		double seuil= 1.414/2 ;// for two close point 
++		long i;
++		long NbSwap=0;
++		Icoor2 det3[3];
++
++		//number of new points
++		const long nbvnew=nbv-nbvold;
++
++		//display info if required
++		if (verbose>5) _printLine_("      Try to Insert " << nbvnew << " new points");
++
++		//return if no new points
++		if (!nbvnew) return 0; 
++
++		/*construction of a random order*/
++		const long PrimeNumber= BigPrimeNumber(nbv)  ;
++		//remainder of the division of rand() by nbvnew
++		long k3 = rand()%nbvnew;
++		//loop over the new points
++		for (int is3=0; is3<nbvnew; is3++){
++			register long j=nbvold +(k3 = (k3+PrimeNumber)%nbvnew);
++			register long i=nbvold+is3; 
++			orderedvertices[i]= vertices + j;
++			orderedvertices[i]->ReferenceNumber=i;
++		}
++
++		// for all the new point
++		long iv=nbvold;
++		for (i=nbvold;i<nbv;i++){
++			BamgVertex &vi=*orderedvertices[i];
++			vi.i=R2ToI2(vi.r);
++			vi.r=I2ToR2(vi.i);
++			double hx,hy;
++			vi.m.Box(hx,hy);
++			Icoor1 hi=(Icoor1) (hx*coefIcoor),hj=(Icoor1) (hy*coefIcoor);
++			if (!quadtree->ToClose(vi,seuil,hi,hj)){
++				// a good new point 
++				BamgVertex &vj = vertices[iv];
++				long  j=vj.ReferenceNumber; 
++				if (&vj!=orderedvertices[j]){
++					_error2_("&vj!= orderedvertices[j]");
++				}
++				if(i!=j){ 
++					Exchange(vi,vj);
++					Exchange(orderedvertices[j],orderedvertices[i]);
++				}
++				vj.ReferenceNumber=0; 
++				Triangle *tcvj=TriangleFindFromCoord(vj.i,det3);
++				if (tcvj && !tcvj->link){
++					tcvj->Echo();
++					_error2_("problem inserting point in InsertNewPoints (tcvj=" << tcvj << " and tcvj->link=" << tcvj->link << ")");
++				}
++				quadtree->Add(vj);
++				AddVertex(vj,tcvj,det3);
++				NbSwap += vj.Optim(1);          
++				iv++;
++			}
++		} 
++		if (verbose>3) {
++			_printLine_("         number of new points: " << iv);
++			_printLine_("         number of to close (?) points: " << nbv-iv);
++			_printLine_("         number of swap after: " << NbSwap);
++		}
++		nbv = iv;
++
++		for (i=nbvold;i<nbv;i++) NbSwap += vertices[i].Optim(1);  
++		if (verbose>3) _printLine_("   NbSwap=" << NbSwap);
++
++		NbTSwap +=  NbSwap ;
++		return nbv-nbvold;
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::isCracked{{{*/
++	int Mesh::isCracked() const {
++		return NbCrackedVertices != 0;
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::MakeGeomEdgeToEdge{{{*/
++	Edge** Mesh::MakeGeomEdgeToEdge() {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeGeomEdgeToEdge)*/
++
++		if (!Gh.nbe){
++			_error2_("!Gh.nbe");
++		}
++		Edge **e= new (Edge* [Gh.nbe]);
++
++		long i;
++		for ( i=0;i<Gh.nbe ; i++)
++		 e[i]=NULL;
++		for ( i=0;i<nbe ; i++) 
++		  { 
++			Edge * ei = edges+i;
++			GeomEdge *GeomEdgeHook = ei->GeomEdgeHook; 
++			e[Gh.GetId(GeomEdgeHook)] = ei;    
++		  }
++		for ( i=0;i<nbe ; i++) 
++		 for (int ii=0;ii<2;ii++) { 
++			 Edge * ei = edges+i;
++			 GeomEdge *GeomEdgeHook = ei->GeomEdgeHook;
++			 int j= ii;
++			 while (!(*GeomEdgeHook)[j].Required()) { 
++				 Adj(GeomEdgeHook,j); // next geom edge
++				 j=1-j;
++				 if (e[Gh.GetId(GeomEdgeHook)])  break; // optimisation
++				 e[Gh.GetId(GeomEdgeHook)] = ei; 
++			 }
++		 }
++
++		int kk=0;
++		for ( i=0;i<Gh.nbe ; i++){
++			if (!e[i]){
++				kk++;
++				if(kk<10) _printLine_("BUG: the geometrical edge " << i << " is on no edge curve");
++			}
++		}
++		if(kk) _error2_("See above");
++
++		return e;
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::MakeQuadrangles{{{*/
++	void Mesh::MakeQuadrangles(double costheta){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeQuadrangles)*/
++
++		long int verbose=0;
++
++		if (verbose>2) _printLine_("MakeQuadrangles costheta = " << costheta);
++
++		if (costheta >1) {
++			if (verbose>5) _printLine_("   do nothing: costheta > 1");
++		}
++
++
++			long nbqq = (nbt*3)/2;
++			DoubleAndInt *qq = new DoubleAndInt[nbqq];
++
++			long i,ij;
++			int j;
++			long k=0;
++			for (i=0;i<nbt;i++)
++			 for (j=0;j<3;j++)
++			  if ((qq[k].q=triangles[i].QualityQuad(j))>=costheta)
++				qq[k++].i3j=i*3+j;
++			//  sort  qq
++			HeapSort(qq,k);
++
++			long kk=0;
++			for (ij=0;ij<k;ij++) { 
++				i=qq[ij].i3j/3;
++				j=(int) (qq[ij].i3j%3);
++				// optisamition no float computation  
++				if (triangles[i].QualityQuad(j,0) >=costheta) 
++				 triangles[i].SetHidden(j),kk++;
++			  }
++			nbq = kk;
++			if (verbose>2){
++				_printLine_("   number of quadrilaterals    = " << nbq);
++				_printLine_("   number of triangles         = " << nbt-nbtout- nbq*2);
++				_printLine_("   number of outside triangles = " << nbtout);
++			}
++			delete [] qq;
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::MakeBamgQuadtree{{{*/
++	void Mesh::MakeBamgQuadtree() {  
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeBamgQuadtree)*/
++
++		long int verbose=0;
++		if (  !quadtree )  quadtree = new BamgQuadtree(this);
++
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::MaxinalHmax{{{*/
++	double Mesh::MaximalHmax() {
++		return Max(pmax.x-pmin.x,pmax.y-pmin.y);
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::MaxSubDivision{{{*/
++	void  Mesh::MaxSubDivision(double maxsubdiv) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/MaxSubDivision)*/
++
++		long int verbose=0;
++
++		const  double maxsubdiv2 = maxsubdiv*maxsubdiv;
++		if(verbose>1) _printLine_("   Limit the subdivision of a edges in the new mesh by " << maxsubdiv);
++		// for all the edges 
++		// if the len of the edge is to long 
++		long it,nbchange=0;    
++		double lmax=0;
++		for (it=0;it<nbt;it++){
++			Triangle &t=triangles[it];
++			for (int j=0;j<3;j++){
++				Triangle &tt = *t.TriangleAdj(j);
++				if ( ! &tt ||  it < GetId(tt) && ( tt.link || t.link)){
++					BamgVertex &v0 = t[VerticesOfTriangularEdge[j][0]];
++					BamgVertex &v1 = t[VerticesOfTriangularEdge[j][1]];
++					R2 AB= (R2) v1-(R2) v0;
++					Metric M = v0;
++					double l = M(AB,AB);
++					lmax = Max(lmax,l);
++					if(l> maxsubdiv2){
++					  R2 AC = M.Orthogonal(AB);// the ortogonal vector of AB in M
++						double lc = M(AC,AC);
++						D2xD2 Rt(AB,AC);// Rt.x = AB , Rt.y = AC;
++						D2xD2 Rt1(Rt.inv());
++						D2xD2 D(maxsubdiv2,0,0,lc);
++						D2xD2 MM = Rt1*D*Rt1.t();
++						v0.m =  M = Metric(MM.x.x,MM.y.x,MM.y.y);
++						nbchange++;
++					}
++					M = v1;
++					l = M(AB,AB);
++					lmax = Max(lmax,l);
++					if(l> maxsubdiv2){
++					  R2 AC = M.Orthogonal(AB);// the ortogonal vector of AB in M
++						double lc = M(AC,AC);
++						D2xD2 Rt(AB,AC);// Rt.x = AB , Rt.y = AC;
++						D2xD2 Rt1(Rt.inv());
++						D2xD2 D(maxsubdiv2,0,0,lc);
++						D2xD2  MM = Rt1*D*Rt1.t();
++						v1.m =  M = Metric(MM.x.x,MM.y.x,MM.y.y);
++						nbchange++;
++					}
++				}
++			}
++		}
++		if(verbose>3){
++			_printLine_("      number of metric changes = " << nbchange << ", maximum number of subdivision of a edges before change = " << pow(lmax,0.5));
++		}
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::MetricAt{{{*/
++	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);
++		Icoor2 deta[3];
++		Triangle * t =TriangleFindFromCoord(a,deta);
++		if (t->det <0) { // outside
++			double ba,bb;
++			AdjacentTriangle edge= CloseBoundaryEdge(a,t,ba,bb) ;
++			return Metric(ba,*edge.EdgeVertex(0),bb,*edge.EdgeVertex(1));}
++		else { // inside
++			double   aa[3];
++			double s = deta[0]+deta[1]+deta[2];
++			aa[0]=deta[0]/s;
++			aa[1]=deta[1]/s;
++			aa[2]=deta[2]/s;
++			return Metric(aa,(*t)[0],(*t)[1],(*t)[2]);
++		}
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::MininalHmin{{{*/
++	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){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/NewPoints)*/
++
++		int i,j,k;
++		long NbTSwap=0;
++		long nbtold=nbt;
++		long nbvold=nbv;
++		long Headt=0;
++		long next_t;
++		long* first_np_or_next_t=new long[maxnbt];
++		Triangle* t=NULL;
++
++		/*Recover options*/
++		int verbose=bamgopts->verbose;
++
++		/*First, insert old points if requested*/
++		if (KeepVertices && (&Bh != this) && (nbv+Bh.nbv< maxnbv)){
++			if (verbose>5) _printLine_("         Inserting initial mesh points");
++			for (i=0;i<Bh.nbv;i++){ 
++				BamgVertex &bv=Bh[i];
++				if (!bv.GeomEdgeHook){
++					vertices[nbv].r   = bv.r;
++					vertices[nbv++].m = bv.m;
++				}
++			}
++			Bh.CreateSingleVertexToTriangleConnectivity();     
++			InsertNewPoints(nbvold,NbTSwap)   ;            
++		}  
++		else Bh.CreateSingleVertexToTriangleConnectivity();     
++
++		// generation of the list of next Triangle 
++		for(i=0;i<nbt;i++) first_np_or_next_t[i]=-(i+1);
++		// the next traingle of i is -first_np_or_next_t[i]
++
++		// Big loop (most time consuming)
++		int iter=0;
++		if (verbose>5) _printLine_("         Big loop");
++		do {
++			/*Update variables*/
++			iter++;
++			nbtold=nbt;
++			nbvold=nbv;
++
++			/*We test all triangles*/
++			i=Headt;
++			next_t=-first_np_or_next_t[i];
++			for(t=&triangles[i];i<nbt;t=&triangles[i=next_t],next_t=-first_np_or_next_t[i]){
++
++				//check i
++				if (i<0 || i>=nbt ){
++					_error2_("Index problem in NewPoints (i=" << i << " not in [0 " << nbt-1 << "])");
++				}
++				//change first_np_or_next_t[i]
++				first_np_or_next_t[i] = iter; 
++
++				//Loop over the edges of t
++				for(j=0;j<3;j++){
++					AdjacentTriangle tj(t,j);
++					BamgVertex &vA = *tj.EdgeVertex(0);
++					BamgVertex &vB = *tj.EdgeVertex(1);
++
++					//if t is a boundary triangle, or tj locked, continue
++					if (!t->link)     continue;
++					if (t->det <0)    continue;
++					if (t->Locked(j)) continue;
++
++					AdjacentTriangle tadjj = t->Adj(j);	  
++					Triangle* ta=tadjj;
++
++					//if the adjacent triangle is a boundary triangle, continur
++					if (ta->det<0) continue;	  
++
++					R2 A=vA;
++					R2 B=vB;
++					k=GetId(ta);
++
++					//if this edge has already been done, go to next edge of triangle
++					if(first_np_or_next_t[k]==iter) continue;
++
++					lIntTria.SplitEdge(Bh,A,B);
++					lIntTria.NewPoints(vertices,nbv,maxnbv);
++				  } // end loop for each edge 
++			  }// for triangle   
++
++			if (!InsertNewPoints(nbvold,NbTSwap)) break;
++			for (i=nbtold;i<nbt;i++) first_np_or_next_t[i]=iter;
++			Headt = nbt; // empty list 
++
++			// for all the triangle containing the vertex i
++			for (i=nbvold;i<nbv;i++){ 
++				BamgVertex*          s  = vertices + i;
++				AdjacentTriangle ta(s->t, EdgesVertexTriangle[s->IndexInTriangle][1]);
++				Triangle*        tbegin= (Triangle*) ta;
++				long kt;
++				do { 
++					kt = GetId((Triangle*) ta);
++					if (first_np_or_next_t[kt]>0){
++						first_np_or_next_t[kt]=-Headt;
++						Headt=kt;
++					}
++					if (ta.EdgeVertex(0)!=s){
++						_error2_("ta.EdgeVertex(0)!=s");
++					}
++					ta = Next(Adj(ta));
++				} while ( (tbegin != (Triangle*) ta)); 
++			}
++
++		} while (nbv!=nbvold);
++
++		delete []  first_np_or_next_t;
++
++		long NbSwapf =0,NbSwp;
++
++		NbSwp = NbSwapf;
++		for (i=0;i<nbv;i++)
++		 NbSwapf += vertices[i].Optim(0);
++		NbTSwap +=  NbSwapf ;
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::ProjectOnCurve{{{*/
++	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)*/
++
++		void *pA=0,*pB=0;
++		double tA=0,tB=0;
++		R2 A=vA,B=vB;
++		BamgVertex * pvA=&vA, * pvB=&vB;
++		if (vA.IndexInTriangle == IsVertexOnVertex){
++			pA=vA.BackgroundVertexHook;
++		}
++		else if (vA.IndexInTriangle == IsVertexOnEdge){
++			pA=vA.BackgroundEdgeHook->be;
++			tA=vA.BackgroundEdgeHook->abcisse;
++		}
++		else {
++			_error2_("ProjectOnCurve On BamgVertex " << BTh.GetId(vA) << " forget call to SetVertexFieldOnBTh");
++		} 
++
++		if (vB.IndexInTriangle == IsVertexOnVertex){
++			pB=vB.BackgroundVertexHook;
++		}
++		else if(vB.IndexInTriangle == IsVertexOnEdge){
++			pB=vB.BackgroundEdgeHook->be;
++			tB=vB.BackgroundEdgeHook->abcisse;
++		}
++		else {
++			_error2_("ProjectOnCurve On BamgVertex " << BTh.GetId(vB) << " forget call to SetVertexFieldOnBTh");
++		} 
++		Edge * e = &BhAB;
++		if (!pA || !pB || !e){
++			_error2_("!pA || !pB || !e");
++		}
++		// be carefull the back ground edge e is on same geom edge 
++		// of the initiale edge def by the 2 vertex A B;
++		//check Is a background Mesh;   
++		if (e<BTh.edges || e>=BTh.edges+BTh.nbe){
++			_error2_("e<BTh.edges || e>=BTh.edges+BTh.nbe");
++		}
++		// walk on BTh edge 
++		//not finish ProjectOnCurve with BackGround Mesh);
++		// 1 first find a back ground edge contening the vertex A
++		// 2 walk n back gound boundary to find the final vertex B
++
++		if( vA.IndexInTriangle == IsVertexOnEdge) 
++		  { // find the start edge 
++			e = vA.BackgroundEdgeHook->be;	 
++
++		  } 
++		else if (vB.IndexInTriangle == IsVertexOnEdge) 
++		  {
++			theta = 1-theta;
++			Exchange(tA,tB);
++			Exchange(pA,pB);
++			Exchange(pvA,pvB);
++			Exchange(A,B);
++			e =  vB.BackgroundEdgeHook->be;
++
++		  } 
++		else{ // do the search by walking 
++			_error2_("case not supported yet");
++		  }
++
++		// find the direction of walking with direction of edge and pA,PB;
++		R2 AB=B-A;
++
++		double cosE01AB = (( (R2) (*e)[1] - (R2) (*e)[0] ) , AB);
++		int kkk=0;
++		int direction = (cosE01AB>0) ? 1 : 0;
++
++		//   double l=0; // length of the edge AB
++		double abscisse = -1;
++
++		for (int step=0;step<2;step++){
++			// 2 times algo:
++			//    1 for computing the length l
++			//    2 for find the vertex 
++			int  iii;
++			BamgVertex  *v0=pvA,*v1; 
++			Edge *neee,*eee;
++			double lg =0; // length of the curve 
++			double te0;
++			// we suppose take the curve's abcisse 
++			for ( eee=e,iii=direction,te0=tA;
++						eee && ((( void*) eee) != pB) && (( void*) (v1=&((*eee)[iii]))) != pB ;
++						neee = eee->adj[iii],iii = 1-neee->Intersection(*eee),eee = neee,v0=v1,te0=1-iii ) { 
++
++				kkk=kkk+1;
++				_assert_(kkk<100);
++				_assert_(eee);
++				double lg0 = lg;
++				double dp = LengthInterpole(v0->m,v1->m,(R2) *v1 - (R2) *v0);
++				lg += dp;
++				if (step && abscisse <= lg) { // ok we find the geom edge 
++					double sss  =   (abscisse-lg0)/dp;
++					double thetab = te0*(1-sss)+ sss*iii;
++					_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)
++				 tB = iii;
++
++				double lg0 = lg;
++				_assert_(eee);
++				v1 = pvB;
++				double dp = LengthInterpole(v0->m,v1->m,(R2) *v1 - (R2) *v0);
++				lg += dp;	
++				abscisse = lg*theta;
++				if (abscisse <= lg && abscisse >= lg0 ) // small optimisation we know the lenght because end
++				  { // ok we find the geom edge 
++					double sss  =   (abscisse-lg0)/dp;
++					double thetab = te0*(1-sss)+ sss*tB;
++					_assert_(thetab>=0 && thetab<=1);
++					BR = VertexOnEdge(&R,eee,thetab);
++					return  Gh.ProjectOnCurve(*eee,thetab,R,GR);
++				  }
++			  }
++			abscisse = lg*theta;
++
++		  }
++		_error2_("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)*/
++
++	/*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;
++
++	// generation of the integer coordinate
++
++	// find extrema coordinates of vertices pmin,pmax
++	long i;
++	if(verbose>2) _printLine_("      Reconstruct mesh of " << nbv << " vertices"); 
++
++	//initialize orderedvertices
++	_assert_(orderedvertices);
++	for (i=0;i<nbv;i++) orderedvertices[i]=0;
++
++	//Initialize nbsubdomains
++	nbsubdomains =0;
++
++	/* 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){ 
++		_error2_("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 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);
++
++			//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)));
++
++				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]; 
++			}
++
++			//An edge belongs to 2 triangles
++			else {
++				_error2_("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) {
++		_printLine_("         info of Mesh:");
++		_printLine_("            - number of vertices    = " << nbv << " "); 
++		_printLine_("            - number of triangles   = " << nbt << " "); 
++		_printLine_("            - number of given edges = " << nbe << " "); 
++		_printLine_("            - number of all edges   = " << edge4->nb()); 
++		_printLine_("            - Euler number 1 - nb of holes = " << nbt-edge4->nb()+nbv); 
++	}
++
++	//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
++					_printLine_("Lost boundary edges " << i << " : " << edge4->i(i) << " " << edge4->j(i));
++				}
++				else if (k==10){
++					_printLine_("Other lost boundary edges not shown...");
++				}
++			}
++		}
++	}
++	if(k) {
++		_error2_(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];
++	}
++
++	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;
++
++	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) {
++		 _error2_("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];
++
++	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[0].det = -1;  // boundary triangles
++	triangles[1].det = -1;  // boundary triangles
++
++	triangles[0].SetSingleVertexToTriangleConnectivity();
++	triangles[1].SetSingleVertexToTriangleConnectivity();
++
++	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);
++
++	// 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++;
++			}
++		}
++	}
++	if(nbloss) {
++		_error2_("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);
++
++					_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;
++		}
++		else{
++			triangles[i].color= savenbt+ NbTfillHoll++;
++		}
++	}
++	_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++;
++		}
++	}
++	// 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) {
++		_error2_("number of triangles edges alone = " << k);
++	}
++	FindSubDomain();
++
++	delete edge4;
++	delete [] st;
++	for (i=0;i<nbv;i++) quadtree->Add(vertices[i]);
++
++	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()){
++						_printLine_("ReconstructExistingMesh error message: problem with the edge number " << i+1 << ": [" << GetId(edges[i][0])+1 << " " << GetId(edges[i][1])+1 << "]");
++						_printLine_("This edge is on geometrical edge number " << Gh.GetId(edges[i].GeomEdgeHook)+1);
++						if (edges[i][j].GeomEdgeHook->OnGeomVertex())
++						 _printLine_("the vertex number " << GetId(edges[i][j])+1 << " of this edge is a geometric BamgVertex number " << Gh.GetId(edges[i][j].GeomEdgeHook->gv)+1);
++						else if (edges[i][j].GeomEdgeHook->OnGeomEdge())
++						 _printLine_("the vertex number " << GetId(edges[i][j])+1 << " of this edge is a geometric Edge number " << Gh.GetId(edges[i][j].GeomEdgeHook->ge)+1);
++						else
++						 _printLine_("Its pointer is " << edges[i][j].GeomEdgeHook);
++
++						_printLine_("This edge is on geometry and has no adjacent edge (open curve) and one of the tip is not required");
++						_error2_("See above (might be cryptic...)");
++					}
++				}
++			}
++		}
++	}
++}
++/*}}}*/
++	/*FUNCTION Mesh::TrianglesRenumberBySubDomain{{{*/
++	void Mesh::TrianglesRenumberBySubDomain(bool justcompress){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ReNumberingTheTriangleBySubDomain)*/
++
++		long int verbose=0;
++		long *renu= new long[nbt];
++		register Triangle *t0,*t,*te=triangles+nbt;
++		register long k=0,it,i,j;
++
++		for ( it=0;it<nbt;it++) 
++		 renu[it]=-1; // outside triangle 
++		for ( i=0;i<nbsubdomains;i++)
++		  { 
++			t=t0=subdomains[i].head;
++			if (!t0){ // not empty sub domain
++				_error2_("!t0");
++			}
++			do { 
++				long kt = GetId(t);
++				if (kt<0 || kt >= nbt ){
++					_error2_("kt<0 || kt >= nbt");
++				}
++				if (renu[kt]!=-1){
++					_error2_("renu[kt]!=-1");
++				}
++				renu[kt]=k++;
++			}
++			while (t0 != (t=t->link));
++		  }
++		// take is same numbering if possible    
++		if(justcompress)
++		 for ( k=0,it=0;it<nbt;it++) 
++		  if(renu[it] >=0 ) 
++			renu[it]=k++;
++
++		// put the outside triangles at the end
++		for ( it=0;it<nbt;it++){
++			if (renu[it]==-1) renu[it]=k++;
++		}
++		if (k != nbt){
++			_error2_("k != nbt");
++		}
++		// do the change on all the pointeur 
++		for ( it=0;it<nbt;it++)
++		 triangles[it].Renumbering(triangles,te,renu);
++
++		for ( i=0;i<nbsubdomains;i++)
++		 subdomains[i].head=triangles+renu[GetId(subdomains[i].head)];
++
++		// move the Triangles  without a copy of the array 
++		// be carefull not trivial code 
++		for ( it=0;it<nbt;it++) // for all sub cycles of the permutation renu
++		 if (renu[it] >= 0) // a new sub cycle
++			{ 
++			 i=it;
++			 Triangle ti=triangles[i],tj;
++			 while ( (j=renu[i]) >= 0) 
++				{ // i is old, and j is new 
++				 renu[i] = -1; // mark 
++				 tj = triangles[j]; // save new
++				 triangles[j]= ti; // new <- old
++				 i=j;     // next 
++				 ti = tj;
++				}  
++			}
++		delete [] renu;
++
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::VerticesRenumber{{{*/
++	void Mesh::VerticesRenumber(long * renu) {
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ReNumberingVertex)*/
++
++		// warning be carfull because pointer
++		// from on mesh to over mesh 
++		//  --  so do ReNumbering at the beginning
++		BamgVertex * ve = vertices+nbv;
++		long it,ie,i;
++
++		_printLine_("renumbering triangles");
++		for ( it=0;it<nbt;it++) 
++		 triangles[it].Renumbering(vertices,ve,renu);
++
++		_printLine_("renumbering edges");
++		for ( ie=0;ie<nbe;ie++) 
++		 edges[ie].Renumbering(vertices,ve,renu);
++
++		_printLine_("renumbering vertices on geom");
++		for (i=0;i< NbVerticesOnGeomVertex;i++)
++		  {
++			BamgVertex *v = VerticesOnGeomVertex[i].meshvertex;
++			if (v>=vertices && v < ve)
++			 VerticesOnGeomVertex[i].meshvertex=vertices+renu[GetId(v)];
++		  }
++
++		_printLine_("renumbering vertices on edge");
++		for (i=0;i< NbVerticesOnGeomEdge;i++)
++		  {
++			BamgVertex *v =VerticesOnGeomEdge[i].meshvertex;
++			if (v>=vertices && v < ve)
++			 VerticesOnGeomEdge[i].meshvertex=vertices+renu[GetId(v)];
++		  }
++
++		_printLine_("renumbering vertices on Bth vertex");
++		for (i=0;i< NbVertexOnBThVertex;i++)
++		  {
++			BamgVertex *v=VertexOnBThVertex[i].v;
++			if (v>=vertices && v < ve)
++			 VertexOnBThVertex[i].v=vertices+renu[GetId(v)];
++		  }
++
++		for (i=0;i< NbVertexOnBThEdge;i++)
++		  {
++			BamgVertex *v=VertexOnBThEdge[i].v;
++			if (v>=vertices && v < ve)
++			 VertexOnBThEdge[i].v=vertices+renu[GetId(v)];
++		  }
++
++		// move the Vertices without a copy of the array 
++		// be carefull not trivial code 
++		long j;
++		for ( it=0;it<nbv;it++) // for all sub cycles of the permutation renu
++		 if (renu[it] >= 0) // a new sub cycle
++			{ 
++			 i=it;
++			 BamgVertex ti=vertices[i],tj;
++			 while ( (j=renu[i]) >= 0){
++				 // i is old, and j is new 
++				 renu[i] = -1-renu[i]; // mark 
++				 tj = vertices[j];     // save new
++				 vertices[j]= ti;      // new <- old
++				 i=j;     // next 
++				 ti = tj;
++				}  
++			}
++		if (quadtree){
++			delete quadtree;
++			quadtree = new BamgQuadtree(this);
++		}
++
++		for ( it=0;it<nbv;it++) renu[i]= -renu[i]-1;
++	}
++	/*}}}*/
++/*FUNCTION Mesh::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*/
++
++	//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){
++		_error2_("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);    
++	}
++
++	// 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 ){
++
++			/*Compute determinant*/
++			triangles[i].det= det(v0,v1,v2);
++
++			/*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){
++					_printLine_("Area of Triangle " << i+1 << " < 0 (det=" << triangles[i].det << ")");
++				}
++			}
++		}
++
++		//else, set as -1
++		else triangles[i].det=-1;
++	}
++
++	if (number_of_errors) _error2_("Fatal error: some triangles have negative areas, see above");
++}
++/*}}}*/
++/*FUNCTION Mesh::ShowRegulaty{{{*/
++void  Mesh::ShowRegulaty() const {
++	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr>*/
++
++	const  double  sqrt32=sqrt(3.)*0.5; 
++	const double  aireKh=sqrt32*0.5;
++	D2  Beq(1,0),Heq(0.5,sqrt32);
++	D2xD2 Br(D2xD2(Beq,Heq).t());
++	D2xD2 B1r(Br.inv());
++	double gammamn=1e100,hmin=1e100;
++	double gammamx=0,hmax=0;
++	double beta=1e100;
++	double beta0=0;
++	double  alpha2=0;
++	double area=0,Marea=0;
++	// double cf= double(coefIcoor);
++	// double cf2= 6.*cf*cf;
++	int nt=0;
++	for (int it=0;it<nbt;it++)
++	 if ( triangles[it].link){
++		 Triangle &K=triangles[it];
++		 double  area3= Area2((R2) K[0],(R2) K[1],(R2) K[2])/6.;
++		 area+= area3;
++		 D2xD2 B_Kt(K[0],K[1],K[2]);
++		 D2xD2 B_K(B_Kt.t());
++		 D2xD2 B1K = Br*B_K.inv();
++		 D2xD2 BK =  B_K*B1r;
++		 D2xD2 B1B1 = B1K.t()*B1K;
++		 Metric MK(B1B1.x.x,B1B1.x.y,B1B1.y.y);
++		 EigenMetric VMK(MK);
++		 alpha2 = Max(alpha2,Max(VMK.lambda1/VMK.lambda2,VMK.lambda2/VMK.lambda1));
++		 double betaK=0;
++
++		 for (int j=0;j<3;j++)
++			{
++			 double he= Norme2(R2(K[j],K[(j+1)%3]));
++			 hmin=Min(hmin,he);
++			 hmax=Max(hmax,he);
++			 BamgVertex & v=K[j];
++			 D2xD2 M((Metric)v);
++			 betaK += sqrt(M.det());
++
++			 D2xD2 BMB = BK.t()*M*BK;
++			 Metric M1(BMB.x.x,BMB.x.y,BMB.y.y);
++			 EigenMetric VM1(M1);
++			 gammamn=Min3(gammamn,VM1.lambda1,VM1.lambda2);
++			 gammamx=Max3(gammamx,VM1.lambda1,VM1.lambda2);		
++			}
++		 betaK *= area3;//  1/2 (somme sqrt(det))* area(K)
++		 Marea+= betaK;
++		 beta=min(beta,betaK);
++		 beta0=max(beta0,betaK);
++		}   
++	area*=3; 
++	gammamn=sqrt(gammamn);
++	gammamx=sqrt(gammamx);    
++	_printLine_("   Adaptmesh info:");
++	_printLine_("      number of triangles = " << nt);
++	_printLine_("      hmin = " << hmin << ", hmax=" << hmax);
++	_printLine_("      area = " << area << ", M area = " << Marea << ", M area/( |Khat| nt) = " <<  Marea/(aireKh*nt));
++	_printLine_("      infinite-regularity(?): min = " << gammamn << ", max = " << gammamx);
++	_printLine_("      anisomax = " << pow(alpha2,0.5) << ", beta max = " << 1./pow(beta/aireKh,0.5) << ", min = " << 1./pow(beta0/aireKh,0.5));
++}
++/*}}}*/
++/*FUNCTION Mesh::ShowHistogram{{{*/
++void  Mesh::ShowHistogram() const {
++	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ShowHistogram)*/
++
++	const long kmax=10;
++	const double llmin = 0.5,llmax=2;
++	const double lmin=log(llmin),lmax=log(llmax),delta= kmax/(lmax-lmin);
++	long histo[kmax+1];
++	long i,it,k, nbedges =0;
++	for (i=0;i<=kmax;i++) histo[i]=0;
++	for (it=0;it<nbt;it++)
++	 if ( triangles[it].link) 
++		{
++
++		 for (int j=0;j<3;j++)
++			{
++			 Triangle *ta = triangles[it].TriangleAdj(j);
++			 if ( !ta || !ta->link || GetId(ta) >= it) 
++				{ 
++				 BamgVertex & vP = triangles[it][VerticesOfTriangularEdge[j][0]];
++				 BamgVertex & vQ = triangles[it][VerticesOfTriangularEdge[j][1]];
++				 if ( !& vP || !&vQ) continue;
++				 R2 PQ = vQ.r - vP.r;
++				 double l = log(LengthInterpole(vP,vQ,PQ));
++				 nbedges++;
++				 k = (int) ((l - lmin)*delta);
++				 k = Min(Max(k,0L),kmax);
++				 histo[k]++;
++				}
++			}
++		}  
++	_printLine_(" --- Histogram of the unit mesh,  nb of edges = " << nbedges);
++	_printLine_("      length of edge in   | %% of edge  | Nb of edges "); 
++	_printLine_("      --------------------+-------------+-------------"); 
++	for   (i=0;i<=kmax;i++){ 
++		if (i==0) _printString_( "      " << setw(10) << 0.);
++		else      _printString_( "      " << setw(10) << exp(lmin+i/delta));
++		if (i==kmax) _printString_("          +inf   ");
++		else      _printString_( "      " << setw(10) << exp(lmin+(i+1)/delta));
++		_printLine_("|  " << setw(10) << (long((10000. * histo[i])/ nbedges)/100.) << " |");
++		_printLine_("  " << histo[i]);
++	}
++	_printLine_("      --------------------+-------------+-------------"); 
++}
++/*}}}*/
++/*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) _printLine_("   SmoothingVertex: nb Iteration = " << nbiter << ", Omega=" << omega);
++	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) _printLine_("      move max = " << pow(delta,0.5) << ", iteration = " << k << ", nb of swap = " << NbSwap);
++	  }
++
++	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)*/
++
++	long int verbose=0;
++
++	if(raisonmax<1.1) return;
++	if(verbose > 1) _printLine_("   Mesh::SmoothMetric raisonmax = " << raisonmax);
++	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
++			register Triangle* t= vertices[i].t;
++			if (!t){
++				_error2_("!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)){
++					_error2_("vertices+i != ta.EdgeVertex(1)");
++				}
++				BamgVertex & vj = *(ta.EdgeVertex(0));
++				if ( &vj ) {
++					j= &vj-vertices;
++					if (j<0 || j >= nbv){
++						_error2_("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 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;
++			}
++		}
++		Head0 = Head1;
++		Head1 = -1;
++		Exchange(first_np_or_next_t0,first_np_or_next_t1);
++	}
++	if(verbose>2) _printLine_("      number of iterations = " << kch); 
++	delete [] first_np_or_next_t0;
++	delete [] first_np_or_next_t1;
++}
++/*}}}*/
++	/*FUNCTION Mesh::SplitElement{{{*/
++	int  Mesh::SplitElement(int choice){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshQuad.cpp/SplitElement)*/
++
++		long int verbose=0;
++
++		Direction NoDirOfSearch;
++		const  int withBackground = &BTh != this && &BTh;
++
++		TrianglesRenumberBySubDomain();
++		//int nswap =0;
++		const long nfortria( choice ? 4 : 6);
++		if(withBackground) 
++		  {
++			BTh.SetVertexFieldOn();
++			SetVertexFieldOnBTh();
++		  }
++		else
++		 BTh.SetVertexFieldOn();
++
++		long newnbt=0,newnbv=0;
++		long * kedge = 0;
++		long newnbq=nbq;
++		long * ksplit= 0, * ksplitarray=0;
++		long kkk=0;
++		int ret =0;
++		if (maxnbv<nbv+nbe) return 1;//   
++		// 1) create  the new points by spliting the internal edges 
++		// set the 
++		long nbvold = nbv;
++		long nbtold = nbt;
++		long nbtoutold  = nbtout;
++		long  NbEdgeOnGeom=0;
++		long i;
++
++		nbt = nbt - nbtout; // remove all the  the ouside triangles 
++		long nbtsave = nbt;
++		Triangle * lastT = triangles + nbt;
++		for (i=0;i<nbe;i++)
++		 if(edges[i].GeomEdgeHook) NbEdgeOnGeom++;
++		long newnbe=nbe+nbe;
++		//  long newNbVerticesOnGeomVertex=NbVerticesOnGeomVertex;
++		long newNbVerticesOnGeomEdge=NbVerticesOnGeomEdge+NbEdgeOnGeom;
++		// long newNbVertexOnBThVertex=NbVertexOnBThVertex;
++		long newNbVertexOnBThEdge=withBackground ? NbVertexOnBThEdge+NbEdgeOnGeom:0;
++
++		// do allocation for pointeur to the geometry and background
++		VertexOnGeom * newVerticesOnGeomEdge = new VertexOnGeom[newNbVerticesOnGeomEdge];
++		VertexOnEdge *newVertexOnBThEdge = newNbVertexOnBThEdge ?  new VertexOnEdge[newNbVertexOnBThEdge]:0;
++		if (NbVerticesOnGeomEdge)
++		 memcpy(newVerticesOnGeomEdge,VerticesOnGeomEdge,sizeof(VertexOnGeom)*NbVerticesOnGeomEdge);
++		if (NbVertexOnBThEdge)
++		 memcpy(newVertexOnBThEdge,VertexOnBThEdge,sizeof(VertexOnEdge)*NbVertexOnBThEdge);
++		Edge *newedges = new Edge [newnbe];
++		//  memcpy(newedges,edges,sizeof(Edge)*nbe);
++		SetOfEdges4 * edge4= new SetOfEdges4(nbe,nbv);
++		long k=nbv;
++		long kk=0;
++		long kvb = NbVertexOnBThEdge;
++		long kvg = NbVerticesOnGeomEdge;
++		long ie =0;
++		Edge ** edgesGtoB=0;
++		if (withBackground)
++		 edgesGtoB= BTh.MakeGeomEdgeToEdge();
++		long ferr=0;
++		for (i=0;i<nbe;i++)
++		 newedges[ie].GeomEdgeHook=0;
++
++		for (i=0;i<nbe;i++)
++		  {
++			GeomEdge *ong =  edges[i].GeomEdgeHook;
++
++			newedges[ie]=edges[i];
++			newedges[ie].adj[0]=newedges+(edges[i].adj[0]-edges) ;
++			newedges[ie].adj[1]=newedges + ie +1;
++			R2 A = edges[i][0],B = edges[i][1];
++
++
++			kk += (i == edge4->SortAndAdd(GetId(edges[i][0]),GetId(edges[i][1])));
++			if (ong) // a geometrical edges 
++			  { 
++				if (withBackground){
++					// walk on back ground mesh 
++					//  newVertexOnBThEdge[ibe++] = VertexOnEdge(vertices[k],bedge,absicsseonBedge); 
++					// a faire -- difficile 
++					// the first PB is to now a background edge between the 2 vertices
++					if (!edgesGtoB){
++						_error2_("!edgesGtoB");
++					}
++					ong= ProjectOnCurve(*edgesGtoB[Gh.GetId(edges[i].GeomEdgeHook)],
++								edges[i][0],edges[i][1],0.5,vertices[k],
++								newVertexOnBThEdge[kvb],
++								newVerticesOnGeomEdge[kvg++]);
++					vertices[k].ReferenceNumber= edges[i].ReferenceNumber;
++					vertices[k].DirOfSearch =   NoDirOfSearch;        
++					;
++					// get the Info on background mesh 
++					double s =        newVertexOnBThEdge[kvb];
++					BamgVertex &  bv0  = newVertexOnBThEdge[kvb][0];
++					BamgVertex &  bv1  = newVertexOnBThEdge[kvb][1];
++					// compute the metrix of the new points 
++					vertices[k].m =  Metric(1-s,bv0,s,bv1); 
++					kvb++;
++				  }
++				else 
++				  {
++					ong=Gh.ProjectOnCurve(edges[i],
++								0.5,vertices[k],newVerticesOnGeomEdge[kvg++]);
++					// vertices[k].i = R2ToI2( vertices[k].r);
++					vertices[k].ReferenceNumber = edges[i].ReferenceNumber;
++					vertices[k].DirOfSearch = NoDirOfSearch;
++					vertices[k].m =  Metric(0.5,edges[i][0],0.5,edges[i][1]);	      
++				  }  
++			  }
++			else // straigth line edge ---
++			  { 
++				vertices[k].r = ((R2) edges[i][0] + (R2)  edges[i][1] )*0.5;
++				vertices[k].m =  Metric(0.5,edges[i][0],0.5,edges[i][1]);
++				vertices[k].GeomEdgeHook = 0;
++			  }
++			//vertices[k].i = R2ToI2( vertices[k].r);
++			R2 AB =  vertices[k].r;
++			R2 AA = (A+AB)*0.5;
++			R2 BB = (AB+B)*0.5;
++			vertices[k].ReferenceNumber = edges[i].ReferenceNumber;
++			vertices[k].DirOfSearch = NoDirOfSearch;
++
++			newedges[ie].GeomEdgeHook = Gh.Containing(AA,ong);
++			newedges[ie++].v[1]=vertices+k;
++
++			newedges[ie]=edges[i];
++			newedges[ie].adj[0]=newedges + ie -1;
++			newedges[ie].adj[1]=newedges+(edges[i].adj[1]-edges) ;
++			newedges[ie].GeomEdgeHook =  Gh.Containing(BB,ong);
++			newedges[ie++].v[0]=vertices+k;
++			k++;
++		  }
++		if (edgesGtoB) delete [] edgesGtoB;
++		edgesGtoB=0;
++
++		newnbv=k;
++		newNbVerticesOnGeomEdge=kvg;
++		if (newnbv> maxnbv) goto Error;// bug 
++
++		nbv = k;
++
++
++		kedge = new long[3*nbt+1];
++		ksplitarray = new long[nbt+1];
++		ksplit = ksplitarray +1; // because ksplit[-1] == ksplitarray[0]
++
++		for (i=0;i<3*nbt;i++)
++		 kedge[i]=-1;
++
++		//  
++
++		for (i=0;i<nbt;i++) {
++			Triangle & t = triangles[i];
++			if (!t.link){
++				_error2_("!t.link");
++			}
++			for(int j=0;j<3;j++)
++			  {
++				const AdjacentTriangle ta = t.Adj(j);
++				const Triangle & tt = ta;
++				if (&tt >= lastT)
++				 t.SetAdj2(j,0,0);// unset adj
++				const BamgVertex & v0 = t[VerticesOfTriangularEdge[j][0]];
++				const BamgVertex & v1 = t[VerticesOfTriangularEdge[j][1]];
++				long  ke =edge4->SortAndFind(GetId(v0),GetId(v1));
++				if (ke>0) 
++				  {
++					long ii = GetId(tt);
++					int  jj = ta;
++					long ks = ke + nbvold;
++					kedge[3*i+j] = ks;
++					if (ii<nbt) // good triangle
++					 kedge[3*ii+jj] = ks;
++					BamgVertex &A=vertices[ks];
++					double aa,bb,cc,dd;
++					if ((dd=Area2(v0.r,v1.r,A.r)) >=0){
++						// warning PB roundoff error 
++						if (t.link && ( (aa=Area2( A.r    , t[1].r , t[2].r )) < 0.0 
++										||   (bb=Area2( t[0].r , A.r    , t[2].r )) < 0.0  
++										||   (cc=Area2( t[0].r , t[1].r , A.r    )) < 0.0)){
++							_printLine_(ke + nbvold << " not in triangle " << i << " In= " << !!t.link << " " << aa << " " << bb << " " << cc << " " << dd);
++							_error2_("Number of triangles with P2 interpolation Problem");
++						}
++					}
++					else {
++						if (tt.link && ( (aa=Area2( A.r     , tt[1].r , tt[2].r )) < 0 
++										||   (bb=Area2( tt[0].r , A.r     , tt[2].r )) < 0 
++										||   (cc=Area2( tt[0].r , tt[1].r , A.r     )) < 0)){
++							_printLine_(ke + nbvold << " not in triangle " << ii << " In= " << !!tt.link << " " << aa << " " << bb << " " << cc << " " << dd);
++							_error2_("Number of triangles with P2 interpolation Problem");
++						}
++					} 
++				  }
++			  }
++		}
++
++		for (i=0;i<nbt;i++){
++			ksplit[i]=1; // no split by default
++			const Triangle & t = triangles[ i];
++			int nbsplitedge =0;
++			int nbinvisible =0;
++			int invisibleedge=0;
++			int kkk[3];      
++			for (int j=0;j<3;j++)
++			  {
++				if (t.Hidden(j)) invisibleedge=j,nbinvisible++;
++
++				const AdjacentTriangle ta = t.Adj(j);
++				const Triangle & tt = ta;
++
++
++				const BamgVertex & v0 = t[VerticesOfTriangularEdge[j][0]];
++				const BamgVertex & v1 = t[VerticesOfTriangularEdge[j][1]];
++				if ( kedge[3*i+j] < 0) 
++				  {
++					long  ke =edge4->SortAndFind(GetId(v0),GetId(v1));
++					if (ke<0) // new 
++					  {
++						if (&tt) // internal triangles all the boundary 
++						  { // new internal edges 
++							long ii = GetId(tt);
++							int  jj = ta;
++
++							kedge[3*i+j]=k;// save the vertex number 
++							kedge[3*ii+jj]=k;
++							if (k<maxnbv) 
++							  {
++								vertices[k].r = ((R2) v0+(R2) v1 )/2;
++								//vertices[k].i = R2ToI2( vertices[k].r);
++								vertices[k].ReferenceNumber=0;
++								vertices[k].DirOfSearch =NoDirOfSearch;
++								vertices[k].m =  Metric(0.5,v0,0.5,v1);
++							  }
++							k++;
++							kkk[nbsplitedge++]=j;		      
++						  } // tt 
++						else
++						 _error2_("Bug...");
++					  } // ke<0	       
++					else
++					  { // ke >=0
++						kedge[3*i+j]=nbvold+ke;
++						kkk[nbsplitedge++]=j;// previously splited
++					  }
++				  }
++				else 
++				 kkk[nbsplitedge++]=j;// previously splited
++
++			  } 
++			if (nbinvisible>=2){
++				_error2_("nbinvisible>=2");
++			}
++			switch (nbsplitedge) {
++				case 0: ksplit[i]=10; newnbt++; break;   // nosplit
++				case 1: ksplit[i]=20+kkk[0];newnbt += 2; break; // split in 2 
++				case 2: ksplit[i]=30+3-kkk[0]-kkk[1];newnbt += 3; break; // split in 3 
++				case 3:
++						  if (nbinvisible) ksplit[i]=40+invisibleedge,newnbt += 4;
++						  else   ksplit[i]=10*nfortria,newnbt+=nfortria;
++						  break;
++			} 
++			if (ksplit[i]<40){
++				_error2_("ksplit[i]<40");
++			}
++		  }
++		//  now do the element split
++		newnbq = 4*nbq;
++		nbv = k;
++		kkk = nbt;
++		ksplit[-1] = nbt;
++		// look on  old true  triangles 
++
++		for (i=0;i<nbtsave;i++){
++			int  nbmkadj=0;
++			long mkadj [100];
++			mkadj[0]=i;
++			long kk=ksplit[i]/10;
++			int  ke=(int) (ksplit[i]%10);
++			if (kk>=7 || kk<=0){
++				_error2_("kk>=7 || kk<=0");
++			}
++
++			// def the numbering   k (edge) i vertex 
++			int k0 = ke;
++			int k1 = NextEdge[k0];
++			int k2 = PreviousEdge[k0];
++			int i0 = OppositeVertex[k0];
++			int i1 = OppositeVertex[k1];
++			int i2 = OppositeVertex[k2];
++
++			Triangle &t0=triangles[i];
++			BamgVertex * v0=t0(i0);           
++			BamgVertex * v1=t0(i1);           
++			BamgVertex * v2=t0(i2);
++
++			if (nbmkadj>=10){
++				_error2_("nbmkadj>=10");
++			}
++			// --------------------------
++			AdjacentTriangle ta0(t0.Adj(i0)),ta1(t0.Adj(i1)),ta2(t0.Adj(i2));
++			// save the flag Hidden
++			int hid[]={t0.Hidden(0),t0.Hidden(1),t0.Hidden(2)};
++			// un set all adj -- save Hidden flag --
++			t0.SetAdj2(0,0,hid[0]);
++			t0.SetAdj2(1,0,hid[1]);
++			t0.SetAdj2(2,0,hid[2]);
++			// --  remake 
++			switch  (kk) {
++				case 1: break;// nothing 
++				case 2: // 
++						  {
++							Triangle &t1=triangles[kkk++];
++							t1=t0;
++							if (kedge[3*i+i0]<0){
++								_error2_("kedge[3*i+i0]<0");
++							}
++							BamgVertex * v3 = vertices + kedge[3*i+k0];
++
++							t0(i2) = v3;
++							t1(i1) = v3;
++							t0.SetAllFlag(k2,0);
++							t1.SetAllFlag(k1,0);
++						  } 
++						break; 
++				case 3: //
++						  {
++							Triangle &t1=triangles[kkk++];
++							Triangle &t2=triangles[kkk++];
++							t2=t1=t0;
++							if (kedge[3*i+k1]<0){
++								_error2_("kedge[3*i+k1]<0");
++							}
++							if (kedge[3*i+k2]<0){
++								_error2_("kedge[3*i+k2]<0");
++							}
++
++							BamgVertex * v01 = vertices + kedge[3*i+k2];
++							BamgVertex * v02 = vertices + kedge[3*i+k1]; 
++							t0(i1) = v01; 
++							t0(i2) = v02; 
++							t1(i2) = v02;
++							t1(i0) = v01; 
++							t2(i0) = v02; 
++							t0.SetAllFlag(k0,0);
++							t1.SetAllFlag(k1,0);
++							t1.SetAllFlag(k0,0);
++							t2.SetAllFlag(k2,0);
++						  } 
++						break;
++				case 4: // 
++				case 6: // split in 4 
++						  {
++							Triangle &t1=triangles[kkk++];
++							Triangle &t2=triangles[kkk++];
++							Triangle &t3=triangles[kkk++];
++							t3=t2=t1=t0;
++							if (kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0){
++								_error2_("kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0");
++							}
++							BamgVertex * v12 = vertices + kedge[3*i+k0];
++							BamgVertex * v02 = vertices + kedge[3*i+k1]; 
++							BamgVertex * v01 = vertices + kedge[3*i+k2];
++							t0(i1) = v01;
++							t0(i2) = v02;
++							t0.SetAllFlag(k0,hid[k0]);
++
++							t1(i0) = v01;
++							t1(i2) = v12;
++							t0.SetAllFlag(k1,hid[k1]);
++
++							t2(i0) = v02;
++							t2(i1) = v12;
++							t2.SetAllFlag(k2,hid[k2]);
++
++							t3(i0) = v12;
++							t3(i1) = v02;
++							t3(i2) = v01;
++
++							t3.SetAllFlag(0,hid[0]);	   
++							t3.SetAllFlag(1,hid[1]);	   
++							t3.SetAllFlag(2,hid[2]);
++
++							if ( kk == 6)
++							  {
++
++								Triangle &t4=triangles[kkk++];
++								Triangle &t5=triangles[kkk++];
++
++								t4 = t3;
++								t5 = t3;
++
++								t0.SetHidden(k0);
++								t1.SetHidden(k1);
++								t2.SetHidden(k2);
++								t3.SetHidden(0);
++								t4.SetHidden(1);
++								t5.SetHidden(2);
++
++								if (nbv < maxnbv ) 
++								  {
++									vertices[nbv].r = ((R2) *v01 + (R2) *v12  + (R2) *v02 ) / 3.0;
++									vertices[nbv].ReferenceNumber =0;
++									vertices[nbv].DirOfSearch =NoDirOfSearch;
++									//vertices[nbv].i = R2ToI2(vertices[nbv].r);
++									double a3[]={1./3.,1./3.,1./3.};
++									vertices[nbv].m = Metric(a3,v0->m,v1->m,v2->m);
++									BamgVertex * vc =  vertices +nbv++;
++									t3(i0) = vc;
++									t4(i1) = vc;
++									t5(i2) = vc;
++
++								  }
++								else
++								 goto Error; 
++							  }
++
++						  } 
++						break;         
++			}
++
++			// save all the new triangles
++			mkadj[nbmkadj++]=i;
++			long jj;
++			if (t0.link) 
++			 for (jj=nbt;jj<kkk;jj++)
++				{
++				 triangles[jj].link=t0.link;
++				 t0.link= triangles+jj;
++				 mkadj[nbmkadj++]=jj;
++				}
++			if (nbmkadj>13){// 13 = 6 + 4 +
++				_error2_("nbmkadj>13");
++			}
++
++			if (kk==6)  newnbq+=3;
++			for (jj=ksplit[i-1];jj<kkk;jj++) nbt = kkk;
++			ksplit[i]= nbt; // save last adresse of the new triangles
++			kkk = nbt;
++		  }
++
++		for (i=0;i<nbv;i++) vertices[i].m = vertices[i].m*2.;
++
++		if(withBackground)
++		 for (i=0;i<BTh.nbv;i++)
++		  BTh.vertices[i].m =  BTh.vertices[i].m*2.;
++
++
++		ret = 2;
++		if (nbt>= maxnbt) goto Error; // bug 
++		if (nbv>= maxnbv) goto Error; // bug 
++		// generation of the new triangles 
++
++		SetIntCoor("In SplitElement"); 
++
++		CreateSingleVertexToTriangleConnectivity();
++		if(withBackground)
++		 BTh.CreateSingleVertexToTriangleConnectivity();
++
++		delete [] edges;
++		edges = newedges;
++		nbe = newnbe;
++		nbq = newnbq;
++
++		for (i=0;i<nbsubdomains;i++)
++		  { 
++			long k = subdomains[i].edge- edges;
++			subdomains[i].edge =  edges+2*k; // spilt all edge in 2 
++		  }
++
++		if (ksplitarray) delete [] ksplitarray;
++		if (kedge) delete [] kedge;
++		if (edge4) delete edge4;
++		if (VerticesOnGeomEdge) delete [] VerticesOnGeomEdge;
++		VerticesOnGeomEdge= newVerticesOnGeomEdge;
++		if(VertexOnBThEdge) delete []  VertexOnBThEdge;
++		VertexOnBThEdge = newVertexOnBThEdge;
++		NbVerticesOnGeomEdge = newNbVerticesOnGeomEdge;
++		NbVertexOnBThEdge=newNbVertexOnBThEdge;
++		//  CreateSingleVertexToTriangleConnectivity();
++
++		ReconstructExistingMesh();
++
++		if (verbose>2){
++			_printLine_("   number of quadrilaterals    = " << nbq);
++			_printLine_("   number of triangles         = " << nbt-nbtout- nbq*2);
++			_printLine_("   number of outside triangles = " << nbtout);
++		}
++
++		return 0; //ok
++
++Error:
++		nbv = nbvold;
++		nbt = nbtold;
++		nbtout = nbtoutold;
++		// cleaning memory ---
++		delete [] newedges;
++		if (ksplitarray) delete [] ksplitarray;
++		if (kedge) delete [] kedge;
++		if (newVerticesOnGeomEdge) delete [] newVerticesOnGeomEdge;
++		if (edge4) delete edge4;
++		if(newVertexOnBThEdge) delete []  newVertexOnBThEdge;
++
++		return ret; // ok 
++	}
++	/*}}}*/
++/*FUNCTION Mesh::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 ;
++					  }
++					  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);
++
++			// a good new point 
++			vi.ReferenceNumber=0; 
++			vi.DirOfSearch =NoDirOfSearch;
++			Triangle *tcvi = TriangleFindFromCoord(vi.i,det3);
++			if (tcvi && !tcvi->link) {
++				_printLine_("problem inserting point in SplitInternalEdgeWithBorderVertices (tcvj && !tcvj->link)");
++			}
++
++			quadtree->Add(vi);
++			if (!tcvi || tcvi->det<0){// internal
++				_error2_("!tcvi || tcvi->det < 0");
++			}
++			AddVertex(vi,tcvi,det3);
++			NbSwap += vi.Optim(1);          
++			iv++;
++			//      }
++	}
++	if (verbose>3) {
++		_printLine_("   number of points: " << iv);
++		_printLine_("   number of swap to  split internal edges with border vertices: " << NbSwap);
++		nbv = iv;
++	}
++}
++if (NbSplitEdge>nbv-nbvold) _printLine_("WARNING: not enough vertices  to split all internal edges, we lost " << NbSplitEdge - ( nbv-nbvold) << " edges...");
++if (verbose>2) _printLine_("SplitInternalEdgeWithBorderVertices: Number of splited edge " << NbSplitEdge);
++
++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;
++
++	/*Get starting triangle. Take tsart if provided*/
++	if (tstart) t=tstart;
++
++	/*Else find the closest Triangle using the quadtree*/
++	else {
++
++		/*Check that the quadtree does exist*/
++		if (!quadtree) _error2_("no starting triangle provided and no quadtree available");
++
++		/*Call NearestVertex*/
++		BamgVertex *a = quadtree->NearestVertex(B.x,B.y) ;
++
++		/*Check output (Vertex a)*/
++		if (!a)    _error2_("problem while trying to find nearest vertex from a given point. No output found");
++		if (!a->t) _error2_("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);
++	}
++
++	Icoor2  detop ;
++
++	/*initialize number of test triangle*/
++	counter=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);
++	}
++
++	jj=0;
++	detop = det(*(*t)(VerticesOfTriangularEdge[jj][0]),*(*t)(VerticesOfTriangularEdge[jj][1]),B);
++
++	while(t->det>0) { 
++
++		/*Increase counter*/
++		if (++counter>=10000) _error2_("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];
++
++		// 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 (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;
++	}
++	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 int verbose=0;
++	register Triangle *t0,*t;
++	register long k=0, num;   
++
++	//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++){ 
++
++		//first triangle of the subdomain i
++		t=t0=subdomains[i].head;
++
++		//check that the subdomain is not empty
++		if (!t0){ _error2_("At least one subdomain is empty");}
++
++		//loop
++		do{
++			k++;
++
++			//get current triangle number
++			num = GetId(t);
++
++			//check that num is in [0 nbt[
++			_assert_(num>=0 && num<nbt);
++
++			//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
++
++	}
++	return k;   
++}
++/*}}}*/
++/*FUNCTION Mesh::Triangulate{{{*/
++void Mesh::Triangulate(double* x,double* y,int nods){
++
++	int verbose=0;
++	int i;
++	Metric M1(1);
++
++	/*Initialize mesh*/
++	Init(nods);//this resets nbv to 0
++	nbv=nods;
++
++	//Vertices
++	if(verbose) _printLine_("Reading vertices (" << nbv << ")");
++	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();
++}
++/*}}}*/
++	/*FUNCTION Mesh::TriangulateFromGeom0{{{*/
++	void Mesh::TriangulateFromGeom0(BamgOpts* bamgopts){
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/GeomToTriangles0)*/
++		/*Generate mesh from geometry*/
++
++		/*Intermediaries*/
++		int                i,j,k;
++		int                nbcurves    = 0;
++		int                NbNewPoints,NbEdgeCurve;
++		double             lcurve,lstep,s;
++		const int          MaxSubEdge  = 10;
++
++		R2          AB;
++		GeomVertex *a, *b;
++		BamgVertex *va,*vb;
++		GeomEdge   *e;
++
++		// add a ref to GH to make sure that it is not destroyed by mistake
++		Gh.NbRef++;
++
++		/*Get options*/
++		int verbose=bamgopts->verbose;
++
++		//build background mesh flag (1 if background, else 0)
++		bool background=(&BTh != this);
++
++		/*Build VerticesOnGeomVertex*/
++
++		//Compute the number of geometrical vertices that we are going to use to mesh
++		for (i=0;i<Gh.nbv;i++){
++			if (Gh[i].Required()) NbVerticesOnGeomVertex++;
++		}
++		//allocate
++		VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex];  
++		if(NbVerticesOnGeomVertex >= maxnbv) _error2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
++		_assert_(nbv==0);
++		//Build VerticesOnGeomVertex
++		for (i=0;i<Gh.nbv;i++){
++			/* Add vertex only if required*/
++			if (Gh[i].Required()) {//Gh  vertices Required
++
++				//Add the vertex
++				_assert_(nbv<maxnbv);
++				vertices[nbv]=Gh[i];
++				
++				//Add pointer from geometry (Gh) to vertex from mesh (Th)
++				Gh[i].MeshVertexHook=vertices+nbv;
++
++				//Build VerticesOnGeomVertex for current point
++				VerticesOnGeomVertex[nbv]=VertexOnGeom(*Gh[i].MeshVertexHook,Gh[i]);
++
++				//nbv increment
++				nbv++;
++			}
++		}
++
++		/*Build VerticesOnGeomEdge*/
++
++		//check that edges is still empty (Init)
++		_assert_(!edges);
++
++		/* Now we are going to create the first edges corresponding
++		 * to the one present in the geometry provided.
++		 * We proceed in 2 steps
++		 *  -step 0: we count all the edges
++		 *           we allocate the number of edges at the end of step 0
++		 *  -step 1: the edges are created */
++		for (int step=0;step<2;step++){
++
++			//initialize number of edges and number of edges max
++			long nbex=0;
++			nbe=0;
++			long NbVerticesOnGeomEdge0=NbVerticesOnGeomEdge;
++			Gh.UnMarkEdges();	
++			nbcurves=0;
++
++			//go through the edges of the geometry
++			for (i=0;i<Gh.nbe;i++){
++
++				//ei = current Geometrical edge
++				GeomEdge &ei=Gh.edges[i];   
++
++				//loop over the two vertices of the edge ei
++				for(int j=0;j<2;j++) {
++
++					/*Take only required vertices (corner->beginning of a new curve)*/
++					if (!ei.Mark() && ei[j].Required()){ 
++
++						long  nbvend=0;
++						Edge* PreviousNewEdge=NULL;
++						lstep = -1;
++
++						/*If Edge is required (do that only once for the 2 vertices)*/
++						if(ei.Required()){
++							if (j==0){
++								//do not create internal points if required (take it as is)
++								if(step==0) nbe++;
++								else{ 
++									e=&ei;
++									a=ei(0);
++									b=ei(1);
++
++									//check that edges has been allocated
++									_assert_(edges);
++									edges[nbe].v[0]=a->MeshVertexHook;
++									edges[nbe].v[1]=b->MeshVertexHook;;
++									edges[nbe].ReferenceNumber = e->ReferenceNumber;
++									edges[nbe].GeomEdgeHook = e;
++									edges[nbe].adj[0] = 0;
++									edges[nbe].adj[1] = 0;
++									nbe++;
++								}
++							}
++						}
++
++						/*If Edge is not required: we are on a curve*/
++						else {
++							for (int kstep=0;kstep<=step;kstep++){
++								//kstep=0, compute number of edges (discretize curve)
++								//kstep=1  create the points and edge
++								PreviousNewEdge=0;
++								NbNewPoints=0;
++								NbEdgeCurve=0;
++								if (nbvend>=maxnbv) _error2_("maximum number of vertices too low! Check the domain outline or increase maxnbv");
++								lcurve =0;
++								s = lstep; //-1 initially, then length of each sub edge
++
++								/*reminder: i = edge number, j=[0;1] vertex index in edge*/
++								k=j;            // k = vertex index in edge (0 or 1)
++								e=&ei;          // e = reference of current edge
++								a=ei(k);        // a = pointer toward the kth vertex of the current edge
++								va = a->MeshVertexHook; // va = pointer toward mesh vertex associated
++								e->SetMark();   // Mark edge
++
++								/*Loop until we reach the end of the curve*/
++								for(;;){ 
++									k = 1-k;            // other vertx index of the curve
++									b = (*e)(k);        // b = pointer toward the other vertex of the current edge
++									AB= b->r - a->r;   // AB = vector of the current edge
++									Metric MA = background ? BTh.MetricAt(a->r) :a->m ;  //Get metric associated to A
++									Metric MB = background ? BTh.MetricAt(b->r) :b->m ;  //Get metric associated to B
++									double ledge = (MA(AB) + MB(AB))/2;                  //Get edge length in metric
++
++									/* We are now creating the mesh edges from the geometrical edge selected above.
++									 * The edge will be divided according to the metric previously computed and cannot
++									 * be divided more than 10 times (MaxSubEdge). */
++
++									//By default, there is only one subedge that is the geometrical edge itself
++									int NbSubEdge = 1;
++
++									//initialize lSubEdge, holding the length of each subedge (cannot be higher than 10)
++									double lSubEdge[MaxSubEdge];
++
++									//Build Subedges according to the edge length
++									if (ledge < 1.5){
++										//if ledge < 1.5 (between one and 2), take the edge as is
++										lSubEdge[0] = ledge;
++									}
++									//else, divide the edge
++									else {
++										//compute number of subedges (division of the edge), Maximum is 10
++										NbSubEdge = Min( MaxSubEdge, (int) (ledge +0.5));
++										/*Now, we are going to divide the edge according to the metric.
++										 * Get segment by sement along the edge.
++										 * Build lSubEdge, which holds the distance between the first vertex
++										 * of the edge and the next point on the edge according to the 
++										 * discretization (each SubEdge is AB)*/
++										R2 A,B;
++										A=a->r;
++										Metric MAs=MA,MBs;
++										ledge=0; 
++										double x =0, xstep= 1./NbSubEdge;
++										for (int kk=0; kk < NbSubEdge; kk++,A=B,MAs=MBs ) {
++											x += xstep;
++											B =  e->F(k ? x : 1-x);
++											MBs= background ? BTh.MetricAt(B) : Metric(1-x,MA,x,MB);
++											AB = A-B;
++											lSubEdge[kk]=(ledge+=(MAs(AB)+MBs(AB))/2);
++										}
++									}
++
++									double lcurveb = lcurve+ledge;
++
++									/*Now, create corresponding points*/
++									while(s>=lcurve && s<=lcurveb && nbv<nbvend){
++
++										/*Schematic of current curve
++										 *
++										 *  a                   vb                  b          // vertex
++										 *  0              ll0     ll1              ledge      // length from a
++										 *  + --- + - ... - + --S-- + --- + - ... - +          // where is S
++										 *  0              kk0     kk1              NbSubEdge  // Sub edge index
++										 *
++										 */
++
++										double ss = s-lcurve;
++
++										/*Find the SubEdge containing ss using Dichotomy*/
++										int kk0=-1,kk1=NbSubEdge-1,kkk;
++										double ll0=0,ll1=ledge,llk;
++										while (kk1-kk0>1){
++											if (ss < (llk=lSubEdge[kkk=(kk0+kk1)/2]))
++											 kk1=kkk,ll1=llk;
++											else
++											 kk0=kkk,ll0=llk;
++										}
++										_assert_(kk1!=kk0);
++
++										/*Curvilinear coordinate in [0 1] of ss in current edge*/
++										// WARNING: This is what we would do
++										// ssa = (ss-ll0)/(ll1-ll0);
++										// aa = (kk0+ssa)/NbSubEdge
++										// This is what Bamg does:
++										double sbb = (ss-ll0)/(ll1-ll0);
++										/*Curvilinear coordinate in [0 1] of ss in current curve*/
++										double bb = (kk1+sbb)/NbSubEdge;
++										double aa = 1-bb;
++
++										// new vertex on edge
++										vb = &vertices[nbv++];
++										vb->m = Metric(aa,a->m,bb,b->m);
++										vb->ReferenceNumber = e->ReferenceNumber;
++										vb->DirOfSearch =NoDirOfSearch;
++										double abcisse = k ? bb : aa;
++										vb->r =  e->F(abcisse);
++										VerticesOnGeomEdge[NbVerticesOnGeomEdge++]= VertexOnGeom(*vb,*e,abcisse);        
++
++										// to take into account the direction of the edge
++										s += lstep;
++										edges[nbe].v[0]=va;
++										edges[nbe].v[1]=vb;
++										edges[nbe].ReferenceNumber =e->ReferenceNumber;
++										edges[nbe].GeomEdgeHook = e;
++										edges[nbe].adj[0] = PreviousNewEdge;
++										if(PreviousNewEdge) PreviousNewEdge->adj[1]=&edges[nbe];
++										PreviousNewEdge=edges+nbe;
++										nbe++;
++										va = vb;
++									}
++									
++									/*We just added one edge to the curve: Go to the next one*/
++									lcurve = lcurveb;
++									e->SetMark();
++									a=b;
++
++									/*If b is required, we are on a new curve->break*/
++									if (b->Required()) break;
++									int kprev=k;
++									k = e->AdjVertexIndex[kprev];// next vertices
++									e = e->Adj[kprev];
++									_assert_(e);
++								}// for(;;)
++								vb = b->MeshVertexHook;
++
++								/*Number of edges in the last disretized curve*/
++								NbEdgeCurve = Max((long) (lcurve +0.5), (long) 1);
++								/*Number of internal vertices in the last disretized curve*/
++								NbNewPoints = NbEdgeCurve-1;
++								if(!kstep){
++									NbVerticesOnGeomEdge0 += NbNewPoints;
++									nbcurves++;
++								}
++								nbvend=nbv+NbNewPoints; 
++								lstep = lcurve / NbEdgeCurve; //approximately one
++							}// end of curve --
++							if (edges) { // last edges of the curves 
++								edges[nbe].v[0]=va;
++								edges[nbe].v[1]=vb;
++								edges[nbe].ReferenceNumber = e->ReferenceNumber;
++								edges[nbe].GeomEdgeHook = e;
++								edges[nbe].adj[0] = PreviousNewEdge;
++								edges[nbe].adj[1] = 0;
++								if(PreviousNewEdge) PreviousNewEdge->adj[1] = & edges[nbe];
++								nbe++;
++							}
++							else nbe += NbEdgeCurve;
++						} // end on  curve ---
++					}
++				}
++			} // for (i=0;i<nbe;i++)
++			if(!step) {
++				_assert_(!edges);
++				_assert_(!VerticesOnGeomEdge);
++
++				edges = new Edge[nbex=nbe];
++				if(NbVerticesOnGeomEdge0) VerticesOnGeomEdge = new VertexOnGeom[NbVerticesOnGeomEdge0];
++
++				// do the vertex on a geometrical vertex
++				_assert_(VerticesOnGeomEdge || NbVerticesOnGeomEdge0==0);
++				NbVerticesOnGeomEdge0 = NbVerticesOnGeomEdge;       
++			}
++			else{
++				_assert_(NbVerticesOnGeomEdge==NbVerticesOnGeomEdge0);
++			}
++		}
++
++		//Insert points inside existing triangles
++		if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
++		if (verbose>3) _printLine_("      Creating initial Constrained Delaunay Triangulation...");
++		if (verbose>3) _printLine_("         Inserting boundary points");
++		Insert();
++
++		//Force the boundary
++		if (verbose>3) _printLine_("         Forcing boundaries");
++		ForceBoundary();
++
++		//Extract SubDomains
++		if (verbose>3) _printLine_("         Extracting subdomains");
++		FindSubDomain();
++
++		if (verbose>3) _printLine_("      Inserting internal points");
++		NewPoints(*this,bamgopts,0) ;
++		if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
++	}
++	/*}}}*/
++	/*FUNCTION Mesh::TriangulateFromGeom1{{{*/
++	void Mesh::TriangulateFromGeom1(BamgOpts* bamgopts,int KeepVertices){ 
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/GeomToTriangles1)*/
++
++		/*Get options*/
++		int verbose=bamgopts->verbose;
++
++		Gh.NbRef++;// add a ref to Gh
++
++		/************************************************************************* 
++		 * method in 2 steps
++		 * 1 - compute the number of new edges to allocate
++		 * 2 - construct the edges
++		 * remark:
++		 * in this part we suppose to have a background mesh with the same geometry 
++		 * 
++		 * To construct the discretization of the new mesh we have to 
++		 * rediscretize the boundary of background Mesh 
++		 * because we have only the pointeur from the background mesh to the geometry.
++		 * We need the abcisse of the background mesh vertices on geometry
++		 * so a vertex is 
++		 * 0 on GeomVertex ;
++		 * 1 on GeomEdge + abcisse
++		 * 2 internal 
++		 *************************************************************************/
++
++		//Check that background mesh and current mesh do have the same geometry
++		_assert_(&BTh.Gh==&Gh);
++		BTh.NbRef++; // add a ref to BackGround Mesh
++
++		//Initialize new mesh
++		BTh.SetVertexFieldOn();
++		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 */
++
++		NbVerticesOnGeomVertex=0;
++		NbVerticesOnGeomEdge=0;
++
++		/*STEP 1 copy of Required vertices*/
++
++		int i; 
++		for (i=0;i<Gh.nbv;i++) if (Gh[i].Required()) NbVerticesOnGeomVertex++;
++		printf("\n");
++		if(NbVerticesOnGeomVertex >= maxnbv){
++			_error2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
++		}
++
++		VerticesOnGeomVertex = new VertexOnGeom[  NbVerticesOnGeomVertex];
++		VertexOnBThVertex    = new VertexOnVertex[NbVerticesOnGeomVertex];
++
++		//At this point there is NO vertex but vertices should have been allocated by Init
++		_assert_(vertices);
++		for (i=0;i<Gh.nbv;i++){
++			if (Gh[i].Required()) {//Gh vertices Required
++				vertices[nbv]  =Gh[i];
++				vertices[nbv].i=I2(0,0);
++				Gh[i].MeshVertexHook = vertices + nbv;// save Geom -> Th
++				VerticesOnGeomVertex[nbv]= VertexOnGeom(vertices[nbv],Gh[i]);
++				nbv++;
++			}
++			else Gh[i].MeshVertexHook=0;
++		} 
++		for (i=0;i<BTh.NbVerticesOnGeomVertex;i++){ 
++			VertexOnGeom &vog=BTh.VerticesOnGeomVertex[i];
++			if (vog.IsRequiredVertex()){
++				GeomVertex* gv=vog;
++				BamgVertex *bv = vog;
++				_assert_(gv->MeshVertexHook); // use of Geom -> Th
++				VertexOnBThVertex[NbVertexOnBThVertex++]=VertexOnVertex(gv->MeshVertexHook,bv);
++				gv->MeshVertexHook->m = bv->m; // for taking the metric of the background mesh
++			}
++		}
++		_assert_(NbVertexOnBThVertex==NbVerticesOnGeomVertex); /*This might be due to MaxCornerAngle too small*/
++
++		/*STEP 2: reseed boundary edges*/
++
++		//  find the begining of the curve in BTh
++		Gh.UnMarkEdges();	
++		int bfind=0;
++		for (int i=0;i<Gh.nbcurves;i++) bcurve[i]=-1; 
++
++		/*Loop over the backgrounf mesh BTh edges*/
++		for (int iedge=0;iedge<BTh.nbe;iedge++){      
++			Edge &ei = BTh.edges[iedge];
++
++			/*Loop over the 2 vertices of the current edge*/
++			for(int je=0;je<2;je++){
++
++				/* If one of the vertex is required we are in a new curve*/
++				if (ei[je].GeomEdgeHook->IsRequiredVertex()){ 
++
++					/*Get curve number*/
++					int nc=ei.GeomEdgeHook->CurveNumber;
++					
++					//_printLine_("Dealing with curve number " << nc);
++					//_printLine_("edge on geometry is same as GhCurve? " << (ei.GeomEdgeHook==Gh.curves[nc].FirstEdge || ei.GeomEdgeHook==Gh.curves[nc].LastEdge)?"yes":"no");
++					//if(ei.GeomEdgeHook==Gh.curves[nc].FirstEdge || ei.GeomEdgeHook==Gh.curves[nc].LastEdge){
++					//	_printLine_("Do we have the right extremity? curve first vertex -> " << ((GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex])?"yes":"no");
++					//	_printLine_("Do we have the right extremity? curve last  vertex -> " << ((GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex])?"yes":"no");
++					//}
++					//BUG FIX from original bamg
++					/*Check that we are on the same edge and right vertex (0 or 1) */
++					if(ei.GeomEdgeHook==Gh.curves[nc].FirstEdge  && (GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex]){
++						bcurve[nc]=iedge*2+je;
++						bfind++;	
++					}
++					else if ((ei.GeomEdgeHook==Gh.curves[nc].LastEdge  && (GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex]) && bcurve[nc]==-1){
++						bcurve[nc]=iedge*2+je;
++						bfind++;	
++					}
++				}
++			}
++		} 
++		if (bfind!=Gh.nbcurves){
++			delete [] bcurve;
++			_error2_("problem generating number of curves (" << Gh.nbcurves << " found in the geometry but " << bfind << " curve found in the mesh)");
++		}
++
++		// method in 2 + 1 step 
++		//  0.0) compute the length and the number of vertex to do allocation
++		//  1.0) recompute the length
++		//  1.1) compute the  vertex 
++
++		long nbex=0,NbVerticesOnGeomEdgex=0;
++		for (int step=0; step <2;step++){
++
++			long NbOfNewPoints=0;
++			long NbOfNewEdge=0;
++			long iedge;
++			Gh.UnMarkEdges();	
++			double L=0;
++
++			/*Go through all geometrical curve*/
++			for (int icurve=0;icurve<Gh.nbcurves;icurve++){ 
++
++				/*Get edge and vertex (index) of background mesh on this curve*/
++				iedge=bcurve[icurve]/2;
++				int jedge=bcurve[icurve]%2;
++
++				/*Get edge of Bth with index iedge*/
++				Edge &ei = BTh.edges[iedge];
++			
++				/*Initialize variables*/
++				double Lstep=0,Lcurve=0;    // step between two points   (phase==1) 
++				long NbCreatePointOnCurve=0;// Nb of new points on curve (phase==1) 
++
++				/*Do phase 0 to step*/
++				for(int phase=0;phase<=step;phase++){
++
++					/*Current curve pointer*/
++					Curve *curve= Gh.curves+icurve;
++
++					/*Get index of current curve*/
++					int icurveequi= Gh.GetId(curve);
++
++					/*For phase 0, check that we are at the begining of the curve only*/
++					if(phase==0 &&  icurveequi!=icurve)  continue;
++
++					int   k0=jedge,k1;
++					Edge* pe=  BTh.edges+iedge;
++					int   iedgeequi=bcurve[icurveequi]/2;
++					int   jedgeequi=bcurve[icurveequi]%2;
++
++					int k0equi=jedgeequi,k1equi;		  
++					Edge * peequi= BTh.edges+iedgeequi;
++					GeomEdge *ongequi = peequi->GeomEdgeHook;
++
++					double sNew=Lstep;// abscisse of the new points (phase==1) 
++					L=0;// length of the curve
++					long i=0;// index of new points on the curve
++					register GeomVertex * GA0 = *(*peequi)[k0equi].GeomEdgeHook;
++					BamgVertex *A0;
++					A0 = GA0->MeshVertexHook;  // the vertex in new mesh
++					BamgVertex *A1;
++					VertexOnGeom *GA1;
++					Edge* PreviousNewEdge = 0;
++
++					// New Curve phase 
++					_assert_(A0-vertices>=0 && A0-vertices<nbv);
++					if(ongequi->Required()){
++						GeomVertex *GA1 = *(*peequi)[1-k0equi].GeomEdgeHook;
++						A1 = GA1->MeshVertexHook;  //
++					}       
++					else {
++						for(;;){
++							Edge &ee=*pe; 
++							Edge &eeequi=*peequi; 
++							k1 = 1-k0; // next vertex of the edge 
++							k1equi= 1 - k0equi;
++							_assert_(pe && ee.GeomEdgeHook);
++							ee.GeomEdgeHook->SetMark();
++							BamgVertex & v0=ee[0], & v1=ee[1];
++							R2 AB=(R2)v1-(R2)v0;
++							double L0=L,LAB;
++							LAB=LengthInterpole(v0.m,v1.m,AB);
++							L+= LAB;
++
++							if (phase){
++								// computation of the new points for the given curve
++								while ((i!=NbCreatePointOnCurve) && sNew<=L) { 
++
++									//some checks
++									_assert_(sNew>=L0);
++									_assert_(LAB);
++									_assert_(vertices && nbv<maxnbv);
++									_assert_(edges && nbe<nbex);
++									_assert_(VerticesOnGeomEdge && NbVerticesOnGeomEdge<NbVerticesOnGeomEdgex);
++
++									// new vertex on edge
++									A1=vertices+nbv++;
++									GA1=VerticesOnGeomEdge+NbVerticesOnGeomEdge;
++									Edge* e = edges + nbe++;
++									double se= (sNew-L0)/LAB;
++									if (se<0 || se>=1.000000001){
++										_error2_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");
++									}
++									se = abscisseInterpole(v0.m,v1.m,AB,se,1);
++									if (se<0 || se>1){
++										_error2_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");
++									}
++									se = k1         ? se : 1. - se;
++									se = k1==k1equi ? se : 1. - se;
++									VertexOnBThEdge[NbVerticesOnGeomEdge++] = VertexOnEdge(A1,&eeequi,se); // save 
++									ongequi=Gh.ProjectOnCurve(eeequi,se,*A1,*GA1); 
++									A1->ReferenceNumber = eeequi.ReferenceNumber;
++									A1->DirOfSearch =NoDirOfSearch;
++									e->GeomEdgeHook = ongequi;
++									e->v[0]=A0;
++									e->v[1]=A1;
++									e->ReferenceNumber = eeequi.ReferenceNumber;
++									e->adj[0]=PreviousNewEdge;
++
++									if (PreviousNewEdge) PreviousNewEdge->adj[1]=e;
++									PreviousNewEdge=e;
++									A0=A1;
++									sNew += Lstep;
++									if (++i== NbCreatePointOnCurve) break;
++								}
++							}
++
++							//some checks
++							_assert_(ee.GeomEdgeHook->CurveNumber==ei.GeomEdgeHook->CurveNumber);
++							if (ee[k1].GeomEdgeHook->IsRequiredVertex()) {
++								_assert_(eeequi[k1equi].GeomEdgeHook->IsRequiredVertex());
++								register GeomVertex * GA1 = *eeequi[k1equi].GeomEdgeHook;
++								A1=GA1->MeshVertexHook;// the vertex in new mesh
++								_assert_(A1-vertices>=0 && A1-vertices<nbv);
++								break;
++							}
++							if (!ee.adj[k1]) {
++								_error2_("adj edge " << BTh.GetId(ee) << ", nbe=" << nbe << ", Gh.vertices=" << Gh.vertices);
++							}
++							pe = ee.adj[k1]; // next edge
++							k0 = pe->Intersection(ee); 
++							peequi= eeequi.adj[k1equi];  // next edge
++							k0equi=peequi->Intersection(eeequi);            
++						}// for(;;) end of the curve
++					}
++
++
++					if (phase){ // construction of the last edge
++						Edge* e=edges + nbe++;
++						e->GeomEdgeHook  = ongequi;
++						e->v[0]=A0;
++						e->v[1]=A1;
++						e->ReferenceNumber = peequi->ReferenceNumber;
++						e->adj[0]=PreviousNewEdge;
++						e->adj[1]=0;
++						if (PreviousNewEdge) PreviousNewEdge->adj[1]=e;
++						PreviousNewEdge = e;
++
++						_assert_(i==NbCreatePointOnCurve);
++					}
++
++					if (!phase)  { // 
++						long NbSegOnCurve = Max((long)(L+0.5),(long) 1);// nb of seg
++						Lstep = L/NbSegOnCurve; 
++						Lcurve = L;
++						NbCreatePointOnCurve = NbSegOnCurve-1;
++						NbOfNewEdge += NbSegOnCurve;
++						NbOfNewPoints += NbCreatePointOnCurve;
++					}
++				}
++			}//  end of curve loop 
++
++			//Allocate memory
++			if(step==0){
++				if(nbv+NbOfNewPoints > maxnbv) {
++					_error2_("too many vertices on geometry: " << nbv+NbOfNewPoints << " >= " << maxnbv);
++				}
++				edges = new Edge[NbOfNewEdge];
++				nbex = NbOfNewEdge;
++				if(NbOfNewPoints) {
++					VerticesOnGeomEdge    = new VertexOnGeom[NbOfNewPoints];
++					NbVertexOnBThEdge     = NbOfNewPoints;
++					VertexOnBThEdge       = new  VertexOnEdge[NbOfNewPoints];
++					NbVerticesOnGeomEdgex = NbOfNewPoints;
++				}
++				NbOfNewPoints =0;
++				NbOfNewEdge = 0;
++			}
++		}
++		_assert_(nbe!=0);
++		delete [] bcurve;
++
++		//Insert points inside existing triangles
++		if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
++		if (verbose>3) _printLine_("      Creating initial Constrained Delaunay Triangulation...");
++		if (verbose>3) _printLine_("         Inserting boundary points");
++		Insert();
++
++		//Force the boundary
++		if (verbose>3) _printLine_("         Forcing boundaries");
++		ForceBoundary();
++
++		//Extract SubDomains
++		if (verbose>3) _printLine_("         Extracting subdomains");
++		FindSubDomain();
++
++		if (verbose>3) _printLine_("      Inserting internal points");
++		NewPoints(BTh,bamgopts,KeepVertices) ;
++		if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
++	}
++	/*}}}*/
++
++	/*Intermediary*/
++	/*FUNCTION CloseBoundaryEdge{{{*/
++	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;
++		int dir=0;
++		if (k<0){
++			_error2_("k<0");
++		}
++		int kkk=0;  
++		Icoor2 IJ_IA,IJ_AJ;
++		AdjacentTriangle edge(t,OppositeEdge[k]);          
++		for (;;edge = dir >0 ? Next(Adj(Next(edge))) : Previous(Adj(Previous(edge)))) {  
++			kkk++;
++			if (kkk>=1000){
++				_error2_("kkk>=1000");
++			}
++			BamgVertex  &vI =  *edge.EdgeVertex(0);
++			BamgVertex  &vJ =  *edge.EdgeVertex(1);
++			I2 I=vI, J=vJ, IJ= J-I;
++			IJ_IA = (IJ ,(A-I));
++			if (IJ_IA<0) {
++				if (dir>0) {a=1;b=0;return edge;}// change of signe => I
++				else {dir=-1;
++					continue;}};// go in direction i 
++					IJ_AJ = (IJ ,(J-A));
++					if (IJ_AJ<0) {
++						if(dir<0)  {a=0;b=1;return edge;}            
++						else {dir = 1;
++							continue;}}// go in direction j
++							double IJ2 = IJ_IA + IJ_AJ;
++							if (IJ2==0){
++								_error2_("IJ2==0");
++							}
++							a= IJ_AJ/IJ2;
++							b= IJ_IA/IJ2;
++							return edge;
++		  } 
++	}
++	/*}}}*/
++	/*FUNCTION CloseBoundaryEdgeV2{{{*/
++	AdjacentTriangle CloseBoundaryEdgeV2(I2 C,Triangle *t, double &a,double &b) { 
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/CloseBoundaryEdgeV2)*/
++		// walk around the vertex 
++		// version 2 for remove the probleme if we fill the hole
++		//int bug=1;
++		//  Triangle *torigine = t;
++		// restart:
++		//   int dir=0;
++		if (t->link != 0){
++			_error2_("t->link != 0");
++		}
++		// to have a starting edges 
++		// try the 3 edge bourna-- in case of internal hole 
++		// and choice  the best 
++		// 
++		// the probleme is in case of  the fine and long internal hole
++		// for exemple neart the training edge of a wing
++		BamgVertex * s=0,*s1=0, *s0=0;
++		Icoor2 imax = MaxICoor22;
++		Icoor2 l0 = imax,l1 = imax;
++		double dd2 =  imax;// infinity
++		AdjacentTriangle er; 
++		int  cas=-2;
++		for (int j=0;j<3;j++)
++		  { 
++			AdjacentTriangle ta=t->FindBoundaryEdge(j);
++			if  (! (Triangle *) ta) continue;
++			s0 = ta.EdgeVertex(0);
++			s1 = ta.EdgeVertex(1);
++			I2 A = * s0;
++			I2 B = *ta.EdgeVertex(1);
++			I2 AB = B-A,AC=C-A,BC=B-C;
++			Icoor2  ACAC = (AC,AC), BCBC = (BC,BC);
++			Icoor2  AB2  =   Norme2_2(AB); //  ||AB||^2
++			Icoor2  ABAC  =   (AB,AC);         //  AB.AC|
++
++			double d2;
++			if ( ABAC < 0 )   // DIST A
++			  {
++				if ( (d2=(double) ACAC)  <  dd2) 
++				  {
++					er = ta;
++					l0 = ACAC;
++					l1 = BCBC;
++					cas = 0;
++					s = s0;
++				  }
++			  }
++			else if (ABAC > AB2)  // DIST B
++			  {
++				if ( (d2=(double) BCBC)  <  dd2) 
++				  {
++					dd2 = d2;
++					er = Adj(ta); // other direction
++					l0 = BCBC;
++					l1 = ACAC;
++					cas = 1;
++					s = s1;
++				  }
++			  }
++			else  // DIST AB
++			  { 
++
++				double det_2 =  (double) Det(AB,AC); 
++				det_2 *= det_2; // square of area*2 of triangle ABC
++				d2 = det_2/ (double) AB2; // hauteur^2 in C of of triangle ABC      
++
++				if (d2 < dd2) 
++				  {
++					dd2 = d2;
++					er = ta;
++					l0 = (AC,AC);
++					l1 = (BC,BC);
++					s = 0;
++					cas = -1;
++					b = ((double) ABAC/(double) AB2);
++					a = 1 - b;
++				  }
++			  }
++		  }
++		if (cas ==-2){
++			_error2_("cas==-2");
++		}
++		// l1 = ||C s1||  , l0 = ||C s0||
++		// where s0,s1 are the vertex of the edge er
++
++		if ( s) 
++		  { 
++			t=er;
++			AdjacentTriangle edge(er); 
++
++			int kkk=0;  
++			int linkp = t->link == 0;
++
++			Triangle * tt=t=edge=Adj(Previous(edge));
++			do  {  // loop over vertex s
++				kkk++;
++				if (edge.EdgeVertex(0)!=s && kkk>=10000){
++					_error2_("edge.EdgeVertex(0)!=s && kkk>=10000");
++				}
++
++				int link = tt->link == 0;
++				if ((link + linkp) == 1) 
++				  { // a boundary edge 
++					BamgVertex * st = edge.EdgeVertex(1);
++					I2 I=*st;
++					Icoor2  ll = Norme2_2 (C-I);
++					if (ll < l1) {  // the other vertex is neart 
++						s1=st;
++						l1=ll;
++						er = edge;
++						if(ll<l0) { // change of direction --
++							s1=s;
++							l1=l0;
++							s=st;
++							l0=ll;
++							t=tt;
++							edge=Adj(edge);
++							link=linkp;
++							er = edge;
++						}
++					}
++				  }
++
++				linkp=link;
++				edge=Adj(Previous(edge));
++				tt = edge;
++			} while (t!=tt);
++
++			if (!(Triangle *) er){
++				_error2_("!(Triangle *) er");
++			}
++			I2 A((I2)*er.EdgeVertex(0));
++			I2 B((I2)*er.EdgeVertex(1));
++			I2 AB=B-A,AC=C-A,CB=B-C;
++			double aa =  (double) (AB,AC);
++			double bb =  (double) (AB,CB);
++			if (aa<0)       a=1,b=0;
++			else if(bb<0)   a=0,b=1;
++			else  
++			  {
++				a  = bb/(aa+bb);
++				b  = aa/(aa+bb);
++			  }
++		  }
++		return er;
++	} 
++	/*}}}*/
++/*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 NbSwap =0;
++	if (!a.t || !b.t){ // the 2 vertex is in a mesh
++		_error2_("!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  
++
++	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){
++			_error2_("!v2");
++		}
++		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; 
++
++		if((det1 < 0) && (det2 >0)) { 
++			// try to force the edge 
++			BamgVertex * va = &a, *vb = &b;
++			tc = Previous(tc);
++			if (!v1 || !v2){
++				_error2_("!v1 || !v2");
++			}
++			Icoor2 detss = 0,l=0,ks;
++			while ((ks=SwapForForcingEdge(  va,  vb, tc, detss, det1,det2,NbSwap)))
++			 if(l++ > 10000000) {
++				 _error2_("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
++			  }
++		}
++		tta = tc;
++		k++;
++		if (k>=2000){
++			_error2_("k>=2000");
++		}
++		if ( vbegin == v2 ) return -1;// error 
++	}
++
++	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->SetSingleVertexToTriangleConnectivity();
++	t2->SetSingleVertexToTriangleConnectivity();
++} // end swap 
++/*}}}*/
++	/*FUNCTION SwapForForcingEdge{{{*/
++	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
++		// on cherche l'arete suivante 
++		// on suppose que detsa >0 et detsb <0
++		// attention la routine echange pva et pvb 
++
++		if(tt1.Locked()) return 0; // frontiere croise 
++
++		AdjacentTriangle tt2 = Adj(tt1);
++		Triangle *t1=tt1,*t2=tt2;// les 2 triangles adjacent
++		short a1=tt1,a2=tt2;// les 2 numero de l arete dans les 2 triangles
++		if ( a1<0 || a1>=3 ){
++			_error2_("a1<0 || a1>=3");
++		}
++
++		BamgVertex & sa= (* t1)[VerticesOfTriangularEdge[a1][0]];
++		BamgVertex & s1= (*t1)[OppositeVertex[a1]];
++		BamgVertex & s2= (*t2)[OppositeVertex[a2]];
++
++
++		Icoor2 dets2 = det(*pva,*pvb,s2);
++		Icoor2 det1=t1->det , det2=t2->det ;
++		Icoor2 detT = det1+det2;
++		if ((det1<=0 ) || (det2<=0)){
++			_error2_("(det1<=0 ) || (det2<=0)");
++		}
++		if ( (detsa>=0) || (detsb<=0) ){ // [a,b] cut infinite line va,bb
++			_error2_("(detsa>=0) || (detsb<=0)");
++		}
++		Icoor2 ndet1 = bamg::det(s1,sa,s2);
++		Icoor2 ndet2 = detT - ndet1;
++
++		int ToSwap =0; //pas de swap
++		if ((ndet1 >0) && (ndet2 >0)) 
++		  { // on peut swaper  
++			if ((dets1 <=0 && dets2 <=0) || (dets2 >=0 && detsb >=0))
++			 ToSwap =1; 
++			else // swap alleatoire 
++			 if (BinaryRand()) 
++			  ToSwap =2; 
++		  }
++		if (ToSwap) NbSwap++,
++		 bamg::swap(t1,a1,t2,a2,&s1,&s2,ndet1,ndet2);
++
++		int ret=1;
++
++		if (dets2 < 0) {// haut
++			dets1 = ToSwap ? dets1 : detsa ;
++			detsa = dets2; 
++			tt1 =  Previous(tt2) ;}
++		else if (dets2 > 0){// bas 
++			dets1 = ToSwap ? dets1 : detsb ;
++			detsb = dets2;
++			//xxxx tt1 = ToSwap ? tt1 : Next(tt2);
++			if(!ToSwap) tt1 =  Next(tt2);
++		}
++		else { // changement de direction 
++			ret = -1;
++			Exchange(pva,pvb);
++			Exchange(detsa,detsb);
++			Exchange(dets1,dets2);
++			Exchange(tt1,tt2);
++			dets1=-dets1;
++			dets2=-dets2;
++			detsa=-detsa;
++			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;}
++
++		}
++		return ret;
++	}
++	/*}}}*/
++
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Update.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Update.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Update.h	(revision 12821)
+@@ -0,0 +1,35 @@
++/*!\file: Update.h: abstract class used by some objects to update their properties
++ * \brief prototypes for Update.h
++ */ 
++
++#ifndef _UPDATE_H_
++#define  _UPDATE_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../shared/shared.h"
++/*}}}*/
++
++class Update{
++
++	public:
++
++		virtual void  InputUpdateFromVector(IssmDouble* vector, int name, int type)=0;
++		virtual void  InputUpdateFromVector(int* vector, int name, int type)=0;
++		virtual void  InputUpdateFromVector(bool* vector, int name, int type)=0; 
++		#ifdef _HAVE_DAKOTA_
++		virtual void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int rows, int ncols, int name, int type)=0;
++		virtual void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type)=0;
++		virtual void  InputUpdateFromVectorDakota(int* vector, int name, int type)=0;
++		virtual void  InputUpdateFromVectorDakota(bool* vector, int name, int type)=0;
++		#endif
++		virtual void  InputUpdateFromConstant(IssmDouble constant, int name)=0;
++		virtual void  InputUpdateFromConstant(int constant, int name)=0;
++		virtual void  InputUpdateFromConstant(bool constant, int name)=0;
++		virtual void  InputUpdateFromSolution(IssmDouble* solution)=0;
++		virtual void  InputUpdateFromIoModel(int index, IoModel* iomodel)=0;
++
++};
++
++#endif //ifndef _UPDATE_H_
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp	(revision 12821)
+@@ -0,0 +1,159 @@
++/*!\file FemModel.c
++ * \brief: implementation of the FemModel object
++ */
++
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include "../Container/Container.h"
++#include "../modules/ModelProcessorx/ModelProcessorx.h"
++#include "../io/io.h"
++#include "./objects.h"
++#include "../include/include.h"
++#include "../EnumDefinitions/EnumDefinitions.h"
++#include "../modules/modules.h"
++
++/*Object constructors and destructor*/
++/*FUNCTION FemModel::constructor {{{*/
++FemModel::FemModel(char* inputfilename, char* outputfilename, const int in_solution_type,const int* analyses,const int nummodels){
++
++	/*intermediary*/
++	int         i;
++	int         analysis_type;
++	FILE       *IOMODEL = NULL;
++	extern int  my_rank;
++
++	/*Open input file on cpu 0: */
++	if(my_rank==0) IOMODEL = pfopen(inputfilename ,"rb");
++
++	/*Initialize internal data: */
++	this->nummodels=nummodels;
++	this->solution_type=in_solution_type;
++	this->analysis_counter=nummodels-1; //point to last analysis_type carried out.
++	this->results=new Results(); //not initialized by CreateDataSets
++	
++	/*Dynamically allocate whatever is a list of length nummodels: */
++	analysis_type_list=xNew<int>(nummodels);
++
++	/*Initialize: */
++	for(i=0;i<nummodels;i++)analysis_type_list[i]=analyses[i];
++
++	/*create datasets for all analyses*/
++	ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,IOMODEL,this->solution_type,nummodels,analyses);
++
++	/*do the post-processing of the datasets to get an FemModel that can actually run analyses: */
++	for(i=0;i<nummodels;i++){
++
++		if(VerboseMProcessor()) _pprintLine_("   Processing finite element model of analysis " << EnumToStringx(analysis_type_list[i]) << ":");
++		analysis_type=analysis_type_list[i];
++		this->SetCurrentConfiguration(analysis_type);
++	
++		if(i==0){
++			if(VerboseMProcessor()) _pprintLine_("      creating vertex degrees of freedom");
++			VerticesDofx(vertices,parameters); //only call once, we only have one set of vertices
++		}
++
++		if(VerboseMProcessor()) _pprintLine_("      resolving node constraints");
++		SpcNodesx(nodes,constraints,parameters,analysis_type); 
++
++		if(VerboseMProcessor()) _pprintLine_("      creating nodal degrees of freedom");
++		NodesDofx(nodes,parameters,analysis_type);
++	
++		if(VerboseMProcessor()) _pprintLine_("      configuring element and loads");
++		ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters);
++	}
++	
++	/*Close input file descriptors: */
++	if(my_rank==0) pfclose(IOMODEL,inputfilename);
++
++	/*Add output file name to parameters: */
++	this->parameters->AddObject(new StringParam(OutputfilenameEnum,outputfilename));
++
++}
++
++/*}}}*/
++/*FUNCTION FemModel::destructor {{{*/
++FemModel::~FemModel(){
++
++	/*Intermediary*/
++	int i;
++
++	/*Delete all the datasets: */
++	xDelete<int>(analysis_type_list);
++	delete elements;
++	delete nodes;
++	delete vertices;
++	delete constraints;
++	delete loads;
++	delete materials;
++	delete parameters;
++	delete results;
++
++}
++/*}}}*/
++
++/*Object management*/
++/*FUNCTION FemModel::Echo {{{*/
++void FemModel::Echo(void){
++
++	_printLine_("FemModel echo: ");
++	_printLine_("   number of fem models: " << nummodels);
++	_printLine_("   analysis_type_list: ");
++	for(int i=0;i<nummodels;i++)_printLine_("     " << i << ": " << EnumToStringx(analysis_type_list[i]));
++	_printLine_("   current analysis_type: ");
++	_printLine_("     " << analysis_counter << ": " << EnumToStringx(analysis_type_list[analysis_counter]));
++
++}
++/*}}}*/
++
++/*Numerics: */
++/*FUNCTION 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 
++	 * analyses. For example: do a SurfaceSlopeX, SurfaceSlopeY, BedSlopeX and BedSlopeY analysis using the 
++	 * Slope configuration.*/
++
++	int found=-1;
++	for(int i=0;i<nummodels;i++){
++		if (analysis_type_list[i]==configuration_type){
++			found=i;
++			break;
++		}
++	}
++	if(found!=-1) analysis_counter=found;
++	else _error2_("Could not find alias for analysis_type " << EnumToStringx(configuration_type) << " in list of FemModel analyses");
++
++	/*Now, plug analysis_counter and analysis_type inside the parameters: */
++	this->parameters->SetParam(analysis_counter,AnalysisCounterEnum);
++	this->parameters->SetParam(analysis_type,AnalysisTypeEnum);
++	this->parameters->SetParam(configuration_type,ConfigurationTypeEnum);
++
++	/*configure elements, loads and nodes, for this new analysis: */
++	this->elements->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters);
++	this->nodes->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters);
++	this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters);
++
++	#ifdef _HAVE_PETSC_
++	/*take care of petsc options, that depend on this analysis type (present only after model processor)*/
++	if(this->parameters->Exist(PetscOptionsStringsEnum)){
++		PetscOptionsFromAnalysis(this->parameters,analysis_type);
++		if(VerboseSolver()) _pprintLine_("      petsc Options set for analysis type: " << EnumToStringx(analysis_type));
++	}
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION FemModel::SetCurrentConfiguration(int configuration_type){{{*/
++void FemModel::SetCurrentConfiguration(int configuration_type){
++
++	/*overload: analysis_type = configuration_type: */
++	this->SetCurrentConfiguration(configuration_type,configuration_type);
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.h	(revision 12821)
+@@ -0,0 +1,43 @@
++/*!\file Contour.h
++ * \brief: header file for Contour object
++ */
++
++#ifndef _CONTOUR_H_
++#define _CONTOUR_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Object.h"
++#include "../shared/Exceptions/exceptions.h"
++#include "../toolkits/toolkits.h"
++#include "../include/include.h"
++/*}}}*/
++
++class Contour: public Object{
++
++	public: 
++
++		int     id;
++		int	  nods;  //number of vertices in the contour
++		IssmDouble* x;
++		IssmDouble* y;
++		bool    closed; //is this contour closed?
++
++		/*Contour constructors, destructors {{{*/
++		Contour();
++		Contour(int id, int nods, IssmDouble* x, IssmDouble* y,bool closed);
++		~Contour();
++		/*}}}*/
++		/*Object virtual functions{{{*/
++		void  Echo(void);
++		void  DeepEcho(void);
++		int   Id(void);
++		int   MyRank(void);
++		int   ObjectEnum(void);
++		Object* copy(void);
++		/*}}}*/
++
++
++};
++
++#endif  /* _CONTOUR_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.cpp	(revision 12821)
+@@ -0,0 +1,86 @@
++/*!\file Segment.c
++ * \brief: implementation of the Segment object
++ */
++
++/*Include files: {{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "./objects.h"
++#include "../Container/Container.h"
++#include "../EnumDefinitions/EnumDefinitions.h"
++#include "../shared/shared.h"
++#include "../include/include.h"
++/*}}}*/
++
++/*Segment constructors and destructors:*/
++/*FUNCTION Segment::Segment() default constructor {{{*/
++Segment::Segment(){
++	this->eid=UNDEF;
++	this->x1=UNDEF;
++	this->y1=UNDEF;
++	this->x2=UNDEF;
++	this->y2=UNDEF;
++}
++/*}}}*/
++/*FUNCTION Segment::Segment(int eid, IssmDouble x1,IssmDouble y1,IssmDouble x2, IssmDouble y2){{{*/
++Segment::Segment(int segment_eid, IssmDouble segment_x1,IssmDouble segment_y1,IssmDouble segment_x2, IssmDouble segment_y2){
++
++	this->eid=segment_eid;
++	this->x1=segment_x1;
++	this->y1=segment_y1;
++	this->x2=segment_x2;
++	this->y2=segment_y2;
++
++}
++/*}}}*/
++/*FUNCTION Segment::~Segment(){{{*/
++Segment::~Segment(){
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Segment::Echo{{{*/
++void Segment::Echo(void){
++
++	_printLine_("Segment:");
++	_printLine_("   eid: " << eid);
++	_printLine_("   node 1: " << this->x1 << "|" << this->y1);
++	_printLine_("   node 2: " << this->x2 << "|" << this->y2);
++
++}
++/*}}}*/
++/*FUNCTION Segment::DeepEcho{{{*/
++void Segment::DeepEcho(void){
++	this->Echo();
++}
++/*}}}*/
++/*FUNCTION Segment::Id{{{*/
++int    Segment::Id(void){ return eid; }
++/*}}}*/
++/*FUNCTION Segment::MyRank{{{*/
++int    Segment::MyRank(void){ 
++	extern int my_rank;
++
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Segment::ObjectEnum{{{*/
++int Segment::ObjectEnum(void){
++
++	return SegmentEnum;
++
++}
++/*}}}*/
++/*FUNCTION Segment::copy {{{*/
++Object* Segment::copy() {
++	return new Segment(this->eid,this->x1,this->y1,this->x2,this->y2);
++
++}
++
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.h	(revision 12821)
+@@ -0,0 +1,65 @@
++/*! \file Vertex.h 
++ *  \brief: header file for vertex object
++ */
++
++#ifndef _VERTEX_H_
++#define _VERTEX_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Object.h"
++class IoModel;
++class Vector;
++class Parameters;
++#include "../shared/Exceptions/exceptions.h"
++#include "../toolkits/toolkits.h"
++#include "../include/include.h"
++
++/*}}}*/
++
++
++class Vertex: public Object{
++
++	public: 
++
++		int    id;
++		int    sid;            //sid for "serial" id, ie the rank of this vertex in the vertices dataset, if the dataset was serial on 1 cpu.
++		IssmDouble x;
++		IssmDouble y;
++		IssmDouble z;
++		IssmDouble sigma;          //sigma coordinate: (z-bed)/thickness
++		int    connectivity;   //number of vertices connected to this vertex
++
++		/*dof management: */
++		int    clone;
++		int    dof; //dof to recover values in a vertex indexed vector
++
++		/*Vertex constructors, destructors {{{*/
++		Vertex();
++		Vertex(int id, int sid,IssmDouble x, IssmDouble y, IssmDouble z, IssmDouble sigma, int connectivity); 
++		void Init(int id, int sid, IssmDouble x, IssmDouble y, IssmDouble z, IssmDouble sigma,int connectivity);
++		Vertex(int id, int sid, int i, IoModel* iomodel);
++		~Vertex();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*DofObject routines {{{*/
++		void  DistributeDofs(int* pdofcount);
++		void  OffsetDofs(int dofcount);
++		void  ShowTrueDofs(int* borderdofs);
++		void  UpdateCloneDofs(int* allborderdofs);
++		void  SetClone(int* minranks);
++		/*}}}*/
++		/*Vertex management: {{{*/
++		int   Sid(void); 
++		int   Connectivity(void); 
++		void  UpdatePosition(Vector* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
++		/*}}}*/
++};
++#endif  /* _VERTEX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 12821)
+@@ -0,0 +1,1012 @@
++/*!\file Node.c
++ * \brief: implementation of the Node object
++ */
++
++/*Include files: {{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "./objects.h"
++#include "../Container/Container.h"
++#include "../EnumDefinitions/EnumDefinitions.h"
++#include "../shared/shared.h"
++#include "../include/include.h"
++#include "../modules/modules.h"
++/*}}}*/
++
++/*Node constructors and destructors:*/
++/*FUNCTION Node::Node() default constructor {{{*/
++Node::Node(){
++		 this->inputs=NULL;
++		 this->hvertex=NULL;
++		 return;
++}
++/*}}}*/
++/*FUNCTION Node::Node(int node_id,int node_sid,int vertex_id,int io_index, IoModel* iomodel,int analysis_type) {{{*/
++Node::Node(int node_id,int node_sid,int vertex_id,int io_index, IoModel* iomodel,int analysis_type){
++
++	/*Intermediary*/
++	int k,l;
++	int gsize;
++	int dim;
++
++	/*Fetch parameters: */
++	iomodel->Constant(&dim,MeshDimensionEnum);
++
++	/*id: */
++	this->id=node_id; 
++	this->sid=node_sid; 
++	this->analysis_type=analysis_type;
++
++	/*Initialize coord_system: Identity matrix by default*/
++	for(k=0;k<3;k++) for(l=0;l<3;l++) this->coord_system[k][l]=0.0;
++	for(k=0;k<3;k++) this->coord_system[k][k]=1.0;
++
++	/*indexing:*/
++	DistributeNumDofs(&this->indexing,analysis_type,iomodel->Data(FlowequationVertexEquationEnum)+io_index); //number of dofs per node
++	gsize=this->indexing.gsize;
++
++	/*Hooks*/
++	this->hvertex=new Hook(&vertex_id,1); //node id is the same as the vertex id, continuous galerkin!
++
++	//intialize inputs, and add as many inputs per element as requested: 
++	this->inputs=new Inputs();
++	if (iomodel->Data(MeshVertexonbedEnum))
++	 this->inputs->AddInput(new BoolInput(MeshVertexonbedEnum,reCast<IssmBool>(iomodel->Data(MeshVertexonbedEnum)[io_index])));
++	if (iomodel->Data(MeshVertexonsurfaceEnum))
++	 this->inputs->AddInput(new BoolInput(MeshVertexonsurfaceEnum,reCast<IssmBool>(iomodel->Data(MeshVertexonsurfaceEnum)[io_index])));
++	if (iomodel->Data(MaskVertexonfloatingiceEnum))
++	 this->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,reCast<IssmBool>(iomodel->Data(MaskVertexonfloatingiceEnum)[io_index])));
++	if (iomodel->Data(MaskVertexongroundediceEnum))
++	  this->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,reCast<IssmBool>(iomodel->Data(MaskVertexongroundediceEnum)[io_index])));
++	if (analysis_type==DiagnosticHorizAnalysisEnum)
++	 this->inputs->AddInput(new IntInput(ApproximationEnum,reCast<IssmInt>(iomodel->Data(FlowequationVertexEquationEnum)[io_index])));
++	/*set single point constraints: */
++
++	/*spc all nodes on water*/
++	if (!iomodel->Data(MaskVertexonwaterEnum)) _error2_("iomodel->nodeonwater is NULL");
++	if (reCast<IssmBool>(iomodel->Data(MaskVertexonwaterEnum)[io_index])){
++		for(k=1;k<=gsize;k++){
++			this->FreezeDof(k);
++		}
++	}
++
++	/*Diagnostic Horiz*/
++	#ifdef _HAVE_DIAGNOSTIC_
++	if (analysis_type==DiagnosticHorizAnalysisEnum){
++
++		/*Coordinate system provided, convert to coord_system matrix*/
++		_assert_(iomodel->Data(DiagnosticReferentialEnum)); 
++		XZvectorsToCoordinateSystem(&this->coord_system[0][0],iomodel->Data(DiagnosticReferentialEnum)+io_index*6);
++
++		if (dim==3){
++			/*We have a  3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
++			_assert_(iomodel->Data(MeshVertexonbedEnum)); 
++			_assert_(iomodel->Data(FlowequationVertexEquationEnum));
++			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealApproximationEnum && !iomodel->Data(MeshVertexonbedEnum)[io_index]){
++				for(k=1;k<=gsize;k++) this->FreezeDof(k);
++			}
++			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealPattynApproximationEnum && iomodel->Data(FlowequationBordermacayealEnum)[io_index]){
++				if(!iomodel->Data(MeshVertexonbedEnum)[io_index]){
++					for(k=1;k<=gsize;k++) this->FreezeDof(k);
++				}
++			}
++			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealStokesApproximationEnum && iomodel->Data(FlowequationBordermacayealEnum)[io_index]){
++				if(!iomodel->Data(MeshVertexonbedEnum)[io_index]){
++					for(k=1;k<=2;k++) this->FreezeDof(k);
++				}
++			}
++		}
++		/*spc all nodes on hutter*/
++		if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==HutterApproximationEnum){
++			for(k=1;k<=gsize;k++){
++				this->FreezeDof(k);
++			}
++		}
++	}
++	#endif
++
++	/*Diagnostic Hutter*/
++	if (analysis_type==DiagnosticHutterAnalysisEnum){
++		if (!iomodel->Data(FlowequationVertexEquationEnum)) _error2_("iomodel->vertices_type is NULL");
++		/*Constrain all nodes that are not Hutter*/
++		if (reCast<int>(iomodel->Data(FlowequationVertexEquationEnum)[io_index])!=HutterApproximationEnum){
++			for(k=1;k<=gsize;k++){
++				this->FreezeDof(k);
++			}
++		}
++	}
++
++	/*Prognostic/ Melting/ Slopecompute/ Balancethickness*/
++	if (
++				analysis_type==PrognosticAnalysisEnum || 
++				analysis_type==MeltingAnalysisEnum || 
++				analysis_type==BedSlopeAnalysisEnum || 
++				analysis_type==SurfaceSlopeAnalysisEnum || 
++				analysis_type==BalancethicknessAnalysisEnum
++				){
++		if (dim==3){
++			/*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
++			_assert_(iomodel->Data(MeshVertexonbedEnum));
++			if (!(reCast<IssmBool>(iomodel->Data(MeshVertexonbedEnum)[io_index]))){
++				for(k=1;k<=gsize;k++){
++					this->FreezeDof(k);
++				}
++			}
++		}
++	}
++
++}
++/*}}}*/
++/*FUNCTION Node::~Node(){{{*/
++Node::~Node(){
++	delete inputs;
++	delete hvertex;
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Node::Echo{{{*/
++void Node::Echo(void){
++
++	_printLine_("Node:");
++	_printLine_("   id: " << id);
++	_printLine_("   sid: " << sid);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	indexing.Echo();
++	_printLine_("   hvertex:     not displayed");
++	_printLine_("   inputs:      " << inputs);
++
++
++}
++/*}}}*/
++/*FUNCTION Node::DeepEcho{{{*/
++void Node::DeepEcho(void){
++
++	_printLine_("Node:");
++	_printLine_("   id: " << id);
++	_printLine_("   sid: " << sid);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	indexing.DeepEcho();
++	_printLine_("Vertex:");
++	hvertex->DeepEcho();
++	_printLine_("   inputs");
++
++
++}
++/*}}}*/
++/*FUNCTION Node::Id{{{*/
++int    Node::Id(void){ return id; }
++/*}}}*/
++/*FUNCTION Node::MyRank{{{*/
++int    Node::MyRank(void){ 
++	extern int my_rank;
++
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Node::ObjectEnum{{{*/
++int Node::ObjectEnum(void){
++
++	return NodeEnum;
++
++}
++/*}}}*/
++
++/*Node management:*/
++/*FUNCTION Node::Configure {{{*/
++void  Node::Configure(DataSet* nodesin,Vertices* verticesin){
++
++	int i;
++
++	/*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 off_sets hidden in hooks: */
++	hvertex->configure(verticesin);
++
++}
++/*FUNCTION Node::SetCurrentConfiguration {{{*/
++void  Node::SetCurrentConfiguration(DataSet* nodesin,Vertices* verticesin){
++
++}
++/*FUNCTION Node::GetDof {{{*/
++int   Node::GetDof(int dofindex,int setenum){
++
++	if(setenum==GsetEnum){
++		_assert_(dofindex>=0 && dofindex<indexing.gsize);
++		return indexing.gdoflist[dofindex];
++	}
++	else if(setenum==FsetEnum){
++		_assert_(dofindex>=0 && dofindex<indexing.fsize);
++		return indexing.fdoflist[dofindex];
++	}
++	else if(setenum==SsetEnum){
++		_assert_(dofindex>=0 && dofindex<indexing.ssize);
++		return indexing.sdoflist[dofindex];
++	}
++	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++
++}
++/*}}}*/
++/*FUNCTION Node::GetDofList1{{{*/
++int  Node::GetDofList1(void){
++
++	Vertex* vertex=NULL;
++
++	vertex=(Vertex*)this->hvertex->delivers();
++
++	return vertex->dof;
++}
++/*}}}*/
++/*FUNCTION Node::GetDofList{{{*/
++void  Node::GetDofList(int* outdoflist,int approximation_enum,int setenum){
++	int i;
++	int count=0;
++	int count2=0;
++		
++	if(approximation_enum==NoneApproximationEnum){
++		if(setenum==GsetEnum)for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=indexing.gdoflist[i];
++		if(setenum==FsetEnum)for(i=0;i<this->indexing.fsize;i++) outdoflist[i]=indexing.fdoflist[i];
++		if(setenum==SsetEnum)for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i];
++	}
++	else{
++
++		if(setenum==GsetEnum){
++			if(indexing.doftype){
++				count=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if(indexing.doftype[i]==approximation_enum){
++						outdoflist[count]=indexing.gdoflist[i];
++						count++;
++					}
++				}
++				_assert_(count); //at least one dof should be the approximation requested
++			}
++			else for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=indexing.gdoflist[i];
++		}
++		else if(setenum==FsetEnum){
++			if(indexing.doftype){
++				count=0;
++				count2=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if(indexing.f_set[i]){
++						if(indexing.doftype[i]==approximation_enum){
++							outdoflist[count]=indexing.fdoflist[count2];
++							count++;
++						}
++						count2++;
++					}
++				}
++			}
++			else for(i=0;i<this->indexing.fsize;i++) outdoflist[i]=indexing.fdoflist[i];
++		}
++		else if(setenum==SsetEnum){
++			if(indexing.doftype){
++				count=0;
++				count2=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if(indexing.s_set[i]){
++						if(indexing.doftype[i]==approximation_enum){
++							outdoflist[count]=indexing.sdoflist[count2];
++							count++;
++						}
++						count2++;
++					}
++				}
++			}
++			else for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i];
++		}
++		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	}
++}
++/*}}}*/
++/*FUNCTION Node::GetSidList{{{*/
++int  Node::GetSidList(void){
++
++	Vertex* vertex=NULL;
++
++	vertex=(Vertex*)this->hvertex->delivers();
++
++	return vertex->sid;
++}
++/*}}}*/
++/*FUNCTION Node::GetLocalDofList{{{*/
++void  Node::GetLocalDofList(int* outdoflist,int approximation_enum,int setenum){
++	int i;
++	int count=0;
++	int count2=0;
++		
++	if(approximation_enum==NoneApproximationEnum){
++		if(setenum==GsetEnum)for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=i;
++		else if(setenum==FsetEnum){
++			count=0;
++			for(i=0;i<this->indexing.gsize;i++){
++				if(indexing.f_set[i]){
++					outdoflist[count]=i;
++					count++;
++				}
++			}
++		}
++		else if(setenum==SsetEnum){
++			count=0;
++			for(i=0;i<this->indexing.gsize;i++){
++				if(indexing.s_set[i]){
++					outdoflist[count]=i;
++					count++;
++				}
++			}
++		}
++		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	}
++	else{
++
++		if(setenum==GsetEnum){
++			if(indexing.doftype){
++				count=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if(indexing.doftype[i]==approximation_enum){
++						outdoflist[count]=count;
++						count++;
++					}
++				}
++				_assert_(count);
++			}
++			else for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=i;
++		}
++		else if(setenum==FsetEnum){
++
++			if(indexing.doftype){
++				count=0;
++				count2=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if(indexing.doftype[i]==approximation_enum){
++						if(indexing.f_set[i]){
++							outdoflist[count]=count2;
++							count++;
++						}
++						count2++;
++					}
++				}
++				_assert_(count2);
++			}
++			else{
++
++				count=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if(indexing.f_set[i]){
++						outdoflist[count]=i;
++						count++;
++					}
++				}
++			}
++		}
++		else if(setenum==SsetEnum){
++			if(indexing.doftype){
++				count=0;
++				count2=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if(indexing.doftype[i]==approximation_enum){
++						if(indexing.s_set[i]){
++							outdoflist[count]=count2;
++							count++;
++						}
++						count2++;
++					}
++				}
++				_assert_(count2);
++			}
++			else{
++				count=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if(indexing.s_set[i]){
++						outdoflist[count]=i;
++						count++;
++					}
++				}
++			}
++		}
++		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	}
++}
++/*}}}*/
++/*FUNCTION Node::Sid{{{*/
++int    Node::Sid(void){ return sid; }
++/*}}}*/
++/*FUNCTION Node::GetVertexId {{{*/
++int   Node::GetVertexId(void){
++
++	Vertex*  vertex=NULL;
++
++	vertex=(Vertex*)hvertex->delivers();
++	return vertex->id;
++}
++/*}}}*/
++/*FUNCTION Node::GetVertexDof {{{*/
++int   Node::GetVertexDof(void){
++
++	Vertex*  vertex=NULL;
++
++	vertex=(Vertex*)hvertex->delivers();
++	return vertex->dof;
++}
++/*}}}*/
++#ifdef _HAVE_DIAGNOSTIC_
++/*FUNCTION Node::GetCoordinateSystem{{{*/
++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];
++
++}
++/*}}}*/
++#endif
++/*FUNCTION Node::SetVertexDof {{{*/
++void   Node::SetVertexDof(int in_dof){
++
++	Vertex*  vertex=NULL;
++
++	vertex=(Vertex*)hvertex->delivers();
++	vertex->dof=in_dof;
++
++}
++/*}}}*/
++/*FUNCTION Node::InAnalysis{{{*/
++bool Node::InAnalysis(int in_analysis_type){
++	if (in_analysis_type==this->analysis_type) return true;
++	else return false;
++}
++/*}}}*/
++
++/*Node numerics:*/
++/*FUNCTION Node::ApplyConstraints{{{*/
++void  Node::ApplyConstraint(int dof,IssmDouble value){
++
++	int index;
++
++	/*Dof should be added in the s set, describing which 
++	 * dofs are constrained to a certain value (dirichlet boundary condition*/
++	DofInSSet(dof-1);
++	this->indexing.svalues[dof-1]=value;
++}
++/*}}}*/
++/*FUNCTION Node::RelaxConstraint{{{*/
++void  Node::RelaxConstraint(int dof){
++
++	/*Dof should be added to the f-set, and taken out of the s-set:*/
++	DofInFSet(dof-1);
++	this->indexing.svalues[dof-1]=NAN;
++}
++/*}}}*/
++/*FUNCTION Node::CreateVecSets {{{*/
++void  Node::CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s){
++
++	IssmDouble gvalue=1.0; //all nodes are in the g set;
++	IssmDouble value;
++
++	int i;
++
++	for(i=0;i<this->indexing.gsize;i++){
++
++		/*g set: */
++		pv_g->SetValue(indexing.gdoflist[i],gvalue,INS_VAL);
++		
++		/*f set: */
++		value=(IssmDouble)this->indexing.f_set[i];
++		pv_f->SetValue(indexing.gdoflist[i],value,INS_VAL);
++
++		/*s set: */
++		value=(IssmDouble)this->indexing.s_set[i];
++		pv_s->SetValue(indexing.gdoflist[i],value,INS_VAL);
++
++	}
++
++
++}
++/*}}}*/
++/*FUNCTION Node::CreateNodalConstraints{{{*/
++void  Node::CreateNodalConstraints(Vector* ys){
++
++	int i;
++	IssmDouble* values=NULL;
++	int count;
++
++	/*Recover values for s set and plug them in constraints vector: */
++	if(this->indexing.ssize){
++		values=xNew<IssmDouble>(this->indexing.ssize);
++		count=0;
++		for(i=0;i<this->indexing.gsize;i++){
++			if(this->indexing.s_set[i]){
++				values[count]=this->indexing.svalues[i];
++				_assert_(!xIsNan<IssmDouble>(values[count]));
++				count++;
++			}
++		}
++		
++		/*Add values into constraint vector: */
++		ys->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
++	}
++
++	/*Free ressources:*/
++	xDelete<IssmDouble>(values);
++
++
++}
++/*}}}*/
++/*FUNCTION Node::DofInSSet {{{*/
++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. */
++
++	this->indexing.f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
++	this->indexing.s_set[dof]=1;
++}
++/*}}}*/
++/*FUNCTION Node::DofInFSet {{{*/
++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. */
++
++	this->indexing.f_set[dof]=1; 
++	this->indexing.s_set[dof]=0;
++}
++/*}}}*/
++/*FUNCTION Node::FreezeDof{{{*/
++void  Node::FreezeDof(int dof){
++	
++	DofInSSet(dof-1); //with 0 displacement for this dof.
++
++}
++/*}}}*/
++/*FUNCTION Node::GetApproximation {{{*/
++int   Node::GetApproximation(){
++
++	int approximation;
++
++	/*recover parameters: */
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	return approximation;
++}
++/*}}}*/
++/*FUNCTION Node::GetConnectivity {{{*/
++int Node::GetConnectivity(){
++
++	Vertex*  vertex=NULL;
++	vertex=(Vertex*)hvertex->delivers();
++	return vertex->connectivity;
++}
++/*}}}*/
++/*FUNCTION Node::GetNumberOfDofs{{{*/
++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: */
++	
++	int i;
++	int numdofs=0;
++
++	if(approximation_enum==NoneApproximationEnum){
++		if (setenum==GsetEnum) numdofs=this->indexing.gsize;
++		else if (setenum==FsetEnum) numdofs=this->indexing.fsize;
++		else if (setenum==SsetEnum) numdofs=this->indexing.ssize;
++		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	}
++	else{
++		if(setenum==GsetEnum){
++			if(this->indexing.doftype){
++				numdofs=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if(this->indexing.doftype[i]==approximation_enum) numdofs++;
++				}
++			}
++			else numdofs=this->indexing.gsize;
++		}
++		else if (setenum==FsetEnum){
++			if(this->indexing.doftype){
++				numdofs=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if((this->indexing.doftype[i]==approximation_enum) && (this->indexing.f_set[i])) numdofs++;
++				}
++			}
++			else numdofs=this->indexing.fsize;
++		}
++		else if (setenum==SsetEnum){
++			if(this->indexing.doftype){
++				numdofs=0;
++				for(i=0;i<this->indexing.gsize;i++){
++					if((this->indexing.doftype[i]==approximation_enum) && (this->indexing.s_set[i])) numdofs++;
++				}
++			}
++			else numdofs=this->indexing.ssize;
++		}
++		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	}
++	return numdofs;
++}
++/*}}}*/
++/*FUNCTION Node::GetSigma {{{*/
++IssmDouble Node::GetSigma(){
++	Vertex* vertex=NULL;
++
++	vertex=(Vertex*)hvertex->delivers();
++	return vertex->sigma;
++}
++/*}}}*/
++/*FUNCTION Node::GetX {{{*/
++IssmDouble Node::GetX(){
++	Vertex* vertex=NULL;
++
++	vertex=(Vertex*)hvertex->delivers();
++	return vertex->x;
++}
++/*}}}*/
++/*FUNCTION Node::GetY {{{*/
++IssmDouble Node::GetY(){
++	Vertex* vertex=NULL;
++
++	vertex=(Vertex*)hvertex->delivers();
++	return vertex->y;
++}
++/*}}}*/
++/*FUNCTION Node::GetZ {{{*/
++IssmDouble Node::GetZ(){
++	Vertex* vertex=NULL;
++
++	vertex=(Vertex*)hvertex->delivers();
++	return vertex->z;
++}
++/*}}}*/
++/*FUNCTION Node::IsClone {{{*/
++int   Node::IsClone(){
++	
++	return indexing.clone;
++
++}
++/*}}}*/
++/*FUNCTION Node::IsOnBed {{{*/
++int   Node::IsOnBed(){
++
++	bool onbed;
++
++	/*recover parameters: */
++	inputs->GetInputValue(&onbed,MeshVertexonbedEnum);
++
++	return onbed;
++}
++/*}}}*/
++/*FUNCTION Node::IsGrounded {{{*/
++int   Node::IsGrounded(){
++
++	bool onsheet;
++
++	/*recover parameters: */
++	inputs->GetInputValue(&onsheet,MaskVertexongroundediceEnum);
++
++	return onsheet;
++}		
++/*}}}*/
++/*FUNCTION Node::IsFloating {{{*/
++int   Node::IsFloating(){
++	
++	bool onshelf;
++
++	/*recover parameters: */
++	inputs->GetInputValue(&onshelf,MaskVertexonfloatingiceEnum);
++
++	return onshelf;
++}
++/*}}}*/
++/*FUNCTION Node::IsOnSurface {{{*/
++int   Node::IsOnSurface(){
++
++	bool onsurface;
++
++	/*recover parameters: */
++	inputs->GetInputValue(&onsurface,MeshVertexonsurfaceEnum);
++
++	return onsurface;
++}
++/*}}}*/
++/*FUNCTION Node::InputUpdateFromVector(IssmDouble* vector, int name, int type){{{*/
++void  Node::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Node::InputUpdateFromVector(int* vector, int name, int type){{{*/
++void  Node::InputUpdateFromVector(int* vector, int name, int type){
++
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Node::InputUpdateFromVector(bool* vector, int name, int type){{{*/
++void  Node::InputUpdateFromVector(bool* vector, int name, int type){
++
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Node::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){{{*/
++void  Node::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
++
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Node::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){{{*/
++void  Node::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
++
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Node::InputUpdateFromVectorDakota(int* vector, int name, int type){{{*/
++void  Node::InputUpdateFromVectorDakota(int* vector, int name, int type){
++
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Node::InputUpdateFromVectorDakota(bool* vector, int name, int type){{{*/
++void  Node::InputUpdateFromVectorDakota(bool* vector, int name, int type){
++
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Node::InputUpdateFromConstant(IssmDouble constant, int name){{{*/
++void  Node::InputUpdateFromConstant(IssmDouble constant, int name){
++
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Node::InputUpdateFromConstant(int constant, int name){{{*/
++void  Node::InputUpdateFromConstant(int constant, int name){
++
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Node::InputUpdateFromConstant(bool constant, int name){{{*/
++void  Node::InputUpdateFromConstant(bool constant, int name){
++
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Node::UpdateSpcs {{{*/
++void   Node::UpdateSpcs(IssmDouble* ys){
++
++	int     count=0;
++	int     i;
++
++	count=0;
++	for(i=0;i<this->indexing.gsize;i++){
++		if(this->indexing.s_set[i]){
++			this->indexing.svalues[i]=ys[this->indexing.sdoflist[count]];
++			count++;
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION Node::VecMerge {{{*/
++void   Node::VecMerge(Vector* ug, IssmDouble* vector_serial,int setenum){
++
++	IssmDouble* values=NULL;
++	int*    indices=NULL;
++	int     count=0;
++	int     i;
++
++	if(setenum==FsetEnum){
++		if(this->indexing.fsize){
++			indices=xNew<int>(this->indexing.fsize);
++ 			values=xNew<IssmDouble>(this->indexing.fsize);
++
++			for(i=0;i<this->indexing.gsize;i++){
++				if(this->indexing.f_set[i]){
++					_assert_(vector_serial);
++					values[count]=vector_serial[this->indexing.fdoflist[count]];
++					indices[count]=this->indexing.gdoflist[i];
++					count++;
++				}
++			}
++
++			/*Add values into ug: */
++			ug->SetValues(this->indexing.fsize,indices,values,INS_VAL);
++		}
++	}
++	else if(setenum==SsetEnum){
++		if(this->indexing.ssize){
++			indices=xNew<int>(this->indexing.ssize);
++			values=xNew<IssmDouble>(this->indexing.ssize);
++
++			for(i=0;i<this->indexing.gsize;i++){
++				if(this->indexing.s_set[i]){
++					_assert_(vector_serial);
++					values[count]=vector_serial[this->indexing.sdoflist[count]];
++					indices[count]=this->indexing.gdoflist[i];
++					count++;
++				}
++			}
++
++			/*Add values into ug: */
++			ug->SetValues(this->indexing.ssize,indices,values,INS_VAL);
++		}
++	}
++	else _error2_("VecMerge can only merge from the s or f-set onto the g-set!");
++
++	/*Free ressources:*/
++	xDelete<IssmDouble>(values);
++	xDelete<int>(indices);
++}
++/*}}}*/
++/*FUNCTION Node::VecReduce {{{*/
++void   Node::VecReduce(Vector* vector, IssmDouble* ug_serial,int setenum){
++
++	IssmDouble* values=NULL;
++	int     count=0;
++	int     i;
++
++	if(setenum==FsetEnum){
++		if(this->indexing.fsize){
++ 			values=xNew<IssmDouble>(this->indexing.fsize);
++
++			for(i=0;i<this->indexing.gsize;i++){
++				if(this->indexing.f_set[i]){
++					_assert_(ug_serial);
++					values[count]=ug_serial[this->indexing.gdoflist[i]];
++					count++;
++				}
++			}
++
++			/*Add values into ug: */
++			vector->SetValues(this->indexing.fsize,this->indexing.fdoflist,values,INS_VAL);
++		}
++	}
++	else if(setenum==SsetEnum){
++		if(this->indexing.ssize){
++			values=xNew<IssmDouble>(this->indexing.ssize);
++
++			for(i=0;i<this->indexing.gsize;i++){
++				if(this->indexing.s_set[i]){
++					_assert_(ug_serial);
++					values[count]=ug_serial[this->indexing.gdoflist[i]];
++					count++;
++				}
++			}
++
++			/*Add values into ug: */
++			vector->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
++		}
++	}
++	else _error2_("VecReduce can only merge from the s or f-set onto the g-set!");
++
++	/*Free ressources:*/
++	xDelete<IssmDouble>(values);
++}
++/*}}}*/
++
++/* DofObject routines:*/
++/*FUNCTION Node::DistributeDofs{{{*/
++void  Node::DistributeDofs(int* pdofcount,int setenum){
++
++	int i;
++	extern int my_rank;
++	int dofcount;
++
++	dofcount=*pdofcount;
++
++	/*Initialize: */
++	if(setenum==FsetEnum) this->indexing.InitSet(setenum);
++	if(setenum==SsetEnum) this->indexing.InitSet(setenum);
++	
++		
++	/*For clone nodfs, don't distribute dofs, we will get them from another cpu in UpdateCloneDofs!*/
++	if(indexing.clone){
++		return;
++	}
++
++	/*This node should distribute dofs for setenum set (eg, f_set or s_set), go ahead: */
++
++	if(setenum==GsetEnum){
++		for(i=0;i<this->indexing.gsize;i++){
++			indexing.gdoflist[i]=dofcount+i;
++		}
++		dofcount+=this->indexing.gsize;
++	}
++	else if(setenum==FsetEnum){
++		for(i=0;i<this->indexing.fsize;i++){
++			indexing.fdoflist[i]=dofcount+i;
++		}
++		dofcount+=this->indexing.fsize;
++	}
++	else if(setenum==SsetEnum){
++		for(i=0;i<this->indexing.ssize;i++){
++			indexing.sdoflist[i]=dofcount+i;
++		}
++		dofcount+=this->indexing.ssize;
++	}
++	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++
++
++	/*Assign output pointers: */
++	*pdofcount=dofcount;
++
++}
++/*}}}*/
++/*FUNCTION Node::Off_setDofs{{{*/
++void  Node::OffsetDofs(int dofcount,int setenum){
++	
++	int i;
++	extern int my_rank;
++	
++	if(indexing.clone){
++		/*This node is a clone, don't off_set the dofs!: */
++		return;
++	}
++
++	/*This node should off_set the dofs, go ahead: */
++	if(setenum==GsetEnum){
++		for(i=0;i<this->indexing.gsize;i++) indexing.gdoflist[i]+=dofcount;
++	}
++	else if(setenum==FsetEnum){
++		for(i=0;i<this->indexing.fsize;i++) indexing.fdoflist[i]+=dofcount;
++	}
++	else if(setenum==SsetEnum){
++		for(i=0;i<this->indexing.ssize;i++) indexing.sdoflist[i]+=dofcount;
++	}
++	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++}
++/*}}}*/
++/*FUNCTION Node::ShowTrueDofs{{{*/
++void  Node::ShowTrueDofs(int* truedofs, int ncols,int setenum){
++
++	int j;
++	extern int my_rank;
++	
++	/*Are we a clone? : */
++	if(indexing.clone)return;
++
++	/*Ok, we are not a clone, just plug our dofs into truedofs: */
++	if(setenum==GsetEnum)for(j=0;j<this->indexing.gsize;j++)  *(truedofs+ncols*sid+j)=indexing.gdoflist[j];
++	else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++)  *(truedofs+ncols*sid+j)=indexing.fdoflist[j];
++	else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++)  *(truedofs+ncols*sid+j)=indexing.sdoflist[j];
++	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++
++}
++/*}}}*/
++/*FUNCTION Node::UpdateCloneDofs{{{*/
++void  Node::UpdateCloneDofs(int* alltruedofs,int ncols,int setenum){
++
++	int j;
++	extern int my_rank;
++	
++	/*If we are not a clone, don't update, we already have dofs!: */
++	if(indexing.clone==0)return;
++
++
++	/*Ok, we are a clone node, but we did not create the dofs for this node.
++	 *      * Therefore, our doflist is garbage right now. Go pick it up in the alltruedofs: */
++	if(setenum==GsetEnum)for(j=0;j<this->indexing.gsize;j++) indexing.gdoflist[j]=*(alltruedofs+ncols*sid+j);
++	else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++) indexing.fdoflist[j]=*(alltruedofs+ncols*sid+j);
++	else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++) indexing.sdoflist[j]=*(alltruedofs+ncols*sid+j);
++	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++
++}
++/*}}}*/
++/*FUNCTION Node::SetClone {{{*/
++void  Node::SetClone(int* minranks){
++
++	extern int my_rank;
++
++	if (minranks[sid]==my_rank){
++		indexing.clone=0;
++	}
++	else{
++		/*!there is a cpu with lower rank that has the same node, 
++		therefore, I am a clone*/
++		indexing.clone=1; 	
++	}
++
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.h	(revision 12821)
+@@ -0,0 +1,37 @@
++/*!\file Segment.h
++ * \brief: header file for node object
++ */
++
++#ifndef _SEGMENT_H_
++#define _SEGMENT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Object.h"
++/*}}}*/
++
++class Segment: public Object{
++
++	public:
++		int eid;
++		IssmDouble x1;
++		IssmDouble y1;
++		IssmDouble x2;
++		IssmDouble y2;
++
++		/*Segment constructors, destructors {{{*/
++		Segment();
++		Segment(int eid,IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2);
++		~Segment();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++};
++
++#endif  /* _SEGMENT_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.cpp	(revision 12821)
+@@ -0,0 +1,95 @@
++/*! \file Contour.c
++ *  \sa Contour.h
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <string.h>
++#include "./objects.h"
++#include "../include/include.h"
++#include "../io/io.h"
++
++/*Contour constructors and destructors:*/
++/*FUNCTION Contour::Contour() default constructor {{{*/
++Contour::Contour(){
++	this->id=0;
++	this->nods=0;
++	this->x=NULL;
++	this->y=NULL;
++	this->closed=false;
++}
++/*}}}*/
++/*FUNCTION Contour::Contour(int pid, int nods, IssmDouble* x, IssmDouble* y,bool closed) {{{*/
++Contour::Contour(int pid,int pnods, IssmDouble* px, IssmDouble* py,bool pclosed){
++	
++	this->id=pid;
++	this->nods=pnods;
++	this->closed=pclosed;
++	if(nods){
++		this->x=xNew<IssmDouble>(nods);
++		xMemCpy<IssmDouble>(this->x,px,nods);
++		this->y=xNew<IssmDouble>(nods);
++		xMemCpy<IssmDouble>(this->y,py,nods);
++	}
++}
++/*}}}*/
++/*FUNCTION Contour::Contour() default constructor {{{*/
++Contour::~Contour(){
++	xDelete<IssmDouble>(this->x);
++	xDelete<IssmDouble>(this->y);
++}
++/*}}}*/
++
++
++/*Object virtual function resolutoin: */
++/*FUNCTION Contour::Echo(){{{*/
++void Contour::Echo(void){
++
++	int i;
++
++	_printLine_("Contour: " << id);
++	_printLine_("   nods: " << nods);
++	_printLine_("   closed: " << (closed?"true":"false"));
++	if(nods){
++	        _printLine_("   x,y:");
++		for(i=0;i<nods;i++){
++		        _printLine_(i << ": " << x[i] << "|" << y[i]);
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION Contour::DeepEcho(){{{*/
++void Contour::DeepEcho(void){
++	this->Echo();
++}
++/*}}}*/
++/*FUNCTION Contour::Id(){{{*/
++int Contour::Id(void){
++	return id;
++}
++/*}}}*/
++/*FUNCTION Contour::MyRank{{{*/
++int    Contour::MyRank(void){ 
++	extern int my_rank;
++
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Contour::ObjectEnum{{{*/
++int Contour::ObjectEnum(void){
++
++	return ContourEnum;
++
++}
++/*}}}*/
++/*FUNCTION Contour::copy {{{*/
++Object* Contour::copy() {
++
++	return new Contour(*this); 
++
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h	(revision 12821)
+@@ -0,0 +1,113 @@
++/*!\file Node.h
++ * \brief: header file for node object
++ */
++
++#ifndef _NODE_H_
++#define _NODE_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Object.h"
++#include "../shared/shared.h"
++class  Inputs;
++class  Hook;
++class  DofIndexing;
++class  IoModel;
++class  DataSet;
++class  Vertices;
++class  Vector;
++class  Matrix;
++#include "./Update.h"
++/*}}}*/
++
++class Node: public Object ,public Update{
++
++	public: 
++
++		int	    id;  //unique arbitrary id.
++		int     sid; //sid for "serial" id, ie the rank of this node in the nodes dataset, if the dataset was serial on 1 cpu.
++				
++		DofIndexing    indexing;
++		Hook*          hvertex;
++		Inputs*        inputs; //properties of this node
++		int            analysis_type;
++		IssmDouble         coord_system[3][3];
++
++		/*Node constructors, destructors {{{*/
++		Node();
++		Node(int node_id,int node_sid, int vertex_id,int io_index, IoModel* iomodel,int analysis_type);
++		~Node();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy(){_error2_("Not implemented yet (similar to Elements)");};
++		/*}}}*/
++		/*Update virtual functions definitions: {{{*/
++		
++		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVector(int* vector, int name, int type);
++		void  InputUpdateFromVector(bool* vector, int name, int type);
++		void  InputUpdateFromMatrixDakota(IssmDouble* matrix,int nrows, int ncols, int name, int type);
++		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
++		void  InputUpdateFromConstant(IssmDouble constant, int name);
++		void  InputUpdateFromConstant(int constant, int name);
++		void  InputUpdateFromConstant(bool constant, int name);
++		void  InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("Not implemented yet!");}
++		/*}}}*/
++		/*Node numerical routines {{{*/
++		void   Configure(DataSet* nodes,Vertices* vertices);
++		void   CreateNodalConstraints(Vector* ys);
++		void   SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
++		int    Sid(void); 
++		int    GetVertexDof(void);
++		int    GetVertexId(void);
++#ifdef _HAVE_DIAGNOSTIC_
++		void   GetCoordinateSystem(IssmDouble* coord_system_out);
++#endif
++		void   SetVertexDof(int in_dof);
++		bool   InAnalysis(int analysis_type);
++		int    GetApproximation();
++		int    GetNumberOfDofs(int approximation_enum,int setenum);
++		int    IsClone();
++		void   ApplyConstraint(int dof,IssmDouble value);
++		void   RelaxConstraint(int dof);
++		void   DofInSSet(int dof);
++		void   DofInFSet(int dof);
++		int    GetDof(int dofindex,int setenum);
++		void   CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s);
++		int    GetConnectivity();
++		void   GetDofList(int* poutdoflist,int approximation_enum,int setenum);
++		void   GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
++		int    GetDofList1(void);
++		int    GetSidList(void);
++		IssmDouble GetX();
++		IssmDouble GetY();
++		IssmDouble GetZ();
++		IssmDouble GetSigma();
++		int    IsOnBed();
++		int    IsOnSurface();
++		void   FreezeDof(int dof);
++		int    IsFloating();
++		int    IsGrounded();
++		void   UpdateSpcs(IssmDouble* ys);
++		void   VecMerge(Vector* ug, IssmDouble* vector_serial,int setenum);
++		void   VecReduce(Vector* vector, IssmDouble* ug_serial,int setnum);
++		
++		/*}}}*/
++		/*Dof Object routines {{{*/
++		void  DistributeDofs(int* pdofcount,int setenum);
++		void  OffsetDofs(int dofcount,int setenum);
++		void  ShowTrueDofs(int* truerows,int ncols,int setenum);
++		void  UpdateCloneDofs(int* alltruerows,int ncols,int setenum);
++		void  SetClone(int* minranks);
++		/*}}}*/
++};
++
++#endif  /* _NODE_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Object.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Object.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Object.h	(revision 12821)
+@@ -0,0 +1,27 @@
++/*
++ * Object.h:
++ * \brief prototype for abstract Object class
++ * \file Object.h
++ * This prototype describes the Object class. This is an abstract class, parent 
++ * to any other objects (Quad, Tria, Node , etc ...), that can be included in a 
++ * DataSet.
++ */
++
++
++#ifndef _OBJECT_H_
++#define _OBJECT_H_
++
++class Object {
++
++	public: 
++
++		virtual       ~Object() {};
++		virtual void  Echo()=0;
++		virtual void  DeepEcho()=0;
++		virtual int   Id()=0;
++		virtual int   MyRank()=0;
++		virtual int   ObjectEnum()=0;
++		virtual Object* copy()=0;
++
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.cpp	(revision 12821)
+@@ -0,0 +1,218 @@
++/*!\file Vertex.c
++ * \brief: implementation of the Vertex object
++ */
++
++/*Include files: {{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <string.h>
++#include "./objects.h"
++#include "../EnumDefinitions/EnumDefinitions.h"
++#include "../shared/shared.h"
++#include "../include/include.h"
++/*}}}*/
++
++/*Vertex constructors and destructor:*/
++/*FUNCTION Vertex::Vertex() {{{*/
++Vertex::Vertex(){
++	return;
++}
++/*}}}*/
++/*FUNCTION Vertex::Vertex(int vertex_id, IssmDouble vertex_x, IssmDouble vertex_y, IssmDouble vertex_z, IssmDouble vertex_sigma){{{*/
++Vertex::Vertex(int vertex_id, int vertex_sid,IssmDouble vertex_x, IssmDouble vertex_y, IssmDouble vertex_z, IssmDouble vertex_sigma,int vertex_connectivity){
++	this->Init(vertex_id, vertex_sid,vertex_x, vertex_y, vertex_z, vertex_sigma,vertex_connectivity);
++}
++/*}}}*/
++/*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){
++
++	_assert_(iomodel->Data(MeshXEnum) && iomodel->Data(MeshYEnum) && iomodel->Data(MeshZEnum));
++	_assert_(iomodel->Data(BedEnum) && iomodel->Data(ThicknessEnum) && iomodel->numbernodetoelementconnectivity);
++
++	this->Init(vertex_id, vertex_sid, iomodel->Data(MeshXEnum)[i],iomodel->Data(MeshYEnum)[i],iomodel->Data(MeshZEnum)[i],(iomodel->Data(MeshZEnum)[i]-iomodel->Data(BedEnum)[i])/(iomodel->Data(ThicknessEnum)[i]),iomodel->numbernodetoelementconnectivity[i]);
++
++}
++/*}}}*/
++/*FUNCTION Vertex::~Vertex() {{{*/
++Vertex::~Vertex(){
++	return;
++}
++/*}}}*/
++/*FUNCTION Vertex::Init{{{*/
++void Vertex::Init(int vertex_id, int vertex_sid,IssmDouble vertex_x, IssmDouble vertex_y, IssmDouble vertex_z, IssmDouble vertex_sigma,int vertex_connectivity){
++
++	/*all the initialization has been done by the initializer, just fill in the id: */
++	this->id=vertex_id;
++	this->sid=vertex_sid;
++	this->x=vertex_x;
++	this->y=vertex_y;
++	this->z=vertex_z;
++	this->sigma=vertex_sigma;
++	this->connectivity=vertex_connectivity;
++	this->dof=UNDEF;
++
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Vertex::Echo{{{*/
++void Vertex::Echo(void){
++
++	_printLine_("Vertex:");
++	_printLine_("   id: " << id);
++	_printLine_("   sid: " << sid);
++	_printLine_("   x: " << x);
++	_printLine_("   y: " << y);
++	_printLine_("   z: " << z);
++	_printLine_("   sigma: " << sigma);
++	_printLine_("   connectivity: " << connectivity);
++	_printLine_("   dof: " << dof);
++	_printLine_("   clone: " << clone);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION Vertex::DeepEcho{{{*/
++void Vertex::DeepEcho(void){
++	this->Echo();
++}
++/*}}}*/
++/*FUNCTION Vertex::Id{{{*/
++int    Vertex::Id(void){ return id; }
++/*}}}*/
++/*FUNCTION Vertex::MyRank {{{*/
++int    Vertex::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Vertex::ObjectEnum{{{*/
++int Vertex::ObjectEnum(void){
++
++	return VertexEnum;
++
++}
++/*}}}*/
++/*FUNCTION Vertex::copy {{{*/
++Object* Vertex::copy() {
++
++	return new Vertex(*this); 
++
++}
++/*}}}*/
++
++/* DofObject routines: */
++/*FUNCTION Vertex::DistributeDofs{{{*/
++void  Vertex::DistributeDofs(int* pdofcount){
++
++	int i;
++	extern int my_rank;
++	int dofcount;
++
++	dofcount=*pdofcount;
++	
++	if(this->clone){
++		/*This vertex is a clone! Don't distribute dofs, it will get them from another cpu!*/
++		return;
++	}
++
++	/*This vertex should distribute his dof, go ahead: */
++	this->dof=dofcount;
++	dofcount++;
++
++	/*Assign output pointers: */
++	*pdofcount=dofcount;
++
++}
++/*}}}*/
++/*FUNCTION Vertex::OffsetDofs{{{*/
++void  Vertex::OffsetDofs(int dofcount){
++	
++	int i;
++	extern int my_rank;
++	
++	if(this->clone){
++		/*This vertex is a clone, don't offset the dofs!: */
++		return;
++	}
++
++	/*This vertex should offset his dof, go ahead: */
++	this->dof+=dofcount;
++}
++/*}}}*/
++/*FUNCTION Vertex::ShowTrueDofs{{{*/
++void  Vertex::ShowTrueDofs(int* truedofs){
++
++	int j;
++	extern int my_rank;
++	
++	/*Are we a clone? : */
++	if(this->clone)return;
++
++	/*Ok, we are not a clone, just plug our dof into truedofs: */
++	truedofs[this->id-1]=this->dof;
++
++}
++/*}}}*/
++/*FUNCTION Vertex::UpdateCloneDofs{{{*/
++void  Vertex::UpdateCloneDofs(int* alltruedofs){
++
++	int j;
++	extern int my_rank;
++	
++	/*If we are not a clone, don't update, we already have dofs!: */
++	if(this->clone==0)return;
++
++	/*Ok, we are a clone node, but we did not create the dof for this vertex 
++	 * Therefore, our dof is garbage right now. Go pick it up in the alltruedofs: */
++	this->dof=alltruedofs[id-1];
++}
++/*}}}*/
++/*FUNCTION Vertex::SetClone {{{*/
++void  Vertex::SetClone(int* minranks){
++
++	extern int my_rank;
++
++	if (minranks[id-1]==my_rank){
++		this->clone=0;
++	}
++	else{
++		/*!there is a cpu with lower rank that has the same vertex, 
++		therefore, I am a clone*/
++		this->clone=1; 	
++	}
++
++}
++/*}}}*/
++
++/*Vertex management: */
++/*FUNCTION Vertex::Connectivity{{{*/
++int    Vertex::Connectivity(void){return connectivity;}
++/*}}}*/
++/*FUNCTION Vertex::Sid{{{*/
++int    Vertex::Sid(void){ return sid; }
++/*}}}*/
++/*FUNCTION Vertex::UpdateVertexPosition {{{*/
++void  Vertex::UpdatePosition(Vector* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed){
++
++	IssmDouble oldz,newz;
++	IssmDouble dt,velz;
++
++	/*Get time stepping*/
++	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++
++	/*sigma remains constant. z=bed+sigma*thickness*/
++	oldz = this->z;
++	newz = bed[this->dof]+sigma*thickness[this->dof];
++	velz = (newz-oldz)/dt;
++	this->z = newz;
++
++	/*put vz in vector*/
++	vz->SetValue(this->dof,velz,INS_VAL);
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp	(revision 12821)
+@@ -0,0 +1,95 @@
++/*!\file ExponentialVariogram.c
++ * \brief: implementation of the ExponentialVariogram object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++
++/*ExponentialVariogram constructors and destructor*/
++/*FUNCTION ExponentialVariogram::ExponentialVariogram(){{{*/
++ExponentialVariogram::ExponentialVariogram(){
++	this->nugget = 0.2;
++	this->sill   = 1;
++	this->range  = SQRT3;
++	return;
++}
++/*}}}*/
++/*FUNCTION ExponentialVariogram::ExponentialVariogram(Options* options){{{*/
++ExponentialVariogram::ExponentialVariogram(Options* options){
++
++	/*Defaults*/
++	this->nugget = 0.2;
++	this->sill   = 1;
++	this->range  = SQRT3;
++
++	/*Overwrite from options*/
++	if(options->GetOption("nugget")) options->Get(&this->nugget,"nugget");
++	if(options->GetOption("sill"))   options->Get(&this->sill,"sill");
++	if(options->GetOption("range"))  options->Get(&this->range,"range");
++
++	/*Checks*/
++	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
++}
++/*}}}*/
++/*FUNCTION ExponentialVariogram::~ExponentialVariogram(){{{*/
++ExponentialVariogram::~ExponentialVariogram(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION ExponentialVariogram::Echo {{{*/
++void ExponentialVariogram::Echo(void){
++	_printLine_("ExponentialVariogram");
++	_printLine_("   nugget: " << this->nugget);
++	_printLine_("   sill  : " << this->sill);
++	_printLine_("   range : " << this->range);
++}
++/*}}}*/
++
++/*Variogram function*/
++/*FUNCTION ExponentialVariogram::Covariance{{{*/
++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)
++	 * so
++	 *    C(h) = sill - gamma                                            */
++	double h,a,cova;
++
++	/*Calculate length*/
++	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
++
++	/*If h is too small, return sill*/
++	if(h<0.0000001) return sill;
++
++	/*compute covariance*/
++	a     = 1./3.;
++	cova = (sill-nugget)*exp(-h/(a*range));
++	return cova;
++}
++/*}}}*/
++/*FUNCTION ExponentialVariogram::SemiVariogram{{{*/
++double ExponentialVariogram::SemiVariogram(double deltax,double deltay){
++	/*http://en.wikipedia.org/wiki/Variogram*/
++	double h,a,gamma;
++
++	/*Calculate length*/
++	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
++
++	/*return semi-variogram*/
++	a     = 1./3.;
++	gamma = (sill-nugget)*(1-exp(-h/(a*range))) + nugget;
++	return gamma;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.h	(revision 12821)
+@@ -0,0 +1,66 @@
++
++#ifndef _QUADTREE_H
++#define _QUADTREE_H
++
++class Observation;
++
++class Quadtree{
++
++	private:
++		/* A quadtree box contains up to 4 points (locations). 4 new quadtree boxes are
++		 * created if a fifth point is added to the same box. A Quadtree box is therefore
++		 * composed of EITHER:
++		 * - up to 4 vertices
++		 * - 4 "sub" quadtree boxes*/
++
++		class QuadtreeBox: public Object{ 
++			public:
++				int    nbitems; // number of current vertices in the box
++				double xcenter; // x position of the center (double)
++				double ycenter; // x position of the center (double)
++				double length;  // width of the box
++				union{
++					QuadtreeBox *box[4];
++					Observation *obs[4];
++				};
++
++				/*Object functions (Needed because the Quadtree uses a Container*/
++				void    Echo();
++				void    DeepEcho()  {_error2_("not implemented yet"); };
++				int     Id()        {_error2_("not implemented yet"); };
++				int     MyRank()    {_error2_("not implemented yet"); };
++				int     ObjectEnum(){_error2_("not implemented yet"); };
++				Object *copy()      {_error2_("not implemented yet"); };
++
++				/*Methods*/
++				int          IsWithinRange(double  x,double y,double range);
++				void         RangeSearch(int *indices,int *pnobs,double x,double y,double range);
++				void         WriteObservations(int *indices,int *pnobs);
++
++		};
++
++		/*Quadtree private Fields*/
++		DataSet* boxcontainer;
++
++	public:
++		int          MaxDepth;          // maximum number of subdivision
++		QuadtreeBox *root;              // main box
++		int          NbQuadtreeBox;     // total number of boxes
++		int          NbObs;             // number of points
++
++		Quadtree();
++		Quadtree(double xmin,double xmax,double ymin,double ymax,int maxdepth_in);
++		~Quadtree();
++		void         Add(Observation *observation);
++		void         AddAndAverage(double x,double y,double value);
++		void         ClosestObs(int *pindex,double x,double y);
++		void         DeepEcho(void);
++		void         Echo(void);
++		void         IntergerCoordinates(int *xi,int *yi,double x,double y);
++		QuadtreeBox *NewQuadtreeBox(double xcenter,double ycenter,double length);
++		QuadtreeBox *NewQuadtreeBox(QuadtreeBox* master,int index);
++		void         QuadtreeDepth(int *A,int xi,int yi);
++		void         QuadtreeDepth2(int *A,int xi,int yi);
++		void         RangeSearch(int **pindices,int *pnobs,double x,double y,double range);
++};
++#endif //_QUADTREE_H
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.h	(revision 12821)
+@@ -0,0 +1,35 @@
++/*! \file Observation.h 
++ *  \brief: header file for Observation object
++ */
++
++#ifndef _OBSERVATION_H_
++#define _OBSERVATION_H_
++
++#include "../Object.h"
++
++class Observation: public Object{
++
++	public:
++		double x,y;
++		int    xi,yi;
++		int    index;
++		double weight;
++		double value;
++
++		/*Observation constructors, destructors*/
++		Observation();
++		Observation(double x_in,double y_in,int xi_in,int yi_in,int index_in,double value_in);
++		~Observation();
++
++		/*Object virtual functions definitions*/
++		void    Echo();
++		void    DeepEcho()  {_error2_("Not implemented yet"); };
++		int     Id()        {_error2_("Not implemented yet"); };
++		int     MyRank()    {_error2_("Not implemented yet"); };
++		int     ObjectEnum(){_error2_("Not implemented yet"); };
++		Object *copy()      {_error2_("Not implemented yet"); };
++
++		/*Management*/
++		void WriteXYObs(double* px,double* py,double* pobs);
++};
++#endif  /* _OBSERVATION_*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp	(revision 12821)
+@@ -0,0 +1,99 @@
++/*!\file GaussianVariogram.c
++ * \brief: implementation of the GaussianVariogram object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++
++/*GaussianVariogram constructors and destructor*/
++/*FUNCTION GaussianVariogram::GaussianVariogram(){{{*/
++GaussianVariogram::GaussianVariogram(){
++	this->nugget = 0.2;
++	this->sill   = 1;
++	this->range  = SQRT3;
++	return;
++}
++/*}}}*/
++/*FUNCTION GaussianVariogram::GaussianVariogram(Options* options){{{*/
++GaussianVariogram::GaussianVariogram(Options* options){
++
++	/*Defaults*/
++	this->nugget = 0.2;
++	this->sill   = 1;
++	this->range  = SQRT3;
++
++	/*Overwrite from options*/
++	if(options->GetOption("nugget")) options->Get(&this->nugget,"nugget");
++	if(options->GetOption("sill"))   options->Get(&this->sill,"sill");
++	if(options->GetOption("range"))  options->Get(&this->range,"range");
++
++	/*Checks*/
++	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
++}
++/*}}}*/
++/*FUNCTION GaussianVariogram::~GaussianVariogram(){{{*/
++GaussianVariogram::~GaussianVariogram(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION GaussianVariogram::Echo {{{*/
++void GaussianVariogram::Echo(void){
++	_printLine_("GaussianVariogram");
++	_printLine_("   nugget: " << this->nugget);
++	_printLine_("   sill  : " << this->sill);
++	_printLine_("   range : " << this->range);
++}
++/*}}}*/
++
++/*Variogram function*/
++/*FUNCTION GaussianVariogram::Covariance{{{*/
++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)
++	 * so
++	 *    C(h) = sill - gamma                                            */
++	double h2,a,cova;
++
++	/*Calculate length square*/
++	h2=pow(deltax,2.)+pow(deltay,2.);
++
++	/*If h is too small, return sill*/
++	if(h2<0.0000001) return sill;
++
++	/*compute covariance*/
++	a     = 1./3.;
++	cova = (sill-nugget)*exp(-h2/(a*range*range));
++
++	return cova;
++}
++/*}}}*/
++/*FUNCTION GaussianVariogram::SemiVariogram{{{*/
++double GaussianVariogram::SemiVariogram(double deltax,double deltay){
++	/*http://en.wikipedia.org/wiki/Variogram*/
++	double h2,a,gamma;
++
++	/*Calculate length square*/
++	h2=pow(deltax,2.)+pow(deltay,2.);
++
++	/*return semi-variogram*/
++	a     = 1./3.;
++	gamma = (sill-nugget)*(1.-exp(-h2/(a*range*range))) + nugget;
++
++	//if(h2>1000*1000) _printLine_("gamma = " << gamma << " h= " << sqrt(h2));
++	_printLine_("h = " << sqrt(h2) << " gamma = " << gamma);
++	return gamma;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp	(revision 12821)
+@@ -0,0 +1,98 @@
++/*!\file SphericalVariogram.c
++ * \brief: implementation of the SphericalVariogram object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++
++/*SphericalVariogram constructors and destructor*/
++/*FUNCTION SphericalVariogram::SphericalVariogram(){{{*/
++SphericalVariogram::SphericalVariogram(){
++	this->nugget = 0.2;
++	this->sill   = 1;
++	this->range  = SQRT3;
++	return;
++}
++/*}}}*/
++/*FUNCTION SphericalVariogram::SphericalVariogram(Options* options){{{*/
++SphericalVariogram::SphericalVariogram(Options* options){
++
++	/*Defaults*/
++	this->nugget = 0.2;
++	this->sill   = 1;
++	this->range  = SQRT3;
++
++	/*Overwrite from options*/
++	if(options->GetOption("nugget")) options->Get(&this->nugget,"nugget");
++	if(options->GetOption("sill"))   options->Get(&this->sill,"sill");
++	if(options->GetOption("range"))  options->Get(&this->range,"range");
++
++	/*Checks*/
++	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
++}
++/*}}}*/
++/*FUNCTION SphericalVariogram::~SphericalVariogram(){{{*/
++SphericalVariogram::~SphericalVariogram(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION SphericalVariogram::Echo {{{*/
++void SphericalVariogram::Echo(void){
++	_printLine_("SphericalVariogram");
++	_printLine_("   nugget: " << this->nugget);
++	_printLine_("   sill  : " << this->sill);
++	_printLine_("   range : " << this->range);
++}
++/*}}}*/
++
++/*Variogram function*/
++/*FUNCTION SphericalVariogram::Covariance{{{*/
++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)
++	 * so
++	 *    C(h) = sill - gamma                                            */
++	double h,cova;
++
++	/*Calculate length square*/
++	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
++
++	/*return covariance*/
++	if(h<=range)
++	 cova = (sill-nugget)*(1 - (3*h)/(2*range) + pow(h,3.)/(2*pow(range,3.)) );
++	else
++	 cova = 0.;
++
++	return cova;
++}
++/*}}}*/
++/*FUNCTION SphericalVariogram::SemiVariogram{{{*/
++double SphericalVariogram::SemiVariogram(double deltax,double deltay){
++	/*http://en.wikipedia.org/wiki/Variogram*/
++	double h,gamma;
++
++	/*Calculate length square*/
++	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
++
++	/*return semi-variogram*/
++	if(h<=range)
++	 gamma = (sill-nugget)*( (3*h)/(2*range) - pow(h,3.)/(2*pow(range,3.)) ) + nugget;
++	else
++	 gamma = sill;
++
++	return gamma;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h	(revision 12821)
+@@ -0,0 +1,35 @@
++/*! \file ExponentialVariogram.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++#ifndef _EXPONENTIALVARIOGRAM_H_
++#define _EXPONENTIALVARIOGRAM_H_
++
++/*Headers:*/
++#include "./Variogram.h"
++
++class ExponentialVariogram: public Variogram{
++
++	public:
++		double nugget; //The height of the jump of the semivariogram at the discontinuity at the origin
++		double sill;   //Limit of the variogram tending to infinity lag distances
++		double range;  //The distance in which the difference of the variogram from the sill becomes negligible
++
++		/*ExponentialVariogram constructors, destructors*/
++		ExponentialVariogram();
++		ExponentialVariogram(Options* options);
++		~ExponentialVariogram();
++
++		/*Object virtual functions definitions*/
++		void  Echo();
++		void  DeepEcho(){_error2_("Not implemented yet");};
++		int   Id(){_error2_("Not implemented yet");}; 
++		int   MyRank(){_error2_("Not implemented yet");};
++		int   ObjectEnum(){_error2_("Not implemented yet");};
++		Object* copy(){_error2_("Not implemented yet");};
++
++		/*Variogram functions*/
++		double SemiVariogram(double deltax,double deltay);
++		double Covariance(double deltax,double deltay);
++};
++#endif  /* _EXPONENTIALVARIOGRAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp	(revision 12821)
+@@ -0,0 +1,94 @@
++/*!\file PowerVariogram.c
++ * \brief: implementation of the PowerVariogram object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++
++/*PowerVariogram constructors and destructor*/
++/*FUNCTION PowerVariogram::PowerVariogram(){{{*/
++PowerVariogram::PowerVariogram(){
++	this->nugget = 0.2;
++	this->slope  = 1.;
++	this->power  = 1.;
++	return;
++}
++/*}}}*/
++/*FUNCTION PowerVariogram::PowerVariogram(Options* options){{{*/
++PowerVariogram::PowerVariogram(Options* options){
++
++	/*Defaults*/
++	this->nugget = 0.2;
++	this->slope  = 1.;
++	this->power  = 1.;
++
++	/*Overwrite from options*/
++	if(options->GetOption("nugget")) options->Get(&this->nugget,"nugget");
++	if(options->GetOption("slope"))  options->Get(&this->slope,"slope");
++	if(options->GetOption("power"))  options->Get(&this->power,"power");
++
++	/*Checks*/
++	if(power<=0 || power>=2) _error2_("power must be betwwen 0 and 2 (0 < power < 2)");
++	if(slope<=0) _error2_("slope must be positive");
++}
++/*}}}*/
++/*FUNCTION PowerVariogram::~PowerVariogram(){{{*/
++PowerVariogram::~PowerVariogram(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION PowerVariogram::Echo {{{*/
++void PowerVariogram::Echo(void){
++	_printLine_("PowerVariogram");
++	_printLine_("   nugget: " << this->nugget);
++	_printLine_("   slope : " << this->slope);
++	_printLine_("   power : " << this->power);
++}
++/*}}}*/
++
++/*Variogram function*/
++/*FUNCTION PowerVariogram::Covariance{{{*/
++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)
++	 * so
++	 *    C(h) = sill - gamma                                            */
++	double h,cova;
++
++	/*Calculate length square*/
++	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
++
++	/*return covariance*/
++	cova = 9999. - this->slope*pow(h,this->power);
++
++	return cova;
++}
++/*}}}*/
++/*FUNCTION PowerVariogram::SemiVariogram{{{*/
++double PowerVariogram::SemiVariogram(double deltax,double deltay){
++	/*http://en.wikipedia.org/wiki/Variogram*/
++	double h,gamma;
++
++	/*Calculate length square*/
++	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
++
++	/*return semi-variogram*/
++	gamma = this->nugget + this->slope*pow(h,this->power);
++
++	//if(h>1000) _printLine_("gamma = " << gamma << " h=" << h);
++	return gamma;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h	(revision 12821)
+@@ -0,0 +1,35 @@
++/*! \file GaussianVariogram.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++#ifndef _GAUSSIANVARIOGRAM_H_
++#define _GAUSSIANVARIOGRAM_H_
++
++/*Headers:*/
++#include "./Variogram.h"
++
++class GaussianVariogram: public Variogram{
++
++	public:
++		double nugget; //The height of the jump of the semivariogram at the discontinuity at the origin
++		double sill;   //Limit of the variogram tending to infinity lag distances
++		double range;  //The distance in which the difference of the variogram from the sill becomes negligible
++
++		/*GaussianVariogram constructors, destructors*/
++		GaussianVariogram();
++		GaussianVariogram(Options* options);
++		~GaussianVariogram();
++
++		/*Object virtual functions definitions*/
++		void  Echo();
++		void  DeepEcho(){_error2_("Not implemented yet");};
++		int   Id(){_error2_("Not implemented yet");}; 
++		int   MyRank(){_error2_("Not implemented yet");};
++		int   ObjectEnum(){_error2_("Not implemented yet");};
++		Object* copy(){_error2_("Not implemented yet");};
++
++		/*Variogram functions*/
++		double SemiVariogram(double deltax,double deltay);
++		double Covariance(double deltax,double deltay);
++};
++#endif  /* _GAUSSIANVARIOGRAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h	(revision 12821)
+@@ -0,0 +1,35 @@
++/*! \file SphericalVariogram.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++#ifndef _SPHERICALVARIOGRAM_H_
++#define _SPHERICALVARIOGRAM_H_
++
++/*Headers:*/
++#include "./Variogram.h"
++
++class SphericalVariogram: public Variogram{
++
++	public:
++		double nugget; //The height of the jump of the semivariogram at the discontinuity at the origin
++		double sill;   //Limit of the variogram tending to infinity lag distances
++		double range;  //The distance in which the difference of the variogram from the sill becomes negligible
++
++		/*SphericalVariogram constructors, destructors*/
++		SphericalVariogram();
++		SphericalVariogram(Options* options);
++		~SphericalVariogram();
++
++		/*Object virtual functions definitions*/
++		void  Echo();
++		void  DeepEcho(){_error2_("Not implemented yet");};
++		int   Id(){_error2_("Not implemented yet");}; 
++		int   MyRank(){_error2_("Not implemented yet");};
++		int   ObjectEnum(){_error2_("Not implemented yet");};
++		Object* copy(){_error2_("Not implemented yet");};
++
++		/*Variogram functions*/
++		double SemiVariogram(double deltax,double deltay);
++		double Covariance(double deltax,double deltay);
++};
++#endif  /* _SPHERICALVARIOGRAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.h	(revision 12821)
+@@ -0,0 +1,35 @@
++/*! \file PowerVariogram.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++#ifndef _POWERVARIOGRAM_H_
++#define _POWERVARIOGRAM_H_
++
++/*Headers:*/
++#include "./Variogram.h"
++
++class PowerVariogram: public Variogram{
++
++	public:
++		double nugget; //The height of the jump of the semivariogram at the discontinuity at the origin
++		double slope;  
++		double power; 
++
++		/*PowerVariogram constructors, destructors*/
++		PowerVariogram();
++		PowerVariogram(Options* options);
++		~PowerVariogram();
++
++		/*Object virtual functions definitions*/
++		void  Echo();
++		void  DeepEcho(){_error2_("Not implemented yet");};
++		int   Id(){_error2_("Not implemented yet");}; 
++		int   MyRank(){_error2_("Not implemented yet");};
++		int   ObjectEnum(){_error2_("Not implemented yet");};
++		Object* copy(){_error2_("Not implemented yet");};
++
++		/*Variogram functions*/
++		double SemiVariogram(double deltax,double deltay);
++		double Covariance(double deltax,double deltay);
++};
++#endif  /* _POWERVARIOGRAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.cpp	(revision 12821)
+@@ -0,0 +1,607 @@
++#include "../objects.h"
++
++/*DOCUMENTATION What is a Quadtree? {{{
++ * A Quadtree is a very simple way to group vertices according
++ * to their locations. A square that holds all the points of the mesh
++ * (or the geometry) is divided into 4 boxes. As soon as one box
++ * hold more than 4 vertices, it is divided into 4 new boxes, etc...
++ * There cannot be more than MAXDEEP (=30) subdivision.
++ * This process is like a Dichotomy in dimension 2
++ *
++ *  + - -  -    - -    -    - - + -   - + - + - + - -     - - +
++ *  |                           |       |   | X |             |
++ *                                      + - + - +
++ *  |                           |       |   |   |             |
++ *                              + -   - + - + - +             +
++ *  |                           |       |       |             |
++ *                         
++ *  |                           |       |       |             |
++ *  + - -  -    - -    -    - - + -   - + -   - + - -     - - +
++ *  |                           |               |             |
++ *                         
++ *  |                           |               |             |
++ *                         
++ *  |                           |               |             |
++ *  |                           |               |             |
++ *  + - -  -    - -    -    - - + -   -   -   - + - -     - - +
++ *  |                           |                             |
++ *                         
++ *  |                           |                             |
++ *                         
++ *  |                           |                             |
++ *                         
++ *  |                           |                             |
++ *  |                           |                             |
++ *  |                           |                             |
++ *  |                           |                             |
++ *  |                           |                             |
++ *  + - -  -    - -    -    - - + -   -   -   -   - -     - - +
++ *
++ * The coordinate system used in a quadtree are integers to avoid
++ * round-off errors. The vertex in the lower left box has the coordinates
++ * (0 0) 
++ * The upper right vertex has the follwing coordinates:
++ * 2^30 -1           2^30 -1        in decimal
++ * 0 1 1 1 .... 1    0 1 1 1 .... 1 in binary
++ *  \--   29  --/     \--   29  --/
++ * Using binaries is therefore very easy to locate a vertex in a box:
++ * we just need to look at the bits from the left to the right (See ::Add)
++ }}}*/
++/*MACROS {{{*/
++/* 
++ * 
++ *    J    j
++ *    ^    ^
++ *    |    | +--------+--------+
++ *    |    | |        |        |
++ * 1X |    | |   2    |   3    |
++ *    |    | |        |        |
++ *    |    | +--------+--------+
++ *    |    | |        |        |
++ * 0X |    | |   0    |   1    |
++ *    |    | |        |        |
++ *    |    | +--------+--------+
++ *    |    +-----------------------> i
++ *    |         
++ *    |----------------------------> I
++ *              X0        X1  
++ *
++ * box 0 -> I=0 J=0 IJ=00  = 0
++ * box 1 -> I=1 J=0 IJ=01  = 1
++ * box 2 -> I=0 J=1 IJ=10  = 2
++ * box 3 -> I=1 J=1 IJ=11  = 3
++ */
++//IJ(i,j,l) returns the box number of i and j with respect to l
++//if !j&l and !i&l -> 0 (box zero: lower left )
++//if !j&l and  i&l -> 1 (box one:  lower right)
++//if  j&l and !i&l -> 2 (box two:  upper left )
++//if  j&l and  i&l -> 3 (box three:upper right)
++#define IJ(i,j,l)  ((j&l) ? ((i&l) ? 3:2 ) :((i&l) ? 1:0 ))
++/*}}}*/
++
++	/*Constructors/Destructors*/
++/*FUNCTION Quadtree::Quadtree(){{{*/
++Quadtree::Quadtree(){
++	_error2_("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){
++
++	/*Intermediaries*/
++	double length;
++
++	/*Initialize fields*/
++	this->MaxDepth=maxdepth;
++	this->NbQuadtreeBox=0;
++	this->NbObs=0;
++
++	/*Create container*/
++	this->boxcontainer=new DataSet();
++
++	/*Create Root, pointer toward the main box*/
++	length=max(xmax-xmin,ymax-ymin);
++	this->root=NewQuadtreeBox(xmin+length/2,ymin+length/2,length);
++}
++/*}}}*/
++	/*FUNCTION Quadtree::~Quadtree(){{{*/
++	Quadtree::~Quadtree(){
++
++		delete boxcontainer;
++		root=NULL;
++
++	}
++	/*}}}*/
++
++	/*Methods*/
++/*FUNCTION Quadtree::Add{{{*/
++void  Quadtree::Add(Observation* observation){
++
++	/*Intermediaries*/
++	int          xi,yi,ij,level,levelbin;
++	QuadtreeBox **pbox    = NULL; // pointer toward current box b
++	QuadtreeBox **pmaster = NULL; // pointer toward master of b
++	QuadtreeBox  *box     = NULL; // current box b
++	QuadtreeBox  *slave   = NULL; // suslaveox of b (if necessary)
++	Observation  *obs[4];
++
++	/*Get integer coodinates*/
++	xi = observation->xi;
++	yi = observation->yi;
++
++	/*Initialize levels*/
++	level    = 0;
++	levelbin = (1L<<this->MaxDepth);// = 2^30
++
++	/*Get inital box (the largest)*/
++	pmaster = &root;
++	pbox    = &root;
++
++	/*Find the smallest box where the observation is located*/
++	while((box=*pbox) && (box->nbitems<0)){ 
++
++		/*Go down one level (levelbin = 00100 -> 00010)*/
++		levelbin>>=1; level+=1; _assert_(level<this->MaxDepth);
++
++		/*Get next box according to the bit value (levelbin)*/
++		pmaster = pbox;
++		pbox    = &box->box[IJ(xi,yi,levelbin)];
++	}
++	_assert_(levelbin>0);
++
++	/*Now, try to add the vertex, if the box is full (nbitems=4), we have to divide it in 4 new boxes*/
++	while((box=*pbox) && (box->nbitems==4)){
++
++		/*Copy the 4 observation in the current Quadtreebox*/
++		obs[0] = box->obs[0];
++		obs[1] = box->obs[1];
++		obs[2] = box->obs[2];
++		obs[3] = box->obs[3];
++
++		/*set nbitems as -1 (now holding boxes instead of observations)*/
++		box->nbitems = -1;
++		box->box[0]  = NULL;
++		box->box[1]  = NULL;
++		box->box[2]  = NULL;
++		box->box[3]  = NULL;
++
++		/*Go down one level (levelbin = 00010 -> 00001)*/
++		levelbin>>=1; level+=1; _assert_(level<this->MaxDepth);
++
++		/*Put the four observations in the new boxes*/
++		for (int k=0;k<4;k++){
++
++			/*Get box for observation number k*/
++			ij    = IJ(obs[k]->xi,obs[k]->yi,levelbin);
++			slave = box->box[ij];
++			if(!slave){
++				box->box[ij] = NewQuadtreeBox(box,ij);
++				slave        = box->box[ij];
++			}
++			slave->obs[slave->nbitems++] = obs[k];
++		}
++
++		/*Get the suslaveox where the current observation is located*/
++		ij      = IJ(xi,yi,levelbin);
++		pmaster = pbox;
++		pbox    = &box->box[ij];
++	}
++
++	/*alloc the QuadtreeBox if necessary and add current observation*/
++	box = *pbox;
++	if(!box){
++		ij  = IJ(xi,yi,levelbin);
++		box = *pbox = NewQuadtreeBox(*pmaster,ij);
++	}
++	box->obs[box->nbitems++]=observation;
++	NbObs++;
++
++}/*}}}*/
++/*FUNCTION Quadtree::AddAndAverage{{{*/
++void Quadtree::AddAndAverage(double x,double y,double value){
++
++	QuadtreeBox **pbox = NULL;
++	QuadtreeBox  *box  = NULL;
++	int           xi,yi;
++	int           level,levelbin;
++	int           index;
++	double        length,length2;
++
++	/*Get integer coodinates*/
++	this->IntergerCoordinates(&xi,&yi,x,y);
++
++	/*Initialize levels*/
++	level    = 0;
++	levelbin = (1L<<this->MaxDepth);// = 2^30
++
++	/*Get inital box (the largest)*/
++	pbox=&root;
++
++	/*Find the smallest box where this point is located*/
++	while((box=*pbox) && (box->nbitems<0)){ 
++
++		levelbin>>=1; level+=1; 
++
++		pbox = &box->box[IJ(xi,yi,levelbin)];
++	}
++
++	/*Add obervation in this box (should be full)*/
++	if(box && box->nbitems==4){
++		index  = 0;
++		length = pow(box->obs[0]->x - x,2.) + pow(box->obs[0]->y - y,2.);
++		for(int i=1;i<4;i++){
++			length2 = pow(box->obs[i]->x - x,2.) + pow(box->obs[i]->y - y,2.);
++			if(length2<length){
++				index  = i;
++				length = length2;
++			}
++		}
++
++		/*We found the closest observation, now average observation (do not change xi and yi to avoid round off errors*/
++		box->obs[index]->x = (box->obs[index]->weight*box->obs[index]->x + x)/(box->obs[index]->weight+1);
++		box->obs[index]->y = (box->obs[index]->weight*box->obs[index]->y + y)/(box->obs[index]->weight+1);
++		box->obs[index]->xi= int((box->obs[index]->weight*double(box->obs[index]->xi) + double(xi))/(box->obs[index]->weight+1));
++		box->obs[index]->yi= int((box->obs[index]->weight*double(box->obs[index]->yi) + double(yi))/(box->obs[index]->weight+1));
++		box->obs[index]->value   = (box->obs[index]->weight*box->obs[index]->value + value)/(box->obs[index]->weight+1);
++		box->obs[index]->weight += 1;
++	}
++	else{
++		_error2_("Box is not full");
++	}
++}/*}}}*/
++/*FUNCTION Quadtree::ClosestObs{{{*/
++void Quadtree::ClosestObs(int *pindex,double x,double y){
++
++	QuadtreeBox **pbox = NULL;
++	QuadtreeBox  *box  = NULL;
++	int           xi,yi;
++	int           level,levelbin;
++	int           index = -1;
++	double        length,length2;
++
++	/*Get integer coodinates*/
++	this->IntergerCoordinates(&xi,&yi,x,y);
++
++	/*Initialize levels*/
++	level    = 0;
++	levelbin = (1L<<this->MaxDepth);// = 2^30
++
++	/*Get inital box (the largest)*/
++	pbox=&root;
++
++	/*Find the smallest box where this point is located*/
++	while((box=*pbox) && (box->nbitems<0)){ 
++
++		levelbin>>=1; level+=1; 
++
++		pbox = &box->box[IJ(xi,yi,levelbin)];
++	}
++
++	/*Add obervation in this box (should be full)*/
++	if(box && box->nbitems>0){
++		index  = box->obs[0]->index;
++		length = pow(box->obs[0]->x - x,2.) + pow(box->obs[0]->y - y,2.);
++		for(int i=1;i<box->nbitems;i++){
++			length2 = pow(box->obs[i]->x - x,2.) + pow(box->obs[i]->y - y,2.);
++			if(length2<length){
++				index  = box->obs[i]->index;
++				length = length2;
++			}
++		}
++	}
++
++	*pindex=index;
++}/*}}}*/
++/*FUNCTION Quadtree::Echo{{{*/
++void  Quadtree::Echo(void){
++
++	_printLine_("Quadtree:");
++	_printLine_("   MaxDepth      = " << this->MaxDepth);
++	_printLine_("   NbQuadtreeBox = " << this->NbQuadtreeBox);
++	_printLine_("   NbObs         = " << this->NbObs);
++	_printLine_("   root          = " << this->root);
++
++}/*}}}*/
++/*FUNCTION Quadtree::DeepEcho{{{*/
++void  Quadtree::DeepEcho(void){
++
++	_printLine_("Quadtree:");
++	_printLine_("   MaxDepth      = " << this->MaxDepth);
++	_printLine_("   NbQuadtreeBox = " << this->NbQuadtreeBox);
++	_printLine_("   NbObs         = " << this->NbObs);
++	_printLine_("   root          = " << this->root);
++	boxcontainer->Echo();
++
++}/*}}}*/
++/*FUNCTION Quadtree::IntergerCoordinates{{{*/
++void  Quadtree::IntergerCoordinates(int *xi,int *yi,double x,double y){
++
++	/*Intermediaries*/
++	double coefficient;
++	double xmin,ymin;
++
++	/*Checks in debugging mode*/
++	_assert_(xi && yi);
++	_assert_(this->root);
++
++	/*coeffIcoor is the coefficient used for integer coordinates:
++	 *                (x-xmin)
++	 * xi = (2^30 -1) --------- 
++	 *                 length
++	 * coefficient = (2^30 -1)/length
++	 */
++	coefficient = double((1L<<this->MaxDepth)-1)/(this->root->length);
++	xmin        = this->root->xcenter - this->root->length/2;
++	ymin        = this->root->ycenter - this->root->length/2;
++
++	*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){
++
++	/*Output*/
++	QuadtreeBox* newbox=NULL;
++
++	/*Create and initialize a new box*/
++	newbox=new QuadtreeBox();
++	newbox->nbitems=0;
++	newbox->xcenter=xcenter;
++	newbox->ycenter=ycenter;
++	newbox->length=length;
++	newbox->box[0]=NULL;
++	newbox->box[1]=NULL;
++	newbox->box[2]=NULL;
++	newbox->box[3]=NULL;
++
++	/*Add to container*/
++	this->boxcontainer->AddObject(newbox);
++	NbQuadtreeBox++;
++
++	/*currentbox now points toward next quadtree box*/
++	return newbox;
++}/*}}}*/
++/*FUNCTION Quadtree::NewQuadtreeBox(QuadtreeBox* master,int index) {{{*/
++Quadtree::QuadtreeBox* Quadtree::NewQuadtreeBox(QuadtreeBox* master,int index){
++
++	/*Output*/
++	QuadtreeBox* newbox=NULL;
++
++	/*Checks in debugging mode*/
++	_assert_(master);
++
++	/*Create and initialize a new box*/
++	newbox=new QuadtreeBox();
++	newbox->nbitems=0;
++	newbox->box[0]=NULL;
++	newbox->box[1]=NULL;
++	newbox->box[2]=NULL;
++	newbox->box[3]=NULL;
++	switch(index){
++		case 0:
++			newbox->xcenter=master->xcenter - master->length/4;
++			newbox->ycenter=master->ycenter - master->length/4;
++			break;
++		case 1:
++			newbox->xcenter=master->xcenter + master->length/4;
++			newbox->ycenter=master->ycenter - master->length/4;
++			break;
++		case 2:
++			newbox->xcenter=master->xcenter - master->length/4;
++			newbox->ycenter=master->ycenter + master->length/4;
++			break;
++		case 3:
++			newbox->xcenter=master->xcenter + master->length/4;
++			newbox->ycenter=master->ycenter + master->length/4;
++			break;
++		default:
++			_error2_("Case " << index << " not supported");
++	}
++	newbox->length=master->length/2;
++
++	/*Add to container*/
++	this->boxcontainer->AddObject(newbox);
++	NbQuadtreeBox++;
++
++	/*currentbox now points toward next quadtree box*/
++	return newbox;
++}/*}}}*/
++/*FUNCTION Quadtree::QuadtreeDepth{{{*/
++void Quadtree::QuadtreeDepth(int* A,int xi,int yi){
++
++	QuadtreeBox **pbox = NULL;
++	QuadtreeBox  *box  = NULL;
++	int           level,levelbin;
++
++	/*Initialize levels*/
++	level    = 0;
++	levelbin = (1L<<this->MaxDepth);// = 2^30
++
++	/*Get inital box (the largest)*/
++	pbox=&root;
++
++	/*Find the smallest box where this point is located*/
++	while((box=*pbox) && (box->nbitems<0)){ 
++
++		levelbin>>=1; level+=1; _assert_(level<this->MaxDepth);
++
++		pbox = &box->box[IJ(xi,yi,levelbin)];
++	}
++	if(box && box->nbitems>0){
++		/*This box is not empty, add one level*/
++		level+=1;
++	}
++
++	*A=level;
++}/*}}}*/
++/*FUNCTION Quadtree::QuadtreeDepth2{{{*/
++void Quadtree::QuadtreeDepth2(int* A,int xi,int yi){
++
++	QuadtreeBox **pbox = NULL;
++	QuadtreeBox  *box  = NULL;
++	int           level,levelbin;
++
++	/*Initialize levels*/
++	level    = 0;
++	levelbin = (1L<<this->MaxDepth);// = 2^30
++
++	/*Get inital box (the largest)*/
++	pbox=&root;
++
++	/*Find the smallest box where this point is located*/
++	while((box=*pbox) && (box->nbitems<0)){ 
++
++		levelbin>>=1; level+=1; 
++
++		pbox = &box->box[IJ(xi,yi,levelbin)];
++	}
++	if(box && box->nbitems>0){
++		/*This box is not empty, add one level*/
++		level+=1;
++	}
++
++	/*If we were to add the vertex, get level*/
++	if(box && box->nbitems==4){
++		int ij;
++		bool flag=true;
++		while(flag){
++
++			levelbin>>=1; level+=1;
++			if(level>this->MaxDepth){
++				level+=1;
++				break;
++			}
++
++			/*loop over the four observations*/
++			ij=IJ(box->obs[0]->xi,box->obs[0]->yi,levelbin);
++			for (int k=1;k<4;k++){
++				if(IJ(box->obs[k]->xi,box->obs[k]->yi,levelbin) != ij){
++					flag = false;
++				}
++			}
++			if(IJ(xi,yi,levelbin)!=ij){
++				flag = false;
++			}
++		}
++	}
++
++	*A=level;
++}/*}}}*/
++/*FUNCTION Quadtree::RangeSearch{{{*/
++void Quadtree::RangeSearch(int **pindices,int *pnobs,double x,double y,double range){
++
++	/*Intermediaries*/
++	int  nobs;
++	int *indices = NULL;
++
++	/*Allocate indices (maximum by default*/
++	if(this->NbObs) indices = xNew<int>(this->NbObs);
++	nobs = 0;
++
++	if(this->root) this->root->RangeSearch(indices,&nobs,x,y,range);
++
++	/*Clean-up and return*/
++	*pnobs=nobs;
++	*pindices=indices;
++
++}/*}}}*/
++
++/*QuadtreeBox methos*/
++/*FUNCTION QuadtreeBox::Echo{{{*/
++void  Quadtree::QuadtreeBox::Echo(void){
++
++	_printLine_("QuadtreeBox:");
++	_printLine_("   nbitems = " << this->nbitems);
++	_printLine_("   xcenter = " << this->xcenter);
++	_printLine_("   ycenter = " << this->ycenter);
++	_printLine_("   length  = " << this->length);
++
++}/*}}}*/
++/*FUNCTION QuadtreeBox::IsWithinRange{{{*/
++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;
++	if(this->xcenter-this->length/2 > x+range) return 0;
++	if(this->ycenter+this->length/2 < y-range) return 0;
++	if(this->ycenter-this->length/2 > y+range) return 0;
++
++	/*Return 2 if the this box is included in the range*/
++	if(this->xcenter+this->length/2 <= x+range &&
++		this->ycenter+this->length/2 <= y+range &&
++		this->xcenter-this->length/2 >= x-range &&
++		this->ycenter-this->length/2 >= y-range) return 2;
++
++	/*This is a simple overlap*/
++	return 1;
++
++}/*}}}*/
++/*FUNCTION QuadtreeBox::RangeSearch{{{*/
++void Quadtree::QuadtreeBox::RangeSearch(int* indices,int *pnobs,double x,double y,double range){
++
++	/*Intermediaries*/
++	int i,nobs;
++
++	/*Recover current number of observations*/
++	nobs = *pnobs;
++
++	switch(this->IsWithinRange(x,y,range)){
++		case 0:
++			/*If this box is not within range, return*/
++			break;
++		case 2:
++			/*This box is included in range*/
++			this->WriteObservations(indices,&nobs);
++			break;
++		case 1:
++			/*This box is partly included*/
++			if(this->nbitems>0){
++				/*If this box has only observations, add indices that are within range*/
++				for(i=0;i<this->nbitems;i++){
++					if(fabs(this->obs[i]->x-x) <= range && fabs(this->obs[i]->y-y) <= range){
++						indices[nobs++]=this->obs[i]->index;
++					}
++				}
++			}
++			else{
++				/*This box points toward boxes*/
++				if(this->box[0]) this->box[0]->RangeSearch(indices,&nobs,x,y,range);
++				if(this->box[1]) this->box[1]->RangeSearch(indices,&nobs,x,y,range);
++				if(this->box[2]) this->box[2]->RangeSearch(indices,&nobs,x,y,range);
++				if(this->box[3]) this->box[3]->RangeSearch(indices,&nobs,x,y,range);
++			}
++			break;
++		default:
++			_error2_("Case " << this->IsWithinRange(x,y,range) << " not supported");
++	}
++
++	/*Assign output pointers: */
++	*pnobs=nobs;
++}/*}}}*/
++/*FUNCTION QuadtreeBox::WriteObservations{{{*/
++void Quadtree::QuadtreeBox::WriteObservations(int* indices,int *pnobs){
++
++	/*Intermediaries*/
++	int i,nobs;
++
++	/*Recover current number of observations*/
++	nobs = *pnobs;
++
++	if(this->nbitems>0){
++		/*If this box has only observations, add all indices*/
++		for(i=0;i<this->nbitems;i++){
++			indices[nobs++]=this->obs[i]->index;
++		}
++	}
++	else{
++		/*This box points toward boxes, */
++		if(this->box[0]) this->box[0]->WriteObservations(indices,&nobs);
++		if(this->box[1]) this->box[1]->WriteObservations(indices,&nobs);
++		if(this->box[2]) this->box[2]->WriteObservations(indices,&nobs);
++		if(this->box[3]) this->box[3]->WriteObservations(indices,&nobs);
++	}
++
++	/*Assign output pointers: */
++	*pnobs=nobs;
++}/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.cpp	(revision 12821)
+@@ -0,0 +1,57 @@
++/*!\file Observation.c
++ * \brief: implementation of the Observation object
++ */
++
++#include <stdlib.h>
++#include "../objects.h"
++
++/*Observation constructors and destructor*/
++/*FUNCTION 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){
++
++	this->x      = x_in;
++	this->y      = y_in;
++	this->xi     = xi_in;
++	this->yi     = yi_in;
++	this->index  = index_in;
++	this->value  = value_in;
++	this->weight = 1.;
++
++}
++/*}}}*/
++/*FUNCTION Observation::~Observation(){{{*/
++Observation::~Observation(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Observation::Echo {{{*/
++void Observation::Echo(void){
++
++	int  bit;
++
++	_printLine_("Observation");
++	_printLine_("   index : " << this->index);
++	_printLine_("   x     : " << this->x);
++	_printLine_("   y     : " << this->y);
++	_printLine_("   xi    : "); printbinary(this->xi); _printLine_("");
++	_printLine_("   yi    : "); printbinary(this->yi); _printLine_("");
++	_printLine_("   weight: " << this->weight);
++	_printLine_("   value : " << this->value);
++}
++/*}}}*/
++
++/*Observations functions*/
++/*FUNCTION 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: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Variogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Variogram.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Variogram.h	(revision 12821)
+@@ -0,0 +1,18 @@
++/*!\file:  Variogram.h
++ * \brief abstract class for Variogram object
++ */ 
++
++#ifndef _VARIOGRAM_H_
++#define _VARIOGRAM_H_
++
++#include "../Object.h"
++
++class Variogram: public Object{
++
++	public: 
++		virtual ~Variogram(){};
++		virtual double SemiVariogram(double deltax,double deltay)=0;
++		virtual double Covariance(double deltax,double deltay)=0;
++
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.h	(revision 12821)
+@@ -0,0 +1,51 @@
++/*
++ * FemModel.h: 
++ */
++
++#ifndef _FEMMODEL_H_
++#define _FEMMODEL_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Object.h"
++#include "../toolkits/toolkits.h"
++class DataSet;
++class Parameters;
++class NodeSets;
++/*}}}*/
++
++
++class FemModel {
++
++	/*no private members, as we need access to these datasets quite often!:*/
++
++	public:
++
++		int                 nummodels;
++		int                 solution_type;
++		int*                analysis_type_list; //list of analyses this femmodel is going to carry out
++		int                 analysis_counter; //counter into analysis_type_list
++		
++		Elements*           elements; //elements (one set for all analyses)
++		Nodes*              nodes; //one set of nodes
++		Vertices*           vertices; //one set of vertices
++		Constraints*        constraints; //one set of constraints. each constraint knows which analysis_type it handles
++		Loads*              loads;  //one set of constraints. each constraint knows which analysis_type it handles
++		Materials*          materials;  //one set of materials, for each element
++		Parameters*         parameters; //one set of parameters, independent of the analysis_type
++		Results*            results; //results that cannot be fit into the elements (such as one time constants, arrays, strings, etc ...)
++
++		/*constructors, destructors: */
++		FemModel(char* inputfilename, char* outputfilename, const int solution_type,const int* analyses,const int nummodels);
++		~FemModel();
++
++		/*Methods: */
++		void Echo();
++
++		/*Fem: */
++		void  SetCurrentConfiguration(int configuration_type);
++		void  SetCurrentConfiguration(int configuration_type,int analysis_type);
++
++};
++
++#endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-12821-12822.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12821-12822.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12821-12822.diff	(revision 13394)
@@ -0,0 +1,86736 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matice.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matice.cpp	(revision 12822)
+@@ -1,769 +0,0 @@
+-/*!\file Matice.c
+- * \brief: implementation of the Matice object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-		
+-/*Matice constructors and destructor*/
+-/*FUNCTION Matice::Matice(){{{*/
+-Matice::Matice(){
+-	this->inputs=NULL;
+-	this->helement=NULL;
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::Matice(int id, int index, IoModel* iomodel, int num_vertices){{{*/
+-Matice::Matice(int matice_mid,int index, IoModel* iomodel){
+-
+-	/*Intermediaries:*/
+-	int    i;
+-	int    matice_eid;
+-
+-	/*Initialize id*/
+-	this->mid=matice_mid;
+-
+-	/*Initialize inputs*/
+-	this->inputs=new Inputs();
+-
+-	/*Initialize inputs from IoModel*/
+-	this->InputUpdateFromIoModel(index,iomodel);
+-
+-	/*Hooks: */
+-	matice_eid=index+1;
+-	this->helement=new Hook(&matice_eid,1);
+-
+-	return;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matice::~Matice(){{{*/
+-Matice::~Matice(){
+-	delete helement;
+-	delete inputs;
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Matice::Echo {{{*/
+-void Matice::Echo(void){
+-
+-	_printLine_("Matice:");
+-	_printLine_("   mid: " << mid);
+-	_printLine_("   inputs:");
+-	inputs->Echo();
+-	_printLine_("   element:");
+-	helement->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION Matice::DeepEcho {{{*/
+-void Matice::DeepEcho(void){
+-
+-	_printLine_("Matice:");
+-	_printLine_("   mid: " << mid);
+-	_printLine_("   inputs:");
+-	inputs->DeepEcho();
+-	_printLine_("   element:");
+-	helement->Echo();
+-}		
+-/*}}}*/
+-/*FUNCTION Matice::Id {{{*/
+-int    Matice::Id(void){ return mid; }
+-/*}}}*/
+-/*FUNCTION Matice::MyRank {{{*/
+-int    Matice::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Matice::ObjectEnum{{{*/
+-int Matice::ObjectEnum(void){
+-
+-	return MaticeEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matice::copy {{{*/
+-Object* Matice::copy() {
+-
+-	/*Output*/
+-	Matice* matice=NULL;
+-
+-	/*Initialize output*/
+-	matice=new Matice();
+-
+-	/*copy fields: */
+-	matice->mid=this->mid;
+-	matice->helement=(Hook*)this->helement->copy();
+-	if(this->inputs) matice->inputs=(Inputs*)this->inputs->Copy();
+-	else  matice->inputs=new Inputs();
+-
+-	return matice;
+-}
+-/*}}}*/
+-
+-/*Matice management*/
+-/*FUNCTION Matice::Configure {{{*/
+-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: */
+-	helement->configure(elementsin);
+-}
+-/*}}}*/
+-/*FUNCTION Matice::SetCurrentConfiguration {{{*/
+-void  Matice::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetB {{{*/
+-IssmDouble Matice::GetB(){
+-
+-	/*Output*/
+-	IssmDouble B;
+-
+-	inputs->GetInputAverage(&B,MaterialsRheologyBEnum);
+-	return B;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetBbar {{{*/
+-IssmDouble Matice::GetBbar(){
+-
+-	/*Output*/
+-	IssmDouble Bbar;
+-
+-	inputs->GetInputAverage(&Bbar,MaterialsRheologyBbarEnum);
+-	return Bbar;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetN {{{*/
+-IssmDouble Matice::GetN(){
+-
+-	/*Output*/
+-	IssmDouble n;
+-
+-	inputs->GetInputAverage(&n,MaterialsRheologyNEnum);
+-	return n;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetVectorFromInputs{{{*/
+-void  Matice::GetVectorFromInputs(Vector* vector,int input_enum){
+-
+-	/*Intermediaries*/
+-	Element *element= NULL;
+-
+-	/*Recover element*/
+-	element=(Element*)helement->delivers();
+-
+-	/*Check that input_enum is a material input*/
+-	if (!IsInput(input_enum)) return;
+-
+-	switch(element->ObjectEnum()){
+-
+-		case TriaEnum:{
+-
+-			/*Prepare index list*/
+-			int doflist1[3];
+-			for(int i=0;i<3;i++) doflist1[i]=((Tria*)element)->nodes[i]->GetVertexDof();
+-
+-			/*Get input (either in element or material)*/
+-			Input* input=inputs->GetInput(input_enum);
+-			if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in material");
+-
+-			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
+-			input->GetVectorFromInputs(vector,&doflist1[0]);}
+-			break;
+-
+-		default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetViscosity2d {{{*/
+-void  Matice::GetViscosity2d(IssmDouble* pviscosity, IssmDouble* epsilon){
+-	/*From a string tensor and a material object, return viscosity, using Glen's flow law.
+-												    B
+-	  viscosity= -------------------------------------------------------------------
+-						  2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
+-
+-	  where viscosity is the viscotiy, B the flow law parameter , (u,v) the velocity 
+-	  vector, and n the flow law exponent.
+-
+-	  If epsilon is NULL, it means this is the first time SystemMatrices is being run, and we 
+-	  return 10^14, initial viscosity.
+-	  */
+-
+-	/*output: */
+-	IssmDouble viscosity;
+-
+-	/*input strain rate: */
+-	IssmDouble exx,eyy,exy;
+-
+-	/*Intermediary: */
+-	IssmDouble A,e;
+-	IssmDouble B,n;
+-
+-	/*Get B and n*/
+-	B=GetBbar();
+-	n=GetN();
+-
+-	if (n==1){
+-		/*Viscous behaviour! viscosity=B: */
+-		viscosity=B/2;
+-	}
+-	else{
+-		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0)){
+-			viscosity=0.5*pow((IssmDouble)10,(IssmDouble)14);
+-		}
+-		else{
+-			/*Retrive strain rate components: */
+-			exx=*(epsilon+0);
+-			eyy=*(epsilon+1);
+-			exy=*(epsilon+2);
+-
+-			/*Build viscosity: viscosity=B/(2*A^e) */
+-			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
+-			if(A==0){
+-				/*Maxiviscositym viscosity for 0 shear areas: */
+-				viscosity=2.5*pow((IssmDouble)10,(IssmDouble)17);
+-			}
+-			else{
+-				e=(n-1)/(2*n);
+-				viscosity=B/(2*pow(A,e));
+-			}
+-		}
+-	}
+-
+-	/*Checks in debugging mode*/
+-	if(viscosity<=0) _error2_("Negative viscosity");
+-	_assert_(B>0);
+-	_assert_(n>0);
+-
+-	/*Return: */
+-	*pviscosity=viscosity;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetViscosity3d {{{*/
+-void  Matice::GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* epsilon){
+-
+-	/*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]: 
+-	 *
+-	 *                                               B
+-	 * viscosity3d= -------------------------------------------------------------------
+-	 *                      2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
+-	 *
+-	 *     where mu is the viscotiy, B the flow law parameter , (u,v) the velocity 
+-	 *     vector, and n the flow law exponent.
+-	 *
+-	 * If epsilon is NULL, it means this is the first time Emg is being run, and we 
+-	 * return g, initial viscosity.
+-	 */
+-	
+-	/*output: */
+-	IssmDouble viscosity3d;
+-
+-	/*input strain rate: */
+-	IssmDouble exx,eyy,exy,exz,eyz;
+-
+-	/*Intermediaries: */
+-	IssmDouble A,e;
+-	IssmDouble B,n;
+-
+-	/*Get B and n*/
+-	B=GetB();
+-	n=GetN();
+-
+-	if (n==1){
+-		/*Viscous behaviour! viscosity3d=B: */
+-		viscosity3d=B/2;
+-	}
+-	else{
+-		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
+-				(epsilon[3]==0) && (epsilon[4]==0)){
+-			viscosity3d=0.5*pow((IssmDouble)10,(IssmDouble)14);
+-		}
+-		else{
+-
+-			/*Retrive strain rate components: */
+-			exx=*(epsilon+0);
+-			eyy=*(epsilon+1);
+-			exy=*(epsilon+2);
+-			exz=*(epsilon+3);
+-			eyz=*(epsilon+4);
+-
+-			/*Build viscosity: viscosity3d=2*B/(2*A^e) */
+-			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+pow(exz,2)+pow(eyz,2)+exx*eyy;
+-			if(A==0){
+-				/*Maxiviscosity3dm viscosity for 0 shear areas: */
+-				viscosity3d=2.25*pow((IssmDouble)10,(IssmDouble)17);
+-			}
+-			else{
+-				e=(n-1)/2/n;
+-			
+-				viscosity3d=B/(2*pow(A,e));
+-			}
+-		}
+-	}
+-
+-	/*Checks in debugging mode*/
+-	if(viscosity3d<=0) _error2_("Negative viscosity");
+-	_assert_(B>0);
+-	_assert_(n>0);
+-
+-	/*Assign output pointers:*/
+-	*pviscosity3d=viscosity3d;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetViscosity3dStokes {{{*/
+-void  Matice::GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon){
+-	/*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]: 
+-	 *
+-	 *                                          B
+-	 * viscosity3d= -------------------------------------------------------------------
+-	 *                   2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
+-	 *
+-	 *     where mu is the viscotiy, B the flow law parameter , (u,v) the velocity 
+-	 *     vector, and n the flow law exponent.
+-	 *
+-	 * If epsilon is NULL, it means this is the first time Emg is being run, and we 
+-	 * return g, initial viscosity.
+-	 */
+-	
+-	/*output: */
+-	IssmDouble viscosity3d;
+-
+-	/*input strain rate: */
+-	IssmDouble exx,eyy,exy,exz,eyz,ezz;
+-
+-	/*Intermediaries: */
+-	IssmDouble A,e;
+-	IssmDouble B,n;
+-	IssmDouble eps0;
+-
+-	/*Get B and n*/
+-	eps0=pow((IssmDouble)10,(IssmDouble)-27);
+-	B=GetB();
+-	n=GetN();
+-	
+-	if (n==1){
+-		/*Viscous behaviour! viscosity3d=B: */
+-		viscosity3d=B/2;
+-	}
+-	else{
+-		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
+-				(epsilon[3]==0) && (epsilon[4]==0) && (epsilon[5]==0)){
+-			viscosity3d=0.5*pow((IssmDouble)10,(IssmDouble)14);
+-		}
+-		else{
+-
+-			/*Retrive strain rate components: */
+-			exx=*(epsilon+0);
+-			eyy=*(epsilon+1);
+-			ezz=*(epsilon+2); //not used
+-			exy=*(epsilon+3);
+-			exz=*(epsilon+4);
+-			eyz=*(epsilon+5);
+-
+-			/*Build viscosity: viscosity3d=B/(2*A^e) */
+-			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+pow(exz,2)+pow(eyz,2)+exx*eyy+pow(eps0,2);
+-			if(A==0){
+-				/*Maxiviscosity3dm viscosity for 0 shear areas: */
+-				viscosity3d=2.25*pow((IssmDouble)10,(IssmDouble)17);
+-			}
+-			else{
+-				e=(n-1)/2/n;
+-				viscosity3d=B/(2*pow(A,e));
+-			}
+-		}
+-	}
+-
+-	/*Checks in debugging mode*/
+-	if(viscosity3d<=0) _error2_("Negative viscosity");
+-	_assert_(B>0);
+-	_assert_(n>0);
+-
+-	/*Assign output pointers:*/
+-	*pviscosity3d=viscosity3d;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetViscosityComplement {{{*/
+-void  Matice::GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){
+-	/*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]: 
+-	 *
+-	 *  										                1
+-	 * viscosity= -------------------------------------------------------------------
+-	 *  				  2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
+-	 *
+-	 * If epsilon is NULL, it means this is the first time Gradjb is being run, and we 
+-	 * return mu20, initial viscosity.
+-	 */
+-	
+-	/*output: */
+-	IssmDouble viscosity_complement;
+-
+-	/*input strain rate: */
+-	IssmDouble exx,eyy,exy;
+-
+-	/*Intermediary value A and exponent e: */
+-	IssmDouble A,e;
+-	IssmDouble B,n;
+-
+-	/*Get B and n*/
+-	B=GetBbar();
+-	n=GetN();
+-
+-	if(epsilon){
+-		exx=*(epsilon+0);
+-		eyy=*(epsilon+1);
+-		exy=*(epsilon+2);
+-
+-		/*Build viscosity: mu2=B/(2*A^e) */
+-		A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
+-		if(A==0){
+-			/*Maximum viscosity_complement for 0 shear areas: */
+-			viscosity_complement=2.25*pow((IssmDouble)10,(IssmDouble)17);
+-		}
+-		else{
+-			e=(n-1)/(2*n);
+-		
+-			viscosity_complement=1/(2*pow(A,e));
+-		}
+-	}
+-	else{
+-		viscosity_complement=4.5*pow((IssmDouble)10,(IssmDouble)17);
+-	}
+-
+-	/*Checks in debugging mode*/
+-	_assert_(B>0);
+-	_assert_(n>0);
+-	_assert_(viscosity_complement>0);
+-		
+-	/*Return: */
+-	*pviscosity_complement=viscosity_complement;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetViscosityDerivativeEpsSquare{{{*/
+-void  Matice::GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){
+-
+-	/*output: */
+-	IssmDouble mu_prime;
+-	IssmDouble mu,n,eff2;
+-
+-	/*input strain rate: */
+-	IssmDouble exx,eyy,exy,exz,eyz;
+-
+-	/*Get visocisty and n*/
+-	GetViscosity3d(&mu,epsilon);
+-	n=GetN();
+-
+-	if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
+-				(epsilon[3]==0) && (epsilon[4]==0)){
+-		mu_prime=0.5*pow((IssmDouble)10,(IssmDouble)14);
+-	}
+-	else{
+-		/*Retrive strain rate components: */
+-		exx=epsilon[0];
+-		eyy=epsilon[1];
+-		exy=epsilon[2];
+-		exz=epsilon[3];
+-		eyz=epsilon[4];
+-		eff2 = exx*exx + eyy*eyy + exx*eyy + exy*exy + exz*exz + eyz*eyz;
+-
+-		mu_prime=(1-n)/(2*n) * mu/eff2;
+-	}
+-
+-	/*Assign output pointers:*/
+-	*pmu_prime=mu_prime;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetViscosity2dDerivativeEpsSquare{{{*/
+-void  Matice::GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){
+-
+-	/*output: */
+-	IssmDouble mu_prime;
+-	IssmDouble mu,n,eff2;
+-
+-	/*input strain rate: */
+-	IssmDouble exx,eyy,exy,exz;
+-
+-	/*Get visocisty and n*/
+-	GetViscosity2d(&mu,epsilon);
+-	n=GetN();
+-
+-	if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0)){
+-		mu_prime=0.5*pow((IssmDouble)10,(IssmDouble)14);
+-	}
+-	else{
+-		/*Retrive strain rate components: */
+-		exx=epsilon[0];
+-		eyy=epsilon[1];
+-		exy=epsilon[2];
+-		eff2 = exx*exx + eyy*eyy + exx*eyy + exy*exy ;
+-
+-		mu_prime=(1-n)/(2*n) * mu/eff2;
+-	}
+-
+-	/*Assign output pointers:*/
+-	*pmu_prime=mu_prime;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputDuplicate{{{*/
+-void  Matice::InputDuplicate(int original_enum,int new_enum){
+-
+-	/*Call inputs method*/
+-	if (IsInput(original_enum)) inputs->DuplicateInput(original_enum,new_enum);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
+-void  Matice::InputUpdateFromVector(IssmDouble* vector, int name, int type){
+-
+-	/*Intermediaries*/
+-	Element *element      = NULL;
+-
+-	/*Recover element*/
+-	element=(Element*)helement->delivers();
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	switch(type){
+-
+-		case VertexEnum:
+-
+-			switch(element->ObjectEnum()){
+-
+-				case TriaEnum: {
+-					IssmDouble values[3];
+-					for (int i=0;i<3;i++) values[i]=vector[((Tria*)element)->nodes[i]->GetVertexDof()];
+-					this->inputs->AddInput(new TriaP1Input(name,values));
+-					return;
+-				}
+-				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+-			}
+-		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputUpdateFromVector(int* vector, int name, int type) {{{*/
+-void  Matice::InputUpdateFromVector(int* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
+-void  Matice::InputUpdateFromVector(bool* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type) {{{*/
+-void  Matice::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
+-
+-	/*Intermediaries*/
+-	Element *element      = NULL;
+-	Parameters* parameters= NULL;
+-	int         dim;
+-
+-	/*Recover element*/
+-	element=(Element*)helement->delivers();
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	switch(type){
+-
+-		case VertexEnum:
+-
+-			switch(element->ObjectEnum()){
+-
+-				case TriaEnum: {
+-					IssmDouble values[3];
+-					for (int i=0;i<3;i++) values[i]=vector[((Tria*)element)->nodes[i]->GetSidList()]; //use sid list, to index into serial oriented vector 
+-					this->inputs->AddInput(new TriaP1Input(name,values));
+-					/*Special case for rheology B in 2D: Pourave land for this solution{{{*/
+-					if(name==MaterialsRheologyBEnum){
+-						/*Are we in 2D?:*/
+-						if(element->ObjectEnum()==TriaEnum){
+-							parameters=((Tria*)(element))->parameters;
+-						}
+-						else{
+-							parameters=((Penta*)(element))->parameters;
+-						}
+-						parameters->FindParam(&dim,MeshDimensionEnum);
+-						if(dim==2){
+-							/*Dupliacte rheology input: */
+-							this->inputs->AddInput(new TriaP1Input(MaterialsRheologyBbarEnum,values));
+-						}
+-					}
+-					/*}}}*/
+-					return;
+-				}
+-				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+-			}
+-		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+-	}
+-
+-
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputUpdateFromMatrixDakota(int* vector, int name, int type) {{{*/
+-void  Matice::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputUpdateFromVectorDakota(int* vector, int name, int type) {{{*/
+-void  Matice::InputUpdateFromVectorDakota(int* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputUpdateFromVectorDakota(bool* vector, int name, int type) {{{*/
+-void  Matice::InputUpdateFromVectorDakota(bool* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION 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){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputUpdateFromConstant(bool constant, int name) {{{*/
+-void  Matice::InputUpdateFromConstant(bool constant, int name){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputUpdateFromSolution{{{*/
+-void  Matice::InputUpdateFromSolution(IssmDouble* solution){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matice::InputUpdateFromIoModel{{{*/
+-void Matice::InputUpdateFromIoModel(int index, IoModel* iomodel){
+-
+-	int i,j;
+-
+-	int    dim;
+-	bool   control_analysis;
+-	int    num_control_type;
+-
+-	/*Fetch parameters: */
+-	iomodel->Constant(&dim,MeshDimensionEnum);
+-	iomodel->Constant(&control_analysis,InversionIscontrolEnum);
+-	if(control_analysis) iomodel->Constant(&num_control_type,InversionNumControlParametersEnum);
+-
+-	/*if 2d*/
+-	if(dim==2){
+-
+-		/*Intermediaries*/
+-		const int num_vertices = 3; //Tria has 3 vertices
+-		IssmDouble    nodeinputs[num_vertices];
+-		IssmDouble    cmmininputs[num_vertices];
+-		IssmDouble    cmmaxinputs[num_vertices];
+-
+-		/*Get B*/
+-		if (iomodel->Data(MaterialsRheologyBEnum)) {
+-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
+-			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyBbarEnum,nodeinputs));
+-		}
+-
+-		/*Get n*/
+-		if (iomodel->Data(MaterialsRheologyNEnum)) {
+-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyNEnum)[index];
+-			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyNEnum,nodeinputs));
+-		}
+-
+-		/*Control Inputs*/
+-		#ifdef _HAVE_CONTROL_
+-		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+-			for(i=0;i<num_control_type;i++){
+-				switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
+-					case MaterialsRheologyBbarEnum:
+-						if (iomodel->Data(MaterialsRheologyBEnum)){
+-							_assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
+-							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
+-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							this->inputs->AddInput(new ControlInput(MaterialsRheologyBbarEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-						}
+-						break;
+-				}
+-			}
+-		}
+-		#endif
+-	}
+-
+-	/*if 3d*/
+-	#ifdef _HAVE_3D_
+-	else if(dim==3){
+-
+-		/*Intermediaries*/
+-		const int num_vertices = 6; //Penta has 6 vertices
+-		IssmDouble    nodeinputs[num_vertices];
+-		IssmDouble    cmmininputs[num_vertices];
+-		IssmDouble    cmmaxinputs[num_vertices];
+-
+-		/*Get B*/
+-		if (iomodel->Data(MaterialsRheologyBEnum)) {
+-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
+-			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,nodeinputs));
+-		}
+-
+-		/*Get n*/
+-		if (iomodel->Data(MaterialsRheologyNEnum)) {
+-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyNEnum)[index];
+-			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyNEnum,nodeinputs));
+-		}
+-
+-		/*Control Inputs*/
+-		#ifdef _HAVE_CONTROL_
+-		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+-			for(i=0;i<num_control_type;i++){
+-				switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
+-					case MaterialsRheologyBbarEnum:
+-						if (iomodel->Data(MaterialsRheologyBEnum)){
+-							_assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
+-							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
+-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-						}
+-						break;
+-				}
+-			}
+-		}
+-		#endif
+-	}
+-	#endif
+-	else{
+-		_error2_("Mesh type not supported yet!");
+-	}
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::IsInput{{{*/
+-bool Matice::IsInput(int name){
+-	if (
+-				name==MaterialsRheologyBEnum ||
+-				name==MaterialsRheologyBbarEnum ||
+-				name==MaterialsRheologyNEnum
+-		){
+-		return true;
+-	}
+-	else return false;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Material.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Material.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Material.h	(revision 12822)
+@@ -1,27 +0,0 @@
+-/*!\file:  Material.h
+- * \brief abstract class for Material object
+- */ 
+-
+-
+-#ifndef _MATERIAL_H_
+-#define _MATERIAL_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-class Object;
+-#include "../Object.h"
+-#include "../../toolkits/toolkits.h"
+-/*}}}*/
+-
+-class Material: public Object,public Update{
+-
+-	public: 
+-		virtual       ~Material(){};
+-
+-		/*Numerics*/
+-		virtual void   InputDuplicate(int original_enum,int new_enum)=0;
+-		virtual void   Configure(Elements* elements)=0;
+-		virtual void   GetVectorFromInputs(Vector* vector,int input_enum)=0;
+-
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matpar.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matpar.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matpar.cpp	(revision 12822)
+@@ -1,361 +0,0 @@
+-/*!\file Matpar.c
+- * \brief: implementation of the Matpar object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-		
+-/*Matpar constructors and destructor*/
+-/*FUNCTION Matpar::Matpar() {{{*/
+-Matpar::Matpar(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::Matpar(int matpar_mid,IoModel* iomodel){{{*/
+-Matpar::Matpar(int matpar_mid, IoModel* iomodel){
+-
+-	this->mid = matpar_mid;
+-	iomodel->Constant(&this->rho_ice,MaterialsRhoIceEnum);
+-	iomodel->Constant(&this->rho_water,MaterialsRhoWaterEnum);
+-	iomodel->Constant(&this->rho_freshwater,MaterialsRhoFreshwaterEnum);
+-	iomodel->Constant(&this->mu_water,MaterialsMuWaterEnum);
+-	iomodel->Constant(&this->heatcapacity,MaterialsHeatcapacityEnum);
+-	iomodel->Constant(&this->thermalconductivity,MaterialsThermalconductivityEnum);
+-	iomodel->Constant(&this->latentheat,MaterialsLatentheatEnum);
+-	iomodel->Constant(&this->beta,MaterialsBetaEnum);
+-	iomodel->Constant(&this->meltingpoint,MaterialsMeltingpointEnum);
+-	iomodel->Constant(&this->referencetemperature,ConstantsReferencetemperatureEnum);
+-	iomodel->Constant(&this->mixed_layer_capacity,MaterialsMixedLayerCapacityEnum);
+-	iomodel->Constant(&this->thermal_exchange_velocity,MaterialsThermalExchangeVelocityEnum);
+-	iomodel->Constant(&this->g,ConstantsGEnum);
+-	
+-	iomodel->Constant(&this->hydro_CR,HydrologyCREnum);
+-	iomodel->Constant(&this->kn,HydrologyKnEnum);
+-	iomodel->Constant(&this->hydro_n,HydrologyNEnum);
+-	iomodel->Constant(&this->hydro_p,HydrologyPEnum);
+-	iomodel->Constant(&this->hydro_q,HydrologyQEnum);
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::~Matpar() {{{*/
+-Matpar::~Matpar(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Matpar::Echo {{{*/
+-void Matpar::Echo(void){
+-
+-	_printLine_("Matpar:");
+-	_printLine_("   mid: " << mid);
+-	_printLine_("   rho_ice: " << rho_ice);
+-	_printLine_("   rho_water: " << rho_water);
+-	_printLine_("   rho_freshwater: " << rho_freshwater);
+-	_printLine_("   mu_water: " << mu_water);
+-	_printLine_("   heatcapacity: " << heatcapacity);
+-	_printLine_("   thermalconductivity: " << thermalconductivity);
+-	_printLine_("   latentheat: " << latentheat);
+-	_printLine_("   beta: " << beta);
+-	_printLine_("   meltingpoint: " << meltingpoint);
+-	_printLine_("   referencetemperature: " << referencetemperature);
+-	_printLine_("   mixed_layer_capacity: " << mixed_layer_capacity);
+-	_printLine_("   thermal_exchange_velocity: " << thermal_exchange_velocity);
+-	_printLine_("   g: " << g);
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::DeepEcho {{{*/
+-void Matpar::DeepEcho(void){
+-
+-	this->Echo();
+-}		
+-/*}}}*/
+-/*FUNCTION Matpar::Id {{{*/
+-int    Matpar::Id(void){ return mid; }
+-/*}}}*/
+-/*FUNCTION Matpar::MyRank {{{*/
+-int    Matpar::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::ObjectEnum{{{*/
+-int Matpar::ObjectEnum(void){
+-
+-	return MatparEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION 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){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromVector(int* vector, int name, int type) {{{*/
+-void   Matpar::InputUpdateFromVector(int* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
+-void   Matpar::InputUpdateFromVector(bool* 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){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromVectorDakota(int* vector, int name, int type) {{{*/
+-void   Matpar::InputUpdateFromVectorDakota(int* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromVectorDakota(bool* vector, int name, int type) {{{*/
+-void   Matpar::InputUpdateFromVectorDakota(bool* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromMatrixDakota(int* vector, 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){
+-
+-	switch(name){
+-		case MaterialsRhoIceEnum:
+-			this->rho_ice=constant;
+-			break;
+-		case MaterialsRhoWaterEnum:
+-			this->rho_water=constant;
+-			break;
+-		case MaterialsRhoFreshwaterEnum:
+-			this->rho_freshwater=constant;
+-			break;
+-		case MaterialsMuWaterEnum:
+-			this->mu_water=constant;
+-			break;
+-		case MaterialsHeatcapacityEnum:
+-			this->heatcapacity=constant;
+-			break;
+-		case MaterialsThermalconductivityEnum:
+-			this->thermalconductivity=constant;
+-			break;
+-		case  MaterialsLatentheatEnum:
+-			this->latentheat=constant;
+-			break;
+-		case  MaterialsBetaEnum:
+-			this->beta=constant;
+-			break;
+-		case  MaterialsMeltingpointEnum:
+-			this->meltingpoint=constant;
+-			break;
+-		case  ConstantsReferencetemperatureEnum:
+-			this->referencetemperature=constant;
+-			break;
+-		case  MaterialsMixedLayerCapacityEnum:
+-			this->mixed_layer_capacity=constant;
+-			break;
+-		case  MaterialsThermalExchangeVelocityEnum:
+-			this->thermalconductivity=constant;
+-			break;
+-		case  ConstantsGEnum:
+-			this->g=constant;
+-			break;
+-		default: 
+-			break;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION 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){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromSolution{{{*/
+-void   Matpar::InputUpdateFromSolution(IssmDouble* solution){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-
+-/*Matpar management: */
+-/*FUNCTION Matpar::Configure {{{*/
+-void  Matpar::Configure(Elements* elementsin){
+-
+-	/*nothing done yet!*/
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetBeta {{{*/
+-IssmDouble Matpar::GetBeta(){
+-	return beta;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetG {{{*/
+-IssmDouble Matpar::GetG(){
+-	return g;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetHeatCapacity {{{*/
+-IssmDouble Matpar::GetHeatCapacity(){
+-	return heatcapacity;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetLatentHeat {{{*/
+-IssmDouble Matpar::GetLatentHeat(){
+-	return latentheat;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetMeltingPoint {{{*/
+-IssmDouble Matpar::GetMeltingPoint(){
+-	return meltingpoint;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetReferenceTemperature {{{*/
+-IssmDouble Matpar::GetReferenceTemperature(){
+-	return referencetemperature;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetMixedLayerCapacity {{{*/
+-IssmDouble Matpar::GetMixedLayerCapacity(){
+-	return mixed_layer_capacity;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetRhoIce {{{*/
+-IssmDouble Matpar::GetRhoIce(){
+-	
+-	return rho_ice;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetRhoWater {{{*/
+-IssmDouble Matpar::GetRhoWater(){
+-	return rho_water;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetRhoFreshwater {{{*/
+-IssmDouble Matpar::GetRhoFreshwater(){
+-	return rho_freshwater;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetMuWater {{{*/
+-IssmDouble Matpar::GetMuWater(){
+-	return mu_water;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetThermalConductivity {{{*/
+-IssmDouble Matpar::GetThermalConductivity(){
+-	return thermalconductivity;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetThermalExchangeVelocity {{{*/
+-IssmDouble Matpar::GetThermalExchangeVelocity(){
+-	return thermal_exchange_velocity;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetKn {{{*/		 
+-IssmDouble Matpar::GetKn(){			 
+-	return kn;		 
+-}		 
+-/*}}}*/			 
+-/*FUNCTION Matpar::GetHydrologyP {{{*/			 
+-IssmDouble Matpar::GetHydrologyP(){		 
+-	return hydro_p;			 
+-}		 
+-/*}}}*/			 
+-/*FUNCTION Matqar::GetHydrologyQ {{{*/			 
+-IssmDouble Matpar::GetHydrologyQ(){		 
+-	return hydro_q;			 
+-}		 
+-/*}}}*/			 
+-/*FUNCTION Matpar::GetHydrologyCR {{{*/		 
+-IssmDouble Matpar::GetHydrologyCR(){		 
+-	return hydro_CR;		 
+-}		 
+-/*}}}*/			 
+-/*FUNCTION Matpar::GetHydrologyN {{{*/			 
+-IssmDouble Matpar::GetHydrologyN(){		 
+-	return hydro_n;			 
+-}		 
+-/*}}}*/ 
+-/*FUNCTION Matpar::TMeltingPoint {{{*/
+-IssmDouble Matpar::TMeltingPoint(IssmDouble pressure){
+-	return meltingpoint-beta*pressure;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::PureIceEnthalpy{{{*/
+-IssmDouble Matpar::PureIceEnthalpy(IssmDouble pressure){
+-	return heatcapacity*(TMeltingPoint(pressure)-referencetemperature);
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::GetEnthalpyDiffusionParameter{{{*/
+-IssmDouble Matpar::GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){
+-	if(enthalpy<PureIceEnthalpy(pressure)){
+-		return thermalconductivity/(rho_ice*heatcapacity);
+-	}
+-	else{
+-		return 0.1*thermalconductivity/(rho_ice*heatcapacity);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::EnthalpyToThermal {{{*/
+-void Matpar::EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){
+-
+-	/*Ouput*/
+-	IssmDouble temperature,waterfraction;
+-	
+-	if(enthalpy<PureIceEnthalpy(pressure)){
+-		temperature=referencetemperature+enthalpy/heatcapacity;
+-		waterfraction=0;
+-	}
+-	else{
+-		temperature=TMeltingPoint(pressure);
+-		waterfraction=(enthalpy-PureIceEnthalpy(pressure))/latentheat;
+-	}
+-
+-	/*Assign output pointers:*/
+-	*pwaterfraction=waterfraction;
+-	*ptemperature=temperature;
+-}
+-/*}}}*/
+-/*FUNCTION Matpar::ThermalToEnthalpy {{{*/
+-void Matpar::ThermalToEnthalpy(IssmDouble * penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){
+-
+-	/*Ouput*/
+-	IssmDouble enthalpy;
+-	
+-	if(temperature<TMeltingPoint(pressure)){
+-		enthalpy=heatcapacity*(temperature-referencetemperature);
+-	}
+-	else{
+-		enthalpy=PureIceEnthalpy(pressure)+latentheat*waterfraction;
+-	}
+-
+-	/*Assign output pointers:*/
+-	*penthalpy=enthalpy;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matice.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matice.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matice.h	(revision 12822)
+@@ -1,74 +0,0 @@
+-/*!\file Matice.h
+- * \brief: header file for matice object
+- */
+-
+-#ifndef MATICE_H_
+-#define MATICE_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Material.h"
+-class IoModel;
+-/*}}}*/
+-
+-class Matice: public Material{
+-
+-	private: 
+-		/*Id*/
+-		int	   mid;
+-
+-		/*hooks: */
+-		Hook* helement;
+-
+-	public:
+-		/*WARNING: input should not be public but it is an easy way to update B from T (using UpdateFromSolution) from Pentas*/
+-		Inputs*  inputs;
+-
+-		/*Matice constructors, destructors: {{{*/
+-		Matice();
+-		Matice(int mid,int i, IoModel* iomodel);
+-		~Matice();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Update virtual functions definitions: {{{*/
+-		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVector(int* vector, int name, int type);
+-		void  InputUpdateFromVector(bool* 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);
+-		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
+-		void  InputUpdateFromConstant(IssmDouble constant, int name);
+-		void  InputUpdateFromConstant(int constant, int name);
+-		void  InputUpdateFromConstant(bool constant, int name);
+-		void  InputUpdateFromSolution(IssmDouble* solution);
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel);
+-		/*}}}*/
+-		/*Material virtual functions resolution: {{{*/
+-		void   InputDuplicate(int original_enum,int new_enum);
+-		void   Configure(Elements* elements);
+-		void   GetVectorFromInputs(Vector* vector,int input_enum);
+-		/*}}}*/
+-		/*Matice Numerics: {{{*/
+-		void   SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
+-		void   GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
+-		void   GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon);
+-		void   GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon);
+-		void   GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
+-		void   GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
+-		void   GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
+-		IssmDouble GetB();
+-		IssmDouble GetBbar();
+-		IssmDouble GetN();
+-		bool   IsInput(int name);
+-		/*}}}*/
+-};
+-
+-#endif  /* _MATICE_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matpar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matpar.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Materials/Matpar.h	(revision 12822)
+@@ -1,99 +0,0 @@
+-/*!\file Matpar.h
+- * \brief: header file for matpar object
+- */
+-
+-#ifndef _MATPAR_H_
+-#define _MATPAR_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Material.h"
+-class IoModel;
+-/*}}}*/
+-
+-class Matpar: public Material{
+-
+-	private: 
+-		int	  mid;
+-		IssmDouble  rho_ice; 
+-		IssmDouble  rho_water;
+-		IssmDouble  rho_freshwater;
+-		IssmDouble  mu_water;
+-		IssmDouble  heatcapacity;
+-		IssmDouble  thermalconductivity;
+-		IssmDouble  latentheat;
+-		IssmDouble  beta;
+-		IssmDouble  meltingpoint;
+-		IssmDouble  referencetemperature;
+-		IssmDouble  mixed_layer_capacity;
+-		IssmDouble  thermal_exchange_velocity;
+-		IssmDouble  g;
+-
+-		/*hydrology: */		 
+-		IssmDouble  kn;			 
+-		IssmDouble  hydro_p;		 
+-		IssmDouble  hydro_q;		 
+-		IssmDouble  hydro_CR;			 
+-		IssmDouble  hydro_n; 
+-
+-	public:
+-		Matpar();
+-		Matpar(int matpar_id, IoModel* iomodel);
+-		~Matpar();
+-
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Update virtual functions resolution: {{{*/
+-		void   InputUpdateFromVector(IssmDouble* vector, int name, int type);
+-		void   InputUpdateFromVector(int* vector, int name, int type);
+-		void   InputUpdateFromVector(bool* vector, int name, int type);
+-		void   InputUpdateFromMatrixDakota(IssmDouble* matrix,int nrows,int ncols, int name, int type);
+-		void   InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
+-		void   InputUpdateFromVectorDakota(int* vector, int name, int type);
+-		void   InputUpdateFromVectorDakota(bool* vector, int name, int type);
+-		void   InputUpdateFromConstant(IssmDouble constant, int name);
+-		void   InputUpdateFromConstant(int constant, int name);
+-		void   InputUpdateFromConstant(bool constant, int name);
+-		void   InputUpdateFromSolution(IssmDouble* solution);
+-		void   InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
+-		/*}}}*/
+-		/*Material virtual functions resolution: {{{*/
+-		void   InputDuplicate(int original_enum,int new_enum){_error2_("not implemented yet");};
+-		void   Configure(Elements* elements);
+-		void   GetVectorFromInputs(Vector* vector,int input_enum){return;}
+-		/*}}}*/
+-		/*Numerics: {{{*/
+-		IssmDouble GetG();
+-		IssmDouble GetRhoIce();
+-		IssmDouble GetRhoWater();
+-		IssmDouble GetRhoFreshwater();
+-		IssmDouble GetMuWater();
+-		IssmDouble GetMixedLayerCapacity();
+-		IssmDouble GetThermalExchangeVelocity();
+-		IssmDouble GetHeatCapacity();
+-		IssmDouble GetThermalConductivity();
+-		IssmDouble GetLatentHeat();
+-		IssmDouble GetBeta();
+-		IssmDouble GetMeltingPoint();
+-		IssmDouble GetReferenceTemperature();
+-		IssmDouble GetKn();
+-		IssmDouble GetHydrologyP();
+-		IssmDouble GetHydrologyQ();
+-		IssmDouble GetHydrologyCR();
+-		IssmDouble GetHydrologyN();
+-		IssmDouble TMeltingPoint(IssmDouble pressure);
+-		IssmDouble PureIceEnthalpy(IssmDouble pressure);
+-		IssmDouble GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure);
+-		void   EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
+-		void   ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
+-		/*}}}*/
+-
+-};
+-
+-#endif  /* _MATPAR_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DoubleInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DoubleInput.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DoubleInput.h	(revision 12822)
+@@ -1,84 +0,0 @@
+-/*! \file DoubleInput.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _DOUBLEINPUT_H_
+-#define _DOUBLEINPUT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Input.h"
+-#include "../../include/include.h"
+-class GaussTria;
+-/*}}}*/
+-
+-class DoubleInput: public Input{
+-
+-	public:
+-		int    enum_type;
+-		IssmDouble value;
+-
+-		/*DoubleInput constructors, destructors: {{{*/
+-		DoubleInput();
+-		DoubleInput(int enum_type,IssmDouble value);
+-		~DoubleInput();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*DoubleInput management: {{{*/
+-		int   InstanceEnum();
+-		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB);
+-		Input* PointwiseMin(Input* inputB);
+-		Input* PointwiseMax(Input* inputB);
+-		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+-		void Configure(Parameters* parameters);
+-		/*}}}*/
+-		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue);
+-		void GetInputValue(int* pvalue);
+-		void GetInputValue(IssmDouble* pvalue);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void ChangeEnum(int newenumtype);
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum);
+-		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar);
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+-		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
+-		IssmDouble Max(void);
+-		IssmDouble MaxAbs(void);
+-		IssmDouble Min(void);
+-		IssmDouble MinAbs(void);
+-		void Extrude(void){_error2_("not supported yet");};
+-		void VerticallyIntegrate(Input* thickness_input);
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+-		/*}}}*/
+-
+-};
+-#endif  /* _DOUBLEINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/ControlInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/ControlInput.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/ControlInput.cpp	(revision 12822)
+@@ -1,282 +0,0 @@
+-/*!\file ControlInput.c
+- * \brief: implementation of the ControlInput object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*ControlInput constructors and destructor*/
+-/*FUNCTION ControlInput::ControlInput(){{{*/
+-ControlInput::ControlInput(){
+-	control_id  = 0;
+-	values      = NULL;
+-	savedvalues = NULL;
+-	minvalues   = NULL;
+-	maxvalues   = NULL;
+-	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){
+-
+-	control_id=id;
+-	enum_type=in_enum_type;
+-
+-	switch(enum_input){
+-		case TriaP1InputEnum:
+-			values     =new TriaP1Input(enum_type,pvalues);
+-			savedvalues=new TriaP1Input(enum_type,pvalues);
+-			minvalues  =new TriaP1Input(enum_type,pmin);
+-			maxvalues  =new TriaP1Input(enum_type,pmax);
+-			break;
+-		case PentaP1InputEnum:
+-			values     =new PentaP1Input(enum_type,pvalues);
+-			savedvalues=new PentaP1Input(enum_type,pvalues);
+-			minvalues  =new PentaP1Input(enum_type,pmin);
+-			maxvalues  =new PentaP1Input(enum_type,pmax);
+-			break;
+-		default:
+-			_error2_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput");
+-	}
+-	gradient   =NULL;
+-}
+-/*}}}*/
+-/*FUNCTION ControlInput::~ControlInput(){{{*/
+-ControlInput::~ControlInput(){
+-	delete values;
+-	delete savedvalues;
+-	delete minvalues;
+-	delete maxvalues;
+-	delete gradient;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-		/*FUNCTION ControlInput::Echo {{{*/
+-void ControlInput::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION ControlInput::DeepEcho{{{*/
+-void ControlInput::DeepEcho(void){
+-
+-	_printLine_("ControlInput:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("---values: ");     if (values)      values->Echo();
+-	_printLine_("---savedvalues: ");if (savedvalues) savedvalues->Echo();
+-	_printLine_("---minvalues: ");  if (minvalues)   minvalues->Echo();
+-	_printLine_("---maxvalues: ");  if (maxvalues)   maxvalues->Echo();
+-	_printLine_("---gradient: ");   if (gradient)    gradient->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION ControlInput::Id{{{*/
+-int    ControlInput::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION ControlInput::MyRank{{{*/
+-int    ControlInput::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION ControlInput::ObjectEnum{{{*/
+-int ControlInput::ObjectEnum(void){
+-
+-	return ControlInputEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION ControlInput::copy{{{*/
+-Object* ControlInput::copy() {
+-	
+-	ControlInput* output=NULL;
+-
+-	output = new ControlInput();
+-	output->enum_type=this->enum_type;
+-	output->control_id=this->control_id;
+-
+-	if(values)      output->values=(Input*)this->values->copy();
+-	if(savedvalues) output->savedvalues=(Input*)this->savedvalues->copy();
+-	if(minvalues)   output->minvalues=(Input*)this->minvalues->copy();
+-	if(maxvalues)   output->maxvalues=(Input*)this->maxvalues->copy();
+-	if(gradient)    output->gradient=(Input*)this->gradient->copy();
+-
+-	return output;
+-}
+-/*}}}*/
+-	
+-/*ControlInput management*/
+-/*FUNCTION ControlInput::InstanceEnum{{{*/
+-int ControlInput::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-
+-/*Object functions*/
+-/*FUNCTION ControlInput::Constrain(){{{*/
+-void ControlInput::Constrain(void){
+-
+-	Input* newvalues=NULL;
+-
+-	newvalues=this->values->PointwiseMin(maxvalues);
+-	delete values; this->values=newvalues;
+-	newvalues=this->values->PointwiseMax(minvalues);
+-	delete values; this->values=newvalues;
+-}/*}}}*/
+-/*FUNCTION ControlInput::Constrain(IssmDouble min, IssmDouble max){{{*/
+-void ControlInput::Constrain(IssmDouble min, IssmDouble max){
+-	   values->Constrain(min,max);
+-}/*}}}*/
+-/*FUNCTION ControlInput::Extrude{{{*/
+-void ControlInput::Extrude(void){
+-	values->Extrude();
+-	savedvalues->Extrude();
+-	//gradient->Extrude();
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetGradient{{{*/
+-void ControlInput::GetGradient(Vector* gradient_vec,int* doflist){
+-	if(gradient) gradient->GetVectorFromInputs(gradient_vec,doflist);
+-}/*}}}*/
+-/*FUNCTION ControlInput::ScaleGradient{{{*/
+-void ControlInput::ScaleGradient(IssmDouble scaling_factor){
+-	if(!gradient) _error2_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");
+-	gradient->Scale(scaling_factor);
+-}/*}}}*/
+-/*FUNCTION ControlInput::SetGradient{{{*/
+-void ControlInput::SetGradient(Input* gradient_in){
+-
+-	/*Get enum for current gradient*/
+-	switch(this->control_id){
+-		case 1:
+-			gradient_in->ChangeEnum(Gradient1Enum);
+-			break;
+-		case 2:
+-			gradient_in->ChangeEnum(Gradient2Enum);
+-			break;
+-		case 3:
+-			gradient_in->ChangeEnum(Gradient3Enum);
+-			break;
+-		default:
+-			_error2_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated.");
+-	}
+-
+-	/*Delete old gradient and assign new gradient*/
+-	if(gradient) delete gradient;
+-	gradient=gradient_in;
+-
+-}/*}}}*/
+-/*FUNCTION ControlInput::SetInput{{{*/
+-void ControlInput::SetInput(Input* in_input){
+-
+-	delete values; this->values=in_input;
+-	this->SaveValue(); //because this is what SpawnResult saves FIXME
+-
+-}/*}}}*/
+-/*FUNCTION ControlInput::SpawnResult{{{*/
+-ElementResult* ControlInput::SpawnResult(int step, IssmDouble time){
+-	return savedvalues->SpawnResult(step,time);
+-}/*}}}*/
+-/*FUNCTION ControlInput::SpawnTriaInput{{{*/
+-Input* ControlInput::SpawnTriaInput(int* indices){
+-	return values->SpawnTriaInput(indices);
+-}/*}}}*/
+-/*FUNCTION ControlInput::SpawnGradient{{{*/
+-ElementResult* ControlInput::SpawnGradient(int step, IssmDouble time){
+-	_assert_(gradient);
+-	return gradient->SpawnResult(step,time);
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){{{*/
+-void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){
+-	values->GetVectorFromInputs(vector,doflist);
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){{{*/
+-void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){
+-	 if(strcmp(data,"value")==0){
+-		 _assert_(values);
+-		 values->GetVectorFromInputs(vector,doflist);
+-	 }
+-	 else if (strcmp(data,"lowerbound")==0){
+-		 _assert_(minvalues);
+-		 minvalues->GetVectorFromInputs(vector,doflist);
+-	 }
+-	 else if (strcmp(data,"upperbound")==0){
+-		 _assert_(maxvalues);
+-		 maxvalues->GetVectorFromInputs(vector,doflist);
+-	 }
+-	 else if (strcmp(data,"gradient")==0){
+-		 _assert_(gradient);
+-		 gradient->GetVectorFromInputs(vector,doflist);
+-	 }
+-	 else{
+-		 _error2_("Data " << data << " not supported yet");
+-	 }
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetInputAverage(IssmDouble* pvalue){{{*/
+-void ControlInput::GetInputAverage(IssmDouble* pvalue){
+-	values->GetInputAverage(pvalue);
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetInputValue(bool* pvalue){{{*/
+-void ControlInput::GetInputValue(bool* pvalue){
+-	values->GetInputValue(pvalue);
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetInputValue(int* pvalue){{{*/
+-void ControlInput::GetInputValue(int* pvalue){
+-	values->GetInputValue(pvalue);
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void ControlInput::GetInputValue(IssmDouble* pvalue){
+-	values->GetInputValue(pvalue);
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void ControlInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){
+-	values->GetInputValue(pvalue,gauss);
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void ControlInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){
+-	values->GetInputValue(pvalue,gauss);
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){
+-	values->GetInputDerivativeValue(derivativevalues,xyz_list,gauss);
+-}/*}}}*/
+-/*FUNCTION ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){
+-	values->GetInputDerivativeValue(derivativevalues,xyz_list,gauss);
+-}/*}}}*/
+-/*FUNCTION ControlInput::SaveValue{{{*/
+-void ControlInput::SaveValue(void){
+-	if(!values) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
+-
+-	if(savedvalues) delete this->savedvalues;
+-	this->savedvalues=(Input*)this->values->copy();
+-}/*}}}*/
+-/*FUNCTION ControlInput::UpdateValue{{{*/
+-void ControlInput::UpdateValue(IssmDouble scalar){
+-	if(!gradient)    _error2_("Gradient of " << EnumToStringx(this->enum_type) << " not found");
+-	if(!savedvalues) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
+-
+-	if(values) delete this->values;
+-	this->values=(Input*)this->savedvalues->copy();
+-	this->values->AXPY(gradient,scalar);
+-}/*}}}*/
+-/*FUNCTION ControlInput::VerticallyIntegrate{{{*/
+-void ControlInput::VerticallyIntegrate(Input* thickness_input){
+-	values->VerticallyIntegrate(thickness_input);
+-}/*}}}*/
+-/*FUNCTION ControlInput::Configure{{{*/
+-void ControlInput::Configure(Parameters* parameters){
+-	/*do nothing: */
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/Input.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/Input.h	(revision 12822)
+@@ -1,69 +0,0 @@
+-/*!\file:  Input.h
+- * \brief abstract class for Input object
+- */ 
+-
+-
+-#ifndef _INPUT_H_
+-#define _INPUT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Object.h"
+-class Node;
+-class ElementResult;
+-class GaussTria;
+-class Parameters;
+-/*}}}*/
+-
+-class Input: public Object{
+-
+-	public: 
+-		
+-		virtual        ~Input(){};
+-
+-		virtual int  InstanceEnum()=0; 
+-		virtual void GetInputValue(bool* pvalue)=0;
+-		virtual void GetInputValue(int* pvalue)=0;
+-		virtual void GetInputValue(IssmDouble* pvalue)=0;
+-		virtual void GetInputValue(IssmDouble* pvalue,GaussTria* gauss)=0;
+-		virtual void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss)=0;
+-		virtual void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time)=0;
+-		virtual void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time)=0;
+-		virtual void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index)=0;
+-		virtual void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index)=0;
+-		virtual void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss)=0;
+-		virtual void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss)=0;
+-		virtual void GetInputAverage(IssmDouble* pvalue)=0;
+-		virtual void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss)=0;
+-		virtual void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss)=0;
+-		virtual void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss)=0;
+-		virtual void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss)=0;
+-		virtual void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss)=0;
+-		virtual void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss)=0;
+-		virtual void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss)=0;
+-		virtual void ChangeEnum(int newenumtype)=0;
+-		virtual void Configure(Parameters* parameters)=0;
+-
+-		virtual void   SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters)=0;
+-		virtual void   ConstrainMin(IssmDouble minimum)=0;
+-		virtual IssmDouble InfinityNorm(void)=0;
+-		virtual IssmDouble MaxAbs(void)=0;
+-		virtual IssmDouble MinAbs(void)=0;
+-		virtual IssmDouble Max(void)=0;
+-		virtual IssmDouble Min(void)=0;
+-		virtual void   Scale(IssmDouble scale_factor)=0;
+-		virtual void   ArtificialNoise(IssmDouble min,IssmDouble max)=0;
+-		virtual void   AXPY(Input* xinput,IssmDouble scalar)=0;
+-		virtual void   Constrain(IssmDouble cm_min, IssmDouble cm_max)=0;
+-		virtual void   VerticallyIntegrate(Input* thickness_input)=0;
+-		virtual void   Extrude()=0;
+-		virtual void   GetVectorFromInputs(Vector* vector,int* doflist)=0;
+-		virtual void   GetValuesPtr(IssmDouble** pvalues,int* pnum_values)=0;
+-		
+-		virtual Input* SpawnTriaInput(int* indices)=0;
+-		virtual Input* PointwiseDivide(Input* inputB)=0;
+-		virtual Input* PointwiseMax(Input* inputmax)=0;
+-		virtual Input* PointwiseMin(Input* inputmin)=0;
+-		virtual ElementResult* SpawnResult(int step, IssmDouble time)=0;
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/ControlInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/ControlInput.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/ControlInput.h	(revision 12822)
+@@ -1,98 +0,0 @@
+-/*! \file ControlInput.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _CONTROLINPUT_H_
+-#define _CONTROLINPUT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Input.h"
+-#include "../../include/include.h"
+-class GaussTria;
+-/*}}}*/
+-
+-class ControlInput: public Input{
+-
+-	public:
+-		int    enum_type;
+-		int    control_id;
+-		Input* values;
+-		Input* savedvalues;
+-		Input* minvalues;
+-		Input* maxvalues;
+-		Input* gradient;
+-
+-		/*ControlInput constructors, destructors: {{{*/
+-		ControlInput();
+-		ControlInput(int enum_type,int enum_input,IssmDouble* pvalues,IssmDouble* pmin,IssmDouble* pmax,int id);
+-		~ControlInput();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ControlInput management: {{{*/
+-		int    InstanceEnum();
+-		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
+-		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+-		void Configure(Parameters* parameters);
+-		/*}}}*/
+-		/*numerics: {{{*/
+-		void SetInput(Input* in_input);
+-		void GetInputValue(bool* pvalue);
+-		void GetInputValue(int* pvalue);
+-		void GetInputValue(IssmDouble* pvalue);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void ChangeEnum(int newenumtype){_error2_("not implemented yet");};
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error2_("not implemented yet");};
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar){_error2_("not implemented yet");};
+-		void Constrain(void);
+-		void Constrain(IssmDouble min,IssmDouble max);
+-		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
+-		IssmDouble Max(void){_error2_("not implemented yet");};
+-		IssmDouble MaxAbs(void){_error2_("not implemented yet");};
+-		IssmDouble Min(void){_error2_("not implemented yet");};
+-		IssmDouble MinAbs(void){_error2_("not implemented yet");};
+-		void Extrude(void);
+-		void VerticallyIntegrate(Input* thickness_input);
+-		void GetVectorFromInputs(Vector* vector,int* doflist,const char* data);
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not implemented yet");};
+-		ElementResult* SpawnGradient(int step, IssmDouble time);
+-		void GetGradient(Vector* gradient_vec,int* doflist);
+-		void ScaleGradient(IssmDouble scale);
+-		void SetGradient(Input* gradient_in);
+-		void UpdateValue(IssmDouble scalar);
+-		void SaveValue(void);
+-		/*}}}*/
+-
+-};
+-#endif  /* _CONTROLINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DatasetInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DatasetInput.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DatasetInput.cpp	(revision 12822)
+@@ -1,122 +0,0 @@
+-/*!\file DatasetInput.c
+- * \brief: implementation of the datasetinput object
+- */
+-/*Headers{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*DatasetInput constructors and destructor*/
+-/*FUNCTION DatasetInput::DatasetInput(){{{*/
+-DatasetInput::DatasetInput(){
+-	enum_type=UNDEF;
+-	inputs=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION DatasetInput::DatasetInput(int in_enum_type) {{{*/
+-DatasetInput::DatasetInput(int in_enum_type){
+-
+-	enum_type  = in_enum_type;
+-	inputs     = new Inputs();
+-}
+-/*}}}*/
+-/*FUNCTION DatasetInput::~DatasetInput(){{{*/
+-DatasetInput::~DatasetInput(){
+-	delete inputs;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-		/*FUNCTION DatasetInput::Echo {{{*/
+-void DatasetInput::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION DatasetInput::DeepEcho{{{*/
+-void DatasetInput::DeepEcho(void){
+-
+-	_printLine_("DatasetInput:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("---inputs: "); inputs->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION DatasetInput::Id{{{*/
+-int    DatasetInput::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DatasetInput::MyRank{{{*/
+-int    DatasetInput::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DatasetInput::ObjectEnum{{{*/
+-int DatasetInput::ObjectEnum(void){
+-
+-	return DatasetInputEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DatasetInput::copy{{{*/
+-Object* DatasetInput::copy() {
+-	
+-	DatasetInput* output=NULL;
+-
+-	output = new DatasetInput();
+-	output->enum_type=this->enum_type;
+-	output->inputs=(Inputs*)this->inputs->Copy();
+-
+-	return output;
+-}
+-/*}}}*/
+-/*FUNCTION DatasetInput::SpawnTriaInput{{{*/
+-Input* DatasetInput::SpawnTriaInput(int* indices){
+-
+-	/*output*/
+-	DatasetInput* outinput=NULL;
+-
+-	/*Create new Datasetinput (copy of current input)*/
+-	outinput=new DatasetInput();
+-	outinput->enum_type=this->enum_type;
+-	outinput->inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices);
+-
+-	/*Assign output*/
+-	return outinput;
+-}
+-/*}}}*/
+-	
+-/*DatasetInput management*/
+-/*FUNCTION DatasetInput::InstanceEnum{{{*/
+-int DatasetInput::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-
+-/*Object functions*/
+-/*FUNCTION DatasetInput::Configure{{{*/
+-void DatasetInput::Configure(Parameters* parameters){
+-	/*do nothing: */
+-}
+-/*}}}*/
+-/*FUNCTION DatasetInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int index){{{*/
+-void DatasetInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int index){
+-
+-	/*Get requested input within dataset*/
+-	if(index<0 || index > inputs->Size()-1) _error2_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");
+-	Input* input=(Input*)this->inputs->GetObjectByOffset(index);
+-	
+-	input->GetInputValue(pvalue,gauss);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DatasetInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DatasetInput.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DatasetInput.h	(revision 12822)
+@@ -1,92 +0,0 @@
+-/*! \file DatasetInput.h 
+- *  \brief: header file for datasetinput object
+- */
+-
+-
+-#ifndef _DATASETINPUT_H_
+-#define _DATASETINPUT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Input.h"
+-#include "../../include/include.h"
+-class GaussTria;
+-/*}}}*/
+-
+-class DatasetInput: public Input{
+-
+-	public:
+-		int    enum_type;
+-
+-		Inputs*     inputs;
+-
+-		/*DatasetInput constructors, destructors: {{{*/
+-		DatasetInput();
+-		DatasetInput(int enum_type);
+-		~DatasetInput();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id();
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*DatasetInput management: {{{*/
+-		int    InstanceEnum();
+-		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
+-		ElementResult* SpawnResult(int step, IssmDouble time){_error2_("not implemented yet");};
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+-		void Configure(Parameters* parameters);
+-		/*}}}*/
+-		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void ChangeEnum(int newenumtype){_error2_("not implemented yet");};
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error2_("not implemented yet");};
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar){_error2_("not implemented yet");};
+-		void Constrain(void){_error2_("not implemented yet");};
+-		void Constrain(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
+-		IssmDouble Max(void){_error2_("not implemented yet");};
+-		IssmDouble MaxAbs(void){_error2_("not implemented yet");};
+-		IssmDouble Min(void){_error2_("not implemented yet");};
+-		IssmDouble MinAbs(void){_error2_("not implemented yet");};
+-		void Extrude(void){_error2_("not implemented yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not implemented yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist){_error2_("not implemented yet");};
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not implemented yet");};
+-		ElementResult* SpawnGradient(int step, IssmDouble time){_error2_("not implemented yet");};
+-		void GetGradient(Vector* gradient_vec,int* doflist){_error2_("not implemented yet");};
+-		void ScaleGradient(IssmDouble scale){_error2_("not implemented yet");};
+-		void SetGradient(Input* gradient_in){_error2_("not implemented yet");};
+-		void UpdateValue(IssmDouble scalar){_error2_("not implemented yet");};
+-		void SaveValue(void){_error2_("not implemented yet");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _DATASETINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/IntInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/IntInput.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/IntInput.cpp	(revision 12822)
+@@ -1,199 +0,0 @@
+-/*!\file IntInput.c
+- * \brief: implementation of the IntInput object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*IntInput constructors and destructor*/
+-/*FUNCTION IntInput::IntInput(){{{*/
+-IntInput::IntInput(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::IntInput(IssmDouble* values){{{*/
+-IntInput::IntInput(int in_enum_type,IssmInt in_value){
+-
+-	enum_type=in_enum_type;
+-	value=in_value;
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::~IntInput(){{{*/
+-IntInput::~IntInput(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION IntInput::DeepEcho{{{*/
+-void IntInput::DeepEcho(void){
+-
+-	_printLine_("IntInput:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << (int)this->value);
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::Id{{{*/
+-int    IntInput::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION IntInput::MyRank{{{*/
+-int    IntInput::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::ObjectEnum{{{*/
+-int IntInput::ObjectEnum(void){
+-
+-	return IntInputEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::copy{{{*/
+-Object* IntInput::copy() {
+-	
+-	return new IntInput(this->enum_type,this->value);
+-
+-}
+-/*}}}*/
+-
+-/*IntInput management*/
+-/*FUNCTION IntInput::Echo {{{*/
+-void IntInput::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::InstanceEnum{{{*/
+-int IntInput::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::SpawnTriaInput{{{*/
+-Input* IntInput::SpawnTriaInput(int* indices){
+-
+-	/*output*/
+-	IntInput* outinput=new IntInput();
+-
+-	/*only copy current value*/
+-	outinput->enum_type=this->enum_type;
+-	outinput->value=this->value;
+-
+-	/*Assign output*/
+-	return outinput;
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::SpawnResult{{{*/
+-ElementResult* IntInput::SpawnResult(int step, IssmDouble time){
+-	
+-	_error2_("not supported yet!");
+-
+-}
+-/*}}}*/
+-
+-/*Object functions*/
+-/*FUNCTION IntInput::GetInputValue(bool* pvalue) {{{*/
+-void IntInput::GetInputValue(bool* pvalue){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION IntInput::GetInputValue(int* pvalue){{{*/
+-void IntInput::GetInputValue(int* pvalue){
+-	*pvalue=value;
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue){
+-	_error2_("IntInput cannot return a IssmDouble in parallel");
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION IntInput::ChangeEnum{{{*/
+-void IntInput::ChangeEnum(int newenumtype){
+-	this->enum_type=newenumtype;
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::SquareMin{{{*/
+-void IntInput::SquareMin(IssmDouble* psquaremin, bool process_units,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){
+-	IssmDouble dvalue=(IssmDouble)value*scale_factor;
+-	value=reCast<int>(dvalue);
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::AXPY{{{*/
+-void IntInput::AXPY(Input* xinput,IssmDouble scalar){
+-
+-	IssmDouble dvalue;
+-	IntInput*  xintinput=NULL;
+-
+-	/*xinput is of the same type, so cast it: */
+-	xintinput=(IntInput*)xinput;
+-
+-	/*Carry out the AXPY operation depending on type:*/
+-	switch(xinput->ObjectEnum()){
+-
+-		case IntInputEnum:
+-			dvalue=(IssmDouble)this->value+scalar*(IssmDouble)xintinput->value;
+-			this->value=reCast<int>(dvalue);
+-			return;
+-
+-		default:
+-			_error2_("not implemented yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::Constrain{{{*/
+-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* vector,int* doflist){
+-
+-	_error2_("not supporte yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::GetValuesPtr{{{*/
+-void IntInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+-
+-	_error2_("not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntInput::Configure{{{*/
+-void IntInput::Configure(Parameters* parameters){
+-	/*do nothing: */
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/BoolInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/BoolInput.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/BoolInput.cpp	(revision 12822)
+@@ -1,193 +0,0 @@
+-/*!\file BoolInput.c
+- * \brief: implementation of the BoolInput object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*BoolInput constructors and destructor*/
+-/*FUNCTION BoolInput::BoolInput(){{{*/
+-BoolInput::BoolInput(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::BoolInput(IssmDouble* values){{{*/
+-BoolInput::BoolInput(int in_enum_type,IssmBool in_value){
+-
+-	enum_type=in_enum_type;
+-	value=in_value;
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::~BoolInput(){{{*/
+-BoolInput::~BoolInput(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION BoolInput::Echo {{{*/
+-void BoolInput::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::DeepEcho{{{*/
+-void BoolInput::DeepEcho(void){
+-
+-	_printLine_("BoolInput:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " <<(value?"true":"false"));
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::Id{{{*/
+-int    BoolInput::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION BoolInput::MyRank{{{*/
+-int    BoolInput::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::ObjectEnum{{{*/
+-int BoolInput::ObjectEnum(void){
+-
+-	return BoolInputEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::copy{{{*/
+-Object* BoolInput::copy() {
+-	
+-	return new BoolInput(this->enum_type,this->value);
+-
+-}
+-/*}}}*/
+-	
+-/*BoolInput management*/
+-/*FUNCTION BoolInput::InstanceEnum{{{*/
+-int BoolInput::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::SpawnTriaInput{{{*/
+-Input* BoolInput::SpawnTriaInput(int* indices){
+-
+-		/*output*/
+-		BoolInput* outinput=new BoolInput();
+-
+-		/*only copy current value*/
+-		outinput->enum_type=this->enum_type;
+-		outinput->value=this->value;
+-
+-		/*Assign output*/
+-		return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::SpawnResult{{{*/
+-ElementResult* BoolInput::SpawnResult(int step, IssmDouble time){
+-	
+-	return new BoolElementResult(this->enum_type,this->value,step,time);
+-
+-}
+-/*}}}*/
+-
+-/*Object functions*/
+-/*FUNCTION BoolInput::GetInputValue(bool* pvalue) {{{*/
+-void BoolInput::GetInputValue(bool* pvalue){
+-	*pvalue=value;
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::GetInputValue(int* pvalue){{{*/
+-void BoolInput::GetInputValue(int* pvalue){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION BoolInput::ChangeEnum{{{*/
+-void BoolInput::ChangeEnum(int newenumtype){
+-	this->enum_type=newenumtype;
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::SquareMin{{{*/
+-void BoolInput::SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){
+-	/*square of a bool is the bool itself: */
+-	*psquaremin=value;
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::Scale{{{*/
+-void BoolInput::Scale(IssmDouble scale_factor){
+-	/*a bool cannot be scaled: */
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::AXPY{{{*/
+-void BoolInput::AXPY(Input* xinput,IssmDouble scalar){
+-
+-	BoolInput*  xboolinput=NULL;
+-
+-	/*xinput is of the same type, so cast it: */
+-	xboolinput=(BoolInput*)xinput;
+-
+-	/*Carry out the AXPY operation depending on type:*/
+-	switch(xinput->ObjectEnum()){
+-
+-		case BoolInputEnum:
+-			this->value=reCast<bool,IssmDouble>(this->value+scalar*xboolinput->value);
+-			return;
+-
+-		default:
+-			_error2_("not implemented yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::Extrude{{{*/
+-void BoolInput::Extrude(void){
+-
+-	/*do nothing*/
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::GetVectorFromInputs{{{*/
+-void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){
+-
+-	_error2_("not supporte yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::GetValuesPtr{{{*/
+-void BoolInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+-
+-	_error2_("not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolInput::Configure{{{*/
+-void BoolInput::Configure(Parameters* parameters){
+-	/*do nothing: */
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/IntInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/IntInput.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/IntInput.h	(revision 12822)
+@@ -1,85 +0,0 @@
+-/*! \file IntInput.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _INTINPUT_H_
+-#define _INTINPUT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Input.h"
+-#include "../../include/include.h"
+-class GaussTria;
+-/*}}}*/
+-
+-class IntInput: public Input{
+-
+-	public:
+-		/*just hold 3 values for 3 vertices: */
+-		int    enum_type;
+-		IssmInt value;
+-
+-		/*IntInput constructors, destructors: {{{*/
+-		IntInput();
+-		IntInput(int enum_type,IssmInt value);
+-		~IntInput();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*IntInput management: {{{*/
+-		int   InstanceEnum();
+-		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
+-		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+-		void Configure(Parameters* parameters);
+-		/*}}}*/
+-		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue);
+-		void GetInputValue(int* pvalue);
+-		void GetInputValue(IssmDouble* pvalue);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void ChangeEnum(int newenumtype);
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar);
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+-		IssmDouble InfinityNorm(void){_error2_("InfinityNorm not implemented for integers");};
+-		IssmDouble Max(void){_error2_("Max not implemented for integers");};
+-		IssmDouble MaxAbs(void){_error2_("Max not implemented for integers");};
+-		IssmDouble Min(void){_error2_("Min not implemented for integers");};
+-		IssmDouble MinAbs(void){_error2_("Min not implemented for integers");};
+-		void Extrude(void){_error2_("not supported yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+-		/*}}}*/
+-
+-};
+-#endif  /* _INTINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/BoolInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/BoolInput.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/BoolInput.h	(revision 12822)
+@@ -1,85 +0,0 @@
+-/*! \file BoolInput.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _BOOLINPUT_H_
+-#define _BOOLINPUT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Input.h"
+-#include "../../include/include.h"
+-class GaussTria;
+-/*}}}*/
+-
+-class BoolInput: public Input{
+-
+-	public:
+-		/*just hold 3 values for 3 vertices: */
+-		int    enum_type;
+-		IssmBool value;
+-
+-		/*BoolInput constructors, destructors: {{{*/
+-		BoolInput();
+-		BoolInput(int enum_type,IssmBool value);
+-		~BoolInput();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*BoolInput management: {{{*/
+-		int   InstanceEnum();
+-		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
+-		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void Configure(Parameters* parameters);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+-		/*}}}*/
+-		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue);
+-		void GetInputValue(int* pvalue);
+-		void GetInputValue(IssmDouble* pvalue);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void ChangeEnum(int newenumtype);
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		IssmDouble InfinityNorm(void){_error2_("InfinityNorm not implemented for booleans");};
+-		IssmDouble Max(void){_error2_("Max not implemented for booleans");};
+-		IssmDouble MaxAbs(void){_error2_("Max not implemented for booleans");};
+-		IssmDouble Min(void){_error2_("Min not implemented for booleans");};
+-		IssmDouble MinAbs(void){_error2_("Min not implemented for booleans");};
+-		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar);
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error2_("Constrain not implemented for booleans");};
+-		void Extrude(void);
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+-		/*}}}*/
+-
+-};
+-#endif  /* _BOOLINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TriaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TriaP1Input.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TriaP1Input.cpp	(revision 12822)
+@@ -1,422 +0,0 @@
+-/*!\file TriaP1Input.c
+- * \brief: implementation of the TriaP1Input object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*TriaP1Input constructors and destructor*/
+-/*FUNCTION TriaP1Input::TriaP1Input(){{{*/
+-TriaP1Input::TriaP1Input(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::TriaP1Input(int in_enum_type,IssmDouble* values){{{*/
+-TriaP1Input::TriaP1Input(int in_enum_type,IssmDouble* in_values)
+-	:TriaRef(1)
+-{
+-
+-	/*Set TriaRef*/
+-	this->SetElementType(P1Enum,0);
+-	this->element_type=P1Enum;
+-
+-	/*Set Enum*/
+-	enum_type=in_enum_type;
+-
+-	/*Set values*/
+-	values[0]=in_values[0];
+-	values[1]=in_values[1];
+-	values[2]=in_values[2];
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::~TriaP1Input(){{{*/
+-TriaP1Input::~TriaP1Input(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION TriaP1Input::Echo {{{*/
+-void TriaP1Input::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::DeepEcho{{{*/
+-void TriaP1Input::DeepEcho(void){
+-
+-	_printLine_("TriaP1Input:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   values: [" << this->values[0] << " " << this->values[1] << " " << this->values[2] << "]");
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::Id{{{*/
+-int    TriaP1Input::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION TriaP1Input::MyRank{{{*/
+-int    TriaP1Input::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::ObjectEnum{{{*/
+-int TriaP1Input::ObjectEnum(void){
+-
+-	return TriaP1InputEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::copy{{{*/
+-Object* TriaP1Input::copy() {
+-	
+-	return new TriaP1Input(this->enum_type,this->values);
+-
+-}
+-/*}}}*/
+-	
+-/*TriaP1Input management*/
+-/*FUNCTION TriaP1Input::InstanceEnum{{{*/
+-int TriaP1Input::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::SpawnTriaInput{{{*/
+-Input* TriaP1Input::SpawnTriaInput(int* indices){
+-
+-	/*output*/
+-	TriaP1Input* outinput=NULL;
+-
+-	/*Create new Tria input (copy of current input)*/
+-	outinput=new TriaP1Input(this->enum_type,&this->values[0]);
+-
+-	/*Assign output*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::SpawnResult{{{*/
+-ElementResult* TriaP1Input::SpawnResult(int step, IssmDouble time){
+-
+-	return new TriaP1ElementResult(this->enum_type,this->values,step,time);
+-
+-}
+-/*}}}*/
+-
+-/*Object functions*/
+-/*FUNCTION TriaP1Input::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void TriaP1Input::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){
+-
+-	/*Call TriaRef function*/
+-	TriaRef::GetInputValue(pvalue,&values[0],gauss);
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void TriaP1Input::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussTria* gauss){
+-
+-	/*Call TriaRef function*/
+-	TriaRef::GetInputDerivativeValue(p,&values[0],xyz_list,gauss);
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::GetVxStrainRate2d{{{*/
+-void TriaP1Input::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){
+-
+-	/*Intermediary*/
+-	int       i;
+-	const int numnodes=3;
+-	IssmDouble B[3][NDOF2*numnodes];
+-	IssmDouble velocity[3][NDOF2];
+-
+-	/*Get B matrix: */
+-	GetBMacAyeal(&B[0][0], xyz_list, gauss);
+-
+-	/*Here, we are computing the strain rate of (vx,0)*/
+-	for(i=0;i<3;i++){
+-		velocity[i][0]=this->values[i];
+-		velocity[i][1]=0.0;
+-	}
+-	/*Get epsilon(vx) = B*velocity*/
+-	MatrixMultiply( &B[0][0],3,NDOF2*numnodes,0,
+-				&velocity[0][0],NDOF2*numnodes,1,0,
+-				epsilonvx,0);
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::GetVyStrainRate2d{{{*/
+-void TriaP1Input::GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){
+-
+-	/*Intermediary*/
+-	int       i;
+-	const int numnodes=3;
+-	IssmDouble B[3][NDOF2*numnodes];
+-	IssmDouble velocity[3][NDOF2];
+-
+-	/*Get B matrix: */
+-	GetBMacAyeal(&B[0][0], xyz_list, gauss);
+-
+-	/*Here, we are computing the strain rate of (0,vy)*/
+-	for(i=0;i<3;i++){
+-		velocity[i][0]=0.0;
+-		velocity[i][1]=this->values[i];
+-	}
+-	/*Get epsilon(vy) = B*velocity*/
+-	MatrixMultiply( &B[0][0],3,NDOF2*numnodes,0,
+-				&velocity[0][0],NDOF2*numnodes,1,0,
+-				epsilonvy,0);
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::ChangeEnum{{{*/
+-void TriaP1Input::ChangeEnum(int newenumtype){
+-	this->enum_type=newenumtype;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::GetInputAverage{{{*/
+-void TriaP1Input::GetInputAverage(IssmDouble* pvalue){
+-	*pvalue=1./3.*(values[0]+values[1]+values[2]);
+-}
+-/*}}}*/
+-
+-/*Intermediary*/
+-/*FUNCTION TriaP1Input::SquareMin{{{*/
+-void TriaP1Input::SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){
+-
+-	int i;
+-	const int numnodes=3;
+-	IssmDouble valuescopy[numnodes];
+-	IssmDouble squaremin;
+-
+-	/*First,  copy values, to process units if requested: */
+-	for(i=0;i<numnodes;i++)valuescopy[i]=this->values[i];
+-
+-	/*Process units if requested: */
+-	if(process_units)UnitConversion(&valuescopy[0],numnodes,IuToExtEnum,enum_type);
+-
+-	/*Now, figure out minimum of valuescopy: */
+-	squaremin=pow(valuescopy[0],2);
+-	for(i=1;i<numnodes;i++){
+-		if(pow(valuescopy[i],2)<squaremin)squaremin=pow(valuescopy[i],2);
+-	}
+-	/*Assign output pointers:*/
+-	*psquaremin=squaremin;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::ContrainMin{{{*/
+-void TriaP1Input::ConstrainMin(IssmDouble minimum){
+-	
+-	int i;
+-	const int numnodes=3;
+-
+-	for(i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::InfinityNorm{{{*/
+-IssmDouble TriaP1Input::InfinityNorm(void){
+-
+-	/*Output*/
+-	IssmDouble norm=0;
+-	const int numnodes=3;
+-
+-	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
+-	return norm;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::Max{{{*/
+-IssmDouble TriaP1Input::Max(void){
+-
+-	const int numnodes=3;
+-	IssmDouble    max=values[0];
+-
+-	for(int i=1;i<numnodes;i++){
+-		if(values[i]>max) max=values[i];
+-	}
+-	return max;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::MaxAbs{{{*/
+-IssmDouble TriaP1Input::MaxAbs(void){
+-
+-	const int numnodes=3;
+-	IssmDouble    max=fabs(values[0]);
+-
+-	for(int i=1;i<numnodes;i++){
+-		if(fabs(values[i])>max) max=fabs(values[i]);
+-	}
+-	return max;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::Min{{{*/
+-IssmDouble TriaP1Input::Min(void){
+-
+-	const int numnodes=3;
+-	IssmDouble    min=values[0];
+-
+-	for(int i=1;i<numnodes;i++){
+-		if(values[i]<min) min=values[i];
+-	}
+-	return min;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::MinAbs{{{*/
+-IssmDouble TriaP1Input::MinAbs(void){
+-
+-	const int numnodes=3;
+-	IssmDouble    min=fabs(values[0]);
+-
+-	for(int i=1;i<numnodes;i++){
+-		if(fabs(values[i])<min) min=fabs(values[i]);
+-	}
+-	return min;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::Scale{{{*/
+-void TriaP1Input::Scale(IssmDouble scale_factor){
+-	
+-	int i;
+-	const int numnodes=3;
+-
+-	for(i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::ArtificialNoise{{{*/
+-void TriaP1Input::ArtificialNoise(IssmDouble min,IssmDouble max){
+-
+-	int i;
+-	const int numnodes=3;
+-	IssmDouble noise;
+-
+-	/*Compute random number between bounds:
+-	 * rand() outputs an integer in [0 RAND_MAX]
+-	 * (IssmDouble)rand()/RAND_MAX is in [0 1]
+-	 */
+-	 noise=min+(max-min)*(IssmDouble)rand()/RAND_MAX;
+-
+-	for(i=0;i<numnodes;i++)values[i]=values[i]+noise;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::AXPY{{{*/
+-void TriaP1Input::AXPY(Input* xinput,IssmDouble scalar){
+-
+-	int i;
+-	const int numnodes=3;
+-	TriaP1Input*  xtriavertexinput=NULL;
+-
+-	/*xinput is of the same type, so cast it: */
+-	xtriavertexinput=(TriaP1Input*)xinput;
+-
+-	/*Carry out the AXPY operation depending on type:*/
+-	switch(xinput->ObjectEnum()){
+-
+-		case TriaP1InputEnum :
+-			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*xtriavertexinput->values[i];
+-			return;
+-
+-		default :
+-			_error2_("not implemented yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::Constrain{{{*/
+-void TriaP1Input::Constrain(IssmDouble cm_min, IssmDouble cm_max){
+-
+-	int i;
+-	const int numnodes=3;
+-		
+-	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;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::GetVectorFromInputs{{{*/
+-void TriaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
+-
+-	const int numvertices=3;
+-	vector->SetValues(numvertices,doflist,this->values,INS_VAL);
+-
+-} /*}}}*/
+-/*FUNCTION TriaP1Input::GetValuesPtr{{{*/
+-void TriaP1Input::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+-
+-	*pvalues=this->values;
+-	if(pnum_values)*pnum_values=3;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::PointwiseMin{{{*/
+-Input* TriaP1Input::PointwiseMin(Input* inputB){
+-
+-	/*Ouput*/
+-	TriaP1Input* outinput=NULL;
+-
+-	/*Intermediaries*/
+-	int               i;
+-	TriaP1Input *xinputB     = NULL;
+-	int               B_numvalues;
+-	const int         numnodes    = 3;
+-	IssmDouble            minvalues[numnodes];
+-
+-	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+-	xinputB=(TriaP1Input*)inputB;
+-
+-	/*Create point wise min*/
+-	for(i=0;i<numnodes;i++){
+-		if(this->values[i] > xinputB->values[i]) minvalues[i]=xinputB->values[i];
+-		else minvalues[i]=this->values[i];
+-	}
+-
+-	/*Create new Tria vertex input (copy of current input)*/
+-	outinput=new TriaP1Input(this->enum_type,&minvalues[0]);
+-
+-	/*Return output pointer*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::PointwiseMax{{{*/
+-Input* TriaP1Input::PointwiseMax(Input* inputB){
+-
+-	/*Ouput*/
+-	TriaP1Input* outinput=NULL;
+-
+-	/*Intermediaries*/
+-	int               i;
+-	TriaP1Input *xinputB     = NULL;
+-	int               B_numvalues;
+-	const int         numnodes    = 3;
+-	IssmDouble            maxvalues[numnodes];
+-
+-	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+-	xinputB=(TriaP1Input*)inputB;
+-
+-	/*Create point wise max*/
+-	for(i=0;i<numnodes;i++){
+-		if(this->values[i] < xinputB->values[i]) maxvalues[i]=xinputB->values[i];
+-		else maxvalues[i]=this->values[i];
+-	}
+-
+-	/*Create new Tria vertex input (copy of current input)*/
+-	outinput=new TriaP1Input(this->enum_type,&maxvalues[0]);
+-
+-	/*Return output pointer*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1Input::Configure{{{*/
+-void TriaP1Input::Configure(Parameters* parameters){
+-	/*do nothing: */
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TriaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TriaP1Input.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TriaP1Input.h	(revision 12822)
+@@ -1,86 +0,0 @@
+-/*! \file TriaP1Input.h 
+- *  \brief: header file for TriaP1Input object
+- */
+-
+-
+-#ifndef _TRIAP1INPUT_H_
+-#define _TRIAP1INPUT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Input.h"
+-#include "../Elements/TriaRef.h"
+-class GaussTria;
+-/*}}}*/
+-
+-class TriaP1Input: public Input,public TriaRef{
+-
+-	public:
+-		/*just hold 3 values for 3 vertices: */
+-		int    enum_type;
+-		IssmDouble values[3];
+-
+-		/*TriaP1Input constructors, destructors: {{{*/
+-		TriaP1Input();
+-		TriaP1Input(int enum_type,IssmDouble* values);
+-		~TriaP1Input();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*TriaP1Input management: {{{*/
+-		int   InstanceEnum();
+-		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB);
+-		Input* PointwiseMax(Input* inputB);
+-		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+-		void Configure(Parameters* parameters);
+-		/*}}}*/
+-		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");}
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");}
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");}
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void ChangeEnum(int newenumtype);
+-
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum);
+-		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max);
+-		void AXPY(Input* xinput,IssmDouble scalar);
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+-		IssmDouble InfinityNorm(void);
+-		IssmDouble Max(void);
+-		IssmDouble MaxAbs(void);
+-		IssmDouble Min(void);
+-		IssmDouble MinAbs(void);
+-		void Extrude(void){_error2_("not supported yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+-		/*}}}*/
+-
+-};
+-#endif  /* _TRIAP1INPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.cpp	(revision 12822)
+@@ -1,486 +0,0 @@
+-/*!\file TransientInput.c
+- * \brief: implementation of the TransientInput object
+- */
+-/*Headers{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*TransientInput constructors and destructor*/
+-/*FUNCTION TransientInput::TransientInput(){{{*/
+-TransientInput::TransientInput(){
+-
+-	enum_type=UNDEF;
+-	inputs=NULL;
+-	this->numtimesteps=0;
+-	this->parameters=NULL;
+-	this->timesteps=NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::TransientInput(int in_enum_type){{{*/
+-TransientInput::TransientInput(int in_enum_type)
+-{
+-	/*Set Enum*/
+-	enum_type=in_enum_type;
+-
+-	/*Allocate values and timesteps, and copy: */
+-	this->numtimesteps=0;
+-	this->timesteps=NULL;
+-	inputs = new Inputs();
+-	this->parameters=NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::~TransientInput{{{*/
+-TransientInput::~TransientInput(){
+-	xDelete<IssmDouble>(this->timesteps);
+-	this->timesteps=NULL;
+-	this->numtimesteps=0;
+-	parameters=NULL;
+-	delete this->inputs;
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION TransientInput::Echo {{{*/
+-void TransientInput::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::DeepEcho{{{*/
+-void TransientInput::DeepEcho(void){
+-
+-	int i;
+-
+-	_printLine_("TransientInput:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   numtimesteps: " << this->numtimesteps);
+-	_printLine_("---inputs: "); 
+-	for(i=0;i<this->numtimesteps;i++){
+-		_printLine_("   time: " << this->timesteps[i] << "  ");
+-		((Input*)this->inputs->GetObjectByOffset(i))->Echo();
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::Id{{{*/
+-int    TransientInput::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION TransientInput::MyRank{{{*/
+-int    TransientInput::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::ObjectEnum{{{*/
+-int TransientInput::ObjectEnum(void){
+-
+-	return TransientInputEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::copy{{{*/
+-Object* TransientInput::copy() {
+-
+-	TransientInput* output=NULL;
+-
+-	output = new TransientInput();
+-	output->enum_type=this->enum_type;
+-	output->numtimesteps=this->numtimesteps;
+-	output->timesteps=xNew<IssmDouble>(this->numtimesteps);
+-   memcpy(output->timesteps,this->timesteps,this->numtimesteps*sizeof(IssmDouble));
+-	output->inputs=(Inputs*)this->inputs->Copy();
+-	output->parameters=this->parameters;
+-
+-	return output;
+-
+-}
+-/*}}}*/
+-	
+-/*TransientInput management*/
+-/*FUNCTION TransientInput::InstanceEnum{{{*/
+-int TransientInput::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::SpawnTriaInput{{{*/
+-Input* TransientInput::SpawnTriaInput(int* indices){
+-
+-	/*output*/
+-	TransientInput* outinput=NULL;
+-
+-	/*Create new Transientinput (copy of current input)*/
+-	outinput=new TransientInput();
+-	outinput->enum_type=this->enum_type;
+-	outinput->numtimesteps=this->numtimesteps;
+-	outinput->timesteps=xNew<IssmDouble>(this->numtimesteps);
+-	memcpy(outinput->timesteps,this->timesteps,this->numtimesteps*sizeof(IssmDouble));
+-	outinput->inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices);
+-	outinput->parameters=this->parameters;
+-
+-	/*Assign output*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::SpawnResult{{{*/
+-ElementResult* TransientInput::SpawnResult(int step, IssmDouble time){
+-
+-	ElementResult* elementresult=NULL;
+-
+-	/*Ok, we want to spawn an ElementResult. We have the time, just get 
+-	 *the correct values: */
+-	Input* input=GetTimeInput(time);
+-
+-	elementresult=input->SpawnResult(step,time);
+-
+-   delete input;
+-
+-	return elementresult;
+-}
+-/*}}}*/
+-
+-/*Object functions*/
+-/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void TransientInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){
+-	IssmDouble time;
+-
+-	/*First, recover current time from parameters: */
+-	this->parameters->FindParam(&time,TimeEnum);
+-
+-	/*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-
+-	/*Call input function*/
+-	input->GetInputValue(pvalue,gauss);
+-
+-	delete input;
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){
+-	IssmDouble time;
+-
+-	/*First, recover current time from parameters: */
+-	this->parameters->FindParam(&time,TimeEnum);
+-
+-	/*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-
+-	/*Call input function*/
+-	input->GetInputValue(pvalue,gauss);
+-
+-	delete input;
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){{{*/
+-void TransientInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){
+-
+-	/*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-
+-	/*Call input function*/
+-	input->GetInputValue(pvalue,gauss);
+-
+-	delete input;
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){{{*/
+-void TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){
+-
+-	/*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-
+-	/*Call input function*/
+-	input->GetInputValue(pvalue,gauss);
+-
+-	delete input;
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussTria* gauss){
+-
+-	IssmDouble time;
+-
+-	/*First, recover current time from parameters: */
+-	parameters->FindParam(&time,TimeEnum);
+-
+-	/*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-		   
+-	/*Call input function*/
+-	input->GetInputDerivativeValue(p,xyz_list,gauss);
+-
+-	delete input;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::ChangeEnum{{{*/
+-void TransientInput::ChangeEnum(int newenumtype){
+-	this->enum_type=newenumtype;
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::GetInputAverage{{{*/
+-void TransientInput::GetInputAverage(IssmDouble* pvalue){
+-	
+-	IssmDouble time;
+-
+-	/*First, recover current time from parameters: */
+-	parameters->FindParam(&time,TimeEnum);
+-
+-	/*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-
+-	/*Call input function*/
+-	input->GetInputAverage(pvalue);
+-			   
+-	delete input;
+-
+-}
+-/*}}}*/
+-
+-/*Intermediary*/
+-/*FUNCTION TransientInput::AddTimeInput{{{*/
+-void TransientInput::AddTimeInput(Input* input,IssmDouble time){
+-
+-	/*insert values at time step: */
+-	if (this->numtimesteps>0 && time<=this->timesteps[this->numtimesteps-1]) _assert_("timestep values must increase sequentially");
+-
+-	//copy timesteps, add the new time, delete previous timesteps, and add the new input: inputs->AddObject(input);
+-	IssmDouble* old_timesteps=NULL;
+-
+-	if (this->numtimesteps > 0){
+-		old_timesteps=xNew<IssmDouble>(this->numtimesteps);
+-		memcpy(old_timesteps,this->timesteps,this->numtimesteps*sizeof(IssmDouble));
+-		xDelete<IssmDouble>(this->timesteps); 
+-	}
+-
+-	this->numtimesteps=this->numtimesteps+1;
+-	this->timesteps=xNew<IssmDouble>(this->numtimesteps);
+-
+-	if (this->numtimesteps > 1){
+-		memcpy(this->timesteps,old_timesteps,(this->numtimesteps-1)*sizeof(IssmDouble));
+-		xDelete<IssmDouble>(old_timesteps);
+-	}
+-
+-	/*go ahead and plug: */
+-	this->timesteps[this->numtimesteps-1]=time;
+-	inputs->AddObject(input);
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::SquareMin{{{*/
+-void TransientInput::SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){
+-
+-	IssmDouble time;
+-
+-	/*First, recover current time from parameters: */
+-	parameters->FindParam(&time,TimeEnum);
+-
+-   /*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-		   
+-	/*Call input function*/
+-	input->SquareMin(psquaremin,process_units,parameters);
+-			   
+-	delete input;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::InfinityNorm{{{*/
+-IssmDouble TransientInput::InfinityNorm(void){
+-
+-	IssmDouble time;
+-	IssmDouble infnorm;
+-
+-	/*First, recover current time from parameters: */
+-	parameters->FindParam(&time,TimeEnum);
+-
+-   /*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-
+-	/*Call input function*/
+-	infnorm=input->InfinityNorm();
+-			   
+-	/*Clean-up and return*/
+-	delete input;
+-	return infnorm;
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::Max{{{*/
+-IssmDouble TransientInput::Max(void){
+-
+-	IssmDouble time;
+-	IssmDouble max;
+-
+-	/*First, recover current time from parameters: */
+-	parameters->FindParam(&time,TimeEnum);
+-
+-   /*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-		   
+-	/*Call input function*/
+-	max=input->Max();
+-			   
+-	delete input;
+-
+-	return max;
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::MaxAbs{{{*/
+-IssmDouble TransientInput::MaxAbs(void){
+-
+-	IssmDouble time;
+-	IssmDouble maxabs;
+-
+-	/*First, recover current time from parameters: */
+-	parameters->FindParam(&time,TimeEnum);
+-
+-	/*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-
+-	/*Call input function*/
+-	maxabs=input->MaxAbs();
+-
+-	/*Clean-up and return*/
+-	delete input;
+-	return maxabs;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::Min{{{*/
+-IssmDouble TransientInput::Min(void){
+-
+-	IssmDouble time;
+-	IssmDouble min;
+-
+-	/*First, recover current time from parameters: */
+-	parameters->FindParam(&time,TimeEnum);
+-
+-   /*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-
+-	/*Call input function*/
+-	min=input->Min();
+-
+-	/*Clean-up and return*/
+-	delete input;
+-	return min;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::MinAbs{{{*/
+-IssmDouble TransientInput::MinAbs(void){
+-
+-	IssmDouble time;
+-	IssmDouble minabs;
+-
+-	/*First, recover current time from parameters: */
+-	parameters->FindParam(&time,TimeEnum);
+-
+-	/*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-
+-	/*Call input function*/
+-	minabs=input->MinAbs();
+-			   
+-	/*Clean-up and return*/
+-	delete input;
+-	return minabs;
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::GetVectorFromInputs{{{*/
+-void TransientInput::GetVectorFromInputs(Vector* vector,int* doflist){
+-
+-	IssmDouble time;
+-
+-	/*First, recover current time from parameters: */
+-	parameters->FindParam(&time,TimeEnum);
+-
+-	/*Retrieve interpolated values for this time step: */
+-	Input* input=GetTimeInput(time);
+-		   
+-	/*Call input function*/
+-	input->GetVectorFromInputs(vector,doflist);
+-			   
+-	delete input;
+-
+-} /*}}}*/
+-/*FUNCTION TransientInput::GetTimeInput{{{*/
+-Input* TransientInput::GetTimeInput(IssmDouble intime){
+-
+-	int     i,j;
+-	IssmDouble  deltat;
+-	IssmDouble  alpha1,alpha2;
+-	bool    found=false;
+-	Input*  input=NULL;
+-	Input*  input1=NULL;
+-	Input*  input2=NULL;
+-
+-	/*Ok, we have the time, go through the timesteps, and figure out which interval we 
+-	 *fall within. Then interpolate the values on this interval: */
+-	if(intime<this->timesteps[0]){
+-		/*get values for the first time: */
+-		input=(Input*)((Input*)this->inputs->GetObjectByOffset(0))->copy();
+-		found=true;
+-	}
+-	else if(intime>this->timesteps[this->numtimesteps-1]){
+-		/*get values for the last time: */
+-		input=(Input*)((Input*)this->inputs->GetObjectByOffset(numtimesteps-1))->copy();
+-		found=true;
+-	}
+-	else{
+-		/*Find which interval we fall within: */
+-		for(i=0;i<this->numtimesteps;i++){
+-			if(intime==this->timesteps[i]){
+-				/*We are right on one step time: */
+-				input=(Input*)((Input*)this->inputs->GetObjectByOffset(i))->copy();
+-				found=true;
+-				break; //we are done with the time interpolation.
+-			}
+-			else{
+-				if(this->timesteps[i]<intime && intime<this->timesteps[i+1]){
+-					/*ok, we have the interval ]i:i+1[. Interpolate linearly for now: */
+-					deltat=this->timesteps[i+1]-this->timesteps[i];
+-					alpha2=(intime-this->timesteps[i])/deltat;
+-					alpha1=(1.0-alpha2);
+-
+-					input1=(Input*)this->inputs->GetObjectByOffset(i); 
+-					input2=(Input*)this->inputs->GetObjectByOffset(i+1);
+-
+-					input=(Input*)input1->copy();
+-					input->Scale(alpha1);
+-					input->AXPY(input2,alpha2);
+-
+-					found=true;
+-					break;
+-				}
+-				else continue; //keep looking on the next interval
+-			}
+-		}
+-	}
+-	if(!found)_error2_("did not find time interval on which to interpolate forcing values!");
+-
+-	/*Assign output pointer*/
+-	return input;
+-}
+-/*}}}*/
+-/*FUNCTION TransientInput::Configure{{{*/
+-void TransientInput::Configure(Parameters* parameters){
+-	this->parameters=parameters;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/PentaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/PentaP1Input.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/PentaP1Input.cpp	(revision 12822)
+@@ -1,629 +0,0 @@
+-/*!\file PentaP1Input.c
+- * \brief: implementation of the PentaP1Input object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*PentaP1Input constructors and destructor*/
+-/*FUNCTION PentaP1Input::PentaP1Input(){{{*/
+-PentaP1Input::PentaP1Input(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::PentaP1Input(int in_enum_type,IssmDouble* values){{{*/
+-PentaP1Input::PentaP1Input(int in_enum_type,IssmDouble* in_values)
+-		:PentaRef(1)
+-{
+-
+-	/*Set PentaRef*/
+-	this->SetElementType(P1Enum,0);
+-	this->element_type=P1Enum;
+-
+-	enum_type=in_enum_type;
+-	values[0]=in_values[0];
+-	values[1]=in_values[1];
+-	values[2]=in_values[2];
+-	values[3]=in_values[3];
+-	values[4]=in_values[4];
+-	values[5]=in_values[5];
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::~PentaP1Input(){{{*/
+-PentaP1Input::~PentaP1Input(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION PentaP1Input::Echo {{{*/
+-void PentaP1Input::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::DeepEcho{{{*/
+-void PentaP1Input::DeepEcho(void){
+-
+-	_printLine_("PentaP1Input:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   values: [" << this->values[0] << " " << this->values[1] << " " << this->values[2] << " " << this->values[3] << " " << this->values[4] << " " << this->values[5] << "]");
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::Id{{{*/
+-int    PentaP1Input::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION PentaP1Input::MyRank{{{*/
+-int    PentaP1Input::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::ObjectEnum{{{*/
+-int PentaP1Input::ObjectEnum(void){
+-
+-	return PentaP1InputEnum;
+-
+-}
+-/*}}}*/
+-	
+-/*PentaP1Input management*/
+-/*FUNCTION PentaP1Input::copy{{{*/
+-Object* PentaP1Input::copy() {
+-	
+-	return new PentaP1Input(this->enum_type,this->values);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::InstanceEnum{{{*/
+-int PentaP1Input::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::SpawnTriaInput{{{*/
+-Input* PentaP1Input::SpawnTriaInput(int* indices){
+-
+-	/*output*/
+-	TriaP1Input* outinput=NULL;
+-	IssmDouble newvalues[3];
+-
+-	/*Loop over the new indices*/
+-	for(int i=0;i<3;i++){
+-
+-		/*Check index value*/
+-		_assert_(indices[i]>=0 && indices[i]<6);
+-
+-		/*Assign value to new input*/
+-		newvalues[i]=this->values[indices[i]];
+-	}
+-
+-	/*Create new Tria input*/
+-	outinput=new TriaP1Input(this->enum_type,&newvalues[0]);
+-
+-	/*Assign output*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::SpawnResult{{{*/
+-ElementResult* PentaP1Input::SpawnResult(int step, IssmDouble time){
+-
+-	return new PentaP1ElementResult(this->enum_type,this->values,step,time);
+-
+-}
+-/*}}}*/
+-
+-/*Object functions*/
+-/*FUNCTION PentaP1Input::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void PentaP1Input::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){
+-
+-	/*Call PentaRef function*/
+-	PentaRef::GetInputValue(pvalue,&values[0],gauss);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void PentaP1Input::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussPenta* gauss){
+-
+-	/*Call PentaRef function*/
+-	PentaRef::GetInputDerivativeValue(p,&values[0],xyz_list,gauss);
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::GetVxStrainRate3d{{{*/
+-void PentaP1Input::GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){
+-	int i,j;
+-
+-	const int numnodes=6;
+-	const int DOFVELOCITY=3;
+-	IssmDouble B[8][27];
+-	IssmDouble B_reduced[6][DOFVELOCITY*numnodes];
+-	IssmDouble velocity[numnodes][DOFVELOCITY];
+-
+-	/*Get B matrix: */
+-	GetBStokes(&B[0][0], xyz_list, gauss);
+-	/*Create a reduced matrix of B to get rid of pressure */
+-	for (i=0;i<6;i++){
+-		for (j=0;j<3;j++){
+-			B_reduced[i][j]=B[i][j];
+-		}
+-		for (j=4;j<7;j++){
+-			B_reduced[i][j-1]=B[i][j];
+-		}
+-		for (j=8;j<11;j++){
+-			B_reduced[i][j-2]=B[i][j];
+-		}
+-		for (j=12;j<15;j++){
+-			B_reduced[i][j-3]=B[i][j];
+-		}
+-		for (j=16;j<19;j++){
+-			B_reduced[i][j-4]=B[i][j];
+-		}
+-		for (j=20;j<23;j++){
+-			B_reduced[i][j-5]=B[i][j];
+-		}
+-	}
+-
+-	/*Here, we are computing the strain rate of (vx,0,0)*/
+-	for(i=0;i<numnodes;i++){
+-		velocity[i][0]=this->values[i];
+-		velocity[i][1]=0.0;
+-		velocity[i][2]=0.0;
+-	}
+-	/*Multiply B by velocity, to get strain rate: */
+-	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvx,0);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::GetVyStrainRate3d{{{*/
+-void PentaP1Input::GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){
+-	int i,j;
+-
+-	const int numnodes=6;
+-	const int DOFVELOCITY=3;
+-	IssmDouble B[8][27];
+-	IssmDouble B_reduced[6][DOFVELOCITY*numnodes];
+-	IssmDouble velocity[numnodes][DOFVELOCITY];
+-
+-	/*Get B matrix: */
+-	GetBStokes(&B[0][0], xyz_list, gauss);
+-	/*Create a reduced matrix of B to get rid of pressure */
+-	for (i=0;i<6;i++){
+-		for (j=0;j<3;j++){
+-			B_reduced[i][j]=B[i][j];
+-		}
+-		for (j=4;j<7;j++){
+-			B_reduced[i][j-1]=B[i][j];
+-		}
+-		for (j=8;j<11;j++){
+-			B_reduced[i][j-2]=B[i][j];
+-		}
+-		for (j=12;j<15;j++){
+-			B_reduced[i][j-3]=B[i][j];
+-		}
+-		for (j=16;j<19;j++){
+-			B_reduced[i][j-4]=B[i][j];
+-		}
+-		for (j=20;j<23;j++){
+-			B_reduced[i][j-5]=B[i][j];
+-		}
+-	}
+-
+-	/*Here, we are computing the strain rate of (0,vy,0)*/
+-	for(i=0;i<numnodes;i++){
+-		velocity[i][0]=0.0;
+-		velocity[i][1]=this->values[i];
+-		velocity[i][2]=0.0;
+-	}
+-	/*Multiply B by velocity, to get strain rate: */
+-	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvy,0);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::GetVzStrainRate3d{{{*/
+-void PentaP1Input::GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){
+-	int i,j;
+-
+-	const int numnodes=6;
+-	const int DOFVELOCITY=3;
+-	IssmDouble B[8][27];
+-	IssmDouble B_reduced[6][DOFVELOCITY*numnodes];
+-	IssmDouble velocity[numnodes][DOFVELOCITY];
+-
+-	/*Get B matrix: */
+-	GetBStokes(&B[0][0], xyz_list, gauss);
+-	/*Create a reduced matrix of B to get rid of pressure */
+-	for (i=0;i<6;i++){
+-		for (j=0;j<3;j++){
+-			B_reduced[i][j]=B[i][j];
+-		}
+-		for (j=4;j<7;j++){
+-			B_reduced[i][j-1]=B[i][j];
+-		}
+-		for (j=8;j<11;j++){
+-			B_reduced[i][j-2]=B[i][j];
+-		}
+-		for (j=12;j<15;j++){
+-			B_reduced[i][j-3]=B[i][j];
+-		}
+-		for (j=16;j<19;j++){
+-			B_reduced[i][j-4]=B[i][j];
+-		}
+-		for (j=20;j<23;j++){
+-			B_reduced[i][j-5]=B[i][j];
+-		}
+-	}
+-
+-	/*Here, we are computing the strain rate of (0,0,vz)*/
+-	for(i=0;i<numnodes;i++){
+-		velocity[i][0]=0.0;
+-		velocity[i][1]=0.0;
+-		velocity[i][2]=this->values[i];
+-	}
+-
+-	/*Multiply B by velocity, to get strain rate: */
+-	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvz,0);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::GetVxStrainRate3dPattyn{{{*/
+-void PentaP1Input::GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){
+-
+-	int i;
+-	const int numnodes=6;
+-	IssmDouble B[5][NDOF2*numnodes];
+-	IssmDouble velocity[numnodes][NDOF2];
+-
+-	/*Get B matrix: */
+-	GetBPattyn(&B[0][0], xyz_list, gauss);
+-
+-	/*Here, we are computing the strain rate of (vx,0)*/
+-	for(i=0;i<numnodes;i++){
+-		velocity[i][0]=this->values[i];
+-		velocity[i][1]=0.0;
+-	}
+-
+-	/*Multiply B by velocity, to get strain rate: */
+-	MatrixMultiply( &B[0][0],5,NDOF2*numnodes,0,
+-				&velocity[0][0],NDOF2*numnodes,1,0,
+-				epsilonvx,0);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::GetVyStrainRate3dPattyn{{{*/
+-void PentaP1Input::GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){
+-
+-	int i;
+-	const int numnodes=6;
+-	IssmDouble B[5][NDOF2*numnodes];
+-	IssmDouble velocity[numnodes][NDOF2];
+-
+-	/*Get B matrix: */
+-	GetBPattyn(&B[0][0], xyz_list, gauss);
+-
+-	/*Here, we are computing the strain rate of (0,vy)*/
+-	for(i=0;i<numnodes;i++){
+-		velocity[i][0]=0.0;
+-		velocity[i][1]=this->values[i];
+-	}
+-
+-	/*Multiply B by velocity, to get strain rate: */
+-	MatrixMultiply( &B[0][0],5,NDOF2*numnodes,0,
+-				&velocity[0][0],NDOF2*numnodes,1,0,
+-				epsilonvy,0);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::ChangeEnum{{{*/
+-void PentaP1Input::ChangeEnum(int newenumtype){
+-	this->enum_type=newenumtype;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::GetInputAverage{{{*/
+-void PentaP1Input::GetInputAverage(IssmDouble* pvalue){
+-	*pvalue=1./6.*(values[0]+values[1]+values[2]+values[3]+values[4]+values[5]);
+-}
+-/*}}}*/
+-
+-/*Intermediary*/
+-/*FUNCTION PentaP1Input::SquareMin{{{*/
+-void PentaP1Input::SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){
+-
+-	int i;
+-	const int numnodes=6;
+-	IssmDouble valuescopy[numnodes];
+-	IssmDouble squaremin;
+-
+-	/*First,  copy values, to process units if requested: */
+-	for(i=0;i<numnodes;i++)valuescopy[i]=this->values[i];
+-
+-	/*Process units if requested: */
+-	if(process_units)UnitConversion(&valuescopy[0],numnodes,IuToExtEnum,enum_type);
+-
+-	/*Now, figure out minimum of valuescopy: */
+-	squaremin=pow(valuescopy[0],2);
+-	for(i=1;i<numnodes;i++){
+-		if(pow(valuescopy[i],2)<squaremin)squaremin=pow(valuescopy[i],2);
+-	}
+-	/*Assign output pointers:*/
+-	*psquaremin=squaremin;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::ConstrainMin{{{*/
+-void PentaP1Input::ConstrainMin(IssmDouble minimum){
+-	
+-	int i;
+-	const int numnodes=6;
+-
+-	for(i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::InfinityNorm{{{*/
+-IssmDouble PentaP1Input::InfinityNorm(void){
+-
+-	/*Output*/
+-	const int numnodes=6;
+-	IssmDouble norm=0;
+-
+-	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
+-	return norm;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::Max{{{*/
+-IssmDouble PentaP1Input::Max(void){
+-
+-	const int numnodes=6;
+-	IssmDouble    max=values[0];
+-
+-	for(int i=1;i<numnodes;i++){
+-		if(values[i]>max) max=values[i];
+-	}
+-	return max;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::MaxAbs{{{*/
+-IssmDouble PentaP1Input::MaxAbs(void){
+-
+-	const int numnodes=6;
+-	IssmDouble    max=fabs(values[0]);
+-
+-	for(int i=1;i<numnodes;i++){
+-		if(fabs(values[i])>max) max=fabs(values[i]);
+-	}
+-	return max;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::Min{{{*/
+-IssmDouble PentaP1Input::Min(void){
+-
+-	const int numnodes=6;
+-	IssmDouble    min=values[0];
+-
+-	for(int i=1;i<numnodes;i++){
+-		if(values[i]<min) min=values[i];
+-	}
+-	return min;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::MinAbs{{{*/
+-IssmDouble PentaP1Input::MinAbs(void){
+-
+-	const int numnodes=6;
+-	IssmDouble    min=fabs(values[0]);
+-
+-	for(int i=1;i<numnodes;i++){
+-		if(fabs(values[i])<min) min=fabs(values[i]);
+-	}
+-	return min;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::Scale{{{*/
+-void PentaP1Input::Scale(IssmDouble scale_factor){
+-	
+-	int i;
+-	const int numnodes=6;
+-
+-	for(i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::AXPY{{{*/
+-void PentaP1Input::AXPY(Input* xinput,IssmDouble scalar){
+-
+-	int i;
+-	const int numnodes=6;
+-
+-	/*xinput is of the same type, so cast it: */
+-
+-	/*Carry out the AXPY operation depending on type:*/
+-	switch(xinput->ObjectEnum()){
+-
+-		case PentaP1InputEnum:{
+-			PentaP1Input* cast_input=(PentaP1Input*)xinput;
+-			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
+-			return;
+-		case ControlInputEnum:{
+-			ControlInput* cont_input=(ControlInput*)xinput;
+-			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error2_("not supported yet");
+-			PentaP1Input* cast_input=(PentaP1Input*)cont_input->values;
+-			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
+-			return;
+-		default:
+-			_error2_("not implemented yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::Constrain{{{*/
+-void PentaP1Input::Constrain(IssmDouble cm_min, IssmDouble cm_max){
+-
+-	int i;
+-	const int numnodes=6;
+-		
+-	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;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::Extrude{{{*/
+-void PentaP1Input::Extrude(void){
+-
+-	int i;
+-
+-	/*First 3 values copied on 3 last values*/
+-	for(i=0;i<3;i++) this->values[3+i]=this->values[i];
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::VerticallyIntegrate{{{*/
+-void PentaP1Input::VerticallyIntegrate(Input* thickness_input){
+-
+-	/*Intermediaries*/
+-	int i;
+-	const int  numnodes = 6;
+-	int        num_thickness_values;
+-	IssmDouble    *thickness_values = NULL;
+-
+-	/*Check that input provided is a thickness*/
+-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
+-
+-	/*Get Thickness value pointer*/
+-	thickness_input->GetValuesPtr(&thickness_values,&num_thickness_values);
+-
+-	/*vertically integrate depending on type:*/
+-	switch(thickness_input->ObjectEnum()){
+-
+-		case PentaP1InputEnum:
+-			for(i=0;i<3;i++){
+-				this->values[i]=0.5*(this->values[i]+this->values[i+3]) * thickness_values[i];
+-				this->values[i+3]=this->values[i];
+-			}
+-			return;
+-
+-		default:
+-			_error2_("not implemented yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::PointwiseDivide{{{*/
+-Input* PentaP1Input::PointwiseDivide(Input* inputB){
+-
+-	/*Ouput*/
+-	PentaP1Input* outinput=NULL;
+-
+-	/*Intermediaries*/
+-	int               i;
+-	PentaP1Input *xinputB     = NULL;
+-	int               B_numvalues;
+-	const int         numnodes    = 6;
+-	IssmDouble            AdotBvalues[numnodes];
+-
+-	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+-	xinputB=(PentaP1Input*)inputB;
+-
+-	/*Create point wise sum*/
+-	for(i=0;i<numnodes;i++){
+-		_assert_(xinputB->values[i]!=0);
+-		AdotBvalues[i]=this->values[i]/xinputB->values[i];
+-	}
+-
+-	/*Create new Penta vertex input (copy of current input)*/
+-	outinput=new PentaP1Input(this->enum_type,&AdotBvalues[0]);
+-
+-	/*Return output pointer*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::PointwiseMin{{{*/
+-Input* PentaP1Input::PointwiseMin(Input* inputB){
+-
+-	/*Ouput*/
+-	PentaP1Input* outinput=NULL;
+-
+-	/*Intermediaries*/
+-	int               i;
+-	PentaP1Input *xinputB     = NULL;
+-	int               B_numvalues;
+-	const int         numnodes    = 6;
+-	IssmDouble            minvalues[numnodes];
+-
+-	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+-	xinputB=(PentaP1Input*)inputB;
+-
+-	/*Create point wise min*/
+-	for(i=0;i<numnodes;i++){
+-		if(this->values[i] > xinputB->values[i]) minvalues[i]=xinputB->values[i];
+-		else minvalues[i]=this->values[i];
+-	}
+-
+-	/*Create new Penta vertex input (copy of current input)*/
+-	outinput=new PentaP1Input(this->enum_type,&minvalues[0]);
+-
+-	/*Return output pointer*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::PointwiseMax{{{*/
+-Input* PentaP1Input::PointwiseMax(Input* inputB){
+-
+-	/*Ouput*/
+-	PentaP1Input* outinput=NULL;
+-
+-	/*Intermediaries*/
+-	int               i;
+-	PentaP1Input *xinputB     = NULL;
+-	int               B_numvalues;
+-	const int         numnodes    = 6;
+-	IssmDouble            maxvalues[numnodes];
+-
+-	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+-	xinputB=(PentaP1Input*)inputB;
+-
+-	/*Create point wise max*/
+-	for(i=0;i<numnodes;i++){
+-		if(this->values[i] < xinputB->values[i]) maxvalues[i]=xinputB->values[i];
+-		else maxvalues[i]=this->values[i];
+-	}
+-
+-	/*Create new Penta vertex input (copy of current input)*/
+-	outinput=new PentaP1Input(this->enum_type,&maxvalues[0]);
+-
+-	/*Return output pointer*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::GetVectorFromInputs{{{*/
+-void PentaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
+-
+-	const int numvertices=6;
+-	vector->SetValues(numvertices,doflist,this->values,INS_VAL);
+-
+-} /*}}}*/
+-/*FUNCTION PentaP1Input::GetValuesPtr{{{*/
+-void PentaP1Input::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+-
+-	*pvalues=this->values;
+-	*pnum_values=6;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1Input::Configure{{{*/
+-void PentaP1Input::Configure(Parameters* parameters){
+-	/*do nothing: */
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DoubleInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DoubleInput.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/DoubleInput.cpp	(revision 12822)
+@@ -1,359 +0,0 @@
+-/*!\file DoubleInput.c
+- * \brief: implementation of the DoubleInput object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*DoubleInput constructors and destructor*/
+-/*FUNCTION DoubleInput::DoubleInput(){{{*/
+-DoubleInput::DoubleInput(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::DoubleInput(IssmDouble value){{{*/
+-DoubleInput::DoubleInput(int in_enum_type,IssmDouble in_value){
+-
+-	enum_type=in_enum_type;
+-	value=in_value;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::~DoubleInput(){{{*/
+-DoubleInput::~DoubleInput(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-		/*FUNCTION DoubleInput::Echo {{{*/
+-void DoubleInput::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::DeepEcho{{{*/
+-void DoubleInput::DeepEcho(void){
+-
+-	_printLine_("DoubleInput:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::Id{{{*/
+-int    DoubleInput::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleInput::MyRank{{{*/
+-int    DoubleInput::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::ObjectEnum{{{*/
+-int DoubleInput::ObjectEnum(void){
+-
+-	return DoubleInputEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::copy{{{*/
+-Object* DoubleInput::copy() {
+-	
+-	return new DoubleInput(this->enum_type,this->value);
+-
+-}
+-/*}}}*/
+-	
+-/*DoubleInput management*/
+-/*FUNCTION DoubleInput::InstanceEnum{{{*/
+-int DoubleInput::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::SpawnTriaInput{{{*/
+-Input* DoubleInput::SpawnTriaInput(int* indices){
+-
+-	/*output*/
+-	DoubleInput* outinput=new DoubleInput();
+-
+-	/*only copy current value*/
+-	outinput->enum_type=this->enum_type;
+-	outinput->value=this->value;
+-
+-	/*Assign output*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::SpawnResult{{{*/
+-ElementResult* DoubleInput::SpawnResult(int step, IssmDouble time){
+-
+-	return new DoubleElementResult(this->enum_type,this->value,step,time);
+-
+-}
+-/*}}}*/
+-
+-/*Object functions*/
+-/*FUNCTION DoubleInput::GetInputValue(bool* pvalue) {{{*/
+-void DoubleInput::GetInputValue(bool* pvalue){
+-	_error2_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetInputValue(int* pvalue){{{*/
+-void DoubleInput::GetInputValue(int* pvalue){
+-	_error2_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void DoubleInput::GetInputValue(IssmDouble* pvalue){
+-
+-	/*return value*/
+-	*pvalue=value;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void DoubleInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){*pvalue=this->value;}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void DoubleInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){*pvalue=this->value;}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){
+-	/*Epsilon is zero as vx is constant over the element*/
+-	for(int i=0;i<3;i++) epsilonvx[i]=0;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void DoubleInput::GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){
+-	/*Epsilon is zero as vy is constant over the element*/
+-	for(int i=0;i<3;i++) epsilonvy[i]=0;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void DoubleInput::GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Epsilon is zero as vx is constant over the element*/
+-	for(int i=0;i<6;i++) epsilonvx[i]=0;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void DoubleInput::GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Epsilon is zero as vy is constant over the element*/
+-	for(int i=0;i<6;i++) epsilonvy[i]=0;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void DoubleInput::GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Epsilon is zero as vz is constant over the element*/
+-	for(int i=0;i<6;i++) epsilonvz[i]=0;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void DoubleInput::GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Epsilon is zero as vx is constant over the element*/
+-	for(int i=0;i<5;i++) epsilonvx[i]=0;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void DoubleInput::GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Epsilon is zero as vy is constant over the element*/
+-	for(int i=0;i<5;i++) epsilonvy[i]=0;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::ChangeEnum{{{*/
+-void DoubleInput::ChangeEnum(int newenumtype){
+-	this->enum_type=newenumtype;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::SquareMin{{{*/
+-void DoubleInput::SquareMin(IssmDouble* psquaremin, bool process_units,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){
+-	value=value*scale_factor;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::ConstrainMin{{{*/
+-void DoubleInput::ConstrainMin(IssmDouble minimum){
+-	if (value<minimum) value=minimum;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::AXPY{{{*/
+-void DoubleInput::AXPY(Input* xinput,IssmDouble scalar){
+-
+-	DoubleInput*  xIssmDoubleinput=NULL;
+-
+-	/*xinput is of the same type, so cast it: */
+-	xIssmDoubleinput=(DoubleInput*)xinput;
+-
+-	/*Carry out the AXPY operation depending on type:*/
+-	switch(xinput->ObjectEnum()){
+-
+-		case DoubleInputEnum:
+-			this->value=this->value+scalar*xIssmDoubleinput->value;
+-			return;
+-
+-		default:
+-			_error2_("not implemented yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::Constrain{{{*/
+-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){
+-	return this->value;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::MaxAbs{{{*/
+-IssmDouble DoubleInput::MaxAbs(void){
+-	return fabs(this->value);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::Min{{{*/
+-IssmDouble DoubleInput::Min(void){
+-	return this->value;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::MinAbs{{{*/
+-IssmDouble DoubleInput::MinAbs(void){
+-	return fabs(this->value);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetVectorFromInputs{{{*/
+-void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){
+-
+-	_error2_("not supporte yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetValuesPtr{{{*/
+-void DoubleInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+-
+-	_error2_("not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::GetInputAverage{{{*/
+-void DoubleInput::GetInputAverage(IssmDouble* pvalue){
+-	*pvalue=value;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::VerticallyIntegrate{{{*/
+-void DoubleInput::VerticallyIntegrate(Input* thickness_input){
+-
+-	/*Intermediaries*/
+-	IssmDouble thickness_value;
+-
+-	/*Check that input provided is a thickness*/
+-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
+-
+-	/*vertically integrate depending on type:*/
+-	switch(thickness_input->ObjectEnum()){
+-
+-		case PentaP1InputEnum:
+-			thickness_input->GetInputAverage(&thickness_value);
+-			this->value=this->value*thickness_value;
+-			return;
+-
+-		default:
+-			_error2_("not implemented yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::PointwiseDivide{{{*/
+-Input* DoubleInput::PointwiseDivide(Input* inputB){
+-
+-	/*Ouput*/
+-	DoubleInput* outinput=NULL;
+-
+-	/*Intermediaries*/
+-	IssmDouble       Bvalue;
+-
+-	/*Check that inputB is of the same type*/
+-	inputB->GetInputAverage(&Bvalue);
+-
+-	/*Create new DoubleInput*/
+-	outinput=new DoubleInput(this->enum_type,this->value/Bvalue);
+-
+-	/*Return output pointer*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::PointwiseMin{{{*/
+-Input* DoubleInput::PointwiseMin(Input* input){
+-
+-	/*Ouput*/
+-	DoubleInput* outinput=NULL;
+-
+-	/*Intermediaries*/
+-	IssmDouble       min;
+-
+-	/*Check that inputB is of the same type*/
+-	if (input->Min() < this->Min()) min=input->Min();
+-	else min=this->Min();
+-
+-	/*Create new DoubleInput*/
+-	outinput=new DoubleInput(this->enum_type,min);
+-
+-	/*Return output pointer*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::PointwiseMax{{{*/
+-Input* DoubleInput::PointwiseMax(Input* input){
+-
+-	/*Ouput*/
+-	DoubleInput* outinput=NULL;
+-
+-	/*Intermediaries*/
+-	IssmDouble       max;
+-
+-	/*Check that inputB is of the same type*/
+-	if (input->Max() > this->Max()) max=input->Max();
+-	else max=this->Max();
+-
+-	/*Create new DoubleInput*/
+-	outinput=new DoubleInput(this->enum_type,max);
+-
+-	/*Return output pointer*/
+-	return outinput;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleInput::Configure{{{*/
+-void DoubleInput::Configure(Parameters* parameters){
+-	/*do nothing: */
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/TransientInput.h	(revision 12822)
+@@ -1,90 +0,0 @@
+-/*! \file TransientInput.h 
+- *  \brief: header file for transientinput object
+- */
+-
+-
+-#ifndef _TRANSIENTINPUT_H_
+-#define _TRANSIENTINPUT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Input.h"
+-class GaussTria;
+-class Parameters;
+-/*}}}*/
+-
+-class TransientInput: public Input{
+-
+-	public:
+-		int     enum_type;
+-		int     numtimesteps;
+-		Inputs* inputs;
+-		IssmDouble* timesteps;
+-		Parameters* parameters; //to find current time.
+-
+-		/*TransientInput constructors, destructors: {{{*/
+-		TransientInput();
+-		TransientInput(int enum_type);
+-		~TransientInput();
+-		void AddTimeInput(Input* input,IssmDouble time);
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id();
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*TransientInput management: {{{*/
+-		int    InstanceEnum();
+-		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* forcingB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* forcingB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* forcingB){_error2_("not implemented yet");};
+-		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void Configure(Parameters* parameters);
+-		/*}}}*/
+-		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void ChangeEnum(int newenumtype);
+-
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xforcing,IssmDouble scalar){_error2_("not implemented yet");};
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error2_("not implemented yet");};
+-		IssmDouble InfinityNorm(void);
+-		IssmDouble Max(void);
+-		IssmDouble MaxAbs(void);
+-		IssmDouble Min(void);
+-		IssmDouble MinAbs(void);
+-		void Extrude(void){_error2_("not supported yet");}
+-		void VerticallyIntegrate(Input* thickness_forcing){_error2_("not supported yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not supported yet");};
+-      void GetTimeValues(IssmDouble* values,IssmDouble time){_error2_("not implemented yet");};
+-		Input* GetTimeInput(IssmDouble time);
+-		/*}}}*/
+-
+-};
+-#endif  /* _TRANSIENTINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/PentaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/PentaP1Input.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Inputs/PentaP1Input.h	(revision 12822)
+@@ -1,86 +0,0 @@
+-/*! \file PentaP1Input.h 
+- *  \brief: header file for PentaP1Input object
+- */
+-
+-
+-#ifndef _PENTAP1INPUT_H_
+-#define _PENTAP1INPUT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Input.h"
+-#include "../Elements/PentaRef.h"
+-class GaussTria;
+-/*}}}*/
+-
+-class PentaP1Input: public Input, public PentaRef{
+-
+-	public:
+-		/*just hold 6 values for 6 vertices: */
+-		int    enum_type;
+-		IssmDouble values[6];
+-
+-		/*PentaP1Input constructors, destructors: {{{*/
+-		PentaP1Input();
+-		PentaP1Input(int enum_type,IssmDouble* values);
+-		~PentaP1Input();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*PentaP1Input management: {{{*/
+-		int   InstanceEnum();
+-		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB);
+-		Input* PointwiseMin(Input* inputB);
+-		Input* PointwiseMax(Input* inputB);
+-		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+-		void Configure(Parameters* parameters);
+-		/*}}}*/
+-		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void ChangeEnum(int newenumtype);
+-
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum);
+-		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar);
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+-		IssmDouble InfinityNorm(void);
+-		IssmDouble Max(void);
+-		IssmDouble MaxAbs(void);
+-		IssmDouble Min(void);
+-		IssmDouble MinAbs(void);
+-		void Extrude(void);
+-		void VerticallyIntegrate(Input* thickness_input);
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+-		/*}}}*/
+-
+-};
+-#endif  /* _PENTAP1INPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Geometry.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Geometry.cpp	(revision 12822)
+@@ -1,94 +0,0 @@
+-/*!\file KML_Geometry.cpp
+- * \brief: implementation of the kml_geometry abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Geometry::KML_Geometry(){{{*/
+-KML_Geometry::KML_Geometry(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Geometry::~KML_Geometry(){{{*/
+-KML_Geometry::~KML_Geometry(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Geometry::Echo {{{*/
+-void  KML_Geometry::Echo(){
+-
+-	this->KML_Object::Echo();
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Geometry::DeepEcho {{{*/
+-void  KML_Geometry::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Geometry::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Geometry::DeepEcho {{{*/
+-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){
+-
+-	KML_Object::Write(filout,indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Geometry::Read {{{*/
+-void  KML_Geometry::Read(FILE* fid,char* kstr){
+-
+-/*  process field within opening and closing tags  */
+-
+-	if      (!strncmp(kstr,"</Geometry",10))
+-		return;
+-	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");}
+-	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");}
+-
+-	else if (!strncmp(kstr,"<",1))
+-		KML_Object::Read(fid,kstr);
+-
+-	return;
+-}
+-/*}}}*/
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Icon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Icon.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Icon.h	(revision 12822)
+@@ -1,57 +0,0 @@
+-/*! \file KML_Icon.h 
+- *  \brief: header file for kml_icon object
+- */
+-
+-#ifndef _KML_ICON_H_
+-#define _KML_ICON_H_
+-
+-#define KML_ICON_HREF_LENGTH      800
+-#define KML_ICON_REFMODE_LENGTH    10
+-#define KML_ICON_VREFMODE_LENGTH    9
+-#define KML_ICON_VFORMAT_LENGTH   800
+-#define KML_ICON_HQUERY_LENGTH    800
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Object.h"
+-/*}}}*/
+-
+-class KML_Icon: public KML_Object {
+-
+-	public:
+-
+-		char  href[KML_ICON_HREF_LENGTH+1];
+-		char  refmode[KML_ICON_REFMODE_LENGTH+1];
+-		float refint;
+-		char  vrefmode[KML_ICON_VREFMODE_LENGTH+1];
+-		float vreftime;
+-		float vboundsc;
+-		char  vformat[KML_ICON_VFORMAT_LENGTH+1];
+-		char  hquery[KML_ICON_HQUERY_LENGTH+1];
+-
+-		/*KML_Icon constructors, destructors {{{*/
+-		KML_Icon();
+-		~KML_Icon();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_ICON_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Point.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Point.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Point.h	(revision 12822)
+@@ -1,49 +0,0 @@
+-/*! \file KML_Point.h 
+- *  \brief: header file for kml_point object
+- */
+-
+-#ifndef _KML_POINT_H_
+-#define _KML_POINT_H_
+-
+-#define KML_POINT_ALTMODE_LENGTH    18
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Geometry.h"
+-/*}}}*/
+-
+-class KML_Point: public KML_Geometry {
+-
+-	public:
+-
+-		bool  extrude;
+-		char  altmode[KML_POINT_ALTMODE_LENGTH+1];
+-		double coords[3];
+-
+-		/*KML_Point constructors, destructors {{{*/
+-		KML_Point();
+-		~KML_Point();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_POINT_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Unknown.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Unknown.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Unknown.cpp	(revision 12822)
+@@ -1,189 +0,0 @@
+-/*!\file KML_Unknown.cpp
+- * \brief: implementation of the kml_unknown object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Unknown::KML_Unknown(){{{*/
+-KML_Unknown::KML_Unknown(){
+-
+-	name      =NULL;
+-	value     =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Unknown::~KML_Unknown(){{{*/
+-KML_Unknown::~KML_Unknown(){
+-
+-	if (name      ) xfree((void**)&name);
+-	if (value     ) xfree((void**)&value);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Unknown::Echo {{{*/
+-void  KML_Unknown::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_Unknown " << name << ":");
+-	KML_Object::Echo();
+-
+-	if (value     )
+-		if(flag) _pprintLine_("         value: \"" << value << "\"");
+-    else
+-        if(flag) _pprintLine_("         value: [none]");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Unknown::DeepEcho {{{*/
+-void  KML_Unknown::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Unknown::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Unknown::DeepEcho {{{*/
+-void  KML_Unknown::DeepEcho(const char* indent){
+-
+-	char*        valuei;
+-	char*        vtoken;
+-	char         nl[]={'\n','\0'};
+-	bool         flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_Unknown " << name << ":");
+-	KML_Object::DeepEcho(indent);
+-
+-	if (value     ) {
+-		valuei=(char *) xmalloc((strlen(value)+1)*sizeof(char));
+-		memcpy(valuei,value,(strlen(value)+1)*sizeof(char)); 
+-        
+-		vtoken=strtok(valuei,nl);
+-		if(flag) _pprintString_(indent << "         value: \"" << vtoken);
+-    
+-		while (vtoken=strtok(NULL,nl))
+-			if(flag) _pprintString_("\n" << indent << "                 " << vtoken);
+-		if(flag) _pprintLine_("\"");
+-
+-		xfree((void**)&valuei);
+-	}
+-    else
+-        if(flag) _pprintLine_(indent << "         value: [none]");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Unknown::Write {{{*/
+-void  KML_Unknown::Write(FILE* filout,const char* indent){
+-
+-	char*        valuei;
+-	char*        vtoken;
+-	char         nl[]={'\n','\0'};
+-
+-	fprintf(filout,"%s<%s",indent,name);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	if (value     ) {
+-		valuei=(char *) xmalloc((strlen(value)+1)*sizeof(char));
+-		memcpy(valuei,value,(strlen(value)+1)*sizeof(char)); 
+-        
+-		vtoken=strtok(valuei,nl);
+-		fprintf(filout,"%s  %s\n",indent,vtoken);
+-    
+-		while (vtoken=strtok(NULL,nl))
+-			fprintf(filout,"%s  %s\n",indent,vtoken);
+-
+-		xfree((void**)&valuei);
+-	}
+-
+-	KML_Object::Write(filout,indent);
+-
+-	fprintf(filout,"%s</%s>\n",indent,name);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Unknown::Read {{{*/
+-void  KML_Unknown::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-	char         nl[]={'\n','\0'};
+-
+-/*  get object name  */
+-
+-	name=KMLFileTagName(NULL,
+-						kstr);
+-//	_pprintLine_("KML_Unknown::Read -- opening name=" << name << ".");
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-//		_pprintLine_("KML_Unknown::Read -- kstri=" << kstri << ".");
+-		if      (!strncmp(&kstri[0],"</", 2) &&
+-				 !strncmp(&kstri[2],name,strlen(name))) {
+-//			_pprintLine_("KML_Unknown::Read -- closing name=" << name << ".");
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");}
+-
+-		else if (strncmp(kstri,"<",1)) {
+-			if (value) {
+-				value=(char *) xrealloc(value,(strlen(value)+1+strlen(kstri)+1)*sizeof(char));
+-				strcat(value,nl);
+-				strcat(value,kstri);
+-			}
+-			else {
+-				value=(char *) xmalloc((strlen(kstri)+1)*sizeof(char));
+-				memcpy(value,kstri,(strlen(kstri)+1)*sizeof(char));
+-			}
+-		}
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Object::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Placemark.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Placemark.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Placemark.cpp	(revision 12822)
+@@ -1,210 +0,0 @@
+-/*!\file KML_Placemark.cpp
+- * \brief: implementation of the kml_placemark object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Placemark::KML_Placemark(){{{*/
+-KML_Placemark::KML_Placemark(){
+-
+-	geometry  =new DataSet;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Placemark::~KML_Placemark(){{{*/
+-KML_Placemark::~KML_Placemark(){
+-
+-	if (geometry) {
+-		delete geometry;
+-		geometry  =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Placemark::Echo {{{*/
+-void  KML_Placemark::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_Placemark:");
+-	KML_Feature::Echo();
+-
+-	if(flag) _pprintLine_("      geometry: (size=" << geometry->Size() << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Placemark::DeepEcho {{{*/
+-void  KML_Placemark::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Placemark::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Placemark::DeepEcho {{{*/
+-void  KML_Placemark::DeepEcho(const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_Placemark:");
+-	KML_Feature::DeepEcho(indent);
+-
+-/*  loop over the geometry elements for the placemark  */
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent2,"  ");
+-
+-	if (geometry->Size())
+-		for (i=0; i<geometry->Size(); i++) {
+-			if(flag) _pprintLine_(indent << "      geometry: -------- begin [" << i << "] --------");
+-			((KML_Geometry *)geometry->GetObjectByOffset(i))->DeepEcho(indent2);
+-			if(flag) _pprintLine_(indent << "      geometry: --------  end  [" << i << "] --------");
+-		}
+-	else
+-		if(flag) _pprintLine_(indent << "      geometry: [empty]");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Placemark::Write {{{*/
+-void  KML_Placemark::Write(FILE* filout,const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-
+-	fprintf(filout,"%s<Placemark",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Feature::Write(filout,indent);
+-
+-/*  loop over the geometry elements for the placemark  */
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-
+-	strcat(indent2,"  ");
+-
+-	for (i=0; i<geometry->Size(); i++)
+-		((KML_Geometry *)geometry->GetObjectByOffset(i))->Write(filout,indent2);
+-
+-	fprintf(filout,"%s</Placemark>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Placemark::Read {{{*/
+-void  KML_Placemark::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-	KML_Object*  kobj;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</Placemark",11)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strncmp(kstri,"<Point", 6)) {
+-			kobj=(KML_Object*)new KML_Point();
+-			kobj->Read(fid,kstri);
+-			geometry  ->AddObject((Object*)kobj);
+-		}
+-
+-		else if (!strncmp(kstri,"<LineString",11)) {
+-			kobj=(KML_Object*)new KML_LineString();
+-			kobj->Read(fid,kstri);
+-			geometry  ->AddObject((Object*)kobj);
+-		}
+-
+-		else if (!strncmp(kstri,"<LinearRing",11)) {
+-			kobj=(KML_Object*)new KML_LinearRing();
+-			kobj->Read(fid,kstri);
+-			geometry  ->AddObject((Object*)kobj);
+-		}
+-
+-		else if (!strncmp(kstri,"<Polygon", 8)) {
+-			kobj=(KML_Object*)new KML_Polygon();
+-			kobj->Read(fid,kstri);
+-			geometry  ->AddObject((Object*)kobj);
+-		}
+-
+-		else if (!strncmp(kstri,"<MultiGeometry",14)) {
+-			kobj=(KML_Object*)new KML_MultiGeometry();
+-			kobj->Read(fid,kstri);
+-			geometry  ->AddObject((Object*)kobj);
+-		}
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Feature::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Placemark::WriteExp {{{*/
+-void  KML_Placemark::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
+-
+-	int   i;
+-	char  nstr2[81];
+-
+-/*  loop over the geometry elements for the placemark  */
+-
+-	for (i=0; i<geometry->Size(); i++) {
+-		if (strlen(nstr))
+-			sprintf(nstr2,"%s %s",nstr,name);
+-		else
+-			sprintf(nstr2,"%s",name);
+-
+-		((KML_Object *)geometry->GetObjectByOffset(i))->WriteExp(fid,nstr2,sgn,cm,sp);
+-	}
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_ColorStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_ColorStyle.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_ColorStyle.cpp	(revision 12822)
+@@ -1,109 +0,0 @@
+-/*!\file KML_ColorStyle.cpp
+- * \brief: implementation of the kml_colorstyle abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_ColorStyle::KML_ColorStyle(){{{*/
+-KML_ColorStyle::KML_ColorStyle(){
+-
+-	strcpy(color     ,"ffffffff");
+-	strcpy(colormode ,"normal");
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_ColorStyle::~KML_ColorStyle(){{{*/
+-KML_ColorStyle::~KML_ColorStyle(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_ColorStyle::Echo {{{*/
+-void  KML_ColorStyle::Echo(){
+-
+-	bool  flag=true;
+-
+-	KML_SubStyle::Echo();
+-
+-	if(flag) _pprintLine_("         color: " << color);
+-	if(flag) _pprintLine_("     colormode: " << colormode);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_ColorStyle::DeepEcho {{{*/
+-void  KML_ColorStyle::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_ColorStyle::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_ColorStyle::DeepEcho {{{*/
+-void  KML_ColorStyle::DeepEcho(const char* indent){
+-
+-	bool  flag=true;
+-
+-	KML_SubStyle::DeepEcho(indent);
+-
+-	if(flag) _pprintLine_(indent << "         color: " << color);
+-	if(flag) _pprintLine_(indent << "     colormode: " << colormode);
+-}
+-/*}}}*/
+-/*FUNCTION KML_ColorStyle::Write {{{*/
+-void  KML_ColorStyle::Write(FILE* filout,const char* indent){
+-
+-	KML_SubStyle::Write(filout,indent);
+-
+-	if (color     && strlen(color))
+-		fprintf(filout,"%s  <color>%s</color>\n",indent,color);
+-	if (colormode && strlen(colormode))
+-		fprintf(filout,"%s  <colorMode>%s</colorMode>\n",indent,colormode);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_ColorStyle::Read {{{*/
+-void  KML_ColorStyle::Read(FILE* fid,char* kstr){
+-
+-/*  process field within opening and closing tags  */
+-
+-	if      (!strncmp(kstr,"</ColorStyle",12))
+-		return;
+-	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);}
+-	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");}
+-
+-	else if (!strcmp(kstr,"<color>"))
+-		KMLFileTokenParse( color     ,NULL,KML_COLORSTYLE_COLOR_LENGTH, kstr, fid);
+-	else if (!strcmp(kstr,"<colorMode>"))
+-		KMLFileTokenParse( colormode ,NULL,KML_COLORSTYLE_COLORMODE_LENGTH, kstr, fid);
+-
+-	else if (!strncmp(kstr,"<",1))
+-		KML_SubStyle::Read(fid,kstr);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LinearRing.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LinearRing.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LinearRing.h	(revision 12822)
+@@ -1,51 +0,0 @@
+-/*! \file KML_LinearRing.h 
+- *  \brief: header file for kml_linearring object
+- */
+-
+-#ifndef _KML_LINEARRING_H_
+-#define _KML_LINEARRING_H_
+-
+-#define KML_LINEARRING_ALTMODE_LENGTH    18
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Geometry.h"
+-/*}}}*/
+-
+-class KML_LinearRing: public KML_Geometry {
+-
+-	public:
+-
+-		bool     extrude;
+-		bool     tessellate;
+-		char     altmode[KML_LINEARRING_ALTMODE_LENGTH+1];
+-		int      ncoord;
+-		double  *coords;
+-
+-		/*KML_LinearRing constructors, destructors {{{*/
+-		KML_LinearRing();
+-		~KML_LinearRing();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_LINEARRING_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Feature.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Feature.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Feature.h	(revision 12822)
+@@ -1,57 +0,0 @@
+-/*! \file KML_Feature.h 
+- *  \brief: header file for kml_feature abstract object
+- */
+-
+-#ifndef _KML_FEATURE_H_
+-#define _KML_FEATURE_H_
+-
+-#define KML_FEATURE_NAME_LENGTH         80
+-#define KML_FEATURE_SNIPPET_LENGTH     160
+-#define KML_FEATURE_DESCRIPT_LENGTH   3200
+-#define KML_FEATURE_STYLEURL_LENGTH     80
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Object.h"
+-class KML_Style;
+-class DataSet;
+-/*}}}*/
+-
+-class KML_Feature: public KML_Object {
+-
+-	public:
+-
+-		char  name[KML_FEATURE_NAME_LENGTH+1];
+-		bool  visibility;
+-		bool  open;
+-		char  snippet[KML_FEATURE_SNIPPET_LENGTH+1];
+-		char  descript[KML_FEATURE_DESCRIPT_LENGTH+1];
+-		char  styleurl[KML_FEATURE_STYLEURL_LENGTH+1];
+-		DataSet* style;
+-
+-		/*KML_Feature constructors, destructors {{{*/
+-		KML_Feature();
+-		~KML_Feature();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_FEATURE_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp	(revision 12822)
+@@ -1,164 +0,0 @@
+-/*!\file KML_GroundOverlay.cpp
+- * \brief: implementation of the kml_groundoverlay object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_GroundOverlay::KML_GroundOverlay(){{{*/
+-KML_GroundOverlay::KML_GroundOverlay(){
+-
+-	altitude  = 0.;
+-	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
+-
+-	llbox     =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_GroundOverlay::~KML_GroundOverlay(){{{*/
+-KML_GroundOverlay::~KML_GroundOverlay(){
+-
+-	if (llbox) {
+-		delete llbox;
+-		llbox     =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_GroundOverlay::Echo {{{*/
+-void  KML_GroundOverlay::Echo(){
+-
+-	_printLine_("KML_GroundOverlay:");
+-	KML_Overlay::Echo();
+-
+-	_printLine_("         altitude: " << altitude);
+-	_printLine_("          altmode: " << altmode);
+-	_printLine_("            llbox: " << llbox);
+-}
+-/*}}}*/
+-/*FUNCTION KML_GroundOverlay::DeepEcho {{{*/
+-void  KML_GroundOverlay::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_GroundOverlay::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_GroundOverlay::DeepEcho {{{*/
+-void  KML_GroundOverlay::DeepEcho(const char* indent){
+-
+-	char  indent2[81];
+-
+-	_printLine_(indent << "KML_GroundOverlay:");
+-	KML_Overlay::DeepEcho(indent);
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent2,"  ");
+-
+-	_printLine_(indent<<"      altitude: " << altitude);
+-	_printLine_(indent<<"       altmode: " << altmode);
+-	if (llbox)
+-	 llbox->DeepEcho(indent2);
+-	else
+-	 _printLine_(indent<<"         llbox: " << llbox);
+-}
+-/*}}}*/
+-/*FUNCTION KML_GroundOverlay::Write {{{*/
+-void  KML_GroundOverlay::Write(FILE* filout,const char* indent){
+-
+-	char  indent2[81];
+-
+-	fprintf(filout,"%s<GroundOverlay",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Overlay::Write(filout,indent);
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-
+-	strcat(indent2,"  ");
+-
+-	fprintf(filout,"%s  <altitude>%0.16g</altitude>\n",indent,altitude);
+-	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
+-	if (llbox)
+-		llbox->Write(filout,indent2);
+-
+-	fprintf(filout,"%s</GroundOverlay>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_GroundOverlay::Read {{{*/
+-void  KML_GroundOverlay::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</GroundOverlay",15)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strcmp(kstri,"<altitude>"))
+-			KMLFileTokenParse(&altitude  ,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<altitudeMode>"))
+-			KMLFileTokenParse( altmode   ,NULL,KML_GROUNDOVERLAY_ALTMODE_LENGTH,
+-							  kstri,
+-							  fid);
+-		else if (!strncmp(kstri,"<LatLonBox",10)) {
+-			llbox     =new KML_LatLonBox();
+-			llbox     ->Read(fid,kstri);
+-		}
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Overlay::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Style.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Style.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Style.cpp	(revision 12822)
+@@ -1,243 +0,0 @@
+-/*!\file KML_Style.cpp
+- * \brief: implementation of the kml_style object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Style::KML_Style(){{{*/
+-KML_Style::KML_Style(){
+-
+-	icon      =NULL;
+-	label     =NULL;
+-	line      =NULL;
+-	poly      =NULL;
+-	balloon   =NULL;
+-	list      =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Style::~KML_Style(){{{*/
+-KML_Style::~KML_Style(){
+-
+-	if (list) {
+-//		delete list;
+-		if (list      ) xfree((void**)&list);
+-		list      =NULL;
+-	}
+-	if (balloon) {
+-//		delete balloon;
+-		if (balloon   ) xfree((void**)&balloon);
+-		balloon   =NULL;
+-	}
+-	if (poly) {
+-		delete poly;
+-		poly      =NULL;
+-	}
+-	if (line) {
+-		delete line;
+-		line      =NULL;
+-	}
+-	if (label) {
+-//		delete label;
+-		if (label     ) xfree((void**)&label);
+-		label     =NULL;
+-	}
+-	if (icon) {
+-//		delete icon;
+-		if (icon      ) xfree((void**)&icon);
+-		icon      =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Style::Echo {{{*/
+-void  KML_Style::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_Style:");
+-	KML_StyleSelector::Echo();
+-
+-	if(flag) _pprintLine_("          icon: " << icon);
+-	if(flag) _pprintLine_("         label: " << label);
+-	if(flag) _pprintLine_("          line: " << line);
+-	if(flag) _pprintLine_("          poly: " << poly);
+-	if(flag) _pprintLine_("       balloon: " << balloon);
+-	if(flag) _pprintLine_("          list: " << list);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Style::DeepEcho {{{*/
+-void  KML_Style::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Style::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Style::DeepEcho {{{*/
+-void  KML_Style::DeepEcho(const char* indent){
+-
+-	char  indent2[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_Style:");
+-	KML_StyleSelector::DeepEcho(indent);
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent2,"  ");
+-
+-//	if (icon)
+-//		icon->DeepEcho(indent2);
+-//	else
+-		if(flag) _pprintLine_(indent << "          icon: " << icon);
+-//	if (label)
+-//		label->DeepEcho(indent2);
+-//	else
+-		if(flag) _pprintLine_(indent << "         label: " << label);
+-	if (line)
+-		line->DeepEcho(indent2);
+-	else
+-		if(flag) _pprintLine_(indent << "          line: " << line);
+-	if (poly)
+-		poly->DeepEcho(indent2);
+-	else
+-		if(flag) _pprintLine_(indent << "          poly: " << poly);
+-//	if (balloon)
+-//		balloon->DeepEcho(indent2);
+-//	else
+-		if(flag) _pprintLine_(indent << "       balloon: " << balloon);
+-//	if (list)
+-//		list->DeepEcho(indent2);
+-//	else
+-		if(flag) _pprintLine_(indent << "          list: " << list);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Style::Write {{{*/
+-void  KML_Style::Write(FILE* filout,const char* indent){
+-
+-	char  indent2[81];
+-
+-	fprintf(filout,"%s<Style",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_StyleSelector::Write(filout,indent);
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-
+-	strcat(indent2,"  ");
+-
+-//	if (icon)
+-//		icon->Write(filout,indent2);
+-//	if (label)
+-//		label->Write(filout,indent2);
+-	if (line)
+-		line->Write(filout,indent2);
+-	if (poly)
+-		poly->Write(filout,indent2);
+-//	if (balloon)
+-//		balloon->Write(filout,indent2);
+-//	if (list)
+-//		list->Write(filout,indent2);
+-
+-	fprintf(filout,"%s</Style>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Style::Read {{{*/
+-void  KML_Style::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</Style", 7)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-//		else if (!strncmp(kstri,"<IconStyle",10)) {
+-//			icon      =new KML_IconStyle();
+-//			icon      ->Read(fid,kstri);
+-//		}
+-
+-//		else if (!strncmp(kstri,"<LabelStyle",11)) {
+-//			label     =new KML_LabelStyle();
+-//			label     ->Read(fid,kstri);
+-//		}
+-
+-		else if (!strncmp(kstri,"<LineStyle",10)) {
+-			line      =new KML_LineStyle();
+-			line      ->Read(fid,kstri);
+-		}
+-
+-		else if (!strncmp(kstri,"<PolyStyle",10)) {
+-			poly      =new KML_PolyStyle();
+-			poly      ->Read(fid,kstri);
+-		}
+-
+-//		else if (!strncmp(kstri,"<BalloonStyle",13)) {
+-//			balloon   =new KML_BalloonStyle();
+-//			balloon   ->Read(fid,kstri);
+-//		}
+-
+-//		else if (!strncmp(kstri,"<ListStyle",10)) {
+-//			list      =new KML_ListStyle();
+-//			list      ->Read(fid,kstri);
+-//		}
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_StyleSelector::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KMLFileReadUtils.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KMLFileReadUtils.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KMLFileReadUtils.h	(revision 12822)
+@@ -1,57 +0,0 @@
+-/*!\file:  KMLFileReadUtils.h
+- * \brief: header file for kml file reading utilities.
+- */ 
+-
+-#ifndef _KMLFILEREADUTILS_H
+-#define _KMLFILEREADUTILS_H
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "../Object.h"
+-/*}}}*/
+-
+-/* local prototypes: */
+-char* KMLFileToken(FILE* fid,
+-				   int* pncom,char*** ppcom);
+-char* KMLFileTokenComment(FILE* fid);
+-void KMLFileTokenBuffer(char** pbuffer,int* pibuf,int* pbuflen,
+-						int c,
+-						int bufblk);
+-char* KMLFileTagName(char* pname,
+-					 char* ktag);
+-char* KMLFileTagName(char* pname,int *m,int maxlen,
+-					 char* ktag);
+-int KMLFileTagAttrib(KML_Object* kobj,
+-					 char* ktag);
+-int KMLFileTokenParse(int* pival,
+-					  char* ktag,
+-					  FILE* fid);
+-int KMLFileTokenParse(bool* pbval,
+-					  char* ktag,
+-					  FILE* fid);
+-char* KMLFileTokenParse(char* pstr,
+-						char* ktag,
+-						FILE* fid);
+-char* KMLFileTokenParse(char* pstr,int *m,int maxlen,
+-						char* ktag,
+-						FILE* fid);
+-int KMLFileTokenParse(float* pfval,
+-					  char* ktag,
+-					  FILE* fid);
+-int KMLFileTokenParse(double* pdval,
+-					  char* ktag,
+-					  FILE* fid);
+-int KMLFileTokenParse(double **pdval,int* m,int maxlen,
+-					  char* ktag,
+-					  FILE* fid);
+-int KMLFileTokenParse(double (**pdval3)[3],int* m,int maxlen,
+-					  char* ktag,
+-					  FILE* fid);
+-int KMLFileTagSkip(char* ktag,
+-				   FILE* fid);
+-
+-#endif  /* _KMLFILEREADUTILS_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Comment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Comment.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Comment.cpp	(revision 12822)
+@@ -1,118 +0,0 @@
+-/*!\file KML_Comment.cpp
+- * \brief: implementation of the kml_comment object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Comment::KML_Comment(){{{*/
+-KML_Comment::KML_Comment(){
+-
+-	value     =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Comment::~KML_Comment(){{{*/
+-KML_Comment::~KML_Comment(){
+-
+-	if (value     ) xfree((void**)&value);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Comment::Echo {{{*/
+-void  KML_Comment::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintString_("    ");
+-	if(flag) _pprintLine_(value);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Comment::DeepEcho {{{*/
+-void  KML_Comment::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Comment::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Comment::DeepEcho {{{*/
+-void  KML_Comment::DeepEcho(const char* indent){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintString_(indent << "    ");
+-	if(flag) _pprintLine_(value);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Comment::Write {{{*/
+-void  KML_Comment::Write(FILE* filout,const char* indent){
+-
+-	if (strncmp(&value[0]              ,"<!--",4))
+-		fprintf(filout,"%s<!--\n",indent);
+-	fprintf(filout,"%s  %s\n",indent,value);
+-	if (strncmp(&value[strlen(value)-3],"-->" ,3))
+-		fprintf(filout,"%s-->\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Comment::Read {{{*/
+-void  KML_Comment::Read(FILE* fid,char* kstr){
+-
+-//  comments always read as part of KMLFileToken
+-
+-	;
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Comment::Alloc {{{*/
+-void  KML_Comment::Alloc(const char* valuei){
+-
+-	value=(char *) xmalloc((strlen(valuei)+1)*sizeof(char));
+-	memcpy(value,valuei,(strlen(valuei)+1)*sizeof(char));
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Comment::Add {{{*/
+-void  KML_Comment::Add(DataSet* commnt){
+-
+-	commnt->AddObject((Object*)this);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Comment::Get {{{*/
+-void  KML_Comment::Get(char** pvalueo){
+-
+-	*pvalueo=(char *) xmalloc((strlen(value)+1)*sizeof(char));
+-	memcpy(*pvalueo,value,(strlen(value)+1)*sizeof(char));
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_MultiGeometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_MultiGeometry.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_MultiGeometry.cpp	(revision 12822)
+@@ -1,203 +0,0 @@
+-/*!\file KML_MultiGeometry.cpp
+- * \brief: implementation of the kml_multigeometry object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_MultiGeometry::KML_MultiGeometry(){{{*/
+-KML_MultiGeometry::KML_MultiGeometry(){
+-
+-	geometry  =new DataSet;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_MultiGeometry::~KML_MultiGeometry(){{{*/
+-KML_MultiGeometry::~KML_MultiGeometry(){
+-
+-	if (geometry) {
+-		delete geometry;
+-		geometry  =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_MultiGeometry::Echo {{{*/
+-void  KML_MultiGeometry::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_Multigeometry:");
+-	KML_Geometry::Echo();
+-
+-	if(flag) _pprintLine_("      geometry: (size=" << geometry->Size() << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_MultiGeometry::DeepEcho {{{*/
+-void  KML_MultiGeometry::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_MultiGeometry::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_MultiGeometry::DeepEcho {{{*/
+-void  KML_MultiGeometry::DeepEcho(const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_Multigeometry:");
+-	KML_Geometry::DeepEcho(indent);
+-
+-/*  loop over the geometry elements for the multigeometry  */
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent2,"  ");
+-
+-	if (geometry->Size())
+-		for (i=0; i<geometry->Size(); i++) {
+-			if(flag) _pprintLine_(indent << "      geometry: -------- begin [" << i << "] --------");
+-			((KML_Geometry *)geometry->GetObjectByOffset(i))->DeepEcho(indent2);
+-			if(flag) _pprintLine_(indent << "      geometry: --------  end  [" << i << "] --------");
+-		}
+-	else
+-		if(flag) _pprintLine_(indent << "      geometry: [empty]");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_MultiGeometry::Write {{{*/
+-void  KML_MultiGeometry::Write(FILE* filout,const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-
+-	fprintf(filout,"%s<MultiGeometry",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Geometry::Write(filout,indent);
+-
+-/*  loop over the geometry elements for the multigeometry  */
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-
+-	strcat(indent2,"  ");
+-
+-	for (i=0; i<geometry->Size(); i++)
+-		((KML_Geometry *)geometry->GetObjectByOffset(i))->Write(filout,indent2);
+-
+-	fprintf(filout,"%s</MultiGeometry>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_MultiGeometry::Read {{{*/
+-void  KML_MultiGeometry::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-	KML_Object*  kobj;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</MultiGeometry",15)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strncmp(kstri,"<Point", 6)) {
+-			kobj=(KML_Object*)new KML_Point();
+-			kobj->Read(fid,kstri);
+-			geometry  ->AddObject((Object*)kobj);
+-		}
+-
+-		else if (!strncmp(kstri,"<LineString",11)) {
+-			kobj=(KML_Object*)new KML_LineString();
+-			kobj->Read(fid,kstri);
+-			geometry  ->AddObject((Object*)kobj);
+-		}
+-
+-		else if (!strncmp(kstri,"<LinearRing",11)) {
+-			kobj=(KML_Object*)new KML_LinearRing();
+-			kobj->Read(fid,kstri);
+-			geometry  ->AddObject((Object*)kobj);
+-		}
+-
+-		else if (!strncmp(kstri,"<Polygon", 8)) {
+-			kobj=(KML_Object*)new KML_Polygon();
+-			kobj->Read(fid,kstri);
+-			geometry  ->AddObject((Object*)kobj);
+-		}
+-
+-		else if (!strncmp(kstri,"<MultiGeometry",14)) {
+-			kobj=(KML_Object*)new KML_MultiGeometry();
+-			kobj->Read(fid,kstri);
+-			geometry  ->AddObject((Object*)kobj);
+-		}
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Geometry::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_MultiGeometry::WriteExp {{{*/
+-void  KML_MultiGeometry::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
+-
+-	int   i;
+-
+-/*  loop over the geometry elements for the multigeometry  */
+-
+-	for (i=0; i<geometry->Size(); i++)
+-		((KML_Object *)geometry->GetObjectByOffset(i))->WriteExp(fid,nstr,sgn,cm,sp);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_StyleSelector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_StyleSelector.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_StyleSelector.h	(revision 12822)
+@@ -1,42 +0,0 @@
+-/*! \file KML_StyleSelector.h 
+- *  \brief: header file for kml_styleselector abstract object
+- */
+-
+-#ifndef _KML_STYLESELECTOR_H_
+-#define _KML_STYLESELECTOR_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Object.h"
+-/*}}}*/
+-
+-class KML_StyleSelector: public KML_Object {
+-
+-	public:
+-
+-		/*KML_StyleSelector constructors, destructors {{{*/
+-		KML_StyleSelector();
+-		~KML_StyleSelector();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_STYLESELECTOR_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LatLonBox.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LatLonBox.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LatLonBox.h	(revision 12822)
+@@ -1,48 +0,0 @@
+-/*! \file KML_LatLonBox.h 
+- *  \brief: header file for kml_latlonbox object
+- */
+-
+-#ifndef _KML_LATLONBOX_H_
+-#define _KML_LATLONBOX_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Object.h"
+-/*}}}*/
+-
+-class KML_LatLonBox: public KML_Object {
+-
+-	public:
+-
+-		double north;
+-		double south;
+-		double east;
+-		double west;
+-		double rotation;
+-
+-		/*KML_LatLonBox constructors, destructors {{{*/
+-		KML_LatLonBox();
+-		~KML_LatLonBox();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_LATLONBOX_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineStyle.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineStyle.cpp	(revision 12822)
+@@ -1,138 +0,0 @@
+-/*!\file KML_LineStyle.cpp
+- * \brief: implementation of the kml_linestyle object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_LineStyle::KML_LineStyle(){{{*/
+-KML_LineStyle::KML_LineStyle(){
+-
+-	width     =1.;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineStyle::~KML_LineStyle(){{{*/
+-KML_LineStyle::~KML_LineStyle(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_LineStyle::Echo {{{*/
+-void  KML_LineStyle::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_LineStyle:");
+-	KML_ColorStyle::Echo();
+-
+-	if(flag) _pprintLine_("         width: " << width);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineStyle::DeepEcho {{{*/
+-void  KML_LineStyle::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_LineStyle::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineStyle::DeepEcho {{{*/
+-void  KML_LineStyle::DeepEcho(const char* indent){
+-
+-	int   i;
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_LineStyle:");
+-	KML_ColorStyle::DeepEcho(indent);
+-
+-	if(flag) _pprintLine_(indent << "         width: " << width);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineStyle::Write {{{*/
+-void  KML_LineStyle::Write(FILE* filout,const char* indent){
+-
+-	fprintf(filout,"%s<LineStyle",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_ColorStyle::Write(filout,indent);
+-
+-	fprintf(filout,"%s  <width>%g</width>\n",indent,width);
+-
+-	fprintf(filout,"%s</LineStyle>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineStyle::Read {{{*/
+-void  KML_LineStyle::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</LineStyle",11)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strcmp(kstri,"<width>"))
+-			KMLFileTokenParse(&width     ,
+-							  kstri,
+-							  fid);
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_ColorStyle::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Attribute.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Attribute.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Attribute.h	(revision 12822)
+@@ -1,50 +0,0 @@
+-/*! \file KML_Attribute.h 
+- *  \brief: header file for kml_attribute object
+- */
+-
+-#ifndef _KML_ATTRIBUTE_H_
+-#define _KML_ATTRIBUTE_H_
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "../Object.h"
+-class DataSet;
+-/*}}}*/
+-
+-class KML_Attribute: public Object {
+-
+-	public:
+-
+-		char* name;
+-		char* value;
+-
+-		/*KML_Attribute constructors, destructors {{{*/
+-		KML_Attribute();
+-		~KML_Attribute();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		virtual void  Echo();
+-		virtual void  DeepEcho();
+-		virtual void  DeepEcho(const char* indent);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		void  Alloc(const char* namei,const char* valuei);
+-		void  Add(DataSet* attrib);
+-		void  Get(char** pvalueo,char* deflt);
+-
+-};
+-#endif  /* _KML_ATTRIBUTE_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_PolyStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_PolyStyle.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_PolyStyle.h	(revision 12822)
+@@ -1,45 +0,0 @@
+-/*! \file KML_PolyStyle.h 
+- *  \brief: header file for kml_polystyle object
+- */
+-
+-#ifndef _KML_POLYSTYLE_H_
+-#define _KML_POLYSTYLE_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_ColorStyle.h"
+-/*}}}*/
+-
+-class KML_PolyStyle: public KML_ColorStyle {
+-
+-	public:
+-
+-		int   fill;
+-		int   outline;
+-
+-		/*KML_PolyStyle constructors, destructors {{{*/
+-		KML_PolyStyle();
+-		~KML_PolyStyle();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_POLYSTYLE_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Folder.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Folder.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Folder.cpp	(revision 12822)
+@@ -1,131 +0,0 @@
+-/*!\file KML_Folder.cpp
+- * \brief: implementation of the kml_folder object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Folder::KML_Folder(){{{*/
+-KML_Folder::KML_Folder(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Folder::~KML_Folder(){{{*/
+-KML_Folder::~KML_Folder(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Folder::Echo {{{*/
+-void  KML_Folder::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_Folder:");
+-	KML_Container::Echo();
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Folder::DeepEcho {{{*/
+-void  KML_Folder::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Folder::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Folder::DeepEcho {{{*/
+-void  KML_Folder::DeepEcho(const char* indent){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_Folder:");
+-	KML_Container::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Folder::Write {{{*/
+-void  KML_Folder::Write(FILE* filout,const char* indent){
+-
+-	fprintf(filout,"%s<Folder",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Container::Write(filout,indent);
+-
+-	fprintf(filout,"%s</Folder>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Folder::Read {{{*/
+-void  KML_Folder::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</Folder", 8)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Container::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Object.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Object.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Object.h	(revision 12822)
+@@ -1,56 +0,0 @@
+-/*! \file KML_Object.h 
+- *  \brief: header file for kml_object abstract object
+- */
+-
+-#ifndef _KML_OBJECT_H_
+-#define _KML_OBJECT_H_
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "../Object.h"
+-class DataSet;
+-/*}}}*/
+-
+-class KML_Object: public Object {
+-
+-	public:
+-
+-		DataSet* attrib;
+-		DataSet* commnt;
+-		DataSet* kmlobj;
+-
+-		/*KML_Object constructors, destructors {{{*/
+-		KML_Object();
+-		~KML_Object();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		virtual void  Echo();
+-		virtual void  DeepEcho();
+-		virtual void  DeepEcho(const char* indent);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		virtual void  Write(FILE* fid,const char* indent)=0;
+-		virtual void  Read(FILE* fid,char* kstr)=0;
+-		virtual void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		virtual void  AddAttrib(const char* name,const char* value);
+-		virtual void  FindAttrib(char** pvalue,char* name,char* deflt);
+-		virtual void  WriteAttrib(FILE* fid,const char* indent);
+-		virtual void  AddCommnt(int ncom,char** pcom);
+-		virtual void  AddCommnt(char* value);
+-		virtual void  FindCommnt(char** pvalue,int inum);
+-		virtual void  WriteCommnt(FILE* fid,const char* indent);
+-
+-};
+-#endif  /* _KML_OBJECT_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Document.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Document.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Document.cpp	(revision 12822)
+@@ -1,131 +0,0 @@
+-/*!\file KML_Document.cpp
+- * \brief: implementation of the kml_document object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Document::KML_Document(){{{*/
+-KML_Document::KML_Document(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Document::~KML_Document(){{{*/
+-KML_Document::~KML_Document(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Document::Echo {{{*/
+-void  KML_Document::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_Document:");
+-	KML_Container::Echo();
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Document::DeepEcho {{{*/
+-void  KML_Document::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Document::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Document::DeepEcho {{{*/
+-void  KML_Document::DeepEcho(const char* indent){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_Document:");
+-	KML_Container::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Document::Write {{{*/
+-void  KML_Document::Write(FILE* filout,const char* indent){
+-
+-	fprintf(filout,"%s<Document",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Container::Write(filout,indent);
+-
+-	fprintf(filout,"%s</Document>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_Document::Read {{{*/
+-void  KML_Document::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</Document",10)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Container::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_File.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_File.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_File.cpp	(revision 12822)
+@@ -1,140 +0,0 @@
+-/*!\file KML_File.cpp
+- * \brief: implementation of the kml_file object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_File::KML_File(){{{*/
+-KML_File::KML_File(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_File::~KML_File(){{{*/
+-KML_File::~KML_File(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_File::Echo {{{*/
+-void  KML_File::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_File:");
+-	KML_Object::Echo();
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_File::DeepEcho {{{*/
+-void  KML_File::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_File::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_File::DeepEcho {{{*/
+-void  KML_File::DeepEcho(const char* indent){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_File:");
+-	KML_Object::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_File::Write {{{*/
+-void  KML_File::Write(FILE* filout,const char* indent){
+-
+-	fprintf(filout,"%s<kml",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Object::Write(filout,indent);
+-
+-	fprintf(filout,"%s</kml>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_File::Read {{{*/
+-void  KML_File::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-	KML_Object*  kobj;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</kml", 5)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Object::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_File::WriteExp {{{*/
+-void  KML_File::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
+-
+-	int   i;
+-
+-/*  loop over the kml objects for the file  */
+-
+-	for (i=0; i<kmlobj->Size(); i++)
+-		((KML_Object *)kmlobj->GetObjectByOffset(i))->WriteExp(fid,nstr,sgn,cm,sp);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_SubStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_SubStyle.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_SubStyle.h	(revision 12822)
+@@ -1,42 +0,0 @@
+-/*! \file KML_SubStyle.h 
+- *  \brief: header file for kml_substyle abstract object
+- */
+-
+-#ifndef _KML_SUBSTYLE_H_
+-#define _KML_SUBSTYLE_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Object.h"
+-/*}}}*/
+-
+-class KML_SubStyle: public KML_Object {
+-
+-	public:
+-
+-		/*KML_SubStyle constructors, destructors {{{*/
+-		KML_SubStyle();
+-		~KML_SubStyle();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_SUBSTYLE_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineString.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineString.h	(revision 12822)
+@@ -1,51 +0,0 @@
+-/*! \file KML_LineString.h 
+- *  \brief: header file for kml_linestring object
+- */
+-
+-#ifndef _KML_LINESTRING_H_
+-#define _KML_LINESTRING_H_
+-
+-#define KML_LINESTRING_ALTMODE_LENGTH    18
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Geometry.h"
+-/*}}}*/
+-
+-class KML_LineString: public KML_Geometry {
+-
+-	public:
+-
+-		bool    extrude;
+-		bool    tessellate;
+-		char    altmode[KML_LINESTRING_ALTMODE_LENGTH+1];
+-		int     ncoord;
+-		double *coords;
+-
+-		/*KML_LineString constructors, destructors {{{*/
+-		KML_LineString();
+-		~KML_LineString();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_LINESTRING_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Overlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Overlay.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Overlay.h	(revision 12822)
+@@ -1,49 +0,0 @@
+-/*! \file KML_Overlay.h 
+- *  \brief: header file for kml_overlay abstract object
+- */
+-
+-#ifndef _KML_OVERLAY_H_
+-#define _KML_OVERLAY_H_
+-
+-#define KML_OVERLAY_COLOR_LENGTH  8
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Feature.h"
+-class KML_Icon;
+-/*}}}*/
+-
+-class KML_Overlay: public KML_Feature {
+-
+-	public:
+-
+-		char  color[KML_OVERLAY_COLOR_LENGTH+1];
+-		int   draword;
+-		KML_Icon* icon;
+-
+-		/*KML_Overlay constructors, destructors {{{*/
+-		KML_Overlay();
+-		~KML_Overlay();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_OVERLAY_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Container.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Container.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Container.h	(revision 12822)
+@@ -1,46 +0,0 @@
+-/*! \file KML_Container.h 
+- *  \brief: header file for kml_container abstract object
+- */
+-
+-#ifndef _KML_CONTAINER_H_
+-#define _KML_CONTAINER_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Feature.h"
+-class DataSet;
+-/*}}}*/
+-
+-class KML_Container: public KML_Feature {
+-
+-	public:
+-
+-		DataSet* feature;
+-
+-		/*KML_Container constructors, destructors {{{*/
+-		KML_Container();
+-		~KML_Container();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_CONTAINER_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Icon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Icon.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Icon.cpp	(revision 12822)
+@@ -1,182 +0,0 @@
+-/*!\file KML_Icon.cpp
+- * \brief: implementation of the kml_feature abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Icon::KML_Icon(){{{*/
+-KML_Icon::KML_Icon(){
+-
+-	strcpy(href      ,"");
+-	strcpy(refmode   ,"onChange");
+-	refint    = 4.;
+-	strcpy(vrefmode  ,"never");
+-	vreftime  = 4.;
+-	vboundsc  = 1.;
+-	strcpy(vformat   ,"");
+-	strcpy(hquery    ,"");
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Icon::~KML_Icon(){{{*/
+-KML_Icon::~KML_Icon(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Icon::Echo {{{*/
+-void  KML_Icon::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_Icon:");
+-	KML_Object::Echo();
+-
+-	if(flag) _pprintLine_("          href: \"" << href << "\"");
+-	if(flag) _pprintLine_("       refmode: \"" << refmode << "\"");
+-	if(flag) _pprintLine_("        refint: " << refint);
+-	if(flag) _pprintLine_("      vrefmode: \"" << vrefmode << "\"");
+-	if(flag) _pprintLine_("      vreftime: " << vreftime);
+-	if(flag) _pprintLine_("      vboundsc: " << vboundsc);
+-	if(flag) _pprintLine_("       vformat: \"" << vformat << "\"");
+-	if(flag) _pprintLine_("        hquery: \"" << hquery << "\"");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Icon::DeepEcho {{{*/
+-void  KML_Icon::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Icon::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Icon::DeepEcho {{{*/
+-void  KML_Icon::DeepEcho(const char* indent){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_Icon:");
+-	KML_Object::DeepEcho(indent);
+-
+-	if(flag) _pprintLine_(indent << "          href: \"" << href << "\"");
+-	if(flag) _pprintLine_(indent << "       refmode: \"" << refmode << "\"");
+-	if(flag) _pprintLine_(indent << "        refint: " << refint);
+-	if(flag) _pprintLine_(indent << "      vrefmode: \"" << vrefmode << "\"");
+-	if(flag) _pprintLine_(indent << "      vreftime: " << vreftime);
+-	if(flag) _pprintLine_(indent << "      vboundsc: " << vboundsc);
+-	if(flag) _pprintLine_(indent << "       vformat: \"" << vformat << "\"");
+-	if(flag) _pprintLine_(indent << "        hquery: \"" << hquery << "\"");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Icon::Write {{{*/
+-void  KML_Icon::Write(FILE* filout,const char* indent){
+-
+-	fprintf(filout,"%s<Icon",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Object::Write(filout,indent);
+-
+-	if (href     && strlen(href))
+-		fprintf(filout,"%s  <href>%s</href>\n",indent,href);
+-	if (refmode  && strlen(refmode))
+-		fprintf(filout,"%s  <refreshMode>%s</refreshMode>\n",indent,refmode);
+-	fprintf(filout,"%s  <refreshInterval>%g</refreshInterval>\n",indent,refint);
+-	if (vrefmode && strlen(vrefmode))
+-		fprintf(filout,"%s  <viewRefreshMode>%s</viewRefreshMode>\n",indent,vrefmode);
+-	fprintf(filout,"%s  <viewRefreshTime>%g</viewRefreshTime>\n",indent,vreftime);
+-	fprintf(filout,"%s  <viewBoundScale>%g</viewBoundScale>\n",indent,vboundsc);
+-	if (vformat  && strlen(vformat))
+-		fprintf(filout,"%s  <viewFormat>%s</viewFormat>\n",indent,vformat);
+-	if (hquery   && strlen(hquery))
+-		fprintf(filout,"%s  <httpQuery>%s</httpQuery>\n",indent,hquery);
+-
+-	fprintf(filout,"%s</Icon>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Icon::Read {{{*/
+-void  KML_Icon::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</Icon", 6)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strcmp(kstri,"<href>"))
+-			KMLFileTokenParse( href      ,NULL,KML_ICON_HREF_LENGTH, kstri, fid);
+-		else if (!strcmp(kstri,"<refreshMode>"))
+-			KMLFileTokenParse( refmode   ,NULL,KML_ICON_REFMODE_LENGTH, kstri, fid);
+-		else if (!strcmp(kstri,"<refreshInterval>"))
+-			KMLFileTokenParse(&refint    , kstri, fid);
+-		else if (!strcmp(kstri,"<viewRefreshMode>"))
+-			KMLFileTokenParse( vrefmode  ,NULL,KML_ICON_VREFMODE_LENGTH, kstri, fid);
+-		else if (!strcmp(kstri,"<viewRefreshTime>"))
+-			KMLFileTokenParse(&vreftime  , kstri, fid);
+-		else if (!strcmp(kstri,"<viewBoundScale>"))
+-			KMLFileTokenParse(&vboundsc  , kstri, fid);
+-		else if (!strcmp(kstri,"<viewFormat>"))
+-			KMLFileTokenParse( vformat   ,NULL,KML_ICON_VFORMAT_LENGTH, kstri, fid);
+-		else if (!strcmp(kstri,"<httpQuery>"))
+-			KMLFileTokenParse( hquery    ,NULL,KML_ICON_HQUERY_LENGTH, kstri, fid);
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Object::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Point.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Point.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Point.cpp	(revision 12822)
+@@ -1,193 +0,0 @@
+-/*!\file KML_Point.cpp
+- * \brief: implementation of the kml_point object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-#include "../../modules/Ll2xyx/Ll2xyx.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Point::KML_Point(){{{*/
+-KML_Point::KML_Point(){
+-
+-	extrude   =false;
+-	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
+-
+-	coords[0] = 0.;
+-	coords[1] = 0.;
+-	coords[2] = 0.;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Point::~KML_Point(){{{*/
+-KML_Point::~KML_Point(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Point::Echo {{{*/
+-void  KML_Point::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_Point:");
+-	KML_Geometry::Echo();
+-
+-	if(flag) _pprintLine_("       extrude: " << (extrude ? "true" : "false"));
+-	if(flag) _pprintLine_("       altmode: \"" << altmode << "\"");
+-	if(flag) _pprintLine_("        coords: (" << coords[0] << "," << coords[1] << "," << coords[2] << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Point::DeepEcho {{{*/
+-void  KML_Point::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Point::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Point::DeepEcho {{{*/
+-void  KML_Point::DeepEcho(const char* indent){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_Point:");
+-	KML_Geometry::DeepEcho(indent);
+-
+-	if(flag) _pprintLine_(indent << "       extrude: " << (extrude ? "true" : "false"));
+-	if(flag) _pprintLine_(indent << "       altmode: \"" << altmode << "\"");
+-	if(flag) _pprintLine_(indent << "        coords: (" << coords[0] << "," << coords[1] << "," << coords[2] << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Point::Write {{{*/
+-void  KML_Point::Write(FILE* filout,const char* indent){
+-
+-	fprintf(filout,"%s<Point",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Geometry::Write(filout,indent);
+-
+-	fprintf(filout,"%s  <extrude>%d</extrude>\n",indent,(extrude ? 1 : 0));
+-	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
+-	fprintf(filout,"%s  <coordinates>%0.16g,%0.16g,%0.16g</coordinates>\n",
+-			indent,coords[0],coords[1],coords[2]);
+-
+-	fprintf(filout,"%s</Point>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Point::Read {{{*/
+-void  KML_Point::Read(FILE* fid,char* kstr){
+-
+-	double*      pcoords=&coords[0];
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</Point", 7)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strcmp(kstri,"<extrude>"))
+-			KMLFileTokenParse(&extrude   , kstri, fid);
+-		else if (!strcmp(kstri,"<altitudeMode>"))
+-			KMLFileTokenParse( altmode   ,NULL,KML_POINT_ALTMODE_LENGTH, kstri, fid);
+-		else if (!strcmp(kstri,"<coordinates>"))
+-			KMLFileTokenParse(&pcoords   ,NULL,3, kstri, fid);
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Geometry::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Point::WriteExp {{{*/
+-void  KML_Point::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
+-
+-	int     i;
+-	double  lat,lon,x,y;
+-	char    nstr2[81];
+-
+-/*  extract latitude and longitude  */
+-
+-	lon=coords[0];
+-	lat=coords[1];
+-
+-/*  convert latitude and longitude to x and y  */
+-
+-	Ll2xyx(&x,&y,&lat,&lon,1,sgn,cm,sp);
+-
+-/*  write header  */
+-
+-	memcpy(nstr2,nstr,(strlen(nstr)+1)*sizeof(char));
+-
+-	for (i=0; i<strlen(nstr2); i++)
+-		if ((nstr2[i] == ' ') || (nstr2[i] == '\t'))
+-			nstr2[i]='_';
+-	fprintf(fid,"## Name:%s\n",nstr2);
+-	fprintf(fid,"## Icon:0\n");
+-	fprintf(fid,"# Points Count	Value\n");
+-    fprintf(fid,"%u	%s\n",1,"1.");
+-	fprintf(fid,"# X pos	Y pos\n");
+-
+-/*  write vertex  */
+-
+-    fprintf(fid,"%lf\t%lf\n",x,y);
+-
+-/*  write blank line  */
+-
+-	fprintf(fid,"\n");
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LinearRing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LinearRing.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LinearRing.cpp	(revision 12822)
+@@ -1,223 +0,0 @@
+-/*!\file KML_LinearRing.cpp
+- * \brief: implementation of the kml_linearring object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-#include "../../io/io.h"
+-#include "../../modules/Ll2xyx/Ll2xyx.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_LinearRing::KML_LinearRing(){{{*/
+-KML_LinearRing::KML_LinearRing(){
+-
+-	extrude   =false;
+-	tessellate=false;
+-	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
+-
+-	ncoord    =0;
+-	coords    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_LinearRing::~KML_LinearRing(){{{*/
+-KML_LinearRing::~KML_LinearRing(){
+-
+-	if (coords) xDelete<double>(coords);
+-
+-	coords    =NULL;
+-	ncoord    =0;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_LinearRing::Echo {{{*/
+-void  KML_LinearRing::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_LinearRing:");
+-	KML_Geometry::Echo();
+-
+-	if(flag) _pprintLine_("       extrude: " << (extrude ? "true" : "false"));
+-	if(flag) _pprintLine_("    tessellate: " << (tessellate ? "true" : "false"));
+-	if(flag) _pprintLine_("       altmode: \"" << altmode << "\"");
+-	if(flag) _pprintLine_("        coords: (ncoord=" << ncoord << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LinearRing::DeepEcho {{{*/
+-void  KML_LinearRing::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_LinearRing::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LinearRing::DeepEcho {{{*/
+-void  KML_LinearRing::DeepEcho(const char* indent){
+-
+-	int   i;
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_LinearRing:");
+-	KML_Geometry::DeepEcho(indent);
+-
+-	if(flag) _pprintLine_(indent << "       extrude: " << (extrude ? "true" : "false"));
+-	if(flag) _pprintLine_(indent << "    tessellate: " << (tessellate ? "true" : "false"));
+-	if(flag) _pprintLine_(indent << "       altmode: \"" << altmode << "\"");
+-	if(flag) _pprintLine_(indent << "        coords: (ncoord=" << ncoord << ")");
+-	for (i=0; i<ncoord; i++)
+-		_printf_(flag,"%s                (%g,%g,%g)\n",indent,
+-				coords[3*i+0],coords[3*i+1],coords[3*i+2]);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LinearRing::Write {{{*/
+-void  KML_LinearRing::Write(FILE* filout,const char* indent){
+-
+-	int   i;
+-
+-	fprintf(filout,"%s<LinearRing",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Geometry::Write(filout,indent);
+-
+-	fprintf(filout,"%s  <extrude>%d</extrude>\n",indent,(extrude ? 1 : 0));
+-	fprintf(filout,"%s  <tessellate>%d</tessellate>\n",indent,(tessellate ? 1 : 0));
+-	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
+-	fprintf(filout,"%s  <coordinates>\n",indent);
+-
+-/*  loop over the coordinates for the linearring  */
+-
+-	for (i=0; i<ncoord; i++)
+-		fprintf(filout,"%s    %0.16g,%0.16g,%0.16g\n",indent,coords[3*i+0],coords[3*i+1],coords[3*i+2]);
+-
+-	fprintf(filout,"%s  </coordinates>\n",indent);
+-	fprintf(filout,"%s</LinearRing>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LinearRing::Read {{{*/
+-void  KML_LinearRing::Read(FILE* fid,char* kstr){
+-
+-	char  *kstri = NULL;
+-	int    ncom  = 0;
+-	char **pcom  = NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,kstr)) return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,&ncom,&pcom)){
+-		if (!strncmp(kstri,"</LinearRing",12)){
+-			xDelete<char>(kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strcmp(kstri,"<extrude>"))
+-			KMLFileTokenParse(&extrude,kstri,fid);
+-		else if (!strcmp(kstri,"<tessellate>"))
+-			KMLFileTokenParse(&tessellate,kstri,fid);
+-		else if (!strcmp(kstri,"<altitudeMode>"))
+-			KMLFileTokenParse(altmode,NULL,KML_LINEARRING_ALTMODE_LENGTH,kstri,fid);
+-		else if (!strcmp(kstri,"<coordinates>"))
+-			KMLFileTokenParse(&coords,&ncoord,0,kstri,fid);
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Geometry::Read(fid,kstri);
+-
+-		xDelete<char>(kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for(ncom;ncom>0;ncom--) xDelete<char>((pcom[ncom-1]));
+-	xDelete<char*>(pcom);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LinearRing::WriteExp {{{*/
+-void  KML_LinearRing::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
+-
+-	int     i;
+-	double  *lat,*lon,*x,*y;
+-	char    nstr2[81];
+-
+-/*  extract latitude and longitude into vectors  */
+-
+-	lat=xNew<double>(ncoord);
+-	lon=xNew<double>(ncoord);
+-	for (i=0; i<ncoord; i++) {
+-		lon[i]=coords[3*i+0];
+-		lat[i]=coords[3*i+1];
+-	}
+-
+-/*  convert latitude and longitude to x and y  */
+-
+-	x  =xNew<double>(ncoord);
+-	y  =xNew<double>(ncoord);
+-	Ll2xyx(x,y,lat,lon,ncoord,sgn,cm,sp);
+-
+-/*  write header  */
+-
+-	memcpy(nstr2,nstr,(strlen(nstr)+1)*sizeof(char));
+-
+-	for (i=0; i<strlen(nstr2); i++)
+-		if ((nstr2[i] == ' ') || (nstr2[i] == '\t'))
+-			nstr2[i]='_';
+-	fprintf(fid,"## Name:%s\n",nstr2);
+-	fprintf(fid,"## Icon:0\n");
+-	fprintf(fid,"# Points Count	Value\n");
+-	if ((lat[ncoord-1] != lat[0]) || (lon[ncoord-1] != lon[0]))
+-	    fprintf(fid,"%u	%s\n",ncoord+1,"1.");
+-	else
+-	    fprintf(fid,"%u	%s\n",ncoord  ,"1.");
+-	fprintf(fid,"# X pos	Y pos\n");
+-
+-/*  write vertices, making sure ring is closed  */
+-
+-	for (i=0; i<ncoord; i++)
+-	    fprintf(fid,"%lf\t%lf\n",x[i],y[i]);
+-	if ((lat[ncoord-1] != lat[0]) || (lon[ncoord-1] != lon[0]))
+-	    fprintf(fid,"%lf\t%lf\n",x[0],y[0]);
+-
+-/*  write blank line  */
+-
+-	fprintf(fid,"\n");
+-
+-	xDelete<double>(y);
+-	xDelete<double>(x);
+-	xDelete<double>(lon);
+-	xDelete<double>(lat);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Feature.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Feature.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Feature.cpp	(revision 12822)
+@@ -1,179 +0,0 @@
+-/*!\file KML_Feature.cpp
+- * \brief: implementation of the kml_feature abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Feature::KML_Feature(){{{*/
+-KML_Feature::KML_Feature(){
+-
+-	memcpy(name,"",(strlen("")+1)*sizeof(char));
+-
+-	visibility=true;
+-	open      =false;
+-	memcpy(snippet,"",(strlen("")+1)*sizeof(char));
+-	memcpy(descript,"",(strlen("")+1)*sizeof(char));
+-	memcpy(styleurl,"",(strlen("")+1)*sizeof(char));
+-	style     =new DataSet;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Feature::~KML_Feature(){{{*/
+-KML_Feature::~KML_Feature(){
+-
+-	if (style) {
+-		delete style;
+-		style     =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Feature::Echo {{{*/
+-void  KML_Feature::Echo(){
+-
+-	bool  flag=true;
+-
+-	KML_Object::Echo();
+-
+-	if(flag) _pprintLine_("          name: \"" << name << "\"");
+-	if(flag) _pprintLine_("    visibility: " << (visibility ? "true" : "false"));
+-	if(flag) _pprintLine_("          open: " << (open ? "true" : "false"));
+-	if(flag) _pprintLine_("       snippet: \"" << snippet << "\"");
+-	if(flag) _pprintLine_("      descript: \"" << descript << "\"");
+-	if(flag) _pprintLine_("      styleurl: \"" << styleurl << "\"");
+-	if(flag) _pprintLine_("         style: (size=" << style->Size() << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Feature::DeepEcho {{{*/
+-void  KML_Feature::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Feature::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Feature::DeepEcho {{{*/
+-void  KML_Feature::DeepEcho(const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-	bool  flag=true;
+-
+-	KML_Object::DeepEcho(indent);
+-
+-	if(flag) _pprintLine_(indent << "          name: \"" << name << "\"");
+-	if(flag) _pprintLine_(indent << "    visibility: " << (visibility ? "true" : "false"));
+-	if(flag) _pprintLine_(indent << "          open: " << (open ? "true" : "false"));
+-	if(flag) _pprintLine_(indent << "       snippet: \"" << snippet << "\"");
+-	if(flag) _pprintLine_(indent << "      descript: \"" << descript << "\"");
+-	if(flag) _pprintLine_(indent << "      styleurl: \"" << styleurl << "\"");
+-
+-/*  loop over any styles for the feature  */
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent2,"  ");
+-
+-	if (style->Size())
+-		for (i=0; i<style->Size(); i++) {
+-			if(flag) _pprintLine_(indent << "         style: -------- begin [" << i << "] --------");
+-			((KML_Style *)style->GetObjectByOffset(i))->DeepEcho(indent2);
+-			if(flag) _pprintLine_(indent << "         style: --------  end  [" << i << "] --------");
+-		}
+-	else
+-		if(flag) _pprintLine_(indent << "         style: [empty]");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Feature::Write {{{*/
+-void  KML_Feature::Write(FILE* filout,const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-
+-	KML_Object::Write(filout,indent);
+-
+-	if (name     && strlen(name))
+-		fprintf(filout,"%s  <name>%s</name>\n",indent,name);
+-	fprintf(filout,"%s  <visibility>%d</visibility>\n",indent,(visibility ? 1 : 0));
+-	fprintf(filout,"%s  <open>%d</open>\n",indent,(open ? 1 : 0));
+-	if (snippet  && strlen(snippet))
+-		fprintf(filout,"%s  <Snippet maxLines=\"2\">%s</Snippet>\n",indent,snippet);
+-	if (descript && strlen(descript))
+-		fprintf(filout,"%s  <description>%s</description>\n",indent,descript);
+-	if (styleurl && strlen(styleurl))
+-		fprintf(filout,"%s  <styleUrl>%s</styleUrl>\n",indent,styleurl);
+-
+-/*  loop over any styles for the feature  */
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-
+-	strcat(indent2,"  ");
+-
+-    for (i=0; i<style->Size(); i++)
+-        ((KML_Style *)style->GetObjectByOffset(i))->Write(filout,indent2);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Feature::Read {{{*/
+-void  KML_Feature::Read(FILE* fid,char* kstr){
+-
+-	KML_Object*  kobj;
+-
+-/*  process field within opening and closing tags  */
+-
+-	if      (!strncmp(kstr,"</Feature", 9))
+-		return;
+-	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Feature::Read -- Unexpected closing tag " << kstr);}
+-	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");}
+-
+-	else if (!strncmp(kstr,"<Style", 6)) {
+-		kobj=(KML_Object*)new KML_Style();
+-		kobj->Read(fid,kstr);
+-		style     ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strcmp(kstr,"<name>"))
+-		KMLFileTokenParse( name      ,NULL,KML_FEATURE_NAME_LENGTH, kstr, fid);
+-	else if (!strcmp(kstr,"<visibility>"))
+-		KMLFileTokenParse(&visibility, kstr, fid);
+-	else if (!strcmp(kstr,"<open>"))
+-		KMLFileTokenParse(&open      , kstr, fid);
+-	else if (!strncmp(kstr,"<snippet", 8))
+-		KMLFileTokenParse( snippet   ,NULL,KML_FEATURE_SNIPPET_LENGTH, kstr, fid);
+-	else if (!strcmp(kstr,"<description>"))
+-		KMLFileTokenParse( descript  ,NULL,KML_FEATURE_DESCRIPT_LENGTH, kstr, fid);
+-	else if (!strcmp(kstr,"<styleUrl>"))
+-		KMLFileTokenParse( styleurl  ,NULL,KML_FEATURE_STYLEURL_LENGTH, kstr, fid);
+-
+-	else if (!strncmp(kstr,"<",1))
+-		KML_Object::Read(fid,kstr);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Polygon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Polygon.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Polygon.h	(revision 12822)
+@@ -1,53 +0,0 @@
+-/*! \file KML_Polygon.h 
+- *  \brief: header file for kml_polygon object
+- */
+-
+-#ifndef _KML_POLYGON_H_
+-#define _KML_POLYGON_H_
+-
+-#define KML_POLYGON_ALTMODE_LENGTH    18
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Geometry.h"
+-class KML_LinearRing;
+-class DataSet;
+-/*}}}*/
+-
+-class KML_Polygon: public KML_Geometry {
+-
+-	public:
+-
+-		bool  extrude;
+-		bool  tessellate;
+-		char  altmode[KML_POLYGON_ALTMODE_LENGTH+1];
+-		DataSet* outer;
+-		DataSet* inner;
+-
+-		/*KML_Polygon constructors, destructors {{{*/
+-		KML_Polygon();
+-		~KML_Polygon();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_POLYGON_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KMLFileReadUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KMLFileReadUtils.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KMLFileReadUtils.cpp	(revision 12822)
+@@ -1,700 +0,0 @@
+-/*!\file KMLFileUtils.cpp
+- * \brief: utilities for kml file reading.
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*FUNCTION  KMLFileToken(FILE* fid,int* pncom=NULL,char*** ppcom=NULL) {{{*/
+-char* KMLFileToken(FILE* fid,
+-				   int* pncom=NULL,char*** ppcom=NULL){
+-
+-/*  get the next token (tag or field) in the file  */
+-
+-	bool    inew=1,itag=0,ifield=0;
+-	int     c;
+-	int     ibuf=0,buflen=1024,bufblk=1024;
+-	char    *buffer=NULL,*bufferc=NULL;
+-
+-	buffer=(char *) xmalloc(buflen*sizeof(char));
+-	buffer[0]='\0';
+-
+-/*  read kml file character-by-character  */
+-
+-//  note that fgets includes newline
+-//	fgets(buffer,buflen,fid);
+-
+-	while ((c=getc(fid)) != EOF) {
+-		/*  ignore leading blanks  */
+-		if (inew && isspace(c))
+-			continue;
+-
+-		/*  distinguish between tag or field  */
+-		if (!itag && !ifield) {
+-
+-			/*  distinguish between tag or comment  */
+-			if (c == '<') {
+-				ungetc(c,fid);
+-				if (!(bufferc=KMLFileTokenComment(fid))) {
+-					c=getc(fid);
+-					itag=1;
+-				}
+-				else {
+-					if (pncom && ppcom) {
+-						(*pncom)++;
+-						*ppcom=(char **) xrealloc(*ppcom,*pncom*sizeof(char*));
+-						(*ppcom)[*pncom-1]=bufferc;
+-					}
+-					else
+-						xfree((void**)&bufferc);
+-					inew=1;
+-					continue;
+-				}
+-			}
+-			else
+-				ifield=1;
+-			inew=0;
+-			KMLFileTokenBuffer(&buffer,&ibuf,&buflen,
+-							   c,
+-							   bufblk);
+-		}
+-
+-		/*  accumulate tag, not including newlines  */
+-		else if (itag) {
+-			if (c != '\n') {
+-				inew=0;
+-				KMLFileTokenBuffer(&buffer,&ibuf,&buflen,
+-								   c,
+-								   bufblk);
+-				if (c == '>')
+-					break;
+-			}
+-			else
+-				inew=1;
+-		}
+-
+-		/*  accumulate field, including newlines  */
+-		else if (ifield) {
+-			/*  distinguish between another tag or comment  */
+-			if (c == '<') {
+-				ungetc(c,fid);
+-				if (!(bufferc=KMLFileTokenComment(fid)))
+-					break;
+-				else
+-					if (pncom && ppcom) {
+-						(*pncom)++;
+-						*ppcom=(char **) xrealloc(*ppcom,*pncom*sizeof(char*));
+-						(*ppcom)[*pncom-1]=bufferc;
+-					}
+-					else
+-						xfree((void**)&bufferc);
+-			}
+-			else {
+-				inew=0;
+-				KMLFileTokenBuffer(&buffer,&ibuf,&buflen,
+-								   c,
+-								   bufblk);
+-				if (c == '\n')
+-					inew=1;
+-			}
+-		}
+-
+-	}
+-
+-/*  remove trailing blanks or newline  */
+-
+-	while (ibuf > 0)
+-		if (isspace(buffer[ibuf-1]))
+-			ibuf--;
+-		else {
+-			buffer[ibuf]='\0';
+-			break;
+-		}
+-
+-//	if      (itag)
+-//		_pprintLine_("tag buffer (length=" << ibuf << "):");
+-//	else if (ifield)
+-//		_pprintLine_("field buffer (length=" << ibuf << "):");
+-//	_pprintLine_(buffer);
+-
+-	if (!ibuf)
+-		xfree((void**)&buffer);
+-
+-	return(buffer);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTokenComment(FILE* fid) {{{*/
+-char* KMLFileTokenComment(FILE* fid){
+-
+-/*  check for comment in the file and read it  */
+-
+-	bool    inew=1;
+-	int     i;
+-	int     c;
+-	int     ibuf=0,buflen=1024,bufblk=1024;
+-	char*   buffer=NULL;
+-
+-	buffer=(char *) xmalloc(buflen*sizeof(char));
+-	buffer[0]='\0';
+-
+-/*  read kml file character-by-character  */
+-
+-	while ((c=getc(fid)) != EOF) {
+-		/*  ignore leading blanks  */
+-		if (inew && isspace(c))
+-			continue;
+-
+-		inew=0;
+-		KMLFileTokenBuffer(&buffer,&ibuf,&buflen,
+-						   c,
+-						   bufblk);
+-
+-		/*  check for comment  */
+-		if (ibuf <= 4) {
+-			if ((ibuf == 1 && buffer[0] != '<') ||
+-				(ibuf == 2 && buffer[1] != '!') ||
+-				(ibuf == 3 && buffer[2] != '-') ||
+-				(ibuf == 4 && buffer[3] != '-')) {
+-				for (i=ibuf-1; i>=0; i--)
+-					ungetc(buffer[i],fid);
+-				xfree((void**)&buffer);
+-				return(buffer);
+-			}
+-		}
+-
+-		/*  accumulate comment, including newlines  */
+-		else
+-			if (buffer[ibuf-3]=='-' && buffer[ibuf-2]=='-' && buffer[ibuf-1]=='>')
+-				break;
+-	}
+-
+-/*  remove trailing blanks or newline  */
+-
+-	while (ibuf > 0)
+-		if (isspace(buffer[ibuf-1]))
+-			ibuf--;
+-		else {
+-			buffer[ibuf]='\0';
+-			break;
+-		}
+-
+-//	_pprintLine_("comment buffer (length=" << ibuf << "):");
+-//	_pprintLine_(buffer);
+-
+-	if (!ibuf)
+-		xfree((void**)&buffer);
+-
+-	return(buffer);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTokenBuffer {{{*/
+-void KMLFileTokenBuffer(char** pbuffer,int* pibuf,int* pbuflen,
+-						int c,
+-						int bufblk){
+-
+-/*  add the specified character to the token buffer  */
+-
+-	char*   buffer=NULL;
+-
+-/*  check buffer length and realloc if necessary  */
+-
+-	if (*pibuf+2 > *pbuflen) {
+-		*pbuflen+=bufblk;
+-		*pbuffer=(char *) xrealloc(*pbuffer,*pbuflen*sizeof(char));
+-	}
+-
+-/*  add character and terminator  */
+-
+-	(*pbuffer)[(*pibuf)++]=c;
+-	(*pbuffer)[ *pibuf   ]='\0';
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTagName {{{*/
+-char* KMLFileTagName(char* pname,
+-					 char* ktag){
+-
+-	return(KMLFileTagName(pname,NULL,0,
+-						  ktag));
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTagName {{{*/
+-char* KMLFileTagName(char* pname,int *m,int maxlen,
+-					 char* ktag){
+-
+-/*  for the given tag buffer, read and store the name  */
+-
+-	char*   ktagi;
+-	char*   ktokn;
+-
+-	if (strncmp(&ktag[0],"<"        ,1) || strncmp(&ktag[strlen(ktag)-1],">",1))
+-		_error2_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n");
+-
+-/*  strtok modifies ktag, so work on copy  */
+-
+-	ktagi=(char *) xmalloc((strlen(ktag)+1)*sizeof(char));
+-	memcpy(ktagi,ktag,(strlen(ktag)+1)*sizeof(char));
+-
+-/*  skip opening delimeter and find subsequent blank or closing delimiter  */
+-
+-	ktokn=strtok(ktagi,"< >");
+-//	_pprintLine_("KMLFileTagName -- initial token=\"" << ktokn << "\".");
+-
+-	if (!pname) {
+-		if (maxlen)
+-			pname=(char *) xmalloc((maxlen       +1)*sizeof(char));
+-		else
+-			pname=(char *) xmalloc((strlen(ktokn)+1)*sizeof(char));
+-	}
+-
+-	if (maxlen && (maxlen < strlen(ktokn))) {
+-		_pprintLine_("KMLFileTagName -- string field too short for " << ktag << ".");
+-		_pprintLine_("KMLFileTagName -- \"" << ktokn << "\" truncated to " << maxlen << " characters.");
+-		strncpy(pname,ktokn,maxlen);
+-	}
+-	else
+-		memcpy(pname,ktokn,(strlen(ktokn)+1)*sizeof(char));
+-
+-	xfree((void**)&ktagi);
+-
+-	if (m)
+-		*m=strlen(pname);
+-
+-	return(pname);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTagAttrib {{{*/
+-int KMLFileTagAttrib(KML_Object* kobj,
+-					 char* ktag){
+-
+-/*  for the given tag buffer, read and store the attributes  */
+-
+-	char*   ktagi;
+-	char*   ktokn;
+-	char*   ktokv;
+-	char    quote[]={'\"','\0'};
+-	int     isolo=0;
+-
+-/*  strtok modifies ktag, so work on copy  */
+-
+-	ktagi=(char *) xmalloc((strlen(ktag)+1)*sizeof(char));
+-	memcpy(ktagi,ktag,(strlen(ktag)+1)*sizeof(char));
+-
+-/*  loop through tag to find all attributes  */
+-
+-	/*  return first non blank and move past subsequent blank  */
+-	ktokn=strtok(ktagi," ");
+-//	_pprintLine_("KMLFileTagAttrib -- initial token=\"" << ktokn << "\".");
+-
+-	/*  return next non " =?/>" and move past subsequent " =?/>"  */
+-	while (ktokn=strtok(NULL," =?/>")) {
+-
+-		/*  return next non quote and move past subsequent quote  */
+-		ktokv=strtok(NULL,quote);
+-//		_pprintLine_("KMLFileTagAttrib -- attribute " << ktokn << "=\"" << ktokv << "\".");
+-
+-/*  add the attribute to the dataset  */
+-
+-		if (kobj)
+-			kobj->AddAttrib(ktokn,ktokv);
+-	}
+-
+-	xfree((void**)&ktagi);
+-
+-/*  check for xml declaration, dtd declaration, or solo tag  */
+-
+-	if ((!strncmp(&ktag[0],"<?"       ,2) && !strncmp(&ktag[strlen(ktag)-2],"?>",2)) ||
+-		(!strncmp(&ktag[0],"<!DOCTYPE",9) && !strncmp(&ktag[strlen(ktag)-1], ">",1)) ||
+-		(!strncmp(&ktag[0],"<"        ,1) && !strncmp(&ktag[strlen(ktag)-2],"/>",2)))
+-		isolo=1;
+-//	_pprintLine_("KMLFileTagAttrib -- isolo=" << isolo << ".");
+-
+-	return(isolo);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(int* pival,
+-					  char* ktag,
+-					  FILE* fid){
+-
+-	char*   kstr;
+-
+-/*  get next token and convert to appropriate format  */
+-
+-	if (!(kstr=KMLFileToken(fid,
+-							NULL,NULL)) ||
+-		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
+-
+-	sscanf(kstr,"%d",pival);
+-	xfree((void**)&kstr);
+-
+-/*  get additional token and compare to closing tag  */
+-
+-	if (ktag)
+-		if (!(kstr=KMLFileToken(fid,
+-								NULL,NULL)) ||
+-			(kstr[0] != '<') ||
+-			(kstr[1] != '/') ||
+-			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+-		else
+-			xfree((void**)&kstr);
+-
+-//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << *pival << ".");
+-
+-	return(0);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(bool* pbval, char* ktag, FILE* fid){
+-
+-	int     ival;
+-	char*   kstr;
+-
+-/*  get next token and convert to appropriate format  */
+-
+-	if (!(kstr=KMLFileToken(fid,
+-							NULL,NULL)) ||
+-		(kstr[0] == '<'))
+-	  {_error2_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");}
+-
+-	sscanf(kstr,"%d",&ival);
+-	*pbval=(bool)ival;
+-	xfree((void**)&kstr);
+-
+-/*  get additional token and compare to closing tag  */
+-
+-	if (ktag)
+-		if (!(kstr=KMLFileToken(fid,
+-								NULL,NULL)) ||
+-			(kstr[0] != '<') ||
+-			(kstr[1] != '/') ||
+-			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+-		else
+-			xfree((void**)&kstr);
+-
+-//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << (*pbval ? "true" : "false") << ".");
+-
+-	return(0);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-char* KMLFileTokenParse(char* pstr,
+-						char* ktag,
+-						FILE* fid){
+-
+-	return(KMLFileTokenParse(pstr,NULL,0,
+-							 ktag,
+-							 fid));
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-char* KMLFileTokenParse(char* pstr,int *m,int maxlen,
+-						char* ktag,
+-						FILE* fid){
+-
+-	char*   kstr;
+-
+-/*  get next token and allocate if necessary  */
+-
+-	if (!(kstr=KMLFileToken(fid,
+-							NULL,NULL)) ||
+-		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n");
+-
+-	if (!pstr) {
+-		if (maxlen)
+-			pstr=(char *) xmalloc((maxlen      +1)*sizeof(char));
+-		else
+-			pstr=(char *) xmalloc((strlen(kstr)+1)*sizeof(char));
+-	}
+-
+-	if (maxlen && (maxlen < strlen(kstr))) {
+-		_pprintLine_("KMLFileTokenParse -- string field too short for " << ktag << ".");
+-		_pprintLine_("KMLFileTokenParse -- \"" << kstr << "\" truncated to " << maxlen << " characters.");
+-		strncpy(pstr,kstr,maxlen);
+-	}
+-	else
+-		memcpy(pstr,kstr,(strlen(kstr)+1)*sizeof(char));
+-
+-	xfree((void**)&kstr);
+-
+-	if (m)
+-		*m=strlen(pstr);
+-
+-/*  get additional token and compare to closing tag  */
+-
+-	if (ktag)
+-		if (!(kstr=KMLFileToken(fid,
+-								NULL,NULL)) ||
+-			(kstr[0] != '<') ||
+-			(kstr[1] != '/') ||
+-			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+-		else
+-			xfree((void**)&kstr);
+-
+-//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=\"" << pstr << "\".");
+-
+-	return(pstr);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(float* pfval,
+-					  char* ktag,
+-					  FILE* fid){
+-
+-	char*   kstr;
+-
+-/*  get next token and convert to appropriate format  */
+-
+-	if (!(kstr=KMLFileToken(fid,
+-							NULL,NULL)) ||
+-		(kstr[0] == '<'))
+-	  {_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}
+-
+-	sscanf(kstr,"%g",pfval);
+-	xfree((void**)&kstr);
+-
+-/*  get additional token and compare to closing tag  */
+-
+-	if (ktag)
+-		if (!(kstr=KMLFileToken(fid,
+-								NULL,NULL)) ||
+-			(kstr[0] != '<') ||
+-			(kstr[1] != '/') ||
+-			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+-		else
+-			xfree((void**)&kstr);
+-
+-//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << *pfval << ".");
+-
+-	return(0);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(double* pdval,
+-					  char* ktag,
+-					  FILE* fid){
+-
+-	char*   kstr;
+-
+-/*  get next token and convert to appropriate format  */
+-
+-	if (!(kstr=KMLFileToken(fid,
+-							NULL,NULL)) ||
+-		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
+-
+-	sscanf(kstr,"%lg",pdval);
+-	xfree((void**)&kstr);
+-
+-/*  get additional token and compare to closing tag  */
+-
+-	if (ktag)
+-		if (!(kstr=KMLFileToken(fid,
+-								NULL,NULL)) ||
+-			(kstr[0] != '<') ||
+-			(kstr[1] != '/') ||
+-			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+-		else
+-			xfree((void**)&kstr);
+-
+-//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << *pdval << ".");
+-
+-	return(0);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(double **pdval,int* m,int maxlen,
+-					  char* ktag,
+-					  FILE* fid){
+-
+-	int     i=-1,j;
+-	char*   kstr;
+-	char*   ktok;
+-	char    delim[]={' ',',','\f','\n','\r','\t','\v','\0'};
+-
+-/*  get next token and allocate if necessary  */
+-
+-	if (!(kstr=KMLFileToken(fid,
+-							NULL,NULL)) ||
+-		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");
+-
+-	if (!*pdval)
+-		if (maxlen)
+-			*pdval=(double *) xmalloc(maxlen              *sizeof(double));
+-		else
+-			*pdval=(double *) xmalloc(((strlen(kstr)+1)/2)*sizeof(double));
+-
+-/*  loop through string to get all values  */
+-
+-	ktok=strtok(kstr,delim);
+-	while (ktok) {
+-		i++;
+-		if (maxlen && (maxlen < i+1))
+-			_error2_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n");
+-		sscanf(ktok,"%lg",&((*pdval)[i]));
+-		ktok=strtok(NULL,delim);
+-	}
+-	xfree((void**)&kstr);
+-
+-	if (!maxlen)
+-		*pdval=(double *) xrealloc(*pdval,(i+1)*sizeof(double));
+-
+-	if (m)
+-		*m=i+1;
+-
+-/*  get additional token and compare to closing tag  */
+-
+-	if (ktag)
+-		if (!(kstr=KMLFileToken(fid,
+-								NULL,NULL)) ||
+-			(kstr[0] != '<') ||
+-			(kstr[1] != '/') ||
+-			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+-		else
+-			xfree((void**)&kstr);
+-
+-//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=...");
+-//	for (j=0; j<=i; j++)
+-//		_pprintLine_("   [" << j << "]: " << (*pdval)[j] << "g");
+-
+-	return(0);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(double (**pdval3)[3],int* m,int maxlen,
+-					  char* ktag,
+-					  FILE* fid){
+-
+-	int     i=0,j=-1;
+-	char*   kstr;
+-	char*   ktok;
+-	char    delim[]={' ',',','\f','\n','\r','\t','\v','\0'};
+-
+-/*  get next token and allocate if necessary  */
+-
+-	if (!(kstr=KMLFileToken(fid,
+-							NULL,NULL)) ||
+-		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing double [m x 3] field for " << ktag << ".\n");
+-
+-	if (!*pdval3)
+-		if (maxlen)
+-			*pdval3=(double (*)[3]) xmalloc((maxlen*3)          *sizeof(double));
+-		else
+-			*pdval3=(double (*)[3]) xmalloc(((strlen(kstr)+1)/2)*sizeof(double));
+-
+-/*  loop through string to get all values  */
+-
+-	ktok=strtok(kstr,delim);
+-	while (ktok) {
+-		j++;
+-		if (j == 3) {
+-			i++;
+-			j=0;
+-			if (maxlen && (maxlen < i+1))
+-				_error2_("KMLFileTokenParse -- Double [m x 3] field too short for " << ktag << ".\n");
+-		}
+-		sscanf(ktok,"%lg",&((*pdval3)[i][j]));
+-		ktok=strtok(NULL,delim);
+-	}
+-	xfree((void**)&kstr);
+-
+-	if (!maxlen)
+-		*pdval3=(double (*)[3]) xrealloc(*pdval3,((i+1)*3)*sizeof(double));
+-
+-	if (m)
+-		*m=i+1;
+-
+-	if (j != 2)
+-		_pprintLine_("KMLFileTokenParse -- Double [m x 3] field for " << ktag << " does not have multiple of 3 values.");
+-
+-/*  get additional token and compare to closing tag  */
+-
+-	if (ktag)
+-		if (!(kstr=KMLFileToken(fid,
+-								NULL,NULL)) ||
+-			(kstr[0] != '<') ||
+-			(kstr[1] != '/') ||
+-			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+-		else
+-			xfree((void**)&kstr);
+-
+-//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=...");
+-//	for (j=0; j<=i; j++)
+-//		_pprintLine_("   [" << j << "][0-2]: " << (*pdval3)[j][0] << "g," << (*pdval3)[j][1] << "g," << (*pdval3)[j][2] << "g");
+-
+-	return(0);
+-}
+-/*}}}*/
+-/*FUNCTION  KMLFileTagSkip {{{*/
+-int KMLFileTagSkip(char* ktag,
+-				   FILE* fid){
+-
+-	char*   kstr;
+-
+-/*  note that tags of the same type can be nested inside each other, so for each
+-	opening tag, must find corresponding closing tag  */
+-
+-	_pprintLine_("KMLFileTagSkip -- input tag " << ktag << ".");
+-
+-/*  if next token is a closing tag, compare to input  */
+-
+-	while (kstr=KMLFileToken(fid,
+-							 NULL,NULL)) {
+-		if      ((kstr[0] == '<') &&
+-				 (kstr[1] == '/') &&
+-				 (!strncmp(&(kstr[2]),&(ktag[1]),(strcspn(ktag," >")-1)/sizeof(char)))) {
+-			_pprintLine_("KMLFileTagSkip -- closing tag " << kstr << ".");
+-			xfree((void**)&kstr);
+-			return(0);
+-		}
+-
+-/*  if next token is an opening tag, call recursively  */
+-
+-		else if ((kstr[0] == '<') &&
+-				 (kstr[1] != '/')) {
+-			_pprintLine_("KMLFileTagSkip -- opening tag " << kstr << ".");
+-			KMLFileTagSkip(kstr,
+-						   fid);
+-		}
+-
+-/*  if next token is a closing tag, error out  */
+-
+-		else if ((kstr[0] == '<') &&
+-				 (kstr[1] == '/')) {
+-			_error2_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");
+-		}
+-
+-		xfree((void**)&kstr);
+-	}
+-
+-	_error2_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");
+-
+-	return(0);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Geometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Geometry.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Geometry.h	(revision 12822)
+@@ -1,42 +0,0 @@
+-/*! \file KML_Geometry.h 
+- *  \brief: header file for kml_geometry abstract object
+- */
+-
+-#ifndef _KML_GEOMETRY_H_
+-#define _KML_GEOMETRY_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Object.h"
+-/*}}}*/
+-
+-class KML_Geometry: public KML_Object {
+-
+-	public:
+-
+-		/*KML_Geometry constructors, destructors {{{*/
+-		KML_Geometry();
+-		~KML_Geometry();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_GEOMETRY_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_StyleSelector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_StyleSelector.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_StyleSelector.cpp	(revision 12822)
+@@ -1,94 +0,0 @@
+-/*!\file KML_StyleSelector.cpp
+- * \brief: implementation of the kml_styleselector abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_StyleSelector::KML_StyleSelector(){{{*/
+-KML_StyleSelector::KML_StyleSelector(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_StyleSelector::~KML_StyleSelector(){{{*/
+-KML_StyleSelector::~KML_StyleSelector(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_StyleSelector::Echo {{{*/
+-void  KML_StyleSelector::Echo(){
+-
+-	KML_Object::Echo();
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_StyleSelector::DeepEcho {{{*/
+-void  KML_StyleSelector::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_StyleSelector::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_StyleSelector::DeepEcho {{{*/
+-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){
+-
+-	KML_Object::Write(filout,indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_StyleSelector::Read {{{*/
+-void  KML_StyleSelector::Read(FILE* fid,char* kstr){
+-
+-/*  process field within opening and closing tags  */
+-
+-	if      (!strncmp(kstr,"</StyleSelector",15))
+-		return;
+-	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");}
+-	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");}
+-
+-	else if (!strncmp(kstr,"<",1))
+-		KML_Object::Read(fid,kstr);
+-
+-	return;
+-}
+-/*}}}*/
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp	(revision 12822)
+@@ -1,162 +0,0 @@
+-/*!\file KML_LatLonBox.cpp
+- * \brief: implementation of the kml_feature abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_LatLonBox::KML_LatLonBox(){{{*/
+-KML_LatLonBox::KML_LatLonBox(){
+-
+-	north     = 0.;
+-	south     = 0.;
+-	east      = 0.;
+-	west      = 0.;
+-	rotation  = 0.;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_LatLonBox::~KML_LatLonBox(){{{*/
+-KML_LatLonBox::~KML_LatLonBox(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_LatLonBox::Echo {{{*/
+-void  KML_LatLonBox::Echo(){
+-
+-
+-	_printLine_("KML_LatLonBox:");
+-	KML_Object::Echo();
+-
+-	_printLine_("         north: " << north);
+-	_printLine_("         south: " << south);
+-	_printLine_("          east: " << east);
+-	_printLine_("          west: " << west);
+-	_printLine_("      rotation: " << rotation);
+-}
+-/*}}}*/
+-/*FUNCTION KML_LatLonBox::DeepEcho {{{*/
+-void  KML_LatLonBox::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_LatLonBox::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LatLonBox::DeepEcho {{{*/
+-void  KML_LatLonBox::DeepEcho(const char* indent){
+-
+-	_printLine_(indent << "KML_LatLonBox:");
+-	KML_Object::DeepEcho(indent);
+-
+-	_printLine_("         north: " << north);
+-	_printLine_("         south: " << south);
+-	_printLine_("          east: " << east);
+-	_printLine_("          west: " << west);
+-	_printLine_("      rotation: " << rotation);
+-}
+-/*}}}*/
+-/*FUNCTION KML_LatLonBox::Write {{{*/
+-void  KML_LatLonBox::Write(FILE* filout,const char* indent){
+-
+-	fprintf(filout,"%s<LatLonBox",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Object::Write(filout,indent);
+-
+-	fprintf(filout,"%s  <north>%0.16g</north>\n",indent,north);
+-	fprintf(filout,"%s  <south>%0.16g</south>\n",indent,south);
+-	fprintf(filout,"%s  <east>%0.16g</east>\n",indent,east);
+-	fprintf(filout,"%s  <west>%0.16g</west>\n",indent,west);
+-	fprintf(filout,"%s  <rotation>%0.16g</rotation>\n",indent,rotation);
+-
+-	fprintf(filout,"%s</LatLonBox>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LatLonBox::Read {{{*/
+-void  KML_LatLonBox::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</LatLonBox",11)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strcmp(kstri,"<north>"))
+-			KMLFileTokenParse(&north     ,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<south>"))
+-			KMLFileTokenParse(&south     ,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<east>"))
+-			KMLFileTokenParse(&east      ,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<west>"))
+-			KMLFileTokenParse(&west      ,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<rotation>"))
+-			KMLFileTokenParse(&rotation  ,
+-							  kstri,
+-							  fid);
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Object::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Attribute.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Attribute.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Attribute.cpp	(revision 12822)
+@@ -1,133 +0,0 @@
+-/*!\file KML_Attribute.cpp
+- * \brief: implementation of the kml_attribute object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Attribute::KML_Attribute(){{{*/
+-KML_Attribute::KML_Attribute(){
+-
+-	name      =NULL;
+-	value     =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Attribute::~KML_Attribute(){{{*/
+-KML_Attribute::~KML_Attribute(){
+-
+-	if (name      ) xfree((void**)&name);
+-	if (value     ) xfree((void**)&value);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Attribute::Echo {{{*/
+-void  KML_Attribute::Echo(){
+-
+-	int   i;
+-	bool  flag=true;
+-
+-	if(flag) _pprintString_("    ");
+-	for (i=0;i<10-strlen(name);i++)
+-		if(flag) _pprintString_(" ");
+-	if(flag) _pprintLine_(name << ": \"" << value << "\"");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Attribute::DeepEcho {{{*/
+-void  KML_Attribute::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Attribute::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Attribute::DeepEcho {{{*/
+-void  KML_Attribute::DeepEcho(const char* indent){
+-
+-	int   i;
+-	bool  flag=true;
+-
+-	if(flag) _pprintString_(indent << "    ");
+-	for (i=0;i<10-strlen(name);i++)
+-		if(flag) _pprintString_(" ");
+-	if(flag) _pprintLine_(name << ": \"" << value << "\"");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Attribute::Write {{{*/
+-void  KML_Attribute::Write(FILE* filout,const char* indent){
+-
+-//  attributes always written in keyword line of kml_object
+-
+-	fprintf(filout,"%s%s=\"%s\"",indent,name,value);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Attribute::Read {{{*/
+-void  KML_Attribute::Read(FILE* fid,char* kstr){
+-
+-//  attributes always read in keyword line of kml_object
+-
+-	;
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Attribute::Alloc {{{*/
+-void  KML_Attribute::Alloc(const char* namei,const char* valuei){
+-
+-	name =(char *) xmalloc((strlen(namei )+1)*sizeof(char));
+-	memcpy(name,namei,(strlen(namei)+1)*sizeof(char));
+-
+-	value=(char *) xmalloc((strlen(valuei)+1)*sizeof(char));
+-	memcpy(value,valuei,(strlen(valuei)+1)*sizeof(char));
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Attribute::Add {{{*/
+-void  KML_Attribute::Add(DataSet* attrib){
+-
+-	attrib->AddObject((Object*)this);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Attribute::Get {{{*/
+-void  KML_Attribute::Get(char** pvalueo,char* deflt){
+-
+-	if (!value || !strlen(value)) {
+-		*pvalueo=(char *) xmalloc((strlen(deflt)+1)*sizeof(char));
+-		memcpy(*pvalueo,deflt,(strlen(deflt)+1)*sizeof(char));
+-	}
+-	else {
+-		*pvalueo=(char *) xmalloc((strlen(value)+1)*sizeof(char));
+-		memcpy(*pvalueo,value,(strlen(value)+1)*sizeof(char));
+-	}
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_ColorStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_ColorStyle.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_ColorStyle.h	(revision 12822)
+@@ -1,48 +0,0 @@
+-/*! \file KML_ColorStyle.h 
+- *  \brief: header file for kml_colorstyle abstract object
+- */
+-
+-#ifndef _KML_COLORSTYLE_H_
+-#define _KML_COLORSTYLE_H_
+-
+-#define KML_COLORSTYLE_COLOR_LENGTH      8
+-#define KML_COLORSTYLE_COLORMODE_LENGTH  6
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_SubStyle.h"
+-/*}}}*/
+-
+-class KML_ColorStyle: public KML_SubStyle {
+-
+-	public:
+-
+-		char  color[KML_COLORSTYLE_COLOR_LENGTH+1];
+-		char  colormode[KML_COLORSTYLE_COLORMODE_LENGTH+1];
+-
+-		/*KML_ColorStyle constructors, destructors {{{*/
+-		KML_ColorStyle();
+-		~KML_ColorStyle();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_COLORSTYLE_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Placemark.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Placemark.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Placemark.h	(revision 12822)
+@@ -1,47 +0,0 @@
+-/*! \file KML_Placemark.h 
+- *  \brief: header file for kml_placemark object
+- */
+-
+-#ifndef _KML_PLACEMARK_H_
+-#define _KML_PLACEMARK_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Feature.h"
+-class KML_Geometry;
+-class DataSet;
+-/*}}}*/
+-
+-class KML_Placemark: public KML_Feature {
+-
+-	public:
+-
+-		DataSet* geometry;
+-
+-		/*KML_Placemark constructors, destructors {{{*/
+-		KML_Placemark();
+-		~KML_Placemark();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_PLACEMARK_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_PolyStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_PolyStyle.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_PolyStyle.cpp	(revision 12822)
+@@ -1,146 +0,0 @@
+-/*!\file KML_PolyStyle.cpp
+- * \brief: implementation of the kml_polystyle object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_PolyStyle::KML_PolyStyle(){{{*/
+-KML_PolyStyle::KML_PolyStyle(){
+-
+-	fill      =true;
+-	outline   =true;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_PolyStyle::~KML_PolyStyle(){{{*/
+-KML_PolyStyle::~KML_PolyStyle(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_PolyStyle::Echo {{{*/
+-void  KML_PolyStyle::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_PolyStyle:");
+-	KML_ColorStyle::Echo();
+-
+-	if(flag) _pprintLine_("          fill: " << fill);
+-	if(flag) _pprintLine_("       outline: " << outline);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_PolyStyle::DeepEcho {{{*/
+-void  KML_PolyStyle::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_PolyStyle::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_PolyStyle::DeepEcho {{{*/
+-void  KML_PolyStyle::DeepEcho(const char* indent){
+-
+-	int   i;
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_PolyStyle:");
+-	KML_ColorStyle::DeepEcho(indent);
+-
+-	if(flag) _pprintLine_(indent << "          fill: " << fill);
+-	if(flag) _pprintLine_(indent << "       outline: " << outline);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_PolyStyle::Write {{{*/
+-void  KML_PolyStyle::Write(FILE* filout,const char* indent){
+-
+-	fprintf(filout,"%s<PolyStyle",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_ColorStyle::Write(filout,indent);
+-
+-	fprintf(filout,"%s  <fill>%d</fill>\n",indent,fill);
+-	fprintf(filout,"%s  <outline>%d</outline>\n",indent,outline);
+-
+-	fprintf(filout,"%s</PolyStyle>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_PolyStyle::Read {{{*/
+-void  KML_PolyStyle::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</PolyStyle",11)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strcmp(kstri,"<fill>"))
+-			KMLFileTokenParse(&fill      ,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<outline>"))
+-			KMLFileTokenParse(&outline   ,
+-							  kstri,
+-							  fid);
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_ColorStyle::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Unknown.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Unknown.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Unknown.h	(revision 12822)
+@@ -1,45 +0,0 @@
+-/*! \file KML_Unknown.h 
+- *  \brief: header file for kml_unknown object
+- */
+-
+-#ifndef _KML_UNKNOWN_H_
+-#define _KML_UNKNOWN_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Object.h"
+-/*}}}*/
+-
+-class KML_Unknown: public KML_Object {
+-
+-	public:
+-
+-		char* name;
+-		char* value;
+-
+-		/*KML_Unknown constructors, destructors {{{*/
+-		KML_Unknown();
+-		~KML_Unknown();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_UNKNOWN_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_GroundOverlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_GroundOverlay.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_GroundOverlay.h	(revision 12822)
+@@ -1,49 +0,0 @@
+-/*! \file KML_GroundOverlay.h 
+- *  \brief: header file for kml_groundoverlay object
+- */
+-
+-#ifndef _KML_GROUNDOVERLAY_H_
+-#define _KML_GROUNDOVERLAY_H_
+-
+-#define KML_GROUNDOVERLAY_ALTMODE_LENGTH    18
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Overlay.h"
+-class KML_LatLonBox;
+-/*}}}*/
+-
+-class KML_GroundOverlay: public KML_Overlay {
+-
+-	public:
+-
+-		double altitude;
+-		char  altmode[KML_GROUNDOVERLAY_ALTMODE_LENGTH+1];
+-		KML_LatLonBox* llbox;
+-
+-		/*KML_GroundOverlay constructors, destructors {{{*/
+-		KML_GroundOverlay();
+-		~KML_GroundOverlay();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_GROUNDOVERLAY_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Style.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Style.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Style.h	(revision 12822)
+@@ -1,51 +0,0 @@
+-/*! \file KML_Style.h 
+- *  \brief: header file for kml_style object
+- */
+-
+-#ifndef _KML_STYLE_H_
+-#define _KML_STYLE_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_StyleSelector.h"
+-class KML_LineStyle;
+-class KML_PolyStyle;
+-/*}}}*/
+-
+-class KML_Style: public KML_StyleSelector {
+-
+-	public:
+-
+-		void* icon;
+-		void* label;
+-		KML_LineStyle* line;
+-		KML_PolyStyle* poly;
+-		void* balloon;
+-		void* list;
+-
+-		/*KML_Style constructors, destructors {{{*/
+-		KML_Style();
+-		~KML_Style();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_STYLE_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Object.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Object.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Object.cpp	(revision 12822)
+@@ -1,387 +0,0 @@
+-/*!\file KML_Object.cpp
+- * \brief: implementation of the kml_object abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Object::KML_Object(){{{*/
+-KML_Object::KML_Object(){
+-
+-	attrib    =new DataSet;
+-	commnt    =new DataSet;
+-	kmlobj    =new DataSet;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::~KML_Object(){{{*/
+-KML_Object::~KML_Object(){
+-
+-	if (attrib) {
+-		delete attrib;
+-		attrib    =NULL;
+-	}
+-	if (commnt) {
+-		delete commnt;
+-		commnt    =NULL;
+-	}
+-	if (kmlobj) {
+-		delete kmlobj;
+-		kmlobj    =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Object::Echo {{{*/
+-void  KML_Object::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("        attrib: (size=" << attrib->Size() << ")");
+-	if(flag) _pprintLine_("        commnt: (size=" << commnt->Size() << ")");
+-	if(flag) _pprintLine_("        kmlobj: (size=" << kmlobj->Size() << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::DeepEcho {{{*/
+-void  KML_Object::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Object::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::DeepEcho {{{*/
+-void  KML_Object::DeepEcho(const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-	bool  flag=true;
+-
+-/*  loop over the attributes for the object  */
+-
+-	if (attrib->Size())
+-		for (i=0; i<attrib->Size(); i++) {
+-			((KML_Attribute *)attrib->GetObjectByOffset(i))->DeepEcho(indent);
+-		}
+-	else
+-		if(flag) _pprintLine_(indent << "        attrib: [empty]");
+-
+-/*  loop over the comments for the object  */
+-
+-	if (commnt->Size())
+-		for (i=0; i<commnt->Size(); i++) {
+-			((KML_Comment *)commnt->GetObjectByOffset(i))->DeepEcho(indent);
+-		}
+-	else
+-		if(flag) _pprintLine_(indent << "        commnt: [empty]");
+-
+-/*  loop over the unknown objects for the object  */
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent2,"  ");
+-
+-	if (kmlobj->Size())
+-		for (i=0; i<kmlobj->Size(); i++) {
+-            if(flag) _pprintLine_(indent << "        kmlobj: -------- begin [" << i << "] --------");
+-			((KML_Unknown *)kmlobj->GetObjectByOffset(i))->DeepEcho(indent2);
+-            if(flag) _pprintLine_(indent << "        kmlobj: --------  end  [" << i << "] --------");
+-		}
+-	else
+-		if(flag) _pprintLine_(indent << "        kmlobj: [empty]");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::Write {{{*/
+-void  KML_Object::Write(FILE* filout,const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-
+-//  attributes always written in keyword line of derived classes
+-//  comments always written after keyword line of derived classes
+-
+-/*  loop over the unknown objects for the object  */
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent2,"  ");
+-
+-	if (kmlobj->Size())
+-		for (i=0; i<kmlobj->Size(); i++) {
+-			((KML_Unknown *)kmlobj->GetObjectByOffset(i))->Write(filout,indent2);
+-		}
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::Read {{{*/
+-void  KML_Object::Read(FILE* fid,char* kstr){
+-
+-	KML_Object*  kobj;
+-
+-/*  process field within opening and closing tags  */
+-
+-	if      (!strncmp(kstr,"</Object", 8))
+-		return;
+-	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Object::Read -- Unexpected closing tag " << kstr << ".\n");}
+-	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Object::Read -- Unexpected field \"" << kstr << "\".\n");}
+-
+-	else if (!strncmp(kstr,"<Placemark",10)) {
+-		kobj=(KML_Object*)new KML_Placemark();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<Folder", 7)) {
+-		kobj=(KML_Object*)new KML_Folder();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<Document", 9)) {
+-		kobj=(KML_Object*)new KML_Document();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<GroundOverlay",14)) {
+-		kobj=(KML_Object*)new KML_GroundOverlay();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<LatLonBox",10)) {
+-		kobj=(KML_Object*)new KML_LatLonBox();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<Icon", 5)) {
+-		kobj=(KML_Object*)new KML_Icon();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<Point", 6)) {
+-		kobj=(KML_Object*)new KML_Point();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<LineString",11)) {
+-		kobj=(KML_Object*)new KML_LineString();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<LinearRing",11)) {
+-		kobj=(KML_Object*)new KML_LinearRing();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<Polygon", 8)) {
+-		kobj=(KML_Object*)new KML_Polygon();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<MultiGeometry",14)) {
+-		kobj=(KML_Object*)new KML_MultiGeometry();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-//	else if (!strncmp(kstr,"<IconStyle",10)) {
+-//		kobj=(KML_Object*)new KML_IconStyle();
+-//		kobj->Read(fid,kstr);
+-//		kmlobj    ->AddObject((Object*)kobj);
+-//	}
+-
+-//	else if (!strncmp(kstr,"<LabelStyle",11)) {
+-//		kobj=(KML_Object*)new KML_LabelStyle();
+-//		kobj->Read(fid,kstr);
+-//		kmlobj    ->AddObject((Object*)kobj);
+-//	}
+-
+-	else if (!strncmp(kstr,"<LineStyle",10)) {
+-		kobj=(KML_Object*)new KML_LineStyle();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<PolyStyle",10)) {
+-		kobj=(KML_Object*)new KML_PolyStyle();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-//	else if (!strncmp(kstr,"<BalloonStyle",13)) {
+-//		kobj=(KML_Object*)new KML_BalloonStyle();
+-//		kobj->Read(fid,kstr);
+-//		kmlobj    ->AddObject((Object*)kobj);
+-//	}
+-
+-//	else if (!strncmp(kstr,"<ListStyle",10)) {
+-//		kobj=(KML_Object*)new KML_ListStyle();
+-//		kobj->Read(fid,kstr);
+-//		kmlobj    ->AddObject((Object*)kobj);
+-//	}
+-
+-	else if (!strncmp(kstr,"<",1)) {
+-		_pprintLine_("KML_Object::Read -- Unrecognized opening tag " << kstr << ".");
+-//		KMLFileTagSkip(kstr,
+-//					   fid);
+-		kobj=(KML_Object*)new KML_Unknown();
+-		kobj->Read(fid,kstr);
+-		kmlobj    ->AddObject((Object*)kobj);
+-	}
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::WriteExp {{{*/
+-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){
+-
+-	KML_Attribute* katt=NULL;
+-
+-	katt=new KML_Attribute();
+-	katt->Alloc(name,value);
+-	katt->Add(attrib);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::FindAttrib {{{*/
+-void  KML_Object::FindAttrib(char** pvalue,char* name,char* deflt){
+-
+-	int   i;
+-	KML_Attribute* katt=NULL;
+-
+-/*  loop over any attributes for the object  */
+-
+-	if (attrib->Size())
+-		for (i=0; i<attrib->Size(); i++)
+-			if (!strcmp(((KML_Attribute *)attrib->GetObjectByOffset(i))->name,name)) {
+-				katt=(KML_Attribute *)attrib->GetObjectByOffset(i);
+-				break;
+-			}
+-
+-/*  if found, get the value; otherwise use the default  */
+-
+-	if (katt)
+-		katt->Get(pvalue,deflt);
+-	else {
+-		*pvalue=(char *) xmalloc((strlen(deflt)+1)*sizeof(char));
+-		memcpy(*pvalue,deflt,(strlen(deflt)+1)*sizeof(char));
+-	}
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::WriteAttrib {{{*/
+-void  KML_Object::WriteAttrib(FILE* filout,const char* indent){
+-
+-//  attributes always written in keyword line of kml_object
+-
+-/*  loop over any attributes for the object  */
+-
+-	if (attrib->Size())
+-		for (int i=0; i<attrib->Size(); i++)
+-			((KML_Attribute *)attrib->GetObjectByOffset(i))->Write(filout,indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::AddCommnt {{{*/
+-void  KML_Object::AddCommnt(int ncom,char** pcom){
+-
+-	int   i;
+-	KML_Comment* kcom=NULL;
+-
+-	for (i=0; i<ncom; i++) {
+-		kcom=new KML_Comment();
+-		kcom->Alloc(pcom[i]);
+-		kcom->Add(commnt);
+-	}
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::AddCommnt {{{*/
+-void  KML_Object::AddCommnt(char* value){
+-
+-	KML_Comment* kcom=NULL;
+-
+-	kcom=new KML_Comment();
+-	kcom->Alloc(value);
+-	kcom->Add(commnt);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::FindCommnt {{{*/
+-void  KML_Object::FindCommnt(char** pvalue,int inum){
+-
+-	KML_Comment* kcom=NULL;
+-
+-/*  loop over any comments for the object  */
+-
+-	if (inum <= commnt->Size())
+-		kcom=(KML_Comment *)commnt->GetObjectByOffset(inum-1);
+-
+-/*  if found, get the value; otherwise use the NULL  */
+-
+-	if (kcom)
+-		kcom->Get(pvalue);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Object::WriteCommnt {{{*/
+-void  KML_Object::WriteCommnt(FILE* filout,const char* indent){
+-
+-	int   i;
+-
+-//  comments always written after keyword line of kml_object
+-
+-/*  loop over any comments for the object  */
+-
+-	if (commnt->Size())
+-		for (i=0; i<commnt->Size(); i++)
+-			((KML_Comment *)commnt->GetObjectByOffset(i))->Write(filout,indent);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Comment.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Comment.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Comment.h	(revision 12822)
+@@ -1,50 +0,0 @@
+-/*! \file KML_Comment.h 
+- *  \brief: header file for kml_comment object
+- */
+-
+-#ifndef _KML_COMMENT_H_
+-#define _KML_COMMENT_H_
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "../Object.h"
+-class DataSet;
+-/*}}}*/
+-
+-class KML_Comment: public Object {
+-
+-	public:
+-
+-		char* name;
+-		char* value;
+-
+-		/*KML_Comment constructors, destructors {{{*/
+-		KML_Comment();
+-		~KML_Comment();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		virtual void  Echo();
+-		virtual void  DeepEcho();
+-		virtual void  DeepEcho(const char* indent);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		void  Alloc(const char* valuei);
+-		void  Add(DataSet* commnt);
+-		void  Get(char** pvalueo);
+-
+-};
+-#endif  /* _KML_COMMENT_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_SubStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_SubStyle.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_SubStyle.cpp	(revision 12822)
+@@ -1,94 +0,0 @@
+-/*!\file KML_SubStyle.cpp
+- * \brief: implementation of the kml_substyle abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_SubStyle::KML_SubStyle(){{{*/
+-KML_SubStyle::KML_SubStyle(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_SubStyle::~KML_SubStyle(){{{*/
+-KML_SubStyle::~KML_SubStyle(){
+-
+-	;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_SubStyle::Echo {{{*/
+-void  KML_SubStyle::Echo(){
+-
+-	KML_Object::Echo();
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_SubStyle::DeepEcho {{{*/
+-void  KML_SubStyle::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_SubStyle::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_SubStyle::DeepEcho {{{*/
+-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){
+-
+-	KML_Object::Write(filout,indent);
+-
+-	return;
+-}
+-/*}}}*/
+-
+-/*FUNCTION KML_SubStyle::Read {{{*/
+-void  KML_SubStyle::Read(FILE* fid,char* kstr){
+-
+-/*  process field within opening and closing tags  */
+-
+-	if      (!strncmp(kstr,"</SubStyle",10))
+-		return;
+-	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_SubStyle::Read -- Unexpected closing tag " << kstr << ".\n");}
+-	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_SubStyle::Read -- Unexpected field \"" << kstr << "\".\n");}
+-
+-	else if (!strncmp(kstr,"<",1))
+-		KML_Object::Read(fid,kstr);
+-
+-	return;
+-}
+-/*}}}*/
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_MultiGeometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_MultiGeometry.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_MultiGeometry.h	(revision 12822)
+@@ -1,47 +0,0 @@
+-/*! \file KML_MultiGeometry.h 
+- *  \brief: header file for kml_multigeometry object
+- */
+-
+-#ifndef _KML_MULTIGEOMETRY_H_
+-#define _KML_MULTIGEOMETRY_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Geometry.h"
+-class KML_Geometry;
+-class DataSet;
+-/*}}}*/
+-
+-class KML_MultiGeometry: public KML_Geometry {
+-
+-	public:
+-
+-		DataSet* geometry;
+-
+-		/*KML_MultiGeometry constructors, destructors {{{*/
+-		KML_MultiGeometry();
+-		~KML_MultiGeometry();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_MULTIGEOMETRY_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineStyle.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineStyle.h	(revision 12822)
+@@ -1,44 +0,0 @@
+-/*! \file KML_LineStyle.h 
+- *  \brief: header file for kml_linestyle object
+- */
+-
+-#ifndef _KML_LINESTYLE_H_
+-#define _KML_LINESTYLE_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_ColorStyle.h"
+-/*}}}*/
+-
+-class KML_LineStyle: public KML_ColorStyle {
+-
+-	public:
+-
+-		float width;
+-
+-		/*KML_LineStyle constructors, destructors {{{*/
+-		KML_LineStyle();
+-		~KML_LineStyle();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_LINESTYLE_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineString.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_LineString.cpp	(revision 12822)
+@@ -1,230 +0,0 @@
+-/*!\file KML_LineString.cpp
+- * \brief: implementation of the kml_linestring object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-#include "../../modules/Ll2xyx/Ll2xyx.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_LineString::KML_LineString(){{{*/
+-KML_LineString::KML_LineString(){
+-
+-	extrude   =false;
+-	tessellate=false;
+-	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
+-
+-	ncoord    =0;
+-	coords    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineString::~KML_LineString(){{{*/
+-KML_LineString::~KML_LineString(){
+-
+-	if (coords) xDelete<double>(coords);
+-
+-	coords    =NULL;
+-	ncoord    =0;
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_LineString::Echo {{{*/
+-void  KML_LineString::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_LineString:");
+-	KML_Geometry::Echo();
+-
+-	if(flag) _pprintLine_("       extrude: " << (extrude ? "true" : "false"));
+-	if(flag) _pprintLine_("    tessellate: " << (tessellate ? "true" : "false"));
+-	if(flag) _pprintLine_("       altmode: \"" << altmode << "\"");
+-	if(flag) _pprintLine_("        coords: (ncoord=" << ncoord << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineString::DeepEcho {{{*/
+-void  KML_LineString::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_LineString::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineString::DeepEcho {{{*/
+-void  KML_LineString::DeepEcho(const char* indent){
+-
+-	int   i;
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_LineString:");
+-	KML_Geometry::DeepEcho(indent);
+-
+-	if(flag) _pprintLine_(indent << "       extrude: " << (extrude ? "true" : "false"));
+-	if(flag) _pprintLine_(indent << "    tessellate: " << (tessellate ? "true" : "false"));
+-	if(flag) _pprintLine_(indent << "       altmode: \"" << altmode << "\"");
+-	if(flag) _pprintLine_(indent << "        coords: (ncoord=" << ncoord << ")");
+-	for (i=0; i<ncoord; i++)
+-		if(flag) _pprintLine_(indent << "                (" << coords[3*i+0] << "," << coords[3*i+1] << "," << coords[3*i+2] << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineString::Write {{{*/
+-void  KML_LineString::Write(FILE* filout,const char* indent){
+-
+-	int   i;
+-
+-	fprintf(filout,"%s<LineString",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Geometry::Write(filout,indent);
+-
+-	fprintf(filout,"%s  <extrude>%d</extrude>\n",indent,(extrude ? 1 : 0));
+-	fprintf(filout,"%s  <tessellate>%d</tessellate>\n",indent,(tessellate ? 1 : 0));
+-	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
+-	fprintf(filout,"%s  <coordinates>\n",indent);
+-
+-/*  loop over the coordinates for the linestring  */
+-
+-	for (i=0; i<ncoord; i++)
+-		fprintf(filout,"%s    %0.16g,%0.16g,%0.16g\n",indent, coords[3*i+0],coords[3*i+1],coords[3*i+2]);
+-
+-	fprintf(filout,"%s  </coordinates>\n",indent);
+-	fprintf(filout,"%s</LineString>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineString::Read {{{*/
+-void  KML_LineString::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</LineString",12)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LineString::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LineString::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strcmp(kstri,"<extrude>"))
+-			KMLFileTokenParse(&extrude   ,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<tessellate>"))
+-			KMLFileTokenParse(&tessellate,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<altitudeMode>"))
+-			KMLFileTokenParse( altmode   ,NULL,KML_LINESTRING_ALTMODE_LENGTH,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<coordinates>"))
+-			KMLFileTokenParse(&coords    ,&ncoord    ,0,
+-							  kstri,
+-							  fid);
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Geometry::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_LineString::WriteExp {{{*/
+-void  KML_LineString::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
+-
+-	int     i;
+-	double  *lat,*lon,*x,*y;
+-	char    nstr2[81];
+-
+-/*  extract latitude and longitude into vectors  */
+-
+-	lat=(double *) xmalloc(ncoord*sizeof(double));
+-	lon=(double *) xmalloc(ncoord*sizeof(double));
+-	for (i=0; i<ncoord; i++) {
+-		lon[i]=coords[3*i+0];
+-		lat[i]=coords[3*i+1];
+-	}
+-
+-/*  convert latitude and longitude to x and y  */
+-
+-	x  =(double *) xmalloc(ncoord*sizeof(double));
+-	y  =(double *) xmalloc(ncoord*sizeof(double));
+-	Ll2xyx(x,y,lat,lon,ncoord,sgn,cm,sp);
+-
+-/*  write header  */
+-
+-	memcpy(nstr2,nstr,(strlen(nstr)+1)*sizeof(char));
+-
+-	for (i=0; i<strlen(nstr2); i++)
+-		if ((nstr2[i] == ' ') || (nstr2[i] == '\t'))
+-			nstr2[i]='_';
+-	fprintf(fid,"## Name:%s\n",nstr2);
+-	fprintf(fid,"## Icon:0\n");
+-	fprintf(fid,"# Points Count	Value\n");
+-    fprintf(fid,"%u	%s\n",ncoord  ,"1.");
+-	fprintf(fid,"# X pos	Y pos\n");
+-
+-/*  write vertices  */
+-
+-	for (i=0; i<ncoord; i++)
+-	    fprintf(fid,"%lf\t%lf\n",x[i],y[i]);
+-
+-/*  write blank line  */
+-
+-	fprintf(fid,"\n");
+-
+-	xfree((void**)&y);
+-	xfree((void**)&x);
+-	xfree((void**)&lon);
+-	xfree((void**)&lat);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Folder.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Folder.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Folder.h	(revision 12822)
+@@ -1,43 +0,0 @@
+-/*! \file KML_Folder.h 
+- *  \brief: header file for kml_folder object
+- */
+-
+-#ifndef _KML_FOLDER_H_
+-#define _KML_FOLDER_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Container.h"
+-class KML_Feature;
+-/*}}}*/
+-
+-class KML_Folder: public KML_Container {
+-
+-	public:
+-
+-		/*KML_Folder constructors, destructors {{{*/
+-		KML_Folder();
+-		~KML_Folder();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_FOLDER_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Overlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Overlay.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Overlay.cpp	(revision 12822)
+@@ -1,135 +0,0 @@
+-/*!\file KML_Overlay.cpp
+- * \brief: implementation of the kml_overlay abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Overlay::KML_Overlay(){{{*/
+-KML_Overlay::KML_Overlay(){
+-
+-	strcpy(color     ,"ffffffff");
+-	memcpy(color,"ffffffff",(strlen("ffffffff")+1)*sizeof(char));
+-
+-	draword   = 0;
+-	icon      =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Overlay::~KML_Overlay(){{{*/
+-KML_Overlay::~KML_Overlay(){
+-
+-	if (icon) {
+-		delete icon;
+-		icon      =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Overlay::Echo {{{*/
+-void  KML_Overlay::Echo(){
+-
+-	KML_Feature::Echo();
+-	_pprintLine_("         color: \"" << color << "\"");
+-	_pprintLine_("       draword: " << draword);
+-	_pprintLine_("          icon: " << icon);
+-}
+-/*}}}*/
+-/*FUNCTION KML_Overlay::DeepEcho {{{*/
+-void  KML_Overlay::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Overlay::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Overlay::DeepEcho {{{*/
+-void  KML_Overlay::DeepEcho(const char* indent){
+-
+-	char  indent2[81];
+-	KML_Feature::DeepEcho(indent);
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent2,"  ");
+-
+-	_pprintLine_(indent << "         color: " << color);
+-	_pprintLine_(indent << "       draword: " << draword);
+-	if (icon)
+-		icon->DeepEcho(indent2);
+-	else
+-		_pprintLine_(indent << "          icon: " << icon);
+-}
+-/*}}}*/
+-/*FUNCTION KML_Overlay::Write {{{*/
+-void  KML_Overlay::Write(FILE* filout,const char* indent){
+-
+-	char  indent2[81];
+-
+-	KML_Feature::Write(filout,indent);
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-
+-	strcat(indent2,"  ");
+-
+-	if (color     && strlen(color))
+-		fprintf(filout,"%s  <color>%s</color>\n",indent,color);
+-	fprintf(filout,"%s  <drawOrder>%d</drawOrder>\n",indent,draword);
+-	if (icon)
+-		icon->Write(filout,indent2);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Overlay::Read {{{*/
+-void  KML_Overlay::Read(FILE* fid,char* kstr){
+-
+-/*  process field within opening and closing tags  */
+-
+-	if      (!strncmp(kstr,"</Overlay", 9)) {
+-		xfree((void**)&kstr);
+-		return;
+-	}
+-	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Overlay::Read -- Unexpected closing tag " << kstr << ".\n");}
+-	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Overlay::Read -- Unexpected field \"" << kstr << "\".\n");}
+-
+-	else if (!strcmp(kstr,"<color>"))
+-		KMLFileTokenParse( color     ,NULL,KML_OVERLAY_COLOR_LENGTH,
+-						  kstr,
+-						  fid);
+-	else if (!strcmp(kstr,"<drawOrder>"))
+-		KMLFileTokenParse(&draword   ,
+-						  kstr,
+-						  fid);
+-
+-	else if (!strncmp(kstr,"<Icon", 5)) {
+-		icon      =new KML_Icon();
+-		icon      ->Read(fid,kstr);
+-	}
+-
+-	else if (!strncmp(kstr,"<",1))
+-		KML_Feature::Read(fid,kstr);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Container.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Container.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Container.cpp	(revision 12822)
+@@ -1,168 +0,0 @@
+-/*!\file KML_Container.cpp
+- * \brief: implementation of the kml_container abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Container::KML_Container(){{{*/
+-KML_Container::KML_Container(){
+-
+-	feature   =new DataSet;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Container::~KML_Container(){{{*/
+-KML_Container::~KML_Container(){
+-
+-	if (feature) {
+-		delete feature;
+-		feature   =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Container::Echo {{{*/
+-void  KML_Container::Echo(){
+-
+-	bool  flag=true;
+-
+-	KML_Feature::Echo();
+-
+-	if(flag) _pprintLine_("       feature: (size=" << feature->Size() << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Container::DeepEcho {{{*/
+-void  KML_Container::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Container::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Container::DeepEcho {{{*/
+-void  KML_Container::DeepEcho(const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-	bool  flag=true;
+-
+-	KML_Feature::DeepEcho(indent);
+-
+-/*  loop over the features for the container  */
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent2,"  ");
+-
+-	if (feature->Size())
+-		for (i=0; i<feature->Size(); i++) {
+-			if(flag) _pprintLine_(indent << "       feature: -------- begin [" << i << "] --------");
+-			((KML_Feature *)feature->GetObjectByOffset(i))->DeepEcho(indent2);
+-			if(flag) _pprintLine_(indent << "       feature: --------  end  [" << i << "] --------");
+-		}
+-	else
+-		if(flag) _pprintLine_(indent << "       feature: [empty]");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Container::Write {{{*/
+-void  KML_Container::Write(FILE* filout,const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-
+-	KML_Feature::Write(filout,indent);
+-
+-/*  loop over the features for the container  */
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-
+-	strcat(indent2,"  ");
+-
+-	for (i=0; i<feature->Size(); i++)
+-		((KML_Feature *)feature->GetObjectByOffset(i))->Write(filout,indent2);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Container::Read {{{*/
+-void  KML_Container::Read(FILE* fid,char* kstr){
+-
+-	KML_Object*  kobj;
+-
+-/*  process field within opening and closing tags  */
+-
+-	if      (!strncmp(kstr,"</Container",11)) {
+-		xfree((void**)&kstr);
+-		return;
+-	}
+-	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Container::Read -- Unexpected closing tag " << kstr );}
+-	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Container::Read -- Unexpected field \"" << kstr << "\"");}
+-
+-	else if (!strncmp(kstr,"<Placemark",10)) {
+-		kobj=(KML_Object*)new KML_Placemark();
+-		kobj->Read(fid,kstr);
+-		feature   ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<Folder", 7)) {
+-		kobj=(KML_Object*)new KML_Folder();
+-		kobj->Read(fid,kstr);
+-		feature   ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<Document", 9)) {
+-		kobj=(KML_Object*)new KML_Document();
+-		kobj->Read(fid,kstr);
+-		feature   ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<GroundOverlay",14)) {
+-		kobj=(KML_Object*)new KML_GroundOverlay();
+-		kobj->Read(fid,kstr);
+-		feature   ->AddObject((Object*)kobj);
+-	}
+-
+-	else if (!strncmp(kstr,"<",1))
+-		KML_Feature::Read(fid,kstr);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Container::WriteExp {{{*/
+-void  KML_Container::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
+-
+-	int   i;
+-
+-/*  loop over the features for the container  */
+-
+-	for (i=0; i<feature->Size(); i++)
+-		((KML_Object *)feature->GetObjectByOffset(i))->WriteExp(fid,nstr,sgn,cm,sp);
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Document.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Document.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Document.h	(revision 12822)
+@@ -1,43 +0,0 @@
+-/*! \file KML_Document.h 
+- *  \brief: header file for kml_document object
+- */
+-
+-#ifndef _KML_DOCUMENT_H_
+-#define _KML_DOCUMENT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Container.h"
+-class KML_Feature;
+-/*}}}*/
+-
+-class KML_Document: public KML_Container {
+-
+-	public:
+-
+-		/*KML_Document constructors, destructors {{{*/
+-		KML_Document();
+-		~KML_Document();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_DOCUMENT_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_File.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_File.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_File.h	(revision 12822)
+@@ -1,44 +0,0 @@
+-/*! \file KML_File.h 
+- *  \brief: header file for kml_file object
+- */
+-
+-#ifndef _KML_FILE_H_
+-#define _KML_FILE_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./KML_Feature.h"
+-class DataSet;
+-/*}}}*/
+-
+-class KML_File: public KML_Object {
+-
+-	public:
+-
+-		/*KML_File constructors, destructors {{{*/
+-		KML_File();
+-		~KML_File();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(const char* indent);
+-		void  Write(FILE* fid,const char* indent);
+-		void  Read(FILE* fid,char* kstr);
+-		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
+-		/*}}}*/
+-
+-};
+-#endif  /* _KML_FILE_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Polygon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Polygon.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/KML/KML_Polygon.cpp	(revision 12822)
+@@ -1,298 +0,0 @@
+-/*!\file KML_Polygon.cpp
+- * \brief: implementation of the kml_polygon object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION KML_Polygon::KML_Polygon(){{{*/
+-KML_Polygon::KML_Polygon(){
+-
+-	extrude   =false;
+-	tessellate=false;
+-	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
+-
+-	outer     =new DataSet;
+-	inner     =new DataSet;
+-
+-}
+-/*}}}*/
+-/*FUNCTION KML_Polygon::~KML_Polygon(){{{*/
+-KML_Polygon::~KML_Polygon(){
+-
+-	if (inner) {
+-		delete inner;
+-		inner     =NULL;
+-	}
+-
+-	if (outer) {
+-		delete outer;
+-		outer     =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION KML_Polygon::Echo {{{*/
+-void  KML_Polygon::Echo(){
+-
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("KML_Polygon:");
+-	KML_Geometry::Echo();
+-
+-	if(flag) _pprintLine_("       extrude: " << (extrude ? "true" : "false"));
+-	if(flag) _pprintLine_("    tessellate: " << (tessellate ? "true" : "false"));
+-	if(flag) _pprintLine_("       altmode: \"" << altmode << "\"");
+-	if(flag) _pprintLine_("         outer: (size=" << outer->Size() << ")");
+-	if(flag) _pprintLine_("         inner: (size=" << inner->Size() << ")");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Polygon::DeepEcho {{{*/
+-void  KML_Polygon::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	KML_Polygon::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Polygon::DeepEcho {{{*/
+-void  KML_Polygon::DeepEcho(const char* indent){
+-
+-	int   i;
+-	char  indent2[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "KML_Polygon:");
+-	KML_Geometry::DeepEcho(indent);
+-
+-	if(flag) _pprintLine_(indent << "       extrude: " << (extrude ? "true" : "false"));
+-	if(flag) _pprintLine_(indent << "    tessellate: " << (tessellate ? "true" : "false"));
+-	if(flag) _pprintLine_(indent << "       altmode: \"" << altmode << "\"");
+-
+-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent2,"  ");
+-
+-	if (outer->Size())
+-		for (i=0; i<outer->Size(); i++) {
+-			if(flag) _pprintLine_(indent << "         outer: -------- begin [" << i << "] --------");
+-			((KML_LinearRing *)outer->GetObjectByOffset(i))->DeepEcho(indent2);
+-			if(flag) _pprintLine_(indent << "         outer: --------  end  [" << i << "] --------");
+-		}
+-	else
+-		if(flag) _pprintLine_(indent << "         outer: [empty]");
+-
+-	if (inner->Size())
+-		for (i=0; i<inner->Size(); i++) {
+-			if(flag) _pprintLine_(indent << "         inner: -------- begin [" << i << "] --------");
+-			((KML_LinearRing *)inner->GetObjectByOffset(i))->DeepEcho(indent2);
+-			if(flag) _pprintLine_(indent << "         inner: --------  end  [" << i << "] --------");
+-		}
+-	else
+-		if(flag) _pprintLine_(indent << "         inner: [empty]");
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Polygon::Write {{{*/
+-void  KML_Polygon::Write(FILE* filout,const char* indent){
+-
+-	int   i;
+-	char  indent4[81];
+-
+-	fprintf(filout,"%s<Polygon",indent);
+-	WriteAttrib(filout," ");
+-	fprintf(filout,">\n");
+-	WriteCommnt(filout,indent);
+-
+-	KML_Geometry::Write(filout,indent);
+-
+-	fprintf(filout,"%s  <extrude>%d</extrude>\n",indent,(extrude ? 1 : 0));
+-	fprintf(filout,"%s  <tessellate>%d</tessellate>\n",indent,(tessellate ? 1 : 0));
+-	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
+-
+-	memcpy(indent4,indent,(strlen(indent)+1)*sizeof(char));
+-	strcat(indent4,"    ");
+-
+-/*  check outer boundary for the polygon  */
+-
+-	fprintf(filout,"%s  <outerBoundaryIs>\n",indent);
+-	if (outer->Size())
+-		((KML_LinearRing *)outer->GetObjectByOffset(0))->Write(filout,indent4);
+-	fprintf(filout,"%s  </outerBoundaryIs>\n",indent);
+-
+-/*  loop over any inner boundaries for the polygon  */
+-
+-	for (i=0; i<inner->Size(); i++) {
+-		fprintf(filout,"%s  <innerBoundaryIs>\n",indent);
+-		((KML_LinearRing *)inner->GetObjectByOffset(i))->Write(filout,indent4);
+-		fprintf(filout,"%s  </innerBoundaryIs>\n",indent);
+-	}
+-
+-	fprintf(filout,"%s</Polygon>\n",indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Polygon::Read {{{*/
+-void  KML_Polygon::Read(FILE* fid,char* kstr){
+-
+-	char*        kstri;
+-	char*        kstrj;
+-	int          ncom=0;
+-	char**       pcom=NULL;
+-	KML_Object*  kobj;
+-
+-/*  get object attributes and check for solo tag  */
+-
+-	if (KMLFileTagAttrib(this,
+-						 kstr))
+-		return;
+-
+-/*  loop over and process fields within opening and closing tags  */
+-
+-	while (kstri=KMLFileToken(fid,
+-							  &ncom,&pcom)) {
+-		if      (!strncmp(kstri,"</Polygon", 9)) {
+-			xfree((void**)&kstri);
+-			break;
+-		}
+-		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstri << ".\n");}
+-		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstri << "\".\n");}
+-
+-		else if (!strcmp(kstri,"<extrude>"))
+-			KMLFileTokenParse(&extrude   ,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<tessellate>"))
+-			KMLFileTokenParse(&tessellate,
+-							  kstri,
+-							  fid);
+-		else if (!strcmp(kstri,"<altitudeMode>"))
+-			KMLFileTokenParse( altmode   ,NULL,KML_POLYGON_ALTMODE_LENGTH,
+-							  kstri,
+-							  fid);
+-
+-		else if (!strcmp(kstri,"<outerBoundaryIs>"))
+-
+-/*  loop over and process fields within outer boundary  */
+-
+-			while (kstrj=KMLFileToken(fid,
+-									  &ncom,&pcom)) {
+-				if      (!strncmp(kstrj,"</outerBoundaryIs",17)) {
+-					xfree((void**)&kstrj);
+-					break;
+-				}
+-				else if (!strncmp(kstrj,"</",2))
+-				  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}
+-				else if (strncmp(kstrj,"<",1))
+-				  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}
+-
+-				else if (!strncmp(kstrj,"<LinearRing",11)) {
+-					kobj=(KML_Object*)new KML_LinearRing();
+-					kobj->Read(fid,kstrj);
+-					outer     ->AddObject((Object*)kobj);
+-				}
+-
+-				else if (!strncmp(kstrj,"<",1))
+-					KML_Geometry::Read(fid,kstrj);
+-
+-				xfree((void**)&kstrj);
+-			}
+-
+-		else if (!strcmp(kstri,"<innerBoundaryIs>"))
+-
+-/*  loop over and process fields within inner boundaries  */
+-
+-			while (kstrj=KMLFileToken(fid,
+-									  &ncom,&pcom)) {
+-				if      (!strncmp(kstrj,"</innerBoundaryIs",17)) {
+-					xfree((void**)&kstrj);
+-					break;
+-				}
+-				else if (!strncmp(kstrj,"</",2))
+-				  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}
+-				else if (strncmp(kstrj,"<",1))
+-				  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}
+-
+-				else if (!strncmp(kstrj,"<LinearRing",11)) {
+-					kobj=(KML_Object*)new KML_LinearRing();
+-					kobj->Read(fid,kstrj);
+-					inner     ->AddObject((Object*)kobj);
+-				}
+-
+-				else if (!strncmp(kstrj,"<",1))
+-					KML_Geometry::Read(fid,kstrj);
+-
+-				xfree((void**)&kstrj);
+-			}
+-
+-
+-		else if (!strncmp(kstri,"<",1))
+-			KML_Geometry::Read(fid,kstri);
+-
+-		xfree((void**)&kstri);
+-	}
+-
+-	this->AddCommnt(ncom,pcom);
+-
+-	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION KML_Polygon::WriteExp {{{*/
+-void  KML_Polygon::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
+-
+-	int   i;
+-	char  nstr2[81];
+-
+-/*  check outer boundary for the polygon  */
+-
+-	if (outer->Size()) {
+-		if (strlen(nstr))
+-			sprintf(nstr2,"%s (outer)",nstr);
+-		else
+-			sprintf(nstr2,"(outer)");
+-
+-		((KML_LinearRing *)outer->GetObjectByOffset(0))->WriteExp(fid,nstr2,sgn,cm,sp);
+-	}
+-
+-/*  loop over any inner boundaries for the polygon  */
+-
+-	for (i=0; i<inner->Size(); i++) {
+-		if (strlen(nstr))
+-			sprintf(nstr2,"%s (inner %d of %d)",nstr,i+1,inner->Size());
+-		else
+-			sprintf(nstr2,"(inner %d of %d)",i+1,inner->Size());
+-
+-		((KML_LinearRing *)inner->GetObjectByOffset(i))->WriteExp(fid,nstr2,sgn,cm,sp);
+-	}
+-
+-	return;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleVecParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleVecParam.h	(revision 12822)
+@@ -1,78 +0,0 @@
+-/*! \file DoubleVecParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _DOUBLEVECPARAM_H_
+-#define _DOUBLEVECPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class DoubleVecParam: public Param{
+-
+-	private: 
+-		int enum_type;
+-		IssmDouble* values;
+-		int M;
+-
+-	public:
+-		/*DoubleVecParam constructors, destructors: {{{*/
+-		DoubleVecParam();
+-		DoubleVecParam(int enum_type,IssmDouble* values,int M);
+-		~DoubleVecParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param virtual functions definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM);
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");};
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M);
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-		
+-		void GetParameterName(char**pname);
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEVECPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleParam.h	(revision 12822)
+@@ -1,79 +0,0 @@
+-/*! \file DoubleParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _DOUBLEPARAM_H_
+-#define _DOUBLEPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class DoubleParam: public Param{
+-
+-	private: 
+-		/*just hold 3 values for 3 vertices: */
+-		int enum_type;
+-		IssmDouble value;
+-
+-	public:
+-		/*DoubleParam constructors, destructors: {{{*/
+-		DoubleParam();
+-		DoubleParam(int enum_type,IssmDouble value);
+-		~DoubleParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool);
+-		void  GetParameterValue(int* pinteger);
+-		void  GetParameterValue(int** pintarray,int* pM);
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN);
+-		void  GetParameterValue(IssmDouble* pIssmDouble){*pIssmDouble=value;}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){this->value=(IssmDouble)boolean;}
+-		void  SetValue(int integer){this->value=(IssmDouble)integer;}
+-		void  SetValue(IssmDouble scalar){this->value=(IssmDouble)scalar;}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/FileParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/FileParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/FileParam.cpp	(revision 12822)
+@@ -1,89 +0,0 @@
+-/*!\file FileParam.c
+- * \brief: implementation of the FileParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*FileParam constructors and destructor*/
+-/*FUNCTION FileParam::FileParam(){{{*/
+-FileParam::FileParam(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION FileParam::FileParam(int enum_type,FILE *value){{{*/
+-FileParam::FileParam(int in_enum_type,FILE* in_value){
+-
+-	enum_type=in_enum_type;
+-	value=in_value;
+-}
+-/*}}}*/
+-/*FUNCTION FileParam::~FileParam(){{{*/
+-FileParam::~FileParam(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION FileParam::Echo {{{*/
+-void FileParam::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION FileParam::DeepEcho{{{*/
+-void FileParam::DeepEcho(void){
+-
+-	_printLine_("FileParam:");
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-}
+-/*}}}*/
+-/*FUNCTION FileParam::Id{{{*/
+-int    FileParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION FileParam::MyRank{{{*/
+-int    FileParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION FileParam::ObjectEnum{{{*/
+-int FileParam::ObjectEnum(void){
+-
+-	return FileParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION FileParam::copy{{{*/
+-Object* FileParam::copy() {
+-	
+-	return new FileParam(this->enum_type,this->value);
+-
+-}
+-/*}}}*/
+-
+-/*FileParam virtual functions definitions: */
+-/*FUNCTION FileParam::GetParameterName{{{*/
+-void FileParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION FileParam::UnitConversion{{{*/
+-void  FileParam::UnitConversion(int direction_enum){
+-	/*do nothing, no unit conversion*/
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h	(revision 12822)
+@@ -1,81 +0,0 @@
+-/*! \file DoubleMatArrayParam.h 
+- *  \brief: header file for object holding an array of serial matrices
+- */
+-
+-
+-#ifndef _DOUBLEMATARRAYPARAM_H_
+-#define _DOUBLEMATARRAYPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class DoubleMatArrayParam: public Param{
+-
+-	private: 
+-		int      enum_type;
+-		IssmDouble** array; //array of matrices
+-		int      M; //size of array
+-		int*     mdim_array; //m-dimensions of matrices in the array
+-		int*     ndim_array; //n-dimensions -f matrices in the array
+-
+-	public:
+-		/*DoubleMatArrayParam constructors, destructors: {{{*/
+-		DoubleMatArrayParam();
+-		DoubleMatArrayParam(int enum_type,IssmDouble** array, int M, int* mdim_array, int* ndim_array);
+-		~DoubleMatArrayParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims);
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble vec array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble mat array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array);
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEMATARRAYPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.h	(revision 12822)
+@@ -1,80 +0,0 @@
+-/*! \file DoubleMatParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _DOUBLEMATPARAM_H_
+-#define _DOUBLEMATPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class DoubleMatParam: public Param{
+-
+-	protected: 
+-		int enum_type;
+-		IssmDouble* value;
+-		int M;
+-		int N;
+-
+-	public:
+-		/*DoubleMatParam constructors, destructors: {{{*/
+-		DoubleMatParam();
+-		DoubleMatParam(int enum_type,IssmDouble* value,int M,int N);
+-		~DoubleMatParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN);
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN);
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M,int N);
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEMATPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/FileParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/FileParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/FileParam.h	(revision 12822)
+@@ -1,78 +0,0 @@
+-/*! \file FileParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _FILEPARAM_H_
+-#define _FILEPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class FileParam: public Param{
+-
+-	private: 
+-		int   enum_type;
+-		FILE* value;
+-
+-	public:
+-		/*FileParam constructors, destructors: {{{*/
+-		FileParam();
+-		FileParam(int enum_type,FILE* fid);
+-		~FileParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){  _error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){*pfid=value;};
+-
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-
+-		/*}}}*/
+-};
+-#endif  /* _INTPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/Param.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/Param.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/Param.h	(revision 12822)
+@@ -1,60 +0,0 @@
+-/*!\file:  Param.h
+- * \brief abstract class for Param object
+- */ 
+-
+-
+-#ifndef _PARAM_H_
+-#define _PARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "../Object.h"
+-#include "../Node.h"
+-/*}}}*/
+-
+-class Param: public Object{
+-
+-	public: 
+-		virtual        ~Param(){};
+-
+-		/*Virtual functions:*/
+-		virtual int   InstanceEnum()=0;
+-		virtual void  GetParameterValue(bool* pbool)=0;
+-		virtual void  GetParameterValue(int* pinteger)=0;
+-		virtual void  GetParameterValue(int** pintarray,int* pM)=0;
+-		virtual void  GetParameterValue(int** pintarray,int* pM,int* pN)=0;
+-		virtual void  GetParameterValue(IssmDouble* pIssmDouble)=0;
+-		virtual void  GetParameterValue(IssmDouble* pdouble,IssmDouble time)=0;
+-		virtual void  GetParameterValue(char** pstring)=0;
+-		virtual void  GetParameterValue(char*** pstringarray,int* pM)=0;
+-		virtual void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM)=0;
+-		virtual void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN)=0;
+-		virtual void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims)=0;
+-		virtual void  GetParameterValue(Vector** pvec)=0;
+-		virtual void  GetParameterValue(Matrix** pmat)=0;
+-		virtual void  GetParameterValue(FILE** pfid)=0;
+-		
+-		virtual void  SetValue(bool boolean)=0;
+-		virtual void  SetValue(int integer)=0;
+-		virtual void  SetValue(IssmDouble scalar)=0;
+-		virtual void  SetValue(char* string)=0;
+-		virtual void  SetValue(char** stringarray,int M)=0;
+-		virtual void  SetValue(IssmDouble* IssmDoublearray,int M)=0;
+-		virtual void  SetValue(IssmDouble* pIssmDoublearray,int M,int N)=0;
+-		virtual void  SetValue(int* intarray,int M)=0;
+-		virtual void  SetValue(int* pintarray,int M,int N)=0;
+-		virtual void  SetValue(Vector* vec)=0;
+-		virtual void  SetValue(Matrix* mat)=0;
+-		virtual void  SetValue(FILE* fid)=0;
+-		virtual void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array)=0;
+-		virtual void  UnitConversion(int direction_enum)=0;
+-		virtual void  GetParameterName(char**pname)=0;
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntVecParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntVecParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntVecParam.cpp	(revision 12822)
+@@ -1,147 +0,0 @@
+-/*!\file IntVecParam.c
+- * \brief: implementation of the IntVecParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*IntVecParam constructors and destructor*/
+-/*FUNCTION 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){
+-
+-	enum_type=in_enum_type;
+-	M=in_M;
+-
+-	if(M){
+-		values=xNew<int>(M);
+-		xMemCpy<int>(values,in_values,M);
+-	}
+-	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){
+-
+-	enum_type=in_enum_type;
+-	M=in_M;
+-
+-	if(M){
+-		values=xNew<int>(M);
+-		for(int i=0;i<in_M;i++) values[i]=reCast<int>(in_values[i]);
+-	}
+-	else values=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION IntVecParam::~IntVecParam(){{{*/
+-IntVecParam::~IntVecParam(){
+-	xDelete<int>(values);
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION IntVecParam::Echo {{{*/
+-void IntVecParam::Echo(void){
+-
+-	_printLine_("IntVecParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   vector size: " << this->M);
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntVecParam::DeepEcho{{{*/
+-void IntVecParam::DeepEcho(void){
+-
+-	int i;
+-	
+-	_printLine_("IntVecParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   vector size: " << this->M);
+-	for(i=0;i<this->M;i++){
+-		_printLine_(i << " " << this->values[i]);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION IntVecParam::Id{{{*/
+-int    IntVecParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION IntVecParam::MyRank{{{*/
+-int    IntVecParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION IntVecParam::ObjectEnum{{{*/
+-int IntVecParam::ObjectEnum(void){
+-
+-	return IntVecParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntVecParam::copy{{{*/
+-Object* IntVecParam::copy() {
+-	
+-	return new IntVecParam(this->enum_type,this->values,this->M);
+-
+-}
+-/*}}}*/
+-
+-/*IntVecParam virtual functions definitions: */
+-/*FUNCTION IntVecParam::GetParameterValue{{{*/
+-void  IntVecParam::GetParameterValue(int** pintarray,int* pM){
+-	int* output=NULL;
+-
+-	if(M){
+-		output=xNew<int>(M);
+-		xMemCpy<int>(output,values,M);
+-	}
+-
+-	/*Assign output pointers:*/
+-	if(pM) *pM=M;
+-	*pintarray=output;
+-}
+-/*}}}*/
+-/*FUNCTION IntVecParam::GetParameterName{{{*/
+-void IntVecParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION IntVecParam::SetValue{{{*/
+-void  IntVecParam::SetValue(int* intarray,int in_M){
+-
+-	/*avoid leak: */
+-	xDelete<int>(this->values);
+-
+-	if(in_M){
+-		this->values=xNew<int>(in_M);
+-		xMemCpy<int>(this->values,intarray,in_M);
+-	}
+-	else this->values=NULL;
+-
+-	this->M=in_M;
+-}
+-/*}}}*/
+-/*FUNCTION IntVecParam::UnitConversion{{{*/
+-void  IntVecParam::UnitConversion(int direction_enum){
+-	/*do nothing, no unit conversion*/
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntParam.cpp	(revision 12822)
+@@ -1,89 +0,0 @@
+-/*!\file IntParam.c
+- * \brief: implementation of the IntParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*IntParam constructors and destructor*/
+-/*FUNCTION IntParam::IntParam(){{{*/
+-IntParam::IntParam(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION IntParam::IntParam(int enum_type,IssmInt value){{{*/
+-IntParam::IntParam(int in_enum_type,IssmInt in_value){
+-
+-	enum_type=in_enum_type;
+-	value=in_value;
+-}
+-/*}}}*/
+-/*FUNCTION IntParam::~IntParam(){{{*/
+-IntParam::~IntParam(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION IntParam::Echo {{{*/
+-void IntParam::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION IntParam::DeepEcho{{{*/
+-void IntParam::DeepEcho(void){
+-
+-	_printLine_("IntParam:");
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-}
+-/*}}}*/
+-/*FUNCTION IntParam::Id{{{*/
+-int    IntParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION IntParam::MyRank{{{*/
+-int    IntParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION IntParam::ObjectEnum{{{*/
+-int IntParam::ObjectEnum(void){
+-
+-	return IntParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntParam::copy{{{*/
+-Object* IntParam::copy() {
+-	
+-	return new IntParam(this->enum_type,this->value);
+-
+-}
+-/*}}}*/
+-
+-/*IntParam virtual functions definitions: */
+-/*FUNCTION IntParam::GetParameterName{{{*/
+-void IntParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION IntParam::UnitConversion{{{*/
+-void  IntParam::UnitConversion(int direction_enum){
+-	/*do nothing, no unit conversion*/
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/BoolParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/BoolParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/BoolParam.cpp	(revision 12822)
+@@ -1,89 +0,0 @@
+-/*!\file BoolParam.c
+- * \brief: implementation of the BoolParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*BoolParam constructors and destructor*/
+-/*FUNCTION BoolParam::BoolParam(){{{*/
+-BoolParam::BoolParam(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION BoolParam::BoolParam(int enum_type,IssmBool value){{{*/
+-BoolParam::BoolParam(int in_enum_type,IssmBool in_value){
+-
+-	enum_type=in_enum_type;
+-	value=in_value;
+-}
+-/*}}}*/
+-/*FUNCTION BoolParam::~BoolParam(){{{*/
+-BoolParam::~BoolParam(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION BoolParam::Echo {{{*/
+-void BoolParam::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION BoolParam::DeepEcho{{{*/
+-void BoolParam::DeepEcho(void){
+-
+-	_printLine_("BoolParam:");
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " <<(this->value?"true":"false"));
+-}
+-/*}}}*/
+-/*FUNCTION BoolParam::Id{{{*/
+-int    BoolParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION BoolParam::MyRank{{{*/
+-int    BoolParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION BoolParam::ObjectEnum{{{*/
+-int BoolParam::ObjectEnum(void){
+-
+-	return BoolParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolParam::copy{{{*/
+-Object* BoolParam::copy() {
+-	
+-	return new BoolParam(this->enum_type,this->value);
+-
+-}
+-/*}}}*/
+-
+-/*BoolParam virtual functions definitions: */
+-/*FUNCTION BoolParam::GetParameterName{{{*/
+-void BoolParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION BoolParam::UnitConversion{{{*/
+-void  BoolParam::UnitConversion(int direction_enum){
+-	/*do nothing, no unit conversion*/
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntMatParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntMatParam.cpp	(revision 12822)
+@@ -1,131 +0,0 @@
+-/*!\file IntMatParam.c
+- * \brief: implementation of the IntMatParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*IntMatParam constructors and destructor*/
+-/*FUNCTION 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){
+-
+-	enum_type=in_enum_type;
+-	M=in_M;
+-	N=in_N;
+-
+-	value=xNew<int>(M*N);
+-	xMemCpy<int>(value,in_value,M*N);
+-}
+-/*}}}*/
+-/*FUNCTION IntMatParam::~IntMatParam(){{{*/
+-IntMatParam::~IntMatParam(){
+-	xDelete<int>(value);
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION IntMatParam::Echo {{{*/
+-void IntMatParam::Echo(void){
+-
+-	_printLine_("IntMatParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   matrix size: " << this->M << "x" << this->N);
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntMatParam::DeepEcho{{{*/
+-void IntMatParam::DeepEcho(void){
+-
+-	int i,j;
+-	
+-	_printLine_("IntMatParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   matrix size: " << this->M << "x" << this->N);
+-	for(i=0;i<this->M;i++){
+-		for(i=0;i<this->N;i++){
+-			_printLine_("(" << i << "," << j << ") " << *(this->value+N*i+j));
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION IntMatParam::Id{{{*/
+-int    IntMatParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION IntMatParam::MyRank{{{*/
+-int    IntMatParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION IntMatParam::ObjectEnum{{{*/
+-int IntMatParam::ObjectEnum(void){
+-
+-	return IntMatParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntMatParam::copy{{{*/
+-Object* IntMatParam::copy() {
+-	
+-	return new IntMatParam(this->enum_type,this->value,this->M,this->N);
+-
+-}
+-/*}}}*/
+-
+-/*IntMatParam virtual functions definitions: */
+-/*FUNCTION IntMatParam::GetParameterValue{{{*/
+-void  IntMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){
+-	int* output=NULL;
+-
+-	output=xNew<int>(M*N);
+-	xMemCpy<int>(output,value,M*N);
+-
+-	/*Assign output pointers:*/
+-	if(pM) *pM=M;
+-	if(pN) *pN=N;
+-	*pintarray=output;
+-}
+-/*}}}*/
+-/*FUNCTION IntMatParam::GetParameterName{{{*/
+-void IntMatParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION IntMatParam::SetValue{{{*/
+-void  IntMatParam::SetValue(int* intarray,int in_M,int in_N){
+-
+-	/*avoid leak: */
+-	xDelete<int>(this->value);
+-
+-	this->value=xNew<int>(in_M*in_N);
+-	xMemCpy<int>(this->value,intarray,in_M*in_N);
+-
+-	this->M=in_M;
+-	this->N=in_N;
+-}
+-/*}}}*/
+-/*FUNCTION IntMatParam::UnitConversion{{{*/
+-void  IntMatParam::UnitConversion(int direction_enum){
+-	/*do nothing, no unit conversion*/
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntVecParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntVecParam.h	(revision 12822)
+@@ -1,79 +0,0 @@
+-/*! \file IntVecParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _INTVECPARAM_H_
+-#define _INTVECPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class IntVecParam: public Param{
+-
+-	private: 
+-		int enum_type;
+-		int* values;
+-		int M;
+-
+-	public:
+-		/*IntVecParam constructors, destructors: {{{*/
+-		IntVecParam();
+-		IntVecParam(int enum_type,int* values,int M);
+-		IntVecParam(int enum_type,IssmDouble* values,int M);
+-		~IntVecParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param virtual functions definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM);
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array (maybe in serial?)");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
+-		void  SetValue(int* intarray,int M);
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-		
+-		void GetParameterName(char**pname);
+-		/*}}}*/
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntParam.h	(revision 12822)
+@@ -1,79 +0,0 @@
+-/*! \file IntParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _INTPARAM_H_
+-#define _INTPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class IntParam: public Param{
+-
+-	private: 
+-		/*just hold 3 values for 3 vertices: */
+-		int enum_type;
+-		IssmInt value;
+-
+-	public:
+-		/*IntParam constructors, destructors: {{{*/
+-		IntParam();
+-		IntParam(int enum_type,IssmInt value);
+-		~IntParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){*pinteger=value;}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a bool");}
+-		void  SetValue(int integer){this->value=integer;}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an IssmDouble");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-
+-		/*}}}*/
+-};
+-#endif  /* _INTPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/BoolParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/BoolParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/BoolParam.h	(revision 12822)
+@@ -1,77 +0,0 @@
+-/*! \file BoolParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _BOOLPARAM_H_
+-#define _BOOLPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class BoolParam: public Param{
+-
+-	public:
+-		/*just hold 3 values for 3 vertices: */
+-		int enum_type;
+-		IssmBool value;
+-
+-		/*BoolParam constructors, destructors: {{{*/
+-		BoolParam();
+-		BoolParam(int enum_type,IssmBool value);
+-		~BoolParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){*pbool=value;}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){this->value=boolean;}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an int");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an IssmPDouble");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-		
+-		void GetParameterName(char**pname);
+-		/*}}}*/
+-};
+-#endif  /* _BOOLPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntMatParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/IntMatParam.h	(revision 12822)
+@@ -1,80 +0,0 @@
+-/*! \file IntMatParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _INTMATPARAM_H_
+-#define _INTMATPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class IntMatParam: public Param{
+-
+-	private: 
+-		int enum_type;
+-		int* value;
+-		int M;
+-		int N;
+-
+-	public:
+-		/*IntMatParam constructors, destructors: {{{*/
+-		IntMatParam();
+-		IntMatParam(int enum_type,int* value,int M,int N);
+-		~IntMatParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN);
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");};
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");};
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");};
+-		void  SetValue(int* intarray,int M,int N);
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-
+-		/*}}}*/
+-};
+-#endif  /* _INTMATPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/VectorParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/VectorParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/VectorParam.cpp	(revision 12822)
+@@ -1,121 +0,0 @@
+-/*!\file VectorParam.c
+- * \brief: implementation of the VectorParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*VectorParam constructors and destructor*/
+-/*FUNCTION VectorParam::VectorParam(){{{*/
+-VectorParam::VectorParam(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION VectorParam::VectorParam(int enum_type,IssmVector value){{{*/
+-VectorParam::VectorParam(int in_enum_type,Vector* in_value){
+-
+-	enum_type=in_enum_type;
+-
+-	value=NULL;
+-
+-	if(in_value){
+-		value=in_value->Duplicate();
+-		in_value->Copy(value);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION VectorParam::~VectorParam(){{{*/
+-VectorParam::~VectorParam(){
+-	xdelete(&value);
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION VectorParam::Echo {{{*/
+-void VectorParam::Echo(void){
+-
+-	_printLine_("VectorParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-
+-}
+-/*}}}*/
+-/*FUNCTION VectorParam::DeepEcho{{{*/
+-void VectorParam::DeepEcho(void){
+-
+-	int i;
+-	_printLine_("VectorParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	value->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION VectorParam::Id{{{*/
+-int    VectorParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION VectorParam::MyRank{{{*/
+-int    VectorParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION VectorParam::ObjectEnum{{{*/
+-int VectorParam::ObjectEnum(void){
+-
+-	return VectorParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION VectorParam::copy{{{*/
+-Object* VectorParam::copy() {
+-	
+-	return new VectorParam(this->enum_type,this->value);
+-
+-}
+-/*}}}*/
+-
+-/*VectorParam virtual functions definitions: */
+-/*FUNCTION VectorParam::GetParameterValue{{{*/
+-void  VectorParam::GetParameterValue(Vector** poutput){
+-	Vector*  output=NULL;
+-
+-	if(value){
+-		output=value->Duplicate();
+-		value->Copy(output);
+-	}
+-	*poutput=output;
+-}
+-/*}}}*/
+-/*FUNCTION VectorParam::GetParameterName{{{*/
+-void VectorParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION VectorParam::SetValue{{{*/
+-void  VectorParam::SetValue(Vector* vector){
+-
+-	/*avoid leak: */
+-	xdelete(&value);
+-	
+-	/*copy: */
+-	value=vector->Duplicate();
+-	vector->Copy(value);
+-}
+-/*}}}*/
+-/*FUNCTION VectorParam::UnitConversion{{{*/
+-void  VectorParam::UnitConversion(int direction_enum){
+-	/*do nothing, no unit conversion*/
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.cpp	(revision 12822)
+@@ -1,30 +0,0 @@
+-/*!\file DoubleTransientMatParam.c
+- * \brief: implementation of the DoubleTransientMatParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.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){
+-}
+-/*}}}*/
+-/*FUNCTION DoubleTransientMatParam::UnitConversion{{{*/
+-void  DoubleTransientMatParam::UnitConversion(int direction_enum){
+-	::UnitConversion(this->value,(this->M-1)*this->N,direction_enum,this->enum_type);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/MatrixParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/MatrixParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/MatrixParam.cpp	(revision 12822)
+@@ -1,117 +0,0 @@
+-/*!\file MatrixParam.c
+- * \brief: implementation of the MatrixParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*MatrixParam constructors and destructor*/
+-/*FUNCTION MatrixParam::MatrixParam(){{{*/
+-MatrixParam::MatrixParam(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION MatrixParam::MatrixParam(int enum_type,Matrix* value){{{*/
+-MatrixParam::MatrixParam(int in_enum_type,Matrix* in_value){
+-
+-	enum_type=in_enum_type;
+-	value=NULL;
+-
+-	if(in_value){
+-		value=in_value->Duplicate();
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION MatrixParam::~MatrixParam(){{{*/
+-MatrixParam::~MatrixParam(){
+-	xdelete(&value);
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION MatrixParam::Echo {{{*/
+-void MatrixParam::Echo(void){
+-
+-	_printLine_("MatrixParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-
+-}
+-/*}}}*/
+-/*FUNCTION MatrixParam::DeepEcho{{{*/
+-void MatrixParam::DeepEcho(void){
+-
+-	int i;
+-	_printLine_("MatrixParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	this->value->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION MatrixParam::Id{{{*/
+-int    MatrixParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION MatrixParam::MyRank{{{*/
+-int    MatrixParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION MatrixParam::ObjectEnum{{{*/
+-int MatrixParam::ObjectEnum(void){
+-
+-	return MatrixParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION MatrixParam::copy{{{*/
+-Object* MatrixParam::copy() {
+-	
+-	return new MatrixParam(this->enum_type,this->value);
+-
+-}
+-/*}}}*/
+-
+-/*MatrixParam virtual functions definitions: */
+-/*FUNCTION MatrixParam::GetParameterValue{{{*/
+-void  MatrixParam::GetParameterValue(Matrix** poutput){
+-	Matrix* output=NULL;
+-
+-	if(value){
+-		output=value->Duplicate();
+-	}
+-	*poutput=output;
+-}
+-/*}}}*/
+-/*FUNCTION MatrixParam::GetParameterName{{{*/
+-void MatrixParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION MatrixParam::SetValue{{{*/
+-void  MatrixParam::SetValue(Matrix* matrix){
+-	
+-	/*avoid leak: */
+-	xdelete(&value);
+-	
+-	/*copy: */
+-	value=matrix->Duplicate();
+-}
+-/*}}}*/
+-/*FUNCTION MatrixParam::UnitConversion{{{*/
+-void  MatrixParam::UnitConversion(int direction_enum){
+-	/*do nothing, no unit conversion*/
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringArrayParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringArrayParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringArrayParam.cpp	(revision 12822)
+@@ -1,179 +0,0 @@
+-/*!\file StringArrayParam.c
+- * \brief: implementation of the StringArrayParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*StringArrayParam constructors and destructor*/
+-/*FUNCTION 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){
+-
+-	int i;
+-	int size;
+-
+-	enum_type=in_enum_type;
+-	numstrings=in_numstrings;
+-
+-	if(numstrings){
+-		value=xNew<char*>(numstrings);
+-		for(i=0;i<numstrings;i++){
+-			char* string=NULL;
+-			size=strlen(in_values[i])+1;
+-			string=xNew<char>(size);
+-			xMemCpy<char>(string,in_values[i],size);
+-			value[i]=string;
+-		}
+-	}
+-	else value=NULL;
+-	
+-}
+-/*}}}*/
+-/*FUNCTION StringArrayParam::~StringArrayParam(){{{*/
+-StringArrayParam::~StringArrayParam(){
+-		
+-	int i;
+-	
+-	char* string=NULL;
+-	for(i=0;i<this->numstrings;i++){
+-		string=value[i];
+-		xDelete<char>(string);
+-	}
+-	xDelete<char*>(value);
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION StringArrayParam::Echo {{{*/
+-void StringArrayParam::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION StringArrayParam::DeepEcho{{{*/
+-void StringArrayParam::DeepEcho(void){
+-
+-	int i;
+-	char* string=NULL;
+-
+-	_printLine_("StringArrayParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	for(i=0;i<this->numstrings;i++){
+-		string=this->value[i];
+-		_printLine_("   " << i << ": " << string);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION StringArrayParam::Id{{{*/
+-int    StringArrayParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION StringArrayParam::MyRank{{{*/
+-int    StringArrayParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION StringArrayParam::ObjectEnum{{{*/
+-int StringArrayParam::ObjectEnum(void){
+-
+-	return StringArrayParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION StringArrayParam::copy{{{*/
+-Object* StringArrayParam::copy() {
+-	
+-	return new StringArrayParam(this->enum_type,this->value,this->numstrings);
+-
+-}
+-/*}}}*/
+-
+-/*StringArrayParam virtual functions definitions: */
+-/*FUNCTION StringArrayParam::GetParameterValue{{{*/
+-void  StringArrayParam::GetParameterValue(char*** pstringarray,int* pM){
+-	
+-	int   i;
+-	char** outstrings=NULL;
+-	int   M;
+-	char* string=NULL;
+-	char* string2=NULL;
+-	int   stringsize;
+-
+-	M=this->numstrings;
+-	if(this->numstrings){
+-		outstrings=xNew<char*>(this->numstrings);
+-
+-		for(i=0;i<this->numstrings;i++){
+-			string=this->value[i];
+-			stringsize=strlen(string)+1;
+-
+-			string2=xNew<char>(stringsize);
+-			xMemCpy<char>(string2,string,stringsize);
+-
+-			outstrings[i]=string2;
+-		}
+-	}
+-	else outstrings=NULL;
+-
+-	/*Assign output pointers:*/
+-	*pM=M;
+-	*pstringarray=outstrings;
+-}
+-/*}}}*/
+-/*FUNCTION StringArrayParam::GetParameterName{{{*/
+-void StringArrayParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION StringArrayParam::SetValue{{{*/
+-void  StringArrayParam::SetValue(char** stringarray,int M){
+-	
+-	int   i;
+-	char *string     = NULL;
+-	char *string2    = NULL;
+-	int   stringsize;
+-
+-	/*first, avoid leak: */
+-	for(i=0;i<this->numstrings;i++){
+-		string=this->value[i];
+-		xDelete<char>(string);
+-	}
+-	xDelete<char*>(this->value);
+-
+-	/*copy: */
+-	this->numstrings=M;
+-	this->value=xNew<char*>(this->numstrings);
+-	for(i=0;i<this->numstrings;i++){
+-		string=stringarray[i];
+-		stringsize=strlen(string)+1;
+-
+-		string2=xNew<char>(stringsize);
+-		xMemCpy<char>(string2,string,stringsize);
+-
+-		this->value[i]=string2;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION StringArrayParam::UnitConversion{{{*/
+-void  StringArrayParam::UnitConversion(int direction_enum){
+-	/*do nothing, no unit conversion*/
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringParam.cpp	(revision 12822)
+@@ -1,121 +0,0 @@
+-/*!\file StringParam.c
+- * \brief: implementation of the StringParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*StringParam constructors and destructor*/
+-/*FUNCTION StringParam::StringParam(){{{*/
+-StringParam::StringParam(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION StringParam::StringParam(int enum_type,IssmString value){{{*/
+-StringParam::StringParam(int in_enum_type,char* in_value){
+-
+-	enum_type=in_enum_type;
+-	value=xNew<char>(strlen(in_value)+1);
+-	xMemCpy<char>(value,in_value,(strlen(in_value)+1));
+-
+-	
+-}
+-/*}}}*/
+-/*FUNCTION StringParam::~StringParam(){{{*/
+-StringParam::~StringParam(){
+-	xDelete<char>(value);
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION StringParam::Echo {{{*/
+-void StringParam::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION StringParam::DeepEcho{{{*/
+-void StringParam::DeepEcho(void){
+-	_printLine_("StringParam:");
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-}
+-/*}}}*/
+-/*FUNCTION StringParam::Id{{{*/
+-int    StringParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION StringParam::MyRank{{{*/
+-int    StringParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION StringParam::ObjectEnum{{{*/
+-int StringParam::ObjectEnum(void){
+-
+-	return StringParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION StringParam::copy{{{*/
+-Object* StringParam::copy() {
+-	
+-	return new StringParam(this->enum_type,this->value);
+-
+-}
+-/*}}}*/
+-
+-/*StringParam virtual functions definitions: */
+-/*FUNCTION StringParam::GetParameterValue{{{*/
+-void  StringParam::GetParameterValue(char** pstring){
+-	
+-	char* outstring=NULL;
+-	int   stringsize;
+-
+-	stringsize=strlen(this->value)+1;
+-
+-	outstring=xNew<char>(stringsize);
+-	xMemCpy<char>(outstring,this->value,stringsize);
+-
+-	*pstring=outstring;
+-
+-}
+-/*}}}*/
+-/*FUNCTION StringParam::GetParameterName{{{*/
+-void StringParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION StringParam::SetValue{{{*/
+-void  StringParam::SetValue(char* string){
+-	
+-	int   stringsize;
+-	
+-	/*avoid leak: */
+-	xDelete<char>(this->value);
+-
+-	/*copy: */
+-	stringsize=strlen(string)+1;
+-	this->value=xNew<char>(stringsize);
+-	xMemCpy<char>(this->value,string,stringsize);
+-
+-}
+-/*}}}*/
+-/*FUNCTION StringParam::UnitConversion{{{*/
+-void  StringParam::UnitConversion(int direction_enum){
+-	/*do nothing, no unit conversion*/
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/VectorParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/VectorParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/VectorParam.h	(revision 12822)
+@@ -1,79 +0,0 @@
+-/*! \file VectorParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _VECTORPARAM_H_
+-#define _VECTORPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class VectorParam: public Param{
+-
+-	private: 
+-		/*just hold 3 values for 3 vertices: */
+-		int enum_type;
+-		Vector* value;
+-
+-	public:
+-		/*VectorParam constructors, destructors: {{{*/
+-		VectorParam();
+-		VectorParam(int enum_type,Vector* value);
+-		~VectorParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(Vector** poutput);
+-		void  GetParameterValue(FILE** pfid){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec);
+-		void  SetValue(Matrix* mat){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-
+-		/*}}}*/
+-};
+-#endif  /* _VECTORPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.cpp	(revision 12822)
+@@ -1,151 +0,0 @@
+-/*!\file TransientParam.c
+- * \brief: implementation of the TransientParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*TransientParam constructors and destructor*/
+-/*FUNCTION 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){
+-
+-	_assert_(in_values && in_time);
+-
+-	enum_type=in_enum_type;
+-	N=in_N;
+-
+-	values=xNew<IssmDouble>(N);
+-	xMemCpy<IssmDouble>(values,in_values,N);
+-
+-	timesteps=xNew<IssmDouble>(N);
+-	xMemCpy<IssmDouble>(timesteps,in_time,N);
+-}
+-/*}}}*/
+-/*FUNCTION TransientParam::~TransientParam(){{{*/
+-TransientParam::~TransientParam(){
+-	xDelete<IssmDouble>(values);
+-	xDelete<IssmDouble>(timesteps);
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION TransientParam::Echo {{{*/
+-void TransientParam::Echo(void){
+-
+-	_printLine_("TransientParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   size: " << this->N);
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientParam::DeepEcho{{{*/
+-void TransientParam::DeepEcho(void){
+-
+-	int i,j;
+-	
+-	_printLine_("TransientParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   size: " << this->N);
+-	for(i=0;i<this->N;i++){
+-		_printLine_(   "time: " << this->timesteps[i] << " value: " << this->values[i]);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION TransientParam::Id{{{*/
+-int    TransientParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION TransientParam::MyRank{{{*/
+-int    TransientParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION TransientParam::ObjectEnum{{{*/
+-int TransientParam::ObjectEnum(void){
+-
+-	return TransientParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TransientParam::copy{{{*/
+-Object* TransientParam::copy() {
+-	
+-	return new TransientParam(this->enum_type,this->values,this->timesteps,this->N);
+-
+-}
+-/*}}}*/
+-
+-/*TransientParam virtual functions definitions: */
+-/*FUNCTION TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){{{*/
+-void  TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){
+-
+-	double output;
+-	bool   found;
+-
+-	/*Ok, we have the time, go through the timesteps, and figure out which interval we 
+-	 *fall within. Then interpolate the values on this interval: */
+-	if(time<this->timesteps[0]){
+-		/*get values for the first time: */
+-		output=this->values[0];
+-		found=true;
+-	}
+-	else if(time>this->timesteps[this->N-1]){
+-		/*get values for the last time: */
+-		output=this->values[this->N-1];
+-		found=true;
+-	}
+-	else{
+-		/*Find which interval we fall within: */
+-		for(int i=0;i<this->N;i++){
+-			if(time==this->timesteps[i]){
+-				/*We are right on one step time: */
+-				output=this->values[i];
+-				found=true;
+-				break; //we are done with the time interpolation.
+-			}
+-			else{
+-				if(this->timesteps[i]<time && time<this->timesteps[i+1]){
+-					/*ok, we have the interval ]i:i+1[. Interpolate linearly for now: */
+-					IssmDouble deltat=this->timesteps[i+1]-this->timesteps[i];
+-					IssmDouble alpha=(time-this->timesteps[i])/deltat;
+-					output=(1.0-alpha)*this->values[i] + alpha*this->values[i+1];
+-					found=true;
+-					break;
+-				}
+-				else continue; //keep looking on the next interval
+-			}
+-		}
+-	}
+-	if(!found)_error2_("did not find time interval on which to interpolate values");
+-	*pdouble=output;
+-}
+-/*}}}*/
+-/*FUNCTION TransientParam::GetParameterName{{{*/
+-void TransientParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION TransientParam::UnitConversion{{{*/
+-void  TransientParam::UnitConversion(int direction_enum){
+-	::UnitConversion(this->values,this->N,direction_enum,this->enum_type);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp	(revision 12822)
+@@ -1,150 +0,0 @@
+-/*!\file DoubleVecParam.c
+- * \brief: implementation of the DoubleVecParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*DoubleVecParam constructors and destructor*/
+-/*FUNCTION 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){
+-
+-	enum_type=in_enum_type;
+-	M=in_M;
+-
+-	values=xNew<IssmDouble>(M);
+-	xMemCpy<IssmDouble>(values,in_values,M);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::~DoubleVecParam(){{{*/
+-DoubleVecParam::~DoubleVecParam(){
+-	xDelete<IssmDouble>(values);
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleVecParam::Echo {{{*/
+-void DoubleVecParam::Echo(void){
+-
+-	_printLine_("DoubleVecParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   vector size: " << this->M);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::DeepEcho{{{*/
+-void DoubleVecParam::DeepEcho(void){
+-
+-	int i;
+-	
+-	_printLine_("DoubleVecParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   vector size: " << this->M);
+-	for(i=0;i<this->M;i++){
+-		_printLine_(i << " " << this->values[i]);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::Id{{{*/
+-int    DoubleVecParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::MyRank{{{*/
+-int    DoubleVecParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::ObjectEnum{{{*/
+-int DoubleVecParam::ObjectEnum(void){
+-
+-	return DoubleVecParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::copy{{{*/
+-Object* DoubleVecParam::copy() {
+-	
+-	return new DoubleVecParam(this->enum_type,this->values,this->M);
+-
+-}
+-/*}}}*/
+-
+-/*DoubleVecParam virtual functions definitions: */
+-/*FUNCTION DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/
+-void  DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){
+-	IssmDouble* output=NULL;
+-	int M;
+-
+-	M=this->M;
+-	output=xNew<IssmDouble>(M);
+-	xMemCpy<IssmDouble>(output,values,M);
+-
+-	/*Assign output pointers:*/
+-	if(pM) *pM=M;
+-	*pIssmDoublearray=output;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/
+-void  DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){
+-	IssmDouble* output=NULL;
+-	int M;
+-	int N;
+-
+-	N=1;
+-	M=this->M;
+-	output=xNew<IssmDouble>(M);
+-	xMemCpy<IssmDouble>(output,values,M);
+-
+-	/*Assign output pointers:*/
+-	if(pM) *pM=M;
+-	if(pN) *pN=N;
+-	*pIssmDoublearray=output;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::GetParameterValue(int** pintarray,int* pM){{{*/
+-void  DoubleVecParam::GetParameterValue(int** pintarray,int* pM){
+-	_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::GetParameterName{{{*/
+-void DoubleVecParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::SetValue{{{*/
+-void  DoubleVecParam::SetValue(IssmDouble* IssmDoublearray,int in_M){
+-
+-	/*avoid leak: */
+-	xDelete<IssmDouble>(this->values);
+-
+-	this->values=xNew<IssmDouble>(in_M);
+-	xMemCpy<IssmDouble>(this->values,IssmDoublearray,in_M);
+-
+-	this->M=in_M;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecParam::UnitConversion{{{*/
+-void  DoubleVecParam::UnitConversion(int direction_enum){
+-	::UnitConversion(this->values,this->M,direction_enum,this->enum_type);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/MatrixParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/MatrixParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/MatrixParam.h	(revision 12822)
+@@ -1,79 +0,0 @@
+-/*! \file MatrixParam.h 
+- *  \brief: header file for MatrixParam object
+- */
+-
+-
+-#ifndef _MATRIXPARAM_H_
+-#define _MATRIXPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class MatrixParam: public Param{
+-
+-	private: 
+-		/*just hold 3 values for 3 vertices: */
+-		int enum_type;
+-		Matrix* value;
+-
+-	public:
+-		/*MatrixParam constructors, destructors: {{{*/
+-		MatrixParam();
+-		MatrixParam(int enum_type,Matrix* value);
+-		~MatrixParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");}
+-		void  GetParameterValue(Matrix** poutput);
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat);
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-
+-		/*}}}*/
+-};
+-#endif  /* _MATRIXPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.h	(revision 12822)
+@@ -1,32 +0,0 @@
+-/*! \file DoubleTransientMatParam.h 
+- *  \brief: header file for DoubleTransientMatParam object
+- */
+-
+-
+-#ifndef _DOUBLETRANSIENTMATPARAM_H_
+-#define _DOUBLETRANSIENTMATPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class DoubleTransientMatParam: public DoubleMatParam{
+-
+-	public:
+-		/*DoubleTransientMatParam constructors, destructors: {{{*/
+-		DoubleTransientMatParam(int enum_type,IssmDouble* value,int M,int N);
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		void  UnitConversion(int direction_enum);
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLETRANSIENTMATPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringArrayParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringArrayParam.h	(revision 12822)
+@@ -1,80 +0,0 @@
+-/*! \file StringArrayParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _STRINGARRAYPARAM_H_
+-#define _STRINGARRAYPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class StringArrayParam: public Param{
+-
+-	private: 
+-		/*just hold 3 values for 3 vertices: */
+-		int      enum_type;
+-		char**   value;
+-		int      numstrings;
+-
+-
+-	public:
+-		/*StringArrayParam constructors, destructors: {{{*/
+-		StringArrayParam();
+-		StringArrayParam(int enum_type,char** values, int numstrings);
+-		~StringArrayParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM);
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Vec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M);
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-		/*}}}*/
+-};
+-#endif  /* _STRINGARRAYPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleParam.cpp	(revision 12822)
+@@ -1,116 +0,0 @@
+-/*!\file DoubleParam.c
+- * \brief: implementation of the DoubleParam object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*DoubleParam constructors and destructor*/
+-/*FUNCTION DoubleParam::DoubleParam(){{{*/
+-DoubleParam::DoubleParam(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleParam::DoubleParam(int enum_type,IssmDouble value){{{*/
+-DoubleParam::DoubleParam(int in_enum_type,IssmDouble in_value){
+-
+-	enum_type=in_enum_type;
+-	value=in_value;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleParam::~DoubleParam(){{{*/
+-DoubleParam::~DoubleParam(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleParam::Echo {{{*/
+-void DoubleParam::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION DoubleParam::DeepEcho{{{*/
+-void DoubleParam::DeepEcho(void){
+-
+-	_printLine_("DoubleParam:");
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleParam::Id{{{*/
+-int    DoubleParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleParam::MyRank{{{*/
+-int    DoubleParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleParam::ObjectEnum{{{*/
+-int DoubleParam::ObjectEnum(void){
+-
+-	return DoubleParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleParam::copy{{{*/
+-Object* DoubleParam::copy() {
+-	
+-	return new DoubleParam(this->enum_type,this->value);
+-
+-}
+-/*}}}*/
+-
+-/*DoubleParam virtual functions definitions: */
+-/*FUNCTION DoubleParam::GetParameterName{{{*/
+-void DoubleParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleParam::GetParameterValue(int* pinteger){{{*/
+-void DoubleParam::GetParameterValue(int* pinteger){
+-	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
+-}
+-/*}}}*/
+-/*FUNCTION DoubleParam::GetParameterValue(bool* pbool){{{*/
+-void DoubleParam::GetParameterValue(bool* pbool){
+-	_error2_("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){
+-	_error2_("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){
+-	_error2_("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){
+-	_error2_("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){
+-	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");
+-}
+-/*}}}*/
+-/*FUNCTION DoubleParam::UnitConversion{{{*/
+-void  DoubleParam::UnitConversion(int direction_enum){
+-	::UnitConversion(&this->value,1,direction_enum,this->enum_type);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/StringParam.h	(revision 12822)
+@@ -1,79 +0,0 @@
+-/*! \file StringParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _STRINGPARAM_H_
+-#define _STRINGPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class StringParam: public Param{
+-
+-	private: 
+-		/*just hold 3 values for 3 vertices: */
+-		int enum_type;
+-		char* value;
+-
+-	public:
+-		/*StringParam constructors, destructors: {{{*/
+-		StringParam();
+-		StringParam(int enum_type,char* value);
+-		~StringParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring);
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string);
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-
+-		/*}}}*/
+-};
+-#endif  /* _STRINGPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.cpp	(revision 12822)
+@@ -1,252 +0,0 @@
+-/*!\file DoubleMatArrayParam.c
+- * \brief: implementation of the DoubleMatArrayParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*DoubleMatArrayParam constructors and destructor*/
+-/*FUNCTION 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){
+-
+-	int i;
+-	IssmDouble* matrix=NULL;
+-	int     m,n;
+-
+-	enum_type=in_enum_type;
+-	M=in_M;
+-	if(M){
+-		array=xNew<IssmDouble*>(M);
+-		mdim_array=xNew<int>(M);
+-		ndim_array=xNew<int>(M);
+-
+-		for(i=0;i<M;i++){
+-			m=in_mdim_array[i]; 
+-			n=in_ndim_array[i];
+-
+-			mdim_array[i]=m;
+-			ndim_array[i]=n;
+-
+-			if(m*n){
+-				matrix=xNew<IssmDouble>(m*n);
+-				xMemCpy<IssmDouble>(matrix,in_array[i],m*n);
+-			}
+-			else{
+-				matrix=NULL;
+-			}
+-			array[i]=matrix;
+-		}
+-	}
+-	else{
+-		array=NULL;
+-		mdim_array=NULL;
+-		ndim_array=NULL;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatArrayParam::~DoubleMatArrayParam(){{{*/
+-DoubleMatArrayParam::~DoubleMatArrayParam(){
+-
+-	int i;
+-	IssmDouble* matrix=NULL;
+-
+-	xDelete<int>(mdim_array);
+-	xDelete<int>(ndim_array);
+-
+-	for(i=0;i<M;i++){
+-		matrix=array[i];
+-		xDelete<IssmDouble>(matrix);
+-	}
+-	
+-	xDelete<IssmDouble*>(array);
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleMatArrayParam::Echo {{{*/
+-void DoubleMatArrayParam::Echo(void){
+-
+-	_printLine_("DoubleMatArrayParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   array size: " << this->M);
+-	_printLine_("   array pointer: " << this->array);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatArrayParam::DeepEcho{{{*/
+-void DoubleMatArrayParam::DeepEcho(void){
+-
+-	int i,j,k;
+-	int m,n;
+-	IssmDouble* matrix=NULL;
+-	
+-	_printLine_("DoubleMatArrayParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   array size: " << this->M);
+-	for(i=0;i<M;i++){
+-		_printLine_("   array " << i << " (" << mdim_array[i] << "x" << ndim_array[i] << "):");
+-		matrix=array[i];
+-		m=mdim_array[i];
+-		n=ndim_array[i];
+-
+-		for(j=0;j<m;j++){
+-			_printString_("   ");
+-			for(k=0;k<n;k++)_printString_(*(matrix+n*j+k) << " ");
+-			_printLine_("");
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatArrayParam::Id{{{*/
+-int    DoubleMatArrayParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleMatArrayParam::MyRank{{{*/
+-int    DoubleMatArrayParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatArrayParam::ObjectEnum{{{*/
+-int DoubleMatArrayParam::ObjectEnum(void){
+-
+-	return DoubleMatArrayParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatArrayParam::copy{{{*/
+-Object* DoubleMatArrayParam::copy() {
+-	
+-	return new DoubleMatArrayParam(this->enum_type,this->array, this->M, this->mdim_array,this->ndim_array);
+-
+-}
+-/*}}}*/
+-
+-/*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){
+-
+-	int i,m,n;
+-	IssmDouble* matrix=NULL;
+-	IssmDouble* out_matrix=NULL;
+-
+-	/*output: */
+-	IssmDouble** out_array=NULL;
+-	int      out_M;
+-	int*     out_mdim_array=NULL;
+-	int*     out_ndim_array=NULL;
+-
+-
+-	out_M=this->M;
+-	if(out_M){
+-		out_array=xNew<IssmDouble*>(M);
+-		out_mdim_array=xNew<int>(M);
+-		out_ndim_array=xNew<int>(M);
+-
+-		xMemCpy<int>(out_mdim_array,this->mdim_array,M);
+-		xMemCpy<int>(out_ndim_array,this->ndim_array,M);
+-
+-		for(i=0;i<this->M;i++){
+-			matrix=this->array[i];
+-			m=this->mdim_array[i];
+-			n=this->ndim_array[i];
+-
+-			if(m*n){
+-				out_matrix=xNew<IssmDouble>(m*n);
+-				xMemCpy<IssmDouble>(out_matrix,matrix,m*n);
+-			}
+-			else{
+-				out_matrix=NULL;
+-			}
+-			out_array[i]=out_matrix;
+-		}
+-	}
+-	else{
+-		out_array=NULL;
+-		out_matrix=NULL;
+-		out_ndim_array=NULL;
+-	}
+-
+-
+-	/*Assign output pointers:*/
+-	if(pout_M) *pout_M=out_M;
+-	if(pout_mdim_array) *pout_mdim_array=out_mdim_array;
+-	if(pout_ndim_array) *pout_ndim_array=out_ndim_array;
+-	*pout_array=out_array;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatArrayParam::GetParameterName{{{*/
+-void DoubleMatArrayParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*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){
+-
+-	int i,m,n;
+-	IssmDouble* in_matrix=NULL;
+-	IssmDouble* matrix=NULL;
+-
+-	/*avoid leak: */
+-	xDelete<int>(mdim_array);
+-	xDelete<int>(ndim_array);
+-	for(i=0;i<M;i++){
+-		matrix=array[i];
+-		xDelete<IssmDouble>(matrix);
+-	}
+-	xDelete<IssmDouble*>(array);
+-
+-	/*copy data: */
+-	this->M=in_M;
+-	this->array=xNew<IssmDouble*>(M);
+-	this->mdim_array=xNew<int>(M);
+-	this->ndim_array=xNew<int>(M);
+-	
+-	xMemCpy<int>(this->mdim_array,in_mdim_array,M);
+-	xMemCpy<int>(this->ndim_array,in_ndim_array,M);
+-
+-	for(i=0;i<M;i++){
+-		in_matrix=in_array[i];
+-		m=in_mdim_array[i];
+-		n=in_ndim_array[i];
+-
+-		matrix=xNew<IssmDouble>(m*n);
+-		xMemCpy<IssmDouble>(matrix,in_matrix,m*n);
+-
+-		this->array[i]=matrix;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatArrayParam::UnitConversion{{{*/
+-void  DoubleMatArrayParam::UnitConversion(int direction_enum){
+-	/*go through all matrices and convert: */
+-	for (int i=0;i<this->M;i++){
+-		IssmDouble* matrix=this->array[i];
+-		int     m=this->mdim_array[i];
+-		int     n=this->ndim_array[i];
+-		::UnitConversion(matrix,m*n,direction_enum,this->enum_type);
+-	}
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp	(revision 12822)
+@@ -1,136 +0,0 @@
+-/*!\file DoubleMatParam.c
+- * \brief: implementation of the DoubleMatParam object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*DoubleMatParam constructors and destructor*/
+-/*FUNCTION 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){
+-
+-	enum_type=in_enum_type;
+-	M=in_M;
+-	N=in_N;
+-
+-	value=xNew<IssmDouble>(M*N);
+-	xMemCpy<IssmDouble>(value,in_value,M*N);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatParam::~DoubleMatParam(){{{*/
+-DoubleMatParam::~DoubleMatParam(){
+-	xDelete<IssmDouble>(value);
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleMatParam::Echo {{{*/
+-void DoubleMatParam::Echo(void){
+-
+-	_printLine_("DoubleMatParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   matrix size: " << this->M << "x" << this->N);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatParam::DeepEcho{{{*/
+-void DoubleMatParam::DeepEcho(void){
+-
+-	int i,j;
+-	
+-	_printLine_("DoubleMatParam:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   matrix size: " << this->M << "x" << this->N);
+-	for(i=0;i<this->M;i++){
+-		for(i=0;i<this->N;i++){
+-			_printLine_(i << " " << j << " " << *(this->value+N*i+j));
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatParam::Id{{{*/
+-int    DoubleMatParam::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleMatParam::MyRank{{{*/
+-int    DoubleMatParam::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatParam::ObjectEnum{{{*/
+-int DoubleMatParam::ObjectEnum(void){
+-
+-	return DoubleMatParamEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatParam::copy{{{*/
+-Object* DoubleMatParam::copy() {
+-	
+-	return new DoubleMatParam(this->enum_type,this->value,this->M,this->N);
+-
+-}
+-/*}}}*/
+-
+-/*DoubleMatParam virtual functions definitions: */
+-/*FUNCTION 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);
+-	xMemCpy<IssmDouble>(output,value,M*N);
+-
+-	/*Assign output pointers:*/
+-	if(pM) *pM=M;
+-	if(pN) *pN=N;
+-	*pIssmDoublearray=output;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{*/
+-void  DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){
+-	_error2_("DoubleMat of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatParam::GetParameterName{{{*/
+-void DoubleMatParam::GetParameterName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatParam::SetValue{{{*/
+-void  DoubleMatParam::SetValue(IssmDouble* IssmDoublearray,int in_M,int in_N){
+-
+-	/*avoid leak: */
+-	xDelete<IssmDouble>(this->value);
+-
+-	this->value=xNew<IssmDouble>(in_M*in_N);
+-	xMemCpy<IssmDouble>(this->value,IssmDoublearray,in_M*in_N);
+-
+-	this->M=in_M;
+-	this->N=in_N;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatParam::UnitConversion{{{*/
+-void  DoubleMatParam::UnitConversion(int direction_enum){
+-	::UnitConversion(this->value,this->M*this->N,direction_enum,this->enum_type);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Params/TransientParam.h	(revision 12822)
+@@ -1,80 +0,0 @@
+-/*! \file TransientParam.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _TRANSIENTPARAM_H_
+-#define _TRANSIENTPARAM_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class TransientParam: public Param{
+-
+-	protected: 
+-		int enum_type;
+-		int N;
+-		IssmDouble* values;
+-		IssmDouble* timesteps;
+-
+-	public:
+-		/*TransientParam constructors, destructors: {{{*/
+-		TransientParam();
+-		TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,int in_N);
+-		~TransientParam();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Param vritual function definitions: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time);
+-		void  GetParameterValue(char** pstring){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a FILE");}
+-
+-		void  SetValue(bool boolean){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int mat array");};
+-		void  SetValue(Vector* vec){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+-		void  UnitConversion(int direction_enum);
+-
+-		void GetParameterName(char**pname);
+-
+-		/*}}}*/
+-};
+-#endif  /* _TRANSIENTPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionStruct.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionStruct.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionStruct.h	(revision 12822)
+@@ -1,52 +0,0 @@
+-/*! \file OptionStruct.h 
+- *  \brief: header file for optionstruct object
+- */
+-
+-#ifndef _OPTIONSTRUCT_H_
+-#define _OPTIONSTRUCT_H_
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-class OptionStruct: public Option {
+-
+-	public:
+-
+-		Options** values;
+-
+-		/*OptionStruct constructors, destructors {{{*/
+-		OptionStruct();
+-		~OptionStruct();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionStructEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		char* Name();
+-		int   NumEl();
+-		int   NDims();
+-		int*  Size();
+-		void  Get(int* pvalue){_error2_("An OptionStruct object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error2_("An OptionStruct object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue){  _error2_("An OptionStruct object cannot return a bool");};
+-		void  Get(char** pvalue){ _error2_("An OptionStruct object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionStruct object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionStruct object cannot return a IssmDouble vec");};
+-		void  Get(Options** pvalue);
+-		void  Get(Options*** ppvalue,int *pnumel);
+-
+-};
+-#endif  /* _OPTIONSTRUCT_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionDouble.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionDouble.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionDouble.cpp	(revision 12822)
+@@ -1,162 +0,0 @@
+-/*!\file OptionDouble.cpp
+- * \brief: implementation of the optionsIssmDouble object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION OptionDouble::OptionDouble(){{{*/
+-OptionDouble::OptionDouble(){
+-
+-	values    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::~OptionDouble(){{{*/
+-OptionDouble::~OptionDouble(){
+-
+-	if (values) xDelete<IssmDouble>(values);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION OptionDouble::Echo {{{*/
+-void  OptionDouble::Echo(){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("OptionDouble Echo:");
+-	Option::Echo();
+-
+-	if (values && size) {
+-		if(numel == 1) if(flag) _pprintLine_("        values: " << values[0]);
+-		else {
+-			StringFromSize(cstr,size,ndims);
+-			if(flag) _pprintLine_("        values: " << cstr << " " << "IssmDouble");
+-		}
+-	}
+-	else if(flag) _pprintLine_("        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::DeepEcho() {{{*/
+-void  OptionDouble::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	OptionDouble::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::DeepEcho(char* indent) {{{*/
+-void  OptionDouble::DeepEcho(char* indent){
+-
+-	int   i;
+-	int*  dims;
+-	char  indent2[81];
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "OptionDouble DeepEcho:");
+-	Option::DeepEcho(indent);
+-
+-	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
+-	strcat(indent2,"  ");
+-
+-	if (values) {
+-		dims=xNew<int>(ndims);
+-		if(numel==1) if(flag) _pprintLine_(indent << "        values: " << values[0]);
+-		else{
+-			for (i=0; i<numel; i++) {
+-				RowWiseDimsFromIndex(dims,i,size,ndims);
+-				StringFromDims(cstr,dims,ndims);
+-				if(flag) _pprintLine_(indent << "        values" << cstr << ": " << values[i]);
+-			}
+-		}
+-		xDelete<int>(dims);
+-	}
+-	else if(flag) _pprintLine_(indent << "        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::Name {{{*/
+-char* OptionDouble::Name(){
+-
+-	return(Option::Name());
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::NumEl {{{*/
+-int   OptionDouble::NumEl(){
+-
+-	return(Option::NumEl());
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::NDims {{{*/
+-int   OptionDouble::NDims(){
+-
+-	return(Option::NDims());
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::Size {{{*/
+-int*  OptionDouble::Size(){
+-
+-	return(Option::Size());
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::Get(int* pvalue) {{{*/
+-void OptionDouble::Get(int* pvalue){
+-
+-	/*We should first check that the size is one*/
+-	if(this->NumEl()!=1){
+-		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single int");
+-	}
+-
+-	/*Assign output pointer*/
+-	*pvalue=reCast<int>(values[0]);
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::Get(IssmDouble* pvalue) {{{*/
+-void OptionDouble::Get(IssmDouble* pvalue){
+-
+-	/*We should first check that the size is one*/
+-	if(this->NumEl()!=1){
+-		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single IssmDouble");
+-	}
+-
+-	/*Assign output pointer*/
+-	*pvalue=this->values[0];
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::Get(IssmDouble** pvalue,int* numel) {{{*/
+-void OptionDouble::Get(IssmDouble** pvalue,int* numel){
+-
+-	/*We should first check that the size is at least one*/
+-	if(this->NumEl()<=0){
+-		_error2_("option \"" << this->name << "\" is empty and cannot return a IssmDouble vector");
+-	}
+-
+-	/*Copy vector*/
+-	IssmDouble* outvalue=xNew<IssmDouble>(this->NumEl());
+-	for(int i=0;i<this->NumEl();i++) outvalue[i]=this->values[i];
+-
+-	/*Assign output pointer*/
+-	*pvalue=outvalue;
+-	if(numel) *numel=this->NumEl();
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionLogical.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionLogical.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionLogical.cpp	(revision 12822)
+@@ -1,133 +0,0 @@
+-/*!\file OptionLogical.cpp
+- * \brief: implementation of the optionslogical object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION OptionLogical::OptionLogical(){{{*/
+-OptionLogical::OptionLogical(){
+-
+-	values    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::~OptionLogical(){{{*/
+-OptionLogical::~OptionLogical(){
+-
+-	if (values) xDelete<bool>(values);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION OptionLogical::Echo {{{*/
+-void  OptionLogical::Echo(){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("OptionLogical Echo:");
+-	Option::Echo();
+-
+-	if (values && size) {
+-		if(numel == 1) if(flag) _pprintLine_("        values: " << (values[0] ? "true" : "false"));
+-		else{
+-			StringFromSize(cstr,size,ndims);
+-			if(flag) _pprintLine_("        values: " << cstr << " " << "logical");
+-		}
+-	}
+-	else if(flag) _pprintLine_("        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::DeepEcho() {{{*/
+-void  OptionLogical::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	OptionLogical::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::DeepEcho(char* indent) {{{*/
+-void  OptionLogical::DeepEcho(char* indent){
+-
+-	int   i;
+-	int*  dims;
+-	char  indent2[81];
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "OptionLogical DeepEcho:");
+-	Option::DeepEcho(indent);
+-
+-	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
+-	strcat(indent2,"  ");
+-
+-	if (values) {
+-		if(numel==1) if(flag) _pprintLine_(indent << "        values: " << (values[0] ? "true" : "false"));
+-		else{
+-			dims=xNew<int>(ndims);
+-			for (i=0; i<numel; i++) {
+-				RowWiseDimsFromIndex(dims,i,size,ndims);
+-				StringFromDims(cstr,dims,ndims);
+-				if(flag) _pprintLine_(indent << "        values" << cstr << ": " << (values[i] ? "true" : "false"));
+-			}
+-			xDelete<int>(dims);
+-		}
+-	}
+-	else if(flag) _pprintLine_(indent << "        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::Name {{{*/
+-char* OptionLogical::Name(){
+-
+-	return(Option::Name());
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::NumEl {{{*/
+-int   OptionLogical::NumEl(){
+-
+-	return(Option::NumEl());
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::NDims {{{*/
+-int   OptionLogical::NDims(){
+-
+-	return(Option::NDims());
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::Size {{{*/
+-int*  OptionLogical::Size(){
+-
+-	return(Option::Size());
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::Get(bool* pvalue) {{{*/
+-void OptionLogical::Get(bool* pvalue){
+-
+-	/*We should first check that the size is one*/
+-	if(this->NumEl()!=1){
+-		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single bool");
+-	}
+-
+-	/*Assign output pointer*/
+-	*pvalue=this->values[0];
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionUtilities.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionUtilities.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionUtilities.cpp	(revision 12822)
+@@ -1,114 +0,0 @@
+-/*!\file OptionUtilities.cpp
+- * \brief: implementation of the options utilities
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*FUNCTION ColumnWiseDimsFromIndex{{{*/
+-int ColumnWiseDimsFromIndex(int* dims,int index,int* size,int ndims){
+-
+-	int   i;
+-	int   aprod=1;
+-
+-	/*check for index too large  */
+-	for (i=0;i<ndims;i++) aprod*=size[i];
+-	if (index >= aprod) _error2_("Index " << index << " exceeds number of elements " << aprod << ".");
+-
+-	/*calculate the dimensions (being careful of integer division)  */
+-	for (i=ndims-1; i>=0; i--) {
+-		aprod=reCast<int>(((IssmPDouble)aprod+0.5)/(IssmPDouble)size[i]);
+-		dims[i]=(int)floor(((IssmPDouble)index+0.5)/(IssmPDouble)aprod);
+-		index-=dims[i]*aprod;
+-	}
+-
+-	return(0);
+-}/*}}}*/
+-/*FUNCTION IndexFromColumnWiseDims{{{*/
+-int IndexFromColumnWiseDims(int* dims, int* size, int ndims) {
+-
+-	int   i;
+-	int   index=0;
+-
+-	/*check for any dimension too large  */
+-	for (i=0;i<ndims;i++){
+-		if (dims[i] >= size[i]) _error2_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");
+-	}
+-
+-	/*calculate the index  */
+-	for (i=ndims-1; i>=0; i--){
+-		index*=size[i];
+-		index+=dims[i];
+-	}
+-
+-	return(index);
+-}/*}}}*/
+-/*FUNCTION RowWiseDimsFromIndex{{{*/
+-int RowWiseDimsFromIndex(int* dims, int index, int* size, int ndims) {
+-
+-	int   i;
+-	int   aprod=1;
+-
+-	/*check for index too large  */
+-	for (i=0; i<ndims; i++) aprod*=size[i];
+-	if (index >= aprod) _error2_("Index " << index << " exceeds number of elements " << aprod << ".");
+-
+-	/*calculate the dimensions (being careful of integer division)  */
+-	for (i=0; i<ndims; i++) {
+-		aprod=(int)(((IssmPDouble)aprod+0.5)/(IssmPDouble)size[i]);
+-		dims[i]=(int)floor(((IssmPDouble)index+0.5)/(IssmPDouble)aprod);
+-		index-=dims[i]*aprod;
+-	}
+-
+-	return(0);
+-}/*}}}*/
+-/*FUNCTION IndexFromRowWiseDims{{{*/
+-int IndexFromRowWiseDims(int* dims, int* size, int ndims) {
+-
+-	int   i;
+-	int   index=0;
+-
+-	/*check for any dimension too large  */
+-	for (i=0; i<ndims; i++){
+-		if (dims[i] >= size[i]) _error2_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");
+-	}
+-
+-	/*calculate the index  */
+-	for (i=0; i<ndims; i++) {
+-		index*=size[i];
+-		index+=dims[i];
+-	}
+-
+-	return(index);
+-}/*}}}*/
+-/*FUNCTION StringFromDims{{{*/
+-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]);
+-	sprintf(&cstr[strlen(cstr)],"%d]",dims[ndims-1]);
+-
+-	return(0);
+-}/*}}}*/
+-/*FUNCTION StringFromSize{{{*/
+-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]);
+-	sprintf(&cstr[strlen(cstr)],"%d]",size[ndims-1]);
+-
+-	return(0);
+-}/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionChar.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionChar.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionChar.cpp	(revision 12822)
+@@ -1,176 +0,0 @@
+-/*!\file OptionChar.cpp
+- * \brief: implementation of the optionschar object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION OptionChar::OptionChar(){{{*/
+-OptionChar::OptionChar(){
+-
+-	values    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::~OptionChar(){{{*/
+-OptionChar::~OptionChar(){
+-
+-	if (values) xDelete<char>(values);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION OptionChar::Echo {{{*/
+-void  OptionChar::Echo(){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("OptionChar Echo:");
+-	Option::Echo();
+-
+-	if (values && size) {
+-//		if (numel == 1) {
+-		if (1) {
+-//			if(flag) _pprintLine_("        values: \"" << values[0] << "\"");
+-			if(flag) _pprintLine_("        values: \"" << values << "\"");
+-		}
+-		else {
+-			StringFromSize(cstr,size,ndims);
+-			if(flag) _pprintLine_("        values: " << cstr << " " << "char");
+-		}
+-	}
+-	else if(flag) _pprintLine_("        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::DeepEcho() {{{*/
+-void  OptionChar::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	OptionChar::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::DeepEcho(char* indent) {{{*/
+-void  OptionChar::DeepEcho(char* indent){
+-
+-	int   i,nstr,ipt=0;
+-	int*  dims;
+-	char  indent2[81];
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "OptionChar DeepEcho:");
+-	Option::DeepEcho(indent);
+-
+-	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
+-	strcat(indent2,"  ");
+-
+-	if (values) {
+-		if (ndims == 2 && size[0] == 1) {
+-			if(flag) _pprintLine_(indent << "        values: \"" << values << "\"");
+-		}
+-		else {
+-			nstr=size[0];
+-			for (i=2; i<ndims; i++) nstr*=size[i];
+-
+-			dims=xNew<int>(ndims);
+-			for (i=0; i<nstr; i++) {
+-				RowWiseDimsFromIndex(dims,ipt,size,ndims);
+-				StringFromDims(cstr,dims,ndims);
+-				if(flag) _pprintLine_(indent << "        values" << cstr << ": \"" << size[1] << "*s\"");
+-				ipt+=size[1];
+-			}
+-			xDelete<int>(dims);
+-		}
+-	}
+-	else if(flag) _pprintLine_(indent << "        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::Name {{{*/
+-char* OptionChar::Name(){
+-
+-	return(Option::Name());
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::NumEl {{{*/
+-int   OptionChar::NumEl(){
+-
+-	return(Option::NumEl());
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::NDims {{{*/
+-int   OptionChar::NDims(){
+-
+-	return(Option::NDims());
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::Size {{{*/
+-int*  OptionChar::Size(){
+-
+-	return(Option::Size());
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::Get(char** pvalue) {{{*/
+-void OptionChar::Get(char** pvalue){
+-
+-	char* outstring=NULL;
+-	int   stringsize;
+-
+-	stringsize=strlen(this->values)+1;
+-
+-	outstring=xNew<char>(stringsize);
+-	xMemCpy<char>(outstring,this->values,stringsize);
+-
+-	*pvalue=outstring;
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::Get(char*** ppvalue,int *pnumel) {{{*/
+-void OptionChar::Get(char*** ppvalue,int *pnumel){
+-
+-	char* outstring=NULL;
+-	int   stringsize;
+-	int   i,nstr,ipt=0;
+-
+-	/*We should first check that the size is at least one*/
+-	if(this->NumEl()<=0){
+-		_error2_("option \"" << this->name << "\" is empty and cannot return a string vector");
+-	}
+-
+-	/*Calculate the size and number of strings*/
+-	stringsize=this->size[1]+1;
+-	nstr=this->size[0];
+-	for (i=2; i<this->ndims; i++) nstr*=this->size[i];
+-
+-	/*Break concatenated string into individual strings*/
+-	*ppvalue=xNew<char*>(nstr);
+-	for (i=0; i<nstr; i++) {
+-		outstring=xNew<char>(stringsize);
+-		xMemCpy<char>(outstring,&(this->values[ipt]),(stringsize-1));
+-		outstring[stringsize-1]='\0';
+-		(*ppvalue)[i]=outstring;
+-		ipt+=stringsize-1;
+-	}
+-
+-	/*Assign output pointer*/
+-	if(numel) *pnumel=nstr;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/Option.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/Option.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/Option.cpp	(revision 12822)
+@@ -1,116 +0,0 @@
+-/*!\file Option.cpp
+- * \brief: implementation of the optionsobject abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../io/io.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION Option::Option(){{{*/
+-Option::Option(){
+-
+-	name  =NULL;
+-	numel =0;
+-	ndims =0;
+-	size  =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Option::~Option(){{{*/
+-Option::~Option(){
+-
+-	if(size) xDelete<int>(size);
+-	if(name) xDelete<char>(name);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION Option::Echo {{{*/
+-void  Option::Echo(){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("          name: \"" << name << "\"");
+-	if(flag) _pprintLine_("         numel: " << numel);
+-	if(flag) _pprintLine_("         ndims: " << ndims);
+-	if(size){
+-		StringFromSize(cstr,size,ndims);
+-		if(flag) _pprintLine_("          size: " << cstr);
+-	}
+-	else if(flag) _pprintLine_("          size: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION Option::DeepEcho() {{{*/
+-void  Option::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	Option::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Option::DeepEcho(char* indent) {{{*/
+-void  Option::DeepEcho(char* indent){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "          name: \"" << name << "\"");
+-	if(flag) _pprintLine_(indent << "         numel: " << numel);
+-	if(flag) _pprintLine_(indent << "         ndims: " << ndims);
+-	if(size){
+-		StringFromSize(cstr,size,ndims);
+-		if(flag) _pprintLine_(indent << "          size: " << cstr);
+-	}
+-	else if(flag) _pprintLine_(indent << "          size: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION Option::Name {{{*/
+-char* Option::Name(){
+-
+-	return(name);
+-}
+-/*}}}*/
+-/*FUNCTION Option::NumEl {{{*/
+-int   Option::NumEl(){
+-
+-	return(numel);
+-}
+-/*}}}*/
+-/*FUNCTION Option::NDims {{{*/
+-int   Option::NDims(){
+-
+-	return(ndims);
+-}
+-/*}}}*/
+-/*FUNCTION Option::Size {{{*/
+-int*  Option::Size(){
+-
+-	return(size);
+-}
+-/*}}}*/
+-/*FUNCTION Option::Get {{{*/
+-//void* Option::Get(){
+-
+-//	;
+-
+-//	return;
+-//}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionCell.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionCell.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionCell.cpp	(revision 12822)
+@@ -1,127 +0,0 @@
+-/*!\file OptionCell.cpp
+- * \brief: implementation of the optionscell object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION OptionCell::OptionCell(){{{*/
+-OptionCell::OptionCell(){
+-
+-	values    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::~OptionCell(){{{*/
+-OptionCell::~OptionCell(){
+-
+-	if (values){
+-		delete values;
+-		values    =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION OptionCell::Echo {{{*/
+-void  OptionCell::Echo(){
+-
+-	char cstr[81];
+-	bool flag     = true;
+-
+-	if(flag) _pprintLine_("OptionCell Echo:");
+-	Option::Echo();
+-
+-	if (values && size) {
+-		StringFromSize(cstr,size,ndims);
+-		if(flag) _pprintLine_("        values: " << cstr << " " << "cell");
+-	}
+-	else if(flag) _pprintLine_("        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::DeepEcho() {{{*/
+-void  OptionCell::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	OptionCell::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::DeepEcho(char* indent) {{{*/
+-void  OptionCell::DeepEcho(char* indent){
+-
+-	int   i;
+-	int*  dims;
+-	char  indent2[81];
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "OptionCell DeepEcho:");
+-	Option::DeepEcho(indent);
+-
+-	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
+-	strcat(indent2,"  ");
+-
+-	if (values->Size()) {
+-		dims=xNew<int>(ndims);
+-		for (i=0; i<values->Size(); i++) {
+-			ColumnWiseDimsFromIndex(dims,i,size,ndims);
+-			StringFromDims(cstr,dims,ndims);
+-			if(flag) _pprintLine_(indent << "        values: -------- begin " << cstr << " --------");
+-			((Option *)values->GetObjectByOffset(i))->DeepEcho(indent2);
+-			if(flag) _pprintLine_(indent << "        values: --------  end  " << cstr << " --------");
+-		}
+-		xDelete<int>(dims);
+-	}
+-	else if(flag) _pprintLine_(indent << "        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::Name {{{*/
+-char* OptionCell::Name(){
+-
+-	return(Option::Name());
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::NumEl {{{*/
+-int   OptionCell::NumEl(){
+-
+-	return(Option::NumEl());
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::NDims {{{*/
+-int   OptionCell::NDims(){
+-
+-	return(Option::NDims());
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::Size {{{*/
+-int*  OptionCell::Size(){
+-
+-	return(Option::Size());
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::Get(Options** pvalue) {{{*/
+-void OptionCell::Get(Options** pvalue){
+-
+-	/*Assign output pointer*/
+-	*pvalue=this->values;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionDouble.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionDouble.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionDouble.h	(revision 12822)
+@@ -1,52 +0,0 @@
+-/*! \file OptionDouble.h 
+- *  \brief: header file for optionIssmDouble object
+- */
+-
+-#ifndef _OPTIONDOUBLE_H_
+-#define _OPTIONDOUBLE_H_
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-class OptionDouble: public Option {
+-
+-	public:
+-
+-		IssmDouble* values;
+-
+-		/*OptionDouble constructors, destructors {{{*/
+-		OptionDouble();
+-		~OptionDouble();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionDoubleEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		char* Name();
+-		int   NumEl();
+-		int   NDims();
+-		int*  Size();
+-		void  Get(int* pvalue);
+-		void  Get(IssmDouble* pvalue);
+-		void  Get(bool* pvalue){  _error2_("An OptionDouble object cannot return a bool");};
+-		void  Get(char** pvalue){ _error2_("An OptionDouble object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionDouble object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int* pnumel);
+-		void  Get(Options** pvalue){ _error2_("An OptionDouble object cannot return an Options DataSet");};
+-		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionDouble object cannot return an Options DataSet vec");};
+-
+-};
+-#endif  /* _OPTIONDOUBLE_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionLogical.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionLogical.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionLogical.h	(revision 12822)
+@@ -1,52 +0,0 @@
+-/*! \file OptionLogical.h 
+- *  \brief: header file for optionlogical object
+- */
+-
+-#ifndef _OPTIONLOGICAL_H_
+-#define _OPTIONLOGICAL_H_
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-class OptionLogical: public Option {
+-
+-	public:
+-
+-		bool* values;
+-
+-		/*OptionLogical constructors, destructors {{{*/
+-		OptionLogical();
+-		~OptionLogical();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionLogicalEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		char* Name();
+-		int   NumEl();
+-		int   NDims();
+-		int*  Size();
+-		void  Get(int* pvalue){_error2_("An OptionLogical object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error2_("An OptionLogical object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue);
+-		void  Get(char** pvalue){ _error2_("An OptionLogical object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionLogical object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionLogical object cannot return a IssmDouble vec");};
+-		void  Get(Options** pvalue){ _error2_("An OptionLogical object cannot return an Options DataSet");};
+-		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionLogical object cannot return an Options DataSet vec");};
+-
+-};
+-#endif  /* _OPTIONLOGICAL_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionUtilities.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionUtilities.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionUtilities.h	(revision 12822)
+@@ -1,24 +0,0 @@
+-/*! \file OptionUtilities.h 
+- *  \brief: header file for option object utilities
+- */
+-
+-#ifndef _OPTIONUTILITIES_H_
+-#define _OPTIONUTILITIES_H_
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-int ColumnWiseDimsFromIndex(int* dims, int index, int* size, int ndims);
+-int IndexFromColumnWiseDims(int* dims, int* size, int ndims);
+-int RowWiseDimsFromIndex(int* dims, int index, int* size, int ndims);
+-int IndexFromRowWiseDims(int* dims, int* size, int ndims);
+-int StringFromDims(char* cstr, int* dims, int ndims);
+-int StringFromSize(char* cstr, int* size, int ndims);
+-
+-#endif  /* _OPTIONUTILITIES_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionChar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionChar.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionChar.h	(revision 12822)
+@@ -1,52 +0,0 @@
+-/*! \file OptionChar.h 
+- *  \brief: header file for optionchar object
+- */
+-
+-#ifndef _OPTIONCHAR_H_
+-#define _OPTIONCHAR_H_
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-class OptionChar: public Option {
+-
+-	public:
+-
+-		char* values;
+-
+-		/*OptionChar constructors, destructors {{{*/
+-		OptionChar();
+-		~OptionChar();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionCharEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		char* Name();
+-		int   NumEl();
+-		int   NDims();
+-		int*  Size();
+-		void  Get(int* pvalue){_error2_("An OptionChar object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error2_("An OptionChar object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue){  _error2_("An OptionChar object cannot return a bool");};
+-		void  Get(char** pvalue);
+-		void  Get(char*** ppvalue,int *pnumel);
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionChar object cannot return a IssmDouble vec");};
+-		void  Get(Options** pvalue){ _error2_("An OptionChar object cannot return an Options DataSet");};
+-		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionChar object cannot return an Options DataSet vec");};
+-
+-};
+-#endif  /* _OPTIONCHAR_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/Option.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/Option.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/Option.h	(revision 12822)
+@@ -1,55 +0,0 @@
+-/*! \file Option.h 
+- *  \brief: header file for option abstract object
+- */
+-
+-#ifndef _OPTIONOBJECT_H_
+-#define _OPTIONOBJECT_H_
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "../Object.h"
+-/*}}}*/
+-
+-class Option: public Object {
+-
+-	public:
+-
+-		char* name;
+-		int   numel;
+-		int   ndims;
+-		int*  size;
+-
+-		/*Option constructors, destructors {{{*/
+-		Option();
+-		~Option();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		virtual void  Echo();
+-		virtual void  DeepEcho();
+-		virtual void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		virtual char* Name()=0;
+-		virtual int   NumEl()=0;
+-		virtual int   NDims()=0;
+-		virtual int*  Size()=0;
+-		virtual void  Get(int* pvalue)=0;
+-		virtual void  Get(IssmDouble* pvalue)=0;
+-		virtual void  Get(bool* pvalue)=0;
+-		virtual void  Get(char** pvalue)=0;
+-		virtual void  Get(char*** ppvalue,int *pnumel)=0;
+-		virtual void  Get(IssmDouble** pvalue,int *pnumel)=0;
+-		virtual void  Get(Options** pvalue)=0;
+-		virtual void  Get(Options*** ppvalue,int *pnumel)=0;
+-
+-};
+-#endif  /* _OPTIONOBJECT_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionCell.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionCell.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionCell.h	(revision 12822)
+@@ -1,52 +0,0 @@
+-/*! \file OptionCell.h 
+- *  \brief: header file for optioncell object
+- */
+-
+-#ifndef _OPTIONCELL_H_
+-#define _OPTIONCELL_H_
+-
+-/*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-class OptionCell: public Option {
+-
+-	public:
+-
+-		Options* values;
+-
+-		/*OptionCell constructors, destructors {{{*/
+-		OptionCell();
+-		~OptionCell();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionCellEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		char* Name();
+-		int   NumEl();
+-		int   NDims();
+-		int*  Size();
+-		void  Get(int* pvalue){_error2_("An OptionCell object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error2_("An OptionCell object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue){  _error2_("An OptionCell object cannot return a bool");};
+-		void  Get(char** pvalue){ _error2_("An OptionCell object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionCell object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionCell object cannot return a IssmDouble vec");};
+-		void  Get(Options** pvalue);
+-		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionCell object cannot return an Options DataSet vec");};
+-
+-};
+-#endif  /* _OPTIONCELL_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionStruct.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionStruct.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Options/OptionStruct.cpp	(revision 12822)
+@@ -1,153 +0,0 @@
+-/*!\file OptionStruct.cpp
+- * \brief: implementation of the optionsstruct object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION OptionStruct::OptionStruct(){{{*/
+-OptionStruct::OptionStruct(){
+-
+-	values    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::~OptionStruct(){{{*/
+-OptionStruct::~OptionStruct(){
+-
+-	int   i;
+-
+-	if(values){
+-		for(i=0; i<numel; i++) {
+-			delete values[i];
+-			values[i] =NULL;
+-		}
+-		xDelete<Options*>(values);
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION OptionStruct::Echo {{{*/
+-void  OptionStruct::Echo(){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("OptionStruct Echo:");
+-	Option::Echo();
+-
+-	if (values && size) {
+-		StringFromSize(cstr,size,ndims);
+-		if(flag) _pprintLine_("        values: " << cstr << " " << "struct");
+-	}
+-	else if(flag) _pprintLine_("        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::DeepEcho() {{{*/
+-void  OptionStruct::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	OptionStruct::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::DeepEcho(char* indent) {{{*/
+-void  OptionStruct::DeepEcho(char* indent){
+-
+-	int   i,j;
+-	int*  dims;
+-	char  indent2[81];
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "OptionStruct DeepEcho:");
+-	Option::DeepEcho(indent);
+-
+-	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
+-	strcat(indent2,"  ");
+-
+-	if (values) {
+-		dims=xNew<int>(ndims);
+-		for (i=0; i<numel; i++) {
+-			ColumnWiseDimsFromIndex(dims,i,size,ndims);
+-			StringFromDims(cstr,dims,ndims);
+-			if (values[i]->Size()){
+-				if(flag) _pprintLine_(indent << "        values: -------- begin " << cstr << " --------");
+-				for (j=0; j<values[i]->Size(); j++) ((Option *)values[i]->GetObjectByOffset(j))->DeepEcho(indent2);
+-				if(flag) _pprintLine_(indent << "        values: --------  end  " << cstr << " --------");
+-			}
+-			else if(flag) _pprintLine_(indent << "        values: " << cstr << " [empty]");
+-		}
+-		xDelete<int>(dims);
+-	}
+-	else if(flag) _pprintLine_(indent << "        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::Name {{{*/
+-char* OptionStruct::Name(){
+-
+-	return(Option::Name());
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::NumEl {{{*/
+-int   OptionStruct::NumEl(){
+-
+-	return(Option::NumEl());
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::NDims {{{*/
+-int   OptionStruct::NDims(){
+-
+-	return(Option::NDims());
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::Size {{{*/
+-int*  OptionStruct::Size(){
+-
+-	return(Option::Size());
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::Get(Options** pvalue) {{{*/
+-void OptionStruct::Get(Options** pvalue){
+-
+-	/*We should first check that the size is one*/
+-	if(this->NumEl()!=1){
+-		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single options dataset");
+-	}
+-
+-	/*Assign output pointer*/
+-	*pvalue=this->values[0];
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::Get(Options*** ppvalue,int* numel) {{{*/
+-void OptionStruct::Get(Options*** ppvalue,int* numel){
+-
+-	/*We should first check that the size is at least one*/
+-	if(this->NumEl()<=0){
+-		_error2_("option \"" << this->name << "\" is empty and cannot return an options dataset vector");
+-	}
+-
+-	/*Assign output pointer*/
+-	*ppvalue=this->values;
+-	if(numel) *numel=this->NumEl();
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Icefront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Icefront.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Icefront.h	(revision 12822)
+@@ -1,98 +0,0 @@
+-/*!\file Icefront.h
+- * \brief: header file for icefront object
+- */
+-
+-#ifndef _ICEFRONT_H_
+-#define _ICEFRONT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Load.h"
+-class Hook;
+-class Inputs;
+-class Parameters;
+-class Matpar;
+-class Node;
+-class Element;
+-class IoModel;
+-class ElementVector;
+-/*}}}*/
+-
+-class Icefront: public Load {
+-
+-	public:
+-		int id;
+-		int analysis_type;
+-
+-		/*hooks: */
+-		Hook* hnodes;
+-		Hook* helement;
+-		Hook* hmatpar;
+-
+-		/*Corresponding fields*/
+-		Matpar   *matpar;
+-		Node    **nodes;
+-		Element  *element;
+-
+-		/*inputs and parameters: */
+-		Inputs* inputs;
+-		Parameters* parameters;
+-
+-		/*Icefront constructors, destructors: {{{*/
+-		Icefront();
+-		Icefront(int icefront_id,int i, IoModel* iomodel,int in_icefront_type, int analysis_type);
+-		~Icefront();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Update virtual functions definitions: {{{*/
+-		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVector(int* vector, int name, int type);
+-		void  InputUpdateFromVector(bool* vector, int name, int type);
+-		void  InputUpdateFromMatrixDakota(IssmDouble* matrix,int ncols,int nrows, int name, int type);
+-		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
+-		void  InputUpdateFromConstant(IssmDouble constant, int name);
+-		void  InputUpdateFromConstant(int constant, int name);
+-		void  InputUpdateFromConstant(bool constant, int name);
+-		void  InputUpdateFromSolution(IssmDouble* solution);
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
+-		/*}}}*/
+-		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+-		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff);
+-		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+-		void  PenaltyCreatePVector(Vector*  pf, IssmDouble kmax);
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax);
+-		bool  InAnalysis(int analysis_type);
+-		/*}}}*/
+-		/*Load management: {{{*/
+-		void GetDofList(int** pdoflist,int approximation_enum,int setenum);
+-		void GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[2][3]);
+-		void GetQuadNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]);
+-		#ifdef _HAVE_CONTROL_
+-		ElementVector* CreatePVectorAdjointHoriz(void);
+-		#endif
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		ElementVector* CreatePVectorDiagnosticHoriz(void);
+-		ElementVector* CreatePVectorDiagnosticMacAyeal2d(void);
+-		#endif
+-        #ifdef _HAVE_3D_
+-		ElementVector* CreatePVectorDiagnosticMacAyeal3d(void);
+-		ElementVector* CreatePVectorDiagnosticPattyn(void);
+-		ElementVector* CreatePVectorDiagnosticStokes(void);
+-	    #endif
+-		/*}}}*/
+-};
+-
+-#endif  /* _ICEFRONT_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Numericalflux.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Numericalflux.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Numericalflux.cpp	(revision 12822)
+@@ -1,880 +0,0 @@
+-/*!\file Numericalflux.c
+- * \brief: implementation of the Numericalflux object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../objects.h"
+-/*}}}*/	
+-
+-/*Load macros*/
+-#define NUMVERTICES_INTERNAL 4
+-#define NUMVERTICES_BOUNDARY 2
+-
+-/*Numericalflux constructors and destructor*/
+-/*FUNCTION Numericalflux::Numericalflux(){{{*/
+-Numericalflux::Numericalflux(){
+-	this->inputs=NULL;
+-	this->parameters=NULL;
+-	this->helement=NULL;
+-	this->element=NULL;
+-	this->hnodes=NULL;
+-	this->nodes=NULL;
+-}
+-/*}}}*/
+-/*}}}*//*FUNCTION Numericalflux::Numericalflux(int id, int i, IoModel* iomodel, int analysis_type) {{{*/
+-Numericalflux::Numericalflux(int numericalflux_id,int i, IoModel* iomodel, int in_analysis_type){
+-
+-	/* Intermediary */
+-	int  e1,e2;
+-	int  i1,i2;
+-	int  j;
+-	int  pos1,pos2,pos3,pos4;
+-	int  num_nodes;
+-	int  num_elems;
+-
+-	/*numericalflux constructor data: */
+-	int   numericalflux_elem_ids[2];
+-	int   numericalflux_mparid;
+-	int   numericalflux_node_ids[4];
+-	int   numericalflux_type;
+-
+-	int    numberofelements;
+-
+-	/*Fetch parameters: */
+-	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
+-
+-	/* Get MatPar id */
+-	numericalflux_mparid=numberofelements+1; //matlab indexing
+-
+-	/*First, see wether this is an internal or boundary edge (if e2=-1)*/
+-	if (iomodel->Data(MeshEdgesEnum)[4*i+3]==-1.){ //edges are [node1 node2 elem1 elem2]
+-		/* Boundary edge, only one element */
+-		e1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+2]);
+-		e2=reCast<int>(UNDEF);
+-		num_elems=1;
+-		num_nodes=2;
+-		numericalflux_type=BoundaryEnum;
+-		numericalflux_elem_ids[0]=e1;
+-	}
+-	else{
+-		/* internal edge: connected to 2 elements */
+-		e1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+2]);
+-		e2=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+3]);
+-		num_elems=2;
+-		num_nodes=4;
+-		numericalflux_type=InternalEnum;
+-		numericalflux_elem_ids[0]=e1;
+-		numericalflux_elem_ids[1]=e2;
+-	}
+-
+-	/*1: Get vertices ids*/
+-	i1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+0]);
+-	i2=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+1]);
+-
+-	if (numericalflux_type==InternalEnum){
+-
+-		/*Now, we must get the nodes of the 4 nodes located on the edge*/
+-
+-		/*2: Get the column where these ids are located in the index*/
+-		pos1=pos2=pos3=pos4=UNDEF;
+-		for(j=0;j<3;j++){
+-			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
+-			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
+-			if (iomodel->Data(MeshElementsEnum)[3*(e2-1)+j]==i1) pos3=j+1;
+-			if (iomodel->Data(MeshElementsEnum)[3*(e2-1)+j]==i2) pos4=j+1;
+-		}
+-		_assert_(pos1!=UNDEF && pos2!=UNDEF && pos3!=UNDEF && pos4!=UNDEF);
+-
+-		/*3: We have the id of the elements and the position of the vertices in the index
+-		 * we can compute their dofs!*/
+-		numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;
+-		numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+pos2;
+-		numericalflux_node_ids[2]=iomodel->nodecounter+3*(e2-1)+pos3;
+-		numericalflux_node_ids[3]=iomodel->nodecounter+3*(e2-1)+pos4;
+-	}
+-	else{
+-
+-		/*2: Get the column where these ids are located in the index*/
+-		pos1=pos2=UNDEF;
+-		for(j=0;j<3;j++){
+-			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
+-			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
+-		}
+-		_assert_(pos1!=UNDEF && pos2!=UNDEF);
+-
+-		/*3: We have the id of the elements and the position of the vertices in the index
+-		 * we can compute their dofs!*/
+-		numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;
+-		numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+pos2;
+-	}
+-
+-	/*Ok, we have everything to build the object: */
+-	this->id=numericalflux_id;
+-	this->analysis_type=in_analysis_type;
+-
+-	/*Hooks: */
+-	this->hnodes  =new Hook(numericalflux_node_ids,num_nodes);
+-	this->helement=new Hook(numericalflux_elem_ids,1); // take only the first element for now
+-
+-	//intialize  and add as many inputs per element as requested: 
+-	this->inputs=new Inputs();
+-	this->inputs->AddInput(new IntInput(TypeEnum,numericalflux_type));
+-
+-	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
+-	this->parameters=NULL;
+-	this->element=NULL;
+-	this->nodes=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::~Numericalflux(){{{*/
+-Numericalflux::~Numericalflux(){
+-	delete inputs;
+-	this->parameters=NULL;
+-	delete helement;
+-	delete hnodes;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Numericalflux::Echo {{{*/
+-void Numericalflux::Echo(void){
+-	_printLine_("Numericalflux:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	hnodes->Echo();
+-	helement->Echo();
+-	_printLine_("   parameters: " << parameters);
+-	_printLine_("   inputs: " << inputs);
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::DeepEcho {{{*/
+-void Numericalflux::DeepEcho(void){
+-
+-	_printLine_("Numericalflux:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	hnodes->DeepEcho();
+-	helement->DeepEcho();
+-	_printLine_("   parameters");
+-	if(parameters)
+-	 parameters->DeepEcho();
+-	else
+-	 _printLine_("      NULL");
+-	_printLine_("   inputs");
+-	inputs->DeepEcho();
+-	
+-}		
+-/*}}}*/
+-/*FUNCTION Numericalflux::Id {{{*/
+-int    Numericalflux::Id(void){
+-	return id;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::MyRank {{{*/
+-int    Numericalflux::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::ObjectEnum{{{*/
+-int Numericalflux::ObjectEnum(void){
+-
+-	return NumericalfluxEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::copy {{{*/
+-Object* Numericalflux::copy() {
+-	
+-	Numericalflux* numericalflux=NULL;
+-
+-	numericalflux=new Numericalflux();
+-
+-	/*copy fields: */
+-	numericalflux->id=this->id;
+-	numericalflux->analysis_type=this->analysis_type;
+-	if(this->inputs){
+-		numericalflux->inputs=(Inputs*)this->inputs->Copy();
+-	}
+-	else{
+-		numericalflux->inputs=new Inputs();
+-	}
+-	/*point parameters: */
+-	numericalflux->parameters=this->parameters;
+-
+-	/*now deal with hooks and objects: */
+-	numericalflux->hnodes=(Hook*)this->hnodes->copy();
+-	numericalflux->helement=(Hook*)this->helement->copy();
+-
+-	/*corresponding fields*/
+-	numericalflux->nodes  =(Node**)numericalflux->hnodes->deliverp();
+-	numericalflux->element=(Element*)numericalflux->helement->delivers();
+-
+-	return numericalflux;
+-}
+-/*}}}*/
+-
+-/*Load virtual functions definitions:*/
+-/*FUNCTION Numericalflux::Configure {{{*/
+-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: */
+-	hnodes->configure(nodesin);
+-	helement->configure(elementsin);
+-
+-	/*Initialize hooked fields*/
+-	this->nodes  =(Node**)hnodes->deliverp();
+-	this->element=(Element*)helement->delivers();
+-
+-	/*point parameters to real dataset: */
+-	this->parameters=parametersin;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::SetCurrentConfiguration {{{*/
+-void  Numericalflux::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
+-
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrix {{{*/
+-void  Numericalflux::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
+-
+-	/*recover some parameters*/
+-	ElementMatrix* Ke=NULL;
+-	int analysis_type;
+-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-		case PrognosticAnalysisEnum:
+-			Ke=CreateKMatrixPrognostic();
+-			break;
+-		case BalancethicknessAnalysisEnum:
+-			Ke=CreateKMatrixBalancethickness();
+-			break;
+-		case AdjointBalancethicknessAnalysisEnum:
+-			Ke=CreateKMatrixAdjointBalancethickness();
+-			break;
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global matrix*/
+-	if(Ke){
+-		Ke->AddToGlobal(Kff,Kfs);
+-		delete Ke;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreatePVector {{{*/
+-void  Numericalflux::CreatePVector(Vector* pf){
+-
+-	/*recover some parameters*/
+-	ElementVector* pe=NULL;
+-	int analysis_type;
+-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	switch(analysis_type){
+-		case PrognosticAnalysisEnum:
+-			pe=CreatePVectorPrognostic();
+-			break;
+-		case BalancethicknessAnalysisEnum:
+-			pe=CreatePVectorBalancethickness();
+-			break;
+-		case AdjointBalancethicknessAnalysisEnum:
+-			pe=CreatePVectorAdjointBalancethickness();
+-			break;
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global matrix*/
+-	if(pe){
+-		pe->AddToGlobal(pf);
+-		delete pe;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{*/
+-void  Numericalflux::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
+-
+-	/*No stiffness loads applied, do nothing: */
+-	return;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::PenaltyCreatePVector{{{*/
+-void  Numericalflux::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
+-
+-	/*No penalty loads applied, do nothing: */
+-	return;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::InAnalysis{{{*/
+-bool Numericalflux::InAnalysis(int in_analysis_type){
+-	if (in_analysis_type==this->analysis_type) return true;
+-	else return false;
+-}
+-/*}}}*/
+-
+-/*Numericalflux management*/
+-/*FUNCTION Numericalflux::CreateKMatrixPrognostic{{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixPrognostic(void){
+-
+-	int type;
+-	inputs->GetInputValue(&type,TypeEnum);
+-
+-	switch(type){
+-		case InternalEnum:
+-			return CreateKMatrixPrognosticInternal();
+-		case BoundaryEnum:
+-			return CreateKMatrixPrognosticBoundary();
+-		default:
+-			_error2_("type not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixPrognosticInternal {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixPrognosticInternal(void){
+-
+-	/* constants*/
+-	const int numdof=NDOF1*NUMVERTICES_INTERNAL;
+-
+-	/* Intermediaries*/
+-	int        i,j,ig,index1,index2;
+-	IssmDouble     DL1,DL2,Jdet,dt,vx,vy,UdotN;
+-	IssmDouble     xyz_list[NUMVERTICES_INTERNAL][3];
+-	IssmDouble     normal[2];
+-	IssmDouble     B[numdof];
+-	IssmDouble     Bprime[numdof];
+-	IssmDouble     Ke_g1[numdof][numdof];
+-	IssmDouble     Ke_g2[numdof][numdof];
+-	GaussTria *gauss;
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	Tria*  tria=(Tria*)element;
+-	if(tria->IsOnWater()) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES_INTERNAL,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes,NUMVERTICES_INTERNAL);
+-	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	Input* vxaverage_input=tria->inputs->GetInput(VxEnum);
+-	Input* vyaverage_input=tria->inputs->GetInput(VyEnum);
+-	GetNormal(&normal[0],xyz_list);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	index1=tria->GetNodeIndex(nodes[0]);
+-	index2=tria->GetNodeIndex(nodes[1]);
+-	gauss=new GaussTria(index1,index2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		tria->GetSegmentBFlux(&B[0],gauss,index1,index2);
+-		tria->GetSegmentBprimeFlux(&Bprime[0],gauss,index1,index2);
+-
+-		vxaverage_input->GetInputValue(&vx,gauss);
+-		vyaverage_input->GetInputValue(&vy,gauss);
+-		UdotN=vx*normal[0]+vy*normal[1];
+-		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+-		DL1=gauss->weight*Jdet*dt*UdotN/2;
+-		DL2=gauss->weight*Jdet*dt*fabs(UdotN)/2;
+-
+-		TripleMultiply(&B[0],1,numdof,1,
+-					&DL1,1,1,0,
+-					&Bprime[0],1,numdof,0,
+-					&Ke_g1[0][0],0);
+-		TripleMultiply(&B[0],1,numdof,1,
+-					&DL2,1,1,0,
+-					&B[0],1,numdof,0,
+-					&Ke_g2[0][0],0);
+-
+-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g1[i][j];
+-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g2[i][j];
+-	}
+-	
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixPrognosticBoundary {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixPrognosticBoundary(void){
+-
+-	/* constants*/
+-	const int numdof=NDOF1*NUMVERTICES_BOUNDARY;
+-
+-	/* Intermediaries*/
+-	int        i,j,ig,index1,index2;
+-	IssmDouble     DL,Jdet,dt,vx,vy,mean_vx,mean_vy,UdotN;
+-	IssmDouble     xyz_list[NUMVERTICES_BOUNDARY][3];
+-	IssmDouble     normal[2];
+-	IssmDouble     L[numdof];
+-	IssmDouble     Ke_g[numdof][numdof];
+-	GaussTria *gauss;
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	ElementMatrix* Ke = NULL;
+-	Tria*  tria=(Tria*)element;
+-	if(tria->IsOnWater()) return NULL;
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES_BOUNDARY);
+-	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	Input* vxaverage_input=tria->inputs->GetInput(VxEnum); _assert_(vxaverage_input);
+-	Input* vyaverage_input=tria->inputs->GetInput(VyEnum); _assert_(vyaverage_input);
+-	GetNormal(&normal[0],xyz_list);
+-
+-	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
+-	index1=tria->GetNodeIndex(nodes[0]);
+-	index2=tria->GetNodeIndex(nodes[1]);
+-
+-	gauss=new GaussTria();
+-	gauss->GaussEdgeCenter(index1,index2);
+-	vxaverage_input->GetInputValue(&mean_vx,gauss);
+-	vyaverage_input->GetInputValue(&mean_vy,gauss);
+-	delete gauss;
+-
+-	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
+-	if (UdotN<=0){
+-		return NULL; /*(u,n)<0 -> inflow, PenaltyCreatePVector will take care of it*/
+-	}
+-	else{
+-		Ke=new ElementMatrix(nodes,NUMVERTICES_BOUNDARY,this->parameters);
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(index1,index2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
+-
+-		vxaverage_input->GetInputValue(&vx,gauss);
+-		vyaverage_input->GetInputValue(&vy,gauss);
+-		UdotN=vx*normal[0]+vy*normal[1];
+-		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+-		DL=gauss->weight*Jdet*dt*UdotN;
+-
+-		TripleMultiply(&L[0],1,numdof,1,
+-					&DL,1,1,0,
+-					&L[0],1,numdof,0,
+-					&Ke_g[0][0],0);
+-
+-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g[i][j];
+-	} 
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixBalancethickness{{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixBalancethickness(void){
+-
+-	int type;
+-	inputs->GetInputValue(&type,TypeEnum);
+-
+-	switch(type){
+-		case InternalEnum:
+-			return CreateKMatrixBalancethicknessInternal();
+-		case BoundaryEnum:
+-			return CreateKMatrixBalancethicknessBoundary();
+-		default:
+-			_error2_("type not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixBalancethicknessInternal {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixBalancethicknessInternal(void){
+-
+-	/* constants*/
+-	const int numdof=NDOF1*NUMVERTICES_INTERNAL;
+-
+-	/* Intermediaries*/
+-	int        i,j,ig,index1,index2;
+-	IssmDouble     DL1,DL2,Jdet,vx,vy,UdotN;
+-	IssmDouble     xyz_list[NUMVERTICES_INTERNAL][3];
+-	IssmDouble     normal[2];
+-	IssmDouble     B[numdof];
+-	IssmDouble     Bprime[numdof];
+-	IssmDouble     Ke_g1[numdof][numdof];
+-	IssmDouble     Ke_g2[numdof][numdof];
+-	GaussTria *gauss;
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	Tria*  tria=(Tria*)element;
+-	if(tria->IsOnWater()) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES_INTERNAL,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes,NUMVERTICES_INTERNAL);
+-	Input* vxaverage_input=tria->inputs->GetInput(VxEnum);
+-	Input* vyaverage_input=tria->inputs->GetInput(VyEnum);
+-	GetNormal(&normal[0],xyz_list);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	index1=tria->GetNodeIndex(nodes[0]);
+-	index2=tria->GetNodeIndex(nodes[1]);
+-	gauss=new GaussTria(index1,index2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		tria->GetSegmentBFlux(&B[0],gauss,index1,index2);
+-		tria->GetSegmentBprimeFlux(&Bprime[0],gauss,index1,index2);
+-
+-		vxaverage_input->GetInputValue(&vx,gauss);
+-		vyaverage_input->GetInputValue(&vy,gauss);
+-		UdotN=vx*normal[0]+vy*normal[1];
+-		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+-		DL1=gauss->weight*Jdet*UdotN/2;
+-		DL2=gauss->weight*Jdet*fabs(UdotN)/2;
+-
+-		TripleMultiply(&B[0],1,numdof,1,
+-					&DL1,1,1,0,
+-					&Bprime[0],1,numdof,0,
+-					&Ke_g1[0][0],0);
+-		TripleMultiply(&B[0],1,numdof,1,
+-					&DL2,1,1,0,
+-					&B[0],1,numdof,0,
+-					&Ke_g2[0][0],0);
+-
+-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g1[i][j];
+-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g2[i][j];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixBalancethicknessBoundary {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixBalancethicknessBoundary(void){
+-
+-	/* constants*/
+-	const int numdof=NDOF1*NUMVERTICES_BOUNDARY;
+-
+-	/* Intermediaries*/
+-	int        i,j,ig,index1,index2;
+-	IssmDouble     DL,Jdet,vx,vy,mean_vx,mean_vy,UdotN;
+-	IssmDouble     xyz_list[NUMVERTICES_BOUNDARY][3];
+-	IssmDouble     normal[2];
+-	IssmDouble     L[numdof];
+-	IssmDouble     Ke_g[numdof][numdof];
+-	GaussTria *gauss;
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	ElementMatrix* Ke = NULL;
+-	Tria*  tria=(Tria*)element;
+-	if(tria->IsOnWater()) return NULL;
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES_BOUNDARY);
+-	Input* vxaverage_input=tria->inputs->GetInput(VxEnum);
+-	Input* vyaverage_input=tria->inputs->GetInput(VyEnum);
+-	GetNormal(&normal[0],xyz_list);
+-
+-	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
+-	index1=tria->GetNodeIndex(nodes[0]);
+-	index2=tria->GetNodeIndex(nodes[1]);
+-
+-	gauss=new GaussTria();
+-	gauss->GaussEdgeCenter(index1,index2);
+-	vxaverage_input->GetInputValue(&mean_vx,gauss);
+-	vyaverage_input->GetInputValue(&mean_vy,gauss);
+-	delete gauss;
+-
+-	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
+-	if (UdotN<=0){
+-		return NULL; /*(u,n)<0 -> inflow, PenaltyCreatePVector will take care of it*/
+-	}
+-	else{
+-		Ke=new ElementMatrix(nodes,NUMVERTICES_BOUNDARY,this->parameters);
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(index1,index2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
+-
+-		vxaverage_input->GetInputValue(&vx,gauss);
+-		vyaverage_input->GetInputValue(&vy,gauss);
+-		UdotN=vx*normal[0]+vy*normal[1];
+-		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+-		DL=gauss->weight*Jdet*UdotN;
+-
+-		TripleMultiply(&L[0],1,numdof,1,
+-					&DL,1,1,0,
+-					&L[0],1,numdof,0,
+-					&Ke_g[0][0],0);
+-
+-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g[i][j];
+-	} 
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixAdjointBalancethickness{{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethickness(void){
+-
+-	int type;
+-	inputs->GetInputValue(&type,TypeEnum);
+-
+-	switch(type){
+-		case InternalEnum:
+-			return CreateKMatrixAdjointBalancethicknessInternal();
+-		case BoundaryEnum:
+-			return CreateKMatrixAdjointBalancethicknessBoundary();
+-		default:
+-			_error2_("type not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixAdjointBalancethicknessInternal {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethicknessInternal(void){
+-
+-	ElementMatrix* Ke=CreateKMatrixBalancethicknessInternal();
+-	if (Ke) Ke->Transpose();
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixAdjointBalancethicknessBoundary {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethicknessBoundary(void){
+-
+-	ElementMatrix* Ke=CreateKMatrixBalancethicknessBoundary();
+-	if(Ke) Ke->Transpose();
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorPrognostic{{{*/
+-ElementVector* Numericalflux::CreatePVectorPrognostic(void){
+-
+-	int type;
+-	inputs->GetInputValue(&type,TypeEnum);
+-
+-	switch(type){
+-		case InternalEnum:
+-			return CreatePVectorPrognosticInternal();
+-		case BoundaryEnum:
+-			return CreatePVectorPrognosticBoundary();
+-		default:
+-			_error2_("type not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorPrognosticInternal{{{*/
+-ElementVector* Numericalflux::CreatePVectorPrognosticInternal(void){
+-
+-	/*Nothing added to PVector*/
+-	return NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorPrognosticBoundary{{{*/
+-ElementVector* Numericalflux::CreatePVectorPrognosticBoundary(void){
+-
+-	/* constants*/
+-	const int numdof=NDOF1*NUMVERTICES_BOUNDARY;
+-
+-	/* Intermediaries*/
+-	int        i,j,ig,index1,index2;
+-	IssmDouble     DL,Jdet,dt,vx,vy,mean_vx,mean_vy,UdotN,thickness;
+-	IssmDouble     xyz_list[NUMVERTICES_BOUNDARY][3];
+-	IssmDouble     normal[2];
+-	IssmDouble     L[numdof];
+-	GaussTria *gauss;
+-
+-	/*Initialize Load Vector and return if necessary*/
+-	ElementVector* pe = NULL;
+-	Tria*  tria=(Tria*)element;
+-	if(tria->IsOnWater()) return NULL;
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES_BOUNDARY);
+-	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	Input* vxaverage_input   =tria->inputs->GetInput(VxEnum);                     _assert_(vxaverage_input); 
+-	Input* vyaverage_input   =tria->inputs->GetInput(VyEnum);                     _assert_(vyaverage_input);
+-	Input* spcthickness_input=tria->inputs->GetInput(PrognosticSpcthicknessEnum); _assert_(spcthickness_input);
+-	GetNormal(&normal[0],xyz_list);
+-
+-	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
+-	index1=tria->GetNodeIndex(nodes[0]);
+-	index2=tria->GetNodeIndex(nodes[1]);
+-
+-	gauss=new GaussTria();
+-	gauss->GaussEdgeCenter(index1,index2);
+-	vxaverage_input->GetInputValue(&mean_vx,gauss);
+-	vyaverage_input->GetInputValue(&mean_vy,gauss);
+-	delete gauss;
+-
+-	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
+-	if (UdotN>0){
+-		return NULL; /*(u,n)>0 -> outflow, PenaltyCreateKMatrix will take care of it*/
+-	}
+-	else{
+-		pe=new ElementVector(nodes,NUMVERTICES_BOUNDARY,this->parameters);
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(index1,index2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
+-
+-		vxaverage_input->GetInputValue(&vx,gauss);
+-		vyaverage_input->GetInputValue(&vy,gauss);
+-		spcthickness_input->GetInputValue(&thickness,gauss);
+-		if(xIsNan<IssmDouble>(thickness)) _error2_("Cannot weakly apply constraint because NaN was provided");
+-
+-		UdotN=vx*normal[0]+vy*normal[1];
+-		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+-		DL= - gauss->weight*Jdet*dt*UdotN*thickness;
+-
+-		for(i=0;i<numdof;i++) pe->values[i] += DL*L[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorBalancethickness{{{*/
+-ElementVector* Numericalflux::CreatePVectorBalancethickness(void){
+-
+-	int type;
+-	inputs->GetInputValue(&type,TypeEnum);
+-
+-	switch(type){
+-		case InternalEnum:
+-			return CreatePVectorBalancethicknessInternal();
+-		case BoundaryEnum:
+-			return CreatePVectorBalancethicknessBoundary();
+-		default:
+-			_error2_("type not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorBalancethicknessInternal{{{*/
+-ElementVector* Numericalflux::CreatePVectorBalancethicknessInternal(void){
+-
+-	/*Nothing added to PVector*/
+-	return NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorBalancethicknessBoundary{{{*/
+-ElementVector* Numericalflux::CreatePVectorBalancethicknessBoundary(void){
+-
+-	/* constants*/
+-	const int numdof=NDOF1*NUMVERTICES_BOUNDARY;
+-
+-	/* Intermediaries*/
+-	int        i,j,ig,index1,index2;
+-	IssmDouble     DL,Jdet,vx,vy,mean_vx,mean_vy,UdotN,thickness;
+-	IssmDouble     xyz_list[NUMVERTICES_BOUNDARY][3];
+-	IssmDouble     normal[2];
+-	IssmDouble     L[numdof];
+-	GaussTria *gauss;
+-
+-	/*Initialize Load Vector and return if necessary*/
+-	ElementVector* pe = NULL;
+-	Tria*  tria=(Tria*)element;
+-	if(tria->IsOnWater()) return NULL;
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES_BOUNDARY);
+-	Input* vxaverage_input=tria->inputs->GetInput(VxEnum); _assert_(vxaverage_input); 
+-	Input* vyaverage_input=tria->inputs->GetInput(VyEnum); _assert_(vyaverage_input);
+-	Input* thickness_input=tria->inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+-	GetNormal(&normal[0],xyz_list);
+-
+-	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
+-	index1=tria->GetNodeIndex(nodes[0]);
+-	index2=tria->GetNodeIndex(nodes[1]);
+-
+-	gauss=new GaussTria();
+-	gauss->GaussEdgeCenter(index1,index2);
+-	vxaverage_input->GetInputValue(&mean_vx,gauss);
+-	vyaverage_input->GetInputValue(&mean_vy,gauss);
+-	delete gauss;
+-	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
+-	if (UdotN>0){
+-		return NULL; /*(u,n)>0 -> outflow, PenaltyCreateKMatrix will take care of it*/
+-	}
+-	else{
+-		pe=new ElementVector(nodes,NUMVERTICES_BOUNDARY,this->parameters);
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(index1,index2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
+-
+-		vxaverage_input->GetInputValue(&vx,gauss);
+-		vyaverage_input->GetInputValue(&vy,gauss);
+-		thickness_input->GetInputValue(&thickness,gauss);
+-
+-		UdotN=vx*normal[0]+vy*normal[1];
+-		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+-		DL= - gauss->weight*Jdet*UdotN*thickness;
+-
+-		for(i=0;i<numdof;i++) pe->values[i] += DL*L[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorAdjointBalancethickness{{{*/
+-ElementVector* Numericalflux::CreatePVectorAdjointBalancethickness(void){
+-
+-	/*No PVector for the Adjoint*/
+-	return NULL;
+-}
+-/*}}}*/
+-/*FUNCTION Numericalflux::GetNormal {{{*/
+-void Numericalflux:: GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]){
+-
+-	/*Build unit outward pointing vector*/
+-	IssmDouble vector[2];
+-	IssmDouble norm;
+-
+-	vector[0]=xyz_list[1][0] - xyz_list[0][0];
+-	vector[1]=xyz_list[1][1] - xyz_list[0][1];
+-
+-	norm=sqrt(pow(vector[0],2.0)+pow(vector[1],2.0));
+-
+-	normal[0]= + vector[1]/norm;
+-	normal[1]= - vector[0]/norm;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Penpair.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Penpair.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Penpair.cpp	(revision 12822)
+@@ -1,355 +0,0 @@
+-/*!\file Penpair.c
+- * \brief: implementation of the Penpair object
+- */
+-
+-/*Headers*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-/*Element macros*/
+-#define NUMVERTICES 2
+-
+-/*Penpair constructors and destructor*/
+-/*FUNCTION Penpair::constructor {{{*/
+-Penpair::Penpair(){
+-
+-	this->hnodes=NULL;
+-	this->nodes=NULL;
+-	this->parameters=NULL;
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::creation {{{*/
+-Penpair::Penpair(int penpair_id, int* penpair_node_ids,int in_analysis_type){
+-	
+-	this->id=penpair_id;
+-	this->analysis_type=in_analysis_type;
+-	this->hnodes=new Hook(penpair_node_ids,2);
+-	this->parameters=NULL;
+-	this->nodes=NULL;
+-	
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::destructor {{{*/
+-Penpair::~Penpair(){
+-	delete hnodes;
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Penpair::Echo {{{*/
+-void Penpair::Echo(void){
+-
+-	int i;
+-
+-	_printLine_("Penpair:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	hnodes->Echo();
+-	
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::DeepEcho {{{*/
+-void Penpair::DeepEcho(void){
+-
+-	_printLine_("Penpair:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	hnodes->DeepEcho();
+-
+-	return;
+-}		
+-/*}}}*/
+-/*FUNCTION Penpair::Id {{{*/
+-int    Penpair::Id(void){ return id; }
+-/*}}}*/
+-/*FUNCTION Penpair::MyRank {{{*/
+-int    Penpair::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::ObjectEnum{{{*/
+-int Penpair::ObjectEnum(void){
+-
+-	return PenpairEnum;
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::copy {{{*/
+-Object* Penpair::copy() {
+-	
+-	Penpair* penpair=NULL;
+-
+-	penpair=new Penpair();
+-
+-	/*copy fields: */
+-	penpair->id=this->id;
+-	penpair->analysis_type=this->analysis_type;
+-
+-	/*now deal with hooks and objects: */
+-	penpair->hnodes=(Hook*)this->hnodes->copy();
+-	penpair->nodes =(Node**)penpair->hnodes->deliverp();
+-
+-	/*point parameters: */
+-	penpair->parameters=this->parameters;
+-
+-	return penpair;
+-
+-}
+-/*}}}*/
+-		
+-/*Load virtual functions definitions:*/
+-/*FUNCTION Penpair::Configure {{{*/
+-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: */
+-	hnodes->configure(nodesin);
+-
+-	/*Initialize hooked fields*/
+-	this->nodes  =(Node**)hnodes->deliverp();
+-
+-	/*point parameters to real dataset: */
+-	this->parameters=parametersin;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::SetCurrentConfiguration {{{*/
+-void  Penpair::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::CreateKMatrix {{{*/
+-void  Penpair::CreateKMatrix(Matrix* Kff, Matrix* 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* pf){
+-
+-	/*No loads applied, do nothing: */
+-	return;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::CreateJacobianMatrix{{{*/
+-void  Penpair::CreateJacobianMatrix(Matrix* Jff){
+-	this->CreateKMatrix(Jff,NULL);
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::PenaltyCreateKMatrix {{{*/
+-void  Penpair::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
+-
+-	/*Retrieve parameters: */
+-	ElementMatrix* Ke=NULL;
+-	int analysis_type;
+-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	switch(analysis_type){
+-		case DiagnosticHorizAnalysisEnum:
+-			Ke=PenaltyCreateKMatrixDiagnosticHoriz(kmax);
+-			break;
+-		case PrognosticAnalysisEnum:
+-			Ke=PenaltyCreateKMatrixPrognostic(kmax);
+-			break;
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global Vector*/
+-	if(Ke){
+-		Ke->AddToGlobal(Kff,Kfs);
+-		delete Ke;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::PenaltyCreatePVector {{{*/
+-void  Penpair::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
+-	/*No loads applied, do nothing: */
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::PenaltyCreateJacobianMatrix{{{*/
+-void  Penpair::PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){
+-	this->PenaltyCreateKMatrix(Jff,NULL,kmax);
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::InAnalysis{{{*/
+-bool Penpair::InAnalysis(int in_analysis_type){
+-	if (in_analysis_type==this->analysis_type)return true;
+-	else return false;
+-}
+-/*}}}*/
+-
+-/*Update virtual functions definitions:*/
+-/*FUNCTION 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){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION 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){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::InputUpdateFromVector(int* vector, int name, int type) {{{*/
+-void  Penpair::InputUpdateFromVector(int* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
+-void  Penpair::InputUpdateFromVector(bool* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-
+-/*Penpair management:*/
+-/*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticHoriz{{{*/
+-ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticHoriz(IssmDouble kmax){
+-
+-	int    approximation0=nodes[0]->GetApproximation();
+-	int    approximation1=nodes[1]->GetApproximation();
+-
+-	switch(approximation0){
+-		case MacAyealApproximationEnum:
+-			switch(approximation1){
+-				case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
+-				case PattynApproximationEnum:   return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
+-				default: _error2_("not supported yet");
+-			}
+-		case PattynApproximationEnum:
+-			switch(approximation1){
+-				case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
+-				case PattynApproximationEnum:   return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
+-				default: _error2_("not supported yet");
+-			}
+-		case StokesApproximationEnum:
+-			switch(approximation1){
+-				case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 
+-				case NoneApproximationEnum: return   PenaltyCreateKMatrixDiagnosticStokes(kmax); 
+-				default: _error2_("not supported yet");
+-			}
+-		case NoneApproximationEnum:
+-			switch(approximation1){
+-				case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 
+-				case NoneApproximationEnum: return   PenaltyCreateKMatrixDiagnosticStokes(kmax); 
+-				default: _error2_("not supported yet");
+-			}
+-		default: _error2_("not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticMacAyealPattyn {{{*/
+-ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticMacAyealPattyn(IssmDouble kmax){
+-	
+-	const int numdof=NUMVERTICES*NDOF2;
+-	IssmDouble penalty_offset;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
+-
+-	/*recover parameters: */
+-	parameters->FindParam(&penalty_offset,DiagnosticPenaltyFactorEnum);
+-
+-	//Create elementary matrix: add penalty to 
+-	Ke->values[0*numdof+0]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[0*numdof+2]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[2*numdof+0]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[2*numdof+2]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-
+-	Ke->values[1*numdof+1]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[1*numdof+3]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[3*numdof+1]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[3*numdof+3]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-
+-	/*Clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticStokes {{{*/
+-ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticStokes(IssmDouble kmax){
+-	
+-	const int numdof=NUMVERTICES*NDOF4;
+-	IssmDouble penalty_offset;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
+-
+-	/*recover parameters: */
+-	parameters->FindParam(&penalty_offset,DiagnosticPenaltyFactorEnum);
+-
+-	//Create elementary matrix: add penalty to 
+-	Ke->values[0*numdof+0]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[0*numdof+4]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[4*numdof+0]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[4*numdof+4]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-
+-	Ke->values[1*numdof+1]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[1*numdof+5]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[5*numdof+1]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[5*numdof+5]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-	
+-	Ke->values[2*numdof+2]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[2*numdof+6]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[6*numdof+2]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[6*numdof+6]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-
+-	Ke->values[3*numdof+3]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[3*numdof+7]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[7*numdof+3]=-kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[7*numdof+7]=+kmax*pow((IssmDouble)10.0,penalty_offset);
+-
+-	/*Clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penpair::PenaltyCreateKMatrixPrognostic {{{*/
+-ElementMatrix* Penpair::PenaltyCreateKMatrixPrognostic(IssmDouble kmax){
+-
+-	const int numdof=NUMVERTICES*NDOF1;
+-	IssmDouble penalty_factor;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
+-
+-	/*recover parameters: */
+-	parameters->FindParam(&penalty_factor,PrognosticPenaltyFactorEnum);
+-
+-	//Create elementary matrix: add penalty to 
+-	Ke->values[0*numdof+0]=+kmax*pow((IssmDouble)10.0,penalty_factor);
+-	Ke->values[0*numdof+1]=-kmax*pow((IssmDouble)10.0,penalty_factor);
+-	Ke->values[1*numdof+0]=-kmax*pow((IssmDouble)10.0,penalty_factor);
+-	Ke->values[1*numdof+1]=+kmax*pow((IssmDouble)10.0,penalty_factor);
+-
+-	/*Clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Friction.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Friction.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Friction.h	(revision 12822)
+@@ -1,38 +0,0 @@
+-/*!\file Friction.h
+- * \brief: header file for friction object
+- */
+-
+-#ifndef _FRICTION_H_
+-#define _FRICTION_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-class Inputs;
+-class Matpar;
+-/*}}}*/
+-
+-class Friction{
+-
+-	public:
+-		int analysis_type;
+-
+-		char* element_type;
+-		Inputs* inputs;
+-		Matpar* matpar;
+-
+-		/*methods: */
+-		Friction();
+-		Friction(const char* element_type, Inputs* inputs,Matpar* matpar, int analysis_type);
+-		~Friction();
+-	
+-		void  Echo(void);
+-		void  GetAlpha2(IssmDouble* palpha2, GaussTria* gauss,int vxenum,int vyenum,int vzenum);
+-		void  GetAlpha2(IssmDouble* palpha2, GaussPenta* gauss,int vxenum,int vyenum,int vzenum);
+-		void  GetAlphaComplement(IssmDouble* alpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum);
+-		void  GetAlphaComplement(IssmDouble* alpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum);
+-		void  GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int enum_type);
+-		void  GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int enum_type);
+-
+-};
+-
+-#endif  /* _FRICTION_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Riftfront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Riftfront.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Riftfront.h	(revision 12822)
+@@ -1,104 +0,0 @@
+-/*!\file Riftfront.h
+- * \brief: header file for riftfront object
+- */
+-
+-#ifndef _RIFTFRONT_H_
+-#define _RIFTFRONT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Load.h"
+-class Hook;
+-class Parameters;
+-class Inputs;
+-class IoModel;
+-/*}}}*/
+-
+-class Riftfront: public Load {
+-
+-	public:
+-		int		id;
+-		int     analysis_type;
+-
+-		/*hooks: */
+-		Hook* hnodes;
+-		Hook* helements;
+-		Hook* hmatpar;
+-		
+-		/*Corresponding fields*/
+-		Matpar   *matpar;
+-		Node    **nodes;
+-		Element **elements;
+-
+-		/*computational: */
+-		int      penalty_lock;
+-		bool     active;
+-		bool     frozen;
+-		int      counter;
+-		bool     prestable;
+-		bool     material_converged;
+-		IssmDouble   normal[2];
+-		IssmDouble   length;
+-		IssmDouble   fraction;
+-		int      state;
+-		
+-		Parameters* parameters; //pointer to solution parameters
+-		Inputs*  inputs;
+-
+-
+-		/*Riftfrontconstructors,destructors: {{{*/
+-		Riftfront();
+-		Riftfront(int riftfront_id,int i, IoModel* iomodel,int analysis_type);
+-		~Riftfront();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Update virtual functions resolution: {{{*/
+-		void    InputUpdateFromVector(IssmDouble* vector, int name, int type);
+-		void    InputUpdateFromVector(int* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVector(bool* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows,int ncols, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVectorDakota(int* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVectorDakota(bool* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromConstant(IssmDouble constant, int name);
+-		void    InputUpdateFromConstant(int constant, int name){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromConstant(bool constant, int name);
+-		void    InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
+-		/*}}}*/
+-		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+-		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff){_error2_("Not implemented yet");};
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error2_("Not implemented yet");};
+-		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+-		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
+-		bool  InAnalysis(int analysis_type);
+-		/*}}}*/
+-		/*Riftfront specific routines: {{{*/
+-		bool  PreStable();
+-		ElementMatrix* PenaltyCreateKMatrixDiagnosticHoriz(IssmDouble kmax);
+-		ElementVector* PenaltyCreatePVectorDiagnosticHoriz(IssmDouble kmax);
+-		void  SetPreStable();
+-		int   PreConstrain(int* punstable);
+-		int   Constrain(int* punstable);
+-		void  FreezeConstraints(void);
+-		bool  IsFrozen(void);
+-		int   Penetration(IssmDouble* ppenetration);
+-		int   MaxPenetration(IssmDouble* ppenetration);
+-		int   PotentialUnstableConstraint(int* punstable);
+-		int   IsMaterialStable(void);
+-		bool  IsInput(int name);
+-		/*}}}*/
+-};
+-
+-#endif  /* _RIFTFRONT_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Numericalflux.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Numericalflux.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Numericalflux.h	(revision 12822)
+@@ -1,97 +0,0 @@
+-/*!\file Numericalflux.h
+- * \brief: header file for icefront object
+- */
+-
+-#ifndef _NUMERICALFLUX_H_
+-#define _NUMERICALFLUX_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Load.h"
+-class Hook;
+-class Parameters;
+-class Inputs;
+-class IoModel;
+-class ElementMatrix;
+-class ElementVector;
+-/*}}}*/
+-
+-class Numericalflux: public Load {
+-
+-	public: 
+-		int         id;
+-		int analysis_type;
+-
+-		/*Hooks*/
+-		Hook*       helement;
+-		Hook*       hnodes;
+-
+-		/*Corresponding fields*/
+-		Element* element;
+-		Node**   nodes;
+-
+-		Parameters *parameters;
+-		Inputs     *inputs;
+-
+-
+-		/*Numericalflux constructors,destructors {{{*/
+-		Numericalflux();
+-		Numericalflux(int numericalflux_id,int i, IoModel* iomodel,int analysis_type);
+-		~Numericalflux();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Update virtual functions resolution: {{{*/
+-		void    InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/}
+-		void    InputUpdateFromVector(int* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVector(bool* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/}
+-		void    InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/}
+-		void    InputUpdateFromVectorDakota(int* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVectorDakota(bool* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/};
+-		void    InputUpdateFromConstant(int constant, int name){/*Do nothing*/};
+-		void    InputUpdateFromConstant(bool constant, int name){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
+-		/*}}}*/
+-		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+-		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff){_error2_("Not implemented yet");};
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error2_("Not implemented yet");};
+-		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+-		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
+-		bool  InAnalysis(int analysis_type);
+-		/*}}}*/
+-		/*Numericalflux management:{{{*/
+-		void  GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]);
+-		ElementMatrix* CreateKMatrixPrognostic(void);
+-		ElementMatrix* CreateKMatrixPrognosticInternal(void);
+-		ElementMatrix* CreateKMatrixPrognosticBoundary(void);
+-		ElementMatrix* CreateKMatrixBalancethickness(void);
+-		ElementMatrix* CreateKMatrixBalancethicknessInternal(void);
+-		ElementMatrix* CreateKMatrixBalancethicknessBoundary(void);
+-		ElementMatrix* CreateKMatrixAdjointBalancethickness(void);
+-		ElementMatrix* CreateKMatrixAdjointBalancethicknessInternal(void);
+-		ElementMatrix* CreateKMatrixAdjointBalancethicknessBoundary(void);
+-		ElementVector* CreatePVectorPrognostic(void);
+-		ElementVector* CreatePVectorPrognosticInternal(void);
+-		ElementVector* CreatePVectorPrognosticBoundary(void);
+-		ElementVector* CreatePVectorBalancethickness(void);
+-		ElementVector* CreatePVectorBalancethicknessInternal(void);
+-		ElementVector* CreatePVectorBalancethicknessBoundary(void);
+-		ElementVector* CreatePVectorAdjointBalancethickness(void);
+-		/*}}}*/
+-
+-};
+-
+-#endif  /* _NUMERICALFLUX_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Penpair.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Penpair.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Penpair.h	(revision 12822)
+@@ -1,77 +0,0 @@
+-/*!\file Penpair.h
+- * \brief: header file for penpair object */
+-
+-#ifndef _PENPAIR_H_
+-#define _PENPAIR_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Load.h"
+-#include "../Node.h"
+-#include "../Elements/Element.h"
+-
+-class Element;
+-/*}}}*/
+-
+-class Penpair: public Load{
+-
+-	private: 
+-		int		id;
+-		int analysis_type;
+-		
+-		Hook* hnodes;  //hook to 2 nodes
+-		Node** nodes;
+-
+-		Parameters* parameters; //pointer to solution parameters
+-
+-	public:
+-
+-		/*Penpair constructors, destructors: {{{*/
+-		Penpair();
+-		Penpair(int penpair_id,int* penpair_node_ids,int analysis_type);
+-		~Penpair();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Update virtual functions resolution: {{{*/
+-		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVector(int* vector, int name, int type);
+-		void  InputUpdateFromVector(bool* vector, int name, int type);
+-		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrow, int ncols,int name, int type){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromVectorDakota(int* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromVectorDakota(bool* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromConstant(IssmDouble constant, int name);
+-		void  InputUpdateFromConstant(int constant, int name);
+-		void  InputUpdateFromConstant(bool constant, int name);
+-		void  InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
+-		/*}}}*/
+-			/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+-		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff);
+-		void  PenaltyCreateKMatrix(Matrix* Kff,Matrix* Kfs,IssmDouble kmax);
+-		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax);
+-		bool  InAnalysis(int analysis_type);
+-		/*}}}*/
+-			/*Penpair management: {{{*/
+-		ElementMatrix* PenaltyCreateKMatrixDiagnosticHoriz(IssmDouble kmax);
+-		ElementMatrix* PenaltyCreateKMatrixDiagnosticMacAyealPattyn(IssmDouble kmax);
+-		ElementMatrix* PenaltyCreateKMatrixDiagnosticStokes(IssmDouble kmax);
+-		ElementMatrix* PenaltyCreateKMatrixPrognostic(IssmDouble kmax);
+-		/*}}}*/
+-};
+-
+-#endif  /* _PENPAIR_H_ */
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Load.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Load.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Load.h	(revision 12822)
+@@ -1,40 +0,0 @@
+-/*!\file:  Load.h
+- * \brief abstract class for Load object
+- * This class is a place holder for the Icefront  and the Penpair loads.
+- * It is derived from Load, so DataSets can contain them.
+- */ 
+-
+-
+-#ifndef _LOAD_H_
+-#define _LOAD_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-class Object;
+-class Matrix;
+-class Vector;
+-
+-#include "../Object.h"
+-#include "../../toolkits/toolkits.h"
+-#include "../../Container/Container.h"
+-/*}}}*/
+-
+-class Load: public Object,public Update{
+-
+-	public: 
+-
+-		virtual       ~Load(){};
+-		
+-		/*Virtual functions: {{{*/
+-		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,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
+-		virtual void  CreateKMatrix(Matrix* Kff, Matrix* Kfs)=0;
+-		virtual void  CreatePVector(Vector* pf)=0;
+-		virtual void  CreateJacobianMatrix(Matrix* Jff)=0;
+-		virtual void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax)=0;
+-		virtual void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, IssmDouble kmax)=0;
+-		virtual void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax)=0;
+-		virtual bool  InAnalysis(int analysis_type)=0;
+-		/*}}}*/
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Pengrid.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Pengrid.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Pengrid.cpp	(revision 12822)
+@@ -1,620 +0,0 @@
+-/*!\file Pengrid.c
+- * \brief: implementation of the Pengrid object
+- */
+-
+-/*Headers*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-/*}}}*/
+-	
+-/*Element macros*/
+-#define NUMVERTICES   1
+-
+-/*Pengrid constructors and destructor*/
+-/*FUNCTION Pengrid::Pengrid(){{{*/
+-Pengrid::Pengrid(){
+-	this->inputs=NULL;
+-	this->parameters=NULL;
+-	this->hnode=NULL;
+-	this->node=NULL;
+-	this->helement=NULL;
+-	this->element=NULL;
+-	this->hmatpar=NULL;
+-	this->matpar=NULL;
+-	
+-	/*not active, not zigzagging: */
+-	active=0;
+-	zigzag_counter=0;
+-
+-}
+-/*}}}*/
+-/*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
+-
+-	int i,j;
+-	int pengrid_node_id;
+-	int pengrid_matpar_id;
+-	int pengrid_element_id;
+-
+-	int numberofvertices;
+-	int numberofelements;
+-
+-	/*Fetch parameters: */
+-	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
+-	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
+-
+-	/*Some checks if debugging activated*/
+-	_assert_(iomodel->singlenodetoelementconnectivity);
+-	_assert_(index>=0 && index<numberofvertices);
+-	_assert_(id);
+-
+-	/*id: */
+-	this->id=id;
+-	this->analysis_type=in_analysis_type;
+-	
+-	/*hooks: */
+-	pengrid_node_id=iomodel->nodecounter+index+1;
+-	pengrid_element_id=iomodel->singlenodetoelementconnectivity[index];
+-	_assert_(pengrid_element_id);
+-	pengrid_matpar_id=numberofelements+1; //refers to the constant material parameters object
+-
+-	this->hnode=new Hook(&pengrid_node_id,1);
+-	this->helement=new Hook(&pengrid_element_id,1);
+-	this->hmatpar=new Hook(&pengrid_matpar_id,1);
+-
+-	//initialize inputs: none needed
+-	this->inputs=new Inputs();
+-
+-	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
+-	this->parameters=NULL;
+-	this->node=NULL;
+-	this->element=NULL;
+-	this->matpar=NULL;
+-
+-	//let's not forget internals
+-	this->active=0;
+-	this->zigzag_counter=0;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::~Pengrid(){{{*/
+-Pengrid::~Pengrid(){
+-	delete inputs;
+-	delete hnode;
+-	delete helement;
+-	delete hmatpar;
+-	return;
+-}
+-/*}}}*/
+-			
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Pengrid::Echo {{{*/
+-void Pengrid::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::DeepEcho{{{*/
+-void Pengrid::DeepEcho(void){
+-
+-	_printLine_("Pengrid:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	hnode->DeepEcho();
+-	helement->DeepEcho();
+-	hmatpar->DeepEcho();
+-	_printLine_("   active " << this->active);
+-	_printLine_("   zigzag_counter " << this->zigzag_counter);
+-	_printLine_("   parameters");
+-	parameters->DeepEcho();
+-	_printLine_("   inputs");
+-	inputs->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::Id {{{*/
+-int    Pengrid::Id(void){ return id; }
+-/*}}}*/
+-/*FUNCTION Pengrid::MyRank {{{*/
+-int    Pengrid::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::ObjectEnum{{{*/
+-int Pengrid::ObjectEnum(void){
+-
+-	return PengridEnum;
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::copy {{{*/
+-Object* Pengrid::copy() {
+-	
+-	Pengrid* pengrid=NULL;
+-
+-	pengrid=new Pengrid();
+-
+-	/*copy fields: */
+-	pengrid->id=this->id;
+-	pengrid->analysis_type=this->analysis_type;
+-	if(this->inputs){
+-		pengrid->inputs=(Inputs*)this->inputs->Copy();
+-	}
+-	else{
+-		pengrid->inputs=new Inputs();
+-	}
+-	/*point parameters: */
+-	pengrid->parameters=this->parameters;
+-
+-	/*now deal with hooks and objects: */
+-	pengrid->hnode=(Hook*)this->hnode->copy();
+-	pengrid->hmatpar=(Hook*)this->hmatpar->copy();
+-	pengrid->helement=(Hook*)this->helement->copy();
+-
+-	/*corresponding fields*/
+-	pengrid->node  =(Node*)pengrid->hnode->delivers();
+-	pengrid->matpar =(Matpar*)pengrid->hmatpar->delivers();
+-	pengrid->element=(Element*)pengrid->helement->delivers();
+-
+-	//let's not forget internals
+-	pengrid->active=this->active=0;
+-	pengrid->zigzag_counter=this->zigzag_counter=0;
+-
+-	return pengrid;
+-
+-}
+-/*}}}*/
+-
+-/*Load virtual functions definitions:*/
+-/*FUNCTION Pengrid::Configure {{{*/
+-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: */
+-	hnode->configure(nodesin);
+-	helement->configure(elementsin);
+-	hmatpar->configure(materialsin);
+-
+-	/*Get corresponding fields*/
+-	node=(Node*)hnode->delivers();
+-	element=(Element*)helement->delivers();
+-	matpar=(Matpar*)hmatpar->delivers();
+-
+-	/*point parameters to real dataset: */
+-	this->parameters=parametersin;
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::SetCurrentConfiguration {{{*/
+-void  Pengrid::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
+-
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::CreateKMatrix {{{*/
+-void  Pengrid::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
+-
+-	/*No loads applied, do nothing: */
+-	return;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::CreatePVector {{{*/
+-void  Pengrid::CreatePVector(Vector* pf){
+-
+-	/*No loads applied, do nothing: */
+-	return;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreateMatrix {{{*/
+-void  Pengrid::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
+-
+-	/*Retrieve parameters: */
+-	ElementMatrix* Ke=NULL;
+-	int analysis_type;
+-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	switch(analysis_type){
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		case DiagnosticHorizAnalysisEnum: case AdjointHorizAnalysisEnum:
+-			Ke=PenaltyCreateKMatrixDiagnosticStokes(kmax);
+-			break;
+-		#endif
+-		#ifdef _HAVE_THERMAL_
+-		case ThermalAnalysisEnum:
+-			Ke=PenaltyCreateKMatrixThermal(kmax);
+-			break;
+-		case MeltingAnalysisEnum:
+-			Ke=PenaltyCreateKMatrixMelting(kmax);
+-			break;
+-		#endif
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global matrix*/
+-	if(Ke){
+-		Ke->AddToGlobal(Kff,Kfs);
+-		delete Ke;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreatePVector {{{*/
+-void  Pengrid::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
+-
+-	/*Retrieve parameters: */
+-	ElementVector* pe=NULL;
+-	int analysis_type;
+-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	switch(analysis_type){
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		case ThermalAnalysisEnum:
+-			pe=PenaltyCreatePVectorThermal(kmax);
+-			break;
+-		#endif
+-		#ifdef _HAVE_THERMAL_
+-		case MeltingAnalysisEnum:
+-			pe=PenaltyCreatePVectorMelting(kmax);
+-			break;
+-		case DiagnosticHorizAnalysisEnum: case AdjointHorizAnalysisEnum:
+-			break;
+-		#endif
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global Vector*/
+-	if(pe){
+-		pe->AddToGlobal(pf);
+-		delete pe;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::InAnalysis{{{*/
+-bool Pengrid::InAnalysis(int in_analysis_type){
+-	if (in_analysis_type==this->analysis_type)return true;
+-	else return false;
+-}
+-/*}}}*/
+-
+-/*Update virtual functions definitions:*/
+-/*FUNCTION Pengrid::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
+-void  Pengrid::InputUpdateFromVector(IssmDouble* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromVector(int* vector, int name, int type) {{{*/
+-void  Pengrid::InputUpdateFromVector(int* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
+-void  Pengrid::InputUpdateFromVector(bool* 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){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type) {{{*/
+-void  Pengrid::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromVectorDakota(int* vector, int name, int type) {{{*/
+-void  Pengrid::InputUpdateFromVectorDakota(int* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromVectorDakota(bool* vector, int name, int type) {{{*/
+-void  Pengrid::InputUpdateFromVectorDakota(bool* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromConstant(IssmDouble constant, int name) {{{*/
+-void  Pengrid::InputUpdateFromConstant(IssmDouble constant, int name){
+-	switch(name){
+-
+-		case MeltingOffsetEnum:
+-			inputs->AddInput(new DoubleInput(name,constant));
+-			return;
+-
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION 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){
+-
+-	switch(name){
+-
+-		case ResetPenaltiesEnum:
+-			if (constant) zigzag_counter=0;
+-			return;
+-
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromSolution{{{*/
+-void  Pengrid::InputUpdateFromSolution(IssmDouble* solution){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/		
+-
+-/*Pengrid management:*/
+-/*FUNCTION Pengrid::ConstraintActivate {{{*/
+-void  Pengrid::ConstraintActivate(int* punstable){
+-
+-	int analysis_type;
+-
+-	/*Retrieve parameters: */
+-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	if (analysis_type==DiagnosticHorizAnalysisEnum){
+-		/*No penalty to check*/
+-		return;
+-	}
+-	else if (analysis_type==ThermalAnalysisEnum){
+-		ConstraintActivateThermal(punstable);
+-	}
+-	else if (analysis_type==MeltingAnalysisEnum){
+-		/*No penalty to check*/
+-		return;
+-	}
+-	else{
+-		_error2_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::ConstraintActivateThermal {{{*/
+-void  Pengrid::ConstraintActivateThermal(int* punstable){
+-
+-	//   The penalty is stable if it doesn't change during to successive iterations.   
+-
+-	int    found=0;
+-	const int numnodes=1;
+-	IssmDouble pressure;
+-	IssmDouble temperature;
+-	IssmDouble t_pmp;
+-	int    new_active;
+-	int    unstable=0;
+-	int    reset_penalties=0;
+-	int    penalty_lock;
+-
+-	/*recover pointers: */
+-	Penta* penta=(Penta*)element;
+-	
+-	/*check that pengrid is not a clone (penalty to be added only once)*/
+-	if (node->IsClone()){
+-		unstable=0;
+-		*punstable=unstable;
+-		return;
+-	}
+-
+-	//First recover pressure and temperature values, using the element: */
+-	penta->GetInputValue(&pressure,node,PressureEnum);
+-	penta->GetInputValue(&temperature,node,TemperaturePicardEnum);
+-
+-	//Recover our data:
+-	parameters->FindParam(&penalty_lock,ThermalPenaltyLockEnum);
+-	
+-	//Compute pressure melting point
+-	t_pmp=matpar->TMeltingPoint(pressure);
+-
+-	//Figure out if temperature is over melting_point, in which case, this penalty needs to be activated.
+-
+-	if (temperature>t_pmp){
+-		new_active=1;
+-	}
+-	else{
+-		new_active=0;
+-	}
+-
+-
+-	//Figure out stability of this penalty
+-	if (active==new_active){
+-		unstable=0;
+-	}
+-	else{
+-		unstable=1;
+-		if(penalty_lock)zigzag_counter++;
+-	}
+-
+-	/*If penalty keeps zigzagging more than 5 times: */
+-	if(penalty_lock){
+-		if(zigzag_counter>penalty_lock){
+-			unstable=0;
+-			active=1;
+-		}
+-	}
+-
+-	//Set penalty flag
+-	active=new_active;
+-
+-	//*Assign output pointers:*/
+-	*punstable=unstable;
+-}
+-/*}}}*/
+-#ifdef _HAVE_DIAGNOSTIC_
+-/*FUNCTION Pengrid::PenaltyCreateKMatrixDiagnosticStokes {{{*/
+-ElementMatrix* Pengrid::PenaltyCreateKMatrixDiagnosticStokes(IssmDouble kmax){
+-	
+-	const int numdof = NUMVERTICES *NDOF4;
+-	IssmDouble    slope[2];
+-	IssmDouble    penalty_offset;
+-	int       approximation;
+-
+-	Penta* penta=(Penta*)element;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	penta->inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(approximation!=StokesApproximationEnum &&  approximation!=PattynStokesApproximationEnum) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(&node,1,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	parameters->FindParam(&penalty_offset,DiagnosticPenaltyFactorEnum);
+-	penta->GetInputValue(&slope[0],node,BedSlopeXEnum);
+-	penta->GetInputValue(&slope[1],node,BedSlopeYEnum);
+-
+-	/*Create elementary matrix: add penalty to constrain wb (wb=ub*db/dx+vb*db/dy)*/
+-	Ke->values[2*NDOF4+0]=-slope[0]*kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[2*NDOF4+1]=-slope[1]*kmax*pow((IssmDouble)10.0,penalty_offset);
+-	Ke->values[2*NDOF4+2]= kmax*pow((IssmDouble)10,penalty_offset);
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,&node,NUMVERTICES,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-#endif
+-#ifdef _HAVE_THERMAL_
+-/*FUNCTION Pengrid::PenaltyCreateKMatrixMelting {{{*/
+-ElementMatrix* Pengrid::PenaltyCreateKMatrixMelting(IssmDouble kmax){
+-
+-	const int numdof=NUMVERTICES*NDOF1;
+-	IssmDouble pressure,temperature,t_pmp;
+-	IssmDouble penalty_factor;
+-
+-	Penta* penta=(Penta*)element;
+-
+-	/*check that pengrid is not a clone (penalty to be added only once)*/
+-	if (node->IsClone()) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(&node,1,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	penta->GetInputValue(&pressure,node,PressureEnum);
+-	penta->GetInputValue(&temperature,node,TemperatureEnum);
+-	parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
+-	
+-	/*Compute pressure melting point*/
+-	t_pmp=matpar->GetMeltingPoint()-matpar->GetBeta()*pressure;
+-
+-	/*Add penalty load*/
+-	if (temperature<t_pmp){ //If T<Tpmp, there must be no melting. Therefore, melting should be  constrained to 0 when T<Tpmp, instead of using spcs, use penalties
+-		Ke->values[0]=kmax*pow((IssmDouble)10,penalty_factor);
+-	}
+-
+-	/*Clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreateKMatrixThermal {{{*/
+-ElementMatrix* Pengrid::PenaltyCreateKMatrixThermal(IssmDouble kmax){
+-
+-	const int numdof=NUMVERTICES*NDOF1;
+-	IssmDouble    penalty_factor;
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	if(!this->active) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(&node,NUMVERTICES,this->parameters);
+-
+-	/*recover parameters: */
+-	parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
+-
+-	Ke->values[0]=kmax*pow((IssmDouble)10,penalty_factor);
+-
+-	/*Clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreatePVectorMelting {{{*/
+-ElementVector* Pengrid::PenaltyCreatePVectorMelting(IssmDouble kmax){
+-	
+-	const int numdof=NUMVERTICES*NDOF1;
+-	IssmDouble pressure;
+-	IssmDouble temperature;
+-	IssmDouble melting_offset;
+-	IssmDouble t_pmp;
+-	IssmDouble dt,penalty_factor;
+-
+-	/*recover pointers: */
+-	Penta* penta=(Penta*)element;
+-
+-	/*check that pengrid is not a clone (penalty to be added only once)*/
+-	if (node->IsClone()) return NULL;
+-	ElementVector* pe=new ElementVector(&node,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	penta->GetInputValue(&pressure,node,PressureEnum);
+-	penta->GetInputValue(&temperature,node,TemperatureEnum);
+-	inputs->GetInputValue(&melting_offset,MeltingOffsetEnum);
+-	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
+-
+-	/*Compute pressure melting point*/
+-	t_pmp=matpar->GetMeltingPoint()-matpar->GetBeta()*pressure;
+-
+-	/*Add penalty load
+-	  This time, the penalty must have the same value as the one used for the thermal computation
+-	  so that the corresponding melting can be computed correctly
+-	  In the thermal computation, we used kmax=melting_offset, and the same penalty_factor*/
+-	if (temperature<t_pmp){ //%no melting
+-		pe->values[0]=0;
+-	}
+-	else{
+-		if (dt) pe->values[0]=melting_offset*pow((IssmDouble)10,penalty_factor)*(temperature-t_pmp)/dt;
+-		else    pe->values[0]=melting_offset*pow((IssmDouble)10,penalty_factor)*(temperature-t_pmp);
+-	}
+-
+-	/*Clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreatePVectorThermal {{{*/
+-ElementVector* Pengrid::PenaltyCreatePVectorThermal(IssmDouble kmax){
+-
+-	const int numdof=NUMVERTICES*NDOF1;
+-	IssmDouble pressure;
+-	IssmDouble t_pmp;
+-	IssmDouble penalty_factor;
+-
+-	Penta* penta=(Penta*)element;
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	if(!this->active) return NULL;
+-	ElementVector* pe=new ElementVector(&node,1,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	penta->GetInputValue(&pressure,node,PressureEnum);
+-	parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
+-
+-	/*Compute pressure melting point*/
+-	t_pmp=matpar->GetMeltingPoint()-matpar->GetBeta()*pressure;
+-
+-	pe->values[0]=kmax*pow((IssmDouble)10,penalty_factor)*t_pmp;
+-
+-	/*Clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-#endif
+-/*FUNCTION Pengrid::ResetConstraint {{{*/
+-void  Pengrid::ResetConstraint(void){
+-	active=0;
+-	zigzag_counter=0;
+-}
+-/*}}}*/
+-/*FUNCTION Pengrid::UpdateInputs {{{*/
+-void  Pengrid::UpdateInputs(IssmDouble* solution){
+-	_error2_("not supported yet!");
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Icefront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Icefront.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Icefront.cpp	(revision 12822)
+@@ -1,743 +0,0 @@
+-/*!\file Icefront.c
+- * \brief: implementation of the Icefront object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-/*}}}*/	
+-
+-/*Load macros*/
+-#define NUMVERTICESSEG 2
+-#define NUMVERTICESQUA 4
+-
+-/*Icefront constructors and destructor*/
+-/*FUNCTION Icefront::Icefront() {{{*/
+-Icefront::Icefront(){
+-
+-	this->inputs=NULL;
+-	this->parameters=NULL;
+-
+-	this->hnodes=NULL;
+-	this->nodes= NULL;
+-	this->helement=NULL;
+-	this->element= NULL;
+-	this->hmatpar=NULL;
+-	this->matpar= NULL;
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::Icefront(int id, int i, IoModel* iomodel,int analysis_type) {{{*/
+-Icefront::Icefront(int icefront_id,int i, IoModel* iomodel,int in_icefront_type, int in_analysis_type){
+-
+-	int segment_width;
+-	int element;
+-	int num_nodes; 
+-	int dim;
+-	int numberofelements;
+-
+-	/*icefront constructor data: */
+-	int  icefront_eid;
+-	int  icefront_mparid;
+-	int  icefront_node_ids[NUMVERTICESQUA]; //initialize with largest size
+-	int  icefront_fill;
+-	
+-	/*find parameters: */
+-	iomodel->Constant(&dim,MeshDimensionEnum);
+-	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
+-
+-	/*First, retrieve element index and element type: */
+-	if (dim==2){
+-		segment_width=4;
+-	}
+-	else{
+-		segment_width=6;
+-	}
+-	_assert_(iomodel->Data(DiagnosticIcefrontEnum));
+-	element=reCast<int,IssmDouble>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)
+-
+-	/*Build ids for hook constructors: */
+-	icefront_eid=reCast<int,IssmDouble>( *(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+segment_width-2)); //matlab indexing
+-	icefront_mparid=numberofelements+1; //matlab indexing
+-
+-	if (in_icefront_type==MacAyeal2dIceFrontEnum || in_icefront_type==MacAyeal3dIceFrontEnum){
+-		icefront_node_ids[0]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
+-		icefront_node_ids[1]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
+-	}
+-	else if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum){
+-		icefront_node_ids[0]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
+-		icefront_node_ids[1]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
+-		icefront_node_ids[2]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2));
+-		icefront_node_ids[3]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3));
+-	}
+-	else _error2_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!");
+-
+-	if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum)
+-	 num_nodes=4;
+-	else 
+-	 num_nodes=2;
+-
+-	/*Fill*/
+-	icefront_fill=reCast<int>(iomodel->Data(DiagnosticIcefrontEnum)[segment_width*i+segment_width-1]);
+-	
+-	/*Ok, we have everything to build the object: */
+-	this->id=icefront_id;
+-	this->analysis_type=in_analysis_type;
+-
+-	/*Hooks: */
+-	this->hnodes=new Hook(icefront_node_ids,num_nodes);
+-	this->helement=new Hook(&icefront_eid,1);
+-	this->hmatpar=new Hook(&icefront_mparid,1);
+-
+-	//intialize  and add as many inputs per element as requested: 
+-	this->inputs=new Inputs();
+-	this->inputs->AddInput(new IntInput(FillEnum,icefront_fill));
+-	this->inputs->AddInput(new IntInput(TypeEnum,in_icefront_type));
+-	
+-	//parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
+-	this->parameters=NULL;
+-	this->nodes= NULL;
+-	this->element= NULL;
+-	this->matpar= NULL;
+-}
+-
+-
+-/*}}}*/
+-/*FUNCTION Icefront::~Icefront() {{{*/
+-Icefront::~Icefront(){
+-	delete inputs;
+-	this->parameters=NULL;
+-	delete hnodes;
+-	delete helement;
+-	delete hmatpar;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Icefront::Echo {{{*/
+-void Icefront::Echo(void){
+-	_printLine_("Icefront:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	hnodes->Echo();
+-	helement->Echo();
+-	hmatpar->Echo();
+-	_printLine_("   parameters: " << parameters);
+-	if(parameters)parameters->Echo();
+-	_printLine_("   inputs: " << inputs);
+-	if(inputs)inputs->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::DeepEcho{{{*/
+-void Icefront::DeepEcho(void){
+-
+-	_printLine_("Icefront:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	hnodes->DeepEcho();
+-	helement->DeepEcho();
+-	hmatpar->DeepEcho();
+-	_printLine_("   parameters: " << parameters);
+-	if(parameters)parameters->DeepEcho();
+-	_printLine_("   inputs: " << inputs);
+-	if(inputs)inputs->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::Id {{{*/
+-int    Icefront::Id(void){ return id; }
+-/*}}}*/
+-/*FUNCTION Icefront::MyRank {{{*/
+-int    Icefront::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::ObjectEnum{{{*/
+-int Icefront::ObjectEnum(void){
+-
+-	return IcefrontEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::copy {{{*/
+-Object* Icefront::copy() {
+-	
+-	Icefront* icefront=NULL;
+-
+-	icefront=new Icefront();
+-
+-	/*copy fields: */
+-	icefront->id=this->id;
+-	icefront->analysis_type=this->analysis_type;
+-	if(this->inputs){
+-		icefront->inputs=(Inputs*)this->inputs->Copy();
+-	}
+-	else{
+-		icefront->inputs=new Inputs();
+-	}
+-	/*point parameters: */
+-	icefront->parameters=this->parameters;
+-
+-	/*now deal with hooks and objects: */
+-	icefront->hnodes=(Hook*)this->hnodes->copy();
+-	icefront->helement=(Hook*)this->helement->copy();
+-	icefront->hmatpar=(Hook*)this->hmatpar->copy();
+-
+-	/*corresponding fields*/
+-	icefront->nodes  =(Node**)icefront->hnodes->deliverp();
+-	icefront->element=(Element*)icefront->helement->delivers();
+-	icefront->matpar =(Matpar*)icefront->hmatpar->delivers();
+-
+-	return icefront;
+-
+-}
+-/*}}}*/
+-
+-/*Load virtual functions definitions:*/
+-/*FUNCTION Icefront::Configure {{{*/
+-void  Icefront::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: */
+-	hnodes->configure(nodesin);
+-	helement->configure(elementsin);
+-	hmatpar->configure(materialsin);
+-
+-	/*Initialize hooked fields*/
+-	this->nodes  =(Node**)hnodes->deliverp();
+-	this->element=(Element*)helement->delivers();
+-	this->matpar =(Matpar*)hmatpar->delivers();
+-
+-	/*point parameters to real dataset: */
+-	this->parameters=parametersin;
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::SetCurrentConfiguration {{{*/
+-void  Icefront::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::CreateKMatrix {{{*/
+-void  Icefront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
+-
+-	/*No stiffness loads applied, do nothing: */
+-	return;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::CreatePVector {{{*/
+-void  Icefront::CreatePVector(Vector* pf){
+-
+-	/*Checks in debugging mode*/
+-	/*{{{*/
+-	_assert_(nodes);
+-	_assert_(element);
+-	_assert_(matpar);
+-	/*}}}*/
+-
+-	/*Retrieve parameters: */
+-	ElementVector* pe=NULL;
+-	int analysis_type;
+-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*Just branch to the correct element icefront vector generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		case DiagnosticHorizAnalysisEnum:
+-			pe=CreatePVectorDiagnosticHoriz();
+-			break;
+-		#endif
+-		#ifdef _HAVE_CONTROL_
+-		case AdjointHorizAnalysisEnum:
+-			pe=CreatePVectorAdjointHoriz();
+-			break;
+-		#endif
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global Vector*/
+-	if(pe){
+-		pe->AddToGlobal(pf);
+-		delete pe;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::CreateJacobianMatrix{{{*/
+-void  Icefront::CreateJacobianMatrix(Matrix* Jff){
+-	this->CreateKMatrix(Jff,NULL);
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::PenaltyCreateKMatrix {{{*/
+-void  Icefront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, IssmDouble kmax){
+-	/*do nothing: */
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::PenaltyCreatePVector{{{*/
+-void  Icefront::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
+-	/*do nothing: */
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::PenaltyCreateJacobianMatrix{{{*/
+-void  Icefront::PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){
+-	this->PenaltyCreateKMatrix(Jff,NULL,kmax);
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InAnalysis{{{*/
+-bool Icefront::InAnalysis(int in_analysis_type){
+-	if (in_analysis_type==this->analysis_type)return true;
+-	else return false;
+-}
+-/*}}}*/
+-
+-/*Update virtual functions definitions:*/
+-/*FUNCTION Icefront::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
+-void  Icefront::InputUpdateFromVector(IssmDouble* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InputUpdateFromVector(int* vector, int name, int type) {{{*/
+-void  Icefront::InputUpdateFromVector(int* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
+-void  Icefront::InputUpdateFromVector(bool* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type) {{{*/
+-void  Icefront::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type) {{{*/
+-void  Icefront::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InputUpdateFromVectorDakota(int* vector, int name, int type) {{{*/
+-void  Icefront::InputUpdateFromVectorDakota(int* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InputUpdateFromVectorDakota(bool* vector, int name, int type) {{{*/
+-void  Icefront::InputUpdateFromVectorDakota(bool* vector, int name, int type){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InputUpdateFromConstant(IssmDouble constant, int name) {{{*/
+-void  Icefront::InputUpdateFromConstant(IssmDouble constant, int name){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InputUpdateFromConstant(int constant, int name) {{{*/
+-void  Icefront::InputUpdateFromConstant(int constant, int name){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InputUpdateFromConstant(bool constant, int name) {{{*/
+-void  Icefront::InputUpdateFromConstant(bool constant, int name){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::InputUpdateFromSolution{{{*/
+-void  Icefront::InputUpdateFromSolution(IssmDouble* solution){
+-	/*Nothing updated yet*/
+-}
+-/*}}}*/
+-
+-/*Icefront numerics: */
+-#ifdef _HAVE_DIAGNOSTIC_
+-/*FUNCTION Icefront::CreatePVectorDiagnosticHoriz {{{*/
+-ElementVector* Icefront::CreatePVectorDiagnosticHoriz(void){
+-
+-	int type;
+-	inputs->GetInputValue(&type,TypeEnum);
+-
+-	switch(type){
+-		case MacAyeal2dIceFrontEnum:
+-			return CreatePVectorDiagnosticMacAyeal2d();
+-        #ifdef _HAVE_3D_
+-		case MacAyeal3dIceFrontEnum:
+-			return CreatePVectorDiagnosticMacAyeal3d();
+-		case PattynIceFrontEnum:
+-			return CreatePVectorDiagnosticPattyn();
+-		case StokesIceFrontEnum:
+-			return CreatePVectorDiagnosticStokes();
+-	    #endif
+-		default:
+-			_error2_("Icefront type " << EnumToStringx(type) << " not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::CreatePVectorDiagnosticMacAyeal2d{{{*/
+-ElementVector* Icefront::CreatePVectorDiagnosticMacAyeal2d(void){
+-
+-	/*Constants*/
+-	const int numnodes= NUMVERTICESSEG;
+-	const int numdofs = numnodes *NDOF2;
+-
+-	/*Intermediary*/
+-	int        ig,index1,index2,fill;
+-	IssmDouble     Jdet;
+-	IssmDouble     thickness,bed,pressure,ice_pressure,rho_water,rho_ice,gravity;
+-	IssmDouble     water_pressure,air_pressure,surface_under_water,base_under_water;
+-	IssmDouble     xyz_list[numnodes][3];
+-	IssmDouble     normal[2];
+-	IssmDouble     L[2];
+-	GaussTria *gauss;
+-
+-	Tria* tria=((Tria*)element);
+-
+-	/*Initialize Element vector and return if necessary*/
+-	if(tria->IsOnWater()) return NULL;
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICESSEG,this->parameters,MacAyealApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0],nodes,numnodes);
+-	Input* thickness_input=tria->inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+-	Input* bed_input      =tria->inputs->GetInput(BedEnum);       _assert_(bed_input);
+-	inputs->GetInputValue(&fill,FillEnum);
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice  =matpar->GetRhoIce();
+-	gravity  =matpar->GetG();
+-	GetSegmentNormal(&normal[0],xyz_list);
+-
+-	/*Start looping on Gaussian points*/
+-	index1=tria->GetNodeIndex(nodes[0]);
+-	index2=tria->GetNodeIndex(nodes[1]);
+-	gauss=new GaussTria(index1,index2,3);
+-
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		thickness_input->GetInputValue(&thickness,gauss);
+-		bed_input->GetInputValue(&bed,gauss);
+-
+-		switch(fill){
+-			case WaterEnum:
+-				surface_under_water=min(0.,thickness+bed); // 0 if the top of the glacier is above water level
+-				base_under_water=min(0.,bed);              // 0 if the bottom of the glacier is above water level
+-				water_pressure=1.0/2.0*gravity*rho_water*(pow(surface_under_water,2) - pow(base_under_water,2));
+-				break;
+-			case AirEnum:
+-				water_pressure=0;
+-				break;
+-			case IceEnum:
+-				water_pressure=-1.0/2.0*gravity*rho_ice*pow(thickness,2); // we are facing a wall of ice. use water_pressure to cancel the lithostatic pressure.
+-				break;
+-			default:
+-				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
+-		}
+-		ice_pressure=1.0/2.0*gravity*rho_ice*pow(thickness,2);
+-		air_pressure=0;
+-		pressure = ice_pressure + water_pressure + air_pressure;
+-
+-		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
+-
+-		for (int i=0;i<numnodes;i++){
+-			pe->values[2*i+0]+= pressure*Jdet*gauss->weight*normal[0]*L[i];
+-			pe->values[2*i+1]+= pressure*Jdet*gauss->weight*normal[1]*L[i];
+-		}
+-	}
+-
+-	/*Transform load vector*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICESSEG,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_CONTROL_
+-/*FUNCTION Icefront::CreatePVectorAdjointHoriz {{{*/
+-ElementVector* Icefront::CreatePVectorAdjointHoriz(void){
+-
+-	/*No load vector applied to the adjoint*/
+-	return NULL;
+-}
+-/*}}}*/
+-#endif
+-#ifdef _HAVE_3D_
+-/*FUNCTION Icefront::CreatePVectorDiagnosticMacAyeal3d{{{*/
+-ElementVector* Icefront::CreatePVectorDiagnosticMacAyeal3d(void){
+-
+-	Icefront* icefront=NULL;
+-	Penta*    penta=NULL;
+-	Tria*     tria=NULL;
+-	bool      onbed;
+-
+-	/*Cast element onto Penta*/
+-	penta   =(Penta*)this->element;
+-
+-	/*Return if not on bed*/
+-	if(!penta->IsOnBed() || penta->IsOnWater()) return NULL;
+-
+-	/*Spawn Tria and call MacAyeal2d*/
+-	tria    =(Tria*)penta->SpawnTria(0,1,2);
+-	icefront=(Icefront*)this->copy();
+-	icefront->element=tria;
+-	icefront->inputs->AddInput(new IntInput(TypeEnum,MacAyeal2dIceFrontEnum));
+-	ElementVector* pe=icefront->CreatePVectorDiagnosticMacAyeal2d();
+-
+-	/*clean-up and return*/
+-	delete tria->matice;
+-	delete tria;
+-	delete icefront;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::CreatePVectorDiagnosticPattyn{{{*/
+-ElementVector* Icefront::CreatePVectorDiagnosticPattyn(void){
+-
+-	/*Constants*/
+-	const int numdofs = NUMVERTICESQUA *NDOF2;
+-
+-	/*Intermediaries*/
+-	int         i,j,ig,index1,index2,index3,index4;
+-	int         fill;
+-	IssmDouble      surface,pressure,ice_pressure,rho_water,rho_ice,gravity;
+-	IssmDouble      water_pressure,air_pressure;
+-	IssmDouble      Jdet,z_g;
+-	IssmDouble      xyz_list[NUMVERTICESQUA][3];
+-	IssmDouble      normal[3];
+-	IssmDouble      l1l4[4];
+-	GaussPenta *gauss = NULL;
+-
+-	Penta* penta=(Penta*)element;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	if(penta->IsOnWater()) return NULL;
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICESQUA,this->parameters,PattynApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICESQUA);
+-	Input* surface_input  =penta->inputs->GetInput(SurfaceEnum);   _assert_(surface_input);
+-	inputs->GetInputValue(&fill,FillEnum);
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice  =matpar->GetRhoIce();
+-	gravity  =matpar->GetG();
+-	GetQuadNormal(&normal[0],xyz_list);
+-
+-	/*Identify which nodes are in the quad: */
+-	index1=element->GetNodeIndex(nodes[0]);
+-	index2=element->GetNodeIndex(nodes[1]);
+-	index3=element->GetNodeIndex(nodes[2]);
+-	index4=element->GetNodeIndex(nodes[3]);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	IssmDouble zmax=xyz_list[0][2]; for(i=1;i<NUMVERTICESQUA;i++) if(xyz_list[i][2]>zmax) zmax=xyz_list[i][2];
+-	IssmDouble zmin=xyz_list[0][2]; for(i=1;i<NUMVERTICESQUA;i++) if(xyz_list[i][2]<zmin) zmin=xyz_list[i][2];
+-	if(zmax>0 && zmin<0) gauss=new GaussPenta(index1,index2,index3,index4,3,10); //refined in vertical because of the sea level discontinuity
+-	else                 gauss=new GaussPenta(index1,index2,index3,index4,3,3);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		penta->GetQuadNodalFunctions(l1l4,gauss,index1,index2,index3,index4);
+-		penta->GetQuadJacobianDeterminant(&Jdet,xyz_list,gauss);
+-		z_g=penta->GetZcoord(gauss);
+-		surface_input->GetInputValue(&surface,gauss);
+-
+-		switch(fill){
+-			case WaterEnum:
+-				water_pressure=rho_water*gravity*min(0.,z_g);//0 if the gaussian point is above water level
+-				break;
+-			case AirEnum:
+-				water_pressure=0;
+-				break;
+-			default:
+-				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
+-		}
+-		ice_pressure=rho_ice*gravity*(surface-z_g);
+-		air_pressure=0;
+-		pressure = ice_pressure + water_pressure + air_pressure;
+-
+-		for(i=0;i<NUMVERTICESQUA;i++) for(j=0;j<NDOF2;j++) pe->values[i*NDOF2+j]+=Jdet*gauss->weight*pressure*l1l4[i]*normal[j];
+-	}
+-
+-	/*Transform load vector*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICESQUA,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::CreatePVectorDiagnosticStokes{{{*/
+-ElementVector* Icefront::CreatePVectorDiagnosticStokes(void){
+-
+-	/*Constants*/
+-	const int numdofs = NUMVERTICESQUA *NDOF4;
+-
+-	/*Intermediaries*/
+-	int         i,j,ig,index1,index2,index3,index4;
+-	int         fill;
+-	IssmDouble      pressure,rho_water,gravity;
+-	IssmDouble      water_pressure,air_pressure;
+-	IssmDouble      Jdet,z_g;
+-	IssmDouble      xyz_list[NUMVERTICESQUA][3];
+-	IssmDouble      normal[3];
+-	IssmDouble      l1l4[4];
+-	GaussPenta *gauss = NULL;
+-
+-	Penta* penta=(Penta*)element;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	if(penta->IsOnWater()) return NULL;
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICESQUA,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICESQUA);
+-	inputs->GetInputValue(&fill,FillEnum);
+-	rho_water=matpar->GetRhoWater();
+-	gravity  =matpar->GetG();
+-	GetQuadNormal(&normal[0],xyz_list);
+-
+-	/*Identify which nodes are in the quad: */
+-	index1=element->GetNodeIndex(nodes[0]);
+-	index2=element->GetNodeIndex(nodes[1]);
+-	index3=element->GetNodeIndex(nodes[2]);
+-	index4=element->GetNodeIndex(nodes[3]);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	IssmDouble zmax=xyz_list[0][2]; for(i=1;i<NUMVERTICESQUA;i++) if(xyz_list[i][2]>zmax) zmax=xyz_list[i][2];
+-	IssmDouble zmin=xyz_list[0][2]; for(i=1;i<NUMVERTICESQUA;i++) if(xyz_list[i][2]<zmin) zmin=xyz_list[i][2];
+-	if(zmax>0 && zmin<0) gauss=new GaussPenta(index1,index2,index3,index4,3,30); //refined in vertical because of the sea level discontinuity
+-	else                 gauss=new GaussPenta(index1,index2,index3,index4,3,3);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		penta->GetQuadNodalFunctions(l1l4,gauss,index1,index2,index3,index4);
+-		penta->GetQuadJacobianDeterminant(&Jdet,xyz_list,gauss);
+-		z_g=penta->GetZcoord(gauss);
+-
+-		switch(fill){
+-			case WaterEnum:
+-				water_pressure=rho_water*gravity*min(0.,z_g);//0 if the gaussian point is above water level
+-				break;
+-			case AirEnum:
+-				water_pressure=0;
+-				break;
+-			default:
+-				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
+-		}
+-		air_pressure=0;
+-		pressure = water_pressure + air_pressure; //no ice pressure fore Stokes
+-
+-		for(i=0;i<NUMVERTICESQUA;i++){
+-			for(j=0;j<NDOF4;j++){
+-				if(j<3)  pe->values[i*NDOF4+j]+=Jdet*gauss->weight*pressure*l1l4[i]*normal[j];
+-				else     pe->values[i*NDOF4+j]+=0; //pressure term
+-			}
+-		}
+-	}
+-
+-	/*Transform load vector*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICESQUA,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-#endif
+-/*FUNCTION Icefront::GetDofList {{{*/
+-void  Icefront::GetDofList(int** pdoflist,int approximation_enum,int setenum){
+-
+-	int i,j;
+-	int numberofdofs=0;
+-	int count=0;
+-	int type;
+-	int numberofnodes=2;
+-
+-	/*output: */
+-	int* doflist=NULL;
+-
+-	
+-	/*recover type: */
+-	inputs->GetInputValue(&type,TypeEnum);
+-
+-	/*Some checks for debugging*/
+-	_assert_(nodes);
+-		
+-	/*How many nodes? :*/
+-	if(type==MacAyeal2dIceFrontEnum || type==MacAyeal3dIceFrontEnum)
+-	 numberofnodes=2;
+-	else 
+-	 numberofnodes=4;
+-	
+-	/*Figure out size of doflist: */
+-	for(i=0;i<numberofnodes;i++){
+-		numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+-	}
+-
+-	/*Allocate: */
+-	doflist=xNew<int>(numberofdofs);
+-
+-	/*Populate: */
+-	count=0;
+-	for(i=0;i<numberofnodes;i++){
+-		nodes[i]->GetDofList(doflist+count,approximation_enum,setenum);
+-		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+-	}
+-
+-	/*Assign output pointers:*/
+-	*pdoflist=doflist;
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::GetSegmentNormal {{{*/
+-void Icefront:: GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]){
+-
+-	/*Build unit outward pointing vector*/
+-	const int numnodes=NUMVERTICESSEG;
+-	IssmDouble vector[2];
+-	IssmDouble norm;
+-
+-	vector[0]=xyz_list[1][0] - xyz_list[0][0];
+-	vector[1]=xyz_list[1][1] - xyz_list[0][1];
+-
+-	norm=sqrt(pow(vector[0],2.0)+pow(vector[1],2.0));
+-
+-	normal[0]= + vector[1]/norm;
+-	normal[1]= - vector[0]/norm;
+-}
+-/*}}}*/
+-/*FUNCTION Icefront::GetQuadNormal {{{*/
+-void Icefront:: GetQuadNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]){
+-
+-	/*Build unit outward pointing vector*/
+-	IssmDouble AB[3];
+-	IssmDouble AC[3];
+-	IssmDouble norm;
+-
+-	AB[0]=xyz_list[1][0] - xyz_list[0][0];
+-	AB[1]=xyz_list[1][1] - xyz_list[0][1];
+-	AB[2]=xyz_list[1][2] - xyz_list[0][2];
+-	AC[0]=xyz_list[2][0] - xyz_list[0][0];
+-	AC[1]=xyz_list[2][1] - xyz_list[0][1];
+-	AC[2]=xyz_list[2][2] - xyz_list[0][2];
+-
+-	cross(normal,AB,AC);
+-	norm=sqrt(pow(normal[0],2.0)+pow(normal[1],2.0)+pow(normal[2],2.0));
+-
+-	for(int i=0;i<3;i++) normal[i]=normal[i]/norm;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Friction.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Friction.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Friction.cpp	(revision 12822)
+@@ -1,334 +0,0 @@
+-/*!\file Friction.c
+- * \brief: implementation of the Friction object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../Container/Container.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-/*}}}*/	
+-
+-/*Constructors/destructors*/
+-/*FUNCTION Friction::Friction() {{{*/
+-Friction::Friction(){
+-	this->element_type=NULL;
+-	this->inputs=NULL;
+-	this->matpar=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION Friction::Friction(const char* element_type, Inputs* inputs,Matpar* matpar,int analysis_type){{{*/
+-Friction::Friction(const char* element_type_in,Inputs* inputs_in,Matpar* matpar_in, int in_analysis_type){
+-
+-	this->analysis_type=in_analysis_type;
+-	this->inputs=inputs_in;
+-	this->element_type=xNew<char>(strlen(element_type_in)+1);
+-	xMemCpy<char>(this->element_type,element_type_in,(strlen(element_type_in)+1));
+-
+-	this->matpar=matpar_in;
+-}
+-/*}}}*/
+-/*FUNCTION Friction::~Friction() {{{*/
+-Friction::~Friction(){
+-	xDelete<char>(element_type);
+-}
+-/*}}}*/
+-
+-/*methods: */
+-/*FUNCTION Friction::Echo {{{*/
+-void Friction::Echo(void){
+-	_printLine_("Friction:");
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	_printLine_("   element_type: " << this->element_type);
+-	inputs->Echo();
+-	matpar->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION Friction::GetAlpha2(IssmDouble* palpha2, GaussTria* gauss,int vxenum,int vyenum,int vzenum){{{*/
+-void Friction::GetAlpha2(IssmDouble* palpha2, GaussTria* gauss,int vxenum,int vyenum,int vzenum){
+-
+-	/*This routine calculates the basal friction coefficient 
+-	  alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p**/
+-
+-	/*diverse: */
+-	IssmDouble  r,s;
+-	IssmDouble  drag_p, drag_q;
+-	IssmDouble  gravity,rho_ice,rho_water;
+-	IssmDouble  Neff;
+-	IssmDouble  thickness,bed;
+-	IssmDouble  vx,vy,vz,vmag;
+-	IssmDouble  drag_coefficient;
+-	IssmDouble  alpha2;
+-
+-	/*Recover parameters: */
+-	inputs->GetInputValue(&drag_p,FrictionPEnum);
+-	inputs->GetInputValue(&drag_q,FrictionQEnum);
+-	this->GetInputValue(&thickness, gauss,ThicknessEnum);
+-	this->GetInputValue(&bed, gauss,BedEnum);
+-	this->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
+-
+-	/*Get material parameters: */
+-	gravity=matpar->GetG();
+-	rho_ice=matpar->GetRhoIce();
+-	rho_water=matpar->GetRhoWater();
+-
+-	//compute r and q coefficients: */
+-	r=drag_q/drag_p;
+-	s=1./drag_p;
+-
+-	//From bed and thickness, compute effective pressure when drag is viscous:
+-	Neff=gravity*(rho_ice*thickness+rho_water*bed);
+-
+-	/*If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
+-	  the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
+-	  for friction should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
+-	  replace it by Neff=0 (ie, equival it to an ice shelf)*/
+-	if (Neff<0)Neff=0;
+-
+-	if(strcmp(element_type,"2d")==0){
+-		this->GetInputValue(&vx, gauss,vxenum);
+-		this->GetInputValue(&vy, gauss,vyenum);
+-		vmag=sqrt(pow(vx,2)+pow(vy,2));
+-	}
+-	else if (strcmp(element_type,"3d")==0){
+-		this->GetInputValue(&vx, gauss,vxenum);
+-		this->GetInputValue(&vy, gauss,vyenum);
+-		this->GetInputValue(&vz, gauss,vzenum);
+-		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
+-	}
+-	else _error2_("element_type "<< element_type << " not supported yet");
+-
+-	/*Checks that s-1>0 if v=0*/
+-        if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
+-
+-	alpha2=pow(drag_coefficient,2)*pow(Neff,r)*pow(vmag,(s-1));
+-	_assert_(!xIsNan<IssmDouble>(alpha2));
+-
+-	/*Assign output pointers:*/
+-	*palpha2=alpha2;
+-}
+-/*}}}*/
+-/*FUNCTION Friction::GetAlpha2(IssmDouble* palpha2, GaussPenta* gauss,int vxenum,int vyenum,int vzenum){{{*/
+-void Friction::GetAlpha2(IssmDouble* palpha2, GaussPenta* gauss,int vxenum,int vyenum,int vzenum){
+-
+-	/*This routine calculates the basal friction coefficient 
+-	  alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p**/
+-
+-	/*diverse: */
+-	IssmDouble  r,s;
+-	IssmDouble  drag_p, drag_q;
+-	IssmDouble  gravity,rho_ice,rho_water;
+-	IssmDouble  Neff;
+-	IssmDouble  thickness,bed;
+-	IssmDouble  vx,vy,vz,vmag;
+-	IssmDouble  drag_coefficient;
+-	IssmDouble  alpha2;
+-
+-	/*Recover parameters: */
+-	inputs->GetInputValue(&drag_p,FrictionPEnum);
+-	inputs->GetInputValue(&drag_q,FrictionQEnum);
+-	this->GetInputValue(&thickness, gauss,ThicknessEnum);
+-	this->GetInputValue(&bed, gauss,BedEnum);
+-	this->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
+-
+-	/*Get material parameters: */
+-	gravity=matpar->GetG();
+-	rho_ice=matpar->GetRhoIce();
+-	rho_water=matpar->GetRhoWater();
+-
+-	//compute r and q coefficients: */
+-	r=drag_q/drag_p;
+-	s=1./drag_p;
+-
+-	//From bed and thickness, compute effective pressure when drag is viscous:
+-	Neff=gravity*(rho_ice*thickness+rho_water*bed);
+-
+-	/*If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
+-	  the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
+-	  for friction should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
+-	  replace it by Neff=0 (ie, equival it to an ice shelf)*/
+-	if (Neff<0)Neff=0;
+-
+-	if(strcmp(element_type,"2d")==0){
+-		this->GetInputValue(&vx, gauss,vxenum);
+-		this->GetInputValue(&vy, gauss,vyenum);
+-		vmag=sqrt(pow(vx,2)+pow(vy,2));
+-	}
+-	else if (strcmp(element_type,"3d")==0){
+-		this->GetInputValue(&vx, gauss,vxenum);
+-		this->GetInputValue(&vy, gauss,vyenum);
+-		this->GetInputValue(&vz, gauss,vzenum);
+-		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
+-	}
+-	else _error2_("element_type "<< element_type << " not supported yet");
+-
+-	/*Checks that s-1>0 if v=0*/
+-	if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
+-
+-	alpha2=pow(drag_coefficient,2)*pow(Neff,r)*pow(vmag,(s-1));
+-	_assert_(!xIsNan<IssmDouble>(alpha2));
+-
+-	/*Assign output pointers:*/
+-	*palpha2=alpha2;
+-}
+-/*}}}*/
+-/*FUNCTION Friction::GetAlphaComplement(IssmDouble* palpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum) {{{*/
+-void Friction::GetAlphaComplement(IssmDouble* palpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum){
+-
+-	/* 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: 
+-	 * alpha_complement= Neff ^r * vel ^s*/
+-
+-	/*diverse: */
+-	int     i;
+-	IssmDouble  r,s;
+-	IssmDouble  vx,vy,vz,vmag;
+-	IssmDouble  drag_p,drag_q;
+-	IssmDouble  Neff;
+-	IssmDouble  drag_coefficient;
+-	IssmDouble  bed,thickness;
+-	IssmDouble  gravity,rho_ice,rho_water;
+-	IssmDouble  alpha_complement;
+-
+-	/*Recover parameters: */
+-	inputs->GetInputValue(&drag_p,FrictionPEnum);
+-	inputs->GetInputValue(&drag_q,FrictionQEnum);
+-	this->GetInputValue(&thickness, gauss,ThicknessEnum);
+-	this->GetInputValue(&bed, gauss,BedEnum);
+-	this->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
+-
+-	/*Get material parameters: */
+-	gravity=matpar->GetG();
+-	rho_ice=matpar->GetRhoIce();
+-	rho_water=matpar->GetRhoWater();
+-
+-	//compute r and q coefficients: */
+-	r=drag_q/drag_p;
+-	s=1./drag_p;
+-
+-	//From bed and thickness, compute effective pressure when drag is viscous:
+-	Neff=gravity*(rho_ice*thickness+rho_water*bed);
+-
+-	/*If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
+-	  the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
+-	  for friction should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
+-	  replace it by Neff=0 (ie, equival it to an ice shelf)*/
+-	if (Neff<0)Neff=0;
+-
+-	//We need the velocity magnitude to evaluate the basal stress:
+-	if(strcmp(element_type,"2d")==0){
+-		this->GetInputValue(&vx, gauss,vxenum);
+-		this->GetInputValue(&vy, gauss,vyenum);
+-		vmag=sqrt(pow(vx,2)+pow(vy,2));
+-	}
+-	else if (strcmp(element_type,"3d")==0){
+-		this->GetInputValue(&vx, gauss,vxenum);
+-		this->GetInputValue(&vy, gauss,vyenum);
+-		this->GetInputValue(&vz, gauss,vzenum);
+-		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
+-	}
+-	else _error2_("element_type "<< element_type << " not supported yet");
+-
+-	/*Checks that s-1>0 if v=0*/
+-	if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
+-
+-	alpha_complement=pow(Neff,r)*pow(vmag,(s-1));            _assert_(!xIsNan<IssmDouble>(alpha_complement));
+-
+-	/*Assign output pointers:*/
+-	*palpha_complement=alpha_complement;
+-}
+-/*}}}*/
+-/*FUNCTION Friction::GetAlphaComplement(IssmDouble* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum) {{{*/
+-void Friction::GetAlphaComplement(IssmDouble* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum){
+-
+-	/* 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: 
+-	 * alpha_complement= Neff ^r * vel ^s*/
+-
+-	/*diverse: */
+-	int     i;
+-	IssmDouble  r,s;
+-	IssmDouble  vx,vy,vz,vmag;
+-	IssmDouble  drag_p,drag_q;
+-	IssmDouble  Neff;
+-	IssmDouble  drag_coefficient;
+-	IssmDouble  bed,thickness;
+-	IssmDouble  gravity,rho_ice,rho_water;
+-	IssmDouble  alpha_complement;
+-
+-	/*Recover parameters: */
+-	inputs->GetInputValue(&drag_p,FrictionPEnum);
+-	inputs->GetInputValue(&drag_q,FrictionQEnum);
+-	this->GetInputValue(&thickness, gauss,ThicknessEnum);
+-	this->GetInputValue(&bed, gauss,BedEnum);
+-	this->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
+-
+-	/*Get material parameters: */
+-	gravity=matpar->GetG();
+-	rho_ice=matpar->GetRhoIce();
+-	rho_water=matpar->GetRhoWater();
+-
+-	//compute r and q coefficients: */
+-	r=drag_q/drag_p;
+-	s=1./drag_p;
+-
+-	//From bed and thickness, compute effective pressure when drag is viscous:
+-	Neff=gravity*(rho_ice*thickness+rho_water*bed);
+-
+-	/*If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
+-	  the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
+-	  for friction should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
+-	  replace it by Neff=0 (ie, equival it to an ice shelf)*/
+-	if (Neff<0)Neff=0;
+-
+-	//We need the velocity magnitude to evaluate the basal stress:
+-	if(strcmp(element_type,"2d")==0){
+-		this->GetInputValue(&vx, gauss,vxenum);
+-		this->GetInputValue(&vy, gauss,vyenum);
+-		vmag=sqrt(pow(vx,2)+pow(vy,2));
+-	}
+-	else if (strcmp(element_type,"3d")==0){
+-		this->GetInputValue(&vx, gauss,vxenum);
+-		this->GetInputValue(&vy, gauss,vyenum);
+-		this->GetInputValue(&vz, gauss,vzenum);
+-		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
+-	}
+-	else _error2_("element_type "<< element_type << " not supported yet");
+-
+-	/*Checks that s-1>0 if v=0*/
+-	if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
+-
+-	alpha_complement=pow(Neff,r)*pow(vmag,(s-1));            _assert_(!xIsNan<IssmDouble>(alpha_complement));
+-
+-	/*Assign output pointers:*/
+-	*palpha_complement=alpha_complement;
+-}
+-/*}}}*/
+-/*FUNCTION Friction::GetInputValue{{{*/
+-void Friction::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int enum_type){
+-
+-	Input* input=inputs->GetInput(enum_type);
+-	if(!input) _error2_("input " << EnumToStringx(enum_type) << " not found");
+-	input->GetInputValue(pvalue,gauss);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Friction::GetInputValue{{{*/
+-void Friction::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int enum_type){
+-
+-	Input* input=inputs->GetInput(enum_type);
+-	if(!input) _error2_("input " << EnumToStringx(enum_type) << " not found");
+-	input->GetInputValue(pvalue,gauss);
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Pengrid.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Pengrid.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Pengrid.h	(revision 12822)
+@@ -1,100 +0,0 @@
+-/*!\file Pengrid.h
+- * \brief: header file for pengrid object */
+-
+-#ifndef _PENGRID_H_
+-#define _PENGRID_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Load.h"
+-class Hook;
+-class Inputs;
+-class Parameters;
+-class IoModel;
+-/*}}}*/
+-
+-class Pengrid: public Load{
+-
+-	private: 
+-
+-		int		id;
+-		int analysis_type;
+-		
+-		/*Hooks*/
+-		Hook* hnode;  //hook to 1 node
+-		Hook* helement;  //hook to 1 element
+-		Hook* hmatpar; //hook to 1 matpar
+-
+-		/*Corresponding fields*/
+-		Node    *node;
+-		Element *element;
+-		Matpar  *matpar;
+-
+-		Parameters* parameters; //pointer to solution parameters
+-		Inputs*  inputs;
+-	
+-		/*internals: */
+-		int active;
+-		int zigzag_counter;
+-
+-	public:
+-
+-		/*Pengrid constructors, destructors {{{*/
+-		Pengrid();
+-		Pengrid(int index, int id, IoModel* iomodel,int analysis_type);
+-		~Pengrid();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Update virtual functions resolution: {{{*/
+-		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVector(int* vector, int name, int type);
+-		void  InputUpdateFromVector(bool* vector, int name, int type);
+-		void  InputUpdateFromMatrixDakota(IssmDouble* matrix ,int nrows, int ncols, int name, int type);
+-		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
+-		void  InputUpdateFromConstant(IssmDouble constant, int name);
+-		void  InputUpdateFromConstant(int constant, int name);
+-		void  InputUpdateFromConstant(bool constant, int name);
+-		void  InputUpdateFromSolution(IssmDouble* solution);
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
+-		/*}}}*/
+-		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+-		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff){_error2_("Not implemented yet");};
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error2_("Not implemented yet");};
+-		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+-		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
+-		bool  InAnalysis(int analysis_type);
+-		/*}}}*/
+-		/*Pengrid management {{{*/
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		ElementMatrix* PenaltyCreateKMatrixDiagnosticStokes(IssmDouble kmax);
+-		#endif
+-		#ifdef _HAVE_THERMAL_
+-		ElementMatrix* PenaltyCreateKMatrixThermal(IssmDouble kmax);
+-		ElementMatrix* PenaltyCreateKMatrixMelting(IssmDouble kmax);
+-		ElementVector* PenaltyCreatePVectorThermal(IssmDouble kmax);
+-		ElementVector* PenaltyCreatePVectorMelting(IssmDouble kmax);
+-		#endif
+-		void  ConstraintActivate(int* punstable);
+-		void  ConstraintActivateThermal(int* punstable);
+-		void  UpdateInputs(IssmDouble* solution);
+-		void  ResetConstraint(void);
+-		/*}}}*/
+-
+-};
+-
+-#endif  /* _PENGRID_H_ */
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Riftfront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Riftfront.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Loads/Riftfront.cpp	(revision 12822)
+@@ -1,916 +0,0 @@
+-/*!\file Riftfront.cpp
+- * \brief: implementation of the Riftfront object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../modules/ModelProcessorx/ModelProcessorx.h"
+-#include "../objects.h"
+-/*}}}*/
+-
+-/*Element macros*/
+-#define NUMVERTICES 2
+-
+-/*Riftfront constructors and destructor*/
+-/*FUNCTION Riftfront::Riftfront(){{{*/
+-Riftfront::Riftfront(){
+-	this->inputs=NULL;
+-	this->parameters=NULL;
+-	this->hnodes=NULL;
+-	this->helements=NULL;
+-	this->hmatpar=NULL;
+-	this->nodes=NULL;
+-	this->elements=NULL;
+-	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){
+-
+-	/*data: */
+-	int    riftfront_node_ids[2];
+-	int    riftfront_elem_ids[2];
+-	int    riftfront_matpar_id;
+-	int    riftfront_type;
+-	int    riftfront_fill;
+-	IssmDouble riftfront_friction;
+-	IssmDouble riftfront_fractionincrement;
+-	bool   riftfront_shelf;
+-	int    numberofelements;
+-	int    penalty_lock;
+-
+-	/*intermediary: */
+-	int el1    ,el2;
+-	int node1  ,node2;
+-
+-	/*Fetch parameters: */
+-	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
+-	iomodel->Constant(&penalty_lock,DiagnosticRiftPenaltyLockEnum);
+-
+-	/*Ok, retrieve all the data needed to add a penalty between the two nodes: */
+-	el1=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+2);
+-	el2=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+3); 
+-
+-	node1=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+0); 
+-	node2=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+1);
+-
+-	/*id: */
+-	this->id=riftfront_id;
+-	this->analysis_type=riftfront_analysis_type;
+-
+-	/*hooks: */
+-	riftfront_node_ids[0]=iomodel->nodecounter+node1;
+-	riftfront_node_ids[1]=iomodel->nodecounter+node2;
+-	riftfront_elem_ids[0]=el1;
+-	riftfront_elem_ids[1]=el2;
+-	riftfront_matpar_id=numberofelements+1; //matlab indexing
+-
+-	/*Hooks: */
+-	this->hnodes=new Hook(riftfront_node_ids,2);
+-	this->helements=new Hook(riftfront_elem_ids,2);
+-	this->hmatpar=new Hook(&riftfront_matpar_id,1);
+-
+-	/*computational parameters: */
+-	this->active=0;
+-	this->frozen=0;
+-	this->counter=0;
+-	this->prestable=0;
+-	this->penalty_lock=penalty_lock;
+-	this->material_converged=0;
+-	this->normal[0]=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+4);
+-	this->normal[1]=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+5);
+-	this->length=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+6);
+-	this->fraction=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+9);
+-	this->state=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+11);
+-
+-	//intialize inputs, and add as many inputs per element as requested: 
+-	this->inputs=new Inputs();
+-		
+-	riftfront_type=SegmentRiftfrontEnum;
+-	riftfront_fill = (int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+7);
+-	riftfront_friction=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+8);
+-	riftfront_fractionincrement=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+10);
+-	riftfront_shelf=(bool)iomodel->Data(MaskVertexonfloatingiceEnum)[node1-1];
+-
+-	this->inputs->AddInput(new IntInput(TypeEnum,riftfront_type));
+-	this->inputs->AddInput(new IntInput(FillEnum,riftfront_fill));
+-	this->inputs->AddInput(new DoubleInput(FrictionEnum,riftfront_friction));
+-	this->inputs->AddInput(new DoubleInput(FractionIncrementEnum,riftfront_fractionincrement));
+-	this->inputs->AddInput(new BoolInput(SegmentOnIceShelfEnum,riftfront_shelf));
+-	
+-	//parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
+-	this->parameters=NULL;
+-	this->nodes= NULL;
+-	this->elements= NULL;
+-	this->matpar= NULL;
+-		
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::~Riftfront(){{{*/
+-Riftfront::~Riftfront(){
+-	delete inputs;
+-	this->parameters=NULL;
+-
+-	delete hnodes;
+-	delete helements;
+-	delete hmatpar;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Riftfront::Echo {{{*/
+-void Riftfront::Echo(void){
+-
+-	Input* input=NULL;
+-	int fill;
+-	IssmDouble friction,fractionincrement;
+-
+-	
+-	/*recover some inputs first: */
+-	input=(Input*)this->inputs->GetInput(FillEnum); input->GetInputValue(&fill);
+-	input=(Input*)this->inputs->GetInput(FrictionEnum); input->GetInputValue(&friction);
+-	input=(Input*)this->inputs->GetInput(FractionIncrementEnum); input->GetInputValue(&fractionincrement);
+-
+-	_printLine_("Riftfront:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	_printLine_("   hnodes: " << hnodes);
+-	_printLine_("   helements: " << helements);
+-	_printLine_("   hmatpar: " << hmatpar);
+-	_printLine_("   parameters: " << parameters);
+-	_printLine_("   inputs: " << inputs);
+-	_printLine_("   internal parameters: ");
+-	_printLine_("   normal: " << normal[0] << "|" << normal[1]);
+-	_printLine_("   length: " << length);
+-	_printLine_("   penalty_lock: " << penalty_lock);
+-	_printLine_("   active: " <<(active ? "true":"false"));
+-	_printLine_("   counter: " << counter);
+-	_printLine_("   prestable: " << (prestable ? "true":"false"));
+-	_printLine_("   material_converged: " << (material_converged ? "true":"false"));
+-	_printLine_("   fill: " << fill);
+-	_printLine_("   friction: " << friction);
+-	_printLine_("   fraction: " << fraction);
+-	_printLine_("   fractionincrement: " << fractionincrement);
+-	_printLine_("   state: " << state);
+-	_printLine_("   frozen: " << (frozen ? "true":"false"));
+-		
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::DeepEcho{{{*/
+-void Riftfront::DeepEcho(void){
+-
+-	_printLine_("Riftfront:");
+-	_printLine_("   id: " << id);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	hnodes->DeepEcho();
+-	helements->DeepEcho();
+-	hmatpar->DeepEcho();
+-	_printLine_("   parameters");
+-	if(parameters)parameters->DeepEcho();
+-	_printLine_("   inputs");
+-	if(inputs)inputs->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::Id {{{*/
+-int    Riftfront::Id(void){ return id; }
+-/*}}}*/
+-/*FUNCTION Riftfront::MyRank {{{*/
+-int    Riftfront::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::ObjectEnum{{{*/
+-int Riftfront::ObjectEnum(void){
+-
+-	return RiftfrontEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::copy {{{*/
+-Object* Riftfront::copy() {
+-	
+-	Riftfront* riftfront=NULL;
+-
+-	riftfront=new Riftfront();
+-
+-	/*copy fields: */
+-	riftfront->id=this->id;
+-	riftfront->analysis_type=this->analysis_type;
+-	if(this->inputs){
+-		riftfront->inputs=(Inputs*)this->inputs->Copy();
+-	}
+-	else{
+-		riftfront->inputs=new Inputs();
+-	}
+-	/*point parameters: */
+-	riftfront->parameters=this->parameters;
+-
+-	/*now deal with hooks and objects: */
+-	riftfront->hnodes=(Hook*)this->hnodes->copy();
+-	riftfront->helements=(Hook*)this->helements->copy();
+-	riftfront->hmatpar=(Hook*)this->hmatpar->copy();
+-
+-	/*corresponding fields*/
+-	riftfront->nodes   =(Node**)riftfront->hnodes->deliverp();
+-	riftfront->elements=(Element**)riftfront->helements->deliverp();
+-	riftfront->matpar  =(Matpar*)riftfront->hmatpar->delivers();
+-
+-	/*internal data: */
+-	riftfront->penalty_lock=this->penalty_lock;
+-	riftfront->active=this->active;
+-	riftfront->frozen=this->frozen;
+-	riftfront->state=this->state;
+-	riftfront->counter=this->counter;
+-	riftfront->prestable=this->prestable;
+-	riftfront->material_converged=this->material_converged;
+-	riftfront->normal[0]=this->normal[0];
+-	riftfront->normal[1]=this->normal[1];
+-	riftfront->length=this->length;
+-	riftfront->fraction=this->fraction;
+-	
+-	return riftfront;
+-
+-}
+-/*}}}*/
+-		
+-/*Update virtual functions definitions:*/
+-/*FUNCTION Riftfront::InputUpdateFromConstant(bool constant,int name) {{{*/
+-void  Riftfront::InputUpdateFromConstant(bool constant,int name){
+-
+-	/*Check that name is a Riftfront input*/
+-	if (!IsInput(name)) return;
+-
+-	/*update input*/
+-	this->inputs->AddInput(new BoolInput(name,constant));
+-
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::InputUpdateFromConstant(IssmDouble constant,int name) {{{*/
+-void  Riftfront::InputUpdateFromConstant(IssmDouble constant,int name){
+-
+-	/*Check that name is a Riftfront input*/
+-	if (!IsInput(name)) return;
+-
+-	/*update input*/
+-	this->inputs->AddInput(new DoubleInput(name,constant));
+-
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::InputUpdateFromConstant(IssmDouble* constant,int name) {{{*/
+-void    Riftfront::InputUpdateFromVector(IssmDouble* vector, int name, int type){
+-
+-	/*Check that name is a Riftfront input*/
+-	if (!IsInput(name)) return;
+-
+-	/*update input*/
+-	_error2_("not implemented yet");
+-	//this->inputs->AddInput(new DoubleInput(name,constant));
+-
+-}
+-/*}}}*/
+-
+-
+-/*Load virtual functions definitions:*/
+-/*FUNCTION Riftfront::Configure {{{*/
+-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: */
+-	hnodes->configure(nodesin);
+-	helements->configure(elementsin);
+-	hmatpar->configure(materialsin);
+-
+-	/*Initialize hooked fields*/
+-	this->nodes   =(Node**)hnodes->deliverp();
+-	this->elements=(Element**)helements->deliverp();
+-	this->matpar  =(Matpar*)hmatpar->delivers();
+-
+-	/*point parameters to real dataset: */
+-	this->parameters=parametersin;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::SetCurrentConfiguration {{{*/
+-void  Riftfront::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
+-
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::PenaltyCreateKMatrix {{{*/
+-void  Riftfront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
+-
+-	/*Retrieve parameters: */
+-	ElementMatrix* Ke=NULL;
+-	int analysis_type;
+-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	switch(analysis_type){
+-		case DiagnosticHorizAnalysisEnum:
+-			Ke=PenaltyCreateKMatrixDiagnosticHoriz(kmax);
+-			break;
+-		case AdjointHorizAnalysisEnum:
+-			Ke=PenaltyCreateKMatrixDiagnosticHoriz(kmax);
+-			break;
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global Vector*/
+-	if(Ke){
+-		Ke->AddToGlobal(Kff,Kfs);
+-		delete Ke;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::PenaltyCreatePVector {{{*/
+-void  Riftfront::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
+-
+-	/*Retrieve parameters: */
+-	ElementVector* pe=NULL;
+-	int analysis_type;
+-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	switch(analysis_type){
+-		case DiagnosticHorizAnalysisEnum:
+-			pe=PenaltyCreatePVectorDiagnosticHoriz(kmax);
+-			break;
+-		case AdjointHorizAnalysisEnum:
+-			/*No penalty applied on load vector*/
+-			break;
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global Vector*/
+-	if(pe){
+-		pe->AddToGlobal(pf);
+-		delete pe;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::CreateKMatrix {{{*/
+-void  Riftfront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
+-	/*do nothing: */
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::CreatePVector {{{*/
+-void  Riftfront::CreatePVector(Vector* pf){
+-	/*do nothing: */
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::InAnalysis{{{*/
+-bool Riftfront::InAnalysis(int in_analysis_type){
+-	if (in_analysis_type==this->analysis_type) return true;
+-	else return false;
+-}
+-/*}}}*/
+-
+-/*Riftfront numerics*/
+-/*FUNCTION Riftfront::PenaltyCreateKMatrixDiagnosticHoriz {{{*/
+-ElementMatrix* Riftfront::PenaltyCreateKMatrixDiagnosticHoriz(IssmDouble kmax){
+-
+-	const int   numdof = NDOF2*NUMVERTICES;
+-	int         i,j;
+-	int         dofs[1]             = {0};
+-	IssmDouble      Ke_gg[4][4];
+-	IssmDouble      thickness;
+-	IssmDouble      h[2];
+-	IssmDouble      penalty_offset;
+-	IssmDouble      friction;
+-
+-	/*Objects: */
+-	Tria       *tria1               = NULL;
+-	Tria       *tria2               = NULL;
+-
+-	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
+-	tria1=(Tria*)elements[0];
+-	tria2=(Tria*)elements[1];
+-
+-	/*Initialize Element Matrix*/
+-	if(!this->active) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Get some parameters: */
+-	this->parameters->FindParam(&penalty_offset,DiagnosticPenaltyFactorEnum);
+-	this->inputs->GetInputValue(&friction,FrictionEnum);
+-	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
+-	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
+-	if (h[0]!=h[1])_error2_("different thicknesses not supported for rift fronts");
+-	thickness=h[0];
+-
+-	/*There is contact, we need to constrain the normal velocities (zero penetration), and the 
+-	 *contact slip friction. */
+-
+-	/*From Peter Wriggers book (Computational Contact Mechanics, p191): */
+-	Ke->values[0*numdof+0]+= +pow(normal[0],2)*kmax*pow(10,penalty_offset);
+-	Ke->values[0*numdof+1]+= +normal[0]*normal[1]*kmax*pow(10,penalty_offset);
+-	Ke->values[0*numdof+2]+= -pow(normal[0],2)*kmax*pow(10,penalty_offset);
+-	Ke->values[0*numdof+3]+= -normal[0]*normal[1]*kmax*pow(10,penalty_offset);
+-
+-	Ke->values[1*numdof+0]+= +normal[0]*normal[1]*kmax*pow(10,penalty_offset);
+-	Ke->values[1*numdof+1]+= +pow(normal[1],2)*kmax*pow(10,penalty_offset);
+-	Ke->values[1*numdof+2]+= -normal[0]*normal[1]*kmax*pow(10,penalty_offset);
+-	Ke->values[1*numdof+3]+= -pow(normal[1],2)*kmax*pow(10,penalty_offset);
+-
+-	Ke->values[2*numdof+0]+= -pow(normal[0],2)*kmax*pow(10,penalty_offset);
+-	Ke->values[2*numdof+1]+= -normal[0]*normal[1]*kmax*pow(10,penalty_offset);
+-	Ke->values[2*numdof+2]+= +pow(normal[0],2)*kmax*pow(10,penalty_offset);
+-	Ke->values[2*numdof+3]+= +normal[0]*normal[1]*kmax*pow(10,penalty_offset);
+-
+-	Ke->values[3*numdof+0]+= -normal[0]*normal[1]*kmax*pow(10,penalty_offset);
+-	Ke->values[3*numdof+1]+= -pow(normal[1],2)*kmax*pow(10,penalty_offset);
+-	Ke->values[3*numdof+2]+= +normal[0]*normal[1]*kmax*pow(10,penalty_offset);
+-	Ke->values[3*numdof+3]+= +pow(normal[1],2)*kmax*pow(10,penalty_offset);
+-
+-	/*Now take care of the friction: of type sigma=frictiontangent_velocity2-tangent_velocity1)*/
+-
+-	Ke->values[0*numdof+0]+= +pow(normal[1],2)*thickness*length*friction;
+-	Ke->values[0*numdof+1]+= -normal[0]*normal[1]*thickness*length*friction;
+-	Ke->values[0*numdof+2]+= -pow(normal[1],2)*thickness*length*friction;
+-	Ke->values[0*numdof+3]+= +normal[0]*normal[1]*thickness*length*friction;
+-
+-	Ke->values[1*numdof+0]+= -normal[0]*normal[1]*thickness*length*friction;
+-	Ke->values[1*numdof+1]+= +pow(normal[0],2)*thickness*length*friction;
+-	Ke->values[1*numdof+2]+= +normal[0]*normal[1]*thickness*length*friction;
+-	Ke->values[1*numdof+3]+= -pow(normal[0],2)*thickness*length*friction;
+-
+-	Ke->values[2*numdof+0]+= -pow(normal[1],2)*thickness*length*friction;
+-	Ke->values[2*numdof+1]+= +normal[0]*normal[1]*thickness*length*friction;
+-	Ke->values[2*numdof+2]+= +pow(normal[1],2)*thickness*length*friction;
+-	Ke->values[2*numdof+3]+= -normal[0]*normal[1]*thickness*length*friction;
+-
+-	Ke->values[3*numdof+0]+= +normal[0]*normal[1]*thickness*length*friction;
+-	Ke->values[3*numdof+1]+= -pow(normal[0],2)*thickness*length*friction;
+-	Ke->values[3*numdof+2]+= -normal[0]*normal[1]*thickness*length*friction;
+-	Ke->values[3*numdof+3]+= +pow(normal[0],2)*thickness*length*friction;
+-
+-	/*Clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::PenaltyCreatePVectorDiagnosticHoriz {{{*/
+-ElementVector* Riftfront::PenaltyCreatePVectorDiagnosticHoriz(IssmDouble kmax){
+-
+-	const int   numdof = NDOF2*NUMVERTICES;
+-	int         i,j;
+-	IssmDouble      rho_ice;
+-	IssmDouble      rho_water;
+-	IssmDouble      gravity;
+-	IssmDouble      thickness;
+-	IssmDouble      h[2];
+-	IssmDouble      bed;
+-	IssmDouble      b[2];
+-	IssmDouble      pressure;
+-	IssmDouble      pressure_litho;
+-	IssmDouble      pressure_air;
+-	IssmDouble      pressure_melange;
+-	IssmDouble      pressure_water;
+-	int         fill;
+-	bool        shelf;
+-
+-	/*Objects: */
+-	Tria       *tria1               = NULL;
+-	Tria       *tria2               = NULL;
+-
+-	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
+-	tria1=(Tria*)elements[0];
+-	tria2=(Tria*)elements[1];
+-
+-	/*Initialize Element Matrix*/
+-	if(this->active) return NULL; /*The penalty is active. No loads implied here.*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Get some inputs: */
+-	this->inputs->GetInputValue(&fill,FillEnum);
+-	this->inputs->GetInputValue(&shelf,SegmentOnIceShelfEnum);
+-	rho_ice=matpar->GetRhoIce();
+-	rho_water=matpar->GetRhoWater();
+-	gravity=matpar->GetG();
+-	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
+-	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
+-	if (h[0]!=h[1])_error2_("different thicknesses not supported for rift fronts");
+-	thickness=h[0];
+-	tria1->GetInputValue(&b[0],nodes[0],BedEnum);
+-	tria2->GetInputValue(&b[1],nodes[1],BedEnum);
+-	if (b[0]!=b[1])_error2_("different beds not supported for rift fronts");
+-	bed=b[0];
+-
+-	/*Ok, this rift is opening. We should put loads on both sides of the rift flanks. Because we are dealing with contact mechanics, 
+-	 * and we want to avoid zigzagging of the loads, we want lump the loads onto nodes, not onto surfaces between nodes.:*/
+-
+-	/*Ok, to compute the pressure, we are going to need material properties, thickness and bed for the two nodes. We assume those properties to 
+-	 * be the same across the rift.: */
+-
+-	/*Ok, now compute the pressure (in norm) that is being applied to the flanks, depending on the type of fill: */
+-	if(fill==WaterEnum){
+-		if(shelf){
+-			/*We are on an ice shelf, hydrostatic equilibrium is used to determine the pressure for water fill: */
+-			pressure=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2  - rho_water*gravity*pow(bed,(IssmDouble)2)/(IssmDouble)2; 
+-		}
+-		else{
+-			//We are on an icesheet, we assume the water column fills the entire front: */
+-			pressure=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2  - rho_water*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2; 
+-		}
+-	}
+-	else if(fill==AirEnum){
+-		pressure=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2;   //icefront on an ice sheet, pressure imbalance ice vs air.
+-	}
+-	else if(fill==IceEnum){ //icefront finding itself against another icefront (pressure imbalance is fully compensated, ice vs ice)
+-		pressure=0;
+-	}
+-	else if(fill==MelangeEnum){ //icefront finding itself against another icefront (pressure imbalance is fully compensated, ice vs ice)
+-
+-		if(!shelf) _error2_("fill type " << fill << " not supported on ice sheets yet.");
+-
+-		pressure_litho=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2;
+-		pressure_air=0;
+-		pressure_melange=rho_ice*gravity*pow(fraction*thickness,(IssmDouble)2)/(IssmDouble)2;
+-		pressure_water=1.0/2.0*rho_water*gravity*  ( pow(bed,2.0)-pow(rho_ice/rho_water*fraction*thickness,2.0) );
+-
+-		pressure=pressure_litho-pressure_air-pressure_melange-pressure_water;
+-	}
+-	else{
+-		_error2_("fill type " << fill << " not supported yet.");
+-	}
+-
+-	/*Ok, add contribution to first node, along the normal i==0: */
+-	for (j=0;j<2;j++){
+-		pe->values[j]+=pressure*normal[j]*length;
+-	}
+-
+-	/*Add contribution to second node, along the opposite normal: i==1 */
+-	for (j=0;j<2;j++){
+-		pe->values[2+j]+= -pressure*normal[j]*length;
+-	}	
+-
+-	/*Clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::Constrain {{{*/
+-#define _ZIGZAGCOUNTER_
+-
+-int Riftfront::Constrain(int* punstable){
+-
+-	const int   numnodes        = 2;
+-	IssmDouble      max_penetration;
+-	IssmDouble      penetration;
+-	int         activate;
+-	int         found;
+-	int         unstable;
+-	IssmDouble      vx1;
+-	IssmDouble      vy1;
+-	IssmDouble      vx2;
+-	IssmDouble      vy2;
+-	IssmDouble      fractionincrement;
+-
+-	/*Objects: */
+-	Tria       *tria1           = NULL;
+-	Tria       *tria2           = NULL;
+-
+-	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
+-
+-	/*recover elements on both side of rift: */
+-	tria1=(Tria*)elements[0];
+-	tria2=(Tria*)elements[1];
+-
+-	/*Is this constraint frozen? In which case we don't touch: */
+-	if (this->frozen){
+-		*punstable=0;
+-		return 1;
+-	}
+-
+-	/*Is this rift segment state specified by user input? :*/
+-	if (this->state==OpenEnum || this->state==ClosedEnum){
+-
+-		if(this->state==OpenEnum)this->active=0;
+-		if(this->state==ClosedEnum)this->active=1;
+-		
+-		/*this segment is like frozen, no instability here: */
+-		*punstable=0;
+-		return 1;
+-	}
+-
+-
+-	/*recover parameters: */
+-	this->inputs->GetInputValue(&fractionincrement,FractionIncrementEnum);
+-
+-	/*First recover velocity: */
+-	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
+-	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
+-	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
+-	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
+-
+-	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
+-	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
+-
+-	/*activation: */
+-	if(penetration<0)activate=1;
+-	else  activate=0;
+-
+-	/*Here, we try to avoid zigzaging. When a penalty activates and deactivates for more than penalty_lock times, 
+-	 * we increase the fraction of melange:*/
+-	if(this->counter>this->penalty_lock){
+-		/*reset counter: */
+-		this->counter=0;
+-		/*increase melange fraction: */
+-		this->fraction+=fractionincrement;
+-		if (this->fraction>1)this->fraction=(IssmDouble)1.0;
+-		//_printLine_("riftfront " << this->Id() << " fraction: " << this->fraction);
+-	}
+-
+-	//Figure out stability of this penalty
+-	if(this->active==activate){
+-		unstable=0;
+-	}
+-	else{
+-		unstable=1;
+-		this->counter++;
+-	}
+-
+-	//Set penalty flag
+-	this->active=activate;
+-
+-	//if ((penetration>0) && (this->active==1))_printLine_("Riftfront " << Id() << " wants to be released");
+-
+-	/*assign output pointer: */
+-	*punstable=unstable;
+-	return 1;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::FreezeConstraints{{{*/
+-void   Riftfront::FreezeConstraints(void){
+-
+-	/*Just set frozen flag to 1: */
+-	this->frozen=1;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::IsFrozen{{{*/
+-bool   Riftfront::IsFrozen(void){
+-
+-	/*Just set frozen flag to 1: */
+-	if(this->frozen)return 1;
+-	else return 0;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::IsMaterialStable {{{*/
+-int   Riftfront::IsMaterialStable(void){
+-
+-	int found=0;
+-	IssmDouble converged=0;
+-
+-	this->inputs->GetInputValue(&converged,ConvergedEnum);
+-
+-	if(converged){
+-		/*ok, material non-linearity has converged. If that was already the case, we keep 
+-		 * constraining the rift front. If it was not, and this is the first time the material 
+-		 * has converged, we start constraining now!: */
+-		this->material_converged=1;
+-	}
+-
+-	return this->material_converged;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::MaxPenetration {{{*/
+-int   Riftfront::MaxPenetration(IssmDouble* ppenetration){
+-
+-	const int     numnodes=2;
+-	IssmDouble        max_penetration;
+-	IssmDouble        penetration=0;
+-	int           found;
+-	IssmDouble      vx1;
+-	IssmDouble      vy1;
+-	IssmDouble      vx2;
+-	IssmDouble      vy2;
+-
+-	/*Objects: */
+-	Tria       *tria1           = NULL;
+-	Tria       *tria2           = NULL;
+-
+-	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
+-
+-	/*recover elements on both side of rift: */
+-	tria1=(Tria*)elements[0];
+-	tria2=(Tria*)elements[1];
+-
+-	//initialize: 
+-	penetration=-1;
+-
+-	/*recover velocity: */
+-	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
+-	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
+-	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
+-	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
+-
+-	/*Node1 faces node2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
+-	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
+-
+-	/*Now, we return penetration only if we are active!: */
+-	if(this->active==0)penetration=-1;
+-
+-	/*If we are zigzag locked, same thing: */
+-	if(this->counter>this->penalty_lock)penetration=-1;
+-	
+-	/*assign output pointer: */
+-	*ppenetration=penetration;
+-	return 1;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::Penetration {{{*/
+-int   Riftfront::Penetration(IssmDouble* ppenetration){
+-
+-	IssmDouble    vx1;
+-	IssmDouble    vy1;
+-	IssmDouble    vx2;
+-	IssmDouble    vy2;
+-
+-	IssmDouble    penetration;
+-	int       found;
+-
+-	/*Objects: */
+-	Tria     *tria1       = NULL;
+-	Tria     *tria2       = NULL;
+-
+-	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
+-
+-	/*recover elements on both side of rift: */
+-	tria1=(Tria*)elements[0];
+-	tria2=(Tria*)elements[1];
+-
+-	/*First recover velocity: */
+-	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
+-	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
+-	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
+-	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
+-
+-	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
+-	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
+-
+-	/*Now, we return penetration only if we are active!: */
+-	if(this->active==0)penetration=0;
+-	
+-	/*assign output pointer: */
+-	*ppenetration=penetration;
+-	return 1;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::PotentialUnstableConstraint {{{*/
+-int   Riftfront::PotentialUnstableConstraint(int* punstable){
+-
+-
+-	const int   numnodes        = 2;
+-	IssmDouble      max_penetration;
+-	IssmDouble      penetration;
+-	int         activate;
+-	int         unstable;
+-	int         found;
+-	IssmDouble      vx1;
+-	IssmDouble      vy1;
+-	IssmDouble      vx2;
+-	IssmDouble      vy2;
+-
+-	/*Objects: */
+-	Tria       *tria1           = NULL;
+-	Tria       *tria2           = NULL;
+-
+-	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
+-
+-	/*recover elements on both side of rift: */
+-	tria1=(Tria*)elements[0];
+-	tria2=(Tria*)elements[1];
+-
+-	/*First recover velocity: */
+-	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
+-	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
+-	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
+-	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
+-
+-	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
+-	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
+-
+-	/*Ok, we are looking for positive penetration in an active constraint: */
+-	if(this->active){
+-		if (penetration>=0){
+-			unstable=1;
+-		}
+-		else{
+-			unstable=0;
+-		}
+-	}
+-	else{
+-		unstable=0;
+-	}
+-
+-	/*assign output pointer: */
+-	*punstable=unstable;
+-	return 1;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::PreConstrain {{{*/
+-int   Riftfront::PreConstrain(int* punstable){
+-
+-	const int   numnodes    = 2;
+-	IssmDouble      penetration;
+-	int         unstable;
+-	int         found;
+-	IssmDouble      vx1;
+-	IssmDouble      vy1;
+-	IssmDouble      vx2;
+-	IssmDouble      vy2;
+-
+-	/*Objects: */
+-	Tria       *tria1       = NULL;
+-	Tria       *tria2       = NULL;
+-
+-	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
+-
+-	/*recover elements on both side of rift: */
+-	tria1=(Tria*)elements[0];
+-	tria2=(Tria*)elements[1];
+-
+-	/*First recover velocity: */
+-	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
+-	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
+-	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
+-	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
+-
+-	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
+-	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
+-
+-	/*Ok, we are preconstraining here. Ie, anything that penetrates is constrained until stability of the entire set 
+-	 * of constraints is reached.: */
+-	if(penetration<0){
+-		if (!this->active){
+-			/*This is the first time penetration happens: */
+-			this->active=1;
+-			unstable=1;
+-		}
+-		else{
+-			/*This constraint was already active: */
+-			this->active=1;
+-			unstable=0;
+-		}
+-	}
+-	else{
+-		/*No penetration happening. : */
+-		if (!this->active){
+-			/*This penalty was not active, and no penetration happening. Do nonthing: */
+-			this->active=0;
+-			unstable=0; 
+-		}
+-		else{
+-			/*Ok, this penalty wants to get released. But not now, this is preconstraint, not constraint: */
+-			this->active=1;
+-			unstable=0;
+-		}
+-	}
+-
+-	/*assign output pointer: */
+-	*punstable=unstable;
+-	return 1;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::PreStable {{{*/
+-bool  Riftfront::PreStable(){
+-	return prestable;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::SetPreStable {{{*/
+-void Riftfront::SetPreStable(){
+-	prestable=1;
+-}
+-/*}}}*/
+-/*FUNCTION Riftfront::IsInput{{{*/
+-bool Riftfront::IsInput(int name){
+-	if (
+-				name==ConvergedEnum ||
+-				name==ThicknessEnum ||
+-				name==SurfaceEnum ||
+-				name==BedEnum 
+-		){
+-		return true;
+-	}
+-	else return false;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 12822)
+@@ -1,149 +0,0 @@
+-/*!\file PetscVecExternalResult.c
+- * \brief: implementation of the PetscVecExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*PetscVecExternalResult constructors and destructor*/
+-/*FUNCTION PetscVecExternalResult::PetscVecExternalResult(){{{*/
+-PetscVecExternalResult::PetscVecExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::PetscVecExternalResult(int enum_type,IssmPetscVec value){{{*/
+-PetscVecExternalResult::PetscVecExternalResult(int in_id, int in_enum_type,Vector* in_value,int in_step, IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-
+-	value=NULL;
+-
+-	if(in_value){
+-		value=in_value->Duplicate();
+-		in_value->Copy(value);
+-	}
+-	else value=NULL;
+-
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::~PetscVecExternalResult(){{{*/
+-PetscVecExternalResult::~PetscVecExternalResult(){
+-	VecFree(&value);
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION PetscVecExternalResult::Echo {{{*/
+-void PetscVecExternalResult::Echo(void){
+-
+-	_printLine_("PetscVecExternalResult:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::DeepEcho{{{*/
+-void PetscVecExternalResult::DeepEcho(void){
+-
+-	int i;
+-	_printLine_("PetscVecExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-	VecView(value,PETSC_VIEWER_STDOUT_WORLD);
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::Id{{{*/
+-int    PetscVecExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::MyRank{{{*/
+-int    PetscVecExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::ObjectEnum{{{*/
+-int PetscVecExternalResult::ObjectEnum(void){
+-
+-	return PetscVecExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::copy{{{*/
+-Object* PetscVecExternalResult::copy() {
+-	
+-	return new PetscVecExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*PetscVecExternalResult management: */
+-/*FUNCTION PetscVecExternalResult::WriteData{{{*/
+-void   PetscVecExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     size;
+-	char   *name      = NULL;
+-	IssmPDouble *serialvec = NULL;
+-	extern int my_rank;
+-	IssmPDouble passiveDouble;
+-
+-	/*serialize: */
+-	VecGetSize(this->value,&size);
+-	VecToMPISerial(&serialvec,this->value);
+-
+-	/*now, exit if we are not on cpu 0: */
+-	if(my_rank)return;
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-        passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmDouble, type is 1, size is 1: */
+-	type=1;
+-	
+-	fwrite(&type,sizeof(int),1,fid);
+-	fwrite(&size,sizeof(int),1,fid);
+-	fwrite(serialvec,size*sizeof(IssmPDouble),1,fid);
+-
+-	/*Free ressources:*/
+-	xDelete<IssmPDouble>(serialvec);
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::GetResultName{{{*/
+-void PetscVecExternalResult::GetResultName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::GetStep{{{*/
+-int PetscVecExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 12822)
+@@ -1,166 +0,0 @@
+-/*!\file DoubleMatExternalResult.c
+- * \brief: implementation of the DoubleMatExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*DoubleMatExternalResult constructors and destructor*/
+-/*FUNCTION DoubleMatExternalResult::DoubleMatExternalResult(){{{*/
+-DoubleMatExternalResult::DoubleMatExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::DoubleMatExternalResult(int in_id, int enum_type,IssmDoubleMat values,int M,int N,int in_step,IssmDouble in_time){{{*/
+-DoubleMatExternalResult::DoubleMatExternalResult(int in_id, int in_enum_type,IssmDouble* in_values, int in_M,int in_N,int in_step,IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	M=in_M;
+-	N=in_N;
+-
+-	/*Copy result in values*/
+-	if(M*N){
+-		values=xNew<IssmDouble>(M*N);
+-		xMemCpy<IssmDouble>(values,in_values,M*N);
+-	}
+-	else values=NULL;
+-
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::~DoubleMatExternalResult(){{{*/
+-DoubleMatExternalResult::~DoubleMatExternalResult(){
+-
+-	xDelete<IssmDouble>(this->values);
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleMatExternalResult::Echo {{{*/
+-void DoubleMatExternalResult::Echo(void){
+-
+-	_printLine_("DoubleMatExternalResult:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-	_printLine_("   matrix size: " << this->M << "-" << this->N);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::DeepEcho{{{*/
+-void DoubleMatExternalResult::DeepEcho(void){
+-
+-	int i,j;
+-	
+-	_printLine_("DoubleMatExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-	_printLine_("   matrix size: " << this->M << "-" << this->N);
+-	for (i=0;i<this->M;i++){  
+-		_printString_("   [ ");
+-		for (j=0;j<this->N;j++){
+-			_printString_( " " << setw(11) << setprecision (5) << this->values[i*this->N+j]);
+-		}  
+-		_printLine_(" ]");
+-	}  
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::Id{{{*/
+-int    DoubleMatExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::MyRank{{{*/
+-int    DoubleMatExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::ObjectEnum{{{*/
+-int DoubleMatExternalResult::ObjectEnum(void){
+-
+-	return DoubleMatExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::copy{{{*/
+-Object* DoubleMatExternalResult::copy() {
+-	
+-	return new DoubleMatExternalResult(this->id,this->enum_type,this->values,this->M,this->N,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*DoubleMatExternalResult management: */
+-/*FUNCTION DoubleMatExternalResult::WriteData{{{*/
+-void   DoubleMatExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     rows,cols;
+-	char   *name    = NULL;
+-	extern  int my_rank;
+-	IssmPDouble *passiveDouble_p=NULL;
+-	IssmPDouble passiveDouble;
+-
+-	if(io_gather){
+-		/*we are gathering the data on cpu 0, don't write on other cpus: */
+-		if(my_rank) return;
+-	}
+-
+-	passiveDouble_p=xNew<IssmPDouble>(M*N);
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-	passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmDouble array, type is 3:*/
+-	type=3;
+-	fwrite(&type,sizeof(int),1,fid);
+-	rows=this->M;
+-	fwrite(&rows,sizeof(int),1,fid);
+-	cols=this->N;
+-	fwrite(&cols,sizeof(int),1,fid);
+-	for (int i=0; i<N*M; ++i) passiveDouble_p[i]=reCast<IssmPDouble>(values[i]);
+-	fwrite(passiveDouble_p,cols*rows*sizeof(IssmPDouble),1,fid);
+-	xDelete(passiveDouble_p);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::GetResultName{{{*/
+-void DoubleMatExternalResult::GetResultName(char** pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::GetStep{{{*/
+-int DoubleMatExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.h	(revision 12822)
+@@ -1,55 +0,0 @@
+-/*! \file DoubleVecExternalResult.h 
+- */
+-
+-
+-#ifndef _DOUBLEVECEXTERNALRESULT_H_
+-#define _DOUBLEVECEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-class DoubleVecExternalResult: public ExternalResult{
+-
+-	private: 
+-		int id;
+-		int enum_type;
+-		IssmDouble* values;
+-		int M;
+-		int step;
+-		IssmDouble time;
+-
+-	public:
+-		/*DoubleVecExternalResult constructors, destructors: {{{*/
+-		DoubleVecExternalResult();
+-		DoubleVecExternalResult(int id,int enum_type,IssmDouble* values,int M,int step, IssmDouble time);
+-		~DoubleVecExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult management: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEVECEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.h	(revision 12822)
+@@ -1,56 +0,0 @@
+-/*! \file DoubleExternalResult.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _DOUBLEEXTERNALRESULT_H_
+-#define _DOUBLEEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-
+-#include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-class DoubleExternalResult: public ExternalResult{
+-
+-	public:
+-		int    id;
+-		int    enum_type;
+-		IssmDouble value;
+-		int    step;
+-		IssmDouble time;
+-
+-
+-		/*DoubleExternalResult constructors, destructors: {{{*/
+-		DoubleExternalResult();
+-		DoubleExternalResult(int id,int enum_type,IssmDouble value,int step,IssmDouble time);
+-		~DoubleExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult management: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.h	(revision 12822)
+@@ -1,54 +0,0 @@
+-/*! \file IntExternalResult.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _INTEXTERNALRESULT_H_
+-#define _INTEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-/*}}}*/
+-
+-class IntExternalResult: public ExternalResult{
+-
+-	public:
+-		int    id;
+-		int    enum_type;
+-		int    value;
+-		int    step;
+-		IssmDouble time;
+-
+-
+-		/*IntExternalResult constructors, destructors: {{{*/
+-		IntExternalResult();
+-		IntExternalResult(int id,int enum_type,int value,int step,IssmDouble time);
+-		~IntExternalResult();
+-
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult managemnet: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _INTEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.h	(revision 12822)
+@@ -1,54 +0,0 @@
+-/*! \file BoolExternalResult.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _BOOLEXTERNALRESULT_H_
+-#define _BOOLEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-class BoolExternalResult: public ExternalResult{
+-
+-	public:
+-		int    id;
+-		int    enum_type;
+-		bool   value;
+-		int    step;
+-		IssmDouble time;
+-
+-		/*BoolExternalResult constructors, destructors: {{{*/
+-		BoolExternalResult();
+-		BoolExternalResult(int id, int enum_type,bool value,int step,IssmDouble time);
+-		~BoolExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult management: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.h	(revision 12822)
+@@ -1,55 +0,0 @@
+-/*! \file PetscVecExternalResult.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _PETSCVECEXTERNALRESULT_H_
+-#define _PETSCVECEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-class PetscVecExternalResult: public ExternalResult{
+-
+-	private: 
+-		int id;
+-		int enum_type;
+-		Vector* value;
+-		int step;
+-		IssmDouble time;
+-
+-	public:
+-		/*PetscVecExternalResult constructors, destructors: {{{*/
+-		PetscVecExternalResult();
+-		PetscVecExternalResult(int id,int enum_type,Vector* value, int step, IssmDouble time);
+-		~PetscVecExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult management: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _PETSCVECEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.h	(revision 12822)
+@@ -1,56 +0,0 @@
+-/*! \file DoubleMatExternalResult.h 
+- */
+-
+-
+-#ifndef _DOUBLEMATEXTERNALRESULT_H_
+-#define _DOUBLEMATEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-class DoubleMatExternalResult: public ExternalResult{
+-
+-	private: 
+-		int id;
+-		int enum_type;
+-		IssmDouble* values;
+-		int M;
+-		int N;
+-		int step;
+-		IssmDouble time;
+-
+-	public:
+-		/*DoubleMatExternalResult constructors, destructors: {{{*/
+-		DoubleMatExternalResult();
+-		DoubleMatExternalResult(int id,int enum_type,IssmDouble* values,int M,int N,int step, IssmDouble time);
+-		~DoubleMatExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult managemnet: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEMATEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/ExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/ExternalResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/ExternalResult.h	(revision 12822)
+@@ -1,34 +0,0 @@
+-/*!\file:  ExternalResult.h
+- * \brief abstract class for ExternalResult object
+- */ 
+-
+-
+-#ifndef _EXTERNALRESULT_H_
+-#define _EXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "../Object.h"
+-#include "../Node.h"
+-/*}}}*/
+-
+-class ExternalResult: public Object{
+-
+-	public: 
+-		
+-		virtual        ~ExternalResult(){};
+-		/*Virtual functions:{{{*/
+-		virtual int   InstanceEnum()=0;
+-		virtual void  WriteData(FILE* fid,bool io_gather)=0;
+-		virtual void  GetResultName(char**)=0;
+-		virtual int   GetStep(void)=0;
+-		/*}}}*/
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 12822)
+@@ -1,132 +0,0 @@
+-/*!\file StringExternalResult.c
+- * \brief: implementation of the StringExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*StringExternalResult constructors and destructor*/
+-/*FUNCTION StringExternalResult::StringExternalResult(){{{*/
+-StringExternalResult::StringExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::StringExternalResult(int enum_type,IssmString value){{{*/
+-StringExternalResult::StringExternalResult(int in_id, int in_enum_type,char* in_value,int in_step, IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	value=xNew<char>(strlen(in_value)+1);
+-	xMemCpy<char>(value,in_value,(strlen(in_value)+1));
+-	step=in_step;
+-	time=in_time;
+-	
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::~StringExternalResult(){{{*/
+-StringExternalResult::~StringExternalResult(){
+-	xDelete<char>(value);
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION StringExternalResult::Echo {{{*/
+-void StringExternalResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::DeepEcho{{{*/
+-void StringExternalResult::DeepEcho(void){
+-
+-	_printLine_("StringExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::Id{{{*/
+-int    StringExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION StringExternalResult::MyRank{{{*/
+-int    StringExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::ObjectEnum{{{*/
+-int StringExternalResult::ObjectEnum(void){
+-
+-	return StringExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::copy{{{*/
+-Object* StringExternalResult::copy() {
+-	
+-	return new StringExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*StringExternalResult management: */
+-/*FUNCTION StringExternalResult::WriteData{{{*/
+-void   StringExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	char   *name      = NULL;
+-	extern  int my_rank;
+-        IssmPDouble passiveDouble;
+-
+-	/*return if now on cpu 0: */
+-	if(my_rank)return;
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-        passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a string, type is 2: */
+-	type=2;
+-	fwrite(&type,sizeof(int),1,fid);
+-	
+-	length=(strlen(this->value)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(this->value,length,1,fid);
+-
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::GetResultName{{{*/
+-void StringExternalResult::GetResultName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::GetStep{{{*/
+-int StringExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 12822)
+@@ -1,152 +0,0 @@
+-/*!\file DoubleVecExternalResult.c
+- * \brief: implementation of the DoubleVecExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*DoubleVecExternalResult constructors and destructor*/
+-/*FUNCTION DoubleVecExternalResult::DoubleVecExternalResult(){{{*/
+-DoubleVecExternalResult::DoubleVecExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::DoubleVecExternalResult(int enum_type,IssmDoubleVec values,int M,int in_step,IssmDouble in_time){{{*/
+-DoubleVecExternalResult::DoubleVecExternalResult(int in_id, int in_enum_type,IssmDouble* in_values, int in_M,int in_step,IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	M=in_M;
+-
+-	if(M){
+-		values=xNew<IssmDouble>(M);
+-		xMemCpy<IssmDouble>(values,in_values,M);
+-	}
+-	else values=NULL;
+-
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::~DoubleVecExternalResult(){{{*/
+-DoubleVecExternalResult::~DoubleVecExternalResult(){
+-	xDelete<IssmDouble>(values);
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleVecExternalResult::Echo {{{*/
+-void DoubleVecExternalResult::Echo(void){
+-
+-	_printLine_("DoubleVecExternalResult:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   vector size: " << this->M);
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::DeepEcho{{{*/
+-void DoubleVecExternalResult::DeepEcho(void){
+-
+-	int i;
+-	
+-	_printLine_("DoubleVecExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   vector size: " << this->M);
+-	for(i=0;i<this->M;i++){
+-		_printLine_(i << " " << this->values[i]);
+-	}
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::Id{{{*/
+-int    DoubleVecExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::MyRank{{{*/
+-int    DoubleVecExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::ObjectEnum{{{*/
+-int DoubleVecExternalResult::ObjectEnum(void){
+-
+-	return DoubleVecExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::copy{{{*/
+-Object* DoubleVecExternalResult::copy() {
+-	
+-	return new DoubleVecExternalResult(this->id,this->enum_type,this->values,this->M,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*DoubleVecExternalResult management: */
+-/*FUNCTION DoubleVecExternalResult::WriteData{{{*/
+-void   DoubleVecExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     size;
+-	char   *name    = NULL;
+-	extern  int my_rank;
+-	IssmPDouble *passiveDouble_p=NULL;
+-	IssmPDouble passiveDouble;
+-
+-	/*return if now on cpu 0: */
+-	if(my_rank)return;
+-
+-	passiveDouble_p=xNew<IssmPDouble>(M);
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-        passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmDouble, type is 1, size is 1: */
+-	type=1;
+-	size=this->M;
+-	fwrite(&type,sizeof(int),1,fid);
+-	fwrite(&size,sizeof(int),1,fid);
+-        for (int i=0; i<M; ++i) passiveDouble_p[i]=reCast<IssmPDouble>(values[i]);
+-	fwrite(passiveDouble_p,size*sizeof(IssmPDouble),1,fid);
+-        xDelete(passiveDouble_p);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::GetResultName{{{*/
+-void DoubleVecExternalResult::GetResultName(char** pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::GetStep{{{*/
+-int DoubleVecExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.cpp	(revision 12822)
+@@ -1,132 +0,0 @@
+-/*!\file IntExternalResult.c
+- * \brief: implementation of the IntExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*IntExternalResult constructors and destructor*/
+-/*FUNCTION IntExternalResult::IntExternalResult(){{{*/
+-IntExternalResult::IntExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::IntExternalResult(int in_id, int in_enum_type,int in_value,int in_step, IssmDouble in_time){{{*/
+-IntExternalResult::IntExternalResult(int in_id, int in_enum_type,int in_value,int in_step, IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	value=in_value;
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::~IntExternalResult(){{{*/
+-IntExternalResult::~IntExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION IntExternalResult::Echo {{{*/
+-void IntExternalResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::DeepEcho{{{*/
+-void IntExternalResult::DeepEcho(void){
+-
+-	_printLine_("IntExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::Id{{{*/
+-int    IntExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION IntExternalResult::MyRank{{{*/
+-int    IntExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::ObjectEnum{{{*/
+-int IntExternalResult::ObjectEnum(void){
+-
+-	return IntExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::copy{{{*/
+-Object* IntExternalResult::copy() {
+-	
+-	return new IntExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*IntExternalResult management: */
+-/*FUNCTION IntExternalResult::WriteData{{{*/
+-void   IntExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     size;
+-	char   *name    = NULL;
+-	IssmPDouble  passiveDouble;
+-	extern  int my_rank;
+-
+-	/*return if now on cpu 0: */
+-	if(my_rank)return;
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-        passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmPDouble, type is 1, size is 1: */
+-	type=1;
+-	size=1;
+-	fwrite(&type,sizeof(int),1,fid);
+-	fwrite(&size,sizeof(int),1,fid);
+-        /*cast to a IssmPDouble: */
+-        passiveDouble=reCast<IssmPDouble>(value);
+-	fwrite(&passiveDouble,size*sizeof(IssmPDouble),1,fid);
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::GetResultName{{{*/
+-void IntExternalResult::GetResultName(char** pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::GetStep{{{*/
+-int IntExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.cpp	(revision 12822)
+@@ -1,131 +0,0 @@
+-/*!\file DoubleExternalResult.c
+- * \brief: implementation of the DoubleExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*DoubleExternalResult constructors and destructor*/
+-/*FUNCTION DoubleExternalResult::DoubleExternalResult(){{{*/
+-DoubleExternalResult::DoubleExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::DoubleExternalResult(int enum_type,IssmDouble value){{{*/
+-DoubleExternalResult::DoubleExternalResult(int in_id, int in_enum_type,IssmDouble in_value,int in_step, IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	value=in_value;
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::~DoubleExternalResult(){{{*/
+-DoubleExternalResult::~DoubleExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleExternalResult::Echo {{{*/
+-void DoubleExternalResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::DeepEcho{{{*/
+-void DoubleExternalResult::DeepEcho(void){
+-
+-	_printLine_("DoubleExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::Id{{{*/
+-int    DoubleExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::MyRank{{{*/
+-int    DoubleExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::ObjectEnum{{{*/
+-int DoubleExternalResult::ObjectEnum(void){
+-
+-	return DoubleExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::copy{{{*/
+-Object* DoubleExternalResult::copy() {
+-	
+-	return new DoubleExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*DoubleExternalResult management: */
+-/*FUNCTION DoubleExternalResult::WriteData{{{*/
+-void   DoubleExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     size;
+-	char   *name    = NULL;
+-	extern  int my_rank;
+-	IssmPDouble passiveDouble;
+-
+-	/*return if now on cpu 0: */
+-	if(my_rank)return;
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-	passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmDouble, type is 1, size is 1: */
+-	type=1;
+-	size=1;
+-	fwrite(&type,sizeof(int),1,fid);
+-	fwrite(&size,sizeof(int),1,fid);
+-        passiveDouble=reCast<IssmPDouble>(this->value);
+-	fwrite(&passiveDouble,size*sizeof(IssmPDouble),1,fid);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::GetResultName{{{*/
+-void DoubleExternalResult::GetResultName(char** pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::GetStep{{{*/
+-int DoubleExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.cpp	(revision 12822)
+@@ -1,132 +0,0 @@
+-/*!\file BoolExternalResult.c
+- * \brief: implementation of the BoolExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*BoolExternalResult constructors and destructor*/
+-/*FUNCTION BoolExternalResult::BoolExternalResult(){{{*/
+-BoolExternalResult::BoolExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::BoolExternalResult(int enum_type,bool value){{{*/
+-BoolExternalResult::BoolExternalResult(int in_id, int in_enum_type,bool in_value,int in_step, IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	value=in_value;
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::~BoolExternalResult(){{{*/
+-BoolExternalResult::~BoolExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION BoolExternalResult::Echo {{{*/
+-void BoolExternalResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::DeepEcho{{{*/
+-void BoolExternalResult::DeepEcho(void){
+-
+-	_printLine_("BoolExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " <<(this->value?"true":"false"));
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::Id{{{*/
+-int    BoolExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::MyRank{{{*/
+-int    BoolExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::ObjectEnum{{{*/
+-int BoolExternalResult::ObjectEnum(void){
+-
+-	return BoolExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::copy{{{*/
+-Object* BoolExternalResult::copy() {
+-	
+-	return new BoolExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*BoolExternalResult management: */
+-/*FUNCTION BoolExternalResult::WriteData{{{*/
+-void   BoolExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     size;
+-	IssmPDouble  passiveDouble;
+-	extern  int my_rank;
+-	char*   name = NULL;
+-
+-	/*return if now on cpu 0: */
+-	if(my_rank)return;
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-	passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmDouble, type is 1, size is 1: */
+-	type=1;
+-	size=1;
+-	fwrite(&type,sizeof(int),1,fid);
+-	fwrite(&size,sizeof(int),1,fid);
+-        /*Now write bool, after casting it: */
+-        passiveDouble=reCast<IssmPDouble>(this->value);
+-        fwrite(&passiveDouble,size*sizeof(IssmPDouble),1,fid);
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::GetResultName{{{*/
+-void BoolExternalResult::GetResultName(char** pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::GetStep{{{*/
+-int BoolExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.h	(revision 12822)
+@@ -1,55 +0,0 @@
+-/*! \file StringExternalResult.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _STRINGEXTERNALRESULT_H_
+-#define _STRINGEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-class StringExternalResult: public ExternalResult{
+-
+-	private: 
+-		int    id;
+-		int    enum_type;
+-		char*  value;
+-		int    step;
+-		IssmDouble time;
+-
+-	public:
+-		/*StringExternalResult constructors, destructors: {{{*/
+-		StringExternalResult();
+-		StringExternalResult(int id,int enum_type,char* value,int step, IssmDouble time);
+-		~StringExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult management: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _STRINGEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/OptArgs.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/OptArgs.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/OptArgs.h	(revision 12822)
+@@ -1,13 +0,0 @@
+-/*!\file:  OptArgs.h
+- * \brief place holder for optimization function arguments
+- */ 
+-
+-#ifndef _OPTARGS_H_
+-#define _OPTARGS_H_
+-
+-class Model;
+-struct OptArgs{
+-	FemModel* femmodel;
+-};
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcDynamic.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcDynamic.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcDynamic.h	(revision 12822)
+@@ -1,52 +0,0 @@
+-/*!\file SpcDynamic.h
+- * \brief: header file for spc object
+- */
+-
+-#ifndef _SPCDynamic_H_
+-#define _SPCDynamic_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Object.h"
+-class DataSet;
+-/*}}}*/
+-
+-class SpcDynamic: public Constraint{
+-
+-	private: 
+-		int	sid; /*! id, to track it*/
+-		int	nodeid; /*!node id*/
+-		int dof; /*!component*/
+-		IssmDouble value; /*value*/
+-		bool isset;
+-		int analysis_type;
+-
+-	public:
+-
+-		/*SpcDynamic constructors, destructors:{{{*/
+-		SpcDynamic();
+-		SpcDynamic(int sid,int nodeid, int dof,int analysis_type);
+-		~SpcDynamic();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Constraint virtual functions definitions: {{{*/
+-		void   ConstrainNode(Nodes* nodes,Parameters* parameters);
+-		bool   InAnalysis(int analysis_type);
+-		/*}}}*/
+-		/*SpcDynamic management:{{{ */
+-		int    GetNodeId();
+-		int    GetDof();
+-		IssmDouble GetValue();
+-		void   SetDynamicConstraint(Nodes* nodes,IssmDouble *yg_serial);
+-		/*}}}*/
+-
+-};
+-
+-#endif  /* _SPCStatic_H_*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcStatic.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcStatic.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcStatic.h	(revision 12822)
+@@ -1,50 +0,0 @@
+-/*!\file SpcStatic.h
+- * \brief: header file for spc object
+- */
+-
+-#ifndef _SPCStatic_H_
+-#define _SPCStatic_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Object.h"
+-class DataSet;
+-/*}}}*/
+-
+-class SpcStatic: public Constraint{
+-
+-	private: 
+-		int	sid; /*! id, to track it*/
+-		int	nodeid; /*!node id*/
+-		int dof; /*!component*/
+-		IssmDouble value; /*value*/
+-		int analysis_type;
+-
+-	public:
+-
+-		/*SpcStatic constructors, destructors:{{{*/
+-		SpcStatic();
+-		SpcStatic(int sid,int nodeid, int dof,IssmDouble value,int analysis_type);
+-		~SpcStatic();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Constraint virtual functions definitions: {{{*/
+-		void   ConstrainNode(Nodes* nodes,Parameters* parameters);
+-		bool   InAnalysis(int analysis_type);
+-		/*}}}*/
+-		/*SpcStatic management:{{{ */
+-		int    GetNodeId();
+-		int    GetDof();
+-		IssmDouble GetValue();
+-		/*}}}*/
+-
+-};
+-
+-#endif  /* _SPCStatic_H_*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcTransient.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcTransient.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcTransient.h	(revision 12822)
+@@ -1,52 +0,0 @@
+-/*!\file SpcTransient.h
+- * \brief: header file for spc object
+- */
+-
+-#ifndef _SPCTRANSIENT_H_
+-#define _SPCTRANSIENT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Object.h"
+-class DataSet;
+-/*}}}*/
+-
+-class SpcTransient: public Constraint{
+-
+-	private: 
+-		int	sid; /*! id, to track it*/
+-		int	nodeid; /*!node id*/
+-		int dof; /*!component*/
+-		IssmDouble* values; /*different values in time*/
+-		IssmDouble* times; /*different time steps*/
+-		int nsteps; /*number of time steps*/
+-		int analysis_type;
+-
+-	public:
+-
+-		/*SpcTransient constructors, destructors:{{{*/
+-		SpcTransient();
+-		SpcTransient(int sid,int nodeid, int dof,int nsteps, IssmDouble* times, IssmDouble* values,int analysis_type);
+-		~SpcTransient();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Constraint virtual functions definitions: {{{*/
+-		void   ConstrainNode(Nodes* nodes,Parameters* parameters);
+-		bool   InAnalysis(int analysis_type);
+-		/*}}}*/
+-		/*SpcTransient management:{{{ */
+-		int    GetNodeId();
+-		int    GetDof();
+-		IssmDouble GetValue();
+-		/*}}}*/
+-
+-};
+-
+-#endif  /* _SPCTRANSIENT_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/Constraint.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/Constraint.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/Constraint.h	(revision 12822)
+@@ -1,28 +0,0 @@
+-/*!\file:  Constraint.h
+- * \brief abstract class for Constraint object
+- * This class is a place holder for constraints
+- * It is derived from Object, so DataSets can contain them.
+- */ 
+-
+-
+-#ifndef _CONSTRAINT_H_
+-#define _CONSTRAINT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-class Nodes;
+-#include "../Object.h"
+-#include "../../toolkits/toolkits.h"
+-/*}}}*/
+-
+-class Constraint: public Object{
+-
+-	public: 
+-		
+-		virtual      ~Constraint(){};
+-		virtual void ConstrainNode(Nodes* nodes,Parameters* parameters)=0;
+-		virtual bool InAnalysis(int analysis_type)=0;
+-
+-
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcDynamic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcDynamic.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcDynamic.cpp	(revision 12822)
+@@ -1,141 +0,0 @@
+-/*!\file SpcDynamic.c
+- * \brief: implementation of the SpcDynamic object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../Container/Container.h"
+-#include "../objects.h"
+-
+-/*SpcDynamic constructors and destructor*/
+-/*FUNCTION 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){
+-
+-	sid=spc_sid;
+-	nodeid=spc_nodeid;
+-	dof=spc_dof;
+-	value=0;
+-	analysis_type=spc_analysis_type;
+-	isset=false;
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION SpcDynamic::~SpcDynamic{{{*/
+-SpcDynamic::~SpcDynamic(){
+-	return;
+-}
+-/*}}}*/
+-		
+-/*Object virtual functions definitions:*/
+-/*FUNCTION SpcDynamic::Echo {{{*/
+-void SpcDynamic::Echo(void){
+-
+-	_printLine_("SpcDynamic:");
+-	_printLine_("   sid: " << sid);
+-	_printLine_("   nodeid: " << nodeid);
+-	_printLine_("   dof: " << dof);
+-	_printLine_("   value: " << value);
+-	_printLine_("   isset: " <<(isset?"true":"false"));
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION SpcDynamic::DeepEcho {{{*/
+-void SpcDynamic::DeepEcho(void){
+-
+-	this->Echo();
+-	return;
+-}		
+-/*}}}*/
+-/*FUNCTION SpcDynamic::Id {{{*/
+-int    SpcDynamic::Id(void){ return sid; }
+-/*}}}*/
+-/*FUNCTION SpcDynamic::MyRank {{{*/
+-int    SpcDynamic::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION SpcDynamic::ObjectEnum{{{*/
+-int SpcDynamic::ObjectEnum(void){
+-
+-	return SpcDynamicEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION SpcDynamic::copy {{{*/
+-Object* SpcDynamic::copy() {
+-	return new SpcDynamic(*this); 
+-}
+-/*}}}*/
+-
+-/*Constraint virtual functions definitions: */
+-/*FUNCTION SpcDynamic::InAnalysis{{{*/
+-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){
+-
+-	Node* node=NULL;
+-
+-	/*Chase through nodes and find the node to which this SpcDynamic applys: */
+-	node=(Node*)nodes->GetObjectById(NULL,nodeid);
+-
+-	/*Apply constraint: */
+-	if(node){ //in case the spc is dealing with a node on another cpu
+-
+-		/*We should first check that the value has been set... (test306)*/
+-		node->ApplyConstraint(dof,value);
+-	}
+-}
+-/*}}}*/
+-
+-/*SpcDynamic functions*/
+-/*FUNCTION SpcDynamic::GetDof {{{*/
+-int SpcDynamic::GetDof(){
+-	return dof;
+-}
+-/*}}}*/
+-/*FUNCTION SpcDynamic::GetNodeId {{{*/
+-int   SpcDynamic::GetNodeId(){
+-	
+-	return nodeid;
+-}
+-/*}}}*/
+-/*FUNCTION 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){
+-
+-	int pos;
+-
+-	Node* node=(Node*)nodes->GetObjectById(NULL,nodeid);
+-	pos=node->GetDof(dof-1,GsetEnum);
+-
+-	this->value=yg_serial[pos];
+-	this->isset=true;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcStatic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcStatic.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcStatic.cpp	(revision 12822)
+@@ -1,129 +0,0 @@
+-/*!\file SpcStatic.c
+- * \brief: implementation of the SpcStatic object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../Container/Container.h"
+-#include "../objects.h"
+-
+-/*SpcStatic constructors and destructor*/
+-/*FUNCTION 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){
+-
+-	sid=spc_sid;
+-	nodeid=spc_nodeid;
+-	dof=spc_dof;
+-	value=spc_value;
+-	analysis_type=spc_analysis_type;
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION SpcStatic::~SpcStatic{{{*/
+-SpcStatic::~SpcStatic(){
+-	return;
+-}
+-/*}}}*/
+-		
+-/*Object virtual functions definitions:*/
+-/*FUNCTION SpcStatic::Echo {{{*/
+-void SpcStatic::Echo(void){
+-
+-	_printLine_("SpcStatic:");
+-	_printLine_("   sid: " << sid);
+-	_printLine_("   nodeid: " << nodeid);
+-	_printLine_("   dof: " << dof);
+-	_printLine_("   value: " << value);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION SpcStatic::DeepEcho {{{*/
+-void SpcStatic::DeepEcho(void){
+-
+-	_printLine_("SpcStatic:");
+-	_printLine_("   sid: " << sid);
+-	_printLine_("   nodeid: " << nodeid);
+-	_printLine_("   dof: " << dof);
+-	_printLine_("   value: " << value);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	return;
+-}		
+-/*}}}*/
+-/*FUNCTION SpcStatic::Id {{{*/
+-int    SpcStatic::Id(void){ return sid; }
+-/*}}}*/
+-/*FUNCTION SpcStatic::MyRank {{{*/
+-int    SpcStatic::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION SpcStatic::ObjectEnum{{{*/
+-int SpcStatic::ObjectEnum(void){
+-
+-	return SpcStaticEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION SpcStatic::copy {{{*/
+-Object* SpcStatic::copy() {
+-	return new SpcStatic(*this); 
+-}
+-/*}}}*/
+-
+-/*Constraint virtual functions definitions: */
+-/*FUNCTION SpcStatic::InAnalysis{{{*/
+-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){
+-
+-	Node* node=NULL;
+-
+-	/*Chase through nodes and find the node to which this SpcStatic applys: */
+-	node=(Node*)nodes->GetObjectById(NULL,nodeid);
+-
+-	/*Apply constraint: */
+-	if(node){ //in case the spc is dealing with a node on another cpu
+-		node->ApplyConstraint(dof,value);
+-	}
+-}
+-/*}}}*/
+-
+-/*SpcStatic functions*/
+-/*FUNCTION SpcStatic::GetDof {{{*/
+-int SpcStatic::GetDof(){
+-	return dof;
+-}
+-/*}}}*/
+-/*FUNCTION SpcStatic::GetNodeId {{{*/
+-int   SpcStatic::GetNodeId(){
+-	
+-	return nodeid;
+-}
+-/*}}}*/
+-/*FUNCTION SpcStatic::GetValue {{{*/
+-IssmDouble SpcStatic::GetValue(){
+-	_assert_(!xIsNan<IssmDouble>(value));
+-	return value;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcTransient.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcTransient.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Constraints/SpcTransient.cpp	(revision 12822)
+@@ -1,176 +0,0 @@
+-/*!\file SpcTransient.c
+- * \brief: implementation of the SpcTransient object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../Container/Container.h"
+-#include "../objects.h"
+-
+-/*SpcTransient constructors and destructor*/
+-/*FUNCTION SpcTransient::SpcTransient(){{{*/
+-SpcTransient::SpcTransient(){
+-	sid=-1;
+-	nodeid=-1;
+-	dof=-1;
+-	values=NULL;
+-	times=NULL;
+-	nsteps=-1;
+-	analysis_type=-1;
+-	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){
+-
+-	sid=spc_sid;
+-	nodeid=spc_nodeid;
+-	dof=spc_dof;
+-	nsteps=spc_nsteps;
+-	if(spc_nsteps){
+-		values=xNew<IssmDouble>(spc_nsteps);
+-		times=xNew<IssmDouble>(spc_nsteps);
+-		xMemCpy<IssmDouble>(values,spc_values,nsteps);
+-		xMemCpy<IssmDouble>(times,spc_times,nsteps);
+-	}
+-	analysis_type=spc_analysis_type;
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION SpcTransient::~SpcTransient{{{*/
+-SpcTransient::~SpcTransient(){
+-	xDelete<IssmDouble>(times);
+-	xDelete<IssmDouble>(values);
+-	return;
+-}
+-/*}}}*/
+-		
+-/*Object virtual functions definitions:*/
+-/*FUNCTION SpcTransient::Echo {{{*/
+-void SpcTransient::Echo(void){
+-
+-	int i;
+-	_printLine_("SpcTransient:");
+-	_printLine_("   sid: " << sid);
+-	_printLine_("   nodeid: " << nodeid);
+-	_printLine_("   dof: " << dof);
+-	_printLine_("   nsteps: " << nsteps);
+-	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
+-	_printLine_("   steps|times|values");
+-	for(i=0;i<nsteps;i++){
+-		_printLine_(i << "-" << times[i] << ":" << values[i]);
+-	}
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION SpcTransient::DeepEcho {{{*/
+-void SpcTransient::DeepEcho(void){
+-	this->Echo();
+-}		
+-/*}}}*/
+-/*FUNCTION SpcTransient::Id {{{*/
+-int    SpcTransient::Id(void){ return sid; }
+-/*}}}*/
+-/*FUNCTION SpcTransient::MyRank {{{*/
+-int    SpcTransient::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION SpcTransient::ObjectEnum{{{*/
+-int SpcTransient::ObjectEnum(void){
+-
+-	return SpcTransientEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION 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){
+-	
+-	if (in_analysis_type==this->analysis_type) return true;
+-	else return false;
+-}
+-/*}}}*/
+-/*FUNCTION SpcTransient::ConstrainNode{{{*/
+-void SpcTransient::ConstrainNode(Nodes* nodes,Parameters* parameters){
+-
+-	Node* node=NULL;
+-	IssmDouble time=0;
+-	int    i;
+-	IssmDouble alpha=-1;
+-	IssmDouble value;
+-	bool   found=false;
+-
+-	/*Chase through nodes and find the node to which this SpcTransient applys: */
+-	node=(Node*)nodes->GetObjectById(NULL,nodeid);
+-	
+-	if(node){ //in case the spc is dealing with a node on another cpu
+-
+-		/*Retrieve time in parameters: */
+-		parameters->FindParam(&time,TimeEnum);
+-
+-		/*Now, go fetch value for this time: */
+-		if (time<=times[0]){
+-			value=values[0];
+-			found=true;
+-		}
+-		else if (time>=times[nsteps-1]){
+-			value=values[nsteps-1];
+-			found=true;
+-		}
+-		else{
+-			for(i=0;i<nsteps-1;i++){
+-				if (times[i]<=time && time<times[i+1]){
+-					alpha=(time-times[i])/(times[i+1]-times[i]);
+-					value=(1-alpha)*values[i]+alpha*values[i+1];
+-					found=true;
+-					break;
+-				}
+-			}
+-		}
+-
+-		if(!found)_error2_("could not find time segment for constraint");
+-
+-		/*Apply or relax constraint: */
+-		if(xIsNan<IssmDouble>(value)){
+-			node->RelaxConstraint(dof);
+-		}
+-		else node->ApplyConstraint(dof,value);
+-	}
+-}
+-/*}}}*/
+-
+-/*SpcTransient functions*/
+-/*FUNCTION SpcTransient::GetDof {{{*/
+-int SpcTransient::GetDof(){
+-	return dof;
+-}
+-/*}}}*/
+-/*FUNCTION SpcTransient::GetNodeId {{{*/
+-int   SpcTransient::GetNodeId(){
+-	
+-	return nodeid;
+-}
+-/*}}}*/
+-/*FUNCTION SpcTransient::GetValue {{{*/
+-IssmDouble SpcTransient::GetValue(){
+-	return values[0];
+-}
+-/*}}}*/
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/IoModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/IoModel.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/IoModel.cpp	(revision 12822)
+@@ -1,1250 +0,0 @@
+-/*! \file IoModel.cpp
+- * \brief  file containing the methods that will help in processing the input data coming 
+- * into ISSM, from Matlab, or through a binary file opened for reading.
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <string.h>
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <stdarg.h>
+-
+-#include "./objects.h"
+-#include "../io/io.h"
+-#include "./Container/Parameters.h"
+-#include "../shared/shared.h"
+-#include "../io/io.h"
+-#include "../include/include.h"
+-
+-/*FUNCTION IoModel::IoModel(){{{*/
+-IoModel::IoModel(){
+-	this->fid=NULL;
+-	this->data=NULL;
+-	this->constants=NULL;
+-	
+-	this->my_elements=NULL;
+-	this->my_nodes=NULL;
+-	this->my_vertices=NULL;
+-	this->singlenodetoelementconnectivity=NULL;
+-	this->numbernodetoelementconnectivity=NULL;
+-	
+-	this->nodecounter=0;
+-	this->loadcounter=0;
+-	this->constraintcounter=0;
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::IoModel(FILE*  iomodel_handle){{{*/
+-IoModel::IoModel(FILE* iomodel_handle){
+-	
+-	/*First, keep track of the file handle: */
+-	this->fid=iomodel_handle;
+-
+-	/*Check that Enums are Synchronized*/
+-	this->CheckEnumSync();
+-
+-	/*Initialize and read constants:*/
+-	this->constants=new Parameters();
+-	this->FetchConstants(); /*this routine goes through the input file, and fetches bools, ints, IssmDoubles and strings only, nothing memory intensive*/
+-
+-	/*Initialize data: */
+-	this->data=xNew<IssmDouble*>(MaximumNumberOfEnums);
+-	for(int i=0;i<MaximumNumberOfEnums;i++) this->data[i]=NULL;
+-	
+-	/*Initialize permanent data: */
+-	this->my_elements=NULL;
+-	this->my_nodes=NULL;
+-	this->my_vertices=NULL;
+-	this->singlenodetoelementconnectivity=NULL;
+-	this->numbernodetoelementconnectivity=NULL;
+-	
+-	this->nodecounter=0;
+-	this->loadcounter=0;
+-	this->constraintcounter=0;
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::~IoModel(){{{*/
+-IoModel::~IoModel(){
+-
+-	if(this->constants) delete this->constants;
+-
+-	/*Some checks in debugging mode*/
+-	#ifdef _ISSM_DEBUG_
+-	if(this->data){
+-		for(int i=0;i<MaximumNumberOfEnums;i++){
+-			if(this->data[i]){
+-				_pprintLine_("Info: previous pointer of " << EnumToStringx(i) << " has not been freed (DeleteData has not been called)");
+-			}
+-		}
+-	}
+-	#endif
+-
+-	xDelete<IssmDouble*>(this->data);
+-	xDelete<bool>(this->my_elements);
+-	xDelete<bool>(this->my_nodes);
+-	xDelete<int>(this->my_vertices);
+-	xDelete<int>(this->singlenodetoelementconnectivity);
+-	xDelete<int>(this->numbernodetoelementconnectivity);
+-}
+-/*}}}*/
+-
+-/*FUNCTION IoModel::CheckEnumSync{{{*/
+-void  IoModel::CheckEnumSync(void){
+-
+-	extern int my_rank;
+-	int record_enum = 0;
+-
+-	/*Check that some fields have been allocated*/
+-	_assert_(this->fid || my_rank);
+-
+-	/*Go find in the binary file, the position of the data we want to fetch: */
+-	if(my_rank==0){ //cpu 0
+-
+-		/*First set FILE* position to the beginning of the file: */
+-		fseek(this->fid,0,SEEK_SET);
+-
+-		/*Get first Enum*/
+-		if(fread(&record_enum,sizeof(int),1,this->fid)==0){
+-			_error2_("Marshalled file is empty");
+-		}
+-		else{
+-			if(record_enum!=MaximumNumberOfEnums){
+-				_printLine_("");
+-				_printLine_("=========================================================================");
+-				_printLine_(" Enums in marshalled file are not compatible with compiled code          ");
+-				_printLine_("                                                                         ");
+-				_printLine_("   * If you are running ISSM on a remote cluster:                        ");
+-				_printLine_("     make sure that you are using the same version of ISSM on your local ");
+-				_printLine_("     machine and remote cluster (you might need to run svn update)       ");
+-				_printLine_("   * If you are running ISSM on your local machine:                      ");
+-				_printLine_("     make sure that all the code is compiled (modules and executables)   ");
+-				_printLine_("   * If you are a developer and just added a new Enum:                   ");
+-				_printLine_("     you might need to run ./Synchronize.sh in src/c/EnumDefinitions     ");
+-				_printLine_("     and recompile                                                       ");
+-				_printLine_("=========================================================================");
+-				_printLine_("");
+-				_error2_("Enums not consistent (See error message above)");
+-			}
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::Constant(bool* poutput,int constant_enum){{{*/
+-void IoModel::Constant(bool* poutput,int constant_enum){
+-
+-	_assert_(constant_enum>=0);
+-	_assert_(this->constants);
+-
+-	this->constants->FindParam(poutput,constant_enum);
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::Constant(int* poutput,int constant_enum){{{*/
+-void IoModel::Constant(int* poutput,int constant_enum){
+-
+-	_assert_(constant_enum>=0);
+-	_assert_(this->constants);
+-
+-	this->constants->FindParam(poutput,constant_enum);
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::Constant(IssmDouble* poutput,int constant_enum){{{*/
+-void IoModel::Constant(IssmDouble* poutput,int constant_enum){
+-
+-	_assert_(constant_enum>=0);
+-	_assert_(this->constants);
+-
+-	this->constants->FindParam(poutput,constant_enum);
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::Constant(char** poutput,int constant_enum){{{*/
+-void IoModel::Constant(char** poutput,int constant_enum){
+-
+-	_assert_(constant_enum>=0);
+-	_assert_(this->constants);
+-
+-	this->constants->FindParam(poutput,constant_enum);
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::CopyConstantObject{{{*/
+-Param* IoModel::CopyConstantObject(int constant_enum){
+-
+-	_assert_(this->constants);
+-
+-	/*Find constant*/
+-	Param* param=(Param*)this->constants->FindParamObject(constant_enum);
+-	if(!param) _error2_("Constant " << EnumToStringx(constant_enum) << " not found in iomodel");
+-
+-	return (Param*)param->copy();
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::Data{{{*/
+-IssmDouble* IoModel::Data(int data_enum){
+-
+-	_assert_(data_enum<MaximumNumberOfEnums);
+-	_assert_(data_enum>=0);
+-
+-	return this->data[data_enum];
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::DeleteData{{{*/
+-void  IoModel::DeleteData(int num,...){
+-
+-	va_list ap;
+-	int     dataenum;
+-	int     i;
+-	DoubleMatParam* parameter=NULL;
+-
+-	/*Go through the entire list of enums and delete the corresponding data from the iomodel-data dataset: */
+-
+-	va_start(ap,num);
+-	for(i = 0; i <num; i++){
+-		dataenum=va_arg(ap, int);
+-		_assert_(dataenum<MaximumNumberOfEnums);
+-		xDelete<IssmDouble>(this->data[dataenum]);
+-	}
+-	va_end(ap);
+-} /*}}}*/
+-/*FUNCTION IoModel::FetchConstants{{{*/
+-void  IoModel::FetchConstants(void){
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-	
+-	/*record descriptions; */
+-	int record_enum;
+-	int record_length;
+-	int record_code; //1 to 7 number
+-
+-	/*records: */
+-	int  booleanint=0;
+-	int  integer=0;
+-	IssmPDouble scalar=0;
+-	char* string=NULL;
+-	int   string_size;
+-
+-	/*Check that some fields have been allocated*/
+-	_assert_(this->fid || my_rank);
+-	_assert_(this->constants);
+-
+-	/*Go find in the binary file, the position of the data we want to fetch: */
+-	if(my_rank==0){ //cpu 0{{{
+-	
+-		/*First set FILE* position to the beginning of the file: */
+-		fseek(this->fid,0,SEEK_SET);
+-
+-		/*Now march through file looking for the correct data identifiers (bool,int,IssmDouble or string): */
+-		for(;;){
+-			if(fread(&record_enum,sizeof(int),1,this->fid)==0){
+-
+-				/*Ok, we have reached the end of the file. break: */
+-				record_code=0; //0 means bailout
+-				#ifdef _HAVE_MPI_
+-				MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*tell others cpus we are bailing: */
+-				#endif
+-				break;
+-			}
+-			else{
+-			
+-				/* Read the record length and the data type code: */
+-				fread(&record_length,sizeof(int),1,this->fid);
+-				fread(&record_code,sizeof(int),1,this->fid);
+-					
+-				#ifdef _HAVE_MPI_
+-				/*Tell other cpus what we are doing: */
+-				MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*tell other cpus what we are going to do: */
+-
+-				/*Tell other cpus the name of the data, then branch according to the data type: */
+-				MPI_Bcast(&record_enum,1,MPI_INT,0,MPI_COMM_WORLD);  
+-				MPI_Bcast(&record_length,1,MPI_INT,0,MPI_COMM_WORLD);  
+-				#endif
+-				
+-				switch(record_code){
+-					case 1: 
+-						/*Read the boolean and broadcast it to other cpus:*/
+-						if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error2_("could not read boolean ");
+-						#ifdef _HAVE_MPI_
+-						MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+-						#endif
+-
+-						/*create BoolParam: */
+-						this->constants->AddObject(new BoolParam(record_enum,(bool)booleanint)); //cast to boolean
+-
+-						break;
+-					case 2:
+-						/*Read the integer and broadcast it to other cpus:*/
+-						if(fread(&integer,sizeof(int),1,this->fid)!=1) _error2_("could not read integer ");
+-						#ifdef _HAVE_MPI_
+-						MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+-						#endif
+-
+-						/*create IntParam: */
+-						this->constants->AddObject(new IntParam(record_enum,integer));
+-
+-						break;
+-					case 3:
+-						/*Read the scalar and broadcast it to other cpus:*/
+-						if(fread(&scalar,sizeof(IssmPDouble),1,this->fid)!=1) _error2_("could not read scalar ");
+-						#ifdef _HAVE_MPI_
+-						MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+-						#endif
+-
+-						/*create DoubleParam: */
+-						this->constants->AddObject(new DoubleParam(record_enum,scalar));
+-
+-						break;
+-					case 4: 
+-						/*We have to read a string from disk. First read the dimensions of the string, then the string: */
+-						if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error2_("could not read length of string ");
+-						#ifdef _HAVE_MPI_
+-						MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+-						#endif
+-
+-						if(string_size){
+-							string=xNew<char>(string_size+1);
+-							string[string_size]='\0';
+-
+-							/*Read string, then broadcast: */
+-							if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error2_(" could not read string ");
+-							#ifdef _HAVE_MPI_
+-							MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+-							#endif
+-						}
+-						else{
+-							string=xNew<char>(1);
+-							string[0]='\0';
+-						}
+-						
+-						/*Add string to parameters: */
+-						this->constants->AddObject(new StringParam(record_enum,string));
+-
+-						/*Free string*/
+-						xDelete<char>(string);
+-
+-						break;
+-					case 5: 
+-							/*We are not interested in this record, too memory intensive. Skip it: */
+-							/*skip: */
+-							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
+-							fseek(fid,record_length,SEEK_CUR);
+-							break;
+-					case 6: 
+-							/*We are not interested in this record, too memory intensive. Skip it: */
+-							/*skip: */
+-							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
+-							fseek(fid,record_length,SEEK_CUR);
+-							break;
+-					case 7: 
+-							/*We are not interested in this record, too memory intensive. Skip it: */
+-							/*skip: */
+-							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
+-							fseek(fid,record_length,SEEK_CUR);
+-							break;
+-
+-					case 8: 
+-							/*We are not interested in this record, too memory intensive. Skip it: */
+-							/*skip: */
+-							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
+-							fseek(fid,record_length,SEEK_CUR);
+-							break;
+-
+-					case 9: 
+-							/*We are not interested in this record, too memory intensive. Skip it: */
+-							/*skip: */
+-							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
+-							fseek(fid,record_length,SEEK_CUR);
+-							break;
+-
+-					default: 
+-						_error2_("unknown record type:" << record_code); 
+-						break;;
+-				}
+-			}
+-		}
+-	} //}}}
+-	#ifdef _HAVE_MPI_
+-	else{ //cpu ~0 {{{
+-		for(;;){ //wait on cpu 0
+-			MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*get from cpu 0 what we are going to do: */
+-			if(record_code==0){
+-				break; //we are done, break from the loop
+-			}
+-			else{
+-				MPI_Bcast(&record_enum,1,MPI_INT,0,MPI_COMM_WORLD);   //get from cpu 0 name of the data
+-				MPI_Bcast(&record_length,1,MPI_INT,0,MPI_COMM_WORLD);  
+-				switch(record_code){
+-				case 1: 
+-					/*boolean. get it from cpu 0 */
+-					MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+-						
+-					/*create BoolParam: */
+-					this->constants->AddObject(new BoolParam(record_enum,(bool)booleanint)); //cast to a boolean
+-					break;
+-
+-				case 2:
+-					/*integer. get it from cpu 0 */
+-					MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+-						
+-					/*create IntParam: */
+-					this->constants->AddObject(new IntParam(record_enum,integer));
+-
+-					break;
+-				case 3:
+-					/*scalar. get it from cpu 0 */
+-					MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+-						
+-					/*create DoubleParam: */
+-					this->constants->AddObject(new DoubleParam(record_enum,scalar));
+-
+-					break;
+-				case 4: 
+-					MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+-					if(string_size){
+-						string=xNew<char>((string_size+1));
+-						string[string_size]='\0';
+-
+-						/*Read string from cpu 0: */
+-						MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+-					}
+-					else{
+-						string=xNew<char>(1);
+-						string[0]='\0';
+-					}
+-					/*Add string to parameters: */
+-					this->constants->AddObject(new StringParam(record_enum,string));
+-
+-					/*Free string*/
+-					xDelete<char>(string);
+-
+-					break;
+-				case 5: break; //do nothing. not interested in this type of data, which is memory intensive.
+-				case 6: break; //do nothing. not interested in this type of data, which is memory intensive.
+-				case 7: break; //do nothing. not interested in this type of data, which is memory intensive.
+-				case 8: break; //do nothing. not interested in this type of data, which is memory intensive.
+-				case 9: break; //do nothing. not interested in this type of data, which is memory intensive.
+-
+-				default: 
+-					_error2_("unknown record type:" << record_code); 
+-					break;;
+-				}
+-
+-
+-			}
+-		}
+-	} //}}}
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::FetchData(bool*     pbool,int data_enum){{{*/
+-void  IoModel::FetchData(bool* pboolean,int data_enum){
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-	
+-
+-	/*output: */
+-	int   booleanint;
+-	int   code;
+-	
+-	/*Set file pointer to beginning of the data: */
+-	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+-
+-	if(code!=1)_error2_("expecting a boolean for enum " << EnumToStringx(data_enum));
+-	
+-	/*We have to read a boolean from disk. */
+-	if(my_rank==0){  
+-		if(fread(&booleanint,sizeof(int),1,fid)!=1) _error2_("could not read boolean ");
+-	}
+-	#ifdef _HAVE_MPI_
+-	MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	#endif
+-
+-	/*cast to bool: */
+-	/*Assign output pointers: */
+-	*pboolean=(bool)booleanint;
+-
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::FetchData(int*      pinteger,int data_enum){{{*/
+-void  IoModel::FetchData(int* pinteger,int data_enum){
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-
+-	/*output: */
+-	int   integer;
+-	int   code;
+-	
+-	/*Set file pointer to beginning of the data: */
+-	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+-	
+-	if(code!=2)_error2_("expecting an integer for enum " << EnumToStringx(data_enum));
+-	
+-	/*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
+-	if(my_rank==0){  
+-		if(fread(&integer,sizeof(int),1,fid)!=1) _error2_("could not read integer ");
+-	}
+-
+-	#ifdef _HAVE_MPI_
+-	MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	#endif
+-
+-	/*Assign output pointers: */
+-	*pinteger=integer;
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::FetchData(IssmDouble*   pscalar,int data_enum){{{*/
+-void  IoModel::FetchData(IssmDouble* pscalar,int data_enum){
+-
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-	
+-
+-	/*output: */
+-	IssmPDouble   scalar;
+-	int      code;
+-	
+-	/*Set file pointer to beginning of the data: */
+-	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+-	
+-	if(code!=3)_error2_("expecting a IssmDouble for enum " << EnumToStringx(data_enum));
+-	
+-	/*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */
+-	if(my_rank==0){
+-		if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1)_error2_("could not read scalar ");
+-	}
+-	#ifdef _HAVE_MPI_
+-	MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+-	#endif
+-
+-	/*Assign output pointers: */
+-	*pscalar=scalar;
+-		 
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::FetchData(char**    pstring,int data_enum){{{*/
+-void  IoModel::FetchData(char** pstring,int data_enum){
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-	
+-
+-	/*output: */
+-	char* string=NULL;
+-	int   string_size;
+-	int code=0;
+-	
+-	/*Set file pointer to beginning of the data: */
+-	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+-	
+-	if(code!=4)_error2_("expecting a string for enum " << EnumToStringx(data_enum));
+-	
+-	/*Now fetch: */
+-	
+-	/*We have to read a string from disk. First read the dimensions of the string, then the string: */
+-	if(my_rank==0){  
+-		if(fread(&string_size,sizeof(int),1,fid)!=1) _error2_("could not read length of string ");
+-	}
+-
+-	#ifdef _HAVE_MPI_
+-	MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	#endif
+-
+-	/*Now allocate string: */
+-	if(string_size){
+-		string=xNew<char>((string_size+1));
+-		string[string_size]='\0';
+-
+-		/*Read string on node 0, then broadcast: */
+-		if(my_rank==0){  
+-			if(fread(string,string_size*sizeof(char),1,fid)!=1)_error2_(" could not read string ");
+-		}
+-		#ifdef _HAVE_MPI_
+-		MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+-		#endif
+-	}
+-	else{
+-		string=xNew<char>(1);
+-		string[0]='\0';
+-	}
+-
+-
+-	/*Assign output pointers: */
+-	*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){
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-	int i,j;
+-
+-	/*output: */
+-	int M,N;
+-	IssmPDouble* matrix=NULL;
+-	int*    integer_matrix=NULL;
+-	int code=0;
+-	int vector_type=0;
+-	
+-	
+-	/*Set file pointer to beginning of the data: */
+-	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
+-
+-	if((code!=5) && (code!=6) && (code!=7))_error2_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
+-	
+-	/*Now fetch: */
+-
+-	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
+-	/*numberofelements: */
+-	if(my_rank==0){  
+-		if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows for matrix ");
+-	}
+-
+-	#ifdef _HAVE_MPI_
+-	MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	#endif
+-
+-	if(my_rank==0){  
+-		if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns for matrix ");
+-	}
+-	#ifdef _HAVE_MPI_
+-	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
+-	#endif
+-
+-	/*Now allocate matrix: */
+-	if(M*N){
+-		matrix=xNew<IssmPDouble>(M*N);
+-
+-		/*Read matrix on node 0, then broadcast: */
+-		if(my_rank==0){  
+-			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
+-		}
+-		
+-		#ifdef _HAVE_MPI_
+-		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+-		#endif
+-	}
+-
+-	/*Now cast to integer: */
+-	if(M*N){
+-		integer_matrix=xNew<int>(M*N);
+-		for (i=0;i<M;i++){
+-			for (j=0;j<N;j++){
+-				integer_matrix[i*N+j]=(int)matrix[i*N+j];
+-			}
+-		}
+-	}
+-	else{
+-		integer_matrix=NULL;
+-	}
+-	/*Free ressources:*/
+-	xDelete<IssmPDouble>(matrix);
+-
+-	/*Assign output pointers: */
+-	*pmatrix=integer_matrix;
+-	if (pM)*pM=M;
+-	if (pN)*pN=N;
+-
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::FetchData(IssmDouble**  pIssmDoublematrix,int* pM,int* pN,int data_enum){{{*/
+-void  IoModel::FetchData(IssmDouble** pmatrix,int* pM,int* pN,int data_enum){
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-
+-	/*output: */
+-	int M,N;
+-	IssmPDouble* matrix=NULL;
+-	int code=0;
+-	int vector_type=0;
+-	
+-	/*Set file pointer to beginning of the data: */
+-	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
+-	if((code!=5) && (code!=6) && (code!=7))_error2_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
+-	
+-	/*Now fetch: */
+-
+-	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
+-	/*numberofelements: */
+-	if(my_rank==0){  
+-		if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows for matrix ");
+-	}
+-	#ifdef _HAVE_MPI_
+-	MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	#endif
+-
+-	if(my_rank==0){  
+-		if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns for matrix ");
+-	}
+-	#ifdef _HAVE_MPI_
+-	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	#endif
+-
+-	/*Now allocate matrix: */
+-	if(M*N){
+-		matrix=xNew<IssmPDouble>(M*N);
+-
+-		/*Read matrix on node 0, then broadcast: */
+-		if(my_rank==0){  
+-			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
+-		}
+-		#ifdef _HAVE_MPI_
+-		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+-		#endif
+-	        *pmatrix=xNew<IssmDouble>(M*N);
+-	        for (int i=0;i<M*N;++i) (*pmatrix)[i]=matrix[i];
+-	        xDelete<IssmPDouble>(matrix);
+-	}
+-	else
+-	  *pmatrix=NULL;
+-	/*Assign output pointers: */
+-	if (pM)*pM=M;
+-	if (pN)*pN=N;
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::FetchData(char***   pstrings,int* pnumstrings,int data_enum){{{*/
+-void  IoModel::FetchData(char*** pstrings,int* pnumstrings,int data_enum){
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-	
+-	int i;
+-
+-	/*output: */
+-	int   numstrings=0;
+-	char** strings=NULL;
+-	
+-	/*intermediary: */
+-	char* string=NULL;
+-	int   string_size;
+-	int   code;
+-	
+-	/*Set file pointer to beginning of the data: */
+-	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+-	
+-	if(code!=9)_error2_("expecting a string array for enum " << EnumToStringx(data_enum));
+-	
+-	/*We have to read a bunch of strings from disk. First read the number of strings, and allocate: */
+-	if(my_rank==0){  
+-		if(fread(&numstrings,sizeof(int),1,fid)!=1) _error2_("could not read length of string array");
+-	}
+-	#ifdef _HAVE_MPI_
+-	MPI_Bcast(&numstrings,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	#endif
+-
+-	/*Now allocate string array: */
+-	if(numstrings){
+-		strings=xNew<char*>(numstrings);
+-		for(i=0;i<numstrings;i++)strings[i]=NULL;
+-
+-		/*Go through strings, and read: */
+-		for(i=0;i<numstrings;i++){
+-			
+-			if(my_rank==0){  
+-				if(fread(&string_size,sizeof(int),1,fid)!=1) _error2_("could not read length of string ");
+-			}
+-			#ifdef _HAVE_MPI_
+-			MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+-			#endif
+-			if(string_size){
+-				string=xNew<char>((string_size+1));
+-				string[string_size]='\0';
+-
+-				/*Read string on node 0, then broadcast: */
+-				if(my_rank==0){  
+-					if(fread(string,string_size*sizeof(char),1,fid)!=1)_error2_(" could not read string ");
+-				}
+-				#ifdef _HAVE_MPI_
+-				MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+-				#endif
+-			}
+-			else{
+-				string=xNew<char>(1);
+-				string[0]='\0';
+-			}
+-
+-			strings[i]=string;
+-		}
+-	}
+-
+-	/*Assign output pointers: */
+-	*pstrings=strings;
+-	*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){
+-
+-	int i;
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-
+-	/*output: */
+-	IssmDouble** matrices=NULL;
+-	int*     mdims=NULL;
+-	int*     ndims=NULL;
+-	int      numrecords=0;
+-
+-	/*intermediary: */
+-	int     M, N;
+-	IssmPDouble *matrix = NULL;
+-	int     code;
+-	
+-	/*Set file pointer to beginning of the data: */
+-	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+-	if(code!=8)_error2_("expecting a IssmDouble mat array for enum " << EnumToStringx(data_enum));
+-	
+-	/*Now fetch: */
+-	if(my_rank==0){  
+-		if(fread(&numrecords,sizeof(int),1,fid)!=1) _error2_("could not read number of records in matrix array ");
+-	}
+-	#ifdef _HAVE_MPI_
+-	MPI_Bcast(&numrecords,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	#endif
+-
+-	if(numrecords){
+-
+-		/*Allocate matrices :*/
+-		matrices=xNew<IssmDouble*>(numrecords);
+-		mdims=xNew<int>(numrecords);
+-		ndims=xNew<int>(numrecords);
+-
+-		for(i=0;i<numrecords;i++){
+-			matrices[i]=NULL;
+-			mdims[i]=0;
+-			ndims[i]=0;
+-		}
+-
+-		/*Loop through records and fetch matrix: */
+-		for(i=0;i<numrecords;i++){
+-
+-			if(my_rank==0){  
+-				if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows in " << i << "th matrix of matrix array");
+-			}
+-			#ifdef _HAVE_MPI_
+-			MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+-			#endif
+-
+-			if(my_rank==0){  
+-				if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns in " << i << "th matrix of matrix array");
+-			}
+-			#ifdef _HAVE_MPI_
+-			MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
+-			#endif
+-
+-			/*Now allocate matrix: */
+-			if(M*N){
+-				matrix=xNew<IssmPDouble>(M*N);
+-
+-				/*Read matrix on node 0, then broadcast: */
+-				if(my_rank==0){  
+-					if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
+-				}
+-
+-				#ifdef _HAVE_MPI_
+-				MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+-				#endif
+-				matrices[i]=xNew<IssmDouble>(M*N);
+-				for (int j=0;j<M*N;++j) {matrices[i][j]=matrix[j];}
+-				xDelete<IssmPDouble>(matrix);
+-			}
+-			else
+-			  matrices[i]=NULL;
+-			/*Assign: */
+-			mdims[i]=M;
+-			ndims[i]=N;
+-		}
+-	}
+-
+-	/*Assign output pointers: */
+-	*pmatrices=matrices;
+-	*pmdims=mdims;
+-	*pndims=ndims;
+-	*pnumrecords=numrecords;
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::FetchData(Option**  poption,int data_enum){{{*/
+-void  IoModel::FetchData(Option** poption,int index){
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-
+-	/*output: */
+-	int     code;
+-	Option *option      = NULL;
+-	char   *name        = NULL;
+-
+-	/*First get option name*/
+-	this->FetchData(&name,index);
+-
+-	/*Get option value*/
+-	fid=this->SetFilePointerToData(&code,NULL,index+1);
+-	switch(code){
+-		case 3: {//IssmDouble
+-			  IssmDouble *value = NULL;
+-			  value=xNew<IssmDouble>(1);
+-			  FetchData(value,index+1);
+-			  option = new OptionDouble();
+-			  ((OptionDouble*)option)->values = value;
+-			  option->name  = name;
+-			  option->numel = 1;
+-			  option->ndims = 1;
+-			  option->size  = NULL;
+-			  break;
+-			  }
+-		case 4: {//char
+-			  char* value = NULL;
+-			  FetchData(&value,index+1);
+-			  option = new OptionChar();
+-			  ((OptionChar*)option)->values = value;
+-			  option->name  = name;
+-			  option->numel = 1;
+-			  option->ndims = 1;
+-			  option->size  = NULL;
+-			  break;
+-			  }
+-		default:
+-			  _error2_("Option of format " << code << " not supported yet");
+-	}
+-
+-	/*Assign output pointers: */
+-	*poption=option;
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::FetchData(int num,...){{{*/
+-void  IoModel::FetchData(int num,...){
+-
+-	va_list ap;
+-	int     dataenum;
+-	IssmDouble* matrix=NULL;
+-	int     M,N;
+-	int     i;
+-
+-	/*Go through the entire list of enums and fetch the corresponding data. Add it to the iomodel->data dataset. Everything
+-	 *we fetch is a IssmDouble* : */
+-	
+-	va_start(ap,num);
+-	for(i=0; i<num; i++){
+-		
+-		dataenum=va_arg(ap, int);
+-
+-		/*Some checks in debugging mode*/
+-		/*{{{*/
+-		#ifdef _ISSM_DEBUG_
+-		_assert_(dataenum<MaximumNumberOfEnums);
+-		if(this->data[dataenum]){
+-			_error2_("Info: trying to fetch " << EnumToStringx(dataenum) << " but previous pointer has not been freed (DeleteData has not been called)");
+-		}
+-		#endif
+-		/*}}}*/
+-
+-		/*Add to this->data: */
+-		this->FetchData(&matrix,&M,&N,dataenum);
+-		this->data[dataenum]=matrix;
+-	}
+-	va_end(ap);
+-
+-}
+-/*}}}*/
+-/*FUNCTION IoModel::FetchDataToInput{{{*/
+-void IoModel::FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum,IssmDouble default_value){
+-
+-	/*intermediary: */
+-	int     i;
+-	bool    defaulting    = false;
+-	bool    transient     = false;
+-
+-	FILE   *fid           = NULL;
+-	int     code          = 0;
+-	int     vector_layout = 0;
+-	int     counter;
+-	int     nods;
+-	int     nel;
+-	int     numberofelements;
+-
+-
+-	/*variables being fetched: */
+-	bool    boolean;
+-	int     integer;
+-	IssmDouble  scalar;
+-	char   *string        = NULL;
+-	IssmDouble *IssmDoublevector  = NULL;
+-	int     M,N;
+-
+-	/*Fetch parameters: */
+-	this->constants->FindParam(&numberofelements,MeshNumberofelementsEnum);
+-
+-	/*First of, find the record for the enum, and get code  of data type: */
+-	fid=this->SetFilePointerToData(&code, &vector_layout,vector_enum);
+-
+-	switch(code){
+-		case 1: //boolean constant.  {{{
+-			this->FetchData(&boolean,vector_enum);
+-
+-			/*Add boolean constant input to all elements: */
+-			counter=0;
+-			for (i=0;i<numberofelements;i++){
+-				if(this->my_elements[i]){
+-					Element* element=(Element*)elements->GetObjectByOffset(counter);
+-					element->InputCreate((IssmDouble)boolean,vector_enum,code);
+-					counter++;
+-				}
+-			}
+-			break; /*}}}*/
+-		case 2: //integer constant.  {{{
+-			this->FetchData(&integer,vector_enum);
+-
+-			/*Add integer constant input to all elements: */
+-			counter=0;
+-			for (i=0;i<numberofelements;i++){
+-				if(this->my_elements[i]){
+-					Element* element=(Element*)elements->GetObjectByOffset(counter);
+-					element->InputCreate((IssmDouble)integer,vector_enum,code);
+-					counter++;
+-				}
+-			}
+-			break; /*}}}*/
+-		case 3: //IssmDouble constant.  {{{
+-			this->FetchData(&scalar,vector_enum);
+-
+-			/*Add IssmDouble constant input to all elements: */
+-			counter=0;
+-			for (i=0;i<numberofelements;i++){
+-				if(this->my_elements[i]){
+-					Element* element=(Element*)elements->GetObjectByOffset(counter);
+-					element->InputCreate(scalar,vector_enum,code); 
+-					counter++;
+-				}
+-			}
+-			break; /*}}}*/
+-		case 5: //boolean vector.  {{{
+-
+-			/*Fetch vector:*/
+-			this->FetchData(&IssmDoublevector,&M,&N,vector_enum); //we still have a IssmDoublevector, because it might include times in transient mode
+-			/*Check we got something, otherwise fetch default: */
+-			if(IssmDoublevector){
+-				defaulting=false;  //we are not defaulting, because  we do have a vector
+-			}
+-			else{
+-				/*do we have a default enum to go fetch? */
+-				if(default_vector_enum!=NoneEnum){
+-					/*yes. fetch it: */
+-					this->FetchData(&IssmDoublevector,&M,&N,default_vector_enum);
+-					if(IssmDoublevector){
+-						defaulting=false;  //we are not defaulting, because  we do have a vector
+-					}
+-					else{
+-						/*even the default vector is non existent. we are defaulting to the default value: */
+-						defaulting=true;
+-					}
+-				}
+-				else{
+-					/*we are left with the default value: */
+-					defaulting=true;
+-				}
+-			}
+-
+-			/*Create inputs:*/
+-			counter=0;
+-			for (i=0;i<numberofelements;i++){
+-				if(this->my_elements[i]){
+-					Element* element=(Element*)elements->GetObjectByOffset(counter);
+-					if(defaulting) element->InputCreate(default_value,vector_enum,code); 
+-					else           element->InputCreate(IssmDoublevector,i,this,M,N,vector_layout,vector_enum,code);//we need i to index into elements.
+-					counter++;
+-				}
+-			}
+-			break; /*}}}*/
+-		case 6: //int vector{{{
+-
+-			/*Fetch vector:*/
+-			this->FetchData(&IssmDoublevector,&M,&N,vector_enum); //we still have a IssmDoublevector, because it might include times in transient mode
+-			/*Check we got something, otherwise fetch default: */
+-			if(IssmDoublevector){
+-				defaulting=false;  //we are not defaulting, because  we do have a vector
+-			}
+-			else{
+-				/*do we have a default enum to go fetch? */
+-				if(default_vector_enum!=NoneEnum){
+-					/*yes. fetch it: */
+-					this->FetchData(&IssmDoublevector,&M,&N,default_vector_enum);
+-					if(IssmDoublevector){
+-						defaulting=false;  //we are not defaulting, because  we do have a vector
+-					}
+-					else{
+-						/*even the default vector is non existent. we are defaulting to the default value: */
+-						defaulting=true;
+-					}
+-				}
+-				else{
+-					/*we are left with the default value: */
+-					defaulting=true;
+-				}
+-			}
+-
+-			/*Create inputs:*/
+-			counter=0;
+-			for (i=0;i<numberofelements;i++){
+-				if(this->my_elements[i]){
+-					Element* element=(Element*)elements->GetObjectByOffset(counter);
+-					if(defaulting) element->InputCreate(default_value,vector_enum,code); 
+-					else           element->InputCreate(IssmDoublevector,i,this,M,N,vector_layout,vector_enum,code);//we need i to index into elements.
+-					counter++;
+-				}
+-			}
+-			break; /*}}}*/
+-		case 7: //IssmDouble vector{{{
+-
+-			/*Fetch vector:*/
+-			this->FetchData(&IssmDoublevector,&M,&N,vector_enum);
+-			/*Check we got something, otherwise fetch default: */
+-			if(IssmDoublevector){
+-				defaulting=false;  //we are not defaulting, because  we do have a vector
+-			}
+-			else{
+-				/*do we have a default enum to go fetch? */
+-				if(default_vector_enum!=NoneEnum){
+-					/*yes. fetch it: */
+-					this->FetchData(&IssmDoublevector,&M,&N,default_vector_enum);
+-					if(IssmDoublevector){
+-						defaulting=false;  //we are not defaulting, because  we do have a vector
+-					}
+-					else{
+-						/*even the default vector is non existent. we are defaulting to the default value: */
+-						defaulting=true;
+-					}
+-				}
+-				else{
+-					/*we are left with the default value: */
+-					defaulting=true;
+-				}
+-			}
+-
+-			/*Create inputs:*/
+-			counter=0;
+-			for (i=0;i<numberofelements;i++){
+-				if(this->my_elements[i]){
+-					Element* element=(Element*)elements->GetObjectByOffset(counter);
+-					if(defaulting) element->InputCreate(default_value,vector_enum,code); 
+-					else           element->InputCreate(IssmDoublevector,i,this,M,N,vector_layout,vector_enum,code);//we need i to index into elements.
+-					counter++;
+-				}
+-			}
+-
+-			break; /*}}}*/
+-		default: /*{{{*/
+-			_error2_("data code " << code << " not supported yet!");
+-			break;
+-			/*}}}*/
+-	}
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(IssmDoublevector);
+-	xDelete<char>(string);
+-}
+-/*FUNCTION IoModel::LastIndex{{{*/
+-void IoModel::LastIndex(int *pindex){
+-
+-	extern int my_rank;
+-	int        lastindex,index;
+-	int        record_length;
+-
+-	/*Go find in the binary file, the position of the data we want to fetch: */
+-	if(my_rank==0){
+-
+-		/*First set FILE* position to the beginning of the file: */
+-		fseek(fid,0,SEEK_SET);
+-
+-		/*Now march through file looking for the correct data identifier: */
+-		for(;;){
+-			/*Read enum for this size of first string name: */
+-			if(fread(&index,sizeof(int),1,fid)==0){
+-				/*Ok, we have reached the end of the file. break: */
+-				break;
+-			}
+-
+-			/*read the record length, and use it to skip this record: */
+-			fread(&record_length,sizeof(int),1,fid);
+-			fseek(fid,record_length,SEEK_CUR);
+-			lastindex=index;
+-		}
+-	}
+-	/*Broadcast code and vector type: */
+-#ifdef _HAVE_MPI_
+-	MPI_Bcast(&lastindex,1,MPI_INT,0,MPI_COMM_WORLD); 
+-#endif
+-
+-	/*Assign output pointers:*/
+-	*pindex=lastindex;
+-}
+-/*FUNCTION IoModel::SetFilePointerToData{{{*/
+-FILE* IoModel::SetFilePointerToData(int* pcode,int* pvector_type, int data_enum){
+-
+-	extern int my_rank;
+-	extern int num_procs;
+-
+-	int found=0;
+-	int record_enum;
+-	int record_length;
+-	int record_code; //1 to 7 number
+-	int vector_type; //nodal or elementary
+-
+-	/*Go find in the binary file, the position of the data we want to fetch: */
+-	if(my_rank==0){
+-
+-		/*First set FILE* position to the beginning of the file: */
+-		fseek(fid,0,SEEK_SET);
+-
+-		/*Now march through file looking for the correct data identifier: */
+-		for(;;){
+-			/*Read enum for this size of first string name: */
+-			if(fread(&record_enum,sizeof(int),1,fid)==0){
+-				/*Ok, we have reached the end of the file. break: */
+-				found=0;
+-				break;
+-			}
+-
+-			/*Is this the record sought for? : */
+-			if (data_enum==record_enum){
+-				/*Ok, we have found the correct string. Pass the record length, and read data type code: */
+-				fseek(fid,sizeof(int),SEEK_CUR);
+-				fread(&record_code,sizeof(int),1,fid);
+-
+-				/*if record_code points to a vector, get its type (nodal or elementary): */
+-				if(5<=record_code && record_code<=7)fread(&vector_type,sizeof(int),1,fid);
+-				found=1;
+-				break;
+-			}
+-			else{
+-				/*This is not the correct string, read the record length, and use it to skip this record: */
+-				fread(&record_length,sizeof(int),1,fid);
+-				/*skip: */
+-				fseek(fid,record_length,SEEK_CUR);
+-			}
+-		}
+-	}
+-#ifdef _HAVE_MPI_
+-	MPI_Bcast(&found,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	if(!found)_error2_("could not find data with name" << " " << EnumToStringx(data_enum) << " ");
+-#endif
+-
+-	/*Broadcast code and vector type: */
+-#ifdef _HAVE_MPI_
+-	MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	if(record_code==5) MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD); 
+-#endif
+-
+-	/*Assign output pointers:*/
+-	*pcode=record_code;
+-	if(pvector_type)*pvector_type=vector_type;
+-
+-	return fid;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.h	(revision 12822)
+@@ -1,53 +0,0 @@
+-/*! \file TriaP1ElementResult.h 
+- *  \brief: header file for TriaP1ElementResult object
+- */
+-
+-
+-#ifndef _TRIAP1ELEMENTRESULT_H_
+-#define _TRIAP1ELEMENTRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Inputs/Input.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-class TriaP1ElementResult: public ElementResult{
+-
+-	private: 
+-		int    enum_type;
+-		IssmDouble values[3];
+-		int    step;
+-		IssmDouble time;
+-
+-	public:
+-
+-		/*TriaP1ElementResult constructors, destructors: {{{*/
+-		TriaP1ElementResult();
+-		TriaP1ElementResult(int enum_type,IssmDouble* values,int step,IssmDouble time);
+-		~TriaP1ElementResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ElementResult virtual functions definitions: {{{*/
+-		ElementResult* SpawnTriaElementResult(int* indices);
+-		IssmDouble  GetTime(void){return time;};
+-		int     GetStep(void){return step;};
+-		void    ProcessUnits(Parameters* parameters);
+-		int     NumberOfNodalValues(void);
+-		void    PatchFill(int row, Patch* patch);
+-		/*}}}*/
+-		/*TriaP1ElementResult management: {{{*/
+-		int   InstanceEnum();
+-		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
+-		void GetElementVectorFromResults(Vector* vector,int dof);
+-		/*}}}*/
+-
+-};
+-#endif  /* _TRIAP1ELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp	(revision 12822)
+@@ -1,153 +0,0 @@
+-/*!\file PentaP1ElementResult.c
+- * \brief: implementation of the PentaP1ElementResult object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "./ElementResultLocal.h"
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*PentaP1ElementResult constructors and destructor*/
+-/*FUNCTION PentaP1ElementResult::PentaP1ElementResult(){{{*/
+-PentaP1ElementResult::PentaP1ElementResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::PentaP1ElementResult(int in_enum_type,IssmDouble* in_values,int in_step, IssmDouble in_time){{{*/
+-PentaP1ElementResult::PentaP1ElementResult(int in_enum_type,IssmDouble* in_values,int in_step, IssmDouble in_time){
+-
+-	int i;
+-
+-	enum_type=in_enum_type;
+-	for(i=0;i<6;i++)values[i]=in_values[i];
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::~PentaP1ElementResult(){{{*/
+-PentaP1ElementResult::~PentaP1ElementResult(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION PentaP1ElementResult::Echo {{{*/
+-void PentaP1ElementResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::DeepEcho{{{*/
+-void PentaP1ElementResult::DeepEcho(void){
+-
+-	_printLine_("PentaP1ElementResult:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   values: [" << this->values[0] << " " << this->values[1] << " " << this->values[2] << " " << this->values[3] << " " << this->values[4] << " " << this->values[5] << "]");
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::Id{{{*/
+-int    PentaP1ElementResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::MyRank{{{*/
+-int    PentaP1ElementResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::ObjectEnum{{{*/
+-int PentaP1ElementResult::ObjectEnum(void){
+-
+-	return PentaP1ElementResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::copy{{{*/
+-Object* PentaP1ElementResult::copy() {
+-	
+-	return new PentaP1ElementResult(this->enum_type,this->values,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*ElementResult management*/
+-/*FUNCTION PentaP1ElementResult::InstanceEnum{{{*/
+-int PentaP1ElementResult::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::SpawnTriaElementResult{{{*/
+-ElementResult* PentaP1ElementResult::SpawnTriaElementResult(int* indices){
+-
+-	/*output*/
+-	TriaP1ElementResult* outresult=NULL;
+-	IssmDouble newvalues[3];
+-
+-	/*Loop over the new indices*/
+-	for(int i=0;i<3;i++){
+-
+-		/*Check index value*/
+-		_assert_(indices[i]>=0 && indices[i]<6);
+-
+-		/*Assign value to new result*/
+-		newvalues[i]=this->values[indices[i]];
+-	}
+-
+-	/*Create new Tria result*/
+-	outresult=new TriaP1ElementResult(this->enum_type,&newvalues[0],this->step,this->time);
+-
+-	/*Assign output*/
+-	return outresult;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::ProcessUnits{{{*/
+-void PentaP1ElementResult::ProcessUnits(Parameters* parameters){
+-	
+-	UnitConversion(this->values,6,IuToExtEnum,this->enum_type);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::NumberOfNodalValues{{{*/
+-int PentaP1ElementResult::NumberOfNodalValues(void){
+-	return 6;
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::PatchFill{{{*/
+-void PentaP1ElementResult::PatchFill(int row, Patch* patch){
+-	
+-	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+-	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+-	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+-	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,6);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaP1ElementResult::GetVectorFromResults{{{*/
+-void PentaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
+-
+-	IssmDouble data[6];
+-
+-	if(numdofs!=6)_error2_("Result " << EnumToStringx(this->enum_type) << " is a PentaP1ElementResult and cannot write vector of " << numdofs << " dofs");
+-	for(int i=0;i<6;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i];
+-	vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
+-
+-} /*}}}*/
+-/*FUNCTION PentaP1ElementResult::GetElementVectorFromResults{{{*/
+-void PentaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
+-
+-	_error2_("Result " << EnumToStringx(enum_type) << " is a PentaP1ElementResult and should not write vector of size numberofelemenrs");
+-} /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.cpp	(revision 12822)
+@@ -1,137 +0,0 @@
+-/*!\file DoubleElementResult.c
+- * \brief: implementation of the DoubleElementResult object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "./ElementResultLocal.h"
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*DoubleElementResult constructors and destructor*/
+-/*FUNCTION DoubleElementResult::DoubleElementResult(){{{*/
+-DoubleElementResult::DoubleElementResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::DoubleElementResult(int in_enum_type,IssmDouble in_value,int in_step, IssmDouble in_time){{{*/
+-DoubleElementResult::DoubleElementResult(int in_enum_type,IssmDouble in_value,int in_step, IssmDouble in_time){
+-
+-	enum_type=in_enum_type;
+-	value=in_value;
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::~DoubleElementResult(){{{*/
+-DoubleElementResult::~DoubleElementResult(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleElementResult::Echo {{{*/
+-void DoubleElementResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::DeepEcho{{{*/
+-void DoubleElementResult::DeepEcho(void){
+-
+-	_printLine_("DoubleElementResult:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::Id{{{*/
+-int    DoubleElementResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::MyRank{{{*/
+-int    DoubleElementResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::ObjectEnum{{{*/
+-int DoubleElementResult::ObjectEnum(void){
+-
+-	return DoubleElementResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::copy{{{*/
+-Object* DoubleElementResult::copy() {
+-
+-	return new DoubleElementResult(this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*ElementResult management*/
+-/*FUNCTION DoubleElementResult::InstanceEnum{{{*/
+-int DoubleElementResult::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::SpawnTriaElementResult{{{*/
+-ElementResult* DoubleElementResult::SpawnTriaElementResult(int* indices){
+-
+-	/*output*/
+-	DoubleElementResult* outresult=new DoubleElementResult();
+-
+-	/*copy fields: */
+-	outresult->enum_type=this->enum_type;
+-	outresult->value=this->value;
+-	outresult->time=this->time;
+-	outresult->step=this->step;
+-
+-	/*Assign output*/
+-	return outresult;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::ProcessUnits{{{*/
+-void DoubleElementResult::ProcessUnits(Parameters* parameters){
+-	
+-	this->value=UnitConversion(this->value,IuToExtEnum,this->enum_type);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::NumberOfNodalValues{{{*/
+-int DoubleElementResult::NumberOfNodalValues(void){
+-	return 1;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::PatchFill{{{*/
+-void DoubleElementResult::PatchFill(int row, Patch* patch){
+-	
+-	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+-	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+-	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+-	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P0Enum,&this->value,1);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleElementResult::GetVectorFromResults{{{1*/
+-void DoubleElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
+-
+-	_error_("cannot return vector on vertices");
+-} /*}}}*/
+-/*FUNCTION DoubleElementResult::GetElementVectorFromResults{{{1*/
+-void DoubleElementResult::GetElementVectorFromResults(Vector* vector,int dof){
+-
+-	vector->SetValue(dof,value,INS_VAL);
+-} /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/BoolElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/BoolElementResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/BoolElementResult.cpp	(revision 12822)
+@@ -1,136 +0,0 @@
+-/*!\file BoolElementResult.c
+- * \brief: implementation of the BoolElementResult object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "./ElementResultLocal.h"
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*BoolElementResult constructors and destructor*/
+-/*FUNCTION BoolElementResult::BoolElementResult(){{{*/
+-BoolElementResult::BoolElementResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::BoolElementResult(int in_enum_type,IssmDouble in_value,int in_step, IssmDouble in_time){{{*/
+-BoolElementResult::BoolElementResult(int in_enum_type,bool in_value,int in_step, IssmDouble in_time){
+-
+-	enum_type=in_enum_type;
+-	value=in_value;
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::~BoolElementResult(){{{*/
+-BoolElementResult::~BoolElementResult(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION BoolElementResult::Echo {{{*/
+-void BoolElementResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::DeepEcho{{{*/
+-void BoolElementResult::DeepEcho(void){
+-
+-	_printLine_("BoolElementResult:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: "<<(this->value?"true":"false"));
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::Id{{{*/
+-int    BoolElementResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION BoolElementResult::MyRank{{{*/
+-int    BoolElementResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::ObjectEnum{{{*/
+-int BoolElementResult::ObjectEnum(void){
+-
+-	return BoolElementResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::copy{{{*/
+-Object* BoolElementResult::copy() {
+-
+-	return new BoolElementResult(this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*ElementResult management*/
+-/*FUNCTION BoolElementResult::InstanceEnum{{{*/
+-int BoolElementResult::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::SpawnTriaElementResult{{{*/
+-ElementResult* BoolElementResult::SpawnTriaElementResult(int* indices){
+-
+-	/*output*/
+-	BoolElementResult* outresult=new BoolElementResult();
+-
+-	/*copy fields: */
+-	outresult->enum_type=this->enum_type;
+-	outresult->value=this->value;
+-	outresult->time=this->time;
+-	outresult->step=this->step;
+-
+-	/*Assign output*/
+-	return outresult;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::ProcessUnits{{{*/
+-void BoolElementResult::ProcessUnits(Parameters* parameters){
+-// no op
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::NumberOfNodalValues{{{*/
+-int BoolElementResult::NumberOfNodalValues(void){
+-	return 1;
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::PatchFill{{{*/
+-void BoolElementResult::PatchFill(int row, Patch* patch){
+-	
+-	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+-	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+-	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+-	IssmDouble IssmDoublevalue=this->value?1:0;
+-	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P0Enum,&IssmDoublevalue,1);
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolElementResult::GetVectorFromResults{{{*/
+-void BoolElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
+-
+-	_error2_("cannot return vector on vertices");
+-} /*}}}*/
+-/*FUNCTION BoolElementResult::GetElementVectorFromResults{{{*/
+-void BoolElementResult::GetElementVectorFromResults(Vector* vector,int dof){
+-
+-	vector->SetValue(dof,value,INS_VAL);
+-} /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.h	(revision 12822)
+@@ -1,54 +0,0 @@
+-/*! \file PentaP1ElementResult.h 
+- *  \brief: header file for PentaP1ElementResult object
+- *  this object is just a PentaP1Input with additional time and step info.
+- */
+-
+-
+-#ifndef _PENTAP1ELEMENTRESULT_H_
+-#define _PENTAP1ELEMENTRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Inputs/Input.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-class PentaP1ElementResult: public ElementResult{
+-
+-	private: 
+-		int    enum_type;
+-		IssmDouble values[6];
+-		int    step;
+-		IssmDouble time;
+-
+-	public:
+-
+-		/*PentaP1ElementResult constructors, destructors: {{{*/
+-		PentaP1ElementResult();
+-		PentaP1ElementResult(int enum_type,IssmDouble* values,int step, IssmDouble time);
+-		~PentaP1ElementResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ElementResult virtual functions definitions: {{{*/
+-		ElementResult* SpawnTriaElementResult(int* indices);
+-		IssmDouble  GetTime(void){return time;};
+-		int     GetStep(void){return step;};
+-		void    ProcessUnits(Parameters* parameters);
+-		int     NumberOfNodalValues(void);
+-		void    PatchFill(int row, Patch* patch);
+-		/*}}}*/
+-		/*PentaP1ElementResult management: {{{*/
+-		int   InstanceEnum();
+-		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
+-		void GetElementVectorFromResults(Vector* vector,int dof);
+-		/*}}}*/
+-
+-};
+-#endif  /* _PENTAP1ELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h	(revision 12822)
+@@ -1,54 +0,0 @@
+-/*! \file DoubleElementResult.h 
+- *  \brief: header file for IssmDouble result object
+- *  A IssmDouble result object is just derived from a DoubleInput object, with additional time and step information.
+- */
+-
+-
+-#ifndef _DOUBLEELEMENTRESULT_H_
+-#define _DOUBLEELEMENTRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Inputs/Input.h"
+-#include "../../include/include.h"
+-class Parameters;
+-/*}}}*/
+-
+-class DoubleElementResult: public ElementResult{
+-
+-	private: 
+-		int    enum_type;
+-		IssmDouble value;
+-		int    step;
+-		IssmDouble time;
+-
+-	public:
+-
+-		/*DoubleElementResult constructors, destructors: {{{*/
+-		DoubleElementResult();
+-		DoubleElementResult(int enum_type,IssmDouble value,int step,IssmDouble time);
+-		~DoubleElementResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ElementResult virtual functions definitions: {{{*/
+-		ElementResult* SpawnTriaElementResult(int* indices);
+-		IssmDouble  GetTime(void){return time;};
+-		int     GetStep(void){return step;};
+-		void    ProcessUnits(Parameters* parameters);
+-		int     NumberOfNodalValues(void);
+-		void    PatchFill(int row, Patch* patch);
+-		/*}}}*/
+-		/*DoubleElementResult management: {{{*/
+-		int   InstanceEnum();
+-		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
+-		void GetElementVectorFromResults(Vector* vector,int dof);
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/ElementResultLocal.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/ElementResultLocal.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/ElementResultLocal.h	(revision 12822)
+@@ -1,11 +0,0 @@
+-/*!\file: ElementResultLocal.h
+- * \brief prototypes for ElementResultLocal.h
+- */ 
+-
+-#ifndef _ELEMENTRESULTLOCAL_H_
+-#define  _ELEMENTRESULTLOCAL_H_
+-
+-class Parameters;
+-
+-#endif //ifndef _ELEMENTRESULTLOCAL_H_
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/BoolElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/BoolElementResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/BoolElementResult.h	(revision 12822)
+@@ -1,54 +0,0 @@
+-/*! \file BoolElementResult.h 
+- *  \brief: header file for bool result object
+- *  A boll result object is just derived from a BoolInput object, with additional time and step information.
+- */
+-
+-
+-#ifndef _BOOLELEMENTRESULT_H_
+-#define _BOOLELEMENTRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Inputs/Input.h"
+-#include "../../include/include.h"
+-class Parameters;
+-/*}}}*/
+-
+-class BoolElementResult: public ElementResult{
+-
+-	private: 
+-		int    enum_type;
+-		bool   value;
+-		int    step;
+-		IssmDouble time;
+-
+-	public:
+-
+-		/*BoolElementResult constructors, destructors: {{{*/
+-		BoolElementResult();
+-		BoolElementResult(int enum_type,bool value,int step,IssmDouble time);
+-		~BoolElementResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ElementResult virtual functions definitions: {{{*/
+-		ElementResult* SpawnTriaElementResult(int* indices);
+-		IssmDouble  GetTime(void){return time;};
+-		int     GetStep(void){return step;};
+-		void    ProcessUnits(Parameters* parameters);
+-		int     NumberOfNodalValues(void);
+-		void    PatchFill(int row, Patch* patch);
+-		/*}}}*/
+-		/*BoolElementResult management: {{{*/
+-		int   InstanceEnum();
+-		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
+-		void GetElementVectorFromResults(Vector* vector,int dof);
+-		/*}}}*/
+-};
+-#endif  /* _BOOLELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp	(revision 12822)
+@@ -1,140 +0,0 @@
+-/*!\file TriaP1ElementResult.c
+- * \brief: implementation of the TriaP1ElementResult object
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "./ElementResultLocal.h"
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-
+-/*TriaP1ElementResult constructors and destructor*/
+-/*FUNCTION TriaP1ElementResult::TriaP1ElementResult(){{{*/
+-TriaP1ElementResult::TriaP1ElementResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::TriaP1ElementResult(int in_enum_type,IssmDouble* in_values,int in_step, IssmDouble in_time){{{*/
+-TriaP1ElementResult::TriaP1ElementResult(int in_enum_type,IssmDouble* in_values,int in_step, IssmDouble in_time){
+-
+-	enum_type=in_enum_type;
+-	values[0]=in_values[0];
+-	values[1]=in_values[1];
+-	values[2]=in_values[2];
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::~TriaP1ElementResult(){{{*/
+-TriaP1ElementResult::~TriaP1ElementResult(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION TriaP1ElementResult::Echo {{{*/
+-void TriaP1ElementResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::DeepEcho{{{*/
+-void TriaP1ElementResult::DeepEcho(void){
+-		
+-	_printLine_("TriaP1ElementResult:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   values: [" << this->values[0] << " " << this->values[1] << " " << this->values[2] << "]");
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::Id{{{*/
+-int    TriaP1ElementResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::MyRank{{{*/
+-int    TriaP1ElementResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::ObjectEnum{{{*/
+-int TriaP1ElementResult::ObjectEnum(void){
+-
+-	return TriaP1ElementResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::copy{{{*/
+-Object* TriaP1ElementResult::copy() {
+-	
+-	return new TriaP1ElementResult(this->enum_type,this->values,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*ElementResult management*/
+-/*FUNCTION TriaP1ElementResult::InstanceEnum{{{*/
+-int TriaP1ElementResult::InstanceEnum(void){
+-
+-	return this->enum_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::SpawnTriaElementResult{{{*/
+-ElementResult* TriaP1ElementResult::SpawnTriaElementResult(int* indices){
+-
+-	/*output*/
+-	TriaP1ElementResult* outresult=NULL;
+-
+-	/*Create new Tria result (copy of current result)*/
+-	outresult=new TriaP1ElementResult(this->enum_type,&this->values[0],this->step,this->time);
+-
+-	/*Assign output*/
+-	return outresult;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::ProcessUnits{{{*/
+-void TriaP1ElementResult::ProcessUnits(Parameters* parameters){
+-	
+-	UnitConversion(this->values,3,IuToExtEnum,this->enum_type);
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::NumberOfNodalValues{{{*/
+-int TriaP1ElementResult::NumberOfNodalValues(void){
+-	return 3;
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::PatchFill{{{*/
+-void TriaP1ElementResult::PatchFill(int row, Patch* patch){
+-	
+-	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+-	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+-	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+-	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,3);
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaP1ElementResult::GetVectorFromResults{{{*/
+-void TriaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
+-
+-	IssmDouble data[3];
+-
+-	if(numdofs!=3)_error2_("Result " << EnumToStringx(this->enum_type) << " is a TriaP1ElementResult and cannot write vector of " << numdofs << " dofs");
+-	for(int i=0;i<3;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i];
+-	vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
+-
+-} /*}}}*/
+-/*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{*/
+-void TriaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
+-	_error2_("Result " << EnumToStringx(enum_type) << " is a TriaP1ElementResult and should not write vector of size numberofelemenrs");
+-} /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/ElementResult.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/ElementResults/ElementResult.h	(revision 12822)
+@@ -1,32 +0,0 @@
+-/*!\file:  ElementResult.h
+- * \brief abstract class for ElementResult object
+- */ 
+-
+-
+-#ifndef _ELEMENTRESULT_H_
+-#define _ELEMENTRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Object.h"
+-/*}}}*/
+-
+-class ElementResult:public Object{
+-
+-	public: 
+-		
+-		virtual        ~ElementResult(){};
+-		
+-		virtual         ElementResult* SpawnTriaElementResult(int* indices)=0;
+-		virtual IssmDouble  GetTime(void)=0;
+-		virtual int     GetStep(void)=0;
+-		virtual void    ProcessUnits(Parameters* parameters)=0;
+-		virtual int     NumberOfNodalValues(void)=0;
+-		virtual void    PatchFill(int row, Patch* patch)=0;
+-		virtual int     InstanceEnum()=0;
+-		virtual void    GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdof)=0;
+-		virtual void    GetElementVectorFromResults(Vector* vector,int dof)=0;
+-
+-};
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h	(revision 12822)
+@@ -1,117 +0,0 @@
+-/*!\file:  Element.h
+- * \brief abstract class for Element object
+- * This class is a place holder for the Tria and the Penta elements. 
+- * It is derived from Element, so DataSets can contain them.
+- */ 
+-
+-
+-#ifndef _ELEMENT_H_
+-#define _ELEMENT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "../Object.h"
+-
+-class DataSet;
+-class Parameters;
+-class Patch;
+-class Matrix;
+-class Vector;
+-
+-#include "../../toolkits/toolkits.h"
+-/*}}}*/
+-
+-class Element: public Object,public Update{
+-
+-	public: 
+-		
+-		virtual        ~Element(){};
+-	
+-		virtual void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
+-		virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
+-		virtual void   CreateKMatrix(Matrix* Kff, Matrix*  Kfs,Vector* df)=0;
+-		virtual void   CreatePVector(Vector* pf)=0;
+-		virtual void   CreateJacobianMatrix(Matrix* Jff)=0;
+-		virtual void   GetSolutionFromInputs(Vector* solution)=0;
+-		virtual int    GetNodeIndex(Node* node)=0;
+-		virtual int    Sid()=0;
+-		virtual bool   IsFloating()=0; 
+-		virtual bool   IsNodeOnShelf()=0; 
+-		virtual bool   IsNodeOnShelfFromFlags(IssmDouble* flags)=0; 
+-		virtual bool   IsOnBed()=0;
+-		virtual void   GetInputListOnVertices(IssmDouble* pvalue,int enumtype)=0;
+-		virtual void   GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue)=0;
+-		virtual void   GetInputValue(IssmDouble* pvalue,Node* node,int enumtype)=0;
+-		
+-		virtual IssmDouble SurfaceArea(void)=0;
+-		virtual void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum)=0;
+-		virtual void   ComputeBasalStress(Vector* sigma_b)=0;
+-		virtual void   ComputeStrainRate(Vector* eps)=0;
+-		virtual void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes)=0;
+-		virtual void   PatchFill(int* pcount, Patch* patch)=0;
+-		virtual void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results)=0;
+-		virtual void   DeleteResults(void)=0;
+-		virtual void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type)=0;
+-		virtual void   InputToResult(int enum_type,int step,IssmDouble time)=0;
+-		virtual void   InputDuplicate(int original_enum,int new_enum)=0;
+-		virtual void   InputCreate(IssmDouble scalar,int name,int code)=0;
+-		virtual void   InputCreate(IssmDouble* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code)=0;
+-		virtual void   ProcessResultsUnits(void)=0;
+-		virtual void   RequestedOutput(int output_enum,int step,IssmDouble time)=0;
+-		
+-		virtual int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units)=0;
+-		virtual void   InputScale(int enum_type,IssmDouble scale_factor)=0;
+-		virtual void   GetVectorFromInputs(Vector* vector, int name_enum)=0;
+-		virtual void   GetVectorFromResults(Vector* vector,int id,int enum_in,int interp)=0;
+-		virtual void   InputArtificialNoise(int enum_type,IssmDouble min,IssmDouble max)=0;
+-		virtual bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums)=0;
+-		virtual void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
+-		virtual int*   GetHorizontalNeighboorSids(void)=0;
+-		virtual IssmDouble TimeAdapt()=0;
+-		virtual void   MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding)=0;
+-		virtual void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding)=0;
+-		virtual void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm)=0;
+-		virtual void   Delta18oParameterization(void)=0;
+-		virtual void   SmbGradients()=0;
+-		virtual int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
+-		virtual void   ResetCoordinateSystem()=0;
+-		virtual void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius)=0;
+-
+-		#ifdef _HAVE_RESPONSES_
+-		virtual void   MinVel(IssmDouble* pminvel, bool process_units)=0;
+-		virtual void   MaxVel(IssmDouble* pmaxvel, bool process_units)=0;
+-		virtual void   MinVx(IssmDouble* pminvx, bool process_units)=0;
+-		virtual void   MaxVx(IssmDouble* pmaxvx, bool process_units)=0;
+-		virtual void   MaxAbsVx(IssmDouble* pmaxabsvx, bool process_units)=0;
+-		virtual void   MinVy(IssmDouble* pminvy, bool process_units)=0;
+-		virtual void   MaxVy(IssmDouble* pmaxvy, bool process_units)=0;
+-		virtual void   MaxAbsVy(IssmDouble* pmaxabsvy, bool process_units)=0;
+-		virtual void   MinVz(IssmDouble* pminvz, bool process_units)=0;
+-		virtual void   MaxVz(IssmDouble* pmaxvz, bool process_units)=0;
+-		virtual void   MaxAbsVz(IssmDouble* pmaxabsvz, bool process_units)=0;
+-		virtual IssmDouble MassFlux(IssmDouble* segment,bool process_units)=0;
+-		virtual void   ElementResponse(IssmDouble* presponse,int response_enum,bool process_units)=0;
+-		virtual IssmDouble IceVolume(void)=0;
+-		virtual IssmDouble TotalSmb(void)=0;
+-		#endif
+-
+-		#ifdef _HAVE_CONTROL_
+-		virtual void   Gradj(Vector* gradient,int control_type,int control_index)=0;
+-		virtual IssmDouble ThicknessAbsMisfit(bool process_units  ,int weight_index)=0;
+-		virtual IssmDouble SurfaceAbsVelMisfit(bool process_units ,int weight_index)=0;
+-		virtual IssmDouble SurfaceRelVelMisfit(bool process_units ,int weight_index)=0;
+-		virtual IssmDouble SurfaceLogVelMisfit(bool process_units ,int weight_index)=0;
+-		virtual IssmDouble SurfaceLogVxVyMisfit(bool process_units,int weight_index)=0;
+-		virtual IssmDouble SurfaceAverageVelMisfit(bool process_units,int weight_index)=0;
+-		virtual IssmDouble ThicknessAbsGradient(bool process_units,int weight_index)=0;
+-		virtual IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index)=0;
+-		virtual IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index)=0;
+-		virtual void   ControlInputGetGradient(Vector* 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   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data)=0;
+-		virtual void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index)=0;
+-		virtual void   InputControlUpdate(IssmDouble scalar,bool save_parameter)=0;
+-		#endif
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12822)
+@@ -1,5718 +0,0 @@
+-/*!\file Tria.cpp
+- * \brief: implementation of the Tria object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Element macros*/
+-#define NUMVERTICES 3
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION Tria::Tria(){{{*/
+-Tria::Tria(){
+-
+-	int i;
+-
+-	this->nodes=NULL;
+-	this->matice=NULL;
+-	this->matpar=NULL;
+-	for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
+-	this->inputs=NULL;
+-	this->parameters=NULL;
+-	this->results=NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::Tria(int id, int sid,int index, IoModel* iomodel,int nummodels){{{*/
+-Tria::Tria(int tria_id, int tria_sid, int index, IoModel* iomodel,int nummodels)
+-	:TriaRef(nummodels)
+-	,TriaHook(nummodels,index+1,iomodel){
+-		
+-		int i;
+-		/*id: */
+-		this->id=tria_id;
+-		this->sid=tria_sid;
+-
+-		//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
+-		this->parameters=NULL;
+-
+-		/*Build horizontalneighborsids list: */
+-		_assert_(iomodel->Data(MeshElementconnectivityEnum));
+-		//for (i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->elementconnectivity[3*index+i]-1;
+-
+-		/*intialize inputs and results: */
+-		this->inputs=new Inputs();
+-		this->results=new Results();
+-
+-		/*initialize pointers:*/
+-		this->nodes=NULL;
+-		this->matice=NULL;
+-		this->matpar=NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::~Tria(){{{*/
+-Tria::~Tria(){
+-	delete inputs;
+-	delete results;
+-	this->parameters=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::copy {{{*/
+-Object* Tria::copy() {
+-
+-	int i;
+-	Tria* tria=NULL;
+-
+-	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];
+-
+-	//deal with TriaHook 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();
+-	tria->hmatice=(Hook*)this->hmatice->copy();
+-	tria->hmatpar=(Hook*)this->hmatpar->copy();
+-
+-	/*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->results){
+-		tria->results=(Results*)this->results->Copy();
+-	}
+-	else{
+-		tria->results=new Results();
+-	}
+-	/*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];
+-	tria->matice=(Matice*)tria->hmatice->delivers();
+-	tria->matpar=(Matpar*)tria->hmatpar->delivers();
+-
+-	/*neighbors: */
+-	for(i=0;i<3;i++)tria->horizontalneighborsids[i]=this->horizontalneighborsids[i];
+-
+-	return tria;
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION Tria::AverageOntoPartition {{{*/
+-void  Tria::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
+-
+-	bool      already=false;
+-	int       i,j;
+-	int       partition[NUMVERTICES];
+-	int       offsetsid[NUMVERTICES];
+-	int       offsetdof[NUMVERTICES];
+-	IssmDouble    area;
+-	IssmDouble    mean;
+-	IssmDouble    values[3];
+-
+-	/*First, get the area: */
+-	area=this->GetArea();
+-
+-	/*Figure out the average for this element: */
+-	this->GetSidList(&offsetsid[0]);
+-	this->GetDofList1(&offsetdof[0]);
+-	mean=0;
+-	for(i=0;i<NUMVERTICES;i++){
+-		partition[i]=reCast<int>(qmu_part[offsetsid[i]]);
+-		mean=mean+1.0/NUMVERTICES*vertex_response[offsetdof[i]];
+-	}
+-
+-	/*Add contribution: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		already=false;
+-		for(j=0;j<i;j++){
+-			if (partition[i]==partition[j]){
+-				already=true;
+-				break;
+-			}
+-		}
+-		if(!already){
+-			partition_contributions->SetValue(partition[i],mean*area,ADD_VAL);
+-			partition_areas->SetValue(partition[i],area,ADD_VAL);
+-		};
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrix {{{*/
+-void  Tria::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){
+-
+-	/*retreive parameters: */
+-	ElementMatrix* Ke=NULL;
+-	int analysis_type;
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*Checks in debugging mode{{{*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->parameters && this->inputs);
+-	/*}}}*/
+-	
+-	/*Skip if water element*/
+-	if(IsOnWater()) return;
+-
+-	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		case DiagnosticHorizAnalysisEnum:
+-			Ke=CreateKMatrixDiagnosticMacAyeal();
+-			break;
+-		case AdjointHorizAnalysisEnum:
+-			Ke=CreateKMatrixAdjointMacAyeal();
+-			break;
+-		case DiagnosticHutterAnalysisEnum:
+-			Ke=CreateKMatrixDiagnosticHutter();
+-			break;
+-		 #endif
+-		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
+-			Ke=CreateKMatrixSlope();
+-			break;
+-		case PrognosticAnalysisEnum:
+-			Ke=CreateKMatrixPrognostic();
+-			break;
+-		#ifdef _HAVE_HYDROLOGY_
+-		case HydrologyAnalysisEnum:
+-			Ke=CreateKMatrixHydrology();
+-			break;
+-		#endif
+-		#ifdef _HAVE_BALANCED_
+-		case BalancethicknessAnalysisEnum:
+-			Ke=CreateKMatrixBalancethickness();
+-			break;
+-		#endif
+-		#ifdef _HAVE_CONTROL_
+-		case AdjointBalancethicknessAnalysisEnum:
+-			Ke=CreateKMatrixAdjointBalancethickness();
+-			break;
+-		#endif
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global matrix*/
+-	if(Ke){
+-		Ke->AddToGlobal(Kff,Kfs);
+-		delete Ke;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixMelting {{{*/
+-ElementMatrix* Tria::CreateKMatrixMelting(void){
+-
+-	/*Constants*/
+-	const int  numdof=NUMVERTICES*NDOF1;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     heatcapacity,latentheat;
+-	IssmDouble     Jdet,D_scalar;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     L[3];
+-	GaussTria *gauss=NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	latentheat=matpar->GetLatentHeat();
+-	heatcapacity=matpar->GetHeatCapacity();
+-
+-	/* Start looping on the number of gauss  (nodes on the bedrock) */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0], gauss);
+-
+-		D_scalar=latentheat/heatcapacity*gauss->weight*Jdet;
+-
+-		TripleMultiply(&L[0],numdof,1,0,
+-					&D_scalar,1,1,0,
+-					&L[0],1,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixPrognostic {{{*/
+-ElementMatrix* Tria::CreateKMatrixPrognostic(void){
+-
+-	switch(GetElementType()){
+-		case P1Enum:
+-			return CreateKMatrixPrognostic_CG();
+-		case P1DGEnum:
+-			return CreateKMatrixPrognostic_DG();
+-		default:
+-			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixPrognostic_CG {{{*/
+-ElementMatrix* Tria::CreateKMatrixPrognostic_CG(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        stabilization;
+-	int        i,j,ig,dim;
+-	IssmDouble     Jdettria,DL_scalar,dt,h;
+-	IssmDouble     vel,vx,vy,dvxdx,dvydy;
+-	IssmDouble     dvx[2],dvy[2];
+-	IssmDouble     v_gauss[2]={0.0};
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     L[NUMVERTICES];
+-	IssmDouble     B[2][NUMVERTICES];
+-	IssmDouble     Bprime[2][NUMVERTICES];
+-	IssmDouble     K[2][2]                        ={0.0};
+-	IssmDouble     KDL[2][2]                      ={0.0};
+-	IssmDouble     DL[2][2]                        ={0.0};
+-	IssmDouble     DLprime[2][2]                   ={0.0};
+-	GaussTria *gauss=NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	this->parameters->FindParam(&dim,MeshDimensionEnum);
+-	this->parameters->FindParam(&stabilization,PrognosticStabilizationEnum);
+-	Input* vxaverage_input=NULL;
+-	Input* vyaverage_input=NULL;
+-	if(dim==2){
+-		vxaverage_input=inputs->GetInput(VxEnum); _assert_(vxaverage_input);
+-		vyaverage_input=inputs->GetInput(VyEnum); _assert_(vyaverage_input);
+-	}
+-	else{
+-		vxaverage_input=inputs->GetInput(VxAverageEnum); _assert_(vxaverage_input);
+-		vyaverage_input=inputs->GetInput(VyAverageEnum); _assert_(vyaverage_input);
+-	}
+-	h=sqrt(2*this->GetArea());
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
+-		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
+-
+-		vxaverage_input->GetInputValue(&vx,gauss);
+-		vyaverage_input->GetInputValue(&vy,gauss);
+-		vxaverage_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
+-		vyaverage_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
+-
+-		DL_scalar=gauss->weight*Jdettria;
+-
+-		TripleMultiply( &L[0],1,numdof,1,
+-					&DL_scalar,1,1,0,
+-					&L[0],1,numdof,0,
+-					&Ke->values[0],1);
+-
+-		GetBPrognostic(&B[0][0], &xyz_list[0][0], gauss);
+-		GetBprimePrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
+-
+-		dvxdx=dvx[0];
+-		dvydy=dvy[1];
+-		DL_scalar=dt*gauss->weight*Jdettria;
+-
+-		DL[0][0]=DL_scalar*dvxdx;
+-		DL[1][1]=DL_scalar*dvydy;
+-		DLprime[0][0]=DL_scalar*vx;
+-		DLprime[1][1]=DL_scalar*vy;
+-
+-		TripleMultiply( &B[0][0],2,numdof,1,
+-					&DL[0][0],2,2,0,
+-					&B[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-
+-		TripleMultiply( &B[0][0],2,numdof,1,
+-					&DLprime[0][0],2,2,0,
+-					&Bprime[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-
+-		if(stabilization==2){
+-			/*Streamline upwinding*/
+-			vel=sqrt(pow(vx,2.)+pow(vy,2.))+1.e-8;
+-			K[0][0]=h/(2*vel)*vx*vx;
+-			K[1][0]=h/(2*vel)*vy*vx;
+-			K[0][1]=h/(2*vel)*vx*vy;
+-			K[1][1]=h/(2*vel)*vy*vy;
+-		}
+-		else if(stabilization==1){
+-			/*MacAyeal*/
+-			vxaverage_input->GetInputAverage(&vx);
+-			vyaverage_input->GetInputAverage(&vy);
+-			K[0][0]=h/2.0*fabs(vx);
+-			K[0][1]=0.;
+-			K[1][0]=0.;
+-			K[1][1]=h/2.0*fabs(vy);
+-		}
+-		if(stabilization==1 || stabilization==2){
+-			KDL[0][0]=DL_scalar*K[0][0];
+-			KDL[1][0]=DL_scalar*K[1][0];
+-			KDL[0][1]=DL_scalar*K[0][1];
+-			KDL[1][1]=DL_scalar*K[1][1];
+-			TripleMultiply( &Bprime[0][0],2,numdof,1,
+-						&KDL[0][0],2,2,0,
+-						&Bprime[0][0],2,numdof,0,
+-						&Ke->values[0],1);
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixPrognostic_DG {{{*/
+-ElementMatrix* Tria::CreateKMatrixPrognostic_DG(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig,dim;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     Jdettria,dt,vx,vy;
+-	IssmDouble     L[NUMVERTICES];
+-	IssmDouble     B[2][NUMVERTICES];
+-	IssmDouble     Bprime[2][NUMVERTICES];
+-	IssmDouble     DL[2][2]={0.0};
+-	IssmDouble     DLprime[2][2]={0.0};
+-	IssmDouble     DL_scalar;
+-	GaussTria  *gauss=NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	this->parameters->FindParam(&dim,MeshDimensionEnum);
+-	Input* vxaverage_input=NULL;
+-	Input* vyaverage_input=NULL;
+-	if(dim==2){
+-		vxaverage_input=inputs->GetInput(VxEnum); _assert_(vxaverage_input);
+-		vyaverage_input=inputs->GetInput(VyEnum); _assert_(vyaverage_input);
+-	}
+-	else{
+-		vxaverage_input=inputs->GetInput(VxAverageEnum); _assert_(vxaverage_input);
+-		vyaverage_input=inputs->GetInput(VyAverageEnum); _assert_(vyaverage_input);
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		vxaverage_input->GetInputValue(&vx,gauss);
+-		vyaverage_input->GetInputValue(&vy,gauss);
+-
+-		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
+-		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
+-
+-		DL_scalar=gauss->weight*Jdettria;
+-
+-		TripleMultiply( &L[0],1,numdof,1,
+-					&DL_scalar,1,1,0,
+-					&L[0],1,numdof,0,
+-					&Ke->values[0],1);
+-
+-		/*WARNING: B and Bprime are inverted compared to usual prognostic!!!!*/
+-		GetBPrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
+-		GetBprimePrognostic(&B[0][0], &xyz_list[0][0], gauss);
+-
+-		DL_scalar=-dt*gauss->weight*Jdettria;
+-
+-		DLprime[0][0]=DL_scalar*vx;
+-		DLprime[1][1]=DL_scalar*vy;
+-
+-		TripleMultiply( &B[0][0],2,numdof,1,
+-					&DLprime[0][0],2,2,0,
+-					&Bprime[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixSlope {{{*/
+-ElementMatrix* Tria::CreateKMatrixSlope(void){
+-
+-	/*constants: */
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/* Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     DL_scalar,Jdet;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     L[1][3];
+-	GaussTria *gauss = NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES);
+-
+-	/* Start looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-		
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		DL_scalar=gauss->weight*Jdet;
+-
+-		GetL(&L[0][0], &xyz_list[0][0], gauss,NDOF1);
+-
+-		TripleMultiply(&L[0][0],1,3,1,
+-					&DL_scalar,1,1,0,
+-					&L[0][0],1,3,0,
+-					&Ke->values[0],1);
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVector {{{*/
+-void  Tria::CreatePVector(Vector* pf){
+-
+-	/*retrive parameters: */
+-	ElementVector* pe=NULL;
+-	int analysis_type;
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*asserts: {{{*/
+-	/*if debugging mode, check that all pointers exist*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->parameters && this->inputs);
+-	/*}}}*/
+-	
+-	/*Skip if water element*/
+-	if(IsOnWater()) return;
+-
+-	/*Just branch to the correct load generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		case DiagnosticHorizAnalysisEnum:
+-			pe=CreatePVectorDiagnosticMacAyeal();
+-			break;
+-		case DiagnosticHutterAnalysisEnum:
+-			pe=CreatePVectorDiagnosticHutter();
+-			break;
+-		#endif
+-		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
+-			pe=CreatePVectorSlope();
+-			break;
+-		case PrognosticAnalysisEnum:
+-			pe=CreatePVectorPrognostic();
+-			break;
+-		#ifdef _HAVE_HYDROLOGY_
+-		case HydrologyAnalysisEnum:
+-			pe=CreatePVectorHydrology();
+-			break;
+-		#endif
+-		#ifdef _HAVE_BALANCED_
+-		case BalancethicknessAnalysisEnum:
+-			pe=CreatePVectorBalancethickness();
+-			break;
+-		#endif
+-		#ifdef _HAVE_CONTROL_
+-		case AdjointBalancethicknessAnalysisEnum:
+-			pe=CreatePVectorAdjointBalancethickness();
+-			break;
+-		case AdjointHorizAnalysisEnum:
+-			pe=CreatePVectorAdjointHoriz();
+-			break;
+-		#endif
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global Vector*/
+-	if(pe){
+-		pe->AddToGlobal(pf);
+-		delete pe;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorPrognostic{{{*/
+-ElementVector* Tria::CreatePVectorPrognostic(void){
+-
+-	switch(GetElementType()){
+-		case P1Enum:
+-			return CreatePVectorPrognostic_CG();
+-		case P1DGEnum:
+-			return CreatePVectorPrognostic_DG();
+-		default:
+-			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorPrognostic_CG {{{*/
+-ElementVector* Tria::CreatePVectorPrognostic_CG(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     Jdettria,dt;
+-	IssmDouble     surface_mass_balance_g,basal_melting_g,basal_melting_correction_g,thickness_g;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     L[NUMVERTICES];
+-	GaussTria* gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	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* basal_melting_correction_input=inputs->GetInput(BasalforcingsMeltingRateCorrectionEnum);
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum);                             _assert_(thickness_input);
+-
+-	/*Initialize basal_melting_correction_g to 0, do not forget!:*/
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
+-		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
+-
+-		surface_mass_balance_input->GetInputValue(&surface_mass_balance_g,gauss);
+-		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
+-		thickness_input->GetInputValue(&thickness_g,gauss);
+-		if(basal_melting_correction_input)
+-		 basal_melting_correction_input->GetInputValue(&basal_melting_correction_g,gauss);
+-		else
+-		 basal_melting_correction_g=0.;
+-
+-		for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(thickness_g+dt*(surface_mass_balance_g-basal_melting_g-basal_melting_correction_g))*L[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorPrognostic_DG {{{*/
+-ElementVector* Tria::CreatePVectorPrognostic_DG(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     Jdettria,dt;
+-	IssmDouble     surface_mass_balance_g,basal_melting_g,thickness_g;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     L[NUMVERTICES];
+-	GaussTria* gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	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* thickness_input=inputs->GetInput(ThicknessEnum);                             _assert_(thickness_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
+-		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
+-
+-		surface_mass_balance_input->GetInputValue(&surface_mass_balance_g,gauss);
+-		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
+-		thickness_input->GetInputValue(&thickness_g,gauss);
+-
+-		for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(thickness_g+dt*(surface_mass_balance_g-basal_melting_g))*L[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorSlope {{{*/
+-ElementVector* Tria::CreatePVectorSlope(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-	
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	int        analysis_type;
+-	IssmDouble     Jdet;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     slope[2];
+-	IssmDouble     basis[3];
+-	GaussTria* gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* slope_input=NULL;
+-	if ( (analysis_type==SurfaceSlopeXAnalysisEnum) || (analysis_type==SurfaceSlopeYAnalysisEnum)){
+-		slope_input=inputs->GetInput(SurfaceEnum); _assert_(slope_input);
+-	}
+-	if ( (analysis_type==BedSlopeXAnalysisEnum) || (analysis_type==BedSlopeYAnalysisEnum)){
+-		slope_input=inputs->GetInput(BedEnum);     _assert_(slope_input);
+-	}
+-		
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis, gauss);
+-
+-		slope_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
+-
+-		if ( (analysis_type==SurfaceSlopeXAnalysisEnum) || (analysis_type==BedSlopeXAnalysisEnum)){
+-			for(i=0;i<numdof;i++) pe->values[i]+=Jdet*gauss->weight*slope[0]*basis[i];
+-		}
+-		if ( (analysis_type==SurfaceSlopeYAnalysisEnum) || (analysis_type==BedSlopeYAnalysisEnum)){
+-			for(i=0;i<numdof;i++) pe->values[i]+=Jdet*gauss->weight*slope[1]*basis[i];
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateJacobianMatrix{{{*/
+-void  Tria::CreateJacobianMatrix(Matrix* Jff){
+-
+-	/*retrieve parameters: */
+-	ElementMatrix* Ke=NULL;
+-	int analysis_type;
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*Checks in debugging {{{*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->parameters && this->inputs);
+-	/*}}}*/
+-
+-	/*Skip if water element*/
+-	if(IsOnWater()) return;
+-
+-	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-#ifdef _HAVE_DIAGNOSTIC_
+-		case DiagnosticHorizAnalysisEnum:
+-			Ke=CreateJacobianDiagnosticMacayeal();
+-			break;
+-#endif
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global matrix*/
+-	if(Ke){
+-		Ke->AddToGlobal(Jff);
+-		delete Ke;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::ComputeBasalStress {{{*/
+-void  Tria::ComputeBasalStress(Vector* eps){
+-	_error2_("Not Implemented yet");
+-}
+-/*}}}*/
+-/*FUNCTION Tria::ComputeStrainRate {{{*/
+-void  Tria::ComputeStrainRate(Vector* eps){
+-	_error2_("Not Implemented yet");
+-}
+-/*}}}*/
+-/*FUNCTION Tria::ComputeStressTensor {{{*/
+-void  Tria::ComputeStressTensor(){
+-
+-	int         iv;
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      pressure,viscosity;
+-	IssmDouble      epsilon[3]; /* epsilon=[exx,eyy,exy];*/
+-	IssmDouble      sigma_xx[NUMVERTICES];
+-	IssmDouble		sigma_yy[NUMVERTICES];
+-	IssmDouble		sigma_zz[NUMVERTICES]={0,0,0};
+-	IssmDouble      sigma_xy[NUMVERTICES];
+-	IssmDouble		sigma_xz[NUMVERTICES]={0,0,0};
+-	IssmDouble		sigma_yz[NUMVERTICES]={0,0,0};
+-	GaussTria* gauss=NULL;
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input);
+-	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->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosity2d(&viscosity,&epsilon[0]);
+-		pressure_input->GetInputValue(&pressure,gauss);
+-
+-		/*Compute Stress*/
+-		sigma_xx[iv]=2*viscosity*epsilon[0]-pressure; // sigma = nu eps - pressure
+-		sigma_yy[iv]=2*viscosity*epsilon[1]-pressure;
+-		sigma_xy[iv]=2*viscosity*epsilon[2];
+-	}
+-	
+-	/*Add Stress tensor components into inputs*/
+-	this->inputs->AddInput(new TriaP1Input(StressTensorxxEnum,&sigma_xx[0]));
+-	this->inputs->AddInput(new TriaP1Input(StressTensorxyEnum,&sigma_xy[0]));
+-	this->inputs->AddInput(new TriaP1Input(StressTensorxzEnum,&sigma_xz[0]));
+-	this->inputs->AddInput(new TriaP1Input(StressTensoryyEnum,&sigma_yy[0]));
+-	this->inputs->AddInput(new TriaP1Input(StressTensoryzEnum,&sigma_yz[0]));
+-	this->inputs->AddInput(new TriaP1Input(StressTensorzzEnum,&sigma_zz[0]));
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::Configure {{{*/
+-void  Tria::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
+-	
+-	/*go into parameters and get the analysis_counter: */
+-	int analysis_counter;
+-	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
+-
+-	/*Get Element type*/
+-	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);
+-	this->hmatice->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();
+-	else this->nodes=NULL;
+-	this->matice=(Matice*)this->hmatice->delivers();
+-	this->matpar=(Matpar*)this->hmatpar->delivers();
+-
+-	/*point parameters to real dataset: */
+-	this->parameters=parametersin;
+-
+-	/*get inputs configured too: */
+-	this->inputs->Configure(parameters);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::DeepEcho{{{*/
+-void Tria::DeepEcho(void){
+-
+-	_printLine_("Tria:");
+-	_printLine_("   id: " << id);
+-	if(nodes){
+-		nodes[0]->DeepEcho();
+-		nodes[1]->DeepEcho();
+-		nodes[2]->DeepEcho();
+-	}
+-	else _printLine_("nodes = NULL");
+-
+-	if (matice) matice->DeepEcho();
+-	else _printLine_("matice = NULL");
+-
+-	if (matpar) matpar->DeepEcho();
+-	else _printLine_("matpar = NULL");
+-
+-	_printLine_("   parameters");
+-	if (parameters) parameters->DeepEcho();
+-	else _printLine_("parameters = NULL");
+-
+-	_printLine_("   inputs");
+-	if (inputs) inputs->DeepEcho();
+-	else _printLine_("inputs=NULL");
+-
+-	if (results) results->DeepEcho();
+-	else _printLine_("results=NULL");
+-
+-	_printLine_("neighboor sids: ");
+-	_printLine_(" " << horizontalneighborsids[0] << " " << horizontalneighborsids[1] << " " << horizontalneighborsids[2]);
+-	
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::DeleteResults {{{*/
+-void  Tria::DeleteResults(void){
+-
+-	/*Delete and reinitialize results*/
+-	delete this->results;
+-	this->results=new Results();
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::Delta18oParameterization{{{*/
+-void  Tria::Delta18oParameterization(void){
+-	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+-	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
+-	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
+-	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
+-	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
+-	IssmDouble time,yts,finaltime;
+-	this->parameters->FindParam(&time,TimeEnum);
+-	this->parameters->FindParam(&yts,ConstantsYtsEnum);
+-	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+-
+-	/*Recover present day temperature and precipitation*/
+-	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
+-	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
+-	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
+-	GaussTria* gauss=new GaussTria();
+-	for(int month=0;month<12;month++) {
+-		for(int iv=0;iv<NUMVERTICES;iv++) {
+-			gauss->GaussVertex(iv);
+-			input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);
+-			input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
+-			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
+-			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
+-		}
+-	}
+-	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
+-	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
+-	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
+-	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
+-	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
+-	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
+-	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
+-
+-	/*Compute the temperature and precipitation*/
+-	for(int iv=0;iv<NUMVERTICES;iv++){
+-		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
+-					Delta18oPresent, Delta18oLgm, Delta18oTime,
+-					&PrecipitationsPresentday[iv][0], 
+-					&TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 
+-					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
+-	}
+-	/*Update inputs*/ 
+-	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
+-	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
+-	for (int imonth=0;imonth<12;imonth++) {
+-		for(int iv=0;iv<NUMVERTICES;iv++) {
+-			TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
+-			NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
+-			TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
+-			NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
+-		}
+-	}
+-	this->inputs->AddInput(NewTemperatureInput);
+-	this->inputs->AddInput(NewPrecipitationInput);
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::Echo{{{*/
+-void Tria::Echo(void){
+-	_printLine_("Tria:");
+-	_printLine_("   id: " << id);
+-	if(nodes){
+-		nodes[0]->Echo();
+-		nodes[1]->Echo();
+-		nodes[2]->Echo();
+-	}
+-	else _printLine_("nodes = NULL");
+-
+-	if (matice) matice->Echo();
+-	else _printLine_("matice = NULL");
+-
+-	if (matpar) matpar->Echo();
+-	else _printLine_("matpar = NULL");
+-
+-	_printLine_("   parameters");
+-	if (parameters) parameters->Echo();
+-	else _printLine_("parameters = NULL");
+-
+-	_printLine_("   inputs");
+-	if (inputs) inputs->Echo();
+-	else _printLine_("inputs=NULL");
+-
+-	if (results) results->Echo();
+-	else _printLine_("results=NULL");
+-
+-	_printLine_("neighboor sids: ");
+-	_printLine_(" " << horizontalneighborsids[0] << " " << horizontalneighborsids[1] << " " << horizontalneighborsids[2]);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::ObjectEnum{{{*/
+-int Tria::ObjectEnum(void){
+-
+-	return TriaEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetArea {{{*/
+-IssmDouble Tria::GetArea(void){
+-
+-	IssmDouble area=0;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble x1,y1,x2,y2,x3,y3;
+-
+-	/*Get xyz list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	x1=xyz_list[0][0]; y1=xyz_list[0][1];
+-	x2=xyz_list[1][0]; y2=xyz_list[1][1];
+-	x3=xyz_list[2][0]; y3=xyz_list[2][1];
+- 
+-	_assert_(x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1>0);
+-	return (x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1)/2;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetDofList {{{*/
+-void  Tria::GetDofList(int** pdoflist, int approximation_enum,int setenum){
+-
+-	int i,j;
+-	int count=0;
+-	int numberofdofs=0;
+-	int* doflist=NULL;
+-
+-	/*First, figure out size of doflist and create it: */
+-	for(i=0;i<3;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+-	doflist=xNew<int>(numberofdofs);
+-
+-	/*Populate: */
+-	count=0;
+-	for(i=0;i<3;i++){
+-		nodes[i]->GetDofList(doflist+count,approximation_enum,setenum);
+-		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+-	}
+-
+-	/*Assign output pointers:*/
+-	*pdoflist=doflist;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetDofList1 {{{*/
+-void  Tria::GetDofList1(int* doflist){
+-
+-	int i;
+-	for(i=0;i<3;i++) doflist[i]=nodes[i]->GetDofList1();
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetElementType {{{*/
+-int Tria::GetElementType(){
+-
+-	/*return TriaRef field*/
+-	return this->element_type;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetHorizontalNeighboorSids {{{*/
+-int* Tria::GetHorizontalNeighboorSids(){
+-
+-	/*return TriaRef field*/
+-	return &this->horizontalneighborsids[0];
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetNodeIndex {{{*/
+-int Tria::GetNodeIndex(Node* node){
+-
+-	_assert_(nodes);
+-	for(int i=0;i<NUMVERTICES;i++){
+-		if(node==nodes[i])
+-		 return i;
+-	}
+-	_error2_("Node provided not found among element nodes");
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype) {{{*/
+-void Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype){
+-
+-	/*Intermediaries*/
+-	IssmDouble     value[NUMVERTICES];
+-	GaussTria *gauss              = NULL;
+-
+-	/*Recover input*/
+-	Input* input=inputs->GetInput(enumtype);
+-	if (!input) _error2_("Input " << EnumToStringx(enumtype) << " not found in element");
+-
+-	/*Checks in debugging mode*/
+-	_assert_(pvalue);
+-
+-	/* Start looping on the number of vertices: */
+-	gauss=new GaussTria();
+-	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
+-		input->GetInputValue(&pvalue[iv],gauss);
+-	}
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue) {{{*/
+-void Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue){
+-
+-	IssmDouble     value[NUMVERTICES];
+-	GaussTria *gauss = NULL;
+-	Input     *input = inputs->GetInput(enumtype);
+-
+-	/*Checks in debugging mode*/
+-	_assert_(pvalue);
+-
+-	/* Start looping on the number of vertices: */
+-	if (input){
+-		gauss=new GaussTria();
+-		for (int iv=0;iv<NUMVERTICES;iv++){
+-			gauss->GaussVertex(iv);
+-			input->GetInputValue(&pvalue[iv],gauss);
+-		}
+-	}
+-	else{
+-		for (int iv=0;iv<NUMVERTICES;iv++) pvalue[iv]=defaultvalue;
+-	}
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue,int index) TO BE REMOVED{{{*/
+-void Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue,int index){
+-
+-	IssmDouble     value[NUMVERTICES];
+-	GaussTria *gauss = NULL;
+-	Input     *input = inputs->GetInput(enumtype);
+-
+-	/*Checks in debugging mode*/
+-	_assert_(pvalue);
+-
+-	/* Start looping on the number of vertices: */
+-	if (input){
+-		gauss=new GaussTria();
+-		for (int iv=0;iv<NUMVERTICES;iv++){
+-			gauss->GaussVertex(iv);
+-			input->GetInputValue(&pvalue[iv],gauss,index);
+-		}
+-	}
+-	else{
+-		for (int iv=0;iv<NUMVERTICES;iv++) pvalue[iv]=defaultvalue;
+-	}
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetInputValue(IssmDouble* pvalue,Node* node,int enumtype) {{{*/
+-void Tria::GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){
+-
+-	Input* input=inputs->GetInput(enumtype);
+-	if(!input) _error2_("No input of type " << EnumToStringx(enumtype) << " found in tria");
+-
+-	GaussTria* gauss=new GaussTria();
+-	gauss->GaussVertex(this->GetNodeIndex(node));
+-
+-	input->GetInputValue(pvalue,gauss);
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetSidList {{{*/
+-void  Tria::GetSidList(int* sidlist){
+-	for(int i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->GetSidList();
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetConnectivityList {{{*/
+-void  Tria::GetConnectivityList(int* connectivity){
+-	for(int i=0;i<NUMVERTICES;i++) connectivity[i]=nodes[i]->GetConnectivity();
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetSolutionFromInputs{{{*/
+-void  Tria::GetSolutionFromInputs(Vector* solution){
+-
+-	/*retrive parameters: */
+-	int analysis_type;
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-	#ifdef _HAVE_DIAGNOSTIC_
+-	case DiagnosticHorizAnalysisEnum:
+-		GetSolutionFromInputsDiagnosticHoriz(solution);
+-		break;
+-	case DiagnosticHutterAnalysisEnum:
+-		GetSolutionFromInputsDiagnosticHutter(solution);
+-		break;
+-	#endif
+-	#ifdef _HAVE_HYDROLOGY_
+-	case HydrologyAnalysisEnum:
+-		GetSolutionFromInputsHydrology(solution);
+-		break;
+-	#endif
+-	default:
+-		_error2_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetStrainRate2d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){{{*/
+-void Tria::GetStrainRate2d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){
+-	/*Compute the 2d Strain Rate (3 components):
+-	 * epsilon=[exx eyy exy] */
+-
+-	int i;
+-	IssmDouble epsilonvx[3];
+-	IssmDouble epsilonvy[3];
+-
+-	/*Check that both inputs have been found*/
+-	if (!vx_input || !vy_input){
+-		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");
+-	}
+-
+-	/*Get strain rate assuming that epsilon has been allocated*/
+-	vx_input->GetVxStrainRate2d(epsilonvx,xyz_list,gauss);
+-	vy_input->GetVyStrainRate2d(epsilonvy,xyz_list,gauss);
+-
+-	/*Sum all contributions*/
+-	for(i=0;i<3;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i];
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetVectorFromInputs{{{*/
+-void  Tria::GetVectorFromInputs(Vector* vector,int input_enum){
+-
+-	int doflist1[NUMVERTICES];
+-
+-	/*Get out if this is not an element input*/
+-	if(!IsInput(input_enum)) return;
+-
+-	/*Prepare index list*/
+-	this->GetDofList1(&doflist1[0]);
+-
+-	/*Get input (either in element or material)*/
+-	Input* input=inputs->GetInput(input_enum);
+-	if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in element");
+-
+-	/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
+-	input->GetVectorFromInputs(vector,&doflist1[0]);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetVectorFromResults{{{*/
+-void  Tria::GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp){
+-
+-	/*Get result*/
+-	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
+-	if(elementresult->InstanceEnum()!=enum_in){
+-		_error_("Results of offset %i is %s, when %s was expected",offset,EnumToStringx(elementresult->InstanceEnum()),EnumToStringx(enum_in));
+-	}
+-	if(interp==P1Enum){
+-		int doflist1[NUMVERTICES];
+-		int connectivity[NUMVERTICES];
+-		this->GetSidList(&doflist1[0]);
+-		this->GetConnectivityList(&connectivity[0]);
+-		elementresult->GetVectorFromResults(vector,&doflist1[0],&connectivity[0],NUMVERTICES);
+-	}
+-	else if(interp==P0Enum){
+-		elementresult->GetElementVectorFromResults(vector,sid);
+-	}
+-	else{
+-		_printLine_("Interpolation " << EnumToStringx(interp) << " not supported");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::Id {{{*/
+-int    Tria::Id(){
+-	
+-	return id;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::Sid {{{*/
+-int    Tria::Sid(){
+-	
+-	return sid;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputArtificialNoise{{{*/
+-void  Tria::InputArtificialNoise(int enum_type,IssmDouble min,IssmDouble max){
+-
+-	Input* input=NULL;
+-
+-	/*Make a copy of the original input: */
+-	input=(Input*)this->inputs->GetInput(enum_type);
+-	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
+-
+-	/*ArtificialNoise: */
+-	input->ArtificialNoise(min,max);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputConvergence{{{*/
+-bool Tria::InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums){
+-
+-	bool    converged=true;
+-	int     i;
+-	Input** new_inputs=NULL;
+-	Input** old_inputs=NULL;
+-
+-	new_inputs=xNew<Input*>(num_enums/2); //half the enums are for the new inputs
+-	old_inputs=xNew<Input*>(num_enums/2); //half the enums are for the old inputs
+-
+-	for(i=0;i<num_enums/2;i++){
+-		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
+-		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
+-		if(!new_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
+-		if(!old_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
+-	}
+-
+-	/*ok, we've got the inputs (new and old), now loop throught the number of criterions and fill the eps array:*/
+-	for(i=0;i<num_criterionenums;i++){
+-		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,criterionenums[i]);
+-		if(eps[i]>criterionvalues[i]) converged=false; 
+-	}
+-
+-	/*clean up and return*/
+-	xDelete<Input*>(new_inputs);
+-	xDelete<Input*>(old_inputs);
+-	return converged;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputDepthAverageAtBase {{{*/
+-void  Tria::InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum){
+-
+-	/*New input*/
+-	Input* oldinput=NULL;
+-	Input* newinput=NULL;
+-
+-	/*copy input of enum_type*/
+-	if (object_enum==MeshElementsEnum)
+-	 oldinput=(Input*)this->inputs->GetInput(enum_type);
+-	else if (object_enum==MaterialsEnum)
+-	 oldinput=(Input*)this->matice->inputs->GetInput(enum_type);
+-	else
+-	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
+-	if(!oldinput)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
+-	newinput=(Input*)oldinput->copy();
+-
+-	/*Assign new name (average)*/
+-	newinput->ChangeEnum(average_enum_type);
+-
+-	/*Add new input to current element*/
+-	if (object_enum==MeshElementsEnum)
+-	 this->inputs->AddInput((Input*)newinput);
+-	else if (object_enum==MaterialsEnum)
+-	 this->matice->inputs->AddInput((Input*)newinput);
+-	else
+-	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputDuplicate{{{*/
+-void  Tria::InputDuplicate(int original_enum,int new_enum){
+-
+-	/*Call inputs method*/
+-	if (IsInput(original_enum)) inputs->DuplicateInput(original_enum,new_enum);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputScale{{{*/
+-void  Tria::InputScale(int enum_type,IssmDouble scale_factor){
+-
+-	Input* input=NULL;
+-
+-	/*Make a copy of the original input: */
+-	input=(Input*)this->inputs->GetInput(enum_type);
+-	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
+-
+-	/*Scale: */
+-	input->Scale(scale_factor);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputToResult{{{*/
+-void  Tria::InputToResult(int enum_type,int step,IssmDouble time){
+-
+-	int    i;
+-	Input *input = NULL;
+-
+-	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
+-	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(enum_type);
+-	else input=this->inputs->GetInput(enum_type);
+-	//if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found in tria->inputs");
+-	if(!input)return;
+-
+-	/*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result 
+-	 * object out of the input, with the additional step and time information: */
+-	this->results->AddObject((Object*)input->SpawnResult(step,time));
+-	
+-	#ifdef _HAVE_CONTROL_
+-	if(input->ObjectEnum()==ControlInputEnum){
+-		if(((ControlInput*)input)->gradient!=NULL) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
+-	}
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromConstant(int value, int name);{{{*/
+-void  Tria::InputUpdateFromConstant(int constant, int name){
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	/*update input*/
+-	this->inputs->AddInput(new IntInput(name,constant));
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromConstant(IssmDouble value, int name);{{{*/
+-void  Tria::InputUpdateFromConstant(IssmDouble constant, int name){
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	/*update input*/
+-	this->inputs->AddInput(new DoubleInput(name,constant));
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromConstant(bool value, int name);{{{*/
+-void  Tria::InputUpdateFromConstant(bool constant, int name){
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	/*update input*/
+-	this->inputs->AddInput(new BoolInput(name,constant));
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromIoModel{{{*/
+-void Tria::InputUpdateFromIoModel(int index, IoModel* iomodel){ //i is the element index
+-
+-	/*Intermediaries*/
+-	int    i,j;
+-	int    tria_vertex_ids[3];
+-	IssmDouble nodeinputs[3];
+-	IssmDouble cmmininputs[3];
+-	IssmDouble cmmaxinputs[3];
+-	bool   control_analysis=false;
+-	int    num_control_type;
+-	IssmDouble yts;
+-	int    num_cm_responses;
+-   
+-	/*Get parameters: */
+-	iomodel->Constant(&yts,ConstantsYtsEnum); 
+-	iomodel->Constant(&control_analysis,InversionIscontrolEnum);
+-	if(control_analysis) iomodel->Constant(&num_control_type,InversionNumControlParametersEnum);
+-	if(control_analysis) iomodel->Constant(&num_cm_responses,InversionNumCostFunctionsEnum);
+-
+-	/*Recover vertices ids needed to initialize inputs*/
+-	for(i=0;i<3;i++){ 
+-		tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab
+-	}
+-
+-	/*Control Inputs*/
+-	#ifdef _HAVE_CONTROL_
+-	if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+-		for(i=0;i<num_control_type;i++){
+-			switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
+-				case BalancethicknessThickeningRateEnum:
+-					if (iomodel->Data(BalancethicknessThickeningRateEnum)){
+-						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(BalancethicknessThickeningRateEnum)[tria_vertex_ids[j]-1]/yts;
+-						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-					}
+-					break;
+-				case VxEnum:
+-					if (iomodel->Data(VxEnum)){
+-						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(VxEnum)[tria_vertex_ids[j]-1]/yts;
+-						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						this->inputs->AddInput(new ControlInput(VxEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-					}
+-					break;
+-				case VyEnum:
+-					if (iomodel->Data(VyEnum)){
+-						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(VyEnum)[tria_vertex_ids[j]-1]/yts;
+-						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						this->inputs->AddInput(new ControlInput(VyEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-					}
+-					break;
+-				case FrictionCoefficientEnum:
+-					if (iomodel->Data(FrictionCoefficientEnum)){
+-						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(FrictionCoefficientEnum)[tria_vertex_ids[j]-1];
+-						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
+-						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
+-						this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-					}
+-					break;
+-				case MaterialsRheologyBbarEnum:
+-					/*Matice will take care of it*/ break;
+-				default:
+-					_error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
+-			}
+-		}
+-	}
+-	#endif
+-
+-	/*DatasetInputs*/
+-	if (control_analysis && iomodel->Data(InversionCostFunctionsCoefficientsEnum)){
+-
+-		/*Create inputs and add to DataSetInput*/
+-		DatasetInput* datasetinput=new DatasetInput(InversionCostFunctionsCoefficientsEnum);
+-		for(i=0;i<num_cm_responses;i++){
+-			for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(InversionCostFunctionsCoefficientsEnum)[(tria_vertex_ids[j]-1)*num_cm_responses+i];
+-			datasetinput->inputs->AddObject(new TriaP1Input(InversionCostFunctionsCoefficientsEnum,nodeinputs));
+-		}
+-
+-		/*Add datasetinput to element inputs*/
+-		this->inputs->AddInput(datasetinput);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromSolution {{{*/
+-void  Tria::InputUpdateFromSolution(IssmDouble* solution){
+-
+-	/*retrive parameters: */
+-	int analysis_type;
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		case DiagnosticHorizAnalysisEnum:
+-			InputUpdateFromSolutionDiagnosticHoriz( solution);
+-			break;
+-		case DiagnosticHutterAnalysisEnum:
+-			InputUpdateFromSolutionDiagnosticHoriz( solution);
+-			break;
+-		#endif
+-		#ifdef _HAVE_CONTROL_
+-		case AdjointHorizAnalysisEnum:
+-			InputUpdateFromSolutionAdjointHoriz( solution);
+-			break;
+-		case AdjointBalancethicknessAnalysisEnum:
+-			InputUpdateFromSolutionAdjointBalancethickness( solution);
+-			break;
+-		#endif
+-		#ifdef _HAVE_HYDROLOGY_ 
+-		case HydrologyAnalysisEnum:
+-			InputUpdateFromSolutionHydrology(solution);
+-			break ;
+-		#endif
+-	 	#ifdef _HAVE_BALANCED_
+-		case BalancethicknessAnalysisEnum:
+-			InputUpdateFromSolutionOneDof(solution,ThicknessEnum);
+-			break;
+-		#endif
+-		case BedSlopeXAnalysisEnum:
+-			InputUpdateFromSolutionOneDof(solution,BedSlopeXEnum);
+-			break;
+-		case BedSlopeYAnalysisEnum:
+-			InputUpdateFromSolutionOneDof(solution,BedSlopeYEnum);
+-			break;
+-		case SurfaceSlopeXAnalysisEnum:
+-			InputUpdateFromSolutionOneDof(solution,SurfaceSlopeXEnum);
+-			break;
+-		case SurfaceSlopeYAnalysisEnum:
+-			InputUpdateFromSolutionOneDof(solution,SurfaceSlopeYEnum);
+-			break;
+-		case PrognosticAnalysisEnum:
+-			InputUpdateFromSolutionPrognostic(solution);
+-			break;
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromSolutionOneDof{{{*/
+-void  Tria::InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type){
+-
+-	const int numdof          = NDOF1*NUMVERTICES;
+-
+-	int*      doflist=NULL;
+-	IssmDouble    values[numdof];
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(int i=0;i<numdof;i++){
+-		values[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Add input to the element: */
+-	this->inputs->AddInput(new TriaP1Input(enum_type,values));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromSolutionPrognostic{{{*/
+-void  Tria::InputUpdateFromSolutionPrognostic(IssmDouble* solution){
+-
+-	/*Intermediaries*/
+-	const int numdof = NDOF1*NUMVERTICES;
+-
+-	int       i,hydroadjustment;
+-	int*      doflist=NULL;
+-	IssmDouble    rho_ice,rho_water,minthickness;
+-	IssmDouble    newthickness[numdof];
+-	IssmDouble    newbed[numdof];
+-	IssmDouble    newsurface[numdof];
+-	IssmDouble    oldbed[NUMVERTICES];
+-	IssmDouble    oldsurface[NUMVERTICES];
+-	IssmDouble    oldthickness[NUMVERTICES];
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	this->parameters->FindParam(&minthickness,PrognosticMinThicknessEnum);
+-	for(i=0;i<numdof;i++){
+-		newthickness[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(newthickness[i])) _error2_("NaN found in solution vector");
+-		/*Constrain thickness to be at least 1m*/
+-		if(newthickness[i]<minthickness) newthickness[i]=minthickness;
+-	}
+-
+-	/*Get previous bed, thickness and surface*/
+-	GetInputListOnVertices(&oldbed[0],BedEnum);
+-	GetInputListOnVertices(&oldsurface[0],SurfaceEnum);
+-	GetInputListOnVertices(&oldthickness[0],ThicknessEnum);
+-
+-	/*Fing PrognosticHydrostaticAdjustment to figure out how to update the geometry:*/
+-	this->parameters->FindParam(&hydroadjustment,PrognosticHydrostaticAdjustmentEnum);
+-	rho_ice=matpar->GetRhoIce();
+-	rho_water=matpar->GetRhoWater();
+-
+-	for(i=0;i<numdof;i++) {
+-		/*If shelf: hydrostatic equilibrium*/
+-		if (this->nodes[i]->IsGrounded()){
+-			newsurface[i]=oldbed[i]+newthickness[i]; //surface = oldbed + newthickness
+-			newbed[i]=oldbed[i];               //same bed: do nothing
+-		}
+-		else{ //this is an ice shelf
+-
+-			if(hydroadjustment==AbsoluteEnum){
+-				newsurface[i]=newthickness[i]*(1-rho_ice/rho_water);
+-				newbed[i]=newthickness[i]*(-rho_ice/rho_water);
+-			}
+-			else if(hydroadjustment==IncrementalEnum){
+-				newsurface[i]=oldsurface[i]+(1.0-rho_ice/rho_water)*(newthickness[i]-oldthickness[i]); //surface = oldsurface + (1-di) * dH 
+-				newbed[i]=oldbed[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i]); //bed = oldbed + di * dH
+-			}
+-			else _error2_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
+-		}
+-	}
+-
+-	/*Add input to the element: */
+-	this->inputs->AddInput(new TriaP1Input(ThicknessEnum,newthickness));
+-	this->inputs->AddInput(new TriaP1Input(SurfaceEnum,newsurface));
+-	this->inputs->AddInput(new TriaP1Input(BedEnum,newbed));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromVector(IssmDouble* vector, int name, int type);{{{*/
+-void  Tria::InputUpdateFromVector(IssmDouble* vector, int name, int type){
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	switch(type){
+-
+-		case VertexEnum: {
+-
+-			/*New TriaP1Input*/
+-			IssmDouble values[3];
+-
+-			/*Get values on the 3 vertices*/
+-			for (int i=0;i<3;i++){
+-				values[i]=vector[this->nodes[i]->GetVertexDof()];
+-			}
+-
+-			/*update input*/
+-			if (name==MaterialsRheologyBbarEnum || name==MaterialsRheologyBEnum){
+-				matice->inputs->AddInput(new TriaP1Input(name,values));
+-			}
+-			else{
+-				this->inputs->AddInput(new TriaP1Input(name,values));
+-			}
+-			return;
+-		}
+-		default:
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromVector(int* vector, int name, int type);{{{*/
+-void  Tria::InputUpdateFromVector(int* vector, int name, int type){
+-	_error2_("not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromVector(bool* vector, int name, int type);{{{*/
+-void  Tria::InputUpdateFromVector(bool* vector, int name, int type){
+-	_error2_("not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputCreate(IssmDouble scalar,int enum,int code);{{{*/
+-void Tria::InputCreate(IssmDouble scalar,int name,int code){
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-	
+-	if ((code==5) || (code==1)){ //boolean
+-		this->inputs->AddInput(new BoolInput(name,reCast<bool>(scalar)));
+-	}
+-	else if ((code==6) || (code==2)){ //integer
+-		this->inputs->AddInput(new IntInput(name,reCast<int>(scalar)));
+-	}
+-	else if ((code==7) || (code==3)){ //IssmDouble
+-		this->inputs->AddInput(new DoubleInput(name,reCast<int>(scalar)));
+-	}
+-	else _error2_("could not recognize nature of vector from code " << code);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputCreate(IssmDouble* vector,int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){{{*/
+-void Tria::InputCreate(IssmDouble* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){//index into elements
+-
+-	/*Intermediaries*/
+-	int    i,j,t;
+-	int    tria_vertex_ids[3];
+-	int    row;
+-	IssmDouble nodeinputs[3];
+-	IssmDouble time;
+-	TransientInput* transientinput=NULL;
+-	int    numberofvertices;
+-	int    numberofelements;
+-	IssmDouble yts;
+-
+-
+-	/*Fetch parameters: */
+-	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
+-	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
+-	iomodel->Constant(&yts,ConstantsYtsEnum);
+-
+-	/*Branch on type of vector: nodal or elementary: */
+-	if(vector_type==1){ //nodal vector
+-
+-		/*Recover vertices ids needed to initialize inputs*/
+-		for(i=0;i<3;i++){ 
+-			_assert_(iomodel->Data(MeshElementsEnum));
+-			tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab
+-		}
+-
+-		/*Are we in transient or static? */
+-		if(M==numberofvertices){
+-
+-			/*create input values: */
+-			for(i=0;i<3;i++)nodeinputs[i]=(IssmDouble)vector[tria_vertex_ids[i]-1];
+-
+-			/*process units: */
+-			UnitConversion(&nodeinputs[0], 3 ,ExtToIuEnum, vector_enum);
+-
+-			/*create static input: */
+-			this->inputs->AddInput(new TriaP1Input(vector_enum,nodeinputs));
+-		}
+-		else if(M==numberofvertices+1){
+-			/*create transient input: */
+-			for(t=0;t<N;t++){ //N is the number of times
+-
+-				/*create input values: */
+-				for(i=0;i<3;i++){
+-					row=tria_vertex_ids[i]-1;
+-					nodeinputs[i]=(IssmDouble)vector[N*row+t];
+-				}
+-
+-				/*process units: */
+-				UnitConversion(&nodeinputs[0], 3 ,ExtToIuEnum, vector_enum);
+-
+-				/*time? :*/
+-				time=(IssmDouble)vector[(M-1)*N+t]*yts;
+-
+-				if(t==0) transientinput=new TransientInput(vector_enum);
+-				transientinput->AddTimeInput(new TriaP1Input(vector_enum,nodeinputs),time);
+-			}
+-			this->inputs->AddInput(transientinput);
+-		}
+-		else _error2_("nodal vector is either numberofnodes or numberofnodes+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
+-	}
+-	else if(vector_type==2){ //element vector
+-		/*Are we in transient or static? */
+-		if(M==numberofelements){
+-
+-			/*static mode: create an input out of the element value: */
+-
+-			if (code==5){ //boolean
+-				this->inputs->AddInput(new BoolInput(vector_enum,reCast<bool>(vector[index])));
+-			}
+-			else if (code==6){ //integer
+-				this->inputs->AddInput(new IntInput(vector_enum,reCast<int>(vector[index])));
+-			}
+-			else if (code==7){ //IssmDouble
+-				this->inputs->AddInput(new DoubleInput(vector_enum,vector[index]));
+-			}
+-			else _error2_("could not recognize nature of vector from code " << code);
+-		}
+-		else {
+-			_error2_("transient elementary inputs not supported yet!");
+-		}
+-	}
+-	else{
+-		_error2_("Cannot add input for vector type " << vector_type << " (not supported)");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::IsInput{{{*/
+-bool Tria::IsInput(int name){
+-	if (
+-				name==ThicknessEnum ||
+-				name==SurfaceEnum ||
+-				name==BedEnum ||
+-				name==SurfaceSlopeXEnum ||
+-				name==SurfaceSlopeYEnum ||
+-				name==BasalforcingsMeltingRateEnum ||
+-				name==WatercolumnEnum || 
+-				name==SurfaceforcingsMassBalanceEnum ||
+-				name==SurfaceAreaEnum||
+-				name==VxEnum ||
+-				name==VyEnum ||
+-				name==InversionVxObsEnum ||
+-				name==InversionVyObsEnum ||
+-				name==FrictionCoefficientEnum ||
+-				name==MaterialsRheologyBbarEnum ||
+-				name==GradientEnum ||
+-				name==OldGradientEnum ||
+-				name==QmuVxEnum ||
+-				name==QmuVyEnum ||
+-				name==QmuPressureEnum ||
+-				name==QmuBedEnum ||
+-				name==QmuThicknessEnum ||
+-				name==QmuSurfaceEnum ||
+-				name==QmuTemperatureEnum ||
+-				name==QmuMeltingEnum
+-		){
+-		return true;
+-	}
+-	else return false;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::IsOnBed {{{*/
+-bool Tria::IsOnBed(){
+-	
+-	bool onbed;
+-	inputs->GetInputValue(&onbed,MeshElementonbedEnum);
+-	return onbed;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::IsFloating {{{*/
+-bool   Tria::IsFloating(){
+-
+-	bool shelf;
+-	inputs->GetInputValue(&shelf,MaskElementonfloatingiceEnum);
+-	return shelf;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::IsNodeOnShelf {{{*/
+-bool   Tria::IsNodeOnShelf(){
+-
+-	int  i;
+-	bool shelf=false;
+-
+-	for(i=0;i<3;i++){
+-		if (nodes[i]->IsFloating()){
+-			shelf=true;
+-			break;
+-		}
+-	}
+-	return shelf;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::IsNodeOnShelfFromFlags {{{*/
+-bool   Tria::IsNodeOnShelfFromFlags(IssmDouble* flags){
+-
+-	int  i;
+-	bool shelf=false;
+-
+-	for(i=0;i<NUMVERTICES;i++){
+-		if (reCast<bool>(flags[nodes[i]->Sid()])){
+-			shelf=true;
+-			break;
+-		}
+-	}
+-	return shelf;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::IsOnWater {{{*/
+-bool   Tria::IsOnWater(){
+-
+-	bool water;
+-	inputs->GetInputValue(&water,MaskElementonwaterEnum);
+-	return water;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::ListResultsInfo{{{*/
+-void Tria::ListResultsInfo(int** in_resultsenums,int** in_resultssizes,IssmDouble** in_resultstimes,int** in_resultssteps,int* in_num_results){
+-
+-	/*Intermediaries*/
+-	int     i;
+-	int     numberofresults = 0;
+-	int     *resultsenums   = NULL;
+-	int     *resultssizes   = NULL;
+-	IssmDouble  *resultstimes   = NULL;
+-	int     *resultssteps   = NULL;
+-
+-	/*Checks*/
+-	_assert_(in_num_results);
+-
+-	/*Count number of results*/
+-	for(i=0;i<this->results->Size();i++){
+-		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+-		numberofresults++;
+-	}
+-
+-	if(numberofresults){
+-
+-		/*Allocate output*/
+-		resultsenums=xNew<int>(numberofresults);
+-		resultssizes=xNew<int>(numberofresults);
+-		resultstimes=xNew<IssmDouble>(numberofresults);
+-		resultssteps=xNew<int>(numberofresults);
+-
+-		/*populate enums*/
+-		for(i=0;i<this->results->Size();i++){
+-			ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+-			resultsenums[i]=elementresult->InstanceEnum();
+-			resultstimes[i]=elementresult->GetTime();
+-			resultssteps[i]=elementresult->GetStep();
+-			if(elementresult->ObjectEnum()==TriaP1ElementResultEnum){
+-				resultssizes[i]=P1Enum;
+-			}
+-			else{
+-				resultssizes[i]=P0Enum;
+-			}
+-		}
+-	}
+-
+-	/*Assign output pointers:*/
+-	*in_num_results=numberofresults;
+-	*in_resultsenums=resultsenums;
+-	*in_resultssizes=resultssizes;
+-	*in_resultstimes=resultstimes;
+-	*in_resultssteps=resultssteps;
+-
+-}/*}}}*/
+-/*FUNCTION Tria::MigrateGroundingLine{{{*/
+-void  Tria::MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding){
+-
+-	int     i,migration_style,unground;
+-	bool    elementonshelf = false;
+-	IssmDouble  bed_hydro,yts,gl_melting_rate;
+-	IssmDouble  rho_water,rho_ice,density;
+-	IssmDouble  melting[NUMVERTICES];
+-	IssmDouble  h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES];
+-
+-	/*Recover info at the vertices: */
+-	parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
+-	parameters->FindParam(&yts,ConstantsYtsEnum);
+-	GetInputListOnVertices(&h[0],ThicknessEnum);
+-	GetInputListOnVertices(&s[0],SurfaceEnum);
+-	GetInputListOnVertices(&b[0],BedEnum);
+-	GetInputListOnVertices(&ba[0],BathymetryEnum);
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice=matpar->GetRhoIce();
+-	density=rho_ice/rho_water;
+-	
+-	/*go through vertices, and update inputs, considering them to be TriaVertex type: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		/*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
+-		if(reCast<bool>(old_floating_ice[nodes[i]->Sid()])){
+-			if(b[i]<=ba[i]){ 
+-				b[i]=ba[i];
+-				s[i]=b[i]+h[i];
+-				nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false));
+-				nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true));
+-			}
+-		}
+-		/*Ice sheet: if hydrostatic bed above bathymetry, ice sheet starts to unground, elso do nothing */
+-		/*Change only if AgressiveMigration or if the ice sheet is in contact with the ocean*/
+-		else{
+-			bed_hydro=-density*h[i];
+-			if (bed_hydro>ba[i]){
+-				/*Unground only if the element is connected to the ice shelf*/
+-				if(migration_style==AgressiveMigrationEnum){
+-					s[i]=(1-density)*h[i];
+-					b[i]=-density*h[i];
+-					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
+-					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
+-				}
+-				else if(migration_style==SoftMigrationEnum && reCast<bool>(sheet_ungrounding[nodes[i]->Sid()])){
+-					s[i]=(1-density)*h[i];
+-					b[i]=-density*h[i];
+-					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
+-					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
+-				}
+-			}
+-		}
+-	}
+-
+-	/*If at least one vertex is now floating, the element is now floating*/
+-	for(i=0;i<NUMVERTICES;i++){
+-		if(nodes[i]->IsFloating()){
+-			elementonshelf=true;
+-			break;
+-		}
+-	}
+-	
+-   /*Add basal melting rate if element just ungrounded*/
+-	if(!this->IsFloating() && elementonshelf==true){
+-		for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
+-		this->inputs->AddInput(new TriaP1Input(BasalforcingsMeltingRateEnum,&melting[0]));
+-	} 
+-
+-	/*Update inputs*/
+-   this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
+-
+-	/*Update inputs*/    
+-	this->inputs->AddInput(new TriaP1Input(SurfaceEnum,&s[0]));
+-	this->inputs->AddInput(new TriaP1Input(BedEnum,&b[0]));
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MyRank {{{*/
+-int    Tria::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Tria::NodalValue {{{*/
+-int    Tria::NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units){
+-
+-	int         found = 0;
+-	IssmDouble  value;
+-	Input      *data  = NULL;
+-	GaussTria  *gauss = NULL;
+-
+-	/*First, serarch the input: */
+-	data=inputs->GetInput(natureofdataenum); 
+-
+-	/*figure out if we have the vertex id: */
+-	found=0;
+-	for(int i=0;i<NUMVERTICES;i++){
+-		if(index==nodes[i]->GetVertexId()){
+-			/*Do we have natureofdataenum in our inputs? :*/
+-			if(data){
+-				/*ok, we are good. retrieve value of input at vertex :*/
+-				gauss=new GaussTria(); gauss->GaussVertex(i);
+-				data->GetInputValue(&value,gauss);
+-				found=1;
+-				break;
+-			}
+-		}
+-	}
+-
+-	/*clean-up*/
+-	delete gauss;
+-
+-	if(found)*pvalue=value;
+-	return found;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::PatchFill{{{*/
+-void  Tria::PatchFill(int* prow, Patch* patch){
+-
+-	int i,row;
+-	int vertices_ids[3];
+-
+-	/*recover pointer: */
+-	row=*prow;
+-		
+-	for(i=0;i<3;i++) vertices_ids[i]=nodes[i]->GetVertexId(); //vertices id start at column 3 of the patch.
+-
+-	for(i=0;i<this->results->Size();i++){
+-		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+-
+-		/*For this result,fill the information in the Patch object (element id + vertices ids), and then hand 
+-		 *it to the result object, to fill the rest: */
+-		patch->fillelementinfo(row,this->sid+1,vertices_ids,3);
+-		elementresult->PatchFill(row,patch);
+-
+-		/*increment rower: */
+-		row++;
+-	}
+-
+-	/*Assign output pointers:*/
+-	*prow=row;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::PatchSize{{{*/
+-void  Tria::PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes){
+-
+-	int     i;
+-	int     numrows       = 0;
+-	int     numnodes      = 0;
+-	int     temp_numnodes = 0;
+-
+-	/*Go through all the results objects, and update the counters: */
+-	for (i=0;i<this->results->Size();i++){
+-		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+-		/*first, we have one more result: */
+-		numrows++;
+-		/*now, how many vertices and how many nodal values for this result? :*/
+-		temp_numnodes=elementresult->NumberOfNodalValues(); //ask result object.
+-		if(temp_numnodes>numnodes)numnodes=temp_numnodes;
+-	}
+-
+-	/*Assign output pointers:*/
+-	*pnumrows=numrows;
+-	*pnumvertices=NUMVERTICES;
+-	*pnumnodes=numnodes;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::PotentialSheetUngrounding{{{*/
+-void  Tria::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){
+-
+-	int     i;
+-	IssmDouble  h[NUMVERTICES],ba[NUMVERTICES];
+-	IssmDouble  bed_hydro;
+-	IssmDouble  rho_water,rho_ice,density;
+-	bool    elementonshelf = false;
+-
+-	/*material parameters: */
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice=matpar->GetRhoIce();
+-	density=rho_ice/rho_water;
+-	GetInputListOnVertices(&h[0],ThicknessEnum);
+-	GetInputListOnVertices(&ba[0],BathymetryEnum);
+-
+-	/*go through vertices, and figure out which ones are on the ice sheet, and want to unground: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		/*Find if grounded vertices want to start floating*/
+-		if (!nodes[i]->IsFloating()){
+-			bed_hydro=-density*h[i];
+-			if (bed_hydro>ba[i]){
+-				/*Vertex that could potentially unground, flag it*/
+-				potential_sheet_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
+-			}
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::PositiveDegreeDay{{{*/
+-void  Tria::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm){
+-
+-   IssmDouble agd[NUMVERTICES];             // surface mass balance
+-   IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+-   IssmDouble h[NUMVERTICES],s[NUMVERTICES]; // ,b
+-   IssmDouble rho_water,rho_ice;
+-
+-   /*Recover monthly temperatures and precipitation*/
+-   Input*     input=inputs->GetInput(SurfaceforcingsMonthlytemperaturesEnum); _assert_(input);
+-   Input*     input2=inputs->GetInput(SurfaceforcingsPrecipitationEnum); _assert_(input2);
+-   GaussTria* gauss=new GaussTria();
+-   IssmDouble time,yts;
+-   this->parameters->FindParam(&time,TimeEnum);
+-   this->parameters->FindParam(&yts,ConstantsYtsEnum);
+-   for(int month=0;month<12;month++) {
+-     for(int iv=0;iv<NUMVERTICES;iv++) {
+-       gauss->GaussVertex(iv);
+-       input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts);
+-       monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius
+-       input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts);
+-       monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
+-     }
+-   }
+-
+-  /*Recover info at the vertices: */
+-  GetInputListOnVertices(&h[0],ThicknessEnum);
+-  GetInputListOnVertices(&s[0],SurfaceEnum);
+-
+-  /*Get material parameters :*/
+-  rho_ice=matpar->GetRhoIce();
+-  rho_water=matpar->GetRhoFreshwater();
+-
+-   /*measure the surface mass balance*/
+-   for (int iv = 0; iv<NUMVERTICES; iv++){
+-     agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], pdds, pds, signorm, yts, h[iv], s[iv], rho_ice, rho_water);
+-   }
+-
+-   /*Update inputs*/    
+-   this->inputs->AddInput(new TriaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0]));
+-   // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::ProcessResultsUnits{{{*/
+-void  Tria::ProcessResultsUnits(void){
+-
+-	int i;
+-
+-	for(i=0;i<this->results->Size();i++){
+-		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+-		elementresult->ProcessUnits(this->parameters);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::RequestedOutput{{{*/
+-void Tria::RequestedOutput(int output_enum,int step,IssmDouble time){
+-
+-	if(IsInput(output_enum)){
+-		/*just transfer this input to results, and we are done: */
+-		InputToResult(output_enum,step,time);
+-	}
+-	else{
+-		/*this input does not exist, compute it, and then transfer to results: */
+-		switch(output_enum){
+-			case StressTensorEnum: 
+-				this->ComputeStressTensor();
+-				InputToResult(StressTensorxxEnum,step,time);
+-				InputToResult(StressTensorxyEnum,step,time);
+-				InputToResult(StressTensorxzEnum,step,time);
+-				InputToResult(StressTensoryyEnum,step,time);
+-				InputToResult(StressTensoryzEnum,step,time);
+-				InputToResult(StressTensorzzEnum,step,time);
+-				break;
+-
+-			default:
+-				/*do nothing, no need to derail the computation because one of the outputs requested cannot be found: */
+-				break;
+-		}
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SetClone {{{*/
+-void  Tria::SetClone(int* minranks){
+-
+-	_error2_("not implemented yet");
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SmearFunction {{{*/
+-void  Tria::SmearFunction(Vector*  smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
+-	_error2_("not implemented yet");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SmbGradients{{{*/
+-void Tria::SmbGradients(void){
+-
+-	int i;
+-
+-	// input
+-   IssmDouble h[NUMVERTICES];					// ice thickness (m)		
+-	IssmDouble s[NUMVERTICES];					// surface elevation (m)
+-	IssmDouble a_pos[NUMVERTICES];				// Hs-SMB relation parameter 
+-	IssmDouble b_pos[NUMVERTICES];				// Hs-SMB relation parameter
+-	IssmDouble a_neg[NUMVERTICES];				// Hs-SMB relation parameter
+-	IssmDouble b_neg[NUMVERTICES];				// Hs-SMB relation paremeter
+-	IssmDouble Hc[NUMVERTICES];					// elevation of transition between accumulation regime and ablation regime
+-	IssmDouble smb_pos_max[NUMVERTICES];		// maximum SMB value in the accumulation regime
+-	IssmDouble smb_pos_min[NUMVERTICES];		// minimum SMB value in the accumulation regime
+-   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(&Hc[0],SurfaceforcingsHcEnum);
+-	GetInputListOnVertices(&smb_pos_max[0],SurfaceforcingsSmbPosMaxEnum);
+-	GetInputListOnVertices(&smb_pos_min[0],SurfaceforcingsSmbPosMinEnum);
+-	GetInputListOnVertices(&a_pos[0],SurfaceforcingsAPosEnum);
+-	GetInputListOnVertices(&b_pos[0],SurfaceforcingsBPosEnum);
+-	GetInputListOnVertices(&a_neg[0],SurfaceforcingsANegEnum);
+-	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(s[i]>Hc[i]){
+-	    smb[i]=a_pos[i]+b_pos[i]*s[i];
+-		 if(smb[i]>smb_pos_max[i]){smb[i]=smb_pos_max[i];}
+-		 if(smb[i]<smb_pos_min[i]){smb[i]=smb_pos_min[i];}
+-	  }
+-	  else{
+-	    smb[i]=a_neg[i]+b_neg[i]*s[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 TriaP1Input(SurfaceforcingsMassBalanceEnum,&smb[0]));
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SetCurrentConfiguration {{{*/
+-void  Tria::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
+-	
+-	/*go into parameters and get the analysis_counter: */
+-	int analysis_counter;
+-	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
+-
+-	/*Get Element type*/
+-	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;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SurfaceArea {{{*/
+-IssmDouble Tria::SurfaceArea(void){
+-
+-	int    i;
+-	IssmDouble S;
+-	IssmDouble normal[3];
+-	IssmDouble v13[3],v23[3];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	for (i=0;i<3;i++){
+-		v13[i]=xyz_list[0][i]-xyz_list[2][i];
+-		v23[i]=xyz_list[1][i]-xyz_list[2][i];
+-	}
+-
+-	normal[0]=v13[1]*v23[2]-v13[2]*v23[1];
+-	normal[1]=v13[2]*v23[0]-v13[0]*v23[2];
+-	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
+-
+-	S = 0.5 * sqrt(pow(normal[0],(IssmDouble)2)+pow(normal[1],(IssmDouble)2)+pow(normal[2],(IssmDouble)2));
+-
+-	/*Return: */
+-	return S;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SurfaceNormal{{{*/
+-void Tria::SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]){
+-
+-	int i;
+-	IssmDouble v13[3],v23[3];
+-	IssmDouble normal[3];
+-	IssmDouble normal_norm;
+-
+-	for (i=0;i<3;i++){
+-		v13[i]=xyz_list[0][i]-xyz_list[2][i];
+-		v23[i]=xyz_list[1][i]-xyz_list[2][i];
+-	}
+-
+-	normal[0]=v13[1]*v23[2]-v13[2]*v23[1];
+-	normal[1]=v13[2]*v23[0]-v13[0]*v23[2];
+-	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
+-
+-	normal_norm=sqrt( pow(normal[0],(IssmDouble)2)+pow(normal[1],(IssmDouble)2)+pow(normal[2],(IssmDouble)2) );
+-
+-	*(surface_normal)=normal[0]/normal_norm;
+-	*(surface_normal+1)=normal[1]/normal_norm;
+-	*(surface_normal+2)=normal[2]/normal_norm;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::TimeAdapt{{{*/
+-IssmDouble  Tria::TimeAdapt(void){
+-
+-	/*intermediary: */
+-	int    i;
+-	IssmDouble C,dt;
+-	IssmDouble dx,dy;
+-	IssmDouble maxx,minx;
+-	IssmDouble maxy,miny;
+-	IssmDouble maxabsvx,maxabsvy;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-
+-	/*get CFL coefficient:*/
+-	this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
+-
+-	/*Get for Vx and Vy, the max of abs value: */
+-	#ifdef _HAVE_RESPONSES_
+-	this->MaxAbsVx(&maxabsvx,false);
+-	this->MaxAbsVy(&maxabsvy,false);
+-	#else
+-		_error2_("ISSM was not compiled with responses compiled in, exiting!");
+-	#endif
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], this->nodes, NUMVERTICES);
+-
+-	minx=xyz_list[0][0];
+-	maxx=xyz_list[0][0];
+-	miny=xyz_list[0][1];
+-	maxy=xyz_list[0][1];
+-
+-	for(i=1;i<NUMVERTICES;i++){
+-		if (xyz_list[i][0]<minx)minx=xyz_list[i][0];
+-		if (xyz_list[i][0]>maxx)maxx=xyz_list[i][0];
+-		if (xyz_list[i][1]<miny)miny=xyz_list[i][1];
+-		if (xyz_list[i][1]>maxy)maxy=xyz_list[i][1];
+-	}
+-	dx=maxx-minx;
+-	dy=maxy-miny;
+-
+-	/*CFL criterion: */
+-	dt=C/(maxabsvy/dx+maxabsvy/dy);
+-
+-	return dt;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type){{{*/
+-void Tria::Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type){ //i is the element index
+-
+-	/*Intermediaries*/
+-	int    i,j;
+-	int    tria_node_ids[3];
+-	int    tria_vertex_ids[3];
+-	int    tria_type;
+-	IssmDouble nodeinputs[3];
+-	IssmDouble yts;
+-	int    progstabilization,balancestabilization;
+-	bool   dakota_analysis;
+-
+-	/*Checks if debuging*/
+-	/*{{{*/
+-	_assert_(iomodel->Data(MeshElementsEnum));
+-	/*}}}*/
+-
+-	/*Fetch parameters: */
+-	iomodel->Constant(&yts,ConstantsYtsEnum);
+-	iomodel->Constant(&progstabilization,PrognosticStabilizationEnum);
+-	iomodel->Constant(&balancestabilization,BalancethicknessStabilizationEnum);
+-	iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum);
+-
+-	/*Recover element type*/
+-	if ((analysis_type==PrognosticAnalysisEnum && progstabilization==3) || (analysis_type==BalancethicknessAnalysisEnum && balancestabilization==3)){
+-		/*P1 Discontinuous Galerkin*/
+-		tria_type=P1DGEnum;
+-	}
+-	else{
+-		/*P1 Continuous Galerkin*/
+-		tria_type=P1Enum;
+-	}
+-	this->SetElementType(tria_type,analysis_counter);
+-
+-	/*Recover vertices ids needed to initialize inputs*/
+-	for(i=0;i<3;i++){ 
+-		tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab
+-	}
+-
+-	/*Recover nodes ids needed to initialize the node hook.*/
+-	if (tria_type==P1DGEnum){
+-		/*Discontinuous Galerkin*/
+-		tria_node_ids[0]=iomodel->nodecounter+3*index+1;
+-		tria_node_ids[1]=iomodel->nodecounter+3*index+2;
+-		tria_node_ids[2]=iomodel->nodecounter+3*index+3;
+-	}
+-	else{
+-		/*Continuous Galerkin*/
+-		for(i=0;i<3;i++){ 
+-			tria_node_ids[i]=iomodel->nodecounter+reCast<int,IssmDouble>(*(iomodel->Data(MeshElementsEnum)+3*index+i)); //ids for vertices are in the elements array from Matlab
+-		}
+-	}
+-
+-	/*hooks: */
+-	this->SetHookNodes(tria_node_ids,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type
+-
+-	/*Fill with IoModel*/
+-	this->InputUpdateFromIoModel(index,iomodel);
+-
+-	/*Defaults if not provided in iomodel*/
+-	switch(analysis_type){
+-
+-		case DiagnosticHorizAnalysisEnum:
+-
+-			/*default vx,vy and vz: either observation or 0 */
+-			if(!iomodel->Data(VxEnum)){
+-				for(i=0;i<3;i++)nodeinputs[i]=0;
+-				this->inputs->AddInput(new TriaP1Input(VxEnum,nodeinputs));
+-				if(dakota_analysis) this->inputs->AddInput(new TriaP1Input(QmuVxEnum,nodeinputs));
+-			}
+-			if(!iomodel->Data(VyEnum)){
+-				for(i=0;i<3;i++)nodeinputs[i]=0;
+-				this->inputs->AddInput(new TriaP1Input(VyEnum,nodeinputs));
+-				if(dakota_analysis) this->inputs->AddInput(new TriaP1Input(QmuVyEnum,nodeinputs));
+-			}
+-			if(!iomodel->Data(VzEnum)){
+-				for(i=0;i<3;i++)nodeinputs[i]=0;
+-				this->inputs->AddInput(new TriaP1Input(VzEnum,nodeinputs));
+-				if(dakota_analysis) this->inputs->AddInput(new TriaP1Input(QmuVzEnum,nodeinputs));
+-			}
+-			if(!iomodel->Data(PressureEnum)){
+-				for(i=0;i<3;i++)nodeinputs[i]=0;
+-				if(dakota_analysis){
+-					this->inputs->AddInput(new TriaP1Input(PressureEnum,nodeinputs));
+-					this->inputs->AddInput(new TriaP1Input(QmuPressureEnum,nodeinputs));
+-				}
+-			}
+-			break;
+-
+-		default:
+-			/*No update for other solution types*/
+-			break;
+-
+-	}
+-
+-	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
+-	this->parameters=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::UpdatePotentialSheetUngrounding{{{*/
+-int Tria::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
+-
+-	int i;
+-	int nflipped=0;
+-
+-	/*Go through nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */
+-	for(i=0;i<3;i++){
+-		if (reCast<bool>(vertices_potentially_ungrounding[nodes[i]->Sid()])){
+-			vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
+-		
+-			/*If node was not on ice shelf, we flipped*/
+-			if(nodes_on_iceshelf[nodes[i]->Sid()]==0){
+-				nflipped++;
+-			}
+-		}
+-	}
+-	return nflipped;
+-}
+-/*}}}*/
+-
+-#ifdef _HAVE_RESPONSES_
+-/*FUNCTION Tria::IceVolume {{{*/
+-IssmDouble Tria::IceVolume(void){
+-
+-	/*The volume of a troncated prism is base * 1/3 sum(length of edges)*/
+-	IssmDouble base,surface,bed;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-
+-	if(IsOnWater())return 0;
+-
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*First calculate the area of the base (cross section triangle)
+-	 * http://en.wikipedia.org/wiki/Triangle
+-	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
+-	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
+-
+-	/*Now get the average height*/
+-	Input* surface_input = inputs->GetInput(SurfaceEnum); _assert_(surface_input);
+-	Input* bed_input     = inputs->GetInput(BedEnum);     _assert_(bed_input);
+-	surface_input->GetInputAverage(&surface);
+-	bed_input->GetInputAverage(&bed);
+-
+-	/*Return: */
+-	return base*(surface-bed);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MassFlux {{{*/
+-IssmDouble Tria::MassFlux( IssmDouble* segment,bool process_units){
+-
+-	const int    numdofs=2;
+-
+-	int        i,dim;
+-	IssmDouble     mass_flux=0;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     normal[2];
+-	IssmDouble     length,rho_ice;
+-	IssmDouble     x1,y1,x2,y2,h1,h2;
+-	IssmDouble     vx1,vx2,vy1,vy2;
+-	GaussTria* gauss_1=NULL;
+-	GaussTria* gauss_2=NULL;
+-
+-	/*Get material parameters :*/
+-	rho_ice=matpar->GetRhoIce();
+-
+-	/*First off, check that this segment belongs to this element: */
+-	if ((int)*(segment+4)!=this->id)_error2_("error message: segment with id " << (int)*(segment+4) << " does not belong to element with id:" << this->id);
+-
+-	/*Recover segment node locations: */
+-	x1=*(segment+0); y1=*(segment+1); x2=*(segment+2); y2=*(segment+3);
+-
+-	/*Get xyz list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*get area coordinates of 0 and 1 locations: */
+-	gauss_1=new GaussTria();
+-	gauss_1->GaussFromCoords(x1,y1,&xyz_list[0][0]);
+-	gauss_2=new GaussTria();
+-	gauss_2->GaussFromCoords(x2,y2,&xyz_list[0][0]);
+-
+-	normal[0]=cos(atan2(x1-x2,y2-y1));
+-	normal[1]=sin(atan2(x1-x2,y2-y1));
+-
+-	length=sqrt(pow(x2-x1,2.0)+pow(y2-y1,2));
+-
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+-	this->parameters->FindParam(&dim,MeshDimensionEnum);
+-	Input* vx_input=NULL;
+-	Input* vy_input=NULL;
+-	if(dim==2){
+-		vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+-		vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+-	}
+-	else{
+-		vx_input=inputs->GetInput(VxAverageEnum); _assert_(vx_input);
+-		vy_input=inputs->GetInput(VyAverageEnum); _assert_(vy_input);
+-	}
+-
+-	thickness_input->GetInputValue(&h1, gauss_1);
+-	thickness_input->GetInputValue(&h2, gauss_2);
+-	vx_input->GetInputValue(&vx1,gauss_1);
+-	vx_input->GetInputValue(&vx2,gauss_2);
+-	vy_input->GetInputValue(&vy1,gauss_1);
+-	vy_input->GetInputValue(&vy2,gauss_2);
+-
+-	mass_flux= rho_ice*length*(  
+-				(ONETHIRD*(h1-h2)*(vx1-vx2)+0.5*h2*(vx1-vx2)+0.5*(h1-h2)*vx2+h2*vx2)*normal[0]+
+-				(ONETHIRD*(h1-h2)*(vy1-vy2)+0.5*h2*(vy1-vy2)+0.5*(h1-h2)*vy2+h2*vy2)*normal[1]
+-				);
+-
+-	/*Process units: */
+-	mass_flux=UnitConversion(mass_flux,IuToExtEnum,MassFluxEnum);
+-
+-	/*clean up and return:*/
+-	delete gauss_1;
+-	delete gauss_2;
+-	return mass_flux;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MaxAbsVx{{{*/
+-void  Tria::MaxAbsVx(IssmDouble* pmaxabsvx, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvx=this->inputs->MaxAbs(VxEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxabsvx=UnitConversion(maxabsvx,IuToExtEnum,VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvx=maxabsvx;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MaxAbsVy{{{*/
+-void  Tria::MaxAbsVy(IssmDouble* pmaxabsvy, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvy=this->inputs->MaxAbs(VyEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxabsvy=UnitConversion(maxabsvy,IuToExtEnum,VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvy=maxabsvy;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MaxAbsVz{{{*/
+-void  Tria::MaxAbsVz(IssmDouble* pmaxabsvz, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvz=this->inputs->MaxAbs(VzEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxabsvz=UnitConversion(maxabsvz,IuToExtEnum,VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvz=maxabsvz;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MaxVel{{{*/
+-void  Tria::MaxVel(IssmDouble* pmaxvel, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvel=this->inputs->Max(VelEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxvel=UnitConversion(maxvel,IuToExtEnum,VelEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvel=maxvel;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MaxVx{{{*/
+-void  Tria::MaxVx(IssmDouble* pmaxvx, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvx=this->inputs->Max(VxEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxvx=UnitConversion(maxvx,IuToExtEnum,VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvx=maxvx;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MaxVy{{{*/
+-void  Tria::MaxVy(IssmDouble* pmaxvy, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvy=this->inputs->Max(VyEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxvy=UnitConversion(maxvy,IuToExtEnum,VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvy=maxvy;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MaxVz{{{*/
+-void  Tria::MaxVz(IssmDouble* pmaxvz, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvz=this->inputs->Max(VzEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxvz=UnitConversion(maxvz,IuToExtEnum,VzEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvz=maxvz;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MinVel{{{*/
+-void  Tria::MinVel(IssmDouble* pminvel, bool process_units){
+-
+-	/*Get minimum:*/
+-	IssmDouble minvel=this->inputs->Min(VelEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) minvel=UnitConversion(minvel,IuToExtEnum,VelEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvel=minvel;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MinVx{{{*/
+-void  Tria::MinVx(IssmDouble* pminvx, bool process_units){
+-
+-	/*Get minimum:*/
+-	IssmDouble minvx=this->inputs->Min(VxEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) minvx=UnitConversion(minvx,IuToExtEnum,VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvx=minvx;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MinVy{{{*/
+-void  Tria::MinVy(IssmDouble* pminvy, bool process_units){
+-
+-	/*Get minimum:*/
+-	IssmDouble minvy=this->inputs->Min(VyEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) minvy=UnitConversion(minvy,IuToExtEnum,VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvy=minvy;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::MinVz{{{*/
+-void  Tria::MinVz(IssmDouble* pminvz, bool process_units){
+-
+-	/*Get minimum:*/
+-	IssmDouble minvz=this->inputs->Min(VzEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) minvz=UnitConversion(minvz,IuToExtEnum,VzEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvz=minvz;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::ElementResponse{{{*/
+-void Tria::ElementResponse(IssmDouble* presponse,int response_enum,bool process_units){
+-
+-	switch(response_enum){
+-		case MaterialsRheologyBbarEnum:
+-			*presponse=this->matice->GetBbar();
+-			break;
+-		case VelEnum:
+-
+-			/*Get input:*/
+-			IssmDouble vel;
+-			Input* vel_input;
+-
+-			vel_input=this->inputs->GetInput(VelEnum); _assert_(vel_input);
+-			vel_input->GetInputAverage(&vel);
+-
+-			/*process units if requested: */
+-			if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum);
+-
+-			/*Assign output pointers:*/
+-			*presponse=vel;
+-		default:  
+-			_error2_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::TotalSmb {{{*/
+-IssmDouble Tria::TotalSmb(void){
+-
+-	/*The smb[kg yr-1] of one element is area[m2] * smb [kg m^-2 yr^-1]*/
+-	IssmDouble base,smb,rho_ice;
+-	IssmDouble Total_Smb=0;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-
+-	/*Get material parameters :*/
+-	rho_ice=matpar->GetRhoIce();
+-
+-   if(IsOnWater())return 0;
+-
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*First calculate the area of the base (cross section triangle)
+-	 * http://en.wikipedia.org/wiki/Triangle
+-	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
+-	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));	// area of element in m2
+-
+-	/*Now get the average SMB over the element*/
+-	Input* smb_input = inputs->GetInput(SurfaceforcingsMassBalanceEnum); _assert_(smb_input);
+-	smb_input->GetInputAverage(&smb);																								// average smb on element in m ice s-1
+-   Total_Smb=rho_ice*base*smb;																											// smb on element in kg s-1
+-	
+-	/*Process units: */
+-	Total_Smb=UnitConversion(Total_Smb,IuToExtEnum,TotalSmbEnum);																// smb on element in GigaTon yr-1
+-	
+-	/*Return: */
+-	return Total_Smb;
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_DIAGNOSTIC_
+-/*FUNCTION Tria::CreateKMatrixDiagnosticMacAyeal {{{*/
+-ElementMatrix* Tria::CreateKMatrixDiagnosticMacAyeal(void){
+-
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixDiagnosticMacAyealViscous();
+-	ElementMatrix* Ke2=CreateKMatrixDiagnosticMacAyealFriction();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
+-	
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixDiagnosticMacAyealViscous{{{*/
+-ElementMatrix* Tria::CreateKMatrixDiagnosticMacAyealViscous(void){
+-
+-	/*Constants*/
+-	const int  numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries*/
+-	int        i,j,ig;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     viscosity,newviscosity,oldviscosity;
+-	IssmDouble     viscosity_overshoot,thickness,Jdet;
+-	IssmDouble     epsilon[3],oldepsilon[3];    /* epsilon=[exx,eyy,exy];    */
+-	IssmDouble     B[3][numdof];
+-	IssmDouble     Bprime[3][numdof];
+-	IssmDouble     D[3][3]   = {0.0};
+-	IssmDouble     D_scalar;
+-	GaussTria *gauss = NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	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* vxold_input=inputs->GetInput(VxPicardEnum);      _assert_(vxold_input);
+-	Input* vyold_input=inputs->GetInput(VyPicardEnum);      _assert_(vyold_input);
+-	this->parameters->FindParam(&viscosity_overshoot,DiagnosticViscosityOvershootEnum);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		GetBMacAyeal(&B[0][0], &xyz_list[0][0], gauss);
+-		GetBprimeMacAyeal(&Bprime[0][0], &xyz_list[0][0], gauss);
+-
+-		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		this->GetStrainRate2d(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
+-		matice->GetViscosity2d(&viscosity, &epsilon[0]);
+-		matice->GetViscosity2d(&oldviscosity, &oldepsilon[0]);
+-		thickness_input->GetInputValue(&thickness, gauss);
+-
+-		newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
+-		D_scalar=2*newviscosity*thickness*gauss->weight*Jdet;
+-		for (i=0;i<3;i++) D[i][i]=D_scalar;
+-
+-		TripleMultiply(&B[0][0],3,numdof,1,
+-					&D[0][0],3,3,0,
+-					&Bprime[0][0],3,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixDiagnosticMacAyealFriction {{{*/
+-ElementMatrix* Tria::CreateKMatrixDiagnosticMacAyealFriction(void){
+-
+-	/*Constants*/
+-	const int  numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries*/
+-	int        i,j,ig;
+-	int        analysis_type;
+-	IssmDouble     MAXSLOPE  = .06; // 6 %
+-	IssmDouble     MOUNTAINKEXPONENT = 10;
+-	IssmDouble     slope_magnitude,alpha2;
+-	IssmDouble     Jdet;
+-	IssmDouble     L[2][numdof];
+-	IssmDouble     DL[2][2]  = {{ 0,0 },{0,0}};
+-	IssmDouble     DL_scalar;
+-	IssmDouble     slope[2]  = {0.0,0.0};
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	Friction  *friction = NULL;
+-	GaussTria *gauss    = NULL;
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	if(IsFloating()) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_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);
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*build friction object, used later on: */
+-	friction=new Friction("2d",inputs,matpar,analysis_type);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		// If we have a slope > 6% for this element,  it means  we are on a mountain. In this particular case, 
+-		//velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */
+-		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
+-		slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2));
+-		if(slope_magnitude>MAXSLOPE) alpha2=pow((IssmDouble)10,MOUNTAINKEXPONENT);
+-		else friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum);
+-
+-		GetL(&L[0][0], &xyz_list[0][0], gauss,NDOF2);
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		DL_scalar=alpha2*gauss->weight*Jdet;
+-		for (i=0;i<2;i++) DL[i][i]=DL_scalar;
+-		
+-		TripleMultiply( &L[0][0],2,numdof,1,
+-					&DL[0][0],2,2,0,
+-					&L[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixDiagnosticHutter{{{*/
+-ElementMatrix* Tria::CreateKMatrixDiagnosticHutter(void){
+-
+-	/*Intermediaries*/
+-	const int numdof=NUMVERTICES*NDOF2;
+-	int    i,connectivity;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Create Element matrix*/
+-	for(i=0;i<NUMVERTICES;i++){
+-		connectivity=nodes[i]->GetConnectivity();
+-		Ke->values[(2*i)*numdof  +(2*i)  ]=1/(IssmDouble)connectivity;
+-		Ke->values[(2*i+1)*numdof+(2*i+1)]=1/(IssmDouble)connectivity;
+-	}
+-
+-	/*Clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorDiagnosticMacAyeal {{{*/
+-ElementVector* Tria::CreatePVectorDiagnosticMacAyeal(){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int            i,j,ig;
+-	IssmDouble         driving_stress_baseline,thickness;
+-	IssmDouble         Jdet;
+-	IssmDouble         xyz_list[NUMVERTICES][3];
+-	IssmDouble         slope[2];
+-	IssmDouble         basis[3];
+-	IssmDouble         pe_g_gaussian[numdof];
+-	GaussTria*     gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input); 
+-	Input* surface_input=inputs->GetInput(SurfaceEnum);     _assert_(surface_input);
+-	Input* drag_input=inputs->GetInput(FrictionCoefficientEnum);_assert_(drag_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis, gauss);
+-
+-		thickness_input->GetInputValue(&thickness,gauss);
+-		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
+-		driving_stress_baseline=matpar->GetRhoIce()*matpar->GetG()*thickness;
+-
+-		/*Build pe_g_gaussian vector: */
+-		for (i=0;i<NUMVERTICES;i++){
+-			for (j=0;j<NDOF2;j++){
+-				pe->values[i*NDOF2+j]+=-driving_stress_baseline*slope[j]*Jdet*gauss->weight*basis[i];
+-			}
+-		}
+-	}
+-
+-	/*Transform coordinate system*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorDiagnosticHutter{{{*/
+-ElementVector* Tria::CreatePVectorDiagnosticHutter(void){
+-
+-	/*Intermediaries */
+-	int        i,connectivity;
+-	IssmDouble     constant_part,ub,vb;
+-	IssmDouble     rho_ice,gravity,n,B;
+-	IssmDouble     slope2,thickness;
+-	IssmDouble     slope[2];
+-	GaussTria* gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	rho_ice=matpar->GetRhoIce();
+-	gravity=matpar->GetG();
+-	n=matice->GetN();
+-	B=matice->GetBbar();
+-	Input* slopex_input=inputs->GetInput(SurfaceSlopeXEnum); _assert_(slopex_input);
+-	Input* slopey_input=inputs->GetInput(SurfaceSlopeYEnum); _assert_(slopey_input);
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum);  _assert_(thickness_input);
+-
+-	/*Spawn 3 sing elements: */
+-	gauss=new GaussTria();
+-	for(i=0;i<NUMVERTICES;i++){
+-
+-		gauss->GaussVertex(i);
+-
+-		connectivity=nodes[i]->GetConnectivity();
+-
+-		thickness_input->GetInputValue(&thickness,gauss);
+-		slopex_input->GetInputValue(&slope[0],gauss);
+-		slopey_input->GetInputValue(&slope[1],gauss);
+-		slope2=pow(slope[0],2)+pow(slope[1],2);
+-
+-		constant_part=-2*pow(rho_ice*gravity,n)*pow(slope2,((n-1)/2));
+-
+-		ub=-1.58*pow((IssmDouble)10.0,(IssmDouble)-10.0)*rho_ice*gravity*thickness*slope[0];
+-		vb=-1.58*pow((IssmDouble)10.0,(IssmDouble)-10.0)*rho_ice*gravity*thickness*slope[1];
+-
+-		pe->values[2*i]  =(ub-2.0*pow(rho_ice*gravity,n)*pow(slope2,((n-1)/2.0))*pow(thickness,n)/(pow(B,n)*(n+1))*slope[0])/(IssmDouble)connectivity;
+-		pe->values[2*i+1]=(vb-2.0*pow(rho_ice*gravity,n)*pow(slope2,((n-1)/2.0))*pow(thickness,n)/(pow(B,n)*(n+1))*slope[1])/(IssmDouble)connectivity;
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateJacobianDiagnosticMacayeal{{{*/
+-ElementMatrix* Tria::CreateJacobianDiagnosticMacayeal(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     Jdet,thickness;
+-	IssmDouble     eps1dotdphii,eps1dotdphij;
+-	IssmDouble     eps2dotdphii,eps2dotdphij;
+-	IssmDouble     mu_prime;
+-	IssmDouble     epsilon[3];/* epsilon=[exx,eyy,exy];*/
+-	IssmDouble     eps1[2],eps2[2];
+-	IssmDouble     phi[NUMVERTICES];
+-	IssmDouble     dphi[2][NUMVERTICES];
+-	GaussTria *gauss=NULL;
+-
+-	/*Initialize Jacobian with regular MacAyeal (first part of the Gateau derivative)*/
+-	ElementMatrix* Ke=CreateKMatrixDiagnosticMacAyeal();
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsDerivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+-
+-		thickness_input->GetInputValue(&thickness, gauss);
+-		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosity2dDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+-		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+-		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+-
+-		for(i=0;i<3;i++){
+-			for(j=0;j<3;j++){
+-				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i];
+-				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j];
+-				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i];
+-				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j];
+-
+-				Ke->values[6*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps1dotdphii;
+-				Ke->values[6*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps1dotdphii;
+-				Ke->values[6*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps2dotdphii;
+-				Ke->values[6*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps2dotdphii;
+-			}
+-		}
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetSolutionFromInputsDiagnosticHoriz{{{*/
+-void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){
+-
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	int          i;
+-	int*         doflist=NULL;
+-	IssmDouble       vx,vy;
+-	IssmDouble       values[numdof];
+-	GaussTria*   gauss=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Get inputs*/
+-	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	/*P1 element only for now*/
+-	gauss=new GaussTria();
+-	for(i=0;i<NUMVERTICES;i++){
+-
+-		gauss->GaussVertex(i);
+-
+-		/*Recover vx and vy*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		values[i*NDOF2+0]=vx;
+-		values[i*NDOF2+1]=vy;
+-	}
+-
+-	solution->SetValues(numdof,doflist,values,INS_VAL);
+-
+-	/*Free ressources:*/
+-	delete gauss;
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetSolutionFromInputsDiagnosticHutter{{{*/
+-void  Tria::GetSolutionFromInputsDiagnosticHutter(Vector* solution){
+-
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	int        i;
+-	IssmDouble     vx,vy;
+-	IssmDouble     values[numdof];
+-	int       *doflist = NULL;
+-	GaussTria *gauss   = NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Get inputs*/
+-	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	/*P1 element only for now*/
+-	gauss=new GaussTria();
+-	for(i=0;i<NUMVERTICES;i++){
+-
+-		gauss->GaussVertex(i);
+-
+-		/*Recover vx and vy*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		values[i*NDOF2+0]=vx;
+-		values[i*NDOF2+1]=vy;
+-	}
+-
+-	solution->SetValues(numdof,doflist,values,INS_VAL);
+-
+-	/*Free ressources:*/
+-	delete gauss;
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromSolutionDiagnosticHoriz {{{*/
+-void  Tria::InputUpdateFromSolutionDiagnosticHoriz(IssmDouble* solution){
+-	
+-	const int numdof=NDOF2*NUMVERTICES;
+-
+-	int       i;
+-	int*      doflist=NULL;
+-	IssmDouble    rho_ice,g;
+-	IssmDouble    values[numdof];
+-	IssmDouble    vx[NUMVERTICES];
+-	IssmDouble    vy[NUMVERTICES];
+-	IssmDouble    vz[NUMVERTICES];
+-	IssmDouble    vel[NUMVERTICES];
+-	IssmDouble    pressure[NUMVERTICES];
+-	IssmDouble    thickness[NUMVERTICES];
+-	
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
+-	/*Transform solution in Cartesian Space*/
+-	TransformSolutionCoord(&values[0],nodes,NUMVERTICES,XYEnum);
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		vx[i]=values[i*NDOF2+0];
+-		vy[i]=values[i*NDOF2+1];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Get Vz and compute vel*/
+-	GetInputListOnVertices(&vz[0],VzEnum,0);
+-	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+-
+-	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D, 
+-	 *so the pressure is just the pressure at the bedrock: */
+-	rho_ice=matpar->GetRhoIce();
+-	g=matpar->GetG();
+-	GetInputListOnVertices(&thickness[0],ThicknessEnum);
+-	for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*thickness[i];
+-
+-	/*Now, we have to move the previous Vx and Vy inputs  to old 
+-	 * status, otherwise, we'll wipe them off: */
+-	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
+-	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
+-	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new TriaP1Input(VxEnum,vx));
+-	this->inputs->AddInput(new TriaP1Input(VyEnum,vy));
+-	this->inputs->AddInput(new TriaP1Input(VelEnum,vel));
+-	this->inputs->AddInput(new TriaP1Input(PressureEnum,pressure));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromSolutionDiagnosticHutter {{{*/
+-void  Tria::InputUpdateFromSolutionDiagnosticHutter(IssmDouble* solution){
+-	
+-	const int numdof=NDOF2*NUMVERTICES;
+-	
+-	int       i;
+-	int*      doflist=NULL;
+-	IssmDouble    rho_ice,g;
+-	IssmDouble    values[numdof];
+-	IssmDouble    vx[NUMVERTICES];
+-	IssmDouble    vy[NUMVERTICES];
+-	IssmDouble    vz[NUMVERTICES];
+-	IssmDouble    vel[NUMVERTICES];
+-	IssmDouble    pressure[NUMVERTICES];
+-	IssmDouble    thickness[NUMVERTICES];
+-	
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		vx[i]=values[i*NDOF2+0];
+-		vy[i]=values[i*NDOF2+1];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Now Compute vel*/
+-	GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0
+-	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+-
+-	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D, 
+-	 *so the pressure is just the pressure at the bedrock: */
+-	rho_ice=matpar->GetRhoIce();
+-	g=matpar->GetG();
+-	GetInputListOnVertices(&thickness[0],ThicknessEnum);
+-	for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*thickness[i];
+-
+-	/*Now, we have to move the previous Vx and Vy inputs  to old 
+-	 * status, otherwise, we'll wipe them off: */
+-	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
+-	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
+-	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new TriaP1Input(VxEnum,vx));
+-	this->inputs->AddInput(new TriaP1Input(VyEnum,vy));
+-	this->inputs->AddInput(new TriaP1Input(VelEnum,vel));
+-	this->inputs->AddInput(new TriaP1Input(PressureEnum,pressure));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_CONTROL_
+-/*FUNCTION Tria::InputControlUpdate{{{*/
+-void  Tria::InputControlUpdate(IssmDouble scalar,bool save_parameter){
+-
+-	/*Intermediary*/
+-	int    num_controls;
+-	int*   control_type=NULL;
+-	Input* input=NULL;
+-
+-	/*retrieve some parameters: */
+-	this->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+-	this->parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+-
+-	for(int i=0;i<num_controls;i++){
+-
+-		if(control_type[i]==MaterialsRheologyBbarEnum){
+-			input=(Input*)matice->inputs->GetInput(control_type[i]); _assert_(input);
+-		}
+-		else{
+-			input=(Input*)this->inputs->GetInput(control_type[i]);   _assert_(input);
+-		}
+-
+-		if (input->ObjectEnum()!=ControlInputEnum){
+-			_error2_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");
+-		}
+-
+-		((ControlInput*)input)->UpdateValue(scalar);
+-		((ControlInput*)input)->Constrain();
+-		if (save_parameter) ((ControlInput*)input)->SaveValue();
+-
+-	}
+-
+-	/*Clean up and return*/
+-	xDelete<int>(control_type);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::ControlInputGetGradient{{{*/
+-void Tria::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){
+-
+-	int doflist1[NUMVERTICES];
+-	Input* input=NULL;
+-
+-	if(enum_type==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(enum_type);
+-	}
+-	else{
+-		input=inputs->GetInput(enum_type);
+-	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+-
+-	GradientIndexing(&doflist1[0],control_index);
+-	((ControlInput*)input)->GetGradient(gradient,&doflist1[0]);
+-
+-}/*}}}*/
+-/*FUNCTION Tria::ControlInputScaleGradient{{{*/
+-void Tria::ControlInputScaleGradient(int enum_type,IssmDouble scale){
+-
+-	Input* input=NULL;
+-
+-	if(enum_type==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(enum_type);
+-	}
+-	else{
+-		input=inputs->GetInput(enum_type);
+-	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+-
+-	((ControlInput*)input)->ScaleGradient(scale);
+-}/*}}}*/
+-/*FUNCTION Tria::ControlInputSetGradient{{{*/
+-void Tria::ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){
+-
+-	int    doflist1[NUMVERTICES];
+-	IssmDouble grad_list[NUMVERTICES];
+-	Input* grad_input=NULL;
+-	Input* input=NULL;
+-
+-	if(enum_type==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(enum_type);
+-	}
+-	else{
+-		input=inputs->GetInput(enum_type);
+-	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+-
+-	GradientIndexing(&doflist1[0],control_index);
+-	for(int i=0;i<NUMVERTICES;i++) grad_list[i]=gradient[doflist1[i]];
+-	grad_input=new TriaP1Input(GradientEnum,grad_list);
+-
+-	((ControlInput*)input)->SetGradient(grad_input);
+-
+-}/*}}}*/
+-/*FUNCTION Tria::Gradj {{{*/
+-void  Tria::Gradj(Vector* gradient,int control_type,int control_index){
+-	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
+-
+-	/*If on water, grad = 0: */
+-	if(IsOnWater()) return;
+-
+-	/*First deal with ∂/∂alpha(KU-F)*/
+-	switch(control_type){
+-		case FrictionCoefficientEnum:
+-			GradjDragMacAyeal(gradient,control_index);
+-			break;
+-		case MaterialsRheologyBbarEnum:
+-			GradjBMacAyeal(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;
+-		default:
+-			_error2_("control type not supported yet: " << 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,NULL,StepResponsesEnum);
+-
+-	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 SurfaceAbsVelMisfitEnum:
+-		case SurfaceRelVelMisfitEnum:
+-		case SurfaceLogVelMisfitEnum:
+-		case SurfaceLogVxVyMisfitEnum:
+-		case SurfaceAverageVelMisfitEnum:
+-			/*Nothing, J does not depends on the parameter being inverted for*/
+-			break;
+-		case DragCoefficientAbsGradientEnum:
+-			GradjDragGradient(gradient,resp,control_index);
+-			break;
+-		case RheologyBbarAbsGradientEnum:
+-			GradjBGradient(gradient,resp,control_index);
+-			break;
+-		default:
+-			_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+-	}
+-
+-	xDelete<int>(responses);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GradjBGradient{{{*/
+-void  Tria::GradjBGradient(Vector* gradient,int weight_index,int control_index){
+-
+-	int        i,ig;
+-	int        doflist1[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], nodes, NUMVERTICES);
+-	GradientIndexing(&doflist1[0],control_index);
+-	Input* rheologyb_input=matice->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 (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsDerivatives(&dbasis[0][0],&xyz_list[0][0],gauss);
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-
+-		/*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,doflist1,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GradjBMacAyeal{{{*/
+-void  Tria::GradjBMacAyeal(Vector* gradient,int control_index){
+-
+-	/*Intermediaries*/
+-	int        i,ig;
+-	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], nodes, 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=matice->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(4);
+-	for (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->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityComplement(&viscosity_complement,&epsilon[0]);
+-
+-		GetJacobianDeterminant2d(&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;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GradjDragMacAyeal {{{*/
+-void  Tria::GradjDragMacAyeal(Vector* gradient,int control_index){
+-
+-	int        i,ig;
+-	int        analysis_type;
+-	int        doflist1[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];
+-	IssmDouble     epsilon[3]; /* epsilon=[exx,eyy,exy];*/
+-	Friction*  friction=NULL;
+-	GaussTria  *gauss=NULL;
+-
+-	if(IsFloating())return;
+-
+-	/*retrive parameters: */
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	GradientIndexing(&doflist1[0],control_index);
+-	this->GetConnectivityList(&connectivity[0]);
+-
+-	/*Build frictoin element, needed later: */
+-	friction=new Friction("2d",inputs,matpar,analysis_type);
+-
+-	/*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 (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis, gauss);
+-
+-		/*Build alpha_complement_list: */
+-		friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum,VzEnum);
+-	
+-		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,VxEnum,VyEnum,VzEnum);
+-	//	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,doflist1,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GradjDragGradient{{{*/
+-void  Tria::GradjDragGradient(Vector* gradient, int weight_index,int control_index){
+-
+-	int        i,ig;
+-	int        doflist1[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], nodes, NUMVERTICES);
+-	GradientIndexing(&doflist1[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 (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsDerivatives(&dbasis[0][0],&xyz_list[0][0],gauss);
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-
+-		/*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,doflist1,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GradjDhDtBalancedthickness{{{*/
+-void  Tria::GradjDhDtBalancedthickness(Vector* gradient,int control_index){
+-
+-	/*Intermediaries*/
+-	int    doflist1[NUMVERTICES];
+-	IssmDouble lambda[NUMVERTICES];
+-	IssmDouble gradient_g[NUMVERTICES];
+-
+-	/*Compute Gradient*/
+-	GradientIndexing(&doflist1[0],control_index);
+-	GetInputListOnVertices(&lambda[0],AdjointEnum);
+-	for(int i=0;i<NUMVERTICES;i++) gradient_g[i]=-lambda[i];
+-
+-	gradient->SetValues(NUMVERTICES,doflist1,gradient_g,INS_VAL);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GradjVxBalancedthickness{{{*/
+-void  Tria::GradjVxBalancedthickness(Vector* gradient,int control_index){
+-
+-	/*Intermediaries*/
+-	int        i,ig;
+-	int        doflist1[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], nodes, NUMVERTICES);
+-	GradientIndexing(&doflist1[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 (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&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,doflist1,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GradjVyBalancedthickness{{{*/
+-void  Tria::GradjVyBalancedthickness(Vector* gradient,int control_index){
+-
+-	/*Intermediaries*/
+-	int        i,ig;
+-	int        doflist1[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], nodes, NUMVERTICES);
+-	GradientIndexing(&doflist1[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 (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&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,doflist1,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GradientIndexing{{{*/
+-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->nodes[i]->GetVertexDof() + control_index;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::RheologyBbarAbsGradient{{{*/
+-IssmDouble Tria::RheologyBbarAbsGradient(bool process_units,int weight_index){
+-
+-	/* Intermediaries */
+-	int        ig;
+-	IssmDouble     Jelem = 0;
+-	IssmDouble     weight;
+-	IssmDouble     Jdet;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     dp[NDOF2];
+-	GaussTria *gauss = NULL;
+-
+-	/*retrieve parameters and inputs*/
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater()) return 0;
+-
+-	/*Retrieve all inputs we will be needing: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* weights_input  =inputs->GetInput(InversionCostFunctionsCoefficientsEnum);              _assert_(weights_input);
+-	Input* rheologyb_input=matice->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
+-
+-	/* Start looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get all parameters at gaussian point*/
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-		rheologyb_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
+-
+-		/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
+-		Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Jelem;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SurfaceAverageVelMisfit {{{*/
+-IssmDouble Tria::SurfaceAverageVelMisfit(bool process_units,int weight_index){
+-
+-	const int    numdof=2*NUMVERTICES;
+-
+-	int        i,ig;
+-	IssmDouble     Jelem=0,S,Jdet;
+-	IssmDouble     misfit;
+-	IssmDouble     vx,vy,vxobs,vyobs,weight;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	GaussTria *gauss=NULL;
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	inputs->GetInputValue(&S,SurfaceAreaEnum);
+-	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
+-	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(3);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get all parameters at gaussian point*/
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		vxobs_input->GetInputValue(&vxobs,gauss);
+-		vyobs_input->GetInputValue(&vyobs,gauss);
+-
+-		/*Compute SurfaceAverageVelMisfitEnum:
+-		 *
+-		 *      1                    2              2
+-		 * J = ---  sqrt(  (u - u   )  +  (v - v   )  )
+-		 *      S                obs            obs
+-		 */
+-		misfit=1/S*pow( pow(vx-vxobs,2.) + pow(vy-vyobs,2.) ,0.5);
+-
+-		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceAverageVelMisfitEnum);
+-
+-		/*Add to cost function*/
+-		Jelem+=misfit*weight*Jdet*gauss->weight;
+-	}
+-
+-	/*clean-up and Return: */
+-	delete gauss;
+-	return Jelem;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SurfaceLogVelMisfit {{{*/
+-IssmDouble Tria::SurfaceLogVelMisfit(bool process_units,int weight_index){
+-
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	int        i,ig;
+-	IssmDouble     Jelem=0;
+-	IssmDouble     misfit,Jdet;
+-	IssmDouble     epsvel=2.220446049250313e-16;
+-	IssmDouble     meanvel=3.170979198376458e-05; /*1000 m/yr*/
+-	IssmDouble     velocity_mag,obs_velocity_mag;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     vx,vy,vxobs,vyobs,weight;
+-	GaussTria *gauss=NULL;
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
+-	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(4);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get all parameters at gaussian point*/
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		vxobs_input->GetInputValue(&vxobs,gauss);
+-		vyobs_input->GetInputValue(&vyobs,gauss);
+-
+-		/*Compute SurfaceLogVelMisfit:
+-		 *                 [        vel + eps     ] 2
+-		 * J = 4 \bar{v}^2 | log ( -----------  ) |  
+-		 *                 [       vel   + eps    ]
+-		 *                            obs
+-		 */
+-		velocity_mag    =sqrt(pow(vx,   2.)+pow(vy,   2.))+epsvel;
+-		obs_velocity_mag=sqrt(pow(vxobs,2.)+pow(vyobs,2.))+epsvel;
+-		misfit=4*pow(meanvel,2.)*pow(log(velocity_mag/obs_velocity_mag),2.);
+-
+-		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceLogVelMisfitEnum);
+-
+-		/*Add to cost function*/
+-		Jelem+=misfit*weight*Jdet*gauss->weight;
+-	}
+-
+-	/*clean-up and Return: */
+-	delete gauss;
+-	return Jelem;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SurfaceLogVxVyMisfit {{{*/
+-IssmDouble Tria::SurfaceLogVxVyMisfit(bool process_units,int weight_index){
+-
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	int        i,ig;
+-	int        fit=-1;
+-	IssmDouble     Jelem=0, S=0;
+-	IssmDouble     epsvel=2.220446049250313e-16;
+-	IssmDouble     meanvel=3.170979198376458e-05; /*1000 m/yr*/
+-	IssmDouble     misfit, Jdet;
+-	IssmDouble     vx,vy,vxobs,vyobs,weight;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	GaussTria *gauss=NULL;
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
+-	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
+-	
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(4);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get all parameters at gaussian point*/
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		vxobs_input->GetInputValue(&vxobs,gauss);
+-		vyobs_input->GetInputValue(&vyobs,gauss);
+-
+-		/*Compute SurfaceRelVelMisfit:
+-		 *
+-		 *      1            [        |u| + eps     2          |v| + eps     2  ]
+-		 * J = --- \bar{v}^2 | log ( -----------  )   +  log ( -----------  )   |  
+-		 *      2            [       |u    |+ eps              |v    |+ eps     ]
+-		 *                              obs                       obs
+-		 */
+-		misfit=0.5*pow(meanvel,2.)*(
+-					pow(log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)),2.) +
+-					pow(log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)),2.) );
+-
+-		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceLogVxVyMisfitEnum);
+-
+-		/*Add to cost function*/
+-		Jelem+=misfit*weight*Jdet*gauss->weight;
+-	}
+-
+-	/*clean-up and Return: */
+-	delete gauss;
+-	return Jelem;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SurfaceAbsVelMisfit {{{*/
+-IssmDouble Tria::SurfaceAbsVelMisfit(bool process_units,int weight_index){
+-
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	int        i,ig;
+-	IssmDouble     Jelem=0;
+-	IssmDouble     misfit,Jdet;
+-	IssmDouble     vx,vy,vxobs,vyobs,weight;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	GaussTria *gauss=NULL;
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
+-	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get all parameters at gaussian point*/
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		vxobs_input->GetInputValue(&vxobs,gauss);
+-		vyobs_input->GetInputValue(&vyobs,gauss);
+-
+-		/*Compute SurfaceAbsVelMisfitEnum:
+-		 *
+-		 *      1  [           2              2 ]
+-		 * J = --- | (u - u   )  +  (v - v   )  |
+-		 *      2  [       obs            obs   ]
+-		 *
+-		 */
+-		misfit=0.5*( pow(vx-vxobs,2.) + pow(vy-vyobs,2.) );
+-
+-		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceAverageVelMisfitEnum);
+-
+-		/*Add to cost function*/
+-		Jelem+=misfit*weight*Jdet*gauss->weight;
+-	}
+-
+-	/*clean up and Return: */
+-	delete gauss;
+-	return Jelem;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SurfaceRelVelMisfit {{{*/
+-IssmDouble Tria::SurfaceRelVelMisfit(bool process_units,int weight_index){
+-	const int  numdof=2*NUMVERTICES;
+-
+-	int        i,ig;
+-	IssmDouble     Jelem=0;
+-	IssmDouble     scalex=1,scaley=1;
+-	IssmDouble     misfit,Jdet;
+-	IssmDouble     epsvel=2.220446049250313e-16;
+-	IssmDouble     meanvel=3.170979198376458e-05; /*1000 m/yr*/
+-	IssmDouble     vx,vy,vxobs,vyobs,weight;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	GaussTria *gauss=NULL;
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
+-	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(4);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get all parameters at gaussian point*/
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		vxobs_input->GetInputValue(&vxobs,gauss);
+-		vyobs_input->GetInputValue(&vyobs,gauss);
+-
+-		/*Compute SurfaceRelVelMisfit:
+-		 *                        
+-		 *      1  [     \bar{v}^2             2   \bar{v}^2              2 ]
+-		 * J = --- | -------------  (u - u   ) + -------------  (v - v   )  |
+-		 *      2  [  (u   + eps)^2       obs    (v   + eps)^2       obs    ]
+-		 *              obs                        obs                      
+-		 */
+-		scalex=pow(meanvel/(vxobs+epsvel),2.); if(vxobs==0)scalex=0;
+-		scaley=pow(meanvel/(vyobs+epsvel),2.); if(vyobs==0)scaley=0;
+-		misfit=0.5*(scalex*pow((vx-vxobs),2.)+scaley*pow((vy-vyobs),2.));
+-		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceRelVelMisfitEnum);
+-
+-		/*Add to cost function*/
+-		Jelem+=misfit*weight*Jdet*gauss->weight;
+-	}
+-
+-	/*clean up and Return: */
+-	delete gauss;
+-	return Jelem;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::ThicknessAbsGradient{{{*/
+-IssmDouble Tria::ThicknessAbsGradient(bool process_units,int weight_index){
+-
+-	/* Intermediaries */
+-	int        ig;
+-	IssmDouble     Jelem = 0;
+-	IssmDouble     weight;
+-	IssmDouble     Jdet;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     dp[NDOF2];
+-	GaussTria *gauss = NULL;
+-
+-	/*retrieve parameters and inputs*/
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater()) return 0;
+-
+-	/*Retrieve all inputs we will be needing: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* weights_input  =inputs->GetInput(InversionCostFunctionsCoefficientsEnum);   _assert_(weights_input);
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+-
+-	/* Start looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get all parameters at gaussian point*/
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-		thickness_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
+-
+-		/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
+-		Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Jelem;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::ThicknessAbsMisfit {{{*/
+-IssmDouble Tria::ThicknessAbsMisfit(bool process_units,int weight_index){
+-
+-	/*Intermediaries*/
+-	int        i,ig;
+-	IssmDouble     thickness,thicknessobs,weight;
+-	IssmDouble     Jdet;
+-	IssmDouble     Jelem = 0;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	GaussTria *gauss = NULL;
+-	IssmDouble     dH[2];
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/*Retrieve all inputs we will be needing: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	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);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get parameters at gauss point*/
+-		thickness_input->GetInputValue(&thickness,gauss);
+-		thickness_input->GetInputDerivativeValue(&dH[0],&xyz_list[0][0],gauss);
+-		thicknessobs_input->GetInputValue(&thicknessobs,gauss);
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-
+-		/*compute ThicknessAbsMisfit*/
+-		Jelem+=0.5*pow(thickness-thicknessobs,2.0)*weight*Jdet*gauss->weight;
+-	}
+-
+-	/* clean up and Return: */
+-	delete gauss;
+-	return Jelem;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorAdjointBalancethickness{{{*/
+-ElementVector* Tria::CreatePVectorAdjointBalancethickness(void){
+-
+-	/*Constants*/
+-	const int    numdof=1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int         i,ig,resp;
+-	IssmDouble      Jdet;
+-	IssmDouble      thickness,thicknessobs,weight;
+-	int        *responses = NULL;
+-	int         num_responses;
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      basis[3];
+-	IssmDouble      dbasis[NDOF2][NUMVERTICES];
+-	IssmDouble      dH[2];
+-	GaussTria*  gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+-	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
+-	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);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&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++) switch(responses[resp]){
+-
+-			case ThicknessAbsMisfitEnum:
+-				weights_input->GetInputValue(&weight, gauss,resp);
+-				for(i=0;i<numdof;i++) pe->values[i]+=(thicknessobs-thickness)*weight*Jdet*gauss->weight*basis[i];
+-				break;
+-			case ThicknessAbsGradientEnum:
+-				weights_input->GetInputValue(&weight, gauss,resp);
+-				for(i=0;i<numdof;i++) pe->values[i]+= - weight*dH[0]*dbasis[0][i]*Jdet*gauss->weight;
+-				for(i=0;i<numdof;i++) pe->values[i]+= - weight*dH[1]*dbasis[1][i]*Jdet*gauss->weight;
+-				break;
+-			default:
+-				_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	xDelete<int>(responses);
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorAdjointHoriz{{{*/
+-ElementVector* Tria::CreatePVectorAdjointHoriz(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,resp,ig;
+-	int       *responses=NULL;
+-	int        num_responses;
+-	IssmDouble     Jdet;
+-	IssmDouble     obs_velocity_mag,velocity_mag;
+-	IssmDouble     dux,duy;
+-	IssmDouble     epsvel=2.220446049250313e-16;
+-	IssmDouble     meanvel=3.170979198376458e-05; /*1000 m/yr*/
+-	IssmDouble     scalex=0,scaley=0,scale=0,S=0;
+-	IssmDouble     vx,vy,vxobs,vyobs,weight;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     basis[3];
+-	GaussTria* gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+-	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
+-	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
+-	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
+-
+-	/*Get Surface if required by one response*/
+-	for(resp=0;resp<num_responses;resp++){
+-		if(responses[resp]==SurfaceAverageVelMisfitEnum){
+-			inputs->GetInputValue(&S,SurfaceAreaEnum); break;
+-		}
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(4);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get all parameters at gaussian point*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		vxobs_input->GetInputValue(&vxobs,gauss);
+-		vyobs_input->GetInputValue(&vyobs,gauss);
+-		GetNodalFunctions(basis, gauss);
+-
+-		/*Loop over all requested responses*/
+-		for(resp=0;resp<num_responses;resp++){
+-
+-			weights_input->GetInputValue(&weight,gauss,resp);
+-
+-			switch(responses[resp]){
+-				case SurfaceAbsVelMisfitEnum:
+-					/*
+-					 *      1  [           2              2 ]
+-					 * J = --- | (u - u   )  +  (v - v   )  |
+-					 *      2  [       obs            obs   ]
+-					 *
+-					 *        dJ
+-					 * DU = - -- = (u   - u )
+-					 *        du     obs
+-					 */
+-					for (i=0;i<NUMVERTICES;i++){
+-						dux=vxobs-vx;
+-						duy=vyobs-vy;
+-						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+-						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+-					}
+-					break;
+-				case SurfaceRelVelMisfitEnum:
+-					/*
+-					 *      1  [     \bar{v}^2             2   \bar{v}^2              2 ]
+-					 * J = --- | -------------  (u - u   ) + -------------  (v - v   )  |
+-					 *      2  [  (u   + eps)^2       obs    (v   + eps)^2       obs    ]
+-					 *              obs                        obs                      
+-					 *
+-					 *        dJ     \bar{v}^2
+-					 * DU = - -- = ------------- (u   - u )
+-					 *        du   (u   + eps)^2    obs
+-					 *               obs
+-					 */
+-					for (i=0;i<NUMVERTICES;i++){
+-						scalex=pow(meanvel/(vxobs+epsvel),2.); if(vxobs==0)scalex=0;
+-						scaley=pow(meanvel/(vyobs+epsvel),2.); if(vyobs==0)scaley=0;
+-						dux=scalex*(vxobs-vx);
+-						duy=scaley*(vyobs-vy);
+-						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+-						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+-					}
+-					break;
+-				case SurfaceLogVelMisfitEnum:
+-					/*
+-					 *                 [        vel + eps     ] 2
+-					 * J = 4 \bar{v}^2 | log ( -----------  ) |  
+-					 *                 [       vel   + eps    ]
+-					 *                            obs
+-					 *
+-					 *        dJ                 2 * log(...)
+-					 * DU = - -- = - 4 \bar{v}^2 -------------  u
+-					 *        du                 vel^2 + eps
+-					 *            
+-					 */
+-					for (i=0;i<NUMVERTICES;i++){
+-						velocity_mag    =sqrt(pow(vx,   2.)+pow(vy,   2.))+epsvel;
+-						obs_velocity_mag=sqrt(pow(vxobs,2.)+pow(vyobs,2.))+epsvel;
+-						scale=-8*pow(meanvel,2.)/pow(velocity_mag,2.)*log(velocity_mag/obs_velocity_mag);
+-						dux=scale*vx;
+-						duy=scale*vy;
+-						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+-						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+-					}
+-					break;
+-				case SurfaceAverageVelMisfitEnum:
+-					/*
+-					 *      1                    2              2
+-					 * J = ---  sqrt(  (u - u   )  +  (v - v   )  )
+-					 *      S                obs            obs
+-					 *
+-					 *        dJ      1       1 
+-					 * DU = - -- = - --- ----------- * 2 (u - u   )
+-					 *        du      S  2 sqrt(...)           obs
+-					 */
+-					for (i=0;i<NUMVERTICES;i++){
+-						scale=1./(S*2*sqrt(pow(vx-vxobs,2.)+pow(vy-vyobs,2.))+epsvel);
+-						dux=scale*(vxobs-vx);
+-						duy=scale*(vyobs-vy);
+-						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+-						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+-					}
+-					break;
+-				case SurfaceLogVxVyMisfitEnum:
+-					/*
+-					 *      1            [        |u| + eps     2          |v| + eps     2  ]
+-					 * J = --- \bar{v}^2 | log ( -----------  )   +  log ( -----------  )   |  
+-					 *      2            [       |u    |+ eps              |v    |+ eps     ]
+-					 *                              obs                       obs
+-					 *        dJ                              1      u                             1
+-					 * DU = - -- = - \bar{v}^2 log(u...) --------- ----  ~ - \bar{v}^2 log(u...) ------
+-					 *        du                         |u| + eps  |u|                           u + eps
+-					 */
+-					for (i=0;i<NUMVERTICES;i++){
+-						dux = - pow(meanvel,2.) * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);
+-						duy = - pow(meanvel,2.) * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);
+-						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+-						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+-					}
+-					break;
+-				case DragCoefficientAbsGradientEnum:
+-					/*Nothing in P vector*/
+-					break;
+-				case ThicknessAbsGradientEnum:
+-					/*Nothing in P vector*/
+-					break;
+-				case RheologyBbarAbsGradientEnum:
+-					/*Nothing in P vector*/
+-					break;
+-				default:
+-					_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+-			}
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	xDelete<int>(responses);
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorAdjointStokes{{{*/
+-ElementVector* Tria::CreatePVectorAdjointStokes(void){
+-
+-	/*Intermediaries */
+-	int        i,resp,ig;
+-	int       *responses=NULL;
+-	int        num_responses;
+-	IssmDouble     Jdet;
+-	IssmDouble     obs_velocity_mag,velocity_mag;
+-	IssmDouble     dux,duy;
+-	IssmDouble     epsvel=2.220446049250313e-16;
+-	IssmDouble     meanvel=3.170979198376458e-05; /*1000 m/yr*/
+-	IssmDouble     scalex=0,scaley=0,scale=0,S=0;
+-	IssmDouble     vx,vy,vxobs,vyobs,weight;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     basis[3];
+-	GaussTria* gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+-	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
+-	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* vxobs_input   = inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
+-	Input* vyobs_input   = inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
+-
+-	/*Get Surface if required by one response*/
+-	for(resp=0;resp<num_responses;resp++){
+-		if(responses[resp]==SurfaceAverageVelMisfitEnum){
+-			inputs->GetInputValue(&S,SurfaceAreaEnum); break;
+-		}
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(4);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get all parameters at gaussian point*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		vxobs_input->GetInputValue(&vxobs,gauss);
+-		vyobs_input->GetInputValue(&vyobs,gauss);
+-		GetNodalFunctions(basis, gauss);
+-
+-		/*Loop over all requested responses*/
+-		for(resp=0;resp<num_responses;resp++){
+-
+-			weights_input->GetInputValue(&weight,gauss,resp);
+-
+-			switch(responses[resp]){
+-
+-				case SurfaceAbsVelMisfitEnum:
+-					/*
+-					 *      1  [           2              2 ]
+-					 * J = --- | (u - u   )  +  (v - v   )  |
+-					 *      2  [       obs            obs   ]
+-					 *
+-					 *        dJ
+-					 * DU = - -- = (u   - u )
+-					 *        du     obs
+-					 */
+-					for (i=0;i<NUMVERTICES;i++){
+-						dux=vxobs-vx;
+-						duy=vyobs-vy;
+-						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+-						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+-					}
+-					break;
+-				case SurfaceRelVelMisfitEnum:
+-					/*
+-					 *      1  [     \bar{v}^2             2   \bar{v}^2              2 ]
+-					 * J = --- | -------------  (u - u   ) + -------------  (v - v   )  |
+-					 *      2  [  (u   + eps)^2       obs    (v   + eps)^2       obs    ]
+-					 *              obs                        obs                      
+-					 *
+-					 *        dJ     \bar{v}^2
+-					 * DU = - -- = ------------- (u   - u )
+-					 *        du   (u   + eps)^2    obs
+-					 *               obs
+-					 */
+-					for (i=0;i<NUMVERTICES;i++){
+-						scalex=pow(meanvel/(vxobs+epsvel),2.); if(vxobs==0)scalex=0;
+-						scaley=pow(meanvel/(vyobs+epsvel),2.); if(vyobs==0)scaley=0;
+-						dux=scalex*(vxobs-vx);
+-						duy=scaley*(vyobs-vy);
+-						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+-						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+-					}
+-					break;
+-				case SurfaceLogVelMisfitEnum:
+-					/*
+-					 *                 [        vel + eps     ] 2
+-					 * J = 4 \bar{v}^2 | log ( -----------  ) |  
+-					 *                 [       vel   + eps    ]
+-					 *                            obs
+-					 *
+-					 *        dJ                 2 * log(...)
+-					 * DU = - -- = - 4 \bar{v}^2 -------------  u
+-					 *        du                 vel^2 + eps
+-					 *            
+-					 */
+-					for (i=0;i<NUMVERTICES;i++){
+-						velocity_mag    =sqrt(pow(vx,   2.)+pow(vy,   2.))+epsvel;
+-						obs_velocity_mag=sqrt(pow(vxobs,2.)+pow(vyobs,2.))+epsvel;
+-						scale=-8*pow(meanvel,2.)/pow(velocity_mag,2.)*log(velocity_mag/obs_velocity_mag);
+-						dux=scale*vx;
+-						duy=scale*vy;
+-						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+-						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+-					}
+-					break;
+-				case SurfaceAverageVelMisfitEnum:
+-					/*
+-					 *      1                    2              2
+-					 * J = ---  sqrt(  (u - u   )  +  (v - v   )  )
+-					 *      S                obs            obs
+-					 *
+-					 *        dJ      1       1 
+-					 * DU = - -- = - --- ----------- * 2 (u - u   )
+-					 *        du      S  2 sqrt(...)           obs
+-					 */
+-					for (i=0;i<NUMVERTICES;i++){
+-						scale=1./(S*2*sqrt(pow(vx-vxobs,2.)+pow(vy-vyobs,2.))+epsvel);
+-						dux=scale*(vxobs-vx);
+-						duy=scale*(vyobs-vy);
+-						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+-						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+-					}
+-					break;
+-				case SurfaceLogVxVyMisfitEnum:
+-					/*
+-					 *      1            [        |u| + eps     2          |v| + eps     2  ]
+-					 * J = --- \bar{v}^2 | log ( -----------  )   +  log ( -----------  )   |  
+-					 *      2            [       |u    |+ eps              |v    |+ eps     ]
+-					 *                              obs                       obs
+-					 *        dJ                              1      u                             1
+-					 * DU = - -- = - \bar{v}^2 log(u...) --------- ----  ~ - \bar{v}^2 log(u...) ------
+-					 *        du                         |u| + eps  |u|                           u + eps
+-					 */
+-					for (i=0;i<NUMVERTICES;i++){
+-						dux = - pow(meanvel,2.) * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);
+-						duy = - pow(meanvel,2.) * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);
+-						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+-						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+-					}
+-					break;
+-				case DragCoefficientAbsGradientEnum:
+-					/*Nothing in P vector*/
+-					break;
+-				case ThicknessAbsGradientEnum:
+-					/*Nothing in P vector*/
+-					break;
+-				case RheologyBbarAbsGradientEnum:
+-					/*Nothing in P vector*/
+-					break;
+-				default:
+-					_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+-			}
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	xDelete<int>(responses);
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::DragCoefficientAbsGradient{{{*/
+-IssmDouble Tria::DragCoefficientAbsGradient(bool process_units,int weight_index){
+-
+-	/* Intermediaries */
+-	int        ig;
+-	IssmDouble     Jelem = 0;
+-	IssmDouble     weight;
+-	IssmDouble     Jdet;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     dp[NDOF2];
+-	GaussTria *gauss = NULL;
+-
+-	/*retrieve parameters and inputs*/
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater()) return 0;
+-
+-	/*Retrieve all inputs we will be needing: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* weights_input=inputs->GetInput(InversionCostFunctionsCoefficientsEnum);         _assert_(weights_input);
+-	Input* drag_input   =inputs->GetInput(FrictionCoefficientEnum); _assert_(drag_input);
+-
+-	/* Start looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/* Get Jacobian determinant: */
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Get all parameters at gaussian point*/
+-		weights_input->GetInputValue(&weight,gauss,weight_index);
+-		drag_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
+-
+-		/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
+-		Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Jelem;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixAdjointBalancethickness {{{*/
+-ElementMatrix* Tria::CreateKMatrixAdjointBalancethickness(void){
+-
+-	ElementMatrix* Ke=NULL;
+-
+-	/*Get Element Matrix of the forward model*/
+-	switch(GetElementType()){
+-		case P1Enum:
+-			Ke=CreateKMatrixBalancethickness_CG();
+-			break;
+-		case P1DGEnum:
+-			Ke=CreateKMatrixBalancethickness_DG();
+-			break;
+-		default:
+-			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
+-	}
+-
+-	/*Transpose and return Ke*/
+-	Ke->Transpose();
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixAdjointMacAyeal{{{*/
+-ElementMatrix* Tria::CreateKMatrixAdjointMacAyeal(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	bool       incomplete_adjoint;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     Jdet,thickness;
+-	IssmDouble     eps1dotdphii,eps1dotdphij;
+-	IssmDouble     eps2dotdphii,eps2dotdphij;
+-	IssmDouble     mu_prime;
+-	IssmDouble     epsilon[3];/* epsilon=[exx,eyy,exy];*/
+-	IssmDouble     eps1[2],eps2[2];
+-	IssmDouble     phi[NUMVERTICES];
+-	IssmDouble     dphi[2][NUMVERTICES];
+-	GaussTria *gauss=NULL;
+-
+-	/*Initialize Jacobian with regular MacAyeal (first part of the Gateau derivative)*/
+-	parameters->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
+-	ElementMatrix* Ke=CreateKMatrixDiagnosticMacAyeal();
+-	if(incomplete_adjoint) return Ke;
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsDerivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+-
+-		thickness_input->GetInputValue(&thickness, gauss);
+-		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosity2dDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+-		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+-		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+-
+-		for(i=0;i<3;i++){
+-			for(j=0;j<3;j++){
+-				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i];
+-				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j];
+-				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i];
+-				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j];
+-
+-				Ke->values[6*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps1dotdphii;
+-				Ke->values[6*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps1dotdphii;
+-				Ke->values[6*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps2dotdphii;
+-				Ke->values[6*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps2dotdphii;
+-			}
+-		}
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	//Ke->Transpose();
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromSolutionAdjointHoriz {{{*/
+-void  Tria::InputUpdateFromSolutionAdjointHoriz(IssmDouble* solution){
+-
+-	const int numdof=NDOF2*NUMVERTICES;
+-
+-	int       i;
+-	int*      doflist=NULL;
+-	IssmDouble    values[numdof];
+-	IssmDouble    lambdax[NUMVERTICES];
+-	IssmDouble    lambday[NUMVERTICES];
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		lambdax[i]=values[i*NDOF2+0];
+-		lambday[i]=values[i*NDOF2+1];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(lambdax[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(lambday[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new TriaP1Input(AdjointxEnum,lambdax));
+-	this->inputs->AddInput(new TriaP1Input(AdjointyEnum,lambday));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromSolutionAdjointBalancethickness {{{*/
+-void  Tria::InputUpdateFromSolutionAdjointBalancethickness(IssmDouble* solution){
+-
+-	const int numdof=NDOF1*NUMVERTICES;
+-
+-	int       i;
+-	int*      doflist=NULL;
+-	IssmDouble    values[numdof];
+-	IssmDouble    lambda[NUMVERTICES];
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<numdof;i++){
+-		lambda[i]=values[i];
+-		if(xIsNan<IssmDouble>(lambda[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new TriaP1Input(AdjointEnum,lambda));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetVectorFromControlInputs{{{*/
+-void  Tria::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){
+-
+-	int doflist1[NUMVERTICES];
+-	Input *input=NULL;
+-
+-	/*Get out if this is not an element input*/
+-	if(!IsInput(control_enum)) return;
+-
+-	/*Prepare index list*/
+-	GradientIndexing(&doflist1[0],control_index);
+-
+-	/*Get input (either in element or material)*/
+-	if(control_enum==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
+-	}
+-	else{
+-		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+-	}
+-
+-	/*Check that it is a ControlInput*/
+-	if (input->ObjectEnum()!=ControlInputEnum){
+-		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
+-	}
+-
+-	((ControlInput*)input)->GetVectorFromInputs(vector,&doflist1[0],data);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::SetControlInputsFromVector{{{*/
+-void  Tria::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){
+-
+-	IssmDouble  values[NUMVERTICES];
+-	int     doflist1[NUMVERTICES];
+-	Input  *input     = NULL;
+-	Input  *new_input = NULL;
+-
+-	/*Get out if this is not an element input*/
+-	if(!IsInput(control_enum)) return;
+-
+-	/*Prepare index list*/
+-	GradientIndexing(&doflist1[0],control_index);
+-
+-	/*Get values on vertices*/
+-	for (int i=0;i<NUMVERTICES;i++){
+-		values[i]=vector[doflist1[i]];
+-	}
+-	new_input = new TriaP1Input(control_enum,values);
+-
+-	if(control_enum==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
+-	}
+-	else{
+-		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+-	}
+-
+-	if (input->ObjectEnum()!=ControlInputEnum){
+-		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
+-	}
+-
+-	((ControlInput*)input)->SetInput(new_input);
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_HYDROLOGY_
+-/*FUNCTION Tria::CreateHydrologyWaterVelocityInput {{{*/
+-void Tria::CreateHydrologyWaterVelocityInput(void){
+-
+-	/*material parameters: */
+-	IssmDouble mu_water;
+-	IssmDouble VelocityFactor;  // This factor represents the number 12 in laminar flow velocity which can vary by differnt hydrology.CR
+-	IssmDouble n_man,CR;
+-	IssmDouble w;
+-	IssmDouble rho_ice, rho_water, g;
+-	IssmDouble dsdx,dsdy,dbdx,dbdy;
+-	IssmDouble vx[NUMVERTICES];
+-	IssmDouble vy[NUMVERTICES];
+-	GaussTria *gauss = NULL;
+-
+-	/*Retrieve all inputs and parameters*/
+-	rho_ice=matpar->GetRhoIce();
+-	rho_water=matpar->GetRhoWater();
+-	g=matpar->GetG();
+-	CR=matpar->GetHydrologyCR(); // To have Lebrocq equavalent equation: CR=0.01,n_man=0.02
+-	n_man=matpar->GetHydrologyN(); 
+-	mu_water=matpar->GetMuWater();
+-	Input* surfaceslopex_input=inputs->GetInput(SurfaceSlopeXEnum); _assert_(surfaceslopex_input);
+-	Input* surfaceslopey_input=inputs->GetInput(SurfaceSlopeYEnum); _assert_(surfaceslopey_input);
+-	Input* bedslopex_input=inputs->GetInput(BedSlopeXEnum);         _assert_(bedslopex_input);
+-	Input* bedslopey_input=inputs->GetInput(BedSlopeYEnum);         _assert_(bedslopey_input);
+-	Input* watercolumn_input=inputs->GetInput(WatercolumnEnum);     _assert_(watercolumn_input);
+-
+-	/* compute VelocityFactor */
+-	VelocityFactor= n_man*pow(CR,2)*rho_water*g/mu_water;
+-	
+-	gauss=new GaussTria();
+-	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
+-		surfaceslopex_input->GetInputValue(&dsdx,gauss);
+-		surfaceslopey_input->GetInputValue(&dsdy,gauss);
+-		bedslopex_input->GetInputValue(&dbdx,gauss);
+-		bedslopey_input->GetInputValue(&dbdy,gauss);
+-		watercolumn_input->GetInputValue(&w,gauss);
+-
+-		/* Water velocity x and y components */
+-	//	vx[iv]= - pow(w,2)/(12 * mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx);
+-	//	vy[iv]= - pow(w,2)/(12 * mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy);
+-	
+-		vx[iv]= - pow(w,2)/(VelocityFactor* mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx);
+-		vy[iv]= - pow(w,2)/(VelocityFactor* mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy);
+-	}
+-
+-	/*clean-up*/
+-	delete gauss;
+-
+-	/*Add to inputs*/
+-	this->inputs->AddInput(new TriaP1Input(HydrologyWaterVxEnum,vx));
+-	this->inputs->AddInput(new TriaP1Input(HydrologyWaterVyEnum,vy));
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixHydrology{{{*/
+-ElementMatrix* Tria::CreateKMatrixHydrology(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	IssmDouble     diffusivity;
+-	int        i,j,ig;
+-	IssmDouble     Jdettria,DL_scalar,dt,h;
+-	IssmDouble     vx,vy,vel,dvxdx,dvydy;
+-	IssmDouble     dvx[2],dvy[2];
+-	IssmDouble     v_gauss[2]={0.0};
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     L[NUMVERTICES];
+-	IssmDouble     B[2][NUMVERTICES];
+-	IssmDouble     Bprime[2][NUMVERTICES];
+-	IssmDouble     K[2][2]                        ={0.0};
+-	IssmDouble     KDL[2][2]                      ={0.0};
+-	IssmDouble     DL[2][2]                        ={0.0};
+-	IssmDouble     DLprime[2][2]                   ={0.0};
+-	GaussTria *gauss=NULL;
+-
+-	/*Skip if water or ice shelf element*/
+-	if(IsOnWater() | IsFloating()) return NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Create water velocity vx and vy from current inputs*/
+-	CreateHydrologyWaterVelocityInput();
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	this->parameters->FindParam(&diffusivity,HydrologyStabilizationEnum);
+-	Input* vx_input=inputs->GetInput(HydrologyWaterVxEnum); _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(HydrologyWaterVyEnum); _assert_(vy_input);
+-	h=sqrt(2*this->GetArea());
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
+-		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
+-
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		vx_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
+-		vy_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
+-
+-		DL_scalar=gauss->weight*Jdettria;
+-
+-		TripleMultiply( &L[0],1,numdof,1,
+-					&DL_scalar,1,1,0,
+-					&L[0],1,numdof,0,
+-					&Ke->values[0],1);
+-
+-		GetBPrognostic(&B[0][0], &xyz_list[0][0], gauss);
+-		GetBprimePrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
+-
+-		dvxdx=dvx[0];
+-		dvydy=dvy[1];
+-		DL_scalar=dt*gauss->weight*Jdettria;
+-
+-		DL[0][0]=DL_scalar*dvxdx;
+-		DL[1][1]=DL_scalar*dvydy;
+-		DLprime[0][0]=DL_scalar*vx;
+-		DLprime[1][1]=DL_scalar*vy;
+-
+-		TripleMultiply( &B[0][0],2,numdof,1,
+-					&DL[0][0],2,2,0,
+-					&B[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-
+-		TripleMultiply( &B[0][0],2,numdof,1,
+-					&DLprime[0][0],2,2,0,
+-					&Bprime[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-
+-		/*Artificial diffusivity*/
+-		vel=sqrt(pow(vx,2.)+pow(vy,2.));
+-		K[0][0]=diffusivity*h/(2*vel)*vx*vx;
+-		K[1][0]=diffusivity*h/(2*vel)*vy*vx;
+-		K[0][1]=diffusivity*h/(2*vel)*vx*vy;
+-		K[1][1]=diffusivity*h/(2*vel)*vy*vy;
+-		KDL[0][0]=DL_scalar*K[0][0];
+-		KDL[1][0]=DL_scalar*K[1][0];
+-		KDL[0][1]=DL_scalar*K[0][1];
+-		KDL[1][1]=DL_scalar*K[1][1];
+-
+-		TripleMultiply( &Bprime[0][0],2,numdof,1,
+-					&KDL[0][0],2,2,0,
+-					&Bprime[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorHydrology {{{*/
+-ElementVector* Tria::CreatePVectorHydrology(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     Jdettria,dt;
+-	IssmDouble     basal_melting_g;
+-	IssmDouble     old_watercolumn_g;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     basis[numdof];
+-	GaussTria* gauss=NULL;
+-
+-	/*Skip if water or ice shelf element*/
+-	if(IsOnWater() | IsFloating()) return NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	Input* basal_melting_input=inputs->GetInput(BasalforcingsMeltingRateEnum); _assert_(basal_melting_input);
+-	Input* old_watercolumn_input=inputs->GetInput(WaterColumnOldEnum);         _assert_(old_watercolumn_input);
+-
+-	/*Initialize basal_melting_correction_g to 0, do not forget!:*/
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis, gauss);
+-
+-		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
+-		old_watercolumn_input->GetInputValue(&old_watercolumn_g,gauss);
+-
+-		if(dt)for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(old_watercolumn_g+dt*basal_melting_g)*basis[i];
+-		else  for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*basal_melting_g*basis[i];
+-	}
+-		
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::GetSolutionFromInputsHydrology{{{*/
+-void  Tria::GetSolutionFromInputsHydrology(Vector* solution){
+-
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	int i;
+-	int*         doflist=NULL;
+-	IssmDouble       watercolumn;
+-	IssmDouble       values[numdof];
+-	GaussTria*   gauss=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Get inputs*/
+-	Input* watercolumn_input=inputs->GetInput(WatercolumnEnum); _assert_(watercolumn_input);
+-
+-	/*Ok, we have watercolumn values, fill in watercolumn array: */
+-	/*P1 element only for now*/
+-	gauss=new GaussTria();
+-	for(i=0;i<NUMVERTICES;i++){
+-
+-		gauss->GaussVertex(i);
+-
+-		/*Recover watercolumn*/
+-		watercolumn_input->GetInputValue(&watercolumn,gauss);
+-		values[i]=watercolumn;
+-	}
+-
+-	solution->SetValues(numdof,doflist,values,INS_VAL);
+-
+-	/*Free ressources:*/
+-	delete gauss;
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromSolutionHydrology{{{*/
+-void  Tria::InputUpdateFromSolutionHydrology(IssmDouble* solution){
+-
+-	/*Intermediaries*/
+-	const int numdof = NDOF1*NUMVERTICES;
+-
+-	int       i;
+-	int*      doflist=NULL;
+-	IssmDouble    values[numdof];
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++){
+-		values[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
+-		if (values[i]<pow((IssmDouble)10,(IssmDouble)-10))values[i]=pow((IssmDouble)10,(IssmDouble)-10); //correcting the water column to positive values
+- 
+-	}
+-
+-	/*Add input to the element: */
+-	this->inputs->AddInput(new TriaP1Input(WatercolumnEnum,values));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_DAKOTA_
+-/*FUNCTION Tria::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);{{{*/
+-void  Tria::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
+-	
+-	int i,j;
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	switch(type){
+-
+-		case VertexEnum:
+-
+-			/*New TriaP1Input*/
+-			IssmDouble values[3];
+-
+-			/*Get values on the 3 vertices*/
+-			for (i=0;i<3;i++){
+-				values[i]=vector[this->nodes[i]->GetSidList()]; //careful, vector of values here is not parallel distributed, but serial distributed (from a serial Dakota core!)
+-			}
+-
+-			/*Branch on the specified type of update: */
+-			switch(name){
+-				case ThicknessEnum:
+-					IssmDouble  thickness[3];
+-					IssmDouble  thickness_init[3];
+-					IssmDouble  hydrostatic_ratio[3];
+-					IssmDouble  surface[3];
+-					IssmDouble  bed[3];
+-					
+-					/*retrieve inputs: */
+-					GetInputListOnVertices(&thickness_init[0],ThicknessEnum);
+-					GetInputListOnVertices(&hydrostatic_ratio[0],GeometryHydrostaticRatioEnum);
+-					GetInputListOnVertices(&bed[0],BedEnum);
+-					GetInputListOnVertices(&surface[0],SurfaceEnum);
+-
+-					/*build new bed and surface: */
+-					if (this->IsFloating()){
+-						/*hydrostatic equilibrium: */
+-						IssmDouble rho_ice,rho_water,di;
+-						rho_ice   = this->matpar->GetRhoIce();
+-						rho_water = this->matpar->GetRhoWater();
+-						di        = rho_ice/rho_water;
+-
+-						/*build new thickness: */
+-						for (j=0; j<3; j++) {
+-							/*  for observed/interpolated/hydrostatic thickness, remove scaling from any hydrostatic thickness  */
+-							if (hydrostatic_ratio[j] >= 0.)
+-								thickness[j]=values[j]-(values[j]/thickness_init[j]-1.)*hydrostatic_ratio[j]*surface[j]/(1.-di);
+-							/*  for minimum thickness, don't scale  */
+-							else
+-								thickness[j]=thickness_init[j];
+-
+-							/*  check the computed thickness and update bed*/
+-							if (thickness[j] < 0.) thickness[j]=1./(1.-di);
+-							bed[j]=surface[j]-thickness[j];
+-						}
+-					}
+-					else{
+-						/*build new thickness: */
+-						for (j=0; j<3; j++) {
+-							/*  for observed thickness, use scaled value  */
+-							if (hydrostatic_ratio[j] >= 0.)
+-								thickness[j]=values[j];
+-							/*  for minimum thickness, don't scale  */
+-							else
+-								thickness[j]=thickness_init[j];
+-						}
+-
+-						/*update bed on grounded ice: */
+-						for(j=0;j<3;j++)bed[j]=surface[j]-thickness[j];
+-					}
+-
+-					/*Add new inputs: */
+-					this->inputs->AddInput(new TriaP1Input(ThicknessEnum,thickness));
+-					this->inputs->AddInput(new TriaP1Input(BedEnum,bed));
+-					this->inputs->AddInput(new TriaP1Input(SurfaceEnum,surface));
+-
+-					break;
+-				default:
+-					this->inputs->AddInput(new TriaP1Input(name,values));
+-			}
+-			break;
+-
+-		default:
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/
+-void  Tria::InputUpdateFromVectorDakota(int* vector, int name, int type){
+-	_error2_("not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/
+-void  Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type){
+-	_error2_("not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Tria::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type);{{{*/
+-void  Tria::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
+-	
+-	int i,j,t;
+-	TransientInput* transientinput=NULL;
+-	IssmDouble values[3];
+-	IssmDouble time;
+-	int row;
+-	IssmDouble yts;
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	switch(type){
+-
+-		case VertexEnum:
+-			
+-			/*Create transient input: */
+-						
+-			parameters->FindParam(&yts,ConstantsYtsEnum);
+-			for(t=0;t<ncols;t++){ //ncols is the number of times
+-
+-				/*create input values: */
+-				for(i=0;i<3;i++){
+-					row=this->nodes[i]->GetSidList();
+-					values[i]=(IssmDouble)matrix[ncols*row+t];
+-				}
+-
+-				/*time? :*/
+-				time=(IssmDouble)matrix[(nrows-1)*ncols+t]*yts;
+-
+-				if(t==0) transientinput=new TransientInput(name);
+-				transientinput->AddTimeInput(new TriaP1Input(name,values),time);
+-				transientinput->Configure(parameters);
+-			}
+-			this->inputs->AddInput(transientinput);
+-			break;
+-
+-		default:
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+-	}
+-
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_BALANCED_
+-/*FUNCTION Tria::CreateKMatrixBalancethickness {{{*/
+-ElementMatrix* Tria::CreateKMatrixBalancethickness(void){
+-
+-	switch(GetElementType()){
+-		case P1Enum:
+-			return CreateKMatrixBalancethickness_CG();
+-		case P1DGEnum:
+-			return CreateKMatrixBalancethickness_DG();
+-		default:
+-			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixBalancethickness_CG {{{*/
+-ElementMatrix* Tria::CreateKMatrixBalancethickness_CG(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        stabilization;
+-	int        i,j,ig,dim;
+-	IssmDouble     Jdettria,vx,vy,dvxdx,dvydy,vel,h;
+-	IssmDouble     dvx[2],dvy[2];
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     L[NUMVERTICES];
+-	IssmDouble     B[2][NUMVERTICES];
+-	IssmDouble     Bprime[2][NUMVERTICES];
+-	IssmDouble     K[2][2]                          = {0.0};
+-	IssmDouble     KDL[2][2]                        = {0.0};
+-	IssmDouble     DL[2][2]                         = {0.0};
+-	IssmDouble     DLprime[2][2]                    = {0.0};
+-	IssmDouble     DL_scalar;
+-	GaussTria *gauss                            = NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all Inputs and parameters: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&stabilization,BalancethicknessStabilizationEnum);
+-	this->parameters->FindParam(&dim,MeshDimensionEnum);
+-	Input* vxaverage_input=NULL;
+-	Input* vyaverage_input=NULL;
+-	if(dim==2){
+-		vxaverage_input=inputs->GetInput(VxEnum); _assert_(vxaverage_input);
+-		vyaverage_input=inputs->GetInput(VyEnum); _assert_(vyaverage_input);
+-	}
+-	else{
+-		vxaverage_input=inputs->GetInput(VxAverageEnum); _assert_(vxaverage_input);
+-		vyaverage_input=inputs->GetInput(VyAverageEnum); _assert_(vyaverage_input);
+-	}
+-	h=sqrt(2*this->GetArea());
+-
+-	/*Start looping on the number of gaussian points:*/
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
+-		GetBPrognostic(&B[0][0], &xyz_list[0][0], gauss);
+-		GetBprimePrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
+-
+-		vxaverage_input->GetInputValue(&vx,gauss);
+-		vyaverage_input->GetInputValue(&vy,gauss);
+-		vxaverage_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
+-		vyaverage_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
+-
+-		dvxdx=dvx[0];
+-		dvydy=dvy[1];
+-		DL_scalar=gauss->weight*Jdettria;
+-
+-		DL[0][0]=DL_scalar*dvxdx;
+-		DL[1][1]=DL_scalar*dvydy;
+-
+-		DLprime[0][0]=DL_scalar*vx;
+-		DLprime[1][1]=DL_scalar*vy;
+-
+-		TripleMultiply( &B[0][0],2,numdof,1,
+-					&DL[0][0],2,2,0,
+-					&B[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-
+-		TripleMultiply( &B[0][0],2,numdof,1,
+-					&DLprime[0][0],2,2,0,
+-					&Bprime[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-
+-		if(stabilization==1){
+-			/*Streamline upwinding*/
+-			vel=sqrt(pow(vx,2.)+pow(vy,2.));
+-			K[0][0]=h/(2*vel)*vx*vx;
+-			K[1][0]=h/(2*vel)*vy*vx;
+-			K[0][1]=h/(2*vel)*vx*vy;
+-			K[1][1]=h/(2*vel)*vy*vy;
+-		}
+-		else if(stabilization==2){
+-			/*MacAyeal*/
+-			vxaverage_input->GetInputAverage(&vx);
+-			vyaverage_input->GetInputAverage(&vy);
+-			K[0][0]=h/2.0*fabs(vx);
+-			K[0][1]=0.;
+-			K[1][0]=0.;
+-			K[1][1]=h/2.0*fabs(vy);
+-		}
+-		if(stabilization==1 || stabilization==2){
+-			KDL[0][0]=DL_scalar*K[0][0];
+-			KDL[1][0]=DL_scalar*K[1][0];
+-			KDL[0][1]=DL_scalar*K[0][1];
+-			KDL[1][1]=DL_scalar*K[1][1];
+-			TripleMultiply( &Bprime[0][0],2,numdof,1,
+-						&KDL[0][0],2,2,0,
+-						&Bprime[0][0],2,numdof,0,
+-						&Ke->values[0],1);
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreateKMatrixBalancethickness_DG {{{*/
+-ElementMatrix* Tria::CreateKMatrixBalancethickness_DG(void){
+-
+-	/*Constants*/
+-	const int  numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries*/
+-	int        i,j,ig,dim;
+-	IssmDouble     vx,vy,Jdettria;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     B[2][NUMVERTICES];
+-	IssmDouble     Bprime[2][NUMVERTICES];
+-	IssmDouble     DL[2][2]={0.0};
+-	IssmDouble     DL_scalar;
+-	GaussTria  *gauss=NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&dim,MeshDimensionEnum);
+-	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+-
+-	/*Start looping on the number of gaussian points:*/
+-	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
+-		/*WARNING: B and Bprime are inverted compared to usual prognostic!!!!*/
+-		GetBPrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
+-		GetBprimePrognostic(&B[0][0], &xyz_list[0][0], gauss);
+-
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-
+-		DL_scalar=-gauss->weight*Jdettria;
+-		DL[0][0]=DL_scalar*vx;
+-		DL[1][1]=DL_scalar*vy;
+-
+-		TripleMultiply( &B[0][0],2,numdof,1,
+-					&DL[0][0],2,2,0,
+-					&Bprime[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorBalancethickness{{{*/
+-ElementVector* Tria::CreatePVectorBalancethickness(void){
+-
+-	switch(GetElementType()){
+-		case P1Enum:
+-			return CreatePVectorBalancethickness_CG();
+-			break;
+-		case P1DGEnum:
+-			return CreatePVectorBalancethickness_DG();
+-		default:
+-			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorBalancethickness_CG{{{*/
+-ElementVector* Tria::CreatePVectorBalancethickness_CG(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-	
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     dhdt_g,basal_melting_g,surface_mass_balance_g,Jdettria;
+-	IssmDouble     L[NUMVERTICES];
+-	GaussTria* gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	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(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		surface_mass_balance_input->GetInputValue(&surface_mass_balance_g,gauss);
+-		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
+-		dhdt_input->GetInputValue(&dhdt_g,gauss);
+-
+-		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
+-		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
+-
+-		for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(surface_mass_balance_g-basal_melting_g-dhdt_g)*L[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Tria::CreatePVectorBalancethickness_DG {{{*/
+-ElementVector* Tria::CreatePVectorBalancethickness_DG(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     basal_melting_g,surface_mass_balance_g,dhdt_g,Jdettria;
+-	IssmDouble     L[NUMVERTICES];
+-	GaussTria* gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	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(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		surface_mass_balance_input->GetInputValue(&surface_mass_balance_g,gauss);
+-		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
+-		dhdt_input->GetInputValue(&dhdt_g,gauss);
+-
+-		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
+-		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
+-
+-		for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(surface_mass_balance_g-basal_melting_g-dhdt_g)*L[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaHook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaHook.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaHook.cpp	(revision 12822)
+@@ -1,72 +0,0 @@
+-/*!\file TriaHook.c
+- * \brief: implementation of the TriaHook object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Object constructors and destructor*/
+-/*FUNCTION TriaHook::TriaHook(){{{*/
+-TriaHook::TriaHook(){
+-	numanalyses=UNDEF;
+-	this->hnodes=NULL;
+-	this->hmatice=NULL;
+-	this->hmatpar=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION TriaHook::~TriaHook(){{{*/
+-TriaHook::~TriaHook(){
+-	int i;
+-
+-	for(i=0;i<this->numanalyses;i++){
+-		if (this->hnodes[i]) delete this->hnodes[i];
+-	}
+-	delete [] this->hnodes;
+-	delete hmatice;
+-	delete hmatpar;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaHook::TriaHook(int in_numanalyses,int matice_id, int matpar_id){{{*/
+-TriaHook::TriaHook(int in_numanalyses,int matice_id, IoModel* iomodel){
+-
+-	/*intermediary: */
+-	int matpar_id;
+-
+-	/*retrieve parameters: */
+-	iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
+-	
+-	this->numanalyses=in_numanalyses;
+-	this->hnodes= new Hook*[in_numanalyses];
+-	this->hmatice=new Hook(&matice_id,1);
+-	this->hmatpar=new Hook(&matpar_id,1);
+-
+-	//Initialize hnodes as NULL
+-	for(int i=0;i<this->numanalyses;i++){
+-		this->hnodes[i]=NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*FUNCTION TriaHook::SetHookNodes{{{*/
+-void TriaHook::SetHookNodes(int* node_ids,int analysis_counter){
+-
+-	/*initialize hook*/
+-	this->hnodes[analysis_counter]=new Hook(node_ids,3);
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaRef.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaRef.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaRef.h	(revision 12822)
+@@ -1,49 +0,0 @@
+-/*!\file:  TriaRef.h
+- * \brief abstract class for handling Tria oriented routines, like nodal functions, 
+- * strain rate generation, etc ...
+- */ 
+-
+-
+-#ifndef _TRIAREF_H_
+-#define _TRIAREF_H_
+-
+-class GaussTria;
+-
+-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 GetBMacAyeal(IssmDouble* B, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetBMacAyealStokes(IssmDouble* B , IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetBprimeMacAyeal(IssmDouble* Bprime, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetBprimeMacAyealStokes(IssmDouble* Bprime, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetBprimePrognostic(IssmDouble* Bprime_prog, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetBPrognostic(IssmDouble* B_prog, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetL(IssmDouble* L, IssmDouble* xyz_list,GaussTria* gauss,int numdof);
+-		void GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussTria* gauss);
+-		void GetSegmentJacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,GaussTria* gauss);
+-		void GetJacobianDeterminant2d(IssmDouble* Jdet, IssmDouble* xyz_list,GaussTria* gauss);
+-		void GetJacobianDeterminant3d(IssmDouble* Jdet, IssmDouble* xyz_list,GaussTria* gauss);
+-		void GetJacobianInvert(IssmDouble*  Jinv, IssmDouble* xyz_list,GaussTria* gauss);
+-		void GetNodalFunctions(IssmDouble* l1l2l3,GaussTria* gauss);
+-		void GetSegmentNodalFunctions(IssmDouble* l1l2l3,GaussTria* gauss, int index1,int index2);
+-		void GetSegmentBFlux(IssmDouble* B,GaussTria* gauss, int index1,int index2);
+-		void GetSegmentBprimeFlux(IssmDouble* Bprime,GaussTria* gauss, int index1,int index2);
+-		void GetNodalFunctionsDerivatives(IssmDouble* l1l2l3,IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetNodalFunctionsDerivativesReference(IssmDouble* dl1dl3,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pp, IssmDouble* plist, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* pp, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss);
+-
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaRef.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaRef.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaRef.cpp	(revision 12822)
+@@ -1,1267 +0,0 @@
+-/*!\file PentaRef.c
+- * \brief: implementation of the PentaRef object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Element macros*/
+-#define NUMNODESP1    6
+-#define NUMNODESP1_2d 3
+-#define NUMNODESMINI  7
+-
+-/*Object constructors and destructor*/
+-/*FUNCTION PentaRef::PentaRef(){{{*/
+-PentaRef::PentaRef(){
+-	this->element_type_list=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::PentaRef(int* types,int nummodels){{{*/
+-PentaRef::PentaRef(const int nummodels){
+-
+-	/*Only allocate pointer*/
+-	element_type_list=xNew<int>(nummodels);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::~PentaRef(){{{*/
+-PentaRef::~PentaRef(){
+-	xDelete<int>(element_type_list);
+-}
+-/*}}}*/
+-
+-/*Management*/
+-/*FUNCTION PentaRef::SetElementType{{{*/
+-void PentaRef::SetElementType(int type,int type_counter){
+-
+-	_assert_(type==P1Enum || type==P1DGEnum);
+-
+-	/*initialize element type*/
+-	this->element_type_list[type_counter]=type;
+-}
+-/*}}}*/
+-
+-/*Reference Element numerics*/
+-/*FUNCTION PentaRef::GetBMacAyealPattyn {{{*/
+-void PentaRef::GetBMacAyealPattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 
+-	 * For node i, Bi can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi=[ dh/dx          0      ]
+-	 *          [   0           dh/dy   ]
+-	 *          [ 1/2*dh/dy  1/2*dh/dx  ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1)
+-	 */
+-
+-	IssmDouble dbasis[3][NUMNODESP1];
+-
+-	/*Get dbasis in actual coordinate system: */
+-	GetNodalFunctionsP1Derivatives(&dbasis[0][0],xyz_list, gauss);
+-
+-	/*Build B: */
+-	for (int i=0;i<NUMNODESP1;i++){
+-		*(B+NDOF2*NUMNODESP1*0+NDOF2*i)=dbasis[0][i]; 
+-		*(B+NDOF2*NUMNODESP1*0+NDOF2*i+1)=0.0;
+-
+-		*(B+NDOF2*NUMNODESP1*1+NDOF2*i)=0.0;
+-		*(B+NDOF2*NUMNODESP1*1+NDOF2*i+1)=dbasis[1][i];
+-
+-		*(B+NDOF2*NUMNODESP1*2+NDOF2*i)=(float).5*dbasis[1][i]; 
+-		*(B+NDOF2*NUMNODESP1*2+NDOF2*i+1)=(float).5*dbasis[0][i]; 
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBMacAyealStokes{{{*/
+-void PentaRef::GetBMacAyealStokes(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 
+-	 * For node i, Bi can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi=[ dh/dx          0       0   0 ]
+-	 *          [   0           dh/dy    0   0 ]
+-	 *          [ 1/2*dh/dy  1/2*dh/dx   0   0 ]
+-	 *          [   0            0       0   h ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1)
+-	 */
+-
+-	int    i;
+-	IssmDouble dh1dh7[3][NUMNODESMINI];
+-	IssmDouble l1l6[NUMNODESP1];
+-
+-	/*Get dh1dh6 in actual coordinate system: */
+-	GetNodalFunctionsMINIDerivatives(&dh1dh7[0][0],xyz_list, gauss);
+-	GetNodalFunctionsP1(l1l6, gauss);
+-
+-	/*Build B: */
+-	for (i=0;i<NUMNODESMINI;i++){
+-		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i)=dh1dh7[0][i]; //B[0][NDOF4*i]=dh1dh6[0][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+2)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+1)=dh1dh7[1][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+2)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i)=0.5*dh1dh7[1][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+1)=0.5*dh1dh7[0][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+2)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+1)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+2)=0;
+-	}
+-
+-	for (i=0;i<NUMNODESP1;i++){ //last column not for the bubble function
+-		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+3)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+3)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+3)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+3)=l1l6[i];
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBPattyn {{{*/
+-void PentaRef::GetBPattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 
+-	 * For node i, Bi can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi=[ dh/dx          0      ]
+-	 *          [   0           dh/dy   ]
+-	 *          [ 1/2*dh/dy  1/2*dh/dx  ]
+-	 *          [ 1/2*dh/dz      0      ]
+-	 *          [  0         1/2*dh/dz  ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1)
+-	 */
+-
+-	IssmDouble dbasis[3][NUMNODESP1];
+-
+-	/*Get dbasis in actual coordinate system: */
+-	GetNodalFunctionsP1Derivatives(&dbasis[0][0],xyz_list, gauss);
+-
+-	/*Build B: */
+-	for (int i=0;i<NUMNODESP1;i++){
+-		*(B+NDOF2*NUMNODESP1*0+NDOF2*i)=dbasis[0][i]; 
+-		*(B+NDOF2*NUMNODESP1*0+NDOF2*i+1)=0.0;
+-
+-		*(B+NDOF2*NUMNODESP1*1+NDOF2*i)=0.0;
+-		*(B+NDOF2*NUMNODESP1*1+NDOF2*i+1)=dbasis[1][i];
+-
+-		*(B+NDOF2*NUMNODESP1*2+NDOF2*i)=(float).5*dbasis[1][i]; 
+-		*(B+NDOF2*NUMNODESP1*2+NDOF2*i+1)=(float).5*dbasis[0][i]; 
+-
+-		*(B+NDOF2*NUMNODESP1*3+NDOF2*i)=(float).5*dbasis[2][i]; 
+-		*(B+NDOF2*NUMNODESP1*3+NDOF2*i+1)=0.0;
+-
+-		*(B+NDOF2*NUMNODESP1*4+NDOF2*i)=0.0;
+-		*(B+NDOF2*NUMNODESP1*4+NDOF2*i+1)=(float).5*dbasis[2][i]; 
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBprimePattyn {{{*/
+-void PentaRef::GetBprimePattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss_coord){
+-	/*Compute B  prime matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 
+-	 * For node i, Bi can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi=[ 2*dh/dx     dh/dy   ]
+-	 *                [   dh/dx    2*dh/dy  ]
+-	 *                [ dh/dy      dh/dx    ]
+-	 *                [ dh/dz         0     ]
+-	 *                [  0         dh/dz    ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1)
+-	 */
+-	IssmDouble dbasis[3][NUMNODESP1];
+-
+-	/*Get dbasis in actual coordinate system: */
+-	GetNodalFunctionsP1Derivatives(&dbasis[0][0],xyz_list, gauss_coord);
+-
+-	/*Build BPrime: */
+-	for (int i=0;i<NUMNODESP1;i++){
+-		*(B+NDOF2*NUMNODESP1*0+NDOF2*i)=2.0*dbasis[0][i]; 
+-		*(B+NDOF2*NUMNODESP1*0+NDOF2*i+1)=dbasis[1][i];
+-
+-		*(B+NDOF2*NUMNODESP1*1+NDOF2*i)=dbasis[0][i];
+-		*(B+NDOF2*NUMNODESP1*1+NDOF2*i+1)=2.0*dbasis[1][i];
+-
+-		*(B+NDOF2*NUMNODESP1*2+NDOF2*i)=dbasis[1][i]; 
+-		*(B+NDOF2*NUMNODESP1*2+NDOF2*i+1)=dbasis[0][i]; 
+-
+-		*(B+NDOF2*NUMNODESP1*3+NDOF2*i)=dbasis[2][i]; 
+-		*(B+NDOF2*NUMNODESP1*3+NDOF2*i+1)=0.0;
+-
+-		*(B+NDOF2*NUMNODESP1*4+NDOF2*i)=0.0;
+-		*(B+NDOF2*NUMNODESP1*4+NDOF2*i+1)=dbasis[2][i]; 
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBprimeMacAyealStokes{{{*/
+-void PentaRef::GetBprimeMacAyealStokes(IssmDouble* Bprime, IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Compute Bprime  matrix. Bprime=[Bprime1 Bprime2 Bprime3 Bprime4 Bprime5 Bprime6] where Bprimei is of size 5*NDOF2. 
+-	 * For node i, Bprimei can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bprimei=[ 2*dh/dx    dh/dy   0   0 ]
+-	 *               [  dh/dx    2*dh/dy  0   0 ]
+-	 *               [  dh/dy     dh/dx   0   0 ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume Bprime has been allocated already, of size: 5x(NDOF2*NUMNODESP1)
+-	 */
+-
+-	int    i;
+-	IssmDouble dh1dh7[3][NUMNODESMINI];
+-
+-	/*Get dh1dh6 in actual coordinate system: */
+-	GetNodalFunctionsMINIDerivatives(&dh1dh7[0][0],xyz_list, gauss);
+-
+-	/*Build Bprime: */
+-	for (i=0;i<NUMNODESMINI;i++){
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i)=2*dh1dh7[0][i]; //Bprime[0][NDOF4*i]=dh1dh6[0][i];
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1)=dh1dh7[1][i];
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+2)=0;
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i)=dh1dh7[0][i];
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+1)=2*dh1dh7[1][i];
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+2)=0;
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i)=dh1dh7[1][i];
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+1)=dh1dh7[0][i];
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+2)=0;
+-	}
+-
+-	for (i=0;i<NUMNODESP1;i++){ //last column not for the bubble function
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+3)=0;
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+3)=0;
+-		*(Bprime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+3)=0;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBStokes {{{*/
+-void PentaRef::GetBStokes(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
+-
+-	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 3*NDOF4. 
+-	 * For node i, Bi can be expressed in the actual coordinate system
+-	 * by: 		Bi=[ dh/dx          0              0       0  ]
+-	 *					[   0           dh/dy           0       0  ]
+-	 *					[   0             0           dh/dy     0  ]
+-	 *					[ 1/2*dh/dy    1/2*dh/dx        0       0  ]
+-	 *					[ 1/2*dh/dz       0         1/2*dh/dx   0  ]
+-	 *					[   0          1/2*dh/dz    1/2*dh/dy   0  ]
+-	 *					[   0             0             0       h  ]
+-	 *					[ dh/dx         dh/dy         dh/dz     0  ]
+-	 *	where h is the interpolation function for node i.
+-	 *	Same thing for Bb except the last column that does not exist.
+-	 */
+-
+-	int i;
+-
+-	IssmDouble dh1dh7[3][NUMNODESMINI];
+-	IssmDouble l1l6[NUMNODESP1];
+-
+-	/*Get dh1dh7 in actual coordinate system: */
+-	GetNodalFunctionsMINIDerivatives(&dh1dh7[0][0],xyz_list, gauss);
+-	GetNodalFunctionsP1(l1l6, gauss);
+-
+-	/*Build B: */
+-	for (i=0;i<NUMNODESMINI;i++){
+-		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i)=dh1dh7[0][i]; //B[0][NDOF4*i]=dh1dh6[0][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+2)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+1)=dh1dh7[1][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+2)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+1)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+2)=dh1dh7[2][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i)=(float).5*dh1dh7[1][i]; 
+-		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+1)=(float).5*dh1dh7[0][i]; 
+-		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+2)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*4+NDOF4*i)=(float).5*dh1dh7[2][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+1)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+2)=(float).5*dh1dh7[0][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*5+NDOF4*i)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+1)=(float).5*dh1dh7[2][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+2)=(float).5*dh1dh7[1][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*6+NDOF4*i)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+1)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+2)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*7+NDOF4*i)=dh1dh7[0][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+1)=dh1dh7[1][i];
+-		*(B+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+2)=dh1dh7[2][i];
+-	}
+-
+-	for (i=0;i<NUMNODESP1;i++){ //last column not for the bubble function
+-		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+3)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+3)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+3)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+3)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+3)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+3)=0;
+-		*(B+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+3)=l1l6[i];
+-		*(B+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+3)=0;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBprimeStokes {{{*/
+-void PentaRef::GetBprimeStokes(IssmDouble* B_prime, IssmDouble* xyz_list, GaussPenta* 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: 
+-	 *				Bi'=[  dh/dx   0          0       0]
+-	 *					 [   0      dh/dy      0       0]
+-	 *					 [   0      0         dh/dz    0]
+-	 *					 [  dh/dy   dh/dx      0       0]
+-	 *					 [  dh/dz   0        dh/dx     0]
+-	 *					 [   0      dh/dz    dh/dy     0]
+-	 *					 [  dh/dx   dh/dy    dh/dz     0]
+-	 *					 [   0      0          0       h]
+-	 *	where h is the interpolation function for node i.
+-	 *
+-	 * 	Same thing for the bubble fonction except that there is no fourth column
+-	 */
+-
+-	int i;
+-	IssmDouble dh1dh7[3][NUMNODESMINI];
+-	IssmDouble l1l6[NUMNODESP1];
+-
+-	/*Get dh1dh7 in actual coordinate system: */
+-	GetNodalFunctionsMINIDerivatives(&dh1dh7[0][0],xyz_list, gauss);
+-	GetNodalFunctionsP1(l1l6, gauss);
+-
+-	/*B_primeuild B_prime: */
+-	for (i=0;i<NUMNODESMINI;i++){
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i)=dh1dh7[0][i]; //B_prime[0][NDOF4*i]=dh1dh6[0][i];
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+2)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+1)=dh1dh7[1][i];
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+2)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+1)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+2)=dh1dh7[2][i];
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*3+NDOF4*i)=dh1dh7[1][i]; 
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+1)=dh1dh7[0][i]; 
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+2)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*4+NDOF4*i)=dh1dh7[2][i];
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+1)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+2)=dh1dh7[0][i];
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*5+NDOF4*i)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+1)=dh1dh7[2][i];
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+2)=dh1dh7[1][i];
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*6+NDOF4*i)=dh1dh7[0][i];
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+1)=dh1dh7[1][i];
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+2)=dh1dh7[2][i];
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*7+NDOF4*i)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+1)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+2)=0;
+-	}
+-
+-	for (i=0;i<NUMNODESP1;i++){ //last column not for the bubble function
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+3)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+3)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+3)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+3)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+3)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+3)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+3)=0;
+-		*(B_prime+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+3)=l1l6[i];
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBAdvec{{{*/
+-void PentaRef::GetBAdvec(IssmDouble* B_advec, IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 
+-	 * For node i, Bi' can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi_advec =[ h ]
+-	 *                 [ h ]
+-	 *                 [ h ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B has been allocated already, of size: 3x(NDOF1*NUMNODESP1)
+-	 */
+-
+-	/*Same thing in the actual coordinate system: */
+-	IssmDouble l1l6[6];
+-
+-	/*Get dh1dh2dh3 in actual coordinates system : */
+-	GetNodalFunctionsP1(l1l6, gauss);
+-
+-	/*Build B': */
+-	for (int i=0;i<NUMNODESP1;i++){
+-		*(B_advec+NDOF1*NUMNODESP1*0+NDOF1*i)=l1l6[i]; 
+-		*(B_advec+NDOF1*NUMNODESP1*1+NDOF1*i)=l1l6[i]; 
+-		*(B_advec+NDOF1*NUMNODESP1*2+NDOF1*i)=l1l6[i]; 
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBConduct{{{*/
+-void PentaRef::GetBConduct(IssmDouble* B_conduct, IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 
+-	 * For node i, Bi' can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi_conduct=[ dh/dx ]
+-	 *                  [ dh/dy ]
+-	 *                  [ dh/dz ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B has been allocated already, of size: 3x(NDOF1*NUMNODESP1)
+-	 */
+-
+-	/*Same thing in the actual coordinate system: */
+-	IssmDouble dh1dh6[3][NUMNODESP1];
+-
+-	/*Get dh1dh2dh3 in actual coordinates system : */
+-	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list,gauss);
+-
+-	/*Build B': */
+-	for (int i=0;i<NUMNODESP1;i++){
+-		*(B_conduct+NDOF1*NUMNODESP1*0+NDOF1*i)=dh1dh6[0][i]; 
+-		*(B_conduct+NDOF1*NUMNODESP1*1+NDOF1*i)=dh1dh6[1][i]; 
+-		*(B_conduct+NDOF1*NUMNODESP1*2+NDOF1*i)=dh1dh6[2][i]; 
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBVert{{{*/
+-void PentaRef::GetBVert(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*	Compute B  matrix. B=[dh1/dz dh2/dz dh3/dz dh4/dz dh5/dz dh6/dz];
+-		where hi is the interpolation function for node i.*/
+-
+-	int i;
+-	IssmDouble dh1dh6[3][NUMNODESP1];
+-
+-	/*Get dh1dh6 in actual coordinate system: */
+-	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list, gauss);
+-
+-	/*Build B: */
+-	for (i=0;i<NUMNODESP1;i++){
+-		B[i]=dh1dh6[2][i];  
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBprimeAdvec{{{*/
+-void PentaRef::GetBprimeAdvec(IssmDouble* Bprime_advec, IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 
+-	 * For node i, Bi' can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Biprime_advec=[ dh/dx ]
+-	 *                     [ dh/dy ]
+-	 *                     [ dh/dz ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B has been allocated already, of size: 3x(NDOF1*NUMNODESP1)
+-	 */
+-
+-	/*Same thing in the actual coordinate system: */
+-	IssmDouble dh1dh6[3][NUMNODESP1];
+-
+-	/*Get dh1dh2dh3 in actual coordinates system : */
+-	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list,gauss);
+-
+-	/*Build B': */
+-	for (int i=0;i<NUMNODESP1;i++){
+-		*(Bprime_advec+NDOF1*NUMNODESP1*0+NDOF1*i)=dh1dh6[0][i]; 
+-		*(Bprime_advec+NDOF1*NUMNODESP1*1+NDOF1*i)=dh1dh6[1][i]; 
+-		*(Bprime_advec+NDOF1*NUMNODESP1*2+NDOF1*i)=dh1dh6[2][i]; 
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetBprimeVert{{{*/
+-void PentaRef::GetBprimeVert(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
+-	/* Compute Bprime  matrix. Bprime=[L1 L2 L3 L4 L5 L6] where Li is the nodal function for node i*/
+-
+-	GetNodalFunctionsP1(B, gauss);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetL{{{*/
+-void PentaRef::GetL(IssmDouble* L, GaussPenta* gauss, int numdof){
+-	/*Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
+-	 ** For node i, Li can be expressed in the actual coordinate system
+-	 ** by: 
+-	 **       numdof=1: 
+-	 **                 Li=h;
+-	 **       numdof=2:
+-	 **                 Li=[ h   0 ]
+-	 **                    [ 0   h ]
+-	 ** where h is the interpolation function for node i.
+-	 **
+-	 ** We assume L has been allocated already, of size: NUMNODESP1 (numdof=1), or numdofx(numdof*NUMNODESP1) (numdof=2)
+-	 **/
+-
+-	int i;
+-	IssmDouble l1l6[6];
+-
+-	/*Get l1l6 in actual coordinate system: */
+-	GetNodalFunctionsP1(l1l6,gauss);
+-
+-	/*Build L: */
+-	if(numdof==1){
+-		for (i=0;i<NUMNODESP1;i++){
+-			L[i]=l1l6[i]; 
+-		}
+-	}
+-	else{
+-		for (i=0;i<NUMNODESP1;i++){
+-			*(L+numdof*NUMNODESP1*0+numdof*i)=l1l6[i]; 
+-			*(L+numdof*NUMNODESP1*0+numdof*i+1)=0;
+-			*(L+numdof*NUMNODESP1*1+numdof*i)=0;
+-			*(L+numdof*NUMNODESP1*1+numdof*i+1)=l1l6[i];
+-		}
+-	}
+-} 
+-/*}}}*/
+-/*FUNCTION PentaRef::GetLStokes{{{*/
+-void PentaRef::GetLStokes(IssmDouble* LStokes, GaussPenta* gauss){
+-	/*
+-	 * Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
+-	 * For node i, Li can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Li=[ h 0 ]
+-	 *	 	      [ 0 h ]
+-	 *		      [ 0 0 ]
+-	 *		      [ 0 0 ]
+-	 * where h is the interpolation function for node i.
+-	 */
+-
+-	const int num_dof=4;
+-	IssmDouble l1l2l3[NUMNODESP1_2d];
+-
+-	/*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;
+-
+-	/*Build LStokes: */
+-	for (int i=0;i<3;i++){
+-		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+0)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0.;
+-		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+2)=0.;
+-		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+3)=0.;
+-
+-		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+0)=0.;
+-		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+2)=0.;
+-		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+3)=0.;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetLprimeStokes {{{*/
+-void PentaRef::GetLprimeStokes(IssmDouble* LprimeStokes, IssmDouble* xyz_list, GaussPenta* gauss){
+-
+-	/*
+-	 * Compute Lprime  matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof. 
+-	 * For node i, Lpi can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Lpi=[ h    0    0   0]1
+-	 *		       [ 0    h    0   0]2
+-	 *		       [ h    0    0   0]3
+-	 *		       [ 0    h    0   0]4
+-	 *		       [ 0    0    h   0]5
+-	 *		       [ 0    0    h   0]6
+-	 *		       [ 0    0  dh/dz 0]7
+-	 *		       [ 0    0  dh/dz 0]8
+-	 *		       [ 0    0  dh/dz 0]9
+-	 *		       [dh/dz 0  dh/dx 0]0
+-	 *		       [ 0 dh/dz dh/dy 0]1
+-	 *           [ 0    0    0   h]2
+-	 *           [ 0    0    0   h]3
+-	 *           [ 0    0    0   h]4
+-	 *
+-	 *       Li=[ h    0    0   0]1
+-	 *	 	      [ 0    h    0   0]2
+-	 *		      [ 0    0    h   0]3
+-	 *		      [ 0    0    h   0]4
+-	 *	 	      [ h    0    0   0]5
+-	 *	 	      [ 0    h    0   0]6
+-	 *	 	      [ h    0    0   0]7
+-	 *	 	      [ 0    h    0   0]8
+-	 *		      [ 0    0    h   0]9
+-	 *		      [ 0    0    h   0]0
+-	 *		      [ 0    0    h   0]1
+-	 *	 	      [ h    0    0   0]2
+-	 *	 	      [ 0    h    0   0]3
+-	 *		      [ 0    0    h   0]4
+-	 * where h is the interpolation function for node i.
+-	 */
+-	int i;
+-	int num_dof=4;
+-
+-	IssmDouble l1l2l3[NUMNODESP1_2d];
+-	IssmDouble dh1dh6[3][NUMNODESP1];
+-
+-	/*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;
+-
+-	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list,gauss);
+-
+-	/*Build LprimeStokes: */
+-	for (i=0;i<3;i++){
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i)=l1l2l3[i]; //LprimeStokes[0][NDOF2*i]=dh1dh3[0][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+1)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+2)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+2)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+2)=dh1dh6[2][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+2)=dh1dh6[2][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*8+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*8+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*8+num_dof*i+2)=dh1dh6[2][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*8+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*9+num_dof*i)=dh1dh6[2][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*9+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*9+num_dof*i+2)=dh1dh6[0][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*9+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*10+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*10+num_dof*i+1)=dh1dh6[2][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*10+num_dof*i+2)=dh1dh6[1][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*10+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*11+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*11+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*11+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*11+num_dof*i+3)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*12+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*12+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*12+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*12+num_dof*i+3)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*13+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*13+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*13+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*13+num_dof*i+3)=l1l2l3[i];
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetLMacAyealStokes {{{*/
+-void PentaRef::GetLMacAyealStokes(IssmDouble* LStokes, GaussPenta* gauss){
+-	/*
+-	 * Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
+-	 * For node i, Li can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Li=[ h    0 ]
+-	 *	 	      [ 0    h ]
+-	 *	 	      [ h    0 ]
+-	 *	 	      [ 0    h ]
+-	 *	 	      [ h    0 ]
+-	 *	 	      [ 0    h ]
+-	 *	 	      [ h    0 ]
+-	 *	 	      [ 0    h ]
+-	 * where h is the interpolation function for node i.
+-	 */
+-
+-	int i;
+-	int num_dof=2;
+-
+-	IssmDouble l1l2l3[NUMNODESP1_2d];
+-
+-
+-	/*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;
+-
+-	/*Build LStokes: */
+-	for (i=0;i<3;i++){
+-		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i)=l1l2l3[i]; //LStokes[0][NDOF2*i]=dh1dh3[0][i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+1)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+1)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*4+num_dof*i)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+1)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*5+num_dof*i)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+1)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*6+num_dof*i)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+1)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*7+num_dof*i)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+1)=l1l2l3[i];
+-
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetLprimeMacAyealStokes {{{*/
+-void PentaRef::GetLprimeMacAyealStokes(IssmDouble* LprimeStokes, IssmDouble* xyz_list, GaussPenta* gauss){
+-
+-	/*
+-	 * Compute Lprime  matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof. 
+-	 * For node i, Lpi can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Lpi=[ h    0    0   0]
+-	 *		       [ 0    h    0   0]
+-	 *		       [ 0    0    h   0]
+-	 *		       [ 0    0    h   0]
+-	 *		       [ 0    0  dh/dz 0]
+-	 *		       [ 0    0  dh/dz 0]
+-	 *           [ 0    0    0   h]
+-	 *           [ 0    0    0   h]
+-	 * where h is the interpolation function for node i.
+-	 */
+-	int i;
+-	int num_dof=4;
+-
+-	IssmDouble l1l2l3[NUMNODESP1_2d];
+-	IssmDouble dh1dh6[3][NUMNODESP1];
+-
+-	/*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;
+-
+-	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list,gauss);
+-
+-	/*Build LprimeStokes: */
+-	for (i=0;i<3;i++){
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i)=l1l2l3[i]; //LprimeStokes[0][NDOF2*i]=dh1dh3[0][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+2)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+2)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+2)=dh1dh6[2][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+2)=dh1dh6[2][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+3)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+3)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+2)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+3)=l1l2l3[i];
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetLStokesMacAyeal {{{*/
+-void PentaRef::GetLStokesMacAyeal(IssmDouble* LStokes, GaussPenta* gauss){
+-	/*
+-	 * Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
+-	 * For node i, Li can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Li=[ h    0    0   0]
+-	 *	 	      [ 0    h    0   0]
+-	 *		      [ 0    0    h   0]
+-	 *		      [ 0    0    h   0]
+-	 * where h is the interpolation function for node i.
+-	 */
+-
+-	int i;
+-	int num_dof=4;
+-
+-	IssmDouble l1l2l3[NUMNODESP1_2d];
+-
+-
+-	/*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;
+-
+-	/*Build LStokes: */
+-	for (i=0;i<3;i++){
+-		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i)=l1l2l3[i]; //LStokes[0][NDOF2*i]=dh1dh3[0][i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+2)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+3)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+2)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+3)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+1)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+2)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+3)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+1)=0;
+-		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+2)=l1l2l3[i];
+-		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+3)=0;
+-
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetLprimeStokesMacAyeal {{{*/
+-void PentaRef::GetLprimeStokesMacAyeal(IssmDouble* LprimeStokes, IssmDouble* xyz_list, GaussPenta* gauss){
+-
+-	/*
+-	 * Compute Lprime  matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof. 
+-	 * For node i, Lpi can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Lpi=[ h    0 ]
+-	 *		       [ 0    h ]
+-	 *		       [ h    0 ]
+-	 *		       [ 0    h ]
+-	 * where h is the interpolation function for node i.
+-	 */
+-	int i;
+-	int num_dof=2;
+-
+-	IssmDouble l1l2l3[NUMNODESP1_2d];
+-	IssmDouble dh1dh6[3][NUMNODESP1];
+-
+-	/*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;
+-
+-	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list,gauss);
+-
+-	/*Build LprimeStokes: */
+-	for (i=0;i<3;i++){
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i)=l1l2l3[i]; //LprimeStokes[0][NDOF2*i]=dh1dh3[0][i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i)=l1l2l3[i];
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+1)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i)=0;
+-		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+1)=l1l2l3[i];
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetJacobian {{{*/
+-void PentaRef::GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussPenta* gauss){
+-
+-	int i,j;
+-
+-	/*The Jacobian is constant over the element, discard the gaussian points. 
+-	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
+-
+-	IssmDouble A1,A2,A3; //area coordinates
+-	IssmDouble xi,eta,zi; //parametric coordinates
+-
+-	IssmDouble x1,x2,x3,x4,x5,x6;
+-	IssmDouble y1,y2,y3,y4,y5,y6;
+-	IssmDouble z1,z2,z3,z4,z5,z6;
+-
+-	/*Figure out xi,eta and zi (parametric coordinates), for this gaussian point: */
+-	A1=gauss->coord1;
+-	A2=gauss->coord2;
+-	A3=gauss->coord3;
+-
+-	xi=A2-A1;
+-	eta=SQRT3*A3;
+-	zi=gauss->coord4;
+-
+-	x1=*(xyz_list+3*0+0);
+-	x2=*(xyz_list+3*1+0);
+-	x3=*(xyz_list+3*2+0);
+-	x4=*(xyz_list+3*3+0);
+-	x5=*(xyz_list+3*4+0);
+-	x6=*(xyz_list+3*5+0);
+-
+-	y1=*(xyz_list+3*0+1);
+-	y2=*(xyz_list+3*1+1);
+-	y3=*(xyz_list+3*2+1);
+-	y4=*(xyz_list+3*3+1);
+-	y5=*(xyz_list+3*4+1);
+-	y6=*(xyz_list+3*5+1);
+-
+-	z1=*(xyz_list+3*0+2);
+-	z2=*(xyz_list+3*1+2);
+-	z3=*(xyz_list+3*2+2);
+-	z4=*(xyz_list+3*3+2);
+-	z5=*(xyz_list+3*4+2);
+-	z6=*(xyz_list+3*5+2);
+-
+-	*(J+NDOF3*0+0)=0.25*(x1-x2-x4+x5)*zi+0.25*(-x1+x2-x4+x5);
+-	*(J+NDOF3*1+0)=SQRT3/12.0*(x1+x2-2*x3-x4-x5+2*x6)*zi+SQRT3/12.0*(-x1-x2+2*x3-x4-x5+2*x6);
+-	*(J+NDOF3*2+0)=SQRT3/12.0*(x1+x2-2*x3-x4-x5+2*x6)*eta+1/4*(x1-x2-x4+x5)*xi +0.25*(-x1+x5-x2+x4);
+-
+-	*(J+NDOF3*0+1)=0.25*(y1-y2-y4+y5)*zi+0.25*(-y1+y2-y4+y5);
+-	*(J+NDOF3*1+1)=SQRT3/12.0*(y1+y2-2*y3-y4-y5+2*y6)*zi+SQRT3/12.0*(-y1-y2+2*y3-y4-y5+2*y6);
+-	*(J+NDOF3*2+1)=SQRT3/12.0*(y1+y2-2*y3-y4-y5+2*y6)*eta+0.25*(y1-y2-y4+y5)*xi+0.25*(y4-y1+y5-y2);
+-
+-	*(J+NDOF3*0+2)=0.25*(z1-z2-z4+z5)*zi+0.25*(-z1+z2-z4+z5);
+-	*(J+NDOF3*1+2)=SQRT3/12.0*(z1+z2-2*z3-z4-z5+2*z6)*zi+SQRT3/12.0*(-z1-z2+2*z3-z4-z5+2*z6);
+-	*(J+NDOF3*2+2)=SQRT3/12.0*(z1+z2-2*z3-z4-z5+2*z6)*eta+0.25*(z1-z2-z4+z5)*xi+0.25*(-z1+z5-z2+z4);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetJacobianDeterminant {{{*/
+-void PentaRef::GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss){
+-	/*On a penta, Jacobian varies according to coordinates. We need to get the Jacobian, and take 
+-	 * the determinant of it: */
+-	IssmDouble J[3][3];
+-
+-	/*Get Jacobian*/
+-	GetJacobian(&J[0][0],xyz_list,gauss);
+-
+-	/*Get Determinant*/
+-	Matrix3x3Determinant(Jdet,&J[0][0]);
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetTriaJacobianDeterminant{{{*/
+-void PentaRef::GetTriaJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss){
+-	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+-	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
+-
+-	IssmDouble x1,x2,x3,y1,y2,y3,z1,z2,z3;
+-
+-	x1=*(xyz_list+3*0+0);
+-	y1=*(xyz_list+3*0+1);
+-	z1=*(xyz_list+3*0+2);
+-	x2=*(xyz_list+3*1+0);
+-	y2=*(xyz_list+3*1+1);
+-	z2=*(xyz_list+3*1+2);
+-	x3=*(xyz_list+3*2+0);
+-	y3=*(xyz_list+3*2+1);
+-	z3=*(xyz_list+3*2+2);
+-
+-	/*Jdet = norm( AB ^ AC ) / (2 * area of the reference triangle), with areaRef=sqrt(3) */
+-	*Jdet=SQRT3/6.0*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2.0)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2.0)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2.0),0.5);
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetSegmentJacobianDeterminant{{{*/
+-void PentaRef::GetSegmentJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss){
+-	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+-	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
+-
+-	IssmDouble x1,x2,y1,y2,z1,z2;
+-
+-	x1=*(xyz_list+3*0+0);
+-	y1=*(xyz_list+3*0+1);
+-	z1=*(xyz_list+3*0+2);
+-	x2=*(xyz_list+3*1+0);
+-	y2=*(xyz_list+3*1+1);
+-	z2=*(xyz_list+3*1+2);
+-
+-	*Jdet=1.0/2.0*sqrt(pow(x2-x1,2.) + pow(y2-y1,2.) + pow(z2-z1,2.));
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetJacobianInvert {{{*/
+-void PentaRef::GetJacobianInvert(IssmDouble* Jinv, IssmDouble* xyz_list,GaussPenta* gauss){
+-
+-	/*Jacobian*/
+-	IssmDouble J[3][3];
+-
+-	/*Call Jacobian routine to get the jacobian:*/
+-	GetJacobian(&J[0][0], xyz_list, gauss);
+-
+-	/*Invert Jacobian matrix: */
+-	Matrix3x3Invert(Jinv,&J[0][0]);
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetNodalFunctionsMINI{{{*/
+-void PentaRef::GetNodalFunctionsMINI(IssmDouble* l1l7, GaussPenta* gauss){
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-
+-	l1l7[0]=gauss->coord1*(1.0-gauss->coord4)/2.0;
+-	l1l7[1]=gauss->coord2*(1.0-gauss->coord4)/2.0;
+-	l1l7[2]=gauss->coord3*(1.0-gauss->coord4)/2.0;
+-	l1l7[3]=gauss->coord1*(1.0+gauss->coord4)/2.0;
+-	l1l7[4]=gauss->coord2*(1.0+gauss->coord4)/2.0;
+-	l1l7[5]=gauss->coord3*(1.0+gauss->coord4)/2.0;
+-	l1l7[6]=27*gauss->coord1*gauss->coord2*gauss->coord3*(1.0+gauss->coord4)*(1.0-gauss->coord4);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetNodalFunctionsMINIDerivatives{{{*/
+-void PentaRef::GetNodalFunctionsMINIDerivatives(IssmDouble* dh1dh7,IssmDouble* xyz_list, GaussPenta* gauss){
+-
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * actual coordinate system): */
+-
+-	int       i;
+-	IssmDouble    dh1dh7_ref[3][NUMNODESMINI];
+-	IssmDouble    Jinv[3][3];
+-
+-	/*Get derivative values with respect to parametric coordinate system: */
+-	GetNodalFunctionsMINIDerivativesReference(&dh1dh7_ref[0][0], gauss); 
+-
+-	/*Get Jacobian invert: */
+-	GetJacobianInvert(&Jinv[0][0], xyz_list, gauss);
+-
+-	/*Build dh1dh6: 
+-	 *
+-	 * [dhi/dx]= Jinv'*[dhi/dr]
+-	 * [dhi/dy]        [dhi/ds]
+-	 * [dhi/dz]        [dhi/dzeta]
+-	 */
+-
+-	for (i=0;i<NUMNODESMINI;i++){
+-		*(dh1dh7+NUMNODESMINI*0+i)=Jinv[0][0]*dh1dh7_ref[0][i]+Jinv[0][1]*dh1dh7_ref[1][i]+Jinv[0][2]*dh1dh7_ref[2][i];
+-		*(dh1dh7+NUMNODESMINI*1+i)=Jinv[1][0]*dh1dh7_ref[0][i]+Jinv[1][1]*dh1dh7_ref[1][i]+Jinv[1][2]*dh1dh7_ref[2][i];
+-		*(dh1dh7+NUMNODESMINI*2+i)=Jinv[2][0]*dh1dh7_ref[0][i]+Jinv[2][1]*dh1dh7_ref[1][i]+Jinv[2][2]*dh1dh7_ref[2][i];
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetNodalFunctionsMINIDerivativesReference{{{*/
+-void PentaRef::GetNodalFunctionsMINIDerivativesReference(IssmDouble* dl1dl7,GaussPenta* gauss){
+-
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * natural coordinate system) at the gaussian point. */
+-	IssmDouble r=gauss->coord2-gauss->coord1;
+-	IssmDouble s=-3.0/SQRT3*(gauss->coord1+gauss->coord2-2.0/3.0);
+-	IssmDouble zeta=gauss->coord4;
+-
+-	/*First nodal function: */
+-	*(dl1dl7+NUMNODESMINI*0+0)=-0.5*(1.0-zeta)/2.0;
+-	*(dl1dl7+NUMNODESMINI*1+0)=-SQRT3/6.0*(1.0-zeta)/2.0;
+-	*(dl1dl7+NUMNODESMINI*2+0)=-0.5*(-0.5*r-SQRT3/6.0*s+ONETHIRD);
+-
+-	/*Second nodal function: */
+-	*(dl1dl7+NUMNODESMINI*0+1)=0.5*(1.0-zeta)/2.0;
+-	*(dl1dl7+NUMNODESMINI*1+1)=-SQRT3/6.0*(1.0-zeta)/2.0;
+-	*(dl1dl7+NUMNODESMINI*2+1)=-0.5*(0.5*r-SQRT3/6.0*s+ONETHIRD);
+-
+-	/*Third nodal function: */
+-	*(dl1dl7+NUMNODESMINI*0+2)=0;
+-	*(dl1dl7+NUMNODESMINI*1+2)=SQRT3/3.0*(1.0-zeta)/2.0;
+-	*(dl1dl7+NUMNODESMINI*2+2)=-0.5*(SQRT3/3.0*s+ONETHIRD);
+-
+-	/*Fourth nodal function: */
+-	*(dl1dl7+NUMNODESMINI*0+3)=-0.5*(1.0+zeta)/2.0;
+-	*(dl1dl7+NUMNODESMINI*1+3)=-SQRT3/6.0*(1.0+zeta)/2.0;
+-	*(dl1dl7+NUMNODESMINI*2+3)=0.5*(-0.5*r-SQRT3/6.0*s+ONETHIRD);
+-
+-	/*Fith nodal function: */
+-	*(dl1dl7+NUMNODESMINI*0+4)=0.5*(1.0+zeta)/2.0;
+-	*(dl1dl7+NUMNODESMINI*1+4)=-SQRT3/6.0*(1.0+zeta)/2.0;
+-	*(dl1dl7+NUMNODESMINI*2+4)=0.5*(0.5*r-SQRT3/6.0*s+ONETHIRD);
+-
+-	/*Sixth nodal function: */
+-	*(dl1dl7+NUMNODESMINI*0+5)=0;
+-	*(dl1dl7+NUMNODESMINI*1+5)=SQRT3/3.0*(1.0+zeta)/2.0;
+-	*(dl1dl7+NUMNODESMINI*2+5)=0.5*(SQRT3/3.0*s+ONETHIRD);
+-
+-	/*Seventh nodal function: */
+-	*(dl1dl7+NUMNODESMINI*0+6)=9.0/2.0*r*(1.0+zeta)*(zeta-1.0)*(SQRT3*s+1.0);
+-	*(dl1dl7+NUMNODESMINI*1+6)=9.0/4.0*(1+zeta)*(1-zeta)*(SQRT3*pow(s,2.0)-2.0*s-SQRT3*pow(r,2.0));
+-	*(dl1dl7+NUMNODESMINI*2+6)=27*gauss->coord1*gauss->coord2*gauss->coord3*(-2.0*zeta);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetNodalFunctionsP1 {{{*/
+-void PentaRef::GetNodalFunctionsP1(IssmDouble* l1l6, GaussPenta* gauss){
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-
+-	l1l6[0]=gauss->coord1*(1-gauss->coord4)/2.0;
+-	l1l6[1]=gauss->coord2*(1-gauss->coord4)/2.0;
+-	l1l6[2]=gauss->coord3*(1-gauss->coord4)/2.0;
+-	l1l6[3]=gauss->coord1*(1+gauss->coord4)/2.0;
+-	l1l6[4]=gauss->coord2*(1+gauss->coord4)/2.0;
+-	l1l6[5]=gauss->coord3*(1+gauss->coord4)/2.0;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetNodalFunctionsP1Derivatives {{{*/
+-void PentaRef::GetNodalFunctionsP1Derivatives(IssmDouble* dh1dh6,IssmDouble* xyz_list, GaussPenta* gauss){
+-
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * actual coordinate system): */
+-	IssmDouble    dh1dh6_ref[NDOF3][NUMNODESP1];
+-	IssmDouble    Jinv[NDOF3][NDOF3];
+-
+-	/*Get derivative values with respect to parametric coordinate system: */
+-	GetNodalFunctionsP1DerivativesReference(&dh1dh6_ref[0][0], gauss); 
+-
+-	/*Get Jacobian invert: */
+-	GetJacobianInvert(&Jinv[0][0], xyz_list, gauss);
+-
+-	/*Build dh1dh3: 
+-	 *
+-	 * [dhi/dx]= Jinv*[dhi/dr]
+-	 * [dhi/dy]       [dhi/ds]
+-	 * [dhi/dz]       [dhi/dn]
+-	 */
+-
+-	for (int i=0;i<NUMNODESP1;i++){
+-		*(dh1dh6+NUMNODESP1*0+i)=Jinv[0][0]*dh1dh6_ref[0][i]+Jinv[0][1]*dh1dh6_ref[1][i]+Jinv[0][2]*dh1dh6_ref[2][i];
+-		*(dh1dh6+NUMNODESP1*1+i)=Jinv[1][0]*dh1dh6_ref[0][i]+Jinv[1][1]*dh1dh6_ref[1][i]+Jinv[1][2]*dh1dh6_ref[2][i];
+-		*(dh1dh6+NUMNODESP1*2+i)=Jinv[2][0]*dh1dh6_ref[0][i]+Jinv[2][1]*dh1dh6_ref[1][i]+Jinv[2][2]*dh1dh6_ref[2][i];
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetNodalFunctionsP1DerivativesReference {{{*/
+-void PentaRef::GetNodalFunctionsP1DerivativesReference(IssmDouble* dl1dl6,GaussPenta* gauss){
+-
+-	/*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 */
+-
+-	IssmDouble A1,A2,A3,z;
+-
+-	A1=gauss->coord1; _assert_(A1>=0 && A1<=1);//first area coordinate value. In term of xi and eta: A1=(1-xi)/2-eta/(2*SQRT3);
+-	A2=gauss->coord2; _assert_(A2>=0 && A2<=1);//second area coordinate value In term of xi and eta: A2=(1+xi)/2-eta/(2*SQRT3);
+-	A3=gauss->coord3; _assert_(A3>=0 && A3<=1);//third area coordinate value  In term of xi and eta: A3=y/SQRT3;
+-	z =gauss->coord4; _assert_(z>=-1 &&  z<=1);//fourth vertical coordinate value. Corresponding nodal function: (1-z)/2 and (1+z)/2
+-
+-	/*First nodal function derivatives. The corresponding nodal function is N=A1*(1-z)/2. Its derivatives follow*/
+-	*(dl1dl6+NUMNODESP1*0+0)=-0.5*(1.0-z)/2.0;
+-	*(dl1dl6+NUMNODESP1*1+0)=-0.5/SQRT3*(1.0-z)/2.0;
+-	*(dl1dl6+NUMNODESP1*2+0)=-0.5*A1;
+-
+-	/*Second nodal function: The corresponding nodal function is N=A2*(1-z)/2. Its derivatives follow*/
+-	*(dl1dl6+NUMNODESP1*0+1)=0.5*(1.0-z)/2.0;
+-	*(dl1dl6+NUMNODESP1*1+1)=-0.5/SQRT3*(1.0-z)/2.0;
+-	*(dl1dl6+NUMNODESP1*2+1)=-0.5*A2;
+-
+-	/*Third nodal function: The corresponding nodal function is N=A3*(1-z)/2. Its derivatives follow*/
+-	*(dl1dl6+NUMNODESP1*0+2)=0.0;
+-	*(dl1dl6+NUMNODESP1*1+2)=1.0/SQRT3*(1.0-z)/2.0;
+-	*(dl1dl6+NUMNODESP1*2+2)=-0.5*A3;
+-
+-	/*Fourth nodal function: The corresponding nodal function is N=A1*(1+z)/2. Its derivatives follow*/
+-	*(dl1dl6+NUMNODESP1*0+3)=-0.5*(1.0+z)/2.0;
+-	*(dl1dl6+NUMNODESP1*1+3)=-0.5/SQRT3*(1.0+z)/2.0;
+-	*(dl1dl6+NUMNODESP1*2+3)=0.5*A1;
+-
+-	/*Fifth nodal function: The corresponding nodal function is N=A2*(1+z)/2. Its derivatives follow*/
+-	*(dl1dl6+NUMNODESP1*0+4)=0.5*(1.0+z)/2.0;
+-	*(dl1dl6+NUMNODESP1*1+4)=-0.5/SQRT3*(1.0+z)/2.0;
+-	*(dl1dl6+NUMNODESP1*2+4)=0.5*A2;
+-
+-	/*Sixth nodal function: The corresponding nodal function is N=A3*(1+z)/2. Its derivatives follow*/
+-	*(dl1dl6+NUMNODESP1*0+5)=0.0;
+-	*(dl1dl6+NUMNODESP1*1+5)=1.0/SQRT3*(1.0+z)/2.0;
+-	*(dl1dl6+NUMNODESP1*2+5)=0.5*A3;
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetQuadNodalFunctions {{{*/
+-void PentaRef::GetQuadNodalFunctions(IssmDouble* l1l4,GaussPenta* gauss,int index1,int index2,int index3,int index4){
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-
+-	IssmDouble BasisFunctions[6];
+-
+-	GetNodalFunctionsP1(&BasisFunctions[0],gauss);
+-
+-	_assert_(index1>=0 && index1<6);
+-	_assert_(index2>=0 && index2<6);
+-	_assert_(index3>=0 && index3<6);
+-	_assert_(index4>=0 && index4<6);
+-
+-	l1l4[0]=BasisFunctions[index1];
+-	l1l4[1]=BasisFunctions[index2];
+-	l1l4[2]=BasisFunctions[index3];
+-	l1l4[3]=BasisFunctions[index4];
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetQuadJacobianDeterminant{{{*/
+-void PentaRef::GetQuadJacobianDeterminant(IssmDouble* Jdet,IssmDouble xyz_list[4][3],GaussPenta* gauss){
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-
+-	IssmDouble x1,x2,x3,x4,y1,y2,y3,y4,z1,z2,z3,z4;
+-
+-	x1=xyz_list[0][0];
+-	y1=xyz_list[0][1];
+-	z1=xyz_list[0][2];
+-	x2=xyz_list[1][0];
+-	y2=xyz_list[1][1];
+-	z2=xyz_list[1][2];
+-	x3=xyz_list[2][0];
+-	y3=xyz_list[2][1];
+-	z3=xyz_list[2][2];
+-	x4=xyz_list[3][0];
+-	y4=xyz_list[3][1];
+-	z4=xyz_list[3][2];
+-
+-	/*Jdet = (Area of the trapezoid)/(Area trapezoid ref) with AreaRef = 4*/
+-	/*Area of a trabezoid = altitude * (base1 + base2)/2 */
+-	*Jdet= pow(pow(x2-x1,2.) + pow(y2-y1,2.),0.5) * (z4-z1 + z3-z2)/8;
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetInputValue{{{*/
+-void PentaRef::GetInputValue(IssmDouble* pvalue,IssmDouble* plist,GaussPenta* gauss){
+-	/*P1 interpolation on Gauss point*/
+-
+-	/*intermediary*/
+-	IssmDouble l1l6[6];
+-
+-	/*nodal functions: */
+-	GetNodalFunctionsP1(&l1l6[0],gauss);
+-
+-	/*Assign output pointers:*/
+-	*pvalue=l1l6[0]*plist[0]+l1l6[1]*plist[1]+l1l6[2]*plist[2]+l1l6[3]*plist[3]+l1l6[4]*plist[4]+l1l6[5]*plist[5];
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaRef::GetInputDerivativeValue{{{*/
+-void PentaRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussPenta* gauss){
+-	/*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:
+-	 *   dp/dx=p_list[0]*dh1/dx+p_list[1]*dh2/dx+p_list[2]*dh3/dx+p_list[3]*dh4/dx+p_list[4]*dh5/dx+p_list[5]*dh6/dx;
+-	 *   dp/dy=p_list[0]*dh1/dy+p_list[1]*dh2/dy+p_list[2]*dh3/dy+p_list[3]*dh4/dy+p_list[4]*dh5/dy+p_list[5]*dh6/dy;
+-	 *   dp/dz=p_list[0]*dh1/dz+p_list[1]*dh2/dz+p_list[2]*dh3/dz+p_list[3]*dh4/dz+p_list[4]*dh5/dz+p_list[5]*dh6/dz;
+-	 *
+-	 *   p is a vector of size 3x1 already allocated.
+-	 */
+-	IssmDouble dh1dh6[3][NUMNODESP1];
+-
+-	/*Get nodal funnctions derivatives in actual coordinate system: */
+-	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list, gauss);
+-
+-	/*Assign output*/
+-	p[0]=plist[0]*dh1dh6[0][0]+plist[1]*dh1dh6[0][1]+plist[2]*dh1dh6[0][2]+plist[3]*dh1dh6[0][3]+plist[4]*dh1dh6[0][4]+plist[5]*dh1dh6[0][5];
+-	p[1]=plist[0]*dh1dh6[1][0]+plist[1]*dh1dh6[1][1]+plist[2]*dh1dh6[1][2]+plist[3]*dh1dh6[1][3]+plist[4]*dh1dh6[1][4]+plist[5]*dh1dh6[1][5];
+-	p[2]=plist[0]*dh1dh6[2][0]+plist[1]*dh1dh6[2][1]+plist[2]*dh1dh6[2][2]+plist[3]*dh1dh6[2][3]+plist[4]*dh1dh6[2][4]+plist[5]*dh1dh6[2][5];
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h	(revision 12822)
+@@ -1,239 +0,0 @@
+-/*! \file Tria.h 
+- *  \brief: header file for tria object
+- */
+-
+-#ifndef _TRIA_H_
+-#define _TRIA_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Element.h"
+-#include "./TriaHook.h"
+-#include "./TriaRef.h"
+-class Parameters;
+-class Inputs;
+-class IoModel;
+-class Node;
+-class Matice;
+-class Matpar;
+-class ElementMatrix;
+-class ElementVector;
+-
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-/*}}}*/
+-
+-class Tria: public Element,public TriaHook,public TriaRef{
+-
+-	public:
+-
+-		int  id;
+-		int  sid;
+-
+-		Node   **nodes;    // 3 nodes
+-		Matice  *matice;   // 1 material ice
+-		Matpar  *matpar;   // 1 material parameter
+-		int      horizontalneighborsids[3];
+-
+-		Parameters *parameters;   //pointer to solution parameters
+-		Inputs     *inputs;
+-		Results    *results;
+-
+-		/*Tria constructors, destructors {{{*/
+-		Tria();
+-		Tria(int tria_id,int tria_sid,int i, IoModel* iomodel,int nummodels);
+-		~Tria();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*Update virtual functions resolution: {{{*/
+-		void  InputUpdateFromSolution(IssmDouble* solutiong);
+-		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVector(int* vector, int name, int type);
+-		void  InputUpdateFromVector(bool* vector, int name, int type);
+-		#ifdef _HAVE_DAKOTA_
+-		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
+-		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nows, int ncols, int name, int type);
+-		#endif
+-		void  InputUpdateFromConstant(IssmDouble constant, int name);
+-		void  InputUpdateFromConstant(int constant, int name);
+-		void  InputUpdateFromConstant(bool constant, int name);
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel);
+-		/*}}}*/
+-		/*Element virtual functions definitions: {{{*/
+-		void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
+-		void   ComputeBasalStress(Vector* sigma_b);
+-		void   ComputeStrainRate(Vector* eps);
+-		void   ComputeStressTensor();
+-		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+-		void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+-		void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
+-		void   CreatePVector(Vector* pf);
+-		void   CreateJacobianMatrix(Matrix* Jff);
+-		void   Delta18oParameterization(void);
+-		int    GetNodeIndex(Node* node);
+-		int    Sid();
+-		bool   IsOnBed();
+-		bool   IsFloating(); 
+-		bool   IsNodeOnShelf(); 
+-		bool   IsNodeOnShelfFromFlags(IssmDouble* flags);
+-		bool   IsOnWater(); 
+-		void   GetSolutionFromInputs(Vector* solution);
+-		void   GetVectorFromInputs(Vector* vector, int name_enum);
+-		void   GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp);
+-		void   InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max);
+-		bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums);
+-		void   InputCreate(IssmDouble scalar,int name,int code);
+-		void   InputCreate(IssmDouble* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code);
+-		void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum=MeshElementsEnum);
+-		void   InputDuplicate(int original_enum,int new_enum);
+-		void   InputScale(int enum_type,IssmDouble scale_factor);
+-		void   InputToResult(int enum_type,int step,IssmDouble time);
+-		void   DeleteResults(void);
+-		void   MaterialUpdateFromTemperature(void){_error2_("not implemented yet");};
+-		void   MigrateGroundingLine(IssmDouble* oldfloating,IssmDouble* sheet_ungrounding);
+-		int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
+-		void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
+-		void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm);
+-		void   RequestedOutput(int output_enum,int step,IssmDouble time);
+-		void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results);
+-		void   PatchFill(int* pcount, Patch* patch);
+-		void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
+-		void   ProcessResultsUnits(void);
+-		void   ResetCoordinateSystem(void){_error2_("not implemented yet");};
+-		void	 SmbGradients();
+-		IssmDouble SurfaceArea(void);
+-		void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
+-		int    UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
+-		IssmDouble TimeAdapt();
+-		int*   GetHorizontalNeighboorSids(void);
+-		void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
+-
+-		#ifdef _HAVE_RESPONSES_
+-		IssmDouble IceVolume(void);
+-		IssmDouble TotalSmb(void);
+-		void   MinVel(IssmDouble* pminvel, bool process_units);
+-		void   MinVx(IssmDouble* pminvx, bool process_units);
+-		void   MinVy(IssmDouble* pminvy, bool process_units);
+-		void   MinVz(IssmDouble* pminvz, bool process_units);
+-		IssmDouble MassFlux(IssmDouble* segment,bool process_units);
+-		void   MaxAbsVx(IssmDouble* pmaxabsvx, bool process_units);
+-		void   MaxAbsVy(IssmDouble* pmaxabsvy, bool process_units);
+-		void   MaxAbsVz(IssmDouble* pmaxabsvz, bool process_units);
+-		void   ElementResponse(IssmDouble* presponse,int response_enum,bool process_units);
+-		void   MaxVel(IssmDouble* pmaxvel, bool process_units);
+-		void   MaxVx(IssmDouble* pmaxvx, bool process_units);
+-		void   MaxVy(IssmDouble* pmaxvy, bool process_units);
+-		void   MaxVz(IssmDouble* pmaxvz, bool process_units);
+-		#endif
+-
+-
+-		#ifdef _HAVE_CONTROL_
+-		IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index);
+-		void   GradientIndexing(int* indexing,int control_index);
+-		void   Gradj(Vector* gradient,int control_type,int control_index);
+-		void   GradjBGradient(Vector* gradient,int weight_index,int control_index);
+-		void   GradjBMacAyeal(Vector* gradient,int control_index);
+-		void   GradjDragMacAyeal(Vector* gradient,int control_index);
+-		void   GradjDragStokes(Vector* gradient,int control_index);
+-		void   GradjDragGradient(Vector* gradient,int weight_index,int control_index);
+-		void   GradjDhDtBalancedthickness(Vector* gradient,int control_index);
+-		void   GradjVxBalancedthickness(Vector* gradient,int control_index);
+-		void   GradjVyBalancedthickness(Vector* gradient,int control_index);
+-		void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
+-		void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
+-		void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index);
+-		void   ControlInputScaleGradient(int enum_type,IssmDouble scale);
+-		void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
+-		IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index);
+-		IssmDouble ThicknessAbsMisfit(     bool process_units,int weight_index);
+-		IssmDouble SurfaceAbsVelMisfit(    bool process_units,int weight_index);
+-		IssmDouble ThicknessAbsGradient(bool process_units,int weight_index);
+-		IssmDouble SurfaceRelVelMisfit(    bool process_units,int weight_index);
+-		IssmDouble SurfaceLogVelMisfit(    bool process_units,int weight_index);
+-		IssmDouble SurfaceLogVxVyMisfit(   bool process_units,int weight_index);
+-		IssmDouble SurfaceAverageVelMisfit(bool process_units,int weight_index);
+-		void   InputControlUpdate(IssmDouble scalar,bool save_parameter);
+-		#endif
+-
+-		/*}}}*/
+-		/*Tria specific routines:{{{*/
+-		ElementMatrix* CreateKMatrixBalancethickness(void);
+-		ElementMatrix* CreateKMatrixBalancethickness_DG(void);
+-		ElementMatrix* CreateKMatrixBalancethickness_CG(void);
+-		ElementMatrix* CreateKMatrixMelting(void);
+-		ElementMatrix* CreateKMatrixPrognostic(void);
+-		ElementMatrix* CreateKMatrixPrognostic_CG(void);
+-		ElementMatrix* CreateKMatrixPrognostic_DG(void);
+-		ElementMatrix* CreateKMatrixSlope(void);
+-		ElementVector* CreatePVectorBalancethickness(void);
+-		ElementVector* CreatePVectorBalancethickness_DG(void);
+-		ElementVector* CreatePVectorBalancethickness_CG(void);
+-		ElementVector* CreatePVectorPrognostic(void);
+-		ElementVector* CreatePVectorPrognostic_CG(void);
+-		ElementVector* CreatePVectorPrognostic_DG(void);
+-		ElementVector* CreatePVectorSlope(void);
+-		IssmDouble         GetArea(void);
+-		int            GetElementType(void);
+-		void	         GetDofList(int** pdoflist,int approximation_enum,int setenum);
+-		void	         GetDofList1(int* doflist);
+-		void           GetSidList(int* sidlist);
+-		void           GetConnectivityList(int* connectivity);
+-		void           GetInputListOnVertices(IssmDouble* pvalue,int enumtype);
+-		void           GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue);
+-		void           GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue,int index); //TO BE REMOVED
+-		void           GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
+-		void           GetStrainRate2d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input);
+-		void	         InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type);
+-		void	         InputUpdateFromSolutionPrognostic(IssmDouble* solution);
+-		bool	         IsInput(int name);
+-		void	         SetClone(int* minranks);
+-		void	         SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]);
+-		
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		ElementMatrix* CreateKMatrixDiagnosticMacAyeal(void);
+-		ElementMatrix* CreateKMatrixDiagnosticMacAyealViscous(void);
+-		ElementMatrix* CreateKMatrixDiagnosticMacAyealFriction(void);
+-		ElementMatrix* CreateKMatrixDiagnosticHutter(void);
+-		ElementVector* CreatePVectorDiagnosticMacAyeal(void);
+-		ElementVector* CreatePVectorDiagnosticHutter(void);
+-		ElementMatrix* CreateJacobianDiagnosticMacayeal(void);
+-		void	  GetSolutionFromInputsDiagnosticHoriz(Vector* solution);
+-		void	  GetSolutionFromInputsDiagnosticHutter(Vector* solution);
+-		void	  InputUpdateFromSolutionDiagnosticHoriz( IssmDouble* solution);
+-		void	  InputUpdateFromSolutionDiagnosticHutter( IssmDouble* solution);
+-		#endif
+-
+-		#ifdef _HAVE_CONTROL_
+-		ElementMatrix* CreateKMatrixAdjointBalancethickness(void);
+-		ElementMatrix* CreateKMatrixAdjointMacAyeal(void);
+-		ElementVector* CreatePVectorAdjointHoriz(void);
+-		ElementVector* CreatePVectorAdjointStokes(void);
+-		ElementVector* CreatePVectorAdjointBalancethickness(void);
+-		void	  InputUpdateFromSolutionAdjointBalancethickness( IssmDouble* solution);
+-		void	  InputUpdateFromSolutionAdjointHoriz( IssmDouble* solution);
+-		#endif
+-
+-		#ifdef _HAVE_HYDROLOGY_
+-		ElementMatrix* CreateKMatrixHydrology(void);
+-		ElementVector* CreatePVectorHydrology(void);
+-		void      CreateHydrologyWaterVelocityInput(void);
+-		void	  GetSolutionFromInputsHydrology(Vector* solution);
+-		void	  InputUpdateFromSolutionHydrology(IssmDouble* solution);
+-		#endif
+-		#ifdef _HAVE_BALANCED_
+-		#endif
+-
+-		/*}}}*/
+-
+-};
+-#endif  /* _TRIA_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaHook.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaHook.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaHook.h	(revision 12822)
+@@ -1,31 +0,0 @@
+-/*!\file: TriaHook.h
+- * \brief prototypes for TriaHook.h
+- */ 
+-
+-#ifndef _TRIAHOOK_H_
+-#define  _TRIAHOOK_H_
+-
+-class Hook;
+-class IoModel;
+-
+-class TriaHook{
+-
+-	public: 
+-		int    numanalyses; //number of analysis types
+-		Hook** hnodes; // 3 nodes for each analysis type
+-		Hook*  hmatice; // 1 ice material
+-		Hook*  hmatpar; // 1 material parameter
+-
+-
+-		/*FUNCTION constructors, destructors {{{*/
+-		TriaHook();
+-		TriaHook(int in_numanalyses,int matice_id, IoModel* iomodel);
+-		~TriaHook();
+-		void SetHookNodes(int* node_ids,int analysis_counter);
+-		/*}}}*/
+-
+-};
+-
+-
+-#endif //ifndef _TRIAHOOK_H_
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12822)
+@@ -1,8784 +0,0 @@
+-/*!\file Penta.cpp
+- * \brief: implementation of the Penta object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../Container/Container.h"
+-/*}}}*/
+-
+-/*Element macros*/
+-#define NUMVERTICES   6
+-#define NUMVERTICES2D 3
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION Penta::Penta(){{{*/
+-Penta::Penta(){
+-
+-	int i;
+-
+-	this->nodes=NULL;
+-	this->matice=NULL;
+-	this->matpar=NULL;
+-	this->verticalneighbors=NULL;
+-	this->inputs=NULL;
+-	this->parameters=NULL;
+-	this->results=NULL;
+-	for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::~Penta(){{{*/
+-Penta::~Penta(){
+-	delete inputs;
+-	delete results;
+-	this->parameters=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::Penta(int id, int index, IoModel* iomodel,int nummodels) {{{*/
+-Penta::Penta(int penta_id, int penta_sid, int index, IoModel* iomodel,int nummodels)
+-	:PentaRef(nummodels)
+-	,PentaHook(nummodels,index+1,iomodel) //index+1: matice id, iomodel->numberofelements+1: matpar id
+-                                                                      { //i is the element index
+-
+-	int i;
+-	int penta_elements_ids[2];
+-
+-	/*Checks in debugging mode*/
+-	/*{{{*/
+-	_assert_(iomodel->Data(MeshUpperelementsEnum));
+-	_assert_(iomodel->Data(MeshLowerelementsEnum));
+-	/*}}}*/
+-
+-	/*id: */
+-	this->id=penta_id;
+-	this->sid=penta_sid;
+-
+-	/*Build neighbors list*/
+-	if (xIsNan<IssmDouble>(iomodel->Data(MeshUpperelementsEnum)[index])) penta_elements_ids[1]=this->id; //upper penta is the same penta
+-	else                                    penta_elements_ids[1]=(int)(iomodel->Data(MeshUpperelementsEnum)[index]);
+-	if (xIsNan<IssmDouble>(iomodel->Data(MeshLowerelementsEnum)[index])) penta_elements_ids[0]=this->id; //lower penta is the same penta
+-	else                                    penta_elements_ids[0]=(int)(iomodel->Data(MeshLowerelementsEnum)[index]);
+-	this->InitHookNeighbors(penta_elements_ids);
+-
+-	/*Build horizontalneighborsids list: */
+-	_assert_(iomodel->Data(MeshElementconnectivityEnum));
+-	for(i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->Data(MeshElementconnectivityEnum)[3*index+i]-1;
+-
+-	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
+-	this->parameters=NULL;
+-
+-	/*intialize inputs and results: */
+-	this->inputs=new Inputs();
+-	this->results=new Results();
+-	
+-	/*initialize pointers:*/
+-	this->nodes=NULL;
+-	this->matice=NULL;
+-	this->matpar=NULL;
+-	this->verticalneighbors=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::copy {{{*/
+-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];
+-
+-	//deal with PentaHook mother class
+-	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->hmatice=(Hook*)this->hmatice->copy();
+-	penta->hmatpar=(Hook*)this->hmatpar->copy();
+-	penta->hneighbors=(Hook*)this->hneighbors->copy();
+-
+-	/*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();
+-	}
+-	if(this->results){
+-		penta->results=(Results*)this->results->Copy();
+-	}
+-	else{
+-		penta->results=new Results();
+-	}
+-	/*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->matice=(Matice*)penta->hmatice->delivers();
+-	penta->matpar=(Matpar*)penta->hmatpar->delivers();
+-	penta->verticalneighbors=(Penta**)penta->hneighbors->deliverp();
+-
+-	/*neighbors: */
+-	for(i=0;i<3;i++)penta->horizontalneighborsids[i]=this->horizontalneighborsids[i];
+-
+-	return penta;
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION Penta::AverageOntoPartition {{{*/
+-void  Penta::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
+-	_error2_("Not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Penta::BedNormal {{{*/
+-void Penta::BedNormal(IssmDouble* bed_normal, IssmDouble xyz_list[3][3]){
+-
+-	int i;
+-	IssmDouble v13[3],v23[3];
+-	IssmDouble normal[3];
+-	IssmDouble normal_norm;
+-
+-	for (i=0;i<3;i++){
+-		v13[i]=xyz_list[0][i]-xyz_list[2][i];
+-		v23[i]=xyz_list[1][i]-xyz_list[2][i];
+-	}
+-
+-	normal[0]=v13[1]*v23[2]-v13[2]*v23[1];
+-	normal[1]=v13[2]*v23[0]-v13[0]*v23[2];
+-	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
+-	normal_norm=sqrt( pow(normal[0],2)+pow(normal[1],2)+pow(normal[2],2) );
+-
+-	/*Bed normal is opposite to surface normal*/
+-	*(bed_normal)=-normal[0]/normal_norm;
+-	*(bed_normal+1)=-normal[1]/normal_norm;
+-	*(bed_normal+2)=-normal[2]/normal_norm;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::BasalFrictionCreateInput {{{*/
+-void Penta::BasalFrictionCreateInput(void){
+-
+-	/*Constants*/
+-	const int  numdof=NUMVERTICES*NDOF1;
+-
+-	/*Intermediaries */
+-	int    count,ig;
+-	IssmDouble basalfriction[NUMVERTICES]={0,0,0,0,0,0};
+-	IssmDouble alpha2,vx,vy;
+-	Friction*  friction=NULL;
+-	GaussPenta* gauss=NULL;
+-
+-
+-	/* Basal friction can only be found at the base of an ice sheet: */
+-	if (!IsOnBed() || IsFloating()){
+-		//empty friction: 
+-		this->inputs->AddInput(new PentaP1Input(BasalFrictionEnum,&basalfriction[0]));
+-		return;
+-	}
+-
+-	/*Retrieve all inputs and parameters*/
+-	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);
+-
+-
+-	/*Build friction element, needed later: */
+-	friction=new Friction("3d",inputs,matpar,DiagnosticHorizAnalysisEnum);
+-
+-	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
+-	gauss=new GaussPenta(0,1,2,2);
+-	count=0;
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		basalfriction[count]=alpha2*(pow(vx,2.0)+pow(vy,2.0));
+-		count++;
+-	}
+-	
+-	/*Create PentaVertex input, which will hold the basal friction:*/
+-	this->inputs->AddInput(new PentaP1Input(BasalFrictionEnum,&basalfriction[0]));
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ComputeBasalStress {{{*/
+-void  Penta::ComputeBasalStress(Vector* sigma_b){
+-
+-	int         i,j,ig;
+-	int         dofv[3]={0,1,2};
+-	int         dofp[1]={3};
+-	int         analysis_type,approximation;
+-	int         doflist[NUMVERTICES];
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      xyz_list_tria[3][3];
+-	IssmDouble      rho_ice,gravity,stokesreconditioning;
+-	IssmDouble      pressure,viscosity,bed,Jdet2d;
+-	IssmDouble      bed_normal[3];
+-	IssmDouble      basalforce[3];
+-	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
+-	IssmDouble      devstresstensor[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
+-	IssmDouble      stresstensor[6]={0.0};
+-	IssmDouble      sigma_xx,sigma_yy,sigma_zz;
+-	IssmDouble      sigma_xy,sigma_xz,sigma_yz;
+-	IssmDouble      surface=0,value=0;
+-	GaussPenta* gauss;
+-
+-	/*retrive parameters: */
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	/*Check analysis_types*/
+-	if (analysis_type!=DiagnosticHorizAnalysisEnum) _error2_("Not supported yet!");
+-	if (approximation!=StokesApproximationEnum) _error2_("Not supported yet!");
+-
+-	/*retrieve some parameters: */
+-	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	
+-	if(!IsOnBed()){
+-		//put zero
+-		sigma_b->SetValue(id-1,0.0,INS_VAL);
+-		return;
+-	}
+-
+-	/*recovre material parameters: */
+-	rho_ice=matpar->GetRhoIce();
+-	gravity=matpar->GetG();
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<3;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-
+-	/*Retrieve all inputs we will be needing: */
+-	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_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);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/*Compute strain rate viscosity and pressure: */
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-		pressure_input->GetInputValue(&pressure,gauss);
+-
+-		/*Compute Stress*/
+-		sigma_xx=2*viscosity*epsilon[0]-pressure*stokesreconditioning; // sigma = nu eps - pressure
+-		sigma_yy=2*viscosity*epsilon[1]-pressure*stokesreconditioning;
+-		sigma_zz=2*viscosity*epsilon[2]-pressure*stokesreconditioning;
+-		sigma_xy=2*viscosity*epsilon[3];
+-		sigma_xz=2*viscosity*epsilon[4];
+-		sigma_yz=2*viscosity*epsilon[5];
+-
+-		/*Get normal vector to the bed */
+-		BedNormal(&bed_normal[0],xyz_list_tria);
+-
+-		/*basalforce*/
+-		basalforce[0] += sigma_xx*bed_normal[0] + sigma_xy*bed_normal[1] + sigma_xz*bed_normal[2];
+-		basalforce[1] += sigma_xy*bed_normal[0] + sigma_yy*bed_normal[1] + sigma_yz*bed_normal[2];
+-		basalforce[2] += sigma_xz*bed_normal[0] + sigma_yz*bed_normal[1] + sigma_zz*bed_normal[2];
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
+-		value+=sigma_zz*Jdet2d*gauss->weight;
+-		surface+=Jdet2d*gauss->weight;
+-	}
+-	value=value/surface;
+-
+-	/*Add value to output*/
+-	sigma_b->SetValue(id-1,value,INS_VAL);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ComputeStrainRate {{{*/
+-void  Penta::ComputeStrainRate(Vector* eps){
+-
+-	_error2_("Not implemented yet");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ComputeStressTensor {{{*/
+-void  Penta::ComputeStressTensor(){
+-
+-	int         iv;
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      pressure,viscosity;
+-	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,exy];*/
+-	IssmDouble      sigma_xx[NUMVERTICES];
+-	IssmDouble		sigma_yy[NUMVERTICES];
+-	IssmDouble		sigma_zz[NUMVERTICES];
+-	IssmDouble      sigma_xy[NUMVERTICES];
+-	IssmDouble		sigma_xz[NUMVERTICES];
+-	IssmDouble		sigma_yz[NUMVERTICES];
+-	GaussPenta* gauss=NULL;
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_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);
+-
+-	/* 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->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3d(&viscosity,&epsilon[0]);
+-		pressure_input->GetInputValue(&pressure,gauss);
+-
+-		/*Compute Stress*/
+-		sigma_xx[iv]=2*viscosity*epsilon[0]-pressure; // sigma = nu eps - pressure
+-		sigma_yy[iv]=2*viscosity*epsilon[1]-pressure;
+-		sigma_zz[iv]=2*viscosity*epsilon[2]-pressure;
+-		sigma_xy[iv]=2*viscosity*epsilon[3];
+-		sigma_xz[iv]=2*viscosity*epsilon[4];
+-		sigma_yz[iv]=2*viscosity*epsilon[5];
+-	}
+-	
+-	/*Add Stress tensor components into inputs*/
+-	this->inputs->AddInput(new PentaP1Input(StressTensorxxEnum,&sigma_xx[0]));
+-	this->inputs->AddInput(new PentaP1Input(StressTensorxyEnum,&sigma_xy[0]));
+-	this->inputs->AddInput(new PentaP1Input(StressTensorxzEnum,&sigma_xz[0]));
+-	this->inputs->AddInput(new PentaP1Input(StressTensoryyEnum,&sigma_yy[0]));
+-	this->inputs->AddInput(new PentaP1Input(StressTensoryzEnum,&sigma_yz[0]));
+-	this->inputs->AddInput(new PentaP1Input(StressTensorzzEnum,&sigma_zz[0]));
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-		/*FUNCTION Penta::Configure {{{*/
+-void  Penta::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
+-
+-	int analysis_counter;
+-	
+-	/*go into parameters and get the analysis_counter: */
+-	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
+-
+-	/*Get Element type*/
+-	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);
+-	this->hmatice->configure(materialsin);
+-	this->hmatpar->configure(materialsin);
+-	this->hneighbors->configure(elementsin);
+-
+-	/*Now, go pick up the objects inside the hooks: */
+-	if (this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
+-	else this->nodes=NULL;
+-	this->matice=(Matice*)this->hmatice->delivers();
+-	this->matpar=(Matpar*)this->hmatpar->delivers();
+-	this->verticalneighbors=(Penta**)this->hneighbors->deliverp();
+-
+-	/*point parameters to real dataset: */
+-	this->parameters=parametersin;
+-
+-	/*get inputs configured too: */
+-	this->inputs->Configure(parameters);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrix {{{*/
+-void  Penta::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){
+-
+-	/*retrieve parameters: */
+-	ElementMatrix* Ke=NULL;
+-	ElementVector* De=NULL;
+-	int analysis_type;
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*Checks in debugging {{{*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
+-	/*}}}*/
+-	
+-	/*Skip if water element*/
+-	if(IsOnWater()) return;
+-
+-	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		case DiagnosticHorizAnalysisEnum:
+-			Ke=CreateKMatrixDiagnosticHoriz(); De=CreateDVectorDiagnosticHoriz();
+-			break;
+-		case AdjointHorizAnalysisEnum:
+-			Ke=CreateKMatrixAdjointHoriz();
+-			break;
+-		case DiagnosticHutterAnalysisEnum:
+-			Ke=CreateKMatrixDiagnosticHutter();
+-			break;
+-		case DiagnosticVertAnalysisEnum:
+-			Ke=CreateKMatrixDiagnosticVert();
+-			break;
+-		#endif
+-		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
+-			Ke=CreateKMatrixSlope();
+-			break;
+-		case PrognosticAnalysisEnum:
+-			Ke=CreateKMatrixPrognostic();
+-			break;
+-		#ifdef _HAVE_BALANCED_
+-		case BalancethicknessAnalysisEnum:
+-			Ke=CreateKMatrixBalancethickness();
+-			break;
+-		#endif
+-		#ifdef _HAVE_THERMAL_
+-		case ThermalAnalysisEnum:
+-			Ke=CreateKMatrixThermal();
+-			break;
+-		case EnthalpyAnalysisEnum:
+-			Ke=CreateKMatrixEnthalpy();
+-			break;
+-		case MeltingAnalysisEnum:
+-			Ke=CreateKMatrixMelting();
+-			break;
+-		#endif
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global matrix*/
+-	if(Ke){
+-		Ke->AddToGlobal(Kff,Kfs);
+-		delete Ke;
+-	}
+-	/*Add to global Vector*/
+-	if(De){
+-		De->InsertIntoGlobal(df);
+-		delete De;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixPrognostic {{{*/
+-ElementMatrix* Penta::CreateKMatrixPrognostic(void){
+-
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Depth Averaging Vx and Vy*/
+-	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
+-	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
+-
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementMatrix* Ke=tria->CreateKMatrixPrognostic();
+-	delete tria->matice; delete tria;
+-
+-	/*Delete Vx and Vy averaged*/
+-	this->inputs->DeleteInput(VxAverageEnum);
+-	this->inputs->DeleteInput(VyAverageEnum);
+-
+-	/*clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixSlope {{{*/
+-ElementMatrix* Penta::CreateKMatrixSlope(void){
+-
+-	if (!IsOnBed()) return NULL;
+-
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementMatrix* Ke=tria->CreateKMatrixSlope();
+-	delete tria->matice; delete tria;
+-
+-	/*clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVector {{{*/
+-void  Penta::CreatePVector(Vector* pf){
+-
+-	/*retrive parameters: */
+-	ElementVector* pe=NULL;
+-	int analysis_type;
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*if debugging mode, check that all pointers exist {{{*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
+-	/*}}}*/
+-
+-	/*Skip if water element*/
+-	if(IsOnWater()) return;
+-
+-	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		case DiagnosticHorizAnalysisEnum:
+-			pe=CreatePVectorDiagnosticHoriz();
+-			break;
+-		case DiagnosticHutterAnalysisEnum:
+-			pe=CreatePVectorDiagnosticHutter();
+-			break;
+-		case DiagnosticVertAnalysisEnum:
+-			pe=CreatePVectorDiagnosticVert();
+-			break;
+-		#endif
+-	 	#ifdef _HAVE_CONTROL_
+-		case AdjointHorizAnalysisEnum:
+-			pe=CreatePVectorAdjointHoriz();
+-			break;
+-		#endif
+-		#ifdef _HAVE_THERMAL_
+-		case ThermalAnalysisEnum:
+-			pe=CreatePVectorThermal();
+-			break;
+-		case EnthalpyAnalysisEnum:
+-			pe=CreatePVectorEnthalpy();
+-			break;
+-		case MeltingAnalysisEnum:
+-			pe=CreatePVectorMelting();
+-			break;
+-		#endif
+-		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
+-			pe=CreatePVectorSlope();
+-			break;
+-		case PrognosticAnalysisEnum:
+-			pe=CreatePVectorPrognostic();
+-			break;
+-		#ifdef _HAVE_BALANCED_
+-		case BalancethicknessAnalysisEnum:
+-			pe=CreatePVectorBalancethickness();
+-			break;
+-		#endif
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global Vector*/
+-	if(pe){
+-		pe->AddToGlobal(pf);
+-		delete pe;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorPrognostic {{{*/
+-ElementVector* Penta::CreatePVectorPrognostic(void){
+-
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Depth Averaging Vx and Vy*/
+-	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
+-	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
+-
+-	/*Call Tria function*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementVector* pe=tria->CreatePVectorPrognostic();
+-	delete tria->matice; delete tria;
+-
+-	/*Delete Vx and Vy averaged*/
+-	this->inputs->DeleteInput(VxAverageEnum);
+-	this->inputs->DeleteInput(VyAverageEnum);
+-
+-	/*Clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorSlope {{{*/
+-ElementVector* Penta::CreatePVectorSlope(void){
+-
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Call Tria function*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementVector* pe=tria->CreatePVectorSlope();
+-	delete tria->matice; delete tria;
+-
+-	/*clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateJacobianMatrix{{{*/
+-void  Penta::CreateJacobianMatrix(Matrix* Jff){
+-
+-	/*retrieve parameters: */
+-	ElementMatrix* Ke=NULL;
+-	int analysis_type;
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*Checks in debugging {{{*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
+-	/*}}}*/
+-
+-	/*Skip if water element*/
+-	if(IsOnWater()) return;
+-
+-	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-#ifdef _HAVE_DIAGNOSTIC_
+-		case DiagnosticHorizAnalysisEnum:
+-			Ke=CreateJacobianDiagnosticHoriz();
+-			break;
+-#endif
+-		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-
+-	/*Add to global matrix*/
+-	if(Ke){
+-		Ke->AddToGlobal(Jff);
+-		delete Ke;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::DeepEcho{{{*/
+-void Penta::DeepEcho(void){
+-
+-	int i;
+-	
+-	_printLine_("Penta:");
+-	_printLine_("   id: " << id);
+-	nodes[0]->DeepEcho();
+-	nodes[1]->DeepEcho();
+-	nodes[2]->DeepEcho();
+-	nodes[3]->DeepEcho();
+-	nodes[4]->DeepEcho();
+-	nodes[5]->DeepEcho();
+-	matice->DeepEcho();
+-	matpar->DeepEcho();
+-	_printLine_("   neighbor ids: " << verticalneighbors[0]->Id() << "-" << verticalneighbors[1]->Id());
+-	_printLine_("   parameters");
+-	parameters->DeepEcho();
+-	_printLine_("   inputs");
+-	inputs->DeepEcho();
+-	_printLine_("   results");
+-	results->DeepEcho();
+-	_printLine_("neighboor sids: ");
+-	_printLine_(" " << horizontalneighborsids[0] << " " << horizontalneighborsids[1] << " " << horizontalneighborsids[2]);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::DeleteResults {{{*/
+-void  Penta::DeleteResults(void){
+-
+-	/*Delete and reinitialize results*/
+-	delete this->results;
+-	this->results=new Results();
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::Delta18oParameterization{{{*/
+-void  Penta::Delta18oParameterization(void){
+-
+-	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+-	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
+-	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
+-	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
+-	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
+-	IssmDouble time,yts,finaltime;
+-	this->parameters->FindParam(&time,TimeEnum);
+-	this->parameters->FindParam(&yts,ConstantsYtsEnum);
+-	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+-
+-	/*Recover present day temperature and precipitation*/
+-	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
+-	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
+-	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
+-	GaussPenta* gauss=new GaussPenta();
+-	for(int month=0;month<12;month++) {
+-		for(int iv=0;iv<NUMVERTICES;iv++) {
+-			gauss->GaussVertex(iv);
+-			input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);
+-			input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
+-			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
+-			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
+-		}
+-	}
+-
+-	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
+-	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
+-	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
+-	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
+-	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
+-	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
+-	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
+-
+-	/*Compute the temperature and precipitation*/
+-	for(int iv=0;iv<NUMVERTICES;iv++){
+-		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
+-					Delta18oPresent, Delta18oLgm, Delta18oTime,
+-					&PrecipitationsPresentday[iv][0], 
+-					&TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 
+-					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
+-	}
+-
+-	/*Update inputs*/ 
+-	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
+-	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
+-	for (int imonth=0;imonth<12;imonth++) {
+-		for(int iv=0;iv<NUMVERTICES;iv++) {
+-			PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
+-			NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
+-			PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
+-			NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
+-		}
+-	}
+-	this->inputs->AddInput(NewTemperatureInput);
+-	this->inputs->AddInput(NewPrecipitationInput);
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::Echo{{{*/
+-
+-void Penta::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ObjectEnum{{{*/
+-int Penta::ObjectEnum(void){
+-
+-	return PentaEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetBasalElement{{{*/
+-Penta* Penta::GetBasalElement(void){
+-
+-	/*Output*/
+-	Penta* penta=NULL;
+-
+-	/*Go through all elements till the bed is reached*/
+-	penta=this;
+-	for(;;){
+-		/*Stop if we have reached the surface, else, take lower penta*/
+-		if (penta->IsOnBed()) break;
+-
+-		/* get lower Penta*/
+-		penta=penta->GetLowerElement();
+-		_assert_(penta->Id()!=this->id);
+-	}
+-
+-	/*return output*/
+-	return penta;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetDofList {{{*/
+-void  Penta::GetDofList(int** pdoflist,int approximation_enum,int setenum){
+-
+-	int  i,j,count=0;
+-	int  numberofdofs=0;
+-	int* doflist=NULL;
+-
+-	/*First, figure out size of doflist: */
+-	for(i=0;i<6;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+-
+-	/*Allocate: */
+-	doflist=xNew<int>(numberofdofs);
+-
+-	/*Populate: */
+-	count=0;
+-	for(i=0;i<6;i++){
+-		nodes[i]->GetDofList(doflist+count,approximation_enum,setenum);
+-		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+-	}
+-
+-	/*Assign output pointers:*/
+-	*pdoflist=doflist;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetDofList1 {{{*/
+-void  Penta::GetDofList1(int* doflist){
+-
+-	int i;
+-	for(i=0;i<6;i++) doflist[i]=nodes[i]->GetDofList1();
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetConnectivityList {{{*/
+-void  Penta::GetConnectivityList(int* connectivity){
+-	for(int i=0;i<NUMVERTICES;i++) connectivity[i]=nodes[i]->GetConnectivity();
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetElementType {{{*/
+-int Penta::GetElementType(){
+-
+-	/*return PentaRef field*/
+-	return this->element_type;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetElementSizes{{{*/
+-void Penta::GetElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){
+-
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble xmin,ymin,zmin;
+-	IssmDouble xmax,ymax,zmax;
+-
+-	/*Get xyz list: */
+-	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES);
+-	xmin=xyz_list[0][0]; xmax=xyz_list[0][0];
+-	ymin=xyz_list[0][1]; ymax=xyz_list[0][1];
+-	zmin=xyz_list[0][2]; zmax=xyz_list[0][2];
+-
+-	for(int i=1;i<NUMVERTICES;i++){
+-		if(xyz_list[i][0]<xmin) xmin=xyz_list[i][0];
+-		if(xyz_list[i][0]>xmax) xmax=xyz_list[i][0];
+-		if(xyz_list[i][1]<ymin) ymin=xyz_list[i][1];
+-		if(xyz_list[i][1]>ymax) ymax=xyz_list[i][1];
+-		if(xyz_list[i][2]<zmin) zmin=xyz_list[i][2];
+-		if(xyz_list[i][2]>zmax) zmax=xyz_list[i][2];
+-	}
+-
+-	*hx=xmax-xmin;
+-	*hy=ymax-ymin;
+-	*hz=zmax-zmin;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetHorizontalNeighboorSids {{{*/
+-int* Penta::GetHorizontalNeighboorSids(){
+-
+-	/*return PentaRef field*/
+-	return &this->horizontalneighborsids[0];
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetLowerElement{{{*/
+-Penta* Penta::GetLowerElement(void){
+-
+-	Penta* upper_penta=NULL;
+-
+-	upper_penta=(Penta*)verticalneighbors[0]; //first one (0) under, second one (1) above
+-
+-	return upper_penta;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetNodeIndex {{{*/
+-int Penta::GetNodeIndex(Node* node){
+-
+-	_assert_(nodes);
+-	for(int i=0;i<NUMVERTICES;i++){
+-		if(node==nodes[i])
+-		 return i;
+-	}
+-	_error2_("Node provided not found among element nodes");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetInputListOnVertices(IssmDouble* pvalue,int enumtype) {{{*/
+-void Penta::GetInputListOnVertices(IssmDouble* pvalue,int enumtype){
+-
+-	/*Intermediaries*/
+-	IssmDouble     value[NUMVERTICES];
+-	GaussPenta *gauss              = NULL;
+-
+-	/*Recover input*/
+-	Input* input=inputs->GetInput(enumtype);
+-	if (!input) _error2_("Input " << EnumToStringx(enumtype) << " not found in element");
+-
+-	/*Checks in debugging mode*/
+-	_assert_(pvalue);
+-
+-	/* Start looping on the number of vertices: */
+-	gauss=new GaussPenta();
+-	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
+-		input->GetInputValue(&pvalue[iv],gauss);
+-	}
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue) {{{*/
+-void Penta::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue){
+-
+-	/*Intermediaries*/
+-	IssmDouble     value[NUMVERTICES];
+-	GaussPenta *gauss              = NULL;
+-
+-	/*Recover input*/
+-	Input* input=inputs->GetInput(enumtype);
+-
+-	/*Checks in debugging mode*/
+-	_assert_(pvalue);
+-
+-	/* Start looping on the number of vertices: */
+-	if (input){
+-		gauss=new GaussPenta();
+-		for (int iv=0;iv<NUMVERTICES;iv++){
+-			gauss->GaussVertex(iv);
+-			input->GetInputValue(&pvalue[iv],gauss);
+-		}
+-	}
+-	else{
+-		for (int iv=0;iv<NUMVERTICES;iv++) pvalue[iv]=defaultvalue;
+-	}
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetInputValue(IssmDouble* pvalue,Node* node,int enumtype) {{{*/
+-void Penta::GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){
+-
+-	Input* input=inputs->GetInput(enumtype);
+-	if(!input) _error2_("No input of type " << EnumToStringx(enumtype) << " found in tria");
+-
+-	GaussPenta* gauss=new GaussPenta();
+-	gauss->GaussVertex(this->GetNodeIndex(node));
+-
+-	input->GetInputValue(pvalue,gauss);
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetPhi {{{*/
+-void Penta::GetPhi(IssmDouble* phi, IssmDouble*  epsilon, IssmDouble viscosity){
+-	/*Compute deformational heating from epsilon and viscosity */
+-
+-	IssmDouble epsilon_matrix[3][3];
+-	IssmDouble epsilon_eff;
+-	IssmDouble epsilon_sqr[3][3];
+-
+-	/* Build epsilon matrix */
+-	epsilon_matrix[0][0]=*(epsilon+0);
+-	epsilon_matrix[1][0]=*(epsilon+3);
+-	epsilon_matrix[2][0]=*(epsilon+4);
+-	epsilon_matrix[0][1]=*(epsilon+3);
+-	epsilon_matrix[1][1]=*(epsilon+1);
+-	epsilon_matrix[2][1]=*(epsilon+5);
+-	epsilon_matrix[0][2]=*(epsilon+4);
+-	epsilon_matrix[1][2]=*(epsilon+5);
+-	epsilon_matrix[2][2]=*(epsilon+2);
+-
+-	/* Effective value of epsilon_matrix */
+-	epsilon_sqr[0][0]=pow(epsilon_matrix[0][0],2);
+-	epsilon_sqr[1][0]=pow(epsilon_matrix[1][0],2);
+-	epsilon_sqr[2][0]=pow(epsilon_matrix[2][0],2);
+-	epsilon_sqr[0][1]=pow(epsilon_matrix[0][1],2);
+-	epsilon_sqr[1][1]=pow(epsilon_matrix[1][1],2);
+-	epsilon_sqr[2][1]=pow(epsilon_matrix[2][1],2);
+-	epsilon_sqr[0][2]=pow(epsilon_matrix[0][2],2);
+-	epsilon_sqr[1][2]=pow(epsilon_matrix[1][2],2);
+-	epsilon_sqr[2][2]=pow(epsilon_matrix[2][2],2);
+-	epsilon_eff=1/pow(2,0.5)*pow((epsilon_sqr[0][0]+epsilon_sqr[0][1]+ epsilon_sqr[0][2]+ epsilon_sqr[1][0]+ epsilon_sqr[1][1]+ epsilon_sqr[1][2]+ epsilon_sqr[2][0]+ epsilon_sqr[2][1]+ epsilon_sqr[2][2]),0.5);
+-
+-	/*Phi = Tr(sigma * eps) 
+-	 *    = Tr(sigma'* eps)
+-	 *    = 2 * eps_eff * sigma'_eff
+-	 *    = 4 * mu * eps_eff ^2*/
+-	*phi=4*pow(epsilon_eff,2.0)*viscosity;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetSidList{{{*/
+-void  Penta::GetSidList(int* sidlist){
+-
+-	int i;
+-	for(i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->GetSidList();
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetSolutionFromInputs{{{*/
+-void  Penta::GetSolutionFromInputs(Vector* solution){
+-
+-	int analysis_type;
+-
+-	/*retrive parameters: */
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-	#ifdef _HAVE_DIAGNOSTIC_
+-	case DiagnosticHorizAnalysisEnum:
+-		int approximation;
+-		inputs->GetInputValue(&approximation,ApproximationEnum);
+-		if(approximation==StokesApproximationEnum || approximation==NoneApproximationEnum){
+-			GetSolutionFromInputsDiagnosticStokes(solution);
+-		}
+-		else if (approximation==MacAyealApproximationEnum || approximation==PattynApproximationEnum || approximation==HutterApproximationEnum){
+-			GetSolutionFromInputsDiagnosticHoriz(solution);
+-		}
+-		else if (approximation==MacAyealPattynApproximationEnum || approximation==PattynStokesApproximationEnum || approximation==MacAyealStokesApproximationEnum){
+-			return; //the elements around will create the solution
+-		}
+-		break;
+-	case DiagnosticHutterAnalysisEnum:
+-		GetSolutionFromInputsDiagnosticHutter(solution);
+-		break;
+-	case DiagnosticVertAnalysisEnum:
+-		GetSolutionFromInputsDiagnosticVert(solution);
+-		break;
+-	#endif
+-	#ifdef _HAVE_THERMAL_
+-	case ThermalAnalysisEnum:
+-		GetSolutionFromInputsThermal(solution);
+-		break;
+-	case EnthalpyAnalysisEnum:
+-		GetSolutionFromInputsEnthalpy(solution);
+-		break;
+-	#endif
+-	default:
+-		_error2_("analysis: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetStabilizationParameter {{{*/
+-IssmDouble Penta::GetStabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){
+-	/*Compute stabilization parameter*/
+-	/*kappa=thermalconductivity/(rho_ice*hearcapacity) for thermal model*/
+-	/*kappa=enthalpydiffusionparameter for enthalpy model*/
+-
+-	IssmDouble normu;
+-	IssmDouble tau_parameter;
+-
+-	normu=pow(pow(u,2)+pow(v,2)+pow(w,2),0.5);
+-	if(normu*diameter/(3*2*kappa)<1){ 
+-		tau_parameter=pow(diameter,2)/(3*2*2*kappa);
+-	}
+-	else tau_parameter=diameter/(2*normu);
+-
+-	return tau_parameter;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetStrainRate3dPattyn{{{*/
+-void Penta::GetStrainRate3dPattyn(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input){
+-	/*Compute the 3d Blatter/PattynStrain Rate (5 components):
+-	 *
+-	 * epsilon=[exx eyy exy exz eyz]
+-	 *
+-	 * with exz=1/2 du/dz
+-	 *      eyz=1/2 dv/dz
+-	 *
+-	 * the contribution of vz is neglected
+-	 */
+-
+-	int i;
+-	IssmDouble epsilonvx[5];
+-	IssmDouble epsilonvy[5];
+-
+-	/*Check that both inputs have been found*/
+-	if (!vx_input || !vy_input){
+-		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");
+-	}
+-
+-	/*Get strain rate assuming that epsilon has been allocated*/
+-	vx_input->GetVxStrainRate3dPattyn(epsilonvx,xyz_list,gauss);
+-	vy_input->GetVyStrainRate3dPattyn(epsilonvy,xyz_list,gauss);
+-
+-	/*Sum all contributions*/
+-	for(i=0;i<5;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i];
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetStrainRate3d{{{*/
+-void Penta::GetStrainRate3d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input, Input* vz_input){
+-	/*Compute the 3d Strain Rate (6 components):
+-	 *
+-	 * epsilon=[exx eyy ezz exy exz eyz]
+-	 */
+-
+-	int i;
+-	IssmDouble epsilonvx[6];
+-	IssmDouble epsilonvy[6];
+-	IssmDouble epsilonvz[6];
+-
+-	/*Check that both inputs have been found*/
+-	if (!vx_input || !vy_input || !vz_input){
+-		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << ", vz: " << vz_input << "\n");
+-	}
+-
+-	/*Get strain rate assuming that epsilon has been allocated*/
+-	vx_input->GetVxStrainRate3d(epsilonvx,xyz_list,gauss);
+-	vy_input->GetVyStrainRate3d(epsilonvy,xyz_list,gauss);
+-	vz_input->GetVzStrainRate3d(epsilonvz,xyz_list,gauss);
+-
+-	/*Sum all contributions*/
+-	for(i=0;i<6;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i]+epsilonvz[i];
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetUpperElement{{{*/
+-Penta* Penta::GetUpperElement(void){
+-
+-	Penta* upper_penta=NULL;
+-
+-	upper_penta=(Penta*)verticalneighbors[1]; //first one under, second one above
+-
+-	return upper_penta;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetVectorFromInputs{{{*/
+-void  Penta::GetVectorFromInputs(Vector* vector,int input_enum){
+-
+-	int doflist1[NUMVERTICES];
+-
+-	/*Get out if this is not an element input*/
+-	if (!IsInput(input_enum)) return;
+-
+-	/*Prepare index list*/
+-	this->GetDofList1(&doflist1[0]);
+-
+-	/*Get input (either in element or material)*/
+-	Input* input=inputs->GetInput(input_enum);
+-	if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in element");
+-
+-	/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
+-	input->GetVectorFromInputs(vector,&doflist1[0]);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetVectorFromResults{{{*/
+-void  Penta::GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp){
+-
+-	/*Get result*/
+-	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
+-	if(elementresult->InstanceEnum()!=enum_in){
+-		_error_("Results of offset %i is %s, when %s was expected",offset,EnumToStringx(elementresult->InstanceEnum()),EnumToStringx(enum_in));
+-	}  
+-	if(interp==P1Enum){
+-		int doflist1[NUMVERTICES];
+-		int connectivity[NUMVERTICES];
+-		this->GetSidList(&doflist1[0]);
+-		this->GetConnectivityList(&connectivity[0]);
+-		elementresult->GetVectorFromResults(vector,&doflist1[0],&connectivity[0],NUMVERTICES);
+-	}
+-	else if(interp==P0Enum){
+-		elementresult->GetElementVectorFromResults(vector,sid);
+-	}
+-	else{
+-		_printLine_("Interpolation " << EnumToStringx(interp) << " not supported");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetZcoord {{{*/
+-IssmDouble Penta::GetZcoord(GaussPenta* gauss){
+-
+-	int    i;
+-	IssmDouble z;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble z_list[NUMVERTICES];
+-
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES;i++) z_list[i]=xyz_list[i][2];
+-	PentaRef::GetInputValue(&z,z_list,gauss);
+-
+-	return z;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::Sid {{{*/
+-int    Penta::Sid(){
+-	
+-	return sid;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::Id {{{*/
+-int    Penta::Id(void){
+-	return id; 
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputArtificialNoise{{{*/
+-void  Penta::InputArtificialNoise(int enum_type,IssmDouble min,IssmDouble max){
+-
+-	Input* input=NULL;
+-
+-	/*Make a copy of the original input: */
+-	input=(Input*)this->inputs->GetInput(enum_type);
+-	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
+-
+-	/*ArtificialNoise: */
+-	input->ArtificialNoise(min,max);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputConvergence{{{*/
+-bool Penta::InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums){
+-
+-	int i;
+-	bool    converged=true;
+-	Input** new_inputs=NULL;
+-	Input** old_inputs=NULL;
+-
+-	new_inputs=xNew<Input*>(num_enums/2); //half the enums are for the new inputs
+-	old_inputs=xNew<Input*>(num_enums/2); //half the enums are for the old inputs
+-
+-	for(i=0;i<num_enums/2;i++){
+-		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
+-		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
+-		if(!new_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
+-		if(!old_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
+-	}
+-
+-	/*ok, we've got the inputs (new and old), now loop throught the number of criterions and fill the eps array:*/
+-	for(i=0;i<num_criterionenums;i++){
+-		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,criterionenums[i]);
+-		if(eps[i]>criterionvalues[i]) converged=false; 
+-	}
+-
+-	/*clean up*/
+-	xDelete<Input*>(new_inputs);
+-	xDelete<Input*>(old_inputs);
+-
+-	/*Return output*/
+-	return converged;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputCreate(IssmDouble scalar,int enum,int code);{{{*/
+-void Penta::InputCreate(IssmDouble scalar,int name,int code){
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-	
+-	if ((code==5) || (code==1)){ //boolean
+-		this->inputs->AddInput(new BoolInput(name,(bool)scalar));
+-	}
+-	else if ((code==6) || (code==2)){ //integer
+-		this->inputs->AddInput(new IntInput(name,(int)scalar));
+-	}
+-	else if ((code==7) || (code==3)){ //IssmDouble
+-		this->inputs->AddInput(new DoubleInput(name,(IssmDouble)scalar));
+-	}
+-	else _error2_("could not recognize nature of vector from code " << code);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputCreate(IssmDouble* vector,int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){{{*/
+-void Penta::InputCreate(IssmDouble* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){//index into elements
+-
+-	/*Intermediaries*/
+-	int    i,j,t;
+-	int    penta_vertex_ids[6];
+-	int    row;
+-	IssmDouble nodeinputs[6];
+-	IssmDouble time;
+-	TransientInput* transientinput=NULL;
+-
+-	int    numberofvertices;
+-	int    numberofelements;
+-	IssmDouble yts;
+-
+-	/*Fetch parameters: */
+-	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
+-	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
+-	iomodel->Constant(&yts,ConstantsYtsEnum);
+-
+-	/*Branch on type of vector: nodal or elementary: */
+-	if(vector_type==1){ //nodal vector
+-
+-		/*Recover vertices ids needed to initialize inputs*/
+-		for(i=0;i<6;i++){ 
+-			_assert_(iomodel->Data(MeshElementsEnum));
+-			penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
+-		}
+-
+-		/*Are we in transient or static? */
+-		if(M==numberofvertices){
+-
+-			/*create input values: */
+-			for(i=0;i<6;i++)nodeinputs[i]=(IssmDouble)vector[penta_vertex_ids[i]-1];
+-
+-			/*process units: */
+-			UnitConversion(&nodeinputs[0], 6 ,ExtToIuEnum, vector_enum);
+-
+-			/*create static input: */
+-			this->inputs->AddInput(new PentaP1Input(vector_enum,nodeinputs));
+-		}
+-		else if(M==numberofvertices+1){
+-			/*create transient input: */
+-			for(t=0;t<N;t++){ //N is the number of times
+-
+-				/*create input values: */
+-				for(i=0;i<6;i++){
+-					row=penta_vertex_ids[i]-1;
+-					nodeinputs[i]=(IssmDouble)vector[N*row+t];
+-				}
+-
+-				/*process units: */
+-				UnitConversion(&nodeinputs[0], 6 ,ExtToIuEnum, vector_enum);
+-
+-				/*time? :*/
+-				time=(IssmDouble)vector[(M-1)*N+t]*yts;
+-
+-				if(t==0)transientinput=new TransientInput(vector_enum);
+-				transientinput->AddTimeInput(new PentaP1Input(vector_enum,nodeinputs),time);
+-			}
+-			this->inputs->AddInput(transientinput);
+-		}
+-		else _error2_("nodal vector is either numberofnodes (" << numberofvertices << "), or numberofnodes+1 long. Field provided is " << M << " long. Enum " << EnumToStringx(vector_enum));
+-	}
+-	else if(vector_type==2){ //element vector
+-		/*Are we in transient or static? */
+-		if(M==numberofelements){
+-
+-			/*static mode: create an input out of the element value: */
+-
+-			if (code==5){ //boolean
+-				this->inputs->AddInput(new BoolInput(vector_enum,(bool)vector[index]));
+-			}
+-			else if (code==6){ //integer
+-				this->inputs->AddInput(new IntInput(vector_enum,(int)vector[index]));
+-			}
+-			else if (code==7){ //IssmDouble
+-				this->inputs->AddInput(new DoubleInput(vector_enum,(IssmDouble)vector[index]));
+-			}
+-			else _error2_("could not recognize nature of vector from code " << code);
+-		}
+-		else {
+-			_error2_("transient elementary inputs not supported yet!");
+-		}
+-	}
+-	else{
+-		_error2_("Cannot add input for vector type " << vector_type << " (not supported)");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputDepthAverageAtBase{{{*/
+-void  Penta::InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum){
+-
+-	int  step,i;
+-	IssmDouble  xyz_list[NUMVERTICES][3];
+-	IssmDouble  Helem_list[NUMVERTICES];
+-	IssmDouble  zeros_list[NUMVERTICES]={0.0};
+-	Penta* penta=NULL;
+-	Input* original_input=NULL;
+-	Input* element_integrated_input=NULL;
+-	Input* total_integrated_input=NULL;
+-	Input* element_thickness_input=NULL;
+-	Input* total_thickness_input=NULL;
+-	Input* depth_averaged_input=NULL;
+-
+-	/*recover parameters: */
+-
+-	/*Are we on the base? If not, return*/
+-	if(!IsOnBed()) return;
+-
+-	/*OK, we are on bed. Initialize global inputs as 0*/
+-	total_thickness_input =new PentaP1Input(ThicknessEnum,zeros_list);
+-
+-	/*Now follow all the upper element from the base to the surface to integrate the input*/
+-	penta=this;
+-	step =0;
+-	for(;;){
+-
+-		/*Step1: Get original input (to be depth avegaged): */
+-		if (object_enum==MeshElementsEnum)
+-		 original_input=(Input*)penta->inputs->GetInput(enum_type);
+-		else if (object_enum==MaterialsEnum)
+-		 original_input=(Input*)penta->matice->inputs->GetInput(enum_type);
+-		else
+-		 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
+-		if(!original_input) _error2_("could not find input with enum " << EnumToStringx(enum_type));
+-
+-		/*If first time, initialize total_integrated_input*/
+-		if (step==0){
+-			if (original_input->ObjectEnum()==PentaP1InputEnum)
+-			 total_integrated_input=new PentaP1Input(average_enum_type,zeros_list);
+-			else if (original_input->ObjectEnum()==ControlInputEnum)
+-			 total_integrated_input=new PentaP1Input(average_enum_type,zeros_list);
+-			else if (original_input->ObjectEnum()==DoubleInputEnum)
+-			 total_integrated_input=new DoubleInput(average_enum_type,0.0);
+-			else
+-			 _error2_("object " << EnumToStringx(original_input->ObjectEnum()) << " not supported yet");
+-		}
+-
+-		/*Step2: Create element thickness input*/
+-		GetVerticesCoordinates(&xyz_list[0][0],penta->nodes,NUMVERTICES);
+-		for(i=0;i<3;i++){
+-			Helem_list[i]=xyz_list[i+3][2]-xyz_list[i][2];
+-			Helem_list[i+3]=Helem_list[i];
+-		}
+-		element_thickness_input=new PentaP1Input(ThicknessEnum,Helem_list);
+-
+-		/*Step3: Vertically integrate A COPY of the original*/
+-		element_integrated_input=(Input*)original_input->copy();
+-		element_integrated_input->VerticallyIntegrate(element_thickness_input);
+-
+-		/*Add contributions to global inputs*/
+-		total_integrated_input->AXPY(element_integrated_input,1.0);
+-		total_thickness_input ->AXPY(element_thickness_input,1.0);
+-
+-		/*Clean up*/
+-		delete element_thickness_input;
+-		delete element_integrated_input;
+-
+-		/*Stop if we have reached the surface, else, take upper penta*/
+-		if (penta->IsOnSurface()) break;
+-
+-		/* get upper Penta*/
+-		penta=penta->GetUpperElement();
+-		_assert_(penta->Id()!=this->id);
+-
+-		/*increase couter*/
+-		step++;
+-	}
+-
+-	/*OK, now we only need to divide the depth integrated input by the total thickness!*/
+-	depth_averaged_input=total_integrated_input->PointwiseDivide(total_thickness_input);
+-	depth_averaged_input->ChangeEnum(average_enum_type);
+-
+-	/*Clean up*/
+-	delete total_thickness_input;
+-	delete total_integrated_input;
+-
+-	/*Finally, add to inputs*/
+-	if (object_enum==MeshElementsEnum)
+-	 this->inputs->AddInput((Input*)depth_averaged_input);
+-	else if (object_enum==MaterialsEnum)
+-	 this->matice->inputs->AddInput((Input*)depth_averaged_input);
+-	else
+-	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputDuplicate{{{*/
+-void  Penta::InputDuplicate(int original_enum,int new_enum){
+-
+-	/*Call inputs method*/
+-	if (IsInput(original_enum)) inputs->DuplicateInput(original_enum,new_enum);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputExtrude {{{*/
+-void  Penta::InputExtrude(int enum_type,int object_type){
+-
+-	int     i,num_inputs;
+-	Penta  *penta       = NULL;
+-	Input  *copy        = NULL;
+-	Input **base_inputs = NULL;
+-
+-	/*Are we on the base, not on the surface?:*/
+-	if(!IsOnBed()) return;
+-
+-	/*Step1: Get and Extrude original input: */
+-	if (object_type==ElementEnum){
+-		num_inputs=1;
+-		base_inputs=xNew<Input*>(num_inputs);
+-		base_inputs[0]=(Input*)this->inputs->GetInput(enum_type);
+-	}
+-	else if (object_type==MaterialsEnum){
+-		num_inputs=1;
+-		base_inputs=xNew<Input*>(num_inputs);
+-		base_inputs[0]=(Input*)matice->inputs->GetInput(enum_type);
+-	}
+-	else if (object_type==NodeEnum){
+-		num_inputs=3; //only the three upper nodes
+-		base_inputs=xNew<Input*>(num_inputs);
+-		for(i=0;i<num_inputs;i++){
+-			base_inputs[i]=(Input*)this->nodes[i]->inputs->GetInput(enum_type);
+-		}
+-	}
+-	else{
+-		_error2_("object of type " << EnumToStringx(object_type) << " not supported yet");
+-	}
+-	for(i=0;i<num_inputs;i++){
+-		if(!base_inputs[i]) _error2_("could not find input with enum " << EnumToStringx(enum_type) << " in object " << EnumToStringx(object_type));
+-		base_inputs[i]->Extrude();
+-	}
+-
+-	/*Stop if there is only one layer of element*/
+-	if (this->IsOnSurface()) return;
+-
+-	/*Step 2: this input has been extruded for this element, now follow the upper element*/
+-	penta=this;
+-	for(;;){
+-		/* get upper Penta*/
+-		penta=penta->GetUpperElement();
+-		_assert_(penta->Id()!=this->id);
+-
+-		/*Add input of the basal element to penta->inputs*/
+-		for(i=0;i<num_inputs;i++){
+-			copy=(Input*)base_inputs[i]->copy();
+-			if (object_type==ElementEnum){
+-				penta->inputs->AddInput((Input*)copy);
+-			}
+-			else if(object_type==MaterialsEnum){
+-				penta->matice->inputs->AddInput((Input*)copy);
+-			}
+-			else if(object_type==NodeEnum){
+-				penta->nodes[i+3]->inputs->AddInput((Input*)copy); //change only the three upper nodes
+-			}
+-			else{
+-				_error2_("object of type " << EnumToStringx(object_type) << " not supported yet");
+-			}
+-		}
+-
+-		/*Stop if we have reached the surface*/
+-		if (penta->IsOnSurface()) break;
+-	}
+-
+-	/*clean-up and return*/
+-	xDelete<Input*>(base_inputs);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputScale{{{*/
+-void  Penta::InputScale(int enum_type,IssmDouble scale_factor){
+-
+-	Input* input=NULL;
+-
+-	/*Make a copy of the original input: */
+-	input=(Input*)this->inputs->GetInput(enum_type);
+-	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
+-
+-	/*Scale: */
+-	input->Scale(scale_factor);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputToResult{{{*/
+-void  Penta::InputToResult(int enum_type,int step,IssmDouble time){
+-
+-	int    i;
+-	bool   found = false;
+-	Input *input = NULL;
+-
+-	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
+-	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyBEnum);
+-	else input=this->inputs->GetInput(enum_type);
+-	//if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found in penta->inputs"); why error out? if the requested input does not exist, we should still 
+-	//try and output whatever we can instead of just failing.
+-	if(!input)return;
+-
+-	/*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result 
+-	 * object out of the input, with the additional step and time information: */
+-	this->results->AddObject((Object*)input->SpawnResult(step,time));
+-	#ifdef _HAVE_CONTROL_
+-	if(input->ObjectEnum()==ControlInputEnum){
+-		if(((ControlInput*)input)->gradient!=NULL) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
+-	}
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromConstant(bool value, int name);{{{*/
+-void  Penta::InputUpdateFromConstant(bool constant, int name){
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	/*update input*/
+-	this->inputs->AddInput(new BoolInput(name,constant));
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromConstant(IssmDouble value, int name);{{{*/
+-void  Penta::InputUpdateFromConstant(IssmDouble constant, int name){
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	/*update input*/
+-	this->inputs->AddInput(new DoubleInput(name,constant));
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromConstant(int value, int name);{{{*/
+-void  Penta::InputUpdateFromConstant(int constant, int name){
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	/*update input*/
+-	this->inputs->AddInput(new IntInput(name,constant));
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromIoModel {{{*/
+-void Penta::InputUpdateFromIoModel(int index,IoModel* iomodel){ 
+-
+-	/*Intermediaries*/
+-	IssmInt i,j;
+-	int     penta_vertex_ids[6];
+-	IssmDouble  nodeinputs[6];
+-	IssmDouble  cmmininputs[6];
+-	IssmDouble  cmmaxinputs[6];
+-
+-	IssmDouble  yts;
+-	bool    control_analysis;
+-	int     num_control_type;
+-	int     num_cm_responses;
+-
+-	/*Fetch parameters: */
+-	iomodel->Constant(&yts,ConstantsYtsEnum);
+-	iomodel->Constant(&control_analysis,InversionIscontrolEnum);
+-	if(control_analysis) iomodel->Constant(&num_control_type,InversionNumControlParametersEnum);
+-	if(control_analysis) iomodel->Constant(&num_cm_responses,InversionNumCostFunctionsEnum);
+-
+-	/*Checks if debuging*/
+-	/*{{{*/
+-	_assert_(iomodel->Data(MeshElementsEnum));
+-	/*}}}*/
+-
+-	/*Recover vertices ids needed to initialize inputs*/
+-	for(i=0;i<6;i++){ 
+-		penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
+-	}
+-
+-	/*Control Inputs*/
+-	#ifdef _HAVE_CONTROL_
+-	if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+-		for(i=0;i<num_control_type;i++){
+-			switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
+-				case BalancethicknessThickeningRateEnum:
+-					if (iomodel->Data(BalancethicknessThickeningRateEnum)){
+-						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(BalancethicknessThickeningRateEnum)[penta_vertex_ids[j]-1]/yts;
+-						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-					}
+-					break;
+-				case VxEnum:
+-					if (iomodel->Data(VxEnum)){
+-						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(VxEnum)[penta_vertex_ids[j]-1]/yts;
+-						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						this->inputs->AddInput(new ControlInput(VxEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-					}
+-					break;
+-				case VyEnum:
+-					if (iomodel->Data(VyEnum)){
+-						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(VyEnum)[penta_vertex_ids[j]-1]/yts;
+-						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+-						this->inputs->AddInput(new ControlInput(VyEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-					}
+-					break;
+-				case FrictionCoefficientEnum:
+-					if (iomodel->Data(FrictionCoefficientEnum)){
+-						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(FrictionCoefficientEnum)[penta_vertex_ids[j]-1];
+-						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];
+-						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];
+-						this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-					}
+-					break;
+-				case MaterialsRheologyBbarEnum:
+-					/*Matice will take care of it*/ break;
+-				default:
+-					_error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
+-			}
+-		}
+-	}
+-	#endif
+-
+-	//Need to know the type of approximation for this element
+-	if(iomodel->Data(FlowequationElementEquationEnum)){
+-		if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealApproximationEnum){
+-			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealApproximationEnum));
+-		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynApproximationEnum){
+-			this->inputs->AddInput(new IntInput(ApproximationEnum,PattynApproximationEnum));
+-		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealPattynApproximationEnum){
+-			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealPattynApproximationEnum));
+-		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==HutterApproximationEnum){
+-			this->inputs->AddInput(new IntInput(ApproximationEnum,HutterApproximationEnum));
+-		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==StokesApproximationEnum){
+-			this->inputs->AddInput(new IntInput(ApproximationEnum,StokesApproximationEnum));
+-		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealStokesApproximationEnum){
+-			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealStokesApproximationEnum));
+-		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynStokesApproximationEnum){
+-			this->inputs->AddInput(new IntInput(ApproximationEnum,PattynStokesApproximationEnum));
+-		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==NoneApproximationEnum){
+-			this->inputs->AddInput(new IntInput(ApproximationEnum,NoneApproximationEnum));
+-		}
+-		else{
+-			_error2_("Approximation type " << EnumToStringx((int)*(iomodel->Data(FlowequationElementEquationEnum)+index)) << " not supported yet");
+-		}
+-	}
+-
+-	/*DatasetInputs*/
+-	if (control_analysis && iomodel->Data(InversionCostFunctionsCoefficientsEnum)) {
+-
+-		/*Create inputs and add to DataSetInput*/
+-		DatasetInput* datasetinput=new DatasetInput(InversionCostFunctionsCoefficientsEnum);
+-		for(i=0;i<num_cm_responses;i++){
+-			for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(InversionCostFunctionsCoefficientsEnum)[(penta_vertex_ids[j]-1)*num_cm_responses+i];
+-			datasetinput->inputs->AddObject(new PentaP1Input(InversionCostFunctionsCoefficientsEnum,nodeinputs));
+-		}
+-
+-		/*Add datasetinput to element inputs*/
+-		this->inputs->AddInput(datasetinput);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolution {{{*/
+-void  Penta::InputUpdateFromSolution(IssmDouble* solution){
+-
+-	int analysis_type;
+-
+-	/*retreive parameters: */
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-
+-	/*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
+-	switch(analysis_type){
+-	#ifdef _HAVE_DIAGNOSTIC_
+-	case DiagnosticHorizAnalysisEnum:
+-		InputUpdateFromSolutionDiagnosticHoriz( solution);
+-		break;
+-	case DiagnosticHutterAnalysisEnum:
+-		InputUpdateFromSolutionDiagnosticHutter( solution);
+-		break;
+-	case DiagnosticVertAnalysisEnum:
+-		InputUpdateFromSolutionDiagnosticVert( solution);
+-		break;
+-	#endif
+-	#ifdef _HAVE_CONTROL_
+-	case AdjointHorizAnalysisEnum:
+-		int approximation;
+-		inputs->GetInputValue(&approximation,ApproximationEnum);
+-		if(approximation==StokesApproximationEnum || approximation==NoneApproximationEnum){
+-			InputUpdateFromSolutionAdjointStokes( solution);
+-		}
+-		else{
+-			InputUpdateFromSolutionAdjointHoriz( solution);
+-		}
+-		break;
+-	#endif
+-	#ifdef _HAVE_THERMAL_
+-	case ThermalAnalysisEnum:
+-		InputUpdateFromSolutionThermal( solution);
+-		break;
+-	case EnthalpyAnalysisEnum:
+-		InputUpdateFromSolutionEnthalpy( solution);
+-		break;
+-	case MeltingAnalysisEnum:
+-		InputUpdateFromSolutionOneDof(solution,BasalforcingsMeltingRateEnum);
+-		break;
+-	#endif
+-	case BedSlopeXAnalysisEnum:
+-		InputUpdateFromSolutionOneDofCollapsed(solution,BedSlopeXEnum);
+-		break;
+-	case BedSlopeYAnalysisEnum:
+-		InputUpdateFromSolutionOneDofCollapsed(solution,BedSlopeYEnum);
+-		break;
+-	case SurfaceSlopeXAnalysisEnum:
+-		InputUpdateFromSolutionOneDofCollapsed(solution,SurfaceSlopeXEnum);
+-		break;
+-	case SurfaceSlopeYAnalysisEnum:
+-		InputUpdateFromSolutionOneDofCollapsed(solution,SurfaceSlopeYEnum);
+-		break;
+-	case PrognosticAnalysisEnum:
+-		InputUpdateFromSolutionPrognostic(solution);
+-		break;
+-	#ifdef _HAVE_BALANCED_
+-	case BalancethicknessAnalysisEnum:
+-		InputUpdateFromSolutionOneDofCollapsed(solution,ThicknessEnum);
+-		break;
+-	#endif
+-	default: 
+-		_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionPrognostic{{{*/
+-void  Penta::InputUpdateFromSolutionPrognostic(IssmDouble* solution){
+-
+-	const int  numdof   = NDOF1*NUMVERTICES;
+-	const int  numdof2d = NDOF1*NUMVERTICES2D;
+-
+-	int    i,hydroadjustment;
+-	int*   doflist = NULL;
+-	IssmDouble rho_ice,rho_water,minthickness;
+-	IssmDouble newthickness[numdof];
+-	IssmDouble newbed[numdof];
+-	IssmDouble newsurface[numdof];
+-	IssmDouble oldbed[NUMVERTICES];
+-	IssmDouble oldsurface[NUMVERTICES];
+-	IssmDouble oldthickness[NUMVERTICES];
+-	Penta  *penta   = NULL;
+-
+-	/*If not on bed, return*/
+-	if (!IsOnBed()) return;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector and extrude it */
+-	this->parameters->FindParam(&minthickness,PrognosticMinThicknessEnum);
+-	for(i=0;i<numdof2d;i++){
+-		newthickness[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(newthickness[i])) _error2_("NaN found in solution vector");
+-		/*Constrain thickness to be at least 1m*/
+-		if(newthickness[i]<minthickness) newthickness[i]=minthickness;
+-		newthickness[i+numdof2d]=newthickness[i];
+-	}
+-
+-	/*Get previous bed, thickness and surface*/
+-	GetInputListOnVertices(&oldbed[0],BedEnum);
+-	GetInputListOnVertices(&oldsurface[0],SurfaceEnum);
+-	GetInputListOnVertices(&oldthickness[0],ThicknessEnum);
+-
+-	/*Fing PrognosticHydrostaticAdjustment to figure out how to update the geometry:*/
+-	this->parameters->FindParam(&hydroadjustment,PrognosticHydrostaticAdjustmentEnum);
+-
+-	/*recover material parameters: */
+-	rho_ice=matpar->GetRhoIce();
+-	rho_water=matpar->GetRhoWater();
+-
+-	for(i=0;i<numdof;i++) {
+-		/*If shelf: hydrostatic equilibrium*/
+-		if (this->nodes[i]->IsGrounded()){
+-			newsurface[i]=oldbed[i]+newthickness[i]; //surface = oldbed + newthickness
+-			newbed[i]=oldbed[i];               //same bed: do nothing
+-		}
+-		else{ //so it is an ice shelf
+-			if(hydroadjustment==AbsoluteEnum){
+-				newsurface[i]=newthickness[i]*(1-rho_ice/rho_water);
+-				newbed[i]=newthickness[i]*(-rho_ice/rho_water);
+-			}
+-			else if(hydroadjustment==IncrementalEnum){
+-				newsurface[i]=oldsurface[i]+(1.0-rho_ice/rho_water)*(newthickness[i]-oldthickness[i]); //surface = oldsurface + (1-di) * dH 
+-				newbed[i]=oldbed[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i]); //bed = oldbed + di * dH
+-			}
+-			else _error2_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
+-		}
+-	}
+-
+-	/*Start looping over all elements above current element and update all inputs*/
+-	penta=this;
+-	for(;;){
+-		/*Add input to the element: */
+-		penta->inputs->AddInput(new PentaP1Input(ThicknessEnum,newthickness));
+-		penta->inputs->AddInput(new PentaP1Input(SurfaceEnum,newsurface));
+-		penta->inputs->AddInput(new PentaP1Input(BedEnum,newbed));
+-
+-		/*Stop if we have reached the surface*/
+-		if (penta->IsOnSurface()) break;
+-
+-		/* get upper Penta*/
+-		penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id);
+-	}
+-	
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionOneDof{{{*/
+-void  Penta::InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type){
+-
+-	const int numdof = NDOF1*NUMVERTICES;
+-
+-	IssmDouble values[numdof];
+-	int*   doflist=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(int i=0;i<numdof;i++){
+-		values[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Add input to the element: */
+-	this->inputs->AddInput(new PentaP1Input(enum_type,values));
+-	
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionOneDofCollpased{{{*/
+-void  Penta::InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int enum_type){
+-
+-	const int  numdof   = NDOF1*NUMVERTICES;
+-	const int  numdof2d = NDOF1*NUMVERTICES2D;
+-
+-	IssmDouble  values[numdof];
+-	int*    doflist = NULL;
+-	Penta  *penta   = NULL;
+-
+-	/*If not on bed, return*/
+-	if (!IsOnBed()) return;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector and extrude it */
+-	for(int i=0;i<numdof2d;i++){
+-		values[i]         =solution[doflist[i]];
+-		values[i+numdof2d]=values[i];
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Start looping over all elements above current element and update all inputs*/
+-	penta=this;
+-	for(;;){
+-		/*Add input to the element: */
+-		penta->inputs->AddInput(new PentaP1Input(enum_type,values));
+-
+-		/*Stop if we have reached the surface*/
+-		if (penta->IsOnSurface()) break;
+-
+-		/* get upper Penta*/
+-		penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id);
+-	}
+-	
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromVector(IssmDouble* vector, int name, int type);{{{*/
+-void  Penta::InputUpdateFromVector(IssmDouble* vector, int name, int type){
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	/*Penta update B in InputUpdateFromSolutionThermal, so don't look for B update here.*/
+-
+-	switch(type){
+-
+-		case VertexEnum:
+-
+-			/*New PentaVertexInpu*/
+-			IssmDouble values[6];
+-
+-			/*Get values on the 6 vertices*/
+-			for (int i=0;i<6;i++){
+-				values[i]=vector[this->nodes[i]->GetVertexDof()];
+-			}
+-
+-			/*update input*/
+-			this->inputs->AddInput(new PentaP1Input(name,values));
+-			return;
+-
+-		default:
+-
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromVector(int* vector, int name, int type);{{{*/
+-void  Penta::InputUpdateFromVector(int* vector, int name, int type){
+-	_error2_("not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromVector(bool* vector, int name, int type);{{{*/
+-void  Penta::InputUpdateFromVector(bool* vector, int name, int type){
+-	_error2_("not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Penta::IsOnBed{{{*/
+-bool Penta::IsOnBed(void){
+-
+-	bool onbed;
+-	inputs->GetInputValue(&onbed,MeshElementonbedEnum);
+-	return onbed;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::IsInput{{{*/
+-bool Penta::IsInput(int name){
+-	if (
+-				name==ThicknessEnum ||
+-				name==SurfaceEnum ||
+-				name==BedEnum ||
+-				name==SurfaceSlopeXEnum ||
+-				name==SurfaceSlopeYEnum ||
+-				name==SurfaceforcingsMassBalanceEnum ||
+-				name==BasalforcingsMeltingRateEnum ||
+-				name==BasalforcingsGeothermalfluxEnum ||
+-				name==SurfaceAreaEnum||
+-				name==PressureEnum ||
+-				name==VxEnum ||
+-				name==VyEnum ||
+-				name==VzEnum ||
+-				name==VxMeshEnum ||
+-				name==VyMeshEnum ||
+-				name==VzMeshEnum ||
+-				name==InversionVxObsEnum ||
+-				name==InversionVyObsEnum ||
+-				name==InversionVzObsEnum ||
+-				name==TemperatureEnum ||
+-				name==EnthalpyEnum ||
+-				name==EnthalpyPicardEnum ||
+-				name==WaterfractionEnum||
+-				name==FrictionCoefficientEnum ||
+-				name==GradientEnum ||
+-				name==OldGradientEnum  ||
+-				name==ConvergedEnum || 
+-				name==QmuVxEnum ||
+-				name==QmuVyEnum ||
+-				name==QmuPressureEnum ||
+-				name==QmuBedEnum ||
+-				name==QmuThicknessEnum ||
+-				name==QmuSurfaceEnum ||
+-				name==QmuTemperatureEnum ||
+-				name==QmuMeltingEnum
+-				) {
+-		return true;
+-	}
+-	else return false;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::IsFloating{{{*/
+-bool   Penta::IsFloating(){
+-
+-	bool onshelf;
+-	inputs->GetInputValue(&onshelf,MaskElementonfloatingiceEnum);
+-	return onshelf;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::IsNodeOnShelf {{{*/
+-bool   Penta::IsNodeOnShelf(){
+-
+-	int  i;
+-	bool shelf=false;
+-
+-	for(i=0;i<6;i++){
+-		if (nodes[i]->IsFloating()){
+-			shelf=true;
+-			break;
+-		}
+-	}
+-	return shelf;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::IsNodeOnShelfFromFlags {{{*/
+-bool   Penta::IsNodeOnShelfFromFlags(IssmDouble* flags){
+-
+-	int  i;
+-	bool shelf=false;
+-
+-	for(i=0;i<NUMVERTICES;i++){
+-		if (flags[nodes[i]->Sid()]){
+-			shelf=true;
+-			break;
+-		}
+-	}
+-	return shelf;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::IsOnSurface{{{*/
+-bool Penta::IsOnSurface(void){
+-
+-	bool onsurface;
+-	inputs->GetInputValue(&onsurface,MeshElementonsurfaceEnum);
+-	return onsurface;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::IsOnWater {{{*/
+-bool   Penta::IsOnWater(){
+-
+-	bool onwater;
+-	inputs->GetInputValue(&onwater,MaskElementonwaterEnum);
+-	return onwater;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ListResultsInfo{{{*/
+-void Penta::ListResultsInfo(int** in_resultsenums,int** in_resultssizes,IssmDouble** in_resultstimes,int** in_resultssteps,int* in_num_results){
+-
+-	/*Intermediaries*/
+-	int     i;
+-	int     numberofresults = 0;
+-	int     *resultsenums   = NULL;
+-	int     *resultssizes   = NULL;
+-	IssmDouble  *resultstimes   = NULL;
+-	int     *resultssteps   = NULL;
+-
+-	/*Checks*/
+-	_assert_(in_num_results);
+-
+-	/*Count number of results*/
+-	for(i=0;i<this->results->Size();i++){
+-		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+-		numberofresults++;
+-	}
+-
+-	if(numberofresults){
+-
+-		/*Allocate output*/
+-		resultsenums=xNew<int>(numberofresults);
+-		resultssizes=xNew<int>(numberofresults);
+-		resultstimes=xNew<IssmDouble>(numberofresults);
+-		resultssteps=xNew<int>(numberofresults);
+-
+-		/*populate enums*/
+-		for(i=0;i<this->results->Size();i++){
+-			ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+-			resultsenums[i]=elementresult->InstanceEnum();
+-			resultstimes[i]=elementresult->GetTime();
+-			resultssteps[i]=elementresult->GetStep();
+-			if(elementresult->ObjectEnum()==PentaP1ElementResultEnum){
+-				resultssizes[i]=P1Enum;
+-			}
+-			else{
+-				resultssizes[i]=P0Enum;
+-			}
+-		}
+-	}
+-
+-	/*Assign output pointers:*/
+-	*in_num_results=numberofresults;
+-	*in_resultsenums=resultsenums;
+-	*in_resultssizes=resultssizes;
+-	*in_resultstimes=resultstimes;
+-	*in_resultssteps=resultssteps;
+-
+-}/*}}}*/
+-/*FUNCTION Penta::MigrateGroundingLine{{{*/
+-void  Penta::MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding){
+-
+-	int     i,migration_style,unground;
+-	bool    elementonshelf = false;
+-	IssmDouble  bed_hydro,yts,gl_melting_rate;
+-	IssmDouble  rho_water,rho_ice,density;
+-	IssmDouble  melting[NUMVERTICES];
+-	IssmDouble  h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES];
+-
+-	if(!IsOnBed()) return;
+-
+-	/*Recover info at the vertices: */
+-	parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
+-	parameters->FindParam(&yts,ConstantsYtsEnum);
+-	GetInputListOnVertices(&h[0],ThicknessEnum);
+-	GetInputListOnVertices(&s[0],SurfaceEnum);
+-	GetInputListOnVertices(&b[0],BedEnum);
+-	GetInputListOnVertices(&ba[0],BathymetryEnum);
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice=matpar->GetRhoIce();
+-	density=rho_ice/rho_water;
+-	
+-	/*go through vertices, and update inputs, considering them to be PentaVertex type: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		/*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
+-		if(old_floating_ice[nodes[i]->Sid()]){
+-			if(b[i]<=ba[i]){ 
+-				b[i]=ba[i];
+-				s[i]=b[i]+h[i];
+-				nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false));
+-				nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true));
+-			}
+-		}
+-		/*Ice sheet: if hydrostatic bed above bathymetry, ice sheet starts to unground, elso do nothing */
+-		/*Change only if AgressiveMigration or if the ice sheet is in contact with the ocean*/
+-		else{
+-			bed_hydro=-density*h[i];
+-			if (bed_hydro>ba[i]){
+-				/*Unground only if the element is connected to the ice shelf*/
+-				if(migration_style==AgressiveMigrationEnum){
+-					s[i]=(1-density)*h[i];
+-					b[i]=-density*h[i];
+-					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
+-					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
+-				}
+-				else if(migration_style==SoftMigrationEnum && sheet_ungrounding[nodes[i]->Sid()]){
+-					s[i]=(1-density)*h[i];
+-					b[i]=-density*h[i];
+-					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
+-					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
+-				}
+-			}
+-		}
+-	}
+-
+-	/*If at least one vertex is now floating, the element is now floating*/
+-	for(i=0;i<NUMVERTICES;i++){
+-		if(nodes[i]->IsFloating()){
+-			elementonshelf=true;
+-			break;
+-		}
+-	}
+-	
+-   /*Add basal melting rate if element just ungrounded*/
+-	if(!this->IsFloating() && elementonshelf==true){
+-		for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
+-		this->inputs->AddInput(new PentaP1Input(BasalforcingsMeltingRateEnum,&melting[0]));
+-	} 
+-
+-	/*Update inputs*/
+-	this->inputs->AddInput(new PentaP1Input(SurfaceEnum,&s[0]));
+-	this->inputs->AddInput(new PentaP1Input(BedEnum,&b[0]));
+-   this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
+-
+-	/*Extrude inputs*/
+-	this->InputExtrude(SurfaceEnum,ElementEnum);
+-	this->InputExtrude(BedEnum,ElementEnum);
+-	this->InputExtrude(MaskElementonfloatingiceEnum,ElementEnum);
+-	this->InputExtrude(MaskVertexonfloatingiceEnum,NodeEnum);
+-	this->InputExtrude(MaskVertexongroundediceEnum,NodeEnum);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MinEdgeLength{{{*/
+-IssmDouble Penta::MinEdgeLength(IssmDouble xyz_list[6][3]){
+-	/*Return the minimum lenght of the nine egdes of the penta*/
+-
+-	int    i,node0,node1;
+-	int    edges[9][2]={{0,1},{0,2},{1,2},{3,4},{3,5},{4,5},{0,3},{1,4},{2,5}}; //list of the nine edges
+-	IssmDouble length;
+-	IssmDouble minlength=-1;
+-
+-	for(i=0;i<9;i++){
+-		/*Find the two nodes for this edge*/
+-		node0=edges[i][0];
+-		node1=edges[i][1];
+-
+-		/*Compute the length of this edge and compare it to the minimal length*/
+-		length=pow(pow(xyz_list[node0][0]-xyz_list[node1][0],2.0)+pow(xyz_list[node0][1]-xyz_list[node1][1],2.0)+pow(xyz_list[node0][2]-xyz_list[node1][2],2.0),0.5);
+-		if(length<minlength || minlength<0) minlength=length;
+-	}
+-
+-	return minlength;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MyRank {{{*/
+-int    Penta::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Penta::NodalValue {{{*/
+-int    Penta::NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units){
+-
+-	int i;
+-	int found=0;
+-	IssmDouble value;
+-	Input* data=NULL;
+-	GaussPenta* gauss=NULL;
+-
+-	/*First, serarch the input: */
+-	data=inputs->GetInput(natureofdataenum); 
+-
+-	/*figure out if we have the vertex id: */
+-	found=0;
+-	for(i=0;i<NUMVERTICES;i++){
+-		if(index==nodes[i]->GetVertexId()){
+-			/*Do we have natureofdataenum in our inputs? :*/
+-			if(data){
+-				/*ok, we are good. retrieve value of input at vertex :*/
+-				gauss=new GaussPenta(); gauss->GaussVertex(i);
+-				data->GetInputValue(&value,gauss);
+-				found=1;
+-				break;
+-			}
+-		}
+-	}
+-
+-	delete gauss;
+-	if(found)*pvalue=value;
+-	return found;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::PatchFill{{{*/
+-void  Penta::PatchFill(int* pcount, Patch* patch){
+-
+-	int i,count;
+-	int vertices_ids[6];
+-
+-	/*recover pointer: */
+-	count=*pcount;
+-		
+-	/*will be needed later: */
+-	for(i=0;i<6;i++) vertices_ids[i]=nodes[i]->GetVertexId(); //vertices id start at column 3 of the patch.
+-
+-	for(i=0;i<this->results->Size();i++){
+-		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+-
+-		/*For this result,fill the information in the Patch object (element id + vertices ids), and then hand 
+-		 *it to the result object, to fill the rest: */
+-		patch->fillelementinfo(count,this->sid+1,vertices_ids,6);
+-		elementresult->PatchFill(count,patch);
+-
+-		/*increment counter: */
+-		count++;
+-	}
+-
+-	/*Assign output pointers:*/
+-	*pcount=count;
+-}/*}}}*/
+-/*FUNCTION Penta::PatchSize{{{*/
+-void  Penta::PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes){
+-
+-	int     i;
+-	int     numrows       = 0;
+-	int     numnodes      = 0;
+-	int     temp_numnodes = 0;
+-
+-	/*Go through all the results objects, and update the counters: */
+-	for (i=0;i<this->results->Size();i++){
+-		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+-		/*first, we have one more result: */
+-		numrows++;
+-		/*now, how many vertices and how many nodal values for this result? :*/
+-		temp_numnodes=elementresult->NumberOfNodalValues(); //ask result object.
+-		if(temp_numnodes>numnodes)numnodes=temp_numnodes;
+-	}
+-
+-	/*Assign output pointers:*/
+-	*pnumrows=numrows;
+-	*pnumvertices=NUMVERTICES;
+-	*pnumnodes=numnodes;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::PositiveDegreeDay{{{*/
+-void  Penta::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm){
+-
+-   IssmDouble agd[NUMVERTICES];             // surface mass balance
+-   IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+-   IssmDouble h[NUMVERTICES],s[NUMVERTICES]; // ,b
+-   IssmDouble rho_water,rho_ice;
+-
+-   /*Recover monthly temperatures and precipitation*/
+-   Input*     input=inputs->GetInput(SurfaceforcingsMonthlytemperaturesEnum); _assert_(input);
+-   Input*     input2=inputs->GetInput(SurfaceforcingsPrecipitationEnum); _assert_(input2);
+-   GaussPenta* gauss=new GaussPenta();
+-   IssmDouble time,yts;
+-   this->parameters->FindParam(&time,TimeEnum);
+-   this->parameters->FindParam(&yts,ConstantsYtsEnum);
+-   for(int month=0;month<12;month++) {
+-     for(int iv=0;iv<NUMVERTICES;iv++) {
+-       gauss->GaussVertex(iv);
+-       input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts);
+-       monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius
+-       input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts);
+-       monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
+-     }
+-   } 
+-
+-  /*Recover info at the vertices: */
+-  GetInputListOnVertices(&h[0],ThicknessEnum);
+-  GetInputListOnVertices(&s[0],SurfaceEnum);
+-
+-  /*Get material parameters :*/
+-  rho_ice=matpar->GetRhoIce();
+-  rho_water=matpar->GetRhoFreshwater();
+-
+-   /*measure the surface mass balance*/
+-   for (int iv = 0; iv < NUMVERTICES; iv++){
+-     agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], pdds, pds, signorm, yts, h[iv], s[iv], rho_ice, rho_water);
+-   }
+-
+-   /*Update inputs*/    
+-   this->inputs->AddInput(new PentaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0]));
+-   //this->inputs->AddInput(new PentaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
+-   this->InputExtrude(SurfaceforcingsMassBalanceEnum,ElementEnum);
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::PotentialSheetUngrounding{{{*/
+-void  Penta::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){
+-
+-	int     i;
+-	IssmDouble  h[NUMVERTICES],ba[NUMVERTICES];
+-	IssmDouble  bed_hydro;
+-	IssmDouble  rho_water,rho_ice,density;
+-	bool    elementonshelf = false;
+-
+-	/*material parameters: */
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice=matpar->GetRhoIce();
+-	density=rho_ice/rho_water;
+-	GetInputListOnVertices(&h[0],ThicknessEnum);
+-	GetInputListOnVertices(&ba[0],BathymetryEnum);
+-
+-	/*go through vertices, and figure out which ones are on the ice sheet, and want to unground: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		/*Find if grounded vertices want to start floating*/
+-		if (!nodes[i]->IsFloating()){
+-			bed_hydro=-density*h[i];
+-			if (bed_hydro>ba[i]){
+-				/*Vertex that could potentially unground, flag it*/
+-				potential_sheet_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
+-			}
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ProcessResultsUnits{{{*/
+-void  Penta::ProcessResultsUnits(void){
+-
+-	int i;
+-
+-	for(i=0;i<this->results->Size();i++){
+-		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+-		elementresult->ProcessUnits(this->parameters);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ReduceMatrixStokes {{{*/
+-void Penta::ReduceMatrixStokes(IssmDouble* Ke_reduced, IssmDouble* Ke_temp){
+-
+-	int    i,j;
+-	IssmDouble Kii[24][24];
+-	IssmDouble Kib[24][3];
+-	IssmDouble Kbb[3][3];
+-	IssmDouble Kbi[3][24];
+-	IssmDouble Kbbinv[3][3];
+-	IssmDouble Kright[24][24];
+-
+-	/*Create the four matrices used for reduction */
+-	for(i=0;i<24;i++){
+-		for(j=0;j<24;j++){
+-			Kii[i][j]=*(Ke_temp+27*i+j);
+-		}
+-		for(j=0;j<3;j++){
+-			Kib[i][j]=*(Ke_temp+27*i+j+24);
+-		}
+-	}
+-	for(i=0;i<3;i++){
+-		for(j=0;j<24;j++){
+-			Kbi[i][j]=*(Ke_temp+27*(i+24)+j);
+-		}
+-		for(j=0;j<3;j++){
+-			Kbb[i][j]=*(Ke_temp+27*(i+24)+j+24);
+-		}
+-	}
+-
+-	/*Inverse the matrix corresponding to bubble part Kbb */
+-	Matrix3x3Invert(&Kbbinv[0][0], &Kbb[0][0]);
+-
+-	/*Multiply matrices to create the reduce matrix Ke_reduced */
+-	TripleMultiply(&Kib[0][0],24,3,0,
+-				&Kbbinv[0][0],3,3,0,
+-				&Kbi[0][0],3,24,0,
+-				&Kright[0][0],0);
+-
+-	/*Affect value to the reduced matrix */
+-	for(i=0;i<24;i++) for(j=0;j<24;j++) *(Ke_reduced+24*i+j)=Kii[i][j]-Kright[i][j];
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ReduceVectorStokes {{{*/
+-void Penta::ReduceVectorStokes(IssmDouble* Pe_reduced, IssmDouble* Ke_temp, IssmDouble* Pe_temp){
+-
+-	int    i,j;
+-	IssmDouble Pi[24];
+-	IssmDouble Pb[3];
+-	IssmDouble Kbb[3][3];
+-	IssmDouble Kib[24][3];
+-	IssmDouble Kbbinv[3][3];
+-	IssmDouble Pright[24];
+-
+-	/*Create the four matrices used for reduction */
+-	for(i=0;i<24;i++) Pi[i]=*(Pe_temp+i);
+-	for(i=0;i<3;i++) Pb[i]=*(Pe_temp+i+24);
+-	for(j=0;j<3;j++){
+-		for(i=0;i<24;i++){
+-			Kib[i][j]=*(Ke_temp+3*i+j);
+-		}
+-		for(i=0;i<3;i++){
+-			Kbb[i][j]=*(Ke_temp+3*(i+24)+j);
+-		}
+-	}
+-
+-	/*Inverse the matrix corresponding to bubble part Kbb */
+-	Matrix3x3Invert(&Kbbinv[0][0], &Kbb[0][0]);
+-
+-	/*Multiply matrices to create the reduce matrix Ke_reduced */
+-	TripleMultiply(&Kib[0][0],24,3,0,
+-				&Kbbinv[0][0],3,3,0,
+-				&Pb[0],3,1,0,&Pright[0],0);
+-
+-	/*Affect value to the reduced matrix */
+-	for(i=0;i<24;i++) *(Pe_reduced+i)=Pi[i]-Pright[i];
+-}
+-/*}}}*/
+-/*FUNCTION Penta::RequestedOutput{{{*/
+-void Penta::RequestedOutput(int output_enum,int step,IssmDouble time){
+-			
+-	if(IsInput(output_enum)){
+-		/*just transfer this input to results, and we are done: */
+-		InputToResult(output_enum,step,time);
+-	}
+-	else{
+-		/*this input does not exist, compute it, and then transfer to results: */
+-		switch(output_enum){
+-			case BasalFrictionEnum:
+-
+-				/*create input: */
+-				BasalFrictionCreateInput();
+-
+-				/*transfer to results :*/
+-				InputToResult(output_enum,step,time);
+-
+-				/*erase input: */
+-				inputs->DeleteInput(output_enum);
+-				break;
+-			case ViscousHeatingEnum:
+-
+-				/*create input: */
+-				ViscousHeatingCreateInput();
+-
+-				/*transfer to results :*/
+-				InputToResult(output_enum,step,time);
+-
+-				/*erase input: */
+-				inputs->DeleteInput(output_enum);
+-				break;
+-
+-			case StressTensorEnum: 
+-				this->ComputeStressTensor();
+-				InputToResult(StressTensorxxEnum,step,time);
+-				InputToResult(StressTensorxyEnum,step,time);
+-				InputToResult(StressTensorxzEnum,step,time);
+-				InputToResult(StressTensoryyEnum,step,time);
+-				InputToResult(StressTensoryzEnum,step,time);
+-				InputToResult(StressTensorzzEnum,step,time);
+-				break;
+-
+-			default:
+-				/*do nothing, no need to derail the computation because one of the outputs requested cannot be found: */
+-				break;
+-		}
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ResetCoordinateSystem{{{*/
+-void  Penta::ResetCoordinateSystem(void){
+-
+-	int    approximation;
+-	IssmDouble slopex[NUMVERTICES];
+-	IssmDouble slopey[NUMVERTICES];
+-	IssmDouble xz_plane[6];
+-
+-	/*For Stokes only: we want the CS to be tangential to the bedrock*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(IsFloating() || !IsOnBed() || (approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum &&  approximation!=PattynStokesApproximationEnum)) return;
+-
+-	/*Get slope on each node*/
+-	GetInputListOnVertices(&slopex[0],BedSlopeXEnum);
+-	GetInputListOnVertices(&slopey[0],BedSlopeYEnum);
+-
+-	/*Loop over basal nodes (first 3) and update their CS*/
+-	for(int i=0;i<NUMVERTICES2D;i++){
+-
+-		/*New X axis             New Z axis*/
+-		xz_plane[0]=1.;          xz_plane[3]=-slopex[i];  
+-		xz_plane[1]=0.;          xz_plane[4]=-slopey[i];  
+-		xz_plane[2]=slopex[i];   xz_plane[5]=1.;          
+-
+-		XZvectorsToCoordinateSystem(&this->nodes[i]->coord_system[0][0],&xz_plane[0]);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SetClone {{{*/
+-void  Penta::SetClone(int* minranks){
+-
+-	_error2_("not implemented yet");
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SetCurrentConfiguration {{{*/
+-void  Penta::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
+-
+-	int analysis_counter;
+-
+-	/*go into parameters and get the analysis_counter: */
+-	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
+-
+-	/*Get Element type*/
+-	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;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SpawnTria {{{*/
+-Tria*  Penta::SpawnTria(int g0, int g1, int g2){
+-
+-	int   i,analysis_counter;
+-	int   indices[3];
+-	int   zero=0;
+-	Tria*       tria            = NULL;
+-	Inputs*     tria_inputs     = NULL;
+-	Results*    tria_results    = NULL;
+-	Parameters* tria_parameters = NULL;
+-
+-	/*go into parameters and get the analysis_counter: */
+-	this->parameters->FindParam(&analysis_counter,AnalysisCounterEnum);
+-
+-	indices[0]=g0;
+-	indices[1]=g1;
+-	indices[2]=g2;
+-
+-	tria_parameters=this->parameters;
+-	tria_inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices);
+-	tria_results=(Results*)this->results->SpawnTriaResults(indices);
+-
+-	tria=new Tria();
+-	tria->id=this->id;
+-	tria->inputs=tria_inputs;
+-	tria->results=tria_results;
+-	tria->parameters=tria_parameters;
+-	tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED)
+-	this->SpawnTriaHook(dynamic_cast<TriaHook*>(tria),&indices[0]);
+-
+-	/*Spawn matice*/
+-	tria->matice=NULL;
+-	tria->matice=(Matice*)this->matice->copy();
+-	delete tria->matice->inputs;
+-	tria->matice->inputs=(Inputs*)this->matice->inputs->SpawnTriaInputs(indices);
+-
+-	/*recover nodes, matice and matpar: */
+-	tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp();
+-	tria->matpar=(Matpar*)tria->hmatpar->delivers();
+-
+-	return tria;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SmbGradients{{{*/
+-void Penta::SmbGradients(void){
+-
+-	int i;
+-
+-	// input
+-   IssmDouble h[NUMVERTICES];					// ice thickness (m)		
+-	IssmDouble s[NUMVERTICES];					// surface elevation (m)
+-	IssmDouble a_pos[NUMVERTICES];				// Hs-SMB relation parameter 
+-	IssmDouble b_pos[NUMVERTICES];				// Hs-SMB relation parameter
+-	IssmDouble a_neg[NUMVERTICES];				// Hs-SMB relation parameter
+-	IssmDouble b_neg[NUMVERTICES];				// Hs-SMB relation paremeter
+-	IssmDouble Hc[NUMVERTICES];					// elevation of transition between accumulation regime and ablation regime
+-	IssmDouble smb_pos_max[NUMVERTICES];		// maximum SMB value in the accumulation regime
+-	IssmDouble smb_pos_min[NUMVERTICES];		// minimum SMB value in the accumulation regime
+-   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(&Hc[0],SurfaceforcingsHcEnum);
+-	GetInputListOnVertices(&smb_pos_max[0],SurfaceforcingsSmbPosMaxEnum);
+-	GetInputListOnVertices(&smb_pos_min[0],SurfaceforcingsSmbPosMinEnum);
+-	GetInputListOnVertices(&a_pos[0],SurfaceforcingsAPosEnum);
+-	GetInputListOnVertices(&b_pos[0],SurfaceforcingsBPosEnum);
+-	GetInputListOnVertices(&a_neg[0],SurfaceforcingsANegEnum);
+-	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(s[i]>Hc[i]){
+-	    smb[i]=a_pos[i]+b_pos[i]*s[i];
+-		 if(smb[i]>smb_pos_max[i]){smb[i]=smb_pos_max[i];}
+-		 if(smb[i]<smb_pos_min[i]){smb[i]=smb_pos_min[i];}
+-	  }
+-	  else{
+-	    smb[i]=a_neg[i]+b_neg[i]*s[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 PentaP1Input(SurfaceforcingsMassBalanceEnum,&smb[0]));
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SurfaceArea {{{*/
+-IssmDouble Penta::SurfaceArea(void){
+-
+-	int    approximation;
+-	IssmDouble S;
+-	Tria*  tria=NULL;
+-
+-	/*retrieve inputs :*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/*Bail out if this element if:
+-	 * -> Non MacAyeal not on the surface
+-	 * -> MacAyeal (2d model) and not on bed) */
+-	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
+-		return 0;
+-	}
+-	else if (approximation==MacAyealApproximationEnum){
+-
+-		/*This element should be collapsed into a tria element at its base. Create this tria element, 
+-		 * and compute SurfaceArea*/
+-		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+-		S=tria->SurfaceArea();
+-		delete tria->matice; delete tria;
+-		return S;
+-	}
+-	else{
+-
+-		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+-		S=tria->SurfaceArea();
+-		delete tria->matice; delete tria;
+-		return S;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SurfaceNormal {{{*/
+-void Penta::SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]){
+-
+-	int    i;
+-	IssmDouble v13[3],v23[3];
+-	IssmDouble normal[3];
+-	IssmDouble normal_norm;
+-
+-	for (i=0;i<3;i++){
+-		v13[i]=xyz_list[0][i]-xyz_list[2][i];
+-		v23[i]=xyz_list[1][i]-xyz_list[2][i];
+-	}
+-
+-	normal[0]=v13[1]*v23[2]-v13[2]*v23[1];
+-	normal[1]=v13[2]*v23[0]-v13[0]*v23[2];
+-	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
+-
+-	normal_norm=sqrt( pow(normal[0],2)+pow(normal[1],2)+pow(normal[2],2) );
+-
+-	*(surface_normal)=normal[0]/normal_norm;
+-	*(surface_normal+1)=normal[1]/normal_norm;
+-	*(surface_normal+2)=normal[2]/normal_norm;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::TimeAdapt{{{*/
+-IssmDouble  Penta::TimeAdapt(void){
+-
+-	int    i;
+-	IssmDouble C,dx,dy,dz,dt;
+-	IssmDouble maxabsvx,maxabsvy,maxabsvz;
+-	IssmDouble maxx,minx,maxy,miny,maxz,minz;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-
+-	/*get CFL coefficient:*/
+-	this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
+-
+-	/*Get for Vx and Vy, the max of abs value: */
+-	this->MaxAbsVx(&maxabsvx,false);
+-	this->MaxAbsVy(&maxabsvy,false);
+-	this->MaxAbsVz(&maxabsvz,false);
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], this->nodes, NUMVERTICES);
+-
+-	minx=xyz_list[0][0];
+-	maxx=xyz_list[0][0];
+-	miny=xyz_list[0][1];
+-	maxy=xyz_list[0][1];
+-	minz=xyz_list[0][2];
+-	maxz=xyz_list[0][2];
+-	
+-	for(i=1;i<NUMVERTICES;i++){
+-		if (xyz_list[i][0]<minx)minx=xyz_list[i][0];
+-		if (xyz_list[i][0]>maxx)maxx=xyz_list[i][0];
+-		if (xyz_list[i][1]<miny)miny=xyz_list[i][1];
+-		if (xyz_list[i][1]>maxy)maxy=xyz_list[i][1];
+-		if (xyz_list[i][2]<minz)minz=xyz_list[i][2];
+-		if (xyz_list[i][2]>maxz)maxz=xyz_list[i][2];
+-	}
+-	dx=maxx-minx;
+-	dy=maxy-miny;
+-	dz=maxz-minz;
+-
+-	/*CFL criterion: */
+-	dt=C/(maxabsvy/dx+maxabsvy/dy+maxabsvz/dz);
+-
+-	return dt;
+-}/*}}}*/
+-/*FUNCTION Penta::Update(int index,IoModel* iomodel,int analysis_counter,int analysis_type) {{{*/
+-void Penta::Update(int index,IoModel* iomodel,int analysis_counter,int analysis_type){ 
+-
+-	/*Intermediaries*/
+-	IssmInt i,j;
+-	int     penta_type;
+-	int     penta_node_ids[6];
+-	int     penta_vertex_ids[6];
+-	IssmDouble  nodeinputs[6];
+-	IssmDouble  yts;
+-	int     stabilization;
+-	bool    dakota_analysis;
+-	bool    isstokes;
+-	IssmDouble  beta,heatcapacity,referencetemperature,meltingpoint,latentheat;
+-
+-	/*Fetch parameters: */
+-	iomodel->Constant(&yts,ConstantsYtsEnum);
+-	iomodel->Constant(&stabilization,PrognosticStabilizationEnum);
+-	iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum);
+-	iomodel->Constant(&isstokes,FlowequationIsstokesEnum);
+-	iomodel->Constant(&beta,MaterialsBetaEnum);
+-	iomodel->Constant(&heatcapacity,MaterialsHeatcapacityEnum);
+-	iomodel->Constant(&referencetemperature,ConstantsReferencetemperatureEnum);
+-	iomodel->Constant(&meltingpoint,MaterialsMeltingpointEnum);
+-	iomodel->Constant(&latentheat,MaterialsLatentheatEnum);
+-
+-	/*Checks if debuging*/
+-	/*{{{*/
+-	_assert_(iomodel->Data(MeshElementsEnum));
+-	/*}}}*/
+-
+-	/*Recover element type*/
+-	if ((analysis_type==PrognosticAnalysisEnum || analysis_type==BalancethicknessAnalysisEnum) && stabilization==3){
+-		/*P1 Discontinuous Galerkin*/
+-		penta_type=P1DGEnum;
+-	}
+-	else{
+-		/*P1 Continuous Galerkin*/
+-		penta_type=P1Enum;
+-	}
+-	this->SetElementType(penta_type,analysis_counter);
+-
+-	/*Recover vertices ids needed to initialize inputs*/
+-	for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
+-
+-	/*Recover nodes ids needed to initialize the node hook.*/
+-	for(i=0;i<6;i++){ 
+-		//go recover node ids, needed to initialize the node hook.
+-		//WARNING: We assume P1 elements here!!!!!
+-		penta_node_ids[i]=iomodel->nodecounter+(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
+-	}
+-
+-	/*hooks: */
+-	this->SetHookNodes(penta_node_ids,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type
+-
+-	/*Fill with IoModel*/
+-	this->InputUpdateFromIoModel(index,iomodel);
+-
+-	/*Defaults if not provided in iomodel*/
+-	switch(analysis_type){
+-
+-		case DiagnosticHorizAnalysisEnum:
+-
+-			/*default vx,vy and vz: either observation or 0 */
+-			if(!iomodel->Data(VxEnum)){
+-				for(i=0;i<6;i++)nodeinputs[i]=0;
+-				this->inputs->AddInput(new PentaP1Input(VxEnum,nodeinputs));
+-				if(dakota_analysis) this->inputs->AddInput(new PentaP1Input(QmuVxEnum,nodeinputs));
+-			}
+-			if(!iomodel->Data(VyEnum)){
+-				for(i=0;i<6;i++)nodeinputs[i]=0;
+-				this->inputs->AddInput(new PentaP1Input(VyEnum,nodeinputs));
+-				if(dakota_analysis) this->inputs->AddInput(new PentaP1Input(QmuVyEnum,nodeinputs));
+-			}
+-			if(!iomodel->Data(VzEnum)){
+-				for(i=0;i<6;i++)nodeinputs[i]=0;
+-				this->inputs->AddInput(new PentaP1Input(VzEnum,nodeinputs));
+-				if(dakota_analysis) this->inputs->AddInput(new PentaP1Input(QmuVzEnum,nodeinputs));
+-			}
+-			if(!iomodel->Data(PressureEnum)){
+-				for(i=0;i<6;i++)nodeinputs[i]=0;
+-				if(dakota_analysis){
+-					this->inputs->AddInput(new PentaP1Input(PressureEnum,nodeinputs));
+-					this->inputs->AddInput(new PentaP1Input(QmuPressureEnum,nodeinputs));
+-				}
+-				if(isstokes){
+-					this->inputs->AddInput(new PentaP1Input(PressureEnum,nodeinputs));
+-					this->inputs->AddInput(new PentaP1Input(PressurePicardEnum,nodeinputs));
+-				}
+-			}
+-			if(*(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynStokesApproximationEnum){
+-				/*Create VzPattyn and VzStokes Enums*/
+-				if(iomodel->Data(VzEnum) && iomodel->Data(FlowequationBorderstokesEnum)){
+-					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1];
+-					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
+-					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1]);
+-					this->inputs->AddInput(new PentaP1Input(VzPattynEnum,nodeinputs));
+-				}
+-				else{
+-					for(i=0;i<6;i++)nodeinputs[i]=0;
+-					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
+-					this->inputs->AddInput(new PentaP1Input(VzPattynEnum,nodeinputs));
+-				}
+-			}
+-			if(*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealStokesApproximationEnum){
+-				/*Create VzMacAyeal and VzStokes Enums*/
+-				if(iomodel->Data(VzEnum) && iomodel->Data(FlowequationBorderstokesEnum)){
+-					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1];
+-					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
+-					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1]);
+-					this->inputs->AddInput(new PentaP1Input(VzMacAyealEnum,nodeinputs));
+-				}
+-				else{
+-					for(i=0;i<6;i++)nodeinputs[i]=0;
+-					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
+-					this->inputs->AddInput(new PentaP1Input(VzMacAyealEnum,nodeinputs));
+-				}
+-			}
+-			break;
+-
+-		case ThermalAnalysisEnum:
+-			/*Initialize mesh velocity*/
+-			for(i=0;i<6;i++)nodeinputs[i]=0;
+-			this->inputs->AddInput(new PentaP1Input(VxMeshEnum,nodeinputs));
+-			this->inputs->AddInput(new PentaP1Input(VyMeshEnum,nodeinputs));
+-			this->inputs->AddInput(new PentaP1Input(VzMeshEnum,nodeinputs));
+-			break;
+-
+-		case EnthalpyAnalysisEnum:
+-			/*Initialize mesh velocity*/
+-			for(i=0;i<6;i++)nodeinputs[i]=0;
+-			this->inputs->AddInput(new PentaP1Input(VxMeshEnum,nodeinputs));
+-			this->inputs->AddInput(new PentaP1Input(VyMeshEnum,nodeinputs));
+-			this->inputs->AddInput(new PentaP1Input(VzMeshEnum,nodeinputs));
+-			if (iomodel->Data(TemperatureEnum) && iomodel->Data(WaterfractionEnum) && iomodel->Data(PressureEnum)) {
+-				for(i=0;i<6;i++){
+-					if(iomodel->Data(TemperatureEnum)[penta_vertex_ids[i]-1] < meltingpoint-beta*iomodel->Data(PressureEnum)[penta_vertex_ids[i]-1]){
+-						nodeinputs[i]=heatcapacity*(iomodel->Data(TemperatureEnum)[penta_vertex_ids[i]-1]-referencetemperature);
+-					}
+-					else nodeinputs[i]=heatcapacity*
+-					 (meltingpoint-beta*iomodel->Data(PressureEnum)[penta_vertex_ids[i]-1]-referencetemperature)
+-						+latentheat*iomodel->Data(WaterfractionEnum)[penta_vertex_ids[i]-1];
+-				}
+-				this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,nodeinputs));
+-			}
+-			else _error2_("temperature and waterfraction required for the enthalpy solution");
+-			break;
+-
+-		default:
+-			/*No update for other solution types*/
+-			break;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::UpdatePotentialSheetUngrounding{{{*/
+-int Penta::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
+-
+-	int i;
+-	int nflipped=0;
+-
+-	/*Go through nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		if (vertices_potentially_ungrounding[nodes[i]->Sid()]){
+-			vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
+-		
+-			/*If node was not on ice shelf, we flipped*/
+-			if(nodes_on_iceshelf[nodes[i]->Sid()]==0){
+-				nflipped++;
+-			}
+-		}
+-	}
+-	return nflipped;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ViscousHeatingCreateInput {{{*/
+-void Penta::ViscousHeatingCreateInput(void){
+-
+-	/*Constants*/
+-	const int  numdof=NUMVERTICES*NDOF1;
+-
+-	/*Intermediaries*/
+-	int    iv;
+-	IssmDouble phi;
+-	IssmDouble viscosity;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble epsilon[6];
+-	IssmDouble     viscousheating[NUMVERTICES]={0,0,0,0,0,0};
+-	IssmDouble     thickness;
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	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* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+-
+-	/*loop over vertices: */
+-	gauss=new GaussPenta();
+-	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
+-		
+-		thickness_input->GetInputValue(&thickness,gauss);
+-
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-		GetPhi(&phi, &epsilon[0], viscosity);
+-		
+-
+-		viscousheating[iv]=phi*thickness;
+-	}
+-
+-	/*Create PentaVertex input, which will hold the basal friction:*/
+-	this->inputs->AddInput(new PentaP1Input(ViscousHeatingEnum,&viscousheating[0]));
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SmearFunction {{{*/
+-void  Penta::SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
+-	_error2_("not implemented yet");
+-}
+-/*}}}*/
+-
+-#ifdef _HAVE_RESPONSES_
+-/*FUNCTION Penta::IceVolume {{{*/
+-IssmDouble Penta::IceVolume(void){
+-
+-	/*The volume of a troncated prism is base * 1/3 sum(length of edges)*/
+-	IssmDouble base,height;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-
+-	if(IsOnWater())return 0;
+-
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*First calculate the area of the base (cross section triangle)
+-	 * http://en.wikipedia.org/wiki/Pentangle
+-	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
+-	base = 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
+-
+-	/*Now get the average height*/
+-	height = 1./3.*((xyz_list[3][2]-xyz_list[0][2])+(xyz_list[4][2]-xyz_list[1][2])+(xyz_list[5][2]-xyz_list[2][2]));
+-
+-	/*Return: */
+-	return base*height;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MinVel{{{*/
+-void  Penta::MinVel(IssmDouble* pminvel, bool process_units){
+-
+-	/*Get minimum:*/
+-	IssmDouble minvel=this->inputs->Min(VelEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) minvel=UnitConversion(minvel,IuToExtEnum,VelEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvel=minvel;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MinVx{{{*/
+-void  Penta::MinVx(IssmDouble* pminvx, bool process_units){
+-
+-	/*Get minimum:*/
+-	IssmDouble minvx=this->inputs->Min(VxEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) minvx=UnitConversion(minvx,IuToExtEnum,VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvx=minvx;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MinVy{{{*/
+-void  Penta::MinVy(IssmDouble* pminvy, bool process_units){
+-
+-	/*Get minimum:*/
+-	IssmDouble minvy=this->inputs->Min(VyEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) minvy=UnitConversion(minvy,IuToExtEnum,VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvy=minvy;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MinVz{{{*/
+-void  Penta::MinVz(IssmDouble* pminvz, bool process_units){
+-
+-	/*Get minimum:*/
+-	IssmDouble minvz=this->inputs->Min(VzEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) minvz=UnitConversion(minvz,IuToExtEnum,VzEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvz=minvz;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MassFlux {{{*/
+-IssmDouble Penta::MassFlux( IssmDouble* segment,bool process_units){
+-
+-	IssmDouble mass_flux=0;
+-
+-	if(!IsOnBed()) return mass_flux;
+-
+-	/*Depth Averaging Vx and Vy*/
+-	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
+-	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
+-
+-	/*Spawn Tria element from the base of the Penta: */
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	mass_flux=tria->MassFlux(segment,process_units);
+-	delete tria->matice; delete tria;
+-
+-	/*Delete Vx and Vy averaged*/
+-	this->inputs->DeleteInput(VxAverageEnum);
+-	this->inputs->DeleteInput(VyAverageEnum);
+-
+-	/*clean up and return*/
+-	return mass_flux;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MaxAbsVx{{{*/
+-void  Penta::MaxAbsVx(IssmDouble* pmaxabsvx, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvx=this->inputs->MaxAbs(VxEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxabsvx=UnitConversion(maxabsvx,IuToExtEnum,VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvx=maxabsvx;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MaxAbsVy{{{*/
+-void  Penta::MaxAbsVy(IssmDouble* pmaxabsvy, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvy=this->inputs->MaxAbs(VyEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxabsvy=UnitConversion(maxabsvy,IuToExtEnum,VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvy=maxabsvy;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MaxAbsVz{{{*/
+-void  Penta::MaxAbsVz(IssmDouble* pmaxabsvz, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvz=this->inputs->MaxAbs(VzEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxabsvz=UnitConversion(maxabsvz,IuToExtEnum,VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvz=maxabsvz;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MaxVel{{{*/
+-void  Penta::MaxVel(IssmDouble* pmaxvel, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvel=this->inputs->Max(VelEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxvel=UnitConversion(maxvel,IuToExtEnum,VelEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvel=maxvel;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MaxVx{{{*/
+-void  Penta::MaxVx(IssmDouble* pmaxvx, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvx=this->inputs->Max(VxEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxvx=UnitConversion(maxvx,IuToExtEnum,VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvx=maxvx;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MaxVy{{{*/
+-void  Penta::MaxVy(IssmDouble* pmaxvy, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvy=this->inputs->Max(VyEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxvy=UnitConversion(maxvy,IuToExtEnum,VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvy=maxvy;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::MaxVz{{{*/
+-void  Penta::MaxVz(IssmDouble* pmaxvz, bool process_units){
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvz=this->inputs->Max(VzEnum);
+-
+-	/*process units if requested: */
+-	if(process_units) maxvz=UnitConversion(maxvz,IuToExtEnum,VzEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvz=maxvz;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ElementResponse{{{*/
+-void Penta::ElementResponse(IssmDouble* presponse,int response_enum,bool process_units){
+-
+-	switch(response_enum){
+-		case MaterialsRheologyBbarEnum:
+-			*presponse=this->matice->GetBbar();
+-			break;
+-		case VelEnum:
+-
+-			/*Get input:*/
+-			IssmDouble vel;
+-			Input* vel_input;
+-
+-			vel_input=this->inputs->GetInput(VelEnum); _assert_(vel_input);
+-			vel_input->GetInputAverage(&vel);
+-
+-			/*process units if requested: */
+-			if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum);
+-
+-			/*Assign output pointers:*/
+-			*presponse=vel;
+-		default:  
+-			_error2_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::TotalSmb {{{*/
+-IssmDouble Penta::TotalSmb(void){
+-
+-	/*The smb[Gt yr-1] of one element is area[m2] * smb [ m ice yr^-1] * rho_ice [kg m-3] / 1e+10^12 */
+-	IssmDouble base,smb,rho_ice;
+-	IssmDouble Total_Smb=0;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-
+-	/*Get material parameters :*/
+-	rho_ice=matpar->GetRhoIce();
+-
+-	if(IsOnWater() || !IsOnSurface()) return 0.;
+-	
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*First calculate the area of the base (cross section triangle)
+-	 * http://en.wikipedia.org/wiki/Triangle
+-	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
+-	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
+-
+-	/*Now get the average SMB over the element*/
+-	Input* smb_input = inputs->GetInput(SurfaceforcingsMassBalanceEnum); _assert_(smb_input);
+-	smb_input->GetInputAverage(&smb);
+-	Total_Smb=rho_ice*base*smb;// smb on element in kg s-1
+-	
+-	/*Process units: */
+-	Total_Smb=UnitConversion(Total_Smb,IuToExtEnum,TotalSmbEnum);// smb on element in GigaTon yr-1
+-	
+-	/*Return: */
+-	return Total_Smb;
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_THERMAL_
+-/*FUNCTION Penta::CreateKMatrixEnthalpy {{{*/
+-ElementMatrix* Penta::CreateKMatrixEnthalpy(void){
+-	
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixEnthalpyVolume();
+-	ElementMatrix* Ke2=CreateKMatrixEnthalpyShelf();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
+-	
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixEnthalpyVolume {{{*/
+-ElementMatrix* Penta::CreateKMatrixEnthalpyVolume(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        stabilization;
+-	int        i,j,ig,found=0;
+-	IssmDouble     Jdet,u,v,w,um,vm,wm;
+-	IssmDouble     h,hx,hy,hz,vx,vy,vz,vel;
+-	IssmDouble     gravity,rho_ice,rho_water;
+-	IssmDouble     epsvel=2.220446049250313e-16;
+-	IssmDouble     heatcapacity,thermalconductivity,dt;
+-	IssmDouble     pressure,enthalpy;
+-	IssmDouble     latentheat,kappa;
+-	IssmDouble     tau_parameter,diameter;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     B_conduct[3][numdof];
+-	IssmDouble     B_advec[3][numdof];
+-	IssmDouble     Bprime_advec[3][numdof];
+-	IssmDouble     L[numdof];
+-	IssmDouble     dbasis[3][6];
+-	IssmDouble     D_scalar_conduct,D_scalar_advec;
+-	IssmDouble     D_scalar_trans,D_scalar_stab;
+-	IssmDouble     D[3][3];
+-	IssmDouble     K[3][3]={0.0};
+-	Tria*      tria=NULL;
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice=matpar->GetRhoIce();
+-	gravity=matpar->GetG();
+-	heatcapacity=matpar->GetHeatCapacity();
+-	latentheat=matpar->GetLatentHeat();
+-	thermalconductivity=matpar->GetThermalConductivity();
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
+-	Input* pressure_input=inputs->GetInput(PressureEnum);      _assert_(pressure_input);
+-	Input* enthalpy_input=inputs->GetInput(EnthalpyPicardEnum);_assert_(enthalpy_input); //for this iteration of the step
+-	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* vxm_input=inputs->GetInput(VxMeshEnum);             _assert_(vxm_input);
+-	Input* vym_input=inputs->GetInput(VyMeshEnum);             _assert_(vym_input);
+-	Input* vzm_input=inputs->GetInput(VzMeshEnum);             _assert_(vzm_input);
+-	if (stabilization==2) diameter=MinEdgeLength(xyz_list);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Conduction: */  
+-		/*Need to change that depending on enthalpy value -> cold or temperate ice: */  
+-		GetBConduct(&B_conduct[0][0],&xyz_list[0][0],gauss); 
+-
+-		enthalpy_input->GetInputValue(&enthalpy, gauss);
+-		pressure_input->GetInputValue(&pressure, gauss);
+-		kappa=matpar->GetEnthalpyDiffusionParameter(enthalpy,pressure);
+-		D_scalar_conduct=gauss->weight*Jdet*kappa;
+-		if(dt) D_scalar_conduct=D_scalar_conduct*dt;
+-
+-		D[0][0]=D_scalar_conduct; D[0][1]=0; D[0][2]=0;
+-		D[1][0]=0; D[1][1]=D_scalar_conduct; D[1][2]=0;
+-		D[2][0]=0; D[2][1]=0; D[2][2]=D_scalar_conduct;
+-
+-		TripleMultiply(&B_conduct[0][0],3,numdof,1,
+-					&D[0][0],3,3,0,
+-					&B_conduct[0][0],3,numdof,0,
+-					&Ke->values[0],1);
+-
+-		/*Advection: */
+-		GetBAdvec(&B_advec[0][0],&xyz_list[0][0],gauss); 
+-		GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
+-
+-		vx_input->GetInputValue(&u, gauss); vxm_input->GetInputValue(&um,gauss); vx=u-um; 
+-		vy_input->GetInputValue(&v, gauss); vym_input->GetInputValue(&vm,gauss); vy=v-vm; 
+-		vz_input->GetInputValue(&w, gauss); vzm_input->GetInputValue(&wm,gauss); vz=w-wm;
+-
+-		D_scalar_advec=gauss->weight*Jdet;
+-		if(dt) D_scalar_advec=D_scalar_advec*dt;
+-
+-		D[0][0]=D_scalar_advec*vx;D[0][1]=0;                D[0][2]=0;
+-		D[1][0]=0;                D[1][1]=D_scalar_advec*vy;D[1][2]=0;
+-		D[2][0]=0;                D[2][1]=0;                D[2][2]=D_scalar_advec*vz;
+-
+-		TripleMultiply(&B_advec[0][0],3,numdof,1,
+-					&D[0][0],3,3,0,
+-					&Bprime_advec[0][0],3,numdof,0,
+-					&Ke->values[0],1);
+-
+-		/*Transient: */
+-		if(dt){
+-			GetNodalFunctionsP1(&L[0], gauss);
+-			D_scalar_trans=gauss->weight*Jdet;
+-			D_scalar_trans=D_scalar_trans;
+-
+-			TripleMultiply(&L[0],numdof,1,0,
+-						&D_scalar_trans,1,1,0,
+-						&L[0],1,numdof,0,
+-						&Ke->values[0],1);
+-		}
+-
+-		/*Artifficial diffusivity*/
+-		if(stabilization==1){
+-			/*Build K: */
+-			GetElementSizes(&hx,&hy,&hz);
+-			vel=sqrt(pow(vx,2.)+pow(vy,2.)+pow(vz,2.))+1.e-14;
+-			h=sqrt( pow(hx*vx/vel,2.) + pow(hy*vy/vel,2.) + pow(hz*vz/vel,2.));
+-			K[0][0]=h/(2*vel)*vx*vx;  K[0][1]=h/(2*vel)*vx*vy; K[0][2]=h/(2*vel)*vx*vz;
+-			K[1][0]=h/(2*vel)*vy*vx;  K[1][1]=h/(2*vel)*vy*vy; K[1][2]=h/(2*vel)*vy*vz;
+-			K[2][0]=h/(2*vel)*vz*vx;  K[2][1]=h/(2*vel)*vz*vy; K[2][2]=h/(2*vel)*vz*vz;
+-			D_scalar_stab=gauss->weight*Jdet;
+-			if(dt) D_scalar_stab=D_scalar_stab*dt;
+-			for(i=0;i<3;i++) for(j=0;j<3;j++) K[i][j] = D_scalar_stab*K[i][j];
+-
+-			GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
+-
+-			TripleMultiply(&Bprime_advec[0][0],3,numdof,1,
+-						&K[0][0],3,3,0,
+-						&Bprime_advec[0][0],3,numdof,0,
+-						&Ke->values[0],1);
+-		}
+-		else if(stabilization==2){
+-			GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
+-			tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter,kappa);
+-
+-			for(i=0;i<numdof;i++){
+-				for(j=0;j<numdof;j++){
+-					Ke->values[i*numdof+j]+=tau_parameter*D_scalar_advec*
+-					  ((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i])*((u-um)*dbasis[0][j]+(v-vm)*dbasis[1][j]+(w-wm)*dbasis[2][j]);
+-				}
+-			}
+-			if(dt){
+-				for(i=0;i<numdof;i++){
+-					for(j=0;j<numdof;j++){
+-						Ke->values[i*numdof+j]+=tau_parameter*D_scalar_trans*L[j]*((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i]);
+-					}
+-				}
+-			}
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixEnthalpyShelf {{{*/
+-ElementMatrix* Penta::CreateKMatrixEnthalpyShelf(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int       i,j,ig;
+-	IssmDouble    mixed_layer_capacity,thermal_exchange_velocity;
+-	IssmDouble    rho_ice,rho_water,heatcapacity;
+-	IssmDouble    Jdet2d,dt;
+-	IssmDouble    xyz_list[NUMVERTICES][3];
+-	IssmDouble	 xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble    basis[NUMVERTICES];
+-	IssmDouble    D_scalar;
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	if (!IsOnBed() || !IsFloating()) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	mixed_layer_capacity=matpar->GetMixedLayerCapacity();
+-	thermal_exchange_velocity=matpar->GetThermalExchangeVelocity();
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice=matpar->GetRhoIce();
+-	heatcapacity=matpar->GetHeatCapacity();
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-
+-	/* Start looping on the number of gauss (nodes on the bedrock) */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-		
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
+-		GetNodalFunctionsP1(&basis[0], gauss);
+-				
+-		D_scalar=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(rho_ice*heatcapacity);
+-		if(dt) D_scalar=dt*D_scalar;
+-
+-		TripleMultiply(&basis[0],numdof,1,0,
+-					&D_scalar,1,1,0,
+-					&basis[0],1,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-	
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixMelting {{{*/
+-ElementMatrix* Penta::CreateKMatrixMelting(void){
+-
+-	if (!IsOnBed()) return NULL;
+-
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementMatrix* Ke=tria->CreateKMatrixMelting();
+-
+-	delete tria->matice; delete tria;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixThermal {{{*/
+-ElementMatrix* Penta::CreateKMatrixThermal(void){
+-	
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixThermalVolume();
+-	ElementMatrix* Ke2=CreateKMatrixThermalShelf();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
+-	
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixThermalVolume {{{*/
+-ElementMatrix* Penta::CreateKMatrixThermalVolume(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        stabilization;
+-	int        i,j,ig,found=0;
+-	IssmDouble     Jdet,u,v,w,um,vm,wm,vel;
+-	IssmDouble     h,hx,hy,hz,vx,vy,vz;
+-	IssmDouble     gravity,rho_ice,rho_water,kappa;
+-	IssmDouble     heatcapacity,thermalconductivity,dt;
+-	IssmDouble     tau_parameter,diameter;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     B_conduct[3][numdof];
+-	IssmDouble     B_advec[3][numdof];
+-	IssmDouble     Bprime_advec[3][numdof];
+-	IssmDouble     L[numdof];
+-	IssmDouble     dbasis[3][6];
+-	IssmDouble     D_scalar_conduct,D_scalar_advec;
+-	IssmDouble     D_scalar_trans,D_scalar_stab;
+-	IssmDouble     D[3][3];
+-	IssmDouble     K[3][3]={0.0};
+-	Tria*      tria=NULL;
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice=matpar->GetRhoIce();
+-	gravity=matpar->GetG();
+-	heatcapacity=matpar->GetHeatCapacity();
+-	thermalconductivity=matpar->GetThermalConductivity();
+-	kappa=thermalconductivity/(rho_ice*heatcapacity);
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
+-	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* vxm_input=inputs->GetInput(VxMeshEnum); _assert_(vxm_input);
+-	Input* vym_input=inputs->GetInput(VyMeshEnum); _assert_(vym_input);
+-	Input* vzm_input=inputs->GetInput(VzMeshEnum); _assert_(vzm_input);
+-	if (stabilization==2) diameter=MinEdgeLength(xyz_list);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-
+-		/*Conduction: */
+-
+-		GetBConduct(&B_conduct[0][0],&xyz_list[0][0],gauss); 
+-
+-		D_scalar_conduct=gauss->weight*Jdet*kappa;
+-		if(dt) D_scalar_conduct=D_scalar_conduct*dt;
+-
+-		D[0][0]=D_scalar_conduct; D[0][1]=0; D[0][2]=0;
+-		D[1][0]=0; D[1][1]=D_scalar_conduct; D[1][2]=0;
+-		D[2][0]=0; D[2][1]=0; D[2][2]=D_scalar_conduct;
+-
+-		TripleMultiply(&B_conduct[0][0],3,numdof,1,
+-					&D[0][0],3,3,0,
+-					&B_conduct[0][0],3,numdof,0,
+-					&Ke->values[0],1);
+-
+-		/*Advection: */
+-
+-		GetBAdvec(&B_advec[0][0],&xyz_list[0][0],gauss); 
+-		GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
+-
+-		vx_input->GetInputValue(&u, gauss); vxm_input->GetInputValue(&um,gauss); vx=u-um;
+-		vy_input->GetInputValue(&v, gauss); vym_input->GetInputValue(&vm,gauss); vy=v-vm;
+-		vz_input->GetInputValue(&w, gauss); vzm_input->GetInputValue(&wm,gauss); vz=w-wm;
+-
+-		D_scalar_advec=gauss->weight*Jdet;
+-		if(dt) D_scalar_advec=D_scalar_advec*dt;
+-
+-		D[0][0]=D_scalar_advec*vx;    D[0][1]=0;                    D[0][2]=0;
+-		D[1][0]=0;                    D[1][1]=D_scalar_advec*vy;    D[1][2]=0;
+-		D[2][0]=0;                    D[2][1]=0;                    D[2][2]=D_scalar_advec*vz;
+-
+-		TripleMultiply(&B_advec[0][0],3,numdof,1,
+-					&D[0][0],3,3,0,
+-					&Bprime_advec[0][0],3,numdof,0,
+-					&Ke->values[0],1);
+-
+-		/*Transient: */
+-		if(dt){
+-			GetNodalFunctionsP1(&L[0], gauss);
+-			D_scalar_trans=gauss->weight*Jdet;
+-			D_scalar_trans=D_scalar_trans;
+-
+-			TripleMultiply(&L[0],numdof,1,0,
+-						&D_scalar_trans,1,1,0,
+-						&L[0],1,numdof,0,
+-						&Ke->values[0],1);
+-		}
+-
+-		/*Artifficial diffusivity*/
+-		if(stabilization==1){
+-			/*Build K: */
+-			GetElementSizes(&hx,&hy,&hz);
+-			vel=sqrt(pow(vx,2.)+pow(vy,2.)+pow(vz,2.))+1.e-14;
+-			h=sqrt( pow(hx*vx/vel,2.) + pow(hy*vy/vel,2.) + pow(hz*vz/vel,2.));
+-
+-			K[0][0]=h/(2*vel)*fabs(vx*vx);  K[0][1]=h/(2*vel)*fabs(vx*vy); K[0][2]=h/(2*vel)*fabs(vx*vz);
+-			K[1][0]=h/(2*vel)*fabs(vy*vx);  K[1][1]=h/(2*vel)*fabs(vy*vy); K[1][2]=h/(2*vel)*fabs(vy*vz);
+-			K[2][0]=h/(2*vel)*fabs(vz*vx);  K[2][1]=h/(2*vel)*fabs(vz*vy); K[2][2]=h/(2*vel)*fabs(vz*vz);
+-
+-			D_scalar_stab=gauss->weight*Jdet;
+-			if(dt) D_scalar_stab=D_scalar_stab*dt;
+-			for(i=0;i<3;i++) for(j=0;j<3;j++) K[i][j] = D_scalar_stab*K[i][j];
+-
+-			GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
+-
+-			TripleMultiply(&Bprime_advec[0][0],3,numdof,1,
+-						&K[0][0],3,3,0,
+-						&Bprime_advec[0][0],3,numdof,0,
+-						&Ke->values[0],1);
+-		}
+-		else if(stabilization==2){
+-			GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
+-			tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter,kappa);
+-
+-			for(i=0;i<numdof;i++){
+-				for(j=0;j<numdof;j++){
+-					Ke->values[i*numdof+j]+=tau_parameter*D_scalar_advec*
+-					  ((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i])*((u-um)*dbasis[0][j]+(v-vm)*dbasis[1][j]+(w-wm)*dbasis[2][j]);
+-				}
+-			}
+-			if(dt){
+-				for(i=0;i<numdof;i++){
+-					for(j=0;j<numdof;j++){
+-						Ke->values[i*numdof+j]+=tau_parameter*D_scalar_trans*L[j]*((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i]);
+-					}
+-				}
+-			}
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixThermalShelf {{{*/
+-ElementMatrix* Penta::CreateKMatrixThermalShelf(void){
+-
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int       i,j,ig;
+-	IssmDouble    mixed_layer_capacity,thermal_exchange_velocity;
+-	IssmDouble    rho_ice,rho_water,heatcapacity;
+-	IssmDouble    Jdet2d,dt;
+-	IssmDouble    xyz_list[NUMVERTICES][3];
+-	IssmDouble	 xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble    basis[NUMVERTICES];
+-	IssmDouble    D_scalar;
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	if (!IsOnBed() || !IsFloating()) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	mixed_layer_capacity=matpar->GetMixedLayerCapacity();
+-	thermal_exchange_velocity=matpar->GetThermalExchangeVelocity();
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice=matpar->GetRhoIce();
+-	heatcapacity=matpar->GetHeatCapacity();
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-
+-	/* Start looping on the number of gauss (nodes on the bedrock) */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-		
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
+-		GetNodalFunctionsP1(&basis[0], gauss);
+-				
+-		D_scalar=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(heatcapacity*rho_ice);
+-		if(dt) D_scalar=dt*D_scalar;
+-
+-		TripleMultiply(&basis[0],numdof,1,0,
+-					&D_scalar,1,1,0,
+-					&basis[0],1,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-	
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorEnthalpy {{{*/
+-ElementVector* Penta::CreatePVectorEnthalpy(void){
+-
+-	/*compute all load vectors for this element*/
+-	ElementVector* pe1=CreatePVectorEnthalpyVolume();
+-	ElementVector* pe2=CreatePVectorEnthalpySheet();
+-	ElementVector* pe3=CreatePVectorEnthalpyShelf();
+-	ElementVector* pe =new ElementVector(pe1,pe2,pe3);
+-
+-	/*clean-up and return*/
+-	delete pe1;
+-	delete pe2;
+-	delete pe3;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorEnthalpyVolume {{{*/
+-ElementVector* Penta::CreatePVectorEnthalpyVolume(void){
+-
+-	/*Constants*/
+-	const int  numdof=NUMVERTICES*NDOF1;
+-
+-	/*Intermediaries*/
+-	int    i,j,ig,found=0;
+-	int    friction_type,stabilization;
+-	IssmDouble Jdet,phi,dt;
+-	IssmDouble rho_ice,heatcapacity;
+-	IssmDouble thermalconductivity,kappa;
+-	IssmDouble viscosity,pressure;
+-	IssmDouble enthalpy,enthalpypicard;
+-	IssmDouble tau_parameter,diameter;
+-	IssmDouble u,v,w;
+-	IssmDouble scalar_def,scalar_transient;
+-	IssmDouble temperature_list[NUMVERTICES];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble L[numdof];
+-	IssmDouble dbasis[3][6];
+-	IssmDouble epsilon[6];
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	rho_ice=matpar->GetRhoIce();
+-	heatcapacity=matpar->GetHeatCapacity();
+-	thermalconductivity=matpar->GetThermalConductivity();
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
+-	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* pressure_input=inputs->GetInput(PressureEnum);                      _assert_(pressure_input);
+-	Input* enthalpy_input=NULL; 
+-	Input* enthalpypicard_input=NULL; 
+-	if(dt){
+-		enthalpy_input=inputs->GetInput(EnthalpyEnum); _assert_(enthalpy_input);
+-	}
+-	if (stabilization==2){
+-		diameter=MinEdgeLength(xyz_list);
+-		enthalpypicard_input=inputs->GetInput(EnthalpyPicardEnum); _assert_(enthalpypicard_input);
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(2,3);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsP1(&L[0], gauss);
+-
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-		GetPhi(&phi, &epsilon[0], viscosity);
+-
+-		scalar_def=phi/rho_ice*Jdet*gauss->weight;
+-		if(dt) scalar_def=scalar_def*dt;
+-
+-		for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_def*L[i];
+-
+-		/* Build transient now */
+-		if(dt){
+-			enthalpy_input->GetInputValue(&enthalpy, gauss);
+-			scalar_transient=enthalpy*Jdet*gauss->weight;
+-			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_transient*L[i];
+-		}
+-
+-		if(stabilization==2){
+-			GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
+-
+-			vx_input->GetInputValue(&u, gauss);
+-			vy_input->GetInputValue(&v, gauss);
+-			vz_input->GetInputValue(&w, gauss);
+-			pressure_input->GetInputValue(&pressure, gauss);
+-			enthalpypicard_input->GetInputValue(&enthalpypicard, gauss);
+-			kappa=matpar->GetEnthalpyDiffusionParameter(enthalpy,pressure);
+-			tau_parameter=GetStabilizationParameter(u,v,w,diameter,kappa);
+-
+-			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
+-			if(dt){
+-				for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
+-			}
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorEnthalpyShelf {{{*/
+-ElementVector* Penta::CreatePVectorEnthalpyShelf(void){
+-
+-	/*Constants*/
+-	const int  numdof=NUMVERTICES*NDOF1;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     Jdet2d;
+-	IssmDouble     heatcapacity,h_pmp;
+-	IssmDouble     mixed_layer_capacity,thermal_exchange_velocity;
+-	IssmDouble     rho_ice,rho_water,pressure,dt,scalar_ocean;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble     basis[NUMVERTICES];
+-	GaussPenta* gauss=NULL;
+-
+-	/* Ice/ocean heat exchange flux on ice shelf base */
+-	if (!IsOnBed() || !IsFloating()) return NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-	mixed_layer_capacity=matpar->GetMixedLayerCapacity();
+-	thermal_exchange_velocity=matpar->GetThermalExchangeVelocity();
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice=matpar->GetRhoIce();
+-	heatcapacity=matpar->GetHeatCapacity();
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input);
+-
+-	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
+-		GetNodalFunctionsP1(&basis[0], gauss);
+-
+-		pressure_input->GetInputValue(&pressure,gauss);
+-		h_pmp=matpar->PureIceEnthalpy(pressure);
+-
+-		scalar_ocean=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity*(h_pmp)/(rho_ice*heatcapacity);
+-		if(dt) scalar_ocean=dt*scalar_ocean;
+-
+-		for(i=0;i<numdof;i++) pe->values[i]+=scalar_ocean*basis[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorEnthalpySheet {{{*/
+-ElementVector* Penta::CreatePVectorEnthalpySheet(void){
+-
+-	/*Constants*/
+-	const int  numdof=NUMVERTICES*NDOF1;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	int        analysis_type;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     xyz_list_tria[NUMVERTICES2D][3]={0.0};
+-	IssmDouble     Jdet2d,dt;
+-	IssmDouble     rho_ice,heatcapacity,geothermalflux_value;
+-	IssmDouble     basalfriction,alpha2,vx,vy;
+-	IssmDouble     scalar,enthalpy,enthalpyup;
+-	IssmDouble     pressure,pressureup;
+-	IssmDouble     basis[NUMVERTICES];
+-	Friction*  friction=NULL;
+-	GaussPenta* gauss=NULL;
+-	GaussPenta* gaussup=NULL;
+-
+-	/* Geothermal flux on ice sheet base and basal friction */
+-	if (!IsOnBed() || IsFloating()) return NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	rho_ice=matpar->GetRhoIce();
+-	heatcapacity=matpar->GetHeatCapacity();
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	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* enthalpy_input=inputs->GetInput(EnthalpyEnum);             _assert_(enthalpy_input);
+-	Input* pressure_input=inputs->GetInput(PressureEnum);             _assert_(pressure_input);
+-	Input* geothermalflux_input=inputs->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
+-
+-	/*Build frictoin element, needed later: */
+-	friction=new Friction("3d",inputs,matpar,analysis_type);
+-
+-	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
+-	gauss=new GaussPenta(0,1,2,2);
+-	gaussup=new GaussPenta(3,4,5,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-		gaussup->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
+-		GetNodalFunctionsP1(&basis[0], gauss);
+-
+-		enthalpy_input->GetInputValue(&enthalpy,gauss);
+-		pressure_input->GetInputValue(&pressure,gauss);
+-//		if(enthalpy>matpar->PureIceEnthalpy(pressure)){
+-//			enthalpy_input->GetInputValue(&enthalpyup,gaussup);
+-//			pressure_input->GetInputValue(&pressureup,gaussup);
+-//			if(enthalpyup>matpar->PureIceEnthalpy(pressureup)){
+-//				//do nothing, don't add heatflux
+-//			}
+-//			else{
+-//				//need to change spcenthalpy according to Aschwanden 
+-//				//NEED TO UPDATE
+-//			}
+-//		}
+-//		else{
+-			geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
+-			friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
+-			vx_input->GetInputValue(&vx,gauss);
+-			vy_input->GetInputValue(&vy,gauss);
+-			basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
+-
+-			scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(rho_ice);
+-			if(dt) scalar=dt*scalar;
+-
+-			for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
+-//		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete gaussup;
+-	delete friction;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorMelting {{{*/
+-ElementVector* Penta::CreatePVectorMelting(void){
+-	return NULL;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorThermal {{{*/
+-ElementVector* Penta::CreatePVectorThermal(void){
+-
+-	/*compute all load vectors for this element*/
+-	ElementVector* pe1=CreatePVectorThermalVolume();
+-	ElementVector* pe2=CreatePVectorThermalSheet();
+-	ElementVector* pe3=CreatePVectorThermalShelf();
+-	ElementVector* pe =new ElementVector(pe1,pe2,pe3);
+-
+-	/*clean-up and return*/
+-	delete pe1;
+-	delete pe2;
+-	delete pe3;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorThermalVolume {{{*/
+-ElementVector* Penta::CreatePVectorThermalVolume(void){
+-
+-	/*Constants*/
+-	const int  numdof=NUMVERTICES*NDOF1;
+-
+-	/*Intermediaries*/
+-	int    i,j,ig,found=0;
+-	int    friction_type,stabilization;
+-	IssmDouble Jdet,phi,dt;
+-	IssmDouble rho_ice,heatcapacity;
+-	IssmDouble thermalconductivity,kappa;
+-	IssmDouble viscosity,temperature;
+-	IssmDouble tau_parameter,diameter;
+-	IssmDouble u,v,w;
+-	IssmDouble scalar_def,scalar_transient;
+-	IssmDouble temperature_list[NUMVERTICES];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble L[numdof];
+-	IssmDouble dbasis[3][6];
+-	IssmDouble epsilon[6];
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	rho_ice=matpar->GetRhoIce();
+-	heatcapacity=matpar->GetHeatCapacity();
+-	thermalconductivity=matpar->GetThermalConductivity();
+-	kappa=thermalconductivity/(rho_ice*heatcapacity);
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
+-	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* temperature_input=NULL;
+-	if (dt) temperature_input=inputs->GetInput(TemperatureEnum); _assert_(inputs);
+-	if (stabilization==2) diameter=MinEdgeLength(xyz_list);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(2,3);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsP1(&L[0], gauss);
+-
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-		GetPhi(&phi, &epsilon[0], viscosity);
+-
+-		scalar_def=phi/(rho_ice*heatcapacity)*Jdet*gauss->weight;
+-		if(dt) scalar_def=scalar_def*dt;
+-
+-		for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_def*L[i];
+-
+-		/* Build transient now */
+-		if(dt){
+-			temperature_input->GetInputValue(&temperature, gauss);
+-			scalar_transient=temperature*Jdet*gauss->weight;
+-			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_transient*L[i];
+-		}
+-
+-		if(stabilization==2){
+-			GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
+-
+-			vx_input->GetInputValue(&u, gauss);
+-			vy_input->GetInputValue(&v, gauss);
+-			vz_input->GetInputValue(&w, gauss);
+-
+-			tau_parameter=GetStabilizationParameter(u,v,w,diameter,kappa);
+-
+-			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
+-			if(dt){
+-				for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
+-			}
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorThermalShelf {{{*/
+-ElementVector* Penta::CreatePVectorThermalShelf(void){
+-
+-	/*Constants*/
+-	const int  numdof=NUMVERTICES*NDOF1;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     Jdet2d;
+-	IssmDouble     mixed_layer_capacity,thermal_exchange_velocity;
+-	IssmDouble     rho_ice,rho_water,pressure,dt,scalar_ocean;
+-	IssmDouble     heatcapacity,t_pmp;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble     basis[NUMVERTICES];
+-	GaussPenta* gauss=NULL;
+-
+-	/* Ice/ocean heat exchange flux on ice shelf base */
+-	if (!IsOnBed() || !IsFloating()) return NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-	mixed_layer_capacity=matpar->GetMixedLayerCapacity();
+-	thermal_exchange_velocity=matpar->GetThermalExchangeVelocity();
+-	rho_water=matpar->GetRhoWater();
+-	rho_ice=matpar->GetRhoIce();
+-	heatcapacity=matpar->GetHeatCapacity();
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input);
+-
+-	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
+-		GetNodalFunctionsP1(&basis[0], gauss);
+-
+-		pressure_input->GetInputValue(&pressure,gauss);
+-		t_pmp=matpar->TMeltingPoint(pressure);
+-
+-		scalar_ocean=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity*(t_pmp)/(heatcapacity*rho_ice);
+-		if(dt) scalar_ocean=dt*scalar_ocean;
+-
+-		for(i=0;i<numdof;i++) pe->values[i]+=scalar_ocean*basis[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorThermalSheet {{{*/
+-ElementVector* Penta::CreatePVectorThermalSheet(void){
+-
+-	/*Constants*/
+-	const int  numdof=NUMVERTICES*NDOF1;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	int        analysis_type;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     xyz_list_tria[NUMVERTICES2D][3]={0.0};
+-	IssmDouble     Jdet2d,dt;
+-	IssmDouble     rho_ice,heatcapacity,geothermalflux_value;
+-	IssmDouble     basalfriction,alpha2,vx,vy;
+-	IssmDouble     basis[NUMVERTICES];
+-	IssmDouble     scalar;
+-	Friction*  friction=NULL;
+-	GaussPenta* gauss=NULL;
+-
+-	/* Geothermal flux on ice sheet base and basal friction */
+-	if (!IsOnBed() || IsFloating()) return NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	rho_ice=matpar->GetRhoIce();
+-	heatcapacity=matpar->GetHeatCapacity();
+-	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	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* geothermalflux_input=inputs->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
+-
+-	/*Build frictoin element, needed later: */
+-	friction=new Friction("3d",inputs,matpar,analysis_type);
+-
+-	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
+-		GetNodalFunctionsP1(&basis[0], gauss);
+-
+-			geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
+-			friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
+-			vx_input->GetInputValue(&vx,gauss);
+-			vy_input->GetInputValue(&vy,gauss);
+-			basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
+-
+-			scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(heatcapacity*rho_ice);
+-			if(dt) scalar=dt*scalar;
+-
+-			for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetSolutionFromInputsThermal{{{*/
+-void  Penta::GetSolutionFromInputsThermal(Vector* solution){
+-
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	int          i;
+-	int*         doflist=NULL;
+-	IssmDouble       values[numdof];
+-	IssmDouble       temp;
+-	GaussPenta   *gauss=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-	Input* t_input=inputs->GetInput(TemperatureEnum); _assert_(t_input);
+-
+-	gauss=new GaussPenta();
+-	for(i=0;i<NUMVERTICES;i++){
+-		/*Recover temperature*/
+-		gauss->GaussVertex(i);
+-		t_input->GetInputValue(&temp,gauss);
+-		values[i]=temp;
+-	}
+-
+-	/*Add value to global vector*/
+-	solution->SetValues(numdof,doflist,values,INS_VAL);
+-
+-	/*Free ressources:*/
+-	delete gauss;
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetSolutionFromInputsEnthalpy{{{*/
+-void  Penta::GetSolutionFromInputsEnthalpy(Vector* solution){
+-
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	int          i;
+-	int*         doflist=NULL;
+-	IssmDouble       values[numdof];
+-	IssmDouble       enthalpy;
+-	GaussPenta   *gauss=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-	Input* h_input=inputs->GetInput(EnthalpyEnum); _assert_(h_input);
+-
+-	gauss=new GaussPenta();
+-	for(i=0;i<NUMVERTICES;i++){
+-		/*Recover temperature*/
+-		gauss->GaussVertex(i);
+-		h_input->GetInputValue(&enthalpy,gauss);
+-		values[i]=enthalpy;
+-	}
+-
+-	/*Add value to global vector*/
+-	solution->SetValues(numdof,doflist,values,INS_VAL);
+-
+-	/*Free ressources:*/
+-	delete gauss;
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionThermal {{{*/
+-void  Penta::InputUpdateFromSolutionThermal(IssmDouble* solution){
+-
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	bool   converged;
+-	int    i,rheology_law;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble values[numdof];
+-	IssmDouble B[numdof];
+-	IssmDouble B_average,s_average;
+-	int*   doflist=NULL;
+-	//IssmDouble pressure[numdof];
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++){
+-		values[i]=solution[doflist[i]];
+-		//GetInputListOnVertices(&pressure[0],PressureEnum);
+-		//if(values[i]>matpar->TMeltingPoint(pressure[i])) values[i]=matpar->TMeltingPoint(pressure[i]);
+-		//if(values[i]<matpar->TMeltingPoint(pressure[i])-50) values[i]=matpar->TMeltingPoint(pressure[i])-50;
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
+-		//if(values[i]<0)      _printLine_("temperature < 0°K found in solution vector");
+-		//if(values[i]>275)    _printLine_("temperature > 275°K found in solution vector (Paterson's rheology associated is negative)");
+-	}
+-
+-	/*Get all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_input);
+-
+-	this->inputs->GetInputValue(&converged,ConvergedEnum);
+-	if(converged){
+-		this->inputs->AddInput(new PentaP1Input(TemperatureEnum,values));
+-
+-		/*Update Rheology only if converged (we must make sure that the temperature is below melting point
+-		 * otherwise the rheology could be negative*/
+-		this->parameters->FindParam(&rheology_law,MaterialsRheologyLawEnum);
+-		switch(rheology_law){
+-			case NoneEnum:
+-				/*Do nothing: B is not temperature dependent*/
+-				break;
+-			case PatersonEnum:
+-				B_average=Paterson((values[0]+values[1]+values[2]+values[3]+values[4]+values[5])/6.0);
+-				for(i=0;i<numdof;i++) B[i]=B_average;
+-				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
+-				break;
+-			case ArrheniusEnum:
+-				surface_input->GetInputAverage(&s_average);
+-				B_average=Arrhenius((values[0]+values[1]+values[2]+values[3]+values[4]+values[5])/6.0,
+-							s_average-((xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2]+xyz_list[3][2]+xyz_list[4][2]+xyz_list[5][2])/6.0),
+-							matice->GetN());
+-				for(i=0;i<numdof;i++) B[i]=B_average;
+-				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
+-				break;
+-			default:
+-				_error2_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
+-
+-		}
+-	}
+-	else{
+-		this->inputs->AddInput(new PentaP1Input(TemperaturePicardEnum,values));
+-	}
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionEnthalpy {{{*/
+-void  Penta::InputUpdateFromSolutionEnthalpy(IssmDouble* solution){
+-
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	bool   converged=false;
+-	int    i,rheology_law;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble values[numdof];
+-	IssmDouble pressure[NUMVERTICES];
+-	IssmDouble temperatures[numdof];
+-	IssmDouble waterfraction[numdof];
+-	IssmDouble B[numdof];
+-	IssmDouble B_average,s_average;
+-	int*   doflist=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++){
+-		values[i]=solution[doflist[i]];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Get all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	GetInputListOnVertices(&pressure[0],PressureEnum);
+-	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_input);
+-	
+-	this->inputs->GetInputValue(&converged,ConvergedEnum);
+-	if(converged){
+-		/*Convert enthalpy into temperature and water fraction*/
+-		for(i=0;i<numdof;i++){
+-			matpar->EnthalpyToThermal(&temperatures[i],&waterfraction[i],values[i],pressure[i]);
+-			if(waterfraction[i]<0) _error2_("Negative water fraction found in solution vector");
+-			//if(waterfraction[i]>1) _error2_("Water fraction >1 found in solution vector");
+-		}
+-			
+-		this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,values));
+-		this->inputs->AddInput(new PentaP1Input(WaterfractionEnum,waterfraction));
+-		this->inputs->AddInput(new PentaP1Input(TemperatureEnum,temperatures));
+-
+-		/*Update Rheology only if converged (we must make sure that the temperature is below melting point
+-		 * otherwise the rheology could be negative*/
+-		this->parameters->FindParam(&rheology_law,MaterialsRheologyLawEnum);
+-		switch(rheology_law){
+-			case NoneEnum:
+-				/*Do nothing: B is not temperature dependent*/
+-				break;
+-			case PatersonEnum:
+-				B_average=Paterson((temperatures[0]+temperatures[1]+temperatures[2]+temperatures[3]+temperatures[4]+temperatures[5])/6.0);
+-				for(i=0;i<numdof;i++) B[i]=B_average;
+-				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
+-				break;
+-			case ArrheniusEnum:
+-				surface_input->GetInputAverage(&s_average);
+-				B_average=Arrhenius((temperatures[0]+temperatures[1]+temperatures[2]+temperatures[3]+temperatures[4]+temperatures[5])/6.0,
+-							s_average-((xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2]+xyz_list[3][2]+xyz_list[4][2]+xyz_list[5][2])/6.0),
+-							matice->GetN());
+-				for(i=0;i<numdof;i++) B[i]=B_average;
+-				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
+-				break;
+-			default:
+-				_error2_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
+-
+-		}
+-	}
+-	else{
+-		this->inputs->AddInput(new PentaP1Input(EnthalpyPicardEnum,values));
+-	}
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_CONTROL_
+-/*FUNCTION Penta::ControlInputGetGradient{{{*/
+-void Penta::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){
+-
+-	int doflist1[NUMVERTICES];
+-	Input* input=NULL;
+-
+-	if(enum_type==MaterialsRheologyBbarEnum){
+-		if(!IsOnBed()) return;
+-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
+-	}
+-	else{
+-		input=inputs->GetInput(enum_type);
+-	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+-
+-	GradientIndexing(&doflist1[0],control_index);
+-	((ControlInput*)input)->GetGradient(gradient,&doflist1[0]);
+-
+-}/*}}}*/
+-/*FUNCTION Penta::ControlInputScaleGradient{{{*/
+-void Penta::ControlInputScaleGradient(int enum_type,IssmDouble scale){
+-
+-	Input* input=NULL;
+-
+-	if(enum_type==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
+-	}
+-	else{
+-		input=inputs->GetInput(enum_type);
+-	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+-
+-	((ControlInput*)input)->ScaleGradient(scale);
+-}/*}}}*/
+-/*FUNCTION Penta::ControlInputSetGradient{{{*/
+-void Penta::ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){
+-
+-	int    doflist1[NUMVERTICES];
+-	IssmDouble grad_list[NUMVERTICES];
+-	Input* grad_input=NULL;
+-	Input* input=NULL;
+-
+-	if(enum_type==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
+-	}
+-	else{
+-		input=inputs->GetInput(enum_type);
+-	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+-
+-	GradientIndexing(&doflist1[0],control_index);
+-	for(int i=0;i<NUMVERTICES;i++) grad_list[i]=gradient[doflist1[i]];
+-	grad_input=new PentaP1Input(GradientEnum,grad_list);
+-	((ControlInput*)input)->SetGradient(grad_input);
+-
+-}/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixAdjointHoriz{{{*/
+-ElementMatrix* Penta::CreateKMatrixAdjointHoriz(void){
+-
+-	int approximation;
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	switch(approximation){
+-		case MacAyealApproximationEnum:
+-			return CreateKMatrixAdjointMacAyeal2d();
+-		case PattynApproximationEnum:
+-			return CreateKMatrixAdjointPattyn();
+-		case StokesApproximationEnum:
+-			return CreateKMatrixAdjointStokes();
+-		case NoneApproximationEnum:
+-			return NULL;
+-		default:
+-			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixAdjointMacAyeal2d{{{*/
+-ElementMatrix* Penta::CreateKMatrixAdjointMacAyeal2d(void){
+-
+-	/*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 
+-	  bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 
+-	  the stiffness matrix. */
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Depth Averaging B*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
+-
+-	/*Call Tria function*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementMatrix* Ke=tria->CreateKMatrixAdjointMacAyeal();
+-	delete tria->matice; delete tria;
+-
+-	/*Delete B averaged*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+-
+-	/*clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixAdjointPattyn{{{*/
+-ElementMatrix* Penta::CreateKMatrixAdjointPattyn(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	bool       incomplete_adjoint;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     Jdet;
+-	IssmDouble     eps1dotdphii,eps1dotdphij;
+-	IssmDouble     eps2dotdphii,eps2dotdphij;
+-	IssmDouble     mu_prime;
+-	IssmDouble     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+-	IssmDouble     eps1[3],eps2[3];
+-	IssmDouble     phi[NUMVERTICES];
+-	IssmDouble     dphi[3][NUMVERTICES];
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Jacobian with regular Pattyn (first part of the Gateau derivative)*/
+-	parameters->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
+-	ElementMatrix* Ke=CreateKMatrixDiagnosticPattyn();
+-	if(incomplete_adjoint) return Ke;
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+-
+-		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+-		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+-		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+-		eps1[2]=epsilon[3];                eps2[2]=epsilon[4];
+-
+-		for(i=0;i<6;i++){
+-			for(j=0;j<6;j++){
+-				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
+-				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
+-				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
+-				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
+-
+-				Ke->values[12*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
+-				Ke->values[12*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
+-				Ke->values[12*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
+-				Ke->values[12*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
+-			}
+-		}
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixAdjointStokes{{{*/
+-ElementMatrix* Penta::CreateKMatrixAdjointStokes(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF4*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	bool       incomplete_adjoint;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     Jdet;
+-	IssmDouble     eps1dotdphii,eps1dotdphij;
+-	IssmDouble     eps2dotdphii,eps2dotdphij;
+-	IssmDouble     eps3dotdphii,eps3dotdphij;
+-	IssmDouble     mu_prime;
+-	IssmDouble     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+-	IssmDouble     eps1[3],eps2[3],eps3[3];
+-	IssmDouble     phi[NUMVERTICES];
+-	IssmDouble     dphi[3][NUMVERTICES];
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Jacobian with regular Stokes (first part of the Gateau derivative)*/
+-	parameters->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
+-	ElementMatrix* Ke=CreateKMatrixDiagnosticStokes();
+-	if(incomplete_adjoint) return Ke;
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	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 gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+-
+-		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+-		eps1[0]=epsilon[0];   eps2[0]=epsilon[2];   eps3[0]=epsilon[3];
+-		eps1[1]=epsilon[2];   eps2[1]=epsilon[1];   eps3[1]=epsilon[4];
+-		eps1[2]=epsilon[3];   eps2[2]=epsilon[4];   eps3[2]= -epsilon[0] -epsilon[1];
+-
+-		for(i=0;i<6;i++){
+-			for(j=0;j<6;j++){
+-				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
+-				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
+-				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
+-				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
+-				eps3dotdphii=eps3[0]*dphi[0][i]+eps3[1]*dphi[1][i]+eps3[2]*dphi[2][i];
+-				eps3dotdphij=eps3[0]*dphi[0][j]+eps3[1]*dphi[1][j]+eps3[2]*dphi[2][j];
+-
+-				Ke->values[numdof*(4*i+0)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
+-				Ke->values[numdof*(4*i+0)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
+-				Ke->values[numdof*(4*i+0)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps1dotdphii;
+-
+-				Ke->values[numdof*(4*i+1)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
+-				Ke->values[numdof*(4*i+1)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
+-				Ke->values[numdof*(4*i+1)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps2dotdphii;
+-
+-				Ke->values[numdof*(4*i+2)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps3dotdphii;
+-				Ke->values[numdof*(4*i+2)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps3dotdphii;
+-				Ke->values[numdof*(4*i+2)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps3dotdphii;
+-			}
+-		}
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorAdjointHoriz{{{*/
+-ElementVector* Penta::CreatePVectorAdjointHoriz(void){
+-
+-	int approximation;
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	switch(approximation){
+-		case MacAyealApproximationEnum:
+-			return CreatePVectorAdjointMacAyeal();
+-		case PattynApproximationEnum:
+-			return CreatePVectorAdjointPattyn();
+-		case NoneApproximationEnum:
+-			return NULL;
+-		case StokesApproximationEnum:
+-			return CreatePVectorAdjointStokes();
+-		default:
+-			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorAdjointMacAyeal{{{*/
+-ElementVector* Penta::CreatePVectorAdjointMacAyeal(){
+-
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Call Tria function*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementVector* pe=tria->CreatePVectorAdjointHoriz();
+-	delete tria->matice; delete tria;
+-
+-	/*clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorAdjointPattyn{{{*/
+-ElementVector* Penta::CreatePVectorAdjointPattyn(void){
+-
+-	if (!IsOnSurface()) return NULL;
+-
+-	/*Call Tria function*/
+-	Tria* tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+-	ElementVector* pe=tria->CreatePVectorAdjointHoriz();
+-	delete tria->matice; delete tria;
+-
+-	/*clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorAdjointStokes{{{*/
+-ElementVector* Penta::CreatePVectorAdjointStokes(void){
+-
+-	if (!IsOnSurface()) return NULL;
+-
+-	/*Call Tria function*/
+-	Tria* tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+-	ElementVector* pe=tria->CreatePVectorAdjointStokes();
+-	delete tria->matice; delete tria;
+-
+-	/*clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GradientIndexing{{{*/
+-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->nodes[i]->GetVertexDof() + control_index;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::Gradj {{{*/
+-void  Penta::Gradj(Vector* gradient,int control_type,int control_index){
+-	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
+-
+-	int              i,approximation;
+-	Tria*            tria=NULL;
+-
+-	/*If on water, skip grad (=0): */
+-	if(IsOnWater())return;
+-
+-	/*First deal with ∂/∂alpha(KU-F)*/
+-	switch(control_type){
+-
+-		case FrictionCoefficientEnum:
+-			inputs->GetInputValue(&approximation,ApproximationEnum);
+-			switch(approximation){
+-				case MacAyealApproximationEnum:
+-					GradjDragMacAyeal(gradient,control_index);
+-					break;
+-				case PattynApproximationEnum:
+-					GradjDragPattyn(gradient,control_index);
+-					break;
+-				case StokesApproximationEnum:
+-					GradjDragStokes(gradient,control_index);
+-					break;
+-				case NoneApproximationEnum:
+-					/*Gradient is 0*/
+-					break;
+-				default:
+-					_error2_("approximation " << EnumToStringx(approximation) << " not supported yet");
+-			}
+-			break;
+-
+-		case MaterialsRheologyBbarEnum:
+-			inputs->GetInputValue(&approximation,ApproximationEnum);
+-			switch(approximation){
+-				case MacAyealApproximationEnum:
+-					GradjBbarMacAyeal(gradient,control_index);
+-					break;
+-				case PattynApproximationEnum:
+-					GradjBbarPattyn(gradient,control_index);
+-					break;
+-				case StokesApproximationEnum:
+-					GradjBbarStokes(gradient,control_index);
+-					break;
+-				case NoneApproximationEnum:
+-					/*Gradient is 0*/
+-					break;
+-				default:
+-					_error2_("approximation " << EnumToStringx(approximation) << " not supported yet");
+-			}
+-			break;
+-
+-		default:
+-			_error2_("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,NULL,StepResponsesEnum);
+-
+-	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 (!IsOnBed()) return;
+-			tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-			tria->GradjDragGradient(gradient,resp,control_index);
+-			delete tria->matice; delete tria;
+-			break;
+-		case RheologyBbarAbsGradientEnum:
+-			if (!IsOnBed()) return;
+-			tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-			tria->GradjBGradient(gradient,resp,control_index);
+-			delete tria->matice; delete tria;
+-			break;
+-		default:
+-			_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+-	}
+-	xDelete<int>(responses);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GradjDragMacAyeal {{{*/
+-void  Penta::GradjDragMacAyeal(Vector* gradient,int control_index){
+-
+-	/*Gradient is 0 if on shelf or not on bed*/
+-	if(IsFloating() || !IsOnBed()) return;
+-
+-	/*Spawn tria*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	tria->GradjDragMacAyeal(gradient,control_index);
+-	delete tria->matice; delete tria;
+-
+-} /*}}}*/
+-/*FUNCTION Penta::GradjDragPattyn {{{*/
+-void  Penta::GradjDragPattyn(Vector* gradient,int control_index){
+-
+-	int        i,j,ig;
+-	int        analysis_type;
+-	int        doflist1[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() || !IsOnBed()) return;
+-
+-	/*Retrieve all inputs and parameters*/
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	GradientIndexing(&doflist1[0],control_index);
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;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("2d",inputs,matpar,analysis_type);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(0,1,2,4);
+-	for (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,VxEnum,VyEnum,VzEnum);
+-
+-		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]; /*basis are 0 for the 3 upper nodes*/
+-		}
+-
+-		/*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,doflist1,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GradjDragStokes {{{*/
+-void  Penta::GradjDragStokes(Vector* gradient,int control_index){
+-
+-	int        i,j,ig;
+-	int        analysis_type;
+-	int        doflist1[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() || !IsOnBed()) return;
+-
+-	/*Retrieve all inputs and parameters*/
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-	GradientIndexing(&doflist1[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("3d",inputs,matpar,analysis_type);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(0,1,2,4);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/*Recover alpha_complement and drag: */
+-		friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum,VzEnum);
+-		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 */
+-		SurfaceNormal(&surface_normal[0],xyz_list_tria);
+-
+-		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,doflist1,grade_g,ADD_VAL);
+-
+-	delete friction;
+-	delete gauss;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GradjBbarMacAyeal {{{*/
+-void  Penta::GradjBbarMacAyeal(Vector* gradient,int control_index){
+-
+-	/*This element should be collapsed into a tria element at its base*/
+-	if (!IsOnBed()) return; 
+-
+-	/*Depth Average B*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
+-
+-	/*Collapse element to the base*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+-	tria->GradjBMacAyeal(gradient,control_index);
+-	delete tria->matice; delete tria;
+-
+-	/*delete Average B*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+-
+-} /*}}}*/
+-/*FUNCTION Penta::GradjBbarPattyn {{{*/
+-void  Penta::GradjBbarPattyn(Vector* gradient,int control_index){
+-
+-	/*Gradient is computed on bed only (Bbar)*/
+-	if (!IsOnBed()) return;
+-
+-	/*Depth Average B*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
+-
+-	/*Collapse element to the base*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2);
+-	tria->GradjBMacAyeal(gradient,control_index);    //We use MacAyeal as an estimate for now
+-	delete tria->matice; delete tria;
+-
+-	/*delete Average B*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+-} /*}}}*/
+-/*FUNCTION Penta::GradjBbarStokes {{{*/
+-void  Penta::GradjBbarStokes(Vector* gradient,int control_index){
+-
+-	/*Gradient is computed on bed only (Bbar)*/
+-	if (!IsOnBed()) return;
+-
+-	/*Depth Average B*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
+-
+-	/*Collapse element to the base*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2);
+-	tria->GradjBMacAyeal(gradient,control_index);    //We use MacAyeal as an estimate for now
+-	delete tria->matice; delete tria;
+-
+-	/*delete Average B*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+-} /*}}}*/
+-/*FUNCTION Penta::InputControlUpdate{{{*/
+-void  Penta::InputControlUpdate(IssmDouble scalar,bool save_parameter){
+-
+-	/*Intermediary*/
+-	int    num_controls;
+-	int*   control_type=NULL;
+-	Input* input=NULL;
+-
+-	/*retrieve some parameters: */
+-	this->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+-	this->parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+-
+-	for(int i=0;i<num_controls;i++){
+-
+-		if(control_type[i]==MaterialsRheologyBbarEnum){
+-			if (!IsOnBed()) goto cleanup_and_return;
+-			input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum); _assert_(input);
+-		}
+-		else{
+-			input=(Input*)this->inputs->GetInput(control_type[i]); _assert_(input);
+-		}
+-
+-		if (input->ObjectEnum()!=ControlInputEnum) _error2_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");
+-
+-		((ControlInput*)input)->UpdateValue(scalar);
+-		((ControlInput*)input)->Constrain();
+-		if (save_parameter) ((ControlInput*)input)->SaveValue();
+-
+-		if(control_type[i]==MaterialsRheologyBbarEnum){
+-			this->InputExtrude(MaterialsRheologyBEnum,MaterialsEnum);
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-cleanup_and_return:
+-	xDelete<int>(control_type);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionAdjointStokes {{{*/
+-void  Penta::InputUpdateFromSolutionAdjointStokes(IssmDouble* solution){
+-
+-	const int    numdof=NDOF4*NUMVERTICES;
+-
+-	int    i;
+-	IssmDouble values[numdof];
+-	IssmDouble lambdax[NUMVERTICES];
+-	IssmDouble lambday[NUMVERTICES];
+-	IssmDouble lambdaz[NUMVERTICES];
+-	IssmDouble lambdap[NUMVERTICES];
+-	int*   doflist=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		lambdax[i]=values[i*NDOF4+0];
+-		lambday[i]=values[i*NDOF4+1];
+-		lambdaz[i]=values[i*NDOF4+2];
+-		lambdap[i]=values[i*NDOF4+3];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(lambdax[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(lambday[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(lambdaz[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(lambdap[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new PentaP1Input(AdjointxEnum,lambdax));
+-	this->inputs->AddInput(new PentaP1Input(AdjointyEnum,lambday));
+-	this->inputs->AddInput(new PentaP1Input(AdjointzEnum,lambdaz));
+-	this->inputs->AddInput(new PentaP1Input(AdjointpEnum,lambdap));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionAdjointHoriz {{{*/
+-void  Penta::InputUpdateFromSolutionAdjointHoriz(IssmDouble* solution){
+-
+-	const int numdof=NDOF2*NUMVERTICES;
+-
+-	int    i;
+-	IssmDouble values[numdof];
+-	IssmDouble lambdax[NUMVERTICES];
+-	IssmDouble lambday[NUMVERTICES];
+-	int*   doflist=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		lambdax[i]=values[i*NDOF2+0];
+-		lambday[i]=values[i*NDOF2+1];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(lambdax[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(lambday[i]))       _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new PentaP1Input(AdjointxEnum,lambdax));
+-	this->inputs->AddInput(new PentaP1Input(AdjointyEnum,lambday));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SurfaceAverageVelMisfit {{{*/
+-IssmDouble Penta::SurfaceAverageVelMisfit(bool process_units,int weight_index){
+-
+-	int    approximation;
+-	IssmDouble J;
+-	Tria*  tria=NULL;
+-
+-	/*retrieve inputs :*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/*Bail out if this element if:
+-	 * -> Non MacAyeal and not on the surface
+-	 * -> MacAyeal (2d model) and not on bed) */
+-	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
+-		return 0;
+-	}
+-	else if (approximation==MacAyealApproximationEnum){
+-
+-		/*This element should be collapsed into a tria element at its base. Create this tria element, 
+-		 * and compute SurfaceAverageVelMisfit*/
+-		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+-		J=tria->SurfaceAverageVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
+-		return J;
+-	}
+-	else{
+-
+-		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+-		J=tria->SurfaceAverageVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
+-		return J;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SurfaceAbsVelMisfit {{{*/
+-IssmDouble Penta::SurfaceAbsVelMisfit(bool process_units,int weight_index){
+-
+-	int    approximation;
+-	IssmDouble J;
+-	Tria*  tria=NULL;
+-
+-	/*retrieve inputs :*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/*Bail out if this element if:
+-	 * -> Non MacAyeal and not on the surface
+-	 * -> MacAyeal (2d model) and not on bed) */
+-	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
+-		return 0;
+-	}
+-	else if (approximation==MacAyealApproximationEnum){
+-
+-		/*This element should be collapsed into a tria element at its base. Create this tria element, 
+-		 * and compute SurfaceAbsVelMisfit*/
+-		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+-		J=tria->SurfaceAbsVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
+-		return J;
+-	}
+-	else{
+-
+-		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+-		J=tria->SurfaceAbsVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
+-		return J;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SurfaceLogVelMisfit {{{*/
+-IssmDouble Penta::SurfaceLogVelMisfit(bool process_units,int weight_index){
+-
+-	int    approximation;
+-	IssmDouble J;
+-	Tria*  tria=NULL;
+-
+-	/*retrieve inputs :*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/*Bail out if this element if:
+-	 * -> Non MacAyeal and not on the surface
+-	 * -> MacAyeal (2d model) and not on bed) */
+-	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
+-		return 0;
+-	}
+-	else if (approximation==MacAyealApproximationEnum){
+-
+-		/*This element should be collapsed into a tria element at its base. Create this tria element, 
+-		 * and compute SurfaceLogVelMisfit*/
+-		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+-		J=tria->SurfaceLogVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
+-		return J;
+-	}
+-	else{
+-
+-		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+-		J=tria->SurfaceLogVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
+-		return J;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SurfaceLogVxVyMisfit {{{*/
+-IssmDouble Penta::SurfaceLogVxVyMisfit(bool process_units,int weight_index){
+-
+-	IssmDouble J;
+-	Tria* tria=NULL;
+-
+-	/*inputs: */
+-	int  approximation;
+-
+-	/*retrieve inputs :*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/*Bail out if this element if:
+-	 * -> Non MacAyeal and not on the surface
+-	 * -> MacAyeal (2d model) and not on bed) */
+-	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
+-		return 0;
+-	}
+-	else if (approximation==MacAyealApproximationEnum){
+-
+-		/*This element should be collapsed into a tria element at its base. Create this tria element, 
+-		 * and compute SurfaceLogVxVyMisfit*/
+-		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+-		J=tria->SurfaceLogVxVyMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
+-		return J;
+-	}
+-	else{
+-
+-		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+-		J=tria->SurfaceLogVxVyMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
+-		return J;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SurfaceRelVelMisfit {{{*/
+-IssmDouble Penta::SurfaceRelVelMisfit(bool process_units,int weight_index){
+-
+-	int    approximation;
+-	IssmDouble J;
+-	Tria*  tria=NULL;
+-
+-	/*retrieve inputs :*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-
+-	/*Bail out if this element if:
+-	 * -> Non MacAyeal and not on the surface
+-	 * -> MacAyeal (2d model) and not on bed) */
+-	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
+-		return 0;
+-	}
+-	else if (approximation==MacAyealApproximationEnum){
+-
+-		/*This element should be collapsed into a tria element at its base. Create this tria element, 
+-		 * and compute SurfaceRelVelMisfit*/
+-		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+-		J=tria->SurfaceRelVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
+-		return J;
+-	}
+-	else{
+-
+-		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+-		J=tria->SurfaceRelVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
+-		return J;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ThicknessAbsGradient{{{*/
+-IssmDouble Penta::ThicknessAbsGradient(bool process_units,int weight_index){
+-
+-	_error2_("Not implemented yet");
+-}
+-/*}}}*/
+-/*FUNCTION Penta::ThicknessAbsMisfit {{{*/
+-IssmDouble Penta::ThicknessAbsMisfit(bool process_units,int weight_index){
+-
+-	int    approximation;
+-	IssmDouble J;
+-	Tria*  tria=NULL;
+-
+-	/*retrieve inputs :*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	/*If on water, return 0: */
+-	if(IsOnWater())return 0;
+-	_error2_("Not implemented yet");
+-
+-	tria=(Tria*)SpawnTria(0,1,2);
+-	J=tria->ThicknessAbsMisfit(process_units,weight_index);
+-	delete tria->matice; delete tria;
+-	return J;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::DragCoefficientAbsGradient{{{*/
+-IssmDouble Penta::DragCoefficientAbsGradient(bool process_units,int weight_index){
+-
+-	IssmDouble J;
+-	Tria*  tria=NULL;
+-
+-	/*If on water, on shelf or not on bed, skip: */
+-	if(IsOnWater()|| IsFloating() || !IsOnBed()) return 0;
+-
+-	tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria
+-	J=tria->DragCoefficientAbsGradient(process_units,weight_index);
+-	delete tria->matice; delete tria;
+-	return J;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::RheologyBbarAbsGradient{{{*/
+-IssmDouble Penta::RheologyBbarAbsGradient(bool process_units,int weight_index){
+-
+-	IssmDouble J;
+-	Tria*  tria=NULL;
+-
+-	/*If on water, on shelf or not on bed, skip: */
+-	if(IsOnWater() || !IsOnBed()) return 0;
+-
+-	tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria
+-	J=tria->RheologyBbarAbsGradient(process_units,weight_index);
+-	delete tria->matice; delete tria;
+-	return J;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetVectorFromControlInputs{{{*/
+-void  Penta::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){
+-
+-	int doflist1[NUMVERTICES];
+-
+-	/*Get out if this is not an element input*/
+-	if(!IsInput(control_enum)) return;
+-
+-	/*Prepare index list*/
+-	GradientIndexing(&doflist1[0],control_index);
+-
+-	/*Get input (either in element or material)*/
+-	Input* input=inputs->GetInput(control_enum);
+-	if(!input) _error2_("Input " << EnumToStringx(control_enum) << " not found in element");
+-
+-	/*Check that it is a ControlInput*/
+-	if (input->ObjectEnum()!=ControlInputEnum){
+-		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
+-	}
+-
+-	((ControlInput*)input)->GetVectorFromInputs(vector,&doflist1[0],data);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::SetControlInputsFromVector{{{*/
+-void  Penta::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){
+-
+-	IssmDouble  values[NUMVERTICES];
+-	int     doflist1[NUMVERTICES];
+-	Input  *input     = NULL;
+-	Input  *new_input = NULL;
+-
+-	/*Get out if this is not an element input*/
+-	if(!IsInput(control_enum)) return;
+-
+-	/*Prepare index list*/
+-	GradientIndexing(&doflist1[0],control_index);
+-
+-	/*Get values on vertices*/
+-	for (int i=0;i<NUMVERTICES;i++){
+-		values[i]=vector[doflist1[i]];
+-	}
+-	new_input = new PentaP1Input(control_enum,values);
+-
+-
+-	if(control_enum==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
+-	}
+-	else{
+-		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+-	}
+-
+-	if (input->ObjectEnum()!=ControlInputEnum){
+-		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
+-	}
+-
+-	((ControlInput*)input)->SetInput(new_input);
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_DAKOTA_
+-/*FUNCTION Penta::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);{{{*/
+-void  Penta::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
+-	
+-	int i,j;
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	switch(type){
+-
+-		case VertexEnum:
+-
+-			/*New PentaP1Input*/
+-			IssmDouble values[6];
+-
+-			/*Get values on the 6 vertices*/
+-			for (i=0;i<6;i++){
+-				values[i]=vector[this->nodes[i]->GetSidList()]; //careful, vector of values here is not parallel distributed, but serial distributed (from a serial Dakota core!)
+-			}
+-
+-			/*Branch on the specified type of update: */
+-			switch(name){
+-				case ThicknessEnum:
+-					/*Update thickness + surface: assume bed is constant. On ice shelves, takes hydrostatic equilibrium {{{*/
+-					IssmDouble  thickness[6];
+-					IssmDouble  thickness_init[6];
+-					IssmDouble  hydrostatic_ratio[6];
+-					IssmDouble  surface[6];
+-					IssmDouble  bed[6];
+-					
+-					/*retrieve inputs: */
+-					GetInputListOnVertices(&thickness_init[0],ThicknessEnum);
+-					GetInputListOnVertices(&hydrostatic_ratio[0],GeometryHydrostaticRatioEnum);
+-					GetInputListOnVertices(&bed[0],BedEnum);
+-					GetInputListOnVertices(&surface[0],SurfaceEnum);
+-
+-					/*build new thickness: */
+-//					for(j=0;j<6;j++)thickness[j]=values[j];
+-
+-					/*build new bed and surface: */
+-					if (this->IsFloating()){
+-						/*hydrostatic equilibrium: */
+-						IssmDouble rho_ice,rho_water,di;
+-						rho_ice=this->matpar->GetRhoIce();
+-						rho_water=this->matpar->GetRhoWater();
+-
+-						di=rho_ice/rho_water;
+-
+-						/*build new thickness: */
+-						for (j=0; j<6; j++) {
+-						/*  for observed/interpolated/hydrostatic thickness, remove scaling from any hydrostatic thickness  */
+-							if     (hydrostatic_ratio[j] >= 0.)
+-								thickness[j]=values[j]-(values[j]/thickness_init[j]-1.)*hydrostatic_ratio[j]*surface[j]/(1.-di);
+-						/*  for minimum thickness, don't scale  */
+-							else
+-								thickness[j]=thickness_init[j];
+-
+-						/*  check the computed thickness and update bed  */
+-							if (thickness[j] < 0.)
+-								thickness[j]=1./(1.-di);
+-							bed[j]=surface[j]-thickness[j];
+-						}
+-
+-//						for(j=0;j<6;j++){
+-//							surface[j]=(1-di)*thickness[j];
+-//							bed[j]=-di*thickness[j];
+-//						}
+-					}
+-					else{
+-						/*build new thickness: */
+-						for (j=0; j<6; j++) {
+-						/*  for observed thickness, use scaled value  */
+-							if(hydrostatic_ratio[j] >= 0.)
+-								thickness[j]=values[j];
+-						/*  for minimum thickness, don't scale  */
+-							else
+-								thickness[j]=thickness_init[j];
+-						}
+-
+-						/*update bed on grounded ice: */
+-//						for(j=0;j<6;j++)surface[j]=bed[j]+thickness[j];
+-						for(j=0;j<6;j++)bed[j]=surface[j]-thickness[j];
+-					}
+-
+-					/*Add new inputs: */
+-					this->inputs->AddInput(new PentaP1Input(ThicknessEnum,thickness));
+-					this->inputs->AddInput(new PentaP1Input(BedEnum,bed));
+-					this->inputs->AddInput(new PentaP1Input(SurfaceEnum,surface));
+-
+-					/*}}}*/
+-					break;
+-				default:
+-					this->inputs->AddInput(new PentaP1Input(name,values));
+-			}
+-			break;
+-
+-		default:
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/
+-void  Penta::InputUpdateFromVectorDakota(int* vector, int name, int type){
+-	_error2_("not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/
+-void  Penta::InputUpdateFromVectorDakota(bool* vector, int name, int type){
+-	_error2_("not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type);{{{*/
+-void  Penta::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
+-	
+-	int i,j,t;
+-	TransientInput* transientinput=NULL;
+-	IssmDouble values[6];
+-	IssmDouble time;
+-	int row;
+-	IssmDouble yts;
+-
+-	/*Check that name is an element input*/
+-	if (!IsInput(name)) return;
+-
+-	switch(type){
+-
+-		case VertexEnum:
+-			
+-			/*Create transient input: */
+-						
+-			parameters->FindParam(&yts,ConstantsYtsEnum);
+-
+-			for(t=0;t<ncols;t++){ //ncols is the number of times
+-
+-				/*create input values: */
+-				for(i=0;i<6;i++){
+-					row=this->nodes[i]->GetSidList();
+-					values[i]=(IssmDouble)matrix[ncols*row+t];
+-				}
+-
+-				/*time? :*/
+-				time=(IssmDouble)matrix[(nrows-1)*ncols+t]*yts;
+-
+-				if(t==0) transientinput=new TransientInput(name);
+-				transientinput->AddTimeInput(new PentaP1Input(name,values),time);
+-				transientinput->Configure(parameters);
+-			}
+-			this->inputs->AddInput(transientinput);
+-			break;
+-
+-		default:
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+-	}
+-
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_DIAGNOSTIC_
+-/*FUNCTION Penta::CreateDVectorDiagnosticHoriz {{{*/
+-ElementVector* Penta::CreateDVectorDiagnosticHoriz(void){
+-
+-	int approximation;
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	switch(approximation){
+-		case StokesApproximationEnum:
+-			return CreateDVectorDiagnosticStokes();
+-		default:
+-			return NULL; //no need for doftypes outside of stokes approximation
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateDVectorDiagnosticStokes{{{*/
+-ElementVector* Penta::CreateDVectorDiagnosticStokes(void){
+-
+-	/*output: */
+-	ElementVector* De=NULL;
+-	/*intermediary: */
+-	int approximation;
+-	int i;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(approximation!=StokesApproximationEnum) return NULL;
+-
+-	De=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-
+-	for (i=0;i<NUMVERTICES;i++){
+-		De->values[i*4+0]=VelocityEnum;
+-		De->values[i*4+1]=VelocityEnum;
+-		De->values[i*4+2]=VelocityEnum;
+-		De->values[i*4+3]=PressureEnum;
+-	}
+-
+-	return De;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixCouplingMacAyealPattyn{{{*/
+-ElementMatrix* Penta::CreateKMatrixCouplingMacAyealPattyn(void){
+-	
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixCouplingMacAyealPattynViscous();
+-	ElementMatrix* Ke2=CreateKMatrixCouplingMacAyealPattynFriction();
+-	ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
+-	
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixCouplingMacAyealPattynViscous{{{*/
+-ElementMatrix* Penta::CreateKMatrixCouplingMacAyealPattynViscous(void){
+-
+-	/*Constants*/
+-	const int numnodes    = 2 *NUMVERTICES;
+-	const int numdofm     = NDOF2 *NUMVERTICES2D;
+-	const int numdofp     = NDOF2 *NUMVERTICES;
+-	const int numdoftotal = 2 *NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int         i,j,ig;
+-	IssmDouble      Jdet;
+-	IssmDouble      viscosity,oldviscosity,newviscosity,viscosity_overshoot; //viscosity
+-	IssmDouble      epsilon[5],oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      B[3][numdofp];
+-	IssmDouble      Bprime[3][numdofm];
+-	IssmDouble      D[3][3]={0.0};            // material matrix, simple scalar matrix.
+-	IssmDouble      D_scalar;
+-	IssmDouble      Ke_gg[numdofp][numdofm]={0.0}; //local element stiffness matrix 
+-	IssmDouble      Ke_gg_gaussian[numdofp][numdofm]; //stiffness matrix evaluated at the gaussian point.
+-	GaussPenta *gauss=NULL;
+-	GaussTria  *gauss_tria=NULL;
+-	Node       *node_list[numnodes];
+-	int         cs_list[numnodes];
+-
+-	/*Find penta on bed as pattyn must be coupled to the dofs on the bed: */
+-	Penta* pentabase=GetBasalElement();
+-	Tria*  tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-
+-	/*Prepare node list*/
+-	for(i=0;i<NUMVERTICES;i++){
+-		node_list[i+0*NUMVERTICES] = pentabase->nodes[i];
+-		node_list[i+1*NUMVERTICES] = this->nodes[i];
+-		cs_list[i+0*NUMVERTICES] = XYEnum;
+-		cs_list[i+1*NUMVERTICES] = XYEnum;
+-	}
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke1=new ElementMatrix(pentabase->nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
+-	ElementMatrix* Ke2=new ElementMatrix(this->nodes     ,NUMVERTICES,this->parameters,PattynApproximationEnum);
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
+-	delete Ke1; delete Ke2;
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&viscosity_overshoot,DiagnosticViscosityOvershootEnum);
+-	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+-	Input* vxold_input=inputs->GetInput(VxPicardEnum); _assert_(vxold_input);
+-	Input* vyold_input=inputs->GetInput(VyPicardEnum); _assert_(vyold_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	gauss_tria=new GaussTria();
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-		gauss->SynchronizeGaussTria(gauss_tria);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetBMacAyealPattyn(&B[0][0], &xyz_list[0][0], gauss);
+-		tria->GetBprimeMacAyeal(&Bprime[0][0], &xyz_list[0][0], gauss_tria);
+-
+-		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
+-		matice->GetViscosity3d(&viscosity, &epsilon[0]);
+-		matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
+-
+-		newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
+-		D_scalar=2*newviscosity*gauss->weight*Jdet;
+-		for (i=0;i<3;i++) D[i][i]=D_scalar;
+-
+-		TripleMultiply( &B[0][0],3,numdofp,1,
+-					&D[0][0],3,3,0,
+-					&Bprime[0][0],3,numdofm,0,
+-					&Ke_gg_gaussian[0][0],0);
+-
+-		for( i=0; i<numdofp; i++) for(j=0;j<numdofm; j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
+-	} 
+-	for(i=0;i<numdofp;i++) for(j=0;j<numdofm;j++) Ke->values[(i+2*numdofm)*numdoftotal+j]+=Ke_gg[i][j];
+-	for(i=0;i<numdofm;i++) for(j=0;j<numdofp;j++) Ke->values[i*numdoftotal+(j+2*numdofm)]+=Ke_gg[j][i];
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
+-
+-	/*Clean-up and return*/
+-	delete tria->matice; delete tria;
+-	delete gauss;
+-	delete gauss_tria;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixCouplingMacAyealPattynFriction{{{*/
+-ElementMatrix* Penta::CreateKMatrixCouplingMacAyealPattynFriction(void){
+-
+-	/*Constants*/
+-	const int numnodes    = 2 *NUMVERTICES;
+-	const int numdof      = NDOF2 *NUMVERTICES;
+-	const int numdoftotal = NDOF4 *NUMVERTICES;
+-	
+-	/*Intermediaries */
+-	int       i,j,ig,analysis_type;
+-	IssmDouble    Jdet2d,slope_magnitude,alpha2;
+-	IssmDouble    xyz_list[NUMVERTICES][3];
+-	IssmDouble    xyz_list_tria[NUMVERTICES2D][3]={0.0};
+-	IssmDouble    slope[3]={0.0,0.0,0.0};
+-	IssmDouble    MAXSLOPE=.06; // 6 %
+-	IssmDouble    MOUNTAINKEXPONENT=10;
+-	IssmDouble    L[2][numdof];
+-	IssmDouble    DL[2][2]                  ={{ 0,0 },{0,0}}; //for basal drag
+-	IssmDouble    DL_scalar;
+-	IssmDouble    Ke_gg[numdof][numdof]     ={0.0};
+-	IssmDouble    Ke_gg_gaussian[numdof][numdof]; //stiffness matrix contribution from drag
+-	Friction  *friction = NULL;
+-	GaussPenta *gauss=NULL;
+-	Node       *node_list[numnodes];
+-	int         cs_list[numnodes];
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	if(IsFloating() || !IsOnBed()) return NULL;
+-	ElementMatrix* Ke1=new ElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
+-	ElementMatrix* Ke2=new ElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
+-	ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
+-	delete Ke1; delete Ke2;
+-
+-	/*Prepare node list*/
+-	for(i=0;i<NUMVERTICES;i++){
+-		node_list[i+0*NUMVERTICES] = this->nodes[i];
+-		node_list[i+1*NUMVERTICES] = this->nodes[i];
+-		cs_list[i+0*NUMVERTICES] = XYEnum;
+-		cs_list[i+1*NUMVERTICES] = XYEnum;
+-	}
+-
+-	/*retrieve inputs :*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_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);
+-
+-	/*build friction object, used later on: */
+-	friction=new Friction("2d",inputs,matpar,analysis_type);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/*Friction: */
+-		friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum);
+-
+-		// If we have a slope > 6% for this element,  it means  we are on a mountain. In this particular case, 
+-		//velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */
+-		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
+-		slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2));
+-
+-		if (slope_magnitude>MAXSLOPE){
+-			alpha2=pow((IssmDouble)10,MOUNTAINKEXPONENT);
+-		}
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
+-		GetL(&L[0][0], gauss,NDOF2);
+-
+-		DL_scalar=alpha2*gauss->weight*Jdet2d;
+-		for (i=0;i<2;i++) DL[i][i]=DL_scalar; 
+-		
+-		/*  Do the triple producte tL*D*L: */
+-		TripleMultiply( &L[0][0],2,numdof,1,
+-					&DL[0][0],2,2,0,
+-					&L[0][0],2,numdof,0,
+-					&Ke_gg_gaussian[0][0],0);
+-
+-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
+-	}
+-
+-	for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdoftotal+(numdof+j)]+=Ke_gg[i][j];
+-	for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[(i+numdof)*numdoftotal+j]+=Ke_gg[i][j];
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixCouplingMacAyealStokes{{{*/
+-ElementMatrix* Penta::CreateKMatrixCouplingMacAyealStokes(void){
+-
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixCouplingMacAyealStokesViscous();
+-	ElementMatrix* Ke2=CreateKMatrixCouplingMacAyealStokesFriction();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
+-
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixCouplingMacAyealStokesViscous{{{*/
+-ElementMatrix* Penta::CreateKMatrixCouplingMacAyealStokesViscous(void){
+-
+-	/*Constants*/
+-	const int numnodes    = 2 *NUMVERTICES;
+-	const int numdofm     = NDOF2 *NUMVERTICES2D;
+-	const int numdofs     = NDOF4 *NUMVERTICES;
+-	const int numdoftotal = 2 *numdofm+numdofs;
+-
+-	/*Intermediaries */
+-	int         i,j,ig;
+-	IssmDouble      Jdet;
+-	IssmDouble      viscosity,stokesreconditioning; //viscosity
+-	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      B[4][numdofs+3];
+-	IssmDouble      Bprime[4][numdofm];
+-	IssmDouble      B2[3][numdofm];
+-	IssmDouble      Bprime2[3][numdofs+3];
+-	IssmDouble      D[4][4]={0.0};            // material matrix, simple scalar matrix.
+-	IssmDouble      D2[3][3]={0.0};            // material matrix, simple scalar matrix.
+-	IssmDouble      D_scalar;
+-	IssmDouble      Ke_gg[numdofs][numdofm]={0.0}; //local element stiffness matrix 
+-	IssmDouble      Ke_gg2[numdofm][numdofs]={0.0}; //local element stiffness matrix 
+-	IssmDouble      Ke_gg_gaussian[numdofs+3][numdofm]; //stiffness matrix evaluated at the gaussian point.
+-	IssmDouble      Ke_gg_gaussian2[numdofm][numdofs+3]; //stiffness matrix evaluated at the gaussian point.
+-	GaussPenta *gauss=NULL;
+-	GaussTria  *gauss_tria=NULL;
+-	Node       *node_list[numnodes];
+-	int         cs_list[numnodes];
+-
+-	/*Find penta on bed as stokes must be coupled to the dofs on the bed: */
+-	Penta* pentabase=GetBasalElement();
+-	Tria* tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-
+-	/*Prepare node list*/
+-	for(i=0;i<NUMVERTICES;i++){
+-		node_list[i+0*NUMVERTICES] = pentabase->nodes[i];
+-		node_list[i+1*NUMVERTICES] = this->nodes[i];
+-		cs_list[i+0*NUMVERTICES] = XYEnum;
+-		cs_list[i+1*NUMVERTICES] = XYZPEnum;
+-	}
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	ElementMatrix* Ke1=new ElementMatrix(pentabase->nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
+-	ElementMatrix* Ke2=new ElementMatrix(this->nodes     ,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-	ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
+-	delete Ke1; delete Ke2;
+-
+-	/* Get node coordinates and dof list: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	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 gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	gauss_tria=new GaussTria();
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-		gauss->SynchronizeGaussTria(gauss_tria);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetBMacAyealStokes(&B[0][0], &xyz_list[0][0], gauss);
+-		tria->GetBprimeMacAyealStokes(&Bprime[0][0], &xyz_list[0][0], gauss_tria);
+-		tria->GetBMacAyealStokes(&B2[0][0], &xyz_list[0][0], gauss_tria);
+-		GetBprimeMacAyealStokes(&Bprime2[0][0], &xyz_list[0][0], gauss);
+-
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity, &epsilon[0]);
+-
+-		D_scalar=2*viscosity*gauss->weight*Jdet;
+-		for (i=0;i<3;i++) D[i][i]=D_scalar;
+-		D[3][3]=-gauss->weight*Jdet*stokesreconditioning;
+-		for (i=0;i<3;i++) D2[i][i]=D_scalar;
+-
+-		TripleMultiply( &B[0][0],4,numdofs+3,1,
+-					&D[0][0],4,4,0,
+-					&Bprime[0][0],4,numdofm,0,
+-					&Ke_gg_gaussian[0][0],0);
+-
+-		TripleMultiply( &B2[0][0],3,numdofm,1,
+-					&D2[0][0],3,3,0,
+-					&Bprime2[0][0],3,numdofs+3,0,
+-					&Ke_gg_gaussian2[0][0],0);
+-
+-		for( i=0; i<numdofs; i++) for(j=0;j<numdofm; j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
+-		for( i=0; i<numdofm; i++) for(j=0;j<numdofs; j++) Ke_gg2[i][j]+=Ke_gg_gaussian2[i][j];
+-	} 
+-	for(i=0;i<numdofs;i++) for(j=0;j<numdofm;j++) Ke->values[(i+2*numdofm)*numdoftotal+j]+=Ke_gg[i][j];
+-	for(i=0;i<numdofm;i++) for(j=0;j<numdofs;j++) Ke->values[i*numdoftotal+(j+2*numdofm)]+=Ke_gg2[i][j];
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
+-
+-	/*Clean-up and return*/
+-	delete tria->matice; delete tria;
+-	delete gauss;
+-	delete gauss_tria;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixCouplingMacAyealStokesFriction {{{*/
+-ElementMatrix* Penta::CreateKMatrixCouplingMacAyealStokesFriction(void){
+-
+-	/*Constants*/
+-	const int numnodes  = 2 *NUMVERTICES;
+-	const int numdof    = NUMVERTICES *NDOF4;
+-	const int numdofm   = NUMVERTICES *NDOF2;
+-	const int numdof2d  = NUMVERTICES2D *NDOF4;
+-	const int numdof2dm = NUMVERTICES2D *NDOF2;
+-	const int numdoftot = numdof+numdofm;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	int        analysis_type,approximation;
+-	IssmDouble     stokesreconditioning;
+-	IssmDouble     viscosity,alpha2_gauss,Jdet2d;
+-	IssmDouble	  bed_normal[3];
+-	IssmDouble     epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble	  xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble     LMacAyealStokes[8][numdof2dm];
+-	IssmDouble     LprimeMacAyealStokes[8][numdof2d];
+-	IssmDouble     DLMacAyealStokes[8][8]={0.0};
+-	IssmDouble     LStokesMacAyeal[4][numdof2d];
+-	IssmDouble     LprimeStokesMacAyeal[4][numdof2dm];
+-	IssmDouble     DLStokesMacAyeal[4][4]={0.0};
+-	IssmDouble     Ke_drag_gaussian[numdof2dm][numdof2d];
+-	IssmDouble     Ke_drag_gaussian2[numdof2d][numdof2dm];
+-	Friction*  friction=NULL;
+-	GaussPenta *gauss=NULL;
+-	Node       *node_list[numnodes];
+-	int         cs_list[numnodes];
+-
+-	/*If on water or not Stokes, skip stiffness: */
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(IsFloating() || !IsOnBed()) return NULL;
+-	ElementMatrix* Ke1=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
+-	ElementMatrix* Ke2=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-	ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
+-	delete Ke1; delete Ke2;
+-
+-	/*Prepare node list*/
+-	for(i=0;i<NUMVERTICES;i++){
+-		node_list[i+0*NUMVERTICES] = this->nodes[i];
+-		node_list[i+1*NUMVERTICES] = this->nodes[i];
+-		cs_list[i+0*NUMVERTICES] = XYEnum;
+-		cs_list[i+1*NUMVERTICES] = XYZPEnum;
+-	}
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	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);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-
+-	/*build friction object, used later on: */
+-	friction=new Friction("3d",inputs,matpar,analysis_type);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
+-		GetLMacAyealStokes(&LMacAyealStokes[0][0], gauss);
+-		GetLprimeMacAyealStokes(&LprimeMacAyealStokes[0][0], &xyz_list[0][0], gauss);
+-		GetLStokesMacAyeal(&LStokesMacAyeal[0][0], gauss);
+-		GetLprimeStokesMacAyeal(&LprimeStokesMacAyeal[0][0], &xyz_list[0][0], gauss);
+-
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-
+-		BedNormal(&bed_normal[0],xyz_list_tria);
+-		friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum);
+-
+-		DLMacAyealStokes[0][0]=alpha2_gauss*gauss->weight*Jdet2d;
+-		DLMacAyealStokes[1][1]=alpha2_gauss*gauss->weight*Jdet2d;
+-		DLMacAyealStokes[2][2]=-alpha2_gauss*gauss->weight*Jdet2d*bed_normal[0]*bed_normal[2];
+-		DLMacAyealStokes[3][3]=-alpha2_gauss*gauss->weight*Jdet2d*bed_normal[1]*bed_normal[2];
+-		DLMacAyealStokes[4][4]=-2*viscosity*gauss->weight*Jdet2d*bed_normal[0];
+-		DLMacAyealStokes[5][5]=-2*viscosity*gauss->weight*Jdet2d*bed_normal[1];
+-		DLMacAyealStokes[6][6]=stokesreconditioning*gauss->weight*Jdet2d*bed_normal[0];
+-		DLMacAyealStokes[7][7]=stokesreconditioning*gauss->weight*Jdet2d*bed_normal[1];
+-
+-		DLStokesMacAyeal[0][0]=alpha2_gauss*gauss->weight*Jdet2d;
+-		DLStokesMacAyeal[1][1]=alpha2_gauss*gauss->weight*Jdet2d;
+-		DLStokesMacAyeal[2][2]=-alpha2_gauss*gauss->weight*Jdet2d*bed_normal[0]*bed_normal[2];
+-		DLStokesMacAyeal[3][3]=-alpha2_gauss*gauss->weight*Jdet2d*bed_normal[1]*bed_normal[2];
+-		
+-		TripleMultiply( &LMacAyealStokes[0][0],8,numdof2dm,1,
+-					&DLMacAyealStokes[0][0],8,8,0,
+-					&LprimeMacAyealStokes[0][0],8,numdof2d,0,
+-					&Ke_drag_gaussian[0][0],0);
+-
+-		TripleMultiply( &LStokesMacAyeal[0][0],4,numdof2d,1,
+-					&DLStokesMacAyeal[0][0],4,4,0,
+-					&LprimeStokesMacAyeal[0][0],4,numdof2dm,0,
+-					&Ke_drag_gaussian2[0][0],0);
+-
+-		for(i=0;i<numdof2dm;i++) for(j=0;j<numdof2d;j++) Ke->values[i*numdoftot+j+numdofm]+=Ke_drag_gaussian[i][j];
+-		for(i=0;i<numdof2d;i++) for(j=0;j<numdof2dm;j++) Ke->values[(i+numdofm)*numdoftot+j]+=Ke_drag_gaussian2[i][j];
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixCouplingPattynStokes{{{*/
+-ElementMatrix* Penta::CreateKMatrixCouplingPattynStokes(void){
+-
+-	/*Constants*/
+-	const int numnodes  = 2 *NUMVERTICES;
+-	const int numdofp     = NDOF2 *NUMVERTICES;
+-	const int numdofs     = NDOF4 *NUMVERTICES;
+-	const int numdoftotal = (NDOF2+NDOF4) *NUMVERTICES;
+-
+-	/*Intermediaries*/
+-	Node     *node_list[numnodes];
+-	int       cs_list[numnodes];
+-	int       i,j;
+-
+-	/*Prepare node list*/
+-	for(i=0;i<NUMVERTICES;i++){
+-		node_list[i+0*NUMVERTICES] = this->nodes[i];
+-		node_list[i+1*NUMVERTICES] = this->nodes[i];
+-		cs_list[i+0*NUMVERTICES] = XYEnum;
+-		cs_list[i+1*NUMVERTICES] = XYZPEnum;
+-	}
+-
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
+-	ElementMatrix* Ke2=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-	ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
+-	delete Ke1;
+-	delete Ke2;
+-	Ke1=CreateKMatrixDiagnosticPattyn(); TransformInvStiffnessMatrixCoord(Ke1,this->nodes,NUMVERTICES,XYEnum);
+-	Ke2=CreateKMatrixDiagnosticStokes(); TransformInvStiffnessMatrixCoord(Ke2,this->nodes,NUMVERTICES,XYZPEnum);
+-
+-	for(i=0;i<numdofs;i++) for(j=0;j<NUMVERTICES;j++){
+-		Ke->values[(i+numdofp)*numdoftotal+NDOF2*j+0]+=Ke2->values[i*numdofs+NDOF4*j+0];
+-		Ke->values[(i+numdofp)*numdoftotal+NDOF2*j+1]+=Ke2->values[i*numdofs+NDOF4*j+1];
+-	}
+-	for(i=0;i<numdofp;i++) for(j=0;j<NUMVERTICES;j++){
+-		Ke->values[i*numdoftotal+numdofp+NDOF4*j+0]+=Ke1->values[i*numdofp+NDOF2*j+0];
+-		Ke->values[i*numdoftotal+numdofp+NDOF4*j+1]+=Ke1->values[i*numdofp+NDOF2*j+1];
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
+-
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticHoriz {{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticHoriz(void){
+-
+-	int approximation;
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	switch(approximation){
+-		case MacAyealApproximationEnum:
+-			return CreateKMatrixDiagnosticMacAyeal2d();
+-		case PattynApproximationEnum:
+-			return CreateKMatrixDiagnosticPattyn();
+-		case StokesApproximationEnum:
+-			return CreateKMatrixDiagnosticStokes();
+-		case HutterApproximationEnum:
+-			return NULL;
+-		case NoneApproximationEnum:
+-			return NULL;
+-		case MacAyealPattynApproximationEnum:
+-			return CreateKMatrixDiagnosticMacAyealPattyn();
+-		case MacAyealStokesApproximationEnum:
+-			return CreateKMatrixDiagnosticMacAyealStokes();
+-		case PattynStokesApproximationEnum:
+-			return CreateKMatrixDiagnosticPattynStokes();
+-		default:
+-			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticHutter{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticHutter(void){
+-
+-	/*Constants*/
+-	const int numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries*/
+-	int       connectivity[2];
+-	int       i,i0,i1,j0,j1;
+-	IssmDouble    one0,one1;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Spawn 3 beam elements: */
+-	for(i=0;i<3;i++){
+-		/*2 dofs of first node*/
+-		i0=2*i;
+-		i1=2*i+1;
+-		/*2 dofs of second node*/
+-		j0=2*(i+3);
+-		j1=2*(i+3)+1;
+-
+-		/*Find connectivity for the two nodes*/
+-		connectivity[0]=nodes[i]->GetConnectivity();
+-		connectivity[1]=nodes[i+3]->GetConnectivity();
+-		one0=1/(IssmDouble)connectivity[0];
+-		one1=1/(IssmDouble)connectivity[1];
+-
+-		/*Create matrix for these two nodes*/
+-		if (IsOnBed() && IsOnSurface()){
+-			Ke->values[i0*numdof+i0]=one0;
+-			Ke->values[i1*numdof+i1]=one0;
+-			Ke->values[j0*numdof+i0]=-one1;
+-			Ke->values[j0*numdof+j0]=one1;
+-			Ke->values[j1*numdof+i1]=-one1;
+-			Ke->values[j1*numdof+j1]=one1;
+-		}
+-		else if (IsOnBed()){
+-			Ke->values[i0*numdof+i0]=one0;
+-			Ke->values[i1*numdof+i1]=one0;
+-			Ke->values[j0*numdof+i0]=-2*one1;
+-			Ke->values[j0*numdof+j0]=2*one1;
+-			Ke->values[j1*numdof+i1]=-2*one1;
+-			Ke->values[j1*numdof+j1]=2*one1;
+-		}
+-		else if (IsOnSurface()){
+-			Ke->values[j0*numdof+i0]=-one1;
+-			Ke->values[j0*numdof+j0]=one1;
+-			Ke->values[j1*numdof+i1]=-one1;
+-			Ke->values[j1*numdof+j1]=one1;
+-		}
+-		else{ //node is on two horizontal layers and beams include the values only once, so the have to use half of the connectivity
+-			Ke->values[j0*numdof+i0]=-2*one1;
+-			Ke->values[j0*numdof+j0]=2*one1;
+-			Ke->values[j1*numdof+i1]=-2*one1;
+-			Ke->values[j1*numdof+j1]=2*one1;
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	return Ke;
+-}/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyeal2d{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyeal2d(void){
+-
+-	/*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 
+-	  bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 
+-	  the stiffness matrix. */
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Depth Averaging B*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
+-
+-	/*Call Tria function*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyeal();
+-	delete tria->matice; delete tria;
+-
+-	/*Delete B averaged*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+-
+-	/*clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyeal3d{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyeal3d(void){
+-
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixDiagnosticMacAyeal3dViscous();
+-	ElementMatrix* Ke2=CreateKMatrixDiagnosticMacAyeal3dFriction();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
+-
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyeal3dViscous{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyeal3dViscous(void){
+-
+-	/*Constants*/
+-	const int    numdof2d=2*NUMVERTICES2D;
+-
+-	/*Intermediaries */
+-	int         i,j,ig,approximation;
+-	IssmDouble      Jdet;
+-	IssmDouble      viscosity, oldviscosity, newviscosity, viscosity_overshoot;
+-	IssmDouble      epsilon[5],oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+-	IssmDouble      epsilons[6]; //6 for stokes
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      B[3][numdof2d];
+-	IssmDouble      Bprime[3][numdof2d];
+-	IssmDouble      D[3][3]={0.0};            // material matrix, simple scalar matrix.
+-	IssmDouble      D_scalar;
+-	IssmDouble      Ke_gg_gaussian[numdof2d][numdof2d]; //stiffness matrix evaluated at the gaussian point.
+-	Tria*       tria=NULL;
+-	Penta*      pentabase=NULL;
+-	GaussPenta *gauss=NULL;
+-	GaussTria  *gauss_tria=NULL;
+-
+-	/*Find penta on bed as this is a macayeal elements: */
+-	pentabase=GetBasalElement();
+-	tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(tria->nodes,NUMVERTICES2D,this->parameters,MacAyealApproximationEnum);
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes,NUMVERTICES);
+-	this->parameters->FindParam(&viscosity_overshoot,DiagnosticViscosityOvershootEnum);
+-	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+-	Input* vxold_input=inputs->GetInput(VxPicardEnum); _assert_(vxold_input);
+-	Input* vyold_input=inputs->GetInput(VyPicardEnum); _assert_(vyold_input);
+-	Input* vz_input=inputs->GetInput(VzEnum);       _assert_(vz_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	gauss_tria=new GaussTria();
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-		gauss->SynchronizeGaussTria(gauss_tria);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		tria->GetBMacAyeal(&B[0][0], &xyz_list[0][0], gauss_tria);
+-		tria->GetBprimeMacAyeal(&Bprime[0][0], &xyz_list[0][0], gauss_tria);
+-
+-		if(approximation==MacAyealPattynApproximationEnum){
+-			this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-			this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
+-			matice->GetViscosity3d(&viscosity, &epsilon[0]);
+-			matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
+-
+-			newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
+-		}
+-		else if (approximation==MacAyealStokesApproximationEnum){
+-			this->GetStrainRate3d(&epsilons[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-			matice->GetViscosity3dStokes(&newviscosity,&epsilons[0]);
+-		}
+-		else _error2_("approximation " << approximation << " (" << EnumToStringx(approximation) << ") not supported yet");
+-
+-		D_scalar=2*newviscosity*gauss->weight*Jdet;
+-		for (i=0;i<3;i++) D[i][i]=D_scalar;
+-
+-		TripleMultiply( &B[0][0],3,numdof2d,1,
+-					&D[0][0],3,3,0,
+-					&Bprime[0][0],3,numdof2d,0,
+-					&Ke_gg_gaussian[0][0],0);
+-
+-		for(i=0;i<numdof2d;i++) for(j=0;j<numdof2d;j++) Ke->values[i*numdof2d+j]+=Ke_gg_gaussian[i][j];
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,tria->nodes,NUMVERTICES2D,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete tria->matice;
+-	delete tria;
+-	delete gauss_tria;
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyeal3dFriction{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyeal3dFriction(void){
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	if(IsFloating() || !IsOnBed()) return NULL;
+-
+-	/*Build a tria element using the 3 nodes of the base of the penta. Then use 
+-	 * the tria functionality to build a friction stiffness matrix on these 3
+-	 * nodes: */
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyealFriction();
+-	delete tria->matice; delete tria;
+-
+-	/*clean-up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyealPattyn{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyealPattyn(void){
+-
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixDiagnosticMacAyeal3d();
+-	ElementMatrix* Ke2=CreateKMatrixDiagnosticPattyn();
+-	ElementMatrix* Ke3=CreateKMatrixCouplingMacAyealPattyn();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2,Ke3);
+-
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	delete Ke3;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyealStokes{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyealStokes(void){
+-
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixDiagnosticMacAyeal3d();
+-	ElementMatrix* Ke2=CreateKMatrixDiagnosticStokes();
+-	ElementMatrix* Ke3=CreateKMatrixCouplingMacAyealStokes();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2,Ke3);
+-
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	delete Ke3;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticPattyn{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticPattyn(void){
+-
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixDiagnosticPattynViscous();
+-	ElementMatrix* Ke2=CreateKMatrixDiagnosticPattynFriction();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
+-
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	return Ke;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticPattynViscous{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticPattynViscous(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	int        approximation;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     Jdet;
+-	IssmDouble     viscosity,oldviscosity,newviscosity,viscosity_overshoot; //viscosity
+-	IssmDouble     epsilon[5],oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+-	IssmDouble     D_scalar;
+-	IssmDouble     D[5][5]={0.0};            // material matrix, simple scalar matrix.
+-	IssmDouble     B[5][numdof];
+-	IssmDouble     Bprime[5][numdof];
+-	Tria*      tria=NULL;
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&viscosity_overshoot,DiagnosticViscosityOvershootEnum);
+-	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+-	Input* vxold_input=inputs->GetInput(VxPicardEnum); _assert_(vxold_input);
+-	Input* vyold_input=inputs->GetInput(VyPicardEnum); _assert_(vyold_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetBPattyn(&B[0][0], &xyz_list[0][0], gauss);
+-		GetBprimePattyn(&Bprime[0][0], &xyz_list[0][0], gauss);
+-
+-		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
+-		matice->GetViscosity3d(&viscosity, &epsilon[0]);
+-		matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
+-		newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
+-
+-		D_scalar=2*newviscosity*gauss->weight*Jdet;
+-		for (i=0;i<5;i++) D[i][i]=D_scalar;
+-
+-		TripleMultiply( &B[0][0],5,numdof,1,
+-					&D[0][0],5,5,0,
+-					&Bprime[0][0],5,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticPattynFriction{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticPattynFriction(void){
+-
+-	/*Constants*/
+-	const int numdof   = NDOF2*NUMVERTICES;
+-	
+-	/*Intermediaries */
+-	int       i,j,ig;
+-	int       analysis_type;
+-	IssmDouble    xyz_list[NUMVERTICES][3];
+-	IssmDouble    xyz_list_tria[NUMVERTICES2D][3]={0.0};
+-	IssmDouble    slope_magnitude,alpha2,Jdet;
+-	IssmDouble    slope[3]={0.0,0.0,0.0};
+-	IssmDouble    MAXSLOPE=.06; // 6 %
+-	IssmDouble    MOUNTAINKEXPONENT=10;
+-	IssmDouble    L[2][numdof];
+-	IssmDouble    DL[2][2]={{ 0,0 },{0,0}}; //for basal drag
+-	IssmDouble    DL_scalar;
+-	Friction  *friction = NULL;
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element matrix and return if necessary*/
+-	if(IsFloating() || !IsOnBed()) return NULL;
+-
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_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);
+-
+-	/*build friction object, used later on: */
+-	friction=new Friction("2d",inputs,matpar,analysis_type);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet, &xyz_list_tria[0][0],gauss);
+-		GetL(&L[0][0], gauss,NDOF2);
+-
+-		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
+-		friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum); 
+-		slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2));
+-
+-		// If we have a slope > 6% for this element,  it means  we are on a mountain. In this particular case, 
+-		//velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */
+-		if (slope_magnitude>MAXSLOPE){
+-			alpha2=pow((IssmDouble)10,MOUNTAINKEXPONENT);
+-		}
+-		
+-		DL_scalar=alpha2*gauss->weight*Jdet;
+-		for (i=0;i<2;i++) DL[i][i]=DL_scalar;
+-		
+-		TripleMultiply( &L[0][0],2,numdof,1,
+-					&DL[0][0],2,2,0,
+-					&L[0][0],2,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticPattynStokes{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticPattynStokes(void){
+-
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixDiagnosticPattyn();
+-	ElementMatrix* Ke2=CreateKMatrixDiagnosticStokes();
+-	ElementMatrix* Ke3=CreateKMatrixCouplingPattynStokes();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2,Ke3);
+-
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	delete Ke3;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticStokes{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticStokes(void){
+-
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixDiagnosticStokesViscous();
+-	ElementMatrix* Ke2=CreateKMatrixDiagnosticStokesFriction();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
+-
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticStokesViscous {{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticStokesViscous(void){
+-
+-	/*Intermediaries */
+-	int        i,j,ig,approximation;
+-	IssmDouble     Jdet,viscosity,stokesreconditioning;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
+-	IssmDouble     B[8][27];
+-	IssmDouble     B_prime[8][27];
+-	IssmDouble     D_scalar;
+-	IssmDouble     D[8][8]={0.0};
+-	IssmDouble     Ke_temp[27][27]={0.0}; //for the six nodes and the bubble 
+-	GaussPenta *gauss=NULL;
+-
+-	/*If on water or not Stokes, skip stiffness: */
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum && approximation!=PattynStokesApproximationEnum) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	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 gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetBStokes(&B[0][0],&xyz_list[0][0],gauss); 
+-		GetBprimeStokes(&B_prime[0][0],&xyz_list[0][0],gauss); 
+-
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-
+-		D_scalar=gauss->weight*Jdet;
+-		for (i=0;i<6;i++) D[i][i]=D_scalar*2*viscosity;
+-		for (i=6;i<8;i++) D[i][i]=-D_scalar*stokesreconditioning;
+-
+-		TripleMultiply( &B[0][0],8,27,1,
+-					&D[0][0],8,8,0,
+-					&B_prime[0][0],8,27,0,
+-					&Ke_temp[0][0],1);
+-	}
+-
+-	/*Condensation*/
+-	ReduceMatrixStokes(Ke->values, &Ke_temp[0][0]);
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticStokesFriction{{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticStokesFriction(void){
+-
+-	/*Constants*/
+-	const int numdof=NUMVERTICES*NDOF4;
+-	const int numdof2d=NUMVERTICES2D*NDOF4;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	int        analysis_type,approximation;
+-	IssmDouble     alpha2,Jdet2d;
+-	IssmDouble     stokesreconditioning,viscosity;
+-	IssmDouble     epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble	  xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble     LStokes[2][numdof2d];
+-	IssmDouble     DLStokes[2][2]={0.0};
+-	IssmDouble     Ke_drag_gaussian[numdof2d][numdof2d];
+-	Friction*  friction=NULL;
+-	GaussPenta *gauss=NULL;
+-
+-	/*If on water or not Stokes, skip stiffness: */
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(IsFloating() || !IsOnBed() || (approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum &&  approximation!=PattynStokesApproximationEnum)) return NULL;
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	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);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-
+-	/*build friction object, used later on: */
+-	friction=new Friction("3d",inputs,matpar,analysis_type);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
+-		GetLStokes(&LStokes[0][0], gauss);
+-
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-
+-		friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum);
+-
+-		DLStokes[0][0] = +alpha2*gauss->weight*Jdet2d; //taub_x = -alpha2 vx
+-		DLStokes[1][1] = +alpha2*gauss->weight*Jdet2d; //taub_y = -alpha2 vy
+-
+-		TripleMultiply( &LStokes[0][0],2,numdof2d,1,
+-					&DLStokes[0][0],2,2,0,
+-					&LStokes[0][0],2,numdof2d,0,
+-					&Ke_drag_gaussian[0][0],0);
+-
+-		for(i=0;i<numdof2d;i++) for(j=0;j<numdof2d;j++) Ke->values[i*numdof+j]+=Ke_drag_gaussian[i][j];
+-	}
+-
+-	/*DO NOT Transform Coordinate System: this stiffness matrix is already expressed in tangential coordinates*/
+-	//TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
+-	
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticVert {{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticVert(void){
+-	
+-	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixDiagnosticVertVolume();
+-	ElementMatrix* Ke2=CreateKMatrixDiagnosticVertSurface();
+-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
+-
+-	/*clean-up and return*/
+-	delete Ke1;
+-	delete Ke2;
+-	return Ke;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticVertVolume {{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticVertVolume(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int         i,j,ig;
+-	IssmDouble      Jdet;
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      B[NDOF1][NUMVERTICES];
+-	IssmDouble      Bprime[NDOF1][NUMVERTICES];
+-	IssmDouble      DL_scalar;
+-	GaussPenta  *gauss=NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetBVert(&B[0][0], &xyz_list[0][0], gauss);
+-		GetBprimeVert(&Bprime[0][0], &xyz_list[0][0], gauss);
+-
+-		DL_scalar=gauss->weight*Jdet;
+-
+-		TripleMultiply( &B[0][0],1,NUMVERTICES,1,
+-					&DL_scalar,1,1,0,
+-					&Bprime[0][0],1,NUMVERTICES,0,
+-					&Ke->values[0],1);
+-	} 
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateKMatrixDiagnosticVertSurface {{{*/
+-ElementMatrix* Penta::CreateKMatrixDiagnosticVertSurface(void){
+-
+-	if (!IsOnSurface()) return NULL;
+-
+-	/*Constants*/
+-	const int numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int       i,j,ig;
+-	IssmDouble    xyz_list[NUMVERTICES][3];
+-	IssmDouble    xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble    surface_normal[3];
+-	IssmDouble    Jdet2d,DL_scalar;
+-	IssmDouble    basis[NUMVERTICES];
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element matrix*/
+-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i+3][j];
+-	SurfaceNormal(&surface_normal[0],xyz_list_tria);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(3,4,5,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
+-		GetNodalFunctionsP1(&basis[0], gauss);
+-
+-		DL_scalar= - gauss->weight*Jdet2d*surface_normal[2]; 
+-
+-		TripleMultiply( basis,1,numdof,1,
+-					&DL_scalar,1,1,0,
+-					basis,1,numdof,0,
+-					&Ke->values[0],1);
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorCouplingMacAyealStokes {{{*/
+-ElementVector* Penta::CreatePVectorCouplingMacAyealStokes(void){
+-
+-	/*compute all load vectors for this element*/
+-	ElementVector* pe1=CreatePVectorCouplingMacAyealStokesViscous();
+-	ElementVector* pe2=CreatePVectorCouplingMacAyealStokesFriction();
+-	ElementVector* pe =new ElementVector(pe1,pe2);
+-
+-	/*clean-up and return*/
+-	delete pe1;
+-	delete pe2;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorCouplingMacAyealStokesViscous {{{*/
+-ElementVector* Penta::CreatePVectorCouplingMacAyealStokesViscous(void){
+-
+-	/*Constants*/
+-	const int   numdof=NUMVERTICES*NDOF4;
+-
+-	/*Intermediaries */
+-	int         i,j,ig;
+-	int         approximation;
+-	IssmDouble      viscosity,Jdet;
+-	IssmDouble      stokesreconditioning;
+-	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
+-	IssmDouble      dw[3];
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      basis[6]; //for the six nodes of the penta
+-	IssmDouble      dbasis[3][6]; //for the six nodes of the penta
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(approximation!=MacAyealStokesApproximationEnum) return NULL;
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	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* vzmacayeal_input=inputs->GetInput(VzMacAyealEnum);   _assert_(vzmacayeal_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsP1(&basis[0], gauss);
+-		GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
+-
+-		vzmacayeal_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
+-
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-
+-		for(i=0;i<NUMVERTICES;i++){
+-			pe->values[i*NDOF4+0]+=-Jdet*gauss->weight*viscosity*dw[0]*dbasis[2][i];
+-			pe->values[i*NDOF4+1]+=-Jdet*gauss->weight*viscosity*dw[1]*dbasis[2][i];
+-			pe->values[i*NDOF4+2]+=-Jdet*gauss->weight*viscosity*(dw[0]*dbasis[0][i]+dw[1]*dbasis[1][i]+2*dw[2]*dbasis[2][i]);
+-			pe->values[i*NDOF4+3]+=Jdet*gauss->weight*stokesreconditioning*dw[2]*basis[i];
+-		}
+-	}
+-
+-	/*Transform coordinate system*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorCouplingMacAyealStokesFriction{{{*/
+-ElementVector* Penta::CreatePVectorCouplingMacAyealStokesFriction(void){
+-
+-	/*Constants*/
+-	const int numdof=NUMVERTICES*NDOF4;
+-
+-	/*Intermediaries*/
+-	int         i,j,ig;
+-	int         approximation,analysis_type;
+-	IssmDouble      Jdet,Jdet2d;
+-	IssmDouble      stokesreconditioning;
+-	IssmDouble	   bed_normal[3];
+-	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
+-	IssmDouble      viscosity, w, alpha2_gauss;
+-	IssmDouble      dw[3];
+-	IssmDouble	   xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      basis[6]; //for the six nodes of the penta
+-	Tria*       tria=NULL;
+-	Friction*   friction=NULL;
+-	GaussPenta  *gauss=NULL;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	if(!IsOnBed() || IsFloating()) return NULL;
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(approximation!=MacAyealStokesApproximationEnum) return NULL;
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	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* vzmacayeal_input=inputs->GetInput(VzMacAyealEnum);   _assert_(vzmacayeal_input);
+-
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-
+-	/*build friction object, used later on: */
+-	friction=new Friction("3d",inputs,matpar,analysis_type);
+-
+-	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
+-		GetNodalFunctionsP1(basis, gauss);
+-
+-		vzmacayeal_input->GetInputValue(&w, gauss);
+-		vzmacayeal_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
+-
+-		BedNormal(&bed_normal[0],xyz_list_tria);
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-		friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum);
+-
+-		for(i=0;i<NUMVERTICES2D;i++){
+-			pe->values[i*NDOF4+0]+=Jdet2d*gauss->weight*(alpha2_gauss*w*bed_normal[0]*bed_normal[2]+2*viscosity*dw[2]*bed_normal[0])*basis[i];
+-			pe->values[i*NDOF4+1]+=Jdet2d*gauss->weight*(alpha2_gauss*w*bed_normal[1]*bed_normal[2]+2*viscosity*dw[2]*bed_normal[1])*basis[i];
+-			pe->values[i*NDOF4+2]+=Jdet2d*gauss->weight*2*viscosity*(dw[0]*bed_normal[0]+dw[1]*bed_normal[1]+dw[2]*bed_normal[2])*basis[i];
+-		}
+-	}
+-
+-	/*Transform coordinate system*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorCouplingPattynStokes {{{*/
+-ElementVector* Penta::CreatePVectorCouplingPattynStokes(void){
+-
+-	/*compute all load vectors for this element*/
+-	ElementVector* pe1=CreatePVectorCouplingPattynStokesViscous();
+-	ElementVector* pe2=CreatePVectorCouplingPattynStokesFriction();
+-	ElementVector* pe =new ElementVector(pe1,pe2);
+-
+-	/*clean-up and return*/
+-	delete pe1;
+-	delete pe2;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorCouplingPattynStokesViscous {{{*/
+-ElementVector* Penta::CreatePVectorCouplingPattynStokesViscous(void){
+-
+-	/*Constants*/
+-	const int   numdof=NUMVERTICES*NDOF4;
+-
+-	/*Intermediaries */
+-	int         i,j,ig;
+-	int         approximation;
+-	IssmDouble      viscosity,Jdet;
+-	IssmDouble      stokesreconditioning;
+-	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
+-	IssmDouble      dw[3];
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      basis[6]; //for the six nodes of the penta
+-	IssmDouble      dbasis[3][6]; //for the six nodes of the penta
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(approximation!=PattynStokesApproximationEnum) return NULL;
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	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* vzpattyn_input=inputs->GetInput(VzPattynEnum);   _assert_(vzpattyn_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsP1(&basis[0], gauss);
+-		GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
+-
+-		vzpattyn_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
+-
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-
+-		for(i=0;i<NUMVERTICES;i++){
+-			pe->values[i*NDOF4+0]+=-Jdet*gauss->weight*viscosity*dw[0]*dbasis[2][i];
+-			pe->values[i*NDOF4+1]+=-Jdet*gauss->weight*viscosity*dw[1]*dbasis[2][i];
+-			pe->values[i*NDOF4+2]+=-Jdet*gauss->weight*viscosity*(dw[0]*dbasis[0][i]+dw[1]*dbasis[1][i]+2*dw[2]*dbasis[2][i]);
+-			pe->values[i*NDOF4+3]+=Jdet*gauss->weight*stokesreconditioning*dw[2]*basis[i];
+-		}
+-	}
+-
+-	/*Transform coordinate system*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorCouplingPattynStokesFriction{{{*/
+-ElementVector* Penta::CreatePVectorCouplingPattynStokesFriction(void){
+-
+-	/*Constants*/
+-	const int numdof=NUMVERTICES*NDOF4;
+-
+-	/*Intermediaries*/
+-	int         i,j,ig;
+-	int         approximation,analysis_type;
+-	IssmDouble      Jdet,Jdet2d;
+-	IssmDouble      stokesreconditioning;
+-	IssmDouble	   bed_normal[3];
+-	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
+-	IssmDouble      viscosity, w, alpha2_gauss;
+-	IssmDouble      dw[3];
+-	IssmDouble	   xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      basis[6]; //for the six nodes of the penta
+-	Tria*       tria=NULL;
+-	Friction*   friction=NULL;
+-	GaussPenta  *gauss=NULL;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	if(!IsOnBed() || IsFloating()) return NULL;
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(approximation!=PattynStokesApproximationEnum) return NULL;
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	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* vzpattyn_input=inputs->GetInput(VzPattynEnum);   _assert_(vzpattyn_input);
+-
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-
+-	/*build friction object, used later on: */
+-	friction=new Friction("3d",inputs,matpar,analysis_type);
+-
+-	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
+-		GetNodalFunctionsP1(basis, gauss);
+-
+-		vzpattyn_input->GetInputValue(&w, gauss);
+-		vzpattyn_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
+-
+-		BedNormal(&bed_normal[0],xyz_list_tria);
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-		friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum);
+-
+-		for(i=0;i<NUMVERTICES2D;i++){
+-			pe->values[i*NDOF4+0]+=Jdet2d*gauss->weight*(alpha2_gauss*w*bed_normal[0]*bed_normal[2]+2*viscosity*dw[2]*bed_normal[0])*basis[i];
+-			pe->values[i*NDOF4+1]+=Jdet2d*gauss->weight*(alpha2_gauss*w*bed_normal[1]*bed_normal[2]+2*viscosity*dw[2]*bed_normal[1])*basis[i];
+-			pe->values[i*NDOF4+2]+=Jdet2d*gauss->weight*2*viscosity*(dw[0]*bed_normal[0]+dw[1]*bed_normal[1]+dw[2]*bed_normal[2])*basis[i];
+-		}
+-	}
+-
+-	/*Transform coordinate system*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticHoriz{{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticHoriz(void){
+-
+-	int approximation;
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	switch(approximation){
+-		case MacAyealApproximationEnum:
+-			return CreatePVectorDiagnosticMacAyeal();
+-		case PattynApproximationEnum:
+-			return CreatePVectorDiagnosticPattyn();
+-		case HutterApproximationEnum:
+-			return NULL;
+-		case NoneApproximationEnum:
+-			return NULL;
+-		case StokesApproximationEnum:
+-			return CreatePVectorDiagnosticStokes();
+-		case MacAyealPattynApproximationEnum:
+-			return CreatePVectorDiagnosticMacAyealPattyn();
+-		case MacAyealStokesApproximationEnum:
+-			return CreatePVectorDiagnosticMacAyealStokes();
+-		case PattynStokesApproximationEnum:
+-			return CreatePVectorDiagnosticPattynStokes();
+-		default:
+-			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticMacAyealPattyn{{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticMacAyealPattyn(void){
+-
+-	/*compute all load vectors for this element*/
+-	ElementVector* pe1=CreatePVectorDiagnosticMacAyeal();
+-	ElementVector* pe2=CreatePVectorDiagnosticPattyn();
+-	ElementVector* pe =new ElementVector(pe1,pe2);
+-
+-	/*clean-up and return*/
+-	delete pe1;
+-	delete pe2;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticMacAyealStokes{{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticMacAyealStokes(void){
+-
+-	/*compute all load vectors for this element*/
+-	ElementVector* pe1=CreatePVectorDiagnosticMacAyeal();
+-	ElementVector* pe2=CreatePVectorDiagnosticStokes();
+-	ElementVector* pe3=CreatePVectorCouplingMacAyealStokes();
+-	ElementVector* pe =new ElementVector(pe1,pe2,pe3);
+-
+-	/*clean-up and return*/
+-	delete pe1;
+-	delete pe2;
+-	delete pe3;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticPattynStokes{{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticPattynStokes(void){
+-
+-	/*compute all load vectors for this element*/
+-	ElementVector* pe1=CreatePVectorDiagnosticPattyn();
+-	ElementVector* pe2=CreatePVectorDiagnosticStokes();
+-	ElementVector* pe3=CreatePVectorCouplingPattynStokes();
+-	ElementVector* pe =new ElementVector(pe1,pe2,pe3);
+-
+-	/*clean-up and return*/
+-	delete pe1;
+-	delete pe2;
+-	delete pe3;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticHutter{{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticHutter(void){
+-
+-	/*Constants*/
+-	const int numdofs=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries*/
+-	int          i,j,k,ig;
+-	int          node0,node1;
+-	int          connectivity[2];
+-	IssmDouble       Jdet;
+-	IssmDouble       xyz_list[NUMVERTICES][3];
+-	IssmDouble       xyz_list_segment[2][3];
+-	IssmDouble       z_list[NUMVERTICES];
+-	IssmDouble       z_segment[2],slope[2];
+-	IssmDouble       slope2,constant_part;
+-	IssmDouble       rho_ice,gravity,n,B;
+-	IssmDouble       ub,vb,z_g,surface,thickness;
+-	GaussPenta*  gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	rho_ice=matpar->GetRhoIce();
+-	gravity=matpar->GetG();
+-	n=matice->GetN();
+-	B=matice->GetB();
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum);  _assert_(thickness_input);
+-	Input* surface_input=inputs->GetInput(SurfaceEnum);      _assert_(surface_input);
+-	Input* slopex_input=inputs->GetInput(SurfaceSlopeXEnum); _assert_(slopex_input);
+-	Input* slopey_input=inputs->GetInput(SurfaceSlopeYEnum); _assert_(slopey_input);
+-	for(i=0;i<NUMVERTICES;i++)z_list[i]=xyz_list[i][2];
+-
+-	/*Loop on the three segments*/
+-	for(i=0;i<3;i++){
+-		node0=i;
+-		node1=i+3;
+-
+-		for(j=0;j<3;j++){
+-			xyz_list_segment[0][j]=xyz_list[node0][j];
+-			xyz_list_segment[1][j]=xyz_list[node1][j];
+-		}
+-
+-		connectivity[0]=nodes[node0]->GetConnectivity();
+-		connectivity[1]=nodes[node1]->GetConnectivity();
+-
+-		/*Loop on the Gauss points: */
+-		gauss=new GaussPenta(node0,node1,3);
+-		for(ig=gauss->begin();ig<gauss->end();ig++){
+-			gauss->GaussPoint(ig);
+-
+-			slopex_input->GetInputValue(&slope[0],gauss);
+-			slopey_input->GetInputValue(&slope[1],gauss);
+-			surface_input->GetInputValue(&surface,gauss);
+-			thickness_input->GetInputValue(&thickness,gauss);
+-
+-			slope2=pow(slope[0],2)+pow(slope[1],2);
+-			constant_part=-2*pow(rho_ice*gravity,n)*pow(slope2,((n-1)/2));
+-
+-			PentaRef::GetInputValue(&z_g,&z_list[0],gauss);
+-			GetSegmentJacobianDeterminant(&Jdet,&xyz_list_segment[0][0],gauss);
+-
+-			if (IsOnSurface()){
+-				for(j=0;j<NDOF2;j++) pe->values[2*node1+j]+=constant_part*pow((surface-z_g)/B,n)*slope[j]*Jdet*gauss->weight/(IssmDouble)connectivity[1];
+-			}
+-			else{//connectivity is too large, should take only half on it
+-				for(j=0;j<NDOF2;j++) pe->values[2*node1+j]+=constant_part*pow((surface-z_g)/B,n)*slope[j]*Jdet*gauss->weight*2/(IssmDouble)connectivity[1];
+-			}
+-		}
+-		delete gauss;
+-
+-		//Deal with lower surface
+-		if (IsOnBed()){
+-			constant_part=-1.58*pow((IssmDouble)10.0,-(IssmDouble)10.0)*rho_ice*gravity*thickness;
+-			ub=constant_part*slope[0];
+-			vb=constant_part*slope[1];
+-
+-			pe->values[2*node0]+=ub/(IssmDouble)connectivity[0];
+-			pe->values[2*node0+1]+=vb/(IssmDouble)connectivity[0];
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticMacAyeal{{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticMacAyeal(void){
+-
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Call Tria function*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementVector* pe=tria->CreatePVectorDiagnosticMacAyeal();
+-	delete tria->matice; delete tria;
+-
+-	/*Clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticPattyn{{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticPattyn(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries*/
+-	int         i,j,ig;
+-	IssmDouble      Jdet;
+-	IssmDouble      slope[3]; //do not put 2! this goes into GetInputDerivativeValue, which addresses slope[3] also!
+-	IssmDouble      driving_stress_baseline,thickness;
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      basis[6];
+-	GaussPenta  *gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+-	Input* surface_input=inputs->GetInput(SurfaceEnum);     _assert_(surface_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(2,3);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsP1(basis, gauss);
+-
+-		thickness_input->GetInputValue(&thickness, gauss);
+-		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
+-
+-		driving_stress_baseline=matpar->GetRhoIce()*matpar->GetG();
+-
+-		for(i=0;i<NUMVERTICES;i++) for(j=0;j<NDOF2;j++) pe->values[i*NDOF2+j]+= -driving_stress_baseline*slope[j]*Jdet*gauss->weight*basis[i];
+-	}
+-
+-	/*Transform coordinate system*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticStokes {{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticStokes(void){
+-
+-	/*compute all load vectors for this element*/
+-	ElementVector* pe1=CreatePVectorDiagnosticStokesViscous();
+-	ElementVector* pe2=CreatePVectorDiagnosticStokesShelf();
+-	ElementVector* pe =new ElementVector(pe1,pe2);
+-
+-	/*clean-up and return*/
+-	delete pe1;
+-	delete pe2;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticStokesViscous {{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticStokesViscous(void){
+-
+-	/*Constants*/
+-	const int numdofbubble=NDOF4*NUMVERTICES+NDOF3*1;
+-
+-	/*Intermediaries*/
+-	int        i,j,ig;
+-	int        approximation;
+-	IssmDouble     Jdet,viscosity;
+-	IssmDouble     gravity,rho_ice,stokesreconditioning;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
+-	IssmDouble     l1l7[7]; //for the six nodes and the bubble 
+-	IssmDouble     B[8][numdofbubble];
+-	IssmDouble     B_prime[8][numdofbubble];
+-	IssmDouble     B_prime_bubble[8][3];
+-	IssmDouble     D[8][8]={0.0};
+-	IssmDouble     D_scalar;
+-	IssmDouble     Pe_gaussian[numdofbubble]={0.0}; //for the six nodes and the bubble 
+-	IssmDouble     Ke_temp[numdofbubble][3]={0.0}; //for the six nodes and the bubble 
+-	IssmDouble     Ke_gaussian[numdofbubble][3];
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum && approximation!=PattynStokesApproximationEnum) return NULL;
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	rho_ice=matpar->GetRhoIce();
+-	gravity=matpar->GetG();
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	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 gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetBStokes(&B[0][0],&xyz_list[0][0],gauss); 
+-		GetBprimeStokes(&B_prime[0][0],&xyz_list[0][0], gauss); 
+-		GetNodalFunctionsMINI(&l1l7[0], gauss);
+-
+-		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+-
+-		for(i=0;i<NUMVERTICES+1;i++){
+-			Pe_gaussian[i*NDOF4+2]+=-rho_ice*gravity*Jdet*gauss->weight*l1l7[i];
+-		}
+-
+-		/*Get bubble part of Bprime */
+-		for(i=0;i<8;i++) for(j=0;j<3;j++) B_prime_bubble[i][j]=B_prime[i][j+24];
+-
+-		D_scalar=gauss->weight*Jdet;
+-		for (i=0;i<6;i++) D[i][i]=D_scalar*2*viscosity;
+-		for (i=6;i<8;i++) D[i][i]=-D_scalar*stokesreconditioning;
+-
+-		TripleMultiply(&B[0][0],8,numdofbubble,1,
+-					&D[0][0],8,8,0,
+-					&B_prime_bubble[0][0],8,3,0,
+-					&Ke_temp[0][0],1);
+-	}
+-
+-	/*Condensation*/
+-	ReduceVectorStokes(pe->values, &Ke_temp[0][0], &Pe_gaussian[0]);
+-
+-	/*Transform coordinate system*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticStokesShelf{{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticStokesShelf(void){
+-
+-	/*Intermediaries*/
+-	int         i,j,ig;
+-	int         approximation,shelf_dampening;
+-	IssmDouble      gravity,rho_water,bed,water_pressure;
+-	IssmDouble      damper,normal_vel,vx,vy,vz,dt;
+-	IssmDouble		xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble		bed_normal[3];
+-	IssmDouble      dz[3];
+-	IssmDouble      basis[6]; //for the six nodes of the penta
+-	IssmDouble      Jdet2d;
+-	GaussPenta  *gauss=NULL;
+-
+-	/*Initialize Element vector and return if necessary*/
+-	if(!IsOnBed() || !IsFloating()) return NULL;
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	this->parameters->FindParam(&shelf_dampening,DiagnosticShelfDampeningEnum);
+-	if(approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum && approximation!=PattynStokesApproximationEnum) return NULL;
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
+-
+-	/*Retrieve all inputs and parameters*/
+-	rho_water=matpar->GetRhoWater();
+-	gravity=matpar->GetG();
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* bed_input=inputs->GetInput(BedEnum); _assert_(bed_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);
+-
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-
+-	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
+-		GetNodalFunctionsP1(basis, gauss);
+-
+-		BedNormal(&bed_normal[0],xyz_list_tria);
+-		bed_input->GetInputValue(&bed, gauss);
+-		if(shelf_dampening){ //add dampening to avoid too high vertical velocities when not in hydrostatic equilibrium
+-			bed_input->GetInputDerivativeValue(&dz[0],&xyz_list[0][0],gauss);
+-			vx_input->GetInputValue(&vx, gauss);
+-			vy_input->GetInputValue(&vy, gauss);
+-			vz_input->GetInputValue(&vz, gauss);
+-			dt=0;
+-			normal_vel=bed_normal[0]*vx+bed_normal[1]*vy+bed_normal[2]*vz;
+-			damper=gravity*rho_water*pow(1+pow(dz[0],2)+pow(dz[1],2),0.5)*normal_vel*dt;
+-		}
+-		else damper=0;
+-		water_pressure=gravity*rho_water*bed;
+-
+-		for(i=0;i<NUMVERTICES;i++) for(j=0;j<3;j++) pe->values[i*NDOF4+j]+=(water_pressure+damper)*gauss->weight*Jdet2d*basis[i]*bed_normal[j];
+-	}
+-
+-	/*Transform coordinate system*/
+-	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticVert {{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticVert(void){
+-
+-	/*compute all load vectors for this element*/
+-	ElementVector* pe1=CreatePVectorDiagnosticVertVolume();
+-	ElementVector* pe2=CreatePVectorDiagnosticVertBase();
+-	ElementVector* pe =new ElementVector(pe1,pe2);
+-
+-	/*clean-up and return*/
+-	delete pe1;
+-	delete pe2;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticVertVolume {{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticVertVolume(void){
+-
+-	/*Constants*/
+-	const int  numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries*/
+-	int        i,ig;
+-	int        approximation;
+-	IssmDouble     Jdet;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     dudx,dvdy,dwdz;
+-	IssmDouble     du[3],dv[3],dw[3];
+-	IssmDouble     basis[6];
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+-	Input* vzstokes_input=NULL;
+-	if(approximation==PattynStokesApproximationEnum || approximation==MacAyealStokesApproximationEnum){
+-		vzstokes_input=inputs->GetInput(VzStokesEnum); _assert_(vzstokes_input);
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(2,2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsP1(basis, gauss);
+-
+-		vx_input->GetInputDerivativeValue(&du[0],&xyz_list[0][0],gauss);
+-		vy_input->GetInputDerivativeValue(&dv[0],&xyz_list[0][0],gauss);
+-		if(approximation==PattynStokesApproximationEnum || approximation==MacAyealStokesApproximationEnum){
+-			vzstokes_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
+-			dwdz=dw[2];
+-		}
+-		else dwdz=0;
+-		dudx=du[0];
+-		dvdy=dv[1];
+-
+-		for (i=0;i<numdof;i++) pe->values[i] += (dudx+dvdy+dwdz)*Jdet*gauss->weight*basis[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorDiagnosticVertBase {{{*/
+-ElementVector* Penta::CreatePVectorDiagnosticVertBase(void){
+-
+-
+-	/*Constants*/
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	int        approximation;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     xyz_list_tria[NUMVERTICES2D][3];
+-	IssmDouble     Jdet2d;
+-	IssmDouble     vx,vy,vz,dbdx,dbdy,basalmeltingvalue;
+-	IssmDouble     slope[3];
+-	IssmDouble     basis[NUMVERTICES];
+-	GaussPenta* gauss=NULL;
+-
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Initialize Element vector*/
+-	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	Input* bed_input=inputs->GetInput(BedEnum);                                _assert_(bed_input);
+-	Input* basal_melting_input=inputs->GetInput(BasalforcingsMeltingRateEnum); _assert_(basal_melting_input);
+-	Input* vx_input=inputs->GetInput(VxEnum);                                  _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);                                  _assert_(vy_input);
+-	Input* vzstokes_input=NULL;
+-	if(approximation==PattynStokesApproximationEnum || approximation==MacAyealStokesApproximationEnum){
+-		vzstokes_input=inputs->GetInput(VzStokesEnum);       _assert_(vzstokes_input);
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(0,1,2,2);
+-	for(ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		basal_melting_input->GetInputValue(&basalmeltingvalue, gauss);
+-		bed_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
+-		vx_input->GetInputValue(&vx, gauss);
+-		vy_input->GetInputValue(&vy, gauss);
+-		if(approximation==PattynStokesApproximationEnum || approximation==MacAyealStokesApproximationEnum){
+-			vzstokes_input->GetInputValue(&vz, gauss);
+-		}
+-		else vz=0;
+-
+-		dbdx=slope[0];
+-		dbdy=slope[1];
+-
+-		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
+-		GetNodalFunctionsP1(&basis[0], gauss);
+-
+-		for(i=0;i<numdof;i++) pe->values[i]+=-Jdet2d*gauss->weight*(vx*dbdx+vy*dbdy-vz-basalmeltingvalue)*basis[i];
+-	}
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return pe;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateJacobianDiagnosticHoriz{{{*/
+-ElementMatrix* Penta::CreateJacobianDiagnosticHoriz(void){
+-
+-	int approximation;
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	switch(approximation){
+-		case MacAyealApproximationEnum:
+-			return CreateJacobianDiagnosticMacayeal2d();
+-		case PattynApproximationEnum:
+-			return CreateJacobianDiagnosticPattyn();
+-		case StokesApproximationEnum:
+-			return CreateJacobianDiagnosticStokes();
+-		case NoneApproximationEnum:
+-			return NULL;
+-		default:
+-			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateJacobianDiagnosticMacayeal2d{{{*/
+-ElementMatrix* Penta::CreateJacobianDiagnosticMacayeal2d(void){
+-
+-	/*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 
+-	  bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 
+-	  the stiffness matrix. */
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Depth Averaging B*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
+-
+-	/*Call Tria function*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementMatrix* Ke=tria->CreateJacobianDiagnosticMacayeal();
+-	delete tria->matice; delete tria;
+-
+-	/*Delete B averaged*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+-
+-	/*clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateJacobianDiagnosticPattyn{{{*/
+-ElementMatrix* Penta::CreateJacobianDiagnosticPattyn(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     Jdet;
+-	IssmDouble     eps1dotdphii,eps1dotdphij;
+-	IssmDouble     eps2dotdphii,eps2dotdphij;
+-	IssmDouble     mu_prime;
+-	IssmDouble     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+-	IssmDouble     eps1[3],eps2[3];
+-	IssmDouble     phi[NUMVERTICES];
+-	IssmDouble     dphi[3][NUMVERTICES];
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Jacobian with regular Pattyn (first part of the Gateau derivative)*/
+-	ElementMatrix* Ke=CreateKMatrixDiagnosticPattyn();
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+-
+-		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+-		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+-		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+-		eps1[2]=epsilon[3];                eps2[2]=epsilon[4];
+-
+-		for(i=0;i<6;i++){
+-			for(j=0;j<6;j++){
+-				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
+-				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
+-				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
+-				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
+-
+-				Ke->values[12*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
+-				Ke->values[12*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
+-				Ke->values[12*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
+-				Ke->values[12*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
+-			}
+-		}
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreateJacobianDiagnosticStokes{{{*/
+-ElementMatrix* Penta::CreateJacobianDiagnosticStokes(void){
+-
+-	/*Constants*/
+-	const int    numdof=NDOF4*NUMVERTICES;
+-
+-	/*Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     Jdet;
+-	IssmDouble     eps1dotdphii,eps1dotdphij;
+-	IssmDouble     eps2dotdphii,eps2dotdphij;
+-	IssmDouble     eps3dotdphii,eps3dotdphij;
+-	IssmDouble     mu_prime;
+-	IssmDouble     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+-	IssmDouble     eps1[3],eps2[3],eps3[3];
+-	IssmDouble     phi[NUMVERTICES];
+-	IssmDouble     dphi[3][NUMVERTICES];
+-	GaussPenta *gauss=NULL;
+-
+-	/*Initialize Jacobian with regular Stokes (first part of the Gateau derivative)*/
+-	ElementMatrix* Ke=CreateKMatrixDiagnosticStokes();
+-
+-	/*Retrieve all inputs and parameters*/
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-	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 gaussian points: */
+-	gauss=new GaussPenta(5,5);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+-
+-		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+-		eps1[0]=epsilon[0];   eps2[0]=epsilon[2];   eps3[0]=epsilon[3];
+-		eps1[1]=epsilon[2];   eps2[1]=epsilon[1];   eps3[1]=epsilon[4];
+-		eps1[2]=epsilon[3];   eps2[2]=epsilon[4];   eps3[2]= -epsilon[0] -epsilon[1];
+-
+-		for(i=0;i<6;i++){
+-			for(j=0;j<6;j++){
+-				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
+-				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
+-				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
+-				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
+-				eps3dotdphii=eps3[0]*dphi[0][i]+eps3[1]*dphi[1][i]+eps3[2]*dphi[2][i];
+-				eps3dotdphij=eps3[0]*dphi[0][j]+eps3[1]*dphi[1][j]+eps3[2]*dphi[2][j];
+-
+-				Ke->values[numdof*(4*i+0)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
+-				Ke->values[numdof*(4*i+0)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
+-				Ke->values[numdof*(4*i+0)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps1dotdphii;
+-
+-				Ke->values[numdof*(4*i+1)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
+-				Ke->values[numdof*(4*i+1)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
+-				Ke->values[numdof*(4*i+1)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps2dotdphii;
+-
+-				Ke->values[numdof*(4*i+2)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps3dotdphii;
+-				Ke->values[numdof*(4*i+2)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps3dotdphii;
+-				Ke->values[numdof*(4*i+2)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps3dotdphii;
+-			}
+-		}
+-	}
+-
+-	/*Transform Coordinate System*/
+-	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetSolutionFromInputsDiagnosticHoriz{{{*/
+-void  Penta::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){
+-
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	int          i;
+-	int          approximation;
+-	int*         doflist=NULL;
+-	IssmDouble       vx,vy;
+-	IssmDouble       values[numdof];
+-	GaussPenta*  gauss;
+-
+-	/*Get approximation enum and dof list: */
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+-
+-	/*If the element is a coupling, do nothing: every node is also on an other elements 
+-	 * (as coupling is between MacAyeal and Pattyn) so the other element will take care of it*/
+-	GetDofList(&doflist,approximation,GsetEnum);
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	/*P1 element only for now*/
+-	gauss=new GaussPenta();
+-	for(i=0;i<NUMVERTICES;i++){
+-
+-		/*Recover vx and vy*/
+-		gauss->GaussVertex(i);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		values[i*NDOF2+0]=vx;
+-		values[i*NDOF2+1]=vy;
+-	}
+-
+-	/*Add value to global vector*/
+-	solution->SetValues(numdof,doflist,values,INS_VAL);
+-
+-	/*Free ressources:*/
+-	delete gauss;
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetSolutionFromInputsDiagnosticHutter{{{*/
+-void  Penta::GetSolutionFromInputsDiagnosticHutter(Vector* solution){
+-
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	int          i;
+-	int*         doflist=NULL;
+-	IssmDouble       vx,vy;
+-	IssmDouble       values[numdof];
+-	GaussPenta*  gauss=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	/*P1 element only for now*/
+-	gauss=new GaussPenta();
+-	for(i=0;i<NUMVERTICES;i++){
+-		/*Recover vx and vy*/
+-		gauss->GaussVertex(i);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		values[i*NDOF2+0]=vx;
+-		values[i*NDOF2+1]=vy;
+-	}
+-
+-	/*Add value to global vector*/
+-	solution->SetValues(numdof,doflist,values,INS_VAL);
+-
+-	/*Free ressources:*/
+-	delete gauss;
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetSolutionFromInputsDiagnosticVert{{{*/
+-void  Penta::GetSolutionFromInputsDiagnosticVert(Vector* solution){
+-
+-	const int    numdof=NDOF1*NUMVERTICES;
+-
+-	int          i;
+-	int*         doflist=NULL;
+-	IssmDouble       vz;
+-	IssmDouble       values[numdof];
+-	GaussPenta*  gauss=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-	Input* vz_input=inputs->GetInput(VzEnum); _assert_(vz_input);
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	/*P1 element only for now*/
+-	gauss=new GaussPenta();
+-	for(i=0;i<NUMVERTICES;i++){
+-		/*Recover vz */
+-		gauss->GaussVertex(i);
+-		vz_input->GetInputValue(&vz,gauss);
+-		values[i]=vz;
+-	}
+-
+-	/*Add value to global vector*/
+-	solution->SetValues(numdof,doflist,values,INS_VAL);
+-
+-	/*Free ressources:*/
+-	delete gauss;
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::GetSolutionFromInputsDiagnosticStokes{{{*/
+-void  Penta::GetSolutionFromInputsDiagnosticStokes(Vector* solution){
+-
+-	const int    numdof=NDOF4*NUMVERTICES;
+-
+-	int          i;
+-	int*         doflist=NULL;
+-	IssmDouble       vx,vy,vz,p;
+-	IssmDouble       stokesreconditioning;
+-	IssmDouble       values[numdof];
+-	GaussPenta   *gauss;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,StokesApproximationEnum,GsetEnum);
+-	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* p_input =inputs->GetInput(PressureEnum); _assert_(p_input);
+-
+-	/*Recondition pressure: */
+-	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-
+-	/*Ok, we have vx vy vz and P in values, fill in vx vy vz P arrays: */
+-	/*P1 element only for now*/
+-	gauss=new GaussPenta();
+-	for(i=0;i<NUMVERTICES;i++){
+-		gauss->GaussVertex(i);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		vz_input->GetInputValue(&vz,gauss);
+-		p_input ->GetInputValue(&p ,gauss);
+-		values[i*NDOF4+0]=vx;
+-		values[i*NDOF4+1]=vy;
+-		values[i*NDOF4+2]=vz;
+-		values[i*NDOF4+3]=p/stokesreconditioning;
+-	}
+-
+-	/*Add value to global vector*/
+-	solution->SetValues(numdof,doflist,values,INS_VAL);
+-
+-	/*Free ressources:*/
+-	delete gauss;
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticHoriz {{{*/
+-void  Penta::InputUpdateFromSolutionDiagnosticHoriz(IssmDouble* solution){
+-
+-	int  approximation;
+-
+-	/*Recover inputs*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-
+-	/*MacAyeal, everything is done by the element on bed*/
+-	if (approximation==MacAyealApproximationEnum){
+-		if (!IsOnBed()){
+-			/*Do nothing. Element on bed will take care of it*/
+-			return;
+-		}
+-		else{
+-			InputUpdateFromSolutionDiagnosticMacAyeal(solution);
+-			return;
+-		}
+-	}
+-	else if (approximation==PattynApproximationEnum){
+-		InputUpdateFromSolutionDiagnosticPattyn(solution);
+-	}
+-	else if (approximation==PattynStokesApproximationEnum){
+-		InputUpdateFromSolutionDiagnosticPattynStokes(solution);
+-	}
+-	else if (approximation==MacAyealStokesApproximationEnum){
+-		InputUpdateFromSolutionDiagnosticMacAyealStokes(solution);
+-	}
+-	else if (approximation==StokesApproximationEnum || approximation==NoneApproximationEnum){
+-		InputUpdateFromSolutionDiagnosticStokes(solution);
+-	}
+-	else if (approximation==MacAyealPattynApproximationEnum){
+-		InputUpdateFromSolutionDiagnosticMacAyealPattyn(solution);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticMacAyeal {{{*/
+-void  Penta::InputUpdateFromSolutionDiagnosticMacAyeal(IssmDouble* solution){
+-
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	int     i;
+-	IssmDouble  rho_ice,g;
+-	IssmDouble  values[numdof];
+-	IssmDouble  vx[NUMVERTICES];
+-	IssmDouble  vy[NUMVERTICES];
+-	IssmDouble  vz[NUMVERTICES];
+-	IssmDouble  vel[NUMVERTICES];
+-	IssmDouble  pressure[NUMVERTICES];
+-	IssmDouble  surface[NUMVERTICES];
+-	IssmDouble  xyz_list[NUMVERTICES][3];
+-	int    *doflist = NULL;
+-	Penta  *penta   = NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,MacAyealApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
+-	/*Transform solution in Cartesian Space*/
+-	TransformSolutionCoord(&values[0],nodes,NUMVERTICES2D,XYEnum); /*2D: only the first 3 nodes are taken*/
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays and extrude */
+-	for(i=0;i<3;i++){
+-		vx[i]  =values[i*NDOF2+0];
+-		vy[i]  =values[i*NDOF2+1];
+-		vx[i+3]=vx[i];
+-		vy[i+3]=vy[i];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Get parameters fro pressure computation*/
+-	rho_ice=matpar->GetRhoIce();
+-	g=matpar->GetG();
+-
+-	/*Start looping over all elements above current element and update all inputs*/
+-	penta=this;
+-	for(;;){
+-
+-		/*Get node data: */
+-		GetVerticesCoordinates(&xyz_list[0][0],penta->nodes,NUMVERTICES);
+-
+-		/*Now Compute vel*/
+-		GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0
+-		for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+-
+-		/*Now compute pressure*/
+-		GetInputListOnVertices(&surface[0],SurfaceEnum);
+-		for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
+-
+-		/*Now, we have to move the previous Vx and Vy inputs  to old 
+-		 * status, otherwise, we'll wipe them off: */
+-		penta->inputs->ChangeEnum(VxEnum,VxPicardEnum);
+-		penta->inputs->ChangeEnum(VyEnum,VyPicardEnum);
+-		penta->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
+-
+-		/*Add vx and vy as inputs to the tria element: */
+-		penta->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+-		penta->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+-		penta->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+-		penta->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
+-
+-		/*Stop if we have reached the surface*/
+-		if (penta->IsOnSurface()) break;
+-
+-		/* get upper Penta*/
+-		penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id);
+-	}
+-	
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticMacAyealPattyn {{{*/
+-void  Penta::InputUpdateFromSolutionDiagnosticMacAyealPattyn(IssmDouble* solution){
+-
+-	const int    numdof=NDOF2*NUMVERTICES;
+-	const int    numdof2d=NDOF2*NUMVERTICES2D;
+-
+-	int     i;
+-	IssmDouble  rho_ice,g;
+-	IssmDouble  macayeal_values[numdof];
+-	IssmDouble  pattyn_values[numdof];
+-	IssmDouble  vx[NUMVERTICES];
+-	IssmDouble  vy[NUMVERTICES];
+-	IssmDouble  vz[NUMVERTICES];
+-	IssmDouble  vel[NUMVERTICES];
+-	IssmDouble  pressure[NUMVERTICES];
+-	IssmDouble  surface[NUMVERTICES];
+-	IssmDouble  xyz_list[NUMVERTICES][3];
+-	int*    doflistp = NULL;
+-	int*    doflistm = NULL;
+-	Penta   *penta   = NULL;
+-
+-	/*OK, we have to add results of this element for pattyn 
+-	 * and results from the penta at base for macayeal. Now recover results*/
+-	penta=GetBasalElement();
+-
+-	/*Get dof listof this element (pattyn dofs) and of the penta at base (macayeal dofs): */
+-	GetDofList(&doflistp,PattynApproximationEnum,GsetEnum);
+-	penta->GetDofList(&doflistm,MacAyealApproximationEnum,GsetEnum);
+-
+-	/*Get node data: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof2d;i++){
+-		pattyn_values[i]=solution[doflistp[i]];
+-		macayeal_values[i]=solution[doflistm[i]];
+-	}
+-	for(i=numdof2d;i<numdof;i++){
+-		pattyn_values[i]=solution[doflistp[i]];
+-		macayeal_values[i]=macayeal_values[i-numdof2d];
+-	}
+-
+-	/*Transform solution in Cartesian Space*/
+-	TransformSolutionCoord(&macayeal_values[0],penta->nodes,NUMVERTICES,XYEnum);
+-	TransformSolutionCoord(&pattyn_values[0],   this->nodes,NUMVERTICES,XYEnum);
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		vx[i]=macayeal_values[i*NDOF2+0]+pattyn_values[i*NDOF2+0];
+-		vy[i]=macayeal_values[i*NDOF2+1]+pattyn_values[i*NDOF2+1];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Now Compute vel*/
+-	GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0
+-	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+-
+-	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D, 
+-	 *so the pressure is just the pressure at the z elevation: */
+-	rho_ice=matpar->GetRhoIce();
+-	g=matpar->GetG();
+-	GetInputListOnVertices(&surface[0],SurfaceEnum);
+-	for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
+-
+-	/*Now, we have to move the previous Vx and Vy inputs  to old 
+-	 * status, otherwise, we'll wipe them off: */
+-	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
+-	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
+-	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+-	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+-	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+-	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflistp);
+-	xDelete<int>(doflistm);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticMacAyealStokes {{{*/
+-void  Penta::InputUpdateFromSolutionDiagnosticMacAyealStokes(IssmDouble* solution){
+-
+-	const int    numdofm=NDOF2*NUMVERTICES;
+-	const int    numdofs=NDOF4*NUMVERTICES;
+-	const int    numdof2d=NDOF2*NUMVERTICES2D;
+-
+-	int     i;
+-	IssmDouble  stokesreconditioning;
+-	IssmDouble  macayeal_values[numdofm];
+-	IssmDouble  stokes_values[numdofs];
+-	IssmDouble  vx[NUMVERTICES];
+-	IssmDouble  vy[NUMVERTICES];
+-	IssmDouble  vz[NUMVERTICES];
+-	IssmDouble  vzmacayeal[NUMVERTICES];
+-	IssmDouble  vzstokes[NUMVERTICES];
+-	IssmDouble  vel[NUMVERTICES];
+-	IssmDouble  pressure[NUMVERTICES];
+-	IssmDouble  xyz_list[NUMVERTICES][3];
+-	int*    doflistm        = NULL;
+-	int*    doflists        = NULL;
+-	Penta   *penta          = NULL;
+-
+-	/*OK, we have to add results of this element for macayeal 
+-	 * and results from the penta at base for macayeal. Now recover results*/
+-	penta=GetBasalElement();
+-
+-	/*Get dof listof this element (macayeal dofs) and of the penta at base (macayeal dofs): */
+-	penta->GetDofList(&doflistm,MacAyealApproximationEnum,GsetEnum);
+-	GetDofList(&doflists,StokesApproximationEnum,GsetEnum);
+-	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-
+-	/*Get node data: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof2d;i++){
+-		macayeal_values[i]=solution[doflistm[i]];
+-		macayeal_values[i+numdof2d]=solution[doflistm[i]];
+-	}
+-	for(i=0;i<numdofs;i++){
+-		stokes_values[i]=solution[doflists[i]];
+-	}
+-
+-	/*Transform solution in Cartesian Space*/
+-	TransformSolutionCoord(&macayeal_values[0],this->nodes,NUMVERTICES,XYEnum);
+-	TransformSolutionCoord(&stokes_values[0],this->nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		vx[i]=stokes_values[i*NDOF4+0]+macayeal_values[i*NDOF2+0];
+-		vy[i]=stokes_values[i*NDOF4+1]+macayeal_values[i*NDOF2+1];
+-		vzstokes[i]=stokes_values[i*NDOF4+2];
+-		pressure[i]=stokes_values[i*NDOF4+3]*stokesreconditioning;
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vzstokes[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(pressure[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Get Vz*/
+-	Input* vzmacayeal_input=inputs->GetInput(VzMacAyealEnum);
+-	if (vzmacayeal_input){
+-		if (vzmacayeal_input->ObjectEnum()!=PentaP1InputEnum){
+-			_error2_("Cannot compute Vel as VzMacAyeal is of type " << EnumToStringx(vzmacayeal_input->ObjectEnum()));
+-		}
+-		GetInputListOnVertices(&vzmacayeal[0],VzMacAyealEnum);
+-	}
+-	else{
+-		_error2_("Cannot update solution as VzMacAyeal is not present");
+-	}
+-
+-	/*Now Compute vel*/
+-	for(i=0;i<NUMVERTICES;i++) {
+-		vz[i]=vzmacayeal[i]+vzstokes[i];
+-		vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+-	}
+-
+-	/*Now, we have to move the previous Vx and Vy inputs  to old 
+-	 * status, otherwise, we'll wipe them off: */
+-	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
+-	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
+-	this->inputs->ChangeEnum(VzEnum,VzPicardEnum);
+-	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+-	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+-	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
+-	this->inputs->AddInput(new PentaP1Input(VzStokesEnum,vzstokes));
+-	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+-	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflistm);
+-	xDelete<int>(doflists);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticPattyn {{{*/
+-void  Penta::InputUpdateFromSolutionDiagnosticPattyn(IssmDouble* solution){
+-	
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	int    i;
+-	IssmDouble rho_ice,g;
+-	IssmDouble values[numdof];
+-	IssmDouble vx[NUMVERTICES];
+-	IssmDouble vy[NUMVERTICES];
+-	IssmDouble vz[NUMVERTICES];
+-	IssmDouble vel[NUMVERTICES];
+-	IssmDouble pressure[NUMVERTICES];
+-	IssmDouble surface[NUMVERTICES];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	int*   doflist = NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,PattynApproximationEnum,GsetEnum);
+-
+-	/*Get node data: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
+-	/*Transform solution in Cartesian Space*/
+-	TransformSolutionCoord(&values[0],nodes,NUMVERTICES,XYEnum);
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		vx[i]=values[i*NDOF2+0];
+-		vy[i]=values[i*NDOF2+1];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Get Vz*/
+-	Input* vz_input=inputs->GetInput(VzEnum);
+-	if (vz_input){
+-		GetInputListOnVertices(&vz[0],VzEnum);
+-	}
+-	else{
+-		for(i=0;i<NUMVERTICES;i++) vz[i]=0.0;
+-	}
+-
+-	/*Now Compute vel*/
+-	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+-
+-	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D, 
+-	 *so the pressure is just the pressure at the z elevation: */
+-	rho_ice=matpar->GetRhoIce();
+-	g=matpar->GetG();
+-	GetInputListOnVertices(&surface[0],SurfaceEnum);
+-	for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
+-
+-	/*Now, we have to move the previous Vx and Vy inputs  to old 
+-	 * status, otherwise, we'll wipe them off: */
+-	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
+-	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
+-	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+-	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+-	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+-	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticPattynStokes {{{*/
+-void  Penta::InputUpdateFromSolutionDiagnosticPattynStokes(IssmDouble* solution){
+-
+-	const int    numdofp=NDOF2*NUMVERTICES;
+-	const int    numdofs=NDOF4*NUMVERTICES;
+-
+-	int    i;
+-	IssmDouble pattyn_values[numdofp];
+-	IssmDouble stokes_values[numdofs];
+-	IssmDouble vx[NUMVERTICES];
+-	IssmDouble vy[NUMVERTICES];
+-	IssmDouble vz[NUMVERTICES];
+-	IssmDouble vzpattyn[NUMVERTICES];
+-	IssmDouble vzstokes[NUMVERTICES];
+-	IssmDouble vel[NUMVERTICES];
+-	IssmDouble pressure[NUMVERTICES];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble stokesreconditioning;
+-	int*   doflistp      = NULL;
+-	int*   doflists      = NULL;
+-	Penta  *penta        = NULL;
+-
+-	/*OK, we have to add results of this element for pattyn 
+-	 * and results from the penta at base for macayeal. Now recover results*/
+-	penta=GetBasalElement();
+-
+-	/*Get dof listof this element (pattyn dofs) and of the penta at base (macayeal dofs): */
+-	GetDofList(&doflistp,PattynApproximationEnum,GsetEnum);
+-	GetDofList(&doflists,StokesApproximationEnum,GsetEnum);
+-	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-
+-	/*Get node data: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdofp;i++) pattyn_values[i]=solution[doflistp[i]];
+-	for(i=0;i<numdofs;i++) stokes_values[i]=solution[doflists[i]];
+-
+-	/*Transform solution in Cartesian Space*/
+-	TransformSolutionCoord(&pattyn_values[0],this->nodes,NUMVERTICES,XYEnum);
+-	TransformSolutionCoord(&stokes_values[0],this->nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		vx[i]=stokes_values[i*NDOF4+0]+pattyn_values[i*NDOF2+0];
+-		vy[i]=stokes_values[i*NDOF4+1]+pattyn_values[i*NDOF2+1];
+-		vzstokes[i]=stokes_values[i*NDOF4+2];
+-		pressure[i]=stokes_values[i*NDOF4+3]*stokesreconditioning;
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vzstokes[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(pressure[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Get Vz*/
+-	Input* vzpattyn_input=inputs->GetInput(VzPattynEnum);
+-	if (vzpattyn_input){
+-		if (vzpattyn_input->ObjectEnum()!=PentaP1InputEnum){
+-			_error2_("Cannot compute Vel as VzPattyn is of type " << EnumToStringx(vzpattyn_input->ObjectEnum()));
+-		}
+-		GetInputListOnVertices(&vzpattyn[0],VzPattynEnum);
+-	}
+-	else{
+-		_error2_("Cannot update solution as VzPattyn is not present");
+-	}
+-
+-	/*Now Compute vel*/
+-	for(i=0;i<NUMVERTICES;i++) {
+-		vz[i]=vzpattyn[i]+vzstokes[i];
+-		vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+-	}
+-
+-	/*Now, we have to move the previous Vx and Vy inputs  to old 
+-	 * status, otherwise, we'll wipe them off: */
+-	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
+-	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
+-	this->inputs->ChangeEnum(VzEnum,VzPicardEnum);
+-	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+-	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+-	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
+-	this->inputs->AddInput(new PentaP1Input(VzStokesEnum,vzstokes));
+-	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+-	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflistp);
+-	xDelete<int>(doflists);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticHutter {{{*/
+-void  Penta::InputUpdateFromSolutionDiagnosticHutter(IssmDouble* solution){
+-	
+-	const int    numdof=NDOF2*NUMVERTICES;
+-
+-	int     i;
+-	IssmDouble  rho_ice,g;
+-	IssmDouble  values[numdof];
+-	IssmDouble  vx[NUMVERTICES];
+-	IssmDouble  vy[NUMVERTICES];
+-	IssmDouble  vz[NUMVERTICES];
+-	IssmDouble  vel[NUMVERTICES];
+-	IssmDouble  pressure[NUMVERTICES];
+-	IssmDouble  surface[NUMVERTICES];
+-	IssmDouble  xyz_list[NUMVERTICES][3];
+-	int*    doflist = NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-
+-	/*Get node data: */
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		vx[i]=values[i*NDOF2+0];
+-		vy[i]=values[i*NDOF2+1];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Now Compute vel*/
+-	GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0
+-	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+-
+-	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D, 
+-	 *so the pressure is just the pressure at the z elevation: */
+-	rho_ice=matpar->GetRhoIce();
+-	g=matpar->GetG();
+-	GetInputListOnVertices(&surface[0],SurfaceEnum);
+-	for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
+-
+-	/*Now, we have to move the previous Vx and Vy inputs  to old 
+-	 * status, otherwise, we'll wipe them off: */
+-	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
+-	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
+-	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+-	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+-	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+-	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticVert {{{*/
+-void  Penta::InputUpdateFromSolutionDiagnosticVert(IssmDouble* solution){
+-
+-	const int numdof=NDOF1*NUMVERTICES;
+-	
+-	int      i;
+-	int      approximation;
+-	IssmDouble   rho_ice,g;
+-	IssmDouble   values[numdof];
+-	IssmDouble   vx[NUMVERTICES];
+-	IssmDouble   vy[NUMVERTICES];
+-	IssmDouble   vz[NUMVERTICES];
+-	IssmDouble   vzmacayeal[NUMVERTICES];
+-	IssmDouble   vzpattyn[NUMVERTICES];
+-	IssmDouble   vzstokes[NUMVERTICES];
+-	IssmDouble   vel[NUMVERTICES];
+-	IssmDouble   pressure[NUMVERTICES];
+-	IssmDouble   surface[NUMVERTICES];
+-	IssmDouble   xyz_list[NUMVERTICES][3];
+-	int*     doflist      = NULL;
+-
+-
+-	/*Get the approximation and do nothing if the element in Stokes or None*/
+-	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(approximation==StokesApproximationEnum || approximation==NoneApproximationEnum){
+-		return;
+-	}
+-
+-	/*Get dof list and vertices coordinates: */
+-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+-
+-	/*Use the dof list to index into the solution vector vz: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-	for(i=0;i<NUMVERTICES;i++){
+-		vz[i]=values[i*NDOF1+0];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vz[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Get Vx and Vy*/
+-	GetInputListOnVertices(&vx[0],VxEnum,0.0); //default is 0
+-	GetInputListOnVertices(&vy[0],VyEnum,0.0); //default is 0
+-
+-	/*Do some modifications if we actually have a PattynStokes or MacAyealStokes element*/
+-	if(approximation==PattynStokesApproximationEnum){
+-		Input* vzstokes_input=inputs->GetInput(VzStokesEnum);
+-		if (vzstokes_input){
+-			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error2_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));
+-			GetInputListOnVertices(&vzstokes[0],VzStokesEnum);
+-		}
+-		else _error2_("Cannot compute Vz as VzStokes in not present in PattynStokes element");
+-		for(i=0;i<NUMVERTICES;i++){
+-			vzpattyn[i]=vz[i];
+-			vz[i]=vzpattyn[i]+vzstokes[i];
+-		}
+-	}
+-	else if(approximation==MacAyealStokesApproximationEnum){
+-		Input* vzstokes_input=inputs->GetInput(VzStokesEnum);
+-		if (vzstokes_input){
+-			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error2_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));
+-			GetInputListOnVertices(&vzstokes[0],VzStokesEnum);
+-		}
+-		else _error2_("Cannot compute Vz as VzStokes in not present in MacAyealStokes element");
+-		for(i=0;i<NUMVERTICES;i++){
+-			vzmacayeal[i]=vz[i];
+-			vz[i]=vzmacayeal[i]+vzstokes[i];
+-		}
+-	}
+-
+-	/*Now Compute vel*/
+-	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+-
+-	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D, 
+-	 *so the pressure is just the pressure at the z elevation: except it this is a PattynStokes element */
+-	if(approximation!=PattynStokesApproximationEnum &&  approximation!=MacAyealStokesApproximationEnum){
+-		rho_ice=matpar->GetRhoIce();
+-		g=matpar->GetG();
+-		GetInputListOnVertices(&surface[0],SurfaceEnum);
+-		for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
+-	}
+-
+-	/*Now, we have to move the previous Vz inputs to old 
+-	 * status, otherwise, we'll wipe them off and add the new inputs: */
+-	this->inputs->ChangeEnum(VzEnum,VzPicardEnum);
+-
+-	if(approximation!=PattynStokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum){
+-		this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
+-		this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
+-	}
+-	else if(approximation==PattynStokesApproximationEnum){
+-		this->inputs->AddInput(new PentaP1Input(VzPattynEnum,vzpattyn));
+-	}
+-	else if(approximation==MacAyealStokesApproximationEnum){
+-		this->inputs->AddInput(new PentaP1Input(VzMacAyealEnum,vzmacayeal));
+-	}
+-	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
+-	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticStokes {{{*/
+-void  Penta::InputUpdateFromSolutionDiagnosticStokes(IssmDouble* solution){
+-	
+-	const int numdof=NDOF4*NUMVERTICES;
+-
+-	int     i;
+-	IssmDouble  values[numdof];
+-	IssmDouble  vx[NUMVERTICES];
+-	IssmDouble  vy[NUMVERTICES];
+-	IssmDouble  vz[NUMVERTICES];
+-	IssmDouble  vel[NUMVERTICES];
+-	IssmDouble  pressure[NUMVERTICES];
+-	IssmDouble  stokesreconditioning;
+-	int*    doflist=NULL;
+-
+-	/*Get dof list: */
+-	GetDofList(&doflist,StokesApproximationEnum,GsetEnum);
+-
+-	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
+-	/*Transform solution in Cartesian Space*/
+-	TransformSolutionCoord(&values[0],nodes,NUMVERTICES,XYZPEnum);
+-
+-	/*Ok, we have vx and vy in values, fill in all arrays: */
+-	for(i=0;i<NUMVERTICES;i++){
+-		vx[i]=values[i*NDOF4+0];
+-		vy[i]=values[i*NDOF4+1];
+-		vz[i]=values[i*NDOF4+2];
+-		pressure[i]=values[i*NDOF4+3];
+-
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vz[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(pressure[i])) _error2_("NaN found in solution vector");
+-	}
+-
+-	/*Recondition pressure and compute vel: */
+-	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+-	for(i=0;i<NUMVERTICES;i++) pressure[i]=pressure[i]*stokesreconditioning;
+-	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+-	
+-	/*Now, we have to move the previous inputs  to old 
+-	 * status, otherwise, we'll wipe them off: */
+-	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
+-	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
+-	this->inputs->ChangeEnum(VzEnum,VzPicardEnum);
+-	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
+-
+-	/*Add vx and vy as inputs to the tria element: */
+-	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+-	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+-	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
+-	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+-	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
+-
+-	/*Free ressources:*/
+-	xDelete<int>(doflist);
+-}
+-/*}}}*/
+-#endif
+-
+-#ifdef _HAVE_BALANCED_
+-/*FUNCTION Penta::CreateKMatrixBalancethickness {{{*/
+-ElementMatrix* Penta::CreateKMatrixBalancethickness(void){
+-
+-	/*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 
+-	  bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 
+-	  the stiffness matrix. */
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Depth Averaging Vx and Vy*/
+-	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
+-	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
+-
+-	/*Spawn Tria element from the base of the Penta: */
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementMatrix* Ke=tria->CreateKMatrixBalancethickness();
+-	delete tria->matice; delete tria;
+-
+-	/*Delete Vx and Vy averaged*/
+-	this->inputs->DeleteInput(VxAverageEnum);
+-	this->inputs->DeleteInput(VyAverageEnum);
+-
+-	/*clean up and return*/
+-	return Ke;
+-}
+-/*}}}*/
+-/*FUNCTION Penta::CreatePVectorBalancethickness {{{*/
+-ElementVector* Penta::CreatePVectorBalancethickness(void){
+-
+-	if (!IsOnBed()) return NULL;
+-
+-	/*Depth Averaging Vx and Vy*/
+-	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
+-	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
+-
+-	/*Call Tria function*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementVector* pe=tria->CreatePVectorBalancethickness();
+-	delete tria->matice; delete tria;
+-
+-	/*Delete Vx and Vy averaged*/
+-	this->inputs->DeleteInput(VxAverageEnum);
+-	this->inputs->DeleteInput(VyAverageEnum);
+-
+-	/*Clean up and return*/
+-	return pe;
+-}
+-/*}}}*/
+-#endif
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaHook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaHook.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaHook.cpp	(revision 12822)
+@@ -1,104 +0,0 @@
+-/*!\file PentaHook.c
+- * \brief: implementation of the PentaHook object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Object constructors and destructor*/
+-/*FUNCTION PentaHook::PentaHook(){{{*/
+-PentaHook::PentaHook(){
+-	numanalyses=UNDEF;
+-	this->hnodes=NULL;
+-	this->hmatice=NULL;
+-	this->hmatpar=NULL;
+-	this->hneighbors=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION PentaHook::~PentaHook(){{{*/
+-PentaHook::~PentaHook(){
+-
+-	int i;
+-
+-	for(i=0;i<this->numanalyses;i++){
+-		if (this->hnodes[i]) delete this->hnodes[i];
+-	}
+-	delete [] this->hnodes;
+-	delete hmatice;
+-	delete hmatpar;
+-	delete hneighbors;
+-}
+-/*}}}*/
+-/*FUNCTION PentaHook::PentaHook(int in_numanalyses,int matice_id, int matpar_id){{{*/
+-PentaHook::PentaHook(int in_numanalyses,int matice_id, IoModel* iomodel){
+-
+-	/*intermediary: */
+-	int matpar_id;
+-	
+-	/*retrieve parameters: */
+-	iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
+-
+-	this->numanalyses=in_numanalyses;
+-	this->hnodes=new Hook*[in_numanalyses];
+-	this->hmatice=new Hook(&matice_id,1);
+-	this->hmatpar=new Hook(&matpar_id,1);
+-	this->hneighbors=NULL; 
+-
+-	//Initialize hnodes as NULL
+-	for(int i=0;i<this->numanalyses;i++){
+-		this->hnodes[i]=NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*FUNCTION PentaHook::SetHookNodes{{{*/
+-void PentaHook::SetHookNodes(int* node_ids,int analysis_counter){
+-	this->hnodes[analysis_counter]= new Hook(node_ids,6);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaHook::InitHookNeighbors{{{*/
+-void PentaHook::InitHookNeighbors(int* element_ids){
+-	this->hneighbors=new Hook(element_ids,2);
+-
+-}
+-/*}}}*/
+-/*FUNCTION PentaHook::SpawnTriaHook{{{*/
+-void PentaHook::SpawnTriaHook(TriaHook* triahook,int* indices){
+-
+-	int i;
+-	int zero=0;
+-
+-	triahook->numanalyses=this->numanalyses;
+-	triahook->hnodes=new Hook*[this->numanalyses];
+-
+-	for(i=0;i<this->numanalyses;i++){
+-		/*Do not do anything if Hook is empty*/
+-		if (!this->hnodes[i] || this->hnodes[i]->GetNum()==0){
+-			triahook->hnodes[i]=NULL;
+-		}
+-		else{
+-			/*Else, spawn Hook*/
+-			triahook->hnodes[i]=this->hnodes[i]->Spawn(indices,3);
+-		}
+-	}
+-	// do not spawn hmatice. matice will be taken care of by Penta
+-	triahook->hmatice=NULL;
+-	triahook->hmatpar=(Hook*)this->hmatpar->copy();
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaRef.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaRef.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaRef.h	(revision 12822)
+@@ -1,63 +0,0 @@
+-/*!\file:  PentaRef.h
+- * \brief abstract class for handling Penta oriented routines, like nodal functions, 
+- * strain rate generation, etc ...
+- */ 
+-
+-
+-#ifndef _PENTAREF_H_
+-#define _PENTAREF_H_
+-
+-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 GetNodalFunctionsP1(IssmDouble* l1l6, GaussPenta* gauss);
+-		void GetNodalFunctionsMINI(IssmDouble* l1l7, GaussPenta* gauss);
+-		void GetNodalFunctionsP1Derivatives(IssmDouble* dh1dh6,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetNodalFunctionsMINIDerivatives(IssmDouble* dh1dh7,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetNodalFunctionsP1DerivativesReference(IssmDouble* dl1dl6,GaussPenta* gauss);
+-		void GetNodalFunctionsMINIDerivativesReference(IssmDouble* dl1dl7,GaussPenta* gauss);
+-		void GetQuadNodalFunctions(IssmDouble* l1l4,GaussPenta* gauss,int index1,int index2,int index3,int index4);
+-		void GetQuadJacobianDeterminant(IssmDouble*  Jdet, IssmDouble xyz_list[4][3],GaussPenta* gauss);
+-		void GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussPenta* gauss);
+-		void GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss);
+-		void GetTriaJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss);
+-		void GetSegmentJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss);
+-		void GetJacobianInvert(IssmDouble*  Jinv, IssmDouble* xyz_list,GaussPenta* gauss);
+-		void GetBMacAyealPattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBMacAyealStokes(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBPattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBStokes(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBprimeMacAyealStokes(IssmDouble* Bprime, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBprimePattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBprimeStokes(IssmDouble* B_prime, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBprimeVert(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBAdvec(IssmDouble* B_advec, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBConduct(IssmDouble* B_conduct, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBVert(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetBprimeAdvec(IssmDouble* Bprime_advec, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetL(IssmDouble* L, GaussPenta* gauss,int numdof);
+-		void GetLStokes(IssmDouble* LStokes, GaussPenta* gauss);
+-		void GetLprimeStokes(IssmDouble* LprimeStokes, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetLMacAyealStokes(IssmDouble* LMacAyealStokes, GaussPenta* gauss);
+-		void GetLprimeMacAyealStokes(IssmDouble* LprimeMacAyealStokes, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetLStokesMacAyeal(IssmDouble* LStokesMacAyeal, GaussPenta* gauss);
+-		void GetLprimeStokesMacAyeal(IssmDouble* LprimeStokesMacAyeal, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,IssmDouble* plist, GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,IssmDouble* plist,GaussTria* gauss){_error2_("only PentaGauss are supported");};
+-		void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss){_error2_("only PentaGauss are supported");};
+-
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h	(revision 12822)
+@@ -1,317 +0,0 @@
+-/*! \file Penta.h 
+- *  \brief: header file for penta object
+- */
+-
+-#ifndef _PENTA_H_
+-#define _PENTA_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./Element.h"
+-#include "./PentaHook.h"
+-#include "./PentaRef.h"
+-class  Object;
+-class Parameters;
+-class Inputs;
+-class IoModel;
+-class Node;
+-class Matice;
+-class Matpar;
+-class Tria;
+-class ElementMatrix;
+-class ElementVector;
+-
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-/*}}}*/
+-
+-class Penta: public Element,public PentaHook,public PentaRef{
+-
+-	public:
+-
+-		int          id;
+-		int          sid;
+-
+-		Node       **nodes;        // 6 nodes
+-		Matice      *matice;       // 1 material ice
+-		Matpar      *matpar;       // 1 material parameter
+-		Penta      **verticalneighbors;   // 2 neighbors: first one under, second one above
+-		int          horizontalneighborsids[3];
+-
+-		Parameters  *parameters;   //pointer to solution parameters
+-		Inputs      *inputs;
+-		Results      *results;
+-
+-		/*Penta constructors and destructor: {{{*/
+-		Penta();
+-		Penta(int penta_id,int penta_sid,int i, IoModel* iomodel,int nummodels);
+-		~Penta();
+-		/*}}}*/
+-		/*Object virtual functions definitions: {{{*/
+-		Object*   copy();
+-		void	  DeepEcho();
+-		void	  Echo();
+-		int		  ObjectEnum();
+-		int		  Id(); 
+-		int		  MyRank();
+-		/*}}}*/
+-		/*Update virtual functions definitions: {{{*/
+-		void  InputUpdateFromConstant(bool constant, int name);
+-		void  InputUpdateFromConstant(IssmDouble constant, int name);
+-		void  InputUpdateFromConstant(int constant, int name);
+-		void  InputUpdateFromSolution(IssmDouble* solutiong);
+-		void  InputUpdateFromVector(bool* vector, int name, int type);
+-		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVector(int* vector, int name, int type);
+-		#ifdef _HAVE_DAKOTA_
+-		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
+-		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
+-		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nows, int ncols, int name, int type);
+-		#endif
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel);
+-		/*}}}*/
+-		/*Element virtual functions definitions: {{{*/
+-		void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
+-		void   BasalFrictionCreateInput(void);
+-		void   ComputeBasalStress(Vector* sigma_b);
+-		void   ComputeStrainRate(Vector* eps);
+-		void   ComputeStressTensor();
+-		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+-		void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+-		void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
+-		void   CreatePVector(Vector* pf);
+-		void   CreateJacobianMatrix(Matrix* Jff);
+-		void   Delta18oParameterization(void);
+-		void   DeleteResults(void);
+-		int    GetNodeIndex(Node* node);
+-		void   GetSolutionFromInputs(Vector* solution);
+-		IssmDouble GetZcoord(GaussPenta* gauss);
+-		void   GetVectorFromInputs(Vector* vector,int name_enum);
+-		void   GetVectorFromResults(Vector* vector,int offset,int name_enum,int interp);
+-		
+-		int    Sid();
+-		void   InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max);
+-		bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums);
+-		void   InputCreate(IssmDouble scalar,int name,int code);
+-		void   InputCreate(IssmDouble* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code);
+-		void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum=MeshElementsEnum);
+-		void   InputDuplicate(int original_enum,int new_enum);
+-		void   InputScale(int enum_type,IssmDouble scale_factor);
+-		
+-		void   InputToResult(int enum_type,int step,IssmDouble time);
+-		void   MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding);
+-		void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
+-		void   RequestedOutput(int output_enum,int step,IssmDouble time);
+-		void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results);
+-		void   PatchFill(int* pcount, Patch* patch);
+-		void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
+-		void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm);
+-		void   ProcessResultsUnits(void);
+-		void   ResetCoordinateSystem(void);
+-		void   SmbGradients();
+-		IssmDouble SurfaceArea(void);
+-		void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
+-		int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
+-		int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
+-		IssmDouble TimeAdapt();
+-		int*   GetHorizontalNeighboorSids(void);
+-		void   ViscousHeatingCreateInput(void);
+-		void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
+-
+-		 #ifdef _HAVE_RESPONSES_
+-		IssmDouble IceVolume(void);
+-		IssmDouble TotalSmb(void);
+-		void   MinVel(IssmDouble* pminvel, bool process_units);
+-		void   MinVx(IssmDouble* pminvx, bool process_units);
+-		void   MinVy(IssmDouble* pminvy, bool process_units);
+-		void   MinVz(IssmDouble* pminvz, bool process_units);
+-		IssmDouble MassFlux(IssmDouble* segment,bool process_units);
+-		void   MaxAbsVx(IssmDouble* pmaxabsvx, bool process_units);
+-		void   MaxAbsVy(IssmDouble* pmaxabsvy, bool process_units);
+-		void   MaxAbsVz(IssmDouble* pmaxabsvz, bool process_units);
+-		void   MaxVel(IssmDouble* pmaxvel, bool process_units);
+-		void   ElementResponse(IssmDouble* presponse,int response_enum,bool process_units);
+-		void   MaxVx(IssmDouble* pmaxvx, bool process_units);
+-		void   MaxVy(IssmDouble* pmaxvy, bool process_units);
+-		void   MaxVz(IssmDouble* pmaxvz, bool process_units);
+-		#endif
+-
+-		#ifdef _HAVE_CONTROL_
+-		IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index);
+-		void   GradientIndexing(int* indexing,int control_index);
+-		void   Gradj(Vector* gradient,int control_type,int control_index);
+-		void   GradjDragMacAyeal(Vector* gradient,int control_index);
+-		void   GradjDragPattyn(Vector* gradient,int control_index);
+-		void   GradjDragStokes(Vector* gradient,int control_index);
+-		void   GradjBbarMacAyeal(Vector* gradient,int control_index);
+-		void   GradjBbarPattyn(Vector* gradient,int control_index);
+-		void   GradjBbarStokes(Vector* gradient,int control_index);
+-		void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
+-		void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
+-		void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index);
+-		void   ControlInputScaleGradient(int enum_type,IssmDouble scale);
+-		void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
+-		IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index);
+-		IssmDouble ThicknessAbsMisfit(     bool process_units,int weight_index);
+-		IssmDouble SurfaceAbsVelMisfit(    bool process_units,int weight_index);
+-		IssmDouble SurfaceRelVelMisfit(    bool process_units,int weight_index);
+-		IssmDouble SurfaceLogVelMisfit(    bool process_units,int weight_index);
+-		IssmDouble SurfaceLogVxVyMisfit(   bool process_units,int weight_index);
+-		IssmDouble SurfaceAverageVelMisfit(bool process_units,int weight_index);
+-		IssmDouble ThicknessAbsGradient(bool process_units,int weight_index);
+-		void   InputControlUpdate(IssmDouble scalar,bool save_parameter);
+-		#endif
+-		/*}}}*/
+-		/*Penta specific routines:{{{*/
+-		void	  BedNormal(IssmDouble* bed_normal, IssmDouble xyz_list[3][3]);
+-		ElementMatrix* CreateKMatrixPrognostic(void);
+-		ElementMatrix* CreateKMatrixSlope(void);
+-		ElementVector* CreatePVectorPrognostic(void);
+-		ElementVector* CreatePVectorSlope(void);
+-		void	  GetDofList(int** pdoflist,int approximation_enum,int setenum);
+-		void	  GetDofList1(int* doflist);
+-		void    GetSidList(int* sidlist);
+-		void    GetConnectivityList(int* connectivity);
+-		int     GetElementType(void);
+-		void    GetElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
+-		void    GetInputListOnVertices(IssmDouble* pvalue,int enumtype);
+-		void    GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue);
+-		void    GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
+-		void	  GetPhi(IssmDouble* phi, IssmDouble*  epsilon, IssmDouble viscosity);
+-		void	  GetSolutionFromInputsEnthalpy(Vector* solutiong);
+-		IssmDouble  GetStabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa);
+-		void    GetStrainRate3dPattyn(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input);
+-		void    GetStrainRate3d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input, Input* vz_input);
+-		Penta*  GetUpperElement(void);
+-		Penta*  GetLowerElement(void);
+-		Penta*  GetBasalElement(void);
+-		void	  InputExtrude(int enum_type,int object_type);
+-		void    InputUpdateFromSolutionPrognostic(IssmDouble* solutiong);
+-		void    InputUpdateFromSolutionOneDof(IssmDouble* solutiong,int enum_type);
+-		void    InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solutiong,int enum_type);
+-		bool	  IsInput(int name);
+-		bool	  IsOnSurface(void);
+-		bool	  IsOnBed(void);
+-		bool    IsFloating(void); 
+-		bool    IsNodeOnShelf(); 
+-		bool    IsNodeOnShelfFromFlags(IssmDouble* flags);
+-		bool    IsOnWater(void); 
+-		IssmDouble  MinEdgeLength(IssmDouble xyz_list[6][3]);
+-		void	  ReduceMatrixStokes(IssmDouble* Ke_reduced, IssmDouble* Ke_temp);
+-		void	  ReduceVectorStokes(IssmDouble* Pe_reduced, IssmDouble* Ke_temp, IssmDouble* Pe_temp);
+-		void	  SetClone(int* minranks);
+-		Tria*	  SpawnTria(int g0, int g1, int g2);
+-		void	  SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]);
+-
+-		#ifdef _HAVE_DIAGNOSTIC_
+-		ElementMatrix* CreateKMatrixCouplingMacAyealPattyn(void);
+-		ElementMatrix* CreateKMatrixCouplingMacAyealPattynViscous(void);
+-		ElementMatrix* CreateKMatrixCouplingMacAyealPattynFriction(void);
+-		ElementMatrix* CreateKMatrixCouplingMacAyealStokes(void);
+-		ElementMatrix* CreateKMatrixCouplingMacAyealStokesViscous(void);
+-		ElementMatrix* CreateKMatrixCouplingMacAyealStokesFriction(void);
+-		ElementMatrix* CreateKMatrixCouplingPattynStokes(void);
+-		ElementMatrix* CreateKMatrixDiagnosticHoriz(void);
+-		ElementMatrix* CreateKMatrixAdjointHoriz(void);
+-		ElementVector* CreateDVectorDiagnosticHoriz(void);
+-		ElementVector* CreateDVectorDiagnosticStokes(void);
+-		ElementMatrix* CreateKMatrixDiagnosticHutter(void);
+-		ElementMatrix* CreateKMatrixDiagnosticMacAyeal2d(void);
+-		ElementMatrix* CreateKMatrixDiagnosticMacAyeal3d(void);
+-		ElementMatrix* CreateKMatrixDiagnosticMacAyeal3dViscous(void);
+-		ElementMatrix* CreateKMatrixDiagnosticMacAyeal3dFriction(void);
+-		ElementMatrix* CreateKMatrixDiagnosticMacAyealPattyn(void);
+-		ElementMatrix* CreateKMatrixDiagnosticMacAyealStokes(void);
+-		ElementMatrix* CreateKMatrixDiagnosticPattyn(void);
+-		ElementMatrix* CreateKMatrixDiagnosticPattynViscous(void);
+-		ElementMatrix* CreateKMatrixDiagnosticPattynFriction(void);
+-		ElementMatrix* CreateKMatrixDiagnosticPattynStokes(void);
+-		ElementMatrix* CreateKMatrixDiagnosticStokes(void);
+-		ElementMatrix* CreateKMatrixDiagnosticStokesViscous(void);
+-		ElementMatrix* CreateKMatrixDiagnosticStokesFriction(void);
+-		ElementMatrix* CreateKMatrixDiagnosticVert(void);
+-		ElementMatrix* CreateKMatrixDiagnosticVertVolume(void);
+-		ElementMatrix* CreateKMatrixDiagnosticVertSurface(void);
+-		ElementMatrix* CreateJacobianDiagnosticHoriz(void);
+-		ElementMatrix* CreateJacobianDiagnosticMacayeal2d(void);
+-		ElementMatrix* CreateJacobianDiagnosticPattyn(void);
+-		ElementMatrix* CreateJacobianDiagnosticStokes(void);
+-		void           InputUpdateFromSolutionDiagnosticHoriz( IssmDouble* solutiong);
+-		void           InputUpdateFromSolutionDiagnosticMacAyeal( IssmDouble* solutiong);
+-		void           InputUpdateFromSolutionDiagnosticMacAyealPattyn( IssmDouble* solutiong);
+-		void           InputUpdateFromSolutionDiagnosticMacAyealStokes( IssmDouble* solutiong);
+-		void           InputUpdateFromSolutionDiagnosticPattyn( IssmDouble* solutiong);
+-		void           InputUpdateFromSolutionDiagnosticPattynStokes( IssmDouble* solutiong);
+-		void           InputUpdateFromSolutionDiagnosticHutter( IssmDouble* solutiong);
+-		void           InputUpdateFromSolutionDiagnosticVert( IssmDouble* solutiong);
+-		void           InputUpdateFromSolutionDiagnosticStokes( IssmDouble* solutiong);
+-		void	         GetSolutionFromInputsDiagnosticHoriz(Vector* solutiong);
+-		void	         GetSolutionFromInputsDiagnosticHutter(Vector* solutiong);
+-		void	         GetSolutionFromInputsDiagnosticStokes(Vector* solutiong);
+-		void	         GetSolutionFromInputsDiagnosticVert(Vector* solutiong);
+-		ElementVector* CreatePVectorCouplingMacAyealStokes(void);
+-		ElementVector* CreatePVectorCouplingMacAyealStokesViscous(void);
+-		ElementVector* CreatePVectorCouplingMacAyealStokesFriction(void);
+-		ElementVector* CreatePVectorCouplingPattynStokes(void);
+-		ElementVector* CreatePVectorCouplingPattynStokesViscous(void);
+-		ElementVector* CreatePVectorCouplingPattynStokesFriction(void);
+-		ElementVector* CreatePVectorDiagnosticHoriz(void);
+-		ElementVector* CreatePVectorDiagnosticHutter(void);
+-		ElementVector* CreatePVectorDiagnosticMacAyeal(void);
+-		ElementVector* CreatePVectorDiagnosticMacAyealPattyn(void);
+-		ElementVector* CreatePVectorDiagnosticMacAyealStokes(void);
+-		ElementVector* CreatePVectorDiagnosticPattyn(void);
+-		ElementVector* CreatePVectorDiagnosticPattynStokes(void);
+-		ElementVector* CreatePVectorDiagnosticStokes(void);
+-		ElementVector* CreatePVectorDiagnosticStokesViscous(void);
+-		ElementVector* CreatePVectorDiagnosticStokesShelf(void);
+-		ElementVector* CreatePVectorDiagnosticVert(void);
+-		ElementVector* CreatePVectorDiagnosticVertVolume(void);
+-		ElementVector* CreatePVectorDiagnosticVertBase(void);
+-		#endif
+-
+-		#ifdef _HAVE_CONTROL_
+-		ElementVector* CreatePVectorAdjointHoriz(void);
+-		ElementMatrix* CreateKMatrixAdjointMacAyeal2d(void);
+-		ElementMatrix* CreateKMatrixAdjointPattyn(void);
+-		ElementMatrix* CreateKMatrixAdjointStokes(void);
+-		ElementVector* CreatePVectorAdjointMacAyeal(void);
+-		ElementVector* CreatePVectorAdjointPattyn(void);
+-		ElementVector* CreatePVectorAdjointStokes(void);
+-		void    InputUpdateFromSolutionAdjointHoriz( IssmDouble* solutiong);
+-		void    InputUpdateFromSolutionAdjointStokes( IssmDouble* solutiong);
+-		#endif
+-
+-		#ifdef _HAVE_HYDROLOGY_
+-		void    CreateHydrologyWaterVelocityInput(void);
+-		#endif
+-		#ifdef _HAVE_THERMAL_
+-		ElementMatrix* CreateKMatrixEnthalpy(void);
+-		ElementMatrix* CreateKMatrixEnthalpyVolume(void);
+-		ElementMatrix* CreateKMatrixEnthalpyShelf(void);
+-		ElementMatrix* CreateKMatrixThermal(void);
+-		ElementMatrix* CreateKMatrixMelting(void);
+-		ElementMatrix* CreateKMatrixThermalVolume(void);
+-		ElementMatrix* CreateKMatrixThermalShelf(void);
+-		ElementVector* CreatePVectorEnthalpy(void);
+-		ElementVector* CreatePVectorEnthalpyVolume(void);
+-		ElementVector* CreatePVectorEnthalpyShelf(void);
+-		ElementVector* CreatePVectorEnthalpySheet(void);
+-		ElementVector* CreatePVectorMelting(void);
+-		ElementVector* CreatePVectorThermal(void);
+-		ElementVector* CreatePVectorThermalVolume(void);
+-		ElementVector* CreatePVectorThermalShelf(void);
+-		ElementVector* CreatePVectorThermalSheet(void);
+-		void	       GetSolutionFromInputsThermal(Vector* solutiong);
+-		void           InputUpdateFromSolutionThermal( IssmDouble* solutiong);
+-		void           InputUpdateFromSolutionEnthalpy( IssmDouble* solutiong);
+-		#endif
+-		#ifdef _HAVE_BALANCED_
+-		ElementMatrix* CreateKMatrixBalancethickness(void);
+-		ElementVector* CreatePVectorBalancethickness(void);
+-		#endif
+-		/*}}}*/
+-};
+-#endif  /* _PENTA_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaRef.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaRef.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/TriaRef.cpp	(revision 12822)
+@@ -1,503 +0,0 @@
+-/*!\file TriaRef.c
+- * \brief: implementation of the TriaRef object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Element macros*/
+-#define NUMNODES 3
+-
+-/*Object constructors and destructor*/
+-/*FUNCTION TriaRef::TriaRef(){{{*/
+-TriaRef::TriaRef(){
+-	this->element_type_list=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::TriaRef(int* types,int nummodels){{{*/
+-
+-TriaRef::TriaRef(const int nummodels){
+-
+-	/*Only allocate pointer*/
+-	element_type_list=xNew<int>(nummodels);
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::~TriaRef(){{{*/
+-TriaRef::~TriaRef(){
+-	xDelete<int>(element_type_list);
+-}
+-/*}}}*/
+-
+-/*Management*/
+-/*FUNCTION TriaRef::SetElementType{{{*/
+-void TriaRef::SetElementType(int type,int type_counter){
+-
+-	_assert_(type==P1Enum || type==P1DGEnum);
+-
+-	/*initialize element type*/
+-	this->element_type_list[type_counter]=type;
+-}
+-/*}}}*/
+-
+-/*Reference Element numerics*/
+-/*FUNCTION TriaRef::GetBMacAyeal {{{*/
+-void TriaRef::GetBMacAyeal(IssmDouble* B, IssmDouble* xyz_list, GaussTria* gauss){
+-	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 
+-	 * For node i, Bi can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi=[ dh/dx           0    ]
+-	 *          [   0           dh/dy  ]
+-	 *          [ 1/2*dh/dy  1/2*dh/dx ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B has been allocated already, of size: 3x(NDOF2*NUMNODES)
+-	 */
+-
+-	int i;
+-	IssmDouble dbasis[NDOF2][NUMNODES];
+-
+-	/*Get dh1dh2dh3 in actual coordinate system: */
+-	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list,gauss);
+-
+-	/*Build B: */
+-	for (i=0;i<NUMNODES;i++){
+-		*(B+NDOF2*NUMNODES*0+NDOF2*i)=dbasis[0][i]; //B[0][NDOF2*i]=dbasis[0][i];
+-		*(B+NDOF2*NUMNODES*0+NDOF2*i+1)=0;
+-		*(B+NDOF2*NUMNODES*1+NDOF2*i)=0;
+-		*(B+NDOF2*NUMNODES*1+NDOF2*i+1)=dbasis[1][i];
+-		*(B+NDOF2*NUMNODES*2+NDOF2*i)=(float).5*dbasis[1][i]; 
+-		*(B+NDOF2*NUMNODES*2+NDOF2*i+1)=(float).5*dbasis[0][i]; 
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetBMacAyealStokes {{{*/
+-void TriaRef::GetBMacAyealStokes(IssmDouble* B, IssmDouble* xyz_list, GaussTria* gauss){
+-
+-	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 
+-	 * For node i, Bi can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi=[   dh/dx         0     ]
+-	 *          [       0       dh/dy   ]
+-	 *          [  1/2*dh/dy  1/2*dh/dx ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B has been allocated already, of size: 3x(NDOF2*NUMNODES)
+-	 */
+-
+-	/*Same thing in the actual coordinate system: */
+-	IssmDouble dbasis[NDOF2][NUMNODES];
+-
+-	/*Get dh1dh2dh3 in actual coordinates system : */
+-	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list,gauss);
+-
+-	/*Build B': */
+-	for (int i=0;i<NUMNODES;i++){
+-		*(B+NDOF2*NUMNODES*0+NDOF2*i)=dbasis[0][i]; 
+-		*(B+NDOF2*NUMNODES*0+NDOF2*i+1)=0; 
+-		*(B+NDOF2*NUMNODES*1+NDOF2*i)=0; 
+-		*(B+NDOF2*NUMNODES*1+NDOF2*i+1)=dbasis[1][i]; 
+-		*(B+NDOF2*NUMNODES*2+NDOF2*i)=0.5*dbasis[1][i]; 
+-		*(B+NDOF2*NUMNODES*2+NDOF2*i+1)=0.5*dbasis[0][i]; 
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetSegmentBFlux{{{*/
+-void TriaRef::GetSegmentBFlux(IssmDouble* B,GaussTria* gauss, int index1,int index2){
+-	/*Compute B  matrix. B=[phi1 phi2 -phi3 -phi4]
+-	 *
+-	 * and phi1=phi3 phi2=phi4
+-	 *
+-	 * We assume B has been allocated already, of size: 1x4
+-	 */
+-
+-	IssmDouble l1l3[NUMNODES];
+-
+-	GetNodalFunctions(&l1l3[0],gauss);
+-
+-	B[0] = +l1l3[index1];
+-	B[1] = +l1l3[index2];
+-	B[2] = -l1l3[index1];
+-	B[3] = -l1l3[index2];
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetSegmentBprimeFlux{{{*/
+-void TriaRef::GetSegmentBprimeFlux(IssmDouble* Bprime,GaussTria* gauss, int index1,int index2){
+-	/*Compute Bprime  matrix. Bprime=[phi1 phi2 phi3 phi4]
+-	 *
+-	 * and phi1=phi3 phi2=phi4
+-	 *
+-	 * We assume Bprime has been allocated already, of size: 1x4
+-	 */
+-
+-	IssmDouble l1l3[NUMNODES];
+-
+-	GetNodalFunctions(&l1l3[0],gauss);
+-
+-	Bprime[0] = l1l3[index1];
+-	Bprime[1] = l1l3[index2];
+-	Bprime[2] = l1l3[index1];
+-	Bprime[3] = l1l3[index2];
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetBPrognostic{{{*/
+-void TriaRef::GetBPrognostic(IssmDouble* B_prog, IssmDouble* xyz_list, GaussTria* gauss){
+-	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 
+-	 * For node i, Bi can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi=[ h ]
+-	 *          [ h ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B_prog has been allocated already, of size: 2x(NDOF1*NUMNODES)
+-	 */
+-
+-	IssmDouble basis[NUMNODES];
+-
+-	/*Get dh1dh2dh3 in actual coordinate system: */
+-	GetNodalFunctions(&basis[0],gauss);
+-
+-	/*Build B_prog: */
+-	for (int i=0;i<NUMNODES;i++){
+-		*(B_prog+NDOF1*NUMNODES*0+NDOF1*i)=basis[i];
+-		*(B_prog+NDOF1*NUMNODES*1+NDOF1*i)=basis[i];
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetBprimeMacAyeal {{{*/
+-void TriaRef::GetBprimeMacAyeal(IssmDouble* Bprime, IssmDouble* xyz_list, GaussTria* gauss){
+-
+-	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 
+-	 * For node i, Bi' can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi_prime=[ 2*dh/dx    dh/dy ]
+-	 *                [   dh/dx  2*dh/dy ]
+-	 *                [   dh/dy    dh/dx ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B' has been allocated already, of size: 3x(NDOF2*NUMNODES)
+-	 */
+-
+-	/*Same thing in the actual coordinate system: */
+-	IssmDouble dbasis[NDOF2][NUMNODES];
+-
+-	/*Get dh1dh2dh3 in actual coordinates system : */
+-	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list,gauss);
+-
+-	/*Build B': */
+-	for (int i=0;i<NUMNODES;i++){
+-		*(Bprime+NDOF2*NUMNODES*0+NDOF2*i)=2*dbasis[0][i]; 
+-		*(Bprime+NDOF2*NUMNODES*0+NDOF2*i+1)=dbasis[1][i]; 
+-		*(Bprime+NDOF2*NUMNODES*1+NDOF2*i)=dbasis[0][i]; 
+-		*(Bprime+NDOF2*NUMNODES*1+NDOF2*i+1)=2*dbasis[1][i]; 
+-		*(Bprime+NDOF2*NUMNODES*2+NDOF2*i)=dbasis[1][i]; 
+-		*(Bprime+NDOF2*NUMNODES*2+NDOF2*i+1)=dbasis[0][i]; 
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetBprimeMacAyealStokes {{{*/
+-void TriaRef::GetBprimeMacAyealStokes(IssmDouble* Bprime, IssmDouble* xyz_list, GaussTria* gauss){
+-
+-	/*Compute Bprime  matrix. Bprime=[Bprime1 Bprime2 Bprime3] where Bprimei is of size 3*NDOF2. 
+-	 * For node i, Bprimei can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bprimei=[  dh/dx    0   ]
+-	 *               [    0    dh/dy ]
+-	 *               [  dh/dy  dh/dx ]
+-	 *               [  dh/dx  dh/dy ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume Bprime has been allocated already, of size: 3x(NDOF2*NUMNODES)
+-	 */
+-
+-	/*Same thing in the actual coordinate system: */
+-	IssmDouble dbasis[NDOF2][NUMNODES];
+-
+-	/*Get dh1dh2dh3 in actual coordinates system : */
+-	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list,gauss);
+-
+-	/*Build Bprime: */
+-	for (int i=0;i<NUMNODES;i++){
+-		*(Bprime+NDOF2*NUMNODES*0+NDOF2*i)=dbasis[0][i]; 
+-		*(Bprime+NDOF2*NUMNODES*0+NDOF2*i+1)=0; 
+-		*(Bprime+NDOF2*NUMNODES*1+NDOF2*i)=0; 
+-		*(Bprime+NDOF2*NUMNODES*1+NDOF2*i+1)=dbasis[1][i]; 
+-		*(Bprime+NDOF2*NUMNODES*2+NDOF2*i)=dbasis[1][i]; 
+-		*(Bprime+NDOF2*NUMNODES*2+NDOF2*i+1)=dbasis[0][i]; 
+-		*(Bprime+NDOF2*NUMNODES*3+NDOF2*i)=dbasis[0][i]; 
+-		*(Bprime+NDOF2*NUMNODES*3+NDOF2*i+1)=dbasis[1][i]; 
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetBprimePrognostic{{{*/
+-void TriaRef::GetBprimePrognostic(IssmDouble* Bprime_prog, IssmDouble* xyz_list, GaussTria* gauss){
+-	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 
+-	 * For node i, Bi' can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       Bi_prime=[ dh/dx ]
+-	 *                [ dh/dy ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume B' has been allocated already, of size: 3x(NDOF2*NUMNODES)
+-	 */
+-
+-	/*Same thing in the actual coordinate system: */
+-	IssmDouble dbasis[NDOF2][NUMNODES];
+-
+-	/*Get dh1dh2dh3 in actual coordinates system : */
+-	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list,gauss);
+-
+-	/*Build B': */
+-	for (int i=0;i<NUMNODES;i++){
+-		*(Bprime_prog+NDOF1*NUMNODES*0+NDOF1*i)=dbasis[0][i]; 
+-		*(Bprime_prog+NDOF1*NUMNODES*1+NDOF1*i)=dbasis[1][i]; 
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetL{{{*/
+-void TriaRef::GetL(IssmDouble* L, IssmDouble* xyz_list,GaussTria* gauss,int numdof){
+-	/*Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
+-	 * For node i, Li can be expressed in the actual coordinate system
+-	 * by: 
+-	 *       numdof=1: 
+-	 *                 Li=h;
+-	 *       numdof=2:
+-	 *                 Li=[ h   0 ]
+-	 *                    [ 0   h ]
+-	 * where h is the interpolation function for node i.
+-	 *
+-	 * We assume L has been allocated already, of size: NUMNODES (numdof=1), or numdofx(numdof*NUMNODES) (numdof=2)
+-	 */
+-
+-	int i;
+-	IssmDouble basis[3];
+-
+-	/*Get basis in actual coordinate system: */
+-	GetNodalFunctions(basis,gauss);
+-
+-	/*Build L: */
+-	if(numdof==1){
+-		for (i=0;i<NUMNODES;i++){
+-			L[i]=basis[i]; 
+-		}
+-	}
+-	else{
+-		for (i=0;i<NUMNODES;i++){
+-			*(L+numdof*NUMNODES*0+numdof*i)=basis[i]; //L[0][NDOF2*i]=dbasis[0][i];
+-			*(L+numdof*NUMNODES*0+numdof*i+1)=0;
+-			*(L+numdof*NUMNODES*1+numdof*i)=0;
+-			*(L+numdof*NUMNODES*1+numdof*i+1)=basis[i];
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetJacobian{{{*/
+-void TriaRef::GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussTria* gauss){
+-	/*The Jacobian is constant over the element, discard the gaussian points. 
+-	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
+-	IssmDouble x1,y1,x2,y2,x3,y3;
+-
+-	x1=*(xyz_list+NUMNODES*0+0);
+-	y1=*(xyz_list+NUMNODES*0+1);
+-	x2=*(xyz_list+NUMNODES*1+0);
+-	y2=*(xyz_list+NUMNODES*1+1);
+-	x3=*(xyz_list+NUMNODES*2+0);
+-	y3=*(xyz_list+NUMNODES*2+1);
+-
+-
+-	*(J+NDOF2*0+0)=0.5*(x2-x1);
+-	*(J+NDOF2*1+0)=SQRT3/6.0*(2*x3-x1-x2);
+-	*(J+NDOF2*0+1)=0.5*(y2-y1);
+-	*(J+NDOF2*1+1)=SQRT3/6.0*(2*y3-y1-y2);
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetSegmentJacobianDeterminant{{{*/
+-void TriaRef::GetSegmentJacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,GaussTria* gauss){
+-	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+-	 * J is assumed to have been allocated*/
+-	IssmDouble x1,y1,x2,y2;
+-
+-	x1=*(xyz_list+3*0+0);
+-	y1=*(xyz_list+3*0+1);
+-	x2=*(xyz_list+3*1+0);
+-	y2=*(xyz_list+3*1+1);
+-
+-	*Jdet=1.0/2.0*sqrt(pow(x2-x1,2.) + pow(y2-y1,2.));
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetJacobianDeterminant2d{{{*/
+-void TriaRef::GetJacobianDeterminant2d(IssmDouble* Jdet, IssmDouble* xyz_list,GaussTria* gauss){
+-	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+-	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
+-	IssmDouble J[2][2];
+-
+-	/*Get Jacobian*/
+-	GetJacobian(&J[0][0],xyz_list,gauss);
+-
+-	/*Get Determinant*/
+-	Matrix2x2Determinant(Jdet,&J[0][0]);
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetJacobianDeterminant3d {{{*/
+-void TriaRef::GetJacobianDeterminant3d(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussTria* gauss){
+-	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+-	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
+-
+-	IssmDouble x1,x2,x3,y1,y2,y3,z1,z2,z3;
+-
+-	x1=*(xyz_list+3*0+0);
+-	y1=*(xyz_list+3*0+1);
+-	z1=*(xyz_list+3*0+2);
+-	x2=*(xyz_list+3*1+0);
+-	y2=*(xyz_list+3*1+1);
+-	z2=*(xyz_list+3*1+2);
+-	x3=*(xyz_list+3*2+0);
+-	y3=*(xyz_list+3*2+1);
+-	z3=*(xyz_list+3*2+2);
+-
+-	*Jdet=SQRT3/6.0*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2.0)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2.0)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2.0),0.5);
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetJacobianInvert{{{*/
+-void TriaRef::GetJacobianInvert(IssmDouble*  Jinv, IssmDouble* xyz_list,GaussTria* gauss){
+-
+-	/*Jacobian*/
+-	IssmDouble J[2][2];
+-
+-	/*Call Jacobian routine to get the jacobian:*/
+-	GetJacobian(&J[0][0], xyz_list, gauss);
+-
+-	/*Invert Jacobian matrix: */
+-	Matrix2x2Invert(Jinv,&J[0][0]);
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetNodalFunctions{{{*/
+-void TriaRef::GetNodalFunctions(IssmDouble* basis,GaussTria* gauss){
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-
+-	basis[0]=gauss->coord1;
+-	basis[1]=gauss->coord2;
+-	basis[2]=gauss->coord3;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetSegmentNodalFunctions{{{*/
+-void TriaRef::GetSegmentNodalFunctions(IssmDouble* basis,GaussTria* gauss,int index1,int index2){
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-
+-	IssmDouble BasisFunctions[3];
+-
+-	GetNodalFunctions(&BasisFunctions[0],gauss);
+-
+-	_assert_(index1>=0 && index1<3);
+-	_assert_(index2>=0 && index2<3);
+-	basis[0]=BasisFunctions[index1];
+-	basis[1]=BasisFunctions[index2];
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetNodalFunctionsDerivatives{{{*/
+-void TriaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTria* gauss){
+-
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * actual coordinate system): */
+-	int       i;
+-	IssmDouble    dbasis_ref[NDOF2][NUMNODES];
+-	IssmDouble    Jinv[NDOF2][NDOF2];
+-
+-	/*Get derivative values with respect to parametric coordinate system: */
+-	GetNodalFunctionsDerivativesReference(&dbasis_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]
+-	 */
+-	for (i=0;i<NUMNODES;i++){
+-		dbasis[NUMNODES*0+i]=Jinv[0][0]*dbasis_ref[0][i]+Jinv[0][1]*dbasis_ref[1][i];
+-		dbasis[NUMNODES*1+i]=Jinv[1][0]*dbasis_ref[0][i]+Jinv[1][1]*dbasis_ref[1][i];
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetNodalFunctionsDerivativesReference{{{*/
+-void TriaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dl1dl3,GaussTria* gauss){
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * natural coordinate system) at the gaussian point. */
+-
+-	/*First nodal function: */
+-	*(dl1dl3+NUMNODES*0+0)=-0.5; 
+-	*(dl1dl3+NUMNODES*1+0)=-1.0/(2.0*SQRT3);
+-
+-	/*Second nodal function: */
+-	*(dl1dl3+NUMNODES*0+1)=0.5;
+-	*(dl1dl3+NUMNODES*1+1)=-1.0/(2.0*SQRT3);
+-
+-	/*Third nodal function: */
+-	*(dl1dl3+NUMNODES*0+2)=0;
+-	*(dl1dl3+NUMNODES*1+2)=1.0/SQRT3;
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetInputDerivativeValue{{{*/
+-void TriaRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss){
+-
+-	/*From node values of parameter p (plist[0],plist[1],plist[2]), return parameter derivative value at gaussian 
+-	 * point specified by gauss_basis:
+-	 *   dp/dx=plist[0]*dh1/dx+plist[1]*dh2/dx+plist[2]*dh3/dx
+-	 *   dp/dx=plist[0]*dh1/dx+plist[1]*dh2/dx+plist[2]*dh3/dx
+-	 *
+-	 * p is a vector of size 2x1 already allocated.
+-	 */
+-
+-	/*Nodal Derivatives*/
+-	IssmDouble dbasis[2][3]; //nodal derivative functions in actual coordinate system.
+-
+-	/*Get dh1dh2dh3 in actual coordinate system: */
+-	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list, gauss);
+-
+-	/*Assign values*/
+-	*(p+0)=plist[0]*dbasis[0][0]+plist[1]*dbasis[0][1]+plist[2]*dbasis[0][2];
+-	*(p+1)=plist[0]*dbasis[1][0]+plist[1]*dbasis[1][1]+plist[2]*dbasis[1][2];
+-
+-}
+-/*}}}*/
+-/*FUNCTION TriaRef::GetInputValue{{{*/
+-void TriaRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTria* gauss){
+-
+-	/*From node values of parameter p (plist[0],plist[1],plist[2]), return parameter value at gaussian 
+-	 * point specifie by gauss: */
+-
+-	/*nodal functions annd output: */
+-	IssmDouble basis[3];
+-
+-	/*Get nodal functions*/
+-	GetNodalFunctions(basis, gauss);
+-
+-	/*Get parameter*/
+-	*p=basis[0]*plist[0]+basis[1]*plist[1]+basis[2]*plist[2];
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaHook.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaHook.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/PentaHook.h	(revision 12822)
+@@ -1,33 +0,0 @@
+-/*!\file: PentaHook.h
+- * \brief prototypes for PentaHook.h
+- */ 
+-
+-#ifndef _PENTAHOOK_H_
+-#define  _PENTAHOOK_H_
+-
+-class Hook;
+-class TriaHook;
+-class IoModel;
+-
+-class PentaHook{
+-
+-	public: 
+-		int   numanalyses; //number of analysis types
+-		Hook** hnodes; // 6 nodes for each analysis type
+-		Hook*  hmatice; // 1 ice material
+-		Hook*  hmatpar; // 1 material parameter
+-		Hook*  hneighbors; // 2 elements, first down, second up
+-
+-		/*FUNCTION constructors, destructors {{{*/
+-		PentaHook();
+-		PentaHook(int in_numanalyses,int matice_id, IoModel* iomodel);
+-		~PentaHook();
+-		void SetHookNodes(int* node_ids,int analysis_counter);
+-		void SpawnTriaHook(TriaHook* triahook,int* indices);
+-		void InitHookNeighbors(int* element_ids);
+-		/*}}}*/
+-};
+-
+-
+-#endif //ifndef _PENTAHOOK_H_
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/IoModel.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/IoModel.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/IoModel.h	(revision 12822)
+@@ -1,67 +0,0 @@
+-/* \file IoModel.h
+- * \brief  Header file defining the IoModel structure that will help in processing the input data coming 
+- * into ISSM, from Matlab, or through a binary file opened for reading.
+- * \sa IoModel.cpp
+- */
+-
+-#ifndef _IOMODEL_H
+-#define _IOMODEL_H
+-
+-#include "../include/include.h"
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-
+-class Elements;
+-class Param;
+-class Option;
+-
+-class IoModel {
+-
+-	private: 
+-		IssmDouble **data;        //this dataset holds temporary data, memory intensive.
+-		Parameters  *constants;   //this dataset holds all IssmDouble, int, bool and char *parameters read in from the input file.*
+-
+-	public:
+-		/*This data needs to stay memory resident at all time, even if it's memory intensive: */
+-		FILE *fid;         //pointer to input file
+-		bool *my_elements;
+-		bool *my_nodes;
+-		int  *my_vertices;
+-		int  *singlenodetoelementconnectivity;
+-		int  *numbernodetoelementconnectivity;
+-
+-		/*Data to synchronize through low level object drivers: */
+-		int nodecounter;         //keep track of how many nodes are being created in each analysis type
+-		int loadcounter;         //keep track of how many loads are being created in each analysis type
+-		int constraintcounter;   //keep track of how many constraints are being created in each analysis type
+-
+-		/*Methods*/
+-		~IoModel();
+-		IoModel();
+-		IoModel(FILE* iomodel_handle);
+-
+-		/*Input/Output*/
+-		void        CheckEnumSync(void);
+-		void        Constant(bool *poutput,int constant_enum);
+-		void        Constant(int *poutput,int constant_enum);
+-		void        Constant(IssmDouble *poutput,int constant_enum);
+-		void        Constant(char **poutput,int constant_enum);
+-		Param      *CopyConstantObject(int constant_enum);
+-		IssmDouble *Data(int dataenum);
+-		void        DeleteData(int num,...);
+-		void        FetchConstants(void);
+-		void        FetchData(bool* pboolean,int data_enum);
+-		void        FetchData(int* pinteger,int data_enum);
+-		void        FetchData(IssmDouble* pscalar,int data_enum);
+-		void        FetchData(char** pstring,int data_enum);
+-		void        FetchData(int** pmatrix,int* pM,int* pN,int data_enum);
+-		void        FetchData(IssmDouble**  pscalarmatrix,int* pM,int* pN,int data_enum);
+-		void        FetchData(char***   pstringarray,int* pnumstrings,int data_enum);
+-		void        FetchData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum);
+-		void        FetchData(Option **poption,int data_enum);
+-		void        FetchData(int num,...);
+-		void        FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,IssmDouble default_value=0);
+-		void        LastIndex(int *pindex);
+-		FILE*       SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);
+-};
+-
+-#endif  /* _IOMODEL_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/OptPars.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/OptPars.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/OptPars.h	(revision 12822)
+@@ -1,17 +0,0 @@
+-/*!\file:  OptPars.h
+- * \brief place holder for optimization parameters
+- */ 
+-
+-#ifndef _OPTPARS_H_
+-#define _OPTPARS_H_
+-
+-struct OptPars{
+-
+-	IssmDouble xmin;
+-	IssmDouble xmax;
+-	IssmDouble cm_jump;
+-	int maxiter;
+-
+-};
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussPenta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussPenta.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussPenta.h	(revision 12822)
+@@ -1,51 +0,0 @@
+-/*!\file GaussPenta.h
+- * \brief: header file for node object
+- */
+-
+-#ifndef _GAUSSPENTA_H_
+-#define _GAUSSPENTA_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./../../shared/shared.h"
+-class GaussTria;
+-/*}}}*/
+-
+-class GaussPenta{
+-
+-	private:
+-		int numgauss;
+-		double* weights;
+-		double* coords1;
+-		double* coords2;
+-		double* coords3;
+-		double* coords4;
+-
+-	public:
+-		double weight;
+-		double coord1;
+-		double coord2;
+-		double coord3;
+-		double coord4;
+-		
+-	public:
+-
+-		/*GaussPenta constructors, destructors*/
+-		GaussPenta();
+-		GaussPenta(int order_horiz,int order_vert);
+-		GaussPenta(int index1, int index2,int order);
+-		GaussPenta(int index1, int index2, int index3, int order);
+-		GaussPenta(int index1, int index2, int index3, int index4,int order_horiz,int order_vert);
+-		~GaussPenta();
+-
+-		/*Methods*/
+-		int  begin(void);
+-		int  end(void);
+-		void Echo(void);
+-		void GaussPoint(int ig);
+-		void GaussVertex(int iv);
+-		void GaussFaceTria(int index1, int index2, int index3, int order);
+-		void GaussCenter(void);
+-		void SynchronizeGaussTria(GaussTria* gauss_tria);
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussTria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussTria.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussTria.cpp	(revision 12822)
+@@ -1,278 +0,0 @@
+-/*!\file GaussTria.c
+- * \brief: implementation of the GaussTria object
+- */
+-
+-/*Include files: {{{*/
+-#include "./../objects.h"
+-/*}}}*/
+-
+-/*GaussTria constructors and destructors:*/
+-/*FUNCTION GaussTria::GaussTria() {{{*/
+-GaussTria::GaussTria(){
+-
+-	numgauss=-1;
+-
+-	weights=NULL;
+-	coords1=NULL;
+-	coords2=NULL;
+-	coords3=NULL;
+-
+-	weight=UNDEF;
+-	coord1=UNDEF;
+-	coord2=UNDEF;
+-	coord3=UNDEF;
+-}
+-/*}}}*/
+-/*FUNCTION GaussTria::GaussTria(int order) {{{*/
+-GaussTria::GaussTria(int order){
+-
+-	/*Get gauss points*/
+-	GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order);
+-
+-	/*Initialize static fields as undefinite*/
+-	weight=UNDEF;
+-	coord1=UNDEF;
+-	coord2=UNDEF;
+-	coord3=UNDEF;
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussTria::GaussTria(int index1,int index2,int order) {{{*/
+-GaussTria::GaussTria(int index1,int index2,int order){
+-
+-	/*Intermediaties*/
+-	IssmPDouble *seg_coords  = NULL;
+-	IssmPDouble *seg_weights = NULL;
+-	int     i,index3;
+-
+-	/*Get Segment gauss points*/
+-	numgauss=order;
+-	GaussLegendreLinear(&seg_coords,&seg_weights,numgauss);
+-
+-	/*Allocate GaussTria fields*/
+-	coords1=xNew<IssmPDouble>(numgauss);
+-	coords2=xNew<IssmPDouble>(numgauss);
+-	coords3=xNew<IssmPDouble>(numgauss);
+-	weights=xNew<IssmPDouble>(numgauss);
+-
+-	/*Reverse index1 and 2 if necessary*/
+-	if (index1>index2){
+-		index3=index1; index1=index2; index2=index3;
+-		for(i=0;i<numgauss;i++) seg_coords[i]=-seg_coords[i];
+-	}
+-
+-	/*Build Triangle Gauss point*/
+-	if (index1==0 && index2==1){
+-		for(i=0;i<numgauss;i++) coords1[i]=  0.5*(1-seg_coords[i]);
+-		for(i=0;i<numgauss;i++) coords2[i]=1-0.5*(1.-seg_coords[i]);
+-		for(i=0;i<numgauss;i++) coords3[i]=0;
+-		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+-	}
+-	else if (index1==0 && index2==2){
+-		for(i=0;i<numgauss;i++) coords1[i]=  0.5*(1-seg_coords[i]);
+-		for(i=0;i<numgauss;i++) coords2[i]= 0 ;
+-		for(i=0;i<numgauss;i++) coords3[i]=1-0.5*(1.-seg_coords[i]);
+-		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+-	}
+-	else if (index1==1 && index2==2){
+-		for(i=0;i<numgauss;i++) coords1[i]=0;
+-		for(i=0;i<numgauss;i++) coords2[i]=  0.5*(1-seg_coords[i]);
+-		for(i=0;i<numgauss;i++) coords3[i]=1-0.5*(1.-seg_coords[i]);
+-		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+-	}
+-	else
+-	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
+-
+-	/*Initialize static fields as undefined*/
+-	weight=UNDEF;
+-	coord1=UNDEF;
+-	coord2=UNDEF;
+-	coord3=UNDEF;
+-
+-	/*clean up*/
+-	xDelete<double>(seg_coords);
+-	xDelete<double>(seg_weights);
+-}
+-/*}}}*/
+-/*FUNCTION GaussTria::~GaussTria(){{{*/
+-GaussTria::~GaussTria(){
+-	xDelete<IssmPDouble>(weights);
+-	xDelete<IssmPDouble>(coords1);
+-	xDelete<IssmPDouble>(coords2);
+-	xDelete<IssmPDouble>(coords3);
+-}
+-/*}}}*/
+-
+-/*Methods*/
+-/*FUNCTION GaussTria::Echo{{{*/
+-void GaussTria::Echo(void){
+-
+-	_printLine_("GaussTria:");
+-	_printLine_("   numgauss: " << numgauss);
+-
+-	if (weights){
+-	 _printString_("   weights = ["); 
+-	 for(int i=0;i<numgauss;i++) _printLine_(" " << weights[i]);
+-	 _printLine_("]");
+-	}
+-	else _printLine_("weights = NULL");
+-	if (coords1){
+-	 _printString_("   coords1 = ["); 
+-	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords1[i]);
+-	 _printLine_("]");
+-	}
+-	else _printLine_("coords1 = NULL");
+-	if (coords2){
+-	 _printString_("   coords2 = ["); 
+-	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords2[i]);
+-	 _printLine_("]");
+-	}
+-	else _printLine_("coords2 = NULL");
+-	if (coords3){
+-	 _printString_("   coords3 = ["); 
+-	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords3[i]);
+-	 _printLine_("]");
+-	}
+-	else _printLine_("coords3 = NULL");
+-
+-	_printLine_("   weight = " << weight);
+-	_printLine_("   coord1 = " << coord1);
+-	_printLine_("   coord2 = " << coord2);
+-	_printLine_("   coord3 = " << coord3);
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussTria::GaussCenter{{{*/
+-void GaussTria::GaussCenter(void){
+-
+-	/*update static arrays*/
+-	coord1=ONETHIRD;
+-	coord2=ONETHIRD;
+-	coord3=ONETHIRD;
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussTria::GaussEdgeCenter{{{*/
+-void GaussTria::GaussEdgeCenter(int index1,int index2){
+-
+-	int     index3;
+-
+-	/*Reverse index1 and 2 if necessary*/
+-	if (index1>index2){
+-		index3=index1; index1=index2; index2=index3;
+-	}
+-
+-	/*update static arrays*/
+-	if (index1==0 && index2==1){
+-		coord1=0.5;
+-		coord2=0.5;
+-		coord3=0.0;
+-	}
+-	else if (index1==0 && index2==2){
+-		coord1=0.5;
+-		coord2=0.0;
+-		coord3=0.5;
+-	}
+-	else if (index1==1 && index2==2){
+-		coord1=0.0;
+-		coord2=0.5;
+-		coord3=0.5;
+-	}
+-	else
+-	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussTria::GaussPoint{{{*/
+-void GaussTria::GaussPoint(int ig){
+-
+-	/*Check input in debugging mode*/
+-	 _assert_(ig>=0 && ig< numgauss);
+-
+-	 /*update static arrays*/
+-	 weight=weights[ig];
+-	 coord1=coords1[ig];
+-	 coord2=coords2[ig];
+-	 coord3=coords3[ig];
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussTria::GaussFromCoords{{{*/
+-void GaussTria::GaussFromCoords(IssmPDouble x,IssmPDouble y,IssmPDouble* xyz_list){
+-
+-	/*Intermediaries*/
+-	IssmPDouble    area = 0;
+-	IssmPDouble    x1,y1,x2,y2,x3,y3;
+-
+-	/*in debugging mode: check that the default constructor has been called*/
+-	_assert_(numgauss==-1);
+-
+-	x1=*(xyz_list+3*0+0); y1=*(xyz_list+3*0+1);
+-	x2=*(xyz_list+3*1+0); y2=*(xyz_list+3*1+1);
+-	x3=*(xyz_list+3*2+0); y3=*(xyz_list+3*2+1);
+-
+-	area=(x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1)/2;
+-
+-	/*Get first area coordinate = det(x-x3  x2-x3 ; y-y3   y2-y3)/area*/
+-	coord1=((x-x3)*(y2-y3)-(x2-x3)*(y-y3))/area;
+-
+-	/*Get second area coordinate = det(x1-x3  x-x3 ; y1-y3   y-y3)/area*/
+-	coord2=((x1-x3)*(y-y3)-(x-x3)*(y1-y3))/area;
+-
+-	/*Get third  area coordinate 1-area1-area2: */
+-	coord3=1-coord1-coord2;
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussTria::GaussVertex{{{*/
+-void GaussTria::GaussVertex(int iv){
+-
+-	/*in debugging mode: check that the default constructor has been called*/
+-	_assert_(numgauss==-1);
+-
+-	/*update static arrays*/
+-	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;
+-		default:
+-			_error2_("vertex index should be in [0 2]");
+-
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussTria::begin{{{*/
+-int GaussTria::begin(void){
+-
+-	/*Check that this has been initialized*/
+-	_assert_(numgauss>0);
+-	_assert_(weights);
+-	_assert_(coords1);
+-	_assert_(coords2);
+-	_assert_(coords3);
+-
+-	/*return first gauss index*/
+-	return 0;
+-}
+-/*}}}*/
+-/*FUNCTION GaussTria::end{{{*/
+-int GaussTria::end(void){
+-
+-	/*Check that this has been initialized*/
+-	_assert_(numgauss>0);
+-	_assert_(weights);
+-	_assert_(coords1);
+-	_assert_(coords2);
+-	_assert_(coords3);
+-
+-	/*return last gauss index +1*/
+-	return numgauss;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussTria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussTria.h	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussTria.h	(revision 12822)
+@@ -1,46 +0,0 @@
+-/*!\file GaussTria.h
+- * \brief: header file for node object
+- */
+-
+-#ifndef _GAUSSTRIA_H_
+-#define _GAUSSTRIA_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-#include "./../../shared/shared.h"
+-/*}}}*/
+-
+-class GaussTria{
+-
+-	private:
+-		int numgauss;
+-		IssmPDouble* weights;
+-		IssmPDouble* coords1;
+-		IssmPDouble* coords2;
+-		IssmPDouble* coords3;
+-
+-	public:
+-		IssmPDouble weight;
+-		IssmPDouble coord1;
+-		IssmPDouble coord2;
+-		IssmPDouble coord3;
+-		
+-	public:
+-
+-		/*GaussTria constructors, destructors*/
+-		GaussTria();
+-		GaussTria(int order);
+-		GaussTria(int index1,int index2,int order);
+-		~GaussTria();
+-
+-		/*Methods*/
+-		int  begin(void);
+-		int  end(void);
+-		void Echo(void);
+-		void GaussFromCoords(IssmPDouble x1,IssmPDouble y1,IssmPDouble* xyz_list);
+-		void GaussPoint(int ig);
+-		void GaussVertex(int iv);
+-		void GaussCenter(void);
+-		void GaussEdgeCenter(int index1,int index2);
+-};
+-#endif  /* _GAUSSTRIA_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussPenta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussPenta.cpp	(revision 12821)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Gauss/GaussPenta.cpp	(revision 12822)
+@@ -1,406 +0,0 @@
+-/*!\file GaussPenta.c
+- * \brief: implementation of the GaussPenta object
+- */
+-
+-/*Include files: {{{*/
+-#include "./../objects.h"
+-/*}}}*/
+-
+-/*GaussPenta constructors and destructors:*/
+-/*FUNCTION GaussPenta::GaussPenta() {{{*/
+-GaussPenta::GaussPenta(){
+-
+-	numgauss=-1;
+-
+-	weights=NULL;
+-	coords1=NULL;
+-	coords2=NULL;
+-	coords3=NULL;
+-	coords4=NULL;
+-
+-	weight=UNDEF;
+-	coord1=UNDEF;
+-	coord2=UNDEF;
+-	coord3=UNDEF;
+-	coord4=UNDEF;
+-}
+-/*}}}*/
+-/*FUNCTION GaussPenta::GaussPenta(int order_horiz,int order_vert) {{{*/
+-GaussPenta::GaussPenta(int order_horiz,int order_vert){
+-
+-	/*Intermediaries*/
+-	int     ighoriz,igvert;
+-	int     numgauss_horiz;
+-	int     numgauss_vert;
+-	double *coords1_horiz = NULL;
+-	double *coords2_horiz = NULL;
+-	double *coords3_horiz = NULL;
+-	double *weights_horiz  = NULL;
+-	double *coords_vert = NULL;
+-	double *weights_vert   = NULL;
+-
+-	/*Get gauss points*/
+-	GaussLegendreTria(&numgauss_horiz,&coords1_horiz,&coords2_horiz,&coords3_horiz,&weights_horiz,order_horiz);
+-	GaussLegendreLinear(&coords_vert,&weights_vert,order_vert);
+-	numgauss_vert=order_vert;
+-
+-	/*Allocate GaussPenta fields*/
+-	numgauss=numgauss_horiz*numgauss_vert;
+-	coords1=xNew<double>(numgauss);
+-	coords2=xNew<double>(numgauss);
+-	coords3=xNew<double>(numgauss);
+-	coords4=xNew<double>(numgauss);
+-	weights=xNew<double>(numgauss);
+-
+-	/*Combine Horizontal and vertical points*/
+-	for (ighoriz=0; ighoriz<numgauss_horiz; ighoriz++){
+-		for (igvert=0; igvert<numgauss_vert; igvert++){
+-			coords1[numgauss_vert*ighoriz+igvert]=coords1_horiz[ighoriz];
+-			coords2[numgauss_vert*ighoriz+igvert]=coords2_horiz[ighoriz];
+-			coords3[numgauss_vert*ighoriz+igvert]=coords3_horiz[ighoriz];
+-			coords4[numgauss_vert*ighoriz+igvert]=coords_vert[igvert];
+-			weights[numgauss_vert*ighoriz+igvert]=weights_horiz[ighoriz]*weights_vert[igvert];
+-		}
+-	}
+-
+-	/*Initialize static fields as undefinite*/
+-	weight=UNDEF;
+-	coord1=UNDEF;
+-	coord2=UNDEF;
+-	coord3=UNDEF;
+-	coord4=UNDEF;
+-
+-	/*Clean up*/
+-	xDelete<double>(coords1_horiz);
+-	xDelete<double>(coords2_horiz);
+-	xDelete<double>(coords3_horiz);
+-	xDelete<double>(coords_vert);
+-	xDelete<double>(weights_horiz);
+-	xDelete<double>(weights_vert);
+-}
+-/*}}}*/
+-/*FUNCTION GaussPenta::GaussPenta(int index1, int index2, int order){{{*/
+-GaussPenta::GaussPenta(int index1, int index2,int order){
+-
+-	/*Intermediaties*/
+-	double *seg_coords  = NULL;
+-	double *seg_weights = NULL;
+-	int     i;
+-
+-	/*Get Segment gauss points*/
+-	numgauss=order;
+-	GaussLegendreLinear(&seg_coords,&seg_weights,numgauss);
+-
+-	/*Allocate GaussPenta fields*/
+-	coords1=xNew<double>(numgauss);
+-	coords2=xNew<double>(numgauss);
+-	coords3=xNew<double>(numgauss);
+-	coords4=xNew<double>(numgauss);
+-	weights=xNew<double>(numgauss);
+-
+-	if(index1==0 && index2==3){
+-		for(i=0;i<numgauss;i++) coords1[i]=1.0;
+-		for(i=0;i<numgauss;i++) coords2[i]=0.0;
+-		for(i=0;i<numgauss;i++) coords3[i]=0.0;
+-		for(i=0;i<numgauss;i++) coords4[i]=seg_coords[i];
+-		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+-	}
+-	else if (index1==1 && index2==4){
+-		for(i=0;i<numgauss;i++) coords1[i]=0.0;
+-		for(i=0;i<numgauss;i++) coords2[i]=1.0;
+-		for(i=0;i<numgauss;i++) coords3[i]=0.0;
+-		for(i=0;i<numgauss;i++) coords4[i]=seg_coords[i];
+-		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+-	}
+-	else if (index1==2 && index2==5){
+-		for(i=0;i<numgauss;i++) coords1[i]=0.0;
+-		for(i=0;i<numgauss;i++) coords2[i]=0.0;
+-		for(i=0;i<numgauss;i++) coords3[i]=1.0;
+-		for(i=0;i<numgauss;i++) coords4[i]=seg_coords[i];
+-		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+-	}
+-	else{
+-		_error2_("Penta not supported yet");
+-	}
+-
+-	/*Initialize static fields as undefined*/
+-	weight=UNDEF;
+-	coord1=UNDEF;
+-	coord2=UNDEF;
+-	coord3=UNDEF;
+-	coord4=UNDEF;
+-
+-	/*clean up*/
+-	xDelete<double>(seg_coords);
+-	xDelete<double>(seg_weights);
+-
+-}
+-/*}}}*/
+-/*FUNCTION 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){
+-
+-		/*Get GaussTria*/
+-		GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order);
+-
+-		/*compute z coordinate*/
+-		coords4=xNew<double>(numgauss);
+-		for(int i=0;i<numgauss;i++) coords4[i]=-1.0;
+-	}
+-	/*Upper surface Tria*/
+-	else if(index1==3 && index2==4 && index3==5){
+-
+-		/*Get GaussTria*/
+-		GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order);
+-
+-		/*compute z coordinate*/
+-		coords4=xNew<double>(numgauss);
+-		for(int i=0;i<numgauss;i++) coords4[i]=1.0;
+-	}
+-	else{
+-		_error2_("Tria not supported yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*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){
+-
+-	/*Intermediaties*/
+-	double *seg_horiz_coords  = NULL;
+-	double *seg_horiz_weights = NULL;
+-	double *seg_vert_coords   = NULL;
+-	double *seg_vert_weights  = NULL;
+-	int     i,j;
+-
+-	/*get the gauss points using the product of two line rules*/
+-	GaussLegendreLinear(&seg_horiz_coords,&seg_horiz_weights,order_horiz);
+-	GaussLegendreLinear(&seg_vert_coords, &seg_vert_weights, order_vert);
+-
+-	/*Allocate GaussPenta fields*/
+-	numgauss=order_horiz*order_vert;
+-	coords1=xNew<double>(numgauss);
+-	coords2=xNew<double>(numgauss);
+-	coords3=xNew<double>(numgauss);
+-	coords4=xNew<double>(numgauss);
+-	weights=xNew<double>(numgauss);
+-
+-	/*Quads: get the gauss points using the product of two line rules  */
+-	if(index1==0 && index2==1 && index3==4 && index4==3){
+-		for(i=0;i<order_horiz;i++){
+-			for(j=0;j<order_vert;j++){
+-				coords1[i*order_vert+j]=  0.5*(1-seg_horiz_coords[i]);
+-				coords2[i*order_vert+j]=1-0.5*(1-seg_horiz_coords[i]);
+-				coords3[i*order_vert+j]=0.0;
+-				coords4[i*order_vert+j]=seg_vert_coords[j];
+-				weights[i*order_vert+j]=seg_horiz_weights[i]*seg_vert_weights[j];
+-			}
+-		}
+-	}
+-	else if(index1==1 && index2==2 && index3==5 && index4==4){
+-		for(i=0;i<order_horiz;i++){
+-			for(j=0;j<order_vert;j++){
+-				coords1[i*order_vert+j]=0.0;
+-				coords2[i*order_vert+j]=  0.5*(1-seg_horiz_coords[i]);
+-				coords3[i*order_vert+j]=1-0.5*(1-seg_horiz_coords[i]);
+-				coords4[i*order_vert+j]=seg_vert_coords[j];
+-				weights[i*order_vert+j]=seg_horiz_weights[i]*seg_vert_weights[j];
+-			}
+-		}
+-	}
+-	else if(index1==2 && index2==0 && index3==3 && index4==5){
+-		for(i=0;i<order_horiz;i++){
+-			for(j=0;j<order_vert;j++){
+-				coords1[i*order_vert+j]=1-0.5*(1-seg_horiz_coords[i]);
+-				coords2[i*order_vert+j]=0.0;
+-				coords3[i*order_vert+j]=  0.5*(1-seg_horiz_coords[i]);
+-				coords4[i*order_vert+j]=seg_vert_coords[j];
+-				weights[i*order_vert+j]=seg_horiz_weights[i]*seg_vert_weights[j];
+-			}
+-		}
+-	}
+-	else{
+-		_error2_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")");
+-	}
+-
+-	/*clean-up*/
+-	xDelete<double>(seg_horiz_coords);
+-	xDelete<double>(seg_horiz_weights);
+-	xDelete<double>(seg_vert_coords);
+-	xDelete<double>(seg_vert_weights);
+-}
+-/*}}}*/
+-/*FUNCTION GaussPenta::~GaussPenta(){{{*/
+-GaussPenta::~GaussPenta(){
+-	xDelete<double>(weights);
+-	xDelete<double>(coords1);
+-	xDelete<double>(coords2);
+-	xDelete<double>(coords3);
+-	xDelete<double>(coords4);
+-}
+-/*}}}*/
+-
+-/*Methods*/
+-/*FUNCTION GaussPenta::Echo{{{*/
+-void GaussPenta::Echo(void){
+-
+-	_printLine_("GaussPenta:");
+-	_printLine_("   numgauss: " << numgauss);
+-
+-	if (weights){
+-	 _printString_("   weights = ["); 
+-	 for(int i=0;i<numgauss;i++) _printLine_(" " << weights[i]);
+-	 _printLine_("]");
+-	}
+-	else _printLine_("weights = NULL");
+-	if (coords1){
+-	 _printString_("   coords1 = ["); 
+-	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords1[i]);
+-	 _printLine_("]");
+-	}
+-	else _printLine_("coords1 = NULL");
+-	if (coords2){
+-	 _printString_("   coords2 = ["); 
+-	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords2[i]);
+-	 _printLine_("]");
+-	}
+-	else _printLine_("coords2 = NULL");
+-	if (coords3){
+-	 _printString_("   coords3 = ["); 
+-	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords3[i]);
+-	 _printLine_("]");
+-	}
+-	else _printLine_("coords3 = NULL");
+-	if (coords4){
+-		_printString_("   coords4 = ["); 
+-		for(int i=0;i<numgauss;i++) _printLine_(" " << coords4[i]);
+-		_printLine_("]");
+-	}
+-	else _printLine_("coords4 = NULL");
+-
+-	_printLine_("   weight = " << weight);
+-	_printLine_("   coord1 = " << coord1);
+-	_printLine_("   coord2 = " << coord2);
+-	_printLine_("   coord3 = " << coord3);
+-	_printLine_("   coord4 = " << coord4);
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussPenta::GaussCenter{{{*/
+-void GaussPenta::GaussCenter(void){
+-
+-	/*update static arrays*/
+-	coord1=ONETHIRD;
+-	coord2=ONETHIRD;
+-	coord3=ONETHIRD;
+-	coord4=0.0;
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussPenta::GaussPoint{{{*/
+-void GaussPenta::GaussPoint(int ig){
+-
+-	/*Check input in debugging mode*/
+-	 _assert_(ig>=0 && ig< numgauss);
+-
+-	 /*update static arrays*/
+-	 weight=weights[ig];
+-	 coord1=coords1[ig];
+-	 coord2=coords2[ig];
+-	 coord3=coords3[ig];
+-	 coord4=coords4[ig];
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussPenta::GaussVertex{{{*/
+-void GaussPenta::GaussVertex(int iv){
+-
+-	/*in debugging mode: check that the default constructor has been called*/
+-	_assert_(numgauss==-1);
+-
+-	/*update static arrays*/
+-	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;
+-		default:
+-			_error2_("vertex index should be in [0 5]");
+-
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussPenta::GaussFaceTria{{{*/
+-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);
+-
+-	/*Basal Tria*/
+-	if(index1==0 && index2==1 && index3==2){
+-		GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order);
+-		coords4=xNew<double>(numgauss);
+-		for(int i=0;i<numgauss;i++) coords4[i]=-1.0;
+-	}
+-	else{
+-		_error2_("Tria not supported yet");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION GaussPenta::begin{{{*/
+-int GaussPenta::begin(void){
+-
+-	/*Check that this has been initialized*/
+-	_assert_(numgauss>0);
+-	_assert_(weights);
+-	_assert_(coords1);
+-	_assert_(coords2);
+-	_assert_(coords3);
+-	_assert_(coords4);
+-
+-	/*return first gauss index*/
+-	return 0;
+-}
+-/*}}}*/
+-/*FUNCTION GaussPenta::end{{{*/
+-int GaussPenta::end(void){
+-
+-	/*Check that this has been initialized*/
+-	_assert_(numgauss>0);
+-	_assert_(weights);
+-	_assert_(coords1);
+-	_assert_(coords2);
+-	_assert_(coords3);
+-	_assert_(coords4);
+-
+-	/*return last gauss index +1*/
+-	return numgauss;
+-}
+-/*}}}*/
+-/*FUNCTION GaussPenta::SynchronizeGaussTria{{{*/
+-void GaussPenta::SynchronizeGaussTria(GaussTria* gauss_tria){
+-
+-	gauss_tria->coord1=this->coord1;
+-	gauss_tria->coord2=this->coord2;
+-	gauss_tria->coord3=this->coord3;
+-	gauss_tria->weight=UNDEF;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.h	(revision 12822)
+@@ -0,0 +1,51 @@
++/*!\file GaussPenta.h
++ * \brief: header file for node object
++ */
++
++#ifndef _GAUSSPENTA_H_
++#define _GAUSSPENTA_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./../../shared/shared.h"
++class GaussTria;
++/*}}}*/
++
++class GaussPenta{
++
++	private:
++		int numgauss;
++		double* weights;
++		double* coords1;
++		double* coords2;
++		double* coords3;
++		double* coords4;
++
++	public:
++		double weight;
++		double coord1;
++		double coord2;
++		double coord3;
++		double coord4;
++		
++	public:
++
++		/*GaussPenta constructors, destructors*/
++		GaussPenta();
++		GaussPenta(int order_horiz,int order_vert);
++		GaussPenta(int index1, int index2,int order);
++		GaussPenta(int index1, int index2, int index3, int order);
++		GaussPenta(int index1, int index2, int index3, int index4,int order_horiz,int order_vert);
++		~GaussPenta();
++
++		/*Methods*/
++		int  begin(void);
++		int  end(void);
++		void Echo(void);
++		void GaussPoint(int ig);
++		void GaussVertex(int iv);
++		void GaussFaceTria(int index1, int index2, int index3, int order);
++		void GaussCenter(void);
++		void SynchronizeGaussTria(GaussTria* gauss_tria);
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 12822)
+@@ -0,0 +1,278 @@
++/*!\file GaussTria.c
++ * \brief: implementation of the GaussTria object
++ */
++
++/*Include files: {{{*/
++#include "./../objects.h"
++/*}}}*/
++
++/*GaussTria constructors and destructors:*/
++/*FUNCTION GaussTria::GaussTria() {{{*/
++GaussTria::GaussTria(){
++
++	numgauss=-1;
++
++	weights=NULL;
++	coords1=NULL;
++	coords2=NULL;
++	coords3=NULL;
++
++	weight=UNDEF;
++	coord1=UNDEF;
++	coord2=UNDEF;
++	coord3=UNDEF;
++}
++/*}}}*/
++/*FUNCTION GaussTria::GaussTria(int order) {{{*/
++GaussTria::GaussTria(int order){
++
++	/*Get gauss points*/
++	GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order);
++
++	/*Initialize static fields as undefinite*/
++	weight=UNDEF;
++	coord1=UNDEF;
++	coord2=UNDEF;
++	coord3=UNDEF;
++
++}
++/*}}}*/
++/*FUNCTION GaussTria::GaussTria(int index1,int index2,int order) {{{*/
++GaussTria::GaussTria(int index1,int index2,int order){
++
++	/*Intermediaties*/
++	IssmPDouble *seg_coords  = NULL;
++	IssmPDouble *seg_weights = NULL;
++	int     i,index3;
++
++	/*Get Segment gauss points*/
++	numgauss=order;
++	GaussLegendreLinear(&seg_coords,&seg_weights,numgauss);
++
++	/*Allocate GaussTria fields*/
++	coords1=xNew<IssmPDouble>(numgauss);
++	coords2=xNew<IssmPDouble>(numgauss);
++	coords3=xNew<IssmPDouble>(numgauss);
++	weights=xNew<IssmPDouble>(numgauss);
++
++	/*Reverse index1 and 2 if necessary*/
++	if (index1>index2){
++		index3=index1; index1=index2; index2=index3;
++		for(i=0;i<numgauss;i++) seg_coords[i]=-seg_coords[i];
++	}
++
++	/*Build Triangle Gauss point*/
++	if (index1==0 && index2==1){
++		for(i=0;i<numgauss;i++) coords1[i]=  0.5*(1-seg_coords[i]);
++		for(i=0;i<numgauss;i++) coords2[i]=1-0.5*(1.-seg_coords[i]);
++		for(i=0;i<numgauss;i++) coords3[i]=0;
++		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
++	}
++	else if (index1==0 && index2==2){
++		for(i=0;i<numgauss;i++) coords1[i]=  0.5*(1-seg_coords[i]);
++		for(i=0;i<numgauss;i++) coords2[i]= 0 ;
++		for(i=0;i<numgauss;i++) coords3[i]=1-0.5*(1.-seg_coords[i]);
++		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
++	}
++	else if (index1==1 && index2==2){
++		for(i=0;i<numgauss;i++) coords1[i]=0;
++		for(i=0;i<numgauss;i++) coords2[i]=  0.5*(1-seg_coords[i]);
++		for(i=0;i<numgauss;i++) coords3[i]=1-0.5*(1.-seg_coords[i]);
++		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
++	}
++	else
++	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
++
++	/*Initialize static fields as undefined*/
++	weight=UNDEF;
++	coord1=UNDEF;
++	coord2=UNDEF;
++	coord3=UNDEF;
++
++	/*clean up*/
++	xDelete<double>(seg_coords);
++	xDelete<double>(seg_weights);
++}
++/*}}}*/
++/*FUNCTION GaussTria::~GaussTria(){{{*/
++GaussTria::~GaussTria(){
++	xDelete<IssmPDouble>(weights);
++	xDelete<IssmPDouble>(coords1);
++	xDelete<IssmPDouble>(coords2);
++	xDelete<IssmPDouble>(coords3);
++}
++/*}}}*/
++
++/*Methods*/
++/*FUNCTION GaussTria::Echo{{{*/
++void GaussTria::Echo(void){
++
++	_printLine_("GaussTria:");
++	_printLine_("   numgauss: " << numgauss);
++
++	if (weights){
++	 _printString_("   weights = ["); 
++	 for(int i=0;i<numgauss;i++) _printLine_(" " << weights[i]);
++	 _printLine_("]");
++	}
++	else _printLine_("weights = NULL");
++	if (coords1){
++	 _printString_("   coords1 = ["); 
++	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords1[i]);
++	 _printLine_("]");
++	}
++	else _printLine_("coords1 = NULL");
++	if (coords2){
++	 _printString_("   coords2 = ["); 
++	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords2[i]);
++	 _printLine_("]");
++	}
++	else _printLine_("coords2 = NULL");
++	if (coords3){
++	 _printString_("   coords3 = ["); 
++	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords3[i]);
++	 _printLine_("]");
++	}
++	else _printLine_("coords3 = NULL");
++
++	_printLine_("   weight = " << weight);
++	_printLine_("   coord1 = " << coord1);
++	_printLine_("   coord2 = " << coord2);
++	_printLine_("   coord3 = " << coord3);
++
++}
++/*}}}*/
++/*FUNCTION GaussTria::GaussCenter{{{*/
++void GaussTria::GaussCenter(void){
++
++	/*update static arrays*/
++	coord1=ONETHIRD;
++	coord2=ONETHIRD;
++	coord3=ONETHIRD;
++
++}
++/*}}}*/
++/*FUNCTION GaussTria::GaussEdgeCenter{{{*/
++void GaussTria::GaussEdgeCenter(int index1,int index2){
++
++	int     index3;
++
++	/*Reverse index1 and 2 if necessary*/
++	if (index1>index2){
++		index3=index1; index1=index2; index2=index3;
++	}
++
++	/*update static arrays*/
++	if (index1==0 && index2==1){
++		coord1=0.5;
++		coord2=0.5;
++		coord3=0.0;
++	}
++	else if (index1==0 && index2==2){
++		coord1=0.5;
++		coord2=0.0;
++		coord3=0.5;
++	}
++	else if (index1==1 && index2==2){
++		coord1=0.0;
++		coord2=0.5;
++		coord3=0.5;
++	}
++	else
++	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
++
++}
++/*}}}*/
++/*FUNCTION GaussTria::GaussPoint{{{*/
++void GaussTria::GaussPoint(int ig){
++
++	/*Check input in debugging mode*/
++	 _assert_(ig>=0 && ig< numgauss);
++
++	 /*update static arrays*/
++	 weight=weights[ig];
++	 coord1=coords1[ig];
++	 coord2=coords2[ig];
++	 coord3=coords3[ig];
++
++}
++/*}}}*/
++/*FUNCTION GaussTria::GaussFromCoords{{{*/
++void GaussTria::GaussFromCoords(IssmPDouble x,IssmPDouble y,IssmPDouble* xyz_list){
++
++	/*Intermediaries*/
++	IssmPDouble    area = 0;
++	IssmPDouble    x1,y1,x2,y2,x3,y3;
++
++	/*in debugging mode: check that the default constructor has been called*/
++	_assert_(numgauss==-1);
++
++	x1=*(xyz_list+3*0+0); y1=*(xyz_list+3*0+1);
++	x2=*(xyz_list+3*1+0); y2=*(xyz_list+3*1+1);
++	x3=*(xyz_list+3*2+0); y3=*(xyz_list+3*2+1);
++
++	area=(x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1)/2;
++
++	/*Get first area coordinate = det(x-x3  x2-x3 ; y-y3   y2-y3)/area*/
++	coord1=((x-x3)*(y2-y3)-(x2-x3)*(y-y3))/area;
++
++	/*Get second area coordinate = det(x1-x3  x-x3 ; y1-y3   y-y3)/area*/
++	coord2=((x1-x3)*(y-y3)-(x-x3)*(y1-y3))/area;
++
++	/*Get third  area coordinate 1-area1-area2: */
++	coord3=1-coord1-coord2;
++
++}
++/*}}}*/
++/*FUNCTION GaussTria::GaussVertex{{{*/
++void GaussTria::GaussVertex(int iv){
++
++	/*in debugging mode: check that the default constructor has been called*/
++	_assert_(numgauss==-1);
++
++	/*update static arrays*/
++	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;
++		default:
++			_error2_("vertex index should be in [0 2]");
++
++	}
++
++}
++/*}}}*/
++/*FUNCTION GaussTria::begin{{{*/
++int GaussTria::begin(void){
++
++	/*Check that this has been initialized*/
++	_assert_(numgauss>0);
++	_assert_(weights);
++	_assert_(coords1);
++	_assert_(coords2);
++	_assert_(coords3);
++
++	/*return first gauss index*/
++	return 0;
++}
++/*}}}*/
++/*FUNCTION GaussTria::end{{{*/
++int GaussTria::end(void){
++
++	/*Check that this has been initialized*/
++	_assert_(numgauss>0);
++	_assert_(weights);
++	_assert_(coords1);
++	_assert_(coords2);
++	_assert_(coords3);
++
++	/*return last gauss index +1*/
++	return numgauss;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.h	(revision 12822)
+@@ -0,0 +1,46 @@
++/*!\file GaussTria.h
++ * \brief: header file for node object
++ */
++
++#ifndef _GAUSSTRIA_H_
++#define _GAUSSTRIA_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./../../shared/shared.h"
++/*}}}*/
++
++class GaussTria{
++
++	private:
++		int numgauss;
++		IssmPDouble* weights;
++		IssmPDouble* coords1;
++		IssmPDouble* coords2;
++		IssmPDouble* coords3;
++
++	public:
++		IssmPDouble weight;
++		IssmPDouble coord1;
++		IssmPDouble coord2;
++		IssmPDouble coord3;
++		
++	public:
++
++		/*GaussTria constructors, destructors*/
++		GaussTria();
++		GaussTria(int order);
++		GaussTria(int index1,int index2,int order);
++		~GaussTria();
++
++		/*Methods*/
++		int  begin(void);
++		int  end(void);
++		void Echo(void);
++		void GaussFromCoords(IssmPDouble x1,IssmPDouble y1,IssmPDouble* xyz_list);
++		void GaussPoint(int ig);
++		void GaussVertex(int iv);
++		void GaussCenter(void);
++		void GaussEdgeCenter(int index1,int index2);
++};
++#endif  /* _GAUSSTRIA_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 12822)
+@@ -0,0 +1,406 @@
++/*!\file GaussPenta.c
++ * \brief: implementation of the GaussPenta object
++ */
++
++/*Include files: {{{*/
++#include "./../objects.h"
++/*}}}*/
++
++/*GaussPenta constructors and destructors:*/
++/*FUNCTION GaussPenta::GaussPenta() {{{*/
++GaussPenta::GaussPenta(){
++
++	numgauss=-1;
++
++	weights=NULL;
++	coords1=NULL;
++	coords2=NULL;
++	coords3=NULL;
++	coords4=NULL;
++
++	weight=UNDEF;
++	coord1=UNDEF;
++	coord2=UNDEF;
++	coord3=UNDEF;
++	coord4=UNDEF;
++}
++/*}}}*/
++/*FUNCTION GaussPenta::GaussPenta(int order_horiz,int order_vert) {{{*/
++GaussPenta::GaussPenta(int order_horiz,int order_vert){
++
++	/*Intermediaries*/
++	int     ighoriz,igvert;
++	int     numgauss_horiz;
++	int     numgauss_vert;
++	double *coords1_horiz = NULL;
++	double *coords2_horiz = NULL;
++	double *coords3_horiz = NULL;
++	double *weights_horiz  = NULL;
++	double *coords_vert = NULL;
++	double *weights_vert   = NULL;
++
++	/*Get gauss points*/
++	GaussLegendreTria(&numgauss_horiz,&coords1_horiz,&coords2_horiz,&coords3_horiz,&weights_horiz,order_horiz);
++	GaussLegendreLinear(&coords_vert,&weights_vert,order_vert);
++	numgauss_vert=order_vert;
++
++	/*Allocate GaussPenta fields*/
++	numgauss=numgauss_horiz*numgauss_vert;
++	coords1=xNew<double>(numgauss);
++	coords2=xNew<double>(numgauss);
++	coords3=xNew<double>(numgauss);
++	coords4=xNew<double>(numgauss);
++	weights=xNew<double>(numgauss);
++
++	/*Combine Horizontal and vertical points*/
++	for (ighoriz=0; ighoriz<numgauss_horiz; ighoriz++){
++		for (igvert=0; igvert<numgauss_vert; igvert++){
++			coords1[numgauss_vert*ighoriz+igvert]=coords1_horiz[ighoriz];
++			coords2[numgauss_vert*ighoriz+igvert]=coords2_horiz[ighoriz];
++			coords3[numgauss_vert*ighoriz+igvert]=coords3_horiz[ighoriz];
++			coords4[numgauss_vert*ighoriz+igvert]=coords_vert[igvert];
++			weights[numgauss_vert*ighoriz+igvert]=weights_horiz[ighoriz]*weights_vert[igvert];
++		}
++	}
++
++	/*Initialize static fields as undefinite*/
++	weight=UNDEF;
++	coord1=UNDEF;
++	coord2=UNDEF;
++	coord3=UNDEF;
++	coord4=UNDEF;
++
++	/*Clean up*/
++	xDelete<double>(coords1_horiz);
++	xDelete<double>(coords2_horiz);
++	xDelete<double>(coords3_horiz);
++	xDelete<double>(coords_vert);
++	xDelete<double>(weights_horiz);
++	xDelete<double>(weights_vert);
++}
++/*}}}*/
++/*FUNCTION GaussPenta::GaussPenta(int index1, int index2, int order){{{*/
++GaussPenta::GaussPenta(int index1, int index2,int order){
++
++	/*Intermediaties*/
++	double *seg_coords  = NULL;
++	double *seg_weights = NULL;
++	int     i;
++
++	/*Get Segment gauss points*/
++	numgauss=order;
++	GaussLegendreLinear(&seg_coords,&seg_weights,numgauss);
++
++	/*Allocate GaussPenta fields*/
++	coords1=xNew<double>(numgauss);
++	coords2=xNew<double>(numgauss);
++	coords3=xNew<double>(numgauss);
++	coords4=xNew<double>(numgauss);
++	weights=xNew<double>(numgauss);
++
++	if(index1==0 && index2==3){
++		for(i=0;i<numgauss;i++) coords1[i]=1.0;
++		for(i=0;i<numgauss;i++) coords2[i]=0.0;
++		for(i=0;i<numgauss;i++) coords3[i]=0.0;
++		for(i=0;i<numgauss;i++) coords4[i]=seg_coords[i];
++		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
++	}
++	else if (index1==1 && index2==4){
++		for(i=0;i<numgauss;i++) coords1[i]=0.0;
++		for(i=0;i<numgauss;i++) coords2[i]=1.0;
++		for(i=0;i<numgauss;i++) coords3[i]=0.0;
++		for(i=0;i<numgauss;i++) coords4[i]=seg_coords[i];
++		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
++	}
++	else if (index1==2 && index2==5){
++		for(i=0;i<numgauss;i++) coords1[i]=0.0;
++		for(i=0;i<numgauss;i++) coords2[i]=0.0;
++		for(i=0;i<numgauss;i++) coords3[i]=1.0;
++		for(i=0;i<numgauss;i++) coords4[i]=seg_coords[i];
++		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
++	}
++	else{
++		_error2_("Penta not supported yet");
++	}
++
++	/*Initialize static fields as undefined*/
++	weight=UNDEF;
++	coord1=UNDEF;
++	coord2=UNDEF;
++	coord3=UNDEF;
++	coord4=UNDEF;
++
++	/*clean up*/
++	xDelete<double>(seg_coords);
++	xDelete<double>(seg_weights);
++
++}
++/*}}}*/
++/*FUNCTION 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){
++
++		/*Get GaussTria*/
++		GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order);
++
++		/*compute z coordinate*/
++		coords4=xNew<double>(numgauss);
++		for(int i=0;i<numgauss;i++) coords4[i]=-1.0;
++	}
++	/*Upper surface Tria*/
++	else if(index1==3 && index2==4 && index3==5){
++
++		/*Get GaussTria*/
++		GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order);
++
++		/*compute z coordinate*/
++		coords4=xNew<double>(numgauss);
++		for(int i=0;i<numgauss;i++) coords4[i]=1.0;
++	}
++	else{
++		_error2_("Tria not supported yet");
++	}
++
++}
++/*}}}*/
++/*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){
++
++	/*Intermediaties*/
++	double *seg_horiz_coords  = NULL;
++	double *seg_horiz_weights = NULL;
++	double *seg_vert_coords   = NULL;
++	double *seg_vert_weights  = NULL;
++	int     i,j;
++
++	/*get the gauss points using the product of two line rules*/
++	GaussLegendreLinear(&seg_horiz_coords,&seg_horiz_weights,order_horiz);
++	GaussLegendreLinear(&seg_vert_coords, &seg_vert_weights, order_vert);
++
++	/*Allocate GaussPenta fields*/
++	numgauss=order_horiz*order_vert;
++	coords1=xNew<double>(numgauss);
++	coords2=xNew<double>(numgauss);
++	coords3=xNew<double>(numgauss);
++	coords4=xNew<double>(numgauss);
++	weights=xNew<double>(numgauss);
++
++	/*Quads: get the gauss points using the product of two line rules  */
++	if(index1==0 && index2==1 && index3==4 && index4==3){
++		for(i=0;i<order_horiz;i++){
++			for(j=0;j<order_vert;j++){
++				coords1[i*order_vert+j]=  0.5*(1-seg_horiz_coords[i]);
++				coords2[i*order_vert+j]=1-0.5*(1-seg_horiz_coords[i]);
++				coords3[i*order_vert+j]=0.0;
++				coords4[i*order_vert+j]=seg_vert_coords[j];
++				weights[i*order_vert+j]=seg_horiz_weights[i]*seg_vert_weights[j];
++			}
++		}
++	}
++	else if(index1==1 && index2==2 && index3==5 && index4==4){
++		for(i=0;i<order_horiz;i++){
++			for(j=0;j<order_vert;j++){
++				coords1[i*order_vert+j]=0.0;
++				coords2[i*order_vert+j]=  0.5*(1-seg_horiz_coords[i]);
++				coords3[i*order_vert+j]=1-0.5*(1-seg_horiz_coords[i]);
++				coords4[i*order_vert+j]=seg_vert_coords[j];
++				weights[i*order_vert+j]=seg_horiz_weights[i]*seg_vert_weights[j];
++			}
++		}
++	}
++	else if(index1==2 && index2==0 && index3==3 && index4==5){
++		for(i=0;i<order_horiz;i++){
++			for(j=0;j<order_vert;j++){
++				coords1[i*order_vert+j]=1-0.5*(1-seg_horiz_coords[i]);
++				coords2[i*order_vert+j]=0.0;
++				coords3[i*order_vert+j]=  0.5*(1-seg_horiz_coords[i]);
++				coords4[i*order_vert+j]=seg_vert_coords[j];
++				weights[i*order_vert+j]=seg_horiz_weights[i]*seg_vert_weights[j];
++			}
++		}
++	}
++	else{
++		_error2_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")");
++	}
++
++	/*clean-up*/
++	xDelete<double>(seg_horiz_coords);
++	xDelete<double>(seg_horiz_weights);
++	xDelete<double>(seg_vert_coords);
++	xDelete<double>(seg_vert_weights);
++}
++/*}}}*/
++/*FUNCTION GaussPenta::~GaussPenta(){{{*/
++GaussPenta::~GaussPenta(){
++	xDelete<double>(weights);
++	xDelete<double>(coords1);
++	xDelete<double>(coords2);
++	xDelete<double>(coords3);
++	xDelete<double>(coords4);
++}
++/*}}}*/
++
++/*Methods*/
++/*FUNCTION GaussPenta::Echo{{{*/
++void GaussPenta::Echo(void){
++
++	_printLine_("GaussPenta:");
++	_printLine_("   numgauss: " << numgauss);
++
++	if (weights){
++	 _printString_("   weights = ["); 
++	 for(int i=0;i<numgauss;i++) _printLine_(" " << weights[i]);
++	 _printLine_("]");
++	}
++	else _printLine_("weights = NULL");
++	if (coords1){
++	 _printString_("   coords1 = ["); 
++	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords1[i]);
++	 _printLine_("]");
++	}
++	else _printLine_("coords1 = NULL");
++	if (coords2){
++	 _printString_("   coords2 = ["); 
++	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords2[i]);
++	 _printLine_("]");
++	}
++	else _printLine_("coords2 = NULL");
++	if (coords3){
++	 _printString_("   coords3 = ["); 
++	 for(int i=0;i<numgauss;i++) _printLine_(" " << coords3[i]);
++	 _printLine_("]");
++	}
++	else _printLine_("coords3 = NULL");
++	if (coords4){
++		_printString_("   coords4 = ["); 
++		for(int i=0;i<numgauss;i++) _printLine_(" " << coords4[i]);
++		_printLine_("]");
++	}
++	else _printLine_("coords4 = NULL");
++
++	_printLine_("   weight = " << weight);
++	_printLine_("   coord1 = " << coord1);
++	_printLine_("   coord2 = " << coord2);
++	_printLine_("   coord3 = " << coord3);
++	_printLine_("   coord4 = " << coord4);
++
++}
++/*}}}*/
++/*FUNCTION GaussPenta::GaussCenter{{{*/
++void GaussPenta::GaussCenter(void){
++
++	/*update static arrays*/
++	coord1=ONETHIRD;
++	coord2=ONETHIRD;
++	coord3=ONETHIRD;
++	coord4=0.0;
++
++}
++/*}}}*/
++/*FUNCTION GaussPenta::GaussPoint{{{*/
++void GaussPenta::GaussPoint(int ig){
++
++	/*Check input in debugging mode*/
++	 _assert_(ig>=0 && ig< numgauss);
++
++	 /*update static arrays*/
++	 weight=weights[ig];
++	 coord1=coords1[ig];
++	 coord2=coords2[ig];
++	 coord3=coords3[ig];
++	 coord4=coords4[ig];
++
++}
++/*}}}*/
++/*FUNCTION GaussPenta::GaussVertex{{{*/
++void GaussPenta::GaussVertex(int iv){
++
++	/*in debugging mode: check that the default constructor has been called*/
++	_assert_(numgauss==-1);
++
++	/*update static arrays*/
++	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;
++		default:
++			_error2_("vertex index should be in [0 5]");
++
++	}
++
++}
++/*}}}*/
++/*FUNCTION GaussPenta::GaussFaceTria{{{*/
++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);
++
++	/*Basal Tria*/
++	if(index1==0 && index2==1 && index3==2){
++		GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order);
++		coords4=xNew<double>(numgauss);
++		for(int i=0;i<numgauss;i++) coords4[i]=-1.0;
++	}
++	else{
++		_error2_("Tria not supported yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION GaussPenta::begin{{{*/
++int GaussPenta::begin(void){
++
++	/*Check that this has been initialized*/
++	_assert_(numgauss>0);
++	_assert_(weights);
++	_assert_(coords1);
++	_assert_(coords2);
++	_assert_(coords3);
++	_assert_(coords4);
++
++	/*return first gauss index*/
++	return 0;
++}
++/*}}}*/
++/*FUNCTION GaussPenta::end{{{*/
++int GaussPenta::end(void){
++
++	/*Check that this has been initialized*/
++	_assert_(numgauss>0);
++	_assert_(weights);
++	_assert_(coords1);
++	_assert_(coords2);
++	_assert_(coords3);
++	_assert_(coords4);
++
++	/*return last gauss index +1*/
++	return numgauss;
++}
++/*}}}*/
++/*FUNCTION GaussPenta::SynchronizeGaussTria{{{*/
++void GaussPenta::SynchronizeGaussTria(GaussTria* gauss_tria){
++
++	gauss_tria->coord1=this->coord1;
++	gauss_tria->coord2=this->coord2;
++	gauss_tria->coord3=this->coord3;
++	gauss_tria->weight=UNDEF;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 12822)
+@@ -0,0 +1,769 @@
++/*!\file Matice.c
++ * \brief: implementation of the Matice object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++		
++/*Matice constructors and destructor*/
++/*FUNCTION Matice::Matice(){{{*/
++Matice::Matice(){
++	this->inputs=NULL;
++	this->helement=NULL;
++	return;
++}
++/*}}}*/
++/*FUNCTION Matice::Matice(int id, int index, IoModel* iomodel, int num_vertices){{{*/
++Matice::Matice(int matice_mid,int index, IoModel* iomodel){
++
++	/*Intermediaries:*/
++	int    i;
++	int    matice_eid;
++
++	/*Initialize id*/
++	this->mid=matice_mid;
++
++	/*Initialize inputs*/
++	this->inputs=new Inputs();
++
++	/*Initialize inputs from IoModel*/
++	this->InputUpdateFromIoModel(index,iomodel);
++
++	/*Hooks: */
++	matice_eid=index+1;
++	this->helement=new Hook(&matice_eid,1);
++
++	return;
++
++}
++/*}}}*/
++/*FUNCTION Matice::~Matice(){{{*/
++Matice::~Matice(){
++	delete helement;
++	delete inputs;
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Matice::Echo {{{*/
++void Matice::Echo(void){
++
++	_printLine_("Matice:");
++	_printLine_("   mid: " << mid);
++	_printLine_("   inputs:");
++	inputs->Echo();
++	_printLine_("   element:");
++	helement->Echo();
++}
++/*}}}*/
++/*FUNCTION Matice::DeepEcho {{{*/
++void Matice::DeepEcho(void){
++
++	_printLine_("Matice:");
++	_printLine_("   mid: " << mid);
++	_printLine_("   inputs:");
++	inputs->DeepEcho();
++	_printLine_("   element:");
++	helement->Echo();
++}		
++/*}}}*/
++/*FUNCTION Matice::Id {{{*/
++int    Matice::Id(void){ return mid; }
++/*}}}*/
++/*FUNCTION Matice::MyRank {{{*/
++int    Matice::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Matice::ObjectEnum{{{*/
++int Matice::ObjectEnum(void){
++
++	return MaticeEnum;
++
++}
++/*}}}*/
++/*FUNCTION Matice::copy {{{*/
++Object* Matice::copy() {
++
++	/*Output*/
++	Matice* matice=NULL;
++
++	/*Initialize output*/
++	matice=new Matice();
++
++	/*copy fields: */
++	matice->mid=this->mid;
++	matice->helement=(Hook*)this->helement->copy();
++	if(this->inputs) matice->inputs=(Inputs*)this->inputs->Copy();
++	else  matice->inputs=new Inputs();
++
++	return matice;
++}
++/*}}}*/
++
++/*Matice management*/
++/*FUNCTION Matice::Configure {{{*/
++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: */
++	helement->configure(elementsin);
++}
++/*}}}*/
++/*FUNCTION Matice::SetCurrentConfiguration {{{*/
++void  Matice::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++
++}
++/*}}}*/
++/*FUNCTION Matice::GetB {{{*/
++IssmDouble Matice::GetB(){
++
++	/*Output*/
++	IssmDouble B;
++
++	inputs->GetInputAverage(&B,MaterialsRheologyBEnum);
++	return B;
++}
++/*}}}*/
++/*FUNCTION Matice::GetBbar {{{*/
++IssmDouble Matice::GetBbar(){
++
++	/*Output*/
++	IssmDouble Bbar;
++
++	inputs->GetInputAverage(&Bbar,MaterialsRheologyBbarEnum);
++	return Bbar;
++}
++/*}}}*/
++/*FUNCTION Matice::GetN {{{*/
++IssmDouble Matice::GetN(){
++
++	/*Output*/
++	IssmDouble n;
++
++	inputs->GetInputAverage(&n,MaterialsRheologyNEnum);
++	return n;
++}
++/*}}}*/
++/*FUNCTION Matice::GetVectorFromInputs{{{*/
++void  Matice::GetVectorFromInputs(Vector* vector,int input_enum){
++
++	/*Intermediaries*/
++	Element *element= NULL;
++
++	/*Recover element*/
++	element=(Element*)helement->delivers();
++
++	/*Check that input_enum is a material input*/
++	if (!IsInput(input_enum)) return;
++
++	switch(element->ObjectEnum()){
++
++		case TriaEnum:{
++
++			/*Prepare index list*/
++			int doflist1[3];
++			for(int i=0;i<3;i++) doflist1[i]=((Tria*)element)->nodes[i]->GetVertexDof();
++
++			/*Get input (either in element or material)*/
++			Input* input=inputs->GetInput(input_enum);
++			if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in material");
++
++			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
++			input->GetVectorFromInputs(vector,&doflist1[0]);}
++			break;
++
++		default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Matice::GetViscosity2d {{{*/
++void  Matice::GetViscosity2d(IssmDouble* pviscosity, IssmDouble* epsilon){
++	/*From a string tensor and a material object, return viscosity, using Glen's flow law.
++												    B
++	  viscosity= -------------------------------------------------------------------
++						  2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
++
++	  where viscosity is the viscotiy, B the flow law parameter , (u,v) the velocity 
++	  vector, and n the flow law exponent.
++
++	  If epsilon is NULL, it means this is the first time SystemMatrices is being run, and we 
++	  return 10^14, initial viscosity.
++	  */
++
++	/*output: */
++	IssmDouble viscosity;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy;
++
++	/*Intermediary: */
++	IssmDouble A,e;
++	IssmDouble B,n;
++
++	/*Get B and n*/
++	B=GetBbar();
++	n=GetN();
++
++	if (n==1){
++		/*Viscous behaviour! viscosity=B: */
++		viscosity=B/2;
++	}
++	else{
++		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0)){
++			viscosity=0.5*pow((IssmDouble)10,(IssmDouble)14);
++		}
++		else{
++			/*Retrive strain rate components: */
++			exx=*(epsilon+0);
++			eyy=*(epsilon+1);
++			exy=*(epsilon+2);
++
++			/*Build viscosity: viscosity=B/(2*A^e) */
++			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
++			if(A==0){
++				/*Maxiviscositym viscosity for 0 shear areas: */
++				viscosity=2.5*pow((IssmDouble)10,(IssmDouble)17);
++			}
++			else{
++				e=(n-1)/(2*n);
++				viscosity=B/(2*pow(A,e));
++			}
++		}
++	}
++
++	/*Checks in debugging mode*/
++	if(viscosity<=0) _error2_("Negative viscosity");
++	_assert_(B>0);
++	_assert_(n>0);
++
++	/*Return: */
++	*pviscosity=viscosity;
++}
++/*}}}*/
++/*FUNCTION Matice::GetViscosity3d {{{*/
++void  Matice::GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* epsilon){
++
++	/*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]: 
++	 *
++	 *                                               B
++	 * viscosity3d= -------------------------------------------------------------------
++	 *                      2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
++	 *
++	 *     where mu is the viscotiy, B the flow law parameter , (u,v) the velocity 
++	 *     vector, and n the flow law exponent.
++	 *
++	 * If epsilon is NULL, it means this is the first time Emg is being run, and we 
++	 * return g, initial viscosity.
++	 */
++	
++	/*output: */
++	IssmDouble viscosity3d;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy,exz,eyz;
++
++	/*Intermediaries: */
++	IssmDouble A,e;
++	IssmDouble B,n;
++
++	/*Get B and n*/
++	B=GetB();
++	n=GetN();
++
++	if (n==1){
++		/*Viscous behaviour! viscosity3d=B: */
++		viscosity3d=B/2;
++	}
++	else{
++		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
++				(epsilon[3]==0) && (epsilon[4]==0)){
++			viscosity3d=0.5*pow((IssmDouble)10,(IssmDouble)14);
++		}
++		else{
++
++			/*Retrive strain rate components: */
++			exx=*(epsilon+0);
++			eyy=*(epsilon+1);
++			exy=*(epsilon+2);
++			exz=*(epsilon+3);
++			eyz=*(epsilon+4);
++
++			/*Build viscosity: viscosity3d=2*B/(2*A^e) */
++			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+pow(exz,2)+pow(eyz,2)+exx*eyy;
++			if(A==0){
++				/*Maxiviscosity3dm viscosity for 0 shear areas: */
++				viscosity3d=2.25*pow((IssmDouble)10,(IssmDouble)17);
++			}
++			else{
++				e=(n-1)/2/n;
++			
++				viscosity3d=B/(2*pow(A,e));
++			}
++		}
++	}
++
++	/*Checks in debugging mode*/
++	if(viscosity3d<=0) _error2_("Negative viscosity");
++	_assert_(B>0);
++	_assert_(n>0);
++
++	/*Assign output pointers:*/
++	*pviscosity3d=viscosity3d;
++}
++/*}}}*/
++/*FUNCTION Matice::GetViscosity3dStokes {{{*/
++void  Matice::GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon){
++	/*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]: 
++	 *
++	 *                                          B
++	 * viscosity3d= -------------------------------------------------------------------
++	 *                   2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
++	 *
++	 *     where mu is the viscotiy, B the flow law parameter , (u,v) the velocity 
++	 *     vector, and n the flow law exponent.
++	 *
++	 * If epsilon is NULL, it means this is the first time Emg is being run, and we 
++	 * return g, initial viscosity.
++	 */
++	
++	/*output: */
++	IssmDouble viscosity3d;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy,exz,eyz,ezz;
++
++	/*Intermediaries: */
++	IssmDouble A,e;
++	IssmDouble B,n;
++	IssmDouble eps0;
++
++	/*Get B and n*/
++	eps0=pow((IssmDouble)10,(IssmDouble)-27);
++	B=GetB();
++	n=GetN();
++	
++	if (n==1){
++		/*Viscous behaviour! viscosity3d=B: */
++		viscosity3d=B/2;
++	}
++	else{
++		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
++				(epsilon[3]==0) && (epsilon[4]==0) && (epsilon[5]==0)){
++			viscosity3d=0.5*pow((IssmDouble)10,(IssmDouble)14);
++		}
++		else{
++
++			/*Retrive strain rate components: */
++			exx=*(epsilon+0);
++			eyy=*(epsilon+1);
++			ezz=*(epsilon+2); //not used
++			exy=*(epsilon+3);
++			exz=*(epsilon+4);
++			eyz=*(epsilon+5);
++
++			/*Build viscosity: viscosity3d=B/(2*A^e) */
++			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+pow(exz,2)+pow(eyz,2)+exx*eyy+pow(eps0,2);
++			if(A==0){
++				/*Maxiviscosity3dm viscosity for 0 shear areas: */
++				viscosity3d=2.25*pow((IssmDouble)10,(IssmDouble)17);
++			}
++			else{
++				e=(n-1)/2/n;
++				viscosity3d=B/(2*pow(A,e));
++			}
++		}
++	}
++
++	/*Checks in debugging mode*/
++	if(viscosity3d<=0) _error2_("Negative viscosity");
++	_assert_(B>0);
++	_assert_(n>0);
++
++	/*Assign output pointers:*/
++	*pviscosity3d=viscosity3d;
++}
++/*}}}*/
++/*FUNCTION Matice::GetViscosityComplement {{{*/
++void  Matice::GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){
++	/*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]: 
++	 *
++	 *  										                1
++	 * viscosity= -------------------------------------------------------------------
++	 *  				  2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
++	 *
++	 * If epsilon is NULL, it means this is the first time Gradjb is being run, and we 
++	 * return mu20, initial viscosity.
++	 */
++	
++	/*output: */
++	IssmDouble viscosity_complement;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy;
++
++	/*Intermediary value A and exponent e: */
++	IssmDouble A,e;
++	IssmDouble B,n;
++
++	/*Get B and n*/
++	B=GetBbar();
++	n=GetN();
++
++	if(epsilon){
++		exx=*(epsilon+0);
++		eyy=*(epsilon+1);
++		exy=*(epsilon+2);
++
++		/*Build viscosity: mu2=B/(2*A^e) */
++		A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
++		if(A==0){
++			/*Maximum viscosity_complement for 0 shear areas: */
++			viscosity_complement=2.25*pow((IssmDouble)10,(IssmDouble)17);
++		}
++		else{
++			e=(n-1)/(2*n);
++		
++			viscosity_complement=1/(2*pow(A,e));
++		}
++	}
++	else{
++		viscosity_complement=4.5*pow((IssmDouble)10,(IssmDouble)17);
++	}
++
++	/*Checks in debugging mode*/
++	_assert_(B>0);
++	_assert_(n>0);
++	_assert_(viscosity_complement>0);
++		
++	/*Return: */
++	*pviscosity_complement=viscosity_complement;
++}
++/*}}}*/
++/*FUNCTION Matice::GetViscosityDerivativeEpsSquare{{{*/
++void  Matice::GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){
++
++	/*output: */
++	IssmDouble mu_prime;
++	IssmDouble mu,n,eff2;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy,exz,eyz;
++
++	/*Get visocisty and n*/
++	GetViscosity3d(&mu,epsilon);
++	n=GetN();
++
++	if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
++				(epsilon[3]==0) && (epsilon[4]==0)){
++		mu_prime=0.5*pow((IssmDouble)10,(IssmDouble)14);
++	}
++	else{
++		/*Retrive strain rate components: */
++		exx=epsilon[0];
++		eyy=epsilon[1];
++		exy=epsilon[2];
++		exz=epsilon[3];
++		eyz=epsilon[4];
++		eff2 = exx*exx + eyy*eyy + exx*eyy + exy*exy + exz*exz + eyz*eyz;
++
++		mu_prime=(1-n)/(2*n) * mu/eff2;
++	}
++
++	/*Assign output pointers:*/
++	*pmu_prime=mu_prime;
++}
++/*}}}*/
++/*FUNCTION Matice::GetViscosity2dDerivativeEpsSquare{{{*/
++void  Matice::GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){
++
++	/*output: */
++	IssmDouble mu_prime;
++	IssmDouble mu,n,eff2;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy,exz;
++
++	/*Get visocisty and n*/
++	GetViscosity2d(&mu,epsilon);
++	n=GetN();
++
++	if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0)){
++		mu_prime=0.5*pow((IssmDouble)10,(IssmDouble)14);
++	}
++	else{
++		/*Retrive strain rate components: */
++		exx=epsilon[0];
++		eyy=epsilon[1];
++		exy=epsilon[2];
++		eff2 = exx*exx + eyy*eyy + exx*eyy + exy*exy ;
++
++		mu_prime=(1-n)/(2*n) * mu/eff2;
++	}
++
++	/*Assign output pointers:*/
++	*pmu_prime=mu_prime;
++}
++/*}}}*/
++/*FUNCTION Matice::InputDuplicate{{{*/
++void  Matice::InputDuplicate(int original_enum,int new_enum){
++
++	/*Call inputs method*/
++	if (IsInput(original_enum)) inputs->DuplicateInput(original_enum,new_enum);
++
++}
++/*}}}*/
++/*FUNCTION Matice::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
++void  Matice::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++
++	/*Intermediaries*/
++	Element *element      = NULL;
++
++	/*Recover element*/
++	element=(Element*)helement->delivers();
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	switch(type){
++
++		case VertexEnum:
++
++			switch(element->ObjectEnum()){
++
++				case TriaEnum: {
++					IssmDouble values[3];
++					for (int i=0;i<3;i++) values[i]=vector[((Tria*)element)->nodes[i]->GetVertexDof()];
++					this->inputs->AddInput(new TriaP1Input(name,values));
++					return;
++				}
++				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++			}
++		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Matice::InputUpdateFromVector(int* vector, int name, int type) {{{*/
++void  Matice::InputUpdateFromVector(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matice::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
++void  Matice::InputUpdateFromVector(bool* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matice::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type) {{{*/
++void  Matice::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
++
++	/*Intermediaries*/
++	Element *element      = NULL;
++	Parameters* parameters= NULL;
++	int         dim;
++
++	/*Recover element*/
++	element=(Element*)helement->delivers();
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	switch(type){
++
++		case VertexEnum:
++
++			switch(element->ObjectEnum()){
++
++				case TriaEnum: {
++					IssmDouble values[3];
++					for (int i=0;i<3;i++) values[i]=vector[((Tria*)element)->nodes[i]->GetSidList()]; //use sid list, to index into serial oriented vector 
++					this->inputs->AddInput(new TriaP1Input(name,values));
++					/*Special case for rheology B in 2D: Pourave land for this solution{{{*/
++					if(name==MaterialsRheologyBEnum){
++						/*Are we in 2D?:*/
++						if(element->ObjectEnum()==TriaEnum){
++							parameters=((Tria*)(element))->parameters;
++						}
++						else{
++							parameters=((Penta*)(element))->parameters;
++						}
++						parameters->FindParam(&dim,MeshDimensionEnum);
++						if(dim==2){
++							/*Dupliacte rheology input: */
++							this->inputs->AddInput(new TriaP1Input(MaterialsRheologyBbarEnum,values));
++						}
++					}
++					/*}}}*/
++					return;
++				}
++				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++			}
++		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++	}
++
++
++
++}
++/*}}}*/
++/*FUNCTION Matice::InputUpdateFromMatrixDakota(int* vector, int name, int type) {{{*/
++void  Matice::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matice::InputUpdateFromVectorDakota(int* vector, int name, int type) {{{*/
++void  Matice::InputUpdateFromVectorDakota(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matice::InputUpdateFromVectorDakota(bool* vector, int name, int type) {{{*/
++void  Matice::InputUpdateFromVectorDakota(bool* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION 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){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matice::InputUpdateFromConstant(bool constant, int name) {{{*/
++void  Matice::InputUpdateFromConstant(bool constant, int name){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matice::InputUpdateFromSolution{{{*/
++void  Matice::InputUpdateFromSolution(IssmDouble* solution){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matice::InputUpdateFromIoModel{{{*/
++void Matice::InputUpdateFromIoModel(int index, IoModel* iomodel){
++
++	int i,j;
++
++	int    dim;
++	bool   control_analysis;
++	int    num_control_type;
++
++	/*Fetch parameters: */
++	iomodel->Constant(&dim,MeshDimensionEnum);
++	iomodel->Constant(&control_analysis,InversionIscontrolEnum);
++	if(control_analysis) iomodel->Constant(&num_control_type,InversionNumControlParametersEnum);
++
++	/*if 2d*/
++	if(dim==2){
++
++		/*Intermediaries*/
++		const int num_vertices = 3; //Tria has 3 vertices
++		IssmDouble    nodeinputs[num_vertices];
++		IssmDouble    cmmininputs[num_vertices];
++		IssmDouble    cmmaxinputs[num_vertices];
++
++		/*Get B*/
++		if (iomodel->Data(MaterialsRheologyBEnum)) {
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
++			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyBbarEnum,nodeinputs));
++		}
++
++		/*Get n*/
++		if (iomodel->Data(MaterialsRheologyNEnum)) {
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyNEnum)[index];
++			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyNEnum,nodeinputs));
++		}
++
++		/*Control Inputs*/
++		#ifdef _HAVE_CONTROL_
++		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
++			for(i=0;i<num_control_type;i++){
++				switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
++					case MaterialsRheologyBbarEnum:
++						if (iomodel->Data(MaterialsRheologyBEnum)){
++							_assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
++							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
++							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							this->inputs->AddInput(new ControlInput(MaterialsRheologyBbarEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++						}
++						break;
++				}
++			}
++		}
++		#endif
++	}
++
++	/*if 3d*/
++	#ifdef _HAVE_3D_
++	else if(dim==3){
++
++		/*Intermediaries*/
++		const int num_vertices = 6; //Penta has 6 vertices
++		IssmDouble    nodeinputs[num_vertices];
++		IssmDouble    cmmininputs[num_vertices];
++		IssmDouble    cmmaxinputs[num_vertices];
++
++		/*Get B*/
++		if (iomodel->Data(MaterialsRheologyBEnum)) {
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
++			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,nodeinputs));
++		}
++
++		/*Get n*/
++		if (iomodel->Data(MaterialsRheologyNEnum)) {
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyNEnum)[index];
++			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyNEnum,nodeinputs));
++		}
++
++		/*Control Inputs*/
++		#ifdef _HAVE_CONTROL_
++		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
++			for(i=0;i<num_control_type;i++){
++				switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
++					case MaterialsRheologyBbarEnum:
++						if (iomodel->Data(MaterialsRheologyBEnum)){
++							_assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
++							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
++							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++						}
++						break;
++				}
++			}
++		}
++		#endif
++	}
++	#endif
++	else{
++		_error2_("Mesh type not supported yet!");
++	}
++
++	return;
++}
++/*}}}*/
++/*FUNCTION Matice::IsInput{{{*/
++bool Matice::IsInput(int name){
++	if (
++				name==MaterialsRheologyBEnum ||
++				name==MaterialsRheologyBbarEnum ||
++				name==MaterialsRheologyNEnum
++		){
++		return true;
++	}
++	else return false;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h	(revision 12822)
+@@ -0,0 +1,27 @@
++/*!\file:  Material.h
++ * \brief abstract class for Material object
++ */ 
++
++
++#ifndef _MATERIAL_H_
++#define _MATERIAL_H_
++
++/*Headers:*/
++/*{{{*/
++class Object;
++#include "../Object.h"
++#include "../../toolkits/toolkits.h"
++/*}}}*/
++
++class Material: public Object,public Update{
++
++	public: 
++		virtual       ~Material(){};
++
++		/*Numerics*/
++		virtual void   InputDuplicate(int original_enum,int new_enum)=0;
++		virtual void   Configure(Elements* elements)=0;
++		virtual void   GetVectorFromInputs(Vector* vector,int input_enum)=0;
++
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp	(revision 12822)
+@@ -0,0 +1,361 @@
++/*!\file Matpar.c
++ * \brief: implementation of the Matpar object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++		
++/*Matpar constructors and destructor*/
++/*FUNCTION Matpar::Matpar() {{{*/
++Matpar::Matpar(){
++	return;
++}
++/*}}}*/
++/*FUNCTION Matpar::Matpar(int matpar_mid,IoModel* iomodel){{{*/
++Matpar::Matpar(int matpar_mid, IoModel* iomodel){
++
++	this->mid = matpar_mid;
++	iomodel->Constant(&this->rho_ice,MaterialsRhoIceEnum);
++	iomodel->Constant(&this->rho_water,MaterialsRhoWaterEnum);
++	iomodel->Constant(&this->rho_freshwater,MaterialsRhoFreshwaterEnum);
++	iomodel->Constant(&this->mu_water,MaterialsMuWaterEnum);
++	iomodel->Constant(&this->heatcapacity,MaterialsHeatcapacityEnum);
++	iomodel->Constant(&this->thermalconductivity,MaterialsThermalconductivityEnum);
++	iomodel->Constant(&this->latentheat,MaterialsLatentheatEnum);
++	iomodel->Constant(&this->beta,MaterialsBetaEnum);
++	iomodel->Constant(&this->meltingpoint,MaterialsMeltingpointEnum);
++	iomodel->Constant(&this->referencetemperature,ConstantsReferencetemperatureEnum);
++	iomodel->Constant(&this->mixed_layer_capacity,MaterialsMixedLayerCapacityEnum);
++	iomodel->Constant(&this->thermal_exchange_velocity,MaterialsThermalExchangeVelocityEnum);
++	iomodel->Constant(&this->g,ConstantsGEnum);
++	
++	iomodel->Constant(&this->hydro_CR,HydrologyCREnum);
++	iomodel->Constant(&this->kn,HydrologyKnEnum);
++	iomodel->Constant(&this->hydro_n,HydrologyNEnum);
++	iomodel->Constant(&this->hydro_p,HydrologyPEnum);
++	iomodel->Constant(&this->hydro_q,HydrologyQEnum);
++}
++/*}}}*/
++/*FUNCTION Matpar::~Matpar() {{{*/
++Matpar::~Matpar(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Matpar::Echo {{{*/
++void Matpar::Echo(void){
++
++	_printLine_("Matpar:");
++	_printLine_("   mid: " << mid);
++	_printLine_("   rho_ice: " << rho_ice);
++	_printLine_("   rho_water: " << rho_water);
++	_printLine_("   rho_freshwater: " << rho_freshwater);
++	_printLine_("   mu_water: " << mu_water);
++	_printLine_("   heatcapacity: " << heatcapacity);
++	_printLine_("   thermalconductivity: " << thermalconductivity);
++	_printLine_("   latentheat: " << latentheat);
++	_printLine_("   beta: " << beta);
++	_printLine_("   meltingpoint: " << meltingpoint);
++	_printLine_("   referencetemperature: " << referencetemperature);
++	_printLine_("   mixed_layer_capacity: " << mixed_layer_capacity);
++	_printLine_("   thermal_exchange_velocity: " << thermal_exchange_velocity);
++	_printLine_("   g: " << g);
++	return;
++}
++/*}}}*/
++/*FUNCTION Matpar::DeepEcho {{{*/
++void Matpar::DeepEcho(void){
++
++	this->Echo();
++}		
++/*}}}*/
++/*FUNCTION Matpar::Id {{{*/
++int    Matpar::Id(void){ return mid; }
++/*}}}*/
++/*FUNCTION Matpar::MyRank {{{*/
++int    Matpar::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Matpar::ObjectEnum{{{*/
++int Matpar::ObjectEnum(void){
++
++	return MatparEnum;
++
++}
++/*}}}*/
++/*FUNCTION 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){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matpar::InputUpdateFromVector(int* vector, int name, int type) {{{*/
++void   Matpar::InputUpdateFromVector(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matpar::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
++void   Matpar::InputUpdateFromVector(bool* 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){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matpar::InputUpdateFromVectorDakota(int* vector, int name, int type) {{{*/
++void   Matpar::InputUpdateFromVectorDakota(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matpar::InputUpdateFromVectorDakota(bool* vector, int name, int type) {{{*/
++void   Matpar::InputUpdateFromVectorDakota(bool* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matpar::InputUpdateFromMatrixDakota(int* vector, 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){
++
++	switch(name){
++		case MaterialsRhoIceEnum:
++			this->rho_ice=constant;
++			break;
++		case MaterialsRhoWaterEnum:
++			this->rho_water=constant;
++			break;
++		case MaterialsRhoFreshwaterEnum:
++			this->rho_freshwater=constant;
++			break;
++		case MaterialsMuWaterEnum:
++			this->mu_water=constant;
++			break;
++		case MaterialsHeatcapacityEnum:
++			this->heatcapacity=constant;
++			break;
++		case MaterialsThermalconductivityEnum:
++			this->thermalconductivity=constant;
++			break;
++		case  MaterialsLatentheatEnum:
++			this->latentheat=constant;
++			break;
++		case  MaterialsBetaEnum:
++			this->beta=constant;
++			break;
++		case  MaterialsMeltingpointEnum:
++			this->meltingpoint=constant;
++			break;
++		case  ConstantsReferencetemperatureEnum:
++			this->referencetemperature=constant;
++			break;
++		case  MaterialsMixedLayerCapacityEnum:
++			this->mixed_layer_capacity=constant;
++			break;
++		case  MaterialsThermalExchangeVelocityEnum:
++			this->thermalconductivity=constant;
++			break;
++		case  ConstantsGEnum:
++			this->g=constant;
++			break;
++		default: 
++			break;
++	}
++
++}
++/*}}}*/
++/*FUNCTION 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){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matpar::InputUpdateFromSolution{{{*/
++void   Matpar::InputUpdateFromSolution(IssmDouble* solution){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++
++/*Matpar management: */
++/*FUNCTION Matpar::Configure {{{*/
++void  Matpar::Configure(Elements* elementsin){
++
++	/*nothing done yet!*/
++
++}
++/*}}}*/
++/*FUNCTION Matpar::GetBeta {{{*/
++IssmDouble Matpar::GetBeta(){
++	return beta;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetG {{{*/
++IssmDouble Matpar::GetG(){
++	return g;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetHeatCapacity {{{*/
++IssmDouble Matpar::GetHeatCapacity(){
++	return heatcapacity;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetLatentHeat {{{*/
++IssmDouble Matpar::GetLatentHeat(){
++	return latentheat;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetMeltingPoint {{{*/
++IssmDouble Matpar::GetMeltingPoint(){
++	return meltingpoint;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetReferenceTemperature {{{*/
++IssmDouble Matpar::GetReferenceTemperature(){
++	return referencetemperature;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetMixedLayerCapacity {{{*/
++IssmDouble Matpar::GetMixedLayerCapacity(){
++	return mixed_layer_capacity;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetRhoIce {{{*/
++IssmDouble Matpar::GetRhoIce(){
++	
++	return rho_ice;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetRhoWater {{{*/
++IssmDouble Matpar::GetRhoWater(){
++	return rho_water;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetRhoFreshwater {{{*/
++IssmDouble Matpar::GetRhoFreshwater(){
++	return rho_freshwater;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetMuWater {{{*/
++IssmDouble Matpar::GetMuWater(){
++	return mu_water;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetThermalConductivity {{{*/
++IssmDouble Matpar::GetThermalConductivity(){
++	return thermalconductivity;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetThermalExchangeVelocity {{{*/
++IssmDouble Matpar::GetThermalExchangeVelocity(){
++	return thermal_exchange_velocity;
++}
++/*}}}*/
++/*FUNCTION Matpar::GetKn {{{*/		 
++IssmDouble Matpar::GetKn(){			 
++	return kn;		 
++}		 
++/*}}}*/			 
++/*FUNCTION Matpar::GetHydrologyP {{{*/			 
++IssmDouble Matpar::GetHydrologyP(){		 
++	return hydro_p;			 
++}		 
++/*}}}*/			 
++/*FUNCTION Matqar::GetHydrologyQ {{{*/			 
++IssmDouble Matpar::GetHydrologyQ(){		 
++	return hydro_q;			 
++}		 
++/*}}}*/			 
++/*FUNCTION Matpar::GetHydrologyCR {{{*/		 
++IssmDouble Matpar::GetHydrologyCR(){		 
++	return hydro_CR;		 
++}		 
++/*}}}*/			 
++/*FUNCTION Matpar::GetHydrologyN {{{*/			 
++IssmDouble Matpar::GetHydrologyN(){		 
++	return hydro_n;			 
++}		 
++/*}}}*/ 
++/*FUNCTION Matpar::TMeltingPoint {{{*/
++IssmDouble Matpar::TMeltingPoint(IssmDouble pressure){
++	return meltingpoint-beta*pressure;
++}
++/*}}}*/
++/*FUNCTION Matpar::PureIceEnthalpy{{{*/
++IssmDouble Matpar::PureIceEnthalpy(IssmDouble pressure){
++	return heatcapacity*(TMeltingPoint(pressure)-referencetemperature);
++}
++/*}}}*/
++/*FUNCTION Matpar::GetEnthalpyDiffusionParameter{{{*/
++IssmDouble Matpar::GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){
++	if(enthalpy<PureIceEnthalpy(pressure)){
++		return thermalconductivity/(rho_ice*heatcapacity);
++	}
++	else{
++		return 0.1*thermalconductivity/(rho_ice*heatcapacity);
++	}
++}
++/*}}}*/
++/*FUNCTION Matpar::EnthalpyToThermal {{{*/
++void Matpar::EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){
++
++	/*Ouput*/
++	IssmDouble temperature,waterfraction;
++	
++	if(enthalpy<PureIceEnthalpy(pressure)){
++		temperature=referencetemperature+enthalpy/heatcapacity;
++		waterfraction=0;
++	}
++	else{
++		temperature=TMeltingPoint(pressure);
++		waterfraction=(enthalpy-PureIceEnthalpy(pressure))/latentheat;
++	}
++
++	/*Assign output pointers:*/
++	*pwaterfraction=waterfraction;
++	*ptemperature=temperature;
++}
++/*}}}*/
++/*FUNCTION Matpar::ThermalToEnthalpy {{{*/
++void Matpar::ThermalToEnthalpy(IssmDouble * penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){
++
++	/*Ouput*/
++	IssmDouble enthalpy;
++	
++	if(temperature<TMeltingPoint(pressure)){
++		enthalpy=heatcapacity*(temperature-referencetemperature);
++	}
++	else{
++		enthalpy=PureIceEnthalpy(pressure)+latentheat*waterfraction;
++	}
++
++	/*Assign output pointers:*/
++	*penthalpy=enthalpy;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h	(revision 12822)
+@@ -0,0 +1,74 @@
++/*!\file Matice.h
++ * \brief: header file for matice object
++ */
++
++#ifndef MATICE_H_
++#define MATICE_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Material.h"
++class IoModel;
++/*}}}*/
++
++class Matice: public Material{
++
++	private: 
++		/*Id*/
++		int	   mid;
++
++		/*hooks: */
++		Hook* helement;
++
++	public:
++		/*WARNING: input should not be public but it is an easy way to update B from T (using UpdateFromSolution) from Pentas*/
++		Inputs*  inputs;
++
++		/*Matice constructors, destructors: {{{*/
++		Matice();
++		Matice(int mid,int i, IoModel* iomodel);
++		~Matice();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Update virtual functions definitions: {{{*/
++		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVector(int* vector, int name, int type);
++		void  InputUpdateFromVector(bool* 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);
++		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
++		void  InputUpdateFromConstant(IssmDouble constant, int name);
++		void  InputUpdateFromConstant(int constant, int name);
++		void  InputUpdateFromConstant(bool constant, int name);
++		void  InputUpdateFromSolution(IssmDouble* solution);
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel);
++		/*}}}*/
++		/*Material virtual functions resolution: {{{*/
++		void   InputDuplicate(int original_enum,int new_enum);
++		void   Configure(Elements* elements);
++		void   GetVectorFromInputs(Vector* vector,int input_enum);
++		/*}}}*/
++		/*Matice Numerics: {{{*/
++		void   SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
++		void   GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
++		void   GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon);
++		void   GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon);
++		void   GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
++		void   GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
++		void   GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
++		IssmDouble GetB();
++		IssmDouble GetBbar();
++		IssmDouble GetN();
++		bool   IsInput(int name);
++		/*}}}*/
++};
++
++#endif  /* _MATICE_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 12822)
+@@ -0,0 +1,99 @@
++/*!\file Matpar.h
++ * \brief: header file for matpar object
++ */
++
++#ifndef _MATPAR_H_
++#define _MATPAR_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Material.h"
++class IoModel;
++/*}}}*/
++
++class Matpar: public Material{
++
++	private: 
++		int	  mid;
++		IssmDouble  rho_ice; 
++		IssmDouble  rho_water;
++		IssmDouble  rho_freshwater;
++		IssmDouble  mu_water;
++		IssmDouble  heatcapacity;
++		IssmDouble  thermalconductivity;
++		IssmDouble  latentheat;
++		IssmDouble  beta;
++		IssmDouble  meltingpoint;
++		IssmDouble  referencetemperature;
++		IssmDouble  mixed_layer_capacity;
++		IssmDouble  thermal_exchange_velocity;
++		IssmDouble  g;
++
++		/*hydrology: */		 
++		IssmDouble  kn;			 
++		IssmDouble  hydro_p;		 
++		IssmDouble  hydro_q;		 
++		IssmDouble  hydro_CR;			 
++		IssmDouble  hydro_n; 
++
++	public:
++		Matpar();
++		Matpar(int matpar_id, IoModel* iomodel);
++		~Matpar();
++
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Update virtual functions resolution: {{{*/
++		void   InputUpdateFromVector(IssmDouble* vector, int name, int type);
++		void   InputUpdateFromVector(int* vector, int name, int type);
++		void   InputUpdateFromVector(bool* vector, int name, int type);
++		void   InputUpdateFromMatrixDakota(IssmDouble* matrix,int nrows,int ncols, int name, int type);
++		void   InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
++		void   InputUpdateFromVectorDakota(int* vector, int name, int type);
++		void   InputUpdateFromVectorDakota(bool* vector, int name, int type);
++		void   InputUpdateFromConstant(IssmDouble constant, int name);
++		void   InputUpdateFromConstant(int constant, int name);
++		void   InputUpdateFromConstant(bool constant, int name);
++		void   InputUpdateFromSolution(IssmDouble* solution);
++		void   InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		/*}}}*/
++		/*Material virtual functions resolution: {{{*/
++		void   InputDuplicate(int original_enum,int new_enum){_error2_("not implemented yet");};
++		void   Configure(Elements* elements);
++		void   GetVectorFromInputs(Vector* vector,int input_enum){return;}
++		/*}}}*/
++		/*Numerics: {{{*/
++		IssmDouble GetG();
++		IssmDouble GetRhoIce();
++		IssmDouble GetRhoWater();
++		IssmDouble GetRhoFreshwater();
++		IssmDouble GetMuWater();
++		IssmDouble GetMixedLayerCapacity();
++		IssmDouble GetThermalExchangeVelocity();
++		IssmDouble GetHeatCapacity();
++		IssmDouble GetThermalConductivity();
++		IssmDouble GetLatentHeat();
++		IssmDouble GetBeta();
++		IssmDouble GetMeltingPoint();
++		IssmDouble GetReferenceTemperature();
++		IssmDouble GetKn();
++		IssmDouble GetHydrologyP();
++		IssmDouble GetHydrologyQ();
++		IssmDouble GetHydrologyCR();
++		IssmDouble GetHydrologyN();
++		IssmDouble TMeltingPoint(IssmDouble pressure);
++		IssmDouble PureIceEnthalpy(IssmDouble pressure);
++		IssmDouble GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure);
++		void   EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
++		void   ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
++		/*}}}*/
++
++};
++
++#endif  /* _MATPAR_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 12822)
+@@ -0,0 +1,84 @@
++/*! \file DoubleInput.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _DOUBLEINPUT_H_
++#define _DOUBLEINPUT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Input.h"
++#include "../../include/include.h"
++class GaussTria;
++/*}}}*/
++
++class DoubleInput: public Input{
++
++	public:
++		int    enum_type;
++		IssmDouble value;
++
++		/*DoubleInput constructors, destructors: {{{*/
++		DoubleInput();
++		DoubleInput(int enum_type,IssmDouble value);
++		~DoubleInput();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*DoubleInput management: {{{*/
++		int   InstanceEnum();
++		Input* SpawnTriaInput(int* indices);
++		Input* PointwiseDivide(Input* inputB);
++		Input* PointwiseMin(Input* inputB);
++		Input* PointwiseMax(Input* inputB);
++		ElementResult* SpawnResult(int step, IssmDouble time);
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void Configure(Parameters* parameters);
++		/*}}}*/
++		/*numerics: {{{*/
++		void GetInputValue(bool* pvalue);
++		void GetInputValue(int* pvalue);
++		void GetInputValue(IssmDouble* pvalue);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetInputAverage(IssmDouble* pvalue);
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss);
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss);
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
++		void ChangeEnum(int newenumtype);
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
++		void ConstrainMin(IssmDouble minimum);
++		void Scale(IssmDouble scale_factor);
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar);
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
++		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
++		IssmDouble Max(void);
++		IssmDouble MaxAbs(void);
++		IssmDouble Min(void);
++		IssmDouble MinAbs(void);
++		void Extrude(void){_error2_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input);
++		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
++		/*}}}*/
++
++};
++#endif  /* _DOUBLEINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 12822)
+@@ -0,0 +1,282 @@
++/*!\file ControlInput.c
++ * \brief: implementation of the ControlInput object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*ControlInput constructors and destructor*/
++/*FUNCTION ControlInput::ControlInput(){{{*/
++ControlInput::ControlInput(){
++	control_id  = 0;
++	values      = NULL;
++	savedvalues = NULL;
++	minvalues   = NULL;
++	maxvalues   = NULL;
++	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){
++
++	control_id=id;
++	enum_type=in_enum_type;
++
++	switch(enum_input){
++		case TriaP1InputEnum:
++			values     =new TriaP1Input(enum_type,pvalues);
++			savedvalues=new TriaP1Input(enum_type,pvalues);
++			minvalues  =new TriaP1Input(enum_type,pmin);
++			maxvalues  =new TriaP1Input(enum_type,pmax);
++			break;
++		case PentaP1InputEnum:
++			values     =new PentaP1Input(enum_type,pvalues);
++			savedvalues=new PentaP1Input(enum_type,pvalues);
++			minvalues  =new PentaP1Input(enum_type,pmin);
++			maxvalues  =new PentaP1Input(enum_type,pmax);
++			break;
++		default:
++			_error2_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput");
++	}
++	gradient   =NULL;
++}
++/*}}}*/
++/*FUNCTION ControlInput::~ControlInput(){{{*/
++ControlInput::~ControlInput(){
++	delete values;
++	delete savedvalues;
++	delete minvalues;
++	delete maxvalues;
++	delete gradient;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++		/*FUNCTION ControlInput::Echo {{{*/
++void ControlInput::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION ControlInput::DeepEcho{{{*/
++void ControlInput::DeepEcho(void){
++
++	_printLine_("ControlInput:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("---values: ");     if (values)      values->Echo();
++	_printLine_("---savedvalues: ");if (savedvalues) savedvalues->Echo();
++	_printLine_("---minvalues: ");  if (minvalues)   minvalues->Echo();
++	_printLine_("---maxvalues: ");  if (maxvalues)   maxvalues->Echo();
++	_printLine_("---gradient: ");   if (gradient)    gradient->Echo();
++}
++/*}}}*/
++/*FUNCTION ControlInput::Id{{{*/
++int    ControlInput::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION ControlInput::MyRank{{{*/
++int    ControlInput::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION ControlInput::ObjectEnum{{{*/
++int ControlInput::ObjectEnum(void){
++
++	return ControlInputEnum;
++
++}
++/*}}}*/
++/*FUNCTION ControlInput::copy{{{*/
++Object* ControlInput::copy() {
++	
++	ControlInput* output=NULL;
++
++	output = new ControlInput();
++	output->enum_type=this->enum_type;
++	output->control_id=this->control_id;
++
++	if(values)      output->values=(Input*)this->values->copy();
++	if(savedvalues) output->savedvalues=(Input*)this->savedvalues->copy();
++	if(minvalues)   output->minvalues=(Input*)this->minvalues->copy();
++	if(maxvalues)   output->maxvalues=(Input*)this->maxvalues->copy();
++	if(gradient)    output->gradient=(Input*)this->gradient->copy();
++
++	return output;
++}
++/*}}}*/
++	
++/*ControlInput management*/
++/*FUNCTION ControlInput::InstanceEnum{{{*/
++int ControlInput::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++
++/*Object functions*/
++/*FUNCTION ControlInput::Constrain(){{{*/
++void ControlInput::Constrain(void){
++
++	Input* newvalues=NULL;
++
++	newvalues=this->values->PointwiseMin(maxvalues);
++	delete values; this->values=newvalues;
++	newvalues=this->values->PointwiseMax(minvalues);
++	delete values; this->values=newvalues;
++}/*}}}*/
++/*FUNCTION ControlInput::Constrain(IssmDouble min, IssmDouble max){{{*/
++void ControlInput::Constrain(IssmDouble min, IssmDouble max){
++	   values->Constrain(min,max);
++}/*}}}*/
++/*FUNCTION ControlInput::Extrude{{{*/
++void ControlInput::Extrude(void){
++	values->Extrude();
++	savedvalues->Extrude();
++	//gradient->Extrude();
++}/*}}}*/
++/*FUNCTION ControlInput::GetGradient{{{*/
++void ControlInput::GetGradient(Vector* gradient_vec,int* doflist){
++	if(gradient) gradient->GetVectorFromInputs(gradient_vec,doflist);
++}/*}}}*/
++/*FUNCTION ControlInput::ScaleGradient{{{*/
++void ControlInput::ScaleGradient(IssmDouble scaling_factor){
++	if(!gradient) _error2_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");
++	gradient->Scale(scaling_factor);
++}/*}}}*/
++/*FUNCTION ControlInput::SetGradient{{{*/
++void ControlInput::SetGradient(Input* gradient_in){
++
++	/*Get enum for current gradient*/
++	switch(this->control_id){
++		case 1:
++			gradient_in->ChangeEnum(Gradient1Enum);
++			break;
++		case 2:
++			gradient_in->ChangeEnum(Gradient2Enum);
++			break;
++		case 3:
++			gradient_in->ChangeEnum(Gradient3Enum);
++			break;
++		default:
++			_error2_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated.");
++	}
++
++	/*Delete old gradient and assign new gradient*/
++	if(gradient) delete gradient;
++	gradient=gradient_in;
++
++}/*}}}*/
++/*FUNCTION ControlInput::SetInput{{{*/
++void ControlInput::SetInput(Input* in_input){
++
++	delete values; this->values=in_input;
++	this->SaveValue(); //because this is what SpawnResult saves FIXME
++
++}/*}}}*/
++/*FUNCTION ControlInput::SpawnResult{{{*/
++ElementResult* ControlInput::SpawnResult(int step, IssmDouble time){
++	return savedvalues->SpawnResult(step,time);
++}/*}}}*/
++/*FUNCTION ControlInput::SpawnTriaInput{{{*/
++Input* ControlInput::SpawnTriaInput(int* indices){
++	return values->SpawnTriaInput(indices);
++}/*}}}*/
++/*FUNCTION ControlInput::SpawnGradient{{{*/
++ElementResult* ControlInput::SpawnGradient(int step, IssmDouble time){
++	_assert_(gradient);
++	return gradient->SpawnResult(step,time);
++}/*}}}*/
++/*FUNCTION ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){{{*/
++void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){
++	values->GetVectorFromInputs(vector,doflist);
++}/*}}}*/
++/*FUNCTION ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){{{*/
++void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){
++	 if(strcmp(data,"value")==0){
++		 _assert_(values);
++		 values->GetVectorFromInputs(vector,doflist);
++	 }
++	 else if (strcmp(data,"lowerbound")==0){
++		 _assert_(minvalues);
++		 minvalues->GetVectorFromInputs(vector,doflist);
++	 }
++	 else if (strcmp(data,"upperbound")==0){
++		 _assert_(maxvalues);
++		 maxvalues->GetVectorFromInputs(vector,doflist);
++	 }
++	 else if (strcmp(data,"gradient")==0){
++		 _assert_(gradient);
++		 gradient->GetVectorFromInputs(vector,doflist);
++	 }
++	 else{
++		 _error2_("Data " << data << " not supported yet");
++	 }
++}/*}}}*/
++/*FUNCTION ControlInput::GetInputAverage(IssmDouble* pvalue){{{*/
++void ControlInput::GetInputAverage(IssmDouble* pvalue){
++	values->GetInputAverage(pvalue);
++}/*}}}*/
++/*FUNCTION ControlInput::GetInputValue(bool* pvalue){{{*/
++void ControlInput::GetInputValue(bool* pvalue){
++	values->GetInputValue(pvalue);
++}/*}}}*/
++/*FUNCTION ControlInput::GetInputValue(int* pvalue){{{*/
++void ControlInput::GetInputValue(int* pvalue){
++	values->GetInputValue(pvalue);
++}/*}}}*/
++/*FUNCTION ControlInput::GetInputValue(IssmDouble* pvalue){{{*/
++void ControlInput::GetInputValue(IssmDouble* pvalue){
++	values->GetInputValue(pvalue);
++}/*}}}*/
++/*FUNCTION ControlInput::GetInputValue(IssmDouble* pvalue){{{*/
++void ControlInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){
++	values->GetInputValue(pvalue,gauss);
++}/*}}}*/
++/*FUNCTION ControlInput::GetInputValue(IssmDouble* pvalue){{{*/
++void ControlInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){
++	values->GetInputValue(pvalue,gauss);
++}/*}}}*/
++/*FUNCTION ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
++void ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){
++	values->GetInputDerivativeValue(derivativevalues,xyz_list,gauss);
++}/*}}}*/
++/*FUNCTION ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
++void ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){
++	values->GetInputDerivativeValue(derivativevalues,xyz_list,gauss);
++}/*}}}*/
++/*FUNCTION ControlInput::SaveValue{{{*/
++void ControlInput::SaveValue(void){
++	if(!values) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
++
++	if(savedvalues) delete this->savedvalues;
++	this->savedvalues=(Input*)this->values->copy();
++}/*}}}*/
++/*FUNCTION ControlInput::UpdateValue{{{*/
++void ControlInput::UpdateValue(IssmDouble scalar){
++	if(!gradient)    _error2_("Gradient of " << EnumToStringx(this->enum_type) << " not found");
++	if(!savedvalues) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
++
++	if(values) delete this->values;
++	this->values=(Input*)this->savedvalues->copy();
++	this->values->AXPY(gradient,scalar);
++}/*}}}*/
++/*FUNCTION ControlInput::VerticallyIntegrate{{{*/
++void ControlInput::VerticallyIntegrate(Input* thickness_input){
++	values->VerticallyIntegrate(thickness_input);
++}/*}}}*/
++/*FUNCTION ControlInput::Configure{{{*/
++void ControlInput::Configure(Parameters* parameters){
++	/*do nothing: */
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/Input.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/Input.h	(revision 12822)
+@@ -0,0 +1,69 @@
++/*!\file:  Input.h
++ * \brief abstract class for Input object
++ */ 
++
++
++#ifndef _INPUT_H_
++#define _INPUT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Object.h"
++class Node;
++class ElementResult;
++class GaussTria;
++class Parameters;
++/*}}}*/
++
++class Input: public Object{
++
++	public: 
++		
++		virtual        ~Input(){};
++
++		virtual int  InstanceEnum()=0; 
++		virtual void GetInputValue(bool* pvalue)=0;
++		virtual void GetInputValue(int* pvalue)=0;
++		virtual void GetInputValue(IssmDouble* pvalue)=0;
++		virtual void GetInputValue(IssmDouble* pvalue,GaussTria* gauss)=0;
++		virtual void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss)=0;
++		virtual void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time)=0;
++		virtual void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time)=0;
++		virtual void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index)=0;
++		virtual void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index)=0;
++		virtual void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss)=0;
++		virtual void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss)=0;
++		virtual void GetInputAverage(IssmDouble* pvalue)=0;
++		virtual void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss)=0;
++		virtual void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss)=0;
++		virtual void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss)=0;
++		virtual void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss)=0;
++		virtual void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss)=0;
++		virtual void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss)=0;
++		virtual void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss)=0;
++		virtual void ChangeEnum(int newenumtype)=0;
++		virtual void Configure(Parameters* parameters)=0;
++
++		virtual void   SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters)=0;
++		virtual void   ConstrainMin(IssmDouble minimum)=0;
++		virtual IssmDouble InfinityNorm(void)=0;
++		virtual IssmDouble MaxAbs(void)=0;
++		virtual IssmDouble MinAbs(void)=0;
++		virtual IssmDouble Max(void)=0;
++		virtual IssmDouble Min(void)=0;
++		virtual void   Scale(IssmDouble scale_factor)=0;
++		virtual void   ArtificialNoise(IssmDouble min,IssmDouble max)=0;
++		virtual void   AXPY(Input* xinput,IssmDouble scalar)=0;
++		virtual void   Constrain(IssmDouble cm_min, IssmDouble cm_max)=0;
++		virtual void   VerticallyIntegrate(Input* thickness_input)=0;
++		virtual void   Extrude()=0;
++		virtual void   GetVectorFromInputs(Vector* vector,int* doflist)=0;
++		virtual void   GetValuesPtr(IssmDouble** pvalues,int* pnum_values)=0;
++		
++		virtual Input* SpawnTriaInput(int* indices)=0;
++		virtual Input* PointwiseDivide(Input* inputB)=0;
++		virtual Input* PointwiseMax(Input* inputmax)=0;
++		virtual Input* PointwiseMin(Input* inputmin)=0;
++		virtual ElementResult* SpawnResult(int step, IssmDouble time)=0;
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 12822)
+@@ -0,0 +1,98 @@
++/*! \file ControlInput.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _CONTROLINPUT_H_
++#define _CONTROLINPUT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Input.h"
++#include "../../include/include.h"
++class GaussTria;
++/*}}}*/
++
++class ControlInput: public Input{
++
++	public:
++		int    enum_type;
++		int    control_id;
++		Input* values;
++		Input* savedvalues;
++		Input* minvalues;
++		Input* maxvalues;
++		Input* gradient;
++
++		/*ControlInput constructors, destructors: {{{*/
++		ControlInput();
++		ControlInput(int enum_type,int enum_input,IssmDouble* pvalues,IssmDouble* pmin,IssmDouble* pmax,int id);
++		~ControlInput();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ControlInput management: {{{*/
++		int    InstanceEnum();
++		Input* SpawnTriaInput(int* indices);
++		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		ElementResult* SpawnResult(int step, IssmDouble time);
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void Configure(Parameters* parameters);
++		/*}}}*/
++		/*numerics: {{{*/
++		void SetInput(Input* in_input);
++		void GetInputValue(bool* pvalue);
++		void GetInputValue(int* pvalue);
++		void GetInputValue(IssmDouble* pvalue);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetInputAverage(IssmDouble* pvalue);
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void ChangeEnum(int newenumtype){_error2_("not implemented yet");};
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error2_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar){_error2_("not implemented yet");};
++		void Constrain(void);
++		void Constrain(IssmDouble min,IssmDouble max);
++		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
++		IssmDouble Max(void){_error2_("not implemented yet");};
++		IssmDouble MaxAbs(void){_error2_("not implemented yet");};
++		IssmDouble Min(void){_error2_("not implemented yet");};
++		IssmDouble MinAbs(void){_error2_("not implemented yet");};
++		void Extrude(void);
++		void VerticallyIntegrate(Input* thickness_input);
++		void GetVectorFromInputs(Vector* vector,int* doflist,const char* data);
++		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not implemented yet");};
++		ElementResult* SpawnGradient(int step, IssmDouble time);
++		void GetGradient(Vector* gradient_vec,int* doflist);
++		void ScaleGradient(IssmDouble scale);
++		void SetGradient(Input* gradient_in);
++		void UpdateValue(IssmDouble scalar);
++		void SaveValue(void);
++		/*}}}*/
++
++};
++#endif  /* _CONTROLINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp	(revision 12822)
+@@ -0,0 +1,122 @@
++/*!\file DatasetInput.c
++ * \brief: implementation of the datasetinput object
++ */
++/*Headers{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*DatasetInput constructors and destructor*/
++/*FUNCTION DatasetInput::DatasetInput(){{{*/
++DatasetInput::DatasetInput(){
++	enum_type=UNDEF;
++	inputs=NULL;
++}
++/*}}}*/
++/*FUNCTION DatasetInput::DatasetInput(int in_enum_type) {{{*/
++DatasetInput::DatasetInput(int in_enum_type){
++
++	enum_type  = in_enum_type;
++	inputs     = new Inputs();
++}
++/*}}}*/
++/*FUNCTION DatasetInput::~DatasetInput(){{{*/
++DatasetInput::~DatasetInput(){
++	delete inputs;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++		/*FUNCTION DatasetInput::Echo {{{*/
++void DatasetInput::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION DatasetInput::DeepEcho{{{*/
++void DatasetInput::DeepEcho(void){
++
++	_printLine_("DatasetInput:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("---inputs: "); inputs->Echo();
++}
++/*}}}*/
++/*FUNCTION DatasetInput::Id{{{*/
++int    DatasetInput::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION DatasetInput::MyRank{{{*/
++int    DatasetInput::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION DatasetInput::ObjectEnum{{{*/
++int DatasetInput::ObjectEnum(void){
++
++	return DatasetInputEnum;
++
++}
++/*}}}*/
++/*FUNCTION DatasetInput::copy{{{*/
++Object* DatasetInput::copy() {
++	
++	DatasetInput* output=NULL;
++
++	output = new DatasetInput();
++	output->enum_type=this->enum_type;
++	output->inputs=(Inputs*)this->inputs->Copy();
++
++	return output;
++}
++/*}}}*/
++/*FUNCTION DatasetInput::SpawnTriaInput{{{*/
++Input* DatasetInput::SpawnTriaInput(int* indices){
++
++	/*output*/
++	DatasetInput* outinput=NULL;
++
++	/*Create new Datasetinput (copy of current input)*/
++	outinput=new DatasetInput();
++	outinput->enum_type=this->enum_type;
++	outinput->inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices);
++
++	/*Assign output*/
++	return outinput;
++}
++/*}}}*/
++	
++/*DatasetInput management*/
++/*FUNCTION DatasetInput::InstanceEnum{{{*/
++int DatasetInput::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++
++/*Object functions*/
++/*FUNCTION DatasetInput::Configure{{{*/
++void DatasetInput::Configure(Parameters* parameters){
++	/*do nothing: */
++}
++/*}}}*/
++/*FUNCTION DatasetInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int index){{{*/
++void DatasetInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int index){
++
++	/*Get requested input within dataset*/
++	if(index<0 || index > inputs->Size()-1) _error2_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");
++	Input* input=(Input*)this->inputs->GetObjectByOffset(index);
++	
++	input->GetInputValue(pvalue,gauss);
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 12822)
+@@ -0,0 +1,92 @@
++/*! \file DatasetInput.h 
++ *  \brief: header file for datasetinput object
++ */
++
++
++#ifndef _DATASETINPUT_H_
++#define _DATASETINPUT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Input.h"
++#include "../../include/include.h"
++class GaussTria;
++/*}}}*/
++
++class DatasetInput: public Input{
++
++	public:
++		int    enum_type;
++
++		Inputs*     inputs;
++
++		/*DatasetInput constructors, destructors: {{{*/
++		DatasetInput();
++		DatasetInput(int enum_type);
++		~DatasetInput();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id();
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*DatasetInput management: {{{*/
++		int    InstanceEnum();
++		Input* SpawnTriaInput(int* indices);
++		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		ElementResult* SpawnResult(int step, IssmDouble time){_error2_("not implemented yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void Configure(Parameters* parameters);
++		/*}}}*/
++		/*numerics: {{{*/
++		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void ChangeEnum(int newenumtype){_error2_("not implemented yet");};
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error2_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar){_error2_("not implemented yet");};
++		void Constrain(void){_error2_("not implemented yet");};
++		void Constrain(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
++		IssmDouble Max(void){_error2_("not implemented yet");};
++		IssmDouble MaxAbs(void){_error2_("not implemented yet");};
++		IssmDouble Min(void){_error2_("not implemented yet");};
++		IssmDouble MinAbs(void){_error2_("not implemented yet");};
++		void Extrude(void){_error2_("not implemented yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error2_("not implemented yet");};
++		void GetVectorFromInputs(Vector* vector,int* doflist){_error2_("not implemented yet");};
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not implemented yet");};
++		ElementResult* SpawnGradient(int step, IssmDouble time){_error2_("not implemented yet");};
++		void GetGradient(Vector* gradient_vec,int* doflist){_error2_("not implemented yet");};
++		void ScaleGradient(IssmDouble scale){_error2_("not implemented yet");};
++		void SetGradient(Input* gradient_in){_error2_("not implemented yet");};
++		void UpdateValue(IssmDouble scalar){_error2_("not implemented yet");};
++		void SaveValue(void){_error2_("not implemented yet");};
++		/*}}}*/
++
++};
++#endif  /* _DATASETINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 12822)
+@@ -0,0 +1,199 @@
++/*!\file IntInput.c
++ * \brief: implementation of the IntInput object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*IntInput constructors and destructor*/
++/*FUNCTION IntInput::IntInput(){{{*/
++IntInput::IntInput(){
++	return;
++}
++/*}}}*/
++/*FUNCTION IntInput::IntInput(IssmDouble* values){{{*/
++IntInput::IntInput(int in_enum_type,IssmInt in_value){
++
++	enum_type=in_enum_type;
++	value=in_value;
++}
++/*}}}*/
++/*FUNCTION IntInput::~IntInput(){{{*/
++IntInput::~IntInput(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION IntInput::DeepEcho{{{*/
++void IntInput::DeepEcho(void){
++
++	_printLine_("IntInput:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " << (int)this->value);
++}
++/*}}}*/
++/*FUNCTION IntInput::Id{{{*/
++int    IntInput::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION IntInput::MyRank{{{*/
++int    IntInput::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION IntInput::ObjectEnum{{{*/
++int IntInput::ObjectEnum(void){
++
++	return IntInputEnum;
++
++}
++/*}}}*/
++/*FUNCTION IntInput::copy{{{*/
++Object* IntInput::copy() {
++	
++	return new IntInput(this->enum_type,this->value);
++
++}
++/*}}}*/
++
++/*IntInput management*/
++/*FUNCTION IntInput::Echo {{{*/
++void IntInput::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION IntInput::InstanceEnum{{{*/
++int IntInput::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++/*FUNCTION IntInput::SpawnTriaInput{{{*/
++Input* IntInput::SpawnTriaInput(int* indices){
++
++	/*output*/
++	IntInput* outinput=new IntInput();
++
++	/*only copy current value*/
++	outinput->enum_type=this->enum_type;
++	outinput->value=this->value;
++
++	/*Assign output*/
++	return outinput;
++}
++/*}}}*/
++/*FUNCTION IntInput::SpawnResult{{{*/
++ElementResult* IntInput::SpawnResult(int step, IssmDouble time){
++	
++	_error2_("not supported yet!");
++
++}
++/*}}}*/
++
++/*Object functions*/
++/*FUNCTION IntInput::GetInputValue(bool* pvalue) {{{*/
++void IntInput::GetInputValue(bool* pvalue){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION IntInput::GetInputValue(int* pvalue){{{*/
++void IntInput::GetInputValue(int* pvalue){
++	*pvalue=value;
++}
++/*}}}*/
++/*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue){{{*/
++void IntInput::GetInputValue(IssmDouble* pvalue){
++	_error2_("IntInput cannot return a IssmDouble in parallel");
++}
++/*}}}*/
++/*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
++void IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
++void IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
++void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
++void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION IntInput::ChangeEnum{{{*/
++void IntInput::ChangeEnum(int newenumtype){
++	this->enum_type=newenumtype;
++}
++/*}}}*/
++/*FUNCTION IntInput::SquareMin{{{*/
++void IntInput::SquareMin(IssmDouble* psquaremin, bool process_units,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){
++	IssmDouble dvalue=(IssmDouble)value*scale_factor;
++	value=reCast<int>(dvalue);
++}
++/*}}}*/
++/*FUNCTION IntInput::AXPY{{{*/
++void IntInput::AXPY(Input* xinput,IssmDouble scalar){
++
++	IssmDouble dvalue;
++	IntInput*  xintinput=NULL;
++
++	/*xinput is of the same type, so cast it: */
++	xintinput=(IntInput*)xinput;
++
++	/*Carry out the AXPY operation depending on type:*/
++	switch(xinput->ObjectEnum()){
++
++		case IntInputEnum:
++			dvalue=(IssmDouble)this->value+scalar*(IssmDouble)xintinput->value;
++			this->value=reCast<int>(dvalue);
++			return;
++
++		default:
++			_error2_("not implemented yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION IntInput::Constrain{{{*/
++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* vector,int* doflist){
++
++	_error2_("not supporte yet!");
++
++}
++/*}}}*/
++/*FUNCTION IntInput::GetValuesPtr{{{*/
++void IntInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
++
++	_error2_("not supported yet!");
++
++}
++/*}}}*/
++/*FUNCTION IntInput::Configure{{{*/
++void IntInput::Configure(Parameters* parameters){
++	/*do nothing: */
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 12822)
+@@ -0,0 +1,193 @@
++/*!\file BoolInput.c
++ * \brief: implementation of the BoolInput object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*BoolInput constructors and destructor*/
++/*FUNCTION BoolInput::BoolInput(){{{*/
++BoolInput::BoolInput(){
++	return;
++}
++/*}}}*/
++/*FUNCTION BoolInput::BoolInput(IssmDouble* values){{{*/
++BoolInput::BoolInput(int in_enum_type,IssmBool in_value){
++
++	enum_type=in_enum_type;
++	value=in_value;
++}
++/*}}}*/
++/*FUNCTION BoolInput::~BoolInput(){{{*/
++BoolInput::~BoolInput(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION BoolInput::Echo {{{*/
++void BoolInput::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION BoolInput::DeepEcho{{{*/
++void BoolInput::DeepEcho(void){
++
++	_printLine_("BoolInput:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " <<(value?"true":"false"));
++}
++/*}}}*/
++/*FUNCTION BoolInput::Id{{{*/
++int    BoolInput::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION BoolInput::MyRank{{{*/
++int    BoolInput::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION BoolInput::ObjectEnum{{{*/
++int BoolInput::ObjectEnum(void){
++
++	return BoolInputEnum;
++
++}
++/*}}}*/
++/*FUNCTION BoolInput::copy{{{*/
++Object* BoolInput::copy() {
++	
++	return new BoolInput(this->enum_type,this->value);
++
++}
++/*}}}*/
++	
++/*BoolInput management*/
++/*FUNCTION BoolInput::InstanceEnum{{{*/
++int BoolInput::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++/*FUNCTION BoolInput::SpawnTriaInput{{{*/
++Input* BoolInput::SpawnTriaInput(int* indices){
++
++		/*output*/
++		BoolInput* outinput=new BoolInput();
++
++		/*only copy current value*/
++		outinput->enum_type=this->enum_type;
++		outinput->value=this->value;
++
++		/*Assign output*/
++		return outinput;
++
++}
++/*}}}*/
++/*FUNCTION BoolInput::SpawnResult{{{*/
++ElementResult* BoolInput::SpawnResult(int step, IssmDouble time){
++	
++	return new BoolElementResult(this->enum_type,this->value,step,time);
++
++}
++/*}}}*/
++
++/*Object functions*/
++/*FUNCTION BoolInput::GetInputValue(bool* pvalue) {{{*/
++void BoolInput::GetInputValue(bool* pvalue){
++	*pvalue=value;
++}
++/*}}}*/
++/*FUNCTION BoolInput::GetInputValue(int* pvalue){{{*/
++void BoolInput::GetInputValue(int* pvalue){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue){{{*/
++void BoolInput::GetInputValue(IssmDouble* pvalue){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
++void BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
++void BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
++void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
++void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION BoolInput::ChangeEnum{{{*/
++void BoolInput::ChangeEnum(int newenumtype){
++	this->enum_type=newenumtype;
++}
++/*}}}*/
++/*FUNCTION BoolInput::SquareMin{{{*/
++void BoolInput::SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){
++	/*square of a bool is the bool itself: */
++	*psquaremin=value;
++}
++/*}}}*/
++/*FUNCTION BoolInput::Scale{{{*/
++void BoolInput::Scale(IssmDouble scale_factor){
++	/*a bool cannot be scaled: */
++}
++/*}}}*/
++/*FUNCTION BoolInput::AXPY{{{*/
++void BoolInput::AXPY(Input* xinput,IssmDouble scalar){
++
++	BoolInput*  xboolinput=NULL;
++
++	/*xinput is of the same type, so cast it: */
++	xboolinput=(BoolInput*)xinput;
++
++	/*Carry out the AXPY operation depending on type:*/
++	switch(xinput->ObjectEnum()){
++
++		case BoolInputEnum:
++			this->value=reCast<bool,IssmDouble>(this->value+scalar*xboolinput->value);
++			return;
++
++		default:
++			_error2_("not implemented yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION BoolInput::Extrude{{{*/
++void BoolInput::Extrude(void){
++
++	/*do nothing*/
++	return;
++}
++/*}}}*/
++/*FUNCTION BoolInput::GetVectorFromInputs{{{*/
++void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){
++
++	_error2_("not supporte yet!");
++
++}
++/*}}}*/
++/*FUNCTION BoolInput::GetValuesPtr{{{*/
++void BoolInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
++
++	_error2_("not supported yet!");
++
++}
++/*}}}*/
++/*FUNCTION BoolInput::Configure{{{*/
++void BoolInput::Configure(Parameters* parameters){
++	/*do nothing: */
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 12822)
+@@ -0,0 +1,85 @@
++/*! \file IntInput.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _INTINPUT_H_
++#define _INTINPUT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Input.h"
++#include "../../include/include.h"
++class GaussTria;
++/*}}}*/
++
++class IntInput: public Input{
++
++	public:
++		/*just hold 3 values for 3 vertices: */
++		int    enum_type;
++		IssmInt value;
++
++		/*IntInput constructors, destructors: {{{*/
++		IntInput();
++		IntInput(int enum_type,IssmInt value);
++		~IntInput();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*IntInput management: {{{*/
++		int   InstanceEnum();
++		Input* SpawnTriaInput(int* indices);
++		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		ElementResult* SpawnResult(int step, IssmDouble time);
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void Configure(Parameters* parameters);
++		/*}}}*/
++		/*numerics: {{{*/
++		void GetInputValue(bool* pvalue);
++		void GetInputValue(int* pvalue);
++		void GetInputValue(IssmDouble* pvalue);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void ChangeEnum(int newenumtype);
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
++		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		void Scale(IssmDouble scale_factor);
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar);
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
++		IssmDouble InfinityNorm(void){_error2_("InfinityNorm not implemented for integers");};
++		IssmDouble Max(void){_error2_("Max not implemented for integers");};
++		IssmDouble MaxAbs(void){_error2_("Max not implemented for integers");};
++		IssmDouble Min(void){_error2_("Min not implemented for integers");};
++		IssmDouble MinAbs(void){_error2_("Min not implemented for integers");};
++		void Extrude(void){_error2_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
++		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
++		/*}}}*/
++
++};
++#endif  /* _INTINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 12822)
+@@ -0,0 +1,85 @@
++/*! \file BoolInput.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _BOOLINPUT_H_
++#define _BOOLINPUT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Input.h"
++#include "../../include/include.h"
++class GaussTria;
++/*}}}*/
++
++class BoolInput: public Input{
++
++	public:
++		/*just hold 3 values for 3 vertices: */
++		int    enum_type;
++		IssmBool value;
++
++		/*BoolInput constructors, destructors: {{{*/
++		BoolInput();
++		BoolInput(int enum_type,IssmBool value);
++		~BoolInput();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*BoolInput management: {{{*/
++		int   InstanceEnum();
++		Input* SpawnTriaInput(int* indices);
++		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		ElementResult* SpawnResult(int step, IssmDouble time);
++		void Configure(Parameters* parameters);
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		/*}}}*/
++		/*numerics: {{{*/
++		void GetInputValue(bool* pvalue);
++		void GetInputValue(int* pvalue);
++		void GetInputValue(IssmDouble* pvalue);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void ChangeEnum(int newenumtype);
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
++		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		IssmDouble InfinityNorm(void){_error2_("InfinityNorm not implemented for booleans");};
++		IssmDouble Max(void){_error2_("Max not implemented for booleans");};
++		IssmDouble MaxAbs(void){_error2_("Max not implemented for booleans");};
++		IssmDouble Min(void){_error2_("Min not implemented for booleans");};
++		IssmDouble MinAbs(void){_error2_("Min not implemented for booleans");};
++		void Scale(IssmDouble scale_factor);
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar);
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error2_("Constrain not implemented for booleans");};
++		void Extrude(void);
++		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
++		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
++		/*}}}*/
++
++};
++#endif  /* _BOOLINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 12822)
+@@ -0,0 +1,422 @@
++/*!\file TriaP1Input.c
++ * \brief: implementation of the TriaP1Input object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*TriaP1Input constructors and destructor*/
++/*FUNCTION TriaP1Input::TriaP1Input(){{{*/
++TriaP1Input::TriaP1Input(){
++	return;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::TriaP1Input(int in_enum_type,IssmDouble* values){{{*/
++TriaP1Input::TriaP1Input(int in_enum_type,IssmDouble* in_values)
++	:TriaRef(1)
++{
++
++	/*Set TriaRef*/
++	this->SetElementType(P1Enum,0);
++	this->element_type=P1Enum;
++
++	/*Set Enum*/
++	enum_type=in_enum_type;
++
++	/*Set values*/
++	values[0]=in_values[0];
++	values[1]=in_values[1];
++	values[2]=in_values[2];
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::~TriaP1Input(){{{*/
++TriaP1Input::~TriaP1Input(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION TriaP1Input::Echo {{{*/
++void TriaP1Input::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::DeepEcho{{{*/
++void TriaP1Input::DeepEcho(void){
++
++	_printLine_("TriaP1Input:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   values: [" << this->values[0] << " " << this->values[1] << " " << this->values[2] << "]");
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::Id{{{*/
++int    TriaP1Input::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION TriaP1Input::MyRank{{{*/
++int    TriaP1Input::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::ObjectEnum{{{*/
++int TriaP1Input::ObjectEnum(void){
++
++	return TriaP1InputEnum;
++
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::copy{{{*/
++Object* TriaP1Input::copy() {
++	
++	return new TriaP1Input(this->enum_type,this->values);
++
++}
++/*}}}*/
++	
++/*TriaP1Input management*/
++/*FUNCTION TriaP1Input::InstanceEnum{{{*/
++int TriaP1Input::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::SpawnTriaInput{{{*/
++Input* TriaP1Input::SpawnTriaInput(int* indices){
++
++	/*output*/
++	TriaP1Input* outinput=NULL;
++
++	/*Create new Tria input (copy of current input)*/
++	outinput=new TriaP1Input(this->enum_type,&this->values[0]);
++
++	/*Assign output*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::SpawnResult{{{*/
++ElementResult* TriaP1Input::SpawnResult(int step, IssmDouble time){
++
++	return new TriaP1ElementResult(this->enum_type,this->values,step,time);
++
++}
++/*}}}*/
++
++/*Object functions*/
++/*FUNCTION TriaP1Input::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
++void TriaP1Input::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){
++
++	/*Call TriaRef function*/
++	TriaRef::GetInputValue(pvalue,&values[0],gauss);
++
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussTria* gauss){{{*/
++void TriaP1Input::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussTria* gauss){
++
++	/*Call TriaRef function*/
++	TriaRef::GetInputDerivativeValue(p,&values[0],xyz_list,gauss);
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::GetVxStrainRate2d{{{*/
++void TriaP1Input::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){
++
++	/*Intermediary*/
++	int       i;
++	const int numnodes=3;
++	IssmDouble B[3][NDOF2*numnodes];
++	IssmDouble velocity[3][NDOF2];
++
++	/*Get B matrix: */
++	GetBMacAyeal(&B[0][0], xyz_list, gauss);
++
++	/*Here, we are computing the strain rate of (vx,0)*/
++	for(i=0;i<3;i++){
++		velocity[i][0]=this->values[i];
++		velocity[i][1]=0.0;
++	}
++	/*Get epsilon(vx) = B*velocity*/
++	MatrixMultiply( &B[0][0],3,NDOF2*numnodes,0,
++				&velocity[0][0],NDOF2*numnodes,1,0,
++				epsilonvx,0);
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::GetVyStrainRate2d{{{*/
++void TriaP1Input::GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){
++
++	/*Intermediary*/
++	int       i;
++	const int numnodes=3;
++	IssmDouble B[3][NDOF2*numnodes];
++	IssmDouble velocity[3][NDOF2];
++
++	/*Get B matrix: */
++	GetBMacAyeal(&B[0][0], xyz_list, gauss);
++
++	/*Here, we are computing the strain rate of (0,vy)*/
++	for(i=0;i<3;i++){
++		velocity[i][0]=0.0;
++		velocity[i][1]=this->values[i];
++	}
++	/*Get epsilon(vy) = B*velocity*/
++	MatrixMultiply( &B[0][0],3,NDOF2*numnodes,0,
++				&velocity[0][0],NDOF2*numnodes,1,0,
++				epsilonvy,0);
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::ChangeEnum{{{*/
++void TriaP1Input::ChangeEnum(int newenumtype){
++	this->enum_type=newenumtype;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::GetInputAverage{{{*/
++void TriaP1Input::GetInputAverage(IssmDouble* pvalue){
++	*pvalue=1./3.*(values[0]+values[1]+values[2]);
++}
++/*}}}*/
++
++/*Intermediary*/
++/*FUNCTION TriaP1Input::SquareMin{{{*/
++void TriaP1Input::SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){
++
++	int i;
++	const int numnodes=3;
++	IssmDouble valuescopy[numnodes];
++	IssmDouble squaremin;
++
++	/*First,  copy values, to process units if requested: */
++	for(i=0;i<numnodes;i++)valuescopy[i]=this->values[i];
++
++	/*Process units if requested: */
++	if(process_units)UnitConversion(&valuescopy[0],numnodes,IuToExtEnum,enum_type);
++
++	/*Now, figure out minimum of valuescopy: */
++	squaremin=pow(valuescopy[0],2);
++	for(i=1;i<numnodes;i++){
++		if(pow(valuescopy[i],2)<squaremin)squaremin=pow(valuescopy[i],2);
++	}
++	/*Assign output pointers:*/
++	*psquaremin=squaremin;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::ContrainMin{{{*/
++void TriaP1Input::ConstrainMin(IssmDouble minimum){
++	
++	int i;
++	const int numnodes=3;
++
++	for(i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::InfinityNorm{{{*/
++IssmDouble TriaP1Input::InfinityNorm(void){
++
++	/*Output*/
++	IssmDouble norm=0;
++	const int numnodes=3;
++
++	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
++	return norm;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::Max{{{*/
++IssmDouble TriaP1Input::Max(void){
++
++	const int numnodes=3;
++	IssmDouble    max=values[0];
++
++	for(int i=1;i<numnodes;i++){
++		if(values[i]>max) max=values[i];
++	}
++	return max;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::MaxAbs{{{*/
++IssmDouble TriaP1Input::MaxAbs(void){
++
++	const int numnodes=3;
++	IssmDouble    max=fabs(values[0]);
++
++	for(int i=1;i<numnodes;i++){
++		if(fabs(values[i])>max) max=fabs(values[i]);
++	}
++	return max;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::Min{{{*/
++IssmDouble TriaP1Input::Min(void){
++
++	const int numnodes=3;
++	IssmDouble    min=values[0];
++
++	for(int i=1;i<numnodes;i++){
++		if(values[i]<min) min=values[i];
++	}
++	return min;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::MinAbs{{{*/
++IssmDouble TriaP1Input::MinAbs(void){
++
++	const int numnodes=3;
++	IssmDouble    min=fabs(values[0]);
++
++	for(int i=1;i<numnodes;i++){
++		if(fabs(values[i])<min) min=fabs(values[i]);
++	}
++	return min;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::Scale{{{*/
++void TriaP1Input::Scale(IssmDouble scale_factor){
++	
++	int i;
++	const int numnodes=3;
++
++	for(i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::ArtificialNoise{{{*/
++void TriaP1Input::ArtificialNoise(IssmDouble min,IssmDouble max){
++
++	int i;
++	const int numnodes=3;
++	IssmDouble noise;
++
++	/*Compute random number between bounds:
++	 * rand() outputs an integer in [0 RAND_MAX]
++	 * (IssmDouble)rand()/RAND_MAX is in [0 1]
++	 */
++	 noise=min+(max-min)*(IssmDouble)rand()/RAND_MAX;
++
++	for(i=0;i<numnodes;i++)values[i]=values[i]+noise;
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::AXPY{{{*/
++void TriaP1Input::AXPY(Input* xinput,IssmDouble scalar){
++
++	int i;
++	const int numnodes=3;
++	TriaP1Input*  xtriavertexinput=NULL;
++
++	/*xinput is of the same type, so cast it: */
++	xtriavertexinput=(TriaP1Input*)xinput;
++
++	/*Carry out the AXPY operation depending on type:*/
++	switch(xinput->ObjectEnum()){
++
++		case TriaP1InputEnum :
++			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*xtriavertexinput->values[i];
++			return;
++
++		default :
++			_error2_("not implemented yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::Constrain{{{*/
++void TriaP1Input::Constrain(IssmDouble cm_min, IssmDouble cm_max){
++
++	int i;
++	const int numnodes=3;
++		
++	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;
++
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::GetVectorFromInputs{{{*/
++void TriaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
++
++	const int numvertices=3;
++	vector->SetValues(numvertices,doflist,this->values,INS_VAL);
++
++} /*}}}*/
++/*FUNCTION TriaP1Input::GetValuesPtr{{{*/
++void TriaP1Input::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
++
++	*pvalues=this->values;
++	if(pnum_values)*pnum_values=3;
++
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::PointwiseMin{{{*/
++Input* TriaP1Input::PointwiseMin(Input* inputB){
++
++	/*Ouput*/
++	TriaP1Input* outinput=NULL;
++
++	/*Intermediaries*/
++	int               i;
++	TriaP1Input *xinputB     = NULL;
++	int               B_numvalues;
++	const int         numnodes    = 3;
++	IssmDouble            minvalues[numnodes];
++
++	/*Check that inputB is of the same type*/
++	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	xinputB=(TriaP1Input*)inputB;
++
++	/*Create point wise min*/
++	for(i=0;i<numnodes;i++){
++		if(this->values[i] > xinputB->values[i]) minvalues[i]=xinputB->values[i];
++		else minvalues[i]=this->values[i];
++	}
++
++	/*Create new Tria vertex input (copy of current input)*/
++	outinput=new TriaP1Input(this->enum_type,&minvalues[0]);
++
++	/*Return output pointer*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::PointwiseMax{{{*/
++Input* TriaP1Input::PointwiseMax(Input* inputB){
++
++	/*Ouput*/
++	TriaP1Input* outinput=NULL;
++
++	/*Intermediaries*/
++	int               i;
++	TriaP1Input *xinputB     = NULL;
++	int               B_numvalues;
++	const int         numnodes    = 3;
++	IssmDouble            maxvalues[numnodes];
++
++	/*Check that inputB is of the same type*/
++	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	xinputB=(TriaP1Input*)inputB;
++
++	/*Create point wise max*/
++	for(i=0;i<numnodes;i++){
++		if(this->values[i] < xinputB->values[i]) maxvalues[i]=xinputB->values[i];
++		else maxvalues[i]=this->values[i];
++	}
++
++	/*Create new Tria vertex input (copy of current input)*/
++	outinput=new TriaP1Input(this->enum_type,&maxvalues[0]);
++
++	/*Return output pointer*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION TriaP1Input::Configure{{{*/
++void TriaP1Input::Configure(Parameters* parameters){
++	/*do nothing: */
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 12822)
+@@ -0,0 +1,86 @@
++/*! \file TriaP1Input.h 
++ *  \brief: header file for TriaP1Input object
++ */
++
++
++#ifndef _TRIAP1INPUT_H_
++#define _TRIAP1INPUT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Input.h"
++#include "../Elements/TriaRef.h"
++class GaussTria;
++/*}}}*/
++
++class TriaP1Input: public Input,public TriaRef{
++
++	public:
++		/*just hold 3 values for 3 vertices: */
++		int    enum_type;
++		IssmDouble values[3];
++
++		/*TriaP1Input constructors, destructors: {{{*/
++		TriaP1Input();
++		TriaP1Input(int enum_type,IssmDouble* values);
++		~TriaP1Input();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*TriaP1Input management: {{{*/
++		int   InstanceEnum();
++		Input* SpawnTriaInput(int* indices);
++		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB);
++		Input* PointwiseMax(Input* inputB);
++		ElementResult* SpawnResult(int step, IssmDouble time);
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void Configure(Parameters* parameters);
++		/*}}}*/
++		/*numerics: {{{*/
++		void GetInputValue(bool* pvalue){_error2_("not implemented yet");}
++		void GetInputValue(int* pvalue){_error2_("not implemented yet");}
++		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");}
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue);
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss);
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss);
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void ChangeEnum(int newenumtype);
++
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
++		void ConstrainMin(IssmDouble minimum);
++		void Scale(IssmDouble scale_factor);
++		void ArtificialNoise(IssmDouble min,IssmDouble max);
++		void AXPY(Input* xinput,IssmDouble scalar);
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
++		IssmDouble InfinityNorm(void);
++		IssmDouble Max(void);
++		IssmDouble MaxAbs(void);
++		IssmDouble Min(void);
++		IssmDouble MinAbs(void);
++		void Extrude(void){_error2_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
++		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
++		/*}}}*/
++
++};
++#endif  /* _TRIAP1INPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 12822)
+@@ -0,0 +1,486 @@
++/*!\file TransientInput.c
++ * \brief: implementation of the TransientInput object
++ */
++/*Headers{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*TransientInput constructors and destructor*/
++/*FUNCTION TransientInput::TransientInput(){{{*/
++TransientInput::TransientInput(){
++
++	enum_type=UNDEF;
++	inputs=NULL;
++	this->numtimesteps=0;
++	this->parameters=NULL;
++	this->timesteps=NULL;
++
++}
++/*}}}*/
++/*FUNCTION TransientInput::TransientInput(int in_enum_type){{{*/
++TransientInput::TransientInput(int in_enum_type)
++{
++	/*Set Enum*/
++	enum_type=in_enum_type;
++
++	/*Allocate values and timesteps, and copy: */
++	this->numtimesteps=0;
++	this->timesteps=NULL;
++	inputs = new Inputs();
++	this->parameters=NULL;
++
++}
++/*}}}*/
++/*FUNCTION TransientInput::~TransientInput{{{*/
++TransientInput::~TransientInput(){
++	xDelete<IssmDouble>(this->timesteps);
++	this->timesteps=NULL;
++	this->numtimesteps=0;
++	parameters=NULL;
++	delete this->inputs;
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION TransientInput::Echo {{{*/
++void TransientInput::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION TransientInput::DeepEcho{{{*/
++void TransientInput::DeepEcho(void){
++
++	int i;
++
++	_printLine_("TransientInput:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   numtimesteps: " << this->numtimesteps);
++	_printLine_("---inputs: "); 
++	for(i=0;i<this->numtimesteps;i++){
++		_printLine_("   time: " << this->timesteps[i] << "  ");
++		((Input*)this->inputs->GetObjectByOffset(i))->Echo();
++	}
++}
++/*}}}*/
++/*FUNCTION TransientInput::Id{{{*/
++int    TransientInput::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION TransientInput::MyRank{{{*/
++int    TransientInput::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION TransientInput::ObjectEnum{{{*/
++int TransientInput::ObjectEnum(void){
++
++	return TransientInputEnum;
++
++}
++/*}}}*/
++/*FUNCTION TransientInput::copy{{{*/
++Object* TransientInput::copy() {
++
++	TransientInput* output=NULL;
++
++	output = new TransientInput();
++	output->enum_type=this->enum_type;
++	output->numtimesteps=this->numtimesteps;
++	output->timesteps=xNew<IssmDouble>(this->numtimesteps);
++   memcpy(output->timesteps,this->timesteps,this->numtimesteps*sizeof(IssmDouble));
++	output->inputs=(Inputs*)this->inputs->Copy();
++	output->parameters=this->parameters;
++
++	return output;
++
++}
++/*}}}*/
++	
++/*TransientInput management*/
++/*FUNCTION TransientInput::InstanceEnum{{{*/
++int TransientInput::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++/*FUNCTION TransientInput::SpawnTriaInput{{{*/
++Input* TransientInput::SpawnTriaInput(int* indices){
++
++	/*output*/
++	TransientInput* outinput=NULL;
++
++	/*Create new Transientinput (copy of current input)*/
++	outinput=new TransientInput();
++	outinput->enum_type=this->enum_type;
++	outinput->numtimesteps=this->numtimesteps;
++	outinput->timesteps=xNew<IssmDouble>(this->numtimesteps);
++	memcpy(outinput->timesteps,this->timesteps,this->numtimesteps*sizeof(IssmDouble));
++	outinput->inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices);
++	outinput->parameters=this->parameters;
++
++	/*Assign output*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION TransientInput::SpawnResult{{{*/
++ElementResult* TransientInput::SpawnResult(int step, IssmDouble time){
++
++	ElementResult* elementresult=NULL;
++
++	/*Ok, we want to spawn an ElementResult. We have the time, just get 
++	 *the correct values: */
++	Input* input=GetTimeInput(time);
++
++	elementresult=input->SpawnResult(step,time);
++
++   delete input;
++
++	return elementresult;
++}
++/*}}}*/
++
++/*Object functions*/
++/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
++void TransientInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){
++	IssmDouble time;
++
++	/*First, recover current time from parameters: */
++	this->parameters->FindParam(&time,TimeEnum);
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	input->GetInputValue(pvalue,gauss);
++
++	delete input;
++}
++/*}}}*/
++/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
++void TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){
++	IssmDouble time;
++
++	/*First, recover current time from parameters: */
++	this->parameters->FindParam(&time,TimeEnum);
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	input->GetInputValue(pvalue,gauss);
++
++	delete input;
++}
++/*}}}*/
++/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){{{*/
++void TransientInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	input->GetInputValue(pvalue,gauss);
++
++	delete input;
++}
++/*}}}*/
++/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){{{*/
++void TransientInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	input->GetInputValue(pvalue,gauss);
++
++	delete input;
++}
++/*}}}*/
++/*FUNCTION TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussTria* gauss){{{*/
++void TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussTria* gauss){
++
++	IssmDouble time;
++
++	/*First, recover current time from parameters: */
++	parameters->FindParam(&time,TimeEnum);
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++		   
++	/*Call input function*/
++	input->GetInputDerivativeValue(p,xyz_list,gauss);
++
++	delete input;
++
++}
++/*}}}*/
++/*FUNCTION TransientInput::ChangeEnum{{{*/
++void TransientInput::ChangeEnum(int newenumtype){
++	this->enum_type=newenumtype;
++}
++/*}}}*/
++/*FUNCTION TransientInput::GetInputAverage{{{*/
++void TransientInput::GetInputAverage(IssmDouble* pvalue){
++	
++	IssmDouble time;
++
++	/*First, recover current time from parameters: */
++	parameters->FindParam(&time,TimeEnum);
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	input->GetInputAverage(pvalue);
++			   
++	delete input;
++
++}
++/*}}}*/
++
++/*Intermediary*/
++/*FUNCTION TransientInput::AddTimeInput{{{*/
++void TransientInput::AddTimeInput(Input* input,IssmDouble time){
++
++	/*insert values at time step: */
++	if (this->numtimesteps>0 && time<=this->timesteps[this->numtimesteps-1]) _assert_("timestep values must increase sequentially");
++
++	//copy timesteps, add the new time, delete previous timesteps, and add the new input: inputs->AddObject(input);
++	IssmDouble* old_timesteps=NULL;
++
++	if (this->numtimesteps > 0){
++		old_timesteps=xNew<IssmDouble>(this->numtimesteps);
++		memcpy(old_timesteps,this->timesteps,this->numtimesteps*sizeof(IssmDouble));
++		xDelete<IssmDouble>(this->timesteps); 
++	}
++
++	this->numtimesteps=this->numtimesteps+1;
++	this->timesteps=xNew<IssmDouble>(this->numtimesteps);
++
++	if (this->numtimesteps > 1){
++		memcpy(this->timesteps,old_timesteps,(this->numtimesteps-1)*sizeof(IssmDouble));
++		xDelete<IssmDouble>(old_timesteps);
++	}
++
++	/*go ahead and plug: */
++	this->timesteps[this->numtimesteps-1]=time;
++	inputs->AddObject(input);
++
++}
++/*}}}*/
++/*FUNCTION TransientInput::SquareMin{{{*/
++void TransientInput::SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){
++
++	IssmDouble time;
++
++	/*First, recover current time from parameters: */
++	parameters->FindParam(&time,TimeEnum);
++
++   /*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++		   
++	/*Call input function*/
++	input->SquareMin(psquaremin,process_units,parameters);
++			   
++	delete input;
++
++}
++/*}}}*/
++/*FUNCTION TransientInput::InfinityNorm{{{*/
++IssmDouble TransientInput::InfinityNorm(void){
++
++	IssmDouble time;
++	IssmDouble infnorm;
++
++	/*First, recover current time from parameters: */
++	parameters->FindParam(&time,TimeEnum);
++
++   /*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	infnorm=input->InfinityNorm();
++			   
++	/*Clean-up and return*/
++	delete input;
++	return infnorm;
++}
++/*}}}*/
++/*FUNCTION TransientInput::Max{{{*/
++IssmDouble TransientInput::Max(void){
++
++	IssmDouble time;
++	IssmDouble max;
++
++	/*First, recover current time from parameters: */
++	parameters->FindParam(&time,TimeEnum);
++
++   /*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++		   
++	/*Call input function*/
++	max=input->Max();
++			   
++	delete input;
++
++	return max;
++}
++/*}}}*/
++/*FUNCTION TransientInput::MaxAbs{{{*/
++IssmDouble TransientInput::MaxAbs(void){
++
++	IssmDouble time;
++	IssmDouble maxabs;
++
++	/*First, recover current time from parameters: */
++	parameters->FindParam(&time,TimeEnum);
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	maxabs=input->MaxAbs();
++
++	/*Clean-up and return*/
++	delete input;
++	return maxabs;
++
++}
++/*}}}*/
++/*FUNCTION TransientInput::Min{{{*/
++IssmDouble TransientInput::Min(void){
++
++	IssmDouble time;
++	IssmDouble min;
++
++	/*First, recover current time from parameters: */
++	parameters->FindParam(&time,TimeEnum);
++
++   /*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	min=input->Min();
++
++	/*Clean-up and return*/
++	delete input;
++	return min;
++
++}
++/*}}}*/
++/*FUNCTION TransientInput::MinAbs{{{*/
++IssmDouble TransientInput::MinAbs(void){
++
++	IssmDouble time;
++	IssmDouble minabs;
++
++	/*First, recover current time from parameters: */
++	parameters->FindParam(&time,TimeEnum);
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++
++	/*Call input function*/
++	minabs=input->MinAbs();
++			   
++	/*Clean-up and return*/
++	delete input;
++	return minabs;
++}
++/*}}}*/
++/*FUNCTION TransientInput::GetVectorFromInputs{{{*/
++void TransientInput::GetVectorFromInputs(Vector* vector,int* doflist){
++
++	IssmDouble time;
++
++	/*First, recover current time from parameters: */
++	parameters->FindParam(&time,TimeEnum);
++
++	/*Retrieve interpolated values for this time step: */
++	Input* input=GetTimeInput(time);
++		   
++	/*Call input function*/
++	input->GetVectorFromInputs(vector,doflist);
++			   
++	delete input;
++
++} /*}}}*/
++/*FUNCTION TransientInput::GetTimeInput{{{*/
++Input* TransientInput::GetTimeInput(IssmDouble intime){
++
++	int     i,j;
++	IssmDouble  deltat;
++	IssmDouble  alpha1,alpha2;
++	bool    found=false;
++	Input*  input=NULL;
++	Input*  input1=NULL;
++	Input*  input2=NULL;
++
++	/*Ok, we have the time, go through the timesteps, and figure out which interval we 
++	 *fall within. Then interpolate the values on this interval: */
++	if(intime<this->timesteps[0]){
++		/*get values for the first time: */
++		input=(Input*)((Input*)this->inputs->GetObjectByOffset(0))->copy();
++		found=true;
++	}
++	else if(intime>this->timesteps[this->numtimesteps-1]){
++		/*get values for the last time: */
++		input=(Input*)((Input*)this->inputs->GetObjectByOffset(numtimesteps-1))->copy();
++		found=true;
++	}
++	else{
++		/*Find which interval we fall within: */
++		for(i=0;i<this->numtimesteps;i++){
++			if(intime==this->timesteps[i]){
++				/*We are right on one step time: */
++				input=(Input*)((Input*)this->inputs->GetObjectByOffset(i))->copy();
++				found=true;
++				break; //we are done with the time interpolation.
++			}
++			else{
++				if(this->timesteps[i]<intime && intime<this->timesteps[i+1]){
++					/*ok, we have the interval ]i:i+1[. Interpolate linearly for now: */
++					deltat=this->timesteps[i+1]-this->timesteps[i];
++					alpha2=(intime-this->timesteps[i])/deltat;
++					alpha1=(1.0-alpha2);
++
++					input1=(Input*)this->inputs->GetObjectByOffset(i); 
++					input2=(Input*)this->inputs->GetObjectByOffset(i+1);
++
++					input=(Input*)input1->copy();
++					input->Scale(alpha1);
++					input->AXPY(input2,alpha2);
++
++					found=true;
++					break;
++				}
++				else continue; //keep looking on the next interval
++			}
++		}
++	}
++	if(!found)_error2_("did not find time interval on which to interpolate forcing values!");
++
++	/*Assign output pointer*/
++	return input;
++}
++/*}}}*/
++/*FUNCTION TransientInput::Configure{{{*/
++void TransientInput::Configure(Parameters* parameters){
++	this->parameters=parameters;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 12822)
+@@ -0,0 +1,629 @@
++/*!\file PentaP1Input.c
++ * \brief: implementation of the PentaP1Input object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*PentaP1Input constructors and destructor*/
++/*FUNCTION PentaP1Input::PentaP1Input(){{{*/
++PentaP1Input::PentaP1Input(){
++	return;
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::PentaP1Input(int in_enum_type,IssmDouble* values){{{*/
++PentaP1Input::PentaP1Input(int in_enum_type,IssmDouble* in_values)
++		:PentaRef(1)
++{
++
++	/*Set PentaRef*/
++	this->SetElementType(P1Enum,0);
++	this->element_type=P1Enum;
++
++	enum_type=in_enum_type;
++	values[0]=in_values[0];
++	values[1]=in_values[1];
++	values[2]=in_values[2];
++	values[3]=in_values[3];
++	values[4]=in_values[4];
++	values[5]=in_values[5];
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::~PentaP1Input(){{{*/
++PentaP1Input::~PentaP1Input(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION PentaP1Input::Echo {{{*/
++void PentaP1Input::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::DeepEcho{{{*/
++void PentaP1Input::DeepEcho(void){
++
++	_printLine_("PentaP1Input:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   values: [" << this->values[0] << " " << this->values[1] << " " << this->values[2] << " " << this->values[3] << " " << this->values[4] << " " << this->values[5] << "]");
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::Id{{{*/
++int    PentaP1Input::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION PentaP1Input::MyRank{{{*/
++int    PentaP1Input::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::ObjectEnum{{{*/
++int PentaP1Input::ObjectEnum(void){
++
++	return PentaP1InputEnum;
++
++}
++/*}}}*/
++	
++/*PentaP1Input management*/
++/*FUNCTION PentaP1Input::copy{{{*/
++Object* PentaP1Input::copy() {
++	
++	return new PentaP1Input(this->enum_type,this->values);
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::InstanceEnum{{{*/
++int PentaP1Input::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::SpawnTriaInput{{{*/
++Input* PentaP1Input::SpawnTriaInput(int* indices){
++
++	/*output*/
++	TriaP1Input* outinput=NULL;
++	IssmDouble newvalues[3];
++
++	/*Loop over the new indices*/
++	for(int i=0;i<3;i++){
++
++		/*Check index value*/
++		_assert_(indices[i]>=0 && indices[i]<6);
++
++		/*Assign value to new input*/
++		newvalues[i]=this->values[indices[i]];
++	}
++
++	/*Create new Tria input*/
++	outinput=new TriaP1Input(this->enum_type,&newvalues[0]);
++
++	/*Assign output*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::SpawnResult{{{*/
++ElementResult* PentaP1Input::SpawnResult(int step, IssmDouble time){
++
++	return new PentaP1ElementResult(this->enum_type,this->values,step,time);
++
++}
++/*}}}*/
++
++/*Object functions*/
++/*FUNCTION PentaP1Input::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
++void PentaP1Input::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){
++
++	/*Call PentaRef function*/
++	PentaRef::GetInputValue(pvalue,&values[0],gauss);
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
++void PentaP1Input::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, GaussPenta* gauss){
++
++	/*Call PentaRef function*/
++	PentaRef::GetInputDerivativeValue(p,&values[0],xyz_list,gauss);
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::GetVxStrainRate3d{{{*/
++void PentaP1Input::GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){
++	int i,j;
++
++	const int numnodes=6;
++	const int DOFVELOCITY=3;
++	IssmDouble B[8][27];
++	IssmDouble B_reduced[6][DOFVELOCITY*numnodes];
++	IssmDouble velocity[numnodes][DOFVELOCITY];
++
++	/*Get B matrix: */
++	GetBStokes(&B[0][0], xyz_list, gauss);
++	/*Create a reduced matrix of B to get rid of pressure */
++	for (i=0;i<6;i++){
++		for (j=0;j<3;j++){
++			B_reduced[i][j]=B[i][j];
++		}
++		for (j=4;j<7;j++){
++			B_reduced[i][j-1]=B[i][j];
++		}
++		for (j=8;j<11;j++){
++			B_reduced[i][j-2]=B[i][j];
++		}
++		for (j=12;j<15;j++){
++			B_reduced[i][j-3]=B[i][j];
++		}
++		for (j=16;j<19;j++){
++			B_reduced[i][j-4]=B[i][j];
++		}
++		for (j=20;j<23;j++){
++			B_reduced[i][j-5]=B[i][j];
++		}
++	}
++
++	/*Here, we are computing the strain rate of (vx,0,0)*/
++	for(i=0;i<numnodes;i++){
++		velocity[i][0]=this->values[i];
++		velocity[i][1]=0.0;
++		velocity[i][2]=0.0;
++	}
++	/*Multiply B by velocity, to get strain rate: */
++	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvx,0);
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::GetVyStrainRate3d{{{*/
++void PentaP1Input::GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){
++	int i,j;
++
++	const int numnodes=6;
++	const int DOFVELOCITY=3;
++	IssmDouble B[8][27];
++	IssmDouble B_reduced[6][DOFVELOCITY*numnodes];
++	IssmDouble velocity[numnodes][DOFVELOCITY];
++
++	/*Get B matrix: */
++	GetBStokes(&B[0][0], xyz_list, gauss);
++	/*Create a reduced matrix of B to get rid of pressure */
++	for (i=0;i<6;i++){
++		for (j=0;j<3;j++){
++			B_reduced[i][j]=B[i][j];
++		}
++		for (j=4;j<7;j++){
++			B_reduced[i][j-1]=B[i][j];
++		}
++		for (j=8;j<11;j++){
++			B_reduced[i][j-2]=B[i][j];
++		}
++		for (j=12;j<15;j++){
++			B_reduced[i][j-3]=B[i][j];
++		}
++		for (j=16;j<19;j++){
++			B_reduced[i][j-4]=B[i][j];
++		}
++		for (j=20;j<23;j++){
++			B_reduced[i][j-5]=B[i][j];
++		}
++	}
++
++	/*Here, we are computing the strain rate of (0,vy,0)*/
++	for(i=0;i<numnodes;i++){
++		velocity[i][0]=0.0;
++		velocity[i][1]=this->values[i];
++		velocity[i][2]=0.0;
++	}
++	/*Multiply B by velocity, to get strain rate: */
++	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvy,0);
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::GetVzStrainRate3d{{{*/
++void PentaP1Input::GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){
++	int i,j;
++
++	const int numnodes=6;
++	const int DOFVELOCITY=3;
++	IssmDouble B[8][27];
++	IssmDouble B_reduced[6][DOFVELOCITY*numnodes];
++	IssmDouble velocity[numnodes][DOFVELOCITY];
++
++	/*Get B matrix: */
++	GetBStokes(&B[0][0], xyz_list, gauss);
++	/*Create a reduced matrix of B to get rid of pressure */
++	for (i=0;i<6;i++){
++		for (j=0;j<3;j++){
++			B_reduced[i][j]=B[i][j];
++		}
++		for (j=4;j<7;j++){
++			B_reduced[i][j-1]=B[i][j];
++		}
++		for (j=8;j<11;j++){
++			B_reduced[i][j-2]=B[i][j];
++		}
++		for (j=12;j<15;j++){
++			B_reduced[i][j-3]=B[i][j];
++		}
++		for (j=16;j<19;j++){
++			B_reduced[i][j-4]=B[i][j];
++		}
++		for (j=20;j<23;j++){
++			B_reduced[i][j-5]=B[i][j];
++		}
++	}
++
++	/*Here, we are computing the strain rate of (0,0,vz)*/
++	for(i=0;i<numnodes;i++){
++		velocity[i][0]=0.0;
++		velocity[i][1]=0.0;
++		velocity[i][2]=this->values[i];
++	}
++
++	/*Multiply B by velocity, to get strain rate: */
++	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvz,0);
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::GetVxStrainRate3dPattyn{{{*/
++void PentaP1Input::GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){
++
++	int i;
++	const int numnodes=6;
++	IssmDouble B[5][NDOF2*numnodes];
++	IssmDouble velocity[numnodes][NDOF2];
++
++	/*Get B matrix: */
++	GetBPattyn(&B[0][0], xyz_list, gauss);
++
++	/*Here, we are computing the strain rate of (vx,0)*/
++	for(i=0;i<numnodes;i++){
++		velocity[i][0]=this->values[i];
++		velocity[i][1]=0.0;
++	}
++
++	/*Multiply B by velocity, to get strain rate: */
++	MatrixMultiply( &B[0][0],5,NDOF2*numnodes,0,
++				&velocity[0][0],NDOF2*numnodes,1,0,
++				epsilonvx,0);
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::GetVyStrainRate3dPattyn{{{*/
++void PentaP1Input::GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){
++
++	int i;
++	const int numnodes=6;
++	IssmDouble B[5][NDOF2*numnodes];
++	IssmDouble velocity[numnodes][NDOF2];
++
++	/*Get B matrix: */
++	GetBPattyn(&B[0][0], xyz_list, gauss);
++
++	/*Here, we are computing the strain rate of (0,vy)*/
++	for(i=0;i<numnodes;i++){
++		velocity[i][0]=0.0;
++		velocity[i][1]=this->values[i];
++	}
++
++	/*Multiply B by velocity, to get strain rate: */
++	MatrixMultiply( &B[0][0],5,NDOF2*numnodes,0,
++				&velocity[0][0],NDOF2*numnodes,1,0,
++				epsilonvy,0);
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::ChangeEnum{{{*/
++void PentaP1Input::ChangeEnum(int newenumtype){
++	this->enum_type=newenumtype;
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::GetInputAverage{{{*/
++void PentaP1Input::GetInputAverage(IssmDouble* pvalue){
++	*pvalue=1./6.*(values[0]+values[1]+values[2]+values[3]+values[4]+values[5]);
++}
++/*}}}*/
++
++/*Intermediary*/
++/*FUNCTION PentaP1Input::SquareMin{{{*/
++void PentaP1Input::SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){
++
++	int i;
++	const int numnodes=6;
++	IssmDouble valuescopy[numnodes];
++	IssmDouble squaremin;
++
++	/*First,  copy values, to process units if requested: */
++	for(i=0;i<numnodes;i++)valuescopy[i]=this->values[i];
++
++	/*Process units if requested: */
++	if(process_units)UnitConversion(&valuescopy[0],numnodes,IuToExtEnum,enum_type);
++
++	/*Now, figure out minimum of valuescopy: */
++	squaremin=pow(valuescopy[0],2);
++	for(i=1;i<numnodes;i++){
++		if(pow(valuescopy[i],2)<squaremin)squaremin=pow(valuescopy[i],2);
++	}
++	/*Assign output pointers:*/
++	*psquaremin=squaremin;
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::ConstrainMin{{{*/
++void PentaP1Input::ConstrainMin(IssmDouble minimum){
++	
++	int i;
++	const int numnodes=6;
++
++	for(i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::InfinityNorm{{{*/
++IssmDouble PentaP1Input::InfinityNorm(void){
++
++	/*Output*/
++	const int numnodes=6;
++	IssmDouble norm=0;
++
++	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
++	return norm;
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::Max{{{*/
++IssmDouble PentaP1Input::Max(void){
++
++	const int numnodes=6;
++	IssmDouble    max=values[0];
++
++	for(int i=1;i<numnodes;i++){
++		if(values[i]>max) max=values[i];
++	}
++	return max;
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::MaxAbs{{{*/
++IssmDouble PentaP1Input::MaxAbs(void){
++
++	const int numnodes=6;
++	IssmDouble    max=fabs(values[0]);
++
++	for(int i=1;i<numnodes;i++){
++		if(fabs(values[i])>max) max=fabs(values[i]);
++	}
++	return max;
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::Min{{{*/
++IssmDouble PentaP1Input::Min(void){
++
++	const int numnodes=6;
++	IssmDouble    min=values[0];
++
++	for(int i=1;i<numnodes;i++){
++		if(values[i]<min) min=values[i];
++	}
++	return min;
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::MinAbs{{{*/
++IssmDouble PentaP1Input::MinAbs(void){
++
++	const int numnodes=6;
++	IssmDouble    min=fabs(values[0]);
++
++	for(int i=1;i<numnodes;i++){
++		if(fabs(values[i])<min) min=fabs(values[i]);
++	}
++	return min;
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::Scale{{{*/
++void PentaP1Input::Scale(IssmDouble scale_factor){
++	
++	int i;
++	const int numnodes=6;
++
++	for(i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::AXPY{{{*/
++void PentaP1Input::AXPY(Input* xinput,IssmDouble scalar){
++
++	int i;
++	const int numnodes=6;
++
++	/*xinput is of the same type, so cast it: */
++
++	/*Carry out the AXPY operation depending on type:*/
++	switch(xinput->ObjectEnum()){
++
++		case PentaP1InputEnum:{
++			PentaP1Input* cast_input=(PentaP1Input*)xinput;
++			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
++			return;
++		case ControlInputEnum:{
++			ControlInput* cont_input=(ControlInput*)xinput;
++			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error2_("not supported yet");
++			PentaP1Input* cast_input=(PentaP1Input*)cont_input->values;
++			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
++			return;
++		default:
++			_error2_("not implemented yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::Constrain{{{*/
++void PentaP1Input::Constrain(IssmDouble cm_min, IssmDouble cm_max){
++
++	int i;
++	const int numnodes=6;
++		
++	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;
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::Extrude{{{*/
++void PentaP1Input::Extrude(void){
++
++	int i;
++
++	/*First 3 values copied on 3 last values*/
++	for(i=0;i<3;i++) this->values[3+i]=this->values[i];
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::VerticallyIntegrate{{{*/
++void PentaP1Input::VerticallyIntegrate(Input* thickness_input){
++
++	/*Intermediaries*/
++	int i;
++	const int  numnodes = 6;
++	int        num_thickness_values;
++	IssmDouble    *thickness_values = NULL;
++
++	/*Check that input provided is a thickness*/
++	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
++
++	/*Get Thickness value pointer*/
++	thickness_input->GetValuesPtr(&thickness_values,&num_thickness_values);
++
++	/*vertically integrate depending on type:*/
++	switch(thickness_input->ObjectEnum()){
++
++		case PentaP1InputEnum:
++			for(i=0;i<3;i++){
++				this->values[i]=0.5*(this->values[i]+this->values[i+3]) * thickness_values[i];
++				this->values[i+3]=this->values[i];
++			}
++			return;
++
++		default:
++			_error2_("not implemented yet");
++	}
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::PointwiseDivide{{{*/
++Input* PentaP1Input::PointwiseDivide(Input* inputB){
++
++	/*Ouput*/
++	PentaP1Input* outinput=NULL;
++
++	/*Intermediaries*/
++	int               i;
++	PentaP1Input *xinputB     = NULL;
++	int               B_numvalues;
++	const int         numnodes    = 6;
++	IssmDouble            AdotBvalues[numnodes];
++
++	/*Check that inputB is of the same type*/
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	xinputB=(PentaP1Input*)inputB;
++
++	/*Create point wise sum*/
++	for(i=0;i<numnodes;i++){
++		_assert_(xinputB->values[i]!=0);
++		AdotBvalues[i]=this->values[i]/xinputB->values[i];
++	}
++
++	/*Create new Penta vertex input (copy of current input)*/
++	outinput=new PentaP1Input(this->enum_type,&AdotBvalues[0]);
++
++	/*Return output pointer*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::PointwiseMin{{{*/
++Input* PentaP1Input::PointwiseMin(Input* inputB){
++
++	/*Ouput*/
++	PentaP1Input* outinput=NULL;
++
++	/*Intermediaries*/
++	int               i;
++	PentaP1Input *xinputB     = NULL;
++	int               B_numvalues;
++	const int         numnodes    = 6;
++	IssmDouble            minvalues[numnodes];
++
++	/*Check that inputB is of the same type*/
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	xinputB=(PentaP1Input*)inputB;
++
++	/*Create point wise min*/
++	for(i=0;i<numnodes;i++){
++		if(this->values[i] > xinputB->values[i]) minvalues[i]=xinputB->values[i];
++		else minvalues[i]=this->values[i];
++	}
++
++	/*Create new Penta vertex input (copy of current input)*/
++	outinput=new PentaP1Input(this->enum_type,&minvalues[0]);
++
++	/*Return output pointer*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::PointwiseMax{{{*/
++Input* PentaP1Input::PointwiseMax(Input* inputB){
++
++	/*Ouput*/
++	PentaP1Input* outinput=NULL;
++
++	/*Intermediaries*/
++	int               i;
++	PentaP1Input *xinputB     = NULL;
++	int               B_numvalues;
++	const int         numnodes    = 6;
++	IssmDouble            maxvalues[numnodes];
++
++	/*Check that inputB is of the same type*/
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	xinputB=(PentaP1Input*)inputB;
++
++	/*Create point wise max*/
++	for(i=0;i<numnodes;i++){
++		if(this->values[i] < xinputB->values[i]) maxvalues[i]=xinputB->values[i];
++		else maxvalues[i]=this->values[i];
++	}
++
++	/*Create new Penta vertex input (copy of current input)*/
++	outinput=new PentaP1Input(this->enum_type,&maxvalues[0]);
++
++	/*Return output pointer*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::GetVectorFromInputs{{{*/
++void PentaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
++
++	const int numvertices=6;
++	vector->SetValues(numvertices,doflist,this->values,INS_VAL);
++
++} /*}}}*/
++/*FUNCTION PentaP1Input::GetValuesPtr{{{*/
++void PentaP1Input::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
++
++	*pvalues=this->values;
++	*pnum_values=6;
++
++}
++/*}}}*/
++/*FUNCTION PentaP1Input::Configure{{{*/
++void PentaP1Input::Configure(Parameters* parameters){
++	/*do nothing: */
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 12822)
+@@ -0,0 +1,359 @@
++/*!\file DoubleInput.c
++ * \brief: implementation of the DoubleInput object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*DoubleInput constructors and destructor*/
++/*FUNCTION DoubleInput::DoubleInput(){{{*/
++DoubleInput::DoubleInput(){
++	return;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::DoubleInput(IssmDouble value){{{*/
++DoubleInput::DoubleInput(int in_enum_type,IssmDouble in_value){
++
++	enum_type=in_enum_type;
++	value=in_value;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::~DoubleInput(){{{*/
++DoubleInput::~DoubleInput(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++		/*FUNCTION DoubleInput::Echo {{{*/
++void DoubleInput::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION DoubleInput::DeepEcho{{{*/
++void DoubleInput::DeepEcho(void){
++
++	_printLine_("DoubleInput:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " << this->value);
++}
++/*}}}*/
++/*FUNCTION DoubleInput::Id{{{*/
++int    DoubleInput::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION DoubleInput::MyRank{{{*/
++int    DoubleInput::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION DoubleInput::ObjectEnum{{{*/
++int DoubleInput::ObjectEnum(void){
++
++	return DoubleInputEnum;
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::copy{{{*/
++Object* DoubleInput::copy() {
++	
++	return new DoubleInput(this->enum_type,this->value);
++
++}
++/*}}}*/
++	
++/*DoubleInput management*/
++/*FUNCTION DoubleInput::InstanceEnum{{{*/
++int DoubleInput::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::SpawnTriaInput{{{*/
++Input* DoubleInput::SpawnTriaInput(int* indices){
++
++	/*output*/
++	DoubleInput* outinput=new DoubleInput();
++
++	/*only copy current value*/
++	outinput->enum_type=this->enum_type;
++	outinput->value=this->value;
++
++	/*Assign output*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::SpawnResult{{{*/
++ElementResult* DoubleInput::SpawnResult(int step, IssmDouble time){
++
++	return new DoubleElementResult(this->enum_type,this->value,step,time);
++
++}
++/*}}}*/
++
++/*Object functions*/
++/*FUNCTION DoubleInput::GetInputValue(bool* pvalue) {{{*/
++void DoubleInput::GetInputValue(bool* pvalue){
++	_error2_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetInputValue(int* pvalue){{{*/
++void DoubleInput::GetInputValue(int* pvalue){
++	_error2_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetInputValue(IssmDouble* pvalue){{{*/
++void DoubleInput::GetInputValue(IssmDouble* pvalue){
++
++	/*return value*/
++	*pvalue=value;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
++void DoubleInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){*pvalue=this->value;}
++/*}}}*/
++/*FUNCTION DoubleInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
++void DoubleInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){*pvalue=this->value;}
++/*}}}*/
++/*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
++void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
++void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
++/*}}}*/
++/*FUNCTION DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){{{*/
++void DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){
++	/*Epsilon is zero as vx is constant over the element*/
++	for(int i=0;i<3;i++) epsilonvx[i]=0;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){{{*/
++void DoubleInput::GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){
++	/*Epsilon is zero as vy is constant over the element*/
++	for(int i=0;i<3;i++) epsilonvy[i]=0;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){{{*/
++void DoubleInput::GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Epsilon is zero as vx is constant over the element*/
++	for(int i=0;i<6;i++) epsilonvx[i]=0;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){{{*/
++void DoubleInput::GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Epsilon is zero as vy is constant over the element*/
++	for(int i=0;i<6;i++) epsilonvy[i]=0;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){{{*/
++void DoubleInput::GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Epsilon is zero as vz is constant over the element*/
++	for(int i=0;i<6;i++) epsilonvz[i]=0;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){{{*/
++void DoubleInput::GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Epsilon is zero as vx is constant over the element*/
++	for(int i=0;i<5;i++) epsilonvx[i]=0;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){{{*/
++void DoubleInput::GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Epsilon is zero as vy is constant over the element*/
++	for(int i=0;i<5;i++) epsilonvy[i]=0;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::ChangeEnum{{{*/
++void DoubleInput::ChangeEnum(int newenumtype){
++	this->enum_type=newenumtype;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::SquareMin{{{*/
++void DoubleInput::SquareMin(IssmDouble* psquaremin, bool process_units,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){
++	value=value*scale_factor;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::ConstrainMin{{{*/
++void DoubleInput::ConstrainMin(IssmDouble minimum){
++	if (value<minimum) value=minimum;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::AXPY{{{*/
++void DoubleInput::AXPY(Input* xinput,IssmDouble scalar){
++
++	DoubleInput*  xIssmDoubleinput=NULL;
++
++	/*xinput is of the same type, so cast it: */
++	xIssmDoubleinput=(DoubleInput*)xinput;
++
++	/*Carry out the AXPY operation depending on type:*/
++	switch(xinput->ObjectEnum()){
++
++		case DoubleInputEnum:
++			this->value=this->value+scalar*xIssmDoubleinput->value;
++			return;
++
++		default:
++			_error2_("not implemented yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::Constrain{{{*/
++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){
++	return this->value;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::MaxAbs{{{*/
++IssmDouble DoubleInput::MaxAbs(void){
++	return fabs(this->value);
++}
++/*}}}*/
++/*FUNCTION DoubleInput::Min{{{*/
++IssmDouble DoubleInput::Min(void){
++	return this->value;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::MinAbs{{{*/
++IssmDouble DoubleInput::MinAbs(void){
++	return fabs(this->value);
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetVectorFromInputs{{{*/
++void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){
++
++	_error2_("not supporte yet!");
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetValuesPtr{{{*/
++void DoubleInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
++
++	_error2_("not supported yet!");
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::GetInputAverage{{{*/
++void DoubleInput::GetInputAverage(IssmDouble* pvalue){
++	*pvalue=value;
++}
++/*}}}*/
++/*FUNCTION DoubleInput::VerticallyIntegrate{{{*/
++void DoubleInput::VerticallyIntegrate(Input* thickness_input){
++
++	/*Intermediaries*/
++	IssmDouble thickness_value;
++
++	/*Check that input provided is a thickness*/
++	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
++
++	/*vertically integrate depending on type:*/
++	switch(thickness_input->ObjectEnum()){
++
++		case PentaP1InputEnum:
++			thickness_input->GetInputAverage(&thickness_value);
++			this->value=this->value*thickness_value;
++			return;
++
++		default:
++			_error2_("not implemented yet");
++	}
++}
++/*}}}*/
++/*FUNCTION DoubleInput::PointwiseDivide{{{*/
++Input* DoubleInput::PointwiseDivide(Input* inputB){
++
++	/*Ouput*/
++	DoubleInput* outinput=NULL;
++
++	/*Intermediaries*/
++	IssmDouble       Bvalue;
++
++	/*Check that inputB is of the same type*/
++	inputB->GetInputAverage(&Bvalue);
++
++	/*Create new DoubleInput*/
++	outinput=new DoubleInput(this->enum_type,this->value/Bvalue);
++
++	/*Return output pointer*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::PointwiseMin{{{*/
++Input* DoubleInput::PointwiseMin(Input* input){
++
++	/*Ouput*/
++	DoubleInput* outinput=NULL;
++
++	/*Intermediaries*/
++	IssmDouble       min;
++
++	/*Check that inputB is of the same type*/
++	if (input->Min() < this->Min()) min=input->Min();
++	else min=this->Min();
++
++	/*Create new DoubleInput*/
++	outinput=new DoubleInput(this->enum_type,min);
++
++	/*Return output pointer*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::PointwiseMax{{{*/
++Input* DoubleInput::PointwiseMax(Input* input){
++
++	/*Ouput*/
++	DoubleInput* outinput=NULL;
++
++	/*Intermediaries*/
++	IssmDouble       max;
++
++	/*Check that inputB is of the same type*/
++	if (input->Max() > this->Max()) max=input->Max();
++	else max=this->Max();
++
++	/*Create new DoubleInput*/
++	outinput=new DoubleInput(this->enum_type,max);
++
++	/*Return output pointer*/
++	return outinput;
++
++}
++/*}}}*/
++/*FUNCTION DoubleInput::Configure{{{*/
++void DoubleInput::Configure(Parameters* parameters){
++	/*do nothing: */
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 12822)
+@@ -0,0 +1,90 @@
++/*! \file TransientInput.h 
++ *  \brief: header file for transientinput object
++ */
++
++
++#ifndef _TRANSIENTINPUT_H_
++#define _TRANSIENTINPUT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Input.h"
++class GaussTria;
++class Parameters;
++/*}}}*/
++
++class TransientInput: public Input{
++
++	public:
++		int     enum_type;
++		int     numtimesteps;
++		Inputs* inputs;
++		IssmDouble* timesteps;
++		Parameters* parameters; //to find current time.
++
++		/*TransientInput constructors, destructors: {{{*/
++		TransientInput();
++		TransientInput(int enum_type);
++		~TransientInput();
++		void AddTimeInput(Input* input,IssmDouble time);
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		int   Id();
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*TransientInput management: {{{*/
++		int    InstanceEnum();
++		Input* SpawnTriaInput(int* indices);
++		Input* PointwiseDivide(Input* forcingB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* forcingB){_error2_("not implemented yet");};
++		Input* PointwiseMax(Input* forcingB){_error2_("not implemented yet");};
++		ElementResult* SpawnResult(int step, IssmDouble time);
++		void Configure(Parameters* parameters);
++		/*}}}*/
++		/*numerics: {{{*/
++		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time);
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue);
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void ChangeEnum(int newenumtype);
++
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
++		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void AXPY(Input* xforcing,IssmDouble scalar){_error2_("not implemented yet");};
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error2_("not implemented yet");};
++		IssmDouble InfinityNorm(void);
++		IssmDouble Max(void);
++		IssmDouble MaxAbs(void);
++		IssmDouble Min(void);
++		IssmDouble MinAbs(void);
++		void Extrude(void){_error2_("not supported yet");}
++		void VerticallyIntegrate(Input* thickness_forcing){_error2_("not supported yet");};
++		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not supported yet");};
++      void GetTimeValues(IssmDouble* values,IssmDouble time){_error2_("not implemented yet");};
++		Input* GetTimeInput(IssmDouble time);
++		/*}}}*/
++
++};
++#endif  /* _TRANSIENTINPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 12822)
+@@ -0,0 +1,86 @@
++/*! \file PentaP1Input.h 
++ *  \brief: header file for PentaP1Input object
++ */
++
++
++#ifndef _PENTAP1INPUT_H_
++#define _PENTAP1INPUT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Input.h"
++#include "../Elements/PentaRef.h"
++class GaussTria;
++/*}}}*/
++
++class PentaP1Input: public Input, public PentaRef{
++
++	public:
++		/*just hold 6 values for 6 vertices: */
++		int    enum_type;
++		IssmDouble values[6];
++
++		/*PentaP1Input constructors, destructors: {{{*/
++		PentaP1Input();
++		PentaP1Input(int enum_type,IssmDouble* values);
++		~PentaP1Input();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*PentaP1Input management: {{{*/
++		int   InstanceEnum();
++		Input* SpawnTriaInput(int* indices);
++		Input* PointwiseDivide(Input* inputB);
++		Input* PointwiseMin(Input* inputB);
++		Input* PointwiseMax(Input* inputB);
++		ElementResult* SpawnResult(int step, IssmDouble time);
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void Configure(Parameters* parameters);
++		/*}}}*/
++		/*numerics: {{{*/
++		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetInputAverage(IssmDouble* pvalue);
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
++		void ChangeEnum(int newenumtype);
++
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
++		void ConstrainMin(IssmDouble minimum);
++		void Scale(IssmDouble scale_factor);
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar);
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
++		IssmDouble InfinityNorm(void);
++		IssmDouble Max(void);
++		IssmDouble MaxAbs(void);
++		IssmDouble Min(void);
++		IssmDouble MinAbs(void);
++		void Extrude(void);
++		void VerticallyIntegrate(Input* thickness_input);
++		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
++		/*}}}*/
++
++};
++#endif  /* _PENTAP1INPUT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp	(revision 12822)
+@@ -0,0 +1,94 @@
++/*!\file KML_Geometry.cpp
++ * \brief: implementation of the kml_geometry abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Geometry::KML_Geometry(){{{*/
++KML_Geometry::KML_Geometry(){
++
++	;
++
++}
++/*}}}*/
++/*FUNCTION KML_Geometry::~KML_Geometry(){{{*/
++KML_Geometry::~KML_Geometry(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Geometry::Echo {{{*/
++void  KML_Geometry::Echo(){
++
++	this->KML_Object::Echo();
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Geometry::DeepEcho {{{*/
++void  KML_Geometry::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Geometry::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Geometry::DeepEcho {{{*/
++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){
++
++	KML_Object::Write(filout,indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Geometry::Read {{{*/
++void  KML_Geometry::Read(FILE* fid,char* kstr){
++
++/*  process field within opening and closing tags  */
++
++	if      (!strncmp(kstr,"</Geometry",10))
++		return;
++	else if (!strncmp(kstr,"</",2))
++	  {_error2_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");}
++	else if (strncmp(kstr,"<",1))
++	  {_error2_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");}
++
++	else if (!strncmp(kstr,"<",1))
++		KML_Object::Read(fid,kstr);
++
++	return;
++}
++/*}}}*/
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h	(revision 12822)
+@@ -0,0 +1,57 @@
++/*! \file KML_Icon.h 
++ *  \brief: header file for kml_icon object
++ */
++
++#ifndef _KML_ICON_H_
++#define _KML_ICON_H_
++
++#define KML_ICON_HREF_LENGTH      800
++#define KML_ICON_REFMODE_LENGTH    10
++#define KML_ICON_VREFMODE_LENGTH    9
++#define KML_ICON_VFORMAT_LENGTH   800
++#define KML_ICON_HQUERY_LENGTH    800
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Object.h"
++/*}}}*/
++
++class KML_Icon: public KML_Object {
++
++	public:
++
++		char  href[KML_ICON_HREF_LENGTH+1];
++		char  refmode[KML_ICON_REFMODE_LENGTH+1];
++		float refint;
++		char  vrefmode[KML_ICON_VREFMODE_LENGTH+1];
++		float vreftime;
++		float vboundsc;
++		char  vformat[KML_ICON_VFORMAT_LENGTH+1];
++		char  hquery[KML_ICON_HQUERY_LENGTH+1];
++
++		/*KML_Icon constructors, destructors {{{*/
++		KML_Icon();
++		~KML_Icon();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_ICON_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h	(revision 12822)
+@@ -0,0 +1,49 @@
++/*! \file KML_Point.h 
++ *  \brief: header file for kml_point object
++ */
++
++#ifndef _KML_POINT_H_
++#define _KML_POINT_H_
++
++#define KML_POINT_ALTMODE_LENGTH    18
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Geometry.h"
++/*}}}*/
++
++class KML_Point: public KML_Geometry {
++
++	public:
++
++		bool  extrude;
++		char  altmode[KML_POINT_ALTMODE_LENGTH+1];
++		double coords[3];
++
++		/*KML_Point constructors, destructors {{{*/
++		KML_Point();
++		~KML_Point();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_POINT_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h	(revision 12822)
+@@ -0,0 +1,51 @@
++/*! \file KML_LinearRing.h 
++ *  \brief: header file for kml_linearring object
++ */
++
++#ifndef _KML_LINEARRING_H_
++#define _KML_LINEARRING_H_
++
++#define KML_LINEARRING_ALTMODE_LENGTH    18
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Geometry.h"
++/*}}}*/
++
++class KML_LinearRing: public KML_Geometry {
++
++	public:
++
++		bool     extrude;
++		bool     tessellate;
++		char     altmode[KML_LINEARRING_ALTMODE_LENGTH+1];
++		int      ncoord;
++		double  *coords;
++
++		/*KML_LinearRing constructors, destructors {{{*/
++		KML_LinearRing();
++		~KML_LinearRing();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_LINEARRING_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp	(revision 12822)
+@@ -0,0 +1,109 @@
++/*!\file KML_ColorStyle.cpp
++ * \brief: implementation of the kml_colorstyle abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_ColorStyle::KML_ColorStyle(){{{*/
++KML_ColorStyle::KML_ColorStyle(){
++
++	strcpy(color     ,"ffffffff");
++	strcpy(colormode ,"normal");
++
++}
++/*}}}*/
++/*FUNCTION KML_ColorStyle::~KML_ColorStyle(){{{*/
++KML_ColorStyle::~KML_ColorStyle(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_ColorStyle::Echo {{{*/
++void  KML_ColorStyle::Echo(){
++
++	bool  flag=true;
++
++	KML_SubStyle::Echo();
++
++	if(flag) _pprintLine_("         color: " << color);
++	if(flag) _pprintLine_("     colormode: " << colormode);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_ColorStyle::DeepEcho {{{*/
++void  KML_ColorStyle::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_ColorStyle::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_ColorStyle::DeepEcho {{{*/
++void  KML_ColorStyle::DeepEcho(const char* indent){
++
++	bool  flag=true;
++
++	KML_SubStyle::DeepEcho(indent);
++
++	if(flag) _pprintLine_(indent << "         color: " << color);
++	if(flag) _pprintLine_(indent << "     colormode: " << colormode);
++}
++/*}}}*/
++/*FUNCTION KML_ColorStyle::Write {{{*/
++void  KML_ColorStyle::Write(FILE* filout,const char* indent){
++
++	KML_SubStyle::Write(filout,indent);
++
++	if (color     && strlen(color))
++		fprintf(filout,"%s  <color>%s</color>\n",indent,color);
++	if (colormode && strlen(colormode))
++		fprintf(filout,"%s  <colorMode>%s</colorMode>\n",indent,colormode);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_ColorStyle::Read {{{*/
++void  KML_ColorStyle::Read(FILE* fid,char* kstr){
++
++/*  process field within opening and closing tags  */
++
++	if      (!strncmp(kstr,"</ColorStyle",12))
++		return;
++	else if (!strncmp(kstr,"</",2))
++	  {_error2_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);}
++	else if (strncmp(kstr,"<",1))
++	  {_error2_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");}
++
++	else if (!strcmp(kstr,"<color>"))
++		KMLFileTokenParse( color     ,NULL,KML_COLORSTYLE_COLOR_LENGTH, kstr, fid);
++	else if (!strcmp(kstr,"<colorMode>"))
++		KMLFileTokenParse( colormode ,NULL,KML_COLORSTYLE_COLORMODE_LENGTH, kstr, fid);
++
++	else if (!strncmp(kstr,"<",1))
++		KML_SubStyle::Read(fid,kstr);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 12822)
+@@ -0,0 +1,210 @@
++/*!\file KML_Placemark.cpp
++ * \brief: implementation of the kml_placemark object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Placemark::KML_Placemark(){{{*/
++KML_Placemark::KML_Placemark(){
++
++	geometry  =new DataSet;
++
++}
++/*}}}*/
++/*FUNCTION KML_Placemark::~KML_Placemark(){{{*/
++KML_Placemark::~KML_Placemark(){
++
++	if (geometry) {
++		delete geometry;
++		geometry  =NULL;
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Placemark::Echo {{{*/
++void  KML_Placemark::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_Placemark:");
++	KML_Feature::Echo();
++
++	if(flag) _pprintLine_("      geometry: (size=" << geometry->Size() << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Placemark::DeepEcho {{{*/
++void  KML_Placemark::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Placemark::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Placemark::DeepEcho {{{*/
++void  KML_Placemark::DeepEcho(const char* indent){
++
++	int   i;
++	char  indent2[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_Placemark:");
++	KML_Feature::DeepEcho(indent);
++
++/*  loop over the geometry elements for the placemark  */
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent2,"  ");
++
++	if (geometry->Size())
++		for (i=0; i<geometry->Size(); i++) {
++			if(flag) _pprintLine_(indent << "      geometry: -------- begin [" << i << "] --------");
++			((KML_Geometry *)geometry->GetObjectByOffset(i))->DeepEcho(indent2);
++			if(flag) _pprintLine_(indent << "      geometry: --------  end  [" << i << "] --------");
++		}
++	else
++		if(flag) _pprintLine_(indent << "      geometry: [empty]");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Placemark::Write {{{*/
++void  KML_Placemark::Write(FILE* filout,const char* indent){
++
++	int   i;
++	char  indent2[81];
++
++	fprintf(filout,"%s<Placemark",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Feature::Write(filout,indent);
++
++/*  loop over the geometry elements for the placemark  */
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++
++	strcat(indent2,"  ");
++
++	for (i=0; i<geometry->Size(); i++)
++		((KML_Geometry *)geometry->GetObjectByOffset(i))->Write(filout,indent2);
++
++	fprintf(filout,"%s</Placemark>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Placemark::Read {{{*/
++void  KML_Placemark::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++	KML_Object*  kobj;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</Placemark",11)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strncmp(kstri,"<Point", 6)) {
++			kobj=(KML_Object*)new KML_Point();
++			kobj->Read(fid,kstri);
++			geometry  ->AddObject((Object*)kobj);
++		}
++
++		else if (!strncmp(kstri,"<LineString",11)) {
++			kobj=(KML_Object*)new KML_LineString();
++			kobj->Read(fid,kstri);
++			geometry  ->AddObject((Object*)kobj);
++		}
++
++		else if (!strncmp(kstri,"<LinearRing",11)) {
++			kobj=(KML_Object*)new KML_LinearRing();
++			kobj->Read(fid,kstri);
++			geometry  ->AddObject((Object*)kobj);
++		}
++
++		else if (!strncmp(kstri,"<Polygon", 8)) {
++			kobj=(KML_Object*)new KML_Polygon();
++			kobj->Read(fid,kstri);
++			geometry  ->AddObject((Object*)kobj);
++		}
++
++		else if (!strncmp(kstri,"<MultiGeometry",14)) {
++			kobj=(KML_Object*)new KML_MultiGeometry();
++			kobj->Read(fid,kstri);
++			geometry  ->AddObject((Object*)kobj);
++		}
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Feature::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Placemark::WriteExp {{{*/
++void  KML_Placemark::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++
++	int   i;
++	char  nstr2[81];
++
++/*  loop over the geometry elements for the placemark  */
++
++	for (i=0; i<geometry->Size(); i++) {
++		if (strlen(nstr))
++			sprintf(nstr2,"%s %s",nstr,name);
++		else
++			sprintf(nstr2,"%s",name);
++
++		((KML_Object *)geometry->GetObjectByOffset(i))->WriteExp(fid,nstr2,sgn,cm,sp);
++	}
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 12822)
+@@ -0,0 +1,189 @@
++/*!\file KML_Unknown.cpp
++ * \brief: implementation of the kml_unknown object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Unknown::KML_Unknown(){{{*/
++KML_Unknown::KML_Unknown(){
++
++	name      =NULL;
++	value     =NULL;
++
++}
++/*}}}*/
++/*FUNCTION KML_Unknown::~KML_Unknown(){{{*/
++KML_Unknown::~KML_Unknown(){
++
++	if (name      ) xfree((void**)&name);
++	if (value     ) xfree((void**)&value);
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Unknown::Echo {{{*/
++void  KML_Unknown::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_Unknown " << name << ":");
++	KML_Object::Echo();
++
++	if (value     )
++		if(flag) _pprintLine_("         value: \"" << value << "\"");
++    else
++        if(flag) _pprintLine_("         value: [none]");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Unknown::DeepEcho {{{*/
++void  KML_Unknown::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Unknown::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Unknown::DeepEcho {{{*/
++void  KML_Unknown::DeepEcho(const char* indent){
++
++	char*        valuei;
++	char*        vtoken;
++	char         nl[]={'\n','\0'};
++	bool         flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_Unknown " << name << ":");
++	KML_Object::DeepEcho(indent);
++
++	if (value     ) {
++		valuei=(char *) xmalloc((strlen(value)+1)*sizeof(char));
++		memcpy(valuei,value,(strlen(value)+1)*sizeof(char)); 
++        
++		vtoken=strtok(valuei,nl);
++		if(flag) _pprintString_(indent << "         value: \"" << vtoken);
++    
++		while (vtoken=strtok(NULL,nl))
++			if(flag) _pprintString_("\n" << indent << "                 " << vtoken);
++		if(flag) _pprintLine_("\"");
++
++		xfree((void**)&valuei);
++	}
++    else
++        if(flag) _pprintLine_(indent << "         value: [none]");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Unknown::Write {{{*/
++void  KML_Unknown::Write(FILE* filout,const char* indent){
++
++	char*        valuei;
++	char*        vtoken;
++	char         nl[]={'\n','\0'};
++
++	fprintf(filout,"%s<%s",indent,name);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	if (value     ) {
++		valuei=(char *) xmalloc((strlen(value)+1)*sizeof(char));
++		memcpy(valuei,value,(strlen(value)+1)*sizeof(char)); 
++        
++		vtoken=strtok(valuei,nl);
++		fprintf(filout,"%s  %s\n",indent,vtoken);
++    
++		while (vtoken=strtok(NULL,nl))
++			fprintf(filout,"%s  %s\n",indent,vtoken);
++
++		xfree((void**)&valuei);
++	}
++
++	KML_Object::Write(filout,indent);
++
++	fprintf(filout,"%s</%s>\n",indent,name);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Unknown::Read {{{*/
++void  KML_Unknown::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++	char         nl[]={'\n','\0'};
++
++/*  get object name  */
++
++	name=KMLFileTagName(NULL,
++						kstr);
++//	_pprintLine_("KML_Unknown::Read -- opening name=" << name << ".");
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++//		_pprintLine_("KML_Unknown::Read -- kstri=" << kstri << ".");
++		if      (!strncmp(&kstri[0],"</", 2) &&
++				 !strncmp(&kstri[2],name,strlen(name))) {
++//			_pprintLine_("KML_Unknown::Read -- closing name=" << name << ".");
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");}
++
++		else if (strncmp(kstri,"<",1)) {
++			if (value) {
++				value=(char *) xrealloc(value,(strlen(value)+1+strlen(kstri)+1)*sizeof(char));
++				strcat(value,nl);
++				strcat(value,kstri);
++			}
++			else {
++				value=(char *) xmalloc((strlen(kstri)+1)*sizeof(char));
++				memcpy(value,kstri,(strlen(kstri)+1)*sizeof(char));
++			}
++		}
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Object::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 12822)
+@@ -0,0 +1,164 @@
++/*!\file KML_GroundOverlay.cpp
++ * \brief: implementation of the kml_groundoverlay object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_GroundOverlay::KML_GroundOverlay(){{{*/
++KML_GroundOverlay::KML_GroundOverlay(){
++
++	altitude  = 0.;
++	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
++
++	llbox     =NULL;
++
++}
++/*}}}*/
++/*FUNCTION KML_GroundOverlay::~KML_GroundOverlay(){{{*/
++KML_GroundOverlay::~KML_GroundOverlay(){
++
++	if (llbox) {
++		delete llbox;
++		llbox     =NULL;
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_GroundOverlay::Echo {{{*/
++void  KML_GroundOverlay::Echo(){
++
++	_printLine_("KML_GroundOverlay:");
++	KML_Overlay::Echo();
++
++	_printLine_("         altitude: " << altitude);
++	_printLine_("          altmode: " << altmode);
++	_printLine_("            llbox: " << llbox);
++}
++/*}}}*/
++/*FUNCTION KML_GroundOverlay::DeepEcho {{{*/
++void  KML_GroundOverlay::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_GroundOverlay::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_GroundOverlay::DeepEcho {{{*/
++void  KML_GroundOverlay::DeepEcho(const char* indent){
++
++	char  indent2[81];
++
++	_printLine_(indent << "KML_GroundOverlay:");
++	KML_Overlay::DeepEcho(indent);
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent2,"  ");
++
++	_printLine_(indent<<"      altitude: " << altitude);
++	_printLine_(indent<<"       altmode: " << altmode);
++	if (llbox)
++	 llbox->DeepEcho(indent2);
++	else
++	 _printLine_(indent<<"         llbox: " << llbox);
++}
++/*}}}*/
++/*FUNCTION KML_GroundOverlay::Write {{{*/
++void  KML_GroundOverlay::Write(FILE* filout,const char* indent){
++
++	char  indent2[81];
++
++	fprintf(filout,"%s<GroundOverlay",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Overlay::Write(filout,indent);
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++
++	strcat(indent2,"  ");
++
++	fprintf(filout,"%s  <altitude>%0.16g</altitude>\n",indent,altitude);
++	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
++	if (llbox)
++		llbox->Write(filout,indent2);
++
++	fprintf(filout,"%s</GroundOverlay>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_GroundOverlay::Read {{{*/
++void  KML_GroundOverlay::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</GroundOverlay",15)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strcmp(kstri,"<altitude>"))
++			KMLFileTokenParse(&altitude  ,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<altitudeMode>"))
++			KMLFileTokenParse( altmode   ,NULL,KML_GROUNDOVERLAY_ALTMODE_LENGTH,
++							  kstri,
++							  fid);
++		else if (!strncmp(kstri,"<LatLonBox",10)) {
++			llbox     =new KML_LatLonBox();
++			llbox     ->Read(fid,kstri);
++		}
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Overlay::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h	(revision 12822)
+@@ -0,0 +1,57 @@
++/*! \file KML_Feature.h 
++ *  \brief: header file for kml_feature abstract object
++ */
++
++#ifndef _KML_FEATURE_H_
++#define _KML_FEATURE_H_
++
++#define KML_FEATURE_NAME_LENGTH         80
++#define KML_FEATURE_SNIPPET_LENGTH     160
++#define KML_FEATURE_DESCRIPT_LENGTH   3200
++#define KML_FEATURE_STYLEURL_LENGTH     80
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Object.h"
++class KML_Style;
++class DataSet;
++/*}}}*/
++
++class KML_Feature: public KML_Object {
++
++	public:
++
++		char  name[KML_FEATURE_NAME_LENGTH+1];
++		bool  visibility;
++		bool  open;
++		char  snippet[KML_FEATURE_SNIPPET_LENGTH+1];
++		char  descript[KML_FEATURE_DESCRIPT_LENGTH+1];
++		char  styleurl[KML_FEATURE_STYLEURL_LENGTH+1];
++		DataSet* style;
++
++		/*KML_Feature constructors, destructors {{{*/
++		KML_Feature();
++		~KML_Feature();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_FEATURE_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 12822)
+@@ -0,0 +1,243 @@
++/*!\file KML_Style.cpp
++ * \brief: implementation of the kml_style object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Style::KML_Style(){{{*/
++KML_Style::KML_Style(){
++
++	icon      =NULL;
++	label     =NULL;
++	line      =NULL;
++	poly      =NULL;
++	balloon   =NULL;
++	list      =NULL;
++
++}
++/*}}}*/
++/*FUNCTION KML_Style::~KML_Style(){{{*/
++KML_Style::~KML_Style(){
++
++	if (list) {
++//		delete list;
++		if (list      ) xfree((void**)&list);
++		list      =NULL;
++	}
++	if (balloon) {
++//		delete balloon;
++		if (balloon   ) xfree((void**)&balloon);
++		balloon   =NULL;
++	}
++	if (poly) {
++		delete poly;
++		poly      =NULL;
++	}
++	if (line) {
++		delete line;
++		line      =NULL;
++	}
++	if (label) {
++//		delete label;
++		if (label     ) xfree((void**)&label);
++		label     =NULL;
++	}
++	if (icon) {
++//		delete icon;
++		if (icon      ) xfree((void**)&icon);
++		icon      =NULL;
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Style::Echo {{{*/
++void  KML_Style::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_Style:");
++	KML_StyleSelector::Echo();
++
++	if(flag) _pprintLine_("          icon: " << icon);
++	if(flag) _pprintLine_("         label: " << label);
++	if(flag) _pprintLine_("          line: " << line);
++	if(flag) _pprintLine_("          poly: " << poly);
++	if(flag) _pprintLine_("       balloon: " << balloon);
++	if(flag) _pprintLine_("          list: " << list);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Style::DeepEcho {{{*/
++void  KML_Style::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Style::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Style::DeepEcho {{{*/
++void  KML_Style::DeepEcho(const char* indent){
++
++	char  indent2[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_Style:");
++	KML_StyleSelector::DeepEcho(indent);
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent2,"  ");
++
++//	if (icon)
++//		icon->DeepEcho(indent2);
++//	else
++		if(flag) _pprintLine_(indent << "          icon: " << icon);
++//	if (label)
++//		label->DeepEcho(indent2);
++//	else
++		if(flag) _pprintLine_(indent << "         label: " << label);
++	if (line)
++		line->DeepEcho(indent2);
++	else
++		if(flag) _pprintLine_(indent << "          line: " << line);
++	if (poly)
++		poly->DeepEcho(indent2);
++	else
++		if(flag) _pprintLine_(indent << "          poly: " << poly);
++//	if (balloon)
++//		balloon->DeepEcho(indent2);
++//	else
++		if(flag) _pprintLine_(indent << "       balloon: " << balloon);
++//	if (list)
++//		list->DeepEcho(indent2);
++//	else
++		if(flag) _pprintLine_(indent << "          list: " << list);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Style::Write {{{*/
++void  KML_Style::Write(FILE* filout,const char* indent){
++
++	char  indent2[81];
++
++	fprintf(filout,"%s<Style",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_StyleSelector::Write(filout,indent);
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++
++	strcat(indent2,"  ");
++
++//	if (icon)
++//		icon->Write(filout,indent2);
++//	if (label)
++//		label->Write(filout,indent2);
++	if (line)
++		line->Write(filout,indent2);
++	if (poly)
++		poly->Write(filout,indent2);
++//	if (balloon)
++//		balloon->Write(filout,indent2);
++//	if (list)
++//		list->Write(filout,indent2);
++
++	fprintf(filout,"%s</Style>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Style::Read {{{*/
++void  KML_Style::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</Style", 7)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++//		else if (!strncmp(kstri,"<IconStyle",10)) {
++//			icon      =new KML_IconStyle();
++//			icon      ->Read(fid,kstri);
++//		}
++
++//		else if (!strncmp(kstri,"<LabelStyle",11)) {
++//			label     =new KML_LabelStyle();
++//			label     ->Read(fid,kstri);
++//		}
++
++		else if (!strncmp(kstri,"<LineStyle",10)) {
++			line      =new KML_LineStyle();
++			line      ->Read(fid,kstri);
++		}
++
++		else if (!strncmp(kstri,"<PolyStyle",10)) {
++			poly      =new KML_PolyStyle();
++			poly      ->Read(fid,kstri);
++		}
++
++//		else if (!strncmp(kstri,"<BalloonStyle",13)) {
++//			balloon   =new KML_BalloonStyle();
++//			balloon   ->Read(fid,kstri);
++//		}
++
++//		else if (!strncmp(kstri,"<ListStyle",10)) {
++//			list      =new KML_ListStyle();
++//			list      ->Read(fid,kstri);
++//		}
++
++		else if (!strncmp(kstri,"<",1))
++			KML_StyleSelector::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h	(revision 12822)
+@@ -0,0 +1,57 @@
++/*!\file:  KMLFileReadUtils.h
++ * \brief: header file for kml file reading utilities.
++ */ 
++
++#ifndef _KMLFILEREADUTILS_H
++#define _KMLFILEREADUTILS_H
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "../Object.h"
++/*}}}*/
++
++/* local prototypes: */
++char* KMLFileToken(FILE* fid,
++				   int* pncom,char*** ppcom);
++char* KMLFileTokenComment(FILE* fid);
++void KMLFileTokenBuffer(char** pbuffer,int* pibuf,int* pbuflen,
++						int c,
++						int bufblk);
++char* KMLFileTagName(char* pname,
++					 char* ktag);
++char* KMLFileTagName(char* pname,int *m,int maxlen,
++					 char* ktag);
++int KMLFileTagAttrib(KML_Object* kobj,
++					 char* ktag);
++int KMLFileTokenParse(int* pival,
++					  char* ktag,
++					  FILE* fid);
++int KMLFileTokenParse(bool* pbval,
++					  char* ktag,
++					  FILE* fid);
++char* KMLFileTokenParse(char* pstr,
++						char* ktag,
++						FILE* fid);
++char* KMLFileTokenParse(char* pstr,int *m,int maxlen,
++						char* ktag,
++						FILE* fid);
++int KMLFileTokenParse(float* pfval,
++					  char* ktag,
++					  FILE* fid);
++int KMLFileTokenParse(double* pdval,
++					  char* ktag,
++					  FILE* fid);
++int KMLFileTokenParse(double **pdval,int* m,int maxlen,
++					  char* ktag,
++					  FILE* fid);
++int KMLFileTokenParse(double (**pdval3)[3],int* m,int maxlen,
++					  char* ktag,
++					  FILE* fid);
++int KMLFileTagSkip(char* ktag,
++				   FILE* fid);
++
++#endif  /* _KMLFILEREADUTILS_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.cpp	(revision 12822)
+@@ -0,0 +1,118 @@
++/*!\file KML_Comment.cpp
++ * \brief: implementation of the kml_comment object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Comment::KML_Comment(){{{*/
++KML_Comment::KML_Comment(){
++
++	value     =NULL;
++
++}
++/*}}}*/
++/*FUNCTION KML_Comment::~KML_Comment(){{{*/
++KML_Comment::~KML_Comment(){
++
++	if (value     ) xfree((void**)&value);
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Comment::Echo {{{*/
++void  KML_Comment::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintString_("    ");
++	if(flag) _pprintLine_(value);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Comment::DeepEcho {{{*/
++void  KML_Comment::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Comment::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Comment::DeepEcho {{{*/
++void  KML_Comment::DeepEcho(const char* indent){
++
++	bool  flag=true;
++
++	if(flag) _pprintString_(indent << "    ");
++	if(flag) _pprintLine_(value);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Comment::Write {{{*/
++void  KML_Comment::Write(FILE* filout,const char* indent){
++
++	if (strncmp(&value[0]              ,"<!--",4))
++		fprintf(filout,"%s<!--\n",indent);
++	fprintf(filout,"%s  %s\n",indent,value);
++	if (strncmp(&value[strlen(value)-3],"-->" ,3))
++		fprintf(filout,"%s-->\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Comment::Read {{{*/
++void  KML_Comment::Read(FILE* fid,char* kstr){
++
++//  comments always read as part of KMLFileToken
++
++	;
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Comment::Alloc {{{*/
++void  KML_Comment::Alloc(const char* valuei){
++
++	value=(char *) xmalloc((strlen(valuei)+1)*sizeof(char));
++	memcpy(value,valuei,(strlen(valuei)+1)*sizeof(char));
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Comment::Add {{{*/
++void  KML_Comment::Add(DataSet* commnt){
++
++	commnt->AddObject((Object*)this);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Comment::Get {{{*/
++void  KML_Comment::Get(char** pvalueo){
++
++	*pvalueo=(char *) xmalloc((strlen(value)+1)*sizeof(char));
++	memcpy(*pvalueo,value,(strlen(value)+1)*sizeof(char));
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 12822)
+@@ -0,0 +1,203 @@
++/*!\file KML_MultiGeometry.cpp
++ * \brief: implementation of the kml_multigeometry object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_MultiGeometry::KML_MultiGeometry(){{{*/
++KML_MultiGeometry::KML_MultiGeometry(){
++
++	geometry  =new DataSet;
++
++}
++/*}}}*/
++/*FUNCTION KML_MultiGeometry::~KML_MultiGeometry(){{{*/
++KML_MultiGeometry::~KML_MultiGeometry(){
++
++	if (geometry) {
++		delete geometry;
++		geometry  =NULL;
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_MultiGeometry::Echo {{{*/
++void  KML_MultiGeometry::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_Multigeometry:");
++	KML_Geometry::Echo();
++
++	if(flag) _pprintLine_("      geometry: (size=" << geometry->Size() << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_MultiGeometry::DeepEcho {{{*/
++void  KML_MultiGeometry::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_MultiGeometry::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_MultiGeometry::DeepEcho {{{*/
++void  KML_MultiGeometry::DeepEcho(const char* indent){
++
++	int   i;
++	char  indent2[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_Multigeometry:");
++	KML_Geometry::DeepEcho(indent);
++
++/*  loop over the geometry elements for the multigeometry  */
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent2,"  ");
++
++	if (geometry->Size())
++		for (i=0; i<geometry->Size(); i++) {
++			if(flag) _pprintLine_(indent << "      geometry: -------- begin [" << i << "] --------");
++			((KML_Geometry *)geometry->GetObjectByOffset(i))->DeepEcho(indent2);
++			if(flag) _pprintLine_(indent << "      geometry: --------  end  [" << i << "] --------");
++		}
++	else
++		if(flag) _pprintLine_(indent << "      geometry: [empty]");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_MultiGeometry::Write {{{*/
++void  KML_MultiGeometry::Write(FILE* filout,const char* indent){
++
++	int   i;
++	char  indent2[81];
++
++	fprintf(filout,"%s<MultiGeometry",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Geometry::Write(filout,indent);
++
++/*  loop over the geometry elements for the multigeometry  */
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++
++	strcat(indent2,"  ");
++
++	for (i=0; i<geometry->Size(); i++)
++		((KML_Geometry *)geometry->GetObjectByOffset(i))->Write(filout,indent2);
++
++	fprintf(filout,"%s</MultiGeometry>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_MultiGeometry::Read {{{*/
++void  KML_MultiGeometry::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++	KML_Object*  kobj;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</MultiGeometry",15)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strncmp(kstri,"<Point", 6)) {
++			kobj=(KML_Object*)new KML_Point();
++			kobj->Read(fid,kstri);
++			geometry  ->AddObject((Object*)kobj);
++		}
++
++		else if (!strncmp(kstri,"<LineString",11)) {
++			kobj=(KML_Object*)new KML_LineString();
++			kobj->Read(fid,kstri);
++			geometry  ->AddObject((Object*)kobj);
++		}
++
++		else if (!strncmp(kstri,"<LinearRing",11)) {
++			kobj=(KML_Object*)new KML_LinearRing();
++			kobj->Read(fid,kstri);
++			geometry  ->AddObject((Object*)kobj);
++		}
++
++		else if (!strncmp(kstri,"<Polygon", 8)) {
++			kobj=(KML_Object*)new KML_Polygon();
++			kobj->Read(fid,kstri);
++			geometry  ->AddObject((Object*)kobj);
++		}
++
++		else if (!strncmp(kstri,"<MultiGeometry",14)) {
++			kobj=(KML_Object*)new KML_MultiGeometry();
++			kobj->Read(fid,kstri);
++			geometry  ->AddObject((Object*)kobj);
++		}
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Geometry::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_MultiGeometry::WriteExp {{{*/
++void  KML_MultiGeometry::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++
++	int   i;
++
++/*  loop over the geometry elements for the multigeometry  */
++
++	for (i=0; i<geometry->Size(); i++)
++		((KML_Object *)geometry->GetObjectByOffset(i))->WriteExp(fid,nstr,sgn,cm,sp);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h	(revision 12822)
+@@ -0,0 +1,42 @@
++/*! \file KML_StyleSelector.h 
++ *  \brief: header file for kml_styleselector abstract object
++ */
++
++#ifndef _KML_STYLESELECTOR_H_
++#define _KML_STYLESELECTOR_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Object.h"
++/*}}}*/
++
++class KML_StyleSelector: public KML_Object {
++
++	public:
++
++		/*KML_StyleSelector constructors, destructors {{{*/
++		KML_StyleSelector();
++		~KML_StyleSelector();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_STYLESELECTOR_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h	(revision 12822)
+@@ -0,0 +1,48 @@
++/*! \file KML_LatLonBox.h 
++ *  \brief: header file for kml_latlonbox object
++ */
++
++#ifndef _KML_LATLONBOX_H_
++#define _KML_LATLONBOX_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Object.h"
++/*}}}*/
++
++class KML_LatLonBox: public KML_Object {
++
++	public:
++
++		double north;
++		double south;
++		double east;
++		double west;
++		double rotation;
++
++		/*KML_LatLonBox constructors, destructors {{{*/
++		KML_LatLonBox();
++		~KML_LatLonBox();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_LATLONBOX_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h	(revision 12822)
+@@ -0,0 +1,50 @@
++/*! \file KML_Attribute.h 
++ *  \brief: header file for kml_attribute object
++ */
++
++#ifndef _KML_ATTRIBUTE_H_
++#define _KML_ATTRIBUTE_H_
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "../Object.h"
++class DataSet;
++/*}}}*/
++
++class KML_Attribute: public Object {
++
++	public:
++
++		char* name;
++		char* value;
++
++		/*KML_Attribute constructors, destructors {{{*/
++		KML_Attribute();
++		~KML_Attribute();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		virtual void  Echo();
++		virtual void  DeepEcho();
++		virtual void  DeepEcho(const char* indent);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++		/*virtual functions: */
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		void  Alloc(const char* namei,const char* valuei);
++		void  Add(DataSet* attrib);
++		void  Get(char** pvalueo,char* deflt);
++
++};
++#endif  /* _KML_ATTRIBUTE_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 12822)
+@@ -0,0 +1,138 @@
++/*!\file KML_LineStyle.cpp
++ * \brief: implementation of the kml_linestyle object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_LineStyle::KML_LineStyle(){{{*/
++KML_LineStyle::KML_LineStyle(){
++
++	width     =1.;
++
++}
++/*}}}*/
++/*FUNCTION KML_LineStyle::~KML_LineStyle(){{{*/
++KML_LineStyle::~KML_LineStyle(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_LineStyle::Echo {{{*/
++void  KML_LineStyle::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_LineStyle:");
++	KML_ColorStyle::Echo();
++
++	if(flag) _pprintLine_("         width: " << width);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LineStyle::DeepEcho {{{*/
++void  KML_LineStyle::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_LineStyle::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LineStyle::DeepEcho {{{*/
++void  KML_LineStyle::DeepEcho(const char* indent){
++
++	int   i;
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_LineStyle:");
++	KML_ColorStyle::DeepEcho(indent);
++
++	if(flag) _pprintLine_(indent << "         width: " << width);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LineStyle::Write {{{*/
++void  KML_LineStyle::Write(FILE* filout,const char* indent){
++
++	fprintf(filout,"%s<LineStyle",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_ColorStyle::Write(filout,indent);
++
++	fprintf(filout,"%s  <width>%g</width>\n",indent,width);
++
++	fprintf(filout,"%s</LineStyle>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LineStyle::Read {{{*/
++void  KML_LineStyle::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</LineStyle",11)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strcmp(kstri,"<width>"))
++			KMLFileTokenParse(&width     ,
++							  kstri,
++							  fid);
++
++		else if (!strncmp(kstri,"<",1))
++			KML_ColorStyle::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h	(revision 12822)
+@@ -0,0 +1,45 @@
++/*! \file KML_PolyStyle.h 
++ *  \brief: header file for kml_polystyle object
++ */
++
++#ifndef _KML_POLYSTYLE_H_
++#define _KML_POLYSTYLE_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_ColorStyle.h"
++/*}}}*/
++
++class KML_PolyStyle: public KML_ColorStyle {
++
++	public:
++
++		int   fill;
++		int   outline;
++
++		/*KML_PolyStyle constructors, destructors {{{*/
++		KML_PolyStyle();
++		~KML_PolyStyle();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_POLYSTYLE_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h	(revision 12822)
+@@ -0,0 +1,56 @@
++/*! \file KML_Object.h 
++ *  \brief: header file for kml_object abstract object
++ */
++
++#ifndef _KML_OBJECT_H_
++#define _KML_OBJECT_H_
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "../Object.h"
++class DataSet;
++/*}}}*/
++
++class KML_Object: public Object {
++
++	public:
++
++		DataSet* attrib;
++		DataSet* commnt;
++		DataSet* kmlobj;
++
++		/*KML_Object constructors, destructors {{{*/
++		KML_Object();
++		~KML_Object();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		virtual void  Echo();
++		virtual void  DeepEcho();
++		virtual void  DeepEcho(const char* indent);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++		/*virtual functions: */
++		virtual void  Write(FILE* fid,const char* indent)=0;
++		virtual void  Read(FILE* fid,char* kstr)=0;
++		virtual void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
++		virtual void  AddAttrib(const char* name,const char* value);
++		virtual void  FindAttrib(char** pvalue,char* name,char* deflt);
++		virtual void  WriteAttrib(FILE* fid,const char* indent);
++		virtual void  AddCommnt(int ncom,char** pcom);
++		virtual void  AddCommnt(char* value);
++		virtual void  FindCommnt(char** pvalue,int inum);
++		virtual void  WriteCommnt(FILE* fid,const char* indent);
++
++};
++#endif  /* _KML_OBJECT_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 12822)
+@@ -0,0 +1,131 @@
++/*!\file KML_Folder.cpp
++ * \brief: implementation of the kml_folder object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Folder::KML_Folder(){{{*/
++KML_Folder::KML_Folder(){
++
++	;
++
++}
++/*}}}*/
++/*FUNCTION KML_Folder::~KML_Folder(){{{*/
++KML_Folder::~KML_Folder(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Folder::Echo {{{*/
++void  KML_Folder::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_Folder:");
++	KML_Container::Echo();
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Folder::DeepEcho {{{*/
++void  KML_Folder::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Folder::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Folder::DeepEcho {{{*/
++void  KML_Folder::DeepEcho(const char* indent){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_Folder:");
++	KML_Container::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Folder::Write {{{*/
++void  KML_Folder::Write(FILE* filout,const char* indent){
++
++	fprintf(filout,"%s<Folder",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Container::Write(filout,indent);
++
++	fprintf(filout,"%s</Folder>\n",indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Folder::Read {{{*/
++void  KML_Folder::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</Folder", 8)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Container::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 12822)
+@@ -0,0 +1,131 @@
++/*!\file KML_Document.cpp
++ * \brief: implementation of the kml_document object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Document::KML_Document(){{{*/
++KML_Document::KML_Document(){
++
++	;
++
++}
++/*}}}*/
++/*FUNCTION KML_Document::~KML_Document(){{{*/
++KML_Document::~KML_Document(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Document::Echo {{{*/
++void  KML_Document::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_Document:");
++	KML_Container::Echo();
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Document::DeepEcho {{{*/
++void  KML_Document::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Document::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Document::DeepEcho {{{*/
++void  KML_Document::DeepEcho(const char* indent){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_Document:");
++	KML_Container::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Document::Write {{{*/
++void  KML_Document::Write(FILE* filout,const char* indent){
++
++	fprintf(filout,"%s<Document",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Container::Write(filout,indent);
++
++	fprintf(filout,"%s</Document>\n",indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_Document::Read {{{*/
++void  KML_Document::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</Document",10)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Container::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h	(revision 12822)
+@@ -0,0 +1,42 @@
++/*! \file KML_SubStyle.h 
++ *  \brief: header file for kml_substyle abstract object
++ */
++
++#ifndef _KML_SUBSTYLE_H_
++#define _KML_SUBSTYLE_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Object.h"
++/*}}}*/
++
++class KML_SubStyle: public KML_Object {
++
++	public:
++
++		/*KML_SubStyle constructors, destructors {{{*/
++		KML_SubStyle();
++		~KML_SubStyle();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_SUBSTYLE_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 12822)
+@@ -0,0 +1,140 @@
++/*!\file KML_File.cpp
++ * \brief: implementation of the kml_file object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_File::KML_File(){{{*/
++KML_File::KML_File(){
++
++	;
++
++}
++/*}}}*/
++/*FUNCTION KML_File::~KML_File(){{{*/
++KML_File::~KML_File(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_File::Echo {{{*/
++void  KML_File::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_File:");
++	KML_Object::Echo();
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_File::DeepEcho {{{*/
++void  KML_File::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_File::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_File::DeepEcho {{{*/
++void  KML_File::DeepEcho(const char* indent){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_File:");
++	KML_Object::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_File::Write {{{*/
++void  KML_File::Write(FILE* filout,const char* indent){
++
++	fprintf(filout,"%s<kml",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Object::Write(filout,indent);
++
++	fprintf(filout,"%s</kml>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_File::Read {{{*/
++void  KML_File::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++	KML_Object*  kobj;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</kml", 5)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Object::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_File::WriteExp {{{*/
++void  KML_File::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++
++	int   i;
++
++/*  loop over the kml objects for the file  */
++
++	for (i=0; i<kmlobj->Size(); i++)
++		((KML_Object *)kmlobj->GetObjectByOffset(i))->WriteExp(fid,nstr,sgn,cm,sp);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h	(revision 12822)
+@@ -0,0 +1,51 @@
++/*! \file KML_LineString.h 
++ *  \brief: header file for kml_linestring object
++ */
++
++#ifndef _KML_LINESTRING_H_
++#define _KML_LINESTRING_H_
++
++#define KML_LINESTRING_ALTMODE_LENGTH    18
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Geometry.h"
++/*}}}*/
++
++class KML_LineString: public KML_Geometry {
++
++	public:
++
++		bool    extrude;
++		bool    tessellate;
++		char    altmode[KML_LINESTRING_ALTMODE_LENGTH+1];
++		int     ncoord;
++		double *coords;
++
++		/*KML_LineString constructors, destructors {{{*/
++		KML_LineString();
++		~KML_LineString();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_LINESTRING_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h	(revision 12822)
+@@ -0,0 +1,49 @@
++/*! \file KML_Overlay.h 
++ *  \brief: header file for kml_overlay abstract object
++ */
++
++#ifndef _KML_OVERLAY_H_
++#define _KML_OVERLAY_H_
++
++#define KML_OVERLAY_COLOR_LENGTH  8
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Feature.h"
++class KML_Icon;
++/*}}}*/
++
++class KML_Overlay: public KML_Feature {
++
++	public:
++
++		char  color[KML_OVERLAY_COLOR_LENGTH+1];
++		int   draword;
++		KML_Icon* icon;
++
++		/*KML_Overlay constructors, destructors {{{*/
++		KML_Overlay();
++		~KML_Overlay();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_OVERLAY_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h	(revision 12822)
+@@ -0,0 +1,46 @@
++/*! \file KML_Container.h 
++ *  \brief: header file for kml_container abstract object
++ */
++
++#ifndef _KML_CONTAINER_H_
++#define _KML_CONTAINER_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Feature.h"
++class DataSet;
++/*}}}*/
++
++class KML_Container: public KML_Feature {
++
++	public:
++
++		DataSet* feature;
++
++		/*KML_Container constructors, destructors {{{*/
++		KML_Container();
++		~KML_Container();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_CONTAINER_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 12822)
+@@ -0,0 +1,182 @@
++/*!\file KML_Icon.cpp
++ * \brief: implementation of the kml_feature abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Icon::KML_Icon(){{{*/
++KML_Icon::KML_Icon(){
++
++	strcpy(href      ,"");
++	strcpy(refmode   ,"onChange");
++	refint    = 4.;
++	strcpy(vrefmode  ,"never");
++	vreftime  = 4.;
++	vboundsc  = 1.;
++	strcpy(vformat   ,"");
++	strcpy(hquery    ,"");
++
++}
++/*}}}*/
++/*FUNCTION KML_Icon::~KML_Icon(){{{*/
++KML_Icon::~KML_Icon(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Icon::Echo {{{*/
++void  KML_Icon::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_Icon:");
++	KML_Object::Echo();
++
++	if(flag) _pprintLine_("          href: \"" << href << "\"");
++	if(flag) _pprintLine_("       refmode: \"" << refmode << "\"");
++	if(flag) _pprintLine_("        refint: " << refint);
++	if(flag) _pprintLine_("      vrefmode: \"" << vrefmode << "\"");
++	if(flag) _pprintLine_("      vreftime: " << vreftime);
++	if(flag) _pprintLine_("      vboundsc: " << vboundsc);
++	if(flag) _pprintLine_("       vformat: \"" << vformat << "\"");
++	if(flag) _pprintLine_("        hquery: \"" << hquery << "\"");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Icon::DeepEcho {{{*/
++void  KML_Icon::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Icon::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Icon::DeepEcho {{{*/
++void  KML_Icon::DeepEcho(const char* indent){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_Icon:");
++	KML_Object::DeepEcho(indent);
++
++	if(flag) _pprintLine_(indent << "          href: \"" << href << "\"");
++	if(flag) _pprintLine_(indent << "       refmode: \"" << refmode << "\"");
++	if(flag) _pprintLine_(indent << "        refint: " << refint);
++	if(flag) _pprintLine_(indent << "      vrefmode: \"" << vrefmode << "\"");
++	if(flag) _pprintLine_(indent << "      vreftime: " << vreftime);
++	if(flag) _pprintLine_(indent << "      vboundsc: " << vboundsc);
++	if(flag) _pprintLine_(indent << "       vformat: \"" << vformat << "\"");
++	if(flag) _pprintLine_(indent << "        hquery: \"" << hquery << "\"");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Icon::Write {{{*/
++void  KML_Icon::Write(FILE* filout,const char* indent){
++
++	fprintf(filout,"%s<Icon",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Object::Write(filout,indent);
++
++	if (href     && strlen(href))
++		fprintf(filout,"%s  <href>%s</href>\n",indent,href);
++	if (refmode  && strlen(refmode))
++		fprintf(filout,"%s  <refreshMode>%s</refreshMode>\n",indent,refmode);
++	fprintf(filout,"%s  <refreshInterval>%g</refreshInterval>\n",indent,refint);
++	if (vrefmode && strlen(vrefmode))
++		fprintf(filout,"%s  <viewRefreshMode>%s</viewRefreshMode>\n",indent,vrefmode);
++	fprintf(filout,"%s  <viewRefreshTime>%g</viewRefreshTime>\n",indent,vreftime);
++	fprintf(filout,"%s  <viewBoundScale>%g</viewBoundScale>\n",indent,vboundsc);
++	if (vformat  && strlen(vformat))
++		fprintf(filout,"%s  <viewFormat>%s</viewFormat>\n",indent,vformat);
++	if (hquery   && strlen(hquery))
++		fprintf(filout,"%s  <httpQuery>%s</httpQuery>\n",indent,hquery);
++
++	fprintf(filout,"%s</Icon>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Icon::Read {{{*/
++void  KML_Icon::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</Icon", 6)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strcmp(kstri,"<href>"))
++			KMLFileTokenParse( href      ,NULL,KML_ICON_HREF_LENGTH, kstri, fid);
++		else if (!strcmp(kstri,"<refreshMode>"))
++			KMLFileTokenParse( refmode   ,NULL,KML_ICON_REFMODE_LENGTH, kstri, fid);
++		else if (!strcmp(kstri,"<refreshInterval>"))
++			KMLFileTokenParse(&refint    , kstri, fid);
++		else if (!strcmp(kstri,"<viewRefreshMode>"))
++			KMLFileTokenParse( vrefmode  ,NULL,KML_ICON_VREFMODE_LENGTH, kstri, fid);
++		else if (!strcmp(kstri,"<viewRefreshTime>"))
++			KMLFileTokenParse(&vreftime  , kstri, fid);
++		else if (!strcmp(kstri,"<viewBoundScale>"))
++			KMLFileTokenParse(&vboundsc  , kstri, fid);
++		else if (!strcmp(kstri,"<viewFormat>"))
++			KMLFileTokenParse( vformat   ,NULL,KML_ICON_VFORMAT_LENGTH, kstri, fid);
++		else if (!strcmp(kstri,"<httpQuery>"))
++			KMLFileTokenParse( hquery    ,NULL,KML_ICON_HQUERY_LENGTH, kstri, fid);
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Object::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 12822)
+@@ -0,0 +1,193 @@
++/*!\file KML_Point.cpp
++ * \brief: implementation of the kml_point object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++#include "../../modules/Ll2xyx/Ll2xyx.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Point::KML_Point(){{{*/
++KML_Point::KML_Point(){
++
++	extrude   =false;
++	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
++
++	coords[0] = 0.;
++	coords[1] = 0.;
++	coords[2] = 0.;
++
++}
++/*}}}*/
++/*FUNCTION KML_Point::~KML_Point(){{{*/
++KML_Point::~KML_Point(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Point::Echo {{{*/
++void  KML_Point::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_Point:");
++	KML_Geometry::Echo();
++
++	if(flag) _pprintLine_("       extrude: " << (extrude ? "true" : "false"));
++	if(flag) _pprintLine_("       altmode: \"" << altmode << "\"");
++	if(flag) _pprintLine_("        coords: (" << coords[0] << "," << coords[1] << "," << coords[2] << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Point::DeepEcho {{{*/
++void  KML_Point::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Point::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Point::DeepEcho {{{*/
++void  KML_Point::DeepEcho(const char* indent){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_Point:");
++	KML_Geometry::DeepEcho(indent);
++
++	if(flag) _pprintLine_(indent << "       extrude: " << (extrude ? "true" : "false"));
++	if(flag) _pprintLine_(indent << "       altmode: \"" << altmode << "\"");
++	if(flag) _pprintLine_(indent << "        coords: (" << coords[0] << "," << coords[1] << "," << coords[2] << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Point::Write {{{*/
++void  KML_Point::Write(FILE* filout,const char* indent){
++
++	fprintf(filout,"%s<Point",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Geometry::Write(filout,indent);
++
++	fprintf(filout,"%s  <extrude>%d</extrude>\n",indent,(extrude ? 1 : 0));
++	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
++	fprintf(filout,"%s  <coordinates>%0.16g,%0.16g,%0.16g</coordinates>\n",
++			indent,coords[0],coords[1],coords[2]);
++
++	fprintf(filout,"%s</Point>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Point::Read {{{*/
++void  KML_Point::Read(FILE* fid,char* kstr){
++
++	double*      pcoords=&coords[0];
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</Point", 7)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strcmp(kstri,"<extrude>"))
++			KMLFileTokenParse(&extrude   , kstri, fid);
++		else if (!strcmp(kstri,"<altitudeMode>"))
++			KMLFileTokenParse( altmode   ,NULL,KML_POINT_ALTMODE_LENGTH, kstri, fid);
++		else if (!strcmp(kstri,"<coordinates>"))
++			KMLFileTokenParse(&pcoords   ,NULL,3, kstri, fid);
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Geometry::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Point::WriteExp {{{*/
++void  KML_Point::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++
++	int     i;
++	double  lat,lon,x,y;
++	char    nstr2[81];
++
++/*  extract latitude and longitude  */
++
++	lon=coords[0];
++	lat=coords[1];
++
++/*  convert latitude and longitude to x and y  */
++
++	Ll2xyx(&x,&y,&lat,&lon,1,sgn,cm,sp);
++
++/*  write header  */
++
++	memcpy(nstr2,nstr,(strlen(nstr)+1)*sizeof(char));
++
++	for (i=0; i<strlen(nstr2); i++)
++		if ((nstr2[i] == ' ') || (nstr2[i] == '\t'))
++			nstr2[i]='_';
++	fprintf(fid,"## Name:%s\n",nstr2);
++	fprintf(fid,"## Icon:0\n");
++	fprintf(fid,"# Points Count	Value\n");
++    fprintf(fid,"%u	%s\n",1,"1.");
++	fprintf(fid,"# X pos	Y pos\n");
++
++/*  write vertex  */
++
++    fprintf(fid,"%lf\t%lf\n",x,y);
++
++/*  write blank line  */
++
++	fprintf(fid,"\n");
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 12822)
+@@ -0,0 +1,223 @@
++/*!\file KML_LinearRing.cpp
++ * \brief: implementation of the kml_linearring object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++#include "../../io/io.h"
++#include "../../modules/Ll2xyx/Ll2xyx.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_LinearRing::KML_LinearRing(){{{*/
++KML_LinearRing::KML_LinearRing(){
++
++	extrude   =false;
++	tessellate=false;
++	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
++
++	ncoord    =0;
++	coords    =NULL;
++
++}
++/*}}}*/
++/*FUNCTION KML_LinearRing::~KML_LinearRing(){{{*/
++KML_LinearRing::~KML_LinearRing(){
++
++	if (coords) xDelete<double>(coords);
++
++	coords    =NULL;
++	ncoord    =0;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_LinearRing::Echo {{{*/
++void  KML_LinearRing::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_LinearRing:");
++	KML_Geometry::Echo();
++
++	if(flag) _pprintLine_("       extrude: " << (extrude ? "true" : "false"));
++	if(flag) _pprintLine_("    tessellate: " << (tessellate ? "true" : "false"));
++	if(flag) _pprintLine_("       altmode: \"" << altmode << "\"");
++	if(flag) _pprintLine_("        coords: (ncoord=" << ncoord << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LinearRing::DeepEcho {{{*/
++void  KML_LinearRing::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_LinearRing::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LinearRing::DeepEcho {{{*/
++void  KML_LinearRing::DeepEcho(const char* indent){
++
++	int   i;
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_LinearRing:");
++	KML_Geometry::DeepEcho(indent);
++
++	if(flag) _pprintLine_(indent << "       extrude: " << (extrude ? "true" : "false"));
++	if(flag) _pprintLine_(indent << "    tessellate: " << (tessellate ? "true" : "false"));
++	if(flag) _pprintLine_(indent << "       altmode: \"" << altmode << "\"");
++	if(flag) _pprintLine_(indent << "        coords: (ncoord=" << ncoord << ")");
++	for (i=0; i<ncoord; i++)
++		_printf_(flag,"%s                (%g,%g,%g)\n",indent,
++				coords[3*i+0],coords[3*i+1],coords[3*i+2]);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LinearRing::Write {{{*/
++void  KML_LinearRing::Write(FILE* filout,const char* indent){
++
++	int   i;
++
++	fprintf(filout,"%s<LinearRing",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Geometry::Write(filout,indent);
++
++	fprintf(filout,"%s  <extrude>%d</extrude>\n",indent,(extrude ? 1 : 0));
++	fprintf(filout,"%s  <tessellate>%d</tessellate>\n",indent,(tessellate ? 1 : 0));
++	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
++	fprintf(filout,"%s  <coordinates>\n",indent);
++
++/*  loop over the coordinates for the linearring  */
++
++	for (i=0; i<ncoord; i++)
++		fprintf(filout,"%s    %0.16g,%0.16g,%0.16g\n",indent,coords[3*i+0],coords[3*i+1],coords[3*i+2]);
++
++	fprintf(filout,"%s  </coordinates>\n",indent);
++	fprintf(filout,"%s</LinearRing>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LinearRing::Read {{{*/
++void  KML_LinearRing::Read(FILE* fid,char* kstr){
++
++	char  *kstri = NULL;
++	int    ncom  = 0;
++	char **pcom  = NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,kstr)) return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,&ncom,&pcom)){
++		if (!strncmp(kstri,"</LinearRing",12)){
++			xDelete<char>(kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strcmp(kstri,"<extrude>"))
++			KMLFileTokenParse(&extrude,kstri,fid);
++		else if (!strcmp(kstri,"<tessellate>"))
++			KMLFileTokenParse(&tessellate,kstri,fid);
++		else if (!strcmp(kstri,"<altitudeMode>"))
++			KMLFileTokenParse(altmode,NULL,KML_LINEARRING_ALTMODE_LENGTH,kstri,fid);
++		else if (!strcmp(kstri,"<coordinates>"))
++			KMLFileTokenParse(&coords,&ncoord,0,kstri,fid);
++		else if (!strncmp(kstri,"<",1))
++			KML_Geometry::Read(fid,kstri);
++
++		xDelete<char>(kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for(ncom;ncom>0;ncom--) xDelete<char>((pcom[ncom-1]));
++	xDelete<char*>(pcom);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LinearRing::WriteExp {{{*/
++void  KML_LinearRing::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++
++	int     i;
++	double  *lat,*lon,*x,*y;
++	char    nstr2[81];
++
++/*  extract latitude and longitude into vectors  */
++
++	lat=xNew<double>(ncoord);
++	lon=xNew<double>(ncoord);
++	for (i=0; i<ncoord; i++) {
++		lon[i]=coords[3*i+0];
++		lat[i]=coords[3*i+1];
++	}
++
++/*  convert latitude and longitude to x and y  */
++
++	x  =xNew<double>(ncoord);
++	y  =xNew<double>(ncoord);
++	Ll2xyx(x,y,lat,lon,ncoord,sgn,cm,sp);
++
++/*  write header  */
++
++	memcpy(nstr2,nstr,(strlen(nstr)+1)*sizeof(char));
++
++	for (i=0; i<strlen(nstr2); i++)
++		if ((nstr2[i] == ' ') || (nstr2[i] == '\t'))
++			nstr2[i]='_';
++	fprintf(fid,"## Name:%s\n",nstr2);
++	fprintf(fid,"## Icon:0\n");
++	fprintf(fid,"# Points Count	Value\n");
++	if ((lat[ncoord-1] != lat[0]) || (lon[ncoord-1] != lon[0]))
++	    fprintf(fid,"%u	%s\n",ncoord+1,"1.");
++	else
++	    fprintf(fid,"%u	%s\n",ncoord  ,"1.");
++	fprintf(fid,"# X pos	Y pos\n");
++
++/*  write vertices, making sure ring is closed  */
++
++	for (i=0; i<ncoord; i++)
++	    fprintf(fid,"%lf\t%lf\n",x[i],y[i]);
++	if ((lat[ncoord-1] != lat[0]) || (lon[ncoord-1] != lon[0]))
++	    fprintf(fid,"%lf\t%lf\n",x[0],y[0]);
++
++/*  write blank line  */
++
++	fprintf(fid,"\n");
++
++	xDelete<double>(y);
++	xDelete<double>(x);
++	xDelete<double>(lon);
++	xDelete<double>(lat);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp	(revision 12822)
+@@ -0,0 +1,179 @@
++/*!\file KML_Feature.cpp
++ * \brief: implementation of the kml_feature abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Feature::KML_Feature(){{{*/
++KML_Feature::KML_Feature(){
++
++	memcpy(name,"",(strlen("")+1)*sizeof(char));
++
++	visibility=true;
++	open      =false;
++	memcpy(snippet,"",(strlen("")+1)*sizeof(char));
++	memcpy(descript,"",(strlen("")+1)*sizeof(char));
++	memcpy(styleurl,"",(strlen("")+1)*sizeof(char));
++	style     =new DataSet;
++
++}
++/*}}}*/
++/*FUNCTION KML_Feature::~KML_Feature(){{{*/
++KML_Feature::~KML_Feature(){
++
++	if (style) {
++		delete style;
++		style     =NULL;
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Feature::Echo {{{*/
++void  KML_Feature::Echo(){
++
++	bool  flag=true;
++
++	KML_Object::Echo();
++
++	if(flag) _pprintLine_("          name: \"" << name << "\"");
++	if(flag) _pprintLine_("    visibility: " << (visibility ? "true" : "false"));
++	if(flag) _pprintLine_("          open: " << (open ? "true" : "false"));
++	if(flag) _pprintLine_("       snippet: \"" << snippet << "\"");
++	if(flag) _pprintLine_("      descript: \"" << descript << "\"");
++	if(flag) _pprintLine_("      styleurl: \"" << styleurl << "\"");
++	if(flag) _pprintLine_("         style: (size=" << style->Size() << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Feature::DeepEcho {{{*/
++void  KML_Feature::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Feature::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Feature::DeepEcho {{{*/
++void  KML_Feature::DeepEcho(const char* indent){
++
++	int   i;
++	char  indent2[81];
++	bool  flag=true;
++
++	KML_Object::DeepEcho(indent);
++
++	if(flag) _pprintLine_(indent << "          name: \"" << name << "\"");
++	if(flag) _pprintLine_(indent << "    visibility: " << (visibility ? "true" : "false"));
++	if(flag) _pprintLine_(indent << "          open: " << (open ? "true" : "false"));
++	if(flag) _pprintLine_(indent << "       snippet: \"" << snippet << "\"");
++	if(flag) _pprintLine_(indent << "      descript: \"" << descript << "\"");
++	if(flag) _pprintLine_(indent << "      styleurl: \"" << styleurl << "\"");
++
++/*  loop over any styles for the feature  */
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent2,"  ");
++
++	if (style->Size())
++		for (i=0; i<style->Size(); i++) {
++			if(flag) _pprintLine_(indent << "         style: -------- begin [" << i << "] --------");
++			((KML_Style *)style->GetObjectByOffset(i))->DeepEcho(indent2);
++			if(flag) _pprintLine_(indent << "         style: --------  end  [" << i << "] --------");
++		}
++	else
++		if(flag) _pprintLine_(indent << "         style: [empty]");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Feature::Write {{{*/
++void  KML_Feature::Write(FILE* filout,const char* indent){
++
++	int   i;
++	char  indent2[81];
++
++	KML_Object::Write(filout,indent);
++
++	if (name     && strlen(name))
++		fprintf(filout,"%s  <name>%s</name>\n",indent,name);
++	fprintf(filout,"%s  <visibility>%d</visibility>\n",indent,(visibility ? 1 : 0));
++	fprintf(filout,"%s  <open>%d</open>\n",indent,(open ? 1 : 0));
++	if (snippet  && strlen(snippet))
++		fprintf(filout,"%s  <Snippet maxLines=\"2\">%s</Snippet>\n",indent,snippet);
++	if (descript && strlen(descript))
++		fprintf(filout,"%s  <description>%s</description>\n",indent,descript);
++	if (styleurl && strlen(styleurl))
++		fprintf(filout,"%s  <styleUrl>%s</styleUrl>\n",indent,styleurl);
++
++/*  loop over any styles for the feature  */
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++
++	strcat(indent2,"  ");
++
++    for (i=0; i<style->Size(); i++)
++        ((KML_Style *)style->GetObjectByOffset(i))->Write(filout,indent2);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Feature::Read {{{*/
++void  KML_Feature::Read(FILE* fid,char* kstr){
++
++	KML_Object*  kobj;
++
++/*  process field within opening and closing tags  */
++
++	if      (!strncmp(kstr,"</Feature", 9))
++		return;
++	else if (!strncmp(kstr,"</",2))
++	  {_error2_("KML_Feature::Read -- Unexpected closing tag " << kstr);}
++	else if (strncmp(kstr,"<",1))
++	  {_error2_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");}
++
++	else if (!strncmp(kstr,"<Style", 6)) {
++		kobj=(KML_Object*)new KML_Style();
++		kobj->Read(fid,kstr);
++		style     ->AddObject((Object*)kobj);
++	}
++
++	else if (!strcmp(kstr,"<name>"))
++		KMLFileTokenParse( name      ,NULL,KML_FEATURE_NAME_LENGTH, kstr, fid);
++	else if (!strcmp(kstr,"<visibility>"))
++		KMLFileTokenParse(&visibility, kstr, fid);
++	else if (!strcmp(kstr,"<open>"))
++		KMLFileTokenParse(&open      , kstr, fid);
++	else if (!strncmp(kstr,"<snippet", 8))
++		KMLFileTokenParse( snippet   ,NULL,KML_FEATURE_SNIPPET_LENGTH, kstr, fid);
++	else if (!strcmp(kstr,"<description>"))
++		KMLFileTokenParse( descript  ,NULL,KML_FEATURE_DESCRIPT_LENGTH, kstr, fid);
++	else if (!strcmp(kstr,"<styleUrl>"))
++		KMLFileTokenParse( styleurl  ,NULL,KML_FEATURE_STYLEURL_LENGTH, kstr, fid);
++
++	else if (!strncmp(kstr,"<",1))
++		KML_Object::Read(fid,kstr);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h	(revision 12822)
+@@ -0,0 +1,53 @@
++/*! \file KML_Polygon.h 
++ *  \brief: header file for kml_polygon object
++ */
++
++#ifndef _KML_POLYGON_H_
++#define _KML_POLYGON_H_
++
++#define KML_POLYGON_ALTMODE_LENGTH    18
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Geometry.h"
++class KML_LinearRing;
++class DataSet;
++/*}}}*/
++
++class KML_Polygon: public KML_Geometry {
++
++	public:
++
++		bool  extrude;
++		bool  tessellate;
++		char  altmode[KML_POLYGON_ALTMODE_LENGTH+1];
++		DataSet* outer;
++		DataSet* inner;
++
++		/*KML_Polygon constructors, destructors {{{*/
++		KML_Polygon();
++		~KML_Polygon();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_POLYGON_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 12822)
+@@ -0,0 +1,700 @@
++/*!\file KMLFileUtils.cpp
++ * \brief: utilities for kml file reading.
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*FUNCTION  KMLFileToken(FILE* fid,int* pncom=NULL,char*** ppcom=NULL) {{{*/
++char* KMLFileToken(FILE* fid,
++				   int* pncom=NULL,char*** ppcom=NULL){
++
++/*  get the next token (tag or field) in the file  */
++
++	bool    inew=1,itag=0,ifield=0;
++	int     c;
++	int     ibuf=0,buflen=1024,bufblk=1024;
++	char    *buffer=NULL,*bufferc=NULL;
++
++	buffer=(char *) xmalloc(buflen*sizeof(char));
++	buffer[0]='\0';
++
++/*  read kml file character-by-character  */
++
++//  note that fgets includes newline
++//	fgets(buffer,buflen,fid);
++
++	while ((c=getc(fid)) != EOF) {
++		/*  ignore leading blanks  */
++		if (inew && isspace(c))
++			continue;
++
++		/*  distinguish between tag or field  */
++		if (!itag && !ifield) {
++
++			/*  distinguish between tag or comment  */
++			if (c == '<') {
++				ungetc(c,fid);
++				if (!(bufferc=KMLFileTokenComment(fid))) {
++					c=getc(fid);
++					itag=1;
++				}
++				else {
++					if (pncom && ppcom) {
++						(*pncom)++;
++						*ppcom=(char **) xrealloc(*ppcom,*pncom*sizeof(char*));
++						(*ppcom)[*pncom-1]=bufferc;
++					}
++					else
++						xfree((void**)&bufferc);
++					inew=1;
++					continue;
++				}
++			}
++			else
++				ifield=1;
++			inew=0;
++			KMLFileTokenBuffer(&buffer,&ibuf,&buflen,
++							   c,
++							   bufblk);
++		}
++
++		/*  accumulate tag, not including newlines  */
++		else if (itag) {
++			if (c != '\n') {
++				inew=0;
++				KMLFileTokenBuffer(&buffer,&ibuf,&buflen,
++								   c,
++								   bufblk);
++				if (c == '>')
++					break;
++			}
++			else
++				inew=1;
++		}
++
++		/*  accumulate field, including newlines  */
++		else if (ifield) {
++			/*  distinguish between another tag or comment  */
++			if (c == '<') {
++				ungetc(c,fid);
++				if (!(bufferc=KMLFileTokenComment(fid)))
++					break;
++				else
++					if (pncom && ppcom) {
++						(*pncom)++;
++						*ppcom=(char **) xrealloc(*ppcom,*pncom*sizeof(char*));
++						(*ppcom)[*pncom-1]=bufferc;
++					}
++					else
++						xfree((void**)&bufferc);
++			}
++			else {
++				inew=0;
++				KMLFileTokenBuffer(&buffer,&ibuf,&buflen,
++								   c,
++								   bufblk);
++				if (c == '\n')
++					inew=1;
++			}
++		}
++
++	}
++
++/*  remove trailing blanks or newline  */
++
++	while (ibuf > 0)
++		if (isspace(buffer[ibuf-1]))
++			ibuf--;
++		else {
++			buffer[ibuf]='\0';
++			break;
++		}
++
++//	if      (itag)
++//		_pprintLine_("tag buffer (length=" << ibuf << "):");
++//	else if (ifield)
++//		_pprintLine_("field buffer (length=" << ibuf << "):");
++//	_pprintLine_(buffer);
++
++	if (!ibuf)
++		xfree((void**)&buffer);
++
++	return(buffer);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTokenComment(FILE* fid) {{{*/
++char* KMLFileTokenComment(FILE* fid){
++
++/*  check for comment in the file and read it  */
++
++	bool    inew=1;
++	int     i;
++	int     c;
++	int     ibuf=0,buflen=1024,bufblk=1024;
++	char*   buffer=NULL;
++
++	buffer=(char *) xmalloc(buflen*sizeof(char));
++	buffer[0]='\0';
++
++/*  read kml file character-by-character  */
++
++	while ((c=getc(fid)) != EOF) {
++		/*  ignore leading blanks  */
++		if (inew && isspace(c))
++			continue;
++
++		inew=0;
++		KMLFileTokenBuffer(&buffer,&ibuf,&buflen,
++						   c,
++						   bufblk);
++
++		/*  check for comment  */
++		if (ibuf <= 4) {
++			if ((ibuf == 1 && buffer[0] != '<') ||
++				(ibuf == 2 && buffer[1] != '!') ||
++				(ibuf == 3 && buffer[2] != '-') ||
++				(ibuf == 4 && buffer[3] != '-')) {
++				for (i=ibuf-1; i>=0; i--)
++					ungetc(buffer[i],fid);
++				xfree((void**)&buffer);
++				return(buffer);
++			}
++		}
++
++		/*  accumulate comment, including newlines  */
++		else
++			if (buffer[ibuf-3]=='-' && buffer[ibuf-2]=='-' && buffer[ibuf-1]=='>')
++				break;
++	}
++
++/*  remove trailing blanks or newline  */
++
++	while (ibuf > 0)
++		if (isspace(buffer[ibuf-1]))
++			ibuf--;
++		else {
++			buffer[ibuf]='\0';
++			break;
++		}
++
++//	_pprintLine_("comment buffer (length=" << ibuf << "):");
++//	_pprintLine_(buffer);
++
++	if (!ibuf)
++		xfree((void**)&buffer);
++
++	return(buffer);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTokenBuffer {{{*/
++void KMLFileTokenBuffer(char** pbuffer,int* pibuf,int* pbuflen,
++						int c,
++						int bufblk){
++
++/*  add the specified character to the token buffer  */
++
++	char*   buffer=NULL;
++
++/*  check buffer length and realloc if necessary  */
++
++	if (*pibuf+2 > *pbuflen) {
++		*pbuflen+=bufblk;
++		*pbuffer=(char *) xrealloc(*pbuffer,*pbuflen*sizeof(char));
++	}
++
++/*  add character and terminator  */
++
++	(*pbuffer)[(*pibuf)++]=c;
++	(*pbuffer)[ *pibuf   ]='\0';
++
++	return;
++}
++/*}}}*/
++/*FUNCTION  KMLFileTagName {{{*/
++char* KMLFileTagName(char* pname,
++					 char* ktag){
++
++	return(KMLFileTagName(pname,NULL,0,
++						  ktag));
++}
++/*}}}*/
++/*FUNCTION  KMLFileTagName {{{*/
++char* KMLFileTagName(char* pname,int *m,int maxlen,
++					 char* ktag){
++
++/*  for the given tag buffer, read and store the name  */
++
++	char*   ktagi;
++	char*   ktokn;
++
++	if (strncmp(&ktag[0],"<"        ,1) || strncmp(&ktag[strlen(ktag)-1],">",1))
++		_error2_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n");
++
++/*  strtok modifies ktag, so work on copy  */
++
++	ktagi=(char *) xmalloc((strlen(ktag)+1)*sizeof(char));
++	memcpy(ktagi,ktag,(strlen(ktag)+1)*sizeof(char));
++
++/*  skip opening delimeter and find subsequent blank or closing delimiter  */
++
++	ktokn=strtok(ktagi,"< >");
++//	_pprintLine_("KMLFileTagName -- initial token=\"" << ktokn << "\".");
++
++	if (!pname) {
++		if (maxlen)
++			pname=(char *) xmalloc((maxlen       +1)*sizeof(char));
++		else
++			pname=(char *) xmalloc((strlen(ktokn)+1)*sizeof(char));
++	}
++
++	if (maxlen && (maxlen < strlen(ktokn))) {
++		_pprintLine_("KMLFileTagName -- string field too short for " << ktag << ".");
++		_pprintLine_("KMLFileTagName -- \"" << ktokn << "\" truncated to " << maxlen << " characters.");
++		strncpy(pname,ktokn,maxlen);
++	}
++	else
++		memcpy(pname,ktokn,(strlen(ktokn)+1)*sizeof(char));
++
++	xfree((void**)&ktagi);
++
++	if (m)
++		*m=strlen(pname);
++
++	return(pname);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTagAttrib {{{*/
++int KMLFileTagAttrib(KML_Object* kobj,
++					 char* ktag){
++
++/*  for the given tag buffer, read and store the attributes  */
++
++	char*   ktagi;
++	char*   ktokn;
++	char*   ktokv;
++	char    quote[]={'\"','\0'};
++	int     isolo=0;
++
++/*  strtok modifies ktag, so work on copy  */
++
++	ktagi=(char *) xmalloc((strlen(ktag)+1)*sizeof(char));
++	memcpy(ktagi,ktag,(strlen(ktag)+1)*sizeof(char));
++
++/*  loop through tag to find all attributes  */
++
++	/*  return first non blank and move past subsequent blank  */
++	ktokn=strtok(ktagi," ");
++//	_pprintLine_("KMLFileTagAttrib -- initial token=\"" << ktokn << "\".");
++
++	/*  return next non " =?/>" and move past subsequent " =?/>"  */
++	while (ktokn=strtok(NULL," =?/>")) {
++
++		/*  return next non quote and move past subsequent quote  */
++		ktokv=strtok(NULL,quote);
++//		_pprintLine_("KMLFileTagAttrib -- attribute " << ktokn << "=\"" << ktokv << "\".");
++
++/*  add the attribute to the dataset  */
++
++		if (kobj)
++			kobj->AddAttrib(ktokn,ktokv);
++	}
++
++	xfree((void**)&ktagi);
++
++/*  check for xml declaration, dtd declaration, or solo tag  */
++
++	if ((!strncmp(&ktag[0],"<?"       ,2) && !strncmp(&ktag[strlen(ktag)-2],"?>",2)) ||
++		(!strncmp(&ktag[0],"<!DOCTYPE",9) && !strncmp(&ktag[strlen(ktag)-1], ">",1)) ||
++		(!strncmp(&ktag[0],"<"        ,1) && !strncmp(&ktag[strlen(ktag)-2],"/>",2)))
++		isolo=1;
++//	_pprintLine_("KMLFileTagAttrib -- isolo=" << isolo << ".");
++
++	return(isolo);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTokenParse {{{*/
++int KMLFileTokenParse(int* pival,
++					  char* ktag,
++					  FILE* fid){
++
++	char*   kstr;
++
++/*  get next token and convert to appropriate format  */
++
++	if (!(kstr=KMLFileToken(fid,
++							NULL,NULL)) ||
++		(kstr[0] == '<'))
++		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
++
++	sscanf(kstr,"%d",pival);
++	xfree((void**)&kstr);
++
++/*  get additional token and compare to closing tag  */
++
++	if (ktag)
++		if (!(kstr=KMLFileToken(fid,
++								NULL,NULL)) ||
++			(kstr[0] != '<') ||
++			(kstr[1] != '/') ||
++			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		else
++			xfree((void**)&kstr);
++
++//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << *pival << ".");
++
++	return(0);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTokenParse {{{*/
++int KMLFileTokenParse(bool* pbval, char* ktag, FILE* fid){
++
++	int     ival;
++	char*   kstr;
++
++/*  get next token and convert to appropriate format  */
++
++	if (!(kstr=KMLFileToken(fid,
++							NULL,NULL)) ||
++		(kstr[0] == '<'))
++	  {_error2_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");}
++
++	sscanf(kstr,"%d",&ival);
++	*pbval=(bool)ival;
++	xfree((void**)&kstr);
++
++/*  get additional token and compare to closing tag  */
++
++	if (ktag)
++		if (!(kstr=KMLFileToken(fid,
++								NULL,NULL)) ||
++			(kstr[0] != '<') ||
++			(kstr[1] != '/') ||
++			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		else
++			xfree((void**)&kstr);
++
++//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << (*pbval ? "true" : "false") << ".");
++
++	return(0);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTokenParse {{{*/
++char* KMLFileTokenParse(char* pstr,
++						char* ktag,
++						FILE* fid){
++
++	return(KMLFileTokenParse(pstr,NULL,0,
++							 ktag,
++							 fid));
++}
++/*}}}*/
++/*FUNCTION  KMLFileTokenParse {{{*/
++char* KMLFileTokenParse(char* pstr,int *m,int maxlen,
++						char* ktag,
++						FILE* fid){
++
++	char*   kstr;
++
++/*  get next token and allocate if necessary  */
++
++	if (!(kstr=KMLFileToken(fid,
++							NULL,NULL)) ||
++		(kstr[0] == '<'))
++		_error2_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n");
++
++	if (!pstr) {
++		if (maxlen)
++			pstr=(char *) xmalloc((maxlen      +1)*sizeof(char));
++		else
++			pstr=(char *) xmalloc((strlen(kstr)+1)*sizeof(char));
++	}
++
++	if (maxlen && (maxlen < strlen(kstr))) {
++		_pprintLine_("KMLFileTokenParse -- string field too short for " << ktag << ".");
++		_pprintLine_("KMLFileTokenParse -- \"" << kstr << "\" truncated to " << maxlen << " characters.");
++		strncpy(pstr,kstr,maxlen);
++	}
++	else
++		memcpy(pstr,kstr,(strlen(kstr)+1)*sizeof(char));
++
++	xfree((void**)&kstr);
++
++	if (m)
++		*m=strlen(pstr);
++
++/*  get additional token and compare to closing tag  */
++
++	if (ktag)
++		if (!(kstr=KMLFileToken(fid,
++								NULL,NULL)) ||
++			(kstr[0] != '<') ||
++			(kstr[1] != '/') ||
++			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		else
++			xfree((void**)&kstr);
++
++//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=\"" << pstr << "\".");
++
++	return(pstr);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTokenParse {{{*/
++int KMLFileTokenParse(float* pfval,
++					  char* ktag,
++					  FILE* fid){
++
++	char*   kstr;
++
++/*  get next token and convert to appropriate format  */
++
++	if (!(kstr=KMLFileToken(fid,
++							NULL,NULL)) ||
++		(kstr[0] == '<'))
++	  {_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}
++
++	sscanf(kstr,"%g",pfval);
++	xfree((void**)&kstr);
++
++/*  get additional token and compare to closing tag  */
++
++	if (ktag)
++		if (!(kstr=KMLFileToken(fid,
++								NULL,NULL)) ||
++			(kstr[0] != '<') ||
++			(kstr[1] != '/') ||
++			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		else
++			xfree((void**)&kstr);
++
++//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << *pfval << ".");
++
++	return(0);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTokenParse {{{*/
++int KMLFileTokenParse(double* pdval,
++					  char* ktag,
++					  FILE* fid){
++
++	char*   kstr;
++
++/*  get next token and convert to appropriate format  */
++
++	if (!(kstr=KMLFileToken(fid,
++							NULL,NULL)) ||
++		(kstr[0] == '<'))
++		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
++
++	sscanf(kstr,"%lg",pdval);
++	xfree((void**)&kstr);
++
++/*  get additional token and compare to closing tag  */
++
++	if (ktag)
++		if (!(kstr=KMLFileToken(fid,
++								NULL,NULL)) ||
++			(kstr[0] != '<') ||
++			(kstr[1] != '/') ||
++			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		else
++			xfree((void**)&kstr);
++
++//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << *pdval << ".");
++
++	return(0);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTokenParse {{{*/
++int KMLFileTokenParse(double **pdval,int* m,int maxlen,
++					  char* ktag,
++					  FILE* fid){
++
++	int     i=-1,j;
++	char*   kstr;
++	char*   ktok;
++	char    delim[]={' ',',','\f','\n','\r','\t','\v','\0'};
++
++/*  get next token and allocate if necessary  */
++
++	if (!(kstr=KMLFileToken(fid,
++							NULL,NULL)) ||
++		(kstr[0] == '<'))
++		_error2_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");
++
++	if (!*pdval)
++		if (maxlen)
++			*pdval=(double *) xmalloc(maxlen              *sizeof(double));
++		else
++			*pdval=(double *) xmalloc(((strlen(kstr)+1)/2)*sizeof(double));
++
++/*  loop through string to get all values  */
++
++	ktok=strtok(kstr,delim);
++	while (ktok) {
++		i++;
++		if (maxlen && (maxlen < i+1))
++			_error2_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n");
++		sscanf(ktok,"%lg",&((*pdval)[i]));
++		ktok=strtok(NULL,delim);
++	}
++	xfree((void**)&kstr);
++
++	if (!maxlen)
++		*pdval=(double *) xrealloc(*pdval,(i+1)*sizeof(double));
++
++	if (m)
++		*m=i+1;
++
++/*  get additional token and compare to closing tag  */
++
++	if (ktag)
++		if (!(kstr=KMLFileToken(fid,
++								NULL,NULL)) ||
++			(kstr[0] != '<') ||
++			(kstr[1] != '/') ||
++			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		else
++			xfree((void**)&kstr);
++
++//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=...");
++//	for (j=0; j<=i; j++)
++//		_pprintLine_("   [" << j << "]: " << (*pdval)[j] << "g");
++
++	return(0);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTokenParse {{{*/
++int KMLFileTokenParse(double (**pdval3)[3],int* m,int maxlen,
++					  char* ktag,
++					  FILE* fid){
++
++	int     i=0,j=-1;
++	char*   kstr;
++	char*   ktok;
++	char    delim[]={' ',',','\f','\n','\r','\t','\v','\0'};
++
++/*  get next token and allocate if necessary  */
++
++	if (!(kstr=KMLFileToken(fid,
++							NULL,NULL)) ||
++		(kstr[0] == '<'))
++		_error2_("KMLFileTokenParse -- Missing double [m x 3] field for " << ktag << ".\n");
++
++	if (!*pdval3)
++		if (maxlen)
++			*pdval3=(double (*)[3]) xmalloc((maxlen*3)          *sizeof(double));
++		else
++			*pdval3=(double (*)[3]) xmalloc(((strlen(kstr)+1)/2)*sizeof(double));
++
++/*  loop through string to get all values  */
++
++	ktok=strtok(kstr,delim);
++	while (ktok) {
++		j++;
++		if (j == 3) {
++			i++;
++			j=0;
++			if (maxlen && (maxlen < i+1))
++				_error2_("KMLFileTokenParse -- Double [m x 3] field too short for " << ktag << ".\n");
++		}
++		sscanf(ktok,"%lg",&((*pdval3)[i][j]));
++		ktok=strtok(NULL,delim);
++	}
++	xfree((void**)&kstr);
++
++	if (!maxlen)
++		*pdval3=(double (*)[3]) xrealloc(*pdval3,((i+1)*3)*sizeof(double));
++
++	if (m)
++		*m=i+1;
++
++	if (j != 2)
++		_pprintLine_("KMLFileTokenParse -- Double [m x 3] field for " << ktag << " does not have multiple of 3 values.");
++
++/*  get additional token and compare to closing tag  */
++
++	if (ktag)
++		if (!(kstr=KMLFileToken(fid,
++								NULL,NULL)) ||
++			(kstr[0] != '<') ||
++			(kstr[1] != '/') ||
++			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		else
++			xfree((void**)&kstr);
++
++//	_pprintLine_("KMLFileTokenParse -- " << ktag << "=...");
++//	for (j=0; j<=i; j++)
++//		_pprintLine_("   [" << j << "][0-2]: " << (*pdval3)[j][0] << "g," << (*pdval3)[j][1] << "g," << (*pdval3)[j][2] << "g");
++
++	return(0);
++}
++/*}}}*/
++/*FUNCTION  KMLFileTagSkip {{{*/
++int KMLFileTagSkip(char* ktag,
++				   FILE* fid){
++
++	char*   kstr;
++
++/*  note that tags of the same type can be nested inside each other, so for each
++	opening tag, must find corresponding closing tag  */
++
++	_pprintLine_("KMLFileTagSkip -- input tag " << ktag << ".");
++
++/*  if next token is a closing tag, compare to input  */
++
++	while (kstr=KMLFileToken(fid,
++							 NULL,NULL)) {
++		if      ((kstr[0] == '<') &&
++				 (kstr[1] == '/') &&
++				 (!strncmp(&(kstr[2]),&(ktag[1]),(strcspn(ktag," >")-1)/sizeof(char)))) {
++			_pprintLine_("KMLFileTagSkip -- closing tag " << kstr << ".");
++			xfree((void**)&kstr);
++			return(0);
++		}
++
++/*  if next token is an opening tag, call recursively  */
++
++		else if ((kstr[0] == '<') &&
++				 (kstr[1] != '/')) {
++			_pprintLine_("KMLFileTagSkip -- opening tag " << kstr << ".");
++			KMLFileTagSkip(kstr,
++						   fid);
++		}
++
++/*  if next token is a closing tag, error out  */
++
++		else if ((kstr[0] == '<') &&
++				 (kstr[1] == '/')) {
++			_error2_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");
++		}
++
++		xfree((void**)&kstr);
++	}
++
++	_error2_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");
++
++	return(0);
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h	(revision 12822)
+@@ -0,0 +1,42 @@
++/*! \file KML_Geometry.h 
++ *  \brief: header file for kml_geometry abstract object
++ */
++
++#ifndef _KML_GEOMETRY_H_
++#define _KML_GEOMETRY_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Object.h"
++/*}}}*/
++
++class KML_Geometry: public KML_Object {
++
++	public:
++
++		/*KML_Geometry constructors, destructors {{{*/
++		KML_Geometry();
++		~KML_Geometry();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_GEOMETRY_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp	(revision 12822)
+@@ -0,0 +1,94 @@
++/*!\file KML_StyleSelector.cpp
++ * \brief: implementation of the kml_styleselector abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_StyleSelector::KML_StyleSelector(){{{*/
++KML_StyleSelector::KML_StyleSelector(){
++
++	;
++
++}
++/*}}}*/
++/*FUNCTION KML_StyleSelector::~KML_StyleSelector(){{{*/
++KML_StyleSelector::~KML_StyleSelector(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_StyleSelector::Echo {{{*/
++void  KML_StyleSelector::Echo(){
++
++	KML_Object::Echo();
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_StyleSelector::DeepEcho {{{*/
++void  KML_StyleSelector::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_StyleSelector::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_StyleSelector::DeepEcho {{{*/
++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){
++
++	KML_Object::Write(filout,indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_StyleSelector::Read {{{*/
++void  KML_StyleSelector::Read(FILE* fid,char* kstr){
++
++/*  process field within opening and closing tags  */
++
++	if      (!strncmp(kstr,"</StyleSelector",15))
++		return;
++	else if (!strncmp(kstr,"</",2))
++	  {_error2_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");}
++	else if (strncmp(kstr,"<",1))
++	  {_error2_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");}
++
++	else if (!strncmp(kstr,"<",1))
++		KML_Object::Read(fid,kstr);
++
++	return;
++}
++/*}}}*/
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 12822)
+@@ -0,0 +1,162 @@
++/*!\file KML_LatLonBox.cpp
++ * \brief: implementation of the kml_feature abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_LatLonBox::KML_LatLonBox(){{{*/
++KML_LatLonBox::KML_LatLonBox(){
++
++	north     = 0.;
++	south     = 0.;
++	east      = 0.;
++	west      = 0.;
++	rotation  = 0.;
++
++}
++/*}}}*/
++/*FUNCTION KML_LatLonBox::~KML_LatLonBox(){{{*/
++KML_LatLonBox::~KML_LatLonBox(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_LatLonBox::Echo {{{*/
++void  KML_LatLonBox::Echo(){
++
++
++	_printLine_("KML_LatLonBox:");
++	KML_Object::Echo();
++
++	_printLine_("         north: " << north);
++	_printLine_("         south: " << south);
++	_printLine_("          east: " << east);
++	_printLine_("          west: " << west);
++	_printLine_("      rotation: " << rotation);
++}
++/*}}}*/
++/*FUNCTION KML_LatLonBox::DeepEcho {{{*/
++void  KML_LatLonBox::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_LatLonBox::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LatLonBox::DeepEcho {{{*/
++void  KML_LatLonBox::DeepEcho(const char* indent){
++
++	_printLine_(indent << "KML_LatLonBox:");
++	KML_Object::DeepEcho(indent);
++
++	_printLine_("         north: " << north);
++	_printLine_("         south: " << south);
++	_printLine_("          east: " << east);
++	_printLine_("          west: " << west);
++	_printLine_("      rotation: " << rotation);
++}
++/*}}}*/
++/*FUNCTION KML_LatLonBox::Write {{{*/
++void  KML_LatLonBox::Write(FILE* filout,const char* indent){
++
++	fprintf(filout,"%s<LatLonBox",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Object::Write(filout,indent);
++
++	fprintf(filout,"%s  <north>%0.16g</north>\n",indent,north);
++	fprintf(filout,"%s  <south>%0.16g</south>\n",indent,south);
++	fprintf(filout,"%s  <east>%0.16g</east>\n",indent,east);
++	fprintf(filout,"%s  <west>%0.16g</west>\n",indent,west);
++	fprintf(filout,"%s  <rotation>%0.16g</rotation>\n",indent,rotation);
++
++	fprintf(filout,"%s</LatLonBox>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LatLonBox::Read {{{*/
++void  KML_LatLonBox::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</LatLonBox",11)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strcmp(kstri,"<north>"))
++			KMLFileTokenParse(&north     ,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<south>"))
++			KMLFileTokenParse(&south     ,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<east>"))
++			KMLFileTokenParse(&east      ,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<west>"))
++			KMLFileTokenParse(&west      ,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<rotation>"))
++			KMLFileTokenParse(&rotation  ,
++							  kstri,
++							  fid);
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Object::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.cpp	(revision 12822)
+@@ -0,0 +1,133 @@
++/*!\file KML_Attribute.cpp
++ * \brief: implementation of the kml_attribute object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Attribute::KML_Attribute(){{{*/
++KML_Attribute::KML_Attribute(){
++
++	name      =NULL;
++	value     =NULL;
++
++}
++/*}}}*/
++/*FUNCTION KML_Attribute::~KML_Attribute(){{{*/
++KML_Attribute::~KML_Attribute(){
++
++	if (name      ) xfree((void**)&name);
++	if (value     ) xfree((void**)&value);
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Attribute::Echo {{{*/
++void  KML_Attribute::Echo(){
++
++	int   i;
++	bool  flag=true;
++
++	if(flag) _pprintString_("    ");
++	for (i=0;i<10-strlen(name);i++)
++		if(flag) _pprintString_(" ");
++	if(flag) _pprintLine_(name << ": \"" << value << "\"");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Attribute::DeepEcho {{{*/
++void  KML_Attribute::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Attribute::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Attribute::DeepEcho {{{*/
++void  KML_Attribute::DeepEcho(const char* indent){
++
++	int   i;
++	bool  flag=true;
++
++	if(flag) _pprintString_(indent << "    ");
++	for (i=0;i<10-strlen(name);i++)
++		if(flag) _pprintString_(" ");
++	if(flag) _pprintLine_(name << ": \"" << value << "\"");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Attribute::Write {{{*/
++void  KML_Attribute::Write(FILE* filout,const char* indent){
++
++//  attributes always written in keyword line of kml_object
++
++	fprintf(filout,"%s%s=\"%s\"",indent,name,value);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Attribute::Read {{{*/
++void  KML_Attribute::Read(FILE* fid,char* kstr){
++
++//  attributes always read in keyword line of kml_object
++
++	;
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Attribute::Alloc {{{*/
++void  KML_Attribute::Alloc(const char* namei,const char* valuei){
++
++	name =(char *) xmalloc((strlen(namei )+1)*sizeof(char));
++	memcpy(name,namei,(strlen(namei)+1)*sizeof(char));
++
++	value=(char *) xmalloc((strlen(valuei)+1)*sizeof(char));
++	memcpy(value,valuei,(strlen(valuei)+1)*sizeof(char));
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Attribute::Add {{{*/
++void  KML_Attribute::Add(DataSet* attrib){
++
++	attrib->AddObject((Object*)this);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Attribute::Get {{{*/
++void  KML_Attribute::Get(char** pvalueo,char* deflt){
++
++	if (!value || !strlen(value)) {
++		*pvalueo=(char *) xmalloc((strlen(deflt)+1)*sizeof(char));
++		memcpy(*pvalueo,deflt,(strlen(deflt)+1)*sizeof(char));
++	}
++	else {
++		*pvalueo=(char *) xmalloc((strlen(value)+1)*sizeof(char));
++		memcpy(*pvalueo,value,(strlen(value)+1)*sizeof(char));
++	}
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h	(revision 12822)
+@@ -0,0 +1,48 @@
++/*! \file KML_ColorStyle.h 
++ *  \brief: header file for kml_colorstyle abstract object
++ */
++
++#ifndef _KML_COLORSTYLE_H_
++#define _KML_COLORSTYLE_H_
++
++#define KML_COLORSTYLE_COLOR_LENGTH      8
++#define KML_COLORSTYLE_COLORMODE_LENGTH  6
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_SubStyle.h"
++/*}}}*/
++
++class KML_ColorStyle: public KML_SubStyle {
++
++	public:
++
++		char  color[KML_COLORSTYLE_COLOR_LENGTH+1];
++		char  colormode[KML_COLORSTYLE_COLORMODE_LENGTH+1];
++
++		/*KML_ColorStyle constructors, destructors {{{*/
++		KML_ColorStyle();
++		~KML_ColorStyle();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_COLORSTYLE_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h	(revision 12822)
+@@ -0,0 +1,47 @@
++/*! \file KML_Placemark.h 
++ *  \brief: header file for kml_placemark object
++ */
++
++#ifndef _KML_PLACEMARK_H_
++#define _KML_PLACEMARK_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Feature.h"
++class KML_Geometry;
++class DataSet;
++/*}}}*/
++
++class KML_Placemark: public KML_Feature {
++
++	public:
++
++		DataSet* geometry;
++
++		/*KML_Placemark constructors, destructors {{{*/
++		KML_Placemark();
++		~KML_Placemark();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_PLACEMARK_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 12822)
+@@ -0,0 +1,146 @@
++/*!\file KML_PolyStyle.cpp
++ * \brief: implementation of the kml_polystyle object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_PolyStyle::KML_PolyStyle(){{{*/
++KML_PolyStyle::KML_PolyStyle(){
++
++	fill      =true;
++	outline   =true;
++
++}
++/*}}}*/
++/*FUNCTION KML_PolyStyle::~KML_PolyStyle(){{{*/
++KML_PolyStyle::~KML_PolyStyle(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_PolyStyle::Echo {{{*/
++void  KML_PolyStyle::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_PolyStyle:");
++	KML_ColorStyle::Echo();
++
++	if(flag) _pprintLine_("          fill: " << fill);
++	if(flag) _pprintLine_("       outline: " << outline);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_PolyStyle::DeepEcho {{{*/
++void  KML_PolyStyle::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_PolyStyle::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_PolyStyle::DeepEcho {{{*/
++void  KML_PolyStyle::DeepEcho(const char* indent){
++
++	int   i;
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_PolyStyle:");
++	KML_ColorStyle::DeepEcho(indent);
++
++	if(flag) _pprintLine_(indent << "          fill: " << fill);
++	if(flag) _pprintLine_(indent << "       outline: " << outline);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_PolyStyle::Write {{{*/
++void  KML_PolyStyle::Write(FILE* filout,const char* indent){
++
++	fprintf(filout,"%s<PolyStyle",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_ColorStyle::Write(filout,indent);
++
++	fprintf(filout,"%s  <fill>%d</fill>\n",indent,fill);
++	fprintf(filout,"%s  <outline>%d</outline>\n",indent,outline);
++
++	fprintf(filout,"%s</PolyStyle>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_PolyStyle::Read {{{*/
++void  KML_PolyStyle::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</PolyStyle",11)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strcmp(kstri,"<fill>"))
++			KMLFileTokenParse(&fill      ,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<outline>"))
++			KMLFileTokenParse(&outline   ,
++							  kstri,
++							  fid);
++
++		else if (!strncmp(kstri,"<",1))
++			KML_ColorStyle::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.h	(revision 12822)
+@@ -0,0 +1,45 @@
++/*! \file KML_Unknown.h 
++ *  \brief: header file for kml_unknown object
++ */
++
++#ifndef _KML_UNKNOWN_H_
++#define _KML_UNKNOWN_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Object.h"
++/*}}}*/
++
++class KML_Unknown: public KML_Object {
++
++	public:
++
++		char* name;
++		char* value;
++
++		/*KML_Unknown constructors, destructors {{{*/
++		KML_Unknown();
++		~KML_Unknown();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_UNKNOWN_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.h	(revision 12822)
+@@ -0,0 +1,49 @@
++/*! \file KML_GroundOverlay.h 
++ *  \brief: header file for kml_groundoverlay object
++ */
++
++#ifndef _KML_GROUNDOVERLAY_H_
++#define _KML_GROUNDOVERLAY_H_
++
++#define KML_GROUNDOVERLAY_ALTMODE_LENGTH    18
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Overlay.h"
++class KML_LatLonBox;
++/*}}}*/
++
++class KML_GroundOverlay: public KML_Overlay {
++
++	public:
++
++		double altitude;
++		char  altmode[KML_GROUNDOVERLAY_ALTMODE_LENGTH+1];
++		KML_LatLonBox* llbox;
++
++		/*KML_GroundOverlay constructors, destructors {{{*/
++		KML_GroundOverlay();
++		~KML_GroundOverlay();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_GROUNDOVERLAY_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.h	(revision 12822)
+@@ -0,0 +1,51 @@
++/*! \file KML_Style.h 
++ *  \brief: header file for kml_style object
++ */
++
++#ifndef _KML_STYLE_H_
++#define _KML_STYLE_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_StyleSelector.h"
++class KML_LineStyle;
++class KML_PolyStyle;
++/*}}}*/
++
++class KML_Style: public KML_StyleSelector {
++
++	public:
++
++		void* icon;
++		void* label;
++		KML_LineStyle* line;
++		KML_PolyStyle* poly;
++		void* balloon;
++		void* list;
++
++		/*KML_Style constructors, destructors {{{*/
++		KML_Style();
++		~KML_Style();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_STYLE_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp	(revision 12822)
+@@ -0,0 +1,387 @@
++/*!\file KML_Object.cpp
++ * \brief: implementation of the kml_object abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Object::KML_Object(){{{*/
++KML_Object::KML_Object(){
++
++	attrib    =new DataSet;
++	commnt    =new DataSet;
++	kmlobj    =new DataSet;
++
++}
++/*}}}*/
++/*FUNCTION KML_Object::~KML_Object(){{{*/
++KML_Object::~KML_Object(){
++
++	if (attrib) {
++		delete attrib;
++		attrib    =NULL;
++	}
++	if (commnt) {
++		delete commnt;
++		commnt    =NULL;
++	}
++	if (kmlobj) {
++		delete kmlobj;
++		kmlobj    =NULL;
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Object::Echo {{{*/
++void  KML_Object::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("        attrib: (size=" << attrib->Size() << ")");
++	if(flag) _pprintLine_("        commnt: (size=" << commnt->Size() << ")");
++	if(flag) _pprintLine_("        kmlobj: (size=" << kmlobj->Size() << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::DeepEcho {{{*/
++void  KML_Object::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Object::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::DeepEcho {{{*/
++void  KML_Object::DeepEcho(const char* indent){
++
++	int   i;
++	char  indent2[81];
++	bool  flag=true;
++
++/*  loop over the attributes for the object  */
++
++	if (attrib->Size())
++		for (i=0; i<attrib->Size(); i++) {
++			((KML_Attribute *)attrib->GetObjectByOffset(i))->DeepEcho(indent);
++		}
++	else
++		if(flag) _pprintLine_(indent << "        attrib: [empty]");
++
++/*  loop over the comments for the object  */
++
++	if (commnt->Size())
++		for (i=0; i<commnt->Size(); i++) {
++			((KML_Comment *)commnt->GetObjectByOffset(i))->DeepEcho(indent);
++		}
++	else
++		if(flag) _pprintLine_(indent << "        commnt: [empty]");
++
++/*  loop over the unknown objects for the object  */
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent2,"  ");
++
++	if (kmlobj->Size())
++		for (i=0; i<kmlobj->Size(); i++) {
++            if(flag) _pprintLine_(indent << "        kmlobj: -------- begin [" << i << "] --------");
++			((KML_Unknown *)kmlobj->GetObjectByOffset(i))->DeepEcho(indent2);
++            if(flag) _pprintLine_(indent << "        kmlobj: --------  end  [" << i << "] --------");
++		}
++	else
++		if(flag) _pprintLine_(indent << "        kmlobj: [empty]");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::Write {{{*/
++void  KML_Object::Write(FILE* filout,const char* indent){
++
++	int   i;
++	char  indent2[81];
++
++//  attributes always written in keyword line of derived classes
++//  comments always written after keyword line of derived classes
++
++/*  loop over the unknown objects for the object  */
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent2,"  ");
++
++	if (kmlobj->Size())
++		for (i=0; i<kmlobj->Size(); i++) {
++			((KML_Unknown *)kmlobj->GetObjectByOffset(i))->Write(filout,indent2);
++		}
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::Read {{{*/
++void  KML_Object::Read(FILE* fid,char* kstr){
++
++	KML_Object*  kobj;
++
++/*  process field within opening and closing tags  */
++
++	if      (!strncmp(kstr,"</Object", 8))
++		return;
++	else if (!strncmp(kstr,"</",2))
++	  {_error2_("KML_Object::Read -- Unexpected closing tag " << kstr << ".\n");}
++	else if (strncmp(kstr,"<",1))
++	  {_error2_("KML_Object::Read -- Unexpected field \"" << kstr << "\".\n");}
++
++	else if (!strncmp(kstr,"<Placemark",10)) {
++		kobj=(KML_Object*)new KML_Placemark();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<Folder", 7)) {
++		kobj=(KML_Object*)new KML_Folder();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<Document", 9)) {
++		kobj=(KML_Object*)new KML_Document();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<GroundOverlay",14)) {
++		kobj=(KML_Object*)new KML_GroundOverlay();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<LatLonBox",10)) {
++		kobj=(KML_Object*)new KML_LatLonBox();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<Icon", 5)) {
++		kobj=(KML_Object*)new KML_Icon();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<Point", 6)) {
++		kobj=(KML_Object*)new KML_Point();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<LineString",11)) {
++		kobj=(KML_Object*)new KML_LineString();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<LinearRing",11)) {
++		kobj=(KML_Object*)new KML_LinearRing();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<Polygon", 8)) {
++		kobj=(KML_Object*)new KML_Polygon();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<MultiGeometry",14)) {
++		kobj=(KML_Object*)new KML_MultiGeometry();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++//	else if (!strncmp(kstr,"<IconStyle",10)) {
++//		kobj=(KML_Object*)new KML_IconStyle();
++//		kobj->Read(fid,kstr);
++//		kmlobj    ->AddObject((Object*)kobj);
++//	}
++
++//	else if (!strncmp(kstr,"<LabelStyle",11)) {
++//		kobj=(KML_Object*)new KML_LabelStyle();
++//		kobj->Read(fid,kstr);
++//		kmlobj    ->AddObject((Object*)kobj);
++//	}
++
++	else if (!strncmp(kstr,"<LineStyle",10)) {
++		kobj=(KML_Object*)new KML_LineStyle();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<PolyStyle",10)) {
++		kobj=(KML_Object*)new KML_PolyStyle();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++//	else if (!strncmp(kstr,"<BalloonStyle",13)) {
++//		kobj=(KML_Object*)new KML_BalloonStyle();
++//		kobj->Read(fid,kstr);
++//		kmlobj    ->AddObject((Object*)kobj);
++//	}
++
++//	else if (!strncmp(kstr,"<ListStyle",10)) {
++//		kobj=(KML_Object*)new KML_ListStyle();
++//		kobj->Read(fid,kstr);
++//		kmlobj    ->AddObject((Object*)kobj);
++//	}
++
++	else if (!strncmp(kstr,"<",1)) {
++		_pprintLine_("KML_Object::Read -- Unrecognized opening tag " << kstr << ".");
++//		KMLFileTagSkip(kstr,
++//					   fid);
++		kobj=(KML_Object*)new KML_Unknown();
++		kobj->Read(fid,kstr);
++		kmlobj    ->AddObject((Object*)kobj);
++	}
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::WriteExp {{{*/
++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){
++
++	KML_Attribute* katt=NULL;
++
++	katt=new KML_Attribute();
++	katt->Alloc(name,value);
++	katt->Add(attrib);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::FindAttrib {{{*/
++void  KML_Object::FindAttrib(char** pvalue,char* name,char* deflt){
++
++	int   i;
++	KML_Attribute* katt=NULL;
++
++/*  loop over any attributes for the object  */
++
++	if (attrib->Size())
++		for (i=0; i<attrib->Size(); i++)
++			if (!strcmp(((KML_Attribute *)attrib->GetObjectByOffset(i))->name,name)) {
++				katt=(KML_Attribute *)attrib->GetObjectByOffset(i);
++				break;
++			}
++
++/*  if found, get the value; otherwise use the default  */
++
++	if (katt)
++		katt->Get(pvalue,deflt);
++	else {
++		*pvalue=(char *) xmalloc((strlen(deflt)+1)*sizeof(char));
++		memcpy(*pvalue,deflt,(strlen(deflt)+1)*sizeof(char));
++	}
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::WriteAttrib {{{*/
++void  KML_Object::WriteAttrib(FILE* filout,const char* indent){
++
++//  attributes always written in keyword line of kml_object
++
++/*  loop over any attributes for the object  */
++
++	if (attrib->Size())
++		for (int i=0; i<attrib->Size(); i++)
++			((KML_Attribute *)attrib->GetObjectByOffset(i))->Write(filout,indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::AddCommnt {{{*/
++void  KML_Object::AddCommnt(int ncom,char** pcom){
++
++	int   i;
++	KML_Comment* kcom=NULL;
++
++	for (i=0; i<ncom; i++) {
++		kcom=new KML_Comment();
++		kcom->Alloc(pcom[i]);
++		kcom->Add(commnt);
++	}
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::AddCommnt {{{*/
++void  KML_Object::AddCommnt(char* value){
++
++	KML_Comment* kcom=NULL;
++
++	kcom=new KML_Comment();
++	kcom->Alloc(value);
++	kcom->Add(commnt);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::FindCommnt {{{*/
++void  KML_Object::FindCommnt(char** pvalue,int inum){
++
++	KML_Comment* kcom=NULL;
++
++/*  loop over any comments for the object  */
++
++	if (inum <= commnt->Size())
++		kcom=(KML_Comment *)commnt->GetObjectByOffset(inum-1);
++
++/*  if found, get the value; otherwise use the NULL  */
++
++	if (kcom)
++		kcom->Get(pvalue);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Object::WriteCommnt {{{*/
++void  KML_Object::WriteCommnt(FILE* filout,const char* indent){
++
++	int   i;
++
++//  comments always written after keyword line of kml_object
++
++/*  loop over any comments for the object  */
++
++	if (commnt->Size())
++		for (i=0; i<commnt->Size(); i++)
++			((KML_Comment *)commnt->GetObjectByOffset(i))->Write(filout,indent);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.h	(revision 12822)
+@@ -0,0 +1,50 @@
++/*! \file KML_Comment.h 
++ *  \brief: header file for kml_comment object
++ */
++
++#ifndef _KML_COMMENT_H_
++#define _KML_COMMENT_H_
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "../Object.h"
++class DataSet;
++/*}}}*/
++
++class KML_Comment: public Object {
++
++	public:
++
++		char* name;
++		char* value;
++
++		/*KML_Comment constructors, destructors {{{*/
++		KML_Comment();
++		~KML_Comment();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		virtual void  Echo();
++		virtual void  DeepEcho();
++		virtual void  DeepEcho(const char* indent);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++		/*virtual functions: */
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		void  Alloc(const char* valuei);
++		void  Add(DataSet* commnt);
++		void  Get(char** pvalueo);
++
++};
++#endif  /* _KML_COMMENT_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.cpp	(revision 12822)
+@@ -0,0 +1,94 @@
++/*!\file KML_SubStyle.cpp
++ * \brief: implementation of the kml_substyle abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_SubStyle::KML_SubStyle(){{{*/
++KML_SubStyle::KML_SubStyle(){
++
++	;
++
++}
++/*}}}*/
++/*FUNCTION KML_SubStyle::~KML_SubStyle(){{{*/
++KML_SubStyle::~KML_SubStyle(){
++
++	;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_SubStyle::Echo {{{*/
++void  KML_SubStyle::Echo(){
++
++	KML_Object::Echo();
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_SubStyle::DeepEcho {{{*/
++void  KML_SubStyle::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_SubStyle::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_SubStyle::DeepEcho {{{*/
++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){
++
++	KML_Object::Write(filout,indent);
++
++	return;
++}
++/*}}}*/
++
++/*FUNCTION KML_SubStyle::Read {{{*/
++void  KML_SubStyle::Read(FILE* fid,char* kstr){
++
++/*  process field within opening and closing tags  */
++
++	if      (!strncmp(kstr,"</SubStyle",10))
++		return;
++	else if (!strncmp(kstr,"</",2))
++	  {_error2_("KML_SubStyle::Read -- Unexpected closing tag " << kstr << ".\n");}
++	else if (strncmp(kstr,"<",1))
++	  {_error2_("KML_SubStyle::Read -- Unexpected field \"" << kstr << "\".\n");}
++
++	else if (!strncmp(kstr,"<",1))
++		KML_Object::Read(fid,kstr);
++
++	return;
++}
++/*}}}*/
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.h	(revision 12822)
+@@ -0,0 +1,47 @@
++/*! \file KML_MultiGeometry.h 
++ *  \brief: header file for kml_multigeometry object
++ */
++
++#ifndef _KML_MULTIGEOMETRY_H_
++#define _KML_MULTIGEOMETRY_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Geometry.h"
++class KML_Geometry;
++class DataSet;
++/*}}}*/
++
++class KML_MultiGeometry: public KML_Geometry {
++
++	public:
++
++		DataSet* geometry;
++
++		/*KML_MultiGeometry constructors, destructors {{{*/
++		KML_MultiGeometry();
++		~KML_MultiGeometry();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_MULTIGEOMETRY_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.h	(revision 12822)
+@@ -0,0 +1,44 @@
++/*! \file KML_LineStyle.h 
++ *  \brief: header file for kml_linestyle object
++ */
++
++#ifndef _KML_LINESTYLE_H_
++#define _KML_LINESTYLE_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_ColorStyle.h"
++/*}}}*/
++
++class KML_LineStyle: public KML_ColorStyle {
++
++	public:
++
++		float width;
++
++		/*KML_LineStyle constructors, destructors {{{*/
++		KML_LineStyle();
++		~KML_LineStyle();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_LINESTYLE_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp	(revision 12822)
+@@ -0,0 +1,230 @@
++/*!\file KML_LineString.cpp
++ * \brief: implementation of the kml_linestring object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++#include "../../modules/Ll2xyx/Ll2xyx.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_LineString::KML_LineString(){{{*/
++KML_LineString::KML_LineString(){
++
++	extrude   =false;
++	tessellate=false;
++	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
++
++	ncoord    =0;
++	coords    =NULL;
++
++}
++/*}}}*/
++/*FUNCTION KML_LineString::~KML_LineString(){{{*/
++KML_LineString::~KML_LineString(){
++
++	if (coords) xDelete<double>(coords);
++
++	coords    =NULL;
++	ncoord    =0;
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_LineString::Echo {{{*/
++void  KML_LineString::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_LineString:");
++	KML_Geometry::Echo();
++
++	if(flag) _pprintLine_("       extrude: " << (extrude ? "true" : "false"));
++	if(flag) _pprintLine_("    tessellate: " << (tessellate ? "true" : "false"));
++	if(flag) _pprintLine_("       altmode: \"" << altmode << "\"");
++	if(flag) _pprintLine_("        coords: (ncoord=" << ncoord << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LineString::DeepEcho {{{*/
++void  KML_LineString::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_LineString::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LineString::DeepEcho {{{*/
++void  KML_LineString::DeepEcho(const char* indent){
++
++	int   i;
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_LineString:");
++	KML_Geometry::DeepEcho(indent);
++
++	if(flag) _pprintLine_(indent << "       extrude: " << (extrude ? "true" : "false"));
++	if(flag) _pprintLine_(indent << "    tessellate: " << (tessellate ? "true" : "false"));
++	if(flag) _pprintLine_(indent << "       altmode: \"" << altmode << "\"");
++	if(flag) _pprintLine_(indent << "        coords: (ncoord=" << ncoord << ")");
++	for (i=0; i<ncoord; i++)
++		if(flag) _pprintLine_(indent << "                (" << coords[3*i+0] << "," << coords[3*i+1] << "," << coords[3*i+2] << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LineString::Write {{{*/
++void  KML_LineString::Write(FILE* filout,const char* indent){
++
++	int   i;
++
++	fprintf(filout,"%s<LineString",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Geometry::Write(filout,indent);
++
++	fprintf(filout,"%s  <extrude>%d</extrude>\n",indent,(extrude ? 1 : 0));
++	fprintf(filout,"%s  <tessellate>%d</tessellate>\n",indent,(tessellate ? 1 : 0));
++	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
++	fprintf(filout,"%s  <coordinates>\n",indent);
++
++/*  loop over the coordinates for the linestring  */
++
++	for (i=0; i<ncoord; i++)
++		fprintf(filout,"%s    %0.16g,%0.16g,%0.16g\n",indent, coords[3*i+0],coords[3*i+1],coords[3*i+2]);
++
++	fprintf(filout,"%s  </coordinates>\n",indent);
++	fprintf(filout,"%s</LineString>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LineString::Read {{{*/
++void  KML_LineString::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	int          ncom=0;
++	char**       pcom=NULL;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</LineString",12)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_LineString::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_LineString::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strcmp(kstri,"<extrude>"))
++			KMLFileTokenParse(&extrude   ,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<tessellate>"))
++			KMLFileTokenParse(&tessellate,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<altitudeMode>"))
++			KMLFileTokenParse( altmode   ,NULL,KML_LINESTRING_ALTMODE_LENGTH,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<coordinates>"))
++			KMLFileTokenParse(&coords    ,&ncoord    ,0,
++							  kstri,
++							  fid);
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Geometry::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_LineString::WriteExp {{{*/
++void  KML_LineString::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++
++	int     i;
++	double  *lat,*lon,*x,*y;
++	char    nstr2[81];
++
++/*  extract latitude and longitude into vectors  */
++
++	lat=(double *) xmalloc(ncoord*sizeof(double));
++	lon=(double *) xmalloc(ncoord*sizeof(double));
++	for (i=0; i<ncoord; i++) {
++		lon[i]=coords[3*i+0];
++		lat[i]=coords[3*i+1];
++	}
++
++/*  convert latitude and longitude to x and y  */
++
++	x  =(double *) xmalloc(ncoord*sizeof(double));
++	y  =(double *) xmalloc(ncoord*sizeof(double));
++	Ll2xyx(x,y,lat,lon,ncoord,sgn,cm,sp);
++
++/*  write header  */
++
++	memcpy(nstr2,nstr,(strlen(nstr)+1)*sizeof(char));
++
++	for (i=0; i<strlen(nstr2); i++)
++		if ((nstr2[i] == ' ') || (nstr2[i] == '\t'))
++			nstr2[i]='_';
++	fprintf(fid,"## Name:%s\n",nstr2);
++	fprintf(fid,"## Icon:0\n");
++	fprintf(fid,"# Points Count	Value\n");
++    fprintf(fid,"%u	%s\n",ncoord  ,"1.");
++	fprintf(fid,"# X pos	Y pos\n");
++
++/*  write vertices  */
++
++	for (i=0; i<ncoord; i++)
++	    fprintf(fid,"%lf\t%lf\n",x[i],y[i]);
++
++/*  write blank line  */
++
++	fprintf(fid,"\n");
++
++	xfree((void**)&y);
++	xfree((void**)&x);
++	xfree((void**)&lon);
++	xfree((void**)&lat);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.h	(revision 12822)
+@@ -0,0 +1,43 @@
++/*! \file KML_Folder.h 
++ *  \brief: header file for kml_folder object
++ */
++
++#ifndef _KML_FOLDER_H_
++#define _KML_FOLDER_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Container.h"
++class KML_Feature;
++/*}}}*/
++
++class KML_Folder: public KML_Container {
++
++	public:
++
++		/*KML_Folder constructors, destructors {{{*/
++		KML_Folder();
++		~KML_Folder();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_FOLDER_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp	(revision 12822)
+@@ -0,0 +1,135 @@
++/*!\file KML_Overlay.cpp
++ * \brief: implementation of the kml_overlay abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Overlay::KML_Overlay(){{{*/
++KML_Overlay::KML_Overlay(){
++
++	strcpy(color     ,"ffffffff");
++	memcpy(color,"ffffffff",(strlen("ffffffff")+1)*sizeof(char));
++
++	draword   = 0;
++	icon      =NULL;
++
++}
++/*}}}*/
++/*FUNCTION KML_Overlay::~KML_Overlay(){{{*/
++KML_Overlay::~KML_Overlay(){
++
++	if (icon) {
++		delete icon;
++		icon      =NULL;
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Overlay::Echo {{{*/
++void  KML_Overlay::Echo(){
++
++	KML_Feature::Echo();
++	_pprintLine_("         color: \"" << color << "\"");
++	_pprintLine_("       draword: " << draword);
++	_pprintLine_("          icon: " << icon);
++}
++/*}}}*/
++/*FUNCTION KML_Overlay::DeepEcho {{{*/
++void  KML_Overlay::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Overlay::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Overlay::DeepEcho {{{*/
++void  KML_Overlay::DeepEcho(const char* indent){
++
++	char  indent2[81];
++	KML_Feature::DeepEcho(indent);
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent2,"  ");
++
++	_pprintLine_(indent << "         color: " << color);
++	_pprintLine_(indent << "       draword: " << draword);
++	if (icon)
++		icon->DeepEcho(indent2);
++	else
++		_pprintLine_(indent << "          icon: " << icon);
++}
++/*}}}*/
++/*FUNCTION KML_Overlay::Write {{{*/
++void  KML_Overlay::Write(FILE* filout,const char* indent){
++
++	char  indent2[81];
++
++	KML_Feature::Write(filout,indent);
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++
++	strcat(indent2,"  ");
++
++	if (color     && strlen(color))
++		fprintf(filout,"%s  <color>%s</color>\n",indent,color);
++	fprintf(filout,"%s  <drawOrder>%d</drawOrder>\n",indent,draword);
++	if (icon)
++		icon->Write(filout,indent2);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Overlay::Read {{{*/
++void  KML_Overlay::Read(FILE* fid,char* kstr){
++
++/*  process field within opening and closing tags  */
++
++	if      (!strncmp(kstr,"</Overlay", 9)) {
++		xfree((void**)&kstr);
++		return;
++	}
++	else if (!strncmp(kstr,"</",2))
++	  {_error2_("KML_Overlay::Read -- Unexpected closing tag " << kstr << ".\n");}
++	else if (strncmp(kstr,"<",1))
++	  {_error2_("KML_Overlay::Read -- Unexpected field \"" << kstr << "\".\n");}
++
++	else if (!strcmp(kstr,"<color>"))
++		KMLFileTokenParse( color     ,NULL,KML_OVERLAY_COLOR_LENGTH,
++						  kstr,
++						  fid);
++	else if (!strcmp(kstr,"<drawOrder>"))
++		KMLFileTokenParse(&draword   ,
++						  kstr,
++						  fid);
++
++	else if (!strncmp(kstr,"<Icon", 5)) {
++		icon      =new KML_Icon();
++		icon      ->Read(fid,kstr);
++	}
++
++	else if (!strncmp(kstr,"<",1))
++		KML_Feature::Read(fid,kstr);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp	(revision 12822)
+@@ -0,0 +1,168 @@
++/*!\file KML_Container.cpp
++ * \brief: implementation of the kml_container abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Container::KML_Container(){{{*/
++KML_Container::KML_Container(){
++
++	feature   =new DataSet;
++
++}
++/*}}}*/
++/*FUNCTION KML_Container::~KML_Container(){{{*/
++KML_Container::~KML_Container(){
++
++	if (feature) {
++		delete feature;
++		feature   =NULL;
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Container::Echo {{{*/
++void  KML_Container::Echo(){
++
++	bool  flag=true;
++
++	KML_Feature::Echo();
++
++	if(flag) _pprintLine_("       feature: (size=" << feature->Size() << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Container::DeepEcho {{{*/
++void  KML_Container::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Container::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Container::DeepEcho {{{*/
++void  KML_Container::DeepEcho(const char* indent){
++
++	int   i;
++	char  indent2[81];
++	bool  flag=true;
++
++	KML_Feature::DeepEcho(indent);
++
++/*  loop over the features for the container  */
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent2,"  ");
++
++	if (feature->Size())
++		for (i=0; i<feature->Size(); i++) {
++			if(flag) _pprintLine_(indent << "       feature: -------- begin [" << i << "] --------");
++			((KML_Feature *)feature->GetObjectByOffset(i))->DeepEcho(indent2);
++			if(flag) _pprintLine_(indent << "       feature: --------  end  [" << i << "] --------");
++		}
++	else
++		if(flag) _pprintLine_(indent << "       feature: [empty]");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Container::Write {{{*/
++void  KML_Container::Write(FILE* filout,const char* indent){
++
++	int   i;
++	char  indent2[81];
++
++	KML_Feature::Write(filout,indent);
++
++/*  loop over the features for the container  */
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++
++	strcat(indent2,"  ");
++
++	for (i=0; i<feature->Size(); i++)
++		((KML_Feature *)feature->GetObjectByOffset(i))->Write(filout,indent2);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Container::Read {{{*/
++void  KML_Container::Read(FILE* fid,char* kstr){
++
++	KML_Object*  kobj;
++
++/*  process field within opening and closing tags  */
++
++	if      (!strncmp(kstr,"</Container",11)) {
++		xfree((void**)&kstr);
++		return;
++	}
++	else if (!strncmp(kstr,"</",2))
++	  {_error2_("KML_Container::Read -- Unexpected closing tag " << kstr );}
++	else if (strncmp(kstr,"<",1))
++	  {_error2_("KML_Container::Read -- Unexpected field \"" << kstr << "\"");}
++
++	else if (!strncmp(kstr,"<Placemark",10)) {
++		kobj=(KML_Object*)new KML_Placemark();
++		kobj->Read(fid,kstr);
++		feature   ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<Folder", 7)) {
++		kobj=(KML_Object*)new KML_Folder();
++		kobj->Read(fid,kstr);
++		feature   ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<Document", 9)) {
++		kobj=(KML_Object*)new KML_Document();
++		kobj->Read(fid,kstr);
++		feature   ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<GroundOverlay",14)) {
++		kobj=(KML_Object*)new KML_GroundOverlay();
++		kobj->Read(fid,kstr);
++		feature   ->AddObject((Object*)kobj);
++	}
++
++	else if (!strncmp(kstr,"<",1))
++		KML_Feature::Read(fid,kstr);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Container::WriteExp {{{*/
++void  KML_Container::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++
++	int   i;
++
++/*  loop over the features for the container  */
++
++	for (i=0; i<feature->Size(); i++)
++		((KML_Object *)feature->GetObjectByOffset(i))->WriteExp(fid,nstr,sgn,cm,sp);
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.h	(revision 12822)
+@@ -0,0 +1,43 @@
++/*! \file KML_Document.h 
++ *  \brief: header file for kml_document object
++ */
++
++#ifndef _KML_DOCUMENT_H_
++#define _KML_DOCUMENT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Container.h"
++class KML_Feature;
++/*}}}*/
++
++class KML_Document: public KML_Container {
++
++	public:
++
++		/*KML_Document constructors, destructors {{{*/
++		KML_Document();
++		~KML_Document();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_DOCUMENT_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.h	(revision 12822)
+@@ -0,0 +1,44 @@
++/*! \file KML_File.h 
++ *  \brief: header file for kml_file object
++ */
++
++#ifndef _KML_FILE_H_
++#define _KML_FILE_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./KML_Feature.h"
++class DataSet;
++/*}}}*/
++
++class KML_File: public KML_Object {
++
++	public:
++
++		/*KML_File constructors, destructors {{{*/
++		KML_File();
++		~KML_File();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(const char* indent);
++		void  Write(FILE* fid,const char* indent);
++		void  Read(FILE* fid,char* kstr);
++		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
++		/*}}}*/
++
++};
++#endif  /* _KML_FILE_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp	(revision 12822)
+@@ -0,0 +1,298 @@
++/*!\file KML_Polygon.cpp
++ * \brief: implementation of the kml_polygon object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION KML_Polygon::KML_Polygon(){{{*/
++KML_Polygon::KML_Polygon(){
++
++	extrude   =false;
++	tessellate=false;
++	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
++
++	outer     =new DataSet;
++	inner     =new DataSet;
++
++}
++/*}}}*/
++/*FUNCTION KML_Polygon::~KML_Polygon(){{{*/
++KML_Polygon::~KML_Polygon(){
++
++	if (inner) {
++		delete inner;
++		inner     =NULL;
++	}
++
++	if (outer) {
++		delete outer;
++		outer     =NULL;
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION KML_Polygon::Echo {{{*/
++void  KML_Polygon::Echo(){
++
++	bool  flag=true;
++
++	if(flag) _pprintLine_("KML_Polygon:");
++	KML_Geometry::Echo();
++
++	if(flag) _pprintLine_("       extrude: " << (extrude ? "true" : "false"));
++	if(flag) _pprintLine_("    tessellate: " << (tessellate ? "true" : "false"));
++	if(flag) _pprintLine_("       altmode: \"" << altmode << "\"");
++	if(flag) _pprintLine_("         outer: (size=" << outer->Size() << ")");
++	if(flag) _pprintLine_("         inner: (size=" << inner->Size() << ")");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Polygon::DeepEcho {{{*/
++void  KML_Polygon::DeepEcho(){
++
++	char  indent[81]="";
++
++	KML_Polygon::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Polygon::DeepEcho {{{*/
++void  KML_Polygon::DeepEcho(const char* indent){
++
++	int   i;
++	char  indent2[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "KML_Polygon:");
++	KML_Geometry::DeepEcho(indent);
++
++	if(flag) _pprintLine_(indent << "       extrude: " << (extrude ? "true" : "false"));
++	if(flag) _pprintLine_(indent << "    tessellate: " << (tessellate ? "true" : "false"));
++	if(flag) _pprintLine_(indent << "       altmode: \"" << altmode << "\"");
++
++	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent2,"  ");
++
++	if (outer->Size())
++		for (i=0; i<outer->Size(); i++) {
++			if(flag) _pprintLine_(indent << "         outer: -------- begin [" << i << "] --------");
++			((KML_LinearRing *)outer->GetObjectByOffset(i))->DeepEcho(indent2);
++			if(flag) _pprintLine_(indent << "         outer: --------  end  [" << i << "] --------");
++		}
++	else
++		if(flag) _pprintLine_(indent << "         outer: [empty]");
++
++	if (inner->Size())
++		for (i=0; i<inner->Size(); i++) {
++			if(flag) _pprintLine_(indent << "         inner: -------- begin [" << i << "] --------");
++			((KML_LinearRing *)inner->GetObjectByOffset(i))->DeepEcho(indent2);
++			if(flag) _pprintLine_(indent << "         inner: --------  end  [" << i << "] --------");
++		}
++	else
++		if(flag) _pprintLine_(indent << "         inner: [empty]");
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Polygon::Write {{{*/
++void  KML_Polygon::Write(FILE* filout,const char* indent){
++
++	int   i;
++	char  indent4[81];
++
++	fprintf(filout,"%s<Polygon",indent);
++	WriteAttrib(filout," ");
++	fprintf(filout,">\n");
++	WriteCommnt(filout,indent);
++
++	KML_Geometry::Write(filout,indent);
++
++	fprintf(filout,"%s  <extrude>%d</extrude>\n",indent,(extrude ? 1 : 0));
++	fprintf(filout,"%s  <tessellate>%d</tessellate>\n",indent,(tessellate ? 1 : 0));
++	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
++
++	memcpy(indent4,indent,(strlen(indent)+1)*sizeof(char));
++	strcat(indent4,"    ");
++
++/*  check outer boundary for the polygon  */
++
++	fprintf(filout,"%s  <outerBoundaryIs>\n",indent);
++	if (outer->Size())
++		((KML_LinearRing *)outer->GetObjectByOffset(0))->Write(filout,indent4);
++	fprintf(filout,"%s  </outerBoundaryIs>\n",indent);
++
++/*  loop over any inner boundaries for the polygon  */
++
++	for (i=0; i<inner->Size(); i++) {
++		fprintf(filout,"%s  <innerBoundaryIs>\n",indent);
++		((KML_LinearRing *)inner->GetObjectByOffset(i))->Write(filout,indent4);
++		fprintf(filout,"%s  </innerBoundaryIs>\n",indent);
++	}
++
++	fprintf(filout,"%s</Polygon>\n",indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Polygon::Read {{{*/
++void  KML_Polygon::Read(FILE* fid,char* kstr){
++
++	char*        kstri;
++	char*        kstrj;
++	int          ncom=0;
++	char**       pcom=NULL;
++	KML_Object*  kobj;
++
++/*  get object attributes and check for solo tag  */
++
++	if (KMLFileTagAttrib(this,
++						 kstr))
++		return;
++
++/*  loop over and process fields within opening and closing tags  */
++
++	while (kstri=KMLFileToken(fid,
++							  &ncom,&pcom)) {
++		if      (!strncmp(kstri,"</Polygon", 9)) {
++			xfree((void**)&kstri);
++			break;
++		}
++		else if (!strncmp(kstri,"</",2))
++		  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstri << ".\n");}
++		else if (strncmp(kstri,"<",1))
++		  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstri << "\".\n");}
++
++		else if (!strcmp(kstri,"<extrude>"))
++			KMLFileTokenParse(&extrude   ,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<tessellate>"))
++			KMLFileTokenParse(&tessellate,
++							  kstri,
++							  fid);
++		else if (!strcmp(kstri,"<altitudeMode>"))
++			KMLFileTokenParse( altmode   ,NULL,KML_POLYGON_ALTMODE_LENGTH,
++							  kstri,
++							  fid);
++
++		else if (!strcmp(kstri,"<outerBoundaryIs>"))
++
++/*  loop over and process fields within outer boundary  */
++
++			while (kstrj=KMLFileToken(fid,
++									  &ncom,&pcom)) {
++				if      (!strncmp(kstrj,"</outerBoundaryIs",17)) {
++					xfree((void**)&kstrj);
++					break;
++				}
++				else if (!strncmp(kstrj,"</",2))
++				  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}
++				else if (strncmp(kstrj,"<",1))
++				  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}
++
++				else if (!strncmp(kstrj,"<LinearRing",11)) {
++					kobj=(KML_Object*)new KML_LinearRing();
++					kobj->Read(fid,kstrj);
++					outer     ->AddObject((Object*)kobj);
++				}
++
++				else if (!strncmp(kstrj,"<",1))
++					KML_Geometry::Read(fid,kstrj);
++
++				xfree((void**)&kstrj);
++			}
++
++		else if (!strcmp(kstri,"<innerBoundaryIs>"))
++
++/*  loop over and process fields within inner boundaries  */
++
++			while (kstrj=KMLFileToken(fid,
++									  &ncom,&pcom)) {
++				if      (!strncmp(kstrj,"</innerBoundaryIs",17)) {
++					xfree((void**)&kstrj);
++					break;
++				}
++				else if (!strncmp(kstrj,"</",2))
++				  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}
++				else if (strncmp(kstrj,"<",1))
++				  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}
++
++				else if (!strncmp(kstrj,"<LinearRing",11)) {
++					kobj=(KML_Object*)new KML_LinearRing();
++					kobj->Read(fid,kstrj);
++					inner     ->AddObject((Object*)kobj);
++				}
++
++				else if (!strncmp(kstrj,"<",1))
++					KML_Geometry::Read(fid,kstrj);
++
++				xfree((void**)&kstrj);
++			}
++
++
++		else if (!strncmp(kstri,"<",1))
++			KML_Geometry::Read(fid,kstri);
++
++		xfree((void**)&kstri);
++	}
++
++	this->AddCommnt(ncom,pcom);
++
++	for (ncom; ncom>0; ncom--)
++		xfree((void**)&(pcom[ncom-1]));
++	xfree((void**)&pcom);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION KML_Polygon::WriteExp {{{*/
++void  KML_Polygon::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++
++	int   i;
++	char  nstr2[81];
++
++/*  check outer boundary for the polygon  */
++
++	if (outer->Size()) {
++		if (strlen(nstr))
++			sprintf(nstr2,"%s (outer)",nstr);
++		else
++			sprintf(nstr2,"(outer)");
++
++		((KML_LinearRing *)outer->GetObjectByOffset(0))->WriteExp(fid,nstr2,sgn,cm,sp);
++	}
++
++/*  loop over any inner boundaries for the polygon  */
++
++	for (i=0; i<inner->Size(); i++) {
++		if (strlen(nstr))
++			sprintf(nstr2,"%s (inner %d of %d)",nstr,i+1,inner->Size());
++		else
++			sprintf(nstr2,"(inner %d of %d)",i+1,inner->Size());
++
++		((KML_LinearRing *)inner->GetObjectByOffset(i))->WriteExp(fid,nstr2,sgn,cm,sp);
++	}
++
++	return;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h	(revision 12822)
+@@ -0,0 +1,78 @@
++/*! \file DoubleVecParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _DOUBLEVECPARAM_H_
++#define _DOUBLEVECPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class DoubleVecParam: public Param{
++
++	private: 
++		int enum_type;
++		IssmDouble* values;
++		int M;
++
++	public:
++		/*DoubleVecParam constructors, destructors: {{{*/
++		DoubleVecParam();
++		DoubleVecParam(int enum_type,IssmDouble* values,int M);
++		~DoubleVecParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param virtual functions definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM);
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");};
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M);
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++		
++		void GetParameterName(char**pname);
++		/*}}}*/
++};
++#endif  /* _DOUBLEVECPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h	(revision 12822)
+@@ -0,0 +1,79 @@
++/*! \file DoubleParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _DOUBLEPARAM_H_
++#define _DOUBLEPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class DoubleParam: public Param{
++
++	private: 
++		/*just hold 3 values for 3 vertices: */
++		int enum_type;
++		IssmDouble value;
++
++	public:
++		/*DoubleParam constructors, destructors: {{{*/
++		DoubleParam();
++		DoubleParam(int enum_type,IssmDouble value);
++		~DoubleParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool);
++		void  GetParameterValue(int* pinteger);
++		void  GetParameterValue(int** pintarray,int* pM);
++		void  GetParameterValue(int** pintarray,int* pM,int* pN);
++		void  GetParameterValue(IssmDouble* pIssmDouble){*pIssmDouble=value;}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++
++		void  SetValue(bool boolean){this->value=(IssmDouble)boolean;}
++		void  SetValue(int integer){this->value=(IssmDouble)integer;}
++		void  SetValue(IssmDouble scalar){this->value=(IssmDouble)scalar;}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _DOUBLEPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.cpp	(revision 12822)
+@@ -0,0 +1,89 @@
++/*!\file FileParam.c
++ * \brief: implementation of the FileParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*FileParam constructors and destructor*/
++/*FUNCTION FileParam::FileParam(){{{*/
++FileParam::FileParam(){
++	return;
++}
++/*}}}*/
++/*FUNCTION FileParam::FileParam(int enum_type,FILE *value){{{*/
++FileParam::FileParam(int in_enum_type,FILE* in_value){
++
++	enum_type=in_enum_type;
++	value=in_value;
++}
++/*}}}*/
++/*FUNCTION FileParam::~FileParam(){{{*/
++FileParam::~FileParam(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION FileParam::Echo {{{*/
++void FileParam::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION FileParam::DeepEcho{{{*/
++void FileParam::DeepEcho(void){
++
++	_printLine_("FileParam:");
++	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " << this->value);
++}
++/*}}}*/
++/*FUNCTION FileParam::Id{{{*/
++int    FileParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION FileParam::MyRank{{{*/
++int    FileParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION FileParam::ObjectEnum{{{*/
++int FileParam::ObjectEnum(void){
++
++	return FileParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION FileParam::copy{{{*/
++Object* FileParam::copy() {
++	
++	return new FileParam(this->enum_type,this->value);
++
++}
++/*}}}*/
++
++/*FileParam virtual functions definitions: */
++/*FUNCTION FileParam::GetParameterName{{{*/
++void FileParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION FileParam::UnitConversion{{{*/
++void  FileParam::UnitConversion(int direction_enum){
++	/*do nothing, no unit conversion*/
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h	(revision 12822)
+@@ -0,0 +1,81 @@
++/*! \file DoubleMatArrayParam.h 
++ *  \brief: header file for object holding an array of serial matrices
++ */
++
++
++#ifndef _DOUBLEMATARRAYPARAM_H_
++#define _DOUBLEMATARRAYPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class DoubleMatArrayParam: public Param{
++
++	private: 
++		int      enum_type;
++		IssmDouble** array; //array of matrices
++		int      M; //size of array
++		int*     mdim_array; //m-dimensions of matrices in the array
++		int*     ndim_array; //n-dimensions -f matrices in the array
++
++	public:
++		/*DoubleMatArrayParam constructors, destructors: {{{*/
++		DoubleMatArrayParam();
++		DoubleMatArrayParam(int enum_type,IssmDouble** array, int M, int* mdim_array, int* ndim_array);
++		~DoubleMatArrayParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims);
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble vec array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble mat array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");}
++		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a int mat array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array);
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _DOUBLEMATARRAYPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h	(revision 12822)
+@@ -0,0 +1,80 @@
++/*! \file DoubleMatParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _DOUBLEMATPARAM_H_
++#define _DOUBLEMATPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class DoubleMatParam: public Param{
++
++	protected: 
++		int enum_type;
++		IssmDouble* value;
++		int M;
++		int N;
++
++	public:
++		/*DoubleMatParam constructors, destructors: {{{*/
++		DoubleMatParam();
++		DoubleMatParam(int enum_type,IssmDouble* value,int M,int N);
++		~DoubleMatParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN);
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN);
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N);
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}
++		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _DOUBLEMATPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/Param.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/Param.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/Param.h	(revision 12822)
+@@ -0,0 +1,60 @@
++/*!\file:  Param.h
++ * \brief abstract class for Param object
++ */ 
++
++
++#ifndef _PARAM_H_
++#define _PARAM_H_
++
++/*Headers:*/
++/*{{{*/
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "../Object.h"
++#include "../Node.h"
++/*}}}*/
++
++class Param: public Object{
++
++	public: 
++		virtual        ~Param(){};
++
++		/*Virtual functions:*/
++		virtual int   InstanceEnum()=0;
++		virtual void  GetParameterValue(bool* pbool)=0;
++		virtual void  GetParameterValue(int* pinteger)=0;
++		virtual void  GetParameterValue(int** pintarray,int* pM)=0;
++		virtual void  GetParameterValue(int** pintarray,int* pM,int* pN)=0;
++		virtual void  GetParameterValue(IssmDouble* pIssmDouble)=0;
++		virtual void  GetParameterValue(IssmDouble* pdouble,IssmDouble time)=0;
++		virtual void  GetParameterValue(char** pstring)=0;
++		virtual void  GetParameterValue(char*** pstringarray,int* pM)=0;
++		virtual void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM)=0;
++		virtual void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN)=0;
++		virtual void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims)=0;
++		virtual void  GetParameterValue(Vector** pvec)=0;
++		virtual void  GetParameterValue(Matrix** pmat)=0;
++		virtual void  GetParameterValue(FILE** pfid)=0;
++		
++		virtual void  SetValue(bool boolean)=0;
++		virtual void  SetValue(int integer)=0;
++		virtual void  SetValue(IssmDouble scalar)=0;
++		virtual void  SetValue(char* string)=0;
++		virtual void  SetValue(char** stringarray,int M)=0;
++		virtual void  SetValue(IssmDouble* IssmDoublearray,int M)=0;
++		virtual void  SetValue(IssmDouble* pIssmDoublearray,int M,int N)=0;
++		virtual void  SetValue(int* intarray,int M)=0;
++		virtual void  SetValue(int* pintarray,int M,int N)=0;
++		virtual void  SetValue(Vector* vec)=0;
++		virtual void  SetValue(Matrix* mat)=0;
++		virtual void  SetValue(FILE* fid)=0;
++		virtual void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array)=0;
++		virtual void  UnitConversion(int direction_enum)=0;
++		virtual void  GetParameterName(char**pname)=0;
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h	(revision 12822)
+@@ -0,0 +1,78 @@
++/*! \file FileParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _FILEPARAM_H_
++#define _FILEPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class FileParam: public Param{
++
++	private: 
++		int   enum_type;
++		FILE* value;
++
++	public:
++		/*FileParam constructors, destructors: {{{*/
++		FileParam();
++		FileParam(int enum_type,FILE* fid);
++		~FileParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){  _error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){*pfid=value;};
++
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _INTPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.cpp	(revision 12822)
+@@ -0,0 +1,147 @@
++/*!\file IntVecParam.c
++ * \brief: implementation of the IntVecParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*IntVecParam constructors and destructor*/
++/*FUNCTION 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){
++
++	enum_type=in_enum_type;
++	M=in_M;
++
++	if(M){
++		values=xNew<int>(M);
++		xMemCpy<int>(values,in_values,M);
++	}
++	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){
++
++	enum_type=in_enum_type;
++	M=in_M;
++
++	if(M){
++		values=xNew<int>(M);
++		for(int i=0;i<in_M;i++) values[i]=reCast<int>(in_values[i]);
++	}
++	else values=NULL;
++}
++/*}}}*/
++/*FUNCTION IntVecParam::~IntVecParam(){{{*/
++IntVecParam::~IntVecParam(){
++	xDelete<int>(values);
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION IntVecParam::Echo {{{*/
++void IntVecParam::Echo(void){
++
++	_printLine_("IntVecParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   vector size: " << this->M);
++
++}
++/*}}}*/
++/*FUNCTION IntVecParam::DeepEcho{{{*/
++void IntVecParam::DeepEcho(void){
++
++	int i;
++	
++	_printLine_("IntVecParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   vector size: " << this->M);
++	for(i=0;i<this->M;i++){
++		_printLine_(i << " " << this->values[i]);
++	}
++}
++/*}}}*/
++/*FUNCTION IntVecParam::Id{{{*/
++int    IntVecParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION IntVecParam::MyRank{{{*/
++int    IntVecParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION IntVecParam::ObjectEnum{{{*/
++int IntVecParam::ObjectEnum(void){
++
++	return IntVecParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION IntVecParam::copy{{{*/
++Object* IntVecParam::copy() {
++	
++	return new IntVecParam(this->enum_type,this->values,this->M);
++
++}
++/*}}}*/
++
++/*IntVecParam virtual functions definitions: */
++/*FUNCTION IntVecParam::GetParameterValue{{{*/
++void  IntVecParam::GetParameterValue(int** pintarray,int* pM){
++	int* output=NULL;
++
++	if(M){
++		output=xNew<int>(M);
++		xMemCpy<int>(output,values,M);
++	}
++
++	/*Assign output pointers:*/
++	if(pM) *pM=M;
++	*pintarray=output;
++}
++/*}}}*/
++/*FUNCTION IntVecParam::GetParameterName{{{*/
++void IntVecParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION IntVecParam::SetValue{{{*/
++void  IntVecParam::SetValue(int* intarray,int in_M){
++
++	/*avoid leak: */
++	xDelete<int>(this->values);
++
++	if(in_M){
++		this->values=xNew<int>(in_M);
++		xMemCpy<int>(this->values,intarray,in_M);
++	}
++	else this->values=NULL;
++
++	this->M=in_M;
++}
++/*}}}*/
++/*FUNCTION IntVecParam::UnitConversion{{{*/
++void  IntVecParam::UnitConversion(int direction_enum){
++	/*do nothing, no unit conversion*/
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.cpp	(revision 12822)
+@@ -0,0 +1,89 @@
++/*!\file IntParam.c
++ * \brief: implementation of the IntParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*IntParam constructors and destructor*/
++/*FUNCTION IntParam::IntParam(){{{*/
++IntParam::IntParam(){
++	return;
++}
++/*}}}*/
++/*FUNCTION IntParam::IntParam(int enum_type,IssmInt value){{{*/
++IntParam::IntParam(int in_enum_type,IssmInt in_value){
++
++	enum_type=in_enum_type;
++	value=in_value;
++}
++/*}}}*/
++/*FUNCTION IntParam::~IntParam(){{{*/
++IntParam::~IntParam(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION IntParam::Echo {{{*/
++void IntParam::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION IntParam::DeepEcho{{{*/
++void IntParam::DeepEcho(void){
++
++	_printLine_("IntParam:");
++	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " << this->value);
++}
++/*}}}*/
++/*FUNCTION IntParam::Id{{{*/
++int    IntParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION IntParam::MyRank{{{*/
++int    IntParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION IntParam::ObjectEnum{{{*/
++int IntParam::ObjectEnum(void){
++
++	return IntParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION IntParam::copy{{{*/
++Object* IntParam::copy() {
++	
++	return new IntParam(this->enum_type,this->value);
++
++}
++/*}}}*/
++
++/*IntParam virtual functions definitions: */
++/*FUNCTION IntParam::GetParameterName{{{*/
++void IntParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION IntParam::UnitConversion{{{*/
++void  IntParam::UnitConversion(int direction_enum){
++	/*do nothing, no unit conversion*/
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.cpp	(revision 12822)
+@@ -0,0 +1,89 @@
++/*!\file BoolParam.c
++ * \brief: implementation of the BoolParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*BoolParam constructors and destructor*/
++/*FUNCTION BoolParam::BoolParam(){{{*/
++BoolParam::BoolParam(){
++	return;
++}
++/*}}}*/
++/*FUNCTION BoolParam::BoolParam(int enum_type,IssmBool value){{{*/
++BoolParam::BoolParam(int in_enum_type,IssmBool in_value){
++
++	enum_type=in_enum_type;
++	value=in_value;
++}
++/*}}}*/
++/*FUNCTION BoolParam::~BoolParam(){{{*/
++BoolParam::~BoolParam(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION BoolParam::Echo {{{*/
++void BoolParam::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION BoolParam::DeepEcho{{{*/
++void BoolParam::DeepEcho(void){
++
++	_printLine_("BoolParam:");
++	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " <<(this->value?"true":"false"));
++}
++/*}}}*/
++/*FUNCTION BoolParam::Id{{{*/
++int    BoolParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION BoolParam::MyRank{{{*/
++int    BoolParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION BoolParam::ObjectEnum{{{*/
++int BoolParam::ObjectEnum(void){
++
++	return BoolParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION BoolParam::copy{{{*/
++Object* BoolParam::copy() {
++	
++	return new BoolParam(this->enum_type,this->value);
++
++}
++/*}}}*/
++
++/*BoolParam virtual functions definitions: */
++/*FUNCTION BoolParam::GetParameterName{{{*/
++void BoolParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION BoolParam::UnitConversion{{{*/
++void  BoolParam::UnitConversion(int direction_enum){
++	/*do nothing, no unit conversion*/
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.cpp	(revision 12822)
+@@ -0,0 +1,131 @@
++/*!\file IntMatParam.c
++ * \brief: implementation of the IntMatParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*IntMatParam constructors and destructor*/
++/*FUNCTION 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){
++
++	enum_type=in_enum_type;
++	M=in_M;
++	N=in_N;
++
++	value=xNew<int>(M*N);
++	xMemCpy<int>(value,in_value,M*N);
++}
++/*}}}*/
++/*FUNCTION IntMatParam::~IntMatParam(){{{*/
++IntMatParam::~IntMatParam(){
++	xDelete<int>(value);
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION IntMatParam::Echo {{{*/
++void IntMatParam::Echo(void){
++
++	_printLine_("IntMatParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   matrix size: " << this->M << "x" << this->N);
++
++}
++/*}}}*/
++/*FUNCTION IntMatParam::DeepEcho{{{*/
++void IntMatParam::DeepEcho(void){
++
++	int i,j;
++	
++	_printLine_("IntMatParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   matrix size: " << this->M << "x" << this->N);
++	for(i=0;i<this->M;i++){
++		for(i=0;i<this->N;i++){
++			_printLine_("(" << i << "," << j << ") " << *(this->value+N*i+j));
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION IntMatParam::Id{{{*/
++int    IntMatParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION IntMatParam::MyRank{{{*/
++int    IntMatParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION IntMatParam::ObjectEnum{{{*/
++int IntMatParam::ObjectEnum(void){
++
++	return IntMatParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION IntMatParam::copy{{{*/
++Object* IntMatParam::copy() {
++	
++	return new IntMatParam(this->enum_type,this->value,this->M,this->N);
++
++}
++/*}}}*/
++
++/*IntMatParam virtual functions definitions: */
++/*FUNCTION IntMatParam::GetParameterValue{{{*/
++void  IntMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){
++	int* output=NULL;
++
++	output=xNew<int>(M*N);
++	xMemCpy<int>(output,value,M*N);
++
++	/*Assign output pointers:*/
++	if(pM) *pM=M;
++	if(pN) *pN=N;
++	*pintarray=output;
++}
++/*}}}*/
++/*FUNCTION IntMatParam::GetParameterName{{{*/
++void IntMatParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION IntMatParam::SetValue{{{*/
++void  IntMatParam::SetValue(int* intarray,int in_M,int in_N){
++
++	/*avoid leak: */
++	xDelete<int>(this->value);
++
++	this->value=xNew<int>(in_M*in_N);
++	xMemCpy<int>(this->value,intarray,in_M*in_N);
++
++	this->M=in_M;
++	this->N=in_N;
++}
++/*}}}*/
++/*FUNCTION IntMatParam::UnitConversion{{{*/
++void  IntMatParam::UnitConversion(int direction_enum){
++	/*do nothing, no unit conversion*/
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h	(revision 12822)
+@@ -0,0 +1,79 @@
++/*! \file IntVecParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _INTVECPARAM_H_
++#define _INTVECPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class IntVecParam: public Param{
++
++	private: 
++		int enum_type;
++		int* values;
++		int M;
++
++	public:
++		/*IntVecParam constructors, destructors: {{{*/
++		IntVecParam();
++		IntVecParam(int enum_type,int* values,int M);
++		IntVecParam(int enum_type,IssmDouble* values,int M);
++		~IntVecParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param virtual functions definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM);
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array (maybe in serial?)");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
++		void  SetValue(int* intarray,int M);
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++		
++		void GetParameterName(char**pname);
++		/*}}}*/
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h	(revision 12822)
+@@ -0,0 +1,79 @@
++/*! \file IntParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _INTPARAM_H_
++#define _INTPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class IntParam: public Param{
++
++	private: 
++		/*just hold 3 values for 3 vertices: */
++		int enum_type;
++		IssmInt value;
++
++	public:
++		/*IntParam constructors, destructors: {{{*/
++		IntParam();
++		IntParam(int enum_type,IssmInt value);
++		~IntParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){*pinteger=value;}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a bool");}
++		void  SetValue(int integer){this->value=integer;}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}
++		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an IssmDouble");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _INTPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h	(revision 12822)
+@@ -0,0 +1,77 @@
++/*! \file BoolParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _BOOLPARAM_H_
++#define _BOOLPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class BoolParam: public Param{
++
++	public:
++		/*just hold 3 values for 3 vertices: */
++		int enum_type;
++		IssmBool value;
++
++		/*BoolParam constructors, destructors: {{{*/
++		BoolParam();
++		BoolParam(int enum_type,IssmBool value);
++		~BoolParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){*pbool=value;}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a FILE");}
++
++		void  SetValue(bool boolean){this->value=boolean;}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an int");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an IssmPDouble");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++		
++		void GetParameterName(char**pname);
++		/*}}}*/
++};
++#endif  /* _BOOLPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h	(revision 12822)
+@@ -0,0 +1,80 @@
++/*! \file IntMatParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _INTMATPARAM_H_
++#define _INTMATPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class IntMatParam: public Param{
++
++	private: 
++		int enum_type;
++		int* value;
++		int M;
++		int N;
++
++	public:
++		/*IntMatParam constructors, destructors: {{{*/
++		IntMatParam();
++		IntMatParam(int enum_type,int* value,int M,int N);
++		~IntMatParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN);
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");};
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");};
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");};
++		void  SetValue(int* intarray,int M,int N);
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _INTMATPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp	(revision 12822)
+@@ -0,0 +1,121 @@
++/*!\file VectorParam.c
++ * \brief: implementation of the VectorParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*VectorParam constructors and destructor*/
++/*FUNCTION VectorParam::VectorParam(){{{*/
++VectorParam::VectorParam(){
++	return;
++}
++/*}}}*/
++/*FUNCTION VectorParam::VectorParam(int enum_type,IssmVector value){{{*/
++VectorParam::VectorParam(int in_enum_type,Vector* in_value){
++
++	enum_type=in_enum_type;
++
++	value=NULL;
++
++	if(in_value){
++		value=in_value->Duplicate();
++		in_value->Copy(value);
++	}
++}
++/*}}}*/
++/*FUNCTION VectorParam::~VectorParam(){{{*/
++VectorParam::~VectorParam(){
++	xdelete(&value);
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION VectorParam::Echo {{{*/
++void VectorParam::Echo(void){
++
++	_printLine_("VectorParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++
++}
++/*}}}*/
++/*FUNCTION VectorParam::DeepEcho{{{*/
++void VectorParam::DeepEcho(void){
++
++	int i;
++	_printLine_("VectorParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	value->Echo();
++}
++/*}}}*/
++/*FUNCTION VectorParam::Id{{{*/
++int    VectorParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION VectorParam::MyRank{{{*/
++int    VectorParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION VectorParam::ObjectEnum{{{*/
++int VectorParam::ObjectEnum(void){
++
++	return VectorParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION VectorParam::copy{{{*/
++Object* VectorParam::copy() {
++	
++	return new VectorParam(this->enum_type,this->value);
++
++}
++/*}}}*/
++
++/*VectorParam virtual functions definitions: */
++/*FUNCTION VectorParam::GetParameterValue{{{*/
++void  VectorParam::GetParameterValue(Vector** poutput){
++	Vector*  output=NULL;
++
++	if(value){
++		output=value->Duplicate();
++		value->Copy(output);
++	}
++	*poutput=output;
++}
++/*}}}*/
++/*FUNCTION VectorParam::GetParameterName{{{*/
++void VectorParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION VectorParam::SetValue{{{*/
++void  VectorParam::SetValue(Vector* vector){
++
++	/*avoid leak: */
++	xdelete(&value);
++	
++	/*copy: */
++	value=vector->Duplicate();
++	vector->Copy(value);
++}
++/*}}}*/
++/*FUNCTION VectorParam::UnitConversion{{{*/
++void  VectorParam::UnitConversion(int direction_enum){
++	/*do nothing, no unit conversion*/
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.cpp	(revision 12822)
+@@ -0,0 +1,30 @@
++/*!\file DoubleTransientMatParam.c
++ * \brief: implementation of the DoubleTransientMatParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.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){
++}
++/*}}}*/
++/*FUNCTION DoubleTransientMatParam::UnitConversion{{{*/
++void  DoubleTransientMatParam::UnitConversion(int direction_enum){
++	::UnitConversion(this->value,(this->M-1)*this->N,direction_enum,this->enum_type);
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp	(revision 12822)
+@@ -0,0 +1,117 @@
++/*!\file MatrixParam.c
++ * \brief: implementation of the MatrixParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*MatrixParam constructors and destructor*/
++/*FUNCTION MatrixParam::MatrixParam(){{{*/
++MatrixParam::MatrixParam(){
++	return;
++}
++/*}}}*/
++/*FUNCTION MatrixParam::MatrixParam(int enum_type,Matrix* value){{{*/
++MatrixParam::MatrixParam(int in_enum_type,Matrix* in_value){
++
++	enum_type=in_enum_type;
++	value=NULL;
++
++	if(in_value){
++		value=in_value->Duplicate();
++	}
++}
++/*}}}*/
++/*FUNCTION MatrixParam::~MatrixParam(){{{*/
++MatrixParam::~MatrixParam(){
++	xdelete(&value);
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION MatrixParam::Echo {{{*/
++void MatrixParam::Echo(void){
++
++	_printLine_("MatrixParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++
++}
++/*}}}*/
++/*FUNCTION MatrixParam::DeepEcho{{{*/
++void MatrixParam::DeepEcho(void){
++
++	int i;
++	_printLine_("MatrixParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	this->value->Echo();
++}
++/*}}}*/
++/*FUNCTION MatrixParam::Id{{{*/
++int    MatrixParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION MatrixParam::MyRank{{{*/
++int    MatrixParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION MatrixParam::ObjectEnum{{{*/
++int MatrixParam::ObjectEnum(void){
++
++	return MatrixParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION MatrixParam::copy{{{*/
++Object* MatrixParam::copy() {
++	
++	return new MatrixParam(this->enum_type,this->value);
++
++}
++/*}}}*/
++
++/*MatrixParam virtual functions definitions: */
++/*FUNCTION MatrixParam::GetParameterValue{{{*/
++void  MatrixParam::GetParameterValue(Matrix** poutput){
++	Matrix* output=NULL;
++
++	if(value){
++		output=value->Duplicate();
++	}
++	*poutput=output;
++}
++/*}}}*/
++/*FUNCTION MatrixParam::GetParameterName{{{*/
++void MatrixParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION MatrixParam::SetValue{{{*/
++void  MatrixParam::SetValue(Matrix* matrix){
++	
++	/*avoid leak: */
++	xdelete(&value);
++	
++	/*copy: */
++	value=matrix->Duplicate();
++}
++/*}}}*/
++/*FUNCTION MatrixParam::UnitConversion{{{*/
++void  MatrixParam::UnitConversion(int direction_enum){
++	/*do nothing, no unit conversion*/
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.cpp	(revision 12822)
+@@ -0,0 +1,179 @@
++/*!\file StringArrayParam.c
++ * \brief: implementation of the StringArrayParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*StringArrayParam constructors and destructor*/
++/*FUNCTION 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){
++
++	int i;
++	int size;
++
++	enum_type=in_enum_type;
++	numstrings=in_numstrings;
++
++	if(numstrings){
++		value=xNew<char*>(numstrings);
++		for(i=0;i<numstrings;i++){
++			char* string=NULL;
++			size=strlen(in_values[i])+1;
++			string=xNew<char>(size);
++			xMemCpy<char>(string,in_values[i],size);
++			value[i]=string;
++		}
++	}
++	else value=NULL;
++	
++}
++/*}}}*/
++/*FUNCTION StringArrayParam::~StringArrayParam(){{{*/
++StringArrayParam::~StringArrayParam(){
++		
++	int i;
++	
++	char* string=NULL;
++	for(i=0;i<this->numstrings;i++){
++		string=value[i];
++		xDelete<char>(string);
++	}
++	xDelete<char*>(value);
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION StringArrayParam::Echo {{{*/
++void StringArrayParam::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION StringArrayParam::DeepEcho{{{*/
++void StringArrayParam::DeepEcho(void){
++
++	int i;
++	char* string=NULL;
++
++	_printLine_("StringArrayParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	for(i=0;i<this->numstrings;i++){
++		string=this->value[i];
++		_printLine_("   " << i << ": " << string);
++	}
++}
++/*}}}*/
++/*FUNCTION StringArrayParam::Id{{{*/
++int    StringArrayParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION StringArrayParam::MyRank{{{*/
++int    StringArrayParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION StringArrayParam::ObjectEnum{{{*/
++int StringArrayParam::ObjectEnum(void){
++
++	return StringArrayParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION StringArrayParam::copy{{{*/
++Object* StringArrayParam::copy() {
++	
++	return new StringArrayParam(this->enum_type,this->value,this->numstrings);
++
++}
++/*}}}*/
++
++/*StringArrayParam virtual functions definitions: */
++/*FUNCTION StringArrayParam::GetParameterValue{{{*/
++void  StringArrayParam::GetParameterValue(char*** pstringarray,int* pM){
++	
++	int   i;
++	char** outstrings=NULL;
++	int   M;
++	char* string=NULL;
++	char* string2=NULL;
++	int   stringsize;
++
++	M=this->numstrings;
++	if(this->numstrings){
++		outstrings=xNew<char*>(this->numstrings);
++
++		for(i=0;i<this->numstrings;i++){
++			string=this->value[i];
++			stringsize=strlen(string)+1;
++
++			string2=xNew<char>(stringsize);
++			xMemCpy<char>(string2,string,stringsize);
++
++			outstrings[i]=string2;
++		}
++	}
++	else outstrings=NULL;
++
++	/*Assign output pointers:*/
++	*pM=M;
++	*pstringarray=outstrings;
++}
++/*}}}*/
++/*FUNCTION StringArrayParam::GetParameterName{{{*/
++void StringArrayParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION StringArrayParam::SetValue{{{*/
++void  StringArrayParam::SetValue(char** stringarray,int M){
++	
++	int   i;
++	char *string     = NULL;
++	char *string2    = NULL;
++	int   stringsize;
++
++	/*first, avoid leak: */
++	for(i=0;i<this->numstrings;i++){
++		string=this->value[i];
++		xDelete<char>(string);
++	}
++	xDelete<char*>(this->value);
++
++	/*copy: */
++	this->numstrings=M;
++	this->value=xNew<char*>(this->numstrings);
++	for(i=0;i<this->numstrings;i++){
++		string=stringarray[i];
++		stringsize=strlen(string)+1;
++
++		string2=xNew<char>(stringsize);
++		xMemCpy<char>(string2,string,stringsize);
++
++		this->value[i]=string2;
++	}
++}
++/*}}}*/
++/*FUNCTION StringArrayParam::UnitConversion{{{*/
++void  StringArrayParam::UnitConversion(int direction_enum){
++	/*do nothing, no unit conversion*/
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.cpp	(revision 12822)
+@@ -0,0 +1,121 @@
++/*!\file StringParam.c
++ * \brief: implementation of the StringParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*StringParam constructors and destructor*/
++/*FUNCTION StringParam::StringParam(){{{*/
++StringParam::StringParam(){
++	return;
++}
++/*}}}*/
++/*FUNCTION StringParam::StringParam(int enum_type,IssmString value){{{*/
++StringParam::StringParam(int in_enum_type,char* in_value){
++
++	enum_type=in_enum_type;
++	value=xNew<char>(strlen(in_value)+1);
++	xMemCpy<char>(value,in_value,(strlen(in_value)+1));
++
++	
++}
++/*}}}*/
++/*FUNCTION StringParam::~StringParam(){{{*/
++StringParam::~StringParam(){
++	xDelete<char>(value);
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION StringParam::Echo {{{*/
++void StringParam::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION StringParam::DeepEcho{{{*/
++void StringParam::DeepEcho(void){
++	_printLine_("StringParam:");
++	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " << this->value);
++}
++/*}}}*/
++/*FUNCTION StringParam::Id{{{*/
++int    StringParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION StringParam::MyRank{{{*/
++int    StringParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION StringParam::ObjectEnum{{{*/
++int StringParam::ObjectEnum(void){
++
++	return StringParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION StringParam::copy{{{*/
++Object* StringParam::copy() {
++	
++	return new StringParam(this->enum_type,this->value);
++
++}
++/*}}}*/
++
++/*StringParam virtual functions definitions: */
++/*FUNCTION StringParam::GetParameterValue{{{*/
++void  StringParam::GetParameterValue(char** pstring){
++	
++	char* outstring=NULL;
++	int   stringsize;
++
++	stringsize=strlen(this->value)+1;
++
++	outstring=xNew<char>(stringsize);
++	xMemCpy<char>(outstring,this->value,stringsize);
++
++	*pstring=outstring;
++
++}
++/*}}}*/
++/*FUNCTION StringParam::GetParameterName{{{*/
++void StringParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION StringParam::SetValue{{{*/
++void  StringParam::SetValue(char* string){
++	
++	int   stringsize;
++	
++	/*avoid leak: */
++	xDelete<char>(this->value);
++
++	/*copy: */
++	stringsize=strlen(string)+1;
++	this->value=xNew<char>(stringsize);
++	xMemCpy<char>(this->value,string,stringsize);
++
++}
++/*}}}*/
++/*FUNCTION StringParam::UnitConversion{{{*/
++void  StringParam::UnitConversion(int direction_enum){
++	/*do nothing, no unit conversion*/
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp	(revision 12822)
+@@ -0,0 +1,151 @@
++/*!\file TransientParam.c
++ * \brief: implementation of the TransientParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*TransientParam constructors and destructor*/
++/*FUNCTION 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){
++
++	_assert_(in_values && in_time);
++
++	enum_type=in_enum_type;
++	N=in_N;
++
++	values=xNew<IssmDouble>(N);
++	xMemCpy<IssmDouble>(values,in_values,N);
++
++	timesteps=xNew<IssmDouble>(N);
++	xMemCpy<IssmDouble>(timesteps,in_time,N);
++}
++/*}}}*/
++/*FUNCTION TransientParam::~TransientParam(){{{*/
++TransientParam::~TransientParam(){
++	xDelete<IssmDouble>(values);
++	xDelete<IssmDouble>(timesteps);
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION TransientParam::Echo {{{*/
++void TransientParam::Echo(void){
++
++	_printLine_("TransientParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   size: " << this->N);
++
++}
++/*}}}*/
++/*FUNCTION TransientParam::DeepEcho{{{*/
++void TransientParam::DeepEcho(void){
++
++	int i,j;
++	
++	_printLine_("TransientParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   size: " << this->N);
++	for(i=0;i<this->N;i++){
++		_printLine_(   "time: " << this->timesteps[i] << " value: " << this->values[i]);
++	}
++}
++/*}}}*/
++/*FUNCTION TransientParam::Id{{{*/
++int    TransientParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION TransientParam::MyRank{{{*/
++int    TransientParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION TransientParam::ObjectEnum{{{*/
++int TransientParam::ObjectEnum(void){
++
++	return TransientParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION TransientParam::copy{{{*/
++Object* TransientParam::copy() {
++	
++	return new TransientParam(this->enum_type,this->values,this->timesteps,this->N);
++
++}
++/*}}}*/
++
++/*TransientParam virtual functions definitions: */
++/*FUNCTION TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){{{*/
++void  TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){
++
++	double output;
++	bool   found;
++
++	/*Ok, we have the time, go through the timesteps, and figure out which interval we 
++	 *fall within. Then interpolate the values on this interval: */
++	if(time<this->timesteps[0]){
++		/*get values for the first time: */
++		output=this->values[0];
++		found=true;
++	}
++	else if(time>this->timesteps[this->N-1]){
++		/*get values for the last time: */
++		output=this->values[this->N-1];
++		found=true;
++	}
++	else{
++		/*Find which interval we fall within: */
++		for(int i=0;i<this->N;i++){
++			if(time==this->timesteps[i]){
++				/*We are right on one step time: */
++				output=this->values[i];
++				found=true;
++				break; //we are done with the time interpolation.
++			}
++			else{
++				if(this->timesteps[i]<time && time<this->timesteps[i+1]){
++					/*ok, we have the interval ]i:i+1[. Interpolate linearly for now: */
++					IssmDouble deltat=this->timesteps[i+1]-this->timesteps[i];
++					IssmDouble alpha=(time-this->timesteps[i])/deltat;
++					output=(1.0-alpha)*this->values[i] + alpha*this->values[i+1];
++					found=true;
++					break;
++				}
++				else continue; //keep looking on the next interval
++			}
++		}
++	}
++	if(!found)_error2_("did not find time interval on which to interpolate values");
++	*pdouble=output;
++}
++/*}}}*/
++/*FUNCTION TransientParam::GetParameterName{{{*/
++void TransientParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION TransientParam::UnitConversion{{{*/
++void  TransientParam::UnitConversion(int direction_enum){
++	::UnitConversion(this->values,this->N,direction_enum,this->enum_type);
++}
++/*}}}*/
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h	(revision 12822)
+@@ -0,0 +1,79 @@
++/*! \file VectorParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _VECTORPARAM_H_
++#define _VECTORPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class VectorParam: public Param{
++
++	private: 
++		/*just hold 3 values for 3 vertices: */
++		int enum_type;
++		Vector* value;
++
++	public:
++		/*VectorParam constructors, destructors: {{{*/
++		VectorParam();
++		VectorParam(int enum_type,Vector* value);
++		~VectorParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector** poutput);
++		void  GetParameterValue(FILE** pfid){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
++		void  SetValue(Vector* vec);
++		void  SetValue(Matrix* mat){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _VECTORPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp	(revision 12822)
+@@ -0,0 +1,150 @@
++/*!\file DoubleVecParam.c
++ * \brief: implementation of the DoubleVecParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*DoubleVecParam constructors and destructor*/
++/*FUNCTION 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){
++
++	enum_type=in_enum_type;
++	M=in_M;
++
++	values=xNew<IssmDouble>(M);
++	xMemCpy<IssmDouble>(values,in_values,M);
++}
++/*}}}*/
++/*FUNCTION DoubleVecParam::~DoubleVecParam(){{{*/
++DoubleVecParam::~DoubleVecParam(){
++	xDelete<IssmDouble>(values);
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION DoubleVecParam::Echo {{{*/
++void DoubleVecParam::Echo(void){
++
++	_printLine_("DoubleVecParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   vector size: " << this->M);
++
++}
++/*}}}*/
++/*FUNCTION DoubleVecParam::DeepEcho{{{*/
++void DoubleVecParam::DeepEcho(void){
++
++	int i;
++	
++	_printLine_("DoubleVecParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   vector size: " << this->M);
++	for(i=0;i<this->M;i++){
++		_printLine_(i << " " << this->values[i]);
++	}
++}
++/*}}}*/
++/*FUNCTION DoubleVecParam::Id{{{*/
++int    DoubleVecParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION DoubleVecParam::MyRank{{{*/
++int    DoubleVecParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION DoubleVecParam::ObjectEnum{{{*/
++int DoubleVecParam::ObjectEnum(void){
++
++	return DoubleVecParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION DoubleVecParam::copy{{{*/
++Object* DoubleVecParam::copy() {
++	
++	return new DoubleVecParam(this->enum_type,this->values,this->M);
++
++}
++/*}}}*/
++
++/*DoubleVecParam virtual functions definitions: */
++/*FUNCTION DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/
++void  DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){
++	IssmDouble* output=NULL;
++	int M;
++
++	M=this->M;
++	output=xNew<IssmDouble>(M);
++	xMemCpy<IssmDouble>(output,values,M);
++
++	/*Assign output pointers:*/
++	if(pM) *pM=M;
++	*pIssmDoublearray=output;
++}
++/*}}}*/
++/*FUNCTION DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/
++void  DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){
++	IssmDouble* output=NULL;
++	int M;
++	int N;
++
++	N=1;
++	M=this->M;
++	output=xNew<IssmDouble>(M);
++	xMemCpy<IssmDouble>(output,values,M);
++
++	/*Assign output pointers:*/
++	if(pM) *pM=M;
++	if(pN) *pN=N;
++	*pIssmDoublearray=output;
++}
++/*}}}*/
++/*FUNCTION DoubleVecParam::GetParameterValue(int** pintarray,int* pM){{{*/
++void  DoubleVecParam::GetParameterValue(int** pintarray,int* pM){
++	_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
++}
++/*}}}*/
++/*FUNCTION DoubleVecParam::GetParameterName{{{*/
++void DoubleVecParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION DoubleVecParam::SetValue{{{*/
++void  DoubleVecParam::SetValue(IssmDouble* IssmDoublearray,int in_M){
++
++	/*avoid leak: */
++	xDelete<IssmDouble>(this->values);
++
++	this->values=xNew<IssmDouble>(in_M);
++	xMemCpy<IssmDouble>(this->values,IssmDoublearray,in_M);
++
++	this->M=in_M;
++}
++/*}}}*/
++/*FUNCTION DoubleVecParam::UnitConversion{{{*/
++void  DoubleVecParam::UnitConversion(int direction_enum){
++	::UnitConversion(this->values,this->M,direction_enum,this->enum_type);
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.h	(revision 12822)
+@@ -0,0 +1,32 @@
++/*! \file DoubleTransientMatParam.h 
++ *  \brief: header file for DoubleTransientMatParam object
++ */
++
++
++#ifndef _DOUBLETRANSIENTMATPARAM_H_
++#define _DOUBLETRANSIENTMATPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class DoubleTransientMatParam: public DoubleMatParam{
++
++	public:
++		/*DoubleTransientMatParam constructors, destructors: {{{*/
++		DoubleTransientMatParam(int enum_type,IssmDouble* value,int M,int N);
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		void  UnitConversion(int direction_enum);
++		/*}}}*/
++};
++#endif  /* _DOUBLETRANSIENTMATPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h	(revision 12822)
+@@ -0,0 +1,79 @@
++/*! \file MatrixParam.h 
++ *  \brief: header file for MatrixParam object
++ */
++
++
++#ifndef _MATRIXPARAM_H_
++#define _MATRIXPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class MatrixParam: public Param{
++
++	private: 
++		/*just hold 3 values for 3 vertices: */
++		int enum_type;
++		Matrix* value;
++
++	public:
++		/*MatrixParam constructors, destructors: {{{*/
++		MatrixParam();
++		MatrixParam(int enum_type,Matrix* value);
++		~MatrixParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");}
++		void  GetParameterValue(Matrix** poutput);
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat);
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _MATRIXPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp	(revision 12822)
+@@ -0,0 +1,116 @@
++/*!\file DoubleParam.c
++ * \brief: implementation of the DoubleParam object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*DoubleParam constructors and destructor*/
++/*FUNCTION DoubleParam::DoubleParam(){{{*/
++DoubleParam::DoubleParam(){
++	return;
++}
++/*}}}*/
++/*FUNCTION DoubleParam::DoubleParam(int enum_type,IssmDouble value){{{*/
++DoubleParam::DoubleParam(int in_enum_type,IssmDouble in_value){
++
++	enum_type=in_enum_type;
++	value=in_value;
++}
++/*}}}*/
++/*FUNCTION DoubleParam::~DoubleParam(){{{*/
++DoubleParam::~DoubleParam(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION DoubleParam::Echo {{{*/
++void DoubleParam::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION DoubleParam::DeepEcho{{{*/
++void DoubleParam::DeepEcho(void){
++
++	_printLine_("DoubleParam:");
++	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " << this->value);
++}
++/*}}}*/
++/*FUNCTION DoubleParam::Id{{{*/
++int    DoubleParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION DoubleParam::MyRank{{{*/
++int    DoubleParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION DoubleParam::ObjectEnum{{{*/
++int DoubleParam::ObjectEnum(void){
++
++	return DoubleParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION DoubleParam::copy{{{*/
++Object* DoubleParam::copy() {
++	
++	return new DoubleParam(this->enum_type,this->value);
++
++}
++/*}}}*/
++
++/*DoubleParam virtual functions definitions: */
++/*FUNCTION DoubleParam::GetParameterName{{{*/
++void DoubleParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION DoubleParam::GetParameterValue(int* pinteger){{{*/
++void DoubleParam::GetParameterValue(int* pinteger){
++	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
++}
++/*}}}*/
++/*FUNCTION DoubleParam::GetParameterValue(bool* pbool){{{*/
++void DoubleParam::GetParameterValue(bool* pbool){
++	_error2_("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){
++	_error2_("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){
++	_error2_("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){
++	_error2_("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){
++	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");
++}
++/*}}}*/
++/*FUNCTION DoubleParam::UnitConversion{{{*/
++void  DoubleParam::UnitConversion(int direction_enum){
++	::UnitConversion(&this->value,1,direction_enum,this->enum_type);
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h	(revision 12822)
+@@ -0,0 +1,80 @@
++/*! \file StringArrayParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _STRINGARRAYPARAM_H_
++#define _STRINGARRAYPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class StringArrayParam: public Param{
++
++	private: 
++		/*just hold 3 values for 3 vertices: */
++		int      enum_type;
++		char**   value;
++		int      numstrings;
++
++
++	public:
++		/*StringArrayParam constructors, destructors: {{{*/
++		StringArrayParam();
++		StringArrayParam(int enum_type,char** values, int numstrings);
++		~StringArrayParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM);
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Vec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M);
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++		/*}}}*/
++};
++#endif  /* _STRINGARRAYPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.cpp	(revision 12822)
+@@ -0,0 +1,252 @@
++/*!\file DoubleMatArrayParam.c
++ * \brief: implementation of the DoubleMatArrayParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*DoubleMatArrayParam constructors and destructor*/
++/*FUNCTION 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){
++
++	int i;
++	IssmDouble* matrix=NULL;
++	int     m,n;
++
++	enum_type=in_enum_type;
++	M=in_M;
++	if(M){
++		array=xNew<IssmDouble*>(M);
++		mdim_array=xNew<int>(M);
++		ndim_array=xNew<int>(M);
++
++		for(i=0;i<M;i++){
++			m=in_mdim_array[i]; 
++			n=in_ndim_array[i];
++
++			mdim_array[i]=m;
++			ndim_array[i]=n;
++
++			if(m*n){
++				matrix=xNew<IssmDouble>(m*n);
++				xMemCpy<IssmDouble>(matrix,in_array[i],m*n);
++			}
++			else{
++				matrix=NULL;
++			}
++			array[i]=matrix;
++		}
++	}
++	else{
++		array=NULL;
++		mdim_array=NULL;
++		ndim_array=NULL;
++	}
++}
++/*}}}*/
++/*FUNCTION DoubleMatArrayParam::~DoubleMatArrayParam(){{{*/
++DoubleMatArrayParam::~DoubleMatArrayParam(){
++
++	int i;
++	IssmDouble* matrix=NULL;
++
++	xDelete<int>(mdim_array);
++	xDelete<int>(ndim_array);
++
++	for(i=0;i<M;i++){
++		matrix=array[i];
++		xDelete<IssmDouble>(matrix);
++	}
++	
++	xDelete<IssmDouble*>(array);
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION DoubleMatArrayParam::Echo {{{*/
++void DoubleMatArrayParam::Echo(void){
++
++	_printLine_("DoubleMatArrayParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   array size: " << this->M);
++	_printLine_("   array pointer: " << this->array);
++
++}
++/*}}}*/
++/*FUNCTION DoubleMatArrayParam::DeepEcho{{{*/
++void DoubleMatArrayParam::DeepEcho(void){
++
++	int i,j,k;
++	int m,n;
++	IssmDouble* matrix=NULL;
++	
++	_printLine_("DoubleMatArrayParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   array size: " << this->M);
++	for(i=0;i<M;i++){
++		_printLine_("   array " << i << " (" << mdim_array[i] << "x" << ndim_array[i] << "):");
++		matrix=array[i];
++		m=mdim_array[i];
++		n=ndim_array[i];
++
++		for(j=0;j<m;j++){
++			_printString_("   ");
++			for(k=0;k<n;k++)_printString_(*(matrix+n*j+k) << " ");
++			_printLine_("");
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION DoubleMatArrayParam::Id{{{*/
++int    DoubleMatArrayParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION DoubleMatArrayParam::MyRank{{{*/
++int    DoubleMatArrayParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION DoubleMatArrayParam::ObjectEnum{{{*/
++int DoubleMatArrayParam::ObjectEnum(void){
++
++	return DoubleMatArrayParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION DoubleMatArrayParam::copy{{{*/
++Object* DoubleMatArrayParam::copy() {
++	
++	return new DoubleMatArrayParam(this->enum_type,this->array, this->M, this->mdim_array,this->ndim_array);
++
++}
++/*}}}*/
++
++/*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){
++
++	int i,m,n;
++	IssmDouble* matrix=NULL;
++	IssmDouble* out_matrix=NULL;
++
++	/*output: */
++	IssmDouble** out_array=NULL;
++	int      out_M;
++	int*     out_mdim_array=NULL;
++	int*     out_ndim_array=NULL;
++
++
++	out_M=this->M;
++	if(out_M){
++		out_array=xNew<IssmDouble*>(M);
++		out_mdim_array=xNew<int>(M);
++		out_ndim_array=xNew<int>(M);
++
++		xMemCpy<int>(out_mdim_array,this->mdim_array,M);
++		xMemCpy<int>(out_ndim_array,this->ndim_array,M);
++
++		for(i=0;i<this->M;i++){
++			matrix=this->array[i];
++			m=this->mdim_array[i];
++			n=this->ndim_array[i];
++
++			if(m*n){
++				out_matrix=xNew<IssmDouble>(m*n);
++				xMemCpy<IssmDouble>(out_matrix,matrix,m*n);
++			}
++			else{
++				out_matrix=NULL;
++			}
++			out_array[i]=out_matrix;
++		}
++	}
++	else{
++		out_array=NULL;
++		out_matrix=NULL;
++		out_ndim_array=NULL;
++	}
++
++
++	/*Assign output pointers:*/
++	if(pout_M) *pout_M=out_M;
++	if(pout_mdim_array) *pout_mdim_array=out_mdim_array;
++	if(pout_ndim_array) *pout_ndim_array=out_ndim_array;
++	*pout_array=out_array;
++
++}
++/*}}}*/
++/*FUNCTION DoubleMatArrayParam::GetParameterName{{{*/
++void DoubleMatArrayParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*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){
++
++	int i,m,n;
++	IssmDouble* in_matrix=NULL;
++	IssmDouble* matrix=NULL;
++
++	/*avoid leak: */
++	xDelete<int>(mdim_array);
++	xDelete<int>(ndim_array);
++	for(i=0;i<M;i++){
++		matrix=array[i];
++		xDelete<IssmDouble>(matrix);
++	}
++	xDelete<IssmDouble*>(array);
++
++	/*copy data: */
++	this->M=in_M;
++	this->array=xNew<IssmDouble*>(M);
++	this->mdim_array=xNew<int>(M);
++	this->ndim_array=xNew<int>(M);
++	
++	xMemCpy<int>(this->mdim_array,in_mdim_array,M);
++	xMemCpy<int>(this->ndim_array,in_ndim_array,M);
++
++	for(i=0;i<M;i++){
++		in_matrix=in_array[i];
++		m=in_mdim_array[i];
++		n=in_ndim_array[i];
++
++		matrix=xNew<IssmDouble>(m*n);
++		xMemCpy<IssmDouble>(matrix,in_matrix,m*n);
++
++		this->array[i]=matrix;
++	}
++
++}
++/*}}}*/
++/*FUNCTION DoubleMatArrayParam::UnitConversion{{{*/
++void  DoubleMatArrayParam::UnitConversion(int direction_enum){
++	/*go through all matrices and convert: */
++	for (int i=0;i<this->M;i++){
++		IssmDouble* matrix=this->array[i];
++		int     m=this->mdim_array[i];
++		int     n=this->ndim_array[i];
++		::UnitConversion(matrix,m*n,direction_enum,this->enum_type);
++	}
++
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h	(revision 12822)
+@@ -0,0 +1,79 @@
++/*! \file StringParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _STRINGPARAM_H_
++#define _STRINGPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class StringParam: public Param{
++
++	private: 
++		/*just hold 3 values for 3 vertices: */
++		int enum_type;
++		char* value;
++
++	public:
++		/*StringParam constructors, destructors: {{{*/
++		StringParam();
++		StringParam(int enum_type,char* value);
++		~StringParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring);
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string);
++		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _STRINGPARAM_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp	(revision 12822)
+@@ -0,0 +1,136 @@
++/*!\file DoubleMatParam.c
++ * \brief: implementation of the DoubleMatParam object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*DoubleMatParam constructors and destructor*/
++/*FUNCTION 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){
++
++	enum_type=in_enum_type;
++	M=in_M;
++	N=in_N;
++
++	value=xNew<IssmDouble>(M*N);
++	xMemCpy<IssmDouble>(value,in_value,M*N);
++}
++/*}}}*/
++/*FUNCTION DoubleMatParam::~DoubleMatParam(){{{*/
++DoubleMatParam::~DoubleMatParam(){
++	xDelete<IssmDouble>(value);
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION DoubleMatParam::Echo {{{*/
++void DoubleMatParam::Echo(void){
++
++	_printLine_("DoubleMatParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   matrix size: " << this->M << "x" << this->N);
++
++}
++/*}}}*/
++/*FUNCTION DoubleMatParam::DeepEcho{{{*/
++void DoubleMatParam::DeepEcho(void){
++
++	int i,j;
++	
++	_printLine_("DoubleMatParam:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   matrix size: " << this->M << "x" << this->N);
++	for(i=0;i<this->M;i++){
++		for(i=0;i<this->N;i++){
++			_printLine_(i << " " << j << " " << *(this->value+N*i+j));
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION DoubleMatParam::Id{{{*/
++int    DoubleMatParam::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION DoubleMatParam::MyRank{{{*/
++int    DoubleMatParam::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION DoubleMatParam::ObjectEnum{{{*/
++int DoubleMatParam::ObjectEnum(void){
++
++	return DoubleMatParamEnum;
++
++}
++/*}}}*/
++/*FUNCTION DoubleMatParam::copy{{{*/
++Object* DoubleMatParam::copy() {
++	
++	return new DoubleMatParam(this->enum_type,this->value,this->M,this->N);
++
++}
++/*}}}*/
++
++/*DoubleMatParam virtual functions definitions: */
++/*FUNCTION 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);
++	xMemCpy<IssmDouble>(output,value,M*N);
++
++	/*Assign output pointers:*/
++	if(pM) *pM=M;
++	if(pN) *pN=N;
++	*pIssmDoublearray=output;
++}
++/*}}}*/
++/*FUNCTION DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{*/
++void  DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){
++	_error2_("DoubleMat of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
++}
++/*}}}*/
++/*FUNCTION DoubleMatParam::GetParameterName{{{*/
++void DoubleMatParam::GetParameterName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION DoubleMatParam::SetValue{{{*/
++void  DoubleMatParam::SetValue(IssmDouble* IssmDoublearray,int in_M,int in_N){
++
++	/*avoid leak: */
++	xDelete<IssmDouble>(this->value);
++
++	this->value=xNew<IssmDouble>(in_M*in_N);
++	xMemCpy<IssmDouble>(this->value,IssmDoublearray,in_M*in_N);
++
++	this->M=in_M;
++	this->N=in_N;
++}
++/*}}}*/
++/*FUNCTION DoubleMatParam::UnitConversion{{{*/
++void  DoubleMatParam::UnitConversion(int direction_enum){
++	::UnitConversion(this->value,this->M*this->N,direction_enum,this->enum_type);
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h	(revision 12822)
+@@ -0,0 +1,80 @@
++/*! \file TransientParam.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _TRANSIENTPARAM_H_
++#define _TRANSIENTPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class TransientParam: public Param{
++
++	protected: 
++		int enum_type;
++		int N;
++		IssmDouble* values;
++		IssmDouble* timesteps;
++
++	public:
++		/*TransientParam constructors, destructors: {{{*/
++		TransientParam();
++		TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,int in_N);
++		~TransientParam();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Param vritual function definitions: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  GetParameterValue(bool* pbool){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time);
++		void  GetParameterValue(char** pstring){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a FILE");}
++
++		void  SetValue(bool boolean){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");}
++		void  SetValue(int* intarray,int M,int N){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int mat array");};
++		void  SetValue(Vector* vec){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  UnitConversion(int direction_enum);
++
++		void GetParameterName(char**pname);
++
++		/*}}}*/
++};
++#endif  /* _TRANSIENTPARAM_H */
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h	(revision 12822)
+@@ -0,0 +1,52 @@
++/*! \file OptionStruct.h 
++ *  \brief: header file for optionstruct object
++ */
++
++#ifndef _OPTIONSTRUCT_H_
++#define _OPTIONSTRUCT_H_
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./Option.h"
++/*}}}*/
++
++class OptionStruct: public Option {
++
++	public:
++
++		Options** values;
++
++		/*OptionStruct constructors, destructors {{{*/
++		OptionStruct();
++		~OptionStruct();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(char* indent);
++		int   Id(){_error2_("Not implemented yet");};
++		int   MyRank(){_error2_("Not implemented yet");};
++		int   ObjectEnum(){return OptionStructEnum;};
++		Object* copy(){_error2_("Not implemented yet");};
++		/*}}}*/
++
++		/*virtual functions: */
++		char* Name();
++		int   NumEl();
++		int   NDims();
++		int*  Size();
++		void  Get(int* pvalue){_error2_("An OptionStruct object cannot return a int");};
++		void  Get(IssmDouble* pvalue){_error2_("An OptionStruct object cannot return a IssmDouble");};
++		void  Get(bool* pvalue){  _error2_("An OptionStruct object cannot return a bool");};
++		void  Get(char** pvalue){ _error2_("An OptionStruct object cannot return a string");};
++		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionStruct object cannot return a string vec");};
++		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionStruct object cannot return a IssmDouble vec");};
++		void  Get(Options** pvalue);
++		void  Get(Options*** ppvalue,int *pnumel);
++
++};
++#endif  /* _OPTIONSTRUCT_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp	(revision 12822)
+@@ -0,0 +1,162 @@
++/*!\file OptionDouble.cpp
++ * \brief: implementation of the optionsIssmDouble object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION OptionDouble::OptionDouble(){{{*/
++OptionDouble::OptionDouble(){
++
++	values    =NULL;
++
++}
++/*}}}*/
++/*FUNCTION OptionDouble::~OptionDouble(){{{*/
++OptionDouble::~OptionDouble(){
++
++	if (values) xDelete<IssmDouble>(values);
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION OptionDouble::Echo {{{*/
++void  OptionDouble::Echo(){
++
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_("OptionDouble Echo:");
++	Option::Echo();
++
++	if (values && size) {
++		if(numel == 1) if(flag) _pprintLine_("        values: " << values[0]);
++		else {
++			StringFromSize(cstr,size,ndims);
++			if(flag) _pprintLine_("        values: " << cstr << " " << "IssmDouble");
++		}
++	}
++	else if(flag) _pprintLine_("        values: [empty]");
++}
++/*}}}*/
++/*FUNCTION OptionDouble::DeepEcho() {{{*/
++void  OptionDouble::DeepEcho(){
++
++	char  indent[81]="";
++
++	OptionDouble::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION OptionDouble::DeepEcho(char* indent) {{{*/
++void  OptionDouble::DeepEcho(char* indent){
++
++	int   i;
++	int*  dims;
++	char  indent2[81];
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "OptionDouble DeepEcho:");
++	Option::DeepEcho(indent);
++
++	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
++	strcat(indent2,"  ");
++
++	if (values) {
++		dims=xNew<int>(ndims);
++		if(numel==1) if(flag) _pprintLine_(indent << "        values: " << values[0]);
++		else{
++			for (i=0; i<numel; i++) {
++				RowWiseDimsFromIndex(dims,i,size,ndims);
++				StringFromDims(cstr,dims,ndims);
++				if(flag) _pprintLine_(indent << "        values" << cstr << ": " << values[i]);
++			}
++		}
++		xDelete<int>(dims);
++	}
++	else if(flag) _pprintLine_(indent << "        values: [empty]");
++}
++/*}}}*/
++/*FUNCTION OptionDouble::Name {{{*/
++char* OptionDouble::Name(){
++
++	return(Option::Name());
++}
++/*}}}*/
++/*FUNCTION OptionDouble::NumEl {{{*/
++int   OptionDouble::NumEl(){
++
++	return(Option::NumEl());
++}
++/*}}}*/
++/*FUNCTION OptionDouble::NDims {{{*/
++int   OptionDouble::NDims(){
++
++	return(Option::NDims());
++}
++/*}}}*/
++/*FUNCTION OptionDouble::Size {{{*/
++int*  OptionDouble::Size(){
++
++	return(Option::Size());
++}
++/*}}}*/
++/*FUNCTION OptionDouble::Get(int* pvalue) {{{*/
++void OptionDouble::Get(int* pvalue){
++
++	/*We should first check that the size is one*/
++	if(this->NumEl()!=1){
++		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single int");
++	}
++
++	/*Assign output pointer*/
++	*pvalue=reCast<int>(values[0]);
++}
++/*}}}*/
++/*FUNCTION OptionDouble::Get(IssmDouble* pvalue) {{{*/
++void OptionDouble::Get(IssmDouble* pvalue){
++
++	/*We should first check that the size is one*/
++	if(this->NumEl()!=1){
++		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single IssmDouble");
++	}
++
++	/*Assign output pointer*/
++	*pvalue=this->values[0];
++}
++/*}}}*/
++/*FUNCTION OptionDouble::Get(IssmDouble** pvalue,int* numel) {{{*/
++void OptionDouble::Get(IssmDouble** pvalue,int* numel){
++
++	/*We should first check that the size is at least one*/
++	if(this->NumEl()<=0){
++		_error2_("option \"" << this->name << "\" is empty and cannot return a IssmDouble vector");
++	}
++
++	/*Copy vector*/
++	IssmDouble* outvalue=xNew<IssmDouble>(this->NumEl());
++	for(int i=0;i<this->NumEl();i++) outvalue[i]=this->values[i];
++
++	/*Assign output pointer*/
++	*pvalue=outvalue;
++	if(numel) *numel=this->NumEl();
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp	(revision 12822)
+@@ -0,0 +1,133 @@
++/*!\file OptionLogical.cpp
++ * \brief: implementation of the optionslogical object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION OptionLogical::OptionLogical(){{{*/
++OptionLogical::OptionLogical(){
++
++	values    =NULL;
++
++}
++/*}}}*/
++/*FUNCTION OptionLogical::~OptionLogical(){{{*/
++OptionLogical::~OptionLogical(){
++
++	if (values) xDelete<bool>(values);
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION OptionLogical::Echo {{{*/
++void  OptionLogical::Echo(){
++
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_("OptionLogical Echo:");
++	Option::Echo();
++
++	if (values && size) {
++		if(numel == 1) if(flag) _pprintLine_("        values: " << (values[0] ? "true" : "false"));
++		else{
++			StringFromSize(cstr,size,ndims);
++			if(flag) _pprintLine_("        values: " << cstr << " " << "logical");
++		}
++	}
++	else if(flag) _pprintLine_("        values: [empty]");
++}
++/*}}}*/
++/*FUNCTION OptionLogical::DeepEcho() {{{*/
++void  OptionLogical::DeepEcho(){
++
++	char  indent[81]="";
++
++	OptionLogical::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION OptionLogical::DeepEcho(char* indent) {{{*/
++void  OptionLogical::DeepEcho(char* indent){
++
++	int   i;
++	int*  dims;
++	char  indent2[81];
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "OptionLogical DeepEcho:");
++	Option::DeepEcho(indent);
++
++	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
++	strcat(indent2,"  ");
++
++	if (values) {
++		if(numel==1) if(flag) _pprintLine_(indent << "        values: " << (values[0] ? "true" : "false"));
++		else{
++			dims=xNew<int>(ndims);
++			for (i=0; i<numel; i++) {
++				RowWiseDimsFromIndex(dims,i,size,ndims);
++				StringFromDims(cstr,dims,ndims);
++				if(flag) _pprintLine_(indent << "        values" << cstr << ": " << (values[i] ? "true" : "false"));
++			}
++			xDelete<int>(dims);
++		}
++	}
++	else if(flag) _pprintLine_(indent << "        values: [empty]");
++}
++/*}}}*/
++/*FUNCTION OptionLogical::Name {{{*/
++char* OptionLogical::Name(){
++
++	return(Option::Name());
++}
++/*}}}*/
++/*FUNCTION OptionLogical::NumEl {{{*/
++int   OptionLogical::NumEl(){
++
++	return(Option::NumEl());
++}
++/*}}}*/
++/*FUNCTION OptionLogical::NDims {{{*/
++int   OptionLogical::NDims(){
++
++	return(Option::NDims());
++}
++/*}}}*/
++/*FUNCTION OptionLogical::Size {{{*/
++int*  OptionLogical::Size(){
++
++	return(Option::Size());
++}
++/*}}}*/
++/*FUNCTION OptionLogical::Get(bool* pvalue) {{{*/
++void OptionLogical::Get(bool* pvalue){
++
++	/*We should first check that the size is one*/
++	if(this->NumEl()!=1){
++		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single bool");
++	}
++
++	/*Assign output pointer*/
++	*pvalue=this->values[0];
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp	(revision 12822)
+@@ -0,0 +1,114 @@
++/*!\file OptionUtilities.cpp
++ * \brief: implementation of the options utilities
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*FUNCTION ColumnWiseDimsFromIndex{{{*/
++int ColumnWiseDimsFromIndex(int* dims,int index,int* size,int ndims){
++
++	int   i;
++	int   aprod=1;
++
++	/*check for index too large  */
++	for (i=0;i<ndims;i++) aprod*=size[i];
++	if (index >= aprod) _error2_("Index " << index << " exceeds number of elements " << aprod << ".");
++
++	/*calculate the dimensions (being careful of integer division)  */
++	for (i=ndims-1; i>=0; i--) {
++		aprod=reCast<int>(((IssmPDouble)aprod+0.5)/(IssmPDouble)size[i]);
++		dims[i]=(int)floor(((IssmPDouble)index+0.5)/(IssmPDouble)aprod);
++		index-=dims[i]*aprod;
++	}
++
++	return(0);
++}/*}}}*/
++/*FUNCTION IndexFromColumnWiseDims{{{*/
++int IndexFromColumnWiseDims(int* dims, int* size, int ndims) {
++
++	int   i;
++	int   index=0;
++
++	/*check for any dimension too large  */
++	for (i=0;i<ndims;i++){
++		if (dims[i] >= size[i]) _error2_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");
++	}
++
++	/*calculate the index  */
++	for (i=ndims-1; i>=0; i--){
++		index*=size[i];
++		index+=dims[i];
++	}
++
++	return(index);
++}/*}}}*/
++/*FUNCTION RowWiseDimsFromIndex{{{*/
++int RowWiseDimsFromIndex(int* dims, int index, int* size, int ndims) {
++
++	int   i;
++	int   aprod=1;
++
++	/*check for index too large  */
++	for (i=0; i<ndims; i++) aprod*=size[i];
++	if (index >= aprod) _error2_("Index " << index << " exceeds number of elements " << aprod << ".");
++
++	/*calculate the dimensions (being careful of integer division)  */
++	for (i=0; i<ndims; i++) {
++		aprod=(int)(((IssmPDouble)aprod+0.5)/(IssmPDouble)size[i]);
++		dims[i]=(int)floor(((IssmPDouble)index+0.5)/(IssmPDouble)aprod);
++		index-=dims[i]*aprod;
++	}
++
++	return(0);
++}/*}}}*/
++/*FUNCTION IndexFromRowWiseDims{{{*/
++int IndexFromRowWiseDims(int* dims, int* size, int ndims) {
++
++	int   i;
++	int   index=0;
++
++	/*check for any dimension too large  */
++	for (i=0; i<ndims; i++){
++		if (dims[i] >= size[i]) _error2_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");
++	}
++
++	/*calculate the index  */
++	for (i=0; i<ndims; i++) {
++		index*=size[i];
++		index+=dims[i];
++	}
++
++	return(index);
++}/*}}}*/
++/*FUNCTION StringFromDims{{{*/
++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]);
++	sprintf(&cstr[strlen(cstr)],"%d]",dims[ndims-1]);
++
++	return(0);
++}/*}}}*/
++/*FUNCTION StringFromSize{{{*/
++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]);
++	sprintf(&cstr[strlen(cstr)],"%d]",size[ndims-1]);
++
++	return(0);
++}/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp	(revision 12822)
+@@ -0,0 +1,176 @@
++/*!\file OptionChar.cpp
++ * \brief: implementation of the optionschar object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION OptionChar::OptionChar(){{{*/
++OptionChar::OptionChar(){
++
++	values    =NULL;
++
++}
++/*}}}*/
++/*FUNCTION OptionChar::~OptionChar(){{{*/
++OptionChar::~OptionChar(){
++
++	if (values) xDelete<char>(values);
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION OptionChar::Echo {{{*/
++void  OptionChar::Echo(){
++
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_("OptionChar Echo:");
++	Option::Echo();
++
++	if (values && size) {
++//		if (numel == 1) {
++		if (1) {
++//			if(flag) _pprintLine_("        values: \"" << values[0] << "\"");
++			if(flag) _pprintLine_("        values: \"" << values << "\"");
++		}
++		else {
++			StringFromSize(cstr,size,ndims);
++			if(flag) _pprintLine_("        values: " << cstr << " " << "char");
++		}
++	}
++	else if(flag) _pprintLine_("        values: [empty]");
++}
++/*}}}*/
++/*FUNCTION OptionChar::DeepEcho() {{{*/
++void  OptionChar::DeepEcho(){
++
++	char  indent[81]="";
++
++	OptionChar::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION OptionChar::DeepEcho(char* indent) {{{*/
++void  OptionChar::DeepEcho(char* indent){
++
++	int   i,nstr,ipt=0;
++	int*  dims;
++	char  indent2[81];
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "OptionChar DeepEcho:");
++	Option::DeepEcho(indent);
++
++	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
++	strcat(indent2,"  ");
++
++	if (values) {
++		if (ndims == 2 && size[0] == 1) {
++			if(flag) _pprintLine_(indent << "        values: \"" << values << "\"");
++		}
++		else {
++			nstr=size[0];
++			for (i=2; i<ndims; i++) nstr*=size[i];
++
++			dims=xNew<int>(ndims);
++			for (i=0; i<nstr; i++) {
++				RowWiseDimsFromIndex(dims,ipt,size,ndims);
++				StringFromDims(cstr,dims,ndims);
++				if(flag) _pprintLine_(indent << "        values" << cstr << ": \"" << size[1] << "*s\"");
++				ipt+=size[1];
++			}
++			xDelete<int>(dims);
++		}
++	}
++	else if(flag) _pprintLine_(indent << "        values: [empty]");
++}
++/*}}}*/
++/*FUNCTION OptionChar::Name {{{*/
++char* OptionChar::Name(){
++
++	return(Option::Name());
++}
++/*}}}*/
++/*FUNCTION OptionChar::NumEl {{{*/
++int   OptionChar::NumEl(){
++
++	return(Option::NumEl());
++}
++/*}}}*/
++/*FUNCTION OptionChar::NDims {{{*/
++int   OptionChar::NDims(){
++
++	return(Option::NDims());
++}
++/*}}}*/
++/*FUNCTION OptionChar::Size {{{*/
++int*  OptionChar::Size(){
++
++	return(Option::Size());
++}
++/*}}}*/
++/*FUNCTION OptionChar::Get(char** pvalue) {{{*/
++void OptionChar::Get(char** pvalue){
++
++	char* outstring=NULL;
++	int   stringsize;
++
++	stringsize=strlen(this->values)+1;
++
++	outstring=xNew<char>(stringsize);
++	xMemCpy<char>(outstring,this->values,stringsize);
++
++	*pvalue=outstring;
++}
++/*}}}*/
++/*FUNCTION OptionChar::Get(char*** ppvalue,int *pnumel) {{{*/
++void OptionChar::Get(char*** ppvalue,int *pnumel){
++
++	char* outstring=NULL;
++	int   stringsize;
++	int   i,nstr,ipt=0;
++
++	/*We should first check that the size is at least one*/
++	if(this->NumEl()<=0){
++		_error2_("option \"" << this->name << "\" is empty and cannot return a string vector");
++	}
++
++	/*Calculate the size and number of strings*/
++	stringsize=this->size[1]+1;
++	nstr=this->size[0];
++	for (i=2; i<this->ndims; i++) nstr*=this->size[i];
++
++	/*Break concatenated string into individual strings*/
++	*ppvalue=xNew<char*>(nstr);
++	for (i=0; i<nstr; i++) {
++		outstring=xNew<char>(stringsize);
++		xMemCpy<char>(outstring,&(this->values[ipt]),(stringsize-1));
++		outstring[stringsize-1]='\0';
++		(*ppvalue)[i]=outstring;
++		ipt+=stringsize-1;
++	}
++
++	/*Assign output pointer*/
++	if(numel) *pnumel=nstr;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.cpp	(revision 12822)
+@@ -0,0 +1,116 @@
++/*!\file Option.cpp
++ * \brief: implementation of the optionsobject abstract object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../io/io.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION Option::Option(){{{*/
++Option::Option(){
++
++	name  =NULL;
++	numel =0;
++	ndims =0;
++	size  =NULL;
++
++}
++/*}}}*/
++/*FUNCTION Option::~Option(){{{*/
++Option::~Option(){
++
++	if(size) xDelete<int>(size);
++	if(name) xDelete<char>(name);
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION Option::Echo {{{*/
++void  Option::Echo(){
++
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_("          name: \"" << name << "\"");
++	if(flag) _pprintLine_("         numel: " << numel);
++	if(flag) _pprintLine_("         ndims: " << ndims);
++	if(size){
++		StringFromSize(cstr,size,ndims);
++		if(flag) _pprintLine_("          size: " << cstr);
++	}
++	else if(flag) _pprintLine_("          size: [empty]");
++}
++/*}}}*/
++/*FUNCTION Option::DeepEcho() {{{*/
++void  Option::DeepEcho(){
++
++	char  indent[81]="";
++
++	Option::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION Option::DeepEcho(char* indent) {{{*/
++void  Option::DeepEcho(char* indent){
++
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "          name: \"" << name << "\"");
++	if(flag) _pprintLine_(indent << "         numel: " << numel);
++	if(flag) _pprintLine_(indent << "         ndims: " << ndims);
++	if(size){
++		StringFromSize(cstr,size,ndims);
++		if(flag) _pprintLine_(indent << "          size: " << cstr);
++	}
++	else if(flag) _pprintLine_(indent << "          size: [empty]");
++}
++/*}}}*/
++/*FUNCTION Option::Name {{{*/
++char* Option::Name(){
++
++	return(name);
++}
++/*}}}*/
++/*FUNCTION Option::NumEl {{{*/
++int   Option::NumEl(){
++
++	return(numel);
++}
++/*}}}*/
++/*FUNCTION Option::NDims {{{*/
++int   Option::NDims(){
++
++	return(ndims);
++}
++/*}}}*/
++/*FUNCTION Option::Size {{{*/
++int*  Option::Size(){
++
++	return(size);
++}
++/*}}}*/
++/*FUNCTION Option::Get {{{*/
++//void* Option::Get(){
++
++//	;
++
++//	return;
++//}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp	(revision 12822)
+@@ -0,0 +1,127 @@
++/*!\file OptionCell.cpp
++ * \brief: implementation of the optionscell object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION OptionCell::OptionCell(){{{*/
++OptionCell::OptionCell(){
++
++	values    =NULL;
++
++}
++/*}}}*/
++/*FUNCTION OptionCell::~OptionCell(){{{*/
++OptionCell::~OptionCell(){
++
++	if (values){
++		delete values;
++		values    =NULL;
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION OptionCell::Echo {{{*/
++void  OptionCell::Echo(){
++
++	char cstr[81];
++	bool flag     = true;
++
++	if(flag) _pprintLine_("OptionCell Echo:");
++	Option::Echo();
++
++	if (values && size) {
++		StringFromSize(cstr,size,ndims);
++		if(flag) _pprintLine_("        values: " << cstr << " " << "cell");
++	}
++	else if(flag) _pprintLine_("        values: [empty]");
++}
++/*}}}*/
++/*FUNCTION OptionCell::DeepEcho() {{{*/
++void  OptionCell::DeepEcho(){
++
++	char  indent[81]="";
++
++	OptionCell::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION OptionCell::DeepEcho(char* indent) {{{*/
++void  OptionCell::DeepEcho(char* indent){
++
++	int   i;
++	int*  dims;
++	char  indent2[81];
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "OptionCell DeepEcho:");
++	Option::DeepEcho(indent);
++
++	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
++	strcat(indent2,"  ");
++
++	if (values->Size()) {
++		dims=xNew<int>(ndims);
++		for (i=0; i<values->Size(); i++) {
++			ColumnWiseDimsFromIndex(dims,i,size,ndims);
++			StringFromDims(cstr,dims,ndims);
++			if(flag) _pprintLine_(indent << "        values: -------- begin " << cstr << " --------");
++			((Option *)values->GetObjectByOffset(i))->DeepEcho(indent2);
++			if(flag) _pprintLine_(indent << "        values: --------  end  " << cstr << " --------");
++		}
++		xDelete<int>(dims);
++	}
++	else if(flag) _pprintLine_(indent << "        values: [empty]");
++}
++/*}}}*/
++/*FUNCTION OptionCell::Name {{{*/
++char* OptionCell::Name(){
++
++	return(Option::Name());
++}
++/*}}}*/
++/*FUNCTION OptionCell::NumEl {{{*/
++int   OptionCell::NumEl(){
++
++	return(Option::NumEl());
++}
++/*}}}*/
++/*FUNCTION OptionCell::NDims {{{*/
++int   OptionCell::NDims(){
++
++	return(Option::NDims());
++}
++/*}}}*/
++/*FUNCTION OptionCell::Size {{{*/
++int*  OptionCell::Size(){
++
++	return(Option::Size());
++}
++/*}}}*/
++/*FUNCTION OptionCell::Get(Options** pvalue) {{{*/
++void OptionCell::Get(Options** pvalue){
++
++	/*Assign output pointer*/
++	*pvalue=this->values;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h	(revision 12822)
+@@ -0,0 +1,52 @@
++/*! \file OptionDouble.h 
++ *  \brief: header file for optionIssmDouble object
++ */
++
++#ifndef _OPTIONDOUBLE_H_
++#define _OPTIONDOUBLE_H_
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./Option.h"
++/*}}}*/
++
++class OptionDouble: public Option {
++
++	public:
++
++		IssmDouble* values;
++
++		/*OptionDouble constructors, destructors {{{*/
++		OptionDouble();
++		~OptionDouble();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(char* indent);
++		int   Id(){_error2_("Not implemented yet");};
++		int   MyRank(){_error2_("Not implemented yet");};
++		int   ObjectEnum(){return OptionDoubleEnum;};
++		Object* copy(){_error2_("Not implemented yet");};
++		/*}}}*/
++
++		/*virtual functions: */
++		char* Name();
++		int   NumEl();
++		int   NDims();
++		int*  Size();
++		void  Get(int* pvalue);
++		void  Get(IssmDouble* pvalue);
++		void  Get(bool* pvalue){  _error2_("An OptionDouble object cannot return a bool");};
++		void  Get(char** pvalue){ _error2_("An OptionDouble object cannot return a string");};
++		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionDouble object cannot return a string vec");};
++		void  Get(IssmDouble** pvalue,int* pnumel);
++		void  Get(Options** pvalue){ _error2_("An OptionDouble object cannot return an Options DataSet");};
++		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionDouble object cannot return an Options DataSet vec");};
++
++};
++#endif  /* _OPTIONDOUBLE_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h	(revision 12822)
+@@ -0,0 +1,52 @@
++/*! \file OptionLogical.h 
++ *  \brief: header file for optionlogical object
++ */
++
++#ifndef _OPTIONLOGICAL_H_
++#define _OPTIONLOGICAL_H_
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./Option.h"
++/*}}}*/
++
++class OptionLogical: public Option {
++
++	public:
++
++		bool* values;
++
++		/*OptionLogical constructors, destructors {{{*/
++		OptionLogical();
++		~OptionLogical();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(char* indent);
++		int   Id(){_error2_("Not implemented yet");};
++		int   MyRank(){_error2_("Not implemented yet");};
++		int   ObjectEnum(){return OptionLogicalEnum;};
++		Object* copy(){_error2_("Not implemented yet");};
++		/*}}}*/
++
++		/*virtual functions: */
++		char* Name();
++		int   NumEl();
++		int   NDims();
++		int*  Size();
++		void  Get(int* pvalue){_error2_("An OptionLogical object cannot return a int");};
++		void  Get(IssmDouble* pvalue){_error2_("An OptionLogical object cannot return a IssmDouble");};
++		void  Get(bool* pvalue);
++		void  Get(char** pvalue){ _error2_("An OptionLogical object cannot return a string");};
++		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionLogical object cannot return a string vec");};
++		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionLogical object cannot return a IssmDouble vec");};
++		void  Get(Options** pvalue){ _error2_("An OptionLogical object cannot return an Options DataSet");};
++		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionLogical object cannot return an Options DataSet vec");};
++
++};
++#endif  /* _OPTIONLOGICAL_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.h	(revision 12822)
+@@ -0,0 +1,24 @@
++/*! \file OptionUtilities.h 
++ *  \brief: header file for option object utilities
++ */
++
++#ifndef _OPTIONUTILITIES_H_
++#define _OPTIONUTILITIES_H_
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./Option.h"
++/*}}}*/
++
++int ColumnWiseDimsFromIndex(int* dims, int index, int* size, int ndims);
++int IndexFromColumnWiseDims(int* dims, int* size, int ndims);
++int RowWiseDimsFromIndex(int* dims, int index, int* size, int ndims);
++int IndexFromRowWiseDims(int* dims, int* size, int ndims);
++int StringFromDims(char* cstr, int* dims, int ndims);
++int StringFromSize(char* cstr, int* size, int ndims);
++
++#endif  /* _OPTIONUTILITIES_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h	(revision 12822)
+@@ -0,0 +1,52 @@
++/*! \file OptionChar.h 
++ *  \brief: header file for optionchar object
++ */
++
++#ifndef _OPTIONCHAR_H_
++#define _OPTIONCHAR_H_
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./Option.h"
++/*}}}*/
++
++class OptionChar: public Option {
++
++	public:
++
++		char* values;
++
++		/*OptionChar constructors, destructors {{{*/
++		OptionChar();
++		~OptionChar();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(char* indent);
++		int   Id(){_error2_("Not implemented yet");};
++		int   MyRank(){_error2_("Not implemented yet");};
++		int   ObjectEnum(){return OptionCharEnum;};
++		Object* copy(){_error2_("Not implemented yet");};
++		/*}}}*/
++
++		/*virtual functions: */
++		char* Name();
++		int   NumEl();
++		int   NDims();
++		int*  Size();
++		void  Get(int* pvalue){_error2_("An OptionChar object cannot return a int");};
++		void  Get(IssmDouble* pvalue){_error2_("An OptionChar object cannot return a IssmDouble");};
++		void  Get(bool* pvalue){  _error2_("An OptionChar object cannot return a bool");};
++		void  Get(char** pvalue);
++		void  Get(char*** ppvalue,int *pnumel);
++		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionChar object cannot return a IssmDouble vec");};
++		void  Get(Options** pvalue){ _error2_("An OptionChar object cannot return an Options DataSet");};
++		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionChar object cannot return an Options DataSet vec");};
++
++};
++#endif  /* _OPTIONCHAR_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h	(revision 12822)
+@@ -0,0 +1,55 @@
++/*! \file Option.h 
++ *  \brief: header file for option abstract object
++ */
++
++#ifndef _OPTIONOBJECT_H_
++#define _OPTIONOBJECT_H_
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "../Object.h"
++/*}}}*/
++
++class Option: public Object {
++
++	public:
++
++		char* name;
++		int   numel;
++		int   ndims;
++		int*  size;
++
++		/*Option constructors, destructors {{{*/
++		Option();
++		~Option();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		virtual void  Echo();
++		virtual void  DeepEcho();
++		virtual void  DeepEcho(char* indent);
++		int   Id(){_error2_("Not implemented yet");};
++		int   MyRank(){_error2_("Not implemented yet");};
++		int   ObjectEnum(){return OptionEnum;};
++		Object* copy(){_error2_("Not implemented yet");};
++		/*}}}*/
++
++		/*virtual functions: */
++		virtual char* Name()=0;
++		virtual int   NumEl()=0;
++		virtual int   NDims()=0;
++		virtual int*  Size()=0;
++		virtual void  Get(int* pvalue)=0;
++		virtual void  Get(IssmDouble* pvalue)=0;
++		virtual void  Get(bool* pvalue)=0;
++		virtual void  Get(char** pvalue)=0;
++		virtual void  Get(char*** ppvalue,int *pnumel)=0;
++		virtual void  Get(IssmDouble** pvalue,int *pnumel)=0;
++		virtual void  Get(Options** pvalue)=0;
++		virtual void  Get(Options*** ppvalue,int *pnumel)=0;
++
++};
++#endif  /* _OPTIONOBJECT_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h	(revision 12822)
+@@ -0,0 +1,52 @@
++/*! \file OptionCell.h 
++ *  \brief: header file for optioncell object
++ */
++
++#ifndef _OPTIONCELL_H_
++#define _OPTIONCELL_H_
++
++/*Headers:{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++#include "./Option.h"
++/*}}}*/
++
++class OptionCell: public Option {
++
++	public:
++
++		Options* values;
++
++		/*OptionCell constructors, destructors {{{*/
++		OptionCell();
++		~OptionCell();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{*/
++		void  Echo();
++		void  DeepEcho();
++		void  DeepEcho(char* indent);
++		int   Id(){_error2_("Not implemented yet");};
++		int   MyRank(){_error2_("Not implemented yet");};
++		int   ObjectEnum(){return OptionCellEnum;};
++		Object* copy(){_error2_("Not implemented yet");};
++		/*}}}*/
++
++		/*virtual functions: */
++		char* Name();
++		int   NumEl();
++		int   NDims();
++		int*  Size();
++		void  Get(int* pvalue){_error2_("An OptionCell object cannot return a int");};
++		void  Get(IssmDouble* pvalue){_error2_("An OptionCell object cannot return a IssmDouble");};
++		void  Get(bool* pvalue){  _error2_("An OptionCell object cannot return a bool");};
++		void  Get(char** pvalue){ _error2_("An OptionCell object cannot return a string");};
++		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionCell object cannot return a string vec");};
++		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionCell object cannot return a IssmDouble vec");};
++		void  Get(Options** pvalue);
++		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionCell object cannot return an Options DataSet vec");};
++
++};
++#endif  /* _OPTIONCELL_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp	(revision 12822)
+@@ -0,0 +1,153 @@
++/*!\file OptionStruct.cpp
++ * \brief: implementation of the optionsstruct object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../io/io.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Constructors/destructor/copy*/
++/*FUNCTION OptionStruct::OptionStruct(){{{*/
++OptionStruct::OptionStruct(){
++
++	values    =NULL;
++
++}
++/*}}}*/
++/*FUNCTION OptionStruct::~OptionStruct(){{{*/
++OptionStruct::~OptionStruct(){
++
++	int   i;
++
++	if(values){
++		for(i=0; i<numel; i++) {
++			delete values[i];
++			values[i] =NULL;
++		}
++		xDelete<Options*>(values);
++	}
++
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION OptionStruct::Echo {{{*/
++void  OptionStruct::Echo(){
++
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_("OptionStruct Echo:");
++	Option::Echo();
++
++	if (values && size) {
++		StringFromSize(cstr,size,ndims);
++		if(flag) _pprintLine_("        values: " << cstr << " " << "struct");
++	}
++	else if(flag) _pprintLine_("        values: [empty]");
++}
++/*}}}*/
++/*FUNCTION OptionStruct::DeepEcho() {{{*/
++void  OptionStruct::DeepEcho(){
++
++	char  indent[81]="";
++
++	OptionStruct::DeepEcho(indent);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION OptionStruct::DeepEcho(char* indent) {{{*/
++void  OptionStruct::DeepEcho(char* indent){
++
++	int   i,j;
++	int*  dims;
++	char  indent2[81];
++	char  cstr[81];
++	bool  flag=true;
++
++	if(flag) _pprintLine_(indent << "OptionStruct DeepEcho:");
++	Option::DeepEcho(indent);
++
++	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
++	strcat(indent2,"  ");
++
++	if (values) {
++		dims=xNew<int>(ndims);
++		for (i=0; i<numel; i++) {
++			ColumnWiseDimsFromIndex(dims,i,size,ndims);
++			StringFromDims(cstr,dims,ndims);
++			if (values[i]->Size()){
++				if(flag) _pprintLine_(indent << "        values: -------- begin " << cstr << " --------");
++				for (j=0; j<values[i]->Size(); j++) ((Option *)values[i]->GetObjectByOffset(j))->DeepEcho(indent2);
++				if(flag) _pprintLine_(indent << "        values: --------  end  " << cstr << " --------");
++			}
++			else if(flag) _pprintLine_(indent << "        values: " << cstr << " [empty]");
++		}
++		xDelete<int>(dims);
++	}
++	else if(flag) _pprintLine_(indent << "        values: [empty]");
++}
++/*}}}*/
++/*FUNCTION OptionStruct::Name {{{*/
++char* OptionStruct::Name(){
++
++	return(Option::Name());
++}
++/*}}}*/
++/*FUNCTION OptionStruct::NumEl {{{*/
++int   OptionStruct::NumEl(){
++
++	return(Option::NumEl());
++}
++/*}}}*/
++/*FUNCTION OptionStruct::NDims {{{*/
++int   OptionStruct::NDims(){
++
++	return(Option::NDims());
++}
++/*}}}*/
++/*FUNCTION OptionStruct::Size {{{*/
++int*  OptionStruct::Size(){
++
++	return(Option::Size());
++}
++/*}}}*/
++/*FUNCTION OptionStruct::Get(Options** pvalue) {{{*/
++void OptionStruct::Get(Options** pvalue){
++
++	/*We should first check that the size is one*/
++	if(this->NumEl()!=1){
++		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single options dataset");
++	}
++
++	/*Assign output pointer*/
++	*pvalue=this->values[0];
++}
++/*}}}*/
++/*FUNCTION OptionStruct::Get(Options*** ppvalue,int* numel) {{{*/
++void OptionStruct::Get(Options*** ppvalue,int* numel){
++
++	/*We should first check that the size is at least one*/
++	if(this->NumEl()<=0){
++		_error2_("option \"" << this->name << "\" is empty and cannot return an options dataset vector");
++	}
++
++	/*Assign output pointer*/
++	*ppvalue=this->values;
++	if(numel) *numel=this->NumEl();
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.h	(revision 12822)
+@@ -0,0 +1,98 @@
++/*!\file Icefront.h
++ * \brief: header file for icefront object
++ */
++
++#ifndef _ICEFRONT_H_
++#define _ICEFRONT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Load.h"
++class Hook;
++class Inputs;
++class Parameters;
++class Matpar;
++class Node;
++class Element;
++class IoModel;
++class ElementVector;
++/*}}}*/
++
++class Icefront: public Load {
++
++	public:
++		int id;
++		int analysis_type;
++
++		/*hooks: */
++		Hook* hnodes;
++		Hook* helement;
++		Hook* hmatpar;
++
++		/*Corresponding fields*/
++		Matpar   *matpar;
++		Node    **nodes;
++		Element  *element;
++
++		/*inputs and parameters: */
++		Inputs* inputs;
++		Parameters* parameters;
++
++		/*Icefront constructors, destructors: {{{*/
++		Icefront();
++		Icefront(int icefront_id,int i, IoModel* iomodel,int in_icefront_type, int analysis_type);
++		~Icefront();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Update virtual functions definitions: {{{*/
++		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVector(int* vector, int name, int type);
++		void  InputUpdateFromVector(bool* vector, int name, int type);
++		void  InputUpdateFromMatrixDakota(IssmDouble* matrix,int ncols,int nrows, int name, int type);
++		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
++		void  InputUpdateFromConstant(IssmDouble constant, int name);
++		void  InputUpdateFromConstant(int constant, int name);
++		void  InputUpdateFromConstant(bool constant, int name);
++		void  InputUpdateFromSolution(IssmDouble* solution);
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		/*}}}*/
++		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
++		void  CreatePVector(Vector* pf);
++		void  CreateJacobianMatrix(Matrix* Jff);
++		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
++		void  PenaltyCreatePVector(Vector*  pf, IssmDouble kmax);
++		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax);
++		bool  InAnalysis(int analysis_type);
++		/*}}}*/
++		/*Load management: {{{*/
++		void GetDofList(int** pdoflist,int approximation_enum,int setenum);
++		void GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[2][3]);
++		void GetQuadNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]);
++		#ifdef _HAVE_CONTROL_
++		ElementVector* CreatePVectorAdjointHoriz(void);
++		#endif
++		#ifdef _HAVE_DIAGNOSTIC_
++		ElementVector* CreatePVectorDiagnosticHoriz(void);
++		ElementVector* CreatePVectorDiagnosticMacAyeal2d(void);
++		#endif
++        #ifdef _HAVE_3D_
++		ElementVector* CreatePVectorDiagnosticMacAyeal3d(void);
++		ElementVector* CreatePVectorDiagnosticPattyn(void);
++		ElementVector* CreatePVectorDiagnosticStokes(void);
++	    #endif
++		/*}}}*/
++};
++
++#endif  /* _ICEFRONT_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp	(revision 12822)
+@@ -0,0 +1,880 @@
++/*!\file Numericalflux.c
++ * \brief: implementation of the Numericalflux object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../objects.h"
++/*}}}*/	
++
++/*Load macros*/
++#define NUMVERTICES_INTERNAL 4
++#define NUMVERTICES_BOUNDARY 2
++
++/*Numericalflux constructors and destructor*/
++/*FUNCTION Numericalflux::Numericalflux(){{{*/
++Numericalflux::Numericalflux(){
++	this->inputs=NULL;
++	this->parameters=NULL;
++	this->helement=NULL;
++	this->element=NULL;
++	this->hnodes=NULL;
++	this->nodes=NULL;
++}
++/*}}}*/
++/*}}}*//*FUNCTION Numericalflux::Numericalflux(int id, int i, IoModel* iomodel, int analysis_type) {{{*/
++Numericalflux::Numericalflux(int numericalflux_id,int i, IoModel* iomodel, int in_analysis_type){
++
++	/* Intermediary */
++	int  e1,e2;
++	int  i1,i2;
++	int  j;
++	int  pos1,pos2,pos3,pos4;
++	int  num_nodes;
++	int  num_elems;
++
++	/*numericalflux constructor data: */
++	int   numericalflux_elem_ids[2];
++	int   numericalflux_mparid;
++	int   numericalflux_node_ids[4];
++	int   numericalflux_type;
++
++	int    numberofelements;
++
++	/*Fetch parameters: */
++	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
++
++	/* Get MatPar id */
++	numericalflux_mparid=numberofelements+1; //matlab indexing
++
++	/*First, see wether this is an internal or boundary edge (if e2=-1)*/
++	if (iomodel->Data(MeshEdgesEnum)[4*i+3]==-1.){ //edges are [node1 node2 elem1 elem2]
++		/* Boundary edge, only one element */
++		e1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+2]);
++		e2=reCast<int>(UNDEF);
++		num_elems=1;
++		num_nodes=2;
++		numericalflux_type=BoundaryEnum;
++		numericalflux_elem_ids[0]=e1;
++	}
++	else{
++		/* internal edge: connected to 2 elements */
++		e1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+2]);
++		e2=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+3]);
++		num_elems=2;
++		num_nodes=4;
++		numericalflux_type=InternalEnum;
++		numericalflux_elem_ids[0]=e1;
++		numericalflux_elem_ids[1]=e2;
++	}
++
++	/*1: Get vertices ids*/
++	i1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+0]);
++	i2=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+1]);
++
++	if (numericalflux_type==InternalEnum){
++
++		/*Now, we must get the nodes of the 4 nodes located on the edge*/
++
++		/*2: Get the column where these ids are located in the index*/
++		pos1=pos2=pos3=pos4=UNDEF;
++		for(j=0;j<3;j++){
++			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
++			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
++			if (iomodel->Data(MeshElementsEnum)[3*(e2-1)+j]==i1) pos3=j+1;
++			if (iomodel->Data(MeshElementsEnum)[3*(e2-1)+j]==i2) pos4=j+1;
++		}
++		_assert_(pos1!=UNDEF && pos2!=UNDEF && pos3!=UNDEF && pos4!=UNDEF);
++
++		/*3: We have the id of the elements and the position of the vertices in the index
++		 * we can compute their dofs!*/
++		numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;
++		numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+pos2;
++		numericalflux_node_ids[2]=iomodel->nodecounter+3*(e2-1)+pos3;
++		numericalflux_node_ids[3]=iomodel->nodecounter+3*(e2-1)+pos4;
++	}
++	else{
++
++		/*2: Get the column where these ids are located in the index*/
++		pos1=pos2=UNDEF;
++		for(j=0;j<3;j++){
++			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
++			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
++		}
++		_assert_(pos1!=UNDEF && pos2!=UNDEF);
++
++		/*3: We have the id of the elements and the position of the vertices in the index
++		 * we can compute their dofs!*/
++		numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;
++		numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+pos2;
++	}
++
++	/*Ok, we have everything to build the object: */
++	this->id=numericalflux_id;
++	this->analysis_type=in_analysis_type;
++
++	/*Hooks: */
++	this->hnodes  =new Hook(numericalflux_node_ids,num_nodes);
++	this->helement=new Hook(numericalflux_elem_ids,1); // take only the first element for now
++
++	//intialize  and add as many inputs per element as requested: 
++	this->inputs=new Inputs();
++	this->inputs->AddInput(new IntInput(TypeEnum,numericalflux_type));
++
++	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
++	this->parameters=NULL;
++	this->element=NULL;
++	this->nodes=NULL;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::~Numericalflux(){{{*/
++Numericalflux::~Numericalflux(){
++	delete inputs;
++	this->parameters=NULL;
++	delete helement;
++	delete hnodes;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Numericalflux::Echo {{{*/
++void Numericalflux::Echo(void){
++	_printLine_("Numericalflux:");
++	_printLine_("   id: " << id);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	hnodes->Echo();
++	helement->Echo();
++	_printLine_("   parameters: " << parameters);
++	_printLine_("   inputs: " << inputs);
++}
++/*}}}*/
++/*FUNCTION Numericalflux::DeepEcho {{{*/
++void Numericalflux::DeepEcho(void){
++
++	_printLine_("Numericalflux:");
++	_printLine_("   id: " << id);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	hnodes->DeepEcho();
++	helement->DeepEcho();
++	_printLine_("   parameters");
++	if(parameters)
++	 parameters->DeepEcho();
++	else
++	 _printLine_("      NULL");
++	_printLine_("   inputs");
++	inputs->DeepEcho();
++	
++}		
++/*}}}*/
++/*FUNCTION Numericalflux::Id {{{*/
++int    Numericalflux::Id(void){
++	return id;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::MyRank {{{*/
++int    Numericalflux::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Numericalflux::ObjectEnum{{{*/
++int Numericalflux::ObjectEnum(void){
++
++	return NumericalfluxEnum;
++
++}
++/*}}}*/
++/*FUNCTION Numericalflux::copy {{{*/
++Object* Numericalflux::copy() {
++	
++	Numericalflux* numericalflux=NULL;
++
++	numericalflux=new Numericalflux();
++
++	/*copy fields: */
++	numericalflux->id=this->id;
++	numericalflux->analysis_type=this->analysis_type;
++	if(this->inputs){
++		numericalflux->inputs=(Inputs*)this->inputs->Copy();
++	}
++	else{
++		numericalflux->inputs=new Inputs();
++	}
++	/*point parameters: */
++	numericalflux->parameters=this->parameters;
++
++	/*now deal with hooks and objects: */
++	numericalflux->hnodes=(Hook*)this->hnodes->copy();
++	numericalflux->helement=(Hook*)this->helement->copy();
++
++	/*corresponding fields*/
++	numericalflux->nodes  =(Node**)numericalflux->hnodes->deliverp();
++	numericalflux->element=(Element*)numericalflux->helement->delivers();
++
++	return numericalflux;
++}
++/*}}}*/
++
++/*Load virtual functions definitions:*/
++/*FUNCTION Numericalflux::Configure {{{*/
++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: */
++	hnodes->configure(nodesin);
++	helement->configure(elementsin);
++
++	/*Initialize hooked fields*/
++	this->nodes  =(Node**)hnodes->deliverp();
++	this->element=(Element*)helement->delivers();
++
++	/*point parameters to real dataset: */
++	this->parameters=parametersin;
++
++}
++/*}}}*/
++/*FUNCTION Numericalflux::SetCurrentConfiguration {{{*/
++void  Numericalflux::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreateKMatrix {{{*/
++void  Numericalflux::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
++
++	/*recover some parameters*/
++	ElementMatrix* Ke=NULL;
++	int analysis_type;
++	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++		case PrognosticAnalysisEnum:
++			Ke=CreateKMatrixPrognostic();
++			break;
++		case BalancethicknessAnalysisEnum:
++			Ke=CreateKMatrixBalancethickness();
++			break;
++		case AdjointBalancethicknessAnalysisEnum:
++			Ke=CreateKMatrixAdjointBalancethickness();
++			break;
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global matrix*/
++	if(Ke){
++		Ke->AddToGlobal(Kff,Kfs);
++		delete Ke;
++	}
++
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreatePVector {{{*/
++void  Numericalflux::CreatePVector(Vector* pf){
++
++	/*recover some parameters*/
++	ElementVector* pe=NULL;
++	int analysis_type;
++	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	switch(analysis_type){
++		case PrognosticAnalysisEnum:
++			pe=CreatePVectorPrognostic();
++			break;
++		case BalancethicknessAnalysisEnum:
++			pe=CreatePVectorBalancethickness();
++			break;
++		case AdjointBalancethicknessAnalysisEnum:
++			pe=CreatePVectorAdjointBalancethickness();
++			break;
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global matrix*/
++	if(pe){
++		pe->AddToGlobal(pf);
++		delete pe;
++	}
++
++}
++/*}}}*/
++/*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{*/
++void  Numericalflux::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
++
++	/*No stiffness loads applied, do nothing: */
++	return;
++
++}
++/*}}}*/
++/*FUNCTION Numericalflux::PenaltyCreatePVector{{{*/
++void  Numericalflux::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
++
++	/*No penalty loads applied, do nothing: */
++	return;
++
++}
++/*}}}*/
++/*FUNCTION Numericalflux::InAnalysis{{{*/
++bool Numericalflux::InAnalysis(int in_analysis_type){
++	if (in_analysis_type==this->analysis_type) return true;
++	else return false;
++}
++/*}}}*/
++
++/*Numericalflux management*/
++/*FUNCTION Numericalflux::CreateKMatrixPrognostic{{{*/
++ElementMatrix* Numericalflux::CreateKMatrixPrognostic(void){
++
++	int type;
++	inputs->GetInputValue(&type,TypeEnum);
++
++	switch(type){
++		case InternalEnum:
++			return CreateKMatrixPrognosticInternal();
++		case BoundaryEnum:
++			return CreateKMatrixPrognosticBoundary();
++		default:
++			_error2_("type not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreateKMatrixPrognosticInternal {{{*/
++ElementMatrix* Numericalflux::CreateKMatrixPrognosticInternal(void){
++
++	/* constants*/
++	const int numdof=NDOF1*NUMVERTICES_INTERNAL;
++
++	/* Intermediaries*/
++	int        i,j,ig,index1,index2;
++	IssmDouble     DL1,DL2,Jdet,dt,vx,vy,UdotN;
++	IssmDouble     xyz_list[NUMVERTICES_INTERNAL][3];
++	IssmDouble     normal[2];
++	IssmDouble     B[numdof];
++	IssmDouble     Bprime[numdof];
++	IssmDouble     Ke_g1[numdof][numdof];
++	IssmDouble     Ke_g2[numdof][numdof];
++	GaussTria *gauss;
++
++	/*Initialize Element matrix and return if necessary*/
++	Tria*  tria=(Tria*)element;
++	if(tria->IsOnWater()) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES_INTERNAL,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes,NUMVERTICES_INTERNAL);
++	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	Input* vxaverage_input=tria->inputs->GetInput(VxEnum);
++	Input* vyaverage_input=tria->inputs->GetInput(VyEnum);
++	GetNormal(&normal[0],xyz_list);
++
++	/* Start  looping on the number of gaussian points: */
++	index1=tria->GetNodeIndex(nodes[0]);
++	index2=tria->GetNodeIndex(nodes[1]);
++	gauss=new GaussTria(index1,index2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		tria->GetSegmentBFlux(&B[0],gauss,index1,index2);
++		tria->GetSegmentBprimeFlux(&Bprime[0],gauss,index1,index2);
++
++		vxaverage_input->GetInputValue(&vx,gauss);
++		vyaverage_input->GetInputValue(&vy,gauss);
++		UdotN=vx*normal[0]+vy*normal[1];
++		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
++		DL1=gauss->weight*Jdet*dt*UdotN/2;
++		DL2=gauss->weight*Jdet*dt*fabs(UdotN)/2;
++
++		TripleMultiply(&B[0],1,numdof,1,
++					&DL1,1,1,0,
++					&Bprime[0],1,numdof,0,
++					&Ke_g1[0][0],0);
++		TripleMultiply(&B[0],1,numdof,1,
++					&DL2,1,1,0,
++					&B[0],1,numdof,0,
++					&Ke_g2[0][0],0);
++
++		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g1[i][j];
++		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g2[i][j];
++	}
++	
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreateKMatrixPrognosticBoundary {{{*/
++ElementMatrix* Numericalflux::CreateKMatrixPrognosticBoundary(void){
++
++	/* constants*/
++	const int numdof=NDOF1*NUMVERTICES_BOUNDARY;
++
++	/* Intermediaries*/
++	int        i,j,ig,index1,index2;
++	IssmDouble     DL,Jdet,dt,vx,vy,mean_vx,mean_vy,UdotN;
++	IssmDouble     xyz_list[NUMVERTICES_BOUNDARY][3];
++	IssmDouble     normal[2];
++	IssmDouble     L[numdof];
++	IssmDouble     Ke_g[numdof][numdof];
++	GaussTria *gauss;
++
++	/*Initialize Element matrix and return if necessary*/
++	ElementMatrix* Ke = NULL;
++	Tria*  tria=(Tria*)element;
++	if(tria->IsOnWater()) return NULL;
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES_BOUNDARY);
++	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	Input* vxaverage_input=tria->inputs->GetInput(VxEnum); _assert_(vxaverage_input);
++	Input* vyaverage_input=tria->inputs->GetInput(VyEnum); _assert_(vyaverage_input);
++	GetNormal(&normal[0],xyz_list);
++
++	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
++	index1=tria->GetNodeIndex(nodes[0]);
++	index2=tria->GetNodeIndex(nodes[1]);
++
++	gauss=new GaussTria();
++	gauss->GaussEdgeCenter(index1,index2);
++	vxaverage_input->GetInputValue(&mean_vx,gauss);
++	vyaverage_input->GetInputValue(&mean_vy,gauss);
++	delete gauss;
++
++	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
++	if (UdotN<=0){
++		return NULL; /*(u,n)<0 -> inflow, PenaltyCreatePVector will take care of it*/
++	}
++	else{
++		Ke=new ElementMatrix(nodes,NUMVERTICES_BOUNDARY,this->parameters);
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(index1,index2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
++
++		vxaverage_input->GetInputValue(&vx,gauss);
++		vyaverage_input->GetInputValue(&vy,gauss);
++		UdotN=vx*normal[0]+vy*normal[1];
++		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
++		DL=gauss->weight*Jdet*dt*UdotN;
++
++		TripleMultiply(&L[0],1,numdof,1,
++					&DL,1,1,0,
++					&L[0],1,numdof,0,
++					&Ke_g[0][0],0);
++
++		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g[i][j];
++	} 
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreateKMatrixBalancethickness{{{*/
++ElementMatrix* Numericalflux::CreateKMatrixBalancethickness(void){
++
++	int type;
++	inputs->GetInputValue(&type,TypeEnum);
++
++	switch(type){
++		case InternalEnum:
++			return CreateKMatrixBalancethicknessInternal();
++		case BoundaryEnum:
++			return CreateKMatrixBalancethicknessBoundary();
++		default:
++			_error2_("type not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreateKMatrixBalancethicknessInternal {{{*/
++ElementMatrix* Numericalflux::CreateKMatrixBalancethicknessInternal(void){
++
++	/* constants*/
++	const int numdof=NDOF1*NUMVERTICES_INTERNAL;
++
++	/* Intermediaries*/
++	int        i,j,ig,index1,index2;
++	IssmDouble     DL1,DL2,Jdet,vx,vy,UdotN;
++	IssmDouble     xyz_list[NUMVERTICES_INTERNAL][3];
++	IssmDouble     normal[2];
++	IssmDouble     B[numdof];
++	IssmDouble     Bprime[numdof];
++	IssmDouble     Ke_g1[numdof][numdof];
++	IssmDouble     Ke_g2[numdof][numdof];
++	GaussTria *gauss;
++
++	/*Initialize Element matrix and return if necessary*/
++	Tria*  tria=(Tria*)element;
++	if(tria->IsOnWater()) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES_INTERNAL,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes,NUMVERTICES_INTERNAL);
++	Input* vxaverage_input=tria->inputs->GetInput(VxEnum);
++	Input* vyaverage_input=tria->inputs->GetInput(VyEnum);
++	GetNormal(&normal[0],xyz_list);
++
++	/* Start  looping on the number of gaussian points: */
++	index1=tria->GetNodeIndex(nodes[0]);
++	index2=tria->GetNodeIndex(nodes[1]);
++	gauss=new GaussTria(index1,index2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		tria->GetSegmentBFlux(&B[0],gauss,index1,index2);
++		tria->GetSegmentBprimeFlux(&Bprime[0],gauss,index1,index2);
++
++		vxaverage_input->GetInputValue(&vx,gauss);
++		vyaverage_input->GetInputValue(&vy,gauss);
++		UdotN=vx*normal[0]+vy*normal[1];
++		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
++		DL1=gauss->weight*Jdet*UdotN/2;
++		DL2=gauss->weight*Jdet*fabs(UdotN)/2;
++
++		TripleMultiply(&B[0],1,numdof,1,
++					&DL1,1,1,0,
++					&Bprime[0],1,numdof,0,
++					&Ke_g1[0][0],0);
++		TripleMultiply(&B[0],1,numdof,1,
++					&DL2,1,1,0,
++					&B[0],1,numdof,0,
++					&Ke_g2[0][0],0);
++
++		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g1[i][j];
++		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g2[i][j];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreateKMatrixBalancethicknessBoundary {{{*/
++ElementMatrix* Numericalflux::CreateKMatrixBalancethicknessBoundary(void){
++
++	/* constants*/
++	const int numdof=NDOF1*NUMVERTICES_BOUNDARY;
++
++	/* Intermediaries*/
++	int        i,j,ig,index1,index2;
++	IssmDouble     DL,Jdet,vx,vy,mean_vx,mean_vy,UdotN;
++	IssmDouble     xyz_list[NUMVERTICES_BOUNDARY][3];
++	IssmDouble     normal[2];
++	IssmDouble     L[numdof];
++	IssmDouble     Ke_g[numdof][numdof];
++	GaussTria *gauss;
++
++	/*Initialize Element matrix and return if necessary*/
++	ElementMatrix* Ke = NULL;
++	Tria*  tria=(Tria*)element;
++	if(tria->IsOnWater()) return NULL;
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES_BOUNDARY);
++	Input* vxaverage_input=tria->inputs->GetInput(VxEnum);
++	Input* vyaverage_input=tria->inputs->GetInput(VyEnum);
++	GetNormal(&normal[0],xyz_list);
++
++	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
++	index1=tria->GetNodeIndex(nodes[0]);
++	index2=tria->GetNodeIndex(nodes[1]);
++
++	gauss=new GaussTria();
++	gauss->GaussEdgeCenter(index1,index2);
++	vxaverage_input->GetInputValue(&mean_vx,gauss);
++	vyaverage_input->GetInputValue(&mean_vy,gauss);
++	delete gauss;
++
++	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
++	if (UdotN<=0){
++		return NULL; /*(u,n)<0 -> inflow, PenaltyCreatePVector will take care of it*/
++	}
++	else{
++		Ke=new ElementMatrix(nodes,NUMVERTICES_BOUNDARY,this->parameters);
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(index1,index2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
++
++		vxaverage_input->GetInputValue(&vx,gauss);
++		vyaverage_input->GetInputValue(&vy,gauss);
++		UdotN=vx*normal[0]+vy*normal[1];
++		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
++		DL=gauss->weight*Jdet*UdotN;
++
++		TripleMultiply(&L[0],1,numdof,1,
++					&DL,1,1,0,
++					&L[0],1,numdof,0,
++					&Ke_g[0][0],0);
++
++		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g[i][j];
++	} 
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreateKMatrixAdjointBalancethickness{{{*/
++ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethickness(void){
++
++	int type;
++	inputs->GetInputValue(&type,TypeEnum);
++
++	switch(type){
++		case InternalEnum:
++			return CreateKMatrixAdjointBalancethicknessInternal();
++		case BoundaryEnum:
++			return CreateKMatrixAdjointBalancethicknessBoundary();
++		default:
++			_error2_("type not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreateKMatrixAdjointBalancethicknessInternal {{{*/
++ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethicknessInternal(void){
++
++	ElementMatrix* Ke=CreateKMatrixBalancethicknessInternal();
++	if (Ke) Ke->Transpose();
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreateKMatrixAdjointBalancethicknessBoundary {{{*/
++ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethicknessBoundary(void){
++
++	ElementMatrix* Ke=CreateKMatrixBalancethicknessBoundary();
++	if(Ke) Ke->Transpose();
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreatePVectorPrognostic{{{*/
++ElementVector* Numericalflux::CreatePVectorPrognostic(void){
++
++	int type;
++	inputs->GetInputValue(&type,TypeEnum);
++
++	switch(type){
++		case InternalEnum:
++			return CreatePVectorPrognosticInternal();
++		case BoundaryEnum:
++			return CreatePVectorPrognosticBoundary();
++		default:
++			_error2_("type not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreatePVectorPrognosticInternal{{{*/
++ElementVector* Numericalflux::CreatePVectorPrognosticInternal(void){
++
++	/*Nothing added to PVector*/
++	return NULL;
++
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreatePVectorPrognosticBoundary{{{*/
++ElementVector* Numericalflux::CreatePVectorPrognosticBoundary(void){
++
++	/* constants*/
++	const int numdof=NDOF1*NUMVERTICES_BOUNDARY;
++
++	/* Intermediaries*/
++	int        i,j,ig,index1,index2;
++	IssmDouble     DL,Jdet,dt,vx,vy,mean_vx,mean_vy,UdotN,thickness;
++	IssmDouble     xyz_list[NUMVERTICES_BOUNDARY][3];
++	IssmDouble     normal[2];
++	IssmDouble     L[numdof];
++	GaussTria *gauss;
++
++	/*Initialize Load Vector and return if necessary*/
++	ElementVector* pe = NULL;
++	Tria*  tria=(Tria*)element;
++	if(tria->IsOnWater()) return NULL;
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES_BOUNDARY);
++	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	Input* vxaverage_input   =tria->inputs->GetInput(VxEnum);                     _assert_(vxaverage_input); 
++	Input* vyaverage_input   =tria->inputs->GetInput(VyEnum);                     _assert_(vyaverage_input);
++	Input* spcthickness_input=tria->inputs->GetInput(PrognosticSpcthicknessEnum); _assert_(spcthickness_input);
++	GetNormal(&normal[0],xyz_list);
++
++	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
++	index1=tria->GetNodeIndex(nodes[0]);
++	index2=tria->GetNodeIndex(nodes[1]);
++
++	gauss=new GaussTria();
++	gauss->GaussEdgeCenter(index1,index2);
++	vxaverage_input->GetInputValue(&mean_vx,gauss);
++	vyaverage_input->GetInputValue(&mean_vy,gauss);
++	delete gauss;
++
++	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
++	if (UdotN>0){
++		return NULL; /*(u,n)>0 -> outflow, PenaltyCreateKMatrix will take care of it*/
++	}
++	else{
++		pe=new ElementVector(nodes,NUMVERTICES_BOUNDARY,this->parameters);
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(index1,index2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
++
++		vxaverage_input->GetInputValue(&vx,gauss);
++		vyaverage_input->GetInputValue(&vy,gauss);
++		spcthickness_input->GetInputValue(&thickness,gauss);
++		if(xIsNan<IssmDouble>(thickness)) _error2_("Cannot weakly apply constraint because NaN was provided");
++
++		UdotN=vx*normal[0]+vy*normal[1];
++		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
++		DL= - gauss->weight*Jdet*dt*UdotN*thickness;
++
++		for(i=0;i<numdof;i++) pe->values[i] += DL*L[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreatePVectorBalancethickness{{{*/
++ElementVector* Numericalflux::CreatePVectorBalancethickness(void){
++
++	int type;
++	inputs->GetInputValue(&type,TypeEnum);
++
++	switch(type){
++		case InternalEnum:
++			return CreatePVectorBalancethicknessInternal();
++		case BoundaryEnum:
++			return CreatePVectorBalancethicknessBoundary();
++		default:
++			_error2_("type not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreatePVectorBalancethicknessInternal{{{*/
++ElementVector* Numericalflux::CreatePVectorBalancethicknessInternal(void){
++
++	/*Nothing added to PVector*/
++	return NULL;
++
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreatePVectorBalancethicknessBoundary{{{*/
++ElementVector* Numericalflux::CreatePVectorBalancethicknessBoundary(void){
++
++	/* constants*/
++	const int numdof=NDOF1*NUMVERTICES_BOUNDARY;
++
++	/* Intermediaries*/
++	int        i,j,ig,index1,index2;
++	IssmDouble     DL,Jdet,vx,vy,mean_vx,mean_vy,UdotN,thickness;
++	IssmDouble     xyz_list[NUMVERTICES_BOUNDARY][3];
++	IssmDouble     normal[2];
++	IssmDouble     L[numdof];
++	GaussTria *gauss;
++
++	/*Initialize Load Vector and return if necessary*/
++	ElementVector* pe = NULL;
++	Tria*  tria=(Tria*)element;
++	if(tria->IsOnWater()) return NULL;
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES_BOUNDARY);
++	Input* vxaverage_input=tria->inputs->GetInput(VxEnum); _assert_(vxaverage_input); 
++	Input* vyaverage_input=tria->inputs->GetInput(VyEnum); _assert_(vyaverage_input);
++	Input* thickness_input=tria->inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
++	GetNormal(&normal[0],xyz_list);
++
++	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
++	index1=tria->GetNodeIndex(nodes[0]);
++	index2=tria->GetNodeIndex(nodes[1]);
++
++	gauss=new GaussTria();
++	gauss->GaussEdgeCenter(index1,index2);
++	vxaverage_input->GetInputValue(&mean_vx,gauss);
++	vyaverage_input->GetInputValue(&mean_vy,gauss);
++	delete gauss;
++	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
++	if (UdotN>0){
++		return NULL; /*(u,n)>0 -> outflow, PenaltyCreateKMatrix will take care of it*/
++	}
++	else{
++		pe=new ElementVector(nodes,NUMVERTICES_BOUNDARY,this->parameters);
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(index1,index2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
++
++		vxaverage_input->GetInputValue(&vx,gauss);
++		vyaverage_input->GetInputValue(&vy,gauss);
++		thickness_input->GetInputValue(&thickness,gauss);
++
++		UdotN=vx*normal[0]+vy*normal[1];
++		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
++		DL= - gauss->weight*Jdet*UdotN*thickness;
++
++		for(i=0;i<numdof;i++) pe->values[i] += DL*L[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::CreatePVectorAdjointBalancethickness{{{*/
++ElementVector* Numericalflux::CreatePVectorAdjointBalancethickness(void){
++
++	/*No PVector for the Adjoint*/
++	return NULL;
++}
++/*}}}*/
++/*FUNCTION Numericalflux::GetNormal {{{*/
++void Numericalflux:: GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]){
++
++	/*Build unit outward pointing vector*/
++	IssmDouble vector[2];
++	IssmDouble norm;
++
++	vector[0]=xyz_list[1][0] - xyz_list[0][0];
++	vector[1]=xyz_list[1][1] - xyz_list[0][1];
++
++	norm=sqrt(pow(vector[0],2.0)+pow(vector[1],2.0));
++
++	normal[0]= + vector[1]/norm;
++	normal[1]= - vector[0]/norm;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp	(revision 12822)
+@@ -0,0 +1,355 @@
++/*!\file Penpair.c
++ * \brief: implementation of the Penpair object
++ */
++
++/*Headers*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++/*Element macros*/
++#define NUMVERTICES 2
++
++/*Penpair constructors and destructor*/
++/*FUNCTION Penpair::constructor {{{*/
++Penpair::Penpair(){
++
++	this->hnodes=NULL;
++	this->nodes=NULL;
++	this->parameters=NULL;
++	return;
++}
++/*}}}*/
++/*FUNCTION Penpair::creation {{{*/
++Penpair::Penpair(int penpair_id, int* penpair_node_ids,int in_analysis_type){
++	
++	this->id=penpair_id;
++	this->analysis_type=in_analysis_type;
++	this->hnodes=new Hook(penpair_node_ids,2);
++	this->parameters=NULL;
++	this->nodes=NULL;
++	
++	return;
++}
++/*}}}*/
++/*FUNCTION Penpair::destructor {{{*/
++Penpair::~Penpair(){
++	delete hnodes;
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Penpair::Echo {{{*/
++void Penpair::Echo(void){
++
++	int i;
++
++	_printLine_("Penpair:");
++	_printLine_("   id: " << id);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	hnodes->Echo();
++	
++	return;
++}
++/*}}}*/
++/*FUNCTION Penpair::DeepEcho {{{*/
++void Penpair::DeepEcho(void){
++
++	_printLine_("Penpair:");
++	_printLine_("   id: " << id);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	hnodes->DeepEcho();
++
++	return;
++}		
++/*}}}*/
++/*FUNCTION Penpair::Id {{{*/
++int    Penpair::Id(void){ return id; }
++/*}}}*/
++/*FUNCTION Penpair::MyRank {{{*/
++int    Penpair::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Penpair::ObjectEnum{{{*/
++int Penpair::ObjectEnum(void){
++
++	return PenpairEnum;
++}
++/*}}}*/
++/*FUNCTION Penpair::copy {{{*/
++Object* Penpair::copy() {
++	
++	Penpair* penpair=NULL;
++
++	penpair=new Penpair();
++
++	/*copy fields: */
++	penpair->id=this->id;
++	penpair->analysis_type=this->analysis_type;
++
++	/*now deal with hooks and objects: */
++	penpair->hnodes=(Hook*)this->hnodes->copy();
++	penpair->nodes =(Node**)penpair->hnodes->deliverp();
++
++	/*point parameters: */
++	penpair->parameters=this->parameters;
++
++	return penpair;
++
++}
++/*}}}*/
++		
++/*Load virtual functions definitions:*/
++/*FUNCTION Penpair::Configure {{{*/
++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: */
++	hnodes->configure(nodesin);
++
++	/*Initialize hooked fields*/
++	this->nodes  =(Node**)hnodes->deliverp();
++
++	/*point parameters to real dataset: */
++	this->parameters=parametersin;
++
++}
++/*}}}*/
++/*FUNCTION Penpair::SetCurrentConfiguration {{{*/
++void  Penpair::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++
++}
++/*}}}*/
++/*FUNCTION Penpair::CreateKMatrix {{{*/
++void  Penpair::CreateKMatrix(Matrix* Kff, Matrix* 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* pf){
++
++	/*No loads applied, do nothing: */
++	return;
++
++}
++/*}}}*/
++/*FUNCTION Penpair::CreateJacobianMatrix{{{*/
++void  Penpair::CreateJacobianMatrix(Matrix* Jff){
++	this->CreateKMatrix(Jff,NULL);
++}
++/*}}}*/
++/*FUNCTION Penpair::PenaltyCreateKMatrix {{{*/
++void  Penpair::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
++
++	/*Retrieve parameters: */
++	ElementMatrix* Ke=NULL;
++	int analysis_type;
++	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	switch(analysis_type){
++		case DiagnosticHorizAnalysisEnum:
++			Ke=PenaltyCreateKMatrixDiagnosticHoriz(kmax);
++			break;
++		case PrognosticAnalysisEnum:
++			Ke=PenaltyCreateKMatrixPrognostic(kmax);
++			break;
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global Vector*/
++	if(Ke){
++		Ke->AddToGlobal(Kff,Kfs);
++		delete Ke;
++	}
++}
++/*}}}*/
++/*FUNCTION Penpair::PenaltyCreatePVector {{{*/
++void  Penpair::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
++	/*No loads applied, do nothing: */
++	return;
++}
++/*}}}*/
++/*FUNCTION Penpair::PenaltyCreateJacobianMatrix{{{*/
++void  Penpair::PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){
++	this->PenaltyCreateKMatrix(Jff,NULL,kmax);
++}
++/*}}}*/
++/*FUNCTION Penpair::InAnalysis{{{*/
++bool Penpair::InAnalysis(int in_analysis_type){
++	if (in_analysis_type==this->analysis_type)return true;
++	else return false;
++}
++/*}}}*/
++
++/*Update virtual functions definitions:*/
++/*FUNCTION 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){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION 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){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Penpair::InputUpdateFromVector(int* vector, int name, int type) {{{*/
++void  Penpair::InputUpdateFromVector(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Penpair::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
++void  Penpair::InputUpdateFromVector(bool* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++
++/*Penpair management:*/
++/*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticHoriz{{{*/
++ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticHoriz(IssmDouble kmax){
++
++	int    approximation0=nodes[0]->GetApproximation();
++	int    approximation1=nodes[1]->GetApproximation();
++
++	switch(approximation0){
++		case MacAyealApproximationEnum:
++			switch(approximation1){
++				case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
++				case PattynApproximationEnum:   return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
++				default: _error2_("not supported yet");
++			}
++		case PattynApproximationEnum:
++			switch(approximation1){
++				case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
++				case PattynApproximationEnum:   return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
++				default: _error2_("not supported yet");
++			}
++		case StokesApproximationEnum:
++			switch(approximation1){
++				case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 
++				case NoneApproximationEnum: return   PenaltyCreateKMatrixDiagnosticStokes(kmax); 
++				default: _error2_("not supported yet");
++			}
++		case NoneApproximationEnum:
++			switch(approximation1){
++				case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 
++				case NoneApproximationEnum: return   PenaltyCreateKMatrixDiagnosticStokes(kmax); 
++				default: _error2_("not supported yet");
++			}
++		default: _error2_("not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticMacAyealPattyn {{{*/
++ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticMacAyealPattyn(IssmDouble kmax){
++	
++	const int numdof=NUMVERTICES*NDOF2;
++	IssmDouble penalty_offset;
++
++	/*Initialize Element vector and return if necessary*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
++
++	/*recover parameters: */
++	parameters->FindParam(&penalty_offset,DiagnosticPenaltyFactorEnum);
++
++	//Create elementary matrix: add penalty to 
++	Ke->values[0*numdof+0]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[0*numdof+2]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[2*numdof+0]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[2*numdof+2]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++
++	Ke->values[1*numdof+1]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[1*numdof+3]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[3*numdof+1]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[3*numdof+3]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++
++	/*Clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticStokes {{{*/
++ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticStokes(IssmDouble kmax){
++	
++	const int numdof=NUMVERTICES*NDOF4;
++	IssmDouble penalty_offset;
++
++	/*Initialize Element vector and return if necessary*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
++
++	/*recover parameters: */
++	parameters->FindParam(&penalty_offset,DiagnosticPenaltyFactorEnum);
++
++	//Create elementary matrix: add penalty to 
++	Ke->values[0*numdof+0]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[0*numdof+4]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[4*numdof+0]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[4*numdof+4]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++
++	Ke->values[1*numdof+1]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[1*numdof+5]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[5*numdof+1]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[5*numdof+5]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++	
++	Ke->values[2*numdof+2]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[2*numdof+6]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[6*numdof+2]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[6*numdof+6]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++
++	Ke->values[3*numdof+3]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[3*numdof+7]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[7*numdof+3]=-kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[7*numdof+7]=+kmax*pow((IssmDouble)10.0,penalty_offset);
++
++	/*Clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penpair::PenaltyCreateKMatrixPrognostic {{{*/
++ElementMatrix* Penpair::PenaltyCreateKMatrixPrognostic(IssmDouble kmax){
++
++	const int numdof=NUMVERTICES*NDOF1;
++	IssmDouble penalty_factor;
++
++	/*Initialize Element vector and return if necessary*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
++
++	/*recover parameters: */
++	parameters->FindParam(&penalty_factor,PrognosticPenaltyFactorEnum);
++
++	//Create elementary matrix: add penalty to 
++	Ke->values[0*numdof+0]=+kmax*pow((IssmDouble)10.0,penalty_factor);
++	Ke->values[0*numdof+1]=-kmax*pow((IssmDouble)10.0,penalty_factor);
++	Ke->values[1*numdof+0]=-kmax*pow((IssmDouble)10.0,penalty_factor);
++	Ke->values[1*numdof+1]=+kmax*pow((IssmDouble)10.0,penalty_factor);
++
++	/*Clean up and return*/
++	return Ke;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.h	(revision 12822)
+@@ -0,0 +1,38 @@
++/*!\file Friction.h
++ * \brief: header file for friction object
++ */
++
++#ifndef _FRICTION_H_
++#define _FRICTION_H_
++
++/*Headers:*/
++/*{{{*/
++class Inputs;
++class Matpar;
++/*}}}*/
++
++class Friction{
++
++	public:
++		int analysis_type;
++
++		char* element_type;
++		Inputs* inputs;
++		Matpar* matpar;
++
++		/*methods: */
++		Friction();
++		Friction(const char* element_type, Inputs* inputs,Matpar* matpar, int analysis_type);
++		~Friction();
++	
++		void  Echo(void);
++		void  GetAlpha2(IssmDouble* palpha2, GaussTria* gauss,int vxenum,int vyenum,int vzenum);
++		void  GetAlpha2(IssmDouble* palpha2, GaussPenta* gauss,int vxenum,int vyenum,int vzenum);
++		void  GetAlphaComplement(IssmDouble* alpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum);
++		void  GetAlphaComplement(IssmDouble* alpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum);
++		void  GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int enum_type);
++		void  GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int enum_type);
++
++};
++
++#endif  /* _FRICTION_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.h	(revision 12822)
+@@ -0,0 +1,104 @@
++/*!\file Riftfront.h
++ * \brief: header file for riftfront object
++ */
++
++#ifndef _RIFTFRONT_H_
++#define _RIFTFRONT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Load.h"
++class Hook;
++class Parameters;
++class Inputs;
++class IoModel;
++/*}}}*/
++
++class Riftfront: public Load {
++
++	public:
++		int		id;
++		int     analysis_type;
++
++		/*hooks: */
++		Hook* hnodes;
++		Hook* helements;
++		Hook* hmatpar;
++		
++		/*Corresponding fields*/
++		Matpar   *matpar;
++		Node    **nodes;
++		Element **elements;
++
++		/*computational: */
++		int      penalty_lock;
++		bool     active;
++		bool     frozen;
++		int      counter;
++		bool     prestable;
++		bool     material_converged;
++		IssmDouble   normal[2];
++		IssmDouble   length;
++		IssmDouble   fraction;
++		int      state;
++		
++		Parameters* parameters; //pointer to solution parameters
++		Inputs*  inputs;
++
++
++		/*Riftfrontconstructors,destructors: {{{*/
++		Riftfront();
++		Riftfront(int riftfront_id,int i, IoModel* iomodel,int analysis_type);
++		~Riftfront();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Update virtual functions resolution: {{{*/
++		void    InputUpdateFromVector(IssmDouble* vector, int name, int type);
++		void    InputUpdateFromVector(int* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromVector(bool* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows,int ncols, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromVectorDakota(int* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromVectorDakota(bool* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromConstant(IssmDouble constant, int name);
++		void    InputUpdateFromConstant(int constant, int name){_error2_("Not implemented yet!");}
++		void    InputUpdateFromConstant(bool constant, int name);
++		void    InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		/*}}}*/
++		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
++		void  CreatePVector(Vector* pf);
++		void  CreateJacobianMatrix(Matrix* Jff){_error2_("Not implemented yet");};
++		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error2_("Not implemented yet");};
++		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
++		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
++		bool  InAnalysis(int analysis_type);
++		/*}}}*/
++		/*Riftfront specific routines: {{{*/
++		bool  PreStable();
++		ElementMatrix* PenaltyCreateKMatrixDiagnosticHoriz(IssmDouble kmax);
++		ElementVector* PenaltyCreatePVectorDiagnosticHoriz(IssmDouble kmax);
++		void  SetPreStable();
++		int   PreConstrain(int* punstable);
++		int   Constrain(int* punstable);
++		void  FreezeConstraints(void);
++		bool  IsFrozen(void);
++		int   Penetration(IssmDouble* ppenetration);
++		int   MaxPenetration(IssmDouble* ppenetration);
++		int   PotentialUnstableConstraint(int* punstable);
++		int   IsMaterialStable(void);
++		bool  IsInput(int name);
++		/*}}}*/
++};
++
++#endif  /* _RIFTFRONT_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h	(revision 12822)
+@@ -0,0 +1,97 @@
++/*!\file Numericalflux.h
++ * \brief: header file for icefront object
++ */
++
++#ifndef _NUMERICALFLUX_H_
++#define _NUMERICALFLUX_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Load.h"
++class Hook;
++class Parameters;
++class Inputs;
++class IoModel;
++class ElementMatrix;
++class ElementVector;
++/*}}}*/
++
++class Numericalflux: public Load {
++
++	public: 
++		int         id;
++		int analysis_type;
++
++		/*Hooks*/
++		Hook*       helement;
++		Hook*       hnodes;
++
++		/*Corresponding fields*/
++		Element* element;
++		Node**   nodes;
++
++		Parameters *parameters;
++		Inputs     *inputs;
++
++
++		/*Numericalflux constructors,destructors {{{*/
++		Numericalflux();
++		Numericalflux(int numericalflux_id,int i, IoModel* iomodel,int analysis_type);
++		~Numericalflux();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Update virtual functions resolution: {{{*/
++		void    InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/}
++		void    InputUpdateFromVector(int* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromVector(bool* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/}
++		void    InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/}
++		void    InputUpdateFromVectorDakota(int* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromVectorDakota(bool* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/};
++		void    InputUpdateFromConstant(int constant, int name){/*Do nothing*/};
++		void    InputUpdateFromConstant(bool constant, int name){_error2_("Not implemented yet!");}
++		void    InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		/*}}}*/
++		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
++		void  CreatePVector(Vector* pf);
++		void  CreateJacobianMatrix(Matrix* Jff){_error2_("Not implemented yet");};
++		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error2_("Not implemented yet");};
++		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
++		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
++		bool  InAnalysis(int analysis_type);
++		/*}}}*/
++		/*Numericalflux management:{{{*/
++		void  GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]);
++		ElementMatrix* CreateKMatrixPrognostic(void);
++		ElementMatrix* CreateKMatrixPrognosticInternal(void);
++		ElementMatrix* CreateKMatrixPrognosticBoundary(void);
++		ElementMatrix* CreateKMatrixBalancethickness(void);
++		ElementMatrix* CreateKMatrixBalancethicknessInternal(void);
++		ElementMatrix* CreateKMatrixBalancethicknessBoundary(void);
++		ElementMatrix* CreateKMatrixAdjointBalancethickness(void);
++		ElementMatrix* CreateKMatrixAdjointBalancethicknessInternal(void);
++		ElementMatrix* CreateKMatrixAdjointBalancethicknessBoundary(void);
++		ElementVector* CreatePVectorPrognostic(void);
++		ElementVector* CreatePVectorPrognosticInternal(void);
++		ElementVector* CreatePVectorPrognosticBoundary(void);
++		ElementVector* CreatePVectorBalancethickness(void);
++		ElementVector* CreatePVectorBalancethicknessInternal(void);
++		ElementVector* CreatePVectorBalancethicknessBoundary(void);
++		ElementVector* CreatePVectorAdjointBalancethickness(void);
++		/*}}}*/
++
++};
++
++#endif  /* _NUMERICALFLUX_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.h	(revision 12822)
+@@ -0,0 +1,77 @@
++/*!\file Penpair.h
++ * \brief: header file for penpair object */
++
++#ifndef _PENPAIR_H_
++#define _PENPAIR_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Load.h"
++#include "../Node.h"
++#include "../Elements/Element.h"
++
++class Element;
++/*}}}*/
++
++class Penpair: public Load{
++
++	private: 
++		int		id;
++		int analysis_type;
++		
++		Hook* hnodes;  //hook to 2 nodes
++		Node** nodes;
++
++		Parameters* parameters; //pointer to solution parameters
++
++	public:
++
++		/*Penpair constructors, destructors: {{{*/
++		Penpair();
++		Penpair(int penpair_id,int* penpair_node_ids,int analysis_type);
++		~Penpair();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Update virtual functions resolution: {{{*/
++		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVector(int* vector, int name, int type);
++		void  InputUpdateFromVector(bool* vector, int name, int type);
++		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrow, int ncols,int name, int type){_error2_("Not implemented yet!");}
++		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error2_("Not implemented yet!");}
++		void  InputUpdateFromVectorDakota(int* vector, int name, int type){_error2_("Not implemented yet!");}
++		void  InputUpdateFromVectorDakota(bool* vector, int name, int type){_error2_("Not implemented yet!");}
++		void  InputUpdateFromConstant(IssmDouble constant, int name);
++		void  InputUpdateFromConstant(int constant, int name);
++		void  InputUpdateFromConstant(bool constant, int name);
++		void  InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		/*}}}*/
++			/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
++		void  CreatePVector(Vector* pf);
++		void  CreateJacobianMatrix(Matrix* Jff);
++		void  PenaltyCreateKMatrix(Matrix* Kff,Matrix* Kfs,IssmDouble kmax);
++		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
++		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax);
++		bool  InAnalysis(int analysis_type);
++		/*}}}*/
++			/*Penpair management: {{{*/
++		ElementMatrix* PenaltyCreateKMatrixDiagnosticHoriz(IssmDouble kmax);
++		ElementMatrix* PenaltyCreateKMatrixDiagnosticMacAyealPattyn(IssmDouble kmax);
++		ElementMatrix* PenaltyCreateKMatrixDiagnosticStokes(IssmDouble kmax);
++		ElementMatrix* PenaltyCreateKMatrixPrognostic(IssmDouble kmax);
++		/*}}}*/
++};
++
++#endif  /* _PENPAIR_H_ */
++
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Load.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Load.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Load.h	(revision 12822)
+@@ -0,0 +1,40 @@
++/*!\file:  Load.h
++ * \brief abstract class for Load object
++ * This class is a place holder for the Icefront  and the Penpair loads.
++ * It is derived from Load, so DataSets can contain them.
++ */ 
++
++
++#ifndef _LOAD_H_
++#define _LOAD_H_
++
++/*Headers:*/
++/*{{{*/
++class Object;
++class Matrix;
++class Vector;
++
++#include "../Object.h"
++#include "../../toolkits/toolkits.h"
++#include "../../Container/Container.h"
++/*}}}*/
++
++class Load: public Object,public Update{
++
++	public: 
++
++		virtual       ~Load(){};
++		
++		/*Virtual functions: {{{*/
++		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,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
++		virtual void  CreateKMatrix(Matrix* Kff, Matrix* Kfs)=0;
++		virtual void  CreatePVector(Vector* pf)=0;
++		virtual void  CreateJacobianMatrix(Matrix* Jff)=0;
++		virtual void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax)=0;
++		virtual void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, IssmDouble kmax)=0;
++		virtual void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax)=0;
++		virtual bool  InAnalysis(int analysis_type)=0;
++		/*}}}*/
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp	(revision 12822)
+@@ -0,0 +1,620 @@
++/*!\file Pengrid.c
++ * \brief: implementation of the Pengrid object
++ */
++
++/*Headers*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++/*}}}*/
++	
++/*Element macros*/
++#define NUMVERTICES   1
++
++/*Pengrid constructors and destructor*/
++/*FUNCTION Pengrid::Pengrid(){{{*/
++Pengrid::Pengrid(){
++	this->inputs=NULL;
++	this->parameters=NULL;
++	this->hnode=NULL;
++	this->node=NULL;
++	this->helement=NULL;
++	this->element=NULL;
++	this->hmatpar=NULL;
++	this->matpar=NULL;
++	
++	/*not active, not zigzagging: */
++	active=0;
++	zigzag_counter=0;
++
++}
++/*}}}*/
++/*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
++
++	int i,j;
++	int pengrid_node_id;
++	int pengrid_matpar_id;
++	int pengrid_element_id;
++
++	int numberofvertices;
++	int numberofelements;
++
++	/*Fetch parameters: */
++	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
++	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
++
++	/*Some checks if debugging activated*/
++	_assert_(iomodel->singlenodetoelementconnectivity);
++	_assert_(index>=0 && index<numberofvertices);
++	_assert_(id);
++
++	/*id: */
++	this->id=id;
++	this->analysis_type=in_analysis_type;
++	
++	/*hooks: */
++	pengrid_node_id=iomodel->nodecounter+index+1;
++	pengrid_element_id=iomodel->singlenodetoelementconnectivity[index];
++	_assert_(pengrid_element_id);
++	pengrid_matpar_id=numberofelements+1; //refers to the constant material parameters object
++
++	this->hnode=new Hook(&pengrid_node_id,1);
++	this->helement=new Hook(&pengrid_element_id,1);
++	this->hmatpar=new Hook(&pengrid_matpar_id,1);
++
++	//initialize inputs: none needed
++	this->inputs=new Inputs();
++
++	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
++	this->parameters=NULL;
++	this->node=NULL;
++	this->element=NULL;
++	this->matpar=NULL;
++
++	//let's not forget internals
++	this->active=0;
++	this->zigzag_counter=0;
++
++}
++/*}}}*/
++/*FUNCTION Pengrid::~Pengrid(){{{*/
++Pengrid::~Pengrid(){
++	delete inputs;
++	delete hnode;
++	delete helement;
++	delete hmatpar;
++	return;
++}
++/*}}}*/
++			
++/*Object virtual functions definitions:*/
++/*FUNCTION Pengrid::Echo {{{*/
++void Pengrid::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION Pengrid::DeepEcho{{{*/
++void Pengrid::DeepEcho(void){
++
++	_printLine_("Pengrid:");
++	_printLine_("   id: " << id);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	hnode->DeepEcho();
++	helement->DeepEcho();
++	hmatpar->DeepEcho();
++	_printLine_("   active " << this->active);
++	_printLine_("   zigzag_counter " << this->zigzag_counter);
++	_printLine_("   parameters");
++	parameters->DeepEcho();
++	_printLine_("   inputs");
++	inputs->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION Pengrid::Id {{{*/
++int    Pengrid::Id(void){ return id; }
++/*}}}*/
++/*FUNCTION Pengrid::MyRank {{{*/
++int    Pengrid::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Pengrid::ObjectEnum{{{*/
++int Pengrid::ObjectEnum(void){
++
++	return PengridEnum;
++}
++/*}}}*/
++/*FUNCTION Icefront::copy {{{*/
++Object* Pengrid::copy() {
++	
++	Pengrid* pengrid=NULL;
++
++	pengrid=new Pengrid();
++
++	/*copy fields: */
++	pengrid->id=this->id;
++	pengrid->analysis_type=this->analysis_type;
++	if(this->inputs){
++		pengrid->inputs=(Inputs*)this->inputs->Copy();
++	}
++	else{
++		pengrid->inputs=new Inputs();
++	}
++	/*point parameters: */
++	pengrid->parameters=this->parameters;
++
++	/*now deal with hooks and objects: */
++	pengrid->hnode=(Hook*)this->hnode->copy();
++	pengrid->hmatpar=(Hook*)this->hmatpar->copy();
++	pengrid->helement=(Hook*)this->helement->copy();
++
++	/*corresponding fields*/
++	pengrid->node  =(Node*)pengrid->hnode->delivers();
++	pengrid->matpar =(Matpar*)pengrid->hmatpar->delivers();
++	pengrid->element=(Element*)pengrid->helement->delivers();
++
++	//let's not forget internals
++	pengrid->active=this->active=0;
++	pengrid->zigzag_counter=this->zigzag_counter=0;
++
++	return pengrid;
++
++}
++/*}}}*/
++
++/*Load virtual functions definitions:*/
++/*FUNCTION Pengrid::Configure {{{*/
++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: */
++	hnode->configure(nodesin);
++	helement->configure(elementsin);
++	hmatpar->configure(materialsin);
++
++	/*Get corresponding fields*/
++	node=(Node*)hnode->delivers();
++	element=(Element*)helement->delivers();
++	matpar=(Matpar*)hmatpar->delivers();
++
++	/*point parameters to real dataset: */
++	this->parameters=parametersin;
++}
++/*}}}*/
++/*FUNCTION Pengrid::SetCurrentConfiguration {{{*/
++void  Pengrid::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++
++}
++/*}}}*/
++/*FUNCTION Pengrid::CreateKMatrix {{{*/
++void  Pengrid::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
++
++	/*No loads applied, do nothing: */
++	return;
++
++}
++/*}}}*/
++/*FUNCTION Pengrid::CreatePVector {{{*/
++void  Pengrid::CreatePVector(Vector* pf){
++
++	/*No loads applied, do nothing: */
++	return;
++
++}
++/*}}}*/
++/*FUNCTION Pengrid::PenaltyCreateMatrix {{{*/
++void  Pengrid::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
++
++	/*Retrieve parameters: */
++	ElementMatrix* Ke=NULL;
++	int analysis_type;
++	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	switch(analysis_type){
++		#ifdef _HAVE_DIAGNOSTIC_
++		case DiagnosticHorizAnalysisEnum: case AdjointHorizAnalysisEnum:
++			Ke=PenaltyCreateKMatrixDiagnosticStokes(kmax);
++			break;
++		#endif
++		#ifdef _HAVE_THERMAL_
++		case ThermalAnalysisEnum:
++			Ke=PenaltyCreateKMatrixThermal(kmax);
++			break;
++		case MeltingAnalysisEnum:
++			Ke=PenaltyCreateKMatrixMelting(kmax);
++			break;
++		#endif
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global matrix*/
++	if(Ke){
++		Ke->AddToGlobal(Kff,Kfs);
++		delete Ke;
++	}
++}
++/*}}}*/
++/*FUNCTION Pengrid::PenaltyCreatePVector {{{*/
++void  Pengrid::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
++
++	/*Retrieve parameters: */
++	ElementVector* pe=NULL;
++	int analysis_type;
++	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	switch(analysis_type){
++		#ifdef _HAVE_DIAGNOSTIC_
++		case ThermalAnalysisEnum:
++			pe=PenaltyCreatePVectorThermal(kmax);
++			break;
++		#endif
++		#ifdef _HAVE_THERMAL_
++		case MeltingAnalysisEnum:
++			pe=PenaltyCreatePVectorMelting(kmax);
++			break;
++		case DiagnosticHorizAnalysisEnum: case AdjointHorizAnalysisEnum:
++			break;
++		#endif
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global Vector*/
++	if(pe){
++		pe->AddToGlobal(pf);
++		delete pe;
++	}
++}
++/*}}}*/
++/*FUNCTION Pengrid::InAnalysis{{{*/
++bool Pengrid::InAnalysis(int in_analysis_type){
++	if (in_analysis_type==this->analysis_type)return true;
++	else return false;
++}
++/*}}}*/
++
++/*Update virtual functions definitions:*/
++/*FUNCTION Pengrid::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
++void  Pengrid::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Pengrid::InputUpdateFromVector(int* vector, int name, int type) {{{*/
++void  Pengrid::InputUpdateFromVector(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Pengrid::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
++void  Pengrid::InputUpdateFromVector(bool* 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){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Pengrid::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type) {{{*/
++void  Pengrid::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Pengrid::InputUpdateFromVectorDakota(int* vector, int name, int type) {{{*/
++void  Pengrid::InputUpdateFromVectorDakota(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Pengrid::InputUpdateFromVectorDakota(bool* vector, int name, int type) {{{*/
++void  Pengrid::InputUpdateFromVectorDakota(bool* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Pengrid::InputUpdateFromConstant(IssmDouble constant, int name) {{{*/
++void  Pengrid::InputUpdateFromConstant(IssmDouble constant, int name){
++	switch(name){
++
++		case MeltingOffsetEnum:
++			inputs->AddInput(new DoubleInput(name,constant));
++			return;
++
++	}
++}
++/*}}}*/
++/*FUNCTION 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){
++
++	switch(name){
++
++		case ResetPenaltiesEnum:
++			if (constant) zigzag_counter=0;
++			return;
++
++	}
++}
++/*}}}*/
++/*FUNCTION Pengrid::InputUpdateFromSolution{{{*/
++void  Pengrid::InputUpdateFromSolution(IssmDouble* solution){
++	/*Nothing updated yet*/
++}
++/*}}}*/		
++
++/*Pengrid management:*/
++/*FUNCTION Pengrid::ConstraintActivate {{{*/
++void  Pengrid::ConstraintActivate(int* punstable){
++
++	int analysis_type;
++
++	/*Retrieve parameters: */
++	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	if (analysis_type==DiagnosticHorizAnalysisEnum){
++		/*No penalty to check*/
++		return;
++	}
++	else if (analysis_type==ThermalAnalysisEnum){
++		ConstraintActivateThermal(punstable);
++	}
++	else if (analysis_type==MeltingAnalysisEnum){
++		/*No penalty to check*/
++		return;
++	}
++	else{
++		_error2_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION Pengrid::ConstraintActivateThermal {{{*/
++void  Pengrid::ConstraintActivateThermal(int* punstable){
++
++	//   The penalty is stable if it doesn't change during to successive iterations.   
++
++	int    found=0;
++	const int numnodes=1;
++	IssmDouble pressure;
++	IssmDouble temperature;
++	IssmDouble t_pmp;
++	int    new_active;
++	int    unstable=0;
++	int    reset_penalties=0;
++	int    penalty_lock;
++
++	/*recover pointers: */
++	Penta* penta=(Penta*)element;
++	
++	/*check that pengrid is not a clone (penalty to be added only once)*/
++	if (node->IsClone()){
++		unstable=0;
++		*punstable=unstable;
++		return;
++	}
++
++	//First recover pressure and temperature values, using the element: */
++	penta->GetInputValue(&pressure,node,PressureEnum);
++	penta->GetInputValue(&temperature,node,TemperaturePicardEnum);
++
++	//Recover our data:
++	parameters->FindParam(&penalty_lock,ThermalPenaltyLockEnum);
++	
++	//Compute pressure melting point
++	t_pmp=matpar->TMeltingPoint(pressure);
++
++	//Figure out if temperature is over melting_point, in which case, this penalty needs to be activated.
++
++	if (temperature>t_pmp){
++		new_active=1;
++	}
++	else{
++		new_active=0;
++	}
++
++
++	//Figure out stability of this penalty
++	if (active==new_active){
++		unstable=0;
++	}
++	else{
++		unstable=1;
++		if(penalty_lock)zigzag_counter++;
++	}
++
++	/*If penalty keeps zigzagging more than 5 times: */
++	if(penalty_lock){
++		if(zigzag_counter>penalty_lock){
++			unstable=0;
++			active=1;
++		}
++	}
++
++	//Set penalty flag
++	active=new_active;
++
++	//*Assign output pointers:*/
++	*punstable=unstable;
++}
++/*}}}*/
++#ifdef _HAVE_DIAGNOSTIC_
++/*FUNCTION Pengrid::PenaltyCreateKMatrixDiagnosticStokes {{{*/
++ElementMatrix* Pengrid::PenaltyCreateKMatrixDiagnosticStokes(IssmDouble kmax){
++	
++	const int numdof = NUMVERTICES *NDOF4;
++	IssmDouble    slope[2];
++	IssmDouble    penalty_offset;
++	int       approximation;
++
++	Penta* penta=(Penta*)element;
++
++	/*Initialize Element vector and return if necessary*/
++	penta->inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(approximation!=StokesApproximationEnum &&  approximation!=PattynStokesApproximationEnum) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(&node,1,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	parameters->FindParam(&penalty_offset,DiagnosticPenaltyFactorEnum);
++	penta->GetInputValue(&slope[0],node,BedSlopeXEnum);
++	penta->GetInputValue(&slope[1],node,BedSlopeYEnum);
++
++	/*Create elementary matrix: add penalty to constrain wb (wb=ub*db/dx+vb*db/dy)*/
++	Ke->values[2*NDOF4+0]=-slope[0]*kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[2*NDOF4+1]=-slope[1]*kmax*pow((IssmDouble)10.0,penalty_offset);
++	Ke->values[2*NDOF4+2]= kmax*pow((IssmDouble)10,penalty_offset);
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,&node,NUMVERTICES,XYZPEnum);
++
++	/*Clean up and return*/
++	return Ke;
++}
++/*}}}*/
++#endif
++#ifdef _HAVE_THERMAL_
++/*FUNCTION Pengrid::PenaltyCreateKMatrixMelting {{{*/
++ElementMatrix* Pengrid::PenaltyCreateKMatrixMelting(IssmDouble kmax){
++
++	const int numdof=NUMVERTICES*NDOF1;
++	IssmDouble pressure,temperature,t_pmp;
++	IssmDouble penalty_factor;
++
++	Penta* penta=(Penta*)element;
++
++	/*check that pengrid is not a clone (penalty to be added only once)*/
++	if (node->IsClone()) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(&node,1,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	penta->GetInputValue(&pressure,node,PressureEnum);
++	penta->GetInputValue(&temperature,node,TemperatureEnum);
++	parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
++	
++	/*Compute pressure melting point*/
++	t_pmp=matpar->GetMeltingPoint()-matpar->GetBeta()*pressure;
++
++	/*Add penalty load*/
++	if (temperature<t_pmp){ //If T<Tpmp, there must be no melting. Therefore, melting should be  constrained to 0 when T<Tpmp, instead of using spcs, use penalties
++		Ke->values[0]=kmax*pow((IssmDouble)10,penalty_factor);
++	}
++
++	/*Clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Pengrid::PenaltyCreateKMatrixThermal {{{*/
++ElementMatrix* Pengrid::PenaltyCreateKMatrixThermal(IssmDouble kmax){
++
++	const int numdof=NUMVERTICES*NDOF1;
++	IssmDouble    penalty_factor;
++
++	/*Initialize Element matrix and return if necessary*/
++	if(!this->active) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(&node,NUMVERTICES,this->parameters);
++
++	/*recover parameters: */
++	parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
++
++	Ke->values[0]=kmax*pow((IssmDouble)10,penalty_factor);
++
++	/*Clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Pengrid::PenaltyCreatePVectorMelting {{{*/
++ElementVector* Pengrid::PenaltyCreatePVectorMelting(IssmDouble kmax){
++	
++	const int numdof=NUMVERTICES*NDOF1;
++	IssmDouble pressure;
++	IssmDouble temperature;
++	IssmDouble melting_offset;
++	IssmDouble t_pmp;
++	IssmDouble dt,penalty_factor;
++
++	/*recover pointers: */
++	Penta* penta=(Penta*)element;
++
++	/*check that pengrid is not a clone (penalty to be added only once)*/
++	if (node->IsClone()) return NULL;
++	ElementVector* pe=new ElementVector(&node,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	penta->GetInputValue(&pressure,node,PressureEnum);
++	penta->GetInputValue(&temperature,node,TemperatureEnum);
++	inputs->GetInputValue(&melting_offset,MeltingOffsetEnum);
++	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
++
++	/*Compute pressure melting point*/
++	t_pmp=matpar->GetMeltingPoint()-matpar->GetBeta()*pressure;
++
++	/*Add penalty load
++	  This time, the penalty must have the same value as the one used for the thermal computation
++	  so that the corresponding melting can be computed correctly
++	  In the thermal computation, we used kmax=melting_offset, and the same penalty_factor*/
++	if (temperature<t_pmp){ //%no melting
++		pe->values[0]=0;
++	}
++	else{
++		if (dt) pe->values[0]=melting_offset*pow((IssmDouble)10,penalty_factor)*(temperature-t_pmp)/dt;
++		else    pe->values[0]=melting_offset*pow((IssmDouble)10,penalty_factor)*(temperature-t_pmp);
++	}
++
++	/*Clean up and return*/
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Pengrid::PenaltyCreatePVectorThermal {{{*/
++ElementVector* Pengrid::PenaltyCreatePVectorThermal(IssmDouble kmax){
++
++	const int numdof=NUMVERTICES*NDOF1;
++	IssmDouble pressure;
++	IssmDouble t_pmp;
++	IssmDouble penalty_factor;
++
++	Penta* penta=(Penta*)element;
++
++	/*Initialize Element matrix and return if necessary*/
++	if(!this->active) return NULL;
++	ElementVector* pe=new ElementVector(&node,1,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	penta->GetInputValue(&pressure,node,PressureEnum);
++	parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
++
++	/*Compute pressure melting point*/
++	t_pmp=matpar->GetMeltingPoint()-matpar->GetBeta()*pressure;
++
++	pe->values[0]=kmax*pow((IssmDouble)10,penalty_factor)*t_pmp;
++
++	/*Clean up and return*/
++	return pe;
++}
++/*}}}*/
++#endif
++/*FUNCTION Pengrid::ResetConstraint {{{*/
++void  Pengrid::ResetConstraint(void){
++	active=0;
++	zigzag_counter=0;
++}
++/*}}}*/
++/*FUNCTION Pengrid::UpdateInputs {{{*/
++void  Pengrid::UpdateInputs(IssmDouble* solution){
++	_error2_("not supported yet!");
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp	(revision 12822)
+@@ -0,0 +1,743 @@
++/*!\file Icefront.c
++ * \brief: implementation of the Icefront object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++/*}}}*/	
++
++/*Load macros*/
++#define NUMVERTICESSEG 2
++#define NUMVERTICESQUA 4
++
++/*Icefront constructors and destructor*/
++/*FUNCTION Icefront::Icefront() {{{*/
++Icefront::Icefront(){
++
++	this->inputs=NULL;
++	this->parameters=NULL;
++
++	this->hnodes=NULL;
++	this->nodes= NULL;
++	this->helement=NULL;
++	this->element= NULL;
++	this->hmatpar=NULL;
++	this->matpar= NULL;
++}
++/*}}}*/
++/*FUNCTION Icefront::Icefront(int id, int i, IoModel* iomodel,int analysis_type) {{{*/
++Icefront::Icefront(int icefront_id,int i, IoModel* iomodel,int in_icefront_type, int in_analysis_type){
++
++	int segment_width;
++	int element;
++	int num_nodes; 
++	int dim;
++	int numberofelements;
++
++	/*icefront constructor data: */
++	int  icefront_eid;
++	int  icefront_mparid;
++	int  icefront_node_ids[NUMVERTICESQUA]; //initialize with largest size
++	int  icefront_fill;
++	
++	/*find parameters: */
++	iomodel->Constant(&dim,MeshDimensionEnum);
++	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
++
++	/*First, retrieve element index and element type: */
++	if (dim==2){
++		segment_width=4;
++	}
++	else{
++		segment_width=6;
++	}
++	_assert_(iomodel->Data(DiagnosticIcefrontEnum));
++	element=reCast<int,IssmDouble>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)
++
++	/*Build ids for hook constructors: */
++	icefront_eid=reCast<int,IssmDouble>( *(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+segment_width-2)); //matlab indexing
++	icefront_mparid=numberofelements+1; //matlab indexing
++
++	if (in_icefront_type==MacAyeal2dIceFrontEnum || in_icefront_type==MacAyeal3dIceFrontEnum){
++		icefront_node_ids[0]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
++		icefront_node_ids[1]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
++	}
++	else if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum){
++		icefront_node_ids[0]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
++		icefront_node_ids[1]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
++		icefront_node_ids[2]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2));
++		icefront_node_ids[3]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3));
++	}
++	else _error2_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!");
++
++	if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum)
++	 num_nodes=4;
++	else 
++	 num_nodes=2;
++
++	/*Fill*/
++	icefront_fill=reCast<int>(iomodel->Data(DiagnosticIcefrontEnum)[segment_width*i+segment_width-1]);
++	
++	/*Ok, we have everything to build the object: */
++	this->id=icefront_id;
++	this->analysis_type=in_analysis_type;
++
++	/*Hooks: */
++	this->hnodes=new Hook(icefront_node_ids,num_nodes);
++	this->helement=new Hook(&icefront_eid,1);
++	this->hmatpar=new Hook(&icefront_mparid,1);
++
++	//intialize  and add as many inputs per element as requested: 
++	this->inputs=new Inputs();
++	this->inputs->AddInput(new IntInput(FillEnum,icefront_fill));
++	this->inputs->AddInput(new IntInput(TypeEnum,in_icefront_type));
++	
++	//parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
++	this->parameters=NULL;
++	this->nodes= NULL;
++	this->element= NULL;
++	this->matpar= NULL;
++}
++
++
++/*}}}*/
++/*FUNCTION Icefront::~Icefront() {{{*/
++Icefront::~Icefront(){
++	delete inputs;
++	this->parameters=NULL;
++	delete hnodes;
++	delete helement;
++	delete hmatpar;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Icefront::Echo {{{*/
++void Icefront::Echo(void){
++	_printLine_("Icefront:");
++	_printLine_("   id: " << id);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	hnodes->Echo();
++	helement->Echo();
++	hmatpar->Echo();
++	_printLine_("   parameters: " << parameters);
++	if(parameters)parameters->Echo();
++	_printLine_("   inputs: " << inputs);
++	if(inputs)inputs->Echo();
++}
++/*}}}*/
++/*FUNCTION Icefront::DeepEcho{{{*/
++void Icefront::DeepEcho(void){
++
++	_printLine_("Icefront:");
++	_printLine_("   id: " << id);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	hnodes->DeepEcho();
++	helement->DeepEcho();
++	hmatpar->DeepEcho();
++	_printLine_("   parameters: " << parameters);
++	if(parameters)parameters->DeepEcho();
++	_printLine_("   inputs: " << inputs);
++	if(inputs)inputs->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION Icefront::Id {{{*/
++int    Icefront::Id(void){ return id; }
++/*}}}*/
++/*FUNCTION Icefront::MyRank {{{*/
++int    Icefront::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Icefront::ObjectEnum{{{*/
++int Icefront::ObjectEnum(void){
++
++	return IcefrontEnum;
++
++}
++/*}}}*/
++/*FUNCTION Icefront::copy {{{*/
++Object* Icefront::copy() {
++	
++	Icefront* icefront=NULL;
++
++	icefront=new Icefront();
++
++	/*copy fields: */
++	icefront->id=this->id;
++	icefront->analysis_type=this->analysis_type;
++	if(this->inputs){
++		icefront->inputs=(Inputs*)this->inputs->Copy();
++	}
++	else{
++		icefront->inputs=new Inputs();
++	}
++	/*point parameters: */
++	icefront->parameters=this->parameters;
++
++	/*now deal with hooks and objects: */
++	icefront->hnodes=(Hook*)this->hnodes->copy();
++	icefront->helement=(Hook*)this->helement->copy();
++	icefront->hmatpar=(Hook*)this->hmatpar->copy();
++
++	/*corresponding fields*/
++	icefront->nodes  =(Node**)icefront->hnodes->deliverp();
++	icefront->element=(Element*)icefront->helement->delivers();
++	icefront->matpar =(Matpar*)icefront->hmatpar->delivers();
++
++	return icefront;
++
++}
++/*}}}*/
++
++/*Load virtual functions definitions:*/
++/*FUNCTION Icefront::Configure {{{*/
++void  Icefront::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: */
++	hnodes->configure(nodesin);
++	helement->configure(elementsin);
++	hmatpar->configure(materialsin);
++
++	/*Initialize hooked fields*/
++	this->nodes  =(Node**)hnodes->deliverp();
++	this->element=(Element*)helement->delivers();
++	this->matpar =(Matpar*)hmatpar->delivers();
++
++	/*point parameters to real dataset: */
++	this->parameters=parametersin;
++}
++/*}}}*/
++/*FUNCTION Icefront::SetCurrentConfiguration {{{*/
++void  Icefront::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++}
++/*}}}*/
++/*FUNCTION Icefront::CreateKMatrix {{{*/
++void  Icefront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
++
++	/*No stiffness loads applied, do nothing: */
++	return;
++
++}
++/*}}}*/
++/*FUNCTION Icefront::CreatePVector {{{*/
++void  Icefront::CreatePVector(Vector* pf){
++
++	/*Checks in debugging mode*/
++	/*{{{*/
++	_assert_(nodes);
++	_assert_(element);
++	_assert_(matpar);
++	/*}}}*/
++
++	/*Retrieve parameters: */
++	ElementVector* pe=NULL;
++	int analysis_type;
++	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*Just branch to the correct element icefront vector generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++		#ifdef _HAVE_DIAGNOSTIC_
++		case DiagnosticHorizAnalysisEnum:
++			pe=CreatePVectorDiagnosticHoriz();
++			break;
++		#endif
++		#ifdef _HAVE_CONTROL_
++		case AdjointHorizAnalysisEnum:
++			pe=CreatePVectorAdjointHoriz();
++			break;
++		#endif
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global Vector*/
++	if(pe){
++		pe->AddToGlobal(pf);
++		delete pe;
++	}
++}
++/*}}}*/
++/*FUNCTION Icefront::CreateJacobianMatrix{{{*/
++void  Icefront::CreateJacobianMatrix(Matrix* Jff){
++	this->CreateKMatrix(Jff,NULL);
++}
++/*}}}*/
++/*FUNCTION Icefront::PenaltyCreateKMatrix {{{*/
++void  Icefront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, IssmDouble kmax){
++	/*do nothing: */
++	return;
++}
++/*}}}*/
++/*FUNCTION Icefront::PenaltyCreatePVector{{{*/
++void  Icefront::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
++	/*do nothing: */
++	return;
++}
++/*}}}*/
++/*FUNCTION Icefront::PenaltyCreateJacobianMatrix{{{*/
++void  Icefront::PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){
++	this->PenaltyCreateKMatrix(Jff,NULL,kmax);
++}
++/*}}}*/
++/*FUNCTION Icefront::InAnalysis{{{*/
++bool Icefront::InAnalysis(int in_analysis_type){
++	if (in_analysis_type==this->analysis_type)return true;
++	else return false;
++}
++/*}}}*/
++
++/*Update virtual functions definitions:*/
++/*FUNCTION Icefront::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
++void  Icefront::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Icefront::InputUpdateFromVector(int* vector, int name, int type) {{{*/
++void  Icefront::InputUpdateFromVector(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Icefront::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
++void  Icefront::InputUpdateFromVector(bool* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Icefront::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type) {{{*/
++void  Icefront::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Icefront::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type) {{{*/
++void  Icefront::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Icefront::InputUpdateFromVectorDakota(int* vector, int name, int type) {{{*/
++void  Icefront::InputUpdateFromVectorDakota(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Icefront::InputUpdateFromVectorDakota(bool* vector, int name, int type) {{{*/
++void  Icefront::InputUpdateFromVectorDakota(bool* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Icefront::InputUpdateFromConstant(IssmDouble constant, int name) {{{*/
++void  Icefront::InputUpdateFromConstant(IssmDouble constant, int name){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Icefront::InputUpdateFromConstant(int constant, int name) {{{*/
++void  Icefront::InputUpdateFromConstant(int constant, int name){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Icefront::InputUpdateFromConstant(bool constant, int name) {{{*/
++void  Icefront::InputUpdateFromConstant(bool constant, int name){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Icefront::InputUpdateFromSolution{{{*/
++void  Icefront::InputUpdateFromSolution(IssmDouble* solution){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++
++/*Icefront numerics: */
++#ifdef _HAVE_DIAGNOSTIC_
++/*FUNCTION Icefront::CreatePVectorDiagnosticHoriz {{{*/
++ElementVector* Icefront::CreatePVectorDiagnosticHoriz(void){
++
++	int type;
++	inputs->GetInputValue(&type,TypeEnum);
++
++	switch(type){
++		case MacAyeal2dIceFrontEnum:
++			return CreatePVectorDiagnosticMacAyeal2d();
++        #ifdef _HAVE_3D_
++		case MacAyeal3dIceFrontEnum:
++			return CreatePVectorDiagnosticMacAyeal3d();
++		case PattynIceFrontEnum:
++			return CreatePVectorDiagnosticPattyn();
++		case StokesIceFrontEnum:
++			return CreatePVectorDiagnosticStokes();
++	    #endif
++		default:
++			_error2_("Icefront type " << EnumToStringx(type) << " not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Icefront::CreatePVectorDiagnosticMacAyeal2d{{{*/
++ElementVector* Icefront::CreatePVectorDiagnosticMacAyeal2d(void){
++
++	/*Constants*/
++	const int numnodes= NUMVERTICESSEG;
++	const int numdofs = numnodes *NDOF2;
++
++	/*Intermediary*/
++	int        ig,index1,index2,fill;
++	IssmDouble     Jdet;
++	IssmDouble     thickness,bed,pressure,ice_pressure,rho_water,rho_ice,gravity;
++	IssmDouble     water_pressure,air_pressure,surface_under_water,base_under_water;
++	IssmDouble     xyz_list[numnodes][3];
++	IssmDouble     normal[2];
++	IssmDouble     L[2];
++	GaussTria *gauss;
++
++	Tria* tria=((Tria*)element);
++
++	/*Initialize Element vector and return if necessary*/
++	if(tria->IsOnWater()) return NULL;
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICESSEG,this->parameters,MacAyealApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0],nodes,numnodes);
++	Input* thickness_input=tria->inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
++	Input* bed_input      =tria->inputs->GetInput(BedEnum);       _assert_(bed_input);
++	inputs->GetInputValue(&fill,FillEnum);
++	rho_water=matpar->GetRhoWater();
++	rho_ice  =matpar->GetRhoIce();
++	gravity  =matpar->GetG();
++	GetSegmentNormal(&normal[0],xyz_list);
++
++	/*Start looping on Gaussian points*/
++	index1=tria->GetNodeIndex(nodes[0]);
++	index2=tria->GetNodeIndex(nodes[1]);
++	gauss=new GaussTria(index1,index2,3);
++
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		thickness_input->GetInputValue(&thickness,gauss);
++		bed_input->GetInputValue(&bed,gauss);
++
++		switch(fill){
++			case WaterEnum:
++				surface_under_water=min(0.,thickness+bed); // 0 if the top of the glacier is above water level
++				base_under_water=min(0.,bed);              // 0 if the bottom of the glacier is above water level
++				water_pressure=1.0/2.0*gravity*rho_water*(pow(surface_under_water,2) - pow(base_under_water,2));
++				break;
++			case AirEnum:
++				water_pressure=0;
++				break;
++			case IceEnum:
++				water_pressure=-1.0/2.0*gravity*rho_ice*pow(thickness,2); // we are facing a wall of ice. use water_pressure to cancel the lithostatic pressure.
++				break;
++			default:
++				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
++		}
++		ice_pressure=1.0/2.0*gravity*rho_ice*pow(thickness,2);
++		air_pressure=0;
++		pressure = ice_pressure + water_pressure + air_pressure;
++
++		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
++		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
++
++		for (int i=0;i<numnodes;i++){
++			pe->values[2*i+0]+= pressure*Jdet*gauss->weight*normal[0]*L[i];
++			pe->values[2*i+1]+= pressure*Jdet*gauss->weight*normal[1]*L[i];
++		}
++	}
++
++	/*Transform load vector*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICESSEG,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_CONTROL_
++/*FUNCTION Icefront::CreatePVectorAdjointHoriz {{{*/
++ElementVector* Icefront::CreatePVectorAdjointHoriz(void){
++
++	/*No load vector applied to the adjoint*/
++	return NULL;
++}
++/*}}}*/
++#endif
++#ifdef _HAVE_3D_
++/*FUNCTION Icefront::CreatePVectorDiagnosticMacAyeal3d{{{*/
++ElementVector* Icefront::CreatePVectorDiagnosticMacAyeal3d(void){
++
++	Icefront* icefront=NULL;
++	Penta*    penta=NULL;
++	Tria*     tria=NULL;
++	bool      onbed;
++
++	/*Cast element onto Penta*/
++	penta   =(Penta*)this->element;
++
++	/*Return if not on bed*/
++	if(!penta->IsOnBed() || penta->IsOnWater()) return NULL;
++
++	/*Spawn Tria and call MacAyeal2d*/
++	tria    =(Tria*)penta->SpawnTria(0,1,2);
++	icefront=(Icefront*)this->copy();
++	icefront->element=tria;
++	icefront->inputs->AddInput(new IntInput(TypeEnum,MacAyeal2dIceFrontEnum));
++	ElementVector* pe=icefront->CreatePVectorDiagnosticMacAyeal2d();
++
++	/*clean-up and return*/
++	delete tria->matice;
++	delete tria;
++	delete icefront;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Icefront::CreatePVectorDiagnosticPattyn{{{*/
++ElementVector* Icefront::CreatePVectorDiagnosticPattyn(void){
++
++	/*Constants*/
++	const int numdofs = NUMVERTICESQUA *NDOF2;
++
++	/*Intermediaries*/
++	int         i,j,ig,index1,index2,index3,index4;
++	int         fill;
++	IssmDouble      surface,pressure,ice_pressure,rho_water,rho_ice,gravity;
++	IssmDouble      water_pressure,air_pressure;
++	IssmDouble      Jdet,z_g;
++	IssmDouble      xyz_list[NUMVERTICESQUA][3];
++	IssmDouble      normal[3];
++	IssmDouble      l1l4[4];
++	GaussPenta *gauss = NULL;
++
++	Penta* penta=(Penta*)element;
++
++	/*Initialize Element vector and return if necessary*/
++	if(penta->IsOnWater()) return NULL;
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICESQUA,this->parameters,PattynApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICESQUA);
++	Input* surface_input  =penta->inputs->GetInput(SurfaceEnum);   _assert_(surface_input);
++	inputs->GetInputValue(&fill,FillEnum);
++	rho_water=matpar->GetRhoWater();
++	rho_ice  =matpar->GetRhoIce();
++	gravity  =matpar->GetG();
++	GetQuadNormal(&normal[0],xyz_list);
++
++	/*Identify which nodes are in the quad: */
++	index1=element->GetNodeIndex(nodes[0]);
++	index2=element->GetNodeIndex(nodes[1]);
++	index3=element->GetNodeIndex(nodes[2]);
++	index4=element->GetNodeIndex(nodes[3]);
++
++	/* Start  looping on the number of gaussian points: */
++	IssmDouble zmax=xyz_list[0][2]; for(i=1;i<NUMVERTICESQUA;i++) if(xyz_list[i][2]>zmax) zmax=xyz_list[i][2];
++	IssmDouble zmin=xyz_list[0][2]; for(i=1;i<NUMVERTICESQUA;i++) if(xyz_list[i][2]<zmin) zmin=xyz_list[i][2];
++	if(zmax>0 && zmin<0) gauss=new GaussPenta(index1,index2,index3,index4,3,10); //refined in vertical because of the sea level discontinuity
++	else                 gauss=new GaussPenta(index1,index2,index3,index4,3,3);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		penta->GetQuadNodalFunctions(l1l4,gauss,index1,index2,index3,index4);
++		penta->GetQuadJacobianDeterminant(&Jdet,xyz_list,gauss);
++		z_g=penta->GetZcoord(gauss);
++		surface_input->GetInputValue(&surface,gauss);
++
++		switch(fill){
++			case WaterEnum:
++				water_pressure=rho_water*gravity*min(0.,z_g);//0 if the gaussian point is above water level
++				break;
++			case AirEnum:
++				water_pressure=0;
++				break;
++			default:
++				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
++		}
++		ice_pressure=rho_ice*gravity*(surface-z_g);
++		air_pressure=0;
++		pressure = ice_pressure + water_pressure + air_pressure;
++
++		for(i=0;i<NUMVERTICESQUA;i++) for(j=0;j<NDOF2;j++) pe->values[i*NDOF2+j]+=Jdet*gauss->weight*pressure*l1l4[i]*normal[j];
++	}
++
++	/*Transform load vector*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICESQUA,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Icefront::CreatePVectorDiagnosticStokes{{{*/
++ElementVector* Icefront::CreatePVectorDiagnosticStokes(void){
++
++	/*Constants*/
++	const int numdofs = NUMVERTICESQUA *NDOF4;
++
++	/*Intermediaries*/
++	int         i,j,ig,index1,index2,index3,index4;
++	int         fill;
++	IssmDouble      pressure,rho_water,gravity;
++	IssmDouble      water_pressure,air_pressure;
++	IssmDouble      Jdet,z_g;
++	IssmDouble      xyz_list[NUMVERTICESQUA][3];
++	IssmDouble      normal[3];
++	IssmDouble      l1l4[4];
++	GaussPenta *gauss = NULL;
++
++	Penta* penta=(Penta*)element;
++
++	/*Initialize Element vector and return if necessary*/
++	if(penta->IsOnWater()) return NULL;
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICESQUA,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICESQUA);
++	inputs->GetInputValue(&fill,FillEnum);
++	rho_water=matpar->GetRhoWater();
++	gravity  =matpar->GetG();
++	GetQuadNormal(&normal[0],xyz_list);
++
++	/*Identify which nodes are in the quad: */
++	index1=element->GetNodeIndex(nodes[0]);
++	index2=element->GetNodeIndex(nodes[1]);
++	index3=element->GetNodeIndex(nodes[2]);
++	index4=element->GetNodeIndex(nodes[3]);
++
++	/* Start  looping on the number of gaussian points: */
++	IssmDouble zmax=xyz_list[0][2]; for(i=1;i<NUMVERTICESQUA;i++) if(xyz_list[i][2]>zmax) zmax=xyz_list[i][2];
++	IssmDouble zmin=xyz_list[0][2]; for(i=1;i<NUMVERTICESQUA;i++) if(xyz_list[i][2]<zmin) zmin=xyz_list[i][2];
++	if(zmax>0 && zmin<0) gauss=new GaussPenta(index1,index2,index3,index4,3,30); //refined in vertical because of the sea level discontinuity
++	else                 gauss=new GaussPenta(index1,index2,index3,index4,3,3);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		penta->GetQuadNodalFunctions(l1l4,gauss,index1,index2,index3,index4);
++		penta->GetQuadJacobianDeterminant(&Jdet,xyz_list,gauss);
++		z_g=penta->GetZcoord(gauss);
++
++		switch(fill){
++			case WaterEnum:
++				water_pressure=rho_water*gravity*min(0.,z_g);//0 if the gaussian point is above water level
++				break;
++			case AirEnum:
++				water_pressure=0;
++				break;
++			default:
++				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
++		}
++		air_pressure=0;
++		pressure = water_pressure + air_pressure; //no ice pressure fore Stokes
++
++		for(i=0;i<NUMVERTICESQUA;i++){
++			for(j=0;j<NDOF4;j++){
++				if(j<3)  pe->values[i*NDOF4+j]+=Jdet*gauss->weight*pressure*l1l4[i]*normal[j];
++				else     pe->values[i*NDOF4+j]+=0; //pressure term
++			}
++		}
++	}
++
++	/*Transform load vector*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICESQUA,XYZPEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++#endif
++/*FUNCTION Icefront::GetDofList {{{*/
++void  Icefront::GetDofList(int** pdoflist,int approximation_enum,int setenum){
++
++	int i,j;
++	int numberofdofs=0;
++	int count=0;
++	int type;
++	int numberofnodes=2;
++
++	/*output: */
++	int* doflist=NULL;
++
++	
++	/*recover type: */
++	inputs->GetInputValue(&type,TypeEnum);
++
++	/*Some checks for debugging*/
++	_assert_(nodes);
++		
++	/*How many nodes? :*/
++	if(type==MacAyeal2dIceFrontEnum || type==MacAyeal3dIceFrontEnum)
++	 numberofnodes=2;
++	else 
++	 numberofnodes=4;
++	
++	/*Figure out size of doflist: */
++	for(i=0;i<numberofnodes;i++){
++		numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
++	}
++
++	/*Allocate: */
++	doflist=xNew<int>(numberofdofs);
++
++	/*Populate: */
++	count=0;
++	for(i=0;i<numberofnodes;i++){
++		nodes[i]->GetDofList(doflist+count,approximation_enum,setenum);
++		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
++	}
++
++	/*Assign output pointers:*/
++	*pdoflist=doflist;
++}
++/*}}}*/
++/*FUNCTION Icefront::GetSegmentNormal {{{*/
++void Icefront:: GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]){
++
++	/*Build unit outward pointing vector*/
++	const int numnodes=NUMVERTICESSEG;
++	IssmDouble vector[2];
++	IssmDouble norm;
++
++	vector[0]=xyz_list[1][0] - xyz_list[0][0];
++	vector[1]=xyz_list[1][1] - xyz_list[0][1];
++
++	norm=sqrt(pow(vector[0],2.0)+pow(vector[1],2.0));
++
++	normal[0]= + vector[1]/norm;
++	normal[1]= - vector[0]/norm;
++}
++/*}}}*/
++/*FUNCTION Icefront::GetQuadNormal {{{*/
++void Icefront:: GetQuadNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]){
++
++	/*Build unit outward pointing vector*/
++	IssmDouble AB[3];
++	IssmDouble AC[3];
++	IssmDouble norm;
++
++	AB[0]=xyz_list[1][0] - xyz_list[0][0];
++	AB[1]=xyz_list[1][1] - xyz_list[0][1];
++	AB[2]=xyz_list[1][2] - xyz_list[0][2];
++	AC[0]=xyz_list[2][0] - xyz_list[0][0];
++	AC[1]=xyz_list[2][1] - xyz_list[0][1];
++	AC[2]=xyz_list[2][2] - xyz_list[0][2];
++
++	cross(normal,AB,AC);
++	norm=sqrt(pow(normal[0],2.0)+pow(normal[1],2.0)+pow(normal[2],2.0));
++
++	for(int i=0;i<3;i++) normal[i]=normal[i]/norm;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.cpp	(revision 12822)
+@@ -0,0 +1,334 @@
++/*!\file Friction.c
++ * \brief: implementation of the Friction object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../Container/Container.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++/*}}}*/	
++
++/*Constructors/destructors*/
++/*FUNCTION Friction::Friction() {{{*/
++Friction::Friction(){
++	this->element_type=NULL;
++	this->inputs=NULL;
++	this->matpar=NULL;
++}
++/*}}}*/
++/*FUNCTION Friction::Friction(const char* element_type, Inputs* inputs,Matpar* matpar,int analysis_type){{{*/
++Friction::Friction(const char* element_type_in,Inputs* inputs_in,Matpar* matpar_in, int in_analysis_type){
++
++	this->analysis_type=in_analysis_type;
++	this->inputs=inputs_in;
++	this->element_type=xNew<char>(strlen(element_type_in)+1);
++	xMemCpy<char>(this->element_type,element_type_in,(strlen(element_type_in)+1));
++
++	this->matpar=matpar_in;
++}
++/*}}}*/
++/*FUNCTION Friction::~Friction() {{{*/
++Friction::~Friction(){
++	xDelete<char>(element_type);
++}
++/*}}}*/
++
++/*methods: */
++/*FUNCTION Friction::Echo {{{*/
++void Friction::Echo(void){
++	_printLine_("Friction:");
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	_printLine_("   element_type: " << this->element_type);
++	inputs->Echo();
++	matpar->Echo();
++}
++/*}}}*/
++/*FUNCTION Friction::GetAlpha2(IssmDouble* palpha2, GaussTria* gauss,int vxenum,int vyenum,int vzenum){{{*/
++void Friction::GetAlpha2(IssmDouble* palpha2, GaussTria* gauss,int vxenum,int vyenum,int vzenum){
++
++	/*This routine calculates the basal friction coefficient 
++	  alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p**/
++
++	/*diverse: */
++	IssmDouble  r,s;
++	IssmDouble  drag_p, drag_q;
++	IssmDouble  gravity,rho_ice,rho_water;
++	IssmDouble  Neff;
++	IssmDouble  thickness,bed;
++	IssmDouble  vx,vy,vz,vmag;
++	IssmDouble  drag_coefficient;
++	IssmDouble  alpha2;
++
++	/*Recover parameters: */
++	inputs->GetInputValue(&drag_p,FrictionPEnum);
++	inputs->GetInputValue(&drag_q,FrictionQEnum);
++	this->GetInputValue(&thickness, gauss,ThicknessEnum);
++	this->GetInputValue(&bed, gauss,BedEnum);
++	this->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
++
++	/*Get material parameters: */
++	gravity=matpar->GetG();
++	rho_ice=matpar->GetRhoIce();
++	rho_water=matpar->GetRhoWater();
++
++	//compute r and q coefficients: */
++	r=drag_q/drag_p;
++	s=1./drag_p;
++
++	//From bed and thickness, compute effective pressure when drag is viscous:
++	Neff=gravity*(rho_ice*thickness+rho_water*bed);
++
++	/*If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
++	  the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
++	  for friction should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
++	  replace it by Neff=0 (ie, equival it to an ice shelf)*/
++	if (Neff<0)Neff=0;
++
++	if(strcmp(element_type,"2d")==0){
++		this->GetInputValue(&vx, gauss,vxenum);
++		this->GetInputValue(&vy, gauss,vyenum);
++		vmag=sqrt(pow(vx,2)+pow(vy,2));
++	}
++	else if (strcmp(element_type,"3d")==0){
++		this->GetInputValue(&vx, gauss,vxenum);
++		this->GetInputValue(&vy, gauss,vyenum);
++		this->GetInputValue(&vz, gauss,vzenum);
++		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
++	}
++	else _error2_("element_type "<< element_type << " not supported yet");
++
++	/*Checks that s-1>0 if v=0*/
++        if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
++
++	alpha2=pow(drag_coefficient,2)*pow(Neff,r)*pow(vmag,(s-1));
++	_assert_(!xIsNan<IssmDouble>(alpha2));
++
++	/*Assign output pointers:*/
++	*palpha2=alpha2;
++}
++/*}}}*/
++/*FUNCTION Friction::GetAlpha2(IssmDouble* palpha2, GaussPenta* gauss,int vxenum,int vyenum,int vzenum){{{*/
++void Friction::GetAlpha2(IssmDouble* palpha2, GaussPenta* gauss,int vxenum,int vyenum,int vzenum){
++
++	/*This routine calculates the basal friction coefficient 
++	  alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p**/
++
++	/*diverse: */
++	IssmDouble  r,s;
++	IssmDouble  drag_p, drag_q;
++	IssmDouble  gravity,rho_ice,rho_water;
++	IssmDouble  Neff;
++	IssmDouble  thickness,bed;
++	IssmDouble  vx,vy,vz,vmag;
++	IssmDouble  drag_coefficient;
++	IssmDouble  alpha2;
++
++	/*Recover parameters: */
++	inputs->GetInputValue(&drag_p,FrictionPEnum);
++	inputs->GetInputValue(&drag_q,FrictionQEnum);
++	this->GetInputValue(&thickness, gauss,ThicknessEnum);
++	this->GetInputValue(&bed, gauss,BedEnum);
++	this->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
++
++	/*Get material parameters: */
++	gravity=matpar->GetG();
++	rho_ice=matpar->GetRhoIce();
++	rho_water=matpar->GetRhoWater();
++
++	//compute r and q coefficients: */
++	r=drag_q/drag_p;
++	s=1./drag_p;
++
++	//From bed and thickness, compute effective pressure when drag is viscous:
++	Neff=gravity*(rho_ice*thickness+rho_water*bed);
++
++	/*If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
++	  the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
++	  for friction should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
++	  replace it by Neff=0 (ie, equival it to an ice shelf)*/
++	if (Neff<0)Neff=0;
++
++	if(strcmp(element_type,"2d")==0){
++		this->GetInputValue(&vx, gauss,vxenum);
++		this->GetInputValue(&vy, gauss,vyenum);
++		vmag=sqrt(pow(vx,2)+pow(vy,2));
++	}
++	else if (strcmp(element_type,"3d")==0){
++		this->GetInputValue(&vx, gauss,vxenum);
++		this->GetInputValue(&vy, gauss,vyenum);
++		this->GetInputValue(&vz, gauss,vzenum);
++		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
++	}
++	else _error2_("element_type "<< element_type << " not supported yet");
++
++	/*Checks that s-1>0 if v=0*/
++	if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
++
++	alpha2=pow(drag_coefficient,2)*pow(Neff,r)*pow(vmag,(s-1));
++	_assert_(!xIsNan<IssmDouble>(alpha2));
++
++	/*Assign output pointers:*/
++	*palpha2=alpha2;
++}
++/*}}}*/
++/*FUNCTION Friction::GetAlphaComplement(IssmDouble* palpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum) {{{*/
++void Friction::GetAlphaComplement(IssmDouble* palpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum){
++
++	/* 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: 
++	 * alpha_complement= Neff ^r * vel ^s*/
++
++	/*diverse: */
++	int     i;
++	IssmDouble  r,s;
++	IssmDouble  vx,vy,vz,vmag;
++	IssmDouble  drag_p,drag_q;
++	IssmDouble  Neff;
++	IssmDouble  drag_coefficient;
++	IssmDouble  bed,thickness;
++	IssmDouble  gravity,rho_ice,rho_water;
++	IssmDouble  alpha_complement;
++
++	/*Recover parameters: */
++	inputs->GetInputValue(&drag_p,FrictionPEnum);
++	inputs->GetInputValue(&drag_q,FrictionQEnum);
++	this->GetInputValue(&thickness, gauss,ThicknessEnum);
++	this->GetInputValue(&bed, gauss,BedEnum);
++	this->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
++
++	/*Get material parameters: */
++	gravity=matpar->GetG();
++	rho_ice=matpar->GetRhoIce();
++	rho_water=matpar->GetRhoWater();
++
++	//compute r and q coefficients: */
++	r=drag_q/drag_p;
++	s=1./drag_p;
++
++	//From bed and thickness, compute effective pressure when drag is viscous:
++	Neff=gravity*(rho_ice*thickness+rho_water*bed);
++
++	/*If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
++	  the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
++	  for friction should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
++	  replace it by Neff=0 (ie, equival it to an ice shelf)*/
++	if (Neff<0)Neff=0;
++
++	//We need the velocity magnitude to evaluate the basal stress:
++	if(strcmp(element_type,"2d")==0){
++		this->GetInputValue(&vx, gauss,vxenum);
++		this->GetInputValue(&vy, gauss,vyenum);
++		vmag=sqrt(pow(vx,2)+pow(vy,2));
++	}
++	else if (strcmp(element_type,"3d")==0){
++		this->GetInputValue(&vx, gauss,vxenum);
++		this->GetInputValue(&vy, gauss,vyenum);
++		this->GetInputValue(&vz, gauss,vzenum);
++		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
++	}
++	else _error2_("element_type "<< element_type << " not supported yet");
++
++	/*Checks that s-1>0 if v=0*/
++	if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
++
++	alpha_complement=pow(Neff,r)*pow(vmag,(s-1));            _assert_(!xIsNan<IssmDouble>(alpha_complement));
++
++	/*Assign output pointers:*/
++	*palpha_complement=alpha_complement;
++}
++/*}}}*/
++/*FUNCTION Friction::GetAlphaComplement(IssmDouble* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum) {{{*/
++void Friction::GetAlphaComplement(IssmDouble* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum){
++
++	/* 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: 
++	 * alpha_complement= Neff ^r * vel ^s*/
++
++	/*diverse: */
++	int     i;
++	IssmDouble  r,s;
++	IssmDouble  vx,vy,vz,vmag;
++	IssmDouble  drag_p,drag_q;
++	IssmDouble  Neff;
++	IssmDouble  drag_coefficient;
++	IssmDouble  bed,thickness;
++	IssmDouble  gravity,rho_ice,rho_water;
++	IssmDouble  alpha_complement;
++
++	/*Recover parameters: */
++	inputs->GetInputValue(&drag_p,FrictionPEnum);
++	inputs->GetInputValue(&drag_q,FrictionQEnum);
++	this->GetInputValue(&thickness, gauss,ThicknessEnum);
++	this->GetInputValue(&bed, gauss,BedEnum);
++	this->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
++
++	/*Get material parameters: */
++	gravity=matpar->GetG();
++	rho_ice=matpar->GetRhoIce();
++	rho_water=matpar->GetRhoWater();
++
++	//compute r and q coefficients: */
++	r=drag_q/drag_p;
++	s=1./drag_p;
++
++	//From bed and thickness, compute effective pressure when drag is viscous:
++	Neff=gravity*(rho_ice*thickness+rho_water*bed);
++
++	/*If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
++	  the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
++	  for friction should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
++	  replace it by Neff=0 (ie, equival it to an ice shelf)*/
++	if (Neff<0)Neff=0;
++
++	//We need the velocity magnitude to evaluate the basal stress:
++	if(strcmp(element_type,"2d")==0){
++		this->GetInputValue(&vx, gauss,vxenum);
++		this->GetInputValue(&vy, gauss,vyenum);
++		vmag=sqrt(pow(vx,2)+pow(vy,2));
++	}
++	else if (strcmp(element_type,"3d")==0){
++		this->GetInputValue(&vx, gauss,vxenum);
++		this->GetInputValue(&vy, gauss,vyenum);
++		this->GetInputValue(&vz, gauss,vzenum);
++		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
++	}
++	else _error2_("element_type "<< element_type << " not supported yet");
++
++	/*Checks that s-1>0 if v=0*/
++	if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
++
++	alpha_complement=pow(Neff,r)*pow(vmag,(s-1));            _assert_(!xIsNan<IssmDouble>(alpha_complement));
++
++	/*Assign output pointers:*/
++	*palpha_complement=alpha_complement;
++}
++/*}}}*/
++/*FUNCTION Friction::GetInputValue{{{*/
++void Friction::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int enum_type){
++
++	Input* input=inputs->GetInput(enum_type);
++	if(!input) _error2_("input " << EnumToStringx(enum_type) << " not found");
++	input->GetInputValue(pvalue,gauss);
++
++}
++/*}}}*/
++/*FUNCTION Friction::GetInputValue{{{*/
++void Friction::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int enum_type){
++
++	Input* input=inputs->GetInput(enum_type);
++	if(!input) _error2_("input " << EnumToStringx(enum_type) << " not found");
++	input->GetInputValue(pvalue,gauss);
++
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.h	(revision 12822)
+@@ -0,0 +1,100 @@
++/*!\file Pengrid.h
++ * \brief: header file for pengrid object */
++
++#ifndef _PENGRID_H_
++#define _PENGRID_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Load.h"
++class Hook;
++class Inputs;
++class Parameters;
++class IoModel;
++/*}}}*/
++
++class Pengrid: public Load{
++
++	private: 
++
++		int		id;
++		int analysis_type;
++		
++		/*Hooks*/
++		Hook* hnode;  //hook to 1 node
++		Hook* helement;  //hook to 1 element
++		Hook* hmatpar; //hook to 1 matpar
++
++		/*Corresponding fields*/
++		Node    *node;
++		Element *element;
++		Matpar  *matpar;
++
++		Parameters* parameters; //pointer to solution parameters
++		Inputs*  inputs;
++	
++		/*internals: */
++		int active;
++		int zigzag_counter;
++
++	public:
++
++		/*Pengrid constructors, destructors {{{*/
++		Pengrid();
++		Pengrid(int index, int id, IoModel* iomodel,int analysis_type);
++		~Pengrid();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Update virtual functions resolution: {{{*/
++		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVector(int* vector, int name, int type);
++		void  InputUpdateFromVector(bool* vector, int name, int type);
++		void  InputUpdateFromMatrixDakota(IssmDouble* matrix ,int nrows, int ncols, int name, int type);
++		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
++		void  InputUpdateFromConstant(IssmDouble constant, int name);
++		void  InputUpdateFromConstant(int constant, int name);
++		void  InputUpdateFromConstant(bool constant, int name);
++		void  InputUpdateFromSolution(IssmDouble* solution);
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		/*}}}*/
++		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
++		void  CreatePVector(Vector* pf);
++		void  CreateJacobianMatrix(Matrix* Jff){_error2_("Not implemented yet");};
++		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error2_("Not implemented yet");};
++		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
++		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
++		bool  InAnalysis(int analysis_type);
++		/*}}}*/
++		/*Pengrid management {{{*/
++		#ifdef _HAVE_DIAGNOSTIC_
++		ElementMatrix* PenaltyCreateKMatrixDiagnosticStokes(IssmDouble kmax);
++		#endif
++		#ifdef _HAVE_THERMAL_
++		ElementMatrix* PenaltyCreateKMatrixThermal(IssmDouble kmax);
++		ElementMatrix* PenaltyCreateKMatrixMelting(IssmDouble kmax);
++		ElementVector* PenaltyCreatePVectorThermal(IssmDouble kmax);
++		ElementVector* PenaltyCreatePVectorMelting(IssmDouble kmax);
++		#endif
++		void  ConstraintActivate(int* punstable);
++		void  ConstraintActivateThermal(int* punstable);
++		void  UpdateInputs(IssmDouble* solution);
++		void  ResetConstraint(void);
++		/*}}}*/
++
++};
++
++#endif  /* _PENGRID_H_ */
++
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp	(revision 12822)
+@@ -0,0 +1,916 @@
++/*!\file Riftfront.cpp
++ * \brief: implementation of the Riftfront object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../modules/ModelProcessorx/ModelProcessorx.h"
++#include "../objects.h"
++/*}}}*/
++
++/*Element macros*/
++#define NUMVERTICES 2
++
++/*Riftfront constructors and destructor*/
++/*FUNCTION Riftfront::Riftfront(){{{*/
++Riftfront::Riftfront(){
++	this->inputs=NULL;
++	this->parameters=NULL;
++	this->hnodes=NULL;
++	this->helements=NULL;
++	this->hmatpar=NULL;
++	this->nodes=NULL;
++	this->elements=NULL;
++	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){
++
++	/*data: */
++	int    riftfront_node_ids[2];
++	int    riftfront_elem_ids[2];
++	int    riftfront_matpar_id;
++	int    riftfront_type;
++	int    riftfront_fill;
++	IssmDouble riftfront_friction;
++	IssmDouble riftfront_fractionincrement;
++	bool   riftfront_shelf;
++	int    numberofelements;
++	int    penalty_lock;
++
++	/*intermediary: */
++	int el1    ,el2;
++	int node1  ,node2;
++
++	/*Fetch parameters: */
++	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
++	iomodel->Constant(&penalty_lock,DiagnosticRiftPenaltyLockEnum);
++
++	/*Ok, retrieve all the data needed to add a penalty between the two nodes: */
++	el1=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+2);
++	el2=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+3); 
++
++	node1=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+0); 
++	node2=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+1);
++
++	/*id: */
++	this->id=riftfront_id;
++	this->analysis_type=riftfront_analysis_type;
++
++	/*hooks: */
++	riftfront_node_ids[0]=iomodel->nodecounter+node1;
++	riftfront_node_ids[1]=iomodel->nodecounter+node2;
++	riftfront_elem_ids[0]=el1;
++	riftfront_elem_ids[1]=el2;
++	riftfront_matpar_id=numberofelements+1; //matlab indexing
++
++	/*Hooks: */
++	this->hnodes=new Hook(riftfront_node_ids,2);
++	this->helements=new Hook(riftfront_elem_ids,2);
++	this->hmatpar=new Hook(&riftfront_matpar_id,1);
++
++	/*computational parameters: */
++	this->active=0;
++	this->frozen=0;
++	this->counter=0;
++	this->prestable=0;
++	this->penalty_lock=penalty_lock;
++	this->material_converged=0;
++	this->normal[0]=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+4);
++	this->normal[1]=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+5);
++	this->length=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+6);
++	this->fraction=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+9);
++	this->state=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+11);
++
++	//intialize inputs, and add as many inputs per element as requested: 
++	this->inputs=new Inputs();
++		
++	riftfront_type=SegmentRiftfrontEnum;
++	riftfront_fill = (int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+7);
++	riftfront_friction=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+8);
++	riftfront_fractionincrement=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+10);
++	riftfront_shelf=(bool)iomodel->Data(MaskVertexonfloatingiceEnum)[node1-1];
++
++	this->inputs->AddInput(new IntInput(TypeEnum,riftfront_type));
++	this->inputs->AddInput(new IntInput(FillEnum,riftfront_fill));
++	this->inputs->AddInput(new DoubleInput(FrictionEnum,riftfront_friction));
++	this->inputs->AddInput(new DoubleInput(FractionIncrementEnum,riftfront_fractionincrement));
++	this->inputs->AddInput(new BoolInput(SegmentOnIceShelfEnum,riftfront_shelf));
++	
++	//parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
++	this->parameters=NULL;
++	this->nodes= NULL;
++	this->elements= NULL;
++	this->matpar= NULL;
++		
++}
++/*}}}*/
++/*FUNCTION Riftfront::~Riftfront(){{{*/
++Riftfront::~Riftfront(){
++	delete inputs;
++	this->parameters=NULL;
++
++	delete hnodes;
++	delete helements;
++	delete hmatpar;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Riftfront::Echo {{{*/
++void Riftfront::Echo(void){
++
++	Input* input=NULL;
++	int fill;
++	IssmDouble friction,fractionincrement;
++
++	
++	/*recover some inputs first: */
++	input=(Input*)this->inputs->GetInput(FillEnum); input->GetInputValue(&fill);
++	input=(Input*)this->inputs->GetInput(FrictionEnum); input->GetInputValue(&friction);
++	input=(Input*)this->inputs->GetInput(FractionIncrementEnum); input->GetInputValue(&fractionincrement);
++
++	_printLine_("Riftfront:");
++	_printLine_("   id: " << id);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	_printLine_("   hnodes: " << hnodes);
++	_printLine_("   helements: " << helements);
++	_printLine_("   hmatpar: " << hmatpar);
++	_printLine_("   parameters: " << parameters);
++	_printLine_("   inputs: " << inputs);
++	_printLine_("   internal parameters: ");
++	_printLine_("   normal: " << normal[0] << "|" << normal[1]);
++	_printLine_("   length: " << length);
++	_printLine_("   penalty_lock: " << penalty_lock);
++	_printLine_("   active: " <<(active ? "true":"false"));
++	_printLine_("   counter: " << counter);
++	_printLine_("   prestable: " << (prestable ? "true":"false"));
++	_printLine_("   material_converged: " << (material_converged ? "true":"false"));
++	_printLine_("   fill: " << fill);
++	_printLine_("   friction: " << friction);
++	_printLine_("   fraction: " << fraction);
++	_printLine_("   fractionincrement: " << fractionincrement);
++	_printLine_("   state: " << state);
++	_printLine_("   frozen: " << (frozen ? "true":"false"));
++		
++}
++/*}}}*/
++/*FUNCTION Riftfront::DeepEcho{{{*/
++void Riftfront::DeepEcho(void){
++
++	_printLine_("Riftfront:");
++	_printLine_("   id: " << id);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	hnodes->DeepEcho();
++	helements->DeepEcho();
++	hmatpar->DeepEcho();
++	_printLine_("   parameters");
++	if(parameters)parameters->DeepEcho();
++	_printLine_("   inputs");
++	if(inputs)inputs->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION Riftfront::Id {{{*/
++int    Riftfront::Id(void){ return id; }
++/*}}}*/
++/*FUNCTION Riftfront::MyRank {{{*/
++int    Riftfront::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Riftfront::ObjectEnum{{{*/
++int Riftfront::ObjectEnum(void){
++
++	return RiftfrontEnum;
++
++}
++/*}}}*/
++/*FUNCTION Riftfront::copy {{{*/
++Object* Riftfront::copy() {
++	
++	Riftfront* riftfront=NULL;
++
++	riftfront=new Riftfront();
++
++	/*copy fields: */
++	riftfront->id=this->id;
++	riftfront->analysis_type=this->analysis_type;
++	if(this->inputs){
++		riftfront->inputs=(Inputs*)this->inputs->Copy();
++	}
++	else{
++		riftfront->inputs=new Inputs();
++	}
++	/*point parameters: */
++	riftfront->parameters=this->parameters;
++
++	/*now deal with hooks and objects: */
++	riftfront->hnodes=(Hook*)this->hnodes->copy();
++	riftfront->helements=(Hook*)this->helements->copy();
++	riftfront->hmatpar=(Hook*)this->hmatpar->copy();
++
++	/*corresponding fields*/
++	riftfront->nodes   =(Node**)riftfront->hnodes->deliverp();
++	riftfront->elements=(Element**)riftfront->helements->deliverp();
++	riftfront->matpar  =(Matpar*)riftfront->hmatpar->delivers();
++
++	/*internal data: */
++	riftfront->penalty_lock=this->penalty_lock;
++	riftfront->active=this->active;
++	riftfront->frozen=this->frozen;
++	riftfront->state=this->state;
++	riftfront->counter=this->counter;
++	riftfront->prestable=this->prestable;
++	riftfront->material_converged=this->material_converged;
++	riftfront->normal[0]=this->normal[0];
++	riftfront->normal[1]=this->normal[1];
++	riftfront->length=this->length;
++	riftfront->fraction=this->fraction;
++	
++	return riftfront;
++
++}
++/*}}}*/
++		
++/*Update virtual functions definitions:*/
++/*FUNCTION Riftfront::InputUpdateFromConstant(bool constant,int name) {{{*/
++void  Riftfront::InputUpdateFromConstant(bool constant,int name){
++
++	/*Check that name is a Riftfront input*/
++	if (!IsInput(name)) return;
++
++	/*update input*/
++	this->inputs->AddInput(new BoolInput(name,constant));
++
++}
++/*}}}*/
++/*FUNCTION Riftfront::InputUpdateFromConstant(IssmDouble constant,int name) {{{*/
++void  Riftfront::InputUpdateFromConstant(IssmDouble constant,int name){
++
++	/*Check that name is a Riftfront input*/
++	if (!IsInput(name)) return;
++
++	/*update input*/
++	this->inputs->AddInput(new DoubleInput(name,constant));
++
++}
++/*}}}*/
++/*FUNCTION Riftfront::InputUpdateFromConstant(IssmDouble* constant,int name) {{{*/
++void    Riftfront::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++
++	/*Check that name is a Riftfront input*/
++	if (!IsInput(name)) return;
++
++	/*update input*/
++	_error2_("not implemented yet");
++	//this->inputs->AddInput(new DoubleInput(name,constant));
++
++}
++/*}}}*/
++
++
++/*Load virtual functions definitions:*/
++/*FUNCTION Riftfront::Configure {{{*/
++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: */
++	hnodes->configure(nodesin);
++	helements->configure(elementsin);
++	hmatpar->configure(materialsin);
++
++	/*Initialize hooked fields*/
++	this->nodes   =(Node**)hnodes->deliverp();
++	this->elements=(Element**)helements->deliverp();
++	this->matpar  =(Matpar*)hmatpar->delivers();
++
++	/*point parameters to real dataset: */
++	this->parameters=parametersin;
++
++}
++/*}}}*/
++/*FUNCTION Riftfront::SetCurrentConfiguration {{{*/
++void  Riftfront::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++
++}
++/*}}}*/
++/*FUNCTION Riftfront::PenaltyCreateKMatrix {{{*/
++void  Riftfront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
++
++	/*Retrieve parameters: */
++	ElementMatrix* Ke=NULL;
++	int analysis_type;
++	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	switch(analysis_type){
++		case DiagnosticHorizAnalysisEnum:
++			Ke=PenaltyCreateKMatrixDiagnosticHoriz(kmax);
++			break;
++		case AdjointHorizAnalysisEnum:
++			Ke=PenaltyCreateKMatrixDiagnosticHoriz(kmax);
++			break;
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global Vector*/
++	if(Ke){
++		Ke->AddToGlobal(Kff,Kfs);
++		delete Ke;
++	}
++}
++/*}}}*/
++/*FUNCTION Riftfront::PenaltyCreatePVector {{{*/
++void  Riftfront::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
++
++	/*Retrieve parameters: */
++	ElementVector* pe=NULL;
++	int analysis_type;
++	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	switch(analysis_type){
++		case DiagnosticHorizAnalysisEnum:
++			pe=PenaltyCreatePVectorDiagnosticHoriz(kmax);
++			break;
++		case AdjointHorizAnalysisEnum:
++			/*No penalty applied on load vector*/
++			break;
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global Vector*/
++	if(pe){
++		pe->AddToGlobal(pf);
++		delete pe;
++	}
++}
++/*}}}*/
++/*FUNCTION Riftfront::CreateKMatrix {{{*/
++void  Riftfront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
++	/*do nothing: */
++	return;
++}
++/*}}}*/
++/*FUNCTION Riftfront::CreatePVector {{{*/
++void  Riftfront::CreatePVector(Vector* pf){
++	/*do nothing: */
++	return;
++}
++/*}}}*/
++/*FUNCTION Riftfront::InAnalysis{{{*/
++bool Riftfront::InAnalysis(int in_analysis_type){
++	if (in_analysis_type==this->analysis_type) return true;
++	else return false;
++}
++/*}}}*/
++
++/*Riftfront numerics*/
++/*FUNCTION Riftfront::PenaltyCreateKMatrixDiagnosticHoriz {{{*/
++ElementMatrix* Riftfront::PenaltyCreateKMatrixDiagnosticHoriz(IssmDouble kmax){
++
++	const int   numdof = NDOF2*NUMVERTICES;
++	int         i,j;
++	int         dofs[1]             = {0};
++	IssmDouble      Ke_gg[4][4];
++	IssmDouble      thickness;
++	IssmDouble      h[2];
++	IssmDouble      penalty_offset;
++	IssmDouble      friction;
++
++	/*Objects: */
++	Tria       *tria1               = NULL;
++	Tria       *tria2               = NULL;
++
++	/*enum of element? */
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++	tria1=(Tria*)elements[0];
++	tria2=(Tria*)elements[1];
++
++	/*Initialize Element Matrix*/
++	if(!this->active) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
++
++	/*Get some parameters: */
++	this->parameters->FindParam(&penalty_offset,DiagnosticPenaltyFactorEnum);
++	this->inputs->GetInputValue(&friction,FrictionEnum);
++	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
++	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
++	if (h[0]!=h[1])_error2_("different thicknesses not supported for rift fronts");
++	thickness=h[0];
++
++	/*There is contact, we need to constrain the normal velocities (zero penetration), and the 
++	 *contact slip friction. */
++
++	/*From Peter Wriggers book (Computational Contact Mechanics, p191): */
++	Ke->values[0*numdof+0]+= +pow(normal[0],2)*kmax*pow(10,penalty_offset);
++	Ke->values[0*numdof+1]+= +normal[0]*normal[1]*kmax*pow(10,penalty_offset);
++	Ke->values[0*numdof+2]+= -pow(normal[0],2)*kmax*pow(10,penalty_offset);
++	Ke->values[0*numdof+3]+= -normal[0]*normal[1]*kmax*pow(10,penalty_offset);
++
++	Ke->values[1*numdof+0]+= +normal[0]*normal[1]*kmax*pow(10,penalty_offset);
++	Ke->values[1*numdof+1]+= +pow(normal[1],2)*kmax*pow(10,penalty_offset);
++	Ke->values[1*numdof+2]+= -normal[0]*normal[1]*kmax*pow(10,penalty_offset);
++	Ke->values[1*numdof+3]+= -pow(normal[1],2)*kmax*pow(10,penalty_offset);
++
++	Ke->values[2*numdof+0]+= -pow(normal[0],2)*kmax*pow(10,penalty_offset);
++	Ke->values[2*numdof+1]+= -normal[0]*normal[1]*kmax*pow(10,penalty_offset);
++	Ke->values[2*numdof+2]+= +pow(normal[0],2)*kmax*pow(10,penalty_offset);
++	Ke->values[2*numdof+3]+= +normal[0]*normal[1]*kmax*pow(10,penalty_offset);
++
++	Ke->values[3*numdof+0]+= -normal[0]*normal[1]*kmax*pow(10,penalty_offset);
++	Ke->values[3*numdof+1]+= -pow(normal[1],2)*kmax*pow(10,penalty_offset);
++	Ke->values[3*numdof+2]+= +normal[0]*normal[1]*kmax*pow(10,penalty_offset);
++	Ke->values[3*numdof+3]+= +pow(normal[1],2)*kmax*pow(10,penalty_offset);
++
++	/*Now take care of the friction: of type sigma=frictiontangent_velocity2-tangent_velocity1)*/
++
++	Ke->values[0*numdof+0]+= +pow(normal[1],2)*thickness*length*friction;
++	Ke->values[0*numdof+1]+= -normal[0]*normal[1]*thickness*length*friction;
++	Ke->values[0*numdof+2]+= -pow(normal[1],2)*thickness*length*friction;
++	Ke->values[0*numdof+3]+= +normal[0]*normal[1]*thickness*length*friction;
++
++	Ke->values[1*numdof+0]+= -normal[0]*normal[1]*thickness*length*friction;
++	Ke->values[1*numdof+1]+= +pow(normal[0],2)*thickness*length*friction;
++	Ke->values[1*numdof+2]+= +normal[0]*normal[1]*thickness*length*friction;
++	Ke->values[1*numdof+3]+= -pow(normal[0],2)*thickness*length*friction;
++
++	Ke->values[2*numdof+0]+= -pow(normal[1],2)*thickness*length*friction;
++	Ke->values[2*numdof+1]+= +normal[0]*normal[1]*thickness*length*friction;
++	Ke->values[2*numdof+2]+= +pow(normal[1],2)*thickness*length*friction;
++	Ke->values[2*numdof+3]+= -normal[0]*normal[1]*thickness*length*friction;
++
++	Ke->values[3*numdof+0]+= +normal[0]*normal[1]*thickness*length*friction;
++	Ke->values[3*numdof+1]+= -pow(normal[0],2)*thickness*length*friction;
++	Ke->values[3*numdof+2]+= -normal[0]*normal[1]*thickness*length*friction;
++	Ke->values[3*numdof+3]+= +pow(normal[0],2)*thickness*length*friction;
++
++	/*Clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Riftfront::PenaltyCreatePVectorDiagnosticHoriz {{{*/
++ElementVector* Riftfront::PenaltyCreatePVectorDiagnosticHoriz(IssmDouble kmax){
++
++	const int   numdof = NDOF2*NUMVERTICES;
++	int         i,j;
++	IssmDouble      rho_ice;
++	IssmDouble      rho_water;
++	IssmDouble      gravity;
++	IssmDouble      thickness;
++	IssmDouble      h[2];
++	IssmDouble      bed;
++	IssmDouble      b[2];
++	IssmDouble      pressure;
++	IssmDouble      pressure_litho;
++	IssmDouble      pressure_air;
++	IssmDouble      pressure_melange;
++	IssmDouble      pressure_water;
++	int         fill;
++	bool        shelf;
++
++	/*Objects: */
++	Tria       *tria1               = NULL;
++	Tria       *tria2               = NULL;
++
++	/*enum of element? */
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++	tria1=(Tria*)elements[0];
++	tria2=(Tria*)elements[1];
++
++	/*Initialize Element Matrix*/
++	if(this->active) return NULL; /*The penalty is active. No loads implied here.*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Get some inputs: */
++	this->inputs->GetInputValue(&fill,FillEnum);
++	this->inputs->GetInputValue(&shelf,SegmentOnIceShelfEnum);
++	rho_ice=matpar->GetRhoIce();
++	rho_water=matpar->GetRhoWater();
++	gravity=matpar->GetG();
++	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
++	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
++	if (h[0]!=h[1])_error2_("different thicknesses not supported for rift fronts");
++	thickness=h[0];
++	tria1->GetInputValue(&b[0],nodes[0],BedEnum);
++	tria2->GetInputValue(&b[1],nodes[1],BedEnum);
++	if (b[0]!=b[1])_error2_("different beds not supported for rift fronts");
++	bed=b[0];
++
++	/*Ok, this rift is opening. We should put loads on both sides of the rift flanks. Because we are dealing with contact mechanics, 
++	 * and we want to avoid zigzagging of the loads, we want lump the loads onto nodes, not onto surfaces between nodes.:*/
++
++	/*Ok, to compute the pressure, we are going to need material properties, thickness and bed for the two nodes. We assume those properties to 
++	 * be the same across the rift.: */
++
++	/*Ok, now compute the pressure (in norm) that is being applied to the flanks, depending on the type of fill: */
++	if(fill==WaterEnum){
++		if(shelf){
++			/*We are on an ice shelf, hydrostatic equilibrium is used to determine the pressure for water fill: */
++			pressure=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2  - rho_water*gravity*pow(bed,(IssmDouble)2)/(IssmDouble)2; 
++		}
++		else{
++			//We are on an icesheet, we assume the water column fills the entire front: */
++			pressure=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2  - rho_water*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2; 
++		}
++	}
++	else if(fill==AirEnum){
++		pressure=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2;   //icefront on an ice sheet, pressure imbalance ice vs air.
++	}
++	else if(fill==IceEnum){ //icefront finding itself against another icefront (pressure imbalance is fully compensated, ice vs ice)
++		pressure=0;
++	}
++	else if(fill==MelangeEnum){ //icefront finding itself against another icefront (pressure imbalance is fully compensated, ice vs ice)
++
++		if(!shelf) _error2_("fill type " << fill << " not supported on ice sheets yet.");
++
++		pressure_litho=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2;
++		pressure_air=0;
++		pressure_melange=rho_ice*gravity*pow(fraction*thickness,(IssmDouble)2)/(IssmDouble)2;
++		pressure_water=1.0/2.0*rho_water*gravity*  ( pow(bed,2.0)-pow(rho_ice/rho_water*fraction*thickness,2.0) );
++
++		pressure=pressure_litho-pressure_air-pressure_melange-pressure_water;
++	}
++	else{
++		_error2_("fill type " << fill << " not supported yet.");
++	}
++
++	/*Ok, add contribution to first node, along the normal i==0: */
++	for (j=0;j<2;j++){
++		pe->values[j]+=pressure*normal[j]*length;
++	}
++
++	/*Add contribution to second node, along the opposite normal: i==1 */
++	for (j=0;j<2;j++){
++		pe->values[2+j]+= -pressure*normal[j]*length;
++	}	
++
++	/*Clean up and return*/
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Riftfront::Constrain {{{*/
++#define _ZIGZAGCOUNTER_
++
++int Riftfront::Constrain(int* punstable){
++
++	const int   numnodes        = 2;
++	IssmDouble      max_penetration;
++	IssmDouble      penetration;
++	int         activate;
++	int         found;
++	int         unstable;
++	IssmDouble      vx1;
++	IssmDouble      vy1;
++	IssmDouble      vx2;
++	IssmDouble      vy2;
++	IssmDouble      fractionincrement;
++
++	/*Objects: */
++	Tria       *tria1           = NULL;
++	Tria       *tria2           = NULL;
++
++	/*enum of element? */
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++
++	/*recover elements on both side of rift: */
++	tria1=(Tria*)elements[0];
++	tria2=(Tria*)elements[1];
++
++	/*Is this constraint frozen? In which case we don't touch: */
++	if (this->frozen){
++		*punstable=0;
++		return 1;
++	}
++
++	/*Is this rift segment state specified by user input? :*/
++	if (this->state==OpenEnum || this->state==ClosedEnum){
++
++		if(this->state==OpenEnum)this->active=0;
++		if(this->state==ClosedEnum)this->active=1;
++		
++		/*this segment is like frozen, no instability here: */
++		*punstable=0;
++		return 1;
++	}
++
++
++	/*recover parameters: */
++	this->inputs->GetInputValue(&fractionincrement,FractionIncrementEnum);
++
++	/*First recover velocity: */
++	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
++	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
++	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
++	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
++
++	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
++	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
++
++	/*activation: */
++	if(penetration<0)activate=1;
++	else  activate=0;
++
++	/*Here, we try to avoid zigzaging. When a penalty activates and deactivates for more than penalty_lock times, 
++	 * we increase the fraction of melange:*/
++	if(this->counter>this->penalty_lock){
++		/*reset counter: */
++		this->counter=0;
++		/*increase melange fraction: */
++		this->fraction+=fractionincrement;
++		if (this->fraction>1)this->fraction=(IssmDouble)1.0;
++		//_printLine_("riftfront " << this->Id() << " fraction: " << this->fraction);
++	}
++
++	//Figure out stability of this penalty
++	if(this->active==activate){
++		unstable=0;
++	}
++	else{
++		unstable=1;
++		this->counter++;
++	}
++
++	//Set penalty flag
++	this->active=activate;
++
++	//if ((penetration>0) && (this->active==1))_printLine_("Riftfront " << Id() << " wants to be released");
++
++	/*assign output pointer: */
++	*punstable=unstable;
++	return 1;
++}
++/*}}}*/
++/*FUNCTION Riftfront::FreezeConstraints{{{*/
++void   Riftfront::FreezeConstraints(void){
++
++	/*Just set frozen flag to 1: */
++	this->frozen=1;
++
++}
++/*}}}*/
++/*FUNCTION Riftfront::IsFrozen{{{*/
++bool   Riftfront::IsFrozen(void){
++
++	/*Just set frozen flag to 1: */
++	if(this->frozen)return 1;
++	else return 0;
++}
++/*}}}*/
++/*FUNCTION Riftfront::IsMaterialStable {{{*/
++int   Riftfront::IsMaterialStable(void){
++
++	int found=0;
++	IssmDouble converged=0;
++
++	this->inputs->GetInputValue(&converged,ConvergedEnum);
++
++	if(converged){
++		/*ok, material non-linearity has converged. If that was already the case, we keep 
++		 * constraining the rift front. If it was not, and this is the first time the material 
++		 * has converged, we start constraining now!: */
++		this->material_converged=1;
++	}
++
++	return this->material_converged;
++}
++/*}}}*/
++/*FUNCTION Riftfront::MaxPenetration {{{*/
++int   Riftfront::MaxPenetration(IssmDouble* ppenetration){
++
++	const int     numnodes=2;
++	IssmDouble        max_penetration;
++	IssmDouble        penetration=0;
++	int           found;
++	IssmDouble      vx1;
++	IssmDouble      vy1;
++	IssmDouble      vx2;
++	IssmDouble      vy2;
++
++	/*Objects: */
++	Tria       *tria1           = NULL;
++	Tria       *tria2           = NULL;
++
++	/*enum of element? */
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++
++	/*recover elements on both side of rift: */
++	tria1=(Tria*)elements[0];
++	tria2=(Tria*)elements[1];
++
++	//initialize: 
++	penetration=-1;
++
++	/*recover velocity: */
++	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
++	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
++	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
++	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
++
++	/*Node1 faces node2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
++	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
++
++	/*Now, we return penetration only if we are active!: */
++	if(this->active==0)penetration=-1;
++
++	/*If we are zigzag locked, same thing: */
++	if(this->counter>this->penalty_lock)penetration=-1;
++	
++	/*assign output pointer: */
++	*ppenetration=penetration;
++	return 1;
++}
++/*}}}*/
++/*FUNCTION Riftfront::Penetration {{{*/
++int   Riftfront::Penetration(IssmDouble* ppenetration){
++
++	IssmDouble    vx1;
++	IssmDouble    vy1;
++	IssmDouble    vx2;
++	IssmDouble    vy2;
++
++	IssmDouble    penetration;
++	int       found;
++
++	/*Objects: */
++	Tria     *tria1       = NULL;
++	Tria     *tria2       = NULL;
++
++	/*enum of element? */
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++
++	/*recover elements on both side of rift: */
++	tria1=(Tria*)elements[0];
++	tria2=(Tria*)elements[1];
++
++	/*First recover velocity: */
++	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
++	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
++	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
++	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
++
++	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
++	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
++
++	/*Now, we return penetration only if we are active!: */
++	if(this->active==0)penetration=0;
++	
++	/*assign output pointer: */
++	*ppenetration=penetration;
++	return 1;
++}
++/*}}}*/
++/*FUNCTION Riftfront::PotentialUnstableConstraint {{{*/
++int   Riftfront::PotentialUnstableConstraint(int* punstable){
++
++
++	const int   numnodes        = 2;
++	IssmDouble      max_penetration;
++	IssmDouble      penetration;
++	int         activate;
++	int         unstable;
++	int         found;
++	IssmDouble      vx1;
++	IssmDouble      vy1;
++	IssmDouble      vx2;
++	IssmDouble      vy2;
++
++	/*Objects: */
++	Tria       *tria1           = NULL;
++	Tria       *tria2           = NULL;
++
++	/*enum of element? */
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++
++	/*recover elements on both side of rift: */
++	tria1=(Tria*)elements[0];
++	tria2=(Tria*)elements[1];
++
++	/*First recover velocity: */
++	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
++	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
++	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
++	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
++
++	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
++	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
++
++	/*Ok, we are looking for positive penetration in an active constraint: */
++	if(this->active){
++		if (penetration>=0){
++			unstable=1;
++		}
++		else{
++			unstable=0;
++		}
++	}
++	else{
++		unstable=0;
++	}
++
++	/*assign output pointer: */
++	*punstable=unstable;
++	return 1;
++}
++/*}}}*/
++/*FUNCTION Riftfront::PreConstrain {{{*/
++int   Riftfront::PreConstrain(int* punstable){
++
++	const int   numnodes    = 2;
++	IssmDouble      penetration;
++	int         unstable;
++	int         found;
++	IssmDouble      vx1;
++	IssmDouble      vy1;
++	IssmDouble      vx2;
++	IssmDouble      vy2;
++
++	/*Objects: */
++	Tria       *tria1       = NULL;
++	Tria       *tria2       = NULL;
++
++	/*enum of element? */
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++
++	/*recover elements on both side of rift: */
++	tria1=(Tria*)elements[0];
++	tria2=(Tria*)elements[1];
++
++	/*First recover velocity: */
++	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
++	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
++	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
++	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
++
++	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
++	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
++
++	/*Ok, we are preconstraining here. Ie, anything that penetrates is constrained until stability of the entire set 
++	 * of constraints is reached.: */
++	if(penetration<0){
++		if (!this->active){
++			/*This is the first time penetration happens: */
++			this->active=1;
++			unstable=1;
++		}
++		else{
++			/*This constraint was already active: */
++			this->active=1;
++			unstable=0;
++		}
++	}
++	else{
++		/*No penetration happening. : */
++		if (!this->active){
++			/*This penalty was not active, and no penetration happening. Do nonthing: */
++			this->active=0;
++			unstable=0; 
++		}
++		else{
++			/*Ok, this penalty wants to get released. But not now, this is preconstraint, not constraint: */
++			this->active=1;
++			unstable=0;
++		}
++	}
++
++	/*assign output pointer: */
++	*punstable=unstable;
++	return 1;
++}
++/*}}}*/
++/*FUNCTION Riftfront::PreStable {{{*/
++bool  Riftfront::PreStable(){
++	return prestable;
++}
++/*}}}*/
++/*FUNCTION Riftfront::SetPreStable {{{*/
++void Riftfront::SetPreStable(){
++	prestable=1;
++}
++/*}}}*/
++/*FUNCTION Riftfront::IsInput{{{*/
++bool Riftfront::IsInput(int name){
++	if (
++				name==ConvergedEnum ||
++				name==ThicknessEnum ||
++				name==SurfaceEnum ||
++				name==BedEnum 
++		){
++		return true;
++	}
++	else return false;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 12822)
+@@ -0,0 +1,166 @@
++/*!\file DoubleMatExternalResult.c
++ * \brief: implementation of the DoubleMatExternalResult object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*DoubleMatExternalResult constructors and destructor*/
++/*FUNCTION DoubleMatExternalResult::DoubleMatExternalResult(){{{*/
++DoubleMatExternalResult::DoubleMatExternalResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION DoubleMatExternalResult::DoubleMatExternalResult(int in_id, int enum_type,IssmDoubleMat values,int M,int N,int in_step,IssmDouble in_time){{{*/
++DoubleMatExternalResult::DoubleMatExternalResult(int in_id, int in_enum_type,IssmDouble* in_values, int in_M,int in_N,int in_step,IssmDouble in_time){
++
++	id=in_id;
++	enum_type=in_enum_type;
++	M=in_M;
++	N=in_N;
++
++	/*Copy result in values*/
++	if(M*N){
++		values=xNew<IssmDouble>(M*N);
++		xMemCpy<IssmDouble>(values,in_values,M*N);
++	}
++	else values=NULL;
++
++	step=in_step;
++	time=in_time;
++}
++/*}}}*/
++/*FUNCTION DoubleMatExternalResult::~DoubleMatExternalResult(){{{*/
++DoubleMatExternalResult::~DoubleMatExternalResult(){
++
++	xDelete<IssmDouble>(this->values);
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION DoubleMatExternalResult::Echo {{{*/
++void DoubleMatExternalResult::Echo(void){
++
++	_printLine_("DoubleMatExternalResult:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++	_printLine_("   matrix size: " << this->M << "-" << this->N);
++
++}
++/*}}}*/
++/*FUNCTION DoubleMatExternalResult::DeepEcho{{{*/
++void DoubleMatExternalResult::DeepEcho(void){
++
++	int i,j;
++	
++	_printLine_("DoubleMatExternalResult:");
++	_printLine_("   id: " << this->id);
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++	_printLine_("   matrix size: " << this->M << "-" << this->N);
++	for (i=0;i<this->M;i++){  
++		_printString_("   [ ");
++		for (j=0;j<this->N;j++){
++			_printString_( " " << setw(11) << setprecision (5) << this->values[i*this->N+j]);
++		}  
++		_printLine_(" ]");
++	}  
++
++}
++/*}}}*/
++/*FUNCTION DoubleMatExternalResult::Id{{{*/
++int    DoubleMatExternalResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION DoubleMatExternalResult::MyRank{{{*/
++int    DoubleMatExternalResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION DoubleMatExternalResult::ObjectEnum{{{*/
++int DoubleMatExternalResult::ObjectEnum(void){
++
++	return DoubleMatExternalResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION DoubleMatExternalResult::copy{{{*/
++Object* DoubleMatExternalResult::copy() {
++	
++	return new DoubleMatExternalResult(this->id,this->enum_type,this->values,this->M,this->N,this->step,this->time);
++
++}
++/*}}}*/
++
++/*DoubleMatExternalResult management: */
++/*FUNCTION DoubleMatExternalResult::WriteData{{{*/
++void   DoubleMatExternalResult::WriteData(FILE* fid,bool io_gather){
++
++	int     length;
++	int     type;
++	int     rows,cols;
++	char   *name    = NULL;
++	extern  int my_rank;
++	IssmPDouble *passiveDouble_p=NULL;
++	IssmPDouble passiveDouble;
++
++	if(io_gather){
++		/*we are gathering the data on cpu 0, don't write on other cpus: */
++		if(my_rank) return;
++	}
++
++	passiveDouble_p=xNew<IssmPDouble>(M*N);
++
++	/*First write enum: */
++	EnumToStringx(&name,this->enum_type);
++	length=(strlen(name)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(name,length,1,fid);
++	xDelete<char>(name);
++
++	/*Now write time and step: */
++	passiveDouble=reCast<IssmPDouble>(time);
++	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
++	fwrite(&step,sizeof(int),1,fid);
++
++	/*writing a IssmDouble array, type is 3:*/
++	type=3;
++	fwrite(&type,sizeof(int),1,fid);
++	rows=this->M;
++	fwrite(&rows,sizeof(int),1,fid);
++	cols=this->N;
++	fwrite(&cols,sizeof(int),1,fid);
++	for (int i=0; i<N*M; ++i) passiveDouble_p[i]=reCast<IssmPDouble>(values[i]);
++	fwrite(passiveDouble_p,cols*rows*sizeof(IssmPDouble),1,fid);
++	xDelete(passiveDouble_p);
++
++}
++/*}}}*/
++/*FUNCTION DoubleMatExternalResult::GetResultName{{{*/
++void DoubleMatExternalResult::GetResultName(char** pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION DoubleMatExternalResult::GetStep{{{*/
++int DoubleMatExternalResult::GetStep(void){
++
++	return this->step;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 12822)
+@@ -0,0 +1,149 @@
++/*!\file PetscVecExternalResult.c
++ * \brief: implementation of the PetscVecExternalResult object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*PetscVecExternalResult constructors and destructor*/
++/*FUNCTION PetscVecExternalResult::PetscVecExternalResult(){{{*/
++PetscVecExternalResult::PetscVecExternalResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION PetscVecExternalResult::PetscVecExternalResult(int enum_type,IssmPetscVec value){{{*/
++PetscVecExternalResult::PetscVecExternalResult(int in_id, int in_enum_type,Vector* in_value,int in_step, IssmDouble in_time){
++
++	id=in_id;
++	enum_type=in_enum_type;
++
++	value=NULL;
++
++	if(in_value){
++		value=in_value->Duplicate();
++		in_value->Copy(value);
++	}
++	else value=NULL;
++
++	step=in_step;
++	time=in_time;
++}
++/*}}}*/
++/*FUNCTION PetscVecExternalResult::~PetscVecExternalResult(){{{*/
++PetscVecExternalResult::~PetscVecExternalResult(){
++	VecFree(&value);
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION PetscVecExternalResult::Echo {{{*/
++void PetscVecExternalResult::Echo(void){
++
++	_printLine_("PetscVecExternalResult:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++
++}
++/*}}}*/
++/*FUNCTION PetscVecExternalResult::DeepEcho{{{*/
++void PetscVecExternalResult::DeepEcho(void){
++
++	int i;
++	_printLine_("PetscVecExternalResult:");
++	_printLine_("   id: " << this->id);
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++	VecView(value,PETSC_VIEWER_STDOUT_WORLD);
++}
++/*}}}*/
++/*FUNCTION PetscVecExternalResult::Id{{{*/
++int    PetscVecExternalResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION PetscVecExternalResult::MyRank{{{*/
++int    PetscVecExternalResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION PetscVecExternalResult::ObjectEnum{{{*/
++int PetscVecExternalResult::ObjectEnum(void){
++
++	return PetscVecExternalResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION PetscVecExternalResult::copy{{{*/
++Object* PetscVecExternalResult::copy() {
++	
++	return new PetscVecExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
++
++}
++/*}}}*/
++
++/*PetscVecExternalResult management: */
++/*FUNCTION PetscVecExternalResult::WriteData{{{*/
++void   PetscVecExternalResult::WriteData(FILE* fid,bool io_gather){
++
++	int     length;
++	int     type;
++	int     size;
++	char   *name      = NULL;
++	IssmPDouble *serialvec = NULL;
++	extern int my_rank;
++	IssmPDouble passiveDouble;
++
++	/*serialize: */
++	VecGetSize(this->value,&size);
++	VecToMPISerial(&serialvec,this->value);
++
++	/*now, exit if we are not on cpu 0: */
++	if(my_rank)return;
++
++	/*First write enum: */
++	EnumToStringx(&name,this->enum_type);
++	length=(strlen(name)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(name,length,1,fid);
++	xDelete<char>(name);
++
++	/*Now write time and step: */
++        passiveDouble=reCast<IssmPDouble>(time);
++	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
++	fwrite(&step,sizeof(int),1,fid);
++
++	/*writing a IssmDouble, type is 1, size is 1: */
++	type=1;
++	
++	fwrite(&type,sizeof(int),1,fid);
++	fwrite(&size,sizeof(int),1,fid);
++	fwrite(serialvec,size*sizeof(IssmPDouble),1,fid);
++
++	/*Free ressources:*/
++	xDelete<IssmPDouble>(serialvec);
++}
++/*}}}*/
++/*FUNCTION PetscVecExternalResult::GetResultName{{{*/
++void PetscVecExternalResult::GetResultName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION PetscVecExternalResult::GetStep{{{*/
++int PetscVecExternalResult::GetStep(void){
++
++	return this->step;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h	(revision 12822)
+@@ -0,0 +1,55 @@
++/*! \file DoubleVecExternalResult.h 
++ */
++
++
++#ifndef _DOUBLEVECEXTERNALRESULT_H_
++#define _DOUBLEVECEXTERNALRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./ExternalResult.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../include/include.h"
++/*}}}*/
++
++class DoubleVecExternalResult: public ExternalResult{
++
++	private: 
++		int id;
++		int enum_type;
++		IssmDouble* values;
++		int M;
++		int step;
++		IssmDouble time;
++
++	public:
++		/*DoubleVecExternalResult constructors, destructors: {{{*/
++		DoubleVecExternalResult();
++		DoubleVecExternalResult(int id,int enum_type,IssmDouble* values,int M,int step, IssmDouble time);
++		~DoubleVecExternalResult();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ExternalResult management: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  WriteData(FILE* fid,bool io_gather);
++		void  GetResultName(char**);
++		int   GetStep(void);
++		/*}}}*/
++};
++#endif  /* _DOUBLEVECEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h	(revision 12822)
+@@ -0,0 +1,56 @@
++/*! \file DoubleExternalResult.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _DOUBLEEXTERNALRESULT_H_
++#define _DOUBLEEXTERNALRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++
++#include "./ExternalResult.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../include/include.h"
++/*}}}*/
++
++class DoubleExternalResult: public ExternalResult{
++
++	public:
++		int    id;
++		int    enum_type;
++		IssmDouble value;
++		int    step;
++		IssmDouble time;
++
++
++		/*DoubleExternalResult constructors, destructors: {{{*/
++		DoubleExternalResult();
++		DoubleExternalResult(int id,int enum_type,IssmDouble value,int step,IssmDouble time);
++		~DoubleExternalResult();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ExternalResult management: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  WriteData(FILE* fid,bool io_gather);
++		void  GetResultName(char**);
++		int   GetStep(void);
++		/*}}}*/
++};
++#endif  /* _DOUBLEEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h	(revision 12822)
+@@ -0,0 +1,54 @@
++/*! \file IntExternalResult.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _INTEXTERNALRESULT_H_
++#define _INTEXTERNALRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./ExternalResult.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++/*}}}*/
++
++class IntExternalResult: public ExternalResult{
++
++	public:
++		int    id;
++		int    enum_type;
++		int    value;
++		int    step;
++		IssmDouble time;
++
++
++		/*IntExternalResult constructors, destructors: {{{*/
++		IntExternalResult();
++		IntExternalResult(int id,int enum_type,int value,int step,IssmDouble time);
++		~IntExternalResult();
++
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ExternalResult managemnet: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  WriteData(FILE* fid,bool io_gather);
++		void  GetResultName(char**);
++		int   GetStep(void);
++		/*}}}*/
++};
++#endif  /* _INTEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h	(revision 12822)
+@@ -0,0 +1,54 @@
++/*! \file BoolExternalResult.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _BOOLEXTERNALRESULT_H_
++#define _BOOLEXTERNALRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./ExternalResult.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../include/include.h"
++/*}}}*/
++
++class BoolExternalResult: public ExternalResult{
++
++	public:
++		int    id;
++		int    enum_type;
++		bool   value;
++		int    step;
++		IssmDouble time;
++
++		/*BoolExternalResult constructors, destructors: {{{*/
++		BoolExternalResult();
++		BoolExternalResult(int id, int enum_type,bool value,int step,IssmDouble time);
++		~BoolExternalResult();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ExternalResult management: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  WriteData(FILE* fid,bool io_gather);
++		void  GetResultName(char**);
++		int   GetStep(void);
++		/*}}}*/
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h	(revision 12822)
+@@ -0,0 +1,56 @@
++/*! \file DoubleMatExternalResult.h 
++ */
++
++
++#ifndef _DOUBLEMATEXTERNALRESULT_H_
++#define _DOUBLEMATEXTERNALRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./ExternalResult.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../include/include.h"
++/*}}}*/
++
++class DoubleMatExternalResult: public ExternalResult{
++
++	private: 
++		int id;
++		int enum_type;
++		IssmDouble* values;
++		int M;
++		int N;
++		int step;
++		IssmDouble time;
++
++	public:
++		/*DoubleMatExternalResult constructors, destructors: {{{*/
++		DoubleMatExternalResult();
++		DoubleMatExternalResult(int id,int enum_type,IssmDouble* values,int M,int N,int step, IssmDouble time);
++		~DoubleMatExternalResult();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ExternalResult managemnet: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  WriteData(FILE* fid,bool io_gather);
++		void  GetResultName(char**);
++		int   GetStep(void);
++		/*}}}*/
++};
++#endif  /* _DOUBLEMATEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h	(revision 12822)
+@@ -0,0 +1,55 @@
++/*! \file PetscVecExternalResult.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _PETSCVECEXTERNALRESULT_H_
++#define _PETSCVECEXTERNALRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./ExternalResult.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../include/include.h"
++/*}}}*/
++
++class PetscVecExternalResult: public ExternalResult{
++
++	private: 
++		int id;
++		int enum_type;
++		Vector* value;
++		int step;
++		IssmDouble time;
++
++	public:
++		/*PetscVecExternalResult constructors, destructors: {{{*/
++		PetscVecExternalResult();
++		PetscVecExternalResult(int id,int enum_type,Vector* value, int step, IssmDouble time);
++		~PetscVecExternalResult();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ExternalResult management: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  WriteData(FILE* fid,bool io_gather);
++		void  GetResultName(char**);
++		int   GetStep(void);
++		/*}}}*/
++};
++#endif  /* _PETSCVECEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/ExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/ExternalResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/ExternalResult.h	(revision 12822)
+@@ -0,0 +1,34 @@
++/*!\file:  ExternalResult.h
++ * \brief abstract class for ExternalResult object
++ */ 
++
++
++#ifndef _EXTERNALRESULT_H_
++#define _EXTERNALRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "../Object.h"
++#include "../Node.h"
++/*}}}*/
++
++class ExternalResult: public Object{
++
++	public: 
++		
++		virtual        ~ExternalResult(){};
++		/*Virtual functions:{{{*/
++		virtual int   InstanceEnum()=0;
++		virtual void  WriteData(FILE* fid,bool io_gather)=0;
++		virtual void  GetResultName(char**)=0;
++		virtual int   GetStep(void)=0;
++		/*}}}*/
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp	(revision 12822)
+@@ -0,0 +1,132 @@
++/*!\file StringExternalResult.c
++ * \brief: implementation of the StringExternalResult object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*StringExternalResult constructors and destructor*/
++/*FUNCTION StringExternalResult::StringExternalResult(){{{*/
++StringExternalResult::StringExternalResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION StringExternalResult::StringExternalResult(int enum_type,IssmString value){{{*/
++StringExternalResult::StringExternalResult(int in_id, int in_enum_type,char* in_value,int in_step, IssmDouble in_time){
++
++	id=in_id;
++	enum_type=in_enum_type;
++	value=xNew<char>(strlen(in_value)+1);
++	xMemCpy<char>(value,in_value,(strlen(in_value)+1));
++	step=in_step;
++	time=in_time;
++	
++}
++/*}}}*/
++/*FUNCTION StringExternalResult::~StringExternalResult(){{{*/
++StringExternalResult::~StringExternalResult(){
++	xDelete<char>(value);
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION StringExternalResult::Echo {{{*/
++void StringExternalResult::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION StringExternalResult::DeepEcho{{{*/
++void StringExternalResult::DeepEcho(void){
++
++	_printLine_("StringExternalResult:");
++	_printLine_("   id: " << this->id);
++	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " << this->value);
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++}
++/*}}}*/
++/*FUNCTION StringExternalResult::Id{{{*/
++int    StringExternalResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION StringExternalResult::MyRank{{{*/
++int    StringExternalResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION StringExternalResult::ObjectEnum{{{*/
++int StringExternalResult::ObjectEnum(void){
++
++	return StringExternalResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION StringExternalResult::copy{{{*/
++Object* StringExternalResult::copy() {
++	
++	return new StringExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
++
++}
++/*}}}*/
++
++/*StringExternalResult management: */
++/*FUNCTION StringExternalResult::WriteData{{{*/
++void   StringExternalResult::WriteData(FILE* fid,bool io_gather){
++
++	int     length;
++	int     type;
++	char   *name      = NULL;
++	extern  int my_rank;
++        IssmPDouble passiveDouble;
++
++	/*return if now on cpu 0: */
++	if(my_rank)return;
++
++	/*First write enum: */
++	EnumToStringx(&name,this->enum_type);
++	length=(strlen(name)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(name,length,1,fid);
++	xDelete<char>(name);
++
++	/*Now write time and step: */
++        passiveDouble=reCast<IssmPDouble>(time);
++	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
++	fwrite(&step,sizeof(int),1,fid);
++
++	/*writing a string, type is 2: */
++	type=2;
++	fwrite(&type,sizeof(int),1,fid);
++	
++	length=(strlen(this->value)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(this->value,length,1,fid);
++
++}
++/*}}}*/
++/*FUNCTION StringExternalResult::GetResultName{{{*/
++void StringExternalResult::GetResultName(char**pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION StringExternalResult::GetStep{{{*/
++int StringExternalResult::GetStep(void){
++
++	return this->step;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 12822)
+@@ -0,0 +1,152 @@
++/*!\file DoubleVecExternalResult.c
++ * \brief: implementation of the DoubleVecExternalResult object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*DoubleVecExternalResult constructors and destructor*/
++/*FUNCTION DoubleVecExternalResult::DoubleVecExternalResult(){{{*/
++DoubleVecExternalResult::DoubleVecExternalResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION DoubleVecExternalResult::DoubleVecExternalResult(int enum_type,IssmDoubleVec values,int M,int in_step,IssmDouble in_time){{{*/
++DoubleVecExternalResult::DoubleVecExternalResult(int in_id, int in_enum_type,IssmDouble* in_values, int in_M,int in_step,IssmDouble in_time){
++
++	id=in_id;
++	enum_type=in_enum_type;
++	M=in_M;
++
++	if(M){
++		values=xNew<IssmDouble>(M);
++		xMemCpy<IssmDouble>(values,in_values,M);
++	}
++	else values=NULL;
++
++	step=in_step;
++	time=in_time;
++}
++/*}}}*/
++/*FUNCTION DoubleVecExternalResult::~DoubleVecExternalResult(){{{*/
++DoubleVecExternalResult::~DoubleVecExternalResult(){
++	xDelete<IssmDouble>(values);
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION DoubleVecExternalResult::Echo {{{*/
++void DoubleVecExternalResult::Echo(void){
++
++	_printLine_("DoubleVecExternalResult:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   vector size: " << this->M);
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++
++}
++/*}}}*/
++/*FUNCTION DoubleVecExternalResult::DeepEcho{{{*/
++void DoubleVecExternalResult::DeepEcho(void){
++
++	int i;
++	
++	_printLine_("DoubleVecExternalResult:");
++	_printLine_("   id: " << this->id);
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   vector size: " << this->M);
++	for(i=0;i<this->M;i++){
++		_printLine_(i << " " << this->values[i]);
++	}
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++}
++/*}}}*/
++/*FUNCTION DoubleVecExternalResult::Id{{{*/
++int    DoubleVecExternalResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION DoubleVecExternalResult::MyRank{{{*/
++int    DoubleVecExternalResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION DoubleVecExternalResult::ObjectEnum{{{*/
++int DoubleVecExternalResult::ObjectEnum(void){
++
++	return DoubleVecExternalResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION DoubleVecExternalResult::copy{{{*/
++Object* DoubleVecExternalResult::copy() {
++	
++	return new DoubleVecExternalResult(this->id,this->enum_type,this->values,this->M,this->step,this->time);
++
++}
++/*}}}*/
++
++/*DoubleVecExternalResult management: */
++/*FUNCTION DoubleVecExternalResult::WriteData{{{*/
++void   DoubleVecExternalResult::WriteData(FILE* fid,bool io_gather){
++
++	int     length;
++	int     type;
++	int     size;
++	char   *name    = NULL;
++	extern  int my_rank;
++	IssmPDouble *passiveDouble_p=NULL;
++	IssmPDouble passiveDouble;
++
++	/*return if now on cpu 0: */
++	if(my_rank)return;
++
++	passiveDouble_p=xNew<IssmPDouble>(M);
++	/*First write enum: */
++	EnumToStringx(&name,this->enum_type);
++	length=(strlen(name)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(name,length,1,fid);
++	xDelete<char>(name);
++
++	/*Now write time and step: */
++        passiveDouble=reCast<IssmPDouble>(time);
++	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
++	fwrite(&step,sizeof(int),1,fid);
++
++	/*writing a IssmDouble, type is 1, size is 1: */
++	type=1;
++	size=this->M;
++	fwrite(&type,sizeof(int),1,fid);
++	fwrite(&size,sizeof(int),1,fid);
++        for (int i=0; i<M; ++i) passiveDouble_p[i]=reCast<IssmPDouble>(values[i]);
++	fwrite(passiveDouble_p,size*sizeof(IssmPDouble),1,fid);
++        xDelete(passiveDouble_p);
++}
++/*}}}*/
++/*FUNCTION DoubleVecExternalResult::GetResultName{{{*/
++void DoubleVecExternalResult::GetResultName(char** pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION DoubleVecExternalResult::GetStep{{{*/
++int DoubleVecExternalResult::GetStep(void){
++
++	return this->step;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp	(revision 12822)
+@@ -0,0 +1,131 @@
++/*!\file DoubleExternalResult.c
++ * \brief: implementation of the DoubleExternalResult object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*DoubleExternalResult constructors and destructor*/
++/*FUNCTION DoubleExternalResult::DoubleExternalResult(){{{*/
++DoubleExternalResult::DoubleExternalResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION DoubleExternalResult::DoubleExternalResult(int enum_type,IssmDouble value){{{*/
++DoubleExternalResult::DoubleExternalResult(int in_id, int in_enum_type,IssmDouble in_value,int in_step, IssmDouble in_time){
++
++	id=in_id;
++	enum_type=in_enum_type;
++	value=in_value;
++	step=in_step;
++	time=in_time;
++}
++/*}}}*/
++/*FUNCTION DoubleExternalResult::~DoubleExternalResult(){{{*/
++DoubleExternalResult::~DoubleExternalResult(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION DoubleExternalResult::Echo {{{*/
++void DoubleExternalResult::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION DoubleExternalResult::DeepEcho{{{*/
++void DoubleExternalResult::DeepEcho(void){
++
++	_printLine_("DoubleExternalResult:");
++	_printLine_("   id: " << this->id);
++	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " << this->value);
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++}
++/*}}}*/
++/*FUNCTION DoubleExternalResult::Id{{{*/
++int    DoubleExternalResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION DoubleExternalResult::MyRank{{{*/
++int    DoubleExternalResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION DoubleExternalResult::ObjectEnum{{{*/
++int DoubleExternalResult::ObjectEnum(void){
++
++	return DoubleExternalResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION DoubleExternalResult::copy{{{*/
++Object* DoubleExternalResult::copy() {
++	
++	return new DoubleExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
++
++}
++/*}}}*/
++
++/*DoubleExternalResult management: */
++/*FUNCTION DoubleExternalResult::WriteData{{{*/
++void   DoubleExternalResult::WriteData(FILE* fid,bool io_gather){
++
++	int     length;
++	int     type;
++	int     size;
++	char   *name    = NULL;
++	extern  int my_rank;
++	IssmPDouble passiveDouble;
++
++	/*return if now on cpu 0: */
++	if(my_rank)return;
++
++	/*First write enum: */
++	EnumToStringx(&name,this->enum_type);
++	length=(strlen(name)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(name,length,1,fid);
++	xDelete<char>(name);
++
++	/*Now write time and step: */
++	passiveDouble=reCast<IssmPDouble>(time);
++	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
++	fwrite(&step,sizeof(int),1,fid);
++
++	/*writing a IssmDouble, type is 1, size is 1: */
++	type=1;
++	size=1;
++	fwrite(&type,sizeof(int),1,fid);
++	fwrite(&size,sizeof(int),1,fid);
++        passiveDouble=reCast<IssmPDouble>(this->value);
++	fwrite(&passiveDouble,size*sizeof(IssmPDouble),1,fid);
++
++}
++/*}}}*/
++/*FUNCTION DoubleExternalResult::GetResultName{{{*/
++void DoubleExternalResult::GetResultName(char** pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION DoubleExternalResult::GetStep{{{*/
++int DoubleExternalResult::GetStep(void){
++
++	return this->step;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp	(revision 12822)
+@@ -0,0 +1,132 @@
++/*!\file IntExternalResult.c
++ * \brief: implementation of the IntExternalResult object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*IntExternalResult constructors and destructor*/
++/*FUNCTION IntExternalResult::IntExternalResult(){{{*/
++IntExternalResult::IntExternalResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION IntExternalResult::IntExternalResult(int in_id, int in_enum_type,int in_value,int in_step, IssmDouble in_time){{{*/
++IntExternalResult::IntExternalResult(int in_id, int in_enum_type,int in_value,int in_step, IssmDouble in_time){
++
++	id=in_id;
++	enum_type=in_enum_type;
++	value=in_value;
++	step=in_step;
++	time=in_time;
++}
++/*}}}*/
++/*FUNCTION IntExternalResult::~IntExternalResult(){{{*/
++IntExternalResult::~IntExternalResult(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION IntExternalResult::Echo {{{*/
++void IntExternalResult::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION IntExternalResult::DeepEcho{{{*/
++void IntExternalResult::DeepEcho(void){
++
++	_printLine_("IntExternalResult:");
++	_printLine_("   id: " << this->id);
++	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " << this->value);
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++}
++/*}}}*/
++/*FUNCTION IntExternalResult::Id{{{*/
++int    IntExternalResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION IntExternalResult::MyRank{{{*/
++int    IntExternalResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION IntExternalResult::ObjectEnum{{{*/
++int IntExternalResult::ObjectEnum(void){
++
++	return IntExternalResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION IntExternalResult::copy{{{*/
++Object* IntExternalResult::copy() {
++	
++	return new IntExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
++
++}
++/*}}}*/
++
++/*IntExternalResult management: */
++/*FUNCTION IntExternalResult::WriteData{{{*/
++void   IntExternalResult::WriteData(FILE* fid,bool io_gather){
++
++	int     length;
++	int     type;
++	int     size;
++	char   *name    = NULL;
++	IssmPDouble  passiveDouble;
++	extern  int my_rank;
++
++	/*return if now on cpu 0: */
++	if(my_rank)return;
++
++	/*First write enum: */
++	EnumToStringx(&name,this->enum_type);
++	length=(strlen(name)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(name,length,1,fid);
++	xDelete<char>(name);
++
++	/*Now write time and step: */
++        passiveDouble=reCast<IssmPDouble>(time);
++	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
++	fwrite(&step,sizeof(int),1,fid);
++
++	/*writing a IssmPDouble, type is 1, size is 1: */
++	type=1;
++	size=1;
++	fwrite(&type,sizeof(int),1,fid);
++	fwrite(&size,sizeof(int),1,fid);
++        /*cast to a IssmPDouble: */
++        passiveDouble=reCast<IssmPDouble>(value);
++	fwrite(&passiveDouble,size*sizeof(IssmPDouble),1,fid);
++
++}
++/*}}}*/
++/*FUNCTION IntExternalResult::GetResultName{{{*/
++void IntExternalResult::GetResultName(char** pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION IntExternalResult::GetStep{{{*/
++int IntExternalResult::GetStep(void){
++
++	return this->step;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp	(revision 12822)
+@@ -0,0 +1,132 @@
++/*!\file BoolExternalResult.c
++ * \brief: implementation of the BoolExternalResult object
++ */
++
++/*header files: */
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*BoolExternalResult constructors and destructor*/
++/*FUNCTION BoolExternalResult::BoolExternalResult(){{{*/
++BoolExternalResult::BoolExternalResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION BoolExternalResult::BoolExternalResult(int enum_type,bool value){{{*/
++BoolExternalResult::BoolExternalResult(int in_id, int in_enum_type,bool in_value,int in_step, IssmDouble in_time){
++
++	id=in_id;
++	enum_type=in_enum_type;
++	value=in_value;
++	step=in_step;
++	time=in_time;
++}
++/*}}}*/
++/*FUNCTION BoolExternalResult::~BoolExternalResult(){{{*/
++BoolExternalResult::~BoolExternalResult(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION BoolExternalResult::Echo {{{*/
++void BoolExternalResult::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION BoolExternalResult::DeepEcho{{{*/
++void BoolExternalResult::DeepEcho(void){
++
++	_printLine_("BoolExternalResult:");
++	_printLine_("   id: " << this->id);
++	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " <<(this->value?"true":"false"));
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++}
++/*}}}*/
++/*FUNCTION BoolExternalResult::Id{{{*/
++int    BoolExternalResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION BoolExternalResult::MyRank{{{*/
++int    BoolExternalResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION BoolExternalResult::ObjectEnum{{{*/
++int BoolExternalResult::ObjectEnum(void){
++
++	return BoolExternalResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION BoolExternalResult::copy{{{*/
++Object* BoolExternalResult::copy() {
++	
++	return new BoolExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
++
++}
++/*}}}*/
++
++/*BoolExternalResult management: */
++/*FUNCTION BoolExternalResult::WriteData{{{*/
++void   BoolExternalResult::WriteData(FILE* fid,bool io_gather){
++
++	int     length;
++	int     type;
++	int     size;
++	IssmPDouble  passiveDouble;
++	extern  int my_rank;
++	char*   name = NULL;
++
++	/*return if now on cpu 0: */
++	if(my_rank)return;
++
++	/*First write enum: */
++	EnumToStringx(&name,this->enum_type);
++	length=(strlen(name)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(name,length,1,fid);
++	xDelete<char>(name);
++
++	/*Now write time and step: */
++	passiveDouble=reCast<IssmPDouble>(time);
++	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
++	fwrite(&step,sizeof(int),1,fid);
++
++	/*writing a IssmDouble, type is 1, size is 1: */
++	type=1;
++	size=1;
++	fwrite(&type,sizeof(int),1,fid);
++	fwrite(&size,sizeof(int),1,fid);
++        /*Now write bool, after casting it: */
++        passiveDouble=reCast<IssmPDouble>(this->value);
++        fwrite(&passiveDouble,size*sizeof(IssmPDouble),1,fid);
++
++}
++/*}}}*/
++/*FUNCTION BoolExternalResult::GetResultName{{{*/
++void BoolExternalResult::GetResultName(char** pname){
++	EnumToStringx(pname,this->enum_type);
++}
++/*}}}*/
++/*FUNCTION BoolExternalResult::GetStep{{{*/
++int BoolExternalResult::GetStep(void){
++
++	return this->step;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h	(revision 12822)
+@@ -0,0 +1,55 @@
++/*! \file StringExternalResult.h 
++ *  \brief: header file for triavertexinput object
++ */
++
++
++#ifndef _STRINGEXTERNALRESULT_H_
++#define _STRINGEXTERNALRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./ExternalResult.h"
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../include/include.h"
++/*}}}*/
++
++class StringExternalResult: public ExternalResult{
++
++	private: 
++		int    id;
++		int    enum_type;
++		char*  value;
++		int    step;
++		IssmDouble time;
++
++	public:
++		/*StringExternalResult constructors, destructors: {{{*/
++		StringExternalResult();
++		StringExternalResult(int id,int enum_type,char* value,int step, IssmDouble time);
++		~StringExternalResult();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ExternalResult management: {{{*/
++		int   InstanceEnum(){return enum_type;}
++		void  WriteData(FILE* fid,bool io_gather);
++		void  GetResultName(char**);
++		int   GetStep(void);
++		/*}}}*/
++};
++#endif  /* _STRINGEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.h	(revision 12822)
+@@ -0,0 +1,52 @@
++/*!\file SpcDynamic.h
++ * \brief: header file for spc object
++ */
++
++#ifndef _SPCDynamic_H_
++#define _SPCDynamic_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Object.h"
++class DataSet;
++/*}}}*/
++
++class SpcDynamic: public Constraint{
++
++	private: 
++		int	sid; /*! id, to track it*/
++		int	nodeid; /*!node id*/
++		int dof; /*!component*/
++		IssmDouble value; /*value*/
++		bool isset;
++		int analysis_type;
++
++	public:
++
++		/*SpcDynamic constructors, destructors:{{{*/
++		SpcDynamic();
++		SpcDynamic(int sid,int nodeid, int dof,int analysis_type);
++		~SpcDynamic();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Constraint virtual functions definitions: {{{*/
++		void   ConstrainNode(Nodes* nodes,Parameters* parameters);
++		bool   InAnalysis(int analysis_type);
++		/*}}}*/
++		/*SpcDynamic management:{{{ */
++		int    GetNodeId();
++		int    GetDof();
++		IssmDouble GetValue();
++		void   SetDynamicConstraint(Nodes* nodes,IssmDouble *yg_serial);
++		/*}}}*/
++
++};
++
++#endif  /* _SPCStatic_H_*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.h	(revision 12822)
+@@ -0,0 +1,50 @@
++/*!\file SpcStatic.h
++ * \brief: header file for spc object
++ */
++
++#ifndef _SPCStatic_H_
++#define _SPCStatic_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Object.h"
++class DataSet;
++/*}}}*/
++
++class SpcStatic: public Constraint{
++
++	private: 
++		int	sid; /*! id, to track it*/
++		int	nodeid; /*!node id*/
++		int dof; /*!component*/
++		IssmDouble value; /*value*/
++		int analysis_type;
++
++	public:
++
++		/*SpcStatic constructors, destructors:{{{*/
++		SpcStatic();
++		SpcStatic(int sid,int nodeid, int dof,IssmDouble value,int analysis_type);
++		~SpcStatic();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Constraint virtual functions definitions: {{{*/
++		void   ConstrainNode(Nodes* nodes,Parameters* parameters);
++		bool   InAnalysis(int analysis_type);
++		/*}}}*/
++		/*SpcStatic management:{{{ */
++		int    GetNodeId();
++		int    GetDof();
++		IssmDouble GetValue();
++		/*}}}*/
++
++};
++
++#endif  /* _SPCStatic_H_*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.h	(revision 12822)
+@@ -0,0 +1,52 @@
++/*!\file SpcTransient.h
++ * \brief: header file for spc object
++ */
++
++#ifndef _SPCTRANSIENT_H_
++#define _SPCTRANSIENT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Object.h"
++class DataSet;
++/*}}}*/
++
++class SpcTransient: public Constraint{
++
++	private: 
++		int	sid; /*! id, to track it*/
++		int	nodeid; /*!node id*/
++		int dof; /*!component*/
++		IssmDouble* values; /*different values in time*/
++		IssmDouble* times; /*different time steps*/
++		int nsteps; /*number of time steps*/
++		int analysis_type;
++
++	public:
++
++		/*SpcTransient constructors, destructors:{{{*/
++		SpcTransient();
++		SpcTransient(int sid,int nodeid, int dof,int nsteps, IssmDouble* times, IssmDouble* values,int analysis_type);
++		~SpcTransient();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Constraint virtual functions definitions: {{{*/
++		void   ConstrainNode(Nodes* nodes,Parameters* parameters);
++		bool   InAnalysis(int analysis_type);
++		/*}}}*/
++		/*SpcTransient management:{{{ */
++		int    GetNodeId();
++		int    GetDof();
++		IssmDouble GetValue();
++		/*}}}*/
++
++};
++
++#endif  /* _SPCTRANSIENT_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/Constraint.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/Constraint.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/Constraint.h	(revision 12822)
+@@ -0,0 +1,28 @@
++/*!\file:  Constraint.h
++ * \brief abstract class for Constraint object
++ * This class is a place holder for constraints
++ * It is derived from Object, so DataSets can contain them.
++ */ 
++
++
++#ifndef _CONSTRAINT_H_
++#define _CONSTRAINT_H_
++
++/*Headers:*/
++/*{{{*/
++class Nodes;
++#include "../Object.h"
++#include "../../toolkits/toolkits.h"
++/*}}}*/
++
++class Constraint: public Object{
++
++	public: 
++		
++		virtual      ~Constraint(){};
++		virtual void ConstrainNode(Nodes* nodes,Parameters* parameters)=0;
++		virtual bool InAnalysis(int analysis_type)=0;
++
++
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.cpp	(revision 12822)
+@@ -0,0 +1,141 @@
++/*!\file SpcDynamic.c
++ * \brief: implementation of the SpcDynamic object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../Container/Container.h"
++#include "../objects.h"
++
++/*SpcDynamic constructors and destructor*/
++/*FUNCTION 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){
++
++	sid=spc_sid;
++	nodeid=spc_nodeid;
++	dof=spc_dof;
++	value=0;
++	analysis_type=spc_analysis_type;
++	isset=false;
++
++	return;
++}
++/*}}}*/
++/*FUNCTION SpcDynamic::~SpcDynamic{{{*/
++SpcDynamic::~SpcDynamic(){
++	return;
++}
++/*}}}*/
++		
++/*Object virtual functions definitions:*/
++/*FUNCTION SpcDynamic::Echo {{{*/
++void SpcDynamic::Echo(void){
++
++	_printLine_("SpcDynamic:");
++	_printLine_("   sid: " << sid);
++	_printLine_("   nodeid: " << nodeid);
++	_printLine_("   dof: " << dof);
++	_printLine_("   value: " << value);
++	_printLine_("   isset: " <<(isset?"true":"false"));
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	return;
++}
++/*}}}*/
++/*FUNCTION SpcDynamic::DeepEcho {{{*/
++void SpcDynamic::DeepEcho(void){
++
++	this->Echo();
++	return;
++}		
++/*}}}*/
++/*FUNCTION SpcDynamic::Id {{{*/
++int    SpcDynamic::Id(void){ return sid; }
++/*}}}*/
++/*FUNCTION SpcDynamic::MyRank {{{*/
++int    SpcDynamic::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION SpcDynamic::ObjectEnum{{{*/
++int SpcDynamic::ObjectEnum(void){
++
++	return SpcDynamicEnum;
++
++}
++/*}}}*/
++/*FUNCTION SpcDynamic::copy {{{*/
++Object* SpcDynamic::copy() {
++	return new SpcDynamic(*this); 
++}
++/*}}}*/
++
++/*Constraint virtual functions definitions: */
++/*FUNCTION SpcDynamic::InAnalysis{{{*/
++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){
++
++	Node* node=NULL;
++
++	/*Chase through nodes and find the node to which this SpcDynamic applys: */
++	node=(Node*)nodes->GetObjectById(NULL,nodeid);
++
++	/*Apply constraint: */
++	if(node){ //in case the spc is dealing with a node on another cpu
++
++		/*We should first check that the value has been set... (test306)*/
++		node->ApplyConstraint(dof,value);
++	}
++}
++/*}}}*/
++
++/*SpcDynamic functions*/
++/*FUNCTION SpcDynamic::GetDof {{{*/
++int SpcDynamic::GetDof(){
++	return dof;
++}
++/*}}}*/
++/*FUNCTION SpcDynamic::GetNodeId {{{*/
++int   SpcDynamic::GetNodeId(){
++	
++	return nodeid;
++}
++/*}}}*/
++/*FUNCTION 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){
++
++	int pos;
++
++	Node* node=(Node*)nodes->GetObjectById(NULL,nodeid);
++	pos=node->GetDof(dof-1,GsetEnum);
++
++	this->value=yg_serial[pos];
++	this->isset=true;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.cpp	(revision 12822)
+@@ -0,0 +1,129 @@
++/*!\file SpcStatic.c
++ * \brief: implementation of the SpcStatic object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../Container/Container.h"
++#include "../objects.h"
++
++/*SpcStatic constructors and destructor*/
++/*FUNCTION 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){
++
++	sid=spc_sid;
++	nodeid=spc_nodeid;
++	dof=spc_dof;
++	value=spc_value;
++	analysis_type=spc_analysis_type;
++
++	return;
++}
++/*}}}*/
++/*FUNCTION SpcStatic::~SpcStatic{{{*/
++SpcStatic::~SpcStatic(){
++	return;
++}
++/*}}}*/
++		
++/*Object virtual functions definitions:*/
++/*FUNCTION SpcStatic::Echo {{{*/
++void SpcStatic::Echo(void){
++
++	_printLine_("SpcStatic:");
++	_printLine_("   sid: " << sid);
++	_printLine_("   nodeid: " << nodeid);
++	_printLine_("   dof: " << dof);
++	_printLine_("   value: " << value);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	return;
++}
++/*}}}*/
++/*FUNCTION SpcStatic::DeepEcho {{{*/
++void SpcStatic::DeepEcho(void){
++
++	_printLine_("SpcStatic:");
++	_printLine_("   sid: " << sid);
++	_printLine_("   nodeid: " << nodeid);
++	_printLine_("   dof: " << dof);
++	_printLine_("   value: " << value);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	return;
++}		
++/*}}}*/
++/*FUNCTION SpcStatic::Id {{{*/
++int    SpcStatic::Id(void){ return sid; }
++/*}}}*/
++/*FUNCTION SpcStatic::MyRank {{{*/
++int    SpcStatic::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION SpcStatic::ObjectEnum{{{*/
++int SpcStatic::ObjectEnum(void){
++
++	return SpcStaticEnum;
++
++}
++/*}}}*/
++/*FUNCTION SpcStatic::copy {{{*/
++Object* SpcStatic::copy() {
++	return new SpcStatic(*this); 
++}
++/*}}}*/
++
++/*Constraint virtual functions definitions: */
++/*FUNCTION SpcStatic::InAnalysis{{{*/
++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){
++
++	Node* node=NULL;
++
++	/*Chase through nodes and find the node to which this SpcStatic applys: */
++	node=(Node*)nodes->GetObjectById(NULL,nodeid);
++
++	/*Apply constraint: */
++	if(node){ //in case the spc is dealing with a node on another cpu
++		node->ApplyConstraint(dof,value);
++	}
++}
++/*}}}*/
++
++/*SpcStatic functions*/
++/*FUNCTION SpcStatic::GetDof {{{*/
++int SpcStatic::GetDof(){
++	return dof;
++}
++/*}}}*/
++/*FUNCTION SpcStatic::GetNodeId {{{*/
++int   SpcStatic::GetNodeId(){
++	
++	return nodeid;
++}
++/*}}}*/
++/*FUNCTION SpcStatic::GetValue {{{*/
++IssmDouble SpcStatic::GetValue(){
++	_assert_(!xIsNan<IssmDouble>(value));
++	return value;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp	(revision 12822)
+@@ -0,0 +1,176 @@
++/*!\file SpcTransient.c
++ * \brief: implementation of the SpcTransient object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../../include/include.h"
++#include "../../shared/shared.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../Container/Container.h"
++#include "../objects.h"
++
++/*SpcTransient constructors and destructor*/
++/*FUNCTION SpcTransient::SpcTransient(){{{*/
++SpcTransient::SpcTransient(){
++	sid=-1;
++	nodeid=-1;
++	dof=-1;
++	values=NULL;
++	times=NULL;
++	nsteps=-1;
++	analysis_type=-1;
++	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){
++
++	sid=spc_sid;
++	nodeid=spc_nodeid;
++	dof=spc_dof;
++	nsteps=spc_nsteps;
++	if(spc_nsteps){
++		values=xNew<IssmDouble>(spc_nsteps);
++		times=xNew<IssmDouble>(spc_nsteps);
++		xMemCpy<IssmDouble>(values,spc_values,nsteps);
++		xMemCpy<IssmDouble>(times,spc_times,nsteps);
++	}
++	analysis_type=spc_analysis_type;
++	return;
++}
++/*}}}*/
++/*FUNCTION SpcTransient::~SpcTransient{{{*/
++SpcTransient::~SpcTransient(){
++	xDelete<IssmDouble>(times);
++	xDelete<IssmDouble>(values);
++	return;
++}
++/*}}}*/
++		
++/*Object virtual functions definitions:*/
++/*FUNCTION SpcTransient::Echo {{{*/
++void SpcTransient::Echo(void){
++
++	int i;
++	_printLine_("SpcTransient:");
++	_printLine_("   sid: " << sid);
++	_printLine_("   nodeid: " << nodeid);
++	_printLine_("   dof: " << dof);
++	_printLine_("   nsteps: " << nsteps);
++	_printLine_("   analysis_type: " << EnumToStringx(analysis_type));
++	_printLine_("   steps|times|values");
++	for(i=0;i<nsteps;i++){
++		_printLine_(i << "-" << times[i] << ":" << values[i]);
++	}
++	return;
++}
++/*}}}*/
++/*FUNCTION SpcTransient::DeepEcho {{{*/
++void SpcTransient::DeepEcho(void){
++	this->Echo();
++}		
++/*}}}*/
++/*FUNCTION SpcTransient::Id {{{*/
++int    SpcTransient::Id(void){ return sid; }
++/*}}}*/
++/*FUNCTION SpcTransient::MyRank {{{*/
++int    SpcTransient::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION SpcTransient::ObjectEnum{{{*/
++int SpcTransient::ObjectEnum(void){
++
++	return SpcTransientEnum;
++
++}
++/*}}}*/
++/*FUNCTION 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){
++	
++	if (in_analysis_type==this->analysis_type) return true;
++	else return false;
++}
++/*}}}*/
++/*FUNCTION SpcTransient::ConstrainNode{{{*/
++void SpcTransient::ConstrainNode(Nodes* nodes,Parameters* parameters){
++
++	Node* node=NULL;
++	IssmDouble time=0;
++	int    i;
++	IssmDouble alpha=-1;
++	IssmDouble value;
++	bool   found=false;
++
++	/*Chase through nodes and find the node to which this SpcTransient applys: */
++	node=(Node*)nodes->GetObjectById(NULL,nodeid);
++	
++	if(node){ //in case the spc is dealing with a node on another cpu
++
++		/*Retrieve time in parameters: */
++		parameters->FindParam(&time,TimeEnum);
++
++		/*Now, go fetch value for this time: */
++		if (time<=times[0]){
++			value=values[0];
++			found=true;
++		}
++		else if (time>=times[nsteps-1]){
++			value=values[nsteps-1];
++			found=true;
++		}
++		else{
++			for(i=0;i<nsteps-1;i++){
++				if (times[i]<=time && time<times[i+1]){
++					alpha=(time-times[i])/(times[i+1]-times[i]);
++					value=(1-alpha)*values[i]+alpha*values[i+1];
++					found=true;
++					break;
++				}
++			}
++		}
++
++		if(!found)_error2_("could not find time segment for constraint");
++
++		/*Apply or relax constraint: */
++		if(xIsNan<IssmDouble>(value)){
++			node->RelaxConstraint(dof);
++		}
++		else node->ApplyConstraint(dof,value);
++	}
++}
++/*}}}*/
++
++/*SpcTransient functions*/
++/*FUNCTION SpcTransient::GetDof {{{*/
++int SpcTransient::GetDof(){
++	return dof;
++}
++/*}}}*/
++/*FUNCTION SpcTransient::GetNodeId {{{*/
++int   SpcTransient::GetNodeId(){
++	
++	return nodeid;
++}
++/*}}}*/
++/*FUNCTION SpcTransient::GetValue {{{*/
++IssmDouble SpcTransient::GetValue(){
++	return values[0];
++}
++/*}}}*/
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h	(revision 12822)
+@@ -0,0 +1,53 @@
++/*! \file TriaP1ElementResult.h 
++ *  \brief: header file for TriaP1ElementResult object
++ */
++
++
++#ifndef _TRIAP1ELEMENTRESULT_H_
++#define _TRIAP1ELEMENTRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Inputs/Input.h"
++#include "../../include/include.h"
++/*}}}*/
++
++class TriaP1ElementResult: public ElementResult{
++
++	private: 
++		int    enum_type;
++		IssmDouble values[3];
++		int    step;
++		IssmDouble time;
++
++	public:
++
++		/*TriaP1ElementResult constructors, destructors: {{{*/
++		TriaP1ElementResult();
++		TriaP1ElementResult(int enum_type,IssmDouble* values,int step,IssmDouble time);
++		~TriaP1ElementResult();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ElementResult virtual functions definitions: {{{*/
++		ElementResult* SpawnTriaElementResult(int* indices);
++		IssmDouble  GetTime(void){return time;};
++		int     GetStep(void){return step;};
++		void    ProcessUnits(Parameters* parameters);
++		int     NumberOfNodalValues(void);
++		void    PatchFill(int row, Patch* patch);
++		/*}}}*/
++		/*TriaP1ElementResult management: {{{*/
++		int   InstanceEnum();
++		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
++		void GetElementVectorFromResults(Vector* vector,int dof);
++		/*}}}*/
++
++};
++#endif  /* _TRIAP1ELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp	(revision 12822)
+@@ -0,0 +1,153 @@
++/*!\file PentaP1ElementResult.c
++ * \brief: implementation of the PentaP1ElementResult object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "./ElementResultLocal.h"
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*PentaP1ElementResult constructors and destructor*/
++/*FUNCTION PentaP1ElementResult::PentaP1ElementResult(){{{*/
++PentaP1ElementResult::PentaP1ElementResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::PentaP1ElementResult(int in_enum_type,IssmDouble* in_values,int in_step, IssmDouble in_time){{{*/
++PentaP1ElementResult::PentaP1ElementResult(int in_enum_type,IssmDouble* in_values,int in_step, IssmDouble in_time){
++
++	int i;
++
++	enum_type=in_enum_type;
++	for(i=0;i<6;i++)values[i]=in_values[i];
++	step=in_step;
++	time=in_time;
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::~PentaP1ElementResult(){{{*/
++PentaP1ElementResult::~PentaP1ElementResult(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION PentaP1ElementResult::Echo {{{*/
++void PentaP1ElementResult::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::DeepEcho{{{*/
++void PentaP1ElementResult::DeepEcho(void){
++
++	_printLine_("PentaP1ElementResult:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   values: [" << this->values[0] << " " << this->values[1] << " " << this->values[2] << " " << this->values[3] << " " << this->values[4] << " " << this->values[5] << "]");
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::Id{{{*/
++int    PentaP1ElementResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::MyRank{{{*/
++int    PentaP1ElementResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::ObjectEnum{{{*/
++int PentaP1ElementResult::ObjectEnum(void){
++
++	return PentaP1ElementResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::copy{{{*/
++Object* PentaP1ElementResult::copy() {
++	
++	return new PentaP1ElementResult(this->enum_type,this->values,this->step,this->time);
++
++}
++/*}}}*/
++
++/*ElementResult management*/
++/*FUNCTION PentaP1ElementResult::InstanceEnum{{{*/
++int PentaP1ElementResult::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::SpawnTriaElementResult{{{*/
++ElementResult* PentaP1ElementResult::SpawnTriaElementResult(int* indices){
++
++	/*output*/
++	TriaP1ElementResult* outresult=NULL;
++	IssmDouble newvalues[3];
++
++	/*Loop over the new indices*/
++	for(int i=0;i<3;i++){
++
++		/*Check index value*/
++		_assert_(indices[i]>=0 && indices[i]<6);
++
++		/*Assign value to new result*/
++		newvalues[i]=this->values[indices[i]];
++	}
++
++	/*Create new Tria result*/
++	outresult=new TriaP1ElementResult(this->enum_type,&newvalues[0],this->step,this->time);
++
++	/*Assign output*/
++	return outresult;
++
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::ProcessUnits{{{*/
++void PentaP1ElementResult::ProcessUnits(Parameters* parameters){
++	
++	UnitConversion(this->values,6,IuToExtEnum,this->enum_type);
++
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::NumberOfNodalValues{{{*/
++int PentaP1ElementResult::NumberOfNodalValues(void){
++	return 6;
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::PatchFill{{{*/
++void PentaP1ElementResult::PatchFill(int row, Patch* patch){
++	
++	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
++	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
++	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
++	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,6);
++
++}
++/*}}}*/
++/*FUNCTION PentaP1ElementResult::GetVectorFromResults{{{*/
++void PentaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
++
++	IssmDouble data[6];
++
++	if(numdofs!=6)_error2_("Result " << EnumToStringx(this->enum_type) << " is a PentaP1ElementResult and cannot write vector of " << numdofs << " dofs");
++	for(int i=0;i<6;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i];
++	vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
++
++} /*}}}*/
++/*FUNCTION PentaP1ElementResult::GetElementVectorFromResults{{{*/
++void PentaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
++
++	_error2_("Result " << EnumToStringx(enum_type) << " is a PentaP1ElementResult and should not write vector of size numberofelemenrs");
++} /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp	(revision 12822)
+@@ -0,0 +1,137 @@
++/*!\file DoubleElementResult.c
++ * \brief: implementation of the DoubleElementResult object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "./ElementResultLocal.h"
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*DoubleElementResult constructors and destructor*/
++/*FUNCTION DoubleElementResult::DoubleElementResult(){{{*/
++DoubleElementResult::DoubleElementResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::DoubleElementResult(int in_enum_type,IssmDouble in_value,int in_step, IssmDouble in_time){{{*/
++DoubleElementResult::DoubleElementResult(int in_enum_type,IssmDouble in_value,int in_step, IssmDouble in_time){
++
++	enum_type=in_enum_type;
++	value=in_value;
++	step=in_step;
++	time=in_time;
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::~DoubleElementResult(){{{*/
++DoubleElementResult::~DoubleElementResult(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION DoubleElementResult::Echo {{{*/
++void DoubleElementResult::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::DeepEcho{{{*/
++void DoubleElementResult::DeepEcho(void){
++
++	_printLine_("DoubleElementResult:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: " << this->value);
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::Id{{{*/
++int    DoubleElementResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION DoubleElementResult::MyRank{{{*/
++int    DoubleElementResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::ObjectEnum{{{*/
++int DoubleElementResult::ObjectEnum(void){
++
++	return DoubleElementResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::copy{{{*/
++Object* DoubleElementResult::copy() {
++
++	return new DoubleElementResult(this->enum_type,this->value,this->step,this->time);
++
++}
++/*}}}*/
++
++/*ElementResult management*/
++/*FUNCTION DoubleElementResult::InstanceEnum{{{*/
++int DoubleElementResult::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::SpawnTriaElementResult{{{*/
++ElementResult* DoubleElementResult::SpawnTriaElementResult(int* indices){
++
++	/*output*/
++	DoubleElementResult* outresult=new DoubleElementResult();
++
++	/*copy fields: */
++	outresult->enum_type=this->enum_type;
++	outresult->value=this->value;
++	outresult->time=this->time;
++	outresult->step=this->step;
++
++	/*Assign output*/
++	return outresult;
++
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::ProcessUnits{{{*/
++void DoubleElementResult::ProcessUnits(Parameters* parameters){
++	
++	this->value=UnitConversion(this->value,IuToExtEnum,this->enum_type);
++
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::NumberOfNodalValues{{{*/
++int DoubleElementResult::NumberOfNodalValues(void){
++	return 1;
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::PatchFill{{{*/
++void DoubleElementResult::PatchFill(int row, Patch* patch){
++	
++	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
++	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
++	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
++	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P0Enum,&this->value,1);
++
++}
++/*}}}*/
++/*FUNCTION DoubleElementResult::GetVectorFromResults{{{1*/
++void DoubleElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
++
++	_error_("cannot return vector on vertices");
++} /*}}}*/
++/*FUNCTION DoubleElementResult::GetElementVectorFromResults{{{1*/
++void DoubleElementResult::GetElementVectorFromResults(Vector* vector,int dof){
++
++	vector->SetValue(dof,value,INS_VAL);
++} /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp	(revision 12822)
+@@ -0,0 +1,136 @@
++/*!\file BoolElementResult.c
++ * \brief: implementation of the BoolElementResult object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "./ElementResultLocal.h"
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*BoolElementResult constructors and destructor*/
++/*FUNCTION BoolElementResult::BoolElementResult(){{{*/
++BoolElementResult::BoolElementResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::BoolElementResult(int in_enum_type,IssmDouble in_value,int in_step, IssmDouble in_time){{{*/
++BoolElementResult::BoolElementResult(int in_enum_type,bool in_value,int in_step, IssmDouble in_time){
++
++	enum_type=in_enum_type;
++	value=in_value;
++	step=in_step;
++	time=in_time;
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::~BoolElementResult(){{{*/
++BoolElementResult::~BoolElementResult(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION BoolElementResult::Echo {{{*/
++void BoolElementResult::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::DeepEcho{{{*/
++void BoolElementResult::DeepEcho(void){
++
++	_printLine_("BoolElementResult:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   value: "<<(this->value?"true":"false"));
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::Id{{{*/
++int    BoolElementResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION BoolElementResult::MyRank{{{*/
++int    BoolElementResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::ObjectEnum{{{*/
++int BoolElementResult::ObjectEnum(void){
++
++	return BoolElementResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::copy{{{*/
++Object* BoolElementResult::copy() {
++
++	return new BoolElementResult(this->enum_type,this->value,this->step,this->time);
++
++}
++/*}}}*/
++
++/*ElementResult management*/
++/*FUNCTION BoolElementResult::InstanceEnum{{{*/
++int BoolElementResult::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::SpawnTriaElementResult{{{*/
++ElementResult* BoolElementResult::SpawnTriaElementResult(int* indices){
++
++	/*output*/
++	BoolElementResult* outresult=new BoolElementResult();
++
++	/*copy fields: */
++	outresult->enum_type=this->enum_type;
++	outresult->value=this->value;
++	outresult->time=this->time;
++	outresult->step=this->step;
++
++	/*Assign output*/
++	return outresult;
++
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::ProcessUnits{{{*/
++void BoolElementResult::ProcessUnits(Parameters* parameters){
++// no op
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::NumberOfNodalValues{{{*/
++int BoolElementResult::NumberOfNodalValues(void){
++	return 1;
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::PatchFill{{{*/
++void BoolElementResult::PatchFill(int row, Patch* patch){
++	
++	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
++	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
++	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
++	IssmDouble IssmDoublevalue=this->value?1:0;
++	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P0Enum,&IssmDoublevalue,1);
++
++}
++/*}}}*/
++/*FUNCTION BoolElementResult::GetVectorFromResults{{{*/
++void BoolElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
++
++	_error2_("cannot return vector on vertices");
++} /*}}}*/
++/*FUNCTION BoolElementResult::GetElementVectorFromResults{{{*/
++void BoolElementResult::GetElementVectorFromResults(Vector* vector,int dof){
++
++	vector->SetValue(dof,value,INS_VAL);
++} /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h	(revision 12822)
+@@ -0,0 +1,54 @@
++/*! \file PentaP1ElementResult.h 
++ *  \brief: header file for PentaP1ElementResult object
++ *  this object is just a PentaP1Input with additional time and step info.
++ */
++
++
++#ifndef _PENTAP1ELEMENTRESULT_H_
++#define _PENTAP1ELEMENTRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Inputs/Input.h"
++#include "../../include/include.h"
++/*}}}*/
++
++class PentaP1ElementResult: public ElementResult{
++
++	private: 
++		int    enum_type;
++		IssmDouble values[6];
++		int    step;
++		IssmDouble time;
++
++	public:
++
++		/*PentaP1ElementResult constructors, destructors: {{{*/
++		PentaP1ElementResult();
++		PentaP1ElementResult(int enum_type,IssmDouble* values,int step, IssmDouble time);
++		~PentaP1ElementResult();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ElementResult virtual functions definitions: {{{*/
++		ElementResult* SpawnTriaElementResult(int* indices);
++		IssmDouble  GetTime(void){return time;};
++		int     GetStep(void){return step;};
++		void    ProcessUnits(Parameters* parameters);
++		int     NumberOfNodalValues(void);
++		void    PatchFill(int row, Patch* patch);
++		/*}}}*/
++		/*PentaP1ElementResult management: {{{*/
++		int   InstanceEnum();
++		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
++		void GetElementVectorFromResults(Vector* vector,int dof);
++		/*}}}*/
++
++};
++#endif  /* _PENTAP1ELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h	(revision 12822)
+@@ -0,0 +1,54 @@
++/*! \file DoubleElementResult.h 
++ *  \brief: header file for IssmDouble result object
++ *  A IssmDouble result object is just derived from a DoubleInput object, with additional time and step information.
++ */
++
++
++#ifndef _DOUBLEELEMENTRESULT_H_
++#define _DOUBLEELEMENTRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Inputs/Input.h"
++#include "../../include/include.h"
++class Parameters;
++/*}}}*/
++
++class DoubleElementResult: public ElementResult{
++
++	private: 
++		int    enum_type;
++		IssmDouble value;
++		int    step;
++		IssmDouble time;
++
++	public:
++
++		/*DoubleElementResult constructors, destructors: {{{*/
++		DoubleElementResult();
++		DoubleElementResult(int enum_type,IssmDouble value,int step,IssmDouble time);
++		~DoubleElementResult();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ElementResult virtual functions definitions: {{{*/
++		ElementResult* SpawnTriaElementResult(int* indices);
++		IssmDouble  GetTime(void){return time;};
++		int     GetStep(void){return step;};
++		void    ProcessUnits(Parameters* parameters);
++		int     NumberOfNodalValues(void);
++		void    PatchFill(int row, Patch* patch);
++		/*}}}*/
++		/*DoubleElementResult management: {{{*/
++		int   InstanceEnum();
++		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
++		void GetElementVectorFromResults(Vector* vector,int dof);
++		/*}}}*/
++};
++#endif  /* _DOUBLEELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/ElementResultLocal.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/ElementResultLocal.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/ElementResultLocal.h	(revision 12822)
+@@ -0,0 +1,11 @@
++/*!\file: ElementResultLocal.h
++ * \brief prototypes for ElementResultLocal.h
++ */ 
++
++#ifndef _ELEMENTRESULTLOCAL_H_
++#define  _ELEMENTRESULTLOCAL_H_
++
++class Parameters;
++
++#endif //ifndef _ELEMENTRESULTLOCAL_H_
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h	(revision 12822)
+@@ -0,0 +1,54 @@
++/*! \file BoolElementResult.h 
++ *  \brief: header file for bool result object
++ *  A boll result object is just derived from a BoolInput object, with additional time and step information.
++ */
++
++
++#ifndef _BOOLELEMENTRESULT_H_
++#define _BOOLELEMENTRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Inputs/Input.h"
++#include "../../include/include.h"
++class Parameters;
++/*}}}*/
++
++class BoolElementResult: public ElementResult{
++
++	private: 
++		int    enum_type;
++		bool   value;
++		int    step;
++		IssmDouble time;
++
++	public:
++
++		/*BoolElementResult constructors, destructors: {{{*/
++		BoolElementResult();
++		BoolElementResult(int enum_type,bool value,int step,IssmDouble time);
++		~BoolElementResult();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*ElementResult virtual functions definitions: {{{*/
++		ElementResult* SpawnTriaElementResult(int* indices);
++		IssmDouble  GetTime(void){return time;};
++		int     GetStep(void){return step;};
++		void    ProcessUnits(Parameters* parameters);
++		int     NumberOfNodalValues(void);
++		void    PatchFill(int row, Patch* patch);
++		/*}}}*/
++		/*BoolElementResult management: {{{*/
++		int   InstanceEnum();
++		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
++		void GetElementVectorFromResults(Vector* vector,int dof);
++		/*}}}*/
++};
++#endif  /* _BOOLELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp	(revision 12822)
+@@ -0,0 +1,140 @@
++/*!\file TriaP1ElementResult.c
++ * \brief: implementation of the TriaP1ElementResult object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "./ElementResultLocal.h"
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++
++/*TriaP1ElementResult constructors and destructor*/
++/*FUNCTION TriaP1ElementResult::TriaP1ElementResult(){{{*/
++TriaP1ElementResult::TriaP1ElementResult(){
++	return;
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::TriaP1ElementResult(int in_enum_type,IssmDouble* in_values,int in_step, IssmDouble in_time){{{*/
++TriaP1ElementResult::TriaP1ElementResult(int in_enum_type,IssmDouble* in_values,int in_step, IssmDouble in_time){
++
++	enum_type=in_enum_type;
++	values[0]=in_values[0];
++	values[1]=in_values[1];
++	values[2]=in_values[2];
++	step=in_step;
++	time=in_time;
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::~TriaP1ElementResult(){{{*/
++TriaP1ElementResult::~TriaP1ElementResult(){
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION TriaP1ElementResult::Echo {{{*/
++void TriaP1ElementResult::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::DeepEcho{{{*/
++void TriaP1ElementResult::DeepEcho(void){
++		
++	_printLine_("TriaP1ElementResult:");
++	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++	_printLine_("   values: [" << this->values[0] << " " << this->values[1] << " " << this->values[2] << "]");
++	_printLine_("   step: " << this->step);
++	_printLine_("   time: " << this->time);
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::Id{{{*/
++int    TriaP1ElementResult::Id(void){ return -1; }
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::MyRank{{{*/
++int    TriaP1ElementResult::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::ObjectEnum{{{*/
++int TriaP1ElementResult::ObjectEnum(void){
++
++	return TriaP1ElementResultEnum;
++
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::copy{{{*/
++Object* TriaP1ElementResult::copy() {
++	
++	return new TriaP1ElementResult(this->enum_type,this->values,this->step,this->time);
++
++}
++/*}}}*/
++
++/*ElementResult management*/
++/*FUNCTION TriaP1ElementResult::InstanceEnum{{{*/
++int TriaP1ElementResult::InstanceEnum(void){
++
++	return this->enum_type;
++
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::SpawnTriaElementResult{{{*/
++ElementResult* TriaP1ElementResult::SpawnTriaElementResult(int* indices){
++
++	/*output*/
++	TriaP1ElementResult* outresult=NULL;
++
++	/*Create new Tria result (copy of current result)*/
++	outresult=new TriaP1ElementResult(this->enum_type,&this->values[0],this->step,this->time);
++
++	/*Assign output*/
++	return outresult;
++
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::ProcessUnits{{{*/
++void TriaP1ElementResult::ProcessUnits(Parameters* parameters){
++	
++	UnitConversion(this->values,3,IuToExtEnum,this->enum_type);
++
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::NumberOfNodalValues{{{*/
++int TriaP1ElementResult::NumberOfNodalValues(void){
++	return 3;
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::PatchFill{{{*/
++void TriaP1ElementResult::PatchFill(int row, Patch* patch){
++	
++	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
++	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
++	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
++	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,3);
++
++}
++/*}}}*/
++/*FUNCTION TriaP1ElementResult::GetVectorFromResults{{{*/
++void TriaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
++
++	IssmDouble data[3];
++
++	if(numdofs!=3)_error2_("Result " << EnumToStringx(this->enum_type) << " is a TriaP1ElementResult and cannot write vector of " << numdofs << " dofs");
++	for(int i=0;i<3;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i];
++	vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
++
++} /*}}}*/
++/*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{*/
++void TriaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
++	_error2_("Result " << EnumToStringx(enum_type) << " is a TriaP1ElementResult and should not write vector of size numberofelemenrs");
++} /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/ElementResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/ElementResult.h	(revision 12822)
+@@ -0,0 +1,32 @@
++/*!\file:  ElementResult.h
++ * \brief abstract class for ElementResult object
++ */ 
++
++
++#ifndef _ELEMENTRESULT_H_
++#define _ELEMENTRESULT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Object.h"
++/*}}}*/
++
++class ElementResult:public Object{
++
++	public: 
++		
++		virtual        ~ElementResult(){};
++		
++		virtual         ElementResult* SpawnTriaElementResult(int* indices)=0;
++		virtual IssmDouble  GetTime(void)=0;
++		virtual int     GetStep(void)=0;
++		virtual void    ProcessUnits(Parameters* parameters)=0;
++		virtual int     NumberOfNodalValues(void)=0;
++		virtual void    PatchFill(int row, Patch* patch)=0;
++		virtual int     InstanceEnum()=0;
++		virtual void    GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdof)=0;
++		virtual void    GetElementVectorFromResults(Vector* vector,int dof)=0;
++
++};
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 12822)
+@@ -0,0 +1,117 @@
++/*!\file:  Element.h
++ * \brief abstract class for Element object
++ * This class is a place holder for the Tria and the Penta elements. 
++ * It is derived from Element, so DataSets can contain them.
++ */ 
++
++
++#ifndef _ELEMENT_H_
++#define _ELEMENT_H_
++
++/*Headers:*/
++/*{{{*/
++#include "../Object.h"
++
++class DataSet;
++class Parameters;
++class Patch;
++class Matrix;
++class Vector;
++
++#include "../../toolkits/toolkits.h"
++/*}}}*/
++
++class Element: public Object,public Update{
++
++	public: 
++		
++		virtual        ~Element(){};
++	
++		virtual void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
++		virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
++		virtual void   CreateKMatrix(Matrix* Kff, Matrix*  Kfs,Vector* df)=0;
++		virtual void   CreatePVector(Vector* pf)=0;
++		virtual void   CreateJacobianMatrix(Matrix* Jff)=0;
++		virtual void   GetSolutionFromInputs(Vector* solution)=0;
++		virtual int    GetNodeIndex(Node* node)=0;
++		virtual int    Sid()=0;
++		virtual bool   IsFloating()=0; 
++		virtual bool   IsNodeOnShelf()=0; 
++		virtual bool   IsNodeOnShelfFromFlags(IssmDouble* flags)=0; 
++		virtual bool   IsOnBed()=0;
++		virtual void   GetInputListOnVertices(IssmDouble* pvalue,int enumtype)=0;
++		virtual void   GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue)=0;
++		virtual void   GetInputValue(IssmDouble* pvalue,Node* node,int enumtype)=0;
++		
++		virtual IssmDouble SurfaceArea(void)=0;
++		virtual void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum)=0;
++		virtual void   ComputeBasalStress(Vector* sigma_b)=0;
++		virtual void   ComputeStrainRate(Vector* eps)=0;
++		virtual void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes)=0;
++		virtual void   PatchFill(int* pcount, Patch* patch)=0;
++		virtual void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results)=0;
++		virtual void   DeleteResults(void)=0;
++		virtual void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type)=0;
++		virtual void   InputToResult(int enum_type,int step,IssmDouble time)=0;
++		virtual void   InputDuplicate(int original_enum,int new_enum)=0;
++		virtual void   InputCreate(IssmDouble scalar,int name,int code)=0;
++		virtual void   InputCreate(IssmDouble* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code)=0;
++		virtual void   ProcessResultsUnits(void)=0;
++		virtual void   RequestedOutput(int output_enum,int step,IssmDouble time)=0;
++		
++		virtual int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units)=0;
++		virtual void   InputScale(int enum_type,IssmDouble scale_factor)=0;
++		virtual void   GetVectorFromInputs(Vector* vector, int name_enum)=0;
++		virtual void   GetVectorFromResults(Vector* vector,int id,int enum_in,int interp)=0;
++		virtual void   InputArtificialNoise(int enum_type,IssmDouble min,IssmDouble max)=0;
++		virtual bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums)=0;
++		virtual void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
++		virtual int*   GetHorizontalNeighboorSids(void)=0;
++		virtual IssmDouble TimeAdapt()=0;
++		virtual void   MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding)=0;
++		virtual void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding)=0;
++		virtual void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm)=0;
++		virtual void   Delta18oParameterization(void)=0;
++		virtual void   SmbGradients()=0;
++		virtual int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
++		virtual void   ResetCoordinateSystem()=0;
++		virtual void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius)=0;
++
++		#ifdef _HAVE_RESPONSES_
++		virtual void   MinVel(IssmDouble* pminvel, bool process_units)=0;
++		virtual void   MaxVel(IssmDouble* pmaxvel, bool process_units)=0;
++		virtual void   MinVx(IssmDouble* pminvx, bool process_units)=0;
++		virtual void   MaxVx(IssmDouble* pmaxvx, bool process_units)=0;
++		virtual void   MaxAbsVx(IssmDouble* pmaxabsvx, bool process_units)=0;
++		virtual void   MinVy(IssmDouble* pminvy, bool process_units)=0;
++		virtual void   MaxVy(IssmDouble* pmaxvy, bool process_units)=0;
++		virtual void   MaxAbsVy(IssmDouble* pmaxabsvy, bool process_units)=0;
++		virtual void   MinVz(IssmDouble* pminvz, bool process_units)=0;
++		virtual void   MaxVz(IssmDouble* pmaxvz, bool process_units)=0;
++		virtual void   MaxAbsVz(IssmDouble* pmaxabsvz, bool process_units)=0;
++		virtual IssmDouble MassFlux(IssmDouble* segment,bool process_units)=0;
++		virtual void   ElementResponse(IssmDouble* presponse,int response_enum,bool process_units)=0;
++		virtual IssmDouble IceVolume(void)=0;
++		virtual IssmDouble TotalSmb(void)=0;
++		#endif
++
++		#ifdef _HAVE_CONTROL_
++		virtual void   Gradj(Vector* gradient,int control_type,int control_index)=0;
++		virtual IssmDouble ThicknessAbsMisfit(bool process_units  ,int weight_index)=0;
++		virtual IssmDouble SurfaceAbsVelMisfit(bool process_units ,int weight_index)=0;
++		virtual IssmDouble SurfaceRelVelMisfit(bool process_units ,int weight_index)=0;
++		virtual IssmDouble SurfaceLogVelMisfit(bool process_units ,int weight_index)=0;
++		virtual IssmDouble SurfaceLogVxVyMisfit(bool process_units,int weight_index)=0;
++		virtual IssmDouble SurfaceAverageVelMisfit(bool process_units,int weight_index)=0;
++		virtual IssmDouble ThicknessAbsGradient(bool process_units,int weight_index)=0;
++		virtual IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index)=0;
++		virtual IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index)=0;
++		virtual void   ControlInputGetGradient(Vector* 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   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data)=0;
++		virtual void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index)=0;
++		virtual void   InputControlUpdate(IssmDouble scalar,bool save_parameter)=0;
++		#endif
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12822)
+@@ -0,0 +1,5718 @@
++/*!\file Tria.cpp
++ * \brief: implementation of the Tria object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Element macros*/
++#define NUMVERTICES 3
++
++/*Constructors/destructor/copy*/
++/*FUNCTION Tria::Tria(){{{*/
++Tria::Tria(){
++
++	int i;
++
++	this->nodes=NULL;
++	this->matice=NULL;
++	this->matpar=NULL;
++	for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
++	this->inputs=NULL;
++	this->parameters=NULL;
++	this->results=NULL;
++
++}
++/*}}}*/
++/*FUNCTION Tria::Tria(int id, int sid,int index, IoModel* iomodel,int nummodels){{{*/
++Tria::Tria(int tria_id, int tria_sid, int index, IoModel* iomodel,int nummodels)
++	:TriaRef(nummodels)
++	,TriaHook(nummodels,index+1,iomodel){
++		
++		int i;
++		/*id: */
++		this->id=tria_id;
++		this->sid=tria_sid;
++
++		//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
++		this->parameters=NULL;
++
++		/*Build horizontalneighborsids list: */
++		_assert_(iomodel->Data(MeshElementconnectivityEnum));
++		//for (i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->elementconnectivity[3*index+i]-1;
++
++		/*intialize inputs and results: */
++		this->inputs=new Inputs();
++		this->results=new Results();
++
++		/*initialize pointers:*/
++		this->nodes=NULL;
++		this->matice=NULL;
++		this->matpar=NULL;
++
++}
++/*}}}*/
++/*FUNCTION Tria::~Tria(){{{*/
++Tria::~Tria(){
++	delete inputs;
++	delete results;
++	this->parameters=NULL;
++}
++/*}}}*/
++/*FUNCTION Tria::copy {{{*/
++Object* Tria::copy() {
++
++	int i;
++	Tria* tria=NULL;
++
++	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];
++
++	//deal with TriaHook 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();
++	tria->hmatice=(Hook*)this->hmatice->copy();
++	tria->hmatpar=(Hook*)this->hmatpar->copy();
++
++	/*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->results){
++		tria->results=(Results*)this->results->Copy();
++	}
++	else{
++		tria->results=new Results();
++	}
++	/*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];
++	tria->matice=(Matice*)tria->hmatice->delivers();
++	tria->matpar=(Matpar*)tria->hmatpar->delivers();
++
++	/*neighbors: */
++	for(i=0;i<3;i++)tria->horizontalneighborsids[i]=this->horizontalneighborsids[i];
++
++	return tria;
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION Tria::AverageOntoPartition {{{*/
++void  Tria::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
++
++	bool      already=false;
++	int       i,j;
++	int       partition[NUMVERTICES];
++	int       offsetsid[NUMVERTICES];
++	int       offsetdof[NUMVERTICES];
++	IssmDouble    area;
++	IssmDouble    mean;
++	IssmDouble    values[3];
++
++	/*First, get the area: */
++	area=this->GetArea();
++
++	/*Figure out the average for this element: */
++	this->GetSidList(&offsetsid[0]);
++	this->GetDofList1(&offsetdof[0]);
++	mean=0;
++	for(i=0;i<NUMVERTICES;i++){
++		partition[i]=reCast<int>(qmu_part[offsetsid[i]]);
++		mean=mean+1.0/NUMVERTICES*vertex_response[offsetdof[i]];
++	}
++
++	/*Add contribution: */
++	for(i=0;i<NUMVERTICES;i++){
++		already=false;
++		for(j=0;j<i;j++){
++			if (partition[i]==partition[j]){
++				already=true;
++				break;
++			}
++		}
++		if(!already){
++			partition_contributions->SetValue(partition[i],mean*area,ADD_VAL);
++			partition_areas->SetValue(partition[i],area,ADD_VAL);
++		};
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrix {{{*/
++void  Tria::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){
++
++	/*retreive parameters: */
++	ElementMatrix* Ke=NULL;
++	int analysis_type;
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*Checks in debugging mode{{{*/
++	_assert_(this->nodes && this->matice && this->matpar && this->parameters && this->inputs);
++	/*}}}*/
++	
++	/*Skip if water element*/
++	if(IsOnWater()) return;
++
++	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++		#ifdef _HAVE_DIAGNOSTIC_
++		case DiagnosticHorizAnalysisEnum:
++			Ke=CreateKMatrixDiagnosticMacAyeal();
++			break;
++		case AdjointHorizAnalysisEnum:
++			Ke=CreateKMatrixAdjointMacAyeal();
++			break;
++		case DiagnosticHutterAnalysisEnum:
++			Ke=CreateKMatrixDiagnosticHutter();
++			break;
++		 #endif
++		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
++			Ke=CreateKMatrixSlope();
++			break;
++		case PrognosticAnalysisEnum:
++			Ke=CreateKMatrixPrognostic();
++			break;
++		#ifdef _HAVE_HYDROLOGY_
++		case HydrologyAnalysisEnum:
++			Ke=CreateKMatrixHydrology();
++			break;
++		#endif
++		#ifdef _HAVE_BALANCED_
++		case BalancethicknessAnalysisEnum:
++			Ke=CreateKMatrixBalancethickness();
++			break;
++		#endif
++		#ifdef _HAVE_CONTROL_
++		case AdjointBalancethicknessAnalysisEnum:
++			Ke=CreateKMatrixAdjointBalancethickness();
++			break;
++		#endif
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global matrix*/
++	if(Ke){
++		Ke->AddToGlobal(Kff,Kfs);
++		delete Ke;
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixMelting {{{*/
++ElementMatrix* Tria::CreateKMatrixMelting(void){
++
++	/*Constants*/
++	const int  numdof=NUMVERTICES*NDOF1;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     heatcapacity,latentheat;
++	IssmDouble     Jdet,D_scalar;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     L[3];
++	GaussTria *gauss=NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	latentheat=matpar->GetLatentHeat();
++	heatcapacity=matpar->GetHeatCapacity();
++
++	/* Start looping on the number of gauss  (nodes on the bedrock) */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0], gauss);
++
++		D_scalar=latentheat/heatcapacity*gauss->weight*Jdet;
++
++		TripleMultiply(&L[0],numdof,1,0,
++					&D_scalar,1,1,0,
++					&L[0],1,numdof,0,
++					&Ke->values[0],1);
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixPrognostic {{{*/
++ElementMatrix* Tria::CreateKMatrixPrognostic(void){
++
++	switch(GetElementType()){
++		case P1Enum:
++			return CreateKMatrixPrognostic_CG();
++		case P1DGEnum:
++			return CreateKMatrixPrognostic_DG();
++		default:
++			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixPrognostic_CG {{{*/
++ElementMatrix* Tria::CreateKMatrixPrognostic_CG(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int        stabilization;
++	int        i,j,ig,dim;
++	IssmDouble     Jdettria,DL_scalar,dt,h;
++	IssmDouble     vel,vx,vy,dvxdx,dvydy;
++	IssmDouble     dvx[2],dvy[2];
++	IssmDouble     v_gauss[2]={0.0};
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     L[NUMVERTICES];
++	IssmDouble     B[2][NUMVERTICES];
++	IssmDouble     Bprime[2][NUMVERTICES];
++	IssmDouble     K[2][2]                        ={0.0};
++	IssmDouble     KDL[2][2]                      ={0.0};
++	IssmDouble     DL[2][2]                        ={0.0};
++	IssmDouble     DLprime[2][2]                   ={0.0};
++	GaussTria *gauss=NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	this->parameters->FindParam(&dim,MeshDimensionEnum);
++	this->parameters->FindParam(&stabilization,PrognosticStabilizationEnum);
++	Input* vxaverage_input=NULL;
++	Input* vyaverage_input=NULL;
++	if(dim==2){
++		vxaverage_input=inputs->GetInput(VxEnum); _assert_(vxaverage_input);
++		vyaverage_input=inputs->GetInput(VyEnum); _assert_(vyaverage_input);
++	}
++	else{
++		vxaverage_input=inputs->GetInput(VxAverageEnum); _assert_(vxaverage_input);
++		vyaverage_input=inputs->GetInput(VyAverageEnum); _assert_(vyaverage_input);
++	}
++	h=sqrt(2*this->GetArea());
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
++		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
++
++		vxaverage_input->GetInputValue(&vx,gauss);
++		vyaverage_input->GetInputValue(&vy,gauss);
++		vxaverage_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
++		vyaverage_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
++
++		DL_scalar=gauss->weight*Jdettria;
++
++		TripleMultiply( &L[0],1,numdof,1,
++					&DL_scalar,1,1,0,
++					&L[0],1,numdof,0,
++					&Ke->values[0],1);
++
++		GetBPrognostic(&B[0][0], &xyz_list[0][0], gauss);
++		GetBprimePrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
++
++		dvxdx=dvx[0];
++		dvydy=dvy[1];
++		DL_scalar=dt*gauss->weight*Jdettria;
++
++		DL[0][0]=DL_scalar*dvxdx;
++		DL[1][1]=DL_scalar*dvydy;
++		DLprime[0][0]=DL_scalar*vx;
++		DLprime[1][1]=DL_scalar*vy;
++
++		TripleMultiply( &B[0][0],2,numdof,1,
++					&DL[0][0],2,2,0,
++					&B[0][0],2,numdof,0,
++					&Ke->values[0],1);
++
++		TripleMultiply( &B[0][0],2,numdof,1,
++					&DLprime[0][0],2,2,0,
++					&Bprime[0][0],2,numdof,0,
++					&Ke->values[0],1);
++
++		if(stabilization==2){
++			/*Streamline upwinding*/
++			vel=sqrt(pow(vx,2.)+pow(vy,2.))+1.e-8;
++			K[0][0]=h/(2*vel)*vx*vx;
++			K[1][0]=h/(2*vel)*vy*vx;
++			K[0][1]=h/(2*vel)*vx*vy;
++			K[1][1]=h/(2*vel)*vy*vy;
++		}
++		else if(stabilization==1){
++			/*MacAyeal*/
++			vxaverage_input->GetInputAverage(&vx);
++			vyaverage_input->GetInputAverage(&vy);
++			K[0][0]=h/2.0*fabs(vx);
++			K[0][1]=0.;
++			K[1][0]=0.;
++			K[1][1]=h/2.0*fabs(vy);
++		}
++		if(stabilization==1 || stabilization==2){
++			KDL[0][0]=DL_scalar*K[0][0];
++			KDL[1][0]=DL_scalar*K[1][0];
++			KDL[0][1]=DL_scalar*K[0][1];
++			KDL[1][1]=DL_scalar*K[1][1];
++			TripleMultiply( &Bprime[0][0],2,numdof,1,
++						&KDL[0][0],2,2,0,
++						&Bprime[0][0],2,numdof,0,
++						&Ke->values[0],1);
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixPrognostic_DG {{{*/
++ElementMatrix* Tria::CreateKMatrixPrognostic_DG(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig,dim;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     Jdettria,dt,vx,vy;
++	IssmDouble     L[NUMVERTICES];
++	IssmDouble     B[2][NUMVERTICES];
++	IssmDouble     Bprime[2][NUMVERTICES];
++	IssmDouble     DL[2][2]={0.0};
++	IssmDouble     DLprime[2][2]={0.0};
++	IssmDouble     DL_scalar;
++	GaussTria  *gauss=NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	this->parameters->FindParam(&dim,MeshDimensionEnum);
++	Input* vxaverage_input=NULL;
++	Input* vyaverage_input=NULL;
++	if(dim==2){
++		vxaverage_input=inputs->GetInput(VxEnum); _assert_(vxaverage_input);
++		vyaverage_input=inputs->GetInput(VyEnum); _assert_(vyaverage_input);
++	}
++	else{
++		vxaverage_input=inputs->GetInput(VxAverageEnum); _assert_(vxaverage_input);
++		vyaverage_input=inputs->GetInput(VyAverageEnum); _assert_(vyaverage_input);
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		vxaverage_input->GetInputValue(&vx,gauss);
++		vyaverage_input->GetInputValue(&vy,gauss);
++
++		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
++		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
++
++		DL_scalar=gauss->weight*Jdettria;
++
++		TripleMultiply( &L[0],1,numdof,1,
++					&DL_scalar,1,1,0,
++					&L[0],1,numdof,0,
++					&Ke->values[0],1);
++
++		/*WARNING: B and Bprime are inverted compared to usual prognostic!!!!*/
++		GetBPrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
++		GetBprimePrognostic(&B[0][0], &xyz_list[0][0], gauss);
++
++		DL_scalar=-dt*gauss->weight*Jdettria;
++
++		DLprime[0][0]=DL_scalar*vx;
++		DLprime[1][1]=DL_scalar*vy;
++
++		TripleMultiply( &B[0][0],2,numdof,1,
++					&DLprime[0][0],2,2,0,
++					&Bprime[0][0],2,numdof,0,
++					&Ke->values[0],1);
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixSlope {{{*/
++ElementMatrix* Tria::CreateKMatrixSlope(void){
++
++	/*constants: */
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/* Intermediaries */
++	int        i,j,ig;
++	IssmDouble     DL_scalar,Jdet;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     L[1][3];
++	GaussTria *gauss = NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES);
++
++	/* Start looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++		
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++		DL_scalar=gauss->weight*Jdet;
++
++		GetL(&L[0][0], &xyz_list[0][0], gauss,NDOF1);
++
++		TripleMultiply(&L[0][0],1,3,1,
++					&DL_scalar,1,1,0,
++					&L[0][0],1,3,0,
++					&Ke->values[0],1);
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVector {{{*/
++void  Tria::CreatePVector(Vector* pf){
++
++	/*retrive parameters: */
++	ElementVector* pe=NULL;
++	int analysis_type;
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*asserts: {{{*/
++	/*if debugging mode, check that all pointers exist*/
++	_assert_(this->nodes && this->matice && this->matpar && this->parameters && this->inputs);
++	/*}}}*/
++	
++	/*Skip if water element*/
++	if(IsOnWater()) return;
++
++	/*Just branch to the correct load generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++		#ifdef _HAVE_DIAGNOSTIC_
++		case DiagnosticHorizAnalysisEnum:
++			pe=CreatePVectorDiagnosticMacAyeal();
++			break;
++		case DiagnosticHutterAnalysisEnum:
++			pe=CreatePVectorDiagnosticHutter();
++			break;
++		#endif
++		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
++			pe=CreatePVectorSlope();
++			break;
++		case PrognosticAnalysisEnum:
++			pe=CreatePVectorPrognostic();
++			break;
++		#ifdef _HAVE_HYDROLOGY_
++		case HydrologyAnalysisEnum:
++			pe=CreatePVectorHydrology();
++			break;
++		#endif
++		#ifdef _HAVE_BALANCED_
++		case BalancethicknessAnalysisEnum:
++			pe=CreatePVectorBalancethickness();
++			break;
++		#endif
++		#ifdef _HAVE_CONTROL_
++		case AdjointBalancethicknessAnalysisEnum:
++			pe=CreatePVectorAdjointBalancethickness();
++			break;
++		case AdjointHorizAnalysisEnum:
++			pe=CreatePVectorAdjointHoriz();
++			break;
++		#endif
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global Vector*/
++	if(pe){
++		pe->AddToGlobal(pf);
++		delete pe;
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorPrognostic{{{*/
++ElementVector* Tria::CreatePVectorPrognostic(void){
++
++	switch(GetElementType()){
++		case P1Enum:
++			return CreatePVectorPrognostic_CG();
++		case P1DGEnum:
++			return CreatePVectorPrognostic_DG();
++		default:
++			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorPrognostic_CG {{{*/
++ElementVector* Tria::CreatePVectorPrognostic_CG(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     Jdettria,dt;
++	IssmDouble     surface_mass_balance_g,basal_melting_g,basal_melting_correction_g,thickness_g;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     L[NUMVERTICES];
++	GaussTria* gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	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* basal_melting_correction_input=inputs->GetInput(BasalforcingsMeltingRateCorrectionEnum);
++	Input* thickness_input=inputs->GetInput(ThicknessEnum);                             _assert_(thickness_input);
++
++	/*Initialize basal_melting_correction_g to 0, do not forget!:*/
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
++		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
++
++		surface_mass_balance_input->GetInputValue(&surface_mass_balance_g,gauss);
++		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
++		thickness_input->GetInputValue(&thickness_g,gauss);
++		if(basal_melting_correction_input)
++		 basal_melting_correction_input->GetInputValue(&basal_melting_correction_g,gauss);
++		else
++		 basal_melting_correction_g=0.;
++
++		for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(thickness_g+dt*(surface_mass_balance_g-basal_melting_g-basal_melting_correction_g))*L[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorPrognostic_DG {{{*/
++ElementVector* Tria::CreatePVectorPrognostic_DG(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     Jdettria,dt;
++	IssmDouble     surface_mass_balance_g,basal_melting_g,thickness_g;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     L[NUMVERTICES];
++	GaussTria* gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	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* thickness_input=inputs->GetInput(ThicknessEnum);                             _assert_(thickness_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
++		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
++
++		surface_mass_balance_input->GetInputValue(&surface_mass_balance_g,gauss);
++		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
++		thickness_input->GetInputValue(&thickness_g,gauss);
++
++		for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(thickness_g+dt*(surface_mass_balance_g-basal_melting_g))*L[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorSlope {{{*/
++ElementVector* Tria::CreatePVectorSlope(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++	
++	/*Intermediaries */
++	int        i,j,ig;
++	int        analysis_type;
++	IssmDouble     Jdet;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     slope[2];
++	IssmDouble     basis[3];
++	GaussTria* gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* slope_input=NULL;
++	if ( (analysis_type==SurfaceSlopeXAnalysisEnum) || (analysis_type==SurfaceSlopeYAnalysisEnum)){
++		slope_input=inputs->GetInput(SurfaceEnum); _assert_(slope_input);
++	}
++	if ( (analysis_type==BedSlopeXAnalysisEnum) || (analysis_type==BedSlopeYAnalysisEnum)){
++		slope_input=inputs->GetInput(BedEnum);     _assert_(slope_input);
++	}
++		
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctions(basis, gauss);
++
++		slope_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
++
++		if ( (analysis_type==SurfaceSlopeXAnalysisEnum) || (analysis_type==BedSlopeXAnalysisEnum)){
++			for(i=0;i<numdof;i++) pe->values[i]+=Jdet*gauss->weight*slope[0]*basis[i];
++		}
++		if ( (analysis_type==SurfaceSlopeYAnalysisEnum) || (analysis_type==BedSlopeYAnalysisEnum)){
++			for(i=0;i<numdof;i++) pe->values[i]+=Jdet*gauss->weight*slope[1]*basis[i];
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateJacobianMatrix{{{*/
++void  Tria::CreateJacobianMatrix(Matrix* Jff){
++
++	/*retrieve parameters: */
++	ElementMatrix* Ke=NULL;
++	int analysis_type;
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*Checks in debugging {{{*/
++	_assert_(this->nodes && this->matice && this->matpar && this->parameters && this->inputs);
++	/*}}}*/
++
++	/*Skip if water element*/
++	if(IsOnWater()) return;
++
++	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++#ifdef _HAVE_DIAGNOSTIC_
++		case DiagnosticHorizAnalysisEnum:
++			Ke=CreateJacobianDiagnosticMacayeal();
++			break;
++#endif
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global matrix*/
++	if(Ke){
++		Ke->AddToGlobal(Jff);
++		delete Ke;
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::ComputeBasalStress {{{*/
++void  Tria::ComputeBasalStress(Vector* eps){
++	_error2_("Not Implemented yet");
++}
++/*}}}*/
++/*FUNCTION Tria::ComputeStrainRate {{{*/
++void  Tria::ComputeStrainRate(Vector* eps){
++	_error2_("Not Implemented yet");
++}
++/*}}}*/
++/*FUNCTION Tria::ComputeStressTensor {{{*/
++void  Tria::ComputeStressTensor(){
++
++	int         iv;
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      pressure,viscosity;
++	IssmDouble      epsilon[3]; /* epsilon=[exx,eyy,exy];*/
++	IssmDouble      sigma_xx[NUMVERTICES];
++	IssmDouble		sigma_yy[NUMVERTICES];
++	IssmDouble		sigma_zz[NUMVERTICES]={0,0,0};
++	IssmDouble      sigma_xy[NUMVERTICES];
++	IssmDouble		sigma_xz[NUMVERTICES]={0,0,0};
++	IssmDouble		sigma_yz[NUMVERTICES]={0,0,0};
++	GaussTria* gauss=NULL;
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Retrieve all inputs we will be needing: */
++	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input);
++	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->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		matice->GetViscosity2d(&viscosity,&epsilon[0]);
++		pressure_input->GetInputValue(&pressure,gauss);
++
++		/*Compute Stress*/
++		sigma_xx[iv]=2*viscosity*epsilon[0]-pressure; // sigma = nu eps - pressure
++		sigma_yy[iv]=2*viscosity*epsilon[1]-pressure;
++		sigma_xy[iv]=2*viscosity*epsilon[2];
++	}
++	
++	/*Add Stress tensor components into inputs*/
++	this->inputs->AddInput(new TriaP1Input(StressTensorxxEnum,&sigma_xx[0]));
++	this->inputs->AddInput(new TriaP1Input(StressTensorxyEnum,&sigma_xy[0]));
++	this->inputs->AddInput(new TriaP1Input(StressTensorxzEnum,&sigma_xz[0]));
++	this->inputs->AddInput(new TriaP1Input(StressTensoryyEnum,&sigma_yy[0]));
++	this->inputs->AddInput(new TriaP1Input(StressTensoryzEnum,&sigma_yz[0]));
++	this->inputs->AddInput(new TriaP1Input(StressTensorzzEnum,&sigma_zz[0]));
++
++	/*Clean up and return*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::Configure {{{*/
++void  Tria::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
++	
++	/*go into parameters and get the analysis_counter: */
++	int analysis_counter;
++	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
++
++	/*Get Element type*/
++	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);
++	this->hmatice->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();
++	else this->nodes=NULL;
++	this->matice=(Matice*)this->hmatice->delivers();
++	this->matpar=(Matpar*)this->hmatpar->delivers();
++
++	/*point parameters to real dataset: */
++	this->parameters=parametersin;
++
++	/*get inputs configured too: */
++	this->inputs->Configure(parameters);
++
++}
++/*}}}*/
++/*FUNCTION Tria::DeepEcho{{{*/
++void Tria::DeepEcho(void){
++
++	_printLine_("Tria:");
++	_printLine_("   id: " << id);
++	if(nodes){
++		nodes[0]->DeepEcho();
++		nodes[1]->DeepEcho();
++		nodes[2]->DeepEcho();
++	}
++	else _printLine_("nodes = NULL");
++
++	if (matice) matice->DeepEcho();
++	else _printLine_("matice = NULL");
++
++	if (matpar) matpar->DeepEcho();
++	else _printLine_("matpar = NULL");
++
++	_printLine_("   parameters");
++	if (parameters) parameters->DeepEcho();
++	else _printLine_("parameters = NULL");
++
++	_printLine_("   inputs");
++	if (inputs) inputs->DeepEcho();
++	else _printLine_("inputs=NULL");
++
++	if (results) results->DeepEcho();
++	else _printLine_("results=NULL");
++
++	_printLine_("neighboor sids: ");
++	_printLine_(" " << horizontalneighborsids[0] << " " << horizontalneighborsids[1] << " " << horizontalneighborsids[2]);
++	
++	return;
++}
++/*}}}*/
++/*FUNCTION Tria::DeleteResults {{{*/
++void  Tria::DeleteResults(void){
++
++	/*Delete and reinitialize results*/
++	delete this->results;
++	this->results=new Results();
++
++}
++/*}}}*/
++/*FUNCTION Tria::Delta18oParameterization{{{*/
++void  Tria::Delta18oParameterization(void){
++	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
++	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
++	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
++	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
++	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
++	IssmDouble time,yts,finaltime;
++	this->parameters->FindParam(&time,TimeEnum);
++	this->parameters->FindParam(&yts,ConstantsYtsEnum);
++	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
++
++	/*Recover present day temperature and precipitation*/
++	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
++	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
++	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
++	GaussTria* gauss=new GaussTria();
++	for(int month=0;month<12;month++) {
++		for(int iv=0;iv<NUMVERTICES;iv++) {
++			gauss->GaussVertex(iv);
++			input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);
++			input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
++			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
++			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++		}
++	}
++	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
++	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
++	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
++	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
++	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
++	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
++	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
++
++	/*Compute the temperature and precipitation*/
++	for(int iv=0;iv<NUMVERTICES;iv++){
++		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
++					Delta18oPresent, Delta18oLgm, Delta18oTime,
++					&PrecipitationsPresentday[iv][0], 
++					&TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 
++					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
++	}
++	/*Update inputs*/ 
++	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
++	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
++	for (int imonth=0;imonth<12;imonth++) {
++		for(int iv=0;iv<NUMVERTICES;iv++) {
++			TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
++			NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
++			TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
++			NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
++		}
++	}
++	this->inputs->AddInput(NewTemperatureInput);
++	this->inputs->AddInput(NewPrecipitationInput);
++
++	/*clean-up*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::Echo{{{*/
++void Tria::Echo(void){
++	_printLine_("Tria:");
++	_printLine_("   id: " << id);
++	if(nodes){
++		nodes[0]->Echo();
++		nodes[1]->Echo();
++		nodes[2]->Echo();
++	}
++	else _printLine_("nodes = NULL");
++
++	if (matice) matice->Echo();
++	else _printLine_("matice = NULL");
++
++	if (matpar) matpar->Echo();
++	else _printLine_("matpar = NULL");
++
++	_printLine_("   parameters");
++	if (parameters) parameters->Echo();
++	else _printLine_("parameters = NULL");
++
++	_printLine_("   inputs");
++	if (inputs) inputs->Echo();
++	else _printLine_("inputs=NULL");
++
++	if (results) results->Echo();
++	else _printLine_("results=NULL");
++
++	_printLine_("neighboor sids: ");
++	_printLine_(" " << horizontalneighborsids[0] << " " << horizontalneighborsids[1] << " " << horizontalneighborsids[2]);
++}
++/*}}}*/
++/*FUNCTION Tria::ObjectEnum{{{*/
++int Tria::ObjectEnum(void){
++
++	return TriaEnum;
++
++}
++/*}}}*/
++/*FUNCTION Tria::GetArea {{{*/
++IssmDouble Tria::GetArea(void){
++
++	IssmDouble area=0;
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble x1,y1,x2,y2,x3,y3;
++
++	/*Get xyz list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	x1=xyz_list[0][0]; y1=xyz_list[0][1];
++	x2=xyz_list[1][0]; y2=xyz_list[1][1];
++	x3=xyz_list[2][0]; y3=xyz_list[2][1];
++ 
++	_assert_(x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1>0);
++	return (x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1)/2;
++}
++/*}}}*/
++/*FUNCTION Tria::GetDofList {{{*/
++void  Tria::GetDofList(int** pdoflist, int approximation_enum,int setenum){
++
++	int i,j;
++	int count=0;
++	int numberofdofs=0;
++	int* doflist=NULL;
++
++	/*First, figure out size of doflist and create it: */
++	for(i=0;i<3;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
++	doflist=xNew<int>(numberofdofs);
++
++	/*Populate: */
++	count=0;
++	for(i=0;i<3;i++){
++		nodes[i]->GetDofList(doflist+count,approximation_enum,setenum);
++		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
++	}
++
++	/*Assign output pointers:*/
++	*pdoflist=doflist;
++}
++/*}}}*/
++/*FUNCTION Tria::GetDofList1 {{{*/
++void  Tria::GetDofList1(int* doflist){
++
++	int i;
++	for(i=0;i<3;i++) doflist[i]=nodes[i]->GetDofList1();
++
++}
++/*}}}*/
++/*FUNCTION Tria::GetElementType {{{*/
++int Tria::GetElementType(){
++
++	/*return TriaRef field*/
++	return this->element_type;
++
++}
++/*}}}*/
++/*FUNCTION Tria::GetHorizontalNeighboorSids {{{*/
++int* Tria::GetHorizontalNeighboorSids(){
++
++	/*return TriaRef field*/
++	return &this->horizontalneighborsids[0];
++
++}
++/*}}}*/
++/*FUNCTION Tria::GetNodeIndex {{{*/
++int Tria::GetNodeIndex(Node* node){
++
++	_assert_(nodes);
++	for(int i=0;i<NUMVERTICES;i++){
++		if(node==nodes[i])
++		 return i;
++	}
++	_error2_("Node provided not found among element nodes");
++}
++/*}}}*/
++/*FUNCTION Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype) {{{*/
++void Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype){
++
++	/*Intermediaries*/
++	IssmDouble     value[NUMVERTICES];
++	GaussTria *gauss              = NULL;
++
++	/*Recover input*/
++	Input* input=inputs->GetInput(enumtype);
++	if (!input) _error2_("Input " << EnumToStringx(enumtype) << " not found in element");
++
++	/*Checks in debugging mode*/
++	_assert_(pvalue);
++
++	/* Start looping on the number of vertices: */
++	gauss=new GaussTria();
++	for (int iv=0;iv<NUMVERTICES;iv++){
++		gauss->GaussVertex(iv);
++		input->GetInputValue(&pvalue[iv],gauss);
++	}
++
++	/*clean-up*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue) {{{*/
++void Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue){
++
++	IssmDouble     value[NUMVERTICES];
++	GaussTria *gauss = NULL;
++	Input     *input = inputs->GetInput(enumtype);
++
++	/*Checks in debugging mode*/
++	_assert_(pvalue);
++
++	/* Start looping on the number of vertices: */
++	if (input){
++		gauss=new GaussTria();
++		for (int iv=0;iv<NUMVERTICES;iv++){
++			gauss->GaussVertex(iv);
++			input->GetInputValue(&pvalue[iv],gauss);
++		}
++	}
++	else{
++		for (int iv=0;iv<NUMVERTICES;iv++) pvalue[iv]=defaultvalue;
++	}
++
++	/*clean-up*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue,int index) TO BE REMOVED{{{*/
++void Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue,int index){
++
++	IssmDouble     value[NUMVERTICES];
++	GaussTria *gauss = NULL;
++	Input     *input = inputs->GetInput(enumtype);
++
++	/*Checks in debugging mode*/
++	_assert_(pvalue);
++
++	/* Start looping on the number of vertices: */
++	if (input){
++		gauss=new GaussTria();
++		for (int iv=0;iv<NUMVERTICES;iv++){
++			gauss->GaussVertex(iv);
++			input->GetInputValue(&pvalue[iv],gauss,index);
++		}
++	}
++	else{
++		for (int iv=0;iv<NUMVERTICES;iv++) pvalue[iv]=defaultvalue;
++	}
++
++	/*clean-up*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::GetInputValue(IssmDouble* pvalue,Node* node,int enumtype) {{{*/
++void Tria::GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){
++
++	Input* input=inputs->GetInput(enumtype);
++	if(!input) _error2_("No input of type " << EnumToStringx(enumtype) << " found in tria");
++
++	GaussTria* gauss=new GaussTria();
++	gauss->GaussVertex(this->GetNodeIndex(node));
++
++	input->GetInputValue(pvalue,gauss);
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::GetSidList {{{*/
++void  Tria::GetSidList(int* sidlist){
++	for(int i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->GetSidList();
++}
++/*}}}*/
++/*FUNCTION Tria::GetConnectivityList {{{*/
++void  Tria::GetConnectivityList(int* connectivity){
++	for(int i=0;i<NUMVERTICES;i++) connectivity[i]=nodes[i]->GetConnectivity();
++}
++/*}}}*/
++/*FUNCTION Tria::GetSolutionFromInputs{{{*/
++void  Tria::GetSolutionFromInputs(Vector* solution){
++
++	/*retrive parameters: */
++	int analysis_type;
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++	#ifdef _HAVE_DIAGNOSTIC_
++	case DiagnosticHorizAnalysisEnum:
++		GetSolutionFromInputsDiagnosticHoriz(solution);
++		break;
++	case DiagnosticHutterAnalysisEnum:
++		GetSolutionFromInputsDiagnosticHutter(solution);
++		break;
++	#endif
++	#ifdef _HAVE_HYDROLOGY_
++	case HydrologyAnalysisEnum:
++		GetSolutionFromInputsHydrology(solution);
++		break;
++	#endif
++	default:
++		_error2_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION Tria::GetStrainRate2d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){{{*/
++void Tria::GetStrainRate2d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){
++	/*Compute the 2d Strain Rate (3 components):
++	 * epsilon=[exx eyy exy] */
++
++	int i;
++	IssmDouble epsilonvx[3];
++	IssmDouble epsilonvy[3];
++
++	/*Check that both inputs have been found*/
++	if (!vx_input || !vy_input){
++		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");
++	}
++
++	/*Get strain rate assuming that epsilon has been allocated*/
++	vx_input->GetVxStrainRate2d(epsilonvx,xyz_list,gauss);
++	vy_input->GetVyStrainRate2d(epsilonvy,xyz_list,gauss);
++
++	/*Sum all contributions*/
++	for(i=0;i<3;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i];
++}
++/*}}}*/
++/*FUNCTION Tria::GetVectorFromInputs{{{*/
++void  Tria::GetVectorFromInputs(Vector* vector,int input_enum){
++
++	int doflist1[NUMVERTICES];
++
++	/*Get out if this is not an element input*/
++	if(!IsInput(input_enum)) return;
++
++	/*Prepare index list*/
++	this->GetDofList1(&doflist1[0]);
++
++	/*Get input (either in element or material)*/
++	Input* input=inputs->GetInput(input_enum);
++	if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in element");
++
++	/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
++	input->GetVectorFromInputs(vector,&doflist1[0]);
++}
++/*}}}*/
++/*FUNCTION Tria::GetVectorFromResults{{{*/
++void  Tria::GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp){
++
++	/*Get result*/
++	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
++	if(elementresult->InstanceEnum()!=enum_in){
++		_error_("Results of offset %i is %s, when %s was expected",offset,EnumToStringx(elementresult->InstanceEnum()),EnumToStringx(enum_in));
++	}
++	if(interp==P1Enum){
++		int doflist1[NUMVERTICES];
++		int connectivity[NUMVERTICES];
++		this->GetSidList(&doflist1[0]);
++		this->GetConnectivityList(&connectivity[0]);
++		elementresult->GetVectorFromResults(vector,&doflist1[0],&connectivity[0],NUMVERTICES);
++	}
++	else if(interp==P0Enum){
++		elementresult->GetElementVectorFromResults(vector,sid);
++	}
++	else{
++		_printLine_("Interpolation " << EnumToStringx(interp) << " not supported");
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::Id {{{*/
++int    Tria::Id(){
++	
++	return id;
++
++}
++/*}}}*/
++/*FUNCTION Tria::Sid {{{*/
++int    Tria::Sid(){
++	
++	return sid;
++
++}
++/*}}}*/
++/*FUNCTION Tria::InputArtificialNoise{{{*/
++void  Tria::InputArtificialNoise(int enum_type,IssmDouble min,IssmDouble max){
++
++	Input* input=NULL;
++
++	/*Make a copy of the original input: */
++	input=(Input*)this->inputs->GetInput(enum_type);
++	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
++
++	/*ArtificialNoise: */
++	input->ArtificialNoise(min,max);
++}
++/*}}}*/
++/*FUNCTION Tria::InputConvergence{{{*/
++bool Tria::InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums){
++
++	bool    converged=true;
++	int     i;
++	Input** new_inputs=NULL;
++	Input** old_inputs=NULL;
++
++	new_inputs=xNew<Input*>(num_enums/2); //half the enums are for the new inputs
++	old_inputs=xNew<Input*>(num_enums/2); //half the enums are for the old inputs
++
++	for(i=0;i<num_enums/2;i++){
++		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
++		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
++		if(!new_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
++		if(!old_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
++	}
++
++	/*ok, we've got the inputs (new and old), now loop throught the number of criterions and fill the eps array:*/
++	for(i=0;i<num_criterionenums;i++){
++		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,criterionenums[i]);
++		if(eps[i]>criterionvalues[i]) converged=false; 
++	}
++
++	/*clean up and return*/
++	xDelete<Input*>(new_inputs);
++	xDelete<Input*>(old_inputs);
++	return converged;
++}
++/*}}}*/
++/*FUNCTION Tria::InputDepthAverageAtBase {{{*/
++void  Tria::InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum){
++
++	/*New input*/
++	Input* oldinput=NULL;
++	Input* newinput=NULL;
++
++	/*copy input of enum_type*/
++	if (object_enum==MeshElementsEnum)
++	 oldinput=(Input*)this->inputs->GetInput(enum_type);
++	else if (object_enum==MaterialsEnum)
++	 oldinput=(Input*)this->matice->inputs->GetInput(enum_type);
++	else
++	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
++	if(!oldinput)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
++	newinput=(Input*)oldinput->copy();
++
++	/*Assign new name (average)*/
++	newinput->ChangeEnum(average_enum_type);
++
++	/*Add new input to current element*/
++	if (object_enum==MeshElementsEnum)
++	 this->inputs->AddInput((Input*)newinput);
++	else if (object_enum==MaterialsEnum)
++	 this->matice->inputs->AddInput((Input*)newinput);
++	else
++	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
++}
++/*}}}*/
++/*FUNCTION Tria::InputDuplicate{{{*/
++void  Tria::InputDuplicate(int original_enum,int new_enum){
++
++	/*Call inputs method*/
++	if (IsInput(original_enum)) inputs->DuplicateInput(original_enum,new_enum);
++
++}
++/*}}}*/
++/*FUNCTION Tria::InputScale{{{*/
++void  Tria::InputScale(int enum_type,IssmDouble scale_factor){
++
++	Input* input=NULL;
++
++	/*Make a copy of the original input: */
++	input=(Input*)this->inputs->GetInput(enum_type);
++	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
++
++	/*Scale: */
++	input->Scale(scale_factor);
++}
++/*}}}*/
++/*FUNCTION Tria::InputToResult{{{*/
++void  Tria::InputToResult(int enum_type,int step,IssmDouble time){
++
++	int    i;
++	Input *input = NULL;
++
++	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
++	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(enum_type);
++	else input=this->inputs->GetInput(enum_type);
++	//if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found in tria->inputs");
++	if(!input)return;
++
++	/*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result 
++	 * object out of the input, with the additional step and time information: */
++	this->results->AddObject((Object*)input->SpawnResult(step,time));
++	
++	#ifdef _HAVE_CONTROL_
++	if(input->ObjectEnum()==ControlInputEnum){
++		if(((ControlInput*)input)->gradient!=NULL) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
++	}
++	#endif
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromConstant(int value, int name);{{{*/
++void  Tria::InputUpdateFromConstant(int constant, int name){
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	/*update input*/
++	this->inputs->AddInput(new IntInput(name,constant));
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromConstant(IssmDouble value, int name);{{{*/
++void  Tria::InputUpdateFromConstant(IssmDouble constant, int name){
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	/*update input*/
++	this->inputs->AddInput(new DoubleInput(name,constant));
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromConstant(bool value, int name);{{{*/
++void  Tria::InputUpdateFromConstant(bool constant, int name){
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	/*update input*/
++	this->inputs->AddInput(new BoolInput(name,constant));
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromIoModel{{{*/
++void Tria::InputUpdateFromIoModel(int index, IoModel* iomodel){ //i is the element index
++
++	/*Intermediaries*/
++	int    i,j;
++	int    tria_vertex_ids[3];
++	IssmDouble nodeinputs[3];
++	IssmDouble cmmininputs[3];
++	IssmDouble cmmaxinputs[3];
++	bool   control_analysis=false;
++	int    num_control_type;
++	IssmDouble yts;
++	int    num_cm_responses;
++   
++	/*Get parameters: */
++	iomodel->Constant(&yts,ConstantsYtsEnum); 
++	iomodel->Constant(&control_analysis,InversionIscontrolEnum);
++	if(control_analysis) iomodel->Constant(&num_control_type,InversionNumControlParametersEnum);
++	if(control_analysis) iomodel->Constant(&num_cm_responses,InversionNumCostFunctionsEnum);
++
++	/*Recover vertices ids needed to initialize inputs*/
++	for(i=0;i<3;i++){ 
++		tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab
++	}
++
++	/*Control Inputs*/
++	#ifdef _HAVE_CONTROL_
++	if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
++		for(i=0;i<num_control_type;i++){
++			switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
++				case BalancethicknessThickeningRateEnum:
++					if (iomodel->Data(BalancethicknessThickeningRateEnum)){
++						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(BalancethicknessThickeningRateEnum)[tria_vertex_ids[j]-1]/yts;
++						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
++						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
++						this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++					}
++					break;
++				case VxEnum:
++					if (iomodel->Data(VxEnum)){
++						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(VxEnum)[tria_vertex_ids[j]-1]/yts;
++						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
++						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
++						this->inputs->AddInput(new ControlInput(VxEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++					}
++					break;
++				case VyEnum:
++					if (iomodel->Data(VyEnum)){
++						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(VyEnum)[tria_vertex_ids[j]-1]/yts;
++						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
++						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
++						this->inputs->AddInput(new ControlInput(VyEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++					}
++					break;
++				case FrictionCoefficientEnum:
++					if (iomodel->Data(FrictionCoefficientEnum)){
++						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(FrictionCoefficientEnum)[tria_vertex_ids[j]-1];
++						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
++						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
++						this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++					}
++					break;
++				case MaterialsRheologyBbarEnum:
++					/*Matice will take care of it*/ break;
++				default:
++					_error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
++			}
++		}
++	}
++	#endif
++
++	/*DatasetInputs*/
++	if (control_analysis && iomodel->Data(InversionCostFunctionsCoefficientsEnum)){
++
++		/*Create inputs and add to DataSetInput*/
++		DatasetInput* datasetinput=new DatasetInput(InversionCostFunctionsCoefficientsEnum);
++		for(i=0;i<num_cm_responses;i++){
++			for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(InversionCostFunctionsCoefficientsEnum)[(tria_vertex_ids[j]-1)*num_cm_responses+i];
++			datasetinput->inputs->AddObject(new TriaP1Input(InversionCostFunctionsCoefficientsEnum,nodeinputs));
++		}
++
++		/*Add datasetinput to element inputs*/
++		this->inputs->AddInput(datasetinput);
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromSolution {{{*/
++void  Tria::InputUpdateFromSolution(IssmDouble* solution){
++
++	/*retrive parameters: */
++	int analysis_type;
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++		#ifdef _HAVE_DIAGNOSTIC_
++		case DiagnosticHorizAnalysisEnum:
++			InputUpdateFromSolutionDiagnosticHoriz( solution);
++			break;
++		case DiagnosticHutterAnalysisEnum:
++			InputUpdateFromSolutionDiagnosticHoriz( solution);
++			break;
++		#endif
++		#ifdef _HAVE_CONTROL_
++		case AdjointHorizAnalysisEnum:
++			InputUpdateFromSolutionAdjointHoriz( solution);
++			break;
++		case AdjointBalancethicknessAnalysisEnum:
++			InputUpdateFromSolutionAdjointBalancethickness( solution);
++			break;
++		#endif
++		#ifdef _HAVE_HYDROLOGY_ 
++		case HydrologyAnalysisEnum:
++			InputUpdateFromSolutionHydrology(solution);
++			break ;
++		#endif
++	 	#ifdef _HAVE_BALANCED_
++		case BalancethicknessAnalysisEnum:
++			InputUpdateFromSolutionOneDof(solution,ThicknessEnum);
++			break;
++		#endif
++		case BedSlopeXAnalysisEnum:
++			InputUpdateFromSolutionOneDof(solution,BedSlopeXEnum);
++			break;
++		case BedSlopeYAnalysisEnum:
++			InputUpdateFromSolutionOneDof(solution,BedSlopeYEnum);
++			break;
++		case SurfaceSlopeXAnalysisEnum:
++			InputUpdateFromSolutionOneDof(solution,SurfaceSlopeXEnum);
++			break;
++		case SurfaceSlopeYAnalysisEnum:
++			InputUpdateFromSolutionOneDof(solution,SurfaceSlopeYEnum);
++			break;
++		case PrognosticAnalysisEnum:
++			InputUpdateFromSolutionPrognostic(solution);
++			break;
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromSolutionOneDof{{{*/
++void  Tria::InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type){
++
++	const int numdof          = NDOF1*NUMVERTICES;
++
++	int*      doflist=NULL;
++	IssmDouble    values[numdof];
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(int i=0;i<numdof;i++){
++		values[i]=solution[doflist[i]];
++		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Add input to the element: */
++	this->inputs->AddInput(new TriaP1Input(enum_type,values));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromSolutionPrognostic{{{*/
++void  Tria::InputUpdateFromSolutionPrognostic(IssmDouble* solution){
++
++	/*Intermediaries*/
++	const int numdof = NDOF1*NUMVERTICES;
++
++	int       i,hydroadjustment;
++	int*      doflist=NULL;
++	IssmDouble    rho_ice,rho_water,minthickness;
++	IssmDouble    newthickness[numdof];
++	IssmDouble    newbed[numdof];
++	IssmDouble    newsurface[numdof];
++	IssmDouble    oldbed[NUMVERTICES];
++	IssmDouble    oldsurface[NUMVERTICES];
++	IssmDouble    oldthickness[NUMVERTICES];
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	this->parameters->FindParam(&minthickness,PrognosticMinThicknessEnum);
++	for(i=0;i<numdof;i++){
++		newthickness[i]=solution[doflist[i]];
++		if(xIsNan<IssmDouble>(newthickness[i])) _error2_("NaN found in solution vector");
++		/*Constrain thickness to be at least 1m*/
++		if(newthickness[i]<minthickness) newthickness[i]=minthickness;
++	}
++
++	/*Get previous bed, thickness and surface*/
++	GetInputListOnVertices(&oldbed[0],BedEnum);
++	GetInputListOnVertices(&oldsurface[0],SurfaceEnum);
++	GetInputListOnVertices(&oldthickness[0],ThicknessEnum);
++
++	/*Fing PrognosticHydrostaticAdjustment to figure out how to update the geometry:*/
++	this->parameters->FindParam(&hydroadjustment,PrognosticHydrostaticAdjustmentEnum);
++	rho_ice=matpar->GetRhoIce();
++	rho_water=matpar->GetRhoWater();
++
++	for(i=0;i<numdof;i++) {
++		/*If shelf: hydrostatic equilibrium*/
++		if (this->nodes[i]->IsGrounded()){
++			newsurface[i]=oldbed[i]+newthickness[i]; //surface = oldbed + newthickness
++			newbed[i]=oldbed[i];               //same bed: do nothing
++		}
++		else{ //this is an ice shelf
++
++			if(hydroadjustment==AbsoluteEnum){
++				newsurface[i]=newthickness[i]*(1-rho_ice/rho_water);
++				newbed[i]=newthickness[i]*(-rho_ice/rho_water);
++			}
++			else if(hydroadjustment==IncrementalEnum){
++				newsurface[i]=oldsurface[i]+(1.0-rho_ice/rho_water)*(newthickness[i]-oldthickness[i]); //surface = oldsurface + (1-di) * dH 
++				newbed[i]=oldbed[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i]); //bed = oldbed + di * dH
++			}
++			else _error2_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
++		}
++	}
++
++	/*Add input to the element: */
++	this->inputs->AddInput(new TriaP1Input(ThicknessEnum,newthickness));
++	this->inputs->AddInput(new TriaP1Input(SurfaceEnum,newsurface));
++	this->inputs->AddInput(new TriaP1Input(BedEnum,newbed));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromVector(IssmDouble* vector, int name, int type);{{{*/
++void  Tria::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	switch(type){
++
++		case VertexEnum: {
++
++			/*New TriaP1Input*/
++			IssmDouble values[3];
++
++			/*Get values on the 3 vertices*/
++			for (int i=0;i<3;i++){
++				values[i]=vector[this->nodes[i]->GetVertexDof()];
++			}
++
++			/*update input*/
++			if (name==MaterialsRheologyBbarEnum || name==MaterialsRheologyBEnum){
++				matice->inputs->AddInput(new TriaP1Input(name,values));
++			}
++			else{
++				this->inputs->AddInput(new TriaP1Input(name,values));
++			}
++			return;
++		}
++		default:
++			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromVector(int* vector, int name, int type);{{{*/
++void  Tria::InputUpdateFromVector(int* vector, int name, int type){
++	_error2_("not supported yet!");
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromVector(bool* vector, int name, int type);{{{*/
++void  Tria::InputUpdateFromVector(bool* vector, int name, int type){
++	_error2_("not supported yet!");
++}
++/*}}}*/
++/*FUNCTION Tria::InputCreate(IssmDouble scalar,int enum,int code);{{{*/
++void Tria::InputCreate(IssmDouble scalar,int name,int code){
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++	
++	if ((code==5) || (code==1)){ //boolean
++		this->inputs->AddInput(new BoolInput(name,reCast<bool>(scalar)));
++	}
++	else if ((code==6) || (code==2)){ //integer
++		this->inputs->AddInput(new IntInput(name,reCast<int>(scalar)));
++	}
++	else if ((code==7) || (code==3)){ //IssmDouble
++		this->inputs->AddInput(new DoubleInput(name,reCast<int>(scalar)));
++	}
++	else _error2_("could not recognize nature of vector from code " << code);
++
++}
++/*}}}*/
++/*FUNCTION Tria::InputCreate(IssmDouble* vector,int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){{{*/
++void Tria::InputCreate(IssmDouble* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){//index into elements
++
++	/*Intermediaries*/
++	int    i,j,t;
++	int    tria_vertex_ids[3];
++	int    row;
++	IssmDouble nodeinputs[3];
++	IssmDouble time;
++	TransientInput* transientinput=NULL;
++	int    numberofvertices;
++	int    numberofelements;
++	IssmDouble yts;
++
++
++	/*Fetch parameters: */
++	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
++	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
++	iomodel->Constant(&yts,ConstantsYtsEnum);
++
++	/*Branch on type of vector: nodal or elementary: */
++	if(vector_type==1){ //nodal vector
++
++		/*Recover vertices ids needed to initialize inputs*/
++		for(i=0;i<3;i++){ 
++			_assert_(iomodel->Data(MeshElementsEnum));
++			tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab
++		}
++
++		/*Are we in transient or static? */
++		if(M==numberofvertices){
++
++			/*create input values: */
++			for(i=0;i<3;i++)nodeinputs[i]=(IssmDouble)vector[tria_vertex_ids[i]-1];
++
++			/*process units: */
++			UnitConversion(&nodeinputs[0], 3 ,ExtToIuEnum, vector_enum);
++
++			/*create static input: */
++			this->inputs->AddInput(new TriaP1Input(vector_enum,nodeinputs));
++		}
++		else if(M==numberofvertices+1){
++			/*create transient input: */
++			for(t=0;t<N;t++){ //N is the number of times
++
++				/*create input values: */
++				for(i=0;i<3;i++){
++					row=tria_vertex_ids[i]-1;
++					nodeinputs[i]=(IssmDouble)vector[N*row+t];
++				}
++
++				/*process units: */
++				UnitConversion(&nodeinputs[0], 3 ,ExtToIuEnum, vector_enum);
++
++				/*time? :*/
++				time=(IssmDouble)vector[(M-1)*N+t]*yts;
++
++				if(t==0) transientinput=new TransientInput(vector_enum);
++				transientinput->AddTimeInput(new TriaP1Input(vector_enum,nodeinputs),time);
++			}
++			this->inputs->AddInput(transientinput);
++		}
++		else _error2_("nodal vector is either numberofnodes or numberofnodes+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
++	}
++	else if(vector_type==2){ //element vector
++		/*Are we in transient or static? */
++		if(M==numberofelements){
++
++			/*static mode: create an input out of the element value: */
++
++			if (code==5){ //boolean
++				this->inputs->AddInput(new BoolInput(vector_enum,reCast<bool>(vector[index])));
++			}
++			else if (code==6){ //integer
++				this->inputs->AddInput(new IntInput(vector_enum,reCast<int>(vector[index])));
++			}
++			else if (code==7){ //IssmDouble
++				this->inputs->AddInput(new DoubleInput(vector_enum,vector[index]));
++			}
++			else _error2_("could not recognize nature of vector from code " << code);
++		}
++		else {
++			_error2_("transient elementary inputs not supported yet!");
++		}
++	}
++	else{
++		_error2_("Cannot add input for vector type " << vector_type << " (not supported)");
++	}
++
++}
++/*}}}*/
++/*FUNCTION Tria::IsInput{{{*/
++bool Tria::IsInput(int name){
++	if (
++				name==ThicknessEnum ||
++				name==SurfaceEnum ||
++				name==BedEnum ||
++				name==SurfaceSlopeXEnum ||
++				name==SurfaceSlopeYEnum ||
++				name==BasalforcingsMeltingRateEnum ||
++				name==WatercolumnEnum || 
++				name==SurfaceforcingsMassBalanceEnum ||
++				name==SurfaceAreaEnum||
++				name==VxEnum ||
++				name==VyEnum ||
++				name==InversionVxObsEnum ||
++				name==InversionVyObsEnum ||
++				name==FrictionCoefficientEnum ||
++				name==MaterialsRheologyBbarEnum ||
++				name==GradientEnum ||
++				name==OldGradientEnum ||
++				name==QmuVxEnum ||
++				name==QmuVyEnum ||
++				name==QmuPressureEnum ||
++				name==QmuBedEnum ||
++				name==QmuThicknessEnum ||
++				name==QmuSurfaceEnum ||
++				name==QmuTemperatureEnum ||
++				name==QmuMeltingEnum
++		){
++		return true;
++	}
++	else return false;
++}
++/*}}}*/
++/*FUNCTION Tria::IsOnBed {{{*/
++bool Tria::IsOnBed(){
++	
++	bool onbed;
++	inputs->GetInputValue(&onbed,MeshElementonbedEnum);
++	return onbed;
++}
++/*}}}*/
++/*FUNCTION Tria::IsFloating {{{*/
++bool   Tria::IsFloating(){
++
++	bool shelf;
++	inputs->GetInputValue(&shelf,MaskElementonfloatingiceEnum);
++	return shelf;
++}
++/*}}}*/
++/*FUNCTION Tria::IsNodeOnShelf {{{*/
++bool   Tria::IsNodeOnShelf(){
++
++	int  i;
++	bool shelf=false;
++
++	for(i=0;i<3;i++){
++		if (nodes[i]->IsFloating()){
++			shelf=true;
++			break;
++		}
++	}
++	return shelf;
++}
++/*}}}*/
++/*FUNCTION Tria::IsNodeOnShelfFromFlags {{{*/
++bool   Tria::IsNodeOnShelfFromFlags(IssmDouble* flags){
++
++	int  i;
++	bool shelf=false;
++
++	for(i=0;i<NUMVERTICES;i++){
++		if (reCast<bool>(flags[nodes[i]->Sid()])){
++			shelf=true;
++			break;
++		}
++	}
++	return shelf;
++}
++/*}}}*/
++/*FUNCTION Tria::IsOnWater {{{*/
++bool   Tria::IsOnWater(){
++
++	bool water;
++	inputs->GetInputValue(&water,MaskElementonwaterEnum);
++	return water;
++}
++/*}}}*/
++/*FUNCTION Tria::ListResultsInfo{{{*/
++void Tria::ListResultsInfo(int** in_resultsenums,int** in_resultssizes,IssmDouble** in_resultstimes,int** in_resultssteps,int* in_num_results){
++
++	/*Intermediaries*/
++	int     i;
++	int     numberofresults = 0;
++	int     *resultsenums   = NULL;
++	int     *resultssizes   = NULL;
++	IssmDouble  *resultstimes   = NULL;
++	int     *resultssteps   = NULL;
++
++	/*Checks*/
++	_assert_(in_num_results);
++
++	/*Count number of results*/
++	for(i=0;i<this->results->Size();i++){
++		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
++		numberofresults++;
++	}
++
++	if(numberofresults){
++
++		/*Allocate output*/
++		resultsenums=xNew<int>(numberofresults);
++		resultssizes=xNew<int>(numberofresults);
++		resultstimes=xNew<IssmDouble>(numberofresults);
++		resultssteps=xNew<int>(numberofresults);
++
++		/*populate enums*/
++		for(i=0;i<this->results->Size();i++){
++			ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
++			resultsenums[i]=elementresult->InstanceEnum();
++			resultstimes[i]=elementresult->GetTime();
++			resultssteps[i]=elementresult->GetStep();
++			if(elementresult->ObjectEnum()==TriaP1ElementResultEnum){
++				resultssizes[i]=P1Enum;
++			}
++			else{
++				resultssizes[i]=P0Enum;
++			}
++		}
++	}
++
++	/*Assign output pointers:*/
++	*in_num_results=numberofresults;
++	*in_resultsenums=resultsenums;
++	*in_resultssizes=resultssizes;
++	*in_resultstimes=resultstimes;
++	*in_resultssteps=resultssteps;
++
++}/*}}}*/
++/*FUNCTION Tria::MigrateGroundingLine{{{*/
++void  Tria::MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding){
++
++	int     i,migration_style,unground;
++	bool    elementonshelf = false;
++	IssmDouble  bed_hydro,yts,gl_melting_rate;
++	IssmDouble  rho_water,rho_ice,density;
++	IssmDouble  melting[NUMVERTICES];
++	IssmDouble  h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES];
++
++	/*Recover info at the vertices: */
++	parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
++	parameters->FindParam(&yts,ConstantsYtsEnum);
++	GetInputListOnVertices(&h[0],ThicknessEnum);
++	GetInputListOnVertices(&s[0],SurfaceEnum);
++	GetInputListOnVertices(&b[0],BedEnum);
++	GetInputListOnVertices(&ba[0],BathymetryEnum);
++	rho_water=matpar->GetRhoWater();
++	rho_ice=matpar->GetRhoIce();
++	density=rho_ice/rho_water;
++	
++	/*go through vertices, and update inputs, considering them to be TriaVertex type: */
++	for(i=0;i<NUMVERTICES;i++){
++		/*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
++		if(reCast<bool>(old_floating_ice[nodes[i]->Sid()])){
++			if(b[i]<=ba[i]){ 
++				b[i]=ba[i];
++				s[i]=b[i]+h[i];
++				nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false));
++				nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true));
++			}
++		}
++		/*Ice sheet: if hydrostatic bed above bathymetry, ice sheet starts to unground, elso do nothing */
++		/*Change only if AgressiveMigration or if the ice sheet is in contact with the ocean*/
++		else{
++			bed_hydro=-density*h[i];
++			if (bed_hydro>ba[i]){
++				/*Unground only if the element is connected to the ice shelf*/
++				if(migration_style==AgressiveMigrationEnum){
++					s[i]=(1-density)*h[i];
++					b[i]=-density*h[i];
++					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
++					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
++				}
++				else if(migration_style==SoftMigrationEnum && reCast<bool>(sheet_ungrounding[nodes[i]->Sid()])){
++					s[i]=(1-density)*h[i];
++					b[i]=-density*h[i];
++					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
++					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
++				}
++			}
++		}
++	}
++
++	/*If at least one vertex is now floating, the element is now floating*/
++	for(i=0;i<NUMVERTICES;i++){
++		if(nodes[i]->IsFloating()){
++			elementonshelf=true;
++			break;
++		}
++	}
++	
++   /*Add basal melting rate if element just ungrounded*/
++	if(!this->IsFloating() && elementonshelf==true){
++		for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
++		this->inputs->AddInput(new TriaP1Input(BasalforcingsMeltingRateEnum,&melting[0]));
++	} 
++
++	/*Update inputs*/
++   this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
++
++	/*Update inputs*/    
++	this->inputs->AddInput(new TriaP1Input(SurfaceEnum,&s[0]));
++	this->inputs->AddInput(new TriaP1Input(BedEnum,&b[0]));
++}
++/*}}}*/
++/*FUNCTION Tria::MyRank {{{*/
++int    Tria::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Tria::NodalValue {{{*/
++int    Tria::NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units){
++
++	int         found = 0;
++	IssmDouble  value;
++	Input      *data  = NULL;
++	GaussTria  *gauss = NULL;
++
++	/*First, serarch the input: */
++	data=inputs->GetInput(natureofdataenum); 
++
++	/*figure out if we have the vertex id: */
++	found=0;
++	for(int i=0;i<NUMVERTICES;i++){
++		if(index==nodes[i]->GetVertexId()){
++			/*Do we have natureofdataenum in our inputs? :*/
++			if(data){
++				/*ok, we are good. retrieve value of input at vertex :*/
++				gauss=new GaussTria(); gauss->GaussVertex(i);
++				data->GetInputValue(&value,gauss);
++				found=1;
++				break;
++			}
++		}
++	}
++
++	/*clean-up*/
++	delete gauss;
++
++	if(found)*pvalue=value;
++	return found;
++}
++/*}}}*/
++/*FUNCTION Tria::PatchFill{{{*/
++void  Tria::PatchFill(int* prow, Patch* patch){
++
++	int i,row;
++	int vertices_ids[3];
++
++	/*recover pointer: */
++	row=*prow;
++		
++	for(i=0;i<3;i++) vertices_ids[i]=nodes[i]->GetVertexId(); //vertices id start at column 3 of the patch.
++
++	for(i=0;i<this->results->Size();i++){
++		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
++
++		/*For this result,fill the information in the Patch object (element id + vertices ids), and then hand 
++		 *it to the result object, to fill the rest: */
++		patch->fillelementinfo(row,this->sid+1,vertices_ids,3);
++		elementresult->PatchFill(row,patch);
++
++		/*increment rower: */
++		row++;
++	}
++
++	/*Assign output pointers:*/
++	*prow=row;
++}
++/*}}}*/
++/*FUNCTION Tria::PatchSize{{{*/
++void  Tria::PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes){
++
++	int     i;
++	int     numrows       = 0;
++	int     numnodes      = 0;
++	int     temp_numnodes = 0;
++
++	/*Go through all the results objects, and update the counters: */
++	for (i=0;i<this->results->Size();i++){
++		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
++		/*first, we have one more result: */
++		numrows++;
++		/*now, how many vertices and how many nodal values for this result? :*/
++		temp_numnodes=elementresult->NumberOfNodalValues(); //ask result object.
++		if(temp_numnodes>numnodes)numnodes=temp_numnodes;
++	}
++
++	/*Assign output pointers:*/
++	*pnumrows=numrows;
++	*pnumvertices=NUMVERTICES;
++	*pnumnodes=numnodes;
++}
++/*}}}*/
++/*FUNCTION Tria::PotentialSheetUngrounding{{{*/
++void  Tria::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){
++
++	int     i;
++	IssmDouble  h[NUMVERTICES],ba[NUMVERTICES];
++	IssmDouble  bed_hydro;
++	IssmDouble  rho_water,rho_ice,density;
++	bool    elementonshelf = false;
++
++	/*material parameters: */
++	rho_water=matpar->GetRhoWater();
++	rho_ice=matpar->GetRhoIce();
++	density=rho_ice/rho_water;
++	GetInputListOnVertices(&h[0],ThicknessEnum);
++	GetInputListOnVertices(&ba[0],BathymetryEnum);
++
++	/*go through vertices, and figure out which ones are on the ice sheet, and want to unground: */
++	for(i=0;i<NUMVERTICES;i++){
++		/*Find if grounded vertices want to start floating*/
++		if (!nodes[i]->IsFloating()){
++			bed_hydro=-density*h[i];
++			if (bed_hydro>ba[i]){
++				/*Vertex that could potentially unground, flag it*/
++				potential_sheet_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
++			}
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::PositiveDegreeDay{{{*/
++void  Tria::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm){
++
++   IssmDouble agd[NUMVERTICES];             // surface mass balance
++   IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
++   IssmDouble h[NUMVERTICES],s[NUMVERTICES]; // ,b
++   IssmDouble rho_water,rho_ice;
++
++   /*Recover monthly temperatures and precipitation*/
++   Input*     input=inputs->GetInput(SurfaceforcingsMonthlytemperaturesEnum); _assert_(input);
++   Input*     input2=inputs->GetInput(SurfaceforcingsPrecipitationEnum); _assert_(input2);
++   GaussTria* gauss=new GaussTria();
++   IssmDouble time,yts;
++   this->parameters->FindParam(&time,TimeEnum);
++   this->parameters->FindParam(&yts,ConstantsYtsEnum);
++   for(int month=0;month<12;month++) {
++     for(int iv=0;iv<NUMVERTICES;iv++) {
++       gauss->GaussVertex(iv);
++       input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts);
++       monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius
++       input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts);
++       monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++     }
++   }
++
++  /*Recover info at the vertices: */
++  GetInputListOnVertices(&h[0],ThicknessEnum);
++  GetInputListOnVertices(&s[0],SurfaceEnum);
++
++  /*Get material parameters :*/
++  rho_ice=matpar->GetRhoIce();
++  rho_water=matpar->GetRhoFreshwater();
++
++   /*measure the surface mass balance*/
++   for (int iv = 0; iv<NUMVERTICES; iv++){
++     agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], pdds, pds, signorm, yts, h[iv], s[iv], rho_ice, rho_water);
++   }
++
++   /*Update inputs*/    
++   this->inputs->AddInput(new TriaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0]));
++   // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
++
++	/*clean-up*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::ProcessResultsUnits{{{*/
++void  Tria::ProcessResultsUnits(void){
++
++	int i;
++
++	for(i=0;i<this->results->Size();i++){
++		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
++		elementresult->ProcessUnits(this->parameters);
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::RequestedOutput{{{*/
++void Tria::RequestedOutput(int output_enum,int step,IssmDouble time){
++
++	if(IsInput(output_enum)){
++		/*just transfer this input to results, and we are done: */
++		InputToResult(output_enum,step,time);
++	}
++	else{
++		/*this input does not exist, compute it, and then transfer to results: */
++		switch(output_enum){
++			case StressTensorEnum: 
++				this->ComputeStressTensor();
++				InputToResult(StressTensorxxEnum,step,time);
++				InputToResult(StressTensorxyEnum,step,time);
++				InputToResult(StressTensorxzEnum,step,time);
++				InputToResult(StressTensoryyEnum,step,time);
++				InputToResult(StressTensoryzEnum,step,time);
++				InputToResult(StressTensorzzEnum,step,time);
++				break;
++
++			default:
++				/*do nothing, no need to derail the computation because one of the outputs requested cannot be found: */
++				break;
++		}
++	}
++
++}
++/*}}}*/
++/*FUNCTION Tria::SetClone {{{*/
++void  Tria::SetClone(int* minranks){
++
++	_error2_("not implemented yet");
++}
++/*}}}*/
++/*FUNCTION Tria::SmearFunction {{{*/
++void  Tria::SmearFunction(Vector*  smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
++	_error2_("not implemented yet");
++
++}
++/*}}}*/
++/*FUNCTION Tria::SmbGradients{{{*/
++void Tria::SmbGradients(void){
++
++	int i;
++
++	// input
++   IssmDouble h[NUMVERTICES];					// ice thickness (m)		
++	IssmDouble s[NUMVERTICES];					// surface elevation (m)
++	IssmDouble a_pos[NUMVERTICES];				// Hs-SMB relation parameter 
++	IssmDouble b_pos[NUMVERTICES];				// Hs-SMB relation parameter
++	IssmDouble a_neg[NUMVERTICES];				// Hs-SMB relation parameter
++	IssmDouble b_neg[NUMVERTICES];				// Hs-SMB relation paremeter
++	IssmDouble Hc[NUMVERTICES];					// elevation of transition between accumulation regime and ablation regime
++	IssmDouble smb_pos_max[NUMVERTICES];		// maximum SMB value in the accumulation regime
++	IssmDouble smb_pos_min[NUMVERTICES];		// minimum SMB value in the accumulation regime
++   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(&Hc[0],SurfaceforcingsHcEnum);
++	GetInputListOnVertices(&smb_pos_max[0],SurfaceforcingsSmbPosMaxEnum);
++	GetInputListOnVertices(&smb_pos_min[0],SurfaceforcingsSmbPosMinEnum);
++	GetInputListOnVertices(&a_pos[0],SurfaceforcingsAPosEnum);
++	GetInputListOnVertices(&b_pos[0],SurfaceforcingsBPosEnum);
++	GetInputListOnVertices(&a_neg[0],SurfaceforcingsANegEnum);
++	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(s[i]>Hc[i]){
++	    smb[i]=a_pos[i]+b_pos[i]*s[i];
++		 if(smb[i]>smb_pos_max[i]){smb[i]=smb_pos_max[i];}
++		 if(smb[i]<smb_pos_min[i]){smb[i]=smb_pos_min[i];}
++	  }
++	  else{
++	    smb[i]=a_neg[i]+b_neg[i]*s[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 TriaP1Input(SurfaceforcingsMassBalanceEnum,&smb[0]));
++}
++/*}}}*/
++/*FUNCTION Tria::SetCurrentConfiguration {{{*/
++void  Tria::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
++	
++	/*go into parameters and get the analysis_counter: */
++	int analysis_counter;
++	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
++
++	/*Get Element type*/
++	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;
++
++}
++/*}}}*/
++/*FUNCTION Tria::SurfaceArea {{{*/
++IssmDouble Tria::SurfaceArea(void){
++
++	int    i;
++	IssmDouble S;
++	IssmDouble normal[3];
++	IssmDouble v13[3],v23[3];
++	IssmDouble xyz_list[NUMVERTICES][3];
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	for (i=0;i<3;i++){
++		v13[i]=xyz_list[0][i]-xyz_list[2][i];
++		v23[i]=xyz_list[1][i]-xyz_list[2][i];
++	}
++
++	normal[0]=v13[1]*v23[2]-v13[2]*v23[1];
++	normal[1]=v13[2]*v23[0]-v13[0]*v23[2];
++	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
++
++	S = 0.5 * sqrt(pow(normal[0],(IssmDouble)2)+pow(normal[1],(IssmDouble)2)+pow(normal[2],(IssmDouble)2));
++
++	/*Return: */
++	return S;
++}
++/*}}}*/
++/*FUNCTION Tria::SurfaceNormal{{{*/
++void Tria::SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]){
++
++	int i;
++	IssmDouble v13[3],v23[3];
++	IssmDouble normal[3];
++	IssmDouble normal_norm;
++
++	for (i=0;i<3;i++){
++		v13[i]=xyz_list[0][i]-xyz_list[2][i];
++		v23[i]=xyz_list[1][i]-xyz_list[2][i];
++	}
++
++	normal[0]=v13[1]*v23[2]-v13[2]*v23[1];
++	normal[1]=v13[2]*v23[0]-v13[0]*v23[2];
++	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
++
++	normal_norm=sqrt( pow(normal[0],(IssmDouble)2)+pow(normal[1],(IssmDouble)2)+pow(normal[2],(IssmDouble)2) );
++
++	*(surface_normal)=normal[0]/normal_norm;
++	*(surface_normal+1)=normal[1]/normal_norm;
++	*(surface_normal+2)=normal[2]/normal_norm;
++}
++/*}}}*/
++/*FUNCTION Tria::TimeAdapt{{{*/
++IssmDouble  Tria::TimeAdapt(void){
++
++	/*intermediary: */
++	int    i;
++	IssmDouble C,dt;
++	IssmDouble dx,dy;
++	IssmDouble maxx,minx;
++	IssmDouble maxy,miny;
++	IssmDouble maxabsvx,maxabsvy;
++	IssmDouble xyz_list[NUMVERTICES][3];
++
++	/*get CFL coefficient:*/
++	this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
++
++	/*Get for Vx and Vy, the max of abs value: */
++	#ifdef _HAVE_RESPONSES_
++	this->MaxAbsVx(&maxabsvx,false);
++	this->MaxAbsVy(&maxabsvy,false);
++	#else
++		_error2_("ISSM was not compiled with responses compiled in, exiting!");
++	#endif
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], this->nodes, NUMVERTICES);
++
++	minx=xyz_list[0][0];
++	maxx=xyz_list[0][0];
++	miny=xyz_list[0][1];
++	maxy=xyz_list[0][1];
++
++	for(i=1;i<NUMVERTICES;i++){
++		if (xyz_list[i][0]<minx)minx=xyz_list[i][0];
++		if (xyz_list[i][0]>maxx)maxx=xyz_list[i][0];
++		if (xyz_list[i][1]<miny)miny=xyz_list[i][1];
++		if (xyz_list[i][1]>maxy)maxy=xyz_list[i][1];
++	}
++	dx=maxx-minx;
++	dy=maxy-miny;
++
++	/*CFL criterion: */
++	dt=C/(maxabsvy/dx+maxabsvy/dy);
++
++	return dt;
++}
++/*}}}*/
++/*FUNCTION Tria::Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type){{{*/
++void Tria::Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type){ //i is the element index
++
++	/*Intermediaries*/
++	int    i,j;
++	int    tria_node_ids[3];
++	int    tria_vertex_ids[3];
++	int    tria_type;
++	IssmDouble nodeinputs[3];
++	IssmDouble yts;
++	int    progstabilization,balancestabilization;
++	bool   dakota_analysis;
++
++	/*Checks if debuging*/
++	/*{{{*/
++	_assert_(iomodel->Data(MeshElementsEnum));
++	/*}}}*/
++
++	/*Fetch parameters: */
++	iomodel->Constant(&yts,ConstantsYtsEnum);
++	iomodel->Constant(&progstabilization,PrognosticStabilizationEnum);
++	iomodel->Constant(&balancestabilization,BalancethicknessStabilizationEnum);
++	iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum);
++
++	/*Recover element type*/
++	if ((analysis_type==PrognosticAnalysisEnum && progstabilization==3) || (analysis_type==BalancethicknessAnalysisEnum && balancestabilization==3)){
++		/*P1 Discontinuous Galerkin*/
++		tria_type=P1DGEnum;
++	}
++	else{
++		/*P1 Continuous Galerkin*/
++		tria_type=P1Enum;
++	}
++	this->SetElementType(tria_type,analysis_counter);
++
++	/*Recover vertices ids needed to initialize inputs*/
++	for(i=0;i<3;i++){ 
++		tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab
++	}
++
++	/*Recover nodes ids needed to initialize the node hook.*/
++	if (tria_type==P1DGEnum){
++		/*Discontinuous Galerkin*/
++		tria_node_ids[0]=iomodel->nodecounter+3*index+1;
++		tria_node_ids[1]=iomodel->nodecounter+3*index+2;
++		tria_node_ids[2]=iomodel->nodecounter+3*index+3;
++	}
++	else{
++		/*Continuous Galerkin*/
++		for(i=0;i<3;i++){ 
++			tria_node_ids[i]=iomodel->nodecounter+reCast<int,IssmDouble>(*(iomodel->Data(MeshElementsEnum)+3*index+i)); //ids for vertices are in the elements array from Matlab
++		}
++	}
++
++	/*hooks: */
++	this->SetHookNodes(tria_node_ids,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type
++
++	/*Fill with IoModel*/
++	this->InputUpdateFromIoModel(index,iomodel);
++
++	/*Defaults if not provided in iomodel*/
++	switch(analysis_type){
++
++		case DiagnosticHorizAnalysisEnum:
++
++			/*default vx,vy and vz: either observation or 0 */
++			if(!iomodel->Data(VxEnum)){
++				for(i=0;i<3;i++)nodeinputs[i]=0;
++				this->inputs->AddInput(new TriaP1Input(VxEnum,nodeinputs));
++				if(dakota_analysis) this->inputs->AddInput(new TriaP1Input(QmuVxEnum,nodeinputs));
++			}
++			if(!iomodel->Data(VyEnum)){
++				for(i=0;i<3;i++)nodeinputs[i]=0;
++				this->inputs->AddInput(new TriaP1Input(VyEnum,nodeinputs));
++				if(dakota_analysis) this->inputs->AddInput(new TriaP1Input(QmuVyEnum,nodeinputs));
++			}
++			if(!iomodel->Data(VzEnum)){
++				for(i=0;i<3;i++)nodeinputs[i]=0;
++				this->inputs->AddInput(new TriaP1Input(VzEnum,nodeinputs));
++				if(dakota_analysis) this->inputs->AddInput(new TriaP1Input(QmuVzEnum,nodeinputs));
++			}
++			if(!iomodel->Data(PressureEnum)){
++				for(i=0;i<3;i++)nodeinputs[i]=0;
++				if(dakota_analysis){
++					this->inputs->AddInput(new TriaP1Input(PressureEnum,nodeinputs));
++					this->inputs->AddInput(new TriaP1Input(QmuPressureEnum,nodeinputs));
++				}
++			}
++			break;
++
++		default:
++			/*No update for other solution types*/
++			break;
++
++	}
++
++	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
++	this->parameters=NULL;
++}
++/*}}}*/
++/*FUNCTION Tria::UpdatePotentialSheetUngrounding{{{*/
++int Tria::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
++
++	int i;
++	int nflipped=0;
++
++	/*Go through nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */
++	for(i=0;i<3;i++){
++		if (reCast<bool>(vertices_potentially_ungrounding[nodes[i]->Sid()])){
++			vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
++		
++			/*If node was not on ice shelf, we flipped*/
++			if(nodes_on_iceshelf[nodes[i]->Sid()]==0){
++				nflipped++;
++			}
++		}
++	}
++	return nflipped;
++}
++/*}}}*/
++
++#ifdef _HAVE_RESPONSES_
++/*FUNCTION Tria::IceVolume {{{*/
++IssmDouble Tria::IceVolume(void){
++
++	/*The volume of a troncated prism is base * 1/3 sum(length of edges)*/
++	IssmDouble base,surface,bed;
++	IssmDouble xyz_list[NUMVERTICES][3];
++
++	if(IsOnWater())return 0;
++
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*First calculate the area of the base (cross section triangle)
++	 * http://en.wikipedia.org/wiki/Triangle
++	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
++	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
++
++	/*Now get the average height*/
++	Input* surface_input = inputs->GetInput(SurfaceEnum); _assert_(surface_input);
++	Input* bed_input     = inputs->GetInput(BedEnum);     _assert_(bed_input);
++	surface_input->GetInputAverage(&surface);
++	bed_input->GetInputAverage(&bed);
++
++	/*Return: */
++	return base*(surface-bed);
++}
++/*}}}*/
++/*FUNCTION Tria::MassFlux {{{*/
++IssmDouble Tria::MassFlux( IssmDouble* segment,bool process_units){
++
++	const int    numdofs=2;
++
++	int        i,dim;
++	IssmDouble     mass_flux=0;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     normal[2];
++	IssmDouble     length,rho_ice;
++	IssmDouble     x1,y1,x2,y2,h1,h2;
++	IssmDouble     vx1,vx2,vy1,vy2;
++	GaussTria* gauss_1=NULL;
++	GaussTria* gauss_2=NULL;
++
++	/*Get material parameters :*/
++	rho_ice=matpar->GetRhoIce();
++
++	/*First off, check that this segment belongs to this element: */
++	if ((int)*(segment+4)!=this->id)_error2_("error message: segment with id " << (int)*(segment+4) << " does not belong to element with id:" << this->id);
++
++	/*Recover segment node locations: */
++	x1=*(segment+0); y1=*(segment+1); x2=*(segment+2); y2=*(segment+3);
++
++	/*Get xyz list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*get area coordinates of 0 and 1 locations: */
++	gauss_1=new GaussTria();
++	gauss_1->GaussFromCoords(x1,y1,&xyz_list[0][0]);
++	gauss_2=new GaussTria();
++	gauss_2->GaussFromCoords(x2,y2,&xyz_list[0][0]);
++
++	normal[0]=cos(atan2(x1-x2,y2-y1));
++	normal[1]=sin(atan2(x1-x2,y2-y1));
++
++	length=sqrt(pow(x2-x1,2.0)+pow(y2-y1,2));
++
++	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
++	this->parameters->FindParam(&dim,MeshDimensionEnum);
++	Input* vx_input=NULL;
++	Input* vy_input=NULL;
++	if(dim==2){
++		vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
++		vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
++	}
++	else{
++		vx_input=inputs->GetInput(VxAverageEnum); _assert_(vx_input);
++		vy_input=inputs->GetInput(VyAverageEnum); _assert_(vy_input);
++	}
++
++	thickness_input->GetInputValue(&h1, gauss_1);
++	thickness_input->GetInputValue(&h2, gauss_2);
++	vx_input->GetInputValue(&vx1,gauss_1);
++	vx_input->GetInputValue(&vx2,gauss_2);
++	vy_input->GetInputValue(&vy1,gauss_1);
++	vy_input->GetInputValue(&vy2,gauss_2);
++
++	mass_flux= rho_ice*length*(  
++				(ONETHIRD*(h1-h2)*(vx1-vx2)+0.5*h2*(vx1-vx2)+0.5*(h1-h2)*vx2+h2*vx2)*normal[0]+
++				(ONETHIRD*(h1-h2)*(vy1-vy2)+0.5*h2*(vy1-vy2)+0.5*(h1-h2)*vy2+h2*vy2)*normal[1]
++				);
++
++	/*Process units: */
++	mass_flux=UnitConversion(mass_flux,IuToExtEnum,MassFluxEnum);
++
++	/*clean up and return:*/
++	delete gauss_1;
++	delete gauss_2;
++	return mass_flux;
++}
++/*}}}*/
++/*FUNCTION Tria::MaxAbsVx{{{*/
++void  Tria::MaxAbsVx(IssmDouble* pmaxabsvx, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxabsvx=this->inputs->MaxAbs(VxEnum);
++
++	/*process units if requested: */
++	if(process_units) maxabsvx=UnitConversion(maxabsvx,IuToExtEnum,VxEnum);
++
++	/*Assign output pointers:*/
++	*pmaxabsvx=maxabsvx;
++}
++/*}}}*/
++/*FUNCTION Tria::MaxAbsVy{{{*/
++void  Tria::MaxAbsVy(IssmDouble* pmaxabsvy, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxabsvy=this->inputs->MaxAbs(VyEnum);
++
++	/*process units if requested: */
++	if(process_units) maxabsvy=UnitConversion(maxabsvy,IuToExtEnum,VyEnum);
++
++	/*Assign output pointers:*/
++	*pmaxabsvy=maxabsvy;
++}
++/*}}}*/
++/*FUNCTION Tria::MaxAbsVz{{{*/
++void  Tria::MaxAbsVz(IssmDouble* pmaxabsvz, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxabsvz=this->inputs->MaxAbs(VzEnum);
++
++	/*process units if requested: */
++	if(process_units) maxabsvz=UnitConversion(maxabsvz,IuToExtEnum,VyEnum);
++
++	/*Assign output pointers:*/
++	*pmaxabsvz=maxabsvz;
++}
++/*}}}*/
++/*FUNCTION Tria::MaxVel{{{*/
++void  Tria::MaxVel(IssmDouble* pmaxvel, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxvel=this->inputs->Max(VelEnum);
++
++	/*process units if requested: */
++	if(process_units) maxvel=UnitConversion(maxvel,IuToExtEnum,VelEnum);
++
++	/*Assign output pointers:*/
++	*pmaxvel=maxvel;
++}
++/*}}}*/
++/*FUNCTION Tria::MaxVx{{{*/
++void  Tria::MaxVx(IssmDouble* pmaxvx, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxvx=this->inputs->Max(VxEnum);
++
++	/*process units if requested: */
++	if(process_units) maxvx=UnitConversion(maxvx,IuToExtEnum,VxEnum);
++
++	/*Assign output pointers:*/
++	*pmaxvx=maxvx;
++}
++/*}}}*/
++/*FUNCTION Tria::MaxVy{{{*/
++void  Tria::MaxVy(IssmDouble* pmaxvy, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxvy=this->inputs->Max(VyEnum);
++
++	/*process units if requested: */
++	if(process_units) maxvy=UnitConversion(maxvy,IuToExtEnum,VyEnum);
++
++	/*Assign output pointers:*/
++	*pmaxvy=maxvy;
++
++}
++/*}}}*/
++/*FUNCTION Tria::MaxVz{{{*/
++void  Tria::MaxVz(IssmDouble* pmaxvz, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxvz=this->inputs->Max(VzEnum);
++
++	/*process units if requested: */
++	if(process_units) maxvz=UnitConversion(maxvz,IuToExtEnum,VzEnum);
++
++	/*Assign output pointers:*/
++	*pmaxvz=maxvz;
++}
++/*}}}*/
++/*FUNCTION Tria::MinVel{{{*/
++void  Tria::MinVel(IssmDouble* pminvel, bool process_units){
++
++	/*Get minimum:*/
++	IssmDouble minvel=this->inputs->Min(VelEnum);
++
++	/*process units if requested: */
++	if(process_units) minvel=UnitConversion(minvel,IuToExtEnum,VelEnum);
++
++	/*Assign output pointers:*/
++	*pminvel=minvel;
++}
++/*}}}*/
++/*FUNCTION Tria::MinVx{{{*/
++void  Tria::MinVx(IssmDouble* pminvx, bool process_units){
++
++	/*Get minimum:*/
++	IssmDouble minvx=this->inputs->Min(VxEnum);
++
++	/*process units if requested: */
++	if(process_units) minvx=UnitConversion(minvx,IuToExtEnum,VxEnum);
++
++	/*Assign output pointers:*/
++	*pminvx=minvx;
++}
++/*}}}*/
++/*FUNCTION Tria::MinVy{{{*/
++void  Tria::MinVy(IssmDouble* pminvy, bool process_units){
++
++	/*Get minimum:*/
++	IssmDouble minvy=this->inputs->Min(VyEnum);
++
++	/*process units if requested: */
++	if(process_units) minvy=UnitConversion(minvy,IuToExtEnum,VyEnum);
++
++	/*Assign output pointers:*/
++	*pminvy=minvy;
++}
++/*}}}*/
++/*FUNCTION Tria::MinVz{{{*/
++void  Tria::MinVz(IssmDouble* pminvz, bool process_units){
++
++	/*Get minimum:*/
++	IssmDouble minvz=this->inputs->Min(VzEnum);
++
++	/*process units if requested: */
++	if(process_units) minvz=UnitConversion(minvz,IuToExtEnum,VzEnum);
++
++	/*Assign output pointers:*/
++	*pminvz=minvz;
++}
++/*}}}*/
++/*FUNCTION Tria::ElementResponse{{{*/
++void Tria::ElementResponse(IssmDouble* presponse,int response_enum,bool process_units){
++
++	switch(response_enum){
++		case MaterialsRheologyBbarEnum:
++			*presponse=this->matice->GetBbar();
++			break;
++		case VelEnum:
++
++			/*Get input:*/
++			IssmDouble vel;
++			Input* vel_input;
++
++			vel_input=this->inputs->GetInput(VelEnum); _assert_(vel_input);
++			vel_input->GetInputAverage(&vel);
++
++			/*process units if requested: */
++			if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum);
++
++			/*Assign output pointers:*/
++			*presponse=vel;
++		default:  
++			_error2_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
++	}
++
++}
++/*}}}*/
++/*FUNCTION Tria::TotalSmb {{{*/
++IssmDouble Tria::TotalSmb(void){
++
++	/*The smb[kg yr-1] of one element is area[m2] * smb [kg m^-2 yr^-1]*/
++	IssmDouble base,smb,rho_ice;
++	IssmDouble Total_Smb=0;
++	IssmDouble xyz_list[NUMVERTICES][3];
++
++	/*Get material parameters :*/
++	rho_ice=matpar->GetRhoIce();
++
++   if(IsOnWater())return 0;
++
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*First calculate the area of the base (cross section triangle)
++	 * http://en.wikipedia.org/wiki/Triangle
++	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
++	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));	// area of element in m2
++
++	/*Now get the average SMB over the element*/
++	Input* smb_input = inputs->GetInput(SurfaceforcingsMassBalanceEnum); _assert_(smb_input);
++	smb_input->GetInputAverage(&smb);																								// average smb on element in m ice s-1
++   Total_Smb=rho_ice*base*smb;																											// smb on element in kg s-1
++	
++	/*Process units: */
++	Total_Smb=UnitConversion(Total_Smb,IuToExtEnum,TotalSmbEnum);																// smb on element in GigaTon yr-1
++	
++	/*Return: */
++	return Total_Smb;
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_DIAGNOSTIC_
++/*FUNCTION Tria::CreateKMatrixDiagnosticMacAyeal {{{*/
++ElementMatrix* Tria::CreateKMatrixDiagnosticMacAyeal(void){
++
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixDiagnosticMacAyealViscous();
++	ElementMatrix* Ke2=CreateKMatrixDiagnosticMacAyealFriction();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
++	
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixDiagnosticMacAyealViscous{{{*/
++ElementMatrix* Tria::CreateKMatrixDiagnosticMacAyealViscous(void){
++
++	/*Constants*/
++	const int  numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries*/
++	int        i,j,ig;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     viscosity,newviscosity,oldviscosity;
++	IssmDouble     viscosity_overshoot,thickness,Jdet;
++	IssmDouble     epsilon[3],oldepsilon[3];    /* epsilon=[exx,eyy,exy];    */
++	IssmDouble     B[3][numdof];
++	IssmDouble     Bprime[3][numdof];
++	IssmDouble     D[3][3]   = {0.0};
++	IssmDouble     D_scalar;
++	GaussTria *gauss = NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	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* vxold_input=inputs->GetInput(VxPicardEnum);      _assert_(vxold_input);
++	Input* vyold_input=inputs->GetInput(VyPicardEnum);      _assert_(vyold_input);
++	this->parameters->FindParam(&viscosity_overshoot,DiagnosticViscosityOvershootEnum);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++		GetBMacAyeal(&B[0][0], &xyz_list[0][0], gauss);
++		GetBprimeMacAyeal(&Bprime[0][0], &xyz_list[0][0], gauss);
++
++		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		this->GetStrainRate2d(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
++		matice->GetViscosity2d(&viscosity, &epsilon[0]);
++		matice->GetViscosity2d(&oldviscosity, &oldepsilon[0]);
++		thickness_input->GetInputValue(&thickness, gauss);
++
++		newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
++		D_scalar=2*newviscosity*thickness*gauss->weight*Jdet;
++		for (i=0;i<3;i++) D[i][i]=D_scalar;
++
++		TripleMultiply(&B[0][0],3,numdof,1,
++					&D[0][0],3,3,0,
++					&Bprime[0][0],3,numdof,0,
++					&Ke->values[0],1);
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixDiagnosticMacAyealFriction {{{*/
++ElementMatrix* Tria::CreateKMatrixDiagnosticMacAyealFriction(void){
++
++	/*Constants*/
++	const int  numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries*/
++	int        i,j,ig;
++	int        analysis_type;
++	IssmDouble     MAXSLOPE  = .06; // 6 %
++	IssmDouble     MOUNTAINKEXPONENT = 10;
++	IssmDouble     slope_magnitude,alpha2;
++	IssmDouble     Jdet;
++	IssmDouble     L[2][numdof];
++	IssmDouble     DL[2][2]  = {{ 0,0 },{0,0}};
++	IssmDouble     DL_scalar;
++	IssmDouble     slope[2]  = {0.0,0.0};
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	Friction  *friction = NULL;
++	GaussTria *gauss    = NULL;
++
++	/*Initialize Element matrix and return if necessary*/
++	if(IsFloating()) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_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);
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*build friction object, used later on: */
++	friction=new Friction("2d",inputs,matpar,analysis_type);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		// If we have a slope > 6% for this element,  it means  we are on a mountain. In this particular case, 
++		//velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */
++		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
++		slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2));
++		if(slope_magnitude>MAXSLOPE) alpha2=pow((IssmDouble)10,MOUNTAINKEXPONENT);
++		else friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum);
++
++		GetL(&L[0][0], &xyz_list[0][0], gauss,NDOF2);
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++		DL_scalar=alpha2*gauss->weight*Jdet;
++		for (i=0;i<2;i++) DL[i][i]=DL_scalar;
++		
++		TripleMultiply( &L[0][0],2,numdof,1,
++					&DL[0][0],2,2,0,
++					&L[0][0],2,numdof,0,
++					&Ke->values[0],1);
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixDiagnosticHutter{{{*/
++ElementMatrix* Tria::CreateKMatrixDiagnosticHutter(void){
++
++	/*Intermediaries*/
++	const int numdof=NUMVERTICES*NDOF2;
++	int    i,connectivity;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Create Element matrix*/
++	for(i=0;i<NUMVERTICES;i++){
++		connectivity=nodes[i]->GetConnectivity();
++		Ke->values[(2*i)*numdof  +(2*i)  ]=1/(IssmDouble)connectivity;
++		Ke->values[(2*i+1)*numdof+(2*i+1)]=1/(IssmDouble)connectivity;
++	}
++
++	/*Clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorDiagnosticMacAyeal {{{*/
++ElementVector* Tria::CreatePVectorDiagnosticMacAyeal(){
++
++	/*Constants*/
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries */
++	int            i,j,ig;
++	IssmDouble         driving_stress_baseline,thickness;
++	IssmDouble         Jdet;
++	IssmDouble         xyz_list[NUMVERTICES][3];
++	IssmDouble         slope[2];
++	IssmDouble         basis[3];
++	IssmDouble         pe_g_gaussian[numdof];
++	GaussTria*     gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input); 
++	Input* surface_input=inputs->GetInput(SurfaceEnum);     _assert_(surface_input);
++	Input* drag_input=inputs->GetInput(FrictionCoefficientEnum);_assert_(drag_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctions(basis, gauss);
++
++		thickness_input->GetInputValue(&thickness,gauss);
++		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
++		driving_stress_baseline=matpar->GetRhoIce()*matpar->GetG()*thickness;
++
++		/*Build pe_g_gaussian vector: */
++		for (i=0;i<NUMVERTICES;i++){
++			for (j=0;j<NDOF2;j++){
++				pe->values[i*NDOF2+j]+=-driving_stress_baseline*slope[j]*Jdet*gauss->weight*basis[i];
++			}
++		}
++	}
++
++	/*Transform coordinate system*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorDiagnosticHutter{{{*/
++ElementVector* Tria::CreatePVectorDiagnosticHutter(void){
++
++	/*Intermediaries */
++	int        i,connectivity;
++	IssmDouble     constant_part,ub,vb;
++	IssmDouble     rho_ice,gravity,n,B;
++	IssmDouble     slope2,thickness;
++	IssmDouble     slope[2];
++	GaussTria* gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	rho_ice=matpar->GetRhoIce();
++	gravity=matpar->GetG();
++	n=matice->GetN();
++	B=matice->GetBbar();
++	Input* slopex_input=inputs->GetInput(SurfaceSlopeXEnum); _assert_(slopex_input);
++	Input* slopey_input=inputs->GetInput(SurfaceSlopeYEnum); _assert_(slopey_input);
++	Input* thickness_input=inputs->GetInput(ThicknessEnum);  _assert_(thickness_input);
++
++	/*Spawn 3 sing elements: */
++	gauss=new GaussTria();
++	for(i=0;i<NUMVERTICES;i++){
++
++		gauss->GaussVertex(i);
++
++		connectivity=nodes[i]->GetConnectivity();
++
++		thickness_input->GetInputValue(&thickness,gauss);
++		slopex_input->GetInputValue(&slope[0],gauss);
++		slopey_input->GetInputValue(&slope[1],gauss);
++		slope2=pow(slope[0],2)+pow(slope[1],2);
++
++		constant_part=-2*pow(rho_ice*gravity,n)*pow(slope2,((n-1)/2));
++
++		ub=-1.58*pow((IssmDouble)10.0,(IssmDouble)-10.0)*rho_ice*gravity*thickness*slope[0];
++		vb=-1.58*pow((IssmDouble)10.0,(IssmDouble)-10.0)*rho_ice*gravity*thickness*slope[1];
++
++		pe->values[2*i]  =(ub-2.0*pow(rho_ice*gravity,n)*pow(slope2,((n-1)/2.0))*pow(thickness,n)/(pow(B,n)*(n+1))*slope[0])/(IssmDouble)connectivity;
++		pe->values[2*i+1]=(vb-2.0*pow(rho_ice*gravity,n)*pow(slope2,((n-1)/2.0))*pow(thickness,n)/(pow(B,n)*(n+1))*slope[1])/(IssmDouble)connectivity;
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateJacobianDiagnosticMacayeal{{{*/
++ElementMatrix* Tria::CreateJacobianDiagnosticMacayeal(void){
++
++	/*Constants*/
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     Jdet,thickness;
++	IssmDouble     eps1dotdphii,eps1dotdphij;
++	IssmDouble     eps2dotdphii,eps2dotdphij;
++	IssmDouble     mu_prime;
++	IssmDouble     epsilon[3];/* epsilon=[exx,eyy,exy];*/
++	IssmDouble     eps1[2],eps2[2];
++	IssmDouble     phi[NUMVERTICES];
++	IssmDouble     dphi[2][NUMVERTICES];
++	GaussTria *gauss=NULL;
++
++	/*Initialize Jacobian with regular MacAyeal (first part of the Gateau derivative)*/
++	ElementMatrix* Ke=CreateKMatrixDiagnosticMacAyeal();
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
++	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsDerivatives(&dphi[0][0],&xyz_list[0][0],gauss);
++
++		thickness_input->GetInputValue(&thickness, gauss);
++		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		matice->GetViscosity2dDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
++		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
++
++		for(i=0;i<3;i++){
++			for(j=0;j<3;j++){
++				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i];
++				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j];
++				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i];
++				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j];
++
++				Ke->values[6*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps1dotdphii;
++				Ke->values[6*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps1dotdphii;
++				Ke->values[6*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps2dotdphii;
++				Ke->values[6*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps2dotdphii;
++			}
++		}
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::GetSolutionFromInputsDiagnosticHoriz{{{*/
++void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){
++
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int          i;
++	int*         doflist=NULL;
++	IssmDouble       vx,vy;
++	IssmDouble       values[numdof];
++	GaussTria*   gauss=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Get inputs*/
++	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	/*P1 element only for now*/
++	gauss=new GaussTria();
++	for(i=0;i<NUMVERTICES;i++){
++
++		gauss->GaussVertex(i);
++
++		/*Recover vx and vy*/
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		values[i*NDOF2+0]=vx;
++		values[i*NDOF2+1]=vy;
++	}
++
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Tria::GetSolutionFromInputsDiagnosticHutter{{{*/
++void  Tria::GetSolutionFromInputsDiagnosticHutter(Vector* solution){
++
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int        i;
++	IssmDouble     vx,vy;
++	IssmDouble     values[numdof];
++	int       *doflist = NULL;
++	GaussTria *gauss   = NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Get inputs*/
++	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	/*P1 element only for now*/
++	gauss=new GaussTria();
++	for(i=0;i<NUMVERTICES;i++){
++
++		gauss->GaussVertex(i);
++
++		/*Recover vx and vy*/
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		values[i*NDOF2+0]=vx;
++		values[i*NDOF2+1]=vy;
++	}
++
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromSolutionDiagnosticHoriz {{{*/
++void  Tria::InputUpdateFromSolutionDiagnosticHoriz(IssmDouble* solution){
++	
++	const int numdof=NDOF2*NUMVERTICES;
++
++	int       i;
++	int*      doflist=NULL;
++	IssmDouble    rho_ice,g;
++	IssmDouble    values[numdof];
++	IssmDouble    vx[NUMVERTICES];
++	IssmDouble    vy[NUMVERTICES];
++	IssmDouble    vz[NUMVERTICES];
++	IssmDouble    vel[NUMVERTICES];
++	IssmDouble    pressure[NUMVERTICES];
++	IssmDouble    thickness[NUMVERTICES];
++	
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Transform solution in Cartesian Space*/
++	TransformSolutionCoord(&values[0],nodes,NUMVERTICES,XYEnum);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		vx[i]=values[i*NDOF2+0];
++		vy[i]=values[i*NDOF2+1];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Get Vz and compute vel*/
++	GetInputListOnVertices(&vz[0],VzEnum,0);
++	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++
++	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D, 
++	 *so the pressure is just the pressure at the bedrock: */
++	rho_ice=matpar->GetRhoIce();
++	g=matpar->GetG();
++	GetInputListOnVertices(&thickness[0],ThicknessEnum);
++	for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*thickness[i];
++
++	/*Now, we have to move the previous Vx and Vy inputs  to old 
++	 * status, otherwise, we'll wipe them off: */
++	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
++	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
++	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new TriaP1Input(VxEnum,vx));
++	this->inputs->AddInput(new TriaP1Input(VyEnum,vy));
++	this->inputs->AddInput(new TriaP1Input(VelEnum,vel));
++	this->inputs->AddInput(new TriaP1Input(PressureEnum,pressure));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromSolutionDiagnosticHutter {{{*/
++void  Tria::InputUpdateFromSolutionDiagnosticHutter(IssmDouble* solution){
++	
++	const int numdof=NDOF2*NUMVERTICES;
++	
++	int       i;
++	int*      doflist=NULL;
++	IssmDouble    rho_ice,g;
++	IssmDouble    values[numdof];
++	IssmDouble    vx[NUMVERTICES];
++	IssmDouble    vy[NUMVERTICES];
++	IssmDouble    vz[NUMVERTICES];
++	IssmDouble    vel[NUMVERTICES];
++	IssmDouble    pressure[NUMVERTICES];
++	IssmDouble    thickness[NUMVERTICES];
++	
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		vx[i]=values[i*NDOF2+0];
++		vy[i]=values[i*NDOF2+1];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Now Compute vel*/
++	GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0
++	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++
++	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D, 
++	 *so the pressure is just the pressure at the bedrock: */
++	rho_ice=matpar->GetRhoIce();
++	g=matpar->GetG();
++	GetInputListOnVertices(&thickness[0],ThicknessEnum);
++	for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*thickness[i];
++
++	/*Now, we have to move the previous Vx and Vy inputs  to old 
++	 * status, otherwise, we'll wipe them off: */
++	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
++	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
++	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new TriaP1Input(VxEnum,vx));
++	this->inputs->AddInput(new TriaP1Input(VyEnum,vy));
++	this->inputs->AddInput(new TriaP1Input(VelEnum,vel));
++	this->inputs->AddInput(new TriaP1Input(PressureEnum,pressure));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_CONTROL_
++/*FUNCTION Tria::InputControlUpdate{{{*/
++void  Tria::InputControlUpdate(IssmDouble scalar,bool save_parameter){
++
++	/*Intermediary*/
++	int    num_controls;
++	int*   control_type=NULL;
++	Input* input=NULL;
++
++	/*retrieve some parameters: */
++	this->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
++	this->parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
++
++	for(int i=0;i<num_controls;i++){
++
++		if(control_type[i]==MaterialsRheologyBbarEnum){
++			input=(Input*)matice->inputs->GetInput(control_type[i]); _assert_(input);
++		}
++		else{
++			input=(Input*)this->inputs->GetInput(control_type[i]);   _assert_(input);
++		}
++
++		if (input->ObjectEnum()!=ControlInputEnum){
++			_error2_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");
++		}
++
++		((ControlInput*)input)->UpdateValue(scalar);
++		((ControlInput*)input)->Constrain();
++		if (save_parameter) ((ControlInput*)input)->SaveValue();
++
++	}
++
++	/*Clean up and return*/
++	xDelete<int>(control_type);
++}
++/*}}}*/
++/*FUNCTION Tria::ControlInputGetGradient{{{*/
++void Tria::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){
++
++	int doflist1[NUMVERTICES];
++	Input* input=NULL;
++
++	if(enum_type==MaterialsRheologyBbarEnum){
++		input=(Input*)matice->inputs->GetInput(enum_type);
++	}
++	else{
++		input=inputs->GetInput(enum_type);
++	}
++	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
++	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++
++	GradientIndexing(&doflist1[0],control_index);
++	((ControlInput*)input)->GetGradient(gradient,&doflist1[0]);
++
++}/*}}}*/
++/*FUNCTION Tria::ControlInputScaleGradient{{{*/
++void Tria::ControlInputScaleGradient(int enum_type,IssmDouble scale){
++
++	Input* input=NULL;
++
++	if(enum_type==MaterialsRheologyBbarEnum){
++		input=(Input*)matice->inputs->GetInput(enum_type);
++	}
++	else{
++		input=inputs->GetInput(enum_type);
++	}
++	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
++	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++
++	((ControlInput*)input)->ScaleGradient(scale);
++}/*}}}*/
++/*FUNCTION Tria::ControlInputSetGradient{{{*/
++void Tria::ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){
++
++	int    doflist1[NUMVERTICES];
++	IssmDouble grad_list[NUMVERTICES];
++	Input* grad_input=NULL;
++	Input* input=NULL;
++
++	if(enum_type==MaterialsRheologyBbarEnum){
++		input=(Input*)matice->inputs->GetInput(enum_type);
++	}
++	else{
++		input=inputs->GetInput(enum_type);
++	}
++	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
++	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++
++	GradientIndexing(&doflist1[0],control_index);
++	for(int i=0;i<NUMVERTICES;i++) grad_list[i]=gradient[doflist1[i]];
++	grad_input=new TriaP1Input(GradientEnum,grad_list);
++
++	((ControlInput*)input)->SetGradient(grad_input);
++
++}/*}}}*/
++/*FUNCTION Tria::Gradj {{{*/
++void  Tria::Gradj(Vector* gradient,int control_type,int control_index){
++	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
++
++	/*If on water, grad = 0: */
++	if(IsOnWater()) return;
++
++	/*First deal with ∂/∂alpha(KU-F)*/
++	switch(control_type){
++		case FrictionCoefficientEnum:
++			GradjDragMacAyeal(gradient,control_index);
++			break;
++		case MaterialsRheologyBbarEnum:
++			GradjBMacAyeal(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;
++		default:
++			_error2_("control type not supported yet: " << 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,NULL,StepResponsesEnum);
++
++	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 SurfaceAbsVelMisfitEnum:
++		case SurfaceRelVelMisfitEnum:
++		case SurfaceLogVelMisfitEnum:
++		case SurfaceLogVxVyMisfitEnum:
++		case SurfaceAverageVelMisfitEnum:
++			/*Nothing, J does not depends on the parameter being inverted for*/
++			break;
++		case DragCoefficientAbsGradientEnum:
++			GradjDragGradient(gradient,resp,control_index);
++			break;
++		case RheologyBbarAbsGradientEnum:
++			GradjBGradient(gradient,resp,control_index);
++			break;
++		default:
++			_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++	}
++
++	xDelete<int>(responses);
++}
++/*}}}*/
++/*FUNCTION Tria::GradjBGradient{{{*/
++void  Tria::GradjBGradient(Vector* gradient,int weight_index,int control_index){
++
++	int        i,ig;
++	int        doflist1[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], nodes, NUMVERTICES);
++	GradientIndexing(&doflist1[0],control_index);
++	Input* rheologyb_input=matice->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 (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsDerivatives(&dbasis[0][0],&xyz_list[0][0],gauss);
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++
++		/*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,doflist1,grade_g,ADD_VAL);
++
++	/*Clean up and return*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::GradjBMacAyeal{{{*/
++void  Tria::GradjBMacAyeal(Vector* gradient,int control_index){
++
++	/*Intermediaries*/
++	int        i,ig;
++	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], nodes, 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=matice->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(4);
++	for (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->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		matice->GetViscosityComplement(&viscosity_complement,&epsilon[0]);
++
++		GetJacobianDeterminant2d(&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;
++}
++/*}}}*/
++/*FUNCTION Tria::GradjDragMacAyeal {{{*/
++void  Tria::GradjDragMacAyeal(Vector* gradient,int control_index){
++
++	int        i,ig;
++	int        analysis_type;
++	int        doflist1[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];
++	IssmDouble     epsilon[3]; /* epsilon=[exx,eyy,exy];*/
++	Friction*  friction=NULL;
++	GaussTria  *gauss=NULL;
++
++	if(IsFloating())return;
++
++	/*retrive parameters: */
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	GradientIndexing(&doflist1[0],control_index);
++	this->GetConnectivityList(&connectivity[0]);
++
++	/*Build frictoin element, needed later: */
++	friction=new Friction("2d",inputs,matpar,analysis_type);
++
++	/*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 (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctions(basis, gauss);
++
++		/*Build alpha_complement_list: */
++		friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum,VzEnum);
++	
++		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,VxEnum,VyEnum,VzEnum);
++	//	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,doflist1,grade_g,ADD_VAL);
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++}
++/*}}}*/
++/*FUNCTION Tria::GradjDragGradient{{{*/
++void  Tria::GradjDragGradient(Vector* gradient, int weight_index,int control_index){
++
++	int        i,ig;
++	int        doflist1[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], nodes, NUMVERTICES);
++	GradientIndexing(&doflist1[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 (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsDerivatives(&dbasis[0][0],&xyz_list[0][0],gauss);
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++
++		/*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,doflist1,grade_g,ADD_VAL);
++
++	/*Clean up and return*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::GradjDhDtBalancedthickness{{{*/
++void  Tria::GradjDhDtBalancedthickness(Vector* gradient,int control_index){
++
++	/*Intermediaries*/
++	int    doflist1[NUMVERTICES];
++	IssmDouble lambda[NUMVERTICES];
++	IssmDouble gradient_g[NUMVERTICES];
++
++	/*Compute Gradient*/
++	GradientIndexing(&doflist1[0],control_index);
++	GetInputListOnVertices(&lambda[0],AdjointEnum);
++	for(int i=0;i<NUMVERTICES;i++) gradient_g[i]=-lambda[i];
++
++	gradient->SetValues(NUMVERTICES,doflist1,gradient_g,INS_VAL);
++}
++/*}}}*/
++/*FUNCTION Tria::GradjVxBalancedthickness{{{*/
++void  Tria::GradjVxBalancedthickness(Vector* gradient,int control_index){
++
++	/*Intermediaries*/
++	int        i,ig;
++	int        doflist1[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], nodes, NUMVERTICES);
++	GradientIndexing(&doflist1[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 (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&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,doflist1,grade_g,ADD_VAL);
++
++	/*Clean up and return*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::GradjVyBalancedthickness{{{*/
++void  Tria::GradjVyBalancedthickness(Vector* gradient,int control_index){
++
++	/*Intermediaries*/
++	int        i,ig;
++	int        doflist1[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], nodes, NUMVERTICES);
++	GradientIndexing(&doflist1[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 (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&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,doflist1,grade_g,ADD_VAL);
++
++	/*Clean up and return*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Tria::GradientIndexing{{{*/
++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->nodes[i]->GetVertexDof() + control_index;
++	}
++
++}
++/*}}}*/
++/*FUNCTION Tria::RheologyBbarAbsGradient{{{*/
++IssmDouble Tria::RheologyBbarAbsGradient(bool process_units,int weight_index){
++
++	/* Intermediaries */
++	int        ig;
++	IssmDouble     Jelem = 0;
++	IssmDouble     weight;
++	IssmDouble     Jdet;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     dp[NDOF2];
++	GaussTria *gauss = NULL;
++
++	/*retrieve parameters and inputs*/
++
++	/*If on water, return 0: */
++	if(IsOnWater()) return 0;
++
++	/*Retrieve all inputs we will be needing: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* weights_input  =inputs->GetInput(InversionCostFunctionsCoefficientsEnum);              _assert_(weights_input);
++	Input* rheologyb_input=matice->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
++
++	/* Start looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++		rheologyb_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
++
++		/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
++		Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
++/*FUNCTION Tria::SurfaceAverageVelMisfit {{{*/
++IssmDouble Tria::SurfaceAverageVelMisfit(bool process_units,int weight_index){
++
++	const int    numdof=2*NUMVERTICES;
++
++	int        i,ig;
++	IssmDouble     Jelem=0,S,Jdet;
++	IssmDouble     misfit;
++	IssmDouble     vx,vy,vxobs,vyobs,weight;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	GaussTria *gauss=NULL;
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Retrieve all inputs we will be needing: */
++	inputs->GetInputValue(&S,SurfaceAreaEnum);
++	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
++	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(3);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		vxobs_input->GetInputValue(&vxobs,gauss);
++		vyobs_input->GetInputValue(&vyobs,gauss);
++
++		/*Compute SurfaceAverageVelMisfitEnum:
++		 *
++		 *      1                    2              2
++		 * J = ---  sqrt(  (u - u   )  +  (v - v   )  )
++		 *      S                obs            obs
++		 */
++		misfit=1/S*pow( pow(vx-vxobs,2.) + pow(vy-vyobs,2.) ,0.5);
++
++		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceAverageVelMisfitEnum);
++
++		/*Add to cost function*/
++		Jelem+=misfit*weight*Jdet*gauss->weight;
++	}
++
++	/*clean-up and Return: */
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
++/*FUNCTION Tria::SurfaceLogVelMisfit {{{*/
++IssmDouble Tria::SurfaceLogVelMisfit(bool process_units,int weight_index){
++
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int        i,ig;
++	IssmDouble     Jelem=0;
++	IssmDouble     misfit,Jdet;
++	IssmDouble     epsvel=2.220446049250313e-16;
++	IssmDouble     meanvel=3.170979198376458e-05; /*1000 m/yr*/
++	IssmDouble     velocity_mag,obs_velocity_mag;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     vx,vy,vxobs,vyobs,weight;
++	GaussTria *gauss=NULL;
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Retrieve all inputs we will be needing: */
++	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
++	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(4);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		vxobs_input->GetInputValue(&vxobs,gauss);
++		vyobs_input->GetInputValue(&vyobs,gauss);
++
++		/*Compute SurfaceLogVelMisfit:
++		 *                 [        vel + eps     ] 2
++		 * J = 4 \bar{v}^2 | log ( -----------  ) |  
++		 *                 [       vel   + eps    ]
++		 *                            obs
++		 */
++		velocity_mag    =sqrt(pow(vx,   2.)+pow(vy,   2.))+epsvel;
++		obs_velocity_mag=sqrt(pow(vxobs,2.)+pow(vyobs,2.))+epsvel;
++		misfit=4*pow(meanvel,2.)*pow(log(velocity_mag/obs_velocity_mag),2.);
++
++		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceLogVelMisfitEnum);
++
++		/*Add to cost function*/
++		Jelem+=misfit*weight*Jdet*gauss->weight;
++	}
++
++	/*clean-up and Return: */
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
++/*FUNCTION Tria::SurfaceLogVxVyMisfit {{{*/
++IssmDouble Tria::SurfaceLogVxVyMisfit(bool process_units,int weight_index){
++
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int        i,ig;
++	int        fit=-1;
++	IssmDouble     Jelem=0, S=0;
++	IssmDouble     epsvel=2.220446049250313e-16;
++	IssmDouble     meanvel=3.170979198376458e-05; /*1000 m/yr*/
++	IssmDouble     misfit, Jdet;
++	IssmDouble     vx,vy,vxobs,vyobs,weight;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	GaussTria *gauss=NULL;
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Retrieve all inputs we will be needing: */
++	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
++	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
++	
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(4);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		vxobs_input->GetInputValue(&vxobs,gauss);
++		vyobs_input->GetInputValue(&vyobs,gauss);
++
++		/*Compute SurfaceRelVelMisfit:
++		 *
++		 *      1            [        |u| + eps     2          |v| + eps     2  ]
++		 * J = --- \bar{v}^2 | log ( -----------  )   +  log ( -----------  )   |  
++		 *      2            [       |u    |+ eps              |v    |+ eps     ]
++		 *                              obs                       obs
++		 */
++		misfit=0.5*pow(meanvel,2.)*(
++					pow(log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)),2.) +
++					pow(log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)),2.) );
++
++		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceLogVxVyMisfitEnum);
++
++		/*Add to cost function*/
++		Jelem+=misfit*weight*Jdet*gauss->weight;
++	}
++
++	/*clean-up and Return: */
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
++/*FUNCTION Tria::SurfaceAbsVelMisfit {{{*/
++IssmDouble Tria::SurfaceAbsVelMisfit(bool process_units,int weight_index){
++
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int        i,ig;
++	IssmDouble     Jelem=0;
++	IssmDouble     misfit,Jdet;
++	IssmDouble     vx,vy,vxobs,vyobs,weight;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	GaussTria *gauss=NULL;
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Retrieve all inputs we will be needing: */
++	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
++	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		vxobs_input->GetInputValue(&vxobs,gauss);
++		vyobs_input->GetInputValue(&vyobs,gauss);
++
++		/*Compute SurfaceAbsVelMisfitEnum:
++		 *
++		 *      1  [           2              2 ]
++		 * J = --- | (u - u   )  +  (v - v   )  |
++		 *      2  [       obs            obs   ]
++		 *
++		 */
++		misfit=0.5*( pow(vx-vxobs,2.) + pow(vy-vyobs,2.) );
++
++		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceAverageVelMisfitEnum);
++
++		/*Add to cost function*/
++		Jelem+=misfit*weight*Jdet*gauss->weight;
++	}
++
++	/*clean up and Return: */
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
++/*FUNCTION Tria::SurfaceRelVelMisfit {{{*/
++IssmDouble Tria::SurfaceRelVelMisfit(bool process_units,int weight_index){
++	const int  numdof=2*NUMVERTICES;
++
++	int        i,ig;
++	IssmDouble     Jelem=0;
++	IssmDouble     scalex=1,scaley=1;
++	IssmDouble     misfit,Jdet;
++	IssmDouble     epsvel=2.220446049250313e-16;
++	IssmDouble     meanvel=3.170979198376458e-05; /*1000 m/yr*/
++	IssmDouble     vx,vy,vxobs,vyobs,weight;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	GaussTria *gauss=NULL;
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Retrieve all inputs we will be needing: */
++	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
++	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(4);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		vxobs_input->GetInputValue(&vxobs,gauss);
++		vyobs_input->GetInputValue(&vyobs,gauss);
++
++		/*Compute SurfaceRelVelMisfit:
++		 *                        
++		 *      1  [     \bar{v}^2             2   \bar{v}^2              2 ]
++		 * J = --- | -------------  (u - u   ) + -------------  (v - v   )  |
++		 *      2  [  (u   + eps)^2       obs    (v   + eps)^2       obs    ]
++		 *              obs                        obs                      
++		 */
++		scalex=pow(meanvel/(vxobs+epsvel),2.); if(vxobs==0)scalex=0;
++		scaley=pow(meanvel/(vyobs+epsvel),2.); if(vyobs==0)scaley=0;
++		misfit=0.5*(scalex*pow((vx-vxobs),2.)+scaley*pow((vy-vyobs),2.));
++		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceRelVelMisfitEnum);
++
++		/*Add to cost function*/
++		Jelem+=misfit*weight*Jdet*gauss->weight;
++	}
++
++	/*clean up and Return: */
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
++/*FUNCTION Tria::ThicknessAbsGradient{{{*/
++IssmDouble Tria::ThicknessAbsGradient(bool process_units,int weight_index){
++
++	/* Intermediaries */
++	int        ig;
++	IssmDouble     Jelem = 0;
++	IssmDouble     weight;
++	IssmDouble     Jdet;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     dp[NDOF2];
++	GaussTria *gauss = NULL;
++
++	/*retrieve parameters and inputs*/
++
++	/*If on water, return 0: */
++	if(IsOnWater()) return 0;
++
++	/*Retrieve all inputs we will be needing: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* weights_input  =inputs->GetInput(InversionCostFunctionsCoefficientsEnum);   _assert_(weights_input);
++	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
++
++	/* Start looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++		thickness_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
++
++		/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
++		Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
++/*FUNCTION Tria::ThicknessAbsMisfit {{{*/
++IssmDouble Tria::ThicknessAbsMisfit(bool process_units,int weight_index){
++
++	/*Intermediaries*/
++	int        i,ig;
++	IssmDouble     thickness,thicknessobs,weight;
++	IssmDouble     Jdet;
++	IssmDouble     Jelem = 0;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	GaussTria *gauss = NULL;
++	IssmDouble     dH[2];
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/*Retrieve all inputs we will be needing: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	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);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get parameters at gauss point*/
++		thickness_input->GetInputValue(&thickness,gauss);
++		thickness_input->GetInputDerivativeValue(&dH[0],&xyz_list[0][0],gauss);
++		thicknessobs_input->GetInputValue(&thicknessobs,gauss);
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++
++		/*compute ThicknessAbsMisfit*/
++		Jelem+=0.5*pow(thickness-thicknessobs,2.0)*weight*Jdet*gauss->weight;
++	}
++
++	/* clean up and Return: */
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorAdjointBalancethickness{{{*/
++ElementVector* Tria::CreatePVectorAdjointBalancethickness(void){
++
++	/*Constants*/
++	const int    numdof=1*NUMVERTICES;
++
++	/*Intermediaries */
++	int         i,ig,resp;
++	IssmDouble      Jdet;
++	IssmDouble      thickness,thicknessobs,weight;
++	int        *responses = NULL;
++	int         num_responses;
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      basis[3];
++	IssmDouble      dbasis[NDOF2][NUMVERTICES];
++	IssmDouble      dH[2];
++	GaussTria*  gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
++	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
++	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);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&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++) switch(responses[resp]){
++
++			case ThicknessAbsMisfitEnum:
++				weights_input->GetInputValue(&weight, gauss,resp);
++				for(i=0;i<numdof;i++) pe->values[i]+=(thicknessobs-thickness)*weight*Jdet*gauss->weight*basis[i];
++				break;
++			case ThicknessAbsGradientEnum:
++				weights_input->GetInputValue(&weight, gauss,resp);
++				for(i=0;i<numdof;i++) pe->values[i]+= - weight*dH[0]*dbasis[0][i]*Jdet*gauss->weight;
++				for(i=0;i<numdof;i++) pe->values[i]+= - weight*dH[1]*dbasis[1][i]*Jdet*gauss->weight;
++				break;
++			default:
++				_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	xDelete<int>(responses);
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorAdjointHoriz{{{*/
++ElementVector* Tria::CreatePVectorAdjointHoriz(void){
++
++	/*Constants*/
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,resp,ig;
++	int       *responses=NULL;
++	int        num_responses;
++	IssmDouble     Jdet;
++	IssmDouble     obs_velocity_mag,velocity_mag;
++	IssmDouble     dux,duy;
++	IssmDouble     epsvel=2.220446049250313e-16;
++	IssmDouble     meanvel=3.170979198376458e-05; /*1000 m/yr*/
++	IssmDouble     scalex=0,scaley=0,scale=0,S=0;
++	IssmDouble     vx,vy,vxobs,vyobs,weight;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     basis[3];
++	GaussTria* gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
++	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
++	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* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
++	Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
++
++	/*Get Surface if required by one response*/
++	for(resp=0;resp<num_responses;resp++){
++		if(responses[resp]==SurfaceAverageVelMisfitEnum){
++			inputs->GetInputValue(&S,SurfaceAreaEnum); break;
++		}
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(4);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		vxobs_input->GetInputValue(&vxobs,gauss);
++		vyobs_input->GetInputValue(&vyobs,gauss);
++		GetNodalFunctions(basis, gauss);
++
++		/*Loop over all requested responses*/
++		for(resp=0;resp<num_responses;resp++){
++
++			weights_input->GetInputValue(&weight,gauss,resp);
++
++			switch(responses[resp]){
++				case SurfaceAbsVelMisfitEnum:
++					/*
++					 *      1  [           2              2 ]
++					 * J = --- | (u - u   )  +  (v - v   )  |
++					 *      2  [       obs            obs   ]
++					 *
++					 *        dJ
++					 * DU = - -- = (u   - u )
++					 *        du     obs
++					 */
++					for (i=0;i<NUMVERTICES;i++){
++						dux=vxobs-vx;
++						duy=vyobs-vy;
++						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++					}
++					break;
++				case SurfaceRelVelMisfitEnum:
++					/*
++					 *      1  [     \bar{v}^2             2   \bar{v}^2              2 ]
++					 * J = --- | -------------  (u - u   ) + -------------  (v - v   )  |
++					 *      2  [  (u   + eps)^2       obs    (v   + eps)^2       obs    ]
++					 *              obs                        obs                      
++					 *
++					 *        dJ     \bar{v}^2
++					 * DU = - -- = ------------- (u   - u )
++					 *        du   (u   + eps)^2    obs
++					 *               obs
++					 */
++					for (i=0;i<NUMVERTICES;i++){
++						scalex=pow(meanvel/(vxobs+epsvel),2.); if(vxobs==0)scalex=0;
++						scaley=pow(meanvel/(vyobs+epsvel),2.); if(vyobs==0)scaley=0;
++						dux=scalex*(vxobs-vx);
++						duy=scaley*(vyobs-vy);
++						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++					}
++					break;
++				case SurfaceLogVelMisfitEnum:
++					/*
++					 *                 [        vel + eps     ] 2
++					 * J = 4 \bar{v}^2 | log ( -----------  ) |  
++					 *                 [       vel   + eps    ]
++					 *                            obs
++					 *
++					 *        dJ                 2 * log(...)
++					 * DU = - -- = - 4 \bar{v}^2 -------------  u
++					 *        du                 vel^2 + eps
++					 *            
++					 */
++					for (i=0;i<NUMVERTICES;i++){
++						velocity_mag    =sqrt(pow(vx,   2.)+pow(vy,   2.))+epsvel;
++						obs_velocity_mag=sqrt(pow(vxobs,2.)+pow(vyobs,2.))+epsvel;
++						scale=-8*pow(meanvel,2.)/pow(velocity_mag,2.)*log(velocity_mag/obs_velocity_mag);
++						dux=scale*vx;
++						duy=scale*vy;
++						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++					}
++					break;
++				case SurfaceAverageVelMisfitEnum:
++					/*
++					 *      1                    2              2
++					 * J = ---  sqrt(  (u - u   )  +  (v - v   )  )
++					 *      S                obs            obs
++					 *
++					 *        dJ      1       1 
++					 * DU = - -- = - --- ----------- * 2 (u - u   )
++					 *        du      S  2 sqrt(...)           obs
++					 */
++					for (i=0;i<NUMVERTICES;i++){
++						scale=1./(S*2*sqrt(pow(vx-vxobs,2.)+pow(vy-vyobs,2.))+epsvel);
++						dux=scale*(vxobs-vx);
++						duy=scale*(vyobs-vy);
++						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++					}
++					break;
++				case SurfaceLogVxVyMisfitEnum:
++					/*
++					 *      1            [        |u| + eps     2          |v| + eps     2  ]
++					 * J = --- \bar{v}^2 | log ( -----------  )   +  log ( -----------  )   |  
++					 *      2            [       |u    |+ eps              |v    |+ eps     ]
++					 *                              obs                       obs
++					 *        dJ                              1      u                             1
++					 * DU = - -- = - \bar{v}^2 log(u...) --------- ----  ~ - \bar{v}^2 log(u...) ------
++					 *        du                         |u| + eps  |u|                           u + eps
++					 */
++					for (i=0;i<NUMVERTICES;i++){
++						dux = - pow(meanvel,2.) * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);
++						duy = - pow(meanvel,2.) * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);
++						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++					}
++					break;
++				case DragCoefficientAbsGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case ThicknessAbsGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case RheologyBbarAbsGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				default:
++					_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++			}
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	xDelete<int>(responses);
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorAdjointStokes{{{*/
++ElementVector* Tria::CreatePVectorAdjointStokes(void){
++
++	/*Intermediaries */
++	int        i,resp,ig;
++	int       *responses=NULL;
++	int        num_responses;
++	IssmDouble     Jdet;
++	IssmDouble     obs_velocity_mag,velocity_mag;
++	IssmDouble     dux,duy;
++	IssmDouble     epsvel=2.220446049250313e-16;
++	IssmDouble     meanvel=3.170979198376458e-05; /*1000 m/yr*/
++	IssmDouble     scalex=0,scaley=0,scale=0,S=0;
++	IssmDouble     vx,vy,vxobs,vyobs,weight;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     basis[3];
++	GaussTria* gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
++	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
++	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* vxobs_input   = inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
++	Input* vyobs_input   = inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
++
++	/*Get Surface if required by one response*/
++	for(resp=0;resp<num_responses;resp++){
++		if(responses[resp]==SurfaceAverageVelMisfitEnum){
++			inputs->GetInputValue(&S,SurfaceAreaEnum); break;
++		}
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(4);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		vxobs_input->GetInputValue(&vxobs,gauss);
++		vyobs_input->GetInputValue(&vyobs,gauss);
++		GetNodalFunctions(basis, gauss);
++
++		/*Loop over all requested responses*/
++		for(resp=0;resp<num_responses;resp++){
++
++			weights_input->GetInputValue(&weight,gauss,resp);
++
++			switch(responses[resp]){
++
++				case SurfaceAbsVelMisfitEnum:
++					/*
++					 *      1  [           2              2 ]
++					 * J = --- | (u - u   )  +  (v - v   )  |
++					 *      2  [       obs            obs   ]
++					 *
++					 *        dJ
++					 * DU = - -- = (u   - u )
++					 *        du     obs
++					 */
++					for (i=0;i<NUMVERTICES;i++){
++						dux=vxobs-vx;
++						duy=vyobs-vy;
++						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++					}
++					break;
++				case SurfaceRelVelMisfitEnum:
++					/*
++					 *      1  [     \bar{v}^2             2   \bar{v}^2              2 ]
++					 * J = --- | -------------  (u - u   ) + -------------  (v - v   )  |
++					 *      2  [  (u   + eps)^2       obs    (v   + eps)^2       obs    ]
++					 *              obs                        obs                      
++					 *
++					 *        dJ     \bar{v}^2
++					 * DU = - -- = ------------- (u   - u )
++					 *        du   (u   + eps)^2    obs
++					 *               obs
++					 */
++					for (i=0;i<NUMVERTICES;i++){
++						scalex=pow(meanvel/(vxobs+epsvel),2.); if(vxobs==0)scalex=0;
++						scaley=pow(meanvel/(vyobs+epsvel),2.); if(vyobs==0)scaley=0;
++						dux=scalex*(vxobs-vx);
++						duy=scaley*(vyobs-vy);
++						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++					}
++					break;
++				case SurfaceLogVelMisfitEnum:
++					/*
++					 *                 [        vel + eps     ] 2
++					 * J = 4 \bar{v}^2 | log ( -----------  ) |  
++					 *                 [       vel   + eps    ]
++					 *                            obs
++					 *
++					 *        dJ                 2 * log(...)
++					 * DU = - -- = - 4 \bar{v}^2 -------------  u
++					 *        du                 vel^2 + eps
++					 *            
++					 */
++					for (i=0;i<NUMVERTICES;i++){
++						velocity_mag    =sqrt(pow(vx,   2.)+pow(vy,   2.))+epsvel;
++						obs_velocity_mag=sqrt(pow(vxobs,2.)+pow(vyobs,2.))+epsvel;
++						scale=-8*pow(meanvel,2.)/pow(velocity_mag,2.)*log(velocity_mag/obs_velocity_mag);
++						dux=scale*vx;
++						duy=scale*vy;
++						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++					}
++					break;
++				case SurfaceAverageVelMisfitEnum:
++					/*
++					 *      1                    2              2
++					 * J = ---  sqrt(  (u - u   )  +  (v - v   )  )
++					 *      S                obs            obs
++					 *
++					 *        dJ      1       1 
++					 * DU = - -- = - --- ----------- * 2 (u - u   )
++					 *        du      S  2 sqrt(...)           obs
++					 */
++					for (i=0;i<NUMVERTICES;i++){
++						scale=1./(S*2*sqrt(pow(vx-vxobs,2.)+pow(vy-vyobs,2.))+epsvel);
++						dux=scale*(vxobs-vx);
++						duy=scale*(vyobs-vy);
++						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++					}
++					break;
++				case SurfaceLogVxVyMisfitEnum:
++					/*
++					 *      1            [        |u| + eps     2          |v| + eps     2  ]
++					 * J = --- \bar{v}^2 | log ( -----------  )   +  log ( -----------  )   |  
++					 *      2            [       |u    |+ eps              |v    |+ eps     ]
++					 *                              obs                       obs
++					 *        dJ                              1      u                             1
++					 * DU = - -- = - \bar{v}^2 log(u...) --------- ----  ~ - \bar{v}^2 log(u...) ------
++					 *        du                         |u| + eps  |u|                           u + eps
++					 */
++					for (i=0;i<NUMVERTICES;i++){
++						dux = - pow(meanvel,2.) * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);
++						duy = - pow(meanvel,2.) * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);
++						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++					}
++					break;
++				case DragCoefficientAbsGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case ThicknessAbsGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case RheologyBbarAbsGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				default:
++					_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++			}
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	xDelete<int>(responses);
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Tria::DragCoefficientAbsGradient{{{*/
++IssmDouble Tria::DragCoefficientAbsGradient(bool process_units,int weight_index){
++
++	/* Intermediaries */
++	int        ig;
++	IssmDouble     Jelem = 0;
++	IssmDouble     weight;
++	IssmDouble     Jdet;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     dp[NDOF2];
++	GaussTria *gauss = NULL;
++
++	/*retrieve parameters and inputs*/
++
++	/*If on water, return 0: */
++	if(IsOnWater()) return 0;
++
++	/*Retrieve all inputs we will be needing: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* weights_input=inputs->GetInput(InversionCostFunctionsCoefficientsEnum);         _assert_(weights_input);
++	Input* drag_input   =inputs->GetInput(FrictionCoefficientEnum); _assert_(drag_input);
++
++	/* Start looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++		drag_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
++
++		/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
++		Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixAdjointBalancethickness {{{*/
++ElementMatrix* Tria::CreateKMatrixAdjointBalancethickness(void){
++
++	ElementMatrix* Ke=NULL;
++
++	/*Get Element Matrix of the forward model*/
++	switch(GetElementType()){
++		case P1Enum:
++			Ke=CreateKMatrixBalancethickness_CG();
++			break;
++		case P1DGEnum:
++			Ke=CreateKMatrixBalancethickness_DG();
++			break;
++		default:
++			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
++	}
++
++	/*Transpose and return Ke*/
++	Ke->Transpose();
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixAdjointMacAyeal{{{*/
++ElementMatrix* Tria::CreateKMatrixAdjointMacAyeal(void){
++
++	/*Constants*/
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	bool       incomplete_adjoint;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     Jdet,thickness;
++	IssmDouble     eps1dotdphii,eps1dotdphij;
++	IssmDouble     eps2dotdphii,eps2dotdphij;
++	IssmDouble     mu_prime;
++	IssmDouble     epsilon[3];/* epsilon=[exx,eyy,exy];*/
++	IssmDouble     eps1[2],eps2[2];
++	IssmDouble     phi[NUMVERTICES];
++	IssmDouble     dphi[2][NUMVERTICES];
++	GaussTria *gauss=NULL;
++
++	/*Initialize Jacobian with regular MacAyeal (first part of the Gateau derivative)*/
++	parameters->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
++	ElementMatrix* Ke=CreateKMatrixDiagnosticMacAyeal();
++	if(incomplete_adjoint) return Ke;
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
++	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsDerivatives(&dphi[0][0],&xyz_list[0][0],gauss);
++
++		thickness_input->GetInputValue(&thickness, gauss);
++		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		matice->GetViscosity2dDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
++		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
++
++		for(i=0;i<3;i++){
++			for(j=0;j<3;j++){
++				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i];
++				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j];
++				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i];
++				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j];
++
++				Ke->values[6*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps1dotdphii;
++				Ke->values[6*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps1dotdphii;
++				Ke->values[6*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps2dotdphii;
++				Ke->values[6*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps2dotdphii;
++			}
++		}
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	//Ke->Transpose();
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromSolutionAdjointHoriz {{{*/
++void  Tria::InputUpdateFromSolutionAdjointHoriz(IssmDouble* solution){
++
++	const int numdof=NDOF2*NUMVERTICES;
++
++	int       i;
++	int*      doflist=NULL;
++	IssmDouble    values[numdof];
++	IssmDouble    lambdax[NUMVERTICES];
++	IssmDouble    lambday[NUMVERTICES];
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		lambdax[i]=values[i*NDOF2+0];
++		lambday[i]=values[i*NDOF2+1];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(lambdax[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambday[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new TriaP1Input(AdjointxEnum,lambdax));
++	this->inputs->AddInput(new TriaP1Input(AdjointyEnum,lambday));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromSolutionAdjointBalancethickness {{{*/
++void  Tria::InputUpdateFromSolutionAdjointBalancethickness(IssmDouble* solution){
++
++	const int numdof=NDOF1*NUMVERTICES;
++
++	int       i;
++	int*      doflist=NULL;
++	IssmDouble    values[numdof];
++	IssmDouble    lambda[NUMVERTICES];
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<numdof;i++){
++		lambda[i]=values[i];
++		if(xIsNan<IssmDouble>(lambda[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new TriaP1Input(AdjointEnum,lambda));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Tria::GetVectorFromControlInputs{{{*/
++void  Tria::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){
++
++	int doflist1[NUMVERTICES];
++	Input *input=NULL;
++
++	/*Get out if this is not an element input*/
++	if(!IsInput(control_enum)) return;
++
++	/*Prepare index list*/
++	GradientIndexing(&doflist1[0],control_index);
++
++	/*Get input (either in element or material)*/
++	if(control_enum==MaterialsRheologyBbarEnum){
++		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
++	}
++	else{
++		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
++	}
++
++	/*Check that it is a ControlInput*/
++	if (input->ObjectEnum()!=ControlInputEnum){
++		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
++	}
++
++	((ControlInput*)input)->GetVectorFromInputs(vector,&doflist1[0],data);
++}
++/*}}}*/
++/*FUNCTION Tria::SetControlInputsFromVector{{{*/
++void  Tria::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){
++
++	IssmDouble  values[NUMVERTICES];
++	int     doflist1[NUMVERTICES];
++	Input  *input     = NULL;
++	Input  *new_input = NULL;
++
++	/*Get out if this is not an element input*/
++	if(!IsInput(control_enum)) return;
++
++	/*Prepare index list*/
++	GradientIndexing(&doflist1[0],control_index);
++
++	/*Get values on vertices*/
++	for (int i=0;i<NUMVERTICES;i++){
++		values[i]=vector[doflist1[i]];
++	}
++	new_input = new TriaP1Input(control_enum,values);
++
++	if(control_enum==MaterialsRheologyBbarEnum){
++		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
++	}
++	else{
++		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
++	}
++
++	if (input->ObjectEnum()!=ControlInputEnum){
++		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
++	}
++
++	((ControlInput*)input)->SetInput(new_input);
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_HYDROLOGY_
++/*FUNCTION Tria::CreateHydrologyWaterVelocityInput {{{*/
++void Tria::CreateHydrologyWaterVelocityInput(void){
++
++	/*material parameters: */
++	IssmDouble mu_water;
++	IssmDouble VelocityFactor;  // This factor represents the number 12 in laminar flow velocity which can vary by differnt hydrology.CR
++	IssmDouble n_man,CR;
++	IssmDouble w;
++	IssmDouble rho_ice, rho_water, g;
++	IssmDouble dsdx,dsdy,dbdx,dbdy;
++	IssmDouble vx[NUMVERTICES];
++	IssmDouble vy[NUMVERTICES];
++	GaussTria *gauss = NULL;
++
++	/*Retrieve all inputs and parameters*/
++	rho_ice=matpar->GetRhoIce();
++	rho_water=matpar->GetRhoWater();
++	g=matpar->GetG();
++	CR=matpar->GetHydrologyCR(); // To have Lebrocq equavalent equation: CR=0.01,n_man=0.02
++	n_man=matpar->GetHydrologyN(); 
++	mu_water=matpar->GetMuWater();
++	Input* surfaceslopex_input=inputs->GetInput(SurfaceSlopeXEnum); _assert_(surfaceslopex_input);
++	Input* surfaceslopey_input=inputs->GetInput(SurfaceSlopeYEnum); _assert_(surfaceslopey_input);
++	Input* bedslopex_input=inputs->GetInput(BedSlopeXEnum);         _assert_(bedslopex_input);
++	Input* bedslopey_input=inputs->GetInput(BedSlopeYEnum);         _assert_(bedslopey_input);
++	Input* watercolumn_input=inputs->GetInput(WatercolumnEnum);     _assert_(watercolumn_input);
++
++	/* compute VelocityFactor */
++	VelocityFactor= n_man*pow(CR,2)*rho_water*g/mu_water;
++	
++	gauss=new GaussTria();
++	for (int iv=0;iv<NUMVERTICES;iv++){
++		gauss->GaussVertex(iv);
++		surfaceslopex_input->GetInputValue(&dsdx,gauss);
++		surfaceslopey_input->GetInputValue(&dsdy,gauss);
++		bedslopex_input->GetInputValue(&dbdx,gauss);
++		bedslopey_input->GetInputValue(&dbdy,gauss);
++		watercolumn_input->GetInputValue(&w,gauss);
++
++		/* Water velocity x and y components */
++	//	vx[iv]= - pow(w,2)/(12 * mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx);
++	//	vy[iv]= - pow(w,2)/(12 * mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy);
++	
++		vx[iv]= - pow(w,2)/(VelocityFactor* mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx);
++		vy[iv]= - pow(w,2)/(VelocityFactor* mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy);
++	}
++
++	/*clean-up*/
++	delete gauss;
++
++	/*Add to inputs*/
++	this->inputs->AddInput(new TriaP1Input(HydrologyWaterVxEnum,vx));
++	this->inputs->AddInput(new TriaP1Input(HydrologyWaterVyEnum,vy));
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixHydrology{{{*/
++ElementMatrix* Tria::CreateKMatrixHydrology(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	IssmDouble     diffusivity;
++	int        i,j,ig;
++	IssmDouble     Jdettria,DL_scalar,dt,h;
++	IssmDouble     vx,vy,vel,dvxdx,dvydy;
++	IssmDouble     dvx[2],dvy[2];
++	IssmDouble     v_gauss[2]={0.0};
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     L[NUMVERTICES];
++	IssmDouble     B[2][NUMVERTICES];
++	IssmDouble     Bprime[2][NUMVERTICES];
++	IssmDouble     K[2][2]                        ={0.0};
++	IssmDouble     KDL[2][2]                      ={0.0};
++	IssmDouble     DL[2][2]                        ={0.0};
++	IssmDouble     DLprime[2][2]                   ={0.0};
++	GaussTria *gauss=NULL;
++
++	/*Skip if water or ice shelf element*/
++	if(IsOnWater() | IsFloating()) return NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Create water velocity vx and vy from current inputs*/
++	CreateHydrologyWaterVelocityInput();
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	this->parameters->FindParam(&diffusivity,HydrologyStabilizationEnum);
++	Input* vx_input=inputs->GetInput(HydrologyWaterVxEnum); _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(HydrologyWaterVyEnum); _assert_(vy_input);
++	h=sqrt(2*this->GetArea());
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
++		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
++
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		vx_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
++		vy_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
++
++		DL_scalar=gauss->weight*Jdettria;
++
++		TripleMultiply( &L[0],1,numdof,1,
++					&DL_scalar,1,1,0,
++					&L[0],1,numdof,0,
++					&Ke->values[0],1);
++
++		GetBPrognostic(&B[0][0], &xyz_list[0][0], gauss);
++		GetBprimePrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
++
++		dvxdx=dvx[0];
++		dvydy=dvy[1];
++		DL_scalar=dt*gauss->weight*Jdettria;
++
++		DL[0][0]=DL_scalar*dvxdx;
++		DL[1][1]=DL_scalar*dvydy;
++		DLprime[0][0]=DL_scalar*vx;
++		DLprime[1][1]=DL_scalar*vy;
++
++		TripleMultiply( &B[0][0],2,numdof,1,
++					&DL[0][0],2,2,0,
++					&B[0][0],2,numdof,0,
++					&Ke->values[0],1);
++
++		TripleMultiply( &B[0][0],2,numdof,1,
++					&DLprime[0][0],2,2,0,
++					&Bprime[0][0],2,numdof,0,
++					&Ke->values[0],1);
++
++		/*Artificial diffusivity*/
++		vel=sqrt(pow(vx,2.)+pow(vy,2.));
++		K[0][0]=diffusivity*h/(2*vel)*vx*vx;
++		K[1][0]=diffusivity*h/(2*vel)*vy*vx;
++		K[0][1]=diffusivity*h/(2*vel)*vx*vy;
++		K[1][1]=diffusivity*h/(2*vel)*vy*vy;
++		KDL[0][0]=DL_scalar*K[0][0];
++		KDL[1][0]=DL_scalar*K[1][0];
++		KDL[0][1]=DL_scalar*K[0][1];
++		KDL[1][1]=DL_scalar*K[1][1];
++
++		TripleMultiply( &Bprime[0][0],2,numdof,1,
++					&KDL[0][0],2,2,0,
++					&Bprime[0][0],2,numdof,0,
++					&Ke->values[0],1);
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorHydrology {{{*/
++ElementVector* Tria::CreatePVectorHydrology(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     Jdettria,dt;
++	IssmDouble     basal_melting_g;
++	IssmDouble     old_watercolumn_g;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     basis[numdof];
++	GaussTria* gauss=NULL;
++
++	/*Skip if water or ice shelf element*/
++	if(IsOnWater() | IsFloating()) return NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	Input* basal_melting_input=inputs->GetInput(BasalforcingsMeltingRateEnum); _assert_(basal_melting_input);
++	Input* old_watercolumn_input=inputs->GetInput(WaterColumnOldEnum);         _assert_(old_watercolumn_input);
++
++	/*Initialize basal_melting_correction_g to 0, do not forget!:*/
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
++		GetNodalFunctions(basis, gauss);
++
++		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
++		old_watercolumn_input->GetInputValue(&old_watercolumn_g,gauss);
++
++		if(dt)for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(old_watercolumn_g+dt*basal_melting_g)*basis[i];
++		else  for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*basal_melting_g*basis[i];
++	}
++		
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Tria::GetSolutionFromInputsHydrology{{{*/
++void  Tria::GetSolutionFromInputsHydrology(Vector* solution){
++
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	int i;
++	int*         doflist=NULL;
++	IssmDouble       watercolumn;
++	IssmDouble       values[numdof];
++	GaussTria*   gauss=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Get inputs*/
++	Input* watercolumn_input=inputs->GetInput(WatercolumnEnum); _assert_(watercolumn_input);
++
++	/*Ok, we have watercolumn values, fill in watercolumn array: */
++	/*P1 element only for now*/
++	gauss=new GaussTria();
++	for(i=0;i<NUMVERTICES;i++){
++
++		gauss->GaussVertex(i);
++
++		/*Recover watercolumn*/
++		watercolumn_input->GetInputValue(&watercolumn,gauss);
++		values[i]=watercolumn;
++	}
++
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromSolutionHydrology{{{*/
++void  Tria::InputUpdateFromSolutionHydrology(IssmDouble* solution){
++
++	/*Intermediaries*/
++	const int numdof = NDOF1*NUMVERTICES;
++
++	int       i;
++	int*      doflist=NULL;
++	IssmDouble    values[numdof];
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++){
++		values[i]=solution[doflist[i]];
++		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++		if (values[i]<pow((IssmDouble)10,(IssmDouble)-10))values[i]=pow((IssmDouble)10,(IssmDouble)-10); //correcting the water column to positive values
++ 
++	}
++
++	/*Add input to the element: */
++	this->inputs->AddInput(new TriaP1Input(WatercolumnEnum,values));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_DAKOTA_
++/*FUNCTION Tria::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);{{{*/
++void  Tria::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
++	
++	int i,j;
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	switch(type){
++
++		case VertexEnum:
++
++			/*New TriaP1Input*/
++			IssmDouble values[3];
++
++			/*Get values on the 3 vertices*/
++			for (i=0;i<3;i++){
++				values[i]=vector[this->nodes[i]->GetSidList()]; //careful, vector of values here is not parallel distributed, but serial distributed (from a serial Dakota core!)
++			}
++
++			/*Branch on the specified type of update: */
++			switch(name){
++				case ThicknessEnum:
++					IssmDouble  thickness[3];
++					IssmDouble  thickness_init[3];
++					IssmDouble  hydrostatic_ratio[3];
++					IssmDouble  surface[3];
++					IssmDouble  bed[3];
++					
++					/*retrieve inputs: */
++					GetInputListOnVertices(&thickness_init[0],ThicknessEnum);
++					GetInputListOnVertices(&hydrostatic_ratio[0],GeometryHydrostaticRatioEnum);
++					GetInputListOnVertices(&bed[0],BedEnum);
++					GetInputListOnVertices(&surface[0],SurfaceEnum);
++
++					/*build new bed and surface: */
++					if (this->IsFloating()){
++						/*hydrostatic equilibrium: */
++						IssmDouble rho_ice,rho_water,di;
++						rho_ice   = this->matpar->GetRhoIce();
++						rho_water = this->matpar->GetRhoWater();
++						di        = rho_ice/rho_water;
++
++						/*build new thickness: */
++						for (j=0; j<3; j++) {
++							/*  for observed/interpolated/hydrostatic thickness, remove scaling from any hydrostatic thickness  */
++							if (hydrostatic_ratio[j] >= 0.)
++								thickness[j]=values[j]-(values[j]/thickness_init[j]-1.)*hydrostatic_ratio[j]*surface[j]/(1.-di);
++							/*  for minimum thickness, don't scale  */
++							else
++								thickness[j]=thickness_init[j];
++
++							/*  check the computed thickness and update bed*/
++							if (thickness[j] < 0.) thickness[j]=1./(1.-di);
++							bed[j]=surface[j]-thickness[j];
++						}
++					}
++					else{
++						/*build new thickness: */
++						for (j=0; j<3; j++) {
++							/*  for observed thickness, use scaled value  */
++							if (hydrostatic_ratio[j] >= 0.)
++								thickness[j]=values[j];
++							/*  for minimum thickness, don't scale  */
++							else
++								thickness[j]=thickness_init[j];
++						}
++
++						/*update bed on grounded ice: */
++						for(j=0;j<3;j++)bed[j]=surface[j]-thickness[j];
++					}
++
++					/*Add new inputs: */
++					this->inputs->AddInput(new TriaP1Input(ThicknessEnum,thickness));
++					this->inputs->AddInput(new TriaP1Input(BedEnum,bed));
++					this->inputs->AddInput(new TriaP1Input(SurfaceEnum,surface));
++
++					break;
++				default:
++					this->inputs->AddInput(new TriaP1Input(name,values));
++			}
++			break;
++
++		default:
++			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/
++void  Tria::InputUpdateFromVectorDakota(int* vector, int name, int type){
++	_error2_("not supported yet!");
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/
++void  Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type){
++	_error2_("not supported yet!");
++}
++/*}}}*/
++/*FUNCTION Tria::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type);{{{*/
++void  Tria::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
++	
++	int i,j,t;
++	TransientInput* transientinput=NULL;
++	IssmDouble values[3];
++	IssmDouble time;
++	int row;
++	IssmDouble yts;
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	switch(type){
++
++		case VertexEnum:
++			
++			/*Create transient input: */
++						
++			parameters->FindParam(&yts,ConstantsYtsEnum);
++			for(t=0;t<ncols;t++){ //ncols is the number of times
++
++				/*create input values: */
++				for(i=0;i<3;i++){
++					row=this->nodes[i]->GetSidList();
++					values[i]=(IssmDouble)matrix[ncols*row+t];
++				}
++
++				/*time? :*/
++				time=(IssmDouble)matrix[(nrows-1)*ncols+t]*yts;
++
++				if(t==0) transientinput=new TransientInput(name);
++				transientinput->AddTimeInput(new TriaP1Input(name,values),time);
++				transientinput->Configure(parameters);
++			}
++			this->inputs->AddInput(transientinput);
++			break;
++
++		default:
++			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++	}
++
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_BALANCED_
++/*FUNCTION Tria::CreateKMatrixBalancethickness {{{*/
++ElementMatrix* Tria::CreateKMatrixBalancethickness(void){
++
++	switch(GetElementType()){
++		case P1Enum:
++			return CreateKMatrixBalancethickness_CG();
++		case P1DGEnum:
++			return CreateKMatrixBalancethickness_DG();
++		default:
++			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixBalancethickness_CG {{{*/
++ElementMatrix* Tria::CreateKMatrixBalancethickness_CG(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int        stabilization;
++	int        i,j,ig,dim;
++	IssmDouble     Jdettria,vx,vy,dvxdx,dvydy,vel,h;
++	IssmDouble     dvx[2],dvy[2];
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     L[NUMVERTICES];
++	IssmDouble     B[2][NUMVERTICES];
++	IssmDouble     Bprime[2][NUMVERTICES];
++	IssmDouble     K[2][2]                          = {0.0};
++	IssmDouble     KDL[2][2]                        = {0.0};
++	IssmDouble     DL[2][2]                         = {0.0};
++	IssmDouble     DLprime[2][2]                    = {0.0};
++	IssmDouble     DL_scalar;
++	GaussTria *gauss                            = NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all Inputs and parameters: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&stabilization,BalancethicknessStabilizationEnum);
++	this->parameters->FindParam(&dim,MeshDimensionEnum);
++	Input* vxaverage_input=NULL;
++	Input* vyaverage_input=NULL;
++	if(dim==2){
++		vxaverage_input=inputs->GetInput(VxEnum); _assert_(vxaverage_input);
++		vyaverage_input=inputs->GetInput(VyEnum); _assert_(vyaverage_input);
++	}
++	else{
++		vxaverage_input=inputs->GetInput(VxAverageEnum); _assert_(vxaverage_input);
++		vyaverage_input=inputs->GetInput(VyAverageEnum); _assert_(vyaverage_input);
++	}
++	h=sqrt(2*this->GetArea());
++
++	/*Start looping on the number of gaussian points:*/
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
++		GetBPrognostic(&B[0][0], &xyz_list[0][0], gauss);
++		GetBprimePrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
++
++		vxaverage_input->GetInputValue(&vx,gauss);
++		vyaverage_input->GetInputValue(&vy,gauss);
++		vxaverage_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
++		vyaverage_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
++
++		dvxdx=dvx[0];
++		dvydy=dvy[1];
++		DL_scalar=gauss->weight*Jdettria;
++
++		DL[0][0]=DL_scalar*dvxdx;
++		DL[1][1]=DL_scalar*dvydy;
++
++		DLprime[0][0]=DL_scalar*vx;
++		DLprime[1][1]=DL_scalar*vy;
++
++		TripleMultiply( &B[0][0],2,numdof,1,
++					&DL[0][0],2,2,0,
++					&B[0][0],2,numdof,0,
++					&Ke->values[0],1);
++
++		TripleMultiply( &B[0][0],2,numdof,1,
++					&DLprime[0][0],2,2,0,
++					&Bprime[0][0],2,numdof,0,
++					&Ke->values[0],1);
++
++		if(stabilization==1){
++			/*Streamline upwinding*/
++			vel=sqrt(pow(vx,2.)+pow(vy,2.));
++			K[0][0]=h/(2*vel)*vx*vx;
++			K[1][0]=h/(2*vel)*vy*vx;
++			K[0][1]=h/(2*vel)*vx*vy;
++			K[1][1]=h/(2*vel)*vy*vy;
++		}
++		else if(stabilization==2){
++			/*MacAyeal*/
++			vxaverage_input->GetInputAverage(&vx);
++			vyaverage_input->GetInputAverage(&vy);
++			K[0][0]=h/2.0*fabs(vx);
++			K[0][1]=0.;
++			K[1][0]=0.;
++			K[1][1]=h/2.0*fabs(vy);
++		}
++		if(stabilization==1 || stabilization==2){
++			KDL[0][0]=DL_scalar*K[0][0];
++			KDL[1][0]=DL_scalar*K[1][0];
++			KDL[0][1]=DL_scalar*K[0][1];
++			KDL[1][1]=DL_scalar*K[1][1];
++			TripleMultiply( &Bprime[0][0],2,numdof,1,
++						&KDL[0][0],2,2,0,
++						&Bprime[0][0],2,numdof,0,
++						&Ke->values[0],1);
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreateKMatrixBalancethickness_DG {{{*/
++ElementMatrix* Tria::CreateKMatrixBalancethickness_DG(void){
++
++	/*Constants*/
++	const int  numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries*/
++	int        i,j,ig,dim;
++	IssmDouble     vx,vy,Jdettria;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     B[2][NUMVERTICES];
++	IssmDouble     Bprime[2][NUMVERTICES];
++	IssmDouble     DL[2][2]={0.0};
++	IssmDouble     DL_scalar;
++	GaussTria  *gauss=NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&dim,MeshDimensionEnum);
++	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
++
++	/*Start looping on the number of gaussian points:*/
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
++		/*WARNING: B and Bprime are inverted compared to usual prognostic!!!!*/
++		GetBPrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
++		GetBprimePrognostic(&B[0][0], &xyz_list[0][0], gauss);
++
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++
++		DL_scalar=-gauss->weight*Jdettria;
++		DL[0][0]=DL_scalar*vx;
++		DL[1][1]=DL_scalar*vy;
++
++		TripleMultiply( &B[0][0],2,numdof,1,
++					&DL[0][0],2,2,0,
++					&Bprime[0][0],2,numdof,0,
++					&Ke->values[0],1);
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorBalancethickness{{{*/
++ElementVector* Tria::CreatePVectorBalancethickness(void){
++
++	switch(GetElementType()){
++		case P1Enum:
++			return CreatePVectorBalancethickness_CG();
++			break;
++		case P1DGEnum:
++			return CreatePVectorBalancethickness_DG();
++		default:
++			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorBalancethickness_CG{{{*/
++ElementVector* Tria::CreatePVectorBalancethickness_CG(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++	
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     dhdt_g,basal_melting_g,surface_mass_balance_g,Jdettria;
++	IssmDouble     L[NUMVERTICES];
++	GaussTria* gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	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(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		surface_mass_balance_input->GetInputValue(&surface_mass_balance_g,gauss);
++		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
++		dhdt_input->GetInputValue(&dhdt_g,gauss);
++
++		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
++		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
++
++		for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(surface_mass_balance_g-basal_melting_g-dhdt_g)*L[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Tria::CreatePVectorBalancethickness_DG {{{*/
++ElementVector* Tria::CreatePVectorBalancethickness_DG(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     basal_melting_g,surface_mass_balance_g,dhdt_g,Jdettria;
++	IssmDouble     L[NUMVERTICES];
++	GaussTria* gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	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(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		surface_mass_balance_input->GetInputValue(&surface_mass_balance_g,gauss);
++		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
++		dhdt_input->GetInputValue(&dhdt_g,gauss);
++
++		GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
++		GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
++
++		for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(surface_mass_balance_g-basal_melting_g-dhdt_g)*L[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp	(revision 12822)
+@@ -0,0 +1,72 @@
++/*!\file TriaHook.c
++ * \brief: implementation of the TriaHook object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Object constructors and destructor*/
++/*FUNCTION TriaHook::TriaHook(){{{*/
++TriaHook::TriaHook(){
++	numanalyses=UNDEF;
++	this->hnodes=NULL;
++	this->hmatice=NULL;
++	this->hmatpar=NULL;
++}
++/*}}}*/
++/*FUNCTION TriaHook::~TriaHook(){{{*/
++TriaHook::~TriaHook(){
++	int i;
++
++	for(i=0;i<this->numanalyses;i++){
++		if (this->hnodes[i]) delete this->hnodes[i];
++	}
++	delete [] this->hnodes;
++	delete hmatice;
++	delete hmatpar;
++
++}
++/*}}}*/
++/*FUNCTION TriaHook::TriaHook(int in_numanalyses,int matice_id, int matpar_id){{{*/
++TriaHook::TriaHook(int in_numanalyses,int matice_id, IoModel* iomodel){
++
++	/*intermediary: */
++	int matpar_id;
++
++	/*retrieve parameters: */
++	iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
++	
++	this->numanalyses=in_numanalyses;
++	this->hnodes= new Hook*[in_numanalyses];
++	this->hmatice=new Hook(&matice_id,1);
++	this->hmatpar=new Hook(&matpar_id,1);
++
++	//Initialize hnodes as NULL
++	for(int i=0;i<this->numanalyses;i++){
++		this->hnodes[i]=NULL;
++	}
++
++}
++/*}}}*/
++
++/*FUNCTION TriaHook::SetHookNodes{{{*/
++void TriaHook::SetHookNodes(int* node_ids,int analysis_counter){
++
++	/*initialize hook*/
++	this->hnodes[analysis_counter]=new Hook(node_ids,3);
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.h	(revision 12822)
+@@ -0,0 +1,49 @@
++/*!\file:  TriaRef.h
++ * \brief abstract class for handling Tria oriented routines, like nodal functions, 
++ * strain rate generation, etc ...
++ */ 
++
++
++#ifndef _TRIAREF_H_
++#define _TRIAREF_H_
++
++class GaussTria;
++
++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 GetBMacAyeal(IssmDouble* B, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetBMacAyealStokes(IssmDouble* B , IssmDouble* xyz_list, GaussTria* gauss);
++		void GetBprimeMacAyeal(IssmDouble* Bprime, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetBprimeMacAyealStokes(IssmDouble* Bprime, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetBprimePrognostic(IssmDouble* Bprime_prog, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetBPrognostic(IssmDouble* B_prog, IssmDouble* xyz_list, GaussTria* gauss);
++		void GetL(IssmDouble* L, IssmDouble* xyz_list,GaussTria* gauss,int numdof);
++		void GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussTria* gauss);
++		void GetSegmentJacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,GaussTria* gauss);
++		void GetJacobianDeterminant2d(IssmDouble* Jdet, IssmDouble* xyz_list,GaussTria* gauss);
++		void GetJacobianDeterminant3d(IssmDouble* Jdet, IssmDouble* xyz_list,GaussTria* gauss);
++		void GetJacobianInvert(IssmDouble*  Jinv, IssmDouble* xyz_list,GaussTria* gauss);
++		void GetNodalFunctions(IssmDouble* l1l2l3,GaussTria* gauss);
++		void GetSegmentNodalFunctions(IssmDouble* l1l2l3,GaussTria* gauss, int index1,int index2);
++		void GetSegmentBFlux(IssmDouble* B,GaussTria* gauss, int index1,int index2);
++		void GetSegmentBprimeFlux(IssmDouble* Bprime,GaussTria* gauss, int index1,int index2);
++		void GetNodalFunctionsDerivatives(IssmDouble* l1l2l3,IssmDouble* xyz_list, GaussTria* gauss);
++		void GetNodalFunctionsDerivativesReference(IssmDouble* dl1dl3,GaussTria* gauss);
++		void GetInputValue(IssmDouble* pp, IssmDouble* plist, GaussTria* gauss);
++		void GetInputDerivativeValue(IssmDouble* pp, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss);
++
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp	(revision 12822)
+@@ -0,0 +1,1267 @@
++/*!\file PentaRef.c
++ * \brief: implementation of the PentaRef object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Element macros*/
++#define NUMNODESP1    6
++#define NUMNODESP1_2d 3
++#define NUMNODESMINI  7
++
++/*Object constructors and destructor*/
++/*FUNCTION PentaRef::PentaRef(){{{*/
++PentaRef::PentaRef(){
++	this->element_type_list=NULL;
++}
++/*}}}*/
++/*FUNCTION PentaRef::PentaRef(int* types,int nummodels){{{*/
++PentaRef::PentaRef(const int nummodels){
++
++	/*Only allocate pointer*/
++	element_type_list=xNew<int>(nummodels);
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::~PentaRef(){{{*/
++PentaRef::~PentaRef(){
++	xDelete<int>(element_type_list);
++}
++/*}}}*/
++
++/*Management*/
++/*FUNCTION PentaRef::SetElementType{{{*/
++void PentaRef::SetElementType(int type,int type_counter){
++
++	_assert_(type==P1Enum || type==P1DGEnum);
++
++	/*initialize element type*/
++	this->element_type_list[type_counter]=type;
++}
++/*}}}*/
++
++/*Reference Element numerics*/
++/*FUNCTION PentaRef::GetBMacAyealPattyn {{{*/
++void PentaRef::GetBMacAyealPattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 
++	 * For node i, Bi can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi=[ dh/dx          0      ]
++	 *          [   0           dh/dy   ]
++	 *          [ 1/2*dh/dy  1/2*dh/dx  ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1)
++	 */
++
++	IssmDouble dbasis[3][NUMNODESP1];
++
++	/*Get dbasis in actual coordinate system: */
++	GetNodalFunctionsP1Derivatives(&dbasis[0][0],xyz_list, gauss);
++
++	/*Build B: */
++	for (int i=0;i<NUMNODESP1;i++){
++		*(B+NDOF2*NUMNODESP1*0+NDOF2*i)=dbasis[0][i]; 
++		*(B+NDOF2*NUMNODESP1*0+NDOF2*i+1)=0.0;
++
++		*(B+NDOF2*NUMNODESP1*1+NDOF2*i)=0.0;
++		*(B+NDOF2*NUMNODESP1*1+NDOF2*i+1)=dbasis[1][i];
++
++		*(B+NDOF2*NUMNODESP1*2+NDOF2*i)=(float).5*dbasis[1][i]; 
++		*(B+NDOF2*NUMNODESP1*2+NDOF2*i+1)=(float).5*dbasis[0][i]; 
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBMacAyealStokes{{{*/
++void PentaRef::GetBMacAyealStokes(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 
++	 * For node i, Bi can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi=[ dh/dx          0       0   0 ]
++	 *          [   0           dh/dy    0   0 ]
++	 *          [ 1/2*dh/dy  1/2*dh/dx   0   0 ]
++	 *          [   0            0       0   h ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1)
++	 */
++
++	int    i;
++	IssmDouble dh1dh7[3][NUMNODESMINI];
++	IssmDouble l1l6[NUMNODESP1];
++
++	/*Get dh1dh6 in actual coordinate system: */
++	GetNodalFunctionsMINIDerivatives(&dh1dh7[0][0],xyz_list, gauss);
++	GetNodalFunctionsP1(l1l6, gauss);
++
++	/*Build B: */
++	for (i=0;i<NUMNODESMINI;i++){
++		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i)=dh1dh7[0][i]; //B[0][NDOF4*i]=dh1dh6[0][i];
++		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+2)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+1)=dh1dh7[1][i];
++		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+2)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i)=0.5*dh1dh7[1][i];
++		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+1)=0.5*dh1dh7[0][i];
++		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+2)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+1)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+2)=0;
++	}
++
++	for (i=0;i<NUMNODESP1;i++){ //last column not for the bubble function
++		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+3)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+3)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+3)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+3)=l1l6[i];
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBPattyn {{{*/
++void PentaRef::GetBPattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 
++	 * For node i, Bi can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi=[ dh/dx          0      ]
++	 *          [   0           dh/dy   ]
++	 *          [ 1/2*dh/dy  1/2*dh/dx  ]
++	 *          [ 1/2*dh/dz      0      ]
++	 *          [  0         1/2*dh/dz  ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1)
++	 */
++
++	IssmDouble dbasis[3][NUMNODESP1];
++
++	/*Get dbasis in actual coordinate system: */
++	GetNodalFunctionsP1Derivatives(&dbasis[0][0],xyz_list, gauss);
++
++	/*Build B: */
++	for (int i=0;i<NUMNODESP1;i++){
++		*(B+NDOF2*NUMNODESP1*0+NDOF2*i)=dbasis[0][i]; 
++		*(B+NDOF2*NUMNODESP1*0+NDOF2*i+1)=0.0;
++
++		*(B+NDOF2*NUMNODESP1*1+NDOF2*i)=0.0;
++		*(B+NDOF2*NUMNODESP1*1+NDOF2*i+1)=dbasis[1][i];
++
++		*(B+NDOF2*NUMNODESP1*2+NDOF2*i)=(float).5*dbasis[1][i]; 
++		*(B+NDOF2*NUMNODESP1*2+NDOF2*i+1)=(float).5*dbasis[0][i]; 
++
++		*(B+NDOF2*NUMNODESP1*3+NDOF2*i)=(float).5*dbasis[2][i]; 
++		*(B+NDOF2*NUMNODESP1*3+NDOF2*i+1)=0.0;
++
++		*(B+NDOF2*NUMNODESP1*4+NDOF2*i)=0.0;
++		*(B+NDOF2*NUMNODESP1*4+NDOF2*i+1)=(float).5*dbasis[2][i]; 
++	}
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBprimePattyn {{{*/
++void PentaRef::GetBprimePattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss_coord){
++	/*Compute B  prime matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 
++	 * For node i, Bi can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi=[ 2*dh/dx     dh/dy   ]
++	 *                [   dh/dx    2*dh/dy  ]
++	 *                [ dh/dy      dh/dx    ]
++	 *                [ dh/dz         0     ]
++	 *                [  0         dh/dz    ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1)
++	 */
++	IssmDouble dbasis[3][NUMNODESP1];
++
++	/*Get dbasis in actual coordinate system: */
++	GetNodalFunctionsP1Derivatives(&dbasis[0][0],xyz_list, gauss_coord);
++
++	/*Build BPrime: */
++	for (int i=0;i<NUMNODESP1;i++){
++		*(B+NDOF2*NUMNODESP1*0+NDOF2*i)=2.0*dbasis[0][i]; 
++		*(B+NDOF2*NUMNODESP1*0+NDOF2*i+1)=dbasis[1][i];
++
++		*(B+NDOF2*NUMNODESP1*1+NDOF2*i)=dbasis[0][i];
++		*(B+NDOF2*NUMNODESP1*1+NDOF2*i+1)=2.0*dbasis[1][i];
++
++		*(B+NDOF2*NUMNODESP1*2+NDOF2*i)=dbasis[1][i]; 
++		*(B+NDOF2*NUMNODESP1*2+NDOF2*i+1)=dbasis[0][i]; 
++
++		*(B+NDOF2*NUMNODESP1*3+NDOF2*i)=dbasis[2][i]; 
++		*(B+NDOF2*NUMNODESP1*3+NDOF2*i+1)=0.0;
++
++		*(B+NDOF2*NUMNODESP1*4+NDOF2*i)=0.0;
++		*(B+NDOF2*NUMNODESP1*4+NDOF2*i+1)=dbasis[2][i]; 
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBprimeMacAyealStokes{{{*/
++void PentaRef::GetBprimeMacAyealStokes(IssmDouble* Bprime, IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Compute Bprime  matrix. Bprime=[Bprime1 Bprime2 Bprime3 Bprime4 Bprime5 Bprime6] where Bprimei is of size 5*NDOF2. 
++	 * For node i, Bprimei can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bprimei=[ 2*dh/dx    dh/dy   0   0 ]
++	 *               [  dh/dx    2*dh/dy  0   0 ]
++	 *               [  dh/dy     dh/dx   0   0 ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume Bprime has been allocated already, of size: 5x(NDOF2*NUMNODESP1)
++	 */
++
++	int    i;
++	IssmDouble dh1dh7[3][NUMNODESMINI];
++
++	/*Get dh1dh6 in actual coordinate system: */
++	GetNodalFunctionsMINIDerivatives(&dh1dh7[0][0],xyz_list, gauss);
++
++	/*Build Bprime: */
++	for (i=0;i<NUMNODESMINI;i++){
++		*(Bprime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i)=2*dh1dh7[0][i]; //Bprime[0][NDOF4*i]=dh1dh6[0][i];
++		*(Bprime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1)=dh1dh7[1][i];
++		*(Bprime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+2)=0;
++		*(Bprime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i)=dh1dh7[0][i];
++		*(Bprime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+1)=2*dh1dh7[1][i];
++		*(Bprime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+2)=0;
++		*(Bprime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i)=dh1dh7[1][i];
++		*(Bprime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+1)=dh1dh7[0][i];
++		*(Bprime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+2)=0;
++	}
++
++	for (i=0;i<NUMNODESP1;i++){ //last column not for the bubble function
++		*(Bprime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+3)=0;
++		*(Bprime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+3)=0;
++		*(Bprime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+3)=0;
++	}
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBStokes {{{*/
++void PentaRef::GetBStokes(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
++
++	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 3*NDOF4. 
++	 * For node i, Bi can be expressed in the actual coordinate system
++	 * by: 		Bi=[ dh/dx          0              0       0  ]
++	 *					[   0           dh/dy           0       0  ]
++	 *					[   0             0           dh/dy     0  ]
++	 *					[ 1/2*dh/dy    1/2*dh/dx        0       0  ]
++	 *					[ 1/2*dh/dz       0         1/2*dh/dx   0  ]
++	 *					[   0          1/2*dh/dz    1/2*dh/dy   0  ]
++	 *					[   0             0             0       h  ]
++	 *					[ dh/dx         dh/dy         dh/dz     0  ]
++	 *	where h is the interpolation function for node i.
++	 *	Same thing for Bb except the last column that does not exist.
++	 */
++
++	int i;
++
++	IssmDouble dh1dh7[3][NUMNODESMINI];
++	IssmDouble l1l6[NUMNODESP1];
++
++	/*Get dh1dh7 in actual coordinate system: */
++	GetNodalFunctionsMINIDerivatives(&dh1dh7[0][0],xyz_list, gauss);
++	GetNodalFunctionsP1(l1l6, gauss);
++
++	/*Build B: */
++	for (i=0;i<NUMNODESMINI;i++){
++		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i)=dh1dh7[0][i]; //B[0][NDOF4*i]=dh1dh6[0][i];
++		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+2)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+1)=dh1dh7[1][i];
++		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+2)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+1)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+2)=dh1dh7[2][i];
++		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i)=(float).5*dh1dh7[1][i]; 
++		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+1)=(float).5*dh1dh7[0][i]; 
++		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+2)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*4+NDOF4*i)=(float).5*dh1dh7[2][i];
++		*(B+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+1)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+2)=(float).5*dh1dh7[0][i];
++		*(B+(NDOF4*NUMNODESP1+3)*5+NDOF4*i)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+1)=(float).5*dh1dh7[2][i];
++		*(B+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+2)=(float).5*dh1dh7[1][i];
++		*(B+(NDOF4*NUMNODESP1+3)*6+NDOF4*i)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+1)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+2)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*7+NDOF4*i)=dh1dh7[0][i];
++		*(B+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+1)=dh1dh7[1][i];
++		*(B+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+2)=dh1dh7[2][i];
++	}
++
++	for (i=0;i<NUMNODESP1;i++){ //last column not for the bubble function
++		*(B+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+3)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+3)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+3)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+3)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+3)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+3)=0;
++		*(B+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+3)=l1l6[i];
++		*(B+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+3)=0;
++	}
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBprimeStokes {{{*/
++void PentaRef::GetBprimeStokes(IssmDouble* B_prime, IssmDouble* xyz_list, GaussPenta* 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: 
++	 *				Bi'=[  dh/dx   0          0       0]
++	 *					 [   0      dh/dy      0       0]
++	 *					 [   0      0         dh/dz    0]
++	 *					 [  dh/dy   dh/dx      0       0]
++	 *					 [  dh/dz   0        dh/dx     0]
++	 *					 [   0      dh/dz    dh/dy     0]
++	 *					 [  dh/dx   dh/dy    dh/dz     0]
++	 *					 [   0      0          0       h]
++	 *	where h is the interpolation function for node i.
++	 *
++	 * 	Same thing for the bubble fonction except that there is no fourth column
++	 */
++
++	int i;
++	IssmDouble dh1dh7[3][NUMNODESMINI];
++	IssmDouble l1l6[NUMNODESP1];
++
++	/*Get dh1dh7 in actual coordinate system: */
++	GetNodalFunctionsMINIDerivatives(&dh1dh7[0][0],xyz_list, gauss);
++	GetNodalFunctionsP1(l1l6, gauss);
++
++	/*B_primeuild B_prime: */
++	for (i=0;i<NUMNODESMINI;i++){
++		*(B_prime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i)=dh1dh7[0][i]; //B_prime[0][NDOF4*i]=dh1dh6[0][i];
++		*(B_prime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+2)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+1)=dh1dh7[1][i];
++		*(B_prime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+2)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+1)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+2)=dh1dh7[2][i];
++		*(B_prime+(NDOF4*NUMNODESP1+3)*3+NDOF4*i)=dh1dh7[1][i]; 
++		*(B_prime+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+1)=dh1dh7[0][i]; 
++		*(B_prime+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+2)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*4+NDOF4*i)=dh1dh7[2][i];
++		*(B_prime+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+1)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+2)=dh1dh7[0][i];
++		*(B_prime+(NDOF4*NUMNODESP1+3)*5+NDOF4*i)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+1)=dh1dh7[2][i];
++		*(B_prime+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+2)=dh1dh7[1][i];
++		*(B_prime+(NDOF4*NUMNODESP1+3)*6+NDOF4*i)=dh1dh7[0][i];
++		*(B_prime+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+1)=dh1dh7[1][i];
++		*(B_prime+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+2)=dh1dh7[2][i];
++		*(B_prime+(NDOF4*NUMNODESP1+3)*7+NDOF4*i)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+1)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+2)=0;
++	}
++
++	for (i=0;i<NUMNODESP1;i++){ //last column not for the bubble function
++		*(B_prime+(NDOF4*NUMNODESP1+3)*0+NDOF4*i+3)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*1+NDOF4*i+3)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*2+NDOF4*i+3)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*3+NDOF4*i+3)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*4+NDOF4*i+3)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*5+NDOF4*i+3)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*6+NDOF4*i+3)=0;
++		*(B_prime+(NDOF4*NUMNODESP1+3)*7+NDOF4*i+3)=l1l6[i];
++	}
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBAdvec{{{*/
++void PentaRef::GetBAdvec(IssmDouble* B_advec, IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 
++	 * For node i, Bi' can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi_advec =[ h ]
++	 *                 [ h ]
++	 *                 [ h ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B has been allocated already, of size: 3x(NDOF1*NUMNODESP1)
++	 */
++
++	/*Same thing in the actual coordinate system: */
++	IssmDouble l1l6[6];
++
++	/*Get dh1dh2dh3 in actual coordinates system : */
++	GetNodalFunctionsP1(l1l6, gauss);
++
++	/*Build B': */
++	for (int i=0;i<NUMNODESP1;i++){
++		*(B_advec+NDOF1*NUMNODESP1*0+NDOF1*i)=l1l6[i]; 
++		*(B_advec+NDOF1*NUMNODESP1*1+NDOF1*i)=l1l6[i]; 
++		*(B_advec+NDOF1*NUMNODESP1*2+NDOF1*i)=l1l6[i]; 
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBConduct{{{*/
++void PentaRef::GetBConduct(IssmDouble* B_conduct, IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 
++	 * For node i, Bi' can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi_conduct=[ dh/dx ]
++	 *                  [ dh/dy ]
++	 *                  [ dh/dz ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B has been allocated already, of size: 3x(NDOF1*NUMNODESP1)
++	 */
++
++	/*Same thing in the actual coordinate system: */
++	IssmDouble dh1dh6[3][NUMNODESP1];
++
++	/*Get dh1dh2dh3 in actual coordinates system : */
++	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list,gauss);
++
++	/*Build B': */
++	for (int i=0;i<NUMNODESP1;i++){
++		*(B_conduct+NDOF1*NUMNODESP1*0+NDOF1*i)=dh1dh6[0][i]; 
++		*(B_conduct+NDOF1*NUMNODESP1*1+NDOF1*i)=dh1dh6[1][i]; 
++		*(B_conduct+NDOF1*NUMNODESP1*2+NDOF1*i)=dh1dh6[2][i]; 
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBVert{{{*/
++void PentaRef::GetBVert(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
++	/*	Compute B  matrix. B=[dh1/dz dh2/dz dh3/dz dh4/dz dh5/dz dh6/dz];
++		where hi is the interpolation function for node i.*/
++
++	int i;
++	IssmDouble dh1dh6[3][NUMNODESP1];
++
++	/*Get dh1dh6 in actual coordinate system: */
++	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list, gauss);
++
++	/*Build B: */
++	for (i=0;i<NUMNODESP1;i++){
++		B[i]=dh1dh6[2][i];  
++	}
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBprimeAdvec{{{*/
++void PentaRef::GetBprimeAdvec(IssmDouble* Bprime_advec, IssmDouble* xyz_list, GaussPenta* gauss){
++	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 
++	 * For node i, Bi' can be expressed in the actual coordinate system
++	 * by: 
++	 *       Biprime_advec=[ dh/dx ]
++	 *                     [ dh/dy ]
++	 *                     [ dh/dz ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B has been allocated already, of size: 3x(NDOF1*NUMNODESP1)
++	 */
++
++	/*Same thing in the actual coordinate system: */
++	IssmDouble dh1dh6[3][NUMNODESP1];
++
++	/*Get dh1dh2dh3 in actual coordinates system : */
++	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list,gauss);
++
++	/*Build B': */
++	for (int i=0;i<NUMNODESP1;i++){
++		*(Bprime_advec+NDOF1*NUMNODESP1*0+NDOF1*i)=dh1dh6[0][i]; 
++		*(Bprime_advec+NDOF1*NUMNODESP1*1+NDOF1*i)=dh1dh6[1][i]; 
++		*(Bprime_advec+NDOF1*NUMNODESP1*2+NDOF1*i)=dh1dh6[2][i]; 
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetBprimeVert{{{*/
++void PentaRef::GetBprimeVert(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss){
++	/* Compute Bprime  matrix. Bprime=[L1 L2 L3 L4 L5 L6] where Li is the nodal function for node i*/
++
++	GetNodalFunctionsP1(B, gauss);
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetL{{{*/
++void PentaRef::GetL(IssmDouble* L, GaussPenta* gauss, int numdof){
++	/*Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
++	 ** For node i, Li can be expressed in the actual coordinate system
++	 ** by: 
++	 **       numdof=1: 
++	 **                 Li=h;
++	 **       numdof=2:
++	 **                 Li=[ h   0 ]
++	 **                    [ 0   h ]
++	 ** where h is the interpolation function for node i.
++	 **
++	 ** We assume L has been allocated already, of size: NUMNODESP1 (numdof=1), or numdofx(numdof*NUMNODESP1) (numdof=2)
++	 **/
++
++	int i;
++	IssmDouble l1l6[6];
++
++	/*Get l1l6 in actual coordinate system: */
++	GetNodalFunctionsP1(l1l6,gauss);
++
++	/*Build L: */
++	if(numdof==1){
++		for (i=0;i<NUMNODESP1;i++){
++			L[i]=l1l6[i]; 
++		}
++	}
++	else{
++		for (i=0;i<NUMNODESP1;i++){
++			*(L+numdof*NUMNODESP1*0+numdof*i)=l1l6[i]; 
++			*(L+numdof*NUMNODESP1*0+numdof*i+1)=0;
++			*(L+numdof*NUMNODESP1*1+numdof*i)=0;
++			*(L+numdof*NUMNODESP1*1+numdof*i+1)=l1l6[i];
++		}
++	}
++} 
++/*}}}*/
++/*FUNCTION PentaRef::GetLStokes{{{*/
++void PentaRef::GetLStokes(IssmDouble* LStokes, GaussPenta* gauss){
++	/*
++	 * Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
++	 * For node i, Li can be expressed in the actual coordinate system
++	 * by: 
++	 *       Li=[ h 0 ]
++	 *	 	      [ 0 h ]
++	 *		      [ 0 0 ]
++	 *		      [ 0 0 ]
++	 * where h is the interpolation function for node i.
++	 */
++
++	const int num_dof=4;
++	IssmDouble l1l2l3[NUMNODESP1_2d];
++
++	/*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;
++
++	/*Build LStokes: */
++	for (int i=0;i<3;i++){
++		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+0)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0.;
++		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+2)=0.;
++		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+3)=0.;
++
++		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+0)=0.;
++		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+2)=0.;
++		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+3)=0.;
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetLprimeStokes {{{*/
++void PentaRef::GetLprimeStokes(IssmDouble* LprimeStokes, IssmDouble* xyz_list, GaussPenta* gauss){
++
++	/*
++	 * Compute Lprime  matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof. 
++	 * For node i, Lpi can be expressed in the actual coordinate system
++	 * by: 
++	 *       Lpi=[ h    0    0   0]1
++	 *		       [ 0    h    0   0]2
++	 *		       [ h    0    0   0]3
++	 *		       [ 0    h    0   0]4
++	 *		       [ 0    0    h   0]5
++	 *		       [ 0    0    h   0]6
++	 *		       [ 0    0  dh/dz 0]7
++	 *		       [ 0    0  dh/dz 0]8
++	 *		       [ 0    0  dh/dz 0]9
++	 *		       [dh/dz 0  dh/dx 0]0
++	 *		       [ 0 dh/dz dh/dy 0]1
++	 *           [ 0    0    0   h]2
++	 *           [ 0    0    0   h]3
++	 *           [ 0    0    0   h]4
++	 *
++	 *       Li=[ h    0    0   0]1
++	 *	 	      [ 0    h    0   0]2
++	 *		      [ 0    0    h   0]3
++	 *		      [ 0    0    h   0]4
++	 *	 	      [ h    0    0   0]5
++	 *	 	      [ 0    h    0   0]6
++	 *	 	      [ h    0    0   0]7
++	 *	 	      [ 0    h    0   0]8
++	 *		      [ 0    0    h   0]9
++	 *		      [ 0    0    h   0]0
++	 *		      [ 0    0    h   0]1
++	 *	 	      [ h    0    0   0]2
++	 *	 	      [ 0    h    0   0]3
++	 *		      [ 0    0    h   0]4
++	 * where h is the interpolation function for node i.
++	 */
++	int i;
++	int num_dof=4;
++
++	IssmDouble l1l2l3[NUMNODESP1_2d];
++	IssmDouble dh1dh6[3][NUMNODESP1];
++
++	/*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;
++
++	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list,gauss);
++
++	/*Build LprimeStokes: */
++	for (i=0;i<3;i++){
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i)=l1l2l3[i]; //LprimeStokes[0][NDOF2*i]=dh1dh3[0][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+1)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+2)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+2)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+2)=dh1dh6[2][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+2)=dh1dh6[2][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*8+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*8+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*8+num_dof*i+2)=dh1dh6[2][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*8+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*9+num_dof*i)=dh1dh6[2][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*9+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*9+num_dof*i+2)=dh1dh6[0][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*9+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*10+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*10+num_dof*i+1)=dh1dh6[2][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*10+num_dof*i+2)=dh1dh6[1][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*10+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*11+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*11+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*11+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*11+num_dof*i+3)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*12+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*12+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*12+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*12+num_dof*i+3)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*13+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*13+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*13+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*13+num_dof*i+3)=l1l2l3[i];
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetLMacAyealStokes {{{*/
++void PentaRef::GetLMacAyealStokes(IssmDouble* LStokes, GaussPenta* gauss){
++	/*
++	 * Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
++	 * For node i, Li can be expressed in the actual coordinate system
++	 * by: 
++	 *       Li=[ h    0 ]
++	 *	 	      [ 0    h ]
++	 *	 	      [ h    0 ]
++	 *	 	      [ 0    h ]
++	 *	 	      [ h    0 ]
++	 *	 	      [ 0    h ]
++	 *	 	      [ h    0 ]
++	 *	 	      [ 0    h ]
++	 * where h is the interpolation function for node i.
++	 */
++
++	int i;
++	int num_dof=2;
++
++	IssmDouble l1l2l3[NUMNODESP1_2d];
++
++
++	/*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;
++
++	/*Build LStokes: */
++	for (i=0;i<3;i++){
++		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i)=l1l2l3[i]; //LStokes[0][NDOF2*i]=dh1dh3[0][i];
++		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+1)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+1)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*4+num_dof*i)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+1)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*5+num_dof*i)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+1)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*6+num_dof*i)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+1)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*7+num_dof*i)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+1)=l1l2l3[i];
++
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetLprimeMacAyealStokes {{{*/
++void PentaRef::GetLprimeMacAyealStokes(IssmDouble* LprimeStokes, IssmDouble* xyz_list, GaussPenta* gauss){
++
++	/*
++	 * Compute Lprime  matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof. 
++	 * For node i, Lpi can be expressed in the actual coordinate system
++	 * by: 
++	 *       Lpi=[ h    0    0   0]
++	 *		       [ 0    h    0   0]
++	 *		       [ 0    0    h   0]
++	 *		       [ 0    0    h   0]
++	 *		       [ 0    0  dh/dz 0]
++	 *		       [ 0    0  dh/dz 0]
++	 *           [ 0    0    0   h]
++	 *           [ 0    0    0   h]
++	 * where h is the interpolation function for node i.
++	 */
++	int i;
++	int num_dof=4;
++
++	IssmDouble l1l2l3[NUMNODESP1_2d];
++	IssmDouble dh1dh6[3][NUMNODESP1];
++
++	/*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;
++
++	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list,gauss);
++
++	/*Build LprimeStokes: */
++	for (i=0;i<3;i++){
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i)=l1l2l3[i]; //LprimeStokes[0][NDOF2*i]=dh1dh3[0][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+2)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+2)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+2)=dh1dh6[2][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*4+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+2)=dh1dh6[2][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*5+num_dof*i+3)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*6+num_dof*i+3)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+2)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*7+num_dof*i+3)=l1l2l3[i];
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetLStokesMacAyeal {{{*/
++void PentaRef::GetLStokesMacAyeal(IssmDouble* LStokes, GaussPenta* gauss){
++	/*
++	 * Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
++	 * For node i, Li can be expressed in the actual coordinate system
++	 * by: 
++	 *       Li=[ h    0    0   0]
++	 *	 	      [ 0    h    0   0]
++	 *		      [ 0    0    h   0]
++	 *		      [ 0    0    h   0]
++	 * where h is the interpolation function for node i.
++	 */
++
++	int i;
++	int num_dof=4;
++
++	IssmDouble l1l2l3[NUMNODESP1_2d];
++
++
++	/*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;
++
++	/*Build LStokes: */
++	for (i=0;i<3;i++){
++		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i)=l1l2l3[i]; //LStokes[0][NDOF2*i]=dh1dh3[0][i];
++		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+2)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+3)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+2)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+3)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+1)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+2)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+3)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+1)=0;
++		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+2)=l1l2l3[i];
++		*(LStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+3)=0;
++
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetLprimeStokesMacAyeal {{{*/
++void PentaRef::GetLprimeStokesMacAyeal(IssmDouble* LprimeStokes, IssmDouble* xyz_list, GaussPenta* gauss){
++
++	/*
++	 * Compute Lprime  matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof. 
++	 * For node i, Lpi can be expressed in the actual coordinate system
++	 * by: 
++	 *       Lpi=[ h    0 ]
++	 *		       [ 0    h ]
++	 *		       [ h    0 ]
++	 *		       [ 0    h ]
++	 * where h is the interpolation function for node i.
++	 */
++	int i;
++	int num_dof=2;
++
++	IssmDouble l1l2l3[NUMNODESP1_2d];
++	IssmDouble dh1dh6[3][NUMNODESP1];
++
++	/*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;
++
++	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list,gauss);
++
++	/*Build LprimeStokes: */
++	for (i=0;i<3;i++){
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i)=l1l2l3[i]; //LprimeStokes[0][NDOF2*i]=dh1dh3[0][i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*0+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*1+num_dof*i+1)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i)=l1l2l3[i];
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*2+num_dof*i+1)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i)=0;
++		*(LprimeStokes+num_dof*NUMNODESP1_2d*3+num_dof*i+1)=l1l2l3[i];
++	}
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetJacobian {{{*/
++void PentaRef::GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussPenta* gauss){
++
++	int i,j;
++
++	/*The Jacobian is constant over the element, discard the gaussian points. 
++	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
++
++	IssmDouble A1,A2,A3; //area coordinates
++	IssmDouble xi,eta,zi; //parametric coordinates
++
++	IssmDouble x1,x2,x3,x4,x5,x6;
++	IssmDouble y1,y2,y3,y4,y5,y6;
++	IssmDouble z1,z2,z3,z4,z5,z6;
++
++	/*Figure out xi,eta and zi (parametric coordinates), for this gaussian point: */
++	A1=gauss->coord1;
++	A2=gauss->coord2;
++	A3=gauss->coord3;
++
++	xi=A2-A1;
++	eta=SQRT3*A3;
++	zi=gauss->coord4;
++
++	x1=*(xyz_list+3*0+0);
++	x2=*(xyz_list+3*1+0);
++	x3=*(xyz_list+3*2+0);
++	x4=*(xyz_list+3*3+0);
++	x5=*(xyz_list+3*4+0);
++	x6=*(xyz_list+3*5+0);
++
++	y1=*(xyz_list+3*0+1);
++	y2=*(xyz_list+3*1+1);
++	y3=*(xyz_list+3*2+1);
++	y4=*(xyz_list+3*3+1);
++	y5=*(xyz_list+3*4+1);
++	y6=*(xyz_list+3*5+1);
++
++	z1=*(xyz_list+3*0+2);
++	z2=*(xyz_list+3*1+2);
++	z3=*(xyz_list+3*2+2);
++	z4=*(xyz_list+3*3+2);
++	z5=*(xyz_list+3*4+2);
++	z6=*(xyz_list+3*5+2);
++
++	*(J+NDOF3*0+0)=0.25*(x1-x2-x4+x5)*zi+0.25*(-x1+x2-x4+x5);
++	*(J+NDOF3*1+0)=SQRT3/12.0*(x1+x2-2*x3-x4-x5+2*x6)*zi+SQRT3/12.0*(-x1-x2+2*x3-x4-x5+2*x6);
++	*(J+NDOF3*2+0)=SQRT3/12.0*(x1+x2-2*x3-x4-x5+2*x6)*eta+1/4*(x1-x2-x4+x5)*xi +0.25*(-x1+x5-x2+x4);
++
++	*(J+NDOF3*0+1)=0.25*(y1-y2-y4+y5)*zi+0.25*(-y1+y2-y4+y5);
++	*(J+NDOF3*1+1)=SQRT3/12.0*(y1+y2-2*y3-y4-y5+2*y6)*zi+SQRT3/12.0*(-y1-y2+2*y3-y4-y5+2*y6);
++	*(J+NDOF3*2+1)=SQRT3/12.0*(y1+y2-2*y3-y4-y5+2*y6)*eta+0.25*(y1-y2-y4+y5)*xi+0.25*(y4-y1+y5-y2);
++
++	*(J+NDOF3*0+2)=0.25*(z1-z2-z4+z5)*zi+0.25*(-z1+z2-z4+z5);
++	*(J+NDOF3*1+2)=SQRT3/12.0*(z1+z2-2*z3-z4-z5+2*z6)*zi+SQRT3/12.0*(-z1-z2+2*z3-z4-z5+2*z6);
++	*(J+NDOF3*2+2)=SQRT3/12.0*(z1+z2-2*z3-z4-z5+2*z6)*eta+0.25*(z1-z2-z4+z5)*xi+0.25*(-z1+z5-z2+z4);
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetJacobianDeterminant {{{*/
++void PentaRef::GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss){
++	/*On a penta, Jacobian varies according to coordinates. We need to get the Jacobian, and take 
++	 * the determinant of it: */
++	IssmDouble J[3][3];
++
++	/*Get Jacobian*/
++	GetJacobian(&J[0][0],xyz_list,gauss);
++
++	/*Get Determinant*/
++	Matrix3x3Determinant(Jdet,&J[0][0]);
++	if(*Jdet<0) _error2_("negative jacobian determinant!");
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetTriaJacobianDeterminant{{{*/
++void PentaRef::GetTriaJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss){
++	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
++	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
++
++	IssmDouble x1,x2,x3,y1,y2,y3,z1,z2,z3;
++
++	x1=*(xyz_list+3*0+0);
++	y1=*(xyz_list+3*0+1);
++	z1=*(xyz_list+3*0+2);
++	x2=*(xyz_list+3*1+0);
++	y2=*(xyz_list+3*1+1);
++	z2=*(xyz_list+3*1+2);
++	x3=*(xyz_list+3*2+0);
++	y3=*(xyz_list+3*2+1);
++	z3=*(xyz_list+3*2+2);
++
++	/*Jdet = norm( AB ^ AC ) / (2 * area of the reference triangle), with areaRef=sqrt(3) */
++	*Jdet=SQRT3/6.0*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2.0)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2.0)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2.0),0.5);
++	if(*Jdet<0) _error2_("negative jacobian determinant!");
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetSegmentJacobianDeterminant{{{*/
++void PentaRef::GetSegmentJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss){
++	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
++	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
++
++	IssmDouble x1,x2,y1,y2,z1,z2;
++
++	x1=*(xyz_list+3*0+0);
++	y1=*(xyz_list+3*0+1);
++	z1=*(xyz_list+3*0+2);
++	x2=*(xyz_list+3*1+0);
++	y2=*(xyz_list+3*1+1);
++	z2=*(xyz_list+3*1+2);
++
++	*Jdet=1.0/2.0*sqrt(pow(x2-x1,2.) + pow(y2-y1,2.) + pow(z2-z1,2.));
++	if(*Jdet<0) _error2_("negative jacobian determinant!");
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetJacobianInvert {{{*/
++void PentaRef::GetJacobianInvert(IssmDouble* Jinv, IssmDouble* xyz_list,GaussPenta* gauss){
++
++	/*Jacobian*/
++	IssmDouble J[3][3];
++
++	/*Call Jacobian routine to get the jacobian:*/
++	GetJacobian(&J[0][0], xyz_list, gauss);
++
++	/*Invert Jacobian matrix: */
++	Matrix3x3Invert(Jinv,&J[0][0]);
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetNodalFunctionsMINI{{{*/
++void PentaRef::GetNodalFunctionsMINI(IssmDouble* l1l7, GaussPenta* gauss){
++	/*This routine returns the values of the nodal functions  at the gaussian point.*/
++
++	l1l7[0]=gauss->coord1*(1.0-gauss->coord4)/2.0;
++	l1l7[1]=gauss->coord2*(1.0-gauss->coord4)/2.0;
++	l1l7[2]=gauss->coord3*(1.0-gauss->coord4)/2.0;
++	l1l7[3]=gauss->coord1*(1.0+gauss->coord4)/2.0;
++	l1l7[4]=gauss->coord2*(1.0+gauss->coord4)/2.0;
++	l1l7[5]=gauss->coord3*(1.0+gauss->coord4)/2.0;
++	l1l7[6]=27*gauss->coord1*gauss->coord2*gauss->coord3*(1.0+gauss->coord4)*(1.0-gauss->coord4);
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetNodalFunctionsMINIDerivatives{{{*/
++void PentaRef::GetNodalFunctionsMINIDerivatives(IssmDouble* dh1dh7,IssmDouble* xyz_list, GaussPenta* gauss){
++
++	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
++	 * actual coordinate system): */
++
++	int       i;
++	IssmDouble    dh1dh7_ref[3][NUMNODESMINI];
++	IssmDouble    Jinv[3][3];
++
++	/*Get derivative values with respect to parametric coordinate system: */
++	GetNodalFunctionsMINIDerivativesReference(&dh1dh7_ref[0][0], gauss); 
++
++	/*Get Jacobian invert: */
++	GetJacobianInvert(&Jinv[0][0], xyz_list, gauss);
++
++	/*Build dh1dh6: 
++	 *
++	 * [dhi/dx]= Jinv'*[dhi/dr]
++	 * [dhi/dy]        [dhi/ds]
++	 * [dhi/dz]        [dhi/dzeta]
++	 */
++
++	for (i=0;i<NUMNODESMINI;i++){
++		*(dh1dh7+NUMNODESMINI*0+i)=Jinv[0][0]*dh1dh7_ref[0][i]+Jinv[0][1]*dh1dh7_ref[1][i]+Jinv[0][2]*dh1dh7_ref[2][i];
++		*(dh1dh7+NUMNODESMINI*1+i)=Jinv[1][0]*dh1dh7_ref[0][i]+Jinv[1][1]*dh1dh7_ref[1][i]+Jinv[1][2]*dh1dh7_ref[2][i];
++		*(dh1dh7+NUMNODESMINI*2+i)=Jinv[2][0]*dh1dh7_ref[0][i]+Jinv[2][1]*dh1dh7_ref[1][i]+Jinv[2][2]*dh1dh7_ref[2][i];
++	}
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetNodalFunctionsMINIDerivativesReference{{{*/
++void PentaRef::GetNodalFunctionsMINIDerivativesReference(IssmDouble* dl1dl7,GaussPenta* gauss){
++
++	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
++	 * natural coordinate system) at the gaussian point. */
++	IssmDouble r=gauss->coord2-gauss->coord1;
++	IssmDouble s=-3.0/SQRT3*(gauss->coord1+gauss->coord2-2.0/3.0);
++	IssmDouble zeta=gauss->coord4;
++
++	/*First nodal function: */
++	*(dl1dl7+NUMNODESMINI*0+0)=-0.5*(1.0-zeta)/2.0;
++	*(dl1dl7+NUMNODESMINI*1+0)=-SQRT3/6.0*(1.0-zeta)/2.0;
++	*(dl1dl7+NUMNODESMINI*2+0)=-0.5*(-0.5*r-SQRT3/6.0*s+ONETHIRD);
++
++	/*Second nodal function: */
++	*(dl1dl7+NUMNODESMINI*0+1)=0.5*(1.0-zeta)/2.0;
++	*(dl1dl7+NUMNODESMINI*1+1)=-SQRT3/6.0*(1.0-zeta)/2.0;
++	*(dl1dl7+NUMNODESMINI*2+1)=-0.5*(0.5*r-SQRT3/6.0*s+ONETHIRD);
++
++	/*Third nodal function: */
++	*(dl1dl7+NUMNODESMINI*0+2)=0;
++	*(dl1dl7+NUMNODESMINI*1+2)=SQRT3/3.0*(1.0-zeta)/2.0;
++	*(dl1dl7+NUMNODESMINI*2+2)=-0.5*(SQRT3/3.0*s+ONETHIRD);
++
++	/*Fourth nodal function: */
++	*(dl1dl7+NUMNODESMINI*0+3)=-0.5*(1.0+zeta)/2.0;
++	*(dl1dl7+NUMNODESMINI*1+3)=-SQRT3/6.0*(1.0+zeta)/2.0;
++	*(dl1dl7+NUMNODESMINI*2+3)=0.5*(-0.5*r-SQRT3/6.0*s+ONETHIRD);
++
++	/*Fith nodal function: */
++	*(dl1dl7+NUMNODESMINI*0+4)=0.5*(1.0+zeta)/2.0;
++	*(dl1dl7+NUMNODESMINI*1+4)=-SQRT3/6.0*(1.0+zeta)/2.0;
++	*(dl1dl7+NUMNODESMINI*2+4)=0.5*(0.5*r-SQRT3/6.0*s+ONETHIRD);
++
++	/*Sixth nodal function: */
++	*(dl1dl7+NUMNODESMINI*0+5)=0;
++	*(dl1dl7+NUMNODESMINI*1+5)=SQRT3/3.0*(1.0+zeta)/2.0;
++	*(dl1dl7+NUMNODESMINI*2+5)=0.5*(SQRT3/3.0*s+ONETHIRD);
++
++	/*Seventh nodal function: */
++	*(dl1dl7+NUMNODESMINI*0+6)=9.0/2.0*r*(1.0+zeta)*(zeta-1.0)*(SQRT3*s+1.0);
++	*(dl1dl7+NUMNODESMINI*1+6)=9.0/4.0*(1+zeta)*(1-zeta)*(SQRT3*pow(s,2.0)-2.0*s-SQRT3*pow(r,2.0));
++	*(dl1dl7+NUMNODESMINI*2+6)=27*gauss->coord1*gauss->coord2*gauss->coord3*(-2.0*zeta);
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetNodalFunctionsP1 {{{*/
++void PentaRef::GetNodalFunctionsP1(IssmDouble* l1l6, GaussPenta* gauss){
++	/*This routine returns the values of the nodal functions  at the gaussian point.*/
++
++	l1l6[0]=gauss->coord1*(1-gauss->coord4)/2.0;
++	l1l6[1]=gauss->coord2*(1-gauss->coord4)/2.0;
++	l1l6[2]=gauss->coord3*(1-gauss->coord4)/2.0;
++	l1l6[3]=gauss->coord1*(1+gauss->coord4)/2.0;
++	l1l6[4]=gauss->coord2*(1+gauss->coord4)/2.0;
++	l1l6[5]=gauss->coord3*(1+gauss->coord4)/2.0;
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetNodalFunctionsP1Derivatives {{{*/
++void PentaRef::GetNodalFunctionsP1Derivatives(IssmDouble* dh1dh6,IssmDouble* xyz_list, GaussPenta* gauss){
++
++	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
++	 * actual coordinate system): */
++	IssmDouble    dh1dh6_ref[NDOF3][NUMNODESP1];
++	IssmDouble    Jinv[NDOF3][NDOF3];
++
++	/*Get derivative values with respect to parametric coordinate system: */
++	GetNodalFunctionsP1DerivativesReference(&dh1dh6_ref[0][0], gauss); 
++
++	/*Get Jacobian invert: */
++	GetJacobianInvert(&Jinv[0][0], xyz_list, gauss);
++
++	/*Build dh1dh3: 
++	 *
++	 * [dhi/dx]= Jinv*[dhi/dr]
++	 * [dhi/dy]       [dhi/ds]
++	 * [dhi/dz]       [dhi/dn]
++	 */
++
++	for (int i=0;i<NUMNODESP1;i++){
++		*(dh1dh6+NUMNODESP1*0+i)=Jinv[0][0]*dh1dh6_ref[0][i]+Jinv[0][1]*dh1dh6_ref[1][i]+Jinv[0][2]*dh1dh6_ref[2][i];
++		*(dh1dh6+NUMNODESP1*1+i)=Jinv[1][0]*dh1dh6_ref[0][i]+Jinv[1][1]*dh1dh6_ref[1][i]+Jinv[1][2]*dh1dh6_ref[2][i];
++		*(dh1dh6+NUMNODESP1*2+i)=Jinv[2][0]*dh1dh6_ref[0][i]+Jinv[2][1]*dh1dh6_ref[1][i]+Jinv[2][2]*dh1dh6_ref[2][i];
++	}
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetNodalFunctionsP1DerivativesReference {{{*/
++void PentaRef::GetNodalFunctionsP1DerivativesReference(IssmDouble* dl1dl6,GaussPenta* gauss){
++
++	/*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 */
++
++	IssmDouble A1,A2,A3,z;
++
++	A1=gauss->coord1; _assert_(A1>=0 && A1<=1);//first area coordinate value. In term of xi and eta: A1=(1-xi)/2-eta/(2*SQRT3);
++	A2=gauss->coord2; _assert_(A2>=0 && A2<=1);//second area coordinate value In term of xi and eta: A2=(1+xi)/2-eta/(2*SQRT3);
++	A3=gauss->coord3; _assert_(A3>=0 && A3<=1);//third area coordinate value  In term of xi and eta: A3=y/SQRT3;
++	z =gauss->coord4; _assert_(z>=-1 &&  z<=1);//fourth vertical coordinate value. Corresponding nodal function: (1-z)/2 and (1+z)/2
++
++	/*First nodal function derivatives. The corresponding nodal function is N=A1*(1-z)/2. Its derivatives follow*/
++	*(dl1dl6+NUMNODESP1*0+0)=-0.5*(1.0-z)/2.0;
++	*(dl1dl6+NUMNODESP1*1+0)=-0.5/SQRT3*(1.0-z)/2.0;
++	*(dl1dl6+NUMNODESP1*2+0)=-0.5*A1;
++
++	/*Second nodal function: The corresponding nodal function is N=A2*(1-z)/2. Its derivatives follow*/
++	*(dl1dl6+NUMNODESP1*0+1)=0.5*(1.0-z)/2.0;
++	*(dl1dl6+NUMNODESP1*1+1)=-0.5/SQRT3*(1.0-z)/2.0;
++	*(dl1dl6+NUMNODESP1*2+1)=-0.5*A2;
++
++	/*Third nodal function: The corresponding nodal function is N=A3*(1-z)/2. Its derivatives follow*/
++	*(dl1dl6+NUMNODESP1*0+2)=0.0;
++	*(dl1dl6+NUMNODESP1*1+2)=1.0/SQRT3*(1.0-z)/2.0;
++	*(dl1dl6+NUMNODESP1*2+2)=-0.5*A3;
++
++	/*Fourth nodal function: The corresponding nodal function is N=A1*(1+z)/2. Its derivatives follow*/
++	*(dl1dl6+NUMNODESP1*0+3)=-0.5*(1.0+z)/2.0;
++	*(dl1dl6+NUMNODESP1*1+3)=-0.5/SQRT3*(1.0+z)/2.0;
++	*(dl1dl6+NUMNODESP1*2+3)=0.5*A1;
++
++	/*Fifth nodal function: The corresponding nodal function is N=A2*(1+z)/2. Its derivatives follow*/
++	*(dl1dl6+NUMNODESP1*0+4)=0.5*(1.0+z)/2.0;
++	*(dl1dl6+NUMNODESP1*1+4)=-0.5/SQRT3*(1.0+z)/2.0;
++	*(dl1dl6+NUMNODESP1*2+4)=0.5*A2;
++
++	/*Sixth nodal function: The corresponding nodal function is N=A3*(1+z)/2. Its derivatives follow*/
++	*(dl1dl6+NUMNODESP1*0+5)=0.0;
++	*(dl1dl6+NUMNODESP1*1+5)=1.0/SQRT3*(1.0+z)/2.0;
++	*(dl1dl6+NUMNODESP1*2+5)=0.5*A3;
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetQuadNodalFunctions {{{*/
++void PentaRef::GetQuadNodalFunctions(IssmDouble* l1l4,GaussPenta* gauss,int index1,int index2,int index3,int index4){
++	/*This routine returns the values of the nodal functions  at the gaussian point.*/
++
++	IssmDouble BasisFunctions[6];
++
++	GetNodalFunctionsP1(&BasisFunctions[0],gauss);
++
++	_assert_(index1>=0 && index1<6);
++	_assert_(index2>=0 && index2<6);
++	_assert_(index3>=0 && index3<6);
++	_assert_(index4>=0 && index4<6);
++
++	l1l4[0]=BasisFunctions[index1];
++	l1l4[1]=BasisFunctions[index2];
++	l1l4[2]=BasisFunctions[index3];
++	l1l4[3]=BasisFunctions[index4];
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetQuadJacobianDeterminant{{{*/
++void PentaRef::GetQuadJacobianDeterminant(IssmDouble* Jdet,IssmDouble xyz_list[4][3],GaussPenta* gauss){
++	/*This routine returns the values of the nodal functions  at the gaussian point.*/
++
++	IssmDouble x1,x2,x3,x4,y1,y2,y3,y4,z1,z2,z3,z4;
++
++	x1=xyz_list[0][0];
++	y1=xyz_list[0][1];
++	z1=xyz_list[0][2];
++	x2=xyz_list[1][0];
++	y2=xyz_list[1][1];
++	z2=xyz_list[1][2];
++	x3=xyz_list[2][0];
++	y3=xyz_list[2][1];
++	z3=xyz_list[2][2];
++	x4=xyz_list[3][0];
++	y4=xyz_list[3][1];
++	z4=xyz_list[3][2];
++
++	/*Jdet = (Area of the trapezoid)/(Area trapezoid ref) with AreaRef = 4*/
++	/*Area of a trabezoid = altitude * (base1 + base2)/2 */
++	*Jdet= pow(pow(x2-x1,2.) + pow(y2-y1,2.),0.5) * (z4-z1 + z3-z2)/8;
++	if(*Jdet<0) _error2_("negative jacobian determinant!");
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetInputValue{{{*/
++void PentaRef::GetInputValue(IssmDouble* pvalue,IssmDouble* plist,GaussPenta* gauss){
++	/*P1 interpolation on Gauss point*/
++
++	/*intermediary*/
++	IssmDouble l1l6[6];
++
++	/*nodal functions: */
++	GetNodalFunctionsP1(&l1l6[0],gauss);
++
++	/*Assign output pointers:*/
++	*pvalue=l1l6[0]*plist[0]+l1l6[1]*plist[1]+l1l6[2]*plist[2]+l1l6[3]*plist[3]+l1l6[4]*plist[4]+l1l6[5]*plist[5];
++
++}
++/*}}}*/
++/*FUNCTION PentaRef::GetInputDerivativeValue{{{*/
++void PentaRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussPenta* gauss){
++	/*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:
++	 *   dp/dx=p_list[0]*dh1/dx+p_list[1]*dh2/dx+p_list[2]*dh3/dx+p_list[3]*dh4/dx+p_list[4]*dh5/dx+p_list[5]*dh6/dx;
++	 *   dp/dy=p_list[0]*dh1/dy+p_list[1]*dh2/dy+p_list[2]*dh3/dy+p_list[3]*dh4/dy+p_list[4]*dh5/dy+p_list[5]*dh6/dy;
++	 *   dp/dz=p_list[0]*dh1/dz+p_list[1]*dh2/dz+p_list[2]*dh3/dz+p_list[3]*dh4/dz+p_list[4]*dh5/dz+p_list[5]*dh6/dz;
++	 *
++	 *   p is a vector of size 3x1 already allocated.
++	 */
++	IssmDouble dh1dh6[3][NUMNODESP1];
++
++	/*Get nodal funnctions derivatives in actual coordinate system: */
++	GetNodalFunctionsP1Derivatives(&dh1dh6[0][0],xyz_list, gauss);
++
++	/*Assign output*/
++	p[0]=plist[0]*dh1dh6[0][0]+plist[1]*dh1dh6[0][1]+plist[2]*dh1dh6[0][2]+plist[3]*dh1dh6[0][3]+plist[4]*dh1dh6[0][4]+plist[5]*dh1dh6[0][5];
++	p[1]=plist[0]*dh1dh6[1][0]+plist[1]*dh1dh6[1][1]+plist[2]*dh1dh6[1][2]+plist[3]*dh1dh6[1][3]+plist[4]*dh1dh6[1][4]+plist[5]*dh1dh6[1][5];
++	p[2]=plist[0]*dh1dh6[2][0]+plist[1]*dh1dh6[2][1]+plist[2]*dh1dh6[2][2]+plist[3]*dh1dh6[2][3]+plist[4]*dh1dh6[2][4]+plist[5]*dh1dh6[2][5];
++
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 12822)
+@@ -0,0 +1,239 @@
++/*! \file Tria.h 
++ *  \brief: header file for tria object
++ */
++
++#ifndef _TRIA_H_
++#define _TRIA_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Element.h"
++#include "./TriaHook.h"
++#include "./TriaRef.h"
++class Parameters;
++class Inputs;
++class IoModel;
++class Node;
++class Matice;
++class Matpar;
++class ElementMatrix;
++class ElementVector;
++
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++/*}}}*/
++
++class Tria: public Element,public TriaHook,public TriaRef{
++
++	public:
++
++		int  id;
++		int  sid;
++
++		Node   **nodes;    // 3 nodes
++		Matice  *matice;   // 1 material ice
++		Matpar  *matpar;   // 1 material parameter
++		int      horizontalneighborsids[3];
++
++		Parameters *parameters;   //pointer to solution parameters
++		Inputs     *inputs;
++		Results    *results;
++
++		/*Tria constructors, destructors {{{*/
++		Tria();
++		Tria(int tria_id,int tria_sid,int i, IoModel* iomodel,int nummodels);
++		~Tria();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Update virtual functions resolution: {{{*/
++		void  InputUpdateFromSolution(IssmDouble* solutiong);
++		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVector(int* vector, int name, int type);
++		void  InputUpdateFromVector(bool* vector, int name, int type);
++		#ifdef _HAVE_DAKOTA_
++		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
++		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nows, int ncols, int name, int type);
++		#endif
++		void  InputUpdateFromConstant(IssmDouble constant, int name);
++		void  InputUpdateFromConstant(int constant, int name);
++		void  InputUpdateFromConstant(bool constant, int name);
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel);
++		/*}}}*/
++		/*Element virtual functions definitions: {{{*/
++		void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
++		void   ComputeBasalStress(Vector* sigma_b);
++		void   ComputeStrainRate(Vector* eps);
++		void   ComputeStressTensor();
++		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
++		void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
++		void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
++		void   CreatePVector(Vector* pf);
++		void   CreateJacobianMatrix(Matrix* Jff);
++		void   Delta18oParameterization(void);
++		int    GetNodeIndex(Node* node);
++		int    Sid();
++		bool   IsOnBed();
++		bool   IsFloating(); 
++		bool   IsNodeOnShelf(); 
++		bool   IsNodeOnShelfFromFlags(IssmDouble* flags);
++		bool   IsOnWater(); 
++		void   GetSolutionFromInputs(Vector* solution);
++		void   GetVectorFromInputs(Vector* vector, int name_enum);
++		void   GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp);
++		void   InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max);
++		bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums);
++		void   InputCreate(IssmDouble scalar,int name,int code);
++		void   InputCreate(IssmDouble* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code);
++		void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum=MeshElementsEnum);
++		void   InputDuplicate(int original_enum,int new_enum);
++		void   InputScale(int enum_type,IssmDouble scale_factor);
++		void   InputToResult(int enum_type,int step,IssmDouble time);
++		void   DeleteResults(void);
++		void   MaterialUpdateFromTemperature(void){_error2_("not implemented yet");};
++		void   MigrateGroundingLine(IssmDouble* oldfloating,IssmDouble* sheet_ungrounding);
++		int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
++		void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
++		void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm);
++		void   RequestedOutput(int output_enum,int step,IssmDouble time);
++		void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results);
++		void   PatchFill(int* pcount, Patch* patch);
++		void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
++		void   ProcessResultsUnits(void);
++		void   ResetCoordinateSystem(void){_error2_("not implemented yet");};
++		void	 SmbGradients();
++		IssmDouble SurfaceArea(void);
++		void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
++		int    UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
++		IssmDouble TimeAdapt();
++		int*   GetHorizontalNeighboorSids(void);
++		void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
++
++		#ifdef _HAVE_RESPONSES_
++		IssmDouble IceVolume(void);
++		IssmDouble TotalSmb(void);
++		void   MinVel(IssmDouble* pminvel, bool process_units);
++		void   MinVx(IssmDouble* pminvx, bool process_units);
++		void   MinVy(IssmDouble* pminvy, bool process_units);
++		void   MinVz(IssmDouble* pminvz, bool process_units);
++		IssmDouble MassFlux(IssmDouble* segment,bool process_units);
++		void   MaxAbsVx(IssmDouble* pmaxabsvx, bool process_units);
++		void   MaxAbsVy(IssmDouble* pmaxabsvy, bool process_units);
++		void   MaxAbsVz(IssmDouble* pmaxabsvz, bool process_units);
++		void   ElementResponse(IssmDouble* presponse,int response_enum,bool process_units);
++		void   MaxVel(IssmDouble* pmaxvel, bool process_units);
++		void   MaxVx(IssmDouble* pmaxvx, bool process_units);
++		void   MaxVy(IssmDouble* pmaxvy, bool process_units);
++		void   MaxVz(IssmDouble* pmaxvz, bool process_units);
++		#endif
++
++
++		#ifdef _HAVE_CONTROL_
++		IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index);
++		void   GradientIndexing(int* indexing,int control_index);
++		void   Gradj(Vector* gradient,int control_type,int control_index);
++		void   GradjBGradient(Vector* gradient,int weight_index,int control_index);
++		void   GradjBMacAyeal(Vector* gradient,int control_index);
++		void   GradjDragMacAyeal(Vector* gradient,int control_index);
++		void   GradjDragStokes(Vector* gradient,int control_index);
++		void   GradjDragGradient(Vector* gradient,int weight_index,int control_index);
++		void   GradjDhDtBalancedthickness(Vector* gradient,int control_index);
++		void   GradjVxBalancedthickness(Vector* gradient,int control_index);
++		void   GradjVyBalancedthickness(Vector* gradient,int control_index);
++		void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
++		void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
++		void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index);
++		void   ControlInputScaleGradient(int enum_type,IssmDouble scale);
++		void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
++		IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index);
++		IssmDouble ThicknessAbsMisfit(     bool process_units,int weight_index);
++		IssmDouble SurfaceAbsVelMisfit(    bool process_units,int weight_index);
++		IssmDouble ThicknessAbsGradient(bool process_units,int weight_index);
++		IssmDouble SurfaceRelVelMisfit(    bool process_units,int weight_index);
++		IssmDouble SurfaceLogVelMisfit(    bool process_units,int weight_index);
++		IssmDouble SurfaceLogVxVyMisfit(   bool process_units,int weight_index);
++		IssmDouble SurfaceAverageVelMisfit(bool process_units,int weight_index);
++		void   InputControlUpdate(IssmDouble scalar,bool save_parameter);
++		#endif
++
++		/*}}}*/
++		/*Tria specific routines:{{{*/
++		ElementMatrix* CreateKMatrixBalancethickness(void);
++		ElementMatrix* CreateKMatrixBalancethickness_DG(void);
++		ElementMatrix* CreateKMatrixBalancethickness_CG(void);
++		ElementMatrix* CreateKMatrixMelting(void);
++		ElementMatrix* CreateKMatrixPrognostic(void);
++		ElementMatrix* CreateKMatrixPrognostic_CG(void);
++		ElementMatrix* CreateKMatrixPrognostic_DG(void);
++		ElementMatrix* CreateKMatrixSlope(void);
++		ElementVector* CreatePVectorBalancethickness(void);
++		ElementVector* CreatePVectorBalancethickness_DG(void);
++		ElementVector* CreatePVectorBalancethickness_CG(void);
++		ElementVector* CreatePVectorPrognostic(void);
++		ElementVector* CreatePVectorPrognostic_CG(void);
++		ElementVector* CreatePVectorPrognostic_DG(void);
++		ElementVector* CreatePVectorSlope(void);
++		IssmDouble         GetArea(void);
++		int            GetElementType(void);
++		void	         GetDofList(int** pdoflist,int approximation_enum,int setenum);
++		void	         GetDofList1(int* doflist);
++		void           GetSidList(int* sidlist);
++		void           GetConnectivityList(int* connectivity);
++		void           GetInputListOnVertices(IssmDouble* pvalue,int enumtype);
++		void           GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue);
++		void           GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue,int index); //TO BE REMOVED
++		void           GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
++		void           GetStrainRate2d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input);
++		void	         InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type);
++		void	         InputUpdateFromSolutionPrognostic(IssmDouble* solution);
++		bool	         IsInput(int name);
++		void	         SetClone(int* minranks);
++		void	         SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]);
++		
++		#ifdef _HAVE_DIAGNOSTIC_
++		ElementMatrix* CreateKMatrixDiagnosticMacAyeal(void);
++		ElementMatrix* CreateKMatrixDiagnosticMacAyealViscous(void);
++		ElementMatrix* CreateKMatrixDiagnosticMacAyealFriction(void);
++		ElementMatrix* CreateKMatrixDiagnosticHutter(void);
++		ElementVector* CreatePVectorDiagnosticMacAyeal(void);
++		ElementVector* CreatePVectorDiagnosticHutter(void);
++		ElementMatrix* CreateJacobianDiagnosticMacayeal(void);
++		void	  GetSolutionFromInputsDiagnosticHoriz(Vector* solution);
++		void	  GetSolutionFromInputsDiagnosticHutter(Vector* solution);
++		void	  InputUpdateFromSolutionDiagnosticHoriz( IssmDouble* solution);
++		void	  InputUpdateFromSolutionDiagnosticHutter( IssmDouble* solution);
++		#endif
++
++		#ifdef _HAVE_CONTROL_
++		ElementMatrix* CreateKMatrixAdjointBalancethickness(void);
++		ElementMatrix* CreateKMatrixAdjointMacAyeal(void);
++		ElementVector* CreatePVectorAdjointHoriz(void);
++		ElementVector* CreatePVectorAdjointStokes(void);
++		ElementVector* CreatePVectorAdjointBalancethickness(void);
++		void	  InputUpdateFromSolutionAdjointBalancethickness( IssmDouble* solution);
++		void	  InputUpdateFromSolutionAdjointHoriz( IssmDouble* solution);
++		#endif
++
++		#ifdef _HAVE_HYDROLOGY_
++		ElementMatrix* CreateKMatrixHydrology(void);
++		ElementVector* CreatePVectorHydrology(void);
++		void      CreateHydrologyWaterVelocityInput(void);
++		void	  GetSolutionFromInputsHydrology(Vector* solution);
++		void	  InputUpdateFromSolutionHydrology(IssmDouble* solution);
++		#endif
++		#ifdef _HAVE_BALANCED_
++		#endif
++
++		/*}}}*/
++
++};
++#endif  /* _TRIA_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h	(revision 12822)
+@@ -0,0 +1,31 @@
++/*!\file: TriaHook.h
++ * \brief prototypes for TriaHook.h
++ */ 
++
++#ifndef _TRIAHOOK_H_
++#define  _TRIAHOOK_H_
++
++class Hook;
++class IoModel;
++
++class TriaHook{
++
++	public: 
++		int    numanalyses; //number of analysis types
++		Hook** hnodes; // 3 nodes for each analysis type
++		Hook*  hmatice; // 1 ice material
++		Hook*  hmatpar; // 1 material parameter
++
++
++		/*FUNCTION constructors, destructors {{{*/
++		TriaHook();
++		TriaHook(int in_numanalyses,int matice_id, IoModel* iomodel);
++		~TriaHook();
++		void SetHookNodes(int* node_ids,int analysis_counter);
++		/*}}}*/
++
++};
++
++
++#endif //ifndef _TRIAHOOK_H_
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12822)
+@@ -0,0 +1,8784 @@
++/*!\file Penta.cpp
++ * \brief: implementation of the Penta object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../Container/Container.h"
++/*}}}*/
++
++/*Element macros*/
++#define NUMVERTICES   6
++#define NUMVERTICES2D 3
++
++/*Constructors/destructor/copy*/
++/*FUNCTION Penta::Penta(){{{*/
++Penta::Penta(){
++
++	int i;
++
++	this->nodes=NULL;
++	this->matice=NULL;
++	this->matpar=NULL;
++	this->verticalneighbors=NULL;
++	this->inputs=NULL;
++	this->parameters=NULL;
++	this->results=NULL;
++	for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
++}
++/*}}}*/
++/*FUNCTION Penta::~Penta(){{{*/
++Penta::~Penta(){
++	delete inputs;
++	delete results;
++	this->parameters=NULL;
++}
++/*}}}*/
++/*FUNCTION Penta::Penta(int id, int index, IoModel* iomodel,int nummodels) {{{*/
++Penta::Penta(int penta_id, int penta_sid, int index, IoModel* iomodel,int nummodels)
++	:PentaRef(nummodels)
++	,PentaHook(nummodels,index+1,iomodel) //index+1: matice id, iomodel->numberofelements+1: matpar id
++                                                                      { //i is the element index
++
++	int i;
++	int penta_elements_ids[2];
++
++	/*Checks in debugging mode*/
++	/*{{{*/
++	_assert_(iomodel->Data(MeshUpperelementsEnum));
++	_assert_(iomodel->Data(MeshLowerelementsEnum));
++	/*}}}*/
++
++	/*id: */
++	this->id=penta_id;
++	this->sid=penta_sid;
++
++	/*Build neighbors list*/
++	if (xIsNan<IssmDouble>(iomodel->Data(MeshUpperelementsEnum)[index])) penta_elements_ids[1]=this->id; //upper penta is the same penta
++	else                                    penta_elements_ids[1]=(int)(iomodel->Data(MeshUpperelementsEnum)[index]);
++	if (xIsNan<IssmDouble>(iomodel->Data(MeshLowerelementsEnum)[index])) penta_elements_ids[0]=this->id; //lower penta is the same penta
++	else                                    penta_elements_ids[0]=(int)(iomodel->Data(MeshLowerelementsEnum)[index]);
++	this->InitHookNeighbors(penta_elements_ids);
++
++	/*Build horizontalneighborsids list: */
++	_assert_(iomodel->Data(MeshElementconnectivityEnum));
++	for(i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->Data(MeshElementconnectivityEnum)[3*index+i]-1;
++
++	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
++	this->parameters=NULL;
++
++	/*intialize inputs and results: */
++	this->inputs=new Inputs();
++	this->results=new Results();
++	
++	/*initialize pointers:*/
++	this->nodes=NULL;
++	this->matice=NULL;
++	this->matpar=NULL;
++	this->verticalneighbors=NULL;
++}
++/*}}}*/
++/*FUNCTION Penta::copy {{{*/
++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];
++
++	//deal with PentaHook mother class
++	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->hmatice=(Hook*)this->hmatice->copy();
++	penta->hmatpar=(Hook*)this->hmatpar->copy();
++	penta->hneighbors=(Hook*)this->hneighbors->copy();
++
++	/*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();
++	}
++	if(this->results){
++		penta->results=(Results*)this->results->Copy();
++	}
++	else{
++		penta->results=new Results();
++	}
++	/*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->matice=(Matice*)penta->hmatice->delivers();
++	penta->matpar=(Matpar*)penta->hmatpar->delivers();
++	penta->verticalneighbors=(Penta**)penta->hneighbors->deliverp();
++
++	/*neighbors: */
++	for(i=0;i<3;i++)penta->horizontalneighborsids[i]=this->horizontalneighborsids[i];
++
++	return penta;
++}
++/*}}}*/
++
++/*Other*/
++/*FUNCTION Penta::AverageOntoPartition {{{*/
++void  Penta::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
++	_error2_("Not supported yet!");
++}
++/*}}}*/
++/*FUNCTION Penta::BedNormal {{{*/
++void Penta::BedNormal(IssmDouble* bed_normal, IssmDouble xyz_list[3][3]){
++
++	int i;
++	IssmDouble v13[3],v23[3];
++	IssmDouble normal[3];
++	IssmDouble normal_norm;
++
++	for (i=0;i<3;i++){
++		v13[i]=xyz_list[0][i]-xyz_list[2][i];
++		v23[i]=xyz_list[1][i]-xyz_list[2][i];
++	}
++
++	normal[0]=v13[1]*v23[2]-v13[2]*v23[1];
++	normal[1]=v13[2]*v23[0]-v13[0]*v23[2];
++	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
++	normal_norm=sqrt( pow(normal[0],2)+pow(normal[1],2)+pow(normal[2],2) );
++
++	/*Bed normal is opposite to surface normal*/
++	*(bed_normal)=-normal[0]/normal_norm;
++	*(bed_normal+1)=-normal[1]/normal_norm;
++	*(bed_normal+2)=-normal[2]/normal_norm;
++}
++/*}}}*/
++/*FUNCTION Penta::BasalFrictionCreateInput {{{*/
++void Penta::BasalFrictionCreateInput(void){
++
++	/*Constants*/
++	const int  numdof=NUMVERTICES*NDOF1;
++
++	/*Intermediaries */
++	int    count,ig;
++	IssmDouble basalfriction[NUMVERTICES]={0,0,0,0,0,0};
++	IssmDouble alpha2,vx,vy;
++	Friction*  friction=NULL;
++	GaussPenta* gauss=NULL;
++
++
++	/* Basal friction can only be found at the base of an ice sheet: */
++	if (!IsOnBed() || IsFloating()){
++		//empty friction: 
++		this->inputs->AddInput(new PentaP1Input(BasalFrictionEnum,&basalfriction[0]));
++		return;
++	}
++
++	/*Retrieve all inputs and parameters*/
++	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);
++
++
++	/*Build friction element, needed later: */
++	friction=new Friction("3d",inputs,matpar,DiagnosticHorizAnalysisEnum);
++
++	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
++	gauss=new GaussPenta(0,1,2,2);
++	count=0;
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		basalfriction[count]=alpha2*(pow(vx,2.0)+pow(vy,2.0));
++		count++;
++	}
++	
++	/*Create PentaVertex input, which will hold the basal friction:*/
++	this->inputs->AddInput(new PentaP1Input(BasalFrictionEnum,&basalfriction[0]));
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++}
++/*}}}*/
++/*FUNCTION Penta::ComputeBasalStress {{{*/
++void  Penta::ComputeBasalStress(Vector* sigma_b){
++
++	int         i,j,ig;
++	int         dofv[3]={0,1,2};
++	int         dofp[1]={3};
++	int         analysis_type,approximation;
++	int         doflist[NUMVERTICES];
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      xyz_list_tria[3][3];
++	IssmDouble      rho_ice,gravity,stokesreconditioning;
++	IssmDouble      pressure,viscosity,bed,Jdet2d;
++	IssmDouble      bed_normal[3];
++	IssmDouble      basalforce[3];
++	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
++	IssmDouble      devstresstensor[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
++	IssmDouble      stresstensor[6]={0.0};
++	IssmDouble      sigma_xx,sigma_yy,sigma_zz;
++	IssmDouble      sigma_xy,sigma_xz,sigma_yz;
++	IssmDouble      surface=0,value=0;
++	GaussPenta* gauss;
++
++	/*retrive parameters: */
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	/*Check analysis_types*/
++	if (analysis_type!=DiagnosticHorizAnalysisEnum) _error2_("Not supported yet!");
++	if (approximation!=StokesApproximationEnum) _error2_("Not supported yet!");
++
++	/*retrieve some parameters: */
++	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	
++	if(!IsOnBed()){
++		//put zero
++		sigma_b->SetValue(id-1,0.0,INS_VAL);
++		return;
++	}
++
++	/*recovre material parameters: */
++	rho_ice=matpar->GetRhoIce();
++	gravity=matpar->GetG();
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<3;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++
++	/*Retrieve all inputs we will be needing: */
++	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_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);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(0,1,2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/*Compute strain rate viscosity and pressure: */
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		pressure_input->GetInputValue(&pressure,gauss);
++
++		/*Compute Stress*/
++		sigma_xx=2*viscosity*epsilon[0]-pressure*stokesreconditioning; // sigma = nu eps - pressure
++		sigma_yy=2*viscosity*epsilon[1]-pressure*stokesreconditioning;
++		sigma_zz=2*viscosity*epsilon[2]-pressure*stokesreconditioning;
++		sigma_xy=2*viscosity*epsilon[3];
++		sigma_xz=2*viscosity*epsilon[4];
++		sigma_yz=2*viscosity*epsilon[5];
++
++		/*Get normal vector to the bed */
++		BedNormal(&bed_normal[0],xyz_list_tria);
++
++		/*basalforce*/
++		basalforce[0] += sigma_xx*bed_normal[0] + sigma_xy*bed_normal[1] + sigma_xz*bed_normal[2];
++		basalforce[1] += sigma_xy*bed_normal[0] + sigma_yy*bed_normal[1] + sigma_yz*bed_normal[2];
++		basalforce[2] += sigma_xz*bed_normal[0] + sigma_yz*bed_normal[1] + sigma_zz*bed_normal[2];
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
++		value+=sigma_zz*Jdet2d*gauss->weight;
++		surface+=Jdet2d*gauss->weight;
++	}
++	value=value/surface;
++
++	/*Add value to output*/
++	sigma_b->SetValue(id-1,value,INS_VAL);
++}
++/*}}}*/
++/*FUNCTION Penta::ComputeStrainRate {{{*/
++void  Penta::ComputeStrainRate(Vector* eps){
++
++	_error2_("Not implemented yet");
++
++}
++/*}}}*/
++/*FUNCTION Penta::ComputeStressTensor {{{*/
++void  Penta::ComputeStressTensor(){
++
++	int         iv;
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      pressure,viscosity;
++	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,exy];*/
++	IssmDouble      sigma_xx[NUMVERTICES];
++	IssmDouble		sigma_yy[NUMVERTICES];
++	IssmDouble		sigma_zz[NUMVERTICES];
++	IssmDouble      sigma_xy[NUMVERTICES];
++	IssmDouble		sigma_xz[NUMVERTICES];
++	IssmDouble		sigma_yz[NUMVERTICES];
++	GaussPenta* gauss=NULL;
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Retrieve all inputs we will be needing: */
++	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_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);
++
++	/* 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->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3d(&viscosity,&epsilon[0]);
++		pressure_input->GetInputValue(&pressure,gauss);
++
++		/*Compute Stress*/
++		sigma_xx[iv]=2*viscosity*epsilon[0]-pressure; // sigma = nu eps - pressure
++		sigma_yy[iv]=2*viscosity*epsilon[1]-pressure;
++		sigma_zz[iv]=2*viscosity*epsilon[2]-pressure;
++		sigma_xy[iv]=2*viscosity*epsilon[3];
++		sigma_xz[iv]=2*viscosity*epsilon[4];
++		sigma_yz[iv]=2*viscosity*epsilon[5];
++	}
++	
++	/*Add Stress tensor components into inputs*/
++	this->inputs->AddInput(new PentaP1Input(StressTensorxxEnum,&sigma_xx[0]));
++	this->inputs->AddInput(new PentaP1Input(StressTensorxyEnum,&sigma_xy[0]));
++	this->inputs->AddInput(new PentaP1Input(StressTensorxzEnum,&sigma_xz[0]));
++	this->inputs->AddInput(new PentaP1Input(StressTensoryyEnum,&sigma_yy[0]));
++	this->inputs->AddInput(new PentaP1Input(StressTensoryzEnum,&sigma_yz[0]));
++	this->inputs->AddInput(new PentaP1Input(StressTensorzzEnum,&sigma_zz[0]));
++
++	/*Clean up and return*/
++	delete gauss;
++}
++/*}}}*/
++		/*FUNCTION Penta::Configure {{{*/
++void  Penta::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
++
++	int analysis_counter;
++	
++	/*go into parameters and get the analysis_counter: */
++	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
++
++	/*Get Element type*/
++	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);
++	this->hmatice->configure(materialsin);
++	this->hmatpar->configure(materialsin);
++	this->hneighbors->configure(elementsin);
++
++	/*Now, go pick up the objects inside the hooks: */
++	if (this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
++	else this->nodes=NULL;
++	this->matice=(Matice*)this->hmatice->delivers();
++	this->matpar=(Matpar*)this->hmatpar->delivers();
++	this->verticalneighbors=(Penta**)this->hneighbors->deliverp();
++
++	/*point parameters to real dataset: */
++	this->parameters=parametersin;
++
++	/*get inputs configured too: */
++	this->inputs->Configure(parameters);
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrix {{{*/
++void  Penta::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){
++
++	/*retrieve parameters: */
++	ElementMatrix* Ke=NULL;
++	ElementVector* De=NULL;
++	int analysis_type;
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*Checks in debugging {{{*/
++	_assert_(this->nodes && this->matice && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
++	/*}}}*/
++	
++	/*Skip if water element*/
++	if(IsOnWater()) return;
++
++	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++		#ifdef _HAVE_DIAGNOSTIC_
++		case DiagnosticHorizAnalysisEnum:
++			Ke=CreateKMatrixDiagnosticHoriz(); De=CreateDVectorDiagnosticHoriz();
++			break;
++		case AdjointHorizAnalysisEnum:
++			Ke=CreateKMatrixAdjointHoriz();
++			break;
++		case DiagnosticHutterAnalysisEnum:
++			Ke=CreateKMatrixDiagnosticHutter();
++			break;
++		case DiagnosticVertAnalysisEnum:
++			Ke=CreateKMatrixDiagnosticVert();
++			break;
++		#endif
++		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
++			Ke=CreateKMatrixSlope();
++			break;
++		case PrognosticAnalysisEnum:
++			Ke=CreateKMatrixPrognostic();
++			break;
++		#ifdef _HAVE_BALANCED_
++		case BalancethicknessAnalysisEnum:
++			Ke=CreateKMatrixBalancethickness();
++			break;
++		#endif
++		#ifdef _HAVE_THERMAL_
++		case ThermalAnalysisEnum:
++			Ke=CreateKMatrixThermal();
++			break;
++		case EnthalpyAnalysisEnum:
++			Ke=CreateKMatrixEnthalpy();
++			break;
++		case MeltingAnalysisEnum:
++			Ke=CreateKMatrixMelting();
++			break;
++		#endif
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global matrix*/
++	if(Ke){
++		Ke->AddToGlobal(Kff,Kfs);
++		delete Ke;
++	}
++	/*Add to global Vector*/
++	if(De){
++		De->InsertIntoGlobal(df);
++		delete De;
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixPrognostic {{{*/
++ElementMatrix* Penta::CreateKMatrixPrognostic(void){
++
++	if (!IsOnBed()) return NULL;
++
++	/*Depth Averaging Vx and Vy*/
++	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
++	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
++
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementMatrix* Ke=tria->CreateKMatrixPrognostic();
++	delete tria->matice; delete tria;
++
++	/*Delete Vx and Vy averaged*/
++	this->inputs->DeleteInput(VxAverageEnum);
++	this->inputs->DeleteInput(VyAverageEnum);
++
++	/*clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixSlope {{{*/
++ElementMatrix* Penta::CreateKMatrixSlope(void){
++
++	if (!IsOnBed()) return NULL;
++
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementMatrix* Ke=tria->CreateKMatrixSlope();
++	delete tria->matice; delete tria;
++
++	/*clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVector {{{*/
++void  Penta::CreatePVector(Vector* pf){
++
++	/*retrive parameters: */
++	ElementVector* pe=NULL;
++	int analysis_type;
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*if debugging mode, check that all pointers exist {{{*/
++	_assert_(this->nodes && this->matice && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
++	/*}}}*/
++
++	/*Skip if water element*/
++	if(IsOnWater()) return;
++
++	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++		#ifdef _HAVE_DIAGNOSTIC_
++		case DiagnosticHorizAnalysisEnum:
++			pe=CreatePVectorDiagnosticHoriz();
++			break;
++		case DiagnosticHutterAnalysisEnum:
++			pe=CreatePVectorDiagnosticHutter();
++			break;
++		case DiagnosticVertAnalysisEnum:
++			pe=CreatePVectorDiagnosticVert();
++			break;
++		#endif
++	 	#ifdef _HAVE_CONTROL_
++		case AdjointHorizAnalysisEnum:
++			pe=CreatePVectorAdjointHoriz();
++			break;
++		#endif
++		#ifdef _HAVE_THERMAL_
++		case ThermalAnalysisEnum:
++			pe=CreatePVectorThermal();
++			break;
++		case EnthalpyAnalysisEnum:
++			pe=CreatePVectorEnthalpy();
++			break;
++		case MeltingAnalysisEnum:
++			pe=CreatePVectorMelting();
++			break;
++		#endif
++		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
++			pe=CreatePVectorSlope();
++			break;
++		case PrognosticAnalysisEnum:
++			pe=CreatePVectorPrognostic();
++			break;
++		#ifdef _HAVE_BALANCED_
++		case BalancethicknessAnalysisEnum:
++			pe=CreatePVectorBalancethickness();
++			break;
++		#endif
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global Vector*/
++	if(pe){
++		pe->AddToGlobal(pf);
++		delete pe;
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorPrognostic {{{*/
++ElementVector* Penta::CreatePVectorPrognostic(void){
++
++	if (!IsOnBed()) return NULL;
++
++	/*Depth Averaging Vx and Vy*/
++	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
++	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementVector* pe=tria->CreatePVectorPrognostic();
++	delete tria->matice; delete tria;
++
++	/*Delete Vx and Vy averaged*/
++	this->inputs->DeleteInput(VxAverageEnum);
++	this->inputs->DeleteInput(VyAverageEnum);
++
++	/*Clean up and return*/
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorSlope {{{*/
++ElementVector* Penta::CreatePVectorSlope(void){
++
++	if (!IsOnBed()) return NULL;
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementVector* pe=tria->CreatePVectorSlope();
++	delete tria->matice; delete tria;
++
++	/*clean up and return*/
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateJacobianMatrix{{{*/
++void  Penta::CreateJacobianMatrix(Matrix* Jff){
++
++	/*retrieve parameters: */
++	ElementMatrix* Ke=NULL;
++	int analysis_type;
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*Checks in debugging {{{*/
++	_assert_(this->nodes && this->matice && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
++	/*}}}*/
++
++	/*Skip if water element*/
++	if(IsOnWater()) return;
++
++	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++#ifdef _HAVE_DIAGNOSTIC_
++		case DiagnosticHorizAnalysisEnum:
++			Ke=CreateJacobianDiagnosticHoriz();
++			break;
++#endif
++		default:
++			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++
++	/*Add to global matrix*/
++	if(Ke){
++		Ke->AddToGlobal(Jff);
++		delete Ke;
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::DeepEcho{{{*/
++void Penta::DeepEcho(void){
++
++	int i;
++	
++	_printLine_("Penta:");
++	_printLine_("   id: " << id);
++	nodes[0]->DeepEcho();
++	nodes[1]->DeepEcho();
++	nodes[2]->DeepEcho();
++	nodes[3]->DeepEcho();
++	nodes[4]->DeepEcho();
++	nodes[5]->DeepEcho();
++	matice->DeepEcho();
++	matpar->DeepEcho();
++	_printLine_("   neighbor ids: " << verticalneighbors[0]->Id() << "-" << verticalneighbors[1]->Id());
++	_printLine_("   parameters");
++	parameters->DeepEcho();
++	_printLine_("   inputs");
++	inputs->DeepEcho();
++	_printLine_("   results");
++	results->DeepEcho();
++	_printLine_("neighboor sids: ");
++	_printLine_(" " << horizontalneighborsids[0] << " " << horizontalneighborsids[1] << " " << horizontalneighborsids[2]);
++
++	return;
++}
++/*}}}*/
++/*FUNCTION Penta::DeleteResults {{{*/
++void  Penta::DeleteResults(void){
++
++	/*Delete and reinitialize results*/
++	delete this->results;
++	this->results=new Results();
++
++}
++/*}}}*/
++/*FUNCTION Penta::Delta18oParameterization{{{*/
++void  Penta::Delta18oParameterization(void){
++
++	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
++	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
++	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
++	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
++	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
++	IssmDouble time,yts,finaltime;
++	this->parameters->FindParam(&time,TimeEnum);
++	this->parameters->FindParam(&yts,ConstantsYtsEnum);
++	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
++
++	/*Recover present day temperature and precipitation*/
++	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
++	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
++	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
++	GaussPenta* gauss=new GaussPenta();
++	for(int month=0;month<12;month++) {
++		for(int iv=0;iv<NUMVERTICES;iv++) {
++			gauss->GaussVertex(iv);
++			input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);
++			input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
++			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
++			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++		}
++	}
++
++	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
++	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
++	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
++	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
++	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
++	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
++	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
++
++	/*Compute the temperature and precipitation*/
++	for(int iv=0;iv<NUMVERTICES;iv++){
++		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
++					Delta18oPresent, Delta18oLgm, Delta18oTime,
++					&PrecipitationsPresentday[iv][0], 
++					&TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 
++					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
++	}
++
++	/*Update inputs*/ 
++	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
++	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
++	for (int imonth=0;imonth<12;imonth++) {
++		for(int iv=0;iv<NUMVERTICES;iv++) {
++			PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
++			NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
++			PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
++			NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
++		}
++	}
++	this->inputs->AddInput(NewTemperatureInput);
++	this->inputs->AddInput(NewPrecipitationInput);
++
++	/*clean-up*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Penta::Echo{{{*/
++
++void Penta::Echo(void){
++	this->DeepEcho();
++}
++/*}}}*/
++/*FUNCTION Penta::ObjectEnum{{{*/
++int Penta::ObjectEnum(void){
++
++	return PentaEnum;
++
++}
++/*}}}*/
++/*FUNCTION Penta::GetBasalElement{{{*/
++Penta* Penta::GetBasalElement(void){
++
++	/*Output*/
++	Penta* penta=NULL;
++
++	/*Go through all elements till the bed is reached*/
++	penta=this;
++	for(;;){
++		/*Stop if we have reached the surface, else, take lower penta*/
++		if (penta->IsOnBed()) break;
++
++		/* get lower Penta*/
++		penta=penta->GetLowerElement();
++		_assert_(penta->Id()!=this->id);
++	}
++
++	/*return output*/
++	return penta;
++}
++/*}}}*/
++/*FUNCTION Penta::GetDofList {{{*/
++void  Penta::GetDofList(int** pdoflist,int approximation_enum,int setenum){
++
++	int  i,j,count=0;
++	int  numberofdofs=0;
++	int* doflist=NULL;
++
++	/*First, figure out size of doflist: */
++	for(i=0;i<6;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
++
++	/*Allocate: */
++	doflist=xNew<int>(numberofdofs);
++
++	/*Populate: */
++	count=0;
++	for(i=0;i<6;i++){
++		nodes[i]->GetDofList(doflist+count,approximation_enum,setenum);
++		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
++	}
++
++	/*Assign output pointers:*/
++	*pdoflist=doflist;
++}
++/*}}}*/
++/*FUNCTION Penta::GetDofList1 {{{*/
++void  Penta::GetDofList1(int* doflist){
++
++	int i;
++	for(i=0;i<6;i++) doflist[i]=nodes[i]->GetDofList1();
++
++}
++/*}}}*/
++/*FUNCTION Penta::GetConnectivityList {{{*/
++void  Penta::GetConnectivityList(int* connectivity){
++	for(int i=0;i<NUMVERTICES;i++) connectivity[i]=nodes[i]->GetConnectivity();
++}
++/*}}}*/
++/*FUNCTION Penta::GetElementType {{{*/
++int Penta::GetElementType(){
++
++	/*return PentaRef field*/
++	return this->element_type;
++}
++/*}}}*/
++/*FUNCTION Penta::GetElementSizes{{{*/
++void Penta::GetElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){
++
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble xmin,ymin,zmin;
++	IssmDouble xmax,ymax,zmax;
++
++	/*Get xyz list: */
++	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES);
++	xmin=xyz_list[0][0]; xmax=xyz_list[0][0];
++	ymin=xyz_list[0][1]; ymax=xyz_list[0][1];
++	zmin=xyz_list[0][2]; zmax=xyz_list[0][2];
++
++	for(int i=1;i<NUMVERTICES;i++){
++		if(xyz_list[i][0]<xmin) xmin=xyz_list[i][0];
++		if(xyz_list[i][0]>xmax) xmax=xyz_list[i][0];
++		if(xyz_list[i][1]<ymin) ymin=xyz_list[i][1];
++		if(xyz_list[i][1]>ymax) ymax=xyz_list[i][1];
++		if(xyz_list[i][2]<zmin) zmin=xyz_list[i][2];
++		if(xyz_list[i][2]>zmax) zmax=xyz_list[i][2];
++	}
++
++	*hx=xmax-xmin;
++	*hy=ymax-ymin;
++	*hz=zmax-zmin;
++}
++/*}}}*/
++/*FUNCTION Penta::GetHorizontalNeighboorSids {{{*/
++int* Penta::GetHorizontalNeighboorSids(){
++
++	/*return PentaRef field*/
++	return &this->horizontalneighborsids[0];
++
++}
++/*}}}*/
++/*FUNCTION Penta::GetLowerElement{{{*/
++Penta* Penta::GetLowerElement(void){
++
++	Penta* upper_penta=NULL;
++
++	upper_penta=(Penta*)verticalneighbors[0]; //first one (0) under, second one (1) above
++
++	return upper_penta;
++}
++/*}}}*/
++/*FUNCTION Penta::GetNodeIndex {{{*/
++int Penta::GetNodeIndex(Node* node){
++
++	_assert_(nodes);
++	for(int i=0;i<NUMVERTICES;i++){
++		if(node==nodes[i])
++		 return i;
++	}
++	_error2_("Node provided not found among element nodes");
++
++}
++/*}}}*/
++/*FUNCTION Penta::GetInputListOnVertices(IssmDouble* pvalue,int enumtype) {{{*/
++void Penta::GetInputListOnVertices(IssmDouble* pvalue,int enumtype){
++
++	/*Intermediaries*/
++	IssmDouble     value[NUMVERTICES];
++	GaussPenta *gauss              = NULL;
++
++	/*Recover input*/
++	Input* input=inputs->GetInput(enumtype);
++	if (!input) _error2_("Input " << EnumToStringx(enumtype) << " not found in element");
++
++	/*Checks in debugging mode*/
++	_assert_(pvalue);
++
++	/* Start looping on the number of vertices: */
++	gauss=new GaussPenta();
++	for (int iv=0;iv<NUMVERTICES;iv++){
++		gauss->GaussVertex(iv);
++		input->GetInputValue(&pvalue[iv],gauss);
++	}
++
++	/*clean-up*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Penta::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue) {{{*/
++void Penta::GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue){
++
++	/*Intermediaries*/
++	IssmDouble     value[NUMVERTICES];
++	GaussPenta *gauss              = NULL;
++
++	/*Recover input*/
++	Input* input=inputs->GetInput(enumtype);
++
++	/*Checks in debugging mode*/
++	_assert_(pvalue);
++
++	/* Start looping on the number of vertices: */
++	if (input){
++		gauss=new GaussPenta();
++		for (int iv=0;iv<NUMVERTICES;iv++){
++			gauss->GaussVertex(iv);
++			input->GetInputValue(&pvalue[iv],gauss);
++		}
++	}
++	else{
++		for (int iv=0;iv<NUMVERTICES;iv++) pvalue[iv]=defaultvalue;
++	}
++
++	/*clean-up*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Penta::GetInputValue(IssmDouble* pvalue,Node* node,int enumtype) {{{*/
++void Penta::GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){
++
++	Input* input=inputs->GetInput(enumtype);
++	if(!input) _error2_("No input of type " << EnumToStringx(enumtype) << " found in tria");
++
++	GaussPenta* gauss=new GaussPenta();
++	gauss->GaussVertex(this->GetNodeIndex(node));
++
++	input->GetInputValue(pvalue,gauss);
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Penta::GetPhi {{{*/
++void Penta::GetPhi(IssmDouble* phi, IssmDouble*  epsilon, IssmDouble viscosity){
++	/*Compute deformational heating from epsilon and viscosity */
++
++	IssmDouble epsilon_matrix[3][3];
++	IssmDouble epsilon_eff;
++	IssmDouble epsilon_sqr[3][3];
++
++	/* Build epsilon matrix */
++	epsilon_matrix[0][0]=*(epsilon+0);
++	epsilon_matrix[1][0]=*(epsilon+3);
++	epsilon_matrix[2][0]=*(epsilon+4);
++	epsilon_matrix[0][1]=*(epsilon+3);
++	epsilon_matrix[1][1]=*(epsilon+1);
++	epsilon_matrix[2][1]=*(epsilon+5);
++	epsilon_matrix[0][2]=*(epsilon+4);
++	epsilon_matrix[1][2]=*(epsilon+5);
++	epsilon_matrix[2][2]=*(epsilon+2);
++
++	/* Effective value of epsilon_matrix */
++	epsilon_sqr[0][0]=pow(epsilon_matrix[0][0],2);
++	epsilon_sqr[1][0]=pow(epsilon_matrix[1][0],2);
++	epsilon_sqr[2][0]=pow(epsilon_matrix[2][0],2);
++	epsilon_sqr[0][1]=pow(epsilon_matrix[0][1],2);
++	epsilon_sqr[1][1]=pow(epsilon_matrix[1][1],2);
++	epsilon_sqr[2][1]=pow(epsilon_matrix[2][1],2);
++	epsilon_sqr[0][2]=pow(epsilon_matrix[0][2],2);
++	epsilon_sqr[1][2]=pow(epsilon_matrix[1][2],2);
++	epsilon_sqr[2][2]=pow(epsilon_matrix[2][2],2);
++	epsilon_eff=1/pow(2,0.5)*pow((epsilon_sqr[0][0]+epsilon_sqr[0][1]+ epsilon_sqr[0][2]+ epsilon_sqr[1][0]+ epsilon_sqr[1][1]+ epsilon_sqr[1][2]+ epsilon_sqr[2][0]+ epsilon_sqr[2][1]+ epsilon_sqr[2][2]),0.5);
++
++	/*Phi = Tr(sigma * eps) 
++	 *    = Tr(sigma'* eps)
++	 *    = 2 * eps_eff * sigma'_eff
++	 *    = 4 * mu * eps_eff ^2*/
++	*phi=4*pow(epsilon_eff,2.0)*viscosity;
++}
++/*}}}*/
++/*FUNCTION Penta::GetSidList{{{*/
++void  Penta::GetSidList(int* sidlist){
++
++	int i;
++	for(i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->GetSidList();
++
++}
++/*}}}*/
++/*FUNCTION Penta::GetSolutionFromInputs{{{*/
++void  Penta::GetSolutionFromInputs(Vector* solution){
++
++	int analysis_type;
++
++	/*retrive parameters: */
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++	#ifdef _HAVE_DIAGNOSTIC_
++	case DiagnosticHorizAnalysisEnum:
++		int approximation;
++		inputs->GetInputValue(&approximation,ApproximationEnum);
++		if(approximation==StokesApproximationEnum || approximation==NoneApproximationEnum){
++			GetSolutionFromInputsDiagnosticStokes(solution);
++		}
++		else if (approximation==MacAyealApproximationEnum || approximation==PattynApproximationEnum || approximation==HutterApproximationEnum){
++			GetSolutionFromInputsDiagnosticHoriz(solution);
++		}
++		else if (approximation==MacAyealPattynApproximationEnum || approximation==PattynStokesApproximationEnum || approximation==MacAyealStokesApproximationEnum){
++			return; //the elements around will create the solution
++		}
++		break;
++	case DiagnosticHutterAnalysisEnum:
++		GetSolutionFromInputsDiagnosticHutter(solution);
++		break;
++	case DiagnosticVertAnalysisEnum:
++		GetSolutionFromInputsDiagnosticVert(solution);
++		break;
++	#endif
++	#ifdef _HAVE_THERMAL_
++	case ThermalAnalysisEnum:
++		GetSolutionFromInputsThermal(solution);
++		break;
++	case EnthalpyAnalysisEnum:
++		GetSolutionFromInputsEnthalpy(solution);
++		break;
++	#endif
++	default:
++		_error2_("analysis: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::GetStabilizationParameter {{{*/
++IssmDouble Penta::GetStabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){
++	/*Compute stabilization parameter*/
++	/*kappa=thermalconductivity/(rho_ice*hearcapacity) for thermal model*/
++	/*kappa=enthalpydiffusionparameter for enthalpy model*/
++
++	IssmDouble normu;
++	IssmDouble tau_parameter;
++
++	normu=pow(pow(u,2)+pow(v,2)+pow(w,2),0.5);
++	if(normu*diameter/(3*2*kappa)<1){ 
++		tau_parameter=pow(diameter,2)/(3*2*2*kappa);
++	}
++	else tau_parameter=diameter/(2*normu);
++
++	return tau_parameter;
++}
++/*}}}*/
++/*FUNCTION Penta::GetStrainRate3dPattyn{{{*/
++void Penta::GetStrainRate3dPattyn(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input){
++	/*Compute the 3d Blatter/PattynStrain Rate (5 components):
++	 *
++	 * epsilon=[exx eyy exy exz eyz]
++	 *
++	 * with exz=1/2 du/dz
++	 *      eyz=1/2 dv/dz
++	 *
++	 * the contribution of vz is neglected
++	 */
++
++	int i;
++	IssmDouble epsilonvx[5];
++	IssmDouble epsilonvy[5];
++
++	/*Check that both inputs have been found*/
++	if (!vx_input || !vy_input){
++		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");
++	}
++
++	/*Get strain rate assuming that epsilon has been allocated*/
++	vx_input->GetVxStrainRate3dPattyn(epsilonvx,xyz_list,gauss);
++	vy_input->GetVyStrainRate3dPattyn(epsilonvy,xyz_list,gauss);
++
++	/*Sum all contributions*/
++	for(i=0;i<5;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i];
++}
++/*}}}*/
++/*FUNCTION Penta::GetStrainRate3d{{{*/
++void Penta::GetStrainRate3d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input, Input* vz_input){
++	/*Compute the 3d Strain Rate (6 components):
++	 *
++	 * epsilon=[exx eyy ezz exy exz eyz]
++	 */
++
++	int i;
++	IssmDouble epsilonvx[6];
++	IssmDouble epsilonvy[6];
++	IssmDouble epsilonvz[6];
++
++	/*Check that both inputs have been found*/
++	if (!vx_input || !vy_input || !vz_input){
++		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << ", vz: " << vz_input << "\n");
++	}
++
++	/*Get strain rate assuming that epsilon has been allocated*/
++	vx_input->GetVxStrainRate3d(epsilonvx,xyz_list,gauss);
++	vy_input->GetVyStrainRate3d(epsilonvy,xyz_list,gauss);
++	vz_input->GetVzStrainRate3d(epsilonvz,xyz_list,gauss);
++
++	/*Sum all contributions*/
++	for(i=0;i<6;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i]+epsilonvz[i];
++}
++/*}}}*/
++/*FUNCTION Penta::GetUpperElement{{{*/
++Penta* Penta::GetUpperElement(void){
++
++	Penta* upper_penta=NULL;
++
++	upper_penta=(Penta*)verticalneighbors[1]; //first one under, second one above
++
++	return upper_penta;
++}
++/*}}}*/
++/*FUNCTION Penta::GetVectorFromInputs{{{*/
++void  Penta::GetVectorFromInputs(Vector* vector,int input_enum){
++
++	int doflist1[NUMVERTICES];
++
++	/*Get out if this is not an element input*/
++	if (!IsInput(input_enum)) return;
++
++	/*Prepare index list*/
++	this->GetDofList1(&doflist1[0]);
++
++	/*Get input (either in element or material)*/
++	Input* input=inputs->GetInput(input_enum);
++	if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in element");
++
++	/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
++	input->GetVectorFromInputs(vector,&doflist1[0]);
++}
++/*}}}*/
++/*FUNCTION Penta::GetVectorFromResults{{{*/
++void  Penta::GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp){
++
++	/*Get result*/
++	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
++	if(elementresult->InstanceEnum()!=enum_in){
++		_error_("Results of offset %i is %s, when %s was expected",offset,EnumToStringx(elementresult->InstanceEnum()),EnumToStringx(enum_in));
++	}  
++	if(interp==P1Enum){
++		int doflist1[NUMVERTICES];
++		int connectivity[NUMVERTICES];
++		this->GetSidList(&doflist1[0]);
++		this->GetConnectivityList(&connectivity[0]);
++		elementresult->GetVectorFromResults(vector,&doflist1[0],&connectivity[0],NUMVERTICES);
++	}
++	else if(interp==P0Enum){
++		elementresult->GetElementVectorFromResults(vector,sid);
++	}
++	else{
++		_printLine_("Interpolation " << EnumToStringx(interp) << " not supported");
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::GetZcoord {{{*/
++IssmDouble Penta::GetZcoord(GaussPenta* gauss){
++
++	int    i;
++	IssmDouble z;
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble z_list[NUMVERTICES];
++
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES;i++) z_list[i]=xyz_list[i][2];
++	PentaRef::GetInputValue(&z,z_list,gauss);
++
++	return z;
++}
++/*}}}*/
++/*FUNCTION Penta::Sid {{{*/
++int    Penta::Sid(){
++	
++	return sid;
++
++}
++/*}}}*/
++/*FUNCTION Penta::Id {{{*/
++int    Penta::Id(void){
++	return id; 
++}
++/*}}}*/
++/*FUNCTION Penta::InputArtificialNoise{{{*/
++void  Penta::InputArtificialNoise(int enum_type,IssmDouble min,IssmDouble max){
++
++	Input* input=NULL;
++
++	/*Make a copy of the original input: */
++	input=(Input*)this->inputs->GetInput(enum_type);
++	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
++
++	/*ArtificialNoise: */
++	input->ArtificialNoise(min,max);
++}
++/*}}}*/
++/*FUNCTION Penta::InputConvergence{{{*/
++bool Penta::InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums){
++
++	int i;
++	bool    converged=true;
++	Input** new_inputs=NULL;
++	Input** old_inputs=NULL;
++
++	new_inputs=xNew<Input*>(num_enums/2); //half the enums are for the new inputs
++	old_inputs=xNew<Input*>(num_enums/2); //half the enums are for the old inputs
++
++	for(i=0;i<num_enums/2;i++){
++		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
++		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
++		if(!new_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
++		if(!old_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
++	}
++
++	/*ok, we've got the inputs (new and old), now loop throught the number of criterions and fill the eps array:*/
++	for(i=0;i<num_criterionenums;i++){
++		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,criterionenums[i]);
++		if(eps[i]>criterionvalues[i]) converged=false; 
++	}
++
++	/*clean up*/
++	xDelete<Input*>(new_inputs);
++	xDelete<Input*>(old_inputs);
++
++	/*Return output*/
++	return converged;
++}
++/*}}}*/
++/*FUNCTION Penta::InputCreate(IssmDouble scalar,int enum,int code);{{{*/
++void Penta::InputCreate(IssmDouble scalar,int name,int code){
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++	
++	if ((code==5) || (code==1)){ //boolean
++		this->inputs->AddInput(new BoolInput(name,(bool)scalar));
++	}
++	else if ((code==6) || (code==2)){ //integer
++		this->inputs->AddInput(new IntInput(name,(int)scalar));
++	}
++	else if ((code==7) || (code==3)){ //IssmDouble
++		this->inputs->AddInput(new DoubleInput(name,(IssmDouble)scalar));
++	}
++	else _error2_("could not recognize nature of vector from code " << code);
++
++}
++/*}}}*/
++/*FUNCTION Penta::InputCreate(IssmDouble* vector,int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){{{*/
++void Penta::InputCreate(IssmDouble* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){//index into elements
++
++	/*Intermediaries*/
++	int    i,j,t;
++	int    penta_vertex_ids[6];
++	int    row;
++	IssmDouble nodeinputs[6];
++	IssmDouble time;
++	TransientInput* transientinput=NULL;
++
++	int    numberofvertices;
++	int    numberofelements;
++	IssmDouble yts;
++
++	/*Fetch parameters: */
++	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
++	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
++	iomodel->Constant(&yts,ConstantsYtsEnum);
++
++	/*Branch on type of vector: nodal or elementary: */
++	if(vector_type==1){ //nodal vector
++
++		/*Recover vertices ids needed to initialize inputs*/
++		for(i=0;i<6;i++){ 
++			_assert_(iomodel->Data(MeshElementsEnum));
++			penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
++		}
++
++		/*Are we in transient or static? */
++		if(M==numberofvertices){
++
++			/*create input values: */
++			for(i=0;i<6;i++)nodeinputs[i]=(IssmDouble)vector[penta_vertex_ids[i]-1];
++
++			/*process units: */
++			UnitConversion(&nodeinputs[0], 6 ,ExtToIuEnum, vector_enum);
++
++			/*create static input: */
++			this->inputs->AddInput(new PentaP1Input(vector_enum,nodeinputs));
++		}
++		else if(M==numberofvertices+1){
++			/*create transient input: */
++			for(t=0;t<N;t++){ //N is the number of times
++
++				/*create input values: */
++				for(i=0;i<6;i++){
++					row=penta_vertex_ids[i]-1;
++					nodeinputs[i]=(IssmDouble)vector[N*row+t];
++				}
++
++				/*process units: */
++				UnitConversion(&nodeinputs[0], 6 ,ExtToIuEnum, vector_enum);
++
++				/*time? :*/
++				time=(IssmDouble)vector[(M-1)*N+t]*yts;
++
++				if(t==0)transientinput=new TransientInput(vector_enum);
++				transientinput->AddTimeInput(new PentaP1Input(vector_enum,nodeinputs),time);
++			}
++			this->inputs->AddInput(transientinput);
++		}
++		else _error2_("nodal vector is either numberofnodes (" << numberofvertices << "), or numberofnodes+1 long. Field provided is " << M << " long. Enum " << EnumToStringx(vector_enum));
++	}
++	else if(vector_type==2){ //element vector
++		/*Are we in transient or static? */
++		if(M==numberofelements){
++
++			/*static mode: create an input out of the element value: */
++
++			if (code==5){ //boolean
++				this->inputs->AddInput(new BoolInput(vector_enum,(bool)vector[index]));
++			}
++			else if (code==6){ //integer
++				this->inputs->AddInput(new IntInput(vector_enum,(int)vector[index]));
++			}
++			else if (code==7){ //IssmDouble
++				this->inputs->AddInput(new DoubleInput(vector_enum,(IssmDouble)vector[index]));
++			}
++			else _error2_("could not recognize nature of vector from code " << code);
++		}
++		else {
++			_error2_("transient elementary inputs not supported yet!");
++		}
++	}
++	else{
++		_error2_("Cannot add input for vector type " << vector_type << " (not supported)");
++	}
++
++}
++/*}}}*/
++/*FUNCTION Penta::InputDepthAverageAtBase{{{*/
++void  Penta::InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum){
++
++	int  step,i;
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	IssmDouble  Helem_list[NUMVERTICES];
++	IssmDouble  zeros_list[NUMVERTICES]={0.0};
++	Penta* penta=NULL;
++	Input* original_input=NULL;
++	Input* element_integrated_input=NULL;
++	Input* total_integrated_input=NULL;
++	Input* element_thickness_input=NULL;
++	Input* total_thickness_input=NULL;
++	Input* depth_averaged_input=NULL;
++
++	/*recover parameters: */
++
++	/*Are we on the base? If not, return*/
++	if(!IsOnBed()) return;
++
++	/*OK, we are on bed. Initialize global inputs as 0*/
++	total_thickness_input =new PentaP1Input(ThicknessEnum,zeros_list);
++
++	/*Now follow all the upper element from the base to the surface to integrate the input*/
++	penta=this;
++	step =0;
++	for(;;){
++
++		/*Step1: Get original input (to be depth avegaged): */
++		if (object_enum==MeshElementsEnum)
++		 original_input=(Input*)penta->inputs->GetInput(enum_type);
++		else if (object_enum==MaterialsEnum)
++		 original_input=(Input*)penta->matice->inputs->GetInput(enum_type);
++		else
++		 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
++		if(!original_input) _error2_("could not find input with enum " << EnumToStringx(enum_type));
++
++		/*If first time, initialize total_integrated_input*/
++		if (step==0){
++			if (original_input->ObjectEnum()==PentaP1InputEnum)
++			 total_integrated_input=new PentaP1Input(average_enum_type,zeros_list);
++			else if (original_input->ObjectEnum()==ControlInputEnum)
++			 total_integrated_input=new PentaP1Input(average_enum_type,zeros_list);
++			else if (original_input->ObjectEnum()==DoubleInputEnum)
++			 total_integrated_input=new DoubleInput(average_enum_type,0.0);
++			else
++			 _error2_("object " << EnumToStringx(original_input->ObjectEnum()) << " not supported yet");
++		}
++
++		/*Step2: Create element thickness input*/
++		GetVerticesCoordinates(&xyz_list[0][0],penta->nodes,NUMVERTICES);
++		for(i=0;i<3;i++){
++			Helem_list[i]=xyz_list[i+3][2]-xyz_list[i][2];
++			Helem_list[i+3]=Helem_list[i];
++		}
++		element_thickness_input=new PentaP1Input(ThicknessEnum,Helem_list);
++
++		/*Step3: Vertically integrate A COPY of the original*/
++		element_integrated_input=(Input*)original_input->copy();
++		element_integrated_input->VerticallyIntegrate(element_thickness_input);
++
++		/*Add contributions to global inputs*/
++		total_integrated_input->AXPY(element_integrated_input,1.0);
++		total_thickness_input ->AXPY(element_thickness_input,1.0);
++
++		/*Clean up*/
++		delete element_thickness_input;
++		delete element_integrated_input;
++
++		/*Stop if we have reached the surface, else, take upper penta*/
++		if (penta->IsOnSurface()) break;
++
++		/* get upper Penta*/
++		penta=penta->GetUpperElement();
++		_assert_(penta->Id()!=this->id);
++
++		/*increase couter*/
++		step++;
++	}
++
++	/*OK, now we only need to divide the depth integrated input by the total thickness!*/
++	depth_averaged_input=total_integrated_input->PointwiseDivide(total_thickness_input);
++	depth_averaged_input->ChangeEnum(average_enum_type);
++
++	/*Clean up*/
++	delete total_thickness_input;
++	delete total_integrated_input;
++
++	/*Finally, add to inputs*/
++	if (object_enum==MeshElementsEnum)
++	 this->inputs->AddInput((Input*)depth_averaged_input);
++	else if (object_enum==MaterialsEnum)
++	 this->matice->inputs->AddInput((Input*)depth_averaged_input);
++	else
++	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
++}
++/*}}}*/
++/*FUNCTION Penta::InputDuplicate{{{*/
++void  Penta::InputDuplicate(int original_enum,int new_enum){
++
++	/*Call inputs method*/
++	if (IsInput(original_enum)) inputs->DuplicateInput(original_enum,new_enum);
++
++}
++/*}}}*/
++/*FUNCTION Penta::InputExtrude {{{*/
++void  Penta::InputExtrude(int enum_type,int object_type){
++
++	int     i,num_inputs;
++	Penta  *penta       = NULL;
++	Input  *copy        = NULL;
++	Input **base_inputs = NULL;
++
++	/*Are we on the base, not on the surface?:*/
++	if(!IsOnBed()) return;
++
++	/*Step1: Get and Extrude original input: */
++	if (object_type==ElementEnum){
++		num_inputs=1;
++		base_inputs=xNew<Input*>(num_inputs);
++		base_inputs[0]=(Input*)this->inputs->GetInput(enum_type);
++	}
++	else if (object_type==MaterialsEnum){
++		num_inputs=1;
++		base_inputs=xNew<Input*>(num_inputs);
++		base_inputs[0]=(Input*)matice->inputs->GetInput(enum_type);
++	}
++	else if (object_type==NodeEnum){
++		num_inputs=3; //only the three upper nodes
++		base_inputs=xNew<Input*>(num_inputs);
++		for(i=0;i<num_inputs;i++){
++			base_inputs[i]=(Input*)this->nodes[i]->inputs->GetInput(enum_type);
++		}
++	}
++	else{
++		_error2_("object of type " << EnumToStringx(object_type) << " not supported yet");
++	}
++	for(i=0;i<num_inputs;i++){
++		if(!base_inputs[i]) _error2_("could not find input with enum " << EnumToStringx(enum_type) << " in object " << EnumToStringx(object_type));
++		base_inputs[i]->Extrude();
++	}
++
++	/*Stop if there is only one layer of element*/
++	if (this->IsOnSurface()) return;
++
++	/*Step 2: this input has been extruded for this element, now follow the upper element*/
++	penta=this;
++	for(;;){
++		/* get upper Penta*/
++		penta=penta->GetUpperElement();
++		_assert_(penta->Id()!=this->id);
++
++		/*Add input of the basal element to penta->inputs*/
++		for(i=0;i<num_inputs;i++){
++			copy=(Input*)base_inputs[i]->copy();
++			if (object_type==ElementEnum){
++				penta->inputs->AddInput((Input*)copy);
++			}
++			else if(object_type==MaterialsEnum){
++				penta->matice->inputs->AddInput((Input*)copy);
++			}
++			else if(object_type==NodeEnum){
++				penta->nodes[i+3]->inputs->AddInput((Input*)copy); //change only the three upper nodes
++			}
++			else{
++				_error2_("object of type " << EnumToStringx(object_type) << " not supported yet");
++			}
++		}
++
++		/*Stop if we have reached the surface*/
++		if (penta->IsOnSurface()) break;
++	}
++
++	/*clean-up and return*/
++	xDelete<Input*>(base_inputs);
++}
++/*}}}*/
++/*FUNCTION Penta::InputScale{{{*/
++void  Penta::InputScale(int enum_type,IssmDouble scale_factor){
++
++	Input* input=NULL;
++
++	/*Make a copy of the original input: */
++	input=(Input*)this->inputs->GetInput(enum_type);
++	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
++
++	/*Scale: */
++	input->Scale(scale_factor);
++}
++/*}}}*/
++/*FUNCTION Penta::InputToResult{{{*/
++void  Penta::InputToResult(int enum_type,int step,IssmDouble time){
++
++	int    i;
++	bool   found = false;
++	Input *input = NULL;
++
++	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
++	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyBEnum);
++	else input=this->inputs->GetInput(enum_type);
++	//if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found in penta->inputs"); why error out? if the requested input does not exist, we should still 
++	//try and output whatever we can instead of just failing.
++	if(!input)return;
++
++	/*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result 
++	 * object out of the input, with the additional step and time information: */
++	this->results->AddObject((Object*)input->SpawnResult(step,time));
++	#ifdef _HAVE_CONTROL_
++	if(input->ObjectEnum()==ControlInputEnum){
++		if(((ControlInput*)input)->gradient!=NULL) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
++	}
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromConstant(bool value, int name);{{{*/
++void  Penta::InputUpdateFromConstant(bool constant, int name){
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	/*update input*/
++	this->inputs->AddInput(new BoolInput(name,constant));
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromConstant(IssmDouble value, int name);{{{*/
++void  Penta::InputUpdateFromConstant(IssmDouble constant, int name){
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	/*update input*/
++	this->inputs->AddInput(new DoubleInput(name,constant));
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromConstant(int value, int name);{{{*/
++void  Penta::InputUpdateFromConstant(int constant, int name){
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	/*update input*/
++	this->inputs->AddInput(new IntInput(name,constant));
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromIoModel {{{*/
++void Penta::InputUpdateFromIoModel(int index,IoModel* iomodel){ 
++
++	/*Intermediaries*/
++	IssmInt i,j;
++	int     penta_vertex_ids[6];
++	IssmDouble  nodeinputs[6];
++	IssmDouble  cmmininputs[6];
++	IssmDouble  cmmaxinputs[6];
++
++	IssmDouble  yts;
++	bool    control_analysis;
++	int     num_control_type;
++	int     num_cm_responses;
++
++	/*Fetch parameters: */
++	iomodel->Constant(&yts,ConstantsYtsEnum);
++	iomodel->Constant(&control_analysis,InversionIscontrolEnum);
++	if(control_analysis) iomodel->Constant(&num_control_type,InversionNumControlParametersEnum);
++	if(control_analysis) iomodel->Constant(&num_cm_responses,InversionNumCostFunctionsEnum);
++
++	/*Checks if debuging*/
++	/*{{{*/
++	_assert_(iomodel->Data(MeshElementsEnum));
++	/*}}}*/
++
++	/*Recover vertices ids needed to initialize inputs*/
++	for(i=0;i<6;i++){ 
++		penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
++	}
++
++	/*Control Inputs*/
++	#ifdef _HAVE_CONTROL_
++	if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
++		for(i=0;i<num_control_type;i++){
++			switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
++				case BalancethicknessThickeningRateEnum:
++					if (iomodel->Data(BalancethicknessThickeningRateEnum)){
++						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(BalancethicknessThickeningRateEnum)[penta_vertex_ids[j]-1]/yts;
++						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
++						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
++						this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++					}
++					break;
++				case VxEnum:
++					if (iomodel->Data(VxEnum)){
++						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(VxEnum)[penta_vertex_ids[j]-1]/yts;
++						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
++						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
++						this->inputs->AddInput(new ControlInput(VxEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++					}
++					break;
++				case VyEnum:
++					if (iomodel->Data(VyEnum)){
++						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(VyEnum)[penta_vertex_ids[j]-1]/yts;
++						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
++						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
++						this->inputs->AddInput(new ControlInput(VyEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++					}
++					break;
++				case FrictionCoefficientEnum:
++					if (iomodel->Data(FrictionCoefficientEnum)){
++						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(FrictionCoefficientEnum)[penta_vertex_ids[j]-1];
++						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];
++						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];
++						this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++					}
++					break;
++				case MaterialsRheologyBbarEnum:
++					/*Matice will take care of it*/ break;
++				default:
++					_error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
++			}
++		}
++	}
++	#endif
++
++	//Need to know the type of approximation for this element
++	if(iomodel->Data(FlowequationElementEquationEnum)){
++		if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealApproximationEnum){
++			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealApproximationEnum));
++		}
++		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynApproximationEnum){
++			this->inputs->AddInput(new IntInput(ApproximationEnum,PattynApproximationEnum));
++		}
++		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealPattynApproximationEnum){
++			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealPattynApproximationEnum));
++		}
++		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==HutterApproximationEnum){
++			this->inputs->AddInput(new IntInput(ApproximationEnum,HutterApproximationEnum));
++		}
++		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==StokesApproximationEnum){
++			this->inputs->AddInput(new IntInput(ApproximationEnum,StokesApproximationEnum));
++		}
++		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealStokesApproximationEnum){
++			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealStokesApproximationEnum));
++		}
++		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynStokesApproximationEnum){
++			this->inputs->AddInput(new IntInput(ApproximationEnum,PattynStokesApproximationEnum));
++		}
++		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==NoneApproximationEnum){
++			this->inputs->AddInput(new IntInput(ApproximationEnum,NoneApproximationEnum));
++		}
++		else{
++			_error2_("Approximation type " << EnumToStringx((int)*(iomodel->Data(FlowequationElementEquationEnum)+index)) << " not supported yet");
++		}
++	}
++
++	/*DatasetInputs*/
++	if (control_analysis && iomodel->Data(InversionCostFunctionsCoefficientsEnum)) {
++
++		/*Create inputs and add to DataSetInput*/
++		DatasetInput* datasetinput=new DatasetInput(InversionCostFunctionsCoefficientsEnum);
++		for(i=0;i<num_cm_responses;i++){
++			for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(InversionCostFunctionsCoefficientsEnum)[(penta_vertex_ids[j]-1)*num_cm_responses+i];
++			datasetinput->inputs->AddObject(new PentaP1Input(InversionCostFunctionsCoefficientsEnum,nodeinputs));
++		}
++
++		/*Add datasetinput to element inputs*/
++		this->inputs->AddInput(datasetinput);
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolution {{{*/
++void  Penta::InputUpdateFromSolution(IssmDouble* solution){
++
++	int analysis_type;
++
++	/*retreive parameters: */
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++
++	/*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
++	switch(analysis_type){
++	#ifdef _HAVE_DIAGNOSTIC_
++	case DiagnosticHorizAnalysisEnum:
++		InputUpdateFromSolutionDiagnosticHoriz( solution);
++		break;
++	case DiagnosticHutterAnalysisEnum:
++		InputUpdateFromSolutionDiagnosticHutter( solution);
++		break;
++	case DiagnosticVertAnalysisEnum:
++		InputUpdateFromSolutionDiagnosticVert( solution);
++		break;
++	#endif
++	#ifdef _HAVE_CONTROL_
++	case AdjointHorizAnalysisEnum:
++		int approximation;
++		inputs->GetInputValue(&approximation,ApproximationEnum);
++		if(approximation==StokesApproximationEnum || approximation==NoneApproximationEnum){
++			InputUpdateFromSolutionAdjointStokes( solution);
++		}
++		else{
++			InputUpdateFromSolutionAdjointHoriz( solution);
++		}
++		break;
++	#endif
++	#ifdef _HAVE_THERMAL_
++	case ThermalAnalysisEnum:
++		InputUpdateFromSolutionThermal( solution);
++		break;
++	case EnthalpyAnalysisEnum:
++		InputUpdateFromSolutionEnthalpy( solution);
++		break;
++	case MeltingAnalysisEnum:
++		InputUpdateFromSolutionOneDof(solution,BasalforcingsMeltingRateEnum);
++		break;
++	#endif
++	case BedSlopeXAnalysisEnum:
++		InputUpdateFromSolutionOneDofCollapsed(solution,BedSlopeXEnum);
++		break;
++	case BedSlopeYAnalysisEnum:
++		InputUpdateFromSolutionOneDofCollapsed(solution,BedSlopeYEnum);
++		break;
++	case SurfaceSlopeXAnalysisEnum:
++		InputUpdateFromSolutionOneDofCollapsed(solution,SurfaceSlopeXEnum);
++		break;
++	case SurfaceSlopeYAnalysisEnum:
++		InputUpdateFromSolutionOneDofCollapsed(solution,SurfaceSlopeYEnum);
++		break;
++	case PrognosticAnalysisEnum:
++		InputUpdateFromSolutionPrognostic(solution);
++		break;
++	#ifdef _HAVE_BALANCED_
++	case BalancethicknessAnalysisEnum:
++		InputUpdateFromSolutionOneDofCollapsed(solution,ThicknessEnum);
++		break;
++	#endif
++	default: 
++		_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionPrognostic{{{*/
++void  Penta::InputUpdateFromSolutionPrognostic(IssmDouble* solution){
++
++	const int  numdof   = NDOF1*NUMVERTICES;
++	const int  numdof2d = NDOF1*NUMVERTICES2D;
++
++	int    i,hydroadjustment;
++	int*   doflist = NULL;
++	IssmDouble rho_ice,rho_water,minthickness;
++	IssmDouble newthickness[numdof];
++	IssmDouble newbed[numdof];
++	IssmDouble newsurface[numdof];
++	IssmDouble oldbed[NUMVERTICES];
++	IssmDouble oldsurface[NUMVERTICES];
++	IssmDouble oldthickness[NUMVERTICES];
++	Penta  *penta   = NULL;
++
++	/*If not on bed, return*/
++	if (!IsOnBed()) return;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector and extrude it */
++	this->parameters->FindParam(&minthickness,PrognosticMinThicknessEnum);
++	for(i=0;i<numdof2d;i++){
++		newthickness[i]=solution[doflist[i]];
++		if(xIsNan<IssmDouble>(newthickness[i])) _error2_("NaN found in solution vector");
++		/*Constrain thickness to be at least 1m*/
++		if(newthickness[i]<minthickness) newthickness[i]=minthickness;
++		newthickness[i+numdof2d]=newthickness[i];
++	}
++
++	/*Get previous bed, thickness and surface*/
++	GetInputListOnVertices(&oldbed[0],BedEnum);
++	GetInputListOnVertices(&oldsurface[0],SurfaceEnum);
++	GetInputListOnVertices(&oldthickness[0],ThicknessEnum);
++
++	/*Fing PrognosticHydrostaticAdjustment to figure out how to update the geometry:*/
++	this->parameters->FindParam(&hydroadjustment,PrognosticHydrostaticAdjustmentEnum);
++
++	/*recover material parameters: */
++	rho_ice=matpar->GetRhoIce();
++	rho_water=matpar->GetRhoWater();
++
++	for(i=0;i<numdof;i++) {
++		/*If shelf: hydrostatic equilibrium*/
++		if (this->nodes[i]->IsGrounded()){
++			newsurface[i]=oldbed[i]+newthickness[i]; //surface = oldbed + newthickness
++			newbed[i]=oldbed[i];               //same bed: do nothing
++		}
++		else{ //so it is an ice shelf
++			if(hydroadjustment==AbsoluteEnum){
++				newsurface[i]=newthickness[i]*(1-rho_ice/rho_water);
++				newbed[i]=newthickness[i]*(-rho_ice/rho_water);
++			}
++			else if(hydroadjustment==IncrementalEnum){
++				newsurface[i]=oldsurface[i]+(1.0-rho_ice/rho_water)*(newthickness[i]-oldthickness[i]); //surface = oldsurface + (1-di) * dH 
++				newbed[i]=oldbed[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i]); //bed = oldbed + di * dH
++			}
++			else _error2_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
++		}
++	}
++
++	/*Start looping over all elements above current element and update all inputs*/
++	penta=this;
++	for(;;){
++		/*Add input to the element: */
++		penta->inputs->AddInput(new PentaP1Input(ThicknessEnum,newthickness));
++		penta->inputs->AddInput(new PentaP1Input(SurfaceEnum,newsurface));
++		penta->inputs->AddInput(new PentaP1Input(BedEnum,newbed));
++
++		/*Stop if we have reached the surface*/
++		if (penta->IsOnSurface()) break;
++
++		/* get upper Penta*/
++		penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id);
++	}
++	
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionOneDof{{{*/
++void  Penta::InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type){
++
++	const int numdof = NDOF1*NUMVERTICES;
++
++	IssmDouble values[numdof];
++	int*   doflist=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(int i=0;i<numdof;i++){
++		values[i]=solution[doflist[i]];
++		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Add input to the element: */
++	this->inputs->AddInput(new PentaP1Input(enum_type,values));
++	
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionOneDofCollpased{{{*/
++void  Penta::InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int enum_type){
++
++	const int  numdof   = NDOF1*NUMVERTICES;
++	const int  numdof2d = NDOF1*NUMVERTICES2D;
++
++	IssmDouble  values[numdof];
++	int*    doflist = NULL;
++	Penta  *penta   = NULL;
++
++	/*If not on bed, return*/
++	if (!IsOnBed()) return;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector and extrude it */
++	for(int i=0;i<numdof2d;i++){
++		values[i]         =solution[doflist[i]];
++		values[i+numdof2d]=values[i];
++		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Start looping over all elements above current element and update all inputs*/
++	penta=this;
++	for(;;){
++		/*Add input to the element: */
++		penta->inputs->AddInput(new PentaP1Input(enum_type,values));
++
++		/*Stop if we have reached the surface*/
++		if (penta->IsOnSurface()) break;
++
++		/* get upper Penta*/
++		penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id);
++	}
++	
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromVector(IssmDouble* vector, int name, int type);{{{*/
++void  Penta::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	/*Penta update B in InputUpdateFromSolutionThermal, so don't look for B update here.*/
++
++	switch(type){
++
++		case VertexEnum:
++
++			/*New PentaVertexInpu*/
++			IssmDouble values[6];
++
++			/*Get values on the 6 vertices*/
++			for (int i=0;i<6;i++){
++				values[i]=vector[this->nodes[i]->GetVertexDof()];
++			}
++
++			/*update input*/
++			this->inputs->AddInput(new PentaP1Input(name,values));
++			return;
++
++		default:
++
++			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromVector(int* vector, int name, int type);{{{*/
++void  Penta::InputUpdateFromVector(int* vector, int name, int type){
++	_error2_("not supported yet!");
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromVector(bool* vector, int name, int type);{{{*/
++void  Penta::InputUpdateFromVector(bool* vector, int name, int type){
++	_error2_("not supported yet!");
++}
++/*}}}*/
++/*FUNCTION Penta::IsOnBed{{{*/
++bool Penta::IsOnBed(void){
++
++	bool onbed;
++	inputs->GetInputValue(&onbed,MeshElementonbedEnum);
++	return onbed;
++}
++/*}}}*/
++/*FUNCTION Penta::IsInput{{{*/
++bool Penta::IsInput(int name){
++	if (
++				name==ThicknessEnum ||
++				name==SurfaceEnum ||
++				name==BedEnum ||
++				name==SurfaceSlopeXEnum ||
++				name==SurfaceSlopeYEnum ||
++				name==SurfaceforcingsMassBalanceEnum ||
++				name==BasalforcingsMeltingRateEnum ||
++				name==BasalforcingsGeothermalfluxEnum ||
++				name==SurfaceAreaEnum||
++				name==PressureEnum ||
++				name==VxEnum ||
++				name==VyEnum ||
++				name==VzEnum ||
++				name==VxMeshEnum ||
++				name==VyMeshEnum ||
++				name==VzMeshEnum ||
++				name==InversionVxObsEnum ||
++				name==InversionVyObsEnum ||
++				name==InversionVzObsEnum ||
++				name==TemperatureEnum ||
++				name==EnthalpyEnum ||
++				name==EnthalpyPicardEnum ||
++				name==WaterfractionEnum||
++				name==FrictionCoefficientEnum ||
++				name==GradientEnum ||
++				name==OldGradientEnum  ||
++				name==ConvergedEnum || 
++				name==QmuVxEnum ||
++				name==QmuVyEnum ||
++				name==QmuPressureEnum ||
++				name==QmuBedEnum ||
++				name==QmuThicknessEnum ||
++				name==QmuSurfaceEnum ||
++				name==QmuTemperatureEnum ||
++				name==QmuMeltingEnum
++				) {
++		return true;
++	}
++	else return false;
++}
++/*}}}*/
++/*FUNCTION Penta::IsFloating{{{*/
++bool   Penta::IsFloating(){
++
++	bool onshelf;
++	inputs->GetInputValue(&onshelf,MaskElementonfloatingiceEnum);
++	return onshelf;
++}
++/*}}}*/
++/*FUNCTION Penta::IsNodeOnShelf {{{*/
++bool   Penta::IsNodeOnShelf(){
++
++	int  i;
++	bool shelf=false;
++
++	for(i=0;i<6;i++){
++		if (nodes[i]->IsFloating()){
++			shelf=true;
++			break;
++		}
++	}
++	return shelf;
++}
++/*}}}*/
++/*FUNCTION Penta::IsNodeOnShelfFromFlags {{{*/
++bool   Penta::IsNodeOnShelfFromFlags(IssmDouble* flags){
++
++	int  i;
++	bool shelf=false;
++
++	for(i=0;i<NUMVERTICES;i++){
++		if (flags[nodes[i]->Sid()]){
++			shelf=true;
++			break;
++		}
++	}
++	return shelf;
++}
++/*}}}*/
++/*FUNCTION Penta::IsOnSurface{{{*/
++bool Penta::IsOnSurface(void){
++
++	bool onsurface;
++	inputs->GetInputValue(&onsurface,MeshElementonsurfaceEnum);
++	return onsurface;
++}
++/*}}}*/
++/*FUNCTION Penta::IsOnWater {{{*/
++bool   Penta::IsOnWater(){
++
++	bool onwater;
++	inputs->GetInputValue(&onwater,MaskElementonwaterEnum);
++	return onwater;
++}
++/*}}}*/
++/*FUNCTION Penta::ListResultsInfo{{{*/
++void Penta::ListResultsInfo(int** in_resultsenums,int** in_resultssizes,IssmDouble** in_resultstimes,int** in_resultssteps,int* in_num_results){
++
++	/*Intermediaries*/
++	int     i;
++	int     numberofresults = 0;
++	int     *resultsenums   = NULL;
++	int     *resultssizes   = NULL;
++	IssmDouble  *resultstimes   = NULL;
++	int     *resultssteps   = NULL;
++
++	/*Checks*/
++	_assert_(in_num_results);
++
++	/*Count number of results*/
++	for(i=0;i<this->results->Size();i++){
++		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
++		numberofresults++;
++	}
++
++	if(numberofresults){
++
++		/*Allocate output*/
++		resultsenums=xNew<int>(numberofresults);
++		resultssizes=xNew<int>(numberofresults);
++		resultstimes=xNew<IssmDouble>(numberofresults);
++		resultssteps=xNew<int>(numberofresults);
++
++		/*populate enums*/
++		for(i=0;i<this->results->Size();i++){
++			ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
++			resultsenums[i]=elementresult->InstanceEnum();
++			resultstimes[i]=elementresult->GetTime();
++			resultssteps[i]=elementresult->GetStep();
++			if(elementresult->ObjectEnum()==PentaP1ElementResultEnum){
++				resultssizes[i]=P1Enum;
++			}
++			else{
++				resultssizes[i]=P0Enum;
++			}
++		}
++	}
++
++	/*Assign output pointers:*/
++	*in_num_results=numberofresults;
++	*in_resultsenums=resultsenums;
++	*in_resultssizes=resultssizes;
++	*in_resultstimes=resultstimes;
++	*in_resultssteps=resultssteps;
++
++}/*}}}*/
++/*FUNCTION Penta::MigrateGroundingLine{{{*/
++void  Penta::MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding){
++
++	int     i,migration_style,unground;
++	bool    elementonshelf = false;
++	IssmDouble  bed_hydro,yts,gl_melting_rate;
++	IssmDouble  rho_water,rho_ice,density;
++	IssmDouble  melting[NUMVERTICES];
++	IssmDouble  h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES];
++
++	if(!IsOnBed()) return;
++
++	/*Recover info at the vertices: */
++	parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
++	parameters->FindParam(&yts,ConstantsYtsEnum);
++	GetInputListOnVertices(&h[0],ThicknessEnum);
++	GetInputListOnVertices(&s[0],SurfaceEnum);
++	GetInputListOnVertices(&b[0],BedEnum);
++	GetInputListOnVertices(&ba[0],BathymetryEnum);
++	rho_water=matpar->GetRhoWater();
++	rho_ice=matpar->GetRhoIce();
++	density=rho_ice/rho_water;
++	
++	/*go through vertices, and update inputs, considering them to be PentaVertex type: */
++	for(i=0;i<NUMVERTICES;i++){
++		/*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
++		if(old_floating_ice[nodes[i]->Sid()]){
++			if(b[i]<=ba[i]){ 
++				b[i]=ba[i];
++				s[i]=b[i]+h[i];
++				nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false));
++				nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true));
++			}
++		}
++		/*Ice sheet: if hydrostatic bed above bathymetry, ice sheet starts to unground, elso do nothing */
++		/*Change only if AgressiveMigration or if the ice sheet is in contact with the ocean*/
++		else{
++			bed_hydro=-density*h[i];
++			if (bed_hydro>ba[i]){
++				/*Unground only if the element is connected to the ice shelf*/
++				if(migration_style==AgressiveMigrationEnum){
++					s[i]=(1-density)*h[i];
++					b[i]=-density*h[i];
++					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
++					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
++				}
++				else if(migration_style==SoftMigrationEnum && sheet_ungrounding[nodes[i]->Sid()]){
++					s[i]=(1-density)*h[i];
++					b[i]=-density*h[i];
++					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
++					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
++				}
++			}
++		}
++	}
++
++	/*If at least one vertex is now floating, the element is now floating*/
++	for(i=0;i<NUMVERTICES;i++){
++		if(nodes[i]->IsFloating()){
++			elementonshelf=true;
++			break;
++		}
++	}
++	
++   /*Add basal melting rate if element just ungrounded*/
++	if(!this->IsFloating() && elementonshelf==true){
++		for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
++		this->inputs->AddInput(new PentaP1Input(BasalforcingsMeltingRateEnum,&melting[0]));
++	} 
++
++	/*Update inputs*/
++	this->inputs->AddInput(new PentaP1Input(SurfaceEnum,&s[0]));
++	this->inputs->AddInput(new PentaP1Input(BedEnum,&b[0]));
++   this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
++
++	/*Extrude inputs*/
++	this->InputExtrude(SurfaceEnum,ElementEnum);
++	this->InputExtrude(BedEnum,ElementEnum);
++	this->InputExtrude(MaskElementonfloatingiceEnum,ElementEnum);
++	this->InputExtrude(MaskVertexonfloatingiceEnum,NodeEnum);
++	this->InputExtrude(MaskVertexongroundediceEnum,NodeEnum);
++}
++/*}}}*/
++/*FUNCTION Penta::MinEdgeLength{{{*/
++IssmDouble Penta::MinEdgeLength(IssmDouble xyz_list[6][3]){
++	/*Return the minimum lenght of the nine egdes of the penta*/
++
++	int    i,node0,node1;
++	int    edges[9][2]={{0,1},{0,2},{1,2},{3,4},{3,5},{4,5},{0,3},{1,4},{2,5}}; //list of the nine edges
++	IssmDouble length;
++	IssmDouble minlength=-1;
++
++	for(i=0;i<9;i++){
++		/*Find the two nodes for this edge*/
++		node0=edges[i][0];
++		node1=edges[i][1];
++
++		/*Compute the length of this edge and compare it to the minimal length*/
++		length=pow(pow(xyz_list[node0][0]-xyz_list[node1][0],2.0)+pow(xyz_list[node0][1]-xyz_list[node1][1],2.0)+pow(xyz_list[node0][2]-xyz_list[node1][2],2.0),0.5);
++		if(length<minlength || minlength<0) minlength=length;
++	}
++
++	return minlength;
++}
++/*}}}*/
++/*FUNCTION Penta::MyRank {{{*/
++int    Penta::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Penta::NodalValue {{{*/
++int    Penta::NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units){
++
++	int i;
++	int found=0;
++	IssmDouble value;
++	Input* data=NULL;
++	GaussPenta* gauss=NULL;
++
++	/*First, serarch the input: */
++	data=inputs->GetInput(natureofdataenum); 
++
++	/*figure out if we have the vertex id: */
++	found=0;
++	for(i=0;i<NUMVERTICES;i++){
++		if(index==nodes[i]->GetVertexId()){
++			/*Do we have natureofdataenum in our inputs? :*/
++			if(data){
++				/*ok, we are good. retrieve value of input at vertex :*/
++				gauss=new GaussPenta(); gauss->GaussVertex(i);
++				data->GetInputValue(&value,gauss);
++				found=1;
++				break;
++			}
++		}
++	}
++
++	delete gauss;
++	if(found)*pvalue=value;
++	return found;
++}
++/*}}}*/
++/*FUNCTION Penta::PatchFill{{{*/
++void  Penta::PatchFill(int* pcount, Patch* patch){
++
++	int i,count;
++	int vertices_ids[6];
++
++	/*recover pointer: */
++	count=*pcount;
++		
++	/*will be needed later: */
++	for(i=0;i<6;i++) vertices_ids[i]=nodes[i]->GetVertexId(); //vertices id start at column 3 of the patch.
++
++	for(i=0;i<this->results->Size();i++){
++		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
++
++		/*For this result,fill the information in the Patch object (element id + vertices ids), and then hand 
++		 *it to the result object, to fill the rest: */
++		patch->fillelementinfo(count,this->sid+1,vertices_ids,6);
++		elementresult->PatchFill(count,patch);
++
++		/*increment counter: */
++		count++;
++	}
++
++	/*Assign output pointers:*/
++	*pcount=count;
++}/*}}}*/
++/*FUNCTION Penta::PatchSize{{{*/
++void  Penta::PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes){
++
++	int     i;
++	int     numrows       = 0;
++	int     numnodes      = 0;
++	int     temp_numnodes = 0;
++
++	/*Go through all the results objects, and update the counters: */
++	for (i=0;i<this->results->Size();i++){
++		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
++		/*first, we have one more result: */
++		numrows++;
++		/*now, how many vertices and how many nodal values for this result? :*/
++		temp_numnodes=elementresult->NumberOfNodalValues(); //ask result object.
++		if(temp_numnodes>numnodes)numnodes=temp_numnodes;
++	}
++
++	/*Assign output pointers:*/
++	*pnumrows=numrows;
++	*pnumvertices=NUMVERTICES;
++	*pnumnodes=numnodes;
++}
++/*}}}*/
++/*FUNCTION Penta::PositiveDegreeDay{{{*/
++void  Penta::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm){
++
++   IssmDouble agd[NUMVERTICES];             // surface mass balance
++   IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
++   IssmDouble h[NUMVERTICES],s[NUMVERTICES]; // ,b
++   IssmDouble rho_water,rho_ice;
++
++   /*Recover monthly temperatures and precipitation*/
++   Input*     input=inputs->GetInput(SurfaceforcingsMonthlytemperaturesEnum); _assert_(input);
++   Input*     input2=inputs->GetInput(SurfaceforcingsPrecipitationEnum); _assert_(input2);
++   GaussPenta* gauss=new GaussPenta();
++   IssmDouble time,yts;
++   this->parameters->FindParam(&time,TimeEnum);
++   this->parameters->FindParam(&yts,ConstantsYtsEnum);
++   for(int month=0;month<12;month++) {
++     for(int iv=0;iv<NUMVERTICES;iv++) {
++       gauss->GaussVertex(iv);
++       input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts);
++       monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius
++       input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts);
++       monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++     }
++   } 
++
++  /*Recover info at the vertices: */
++  GetInputListOnVertices(&h[0],ThicknessEnum);
++  GetInputListOnVertices(&s[0],SurfaceEnum);
++
++  /*Get material parameters :*/
++  rho_ice=matpar->GetRhoIce();
++  rho_water=matpar->GetRhoFreshwater();
++
++   /*measure the surface mass balance*/
++   for (int iv = 0; iv < NUMVERTICES; iv++){
++     agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], pdds, pds, signorm, yts, h[iv], s[iv], rho_ice, rho_water);
++   }
++
++   /*Update inputs*/    
++   this->inputs->AddInput(new PentaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0]));
++   //this->inputs->AddInput(new PentaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
++   this->InputExtrude(SurfaceforcingsMassBalanceEnum,ElementEnum);
++
++	/*clean-up*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Penta::PotentialSheetUngrounding{{{*/
++void  Penta::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){
++
++	int     i;
++	IssmDouble  h[NUMVERTICES],ba[NUMVERTICES];
++	IssmDouble  bed_hydro;
++	IssmDouble  rho_water,rho_ice,density;
++	bool    elementonshelf = false;
++
++	/*material parameters: */
++	rho_water=matpar->GetRhoWater();
++	rho_ice=matpar->GetRhoIce();
++	density=rho_ice/rho_water;
++	GetInputListOnVertices(&h[0],ThicknessEnum);
++	GetInputListOnVertices(&ba[0],BathymetryEnum);
++
++	/*go through vertices, and figure out which ones are on the ice sheet, and want to unground: */
++	for(i=0;i<NUMVERTICES;i++){
++		/*Find if grounded vertices want to start floating*/
++		if (!nodes[i]->IsFloating()){
++			bed_hydro=-density*h[i];
++			if (bed_hydro>ba[i]){
++				/*Vertex that could potentially unground, flag it*/
++				potential_sheet_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
++			}
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::ProcessResultsUnits{{{*/
++void  Penta::ProcessResultsUnits(void){
++
++	int i;
++
++	for(i=0;i<this->results->Size();i++){
++		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
++		elementresult->ProcessUnits(this->parameters);
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::ReduceMatrixStokes {{{*/
++void Penta::ReduceMatrixStokes(IssmDouble* Ke_reduced, IssmDouble* Ke_temp){
++
++	int    i,j;
++	IssmDouble Kii[24][24];
++	IssmDouble Kib[24][3];
++	IssmDouble Kbb[3][3];
++	IssmDouble Kbi[3][24];
++	IssmDouble Kbbinv[3][3];
++	IssmDouble Kright[24][24];
++
++	/*Create the four matrices used for reduction */
++	for(i=0;i<24;i++){
++		for(j=0;j<24;j++){
++			Kii[i][j]=*(Ke_temp+27*i+j);
++		}
++		for(j=0;j<3;j++){
++			Kib[i][j]=*(Ke_temp+27*i+j+24);
++		}
++	}
++	for(i=0;i<3;i++){
++		for(j=0;j<24;j++){
++			Kbi[i][j]=*(Ke_temp+27*(i+24)+j);
++		}
++		for(j=0;j<3;j++){
++			Kbb[i][j]=*(Ke_temp+27*(i+24)+j+24);
++		}
++	}
++
++	/*Inverse the matrix corresponding to bubble part Kbb */
++	Matrix3x3Invert(&Kbbinv[0][0], &Kbb[0][0]);
++
++	/*Multiply matrices to create the reduce matrix Ke_reduced */
++	TripleMultiply(&Kib[0][0],24,3,0,
++				&Kbbinv[0][0],3,3,0,
++				&Kbi[0][0],3,24,0,
++				&Kright[0][0],0);
++
++	/*Affect value to the reduced matrix */
++	for(i=0;i<24;i++) for(j=0;j<24;j++) *(Ke_reduced+24*i+j)=Kii[i][j]-Kright[i][j];
++}
++/*}}}*/
++/*FUNCTION Penta::ReduceVectorStokes {{{*/
++void Penta::ReduceVectorStokes(IssmDouble* Pe_reduced, IssmDouble* Ke_temp, IssmDouble* Pe_temp){
++
++	int    i,j;
++	IssmDouble Pi[24];
++	IssmDouble Pb[3];
++	IssmDouble Kbb[3][3];
++	IssmDouble Kib[24][3];
++	IssmDouble Kbbinv[3][3];
++	IssmDouble Pright[24];
++
++	/*Create the four matrices used for reduction */
++	for(i=0;i<24;i++) Pi[i]=*(Pe_temp+i);
++	for(i=0;i<3;i++) Pb[i]=*(Pe_temp+i+24);
++	for(j=0;j<3;j++){
++		for(i=0;i<24;i++){
++			Kib[i][j]=*(Ke_temp+3*i+j);
++		}
++		for(i=0;i<3;i++){
++			Kbb[i][j]=*(Ke_temp+3*(i+24)+j);
++		}
++	}
++
++	/*Inverse the matrix corresponding to bubble part Kbb */
++	Matrix3x3Invert(&Kbbinv[0][0], &Kbb[0][0]);
++
++	/*Multiply matrices to create the reduce matrix Ke_reduced */
++	TripleMultiply(&Kib[0][0],24,3,0,
++				&Kbbinv[0][0],3,3,0,
++				&Pb[0],3,1,0,&Pright[0],0);
++
++	/*Affect value to the reduced matrix */
++	for(i=0;i<24;i++) *(Pe_reduced+i)=Pi[i]-Pright[i];
++}
++/*}}}*/
++/*FUNCTION Penta::RequestedOutput{{{*/
++void Penta::RequestedOutput(int output_enum,int step,IssmDouble time){
++			
++	if(IsInput(output_enum)){
++		/*just transfer this input to results, and we are done: */
++		InputToResult(output_enum,step,time);
++	}
++	else{
++		/*this input does not exist, compute it, and then transfer to results: */
++		switch(output_enum){
++			case BasalFrictionEnum:
++
++				/*create input: */
++				BasalFrictionCreateInput();
++
++				/*transfer to results :*/
++				InputToResult(output_enum,step,time);
++
++				/*erase input: */
++				inputs->DeleteInput(output_enum);
++				break;
++			case ViscousHeatingEnum:
++
++				/*create input: */
++				ViscousHeatingCreateInput();
++
++				/*transfer to results :*/
++				InputToResult(output_enum,step,time);
++
++				/*erase input: */
++				inputs->DeleteInput(output_enum);
++				break;
++
++			case StressTensorEnum: 
++				this->ComputeStressTensor();
++				InputToResult(StressTensorxxEnum,step,time);
++				InputToResult(StressTensorxyEnum,step,time);
++				InputToResult(StressTensorxzEnum,step,time);
++				InputToResult(StressTensoryyEnum,step,time);
++				InputToResult(StressTensoryzEnum,step,time);
++				InputToResult(StressTensorzzEnum,step,time);
++				break;
++
++			default:
++				/*do nothing, no need to derail the computation because one of the outputs requested cannot be found: */
++				break;
++		}
++	}
++
++}
++/*}}}*/
++/*FUNCTION Penta::ResetCoordinateSystem{{{*/
++void  Penta::ResetCoordinateSystem(void){
++
++	int    approximation;
++	IssmDouble slopex[NUMVERTICES];
++	IssmDouble slopey[NUMVERTICES];
++	IssmDouble xz_plane[6];
++
++	/*For Stokes only: we want the CS to be tangential to the bedrock*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(IsFloating() || !IsOnBed() || (approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum &&  approximation!=PattynStokesApproximationEnum)) return;
++
++	/*Get slope on each node*/
++	GetInputListOnVertices(&slopex[0],BedSlopeXEnum);
++	GetInputListOnVertices(&slopey[0],BedSlopeYEnum);
++
++	/*Loop over basal nodes (first 3) and update their CS*/
++	for(int i=0;i<NUMVERTICES2D;i++){
++
++		/*New X axis             New Z axis*/
++		xz_plane[0]=1.;          xz_plane[3]=-slopex[i];  
++		xz_plane[1]=0.;          xz_plane[4]=-slopey[i];  
++		xz_plane[2]=slopex[i];   xz_plane[5]=1.;          
++
++		XZvectorsToCoordinateSystem(&this->nodes[i]->coord_system[0][0],&xz_plane[0]);
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::SetClone {{{*/
++void  Penta::SetClone(int* minranks){
++
++	_error2_("not implemented yet");
++}
++/*}}}*/
++/*FUNCTION Penta::SetCurrentConfiguration {{{*/
++void  Penta::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
++
++	int analysis_counter;
++
++	/*go into parameters and get the analysis_counter: */
++	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
++
++	/*Get Element type*/
++	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;
++}
++/*}}}*/
++/*FUNCTION Penta::SpawnTria {{{*/
++Tria*  Penta::SpawnTria(int g0, int g1, int g2){
++
++	int   i,analysis_counter;
++	int   indices[3];
++	int   zero=0;
++	Tria*       tria            = NULL;
++	Inputs*     tria_inputs     = NULL;
++	Results*    tria_results    = NULL;
++	Parameters* tria_parameters = NULL;
++
++	/*go into parameters and get the analysis_counter: */
++	this->parameters->FindParam(&analysis_counter,AnalysisCounterEnum);
++
++	indices[0]=g0;
++	indices[1]=g1;
++	indices[2]=g2;
++
++	tria_parameters=this->parameters;
++	tria_inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices);
++	tria_results=(Results*)this->results->SpawnTriaResults(indices);
++
++	tria=new Tria();
++	tria->id=this->id;
++	tria->inputs=tria_inputs;
++	tria->results=tria_results;
++	tria->parameters=tria_parameters;
++	tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED)
++	this->SpawnTriaHook(dynamic_cast<TriaHook*>(tria),&indices[0]);
++
++	/*Spawn matice*/
++	tria->matice=NULL;
++	tria->matice=(Matice*)this->matice->copy();
++	delete tria->matice->inputs;
++	tria->matice->inputs=(Inputs*)this->matice->inputs->SpawnTriaInputs(indices);
++
++	/*recover nodes, matice and matpar: */
++	tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp();
++	tria->matpar=(Matpar*)tria->hmatpar->delivers();
++
++	return tria;
++}
++/*}}}*/
++/*FUNCTION Penta::SmbGradients{{{*/
++void Penta::SmbGradients(void){
++
++	int i;
++
++	// input
++   IssmDouble h[NUMVERTICES];					// ice thickness (m)		
++	IssmDouble s[NUMVERTICES];					// surface elevation (m)
++	IssmDouble a_pos[NUMVERTICES];				// Hs-SMB relation parameter 
++	IssmDouble b_pos[NUMVERTICES];				// Hs-SMB relation parameter
++	IssmDouble a_neg[NUMVERTICES];				// Hs-SMB relation parameter
++	IssmDouble b_neg[NUMVERTICES];				// Hs-SMB relation paremeter
++	IssmDouble Hc[NUMVERTICES];					// elevation of transition between accumulation regime and ablation regime
++	IssmDouble smb_pos_max[NUMVERTICES];		// maximum SMB value in the accumulation regime
++	IssmDouble smb_pos_min[NUMVERTICES];		// minimum SMB value in the accumulation regime
++   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(&Hc[0],SurfaceforcingsHcEnum);
++	GetInputListOnVertices(&smb_pos_max[0],SurfaceforcingsSmbPosMaxEnum);
++	GetInputListOnVertices(&smb_pos_min[0],SurfaceforcingsSmbPosMinEnum);
++	GetInputListOnVertices(&a_pos[0],SurfaceforcingsAPosEnum);
++	GetInputListOnVertices(&b_pos[0],SurfaceforcingsBPosEnum);
++	GetInputListOnVertices(&a_neg[0],SurfaceforcingsANegEnum);
++	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(s[i]>Hc[i]){
++	    smb[i]=a_pos[i]+b_pos[i]*s[i];
++		 if(smb[i]>smb_pos_max[i]){smb[i]=smb_pos_max[i];}
++		 if(smb[i]<smb_pos_min[i]){smb[i]=smb_pos_min[i];}
++	  }
++	  else{
++	    smb[i]=a_neg[i]+b_neg[i]*s[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 PentaP1Input(SurfaceforcingsMassBalanceEnum,&smb[0]));
++}
++/*}}}*/
++/*FUNCTION Penta::SurfaceArea {{{*/
++IssmDouble Penta::SurfaceArea(void){
++
++	int    approximation;
++	IssmDouble S;
++	Tria*  tria=NULL;
++
++	/*retrieve inputs :*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/*Bail out if this element if:
++	 * -> Non MacAyeal not on the surface
++	 * -> MacAyeal (2d model) and not on bed) */
++	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
++		return 0;
++	}
++	else if (approximation==MacAyealApproximationEnum){
++
++		/*This element should be collapsed into a tria element at its base. Create this tria element, 
++		 * and compute SurfaceArea*/
++		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
++		S=tria->SurfaceArea();
++		delete tria->matice; delete tria;
++		return S;
++	}
++	else{
++
++		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
++		S=tria->SurfaceArea();
++		delete tria->matice; delete tria;
++		return S;
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::SurfaceNormal {{{*/
++void Penta::SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]){
++
++	int    i;
++	IssmDouble v13[3],v23[3];
++	IssmDouble normal[3];
++	IssmDouble normal_norm;
++
++	for (i=0;i<3;i++){
++		v13[i]=xyz_list[0][i]-xyz_list[2][i];
++		v23[i]=xyz_list[1][i]-xyz_list[2][i];
++	}
++
++	normal[0]=v13[1]*v23[2]-v13[2]*v23[1];
++	normal[1]=v13[2]*v23[0]-v13[0]*v23[2];
++	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
++
++	normal_norm=sqrt( pow(normal[0],2)+pow(normal[1],2)+pow(normal[2],2) );
++
++	*(surface_normal)=normal[0]/normal_norm;
++	*(surface_normal+1)=normal[1]/normal_norm;
++	*(surface_normal+2)=normal[2]/normal_norm;
++}
++/*}}}*/
++/*FUNCTION Penta::TimeAdapt{{{*/
++IssmDouble  Penta::TimeAdapt(void){
++
++	int    i;
++	IssmDouble C,dx,dy,dz,dt;
++	IssmDouble maxabsvx,maxabsvy,maxabsvz;
++	IssmDouble maxx,minx,maxy,miny,maxz,minz;
++	IssmDouble xyz_list[NUMVERTICES][3];
++
++	/*get CFL coefficient:*/
++	this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
++
++	/*Get for Vx and Vy, the max of abs value: */
++	this->MaxAbsVx(&maxabsvx,false);
++	this->MaxAbsVy(&maxabsvy,false);
++	this->MaxAbsVz(&maxabsvz,false);
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], this->nodes, NUMVERTICES);
++
++	minx=xyz_list[0][0];
++	maxx=xyz_list[0][0];
++	miny=xyz_list[0][1];
++	maxy=xyz_list[0][1];
++	minz=xyz_list[0][2];
++	maxz=xyz_list[0][2];
++	
++	for(i=1;i<NUMVERTICES;i++){
++		if (xyz_list[i][0]<minx)minx=xyz_list[i][0];
++		if (xyz_list[i][0]>maxx)maxx=xyz_list[i][0];
++		if (xyz_list[i][1]<miny)miny=xyz_list[i][1];
++		if (xyz_list[i][1]>maxy)maxy=xyz_list[i][1];
++		if (xyz_list[i][2]<minz)minz=xyz_list[i][2];
++		if (xyz_list[i][2]>maxz)maxz=xyz_list[i][2];
++	}
++	dx=maxx-minx;
++	dy=maxy-miny;
++	dz=maxz-minz;
++
++	/*CFL criterion: */
++	dt=C/(maxabsvy/dx+maxabsvy/dy+maxabsvz/dz);
++
++	return dt;
++}/*}}}*/
++/*FUNCTION Penta::Update(int index,IoModel* iomodel,int analysis_counter,int analysis_type) {{{*/
++void Penta::Update(int index,IoModel* iomodel,int analysis_counter,int analysis_type){ 
++
++	/*Intermediaries*/
++	IssmInt i,j;
++	int     penta_type;
++	int     penta_node_ids[6];
++	int     penta_vertex_ids[6];
++	IssmDouble  nodeinputs[6];
++	IssmDouble  yts;
++	int     stabilization;
++	bool    dakota_analysis;
++	bool    isstokes;
++	IssmDouble  beta,heatcapacity,referencetemperature,meltingpoint,latentheat;
++
++	/*Fetch parameters: */
++	iomodel->Constant(&yts,ConstantsYtsEnum);
++	iomodel->Constant(&stabilization,PrognosticStabilizationEnum);
++	iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum);
++	iomodel->Constant(&isstokes,FlowequationIsstokesEnum);
++	iomodel->Constant(&beta,MaterialsBetaEnum);
++	iomodel->Constant(&heatcapacity,MaterialsHeatcapacityEnum);
++	iomodel->Constant(&referencetemperature,ConstantsReferencetemperatureEnum);
++	iomodel->Constant(&meltingpoint,MaterialsMeltingpointEnum);
++	iomodel->Constant(&latentheat,MaterialsLatentheatEnum);
++
++	/*Checks if debuging*/
++	/*{{{*/
++	_assert_(iomodel->Data(MeshElementsEnum));
++	/*}}}*/
++
++	/*Recover element type*/
++	if ((analysis_type==PrognosticAnalysisEnum || analysis_type==BalancethicknessAnalysisEnum) && stabilization==3){
++		/*P1 Discontinuous Galerkin*/
++		penta_type=P1DGEnum;
++	}
++	else{
++		/*P1 Continuous Galerkin*/
++		penta_type=P1Enum;
++	}
++	this->SetElementType(penta_type,analysis_counter);
++
++	/*Recover vertices ids needed to initialize inputs*/
++	for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
++
++	/*Recover nodes ids needed to initialize the node hook.*/
++	for(i=0;i<6;i++){ 
++		//go recover node ids, needed to initialize the node hook.
++		//WARNING: We assume P1 elements here!!!!!
++		penta_node_ids[i]=iomodel->nodecounter+(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
++	}
++
++	/*hooks: */
++	this->SetHookNodes(penta_node_ids,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type
++
++	/*Fill with IoModel*/
++	this->InputUpdateFromIoModel(index,iomodel);
++
++	/*Defaults if not provided in iomodel*/
++	switch(analysis_type){
++
++		case DiagnosticHorizAnalysisEnum:
++
++			/*default vx,vy and vz: either observation or 0 */
++			if(!iomodel->Data(VxEnum)){
++				for(i=0;i<6;i++)nodeinputs[i]=0;
++				this->inputs->AddInput(new PentaP1Input(VxEnum,nodeinputs));
++				if(dakota_analysis) this->inputs->AddInput(new PentaP1Input(QmuVxEnum,nodeinputs));
++			}
++			if(!iomodel->Data(VyEnum)){
++				for(i=0;i<6;i++)nodeinputs[i]=0;
++				this->inputs->AddInput(new PentaP1Input(VyEnum,nodeinputs));
++				if(dakota_analysis) this->inputs->AddInput(new PentaP1Input(QmuVyEnum,nodeinputs));
++			}
++			if(!iomodel->Data(VzEnum)){
++				for(i=0;i<6;i++)nodeinputs[i]=0;
++				this->inputs->AddInput(new PentaP1Input(VzEnum,nodeinputs));
++				if(dakota_analysis) this->inputs->AddInput(new PentaP1Input(QmuVzEnum,nodeinputs));
++			}
++			if(!iomodel->Data(PressureEnum)){
++				for(i=0;i<6;i++)nodeinputs[i]=0;
++				if(dakota_analysis){
++					this->inputs->AddInput(new PentaP1Input(PressureEnum,nodeinputs));
++					this->inputs->AddInput(new PentaP1Input(QmuPressureEnum,nodeinputs));
++				}
++				if(isstokes){
++					this->inputs->AddInput(new PentaP1Input(PressureEnum,nodeinputs));
++					this->inputs->AddInput(new PentaP1Input(PressurePicardEnum,nodeinputs));
++				}
++			}
++			if(*(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynStokesApproximationEnum){
++				/*Create VzPattyn and VzStokes Enums*/
++				if(iomodel->Data(VzEnum) && iomodel->Data(FlowequationBorderstokesEnum)){
++					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1];
++					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
++					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1]);
++					this->inputs->AddInput(new PentaP1Input(VzPattynEnum,nodeinputs));
++				}
++				else{
++					for(i=0;i<6;i++)nodeinputs[i]=0;
++					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
++					this->inputs->AddInput(new PentaP1Input(VzPattynEnum,nodeinputs));
++				}
++			}
++			if(*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealStokesApproximationEnum){
++				/*Create VzMacAyeal and VzStokes Enums*/
++				if(iomodel->Data(VzEnum) && iomodel->Data(FlowequationBorderstokesEnum)){
++					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1];
++					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
++					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1]);
++					this->inputs->AddInput(new PentaP1Input(VzMacAyealEnum,nodeinputs));
++				}
++				else{
++					for(i=0;i<6;i++)nodeinputs[i]=0;
++					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
++					this->inputs->AddInput(new PentaP1Input(VzMacAyealEnum,nodeinputs));
++				}
++			}
++			break;
++
++		case ThermalAnalysisEnum:
++			/*Initialize mesh velocity*/
++			for(i=0;i<6;i++)nodeinputs[i]=0;
++			this->inputs->AddInput(new PentaP1Input(VxMeshEnum,nodeinputs));
++			this->inputs->AddInput(new PentaP1Input(VyMeshEnum,nodeinputs));
++			this->inputs->AddInput(new PentaP1Input(VzMeshEnum,nodeinputs));
++			break;
++
++		case EnthalpyAnalysisEnum:
++			/*Initialize mesh velocity*/
++			for(i=0;i<6;i++)nodeinputs[i]=0;
++			this->inputs->AddInput(new PentaP1Input(VxMeshEnum,nodeinputs));
++			this->inputs->AddInput(new PentaP1Input(VyMeshEnum,nodeinputs));
++			this->inputs->AddInput(new PentaP1Input(VzMeshEnum,nodeinputs));
++			if (iomodel->Data(TemperatureEnum) && iomodel->Data(WaterfractionEnum) && iomodel->Data(PressureEnum)) {
++				for(i=0;i<6;i++){
++					if(iomodel->Data(TemperatureEnum)[penta_vertex_ids[i]-1] < meltingpoint-beta*iomodel->Data(PressureEnum)[penta_vertex_ids[i]-1]){
++						nodeinputs[i]=heatcapacity*(iomodel->Data(TemperatureEnum)[penta_vertex_ids[i]-1]-referencetemperature);
++					}
++					else nodeinputs[i]=heatcapacity*
++					 (meltingpoint-beta*iomodel->Data(PressureEnum)[penta_vertex_ids[i]-1]-referencetemperature)
++						+latentheat*iomodel->Data(WaterfractionEnum)[penta_vertex_ids[i]-1];
++				}
++				this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,nodeinputs));
++			}
++			else _error2_("temperature and waterfraction required for the enthalpy solution");
++			break;
++
++		default:
++			/*No update for other solution types*/
++			break;
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::UpdatePotentialSheetUngrounding{{{*/
++int Penta::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
++
++	int i;
++	int nflipped=0;
++
++	/*Go through nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */
++	for(i=0;i<NUMVERTICES;i++){
++		if (vertices_potentially_ungrounding[nodes[i]->Sid()]){
++			vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
++		
++			/*If node was not on ice shelf, we flipped*/
++			if(nodes_on_iceshelf[nodes[i]->Sid()]==0){
++				nflipped++;
++			}
++		}
++	}
++	return nflipped;
++}
++/*}}}*/
++/*FUNCTION Penta::ViscousHeatingCreateInput {{{*/
++void Penta::ViscousHeatingCreateInput(void){
++
++	/*Constants*/
++	const int  numdof=NUMVERTICES*NDOF1;
++
++	/*Intermediaries*/
++	int    iv;
++	IssmDouble phi;
++	IssmDouble viscosity;
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble epsilon[6];
++	IssmDouble     viscousheating[NUMVERTICES]={0,0,0,0,0,0};
++	IssmDouble     thickness;
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	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* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
++
++	/*loop over vertices: */
++	gauss=new GaussPenta();
++	for (int iv=0;iv<NUMVERTICES;iv++){
++		gauss->GaussVertex(iv);
++		
++		thickness_input->GetInputValue(&thickness,gauss);
++
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		GetPhi(&phi, &epsilon[0], viscosity);
++		
++
++		viscousheating[iv]=phi*thickness;
++	}
++
++	/*Create PentaVertex input, which will hold the basal friction:*/
++	this->inputs->AddInput(new PentaP1Input(ViscousHeatingEnum,&viscousheating[0]));
++
++	/*Clean up and return*/
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Penta::SmearFunction {{{*/
++void  Penta::SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
++	_error2_("not implemented yet");
++}
++/*}}}*/
++
++#ifdef _HAVE_RESPONSES_
++/*FUNCTION Penta::IceVolume {{{*/
++IssmDouble Penta::IceVolume(void){
++
++	/*The volume of a troncated prism is base * 1/3 sum(length of edges)*/
++	IssmDouble base,height;
++	IssmDouble xyz_list[NUMVERTICES][3];
++
++	if(IsOnWater())return 0;
++
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*First calculate the area of the base (cross section triangle)
++	 * http://en.wikipedia.org/wiki/Pentangle
++	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
++	base = 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
++
++	/*Now get the average height*/
++	height = 1./3.*((xyz_list[3][2]-xyz_list[0][2])+(xyz_list[4][2]-xyz_list[1][2])+(xyz_list[5][2]-xyz_list[2][2]));
++
++	/*Return: */
++	return base*height;
++}
++/*}}}*/
++/*FUNCTION Penta::MinVel{{{*/
++void  Penta::MinVel(IssmDouble* pminvel, bool process_units){
++
++	/*Get minimum:*/
++	IssmDouble minvel=this->inputs->Min(VelEnum);
++
++	/*process units if requested: */
++	if(process_units) minvel=UnitConversion(minvel,IuToExtEnum,VelEnum);
++
++	/*Assign output pointers:*/
++	*pminvel=minvel;
++}
++/*}}}*/
++/*FUNCTION Penta::MinVx{{{*/
++void  Penta::MinVx(IssmDouble* pminvx, bool process_units){
++
++	/*Get minimum:*/
++	IssmDouble minvx=this->inputs->Min(VxEnum);
++
++	/*process units if requested: */
++	if(process_units) minvx=UnitConversion(minvx,IuToExtEnum,VxEnum);
++
++	/*Assign output pointers:*/
++	*pminvx=minvx;
++}
++/*}}}*/
++/*FUNCTION Penta::MinVy{{{*/
++void  Penta::MinVy(IssmDouble* pminvy, bool process_units){
++
++	/*Get minimum:*/
++	IssmDouble minvy=this->inputs->Min(VyEnum);
++
++	/*process units if requested: */
++	if(process_units) minvy=UnitConversion(minvy,IuToExtEnum,VyEnum);
++
++	/*Assign output pointers:*/
++	*pminvy=minvy;
++}
++/*}}}*/
++/*FUNCTION Penta::MinVz{{{*/
++void  Penta::MinVz(IssmDouble* pminvz, bool process_units){
++
++	/*Get minimum:*/
++	IssmDouble minvz=this->inputs->Min(VzEnum);
++
++	/*process units if requested: */
++	if(process_units) minvz=UnitConversion(minvz,IuToExtEnum,VzEnum);
++
++	/*Assign output pointers:*/
++	*pminvz=minvz;
++}
++/*}}}*/
++/*FUNCTION Penta::MassFlux {{{*/
++IssmDouble Penta::MassFlux( IssmDouble* segment,bool process_units){
++
++	IssmDouble mass_flux=0;
++
++	if(!IsOnBed()) return mass_flux;
++
++	/*Depth Averaging Vx and Vy*/
++	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
++	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
++
++	/*Spawn Tria element from the base of the Penta: */
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	mass_flux=tria->MassFlux(segment,process_units);
++	delete tria->matice; delete tria;
++
++	/*Delete Vx and Vy averaged*/
++	this->inputs->DeleteInput(VxAverageEnum);
++	this->inputs->DeleteInput(VyAverageEnum);
++
++	/*clean up and return*/
++	return mass_flux;
++}
++/*}}}*/
++/*FUNCTION Penta::MaxAbsVx{{{*/
++void  Penta::MaxAbsVx(IssmDouble* pmaxabsvx, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxabsvx=this->inputs->MaxAbs(VxEnum);
++
++	/*process units if requested: */
++	if(process_units) maxabsvx=UnitConversion(maxabsvx,IuToExtEnum,VxEnum);
++
++	/*Assign output pointers:*/
++	*pmaxabsvx=maxabsvx;
++}
++/*}}}*/
++/*FUNCTION Penta::MaxAbsVy{{{*/
++void  Penta::MaxAbsVy(IssmDouble* pmaxabsvy, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxabsvy=this->inputs->MaxAbs(VyEnum);
++
++	/*process units if requested: */
++	if(process_units) maxabsvy=UnitConversion(maxabsvy,IuToExtEnum,VyEnum);
++
++	/*Assign output pointers:*/
++	*pmaxabsvy=maxabsvy;
++}
++/*}}}*/
++/*FUNCTION Penta::MaxAbsVz{{{*/
++void  Penta::MaxAbsVz(IssmDouble* pmaxabsvz, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxabsvz=this->inputs->MaxAbs(VzEnum);
++
++	/*process units if requested: */
++	if(process_units) maxabsvz=UnitConversion(maxabsvz,IuToExtEnum,VyEnum);
++
++	/*Assign output pointers:*/
++	*pmaxabsvz=maxabsvz;
++}
++/*}}}*/
++/*FUNCTION Penta::MaxVel{{{*/
++void  Penta::MaxVel(IssmDouble* pmaxvel, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxvel=this->inputs->Max(VelEnum);
++
++	/*process units if requested: */
++	if(process_units) maxvel=UnitConversion(maxvel,IuToExtEnum,VelEnum);
++
++	/*Assign output pointers:*/
++	*pmaxvel=maxvel;
++
++}
++/*}}}*/
++/*FUNCTION Penta::MaxVx{{{*/
++void  Penta::MaxVx(IssmDouble* pmaxvx, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxvx=this->inputs->Max(VxEnum);
++
++	/*process units if requested: */
++	if(process_units) maxvx=UnitConversion(maxvx,IuToExtEnum,VxEnum);
++
++	/*Assign output pointers:*/
++	*pmaxvx=maxvx;
++}
++/*}}}*/
++/*FUNCTION Penta::MaxVy{{{*/
++void  Penta::MaxVy(IssmDouble* pmaxvy, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxvy=this->inputs->Max(VyEnum);
++
++	/*process units if requested: */
++	if(process_units) maxvy=UnitConversion(maxvy,IuToExtEnum,VyEnum);
++
++	/*Assign output pointers:*/
++	*pmaxvy=maxvy;
++}
++/*}}}*/
++/*FUNCTION Penta::MaxVz{{{*/
++void  Penta::MaxVz(IssmDouble* pmaxvz, bool process_units){
++
++	/*Get maximum:*/
++	IssmDouble maxvz=this->inputs->Max(VzEnum);
++
++	/*process units if requested: */
++	if(process_units) maxvz=UnitConversion(maxvz,IuToExtEnum,VzEnum);
++
++	/*Assign output pointers:*/
++	*pmaxvz=maxvz;
++}
++/*}}}*/
++/*FUNCTION Penta::ElementResponse{{{*/
++void Penta::ElementResponse(IssmDouble* presponse,int response_enum,bool process_units){
++
++	switch(response_enum){
++		case MaterialsRheologyBbarEnum:
++			*presponse=this->matice->GetBbar();
++			break;
++		case VelEnum:
++
++			/*Get input:*/
++			IssmDouble vel;
++			Input* vel_input;
++
++			vel_input=this->inputs->GetInput(VelEnum); _assert_(vel_input);
++			vel_input->GetInputAverage(&vel);
++
++			/*process units if requested: */
++			if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum);
++
++			/*Assign output pointers:*/
++			*presponse=vel;
++		default:  
++			_error2_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
++	}
++
++}
++/*}}}*/
++/*FUNCTION Penta::TotalSmb {{{*/
++IssmDouble Penta::TotalSmb(void){
++
++	/*The smb[Gt yr-1] of one element is area[m2] * smb [ m ice yr^-1] * rho_ice [kg m-3] / 1e+10^12 */
++	IssmDouble base,smb,rho_ice;
++	IssmDouble Total_Smb=0;
++	IssmDouble xyz_list[NUMVERTICES][3];
++
++	/*Get material parameters :*/
++	rho_ice=matpar->GetRhoIce();
++
++	if(IsOnWater() || !IsOnSurface()) return 0.;
++	
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*First calculate the area of the base (cross section triangle)
++	 * http://en.wikipedia.org/wiki/Triangle
++	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
++	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
++
++	/*Now get the average SMB over the element*/
++	Input* smb_input = inputs->GetInput(SurfaceforcingsMassBalanceEnum); _assert_(smb_input);
++	smb_input->GetInputAverage(&smb);
++	Total_Smb=rho_ice*base*smb;// smb on element in kg s-1
++	
++	/*Process units: */
++	Total_Smb=UnitConversion(Total_Smb,IuToExtEnum,TotalSmbEnum);// smb on element in GigaTon yr-1
++	
++	/*Return: */
++	return Total_Smb;
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_THERMAL_
++/*FUNCTION Penta::CreateKMatrixEnthalpy {{{*/
++ElementMatrix* Penta::CreateKMatrixEnthalpy(void){
++	
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixEnthalpyVolume();
++	ElementMatrix* Ke2=CreateKMatrixEnthalpyShelf();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
++	
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixEnthalpyVolume {{{*/
++ElementMatrix* Penta::CreateKMatrixEnthalpyVolume(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int        stabilization;
++	int        i,j,ig,found=0;
++	IssmDouble     Jdet,u,v,w,um,vm,wm;
++	IssmDouble     h,hx,hy,hz,vx,vy,vz,vel;
++	IssmDouble     gravity,rho_ice,rho_water;
++	IssmDouble     epsvel=2.220446049250313e-16;
++	IssmDouble     heatcapacity,thermalconductivity,dt;
++	IssmDouble     pressure,enthalpy;
++	IssmDouble     latentheat,kappa;
++	IssmDouble     tau_parameter,diameter;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     B_conduct[3][numdof];
++	IssmDouble     B_advec[3][numdof];
++	IssmDouble     Bprime_advec[3][numdof];
++	IssmDouble     L[numdof];
++	IssmDouble     dbasis[3][6];
++	IssmDouble     D_scalar_conduct,D_scalar_advec;
++	IssmDouble     D_scalar_trans,D_scalar_stab;
++	IssmDouble     D[3][3];
++	IssmDouble     K[3][3]={0.0};
++	Tria*      tria=NULL;
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	rho_water=matpar->GetRhoWater();
++	rho_ice=matpar->GetRhoIce();
++	gravity=matpar->GetG();
++	heatcapacity=matpar->GetHeatCapacity();
++	latentheat=matpar->GetLatentHeat();
++	thermalconductivity=matpar->GetThermalConductivity();
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
++	Input* pressure_input=inputs->GetInput(PressureEnum);      _assert_(pressure_input);
++	Input* enthalpy_input=inputs->GetInput(EnthalpyPicardEnum);_assert_(enthalpy_input); //for this iteration of the step
++	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* vxm_input=inputs->GetInput(VxMeshEnum);             _assert_(vxm_input);
++	Input* vym_input=inputs->GetInput(VyMeshEnum);             _assert_(vym_input);
++	Input* vzm_input=inputs->GetInput(VzMeshEnum);             _assert_(vzm_input);
++	if (stabilization==2) diameter=MinEdgeLength(xyz_list);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Conduction: */  
++		/*Need to change that depending on enthalpy value -> cold or temperate ice: */  
++		GetBConduct(&B_conduct[0][0],&xyz_list[0][0],gauss); 
++
++		enthalpy_input->GetInputValue(&enthalpy, gauss);
++		pressure_input->GetInputValue(&pressure, gauss);
++		kappa=matpar->GetEnthalpyDiffusionParameter(enthalpy,pressure);
++		D_scalar_conduct=gauss->weight*Jdet*kappa;
++		if(dt) D_scalar_conduct=D_scalar_conduct*dt;
++
++		D[0][0]=D_scalar_conduct; D[0][1]=0; D[0][2]=0;
++		D[1][0]=0; D[1][1]=D_scalar_conduct; D[1][2]=0;
++		D[2][0]=0; D[2][1]=0; D[2][2]=D_scalar_conduct;
++
++		TripleMultiply(&B_conduct[0][0],3,numdof,1,
++					&D[0][0],3,3,0,
++					&B_conduct[0][0],3,numdof,0,
++					&Ke->values[0],1);
++
++		/*Advection: */
++		GetBAdvec(&B_advec[0][0],&xyz_list[0][0],gauss); 
++		GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
++
++		vx_input->GetInputValue(&u, gauss); vxm_input->GetInputValue(&um,gauss); vx=u-um; 
++		vy_input->GetInputValue(&v, gauss); vym_input->GetInputValue(&vm,gauss); vy=v-vm; 
++		vz_input->GetInputValue(&w, gauss); vzm_input->GetInputValue(&wm,gauss); vz=w-wm;
++
++		D_scalar_advec=gauss->weight*Jdet;
++		if(dt) D_scalar_advec=D_scalar_advec*dt;
++
++		D[0][0]=D_scalar_advec*vx;D[0][1]=0;                D[0][2]=0;
++		D[1][0]=0;                D[1][1]=D_scalar_advec*vy;D[1][2]=0;
++		D[2][0]=0;                D[2][1]=0;                D[2][2]=D_scalar_advec*vz;
++
++		TripleMultiply(&B_advec[0][0],3,numdof,1,
++					&D[0][0],3,3,0,
++					&Bprime_advec[0][0],3,numdof,0,
++					&Ke->values[0],1);
++
++		/*Transient: */
++		if(dt){
++			GetNodalFunctionsP1(&L[0], gauss);
++			D_scalar_trans=gauss->weight*Jdet;
++			D_scalar_trans=D_scalar_trans;
++
++			TripleMultiply(&L[0],numdof,1,0,
++						&D_scalar_trans,1,1,0,
++						&L[0],1,numdof,0,
++						&Ke->values[0],1);
++		}
++
++		/*Artifficial diffusivity*/
++		if(stabilization==1){
++			/*Build K: */
++			GetElementSizes(&hx,&hy,&hz);
++			vel=sqrt(pow(vx,2.)+pow(vy,2.)+pow(vz,2.))+1.e-14;
++			h=sqrt( pow(hx*vx/vel,2.) + pow(hy*vy/vel,2.) + pow(hz*vz/vel,2.));
++			K[0][0]=h/(2*vel)*vx*vx;  K[0][1]=h/(2*vel)*vx*vy; K[0][2]=h/(2*vel)*vx*vz;
++			K[1][0]=h/(2*vel)*vy*vx;  K[1][1]=h/(2*vel)*vy*vy; K[1][2]=h/(2*vel)*vy*vz;
++			K[2][0]=h/(2*vel)*vz*vx;  K[2][1]=h/(2*vel)*vz*vy; K[2][2]=h/(2*vel)*vz*vz;
++			D_scalar_stab=gauss->weight*Jdet;
++			if(dt) D_scalar_stab=D_scalar_stab*dt;
++			for(i=0;i<3;i++) for(j=0;j<3;j++) K[i][j] = D_scalar_stab*K[i][j];
++
++			GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
++
++			TripleMultiply(&Bprime_advec[0][0],3,numdof,1,
++						&K[0][0],3,3,0,
++						&Bprime_advec[0][0],3,numdof,0,
++						&Ke->values[0],1);
++		}
++		else if(stabilization==2){
++			GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
++			tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter,kappa);
++
++			for(i=0;i<numdof;i++){
++				for(j=0;j<numdof;j++){
++					Ke->values[i*numdof+j]+=tau_parameter*D_scalar_advec*
++					  ((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i])*((u-um)*dbasis[0][j]+(v-vm)*dbasis[1][j]+(w-wm)*dbasis[2][j]);
++				}
++			}
++			if(dt){
++				for(i=0;i<numdof;i++){
++					for(j=0;j<numdof;j++){
++						Ke->values[i*numdof+j]+=tau_parameter*D_scalar_trans*L[j]*((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i]);
++					}
++				}
++			}
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixEnthalpyShelf {{{*/
++ElementMatrix* Penta::CreateKMatrixEnthalpyShelf(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int       i,j,ig;
++	IssmDouble    mixed_layer_capacity,thermal_exchange_velocity;
++	IssmDouble    rho_ice,rho_water,heatcapacity;
++	IssmDouble    Jdet2d,dt;
++	IssmDouble    xyz_list[NUMVERTICES][3];
++	IssmDouble	 xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble    basis[NUMVERTICES];
++	IssmDouble    D_scalar;
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element matrix and return if necessary*/
++	if (!IsOnBed() || !IsFloating()) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	mixed_layer_capacity=matpar->GetMixedLayerCapacity();
++	thermal_exchange_velocity=matpar->GetThermalExchangeVelocity();
++	rho_water=matpar->GetRhoWater();
++	rho_ice=matpar->GetRhoIce();
++	heatcapacity=matpar->GetHeatCapacity();
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++
++	/* Start looping on the number of gauss (nodes on the bedrock) */
++	gauss=new GaussPenta(0,1,2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++		
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
++		GetNodalFunctionsP1(&basis[0], gauss);
++				
++		D_scalar=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(rho_ice*heatcapacity);
++		if(dt) D_scalar=dt*D_scalar;
++
++		TripleMultiply(&basis[0],numdof,1,0,
++					&D_scalar,1,1,0,
++					&basis[0],1,numdof,0,
++					&Ke->values[0],1);
++	}
++	
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixMelting {{{*/
++ElementMatrix* Penta::CreateKMatrixMelting(void){
++
++	if (!IsOnBed()) return NULL;
++
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementMatrix* Ke=tria->CreateKMatrixMelting();
++
++	delete tria->matice; delete tria;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixThermal {{{*/
++ElementMatrix* Penta::CreateKMatrixThermal(void){
++	
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixThermalVolume();
++	ElementMatrix* Ke2=CreateKMatrixThermalShelf();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
++	
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixThermalVolume {{{*/
++ElementMatrix* Penta::CreateKMatrixThermalVolume(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int        stabilization;
++	int        i,j,ig,found=0;
++	IssmDouble     Jdet,u,v,w,um,vm,wm,vel;
++	IssmDouble     h,hx,hy,hz,vx,vy,vz;
++	IssmDouble     gravity,rho_ice,rho_water,kappa;
++	IssmDouble     heatcapacity,thermalconductivity,dt;
++	IssmDouble     tau_parameter,diameter;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     B_conduct[3][numdof];
++	IssmDouble     B_advec[3][numdof];
++	IssmDouble     Bprime_advec[3][numdof];
++	IssmDouble     L[numdof];
++	IssmDouble     dbasis[3][6];
++	IssmDouble     D_scalar_conduct,D_scalar_advec;
++	IssmDouble     D_scalar_trans,D_scalar_stab;
++	IssmDouble     D[3][3];
++	IssmDouble     K[3][3]={0.0};
++	Tria*      tria=NULL;
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	rho_water=matpar->GetRhoWater();
++	rho_ice=matpar->GetRhoIce();
++	gravity=matpar->GetG();
++	heatcapacity=matpar->GetHeatCapacity();
++	thermalconductivity=matpar->GetThermalConductivity();
++	kappa=thermalconductivity/(rho_ice*heatcapacity);
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
++	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* vxm_input=inputs->GetInput(VxMeshEnum); _assert_(vxm_input);
++	Input* vym_input=inputs->GetInput(VyMeshEnum); _assert_(vym_input);
++	Input* vzm_input=inputs->GetInput(VzMeshEnum); _assert_(vzm_input);
++	if (stabilization==2) diameter=MinEdgeLength(xyz_list);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Conduction: */
++
++		GetBConduct(&B_conduct[0][0],&xyz_list[0][0],gauss); 
++
++		D_scalar_conduct=gauss->weight*Jdet*kappa;
++		if(dt) D_scalar_conduct=D_scalar_conduct*dt;
++
++		D[0][0]=D_scalar_conduct; D[0][1]=0; D[0][2]=0;
++		D[1][0]=0; D[1][1]=D_scalar_conduct; D[1][2]=0;
++		D[2][0]=0; D[2][1]=0; D[2][2]=D_scalar_conduct;
++
++		TripleMultiply(&B_conduct[0][0],3,numdof,1,
++					&D[0][0],3,3,0,
++					&B_conduct[0][0],3,numdof,0,
++					&Ke->values[0],1);
++
++		/*Advection: */
++
++		GetBAdvec(&B_advec[0][0],&xyz_list[0][0],gauss); 
++		GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
++
++		vx_input->GetInputValue(&u, gauss); vxm_input->GetInputValue(&um,gauss); vx=u-um;
++		vy_input->GetInputValue(&v, gauss); vym_input->GetInputValue(&vm,gauss); vy=v-vm;
++		vz_input->GetInputValue(&w, gauss); vzm_input->GetInputValue(&wm,gauss); vz=w-wm;
++
++		D_scalar_advec=gauss->weight*Jdet;
++		if(dt) D_scalar_advec=D_scalar_advec*dt;
++
++		D[0][0]=D_scalar_advec*vx;    D[0][1]=0;                    D[0][2]=0;
++		D[1][0]=0;                    D[1][1]=D_scalar_advec*vy;    D[1][2]=0;
++		D[2][0]=0;                    D[2][1]=0;                    D[2][2]=D_scalar_advec*vz;
++
++		TripleMultiply(&B_advec[0][0],3,numdof,1,
++					&D[0][0],3,3,0,
++					&Bprime_advec[0][0],3,numdof,0,
++					&Ke->values[0],1);
++
++		/*Transient: */
++		if(dt){
++			GetNodalFunctionsP1(&L[0], gauss);
++			D_scalar_trans=gauss->weight*Jdet;
++			D_scalar_trans=D_scalar_trans;
++
++			TripleMultiply(&L[0],numdof,1,0,
++						&D_scalar_trans,1,1,0,
++						&L[0],1,numdof,0,
++						&Ke->values[0],1);
++		}
++
++		/*Artifficial diffusivity*/
++		if(stabilization==1){
++			/*Build K: */
++			GetElementSizes(&hx,&hy,&hz);
++			vel=sqrt(pow(vx,2.)+pow(vy,2.)+pow(vz,2.))+1.e-14;
++			h=sqrt( pow(hx*vx/vel,2.) + pow(hy*vy/vel,2.) + pow(hz*vz/vel,2.));
++
++			K[0][0]=h/(2*vel)*fabs(vx*vx);  K[0][1]=h/(2*vel)*fabs(vx*vy); K[0][2]=h/(2*vel)*fabs(vx*vz);
++			K[1][0]=h/(2*vel)*fabs(vy*vx);  K[1][1]=h/(2*vel)*fabs(vy*vy); K[1][2]=h/(2*vel)*fabs(vy*vz);
++			K[2][0]=h/(2*vel)*fabs(vz*vx);  K[2][1]=h/(2*vel)*fabs(vz*vy); K[2][2]=h/(2*vel)*fabs(vz*vz);
++
++			D_scalar_stab=gauss->weight*Jdet;
++			if(dt) D_scalar_stab=D_scalar_stab*dt;
++			for(i=0;i<3;i++) for(j=0;j<3;j++) K[i][j] = D_scalar_stab*K[i][j];
++
++			GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
++
++			TripleMultiply(&Bprime_advec[0][0],3,numdof,1,
++						&K[0][0],3,3,0,
++						&Bprime_advec[0][0],3,numdof,0,
++						&Ke->values[0],1);
++		}
++		else if(stabilization==2){
++			GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
++			tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter,kappa);
++
++			for(i=0;i<numdof;i++){
++				for(j=0;j<numdof;j++){
++					Ke->values[i*numdof+j]+=tau_parameter*D_scalar_advec*
++					  ((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i])*((u-um)*dbasis[0][j]+(v-vm)*dbasis[1][j]+(w-wm)*dbasis[2][j]);
++				}
++			}
++			if(dt){
++				for(i=0;i<numdof;i++){
++					for(j=0;j<numdof;j++){
++						Ke->values[i*numdof+j]+=tau_parameter*D_scalar_trans*L[j]*((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i]);
++					}
++				}
++			}
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixThermalShelf {{{*/
++ElementMatrix* Penta::CreateKMatrixThermalShelf(void){
++
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int       i,j,ig;
++	IssmDouble    mixed_layer_capacity,thermal_exchange_velocity;
++	IssmDouble    rho_ice,rho_water,heatcapacity;
++	IssmDouble    Jdet2d,dt;
++	IssmDouble    xyz_list[NUMVERTICES][3];
++	IssmDouble	 xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble    basis[NUMVERTICES];
++	IssmDouble    D_scalar;
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element matrix and return if necessary*/
++	if (!IsOnBed() || !IsFloating()) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	mixed_layer_capacity=matpar->GetMixedLayerCapacity();
++	thermal_exchange_velocity=matpar->GetThermalExchangeVelocity();
++	rho_water=matpar->GetRhoWater();
++	rho_ice=matpar->GetRhoIce();
++	heatcapacity=matpar->GetHeatCapacity();
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++
++	/* Start looping on the number of gauss (nodes on the bedrock) */
++	gauss=new GaussPenta(0,1,2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++		
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
++		GetNodalFunctionsP1(&basis[0], gauss);
++				
++		D_scalar=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(heatcapacity*rho_ice);
++		if(dt) D_scalar=dt*D_scalar;
++
++		TripleMultiply(&basis[0],numdof,1,0,
++					&D_scalar,1,1,0,
++					&basis[0],1,numdof,0,
++					&Ke->values[0],1);
++	}
++	
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorEnthalpy {{{*/
++ElementVector* Penta::CreatePVectorEnthalpy(void){
++
++	/*compute all load vectors for this element*/
++	ElementVector* pe1=CreatePVectorEnthalpyVolume();
++	ElementVector* pe2=CreatePVectorEnthalpySheet();
++	ElementVector* pe3=CreatePVectorEnthalpyShelf();
++	ElementVector* pe =new ElementVector(pe1,pe2,pe3);
++
++	/*clean-up and return*/
++	delete pe1;
++	delete pe2;
++	delete pe3;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorEnthalpyVolume {{{*/
++ElementVector* Penta::CreatePVectorEnthalpyVolume(void){
++
++	/*Constants*/
++	const int  numdof=NUMVERTICES*NDOF1;
++
++	/*Intermediaries*/
++	int    i,j,ig,found=0;
++	int    friction_type,stabilization;
++	IssmDouble Jdet,phi,dt;
++	IssmDouble rho_ice,heatcapacity;
++	IssmDouble thermalconductivity,kappa;
++	IssmDouble viscosity,pressure;
++	IssmDouble enthalpy,enthalpypicard;
++	IssmDouble tau_parameter,diameter;
++	IssmDouble u,v,w;
++	IssmDouble scalar_def,scalar_transient;
++	IssmDouble temperature_list[NUMVERTICES];
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble L[numdof];
++	IssmDouble dbasis[3][6];
++	IssmDouble epsilon[6];
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	rho_ice=matpar->GetRhoIce();
++	heatcapacity=matpar->GetHeatCapacity();
++	thermalconductivity=matpar->GetThermalConductivity();
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
++	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* pressure_input=inputs->GetInput(PressureEnum);                      _assert_(pressure_input);
++	Input* enthalpy_input=NULL; 
++	Input* enthalpypicard_input=NULL; 
++	if(dt){
++		enthalpy_input=inputs->GetInput(EnthalpyEnum); _assert_(enthalpy_input);
++	}
++	if (stabilization==2){
++		diameter=MinEdgeLength(xyz_list);
++		enthalpypicard_input=inputs->GetInput(EnthalpyPicardEnum); _assert_(enthalpypicard_input);
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(2,3);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsP1(&L[0], gauss);
++
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		GetPhi(&phi, &epsilon[0], viscosity);
++
++		scalar_def=phi/rho_ice*Jdet*gauss->weight;
++		if(dt) scalar_def=scalar_def*dt;
++
++		for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_def*L[i];
++
++		/* Build transient now */
++		if(dt){
++			enthalpy_input->GetInputValue(&enthalpy, gauss);
++			scalar_transient=enthalpy*Jdet*gauss->weight;
++			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_transient*L[i];
++		}
++
++		if(stabilization==2){
++			GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
++
++			vx_input->GetInputValue(&u, gauss);
++			vy_input->GetInputValue(&v, gauss);
++			vz_input->GetInputValue(&w, gauss);
++			pressure_input->GetInputValue(&pressure, gauss);
++			enthalpypicard_input->GetInputValue(&enthalpypicard, gauss);
++			kappa=matpar->GetEnthalpyDiffusionParameter(enthalpy,pressure);
++			tau_parameter=GetStabilizationParameter(u,v,w,diameter,kappa);
++
++			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
++			if(dt){
++				for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
++			}
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorEnthalpyShelf {{{*/
++ElementVector* Penta::CreatePVectorEnthalpyShelf(void){
++
++	/*Constants*/
++	const int  numdof=NUMVERTICES*NDOF1;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     Jdet2d;
++	IssmDouble     heatcapacity,h_pmp;
++	IssmDouble     mixed_layer_capacity,thermal_exchange_velocity;
++	IssmDouble     rho_ice,rho_water,pressure,dt,scalar_ocean;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble     basis[NUMVERTICES];
++	GaussPenta* gauss=NULL;
++
++	/* Ice/ocean heat exchange flux on ice shelf base */
++	if (!IsOnBed() || !IsFloating()) return NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++	mixed_layer_capacity=matpar->GetMixedLayerCapacity();
++	thermal_exchange_velocity=matpar->GetThermalExchangeVelocity();
++	rho_water=matpar->GetRhoWater();
++	rho_ice=matpar->GetRhoIce();
++	heatcapacity=matpar->GetHeatCapacity();
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input);
++
++	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
++	gauss=new GaussPenta(0,1,2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
++		GetNodalFunctionsP1(&basis[0], gauss);
++
++		pressure_input->GetInputValue(&pressure,gauss);
++		h_pmp=matpar->PureIceEnthalpy(pressure);
++
++		scalar_ocean=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity*(h_pmp)/(rho_ice*heatcapacity);
++		if(dt) scalar_ocean=dt*scalar_ocean;
++
++		for(i=0;i<numdof;i++) pe->values[i]+=scalar_ocean*basis[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorEnthalpySheet {{{*/
++ElementVector* Penta::CreatePVectorEnthalpySheet(void){
++
++	/*Constants*/
++	const int  numdof=NUMVERTICES*NDOF1;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	int        analysis_type;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     xyz_list_tria[NUMVERTICES2D][3]={0.0};
++	IssmDouble     Jdet2d,dt;
++	IssmDouble     rho_ice,heatcapacity,geothermalflux_value;
++	IssmDouble     basalfriction,alpha2,vx,vy;
++	IssmDouble     scalar,enthalpy,enthalpyup;
++	IssmDouble     pressure,pressureup;
++	IssmDouble     basis[NUMVERTICES];
++	Friction*  friction=NULL;
++	GaussPenta* gauss=NULL;
++	GaussPenta* gaussup=NULL;
++
++	/* Geothermal flux on ice sheet base and basal friction */
++	if (!IsOnBed() || IsFloating()) return NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	rho_ice=matpar->GetRhoIce();
++	heatcapacity=matpar->GetHeatCapacity();
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	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* enthalpy_input=inputs->GetInput(EnthalpyEnum);             _assert_(enthalpy_input);
++	Input* pressure_input=inputs->GetInput(PressureEnum);             _assert_(pressure_input);
++	Input* geothermalflux_input=inputs->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
++
++	/*Build frictoin element, needed later: */
++	friction=new Friction("3d",inputs,matpar,analysis_type);
++
++	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
++	gauss=new GaussPenta(0,1,2,2);
++	gaussup=new GaussPenta(3,4,5,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++		gaussup->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
++		GetNodalFunctionsP1(&basis[0], gauss);
++
++		enthalpy_input->GetInputValue(&enthalpy,gauss);
++		pressure_input->GetInputValue(&pressure,gauss);
++//		if(enthalpy>matpar->PureIceEnthalpy(pressure)){
++//			enthalpy_input->GetInputValue(&enthalpyup,gaussup);
++//			pressure_input->GetInputValue(&pressureup,gaussup);
++//			if(enthalpyup>matpar->PureIceEnthalpy(pressureup)){
++//				//do nothing, don't add heatflux
++//			}
++//			else{
++//				//need to change spcenthalpy according to Aschwanden 
++//				//NEED TO UPDATE
++//			}
++//		}
++//		else{
++			geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
++			friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
++			vx_input->GetInputValue(&vx,gauss);
++			vy_input->GetInputValue(&vy,gauss);
++			basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
++
++			scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(rho_ice);
++			if(dt) scalar=dt*scalar;
++
++			for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
++//		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	delete gaussup;
++	delete friction;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorMelting {{{*/
++ElementVector* Penta::CreatePVectorMelting(void){
++	return NULL;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorThermal {{{*/
++ElementVector* Penta::CreatePVectorThermal(void){
++
++	/*compute all load vectors for this element*/
++	ElementVector* pe1=CreatePVectorThermalVolume();
++	ElementVector* pe2=CreatePVectorThermalSheet();
++	ElementVector* pe3=CreatePVectorThermalShelf();
++	ElementVector* pe =new ElementVector(pe1,pe2,pe3);
++
++	/*clean-up and return*/
++	delete pe1;
++	delete pe2;
++	delete pe3;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorThermalVolume {{{*/
++ElementVector* Penta::CreatePVectorThermalVolume(void){
++
++	/*Constants*/
++	const int  numdof=NUMVERTICES*NDOF1;
++
++	/*Intermediaries*/
++	int    i,j,ig,found=0;
++	int    friction_type,stabilization;
++	IssmDouble Jdet,phi,dt;
++	IssmDouble rho_ice,heatcapacity;
++	IssmDouble thermalconductivity,kappa;
++	IssmDouble viscosity,temperature;
++	IssmDouble tau_parameter,diameter;
++	IssmDouble u,v,w;
++	IssmDouble scalar_def,scalar_transient;
++	IssmDouble temperature_list[NUMVERTICES];
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble L[numdof];
++	IssmDouble dbasis[3][6];
++	IssmDouble epsilon[6];
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	rho_ice=matpar->GetRhoIce();
++	heatcapacity=matpar->GetHeatCapacity();
++	thermalconductivity=matpar->GetThermalConductivity();
++	kappa=thermalconductivity/(rho_ice*heatcapacity);
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
++	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* temperature_input=NULL;
++	if (dt) temperature_input=inputs->GetInput(TemperatureEnum); _assert_(inputs);
++	if (stabilization==2) diameter=MinEdgeLength(xyz_list);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(2,3);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsP1(&L[0], gauss);
++
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		GetPhi(&phi, &epsilon[0], viscosity);
++
++		scalar_def=phi/(rho_ice*heatcapacity)*Jdet*gauss->weight;
++		if(dt) scalar_def=scalar_def*dt;
++
++		for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_def*L[i];
++
++		/* Build transient now */
++		if(dt){
++			temperature_input->GetInputValue(&temperature, gauss);
++			scalar_transient=temperature*Jdet*gauss->weight;
++			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_transient*L[i];
++		}
++
++		if(stabilization==2){
++			GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
++
++			vx_input->GetInputValue(&u, gauss);
++			vy_input->GetInputValue(&v, gauss);
++			vz_input->GetInputValue(&w, gauss);
++
++			tau_parameter=GetStabilizationParameter(u,v,w,diameter,kappa);
++
++			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
++			if(dt){
++				for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
++			}
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorThermalShelf {{{*/
++ElementVector* Penta::CreatePVectorThermalShelf(void){
++
++	/*Constants*/
++	const int  numdof=NUMVERTICES*NDOF1;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     Jdet2d;
++	IssmDouble     mixed_layer_capacity,thermal_exchange_velocity;
++	IssmDouble     rho_ice,rho_water,pressure,dt,scalar_ocean;
++	IssmDouble     heatcapacity,t_pmp;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble     basis[NUMVERTICES];
++	GaussPenta* gauss=NULL;
++
++	/* Ice/ocean heat exchange flux on ice shelf base */
++	if (!IsOnBed() || !IsFloating()) return NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++	mixed_layer_capacity=matpar->GetMixedLayerCapacity();
++	thermal_exchange_velocity=matpar->GetThermalExchangeVelocity();
++	rho_water=matpar->GetRhoWater();
++	rho_ice=matpar->GetRhoIce();
++	heatcapacity=matpar->GetHeatCapacity();
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input);
++
++	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
++	gauss=new GaussPenta(0,1,2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
++		GetNodalFunctionsP1(&basis[0], gauss);
++
++		pressure_input->GetInputValue(&pressure,gauss);
++		t_pmp=matpar->TMeltingPoint(pressure);
++
++		scalar_ocean=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity*(t_pmp)/(heatcapacity*rho_ice);
++		if(dt) scalar_ocean=dt*scalar_ocean;
++
++		for(i=0;i<numdof;i++) pe->values[i]+=scalar_ocean*basis[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorThermalSheet {{{*/
++ElementVector* Penta::CreatePVectorThermalSheet(void){
++
++	/*Constants*/
++	const int  numdof=NUMVERTICES*NDOF1;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	int        analysis_type;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     xyz_list_tria[NUMVERTICES2D][3]={0.0};
++	IssmDouble     Jdet2d,dt;
++	IssmDouble     rho_ice,heatcapacity,geothermalflux_value;
++	IssmDouble     basalfriction,alpha2,vx,vy;
++	IssmDouble     basis[NUMVERTICES];
++	IssmDouble     scalar;
++	Friction*  friction=NULL;
++	GaussPenta* gauss=NULL;
++
++	/* Geothermal flux on ice sheet base and basal friction */
++	if (!IsOnBed() || IsFloating()) return NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	rho_ice=matpar->GetRhoIce();
++	heatcapacity=matpar->GetHeatCapacity();
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	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* geothermalflux_input=inputs->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
++
++	/*Build frictoin element, needed later: */
++	friction=new Friction("3d",inputs,matpar,analysis_type);
++
++	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
++	gauss=new GaussPenta(0,1,2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
++		GetNodalFunctionsP1(&basis[0], gauss);
++
++			geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
++			friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
++			vx_input->GetInputValue(&vx,gauss);
++			vy_input->GetInputValue(&vy,gauss);
++			basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
++
++			scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(heatcapacity*rho_ice);
++			if(dt) scalar=dt*scalar;
++
++			for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::GetSolutionFromInputsThermal{{{*/
++void  Penta::GetSolutionFromInputsThermal(Vector* solution){
++
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	int          i;
++	int*         doflist=NULL;
++	IssmDouble       values[numdof];
++	IssmDouble       temp;
++	GaussPenta   *gauss=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++	Input* t_input=inputs->GetInput(TemperatureEnum); _assert_(t_input);
++
++	gauss=new GaussPenta();
++	for(i=0;i<NUMVERTICES;i++){
++		/*Recover temperature*/
++		gauss->GaussVertex(i);
++		t_input->GetInputValue(&temp,gauss);
++		values[i]=temp;
++	}
++
++	/*Add value to global vector*/
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::GetSolutionFromInputsEnthalpy{{{*/
++void  Penta::GetSolutionFromInputsEnthalpy(Vector* solution){
++
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	int          i;
++	int*         doflist=NULL;
++	IssmDouble       values[numdof];
++	IssmDouble       enthalpy;
++	GaussPenta   *gauss=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++	Input* h_input=inputs->GetInput(EnthalpyEnum); _assert_(h_input);
++
++	gauss=new GaussPenta();
++	for(i=0;i<NUMVERTICES;i++){
++		/*Recover temperature*/
++		gauss->GaussVertex(i);
++		h_input->GetInputValue(&enthalpy,gauss);
++		values[i]=enthalpy;
++	}
++
++	/*Add value to global vector*/
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionThermal {{{*/
++void  Penta::InputUpdateFromSolutionThermal(IssmDouble* solution){
++
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	bool   converged;
++	int    i,rheology_law;
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble values[numdof];
++	IssmDouble B[numdof];
++	IssmDouble B_average,s_average;
++	int*   doflist=NULL;
++	//IssmDouble pressure[numdof];
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++){
++		values[i]=solution[doflist[i]];
++		//GetInputListOnVertices(&pressure[0],PressureEnum);
++		//if(values[i]>matpar->TMeltingPoint(pressure[i])) values[i]=matpar->TMeltingPoint(pressure[i]);
++		//if(values[i]<matpar->TMeltingPoint(pressure[i])-50) values[i]=matpar->TMeltingPoint(pressure[i])-50;
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++		//if(values[i]<0)      _printLine_("temperature < 0°K found in solution vector");
++		//if(values[i]>275)    _printLine_("temperature > 275°K found in solution vector (Paterson's rheology associated is negative)");
++	}
++
++	/*Get all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_input);
++
++	this->inputs->GetInputValue(&converged,ConvergedEnum);
++	if(converged){
++		this->inputs->AddInput(new PentaP1Input(TemperatureEnum,values));
++
++		/*Update Rheology only if converged (we must make sure that the temperature is below melting point
++		 * otherwise the rheology could be negative*/
++		this->parameters->FindParam(&rheology_law,MaterialsRheologyLawEnum);
++		switch(rheology_law){
++			case NoneEnum:
++				/*Do nothing: B is not temperature dependent*/
++				break;
++			case PatersonEnum:
++				B_average=Paterson((values[0]+values[1]+values[2]+values[3]+values[4]+values[5])/6.0);
++				for(i=0;i<numdof;i++) B[i]=B_average;
++				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
++				break;
++			case ArrheniusEnum:
++				surface_input->GetInputAverage(&s_average);
++				B_average=Arrhenius((values[0]+values[1]+values[2]+values[3]+values[4]+values[5])/6.0,
++							s_average-((xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2]+xyz_list[3][2]+xyz_list[4][2]+xyz_list[5][2])/6.0),
++							matice->GetN());
++				for(i=0;i<numdof;i++) B[i]=B_average;
++				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
++				break;
++			default:
++				_error2_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
++
++		}
++	}
++	else{
++		this->inputs->AddInput(new PentaP1Input(TemperaturePicardEnum,values));
++	}
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionEnthalpy {{{*/
++void  Penta::InputUpdateFromSolutionEnthalpy(IssmDouble* solution){
++
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	bool   converged=false;
++	int    i,rheology_law;
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble values[numdof];
++	IssmDouble pressure[NUMVERTICES];
++	IssmDouble temperatures[numdof];
++	IssmDouble waterfraction[numdof];
++	IssmDouble B[numdof];
++	IssmDouble B_average,s_average;
++	int*   doflist=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++){
++		values[i]=solution[doflist[i]];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Get all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	GetInputListOnVertices(&pressure[0],PressureEnum);
++	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_input);
++	
++	this->inputs->GetInputValue(&converged,ConvergedEnum);
++	if(converged){
++		/*Convert enthalpy into temperature and water fraction*/
++		for(i=0;i<numdof;i++){
++			matpar->EnthalpyToThermal(&temperatures[i],&waterfraction[i],values[i],pressure[i]);
++			if(waterfraction[i]<0) _error2_("Negative water fraction found in solution vector");
++			//if(waterfraction[i]>1) _error2_("Water fraction >1 found in solution vector");
++		}
++			
++		this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,values));
++		this->inputs->AddInput(new PentaP1Input(WaterfractionEnum,waterfraction));
++		this->inputs->AddInput(new PentaP1Input(TemperatureEnum,temperatures));
++
++		/*Update Rheology only if converged (we must make sure that the temperature is below melting point
++		 * otherwise the rheology could be negative*/
++		this->parameters->FindParam(&rheology_law,MaterialsRheologyLawEnum);
++		switch(rheology_law){
++			case NoneEnum:
++				/*Do nothing: B is not temperature dependent*/
++				break;
++			case PatersonEnum:
++				B_average=Paterson((temperatures[0]+temperatures[1]+temperatures[2]+temperatures[3]+temperatures[4]+temperatures[5])/6.0);
++				for(i=0;i<numdof;i++) B[i]=B_average;
++				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
++				break;
++			case ArrheniusEnum:
++				surface_input->GetInputAverage(&s_average);
++				B_average=Arrhenius((temperatures[0]+temperatures[1]+temperatures[2]+temperatures[3]+temperatures[4]+temperatures[5])/6.0,
++							s_average-((xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2]+xyz_list[3][2]+xyz_list[4][2]+xyz_list[5][2])/6.0),
++							matice->GetN());
++				for(i=0;i<numdof;i++) B[i]=B_average;
++				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
++				break;
++			default:
++				_error2_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
++
++		}
++	}
++	else{
++		this->inputs->AddInput(new PentaP1Input(EnthalpyPicardEnum,values));
++	}
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_CONTROL_
++/*FUNCTION Penta::ControlInputGetGradient{{{*/
++void Penta::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){
++
++	int doflist1[NUMVERTICES];
++	Input* input=NULL;
++
++	if(enum_type==MaterialsRheologyBbarEnum){
++		if(!IsOnBed()) return;
++		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
++	}
++	else{
++		input=inputs->GetInput(enum_type);
++	}
++	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
++	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++
++	GradientIndexing(&doflist1[0],control_index);
++	((ControlInput*)input)->GetGradient(gradient,&doflist1[0]);
++
++}/*}}}*/
++/*FUNCTION Penta::ControlInputScaleGradient{{{*/
++void Penta::ControlInputScaleGradient(int enum_type,IssmDouble scale){
++
++	Input* input=NULL;
++
++	if(enum_type==MaterialsRheologyBbarEnum){
++		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
++	}
++	else{
++		input=inputs->GetInput(enum_type);
++	}
++	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
++	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++
++	((ControlInput*)input)->ScaleGradient(scale);
++}/*}}}*/
++/*FUNCTION Penta::ControlInputSetGradient{{{*/
++void Penta::ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){
++
++	int    doflist1[NUMVERTICES];
++	IssmDouble grad_list[NUMVERTICES];
++	Input* grad_input=NULL;
++	Input* input=NULL;
++
++	if(enum_type==MaterialsRheologyBbarEnum){
++		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
++	}
++	else{
++		input=inputs->GetInput(enum_type);
++	}
++	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
++	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++
++	GradientIndexing(&doflist1[0],control_index);
++	for(int i=0;i<NUMVERTICES;i++) grad_list[i]=gradient[doflist1[i]];
++	grad_input=new PentaP1Input(GradientEnum,grad_list);
++	((ControlInput*)input)->SetGradient(grad_input);
++
++}/*}}}*/
++/*FUNCTION Penta::CreateKMatrixAdjointHoriz{{{*/
++ElementMatrix* Penta::CreateKMatrixAdjointHoriz(void){
++
++	int approximation;
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	switch(approximation){
++		case MacAyealApproximationEnum:
++			return CreateKMatrixAdjointMacAyeal2d();
++		case PattynApproximationEnum:
++			return CreateKMatrixAdjointPattyn();
++		case StokesApproximationEnum:
++			return CreateKMatrixAdjointStokes();
++		case NoneApproximationEnum:
++			return NULL;
++		default:
++			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixAdjointMacAyeal2d{{{*/
++ElementMatrix* Penta::CreateKMatrixAdjointMacAyeal2d(void){
++
++	/*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 
++	  bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 
++	  the stiffness matrix. */
++	if (!IsOnBed()) return NULL;
++
++	/*Depth Averaging B*/
++	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementMatrix* Ke=tria->CreateKMatrixAdjointMacAyeal();
++	delete tria->matice; delete tria;
++
++	/*Delete B averaged*/
++	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++
++	/*clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixAdjointPattyn{{{*/
++ElementMatrix* Penta::CreateKMatrixAdjointPattyn(void){
++
++	/*Constants*/
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	bool       incomplete_adjoint;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     Jdet;
++	IssmDouble     eps1dotdphii,eps1dotdphij;
++	IssmDouble     eps2dotdphii,eps2dotdphij;
++	IssmDouble     mu_prime;
++	IssmDouble     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble     eps1[3],eps2[3];
++	IssmDouble     phi[NUMVERTICES];
++	IssmDouble     dphi[3][NUMVERTICES];
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Jacobian with regular Pattyn (first part of the Gateau derivative)*/
++	parameters->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
++	ElementMatrix* Ke=CreateKMatrixDiagnosticPattyn();
++	if(incomplete_adjoint) return Ke;
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(5,5);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
++
++		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
++		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
++		eps1[2]=epsilon[3];                eps2[2]=epsilon[4];
++
++		for(i=0;i<6;i++){
++			for(j=0;j<6;j++){
++				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
++				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
++				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
++				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
++
++				Ke->values[12*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
++				Ke->values[12*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
++				Ke->values[12*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
++				Ke->values[12*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
++			}
++		}
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixAdjointStokes{{{*/
++ElementMatrix* Penta::CreateKMatrixAdjointStokes(void){
++
++	/*Constants*/
++	const int    numdof=NDOF4*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	bool       incomplete_adjoint;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     Jdet;
++	IssmDouble     eps1dotdphii,eps1dotdphij;
++	IssmDouble     eps2dotdphii,eps2dotdphij;
++	IssmDouble     eps3dotdphii,eps3dotdphij;
++	IssmDouble     mu_prime;
++	IssmDouble     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble     eps1[3],eps2[3],eps3[3];
++	IssmDouble     phi[NUMVERTICES];
++	IssmDouble     dphi[3][NUMVERTICES];
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Jacobian with regular Stokes (first part of the Gateau derivative)*/
++	parameters->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
++	ElementMatrix* Ke=CreateKMatrixDiagnosticStokes();
++	if(incomplete_adjoint) return Ke;
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	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 gaussian points: */
++	gauss=new GaussPenta(5,5);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
++
++		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		eps1[0]=epsilon[0];   eps2[0]=epsilon[2];   eps3[0]=epsilon[3];
++		eps1[1]=epsilon[2];   eps2[1]=epsilon[1];   eps3[1]=epsilon[4];
++		eps1[2]=epsilon[3];   eps2[2]=epsilon[4];   eps3[2]= -epsilon[0] -epsilon[1];
++
++		for(i=0;i<6;i++){
++			for(j=0;j<6;j++){
++				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
++				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
++				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
++				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
++				eps3dotdphii=eps3[0]*dphi[0][i]+eps3[1]*dphi[1][i]+eps3[2]*dphi[2][i];
++				eps3dotdphij=eps3[0]*dphi[0][j]+eps3[1]*dphi[1][j]+eps3[2]*dphi[2][j];
++
++				Ke->values[numdof*(4*i+0)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
++				Ke->values[numdof*(4*i+0)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
++				Ke->values[numdof*(4*i+0)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps1dotdphii;
++
++				Ke->values[numdof*(4*i+1)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
++				Ke->values[numdof*(4*i+1)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
++				Ke->values[numdof*(4*i+1)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps2dotdphii;
++
++				Ke->values[numdof*(4*i+2)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps3dotdphii;
++				Ke->values[numdof*(4*i+2)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps3dotdphii;
++				Ke->values[numdof*(4*i+2)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps3dotdphii;
++			}
++		}
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorAdjointHoriz{{{*/
++ElementVector* Penta::CreatePVectorAdjointHoriz(void){
++
++	int approximation;
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	switch(approximation){
++		case MacAyealApproximationEnum:
++			return CreatePVectorAdjointMacAyeal();
++		case PattynApproximationEnum:
++			return CreatePVectorAdjointPattyn();
++		case NoneApproximationEnum:
++			return NULL;
++		case StokesApproximationEnum:
++			return CreatePVectorAdjointStokes();
++		default:
++			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorAdjointMacAyeal{{{*/
++ElementVector* Penta::CreatePVectorAdjointMacAyeal(){
++
++	if (!IsOnBed()) return NULL;
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementVector* pe=tria->CreatePVectorAdjointHoriz();
++	delete tria->matice; delete tria;
++
++	/*clean up and return*/
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorAdjointPattyn{{{*/
++ElementVector* Penta::CreatePVectorAdjointPattyn(void){
++
++	if (!IsOnSurface()) return NULL;
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
++	ElementVector* pe=tria->CreatePVectorAdjointHoriz();
++	delete tria->matice; delete tria;
++
++	/*clean up and return*/
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorAdjointStokes{{{*/
++ElementVector* Penta::CreatePVectorAdjointStokes(void){
++
++	if (!IsOnSurface()) return NULL;
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
++	ElementVector* pe=tria->CreatePVectorAdjointStokes();
++	delete tria->matice; delete tria;
++
++	/*clean up and return*/
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::GradientIndexing{{{*/
++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->nodes[i]->GetVertexDof() + control_index;
++	}
++
++}
++/*}}}*/
++/*FUNCTION Penta::Gradj {{{*/
++void  Penta::Gradj(Vector* gradient,int control_type,int control_index){
++	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
++
++	int              i,approximation;
++	Tria*            tria=NULL;
++
++	/*If on water, skip grad (=0): */
++	if(IsOnWater())return;
++
++	/*First deal with ∂/∂alpha(KU-F)*/
++	switch(control_type){
++
++		case FrictionCoefficientEnum:
++			inputs->GetInputValue(&approximation,ApproximationEnum);
++			switch(approximation){
++				case MacAyealApproximationEnum:
++					GradjDragMacAyeal(gradient,control_index);
++					break;
++				case PattynApproximationEnum:
++					GradjDragPattyn(gradient,control_index);
++					break;
++				case StokesApproximationEnum:
++					GradjDragStokes(gradient,control_index);
++					break;
++				case NoneApproximationEnum:
++					/*Gradient is 0*/
++					break;
++				default:
++					_error2_("approximation " << EnumToStringx(approximation) << " not supported yet");
++			}
++			break;
++
++		case MaterialsRheologyBbarEnum:
++			inputs->GetInputValue(&approximation,ApproximationEnum);
++			switch(approximation){
++				case MacAyealApproximationEnum:
++					GradjBbarMacAyeal(gradient,control_index);
++					break;
++				case PattynApproximationEnum:
++					GradjBbarPattyn(gradient,control_index);
++					break;
++				case StokesApproximationEnum:
++					GradjBbarStokes(gradient,control_index);
++					break;
++				case NoneApproximationEnum:
++					/*Gradient is 0*/
++					break;
++				default:
++					_error2_("approximation " << EnumToStringx(approximation) << " not supported yet");
++			}
++			break;
++
++		default:
++			_error2_("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,NULL,StepResponsesEnum);
++
++	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 (!IsOnBed()) return;
++			tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++			tria->GradjDragGradient(gradient,resp,control_index);
++			delete tria->matice; delete tria;
++			break;
++		case RheologyBbarAbsGradientEnum:
++			if (!IsOnBed()) return;
++			tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++			tria->GradjBGradient(gradient,resp,control_index);
++			delete tria->matice; delete tria;
++			break;
++		default:
++			_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++	}
++	xDelete<int>(responses);
++}
++/*}}}*/
++/*FUNCTION Penta::GradjDragMacAyeal {{{*/
++void  Penta::GradjDragMacAyeal(Vector* gradient,int control_index){
++
++	/*Gradient is 0 if on shelf or not on bed*/
++	if(IsFloating() || !IsOnBed()) return;
++
++	/*Spawn tria*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	tria->GradjDragMacAyeal(gradient,control_index);
++	delete tria->matice; delete tria;
++
++} /*}}}*/
++/*FUNCTION Penta::GradjDragPattyn {{{*/
++void  Penta::GradjDragPattyn(Vector* gradient,int control_index){
++
++	int        i,j,ig;
++	int        analysis_type;
++	int        doflist1[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() || !IsOnBed()) return;
++
++	/*Retrieve all inputs and parameters*/
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	GradientIndexing(&doflist1[0],control_index);
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;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("2d",inputs,matpar,analysis_type);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(0,1,2,4);
++	for (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,VxEnum,VyEnum,VzEnum);
++
++		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]; /*basis are 0 for the 3 upper nodes*/
++		}
++
++		/*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,doflist1,grade_g,ADD_VAL);
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++}
++/*}}}*/
++/*FUNCTION Penta::GradjDragStokes {{{*/
++void  Penta::GradjDragStokes(Vector* gradient,int control_index){
++
++	int        i,j,ig;
++	int        analysis_type;
++	int        doflist1[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() || !IsOnBed()) return;
++
++	/*Retrieve all inputs and parameters*/
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++	GradientIndexing(&doflist1[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("3d",inputs,matpar,analysis_type);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(0,1,2,4);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/*Recover alpha_complement and drag: */
++		friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum,VzEnum);
++		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 */
++		SurfaceNormal(&surface_normal[0],xyz_list_tria);
++
++		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,doflist1,grade_g,ADD_VAL);
++
++	delete friction;
++	delete gauss;
++}
++/*}}}*/
++/*FUNCTION Penta::GradjBbarMacAyeal {{{*/
++void  Penta::GradjBbarMacAyeal(Vector* gradient,int control_index){
++
++	/*This element should be collapsed into a tria element at its base*/
++	if (!IsOnBed()) return; 
++
++	/*Depth Average B*/
++	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++
++	/*Collapse element to the base*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
++	tria->GradjBMacAyeal(gradient,control_index);
++	delete tria->matice; delete tria;
++
++	/*delete Average B*/
++	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++
++} /*}}}*/
++/*FUNCTION Penta::GradjBbarPattyn {{{*/
++void  Penta::GradjBbarPattyn(Vector* gradient,int control_index){
++
++	/*Gradient is computed on bed only (Bbar)*/
++	if (!IsOnBed()) return;
++
++	/*Depth Average B*/
++	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++
++	/*Collapse element to the base*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2);
++	tria->GradjBMacAyeal(gradient,control_index);    //We use MacAyeal as an estimate for now
++	delete tria->matice; delete tria;
++
++	/*delete Average B*/
++	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++} /*}}}*/
++/*FUNCTION Penta::GradjBbarStokes {{{*/
++void  Penta::GradjBbarStokes(Vector* gradient,int control_index){
++
++	/*Gradient is computed on bed only (Bbar)*/
++	if (!IsOnBed()) return;
++
++	/*Depth Average B*/
++	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++
++	/*Collapse element to the base*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2);
++	tria->GradjBMacAyeal(gradient,control_index);    //We use MacAyeal as an estimate for now
++	delete tria->matice; delete tria;
++
++	/*delete Average B*/
++	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++} /*}}}*/
++/*FUNCTION Penta::InputControlUpdate{{{*/
++void  Penta::InputControlUpdate(IssmDouble scalar,bool save_parameter){
++
++	/*Intermediary*/
++	int    num_controls;
++	int*   control_type=NULL;
++	Input* input=NULL;
++
++	/*retrieve some parameters: */
++	this->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
++	this->parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
++
++	for(int i=0;i<num_controls;i++){
++
++		if(control_type[i]==MaterialsRheologyBbarEnum){
++			if (!IsOnBed()) goto cleanup_and_return;
++			input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum); _assert_(input);
++		}
++		else{
++			input=(Input*)this->inputs->GetInput(control_type[i]); _assert_(input);
++		}
++
++		if (input->ObjectEnum()!=ControlInputEnum) _error2_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");
++
++		((ControlInput*)input)->UpdateValue(scalar);
++		((ControlInput*)input)->Constrain();
++		if (save_parameter) ((ControlInput*)input)->SaveValue();
++
++		if(control_type[i]==MaterialsRheologyBbarEnum){
++			this->InputExtrude(MaterialsRheologyBEnum,MaterialsEnum);
++		}
++	}
++
++	/*Clean up and return*/
++cleanup_and_return:
++	xDelete<int>(control_type);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionAdjointStokes {{{*/
++void  Penta::InputUpdateFromSolutionAdjointStokes(IssmDouble* solution){
++
++	const int    numdof=NDOF4*NUMVERTICES;
++
++	int    i;
++	IssmDouble values[numdof];
++	IssmDouble lambdax[NUMVERTICES];
++	IssmDouble lambday[NUMVERTICES];
++	IssmDouble lambdaz[NUMVERTICES];
++	IssmDouble lambdap[NUMVERTICES];
++	int*   doflist=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		lambdax[i]=values[i*NDOF4+0];
++		lambday[i]=values[i*NDOF4+1];
++		lambdaz[i]=values[i*NDOF4+2];
++		lambdap[i]=values[i*NDOF4+3];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(lambdax[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambday[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambdaz[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambdap[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new PentaP1Input(AdjointxEnum,lambdax));
++	this->inputs->AddInput(new PentaP1Input(AdjointyEnum,lambday));
++	this->inputs->AddInput(new PentaP1Input(AdjointzEnum,lambdaz));
++	this->inputs->AddInput(new PentaP1Input(AdjointpEnum,lambdap));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionAdjointHoriz {{{*/
++void  Penta::InputUpdateFromSolutionAdjointHoriz(IssmDouble* solution){
++
++	const int numdof=NDOF2*NUMVERTICES;
++
++	int    i;
++	IssmDouble values[numdof];
++	IssmDouble lambdax[NUMVERTICES];
++	IssmDouble lambday[NUMVERTICES];
++	int*   doflist=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		lambdax[i]=values[i*NDOF2+0];
++		lambday[i]=values[i*NDOF2+1];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(lambdax[i]))       _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambday[i]))       _error2_("NaN found in solution vector");
++	}
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new PentaP1Input(AdjointxEnum,lambdax));
++	this->inputs->AddInput(new PentaP1Input(AdjointyEnum,lambday));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::SurfaceAverageVelMisfit {{{*/
++IssmDouble Penta::SurfaceAverageVelMisfit(bool process_units,int weight_index){
++
++	int    approximation;
++	IssmDouble J;
++	Tria*  tria=NULL;
++
++	/*retrieve inputs :*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/*Bail out if this element if:
++	 * -> Non MacAyeal and not on the surface
++	 * -> MacAyeal (2d model) and not on bed) */
++	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
++		return 0;
++	}
++	else if (approximation==MacAyealApproximationEnum){
++
++		/*This element should be collapsed into a tria element at its base. Create this tria element, 
++		 * and compute SurfaceAverageVelMisfit*/
++		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
++		J=tria->SurfaceAverageVelMisfit(process_units,weight_index);
++		delete tria->matice; delete tria;
++		return J;
++	}
++	else{
++
++		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
++		J=tria->SurfaceAverageVelMisfit(process_units,weight_index);
++		delete tria->matice; delete tria;
++		return J;
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::SurfaceAbsVelMisfit {{{*/
++IssmDouble Penta::SurfaceAbsVelMisfit(bool process_units,int weight_index){
++
++	int    approximation;
++	IssmDouble J;
++	Tria*  tria=NULL;
++
++	/*retrieve inputs :*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/*Bail out if this element if:
++	 * -> Non MacAyeal and not on the surface
++	 * -> MacAyeal (2d model) and not on bed) */
++	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
++		return 0;
++	}
++	else if (approximation==MacAyealApproximationEnum){
++
++		/*This element should be collapsed into a tria element at its base. Create this tria element, 
++		 * and compute SurfaceAbsVelMisfit*/
++		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
++		J=tria->SurfaceAbsVelMisfit(process_units,weight_index);
++		delete tria->matice; delete tria;
++		return J;
++	}
++	else{
++
++		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
++		J=tria->SurfaceAbsVelMisfit(process_units,weight_index);
++		delete tria->matice; delete tria;
++		return J;
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::SurfaceLogVelMisfit {{{*/
++IssmDouble Penta::SurfaceLogVelMisfit(bool process_units,int weight_index){
++
++	int    approximation;
++	IssmDouble J;
++	Tria*  tria=NULL;
++
++	/*retrieve inputs :*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/*Bail out if this element if:
++	 * -> Non MacAyeal and not on the surface
++	 * -> MacAyeal (2d model) and not on bed) */
++	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
++		return 0;
++	}
++	else if (approximation==MacAyealApproximationEnum){
++
++		/*This element should be collapsed into a tria element at its base. Create this tria element, 
++		 * and compute SurfaceLogVelMisfit*/
++		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
++		J=tria->SurfaceLogVelMisfit(process_units,weight_index);
++		delete tria->matice; delete tria;
++		return J;
++	}
++	else{
++
++		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
++		J=tria->SurfaceLogVelMisfit(process_units,weight_index);
++		delete tria->matice; delete tria;
++		return J;
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::SurfaceLogVxVyMisfit {{{*/
++IssmDouble Penta::SurfaceLogVxVyMisfit(bool process_units,int weight_index){
++
++	IssmDouble J;
++	Tria* tria=NULL;
++
++	/*inputs: */
++	int  approximation;
++
++	/*retrieve inputs :*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/*Bail out if this element if:
++	 * -> Non MacAyeal and not on the surface
++	 * -> MacAyeal (2d model) and not on bed) */
++	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
++		return 0;
++	}
++	else if (approximation==MacAyealApproximationEnum){
++
++		/*This element should be collapsed into a tria element at its base. Create this tria element, 
++		 * and compute SurfaceLogVxVyMisfit*/
++		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
++		J=tria->SurfaceLogVxVyMisfit(process_units,weight_index);
++		delete tria->matice; delete tria;
++		return J;
++	}
++	else{
++
++		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
++		J=tria->SurfaceLogVxVyMisfit(process_units,weight_index);
++		delete tria->matice; delete tria;
++		return J;
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::SurfaceRelVelMisfit {{{*/
++IssmDouble Penta::SurfaceRelVelMisfit(bool process_units,int weight_index){
++
++	int    approximation;
++	IssmDouble J;
++	Tria*  tria=NULL;
++
++	/*retrieve inputs :*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++
++	/*Bail out if this element if:
++	 * -> Non MacAyeal and not on the surface
++	 * -> MacAyeal (2d model) and not on bed) */
++	if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
++		return 0;
++	}
++	else if (approximation==MacAyealApproximationEnum){
++
++		/*This element should be collapsed into a tria element at its base. Create this tria element, 
++		 * and compute SurfaceRelVelMisfit*/
++		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
++		J=tria->SurfaceRelVelMisfit(process_units,weight_index);
++		delete tria->matice; delete tria;
++		return J;
++	}
++	else{
++
++		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
++		J=tria->SurfaceRelVelMisfit(process_units,weight_index);
++		delete tria->matice; delete tria;
++		return J;
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::ThicknessAbsGradient{{{*/
++IssmDouble Penta::ThicknessAbsGradient(bool process_units,int weight_index){
++
++	_error2_("Not implemented yet");
++}
++/*}}}*/
++/*FUNCTION Penta::ThicknessAbsMisfit {{{*/
++IssmDouble Penta::ThicknessAbsMisfit(bool process_units,int weight_index){
++
++	int    approximation;
++	IssmDouble J;
++	Tria*  tria=NULL;
++
++	/*retrieve inputs :*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	/*If on water, return 0: */
++	if(IsOnWater())return 0;
++	_error2_("Not implemented yet");
++
++	tria=(Tria*)SpawnTria(0,1,2);
++	J=tria->ThicknessAbsMisfit(process_units,weight_index);
++	delete tria->matice; delete tria;
++	return J;
++}
++/*}}}*/
++/*FUNCTION Penta::DragCoefficientAbsGradient{{{*/
++IssmDouble Penta::DragCoefficientAbsGradient(bool process_units,int weight_index){
++
++	IssmDouble J;
++	Tria*  tria=NULL;
++
++	/*If on water, on shelf or not on bed, skip: */
++	if(IsOnWater()|| IsFloating() || !IsOnBed()) return 0;
++
++	tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria
++	J=tria->DragCoefficientAbsGradient(process_units,weight_index);
++	delete tria->matice; delete tria;
++	return J;
++}
++/*}}}*/
++/*FUNCTION Penta::RheologyBbarAbsGradient{{{*/
++IssmDouble Penta::RheologyBbarAbsGradient(bool process_units,int weight_index){
++
++	IssmDouble J;
++	Tria*  tria=NULL;
++
++	/*If on water, on shelf or not on bed, skip: */
++	if(IsOnWater() || !IsOnBed()) return 0;
++
++	tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria
++	J=tria->RheologyBbarAbsGradient(process_units,weight_index);
++	delete tria->matice; delete tria;
++	return J;
++}
++/*}}}*/
++/*FUNCTION Penta::GetVectorFromControlInputs{{{*/
++void  Penta::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){
++
++	int doflist1[NUMVERTICES];
++
++	/*Get out if this is not an element input*/
++	if(!IsInput(control_enum)) return;
++
++	/*Prepare index list*/
++	GradientIndexing(&doflist1[0],control_index);
++
++	/*Get input (either in element or material)*/
++	Input* input=inputs->GetInput(control_enum);
++	if(!input) _error2_("Input " << EnumToStringx(control_enum) << " not found in element");
++
++	/*Check that it is a ControlInput*/
++	if (input->ObjectEnum()!=ControlInputEnum){
++		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
++	}
++
++	((ControlInput*)input)->GetVectorFromInputs(vector,&doflist1[0],data);
++}
++/*}}}*/
++/*FUNCTION Penta::SetControlInputsFromVector{{{*/
++void  Penta::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){
++
++	IssmDouble  values[NUMVERTICES];
++	int     doflist1[NUMVERTICES];
++	Input  *input     = NULL;
++	Input  *new_input = NULL;
++
++	/*Get out if this is not an element input*/
++	if(!IsInput(control_enum)) return;
++
++	/*Prepare index list*/
++	GradientIndexing(&doflist1[0],control_index);
++
++	/*Get values on vertices*/
++	for (int i=0;i<NUMVERTICES;i++){
++		values[i]=vector[doflist1[i]];
++	}
++	new_input = new PentaP1Input(control_enum,values);
++
++
++	if(control_enum==MaterialsRheologyBbarEnum){
++		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
++	}
++	else{
++		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
++	}
++
++	if (input->ObjectEnum()!=ControlInputEnum){
++		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
++	}
++
++	((ControlInput*)input)->SetInput(new_input);
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_DAKOTA_
++/*FUNCTION Penta::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);{{{*/
++void  Penta::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
++	
++	int i,j;
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	switch(type){
++
++		case VertexEnum:
++
++			/*New PentaP1Input*/
++			IssmDouble values[6];
++
++			/*Get values on the 6 vertices*/
++			for (i=0;i<6;i++){
++				values[i]=vector[this->nodes[i]->GetSidList()]; //careful, vector of values here is not parallel distributed, but serial distributed (from a serial Dakota core!)
++			}
++
++			/*Branch on the specified type of update: */
++			switch(name){
++				case ThicknessEnum:
++					/*Update thickness + surface: assume bed is constant. On ice shelves, takes hydrostatic equilibrium {{{*/
++					IssmDouble  thickness[6];
++					IssmDouble  thickness_init[6];
++					IssmDouble  hydrostatic_ratio[6];
++					IssmDouble  surface[6];
++					IssmDouble  bed[6];
++					
++					/*retrieve inputs: */
++					GetInputListOnVertices(&thickness_init[0],ThicknessEnum);
++					GetInputListOnVertices(&hydrostatic_ratio[0],GeometryHydrostaticRatioEnum);
++					GetInputListOnVertices(&bed[0],BedEnum);
++					GetInputListOnVertices(&surface[0],SurfaceEnum);
++
++					/*build new thickness: */
++//					for(j=0;j<6;j++)thickness[j]=values[j];
++
++					/*build new bed and surface: */
++					if (this->IsFloating()){
++						/*hydrostatic equilibrium: */
++						IssmDouble rho_ice,rho_water,di;
++						rho_ice=this->matpar->GetRhoIce();
++						rho_water=this->matpar->GetRhoWater();
++
++						di=rho_ice/rho_water;
++
++						/*build new thickness: */
++						for (j=0; j<6; j++) {
++						/*  for observed/interpolated/hydrostatic thickness, remove scaling from any hydrostatic thickness  */
++							if     (hydrostatic_ratio[j] >= 0.)
++								thickness[j]=values[j]-(values[j]/thickness_init[j]-1.)*hydrostatic_ratio[j]*surface[j]/(1.-di);
++						/*  for minimum thickness, don't scale  */
++							else
++								thickness[j]=thickness_init[j];
++
++						/*  check the computed thickness and update bed  */
++							if (thickness[j] < 0.)
++								thickness[j]=1./(1.-di);
++							bed[j]=surface[j]-thickness[j];
++						}
++
++//						for(j=0;j<6;j++){
++//							surface[j]=(1-di)*thickness[j];
++//							bed[j]=-di*thickness[j];
++//						}
++					}
++					else{
++						/*build new thickness: */
++						for (j=0; j<6; j++) {
++						/*  for observed thickness, use scaled value  */
++							if(hydrostatic_ratio[j] >= 0.)
++								thickness[j]=values[j];
++						/*  for minimum thickness, don't scale  */
++							else
++								thickness[j]=thickness_init[j];
++						}
++
++						/*update bed on grounded ice: */
++//						for(j=0;j<6;j++)surface[j]=bed[j]+thickness[j];
++						for(j=0;j<6;j++)bed[j]=surface[j]-thickness[j];
++					}
++
++					/*Add new inputs: */
++					this->inputs->AddInput(new PentaP1Input(ThicknessEnum,thickness));
++					this->inputs->AddInput(new PentaP1Input(BedEnum,bed));
++					this->inputs->AddInput(new PentaP1Input(SurfaceEnum,surface));
++
++					/*}}}*/
++					break;
++				default:
++					this->inputs->AddInput(new PentaP1Input(name,values));
++			}
++			break;
++
++		default:
++			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++	}
++
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/
++void  Penta::InputUpdateFromVectorDakota(int* vector, int name, int type){
++	_error2_("not supported yet!");
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/
++void  Penta::InputUpdateFromVectorDakota(bool* vector, int name, int type){
++	_error2_("not supported yet!");
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type);{{{*/
++void  Penta::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
++	
++	int i,j,t;
++	TransientInput* transientinput=NULL;
++	IssmDouble values[6];
++	IssmDouble time;
++	int row;
++	IssmDouble yts;
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	switch(type){
++
++		case VertexEnum:
++			
++			/*Create transient input: */
++						
++			parameters->FindParam(&yts,ConstantsYtsEnum);
++
++			for(t=0;t<ncols;t++){ //ncols is the number of times
++
++				/*create input values: */
++				for(i=0;i<6;i++){
++					row=this->nodes[i]->GetSidList();
++					values[i]=(IssmDouble)matrix[ncols*row+t];
++				}
++
++				/*time? :*/
++				time=(IssmDouble)matrix[(nrows-1)*ncols+t]*yts;
++
++				if(t==0) transientinput=new TransientInput(name);
++				transientinput->AddTimeInput(new PentaP1Input(name,values),time);
++				transientinput->Configure(parameters);
++			}
++			this->inputs->AddInput(transientinput);
++			break;
++
++		default:
++			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++	}
++
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_DIAGNOSTIC_
++/*FUNCTION Penta::CreateDVectorDiagnosticHoriz {{{*/
++ElementVector* Penta::CreateDVectorDiagnosticHoriz(void){
++
++	int approximation;
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	switch(approximation){
++		case StokesApproximationEnum:
++			return CreateDVectorDiagnosticStokes();
++		default:
++			return NULL; //no need for doftypes outside of stokes approximation
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::CreateDVectorDiagnosticStokes{{{*/
++ElementVector* Penta::CreateDVectorDiagnosticStokes(void){
++
++	/*output: */
++	ElementVector* De=NULL;
++	/*intermediary: */
++	int approximation;
++	int i;
++
++	/*Initialize Element vector and return if necessary*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(approximation!=StokesApproximationEnum) return NULL;
++
++	De=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++
++	for (i=0;i<NUMVERTICES;i++){
++		De->values[i*4+0]=VelocityEnum;
++		De->values[i*4+1]=VelocityEnum;
++		De->values[i*4+2]=VelocityEnum;
++		De->values[i*4+3]=PressureEnum;
++	}
++
++	return De;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixCouplingMacAyealPattyn{{{*/
++ElementMatrix* Penta::CreateKMatrixCouplingMacAyealPattyn(void){
++	
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixCouplingMacAyealPattynViscous();
++	ElementMatrix* Ke2=CreateKMatrixCouplingMacAyealPattynFriction();
++	ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
++	
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixCouplingMacAyealPattynViscous{{{*/
++ElementMatrix* Penta::CreateKMatrixCouplingMacAyealPattynViscous(void){
++
++	/*Constants*/
++	const int numnodes    = 2 *NUMVERTICES;
++	const int numdofm     = NDOF2 *NUMVERTICES2D;
++	const int numdofp     = NDOF2 *NUMVERTICES;
++	const int numdoftotal = 2 *NDOF2*NUMVERTICES;
++
++	/*Intermediaries */
++	int         i,j,ig;
++	IssmDouble      Jdet;
++	IssmDouble      viscosity,oldviscosity,newviscosity,viscosity_overshoot; //viscosity
++	IssmDouble      epsilon[5],oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      B[3][numdofp];
++	IssmDouble      Bprime[3][numdofm];
++	IssmDouble      D[3][3]={0.0};            // material matrix, simple scalar matrix.
++	IssmDouble      D_scalar;
++	IssmDouble      Ke_gg[numdofp][numdofm]={0.0}; //local element stiffness matrix 
++	IssmDouble      Ke_gg_gaussian[numdofp][numdofm]; //stiffness matrix evaluated at the gaussian point.
++	GaussPenta *gauss=NULL;
++	GaussTria  *gauss_tria=NULL;
++	Node       *node_list[numnodes];
++	int         cs_list[numnodes];
++
++	/*Find penta on bed as pattyn must be coupled to the dofs on the bed: */
++	Penta* pentabase=GetBasalElement();
++	Tria*  tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++
++	/*Prepare node list*/
++	for(i=0;i<NUMVERTICES;i++){
++		node_list[i+0*NUMVERTICES] = pentabase->nodes[i];
++		node_list[i+1*NUMVERTICES] = this->nodes[i];
++		cs_list[i+0*NUMVERTICES] = XYEnum;
++		cs_list[i+1*NUMVERTICES] = XYEnum;
++	}
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke1=new ElementMatrix(pentabase->nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
++	ElementMatrix* Ke2=new ElementMatrix(this->nodes     ,NUMVERTICES,this->parameters,PattynApproximationEnum);
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
++	delete Ke1; delete Ke2;
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&viscosity_overshoot,DiagnosticViscosityOvershootEnum);
++	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
++	Input* vxold_input=inputs->GetInput(VxPicardEnum); _assert_(vxold_input);
++	Input* vyold_input=inputs->GetInput(VyPicardEnum); _assert_(vyold_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(5,5);
++	gauss_tria=new GaussTria();
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++		gauss->SynchronizeGaussTria(gauss_tria);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetBMacAyealPattyn(&B[0][0], &xyz_list[0][0], gauss);
++		tria->GetBprimeMacAyeal(&Bprime[0][0], &xyz_list[0][0], gauss_tria);
++
++		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
++		matice->GetViscosity3d(&viscosity, &epsilon[0]);
++		matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
++
++		newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
++		D_scalar=2*newviscosity*gauss->weight*Jdet;
++		for (i=0;i<3;i++) D[i][i]=D_scalar;
++
++		TripleMultiply( &B[0][0],3,numdofp,1,
++					&D[0][0],3,3,0,
++					&Bprime[0][0],3,numdofm,0,
++					&Ke_gg_gaussian[0][0],0);
++
++		for( i=0; i<numdofp; i++) for(j=0;j<numdofm; j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
++	} 
++	for(i=0;i<numdofp;i++) for(j=0;j<numdofm;j++) Ke->values[(i+2*numdofm)*numdoftotal+j]+=Ke_gg[i][j];
++	for(i=0;i<numdofm;i++) for(j=0;j<numdofp;j++) Ke->values[i*numdoftotal+(j+2*numdofm)]+=Ke_gg[j][i];
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
++
++	/*Clean-up and return*/
++	delete tria->matice; delete tria;
++	delete gauss;
++	delete gauss_tria;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixCouplingMacAyealPattynFriction{{{*/
++ElementMatrix* Penta::CreateKMatrixCouplingMacAyealPattynFriction(void){
++
++	/*Constants*/
++	const int numnodes    = 2 *NUMVERTICES;
++	const int numdof      = NDOF2 *NUMVERTICES;
++	const int numdoftotal = NDOF4 *NUMVERTICES;
++	
++	/*Intermediaries */
++	int       i,j,ig,analysis_type;
++	IssmDouble    Jdet2d,slope_magnitude,alpha2;
++	IssmDouble    xyz_list[NUMVERTICES][3];
++	IssmDouble    xyz_list_tria[NUMVERTICES2D][3]={0.0};
++	IssmDouble    slope[3]={0.0,0.0,0.0};
++	IssmDouble    MAXSLOPE=.06; // 6 %
++	IssmDouble    MOUNTAINKEXPONENT=10;
++	IssmDouble    L[2][numdof];
++	IssmDouble    DL[2][2]                  ={{ 0,0 },{0,0}}; //for basal drag
++	IssmDouble    DL_scalar;
++	IssmDouble    Ke_gg[numdof][numdof]     ={0.0};
++	IssmDouble    Ke_gg_gaussian[numdof][numdof]; //stiffness matrix contribution from drag
++	Friction  *friction = NULL;
++	GaussPenta *gauss=NULL;
++	Node       *node_list[numnodes];
++	int         cs_list[numnodes];
++
++	/*Initialize Element matrix and return if necessary*/
++	if(IsFloating() || !IsOnBed()) return NULL;
++	ElementMatrix* Ke1=new ElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
++	ElementMatrix* Ke2=new ElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
++	ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
++	delete Ke1; delete Ke2;
++
++	/*Prepare node list*/
++	for(i=0;i<NUMVERTICES;i++){
++		node_list[i+0*NUMVERTICES] = this->nodes[i];
++		node_list[i+1*NUMVERTICES] = this->nodes[i];
++		cs_list[i+0*NUMVERTICES] = XYEnum;
++		cs_list[i+1*NUMVERTICES] = XYEnum;
++	}
++
++	/*retrieve inputs :*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_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);
++
++	/*build friction object, used later on: */
++	friction=new Friction("2d",inputs,matpar,analysis_type);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(0,1,2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/*Friction: */
++		friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum);
++
++		// If we have a slope > 6% for this element,  it means  we are on a mountain. In this particular case, 
++		//velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */
++		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
++		slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2));
++
++		if (slope_magnitude>MAXSLOPE){
++			alpha2=pow((IssmDouble)10,MOUNTAINKEXPONENT);
++		}
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
++		GetL(&L[0][0], gauss,NDOF2);
++
++		DL_scalar=alpha2*gauss->weight*Jdet2d;
++		for (i=0;i<2;i++) DL[i][i]=DL_scalar; 
++		
++		/*  Do the triple producte tL*D*L: */
++		TripleMultiply( &L[0][0],2,numdof,1,
++					&DL[0][0],2,2,0,
++					&L[0][0],2,numdof,0,
++					&Ke_gg_gaussian[0][0],0);
++
++		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
++	}
++
++	for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdoftotal+(numdof+j)]+=Ke_gg[i][j];
++	for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[(i+numdof)*numdoftotal+j]+=Ke_gg[i][j];
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixCouplingMacAyealStokes{{{*/
++ElementMatrix* Penta::CreateKMatrixCouplingMacAyealStokes(void){
++
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixCouplingMacAyealStokesViscous();
++	ElementMatrix* Ke2=CreateKMatrixCouplingMacAyealStokesFriction();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
++
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixCouplingMacAyealStokesViscous{{{*/
++ElementMatrix* Penta::CreateKMatrixCouplingMacAyealStokesViscous(void){
++
++	/*Constants*/
++	const int numnodes    = 2 *NUMVERTICES;
++	const int numdofm     = NDOF2 *NUMVERTICES2D;
++	const int numdofs     = NDOF4 *NUMVERTICES;
++	const int numdoftotal = 2 *numdofm+numdofs;
++
++	/*Intermediaries */
++	int         i,j,ig;
++	IssmDouble      Jdet;
++	IssmDouble      viscosity,stokesreconditioning; //viscosity
++	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      B[4][numdofs+3];
++	IssmDouble      Bprime[4][numdofm];
++	IssmDouble      B2[3][numdofm];
++	IssmDouble      Bprime2[3][numdofs+3];
++	IssmDouble      D[4][4]={0.0};            // material matrix, simple scalar matrix.
++	IssmDouble      D2[3][3]={0.0};            // material matrix, simple scalar matrix.
++	IssmDouble      D_scalar;
++	IssmDouble      Ke_gg[numdofs][numdofm]={0.0}; //local element stiffness matrix 
++	IssmDouble      Ke_gg2[numdofm][numdofs]={0.0}; //local element stiffness matrix 
++	IssmDouble      Ke_gg_gaussian[numdofs+3][numdofm]; //stiffness matrix evaluated at the gaussian point.
++	IssmDouble      Ke_gg_gaussian2[numdofm][numdofs+3]; //stiffness matrix evaluated at the gaussian point.
++	GaussPenta *gauss=NULL;
++	GaussTria  *gauss_tria=NULL;
++	Node       *node_list[numnodes];
++	int         cs_list[numnodes];
++
++	/*Find penta on bed as stokes must be coupled to the dofs on the bed: */
++	Penta* pentabase=GetBasalElement();
++	Tria* tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++
++	/*Prepare node list*/
++	for(i=0;i<NUMVERTICES;i++){
++		node_list[i+0*NUMVERTICES] = pentabase->nodes[i];
++		node_list[i+1*NUMVERTICES] = this->nodes[i];
++		cs_list[i+0*NUMVERTICES] = XYEnum;
++		cs_list[i+1*NUMVERTICES] = XYZPEnum;
++	}
++
++	/*Initialize Element matrix and return if necessary*/
++	ElementMatrix* Ke1=new ElementMatrix(pentabase->nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
++	ElementMatrix* Ke2=new ElementMatrix(this->nodes     ,NUMVERTICES,this->parameters,StokesApproximationEnum);
++	ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
++	delete Ke1; delete Ke2;
++
++	/* Get node coordinates and dof list: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	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 gaussian points: */
++	gauss=new GaussPenta(5,5);
++	gauss_tria=new GaussTria();
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++		gauss->SynchronizeGaussTria(gauss_tria);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetBMacAyealStokes(&B[0][0], &xyz_list[0][0], gauss);
++		tria->GetBprimeMacAyealStokes(&Bprime[0][0], &xyz_list[0][0], gauss_tria);
++		tria->GetBMacAyealStokes(&B2[0][0], &xyz_list[0][0], gauss_tria);
++		GetBprimeMacAyealStokes(&Bprime2[0][0], &xyz_list[0][0], gauss);
++
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity, &epsilon[0]);
++
++		D_scalar=2*viscosity*gauss->weight*Jdet;
++		for (i=0;i<3;i++) D[i][i]=D_scalar;
++		D[3][3]=-gauss->weight*Jdet*stokesreconditioning;
++		for (i=0;i<3;i++) D2[i][i]=D_scalar;
++
++		TripleMultiply( &B[0][0],4,numdofs+3,1,
++					&D[0][0],4,4,0,
++					&Bprime[0][0],4,numdofm,0,
++					&Ke_gg_gaussian[0][0],0);
++
++		TripleMultiply( &B2[0][0],3,numdofm,1,
++					&D2[0][0],3,3,0,
++					&Bprime2[0][0],3,numdofs+3,0,
++					&Ke_gg_gaussian2[0][0],0);
++
++		for( i=0; i<numdofs; i++) for(j=0;j<numdofm; j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
++		for( i=0; i<numdofm; i++) for(j=0;j<numdofs; j++) Ke_gg2[i][j]+=Ke_gg_gaussian2[i][j];
++	} 
++	for(i=0;i<numdofs;i++) for(j=0;j<numdofm;j++) Ke->values[(i+2*numdofm)*numdoftotal+j]+=Ke_gg[i][j];
++	for(i=0;i<numdofm;i++) for(j=0;j<numdofs;j++) Ke->values[i*numdoftotal+(j+2*numdofm)]+=Ke_gg2[i][j];
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
++
++	/*Clean-up and return*/
++	delete tria->matice; delete tria;
++	delete gauss;
++	delete gauss_tria;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixCouplingMacAyealStokesFriction {{{*/
++ElementMatrix* Penta::CreateKMatrixCouplingMacAyealStokesFriction(void){
++
++	/*Constants*/
++	const int numnodes  = 2 *NUMVERTICES;
++	const int numdof    = NUMVERTICES *NDOF4;
++	const int numdofm   = NUMVERTICES *NDOF2;
++	const int numdof2d  = NUMVERTICES2D *NDOF4;
++	const int numdof2dm = NUMVERTICES2D *NDOF2;
++	const int numdoftot = numdof+numdofm;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	int        analysis_type,approximation;
++	IssmDouble     stokesreconditioning;
++	IssmDouble     viscosity,alpha2_gauss,Jdet2d;
++	IssmDouble	  bed_normal[3];
++	IssmDouble     epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble	  xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble     LMacAyealStokes[8][numdof2dm];
++	IssmDouble     LprimeMacAyealStokes[8][numdof2d];
++	IssmDouble     DLMacAyealStokes[8][8]={0.0};
++	IssmDouble     LStokesMacAyeal[4][numdof2d];
++	IssmDouble     LprimeStokesMacAyeal[4][numdof2dm];
++	IssmDouble     DLStokesMacAyeal[4][4]={0.0};
++	IssmDouble     Ke_drag_gaussian[numdof2dm][numdof2d];
++	IssmDouble     Ke_drag_gaussian2[numdof2d][numdof2dm];
++	Friction*  friction=NULL;
++	GaussPenta *gauss=NULL;
++	Node       *node_list[numnodes];
++	int         cs_list[numnodes];
++
++	/*If on water or not Stokes, skip stiffness: */
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(IsFloating() || !IsOnBed()) return NULL;
++	ElementMatrix* Ke1=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
++	ElementMatrix* Ke2=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++	ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
++	delete Ke1; delete Ke2;
++
++	/*Prepare node list*/
++	for(i=0;i<NUMVERTICES;i++){
++		node_list[i+0*NUMVERTICES] = this->nodes[i];
++		node_list[i+1*NUMVERTICES] = this->nodes[i];
++		cs_list[i+0*NUMVERTICES] = XYEnum;
++		cs_list[i+1*NUMVERTICES] = XYZPEnum;
++	}
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	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);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++
++	/*build friction object, used later on: */
++	friction=new Friction("3d",inputs,matpar,analysis_type);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(0,1,2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
++		GetLMacAyealStokes(&LMacAyealStokes[0][0], gauss);
++		GetLprimeMacAyealStokes(&LprimeMacAyealStokes[0][0], &xyz_list[0][0], gauss);
++		GetLStokesMacAyeal(&LStokesMacAyeal[0][0], gauss);
++		GetLprimeStokesMacAyeal(&LprimeStokesMacAyeal[0][0], &xyz_list[0][0], gauss);
++
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++
++		BedNormal(&bed_normal[0],xyz_list_tria);
++		friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum);
++
++		DLMacAyealStokes[0][0]=alpha2_gauss*gauss->weight*Jdet2d;
++		DLMacAyealStokes[1][1]=alpha2_gauss*gauss->weight*Jdet2d;
++		DLMacAyealStokes[2][2]=-alpha2_gauss*gauss->weight*Jdet2d*bed_normal[0]*bed_normal[2];
++		DLMacAyealStokes[3][3]=-alpha2_gauss*gauss->weight*Jdet2d*bed_normal[1]*bed_normal[2];
++		DLMacAyealStokes[4][4]=-2*viscosity*gauss->weight*Jdet2d*bed_normal[0];
++		DLMacAyealStokes[5][5]=-2*viscosity*gauss->weight*Jdet2d*bed_normal[1];
++		DLMacAyealStokes[6][6]=stokesreconditioning*gauss->weight*Jdet2d*bed_normal[0];
++		DLMacAyealStokes[7][7]=stokesreconditioning*gauss->weight*Jdet2d*bed_normal[1];
++
++		DLStokesMacAyeal[0][0]=alpha2_gauss*gauss->weight*Jdet2d;
++		DLStokesMacAyeal[1][1]=alpha2_gauss*gauss->weight*Jdet2d;
++		DLStokesMacAyeal[2][2]=-alpha2_gauss*gauss->weight*Jdet2d*bed_normal[0]*bed_normal[2];
++		DLStokesMacAyeal[3][3]=-alpha2_gauss*gauss->weight*Jdet2d*bed_normal[1]*bed_normal[2];
++		
++		TripleMultiply( &LMacAyealStokes[0][0],8,numdof2dm,1,
++					&DLMacAyealStokes[0][0],8,8,0,
++					&LprimeMacAyealStokes[0][0],8,numdof2d,0,
++					&Ke_drag_gaussian[0][0],0);
++
++		TripleMultiply( &LStokesMacAyeal[0][0],4,numdof2d,1,
++					&DLStokesMacAyeal[0][0],4,4,0,
++					&LprimeStokesMacAyeal[0][0],4,numdof2dm,0,
++					&Ke_drag_gaussian2[0][0],0);
++
++		for(i=0;i<numdof2dm;i++) for(j=0;j<numdof2d;j++) Ke->values[i*numdoftot+j+numdofm]+=Ke_drag_gaussian[i][j];
++		for(i=0;i<numdof2d;i++) for(j=0;j<numdof2dm;j++) Ke->values[(i+numdofm)*numdoftot+j]+=Ke_drag_gaussian2[i][j];
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixCouplingPattynStokes{{{*/
++ElementMatrix* Penta::CreateKMatrixCouplingPattynStokes(void){
++
++	/*Constants*/
++	const int numnodes  = 2 *NUMVERTICES;
++	const int numdofp     = NDOF2 *NUMVERTICES;
++	const int numdofs     = NDOF4 *NUMVERTICES;
++	const int numdoftotal = (NDOF2+NDOF4) *NUMVERTICES;
++
++	/*Intermediaries*/
++	Node     *node_list[numnodes];
++	int       cs_list[numnodes];
++	int       i,j;
++
++	/*Prepare node list*/
++	for(i=0;i<NUMVERTICES;i++){
++		node_list[i+0*NUMVERTICES] = this->nodes[i];
++		node_list[i+1*NUMVERTICES] = this->nodes[i];
++		cs_list[i+0*NUMVERTICES] = XYEnum;
++		cs_list[i+1*NUMVERTICES] = XYZPEnum;
++	}
++
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
++	ElementMatrix* Ke2=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++	ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
++	delete Ke1;
++	delete Ke2;
++	Ke1=CreateKMatrixDiagnosticPattyn(); TransformInvStiffnessMatrixCoord(Ke1,this->nodes,NUMVERTICES,XYEnum);
++	Ke2=CreateKMatrixDiagnosticStokes(); TransformInvStiffnessMatrixCoord(Ke2,this->nodes,NUMVERTICES,XYZPEnum);
++
++	for(i=0;i<numdofs;i++) for(j=0;j<NUMVERTICES;j++){
++		Ke->values[(i+numdofp)*numdoftotal+NDOF2*j+0]+=Ke2->values[i*numdofs+NDOF4*j+0];
++		Ke->values[(i+numdofp)*numdoftotal+NDOF2*j+1]+=Ke2->values[i*numdofs+NDOF4*j+1];
++	}
++	for(i=0;i<numdofp;i++) for(j=0;j<NUMVERTICES;j++){
++		Ke->values[i*numdoftotal+numdofp+NDOF4*j+0]+=Ke1->values[i*numdofp+NDOF2*j+0];
++		Ke->values[i*numdoftotal+numdofp+NDOF4*j+1]+=Ke1->values[i*numdofp+NDOF2*j+1];
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
++
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticHoriz {{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticHoriz(void){
++
++	int approximation;
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	switch(approximation){
++		case MacAyealApproximationEnum:
++			return CreateKMatrixDiagnosticMacAyeal2d();
++		case PattynApproximationEnum:
++			return CreateKMatrixDiagnosticPattyn();
++		case StokesApproximationEnum:
++			return CreateKMatrixDiagnosticStokes();
++		case HutterApproximationEnum:
++			return NULL;
++		case NoneApproximationEnum:
++			return NULL;
++		case MacAyealPattynApproximationEnum:
++			return CreateKMatrixDiagnosticMacAyealPattyn();
++		case MacAyealStokesApproximationEnum:
++			return CreateKMatrixDiagnosticMacAyealStokes();
++		case PattynStokesApproximationEnum:
++			return CreateKMatrixDiagnosticPattynStokes();
++		default:
++			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticHutter{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticHutter(void){
++
++	/*Constants*/
++	const int numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries*/
++	int       connectivity[2];
++	int       i,i0,i1,j0,j1;
++	IssmDouble    one0,one1;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Spawn 3 beam elements: */
++	for(i=0;i<3;i++){
++		/*2 dofs of first node*/
++		i0=2*i;
++		i1=2*i+1;
++		/*2 dofs of second node*/
++		j0=2*(i+3);
++		j1=2*(i+3)+1;
++
++		/*Find connectivity for the two nodes*/
++		connectivity[0]=nodes[i]->GetConnectivity();
++		connectivity[1]=nodes[i+3]->GetConnectivity();
++		one0=1/(IssmDouble)connectivity[0];
++		one1=1/(IssmDouble)connectivity[1];
++
++		/*Create matrix for these two nodes*/
++		if (IsOnBed() && IsOnSurface()){
++			Ke->values[i0*numdof+i0]=one0;
++			Ke->values[i1*numdof+i1]=one0;
++			Ke->values[j0*numdof+i0]=-one1;
++			Ke->values[j0*numdof+j0]=one1;
++			Ke->values[j1*numdof+i1]=-one1;
++			Ke->values[j1*numdof+j1]=one1;
++		}
++		else if (IsOnBed()){
++			Ke->values[i0*numdof+i0]=one0;
++			Ke->values[i1*numdof+i1]=one0;
++			Ke->values[j0*numdof+i0]=-2*one1;
++			Ke->values[j0*numdof+j0]=2*one1;
++			Ke->values[j1*numdof+i1]=-2*one1;
++			Ke->values[j1*numdof+j1]=2*one1;
++		}
++		else if (IsOnSurface()){
++			Ke->values[j0*numdof+i0]=-one1;
++			Ke->values[j0*numdof+j0]=one1;
++			Ke->values[j1*numdof+i1]=-one1;
++			Ke->values[j1*numdof+j1]=one1;
++		}
++		else{ //node is on two horizontal layers and beams include the values only once, so the have to use half of the connectivity
++			Ke->values[j0*numdof+i0]=-2*one1;
++			Ke->values[j0*numdof+j0]=2*one1;
++			Ke->values[j1*numdof+i1]=-2*one1;
++			Ke->values[j1*numdof+j1]=2*one1;
++		}
++	}
++
++	/*Clean up and return*/
++	return Ke;
++}/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyeal2d{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyeal2d(void){
++
++	/*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 
++	  bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 
++	  the stiffness matrix. */
++	if (!IsOnBed()) return NULL;
++
++	/*Depth Averaging B*/
++	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyeal();
++	delete tria->matice; delete tria;
++
++	/*Delete B averaged*/
++	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++
++	/*clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyeal3d{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyeal3d(void){
++
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixDiagnosticMacAyeal3dViscous();
++	ElementMatrix* Ke2=CreateKMatrixDiagnosticMacAyeal3dFriction();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
++
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyeal3dViscous{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyeal3dViscous(void){
++
++	/*Constants*/
++	const int    numdof2d=2*NUMVERTICES2D;
++
++	/*Intermediaries */
++	int         i,j,ig,approximation;
++	IssmDouble      Jdet;
++	IssmDouble      viscosity, oldviscosity, newviscosity, viscosity_overshoot;
++	IssmDouble      epsilon[5],oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble      epsilons[6]; //6 for stokes
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      B[3][numdof2d];
++	IssmDouble      Bprime[3][numdof2d];
++	IssmDouble      D[3][3]={0.0};            // material matrix, simple scalar matrix.
++	IssmDouble      D_scalar;
++	IssmDouble      Ke_gg_gaussian[numdof2d][numdof2d]; //stiffness matrix evaluated at the gaussian point.
++	Tria*       tria=NULL;
++	Penta*      pentabase=NULL;
++	GaussPenta *gauss=NULL;
++	GaussTria  *gauss_tria=NULL;
++
++	/*Find penta on bed as this is a macayeal elements: */
++	pentabase=GetBasalElement();
++	tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(tria->nodes,NUMVERTICES2D,this->parameters,MacAyealApproximationEnum);
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes,NUMVERTICES);
++	this->parameters->FindParam(&viscosity_overshoot,DiagnosticViscosityOvershootEnum);
++	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
++	Input* vxold_input=inputs->GetInput(VxPicardEnum); _assert_(vxold_input);
++	Input* vyold_input=inputs->GetInput(VyPicardEnum); _assert_(vyold_input);
++	Input* vz_input=inputs->GetInput(VzEnum);       _assert_(vz_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(5,5);
++	gauss_tria=new GaussTria();
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++		gauss->SynchronizeGaussTria(gauss_tria);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		tria->GetBMacAyeal(&B[0][0], &xyz_list[0][0], gauss_tria);
++		tria->GetBprimeMacAyeal(&Bprime[0][0], &xyz_list[0][0], gauss_tria);
++
++		if(approximation==MacAyealPattynApproximationEnum){
++			this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++			this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
++			matice->GetViscosity3d(&viscosity, &epsilon[0]);
++			matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
++
++			newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
++		}
++		else if (approximation==MacAyealStokesApproximationEnum){
++			this->GetStrainRate3d(&epsilons[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++			matice->GetViscosity3dStokes(&newviscosity,&epsilons[0]);
++		}
++		else _error2_("approximation " << approximation << " (" << EnumToStringx(approximation) << ") not supported yet");
++
++		D_scalar=2*newviscosity*gauss->weight*Jdet;
++		for (i=0;i<3;i++) D[i][i]=D_scalar;
++
++		TripleMultiply( &B[0][0],3,numdof2d,1,
++					&D[0][0],3,3,0,
++					&Bprime[0][0],3,numdof2d,0,
++					&Ke_gg_gaussian[0][0],0);
++
++		for(i=0;i<numdof2d;i++) for(j=0;j<numdof2d;j++) Ke->values[i*numdof2d+j]+=Ke_gg_gaussian[i][j];
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,tria->nodes,NUMVERTICES2D,XYEnum);
++
++	/*Clean up and return*/
++	delete tria->matice;
++	delete tria;
++	delete gauss_tria;
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyeal3dFriction{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyeal3dFriction(void){
++
++	/*Initialize Element matrix and return if necessary*/
++	if(IsFloating() || !IsOnBed()) return NULL;
++
++	/*Build a tria element using the 3 nodes of the base of the penta. Then use 
++	 * the tria functionality to build a friction stiffness matrix on these 3
++	 * nodes: */
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyealFriction();
++	delete tria->matice; delete tria;
++
++	/*clean-up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyealPattyn{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyealPattyn(void){
++
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixDiagnosticMacAyeal3d();
++	ElementMatrix* Ke2=CreateKMatrixDiagnosticPattyn();
++	ElementMatrix* Ke3=CreateKMatrixCouplingMacAyealPattyn();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2,Ke3);
++
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	delete Ke3;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticMacAyealStokes{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticMacAyealStokes(void){
++
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixDiagnosticMacAyeal3d();
++	ElementMatrix* Ke2=CreateKMatrixDiagnosticStokes();
++	ElementMatrix* Ke3=CreateKMatrixCouplingMacAyealStokes();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2,Ke3);
++
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	delete Ke3;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticPattyn{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticPattyn(void){
++
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixDiagnosticPattynViscous();
++	ElementMatrix* Ke2=CreateKMatrixDiagnosticPattynFriction();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
++
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticPattynViscous{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticPattynViscous(void){
++
++	/*Constants*/
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	int        approximation;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     Jdet;
++	IssmDouble     viscosity,oldviscosity,newviscosity,viscosity_overshoot; //viscosity
++	IssmDouble     epsilon[5],oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble     D_scalar;
++	IssmDouble     D[5][5]={0.0};            // material matrix, simple scalar matrix.
++	IssmDouble     B[5][numdof];
++	IssmDouble     Bprime[5][numdof];
++	Tria*      tria=NULL;
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&viscosity_overshoot,DiagnosticViscosityOvershootEnum);
++	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
++	Input* vxold_input=inputs->GetInput(VxPicardEnum); _assert_(vxold_input);
++	Input* vyold_input=inputs->GetInput(VyPicardEnum); _assert_(vyold_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(5,5);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetBPattyn(&B[0][0], &xyz_list[0][0], gauss);
++		GetBprimePattyn(&Bprime[0][0], &xyz_list[0][0], gauss);
++
++		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
++		matice->GetViscosity3d(&viscosity, &epsilon[0]);
++		matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
++		newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
++
++		D_scalar=2*newviscosity*gauss->weight*Jdet;
++		for (i=0;i<5;i++) D[i][i]=D_scalar;
++
++		TripleMultiply( &B[0][0],5,numdof,1,
++					&D[0][0],5,5,0,
++					&Bprime[0][0],5,numdof,0,
++					&Ke->values[0],1);
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticPattynFriction{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticPattynFriction(void){
++
++	/*Constants*/
++	const int numdof   = NDOF2*NUMVERTICES;
++	
++	/*Intermediaries */
++	int       i,j,ig;
++	int       analysis_type;
++	IssmDouble    xyz_list[NUMVERTICES][3];
++	IssmDouble    xyz_list_tria[NUMVERTICES2D][3]={0.0};
++	IssmDouble    slope_magnitude,alpha2,Jdet;
++	IssmDouble    slope[3]={0.0,0.0,0.0};
++	IssmDouble    MAXSLOPE=.06; // 6 %
++	IssmDouble    MOUNTAINKEXPONENT=10;
++	IssmDouble    L[2][numdof];
++	IssmDouble    DL[2][2]={{ 0,0 },{0,0}}; //for basal drag
++	IssmDouble    DL_scalar;
++	Friction  *friction = NULL;
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element matrix and return if necessary*/
++	if(IsFloating() || !IsOnBed()) return NULL;
++
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_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);
++
++	/*build friction object, used later on: */
++	friction=new Friction("2d",inputs,matpar,analysis_type);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(0,1,2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet, &xyz_list_tria[0][0],gauss);
++		GetL(&L[0][0], gauss,NDOF2);
++
++		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
++		friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum); 
++		slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2));
++
++		// If we have a slope > 6% for this element,  it means  we are on a mountain. In this particular case, 
++		//velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */
++		if (slope_magnitude>MAXSLOPE){
++			alpha2=pow((IssmDouble)10,MOUNTAINKEXPONENT);
++		}
++		
++		DL_scalar=alpha2*gauss->weight*Jdet;
++		for (i=0;i<2;i++) DL[i][i]=DL_scalar;
++		
++		TripleMultiply( &L[0][0],2,numdof,1,
++					&DL[0][0],2,2,0,
++					&L[0][0],2,numdof,0,
++					&Ke->values[0],1);
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticPattynStokes{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticPattynStokes(void){
++
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixDiagnosticPattyn();
++	ElementMatrix* Ke2=CreateKMatrixDiagnosticStokes();
++	ElementMatrix* Ke3=CreateKMatrixCouplingPattynStokes();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2,Ke3);
++
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	delete Ke3;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticStokes{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticStokes(void){
++
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixDiagnosticStokesViscous();
++	ElementMatrix* Ke2=CreateKMatrixDiagnosticStokesFriction();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
++
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticStokesViscous {{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticStokesViscous(void){
++
++	/*Intermediaries */
++	int        i,j,ig,approximation;
++	IssmDouble     Jdet,viscosity,stokesreconditioning;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
++	IssmDouble     B[8][27];
++	IssmDouble     B_prime[8][27];
++	IssmDouble     D_scalar;
++	IssmDouble     D[8][8]={0.0};
++	IssmDouble     Ke_temp[27][27]={0.0}; //for the six nodes and the bubble 
++	GaussPenta *gauss=NULL;
++
++	/*If on water or not Stokes, skip stiffness: */
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum && approximation!=PattynStokesApproximationEnum) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	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 gaussian points: */
++	gauss=new GaussPenta(5,5);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetBStokes(&B[0][0],&xyz_list[0][0],gauss); 
++		GetBprimeStokes(&B_prime[0][0],&xyz_list[0][0],gauss); 
++
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++
++		D_scalar=gauss->weight*Jdet;
++		for (i=0;i<6;i++) D[i][i]=D_scalar*2*viscosity;
++		for (i=6;i<8;i++) D[i][i]=-D_scalar*stokesreconditioning;
++
++		TripleMultiply( &B[0][0],8,27,1,
++					&D[0][0],8,8,0,
++					&B_prime[0][0],8,27,0,
++					&Ke_temp[0][0],1);
++	}
++
++	/*Condensation*/
++	ReduceMatrixStokes(Ke->values, &Ke_temp[0][0]);
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticStokesFriction{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticStokesFriction(void){
++
++	/*Constants*/
++	const int numdof=NUMVERTICES*NDOF4;
++	const int numdof2d=NUMVERTICES2D*NDOF4;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	int        analysis_type,approximation;
++	IssmDouble     alpha2,Jdet2d;
++	IssmDouble     stokesreconditioning,viscosity;
++	IssmDouble     epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble	  xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble     LStokes[2][numdof2d];
++	IssmDouble     DLStokes[2][2]={0.0};
++	IssmDouble     Ke_drag_gaussian[numdof2d][numdof2d];
++	Friction*  friction=NULL;
++	GaussPenta *gauss=NULL;
++
++	/*If on water or not Stokes, skip stiffness: */
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(IsFloating() || !IsOnBed() || (approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum &&  approximation!=PattynStokesApproximationEnum)) return NULL;
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	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);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++
++	/*build friction object, used later on: */
++	friction=new Friction("3d",inputs,matpar,analysis_type);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(0,1,2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
++		GetLStokes(&LStokes[0][0], gauss);
++
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++
++		friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum);
++
++		DLStokes[0][0] = +alpha2*gauss->weight*Jdet2d; //taub_x = -alpha2 vx
++		DLStokes[1][1] = +alpha2*gauss->weight*Jdet2d; //taub_y = -alpha2 vy
++
++		TripleMultiply( &LStokes[0][0],2,numdof2d,1,
++					&DLStokes[0][0],2,2,0,
++					&LStokes[0][0],2,numdof2d,0,
++					&Ke_drag_gaussian[0][0],0);
++
++		for(i=0;i<numdof2d;i++) for(j=0;j<numdof2d;j++) Ke->values[i*numdof+j]+=Ke_drag_gaussian[i][j];
++	}
++
++	/*DO NOT Transform Coordinate System: this stiffness matrix is already expressed in tangential coordinates*/
++	//TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
++	
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticVert {{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticVert(void){
++	
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixDiagnosticVertVolume();
++	ElementMatrix* Ke2=CreateKMatrixDiagnosticVertSurface();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
++
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticVertVolume {{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticVertVolume(void){
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int         i,j,ig;
++	IssmDouble      Jdet;
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      B[NDOF1][NUMVERTICES];
++	IssmDouble      Bprime[NDOF1][NUMVERTICES];
++	IssmDouble      DL_scalar;
++	GaussPenta  *gauss=NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetBVert(&B[0][0], &xyz_list[0][0], gauss);
++		GetBprimeVert(&Bprime[0][0], &xyz_list[0][0], gauss);
++
++		DL_scalar=gauss->weight*Jdet;
++
++		TripleMultiply( &B[0][0],1,NUMVERTICES,1,
++					&DL_scalar,1,1,0,
++					&Bprime[0][0],1,NUMVERTICES,0,
++					&Ke->values[0],1);
++	} 
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticVertSurface {{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticVertSurface(void){
++
++	if (!IsOnSurface()) return NULL;
++
++	/*Constants*/
++	const int numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int       i,j,ig;
++	IssmDouble    xyz_list[NUMVERTICES][3];
++	IssmDouble    xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble    surface_normal[3];
++	IssmDouble    Jdet2d,DL_scalar;
++	IssmDouble    basis[NUMVERTICES];
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i+3][j];
++	SurfaceNormal(&surface_normal[0],xyz_list_tria);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(3,4,5,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
++		GetNodalFunctionsP1(&basis[0], gauss);
++
++		DL_scalar= - gauss->weight*Jdet2d*surface_normal[2]; 
++
++		TripleMultiply( basis,1,numdof,1,
++					&DL_scalar,1,1,0,
++					basis,1,numdof,0,
++					&Ke->values[0],1);
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorCouplingMacAyealStokes {{{*/
++ElementVector* Penta::CreatePVectorCouplingMacAyealStokes(void){
++
++	/*compute all load vectors for this element*/
++	ElementVector* pe1=CreatePVectorCouplingMacAyealStokesViscous();
++	ElementVector* pe2=CreatePVectorCouplingMacAyealStokesFriction();
++	ElementVector* pe =new ElementVector(pe1,pe2);
++
++	/*clean-up and return*/
++	delete pe1;
++	delete pe2;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorCouplingMacAyealStokesViscous {{{*/
++ElementVector* Penta::CreatePVectorCouplingMacAyealStokesViscous(void){
++
++	/*Constants*/
++	const int   numdof=NUMVERTICES*NDOF4;
++
++	/*Intermediaries */
++	int         i,j,ig;
++	int         approximation;
++	IssmDouble      viscosity,Jdet;
++	IssmDouble      stokesreconditioning;
++	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
++	IssmDouble      dw[3];
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      basis[6]; //for the six nodes of the penta
++	IssmDouble      dbasis[3][6]; //for the six nodes of the penta
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element vector and return if necessary*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(approximation!=MacAyealStokesApproximationEnum) return NULL;
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	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* vzmacayeal_input=inputs->GetInput(VzMacAyealEnum);   _assert_(vzmacayeal_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(5,5);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsP1(&basis[0], gauss);
++		GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
++
++		vzmacayeal_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
++
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++
++		for(i=0;i<NUMVERTICES;i++){
++			pe->values[i*NDOF4+0]+=-Jdet*gauss->weight*viscosity*dw[0]*dbasis[2][i];
++			pe->values[i*NDOF4+1]+=-Jdet*gauss->weight*viscosity*dw[1]*dbasis[2][i];
++			pe->values[i*NDOF4+2]+=-Jdet*gauss->weight*viscosity*(dw[0]*dbasis[0][i]+dw[1]*dbasis[1][i]+2*dw[2]*dbasis[2][i]);
++			pe->values[i*NDOF4+3]+=Jdet*gauss->weight*stokesreconditioning*dw[2]*basis[i];
++		}
++	}
++
++	/*Transform coordinate system*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorCouplingMacAyealStokesFriction{{{*/
++ElementVector* Penta::CreatePVectorCouplingMacAyealStokesFriction(void){
++
++	/*Constants*/
++	const int numdof=NUMVERTICES*NDOF4;
++
++	/*Intermediaries*/
++	int         i,j,ig;
++	int         approximation,analysis_type;
++	IssmDouble      Jdet,Jdet2d;
++	IssmDouble      stokesreconditioning;
++	IssmDouble	   bed_normal[3];
++	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
++	IssmDouble      viscosity, w, alpha2_gauss;
++	IssmDouble      dw[3];
++	IssmDouble	   xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      basis[6]; //for the six nodes of the penta
++	Tria*       tria=NULL;
++	Friction*   friction=NULL;
++	GaussPenta  *gauss=NULL;
++
++	/*Initialize Element vector and return if necessary*/
++	if(!IsOnBed() || IsFloating()) return NULL;
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(approximation!=MacAyealStokesApproximationEnum) return NULL;
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	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* vzmacayeal_input=inputs->GetInput(VzMacAyealEnum);   _assert_(vzmacayeal_input);
++
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++
++	/*build friction object, used later on: */
++	friction=new Friction("3d",inputs,matpar,analysis_type);
++
++	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
++	gauss=new GaussPenta(0,1,2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
++		GetNodalFunctionsP1(basis, gauss);
++
++		vzmacayeal_input->GetInputValue(&w, gauss);
++		vzmacayeal_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
++
++		BedNormal(&bed_normal[0],xyz_list_tria);
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum);
++
++		for(i=0;i<NUMVERTICES2D;i++){
++			pe->values[i*NDOF4+0]+=Jdet2d*gauss->weight*(alpha2_gauss*w*bed_normal[0]*bed_normal[2]+2*viscosity*dw[2]*bed_normal[0])*basis[i];
++			pe->values[i*NDOF4+1]+=Jdet2d*gauss->weight*(alpha2_gauss*w*bed_normal[1]*bed_normal[2]+2*viscosity*dw[2]*bed_normal[1])*basis[i];
++			pe->values[i*NDOF4+2]+=Jdet2d*gauss->weight*2*viscosity*(dw[0]*bed_normal[0]+dw[1]*bed_normal[1]+dw[2]*bed_normal[2])*basis[i];
++		}
++	}
++
++	/*Transform coordinate system*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorCouplingPattynStokes {{{*/
++ElementVector* Penta::CreatePVectorCouplingPattynStokes(void){
++
++	/*compute all load vectors for this element*/
++	ElementVector* pe1=CreatePVectorCouplingPattynStokesViscous();
++	ElementVector* pe2=CreatePVectorCouplingPattynStokesFriction();
++	ElementVector* pe =new ElementVector(pe1,pe2);
++
++	/*clean-up and return*/
++	delete pe1;
++	delete pe2;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorCouplingPattynStokesViscous {{{*/
++ElementVector* Penta::CreatePVectorCouplingPattynStokesViscous(void){
++
++	/*Constants*/
++	const int   numdof=NUMVERTICES*NDOF4;
++
++	/*Intermediaries */
++	int         i,j,ig;
++	int         approximation;
++	IssmDouble      viscosity,Jdet;
++	IssmDouble      stokesreconditioning;
++	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
++	IssmDouble      dw[3];
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      basis[6]; //for the six nodes of the penta
++	IssmDouble      dbasis[3][6]; //for the six nodes of the penta
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element vector and return if necessary*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(approximation!=PattynStokesApproximationEnum) return NULL;
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	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* vzpattyn_input=inputs->GetInput(VzPattynEnum);   _assert_(vzpattyn_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(5,5);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsP1(&basis[0], gauss);
++		GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
++
++		vzpattyn_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
++
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++
++		for(i=0;i<NUMVERTICES;i++){
++			pe->values[i*NDOF4+0]+=-Jdet*gauss->weight*viscosity*dw[0]*dbasis[2][i];
++			pe->values[i*NDOF4+1]+=-Jdet*gauss->weight*viscosity*dw[1]*dbasis[2][i];
++			pe->values[i*NDOF4+2]+=-Jdet*gauss->weight*viscosity*(dw[0]*dbasis[0][i]+dw[1]*dbasis[1][i]+2*dw[2]*dbasis[2][i]);
++			pe->values[i*NDOF4+3]+=Jdet*gauss->weight*stokesreconditioning*dw[2]*basis[i];
++		}
++	}
++
++	/*Transform coordinate system*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorCouplingPattynStokesFriction{{{*/
++ElementVector* Penta::CreatePVectorCouplingPattynStokesFriction(void){
++
++	/*Constants*/
++	const int numdof=NUMVERTICES*NDOF4;
++
++	/*Intermediaries*/
++	int         i,j,ig;
++	int         approximation,analysis_type;
++	IssmDouble      Jdet,Jdet2d;
++	IssmDouble      stokesreconditioning;
++	IssmDouble	   bed_normal[3];
++	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
++	IssmDouble      viscosity, w, alpha2_gauss;
++	IssmDouble      dw[3];
++	IssmDouble	   xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      basis[6]; //for the six nodes of the penta
++	Tria*       tria=NULL;
++	Friction*   friction=NULL;
++	GaussPenta  *gauss=NULL;
++
++	/*Initialize Element vector and return if necessary*/
++	if(!IsOnBed() || IsFloating()) return NULL;
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(approximation!=PattynStokesApproximationEnum) return NULL;
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	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* vzpattyn_input=inputs->GetInput(VzPattynEnum);   _assert_(vzpattyn_input);
++
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++
++	/*build friction object, used later on: */
++	friction=new Friction("3d",inputs,matpar,analysis_type);
++
++	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
++	gauss=new GaussPenta(0,1,2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
++		GetNodalFunctionsP1(basis, gauss);
++
++		vzpattyn_input->GetInputValue(&w, gauss);
++		vzpattyn_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
++
++		BedNormal(&bed_normal[0],xyz_list_tria);
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum);
++
++		for(i=0;i<NUMVERTICES2D;i++){
++			pe->values[i*NDOF4+0]+=Jdet2d*gauss->weight*(alpha2_gauss*w*bed_normal[0]*bed_normal[2]+2*viscosity*dw[2]*bed_normal[0])*basis[i];
++			pe->values[i*NDOF4+1]+=Jdet2d*gauss->weight*(alpha2_gauss*w*bed_normal[1]*bed_normal[2]+2*viscosity*dw[2]*bed_normal[1])*basis[i];
++			pe->values[i*NDOF4+2]+=Jdet2d*gauss->weight*2*viscosity*(dw[0]*bed_normal[0]+dw[1]*bed_normal[1]+dw[2]*bed_normal[2])*basis[i];
++		}
++	}
++
++	/*Transform coordinate system*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticHoriz{{{*/
++ElementVector* Penta::CreatePVectorDiagnosticHoriz(void){
++
++	int approximation;
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	switch(approximation){
++		case MacAyealApproximationEnum:
++			return CreatePVectorDiagnosticMacAyeal();
++		case PattynApproximationEnum:
++			return CreatePVectorDiagnosticPattyn();
++		case HutterApproximationEnum:
++			return NULL;
++		case NoneApproximationEnum:
++			return NULL;
++		case StokesApproximationEnum:
++			return CreatePVectorDiagnosticStokes();
++		case MacAyealPattynApproximationEnum:
++			return CreatePVectorDiagnosticMacAyealPattyn();
++		case MacAyealStokesApproximationEnum:
++			return CreatePVectorDiagnosticMacAyealStokes();
++		case PattynStokesApproximationEnum:
++			return CreatePVectorDiagnosticPattynStokes();
++		default:
++			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticMacAyealPattyn{{{*/
++ElementVector* Penta::CreatePVectorDiagnosticMacAyealPattyn(void){
++
++	/*compute all load vectors for this element*/
++	ElementVector* pe1=CreatePVectorDiagnosticMacAyeal();
++	ElementVector* pe2=CreatePVectorDiagnosticPattyn();
++	ElementVector* pe =new ElementVector(pe1,pe2);
++
++	/*clean-up and return*/
++	delete pe1;
++	delete pe2;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticMacAyealStokes{{{*/
++ElementVector* Penta::CreatePVectorDiagnosticMacAyealStokes(void){
++
++	/*compute all load vectors for this element*/
++	ElementVector* pe1=CreatePVectorDiagnosticMacAyeal();
++	ElementVector* pe2=CreatePVectorDiagnosticStokes();
++	ElementVector* pe3=CreatePVectorCouplingMacAyealStokes();
++	ElementVector* pe =new ElementVector(pe1,pe2,pe3);
++
++	/*clean-up and return*/
++	delete pe1;
++	delete pe2;
++	delete pe3;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticPattynStokes{{{*/
++ElementVector* Penta::CreatePVectorDiagnosticPattynStokes(void){
++
++	/*compute all load vectors for this element*/
++	ElementVector* pe1=CreatePVectorDiagnosticPattyn();
++	ElementVector* pe2=CreatePVectorDiagnosticStokes();
++	ElementVector* pe3=CreatePVectorCouplingPattynStokes();
++	ElementVector* pe =new ElementVector(pe1,pe2,pe3);
++
++	/*clean-up and return*/
++	delete pe1;
++	delete pe2;
++	delete pe3;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticHutter{{{*/
++ElementVector* Penta::CreatePVectorDiagnosticHutter(void){
++
++	/*Constants*/
++	const int numdofs=NDOF2*NUMVERTICES;
++
++	/*Intermediaries*/
++	int          i,j,k,ig;
++	int          node0,node1;
++	int          connectivity[2];
++	IssmDouble       Jdet;
++	IssmDouble       xyz_list[NUMVERTICES][3];
++	IssmDouble       xyz_list_segment[2][3];
++	IssmDouble       z_list[NUMVERTICES];
++	IssmDouble       z_segment[2],slope[2];
++	IssmDouble       slope2,constant_part;
++	IssmDouble       rho_ice,gravity,n,B;
++	IssmDouble       ub,vb,z_g,surface,thickness;
++	GaussPenta*  gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	rho_ice=matpar->GetRhoIce();
++	gravity=matpar->GetG();
++	n=matice->GetN();
++	B=matice->GetB();
++	Input* thickness_input=inputs->GetInput(ThicknessEnum);  _assert_(thickness_input);
++	Input* surface_input=inputs->GetInput(SurfaceEnum);      _assert_(surface_input);
++	Input* slopex_input=inputs->GetInput(SurfaceSlopeXEnum); _assert_(slopex_input);
++	Input* slopey_input=inputs->GetInput(SurfaceSlopeYEnum); _assert_(slopey_input);
++	for(i=0;i<NUMVERTICES;i++)z_list[i]=xyz_list[i][2];
++
++	/*Loop on the three segments*/
++	for(i=0;i<3;i++){
++		node0=i;
++		node1=i+3;
++
++		for(j=0;j<3;j++){
++			xyz_list_segment[0][j]=xyz_list[node0][j];
++			xyz_list_segment[1][j]=xyz_list[node1][j];
++		}
++
++		connectivity[0]=nodes[node0]->GetConnectivity();
++		connectivity[1]=nodes[node1]->GetConnectivity();
++
++		/*Loop on the Gauss points: */
++		gauss=new GaussPenta(node0,node1,3);
++		for(ig=gauss->begin();ig<gauss->end();ig++){
++			gauss->GaussPoint(ig);
++
++			slopex_input->GetInputValue(&slope[0],gauss);
++			slopey_input->GetInputValue(&slope[1],gauss);
++			surface_input->GetInputValue(&surface,gauss);
++			thickness_input->GetInputValue(&thickness,gauss);
++
++			slope2=pow(slope[0],2)+pow(slope[1],2);
++			constant_part=-2*pow(rho_ice*gravity,n)*pow(slope2,((n-1)/2));
++
++			PentaRef::GetInputValue(&z_g,&z_list[0],gauss);
++			GetSegmentJacobianDeterminant(&Jdet,&xyz_list_segment[0][0],gauss);
++
++			if (IsOnSurface()){
++				for(j=0;j<NDOF2;j++) pe->values[2*node1+j]+=constant_part*pow((surface-z_g)/B,n)*slope[j]*Jdet*gauss->weight/(IssmDouble)connectivity[1];
++			}
++			else{//connectivity is too large, should take only half on it
++				for(j=0;j<NDOF2;j++) pe->values[2*node1+j]+=constant_part*pow((surface-z_g)/B,n)*slope[j]*Jdet*gauss->weight*2/(IssmDouble)connectivity[1];
++			}
++		}
++		delete gauss;
++
++		//Deal with lower surface
++		if (IsOnBed()){
++			constant_part=-1.58*pow((IssmDouble)10.0,-(IssmDouble)10.0)*rho_ice*gravity*thickness;
++			ub=constant_part*slope[0];
++			vb=constant_part*slope[1];
++
++			pe->values[2*node0]+=ub/(IssmDouble)connectivity[0];
++			pe->values[2*node0+1]+=vb/(IssmDouble)connectivity[0];
++		}
++	}
++
++	/*Clean up and return*/
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticMacAyeal{{{*/
++ElementVector* Penta::CreatePVectorDiagnosticMacAyeal(void){
++
++	if (!IsOnBed()) return NULL;
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementVector* pe=tria->CreatePVectorDiagnosticMacAyeal();
++	delete tria->matice; delete tria;
++
++	/*Clean up and return*/
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticPattyn{{{*/
++ElementVector* Penta::CreatePVectorDiagnosticPattyn(void){
++
++	/*Constants*/
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries*/
++	int         i,j,ig;
++	IssmDouble      Jdet;
++	IssmDouble      slope[3]; //do not put 2! this goes into GetInputDerivativeValue, which addresses slope[3] also!
++	IssmDouble      driving_stress_baseline,thickness;
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble      basis[6];
++	GaussPenta  *gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
++	Input* surface_input=inputs->GetInput(SurfaceEnum);     _assert_(surface_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(2,3);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsP1(basis, gauss);
++
++		thickness_input->GetInputValue(&thickness, gauss);
++		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
++
++		driving_stress_baseline=matpar->GetRhoIce()*matpar->GetG();
++
++		for(i=0;i<NUMVERTICES;i++) for(j=0;j<NDOF2;j++) pe->values[i*NDOF2+j]+= -driving_stress_baseline*slope[j]*Jdet*gauss->weight*basis[i];
++	}
++
++	/*Transform coordinate system*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticStokes {{{*/
++ElementVector* Penta::CreatePVectorDiagnosticStokes(void){
++
++	/*compute all load vectors for this element*/
++	ElementVector* pe1=CreatePVectorDiagnosticStokesViscous();
++	ElementVector* pe2=CreatePVectorDiagnosticStokesShelf();
++	ElementVector* pe =new ElementVector(pe1,pe2);
++
++	/*clean-up and return*/
++	delete pe1;
++	delete pe2;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticStokesViscous {{{*/
++ElementVector* Penta::CreatePVectorDiagnosticStokesViscous(void){
++
++	/*Constants*/
++	const int numdofbubble=NDOF4*NUMVERTICES+NDOF3*1;
++
++	/*Intermediaries*/
++	int        i,j,ig;
++	int        approximation;
++	IssmDouble     Jdet,viscosity;
++	IssmDouble     gravity,rho_ice,stokesreconditioning;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
++	IssmDouble     l1l7[7]; //for the six nodes and the bubble 
++	IssmDouble     B[8][numdofbubble];
++	IssmDouble     B_prime[8][numdofbubble];
++	IssmDouble     B_prime_bubble[8][3];
++	IssmDouble     D[8][8]={0.0};
++	IssmDouble     D_scalar;
++	IssmDouble     Pe_gaussian[numdofbubble]={0.0}; //for the six nodes and the bubble 
++	IssmDouble     Ke_temp[numdofbubble][3]={0.0}; //for the six nodes and the bubble 
++	IssmDouble     Ke_gaussian[numdofbubble][3];
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element vector and return if necessary*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum && approximation!=PattynStokesApproximationEnum) return NULL;
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	rho_ice=matpar->GetRhoIce();
++	gravity=matpar->GetG();
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	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 gaussian points: */
++	gauss=new GaussPenta(5,5);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetBStokes(&B[0][0],&xyz_list[0][0],gauss); 
++		GetBprimeStokes(&B_prime[0][0],&xyz_list[0][0], gauss); 
++		GetNodalFunctionsMINI(&l1l7[0], gauss);
++
++		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++
++		for(i=0;i<NUMVERTICES+1;i++){
++			Pe_gaussian[i*NDOF4+2]+=-rho_ice*gravity*Jdet*gauss->weight*l1l7[i];
++		}
++
++		/*Get bubble part of Bprime */
++		for(i=0;i<8;i++) for(j=0;j<3;j++) B_prime_bubble[i][j]=B_prime[i][j+24];
++
++		D_scalar=gauss->weight*Jdet;
++		for (i=0;i<6;i++) D[i][i]=D_scalar*2*viscosity;
++		for (i=6;i<8;i++) D[i][i]=-D_scalar*stokesreconditioning;
++
++		TripleMultiply(&B[0][0],8,numdofbubble,1,
++					&D[0][0],8,8,0,
++					&B_prime_bubble[0][0],8,3,0,
++					&Ke_temp[0][0],1);
++	}
++
++	/*Condensation*/
++	ReduceVectorStokes(pe->values, &Ke_temp[0][0], &Pe_gaussian[0]);
++
++	/*Transform coordinate system*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticStokesShelf{{{*/
++ElementVector* Penta::CreatePVectorDiagnosticStokesShelf(void){
++
++	/*Intermediaries*/
++	int         i,j,ig;
++	int         approximation,shelf_dampening;
++	IssmDouble      gravity,rho_water,bed,water_pressure;
++	IssmDouble      damper,normal_vel,vx,vy,vz,dt;
++	IssmDouble		xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble      xyz_list[NUMVERTICES][3];
++	IssmDouble		bed_normal[3];
++	IssmDouble      dz[3];
++	IssmDouble      basis[6]; //for the six nodes of the penta
++	IssmDouble      Jdet2d;
++	GaussPenta  *gauss=NULL;
++
++	/*Initialize Element vector and return if necessary*/
++	if(!IsOnBed() || !IsFloating()) return NULL;
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	this->parameters->FindParam(&shelf_dampening,DiagnosticShelfDampeningEnum);
++	if(approximation!=StokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum && approximation!=PattynStokesApproximationEnum) return NULL;
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	rho_water=matpar->GetRhoWater();
++	gravity=matpar->GetG();
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* bed_input=inputs->GetInput(BedEnum); _assert_(bed_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);
++
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++
++	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
++	gauss=new GaussPenta(0,1,2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
++		GetNodalFunctionsP1(basis, gauss);
++
++		BedNormal(&bed_normal[0],xyz_list_tria);
++		bed_input->GetInputValue(&bed, gauss);
++		if(shelf_dampening){ //add dampening to avoid too high vertical velocities when not in hydrostatic equilibrium
++			bed_input->GetInputDerivativeValue(&dz[0],&xyz_list[0][0],gauss);
++			vx_input->GetInputValue(&vx, gauss);
++			vy_input->GetInputValue(&vy, gauss);
++			vz_input->GetInputValue(&vz, gauss);
++			dt=0;
++			normal_vel=bed_normal[0]*vx+bed_normal[1]*vy+bed_normal[2]*vz;
++			damper=gravity*rho_water*pow(1+pow(dz[0],2)+pow(dz[1],2),0.5)*normal_vel*dt;
++		}
++		else damper=0;
++		water_pressure=gravity*rho_water*bed;
++
++		for(i=0;i<NUMVERTICES;i++) for(j=0;j<3;j++) pe->values[i*NDOF4+j]+=(water_pressure+damper)*gauss->weight*Jdet2d*basis[i]*bed_normal[j];
++	}
++
++	/*Transform coordinate system*/
++	TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticVert {{{*/
++ElementVector* Penta::CreatePVectorDiagnosticVert(void){
++
++	/*compute all load vectors for this element*/
++	ElementVector* pe1=CreatePVectorDiagnosticVertVolume();
++	ElementVector* pe2=CreatePVectorDiagnosticVertBase();
++	ElementVector* pe =new ElementVector(pe1,pe2);
++
++	/*clean-up and return*/
++	delete pe1;
++	delete pe2;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticVertVolume {{{*/
++ElementVector* Penta::CreatePVectorDiagnosticVertVolume(void){
++
++	/*Constants*/
++	const int  numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries*/
++	int        i,ig;
++	int        approximation;
++	IssmDouble     Jdet;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     dudx,dvdy,dwdz;
++	IssmDouble     du[3],dv[3],dw[3];
++	IssmDouble     basis[6];
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
++	Input* vzstokes_input=NULL;
++	if(approximation==PattynStokesApproximationEnum || approximation==MacAyealStokesApproximationEnum){
++		vzstokes_input=inputs->GetInput(VzStokesEnum); _assert_(vzstokes_input);
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(2,2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsP1(basis, gauss);
++
++		vx_input->GetInputDerivativeValue(&du[0],&xyz_list[0][0],gauss);
++		vy_input->GetInputDerivativeValue(&dv[0],&xyz_list[0][0],gauss);
++		if(approximation==PattynStokesApproximationEnum || approximation==MacAyealStokesApproximationEnum){
++			vzstokes_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
++			dwdz=dw[2];
++		}
++		else dwdz=0;
++		dudx=du[0];
++		dvdy=dv[1];
++
++		for (i=0;i<numdof;i++) pe->values[i] += (dudx+dvdy+dwdz)*Jdet*gauss->weight*basis[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticVertBase {{{*/
++ElementVector* Penta::CreatePVectorDiagnosticVertBase(void){
++
++
++	/*Constants*/
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	int        approximation;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     xyz_list_tria[NUMVERTICES2D][3];
++	IssmDouble     Jdet2d;
++	IssmDouble     vx,vy,vz,dbdx,dbdy,basalmeltingvalue;
++	IssmDouble     slope[3];
++	IssmDouble     basis[NUMVERTICES];
++	GaussPenta* gauss=NULL;
++
++	if (!IsOnBed()) return NULL;
++
++	/*Initialize Element vector*/
++	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	Input* bed_input=inputs->GetInput(BedEnum);                                _assert_(bed_input);
++	Input* basal_melting_input=inputs->GetInput(BasalforcingsMeltingRateEnum); _assert_(basal_melting_input);
++	Input* vx_input=inputs->GetInput(VxEnum);                                  _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum);                                  _assert_(vy_input);
++	Input* vzstokes_input=NULL;
++	if(approximation==PattynStokesApproximationEnum || approximation==MacAyealStokesApproximationEnum){
++		vzstokes_input=inputs->GetInput(VzStokesEnum);       _assert_(vzstokes_input);
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(0,1,2,2);
++	for(ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		basal_melting_input->GetInputValue(&basalmeltingvalue, gauss);
++		bed_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
++		vx_input->GetInputValue(&vx, gauss);
++		vy_input->GetInputValue(&vy, gauss);
++		if(approximation==PattynStokesApproximationEnum || approximation==MacAyealStokesApproximationEnum){
++			vzstokes_input->GetInputValue(&vz, gauss);
++		}
++		else vz=0;
++
++		dbdx=slope[0];
++		dbdy=slope[1];
++
++		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
++		GetNodalFunctionsP1(&basis[0], gauss);
++
++		for(i=0;i<numdof;i++) pe->values[i]+=-Jdet2d*gauss->weight*(vx*dbdx+vy*dbdy-vz-basalmeltingvalue)*basis[i];
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return pe;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateJacobianDiagnosticHoriz{{{*/
++ElementMatrix* Penta::CreateJacobianDiagnosticHoriz(void){
++
++	int approximation;
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	switch(approximation){
++		case MacAyealApproximationEnum:
++			return CreateJacobianDiagnosticMacayeal2d();
++		case PattynApproximationEnum:
++			return CreateJacobianDiagnosticPattyn();
++		case StokesApproximationEnum:
++			return CreateJacobianDiagnosticStokes();
++		case NoneApproximationEnum:
++			return NULL;
++		default:
++			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::CreateJacobianDiagnosticMacayeal2d{{{*/
++ElementMatrix* Penta::CreateJacobianDiagnosticMacayeal2d(void){
++
++	/*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 
++	  bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 
++	  the stiffness matrix. */
++	if (!IsOnBed()) return NULL;
++
++	/*Depth Averaging B*/
++	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementMatrix* Ke=tria->CreateJacobianDiagnosticMacayeal();
++	delete tria->matice; delete tria;
++
++	/*Delete B averaged*/
++	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++
++	/*clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateJacobianDiagnosticPattyn{{{*/
++ElementMatrix* Penta::CreateJacobianDiagnosticPattyn(void){
++
++	/*Constants*/
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     Jdet;
++	IssmDouble     eps1dotdphii,eps1dotdphij;
++	IssmDouble     eps2dotdphii,eps2dotdphij;
++	IssmDouble     mu_prime;
++	IssmDouble     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble     eps1[3],eps2[3];
++	IssmDouble     phi[NUMVERTICES];
++	IssmDouble     dphi[3][NUMVERTICES];
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Jacobian with regular Pattyn (first part of the Gateau derivative)*/
++	ElementMatrix* Ke=CreateKMatrixDiagnosticPattyn();
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(5,5);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
++
++		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
++		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
++		eps1[2]=epsilon[3];                eps2[2]=epsilon[4];
++
++		for(i=0;i<6;i++){
++			for(j=0;j<6;j++){
++				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
++				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
++				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
++				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
++
++				Ke->values[12*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
++				Ke->values[12*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
++				Ke->values[12*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
++				Ke->values[12*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
++			}
++		}
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateJacobianDiagnosticStokes{{{*/
++ElementMatrix* Penta::CreateJacobianDiagnosticStokes(void){
++
++	/*Constants*/
++	const int    numdof=NDOF4*NUMVERTICES;
++
++	/*Intermediaries */
++	int        i,j,ig;
++	IssmDouble     xyz_list[NUMVERTICES][3];
++	IssmDouble     Jdet;
++	IssmDouble     eps1dotdphii,eps1dotdphij;
++	IssmDouble     eps2dotdphii,eps2dotdphij;
++	IssmDouble     eps3dotdphii,eps3dotdphij;
++	IssmDouble     mu_prime;
++	IssmDouble     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble     eps1[3],eps2[3],eps3[3];
++	IssmDouble     phi[NUMVERTICES];
++	IssmDouble     dphi[3][NUMVERTICES];
++	GaussPenta *gauss=NULL;
++
++	/*Initialize Jacobian with regular Stokes (first part of the Gateau derivative)*/
++	ElementMatrix* Ke=CreateKMatrixDiagnosticStokes();
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	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 gaussian points: */
++	gauss=new GaussPenta(5,5);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
++
++		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		eps1[0]=epsilon[0];   eps2[0]=epsilon[2];   eps3[0]=epsilon[3];
++		eps1[1]=epsilon[2];   eps2[1]=epsilon[1];   eps3[1]=epsilon[4];
++		eps1[2]=epsilon[3];   eps2[2]=epsilon[4];   eps3[2]= -epsilon[0] -epsilon[1];
++
++		for(i=0;i<6;i++){
++			for(j=0;j<6;j++){
++				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
++				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
++				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
++				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
++				eps3dotdphii=eps3[0]*dphi[0][i]+eps3[1]*dphi[1][i]+eps3[2]*dphi[2][i];
++				eps3dotdphij=eps3[0]*dphi[0][j]+eps3[1]*dphi[1][j]+eps3[2]*dphi[2][j];
++
++				Ke->values[numdof*(4*i+0)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
++				Ke->values[numdof*(4*i+0)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
++				Ke->values[numdof*(4*i+0)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps1dotdphii;
++
++				Ke->values[numdof*(4*i+1)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
++				Ke->values[numdof*(4*i+1)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
++				Ke->values[numdof*(4*i+1)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps2dotdphii;
++
++				Ke->values[numdof*(4*i+2)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps3dotdphii;
++				Ke->values[numdof*(4*i+2)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps3dotdphii;
++				Ke->values[numdof*(4*i+2)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps3dotdphii;
++			}
++		}
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::GetSolutionFromInputsDiagnosticHoriz{{{*/
++void  Penta::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){
++
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int          i;
++	int          approximation;
++	int*         doflist=NULL;
++	IssmDouble       vx,vy;
++	IssmDouble       values[numdof];
++	GaussPenta*  gauss;
++
++	/*Get approximation enum and dof list: */
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
++
++	/*If the element is a coupling, do nothing: every node is also on an other elements 
++	 * (as coupling is between MacAyeal and Pattyn) so the other element will take care of it*/
++	GetDofList(&doflist,approximation,GsetEnum);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	/*P1 element only for now*/
++	gauss=new GaussPenta();
++	for(i=0;i<NUMVERTICES;i++){
++
++		/*Recover vx and vy*/
++		gauss->GaussVertex(i);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		values[i*NDOF2+0]=vx;
++		values[i*NDOF2+1]=vy;
++	}
++
++	/*Add value to global vector*/
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::GetSolutionFromInputsDiagnosticHutter{{{*/
++void  Penta::GetSolutionFromInputsDiagnosticHutter(Vector* solution){
++
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int          i;
++	int*         doflist=NULL;
++	IssmDouble       vx,vy;
++	IssmDouble       values[numdof];
++	GaussPenta*  gauss=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	/*P1 element only for now*/
++	gauss=new GaussPenta();
++	for(i=0;i<NUMVERTICES;i++){
++		/*Recover vx and vy*/
++		gauss->GaussVertex(i);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		values[i*NDOF2+0]=vx;
++		values[i*NDOF2+1]=vy;
++	}
++
++	/*Add value to global vector*/
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::GetSolutionFromInputsDiagnosticVert{{{*/
++void  Penta::GetSolutionFromInputsDiagnosticVert(Vector* solution){
++
++	const int    numdof=NDOF1*NUMVERTICES;
++
++	int          i;
++	int*         doflist=NULL;
++	IssmDouble       vz;
++	IssmDouble       values[numdof];
++	GaussPenta*  gauss=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++	Input* vz_input=inputs->GetInput(VzEnum); _assert_(vz_input);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	/*P1 element only for now*/
++	gauss=new GaussPenta();
++	for(i=0;i<NUMVERTICES;i++){
++		/*Recover vz */
++		gauss->GaussVertex(i);
++		vz_input->GetInputValue(&vz,gauss);
++		values[i]=vz;
++	}
++
++	/*Add value to global vector*/
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::GetSolutionFromInputsDiagnosticStokes{{{*/
++void  Penta::GetSolutionFromInputsDiagnosticStokes(Vector* solution){
++
++	const int    numdof=NDOF4*NUMVERTICES;
++
++	int          i;
++	int*         doflist=NULL;
++	IssmDouble       vx,vy,vz,p;
++	IssmDouble       stokesreconditioning;
++	IssmDouble       values[numdof];
++	GaussPenta   *gauss;
++
++	/*Get dof list: */
++	GetDofList(&doflist,StokesApproximationEnum,GsetEnum);
++	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* p_input =inputs->GetInput(PressureEnum); _assert_(p_input);
++
++	/*Recondition pressure: */
++	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++
++	/*Ok, we have vx vy vz and P in values, fill in vx vy vz P arrays: */
++	/*P1 element only for now*/
++	gauss=new GaussPenta();
++	for(i=0;i<NUMVERTICES;i++){
++		gauss->GaussVertex(i);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		vz_input->GetInputValue(&vz,gauss);
++		p_input ->GetInputValue(&p ,gauss);
++		values[i*NDOF4+0]=vx;
++		values[i*NDOF4+1]=vy;
++		values[i*NDOF4+2]=vz;
++		values[i*NDOF4+3]=p/stokesreconditioning;
++	}
++
++	/*Add value to global vector*/
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticHoriz {{{*/
++void  Penta::InputUpdateFromSolutionDiagnosticHoriz(IssmDouble* solution){
++
++	int  approximation;
++
++	/*Recover inputs*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++
++	/*MacAyeal, everything is done by the element on bed*/
++	if (approximation==MacAyealApproximationEnum){
++		if (!IsOnBed()){
++			/*Do nothing. Element on bed will take care of it*/
++			return;
++		}
++		else{
++			InputUpdateFromSolutionDiagnosticMacAyeal(solution);
++			return;
++		}
++	}
++	else if (approximation==PattynApproximationEnum){
++		InputUpdateFromSolutionDiagnosticPattyn(solution);
++	}
++	else if (approximation==PattynStokesApproximationEnum){
++		InputUpdateFromSolutionDiagnosticPattynStokes(solution);
++	}
++	else if (approximation==MacAyealStokesApproximationEnum){
++		InputUpdateFromSolutionDiagnosticMacAyealStokes(solution);
++	}
++	else if (approximation==StokesApproximationEnum || approximation==NoneApproximationEnum){
++		InputUpdateFromSolutionDiagnosticStokes(solution);
++	}
++	else if (approximation==MacAyealPattynApproximationEnum){
++		InputUpdateFromSolutionDiagnosticMacAyealPattyn(solution);
++	}
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticMacAyeal {{{*/
++void  Penta::InputUpdateFromSolutionDiagnosticMacAyeal(IssmDouble* solution){
++
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int     i;
++	IssmDouble  rho_ice,g;
++	IssmDouble  values[numdof];
++	IssmDouble  vx[NUMVERTICES];
++	IssmDouble  vy[NUMVERTICES];
++	IssmDouble  vz[NUMVERTICES];
++	IssmDouble  vel[NUMVERTICES];
++	IssmDouble  pressure[NUMVERTICES];
++	IssmDouble  surface[NUMVERTICES];
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	int    *doflist = NULL;
++	Penta  *penta   = NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,MacAyealApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Transform solution in Cartesian Space*/
++	TransformSolutionCoord(&values[0],nodes,NUMVERTICES2D,XYEnum); /*2D: only the first 3 nodes are taken*/
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays and extrude */
++	for(i=0;i<3;i++){
++		vx[i]  =values[i*NDOF2+0];
++		vy[i]  =values[i*NDOF2+1];
++		vx[i+3]=vx[i];
++		vy[i+3]=vy[i];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Get parameters fro pressure computation*/
++	rho_ice=matpar->GetRhoIce();
++	g=matpar->GetG();
++
++	/*Start looping over all elements above current element and update all inputs*/
++	penta=this;
++	for(;;){
++
++		/*Get node data: */
++		GetVerticesCoordinates(&xyz_list[0][0],penta->nodes,NUMVERTICES);
++
++		/*Now Compute vel*/
++		GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0
++		for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++
++		/*Now compute pressure*/
++		GetInputListOnVertices(&surface[0],SurfaceEnum);
++		for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
++
++		/*Now, we have to move the previous Vx and Vy inputs  to old 
++		 * status, otherwise, we'll wipe them off: */
++		penta->inputs->ChangeEnum(VxEnum,VxPicardEnum);
++		penta->inputs->ChangeEnum(VyEnum,VyPicardEnum);
++		penta->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++
++		/*Add vx and vy as inputs to the tria element: */
++		penta->inputs->AddInput(new PentaP1Input(VxEnum,vx));
++		penta->inputs->AddInput(new PentaP1Input(VyEnum,vy));
++		penta->inputs->AddInput(new PentaP1Input(VelEnum,vel));
++		penta->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
++
++		/*Stop if we have reached the surface*/
++		if (penta->IsOnSurface()) break;
++
++		/* get upper Penta*/
++		penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id);
++	}
++	
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticMacAyealPattyn {{{*/
++void  Penta::InputUpdateFromSolutionDiagnosticMacAyealPattyn(IssmDouble* solution){
++
++	const int    numdof=NDOF2*NUMVERTICES;
++	const int    numdof2d=NDOF2*NUMVERTICES2D;
++
++	int     i;
++	IssmDouble  rho_ice,g;
++	IssmDouble  macayeal_values[numdof];
++	IssmDouble  pattyn_values[numdof];
++	IssmDouble  vx[NUMVERTICES];
++	IssmDouble  vy[NUMVERTICES];
++	IssmDouble  vz[NUMVERTICES];
++	IssmDouble  vel[NUMVERTICES];
++	IssmDouble  pressure[NUMVERTICES];
++	IssmDouble  surface[NUMVERTICES];
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	int*    doflistp = NULL;
++	int*    doflistm = NULL;
++	Penta   *penta   = NULL;
++
++	/*OK, we have to add results of this element for pattyn 
++	 * and results from the penta at base for macayeal. Now recover results*/
++	penta=GetBasalElement();
++
++	/*Get dof listof this element (pattyn dofs) and of the penta at base (macayeal dofs): */
++	GetDofList(&doflistp,PattynApproximationEnum,GsetEnum);
++	penta->GetDofList(&doflistm,MacAyealApproximationEnum,GsetEnum);
++
++	/*Get node data: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof2d;i++){
++		pattyn_values[i]=solution[doflistp[i]];
++		macayeal_values[i]=solution[doflistm[i]];
++	}
++	for(i=numdof2d;i<numdof;i++){
++		pattyn_values[i]=solution[doflistp[i]];
++		macayeal_values[i]=macayeal_values[i-numdof2d];
++	}
++
++	/*Transform solution in Cartesian Space*/
++	TransformSolutionCoord(&macayeal_values[0],penta->nodes,NUMVERTICES,XYEnum);
++	TransformSolutionCoord(&pattyn_values[0],   this->nodes,NUMVERTICES,XYEnum);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		vx[i]=macayeal_values[i*NDOF2+0]+pattyn_values[i*NDOF2+0];
++		vy[i]=macayeal_values[i*NDOF2+1]+pattyn_values[i*NDOF2+1];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Now Compute vel*/
++	GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0
++	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++
++	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D, 
++	 *so the pressure is just the pressure at the z elevation: */
++	rho_ice=matpar->GetRhoIce();
++	g=matpar->GetG();
++	GetInputListOnVertices(&surface[0],SurfaceEnum);
++	for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
++
++	/*Now, we have to move the previous Vx and Vy inputs  to old 
++	 * status, otherwise, we'll wipe them off: */
++	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
++	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
++	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
++	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
++	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
++	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
++
++	/*Free ressources:*/
++	xDelete<int>(doflistp);
++	xDelete<int>(doflistm);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticMacAyealStokes {{{*/
++void  Penta::InputUpdateFromSolutionDiagnosticMacAyealStokes(IssmDouble* solution){
++
++	const int    numdofm=NDOF2*NUMVERTICES;
++	const int    numdofs=NDOF4*NUMVERTICES;
++	const int    numdof2d=NDOF2*NUMVERTICES2D;
++
++	int     i;
++	IssmDouble  stokesreconditioning;
++	IssmDouble  macayeal_values[numdofm];
++	IssmDouble  stokes_values[numdofs];
++	IssmDouble  vx[NUMVERTICES];
++	IssmDouble  vy[NUMVERTICES];
++	IssmDouble  vz[NUMVERTICES];
++	IssmDouble  vzmacayeal[NUMVERTICES];
++	IssmDouble  vzstokes[NUMVERTICES];
++	IssmDouble  vel[NUMVERTICES];
++	IssmDouble  pressure[NUMVERTICES];
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	int*    doflistm        = NULL;
++	int*    doflists        = NULL;
++	Penta   *penta          = NULL;
++
++	/*OK, we have to add results of this element for macayeal 
++	 * and results from the penta at base for macayeal. Now recover results*/
++	penta=GetBasalElement();
++
++	/*Get dof listof this element (macayeal dofs) and of the penta at base (macayeal dofs): */
++	penta->GetDofList(&doflistm,MacAyealApproximationEnum,GsetEnum);
++	GetDofList(&doflists,StokesApproximationEnum,GsetEnum);
++	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++
++	/*Get node data: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof2d;i++){
++		macayeal_values[i]=solution[doflistm[i]];
++		macayeal_values[i+numdof2d]=solution[doflistm[i]];
++	}
++	for(i=0;i<numdofs;i++){
++		stokes_values[i]=solution[doflists[i]];
++	}
++
++	/*Transform solution in Cartesian Space*/
++	TransformSolutionCoord(&macayeal_values[0],this->nodes,NUMVERTICES,XYEnum);
++	TransformSolutionCoord(&stokes_values[0],this->nodes,NUMVERTICES,XYZPEnum);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		vx[i]=stokes_values[i*NDOF4+0]+macayeal_values[i*NDOF2+0];
++		vy[i]=stokes_values[i*NDOF4+1]+macayeal_values[i*NDOF2+1];
++		vzstokes[i]=stokes_values[i*NDOF4+2];
++		pressure[i]=stokes_values[i*NDOF4+3]*stokesreconditioning;
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vx[i]))       _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i]))       _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vzstokes[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(pressure[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Get Vz*/
++	Input* vzmacayeal_input=inputs->GetInput(VzMacAyealEnum);
++	if (vzmacayeal_input){
++		if (vzmacayeal_input->ObjectEnum()!=PentaP1InputEnum){
++			_error2_("Cannot compute Vel as VzMacAyeal is of type " << EnumToStringx(vzmacayeal_input->ObjectEnum()));
++		}
++		GetInputListOnVertices(&vzmacayeal[0],VzMacAyealEnum);
++	}
++	else{
++		_error2_("Cannot update solution as VzMacAyeal is not present");
++	}
++
++	/*Now Compute vel*/
++	for(i=0;i<NUMVERTICES;i++) {
++		vz[i]=vzmacayeal[i]+vzstokes[i];
++		vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++	}
++
++	/*Now, we have to move the previous Vx and Vy inputs  to old 
++	 * status, otherwise, we'll wipe them off: */
++	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
++	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
++	this->inputs->ChangeEnum(VzEnum,VzPicardEnum);
++	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
++	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
++	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
++	this->inputs->AddInput(new PentaP1Input(VzStokesEnum,vzstokes));
++	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
++	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
++
++	/*Free ressources:*/
++	xDelete<int>(doflistm);
++	xDelete<int>(doflists);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticPattyn {{{*/
++void  Penta::InputUpdateFromSolutionDiagnosticPattyn(IssmDouble* solution){
++	
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int    i;
++	IssmDouble rho_ice,g;
++	IssmDouble values[numdof];
++	IssmDouble vx[NUMVERTICES];
++	IssmDouble vy[NUMVERTICES];
++	IssmDouble vz[NUMVERTICES];
++	IssmDouble vel[NUMVERTICES];
++	IssmDouble pressure[NUMVERTICES];
++	IssmDouble surface[NUMVERTICES];
++	IssmDouble xyz_list[NUMVERTICES][3];
++	int*   doflist = NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,PattynApproximationEnum,GsetEnum);
++
++	/*Get node data: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Transform solution in Cartesian Space*/
++	TransformSolutionCoord(&values[0],nodes,NUMVERTICES,XYEnum);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		vx[i]=values[i*NDOF2+0];
++		vy[i]=values[i*NDOF2+1];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Get Vz*/
++	Input* vz_input=inputs->GetInput(VzEnum);
++	if (vz_input){
++		GetInputListOnVertices(&vz[0],VzEnum);
++	}
++	else{
++		for(i=0;i<NUMVERTICES;i++) vz[i]=0.0;
++	}
++
++	/*Now Compute vel*/
++	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++
++	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D, 
++	 *so the pressure is just the pressure at the z elevation: */
++	rho_ice=matpar->GetRhoIce();
++	g=matpar->GetG();
++	GetInputListOnVertices(&surface[0],SurfaceEnum);
++	for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
++
++	/*Now, we have to move the previous Vx and Vy inputs  to old 
++	 * status, otherwise, we'll wipe them off: */
++	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
++	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
++	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
++	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
++	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
++	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticPattynStokes {{{*/
++void  Penta::InputUpdateFromSolutionDiagnosticPattynStokes(IssmDouble* solution){
++
++	const int    numdofp=NDOF2*NUMVERTICES;
++	const int    numdofs=NDOF4*NUMVERTICES;
++
++	int    i;
++	IssmDouble pattyn_values[numdofp];
++	IssmDouble stokes_values[numdofs];
++	IssmDouble vx[NUMVERTICES];
++	IssmDouble vy[NUMVERTICES];
++	IssmDouble vz[NUMVERTICES];
++	IssmDouble vzpattyn[NUMVERTICES];
++	IssmDouble vzstokes[NUMVERTICES];
++	IssmDouble vel[NUMVERTICES];
++	IssmDouble pressure[NUMVERTICES];
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble stokesreconditioning;
++	int*   doflistp      = NULL;
++	int*   doflists      = NULL;
++	Penta  *penta        = NULL;
++
++	/*OK, we have to add results of this element for pattyn 
++	 * and results from the penta at base for macayeal. Now recover results*/
++	penta=GetBasalElement();
++
++	/*Get dof listof this element (pattyn dofs) and of the penta at base (macayeal dofs): */
++	GetDofList(&doflistp,PattynApproximationEnum,GsetEnum);
++	GetDofList(&doflists,StokesApproximationEnum,GsetEnum);
++	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++
++	/*Get node data: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdofp;i++) pattyn_values[i]=solution[doflistp[i]];
++	for(i=0;i<numdofs;i++) stokes_values[i]=solution[doflists[i]];
++
++	/*Transform solution in Cartesian Space*/
++	TransformSolutionCoord(&pattyn_values[0],this->nodes,NUMVERTICES,XYEnum);
++	TransformSolutionCoord(&stokes_values[0],this->nodes,NUMVERTICES,XYZPEnum);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		vx[i]=stokes_values[i*NDOF4+0]+pattyn_values[i*NDOF2+0];
++		vy[i]=stokes_values[i*NDOF4+1]+pattyn_values[i*NDOF2+1];
++		vzstokes[i]=stokes_values[i*NDOF4+2];
++		pressure[i]=stokes_values[i*NDOF4+3]*stokesreconditioning;
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vx[i]))       _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i]))       _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vzstokes[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(pressure[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Get Vz*/
++	Input* vzpattyn_input=inputs->GetInput(VzPattynEnum);
++	if (vzpattyn_input){
++		if (vzpattyn_input->ObjectEnum()!=PentaP1InputEnum){
++			_error2_("Cannot compute Vel as VzPattyn is of type " << EnumToStringx(vzpattyn_input->ObjectEnum()));
++		}
++		GetInputListOnVertices(&vzpattyn[0],VzPattynEnum);
++	}
++	else{
++		_error2_("Cannot update solution as VzPattyn is not present");
++	}
++
++	/*Now Compute vel*/
++	for(i=0;i<NUMVERTICES;i++) {
++		vz[i]=vzpattyn[i]+vzstokes[i];
++		vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++	}
++
++	/*Now, we have to move the previous Vx and Vy inputs  to old 
++	 * status, otherwise, we'll wipe them off: */
++	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
++	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
++	this->inputs->ChangeEnum(VzEnum,VzPicardEnum);
++	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
++	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
++	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
++	this->inputs->AddInput(new PentaP1Input(VzStokesEnum,vzstokes));
++	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
++	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
++
++	/*Free ressources:*/
++	xDelete<int>(doflistp);
++	xDelete<int>(doflists);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticHutter {{{*/
++void  Penta::InputUpdateFromSolutionDiagnosticHutter(IssmDouble* solution){
++	
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int     i;
++	IssmDouble  rho_ice,g;
++	IssmDouble  values[numdof];
++	IssmDouble  vx[NUMVERTICES];
++	IssmDouble  vy[NUMVERTICES];
++	IssmDouble  vz[NUMVERTICES];
++	IssmDouble  vel[NUMVERTICES];
++	IssmDouble  pressure[NUMVERTICES];
++	IssmDouble  surface[NUMVERTICES];
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	int*    doflist = NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++
++	/*Get node data: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		vx[i]=values[i*NDOF2+0];
++		vy[i]=values[i*NDOF2+1];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Now Compute vel*/
++	GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0
++	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++
++	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D, 
++	 *so the pressure is just the pressure at the z elevation: */
++	rho_ice=matpar->GetRhoIce();
++	g=matpar->GetG();
++	GetInputListOnVertices(&surface[0],SurfaceEnum);
++	for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
++
++	/*Now, we have to move the previous Vx and Vy inputs  to old 
++	 * status, otherwise, we'll wipe them off: */
++	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
++	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
++	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
++	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
++	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
++	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticVert {{{*/
++void  Penta::InputUpdateFromSolutionDiagnosticVert(IssmDouble* solution){
++
++	const int numdof=NDOF1*NUMVERTICES;
++	
++	int      i;
++	int      approximation;
++	IssmDouble   rho_ice,g;
++	IssmDouble   values[numdof];
++	IssmDouble   vx[NUMVERTICES];
++	IssmDouble   vy[NUMVERTICES];
++	IssmDouble   vz[NUMVERTICES];
++	IssmDouble   vzmacayeal[NUMVERTICES];
++	IssmDouble   vzpattyn[NUMVERTICES];
++	IssmDouble   vzstokes[NUMVERTICES];
++	IssmDouble   vel[NUMVERTICES];
++	IssmDouble   pressure[NUMVERTICES];
++	IssmDouble   surface[NUMVERTICES];
++	IssmDouble   xyz_list[NUMVERTICES][3];
++	int*     doflist      = NULL;
++
++
++	/*Get the approximation and do nothing if the element in Stokes or None*/
++	inputs->GetInputValue(&approximation,ApproximationEnum);
++	if(approximation==StokesApproximationEnum || approximation==NoneApproximationEnum){
++		return;
++	}
++
++	/*Get dof list and vertices coordinates: */
++	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++
++	/*Use the dof list to index into the solution vector vz: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++	for(i=0;i<NUMVERTICES;i++){
++		vz[i]=values[i*NDOF1+0];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vz[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Get Vx and Vy*/
++	GetInputListOnVertices(&vx[0],VxEnum,0.0); //default is 0
++	GetInputListOnVertices(&vy[0],VyEnum,0.0); //default is 0
++
++	/*Do some modifications if we actually have a PattynStokes or MacAyealStokes element*/
++	if(approximation==PattynStokesApproximationEnum){
++		Input* vzstokes_input=inputs->GetInput(VzStokesEnum);
++		if (vzstokes_input){
++			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error2_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));
++			GetInputListOnVertices(&vzstokes[0],VzStokesEnum);
++		}
++		else _error2_("Cannot compute Vz as VzStokes in not present in PattynStokes element");
++		for(i=0;i<NUMVERTICES;i++){
++			vzpattyn[i]=vz[i];
++			vz[i]=vzpattyn[i]+vzstokes[i];
++		}
++	}
++	else if(approximation==MacAyealStokesApproximationEnum){
++		Input* vzstokes_input=inputs->GetInput(VzStokesEnum);
++		if (vzstokes_input){
++			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error2_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));
++			GetInputListOnVertices(&vzstokes[0],VzStokesEnum);
++		}
++		else _error2_("Cannot compute Vz as VzStokes in not present in MacAyealStokes element");
++		for(i=0;i<NUMVERTICES;i++){
++			vzmacayeal[i]=vz[i];
++			vz[i]=vzmacayeal[i]+vzstokes[i];
++		}
++	}
++
++	/*Now Compute vel*/
++	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++
++	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D, 
++	 *so the pressure is just the pressure at the z elevation: except it this is a PattynStokes element */
++	if(approximation!=PattynStokesApproximationEnum &&  approximation!=MacAyealStokesApproximationEnum){
++		rho_ice=matpar->GetRhoIce();
++		g=matpar->GetG();
++		GetInputListOnVertices(&surface[0],SurfaceEnum);
++		for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
++	}
++
++	/*Now, we have to move the previous Vz inputs to old 
++	 * status, otherwise, we'll wipe them off and add the new inputs: */
++	this->inputs->ChangeEnum(VzEnum,VzPicardEnum);
++
++	if(approximation!=PattynStokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum){
++		this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++		this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
++	}
++	else if(approximation==PattynStokesApproximationEnum){
++		this->inputs->AddInput(new PentaP1Input(VzPattynEnum,vzpattyn));
++	}
++	else if(approximation==MacAyealStokesApproximationEnum){
++		this->inputs->AddInput(new PentaP1Input(VzMacAyealEnum,vzmacayeal));
++	}
++	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
++	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticStokes {{{*/
++void  Penta::InputUpdateFromSolutionDiagnosticStokes(IssmDouble* solution){
++	
++	const int numdof=NDOF4*NUMVERTICES;
++
++	int     i;
++	IssmDouble  values[numdof];
++	IssmDouble  vx[NUMVERTICES];
++	IssmDouble  vy[NUMVERTICES];
++	IssmDouble  vz[NUMVERTICES];
++	IssmDouble  vel[NUMVERTICES];
++	IssmDouble  pressure[NUMVERTICES];
++	IssmDouble  stokesreconditioning;
++	int*    doflist=NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,StokesApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Transform solution in Cartesian Space*/
++	TransformSolutionCoord(&values[0],nodes,NUMVERTICES,XYZPEnum);
++
++	/*Ok, we have vx and vy in values, fill in all arrays: */
++	for(i=0;i<NUMVERTICES;i++){
++		vx[i]=values[i*NDOF4+0];
++		vy[i]=values[i*NDOF4+1];
++		vz[i]=values[i*NDOF4+2];
++		pressure[i]=values[i*NDOF4+3];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vx[i]))       _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i]))       _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vz[i]))       _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(pressure[i])) _error2_("NaN found in solution vector");
++	}
++
++	/*Recondition pressure and compute vel: */
++	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
++	for(i=0;i<NUMVERTICES;i++) pressure[i]=pressure[i]*stokesreconditioning;
++	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++	
++	/*Now, we have to move the previous inputs  to old 
++	 * status, otherwise, we'll wipe them off: */
++	this->inputs->ChangeEnum(VxEnum,VxPicardEnum);
++	this->inputs->ChangeEnum(VyEnum,VyPicardEnum);
++	this->inputs->ChangeEnum(VzEnum,VzPicardEnum);
++	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++
++	/*Add vx and vy as inputs to the tria element: */
++	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
++	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
++	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
++	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
++	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
++#endif
++
++#ifdef _HAVE_BALANCED_
++/*FUNCTION Penta::CreateKMatrixBalancethickness {{{*/
++ElementMatrix* Penta::CreateKMatrixBalancethickness(void){
++
++	/*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 
++	  bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 
++	  the stiffness matrix. */
++	if (!IsOnBed()) return NULL;
++
++	/*Depth Averaging Vx and Vy*/
++	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
++	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
++
++	/*Spawn Tria element from the base of the Penta: */
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementMatrix* Ke=tria->CreateKMatrixBalancethickness();
++	delete tria->matice; delete tria;
++
++	/*Delete Vx and Vy averaged*/
++	this->inputs->DeleteInput(VxAverageEnum);
++	this->inputs->DeleteInput(VyAverageEnum);
++
++	/*clean up and return*/
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreatePVectorBalancethickness {{{*/
++ElementVector* Penta::CreatePVectorBalancethickness(void){
++
++	if (!IsOnBed()) return NULL;
++
++	/*Depth Averaging Vx and Vy*/
++	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
++	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementVector* pe=tria->CreatePVectorBalancethickness();
++	delete tria->matice; delete tria;
++
++	/*Delete Vx and Vy averaged*/
++	this->inputs->DeleteInput(VxAverageEnum);
++	this->inputs->DeleteInput(VyAverageEnum);
++
++	/*Clean up and return*/
++	return pe;
++}
++/*}}}*/
++#endif
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp	(revision 12822)
+@@ -0,0 +1,104 @@
++/*!\file PentaHook.c
++ * \brief: implementation of the PentaHook object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Object constructors and destructor*/
++/*FUNCTION PentaHook::PentaHook(){{{*/
++PentaHook::PentaHook(){
++	numanalyses=UNDEF;
++	this->hnodes=NULL;
++	this->hmatice=NULL;
++	this->hmatpar=NULL;
++	this->hneighbors=NULL;
++}
++/*}}}*/
++/*FUNCTION PentaHook::~PentaHook(){{{*/
++PentaHook::~PentaHook(){
++
++	int i;
++
++	for(i=0;i<this->numanalyses;i++){
++		if (this->hnodes[i]) delete this->hnodes[i];
++	}
++	delete [] this->hnodes;
++	delete hmatice;
++	delete hmatpar;
++	delete hneighbors;
++}
++/*}}}*/
++/*FUNCTION PentaHook::PentaHook(int in_numanalyses,int matice_id, int matpar_id){{{*/
++PentaHook::PentaHook(int in_numanalyses,int matice_id, IoModel* iomodel){
++
++	/*intermediary: */
++	int matpar_id;
++	
++	/*retrieve parameters: */
++	iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
++
++	this->numanalyses=in_numanalyses;
++	this->hnodes=new Hook*[in_numanalyses];
++	this->hmatice=new Hook(&matice_id,1);
++	this->hmatpar=new Hook(&matpar_id,1);
++	this->hneighbors=NULL; 
++
++	//Initialize hnodes as NULL
++	for(int i=0;i<this->numanalyses;i++){
++		this->hnodes[i]=NULL;
++	}
++
++}
++/*}}}*/
++
++/*FUNCTION PentaHook::SetHookNodes{{{*/
++void PentaHook::SetHookNodes(int* node_ids,int analysis_counter){
++	this->hnodes[analysis_counter]= new Hook(node_ids,6);
++
++}
++/*}}}*/
++/*FUNCTION PentaHook::InitHookNeighbors{{{*/
++void PentaHook::InitHookNeighbors(int* element_ids){
++	this->hneighbors=new Hook(element_ids,2);
++
++}
++/*}}}*/
++/*FUNCTION PentaHook::SpawnTriaHook{{{*/
++void PentaHook::SpawnTriaHook(TriaHook* triahook,int* indices){
++
++	int i;
++	int zero=0;
++
++	triahook->numanalyses=this->numanalyses;
++	triahook->hnodes=new Hook*[this->numanalyses];
++
++	for(i=0;i<this->numanalyses;i++){
++		/*Do not do anything if Hook is empty*/
++		if (!this->hnodes[i] || this->hnodes[i]->GetNum()==0){
++			triahook->hnodes[i]=NULL;
++		}
++		else{
++			/*Else, spawn Hook*/
++			triahook->hnodes[i]=this->hnodes[i]->Spawn(indices,3);
++		}
++	}
++	// do not spawn hmatice. matice will be taken care of by Penta
++	triahook->hmatice=NULL;
++	triahook->hmatpar=(Hook*)this->hmatpar->copy();
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.h	(revision 12822)
+@@ -0,0 +1,63 @@
++/*!\file:  PentaRef.h
++ * \brief abstract class for handling Penta oriented routines, like nodal functions, 
++ * strain rate generation, etc ...
++ */ 
++
++
++#ifndef _PENTAREF_H_
++#define _PENTAREF_H_
++
++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 GetNodalFunctionsP1(IssmDouble* l1l6, GaussPenta* gauss);
++		void GetNodalFunctionsMINI(IssmDouble* l1l7, GaussPenta* gauss);
++		void GetNodalFunctionsP1Derivatives(IssmDouble* dh1dh6,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetNodalFunctionsMINIDerivatives(IssmDouble* dh1dh7,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetNodalFunctionsP1DerivativesReference(IssmDouble* dl1dl6,GaussPenta* gauss);
++		void GetNodalFunctionsMINIDerivativesReference(IssmDouble* dl1dl7,GaussPenta* gauss);
++		void GetQuadNodalFunctions(IssmDouble* l1l4,GaussPenta* gauss,int index1,int index2,int index3,int index4);
++		void GetQuadJacobianDeterminant(IssmDouble*  Jdet, IssmDouble xyz_list[4][3],GaussPenta* gauss);
++		void GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussPenta* gauss);
++		void GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss);
++		void GetTriaJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss);
++		void GetSegmentJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss);
++		void GetJacobianInvert(IssmDouble*  Jinv, IssmDouble* xyz_list,GaussPenta* gauss);
++		void GetBMacAyealPattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBMacAyealStokes(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBPattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBStokes(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBprimeMacAyealStokes(IssmDouble* Bprime, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBprimePattyn(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBprimeStokes(IssmDouble* B_prime, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBprimeVert(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBAdvec(IssmDouble* B_advec, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBConduct(IssmDouble* B_conduct, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBVert(IssmDouble* B, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetBprimeAdvec(IssmDouble* Bprime_advec, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetL(IssmDouble* L, GaussPenta* gauss,int numdof);
++		void GetLStokes(IssmDouble* LStokes, GaussPenta* gauss);
++		void GetLprimeStokes(IssmDouble* LprimeStokes, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetLMacAyealStokes(IssmDouble* LMacAyealStokes, GaussPenta* gauss);
++		void GetLprimeMacAyealStokes(IssmDouble* LprimeMacAyealStokes, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetLStokesMacAyeal(IssmDouble* LStokesMacAyeal, GaussPenta* gauss);
++		void GetLprimeStokesMacAyeal(IssmDouble* LprimeStokesMacAyeal, IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,IssmDouble* plist, GaussPenta* gauss);
++		void GetInputValue(IssmDouble* pvalue,IssmDouble* plist,GaussTria* gauss){_error2_("only PentaGauss are supported");};
++		void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussPenta* gauss);
++		void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss){_error2_("only PentaGauss are supported");};
++
++};
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 12822)
+@@ -0,0 +1,317 @@
++/*! \file Penta.h 
++ *  \brief: header file for penta object
++ */
++
++#ifndef _PENTA_H_
++#define _PENTA_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Element.h"
++#include "./PentaHook.h"
++#include "./PentaRef.h"
++class  Object;
++class Parameters;
++class Inputs;
++class IoModel;
++class Node;
++class Matice;
++class Matpar;
++class Tria;
++class ElementMatrix;
++class ElementVector;
++
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++/*}}}*/
++
++class Penta: public Element,public PentaHook,public PentaRef{
++
++	public:
++
++		int          id;
++		int          sid;
++
++		Node       **nodes;        // 6 nodes
++		Matice      *matice;       // 1 material ice
++		Matpar      *matpar;       // 1 material parameter
++		Penta      **verticalneighbors;   // 2 neighbors: first one under, second one above
++		int          horizontalneighborsids[3];
++
++		Parameters  *parameters;   //pointer to solution parameters
++		Inputs      *inputs;
++		Results      *results;
++
++		/*Penta constructors and destructor: {{{*/
++		Penta();
++		Penta(int penta_id,int penta_sid,int i, IoModel* iomodel,int nummodels);
++		~Penta();
++		/*}}}*/
++		/*Object virtual functions definitions: {{{*/
++		Object*   copy();
++		void	  DeepEcho();
++		void	  Echo();
++		int		  ObjectEnum();
++		int		  Id(); 
++		int		  MyRank();
++		/*}}}*/
++		/*Update virtual functions definitions: {{{*/
++		void  InputUpdateFromConstant(bool constant, int name);
++		void  InputUpdateFromConstant(IssmDouble constant, int name);
++		void  InputUpdateFromConstant(int constant, int name);
++		void  InputUpdateFromSolution(IssmDouble* solutiong);
++		void  InputUpdateFromVector(bool* vector, int name, int type);
++		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVector(int* vector, int name, int type);
++		#ifdef _HAVE_DAKOTA_
++		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
++		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nows, int ncols, int name, int type);
++		#endif
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel);
++		/*}}}*/
++		/*Element virtual functions definitions: {{{*/
++		void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
++		void   BasalFrictionCreateInput(void);
++		void   ComputeBasalStress(Vector* sigma_b);
++		void   ComputeStrainRate(Vector* eps);
++		void   ComputeStressTensor();
++		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
++		void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
++		void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
++		void   CreatePVector(Vector* pf);
++		void   CreateJacobianMatrix(Matrix* Jff);
++		void   Delta18oParameterization(void);
++		void   DeleteResults(void);
++		int    GetNodeIndex(Node* node);
++		void   GetSolutionFromInputs(Vector* solution);
++		IssmDouble GetZcoord(GaussPenta* gauss);
++		void   GetVectorFromInputs(Vector* vector,int name_enum);
++		void   GetVectorFromResults(Vector* vector,int offset,int name_enum,int interp);
++		
++		int    Sid();
++		void   InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max);
++		bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums);
++		void   InputCreate(IssmDouble scalar,int name,int code);
++		void   InputCreate(IssmDouble* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code);
++		void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum=MeshElementsEnum);
++		void   InputDuplicate(int original_enum,int new_enum);
++		void   InputScale(int enum_type,IssmDouble scale_factor);
++		
++		void   InputToResult(int enum_type,int step,IssmDouble time);
++		void   MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding);
++		void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
++		void   RequestedOutput(int output_enum,int step,IssmDouble time);
++		void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results);
++		void   PatchFill(int* pcount, Patch* patch);
++		void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
++		void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm);
++		void   ProcessResultsUnits(void);
++		void   ResetCoordinateSystem(void);
++		void   SmbGradients();
++		IssmDouble SurfaceArea(void);
++		void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
++		int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
++		int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
++		IssmDouble TimeAdapt();
++		int*   GetHorizontalNeighboorSids(void);
++		void   ViscousHeatingCreateInput(void);
++		void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
++
++		 #ifdef _HAVE_RESPONSES_
++		IssmDouble IceVolume(void);
++		IssmDouble TotalSmb(void);
++		void   MinVel(IssmDouble* pminvel, bool process_units);
++		void   MinVx(IssmDouble* pminvx, bool process_units);
++		void   MinVy(IssmDouble* pminvy, bool process_units);
++		void   MinVz(IssmDouble* pminvz, bool process_units);
++		IssmDouble MassFlux(IssmDouble* segment,bool process_units);
++		void   MaxAbsVx(IssmDouble* pmaxabsvx, bool process_units);
++		void   MaxAbsVy(IssmDouble* pmaxabsvy, bool process_units);
++		void   MaxAbsVz(IssmDouble* pmaxabsvz, bool process_units);
++		void   MaxVel(IssmDouble* pmaxvel, bool process_units);
++		void   ElementResponse(IssmDouble* presponse,int response_enum,bool process_units);
++		void   MaxVx(IssmDouble* pmaxvx, bool process_units);
++		void   MaxVy(IssmDouble* pmaxvy, bool process_units);
++		void   MaxVz(IssmDouble* pmaxvz, bool process_units);
++		#endif
++
++		#ifdef _HAVE_CONTROL_
++		IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index);
++		void   GradientIndexing(int* indexing,int control_index);
++		void   Gradj(Vector* gradient,int control_type,int control_index);
++		void   GradjDragMacAyeal(Vector* gradient,int control_index);
++		void   GradjDragPattyn(Vector* gradient,int control_index);
++		void   GradjDragStokes(Vector* gradient,int control_index);
++		void   GradjBbarMacAyeal(Vector* gradient,int control_index);
++		void   GradjBbarPattyn(Vector* gradient,int control_index);
++		void   GradjBbarStokes(Vector* gradient,int control_index);
++		void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
++		void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
++		void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index);
++		void   ControlInputScaleGradient(int enum_type,IssmDouble scale);
++		void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
++		IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index);
++		IssmDouble ThicknessAbsMisfit(     bool process_units,int weight_index);
++		IssmDouble SurfaceAbsVelMisfit(    bool process_units,int weight_index);
++		IssmDouble SurfaceRelVelMisfit(    bool process_units,int weight_index);
++		IssmDouble SurfaceLogVelMisfit(    bool process_units,int weight_index);
++		IssmDouble SurfaceLogVxVyMisfit(   bool process_units,int weight_index);
++		IssmDouble SurfaceAverageVelMisfit(bool process_units,int weight_index);
++		IssmDouble ThicknessAbsGradient(bool process_units,int weight_index);
++		void   InputControlUpdate(IssmDouble scalar,bool save_parameter);
++		#endif
++		/*}}}*/
++		/*Penta specific routines:{{{*/
++		void	  BedNormal(IssmDouble* bed_normal, IssmDouble xyz_list[3][3]);
++		ElementMatrix* CreateKMatrixPrognostic(void);
++		ElementMatrix* CreateKMatrixSlope(void);
++		ElementVector* CreatePVectorPrognostic(void);
++		ElementVector* CreatePVectorSlope(void);
++		void	  GetDofList(int** pdoflist,int approximation_enum,int setenum);
++		void	  GetDofList1(int* doflist);
++		void    GetSidList(int* sidlist);
++		void    GetConnectivityList(int* connectivity);
++		int     GetElementType(void);
++		void    GetElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
++		void    GetInputListOnVertices(IssmDouble* pvalue,int enumtype);
++		void    GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue);
++		void    GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
++		void	  GetPhi(IssmDouble* phi, IssmDouble*  epsilon, IssmDouble viscosity);
++		void	  GetSolutionFromInputsEnthalpy(Vector* solutiong);
++		IssmDouble  GetStabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa);
++		void    GetStrainRate3dPattyn(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input);
++		void    GetStrainRate3d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input, Input* vz_input);
++		Penta*  GetUpperElement(void);
++		Penta*  GetLowerElement(void);
++		Penta*  GetBasalElement(void);
++		void	  InputExtrude(int enum_type,int object_type);
++		void    InputUpdateFromSolutionPrognostic(IssmDouble* solutiong);
++		void    InputUpdateFromSolutionOneDof(IssmDouble* solutiong,int enum_type);
++		void    InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solutiong,int enum_type);
++		bool	  IsInput(int name);
++		bool	  IsOnSurface(void);
++		bool	  IsOnBed(void);
++		bool    IsFloating(void); 
++		bool    IsNodeOnShelf(); 
++		bool    IsNodeOnShelfFromFlags(IssmDouble* flags);
++		bool    IsOnWater(void); 
++		IssmDouble  MinEdgeLength(IssmDouble xyz_list[6][3]);
++		void	  ReduceMatrixStokes(IssmDouble* Ke_reduced, IssmDouble* Ke_temp);
++		void	  ReduceVectorStokes(IssmDouble* Pe_reduced, IssmDouble* Ke_temp, IssmDouble* Pe_temp);
++		void	  SetClone(int* minranks);
++		Tria*	  SpawnTria(int g0, int g1, int g2);
++		void	  SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]);
++
++		#ifdef _HAVE_DIAGNOSTIC_
++		ElementMatrix* CreateKMatrixCouplingMacAyealPattyn(void);
++		ElementMatrix* CreateKMatrixCouplingMacAyealPattynViscous(void);
++		ElementMatrix* CreateKMatrixCouplingMacAyealPattynFriction(void);
++		ElementMatrix* CreateKMatrixCouplingMacAyealStokes(void);
++		ElementMatrix* CreateKMatrixCouplingMacAyealStokesViscous(void);
++		ElementMatrix* CreateKMatrixCouplingMacAyealStokesFriction(void);
++		ElementMatrix* CreateKMatrixCouplingPattynStokes(void);
++		ElementMatrix* CreateKMatrixDiagnosticHoriz(void);
++		ElementMatrix* CreateKMatrixAdjointHoriz(void);
++		ElementVector* CreateDVectorDiagnosticHoriz(void);
++		ElementVector* CreateDVectorDiagnosticStokes(void);
++		ElementMatrix* CreateKMatrixDiagnosticHutter(void);
++		ElementMatrix* CreateKMatrixDiagnosticMacAyeal2d(void);
++		ElementMatrix* CreateKMatrixDiagnosticMacAyeal3d(void);
++		ElementMatrix* CreateKMatrixDiagnosticMacAyeal3dViscous(void);
++		ElementMatrix* CreateKMatrixDiagnosticMacAyeal3dFriction(void);
++		ElementMatrix* CreateKMatrixDiagnosticMacAyealPattyn(void);
++		ElementMatrix* CreateKMatrixDiagnosticMacAyealStokes(void);
++		ElementMatrix* CreateKMatrixDiagnosticPattyn(void);
++		ElementMatrix* CreateKMatrixDiagnosticPattynViscous(void);
++		ElementMatrix* CreateKMatrixDiagnosticPattynFriction(void);
++		ElementMatrix* CreateKMatrixDiagnosticPattynStokes(void);
++		ElementMatrix* CreateKMatrixDiagnosticStokes(void);
++		ElementMatrix* CreateKMatrixDiagnosticStokesViscous(void);
++		ElementMatrix* CreateKMatrixDiagnosticStokesFriction(void);
++		ElementMatrix* CreateKMatrixDiagnosticVert(void);
++		ElementMatrix* CreateKMatrixDiagnosticVertVolume(void);
++		ElementMatrix* CreateKMatrixDiagnosticVertSurface(void);
++		ElementMatrix* CreateJacobianDiagnosticHoriz(void);
++		ElementMatrix* CreateJacobianDiagnosticMacayeal2d(void);
++		ElementMatrix* CreateJacobianDiagnosticPattyn(void);
++		ElementMatrix* CreateJacobianDiagnosticStokes(void);
++		void           InputUpdateFromSolutionDiagnosticHoriz( IssmDouble* solutiong);
++		void           InputUpdateFromSolutionDiagnosticMacAyeal( IssmDouble* solutiong);
++		void           InputUpdateFromSolutionDiagnosticMacAyealPattyn( IssmDouble* solutiong);
++		void           InputUpdateFromSolutionDiagnosticMacAyealStokes( IssmDouble* solutiong);
++		void           InputUpdateFromSolutionDiagnosticPattyn( IssmDouble* solutiong);
++		void           InputUpdateFromSolutionDiagnosticPattynStokes( IssmDouble* solutiong);
++		void           InputUpdateFromSolutionDiagnosticHutter( IssmDouble* solutiong);
++		void           InputUpdateFromSolutionDiagnosticVert( IssmDouble* solutiong);
++		void           InputUpdateFromSolutionDiagnosticStokes( IssmDouble* solutiong);
++		void	         GetSolutionFromInputsDiagnosticHoriz(Vector* solutiong);
++		void	         GetSolutionFromInputsDiagnosticHutter(Vector* solutiong);
++		void	         GetSolutionFromInputsDiagnosticStokes(Vector* solutiong);
++		void	         GetSolutionFromInputsDiagnosticVert(Vector* solutiong);
++		ElementVector* CreatePVectorCouplingMacAyealStokes(void);
++		ElementVector* CreatePVectorCouplingMacAyealStokesViscous(void);
++		ElementVector* CreatePVectorCouplingMacAyealStokesFriction(void);
++		ElementVector* CreatePVectorCouplingPattynStokes(void);
++		ElementVector* CreatePVectorCouplingPattynStokesViscous(void);
++		ElementVector* CreatePVectorCouplingPattynStokesFriction(void);
++		ElementVector* CreatePVectorDiagnosticHoriz(void);
++		ElementVector* CreatePVectorDiagnosticHutter(void);
++		ElementVector* CreatePVectorDiagnosticMacAyeal(void);
++		ElementVector* CreatePVectorDiagnosticMacAyealPattyn(void);
++		ElementVector* CreatePVectorDiagnosticMacAyealStokes(void);
++		ElementVector* CreatePVectorDiagnosticPattyn(void);
++		ElementVector* CreatePVectorDiagnosticPattynStokes(void);
++		ElementVector* CreatePVectorDiagnosticStokes(void);
++		ElementVector* CreatePVectorDiagnosticStokesViscous(void);
++		ElementVector* CreatePVectorDiagnosticStokesShelf(void);
++		ElementVector* CreatePVectorDiagnosticVert(void);
++		ElementVector* CreatePVectorDiagnosticVertVolume(void);
++		ElementVector* CreatePVectorDiagnosticVertBase(void);
++		#endif
++
++		#ifdef _HAVE_CONTROL_
++		ElementVector* CreatePVectorAdjointHoriz(void);
++		ElementMatrix* CreateKMatrixAdjointMacAyeal2d(void);
++		ElementMatrix* CreateKMatrixAdjointPattyn(void);
++		ElementMatrix* CreateKMatrixAdjointStokes(void);
++		ElementVector* CreatePVectorAdjointMacAyeal(void);
++		ElementVector* CreatePVectorAdjointPattyn(void);
++		ElementVector* CreatePVectorAdjointStokes(void);
++		void    InputUpdateFromSolutionAdjointHoriz( IssmDouble* solutiong);
++		void    InputUpdateFromSolutionAdjointStokes( IssmDouble* solutiong);
++		#endif
++
++		#ifdef _HAVE_HYDROLOGY_
++		void    CreateHydrologyWaterVelocityInput(void);
++		#endif
++		#ifdef _HAVE_THERMAL_
++		ElementMatrix* CreateKMatrixEnthalpy(void);
++		ElementMatrix* CreateKMatrixEnthalpyVolume(void);
++		ElementMatrix* CreateKMatrixEnthalpyShelf(void);
++		ElementMatrix* CreateKMatrixThermal(void);
++		ElementMatrix* CreateKMatrixMelting(void);
++		ElementMatrix* CreateKMatrixThermalVolume(void);
++		ElementMatrix* CreateKMatrixThermalShelf(void);
++		ElementVector* CreatePVectorEnthalpy(void);
++		ElementVector* CreatePVectorEnthalpyVolume(void);
++		ElementVector* CreatePVectorEnthalpyShelf(void);
++		ElementVector* CreatePVectorEnthalpySheet(void);
++		ElementVector* CreatePVectorMelting(void);
++		ElementVector* CreatePVectorThermal(void);
++		ElementVector* CreatePVectorThermalVolume(void);
++		ElementVector* CreatePVectorThermalShelf(void);
++		ElementVector* CreatePVectorThermalSheet(void);
++		void	       GetSolutionFromInputsThermal(Vector* solutiong);
++		void           InputUpdateFromSolutionThermal( IssmDouble* solutiong);
++		void           InputUpdateFromSolutionEnthalpy( IssmDouble* solutiong);
++		#endif
++		#ifdef _HAVE_BALANCED_
++		ElementMatrix* CreateKMatrixBalancethickness(void);
++		ElementVector* CreatePVectorBalancethickness(void);
++		#endif
++		/*}}}*/
++};
++#endif  /* _PENTA_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp	(revision 12822)
+@@ -0,0 +1,503 @@
++/*!\file TriaRef.c
++ * \brief: implementation of the TriaRef object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../objects.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../Container/Container.h"
++#include "../../include/include.h"
++/*}}}*/
++
++/*Element macros*/
++#define NUMNODES 3
++
++/*Object constructors and destructor*/
++/*FUNCTION TriaRef::TriaRef(){{{*/
++TriaRef::TriaRef(){
++	this->element_type_list=NULL;
++}
++/*}}}*/
++/*FUNCTION TriaRef::TriaRef(int* types,int nummodels){{{*/
++
++TriaRef::TriaRef(const int nummodels){
++
++	/*Only allocate pointer*/
++	element_type_list=xNew<int>(nummodels);
++
++}
++/*}}}*/
++/*FUNCTION TriaRef::~TriaRef(){{{*/
++TriaRef::~TriaRef(){
++	xDelete<int>(element_type_list);
++}
++/*}}}*/
++
++/*Management*/
++/*FUNCTION TriaRef::SetElementType{{{*/
++void TriaRef::SetElementType(int type,int type_counter){
++
++	_assert_(type==P1Enum || type==P1DGEnum);
++
++	/*initialize element type*/
++	this->element_type_list[type_counter]=type;
++}
++/*}}}*/
++
++/*Reference Element numerics*/
++/*FUNCTION TriaRef::GetBMacAyeal {{{*/
++void TriaRef::GetBMacAyeal(IssmDouble* B, IssmDouble* xyz_list, GaussTria* gauss){
++	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 
++	 * For node i, Bi can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi=[ dh/dx           0    ]
++	 *          [   0           dh/dy  ]
++	 *          [ 1/2*dh/dy  1/2*dh/dx ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B has been allocated already, of size: 3x(NDOF2*NUMNODES)
++	 */
++
++	int i;
++	IssmDouble dbasis[NDOF2][NUMNODES];
++
++	/*Get dh1dh2dh3 in actual coordinate system: */
++	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list,gauss);
++
++	/*Build B: */
++	for (i=0;i<NUMNODES;i++){
++		*(B+NDOF2*NUMNODES*0+NDOF2*i)=dbasis[0][i]; //B[0][NDOF2*i]=dbasis[0][i];
++		*(B+NDOF2*NUMNODES*0+NDOF2*i+1)=0;
++		*(B+NDOF2*NUMNODES*1+NDOF2*i)=0;
++		*(B+NDOF2*NUMNODES*1+NDOF2*i+1)=dbasis[1][i];
++		*(B+NDOF2*NUMNODES*2+NDOF2*i)=(float).5*dbasis[1][i]; 
++		*(B+NDOF2*NUMNODES*2+NDOF2*i+1)=(float).5*dbasis[0][i]; 
++	}
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetBMacAyealStokes {{{*/
++void TriaRef::GetBMacAyealStokes(IssmDouble* B, IssmDouble* xyz_list, GaussTria* gauss){
++
++	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 
++	 * For node i, Bi can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi=[   dh/dx         0     ]
++	 *          [       0       dh/dy   ]
++	 *          [  1/2*dh/dy  1/2*dh/dx ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B has been allocated already, of size: 3x(NDOF2*NUMNODES)
++	 */
++
++	/*Same thing in the actual coordinate system: */
++	IssmDouble dbasis[NDOF2][NUMNODES];
++
++	/*Get dh1dh2dh3 in actual coordinates system : */
++	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list,gauss);
++
++	/*Build B': */
++	for (int i=0;i<NUMNODES;i++){
++		*(B+NDOF2*NUMNODES*0+NDOF2*i)=dbasis[0][i]; 
++		*(B+NDOF2*NUMNODES*0+NDOF2*i+1)=0; 
++		*(B+NDOF2*NUMNODES*1+NDOF2*i)=0; 
++		*(B+NDOF2*NUMNODES*1+NDOF2*i+1)=dbasis[1][i]; 
++		*(B+NDOF2*NUMNODES*2+NDOF2*i)=0.5*dbasis[1][i]; 
++		*(B+NDOF2*NUMNODES*2+NDOF2*i+1)=0.5*dbasis[0][i]; 
++	}
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetSegmentBFlux{{{*/
++void TriaRef::GetSegmentBFlux(IssmDouble* B,GaussTria* gauss, int index1,int index2){
++	/*Compute B  matrix. B=[phi1 phi2 -phi3 -phi4]
++	 *
++	 * and phi1=phi3 phi2=phi4
++	 *
++	 * We assume B has been allocated already, of size: 1x4
++	 */
++
++	IssmDouble l1l3[NUMNODES];
++
++	GetNodalFunctions(&l1l3[0],gauss);
++
++	B[0] = +l1l3[index1];
++	B[1] = +l1l3[index2];
++	B[2] = -l1l3[index1];
++	B[3] = -l1l3[index2];
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetSegmentBprimeFlux{{{*/
++void TriaRef::GetSegmentBprimeFlux(IssmDouble* Bprime,GaussTria* gauss, int index1,int index2){
++	/*Compute Bprime  matrix. Bprime=[phi1 phi2 phi3 phi4]
++	 *
++	 * and phi1=phi3 phi2=phi4
++	 *
++	 * We assume Bprime has been allocated already, of size: 1x4
++	 */
++
++	IssmDouble l1l3[NUMNODES];
++
++	GetNodalFunctions(&l1l3[0],gauss);
++
++	Bprime[0] = l1l3[index1];
++	Bprime[1] = l1l3[index2];
++	Bprime[2] = l1l3[index1];
++	Bprime[3] = l1l3[index2];
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetBPrognostic{{{*/
++void TriaRef::GetBPrognostic(IssmDouble* B_prog, IssmDouble* xyz_list, GaussTria* gauss){
++	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 
++	 * For node i, Bi can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi=[ h ]
++	 *          [ h ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B_prog has been allocated already, of size: 2x(NDOF1*NUMNODES)
++	 */
++
++	IssmDouble basis[NUMNODES];
++
++	/*Get dh1dh2dh3 in actual coordinate system: */
++	GetNodalFunctions(&basis[0],gauss);
++
++	/*Build B_prog: */
++	for (int i=0;i<NUMNODES;i++){
++		*(B_prog+NDOF1*NUMNODES*0+NDOF1*i)=basis[i];
++		*(B_prog+NDOF1*NUMNODES*1+NDOF1*i)=basis[i];
++	}
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetBprimeMacAyeal {{{*/
++void TriaRef::GetBprimeMacAyeal(IssmDouble* Bprime, IssmDouble* xyz_list, GaussTria* gauss){
++
++	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 
++	 * For node i, Bi' can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi_prime=[ 2*dh/dx    dh/dy ]
++	 *                [   dh/dx  2*dh/dy ]
++	 *                [   dh/dy    dh/dx ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B' has been allocated already, of size: 3x(NDOF2*NUMNODES)
++	 */
++
++	/*Same thing in the actual coordinate system: */
++	IssmDouble dbasis[NDOF2][NUMNODES];
++
++	/*Get dh1dh2dh3 in actual coordinates system : */
++	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list,gauss);
++
++	/*Build B': */
++	for (int i=0;i<NUMNODES;i++){
++		*(Bprime+NDOF2*NUMNODES*0+NDOF2*i)=2*dbasis[0][i]; 
++		*(Bprime+NDOF2*NUMNODES*0+NDOF2*i+1)=dbasis[1][i]; 
++		*(Bprime+NDOF2*NUMNODES*1+NDOF2*i)=dbasis[0][i]; 
++		*(Bprime+NDOF2*NUMNODES*1+NDOF2*i+1)=2*dbasis[1][i]; 
++		*(Bprime+NDOF2*NUMNODES*2+NDOF2*i)=dbasis[1][i]; 
++		*(Bprime+NDOF2*NUMNODES*2+NDOF2*i+1)=dbasis[0][i]; 
++	}
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetBprimeMacAyealStokes {{{*/
++void TriaRef::GetBprimeMacAyealStokes(IssmDouble* Bprime, IssmDouble* xyz_list, GaussTria* gauss){
++
++	/*Compute Bprime  matrix. Bprime=[Bprime1 Bprime2 Bprime3] where Bprimei is of size 3*NDOF2. 
++	 * For node i, Bprimei can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bprimei=[  dh/dx    0   ]
++	 *               [    0    dh/dy ]
++	 *               [  dh/dy  dh/dx ]
++	 *               [  dh/dx  dh/dy ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume Bprime has been allocated already, of size: 3x(NDOF2*NUMNODES)
++	 */
++
++	/*Same thing in the actual coordinate system: */
++	IssmDouble dbasis[NDOF2][NUMNODES];
++
++	/*Get dh1dh2dh3 in actual coordinates system : */
++	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list,gauss);
++
++	/*Build Bprime: */
++	for (int i=0;i<NUMNODES;i++){
++		*(Bprime+NDOF2*NUMNODES*0+NDOF2*i)=dbasis[0][i]; 
++		*(Bprime+NDOF2*NUMNODES*0+NDOF2*i+1)=0; 
++		*(Bprime+NDOF2*NUMNODES*1+NDOF2*i)=0; 
++		*(Bprime+NDOF2*NUMNODES*1+NDOF2*i+1)=dbasis[1][i]; 
++		*(Bprime+NDOF2*NUMNODES*2+NDOF2*i)=dbasis[1][i]; 
++		*(Bprime+NDOF2*NUMNODES*2+NDOF2*i+1)=dbasis[0][i]; 
++		*(Bprime+NDOF2*NUMNODES*3+NDOF2*i)=dbasis[0][i]; 
++		*(Bprime+NDOF2*NUMNODES*3+NDOF2*i+1)=dbasis[1][i]; 
++	}
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetBprimePrognostic{{{*/
++void TriaRef::GetBprimePrognostic(IssmDouble* Bprime_prog, IssmDouble* xyz_list, GaussTria* gauss){
++	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 
++	 * For node i, Bi' can be expressed in the actual coordinate system
++	 * by: 
++	 *       Bi_prime=[ dh/dx ]
++	 *                [ dh/dy ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume B' has been allocated already, of size: 3x(NDOF2*NUMNODES)
++	 */
++
++	/*Same thing in the actual coordinate system: */
++	IssmDouble dbasis[NDOF2][NUMNODES];
++
++	/*Get dh1dh2dh3 in actual coordinates system : */
++	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list,gauss);
++
++	/*Build B': */
++	for (int i=0;i<NUMNODES;i++){
++		*(Bprime_prog+NDOF1*NUMNODES*0+NDOF1*i)=dbasis[0][i]; 
++		*(Bprime_prog+NDOF1*NUMNODES*1+NDOF1*i)=dbasis[1][i]; 
++	}
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetL{{{*/
++void TriaRef::GetL(IssmDouble* L, IssmDouble* xyz_list,GaussTria* gauss,int numdof){
++	/*Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
++	 * For node i, Li can be expressed in the actual coordinate system
++	 * by: 
++	 *       numdof=1: 
++	 *                 Li=h;
++	 *       numdof=2:
++	 *                 Li=[ h   0 ]
++	 *                    [ 0   h ]
++	 * where h is the interpolation function for node i.
++	 *
++	 * We assume L has been allocated already, of size: NUMNODES (numdof=1), or numdofx(numdof*NUMNODES) (numdof=2)
++	 */
++
++	int i;
++	IssmDouble basis[3];
++
++	/*Get basis in actual coordinate system: */
++	GetNodalFunctions(basis,gauss);
++
++	/*Build L: */
++	if(numdof==1){
++		for (i=0;i<NUMNODES;i++){
++			L[i]=basis[i]; 
++		}
++	}
++	else{
++		for (i=0;i<NUMNODES;i++){
++			*(L+numdof*NUMNODES*0+numdof*i)=basis[i]; //L[0][NDOF2*i]=dbasis[0][i];
++			*(L+numdof*NUMNODES*0+numdof*i+1)=0;
++			*(L+numdof*NUMNODES*1+numdof*i)=0;
++			*(L+numdof*NUMNODES*1+numdof*i+1)=basis[i];
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetJacobian{{{*/
++void TriaRef::GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussTria* gauss){
++	/*The Jacobian is constant over the element, discard the gaussian points. 
++	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
++	IssmDouble x1,y1,x2,y2,x3,y3;
++
++	x1=*(xyz_list+NUMNODES*0+0);
++	y1=*(xyz_list+NUMNODES*0+1);
++	x2=*(xyz_list+NUMNODES*1+0);
++	y2=*(xyz_list+NUMNODES*1+1);
++	x3=*(xyz_list+NUMNODES*2+0);
++	y3=*(xyz_list+NUMNODES*2+1);
++
++
++	*(J+NDOF2*0+0)=0.5*(x2-x1);
++	*(J+NDOF2*1+0)=SQRT3/6.0*(2*x3-x1-x2);
++	*(J+NDOF2*0+1)=0.5*(y2-y1);
++	*(J+NDOF2*1+1)=SQRT3/6.0*(2*y3-y1-y2);
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetSegmentJacobianDeterminant{{{*/
++void TriaRef::GetSegmentJacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,GaussTria* gauss){
++	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
++	 * J is assumed to have been allocated*/
++	IssmDouble x1,y1,x2,y2;
++
++	x1=*(xyz_list+3*0+0);
++	y1=*(xyz_list+3*0+1);
++	x2=*(xyz_list+3*1+0);
++	y2=*(xyz_list+3*1+1);
++
++	*Jdet=1.0/2.0*sqrt(pow(x2-x1,2.) + pow(y2-y1,2.));
++	if(*Jdet<0) _error2_("negative jacobian determinant!");
++
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetJacobianDeterminant2d{{{*/
++void TriaRef::GetJacobianDeterminant2d(IssmDouble* Jdet, IssmDouble* xyz_list,GaussTria* gauss){
++	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
++	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
++	IssmDouble J[2][2];
++
++	/*Get Jacobian*/
++	GetJacobian(&J[0][0],xyz_list,gauss);
++
++	/*Get Determinant*/
++	Matrix2x2Determinant(Jdet,&J[0][0]);
++	if(*Jdet<0) _error2_("negative jacobian determinant!");
++
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetJacobianDeterminant3d {{{*/
++void TriaRef::GetJacobianDeterminant3d(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussTria* gauss){
++	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
++	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
++
++	IssmDouble x1,x2,x3,y1,y2,y3,z1,z2,z3;
++
++	x1=*(xyz_list+3*0+0);
++	y1=*(xyz_list+3*0+1);
++	z1=*(xyz_list+3*0+2);
++	x2=*(xyz_list+3*1+0);
++	y2=*(xyz_list+3*1+1);
++	z2=*(xyz_list+3*1+2);
++	x3=*(xyz_list+3*2+0);
++	y3=*(xyz_list+3*2+1);
++	z3=*(xyz_list+3*2+2);
++
++	*Jdet=SQRT3/6.0*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2.0)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2.0)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2.0),0.5);
++	if(*Jdet<0) _error2_("negative jacobian determinant!");
++
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetJacobianInvert{{{*/
++void TriaRef::GetJacobianInvert(IssmDouble*  Jinv, IssmDouble* xyz_list,GaussTria* gauss){
++
++	/*Jacobian*/
++	IssmDouble J[2][2];
++
++	/*Call Jacobian routine to get the jacobian:*/
++	GetJacobian(&J[0][0], xyz_list, gauss);
++
++	/*Invert Jacobian matrix: */
++	Matrix2x2Invert(Jinv,&J[0][0]);
++
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetNodalFunctions{{{*/
++void TriaRef::GetNodalFunctions(IssmDouble* basis,GaussTria* gauss){
++	/*This routine returns the values of the nodal functions  at the gaussian point.*/
++
++	basis[0]=gauss->coord1;
++	basis[1]=gauss->coord2;
++	basis[2]=gauss->coord3;
++
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetSegmentNodalFunctions{{{*/
++void TriaRef::GetSegmentNodalFunctions(IssmDouble* basis,GaussTria* gauss,int index1,int index2){
++	/*This routine returns the values of the nodal functions  at the gaussian point.*/
++
++	IssmDouble BasisFunctions[3];
++
++	GetNodalFunctions(&BasisFunctions[0],gauss);
++
++	_assert_(index1>=0 && index1<3);
++	_assert_(index2>=0 && index2<3);
++	basis[0]=BasisFunctions[index1];
++	basis[1]=BasisFunctions[index2];
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetNodalFunctionsDerivatives{{{*/
++void TriaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTria* gauss){
++
++	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
++	 * actual coordinate system): */
++	int       i;
++	IssmDouble    dbasis_ref[NDOF2][NUMNODES];
++	IssmDouble    Jinv[NDOF2][NDOF2];
++
++	/*Get derivative values with respect to parametric coordinate system: */
++	GetNodalFunctionsDerivativesReference(&dbasis_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]
++	 */
++	for (i=0;i<NUMNODES;i++){
++		dbasis[NUMNODES*0+i]=Jinv[0][0]*dbasis_ref[0][i]+Jinv[0][1]*dbasis_ref[1][i];
++		dbasis[NUMNODES*1+i]=Jinv[1][0]*dbasis_ref[0][i]+Jinv[1][1]*dbasis_ref[1][i];
++	}
++
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetNodalFunctionsDerivativesReference{{{*/
++void TriaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dl1dl3,GaussTria* gauss){
++	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
++	 * natural coordinate system) at the gaussian point. */
++
++	/*First nodal function: */
++	*(dl1dl3+NUMNODES*0+0)=-0.5; 
++	*(dl1dl3+NUMNODES*1+0)=-1.0/(2.0*SQRT3);
++
++	/*Second nodal function: */
++	*(dl1dl3+NUMNODES*0+1)=0.5;
++	*(dl1dl3+NUMNODES*1+1)=-1.0/(2.0*SQRT3);
++
++	/*Third nodal function: */
++	*(dl1dl3+NUMNODES*0+2)=0;
++	*(dl1dl3+NUMNODES*1+2)=1.0/SQRT3;
++
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetInputDerivativeValue{{{*/
++void TriaRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss){
++
++	/*From node values of parameter p (plist[0],plist[1],plist[2]), return parameter derivative value at gaussian 
++	 * point specified by gauss_basis:
++	 *   dp/dx=plist[0]*dh1/dx+plist[1]*dh2/dx+plist[2]*dh3/dx
++	 *   dp/dx=plist[0]*dh1/dx+plist[1]*dh2/dx+plist[2]*dh3/dx
++	 *
++	 * p is a vector of size 2x1 already allocated.
++	 */
++
++	/*Nodal Derivatives*/
++	IssmDouble dbasis[2][3]; //nodal derivative functions in actual coordinate system.
++
++	/*Get dh1dh2dh3 in actual coordinate system: */
++	GetNodalFunctionsDerivatives(&dbasis[0][0],xyz_list, gauss);
++
++	/*Assign values*/
++	*(p+0)=plist[0]*dbasis[0][0]+plist[1]*dbasis[0][1]+plist[2]*dbasis[0][2];
++	*(p+1)=plist[0]*dbasis[1][0]+plist[1]*dbasis[1][1]+plist[2]*dbasis[1][2];
++
++}
++/*}}}*/
++/*FUNCTION TriaRef::GetInputValue{{{*/
++void TriaRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTria* gauss){
++
++	/*From node values of parameter p (plist[0],plist[1],plist[2]), return parameter value at gaussian 
++	 * point specifie by gauss: */
++
++	/*nodal functions annd output: */
++	IssmDouble basis[3];
++
++	/*Get nodal functions*/
++	GetNodalFunctions(basis, gauss);
++
++	/*Get parameter*/
++	*p=basis[0]*plist[0]+basis[1]*plist[1]+basis[2]*plist[2];
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h	(revision 12822)
+@@ -0,0 +1,33 @@
++/*!\file: PentaHook.h
++ * \brief prototypes for PentaHook.h
++ */ 
++
++#ifndef _PENTAHOOK_H_
++#define  _PENTAHOOK_H_
++
++class Hook;
++class TriaHook;
++class IoModel;
++
++class PentaHook{
++
++	public: 
++		int   numanalyses; //number of analysis types
++		Hook** hnodes; // 6 nodes for each analysis type
++		Hook*  hmatice; // 1 ice material
++		Hook*  hmatpar; // 1 material parameter
++		Hook*  hneighbors; // 2 elements, first down, second up
++
++		/*FUNCTION constructors, destructors {{{*/
++		PentaHook();
++		PentaHook(int in_numanalyses,int matice_id, IoModel* iomodel);
++		~PentaHook();
++		void SetHookNodes(int* node_ids,int analysis_counter);
++		void SpawnTriaHook(TriaHook* triahook,int* indices);
++		void InitHookNeighbors(int* element_ids);
++		/*}}}*/
++};
++
++
++#endif //ifndef _PENTAHOOK_H_
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/OptArgs.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/OptArgs.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/OptArgs.h	(revision 12822)
+@@ -0,0 +1,13 @@
++/*!\file:  OptArgs.h
++ * \brief place holder for optimization function arguments
++ */ 
++
++#ifndef _OPTARGS_H_
++#define _OPTARGS_H_
++
++class Model;
++struct OptArgs{
++	FemModel* femmodel;
++};
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 12822)
+@@ -0,0 +1,1250 @@
++/*! \file IoModel.cpp
++ * \brief  file containing the methods that will help in processing the input data coming 
++ * into ISSM, from Matlab, or through a binary file opened for reading.
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <string.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <stdarg.h>
++
++#include "./objects.h"
++#include "../io/io.h"
++#include "./Container/Parameters.h"
++#include "../shared/shared.h"
++#include "../io/io.h"
++#include "../include/include.h"
++
++/*FUNCTION IoModel::IoModel(){{{*/
++IoModel::IoModel(){
++	this->fid=NULL;
++	this->data=NULL;
++	this->constants=NULL;
++	
++	this->my_elements=NULL;
++	this->my_nodes=NULL;
++	this->my_vertices=NULL;
++	this->singlenodetoelementconnectivity=NULL;
++	this->numbernodetoelementconnectivity=NULL;
++	
++	this->nodecounter=0;
++	this->loadcounter=0;
++	this->constraintcounter=0;
++}
++/*}}}*/
++/*FUNCTION IoModel::IoModel(FILE*  iomodel_handle){{{*/
++IoModel::IoModel(FILE* iomodel_handle){
++	
++	/*First, keep track of the file handle: */
++	this->fid=iomodel_handle;
++
++	/*Check that Enums are Synchronized*/
++	this->CheckEnumSync();
++
++	/*Initialize and read constants:*/
++	this->constants=new Parameters();
++	this->FetchConstants(); /*this routine goes through the input file, and fetches bools, ints, IssmDoubles and strings only, nothing memory intensive*/
++
++	/*Initialize data: */
++	this->data=xNew<IssmDouble*>(MaximumNumberOfEnums);
++	for(int i=0;i<MaximumNumberOfEnums;i++) this->data[i]=NULL;
++	
++	/*Initialize permanent data: */
++	this->my_elements=NULL;
++	this->my_nodes=NULL;
++	this->my_vertices=NULL;
++	this->singlenodetoelementconnectivity=NULL;
++	this->numbernodetoelementconnectivity=NULL;
++	
++	this->nodecounter=0;
++	this->loadcounter=0;
++	this->constraintcounter=0;
++}
++/*}}}*/
++/*FUNCTION IoModel::~IoModel(){{{*/
++IoModel::~IoModel(){
++
++	if(this->constants) delete this->constants;
++
++	/*Some checks in debugging mode*/
++	#ifdef _ISSM_DEBUG_
++	if(this->data){
++		for(int i=0;i<MaximumNumberOfEnums;i++){
++			if(this->data[i]){
++				_pprintLine_("Info: previous pointer of " << EnumToStringx(i) << " has not been freed (DeleteData has not been called)");
++			}
++		}
++	}
++	#endif
++
++	xDelete<IssmDouble*>(this->data);
++	xDelete<bool>(this->my_elements);
++	xDelete<bool>(this->my_nodes);
++	xDelete<int>(this->my_vertices);
++	xDelete<int>(this->singlenodetoelementconnectivity);
++	xDelete<int>(this->numbernodetoelementconnectivity);
++}
++/*}}}*/
++
++/*FUNCTION IoModel::CheckEnumSync{{{*/
++void  IoModel::CheckEnumSync(void){
++
++	extern int my_rank;
++	int record_enum = 0;
++
++	/*Check that some fields have been allocated*/
++	_assert_(this->fid || my_rank);
++
++	/*Go find in the binary file, the position of the data we want to fetch: */
++	if(my_rank==0){ //cpu 0
++
++		/*First set FILE* position to the beginning of the file: */
++		fseek(this->fid,0,SEEK_SET);
++
++		/*Get first Enum*/
++		if(fread(&record_enum,sizeof(int),1,this->fid)==0){
++			_error2_("Marshalled file is empty");
++		}
++		else{
++			if(record_enum!=MaximumNumberOfEnums){
++				_printLine_("");
++				_printLine_("=========================================================================");
++				_printLine_(" Enums in marshalled file are not compatible with compiled code          ");
++				_printLine_("                                                                         ");
++				_printLine_("   * If you are running ISSM on a remote cluster:                        ");
++				_printLine_("     make sure that you are using the same version of ISSM on your local ");
++				_printLine_("     machine and remote cluster (you might need to run svn update)       ");
++				_printLine_("   * If you are running ISSM on your local machine:                      ");
++				_printLine_("     make sure that all the code is compiled (modules and executables)   ");
++				_printLine_("   * If you are a developer and just added a new Enum:                   ");
++				_printLine_("     you might need to run ./Synchronize.sh in src/c/EnumDefinitions     ");
++				_printLine_("     and recompile                                                       ");
++				_printLine_("=========================================================================");
++				_printLine_("");
++				_error2_("Enums not consistent (See error message above)");
++			}
++		}
++	}
++}
++/*}}}*/
++/*FUNCTION IoModel::Constant(bool* poutput,int constant_enum){{{*/
++void IoModel::Constant(bool* poutput,int constant_enum){
++
++	_assert_(constant_enum>=0);
++	_assert_(this->constants);
++
++	this->constants->FindParam(poutput,constant_enum);
++}
++/*}}}*/
++/*FUNCTION IoModel::Constant(int* poutput,int constant_enum){{{*/
++void IoModel::Constant(int* poutput,int constant_enum){
++
++	_assert_(constant_enum>=0);
++	_assert_(this->constants);
++
++	this->constants->FindParam(poutput,constant_enum);
++}
++/*}}}*/
++/*FUNCTION IoModel::Constant(IssmDouble* poutput,int constant_enum){{{*/
++void IoModel::Constant(IssmDouble* poutput,int constant_enum){
++
++	_assert_(constant_enum>=0);
++	_assert_(this->constants);
++
++	this->constants->FindParam(poutput,constant_enum);
++}
++/*}}}*/
++/*FUNCTION IoModel::Constant(char** poutput,int constant_enum){{{*/
++void IoModel::Constant(char** poutput,int constant_enum){
++
++	_assert_(constant_enum>=0);
++	_assert_(this->constants);
++
++	this->constants->FindParam(poutput,constant_enum);
++}
++/*}}}*/
++/*FUNCTION IoModel::CopyConstantObject{{{*/
++Param* IoModel::CopyConstantObject(int constant_enum){
++
++	_assert_(this->constants);
++
++	/*Find constant*/
++	Param* param=(Param*)this->constants->FindParamObject(constant_enum);
++	if(!param) _error2_("Constant " << EnumToStringx(constant_enum) << " not found in iomodel");
++
++	return (Param*)param->copy();
++}
++/*}}}*/
++/*FUNCTION IoModel::Data{{{*/
++IssmDouble* IoModel::Data(int data_enum){
++
++	_assert_(data_enum<MaximumNumberOfEnums);
++	_assert_(data_enum>=0);
++
++	return this->data[data_enum];
++}
++/*}}}*/
++/*FUNCTION IoModel::DeleteData{{{*/
++void  IoModel::DeleteData(int num,...){
++
++	va_list ap;
++	int     dataenum;
++	int     i;
++	DoubleMatParam* parameter=NULL;
++
++	/*Go through the entire list of enums and delete the corresponding data from the iomodel-data dataset: */
++
++	va_start(ap,num);
++	for(i = 0; i <num; i++){
++		dataenum=va_arg(ap, int);
++		_assert_(dataenum<MaximumNumberOfEnums);
++		xDelete<IssmDouble>(this->data[dataenum]);
++	}
++	va_end(ap);
++} /*}}}*/
++/*FUNCTION IoModel::FetchConstants{{{*/
++void  IoModel::FetchConstants(void){
++
++	extern int my_rank;
++	extern int num_procs;
++	
++	/*record descriptions; */
++	int record_enum;
++	int record_length;
++	int record_code; //1 to 7 number
++
++	/*records: */
++	int  booleanint=0;
++	int  integer=0;
++	IssmPDouble scalar=0;
++	char* string=NULL;
++	int   string_size;
++
++	/*Check that some fields have been allocated*/
++	_assert_(this->fid || my_rank);
++	_assert_(this->constants);
++
++	/*Go find in the binary file, the position of the data we want to fetch: */
++	if(my_rank==0){ //cpu 0{{{
++	
++		/*First set FILE* position to the beginning of the file: */
++		fseek(this->fid,0,SEEK_SET);
++
++		/*Now march through file looking for the correct data identifiers (bool,int,IssmDouble or string): */
++		for(;;){
++			if(fread(&record_enum,sizeof(int),1,this->fid)==0){
++
++				/*Ok, we have reached the end of the file. break: */
++				record_code=0; //0 means bailout
++				#ifdef _HAVE_MPI_
++				MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*tell others cpus we are bailing: */
++				#endif
++				break;
++			}
++			else{
++			
++				/* Read the record length and the data type code: */
++				fread(&record_length,sizeof(int),1,this->fid);
++				fread(&record_code,sizeof(int),1,this->fid);
++					
++				#ifdef _HAVE_MPI_
++				/*Tell other cpus what we are doing: */
++				MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*tell other cpus what we are going to do: */
++
++				/*Tell other cpus the name of the data, then branch according to the data type: */
++				MPI_Bcast(&record_enum,1,MPI_INT,0,MPI_COMM_WORLD);  
++				MPI_Bcast(&record_length,1,MPI_INT,0,MPI_COMM_WORLD);  
++				#endif
++				
++				switch(record_code){
++					case 1: 
++						/*Read the boolean and broadcast it to other cpus:*/
++						if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error2_("could not read boolean ");
++						#ifdef _HAVE_MPI_
++						MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
++						#endif
++
++						/*create BoolParam: */
++						this->constants->AddObject(new BoolParam(record_enum,(bool)booleanint)); //cast to boolean
++
++						break;
++					case 2:
++						/*Read the integer and broadcast it to other cpus:*/
++						if(fread(&integer,sizeof(int),1,this->fid)!=1) _error2_("could not read integer ");
++						#ifdef _HAVE_MPI_
++						MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
++						#endif
++
++						/*create IntParam: */
++						this->constants->AddObject(new IntParam(record_enum,integer));
++
++						break;
++					case 3:
++						/*Read the scalar and broadcast it to other cpus:*/
++						if(fread(&scalar,sizeof(IssmPDouble),1,this->fid)!=1) _error2_("could not read scalar ");
++						#ifdef _HAVE_MPI_
++						MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
++						#endif
++
++						/*create DoubleParam: */
++						this->constants->AddObject(new DoubleParam(record_enum,scalar));
++
++						break;
++					case 4: 
++						/*We have to read a string from disk. First read the dimensions of the string, then the string: */
++						if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error2_("could not read length of string ");
++						#ifdef _HAVE_MPI_
++						MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
++						#endif
++
++						if(string_size){
++							string=xNew<char>(string_size+1);
++							string[string_size]='\0';
++
++							/*Read string, then broadcast: */
++							if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error2_(" could not read string ");
++							#ifdef _HAVE_MPI_
++							MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
++							#endif
++						}
++						else{
++							string=xNew<char>(1);
++							string[0]='\0';
++						}
++						
++						/*Add string to parameters: */
++						this->constants->AddObject(new StringParam(record_enum,string));
++
++						/*Free string*/
++						xDelete<char>(string);
++
++						break;
++					case 5: 
++							/*We are not interested in this record, too memory intensive. Skip it: */
++							/*skip: */
++							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
++							fseek(fid,record_length,SEEK_CUR);
++							break;
++					case 6: 
++							/*We are not interested in this record, too memory intensive. Skip it: */
++							/*skip: */
++							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
++							fseek(fid,record_length,SEEK_CUR);
++							break;
++					case 7: 
++							/*We are not interested in this record, too memory intensive. Skip it: */
++							/*skip: */
++							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
++							fseek(fid,record_length,SEEK_CUR);
++							break;
++
++					case 8: 
++							/*We are not interested in this record, too memory intensive. Skip it: */
++							/*skip: */
++							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
++							fseek(fid,record_length,SEEK_CUR);
++							break;
++
++					case 9: 
++							/*We are not interested in this record, too memory intensive. Skip it: */
++							/*skip: */
++							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
++							fseek(fid,record_length,SEEK_CUR);
++							break;
++
++					default: 
++						_error2_("unknown record type:" << record_code); 
++						break;;
++				}
++			}
++		}
++	} //}}}
++	#ifdef _HAVE_MPI_
++	else{ //cpu ~0 {{{
++		for(;;){ //wait on cpu 0
++			MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*get from cpu 0 what we are going to do: */
++			if(record_code==0){
++				break; //we are done, break from the loop
++			}
++			else{
++				MPI_Bcast(&record_enum,1,MPI_INT,0,MPI_COMM_WORLD);   //get from cpu 0 name of the data
++				MPI_Bcast(&record_length,1,MPI_INT,0,MPI_COMM_WORLD);  
++				switch(record_code){
++				case 1: 
++					/*boolean. get it from cpu 0 */
++					MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
++						
++					/*create BoolParam: */
++					this->constants->AddObject(new BoolParam(record_enum,(bool)booleanint)); //cast to a boolean
++					break;
++
++				case 2:
++					/*integer. get it from cpu 0 */
++					MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
++						
++					/*create IntParam: */
++					this->constants->AddObject(new IntParam(record_enum,integer));
++
++					break;
++				case 3:
++					/*scalar. get it from cpu 0 */
++					MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
++						
++					/*create DoubleParam: */
++					this->constants->AddObject(new DoubleParam(record_enum,scalar));
++
++					break;
++				case 4: 
++					MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
++					if(string_size){
++						string=xNew<char>((string_size+1));
++						string[string_size]='\0';
++
++						/*Read string from cpu 0: */
++						MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
++					}
++					else{
++						string=xNew<char>(1);
++						string[0]='\0';
++					}
++					/*Add string to parameters: */
++					this->constants->AddObject(new StringParam(record_enum,string));
++
++					/*Free string*/
++					xDelete<char>(string);
++
++					break;
++				case 5: break; //do nothing. not interested in this type of data, which is memory intensive.
++				case 6: break; //do nothing. not interested in this type of data, which is memory intensive.
++				case 7: break; //do nothing. not interested in this type of data, which is memory intensive.
++				case 8: break; //do nothing. not interested in this type of data, which is memory intensive.
++				case 9: break; //do nothing. not interested in this type of data, which is memory intensive.
++
++				default: 
++					_error2_("unknown record type:" << record_code); 
++					break;;
++				}
++
++
++			}
++		}
++	} //}}}
++	#endif
++}
++/*}}}*/
++/*FUNCTION IoModel::FetchData(bool*     pbool,int data_enum){{{*/
++void  IoModel::FetchData(bool* pboolean,int data_enum){
++
++	extern int my_rank;
++	extern int num_procs;
++	
++
++	/*output: */
++	int   booleanint;
++	int   code;
++	
++	/*Set file pointer to beginning of the data: */
++	fid=this->SetFilePointerToData(&code,NULL,data_enum);
++
++	if(code!=1)_error2_("expecting a boolean for enum " << EnumToStringx(data_enum));
++	
++	/*We have to read a boolean from disk. */
++	if(my_rank==0){  
++		if(fread(&booleanint,sizeof(int),1,fid)!=1) _error2_("could not read boolean ");
++	}
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
++	#endif
++
++	/*cast to bool: */
++	/*Assign output pointers: */
++	*pboolean=(bool)booleanint;
++
++}
++/*}}}*/
++/*FUNCTION IoModel::FetchData(int*      pinteger,int data_enum){{{*/
++void  IoModel::FetchData(int* pinteger,int data_enum){
++
++	extern int my_rank;
++	extern int num_procs;
++
++	/*output: */
++	int   integer;
++	int   code;
++	
++	/*Set file pointer to beginning of the data: */
++	fid=this->SetFilePointerToData(&code,NULL,data_enum);
++	
++	if(code!=2)_error2_("expecting an integer for enum " << EnumToStringx(data_enum));
++	
++	/*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
++	if(my_rank==0){  
++		if(fread(&integer,sizeof(int),1,fid)!=1) _error2_("could not read integer ");
++	}
++
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
++	#endif
++
++	/*Assign output pointers: */
++	*pinteger=integer;
++}
++/*}}}*/
++/*FUNCTION IoModel::FetchData(IssmDouble*   pscalar,int data_enum){{{*/
++void  IoModel::FetchData(IssmDouble* pscalar,int data_enum){
++
++
++	extern int my_rank;
++	extern int num_procs;
++	
++
++	/*output: */
++	IssmPDouble   scalar;
++	int      code;
++	
++	/*Set file pointer to beginning of the data: */
++	fid=this->SetFilePointerToData(&code,NULL,data_enum);
++	
++	if(code!=3)_error2_("expecting a IssmDouble for enum " << EnumToStringx(data_enum));
++	
++	/*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */
++	if(my_rank==0){
++		if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1)_error2_("could not read scalar ");
++	}
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
++	#endif
++
++	/*Assign output pointers: */
++	*pscalar=scalar;
++		 
++}
++/*}}}*/
++/*FUNCTION IoModel::FetchData(char**    pstring,int data_enum){{{*/
++void  IoModel::FetchData(char** pstring,int data_enum){
++
++	extern int my_rank;
++	extern int num_procs;
++	
++
++	/*output: */
++	char* string=NULL;
++	int   string_size;
++	int code=0;
++	
++	/*Set file pointer to beginning of the data: */
++	fid=this->SetFilePointerToData(&code,NULL,data_enum);
++	
++	if(code!=4)_error2_("expecting a string for enum " << EnumToStringx(data_enum));
++	
++	/*Now fetch: */
++	
++	/*We have to read a string from disk. First read the dimensions of the string, then the string: */
++	if(my_rank==0){  
++		if(fread(&string_size,sizeof(int),1,fid)!=1) _error2_("could not read length of string ");
++	}
++
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
++	#endif
++
++	/*Now allocate string: */
++	if(string_size){
++		string=xNew<char>((string_size+1));
++		string[string_size]='\0';
++
++		/*Read string on node 0, then broadcast: */
++		if(my_rank==0){  
++			if(fread(string,string_size*sizeof(char),1,fid)!=1)_error2_(" could not read string ");
++		}
++		#ifdef _HAVE_MPI_
++		MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
++		#endif
++	}
++	else{
++		string=xNew<char>(1);
++		string[0]='\0';
++	}
++
++
++	/*Assign output pointers: */
++	*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){
++
++	extern int my_rank;
++	extern int num_procs;
++	int i,j;
++
++	/*output: */
++	int M,N;
++	IssmPDouble* matrix=NULL;
++	int*    integer_matrix=NULL;
++	int code=0;
++	int vector_type=0;
++	
++	
++	/*Set file pointer to beginning of the data: */
++	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
++
++	if((code!=5) && (code!=6) && (code!=7))_error2_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
++	
++	/*Now fetch: */
++
++	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
++	/*numberofelements: */
++	if(my_rank==0){  
++		if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows for matrix ");
++	}
++
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
++	#endif
++
++	if(my_rank==0){  
++		if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns for matrix ");
++	}
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
++	#endif
++
++	/*Now allocate matrix: */
++	if(M*N){
++		matrix=xNew<IssmPDouble>(M*N);
++
++		/*Read matrix on node 0, then broadcast: */
++		if(my_rank==0){  
++			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
++		}
++		
++		#ifdef _HAVE_MPI_
++		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
++		#endif
++	}
++
++	/*Now cast to integer: */
++	if(M*N){
++		integer_matrix=xNew<int>(M*N);
++		for (i=0;i<M;i++){
++			for (j=0;j<N;j++){
++				integer_matrix[i*N+j]=(int)matrix[i*N+j];
++			}
++		}
++	}
++	else{
++		integer_matrix=NULL;
++	}
++	/*Free ressources:*/
++	xDelete<IssmPDouble>(matrix);
++
++	/*Assign output pointers: */
++	*pmatrix=integer_matrix;
++	if (pM)*pM=M;
++	if (pN)*pN=N;
++
++}
++/*}}}*/
++/*FUNCTION IoModel::FetchData(IssmDouble**  pIssmDoublematrix,int* pM,int* pN,int data_enum){{{*/
++void  IoModel::FetchData(IssmDouble** pmatrix,int* pM,int* pN,int data_enum){
++
++	extern int my_rank;
++	extern int num_procs;
++
++	/*output: */
++	int M,N;
++	IssmPDouble* matrix=NULL;
++	int code=0;
++	int vector_type=0;
++	
++	/*Set file pointer to beginning of the data: */
++	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
++	if((code!=5) && (code!=6) && (code!=7))_error2_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
++	
++	/*Now fetch: */
++
++	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
++	/*numberofelements: */
++	if(my_rank==0){  
++		if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows for matrix ");
++	}
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
++	#endif
++
++	if(my_rank==0){  
++		if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns for matrix ");
++	}
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
++	#endif
++
++	/*Now allocate matrix: */
++	if(M*N){
++		matrix=xNew<IssmPDouble>(M*N);
++
++		/*Read matrix on node 0, then broadcast: */
++		if(my_rank==0){  
++			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
++		}
++		#ifdef _HAVE_MPI_
++		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
++		#endif
++	        *pmatrix=xNew<IssmDouble>(M*N);
++	        for (int i=0;i<M*N;++i) (*pmatrix)[i]=matrix[i];
++	        xDelete<IssmPDouble>(matrix);
++	}
++	else
++	  *pmatrix=NULL;
++	/*Assign output pointers: */
++	if (pM)*pM=M;
++	if (pN)*pN=N;
++}
++/*}}}*/
++/*FUNCTION IoModel::FetchData(char***   pstrings,int* pnumstrings,int data_enum){{{*/
++void  IoModel::FetchData(char*** pstrings,int* pnumstrings,int data_enum){
++
++	extern int my_rank;
++	extern int num_procs;
++	
++	int i;
++
++	/*output: */
++	int   numstrings=0;
++	char** strings=NULL;
++	
++	/*intermediary: */
++	char* string=NULL;
++	int   string_size;
++	int   code;
++	
++	/*Set file pointer to beginning of the data: */
++	fid=this->SetFilePointerToData(&code,NULL,data_enum);
++	
++	if(code!=9)_error2_("expecting a string array for enum " << EnumToStringx(data_enum));
++	
++	/*We have to read a bunch of strings from disk. First read the number of strings, and allocate: */
++	if(my_rank==0){  
++		if(fread(&numstrings,sizeof(int),1,fid)!=1) _error2_("could not read length of string array");
++	}
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&numstrings,1,MPI_INT,0,MPI_COMM_WORLD); 
++	#endif
++
++	/*Now allocate string array: */
++	if(numstrings){
++		strings=xNew<char*>(numstrings);
++		for(i=0;i<numstrings;i++)strings[i]=NULL;
++
++		/*Go through strings, and read: */
++		for(i=0;i<numstrings;i++){
++			
++			if(my_rank==0){  
++				if(fread(&string_size,sizeof(int),1,fid)!=1) _error2_("could not read length of string ");
++			}
++			#ifdef _HAVE_MPI_
++			MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
++			#endif
++			if(string_size){
++				string=xNew<char>((string_size+1));
++				string[string_size]='\0';
++
++				/*Read string on node 0, then broadcast: */
++				if(my_rank==0){  
++					if(fread(string,string_size*sizeof(char),1,fid)!=1)_error2_(" could not read string ");
++				}
++				#ifdef _HAVE_MPI_
++				MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
++				#endif
++			}
++			else{
++				string=xNew<char>(1);
++				string[0]='\0';
++			}
++
++			strings[i]=string;
++		}
++	}
++
++	/*Assign output pointers: */
++	*pstrings=strings;
++	*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){
++
++	int i;
++
++	extern int my_rank;
++	extern int num_procs;
++
++	/*output: */
++	IssmDouble** matrices=NULL;
++	int*     mdims=NULL;
++	int*     ndims=NULL;
++	int      numrecords=0;
++
++	/*intermediary: */
++	int     M, N;
++	IssmPDouble *matrix = NULL;
++	int     code;
++	
++	/*Set file pointer to beginning of the data: */
++	fid=this->SetFilePointerToData(&code,NULL,data_enum);
++	if(code!=8)_error2_("expecting a IssmDouble mat array for enum " << EnumToStringx(data_enum));
++	
++	/*Now fetch: */
++	if(my_rank==0){  
++		if(fread(&numrecords,sizeof(int),1,fid)!=1) _error2_("could not read number of records in matrix array ");
++	}
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&numrecords,1,MPI_INT,0,MPI_COMM_WORLD); 
++	#endif
++
++	if(numrecords){
++
++		/*Allocate matrices :*/
++		matrices=xNew<IssmDouble*>(numrecords);
++		mdims=xNew<int>(numrecords);
++		ndims=xNew<int>(numrecords);
++
++		for(i=0;i<numrecords;i++){
++			matrices[i]=NULL;
++			mdims[i]=0;
++			ndims[i]=0;
++		}
++
++		/*Loop through records and fetch matrix: */
++		for(i=0;i<numrecords;i++){
++
++			if(my_rank==0){  
++				if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows in " << i << "th matrix of matrix array");
++			}
++			#ifdef _HAVE_MPI_
++			MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
++			#endif
++
++			if(my_rank==0){  
++				if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns in " << i << "th matrix of matrix array");
++			}
++			#ifdef _HAVE_MPI_
++			MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
++			#endif
++
++			/*Now allocate matrix: */
++			if(M*N){
++				matrix=xNew<IssmPDouble>(M*N);
++
++				/*Read matrix on node 0, then broadcast: */
++				if(my_rank==0){  
++					if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
++				}
++
++				#ifdef _HAVE_MPI_
++				MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
++				#endif
++				matrices[i]=xNew<IssmDouble>(M*N);
++				for (int j=0;j<M*N;++j) {matrices[i][j]=matrix[j];}
++				xDelete<IssmPDouble>(matrix);
++			}
++			else
++			  matrices[i]=NULL;
++			/*Assign: */
++			mdims[i]=M;
++			ndims[i]=N;
++		}
++	}
++
++	/*Assign output pointers: */
++	*pmatrices=matrices;
++	*pmdims=mdims;
++	*pndims=ndims;
++	*pnumrecords=numrecords;
++}
++/*}}}*/
++/*FUNCTION IoModel::FetchData(Option**  poption,int data_enum){{{*/
++void  IoModel::FetchData(Option** poption,int index){
++
++	extern int my_rank;
++	extern int num_procs;
++
++	/*output: */
++	int     code;
++	Option *option      = NULL;
++	char   *name        = NULL;
++
++	/*First get option name*/
++	this->FetchData(&name,index);
++
++	/*Get option value*/
++	fid=this->SetFilePointerToData(&code,NULL,index+1);
++	switch(code){
++		case 3: {//IssmDouble
++			  IssmDouble *value = NULL;
++			  value=xNew<IssmDouble>(1);
++			  FetchData(value,index+1);
++			  option = new OptionDouble();
++			  ((OptionDouble*)option)->values = value;
++			  option->name  = name;
++			  option->numel = 1;
++			  option->ndims = 1;
++			  option->size  = NULL;
++			  break;
++			  }
++		case 4: {//char
++			  char* value = NULL;
++			  FetchData(&value,index+1);
++			  option = new OptionChar();
++			  ((OptionChar*)option)->values = value;
++			  option->name  = name;
++			  option->numel = 1;
++			  option->ndims = 1;
++			  option->size  = NULL;
++			  break;
++			  }
++		default:
++			  _error2_("Option of format " << code << " not supported yet");
++	}
++
++	/*Assign output pointers: */
++	*poption=option;
++}
++/*}}}*/
++/*FUNCTION IoModel::FetchData(int num,...){{{*/
++void  IoModel::FetchData(int num,...){
++
++	va_list ap;
++	int     dataenum;
++	IssmDouble* matrix=NULL;
++	int     M,N;
++	int     i;
++
++	/*Go through the entire list of enums and fetch the corresponding data. Add it to the iomodel->data dataset. Everything
++	 *we fetch is a IssmDouble* : */
++	
++	va_start(ap,num);
++	for(i=0; i<num; i++){
++		
++		dataenum=va_arg(ap, int);
++
++		/*Some checks in debugging mode*/
++		/*{{{*/
++		#ifdef _ISSM_DEBUG_
++		_assert_(dataenum<MaximumNumberOfEnums);
++		if(this->data[dataenum]){
++			_error2_("Info: trying to fetch " << EnumToStringx(dataenum) << " but previous pointer has not been freed (DeleteData has not been called)");
++		}
++		#endif
++		/*}}}*/
++
++		/*Add to this->data: */
++		this->FetchData(&matrix,&M,&N,dataenum);
++		this->data[dataenum]=matrix;
++	}
++	va_end(ap);
++
++}
++/*}}}*/
++/*FUNCTION IoModel::FetchDataToInput{{{*/
++void IoModel::FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum,IssmDouble default_value){
++
++	/*intermediary: */
++	int     i;
++	bool    defaulting    = false;
++	bool    transient     = false;
++
++	FILE   *fid           = NULL;
++	int     code          = 0;
++	int     vector_layout = 0;
++	int     counter;
++	int     nods;
++	int     nel;
++	int     numberofelements;
++
++
++	/*variables being fetched: */
++	bool    boolean;
++	int     integer;
++	IssmDouble  scalar;
++	char   *string        = NULL;
++	IssmDouble *IssmDoublevector  = NULL;
++	int     M,N;
++
++	/*Fetch parameters: */
++	this->constants->FindParam(&numberofelements,MeshNumberofelementsEnum);
++
++	/*First of, find the record for the enum, and get code  of data type: */
++	fid=this->SetFilePointerToData(&code, &vector_layout,vector_enum);
++
++	switch(code){
++		case 1: //boolean constant.  {{{
++			this->FetchData(&boolean,vector_enum);
++
++			/*Add boolean constant input to all elements: */
++			counter=0;
++			for (i=0;i<numberofelements;i++){
++				if(this->my_elements[i]){
++					Element* element=(Element*)elements->GetObjectByOffset(counter);
++					element->InputCreate((IssmDouble)boolean,vector_enum,code);
++					counter++;
++				}
++			}
++			break; /*}}}*/
++		case 2: //integer constant.  {{{
++			this->FetchData(&integer,vector_enum);
++
++			/*Add integer constant input to all elements: */
++			counter=0;
++			for (i=0;i<numberofelements;i++){
++				if(this->my_elements[i]){
++					Element* element=(Element*)elements->GetObjectByOffset(counter);
++					element->InputCreate((IssmDouble)integer,vector_enum,code);
++					counter++;
++				}
++			}
++			break; /*}}}*/
++		case 3: //IssmDouble constant.  {{{
++			this->FetchData(&scalar,vector_enum);
++
++			/*Add IssmDouble constant input to all elements: */
++			counter=0;
++			for (i=0;i<numberofelements;i++){
++				if(this->my_elements[i]){
++					Element* element=(Element*)elements->GetObjectByOffset(counter);
++					element->InputCreate(scalar,vector_enum,code); 
++					counter++;
++				}
++			}
++			break; /*}}}*/
++		case 5: //boolean vector.  {{{
++
++			/*Fetch vector:*/
++			this->FetchData(&IssmDoublevector,&M,&N,vector_enum); //we still have a IssmDoublevector, because it might include times in transient mode
++			/*Check we got something, otherwise fetch default: */
++			if(IssmDoublevector){
++				defaulting=false;  //we are not defaulting, because  we do have a vector
++			}
++			else{
++				/*do we have a default enum to go fetch? */
++				if(default_vector_enum!=NoneEnum){
++					/*yes. fetch it: */
++					this->FetchData(&IssmDoublevector,&M,&N,default_vector_enum);
++					if(IssmDoublevector){
++						defaulting=false;  //we are not defaulting, because  we do have a vector
++					}
++					else{
++						/*even the default vector is non existent. we are defaulting to the default value: */
++						defaulting=true;
++					}
++				}
++				else{
++					/*we are left with the default value: */
++					defaulting=true;
++				}
++			}
++
++			/*Create inputs:*/
++			counter=0;
++			for (i=0;i<numberofelements;i++){
++				if(this->my_elements[i]){
++					Element* element=(Element*)elements->GetObjectByOffset(counter);
++					if(defaulting) element->InputCreate(default_value,vector_enum,code); 
++					else           element->InputCreate(IssmDoublevector,i,this,M,N,vector_layout,vector_enum,code);//we need i to index into elements.
++					counter++;
++				}
++			}
++			break; /*}}}*/
++		case 6: //int vector{{{
++
++			/*Fetch vector:*/
++			this->FetchData(&IssmDoublevector,&M,&N,vector_enum); //we still have a IssmDoublevector, because it might include times in transient mode
++			/*Check we got something, otherwise fetch default: */
++			if(IssmDoublevector){
++				defaulting=false;  //we are not defaulting, because  we do have a vector
++			}
++			else{
++				/*do we have a default enum to go fetch? */
++				if(default_vector_enum!=NoneEnum){
++					/*yes. fetch it: */
++					this->FetchData(&IssmDoublevector,&M,&N,default_vector_enum);
++					if(IssmDoublevector){
++						defaulting=false;  //we are not defaulting, because  we do have a vector
++					}
++					else{
++						/*even the default vector is non existent. we are defaulting to the default value: */
++						defaulting=true;
++					}
++				}
++				else{
++					/*we are left with the default value: */
++					defaulting=true;
++				}
++			}
++
++			/*Create inputs:*/
++			counter=0;
++			for (i=0;i<numberofelements;i++){
++				if(this->my_elements[i]){
++					Element* element=(Element*)elements->GetObjectByOffset(counter);
++					if(defaulting) element->InputCreate(default_value,vector_enum,code); 
++					else           element->InputCreate(IssmDoublevector,i,this,M,N,vector_layout,vector_enum,code);//we need i to index into elements.
++					counter++;
++				}
++			}
++			break; /*}}}*/
++		case 7: //IssmDouble vector{{{
++
++			/*Fetch vector:*/
++			this->FetchData(&IssmDoublevector,&M,&N,vector_enum);
++			/*Check we got something, otherwise fetch default: */
++			if(IssmDoublevector){
++				defaulting=false;  //we are not defaulting, because  we do have a vector
++			}
++			else{
++				/*do we have a default enum to go fetch? */
++				if(default_vector_enum!=NoneEnum){
++					/*yes. fetch it: */
++					this->FetchData(&IssmDoublevector,&M,&N,default_vector_enum);
++					if(IssmDoublevector){
++						defaulting=false;  //we are not defaulting, because  we do have a vector
++					}
++					else{
++						/*even the default vector is non existent. we are defaulting to the default value: */
++						defaulting=true;
++					}
++				}
++				else{
++					/*we are left with the default value: */
++					defaulting=true;
++				}
++			}
++
++			/*Create inputs:*/
++			counter=0;
++			for (i=0;i<numberofelements;i++){
++				if(this->my_elements[i]){
++					Element* element=(Element*)elements->GetObjectByOffset(counter);
++					if(defaulting) element->InputCreate(default_value,vector_enum,code); 
++					else           element->InputCreate(IssmDoublevector,i,this,M,N,vector_layout,vector_enum,code);//we need i to index into elements.
++					counter++;
++				}
++			}
++
++			break; /*}}}*/
++		default: /*{{{*/
++			_error2_("data code " << code << " not supported yet!");
++			break;
++			/*}}}*/
++	}
++	/*Free ressources:*/
++	xDelete<IssmDouble>(IssmDoublevector);
++	xDelete<char>(string);
++}
++/*FUNCTION IoModel::LastIndex{{{*/
++void IoModel::LastIndex(int *pindex){
++
++	extern int my_rank;
++	int        lastindex,index;
++	int        record_length;
++
++	/*Go find in the binary file, the position of the data we want to fetch: */
++	if(my_rank==0){
++
++		/*First set FILE* position to the beginning of the file: */
++		fseek(fid,0,SEEK_SET);
++
++		/*Now march through file looking for the correct data identifier: */
++		for(;;){
++			/*Read enum for this size of first string name: */
++			if(fread(&index,sizeof(int),1,fid)==0){
++				/*Ok, we have reached the end of the file. break: */
++				break;
++			}
++
++			/*read the record length, and use it to skip this record: */
++			fread(&record_length,sizeof(int),1,fid);
++			fseek(fid,record_length,SEEK_CUR);
++			lastindex=index;
++		}
++	}
++	/*Broadcast code and vector type: */
++#ifdef _HAVE_MPI_
++	MPI_Bcast(&lastindex,1,MPI_INT,0,MPI_COMM_WORLD); 
++#endif
++
++	/*Assign output pointers:*/
++	*pindex=lastindex;
++}
++/*FUNCTION IoModel::SetFilePointerToData{{{*/
++FILE* IoModel::SetFilePointerToData(int* pcode,int* pvector_type, int data_enum){
++
++	extern int my_rank;
++	extern int num_procs;
++
++	int found=0;
++	int record_enum;
++	int record_length;
++	int record_code; //1 to 7 number
++	int vector_type; //nodal or elementary
++
++	/*Go find in the binary file, the position of the data we want to fetch: */
++	if(my_rank==0){
++
++		/*First set FILE* position to the beginning of the file: */
++		fseek(fid,0,SEEK_SET);
++
++		/*Now march through file looking for the correct data identifier: */
++		for(;;){
++			/*Read enum for this size of first string name: */
++			if(fread(&record_enum,sizeof(int),1,fid)==0){
++				/*Ok, we have reached the end of the file. break: */
++				found=0;
++				break;
++			}
++
++			/*Is this the record sought for? : */
++			if (data_enum==record_enum){
++				/*Ok, we have found the correct string. Pass the record length, and read data type code: */
++				fseek(fid,sizeof(int),SEEK_CUR);
++				fread(&record_code,sizeof(int),1,fid);
++
++				/*if record_code points to a vector, get its type (nodal or elementary): */
++				if(5<=record_code && record_code<=7)fread(&vector_type,sizeof(int),1,fid);
++				found=1;
++				break;
++			}
++			else{
++				/*This is not the correct string, read the record length, and use it to skip this record: */
++				fread(&record_length,sizeof(int),1,fid);
++				/*skip: */
++				fseek(fid,record_length,SEEK_CUR);
++			}
++		}
++	}
++#ifdef _HAVE_MPI_
++	MPI_Bcast(&found,1,MPI_INT,0,MPI_COMM_WORLD); 
++	if(!found)_error2_("could not find data with name" << " " << EnumToStringx(data_enum) << " ");
++#endif
++
++	/*Broadcast code and vector type: */
++#ifdef _HAVE_MPI_
++	MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD); 
++	MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD); 
++	if(record_code==5) MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD); 
++#endif
++
++	/*Assign output pointers:*/
++	*pcode=record_code;
++	if(pvector_type)*pvector_type=vector_type;
++
++	return fid;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/OptPars.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/OptPars.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/OptPars.h	(revision 12822)
+@@ -0,0 +1,17 @@
++/*!\file:  OptPars.h
++ * \brief place holder for optimization parameters
++ */ 
++
++#ifndef _OPTPARS_H_
++#define _OPTPARS_H_
++
++struct OptPars{
++
++	IssmDouble xmin;
++	IssmDouble xmax;
++	IssmDouble cm_jump;
++	int maxiter;
++
++};
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h	(revision 12822)
+@@ -0,0 +1,67 @@
++/* \file IoModel.h
++ * \brief  Header file defining the IoModel structure that will help in processing the input data coming 
++ * into ISSM, from Matlab, or through a binary file opened for reading.
++ * \sa IoModel.cpp
++ */
++
++#ifndef _IOMODEL_H
++#define _IOMODEL_H
++
++#include "../include/include.h"
++#include "../EnumDefinitions/EnumDefinitions.h"
++
++class Elements;
++class Param;
++class Option;
++
++class IoModel {
++
++	private: 
++		IssmDouble **data;        //this dataset holds temporary data, memory intensive.
++		Parameters  *constants;   //this dataset holds all IssmDouble, int, bool and char *parameters read in from the input file.*
++
++	public:
++		/*This data needs to stay memory resident at all time, even if it's memory intensive: */
++		FILE *fid;         //pointer to input file
++		bool *my_elements;
++		bool *my_nodes;
++		int  *my_vertices;
++		int  *singlenodetoelementconnectivity;
++		int  *numbernodetoelementconnectivity;
++
++		/*Data to synchronize through low level object drivers: */
++		int nodecounter;         //keep track of how many nodes are being created in each analysis type
++		int loadcounter;         //keep track of how many loads are being created in each analysis type
++		int constraintcounter;   //keep track of how many constraints are being created in each analysis type
++
++		/*Methods*/
++		~IoModel();
++		IoModel();
++		IoModel(FILE* iomodel_handle);
++
++		/*Input/Output*/
++		void        CheckEnumSync(void);
++		void        Constant(bool *poutput,int constant_enum);
++		void        Constant(int *poutput,int constant_enum);
++		void        Constant(IssmDouble *poutput,int constant_enum);
++		void        Constant(char **poutput,int constant_enum);
++		Param      *CopyConstantObject(int constant_enum);
++		IssmDouble *Data(int dataenum);
++		void        DeleteData(int num,...);
++		void        FetchConstants(void);
++		void        FetchData(bool* pboolean,int data_enum);
++		void        FetchData(int* pinteger,int data_enum);
++		void        FetchData(IssmDouble* pscalar,int data_enum);
++		void        FetchData(char** pstring,int data_enum);
++		void        FetchData(int** pmatrix,int* pM,int* pN,int data_enum);
++		void        FetchData(IssmDouble**  pscalarmatrix,int* pM,int* pN,int data_enum);
++		void        FetchData(char***   pstringarray,int* pnumstrings,int data_enum);
++		void        FetchData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum);
++		void        FetchData(Option **poption,int data_enum);
++		void        FetchData(int num,...);
++		void        FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,IssmDouble default_value=0);
++		void        LastIndex(int *pindex);
++		FILE*       SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);
++};
++
++#endif  /* _IOMODEL_H */
Index: /issm/oecreview/Archive/12678-13393/ISSM-12822-12823.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12822-12823.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12822-12823.diff	(revision 13394)
@@ -0,0 +1,27 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-macosx64.sh	(revision 12822)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-macosx64.sh	(revision 12823)
+@@ -1,9 +1,5 @@
+ #!/bin/bash
+ 
+-#use matlab? 
+-matlab=0
+-
+-
+ #Some cleanup 
+ rm -rf install triangle
+ mkdir install
+@@ -21,11 +17,7 @@
+ cp ../makefile ./
+ 
+ #Patch triangle.c 
+-if [[ $matlab == "1" ]];then
+-	patch triangle.c ../triangle.c.patch.matlab
+-else
+-	patch triangle.c ../triangle.c.patch.python
+-fi
++patch triangle.c ../triangle.c.patch
+ 
+ #Compile triangle
+ make
Index: /issm/oecreview/Archive/12678-13393/ISSM-12823-12824.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12823-12824.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12823-12824.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 12823)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 12824)
+@@ -38,4 +38,4 @@
+ 
+ #Patch pyport.h:
+ cd include
+-patch pyport.h ../patch/pyport.h.patch
++patch pyport.h $ISSM_DIR/externalpackages/python/patches/pyport.h.patch
Index: /issm/oecreview/Archive/12678-13393/ISSM-12824-12825.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12824-12825.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12824-12825.diff	(revision 13394)
@@ -0,0 +1,31 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh	(revision 12824)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh	(revision 12825)
+@@ -1,4 +1,6 @@
+ #!/bin/bash
++PYVERSION=2.7
++PYTHON=python${PYVERSION}
+ 
+ #1: install numpy
+ #2 install scipy
+@@ -24,6 +26,9 @@
+ 	cd numpy
+ 	python setup.py build
+ 	python setup.py install
++	cd ..
++	${PYTHON} -c "import numpy; print 'Installed NumPy', numpy.__version__"
++	${PYTHON} -c "import numpy; numpy.test()"
+ 
+ 	
+ elif [[ $install == "2" ]];then 
+@@ -41,6 +46,9 @@
+ 
+ 	python setup.py build
+ 	python setup.py install
++	cd ..
++	${PYTHON} -c "import scipy; print 'Installed SciPy', scipy.__version__"
++	${PYTHON} -c "import scipy; scipy.test()"
+ 
+ elif [[ $install == "3" ]];then 
+ 	rm -rf numpy scipy
Index: /issm/oecreview/Archive/12678-13393/ISSM-12825-12826.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12825-12826.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12825-12826.diff	(revision 13394)
@@ -0,0 +1,40 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64.sh	(revision 12826)
+@@ -0,0 +1,29 @@
++#!/bin/bash
++#Install Python nose module
++
++pythonversion=2
++	
++rm -rf src 
++
++if [[ $pythonversion == "3" ]];then
++
++	svn checkout http://python-nose.googlecode.com/svn/branches/py3k
++	mv py3k src
++
++	cd src
++	python ./setup.py build
++	python ./setup.py install
++fi
++
++if [[ $pythonversion == "2" ]];then
++
++	#Download from ISSM server
++	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/nose-1.1.2.tar.gz' 'nose-1.1.2.tar.gz'
++	tar -zxvf  nose-1.1.2.tar.gz
++	mv nose-1.1.2 src
++	rm -rf nose-1.1.2
++
++	cd src
++	python ./setup.py build
++	python ./setup.py install
++fi
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12826-12827.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12826-12827.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12826-12827.diff	(revision 13394)
@@ -0,0 +1,554 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12827)
+@@ -1,34 +1,33 @@
+-"""
+-SOLVE - apply solution sequence for this model
+- 
+-    Usage:
+-       md=solve(md,solutionenum,varargin)
+-       where varargin is a list of paired arguments of string OR enums
+- 
+-    solution types available comprise:
+- 		 - DiagnosticSolutionEnum
+- 		 - PrognosticSolutionEnum
+- 		 - ThermalSolutionEnum
+- 		 - SteadystateSolutionEnum
+- 		 - TransientSolutionEnum...
+- 		 - BalancethicknessSolutionEnum
+- 		 - BedSlopeSolutionEnum
+- 		 - SurfaceSlopeSolutionEnum
+- 		 - HydrologySolutionEnum
+- 		 - FlaimSolutionEnum
+- 
+-   extra options:
+-       - loadonly : does not solve. only load results
+- 
+-    Examples:
+-       md=solve(md,DiagnosticSolutionEnum);
+-"""
+-
+ import datetime
+ import os
+ import shutil
+ 
+ def solve(md,solutionenum,*args):
++	"""
++	SOLVE - apply solution sequence for this model
++ 
++	    Usage:
++	       md=solve(md,solutionenum,varargin)
++	       where varargin is a list of paired arguments of string OR enums
++ 
++	    solution types available comprise:
++	 		 - DiagnosticSolutionEnum
++	 		 - PrognosticSolutionEnum
++	 		 - ThermalSolutionEnum
++	 		 - SteadystateSolutionEnum
++	 		 - TransientSolutionEnum...
++	 		 - BalancethicknessSolutionEnum
++	 		 - BedSlopeSolutionEnum
++	 		 - SurfaceSlopeSolutionEnum
++	 		 - HydrologySolutionEnum
++	 		 - FlaimSolutionEnum
++ 
++	   extra options:
++	       - loadonly : does not solve. only load results
++ 
++	    Examples:
++	       md=solve(md,DiagnosticSolutionEnum);
++	"""
+ 
+ 	#recover and process solve options
+ 	options=pairoptions('solution_type',solutionenum,*args)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py	(revision 12827)
+@@ -1,15 +1,14 @@
+-"""
+-DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
+- 
+-    Usage:
+-       options=process_solve_options(options)
+- 
+-    See also: SOLVE
+-"""
+-
+ import os
+ 
+ def process_solve_options(options):
++	"""
++	DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
++ 
++	    Usage:
++	       options=process_solve_options(options)
++ 
++	    See also: SOLVE
++	"""
+ 
+ 	outoptions={}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 12827)
+@@ -1,16 +1,16 @@
+-"""
+-MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
++from WriteData import *
+ 
+-    The routine creates a compatible binary file from @model md
+-    This binary file will be used for parallel runs in JPL-package
++def marshall(md):
++	"""
++	MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
+ 
+-    Usage:
+-       marshall(md)
+-"""
++	    The routine creates a compatible binary file from @model md
++	    This binary file will be used for parallel runs in JPL-package
+ 
+-from WriteData import *
++	    Usage:
++	       marshall(md)
++	"""
+ 
+-def marshall(md):
+ 	print "marshalling file '%s.bin'." % md.miscellaneous.name
+ 
+ 	#open file for binary writing
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py	(revision 12827)
+@@ -1,12 +1,11 @@
+-"""
+-PROCESSPATCH - create a structure from a patch
++def MatlabProcessPatch(structure):
++	"""
++	PROCESSPATCH - create a structure from a patch
+  
+-    Usage:
+-       Result=ProcessPatch(Result);
+-"""
++	    Usage:
++	       Result=ProcessPatch(Result);
++	"""
+ 
+-def MatlabProcessPatch(structure):
+-
+ 	#loop over steps
+ 	for structurei in structure.itervalues():
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py	(revision 12827)
+@@ -1,13 +1,12 @@
+-"""
+-LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
+- 
+-    Usage:
+-       md=loadresultsfromdisk(md=False,filename=False);
+-"""
+-
+ import os
+ 
+ def loadresultsfromdisk(md,filename):
++	"""
++	LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
++ 
++	    Usage:
++	       md=loadresultsfromdisk(md=False,filename=False);
++	"""
+ 
+ 	#check number of inputs/outputs
+ 	if not md or not filename:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.py	(revision 12827)
+@@ -1,19 +1,18 @@
+-"""
+-WAITONLOCK - wait for a file
+- 
+-    This routine will return when a file named 'filename' is written to disk.
+-    If the time limit given in input is exceeded, return 0
+- 
+-    Usage:
+-       flag=waitonlock(md,executionpath)
+-"""
+-
+ import os
+ import socket
+ import time
+ from MatlabFuncs import *
+ 
+ def waitonlock(md,executionpath,login,port):
++	"""
++	WAITONLOCK - wait for a file
++ 
++	    This routine will return when a file named 'filename' is written to disk.
++	    If the time limit given in input is exceeded, return 0
++ 
++	    Usage:
++	       flag=waitonlock(md,executionpath)
++	"""
+ 
+ 	#Get filename (lock file) and options
+ 	executionpath=md.cluster.executionpath
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py	(revision 12827)
+@@ -1,16 +1,16 @@
+-"""
+-WRITEDATA - write model field in binary file
+- 
+-    Usage:
+-       WriteData(fid,*args)
+-"""
+-
+ import numpy
+ import math
+ import struct
+ from MatlabFuncs import *
+ 
+ def WriteData(fid,*args):
++	"""
++	WRITEDATA - write model field in binary file
++ 
++	    Usage:
++	       WriteData(fid,*args)
++	"""
++
+ 	#process options
+ 	options=pairoptions(args)
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py	(revision 12827)
+@@ -1,16 +1,15 @@
+-"""
+-LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
+- 
+-    Usage:
+-       md=loadresultsfromcluster(md,runtimename);
+-"""
+-
+ import os
+ import platform
+ import socket
+ from MatlabFuncs import *
+ 
+ def loadresultsfromcluster(md,runtimename=False):
++	"""
++	LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
++ 
++	    Usage:
++	       md=loadresultsfromcluster(md,runtimename);
++	"""
+ 
+ 	#retrieve cluster, to be able to call its methods
+ 	cluster=md.cluster
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12827)
+@@ -1,12 +1,11 @@
+-"""
+-ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+- 
+-    Usage:
+-       ismodelselfconsistent(md),
+-"""
+-
+ def ismodelselfconsistent(md):
++	"""
++	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+ 
++	    Usage:
++	       ismodelselfconsistent(md),
++	"""
++
+ 	#initialize consistency as true
+ 	md.private.isconsistent=true
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py	(revision 12827)
+@@ -1,15 +1,14 @@
+-"""
+-PETSCVERSION - recover petsc version number, inside config.h file
+- 
+-    Usage:
+-        PETSC_VERSION=petscversion();
+-"""
+-
+ import os
+ from issmdir import *
+ from MatlabFuncs import *
+ 
+ def petscversion():
++	"""
++	PETSCVERSION - recover petsc version number, inside config.h file
++ 
++	    Usage:
++	        PETSC_VERSION=petscversion();
++	"""
+ 
+ 	#default
+ 	PETSC_VERSION=3
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py	(revision 12827)
+@@ -1,11 +1,3 @@
+-"""
+-SCPIN get packages from host, using scp on unix, and pscp on windows
+- 
+-    usage: scpin(host,packages,path)
+- 
+- 
+-"""
+-
+ import socket
+ import platform
+ import subprocess
+@@ -14,6 +6,13 @@
+ from MatlabFuncs import *
+ 
+ def scpin(host, login,port,path, packages):
++	"""
++	SCPIN get packages from host, using scp on unix, and pscp on windows
++ 
++	    usage: scpin(host,packages,path)
++ 
++ 
++	"""
+ 
+ 	#first get hostname
+ 	hostname=socket.gethostname().lower().split('.')[0]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py	(revision 12827)
+@@ -1,11 +1,3 @@
+-"""
+-SCPOUT send packages to a host, using scp on unix, and pscp on windows
+- 
+-    usage: scpout(host,path,packages)
+- 
+- 
+-"""
+-
+ import socket
+ import platform
+ import subprocess
+@@ -14,6 +6,13 @@
+ from MatlabFuncs import *
+ 
+ def issmscpout(host,path,login,port,packages):
++	"""
++	SCPOUT send packages to a host, using scp on unix, and pscp on windows
++ 
++	    usage: scpout(host,path,packages)
++ 
++ 
++	"""
+ 
+ 	#get hostname
+ 	hostname=socket.gethostname().lower().split('.')[0]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py	(revision 12827)
+@@ -1,10 +1,3 @@
+-"""
+-ISSMSSH - wrapper for OS independent ssh command.
+- 
+-    usage: 
+-       issmssh(host,command)
+-"""
+-
+ import socket
+ import platform
+ import subprocess
+@@ -12,6 +5,12 @@
+ from MatlabFuncs import *
+ 
+ def issmssh(host,login,port,command):
++	"""
++	ISSMSSH - wrapper for OS independent ssh command.
++ 
++	    usage: 
++	       issmssh(host,command)
++	"""
+ 
+ 	#first get hostname 
+ 	hostname=socket.gethostname().lower().split('.')[0]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12827)
+@@ -1,15 +1,14 @@
+-"""
+-%ISPETSC - figure out if PETSC package was compiled with ISSM
+-%
+-%   Usage:
+-%       flag=ispetsc();
+-"""
+-
+ import os
+ from issmdir import *
+ from MatlabFuncs import *
+ 
+ def ispetsc():
++	"""
++	ISPETSC - figure out if PETSC package was compiled with ISSM
++ 
++	    Usage:
++	        flag=ispetsc();
++	"""
+ 
+ 	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
+ 	if not os.path.exists(configfile):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py	(revision 12827)
+@@ -1,15 +1,14 @@
+-"""
+-%ISMUMPS - figure out if MUMPS package was compiled with ISSM
+-%
+-%   Usage:
+-%       flag=ismumps();
+-"""
+-
+ import os
+ from issmdir import *
+ from MatlabFuncs import *
+ 
+ def ismumps():
++	"""
++	ISMUMPS - figure out if MUMPS package was compiled with ISSM
++ 
++	    Usage:
++	        flag=ismumps();
++	"""
+ 
+ 	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
+ 	if not os.path.exists(configfile):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.py	(revision 12827)
+@@ -1,13 +1,12 @@
+ #! /usr/bin/env python
+-"""
+-PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
++def parallelrange(rank,numprocs,globalsize):
++	"""
++	PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
+  
+-    Usage: 
+-       i1,i2=parallelrange(rank,numprocs,globalsize)
+-"""
++	    Usage: 
++	       i1,i2=parallelrange(rank,numprocs,globalsize)
++	"""
+ 
+-def parallelrange(rank,numprocs,globalsize):
+-
+ 	#We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
+ 	num_local_rows=[int(globalsize/numprocs) for i in xrange(numprocs)]
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py	(revision 12827)
+@@ -1,15 +1,14 @@
+-"""
+-ISSMDIR - Get ISSM_DIR environment variable
+- 
+-    Usage:
+-       ISSM_DIR=issmdir()
+-"""
+-
+ import platform
+ import os
+ from MatlabFuncs import *
+ 
+ def issmdir():
++	"""
++	ISSMDIR - Get ISSM_DIR environment variable
++ 
++	    Usage:
++	       ISSM_DIR=issmdir()
++	"""
+ 
+ 	if not 'Windows' in platform.system():
+ 		ISSM_DIR =os.environ['ISSM_DIR']
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12827)
+@@ -1,11 +1,3 @@
+-"""
+-GENERIC cluster class definition
+- 
+-    Usage:
+-       cluster=generic('name','astrid','np',3);
+-       cluster=generic('name',oshostname(),'np',3,'login','username');
+-"""
+-
+ import socket
+ import os
+ import math
+@@ -18,6 +10,14 @@
+ from issmscpout import *
+ 
+ class generic(object):
++	"""
++	GENERIC cluster class definition
++ 
++	    Usage:
++	       cluster=generic('name','astrid','np',3);
++	       cluster=generic('name',oshostname(),'np',3,'login','username');
++	"""
++
+ 	def __init__(self,*args):    # {{{
+ 
+ 		self.name=''
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py	(revision 12826)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py	(revision 12827)
+@@ -1,14 +1,14 @@
+-"""
+-PAIROPTIONS class definition
+- 
+-    Usage:
+-       pairoptions=pairoptions();
+-       pairoptions=pairoptions('module',true,'solver',false);
+-"""
+-
+ from WriteData import *
+ 
+ class pairoptions(object):
++	"""
++	PAIROPTIONS class definition
++ 
++	    Usage:
++	       pairoptions=pairoptions();
++	       pairoptions=pairoptions('module',true,'solver',false);
++	"""
++
+ 	def __init__(self,*arg):
+ 		self.functionname = ''
+ 		self.list         = {}
Index: /issm/oecreview/Archive/12678-13393/ISSM-12827-12828.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12827-12828.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12827-12828.diff	(revision 13394)
@@ -0,0 +1,142 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py	(revision 12827)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py	(revision 12828)
+@@ -1,35 +1,4 @@
+ #! /usr/bin/env python
+-"""
+-RUNME - test deck for ISSM nightly runs
+- 
+-    In a test deck directory (tests/Vertification/NightlyRun for example)
+-    The following command will launch all the existing tests:
+-    >>> runme()
+-    To run the tests 101 and 102:
+-    >>> runme(id=[101,102])
+-    etc...
+- 
+-    Available options:
+-       'id'            followed by the list of ids requested
+-       'exclude'       ids to be excluded from the test
+-       'benchmark'     'nightly' (nightly run/ daily run)
+-                       'ismip'  : validation of ismip-hom tests
+-                       'eismint': validation of eismint tests
+-                       'thermal': validation of thermal tests
+-                       'mesh'   : validation of mesh tests
+-                       ...
+-       'procedure'     'check' : run the test (default)
+-                       'update': update the archive
+- 
+-    Usage:
+-       md=runme(varargin);
+- 
+-    Examples:
+-       runme()
+-       runme(exclude=101)
+-       md=runme(id=102,procedure='update')
+-"""
+-
+ import os
+ import glob
+ import socket
+@@ -38,11 +7,41 @@
+ import netCDF4
+ import sys
+ 
++from parallelrange import parallelrange
++from IdToName import IdToName
++
+ def runme(id=None,exclude=None,benchmark='nightly',procedure='check',output='none',rank=1,numprocs=1):
++	"""
++	RUNME - test deck for ISSM nightly runs
++ 
++	    In a test deck directory (tests/Vertification/NightlyRun for example)
++	    The following command will launch all the existing tests:
++	    >>> runme()
++	    To run the tests 101 and 102:
++	    >>> runme(id=[101,102])
++	    etc...
++ 
++	    Available options:
++	       'id'            followed by the list of ids requested
++	       'exclude'       ids to be excluded from the test
++	       'benchmark'     'nightly' (nightly run/ daily run)
++	                       'ismip'  : validation of ismip-hom tests
++	                       'eismint': validation of eismint tests
++	                       'thermal': validation of thermal tests
++	                       'mesh'   : validation of mesh tests
++	                       ...
++	       'procedure'     'check' : run the test (default)
++	                       'update': update the archive
++ 
++	    Usage:
++	       md=runme(varargin);
++ 
++	    Examples:
++	       runme()
++	       runme(exclude=101)
++	       md=runme(id=102,procedure='update')
++	"""
+ 
+-	from parallelrange import parallelrange
+-	from IdToName import IdToName
+-
+ 	#Get ISSM_DIR variable
+ 	ISSM_DIR=os.environ['ISSM_DIR']
+ 	print 'ISSM_DIR =',ISSM_DIR
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12827)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12828)
+@@ -1,12 +1,13 @@
+ #! /usr/bin/env python
+-"""
+-IDTONAME- return name of test
++
++def IdToName(id):
++	"""
++	IDTONAME- return name of test
+  
+-    Usage:
+-       name=IdToName(id)
+-"""
++	    Usage:
++	       name=IdToName(id)
++	"""
+ 
+-def IdToName(id):
+ 	idname={
+ 		101 : 'SquareShelfConstrainedDiagM2d',
+ 		102 : 'SquareShelfConstrainedDiagM3d',
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdFromString.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdFromString.py	(revision 12827)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdFromString.py	(revision 12828)
+@@ -1,18 +1,17 @@
+ #! /usr/bin/env python
+-"""
+-IDFROMSTRING - output ids from a given string
+- 
+-    Usage:
+-       ids=IdFromString(string)
+- 
+-    Examples:
+-       ids=IdFromString('Parallel')
+-       ids=IdFromString('79North')
+-"""
+-
+ from IdToName import IdToName
+ 
+ def IdFromString(string):
++	"""
++	IDFROMSTRING - output ids from a given string
++ 
++	    Usage:
++	       ids=IdFromString(string)
++ 
++	    Examples:
++	       ids=IdFromString('Parallel')
++	       ids=IdFromString('79North')
++	"""
+ 
+ 	#Check input
+ 	if not isinstance(string,str):
Index: /issm/oecreview/Archive/12678-13393/ISSM-12828-12829.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12828-12829.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12828-12829.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.m	(revision 12828)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.m	(revision 12829)
+@@ -38,6 +38,7 @@
+ 			md = checkfield(md,'transient.isdiagnostic','numel',1,'values',[0 1]);
+ 			md = checkfield(md,'transient.isthermal','numel',1,'values',[0 1]);
+ 			md = checkfield(md,'transient.isgroundingline','numel',1,'values',[0 1]);
++			md = checkfield(md,'transient.requested_outputs','size',[NaN 1]);
+ 
+ 		end % }}}
+ 		function disp(obj) % {{{
Index: /issm/oecreview/Archive/12678-13393/ISSM-12829-12830.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12829-12830.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12829-12830.diff	(revision 13394)
@@ -0,0 +1,25 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 12829)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 12830)
+@@ -6,7 +6,6 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
+-#include "../../objects/objects.h"
+ #include "../modules.h"
+ 
+ using namespace bamg;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h	(revision 12829)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h	(revision 12830)
+@@ -5,7 +5,7 @@
+ #ifndef _INTERPFROMMESHTOMESH2DX_H
+ #define _INTERPFROMMESHTOMESH2DX_H
+ 
+-class Options;
++#include "../../objects/objects.h"
+ 
+ int InterpFromMeshToMesh2dx(double** pdata_interp,int* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
+ 			double* data,int M_data,int N_data,double* x_interp,double* y_interp,int N_interp,Options* options);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12830-12831.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12830-12831.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12830-12831.diff	(revision 13394)
@@ -0,0 +1,33 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 12830)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 12831)
+@@ -48,20 +48,20 @@
+ BODY_FONTC=`echo $BODY_FONT | sed -e "s/style=\"/style=\"text-align:center; /g"`
+ BODY_FONTL=`echo $BODY_FONT | sed -e "s/style=\"/style=\"text-align:left; /g"`
+ 
+-#create some variables
+-if [ $(ls -1 $ISSM_DIR/bin | wc -l) -le 20 ];
+-then
++#Did installation work?
++if [ $(ls -1 $ISSM_DIR/bin | wc -l) -le 20 ]; then
+ 	IS_INSTALL=0
+ else
+ 	IS_INSTALL=1
+ fi
+ 
++#display table ONLY if installation worked and there has been at leat one FAILURE or ERROR
+ IS_TABLE=0
+-if [ $NUM_TOT -gt 1 ];
+-then
+-	if [ $NUM_SUC -ne $NUM_TOT  ];
+-	then
+-		IS_TABLE=1
++if [ $IS_INSTALL -eq 1 ]; then
++	if [ $NUM_TOT -gt 1 ]; then
++		if [ $NUM_SUC -ne $NUM_TOT  ]; then
++			IS_TABLE=1
++		fi
+ 	fi
+ fi
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12831-12832.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12831-12832.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12831-12832.diff	(revision 13394)
@@ -0,0 +1,6365 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patches/pyport.h.patch
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patches/pyport.h.patch	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/patches/pyport.h.patch	(revision 12832)
+@@ -1,42 +1,22 @@
+-Index: Include/pyport.h
+-===================================================================
+---- Include/pyport.h (revision 933)
+-+++ Include/pyport.h (working copy)
+-@@ -514,22 +514,40 @@
+-#if __FreeBSD_version > 500039
+-#include <ctype.h>
+-#include <wctype.h>
+-+/* If the source file #includes <cctype> before "Python.h" then
+-+ * these macros will not be defined at this point and we
+-+ * should not define them either.
+-+ */
+-+#ifdef isalnum
+-#undef isalnum
+-#define isalnum(c) iswalnum(btowc(c))
+-+#endif
+-+#ifdef isalpha
+-#undef isalpha
+-#define isalpha(c) iswalpha(btowc(c))
+-+#endif
+-+#ifdef islower
+-#undef islower
+-#define islower(c) iswlower(btowc(c))
+-+#endif
+-+#ifdef isspace
+-#undef isspace
+-#define isspace(c) iswspace(btowc(c))
+-+#endif
+-+#ifdef isupper
+-#undef isupper
+-#define isupper(c) iswupper(btowc(c))
+-+#endif
+-+#ifdef tolower
+-#undef tolower
+-#define tolower(c) towlower(btowc(c))
+-+#endif
+-+#ifdef toupper
+-#undef toupper
+-#define toupper(c) towupper(btowc(c))
+-#endif
+-#endif
+-+#endif
++680a681
++> #ifdef isalnum
++682a684,685
++> #endif
++> #ifdef isalpha
++684a688,689
++> #endif
++> #ifdef islower
++686a692,693
++> #endif
++> #ifdef isspace
++688a696,697
++> #endif
++> #ifdef isupper
++690a700,701
++> #endif
++> #ifdef tolower
++692a704,705
++> #endif
++> #ifdef toupper
++695a709
++> #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 12832)
+@@ -21,8 +21,6 @@
+ ./configure \
+  --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
+ 
+-#obsolete? 
+-#./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-framework="$ISSM_DIR/externalpackages/python/install"
+ 
+ #make
+ if [ -z $1 ]; then
+@@ -36,6 +34,16 @@
+ ln -s Library/Frameworks/Python.framework/Headers include
+ ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
+ 
+-#Patch pyport.h:
+-cd include
+-patch pyport.h $ISSM_DIR/externalpackages/python/patches/pyport.h.patch
++#Some modifications to be done in case version is 2.7
++if [[ $version == "2.7.2" ]]; then 
++	cd ../install
++	#get rid of bin, because it's just a copy of Library/Frameworks/Python.framework/Versions/2.7/bin, and will not reflect new changes being made
++	rm -rf bin
++	ln -s Library/Frameworks/Python.framework/Headers include
++	ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
++	ln -s Library/Frameworks/Python.framework/Versions/2.7/bin bin
++
++	#Patch pyport.h:
++	cd include
++	patch pyport.h $ISSM_DIR/externalpackages/python/patches/pyport.h.patch
++fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython/install.sh	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython/install.sh	(revision 12832)
+@@ -2,9 +2,8 @@
+ 
+ #Some cleanup
+ rm -rf src
+-rm -rf install
+ rm -rf ipython-0.12
+-mkdir src install
++mkdir src 
+ 
+ #Download from ISSM server
+ $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/ipython-0.12.tar.gz' 'ipython-0.12.tar.gz'
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp	(revision 12832)
+@@ -17,7 +17,7 @@
+ #include <iostream>
+ 
+ #include "./DataSet.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _CONTAINER_DATASET_H_
+ 
+ #include <vector>
+-#include "../objects/Object.h"
++#include "../classes/objects/Object.h"
+ #include "../toolkits/toolkits.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 12832)
+@@ -9,7 +9,7 @@
+ #endif
+ 
+ #include <stdio.h>
+-#include "./objects.h"
++#include "./classes.h"
+ #include <string.h>
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../shared/shared.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Patch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Patch.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Patch.cpp	(revision 12832)
+@@ -12,7 +12,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <math.h>
+-#include "./objects.h"
++#include "./classes.h"
+ #include "../Container/Container.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp	(revision 12832)
+@@ -11,7 +11,7 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "./objects.h"
++#include "./classes.h"
+ #include "../Container/Container.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../shared/shared.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/gaussobjects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/gaussobjects.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/gaussobjects.h	(revision 12832)
+@@ -0,0 +1,11 @@
++/* \file gaussobjects.h
++ * \brief: prototype header for all gauss related objects
++ */
++
++#ifndef ALL_GAUSS_OBJECTS_H_
++#define ALL_GAUSS_OBJECTS_H_
++
++#include "./GaussTria.h"
++#include "./GaussPenta.h"
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 12832)
+@@ -2,9 +2,7 @@
+  * \brief: implementation of the GaussTria object
+  */
+ 
+-/*Include files: {{{*/
+-#include "./../objects.h"
+-/*}}}*/
++#include "./gaussobjects.h"
+ 
+ /*GaussTria constructors and destructors:*/
+ /*FUNCTION GaussTria::GaussTria() {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 12832)
+@@ -2,9 +2,7 @@
+  * \brief: implementation of the GaussPenta object
+  */
+ 
+-/*Include files: {{{*/
+-#include "./../objects.h"
+-/*}}}*/
++#include "./gaussobjects.h"
+ 
+ /*GaussPenta constructors and destructors:*/
+ /*FUNCTION GaussPenta::GaussPenta() {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/classes.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/classes.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/classes.h	(revision 12832)
+@@ -0,0 +1,36 @@
++/* \file classes.h
++ * \brief: prototype header for all classes used in ISSM.
++ */
++
++#ifndef ALL_CLASSES_H_
++#define ALL_CLASSES_H_
++
++/*Objects derived classes, which are used in our containers: */
++#include "./objects/objects.h"
++
++/*matrix: */
++#include "./matrix/matrixobjects.h"
++
++/*bamg: */
++#include "./bamg/bamgobjects.h"
++
++/*gauss: */
++#include "./gauss/gaussobjects.h"
++
++/*kriging: */
++#include "./kriging/krigingobjects.h"
++
++/*diverse: */
++#include "./Hook.h"
++#include "./DofIndexing.h"
++#include "./IoModel.h"
++#include "./Patch.h"
++#include "./Update.h"
++#include "./FemModel.h"
++#include "./OptArgs.h"
++#include "./OptPars.h"
++
++/*dakota:*/
++#include "./dakota/DakotaPlugin.h"
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.h	(revision 12832)
+@@ -10,7 +10,7 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "./Object.h"
++#include "./objects/Object.h"
+ class DataSet;
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 12832)
+@@ -0,0 +1,132 @@
++/* \file objects.h
++ * \brief: prototype header for all objects.
++ */
++
++#ifndef ALL_OBJECTS_H_
++#define ALL_OBJECTS_H_
++
++/*Abstract classes: */
++#include "./Object.h"
++
++/*Orphans: */
++#include "./Contour.h"
++
++/*Objects: */
++#include "./Vertex.h"
++#include "./Node.h"
++#include "./Segment.h"
++
++/*Constraints: */
++#include "./Constraints/Constraint.h"
++#include "./Constraints/SpcStatic.h"
++#include "./Constraints/SpcTransient.h"
++#include "./Constraints/SpcDynamic.h"
++
++/*Loads: */
++#include "./Loads/Load.h"
++#include "./Loads/Friction.h"
++#include "./Loads/Icefront.h"
++#include "./Loads/Numericalflux.h"
++#include "./Loads/Riftfront.h"
++#include "./Loads/Penpair.h"
++#include "./Loads/Pengrid.h"
++
++/*Elements: */
++#include "./Elements/Element.h"
++#include "./Elements/Penta.h"
++#include "./Elements/PentaHook.h"
++#include "./Elements/PentaRef.h"
++#include "./Elements/Tria.h"
++#include "./Elements/TriaHook.h"
++#include "./Elements/TriaRef.h"
++
++/*KML parsing objects: */
++#include "./KML/KML_Attribute.h"
++#include "./KML/KML_Comment.h"
++#include "./KML/KML_ColorStyle.h"
++#include "./KML/KML_Container.h"
++#include "./KML/KML_Document.h"
++#include "./KML/KML_Feature.h"
++#include "./KML/KML_File.h"
++#include "./KML/KML_Folder.h"
++#include "./KML/KML_Geometry.h"
++#include "./KML/KML_GroundOverlay.h"
++#include "./KML/KML_Icon.h"
++#include "./KML/KML_LatLonBox.h"
++#include "./KML/KML_LinearRing.h"
++#include "./KML/KML_LineString.h"
++#include "./KML/KML_LineStyle.h"
++#include "./KML/KML_MultiGeometry.h"
++#include "./KML/KML_Object.h"
++#include "./KML/KML_Overlay.h"
++#include "./KML/KML_Point.h"
++#include "./KML/KML_Placemark.h"
++#include "./KML/KML_Polygon.h"
++#include "./KML/KML_PolyStyle.h"
++#include "./KML/KML_Style.h"
++#include "./KML/KML_StyleSelector.h"
++#include "./KML/KML_SubStyle.h"
++#include "./KML/KML_Unknown.h"
++#include "./KML/KMLFileReadUtils.h"
++
++/*Option parsing objects: */
++#include "./Options/Option.h"
++#include "./Options/OptionDouble.h"
++#include "./Options/OptionLogical.h"
++#include "./Options/OptionChar.h"
++#include "./Options/OptionStruct.h"
++#include "./Options/OptionCell.h"
++#include "./Options/OptionUtilities.h"
++
++/*Inputs: */
++#include "./Inputs/Input.h"
++#include "./Inputs/BoolInput.h"
++#include "./Inputs/DoubleInput.h"
++#include "./Inputs/IntInput.h"
++#include "./Inputs/PentaP1Input.h"
++#include "./Inputs/TriaP1Input.h"
++#include "./Inputs/ControlInput.h"
++#include "./Inputs/DatasetInput.h"
++#include "./Inputs/TransientInput.h"
++
++/*ElementResults: */
++#include "./ElementResults/ElementResult.h"
++#include "./ElementResults/DoubleElementResult.h"
++#include "./ElementResults/TriaP1ElementResult.h"
++#include "./ElementResults/PentaP1ElementResult.h" 
++#include "./ElementResults/BoolElementResult.h"
++
++/*ExternalResults: */
++#include "./ExternalResults/ExternalResult.h"
++#include "./ExternalResults/BoolExternalResult.h"
++#include "./ExternalResults/DoubleExternalResult.h"
++#include "./ExternalResults/DoubleVecExternalResult.h"
++#include "./ExternalResults/DoubleMatExternalResult.h"
++#include "./ExternalResults/IntExternalResult.h"
++#include "./ExternalResults/PetscVecExternalResult.h"
++#include "./ExternalResults/StringExternalResult.h"
++
++/*Materials: */
++#include "./Materials/Material.h"
++#include "./Materials/Matice.h"
++#include "./Materials/Matpar.h"
++
++/*Params: */
++#include "./Params/BoolParam.h"
++#include "./Params/DoubleMatParam.h"
++#include "./Params/DoubleTransientMatParam.h"
++#include "./Params/DoubleMatArrayParam.h"
++#include "./Params/DoubleParam.h"
++#include "./Params/DoubleVecParam.h"
++#include "./Params/IntParam.h"
++#include "./Params/IntVecParam.h"
++#include "./Params/IntMatParam.h"
++#include "./Params/FileParam.h"
++#include "./Params/Param.h"
++#include "./Params/MatrixParam.h"
++#include "./Params/VectorParam.h"
++#include "./Params/StringArrayParam.h"
++#include "./Params/StringParam.h"
++#include "./Params/TransientParam.h"
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.h	(revision 12832)
+@@ -8,9 +8,9 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "./Object.h"
+-#include "../shared/Exceptions/exceptions.h"
+-#include "../toolkits/toolkits.h"
+-#include "../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../toolkits/toolkits.h"
++#include "../../include/include.h"
+ /*}}}*/
+ 
+ class Contour: public Object{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 12832)
+@@ -10,10 +10,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
+ 		
+ /*Matice constructors and destructor*/
+ /*FUNCTION Matice::Matice(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h	(revision 12832)
+@@ -10,7 +10,7 @@
+ /*{{{*/
+ class Object;
+ #include "../Object.h"
+-#include "../../toolkits/toolkits.h"
++#include "../../../toolkits/toolkits.h"
+ /*}}}*/
+ 
+ class Material: public Object,public Update{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp	(revision 12832)
+@@ -10,10 +10,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../classes.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 		
+ /*Matpar constructors and destructor*/
+ /*FUNCTION Matpar::Matpar() {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 12832)
+@@ -9,7 +9,7 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "./Input.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
+ class GaussTria;
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 12832)
+@@ -10,11 +10,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*ControlInput constructors and destructor*/
+ /*FUNCTION ControlInput::ControlInput(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 12832)
+@@ -9,7 +9,7 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "./Input.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
+ class GaussTria;
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp	(revision 12832)
+@@ -10,11 +10,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*DatasetInput constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 12832)
+@@ -9,7 +9,7 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "./Input.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
+ class GaussTria;
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 12832)
+@@ -10,11 +10,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*IntInput constructors and destructor*/
+ /*FUNCTION IntInput::IntInput(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 12832)
+@@ -10,11 +10,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*BoolInput constructors and destructor*/
+ /*FUNCTION BoolInput::BoolInput(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 12832)
+@@ -9,7 +9,7 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "./Input.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
+ class GaussTria;
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 12832)
+@@ -9,7 +9,7 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "./Input.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
+ class GaussTria;
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 12832)
+@@ -10,11 +10,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*TriaP1Input constructors and destructor*/
+ /*FUNCTION TriaP1Input::TriaP1Input(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 12832)
+@@ -10,11 +10,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*TransientInput constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 12832)
+@@ -10,11 +10,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*PentaP1Input constructors and destructor*/
+ /*FUNCTION PentaP1Input::PentaP1Input(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 12832)
+@@ -10,11 +10,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*DoubleInput constructors and destructor*/
+ /*FUNCTION DoubleInput::DoubleInput(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h	(revision 12832)
+@@ -13,9 +13,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Object.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h	(revision 12832)
+@@ -9,9 +9,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Geometry.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h	(revision 12832)
+@@ -9,9 +9,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Geometry.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h	(revision 12832)
+@@ -12,9 +12,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Object.h"
+ class KML_Style;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _KMLFILEREADUTILS_H
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "../Object.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Object.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Object.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _KML_ATTRIBUTE_H_
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "../Object.h"
+ class DataSet;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_ColorStyle.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _KML_OBJECT_H_
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "../Object.h"
+ class DataSet;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Object.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h	(revision 12832)
+@@ -9,9 +9,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Geometry.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h	(revision 12832)
+@@ -9,9 +9,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Feature.h"
+ class KML_Icon;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Feature.h"
+ class DataSet;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h	(revision 12832)
+@@ -9,9 +9,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Geometry.h"
+ class KML_LinearRing;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Object.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h	(revision 12832)
+@@ -10,9 +10,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_SubStyle.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Feature.h"
+ class KML_Geometry;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Object.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.h	(revision 12832)
+@@ -9,9 +9,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Overlay.h"
+ class KML_LatLonBox;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_StyleSelector.h"
+ class KML_LineStyle;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _KML_COMMENT_H_
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "../Object.h"
+ class DataSet;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Geometry.h"
+ class KML_Geometry;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_ColorStyle.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Container.h"
+ class KML_Feature;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Container.h"
+ class KML_Feature;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.h	(revision 12832)
+@@ -7,9 +7,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./KML_Feature.h"
+ class DataSet;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class DoubleVecParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class DoubleParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*FileParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class DoubleMatArrayParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class DoubleMatParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class FileParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*IntVecParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*IntParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*BoolParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*IntMatParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class IntVecParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class IntParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class BoolParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class IntMatParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*VectorParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*FUNCTION DoubleTransientMatParam::DoubleTransientMatParam(int enum_type,IssmDoubleMat value){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*MatrixParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*StringArrayParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*StringParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*TransientParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class VectorParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*DoubleVecParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class DoubleTransientMatParam: public DoubleMatParam{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class MatrixParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp	(revision 12832)
+@@ -11,10 +11,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*DoubleParam constructors and destructor*/
+ /*FUNCTION DoubleParam::DoubleParam(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class StringArrayParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*DoubleMatArrayParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class StringParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*DoubleMatParam constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ #endif
+ 
+ #include "./Param.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class TransientParam: public Param{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.cpp	(revision 12832)
+@@ -12,10 +12,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "./objects.h"
+-#include "../Container/Container.h"
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-#include "../shared/shared.h"
+-#include "../include/include.h"
++#include "../../Container/Container.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
+ /*}}}*/
+ 
+ /*Segment constructors and destructors:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _OPTIONSTRUCT_H_
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./Option.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp	(revision 12832)
+@@ -13,9 +13,9 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*FUNCTION ColumnWiseDimsFromIndex{{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../io/io.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../io/io.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _OPTIONDOUBLE_H_
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./Option.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _OPTIONLOGICAL_H_
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./Option.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _OPTIONUTILITIES_H_
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./Option.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _OPTIONCHAR_H_
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./Option.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _OPTIONOBJECT_H_
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "../Object.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h	(revision 12832)
+@@ -6,9 +6,9 @@
+ #define _OPTIONCELL_H_
+ 
+ /*Headers:{{{*/
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ 
+ #include "./Option.h"
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.cpp	(revision 12832)
+@@ -10,10 +10,10 @@
+ #endif
+ 
+ #include <string.h>
+-#include "./objects.h"
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-#include "../shared/shared.h"
+-#include "../include/include.h"
++#include "../classes.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
+ /*}}}*/
+ 
+ /*Vertex constructors and destructor:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp	(revision 12832)
+@@ -12,10 +12,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../objects.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../classes.h"
+ /*}}}*/	
+ 
+ /*Load macros*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp	(revision 12832)
+@@ -12,10 +12,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ /*Element macros*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Load.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Load.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Load.h	(revision 12832)
+@@ -15,8 +15,8 @@
+ class Vector;
+ 
+ #include "../Object.h"
+-#include "../../toolkits/toolkits.h"
+-#include "../../Container/Container.h"
++#include "../../../toolkits/toolkits.h"
++#include "../../../Container/Container.h"
+ /*}}}*/
+ 
+ class Load: public Object,public Update{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp	(revision 12832)
+@@ -12,11 +12,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
+ /*}}}*/
+ 	
+ /*Element macros*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp	(revision 12832)
+@@ -12,10 +12,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
+ /*}}}*/	
+ 
+ /*Load macros*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.cpp	(revision 12832)
+@@ -12,11 +12,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../Container/Container.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../Container/Container.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
+ /*}}}*/	
+ 
+ /*Constructors/destructors*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp	(revision 12832)
+@@ -12,11 +12,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../modules/ModelProcessorx/ModelProcessorx.h"
+-#include "../objects.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../modules/ModelProcessorx/ModelProcessorx.h"
++#include "../../classes.h"
+ /*}}}*/
+ 
+ /*Element macros*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.h	(revision 12832)
+@@ -7,13 +7,13 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "./Object.h"
++#include "../classes.h"
+ class IoModel;
+ class Vector;
+ class Parameters;
+-#include "../shared/Exceptions/exceptions.h"
+-#include "../toolkits/toolkits.h"
+-#include "../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../toolkits/toolkits.h"
++#include "../../include/include.h"
+ 
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*DoubleMatExternalResult constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*PetscVecExternalResult constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h	(revision 12832)
+@@ -15,10 +15,10 @@
+ #endif
+ 
+ #include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ class DoubleVecExternalResult: public ExternalResult{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h	(revision 12832)
+@@ -17,10 +17,10 @@
+ 
+ 
+ #include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ class DoubleExternalResult: public ExternalResult{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h	(revision 12832)
+@@ -16,8 +16,8 @@
+ #endif
+ 
+ #include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
+ /*}}}*/
+ 
+ class IntExternalResult: public ExternalResult{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h	(revision 12832)
+@@ -16,10 +16,10 @@
+ #endif
+ 
+ #include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ class BoolExternalResult: public ExternalResult{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h	(revision 12832)
+@@ -15,10 +15,10 @@
+ #endif
+ 
+ #include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ class DoubleMatExternalResult: public ExternalResult{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h	(revision 12832)
+@@ -16,10 +16,10 @@
+ #endif
+ 
+ #include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ class PetscVecExternalResult: public ExternalResult{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*StringExternalResult constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*DoubleVecExternalResult constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*DoubleExternalResult constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*IntExternalResult constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp	(revision 12832)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*BoolExternalResult constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h	(revision 12832)
+@@ -16,10 +16,10 @@
+ #endif
+ 
+ #include "./ExternalResult.h"
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ class StringExternalResult: public ExternalResult{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 12832)
+@@ -12,11 +12,11 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "./objects.h"
+-#include "../Container/Container.h"
+-#include "../EnumDefinitions/EnumDefinitions.h"
+-#include "../shared/shared.h"
+-#include "../include/include.h"
+-#include "../modules/modules.h"
++#include "../../Container/Container.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../modules/modules.h"
+ /*}}}*/
+ 
+ /*Node constructors and destructors:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/Constraint.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/Constraint.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/Constraint.h	(revision 12832)
+@@ -12,7 +12,7 @@
+ /*{{{*/
+ class Nodes;
+ #include "../Object.h"
+-#include "../../toolkits/toolkits.h"
++#include "../../../toolkits/toolkits.h"
+ /*}}}*/
+ 
+ class Constraint: public Object{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.cpp	(revision 12832)
+@@ -10,10 +10,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../Container/Container.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../Container/Container.h"
+ #include "../objects.h"
+ 
+ /*SpcDynamic constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.cpp	(revision 12832)
+@@ -10,10 +10,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../Container/Container.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../Container/Container.h"
+ #include "../objects.h"
+ 
+ /*SpcStatic constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp	(revision 12832)
+@@ -10,10 +10,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../../include/include.h"
+-#include "../../shared/shared.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../Container/Container.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../Container/Container.h"
+ #include "../objects.h"
+ 
+ /*SpcTransient constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.cpp	(revision 12832)
+@@ -10,8 +10,8 @@
+ 
+ #include <string.h>
+ #include "./objects.h"
+-#include "../include/include.h"
+-#include "../io/io.h"
++#include "../../include/include.h"
++#include "../../io/io.h"
+ 
+ /*Contour constructors and destructors:*/
+ /*FUNCTION Contour::Contour() default constructor {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h	(revision 12832)
+@@ -8,16 +8,16 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "./Object.h"
+-#include "../shared/shared.h"
++#include "../../shared/shared.h"
++#include "../DofIndexing.h"
+ class  Inputs;
+ class  Hook;
+-class  DofIndexing;
+ class  IoModel;
+ class  DataSet;
+ class  Vertices;
+ class  Vector;
+ class  Matrix;
+-#include "./Update.h"
++#include "../Update.h"
+ /*}}}*/
+ 
+ class Node: public Object ,public Update{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h	(revision 12832)
+@@ -9,7 +9,7 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "../Inputs/Input.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ class TriaP1ElementResult: public ElementResult{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp	(revision 12832)
+@@ -11,11 +11,11 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "./ElementResultLocal.h"
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*PentaP1ElementResult constructors and destructor*/
+ /*FUNCTION PentaP1ElementResult::PentaP1ElementResult(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp	(revision 12832)
+@@ -11,11 +11,11 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "./ElementResultLocal.h"
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*DoubleElementResult constructors and destructor*/
+ /*FUNCTION DoubleElementResult::DoubleElementResult(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp	(revision 12832)
+@@ -11,11 +11,11 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "./ElementResultLocal.h"
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*BoolElementResult constructors and destructor*/
+ /*FUNCTION BoolElementResult::BoolElementResult(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h	(revision 12832)
+@@ -10,7 +10,7 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "../Inputs/Input.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ class PentaP1ElementResult: public ElementResult{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h	(revision 12832)
+@@ -10,7 +10,7 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "../Inputs/Input.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
+ class Parameters;
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h	(revision 12832)
+@@ -10,7 +10,7 @@
+ /*Headers:*/
+ /*{{{*/
+ #include "../Inputs/Input.h"
+-#include "../../include/include.h"
++#include "../../../include/include.h"
+ class Parameters;
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp	(revision 12832)
+@@ -11,11 +11,11 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "./ElementResultLocal.h"
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ 
+ /*TriaP1ElementResult constructors and destructor*/
+ /*FUNCTION TriaP1ElementResult::TriaP1ElementResult(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 12832)
+@@ -18,7 +18,7 @@
+ class Matrix;
+ class Vector;
+ 
+-#include "../../toolkits/toolkits.h"
++#include "../../../toolkits/toolkits.h"
+ /*}}}*/
+ 
+ class Element: public Object,public Update{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12832)
+@@ -12,10 +12,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Element macros*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp	(revision 12832)
+@@ -12,11 +12,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp	(revision 12832)
+@@ -12,11 +12,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Element macros*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 12832)
+@@ -19,9 +19,9 @@
+ class ElementMatrix;
+ class ElementVector;
+ 
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ /*}}}*/
+ 
+ class Tria: public Element,public TriaHook,public TriaRef{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12832)
+@@ -12,10 +12,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../Container/Container.h"
++#include "../../classes.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../../../Container/Container.h"
+ /*}}}*/
+ 
+ /*Element macros*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp	(revision 12832)
+@@ -12,11 +12,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 12832)
+@@ -21,9 +21,9 @@
+ class ElementMatrix;
+ class ElementVector;
+ 
+-#include "../../include/include.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
+ /*}}}*/
+ 
+ class Penta: public Element,public PentaHook,public PentaRef{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp	(revision 12832)
+@@ -12,11 +12,11 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Element macros*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _OBSERVATION_H_
+ #define _OBSERVATION_H_
+ 
+-#include "../Object.h"
++#include "../objects/Object.h"
+ 
+ class Observation: public Object{
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h	(revision 12832)
+@@ -7,6 +7,7 @@
+ 
+ /*Headers:*/
+ #include "./Variogram.h"
++class Options;
+ 
+ class GaussianVariogram: public Variogram{
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/krigingobjects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/krigingobjects.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/krigingobjects.h	(revision 12832)
+@@ -0,0 +1,17 @@
++/* \file krigingobjects.h
++ * \brief: prototype header for all kriging objects.
++ */
++
++#ifndef KRIGING_OBJECTS_H_
++#define KRIGING_OBJECTS_H_
++
++/*Kriging*/
++#include "./Variogram.h"
++#include "./GaussianVariogram.h"
++#include "./ExponentialVariogram.h"
++#include "./SphericalVariogram.h"
++#include "./PowerVariogram.h"
++#include "./Quadtree.h"
++#include "./Observation.h"
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Variogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Variogram.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Variogram.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _VARIOGRAM_H_
+ #define _VARIOGRAM_H_
+ 
+-#include "../Object.h"
++#include "../objects/Object.h"
+ 
+ class Variogram: public Object{
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.h	(revision 12832)
+@@ -12,8 +12,8 @@
+ 
+ 
+ #include "DirectApplicInterface.H"
+-#include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../../toolkits/toolkits.h"
++#include "../../objects/objects.h"
+ 
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 12832)
+@@ -12,7 +12,7 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
++#include "../classes.h"
+ #include "../../shared/shared.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 12832)
+@@ -10,10 +10,11 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../Object.h"
++#include "../objects/Object.h"
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ class Node;
++class Vector;
+ /*}}}*/
+ 
+ class ElementVector{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 12832)
+@@ -12,7 +12,7 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
++#include "../classes.h"
+ #include "../../shared/shared.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 12832)
+@@ -10,10 +10,11 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "../Object.h"
++#include "../objects/Object.h"
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ class Node;
++class Matrix;
+ /*}}}*/
+ 
+ class ElementMatrix{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/matrixobjects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/matrixobjects.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/matrixobjects.h	(revision 12832)
+@@ -0,0 +1,16 @@
++/* \file matrixobjects.h
++ * \brief: prototype header for all matrix objects.
++ */
++
++#ifndef ALL_MATRIX_OBJECTS_H_
++#define ALL_MATRIX_OBJECTS_H_
++
++
++/*Numerics:*/
++#include "./ElementMatrix.h"
++#include "./ElementVector.h"
++#include "./Vector.h"
++#include "./Matrix.h"
++
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12832)
+@@ -12,7 +12,7 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
++#include "../classes.h"
+ #include "../../shared/shared.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 12832)
+@@ -12,7 +12,7 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include "../objects.h"
++#include "../classes.h"
+ #include "../../shared/shared.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h	(revision 12832)
+@@ -3,6 +3,7 @@
+ #define _BAMGQUADTREE_H
+ 
+ #include "./include.h"
++class DataSet;
+ 
+ namespace bamg {
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/bamgobjects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/bamgobjects.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/bamgobjects.h	(revision 12832)
+@@ -0,0 +1,34 @@
++/* \file bamgobjects.h
++ * \brief: prototype header for all bamg related objects.
++ */
++
++#ifndef BAMG_OBJECTS_H_
++#define BAMG_OBJECTS_H_
++
++/*Bamg: */
++#include "./BamgOpts.h"
++#include "./BamgGeom.h"
++#include "./BamgMesh.h"
++#include "./Metric.h"
++#include "./DoubleAndInt.h"
++#include "./Direction.h"
++#include "./BamgVertex.h"
++#include "./AdjacentTriangle.h"
++#include "./Edge.h"
++#include "./GeomVertex.h"
++#include "./GeomEdge.h"
++#include "./Curve.h"
++#include "./Triangle.h"
++#include "./ListofIntersectionTriangles.h"
++#include "./GeomSubDomain.h"
++#include "./SubDomain.h"
++#include "./VertexOnGeom.h"
++#include "./VertexOnVertex.h"
++#include "./VertexOnEdge.h"
++#include "./CrackedEdge.h"
++#include "./Mesh.h"
++#include "./Geometry.h"
++#include "./BamgQuadtree.h"
++#include "./SetOfE4.h"
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 12832)
+@@ -14,7 +14,7 @@
+ #include <stdlib.h>
+ #include <stdarg.h>
+ 
+-#include "./objects.h"
++#include "./classes.h"
+ #include "../io/io.h"
+ #include "./Container/Parameters.h"
+ #include "../shared/shared.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp	(revision 12832)
+@@ -13,7 +13,7 @@
+ #include "../Container/Container.h"
+ #include "../modules/ModelProcessorx/ModelProcessorx.h"
+ #include "../io/io.h"
+-#include "./objects.h"
++#include "./classes.h"
+ #include "../include/include.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../modules/modules.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.h	(revision 12832)
+@@ -7,11 +7,17 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-#include "./Object.h"
++#include "./objects/Object.h"
+ #include "../toolkits/toolkits.h"
+ class DataSet;
+ class Parameters;
+ class NodeSets;
++class Nodes;
++class Vertices;
++class Results;
++class Constraints;
++class Loads;
++class Materials;
+ /*}}}*/
+ 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_nonlinear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_nonlinear.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_nonlinear.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../modules/modules.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solvers.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solvers.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solvers.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef SOLVERS_H_
+ #define SOLVERS_H_
+ 
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../io/io.h"
+ 
+ struct OptArgs;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_linear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_linear.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_linear.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../modules/modules.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_newton.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_newton.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_newton.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../modules/modules.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_stokescoupling_nonlinear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_stokescoupling_nonlinear.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_stokescoupling_nonlinear.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../io/io.h"
+ #include "../modules/modules.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_thermal_nonlinear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_thermal_nonlinear.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_thermal_nonlinear.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../modules/modules.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_adjoint_linear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_adjoint_linear.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_adjoint_linear.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../modules/modules.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 12832)
+@@ -2,7 +2,7 @@
+  * \brief: figure out if convergence has been reached
+  */ 
+ 
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../modules/modules.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 12832)
+@@ -9,7 +9,7 @@
+ #endif
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "./solutions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controlconvergence.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controlconvergence.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controlconvergence.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp	(revision 12832)
+@@ -10,7 +10,7 @@
+ 
+ #include "../include/include.h"
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/surfaceslope_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/surfaceslope_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/surfaceslope_core.cpp	(revision 12832)
+@@ -4,7 +4,7 @@
+ 
+ #include "./solutions.h"
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../solvers/solvers.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/thermal_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/thermal_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/thermal_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/solutions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/solutions.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/solutions.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef SOLUTIONS_H_
+ #define SOLUTIONS_H_
+ 
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../io/io.h"
+ 
+ struct OptArgs;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/adjointdiagnostic_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/adjointdiagnostic_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/adjointdiagnostic_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/bedslope_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/bedslope_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/bedslope_core.cpp	(revision 12832)
+@@ -4,7 +4,7 @@
+ 
+ #include "./solutions.h"
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../modules/modules.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 12832)
+@@ -9,7 +9,7 @@
+ #endif
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "./solutions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystateconvergence.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystateconvergence.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystateconvergence.cpp	(revision 12832)
+@@ -8,7 +8,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../Container/Container.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/balancethickness_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/balancethickness_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/balancethickness_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 12832)
+@@ -9,7 +9,7 @@
+ #endif
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "./solutions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12832)
+@@ -9,7 +9,7 @@
+ #endif
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ResetBoundaryConditions.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ResetBoundaryConditions.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ResetBoundaryConditions.cpp	(revision 12832)
+@@ -2,7 +2,7 @@
+  * \brief: change boundary conditions of a model, using a solution vector from another analysis
+  */ 
+ 
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../modules/modules.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 12832)
+@@ -10,7 +10,7 @@
+ #endif
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../solvers/solvers.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/adjointbalancethickness_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/adjointbalancethickness_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/adjointbalancethickness_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/hydrology_core_step.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/hydrology_core_step.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/hydrology_core_step.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/control_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/control_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/control_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/hydrology_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/hydrology_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/hydrology_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/diagnostic_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/diagnostic_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/diagnostic_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ #include <config.h>
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/enthalpy_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/enthalpy_core.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/enthalpy_core.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #include "../toolkits/toolkits.h"
+-#include "../objects/objects.h"
++#include "../classes/objects/objects.h"
+ #include "../shared/shared.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "./solutions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Wrapper/wrappershared.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Wrapper/wrappershared.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Wrapper/wrappershared.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _WRAPPER_SHARED_H_
+ #define _WRAPPER_SHARED_H_
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ int ModuleBoot(void);
+ int ModuleEnd(void);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 12832)
+@@ -9,7 +9,7 @@
+ #endif
+ 
+ #include "./numerics.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../include/include.h"
+ #include "../../io/io.h"
+ #include "../../shared/shared.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp	(revision 12832)
+@@ -8,7 +8,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Parameters.h"
+ #include "../../toolkits/toolkits.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp	(revision 12832)
+@@ -10,7 +10,7 @@
+ 
+ #include <cstring>
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Parameters.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 12832)
+@@ -10,7 +10,7 @@
+ #endif
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ #include "../../shared/shared.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp	(revision 12832)
+@@ -11,7 +11,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ void IsInputConverged(IssmDouble* peps, Input** new_inputs,Input** old_inputs,int num_inputs,int criterion_enum){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 12832)
+@@ -9,7 +9,7 @@
+ #endif
+ 
+ #include "./numerics.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../io/io.h"
+ #include "../../include/include.h"
+ #include "../../shared/shared.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Bamg/OppositeAngle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Bamg/OppositeAngle.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Bamg/OppositeAngle.h	(revision 12832)
+@@ -1,7 +1,7 @@
+ #ifndef _OPPOSITEANGLE_H_
+ #define _OPPOSITEANGLE_H_
+ 
+-#include "../../objects/Bamg/include.h"
++#include "../../classes/bamg/include.h"
+ 
+ /*Return the opposite angle modulo 2 Pi*/
+ namespace bamg {
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Bamg/det.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Bamg/det.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Bamg/det.h	(revision 12832)
+@@ -1,7 +1,7 @@
+ #ifndef _BAMGDET_H_
+ #define _BAMGDET_H_
+ 
+-#include "../../objects/Bamg/include.h"
++#include "../../classes/bamg/include.h"
+ 
+ namespace bamg {
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp	(revision 12832)
+@@ -14,7 +14,7 @@
+ #include  "./alloc_module.h"
+ #include "../Exceptions/exceptions.h"
+ #include "../../include/include.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ void xdelete_module(Matrix** pv){
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 12832)
+@@ -24,7 +24,7 @@
+ #include  "./alloc.h"
+ #include "../Exceptions/exceptions.h"
+ #include "../../include/include.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ void* xmalloc(int size){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _SHARED_ELEMENTS_H_
+ #define  _SHARED_ELEMENTS_H_
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ class ElementMatrix;
+ class ElementVector;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #ifndef _EXP_H_
+ #define _EXP_H_
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../toolkits/toolkits.h"
+ 
+ int IsInPoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/diskio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/diskio.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/diskio.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _DISK_IO_H_
+ #define _DISK_IO_H_
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../modules.h"
+ 
+ int InterpFromMesh2dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _INTERPFROMMESH2DX_H
+ #define _INTERPFROMMESH2DX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../toolkits/toolkits.h"
+ 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h	(revision 12832)
+@@ -4,7 +4,7 @@
+ #ifndef _CONTROLINPUTSSETGRADIENTX_H
+ #define _CONTROLINPUTSSETGRADIENTX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ void	ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* gradient);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _RESPONSESX_H
+ #define _RESPONSESX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ void Responsex(IssmDouble* presponse,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,const char* response_descriptor,bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _THICKNESSABSGRADIENT_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void ThicknessAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _UPDATEINPUTSFROMMATRIXDAKOTAXX_H
+ #define _UPDATEINPUTSFROMMATRIXDAKOTAXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVzx/MinVzx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVzx/MinVzx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVzx/MinVzx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MINVZX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MinVzx( double* pminvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVxx/MaxVxx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVxx/MaxVxx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVxx/MaxVxx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #define _MAXVXX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MaxVxx( double* pmaxvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _AVERAGEONTOPARTITIONXX_H
+ #define _AVERAGEONTOPARTITIONXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ void AverageOntoPartitionx(double** average, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* vertex_response);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TimeAdaptx/TimeAdaptx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TimeAdaptx/TimeAdaptx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TimeAdaptx/TimeAdaptx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #define _TIMEADAPTX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void TimeAdaptx(IssmDouble* pdt, Elements* elements, Nodes* nodes,Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 12832)
+@@ -6,6 +6,7 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
++#include "../../classes/objects/objects.h"
+ #include "../modules.h"
+ 
+ using namespace bamg;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _UPDATEINPUTSFROMVECTORXX_H
+ #define _UPDATEINPUTSFROMVECTORXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #ifndef _REDUCEVECTORGTOFX_H
+ #define _REDUCEVECTORGTOFX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void Reducevectorgtofx(Vector** puf, Vector* ug, Nodes* nodes,Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SmearFunctionx/SmearFunctionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SmearFunctionx/SmearFunctionx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SmearFunctionx/SmearFunctionx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _SYSTEMMATRICESX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void SystemMatricesx(Mat* pKff, Mat* pKfs, Vec* ppf, Vec* pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SmbGradientsx/SmbGradientsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SmbGradientsx/SmbGradientsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SmbGradientsx/SmbGradientsx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _SMBGRADIENTSX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void SmbGradientsx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgConvertMeshx/BamgConvertMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgConvertMeshx/BamgConvertMeshx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgConvertMeshx/BamgConvertMeshx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _BAMGCONVERTMESHX_H
+ #define _BAMGCONVERTMESHX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ int BamgConvertMeshx(BamgMesh* bamgmesh,BamgGeom* bamggeom,int* index,double* x,double* y,int nods,int nels);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgConvertMeshx/BamgConvertMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgConvertMeshx/BamgConvertMeshx.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgConvertMeshx/BamgConvertMeshx.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
+-#include "../../objects/objects.h"
++#include "../../classes/bamg/bamgobjects.h"
+ 
+ using namespace bamg;
+ using namespace std;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IceVolumex/IceVolumex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IceVolumex/IceVolumex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IceVolumex/IceVolumex.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _ICEVOLUMEX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void IceVolumex(double* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MAXABSVXX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MaxAbsVxx( double* pmaxabsvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	(revision 12832)
+@@ -4,7 +4,7 @@
+ #ifndef _GETVECTORFROMCONTROLINPUTSXX_H
+ #define _GETVECTORFROMCONTROLINPUTSXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVelx/MinVelx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVelx/MinVelx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVelx/MinVelx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MINVELX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MinVelx( double* pminvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVelx/MaxVelx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVelx/MaxVelx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVelx/MaxVelx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MAXVELX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MaxVelx( double* pmaxvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp	(revision 12832)
+@@ -25,7 +25,7 @@
+ #endif
+ 
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../io/io.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ #include "../../io/io.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/Dakotax.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/Dakotax.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/Dakotax.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _DAKOTAX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/classes.h"
+ 
+ /* local prototypes: */
+ int  SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* femmodel,int counter);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCore.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCore.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCore.cpp	(revision 12832)
+@@ -9,7 +9,7 @@
+ #endif
+ 
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../io/io.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ #include "../../shared/shared.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _GETSOLUTIONFROMINPUTSXX_H
+ #define _GETSOLUTIONFROMINPUTSXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVyx/MaxVyx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVyx/MaxVyx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVyx/MaxVyx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MAXVYX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MaxVyx( double* pmaxvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h	(revision 12832)
+@@ -7,7 +7,7 @@
+ #define _MESHPROFILEINTERSECTIONX_H
+ 
+ #include "../../shared/shared.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MeshProfileIntersectionx( double** psegments, int* pnumseg, int* index, double* x, double* y, int nel, int nods,  Contour** contours,int numcontours);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _SURFACEAVERAGEVELMISFITX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void SurfaceAverageVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _REDUCELOADX_H
+ #define _REDUCELOADX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void	Reduceloadx( Vector* pf, Matrix* Kfs, Vector* ys,bool flag_ys0=false);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _ELEMENTRESPONSEX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void ElementResponsex( double* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int response_enum,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _COMPUTESTRAINRATEX_H
+ #define _COMPUTESTRAINRATEX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateConstraintsx/UpdateConstraintsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateConstraintsx/UpdateConstraintsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateConstraintsx/UpdateConstraintsx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _UPDATECONSTRAINTSX_H
+ #define _UPDATECONSTRAINTSX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ #include "../../toolkits/toolkits.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _RESETCONSTRAINTSX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void  ThermalConstraintsReset(Loads* loads, int configuration_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _INPUTUPDATEFROMDAKOTAXX_H
+ #define _INPUTUPDATEFROMDAKOTAXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ void  InputUpdateFromDakotax(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials*  materials,Parameters* parameters,double* variables,char* *variables_descriptors,int numvariables);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _POSITIVEDEGREEDAYX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void PositiveDegreeDayx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Chacox/Chacox.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Chacox/Chacox.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Chacox/Chacox.h	(revision 12832)
+@@ -32,7 +32,7 @@
+ #endif
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ int Chacox( int nvtxs, int *start, int *adjacency,int *vwgts, float *ewgts, float *x, float *y, float *z, short *assignment, double  options[10], int *nparts, double *goal);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SpcNodesx/SpcNodesx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SpcNodesx/SpcNodesx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SpcNodesx/SpcNodesx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _SPCNODESX_H
+ #define _SPCNODESX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ #include "../../toolkits/toolkits.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAreax/SurfaceAreax.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAreax/SurfaceAreax.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAreax/SurfaceAreax.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _SURFACEAREAX_H
+ #define _SURFACEAREAX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 12832)
+@@ -13,7 +13,7 @@
+ #include "./OutputResultsx.h"
+ #include "../../Container/Container.h"
+ #include "../../io/io.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 		
+ void OutputResultsx(Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results* results){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.h	(revision 12832)
+@@ -7,7 +7,7 @@
+ 
+ #include <float.h>    /*  DBL_MAX  */
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ int Exp2Kmlx(char* filexp,char* filkml,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.h	(revision 12832)
+@@ -7,7 +7,7 @@
+ 
+ #include <float.h>    /*  DBL_MAX  */
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ int Kml2Expx(char* filkml,char* filexp,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Scotchx/Scotchx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Scotchx/Scotchx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Scotchx/Scotchx.h	(revision 12832)
+@@ -19,7 +19,7 @@
+ #include <string.h>
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ #ifdef _HAVE_SCOTCH_ //only works if scotch library has been compiled in.
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _COMPUTEBASALSTRESSX_H
+ #define _COMPUTEBASALSTRESSX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _UPDATEINPUTSFROMSOLUTIONXX_H
+ #define _UPDATEINPUTSFROMSOLUTIONXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h	(revision 12832)
+@@ -7,7 +7,7 @@
+ #define _CONTOURTONODESX_H
+ 
+ #include "../../shared/shared.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLOverlayx/KMLOverlayx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLOverlayx/KMLOverlayx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLOverlayx/KMLOverlayx.h	(revision 12832)
+@@ -7,7 +7,7 @@
+ 
+ #include <float.h>    /*  DBL_MAX  */
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void KMLOverlayx(int* ierror,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #ifndef _REDUCEVECTORGTOSX_H
+ #define _REDUCEVECTORGTOSX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void Reducevectorgtosx(Vector** pys, Vector* yg, Nodes* nodes,Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h	(revision 12832)
+@@ -4,7 +4,7 @@
+ #ifndef _GETVECTORFROMINPUTSXX_H
+ #define _GETVECTORFROMINPUTSXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "./AddExternalResultx.h"
+ #include "../../Container/Container.h"
+ #include "../../io/io.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 		
+ void AddExternalResultx( DataSet* results, int enumtype, double value){
+ 	/* Add new result in into results*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Observations.h"
+ #include "../modules.h"
+ #ifdef _HAVE_GSL_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ #include "../../io/io.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _KRIGINGX_H
+ #define _KRIGINGX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../toolkits/toolkits.h"
+ 
+ class Observations;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MAXABSVYX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MaxAbsVyx( double* pmaxabsvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _NODALVALUEX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void NodalValuex( IssmDouble* pnodalvalue, int natureofdataenum,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _UPDATEINPUTSFROMVECTORDAKOTAXX_H
+ #define _UPDATEINPUTSFROMVECTORDAKOTAXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _THICKNESSABSMISFITX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void ThicknessAbsMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../modules/modules.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../io/io.h"
+ #include "../../../modules/modules.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../ModelProcessorx.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../io/io.h"
+ #include "../../../modules/modules.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateLoadsHydrology.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateLoadsHydrology.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateLoadsHydrology.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateConstraintsHydrology.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateConstraintsHydrology.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateConstraintsHydrology.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+ #include "../../../io/io.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../ModelProcessorx.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../include/include.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 12832)
+@@ -9,7 +9,7 @@
+ #endif
+ 
+ #include <string.h>
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../shared/shared.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ #include "../../io/io.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../io/io.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../include/include.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+ #include "../../../modules/modules.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateLoadsEnthalpy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateLoadsEnthalpy.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateLoadsEnthalpy.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../ModelProcessorx.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../io/io.h"
+ #include "../../../modules/modules.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateLoadsDiagnosticVert.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateLoadsDiagnosticVert.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateLoadsDiagnosticVert.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/UpdateCounters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/UpdateCounters.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/UpdateCounters.cpp	(revision 12832)
+@@ -8,7 +8,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+ #include "../../../io/io.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../ModelProcessorx.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../Container/Container.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../io/io.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../modules/modules.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateLoadsSurfaceSlope.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateLoadsSurfaceSlope.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateLoadsSurfaceSlope.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../io/io.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateConstraintsSurfaceSlope.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateConstraintsSurfaceSlope.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateConstraintsSurfaceSlope.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../io/io.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../ModelProcessorx.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../io/io.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../modules/modules.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../io/io.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../ModelProcessorx.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../include/include.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateLoadsBedSlope.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateLoadsBedSlope.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateLoadsBedSlope.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../io/io.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateConstraintsBedSlope.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateConstraintsBedSlope.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateConstraintsBedSlope.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../io/io.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../ModelProcessorx.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../io/io.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../modules/modules.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateConstraintsMelting.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateConstraintsMelting.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateConstraintsMelting.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../io/io.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../ModelProcessorx.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+ #include "../../../include/include.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../ModelProcessorx.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../modules/modules.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../io/io.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../include/include.h"
+ #include "../ModelProcessorx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp	(revision 12832)
+@@ -3,7 +3,7 @@
+ #include "../../../io/io.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/classes.h"
+ #include "../../../shared/shared.h"
+ #include "../ModelProcessorx.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SortDataSets.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SortDataSets.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/SortDataSets.cpp	(revision 12832)
+@@ -8,7 +8,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 12832)
+@@ -5,7 +5,7 @@
+ #include "../../../Container/Container.h"
+ #include "../../../toolkits/toolkits.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../../io/io.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp	(revision 12832)
+@@ -7,7 +7,7 @@
+ #include "../../../io/io.h"
+ #include "../../../modules/modules.h"
+ #include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../objects/objects.h"
++#include "../../../classes/objects/objects.h"
+ #include "../../../shared/shared.h"
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 12832)
+@@ -12,7 +12,7 @@
+ #include "../../Container/Container.h"
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../shared/shared.h"
+ #include "../MeshPartitionx/MeshPartitionx.h"
+ #include "../../io/io.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 12832)
+@@ -8,7 +8,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../shared/shared.h"
+ #include "../../io/io.h"
+ #include "../../Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../io/io.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../shared/shared.h"
+ #include "../MeshPartitionx/MeshPartitionx.h"
+ #include "../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 12832)
+@@ -9,7 +9,7 @@
+ #endif
+ 
+ #include <string.h>
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../shared/shared.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ #include "../../io/io.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 12832)
+@@ -8,7 +8,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVxx/MinVxx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVxx/MinVxx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVxx/MinVxx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MINVX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MinVxx( double* pminvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodesDofx/NodesDofx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodesDofx/NodesDofx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodesDofx/NodesDofx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _NODESDOFX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void NodesDofx(Nodes* nodes, Parameters* parameters,int analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _SURFACELOGVXVYMISFITX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void SurfaceLogVxVyMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVzx/MaxVzx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVzx/MaxVzx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVzx/MaxVzx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MAXVZX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MaxVzx( double* pmaxvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgTriangulatex/BamgTriangulatex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgTriangulatex/BamgTriangulatex.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgTriangulatex/BamgTriangulatex.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ using namespace bamg;
+ using namespace std;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgTriangulatex/BamgTriangulatex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgTriangulatex/BamgTriangulatex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/BamgTriangulatex/BamgTriangulatex.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _BAMGTRIANGULATEX_H
+ #define _BAMGTRIANGULATEX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ int BamgTriangulatex(int** pindex,int* pnels,double* x,double* y,int nods);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	(revision 12832)
+@@ -4,7 +4,7 @@
+ #ifndef _SETCONTROLINPUTSXFROMVECTOR_H
+ #define _SETCONTROLINPUTSXFROMVECTOR_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStatex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStatex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStatex.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _CONSTRAINTSSTATEX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ int   ThermalIsPresent(Loads* loads,int analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _CONSTRAINTSSTATELOCAL_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /*melting: */
+ void  ThermalConstraintsState(Loads* loads, int* pconverged, int* pnum_unstable_constraints,int analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _INTERPFROMMESHTOMESH3DX_H
+ 
+ #include "../../toolkits/toolkits.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ int InterpFromMeshToMesh3dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 12832)
+@@ -11,7 +11,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void	Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _INTERPFROMGRIDTOMESHX_H
+ #define _INTERPFROMGRIDTOMESHX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _ORTHX_H
+ #define _ORTHX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../include/include.h"
+ #include "../../shared/shared.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _SYSTEMMATRICESX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void SystemMatricesx(Matrix** pKff, Matrix** pKfs, Vector** ppf, Vector** pdf, IssmDouble* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _SURFACELOGVELMISFITX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void SurfaceLogVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VerticesDofx/VerticesDofx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VerticesDofx/VerticesDofx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VerticesDofx/VerticesDofx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _VERTICESDOFX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void VerticesDofx( Vertices* vertices, Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _COSTFUNCTIONX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void CostFunctionx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _SURFACERELVELMISFITX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void SurfaceRelVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLFileReadx/KMLFileReadx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLFileReadx/KMLFileReadx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLFileReadx/KMLFileReadx.h	(revision 12832)
+@@ -7,7 +7,7 @@
+ 
+ #include <float.h>    /*  DBL_MAX  */
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ KML_Object* KMLFileReadx(FILE* fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _CREATEJACOBIANMATRIXX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void CreateJacobianMatrixx(Matrix** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _DELTA18OPARAMETERIZATIONX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void Delta18oParameterizationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _PARSEPETSCOPTIONSX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void ParsePetscOptionsx(Parameters* parameters, FILE* petscoptionsfid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _TRIASEARCHX_H
+ #define _TRIASEARCHX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void TriaSearchx(double** ptria,int* index,int nel, double* x, double* y, int nods,double* x0, double* y0,int numberofnodes);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.cpp	(revision 12832)
+@@ -6,7 +6,7 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../modules.h"
+ 
+ using namespace bamg;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _GRADJX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void Gradjx(Vector** pgrad_g,double** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MAXABSVZX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MaxAbsVzx( double* pmaxabsvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VecMergex/VecMergex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VecMergex/VecMergex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VecMergex/VecMergex.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _VECMERGEX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void VecMergex(Vector* ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetCoordinateSystemx/ResetCoordinateSystemx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetCoordinateSystemx/ResetCoordinateSystemx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetCoordinateSystemx/ResetCoordinateSystemx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _RESETCOORDINATESYSTEMX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void ResetCoordinateSystemx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads,Materials* materials,  Parameters* parameters); 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _UPDATEINPUTSFROMCONSTANTXX_H
+ #define _UPDATEINPUTSFROMCONSTANTXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _MERGESOLUTIONFROMFTOGX_H
+ #define _MERGESOLUTIONFROMFTOGX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void	Mergesolutionfromftogx( Vector** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _SURFACEABSVELMISFITX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void SurfaceAbsVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MassFluxx/MassFluxx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MassFluxx/MassFluxx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MassFluxx/MassFluxx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MASSFLUXX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MassFluxx(double* pmass_flux, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVyx/MinVyx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVyx/MinVyx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVyx/MinVyx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _MINVYX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void MinVyx( double* pminvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _DAKOTARESPONSESXX_H
+ #define _DAKOTARESPONSESXX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ void DakotaResponsesx(double* d_responses,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,char** responses_descriptors,int numresponsedescriptors,int d_numresponses);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Bamgx/Bamgx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Bamgx/Bamgx.cpp	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Bamgx/Bamgx.cpp	(revision 12832)
+@@ -2,7 +2,7 @@
+  * \brief: use Bamg capabilities.
+  */
+ #include "./Bamgx.h"
+-#include "../../objects/objects.h"
++#include "../../classes/bamg/bamgobjects.h"
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Bamgx/Bamgx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Bamgx/Bamgx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Bamgx/Bamgx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _BAMGX_H
+ #define _BAMGX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/bamg/bamgobjects.h"
+ 
+ /* local prototypes: */
+ int     Bamgx(BamgMesh* bamgmesh_out,BamgGeom* bamggeom_out,BamgMesh* bamgmesh_in,BamgGeom* bamggeom_in,BamgOpts* bamgopts);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h	(revision 12832)
+@@ -7,7 +7,7 @@
+ #define _CONTOURTOMESHX_H
+ 
+ #include "../../shared/shared.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /*threading: */
+ typedef struct{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #define _CREATENODALCONSTRAINTSX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void CreateNodalConstraintsx( Vector** pys, Nodes* nodes,int configuration_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.h	(revision 12832)
+@@ -7,7 +7,7 @@
+ 
+ #include <float.h>    /*  DBL_MAX  */
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void KMLMeshWritex(int* ierror,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h	(revision 12832)
+@@ -7,7 +7,7 @@
+ 
+ #include "string.h"
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h	(revision 12832)
+@@ -4,7 +4,7 @@
+ #ifndef _CONTROLINPUTGETGRADIENTX_H
+ #define _CONTROLINPUTGETGRADIENTX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ void	ControlInputGetGradientx( Vector** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _UPDATEDYNAMICCONSTRAINTSXX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector* yg);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _DRAGCOEFFABSGRADX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void DragCoefficientAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.h	(revision 12832)
+@@ -18,7 +18,7 @@
+ #endif
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ int Shp2Kmlx(char* filshp,char* filkml, int sgn);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h	(revision 12832)
+@@ -7,7 +7,7 @@
+ #define _POINTCLOUDFLAGNEIGHBORSX_H
+ 
+ #include "../../shared/shared.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ int PointCloudFindNeighborsx( Vector** pflags,double* x, double* y, int nods, double mindistance,double multithread);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #define _IOMODEL_TO_CONSTRAINTS_H_
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void IoModelToConstraintsx(Constraints* constraints,IoModel* iomodel,int vector_enum,int analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _RHEOLOGYBBARGRADIENTX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void RheologyBbarAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputArtificialNoisex/InputArtificialNoisex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputArtificialNoisex/InputArtificialNoisex.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputArtificialNoisex/InputArtificialNoisex.h	(revision 12832)
+@@ -5,7 +5,7 @@
+ #ifndef _INPUTARTIFICIALNOISEX_H
+ #define _INPUTARTIFICIALNOISEX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h	(revision 12832)
+@@ -6,7 +6,7 @@
+ #define _TOTALSMBX_H
+ 
+ #include "../../Container/Container.h"
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+ void TotalSmbx(double* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h	(revision 12832)
+@@ -4,7 +4,7 @@
+ #ifndef _CONTROLINPUTSSCALEGRADIENTX_H
+ #define _CONTROLINPUTSSCALEGRADIENTX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+ void	ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* norm_list,int step);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12831)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12832)
+@@ -27,134 +27,136 @@
+ 					./include/typedefs.h\
+ 					./include/types.h\
+ 					./include/include.h\
+-					./objects/objects.h\
+-					./objects/Object.h\
+-					./objects/Gauss/GaussTria.h\
+-					./objects/Gauss/GaussTria.cpp\
+-					./objects/Update.h\
+-					./objects/Element.h\
+-					./objects/FemModel.h\
+-					./objects/FemModel.cpp\
+-					./objects/Material.h\
+-					./objects/Load.h\
+-					./objects/Contour.h\
+-					./objects/Contour.cpp\
+-					./objects/OptArgs.h\
+-					./objects/OptPars.h\
+-					./objects/Loads/Friction.h\
+-					./objects/Loads/Friction.cpp\
+-					./objects/Inputs/TransientInput.h\
+-					./objects/Inputs/TransientInput.cpp\
+-					./objects/Constraints/SpcTransient.cpp\
+-					./objects/Constraints/SpcTransient.h\
+-					./objects/DofIndexing.h\
+-					./objects/DofIndexing.cpp\
+-					./objects/IoModel.h\
+-					./objects/IoModel.cpp\
+-					./objects/Node.h\
+-					./objects/Node.cpp\
+-					./objects/Segment.h\
+-					./objects/Segment.cpp\
+-					./objects/Vertex.h\
+-					./objects/Vertex.cpp\
+-					./objects/Hook.h\
+-					./objects/Hook.cpp\
+-					./objects/Patch.h\
+-					./objects/Patch.cpp\
+-					./objects/ElementResults/ElementResultLocal.h\
+-					./objects/ElementResults/DoubleElementResult.h\
+-					./objects/ElementResults/DoubleElementResult.cpp\
+-					./objects/ElementResults/TriaP1ElementResult.h\
+-					./objects/ElementResults/TriaP1ElementResult.cpp\
+-					./objects/ElementResults/BoolElementResult.h\
+-					./objects/ElementResults/BoolElementResult.cpp\
+-					./objects/ExternalResults/ExternalResult.h\
+-					./objects/ExternalResults/BoolExternalResult.h\
+-					./objects/ExternalResults/BoolExternalResult.cpp\
+-					./objects/ExternalResults/DoubleExternalResult.h\
+-					./objects/ExternalResults/DoubleExternalResult.cpp\
+-					./objects/ExternalResults/DoubleVecExternalResult.h\
+-					./objects/ExternalResults/DoubleVecExternalResult.cpp\
+-					./objects/ExternalResults/DoubleMatExternalResult.h\
+-					./objects/ExternalResults/DoubleMatExternalResult.cpp\
+-					./objects/ExternalResults/IntExternalResult.h\
+-					./objects/ExternalResults/IntExternalResult.cpp\
+-					./objects/ExternalResults/StringExternalResult.h\
+-					./objects/ExternalResults/StringExternalResult.cpp\
+-					./objects/Elements/Tria.h\
+-					./objects/Elements/Tria.cpp\
+-					./objects/Elements/TriaHook.h\
+-					./objects/Elements/TriaHook.cpp\
+-					./objects/Elements/TriaRef.h\
+-					./objects/Elements/TriaRef.cpp\
+-					./objects/Inputs/Input.h\
+-					./objects/Inputs/InputLocal.h\
+-					./objects/Inputs/TriaP1Input.h\
+-					./objects/Inputs/TriaP1Input.cpp\
+-					./objects/Inputs/BoolInput.h\
+-					./objects/Inputs/BoolInput.cpp\
+-					./objects/Inputs/IntInput.h\
+-					./objects/Inputs/IntInput.cpp\
+-					./objects/Inputs/DoubleInput.h\
+-					./objects/Inputs/DoubleInput.cpp\
+-					./objects/Inputs/DatasetInput.h\
+-					./objects/Inputs/DatasetInput.cpp\
+-					./objects/Materials/Matice.h\
+-					./objects/Materials/Matice.cpp\
+-					./objects/Materials/Matpar.h\
+-					./objects/Materials/Matpar.cpp\
+-					./objects/Constraints/Constraint.h\
+-					./objects/Constraints/SpcStatic.cpp\
+-					./objects/Constraints/SpcStatic.h\
+-					./objects/Constraints/SpcDynamic.cpp\
+-					./objects/Constraints/SpcDynamic.h\
+-					./objects/Loads/Penpair.cpp\
+-					./objects/Loads/Penpair.h\
+-					./objects/Loads/Pengrid.cpp\
+-					./objects/Loads/Pengrid.h\
+-					./objects/Loads/Icefront.cpp\
+-					./objects/Loads/Icefront.h\
+-					./objects/Loads/Numericalflux.cpp\
+-					./objects/Loads/Numericalflux.h\
+-					./objects/Numerics/ElementMatrix.h\
+-					./objects/Numerics/ElementMatrix.cpp\
+-					./objects/Numerics/ElementVector.h\
+-					./objects/Numerics/ElementVector.cpp\
+-					./objects/Numerics/Matrix.h\
+-					./objects/Numerics/Matrix.cpp\
+-					./objects/Numerics/Vector.h\
+-					./objects/Numerics/Vector.cpp\
+-					./objects/Params/Param.h\
+-					./objects/Params/BoolParam.cpp\
+-					./objects/Params/BoolParam.h\
+-					./objects/Params/IntParam.cpp\
+-					./objects/Params/IntParam.h\
+-					./objects/Params/IntVecParam.cpp\
+-					./objects/Params/IntVecParam.h\
+-					./objects/Params/IntMatParam.cpp\
+-					./objects/Params/IntMatParam.h\
+-					./objects/Params/DoubleParam.cpp\
+-					./objects/Params/DoubleParam.h\
+-					./objects/Params/FileParam.cpp\
+-					./objects/Params/FileParam.h\
+-					./objects/Params/StringArrayParam.cpp\
+-					./objects/Params/StringArrayParam.h\
+-					./objects/Params/DoubleMatParam.cpp\
+-					./objects/Params/DoubleMatParam.h\
+-					./objects/Params/DoubleTransientMatParam.cpp\
+-					./objects/Params/DoubleTransientMatParam.h\
+-					./objects/Params/DoubleMatArrayParam.cpp\
+-					./objects/Params/DoubleMatArrayParam.h\
+-					./objects/Params/DoubleVecParam.cpp\
+-					./objects/Params/DoubleVecParam.h\
+-					./objects/Params/StringParam.cpp\
+-					./objects/Params/StringParam.h\
+-					./objects/Params/MatrixParam.h\
+-					./objects/Params/MatrixParam.cpp\
+-					./objects/Params/VectorParam.h\
+-					./objects/Params/VectorParam.cpp\
+-					./objects/Params/TransientParam.h\
+-					./objects/Params/TransientParam.cpp\
++					./classes/classes.h\
++					./classes/objects.h\
++					./classes/objects/Object.h\
++					./classes/gauss/GaussTria.h\
++					./classes/gauss/GaussTria.cpp\
++					./classes/objects/Update.h\
++					./classes/objects/Element.h\
++					./classes/FemModel.h\
++					./classes/FemModel.cpp\
++					./classes/objects/Material.h\
++					./classes/objects/Load.h\
++					./classes/objects/Contour.h\
++					./classes/objects/Contour.cpp\
++					./classes/objects/OptArgs.h\
++					./classes/objects/OptPars.h\
++					./classes/objects/Loads/Friction.h\
++					./classes/objects/Loads/Friction.cpp\
++					./classes/objects/Inputs/TransientInput.h\
++					./classes/objects/Inputs/TransientInput.cpp\
++					./classes/objects/Constraints/SpcTransient.cpp\
++					./classes/objects/Constraints/SpcTransient.h\
++					./classes/DofIndexing.h\
++					./classes/DofIndexing.cpp\
++					./classes/IoModel.h\
++					./classes/IoModel.cpp\
++					./classes/objects/Node.h\
++					./classes/objects/Node.cpp\
++					./classes/objects/Segment.h\
++					./classes/objects/Segment.cpp\
++					./classes/objects/Vertex.h\
++					./classes/objects/Vertex.cpp\
++					./classes/Hook.h\
++					./classes/Hook.cpp\
++					./classes/Patch.h\
++					./classes/Patch.cpp\
++					./classes/objects/ElementResults/ElementResultLocal.h\
++					./classes/objects/ElementResults/DoubleElementResult.h\
++					./classes/objects/ElementResults/DoubleElementResult.cpp\
++					./classes/objects/ElementResults/TriaP1ElementResult.h\
++					./classes/objects/ElementResults/TriaP1ElementResult.cpp\
++					./classes/objects/ElementResults/BoolElementResult.h\
++					./classes/objects/ElementResults/BoolElementResult.cpp\
++					./classes/objects/ExternalResults/ExternalResult.h\
++					./classes/objects/ExternalResults/BoolExternalResult.h\
++					./classes/objects/ExternalResults/BoolExternalResult.cpp\
++					./classes/objects/ExternalResults/DoubleExternalResult.h\
++					./classes/objects/ExternalResults/DoubleExternalResult.cpp\
++					./classes/objects/ExternalResults/DoubleVecExternalResult.h\
++					./classes/objects/ExternalResults/DoubleVecExternalResult.cpp\
++					./classes/objects/ExternalResults/DoubleMatExternalResult.h\
++					./classes/objects/ExternalResults/DoubleMatExternalResult.cpp\
++					./classes/objects/ExternalResults/IntExternalResult.h\
++					./classes/objects/ExternalResults/IntExternalResult.cpp\
++					./classes/objects/ExternalResults/StringExternalResult.h\
++					./classes/objects/ExternalResults/StringExternalResult.cpp\
++					./classes/objects/Elements/Tria.h\
++					./classes/objects/Elements/Tria.cpp\
++					./classes/objects/Elements/TriaHook.h\
++					./classes/objects/Elements/TriaHook.cpp\
++					./classes/objects/Elements/TriaRef.h\
++					./classes/objects/Elements/TriaRef.cpp\
++					./classes/objects/Inputs/Input.h\
++					./classes/objects/Inputs/InputLocal.h\
++					./classes/objects/Inputs/TriaP1Input.h\
++					./classes/objects/Inputs/TriaP1Input.cpp\
++					./classes/objects/Inputs/BoolInput.h\
++					./classes/objects/Inputs/BoolInput.cpp\
++					./classes/objects/Inputs/IntInput.h\
++					./classes/objects/Inputs/IntInput.cpp\
++					./classes/objects/Inputs/DoubleInput.h\
++					./classes/objects/Inputs/DoubleInput.cpp\
++					./classes/objects/Inputs/DatasetInput.h\
++					./classes/objects/Inputs/DatasetInput.cpp\
++					./classes/objects/Materials/Matice.h\
++					./classes/objects/Materials/Matice.cpp\
++					./classes/objects/Materials/Matpar.h\
++					./classes/objects/Materials/Matpar.cpp\
++					./classes/objects/Constraints/Constraint.h\
++					./classes/objects/Constraints/SpcStatic.cpp\
++					./classes/objects/Constraints/SpcStatic.h\
++					./classes/objects/Constraints/SpcDynamic.cpp\
++					./classes/objects/Constraints/SpcDynamic.h\
++					./classes/objects/Loads/Penpair.cpp\
++					./classes/objects/Loads/Penpair.h\
++					./classes/objects/Loads/Pengrid.cpp\
++					./classes/objects/Loads/Pengrid.h\
++					./classes/objects/Loads/Icefront.cpp\
++					./classes/objects/Loads/Icefront.h\
++					./classes/objects/Loads/Numericalflux.cpp\
++					./classes/objects/Loads/Numericalflux.h\
++					./classes/matrix/matrixobjects.h\
++					./classes/matrix/ElementMatrix.h\
++					./classes/matrix/ElementMatrix.cpp\
++					./classes/matrix/ElementVector.h\
++					./classes/matrix/ElementVector.cpp\
++					./classes/matrix/Matrix.h\
++					./classes/matrix/Matrix.cpp\
++					./classes/matrix/Vector.h\
++					./classes/matrix/Vector.cpp\
++					./classes/objects/Params/Param.h\
++					./classes/objects/Params/BoolParam.cpp\
++					./classes/objects/Params/BoolParam.h\
++					./classes/objects/Params/IntParam.cpp\
++					./classes/objects/Params/IntParam.h\
++					./classes/objects/Params/IntVecParam.cpp\
++					./classes/objects/Params/IntVecParam.h\
++					./classes/objects/Params/IntMatParam.cpp\
++					./classes/objects/Params/IntMatParam.h\
++					./classes/objects/Params/DoubleParam.cpp\
++					./classes/objects/Params/DoubleParam.h\
++					./classes/objects/Params/FileParam.cpp\
++					./classes/objects/Params/FileParam.h\
++					./classes/objects/Params/StringArrayParam.cpp\
++					./classes/objects/Params/StringArrayParam.h\
++					./classes/objects/Params/DoubleMatParam.cpp\
++					./classes/objects/Params/DoubleMatParam.h\
++					./classes/objects/Params/DoubleTransientMatParam.cpp\
++					./classes/objects/Params/DoubleTransientMatParam.h\
++					./classes/objects/Params/DoubleMatArrayParam.cpp\
++					./classes/objects/Params/DoubleMatArrayParam.h\
++					./classes/objects/Params/DoubleVecParam.cpp\
++					./classes/objects/Params/DoubleVecParam.h\
++					./classes/objects/Params/StringParam.cpp\
++					./classes/objects/Params/StringParam.h\
++					./classes/objects/Params/MatrixParam.h\
++					./classes/objects/Params/MatrixParam.cpp\
++					./classes/objects/Params/VectorParam.h\
++					./classes/objects/Params/VectorParam.cpp\
++					./classes/objects/Params/TransientParam.h\
++					./classes/objects/Params/TransientParam.cpp\
+ 					./Container/Container.h\
+ 					./Container/Constraints.h\
+ 					./Container/Constraints.cpp\
+@@ -344,14 +346,20 @@
+ 					./solvers/solver_linear.cpp\
+ 					./solvers/solver_nonlinear.cpp\
+ 					./solvers/solver_newton.cpp\
+-					./objects/Options/Option.cpp\
+-					./objects/Options/Option.h\
+-					./objects/Options/OptionDouble.cpp\
+-					./objects/Options/OptionDouble.h\
+-					./objects/Options/OptionChar.cpp\
+-					./objects/Options/OptionChar.h\
+-					./objects/Options/OptionUtilities.cpp\
+-					./objects/Options/OptionUtilities.h
++					./classes/objects/Options/Option.cpp\
++					./classes/objects/Options/Option.h\
++					./classes/objects/Options/OptionDouble.cpp\
++					./classes/objects/Options/OptionDouble.h\
++					./classes/objects/Options/OptionChar.cpp\
++					./classes/objects/Options/OptionChar.h\
++					./classes/objects/Options/OptionUtilities.cpp\
++					./classes/objects/Options/OptionUtilities.h\
++					./classes/objects/Options/OptionLogical.cpp\
++					./classes/objects/Options/OptionLogical.h\
++					./classes/objects/Options/OptionStruct.cpp\
++					./classes/objects/Options/OptionStruct.h\
++					./classes/objects/Options/OptionCell.cpp\
++					./classes/objects/Options/OptionCell.h
+ 
+ #}}}
+ #DAKOTA sources  {{{
+@@ -452,8 +460,8 @@
+ 					  ./modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h\
+ 					  ./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp\
+ 					  ./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h\
+-					  ./objects/Inputs/ControlInput.h\
+-					  ./objects/Inputs/ControlInput.cpp\
++					  ./classes/objects/Inputs/ControlInput.h\
++					  ./classes/objects/Inputs/ControlInput.cpp\
+ 					  ./shared/Numerics/BrentSearch.cpp\
+ 					  ./shared/Numerics/OptimalSearch.cpp \
+ 					  ./solutions/control_core.cpp\
+@@ -553,74 +561,75 @@
+ 					        ./modules/GroundinglineMigrationx/GroundinglineMigrationx.h
+ #}}}
+ #Rifts sources  {{{
+-rifts_sources = ./objects/Loads/Riftfront.cpp\
+-				    ./objects/Loads/Riftfront.h\
++rifts_sources = ./classes/objects/Loads/Riftfront.cpp\
++				    ./classes/objects/Loads/Riftfront.h\
+ 				    ./modules/ConstraintsStatex/RiftConstraintsState.cpp
+ #}}}
+ #3D sources  {{{
+-threed_sources = ./objects/Gauss/GaussPenta.h\
+-				     ./objects/Gauss/GaussPenta.cpp\
+-				     ./objects/ElementResults/PentaP1ElementResult.h\
+-				     ./objects/ElementResults/PentaP1ElementResult.cpp\
+-				     ./objects/Inputs/PentaP1Input.h\
+-				     ./objects/Inputs/PentaP1Input.cpp\
+-				     ./objects/Elements/Penta.h\
+-				     ./objects/Elements/Penta.cpp\
+-				     ./objects/Elements/PentaHook.h\
+-				     ./objects/Elements/PentaHook.cpp\
+-				     ./objects/Elements/PentaRef.h\
+-				     ./objects/Elements/PentaRef.cpp
++threed_sources = ./classes/gauss/GaussPenta.h\
++				     ./classes/gauss/GaussPenta.cpp\
++				     ./classes/objects/ElementResults/PentaP1ElementResult.h\
++				     ./classes/objects/ElementResults/PentaP1ElementResult.cpp\
++				     ./classes/objects/Inputs/PentaP1Input.h\
++				     ./classes/objects/Inputs/PentaP1Input.cpp\
++				     ./classes/objects/Elements/Penta.h\
++				     ./classes/objects/Elements/Penta.cpp\
++				     ./classes/objects/Elements/PentaHook.h\
++				     ./classes/objects/Elements/PentaHook.cpp\
++				     ./classes/objects/Elements/PentaRef.h\
++				     ./classes/objects/Elements/PentaRef.cpp
+ #}}}
+ #Bamg sources  {{{
+-bamg_sources =  ./objects/Bamg/BamgGeom.h\
+-				./objects/Bamg/BamgGeom.cpp\
+-				./objects/Bamg/BamgMesh.h\
+-				./objects/Bamg/BamgMesh.cpp\
+-				./objects/Bamg/BamgOpts.h\
+-				./objects/Bamg/BamgOpts.cpp\
+-				./objects/Bamg/CrackedEdge.h\
+-				./objects/Bamg/CrackedEdge.cpp\
+-				./objects/Bamg/Curve.h\
+-				./objects/Bamg/Curve.cpp\
+-				./objects/Bamg/Direction.h\
+-				./objects/Bamg/Direction.cpp\
+-				./objects/Bamg/DoubleAndInt.h\
+-				./objects/Bamg/Edge.h\
+-				./objects/Bamg/Edge.cpp\
+-				./objects/Bamg/GeomEdge.h\
+-				./objects/Bamg/GeomEdge.cpp\
+-				./objects/Bamg/GeomSubDomain.h\
+-				./objects/Bamg/GeomSubDomain.cpp\
+-				./objects/Bamg/GeomVertex.h\
+-				./objects/Bamg/GeomVertex.cpp\
+-				./objects/Bamg/Geometry.cpp\
+-				./objects/Bamg/Geometry.h\
+-				./objects/Bamg/ListofIntersectionTriangles.cpp\
+-				./objects/Bamg/ListofIntersectionTriangles.h\
+-				./objects/Bamg/EigenMetric.cpp\
+-				./objects/Bamg/Metric.cpp\
+-				./objects/Bamg/Metric.h\
+-				./objects/Bamg/BamgQuadtree.cpp\
+-				./objects/Bamg/BamgQuadtree.h\
+-				./objects/Bamg/R2.h\
+-				./objects/Bamg/SetOfE4.cpp\
+-				./objects/Bamg/SetOfE4.h\
+-				./objects/Bamg/SubDomain.h\
+-				./objects/Bamg/SubDomain.cpp\
+-				./objects/Bamg/AdjacentTriangle.h\
+-				./objects/Bamg/AdjacentTriangle.cpp\
+-				./objects/Bamg/Triangle.cpp\
+-				./objects/Bamg/Triangle.h\
+-				./objects/Bamg/BamgVertex.cpp\
+-				./objects/Bamg/BamgVertex.h\
+-				./objects/Bamg/VertexOnEdge.h\
+-				./objects/Bamg/VertexOnEdge.cpp\
+-				./objects/Bamg/VertexOnGeom.h\
+-				./objects/Bamg/VertexOnGeom.cpp\
+-				./objects/Bamg/VertexOnVertex.h\
+-				./objects/Bamg/VertexOnVertex.cpp\
+-				./objects/Bamg/Mesh.cpp\
+-				./objects/Bamg/Mesh.h\
++bamg_sources =  ./classes/bamg/bamgobjects.h\
++				./classes/bamg/BamgGeom.h\
++				./classes/bamg/BamgGeom.cpp\
++				./classes/bamg/BamgMesh.h\
++				./classes/bamg/BamgMesh.cpp\
++				./classes/bamg/BamgOpts.h\
++				./classes/bamg/BamgOpts.cpp\
++				./classes/bamg/CrackedEdge.h\
++				./classes/bamg/CrackedEdge.cpp\
++				./classes/bamg/Curve.h\
++				./classes/bamg/Curve.cpp\
++				./classes/bamg/Direction.h\
++				./classes/bamg/Direction.cpp\
++				./classes/bamg/DoubleAndInt.h\
++				./classes/bamg/Edge.h\
++				./classes/bamg/Edge.cpp\
++				./classes/bamg/GeomEdge.h\
++				./classes/bamg/GeomEdge.cpp\
++				./classes/bamg/GeomSubDomain.h\
++				./classes/bamg/GeomSubDomain.cpp\
++				./classes/bamg/GeomVertex.h\
++				./classes/bamg/GeomVertex.cpp\
++				./classes/bamg/Geometry.cpp\
++				./classes/bamg/Geometry.h\
++				./classes/bamg/ListofIntersectionTriangles.cpp\
++				./classes/bamg/ListofIntersectionTriangles.h\
++				./classes/bamg/EigenMetric.cpp\
++				./classes/bamg/Metric.cpp\
++				./classes/bamg/Metric.h\
++				./classes/bamg/BamgQuadtree.cpp\
++				./classes/bamg/BamgQuadtree.h\
++				./classes/bamg/R2.h\
++				./classes/bamg/SetOfE4.cpp\
++				./classes/bamg/SetOfE4.h\
++				./classes/bamg/SubDomain.h\
++				./classes/bamg/SubDomain.cpp\
++				./classes/bamg/AdjacentTriangle.h\
++				./classes/bamg/AdjacentTriangle.cpp\
++				./classes/bamg/Triangle.cpp\
++				./classes/bamg/Triangle.h\
++				./classes/bamg/BamgVertex.cpp\
++				./classes/bamg/BamgVertex.h\
++				./classes/bamg/VertexOnEdge.h\
++				./classes/bamg/VertexOnEdge.cpp\
++				./classes/bamg/VertexOnGeom.h\
++				./classes/bamg/VertexOnGeom.cpp\
++				./classes/bamg/VertexOnVertex.h\
++				./classes/bamg/VertexOnVertex.cpp\
++				./classes/bamg/Mesh.cpp\
++				./classes/bamg/Mesh.h\
+ 				./shared/Bamg/Abs.h \
+ 				./shared/Bamg/BigPrimeNumber.h\
+ 				./shared/Bamg/BigPrimeNumber.cpp\
+@@ -640,38 +649,38 @@
+ #Kriging sources  {{{
+ kriging_sources = ./Container/Observations.h\
+ 						./Container/Observations.cpp\
+-						./objects/Kriging/Variogram.h \
+-						./objects/Kriging/GaussianVariogram.h\
+-						./objects/Kriging/GaussianVariogram.cpp\
+-						./objects/Kriging/ExponentialVariogram.h\
+-						./objects/Kriging/ExponentialVariogram.cpp\
+-						./objects/Kriging/SphericalVariogram.h\
+-						./objects/Kriging/SphericalVariogram.cpp\
+-						./objects/Kriging/PowerVariogram.h\
+-						./objects/Kriging/PowerVariogram.cpp\
+-						./objects/Kriging/Quadtree.h\
+-						./objects/Kriging/Quadtree.cpp\
+-						./objects/Kriging/Observation.h\
+-						./objects/Kriging/Observation.cpp\
++						./classes/kriging/Variogram.h \
++						./classes/kriging/GaussianVariogram.h\
++						./classes/kriging/GaussianVariogram.cpp\
++						./classes/kriging/ExponentialVariogram.h\
++						./classes/kriging/ExponentialVariogram.cpp\
++						./classes/kriging/SphericalVariogram.h\
++						./classes/kriging/SphericalVariogram.cpp\
++						./classes/kriging/PowerVariogram.h\
++						./classes/kriging/PowerVariogram.cpp\
++						./classes/kriging/Quadtree.h\
++						./classes/kriging/Quadtree.cpp\
++						./classes/kriging/Observation.h\
++						./classes/kriging/Observation.cpp\
+ 						./modules/Krigingx/Krigingx.cpp\
+ 						./modules/Krigingx/Krigingx.h
+ 
+ #For parallel kriging, only difference is ./modules/Krigingx/pKrigingx.cpp with no multithreading
+ pkriging_sources = ./Container/Observations.h\
+ 						./Container/Observations.cpp\
+-						./objects/Kriging/Variogram.h \
+-						./objects/Kriging/GaussianVariogram.h\
+-						./objects/Kriging/GaussianVariogram.cpp\
+-						./objects/Kriging/ExponentialVariogram.h\
+-						./objects/Kriging/ExponentialVariogram.cpp\
+-						./objects/Kriging/SphericalVariogram.h\
+-						./objects/Kriging/SphericalVariogram.cpp\
+-						./objects/Kriging/PowerVariogram.h\
+-						./objects/Kriging/PowerVariogram.cpp\
+-						./objects/Kriging/Quadtree.h\
+-						./objects/Kriging/Quadtree.cpp\
+-						./objects/Kriging/Observation.h\
+-						./objects/Kriging/Observation.cpp\
++						./classes/kriging/Variogram.h \
++						./classes/kriging/GaussianVariogram.h\
++						./classes/kriging/GaussianVariogram.cpp\
++						./classes/kriging/ExponentialVariogram.h\
++						./classes/kriging/ExponentialVariogram.cpp\
++						./classes/kriging/SphericalVariogram.h\
++						./classes/kriging/SphericalVariogram.cpp\
++						./classes/kriging/PowerVariogram.h\
++						./classes/kriging/PowerVariogram.cpp\
++						./classes/kriging/Quadtree.h\
++						./classes/kriging/Quadtree.cpp\
++						./classes/kriging/Observation.h\
++						./classes/kriging/Observation.cpp\
+ 						./modules/Krigingx/pKrigingx.cpp\
+ 						./modules/Krigingx/Krigingx.h
+ 
+@@ -825,21 +834,7 @@
+ 
+ #}}}
+ #Modules sources{{{
+-module_sources= ./objects/Options/Option.cpp\
+-			./objects/Options/Option.h\
+-			./objects/Options/OptionDouble.cpp\
+-			./objects/Options/OptionDouble.h\
+-			./objects/Options/OptionLogical.cpp\
+-			./objects/Options/OptionLogical.h\
+-			./objects/Options/OptionChar.cpp\
+-			./objects/Options/OptionChar.h\
+-			./objects/Options/OptionStruct.cpp\
+-			./objects/Options/OptionStruct.h\
+-			./objects/Options/OptionCell.cpp\
+-			./objects/Options/OptionCell.h\
+-			./objects/Options/OptionUtilities.cpp\
+-			./objects/Options/OptionUtilities.h\
+-			./shared/Alloc/alloc_module.h\
++module_sources= ./shared/Alloc/alloc_module.h\
+ 			./shared/Alloc/alloc_module.cpp\
+ 			./shared/Threads/issm_threads.h\
+ 			./shared/Threads/LaunchThread.cpp\
Index: /issm/oecreview/Archive/12678-13393/ISSM-12832-12833.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12832-12833.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12832-12833.diff	(revision 13394)
@@ -0,0 +1,48 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 12832)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 12833)
+@@ -16,13 +16,10 @@
+ mv Python-2.7.2/* src
+ rm -rf Python-2.7.2
+ 
+-#Configure doxygen
++#Configure and compile
+ cd src 
+ ./configure \
+  --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
+-
+-
+-#make
+ if [ -z $1 ]; then
+ 	make
+ else
+@@ -31,19 +28,15 @@
+ make install
+ 
+ cd ../install
++
++#get rid of bin, because it's just a copy of
++#Library/Frameworks/Python.framework/Versions/2.7/bin, and will not reflect
++#new changes being made
++rm -rf bin
+ ln -s Library/Frameworks/Python.framework/Headers include
+ ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
++ln -s Library/Frameworks/Python.framework/Versions/2.7/bin bin
+ 
+-#Some modifications to be done in case version is 2.7
+-if [[ $version == "2.7.2" ]]; then 
+-	cd ../install
+-	#get rid of bin, because it's just a copy of Library/Frameworks/Python.framework/Versions/2.7/bin, and will not reflect new changes being made
+-	rm -rf bin
+-	ln -s Library/Frameworks/Python.framework/Headers include
+-	ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
+-	ln -s Library/Frameworks/Python.framework/Versions/2.7/bin bin
+-
+-	#Patch pyport.h:
+-	cd include
+-	patch pyport.h $ISSM_DIR/externalpackages/python/patches/pyport.h.patch
+-fi
++#Patch pyport.h:
++cd include
++patch pyport.h $ISSM_DIR/externalpackages/python/patches/pyport.h.patch
Index: /issm/oecreview/Archive/12678-13393/ISSM-12833-12834.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12833-12834.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12833-12834.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h	(revision 12833)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h	(revision 12834)
+@@ -5,7 +5,7 @@
+ #ifndef _INTERPFROMMESHTOMESH2DX_H
+ #define _INTERPFROMMESHTOMESH2DX_H
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/classes.h"
+ 
+ int InterpFromMeshToMesh2dx(double** pdata_interp,int* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
+ 			double* data,int M_data,int N_data,double* x_interp,double* y_interp,int N_interp,Options* options);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12834-12835.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12834-12835.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12834-12835.diff	(revision 13394)
@@ -0,0 +1,1194 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects.h	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects.h	(revision 12835)
+@@ -6,180 +6,63 @@
+ #define ALL_OBJECTS_H_
+ 
+ /*Abstract classes: */
+-#include "./Object.h"
++#include "./objects/objects.h"
+ 
+ /*Objects: */
+ #include "./Hook.h"
+ #include "./DofIndexing.h"
+-#include "./Vertex.h"
+-#include "./Node.h"
+-#include "./Segment.h"
+ #include "./IoModel.h"
+ #include "./Patch.h"
+ #include "./Update.h"
+ 
+-/*Constraints: */
+-#include "./Constraints/Constraint.h"
+-#include "./Constraints/SpcStatic.h"
+-#include "./Constraints/SpcTransient.h"
+-#include "./Constraints/SpcDynamic.h"
+-
+ /*Gauss*/
+-#include "./Gauss/GaussTria.h"
+-#include "./Gauss/GaussPenta.h"
++#include "./gauss/GaussTria.h"
++#include "./gauss/GaussPenta.h"
+ 
+-/*Loads: */
+-#include "./Loads/Load.h"
+-#include "./Loads/Friction.h"
+-#include "./Loads/Icefront.h"
+-#include "./Loads/Numericalflux.h"
+-#include "./Loads/Riftfront.h"
+-#include "./Loads/Penpair.h"
+-#include "./Loads/Pengrid.h"
+-
+-/*Elements: */
+-#include "./Elements/Element.h"
+-#include "./Elements/Penta.h"
+-#include "./Elements/PentaHook.h"
+-#include "./Elements/PentaRef.h"
+-#include "./Elements/Tria.h"
+-#include "./Elements/TriaHook.h"
+-#include "./Elements/TriaRef.h"
+-
+-/*KML parsing objects: */
+-#include "./KML/KML_Attribute.h"
+-#include "./KML/KML_Comment.h"
+-#include "./KML/KML_ColorStyle.h"
+-#include "./KML/KML_Container.h"
+-#include "./KML/KML_Document.h"
+-#include "./KML/KML_Feature.h"
+-#include "./KML/KML_File.h"
+-#include "./KML/KML_Folder.h"
+-#include "./KML/KML_Geometry.h"
+-#include "./KML/KML_GroundOverlay.h"
+-#include "./KML/KML_Icon.h"
+-#include "./KML/KML_LatLonBox.h"
+-#include "./KML/KML_LinearRing.h"
+-#include "./KML/KML_LineString.h"
+-#include "./KML/KML_LineStyle.h"
+-#include "./KML/KML_MultiGeometry.h"
+-#include "./KML/KML_Object.h"
+-#include "./KML/KML_Overlay.h"
+-#include "./KML/KML_Point.h"
+-#include "./KML/KML_Placemark.h"
+-#include "./KML/KML_Polygon.h"
+-#include "./KML/KML_PolyStyle.h"
+-#include "./KML/KML_Style.h"
+-#include "./KML/KML_StyleSelector.h"
+-#include "./KML/KML_SubStyle.h"
+-#include "./KML/KML_Unknown.h"
+-#include "./KML/KMLFileReadUtils.h"
+-
+-/*Option parsing objects: */
+-#include "./Options/Option.h"
+-#include "./Options/OptionDouble.h"
+-#include "./Options/OptionLogical.h"
+-#include "./Options/OptionChar.h"
+-#include "./Options/OptionStruct.h"
+-#include "./Options/OptionCell.h"
+-#include "./Options/OptionUtilities.h"
+-
+-/*Inputs: */
+-#include "./Inputs/Input.h"
+-#include "./Inputs/BoolInput.h"
+-#include "./Inputs/DoubleInput.h"
+-#include "./Inputs/IntInput.h"
+-#include "./Inputs/PentaP1Input.h"
+-#include "./Inputs/TriaP1Input.h"
+-#include "./Inputs/ControlInput.h"
+-#include "./Inputs/DatasetInput.h"
+-#include "./Inputs/TransientInput.h"
+-
+-/*ElementResults: */
+-#include "./ElementResults/ElementResult.h"
+-#include "./ElementResults/DoubleElementResult.h"
+-#include "./ElementResults/TriaP1ElementResult.h"
+-#include "./ElementResults/PentaP1ElementResult.h" 
+-#include "./ElementResults/BoolElementResult.h"
+-
+-/*ExternalResults: */
+-#include "./ExternalResults/ExternalResult.h"
+-#include "./ExternalResults/BoolExternalResult.h"
+-#include "./ExternalResults/DoubleExternalResult.h"
+-#include "./ExternalResults/DoubleVecExternalResult.h"
+-#include "./ExternalResults/DoubleMatExternalResult.h"
+-#include "./ExternalResults/IntExternalResult.h"
+-#include "./ExternalResults/PetscVecExternalResult.h"
+-#include "./ExternalResults/StringExternalResult.h"
+-
+-/*Materials: */
+-#include "./Materials/Material.h"
+-#include "./Materials/Matice.h"
+-#include "./Materials/Matpar.h"
+-
+ /*Numerics:*/
+-#include "./Numerics/ElementMatrix.h"
+-#include "./Numerics/ElementVector.h"
+-#include "./Numerics/Vector.h"
+-#include "./Numerics/Matrix.h"
++#include "./matrix/ElementMatrix.h"
++#include "./matrix/ElementVector.h"
++#include "./matrix/Vector.h"
++#include "./matrix/Matrix.h"
+ 
+-/*Params: */
+-#include "./Params/BoolParam.h"
+-#include "./Params/DoubleMatParam.h"
+-#include "./Params/DoubleTransientMatParam.h"
+-#include "./Params/DoubleMatArrayParam.h"
+-#include "./Params/DoubleParam.h"
+-#include "./Params/DoubleVecParam.h"
+-#include "./Params/IntParam.h"
+-#include "./Params/IntVecParam.h"
+-#include "./Params/IntMatParam.h"
+-#include "./Params/FileParam.h"
+-#include "./Params/Param.h"
+-#include "./Params/MatrixParam.h"
+-#include "./Params/VectorParam.h"
+-#include "./Params/StringArrayParam.h"
+-#include "./Params/StringParam.h"
+-#include "./Params/TransientParam.h"
+-
+ /*C objects: */
+-#include "./Contour.h"
+ #include "./FemModel.h"
+ #include "./OptArgs.h"
+ #include "./OptPars.h"
+ 
+ /*Bamg: */
+-#include "./Bamg/BamgOpts.h"
+-#include "./Bamg/BamgGeom.h"
+-#include "./Bamg/BamgMesh.h"
+-#include "./Bamg/Metric.h"
+-#include "./Bamg/DoubleAndInt.h"
+-#include "./Bamg/Direction.h"
+-#include "./Bamg/BamgVertex.h"
+-#include "./Bamg/AdjacentTriangle.h"
+-#include "./Bamg/Edge.h"
+-#include "./Bamg/GeomVertex.h"
+-#include "./Bamg/GeomEdge.h"
+-#include "./Bamg/Curve.h"
+-#include "./Bamg/Triangle.h"
+-#include "./Bamg/ListofIntersectionTriangles.h"
+-#include "./Bamg/GeomSubDomain.h"
+-#include "./Bamg/SubDomain.h"
+-#include "./Bamg/VertexOnGeom.h"
+-#include "./Bamg/VertexOnVertex.h"
+-#include "./Bamg/VertexOnEdge.h"
+-#include "./Bamg/CrackedEdge.h"
+-#include "./Bamg/Mesh.h"
+-#include "./Bamg/Geometry.h"
+-#include "./Bamg/BamgQuadtree.h"
+-#include "./Bamg/SetOfE4.h"
++#include "./bamg/BamgOpts.h"
++#include "./bamg/BamgGeom.h"
++#include "./bamg/BamgMesh.h"
++#include "./bamg/Metric.h"
++#include "./bamg/DoubleAndInt.h"
++#include "./bamg/Direction.h"
++#include "./bamg/BamgVertex.h"
++#include "./bamg/AdjacentTriangle.h"
++#include "./bamg/Edge.h"
++#include "./bamg/GeomVertex.h"
++#include "./bamg/GeomEdge.h"
++#include "./bamg/Curve.h"
++#include "./bamg/Triangle.h"
++#include "./bamg/ListofIntersectionTriangles.h"
++#include "./bamg/GeomSubDomain.h"
++#include "./bamg/SubDomain.h"
++#include "./bamg/VertexOnGeom.h"
++#include "./bamg/VertexOnVertex.h"
++#include "./bamg/VertexOnEdge.h"
++#include "./bamg/CrackedEdge.h"
++#include "./bamg/Mesh.h"
++#include "./bamg/Geometry.h"
++#include "./bamg/BamgQuadtree.h"
++#include "./bamg/SetOfE4.h"
+ 
+ /*Kriging*/
+-#include "./Kriging/Variogram.h"
+-#include "./Kriging/GaussianVariogram.h"
+-#include "./Kriging/ExponentialVariogram.h"
+-#include "./Kriging/SphericalVariogram.h"
+-#include "./Kriging/PowerVariogram.h"
+-#include "./Kriging/Quadtree.h"
+-#include "./Kriging/Observation.h"
++#include "./kriging/Variogram.h"
++#include "./kriging/GaussianVariogram.h"
++#include "./kriging/ExponentialVariogram.h"
++#include "./kriging/SphericalVariogram.h"
++#include "./kriging/PowerVariogram.h"
++#include "./kriging/Quadtree.h"
++#include "./kriging/Observation.h"
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 12835)
+@@ -8,10 +8,8 @@
+ /*Abstract classes: */
+ #include "./Object.h"
+ 
+-/*Orphans: */
++/*Objects: */
+ #include "./Contour.h"
+-
+-/*Objects: */
+ #include "./Vertex.h"
+ #include "./Node.h"
+ #include "./Segment.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp	(revision 12835)
+@@ -13,9 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+@@ -43,7 +44,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Geometry::DeepEcho {{{*/
+ void  KML_Geometry::DeepEcho(){
+ 
+@@ -54,7 +54,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Geometry::DeepEcho {{{*/
+ void  KML_Geometry::DeepEcho(const char* indent){
+ 
+@@ -63,7 +62,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Geometry::Write {{{*/
+ void  KML_Geometry::Write(FILE* filout,const char* indent){
+ 
+@@ -72,7 +70,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Geometry::Read {{{*/
+ void  KML_Geometry::Read(FILE* fid,char* kstr){
+ 
+@@ -91,4 +88,3 @@
+ 	return;
+ }
+ /*}}}*/
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+@@ -47,7 +47,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Folder::DeepEcho {{{*/
+ void  KML_Folder::DeepEcho(){
+ 
+@@ -58,7 +57,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Folder::DeepEcho {{{*/
+ void  KML_Folder::DeepEcho(const char* indent){
+ 
+@@ -70,7 +68,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Folder::Write {{{*/
+ void  KML_Folder::Write(FILE* filout,const char* indent){
+ 
+@@ -86,7 +83,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Folder::Read {{{*/
+ void  KML_Folder::Read(FILE* fid,char* kstr){
+ 
+@@ -128,4 +124,3 @@
+ 	return;
+ }
+ /*}}}*/
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+@@ -47,7 +47,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Document::DeepEcho {{{*/
+ void  KML_Document::DeepEcho(){
+ 
+@@ -58,7 +57,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Document::DeepEcho {{{*/
+ void  KML_Document::DeepEcho(const char* indent){
+ 
+@@ -70,7 +68,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Document::Write {{{*/
+ void  KML_Document::Write(FILE* filout,const char* indent){
+ 
+@@ -86,7 +83,6 @@
+ 	return;
+ }
+ /*}}}*/
+-
+ /*FUNCTION KML_Document::Read {{{*/
+ void  KML_Document::Read(FILE* fid,char* kstr){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 12835)
+@@ -13,11 +13,11 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-#include "../../modules/Ll2xyx/Ll2xyx.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
++#include "../../../modules/Ll2xyx/Ll2xyx.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 12835)
+@@ -13,11 +13,11 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-#include "../../io/io.h"
+-#include "../../modules/Ll2xyx/Ll2xyx.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
++#include "../../../modules/Ll2xyx/Ll2xyx.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*FUNCTION  KMLFileToken(FILE* fid,int* pncom=NULL,char*** ppcom=NULL) {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp	(revision 12835)
+@@ -13,9 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.cpp	(revision 12835)
+@@ -13,9 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp	(revision 12835)
+@@ -13,11 +13,11 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-#include "../../modules/Ll2xyx/Ll2xyx.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
++#include "../../../modules/Ll2xyx/Ll2xyx.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp	(revision 12835)
+@@ -13,10 +13,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "../objects.h"
+-#include "../../shared/shared.h"
+-#include "../../io/io.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include "../../../shared/shared.h"
++#include "../../../io/io.h"
++#include "../../../Container/Container.h"
++#include "../../../include/include.h"
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h	(revision 12835)
+@@ -3,6 +3,7 @@
+ #define _BAMGQUADTREE_H
+ 
+ #include "./include.h"
++#include "../objects/Object.h"
+ class DataSet;
+ 
+ namespace bamg {
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h	(revision 12835)
+@@ -10,6 +10,7 @@
+ #include "../include/include.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ 
++class Parameters;
+ class Elements;
+ class Param;
+ class Option;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp	(revision 12835)
+@@ -13,7 +13,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "./matlabio.h"
+-#include "../../objects/objects.h"
++#include "../../classes/classes.h"
+ #include "../../shared/shared.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp	(revision 12835)
+@@ -13,7 +13,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "./matlabio.h"
+-#include "../../objects/objects.h"
++#include "../../classes/classes.h"
+ #include "../../shared/shared.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 12835)
+@@ -11,7 +11,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif 
+ 
+-#include "../../objects/objects.h"
++#include "../../classes/classes.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/issm.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/issm.h	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/issm.h	(revision 12835)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #ifndef _ISSM_H_
+-#define  _ISSM_H_
++#define _ISSM_H_
+ 
+ #ifdef HAVE_CONFIG_H
+ 	#include <config.h>
+@@ -13,7 +13,7 @@
+ 
+ #include "./include/include.h"
+ #include "./shared/shared.h"
+-#include "./objects/objects.h"
++#include "./classes/classes.h"
+ #include "./Container/Container.h"
+ #include "./EnumDefinitions/EnumDefinitions.h"
+ #include "./toolkits/toolkits.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PrintArrays.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PrintArrays.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PrintArrays.cpp	(revision 12835)
+@@ -0,0 +1,33 @@
++
++#include "./elements.h"
++#include "../../include/macros.h"
++using namespace std;
++
++void printarray(IssmPDouble* array,int lines,int cols){
++	_printLine_("");
++	for(int i=0;i<lines;i++){  
++		_printString_("   [ ");
++		for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
++		_printLine_(" ]");
++	}  
++	_printLine_("");
++}
++void printarray(int* array,int lines,int cols){
++	_printLine_("");
++	for(int i=0;i<lines;i++){  
++		_printString_("   [ ");
++		for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
++		_printLine_(" ]");
++	}  
++	_printLine_("");
++}
++void printbinary(int n){
++	unsigned int i=1L<<(sizeof(n)*8-1);
++	while (i>0) {
++		if (n&i)
++		 _printString_("1");
++		else
++		 _printString_("0");
++		i>>=1;
++	}
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h	(revision 12835)
+@@ -3,7 +3,7 @@
+  */ 
+ 
+ #ifndef _SHARED_ELEMENTS_H_
+-#define  _SHARED_ELEMENTS_H_
++#define _SHARED_ELEMENTS_H_
+ 
+ #include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+@@ -23,6 +23,7 @@
+ int    GetNumberOfDofs( Node** nodes,int numnodes,int setenum,int approximation_enum);
+ int*   GetLocalDofList( Node** nodes,int numnodes,int setenum,int approximation_enum);
+ int*   GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation_enum);
++
+ #ifdef _HAVE_DIAGNOSTIC_
+ void   CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes,int numnodes,int* cs_array);
+ void   TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int cs_enum);
+@@ -35,33 +36,8 @@
+ void   TransformSolutionCoord(IssmDouble* solution,Node** nodes,int numnodes,int* cs_array);
+ #endif
+ 
+-inline void printarray(IssmPDouble* array,int lines,int cols=1){
+-	_printLine_("");
+-	for(int i=0;i<lines;i++){  
+-		_printString_("   [ ");
+-		for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
+-		_printLine_(" ]");
+-	}  
+-	_printLine_("");
+-}
+-inline void printarray(int* array,int lines,int cols=1){
+-	_printLine_("");
+-	for(int i=0;i<lines;i++){  
+-		_printString_("   [ ");
+-		for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
+-		_printLine_(" ]");
+-	}  
+-	_printLine_("");
+-}
+-inline void printbinary(int n) {
+-	unsigned int i=1L<<(sizeof(n)*8-1);
+-	while (i>0) {
+-		if (n&i)
+-		 _printString_("1");
+-		else
+-		 _printString_("0");
+-		i>>=1;
+-	}
+-}
+-
++/*Print arrays*/
++void printarray(IssmPDouble* array,int lines,int cols=1);
++void printarray(int* array,int lines,int cols=1);
++void printbinary(int n);
+ #endif //ifndef _SHARED_ELEMENTS_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 12835)
+@@ -9,7 +9,7 @@
+ #include <cstring> 
+ #include "../Alloc/alloc.h"
+ #include "../../include/include.h"
+-#include "../../objects/objects.h"
++#include "../../classes/classes.h"
+ #include "../Exceptions/exceptions.h"
+ #include "../../Container/DataSet.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12834)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12835)
+@@ -212,6 +212,7 @@
+ 					./shared/Elements/GetLocalDofList.cpp\
+ 					./shared/Elements/GetGlobalDofList.cpp\
+ 					./shared/Elements/GetNumberOfDofs.cpp\
++					./shared/Elements/PrintArrays.cpp\
+ 					./shared/Elements/PddSurfaceMassBalance.cpp\
+ 					./shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp\
+ 					./shared/String/sharedstring.h\
+@@ -363,8 +364,8 @@
+ 
+ #}}}
+ #DAKOTA sources  {{{
+-dakota_sources = ./objects/DakotaPlugin.h\
+-					  ./objects/DakotaPlugin.cpp\
++dakota_sources = ./classes/dakota/DakotaPlugin.h\
++					  ./classes/dakota/DakotaPlugin.cpp\
+ 					  ./modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h\
+ 					  ./modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp\
+ 					  ./modules/DakotaResponsesx/DakotaResponsesx.h\
+@@ -698,60 +699,60 @@
+ 			     ./modules/KMLMeshWritex/KMLMeshWritex.cpp\
+ 			     ./modules/KMLOverlayx/KMLOverlayx.h\
+ 			     ./modules/KMLOverlayx/KMLOverlayx.cpp\
+-			     ./objects/KML/KML_Attribute.cpp\
+-			     ./objects/KML/KML_Attribute.h\
+-			     ./objects/KML/KML_Comment.cpp\
+-			     ./objects/KML/KML_Comment.h\
+-			     ./objects/KML/KML_ColorStyle.cpp\
+-			     ./objects/KML/KML_ColorStyle.h\
+-			     ./objects/KML/KML_Container.cpp\
+-			     ./objects/KML/KML_Container.h\
+-			     ./objects/KML/KML_Document.cpp\
+-			     ./objects/KML/KML_Document.h\
+-			     ./objects/KML/KML_Feature.cpp\
+-			     ./objects/KML/KML_Feature.h\
+-			     ./objects/KML/KML_File.cpp\
+-			     ./objects/KML/KML_File.h\
+-			     ./objects/KML/KML_Folder.cpp\
+-			     ./objects/KML/KML_Folder.h\
+-			     ./objects/KML/KML_Geometry.cpp\
+-			     ./objects/KML/KML_Geometry.h\
+-			     ./objects/KML/KML_GroundOverlay.cpp\
+-			     ./objects/KML/KML_GroundOverlay.h\
+-			     ./objects/KML/KML_Icon.cpp\
+-			     ./objects/KML/KML_Icon.h\
+-			     ./objects/KML/KML_LatLonBox.cpp\
+-		  	     ./objects/KML/KML_LatLonBox.h\
+-			     ./objects/KML/KML_LinearRing.cpp\
+-			     ./objects/KML/KML_LinearRing.h\
+-			     ./objects/KML/KML_LineString.cpp\
+-			     ./objects/KML/KML_LineString.h\
+-			     ./objects/KML/KML_LineStyle.cpp\
+-			     ./objects/KML/KML_LineStyle.h\
+-			     ./objects/KML/KML_MultiGeometry.cpp\
+-			     ./objects/KML/KML_MultiGeometry.h\
+-			     ./objects/KML/KML_Object.cpp\
+-			     ./objects/KML/KML_Object.h\
+-			     ./objects/KML/KML_Overlay.cpp\
+-			     ./objects/KML/KML_Overlay.h\
+-			     ./objects/KML/KML_Point.cpp\
+-			     ./objects/KML/KML_Point.h\
+-			     ./objects/KML/KML_Placemark.cpp\
+-			     ./objects/KML/KML_Placemark.h\
+-			     ./objects/KML/KML_Polygon.cpp\
+-			     ./objects/KML/KML_Polygon.h\
+-			     ./objects/KML/KML_PolyStyle.cpp\
+-			     ./objects/KML/KML_PolyStyle.h\
+-			     ./objects/KML/KML_Style.cpp\
+-			     ./objects/KML/KML_Style.h\
+-			     ./objects/KML/KML_StyleSelector.cpp\
+-			     ./objects/KML/KML_StyleSelector.h\
+-			     ./objects/KML/KML_SubStyle.cpp\
+-			     ./objects/KML/KML_SubStyle.h\
+-			     ./objects/KML/KML_Unknown.cpp\
+-			     ./objects/KML/KML_Unknown.h\
+-			     ./objects/KML/KMLFileReadUtils.cpp\
+-			     ./objects/KML/KMLFileReadUtils.h
++			     ./classes/objects/KML/KML_Attribute.cpp\
++			     ./classes/objects/KML/KML_Attribute.h\
++			     ./classes/objects/KML/KML_Comment.cpp\
++			     ./classes/objects/KML/KML_Comment.h\
++			     ./classes/objects/KML/KML_ColorStyle.cpp\
++			     ./classes/objects/KML/KML_ColorStyle.h\
++			     ./classes/objects/KML/KML_Container.cpp\
++			     ./classes/objects/KML/KML_Container.h\
++			     ./classes/objects/KML/KML_Document.cpp\
++			     ./classes/objects/KML/KML_Document.h\
++			     ./classes/objects/KML/KML_Feature.cpp\
++			     ./classes/objects/KML/KML_Feature.h\
++			     ./classes/objects/KML/KML_File.cpp\
++			     ./classes/objects/KML/KML_File.h\
++			     ./classes/objects/KML/KML_Folder.cpp\
++			     ./classes/objects/KML/KML_Folder.h\
++			     ./classes/objects/KML/KML_Geometry.cpp\
++			     ./classes/objects/KML/KML_Geometry.h\
++			     ./classes/objects/KML/KML_GroundOverlay.cpp\
++			     ./classes/objects/KML/KML_GroundOverlay.h\
++			     ./classes/objects/KML/KML_Icon.cpp\
++			     ./classes/objects/KML/KML_Icon.h\
++			     ./classes/objects/KML/KML_LatLonBox.cpp\
++		  	     ./classes/objects/KML/KML_LatLonBox.h\
++			     ./classes/objects/KML/KML_LinearRing.cpp\
++			     ./classes/objects/KML/KML_LinearRing.h\
++			     ./classes/objects/KML/KML_LineString.cpp\
++			     ./classes/objects/KML/KML_LineString.h\
++			     ./classes/objects/KML/KML_LineStyle.cpp\
++			     ./classes/objects/KML/KML_LineStyle.h\
++			     ./classes/objects/KML/KML_MultiGeometry.cpp\
++			     ./classes/objects/KML/KML_MultiGeometry.h\
++			     ./classes/objects/KML/KML_Object.cpp\
++			     ./classes/objects/KML/KML_Object.h\
++			     ./classes/objects/KML/KML_Overlay.cpp\
++			     ./classes/objects/KML/KML_Overlay.h\
++			     ./classes/objects/KML/KML_Point.cpp\
++			     ./classes/objects/KML/KML_Point.h\
++			     ./classes/objects/KML/KML_Placemark.cpp\
++			     ./classes/objects/KML/KML_Placemark.h\
++			     ./classes/objects/KML/KML_Polygon.cpp\
++			     ./classes/objects/KML/KML_Polygon.h\
++			     ./classes/objects/KML/KML_PolyStyle.cpp\
++			     ./classes/objects/KML/KML_PolyStyle.h\
++			     ./classes/objects/KML/KML_Style.cpp\
++			     ./classes/objects/KML/KML_Style.h\
++			     ./classes/objects/KML/KML_StyleSelector.cpp\
++			     ./classes/objects/KML/KML_StyleSelector.h\
++			     ./classes/objects/KML/KML_SubStyle.cpp\
++			     ./classes/objects/KML/KML_SubStyle.h\
++			     ./classes/objects/KML/KML_Unknown.cpp\
++			     ./classes/objects/KML/KML_Unknown.h\
++			     ./classes/objects/KML/KMLFileReadUtils.cpp\
++			     ./classes/objects/KML/KMLFileReadUtils.h
+ #}}}
+ #Petsc sources  {{{
+ petsc_sources= ./toolkits/petsc\
Index: /issm/oecreview/Archive/12678-13393/ISSM-12835-12836.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12835-12836.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12835-12836.diff	(revision 13394)
@@ -0,0 +1,18 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.h	(revision 12835)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.h	(revision 12836)
+@@ -9,12 +9,9 @@
+ 
+ /*Headers:*/
+ /*{{{*/
+-
+-
+ #include "DirectApplicInterface.H"
+ #include "../../toolkits/toolkits.h"
+-#include "../../objects/objects.h"
+-
++#include "../../classes/classes.h"
+ /*}}}*/
+ 
+ namespace SIM {
Index: /issm/oecreview/Archive/12678-13393/ISSM-12836-12837.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12836-12837.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12836-12837.diff	(revision 13394)
@@ -0,0 +1,32 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.cpp	(revision 12836)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/dakota/DakotaPlugin.cpp	(revision 12837)
+@@ -22,10 +22,10 @@
+ #endif
+ 
+ /*Standard ISSM includes: */
+-#include "../shared/shared.h"
+-#include "../include/include.h"
+-#include "../objects/objects.h"
+-#include "../modules/Dakotax/Dakotax.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../classes.h"
++#include "../../modules/Dakotax/Dakotax.h"
+ 
+ /*Standard includes: */
+ #include <string>
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/Dakotax.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/Dakotax.cpp	(revision 12836)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/Dakotax.cpp	(revision 12837)
+@@ -39,7 +39,7 @@
+ #include "../../io/io.h"
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../objects/DakotaPlugin.h"
++#include "../../classes/dakota/DakotaPlugin.h"
+ 
+ #ifdef _HAVE_DAKOTA_ //only works if dakota library has been compiled in.
+ #include "ParallelLibrary.H"
Index: /issm/oecreview/Archive/12678-13393/ISSM-12837-12838.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12837-12838.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12837-12838.diff	(revision 13394)
@@ -0,0 +1,32 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 12837)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 12838)
+@@ -1,4 +1,4 @@
+-INCLUDES = @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++INCLUDES = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
+ EXEEXT=$(PYTHONWRAPPEREXT)
+ #Bin programs {{{1
+ if MODULES
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 12837)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 12838)
+@@ -1,4 +1,4 @@
+-INCLUDES = @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++INCLUDES = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
+ EXEEXT=$(MATLABWRAPPEREXT)
+ #Bin programs {{{1
+ if MODULES
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour.sh	(revision 12837)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour.sh	(revision 12838)
+@@ -23,5 +23,5 @@
+ 	--with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
+ 	--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ 	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+-	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ 
+-	#--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
++	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12838-12839.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12838-12839.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12838-12839.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota	(revision 12838)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota	(revision 12839)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++*.gz
+ install
+ src
+ configure.sh
Index: /issm/oecreview/Archive/12678-13393/ISSM-12839-12840.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12839-12840.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12839-12840.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/classes.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/classes.h	(revision 12839)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/classes.h	(revision 12840)
+@@ -30,7 +30,4 @@
+ #include "./OptArgs.h"
+ #include "./OptPars.h"
+ 
+-/*dakota:*/
+-#include "./dakota/DakotaPlugin.h"
+-
+ #endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-12840-12841.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12840-12841.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12840-12841.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m	(revision 12840)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.m	(revision 12841)
+@@ -14,7 +14,7 @@
+ 	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3','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-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-12,...
++	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,2e-12,...
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-11};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
Index: /issm/oecreview/Archive/12678-13393/ISSM-12841-12842.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12841-12842.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12841-12842.diff	(revision 13394)
@@ -0,0 +1,313 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabFuncs.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabFuncs.py	(revision 12841)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabFuncs.py	(revision 12842)
+@@ -1,28 +1,47 @@
+-def strcmp(str1,str2):
++def strcmp(s1,s2):
+ 
+-	if str1 == str2:
++	if s1 == s2:
+ 		return True
+ 	else:
+ 		return False
+ 
+-def strncmp(str1,str2,n):
++def strncmp(s1,s2,n):
+ 
+-	if str1[0:n] == str2[0:n]:
++	if s1[0:n] == s2[0:n]:
+ 		return True
+ 	else:
+ 		return False
+ 
+-def strcmpi(str1,str2):
++def strcmpi(s1,s2):
+ 
+-	if str1.lower() == str2.lower():
++	if s1.lower() == s2.lower():
+ 		return True
+ 	else:
+ 		return False
+ 
+-def strncmpi(str1,str2,n):
++def strncmpi(s1,s2,n):
+ 
+-	if str1.lower()[0:n] == str2.lower()[0:n]:
++	if s1.lower()[0:n] == s2.lower()[0:n]:
+ 		return True
+ 	else:
+ 		return False
+ 
++def ismember(a,s):
++	import numpy
++
++	if not isinstance(s,(tuple,list,dict,numpy.ndarray)):
++		s=[s]
++
++	if not isinstance(a,(tuple,list,dict,numpy.ndarray)):
++		a=[a]
++
++	if not isinstance(a,numpy.ndarray):
++		b=[item in s for item in a]
++
++	else:
++		b=numpy.empty_like(a)
++		for i,item in enumerate(a.flat):
++			b.flat[i]=item in s
++
++	return b
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.py	(revision 12842)
+@@ -0,0 +1,150 @@
++import numpy
++import os
++from pairoptions import *
++from MatlabFuncs import *
++
++def checkfield(md,fieldname,*args):
++	"""
++	CHECKFIELD - check field consistency
++
++	    Used to check model consistency.
++	    Available options:
++	       - NaN: 1 if check that there is no NaN
++	       - size: [lines cols], NaN for non checked dimensions
++	       - >:  greater than provided value
++	       - >=: greater or equal to provided value
++	       - <:  smallerthan provided value
++	       - <=: smaller or equal to provided value
++	       - < vec:  smallerthan provided values on each vertex
++	       - forcing: 1 if check forcing consistency (size and time)
++	       - values: cell of strings or vector of acceptable values
++	       - numel: list of acceptable number of elements
++	       - cell: 1 if check that is cell
++	       - empty: 1 if check that non empty
++	       - message: overloaded error message
++
++	    Usage:
++	       md = checkfield(md,fieldname,options);
++
++	    Example:
++	       md = checkfield(md,'mesh.elementonbed','size',[md.mesh.numberofelements 1],'values',[0 1]);
++	       md = checkfield(md,'diagnostic.icefront','size',[NaN 4],'NaN',1);
++	       md = checkfield(md,'diagnostic.icefront(:,end)','values',[0 1 2]);
++	"""
++
++	#get options
++	options=pairoptions(*args)
++
++	#get field from model
++	field=getattr(md,fieldname)
++
++	#check empty
++	if 'empty' in options:
++		if not field:
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' is empty" % fieldname))
++
++	#Check size
++	if 'size' in options:
++		fieldsize=options.getfieldvalue('size')
++		if   numpy.isnan(fieldsize[0]):
++			if not numpy.size(field,1)==fieldsize[1]:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' should have %d columns" % (fieldname,fieldsize[1])))
++		elif numpy.isnan(fieldsize[1]):
++			if not numpy.size(field,0)==fieldsize[0]:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' should have %d lines" % (fieldname,fieldsize[0])))
++		else:
++			if (not numpy.size(field,0)==fieldsize[0]) or (not numpy.size(field,1)==fieldsize[1]):
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' size should be %d x %d" % (fieldname,fieldsize[0],fieldsize[1])))
++	
++	#Check numel
++	if 'numel' in options:
++		fieldnumel=options.getfieldvalue('numel')
++		if not numpy.size(field) in fieldnumel:
++			if   len(fieldnumel)==1:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' size should be %d" % (fieldname,fieldnumel)))
++			elif len(fieldnumel)==2:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' size should be %d or %d" % (fieldname,fieldnumel[0],fieldnumel[1])))
++			else:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' size should be %s" % (fieldname,fieldnumel)))
++
++	#check NaN
++	if options.getfieldvalue('NaN',0):
++		if True in numpy.isnan(field):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"NaN values found in field '%s'" % fieldname))
++
++	#check cell
++	if options.getfieldvalue('cell',0):
++		if not isinstance(field,(tuple,list,dict)):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should be a cell" % fieldname))
++
++	#check values
++	if 'values' in options:
++		fieldvalues=options.getfieldvalue('values')
++		if False in ismember(field,fieldvalues):
++			if   len(fieldvalues)==1:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' value should be '%s'"  % (fieldname,fieldvalues[0])))
++			elif len(fieldvalues)==2:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' values should be '%s' or '%s'"  % (fieldname,fieldvalues[0],fieldvalues[1])))
++			else:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' should have values in %s" % (fieldname,fieldvalues)))
++
++	#check greater
++	if '>=' in options:
++		lowerbound=options.getfieldvalue('>=')
++		if numpy.any(field<lowerbound):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should have values above %d" % (fieldname,lowerbound)))
++	if '>' in options:
++		lowerbound=options.getfieldvalue('>')
++		if numpy.any(field<=lowerbound):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should have values above %d" % (fieldname,lowerbound)))
++
++	#check smaller
++	if '<=' in options:
++		upperbound=options.getfieldvalue('<=')
++		if numpy.any(field>upperbound):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should have values below %d" % (fieldname,upperbound)))
++	if '<' in options:
++		upperbound=options.getfieldvalue('<')
++		if numpy.any(field>=upperbound):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should have values below %d" % (fieldname,upperbound)))
++
++	#check file
++	if options.getfieldvalue('file',0):
++		if not os.path.exists(field):
++			md = md.checkmessage("file provided in '%s': '%s' does not exist" % (fieldname,field))
++
++	#Check forcings (size and times)
++	if options.getfieldvalue('forcing',0):
++		if   numpy.size(field,0)==md.mesh.numberofvertices:
++			if not numpy.size(field,1)==1:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' should have only one column as there are md.mesh.numberofvertices lines" % fieldname))
++		elif numpy.size(field,0)==md.mesh.numberofvertices+1:
++			if not numpy.all(field[-1,:]==numpy.sort(field[-1,:])):
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' columns should be sorted chronologically" % fieldname))
++			if nump.any(field[-1,0:-1]==field[-1,1:]):
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' columns must not contain duplicate timesteps" % fieldname))
++		else:
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should have md.mesh.numberofvertices or md.mesh.numberofvertices+1 lines" % fieldname))
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.m	(revision 12841)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.m	(revision 12842)
+@@ -53,7 +53,7 @@
+ 				['field ''' fieldname ''' should have ' num2str(fieldsize(1)) ' lines']));
+ 		end
+ 	else
+-		if ((size(field)~=fieldsize(1)) |  (size(field,2)~=fieldsize(2)))
++		if ((size(field,1)~=fieldsize(1)) |  (size(field,2)~=fieldsize(2)))
+ 			md = checkmessage(md,getfieldvalue(options,'message',...
+ 				['field ''' fieldname ''' size should be ' num2str(fieldsize(1)) ' x ' num2str(fieldsize(2))]));
+ 		end
+@@ -86,7 +86,7 @@
+ 	end
+ end
+ 
+-%check NaN
++%check cell
+ if getfieldvalue(options,'cell',0);
+ 	if ~iscell(field),
+ 		md = checkmessage(md,getfieldvalue(options,'message',...
+@@ -98,35 +98,35 @@
+ if exist(options,'values')
+ 	fieldvalues=getfieldvalue(options,'values');
+ 	if iscell(fieldvalues), %strings
+-	if ischar(field) | iscell(fieldvalues),
+-		if any(~ismember(field,fieldvalues)),
+-			if length(fieldvalues)==1
+-				md = checkmessage(md,getfieldvalue(options,'message',...
+-					['field ''' fieldname ''' value should be ' fieldvalues{1} ]));
+-			elseif length(fieldvalues)==2
+-				md = checkmessage(md,getfieldvalue(options,'message',...
+-					['field ''' fieldname ''' values should be ' fieldvalues{1} ' or ' fieldvalues{2} ]));
+-			else
+-				md = checkmessage(md,getfieldvalue(options,'message',...
+-					['field ''' fieldname ''' should have values in ' sprintf('''%s'', ',fieldvalues{1:end-1}) 'or ''' fieldvalues{end} '''']));
++		if ischar(field) | iscell(fieldvalues),
++			if any(~ismember(field,fieldvalues)),
++				if length(fieldvalues)==1
++					md = checkmessage(md,getfieldvalue(options,'message',...
++						['field ''' fieldname ''' value should be ''' fieldvalues{1} '''']));
++				elseif length(fieldvalues)==2
++					md = checkmessage(md,getfieldvalue(options,'message',...
++						['field ''' fieldname ''' values should be ''' fieldvalues{1} ''' or ''' fieldvalues{2} '''']));
++				else
++					md = checkmessage(md,getfieldvalue(options,'message',...
++						['field ''' fieldname ''' should have values in ' sprintf('''%s'', ',fieldvalues{1:end-1}) 'or ''' fieldvalues{end} '''']));
++				end
+ 			end
++		else
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' should be one of the following strings: ' sprintf('''%s'', ',fieldvalues{1:end-1}) 'or ''' fieldvalues{end} '''']));
+ 		end
+ 	else
+-		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should be one of the following strings: ' sprintf('''%s'', ',fieldvalues{1:end-1}) 'or ''' fieldvalues{end} '''']));
+-	end
+-else
+-	field2=reshape(field,prod(size(field)),1);
+-	if isnumeric(field),
+-		if any(~ismember(field2,fieldvalues)),
++		field2=reshape(field,prod(size(field)),1);
++		if isnumeric(field),
++			if any(~ismember(field2,fieldvalues)),
++				md = checkmessage(md,getfieldvalue(options,'message',...
++					['field ''' fieldname ''' should have values in [' num2str(fieldvalues) ']']));
++			end
++		else
+ 			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' should have values in [' num2str(fieldvalues) ']']));
++				['field ''' fieldname ''' should be a number in [' num2str(fieldvalues) ']']));
+ 		end
+-	else
+-		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should be a number in [' num2str(fieldvalues) ']']));
+ 	end
+-	end
+ end
+ 
+ %check greater
+@@ -161,14 +161,14 @@
+ 	field2=reshape(field,prod(size(field)),1);
+ 	if any(field2>=upperbound),
+ 		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should have values below ' num2str(upperbound(1))]));
++			['field ''' fieldname ''' should have values below ' num2str(upperbound)]));
+ 	end
+ end
+ 
+ %check file
+ if getfieldvalue(options,'file',0),
+ 	if ~exist(field,'file')
+-		md = checkmessage(md,['file profided in ''' fieldname ''': ''' field ''' does not exist']);
++		md = checkmessage(md,['file provided in ''' fieldname ''': ''' field ''' does not exist']);
+ 	end
+ end
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12842-12843.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12842-12843.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12842-12843.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-greenplanet.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-greenplanet.sh	(revision 12842)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-greenplanet.sh	(revision 12843)
+@@ -1,4 +1,4 @@
+-#!/bin/csh
++#!/bin/sh
+ 
+ #PETSc 3.2
+ #MPI /sopt/mpi/openmpi-1.5.4_psm/intel
Index: /issm/oecreview/Archive/12678-13393/ISSM-12843-12844.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12843-12844.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12843-12844.diff	(revision 13394)
@@ -0,0 +1,139 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/greenplanet.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/greenplanet.m	(revision 12843)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/greenplanet.m	(revision 12844)
+@@ -62,7 +62,7 @@
+ 
+ 		 end
+ 		 %}}}
+-		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+ 			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+@@ -80,7 +80,7 @@
+ 			 fprintf(fid,'#PBS -M mmorligh@uci.edu\n');
+ 			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+ 			 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,md.private.runtimename);
++			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+ 			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+ 			 if ~io_gather, %concatenate the output files:
+ 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/gemini.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/gemini.m	(revision 12843)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/gemini.m	(revision 12844)
+@@ -45,7 +45,7 @@
+ 			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+ 		 end
+ 		 %}}}
+-		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+ 			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12843)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12844)
+@@ -69,7 +69,7 @@
+ 		return md
+ 	# }}}
+ 
+-	def BuildQueueScript(self,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
++	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
+ 
+ 		#write queuing script 
+ 		if not 'Windows' in platform.system():
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 12843)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 12844)
+@@ -95,7 +95,7 @@
+ 
+ 		 end
+ 		 %}}}
+-		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/castor.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/castor.m	(revision 12843)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/castor.m	(revision 12844)
+@@ -45,7 +45,7 @@
+ 			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+ 		 end
+ 		 %}}}
+-		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+ 			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 12843)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 12844)
+@@ -58,7 +58,7 @@
+ 			end
+ 		end
+ 		%}}}
+-		function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			%write queuing script 
+ 			if ~ispc,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/discover.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/discover.m	(revision 12843)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/discover.m	(revision 12844)
+@@ -86,7 +86,7 @@
+ 
+ 		 end
+ 		 %}}}
+-		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m	(revision 12843)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m	(revision 12844)
+@@ -55,7 +55,7 @@
+ 			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+ 		 end
+ 		 %}}}
+-		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+ 			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/cosmos.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/cosmos.m	(revision 12843)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/cosmos.m	(revision 12844)
+@@ -45,7 +45,7 @@
+ 			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+ 		 end
+ 		 %}}}
+-		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+ 			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pollux.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pollux.m	(revision 12843)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pollux.m	(revision 12844)
+@@ -45,7 +45,7 @@
+ 			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+ 		 end
+ 		 %}}}
+-		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+ 			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
Index: /issm/oecreview/Archive/12678-13393/ISSM-12844-12845.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12844-12845.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12844-12845.diff	(revision 13394)
@@ -0,0 +1,26 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12844)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12845)
+@@ -71,7 +71,7 @@
+ 	#Wite all input files
+ 	marshall(md)                                           # bin file
+ 	md.solver.PetscFile(md.miscellaneous.name+'.petsc')    # petsc file
+-	cluster.BuildQueueScript(md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
++	cluster.BuildQueueScript(md.miscellaneous.name,md.private.runtimename,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
+ 
+ 	#we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+ 	if not ispetsc:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.m	(revision 12844)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.m	(revision 12845)
+@@ -70,7 +70,7 @@
+ %Wite all input files
+ marshall(md);                                          % bin file
+ PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file
+-BuildQueueScript(cluster,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); % queue file
++BuildQueueScript(cluster,md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); % queue file
+ 
+ %we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+ if ~ispetsc,
Index: /issm/oecreview/Archive/12678-13393/ISSM-12845-12846.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12845-12846.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12845-12846.diff	(revision 13394)
@@ -0,0 +1,182 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android_aux.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android_aux.sh	(revision 12845)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android_aux.sh	(revision 12846)
+@@ -21,7 +21,7 @@
+     if [[ "$arg" =~ --step=([0-9])* ]]; then
+         step=${BASH_REMATCH[1]}; 
+         echo "Setting step to: " $step
+-    elif [[ "$arg" =~ -j=([0-9])* ]]; then
++    elif [[ "$arg" =~ -j=([1-9]+[0-9]*) || "$arg" =~ ([1-9]+[0-9]*) ]]; then
+         j=${BASH_REMATCH[1]}; 
+         echo "Number of jobs set to: " $j
+     else
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh	(revision 12845)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh	(revision 12846)
+@@ -1,17 +1,19 @@
+ #!/bin/bash
+ 
+ #Some cleanup
+-rm -rf install libtool-2.2.6b src
++rm -rf install libtool[\w.- ]* src
+ mkdir install
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool-2.2.6b.tar.gz' 'libtool-2.2.6b.tar.gz'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool' 'libtool'
+ 
+ #Untar 
+-tar -zxvf  libtool-2.2.6b.tar.gz
++tar -zxvf  libtool[\w.-]*.tar.gz
++rm libtool[\w.-]*.tar.gz
+ 
++
+ #Move libtool into src directory
+-mv libtool-2.2.6b src
++mv libtool[\w.-]* src
+ 
+ #Compile libtool
+ cd src 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh	(revision 12845)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh	(revision 12846)
+@@ -23,7 +23,7 @@
+ if [[ $step == "2" || $step == "0" ]]; then
+     cd src
+     
+-    autoreconf -iv --force -I "$ISSM_DIR/m4/"
++    autoreconf -iv --force -I $LIBTOOL_DIR/share/aclocal/ 
+ 
+     ./configure \
+         --build="i386-apple-darwin10.8.0" \
+@@ -34,9 +34,9 @@
+ #Compile gsl
+ if [[ $step == "3" || $step == "0" ]]; then
+     if [ -z $1 ]; then
+-	    make 12
++	    make $j 
+     else
+-	    make -j 12
++	    make -j $j 
+     fi
+ 
+     make install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/configs/android/configure.make
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/configs/android/configure.make	(revision 12845)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/configs/android/configure.make	(revision 12846)
+@@ -1,13 +1,16 @@
+ # This makefile configures build process to cross-compile to the android platform.
+-# The binary tools referenced below are specifically configuered to target armeabi-v7a.
++# The binary tools referenced below are specifically configured to target armeabi-v7a.
+ # Furthermore, the compilers (which are simply wrappers around GNU GCC) are set to
+-# produce binaries that are EABI complient.
++# produce binaries that are EABI compliant.
+ #
+ # Note that the AAPCS standard defines 'EABI' as a moniker used to specify
+ # a _family_ of similar but distinct ABIs. Android follows the little-endian
+ # ARM GNU/Linux ABI as documented in the following document:
+ #
+ # http://www.codesourcery.com/gnu_toolchains/arm/arm_gnu_linux_abi.pdf
++
++source $ANDROID_DIR/android_aux.sh
++
+ CC=${toolchain_path}-gcc
+ AR=${toolchain_path}-ar
+ RANLIB=${toolchain_path}-ranlib
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/DownloadExternalPackage.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/DownloadExternalPackage.py	(revision 12845)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/DownloadExternalPackage.py	(revision 12846)
+@@ -1,37 +1,61 @@
+ #!/usr/bin/env python
+ # -*- coding: ISO-8859-1 -*-
+ 
+-import os,sys
++import os,sys,re
+ import urllib
++from HTMLParser import HTMLParser
++from urllib import FancyURLopener
+ 
+-#Check inputs
+-if(len(sys.argv)!=3): raise NameError('usage: ./DownloadExternalPackage.py URL localfile')
++# Start class myHTMLParser
++class MyHTMLParser(HTMLParser):
+ 
+-url=sys.argv[1];
++    def __init__(self, pattern):
++        HTMLParser.__init__(self)
++        self.matcher = re.compile(pattern) 
++        self.targets = []
++
++    def handle_starttag(self, tag, attrs):
++        for i in attrs:
++            if "href" == i[0] and str(self.matcher.match(i[1])) != "None":
++                self.targets.append(i[1])
++# End class myHTMLParser
++
++pivot = sys.argv[1].rfind("/")
++url = (sys.argv[1])[:pivot]
+ localFile=sys.argv[2]
+ 
+-#Remove file if it already exists
+-if os.path.exists(localFile):
+-	print "File "+ localFile +" already exists and will not be downloaded..."
+-	sys.exit()
++pivot += 1;
++find = (sys.argv[1])[pivot:];
++print "Looking for " + find
++pattern = find + "[\w.-]*(\.tar\.gz|tar\.gz2|tgz|zip|exe)?"
++parser = MyHTMLParser(pattern)
+ 
+-#Try to download from url
+-httpfail=-1
+-try:
+-	print "Fetching %s" % localFile
+-	urllib.urlretrieve(url,localFile)
+-	httpfail=0
+-except Exception, e:
+-	httpfail=1
++urlObject = FancyURLopener()
++obj = urlObject.open(url)
++parser.feed(obj.read())
+ 
+-#Error message in case it failed
+-if (httpfail):
+-	failureMessage = '''
+-===========================================================================
+-Unable to download package %s from: %s
+-* If URL specified manually - perhaps there is a typo?
+-* If your network is disconnected - please reconnect 
+-* Alternatively, you can download the above URL manually
+-===========================================================================
+-''' % (localFile,url)
+-	raise RuntimeError(failureMessage)
++if len(parser.targets) > 1:
++    print "Could not resolve your download due to the number of hits."
++    print "Refine your search."
++    for i in parser.targets:
++        print i
++
++elif len(parser.targets) == 1:
++    url += "/" + parser.targets[0]
++    if os.path.exists(localFile): 
++        print "File "+ localFile +" already exists and will not be downloaded..."
++    elif parser.targets[0] == localFile:
++        urllib.urlretrieve(url, localFile)
++        print "Found: " + parser.targets[0]
++    elif parser.matcher.match(localFile) != "None":
++        urllib.urlretrieve(url,parser.targets[0]);
++        print "Found: " + parser.targets[0]
++    else:
++        urllib.urlretrieve(url, parser.targets[0]);
++        print "WARNING: the file found \'" + parser.targets[0] + "\' does not match \'" + localFile + "\'"
++        print "Ensure the downloaded version is suitable."
++
++else:
++    print "No matches found!"
++
++obj.close()
Index: /issm/oecreview/Archive/12678-13393/ISSM-12846-12847.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12846-12847.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12846-12847.diff	(revision 13394)
@@ -0,0 +1,14 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 12846)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 12847)
+@@ -12,7 +12,8 @@
+ #endif 
+ 
+ 
+-#include "../../objects/objects.h"
++//#include "../../objects/objects.h"
++#include "../../classes/classes.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12847-12848.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12847-12848.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12847-12848.diff	(revision 13394)
@@ -0,0 +1,24 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py	(revision 12847)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py	(revision 12848)
+@@ -17,12 +17,17 @@
+ 
+ #Initial velocity 
+ mat=matio.loadmat('../Data/SquareShelfConstrained.data')
++#Reshape as Rank-1 arrays
++x=reshape(mat['x'],(size(mat['x']),))
++y=reshape(mat['y'],(size(mat['y']),))
++vx=mat['vx']
++vy=mat['vy']
+ #deal with 'F' oriented matlab matrices!
+ index=mat['index'].astype(float)
+ index=reshape(index.T,(len(index),3),order='F')
+ 
+-md.initialization.vx = im.InterpFromMeshToMesh2d(index, mat['x'], mat['y'], mat['vx'], md.mesh.x, md.mesh.y)
+-md.initialization.vy = im.InterpFromMeshToMesh2d(index, mat['x'], mat['y'], mat['vy'], md.mesh.x, md.mesh.y)
++md.initialization.vx = im.InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
++md.initialization.vy = im.InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
+ md.initialization.vz = zeros(md.mesh.numberofvertices)
+ md.initialization.pressure = zeros(md.mesh.numberofvertices)
+ #Materials
Index: /issm/oecreview/Archive/12678-13393/ISSM-12848-12849.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12848-12849.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12848-12849.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 12848)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 12849)
+@@ -12,7 +12,6 @@
+ #endif 
+ 
+ 
+-//#include "../../objects/objects.h"
+ #include "../../classes/classes.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
Index: /issm/oecreview/Archive/12678-13393/ISSM-12849-12850.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12849-12850.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12849-12850.diff	(revision 13394)
@@ -0,0 +1,2583 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 12850)
+@@ -24,171 +24,180 @@
+ /*FUNCTION Vector::Vector(){{{*/
+ Vector::Vector(){
+ 
+-	#ifdef _HAVE_PETSC_
+-	this->vector=NULL;
+-	#else
+-	this->vector=NULL;
++	this->pvector=NULL;
++	this->svector=NULL;
++	
++	type=PetscVecType; //default
++	#ifndef _HAVE_PETSC_
++	type=SeqVecType;
+ 	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->avector=NULL;
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Vector(int M,bool fromlocalsize){{{*/
+-Vector::Vector(int pM,bool fromlocalsize){
+ 
+-	#ifdef _HAVE_PETSC_
+-	this->vector=NewVec(pM,fromlocalsize);
+-	#else
+-	this->vector=new SeqVec(pM,fromlocalsize);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->avector=xNew<IssmDouble>(pM);
+-	#endif
+ }
+ /*}}}*/
+-/*FUNCTION Vector::Vector(IssmDouble* serial_vec,int M){{{*/
+-Vector::Vector(IssmDouble* serial_vec,int M){
++/*FUNCTION Vector::Vector(int M,bool fromlocalsize,int type){{{*/
++Vector::Vector(int M,bool fromlocalsize,int in_type){
++	
++	pvector=NULL;
++	svector=NULL;
++	type=in_type;
+ 
+-	#ifdef _HAVE_PETSC_
+-		int* idxm=xNew<int>(M);
+-		for(int i=0;i<M;i++) idxm[i]=i;
+ 
+-		this->vector=NewVec(M);
+-		VecSetValues(this->vector,M,idxm,serial_vec,INSERT_VALUES);
+-		VecAssemblyBegin(this->vector);
+-		VecAssemblyEnd(this->vector);
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector=new PetscVec(M,fromlocalsize);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector=new SeqVec(M,fromlocalsize);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
+ 
+-		xDelete<int>(idxm);
+-	#else
+-		this->vector=new SeqVec(serial_vec,M);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-		this->avector=xNew<IssmDouble>(M);
+-	#endif
+ }
+ /*}}}*/
+-#ifdef _HAVE_PETSC_
+-/*FUNCTION Vector::Vector(Vec petsc_vec){{{*/
+-Vector::Vector(Vec petsc_vec){
++/*FUNCTION Vector::Vector(IssmDouble* serial_vec,int M,int type){{{*/
++Vector::Vector(IssmDouble* serial_vec,int M,int in_type){
+ 
+-	if(petsc_vec==NULL){
+-		this->vector=NewVec(0);
++	pvector=NULL;
++	svector=NULL;
++	type=in_type;
++
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector=new PetscVec(serial_vec,M);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
+ 	}
+-	else{
+-		/*copy vector*/
+-		VecDuplicate(petsc_vec,&this->vector);
+-		VecCopy(petsc_vec,this->vector);
++	else if(type==SeqVecType){
++		this->svector=new SeqVec(serial_vec,M);
+ 	}
++	else _error2_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+-#endif
+-#if defined(_HAVE_GSL_) && !defined(_HAVE_PETSC_)
+-/*FUNCTION Vector::Vector(SeqVec* seq_vec){{{*/
+-Vector::Vector(SeqVec*  seq_vec){
++/*FUNCTION Vector::~Vector(){{{*/
++Vector::~Vector(){
+ 
+-	if(seq_vec==NULL){
+-		this->vector=NULL;
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		delete this->pvector;
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
+ 	}
+-	else{
+-		/*copy vector*/
+-		this->vector=seq_vec->Duplicate();
++	else if(type==SeqVecType){
++		delete this->svector;
+ 	}
++	else _error2_("Vector type: " << type << " not supported yet!");
+ }
+ /*}}}*/
+-#endif
+ 
+-		/*FUNCTION Vector::~Vector(){{{*/
+-Vector::~Vector(){
+-
+- 	#ifdef _HAVE_PETSC_
+-	VecFree(&this->vector);
+-	#else
+-	delete this->vector;
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	xDelete<IssmDouble>(this->avector);
+-	#endif
+-}
+-/*}}}*/
+-
+ /*Vector specific routines: */
+ /*FUNCTION Vector::Echo{{{*/
+ void Vector::Echo(void){
+ 
+-	int i;
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->Echo();
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->Echo();
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
+ 
+-	#ifdef _HAVE_PETSC_
+-	_assert_(this->vector);
+-	VecView(this->vector,PETSC_VIEWER_STDOUT_WORLD);
+-	#else
+-	this->vector->Echo();
+-	#endif
+-
+-	#ifdef _HAVE_ADOLC_
+-	/*do nothing for now: */
+-	#endif
+ }
+ /*}}}*/
+ /*FUNCTION Vector::Assemble{{{*/
+ void Vector::Assemble(void){
+-		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecAssemblyBegin(this->vector); 
+-		VecAssemblyEnd(this->vector);
+-	#else
+-		this->vector->Assemble();
+-	#endif
+ 
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->Assemble();
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->Assemble();
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+ /*FUNCTION Vector::SetValues{{{*/
+ void Vector::SetValues(int ssize, int* list, IssmDouble* values, InsMode mode){
+ 		
++
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->SetValues(ssize,list,values,mode);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->SetValues(ssize,list,values,mode);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
+ 		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecSetValues(this->vector,ssize,list,values,ISSMToPetscInsertMode(mode));
+-	#else
+-		this->vector->SetValues(ssize,list,values,mode);
+-	#endif
+ 
+ }
+ /*}}}*/
+ /*FUNCTION Vector::SetValue{{{*/
+ void Vector::SetValue(int dof, IssmDouble value, InsMode mode){
+-		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecSetValues(this->vector,1,&dof,&value,ISSMToPetscInsertMode(mode));
+-	#else
+-		this->vector->SetValue(dof,value,mode);
+-	#endif
++	
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->SetValue(dof,value,mode);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->SetValue(dof,value,mode);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION Vector::GetValue{{{*/
+ void Vector::GetValue(IssmDouble* pvalue,int dof){
+ 		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecGetValues(this->vector,1,&dof,pvalue);
+-	#else
+-	this->vector->GetValue(pvalue,dof);
+-	#endif
++
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->GetValue(pvalue,dof);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->GetValue(pvalue,dof);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+ /*FUNCTION Vector::GetSize{{{*/
+ void Vector::GetSize(int* pM){
+-		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecGetSize(this->vector,pM);
+-	#else
+-		this->vector->GetSize(pM);
+-	#endif
++	
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->GetSize(pM);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->GetSize(pM);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -197,7 +206,6 @@
+ 
+ 	int M;
+ 
+-	_assert_(this->vector);
+ 	this->GetSize(&M);
+ 
+ 	if(M==0) 
+@@ -209,29 +217,41 @@
+ /*FUNCTION Vector::GetLocalSize{{{*/
+ void Vector::GetLocalSize(int* pM){
+ 		
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecGetLocalSize(this->vector,pM);
+-	#else
+-		this->vector->GetLocalSize(pM);
+-	#endif
+ 
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->GetLocalSize(pM);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->GetLocalSize(pM);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+ /*FUNCTION Vector::Duplicate{{{*/
+ Vector* Vector::Duplicate(void){
+ 	
+ 	Vector* output=NULL;
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		Vec vec_output=NULL;
+-		VecDuplicate(this->vector,&vec_output);
+-		output=new Vector(vec_output);
+-		VecFree(&vec_output);
+-	#else
++
++
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
+ 		output=new Vector();
+-		output->vector=this->vector->Duplicate();
+-	#endif
++		output->pvector=this->pvector->Duplicate();
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		output=new Vector();
++		output->svector=this->svector->Duplicate();
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
+ 	return output;
+ 
+ }
+@@ -239,36 +259,56 @@
+ /*FUNCTION Vector::Set{{{*/
+ void Vector::Set(IssmDouble value){
+ 	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecSet(this->vector,value);
+-	#else
+-		this->vector->Set(value);
+-	#endif
++	
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->Set(value);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->Set(value);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION Vector::AXPY{{{*/
+ void Vector::AXPY(Vector* X, IssmDouble a){
+ 	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecAXPY(this->vector,a,X->vector);
+-	#else
+-		this->vector->AXPY(X->vector,a);
+-	#endif
++
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->AXPY(X->pvector,a);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->AXPY(X->svector,a);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+ /*FUNCTION Vector::AYPX{{{*/
+ void Vector::AYPX(Vector* X, IssmDouble a){
+ 	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecAYPX(this->vector,a,X->vector);
+-	#else
+-		this->vector->AYPX(X->vector,a);
+-	#endif
+ 
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->AYPX(X->pvector,a);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->AYPX(X->svector,a);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
++
+ }
+ /*}}}*/
+ /*FUNCTION Vector::ToMPISerial{{{*/
+@@ -276,11 +316,17 @@
+ 
+ 	IssmDouble* vec_serial=NULL;
+ 
+-	#ifdef _HAVE_PETSC_
+-		VecToMPISerial(&vec_serial, this->vector);
+-	#else
+-		vec_serial=this->vector->ToMPISerial();
+-	#endif
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		vec_serial=this->pvector->ToMPISerial();
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		vec_serial=this->svector->ToMPISerial();
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
+ 
+ 	return vec_serial;
+ 
+@@ -289,59 +335,95 @@
+ /*FUNCTION Vector::Copy{{{*/
+ void Vector::Copy(Vector* to){
+ 
+-	#ifdef _HAVE_PETSC_
+-		if(this->vector) VecCopy(this->vector,to->vector);
+-	#else
+-		this->vector->Copy(to->vector);
+-	#endif
++	
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->Copy(to->pvector);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->Copy(to->svector);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
+ 
++
+ }
+ /*}}}*/
+ /*FUNCTION Vector::Norm{{{*/
+ IssmDouble Vector::Norm(NormMode norm_type){
+ 	
+ 	IssmDouble norm=0;
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecNorm(this->vector,ISSMToPetscNormMode(norm_type),&norm);
+-	#else
+-		norm=this->vector->Norm(norm_type);
+-	#endif
++
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		norm=this->pvector->Norm(norm_type);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		norm=this->svector->Norm(norm_type);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
+ 	return norm;
+ }
+ /*}}}*/
+ /*FUNCTION Vector::Scale{{{*/
+ void Vector::Scale(IssmDouble scale_factor){
+ 	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecScale(this->vector,scale_factor); 
+-	#else
+-		this->vector->Scale(scale_factor);
+-	#endif
++
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->Scale(scale_factor);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->Scale(scale_factor);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+ /*FUNCTION Vector::Dot{{{*/
+ IssmDouble Vector::Dot(Vector* vector){
+ 
+ 	IssmDouble dot;
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecDot(this->vector,vector->vector,&dot);
+-	#else
+-		dot=this->vector->Dot(vector->vector);
+-	#endif
++	
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		dot=this->pvector->Dot(vector->pvector);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		dot=this->svector->Dot(vector->svector);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
+ 	return dot;
+ }
+ /*}}}*/
+ /*FUNCTION Vector::PointwiseDivide{{{*/
+ void Vector::PointwiseDivide(Vector* x,Vector* y){
+ 
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->vector);
+-		VecPointwiseDivide(this->vector,x->vector,y->vector);
+-	#else
+-		this->vector->PointwiseDivide(x->vector,y->vector);
+-	#endif
++
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->PointwiseDivide(x->pvector,y->pvector);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqVecType){
++		this->svector->PointwiseDivide(x->svector,y->svector);
++	}
++	else _error2_("Vector type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12850)
+@@ -25,93 +25,114 @@
+ /*FUNCTION Matrix::Matrix(){{{*/
+ Matrix::Matrix(){
+ 
+-	#ifdef _HAVE_PETSC_
+-	this->matrix=NULL;
+-	#else
+-	this->matrix=NULL;
++	pmatrix=NULL;
++	smatrix=NULL;
++
++	type=PetscMatType; //default
++	#ifndef _HAVE_PETSC_
++	type=SeqMatType;
+ 	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->amatrix=NULL;
+-	#endif
++	
+ }
+ /*}}}*/
+-/*FUNCTION Matrix::Matrix(int M,int N){{{*/
+-Matrix::Matrix(int M,int N){
++/*FUNCTION Matrix::Matrix(int M,int N,int type){{{*/
++Matrix::Matrix(int M,int N,int in_type){
+ 
+-	#ifdef _HAVE_PETSC_
+-	this->matrix=NewMat(M,N);
+-	#else
+-	this->matrix=new SeqMat(M,N);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->amatrix=xNew<IssmDouble>(M*N);
+-	#endif
++	pmatrix=NULL;
++	smatrix=NULL;
++	type=in_type;
++
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix=new PetscMat(M,N);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		this->smatrix=new SeqMat(M,N);
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+-/*FUNCTION Matrix::Matrix(int M,int N,IssmDouble sparsity){{{*/
+-Matrix::Matrix(int M,int N,IssmDouble sparsity){
++/*FUNCTION Matrix::Matrix(int M,int N,IssmDouble sparsity,int type){{{*/
++Matrix::Matrix(int M,int N,IssmDouble sparsity,int in_type){
+ 
+-	#ifdef _HAVE_PETSC_
+-	this->matrix=NewMat(M,N,sparsity);
+-	#else
+-	this->matrix=new SeqMat(M,N,sparsity);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+- 	this->amatrix=xNew<IssmDouble>(M*N);
+-	#endif
++	pmatrix=NULL;
++	smatrix=NULL;
++	type=in_type;
++
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix=new PetscMat(M,N,sparsity);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		this->smatrix=new SeqMat(M,N,sparsity);
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
+ }
+ /*}}}*/
+-/*FUNCTION Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity){{{*/
+-Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity){
++/*FUNCTION Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int type){{{*/
++Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int in_type){
+ 
+-	#ifdef _HAVE_PETSC_
+-	int     i;
++	pmatrix=NULL;
++	smatrix=NULL;
++	type=in_type;
+ 
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix=new PetscMat(serial_mat,M,N,sparsity);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		this->smatrix=new SeqMat(serial_mat,M,N,sparsity);
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
++	
++}
++/*}}}*/
++/*FUNCTION Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode,int type){{{*/
++Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type){
+ 
+-	int* idxm=xNew<int>(M);
+-	int* idxn=xNew<int>(N);
+-	for(i=0;i<M;i++)idxm[i]=i;
+-	for(i=0;i<N;i++)idxn[i]=i;
++	pmatrix=NULL;
++	smatrix=NULL;
++	type=in_type;
+ 
+-	this->matrix=NewMat(M,N,sparsity);
+-	MatSetValues(this->matrix,M,idxm,N,idxn,serial_mat,INSERT_VALUES);
+-	MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
+-	MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
+-
+-	xDelete<int>(idxm);
+-	xDelete<int>(idxn);
+-	#else
+-	this->matrix=new SeqMat(serial_mat,M,N,sparsity);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->amatrix=xNew<IssmDouble>(M*N);
+-	#endif
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode){{{*/
+-Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode){
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix=new PetscMat(M,N,connectivity,numberofdofspernode);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		this->smatrix=new SeqMat(M,N,connectivity,numberofdofspernode);
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
+ 	
+-	#ifdef _HAVE_PETSC_
+-	this->matrix=NewMat(M,N,connectivity,numberofdofspernode);
+-	#else
+-	this->matrix=new SeqMat(M,N,connectivity,numberofdofspernode);
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	this->amatrix=xNew<IssmDouble>(M*N);
+-	#endif
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::~Matrix(){{{*/
+ Matrix::~Matrix(){
+ 
+- 	#ifdef _HAVE_PETSC_
+-	MatFree(&this->matrix);
+-	#else
+-	delete this->matrix;
+-	#endif
+-	#ifdef _HAVE_ADOLC_
+-	xDelete<IssmDouble>(this->amatrix);
+-	#endif
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		delete this->pmatrix;
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		delete this->smatrix;
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+ 
+@@ -119,86 +140,105 @@
+ /*FUNCTION Matrix::Echo{{{*/
+ void Matrix::Echo(void){
+ 
+-	int i,j;
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix->Echo();
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		this->smatrix->Echo();
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
+ 
+-	#ifdef _HAVE_PETSC_
+-	MatView(this->matrix,PETSC_VIEWER_STDOUT_WORLD);
+-	#else
+-	this->matrix->Echo();
+-	#endif
+-
+-	#ifdef _HAVE_ADOLC_
+-	/*Not sure about that one. Should we use the overloaded operator >>?*/
+-	_printString_("ADOLC Matrix equivalent:" );
+-//	for(i=0;i<M;i++){
+-//		for(j=0;j<N;j++){
+-//			_printString_(*(amatrix+N*i+j) << " ");
+-//		}
+-//		_printLine_("");
+-//	}
+-	#endif
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::Assemble{{{*/
+ void Matrix::Assemble(void){
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
+-		MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
+-		#if _PETSC_MAJOR_ == 2 
+-			MatCompress(this->matrix);
++
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix->Assemble();
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+-	#else
+-		this->matrix->Assemble();
+-	#endif
+-
++	}
++	else if(type==SeqMatType){
++		this->smatrix->Assemble();
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::Norm{{{*/
+ IssmDouble Matrix::Norm(NormMode norm_type){
+ 	
+ 	IssmDouble norm=0;
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		MatNorm(this->matrix,ISSMToPetscNormMode(norm_type),&norm);
+-	#else
+-		norm=this->matrix->Norm(norm_type);
+-	#endif
++
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		norm=this->pmatrix->Norm(norm_type);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		norm=this->smatrix->Norm(norm_type);
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
++
+ 	return norm;
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::GetSize{{{*/
+ void Matrix::GetSize(int* pM,int* pN){
++
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix->GetSize(pM,pN);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		this->smatrix->GetSize(pM,pN);
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
+ 	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		MatGetSize(this->matrix,pM,pN);
+-	#else
+-		this->matrix->GetSize(pM,pN);
+-	#endif
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::GetLocalSize{{{*/
+ void Matrix::GetLocalSize(int* pM,int* pN){
+ 	
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		MatGetLocalSize(this->matrix,pM,pN);
+-	#else
+-		this->matrix->GetLocalSize(pM,pN);
+-	#endif
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix->GetLocalSize(pM,pN);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		this->smatrix->GetLocalSize(pM,pN);
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::MatMult{{{*/
+ void Matrix::MatMult(Vector* X,Vector* AX){
+ 
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		_assert_(X->vector);
+-		MatMultPatch(this->matrix,X->vector,AX->vector);
+-	#else
+-		this->matrix->MatMult(X->vector,AX->vector);
+-	#endif
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix->MatMult(X->pvector,AX->pvector);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		this->smatrix->MatMult(X->svector,AX->svector);
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::Duplicate{{{*/
+@@ -208,12 +248,17 @@
+ 
+ 	output=new Matrix();
+ 
+-	#ifdef _HAVE_PETSC_
+-		_assert_(this->matrix);
+-		MatDuplicate(this->matrix,MAT_COPY_VALUES,&output->matrix);
+-	#else
+-		output->matrix=this->matrix->Duplicate();
+-	#endif
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		output->pmatrix=this->pmatrix->Duplicate();
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		output->smatrix=this->smatrix->Duplicate();
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
+ 	
+ 	return output;
+ }
+@@ -222,32 +267,53 @@
+ IssmDouble* Matrix::ToSerial(void){
+ 
+ 	IssmDouble* output=NULL;
++	
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		output=this->pmatrix->ToSerial();
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		output=this->smatrix->ToSerial();
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
+ 
+-	#ifdef _HAVE_PETSC_
+-		MatToSerial(&output,this->matrix);
+-	#else
+-		output=this->matrix->ToSerial();
+-	#endif
++
+ 	return output;
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::SetValues{{{*/
+ void Matrix::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){
+-
+-	#ifdef _HAVE_PETSC_
+-		MatSetValues(this->matrix,m,idxm,n,idxn,values,ISSMToPetscInsertMode(mode));
+-	#else
+-		this->matrix->SetValues(m,idxm,n,idxn,values,mode);
+-	#endif
++		
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix->SetValues(m,idxm,n,idxn,values,mode);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		this->smatrix->SetValues(m,idxm,n,idxn,values,mode);
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::Convert{{{*/
+ void Matrix::Convert(MatrixType type){
+ 
+-	#ifdef _HAVE_PETSC_
+-		MatConvert(this->matrix,ISSMToPetscMatrixType(type),MAT_REUSE_MATRIX,&this->matrix);
+-	#else
+-		this->matrix->Convert(type);
+-	#endif
++	if(type==PetscMatType){
++		#ifdef _HAVE_PETSC_
++		this->pmatrix->Convert(type);
++		#else
++		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		#endif
++	}
++	else if(type==SeqMatType){
++		this->smatrix->Convert(type);
++	}
++	else _error2_("Matrix type: " << type << " not supported yet!");
++
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 12850)
+@@ -18,33 +18,27 @@
+ 
+ /*}}}*/
+ 
++enum vectortype { PetscVecType, SeqVecType };
++
+ class Vector{
+ 
+ 	public:
+-	
++
+ 		#ifdef _HAVE_PETSC_
+-			Vec vector; 
+-		#else
+-			SeqVec* vector;
++		PetscVec* pvector;
+ 		#endif
+-		#ifdef _HAVE_ADOLC_
+-			IssmDouble* avector;
+-		#endif
++		SeqVec* svector; 
++		int     type;
++	
+ 
+ 		/*Vector constructors, destructors {{{*/
+ 		Vector();
+-		Vector(int M,bool fromlocalsize=false);
+-		Vector(IssmDouble* serial_vec,int pM);
+-		#ifdef _HAVE_PETSC_
+-		Vector(Vec petsc_vec);
+-		#endif
+-		#if defined(_HAVE_GSL_) && !defined(_HAVE_PETSC_)
+-		Vector(SeqVec*  seq_vec);
+-		#endif
++		Vector(int M,bool fromlocalsize=false,int type=PetscVecType);
++		Vector(IssmDouble* serial_vec,int pM,int type=PetscVecType);
+ 		~Vector();
+ 		/*}}}*/
+ 		/*Vector specific routines {{{*/
+-		void Echo(void);
++		void    Echo(void);
+ 		void    AXPY(Vector *X, IssmDouble a);
+ 		void    AYPX(Vector *X, IssmDouble a);
+ 		void    Assemble(void);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 12850)
+@@ -17,28 +17,26 @@
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+ class Vector;
+-
+ /*}}}*/
+ 
++enum matrixtype { PetscMatType, SeqMatType };
++
+ class Matrix{
+ 
+ 	public:
+-	
++
+ 		#ifdef _HAVE_PETSC_
+-		Mat matrix; 
+-		#else
+-		SeqMat* matrix; 
++		PetscMat* pmatrix;
+ 		#endif
+-		#ifdef _HAVE_ADOLC_
+-		IssmDouble* amatrix;
+-		#endif
++		SeqMat* smatrix; 
++		int     type;
+ 
+ 		/*Matrix constructors, destructors {{{*/
+ 		Matrix();
+-		Matrix(int M,int N);
+-		Matrix(int M,int N,IssmDouble sparsity);
+-		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity);
+-		Matrix(int M,int N,int connectivity,int numberofdofspernode);
++		Matrix(int M,int N,int type=PetscMatType);
++		Matrix(int M,int N,IssmDouble sparsity,int type=PetscMatType);
++		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=PetscMatType);
++		Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=PetscMatType);
+ 		~Matrix();
+ 		/*}}}*/
+ 		/*Matrix specific routines {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToPetscVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToPetscVector.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToPetscVector.cpp	(revision 12850)
+@@ -1,98 +0,0 @@
+-/* \file MatlabVectorToPetscVector.cpp
+- * \brief: convert a sparse or dense matlab vector to a serial Petsc vector:
+- */
+-
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-/*Petsc includes: */
+-#include "petscmat.h"
+-#include "petscvec.h"
+-#include "petscksp.h"
+-
+-/*Matlab includes: */
+-#include "mex.h"
+-
+-#include "../../shared/shared.h"
+-
+-int MatlabVectorToPetscVector(Vec* pvector,int* pvector_rows,const mxArray* mxvector){
+-
+-	int rows, cols;
+-	double* mxvector_ptr=NULL;
+-	int ierr;
+-	int i,j;
+-
+-	/*output: */
+-	Vec vector=NULL;
+-
+-	/*matlab indices: */
+-	mwIndex*    ir=NULL;
+-	mwIndex*    jc=NULL;
+-	double* pr=NULL;
+-	int     count;
+-	int     nnz;
+-	int     nz;
+-
+-	/*petsc indices: */
+-	int* idxm=NULL;
+-	
+-	/*Ok, first check if we are dealing with a sparse or full vector: */
+-	if (mxIsSparse(mxvector)){
+-
+-		/*Dealing with sparse vector: recover size first: */
+-		mxvector_ptr=(double*)mxGetPr(mxvector);
+-		rows=mxGetM(mxvector);
+-		cols=mxGetN(mxvector);
+-		nnz=mxGetNzmax(mxvector);
+-		nz=(int)((double)nnz/(double)rows);
+-
+-		ierr=VecCreateSeq(PETSC_COMM_SELF,rows,&vector);CHKERRQ(ierr);
+-
+-		/*Now, get ir,jc and pr: */
+-		pr=mxGetPr(mxvector);
+-		ir=mxGetIr(mxvector);
+-		jc=mxGetJc(mxvector);
+-
+-		/*Now, start inserting data into sparse vector: */
+-		count=0;
+-		for(i=0;i<cols;i++){
+-			for(j=0;j<(jc[i+1]-jc[i]);j++){
+-				VecSetValue(vector,ir[count],pr[count],INSERT_VALUES);
+-				count++;
+-			}
+-		}
+-
+-	}
+-	else{
+-
+-		/*Dealing with dense vector: recover pointer and size: */
+-		mxvector_ptr=(double*)mxGetPr(mxvector);
+-		rows=mxGetM(mxvector);
+-		cols=mxGetN(mxvector);
+-
+-		/*Create serial vector: */
+-		ierr=VecCreateSeq(PETSC_COMM_SELF,rows,&vector);CHKERRQ(ierr);
+-
+-		/*Insert mxvector_ptr values into petsc vector: */
+-		idxm=xNew<int>(rows);
+-
+-		for(i=0;i<rows;i++)idxm[i]=i;
+-
+-		ierr=VecSetValues(vector,rows,idxm,mxvector_ptr,INSERT_VALUES);CHKERRQ(ierr);
+-
+-	}
+-
+-	/*Assemble vector: */
+-	VecAssemblyBegin(vector);
+-	VecAssemblyEnd(vector);
+-
+-	/*Assign output pointer: */
+-	*pvector=vector;
+-	*pvector_rows=rows;
+-
+-	return 1;
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToPetscMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToPetscMatrix.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToPetscMatrix.cpp	(revision 12850)
+@@ -1,114 +0,0 @@
+-/* \file MatlabMatrixToPetscMatrix.cpp
+- * \brief: convert a sparse or dense matlab matrix to a serial Petsc matrix:
+- */
+-
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-#include "../../shared/shared.h"
+-
+-/*Petsc includes: */
+-#include "petscmat.h"
+-#include "petscvec.h"
+-#include "petscksp.h"
+-
+-/*Matlab includes: */
+-#include "mex.h"
+-
+-int MatlabMatrixToPetscMatrix(Mat* pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix){
+-
+-	int rows, cols;
+-	double *mxmatrix_ptr = NULL;
+-	double *tmatrix      = NULL;
+-	int ierr;
+-	int i,j;
+-
+-	/*output: */
+-	Mat matrix = NULL;
+-
+-	/*matlab indices: */
+-	mwIndex *ir = NULL;
+-	mwIndex *jc = NULL;
+-	double  *pr = NULL;
+-	int     count;
+-	int     nnz;
+-	int     nz;
+-
+-	/*petsc indices: */
+-	int *idxm = NULL;
+-	int *idxn = NULL;
+-	
+-	/*Ok, first check if we are dealing with a sparse or full matrix: */
+-	if (mxIsSparse(mxmatrix)){
+-
+-		/*Dealing with sparse matrix: recover size first: */
+-		mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
+-		rows=mxGetM(mxmatrix);
+-		cols=mxGetN(mxmatrix);
+-		nnz=mxGetNzmax(mxmatrix);
+-		if(rows){
+-			nz=(int)((double)nnz/(double)rows);
+-		}
+-		else{
+-			nz=0;
+-		}
+-
+-		ierr=MatCreateSeqAIJ(PETSC_COMM_SELF,rows,cols,nz,PETSC_NULL,&matrix);CHKERRQ(ierr);
+-
+-		/*Now, get ir,jc and pr: */
+-		pr=mxGetPr(mxmatrix);
+-		ir=mxGetIr(mxmatrix);
+-		jc=mxGetJc(mxmatrix);
+-
+-		/*Now, start inserting data into sparse matrix: */
+-		count=0;
+-		for(i=0;i<cols;i++){
+-			for(j=0;j<(jc[i+1]-jc[i]);j++){
+-				MatSetValue(matrix,ir[count],i,pr[count],INSERT_VALUES);
+-				count++;
+-			}
+-		}
+-	}
+-	else{
+-		/*Dealing with dense matrix: recover pointer and size: */
+-		mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
+-		rows=mxGetM(mxmatrix);
+-		cols=mxGetN(mxmatrix);
+-
+-		/*transpose, as Petsc now does not allows MAT_COLUMN_ORIENTED matrices in MatSetValues: */
+-		tmatrix=xNew<double>(rows*cols);
+-		for(i=0;i<cols;i++){
+-			for(j=0;j<rows;j++){
+-				*(tmatrix+rows*i+j)=*(mxmatrix_ptr+cols*j+i);
+-			}
+-		}
+-
+-		/*Create serial matrix: */
+-		ierr=MatCreateSeqDense(PETSC_COMM_SELF,rows,cols,NULL,&matrix);CHKERRQ(ierr);
+-
+-		/*Insert mxmatrix_ptr values into petsc matrix: */
+-		idxm=xNew<int>(rows);
+-		idxn=xNew<int>(cols);
+-
+-		for(i=0;i<rows;i++)idxm[i]=i;
+-		for(i=0;i<cols;i++)idxn[i]=i;
+-
+-		ierr=MatSetValues(matrix,rows,idxm,cols,idxn,tmatrix,INSERT_VALUES); CHKERRQ(ierr);
+-
+-		xDelete<double>(tmatrix);
+-	}
+-
+-	/*Assemble matrix: */
+-	MatAssemblyBegin(matrix,MAT_FINAL_ASSEMBLY); 
+-	MatAssemblyEnd(matrix,MAT_FINAL_ASSEMBLY);
+-
+-	/*Assign output pointer: */
+-	*pmatrix=matrix;
+-	if(pmatrix_rows) *pmatrix_rows=rows;
+-	if(pmatrix_cols) *pmatrix_cols=cols;
+-
+-	return 1;
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 12850)
+@@ -226,12 +226,8 @@
+ 	
+ 	if(matrix){
+ 		
+-		#ifdef _HAVE_PETSC_
+-		PetscMatrixToDoubleMatrix(&matrix_ptr,&rows,&cols,matrix->matrix);
+-		#else
+-		matrix_ptr=matrix->matrix->ToSerial();
+-		matrix->matrix->GetSize(&rows,&cols);
+-		#endif
++		matrix_ptr=matrix->ToSerial();
++		matrix->GetSize(&rows,&cols);
+ 
+ 		/*Now transpose the matrix and allocate with Matlab's memory manager: */
+ 		tmatrix_ptr=(double*)mxMalloc(rows*cols*sizeof(double));
+@@ -268,12 +264,8 @@
+ 	
+ 	if(vector){
+ 		/*call toolkit routine: */
+-		#ifdef _HAVE_PETSC_
+-		PetscVectorToDoubleVector(&vector_ptr,&rows,vector->vector);
+-		#else
+-		vector_ptr=vector->vector->ToMPISerial();
+-		vector->vector->GetSize(&rows);
+-		#endif
++		vector_ptr=vector->ToMPISerial();
++		vector->GetSize(&rows);
+ 		
+ 		/*now create the matlab vector with Matlab's memory manager */
+ 		vector_matlab=(double*)mxMalloc(rows*sizeof(double));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp	(revision 12850)
+@@ -30,9 +30,9 @@
+ 	vector=new Vector();
+ 
+ 	#ifdef _HAVE_PETSC_
+-	MatlabVectorToPetscVector(&vector->vector,&dummy,mxvector);
++	vector->pvector=MatlabVectorToPetscVec(mxvector);
+ 	#else
+-	vector->vector=MatlabVectorToSeqVec(mxvector);
++	vector->svector=MatlabVectorToSeqVec(mxvector);
+ 	#endif
+ 	
+ 	return vector;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp	(revision 12850)
+@@ -30,9 +30,9 @@
+ 	matrix=new Matrix();
+ 
+ 	#ifdef _HAVE_PETSC_
+-	MatlabMatrixToPetscMatrix(&matrix->matrix,NULL,NULL,mxmatrix);
++	matrix->pmatrix=MatlabMatrixToPetscMat(mxmatrix);
+ 	#else
+-	matrix->matrix=MatlabMatrixToSeqMat(mxmatrix);
++	matrix->smatrix=MatlabMatrixToSeqMat(mxmatrix);
+ 	#endif
+ 	
+ 	return matrix;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToPetscVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToPetscVec.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToPetscVec.cpp	(revision 12850)
+@@ -0,0 +1,109 @@
++/* \file MatlabVectorToPetscVector.cpp
++ * \brief: convert a sparse or dense matlab vector to a serial Petsc vector:
++ */
++
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++/*Petsc includes: */
++#include "petscmat.h"
++#include "petscvec.h"
++#include "petscksp.h"
++
++/*Matlab includes: */
++#include "mex.h"
++
++#include "../../shared/shared.h"
++#include "matlabio.h"
++
++PetscVec* MatlabVectorToPetscVec(const mxArray* mxvector){
++
++	int dummy;
++	PetscVec* vector=new PetscVec();
++	
++	MatlabVectorToPetscVec(&vector->vector,&dummy, mxvector);
++
++	return vector;
++}
++
++int MatlabVectorToPetscVec(Vec* pvector,int* pvector_rows,const mxArray* mxvector){
++
++	int rows, cols;
++	double* mxvector_ptr=NULL;
++	int ierr;
++	int i,j;
++
++	/*output: */
++	Vec vector=NULL;
++
++	/*matlab indices: */
++	mwIndex*    ir=NULL;
++	mwIndex*    jc=NULL;
++	double* pr=NULL;
++	int     count;
++	int     nnz;
++	int     nz;
++
++	/*petsc indices: */
++	int* idxm=NULL;
++	
++	/*Ok, first check if we are dealing with a sparse or full vector: */
++	if (mxIsSparse(mxvector)){
++
++		/*Dealing with sparse vector: recover size first: */
++		mxvector_ptr=(double*)mxGetPr(mxvector);
++		rows=mxGetM(mxvector);
++		cols=mxGetN(mxvector);
++		nnz=mxGetNzmax(mxvector);
++		nz=(int)((double)nnz/(double)rows);
++
++		ierr=VecCreateSeq(PETSC_COMM_SELF,rows,&vector);CHKERRQ(ierr);
++
++		/*Now, get ir,jc and pr: */
++		pr=mxGetPr(mxvector);
++		ir=mxGetIr(mxvector);
++		jc=mxGetJc(mxvector);
++
++		/*Now, start inserting data into sparse vector: */
++		count=0;
++		for(i=0;i<cols;i++){
++			for(j=0;j<(jc[i+1]-jc[i]);j++){
++				VecSetValue(vector,ir[count],pr[count],INSERT_VALUES);
++				count++;
++			}
++		}
++
++	}
++	else{
++
++		/*Dealing with dense vector: recover pointer and size: */
++		mxvector_ptr=(double*)mxGetPr(mxvector);
++		rows=mxGetM(mxvector);
++		cols=mxGetN(mxvector);
++
++		/*Create serial vector: */
++		ierr=VecCreateSeq(PETSC_COMM_SELF,rows,&vector);CHKERRQ(ierr);
++
++		/*Insert mxvector_ptr values into petsc vector: */
++		idxm=xNew<int>(rows);
++
++		for(i=0;i<rows;i++)idxm[i]=i;
++
++		ierr=VecSetValues(vector,rows,idxm,mxvector_ptr,INSERT_VALUES);CHKERRQ(ierr);
++
++	}
++
++	/*Assemble vector: */
++	VecAssemblyBegin(vector);
++	VecAssemblyEnd(vector);
++
++	/*Assign output pointer: */
++	*pvector=vector;
++	*pvector_rows=rows;
++
++	return 1;
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToPetscMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToPetscMat.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToPetscMat.cpp	(revision 12850)
+@@ -0,0 +1,124 @@
++/* \file MatlabMatrixToPetscMatrix.cpp
++ * \brief: convert a sparse or dense matlab matrix to a serial Petsc matrix:
++ */
++
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++#include "../../shared/shared.h"
++
++/*Petsc includes: */
++#include "petscmat.h"
++#include "petscvec.h"
++#include "petscksp.h"
++
++/*Matlab includes: */
++#include "mex.h"
++#include "matlabio.h"
++
++PetscMat* MatlabMatrixToPetscMat(const mxArray* mxmatrix){
++
++	int dummy;
++	PetscMat* matrix=new PetscMat();
++
++	MatlabMatrixToPetscMat(&matrix->matrix, &dummy, &dummy, mxmatrix);
++
++	return matrix;
++}
++int MatlabMatrixToPetscMat(Mat* pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix){
++
++	int rows, cols;
++	double *mxmatrix_ptr = NULL;
++	double *tmatrix      = NULL;
++	int ierr;
++	int i,j;
++
++	/*output: */
++	Mat matrix = NULL;
++
++	/*matlab indices: */
++	mwIndex *ir = NULL;
++	mwIndex *jc = NULL;
++	double  *pr = NULL;
++	int     count;
++	int     nnz;
++	int     nz;
++
++	/*petsc indices: */
++	int *idxm = NULL;
++	int *idxn = NULL;
++	
++	/*Ok, first check if we are dealing with a sparse or full matrix: */
++	if (mxIsSparse(mxmatrix)){
++
++		/*Dealing with sparse matrix: recover size first: */
++		mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
++		rows=mxGetM(mxmatrix);
++		cols=mxGetN(mxmatrix);
++		nnz=mxGetNzmax(mxmatrix);
++		if(rows){
++			nz=(int)((double)nnz/(double)rows);
++		}
++		else{
++			nz=0;
++		}
++
++		ierr=MatCreateSeqAIJ(PETSC_COMM_SELF,rows,cols,nz,PETSC_NULL,&matrix);CHKERRQ(ierr);
++
++		/*Now, get ir,jc and pr: */
++		pr=mxGetPr(mxmatrix);
++		ir=mxGetIr(mxmatrix);
++		jc=mxGetJc(mxmatrix);
++
++		/*Now, start inserting data into sparse matrix: */
++		count=0;
++		for(i=0;i<cols;i++){
++			for(j=0;j<(jc[i+1]-jc[i]);j++){
++				MatSetValue(matrix,ir[count],i,pr[count],INSERT_VALUES);
++				count++;
++			}
++		}
++	}
++	else{
++		/*Dealing with dense matrix: recover pointer and size: */
++		mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
++		rows=mxGetM(mxmatrix);
++		cols=mxGetN(mxmatrix);
++
++		/*transpose, as Petsc now does not allows MAT_COLUMN_ORIENTED matrices in MatSetValues: */
++		tmatrix=xNew<double>(rows*cols);
++		for(i=0;i<cols;i++){
++			for(j=0;j<rows;j++){
++				*(tmatrix+rows*i+j)=*(mxmatrix_ptr+cols*j+i);
++			}
++		}
++
++		/*Create serial matrix: */
++		ierr=MatCreateSeqDense(PETSC_COMM_SELF,rows,cols,NULL,&matrix);CHKERRQ(ierr);
++
++		/*Insert mxmatrix_ptr values into petsc matrix: */
++		idxm=xNew<int>(rows);
++		idxn=xNew<int>(cols);
++
++		for(i=0;i<rows;i++)idxm[i]=i;
++		for(i=0;i<cols;i++)idxn[i]=i;
++
++		ierr=MatSetValues(matrix,rows,idxm,cols,idxn,tmatrix,INSERT_VALUES); CHKERRQ(ierr);
++
++		xDelete<double>(tmatrix);
++	}
++
++	/*Assemble matrix: */
++	MatAssemblyBegin(matrix,MAT_FINAL_ASSEMBLY); 
++	MatAssemblyEnd(matrix,MAT_FINAL_ASSEMBLY);
++
++	/*Assign output pointer: */
++	*pmatrix=matrix;
++	if(pmatrix_rows) *pmatrix_rows=rows;
++	if(pmatrix_cols) *pmatrix_cols=cols;
++
++	return 1;
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 12850)
+@@ -78,8 +78,10 @@
+ 
+ /*Matlab to Petsc routines: */
+ #ifdef _HAVE_PETSC_
+-int MatlabMatrixToPetscMatrix(Mat* matrix,int* prows,int* pcols, const mxArray* mxmatrix);
+-int MatlabVectorToPetscVector(Vec* pvector,int* pvector_rows,const mxArray* mxvector);
++int MatlabMatrixToPetscMat(Mat* matrix,int* prows,int* pcols, const mxArray* mxmatrix);
++PetscMat* MatlabMatrixToPetscMat(const mxArray* mxmatrix);
++int MatlabVectorToPetscVec(Vec* pvector,int* pvector_rows,const mxArray* mxvector);
++PetscVec* MatlabVectorToPetscVec(const mxArray* mxvector);
+ #endif
+ 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp	(revision 12850)
+@@ -21,9 +21,11 @@
+ 	if (pv && *pv){
+ 		/*Actually, still get rid of internal Petsc matrix. Quick fix until Matlab handles C++ 
+ 		 * correctly: */
+-		#ifdef _HAVE_PETSC_
++		/*Keeping this for legacy reasons: */
++		/*#ifdef _HAVE_PETSC_
+ 			MatFree(&(*pv)->matrix);
+-		#endif
++		#endif*/
++		delete *pv;
+ 		*pv=NULL;
+ 	}
+ }
+@@ -33,9 +35,11 @@
+ 	if (pv && *pv){
+ 		/*Actually, still get rid of internal Petsc vector. Quick fix until Matlab handles C++ 
+ 		 * correctly: */
+-		#ifdef _HAVE_PETSC_
++		/*Keeping this for legacy reasons: shoudl be done by the vector itself!*/
++		/*#ifdef _HAVE_PETSC_
+ 			VecFree(&(*pv)->vector);
+-		#endif
++		#endif*/
++		delete *pv;
+ 		*pv=NULL;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxGsl.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxGsl.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxGsl.cpp	(revision 12850)
+@@ -1,78 +0,0 @@
+-/*!\file SolverxGsl
+- * \brief Gsl implementation of solver
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-#include <cstring>
+-#include <gsl/gsl_linalg.h>
+-
+-#include "./Solverx.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../io/io.h"
+-
+-void SolverxGsl(SeqVec** puf,SeqMat* Kff, SeqVec* pf){/*{{{*/
+-
+-	/*Intermediary: */
+-	int M,N,N2,s;
+-	SeqVec *uf = NULL;
+-	IssmDouble *x  = NULL;
+-
+-	Kff->GetSize(&M,&N);
+-	pf->GetSize(&N2);
+-
+-	if(N!=N2)_error2_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
+-	if(M!=N)_error2_("Stiffness matrix should be square!");
+-
+-	SolverxGsl(&x,Kff->matrix,pf->vector,N);
+-	uf=new SeqVec(x,N);
+-
+-	/*Assign output pointers:*/
+-	*puf=uf;
+-}/*}}}*/
+-void SolverxGsl(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){/*{{{*/
+-
+-	/*GSL Matrices and vectors: */
+-	int              s;
+-	gsl_matrix_view  a;
+-	gsl_vector_view  b;
+-	gsl_vector      *x = NULL;
+-	gsl_permutation *p = NULL;
+-#ifdef _HAVE_ADOLC_
+-	// if we use Adol-C then the IssmDouble will be an adouble
+-	// and the calls to gsl_... will not work
+-	// and we should call  a suitable wrapped solve instead
+-	_error2_("SolverxGsl: should not be here with Adol-C");
+-#else
+-	/*A will be modified by LU decomposition. Use copy*/
+-	IssmDouble* Acopy = xNew<IssmDouble>(n*n);
+-	xMemCpy<IssmDouble>(Acopy,A,n*n);
+-
+-	/*Initialize gsl matrices and vectors: */
+-	a = gsl_matrix_view_array (Acopy,n,n);
+-	b = gsl_vector_view_array (B,n);
+-	x = gsl_vector_alloc (n);
+-
+-	/*Run LU and solve: */
+-	p = gsl_permutation_alloc (n);
+-	gsl_linalg_LU_decomp (&a.matrix, p, &s);
+-	gsl_linalg_LU_solve (&a.matrix, p, &b.vector, x);
+-
+-	//printf ("x = \n");
+-	//gsl_vector_fprintf (stdout, x, "%g");
+-
+-	/*Copy result*/
+-	IssmDouble* X = xNew<IssmDouble>(n);
+-	memcpy(X,gsl_vector_ptr(x,0),n*sizeof(IssmDouble));
+-
+-	/*Clean up and assign output pointer*/
+-	xDelete<IssmDouble>(Acopy);
+-	gsl_permutation_free(p);
+-	gsl_vector_free(x);
+-	*pX=X;
+-#endif
+-}/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 12850)
+@@ -13,6 +13,13 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
++void	SolverxPetsc(PetscVec** puf, PetscMat* Kff, PetscVec* pf, PetscVec* uf0,PetscVec* df, Parameters* parameters){
++
++	PetscVec* uf=new PetscVec();
++	SolverxPetsc(&uf->vector, Kff->matrix, pf->vector, uf0->vector, df->vector, parameters);
++	*puf=uf;
++
++}
+ void	SolverxPetsc(Vec* puf, Mat Kff, Vec pf, Vec uf0,Vec df, Parameters* parameters){
+ 
+ 	/*Output: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 12850)
+@@ -25,39 +25,23 @@
+ 	_assert_(Kff);
+ 	_assert_(pf);
+ 
+-	#ifdef _HAVE_PETSC_
+-		Vec uf0_vector = NULL;
+-		Vec df_vector  = NULL;
+-		Vec uf_vector  = NULL;
+-		if(uf0) uf0_vector = uf0->vector;
+-		if(df)  df_vector  = df->vector;
++	/*Initialize vector: */
++	uf=new Vector();
+ 
+-		/*In serial mode, the Petsc Options database has not been initialized properly: */
++	/*According to matrix type, use specific solvers: */
++	if(Kff->type==PetscMatType){
++		PetscVec* uf0_vector = NULL;
++		PetscVec* df_vector  = NULL;
++		if(uf0) uf0_vector = uf0->pvector;
++		if(df)  df_vector  = df->pvector;
+ 
+-		SolverxPetsc(&uf_vector,Kff->matrix,pf->vector,uf0_vector,df_vector,parameters);
++		SolverxPetsc(&uf->pvector,Kff->pmatrix,pf->pvector,uf0_vector,df_vector,parameters);
++	}
++	else if(Kff->type==SeqMatType){
++		SolverxSeq(&uf->svector,Kff->smatrix,pf->svector);
++	}
++	else _error2_("Matrix type: " << Kff->type << " not supported yet!");
+ 
+-		/*Create vector out of petsc vector: */
+-		uf=new Vector(uf_vector);
+-
+-		/*Free ressources: */
+-		VecFree(&uf_vector);
+-	#else
+-		#ifdef _HAVE_GSL_
+-		SeqVec* uf_vector=NULL;
+-
+-		SolverxGsl(&uf_vector,Kff->matrix,pf->vector);
+-
+-		/*Create vector out of SeqVec vector: */
+-		uf=new Vector(uf_vector);
+-
+-		/*Free ressources: */
+-		delete uf_vector;
+-
+-		#else
+-			_error2_("GSL support not compiled in!");
+-		#endif
+-	#endif
+-
+ 	/*Assign output pointers: */
+ 	*puf=uf;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 12850)
+@@ -17,14 +17,13 @@
+ void	Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters);
+ 
+ #ifdef _HAVE_PETSC_
++void	SolverxPetsc(PetscVec** puf, PetscMat* Kff, PetscVec* pf, PetscVec* uf0,PetscVec* df, Parameters* parameters);
+ void	SolverxPetsc(Vec* puf, Mat Kff, Vec pf, Vec uf0,Vec df, Parameters* parameters);
+ void  DofTypesToIndexSet(IS* pisv, IS* pisp, Vec df,int typeenum);
+ #endif
+ 
+-#ifdef _HAVE_GSL_
+-void SolverxGsl(SeqVec** puf,SeqMat* Kff, SeqVec* pf);
+-void SolverxGsl(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n);
+-#endif
++void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf);
++void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n);
+ 
+ #endif  /* _SOLVERX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 12850)
+@@ -0,0 +1,89 @@
++/*!\file SolverxSeq
++ * \brief implementation of sequential solver using the GSL librarie
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++#include <cstring>
++
++#include "./Solverx.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../io/io.h"
++
++#ifdef _HAVE_GSL_
++#include <gsl/gsl_linalg.h>
++#endif
++
++void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf){/*{{{*/
++
++	#ifdef _HAVE_GSL_
++	/*Intermediary: */
++	int M,N,N2,s;
++	SeqVec *uf = NULL;
++	IssmDouble *x  = NULL;
++
++	Kff->GetSize(&M,&N);
++	pf->GetSize(&N2);
++
++	if(N!=N2)_error2_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
++	if(M!=N)_error2_("Stiffness matrix should be square!");
++
++	SolverxSeq(&x,Kff->matrix,pf->vector,N);
++	uf=new SeqVec(x,N);
++
++	/*Assign output pointers:*/
++	*puf=uf;
++
++	#else
++		_error2_("GSL support not compiled in!");
++	#endif
++
++}/*}}}*/
++void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){/*{{{*/
++
++	#ifdef _HAVE_GSL_
++		/*GSL Matrices and vectors: */
++		int              s;
++		gsl_matrix_view  a;
++		gsl_vector_view  b;
++		gsl_vector      *x = NULL;
++		gsl_permutation *p = NULL;
++		#ifdef _HAVE_ADOLC_
++			// if we use Adol-C then the IssmDouble will be an adouble
++			// and the calls to gsl_... will not work
++			// and we should call  a suitable wrapped solve instead
++			_error2_("SolverxSeq: should not be here with Adol-C");
++		#else
++			/*A will be modified by LU decomposition. Use copy*/
++			IssmDouble* Acopy = xNew<IssmDouble>(n*n);
++			xMemCpy<IssmDouble>(Acopy,A,n*n);
++
++			/*Initialize gsl matrices and vectors: */
++			a = gsl_matrix_view_array (Acopy,n,n);
++			b = gsl_vector_view_array (B,n);
++			x = gsl_vector_alloc (n);
++
++			/*Run LU and solve: */
++			p = gsl_permutation_alloc (n);
++			gsl_linalg_LU_decomp (&a.matrix, p, &s);
++			gsl_linalg_LU_solve (&a.matrix, p, &b.vector, x);
++
++			//printf ("x = \n");
++			//gsl_vector_fprintf (stdout, x, "%g");
++
++			/*Copy result*/
++			IssmDouble* X = xNew<IssmDouble>(n);
++			memcpy(X,gsl_vector_ptr(x,0),n*sizeof(IssmDouble));
++
++			/*Clean up and assign output pointer*/
++			xDelete<IssmDouble>(Acopy);
++			gsl_permutation_free(p);
++			gsl_vector_free(x);
++			*pX=X;
++		#endif
++	#endif
++}/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 12850)
+@@ -0,0 +1,174 @@
++/*!\file PetscMat.cpp
++ * \brief: implementation of the PetscMat object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../petscincludes.h"
++#include "../../../shared/shared.h"
++
++/*}}}*/
++
++/*PetscMat constructors and destructor*/
++/*FUNCTION PetscMat::PetscMat(){{{*/
++PetscMat::PetscMat(){
++	this->matrix=NULL;
++	#ifdef _HAVE_ADOLC_
++	this->amatrix=NULL;
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION PetscMat::PetscMat(int M,int N){{{*/
++PetscMat::PetscMat(int M,int N){
++
++	this->matrix=NULL;
++	if(M*N)this->matrix=NewMat(M,N);
++}
++/*}}}*/
++/*FUNCTION PetscMat::PetscMat(int M,int N, IssmDouble sparsity){{{*/
++PetscMat::PetscMat(int M,int N, IssmDouble sparsity){
++
++	this->matrix=NULL;
++	if(M*N) this->matrix=NewMat(M,N,sparsity);
++}
++/*}}}*/
++/*FUNCTION PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){{{*/
++PetscMat::PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){
++
++	this->matrix=NULL;
++	
++	if(M*N){
++		int     i;
++		int* idxm=xNew<int>(M);
++		int* idxn=xNew<int>(N);
++	
++		for(i=0;i<M;i++)idxm[i]=i;
++		for(i=0;i<N;i++)idxn[i]=i;
++
++
++		this->matrix=NewMat(M,N,sparsity);
++		MatSetValues(this->matrix,M,idxm,N,idxn,serial_mat,INSERT_VALUES);
++		MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
++		MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
++
++		xDelete<int>(idxm);
++		xDelete<int>(idxn);
++	}
++
++}
++/*}}}*/
++/*FUNCTION PetscMat::PetscMat(int M,int N, int connectivity, int numberofdofspernode){{{*/
++PetscMat::PetscMat(int M,int N, int connectivity,int numberofdofspernode){
++	
++	this->matrix=NULL;
++	if(M*N) this->matrix=NewMat(M,N,connectivity,numberofdofspernode);
++
++}
++/*}}}*/
++/*FUNCTION PetscMat::~PetscMat(){{{*/
++PetscMat::~PetscMat(){
++	MatFree(&this->matrix);
++}
++/*}}}*/
++
++/*PetscMat specific routines: */
++/*FUNCTION PetscMat::Echo{{{*/
++void PetscMat::Echo(void){
++
++	MatView(this->matrix,PETSC_VIEWER_STDOUT_WORLD);
++}
++/*}}}*/
++/*FUNCTION PetscMat::Assemble{{{*/
++void PetscMat::Assemble(void){
++
++	_assert_(this->matrix);
++	MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
++	MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
++	#if _PETSC_MAJOR_ == 2 
++		MatCompress(this->matrix);
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION PetscMat::Norm{{{*/
++IssmDouble PetscMat::Norm(NormMode mode){
++
++
++	IssmDouble norm=0;
++	_assert_(this->matrix);
++	MatNorm(this->matrix,ISSMToPetscNormMode(mode),&norm);
++	
++	return norm;
++
++}
++/*}}}*/
++/*FUNCTION PetscMat::GetSize{{{*/
++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){
++
++	_assert_(this->matrix);
++	MatGetLocalSize(this->matrix,pM,pN);
++
++}
++/*}}}*/
++/*FUNCTION PetscMat::MatMult{{{*/
++void PetscMat::MatMult(PetscVec* X,PetscVec* AX){
++
++	_assert_(this->matrix);
++	_assert_(X->vector);
++	MatMultPatch(this->matrix,X->vector,AX->vector);
++
++}
++/*}}}*/
++/*FUNCTION PetscMat::Duplicate{{{*/
++PetscMat* PetscMat::Duplicate(void){
++
++	PetscMat* output=NULL;
++
++	output=new PetscMat();
++	_assert_(this->matrix);
++	MatDuplicate(this->matrix,MAT_COPY_VALUES,&output->matrix);
++
++	return output;
++
++}
++/*}}}*/
++/*FUNCTION PetscMat::ToSerial{{{*/
++IssmDouble* PetscMat::ToSerial(void){
++
++	 IssmDouble* output=NULL;
++
++	 MatToSerial(&output,this->matrix);
++	 return output;
++
++}
++/*}}}*/
++/*FUNCTION PetscMat::SetValues{{{*/
++void PetscMat::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){
++
++	MatSetValues(this->matrix,m,idxm,n,idxn,values,ISSMToPetscInsertMode(mode));
++
++}
++/*}}}*/
++/*FUNCTION PetscMat::Convert{{{*/
++void PetscMat::Convert(MatrixType type){
++
++	MatConvert(this->matrix,ISSMToPetscMatrixType(type),MAT_REUSE_MATRIX,&this->matrix);
++
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h	(revision 12850)
+@@ -0,0 +1,62 @@
++/*!\file:  PetscVec.h
++ * \brief wrapper to our own PetscVec object, which is needed to add AD capabilities (using ADOLC) 
++ * to a C-coded Petsc API. We are just wrapping the Petsc objects into C++ equivalent, so that 
++ * later, we can map all of the Petsc routines into Adolc equivalents.
++ */ 
++
++#ifndef _PETSCVEC_H_
++#define _PETSCVEC_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "../petscincludes.h"
++#include "../../../include/include.h"
++
++
++/*}}}*/
++
++class PetscVec{
++
++	public:
++		Vec vector;
++
++		#ifdef _HAVE_ADOLC_
++		IssmDouble* avector;
++		#endif
++
++
++		/*PetscVec constructors, destructors {{{*/
++		PetscVec();
++		PetscVec(int M,bool fromlocalsize=false);
++		PetscVec(IssmDouble* buffer, int M);
++		PetscVec(Vec petsc_vec);
++		~PetscVec();
++		/*}}}*/
++		/*PetscVec specific routines {{{*/
++		void Echo(void);
++		void Assemble(void);
++		void SetValues(int ssize, int* list, IssmDouble* values, InsMode mode);
++		void SetValue(int dof, IssmDouble value, InsMode  mode);
++		void GetValue(IssmDouble* pvalue, int dof);
++		void GetSize(int* pM);
++		void GetLocalSize(int* pM);
++		PetscVec* Duplicate(void);
++		void Set(IssmDouble value);
++		void AXPY(PetscVec* X, IssmDouble a);
++		void AYPX(PetscVec* X, IssmDouble a);
++		IssmDouble* ToMPISerial(void);
++		void Copy(PetscVec* to);
++		IssmDouble Norm(NormMode norm_type);
++		void Scale(IssmDouble scale_factor);
++		void PointwiseDivide(PetscVec* x,PetscVec* y);
++		IssmDouble Dot(PetscVec* vector);
++		/*}}}*/
++};
++
++#endif //#ifndef _PETSCVEC_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h	(revision 12850)
+@@ -0,0 +1,56 @@
++/*!\file:  PetscMat.h
++ * \brief wrapper to our own PetscMat object, which is needed to add AD capabilities (using ADOLC) 
++ * to a C-coded Petsc API. We are just wrapping the Petsc objects into C++ equivalent, so that 
++ * later, we can map all of the Petsc routines into Adolc equivalents.
++ */ 
++
++#ifndef _PETSCMAT_H_
++#define _PETSCMAT_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "../petscincludes.h"
++#include "../../../include/include.h"
++
++/*}}}*/
++class PetscVec;
++
++class PetscMat{
++
++	public:
++		Mat matrix;
++
++		#ifdef _HAVE_ADOLC_
++		IssmDouble* amatrix;
++		#endif
++
++		/*PetscMat constructors, destructors {{{*/
++		PetscMat();
++		PetscMat(int M,int N);
++		PetscMat(int M,int N,IssmDouble sparsity);
++		PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity);
++		PetscMat(int M,int N,int connectivity,int numberofdofspernode);
++		~PetscMat();
++		/*}}}*/
++		/*PetscMat specific routines {{{*/
++		void Echo(void);
++		void Assemble(void);
++		IssmDouble Norm(NormMode norm_type);
++		void GetSize(int* pM,int* pN);
++		void GetLocalSize(int* pM,int* pN);
++		void MatMult(PetscVec* X,PetscVec* AX);
++		PetscMat* Duplicate(void);
++		IssmDouble* ToSerial(void);
++		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode);
++		void Convert(MatrixType type);
++		/*}}}*/
++
++};
++		
++#endif //#ifndef _PETSCMAT_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 12850)
+@@ -0,0 +1,217 @@
++/*!\file PetscVec.cpp
++ * \brief: implementation of the PetscVec object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../petscincludes.h"
++#include "../../../shared/shared.h"
++
++/*}}}*/
++
++/*PetscVec constructors and destructor*/
++/*FUNCTION 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){
++	this->vector=NULL;
++	if(M) this->vector=NewVec(M,fromlocalsize);
++}
++/*}}}*/
++/*FUNCTION PetscVec::PetscVec(IssmDouble* serial_vec,int M){{{*/
++PetscVec::PetscVec(IssmDouble* serial_vec,int M){
++
++	this->vector=NULL;
++	if(M){
++		int* idxm=xNew<int>(M);
++		for(int i=0;i<M;i++) idxm[i]=i;
++
++		this->vector=NewVec(M);
++		VecSetValues(this->vector,M,idxm,serial_vec,INSERT_VALUES);
++		VecAssemblyBegin(this->vector);
++		VecAssemblyEnd(this->vector);
++
++		xDelete<int>(idxm);
++	}
++}
++/*}}}*/
++/*FUNCTION PetscVec::~PetscVec(){{{*/
++PetscVec::~PetscVec(){
++    VecFree(&this->vector);
++}
++/*}}}*/
++/*FUNCTION Vector::Vector(Vec petsc_vec){{{*/
++PetscVec::PetscVec(Vec petsc_vec){
++
++	if(petsc_vec==NULL){
++		this->vector=NewVec(0);
++	}
++	else{
++		/*copy vector*/
++		VecDuplicate(petsc_vec,&this->vector);
++		VecCopy(petsc_vec,this->vector);
++	}
++
++}
++/*}}}*/
++
++/*PetscVec specific routines: */
++/*FUNCTION PetscVec::Echo{{{*/
++void PetscVec::Echo(void){
++
++	_assert_(this->vector);
++	VecView(this->vector,PETSC_VIEWER_STDOUT_WORLD);
++}
++/*}}}*/
++/*FUNCTION PetscVec::Assemble{{{*/
++void PetscVec::Assemble(void){
++		
++	_assert_(this->vector);
++	VecAssemblyBegin(this->vector); 
++	VecAssemblyEnd(this->vector);
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::SetValues{{{*/
++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){
++
++	_assert_(this->vector);
++	VecSetValues(this->vector,1,&dof,&value,ISSMToPetscInsertMode(mode));
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::GetValue{{{*/
++void PetscVec::GetValue(IssmDouble* pvalue,int dof){
++
++	_assert_(this->vector);
++	VecGetValues(this->vector,1,&dof,pvalue);
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::GetSize{{{*/
++void PetscVec::GetSize(int* pM){
++
++	_assert_(this->vector);
++	VecGetSize(this->vector,pM);
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::GetLocalSize{{{*/
++void PetscVec::GetLocalSize(int* pM){
++
++	_assert_(this->vector);
++	VecGetLocalSize(this->vector,pM);
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::Duplicate{{{*/
++PetscVec* PetscVec::Duplicate(void){
++	
++	PetscVec* output=NULL;
++	_assert_(this->vector);
++	Vec vec_output=NULL;
++	VecDuplicate(this->vector,&vec_output);
++	output=new PetscVec(vec_output);
++	VecFree(&vec_output);
++
++	return output;
++}
++/*}}}*/
++/*FUNCTION PetscVec::Set{{{*/
++void PetscVec::Set(IssmDouble value){
++
++	_assert_(this->vector);
++	VecSet(this->vector,value);
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::AXPY{{{*/
++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){
++
++	_assert_(this->vector);
++	VecAYPX(this->vector,a,X->vector);
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::ToMPISerial{{{*/
++IssmDouble* PetscVec::ToMPISerial(void){
++	
++	IssmDouble* vec_serial=NULL;
++	VecToMPISerial(&vec_serial, this->vector);
++	return vec_serial;
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::Copy{{{*/
++void PetscVec::Copy(PetscVec* to){
++
++	if(this->vector) VecCopy(this->vector,to->vector);
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::Norm{{{*/
++IssmDouble PetscVec::Norm(NormMode mode){
++
++	IssmDouble norm=0;
++	_assert_(this->vector);
++	VecNorm(this->vector,ISSMToPetscNormMode(mode),&norm);
++	return norm;
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::Scale{{{*/
++void PetscVec::Scale(IssmDouble scale_factor){
++
++	_assert_(this->vector);
++	VecScale(this->vector,scale_factor); 
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::Dot{{{*/
++IssmDouble PetscVec::Dot(PetscVec* input){
++
++	IssmDouble dot;
++	_assert_(this->vector);
++	VecDot(this->vector,input->vector,&dot);
++	return dot;
++
++}
++/*}}}*/
++/*FUNCTION PetscVec::PointwiseDivide{{{*/
++void PetscVec::PointwiseDivide(PetscVec* x,PetscVec* y){
++
++	_assert_(this->vector);
++	VecPointwiseDivide(this->vector,x->vector,y->vector);
++
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/petscobjects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/petscobjects.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/petscobjects.h	(revision 12850)
+@@ -0,0 +1,11 @@
++/* \file petscobjects.h
++ * \brief all includes for our own petsc object implementation
++ */
++
++#ifndef _PETSC_OBJECTS_H_
++#define _PETSC_OBJECTS_H_
++
++#include "./PetscMat.h"
++#include "./PetscVec.h"
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/petscincludes.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/petscincludes.h	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/petscincludes.h	(revision 12850)
+@@ -15,6 +15,7 @@
+ 
+ /*our own patches: */
+ #include "patches/petscpatches.h"
++#include "objects/petscobjects.h"
+ 
+ #endif
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12849)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12850)
+@@ -330,6 +330,7 @@
+ 					./modules/ResetCoordinateSystemx/ResetCoordinateSystemx.cpp\
+ 					./modules/Solverx/Solverx.cpp\
+ 					./modules/Solverx/Solverx.h\
++					./modules/Solverx/SolverxSeq.cpp\
+ 					./modules/VecMergex/VecMergex.cpp\
+ 					./modules/VecMergex/VecMergex.h\
+ 					./modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp\
+@@ -783,15 +784,17 @@
+ 					./toolkits/petsc/patches/ISSMToPetscMatrixType.cpp\
+ 					./toolkits/petsc/patches/ISSMToPetscInsertMode.cpp\
+ 					./toolkits/petsc/patches/ISSMToPetscNormMode.cpp\
++					./toolkits/petsc/objects/petscobjects.h\
++					./toolkits/petsc/objects/PetscMat.h\
++					./toolkits/petsc/objects/PetscMat.cpp\
++					./toolkits/petsc/objects/PetscVec.h\
++					./toolkits/petsc/objects/PetscVec.cpp\
+ 					./toolkits/petsc/petscincludes.h\
+ 					./shared/Numerics/PetscOptionsFromAnalysis.cpp\
+ 					./modules/Solverx/SolverxPetsc.cpp\
+ 					./modules/Solverx/DofTypesToIndexSet.cpp
+ 
+ #}}}
+-#Gsl sources  {{{
+-gsl_sources= ./modules/Solverx/SolverxGsl.cpp
+-#}}}
+ #Mpi sources  {{{
+ mpi_sources= ./toolkits/mpi/mpiincludes.h\
+ 				./toolkits/mpi/patches/mpipatches.h\
+@@ -830,8 +833,8 @@
+ 					 ./matlab/io/MatlabVectorToSeqVec.cpp
+ #}}}
+ #Matlab and Petsc sources  {{{
+-matlabpetsc_sources= ./matlab/io/MatlabMatrixToPetscMatrix.cpp\
+-					 ./matlab/io/MatlabVectorToPetscVector.cpp
++matlabpetsc_sources= ./matlab/io/MatlabMatrixToPetscMat.cpp\
++					 ./matlab/io/MatlabVectorToPetscVec.cpp
+ 
+ #}}}
+ #Modules sources{{{
+@@ -924,10 +927,6 @@
+ issm_sources  +=  $(petsc_sources)
+ endif
+ 
+-if GSL
+-issm_sources  +=  $(gsl_sources)
+-endif
+-
+ if TRANSIENT
+ issm_sources  +=  $(transient_sources)
+ endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-12850-12851.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12850-12851.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12850-12851.diff	(revision 13394)
@@ -0,0 +1,21 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12850)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12851)
+@@ -303,14 +303,14 @@
+ /*FUNCTION Matrix::Convert{{{*/
+ void Matrix::Convert(MatrixType type){
+ 
+-	if(type==PetscMatType){
++	if((int)type==(int)PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix->Convert(type);
+ 		#else
+ 		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+-	else if(type==SeqMatType){
++	else if((int)type==(int)SeqMatType){
+ 		this->smatrix->Convert(type);
+ 	}
+ 	else _error2_("Matrix type: " << type << " not supported yet!");
Index: /issm/oecreview/Archive/12678-13393/ISSM-12851-12852.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12851-12852.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12851-12852.diff	(revision 13394)
@@ -0,0 +1,34 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp	(revision 12851)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp	(revision 12852)
+@@ -21,11 +21,9 @@
+ 	if (pv && *pv){
+ 		/*Actually, still get rid of internal Petsc matrix. Quick fix until Matlab handles C++ 
+ 		 * correctly: */
+-		/*Keeping this for legacy reasons: */
+-		/*#ifdef _HAVE_PETSC_
+-			MatFree(&(*pv)->matrix);
+-		#endif*/
+-		delete *pv;
++		#ifdef _HAVE_PETSC_
++			MatFree(&(*pv)->pmatrix->matrix);
++		#endif
+ 		*pv=NULL;
+ 	}
+ }
+@@ -35,11 +33,9 @@
+ 	if (pv && *pv){
+ 		/*Actually, still get rid of internal Petsc vector. Quick fix until Matlab handles C++ 
+ 		 * correctly: */
+-		/*Keeping this for legacy reasons: shoudl be done by the vector itself!*/
+-		/*#ifdef _HAVE_PETSC_
+-			VecFree(&(*pv)->vector);
+-		#endif*/
+-		delete *pv;
++		#ifdef _HAVE_PETSC_
++			VecFree(&(*pv)->pvector->vector);
++		#endif
+ 		*pv=NULL;
+ 	}
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-12852-12853.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12852-12853.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12852-12853.diff	(revision 13394)
@@ -0,0 +1,72 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par	(revision 12852)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par	(revision 12853)
+@@ -49,6 +49,6 @@
+ %Deal with boundary conditions:
+ md=SetIceShelfBC(md);
+ 
+-%Change name so that no test have the same name
++%Change name so that no tests have the same name
+ A=dbstack;
+ if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py	(revision 12852)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py	(revision 12853)
+@@ -3,6 +3,8 @@
+ import scipy.io as matio
+ import InterpFromMeshToMesh2d as im
+ from   paterson import  *
++from SetIceShelfBC import *
++import inspect
+ 
+ #Start defining model parameters here
+ #Geometry
+@@ -18,8 +20,8 @@
+ #Initial velocity 
+ mat=matio.loadmat('../Data/SquareShelfConstrained.data')
+ #Reshape as Rank-1 arrays
+-x=reshape(mat['x'],(size(mat['x']),))
+-y=reshape(mat['y'],(size(mat['y']),))
++x=reshape(mat['x'],(-1))
++y=reshape(mat['y'],(-1))
+ vx=mat['vx']
+ vy=mat['vy']
+ #deal with 'F' oriented matlab matrices!
+@@ -57,8 +59,7 @@
+ md.timestepping.final_time = 3.
+ #Deal with boundary conditions:
+ md = SetIceShelfBC(md)
+-#Change name so that no test have the same name
+-A = dbstack
+-if length(A) > 2.:
+-    md.miscellaneous.name = A[2].file[0:0-2.]
++#Change name so that no tests have the same name
++if len(inspect.stack()) > 2:
++    md.miscellaneous.name = inspect.stack()[2][1].split('.')[0]
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py	(revision 12852)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py	(revision 12853)
+@@ -7,9 +7,6 @@
+ import netCDF4
+ import sys
+ 
+-from parallelrange import parallelrange
+-from IdToName import IdToName
+-
+ def runme(id=None,exclude=None,benchmark='nightly',procedure='check',output='none',rank=1,numprocs=1):
+ 	"""
+ 	RUNME - test deck for ISSM nightly runs
+@@ -42,6 +39,9 @@
+ 	       md=runme(id=102,procedure='update')
+ 	"""
+ 
++	from parallelrange import parallelrange
++	from IdToName import IdToName
++
+ 	#Get ISSM_DIR variable
+ 	ISSM_DIR=os.environ['ISSM_DIR']
+ 	print 'ISSM_DIR =',ISSM_DIR
Index: /issm/oecreview/Archive/12678-13393/ISSM-12853-12854.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12853-12854.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12853-12854.diff	(revision 13394)
@@ -0,0 +1,166 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.py	(revision 12853)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.py	(revision 12854)
+@@ -1,91 +1,98 @@
+-from numpy import *
++import os
++import numpy
++
+ def SetIceShelfBC(md,icefrontfile=''):
+-	#SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
+-	#
+-	#   Neumann BC are used on the ice front (an ANRGUS contour around the ice front
+-	#   must be given in input)
+-	#   Dirichlet BC are used elsewhere for diagnostic
+-	#
+-	#   Usage:
+-	#      md=SetIceShelfBC(md,varargin)
+-	#
+-	#   Example:
+-	#      md=SetIceShelfBC(md);
+-	#      md=SetIceShelfBC(md,'Front.exp');
+-	#
+-	#   See also: SETICESHEETBC, SETMARINEICESHEETBC
++	"""
++	SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
++	 
++	    Neumann BC are used on the ice front (an ANRGUS contour around the ice front
++	    must be given in input)
++	    Dirichlet BC are used elsewhere for diagnostic
++	 
++	    Usage:
++	       md=SetIceShelfBC(md,varargin)
++	 
++	    Example:
++	       md=SetIceShelfBC(md);
++	       md=SetIceShelfBC(md,'Front.exp');
++	 
++	    See also: SETICESHEETBC, SETMARINEICESHEETBC
++	"""
+ 
+ 	#node on Dirichlet (boundary and ~icefront)
+-	if not icefrontfile:
+-		nodeonicefront=zeros(md.mesh.numberofvertices)
++	if icefrontfile:
++		if not os.path.exists(icefrontfile):
++			raise IOError("SetIceShelfBC error message: ice front file '%s' not found." % icefrontfile)
++		nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2)
++		nodeonicefront=double(md.mesh.vertexonboundary and nodeinsideicefront)
+ 	else:
+-		if not os.path.isfile(icefrontfile):
+-			print 'SetIceShelfBC error message: ice front file '+icefrontfile+ ' not found'
+-			return []
+-		nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2)
+-		nodeonicefront=double(md.mesh.vertexonboundary.astype(bool) and nodeinsideicefront.astype(bool))
+-	
+-	pos=argwhere(logical_and(md.mesh.vertexonboundary.astype(bool),~nodeonicefront.astype(bool)))
+-	md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices);
+-	md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices);
+-	md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices);
+-	md.diagnostic.spcvx[pos]=0;
+-	md.diagnostic.spcvy[pos]=0;
+-	md.diagnostic.spcvz[pos]=0;
+-	md.diagnostic.referential=float('NaN')*ones((md.mesh.numberofvertices,6),float);
++		nodeonicefront=numpy.zeros(md.mesh.numberofvertices)
+ 
++#	pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
++	pos=[i for i,(vob,noif) in enumerate(zip(md.mesh.vertexonboundary,nodeonicefront)) if vob and not noif]
++	md.diagnostic.spcvx=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.diagnostic.spcvy=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.diagnostic.spcvz=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.diagnostic.spcvx[pos]=0
++	md.diagnostic.spcvy[pos]=0
++	md.diagnostic.spcvz[pos]=0
++	md.diagnostic.referential=float('NaN')*numpy.ones((md.mesh.numberofvertices,6))
++
+ 	#Dirichlet Values
+-	if ~isnan(md.inversion.vx_obs) and ~isnan(md.inversion.vy_obs):
+-		if (len(md.inversion.vx_obs)==md.mesh.numberofvertices) and (len(md.inversion.vy_obs)==md.mesh.numberofvertices):
+-			print '      boundary conditions for diagnostic model: spc set as observed velocities'
+-			md.diagnostic.spcvx[pos]=md.inversion.vx_obs[pos]
+-			md.diagnostic.spcvy[pos]=md.inversion.vy_obs[pos]
++	if numpy.size(md.inversion.vx_obs)==md.mesh.numberofvertices and numpy.size(md.inversion.vy_obs)==md.mesh.numberofvertices:
++		print '      boundary conditions for diagnostic model: spc set as observed velocities'
++		md.diagnostic.spcvx[pos]=md.inversion.vx_obs[pos]
++		md.diagnostic.spcvy[pos]=md.inversion.vy_obs[pos]
+ 	else:
+ 		print '      boundary conditions for diagnostic model: spc set as zero'
+ 
+ 	#segment on Ice Front
+ 	#segment on Neumann (Ice Front)
+-	segs1=md.mesh.segments[:,0].astype(int)-1
+-	segs2=md.mesh.segments[:,1].astype(int)-1
+-
+-	pos=argwhere(logical_and(nodeonicefront[segs1].astype(bool),nodeonicefront[segs2].astype(bool)))
+-	if (md.mesh.dimension==2):
+-		pressureload=md.mesh.segments[pos,:];
++#	pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
++	pos=[i for i,(noif1,noif2) in enumerate(zip(nodeonicefront[md.mesh.segments[:,0].astype('int')-1],nodeonicefront[md.mesh.segments[:,1].astype('int')-1])) if noif1 or noif2]
++	if   md.mesh.dimension==2:
++		pressureload=md.mesh.segments[pos,:]
+ 	elif md.mesh.dimension==3:
+-		pressureload_layer=[md.mesh.segments[pos,0:2],md.mesh.segments[pos,1]+md.mesh.numberofvertices2d,md.mesh.segments[pos,0]+md.mesh.numberofvertices2d, md.mesh.segments[pos,2]];
+-		pressureload=[];
+-		for i in range(1,md.mesh.numberoflayers-1):
+-			pressureload=[pressureload ,pressureload_layer1[:,1:4]+(i-1)*md.mesh.numberofvertices2d, pressureload_layer1[:,5]+(i-1)*md.mesh.numberofelements2d ];
++#		pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
++		pressureload_layer1=numpy.concatenate((md.mesh.segments[pos,0:2],md.mesh.segments[pos,1]+md.mesh.numberofvertices2d,md.mesh.segments[pos,0]+md.mesh.numberofvertices2d,md.mesh.segments[pos,2]),axis=1)
++		pressureload=numpy.zeros((0,5))
++		for i in xrange(1,md.mesh.numberoflayers):
++#			pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
++			pressureload=numpy.concatenate((pressureload,numpy.concatenate((pressureload_layer1[:,0:3]+(i-1)*md.mesh.numberofvertices2d,pressureload_layer1[:,4]+(i-1)*md.mesh.numberofelements2d),axis=1)),axis=0)
+ 
+ 	#Add water or air enum depending on the element
+-	pressureload=[pressureload, 1*md.mask.elementonfloatingice(pressureload[:,end])];
++#	pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))];
++	pressureload=numpy.concatenate((pressureload,1*md.mask.elementonfloatingice[pressureload[:,-1].astype('int')-1].reshape((-1,1))),axis=1)
+ 
+ 	#plug onto model
+-	md.diagnostic.icefront=pressureload;
++	md.diagnostic.icefront=pressureload
+ 
+ 	#Create zeros basalforcings and surfaceforcings
+-	if isnan(md.surfaceforcings.precipitation):
+-		md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices);
++	if numpy.isnan(md.surfaceforcings.precipitation).all():
++		md.surfaceforcings.precipitation=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no surfaceforcings.precipitation specified: values set as zero'
+-	if isnan(md.surfaceforcings.mass_balance):
+-		md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices);
++	if numpy.isnan(md.surfaceforcings.mass_balance).all():
++		md.surfaceforcings.mass_balance=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no surfaceforcings.mass_balance specified: values set as zero'
+-	if isnan(md.basalforcings.melting_rate):
+-		md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices)
++	if numpy.isnan(md.basalforcings.melting_rate).all():
++		md.basalforcings.melting_rate=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no basalforcings.melting_rate specified: values set as zero'
+-	if isnan(md.balancethickness.thickening_rate):
+-		md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices);
++	if numpy.isnan(md.balancethickness.thickening_rate).all():
++		md.balancethickness.thickening_rate=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no balancethickness.thickening_rate specified: values set as zero'
+ 
+-	md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices);
+-	md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices);
++	md.prognostic.spcthickness=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.balancethickness.spcthickness=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+ 
+-	if (len(md.initialization.temperature)==md.mesh.numberofvertices):
+-		md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices);
+-		pos=argwhere(md.mesh.vertexonsurface); md.thermal.spctemperature[pos]=md.initialization.temperature[pos]; #impose observed temperature on surface
+-		if (len(md.basalforcings.geothermalflux) !=md.mesh.numberofvertices):
+-			md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices);
++	if numpy.size(md.initialization.temperature)==md.mesh.numberofvertices:
++		md.thermal.spctemperature=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++#		pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
++		pos=[i for i,vos in enumerate(md.mesh.vertexonsurface) if vos]
++		md.thermal.spctemperature[pos]=md.initialization.temperature[pos]    # impose observed temperature on surface
++		if not numpy.size(md.basalforcings.geothermalflux)==md.mesh.numberofvertices:
++			md.basalforcings.geothermalflux=numpy.zeros(md.mesh.numberofvertices)
+ 	else:
+ 		print '      no thermal boundary conditions created: no observed temperature found'
+ 
+ 	return md
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12854-12855.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12854-12855.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12854-12855.diff	(revision 13394)
@@ -0,0 +1,21 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 12854)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 12855)
+@@ -16,7 +16,15 @@
+ void	SolverxPetsc(PetscVec** puf, PetscMat* Kff, PetscVec* pf, PetscVec* uf0,PetscVec* df, Parameters* parameters){
+ 
+ 	PetscVec* uf=new PetscVec();
+-	SolverxPetsc(&uf->vector, Kff->matrix, pf->vector, uf0->vector, df->vector, parameters);
++
++	Vec uf0_vector = NULL;
++	Vec df_vector  = NULL;
++	
++	if(uf0) uf0_vector = uf0->vector;
++	if(df)  df_vector  = df->vector;
++
++	SolverxPetsc(&uf->vector, Kff->matrix, pf->vector, uf0_vector, df_vector, parameters);
++
+ 	*puf=uf;
+ 
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-12855-12856.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12855-12856.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12855-12856.diff	(revision 13394)
@@ -0,0 +1,57 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.py	(revision 12855)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.py	(revision 12856)
+@@ -1,29 +1,25 @@
+-def addnote(md, string):
++def addnote(md,string):
++	"""
++	ADDNOTE - add a note to the existing model notes field
++	 
++	    Usage:
++	       md=addnote(md,string);
++	 
++	    Example:
++	       md=addnote(md,'Pine Island, Geometry of 2007');
++	"""
+ 
+-    # Local Variables: md, string, i, notes, miscellaneous, newnotes
+-    # Function calls: ischar, nargout, cell, nargin, length, addnote, error
+-    #ADDNOTE - add a note to the existing model notes field
+-    #
+-    #   Usage:
+-    #      md=addnote(md,string);
+-    #
+-    #   Example:
+-    #      md=addnote(md,'Pine Island, Geometry of 2007');
+-    
+-	if not isinstance(string,basetring):
+-        print 'addnote error message: second input argument should be a string'
+-		return []
+-    
+-    notes = md.miscellaneous.notes
+-    
+-	if isinstance(notes,basestring):
++	if not isinstance(string,str):
++		raise TypeError('addnote error message: second input argument should be a string')
++
++	notes=md.miscellaneous.notes
++
++	if isinstance(notes,str):
+ 		newnotes=[notes,string]
+-    else:
+-		newnotes=[];
+-		for i in range(len(notes)):
+-			newnotes=newnotes+notes[i]
+-            
+-        newnotes=newnotes+nodes;
+-        
+-    md.miscellaneous.notes = newnotes
+-    return md
++	else:
++		newnotes=notes.append(string)
++
++	md.miscellaneous.notes=newnotes
++
++	return md
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12856-12857.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12856-12857.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12856-12857.diff	(revision 13394)
@@ -0,0 +1,30 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 12856)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 12857)
+@@ -30,8 +30,7 @@
+ /*FUNCTION PetscMat::PetscMat(int M,int N){{{*/
+ PetscMat::PetscMat(int M,int N){
+ 
+-	this->matrix=NULL;
+-	if(M*N)this->matrix=NewMat(M,N);
++	this->matrix=NewMat(M,N);
+ }
+ /*}}}*/
+ /*FUNCTION PetscMat::PetscMat(int M,int N, IssmDouble sparsity){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 12856)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 12857)
+@@ -28,8 +28,9 @@
+ /*}}}*/
+ /*FUNCTION PetscVec::PetscVec(int M,bool fromlocalsize){{{*/
+ PetscVec::PetscVec(int M,bool fromlocalsize){
+-	this->vector=NULL;
+-	if(M) this->vector=NewVec(M,fromlocalsize);
++	
++	this->vector=NewVec(M,fromlocalsize);
++
+ }
+ /*}}}*/
+ /*FUNCTION PetscVec::PetscVec(IssmDouble* serial_vec,int M){{{*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-12857-12858.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12857-12858.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12857-12858.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/getcolormap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/getcolormap.m	(revision 12857)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/getcolormap.m	(revision 12858)
+@@ -4,9 +4,9 @@
+ %   Usage:
+ %      map = getcolormap(options)
+ 
+-%default is jet(256)
++%default is jet
+ if ~exist(options,'colormap'),
+-	map = jet(256);
++	map = jet;
+ 	return
+ end
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12858-12859.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12858-12859.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12858-12859.diff	(revision 13394)
@@ -0,0 +1,92 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 12858)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 12859)
+@@ -36,40 +36,37 @@
+ /*FUNCTION PetscMat::PetscMat(int M,int N, IssmDouble sparsity){{{*/
+ PetscMat::PetscMat(int M,int N, IssmDouble sparsity){
+ 
+-	this->matrix=NULL;
+-	if(M*N) this->matrix=NewMat(M,N,sparsity);
++	this->matrix=NewMat(M,N,sparsity);
+ }
+ /*}}}*/
+ /*FUNCTION PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){{{*/
+ PetscMat::PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){
+ 
+-	this->matrix=NULL;
++	int     i;
++	int* idxm=NULL;
++	int* idxn=NULL;
+ 	
+-	if(M*N){
+-		int     i;
+-		int* idxm=xNew<int>(M);
+-		int* idxn=xNew<int>(N);
+-	
+-		for(i=0;i<M;i++)idxm[i]=i;
+-		for(i=0;i<N;i++)idxn[i]=i;
++	if(M)idxm=xNew<int>(M);
++	if(N)idxn=xNew<int>(N);
+ 
++	for(i=0;i<M;i++)idxm[i]=i;
++	for(i=0;i<N;i++)idxn[i]=i;
+ 
+-		this->matrix=NewMat(M,N,sparsity);
+-		MatSetValues(this->matrix,M,idxm,N,idxn,serial_mat,INSERT_VALUES);
+-		MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
+-		MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
+ 
+-		xDelete<int>(idxm);
+-		xDelete<int>(idxn);
+-	}
++	this->matrix=NewMat(M,N,sparsity);
++	MatSetValues(this->matrix,M,idxm,N,idxn,serial_mat,INSERT_VALUES);
++	MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
++	MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
+ 
++	xDelete<int>(idxm);
++	xDelete<int>(idxn);
++
+ }
+ /*}}}*/
+ /*FUNCTION PetscMat::PetscMat(int M,int N, int connectivity, int numberofdofspernode){{{*/
+ PetscMat::PetscMat(int M,int N, int connectivity,int numberofdofspernode){
+ 	
+-	this->matrix=NULL;
+-	if(M*N) this->matrix=NewMat(M,N,connectivity,numberofdofspernode);
++	this->matrix=NewMat(M,N,connectivity,numberofdofspernode);
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 12858)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 12859)
+@@ -36,18 +36,16 @@
+ /*FUNCTION PetscVec::PetscVec(IssmDouble* serial_vec,int M){{{*/
+ PetscVec::PetscVec(IssmDouble* serial_vec,int M){
+ 
+-	this->vector=NULL;
+-	if(M){
+-		int* idxm=xNew<int>(M);
+-		for(int i=0;i<M;i++) idxm[i]=i;
++	int* idxm=NULL;
++	if(M)idxm=xNew<int>(M);
++	for(int i=0;i<M;i++) idxm[i]=i;
+ 
+-		this->vector=NewVec(M);
+-		VecSetValues(this->vector,M,idxm,serial_vec,INSERT_VALUES);
+-		VecAssemblyBegin(this->vector);
+-		VecAssemblyEnd(this->vector);
++	this->vector=NewVec(M);
++	VecSetValues(this->vector,M,idxm,serial_vec,INSERT_VALUES);
++	VecAssemblyBegin(this->vector);
++	VecAssemblyEnd(this->vector);
+ 
+-		xDelete<int>(idxm);
+-	}
++	xDelete<int>(idxm);
+ }
+ /*}}}*/
+ /*FUNCTION PetscVec::~PetscVec(){{{*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-12859-12860.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12859-12860.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12859-12860.diff	(revision 13394)
@@ -0,0 +1,140 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12859)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12860)
+@@ -167,7 +167,9 @@
+ 	else if(type==SeqMatType){
+ 		this->smatrix->Assemble();
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else{
++		_error2_("Matrix type: " << type << " not supported yet!");
++	}
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::Norm{{{*/
+@@ -301,19 +303,21 @@
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::Convert{{{*/
+-void Matrix::Convert(MatrixType type){
++void Matrix::Convert(MatrixType newtype){
+ 
+-	if((int)type==(int)PetscMatType){
++	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+-		this->pmatrix->Convert(type);
++		this->pmatrix->Convert(newtype);
+ 		#else
+ 		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+-	else if((int)type==(int)SeqMatType){
+-		this->smatrix->Convert(type);
++	else if(type==SeqMatType){
++		this->smatrix->Convert(newtype);
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else{
++		_error2_("Matrix type: " << type << " not supported yet!");
++	}
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 12859)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 12860)
+@@ -15,21 +15,19 @@
+ #endif
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+-
++/*}}}*/
+ class Vector;
+-/*}}}*/
++enum matrixtype{PetscMatType, SeqMatType};
+ 
+-enum matrixtype { PetscMatType, SeqMatType };
+-
+ class Matrix{
+ 
+ 	public:
+ 
+ 		#ifdef _HAVE_PETSC_
+-		PetscMat* pmatrix;
++		PetscMat *pmatrix;
+ 		#endif
+-		SeqMat* smatrix; 
+-		int     type;
++		SeqMat   *smatrix;
++		int       type;
+ 
+ 		/*Matrix constructors, destructors {{{*/
+ 		Matrix();
+@@ -40,18 +38,17 @@
+ 		~Matrix();
+ 		/*}}}*/
+ 		/*Matrix specific routines {{{*/
+-		void Echo(void);
+-		void Assemble(void);
+-		IssmDouble Norm(NormMode norm_type);
+-		void GetSize(int* pM,int* pN);
+-		void GetLocalSize(int* pM,int* pN);
+-		void MatMult(Vector* X,Vector* AX);
+-		Matrix* Duplicate(void);
+-		IssmDouble* ToSerial(void);
+-		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode);
+-		void Convert(MatrixType type);
++		void        Echo(void);
++		void        Assemble(void);
++		IssmDouble  Norm(NormMode norm_type);
++		void        GetSize(int *pM,int*pN);
++		void        GetLocalSize(int *pM,int*pN);
++		void        MatMult(Vector *X,Vector*AX);
++		Matrix     *Duplicate(void);
++		IssmDouble *ToSerial(void);
++		void        SetValues(int m,int *idxm,int n,int*idxn,IssmDouble*values,InsMode mode);
++		void        Convert(MatrixType newtype);
+ 		/*}}}*/
+-
+ };
+ 
+ #endif //#ifndef _MATRIX_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 12859)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 12860)
+@@ -191,14 +191,13 @@
+ 	OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
+ 
+ 	/*Output : */
+-	index_matrix=new Matrix(index,out.numberoftriangles,3,1); 
+-	index_matrix->Convert(DENSE_SEQUENTIAL);
++	index_matrix=new Matrix(index,out.numberoftriangles,3,1,SeqMatType);
+ 	*pindex=index_matrix;
+ 	
+-	segments_matrix=new Matrix(segments,out.numberofsegments,3,1); segments_matrix->Convert(DENSE_SEQUENTIAL);
++	segments_matrix=new Matrix(segments,out.numberofsegments,3,1,SeqMatType);
+ 	*psegments=segments_matrix;
+ 
+-	*px=new Vector(x,out.numberofpoints);
+-	*py=new Vector(y,out.numberofpoints);
+-	*psegmentmarkerlist=new Vector(segmentmarkerlist,out.numberofsegments);
++	*px=new Vector(x,out.numberofpoints,SeqMatType);
++	*py=new Vector(y,out.numberofpoints,SeqMatType);
++	*psegmentmarkerlist=new Vector(segmentmarkerlist,out.numberofsegments,SeqMatType);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 12859)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 12860)
+@@ -44,7 +44,7 @@
+ 	if(M*N) this->matrix=xNewZeroInit<IssmDouble>(pM*pN);
+ }
+ /*}}}*/
+-/*FUNCTION SeqMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){{{*/
++/*FUNCTION SeqMat::SeqMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){{{*/
+ SeqMat::SeqMat(IssmDouble* serial_mat,int pM,int pN,IssmDouble sparsity){
+ 
+ 	int i,j;
Index: /issm/oecreview/Archive/12678-13393/ISSM-12860-12861.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12860-12861.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12860-12861.diff	(revision 13394)
@@ -0,0 +1,21 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 12860)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 12861)
+@@ -50,11 +50,11 @@
+ 	/*free ressources: */
+ 	delete domain;
+ 	delete rifts;
+-	xdelete_module(&index);
+-	xdelete_module(&x);
+-	xdelete_module(&y);
+-	xdelete_module(&segments);
+-	xdelete_module(&segmentmarkerlist);
++	delete index;
++	delete x;
++	delete y;
++	delete segments;
++	delete segmentmarkerlist;
+ 
+ 	/*end module: */
+ 	MODULEEND();
Index: /issm/oecreview/Archive/12678-13393/ISSM-12861-12862.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12861-12862.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12861-12862.diff	(revision 13394)
@@ -0,0 +1,89 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp	(revision 12861)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp	(revision 12862)
+@@ -1,41 +0,0 @@
+-/* \file alloc_module.h
+- */
+-
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile without HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <stdlib.h>
+-
+-#include  "./alloc_module.h"
+-#include "../Exceptions/exceptions.h"
+-#include "../../include/include.h"
+-#include "../../classes/objects/objects.h"
+-
+-void xdelete_module(Matrix** pv){
+-	
+-	if (pv && *pv){
+-		/*Actually, still get rid of internal Petsc matrix. Quick fix until Matlab handles C++ 
+-		 * correctly: */
+-		#ifdef _HAVE_PETSC_
+-			MatFree(&(*pv)->pmatrix->matrix);
+-		#endif
+-		*pv=NULL;
+-	}
+-}
+-
+-void xdelete_module(Vector** pv){
+-
+-	if (pv && *pv){
+-		/*Actually, still get rid of internal Petsc vector. Quick fix until Matlab handles C++ 
+-		 * correctly: */
+-		#ifdef _HAVE_PETSC_
+-			VecFree(&(*pv)->pvector->vector);
+-		#endif
+-		*pv=NULL;
+-	}
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.h	(revision 12861)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.h	(revision 12862)
+@@ -1,11 +0,0 @@
+-/* \file alloc.h
+- */
+-
+-#ifndef _ALLOC_MODULE_H_
+-#define _ALLOC_MODULE_H_
+-class Matrix;
+-class Vector;
+-void xdelete_module(Matrix** pvptr);
+-void xdelete_module(Vector** pvptr);
+-
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/shared.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/shared.h	(revision 12861)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/shared.h	(revision 12862)
+@@ -6,7 +6,6 @@
+ #define _SHARED_H_
+ 
+ #include "Alloc/alloc.h"
+-#include "Alloc/alloc_module.h"
+ #include "Alloc/xNewDelete.h"
+ #include "Bamg/shared.h"
+ #include "Elements/elements.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12861)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12862)
+@@ -838,9 +838,7 @@
+ 
+ #}}}
+ #Modules sources{{{
+-module_sources= ./shared/Alloc/alloc_module.h\
+-			./shared/Alloc/alloc_module.cpp\
+-			./shared/Threads/issm_threads.h\
++module_sources= ./shared/Threads/issm_threads.h\
+ 			./shared/Threads/LaunchThread.cpp\
+ 			./shared/Threads/PartitionRange.cpp\
+ 			./shared/Exp/exp.h\
Index: /issm/oecreview/Archive/12678-13393/ISSM-12862-12863.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12862-12863.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12862-12863.diff	(revision 13394)
@@ -0,0 +1,60 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 12862)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 12863)
+@@ -41,7 +41,7 @@
+ 	this->M=pM;
+ 	this->vector=NULL;
+ 	if(this->M){
+-		this->vector=xNewZeroInit<IssmDouble>(pM);
++		this->vector=xNew<IssmDouble>(pM);
+ 		xMemCpy<IssmDouble>(this->vector,buffer,pM);
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 12862)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 12863)
+@@ -33,6 +33,20 @@
+ 
+ }
+ /*}}}*/
++/*FUNCTION PetscVec::PetscVec(Vec petsc_vec){{{*/
++PetscVec::PetscVec(Vec petsc_vec){
++
++	if(petsc_vec==NULL){
++		this->vector=NewVec(0);
++	}
++	else{
++		/*copy vector*/
++		VecDuplicate(petsc_vec,&this->vector);
++		VecCopy(petsc_vec,this->vector);
++	}
++
++}
++/*}}}*/
+ /*FUNCTION PetscVec::PetscVec(IssmDouble* serial_vec,int M){{{*/
+ PetscVec::PetscVec(IssmDouble* serial_vec,int M){
+ 
+@@ -53,21 +67,7 @@
+     VecFree(&this->vector);
+ }
+ /*}}}*/
+-/*FUNCTION Vector::Vector(Vec petsc_vec){{{*/
+-PetscVec::PetscVec(Vec petsc_vec){
+ 
+-	if(petsc_vec==NULL){
+-		this->vector=NewVec(0);
+-	}
+-	else{
+-		/*copy vector*/
+-		VecDuplicate(petsc_vec,&this->vector);
+-		VecCopy(petsc_vec,this->vector);
+-	}
+-
+-}
+-/*}}}*/
+-
+ /*PetscVec specific routines: */
+ /*FUNCTION PetscVec::Echo{{{*/
+ void PetscVec::Echo(void){
Index: /issm/oecreview/Archive/12678-13393/ISSM-12863-12864.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12863-12864.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12863-12864.diff	(revision 13394)
@@ -0,0 +1,119 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 12863)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 12864)
+@@ -11,7 +11,6 @@
+ 
+ int InterpFromMesh2dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
+ 		double* default_values,int num_default_values,Contour** contours,int numcontours){
+-
+ 	
+ 	/*Output*/
+ 	Vector* data_prime=NULL;
+@@ -71,7 +70,7 @@
+ 	}
+ 
+ 	/*Initialize output*/
+-	data_prime=new Vector(nods_prime);
++	data_prime=new Vector(nods_prime,false,SeqVecType);
+ 	if(num_default_values){
+ 		if(num_default_values==1)for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[0],INS_VAL);
+ 		else for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[i],INS_VAL);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp	(revision 12863)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp	(revision 12864)
+@@ -7,68 +7,42 @@
+ 
+ void* InterpFromMesh2dxt(void* vpthread_handle){
+ 
+-	/*gate variables :*/
+-	InterpFromMesh2dxThreadStruct* gate=NULL;
+-	pthread_handle* handle=NULL;
+-	int     my_thread;
+-	int     num_threads;
+-	
+-	int interpolation_type;
+-	bool debug;
+-	int  nels_data;
+-	double *index_data         = NULL;
+-	double *x_data             = NULL;
+-	double *y_data             = NULL;
+-	double *data               = NULL;
+-	double  xmin                 ,xmax;
+-	double  ymin                 ,ymax;
+-	int     nods_prime;
+-	Vector *data_prime         = NULL;
+-	double *x_prime            = NULL;
+-	double *y_prime            = NULL;
+-	double *default_values     = NULL;
+-	int     num_default_values;
+-	double *incontour          = NULL;
+-
+ 	/*intermediary: */
+-	int     i0;
+-	int     i1;
+-	int     i,j;
+-	double  area;
+-	double  area_1,area_2,area_3;
++	int     i0,i1,i,j;
++	double  area,area_1,area_2,area_3;
+ 	double  data_value;
+ 
+ 	/*recover handle and gate: */
+-	handle=(pthread_handle*)vpthread_handle;
+-	gate=(InterpFromMesh2dxThreadStruct*)handle->gate;
+-	my_thread=handle->id;
+-	num_threads=handle->num;
++	pthread_handle                *handle      = (pthread_handle*)vpthread_handle;
++	InterpFromMesh2dxThreadStruct *gate        = (InterpFromMesh2dxThreadStruct*)handle->gate;
++	int                            my_thread   = handle->id;
++	int                            num_threads = handle->num;
+ 	
+ 	/*recover parameters :*/
+-	interpolation_type = gate->interpolation_type;
+-	debug              = gate->debug;
+-	nels_data          = gate->nels_data;
+-	index_data         = gate->index_data;
+-	x_data             = gate->x_data;
+-	y_data             = gate->y_data;
+-	data               = gate->data;
+-	xmin               = gate->xmin;
+-	xmax               = gate->xmax;
+-	ymin               = gate->ymin;
+-	ymax               = gate->ymax;
+-	nods_prime         = gate->nods_prime;
+-	data_prime         = gate->data_prime;
+-	x_prime            = gate->x_prime;
+-	y_prime            = gate->y_prime;
+-	default_values     = gate->default_values;
+-	num_default_values = gate->num_default_values;
+-	incontour          = gate->incontour;
++	int     interpolation_type = gate->interpolation_type;
++	bool    debug              = gate->debug;
++	int     nels_data          = gate->nels_data;
++	double *index_data         = gate->index_data;
++	double *x_data             = gate->x_data;
++	double *y_data             = gate->y_data;
++	double *data               = gate->data;
++	double  xmin               = gate->xmin;
++	double  xmax               = gate->xmax;
++	double  ymin               = gate->ymin;
++	double  ymax               = gate->ymax;
++	int     nods_prime         = gate->nods_prime;
++	Vector *data_prime         = gate->data_prime;
++	double *x_prime            = gate->x_prime;
++	double *y_prime            = gate->y_prime;
++	double *default_values     = gate->default_values;
++	int     num_default_values = gate->num_default_values;
++	double *incontour          = gate->incontour;
+ 
+ 	/*partition loop across threads: */
+ 	PartitionRange(&i0,&i1,nels_data,num_threads,my_thread);
+ 
+ 	/*Loop over the elements*/
+-	for (i=i0;i<i1;i++){
++	for(i=i0;i<i1;i++){
+ 
+ 		/*display current iteration*/
+ 		if (debug && my_thread==0 && fmod((double)i,(double)100)==0)
Index: /issm/oecreview/Archive/12678-13393/ISSM-12864-12865.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12864-12865.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12864-12865.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 12864)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 12865)
+@@ -69,7 +69,7 @@
+ 	_assert_(Kff);
+ 	MatGetSize(Kff,&global_m,&global_n); _assert_(global_m==global_m);
+ 	if(!global_n){
+-		*puf=NULL; return;
++		*puf=NewVec(0); return;
+ 	}
+ 
+ 	/*Initial guess */
Index: /issm/oecreview/Archive/12678-13393/ISSM-12865-12866.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12865-12866.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12865-12866.diff	(revision 13394)
@@ -0,0 +1,91 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12865)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12866)
+@@ -930,17 +930,17 @@
+ 			input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);
+ 			input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
+ 			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
+-			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++			PrecipitationsPresentday[iv][month]=PrecipitationsPresentday[iv][month]/yts; // converion in m/sec
+ 		}
+ 	}
+ 	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
+-	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
+-	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
+-	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
+-	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
+-	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
+-	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
+-
++	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime);
++        this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-(21000*yts)));
++	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time);
++	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime);
++	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-(21000*yts)));
++	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time);
++	
+ 	/*Compute the temperature and precipitation*/
+ 	for(int iv=0;iv<NUMVERTICES;iv++){
+ 		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
+@@ -949,16 +949,17 @@
+ 					&TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 
+ 					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
+ 	}
++	//if(id==1)	printf(" monthlytemperatures1 %f\n",monthlytemperatures[iv][0]);
++	//if(id==1)	printf(" monthlyprec1 %f\n",monthlyprec[iv][0]*yts);
+ 	/*Update inputs*/ 
+ 	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
+ 	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
+ 	for (int imonth=0;imonth<12;imonth++) {
+-		for(int iv=0;iv<NUMVERTICES;iv++) {
+-			TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
+-			NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
+-			TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
+-			NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
+-		}
++			TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&TemperaturesPresentday[0][imonth]);
++			//TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[0][imonth]);
++			NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
++			TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[0][imonth]);
++			NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
+ 	}
+ 	this->inputs->AddInput(NewTemperatureInput);
+ 	this->inputs->AddInput(NewPrecipitationInput);
+@@ -1384,7 +1385,7 @@
+ void  Tria::InputToResult(int enum_type,int step,IssmDouble time){
+ 
+ 	int    i;
+-	Input *input = NULL;
++	Input *input = NULL;	
+ 
+ 	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
+ 	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(enum_type);
+@@ -2153,7 +2154,7 @@
+ 
+    IssmDouble agd[NUMVERTICES];             // surface mass balance
+    IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+-   IssmDouble h[NUMVERTICES],s[NUMVERTICES]; // ,b
++   IssmDouble h[NUMVERTICES],s[NUMVERTICES];
+    IssmDouble rho_water,rho_ice;
+ 
+    /*Recover monthly temperatures and precipitation*/
+@@ -2169,7 +2170,7 @@
+        input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts);
+        monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius
+        input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts);
+-       monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++       monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion in m/y
+      }
+    }
+ 
+@@ -2181,6 +2182,9 @@
+   rho_ice=matpar->GetRhoIce();
+   rho_water=matpar->GetRhoFreshwater();
+ 
++  //if(id==1) printf(" monthlytemperatures %f\n",monthlytemperatures[1][0]);
++  //if(id==1) printf("monthlyprec %f\n",monthlyprec[1][0]);
++
+    /*measure the surface mass balance*/
+    for (int iv = 0; iv<NUMVERTICES; iv++){
+      agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], pdds, pds, signorm, yts, h[iv], s[iv], rho_ice, rho_water);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12866-12867.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12866-12867.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12866-12867.diff	(revision 13394)
@@ -0,0 +1,46 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 12866)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 12867)
+@@ -14,15 +14,25 @@
+   IssmDouble monthlytemperaturestmp[12],monthlyprectmp[12];
+   IssmDouble delta18oLapseRate=-6.2*pow(10.,-3);
+   IssmDouble glacialindex; // used to vary present day temperature
++  int imonth=0;
++  // printf("Delta18oTime %f\n",Delta18oTime);
++  // printf("Delta18oPresent %f\n",Delta18oPresent);
++  // printf("Delta18oLgm %f\n",Delta18oLgm);
+ 
+   glacialindex = (Delta18oTime-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceTime-Delta18oSurfacePresent))
+     /(Delta18oLgm-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceLgm-Delta18oSurfacePresent));
+-  
++  // printf(" monthlytemperatureseeeeee %f\n",TemperaturesPresentday[1]);
++  // printf(" monthlypreceeeeeeee %f\n",TemperaturesLgm[1]);
++  // printf(" glacialindex %f\n",glacialindex);
++
+   for (int imonth = 0; imonth<12; imonth++){  
+-    monthlytemperaturestmp[imonth] = glacialindex*TemperaturesLgm[imonth] + (1-glacialindex)*TemperaturesPresentday[imonth];
+-    monthlyprectmp[imonth] = 1.5*pow(2,((monthlytemperaturestmp[imonth]-0)/10)); //equation from rob's paper
++    monthlytemperaturestmp[imonth] = TemperaturesPresentday[imonth];//glacialindex*TemperaturesLgm[imonth] + (1-glacialindex)*TemperaturesPresentday[imonth];
++    //monthlyprectmp[imonth] = 1.5*pow(2,((monthlytemperaturestmp[imonth]-273.15-0)/10)); //equation from rob's paper
++    monthlyprectmp[imonth] = PrecipitationsPresentday[imonth];
++
+     /*Assign output pointer*/
+     *(monthlytemperaturesout+imonth) = monthlytemperaturestmp[imonth];
+     *(monthlyprecout+imonth) = monthlyprectmp[imonth];
+   }
++  // printf(" tempera %f\n",monthlytemperaturestmp[1]);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 12866)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 12867)
+@@ -60,7 +60,7 @@
+   IssmDouble pddtj, hmx2;
+   
+   sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months
+-  
++
+   /*PDD constant*/
+   siglim = 2.5*signorm; 
+   siglimc = 2.5*signormc;
Index: /issm/oecreview/Archive/12678-13393/ISSM-12868-12869.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12868-12869.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12868-12869.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test421.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test421.m	(revision 12868)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test421.m	(revision 12869)
+@@ -8,7 +8,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-08,1e-09,1e-05,1e-09,1e-09};
++field_tolerances={1e-08,1e-09,2e-05,1e-09,1e-09};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
Index: /issm/oecreview/Archive/12678-13393/ISSM-12869-12870.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12869-12870.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12869-12870.diff	(revision 13394)
@@ -0,0 +1,93 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12869)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12870)
+@@ -138,6 +138,12 @@
+ 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BedEnum);
+ 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsMassBalanceEnum);
+ 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,MaskElementonfloatingiceEnum);
++			bool isdelta18o;
++			femmodel->parameters->FindParam(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
++			if(isdelta18o){
++				InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsMonthlytemperaturesEnum);
++				InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsPrecipitationEnum);
++			}
+ 			RequestedOutputsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs);
+ 
+ 			if(VerboseSolution()) _pprintLine_("   saving temporary results");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12869)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12870)
+@@ -909,23 +909,28 @@
+ /*}}}*/
+ /*FUNCTION Tria::Delta18oParameterization{{{*/
+ void  Tria::Delta18oParameterization(void){
++
++	int        i;
+ 	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+ 	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
+ 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
++	IssmDouble temp[NUMVERTICES];
+ 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
+ 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
+ 	IssmDouble time,yts,finaltime;
++
++	/*Recover parameters*/
+ 	this->parameters->FindParam(&time,TimeEnum);
+ 	this->parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+ 
+ 	/*Recover present day temperature and precipitation*/
+-	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
+-	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
+-	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
++	Input* input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum);    _assert_(input);
++	Input* input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum);          _assert_(input2);
++	Input* input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
+ 	GaussTria* gauss=new GaussTria();
+-	for(int month=0;month<12;month++) {
+-		for(int iv=0;iv<NUMVERTICES;iv++) {
++	for(int month=0;month<12;month++){
++		for(int iv=0;iv<NUMVERTICES;iv++){
+ 			gauss->GaussVertex(iv);
+ 			input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);
+ 			input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
+@@ -933,9 +938,10 @@
+ 			PrecipitationsPresentday[iv][month]=PrecipitationsPresentday[iv][month]/yts; // converion in m/sec
+ 		}
+ 	}
++
+ 	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
+ 	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime);
+-        this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-(21000*yts)));
++	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-(21000*yts)));
+ 	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time);
+ 	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime);
+ 	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-(21000*yts)));
+@@ -949,17 +955,18 @@
+ 					&TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 
+ 					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
+ 	}
+-	//if(id==1)	printf(" monthlytemperatures1 %f\n",monthlytemperatures[iv][0]);
+-	//if(id==1)	printf(" monthlyprec1 %f\n",monthlyprec[iv][0]*yts);
++
+ 	/*Update inputs*/ 
+ 	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
+ 	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
+ 	for (int imonth=0;imonth<12;imonth++) {
+-			TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&TemperaturesPresentday[0][imonth]);
+-			//TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[0][imonth]);
+-			NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
+-			TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[0][imonth]);
+-			NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
++		for(i=0;i<NUMVERTICES;i++) temp[i]=TemperaturesPresentday[i][imonth];
++		TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&temp[0]);
++		//TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[0][imonth]);
++		NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
++		for(i=0;i<NUMVERTICES;i++) temp[i]=monthlyprec[i][imonth];
++		TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&temp[0]);
++		NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
+ 	}
+ 	this->inputs->AddInput(NewTemperatureInput);
+ 	this->inputs->AddInput(NewPrecipitationInput);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12870-12871.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12870-12871.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12870-12871.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12870)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12871)
+@@ -138,12 +138,6 @@
+ 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BedEnum);
+ 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsMassBalanceEnum);
+ 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,MaskElementonfloatingiceEnum);
+-			bool isdelta18o;
+-			femmodel->parameters->FindParam(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
+-			if(isdelta18o){
+-				InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsMonthlytemperaturesEnum);
+-				InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsPrecipitationEnum);
+-			}
+ 			RequestedOutputsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs);
+ 
+ 			if(VerboseSolution()) _pprintLine_("   saving temporary results");
Index: /issm/oecreview/Archive/12678-13393/ISSM-12873-12874.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12873-12874.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12873-12874.diff	(revision 13394)
@@ -0,0 +1,11 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.py	(revision 12873)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.py	(revision 12874)
+@@ -1,5 +1,6 @@
+ import os
+ import datetime
++from addnote import *
+ 
+ def parameterize(md,parametername):
+ 	"""
Index: /issm/oecreview/Archive/12678-13393/ISSM-12874-12875.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12874-12875.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12874-12875.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h	(revision 12874)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h	(revision 12875)
+@@ -7,11 +7,7 @@
+ 
+ 	/*Integer coordinates types*/
+ 	typedef int  Icoor1; 
+-	#if LONG_BIT > 63 //64 bits or more
+-	typedef long Icoor2;
+-	#else //32 bits
+ 	typedef double Icoor2;
+-	#endif
+ 
+ 	/*I2 and R2*/
+ 	typedef P2<Icoor1,Icoor2>  I2;
Index: /issm/oecreview/Archive/12678-13393/ISSM-12875-12876.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12875-12876.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12875-12876.diff	(revision 13394)
@@ -0,0 +1,45 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h	(revision 12875)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h	(revision 12876)
+@@ -7,7 +7,7 @@
+ 
+ 	/*Integer coordinates types*/
+ 	typedef int  Icoor1; 
+-	typedef double Icoor2;
++	typedef long Icoor2;
+ 
+ 	/*I2 and R2*/
+ 	typedef P2<Icoor1,Icoor2>  I2;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp	(revision 12875)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp	(revision 12876)
+@@ -4763,18 +4763,17 @@
+ 			AddVertex(vi,tcvi,det3);
+ 			NbSwap += vi.Optim(1);          
+ 			iv++;
+-			//      }
++		}
++		if (verbose>3) {
++			_printLine_("   number of points: " << iv);
++			_printLine_("   number of swap to  split internal edges with border vertices: " << NbSwap);
++			nbv = iv;
++		}
+ 	}
+-	if (verbose>3) {
+-		_printLine_("   number of points: " << iv);
+-		_printLine_("   number of swap to  split internal edges with border vertices: " << NbSwap);
+-		nbv = iv;
+-	}
+-}
+-if (NbSplitEdge>nbv-nbvold) _printLine_("WARNING: not enough vertices  to split all internal edges, we lost " << NbSplitEdge - ( nbv-nbvold) << " edges...");
+-if (verbose>2) _printLine_("SplitInternalEdgeWithBorderVertices: Number of splited edge " << NbSplitEdge);
++	if (NbSplitEdge>nbv-nbvold) _printLine_("WARNING: not enough vertices  to split all internal edges, we lost " << NbSplitEdge - ( nbv-nbvold) << " edges...");
++	if (verbose>2) _printLine_("SplitInternalEdgeWithBorderVertices: Number of splited edge " << NbSplitEdge);
+ 
+-return  NbSplitEdge;
++	return  NbSplitEdge;
+ }
+ /*}}}*/
+ /*FUNCTION Mesh::ToI2{{{*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-12876-12877.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12876-12877.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12876-12877.diff	(revision 13394)
@@ -0,0 +1,19 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h	(revision 12876)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h	(revision 12877)
+@@ -18,12 +18,8 @@
+ 	static const short PreviousEdge[3] = {2,0,1};
+ 	static const short NextVertex[3] = {1,2,0};
+ 	static const short PreviousVertex[3] = {2,0,1};
+-	#if LONG_BIT > 63
+-	const  Icoor1 MaxICoor   = 1073741823; // 2^30-1 =111...111 (29 times)
+-	#else
+-	const  Icoor1 MaxICoor   = 8388608;    // 2^23
+-	#endif
+-	const  Icoor2 MaxICoor22 = Icoor2(2)*Icoor2(MaxICoor) * Icoor2(MaxICoor) ;
++	const  Icoor1 MaxICoor   = 1073741823; // 2^30-1 =111...111 (29 times one)
++	const  Icoor2 MaxICoor22 = Icoor2(2)*Icoor2(MaxICoor)*Icoor2(MaxICoor) ;
+ }
+ 
+ #endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-12881-12882.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12881-12882.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12881-12882.diff	(revision 13394)
@@ -0,0 +1,32 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 12881)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 12882)
+@@ -283,6 +283,14 @@
+ 
+ }
+ /*}}}*/
++/*FUNCTION TransientInput::Extrude{{{*/
++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, bool process_units,Parameters* parameters){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 12881)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 12882)
+@@ -78,7 +78,7 @@
+ 		IssmDouble MaxAbs(void);
+ 		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void);
+-		void Extrude(void){_error2_("not supported yet");}
++		void Extrude(void);
+ 		void VerticallyIntegrate(Input* thickness_forcing){_error2_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not supported yet");};
Index: /issm/oecreview/Archive/12678-13393/ISSM-12882-12883.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12882-12883.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12882-12883.diff	(revision 13394)
@@ -0,0 +1,120 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test236.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test236.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test236.m	(revision 12883)
+@@ -0,0 +1,87 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++
++% Use of ispdd and isdelta18o methods
++md.surfaceforcings.ispdd=1;
++md.surfaceforcings.isdelta18o=1;
++
++md=parameterize(md,'../Par/SquareShelf.par');
++
++% Add temperature, precipitation and delta18o needed to measure the surface mass balance
++% creating delta18o
++load '../Data/delta18o.data'
++md.surfaceforcings.delta18o=delta18o;
++%  creating delta18oSurface
++md.surfaceforcings.delta18o_surface(1,1:(length(delta18o))) = 0;
++md.surfaceforcings.delta18o_surface(2,:) = delta18o(2,:);
++
++% creating Present day and lgm temperatures
++% Same temperature over the all region :
++imonth=0:11;
++tmonth(1:12)=238.15+20;
++for imonth=0:11
++    md.surfaceforcings.temperatures_presentday(1:md.mesh.numberofvertices,imonth+1)=tmonth(imonth+1);
++    md.surfaceforcings.temperatures_lgm(1:md.mesh.numberofvertices,imonth+1)=tmonth(imonth+1)-20;
++    % Time for the last line:
++    md.surfaceforcings.temperatures_presentday(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
++    md.surfaceforcings.temperatures_lgm(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
++end
++
++% creating initialization and spc temperatures initialization and spc
++md.thermal.spctemperature=mean(md.surfaceforcings.temperatures_lgm(1:md.mesh.numberofvertices,1:12),2); %-10*ones(md.mesh.numberofvertices,1);
++md.thermal.spctemperature=repmat(md.thermal.spctemperature,1,md.timestepping.final_time/md.timestepping.time_step);
++itemp = 0:md.timestepping.time_step:md.timestepping.final_time-md.timestepping.time_step;
++md.thermal.spctemperature(md.mesh.numberofvertices+1,:)=itemp;
++
++md.initialization.temperature=md.surfaceforcings.temperatures_lgm(1:md.mesh.numberofvertices,1); %*ones(md.mesh.numberofvertices,1);
++
++% creating precipitation
++for imonth=0:11
++    md.surfaceforcings.precipitations_presentday(1:md.mesh.numberofvertices,imonth+1)=-0.4*10^(-6)*md.mesh.y+0.5;
++    md.surfaceforcings.precipitations_presentday(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
++end
++
++% time steps and resolution
++md.timestepping.time_step=20;
++md.timestepping.final_time= 60;
++
++% 
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).SurfaceforcingsMonthlytemperatures),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).SurfaceforcingsMonthlytemperatures),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).SurfaceforcingsMonthlytemperatures),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12882)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 12883)
+@@ -5,7 +5,6 @@
+ %      name=IdToName(id);
+ 
+ switch id,
+-
+ 	case 101, name='SquareShelfConstrainedDiagM2d';
+ 	case 102, name='SquareShelfConstrainedDiagM3d';
+ 	case 103, name='SquareShelfConstrainedDiagP3d';
+@@ -63,6 +62,8 @@
+ 	case 233, name='SquareShelfTranP3dForcTemp';
+ 	case 234, name='SquareShelfTranForceNeg2dDakotaSamp';
+ 	case 235, name='SquareShelfTranForceNeg2dDakotaLocal';
++	case 236, name='SquareShelfTranIspddIsdeltaM2d';
++	case 237, name='SquareShelfTranIspddIsdeltaM3d';
+ 	case 301, name='SquareSheetConstrainedDiagM2d';
+ 	case 302, name='SquareSheetConstrainedDiagH2d';
+ 	case 303, name='SquareSheetConstrainedDiagHM2d';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/delta18o.data
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/delta18o.data	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/delta18o.data	(revision 12883)
+@@ -0,0 +1,2 @@
++  -3.9010000e-02  -3.9180000e-02  -3.9280000e-02  -3.9320000e-02  -3.9050000e-02  -3.8880000e-02  -3.8680000e-02  -3.8560000e-02  -3.8500000e-02  -3.8520000e-02  -3.8560000e-02
++   0.0000000e+00   2.0000000e+01   4.0000000e+01   6.0000000e+01   8.0000000e+01   1.0000000e+02   1.2000000e+02   1.4000000e+02   1.6000000e+02   1.8000000e+02   2.0000000e+02
Index: /issm/oecreview/Archive/12678-13393/ISSM-12883-12884.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12883-12884.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12883-12884.diff	(revision 13394)
@@ -0,0 +1,33 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12883)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12884)
+@@ -23,7 +23,7 @@
+ 
+ 	/*parameters: */
+ 	IssmDouble starttime,finaltime,dt,yts;
+-	bool   isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy;
++	bool   isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy,isdelta18o;
+ 	bool   save_results,dakota_analysis;
+ 	bool   time_adapt=false;
+ 	int    output_frequency;
+@@ -52,6 +52,7 @@
+ 	if(isgroundingline) femmodel->parameters->FindParam(&groundingline_migration,GroundinglineMigrationEnum);
+ 	femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum);
+ 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,TransientRequestedOutputsEnum);
++	femmodel->parameters->FindParam(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
+ 
+ 	/*initialize: */
+ 	step=0;
+@@ -140,6 +141,11 @@
+ 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,MaskElementonfloatingiceEnum);
+ 			RequestedOutputsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs);
+ 
++			if(isdelta18o){
++			        InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsMonthlytemperaturesEnum);
++			        InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsPrecipitationEnum);
++			}
++
+ 			if(VerboseSolution()) _pprintLine_("   saving temporary results");
+ 			OutputResultsx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results);
+ 		}
Index: /issm/oecreview/Archive/12678-13393/ISSM-12884-12885.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12884-12885.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12884-12885.diff	(revision 13394)
@@ -0,0 +1,111 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12884)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12885)
+@@ -914,7 +914,7 @@
+ 	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+ 	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
+ 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
+-	IssmDouble temp[NUMVERTICES];
++	IssmDouble tmp[NUMVERTICES];
+ 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
+ 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
+ 	IssmDouble time,yts,finaltime;
+@@ -960,14 +960,15 @@
+ 	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
+ 	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
+ 	for (int imonth=0;imonth<12;imonth++) {
+-		for(i=0;i<NUMVERTICES;i++) temp[i]=TemperaturesPresentday[i][imonth];
+-		TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&temp[0]);
+-		//TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[0][imonth]);
++		for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth];
++		TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0]);
+ 		NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
+-		for(i=0;i<NUMVERTICES;i++) temp[i]=monthlyprec[i][imonth];
+-		TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&temp[0]);
++
++		for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth];
++		TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&tmp[0]);
+ 		NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
+ 	}
++
+ 	this->inputs->AddInput(NewTemperatureInput);
+ 	this->inputs->AddInput(NewPrecipitationInput);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12884)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12885)
+@@ -686,10 +686,14 @@
+ /*}}}*/
+ /*FUNCTION Penta::Delta18oParameterization{{{*/
+ void  Penta::Delta18oParameterization(void){
++        /*Are we on the base? If not, return*/
++        if(!IsOnBed()) return;
+ 
++	int        i;
+ 	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+ 	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
+ 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
++	IssmDouble tmp[NUMVERTICES];
+ 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
+ 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
+ 	IssmDouble time,yts,finaltime;
+@@ -698,8 +702,8 @@
+ 	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+ 
+ 	/*Recover present day temperature and precipitation*/
+-	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
+-	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
++	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum);    _assert_(input);
++	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum);          _assert_(input2);
+ 	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
+ 	GaussPenta* gauss=new GaussPenta();
+ 	for(int month=0;month<12;month++) {
+@@ -713,12 +717,12 @@
+ 	}
+ 
+ 	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
+-	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
+-	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
+-	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
+-	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
+-	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
+-	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
++	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime);
++	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,finaltime-(21000*yts));
++	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time);
++	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime);
++	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,finaltime-(21000*yts));
++	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time);
+ 
+ 	/*Compute the temperature and precipitation*/
+ 	for(int iv=0;iv<NUMVERTICES;iv++){
+@@ -733,16 +737,21 @@
+ 	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
+ 	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
+ 	for (int imonth=0;imonth<12;imonth++) {
+-		for(int iv=0;iv<NUMVERTICES;iv++) {
+-			PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
+-			NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
+-			PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
+-			NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
+-		}
++		for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth];
++		PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0]);
++		NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
++
++		for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth];
++		PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&tmp[0]);
++		NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
+ 	}
++
+ 	this->inputs->AddInput(NewTemperatureInput);
+ 	this->inputs->AddInput(NewPrecipitationInput);
+ 
++	this->InputExtrude(SurfaceforcingsMonthlytemperaturesEnum,ElementEnum);
++	this->InputExtrude(SurfaceforcingsPrecipitationEnum,ElementEnum);
++
+ 	/*clean-up*/
+ 	delete gauss;
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-12885-12886.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12885-12886.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12885-12886.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 12885)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 12886)
+@@ -26,7 +26,7 @@
+   // printf(" glacialindex %f\n",glacialindex);
+ 
+   for (int imonth = 0; imonth<12; imonth++){  
+-    monthlytemperaturestmp[imonth] = TemperaturesPresentday[imonth];//glacialindex*TemperaturesLgm[imonth] + (1-glacialindex)*TemperaturesPresentday[imonth];
++    monthlytemperaturestmp[imonth] = glacialindex*TemperaturesLgm[imonth] + (1-glacialindex)*TemperaturesPresentday[imonth];
+     //monthlyprectmp[imonth] = 1.5*pow(2,((monthlytemperaturestmp[imonth]-273.15-0)/10)); //equation from rob's paper
+     monthlyprectmp[imonth] = PrecipitationsPresentday[imonth];
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12886-12887.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12886-12887.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12886-12887.diff	(revision 13394)
@@ -0,0 +1,29 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12886)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 12887)
+@@ -65,7 +65,9 @@
+ 		232 : 'SquareShelfTherTranForcTemp',
+ 		233 : 'SquareShelfTranP3dForcTemp',
+ 		234 : 'SquareShelfTranForceNeg2dDakotaSamp',
+-   	235 : 'SquareShelfTranForceNeg2dDakotaLocal',
++		235 : 'SquareShelfTranForceNeg2dDakotaLocal',
++		236 : 'SquareShelfTranIspddIsdeltaM2d';
++		237 : 'SquareShelfTranIspddIsdeltaM3d';
+ 		301 : 'SquareSheetConstrainedDiagM2d',
+ 		302 : 'SquareSheetConstrainedDiagH2d',
+ 		303 : 'SquareSheetConstrainedDiagHM2d',
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.mat
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.mat	(revision 12886)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.mat	(revision 12887)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.mat
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12887-12888.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12887-12888.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12887-12888.diff	(revision 13394)
@@ -0,0 +1,457 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.py	(revision 12888)
+@@ -0,0 +1,278 @@
++import numpy
++from model import *
++from pairoptions import *
++from recover_areas import *
++from MatlabFuncs import *
++
++def setflowequation(md,*args):
++	"""
++	SETELEMENTSTYPE - associate a solution type to each element
++
++	    This routine works like plotmodel: it works with an even number of inputs
++	    'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
++	    that must be followed by the corresponding exp file or flags list
++	    It can either be a domain file (argus type, .exp extension), or an array of element flags. 
++	    If user wants every element outside the domain to be 
++	    setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
++	    an empty string '' will be considered as an empty domain
++	    a string 'all' will be considered as the entire domain
++	    You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
++
++	    Usage:
++	       md=setflowequation(md,varargin)
++
++	    Example:
++	       md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
++	       md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
++	"""
++
++	#some checks on list of arguments
++	if not isinstance(md,model) or not len(args):
++		raise TypeError("setflowequation error message")
++
++	#Find_out what kind of coupling to use
++	options=pairoptions(*args)
++	coupling_method=options.getfieldvalue('coupling','tiling')
++	if not strcmpi(coupling_method,'tiling') and not strcmpi(coupling_method,'penalties'):
++		raise TypeError("coupling type can only be: tiling or penalties")
++
++	hutterflag,macayealflag,pattynflag,stokesflag,filltype=recover_areas(md,*args)
++
++	#Flag the elements that have not been flagged as filltype
++	if   strcmpi(filltype,'hutter'):
++		hutterflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(macayealflag,pattynflag)))]=1
++	elif strcmpi(filltype,'macayeal'):
++		macayealflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(pattynflag,stokesflag))))]=1
++	elif strcmpi(filltype,'pattyn'):
++		pattynflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(macayealflag,stokesflag))))]=1
++
++	#check that each element has at least one flag
++	if not numpy.any(hutterflag+macayealflag+pattynflag+stokesflag):
++		raise TypeError("setflowequation error message: elements type not assigned, must be specified")
++
++	#check that each element has only one flag
++	if numpy.any(hutterflag+macayealflag+pattynflag+stokesflag>1):
++		print "setflowequation warning message: some elements have several types, higher order type is used for them"
++		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,macayealflag))]=0
++		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,pattynflag))]=0
++		macayealflag[numpy.nonzero(numpy.logical_and(macayealflag,pattynflag))]=0
++
++	#Check that no pattyn or stokes for 2d mesh
++	if md.mesh.dimension==2:
++		if numpy.any(numpy.logical_or(stokesflag,pattynflag)):
++			raise TypeError("setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first")
++
++	#Stokes can only be used alone for now:
++	if numpy.any(stokesflag) and numpy.any(hutterflag):
++		raise TypeError("setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere")
++
++	#Initialize node fields
++	nodeonhutter=numpy.zeros(md.mesh.numberofvertices)
++	nodeonhutter[md.mesh.elements[numpy.nonzero(hutterflag),:].astype(int)-1]=1
++	nodeonmacayeal=numpy.zeros(md.mesh.numberofvertices)
++	nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++	nodeonpattyn=numpy.zeros(md.mesh.numberofvertices)
++	nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++	nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
++	noneflag=numpy.zeros(md.mesh.numberofelements)
++
++	#First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
++	if any(stokesflag):
++#		fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
++		fullspcnodes=numpy.logical_or(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx))+ \
++		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvy))+ \
++		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvz))==3, \
++		                              numpy.logical_and(nodeonpattyn,nodeonstokes)).astype(int)    #find all the nodes on the boundary of the domain without icefront
++#		fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
++		fullspcelems=(numpy.sum(fullspcnodes[md.mesh.elements.astype(int)-1],axis=1)==6).astype(int)    #find all the nodes on the boundary of the domain without icefront
++		stokesflag[numpy.nonzero(fullspcelems)]=0
++		nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++
++	#Then complete with NoneApproximation or the other model used if there is no stokes
++	if any(stokesflag): 
++		if   any(pattynflag):    #fill with pattyn
++			pattynflag[numpy.logical_not(stokesflag)]=1
++			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++		elif any(macayealflag):    #fill with macayeal
++			macayealflag[numpy.logical_not(stokesflag)]=1
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++		else:    #fill with none 
++			noneflag[numpy.nonzero(numpy.logical_not(stokesflag))]=1
++
++	#Now take care of the coupling between MacAyeal and Pattyn
++	md.diagnostic.vertex_pairing=numpy.array([])
++	nodeonmacayealpattyn=numpy.zeros(md.mesh.numberofvertices)
++	nodeonpattynstokes=numpy.zeros(md.mesh.numberofvertices)
++	nodeonmacayealstokes=numpy.zeros(md.mesh.numberofvertices)
++	macayealpattynflag=numpy.zeros(md.mesh.numberofelements)
++	macayealstokesflag=numpy.zeros(md.mesh.numberofelements)
++	pattynstokesflag=numpy.zeros(md.mesh.numberofelements)
++	if   strcmpi(coupling_method,'penalties'):
++		#Create the border nodes between Pattyn and MacAyeal and extrude them
++		numnodes2d=md.mesh.numberofvertices2d
++		numlayers=md.mesh.numberoflayers
++		bordernodes2d=numpy.nonzero(numpy.logical_and(nodeonpattyn[1:numnodes2d],nodeonmacayeal[1:numnodes2d]))    #Nodes connected to two different types of elements
++
++		#initialize and fill in penalties structure
++		if numpy.all(numpy.logical_not(numpy.isnan(bordernodes2d))):
++			penalties=numpy.zeros((0,2))
++			for	i in xrange(1,numlayers):
++				penalties=numpy.concatenate((penalties,numpy.concatenate((bordernodes2d,bordernodes2d+md.mesh.numberofvertices2d*(i)),axis=1)),axis=0)
++			md.diagnostic.vertex_pairing=penalties
++
++	elif strcmpi(coupling_method,'tiling'):
++		if   numpy.any(macayealflag) and numpy.any(pattynflag):    #coupling macayeal pattyn
++			#Find node at the border
++			nodeonmacayealpattyn[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonpattyn))]=1
++			#Macayeal elements in contact with this layer become MacAyealPattyn elements
++			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonmacayealpattyn))
++			commonelements=numpy.sum(matrixelements,axis=1)!=0
++			commonelements[numpy.nonzero(pattynflag)]=0    #only one layer: the elements previously in macayeal
++			macayealflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealpattynelements
++			macayealpattynflag[numpy.nonzero(commonelements)]=1
++			nodeonmacayeal[:]=0
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++
++			#rule out elements that don't touch the 2 boundaries
++			pos=numpy.nonzero(macayealpattynflag)
++			elist=numpy.zeros(len(pos))
++			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
++			pos1=[i for i,item in enumerate(elist) if item==1]
++			macayealflag[pos[pos1]]=1
++			macayealpattynflag[pos[pos1]]=0
++			pos2=[i for i,item in enumerate(elist) if item==-1]
++			pattynflag[pos[pos2]]=1
++			macayealpattynflag[pos[pos2]]=0
++
++			#Recompute nodes associated to these elements
++			nodeonmacayeal[:]=0
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++			nodeonpattyn[:]=0
++			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++			nodeonmacayealpattyn[:]=0
++			nodeonmacayealpattyn[md.mesh.elements[numpy.nonzero(macayealpattynflag),:].astype(int)-1]=1
++
++		elif numpy.any(pattynflag) and numpy.any(stokesflag):    #coupling pattyn stokes
++			#Find node at the border
++			nodeonpattynstokes[numpy.nonzero(numpy.logical_and(nodeonpattyn,nodeonstokes))]=1
++			#Stokes elements in contact with this layer become PattynStokes elements
++			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonpattynstokes))
++			commonelements=numpy.sum(matrixelements,axis=1)!=0
++			commonelements[numpy.nonzero(pattynflag)]=0    #only one layer: the elements previously in macayeal
++			stokesflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealpattynelements
++			pattynstokesflag[numpy.nonzero(commonelements)]=1
++			nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++
++			#rule out elements that don't touch the 2 boundaries
++			pos=numpy.nonzero(pattynstokesflag)
++			elist=numpy.zeros(len(pos))
++			elist = elist + numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			pos1=[i for i,item in enumerate(elist) if item==1]
++			stokesflag[pos[pos1]]=1
++			pattynstokesflag[pos[pos1]]=0
++			pos2=[i for i,item in enumerate(elist) if item==-1]
++			pattynflag[pos[pos2]]=1
++			pattynstokesflag[pos[pos2]]=0
++
++			#Recompute nodes associated to these elements
++			nodeonstokes[:]=0
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++			nodeonpattyn[:]=0
++			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++			nodeonpattynstokes[:]=0
++			nodeonpattynstokes[md.mesh.elements[numpy.nonzero(pattynstokesflag),:].astype(int)-1]=1
++
++		elif numpy.any(stokesflag) and numpy.any(macayealflag):
++			#Find node at the border
++			nodeonmacayealstokes[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonstokes))]=1
++			#Stokes elements in contact with this layer become MacAyealStokes elements
++			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonmacayealstokes))
++			commonelements=numpy.sum(matrixelements,axis=1)!=0
++			commonelements[numpy.nonzero(macayealflag)]=0    #only one layer: the elements previously in macayeal
++			stokesflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealmacayealelements
++			macayealstokesflag[numpy.nonzero(commonelements)]=1
++			nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++
++			#rule out elements that don't touch the 2 boundaries
++			pos=numpy.nonzero(macayealstokesflag)
++			elist=numpy.zeros(len(pos))
++			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
++			pos1=[i for i,item in enumerate(elist) if item==1]
++			macayealflag[pos[pos1]]=1
++			macayealstokesflag[pos[pos1]]=0
++			pos2=[i for i,item in enumerate(elist) if item==-1]
++			stokesflag[pos[pos2]]=1
++			macayealstokesflag[pos[pos2]]=0
++
++			#Recompute nodes associated to these elements
++			nodeonmacayeal[:]=0
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++			nodeonstokes[:]=0
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++			nodeonmacayealstokes[:]=0
++			nodeonmacayealstokes[md.mesh.elements[numpy.nonzero(macayealstokesflag),:].astype(int)-1]=1
++
++		elif numpy.any(stokesflag) and numpy.any(hutterflag):
++			raise TypeError("type of coupling not supported yet")
++
++	#Create MacaAyealPattynApproximation where needed
++	md.flowequation.element_equation=numpy.zeros(md.mesh.numberofelements)
++	md.flowequation.element_equation[numpy.nonzero(noneflag)]=0
++	md.flowequation.element_equation[numpy.nonzero(hutterflag)]=1
++	md.flowequation.element_equation[numpy.nonzero(macayealflag)]=2
++	md.flowequation.element_equation[numpy.nonzero(pattynflag)]=3
++	md.flowequation.element_equation[numpy.nonzero(stokesflag)]=4
++	md.flowequation.element_equation[numpy.nonzero(macayealpattynflag)]=5
++	md.flowequation.element_equation[numpy.nonzero(macayealstokesflag)]=6
++	md.flowequation.element_equation[numpy.nonzero(pattynstokesflag)]=7
++
++	#border
++	md.flowequation.borderpattyn=nodeonpattyn
++	md.flowequation.bordermacayeal=nodeonmacayeal
++	md.flowequation.borderstokes=nodeonstokes
++
++	#Create vertices_type
++	md.flowequation.vertex_equation=numpy.zeros(md.mesh.numberofvertices)
++	pos=numpy.nonzero(nodeonhutter)
++	md.flowequation.vertex_equation[pos]=1
++	pos=numpy.nonzero(nodeonmacayeal)
++	md.flowequation.vertex_equation[pos]=2
++	pos=numpy.nonzero(nodeonpattyn)
++	md.flowequation.vertex_equation[pos]=3
++	pos=numpy.nonzero(nodeonhutter)
++	md.flowequation.vertex_equation[pos]=1
++	pos=numpy.nonzero(nodeonmacayealpattyn)
++	md.flowequation.vertex_equation[pos]=5
++	pos=numpy.nonzero(nodeonstokes)
++	md.flowequation.vertex_equation[pos]=4
++	if numpy.any(stokesflag):
++		pos=numpy.nonzero(numpy.logical_not(nodeonstokes))
++		if not (numpy.any(pattynflag) or numpy.any(macayealflag)):
++			md.flowequation.vertex_equation[pos]=0
++	pos=numpy.nonzero(nodeonpattynstokes)
++	md.flowequation.vertex_equation[pos]=7
++	pos=numpy.nonzero(nodeonmacayealstokes)
++	md.flowequation.vertex_equation[pos]=6
++
++	#figure out solution types
++	md.flowequation.ishutter=float(numpy.any(md.flowequation.element_equation==1))
++	md.flowequation.ismacayealpattyn=float(numpy.any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
++	md.flowequation.isstokes=float(numpy.any(md.flowequation.element_equation==4))
++
++	return md
++
++	#Check that tiling can work:
++	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal !=1):
++		raise TypeError("error coupling domain too irregular")
++	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderstokes + md.flowequation.bordermacayeal !=1):
++		raise TypeError("error coupling domain too irregular")
++	if numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.borderstokes !=1):
++		raise TypeError("error coupling domain too irregular")
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m	(revision 12887)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m	(revision 12888)
+@@ -32,7 +32,7 @@
+ 
+ [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin{:});
+ 
+-%Flag the elements that has not been flagged as filltype
++%Flag the elements that have not been flagged as filltype
+ if strcmpi(filltype,'hutter'),
+ 	hutterflag(find(~macayealflag & ~pattynflag))=1;
+ elseif strcmpi(filltype,'macayeal'),
+@@ -57,7 +57,7 @@
+ %Check that no pattyn or stokes for 2d mesh
+ if (md.mesh.dimension==2),
+ 	if any(stokesflag | pattynflag)
+-		error('setflowequation error message: stokes and pattyn elements no allowed in 2d mesh, extrude it first')
++		error('setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first')
+ 	end
+ end
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.py	(revision 12888)
+@@ -0,0 +1,26 @@
++from pairoptions import *
++from FlagElements import *
++
++def recover_areas(md,*args):
++	"""
++	RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
++
++	    This routine is called by setelementstype, do not use
++
++	    Usage:
++	       [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
++	"""
++
++	#go through varargin, extract options and plug them into subtype options, by order of appearance
++	options=pairoptions(*args)
++#	options=deleteduplicates(options,1);
++
++	#recover elements distribution
++	hutterflag  =FlagElements(md,options.getfieldvalue('hutter',''))
++	macayealflag=FlagElements(md,options.getfieldvalue('macayeal',''))
++	pattynflag  =FlagElements(md,options.getfieldvalue('pattyn',''))
++	stokesflag  =FlagElements(md,options.getfieldvalue('stokes',''))
++	filltype    =options.getfieldvalue('fill','none')
++
++	return hutterflag,macayealflag,pattynflag,stokesflag,filltype
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.m	(revision 12887)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.m	(revision 12888)
+@@ -15,7 +15,6 @@
+ 	macayealflag=FlagElements(md,getfieldvalue(options,'macayeal',''));
+ 	pattynflag  =FlagElements(md,getfieldvalue(options,'pattyn',''));
+ 	stokesflag  =FlagElements(md,getfieldvalue(options,'stokes',''));
+-	hutterflag  =FlagElements(md,getfieldvalue(options,'hutter',''));
+ 	filltype    =getfieldvalue(options,'fill','none');
+ 
+ end %end function
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.py	(revision 12887)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.py	(revision 12888)
+@@ -1,54 +1,62 @@
+-from numpy import * 
++import numpy
++import os
++#from basinzoom import *
++#from ContourToMesh import *
++from MatlabFuncs import *
++
+ def FlagElements(md,region):
+-#FLAGELEMENTS - flag the elements in an region
+-#
+-#   The region can be given with an exp file, a list of elements.
+-#
+-#   Usage: 
+-#      flag=FlagElements(md,region);
+-#
+-#   Example:
+-#      flag=FlagElements(md,'all');
+-#      flag=FlagElements(md,'');
+-#      flag=FlagElements(md,'Domain.exp');
+-#      flag=FlagElements(md,'~Domain.exp');
+-#      flag=FlagElements(md,md.mask.elementongroundedice);
++	"""
++	FLAGELEMENTS - flag the elements in an region
+ 
+-	if isinstance(region,basestring):
+-		if not(region):
+-			flag=zeros(md.mesh.numberofelements,'bool')
+-			invert=0;
+-		elif region=='all':
+-			flag=ones(md.mesh.numberofelements,'bool')
+-			invert=0;
++	    The region can be given with an exp file, a list of elements.
++
++	    Usage: 
++	       flag=FlagElements(md,region);
++
++	    Example:
++	       flag=FlagElements(md,'all');
++	       flag=FlagElements(md,'');
++	       flag=FlagElements(md,'Domain.exp');
++	       flag=FlagElements(md,'~Domain.exp');
++	       flag=FlagElements(md,md.mask.elementongroundedice);
++	"""
++
++	if   isinstance(region,str):
++		if   not region:
++			flag=numpy.zeros(md.mesh.numberofelements,'bool')
++			invert=0
++		elif strcmpi(region,'all'):
++			flag=numpy.ones(md.mesh.numberofelements,'bool')
++			invert=0
+ 		else:
+ 			#make sure that we actually don't want the elements outside the domain outline!
+-			if region[0]=='~':
++			if strcmpi(region[0],'~'):
+ 				region=region[1:]
+-				invert=1;
++				invert=1
+ 			else:
+-				invert=0;
+-			
++				invert=0
++
+ 			#does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
+-			if not os.path.isfile(region):
+-				[xlim,ylim]=basinzoom('basin',region);
+-				flag_nodes=double(md.mesh.x<xlim(2) & md.mesh.x>xlim(1) &  md.mesh.y<ylim(2) & md.mesh.y>ylim(1));
+-				flag=prod(flag_nodes(md.mesh.elements),2);
++			if not os.path.exists(region):
++				if len(region)>3 and not strcmp(region[-4:],'.exp'):
++					raise IOError("Error: File 'region' not found!" % region)
++				xlim,ylim=basinzoom('basin',region)
++				flag_nodes=numpy.logical_and(numpy.logical_and(md.mesh.x<xlim[1],md.mesh.x>xlim[0]),numpy.logical_and(md.mesh.y<ylim[1],md.mesh.y>ylim[0])).astype(float)
++				flag=numpy.prod(flag_nodes[md.mesh.elements],axis=1)
+ 			else:
+ 				#ok, flag elements
+-				flag=ContourToMesh(md.mesh.elements[:,0:3],md.mesh.x,md.mesh.y,region,'element',1);
+-		
++				flag=ContourToMesh(md.mesh.elements[:,0:3],md.mesh.x,md.mesh.y,region,'element',1)
++
+ 		if invert:
+-			flag=~flag;
+-	
+-	elif isinstance(region,nparray):
+-		if len(region)!=md.mesh.numberofelements:
+-			print FlagElements.__doc__
+-			print 'Flaglist for region must be of same size as number of elements in model'
+-			return []
+-		flag=region;
++			flag=numpy.logical_not(flag)
++
++	elif isinstance(region,numpy.nparray) or isinstance(region,bool):
++		if not numpy.size(region,0)==md.mesh.numberofelements:
++			raise TypeError("Flaglist for region must be of same size as number of elements in model.")
++		flag=region
++
+ 	else:
+-		print 'Invalid region option'
+-		return []
++		raise TypeError("Invalid region option")
+ 
+-	return flag;
++	return flag
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12888-12889.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12888-12889.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12888-12889.diff	(revision 13394)
@@ -0,0 +1,194 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py	(revision 12888)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py	(revision 12889)
+@@ -2,11 +2,19 @@
+ from triangle import *
+ from setmask import *
+ from parameterize import *
++from setflowequation import *
++from EnumDefinitions import *
++from solve import *
++from MatlabFuncs import *
+ 
+ md=model()
+ md=triangle(md,'../Exp/Square.exp',50000)
+ md=setmask(md,'all','')
+ md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md.diagnostic.requested_outputs=StressTensorEnum
++md=solve(md,DiagnosticSolutionEnum)
+ 
+ #Fields and tolerances to track changes
+ field_names     =['Vx','Vy','Vel','Pressure',\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12888)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12889)
+@@ -1,6 +1,10 @@
+ import datetime
+ import os
+ import shutil
++from pairoptions import *
++from process_solve_options import *
++from EnumDefinitions import *
++from ismodelselfconsistent import *
+ 
+ def solve(md,solutionenum,*args):
+ 	"""
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabFuncs.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabFuncs.py	(revision 12888)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabFuncs.py	(revision 12889)
+@@ -1,3 +1,8 @@
++def oshostname():
++	import socket
++
++	return socket.gethostname().lower().split('.')[0]
++
+ def strcmp(s1,s2):
+ 
+ 	if s1 == s2:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py	(revision 12888)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py	(revision 12889)
+@@ -1,4 +1,5 @@
+ import os
++from EnumDefinitions import *
+ 
+ def process_solve_options(options):
+ 	"""
+@@ -14,7 +15,7 @@
+ 
+ 	#solution_type: check on this option, error out otherwise
+ 	solution_type=options.getfieldvalue('solution_type')
+-	if solution_type in (DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,\
++	if not solution_type in (DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,\
+ 			SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,\
+ 			BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum):
+ 		raise ValueError("process_solve_options error message: solution_type '%s' not supported yet!" % EnumToString(solution_type))
+@@ -41,7 +42,7 @@
+ 	outoptions['overwrite']=options.getfieldvalue('overwrite','n')
+ 	outoptions['keep']=options.getfieldvalue('keep','y')
+ 	outoptions['latsgn']=options.getfieldvalue('latsgn',0)
+-	outoptions['cmap']=options.getfieldvalue('cmap',None)
++	outoptions['cmap']=options.getfieldvalue('cmap',[])
+ 
+ 	return outoptions
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 12888)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 12889)
+@@ -20,7 +20,7 @@
+ 		raise IOError("marshall error message: could not open '%s.bin' file for binary writing." % md.miscellaneous.name)
+ 
+ 	#First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
+-	WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean')
++	WriteData(fid,'enum',MaximumNumberOfEnums(),'data',True,'format','Boolean')
+ 
+ 	#Go through all model fields: check that it is a class and call checkconsistency
+ 	fields=vars(md)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.py	(revision 12889)
+@@ -0,0 +1,59 @@
++from EnumDefinitions import *
++
++def AnalysisConfiguration(solutiontype):
++	"""
++	ANALYSISCONFIGURATION - return type of analyses, number of analyses 
++
++	    Usage:
++	       [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
++	"""
++
++	if   solutiontype == DiagnosticSolutionEnum:
++		numanalyses=5
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum]
++
++	elif solutiontype == SteadystateSolutionEnum:
++		numanalyses=7 
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum]
++
++	elif solutiontype == ThermalSolutionEnum:
++		numanalyses=2 
++		analyses=[ThermalAnalysisEnum,MeltingAnalysisEnum]
++
++	elif solutiontype == EnthalpySolutionEnum:
++		numanalyses=1 
++		analyses=[EnthalpyAnalysisEnum]
++
++	elif solutiontype == PrognosticSolutionEnum:
++		numanalyses=1 
++		analyses=[PrognosticAnalysisEnum]
++
++	elif solutiontype == BalancethicknessSolutionEnum:
++		numanalyses=1 
++		analyses=[BalancethicknessAnalysisEnum]
++
++	elif solutiontype == SurfaceSlopeSolutionEnum:
++		numanalyses=1 
++		analyses=[SurfaceSlopeAnalysisEnum]
++
++	elif solutiontype == BedSlopeSolutionEnum:
++		numanalyses=1 
++		analyses=[BedSlopeAnalysisEnum]
++
++	elif solutiontype == TransientSolutionEnum:
++		numanalyses=9 
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum,EnthalpyAnalysisEnum,PrognosticAnalysisEnum]
++
++	elif solutiontype == FlaimSolutionEnum:
++		numanalyses=1 
++		analyses=[FlaimAnalysisEnum]
++
++	elif solutiontype == HydrologySolutionEnum:
++		numanalyses=3 
++		analyses=[BedSlopeAnalysisEnum,SurfaceSlopeAnalysisEnum,HydrologyAnalysisEnum]
++
++	else:
++		raise TypeError("solution type: '%s' not supported yet!" % EnumToString(solutiontype))
++
++	return analyses,numanalyses
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12888)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12889)
+@@ -1,3 +1,5 @@
++from AnalysisConfiguration import *
++
+ def ismodelselfconsistent(md):
+ 	"""
+ 	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+@@ -7,14 +9,15 @@
+ 	"""
+ 
+ 	#initialize consistency as true
+-	md.private.isconsistent=true
++	md.private.isconsistent=True
+ 
+ 	#Get solution and associated analyses
+ 	solution=md.private.solution
+ 	analyses,numanalyses=AnalysisConfiguration(solution)
+ 
+ 	#Go through a model fields, check that it is a class, and call checkconsistency
+-	fields=vars('model')
++#	fields=vars('model')
++	fields=dir(md)
+ 	for field in fields:
+ 
+ 		#Some properties do not need to be checked
+@@ -23,7 +26,7 @@
+ 
+ 		#Check that current field is an object
+ 		if not hasattr(getattr(md,field),'checkconsistency'):
+-			md=checkmessage(md,"field '%s' is not an object." % field)
++			md.checkmessage("field '%s' is not an object." % field)
+ 
+ 		#Check consistency of the object
+ 		exec("md.%s.checkconsistency(md,solution,analyses)" % field)
Index: /issm/oecreview/Archive/12678-13393/ISSM-12889-12890.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12889-12890.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12889-12890.diff	(revision 13394)
@@ -0,0 +1,62 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh	(revision 12890)
+@@ -0,0 +1,51 @@
++#!/bin/bash
++
++#Get number of cpus
++NUMCPUS=$1;
++
++#version of mpich2
++#version=1.0.2p1
++version=1.3.1
++#version=1.4
++
++#Some cleanup
++rm -rf src install mpich2-$version
++
++#Create src and install directories
++mkdir src install
++
++#Untar 
++tar -zxvf  mpich2-$version.tar.gz
++
++#Move mpich2 into src directory
++mv mpich2-$version/* src
++rm -rf mpich2-$version
++
++#Configure mpich2
++cd src
++if [[ "$version" == "1.0.2p1" ]];
++then
++	make distclean
++fi
++
++source ../configure.sh
++
++if [[ "$version" == "1.0.2p1" ]];
++then
++	#Apply Patch to examples
++	patch ./examples/Makefile ../Examples.Makefile.patch
++	patch -R ./src/binding/cxx/mpicxx.h ../mpicxx.h.patch
++	patch -R ./src/include/mpicxx.h ../mpicxx.h.patch
++fi
++
++#Compile mpich2
++if [ -z $NUMCPUS ];
++then
++	make
++else
++	make -j $NUMCPUS
++fi
++make install 
++
++cd ../install/lib
++rm -rf *.so
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12890-12891.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12890-12891.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12890-12891.diff	(revision 13394)
@@ -0,0 +1,106 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test237.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test237.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test237.m	(revision 12891)
+@@ -0,0 +1,101 @@
++md=triangle(model,'../Exp/Square.exp',600000);%180000
++md=setmask(md,'all','');
++
++% Use of ispdd and isdelta18o methods
++md.surfaceforcings.ispdd=1;
++md.surfaceforcings.isdelta18o=1;
++
++md=parameterize(md,'../Par/SquareShelf.par');
++
++% Add temperature, precipitation and delta18o needed to measure the surface mass balance
++% creating delta18o
++load '../Data/delta18o.data'
++md.surfaceforcings.delta18o=delta18o;
++%  creating delta18oSurface
++md.surfaceforcings.delta18o_surface(1,1:(length(delta18o))) = 0;
++md.surfaceforcings.delta18o_surface(2,:) = delta18o(2,:);
++
++% creating Present day and lgm temperatures
++% Same temperature over the all region :
++imonth=0:11;
++tmonth(1:12)=238.15+20;
++for imonth=0:11
++    md.surfaceforcings.temperatures_presentday(1:md.mesh.numberofvertices,imonth+1)=tmonth(imonth+1);
++    md.surfaceforcings.temperatures_lgm(1:md.mesh.numberofvertices,imonth+1)=tmonth(imonth+1)-20;
++    % Time for the last line:
++    md.surfaceforcings.temperatures_presentday(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
++    md.surfaceforcings.temperatures_lgm(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
++end
++
++% creating initialization and spc temperatures initialization and spc
++md.thermal.spctemperature=mean(md.surfaceforcings.temperatures_lgm(1:md.mesh.numberofvertices,1:12),2); %-10*ones(md.mesh.numberofvertices,1);
++md.thermal.spctemperature=repmat(md.thermal.spctemperature,1,md.timestepping.final_time/md.timestepping.time_step);
++itemp = 0:md.timestepping.time_step:md.timestepping.final_time-md.timestepping.time_step;
++md.thermal.spctemperature(md.mesh.numberofvertices+1,:)=itemp;
++
++md.initialization.temperature=md.surfaceforcings.temperatures_lgm(1:md.mesh.numberofvertices,1); %*ones(md.mesh.numberofvertices,1);
++
++% creating precipitation
++for imonth=0:11
++    md.surfaceforcings.precipitations_presentday(1:md.mesh.numberofvertices,imonth+1)=-0.4*10^(-6)*md.mesh.y+0.5;
++    md.surfaceforcings.precipitations_presentday(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
++end
++
++% time steps and resolution
++md.timestepping.time_step=20;
++md.settings.output_frequency=1;
++md.timestepping.final_time= 60;
++
++%
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++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_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,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,...
++	1e-13,1e-13,1e-08,1e-13,1e-13,1e-10,1e-10,1e-10,1e-13,1e-8};
++
++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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).SurfaceforcingsMonthlytemperatures),...
++	(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).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).Temperature),...
++	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).SurfaceforcingsMonthlytemperatures),...
++	(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).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).Temperature),...
++	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).SurfaceforcingsMonthlytemperatures),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	};
Index: /issm/oecreview/Archive/12678-13393/ISSM-12891-12892.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12891-12892.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12891-12892.diff	(revision 13394)
@@ -0,0 +1,79 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12891)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12892)
+@@ -712,7 +712,7 @@
+ 			input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);
+ 			input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
+ 			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
+-			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
++			PrecipitationsPresentday[iv][month]=PrecipitationsPresentday[iv][month]/yts; // converion in m/sec
+ 		}
+ 	}
+ 
+@@ -1567,7 +1567,6 @@
+ 		if(((ControlInput*)input)->gradient!=NULL) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
+ 	}
+ 	#endif
+-
+ }
+ /*}}}*/
+ /*FUNCTION Penta::InputUpdateFromConstant(bool value, int name);{{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetMarineIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 12891)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 12892)
+@@ -75,11 +75,11 @@
+ 
+ 
+ %Create zeros basalforcings and surfaceforcings
+-if isnan(md.surfaceforcings.precipitation),
++if (isnan(md.surfaceforcings.precipitation)& (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
+ 	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+ 	disp('      no surfaceforcings.precipitation specified: values set as zero');
+ end
+-if isnan(md.surfaceforcings.mass_balance),
++if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
+ 	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 	disp('      no surfaceforcings.mass_balance specified: values set as zero');
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceSheetBC.m	(revision 12891)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceSheetBC.m	(revision 12892)
+@@ -33,11 +33,11 @@
+ end
+ 
+ %Create zeros basal melting rate and surface mass balance if not specified
+-if isnan(md.surfaceforcings.precipitation),
++if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
+ 	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+ 	disp('      no surfaceforcings.precipitation specified: values set as zero');
+ end
+-if isnan(md.surfaceforcings.mass_balance),
++if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
+ 	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 	disp('      no surfaceforcings.mass_balance specified: values set as zero');
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.m	(revision 12891)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.m	(revision 12892)
+@@ -64,13 +64,13 @@
+ md.diagnostic.icefront=pressureload;
+ 
+ %Create zeros basalforcings and surfaceforcings
+-if isnan(md.surfaceforcings.precipitation),
++if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
+ 	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+ 	disp('      no surfaceforcings.precipitation specified: values set as zero');
+ end
+-if isnan(md.surfaceforcings.mass_balance),
+-	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.mass_balance specified: values set as zero');
++if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
++	        md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
++		disp('      no surfaceforcings.mass_balance specified: values set as zero');
+ end
+ if isnan(md.basalforcings.melting_rate),
+ 	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12892-12893.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12892-12893.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12892-12893.diff	(revision 13394)
@@ -0,0 +1,14 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12892)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12893)
+@@ -2190,9 +2190,6 @@
+   rho_ice=matpar->GetRhoIce();
+   rho_water=matpar->GetRhoFreshwater();
+ 
+-  //if(id==1) printf(" monthlytemperatures %f\n",monthlytemperatures[1][0]);
+-  //if(id==1) printf("monthlyprec %f\n",monthlyprec[1][0]);
+-
+    /*measure the surface mass balance*/
+    for (int iv = 0; iv<NUMVERTICES; iv++){
+      agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], pdds, pds, signorm, yts, h[iv], s[iv], rho_ice, rho_water);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12893-12894.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12893-12894.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12893-12894.diff	(revision 13394)
@@ -0,0 +1,56 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk/install.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk/install.sh	(revision 12894)
+@@ -0,0 +1,45 @@
++#!/bin/bash
++
++sudochoice=0;
++
++#Some cleanup
++rm -rf src
++rm -rf install
++rm -rf tk8.5.12
++mkdir src install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/tk8.5.12-src.tar.gz' 'tk8.5.12.tar.gz'
++
++#Untar 
++tar -zxvf  tk8.5.12.tar.gz
++
++#Move tk into src directory
++mv tk8.5.12/* src
++rm -rf tk8.5.12
++
++cd src/unix
++
++#User mode: 
++if [[ $sudochoice == "0" ]]; 
++then 
++	./configure --prefix=$ISSM_DIR/externalpackages/tk/install
++	if [ -z $1 ]; then
++		make
++	else
++		make -j $1
++	fi
++	make install 
++fi
++
++#sudo mode: 
++if [[ $sudochoice == "1" ]]; 
++then
++	sudo ./configure 
++	if [ -z $1 ]; then
++		sudo make
++	else
++		sudo make -j $1
++	fi
++	sudo make install 
++fi
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12894-12895.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12894-12895.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12894-12895.diff	(revision 13394)
@@ -0,0 +1,102 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh	(revision 12894)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh	(revision 12895)
+@@ -1,5 +1,7 @@
+ #!/bin/bash
+ 
++sudochoice=0;
++
+ #Some cleanup
+ rm -rf src
+ rm -rf install
+@@ -19,5 +21,28 @@
+ #Configure tcl
+ ver="8.4.12"
+ 
+-cd src
+-make -C ./macosx install INSTALL_ROOT="$ISSM_DIR/externalpackages/tcl/install"
++cd src/unix
++
++#User mode: 
++if [[ $sudochoice == "0" ]]; 
++then 
++	./configure --prefix=$ISSM_DIR/externalpackages/tcl/install
++	if [ -z $1 ]; then
++		make
++	else
++		make -j $1
++	fi
++	make install 
++fi
++
++#sudo mode: 
++if [[ $sudochoice == "1" ]]; 
++then
++	sudo ./configure 
++	if [ -z $1 ]; then
++		sudo make
++	else
++		sudo make -j $1
++	fi
++	sudo make install 
++fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk	(revision 12894)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk	(revision 12895)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++install
++src
++*.gz
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install.sh	(revision 12894)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install.sh	(revision 12895)
+@@ -1,7 +1,17 @@
+ #/bin/bash
++pythonversion=2.7
++PYTHON=python${pythonversion}
+ 
++export GIT_SSL_NO_VERIFY=true 
++export CC="gcc -fPIC "
++export CXX="g++ -fPIC -L$ISSM_DIR/externalpackages/tcl/install/lib"
++export F77="gfortran -fPIC"
++export FC="gfortran -fPIC"
++export FFLAGS=-ff2c
++
++
+ git clone https://github.com/matplotlib/matplotlib
+ mv matplotlib src
+ cd src
+-python setup.py build
+-python setup.py install
++python setup.py build 
++python setup.py install 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh	(revision 12894)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh	(revision 12895)
+@@ -2,9 +2,18 @@
+ pythonversion=2.7
+ PYTHON=python${pythonversion}
+ 
++export GIT_SSL_NO_VERIFY=true 
++export CC="gcc -fPIC"
++export CXX="g++ -fPIC"
++export F77="gfortran -fPIC"
++export FC="gfortran -fPIC"
++export FFLAGS=-ff2c
++
++
+ git clone https://github.com/matplotlib/matplotlib
+ mv matplotlib src
+ mkdir deps
+ cd src
++exit
+ make -f make.osx PREFIX=$ISSM_DIR/externalpackages/matplotlib/deps PYVERSION=$pythonversion fetch deps mpl_install_std
+ ${PYTHON} -c "import matplotlib; print 'Installed matplotlib', matplotlib.__version__, matplotlib.__file__"
Index: /issm/oecreview/Archive/12678-13393/ISSM-12895-12896.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12895-12896.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12895-12896.diff	(revision 13394)
@@ -0,0 +1,14 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.mat
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.mat	(revision 12895)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.mat	(revision 12896)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.mat
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12898-12899.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12898-12899.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12898-12899.diff	(revision 13394)
@@ -0,0 +1,113 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 12898)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 12899)
+@@ -15,6 +15,7 @@
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ class Node;
+ class Vector;
++class Parameters;
+ /*}}}*/
+ 
+ class ElementVector{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 12898)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 12899)
+@@ -24,7 +24,9 @@
+ /*FUNCTION Vector::Vector(){{{*/
+ Vector::Vector(){
+ 
++	#ifdef _HAVE_PETSC_
+ 	this->pvector=NULL;
++	#endif
+ 	this->svector=NULL;
+ 	
+ 	type=PetscVecType; //default
+@@ -37,7 +39,9 @@
+ /*FUNCTION Vector::Vector(int M,bool fromlocalsize,int type){{{*/
+ Vector::Vector(int M,bool fromlocalsize,int in_type){
+ 	
++	#ifdef _HAVE_PETSC_
+ 	pvector=NULL;
++	#endif
+ 	svector=NULL;
+ 	type=in_type;
+ 
+@@ -59,7 +63,10 @@
+ /*FUNCTION Vector::Vector(IssmDouble* serial_vec,int M,int type){{{*/
+ Vector::Vector(IssmDouble* serial_vec,int M,int in_type){
+ 
++	#ifdef _HAVE_PETSC_
+ 	pvector=NULL;
++	#endif
++
+ 	svector=NULL;
+ 	type=in_type;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 12898)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 12899)
+@@ -15,6 +15,7 @@
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ class Node;
+ class Matrix;
++class Parameters;
+ /*}}}*/
+ 
+ class ElementMatrix{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12898)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12899)
+@@ -25,7 +25,9 @@
+ /*FUNCTION Matrix::Matrix(){{{*/
+ Matrix::Matrix(){
+ 
++	#ifdef _HAVE_PETSC_
+ 	pmatrix=NULL;
++	#endif
+ 	smatrix=NULL;
+ 
+ 	type=PetscMatType; //default
+@@ -38,7 +40,9 @@
+ /*FUNCTION Matrix::Matrix(int M,int N,int type){{{*/
+ Matrix::Matrix(int M,int N,int in_type){
+ 
++	#ifdef _HAVE_PETSC_
+ 	pmatrix=NULL;
++	#endif
+ 	smatrix=NULL;
+ 	type=in_type;
+ 
+@@ -59,7 +63,9 @@
+ /*FUNCTION Matrix::Matrix(int M,int N,IssmDouble sparsity,int type){{{*/
+ Matrix::Matrix(int M,int N,IssmDouble sparsity,int in_type){
+ 
++	#ifdef _HAVE_PETSC_
+ 	pmatrix=NULL;
++	#endif
+ 	smatrix=NULL;
+ 	type=in_type;
+ 
+@@ -79,7 +85,9 @@
+ /*FUNCTION Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int type){{{*/
+ Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int in_type){
+ 
++	#ifdef _HAVE_PETSC_
+ 	pmatrix=NULL;
++	#endif
+ 	smatrix=NULL;
+ 	type=in_type;
+ 
+@@ -100,7 +108,9 @@
+ /*FUNCTION Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode,int type){{{*/
+ Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type){
+ 
++	#ifdef _HAVE_PETSC_
+ 	pmatrix=NULL;
++	#endif
+ 	smatrix=NULL;
+ 	type=in_type;
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12899-12900.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12899-12900.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12899-12900.diff	(revision 13394)
@@ -0,0 +1,21 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 12899)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 12900)
+@@ -30,12 +30,16 @@
+ 
+ 	/*According to matrix type, use specific solvers: */
+ 	if(Kff->type==PetscMatType){
++		#ifdef _HAVE_PETSC_
+ 		PetscVec* uf0_vector = NULL;
+ 		PetscVec* df_vector  = NULL;
+ 		if(uf0) uf0_vector = uf0->pvector;
+ 		if(df)  df_vector  = df->pvector;
+ 
+ 		SolverxPetsc(&uf->pvector,Kff->pmatrix,pf->pvector,uf0_vector,df_vector,parameters);
++		#else
++		_error_("ISSM should be compiled with Petsc support for this operation!");
++		#endif
+ 	}
+ 	else if(Kff->type==SeqMatType){
+ 		SolverxSeq(&uf->svector,Kff->smatrix,pf->svector);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12902-12903.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12902-12903.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12902-12903.diff	(revision 13394)
@@ -0,0 +1,40 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 12902)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 12903)
+@@ -29,22 +29,22 @@
+ 	uf=new Vector();
+ 
+ 	/*According to matrix type, use specific solvers: */
+-	if(Kff->type==PetscMatType){
++	switch(Kff->type){
+ 		#ifdef _HAVE_PETSC_
+-		PetscVec* uf0_vector = NULL;
+-		PetscVec* df_vector  = NULL;
+-		if(uf0) uf0_vector = uf0->pvector;
+-		if(df)  df_vector  = df->pvector;
+-
+-		SolverxPetsc(&uf->pvector,Kff->pmatrix,pf->pvector,uf0_vector,df_vector,parameters);
+-		#else
+-		_error_("ISSM should be compiled with Petsc support for this operation!");
++		case PetscMatType:
++			PetscVec* uf0_vector = NULL;
++			PetscVec* df_vector  = NULL;
++			if(uf0) uf0_vector = uf0->pvector;
++			if(df)  df_vector  = df->pvector;
++			SolverxPetsc(&uf->pvector,Kff->pmatrix,pf->pvector,uf0_vector,df_vector,parameters);
++			break;
+ 		#endif
++		case SeqMatType:
++			SolverxSeq(&uf->svector,Kff->smatrix,pf->svector);
++			break
++		default:
++			  _error2_("Matrix type: " << Kff->type << " not supported yet!");
+ 	}
+-	else if(Kff->type==SeqMatType){
+-		SolverxSeq(&uf->svector,Kff->smatrix,pf->svector);
+-	}
+-	else _error2_("Matrix type: " << Kff->type << " not supported yet!");
+ 
+ 	/*Assign output pointers: */
+ 	*puf=uf;
Index: /issm/oecreview/Archive/12678-13393/ISSM-12903-12904.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12903-12904.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12903-12904.diff	(revision 13394)
@@ -0,0 +1,52 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12903)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12904)
+@@ -5,9 +5,9 @@
+ #Library declaration {{{
+ lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+-if SHARED
+-lib_LTLIBRARIES = libISSM.la libISSMCore.la libISSMOverload.la
+-endif
++#if SHARED
++#lib_LTLIBRARIES = libISSM.la libISSMCore.la libISSMOverload.la
++#endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+@@ -1001,14 +1001,14 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
+-if SHARED
+-libISSM_la_SOURCES = solutions/issm.cpp
+-libISSM_la_LDFLAGS = -prefer-pic
++#if SHARED
++#libISSM_la_SOURCES = solutions/issm.cpp
++#libISSM_la_LDFLAGS = -prefer-pic
++#
++#libISSMCore_la_SOURCES  = $(issm_sources)
++#libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++#endif
+ 
+-libISSMCore_la_SOURCES  = $(issm_sources)
+-libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
+-endif
+-
+ if MODULES
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12903)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12904)
+@@ -28,7 +28,7 @@
+ # even if all linking is static, since, if not shared libraries are to be produce, libtool
+ # will act simply as a wrapper around AR and Ranlib.
+ #
+-LT_INIT
++#LT_INIT
+ 
+ #Run issm_options.m4
+ ISSM_OPTIONS
Index: /issm/oecreview/Archive/12678-13393/ISSM-12904-12905.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12904-12905.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12904-12905.diff	(revision 13394)
@@ -0,0 +1,26 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 12904)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 12905)
+@@ -31,17 +31,17 @@
+ 	/*According to matrix type, use specific solvers: */
+ 	switch(Kff->type){
+ 		#ifdef _HAVE_PETSC_
+-		case PetscMatType:
++		case PetscMatType:{
+ 			PetscVec* uf0_vector = NULL;
+ 			PetscVec* df_vector  = NULL;
+ 			if(uf0) uf0_vector = uf0->pvector;
+ 			if(df)  df_vector  = df->pvector;
+ 			SolverxPetsc(&uf->pvector,Kff->pmatrix,pf->pvector,uf0_vector,df_vector,parameters);
+-			break;
++			break;}
+ 		#endif
+-		case SeqMatType:
++		case SeqMatType:{
+ 			SolverxSeq(&uf->svector,Kff->smatrix,pf->svector);
+-			break
++			break;}
+ 		default:
+ 			  _error2_("Matrix type: " << Kff->type << " not supported yet!");
+ 	}
Index: /issm/oecreview/Archive/12678-13393/ISSM-12905-12906.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12905-12906.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12905-12906.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h	(revision 12905)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/typedefs.h	(revision 12906)
+@@ -7,7 +7,7 @@
+ 
+ 	/*Integer coordinates types*/
+ 	typedef int  Icoor1; 
+-	typedef unsigned long Icoor2;
++	typedef long Icoor2;
+ 
+ 	/*I2 and R2*/
+ 	typedef P2<Icoor1,Icoor2>  I2;
Index: /issm/oecreview/Archive/12678-13393/ISSM-12906-12907.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12906-12907.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12906-12907.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h	(revision 12906)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h	(revision 12907)
+@@ -19,9 +19,7 @@
+ 	static const short NextVertex[3] = {1,2,0};
+ 	static const short PreviousVertex[3] = {2,0,1};
+ 	const  Icoor1 MaxICoor   = 1073741823; // 2^30-1 =111...111 (29 times one)
+-	//const  Icoor2 MaxICoor22 = ((long)(Icoor2(2)*Icoor2(MaxICoor)));
+-    //const  Icoor2 MaxICoor22 = ((long)(Icoor2(2)*Icoor2(MaxICoor)*Icoor2(MaxICoor)));
+-    const  Icoor2 MaxICoor22 = ((unsigned long)(Icoor2(2)*Icoor2(MaxICoor)*Icoor2(MaxICoor)));
++	const  Icoor2 MaxICoor22 = (Icoor2(2)*Icoor2(MaxICoor)*Icoor2(MaxICoor)));
+ }
+ 
+ #endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-12907-12908.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12907-12908.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12907-12908.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h	(revision 12907)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h	(revision 12908)
+@@ -19,7 +19,7 @@
+ 	static const short NextVertex[3] = {1,2,0};
+ 	static const short PreviousVertex[3] = {2,0,1};
+ 	const  Icoor1 MaxICoor   = 1073741823; // 2^30-1 =111...111 (29 times one)
+-	const  Icoor2 MaxICoor22 = (Icoor2(2)*Icoor2(MaxICoor)*Icoor2(MaxICoor)));
++	const  Icoor2 MaxICoor22 = (Icoor2(2)*Icoor2(MaxICoor)*Icoor2(MaxICoor));
+ }
+ 
+ #endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-12908-12909.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12908-12909.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12908-12909.diff	(revision 13394)
@@ -0,0 +1,53 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 12908)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 12909)
+@@ -50,27 +50,27 @@
+ 		case TimesteppingFinalTimeEnum:              scale=1.0/yts;break; //yr
+ 		case TimesteppingTimeStepEnum:               scale=1.0/yts;break; //yr
+ 		case TimeEnum:                               scale=1.0/yts;break; //yr
+-		case HydrologyWaterVxEnum:                   scale=yts;break; //m/yr
+-		case HydrologyWaterVyEnum:                   scale=yts;break; //m/yr
+-		case VxEnum:                                 scale=yts;break; //m/yr
+-		case InversionVxObsEnum:                     scale=yts;break; //m/yr
+-		case VyEnum:                                 scale=yts;break; //m/yr
+-		case InversionVyObsEnum:                     scale=yts;break; //m/yr
+-		case VzEnum:                                 scale=yts;break; //m/yr
+-		case InversionVzObsEnum:                     scale=yts;break; //m/yr
+-		case VelEnum:                                scale=yts;break; //m/yr
+-		case InversionVelObsEnum:                    scale=yts;break; //m/yr
+-		case BalancethicknessThickeningRateEnum:     scale=yts;break; //m/yr
+-		case BasalforcingsMeltingRateEnum:           scale=yts;break; //m/yr
+-		case BasalforcingsMeltingRateCorrectionEnum: scale=yts;break; //m/yr
+-		case SurfaceforcingsPrecipitationEnum:       scale=yts;break; //m/yr
+-		case SurfaceforcingsMassBalanceEnum:         scale=yts;break; //m/yr
+-		case SurfaceforcingsSmbPosMaxEnum:				scale=yts;break; //m/yr
+-		case SurfaceforcingsSmbPosMinEnum:				scale=yts;break; //m/yr
+-		case SurfaceforcingsAPosEnum:						scale=yts;break; //m/yr
+-		case SurfaceforcingsBPosEnum:						scale=yts;break; //m/yr
+-		case SurfaceforcingsANegEnum:						scale=yts;break; //m/yr
+-		case SurfaceforcingsBNegEnum:						scale=yts;break; //m/yr
++		case HydrologyWaterVxEnum:                   scale=yts;break;     //m/yr
++		case HydrologyWaterVyEnum:                   scale=yts;break;     //m/yr
++		case VxEnum:                                 scale=yts;break;     //m/yr
++		case InversionVxObsEnum:                     scale=yts;break;     //m/yr
++		case VyEnum:                                 scale=yts;break;     //m/yr
++		case InversionVyObsEnum:                     scale=yts;break;     //m/yr
++		case VzEnum:                                 scale=yts;break;     //m/yr
++		case InversionVzObsEnum:                     scale=yts;break;     //m/yr
++		case VelEnum:                                scale=yts;break;     //m/yr
++		case InversionVelObsEnum:                    scale=yts;break;     //m/yr
++		case BalancethicknessThickeningRateEnum:     scale=yts;break;     //m/yr
++		case BasalforcingsMeltingRateEnum:           scale=yts;break;     //m/yr
++		case BasalforcingsMeltingRateCorrectionEnum: scale=yts;break;     //m/yr
++		case SurfaceforcingsPrecipitationEnum:       scale=yts;break;     //m/yr
++		case SurfaceforcingsMassBalanceEnum:         scale=yts;break;     //m/yr
++		case SurfaceforcingsSmbPosMaxEnum:				scale=yts;break;     //m/yr
++		case SurfaceforcingsSmbPosMinEnum:				scale=yts;break;     //m/yr
++		case SurfaceforcingsAPosEnum:						scale=yts;break;     //m/yr
++		case SurfaceforcingsBPosEnum:						scale=yts;break;     //m/yr
++		case SurfaceforcingsANegEnum:						scale=yts;break;     //m/yr
++		case SurfaceforcingsBNegEnum:						scale=yts;break;     //m/yr
+ 		case MisfitEnum:                             scale=pow(yts,2);break; //(m/yr)^2
+ 		case MassFluxEnum:                           scale=pow((IssmDouble)10,-12)*yts;break; // (GigaTon/year)
+ 		case TotalSmbEnum:                           scale=pow((IssmDouble)10,-12)*yts;break; // (GigaTon/year)
Index: /issm/oecreview/Archive/12678-13393/ISSM-12909-12910.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12909-12910.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12909-12910.diff	(revision 13394)
@@ -0,0 +1,94 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 12909)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 12910)
+@@ -20,6 +20,7 @@
+ int IssmMonitor(TaoSolver,void*);
+ typedef struct {
+ 	FemModel* femmodel;
++	double*   J;
+ } AppCtx;
+ 
+ void controltao_core(FemModel* femmodel){
+@@ -68,11 +69,12 @@
+ 	GetVectorFromControlInputsx(&X, femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
+ 	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");
+-	TaoSetInitialVector(tao,X->vector);
+-	TaoSetVariableBounds(tao,XL->vector,XU->vector);
++	TaoSetInitialVector(tao,X->pvector->vector);
++	TaoSetVariableBounds(tao,XL->pvector->vector,XU->pvector->vector);
+ 	xdelete(&XL);
+ 	xdelete(&XU);
+ 
++	user.J=(double*)xcalloc((maxiter+5),sizeof(double));
+ 	user.femmodel=femmodel;
+ 	TaoSetObjectiveAndGradientRoutine(tao,FormFunctionGradient,(void*)&user); 
+ 
+@@ -80,11 +82,12 @@
+ 	if(VerboseControl()) _pprintLine_("   Starting optimization");
+ 	TaoSolve(tao);
+ 	TaoView(tao,PETSC_VIEWER_STDOUT_WORLD);
+-	TaoGetSolutionVector(tao,&X->vector);
++	TaoGetSolutionVector(tao,&X->pvector->vector);
+ 	SetControlInputsFromVectorx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,X);
+ 	for(int i=0;i<num_controls;i++){
+ 		InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,control_list[i]);
+ 	}
++	femmodel->results->AddObject(new DoubleVecExternalResult(femmodel->results->Size()+1,JEnum,user.J,maxiter+3,1,0));
+ 
+ 	/*Finalize*/
+ 	if(VerboseControl()) _pprintLine_("   preparing final solution");
+@@ -141,7 +144,7 @@
+ 
+ 	/*Compute gradient*/
+ 	Gradjx(&gradient,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+-	VecCopy(gradient->vector,G); xdelete(&gradient);
++	VecCopy(gradient->pvector->vector,G); xdelete(&gradient);
+ 	VecScale(G,-1.);
+ 
+ 	/*Clean-up and return*/
+@@ -165,6 +168,7 @@
+ 	if(its==0) _pprintLine_("Iter       Function      Residual  |  List of contributions");
+ 	if(its==0) _pprintLine_("-----------------------------------+-----------------------");
+ 	_pprintString_(setw(4)<<its<<"   "<<setw(12)<<setprecision(7)<<f<<"  "<<setw(12)<<setprecision(7)<<gnorm<<"  | ");
++	user->J[its]=f;
+ 
+ 	/*Retrieve objective functions independently*/
+ 	for(i=0;i<num_responses;i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 12909)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 12910)
+@@ -60,6 +60,17 @@
+ 
+ }
+ /*}}}*/
++#ifdef _HAVE_PETSC_
++/*FUNCTION Vector::Vector(Vec petsc_vector){{{*/
++Vector::Vector(Vec petsc_vector){
++
++	this->type=PetscVecType;
++	this->svector=NULL;
++	this->pvector=new PetscVec(petsc_vector);
++
++}
++/*}}}*/
++#endif
+ /*FUNCTION Vector::Vector(IssmDouble* serial_vec,int M,int type){{{*/
+ Vector::Vector(IssmDouble* serial_vec,int M,int in_type){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 12909)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 12910)
+@@ -35,6 +35,9 @@
+ 		Vector();
+ 		Vector(int M,bool fromlocalsize=false,int type=PetscVecType);
+ 		Vector(IssmDouble* serial_vec,int pM,int type=PetscVecType);
++		#ifdef _HAVE_PETSC_
++		Vector(Vec petsc_vector);
++		#endif
+ 		~Vector();
+ 		/*}}}*/
+ 		/*Vector specific routines {{{*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-12910-12911.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12910-12911.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12910-12911.diff	(revision 13394)
@@ -0,0 +1,991 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh	(revision 12910)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh	(revision 12911)
+@@ -14,8 +14,7 @@
+ #Synchronize objects
+ cat c.vim | sed "/ISSM's objects begin/,/vim: ts=8/d" > temp
+ echo "\"ISSM's objects begin" >> temp
+-cat ../../../../../src/c/objects/objects.h  | grep "\.h" | sed -e "s/\// /g" -e "s/\.h\"//" | awk '{print  $(NF)}' | awk '{ printf "syn keyword cType " $1 "\n"}' >> temp
+-echo "\"ISSM's objects end" >> temp
++find ../../../../../src/c/classes -name "*.h" | sed -e "s/\// /g" -e "s/\.h//"| awk '{print  $(NF)}' | awk '{ printf "syn keyword cType " $1 "\n"}'>> temp
+ cat c.vim | sed "1,/ISSM's objects end/d" >> temp
+ 
+ mv temp c.vim
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12910)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12911)
+@@ -410,29 +410,68 @@
+ syn keyword	cType		mxArray ErrorException QuadtreeBox IssmDouble IssmPDouble
+ 
+ "ISSM's objects begin
+-syn keyword cType objects.h
+-syn keyword cType Object
++syn keyword cType AdjacentTriangle
++syn keyword cType BamgGeom
++syn keyword cType BamgMesh
++syn keyword cType bamgobjects
++syn keyword cType BamgOpts
++syn keyword cType BamgQuadtree
++syn keyword cType BamgVertex
++syn keyword cType CrackedEdge
++syn keyword cType Curve
++syn keyword cType Direction
++syn keyword cType DoubleAndInt
++syn keyword cType Edge
++syn keyword cType GeomEdge
++syn keyword cType Geometry
++syn keyword cType GeomSubDomain
++syn keyword cType GeomVertex
++syn keyword cType include
++syn keyword cType ListofIntersectionTriangles
++syn keyword cType macros
++syn keyword cType Mesh
++syn keyword cType Metric
++syn keyword cType R2
++syn keyword cType SetOfE4
++syn keyword cType SubDomain
++syn keyword cType Triangle
++syn keyword cType typedefs
++syn keyword cType VertexOnEdge
++syn keyword cType VertexOnGeom
++syn keyword cType VertexOnVertex
++syn keyword cType classes
++syn keyword cType DakotaPlugin
++syn keyword cType DofIndexing
++syn keyword cType FemModel
++syn keyword cType gaussobjects
++syn keyword cType GaussPenta
++syn keyword cType GaussTria
+ syn keyword cType Hook
+-syn keyword cType DofIndexing
+-syn keyword cType Vertex
+-syn keyword cType Node
+-syn keyword cType Segment
+ syn keyword cType IoModel
+-syn keyword cType Patch
+-syn keyword cType Update
++syn keyword cType ExponentialVariogram
++syn keyword cType GaussianVariogram
++syn keyword cType krigingobjects
++syn keyword cType Observation
++syn keyword cType PowerVariogram
++syn keyword cType Quadtree
++syn keyword cType SphericalVariogram
++syn keyword cType Variogram
++syn keyword cType ElementMatrix
++syn keyword cType ElementVector
++syn keyword cType Matrix
++syn keyword cType matrixobjects
++syn keyword cType Vector
+ syn keyword cType Constraint
++syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+-syn keyword cType SpcDynamic
+-syn keyword cType GaussTria
+-syn keyword cType GaussPenta
+-syn keyword cType Load
+-syn keyword cType Friction
+-syn keyword cType Icefront
+-syn keyword cType Numericalflux
+-syn keyword cType Riftfront
+-syn keyword cType Penpair
+-syn keyword cType Pengrid
++syn keyword cType Contour
++syn keyword cType BoolElementResult
++syn keyword cType DoubleElementResult
++syn keyword cType ElementResult
++syn keyword cType ElementResultLocal
++syn keyword cType PentaP1ElementResult
++syn keyword cType TriaP1ElementResult
+ syn keyword cType Element
+ syn keyword cType Penta
+ syn keyword cType PentaHook
+@@ -440,9 +479,26 @@
+ syn keyword cType Tria
+ syn keyword cType TriaHook
+ syn keyword cType TriaRef
++syn keyword cType BoolExternalResult
++syn keyword cType DoubleExternalResult
++syn keyword cType DoubleMatExternalResult
++syn keyword cType DoubleVecExternalResult
++syn keyword cType ExternalResult
++syn keyword cType IntExternalResult
++syn keyword cType PetscVecExternalResult
++syn keyword cType StringExternalResult
++syn keyword cType BoolInput
++syn keyword cType ControlInput
++syn keyword cType DatasetInput
++syn keyword cType DoubleInput
++syn keyword cType Input
++syn keyword cType IntInput
++syn keyword cType PentaP1Input
++syn keyword cType TransientInput
++syn keyword cType TriaP1Input
+ syn keyword cType KML_Attribute
++syn keyword cType KML_ColorStyle
+ syn keyword cType KML_Comment
+-syn keyword cType KML_ColorStyle
+ syn keyword cType KML_Container
+ syn keyword cType KML_Document
+ syn keyword cType KML_Feature
+@@ -458,8 +514,8 @@
+ syn keyword cType KML_MultiGeometry
+ syn keyword cType KML_Object
+ syn keyword cType KML_Overlay
++syn keyword cType KML_Placemark
+ syn keyword cType KML_Point
+-syn keyword cType KML_Placemark
+ syn keyword cType KML_Polygon
+ syn keyword cType KML_PolyStyle
+ syn keyword cType KML_Style
+@@ -467,820 +523,46 @@
+ syn keyword cType KML_SubStyle
+ syn keyword cType KML_Unknown
+ syn keyword cType KMLFileReadUtils
++syn keyword cType Friction
++syn keyword cType Icefront
++syn keyword cType Load
++syn keyword cType Numericalflux
++syn keyword cType Pengrid
++syn keyword cType Penpair
++syn keyword cType Riftfront
++syn keyword cType Material
++syn keyword cType Matice
++syn keyword cType Matpar
++syn keyword cType Node
++syn keyword cType Object
++syn keyword cType objects
+ syn keyword cType Option
++syn keyword cType OptionCell
++syn keyword cType OptionChar
+ syn keyword cType OptionDouble
+ syn keyword cType OptionLogical
+-syn keyword cType OptionChar
+ syn keyword cType OptionStruct
+-syn keyword cType OptionCell
+ syn keyword cType OptionUtilities
+-syn keyword cType Input
+-syn keyword cType BoolInput
+-syn keyword cType DoubleInput
+-syn keyword cType IntInput
+-syn keyword cType PentaP1Input
+-syn keyword cType TriaP1Input
+-syn keyword cType ControlInput
+-syn keyword cType DatasetInput
+-syn keyword cType TransientInput
+-syn keyword cType ElementResult
+-syn keyword cType DoubleElementResult
+-syn keyword cType TriaP1ElementResult
+-syn keyword cType PentaP1ElementResult
+-syn keyword cType BoolElementResult
+-syn keyword cType ExternalResult
+-syn keyword cType BoolExternalResult
+-syn keyword cType DoubleExternalResult
+-syn keyword cType DoubleVecExternalResult
+-syn keyword cType DoubleMatExternalResult
+-syn keyword cType IntExternalResult
+-syn keyword cType PetscVecExternalResult
+-syn keyword cType StringExternalResult
+-syn keyword cType Material
+-syn keyword cType Matice
+-syn keyword cType Matpar
+-syn keyword cType ElementMatrix
+-syn keyword cType ElementVector
+-syn keyword cType Vector
+-syn keyword cType Matrix
+ syn keyword cType BoolParam
++syn keyword cType DoubleMatArrayParam
+ syn keyword cType DoubleMatParam
++syn keyword cType DoubleParam
+ syn keyword cType DoubleTransientMatParam
+-syn keyword cType DoubleMatArrayParam
+-syn keyword cType DoubleParam
+ syn keyword cType DoubleVecParam
++syn keyword cType FileParam
++syn keyword cType IntMatParam
+ syn keyword cType IntParam
+ syn keyword cType IntVecParam
+-syn keyword cType IntMatParam
+-syn keyword cType FileParam
++syn keyword cType MatrixParam
+ syn keyword cType Param
+-syn keyword cType MatrixParam
+-syn keyword cType VectorParam
+ syn keyword cType StringArrayParam
+ syn keyword cType StringParam
+-syn keyword cType Contour
+-syn keyword cType FemModel
++syn keyword cType TransientParam
++syn keyword cType VectorParam
++syn keyword cType Segment
++syn keyword cType Vertex
++syn keyword cType objects
+ syn keyword cType OptArgs
+ syn keyword cType OptPars
+-syn keyword cType BamgOpts
+-syn keyword cType BamgGeom
+-syn keyword cType BamgMesh
+-syn keyword cType Metric
+-syn keyword cType DoubleAndInt
+-syn keyword cType Direction
+-syn keyword cType BamgVertex
+-syn keyword cType AdjacentTriangle
+-syn keyword cType Edge
+-syn keyword cType GeomVertex
+-syn keyword cType GeomEdge
+-syn keyword cType Curve
+-syn keyword cType Triangle
+-syn keyword cType ListofIntersectionTriangles
+-syn keyword cType GeomSubDomain
+-syn keyword cType SubDomain
+-syn keyword cType VertexOnGeom
+-syn keyword cType VertexOnVertex
+-syn keyword cType VertexOnEdge
+-syn keyword cType CrackedEdge
+-syn keyword cType Mesh
+-syn keyword cType Geometry
+-syn keyword cType BamgQuadtree
+-syn keyword cType SetOfE4
+-syn keyword cType Variogram
+-syn keyword cType GaussianVariogram
+-syn keyword cType ExponentialVariogram
+-syn keyword cType SphericalVariogram
+-syn keyword cType PowerVariogram
+-syn keyword cType Quadtree
+-syn keyword cType Observation
+-"ISSM's objects end
+-
+-"ISSM's Enums begin
+-syn keyword cConstant AutodiffForwardEnum
+-syn keyword cConstant AutodiffIsautodiffEnum
+-syn keyword cConstant AutodiffReverseEnum
+-syn keyword cConstant BalancethicknessSpcthicknessEnum
+-syn keyword cConstant BalancethicknessStabilizationEnum
+-syn keyword cConstant BalancethicknessThickeningRateEnum
+-syn keyword cConstant BasalforcingsGeothermalfluxEnum
+-syn keyword cConstant BasalforcingsMeltingRateCorrectionEnum
+-syn keyword cConstant BasalforcingsMeltingRateEnum
+-syn keyword cConstant BathymetryEnum
+-syn keyword cConstant BedEnum
+-syn keyword cConstant ConstantsGEnum
+-syn keyword cConstant ConstantsReferencetemperatureEnum
+-syn keyword cConstant ConstantsYtsEnum
+-syn keyword cConstant DiagnosticAbstolEnum
+-syn keyword cConstant DiagnosticIcefrontEnum
+-syn keyword cConstant DiagnosticIsnewtonEnum
+-syn keyword cConstant DiagnosticMaxiterEnum
+-syn keyword cConstant DiagnosticNumRequestedOutputsEnum
+-syn keyword cConstant DiagnosticPenaltyFactorEnum
+-syn keyword cConstant DiagnosticReferentialEnum
+-syn keyword cConstant DiagnosticReltolEnum
+-syn keyword cConstant DiagnosticRequestedOutputsEnum
+-syn keyword cConstant DiagnosticRestolEnum
+-syn keyword cConstant DiagnosticRiftPenaltyLockEnum
+-syn keyword cConstant DiagnosticRiftPenaltyThresholdEnum
+-syn keyword cConstant DiagnosticShelfDampeningEnum
+-syn keyword cConstant DiagnosticSpcvxEnum
+-syn keyword cConstant DiagnosticSpcvyEnum
+-syn keyword cConstant DiagnosticSpcvzEnum
+-syn keyword cConstant DiagnosticStokesreconditioningEnum
+-syn keyword cConstant DiagnosticVertexPairingEnum
+-syn keyword cConstant DiagnosticViscosityOvershootEnum
+-syn keyword cConstant FlowequationBordermacayealEnum
+-syn keyword cConstant FlowequationBorderpattynEnum
+-syn keyword cConstant FlowequationBorderstokesEnum
+-syn keyword cConstant FlowequationElementEquationEnum
+-syn keyword cConstant FlowequationIshutterEnum
+-syn keyword cConstant FlowequationIsmacayealpattynEnum
+-syn keyword cConstant FlowequationIsstokesEnum
+-syn keyword cConstant FlowequationVertexEquationEnum
+-syn keyword cConstant FrictionCoefficientEnum
+-syn keyword cConstant FrictionPEnum
+-syn keyword cConstant FrictionQEnum
+-syn keyword cConstant GeometryHydrostaticRatioEnum
+-syn keyword cConstant HydrologyCREnum
+-syn keyword cConstant HydrologyKnEnum
+-syn keyword cConstant HydrologyNEnum
+-syn keyword cConstant HydrologyPEnum
+-syn keyword cConstant HydrologyQEnum
+-syn keyword cConstant HydrologySpcwatercolumnEnum
+-syn keyword cConstant HydrologyStabilizationEnum
+-syn keyword cConstant InversionControlParametersEnum
+-syn keyword cConstant InversionCostFunctionEnum
+-syn keyword cConstant InversionCostFunctionThresholdEnum
+-syn keyword cConstant InversionCostFunctionsCoefficientsEnum
+-syn keyword cConstant InversionCostFunctionsEnum
+-syn keyword cConstant InversionGradientOnlyEnum
+-syn keyword cConstant InversionGradientScalingEnum
+-syn keyword cConstant InversionIscontrolEnum
+-syn keyword cConstant InversionTaoEnum
+-syn keyword cConstant InversionIncompleteAdjointEnum
+-syn keyword cConstant InversionMaxParametersEnum
+-syn keyword cConstant InversionMaxiterPerStepEnum
+-syn keyword cConstant InversionMinParametersEnum
+-syn keyword cConstant InversionNstepsEnum
+-syn keyword cConstant InversionNumControlParametersEnum
+-syn keyword cConstant InversionNumCostFunctionsEnum
+-syn keyword cConstant InversionStepThresholdEnum
+-syn keyword cConstant InversionThicknessObsEnum
+-syn keyword cConstant InversionVelObsEnum
+-syn keyword cConstant InversionVxObsEnum
+-syn keyword cConstant InversionVyObsEnum
+-syn keyword cConstant InversionVzObsEnum
+-syn keyword cConstant MaskElementonfloatingiceEnum
+-syn keyword cConstant MaskElementongroundediceEnum
+-syn keyword cConstant MaskElementonwaterEnum
+-syn keyword cConstant MaskVertexonfloatingiceEnum
+-syn keyword cConstant MaskVertexongroundediceEnum
+-syn keyword cConstant MaskVertexonwaterEnum
+-syn keyword cConstant MaterialsBetaEnum
+-syn keyword cConstant MaterialsHeatcapacityEnum
+-syn keyword cConstant MaterialsLatentheatEnum
+-syn keyword cConstant MaterialsMeltingpointEnum
+-syn keyword cConstant MaterialsMixedLayerCapacityEnum
+-syn keyword cConstant MaterialsRheologyBEnum
+-syn keyword cConstant MaterialsRheologyBbarEnum
+-syn keyword cConstant MaterialsRheologyLawEnum
+-syn keyword cConstant MaterialsRheologyNEnum
+-syn keyword cConstant MaterialsRhoIceEnum
+-syn keyword cConstant MaterialsRhoWaterEnum
+-syn keyword cConstant MaterialsRhoFreshwaterEnum
+-syn keyword cConstant MaterialsMuWaterEnum
+-syn keyword cConstant MaterialsThermalExchangeVelocityEnum
+-syn keyword cConstant MaterialsThermalconductivityEnum
+-syn keyword cConstant MeshAverageVertexConnectivityEnum
+-syn keyword cConstant MeshDimensionEnum
+-syn keyword cConstant MeshEdgesEnum
+-syn keyword cConstant MeshElementconnectivityEnum
+-syn keyword cConstant MeshElementonbedEnum
+-syn keyword cConstant MeshElementonsurfaceEnum
+-syn keyword cConstant MeshElements2dEnum
+-syn keyword cConstant MeshElementsEnum
+-syn keyword cConstant MeshLowerelementsEnum
+-syn keyword cConstant MeshNumberofedgesEnum
+-syn keyword cConstant MeshNumberofelements2dEnum
+-syn keyword cConstant MeshNumberofelementsEnum
+-syn keyword cConstant MeshNumberoflayersEnum
+-syn keyword cConstant MeshNumberofvertices2dEnum
+-syn keyword cConstant MeshNumberofverticesEnum
+-syn keyword cConstant MeshUpperelementsEnum
+-syn keyword cConstant MeshVertexonbedEnum
+-syn keyword cConstant MeshVertexonsurfaceEnum
+-syn keyword cConstant MeshXEnum
+-syn keyword cConstant MeshYEnum
+-syn keyword cConstant MeshZEnum
+-syn keyword cConstant MiscellaneousNameEnum
+-syn keyword cConstant PrognosticHydrostaticAdjustmentEnum
+-syn keyword cConstant PrognosticMinThicknessEnum
+-syn keyword cConstant PrognosticPenaltyFactorEnum
+-syn keyword cConstant PrognosticSpcthicknessEnum
+-syn keyword cConstant PrognosticStabilizationEnum
+-syn keyword cConstant PrognosticVertexPairingEnum
+-syn keyword cConstant QmuIsdakotaEnum
+-syn keyword cConstant QmuMassFluxSegmentsEnum
+-syn keyword cConstant QmuNumberofpartitionsEnum
+-syn keyword cConstant QmuNumberofresponsesEnum
+-syn keyword cConstant QmuPartitionEnum
+-syn keyword cConstant QmuResponsedescriptorsEnum
+-syn keyword cConstant QmuVariabledescriptorsEnum
+-syn keyword cConstant RiftsNumriftsEnum
+-syn keyword cConstant RiftsRiftstructEnum
+-syn keyword cConstant SettingsIoGatherEnum
+-syn keyword cConstant SettingsLowmemEnum
+-syn keyword cConstant SettingsOutputFrequencyEnum
+-syn keyword cConstant SettingsResultsAsPatchesEnum
+-syn keyword cConstant SettingsWaitonlockEnum
+-syn keyword cConstant SurfaceforcingsDelta18oEnum
+-syn keyword cConstant SurfaceforcingsDelta18oTemperaturesPresentdayEnum
+-syn keyword cConstant SurfaceforcingsDelta18oTemperaturesLgmEnum
+-syn keyword cConstant SurfaceforcingsDelta18oSurfaceEnum
+-syn keyword cConstant SurfaceforcingsIsdelta18oEnum
+-syn keyword cConstant SurfaceforcingsPrecipitationsPresentdayEnum
+-syn keyword cConstant DebugProfilingEnum
+-syn keyword cConstant ProfilingCurrentMemEnum
+-syn keyword cConstant ProfilingCurrentFlopsEnum
+-syn keyword cConstant ProfilingSolutionTimeEnum
+-syn keyword cConstant MaxIterationConvergenceFlagEnum
+-syn keyword cConstant SteadystateMaxiterEnum
+-syn keyword cConstant SteadystateNumRequestedOutputsEnum
+-syn keyword cConstant SteadystateReltolEnum
+-syn keyword cConstant SteadystateRequestedOutputsEnum
+-syn keyword cConstant SurfaceEnum
+-syn keyword cConstant SurfaceforcingsPrecipitationEnum
+-syn keyword cConstant SurfaceforcingsMassBalanceEnum
+-syn keyword cConstant ThermalMaxiterEnum
+-syn keyword cConstant ThermalPenaltyFactorEnum
+-syn keyword cConstant ThermalPenaltyLockEnum
+-syn keyword cConstant ThermalPenaltyThresholdEnum
+-syn keyword cConstant ThermalSpctemperatureEnum
+-syn keyword cConstant ThermalStabilizationEnum
+-syn keyword cConstant ThermalIsenthalpyEnum
+-syn keyword cConstant ThicknessEnum
+-syn keyword cConstant TimesteppingStartTimeEnum
+-syn keyword cConstant TimesteppingFinalTimeEnum
+-syn keyword cConstant TimesteppingCflCoefficientEnum
+-syn keyword cConstant TimesteppingTimeAdaptEnum
+-syn keyword cConstant TimesteppingTimeStepEnum
+-syn keyword cConstant TransientIsdiagnosticEnum
+-syn keyword cConstant TransientIsgroundinglineEnum
+-syn keyword cConstant TransientIsprognosticEnum
+-syn keyword cConstant TransientIsthermalEnum
+-syn keyword cConstant TransientNumRequestedOutputsEnum
+-syn keyword cConstant TransientRequestedOutputsEnum
+-syn keyword cConstant SolutionTypeEnum
+-syn keyword cConstant AnalysisTypeEnum
+-syn keyword cConstant ConfigurationTypeEnum
+-syn keyword cConstant AdjointBalancethicknessAnalysisEnum
+-syn keyword cConstant AdjointHorizAnalysisEnum
+-syn keyword cConstant AdjointSolutionEnum
+-syn keyword cConstant AnalysisCounterEnum
+-syn keyword cConstant BalancethicknessAnalysisEnum
+-syn keyword cConstant BalancethicknessSolutionEnum
+-syn keyword cConstant BedSlopeAnalysisEnum
+-syn keyword cConstant BedSlopeSolutionEnum
+-syn keyword cConstant BedSlopeXAnalysisEnum
+-syn keyword cConstant BedSlopeYAnalysisEnum
+-syn keyword cConstant DiagnosticHorizAnalysisEnum
+-syn keyword cConstant DiagnosticHutterAnalysisEnum
+-syn keyword cConstant DiagnosticSolutionEnum
+-syn keyword cConstant DiagnosticVertAnalysisEnum
+-syn keyword cConstant EnthalpyAnalysisEnum
+-syn keyword cConstant EnthalpySolutionEnum
+-syn keyword cConstant FlaimAnalysisEnum
+-syn keyword cConstant FlaimSolutionEnum
+-syn keyword cConstant HydrologyAnalysisEnum
+-syn keyword cConstant HydrologySolutionEnum
+-syn keyword cConstant MeltingAnalysisEnum
+-syn keyword cConstant NoneAnalysisEnum
+-syn keyword cConstant PrognosticAnalysisEnum
+-syn keyword cConstant PrognosticSolutionEnum
+-syn keyword cConstant SteadystateSolutionEnum
+-syn keyword cConstant SurfaceSlopeAnalysisEnum
+-syn keyword cConstant SurfaceSlopeSolutionEnum
+-syn keyword cConstant SurfaceSlopeXAnalysisEnum
+-syn keyword cConstant SurfaceSlopeYAnalysisEnum
+-syn keyword cConstant ThermalAnalysisEnum
+-syn keyword cConstant ThermalSolutionEnum
+-syn keyword cConstant TransientSolutionEnum
+-syn keyword cConstant ApproximationEnum
+-syn keyword cConstant HutterApproximationEnum
+-syn keyword cConstant MacAyealApproximationEnum
+-syn keyword cConstant MacAyealPattynApproximationEnum
+-syn keyword cConstant MacAyealStokesApproximationEnum
+-syn keyword cConstant NoneApproximationEnum
+-syn keyword cConstant PattynApproximationEnum
+-syn keyword cConstant PattynStokesApproximationEnum
+-syn keyword cConstant StokesApproximationEnum
+-syn keyword cConstant ConstraintsEnum
+-syn keyword cConstant LoadsEnum
+-syn keyword cConstant MaterialsEnum
+-syn keyword cConstant NodesEnum
+-syn keyword cConstant ParametersEnum
+-syn keyword cConstant VerticesEnum
+-syn keyword cConstant ResultsEnum
+-syn keyword cConstant BoolInputEnum
+-syn keyword cConstant BoolParamEnum
+-syn keyword cConstant ContourEnum
+-syn keyword cConstant ControlInputEnum
+-syn keyword cConstant DatasetInputEnum
+-syn keyword cConstant DofIndexingEnum
+-syn keyword cConstant DoubleInputEnum
+-syn keyword cConstant DoubleMatArrayParamEnum
+-syn keyword cConstant DoubleMatParamEnum
+-syn keyword cConstant DoubleParamEnum
+-syn keyword cConstant DoubleVecParamEnum
+-syn keyword cConstant ElementEnum
+-syn keyword cConstant ElementResultEnum
+-syn keyword cConstant ExternalResultEnum
+-syn keyword cConstant FileParamEnum
+-syn keyword cConstant HookEnum
+-syn keyword cConstant IcefrontEnum
+-syn keyword cConstant InputEnum
+-syn keyword cConstant IntInputEnum
+-syn keyword cConstant IntParamEnum
+-syn keyword cConstant IntVecParamEnum
+-syn keyword cConstant TransientParamEnum
+-syn keyword cConstant MacAyeal2dIceFrontEnum
+-syn keyword cConstant MacAyeal3dIceFrontEnum
+-syn keyword cConstant MaticeEnum
+-syn keyword cConstant MatparEnum
+-syn keyword cConstant NodeEnum
+-syn keyword cConstant NumericalfluxEnum
+-syn keyword cConstant ParamEnum
+-syn keyword cConstant PattynIceFrontEnum
+-syn keyword cConstant PengridEnum
+-syn keyword cConstant PenpairEnum
+-syn keyword cConstant PentaEnum
+-syn keyword cConstant PentaP1InputEnum
+-syn keyword cConstant MatrixParamEnum
+-syn keyword cConstant VectorParamEnum
+-syn keyword cConstant RiftfrontEnum
+-syn keyword cConstant SegmentEnum
+-syn keyword cConstant SegmentRiftfrontEnum
+-syn keyword cConstant SpcDynamicEnum
+-syn keyword cConstant SpcStaticEnum
+-syn keyword cConstant SpcTransientEnum
+-syn keyword cConstant StokesIceFrontEnum
+-syn keyword cConstant StringArrayParamEnum
+-syn keyword cConstant StringParamEnum
+-syn keyword cConstant TriaEnum
+-syn keyword cConstant TriaP1InputEnum
+-syn keyword cConstant VertexEnum
+-syn keyword cConstant AirEnum
+-syn keyword cConstant IceEnum
+-syn keyword cConstant MelangeEnum
+-syn keyword cConstant WaterEnum
+-syn keyword cConstant ClosedEnum
+-syn keyword cConstant FreeEnum
+-syn keyword cConstant OpenEnum
+-syn keyword cConstant AdjointpEnum
+-syn keyword cConstant AdjointxEnum
+-syn keyword cConstant AdjointyEnum
+-syn keyword cConstant AdjointzEnum
+-syn keyword cConstant BedSlopeXEnum
+-syn keyword cConstant BedSlopeYEnum
+-syn keyword cConstant BoundaryEnum
+-syn keyword cConstant ConstantEnum
+-syn keyword cConstant ConvergedEnum
+-syn keyword cConstant ExtToIuEnum
+-syn keyword cConstant FillEnum
+-syn keyword cConstant FractionIncrementEnum
+-syn keyword cConstant FrictionEnum
+-syn keyword cConstant GroundinglineMeltingRateEnum
+-syn keyword cConstant InternalEnum
+-syn keyword cConstant IuToExtEnum
+-syn keyword cConstant MassFluxEnum
+-syn keyword cConstant MaxPenetrationEnum
+-syn keyword cConstant MeltingOffsetEnum
+-syn keyword cConstant MisfitEnum
+-syn keyword cConstant NumberNodeToElementConnectivityEnum
+-syn keyword cConstant PressureEnum
+-syn keyword cConstant PressurePicardEnum
+-syn keyword cConstant QmuPressureEnum
+-syn keyword cConstant QmuVxEnum
+-syn keyword cConstant QmuVyEnum
+-syn keyword cConstant QmuVzEnum
+-syn keyword cConstant QmuThicknessEnum
+-syn keyword cConstant QmuBedEnum
+-syn keyword cConstant QmuSurfaceEnum
+-syn keyword cConstant QmuMeltingEnum
+-syn keyword cConstant ResetPenaltiesEnum
+-syn keyword cConstant SegmentOnIceShelfEnum
+-syn keyword cConstant SurfaceAbsVelMisfitEnum
+-syn keyword cConstant SurfaceAreaEnum
+-syn keyword cConstant SurfaceAverageVelMisfitEnum
+-syn keyword cConstant SurfaceLogVelMisfitEnum
+-syn keyword cConstant SurfaceLogVxVyMisfitEnum
+-syn keyword cConstant SurfaceRelVelMisfitEnum
+-syn keyword cConstant SurfaceSlopeXEnum
+-syn keyword cConstant SurfaceSlopeYEnum
+-syn keyword cConstant TemperatureEnum
+-syn keyword cConstant TemperatureOldEnum
+-syn keyword cConstant TemperaturePicardEnum
+-syn keyword cConstant ThicknessAbsMisfitEnum
+-syn keyword cConstant TypeEnum
+-syn keyword cConstant VelEnum
+-syn keyword cConstant VelocityEnum
+-syn keyword cConstant VxAverageEnum
+-syn keyword cConstant VxEnum
+-syn keyword cConstant VxPicardEnum
+-syn keyword cConstant VyAverageEnum
+-syn keyword cConstant VyEnum
+-syn keyword cConstant VyPicardEnum
+-syn keyword cConstant VzEnum
+-syn keyword cConstant VzMacAyealEnum
+-syn keyword cConstant VzPattynEnum
+-syn keyword cConstant VzPicardEnum
+-syn keyword cConstant VzStokesEnum
+-syn keyword cConstant VxMeshEnum
+-syn keyword cConstant VyMeshEnum
+-syn keyword cConstant VzMeshEnum
+-syn keyword cConstant EnthalpyEnum
+-syn keyword cConstant EnthalpyPicardEnum
+-syn keyword cConstant ThicknessAbsGradientEnum
+-syn keyword cConstant StepResponsesEnum
+-syn keyword cConstant IntMatParamEnum
+-syn keyword cConstant RheologyBbarAbsGradientEnum
+-syn keyword cConstant DragCoefficientAbsGradientEnum
+-syn keyword cConstant TransientInputEnum
+-syn keyword cConstant OutputfilenameEnum
+-syn keyword cConstant WaterfractionEnum
+-syn keyword cConstant WatercolumnEnum
+-syn keyword cConstant BasalFrictionEnum
+-syn keyword cConstant ViscousHeatingEnum
+-syn keyword cConstant QmuTemperatureEnum
+-syn keyword cConstant HydrologyWaterVxEnum
+-syn keyword cConstant HydrologyWaterVyEnum
+-syn keyword cConstant StressTensorEnum
+-syn keyword cConstant StressTensorxxEnum
+-syn keyword cConstant StressTensorxyEnum
+-syn keyword cConstant StressTensorxzEnum
+-syn keyword cConstant StressTensoryyEnum
+-syn keyword cConstant StressTensoryzEnum
+-syn keyword cConstant StressTensorzzEnum
+-syn keyword cConstant IceVolumeEnum
+-syn keyword cConstant TotalSmbEnum
+-syn keyword cConstant P0Enum
+-syn keyword cConstant P1Enum
+-syn keyword cConstant P1DGEnum
+-syn keyword cConstant SaveResultsEnum
+-syn keyword cConstant BoolElementResultEnum
+-syn keyword cConstant BoolExternalResultEnum
+-syn keyword cConstant DoubleElementResultEnum
+-syn keyword cConstant DoubleExternalResultEnum
+-syn keyword cConstant DoubleMatExternalResultEnum
+-syn keyword cConstant DoubleVecExternalResultEnum
+-syn keyword cConstant IntExternalResultEnum
+-syn keyword cConstant JEnum
+-syn keyword cConstant PatchEnum
+-syn keyword cConstant PatchNodesEnum
+-syn keyword cConstant PatchVerticesEnum
+-syn keyword cConstant PentaP1ElementResultEnum
+-syn keyword cConstant PetscVecExternalResultEnum
+-syn keyword cConstant StringExternalResultEnum
+-syn keyword cConstant StepEnum
+-syn keyword cConstant TimeEnum
+-syn keyword cConstant TriaP1ElementResultEnum
+-syn keyword cConstant WaterColumnOldEnum
+-syn keyword cConstant MinVelEnum
+-syn keyword cConstant MaxVelEnum
+-syn keyword cConstant MinVxEnum
+-syn keyword cConstant MaxVxEnum
+-syn keyword cConstant MaxAbsVxEnum
+-syn keyword cConstant MinVyEnum
+-syn keyword cConstant MaxVyEnum
+-syn keyword cConstant MaxAbsVyEnum
+-syn keyword cConstant MinVzEnum
+-syn keyword cConstant MaxVzEnum
+-syn keyword cConstant MaxAbsVzEnum
+-syn keyword cConstant RelativeEnum
+-syn keyword cConstant AbsoluteEnum
+-syn keyword cConstant IncrementalEnum
+-syn keyword cConstant AgressiveMigrationEnum
+-syn keyword cConstant NoneEnum
+-syn keyword cConstant SoftMigrationEnum
+-syn keyword cConstant StokesSolverEnum
+-syn keyword cConstant AdjointEnum
+-syn keyword cConstant ColinearEnum
+-syn keyword cConstant ControlSteadyEnum
+-syn keyword cConstant FsetEnum
+-syn keyword cConstant Gradient1Enum
+-syn keyword cConstant Gradient2Enum
+-syn keyword cConstant Gradient3Enum
+-syn keyword cConstant GradientEnum
+-syn keyword cConstant GroundinglineMigrationEnum
+-syn keyword cConstant GsetEnum
+-syn keyword cConstant IndexEnum
+-syn keyword cConstant IndexedEnum
+-syn keyword cConstant IntersectEnum
+-syn keyword cConstant NodalEnum
+-syn keyword cConstant OldGradientEnum
+-syn keyword cConstant OutputFilePointerEnum
+-syn keyword cConstant PetscOptionsAnalysesEnum
+-syn keyword cConstant PetscOptionsStringsEnum
+-syn keyword cConstant QmuErrNameEnum
+-syn keyword cConstant QmuInNameEnum
+-syn keyword cConstant QmuOutNameEnum
+-syn keyword cConstant RegularEnum
+-syn keyword cConstant ScaledEnum
+-syn keyword cConstant SeparateEnum
+-syn keyword cConstant SsetEnum
+-syn keyword cConstant VerboseEnum
+-syn keyword cConstant TriangleInterpEnum
+-syn keyword cConstant BilinearInterpEnum
+-syn keyword cConstant NearestInterpEnum
+-syn keyword cConstant XYEnum
+-syn keyword cConstant XYZPEnum
+-syn keyword cConstant OptionEnum
+-syn keyword cConstant OptionCellEnum
+-syn keyword cConstant OptionCharEnum
+-syn keyword cConstant OptionStructEnum
+-syn keyword cConstant OptionDoubleEnum
+-syn keyword cConstant OptionLogicalEnum
+-syn keyword cConstant PatersonEnum
+-syn keyword cConstant ArrheniusEnum
+-"ISSM's Enums end
+-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+-
+-if !exists("c_no_ansi") || exists("c_ansi_typedefs")
+-  syn keyword   cType		size_t ssize_t wchar_t ptrdiff_t sig_atomic_t fpos_t
+-  syn keyword   cType		clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t
+-  syn keyword   cType		mbstate_t wctrans_t wint_t wctype_t
+-  syn keyword   cType		lldiv_t float_t double_t fenv_t fexcept_t
+-endif
+-if !exists("c_no_c99") " ISO C99
+-  syn keyword	cType		bool complex imaginary
+-  syn keyword	cType		int8_t int16_t int32_t int64_t
+-  syn keyword	cType		uint8_t uint16_t uint32_t uint64_t
+-  syn keyword	cType		int_least8_t int_least16_t int_least32_t int_least64_t
+-  syn keyword	cType		uint_least8_t uint_least16_t uint_least32_t uint_least64_t
+-  syn keyword	cType		int_fast8_t int_fast16_t int_fast32_t int_fast64_t
+-  syn keyword	cType		uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
+-  syn keyword	cType		intptr_t uintptr_t
+-  syn keyword	cType		intmax_t uintmax_t
+-endif
+-if exists("c_gnu")
+-  syn keyword	cType		__label__ __complex__ __volatile__
+-endif
+-
+-syn keyword	cStructure	struct union enum typedef
+-syn keyword	cStorageClass	static register auto volatile extern const VOL
+-if exists("c_gnu")
+-  syn keyword	cStorageClass	inline __attribute__
+-endif
+-if !exists("c_no_c99")
+-  syn keyword	cStorageClass	inline restrict
+-endif
+-
+-if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
+-  if exists("c_gnu")
+-    syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__
+-  endif
+-  syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ __func__
+-  syn keyword cConstant __STDC_VERSION__
+-  syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX
+-  syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
+-  syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN
+-  syn keyword cConstant CHAR_MAX INT_MAX LONG_MAX SHRT_MAX
+-  syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
+-  syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
+-  if !exists("c_no_c99")
+-    syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX
+-    syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
+-    syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX
+-    syn keyword cConstant UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX
+-    syn keyword cConstant INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN
+-    syn keyword cConstant INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX
+-    syn keyword cConstant UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX
+-    syn keyword cConstant INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN
+-    syn keyword cConstant INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX
+-    syn keyword cConstant UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX
+-    syn keyword cConstant INTPTR_MIN INTPTR_MAX UINTPTR_MAX
+-    syn keyword cConstant INTMAX_MIN INTMAX_MAX UINTMAX_MAX
+-    syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX
+-    syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX
+-  endif
+-  syn keyword cConstant FLT_RADIX FLT_ROUNDS
+-  syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON
+-  syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON
+-  syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON
+-  syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP
+-  syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
+-  syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
+-  syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
+-  syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
+-  syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
+-  syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL _NO_LEAP_SECONDS _LOCALTIME
+-  syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
+-  syn keyword cConstant LC_NUMERIC LC_TIME
+-" syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
+-  syn keyword cAnsiFuncPtr SIG_DFL SIG_ERR SIG_IGN
+-  syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
+-  syn keyword cConstant INFINITY     FP_SUBNORMAL FP_ILOGB0
+-  syn keyword cConstant NAN          FP_ZERO      FP_ILOGBNAN
+-  syn keyword cConstant FP_INFINITE  FP_FAST_FMA
+-  syn keyword cConstant HUGE_VALF    FP_NAN       FP_FAST_FMAF
+-  syn keyword cConstant HUGE_VALL    FP_NORMAL    FP_FAST_FMAL
+-  syn keyword cConstant FE_OVERFLOW      FE_TOWARDZERO
+-  syn keyword cConstant FE_UNDERFLOW     FE_UPWARD
+-  syn keyword cConstant FE_DIVBYZERO     FE_ALL_EXCEPT    FE_DFL_ENV
+-  syn keyword cConstant FE_INEXACT       FE_DOWNWARD
+-  syn keyword cConstant FE_INVALID       FE_TONEAREST
+-  syn keyword cConstant	_Complex_I _Imaginary_I 
+-  " Add POSIX signals as well...
+-  syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP
+-  syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
+-  syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU
+-  syn keyword cConstant SIGUSR1 SIGUSR2
+-  syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF
+-  syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
+-  syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
+-  syn keyword cConstant TMP_MAX stderr stdin stdout
+-  syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
+-  " Add POSIX errors as well
+-  syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
+-  syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
+-  syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR
+-  syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV
+-  syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS
+-  syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM
+-  syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV
+-  " math.h
+-  syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
+-  syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2
+-endif
+-if !exists("c_no_c99") " ISO C99
+-  syn keyword cConstant true false __bool_true_false_are_defined
+-endif
+-
+-" Accept %: for # (C99)
+-syn region	cPreCondit	start="^\s*\(%:\|#\)\s*\(ifdef\|ifndef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
+-syn keyword	cDefined	defined contained
+-"syn match	cDefined	display contained "\<defined(\w\+)" contains=cName,cAnsiName
+-syn region	cPreConditIf	start="^\s*\(%:\|#\)\s*\(if\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cDefined,cComment,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
+-syn match	cPreCondit	display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
+-if !exists("c_no_if0")
+-  syn region	cCppOut		start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2
+-  syn region	cCppOut2	contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
+-  syn region	cCppSkip	contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
+-endif
+-syn region	cIncluded	display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+-syn match	cIncluded	display contained "<[^>]*>"
+-syn match	cInclude	display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
+-syn match cLineSkip	"\\$"
+-syn cluster	cPreProcGroup	contains=cPreConditIf,cPreCondit,cIncluded,cInclude,cDefined,cDefine,cErrInParen,cErrInBracket,cUserLabel,cUserLabel2,cGotoLabel,cSpecial,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti
+-"syn region	cDefine		start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@cPreProcGroup,@Spell
+-syn region	cDefine		start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@cPreProcGroup,cName,cFunction,cAnsiFunction,@Spell
+-syn region	cPreProc	start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
+-
+-" Highlight User Labels
+-syn cluster	cMultiGroup	contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cUserLabel2,cGotoLabel,cBitField,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
+-syn region	cMulti		transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
+-" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
+-syn cluster	cLabelGroup	contains=cUserLabel
+-syn match	cUserCont	display "^\s*\I\i*\s*:$" contains=@cLabelGroup
+-syn match	cUserCont	display ";\s*\I\i*\s*:$" contains=@cLabelGroup
+-syn match	cUserCont	display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
+-syn match	cUserCont	display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
+-
+-syn match	cUserLabel	display "\I\i*" contained
+-syn match	cUserLabel2	display "\I\i*:;\+"me=e-2
+-syn match	cGotoLabel	display "\<goto\s\+\I\i*;"me=e-1,hs=s+5 contains=cGoto
+-syn keyword	cGoto		contained goto
+-
+-" Avoid recognizing most bitfields as labels
+-syn match	cBitField	display "^\s*\I\i*\s*:\s*[1-9]"me=e-1
+-syn match	cBitField	display ";\s*\I\i*\s*:\s*[1-9]"me=e-1
+-
+-syn match cOperator	"\(<<\|>>\|[-+*/%&^|<>!=]\)="
+-syn match cOperator	"<<\|>>\|&&\|||\|++\|--\|->"
+-syn match cOperator	"[.!~*&%<>^|=+-]"
+-syn match cOperator	"/[^/*=]"me=e-1
+-syn match cOperator	"/$"
+-syn match cOperator	"[\\]"
+-syn match cOperator	"&&\|||"
+-syn match cSpecialCharacter	"[,;]"
+-syn match cDelimiter    "[][(){}]"
+-syn keyword	cType		CHAR byte BYTE uchar ushort uint ulong
+-syn keyword	cType		WORD DWORD QWORD INT INT2 INT4 UNS UNS2 UNS4 INT8 UNS8
+-syn keyword	cType		CFG_t cfap_t cBYTE cvoid
+-syn keyword	cType		_Bool _Complex _Imaginary __int64
+-if !exists("c_no_ansi") || exists("c_ansi_typedefs")
+-  syn keyword   cMC	__near __far FAR __io __direct DIR
+-endif
+-
+-if exists("c_minlines")
+-  let b:c_minlines = c_minlines
+-else
+-  if !exists("c_no_if0")
+-    let b:c_minlines = 50	" #if 0 constructs can be long
+-  else
+-    let b:c_minlines = 15	" mostly for () constructs
+-  endif
+-endif
+-exec "syn sync ccomment cComment minlines=" . b:c_minlines
+-
+-" Define the default highlighting.
+-" For version 5.7 and earlier: only when not done already
+-" For version 5.8 and later: only when an item doesn't have highlighting yet
+-if version >= 508 || !exists("did_c_syn_inits")
+-  if version < 508
+-    let did_c_syn_inits = 1
+-    command -nargs=+ HiLink hi link <args>
+-  else
+-    command -nargs=+ HiLink hi def link <args>
+-  endif
+-
+-  HiLink cFormat	cSpecial
+-  HiLink cCppString	cString
+-  HiLink cCommentL	cComment
+-  HiLink cCommentStart	cComment
+-  HiLink cLabel		Label
+-" HiLink cUserLabel	Label
+-  HiLink cUserLabel	UserLabel2
+-  HiLink cUserLabel2	UserLabel2
+-  HiLink cGotoLabel	UserLabel2
+-  HiLink cGoto		Statement
+-  HiLink cConditional	Conditional
+-  HiLink cRepeat	Repeat
+-  HiLink cCharacter	Character
+-  HiLink cSpecialCharacter cSpecial
+-  HiLink cNumber	Number
+-  HiLink cOctal		Number
+-  HiLink cOctalZero	PreProc		" link this to Error if you want
+-  HiLink cFloat		Float
+-  HiLink cOctalError	cError
+-  HiLink cParenError	cError
+-  HiLink cErrInParen	cError
+-  HiLink cErrInBracket	cError
+-  HiLink cCommentError	cError
+-  HiLink cCommentStartError	cError
+-  HiLink cSpaceError	cError
+-  HiLink cSpecialError	cError
+-  HiLink cOperator	Operator
+-  HiLink cOperatorBold	OperatorBold
+-  HiLink cStructure	Structure
+-  HiLink cStorageClass	StorageClass
+-  HiLink cInclude	Include
+-  HiLink cPreProc	PreProc
+-  HiLink cDefine	Macro
+-  HiLink cDefined	PreCondit
+-  HiLink cIncluded	cString
+-  HiLink cError		Error
+-  HiLink cStatement	Statement
+-  HiLink cPreCondit	PreCondit
+-  HiLink cPreConditIf	PreCondit
+-  HiLink cType		Type
+-  HiLink cConstant	Constant
+-  HiLink cCommentString cString
+-  HiLink cComment2String cString
+-  HiLink cCommentSkip	cComment
+-  HiLink cString	String
+-  HiLink cComment	Comment
+-  HiLink cDelimiter     Delimiter
+-  HiLink cSpecial	SpecialChar
+-  HiLink cTodo		Todo
+-  HiLink cCppSkip	cCppOut
+-  HiLink cCppOut2	cCppOut
+-  HiLink cCppOut	Comment
+-  HiLink cMulti		Operator
+-  HiLink cMultiMG	Operator
+-  HiLink cFunction	Function
+-  HiLink cAnsiFunction	StdFunction
+-  HiLink cName		Name
+-  HiLink cBitField	Name
+-  HiLink cAnsiName	StdName
+-  "HiLink cBlock	BlockBraces
+-  HiLink cBraces	BlockBraces
+-  "HiLink cBraceError	Error
+-  HiLink cMC		MicroController
+-  HiLink cAnsiFuncPtr	AnsiFuncPtr
+-
+-  hi Function		gui=NONE guifg=#e86f00
+-  "hi StdFunction	gui=bold guifg=#ee0040
+-  hi StdFunction	gui=bold guifg=#e86f00
+-  hi Statement		gui=bold guifg=#a06129
+-  hi UserLabel2		gui=bold guifg=#c96129
+-  hi Operator		gui=NONE guifg=#000000
+-  hi OperatorBold	gui=bold guifg=#000000
+-  hi StdName		gui=bold guifg=#5276e6
+-  hi Name		gui=NONE guifg=#5276e6
+-  hi BlockBraces	gui=bold guifg=#000000
+-  hi Special		gui=NONE guifg=#a000a0
+-  hi Comment		gui=NONE guifg=grey62
+-  hi MicroController	gui=bold guifg=#d00000
+-  hi AnsiFuncPtr	gui=NONE guifg=#ff0000
+-" hi PreProc        	gui=NONE guifg=#6a5acd
+-  hi PreCondit      	gui=NONE guifg=#6a5acd
+-" hi Macro          	gui=NONE guifg=#0000ff
+-
+-  delcommand HiLink
+-endif
+-hi Normal		gui=NONE guifg=#000000 guibg=Ivory1
+-
+-let b:current_syntax = "c"
+-
+-" vim: ts=8
++syn keyword cType Patch
++syn keyword cType Update
Index: /issm/oecreview/Archive/12678-13393/ISSM-12911-12912.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12911-12912.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12911-12912.diff	(revision 13394)
@@ -0,0 +1,105 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h	(revision 12911)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h	(revision 12912)
+@@ -47,7 +47,7 @@
+ int KMLFileTokenParse(double **pdval,int* m,int maxlen,
+ 					  char* ktag,
+ 					  FILE* fid);
+-int KMLFileTokenParse(double (**pdval3)[3],int* m,int maxlen,
++int KMLFileTokenParse(double **pdval,int* m,int n,int maxlen,
+ 					  char* ktag,
+ 					  FILE* fid);
+ int KMLFileTagSkip(char* ktag,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 12911)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 12912)
+@@ -149,7 +149,7 @@
+ 		else if (!strcmp(kstri,"<altitudeMode>"))
+ 			KMLFileTokenParse(altmode,NULL,KML_LINEARRING_ALTMODE_LENGTH,kstri,fid);
+ 		else if (!strcmp(kstri,"<coordinates>"))
+-			KMLFileTokenParse(&coords,&ncoord,0,kstri,fid);
++			KMLFileTokenParse(&coords,&ncoord,3,0,kstri,fid);
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Geometry::Read(fid,kstri);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 12911)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 12912)
+@@ -585,11 +585,11 @@
+ }
+ /*}}}*/
+ /*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(double (**pdval3)[3],int* m,int maxlen,
++int KMLFileTokenParse(double **pdval,int* m,int n,int maxlen,
+ 					  char* ktag,
+ 					  FILE* fid){
+ 
+-	int     i=0,j=-1;
++	int     i=-1,j=-1;
+ 	char*   kstr;
+ 	char*   ktok;
+ 	char    delim[]={' ',',','\f','\n','\r','\t','\v','\0'};
+@@ -599,38 +599,35 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing double [m x 3] field for " << ktag << ".\n");
++		_error2_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n");
+ 
+-	if (!*pdval3)
++	if (!*pdval)
+ 		if (maxlen)
+-			*pdval3=(double (*)[3]) xmalloc((maxlen*3)          *sizeof(double));
++			*pdval=(double *) xmalloc((maxlen*n)          *sizeof(double));
+ 		else
+-			*pdval3=(double (*)[3]) xmalloc(((strlen(kstr)+1)/2)*sizeof(double));
++			*pdval=(double *) xmalloc(((strlen(kstr)+1)/2)*sizeof(double));
+ 
+ /*  loop through string to get all values  */
+ 
+ 	ktok=strtok(kstr,delim);
+ 	while (ktok) {
+-		j++;
+-		if (j == 3) {
+-			i++;
+-			j=0;
+-			if (maxlen && (maxlen < i+1))
+-				_error2_("KMLFileTokenParse -- Double [m x 3] field too short for " << ktag << ".\n");
+-		}
+-		sscanf(ktok,"%lg",&((*pdval3)[i][j]));
++		i++;
++		if (maxlen && (maxlen*n < i+1))
++			_error2_("KMLFileTokenParse -- Double [m x n] field too short for " << ktag << ".\n");
++		j=(j+1) % n;
++		sscanf(ktok,"%lg",&((*pdval)[i]));
+ 		ktok=strtok(NULL,delim);
+ 	}
+ 	xfree((void**)&kstr);
+ 
+ 	if (!maxlen)
+-		*pdval3=(double (*)[3]) xrealloc(*pdval3,((i+1)*3)*sizeof(double));
++		*pdval=(double *) xrealloc(*pdval,((i+1)*n)*sizeof(double));
+ 
+ 	if (m)
+-		*m=i+1;
++		*m=((i+1)+(n-1))/n;
+ 
+-	if (j != 2)
+-		_pprintLine_("KMLFileTokenParse -- Double [m x 3] field for " << ktag << " does not have multiple of 3 values.");
++	if ((i+1) % n)
++		_pprintLine_("KMLFileTokenParse -- Double [m x n] field for " << ktag << " does not have multiple of n values.");
+ 
+ /*  get additional token and compare to closing tag  */
+ 
+@@ -646,7 +643,7 @@
+ 
+ //	_pprintLine_("KMLFileTokenParse -- " << ktag << "=...");
+ //	for (j=0; j<=i; j++)
+-//		_pprintLine_("   [" << j << "][0-2]: " << (*pdval3)[j][0] << "g," << (*pdval3)[j][1] << "g," << (*pdval3)[j][2] << "g");
++//		_pprintLine_("   [" << j << "]: " << (*pdval)[j] << "g");
+ 
+ 	return(0);
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-12912-12913.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12912-12913.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12912-12913.diff	(revision 13394)
@@ -0,0 +1,1298 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/sphere_tri.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/sphere_tri.m	(revision 12912)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/sphere_tri.m	(revision 12913)
+@@ -1,204 +0,0 @@
+-function [FV] = sphere_tri(shape,maxlevel,r,winding)
+-
+-% sphere_tri - generate a triangle mesh approximating a sphere
+-% 
+-% Usage: FV = sphere_tri(shape,Nrecurse,r,winding)
+-% 
+-%   shape is a string, either of the following:
+-%   'ico'   starts with icosahedron (most even, default)
+-%   'oct'   starts with octahedron
+-%   'tetra' starts with tetrahedron (least even)
+-%
+-%   Nrecurse is int >= 0, setting the recursions (default 0)
+-%
+-%   r is the radius of the sphere (default 1)
+-%
+-%   winding is 0 for clockwise, 1 for counterclockwise (default 0).  The
+-%   matlab patch command gives outward surface normals for clockwise
+-%   order of vertices in the faces (viewed from outside the surface).
+-%
+-%   FV has fields FV.vertices and FV.faces.  The vertices 
+-%   are listed in clockwise order in FV.faces, as viewed 
+-%   from the outside in a RHS coordinate system.
+-% 
+-% The function uses recursive subdivision.  The first
+-% approximation is an platonic solid, either an  icosahedron,
+-% octahedron or a tetrahedron.  Each level of refinement 
+-% subdivides each triangle face by a factor of 4 (see also 
+-% mesh_refine).  At each refinement, the vertices are 
+-% projected to the sphere surface (see sphere_project).
+-% 
+-% A recursion level of 3 or 4 is a good sphere surface, if
+-% gouraud shading is used for rendering.
+-% 
+-% The returned struct can be used in the patch command, eg:
+-% 
+-% % create and plot, vertices: [2562x3] and faces: [5120x3]
+-% FV = sphere_tri('ico',4,1);
+-% lighting phong; shading interp; figure;
+-% patch('vertices',FV.vertices,'faces',FV.faces,...
+-%       'facecolor',[1 0 0],'edgecolor',[.2 .2 .6]);
+-% axis off; camlight infinite; camproj('perspective');
+-% 
+-% See also: mesh_refine, sphere_project
+-%
+-
+-
+-
+-% $Revision: 1.2 $ $Date: 2005/07/20 23:07:03 $
+-
+-% Licence:  GNU GPL, no implied or express warranties
+-% Jon Leech (leech @ cs.unc.edu) 3/24/89
+-% icosahedral code added by Jim Buddenhagen (jb1556@daditz.sbc.com) 5/93
+-% 06/2002, adapted from c to matlab by Darren.Weber_at_radiology.ucsf.edu
+-% 05/2004, reorder of the faces for the 'ico' surface so they are indeed
+-% clockwise!  Now the surface normals are directed outward.  Also reset the
+-% default recursions to zero, so we can get out just the platonic solids.
+-%
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-
+-eegversion = '$Revision: 1.2 $';
+-fprintf('SPHERE_TRI [v %s]\n',eegversion(11:15)); tic
+-
+-if ~exist('shape','var') || isempty(shape),
+-    shape = 'ico';
+-end
+-fprintf('...creating sphere tesselation based on %s\n',shape);
+-
+-% default maximum subdivision level
+-if ~exist('maxlevel','var') || isempty(maxlevel) || maxlevel < 0,
+-    maxlevel = 0;
+-end
+-
+-% default radius
+-if ~exist('r','var') || isempty(r),
+-    r = 1;
+-end
+-
+-if ~exist('winding','var') || isempty(winding),
+-    winding = 0;
+-end
+-
+-
+-% -----------------
+-% define the starting shapes
+-
+-shape = lower(shape);
+-
+-switch shape,
+-case 'tetra',
+-    
+-    % Vertices of a tetrahedron
+-    sqrt_3 = 0.5773502692;
+-    
+-    tetra.v = [  sqrt_3,  sqrt_3,  sqrt_3 ;   % +X, +Y, +Z  - PPP
+-                -sqrt_3, -sqrt_3,  sqrt_3 ;   % -X, -Y, +Z  - MMP
+-                -sqrt_3,  sqrt_3, -sqrt_3 ;   % -X, +Y, -Z  - MPM
+-                 sqrt_3, -sqrt_3, -sqrt_3 ];  % +X, -Y, -Z  - PMM
+-	
+-    % Structure describing a tetrahedron
+-    tetra.f = [ 1, 2, 3;
+-                1, 4, 2;
+-                3, 2, 4;
+-                4, 1, 3 ];
+-    
+-    FV.vertices = tetra.v;
+-    FV.faces    = tetra.f;
+-    
+-case 'oct',
+-    
+-    % Six equidistant points lying on the unit sphere
+-    oct.v = [  1,  0,  0 ;  %  X
+-              -1,  0,  0 ; 	% -X
+-               0,  1,  0 ;  %  Y
+-               0, -1,  0 ; 	% -Y
+-               0,  0,  1 ; 	%  Z
+-               0,  0, -1 ];	% -Z
+-	
+-    % Join vertices to create a unit octahedron
+-    oct.f = [ 1 5 3 ;    %  X  Z  Y  -  First the top half
+-              3 5 2 ;    %  Y  Z -X
+-              2 5 4 ;    % -X  Z -Y
+-              4 5 1 ;    % -Y  Z  X
+-              1 3 6 ;    %  X  Y -Z  -  Now the bottom half
+-              3 2 6 ;    %  Y  Z -Z
+-              2 4 6 ;    % -X  Z -Z
+-              4 1 6 ];   % -Y  Z -Z
+-    
+-    FV.vertices = oct.v;
+-    FV.faces    = oct.f;
+-    
+-case 'ico',
+-    
+-    % Twelve vertices of icosahedron on unit sphere
+-    tau = 0.8506508084; % t=(1+sqrt(5))/2, tau=t/sqrt(1+t^2)
+-    one = 0.5257311121; % one=1/sqrt(1+t^2) , unit sphere
+-    
+-    ico.v( 1,:) = [  tau,  one,    0 ]; % ZA
+-    ico.v( 2,:) = [ -tau,  one,    0 ]; % ZB
+-    ico.v( 3,:) = [ -tau, -one,    0 ]; % ZC
+-    ico.v( 4,:) = [  tau, -one,    0 ]; % ZD
+-    ico.v( 5,:) = [  one,   0 ,  tau ]; % YA
+-    ico.v( 6,:) = [  one,   0 , -tau ]; % YB
+-    ico.v( 7,:) = [ -one,   0 , -tau ]; % YC
+-    ico.v( 8,:) = [ -one,   0 ,  tau ]; % YD
+-    ico.v( 9,:) = [   0 ,  tau,  one ]; % XA
+-    ico.v(10,:) = [   0 , -tau,  one ]; % XB
+-    ico.v(11,:) = [   0 , -tau, -one ]; % XC
+-    ico.v(12,:) = [   0 ,  tau, -one ]; % XD
+-    
+-    % Structure for unit icosahedron
+-    ico.f = [  5,  8,  9 ;
+-               5, 10,  8 ;
+-               6, 12,  7 ;
+-               6,  7, 11 ;
+-               1,  4,  5 ;
+-               1,  6,  4 ;
+-               3,  2,  8 ;
+-               3,  7,  2 ;
+-               9, 12,  1 ;
+-               9,  2, 12 ;
+-              10,  4, 11 ;
+-              10, 11,  3 ;
+-               9,  1,  5 ;
+-              12,  6,  1 ;
+-               5,  4, 10 ;
+-               6, 11,  4 ;
+-               8,  2,  9 ;
+-               7, 12,  2 ;
+-               8, 10,  3 ;
+-               7,  3, 11 ];
+-	
+-    FV.vertices = ico.v;
+-    FV.faces    = ico.f;
+-end
+-
+-
+-% -----------------
+-% refine the starting shapes with subdivisions
+-if maxlevel,
+-    
+-    % Subdivide each starting triangle (maxlevel) times
+-    for level = 1:maxlevel,
+-        
+-        % Subdivide each triangle and normalize the new points thus
+-        % generated to lie on the surface of a sphere radius r.
+-        FV = mesh_refine_tri4(FV);
+-        FV.vertices = sphere_project(FV.vertices,r);
+-        
+-        % An alternative might be to define a min distance
+-        % between vertices and recurse or use fminsearch
+-        
+-    end
+-end
+-
+-if winding,
+-    fprintf('...returning counterclockwise vertex order (viewed from outside)\n');
+-    FV.faces = FV.faces(:,[1 3 2]);
+-else
+-    fprintf('...returning clockwise vertex order (viewed from outside)\n');
+-end
+-
+-t=toc; fprintf('...done (%6.2f sec)\n\n',t);
+-
+-return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/mesh_refine_tri4.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/mesh_refine_tri4.m	(revision 12912)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/mesh_refine_tri4.m	(revision 12913)
+@@ -1,146 +0,0 @@
+-function [ FV ] = mesh_refine_tri4(FV)
+-
+-% mesh_refine_tri4 - creates 4 triangle from each triangle of a mesh
+-%
+-% [ FV ] = mesh_refine_tri4( FV )
+-%
+-% FV.vertices   - mesh vertices (Nx3 matrix)
+-% FV.faces      - faces with indices into 3 rows
+-%                 of FV.vertices (Mx3 matrix)
+-% 
+-% For each face, 3 new vertices are created at the 
+-% triangle edge midpoints.  Each face is divided into 4
+-% faces and returned in FV.
+-%
+-%        B
+-%       /\
+-%      /  \
+-%    a/____\b       Construct new triangles
+-%    /\    /\       [A,a,c]
+-%   /  \  /  \      [a,B,b]
+-%  /____\/____\     [c,b,C]
+-% A	     c	   C    [a,b,c]
+-% 
+-% It is assumed that the vertices are listed in clockwise order in
+-% FV.faces (A,B,C above), as viewed from the outside in a RHS coordinate
+-% system.
+-% 
+-% See also: mesh_refine, sphere_tri, sphere_project
+-% 
+-
+-
+-% ---this method is not implemented, but the idea here remains...
+-% This can be done until some minimal distance (D) of the mean 
+-% distance between vertices of all triangles is achieved.  If
+-% no D argument is given, the function refines the mesh once.
+-% Alternatively, it could be done until some minimum mean 
+-% area of faces is achieved.  As is, it just refines once.
+-
+-
+-% $Revision: 1.1 $ $Date: 2004/11/12 01:32:35 $
+-
+-% Licence:  GNU GPL, no implied or express warranties
+-% History:  05/2002, Darren.Weber_at_radiology.ucsf.edu, created
+-%
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-
+-tic;
+-fprintf('...refining mesh (tri4)...')
+-
+-% NOTE
+-% The centroid is located one third of the way from each vertex to 
+-% the midpoint of the opposite side. Each median divides the triangle 
+-% into two equal areas; all the medians together divide it into six 
+-% equal parts, and the lines from the median point to the vertices 
+-% divide the whole into three equivalent triangles.
+-
+-% Each input triangle with vertices labelled [A,B,C] as shown
+-% below will be turned into four new triangles:
+-%
+-% Make new midpoints
+-% a = (A+B)/2
+-% b = (B+C)/2
+-% c = (C+A)/2
+-%
+-%        B
+-%       /\
+-%      /  \
+-%    a/____\b       Construct new triangles
+-%    /\    /\       [A,a,c]
+-%   /  \  /  \      [a,B,b]
+-%  /____\/____\     [c,b,C]
+-% A	     c	   C    [a,b,c]
+-%
+-
+-% Initialise a new vertices and faces matrix
+-Nvert = size(FV.vertices,1);
+-Nface = size(FV.faces,1);
+-V2 = zeros(Nface*3,3);
+-F2 = zeros(Nface*4,3);
+-
+-for f = 1:Nface,
+-    
+-    % Get the triangle vertex indices
+-    NA = FV.faces(f,1);
+-    NB = FV.faces(f,2);
+-    NC = FV.faces(f,3);
+-    
+-    % Get the triangle vertex coordinates
+-    A = FV.vertices(NA,:);
+-    B = FV.vertices(NB,:);
+-    C = FV.vertices(NC,:);
+-    
+-    % Now find the midpoints between vertices
+-    a = (A + B) ./ 2;
+-    b = (B + C) ./ 2;
+-    c = (C + A) ./ 2;
+-    
+-    % Find the length of each median
+-    %A2blen = sqrt ( sum( (A - b).^2, 2 ) );
+-    %B2clen = sqrt ( sum( (B - c).^2, 2 ) );
+-    %C2alen = sqrt ( sum( (C - a).^2, 2 ) );
+-    
+-    % Store the midpoint vertices, while
+-    % checking if midpoint vertex already exists
+-    [FV, Na] = mesh_find_vertex(FV,a);
+-    [FV, Nb] = mesh_find_vertex(FV,b);
+-    [FV, Nc] = mesh_find_vertex(FV,c);
+-    
+-    % Create new faces with orig vertices plus midpoints
+-    F2(f*4-3,:) = [ NA, Na, Nc ];
+-    F2(f*4-2,:) = [ Na, NB, Nb ];
+-    F2(f*4-1,:) = [ Nc, Nb, NC ];
+-    F2(f*4-0,:) = [ Na, Nb, Nc ];
+-    
+-end
+-
+-% Replace the faces matrix
+-FV.faces = F2;
+-
+-t=toc; fprintf('done (%5.2f sec)\n',t);
+-
+-return
+-
+-
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-function [FV, N] = mesh_find_vertex(FV,vertex)
+-
+-    Vn = size(FV.vertices,1);
+-    Va = repmat(vertex,Vn,1);
+-    Vexist = find( FV.vertices(:,1) == Va(:,1) & ...
+-                   FV.vertices(:,2) == Va(:,2) & ...
+-                   FV.vertices(:,3) == Va(:,3) );
+-    if Vexist,
+-        if size(Vexist) == [1,1],
+-            N = Vexist;
+-        else,
+-            msg = sprintf('replicated vertices');
+-            error(msg);
+-        end
+-    else
+-        FV.vertices(end+1,:) = vertex;
+-        N = size(FV.vertices,1);
+-    end
+-
+-return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/runme.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/runme.m	(revision 12912)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/runme.m	(revision 12913)
+@@ -1,4 +0,0 @@
+-% 5 -> level of refinment
+-% 1000 -> radius
+-FV = sphere_tri('ico',5,1000); 
+-patch('vertices',FV.vertices,'faces',FV.faces,'facecolor',[1 0 0],'edgecolor',[.2 .2 .6]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/planetmixedmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/planetmixedmesh.m	(revision 12912)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/planetmixedmesh.m	(revision 12913)
+@@ -1,99 +0,0 @@
+-function md=planetmixedmesh(md,radius,angleresol)
+-%PLANETMIXEDMESH: build 2d shell mesh
+-%
+-% Usage: md=planetmixedshell(md,radius,angleresol)
+-%
+-
+-conv=pi/180;
+-
+-r=radius;
+-theta=(0:angleresol:360)';
+-theta=theta*conv;
+-phi=(0:angleresol:180)';
+-phi=phi(2:end-1)*conv;
+-
+-nphi=length(phi);
+-nthetha=length(theta);
+-
+-x=zeros(nphi*nthetha,1);
+-y=zeros(nphi*nthetha,1);
+-z=zeros(nphi*nthetha,1);
+-
+-for i=1:nphi,
+-	phii=phi(i);
+-	x((i-1)*nthetha+1:i*nthetha)=r.*cos(theta).*sin(phii);
+-	y((i-1)*nthetha+1:i*nthetha)=r.*sin(theta).*sin(phii);
+-	z((i-1)*nthetha+1:i*nthetha)=r.*cos(phii);
+-end
+-
+-quads=zeros((nthetha-1)*(nphi-1),4);
+-
+-%build elements
+-for i=1:nphi-1,
+-	for j=1:nthetha-1,
+-		count=(i-1)*(nthetha-1)+j;
+-	
+-		A=(i-1)*nthetha+j;
+-		B=(i-1)*nthetha+j+1;
+-		C=(i)*nthetha+j+1;
+-		D=(i)*nthetha+j;
+-		
+-		quads(count,:)=[A B C D];
+-	end
+-end
+-
+-%now, add polar elements:
+-%first north: phi = 0;
+-x=[r.*cos(0).*sin(0);x];
+-y=[r.*sin(0).*sin(0);y];
+-z=[r.*cos(0);z];
+-
+-%add 1 to quads: 
+-quads=quads+1;
+-
+-%add tria elements:
+-trias=zeros(nthetha-1,4);
+-
+-for i=1:nthetha-1,
+-	A=1;
+-	B=i+1;
+-	C=i+2;
+-	trias(i,:)=[A B C NaN];
+-end
+-
+-quads=[trias;quads];
+-
+-
+-% now add south pole: 
+-phii=180*conv;
+-x=[x;r.*cos(phii).*sin(phii)];
+-y=[y;r.*sin(phii).*sin(phii)];
+-z=[z;r.*cos(phii)];
+-nods=length(x);
+-
+-%add tria elements:
+-trias=zeros(nthetha-1,4);
+-
+-start=nods-nthetha;
+-for i=1:nthetha-1,
+-	A=start+i-1;
+-	B=start+i;
+-	C=nods;
+-	trias(i,:)=[A B C NaN];
+-end
+-
+-quads=[quads;trias];
+-
+-
+-md.mesh.elements=quads;
+-md.x=x;
+-md.y=y;
+-md.z=z;
+-md.r=sqrt(x.^2+y.^2+z.^2);
+-md.theta=acos(z./r);
+-md.phi=atan2(y,x);
+-
+-md.mesh.numberofvertices=length(md.x);
+-md.mesh.numberofelements=size(md.mesh.elements,1);
+-
+-md.mesh.dimension=3;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/sphere_project.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/sphere_project.m	(revision 12912)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/sphere_project.m	(revision 12913)
+@@ -1,66 +0,0 @@
+-function V = sphere_project(v,r,c)
+-
+-% sphere_project - project point X,Y,Z to the surface of sphere radius r
+-% 
+-% V = sphere_project(v,r,c)
+-% 
+-% Cartesian inputs:
+-% v is the vertex matrix, Nx3 (XYZ)
+-% r is the sphere radius, 1x1 (default 1)
+-% c is the sphere centroid, 1x3 (default 0,0,0)
+-%
+-% XYZ are converted to spherical coordinates and their radius is
+-% adjusted according to r, from c toward XYZ (defined with theta,phi)
+-% 
+-% V is returned as Cartesian 3D coordinates
+-% 
+-
+-% $Revision: 1.1 $ $Date: 2004/11/12 01:32:36 $
+-
+-% Licence:  GNU GPL, no implied or express warranties
+-% History:  06/2002, Darren.Weber_at_radiology.ucsf.edu, created
+-%
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-
+-if ~exist('v','var'),
+-    msg = sprintf('SPHERE_PROJECT: No input vertices (X,Y,Z)\n');
+-    error(msg);
+-end
+-
+-X = v(:,1);
+-Y = v(:,2);
+-Z = v(:,3);
+-
+-if ~exist('c','var'),
+-    xo = 0;
+-    yo = 0;
+-    zo = 0;
+-else
+-    xo = c(1);
+-    yo = c(2);
+-    zo = c(3);
+-end
+-
+-if ~exist('r','var'), r = 1; end
+-
+-% alternate method is to use unit vector of V
+-% [ n = 'magnitude(V)'; unitV = V ./ n; ]
+-% to change the radius, multiply the unitV
+-% by the radius required.  This avoids the
+-% use of arctan functions, which have branches.
+-
+-
+-% Convert Cartesian X,Y,Z to spherical (radians)
+-theta = atan2( (Y-yo), (X-xo) );
+-phi   = atan2( sqrt( (X-xo).^2 + (Y-yo).^2 ), (Z-zo) );
+-% do not calc: r = sqrt( (X-xo).^2 + (Y-yo).^2 + (Z-zo).^2);
+-
+-%   Recalculate X,Y,Z for constant r, given theta & phi.
+-R = ones(size(phi)) * r;
+-x = R .* sin(phi) .* cos(theta);
+-y = R .* sin(phi) .* sin(theta);
+-z = R .* cos(phi);
+-
+-V = [x y z];
+-
+-return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/planettrimesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/planettrimesh.m	(revision 12912)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/planet/planettrimesh.m	(revision 12913)
+@@ -1,20 +0,0 @@
+-function md=planettrimesh(md,shape,radius,refinement)
+-%PLANETTRIMESH: build 2d shell mesh
+-%
+-% Usage: md=planettrimesh(md,shape,radius,refinement)
+-%
+-
+-results = sphere_tri(shape,refinement,radius);
+-md.x=results.vertices(:,1);
+-md.y=results.vertices(:,2);
+-md.z=results.vertices(:,3);
+-md.mesh.elements=results.faces;
+-
+-md.r=sqrt(md.x.^2+md.y.^2+md.z.^2);
+-md.theta=acos(md.z./md.r);
+-md.phi=atan2(md.y,md.x);
+-
+-md.mesh.numberofvertices=length(md.x);
+-md.mesh.numberofelements=size(md.mesh.elements,1);
+-
+-md.mesh.dimension=3;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_tri.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_tri.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_tri.m	(revision 12913)
+@@ -0,0 +1,204 @@
++function [FV] = sphere_tri(shape,maxlevel,r,winding)
++
++% sphere_tri - generate a triangle mesh approximating a sphere
++% 
++% Usage: FV = sphere_tri(shape,Nrecurse,r,winding)
++% 
++%   shape is a string, either of the following:
++%   'ico'   starts with icosahedron (most even, default)
++%   'oct'   starts with octahedron
++%   'tetra' starts with tetrahedron (least even)
++%
++%   Nrecurse is int >= 0, setting the recursions (default 0)
++%
++%   r is the radius of the sphere (default 1)
++%
++%   winding is 0 for clockwise, 1 for counterclockwise (default 0).  The
++%   matlab patch command gives outward surface normals for clockwise
++%   order of vertices in the faces (viewed from outside the surface).
++%
++%   FV has fields FV.vertices and FV.faces.  The vertices 
++%   are listed in clockwise order in FV.faces, as viewed 
++%   from the outside in a RHS coordinate system.
++% 
++% The function uses recursive subdivision.  The first
++% approximation is an platonic solid, either an  icosahedron,
++% octahedron or a tetrahedron.  Each level of refinement 
++% subdivides each triangle face by a factor of 4 (see also 
++% mesh_refine).  At each refinement, the vertices are 
++% projected to the sphere surface (see sphere_project).
++% 
++% A recursion level of 3 or 4 is a good sphere surface, if
++% gouraud shading is used for rendering.
++% 
++% The returned struct can be used in the patch command, eg:
++% 
++% % create and plot, vertices: [2562x3] and faces: [5120x3]
++% FV = sphere_tri('ico',4,1);
++% lighting phong; shading interp; figure;
++% patch('vertices',FV.vertices,'faces',FV.faces,...
++%       'facecolor',[1 0 0],'edgecolor',[.2 .2 .6]);
++% axis off; camlight infinite; camproj('perspective');
++% 
++% See also: mesh_refine, sphere_project
++%
++
++
++
++% $Revision: 1.2 $ $Date: 2005/07/20 23:07:03 $
++
++% Licence:  GNU GPL, no implied or express warranties
++% Jon Leech (leech @ cs.unc.edu) 3/24/89
++% icosahedral code added by Jim Buddenhagen (jb1556@daditz.sbc.com) 5/93
++% 06/2002, adapted from c to matlab by Darren.Weber_at_radiology.ucsf.edu
++% 05/2004, reorder of the faces for the 'ico' surface so they are indeed
++% clockwise!  Now the surface normals are directed outward.  Also reset the
++% default recursions to zero, so we can get out just the platonic solids.
++%
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++
++eegversion = '$Revision: 1.2 $';
++fprintf('SPHERE_TRI [v %s]\n',eegversion(11:15)); tic
++
++if ~exist('shape','var') || isempty(shape),
++    shape = 'ico';
++end
++fprintf('...creating sphere tesselation based on %s\n',shape);
++
++% default maximum subdivision level
++if ~exist('maxlevel','var') || isempty(maxlevel) || maxlevel < 0,
++    maxlevel = 0;
++end
++
++% default radius
++if ~exist('r','var') || isempty(r),
++    r = 1;
++end
++
++if ~exist('winding','var') || isempty(winding),
++    winding = 0;
++end
++
++
++% -----------------
++% define the starting shapes
++
++shape = lower(shape);
++
++switch shape,
++case 'tetra',
++    
++    % Vertices of a tetrahedron
++    sqrt_3 = 0.5773502692;
++    
++    tetra.v = [  sqrt_3,  sqrt_3,  sqrt_3 ;   % +X, +Y, +Z  - PPP
++                -sqrt_3, -sqrt_3,  sqrt_3 ;   % -X, -Y, +Z  - MMP
++                -sqrt_3,  sqrt_3, -sqrt_3 ;   % -X, +Y, -Z  - MPM
++                 sqrt_3, -sqrt_3, -sqrt_3 ];  % +X, -Y, -Z  - PMM
++	
++    % Structure describing a tetrahedron
++    tetra.f = [ 1, 2, 3;
++                1, 4, 2;
++                3, 2, 4;
++                4, 1, 3 ];
++    
++    FV.vertices = tetra.v;
++    FV.faces    = tetra.f;
++    
++case 'oct',
++    
++    % Six equidistant points lying on the unit sphere
++    oct.v = [  1,  0,  0 ;  %  X
++              -1,  0,  0 ; 	% -X
++               0,  1,  0 ;  %  Y
++               0, -1,  0 ; 	% -Y
++               0,  0,  1 ; 	%  Z
++               0,  0, -1 ];	% -Z
++	
++    % Join vertices to create a unit octahedron
++    oct.f = [ 1 5 3 ;    %  X  Z  Y  -  First the top half
++              3 5 2 ;    %  Y  Z -X
++              2 5 4 ;    % -X  Z -Y
++              4 5 1 ;    % -Y  Z  X
++              1 3 6 ;    %  X  Y -Z  -  Now the bottom half
++              3 2 6 ;    %  Y  Z -Z
++              2 4 6 ;    % -X  Z -Z
++              4 1 6 ];   % -Y  Z -Z
++    
++    FV.vertices = oct.v;
++    FV.faces    = oct.f;
++    
++case 'ico',
++    
++    % Twelve vertices of icosahedron on unit sphere
++    tau = 0.8506508084; % t=(1+sqrt(5))/2, tau=t/sqrt(1+t^2)
++    one = 0.5257311121; % one=1/sqrt(1+t^2) , unit sphere
++    
++    ico.v( 1,:) = [  tau,  one,    0 ]; % ZA
++    ico.v( 2,:) = [ -tau,  one,    0 ]; % ZB
++    ico.v( 3,:) = [ -tau, -one,    0 ]; % ZC
++    ico.v( 4,:) = [  tau, -one,    0 ]; % ZD
++    ico.v( 5,:) = [  one,   0 ,  tau ]; % YA
++    ico.v( 6,:) = [  one,   0 , -tau ]; % YB
++    ico.v( 7,:) = [ -one,   0 , -tau ]; % YC
++    ico.v( 8,:) = [ -one,   0 ,  tau ]; % YD
++    ico.v( 9,:) = [   0 ,  tau,  one ]; % XA
++    ico.v(10,:) = [   0 , -tau,  one ]; % XB
++    ico.v(11,:) = [   0 , -tau, -one ]; % XC
++    ico.v(12,:) = [   0 ,  tau, -one ]; % XD
++    
++    % Structure for unit icosahedron
++    ico.f = [  5,  8,  9 ;
++               5, 10,  8 ;
++               6, 12,  7 ;
++               6,  7, 11 ;
++               1,  4,  5 ;
++               1,  6,  4 ;
++               3,  2,  8 ;
++               3,  7,  2 ;
++               9, 12,  1 ;
++               9,  2, 12 ;
++              10,  4, 11 ;
++              10, 11,  3 ;
++               9,  1,  5 ;
++              12,  6,  1 ;
++               5,  4, 10 ;
++               6, 11,  4 ;
++               8,  2,  9 ;
++               7, 12,  2 ;
++               8, 10,  3 ;
++               7,  3, 11 ];
++	
++    FV.vertices = ico.v;
++    FV.faces    = ico.f;
++end
++
++
++% -----------------
++% refine the starting shapes with subdivisions
++if maxlevel,
++    
++    % Subdivide each starting triangle (maxlevel) times
++    for level = 1:maxlevel,
++        
++        % Subdivide each triangle and normalize the new points thus
++        % generated to lie on the surface of a sphere radius r.
++        FV = mesh_refine_tri4(FV);
++        FV.vertices = sphere_project(FV.vertices,r);
++        
++        % An alternative might be to define a min distance
++        % between vertices and recurse or use fminsearch
++        
++    end
++end
++
++if winding,
++    fprintf('...returning counterclockwise vertex order (viewed from outside)\n');
++    FV.faces = FV.faces(:,[1 3 2]);
++else
++    fprintf('...returning clockwise vertex order (viewed from outside)\n');
++end
++
++t=toc; fprintf('...done (%6.2f sec)\n\n',t);
++
++return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/mesh_refine_tri4.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/mesh_refine_tri4.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/mesh_refine_tri4.m	(revision 12913)
+@@ -0,0 +1,146 @@
++function [ FV ] = mesh_refine_tri4(FV)
++
++% mesh_refine_tri4 - creates 4 triangle from each triangle of a mesh
++%
++% [ FV ] = mesh_refine_tri4( FV )
++%
++% FV.vertices   - mesh vertices (Nx3 matrix)
++% FV.faces      - faces with indices into 3 rows
++%                 of FV.vertices (Mx3 matrix)
++% 
++% For each face, 3 new vertices are created at the 
++% triangle edge midpoints.  Each face is divided into 4
++% faces and returned in FV.
++%
++%        B
++%       /\
++%      /  \
++%    a/____\b       Construct new triangles
++%    /\    /\       [A,a,c]
++%   /  \  /  \      [a,B,b]
++%  /____\/____\     [c,b,C]
++% A	     c	   C    [a,b,c]
++% 
++% It is assumed that the vertices are listed in clockwise order in
++% FV.faces (A,B,C above), as viewed from the outside in a RHS coordinate
++% system.
++% 
++% See also: mesh_refine, sphere_tri, sphere_project
++% 
++
++
++% ---this method is not implemented, but the idea here remains...
++% This can be done until some minimal distance (D) of the mean 
++% distance between vertices of all triangles is achieved.  If
++% no D argument is given, the function refines the mesh once.
++% Alternatively, it could be done until some minimum mean 
++% area of faces is achieved.  As is, it just refines once.
++
++
++% $Revision: 1.1 $ $Date: 2004/11/12 01:32:35 $
++
++% Licence:  GNU GPL, no implied or express warranties
++% History:  05/2002, Darren.Weber_at_radiology.ucsf.edu, created
++%
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++
++tic;
++fprintf('...refining mesh (tri4)...')
++
++% NOTE
++% The centroid is located one third of the way from each vertex to 
++% the midpoint of the opposite side. Each median divides the triangle 
++% into two equal areas; all the medians together divide it into six 
++% equal parts, and the lines from the median point to the vertices 
++% divide the whole into three equivalent triangles.
++
++% Each input triangle with vertices labelled [A,B,C] as shown
++% below will be turned into four new triangles:
++%
++% Make new midpoints
++% a = (A+B)/2
++% b = (B+C)/2
++% c = (C+A)/2
++%
++%        B
++%       /\
++%      /  \
++%    a/____\b       Construct new triangles
++%    /\    /\       [A,a,c]
++%   /  \  /  \      [a,B,b]
++%  /____\/____\     [c,b,C]
++% A	     c	   C    [a,b,c]
++%
++
++% Initialise a new vertices and faces matrix
++Nvert = size(FV.vertices,1);
++Nface = size(FV.faces,1);
++V2 = zeros(Nface*3,3);
++F2 = zeros(Nface*4,3);
++
++for f = 1:Nface,
++    
++    % Get the triangle vertex indices
++    NA = FV.faces(f,1);
++    NB = FV.faces(f,2);
++    NC = FV.faces(f,3);
++    
++    % Get the triangle vertex coordinates
++    A = FV.vertices(NA,:);
++    B = FV.vertices(NB,:);
++    C = FV.vertices(NC,:);
++    
++    % Now find the midpoints between vertices
++    a = (A + B) ./ 2;
++    b = (B + C) ./ 2;
++    c = (C + A) ./ 2;
++    
++    % Find the length of each median
++    %A2blen = sqrt ( sum( (A - b).^2, 2 ) );
++    %B2clen = sqrt ( sum( (B - c).^2, 2 ) );
++    %C2alen = sqrt ( sum( (C - a).^2, 2 ) );
++    
++    % Store the midpoint vertices, while
++    % checking if midpoint vertex already exists
++    [FV, Na] = mesh_find_vertex(FV,a);
++    [FV, Nb] = mesh_find_vertex(FV,b);
++    [FV, Nc] = mesh_find_vertex(FV,c);
++    
++    % Create new faces with orig vertices plus midpoints
++    F2(f*4-3,:) = [ NA, Na, Nc ];
++    F2(f*4-2,:) = [ Na, NB, Nb ];
++    F2(f*4-1,:) = [ Nc, Nb, NC ];
++    F2(f*4-0,:) = [ Na, Nb, Nc ];
++    
++end
++
++% Replace the faces matrix
++FV.faces = F2;
++
++t=toc; fprintf('done (%5.2f sec)\n',t);
++
++return
++
++
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++function [FV, N] = mesh_find_vertex(FV,vertex)
++
++    Vn = size(FV.vertices,1);
++    Va = repmat(vertex,Vn,1);
++    Vexist = find( FV.vertices(:,1) == Va(:,1) & ...
++                   FV.vertices(:,2) == Va(:,2) & ...
++                   FV.vertices(:,3) == Va(:,3) );
++    if Vexist,
++        if size(Vexist) == [1,1],
++            N = Vexist;
++        else,
++            msg = sprintf('replicated vertices');
++            error(msg);
++        end
++    else
++        FV.vertices(end+1,:) = vertex;
++        N = size(FV.vertices,1);
++    end
++
++return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/runme.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/runme.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/runme.m	(revision 12913)
+@@ -0,0 +1,4 @@
++% 5 -> level of refinment
++% 1000 -> radius
++FV = sphere_tri('ico',5,1000); 
++patch('vertices',FV.vertices,'faces',FV.faces,'facecolor',[1 0 0],'edgecolor',[.2 .2 .6]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmesher.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmesher.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmesher.m	(revision 12913)
+@@ -0,0 +1,35 @@
++function md=planetmesher(md,varargin)
++%PLANETMESHER - create planet mesh using several packages
++%
++%   This routine creates a planet mesh using several packages: a custom made 
++%   ISSM mesher (called planetmixedmesh.m, method 'mixed') and the planettrimesh
++%   (method 'tria')
++%   where md is a @planet object, varargin is a list of options
++%
++% Usage: md=planetmesh(md,'method','mixed','radius',6378000,'angleresol',1);
++%        md=planetmesh(md,'method','tria','shape','iso','radius',6378000,'refinement',5);
++%
++%
++
++	%recover options
++	options=pairoptions(varargin{:});
++
++	method=getfieldvalue(options,'method','mixed');
++
++	if strcmpi(method,'mixed'),
++		%recover radius and angleresol: 
++		radius=getfieldvalue(options,'radius',6378000); %earth radius as default
++		angleresol=getfieldvalue(options,'angleresol',10); %10 degree resolution
++
++		%call mixed mesh 
++		md=planetmixedmesh(md,radius,angleresol);
++	else
++		%recover radius, shape and level of refinmenet
++		radius=getfieldvalue(options,'radius',6378000); %earth radius as default
++		refinement=getfieldvalue(options,'refinement',5); %refine 5 times
++		shape=getfieldvalue(options,'shape','ico'); 
++
++		%call triangular mesh
++		md=planettrimesh(md,shape,radius,refinement);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m	(revision 12913)
+@@ -0,0 +1,99 @@
++function md=planetmixedmesh(md,radius,angleresol)
++%PLANETMIXEDMESH: build 2d shell mesh
++%
++% Usage: md=planetmixedshell(md,radius,angleresol)
++%
++
++conv=pi/180;
++
++r=radius;
++theta=(0:angleresol:360)';
++theta=theta*conv;
++phi=(0:angleresol:180)';
++phi=phi(2:end-1)*conv;
++
++nphi=length(phi);
++nthetha=length(theta);
++
++x=zeros(nphi*nthetha,1);
++y=zeros(nphi*nthetha,1);
++z=zeros(nphi*nthetha,1);
++
++for i=1:nphi,
++	phii=phi(i);
++	x((i-1)*nthetha+1:i*nthetha)=r.*cos(theta).*sin(phii);
++	y((i-1)*nthetha+1:i*nthetha)=r.*sin(theta).*sin(phii);
++	z((i-1)*nthetha+1:i*nthetha)=r.*cos(phii);
++end
++
++quads=zeros((nthetha-1)*(nphi-1),4);
++
++%build elements
++for i=1:nphi-1,
++	for j=1:nthetha-1,
++		count=(i-1)*(nthetha-1)+j;
++	
++		A=(i-1)*nthetha+j;
++		B=(i-1)*nthetha+j+1;
++		C=(i)*nthetha+j+1;
++		D=(i)*nthetha+j;
++		
++		quads(count,:)=[A B C D];
++	end
++end
++
++%now, add polar elements:
++%first north: phi = 0;
++x=[r.*cos(0).*sin(0);x];
++y=[r.*sin(0).*sin(0);y];
++z=[r.*cos(0);z];
++
++%add 1 to quads: 
++quads=quads+1;
++
++%add tria elements:
++trias=zeros(nthetha-1,4);
++
++for i=1:nthetha-1,
++	A=1;
++	B=i+1;
++	C=i+2;
++	trias(i,:)=[A B C NaN];
++end
++
++quads=[trias;quads];
++
++
++% now add south pole: 
++phii=180*conv;
++x=[x;r.*cos(phii).*sin(phii)];
++y=[y;r.*sin(phii).*sin(phii)];
++z=[z;r.*cos(phii)];
++nods=length(x);
++
++%add tria elements:
++trias=zeros(nthetha-1,4);
++
++start=nods-nthetha;
++for i=1:nthetha-1,
++	A=start+i-1;
++	B=start+i;
++	C=nods;
++	trias(i,:)=[A B C NaN];
++end
++
++quads=[quads;trias];
++
++
++md.mesh.elements=quads;
++md.x=x;
++md.y=y;
++md.z=z;
++md.r=sqrt(x.^2+y.^2+z.^2);
++md.theta=acos(z./r);
++md.phi=atan2(y,x);
++
++md.mesh.numberofvertices=length(md.x);
++md.mesh.numberofelements=size(md.mesh.elements,1);
++
++md.mesh.dimension=3;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_project.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_project.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_project.m	(revision 12913)
+@@ -0,0 +1,66 @@
++function V = sphere_project(v,r,c)
++
++% sphere_project - project point X,Y,Z to the surface of sphere radius r
++% 
++% V = sphere_project(v,r,c)
++% 
++% Cartesian inputs:
++% v is the vertex matrix, Nx3 (XYZ)
++% r is the sphere radius, 1x1 (default 1)
++% c is the sphere centroid, 1x3 (default 0,0,0)
++%
++% XYZ are converted to spherical coordinates and their radius is
++% adjusted according to r, from c toward XYZ (defined with theta,phi)
++% 
++% V is returned as Cartesian 3D coordinates
++% 
++
++% $Revision: 1.1 $ $Date: 2004/11/12 01:32:36 $
++
++% Licence:  GNU GPL, no implied or express warranties
++% History:  06/2002, Darren.Weber_at_radiology.ucsf.edu, created
++%
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++
++if ~exist('v','var'),
++    msg = sprintf('SPHERE_PROJECT: No input vertices (X,Y,Z)\n');
++    error(msg);
++end
++
++X = v(:,1);
++Y = v(:,2);
++Z = v(:,3);
++
++if ~exist('c','var'),
++    xo = 0;
++    yo = 0;
++    zo = 0;
++else
++    xo = c(1);
++    yo = c(2);
++    zo = c(3);
++end
++
++if ~exist('r','var'), r = 1; end
++
++% alternate method is to use unit vector of V
++% [ n = 'magnitude(V)'; unitV = V ./ n; ]
++% to change the radius, multiply the unitV
++% by the radius required.  This avoids the
++% use of arctan functions, which have branches.
++
++
++% Convert Cartesian X,Y,Z to spherical (radians)
++theta = atan2( (Y-yo), (X-xo) );
++phi   = atan2( sqrt( (X-xo).^2 + (Y-yo).^2 ), (Z-zo) );
++% do not calc: r = sqrt( (X-xo).^2 + (Y-yo).^2 + (Z-zo).^2);
++
++%   Recalculate X,Y,Z for constant r, given theta & phi.
++R = ones(size(phi)) * r;
++x = R .* sin(phi) .* cos(theta);
++y = R .* sin(phi) .* sin(theta);
++z = R .* cos(phi);
++
++V = [x y z];
++
++return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planettrimesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planettrimesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planettrimesh.m	(revision 12913)
+@@ -0,0 +1,20 @@
++function md=planettrimesh(md,shape,radius,refinement)
++%PLANETTRIMESH: build 2d shell mesh
++%
++% Usage: md=planettrimesh(md,shape,radius,refinement)
++%
++
++results = sphere_tri(shape,refinement,radius);
++md.x=results.vertices(:,1);
++md.y=results.vertices(:,2);
++md.z=results.vertices(:,3);
++md.mesh.elements=results.faces;
++
++md.r=sqrt(md.x.^2+md.y.^2+md.z.^2);
++md.theta=acos(md.z./md.r);
++md.phi=atan2(md.y,md.x);
++
++md.mesh.numberofvertices=length(md.x);
++md.mesh.numberofelements=size(md.mesh.elements,1);
++
++md.mesh.dimension=3;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/planetmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/planetmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/planetmesh.m	(revision 12913)
+@@ -0,0 +1,115 @@
++%MESH class definition
++%
++%   Usage:
++%      planetmesh=planetmesh();
++
++classdef planetmesh
++	properties (SetAccess=public) 
++		r                           = NaN;
++		theta                       = NaN;
++		phi                         = NaN
++		elements                    = NaN
++		dimension                   = 0;
++		numberoflayers              = 0;
++		numberofelements            = 0;
++		numberofvertices            = 0;
++		
++		lat                         = NaN
++		long                        = NaN
++
++		vertexconnectivity          = NaN
++		elementconnectivity         = NaN
++		average_vertex_connectivity = 0;
++	end
++	methods
++		function obj = planetmesh(varargin) % {{{
++			switch nargin
++				case 0
++					obj=setdefaultparameters(obj);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function obj = setdefaultparameters(obj) % {{{
++
++			%the connectivity is the avergaded number of nodes linked to a
++			%given node through an edge. This connectivity is used to initially
++			%allocate memory to the stiffness matrix. A value of 16 seems to
++			%give a good memory/time ration. This value can be checked in
++			%trunk/test/Miscellaneous/runme.m
++			obj.average_vertex_connectivity=25;
++		end % }}}
++		function md = checkconsistency(obj,md,solution,analyses) % {{{
++
++			md = checkfield(md,'planetmesh.r','NaN',1,'size',[md.planetmesh.numberofvertices 1]);
++			md = checkfield(md,'planetmesh.theta','NaN',1,'size',[md.planetmesh.numberofvertices 1]);
++			md = checkfield(md,'planetmesh.phi','NaN',1,'size',[md.planetmesh.numberofvertices 1]);
++			md = checkfield(md,'planetmesh.elements','NaN',1,'>',0,'values',1:md.planetmesh.numberofvertices);
++			if(md.planetmesh.dimension==2),
++				md = checkfield(md,'planetmesh.elements','size',[md.planetmesh.numberofelements 3]);
++			else
++				md = checkfield(md,'planetmesh.elements','size',[md.planetmesh.numberofelements 6]);
++			end
++			if any(~ismember(1:md.planetmesh.numberofvertices,sort(unique(md.planetmesh.elements(:)))));
++				md = checkmessage(md,'orphan nodes have been found. Check the planetmesh outline');
++			end
++			md = checkfield(md,'planetmesh.dimension','values',[2 3]);
++			md = checkfield(md,'planetmesh.numberoflayers','>=',0);
++			md = checkfield(md,'planetmesh.numberofelements','>',0);
++			md = checkfield(md,'planetmesh.numberofvertices','>',0);
++			%no checks for numberofedges lat long and hemisphere
++			if (md.planetmesh.dimension==2),
++				md = checkfield(md,'planetmesh.average_vertex_connectivity','>=',9,'message','''planetmesh.average_vertex_connectivity'' should be at least 9 in 2d');
++			else
++				md = checkfield(md,'planetmesh.average_vertex_connectivity','>=',24,'message','''planetmesh.average_vertex_connectivity'' should be at least 24 in 3d');
++			end
++			md = checkfield(md,'planetmesh.elementconnectivity','size',[md.planetmesh.numberofelements 3],'NaN',1);
++
++			%Solution specific checks
++			switch(solution),
++				case PrognosticSolutionEnum,
++					if md.prognostic.stabilization==3,
++						md = checkfield(md,'planetmesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d planetmeshes');
++					end
++				case TransientSolutionEnum,
++					if md.transient.isprognostic & md.prognostic.stabilization==3,
++						md = checkfield(md,'planetmesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d planetmeshes');
++					end
++				case ThermalSolutionEnum,
++					md = checkfield(md,'planetmesh.dimension','values',3,'message','thermal solution only supported on 3d planetmeshes');
++			end
++		end % }}}
++		function disp(obj) % {{{
++			disp(sprintf('   Mesh:')); 
++
++			disp(sprintf('\n      Elements and vertices:'));
++			fielddisplay(obj,'numberofelements','number of elements');
++			fielddisplay(obj,'numberofvertices','number of vertices');
++			fielddisplay(obj,'elements','index into (x,y,z), coordinates of the vertices');
++			fielddisplay(obj,'r','vertices r coordinate');
++			fielddisplay(obj,'theta','vertices theta coordinate');
++			fielddisplay(obj,'phi','vertices phi coordinate');
++
++			disp(sprintf('\n      Properties:'));
++			fielddisplay(obj,'dimension','planetmesh dimension (2d or 3d)');
++			fielddisplay(obj,'numberoflayers','number of extrusion layers');
++			
++			fielddisplay(obj,'vertexconnectivity','list of vertices connected to vertex_i');
++			fielddisplay(obj,'elementconnectivity','list of vertices connected to element_i');
++			fielddisplay(obj,'average_vertex_connectivity','average number of vertices connected to one vertex');
++
++		end % }}}
++		function marshall(obj,fid) % {{{
++			WriteData(fid,'object',obj,'fieldname','r','format','DoubleMat','mattype',1);
++			WriteData(fid,'object',obj,'fieldname','theta','format','DoubleMat','mattype',1);
++			WriteData(fid,'object',obj,'fieldname','phi','format','DoubleMat','mattype',1);
++			WriteData(fid,'object',obj,'fieldname','elements','format','DoubleMat','mattype',2);
++			WriteData(fid,'object',obj,'fieldname','dimension','format','Integer');
++			WriteData(fid,'object',obj,'fieldname','numberoflayers','format','Integer');
++			WriteData(fid,'object',obj,'fieldname','numberofelements','format','Integer');
++			WriteData(fid,'object',obj,'fieldname','numberofvertices','format','Integer');
++			WriteData(fid,'object',obj,'fieldname','elementconnectivity','format','DoubleMat','mattype',3);
++			WriteData(fid,'object',obj,'fieldname','average_vertex_connectivity','format','Integer');
++		end % }}}
++	end
++end
Index: /issm/oecreview/Archive/12678-13393/ISSM-12913-12914.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12913-12914.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12913-12914.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am	(revision 12913)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am	(revision 12914)
+@@ -10,7 +10,6 @@
+ 				./model/parameterization/*.m \
+ 				./model/partition/*.m \
+ 				./model/solvers/*.m \
+-				./planet/*.m \
+ 				./qmu/*.m \
+ 				./utils/*.m \
+ 				./utils/Array/*.m \
Index: /issm/oecreview/Archive/12678-13393/ISSM-12914-12915.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12914-12915.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12914-12915.diff	(revision 13394)
@@ -0,0 +1,1135 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 12915)
+@@ -135,7 +135,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</Placemark",11)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -176,14 +176,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Feature::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 12915)
+@@ -31,8 +31,8 @@
+ /*FUNCTION KML_Unknown::~KML_Unknown(){{{*/
+ KML_Unknown::~KML_Unknown(){
+ 
+-	if (name      ) xfree((void**)&name);
+-	if (value     ) xfree((void**)&value);
++	if (name      ) xDelete<char>(name);
++	if (value     ) xDelete<char>(value);
+ 
+ }
+ /*}}}*/
+@@ -76,7 +76,7 @@
+ 	KML_Object::DeepEcho(indent);
+ 
+ 	if (value     ) {
+-		valuei=(char *) xmalloc((strlen(value)+1)*sizeof(char));
++		valuei=xNew<char>(strlen(value)+1);
+ 		memcpy(valuei,value,(strlen(value)+1)*sizeof(char)); 
+         
+ 		vtoken=strtok(valuei,nl);
+@@ -86,7 +86,7 @@
+ 			if(flag) _pprintString_("\n" << indent << "                 " << vtoken);
+ 		if(flag) _pprintLine_("\"");
+ 
+-		xfree((void**)&valuei);
++		xDelete<char>(valuei);
+ 	}
+     else
+         if(flag) _pprintLine_(indent << "         value: [none]");
+@@ -107,7 +107,7 @@
+ 	WriteCommnt(filout,indent);
+ 
+ 	if (value     ) {
+-		valuei=(char *) xmalloc((strlen(value)+1)*sizeof(char));
++		valuei=xNew<char>(strlen(value)+1);
+ 		memcpy(valuei,value,(strlen(value)+1)*sizeof(char)); 
+         
+ 		vtoken=strtok(valuei,nl);
+@@ -116,7 +116,7 @@
+ 		while (vtoken=strtok(NULL,nl))
+ 			fprintf(filout,"%s  %s\n",indent,vtoken);
+ 
+-		xfree((void**)&valuei);
++		xDelete<char>(valuei);
+ 	}
+ 
+ 	KML_Object::Write(filout,indent);
+@@ -130,6 +130,7 @@
+ void  KML_Unknown::Read(FILE* fid,char* kstr){
+ 
+ 	char*        kstri;
++	char*        value2=NULL;
+ 	int          ncom=0;
+ 	char**       pcom=NULL;
+ 	char         nl[]={'\n','\0'};
+@@ -154,7 +155,7 @@
+ 		if      (!strncmp(&kstri[0],"</", 2) &&
+ 				 !strncmp(&kstri[2],name,strlen(name))) {
+ //			_pprintLine_("KML_Unknown::Read -- closing name=" << name << ".");
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -162,12 +163,17 @@
+ 
+ 		else if (strncmp(kstri,"<",1)) {
+ 			if (value) {
+-				value=(char *) xrealloc(value,(strlen(value)+1+strlen(kstri)+1)*sizeof(char));
++				value2=xNew<char>(strlen(value)+1+strlen(kstri)+1);
++				memcpy(value2,value,(strlen(value)+1)*sizeof(char));
++				xDelete<char>(value);
++				value=value2;
++				value2=NULL;
++//				value=(char *) xrealloc(value,(strlen(value)+1+strlen(kstri)+1)*sizeof(char));
+ 				strcat(value,nl);
+ 				strcat(value,kstri);
+ 			}
+ 			else {
+-				value=(char *) xmalloc((strlen(kstri)+1)*sizeof(char));
++				value=xNew<char>(strlen(kstri)+1);
+ 				memcpy(value,kstri,(strlen(kstri)+1)*sizeof(char));
+ 			}
+ 		}
+@@ -175,14 +181,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Object::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 12915)
+@@ -126,7 +126,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</GroundOverlay",15)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -150,14 +150,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Overlay::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 12915)
+@@ -37,12 +37,10 @@
+ 
+ 	if (list) {
+ //		delete list;
+-		if (list      ) xfree((void**)&list);
+ 		list      =NULL;
+ 	}
+ 	if (balloon) {
+ //		delete balloon;
+-		if (balloon   ) xfree((void**)&balloon);
+ 		balloon   =NULL;
+ 	}
+ 	if (poly) {
+@@ -55,12 +53,10 @@
+ 	}
+ 	if (label) {
+ //		delete label;
+-		if (label     ) xfree((void**)&label);
+ 		label     =NULL;
+ 	}
+ 	if (icon) {
+ //		delete icon;
+-		if (icon      ) xfree((void**)&icon);
+ 		icon      =NULL;
+ 	}
+ 
+@@ -188,7 +184,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</Style", 7)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -229,14 +225,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_StyleSelector::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.cpp	(revision 12915)
+@@ -30,7 +30,7 @@
+ /*FUNCTION KML_Comment::~KML_Comment(){{{*/
+ KML_Comment::~KML_Comment(){
+ 
+-	if (value     ) xfree((void**)&value);
++	if (value     ) xDelete<char>(value);
+ 
+ }
+ /*}}}*/
+@@ -93,7 +93,7 @@
+ /*FUNCTION KML_Comment::Alloc {{{*/
+ void  KML_Comment::Alloc(const char* valuei){
+ 
+-	value=(char *) xmalloc((strlen(valuei)+1)*sizeof(char));
++	value=xNew<char>(strlen(valuei)+1);
+ 	memcpy(value,valuei,(strlen(valuei)+1)*sizeof(char));
+ 
+ 	return;
+@@ -110,7 +110,7 @@
+ /*FUNCTION KML_Comment::Get {{{*/
+ void  KML_Comment::Get(char** pvalueo){
+ 
+-	*pvalueo=(char *) xmalloc((strlen(value)+1)*sizeof(char));
++	*pvalueo=xNew<char>(strlen(value)+1);
+ 	memcpy(*pvalueo,value,(strlen(value)+1)*sizeof(char));
+ 
+ 	return;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 12915)
+@@ -135,7 +135,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</MultiGeometry",15)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -176,14 +176,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Geometry::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 12915)
+@@ -108,7 +108,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</LineStyle",11)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -124,14 +124,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_ColorStyle::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 12915)
+@@ -101,7 +101,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</Folder", 8)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -112,14 +112,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Container::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 12915)
+@@ -101,7 +101,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</Document",10)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -112,14 +112,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Container::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 12915)
+@@ -102,7 +102,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</kml", 5)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -113,14 +113,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Object::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 12915)
+@@ -140,7 +140,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</Icon", 6)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -168,14 +168,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Object::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 12915)
+@@ -121,7 +121,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</Point", 7)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -139,14 +139,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Geometry::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 12915)
+@@ -158,7 +158,8 @@
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+-	for(ncom;ncom>0;ncom--) xDelete<char>((pcom[ncom-1]));
++	for(ncom; ncom>0; ncom--)
++		xDelete<char>(pcom[ncom-1]);
+ 	xDelete<char*>(pcom);
+ 
+ 	return;
+@@ -173,8 +174,8 @@
+ 
+ /*  extract latitude and longitude into vectors  */
+ 
+-	lat=xNew<double>(ncoord);
+-	lon=xNew<double>(ncoord);
++	lat=xNew<IssmDouble>(ncoord);
++	lon=xNew<IssmDouble>(ncoord);
+ 	for (i=0; i<ncoord; i++) {
+ 		lon[i]=coords[3*i+0];
+ 		lat[i]=coords[3*i+1];
+@@ -182,8 +183,8 @@
+ 
+ /*  convert latitude and longitude to x and y  */
+ 
+-	x  =xNew<double>(ncoord);
+-	y  =xNew<double>(ncoord);
++	x  =xNew<IssmDouble>(ncoord);
++	y  =xNew<IssmDouble>(ncoord);
+ 	Ll2xyx(x,y,lat,lon,ncoord,sgn,cm,sp);
+ 
+ /*  write header  */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 12915)
+@@ -28,9 +28,9 @@
+ 	bool    inew=1,itag=0,ifield=0;
+ 	int     c;
+ 	int     ibuf=0,buflen=1024,bufblk=1024;
+-	char    *buffer=NULL,*bufferc=NULL;
++	char    *buffer=NULL,*bufferc=NULL,**pcom2=NULL;
+ 
+-	buffer=(char *) xmalloc(buflen*sizeof(char));
++	buffer=xNew<char>(buflen);
+ 	buffer[0]='\0';
+ 
+ /*  read kml file character-by-character  */
+@@ -56,11 +56,16 @@
+ 				else {
+ 					if (pncom && ppcom) {
+ 						(*pncom)++;
+-						*ppcom=(char **) xrealloc(*ppcom,*pncom*sizeof(char*));
++						pcom2=xNew<char*>(*pncom);
++						memcpy(pcom2,*ppcom,(*pncom-1)*sizeof(char*));
++						xDelete<char*>(*ppcom);
++						*ppcom=pcom2;
++						pcom2=NULL;
++//						*ppcom=(char **) xrealloc(*ppcom,*pncom*sizeof(char*));
+ 						(*ppcom)[*pncom-1]=bufferc;
+ 					}
+ 					else
+-						xfree((void**)&bufferc);
++						xDelete<char>(bufferc);
+ 					inew=1;
+ 					continue;
+ 				}
+@@ -97,11 +102,16 @@
+ 				else
+ 					if (pncom && ppcom) {
+ 						(*pncom)++;
+-						*ppcom=(char **) xrealloc(*ppcom,*pncom*sizeof(char*));
++						pcom2=xNew<char*>(*pncom);
++						memcpy(pcom2,*ppcom,(*pncom-1)*sizeof(char*));
++						xDelete<char*>(*ppcom);
++						*ppcom=pcom2;
++						pcom2=NULL;
++//						*ppcom=(char **) xrealloc(*ppcom,*pncom*sizeof(char*));
+ 						(*ppcom)[*pncom-1]=bufferc;
+ 					}
+ 					else
+-						xfree((void**)&bufferc);
++						xDelete<char>(bufferc);
+ 			}
+ 			else {
+ 				inew=0;
+@@ -132,7 +142,7 @@
+ //	_pprintLine_(buffer);
+ 
+ 	if (!ibuf)
+-		xfree((void**)&buffer);
++		xDelete<char>(buffer);
+ 
+ 	return(buffer);
+ }
+@@ -148,7 +158,7 @@
+ 	int     ibuf=0,buflen=1024,bufblk=1024;
+ 	char*   buffer=NULL;
+ 
+-	buffer=(char *) xmalloc(buflen*sizeof(char));
++	buffer=xNew<char>(buflen);
+ 	buffer[0]='\0';
+ 
+ /*  read kml file character-by-character  */
+@@ -171,7 +181,7 @@
+ 				(ibuf == 4 && buffer[3] != '-')) {
+ 				for (i=ibuf-1; i>=0; i--)
+ 					ungetc(buffer[i],fid);
+-				xfree((void**)&buffer);
++				xDelete<char>(buffer);
+ 				return(buffer);
+ 			}
+ 		}
+@@ -196,7 +206,7 @@
+ //	_pprintLine_(buffer);
+ 
+ 	if (!ibuf)
+-		xfree((void**)&buffer);
++		xDelete<char>(buffer);
+ 
+ 	return(buffer);
+ }
+@@ -208,13 +218,18 @@
+ 
+ /*  add the specified character to the token buffer  */
+ 
+-	char*   buffer=NULL;
++	char*   buffer2=NULL;
+ 
+ /*  check buffer length and realloc if necessary  */
+ 
+ 	if (*pibuf+2 > *pbuflen) {
+ 		*pbuflen+=bufblk;
+-		*pbuffer=(char *) xrealloc(*pbuffer,*pbuflen*sizeof(char));
++		buffer2=xNew<char>(*pbuflen);
++		memcpy(buffer2,*pbuffer,(*pbuflen-bufblk)*sizeof(char));
++		xDelete<char>(*pbuffer);
++		*pbuffer=buffer2;
++		buffer2=NULL;
++//		*pbuffer=(char *) xrealloc(*pbuffer,*pbuflen*sizeof(char));
+ 	}
+ 
+ /*  add character and terminator  */
+@@ -247,7 +262,7 @@
+ 
+ /*  strtok modifies ktag, so work on copy  */
+ 
+-	ktagi=(char *) xmalloc((strlen(ktag)+1)*sizeof(char));
++	ktagi=xNew<char>(strlen(ktag)+1);
+ 	memcpy(ktagi,ktag,(strlen(ktag)+1)*sizeof(char));
+ 
+ /*  skip opening delimeter and find subsequent blank or closing delimiter  */
+@@ -257,9 +272,9 @@
+ 
+ 	if (!pname) {
+ 		if (maxlen)
+-			pname=(char *) xmalloc((maxlen       +1)*sizeof(char));
++			pname=xNew<char>(maxlen       +1);
+ 		else
+-			pname=(char *) xmalloc((strlen(ktokn)+1)*sizeof(char));
++			pname=xNew<char>(strlen(ktokn)+1);
+ 	}
+ 
+ 	if (maxlen && (maxlen < strlen(ktokn))) {
+@@ -270,7 +285,7 @@
+ 	else
+ 		memcpy(pname,ktokn,(strlen(ktokn)+1)*sizeof(char));
+ 
+-	xfree((void**)&ktagi);
++	xDelete<char>(ktagi);
+ 
+ 	if (m)
+ 		*m=strlen(pname);
+@@ -292,7 +307,7 @@
+ 
+ /*  strtok modifies ktag, so work on copy  */
+ 
+-	ktagi=(char *) xmalloc((strlen(ktag)+1)*sizeof(char));
++	ktagi=xNew<char>(strlen(ktag)+1);
+ 	memcpy(ktagi,ktag,(strlen(ktag)+1)*sizeof(char));
+ 
+ /*  loop through tag to find all attributes  */
+@@ -314,7 +329,7 @@
+ 			kobj->AddAttrib(ktokn,ktokv);
+ 	}
+ 
+-	xfree((void**)&ktagi);
++	xDelete<char>(ktagi);
+ 
+ /*  check for xml declaration, dtd declaration, or solo tag  */
+ 
+@@ -342,7 +357,7 @@
+ 		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
+ 
+ 	sscanf(kstr,"%d",pival);
+-	xfree((void**)&kstr);
++	xDelete<char>(kstr);
+ 
+ /*  get additional token and compare to closing tag  */
+ 
+@@ -354,7 +369,7 @@
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+ 		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+-			xfree((void**)&kstr);
++			xDelete<char>(kstr);
+ 
+ //	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << *pival << ".");
+ 
+@@ -376,7 +391,7 @@
+ 
+ 	sscanf(kstr,"%d",&ival);
+ 	*pbval=(bool)ival;
+-	xfree((void**)&kstr);
++	xDelete<char>(kstr);
+ 
+ /*  get additional token and compare to closing tag  */
+ 
+@@ -388,7 +403,7 @@
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+ 		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+-			xfree((void**)&kstr);
++			xDelete<char>(kstr);
+ 
+ //	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << (*pbval ? "true" : "false") << ".");
+ 
+@@ -421,9 +436,9 @@
+ 
+ 	if (!pstr) {
+ 		if (maxlen)
+-			pstr=(char *) xmalloc((maxlen      +1)*sizeof(char));
++			pstr=xNew<char>(maxlen      +1);
+ 		else
+-			pstr=(char *) xmalloc((strlen(kstr)+1)*sizeof(char));
++			pstr=xNew<char>(strlen(kstr)+1);
+ 	}
+ 
+ 	if (maxlen && (maxlen < strlen(kstr))) {
+@@ -434,7 +449,7 @@
+ 	else
+ 		memcpy(pstr,kstr,(strlen(kstr)+1)*sizeof(char));
+ 
+-	xfree((void**)&kstr);
++	xDelete<char>(kstr);
+ 
+ 	if (m)
+ 		*m=strlen(pstr);
+@@ -449,7 +464,7 @@
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+ 		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+-			xfree((void**)&kstr);
++			xDelete<char>(kstr);
+ 
+ //	_pprintLine_("KMLFileTokenParse -- " << ktag << "=\"" << pstr << "\".");
+ 
+@@ -471,7 +486,7 @@
+ 	  {_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}
+ 
+ 	sscanf(kstr,"%g",pfval);
+-	xfree((void**)&kstr);
++	xDelete<char>(kstr);
+ 
+ /*  get additional token and compare to closing tag  */
+ 
+@@ -483,7 +498,7 @@
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+ 		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+-			xfree((void**)&kstr);
++			xDelete<char>(kstr);
+ 
+ //	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << *pfval << ".");
+ 
+@@ -505,7 +520,7 @@
+ 		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
+ 
+ 	sscanf(kstr,"%lg",pdval);
+-	xfree((void**)&kstr);
++	xDelete<char>(kstr);
+ 
+ /*  get additional token and compare to closing tag  */
+ 
+@@ -517,7 +532,7 @@
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+ 		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+-			xfree((void**)&kstr);
++			xDelete<char>(kstr);
+ 
+ //	_pprintLine_("KMLFileTokenParse -- " << ktag << "=" << *pdval << ".");
+ 
+@@ -543,9 +558,9 @@
+ 
+ 	if (!*pdval)
+ 		if (maxlen)
+-			*pdval=(double *) xmalloc(maxlen              *sizeof(double));
++			*pdval=xNew<IssmDouble>(maxlen            );
+ 		else
+-			*pdval=(double *) xmalloc(((strlen(kstr)+1)/2)*sizeof(double));
++			*pdval=xNew<IssmDouble>((strlen(kstr)+1)/2);
+ 
+ /*  loop through string to get all values  */
+ 
+@@ -557,10 +572,10 @@
+ 		sscanf(ktok,"%lg",&((*pdval)[i]));
+ 		ktok=strtok(NULL,delim);
+ 	}
+-	xfree((void**)&kstr);
++	xDelete<char>(kstr);
+ 
+-	if (!maxlen)
+-		*pdval=(double *) xrealloc(*pdval,(i+1)*sizeof(double));
++//	if (!maxlen)
++//		*pdval=(double *) xrealloc(*pdval,(i+1)*sizeof(double));
+ 
+ 	if (m)
+ 		*m=i+1;
+@@ -575,7 +590,7 @@
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+ 		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+-			xfree((void**)&kstr);
++			xDelete<char>(kstr);
+ 
+ //	_pprintLine_("KMLFileTokenParse -- " << ktag << "=...");
+ //	for (j=0; j<=i; j++)
+@@ -603,9 +618,9 @@
+ 
+ 	if (!*pdval)
+ 		if (maxlen)
+-			*pdval=(double *) xmalloc((maxlen*n)          *sizeof(double));
++			*pdval=xNew<IssmDouble>(maxlen*n          );
+ 		else
+-			*pdval=(double *) xmalloc(((strlen(kstr)+1)/2)*sizeof(double));
++			*pdval=xNew<IssmDouble>((strlen(kstr)+1)/2);
+ 
+ /*  loop through string to get all values  */
+ 
+@@ -618,10 +633,10 @@
+ 		sscanf(ktok,"%lg",&((*pdval)[i]));
+ 		ktok=strtok(NULL,delim);
+ 	}
+-	xfree((void**)&kstr);
++	xDelete<char>(kstr);
+ 
+-	if (!maxlen)
+-		*pdval=(double *) xrealloc(*pdval,((i+1)*n)*sizeof(double));
++//	if (!maxlen)
++//		*pdval=(double *) xrealloc(*pdval,((i+1)*n)*sizeof(double));
+ 
+ 	if (m)
+ 		*m=((i+1)+(n-1))/n;
+@@ -639,7 +654,7 @@
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+ 		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+-			xfree((void**)&kstr);
++			xDelete<char>(kstr);
+ 
+ //	_pprintLine_("KMLFileTokenParse -- " << ktag << "=...");
+ //	for (j=0; j<=i; j++)
+@@ -667,7 +682,7 @@
+ 				 (kstr[1] == '/') &&
+ 				 (!strncmp(&(kstr[2]),&(ktag[1]),(strcspn(ktag," >")-1)/sizeof(char)))) {
+ 			_pprintLine_("KMLFileTagSkip -- closing tag " << kstr << ".");
+-			xfree((void**)&kstr);
++			xDelete<char>(kstr);
+ 			return(0);
+ 		}
+ 
+@@ -687,7 +702,7 @@
+ 			_error2_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");
+ 		}
+ 
+-		xfree((void**)&kstr);
++		xDelete<char>(kstr);
+ 	}
+ 
+ 	_error2_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 12915)
+@@ -116,7 +116,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</LatLonBox",11)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -148,14 +148,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Object::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.cpp	(revision 12915)
+@@ -31,8 +31,8 @@
+ /*FUNCTION KML_Attribute::~KML_Attribute(){{{*/
+ KML_Attribute::~KML_Attribute(){
+ 
+-	if (name      ) xfree((void**)&name);
+-	if (value     ) xfree((void**)&value);
++	if (name      ) xDelete<char>(name);
++	if (value     ) xDelete<char>(value);
+ 
+ }
+ /*}}}*/
+@@ -99,10 +99,10 @@
+ /*FUNCTION KML_Attribute::Alloc {{{*/
+ void  KML_Attribute::Alloc(const char* namei,const char* valuei){
+ 
+-	name =(char *) xmalloc((strlen(namei )+1)*sizeof(char));
++	name =xNew<char>(strlen(namei )+1);
+ 	memcpy(name,namei,(strlen(namei)+1)*sizeof(char));
+ 
+-	value=(char *) xmalloc((strlen(valuei)+1)*sizeof(char));
++	value=xNew<char>(strlen(valuei)+1);
+ 	memcpy(value,valuei,(strlen(valuei)+1)*sizeof(char));
+ 
+ 	return;
+@@ -120,11 +120,11 @@
+ void  KML_Attribute::Get(char** pvalueo,char* deflt){
+ 
+ 	if (!value || !strlen(value)) {
+-		*pvalueo=(char *) xmalloc((strlen(deflt)+1)*sizeof(char));
++		*pvalueo=xNew<char>(strlen(deflt)+1);
+ 		memcpy(*pvalueo,deflt,(strlen(deflt)+1)*sizeof(char));
+ 	}
+ 	else {
+-		*pvalueo=(char *) xmalloc((strlen(value)+1)*sizeof(char));
++		*pvalueo=xNew<char>(strlen(value)+1);
+ 		memcpy(*pvalueo,value,(strlen(value)+1)*sizeof(char));
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 12915)
+@@ -112,7 +112,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</PolyStyle",11)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -132,14 +132,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_ColorStyle::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp	(revision 12915)
+@@ -303,7 +303,7 @@
+ 	if (katt)
+ 		katt->Get(pvalue,deflt);
+ 	else {
+-		*pvalue=(char *) xmalloc((strlen(deflt)+1)*sizeof(char));
++		*pvalue=xNew<char>(strlen(deflt)+1);
+ 		memcpy(*pvalue,deflt,(strlen(deflt)+1)*sizeof(char));
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp	(revision 12915)
+@@ -136,7 +136,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</LineString",12)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -164,14 +164,14 @@
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Geometry::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
+@@ -185,8 +185,8 @@
+ 
+ /*  extract latitude and longitude into vectors  */
+ 
+-	lat=(double *) xmalloc(ncoord*sizeof(double));
+-	lon=(double *) xmalloc(ncoord*sizeof(double));
++	lat=xNew<IssmDouble>(ncoord);
++	lon=xNew<IssmDouble>(ncoord);
+ 	for (i=0; i<ncoord; i++) {
+ 		lon[i]=coords[3*i+0];
+ 		lat[i]=coords[3*i+1];
+@@ -194,8 +194,8 @@
+ 
+ /*  convert latitude and longitude to x and y  */
+ 
+-	x  =(double *) xmalloc(ncoord*sizeof(double));
+-	y  =(double *) xmalloc(ncoord*sizeof(double));
++	x  =xNew<IssmDouble>(ncoord);
++	y  =xNew<IssmDouble>(ncoord);
+ 	Ll2xyx(x,y,lat,lon,ncoord,sgn,cm,sp);
+ 
+ /*  write header  */
+@@ -220,10 +220,10 @@
+ 
+ 	fprintf(fid,"\n");
+ 
+-	xfree((void**)&y);
+-	xfree((void**)&x);
+-	xfree((void**)&lon);
+-	xfree((void**)&lat);
++	xDelete<IssmDouble>(y);
++	xDelete<IssmDouble>(x);
++	xDelete<IssmDouble>(lon);
++	xDelete<IssmDouble>(lat);
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp	(revision 12915)
+@@ -105,7 +105,7 @@
+ /*  process field within opening and closing tags  */
+ 
+ 	if      (!strncmp(kstr,"</Overlay", 9)) {
+-		xfree((void**)&kstr);
++		xDelete<char>(kstr);
+ 		return;
+ 	}
+ 	else if (!strncmp(kstr,"</",2))
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp	(revision 12915)
+@@ -115,7 +115,7 @@
+ /*  process field within opening and closing tags  */
+ 
+ 	if      (!strncmp(kstr,"</Container",11)) {
+-		xfree((void**)&kstr);
++		xDelete<char>(kstr);
+ 		return;
+ 	}
+ 	else if (!strncmp(kstr,"</",2))
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp	(revision 12914)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp	(revision 12915)
+@@ -174,7 +174,7 @@
+ 	while (kstri=KMLFileToken(fid,
+ 							  &ncom,&pcom)) {
+ 		if      (!strncmp(kstri,"</Polygon", 9)) {
+-			xfree((void**)&kstri);
++			xDelete<char>(kstri);
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+@@ -202,7 +202,7 @@
+ 			while (kstrj=KMLFileToken(fid,
+ 									  &ncom,&pcom)) {
+ 				if      (!strncmp(kstrj,"</outerBoundaryIs",17)) {
+-					xfree((void**)&kstrj);
++					xDelete<char>(kstrj);
+ 					break;
+ 				}
+ 				else if (!strncmp(kstrj,"</",2))
+@@ -219,7 +219,7 @@
+ 				else if (!strncmp(kstrj,"<",1))
+ 					KML_Geometry::Read(fid,kstrj);
+ 
+-				xfree((void**)&kstrj);
++				xDelete<char>(kstrj);
+ 			}
+ 
+ 		else if (!strcmp(kstri,"<innerBoundaryIs>"))
+@@ -229,7 +229,7 @@
+ 			while (kstrj=KMLFileToken(fid,
+ 									  &ncom,&pcom)) {
+ 				if      (!strncmp(kstrj,"</innerBoundaryIs",17)) {
+-					xfree((void**)&kstrj);
++					xDelete<char>(kstrj);
+ 					break;
+ 				}
+ 				else if (!strncmp(kstrj,"</",2))
+@@ -246,21 +246,21 @@
+ 				else if (!strncmp(kstrj,"<",1))
+ 					KML_Geometry::Read(fid,kstrj);
+ 
+-				xfree((void**)&kstrj);
++				xDelete<char>(kstrj);
+ 			}
+ 
+ 
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Geometry::Read(fid,kstri);
+ 
+-		xfree((void**)&kstri);
++		xDelete<char>(kstri);
+ 	}
+ 
+ 	this->AddCommnt(ncom,pcom);
+ 
+ 	for (ncom; ncom>0; ncom--)
+-		xfree((void**)&(pcom[ncom-1]));
+-	xfree((void**)&pcom);
++		xDelete<char>(pcom[ncom-1]);
++	xDelete<char*>(pcom);
+ 
+ 	return;
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-12915-12916.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12915-12916.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12915-12916.diff	(revision 13394)
@@ -0,0 +1,48 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 12915)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 12916)
+@@ -547,6 +547,7 @@
+ 	int     i=-1,j;
+ 	char*   kstr;
+ 	char*   ktok;
++	double* dval2=NULL;
+ 	char    delim[]={' ',',','\f','\n','\r','\t','\v','\0'};
+ 
+ /*  get next token and allocate if necessary  */
+@@ -574,7 +575,12 @@
+ 	}
+ 	xDelete<char>(kstr);
+ 
+-//	if (!maxlen)
++	if (!maxlen)
++		dval2=xNew<double>(i+1);
++		memcpy(dval2,*pdval,(i+1)*sizeof(double));
++		xDelete<double>(*pdval);
++		*pdval=dval2;
++		dval2=NULL;
+ //		*pdval=(double *) xrealloc(*pdval,(i+1)*sizeof(double));
+ 
+ 	if (m)
+@@ -607,6 +613,7 @@
+ 	int     i=-1,j=-1;
+ 	char*   kstr;
+ 	char*   ktok;
++	double* dval2=NULL;
+ 	char    delim[]={' ',',','\f','\n','\r','\t','\v','\0'};
+ 
+ /*  get next token and allocate if necessary  */
+@@ -635,7 +642,12 @@
+ 	}
+ 	xDelete<char>(kstr);
+ 
+-//	if (!maxlen)
++	if (!maxlen)
++		dval2=xNew<double>((i+1)*n);
++		memcpy(dval2,*pdval,((i+1)*n)*sizeof(double));
++		xDelete<double>(*pdval);
++		*pdval=dval2;
++		dval2=NULL;
+ //		*pdval=(double *) xrealloc(*pdval,((i+1)*n)*sizeof(double));
+ 
+ 	if (m)
Index: /issm/oecreview/Archive/12678-13393/ISSM-12920-12921.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12920-12921.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12920-12921.diff	(revision 13394)
@@ -0,0 +1,24 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh	(revision 12920)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh	(revision 12921)
+@@ -5,15 +5,14 @@
+ mkdir install
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool' 'libtool.tar.gz'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool-2.4.2.tar.gz' 'libtool-2.4.2.tar.gz'
+ 
+ #Untar 
+-tar -zxvf  libtool[\w.-]*.tar.gz
+-rm libtool[\w.-]*.tar.gz
++tar -zxvf  libtool-2.4.2.tar.gz
++rm libtool-2.4.2.tar.gz
+ 
+-
+ #Move libtool into src directory
+-mv libtool[\w.-]* src
++mv libtool-2.4.2 src
+ 
+ #Compile libtool
+ cd src 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12921-12922.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12921-12922.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12921-12922.diff	(revision 13394)
@@ -0,0 +1,57 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12921)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12922)
+@@ -5,9 +5,9 @@
+ #Library declaration {{{
+ lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+-if SHARED
+-lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
+-endif
++#if SHARED
++#lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
++#endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+@@ -1001,16 +1001,16 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
+-if SHARED
+-libISSM_la_SOURCES = solutions/issm.cpp
+-libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
++#if SHARED
++#libISSM_la_SOURCES = solutions/issm.cpp
++#libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
++#
++#libISSMCore_la_SOURCES  = $(issm_sources)
++#libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
++#
++#libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++#endif
+ 
+-libISSMCore_la_SOURCES  = $(issm_sources)
+-libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
+-
+-libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
+-endif
+-
+ if MODULES
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12921)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12922)
+@@ -20,8 +20,8 @@
+ AM_CONFIG_HEADER([./config.h])   #Config file must be config.h
+ AM_SILENT_RULES([yes])           #Do not show compilation command by default
+ AM_PROG_CC_C_O
+-
+ AM_PROG_AR
++AC_PROG_RANLIB
+ 
+ # To produce shared libraries uncomment LT_INIT. In theory, Libtool can be initialized
+ # even if all linking is static, since, if not shared libraries are to be produce, libtool
Index: /issm/oecreview/Archive/12678-13393/ISSM-12922-12923.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12922-12923.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12922-12923.diff	(revision 13394)
@@ -0,0 +1,22 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 12922)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 12923)
+@@ -15,15 +15,9 @@
+   IssmDouble delta18oLapseRate=-6.2*pow(10.,-3);
+   IssmDouble glacialindex; // used to vary present day temperature
+   int imonth=0;
+-  // printf("Delta18oTime %f\n",Delta18oTime);
+-  // printf("Delta18oPresent %f\n",Delta18oPresent);
+-  // printf("Delta18oLgm %f\n",Delta18oLgm);
+ 
+-  glacialindex = (Delta18oTime-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceTime-Delta18oSurfacePresent))
+-    /(Delta18oLgm-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceLgm-Delta18oSurfacePresent));
+-  // printf(" monthlytemperatureseeeeee %f\n",TemperaturesPresentday[1]);
+-  // printf(" monthlypreceeeeeeee %f\n",TemperaturesLgm[1]);
+-  // printf(" glacialindex %f\n",glacialindex);
++  glacialindex = 0;//(Delta18oTime-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceTime-Delta18oSurfacePresent))
++  //  /(Delta18oLgm-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceLgm-Delta18oSurfacePresent));
+ 
+   for (int imonth = 0; imonth<12; imonth++){  
+     monthlytemperaturestmp[imonth] = glacialindex*TemperaturesLgm[imonth] + (1-glacialindex)*TemperaturesPresentday[imonth];
Index: /issm/oecreview/Archive/12678-13393/ISSM-12923-12924.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12923-12924.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12923-12924.diff	(revision 13394)
@@ -0,0 +1,14 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m	(revision 12923)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m	(revision 12924)
+@@ -85,9 +85,6 @@
+ 			 for i=1:numel(filelist),
+ 				 compressstring = [compressstring ' ' filelist{i}];
+ 			 end
+-			 if cluster.interactive,
+-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+-			 end
+ 			 system(compressstring);
+ 
+ 			 disp('uploading input file and queueing script');
Index: /issm/oecreview/Archive/12678-13393/ISSM-12924-12925.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12924-12925.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12924-12925.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m	(revision 12924)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m	(revision 12925)
+@@ -17,7 +17,7 @@
+ 		 queue='shortq';
+ 		 time=10;
+ 		 % codepath='/usr/local/issm-r11321/bin'; % this one is for issm on acenet global
+-		 codepath='/home/klemorza/issm/bin'; % this one is for issm on my acenet directory
++		 codepath='PATH'; % this one is for issm on my acenet directory
+ 		 executionpath='/home/klemorza/issm/execution';
+ 		 %}}}
+ 	 end
Index: /issm/oecreview/Archive/12678-13393/ISSM-12925-12926.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12925-12926.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12925-12926.diff	(revision 13394)
@@ -0,0 +1,8 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12926-12927.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12926-12927.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12926-12927.diff	(revision 13394)
@@ -0,0 +1,449 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12926)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 12927)
+@@ -400,8 +400,10 @@
+ 	StressTensoryyEnum,
+ 	StressTensoryzEnum,
+ 	StressTensorzzEnum,
+-	IceVolumeEnum,
+-	TotalSmbEnum,
++	IceVolumeEnum, //FIXME reposition
++	TotalSmbEnum,  //FIXME reposition
++	ThicknessAlongGradientEnum,
++	ThicknessAcrossGradientEnum,
+ 	/*}}}*/
+ 	/*Element Interpolations{{{1*/
+ 	P0Enum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12926)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12927)
+@@ -403,6 +403,8 @@
+ 	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
+ 	      else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
+ 	      else if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum;
++	      else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
++	      else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
+ 	      else if (strcmp(name,"P0")==0) return P0Enum;
+ 	      else if (strcmp(name,"P1")==0) return P1Enum;
+ 	      else if (strcmp(name,"P1DG")==0) return P1DGEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12926)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 12927)
+@@ -393,6 +393,8 @@
+ 		case StressTensorzzEnum : return "StressTensorzz";
+ 		case IceVolumeEnum : return "IceVolume";
+ 		case TotalSmbEnum : return "TotalSmb";
++		case ThicknessAlongGradientEnum : return "ThicknessAlongGradient";
++		case ThicknessAcrossGradientEnum : return "ThicknessAcrossGradient";
+ 		case P0Enum : return "P0";
+ 		case P1Enum : return "P1";
+ 		case P1DGEnum : return "P1DG";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h	(revision 12926)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h	(revision 12927)
+@@ -118,6 +118,8 @@
+ #include "./TriMeshx/TriMeshx.h"
+ #include "./ThicknessAbsMisfitx/ThicknessAbsMisfitx.h"
+ #include "./ThicknessAbsGradientx/ThicknessAbsGradientx.h"
++#include "./ThicknessAlongGradientx/ThicknessAlongGradientx.h"
++#include "./ThicknessAcrossGradientx/ThicknessAcrossGradientx.h"
+ #include "./UpdateVertexPositionsx/UpdateVertexPositionsx.h"
+ #include "./UpdateConstraintsx/UpdateConstraintsx.h"
+ #include "./UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp	(revision 12927)
+@@ -0,0 +1,37 @@
++/*!\file ThicknessAlongGradientx
++ * \brief: compute misfit between observations and model
++ */
++
++#include "./ThicknessAlongGradientx.h"
++
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../toolkits/toolkits.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++void ThicknessAlongGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
++
++	/*Intermediary*/
++	int i;
++	Element* element=NULL;
++
++	/*output: */
++	double J=0;
++	double J_sum;
++
++	/*Compute Misfit: */
++	for (i=0;i<elements->Size();i++){
++		element=(Element*)elements->GetObjectByOffset(i);
++		J+=element->ThicknessAlongGradient(process_units,weight_index);
++	}
++
++	/*Sum all J from all cpus of the cluster:*/
++	#ifdef _HAVE_MPI_
++	MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
++	MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
++	J=J_sum;
++	#endif
++
++	/*Assign output pointers: */
++	*pJ=J;
++}
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h	(revision 12927)
+@@ -0,0 +1,14 @@
++/*!\file:  ThicknessAlongGradientx.h
++ * \brief header file for inverse methods misfit computation
++ */ 
++
++#ifndef _THICKNESSALONGGRADIENT_H
++#define _THICKNESSALONGGRADIENT_H
++
++#include "../../Container/Container.h"
++#include "../../classes/objects/objects.h"
++
++/* local prototypes: */
++void ThicknessAlongGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h	(revision 12927)
+@@ -0,0 +1,14 @@
++/*!\file:  ThicknessAcrossGradientx.h
++ * \brief header file for inverse methods misfit computation
++ */ 
++
++#ifndef _THICKNESSACROSSGRADIENT_H
++#define _THICKNESSACROSSGRADIENT_H
++
++#include "../../Container/Container.h"
++#include "../../classes/objects/objects.h"
++
++/* local prototypes: */
++void ThicknessAcrossGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp	(revision 12927)
+@@ -0,0 +1,37 @@
++/*!\file ThicknessAcrossGradientx
++ * \brief: compute misfit between observations and model
++ */
++
++#include "./ThicknessAcrossGradientx.h"
++
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../toolkits/toolkits.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++void ThicknessAcrossGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
++
++	/*Intermediary*/
++	int i;
++	Element* element=NULL;
++
++	/*output: */
++	double J=0;
++	double J_sum;
++
++	/*Compute Misfit: */
++	for (i=0;i<elements->Size();i++){
++		element=(Element*)elements->GetObjectByOffset(i);
++		J+=element->ThicknessAcrossGradient(process_units,weight_index);
++	}
++
++	/*Sum all J from all cpus of the cluster:*/
++	#ifdef _HAVE_MPI_
++	MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
++	MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
++	J=J_sum;
++	#endif
++
++	/*Assign output pointers: */
++	*pJ=J;
++}
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12926)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12927)
+@@ -460,6 +460,10 @@
+ 					  ./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h\
+ 					  ./modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp\
+ 					  ./modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h\
++					  ./modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp\
++					  ./modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h\
++					  ./modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp\
++					  ./modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h\
+ 					  ./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp\
+ 					  ./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h\
+ 					  ./classes/objects/Inputs/ControlInput.h\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 12926)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 12927)
+@@ -104,6 +104,8 @@
+ 		virtual IssmDouble SurfaceLogVxVyMisfit(bool process_units,int weight_index)=0;
+ 		virtual IssmDouble SurfaceAverageVelMisfit(bool process_units,int weight_index)=0;
+ 		virtual IssmDouble ThicknessAbsGradient(bool process_units,int weight_index)=0;
++		virtual IssmDouble ThicknessAlongGradient(bool process_units,int weight_index)=0;
++		virtual IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index)=0;
+ 		virtual IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index)=0;
+ 		virtual IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index)=0;
+ 		virtual void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index)=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12926)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12927)
+@@ -3523,6 +3523,8 @@
+ 
+ 		case ThicknessAbsMisfitEnum:
+ 		case ThicknessAbsGradientEnum:
++		case ThicknessAlongGradientEnum:
++		case ThicknessAcrossGradientEnum:
+ 		case SurfaceAbsVelMisfitEnum:
+ 		case SurfaceRelVelMisfitEnum:
+ 		case SurfaceLogVelMisfitEnum:
+@@ -4292,6 +4294,104 @@
+ 	return Jelem;
+ }
+ /*}}}*/
++/*FUNCTION Tria::ThicknessAlongGradient{{{*/
++IssmDouble Tria::ThicknessAlongGradient(bool process_units,int weight_index){
++
++	/* Intermediaries */
++	int         ig;
++	IssmDouble  Jelem = 0;
++	IssmDouble  weight;
++	IssmDouble  Jdet;
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	IssmDouble  dp[NDOF2];
++	IssmDouble  vx,vy;
++	GaussTria  *gauss                    = NULL;
++
++	/*retrieve parameters and inputs*/
++
++	/*If on water, return 0: */
++	if(IsOnWater()) return 0;
++
++	/*Retrieve all inputs we will be needing: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* weights_input  = inputs->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
++	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);
++
++	/* Start looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++		thickness_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++
++		/*J = 1/2 ( vx*dH/dx + vy*dH/dy )^2 */
++		Jelem+=weight*1/2*(vx*dp[0] + vy*dp[1])*(vx*dp[0] + vy*dp[1])*Jdet*gauss->weight;
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
++/*FUNCTION Tria::ThicknessAcrossGradient{{{*/
++IssmDouble Tria::ThicknessAcrossGradient(bool process_units,int weight_index){
++
++	/* Intermediaries */
++	int         ig;
++	IssmDouble  Jelem = 0;
++	IssmDouble  weight;
++	IssmDouble  Jdet;
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	IssmDouble  dp[NDOF2];
++	IssmDouble  vx,vy;
++	GaussTria  *gauss                    = NULL;
++
++	/*retrieve parameters and inputs*/
++
++	/*If on water, return 0: */
++	if(IsOnWater()) return 0;
++
++	/*Retrieve all inputs we will be needing: */
++	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
++	Input* weights_input  = inputs->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
++	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);
++
++	/* Start looping on the number of gaussian points: */
++	gauss=new GaussTria(2);
++	for (ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		/* Get Jacobian determinant: */
++		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
++
++		/*Get all parameters at gaussian point*/
++		weights_input->GetInputValue(&weight,gauss,weight_index);
++		thickness_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++
++		/*J = 1/2 ( -vy*dH/dx + vx*dH/dy )^2 */
++		Jelem+=weight*1/2*(-vy*dp[0] + vx*dp[1])*(-vy*dp[0] + vx*dp[1])*Jdet*gauss->weight;
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	return Jelem;
++}
++/*}}}*/
+ /*FUNCTION Tria::ThicknessAbsMisfit {{{*/
+ IssmDouble Tria::ThicknessAbsMisfit(bool process_units,int weight_index){
+ 
+@@ -4345,15 +4445,16 @@
+ 
+ 	/*Intermediaries */
+ 	int         i,ig,resp;
+-	IssmDouble      Jdet;
+-	IssmDouble      thickness,thicknessobs,weight;
+-	int        *responses = NULL;
++	IssmDouble  Jdet;
++	IssmDouble  thickness,thicknessobs,weight;
+ 	int         num_responses;
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      basis[3];
+-	IssmDouble      dbasis[NDOF2][NUMVERTICES];
+-	IssmDouble      dH[2];
+-	GaussTria*  gauss=NULL;
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	IssmDouble  basis[3];
++	IssmDouble  dbasis[NDOF2][NUMVERTICES];
++	IssmDouble  dH[2];
++	IssmDouble  v[2];
++	GaussTria *gauss     = NULL;
++	int       *responses = NULL;
+ 
+ 	/*Initialize Element vector*/
+ 	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
+@@ -4362,9 +4463,11 @@
+ 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+ 	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+ 	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
+-	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* 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);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	gauss=new GaussTria(2);
+@@ -4392,6 +4495,18 @@
+ 				for(i=0;i<numdof;i++) pe->values[i]+= - weight*dH[0]*dbasis[0][i]*Jdet*gauss->weight;
+ 				for(i=0;i<numdof;i++) pe->values[i]+= - weight*dH[1]*dbasis[1][i]*Jdet*gauss->weight;
+ 				break;
++			case ThicknessAlongGradientEnum:
++				weights_input->GetInputValue(&weight, gauss,resp);
++				vx_input->GetInputValue(&v[0],gauss);
++				vy_input->GetInputValue(&v[1],gauss);
++				for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*v[0]+dH[1]*v[1])*(dbasis[0][i]*v[0]+dbasis[1][i]*v[1])*Jdet*gauss->weight;
++				break;
++			case ThicknessAcrossGradientEnum:
++				weights_input->GetInputValue(&weight, gauss,resp);
++				vx_input->GetInputValue(&v[0],gauss);
++				vy_input->GetInputValue(&v[1],gauss);
++				for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*(-v[1])+dH[1]*v[0])*(dbasis[0][i]*(-v[1])+dbasis[1][i]*v[0])*Jdet*gauss->weight;
++				break;
+ 			default:
+ 				_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+ 		}
+@@ -4567,6 +4682,12 @@
+ 				case ThicknessAbsGradientEnum:
+ 					/*Nothing in P vector*/
+ 					break;
++				case ThicknessAlongGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case ThicknessAcrossGradientEnum:
++					/*Nothing in P vector*/
++					break;
+ 				case RheologyBbarAbsGradientEnum:
+ 					/*Nothing in P vector*/
+ 					break;
+@@ -4744,6 +4865,12 @@
+ 				case ThicknessAbsGradientEnum:
+ 					/*Nothing in P vector*/
+ 					break;
++				case ThicknessAcrossGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case ThicknessAlongGradientEnum:
++					/*Nothing in P vector*/
++					break;
+ 				case RheologyBbarAbsGradientEnum:
+ 					/*Nothing in P vector*/
+ 					break;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 12926)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 12927)
+@@ -157,7 +157,9 @@
+ 		IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index);
+ 		IssmDouble ThicknessAbsMisfit(     bool process_units,int weight_index);
+ 		IssmDouble SurfaceAbsVelMisfit(    bool process_units,int weight_index);
+-		IssmDouble ThicknessAbsGradient(bool process_units,int weight_index);
++		IssmDouble ThicknessAbsGradient(   bool process_units,int weight_index);
++		IssmDouble ThicknessAlongGradient( bool process_units,int weight_index);
++		IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index);
+ 		IssmDouble SurfaceRelVelMisfit(    bool process_units,int weight_index);
+ 		IssmDouble SurfaceLogVelMisfit(    bool process_units,int weight_index);
+ 		IssmDouble SurfaceLogVxVyMisfit(   bool process_units,int weight_index);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 12926)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 12927)
+@@ -161,6 +161,8 @@
+ 		IssmDouble SurfaceLogVxVyMisfit(   bool process_units,int weight_index);
+ 		IssmDouble SurfaceAverageVelMisfit(bool process_units,int weight_index);
+ 		IssmDouble ThicknessAbsGradient(bool process_units,int weight_index);
++		IssmDouble ThicknessAlongGradient( bool process_units,int weight_index){_error2_("not supported");};
++		IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index){_error2_("not supported");};
+ 		void   InputControlUpdate(IssmDouble scalar,bool save_parameter);
+ 		#endif
+ 		/*}}}*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-12927-12928.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12927-12928.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12927-12928.diff	(revision 13394)
@@ -0,0 +1,80 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 12927)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 12928)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=456;
++macro=458;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12927)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 12928)
+@@ -3776,6 +3776,26 @@
+ 
+ 	return StringToEnum('TotalSmb')
+ 
++def ThicknessAlongGradientEnum():
++	"""
++	THICKNESSALONGGRADIENTENUM - Enum of ThicknessAlongGradient
++
++	   Usage:
++	      macro=ThicknessAlongGradientEnum()
++	"""
++
++	return StringToEnum('ThicknessAlongGradient')
++
++def ThicknessAcrossGradientEnum():
++	"""
++	THICKNESSACROSSGRADIENTENUM - Enum of ThicknessAcrossGradient
++
++	   Usage:
++	      macro=ThicknessAcrossGradientEnum()
++	"""
++
++	return StringToEnum('ThicknessAcrossGradient')
++
+ def P0Enum():
+ 	"""
+ 	P0ENUM - Enum of P0
+@@ -4574,5 +4594,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 456
++	return 458
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ThicknessAcrossGradientEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ThicknessAcrossGradientEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ThicknessAcrossGradientEnum.m	(revision 12928)
+@@ -0,0 +1,11 @@
++function macro=ThicknessAcrossGradientEnum()
++%THICKNESSACROSSGRADIENTENUM - Enum of ThicknessAcrossGradient
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=ThicknessAcrossGradientEnum()
++
++macro=StringToEnum('ThicknessAcrossGradient');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ThicknessAlongGradientEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ThicknessAlongGradientEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/ThicknessAlongGradientEnum.m	(revision 12928)
+@@ -0,0 +1,11 @@
++function macro=ThicknessAlongGradientEnum()
++%THICKNESSALONGGRADIENTENUM - Enum of ThicknessAlongGradient
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=ThicknessAlongGradientEnum()
++
++macro=StringToEnum('ThicknessAlongGradient');
Index: /issm/oecreview/Archive/12678-13393/ISSM-12928-12929.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12928-12929.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12928-12929.diff	(revision 13394)
@@ -0,0 +1,293 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/asmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/asmoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/asmoptions.py	(revision 12929)
+@@ -0,0 +1,31 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def asmoptions(*args):
++	#ASMOPTIONS - return ASM petsc options
++	#
++	#   Usage:
++	#      options=asmoptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++	
++	options=[['mat_type','aij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','lu'],['pc_asm_overlap',3],['ksp_max_it',100],['ksp_rtol',1e-30]];
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobiasmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobiasmoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobiasmoptions.py	(revision 12929)
+@@ -0,0 +1,31 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def jacobiasmoptions(*args):
++	#ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
++	#
++	#   Usage:
++	#      options=jacobiasmoptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++	
++	options=[['mat_type','aij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','jacobi'],['pc_asm_overlap',3],['ksp_max_it',100],['ksp_rtol',1e-15]];
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.py	(revision 12929)
+@@ -0,0 +1,25 @@
++from pairoptions import *
++
++def iluasmoptions(*args):
++	"""
++	ILUASMOPTIONS - 
++
++	   Usage:
++	      options=iluasmoptions;
++	"""
++			 
++	#retrieve options provided in varargin
++	options=pairoptions(*args)
++	iluasm={}
++
++	#default iluasm options
++	iluasm['mat_type']=options.getfieldvalue("mat_type'",'aij')
++	iluasm['ksp_type']=options.getfieldvalue("ksp_type'",'gmres')
++	iluasm['pc_type']=options.getfieldvalue("pc_type'",'asm')
++	iluasm['sub_pc_type']=options.getfieldvalue("sub_pc_type'",'ilu')
++	iluasm['pc_asm_overlap']=options.getfieldvalue('pc_asm_overlap',5)
++	iluasm['ksp_max_it']=options.getfieldvalue('ksp_max_it',100)
++	iluasm['ksp_rtol']=options.getfieldvalue('ksp_rtol',1e-15)
++
++	return iluasm
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/matlaboptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/matlaboptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/matlaboptions.py	(revision 12929)
+@@ -0,0 +1,31 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def matlaboptions(*args):
++	#MATLABOPTIONS - return Matlab petsc options
++	#
++	#   Usage:
++	#      options=matlaboptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++	
++	options=[['ksp_type','matlab']];
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobicgoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobicgoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobicgoptions.py	(revision 12929)
+@@ -0,0 +1,31 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def jacobicgoptions(*args):
++	#ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
++	#
++	#   Usage:
++	#      options=jacobicgoptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++	
++	options=[['mat_type','aij'],['ksp_type','cg'],['ksp_max_it',100],['ksp_rtol',1e-15]];
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/mumpsoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/mumpsoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/mumpsoptions.py	(revision 12929)
+@@ -0,0 +1,33 @@
++from pairoptions import *
++from petscversion import *
++
++def mumpsoptions(*args):
++	"""
++	MUMPSOPTIONS - return MUMPS direct solver  petsc options
++
++	   Usage:
++	      options=mumpsoptions;
++	"""
++
++	#retrieve options provided in varargin
++	options=pairoptions(*args)
++	mumps={}
++
++	#default mumps options
++	PETSC_VERSION=petscversion()
++	if PETSC_VERSION==2:
++		mumps['mat_type']=options.getfieldvalue('mat_type','aijmumps')
++		mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
++		mumps['pc_type']=options.getfieldvalue('pc_type','lu')
++		mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
++		mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
++	if PETSC_VERSION==3:
++		mumps['mat_type']=options.getfieldvalue('mat_type','mpiaij')
++		mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
++		mumps['pc_type']=options.getfieldvalue('pc_type','lu')
++		mumps['pc_factor_mat_solver_package']=options.getfieldvalue('pc_factor_mat_solver_package','mumps')
++		mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
++		mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
++
++	return mumps
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/soroptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/soroptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/soroptions.py	(revision 12929)
+@@ -0,0 +1,31 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def soroptions(*args):
++	#SOROPTIONS - return Relaxation Solver petsc options
++	#
++	#   Usage:
++	#      options=soroptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++	
++	options=[['mat_type','aij'],['ksp_type','cg'],['pc_type','sor'],['pc_sor_omega',1.1],['pc_sor_its',2]];
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/stokesoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/stokesoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/stokesoptions.py	(revision 12929)
+@@ -0,0 +1,40 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def stokesoptions(*args):
++	#STOKESOPTIONS - return STOKES multi-physics solver petsc options
++	#
++	#   Usage:
++	#      options=stokesoptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++
++
++	#default stokes options
++	PETSC_VERSION=petscversion()
++
++	if PETSC_VERSION==2:
++		raise RuntimeError('stokesoptions error message: multi-physics options not supported in Petsc 2')
++	if PETSC_VERSION==3:
++		options=[['mat_type','mpiaij'],['ksp_max_it',1000],['ksp_type','gmres'],['pc_type','fieldsplit'],['pc_field_split_type','schur'],\
++	['fieldsplit_0_pc_type','hypre'],['fieldsplit_0_ksp_type','gmres'],['fieldsplit_0_pc_hypre_type','boomerang'],\
++	['fieldsplit_1_pc_type','jacobi'],['fieldsplit_1_ksp_type','preonly'],['issm_option_solver','stokes']]
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
Index: /issm/oecreview/Archive/12678-13393/ISSM-12929-12930.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12929-12930.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12929-12930.diff	(revision 13394)
@@ -0,0 +1,304 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/asmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/asmoptions.py	(revision 12929)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/asmoptions.py	(revision 12930)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def asmoptions(*args):
+-	#ASMOPTIONS - return ASM petsc options
+-	#
+-	#   Usage:
+-	#      options=asmoptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['mat_type','aij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','lu'],['pc_asm_overlap',3],['ksp_max_it',100],['ksp_rtol',1e-30]];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/matlaboptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/matlaboptions.py	(revision 12929)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/matlaboptions.py	(revision 12930)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def matlaboptions(*args):
+-	#MATLABOPTIONS - return Matlab petsc options
+-	#
+-	#   Usage:
+-	#      options=matlaboptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['ksp_type','matlab']];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/jacobicgoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/jacobicgoptions.py	(revision 12929)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/jacobicgoptions.py	(revision 12930)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def jacobicgoptions(*args):
+-	#ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
+-	#
+-	#   Usage:
+-	#      options=jacobicgoptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['mat_type','aij'],['ksp_type','cg'],['ksp_max_it',100],['ksp_rtol',1e-15]];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/mumpsoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/mumpsoptions.py	(revision 12929)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/mumpsoptions.py	(revision 12930)
+@@ -1,38 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def mumpsoptions(*args):
+-	#MUMPSOPTIONS - return MUMPS direct solver  petsc options
+-	#
+-	#   Usage:
+-	#      options=mumpsoptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-
+-
+-	#default mumps options
+-	PETSC_VERSION=petscversion()
+-
+-	if PETSC_VERSION==2:
+-		options=[['mat_type','aijmumps'],['ksp_type','preonly'],['pc_type','lu'],['mat_mumps_icntl_14',120],['pc_factor_shift_positive_definite','true']]
+-	if PETSC_VERSION==3:
+-		options=[['mat_type','mpiaij'],['ksp_type','preonly'],['pc_type','lu'],['pc_factor_mat_solver_package','mumps'],['mat_mumps_icntl_14',120],['pc_factor_shift_positive_definite','true']]
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/soroptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/soroptions.py	(revision 12929)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/soroptions.py	(revision 12930)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def soroptions(*args):
+-	#SOROPTIONS - return Relaxation Solver petsc options
+-	#
+-	#   Usage:
+-	#      options=soroptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['mat_type','aij'],['ksp_type','cg'],['pc_type','sor'],['pc_sor_omega',1.1],['pc_sor_its',2]];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/jacobiasmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/jacobiasmoptions.py	(revision 12929)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/jacobiasmoptions.py	(revision 12930)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def jacobiasmoptions(*args):
+-	#ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
+-	#
+-	#   Usage:
+-	#      options=jacobiasmoptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['mat_type','aij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','jacobi'],['pc_asm_overlap',3],['ksp_max_it',100],['ksp_rtol',1e-15]];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/stokesoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/stokesoptions.py	(revision 12929)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/stokesoptions.py	(revision 12930)
+@@ -1,40 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def stokesoptions(*args):
+-	#STOKESOPTIONS - return STOKES multi-physics solver petsc options
+-	#
+-	#   Usage:
+-	#      options=stokesoptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-
+-
+-	#default stokes options
+-	PETSC_VERSION=petscversion()
+-
+-	if PETSC_VERSION==2:
+-		raise RuntimeError('stokesoptions error message: multi-physics options not supported in Petsc 2')
+-	if PETSC_VERSION==3:
+-		options=[['mat_type','mpiaij'],['ksp_max_it',1000],['ksp_type','gmres'],['pc_type','fieldsplit'],['pc_field_split_type','schur'],\
+-	['fieldsplit_0_pc_type','hypre'],['fieldsplit_0_ksp_type','gmres'],['fieldsplit_0_pc_hypre_type','boomerang'],\
+-	['fieldsplit_1_pc_type','jacobi'],['fieldsplit_1_ksp_type','preonly'],['issm_option_solver','stokes']]
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/iluasmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/iluasmoptions.py	(revision 12929)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/solvers/iluasmoptions.py	(revision 12930)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def iluasmoptions(*args):
+-	#ILUASMOPTIONS - return MUMPS direct solver  petsc options
+-	#
+-	#   Usage:
+-	#      options=iluasmoptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['mat_type','aij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','ilu'],['pc_asm_overlap',5],['ksp_max_it',100],['ksp_rtol',1e-15]];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
Index: /issm/oecreview/Archive/12678-13393/ISSM-12930-12931.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12930-12931.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12930-12931.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 12930)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 12931)
+@@ -40,6 +40,8 @@
+ 		case SurfaceAverageVelMisfitEnum:SurfaceAverageVelMisfitx( responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+ 		case ThicknessAbsMisfitEnum:     ThicknessAbsMisfitx(      responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+ 		case ThicknessAbsGradientEnum:   ThicknessAbsGradientx(    responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
++		case ThicknessAlongGradientEnum:   ThicknessAlongGradientx(    responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
++		case ThicknessAcrossGradientEnum:   ThicknessAcrossGradientx(    responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+ 		case TotalSmbEnum:					TotalSmbx(                responses, elements,nodes, vertices, loads, materials, parameters,process_units); break;
+ 		case RheologyBbarAbsGradientEnum:RheologyBbarAbsGradientx( responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+ 		case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
Index: /issm/oecreview/Archive/12678-13393/ISSM-12931-12932.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12931-12932.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12931-12932.diff	(revision 13394)
@@ -0,0 +1,38 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.py	(revision 12931)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.py	(revision 12932)
+@@ -13,10 +13,10 @@
+ 	iluasm={}
+ 
+ 	#default iluasm options
+-	iluasm['mat_type']=options.getfieldvalue("mat_type'",'aij')
+-	iluasm['ksp_type']=options.getfieldvalue("ksp_type'",'gmres')
+-	iluasm['pc_type']=options.getfieldvalue("pc_type'",'asm')
+-	iluasm['sub_pc_type']=options.getfieldvalue("sub_pc_type'",'ilu')
++	iluasm['mat_type']=options.getfieldvalue('mat_type','aij')
++	iluasm['ksp_type']=options.getfieldvalue('ksp_type','gmres')
++	iluasm['pc_type']=options.getfieldvalue('pc_type','asm')
++	iluasm['sub_pc_type']=options.getfieldvalue('sub_pc_type','ilu')
+ 	iluasm['pc_asm_overlap']=options.getfieldvalue('pc_asm_overlap',5)
+ 	iluasm['ksp_max_it']=options.getfieldvalue('ksp_max_it',100)
+ 	iluasm['ksp_rtol']=options.getfieldvalue('ksp_rtol',1e-15)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.m	(revision 12931)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.m	(revision 12932)
+@@ -9,10 +9,10 @@
+ iluasm=struct();
+ 
+ %default iluasm options
+-iluasm.mat_type=getfieldvalue(options,'mat_type''','aij');
+-iluasm.ksp_type=getfieldvalue(options,'ksp_type''','gmres');
+-iluasm.pc_type=getfieldvalue(options,'pc_type''','asm');
+-iluasm.sub_pc_type=getfieldvalue(options,'sub_pc_type''','ilu');
++iluasm.mat_type=getfieldvalue(options,'mat_type','aij');
++iluasm.ksp_type=getfieldvalue(options,'ksp_type','gmres');
++iluasm.pc_type=getfieldvalue(options,'pc_type','asm');
++iluasm.sub_pc_type=getfieldvalue(options,'sub_pc_type','ilu');
+ iluasm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',5);
+ iluasm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
+ iluasm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-15);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12932-12933.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12932-12933.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12932-12933.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12932)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12933)
+@@ -2016,6 +2016,7 @@
+ 				name==ConvergedEnum || 
+ 				name==QmuVxEnum ||
+ 				name==QmuVyEnum ||
++				name==QmuVzEnum ||
+ 				name==QmuPressureEnum ||
+ 				name==QmuBedEnum ||
+ 				name==QmuThicknessEnum ||
Index: /issm/oecreview/Archive/12678-13393/ISSM-12933-12934.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12933-12934.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12933-12934.diff	(revision 13394)
@@ -0,0 +1,184 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.h	(revision 12933)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.h	(revision 12934)
+@@ -153,7 +153,6 @@
+ 
+ 	/*Intermediary*/
+ 	AdjacentTriangle CloseBoundaryEdge(I2 ,Triangle *, double &,double &) ;
+-	AdjacentTriangle CloseBoundaryEdgeV2(I2 A,Triangle *t, double &a,double &b);
+ 	void  swap(Triangle *t1,short a1,
+ 				Triangle *t2,short a2,
+ 				BamgVertex *s1,BamgVertex *s2,Icoor2 det1,Icoor2 det2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h	(revision 12933)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/macros.h	(revision 12934)
+@@ -19,7 +19,6 @@
+ 	static const short NextVertex[3] = {1,2,0};
+ 	static const short PreviousVertex[3] = {2,0,1};
+ 	const  Icoor1 MaxICoor   = 1073741823; // 2^30-1 =111...111 (29 times one)
+-	const  Icoor2 MaxICoor22 = (Icoor2(2)*Icoor2(MaxICoor)*Icoor2(MaxICoor));
+ }
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp	(revision 12933)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp	(revision 12934)
+@@ -5643,155 +5643,6 @@
+ 		  } 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION CloseBoundaryEdgeV2{{{*/
+-	AdjacentTriangle CloseBoundaryEdgeV2(I2 C,Triangle *t, double &a,double &b) { 
+-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/CloseBoundaryEdgeV2)*/
+-		// walk around the vertex 
+-		// version 2 for remove the probleme if we fill the hole
+-		//int bug=1;
+-		//  Triangle *torigine = t;
+-		// restart:
+-		//   int dir=0;
+-		if (t->link != 0){
+-			_error2_("t->link != 0");
+-		}
+-		// to have a starting edges 
+-		// try the 3 edge bourna-- in case of internal hole 
+-		// and choice  the best 
+-		// 
+-		// the probleme is in case of  the fine and long internal hole
+-		// for exemple neart the training edge of a wing
+-		BamgVertex * s=0,*s1=0, *s0=0;
+-		Icoor2 imax = MaxICoor22;
+-		Icoor2 l0 = imax,l1 = imax;
+-		double dd2 =  imax;// infinity
+-		AdjacentTriangle er; 
+-		int  cas=-2;
+-		for (int j=0;j<3;j++)
+-		  { 
+-			AdjacentTriangle ta=t->FindBoundaryEdge(j);
+-			if  (! (Triangle *) ta) continue;
+-			s0 = ta.EdgeVertex(0);
+-			s1 = ta.EdgeVertex(1);
+-			I2 A = * s0;
+-			I2 B = *ta.EdgeVertex(1);
+-			I2 AB = B-A,AC=C-A,BC=B-C;
+-			Icoor2  ACAC = (AC,AC), BCBC = (BC,BC);
+-			Icoor2  AB2  =   Norme2_2(AB); //  ||AB||^2
+-			Icoor2  ABAC  =   (AB,AC);         //  AB.AC|
+-
+-			double d2;
+-			if ( ABAC < 0 )   // DIST A
+-			  {
+-				if ( (d2=(double) ACAC)  <  dd2) 
+-				  {
+-					er = ta;
+-					l0 = ACAC;
+-					l1 = BCBC;
+-					cas = 0;
+-					s = s0;
+-				  }
+-			  }
+-			else if (ABAC > AB2)  // DIST B
+-			  {
+-				if ( (d2=(double) BCBC)  <  dd2) 
+-				  {
+-					dd2 = d2;
+-					er = Adj(ta); // other direction
+-					l0 = BCBC;
+-					l1 = ACAC;
+-					cas = 1;
+-					s = s1;
+-				  }
+-			  }
+-			else  // DIST AB
+-			  { 
+-
+-				double det_2 =  (double) Det(AB,AC); 
+-				det_2 *= det_2; // square of area*2 of triangle ABC
+-				d2 = det_2/ (double) AB2; // hauteur^2 in C of of triangle ABC      
+-
+-				if (d2 < dd2) 
+-				  {
+-					dd2 = d2;
+-					er = ta;
+-					l0 = (AC,AC);
+-					l1 = (BC,BC);
+-					s = 0;
+-					cas = -1;
+-					b = ((double) ABAC/(double) AB2);
+-					a = 1 - b;
+-				  }
+-			  }
+-		  }
+-		if (cas ==-2){
+-			_error2_("cas==-2");
+-		}
+-		// l1 = ||C s1||  , l0 = ||C s0||
+-		// where s0,s1 are the vertex of the edge er
+-
+-		if ( s) 
+-		  { 
+-			t=er;
+-			AdjacentTriangle edge(er); 
+-
+-			int kkk=0;  
+-			int linkp = t->link == 0;
+-
+-			Triangle * tt=t=edge=Adj(Previous(edge));
+-			do  {  // loop over vertex s
+-				kkk++;
+-				if (edge.EdgeVertex(0)!=s && kkk>=10000){
+-					_error2_("edge.EdgeVertex(0)!=s && kkk>=10000");
+-				}
+-
+-				int link = tt->link == 0;
+-				if ((link + linkp) == 1) 
+-				  { // a boundary edge 
+-					BamgVertex * st = edge.EdgeVertex(1);
+-					I2 I=*st;
+-					Icoor2  ll = Norme2_2 (C-I);
+-					if (ll < l1) {  // the other vertex is neart 
+-						s1=st;
+-						l1=ll;
+-						er = edge;
+-						if(ll<l0) { // change of direction --
+-							s1=s;
+-							l1=l0;
+-							s=st;
+-							l0=ll;
+-							t=tt;
+-							edge=Adj(edge);
+-							link=linkp;
+-							er = edge;
+-						}
+-					}
+-				  }
+-
+-				linkp=link;
+-				edge=Adj(Previous(edge));
+-				tt = edge;
+-			} while (t!=tt);
+-
+-			if (!(Triangle *) er){
+-				_error2_("!(Triangle *) er");
+-			}
+-			I2 A((I2)*er.EdgeVertex(0));
+-			I2 B((I2)*er.EdgeVertex(1));
+-			I2 AB=B-A,AC=C-A,CB=B-C;
+-			double aa =  (double) (AB,AC);
+-			double bb =  (double) (AB,CB);
+-			if (aa<0)       a=1,b=0;
+-			else if(bb<0)   a=0,b=1;
+-			else  
+-			  {
+-				a  = bb/(aa+bb);
+-				b  = aa/(aa+bb);
+-			  }
+-		  }
+-		return er;
+-	} 
+-	/*}}}*/
+ /*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)*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-12934-12935.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12934-12935.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12934-12935.diff	(revision 13394)
@@ -0,0 +1,62 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12934)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12935)
+@@ -5,9 +5,9 @@
+ #Library declaration {{{
+ lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+-#if SHARED
+-#lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
+-#endif
++if SHARED
++lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
++endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+@@ -1005,16 +1005,16 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
+-#if SHARED
+-#libISSM_la_SOURCES = solutions/issm.cpp
+-#libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
+-#
+-#libISSMCore_la_SOURCES  = $(issm_sources)
+-#libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
+-#
+-#libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
+-#endif
++if SHARED
++libISSM_la_SOURCES = solutions/issm.cpp
++libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
+ 
++libISSMCore_la_SOURCES  = $(issm_sources)
++libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
++
++libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++endif
++
+ if MODULES
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12934)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12935)
+@@ -21,13 +21,11 @@
+ AM_SILENT_RULES([yes])           #Do not show compilation command by default
+ AM_PROG_CC_C_O
+ AM_PROG_AR
+-AC_PROG_RANLIB
+ 
+ # To produce shared libraries uncomment LT_INIT. In theory, Libtool can be initialized
+ # even if all linking is static, since, if not shared libraries are to be produce, libtool
+ # will act simply as a wrapper around AR and Ranlib.
+-#
+-#LT_INIT
++LT_INIT
+ 
+ #Run issm_options.m4
+ ISSM_OPTIONS
Index: /issm/oecreview/Archive/12678-13393/ISSM-12937-12938.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12937-12938.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12937-12938.diff	(revision 13394)
@@ -0,0 +1,233 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py	(revision 12937)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py	(revision 12938)
+@@ -1,10 +1,33 @@
+-#module imports
+-from fielddisplay import fielddisplay
++from pairoptions import *
++from MatlabFuncs import *
++from WriteData import *
++from EnumDefinitions import *
+ 
+-class verbose:
+-	#properties
+-	def __init__(self):
+-		# {{{ Properties
++class verbose(object):
++	"""
++	VERBOSE class definition
++
++	   Available verbosity levels:
++	      mprocessor  : model processing 
++	      module      : modules
++	      solution    : solution sequence
++	      solver      : solver info (extensive)
++	      convergence : convergence criteria
++	      control     : control method
++	      qmu         : sensitivity analysis
++
++	   Usage:
++	      verbose=verbose();
++	      verbose=verbose(3);
++	      verbose=verbose('001100');
++	      verbose=verbose('module',True,'solver',False);
++
++	WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
++	         Do not modify these sections. See src/c/shared/Numerics/README for more info
++	"""
++
++	def __init__(self,*args):    # {{{
++		#BEGINFIELDS
+ 		self.mprocessor  = False
+ 		self.module      = False
+ 		self.solution    = False
+@@ -12,16 +35,95 @@
+ 		self.convergence = False
+ 		self.control     = False
+ 		self.qmu         = False
+-		#}}}
+-	def __repr__(obj):
+-		# {{{ Display
+-		string="%s%s%s\n\n"%("class '",obj.__class__.__name__,"'=")
+-		string="%s%s\n"%(string,"   %15s : %s"%("mprocessor",obj.mprocessor))
+-		string="%s%s\n"%(string,"   %15s : %s"%("module",obj.module))
+-		string="%s%s\n"%(string,"   %15s : %s"%("solution",obj.solution))
+-		string="%s%s\n"%(string,"   %15s : %s"%("solver",obj.solver))
+-		string="%s%s\n"%(string,"   %15s : %s"%("convergence",obj.convergence))
+-		string="%s%s\n"%(string,"   %15s : %s"%("control",obj.control))
+-		string="%s%s\n"%(string,"   %15s : %s"%("qmu",obj.qmu))
+-		return string
+-		#}}}
++		#ENDFIELDS
++
++		if not len(args):
++			#Don't do anything
++			pass
++
++		elif len(args) == 1:
++			binary=args[0]
++			if   isinstance(binary,str):
++				if strcmpi(binary,'all'):
++					binary=2**11-1    #all ones
++					self.BinaryToVerbose(binary)
++					self.solver=False    #Do not use by default
++				else:
++					binary=int(binary,2)
++					self.BinaryToVerbose(binary)
++			elif isinstance(binary,(int,float)):
++				self.BinaryToVerbose(int(binary))
++
++		else:
++			#Use options to initialize object
++			self=pairoptions(*args).AssignObjectFields(self)
++
++			#Cast to logicals
++			listproperties=vars(self)
++			for [fieldname,fieldvalue] in listproperties.iteritems():
++				if isinstance(fieldvalue,bool) or isinstance(fieldvalue,(int,float)):
++					setattr(self,fieldname,bool(fieldvalue))
++				else:
++					raise TypeError("verbose supported field values are logicals only (True or False)")
++	# }}}
++
++	def VerboseToBinary(self):    # {{{
++
++		#BEGINVERB2BIN
++		binary=0
++		if self.mprocessor:
++			binary=binary |  1
++		if self.module:
++			binary=binary |  2
++		if self.solution:
++			binary=binary |  4
++		if self.solver:
++			binary=binary |  8
++		if self.convergence:
++			binary=binary | 16
++		if self.control:
++			binary=binary | 32
++		if self.qmu:
++			binary=binary | 64
++		#ENDVERB2BIN
++
++		return binary
++	# }}}
++
++	def BinaryToVerbose(self,binary):    # {{{
++
++		#BEGINBIN2VERB
++		self.mprocessor =bool(binary &  1)
++		self.module     =bool(binary &  2)
++		self.solution   =bool(binary &  4)
++		self.solver     =bool(binary &  8)
++		self.convergence=bool(binary & 16)
++		self.control    =bool(binary & 32)
++		self.qmu        =bool(binary & 64)
++		#ENDBIN2VERB
++	# }}}
++
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		return md
++	# }}}
++
++	def __repr__(self):    # {{{
++			
++		#BEGINDISP
++		s ="class '%s'  = \n" % type(self)
++		s+="   %15s : %s\n" % ('mprocessor',self.mprocessor)
++		s+="   %15s : %s\n" % ('module',self.module)
++		s+="   %15s : %s\n" % ('solution',self.solution)
++		s+="   %15s : %s\n" % ('solver',self.solver)
++		s+="   %15s : %s\n" % ('convergence',self.convergence)
++		s+="   %15s : %s\n" % ('control',self.control)
++		s+="   %15s : %s\n" % ('qmu',self.qmu)
++		#ENDDISP
++
++		return s
++	# }}}
++
++	def marshall(self,fid):    # {{{
++			WriteData(fid,'data',VerboseToBinary(self),'enum',VerboseEnum,'format','Integer')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.m	(revision 12937)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.m	(revision 12938)
+@@ -41,7 +41,7 @@
+ 					%Don't do anything
+ 				case 1,
+ 					binary=varargin{1};
+-					if ischar(binary),
++					if     ischar(binary),
+ 						if strcmpi(binary,'all'),
+ 							binary=2^11-1; %all ones
+ 							verbose=BinaryToVerbose(verbose,binary);
+@@ -50,6 +50,8 @@
+ 							binary=bin2dec(binary);
+ 							verbose=BinaryToVerbose(verbose,binary);
+ 						end
++					elseif isnumeric(binary),
++						verbose=BinaryToVerbose(verbose,binary);
+ 					end 
+ 				otherwise,
+ 					%Use options to initialize object
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 12937)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 12938)
+@@ -31,7 +31,9 @@
+ from radaroverlay import radaroverlay
+ from miscellaneous import miscellaneous
+ from private import private
++from EnumDefinitions import *
+ #}}}
++
+ class model(object):
+ 	#properties
+ 	def __init__(self):
+@@ -50,9 +52,14 @@
+ 		self.rifts            = rifts()
+ 
+ 		self.debug            = debug()
+-		self.verbose          = verbose()
++		self.verbose          = verbose('solution',True,'qmu',True,'control',True)
+ 		self.settings         = settings()
+ 		self.solver           = solver()
++#		need EnumToString for these to work
++#		if ismumps:
++#			md.solver.addoptions(DiagnosticVertAnalysisEnum(),mumpsoptions)
++#		else:
++#			md.solver.addoptions(DiagnosticVertAnalysisEnum(),iluasmoptions)
+ 		self.cluster          = generic()
+ 
+ 		self.balancethickness = balancethickness()
+@@ -69,11 +76,12 @@
+ 		self.inversion        = inversion()
+ 		self.qmu              = qmu()
+ 
+-		self.results          = [];
++		self.results          = {}
+ 		self.radaroverlay     = radaroverlay()
+ 		self.miscellaneous    = miscellaneous()
+ 		self.private          = private()
+ 		#}}}
++
+ 	def __repr__(obj):
+ 		# {{{ Display
+ 
+@@ -110,5 +118,11 @@
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results'"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("radaroverlay","[%s,%s]" % ("1x1",obj.radaroverlay.__class__.__name__),"radar image for plot overlay"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("miscellaneous","[%s,%s]" % ("1x1",obj.miscellaneous.__class__.__name__),"miscellaneous fields"))
+-		return string;
+-		 #}}}
++		return string
++	# }}}
++
++	def checkmessage(self,string):    # {{{
++		print ("model not consistent: %s" % string)
++		self.private.isconsistent=False
++	# }}}
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12938-12939.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12938-12939.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12938-12939.diff	(revision 13394)
@@ -0,0 +1,25 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.m	(revision 12938)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.m	(revision 12939)
+@@ -89,13 +89,13 @@
+ 		function verbose=BinaryToVerbose(verbose,binary) % {{{
+ 
+ 		%BEGINBIN2VERB
+-		if bitand(binary,1), verbose.mprocessor=true; else verbose.mprocessor=false; end
+-		if bitand(binary,2), verbose.module=true; else verbose.module=false; end
+-		if bitand(binary,4), verbose.solution=true; else verbose.solution=false; end
+-		if bitand(binary,8), verbose.solver=true; else verbose.solver=false; end
+-		if bitand(binary,16), verbose.convergence=true; else verbose.convergence=false; end
+-		if bitand(binary,32), verbose.control=true; else verbose.control=false; end
+-		if bitand(binary,64), verbose.qmu=true; else verbose.qmu=false; end
++		verbose.mprocessor =logical(bitand(binary, 1));
++		verbose.module     =logical(bitand(binary, 2));
++		verbose.solution   =logical(bitand(binary, 4));
++		verbose.solver     =logical(bitand(binary, 8));
++		verbose.convergence=logical(bitand(binary,16));
++		verbose.control    =logical(bitand(binary,32));
++		verbose.qmu        =logical(bitand(binary,64));
+ 		%ENDBIN2VERB
+ 
+ 		end
Index: /issm/oecreview/Archive/12678-13393/ISSM-12939-12940.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12939-12940.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12939-12940.diff	(revision 13394)
@@ -0,0 +1,56 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12939)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12940)
+@@ -5,9 +5,9 @@
+ #Library declaration {{{
+ lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+-if SHARED
+-lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
+-endif
++#if SHARED
++#lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
++#endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+@@ -1005,16 +1005,16 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
+-if SHARED
+-libISSM_la_SOURCES = solutions/issm.cpp
+-libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
++#if SHARED
++#libISSM_la_SOURCES = solutions/issm.cpp
++#libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
++#
++#libISSMCore_la_SOURCES  = $(issm_sources)
++#libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
++#
++#libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++#endif
+ 
+-libISSMCore_la_SOURCES  = $(issm_sources)
+-libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
+-
+-libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
+-endif
+-
+ if MODULES
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12939)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12940)
+@@ -25,7 +25,7 @@
+ # To produce shared libraries uncomment LT_INIT. In theory, Libtool can be initialized
+ # even if all linking is static, since, if not shared libraries are to be produce, libtool
+ # will act simply as a wrapper around AR and Ranlib.
+-LT_INIT
++#LT_INIT
+ 
+ #Run issm_options.m4
+ ISSM_OPTIONS
Index: /issm/oecreview/Archive/12678-13393/ISSM-12940-12941.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12940-12941.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12940-12941.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12940)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 12941)
+@@ -21,6 +21,7 @@
+ AM_SILENT_RULES([yes])           #Do not show compilation command by default
+ AM_PROG_CC_C_O
+ AM_PROG_AR
++AC_PROG_RANLIB 
+ 
+ # To produce shared libraries uncomment LT_INIT. In theory, Libtool can be initialized
+ # even if all linking is static, since, if not shared libraries are to be produce, libtool
Index: /issm/oecreview/Archive/12678-13393/ISSM-12941-12942.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12941-12942.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12941-12942.diff	(revision 13394)
@@ -0,0 +1,100 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 12941)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 12942)
+@@ -172,44 +172,48 @@
+ 		AC_MSG_CHECKING(for matlab headers and libraries in $MATLAB_ROOT)
+ 		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
+ 		
+-		dnl OS-dependent variables and checks
+-		case "${host_os}" in
+-			*linux*)
+-				if test "${host_cpu}" = "x86_64";
+-				then
+-					MEXLIB=-L"$MATLAB_ROOT/bin/glnxa64/ -lmex"
+-					MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnxa64/mexFunction.map";
+-				else
+-					MEXLIB=-L"$MATLAB_ROOT/bin/glnx86/ -lmex"
+-					MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
+-				fi
+-				MEXEXT=`$MATLAB_ROOT/bin/mexext`
+-				MEXEXT=".$MEXEXT"
+-			;;
+-			*darwin*)
+-				dnl mex -v gives all the flags for compilation of mex files
+-				dnl if matlab version is 7.9 or more, we must use mexmaci64 (64 bits)
+-				MEXLINK="-O -Wl,-flat_namespace -undefined suppress -arch i386 -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
+-				MEXLIB=" -L$MATLAB_ROOT/bin/maci/ -lmx -lmex -lmat -lstdc++ -largeArrayDims"
+-				if test $MATLAB_MAJOR -ge 7; then 
+-					 if test $MATLAB_MINOR -ge 9; then 
+-						  MEXLINK="-O -Wl,-flat_namespace -undefined suppress -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci64/mexFunction.map"
+-							 MEXLIB=" -L$MATLAB_ROOT/bin/maci64/ -lmx -lmex -lmat -lstdc++"
+-					 fi
+-				fi
+-				MEXEXT=`$MATLAB_ROOT/bin/mexext`
+-				MEXEXT=".$MEXEXT"
+-			;;
+-			*cygwin*) 
+-				if  test $VENDOR = intel-win7-32; then
+-					MEXLIB="-dll -export:mexFunction -LIBPATH:\"$MATLAB_ROOT\extern\lib\win32\microsoft\" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  -NOLOGO -INCREMENTAL:NO -manifest" 
+-				elif  test $VENDOR = intel-win7-64; then
+-					MEXLIB="-dll -export:mexFunction -LIBPATH:\"$MATLAB_ROOT\extern\lib\win64\microsoft\" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  -NOLOGO -INCREMENTAL:NO -manifest" 
+-				fi
+-				MEXEXT=`$MATLAB_ROOT/bin/mexext.bat`
+-				MEXEXT=".$MEXEXT"
+-			;;
+-		esac
++		dnl 4. get MEXLIB MEXLINK and MEXEXT (experimental)
++		MEXLINK=$(mex -v 2>&1 < /dev/null | grep LDFLAGS     | sed -e "s/         LDFLAGS            = //g")
++		MEXLIB=$( mex -v 2>&1 < /dev/null | grep CXXLIBS     | sed -e "s/         CXXLIBS            = //g")
++		MEXEXT=$( mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
++		dnl dnl OS-dependent variables and checks (old stuff)
++		dnl case "${host_os}" in
++		dnl 	*linux*)
++		dnl 		if test "${host_cpu}" = "x86_64";
++		dnl 		then
++		dnl 			MEXLIB="-Wl,-rpath-link,$MATLAB_ROOT/bin/glnxa64 -L$MATLAB_ROOT/bin/glnxa64/ -lmx -lmex -lmat -lm"
++		dnl 			MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnxa64/mexFunction.map";
++		dnl 		else
++		dnl 			MEXLIB=-L"$MATLAB_ROOT/bin/glnx86/ -lmex"
++		dnl 			MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
++		dnl 		fi
++		dnl 		MEXEXT=`$MATLAB_ROOT/bin/mexext`
++		dnl 		MEXEXT=".$MEXEXT"
++		dnl 	;;
++		dnl 	*darwin*)
++		dnl 		dnl mex -v gives all the flags for compilation of mex files
++		dnl 		dnl if matlab version is 7.9 or more, we must use mexmaci64 (64 bits)
++		dnl 		MEXLINK="-O -Wl,-flat_namespace -undefined suppress -arch i386 -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
++		dnl 		MEXLIB=" -L$MATLAB_ROOT/bin/maci/ -lmx -lmex -lmat -lstdc++ -largeArrayDims"
++		dnl 		if test $MATLAB_MAJOR -ge 7; then 
++		dnl 			 if test $MATLAB_MINOR -ge 9; then 
++		dnl 				  MEXLINK="-O -Wl,-flat_namespace -undefined suppress -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci64/mexFunction.map"
++		dnl 					 MEXLIB=" -L$MATLAB_ROOT/bin/maci64/ -lmx -lmex -lmat -lstdc++"
++		dnl 			 fi
++		dnl 		fi
++		dnl 		MEXEXT=`$MATLAB_ROOT/bin/mexext`
++		dnl 		MEXEXT=".$MEXEXT"
++		dnl 	;;
++		dnl 	*cygwin*) 
++		dnl 		if  test $VENDOR = intel-win7-32; then
++		dnl 			MEXLIB="-dll -export:mexFunction -LIBPATH:\"$MATLAB_ROOT\extern\lib\win32\microsoft\" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  -NOLOGO -INCREMENTAL:NO -manifest" 
++		dnl 		elif  test $VENDOR = intel-win7-64; then
++		dnl 			MEXLIB="-dll -export:mexFunction -LIBPATH:\"$MATLAB_ROOT\extern\lib\win64\microsoft\" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  -NOLOGO -INCREMENTAL:NO -manifest" 
++		dnl 		fi
++		dnl 		MEXEXT=`$MATLAB_ROOT/bin/mexext.bat`
++		dnl 		MEXEXT=".$MEXEXT"
++		dnl 	;;
++		dnl esac
+ 	   AC_MSG_RESULT(done)
+ 
+ 		AC_SUBST([MATLABINCL])
+@@ -670,7 +674,7 @@
+ 			if test "$PETSC_MAJOR" = "2" ; then
+ 			PETSCLIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+ 			else
+-			PETSCLIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetsc"
++			PETSCLIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetsc -ldl"
+ 			fi
+ 			;;
+ 			*darwin*)
Index: /issm/oecreview/Archive/12678-13393/ISSM-12942-12943.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12942-12943.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12942-12943.diff	(revision 13394)
@@ -0,0 +1,386 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 12942)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 12943)
+@@ -25,7 +25,7 @@
+ 	#Go through all model fields: check that it is a class and call checkconsistency
+ 	fields=vars(md)
+ 
+-	for field in fields.interkeys():
++	for field in fields.iterkeys():
+ 
+ 		#Some properties do not need to be marshalled
+ 		if field in ['results','radaroverlay','solver','cluster','flaim','private']:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py	(revision 12942)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py	(revision 12943)
+@@ -8,11 +8,11 @@
+ 	WRITEDATA - write model field in binary file
+  
+ 	    Usage:
+-	       WriteData(fid,*args)
++	       WriteData(fid,varargin)
+ 	"""
+ 
+ 	#process options
+-	options=pairoptions(args)
++	options=pairoptions(*args)
+ 
+ 	#Get data properties
+ 	if options.exist('object'):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12942)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12943)
+@@ -16,9 +16,8 @@
+ 	analyses,numanalyses=AnalysisConfiguration(solution)
+ 
+ 	#Go through a model fields, check that it is a class, and call checkconsistency
+-#	fields=vars('model')
+-	fields=dir(md)
+-	for field in fields:
++	fields=vars(md)
++	for field in fields.iterkeys():
+ 
+ 		#Some properties do not need to be checked
+ 		if field in ['results','debug','radaroverlay']:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.py	(revision 12942)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.py	(revision 12943)
+@@ -7,61 +7,67 @@
+ 	"""
+ 	CHECKFIELD - check field consistency
+ 
+-	    Used to check model consistency.
+-	    Available options:
+-	       - NaN: 1 if check that there is no NaN
+-	       - size: [lines cols], NaN for non checked dimensions
+-	       - >:  greater than provided value
+-	       - >=: greater or equal to provided value
+-	       - <:  smallerthan provided value
+-	       - <=: smaller or equal to provided value
+-	       - < vec:  smallerthan provided values on each vertex
+-	       - forcing: 1 if check forcing consistency (size and time)
+-	       - values: cell of strings or vector of acceptable values
+-	       - numel: list of acceptable number of elements
+-	       - cell: 1 if check that is cell
+-	       - empty: 1 if check that non empty
+-	       - message: overloaded error message
++	   Used to check model consistency.
++	   Available options:
++	      - NaN: 1 if check that there is no NaN
++	      - size: [lines cols], NaN for non checked dimensions
++	      - >:  greater than provided value
++	      - >=: greater or equal to provided value
++	      - <:  smallerthan provided value
++	      - <=: smaller or equal to provided value
++	      - < vec:  smallerthan provided values on each vertex
++	      - forcing: 1 if check forcing consistency (size and time)
++	      - values: cell of strings or vector of acceptable values
++	      - numel: list of acceptable number of elements
++	      - cell: 1 if check that is cell
++	      - empty: 1 if check that non empty
++	      - message: overloaded error message
+ 
+-	    Usage:
+-	       md = checkfield(md,fieldname,options);
++	   Usage:
++	      md = checkfield(md,fieldname,options);
+ 
+-	    Example:
+-	       md = checkfield(md,'mesh.elementonbed','size',[md.mesh.numberofelements 1],'values',[0 1]);
+-	       md = checkfield(md,'diagnostic.icefront','size',[NaN 4],'NaN',1);
+-	       md = checkfield(md,'diagnostic.icefront(:,end)','values',[0 1 2]);
++	   Example:
++	      md = checkfield(md,'mesh.elementonbed','size',[md.mesh.numberofelements 1],'values',[0 1]);
++	      md = checkfield(md,'diagnostic.icefront','size',[NaN 4],'NaN',1);
++	      md = checkfield(md,'diagnostic.icefront(:,end)','values',[0 1 2]);
+ 	"""
+ 
+ 	#get options
+ 	options=pairoptions(*args)
+ 
+ 	#get field from model
+-	field=getattr(md,fieldname)
++#	field=getattr(md,fieldname)
++	exec("field=md.%s" % fieldname)
+ 
+ 	#check empty
+-	if 'empty' in options:
++	if options.exist('empty'):
+ 		if not field:
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' is empty" % fieldname))
+ 
+ 	#Check size
+-	if 'size' in options:
++	if options.exist('size'):
+ 		fieldsize=options.getfieldvalue('size')
+-		if   numpy.isnan(fieldsize[0]):
+-			if not numpy.size(field,1)==fieldsize[1]:
++		if   len(fieldsize) == 1:
++			if (not numpy.size(field,0)==fieldsize[0]):
+ 				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' should have %d columns" % (fieldname,fieldsize[1])))
+-		elif numpy.isnan(fieldsize[1]):
+-			if not numpy.size(field,0)==fieldsize[0]:
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' should have %d lines" % (fieldname,fieldsize[0])))
+-		else:
+-			if (not numpy.size(field,0)==fieldsize[0]) or (not numpy.size(field,1)==fieldsize[1]):
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' size should be %d x %d" % (fieldname,fieldsize[0],fieldsize[1])))
++					"field '%s' size should be %d" % (fieldname,fieldsize[0])))
++		elif len(fieldsize) == 2:
++			if   numpy.isnan(fieldsize[0]):
++				if not numpy.size(field,1)==fieldsize[1]:
++					md = md.checkmessage(options.getfieldvalue('message',\
++						"field '%s' should have %d columns" % (fieldname,fieldsize[1])))
++			elif numpy.isnan(fieldsize[1]):
++				if not numpy.size(field,0)==fieldsize[0]:
++					md = md.checkmessage(options.getfieldvalue('message',\
++						"field '%s' should have %d lines" % (fieldname,fieldsize[0])))
++			else:
++				if (not numpy.size(field,0)==fieldsize[0]) or (not numpy.size(field,1)==fieldsize[1]):
++					md = md.checkmessage(options.getfieldvalue('message',\
++						"field '%s' size should be %d x %d" % (fieldname,fieldsize[0],fieldsize[1])))
+ 	
+ 	#Check numel
+-	if 'numel' in options:
++	if options.exist('numel'):
+ 		fieldnumel=options.getfieldvalue('numel')
+ 		if not numpy.size(field) in fieldnumel:
+ 			if   len(fieldnumel)==1:
+@@ -87,7 +93,7 @@
+ 				"field '%s' should be a cell" % fieldname))
+ 
+ 	#check values
+-	if 'values' in options:
++	if options.exist('values'):
+ 		fieldvalues=options.getfieldvalue('values')
+ 		if False in ismember(field,fieldvalues):
+ 			if   len(fieldvalues)==1:
+@@ -101,24 +107,24 @@
+ 					"field '%s' should have values in %s" % (fieldname,fieldvalues)))
+ 
+ 	#check greater
+-	if '>=' in options:
++	if options.exist('>='):
+ 		lowerbound=options.getfieldvalue('>=')
+ 		if numpy.any(field<lowerbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values above %d" % (fieldname,lowerbound)))
+-	if '>' in options:
++	if options.exist('>'):
+ 		lowerbound=options.getfieldvalue('>')
+ 		if numpy.any(field<=lowerbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values above %d" % (fieldname,lowerbound)))
+ 
+ 	#check smaller
+-	if '<=' in options:
++	if options.exist('<='):
+ 		upperbound=options.getfieldvalue('<=')
+ 		if numpy.any(field>upperbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values below %d" % (fieldname,upperbound)))
+-	if '<' in options:
++	if options.exist('<'):
+ 		upperbound=options.getfieldvalue('<')
+ 		if numpy.any(field>=upperbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py	(revision 12942)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py	(revision 12943)
+@@ -1,5 +1,9 @@
+ #module imports
++import numpy
+ from fielddisplay import fielddisplay
++from checkfield import *
++from EnumDefinitions import *
++from MatlabFuncs import *
+ 
+ class mesh:
+ 	#properties
+@@ -64,12 +68,7 @@
+ 			string="%s\n%s" %(string,"Elements and vertices of the extruded 3d mesh:")
+ 		else:
+ 			string="\n%s"%("      Elements and vertices:")
+-
+ 		string="%s\n%s"%(string,fielddisplay(obj,"numberofelements","number of elements"))
+-		
+-
+-
+-
+ 		string="%s\n%s"%(string,fielddisplay(obj,"numberofvertices","number of vertices"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"elements","index into (x,y,z), coordinates of the vertices"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"x","vertices x coordinate"))
+@@ -79,7 +78,6 @@
+ 		string="%s\n%s"%(string,fielddisplay(obj,"numberofedges","number of edges of the 2d mesh"))
+ 
+ 		string="%s%s"%(string,"\n      Properties:")
+-		
+ 		string="%s\n%s"%(string,fielddisplay(obj,"dimension","mesh dimension (2d or 3d)"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"numberoflayers","number of extrusion layers"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"vertexonbed","lower vertices flags list"))
+@@ -91,7 +89,6 @@
+ 		string="%s\n%s"%(string,fielddisplay(obj,"lowervertex","lower vertex list (NaN for vertex on the lower surface)"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"lowerelements","lower element list (NaN for element on the lower layer"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"vertexonboundary","vertices on the boundary of the domain flag list"))
+-		
+ 		string="%s\n%s"%(string,fielddisplay(obj,"segments","edges on domain boundary (vertex1 vertex2 element)"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"segmentmarkers","number associated to each segment"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"vertexconnectivity","list of vertices connected to vertex_i"))
+@@ -99,7 +96,6 @@
+ 		string="%s\n%s"%(string,fielddisplay(obj,"average_vertex_connectivity","average number of vertices connected to one vertex"))
+ 
+ 		string="%s%s"%(string,"\n      Extracted model:")
+-
+ 		string="%s\n%s"%(string,fielddisplay(obj,"extractedvertices","vertices extracted from the model"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"extractedelements","elements extracted from the model"))
+ 
+@@ -113,7 +109,7 @@
+ 	def setdefaultparameters(obj):
+ 		# {{{setdefaultparameters
+ 		
+-		#the connectivity is the avergaded number of nodes linked to a
++		#the connectivity is the averaged number of nodes linked to a
+ 		#given node through an edge. This connectivity is used to initially
+ 		#allocate memory to the stiffness matrix. A value of 16 seems to
+ 		#give a good memory/time ration. This value can be checked in
+@@ -123,3 +119,76 @@
+ 		return obj
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		md = checkfield(md,'mesh.x','NaN',1,'size',[md.mesh.numberofvertices])
++		md = checkfield(md,'mesh.y','NaN',1,'size',[md.mesh.numberofvertices])
++		md = checkfield(md,'mesh.z','NaN',1,'size',[md.mesh.numberofvertices])
++		md = checkfield(md,'mesh.elements','NaN',1,'>',0,'values',range(1,md.mesh.numberofvertices+1))
++		if md.mesh.dimension==2:
++			md = checkfield(md,'mesh.elements','size',[md.mesh.numberofelements,3])
++		else:
++			md = checkfield(md,'mesh.elements','size',[md.mesh.numberofelements,6])
++		if any(numpy.logical_not(ismember(range(1,md.mesh.numberofvertices+1),md.mesh.elements))):
++			md = checkmessage(md,"orphan nodes have been found. Check the mesh outline")
++		md = checkfield(md,'mesh.dimension','values',[2,3])
++		md = checkfield(md,'mesh.numberoflayers','>=',0)
++		md = checkfield(md,'mesh.numberofelements','>',0)
++		md = checkfield(md,'mesh.numberofvertices','>',0)
++		#no checks for numberofedges lat long and hemisphere
++		md = checkfield(md,'mesh.elementonbed','size',[md.mesh.numberofelements],'values',[0,1])
++		md = checkfield(md,'mesh.elementonsurface','size',[md.mesh.numberofelements],'values',[0,1])
++		md = checkfield(md,'mesh.vertexonbed','size',[md.mesh.numberofvertices],'values',[0,1])
++		md = checkfield(md,'mesh.vertexonsurface','size',[md.mesh.numberofvertices],'values',[0,1])
++		if md.mesh.dimension==2:
++			md = checkfield(md,'mesh.average_vertex_connectivity','>=',9,'message',"'mesh.average_vertex_connectivity' should be at least 9 in 2d")
++		else:
++			md = checkfield(md,'mesh.average_vertex_connectivity','>=',24,'message',"'mesh.average_vertex_connectivity' should be at least 24 in 3d")
++		md = checkfield(md,'mesh.elementconnectivity','size',[md.mesh.numberofelements,3],'NaN',1)
++
++		#Solution specific checks
++		if   solution==PrognosticSolutionEnum:
++			if md.prognostic.stabilization==3:
++				md = checkfield(md,'mesh.dimension','values',2,'message',"Discontinuous Galerkin only supported for 2d meshes")
++				md = checkfield(md,'mesh.edges','size',[float('NaN'),4])
++				md = checkfield(md,'mesh.edges[:,1:3]','>',0)
++		elif solution==BalancethicknessSolutionEnum:
++			if md.balancethickness.stabilization==3:
++				md = checkfield(md,'mesh.dimension','values',2,'message',"Discontinuous Galerkin only supported for 2d meshes")
++				md = checkfield(md,'mesh.edges','size',[float('NaN'),4])
++				md = checkfield(md,'mesh.edges[:,1:3]','>',0)
++		elif solution==TransientSolutionEnum:
++			if md.transient.isprognostic and md.prognostic.stabilization==3:
++				md = checkfield(md,'mesh.dimension','values',2,'message',"Discontinuous Galerkin only supported for 2d meshes")
++				md = checkfield(md,'mesh.edges','size',[float('NaN'),4])
++				md = checkfield(md,'mesh.edges[:,1:3]','>',0)
++		elif solution==ThermalSolutionEnum:
++			md = checkfield(md,'mesh.dimension','values',3,'message','thermal solution only supported on 3d meshes')
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','x','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','y','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','z','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','elements','format','DoubleMat','mattype',2)
++		WriteData(fid,'object',self,'fieldname','dimension','format','Integer')
++		WriteData(fid,'object',self,'fieldname','numberoflayers','format','Integer')
++		WriteData(fid,'object',self,'fieldname','numberofelements','format','Integer')
++		WriteData(fid,'object',self,'fieldname','numberofvertices','format','Integer')
++		WriteData(fid,'object',self,'fieldname','numberofedges','format','Integer')
++		WriteData(fid,'object',self,'fieldname','elementonbed','format','BooleanMat','mattype',2)
++		WriteData(fid,'object',self,'fieldname','elementonsurface','format','BooleanMat','mattype',2)
++		WriteData(fid,'object',self,'fieldname','vertexonbed','format','BooleanMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','vertexonsurface','format','BooleanMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','lowerelements','format','DoubleMat','mattype',2)
++		WriteData(fid,'object',self,'fieldname','upperelements','format','DoubleMat','mattype',2)
++		WriteData(fid,'object',self,'fieldname','edges','format','DoubleMat','mattype',3)
++		WriteData(fid,'object',self,'fieldname','elementconnectivity','format','DoubleMat','mattype',3)
++		WriteData(fid,'object',self,'fieldname','average_vertex_connectivity','format','Integer')
++		WriteData(fid,'object',self,'fieldname','elements2d','format','DoubleMat','mattype',3)
++		WriteData(fid,'object',self,'fieldname','numberofvertices2d','format','Integer')
++		WriteData(fid,'object',self,'fieldname','numberofelements2d','format','Integer')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m	(revision 12942)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m	(revision 12943)
+@@ -56,7 +56,7 @@
+ 		end % }}}
+ 		function obj = setdefaultparameters(obj) % {{{
+ 
+-			%the connectivity is the avergaded number of nodes linked to a
++			%the connectivity is the averaged number of nodes linked to a
+ 			%given node through an edge. This connectivity is used to initially
+ 			%allocate memory to the stiffness matrix. A value of 16 seems to
+ 			%give a good memory/time ration. This value can be checked in
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.m	(revision 12942)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.m	(revision 12943)
+@@ -30,7 +30,7 @@
+ 
+ 			fielddisplay(obj,'isconsistent','is model self consistent');
+ 			fielddisplay(obj,'runtimename','name of the run launched');
+-			fielddisplay(obj,'bamg','structure with mesh properties construced if bamg is used to mesh the domain');
++			fielddisplay(obj,'bamg','structure with mesh properties constructed if bamg is used to mesh the domain');
+ 			fielddisplay(obj,'solution','type of solution launched');
+ 
+ 		end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py	(revision 12942)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py	(revision 12943)
+@@ -5,9 +5,10 @@
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+-		self.runtimename = ''
+-		self.bamg        = {}
+-		self.solution    = '';
++		self.isconsistent = True;
++		self.runtimename  = ''
++		self.bamg         = {}
++		self.solution     = '';
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+@@ -16,8 +17,10 @@
+ 	def __repr__(obj):
+ 		# {{{ Display
+ 		string='   private parameters: do not change'
++
++		string="%s\n%s"%(string,fielddisplay(obj,'isconsistent','is model self consistent'))
+ 		string="%s\n%s"%(string,fielddisplay(obj,'runtimename','name of the run launched'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'bamg','structure with mesh properties construced if bamg is used to mesh the domain'))
++		string="%s\n%s"%(string,fielddisplay(obj,'bamg','structure with mesh properties constructed if bamg is used to mesh the domain'))
+ 		string="%s\n%s"%(string,fielddisplay(obj,'solution','type of solution launched'))
+ 		return string
+ 		#}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-12943-12944.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12943-12944.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12943-12944.diff	(revision 13394)
@@ -0,0 +1,549 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12944)
+@@ -10,27 +10,27 @@
+ 	"""
+ 	SOLVE - apply solution sequence for this model
+  
+-	    Usage:
+-	       md=solve(md,solutionenum,varargin)
+-	       where varargin is a list of paired arguments of string OR enums
++	   Usage:
++	      md=solve(md,solutionenum,varargin)
++	      where varargin is a list of paired arguments of string OR enums
+  
+-	    solution types available comprise:
+-	 		 - DiagnosticSolutionEnum
+-	 		 - PrognosticSolutionEnum
+-	 		 - ThermalSolutionEnum
+-	 		 - SteadystateSolutionEnum
+-	 		 - TransientSolutionEnum...
+-	 		 - BalancethicknessSolutionEnum
+-	 		 - BedSlopeSolutionEnum
+-	 		 - SurfaceSlopeSolutionEnum
+-	 		 - HydrologySolutionEnum
+-	 		 - FlaimSolutionEnum
++	   solution types available comprise:
++		  - DiagnosticSolutionEnum
++	 	  - PrognosticSolutionEnum
++	 	  - ThermalSolutionEnum
++	 	  - SteadystateSolutionEnum
++	 	  - TransientSolutionEnum...
++	 	  - BalancethicknessSolutionEnum
++	 	  - BedSlopeSolutionEnum
++	 	  - SurfaceSlopeSolutionEnum
++	 	  - HydrologySolutionEnum
++	 	  - FlaimSolutionEnum
+  
+ 	   extra options:
+-	       - loadonly : does not solve. only load results
++	      - loadonly : does not solve. only load results
+  
+-	    Examples:
+-	       md=solve(md,DiagnosticSolutionEnum);
++	   Examples:
++	      md=solve(md,DiagnosticSolutionEnum);
+ 	"""
+ 
+ 	#recover and process solve options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py	(revision 12944)
+@@ -5,10 +5,10 @@
+ 	"""
+ 	DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
+  
+-	    Usage:
+-	       options=process_solve_options(options)
++	   Usage:
++	      options=process_solve_options(options)
+  
+-	    See also: SOLVE
++	   See also: SOLVE
+ 	"""
+ 
+ 	outoptions={}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 12944)
+@@ -4,11 +4,11 @@
+ 	"""
+ 	MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
+ 
+-	    The routine creates a compatible binary file from @model md
+-	    This binary file will be used for parallel runs in JPL-package
++	   The routine creates a compatible binary file from @model md
++	   This binary file will be used for parallel runs in JPL-package
+ 
+-	    Usage:
+-	       marshall(md)
++	   Usage:
++	      marshall(md)
+ 	"""
+ 
+ 	print "marshalling file '%s.bin'." % md.miscellaneous.name
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.py	(revision 12944)
+@@ -4,8 +4,8 @@
+ 	"""
+ 	ANALYSISCONFIGURATION - return type of analyses, number of analyses 
+ 
+-	    Usage:
+-	       [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
++	   Usage:
++	      [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
+ 	"""
+ 
+ 	if   solutiontype == DiagnosticSolutionEnum:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py	(revision 12944)
+@@ -2,8 +2,8 @@
+ 	"""
+ 	PROCESSPATCH - create a structure from a patch
+  
+-	    Usage:
+-	       Result=ProcessPatch(Result);
++	   Usage:
++	      Result=ProcessPatch(Result);
+ 	"""
+ 
+ 	#loop over steps
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.py	(revision 12944)
+@@ -8,22 +8,22 @@
+ 	"""
+ 	SETELEMENTSTYPE - associate a solution type to each element
+ 
+-	    This routine works like plotmodel: it works with an even number of inputs
+-	    'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
+-	    that must be followed by the corresponding exp file or flags list
+-	    It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+-	    If user wants every element outside the domain to be 
+-	    setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
+-	    an empty string '' will be considered as an empty domain
+-	    a string 'all' will be considered as the entire domain
+-	    You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
++	   This routine works like plotmodel: it works with an even number of inputs
++	   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
++	   that must be followed by the corresponding exp file or flags list
++	   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
++	   If user wants every element outside the domain to be 
++	   setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
++	   an empty string '' will be considered as an empty domain
++	   a string 'all' will be considered as the entire domain
++	   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
+ 
+-	    Usage:
+-	       md=setflowequation(md,varargin)
++	   Usage:
++	      md=setflowequation(md,varargin)
+ 
+-	    Example:
+-	       md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
+-	       md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
++	   Example:
++	      md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
++	      md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
+ 	"""
+ 
+ 	#some checks on list of arguments
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py	(revision 12944)
+@@ -4,8 +4,8 @@
+ 	"""
+ 	LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
+  
+-	    Usage:
+-	       md=loadresultsfromdisk(md=False,filename=False);
++	   Usage:
++	      md=loadresultsfromdisk(md=False,filename=False);
+ 	"""
+ 
+ 	#check number of inputs/outputs
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.py	(revision 12944)
+@@ -7,11 +7,11 @@
+ 	"""
+ 	WAITONLOCK - wait for a file
+  
+-	    This routine will return when a file named 'filename' is written to disk.
+-	    If the time limit given in input is exceeded, return 0
++	   This routine will return when a file named 'filename' is written to disk.
++	   If the time limit given in input is exceeded, return 0
+  
+-	    Usage:
+-	       flag=waitonlock(md,executionpath)
++	   Usage:
++	      flag=waitonlock(md,executionpath)
+ 	"""
+ 
+ 	#Get filename (lock file) and options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.py	(revision 12944)
+@@ -5,10 +5,10 @@
+ 	"""
+ 	RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
+ 
+-	    This routine is called by setelementstype, do not use
++	   This routine is called by setelementstype, do not use
+ 
+-	    Usage:
+-	       [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
++	   Usage:
++	      [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+ 	"""
+ 
+ 	#go through varargin, extract options and plug them into subtype options, by order of appearance
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py	(revision 12944)
+@@ -7,8 +7,8 @@
+ 	"""
+ 	WRITEDATA - write model field in binary file
+  
+-	    Usage:
+-	       WriteData(fid,varargin)
++	   Usage:
++	      WriteData(fid,varargin)
+ 	"""
+ 
+ 	#process options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py	(revision 12944)
+@@ -7,8 +7,8 @@
+ 	"""
+ 	LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
+  
+-	    Usage:
+-	       md=loadresultsfromcluster(md,runtimename);
++	   Usage:
++	      md=loadresultsfromcluster(md,runtimename);
+ 	"""
+ 
+ 	#retrieve cluster, to be able to call its methods
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.py	(revision 12944)
+@@ -5,16 +5,16 @@
+ def parameterize(md,parametername):
+ 	"""
+ 	PARAMETERIZE - parameterize a model
+-	 
+-	    from a parameter python file, start filling in all the model fields that were not 
+-	    filled in by the mesh.py and mask.py model methods.
+-	    Warning: the parameter file must be able to be run in Python
+-	 
+-	    Usage:
+-	       md=parameterize(md,parametername)
+-	 
+-	    Example:
+-	       md=parameterize(md,'Square.par');
++
++	   from a parameter python file, start filling in all the model fields that were not 
++	   filled in by the mesh.py and mask.py model methods.
++	   Warning: the parameter file must be able to be run in Python
++
++	   Usage:
++	      md=parameterize(md,parametername)
++
++	   Example:
++	      md=parameterize(md,'Square.par');
+ 	"""
+ 
+ 	#some checks
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.py	(revision 12944)
+@@ -6,9 +6,9 @@
+ def parseresultsfromdisk(filename,iosplit):
+ 	"""
+ 	PARSERESULTSFROMDISK - ...
+-	 
+-	    Usage:
+-	       results=parseresultsfromdisk(filename,iosplit)
++
++	   Usage:
++	      results=parseresultsfromdisk(filename,iosplit)
+ 	"""
+ 
+ 	if iosplit:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.py	(revision 12944)
+@@ -1,12 +1,12 @@
+ def addnote(md,string):
+ 	"""
+ 	ADDNOTE - add a note to the existing model notes field
+-	 
+-	    Usage:
+-	       md=addnote(md,string);
+-	 
+-	    Example:
+-	       md=addnote(md,'Pine Island, Geometry of 2007');
++
++	   Usage:
++	      md=addnote(md,string);
++
++	   Example:
++	      md=addnote(md,'Pine Island, Geometry of 2007');
+ 	"""
+ 
+ 	if not isinstance(string,str):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 12944)
+@@ -4,8 +4,8 @@
+ 	"""
+ 	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+ 
+-	    Usage:
+-	       ismodelselfconsistent(md),
++	   Usage:
++	      ismodelselfconsistent(md),
+ 	"""
+ 
+ 	#initialize consistency as true
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py	(revision 12944)
+@@ -6,8 +6,8 @@
+ 	"""
+ 	PETSCVERSION - recover petsc version number, inside config.h file
+  
+-	    Usage:
+-	        PETSC_VERSION=petscversion();
++	   Usage:
++	      PETSC_VERSION=petscversion();
+ 	"""
+ 
+ 	#default
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py	(revision 12944)
+@@ -9,9 +9,7 @@
+ 	"""
+ 	SCPIN get packages from host, using scp on unix, and pscp on windows
+  
+-	    usage: scpin(host,packages,path)
+- 
+- 
++	   usage: scpin(host,packages,path)
+ 	"""
+ 
+ 	#first get hostname
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py	(revision 12944)
+@@ -9,9 +9,7 @@
+ 	"""
+ 	SCPOUT send packages to a host, using scp on unix, and pscp on windows
+  
+-	    usage: scpout(host,path,packages)
+- 
+- 
++	   usage: scpout(host,path,packages)
+ 	"""
+ 
+ 	#get hostname
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py	(revision 12944)
+@@ -8,8 +8,8 @@
+ 	"""
+ 	ISSMSSH - wrapper for OS independent ssh command.
+  
+-	    usage: 
+-	       issmssh(host,command)
++	   usage: 
++	      issmssh(host,command)
+ 	"""
+ 
+ 	#first get hostname 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12944)
+@@ -6,8 +6,8 @@
+ 	"""
+ 	ISPETSC - figure out if PETSC package was compiled with ISSM
+  
+-	    Usage:
+-	        flag=ispetsc();
++	   Usage:
++	      flag=ispetsc();
+ 	"""
+ 
+ 	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py	(revision 12944)
+@@ -6,8 +6,8 @@
+ 	"""
+ 	ISMUMPS - figure out if MUMPS package was compiled with ISSM
+  
+-	    Usage:
+-	        flag=ismumps();
++	   Usage:
++	      flag=ismumps();
+ 	"""
+ 
+ 	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.py	(revision 12944)
+@@ -3,8 +3,8 @@
+ 	"""
+ 	PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
+  
+-	    Usage: 
+-	       i1,i2=parallelrange(rank,numprocs,globalsize)
++	   Usage: 
++	      i1,i2=parallelrange(rank,numprocs,globalsize)
+ 	"""
+ 
+ 	#We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.py	(revision 12944)
+@@ -4,19 +4,19 @@
+ def SetIceShelfBC(md,icefrontfile=''):
+ 	"""
+ 	SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
+-	 
+-	    Neumann BC are used on the ice front (an ANRGUS contour around the ice front
+-	    must be given in input)
+-	    Dirichlet BC are used elsewhere for diagnostic
+-	 
+-	    Usage:
+-	       md=SetIceShelfBC(md,varargin)
+-	 
+-	    Example:
+-	       md=SetIceShelfBC(md);
+-	       md=SetIceShelfBC(md,'Front.exp');
+-	 
+-	    See also: SETICESHEETBC, SETMARINEICESHEETBC
++
++	   Neumann BC are used on the ice front (an ANRGUS contour around the ice front
++	   must be given in input)
++	   Dirichlet BC are used elsewhere for diagnostic
++
++	   Usage:
++	      md=SetIceShelfBC(md,varargin)
++
++	   Example:
++	      md=SetIceShelfBC(md);
++	      md=SetIceShelfBC(md,'Front.exp');
++
++	   See also: SETICESHEETBC, SETMARINEICESHEETBC
+ 	"""
+ 
+ 	#node on Dirichlet (boundary and ~icefront)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.py	(revision 12944)
+@@ -8,17 +8,17 @@
+ 	"""
+ 	FLAGELEMENTS - flag the elements in an region
+ 
+-	    The region can be given with an exp file, a list of elements.
++	   The region can be given with an exp file, a list of elements.
+ 
+-	    Usage: 
+-	       flag=FlagElements(md,region);
++	   Usage: 
++	      flag=FlagElements(md,region);
+ 
+-	    Example:
+-	       flag=FlagElements(md,'all');
+-	       flag=FlagElements(md,'');
+-	       flag=FlagElements(md,'Domain.exp');
+-	       flag=FlagElements(md,'~Domain.exp');
+-	       flag=FlagElements(md,md.mask.elementongroundedice);
++	   Example:
++	      flag=FlagElements(md,'all');
++	      flag=FlagElements(md,'');
++	      flag=FlagElements(md,'Domain.exp');
++	      flag=FlagElements(md,'~Domain.exp');
++	      flag=FlagElements(md,md.mask.elementongroundedice);
+ 	"""
+ 
+ 	if   isinstance(region,str):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py	(revision 12944)
+@@ -6,8 +6,8 @@
+ 	"""
+ 	ISSMDIR - Get ISSM_DIR environment variable
+  
+-	    Usage:
+-	       ISSM_DIR=issmdir()
++	   Usage:
++	      ISSM_DIR=issmdir()
+ 	"""
+ 
+ 	if not 'Windows' in platform.system():
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12944)
+@@ -13,9 +13,9 @@
+ 	"""
+ 	GENERIC cluster class definition
+  
+-	    Usage:
+-	       cluster=generic('name','astrid','np',3);
+-	       cluster=generic('name',oshostname(),'np',3,'login','username');
++	   Usage:
++	      cluster=generic('name','astrid','np',3);
++	      cluster=generic('name',oshostname(),'np',3,'login','username');
+ 	"""
+ 
+ 	def __init__(self,*args):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py	(revision 12943)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py	(revision 12944)
+@@ -4,9 +4,9 @@
+ 	"""
+ 	PAIROPTIONS class definition
+  
+-	    Usage:
+-	       pairoptions=pairoptions();
+-	       pairoptions=pairoptions('module',true,'solver',false);
++	   Usage:
++	      pairoptions=pairoptions();
++	      pairoptions=pairoptions('module',true,'solver',false);
+ 	"""
+ 
+ 	def __init__(self,*arg):
Index: /issm/oecreview/Archive/12678-13393/ISSM-12944-12945.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12944-12945.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12944-12945.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.m	(revision 12944)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.m	(revision 12945)
+@@ -72,7 +72,7 @@
+ 			md = checkfield(md,'diagnostic.spcvx','forcing',1);
+ 			md = checkfield(md,'diagnostic.spcvy','forcing',1);
+ 			if md.mesh.dimension==3, md = checkfield(md,'diagnostic.spcvz','forcing',1); end
+-			md = checkfield(md,'diagnostic.restol','size',[1 1],'>',0);
++			md = checkfield(md,'diagnostic.restol','size',[1 1],'>',0,'NaN',1);
+ 			md = checkfield(md,'diagnostic.reltol','size',[1 1]);
+ 			md = checkfield(md,'diagnostic.abstol','size',[1 1]);
+ 			md = checkfield(md,'diagnostic.isnewton','numel',1,'values',[0 1]);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12948-12949.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12948-12949.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12948-12949.diff	(revision 13394)
@@ -0,0 +1,781 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 12949)
+@@ -15,16 +15,16 @@
+ 	      where varargin is a list of paired arguments of string OR enums
+  
+ 	   solution types available comprise:
+-		  - DiagnosticSolutionEnum
+-	 	  - PrognosticSolutionEnum
+-	 	  - ThermalSolutionEnum
+-	 	  - SteadystateSolutionEnum
+-	 	  - TransientSolutionEnum...
+-	 	  - BalancethicknessSolutionEnum
+-	 	  - BedSlopeSolutionEnum
+-	 	  - SurfaceSlopeSolutionEnum
+-	 	  - HydrologySolutionEnum
+-	 	  - FlaimSolutionEnum
++	      - DiagnosticSolutionEnum
++	      - PrognosticSolutionEnum
++	      - ThermalSolutionEnum
++	      - SteadystateSolutionEnum
++	      - TransientSolutionEnum...
++	      - BalancethicknessSolutionEnum
++	      - BedSlopeSolutionEnum
++	      - SurfaceSlopeSolutionEnum
++	      - HydrologySolutionEnum
++	      - FlaimSolutionEnum
+  
+ 	   extra options:
+ 	      - loadonly : does not solve. only load results
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m	(revision 12949)
+@@ -34,11 +34,11 @@
+ 
+ %Flag the elements that have not been flagged as filltype
+ if strcmpi(filltype,'hutter'),
+-	hutterflag(find(~macayealflag & ~pattynflag))=1;
++	hutterflag(find(~(macayealflag | pattynflag)))=1;
+ elseif strcmpi(filltype,'macayeal'),
+-	macayealflag(find(~hutterflag & ~pattynflag & ~stokesflag))=1;
++	macayealflag(find(~(hutterflag | pattynflag | ~stokesflag)))=1;
+ elseif strcmpi(filltype,'pattyn'),
+-	pattynflag(find(~hutterflag & ~macayealflag & ~stokesflag))=1;
++	pattynflag(find(~(hutterflag | ~macayealflag | ~stokesflag)))=1;
+ end
+ 
+ %check that each element has at least one flag
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.m	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.m	(revision 12949)
+@@ -28,7 +28,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 			if ismember(DiagnosticHorizAnalysisEnum,analyses)
+-				if ~isnan(md.initialization.vx) & ~isnan(md.initialization.vy),
++				if ~(isnan(md.initialization.vx) | isnan(md.initialization.vy)),
+ 					md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 					md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 				end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py	(revision 12949)
+@@ -1,5 +1,8 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class surfaceforcings:
+ 	#properties
+@@ -7,6 +10,22 @@
+ 		# {{{ Properties
+ 		self.precipitation = float('NaN')
+ 		self.mass_balance  = float('NaN')
++		self.ispdd = 0
++		self.issmbgradients = 0
++		self.isdelta18o = 0
++		self.hc = float('NaN')
++		self.smb_pos_max = float('NaN')
++		self.smb_pos_min = float('NaN')
++		self.a_pos = float('NaN')
++		self.b_pos = float('NaN')
++		self.a_neg = float('NaN')
++		self.b_neg = float('NaN')
++		self.monthlytemperatures = float('NaN')
++		self.delta18o = float('NaN')
++		self.delta18o_surface = float('NaN')
++		self.temperatures_presentday = float('NaN')
++		self.temperatures_lgm = float('NaN')
++		self.precipitations_presentday = float('NaN')
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+@@ -18,12 +37,96 @@
+ 
+ 		string="%s\n\n%s"%(string,fielddisplay(obj,'precipitation','surface precipitation [m/yr water eq]'))
+ 		string="%s\n%s"%(string,fielddisplay(obj,'mass_balance','surface mass balance [m/yr ice eq]'))
++		string="%s\n%s"%(string,fielddisplay(obj,'ispdd','is pdd activated (0 or 1, default is 0)'))
++		string="%s\n%s"%(string,fielddisplay(obj,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'))
++		string="%s\n%s"%(string,fielddisplay(obj,'monthlytemperatures','monthly surface temperatures [Kelvin], required if pdd is activated and delta18o not activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'precipitation','surface precipitation [m/yr water eq]'))
++		string="%s\n%s"%(string,fielddisplay(obj,'temperatures_presentday','monthly present day surface temperatures [Kelvin], required if pdd is activated and delta18o activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'temperatures_lgm','monthly LGM surface temperatures [Kelvin], required if pdd is activated and delta18o activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'delta18o','delta18o, required if pdd is activated and delta18o activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'issmbgradients','is smb gradients method activated (0 or 1, default is 0)'))
++		string="%s\n%s"%(string,fielddisplay(obj,'hc',' elevation of intersection between accumulation and ablation regime required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'smb_pos_max',' maximum value of positive smb required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'smb_pos_min',' minimum value of positive smb required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'a_pos',' intercept of hs - smb regression line for accumulation regime required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'b_pos',' slope of hs - smb regression line for accumulation regime required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'a_neg',' intercept of hs - smb regression line for ablation regime required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(obj,'b_neg',' slope of hs - smb regression line for ablation regime required if smb gradients is activated'))
+ 
+ 		return string
+ 		#}}}
+ 		
+ 	def setdefaultparameters(obj):
+ 		# {{{setdefaultparameters
++		  
++		#pdd method not used in default mode
++		obj.ispdd=0
++		obj.issmbgradients=0
++		obj.isdelta18o=0
++
+ 		return obj
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		if PrognosticAnalysisEnum in analyses:
++			md = checkfield(md,'surfaceforcings.ispdd','numel',1,'values',[0,1])
++			md = checkfield(md,'surfaceforcings.issmbgradients','numel',1,'values',[0,1])
++			if   self.ispdd:
++				if not self.isdelta18o:
++					md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1)
++					md = checkfield(md,'surfaceforcings.precipitation','forcing',1,'NaN',1)
++				else:
++					md = checkfield(md,'surfaceforcings.delta18o','NaN',1)
++					md = checkfield(md,'surfaceforcings.delta18o_surface','NaN',1)
++					md = checkfield(md,'surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1)
++					md = checkfield(md,'surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1)
++					md = checkfield(md,'surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1)
++			elif self.issmbgradients:
++				md = checkfield(md,'surfaceforcings.hc','forcing',1,'NaN',1)
++				md = checkfield(md,'surfaceforcings.smb_pos_max','forcing',1,'NaN',1)
++				md = checkfield(md,'surfaceforcings.smb_pos_min','forcing',1,'NaN',1)
++				md = checkfield(md,'surfaceforcings.a_pos','forcing',1,'NaN',1)
++				md = checkfield(md,'surfaceforcings.b_pos','forcing',1,'NaN',1)
++				md = checkfield(md,'surfaceforcings.a_neg','forcing',1,'NaN',1)
++				md = checkfield(md,'surfaceforcings.b_neg','forcing',1,'NaN',1)
++			else:
++				md = checkfield(md,'surfaceforcings.mass_balance','forcing',1,'NaN',1)
++
++		if BalancethicknessAnalysisEnum in analyses:
++			md = checkfield(md,'surfaceforcings.mass_balance','size',[md.mesh.numberofvertices],'NaN',1)
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','precipitation','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','mass_balance','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','ispdd','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','isdelta18o','format','Boolean')
++
++		if self.ispdd:
++			if self.isdelta18o:
++				WriteData(fid,'object',self,'fieldname','temperatures_presentday','format','DoubleMat','mattype',1)
++				WriteData(fid,'object',self,'fieldname','temperatures_lgm','format','DoubleMat','mattype',1)
++				WriteData(fid,'object',self,'fieldname','precipitations_presentday','format','DoubleMat','mattype',1)
++				WriteData(fid,'object',self,'fieldname','delta18o_surface','format','DoubleMat','mattype',1)
++				WriteData(fid,'object',self,'fieldname','delta18o','format','DoubleMat','mattype',1)
++			else:
++				WriteData(fid,'object',self,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1)
++				WriteData(fid,'object',self,'fieldname','precipitation','format','DoubleMat','mattype',1)
++
++		WriteData(fid,'object',self,'fieldname','issmbgradients','format','Boolean')
++
++		if self.issmbgradients:
++			WriteData(fid,'object',self,'fieldname','hc','format','DoubleMat','mattype',1)
++			WriteData(fid,'object',self,'fieldname','smb_pos_max','format','DoubleMat','mattype',1)
++			WriteData(fid,'object',self,'fieldname','smb_pos_min','format','DoubleMat','mattype',1)
++			WriteData(fid,'object',self,'fieldname','a_pos','format','DoubleMat','mattype',1)
++			WriteData(fid,'object',self,'fieldname','b_pos','format','DoubleMat','mattype',1)
++			WriteData(fid,'object',self,'fieldname','a_neg','format','DoubleMat','mattype',1)
++			WriteData(fid,'object',self,'fieldname','b_neg','format','DoubleMat','mattype',1)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py	(revision 12949)
+@@ -1,8 +1,8 @@
+ #module imports
+ import numpy
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
+ from checkfield import *
+-from EnumDefinitions import *
+ from MatlabFuncs import *
+ 
+ class mesh:
+@@ -130,7 +130,7 @@
+ 		else:
+ 			md = checkfield(md,'mesh.elements','size',[md.mesh.numberofelements,6])
+ 		if any(numpy.logical_not(ismember(range(1,md.mesh.numberofvertices+1),md.mesh.elements))):
+-			md = checkmessage(md,"orphan nodes have been found. Check the mesh outline")
++			md.checkmessage("orphan nodes have been found. Check the mesh outline")
+ 		md = checkfield(md,'mesh.dimension','values',[2,3])
+ 		md = checkfield(md,'mesh.numberoflayers','>=',0)
+ 		md = checkfield(md,'mesh.numberofelements','>',0)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.py	(revision 12949)
+@@ -1,12 +1,16 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class timestepping:
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
++		self.start_time      = 0
++		self.final_time      = 0
+ 		self.time_step       = 0
+-		self.final_time      = 0
+ 		self.time_adapt      = 0
+ 		self.cfl_coefficient = 0
+ 		
+@@ -17,8 +21,9 @@
+ 	def __repr__(obj):
+ 		# {{{ Display
+ 		string="   timestepping parameters:"
+-		string="%s\n\n%s"%(string,fielddisplay(obj,"time_step","length of time steps [yrs]"))
++		string="%s\n\n%s"%(string,fielddisplay(obj,"start_time","simulation starting time [yrs]"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"final_time","final time to stop the simulation [yrs]"))
++		string="%s\n%s"%(string,fielddisplay(obj,"time_step","length of time steps [yrs]"))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"time_adapt","use cfl condition to define time step ? (0 or 1) "))
+ 		string="%s\n%s"%(string,fielddisplay(obj,"cfl_coefficient","coefficient applied to cfl condition"))
+ 		return string
+@@ -39,3 +44,25 @@
+ 
+ 		return obj
+ 	#}}}
++
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		md = checkfield(md,'timestepping.start_time','numel',1,'NaN',1)
++		md = checkfield(md,'timestepping.final_time','numel',1,'NaN',1)
++		md = checkfield(md,'timestepping.time_step','numel',1,'>=',0,'NaN',1)
++		md = checkfield(md,'timestepping.time_adapt','numel',1,'values',[0,1])
++		md = checkfield(md,'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")
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','start_time','format','Double')
++		WriteData(fid,'object',self,'fieldname','final_time','format','Double')
++		WriteData(fid,'object',self,'fieldname','time_step','format','Double')
++		WriteData(fid,'object',self,'fieldname','time_adapt','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','cfl_coefficient','format','Double')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/constants.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/constants.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/constants.py	(revision 12949)
+@@ -1,5 +1,8 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class constants:
+ 	#properties
+@@ -39,3 +42,18 @@
+ 		return obj
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		md = checkfield(md,'constants.g','>',0,'size',[1])
++		md = checkfield(md,'constants.yts','>',0,'size',[1])
++		md = checkfield(md,'constants.referencetemperature','size',[1])
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','g','format','Double')
++		WriteData(fid,'object',self,'fieldname','yts','format','Double')
++		WriteData(fid,'object',self,'fieldname','referencetemperature','format','Double')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py	(revision 12949)
+@@ -1,5 +1,8 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class friction:
+ 	#properties
+@@ -27,3 +30,22 @@
+ 		return obj
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		#Early return
++		if not DiagnosticHorizAnalysisEnum in analyses and not ThermalAnalysisEnum in analyses:
++			return md
++
++		md = checkfield(md,'friction.coefficient','NaN',1,'size',[md.mesh.numberofvertices])
++		md = checkfield(md,'friction.q','NaN',1,'size',[md.mesh.numberofelements])
++		md = checkfield(md,'friction.p','NaN',1,'size',[md.mesh.numberofelements])
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','p','format','DoubleMat','mattype',2)
++		WriteData(fid,'object',self,'fieldname','q','format','DoubleMat','mattype',2)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 12949)
+@@ -1,23 +1,26 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class materials:
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+-		self.rho_ice                    = 0;
+-		self.rho_water                  = 0;
+-		self.mu_water                   = 0;
+-		self.heatcapacity               = 0;
+-		self.latentheat                 = 0;
+-		self.thermalconductivity        = 0;
+-		self.meltingpoint               = 0;
+-		self.beta                       = 0;
+-		self.mixed_layer_capacity       = 0;
+-		self.thermal_exchange_velocity  = 0;
++		self.rho_ice                    = 0
++		self.rho_water                  = 0
++		self.mu_water                   = 0
++		self.heatcapacity               = 0
++		self.latentheat                 = 0
++		self.thermalconductivity        = 0
++		self.meltingpoint               = 0
++		self.beta                       = 0
++		self.mixed_layer_capacity       = 0
++		self.thermal_exchange_velocity  = 0
+ 		self.rheology_B   = float('NaN')
+ 		self.rheology_n   = float('NaN')
+-		self.rheology_law = "";
++		self.rheology_law = ""
+ 
+ 		self.setdefaultparameters()
+ 		#}}}
+@@ -78,3 +81,32 @@
+ 		obj.rheology_law='Paterson'
+ 		return obj
+ 		#}}}
++
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		md = checkfield(md,'materials.rho_ice','>',0)
++		md = checkfield(md,'materials.rho_water','>',0)
++		md = checkfield(md,'materials.rho_freshwater','>',0)
++		md = checkfield(md,'materials.mu_water','>',0)
++		md = checkfield(md,'materials.rheology_B','>',0,'size',[md.mesh.numberofvertices])
++		md = checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
++		md = checkfield(md,'materials.rheology_law','values',['None','Paterson','Arrhenius'])
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','rho_ice','format','Double')
++		WriteData(fid,'object',self,'fieldname','rho_water','format','Double')
++		WriteData(fid,'object',self,'fieldname','rho_freshwater','format','Double')
++		WriteData(fid,'object',self,'fieldname','mu_water','format','Double')
++		WriteData(fid,'object',self,'fieldname','heatcapacity','format','Double')
++		WriteData(fid,'object',self,'fieldname','latentheat','format','Double')
++		WriteData(fid,'object',self,'fieldname','thermalconductivity','format','Double')
++		WriteData(fid,'object',self,'fieldname','meltingpoint','format','Double')
++		WriteData(fid,'object',self,'fieldname','beta','format','Double')
++		WriteData(fid,'object',self,'fieldname','mixed_layer_capacity','format','Double')
++		WriteData(fid,'object',self,'fieldname','thermal_exchange_velocity','format','Double')
++		WriteData(fid,'object',self,'fieldname','rheology_B','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','rheology_n','format','DoubleMat','mattype',2)
++		WriteData(fid,'data',StringToEnum(self.rheology_law),'enum',MaterialsRheologyLawEnum,'format','Integer')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py	(revision 12949)
+@@ -1,5 +1,9 @@
+ #module imports
++import numpy
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class initialization:
+ 	#properties
+@@ -40,3 +44,41 @@
+ 		return obj
+ 	#}}}
+ 
++	def checkconsistency(obj,md,solution,analyses):    # {{{
++		if DiagnosticHorizAnalysisEnum in analyses:
++			if not any(numpy.isnan(md.initialization.vx) or numpy.isnan(md.initialization.vy)):
++				md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
++				md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices])
++		if PrognosticAnalysisEnum in analyses:
++			md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
++			md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices])
++		if HydrologyAnalysisEnum in analyses:
++			md = checkfield(md,'initialization.watercolumn','NaN',1,'size',[md.mesh.numberofvertices])
++		if BalancethicknessAnalysisEnum in analyses:
++			md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
++			md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices])
++			#Triangle with zero velocity
++			if any(numpy.logical_and(numpy.sum(numpy.abs(md.initialization.vx[md.mesh.elements.astype(int)-1]),axis=1)==0,\
++			                         numpy.sum(numpy.abs(md.initialization.vy[md.mesh.elements.astype(int)-1]),axis=1)==0)):
++				md.checkmessage("at least one triangle has all its vertices with a zero velocity")
++		if ThermalAnalysisEnum in analyses:
++			md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
++			md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices])
++			md = checkfield(md,'initialization.vz','NaN',1,'size',[md.mesh.numberofvertices])
++			md = checkfield(md,'initialization.pressure','NaN',1,'size',[md.mesh.numberofvertices])
++		if (EnthalpyAnalysisEnum in analyses and md.thermal.isenthalpy) or solution==EnthalpySolutionEnum:
++			md = checkfield(md,'initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices])
++
++		return md
++	# }}}
++
++	def marshall(obj,fid):    # {{{
++		WriteData(fid,'data',obj.vx,'format','DoubleMat','mattype',1,'enum',VxEnum)
++		WriteData(fid,'data',obj.vy,'format','DoubleMat','mattype',1,'enum',VyEnum)
++		WriteData(fid,'data',obj.vz,'format','DoubleMat','mattype',1,'enum',VzEnum)
++		WriteData(fid,'data',obj.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum)
++		WriteData(fid,'data',obj.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum)
++		WriteData(fid,'data',obj.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum)
++		WriteData(fid,'data',obj.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mask.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mask.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mask.py	(revision 12949)
+@@ -1,5 +1,8 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class mask:
+ 	#properties
+@@ -34,3 +37,24 @@
+ 		return obj
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		md = checkfield(md,'mask.elementonfloatingice','size',[md.mesh.numberofelements],'values',[0,1])
++		md = checkfield(md,'mask.elementongroundedice','size',[md.mesh.numberofelements],'values',[0,1])
++		md = checkfield(md,'mask.elementonwater'      ,'size',[md.mesh.numberofelements],'values',[0,1])
++		md = checkfield(md,'mask.vertexonfloatingice' ,'size',[md.mesh.numberofvertices],'values',[0,1])
++		md = checkfield(md,'mask.vertexongroundedice' ,'size',[md.mesh.numberofvertices],'values',[0,1])
++		md = checkfield(md,'mask.vertexonwater'       ,'size',[md.mesh.numberofvertices],'values',[0,1])
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','elementonfloatingice','format','BooleanMat','mattype',2)
++		WriteData(fid,'object',self,'fieldname','elementongroundedice','format','BooleanMat','mattype',2)
++		WriteData(fid,'object',self,'fieldname','elementonwater','format','BooleanMat','mattype',2)
++		WriteData(fid,'object',self,'fieldname','vertexonfloatingice','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','vertexongroundedice','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','vertexonwater','format','DoubleMat','mattype',1)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m	(revision 12949)
+@@ -10,7 +10,7 @@
+ 		ispdd = 0;
+ 		issmbgradients = 0;
+ 		isdelta18o = 0;
+-	   hc = NaN;
++		hc = NaN;
+ 		smb_pos_max = NaN;
+ 		smb_pos_min = NaN;
+ 		a_pos = NaN;
+@@ -45,26 +45,26 @@
+ 
+ 			if ismember(PrognosticAnalysisEnum,analyses),
+ 				md = checkfield(md,'surfaceforcings.ispdd','numel',1,'values',[0 1]);
+-				checkfield(md,'surfaceforcings.issmbgradients','numel',1,'values',[0 1]);
++				md = checkfield(md,'surfaceforcings.issmbgradients','numel',1,'values',[0 1]);
+ 				if(obj.ispdd)
+-				        if(obj.isdelta18o==0)
+-				        	md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1);
+-				        	md = checkfield(md,'surfaceforcings.precipitation','forcing',1,'NaN',1);
+-			                else
+-				                md = checkfield(md,'surfaceforcings.delta18o','NaN',1);
+-				        	md = checkfield(md,'surfaceforcings.delta18o_surface','NaN',1);
+-				        	md = checkfield(md,'surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1);
+-				        	md = checkfield(md,'surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1);
+-				        	md = checkfield(md,'surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1);
+-				        end
++					if(obj.isdelta18o==0)
++						md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1);
++						md = checkfield(md,'surfaceforcings.precipitation','forcing',1,'NaN',1);
++					else
++						md = checkfield(md,'surfaceforcings.delta18o','NaN',1);
++						md = checkfield(md,'surfaceforcings.delta18o_surface','NaN',1);
++						md = checkfield(md,'surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1);
++						md = checkfield(md,'surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1);
++						md = checkfield(md,'surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1);
++					end
+ 				elseif(obj.issmbgradients)
+-					checkfield(md,'surfaceforcings.hc','forcing',1,'NaN',1);
+-					checkfield(md,'surfaceforcings.smb_pos_max','forcing',1,'NaN',1);
+-					checkfield(md,'surfaceforcings.smb_pos_min','forcing',1,'NaN',1);
+-					checkfield(md,'surfaceforcings.a_pos','forcing',1,'NaN',1);
+-					checkfield(md,'surfaceforcings.b_pos','forcing',1,'NaN',1);
+-					checkfield(md,'surfaceforcings.a_neg','forcing',1,'NaN',1);
+-					checkfield(md,'surfaceforcings.b_neg','forcing',1,'NaN',1);
++					md = checkfield(md,'surfaceforcings.hc','forcing',1,'NaN',1);
++					md = checkfield(md,'surfaceforcings.smb_pos_max','forcing',1,'NaN',1);
++					md = checkfield(md,'surfaceforcings.smb_pos_min','forcing',1,'NaN',1);
++					md = checkfield(md,'surfaceforcings.a_pos','forcing',1,'NaN',1);
++					md = checkfield(md,'surfaceforcings.b_pos','forcing',1,'NaN',1);
++					md = checkfield(md,'surfaceforcings.a_neg','forcing',1,'NaN',1);
++					md = checkfield(md,'surfaceforcings.b_neg','forcing',1,'NaN',1);
+ 				else
+ 					md = checkfield(md,'surfaceforcings.mass_balance','forcing',1,'NaN',1);
+ 				end
+@@ -102,16 +102,16 @@
+ 			WriteData(fid,'object',obj,'fieldname','ispdd','format','Boolean');
+ 			WriteData(fid,'object',obj,'fieldname','isdelta18o','format','Boolean');
+ 			if obj.ispdd,
+-			  if obj.isdelta18o
+-			        WriteData(fid,'object',obj,'fieldname','temperatures_presentday','format','DoubleMat','mattype',1);
+-			        WriteData(fid,'object',obj,'fieldname','temperatures_lgm','format','DoubleMat','mattype',1);
+-			        WriteData(fid,'object',obj,'fieldname','precipitations_presentday','format','DoubleMat','mattype',1);
+-			        WriteData(fid,'object',obj,'fieldname','delta18o_surface','format','DoubleMat','mattype',1);
+-			        WriteData(fid,'object',obj,'fieldname','delta18o','format','DoubleMat','mattype',1);
+-			  else
+-				WriteData(fid,'object',obj,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1);
+-				WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1);
+-			  end
++				if obj.isdelta18o
++					WriteData(fid,'object',obj,'fieldname','temperatures_presentday','format','DoubleMat','mattype',1);
++					WriteData(fid,'object',obj,'fieldname','temperatures_lgm','format','DoubleMat','mattype',1);
++					WriteData(fid,'object',obj,'fieldname','precipitations_presentday','format','DoubleMat','mattype',1);
++					WriteData(fid,'object',obj,'fieldname','delta18o_surface','format','DoubleMat','mattype',1);
++					WriteData(fid,'object',obj,'fieldname','delta18o','format','DoubleMat','mattype',1);
++				else
++					WriteData(fid,'object',obj,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1);
++					WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1);
++				end
+ 			end
+ 			WriteData(fid,'object',obj,'fieldname','issmbgradients','format','Boolean');
+ 			if obj.issmbgradients,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py	(revision 12949)
+@@ -1,5 +1,8 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class geometry:
+ 	#properties
+@@ -33,3 +36,25 @@
+ 		return obj
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		md = checkfield(md,'geometry.surface'  ,'NaN',1,'size',[md.mesh.numberofvertices])
++		md = checkfield(md,'geometry.bed'      ,'NaN',1,'size',[md.mesh.numberofvertices])
++		md = checkfield(md,'geometry.thickness','NaN',1,'size',[md.mesh.numberofvertices],'>',0)
++		if any((self.thickness-self.surface+self.bed)>10**-9):
++			md.checkmessage("equality thickness=surface-bed violated")
++		end 
++		if solution==TransientSolutionEnum and md.transient.isgroundingline:
++			md = checkfield(md,'geometry.bathymetry','NaN',1,'size',[md.mesh.numberofvertices])
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'data',self.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum)
++		WriteData(fid,'data',self.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum)
++		WriteData(fid,'data',self.bed,'format','DoubleMat','mattype',1,'enum',BedEnum)
++		WriteData(fid,'data',self.bathymetry,'format','DoubleMat','mattype',1,'enum',BathymetryEnum)
++		WriteData(fid,'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py	(revision 12949)
+@@ -5,10 +5,10 @@
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+-		self.isconsistent = True;
++		self.isconsistent = True
+ 		self.runtimename  = ''
+ 		self.bamg         = {}
+-		self.solution     = '';
++		self.solution     = ''
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.py	(revision 12949)
+@@ -1,5 +1,8 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class basalforcings:
+ 	#properties
+@@ -27,3 +30,24 @@
+ 		return obj
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		if PrognosticAnalysisEnum in analyses and not (solution==TransientSolutionEnum and not md.transient.isprognostic):
++			md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1)
++
++		if BalancethicknessAnalysisEnum in analyses:
++			md = checkfield(md,'basalforcings.melting_rate','NaN',1,'size',[md.mesh.numberofvertices])
++
++		if ThermalAnalysisEnum in analyses and not (solution==TransientSolutionEnum and not md.transient.isthermal):
++			md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1)
++			md = checkfield(md,'basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0)
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','melting_rate','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','melting_rate_correction','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 12949)
+@@ -1,5 +1,9 @@
+ #module imports
++import numpy
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class flowequation:
+ 	#properties
+@@ -39,3 +43,59 @@
+ 		return obj
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		if DiagnosticHorizAnalysisEnum in analyses:
++			md = checkfield(md,'flowequation.ismacayealpattyn','numel',1,'values',[0,1])
++			md = checkfield(md,'flowequation.ishutter','numel',1,'values',[0,1])
++			md = checkfield(md,'flowequation.isstokes','numel',1,'values',[0,1])
++			md = checkfield(md,'flowequation.bordermacayeal','size',[md.mesh.numberofvertices],'values',[0,1])
++			md = checkfield(md,'flowequation.borderpattyn','size',[md.mesh.numberofvertices],'values',[0,1])
++			md = checkfield(md,'flowequation.borderstokes','size',[md.mesh.numberofvertices],'values',[0,1])
++			if md.mesh.dimension==2:
++				md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',[1,2])
++				md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements],'values',[1,2])
++			else:
++				md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',range(0,7+1))
++				md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements],'values',range(0,7+1))
++			if not (md.flowequation.ismacayealpattyn or md.flowequation.ishutter or md.flowequation.isstokes):
++				md.checkmessage("no element types set for this model. At least one of ismacayealpattyn, ishutter or isstokes need to be =1")
++
++		if DiagnosticHutterAnalysisEnum in analyses:
++			if any(md.flowequation.element_equation==1):
++				if any(numpy.logical_and(md.flowequation.element_equation,md.mask.elementonfloatingice)):
++					print "\n !!! Warning: Hutter's model is not consistent on ice shelves !!!\n"
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','ismacayealpattyn','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','ishutter','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','isstokes','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','bordermacayeal','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','borderpattyn','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','borderstokes','format','DoubleMat','mattype',1)
++		#convert approximations to enums
++		data=self.vertex_equation
++		data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum
++		data[[i for i,item in enumerate(data) if item==1]]=HutterApproximationEnum
++		data[[i for i,item in enumerate(data) if item==2]]=MacAyealApproximationEnum
++		data[[i for i,item in enumerate(data) if item==3]]=PattynApproximationEnum
++		data[[i for i,item in enumerate(data) if item==4]]=StokesApproximationEnum
++		data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum
++		data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum
++		data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum
++		WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum,'format','DoubleMat','mattype',1)
++		data=self.element_equation
++		data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum
++		data[[i for i,item in enumerate(data) if item==1]]=HutterApproximationEnum
++		data[[i for i,item in enumerate(data) if item==2]]=MacAyealApproximationEnum
++		data[[i for i,item in enumerate(data) if item==3]]=PattynApproximationEnum
++		data[[i for i,item in enumerate(data) if item==4]]=StokesApproximationEnum
++		data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum
++		data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum
++		data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum
++		WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum,'format','DoubleMat','mattype',2)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m	(revision 12948)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m	(revision 12949)
+@@ -43,7 +43,7 @@
+ 					md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:7]);
+ 					md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:7]);
+ 				end
+-				if (md.flowequation.ismacayealpattyn==0 && md.flowequation.ishutter==0 && md.flowequation.isstokes==0),
++				if ~(md.flowequation.ismacayealpattyn || md.flowequation.ishutter || md.flowequation.isstokes),
+ 					md = checkmessage(md,['no element types set for this model. At least one of ismacayealpattyn, ishutter or isstokes need to be =1']);
+ 				end
+ 			end
Index: /issm/oecreview/Archive/12678-13393/ISSM-12949-12950.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12949-12950.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12949-12950.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m	(revision 12949)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m	(revision 12950)
+@@ -36,9 +36,9 @@
+ if strcmpi(filltype,'hutter'),
+ 	hutterflag(find(~(macayealflag | pattynflag)))=1;
+ elseif strcmpi(filltype,'macayeal'),
+-	macayealflag(find(~(hutterflag | pattynflag | ~stokesflag)))=1;
++	macayealflag(find(~(hutterflag | pattynflag | stokesflag)))=1;
+ elseif strcmpi(filltype,'pattyn'),
+-	pattynflag(find(~(hutterflag | ~macayealflag | ~stokesflag)))=1;
++	pattynflag(find(~(hutterflag | macayealflag | stokesflag)))=1;
+ end
+ 
+ %check that each element has at least one flag
Index: /issm/oecreview/Archive/12678-13393/ISSM-12950-12951.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12950-12951.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12950-12951.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12950)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12951)
+@@ -26,6 +26,7 @@
+ #MPI
+ MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install"
+ if [ -d "$MPI_DIR" ]; then
++	export MPI_DIR
+ 	export PATH="$MPI_DIR/bin:$PATH"
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MPI_DIR/lib"
+ 	export LD_RUN_PATH="$LD_RUN_PATH:$MPI_DIR/lib"
Index: /issm/oecreview/Archive/12678-13393/ISSM-12951-12952.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12951-12952.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12951-12952.diff	(revision 13394)
@@ -0,0 +1,104 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py	(revision 12951)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py	(revision 12952)
+@@ -41,6 +41,7 @@
+ 
+ 	from parallelrange import parallelrange
+ 	from IdToName import IdToName
++	from MatlabFuncs import *
+ 
+ 	#Get ISSM_DIR variable
+ 	ISSM_DIR=os.environ['ISSM_DIR']
+@@ -48,17 +49,17 @@
+ 
+ 	#Process options
+ 	#GET benchmark {{{1
+-	if not benchmark.lower() in ['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing']:
++	if not ismember(benchmark,['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing']):
+ 		print "runme warning: benchmark '%s' not supported, defaulting to test 'nightly'." % benchmark
+ 		benchmark='nightly'
+ 	# }}}
+ 	#GET procedure {{{1
+-	if not procedure.lower() in ['check','update']:
++	if not ismember(procedure,['check','update']):
+ 		print "runme warning: procedure '%s' not supported, defaulting to test 'check'." % procedure
+ 		procedure='check'
+ 	# }}}
+ 	#GET output {{{1
+-	if not output.lower() in ['nightly','daily','none']:
++	if not ismember(output,['nightly','daily','none']):
+ 		print "runme warning: output '%s' not supported, defaulting to test 'none'." % output
+ 		output='none'
+ 	# }}}
+@@ -106,19 +107,19 @@
+ 	# }}}
+ 
+ 	#Process Ids according to benchmarks {{{1
+-	if   benchmark.lower() == 'nightly':
++	if   strcmpi(benchmark,'nightly'):
+ 		test_ids=test_ids.intersection(set(range(1,1000)))
+-	elif benchmark.lower() == 'ismip':
++	elif strcmpi(benchmark,'ismip'):
+ 		test_ids=test_ids.intersection(set(range(1101,1200)))
+-	elif benchmark.lower() == 'eismint':
++	elif strcmpi(benchmark,'eismint'):
+ 		test_ids=test_ids.intersection(set(range(1201,1300)))
+-	elif benchmark.lower() == 'thermal':
++	elif strcmpi(benchmark,'thermal'):
+ 		test_ids=test_ids.intersection(set(range(1301,1400)))
+-	elif benchmark.lower() == 'mesh':
++	elif strcmpi(benchmark,'mesh'):
+ 		test_ids=test_ids.intersection(set(range(1401,1500)))
+-	elif benchmark.lower() == 'validation':
++	elif strcmpi(benchmark,'validation'):
+ 		test_ids=test_ids.intersection(set(range(1001,2000)))
+-	elif benchmark.lower() == 'tranforcing':
++	elif strcmpi(benchmark,'tranforcing'):
+ 		test_ids=test_ids.intersection(set(range(1501,1503)))
+ #	print 'test_ids after benchmark =',test_ids
+ 	test_ids=list(test_ids)
+@@ -138,9 +139,9 @@
+ 
+ 			#UPDATE ARCHIVE?
+ 			archive_name='Archive'+str(id)
+-			if procedure.lower() == 'update':
++			if strcmpi(procedure,'update'):
+ 
+-				if not socket.gethostname().lower().split('.')[0] == 'larsen':
++				if not strcmp(socket.gethostname().lower().split('.')[0],'larsen'):
+ #					raise RuntimeError("Nightly run archives must be saved on 'larsen' (hostname is '"+socket.gethostname()+"').")
+ 					print "Nightly run archives must be saved on 'larsen' (hostname is '"+socket.gethostname()+"')."
+ #				f = h5py.File(os.path.join('..','Archives',archive_name+'.hdf5'),'w')
+@@ -199,13 +200,13 @@
+ 						#something went wrong, print failure message:
+ 						directory=os.getcwd().split('/')    #  not used?
+ 						message=me2
+-						if   output.lower() == 'nightly':
++						if   strcmpi(output,'nightly'):
+ 							fid=open(os.path.join(ISSM_DIR,'nightlylog','matlaberror.log'), 'a')
+ 							fid.write('%s' % message)
+ 							fid.write('\n------------------------------------------------------------------\n')
+ 							fid.close()
+ 							print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,fieldname)
+-						elif output.lower() == 'daily':
++						elif strcmpi(output,'daily'):
+ 							fid=open(os.path.join(ISSM_DIR,'dailylog','matlaberror.log'), 'a')
+ 							fid.write('%s' % message)
+ 							fid.write('\n------------------------------------------------------------------\n')
+@@ -222,13 +223,13 @@
+ 			#something went wrong, print failure message:
+ 			directory=os.getcwd().split('/')    #  not used?
+ 			message=me
+-			if   output.lower() == 'nightly':
++			if   strcmpi(output,'nightly'):
+ 				fid=open(os.path.join(ISSM_DIR+'nightlylog','matlaberror.log'), 'a')
+ 				fid.write('%s' % message)
+ 				fid.write('\n------------------------------------------------------------------\n')
+ 				fid.close()
+ 				print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,'N/A')
+-			elif output.lower() == 'daily':
++			elif strcmpi(output,'daily'):
+ 				fid=open(os.path.join(ISSM_DIR+'dailylog','matlaberror.log'), 'a')
+ 				fid.write('%s' % message)
+ 				fid.write('\n------------------------------------------------------------------\n')
Index: /issm/oecreview/Archive/12678-13393/ISSM-12952-12953.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12952-12953.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12952-12953.diff	(revision 13394)
@@ -0,0 +1,295 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12952)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12953)
+@@ -410,159 +410,159 @@
+ syn keyword	cType		mxArray ErrorException QuadtreeBox IssmDouble IssmPDouble
+ 
+ "ISSM's objects begin
+-syn keyword cType AdjacentTriangle
+-syn keyword cType BamgGeom
+-syn keyword cType BamgMesh
+-syn keyword cType bamgobjects
+-syn keyword cType BamgOpts
+-syn keyword cType BamgQuadtree
+-syn keyword cType BamgVertex
+-syn keyword cType CrackedEdge
+-syn keyword cType Curve
+-syn keyword cType Direction
+-syn keyword cType DoubleAndInt
+-syn keyword cType Edge
+-syn keyword cType GeomEdge
+-syn keyword cType Geometry
+-syn keyword cType GeomSubDomain
+-syn keyword cType GeomVertex
+-syn keyword cType include
+-syn keyword cType ListofIntersectionTriangles
+-syn keyword cType macros
+-syn keyword cType Mesh
+-syn keyword cType Metric
+-syn keyword cType R2
+-syn keyword cType SetOfE4
+-syn keyword cType SubDomain
+-syn keyword cType Triangle
+-syn keyword cType typedefs
+-syn keyword cType VertexOnEdge
+-syn keyword cType VertexOnGeom
+-syn keyword cType VertexOnVertex
+-syn keyword cType classes
+-syn keyword cType DakotaPlugin
+-syn keyword cType DofIndexing
+-syn keyword cType FemModel
++syn keyword cType GaussPenta
+ syn keyword cType gaussobjects
+-syn keyword cType GaussPenta
+ syn keyword cType GaussTria
+-syn keyword cType Hook
+-syn keyword cType IoModel
+-syn keyword cType ExponentialVariogram
+-syn keyword cType GaussianVariogram
+-syn keyword cType krigingobjects
+-syn keyword cType Observation
+-syn keyword cType PowerVariogram
+-syn keyword cType Quadtree
+-syn keyword cType SphericalVariogram
+-syn keyword cType Variogram
+-syn keyword cType ElementMatrix
+-syn keyword cType ElementVector
+-syn keyword cType Matrix
+-syn keyword cType matrixobjects
+-syn keyword cType Vector
+-syn keyword cType Constraint
+-syn keyword cType SpcDynamic
+-syn keyword cType SpcStatic
+-syn keyword cType SpcTransient
++syn keyword cType objects
++syn keyword cType Material
++syn keyword cType Matice
++syn keyword cType Matpar
++syn keyword cType objects
+ syn keyword cType Contour
+-syn keyword cType BoolElementResult
+-syn keyword cType DoubleElementResult
+-syn keyword cType ElementResult
+-syn keyword cType ElementResultLocal
+-syn keyword cType PentaP1ElementResult
+-syn keyword cType TriaP1ElementResult
+-syn keyword cType Element
+-syn keyword cType Penta
+-syn keyword cType PentaHook
+-syn keyword cType PentaRef
+-syn keyword cType Tria
+-syn keyword cType TriaHook
+-syn keyword cType TriaRef
+-syn keyword cType BoolExternalResult
+-syn keyword cType DoubleExternalResult
+-syn keyword cType DoubleMatExternalResult
+-syn keyword cType DoubleVecExternalResult
+-syn keyword cType ExternalResult
+-syn keyword cType IntExternalResult
+-syn keyword cType PetscVecExternalResult
+-syn keyword cType StringExternalResult
+-syn keyword cType BoolInput
++syn keyword cType DoubleInput
++syn keyword cType Input
+ syn keyword cType ControlInput
+ syn keyword cType DatasetInput
+-syn keyword cType DoubleInput
+-syn keyword cType Input
+ syn keyword cType IntInput
++syn keyword cType BoolInput
++syn keyword cType TriaP1Input
++syn keyword cType TransientInput
+ syn keyword cType PentaP1Input
+-syn keyword cType TransientInput
+-syn keyword cType TriaP1Input
+-syn keyword cType KML_Attribute
+-syn keyword cType KML_ColorStyle
+-syn keyword cType KML_Comment
+-syn keyword cType KML_Container
+-syn keyword cType KML_Document
++syn keyword cType KML_Icon
++syn keyword cType KML_Point
++syn keyword cType KML_LinearRing
+ syn keyword cType KML_Feature
+-syn keyword cType KML_File
+-syn keyword cType KML_Folder
+-syn keyword cType KML_Geometry
+-syn keyword cType KML_GroundOverlay
+-syn keyword cType KML_Icon
++syn keyword cType KMLFileReadUtils
++syn keyword cType KML_StyleSelector
+ syn keyword cType KML_LatLonBox
+-syn keyword cType KML_LinearRing
++syn keyword cType KML_Attribute
++syn keyword cType KML_PolyStyle
++syn keyword cType KML_Object
++syn keyword cType KML_SubStyle
+ syn keyword cType KML_LineString
+-syn keyword cType KML_LineStyle
+-syn keyword cType KML_MultiGeometry
+-syn keyword cType KML_Object
+ syn keyword cType KML_Overlay
++syn keyword cType KML_Container
++syn keyword cType KML_Polygon
++syn keyword cType KML_Geometry
++syn keyword cType KML_ColorStyle
+ syn keyword cType KML_Placemark
+-syn keyword cType KML_Point
+-syn keyword cType KML_Polygon
+-syn keyword cType KML_PolyStyle
++syn keyword cType KML_Unknown
++syn keyword cType KML_GroundOverlay
+ syn keyword cType KML_Style
+-syn keyword cType KML_StyleSelector
+-syn keyword cType KML_SubStyle
+-syn keyword cType KML_Unknown
+-syn keyword cType KMLFileReadUtils
+-syn keyword cType Friction
+-syn keyword cType Icefront
+-syn keyword cType Load
+-syn keyword cType Numericalflux
+-syn keyword cType Pengrid
+-syn keyword cType Penpair
+-syn keyword cType Riftfront
+-syn keyword cType Material
+-syn keyword cType Matice
+-syn keyword cType Matpar
+-syn keyword cType Node
+-syn keyword cType Object
+-syn keyword cType objects
+-syn keyword cType Option
+-syn keyword cType OptionCell
+-syn keyword cType OptionChar
+-syn keyword cType OptionDouble
+-syn keyword cType OptionLogical
+-syn keyword cType OptionStruct
+-syn keyword cType OptionUtilities
+-syn keyword cType BoolParam
++syn keyword cType KML_Comment
++syn keyword cType KML_MultiGeometry
++syn keyword cType KML_LineStyle
++syn keyword cType KML_Folder
++syn keyword cType KML_Document
++syn keyword cType KML_File
++syn keyword cType DoubleVecParam
++syn keyword cType DoubleParam
+ syn keyword cType DoubleMatArrayParam
+ syn keyword cType DoubleMatParam
+-syn keyword cType DoubleParam
+-syn keyword cType DoubleTransientMatParam
+-syn keyword cType DoubleVecParam
++syn keyword cType Param
+ syn keyword cType FileParam
++syn keyword cType IntVecParam
++syn keyword cType IntParam
++syn keyword cType BoolParam
+ syn keyword cType IntMatParam
+-syn keyword cType IntParam
+-syn keyword cType IntVecParam
++syn keyword cType VectorParam
++syn keyword cType DoubleTransientMatParam
+ syn keyword cType MatrixParam
+-syn keyword cType Param
+ syn keyword cType StringArrayParam
+ syn keyword cType StringParam
+ syn keyword cType TransientParam
+-syn keyword cType VectorParam
++syn keyword cType OptionStruct
++syn keyword cType OptionDouble
++syn keyword cType OptionLogical
++syn keyword cType OptionUtilities
++syn keyword cType OptionChar
++syn keyword cType Option
++syn keyword cType OptionCell
+ syn keyword cType Segment
++syn keyword cType Icefront
++syn keyword cType Friction
++syn keyword cType Riftfront
++syn keyword cType Numericalflux
++syn keyword cType Penpair
++syn keyword cType Load
++syn keyword cType Pengrid
++syn keyword cType Object
++syn keyword cType DoubleVecExternalResult
++syn keyword cType DoubleExternalResult
++syn keyword cType IntExternalResult
++syn keyword cType BoolExternalResult
++syn keyword cType DoubleMatExternalResult
++syn keyword cType PetscVecExternalResult
++syn keyword cType ExternalResult
++syn keyword cType StringExternalResult
+ syn keyword cType Vertex
+-syn keyword cType objects
++syn keyword cType SpcDynamic
++syn keyword cType SpcStatic
++syn keyword cType SpcTransient
++syn keyword cType Constraint
++syn keyword cType TriaP1ElementResult
++syn keyword cType PentaP1ElementResult
++syn keyword cType DoubleElementResult
++syn keyword cType ElementResultLocal
++syn keyword cType BoolElementResult
++syn keyword cType ElementResult
++syn keyword cType Node
++syn keyword cType TriaRef
++syn keyword cType TriaHook
++syn keyword cType PentaRef
++syn keyword cType PentaHook
++syn keyword cType Tria
++syn keyword cType Element
++syn keyword cType Penta
++syn keyword cType classes
++syn keyword cType DofIndexing
++syn keyword cType Patch
++syn keyword cType Hook
++syn keyword cType Quadtree
++syn keyword cType Observation
++syn keyword cType ExponentialVariogram
++syn keyword cType GaussianVariogram
++syn keyword cType SphericalVariogram
++syn keyword cType PowerVariogram
++syn keyword cType krigingobjects
++syn keyword cType Variogram
++syn keyword cType DakotaPlugin
++syn keyword cType ElementVector
++syn keyword cType ElementMatrix
++syn keyword cType matrixobjects
++syn keyword cType Vector
++syn keyword cType Matrix
++syn keyword cType GeomSubDomain
++syn keyword cType Geometry
++syn keyword cType AdjacentTriangle
++syn keyword cType VertexOnEdge
++syn keyword cType BamgQuadtree
++syn keyword cType Edge
++syn keyword cType BamgVertex
++syn keyword cType SetOfE4
++syn keyword cType GeomEdge
++syn keyword cType Direction
++syn keyword cType VertexOnGeom
++syn keyword cType R2
++syn keyword cType Mesh
++syn keyword cType ListofIntersectionTriangles
++syn keyword cType Triangle
++syn keyword cType DoubleAndInt
++syn keyword cType VertexOnVertex
++syn keyword cType BamgOpts
++syn keyword cType BamgGeom
++syn keyword cType bamgobjects
++syn keyword cType CrackedEdge
++syn keyword cType SubDomain
++syn keyword cType BamgMesh
++syn keyword cType Metric
++syn keyword cType include
++syn keyword cType typedefs
++syn keyword cType Curve
++syn keyword cType macros
++syn keyword cType GeomVertex
+ syn keyword cType OptArgs
++syn keyword cType Update
+ syn keyword cType OptPars
+-syn keyword cType Patch
+-syn keyword cType Update
++syn keyword cType IoModel
++syn keyword cType FemModel
Index: /issm/oecreview/Archive/12678-13393/ISSM-12953-12954.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12953-12954.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12953-12954.diff	(revision 13394)
@@ -0,0 +1,42 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vimrc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vimrc	(revision 12953)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vimrc	(revision 12954)
+@@ -202,6 +202,8 @@
+ au BufRead,BufNewFile *.m        iab <expr> p0  "disp('-------------- file: ".expand('%')." line: ".line(".")."');"
+ au BufRead,BufNewFile *.c*       iabbr <silent> p1  printf("\n");<Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
+ au BufRead,BufNewFile *.c*,*.h   iabbr <silent> ER  _error_("");<Left><Left><Left><C-R>=Eatchar('\s')<CR>
++au BufRead,BufNewFile *.py       iabbr <silent> ER  raise NameError('')<Left><Left><C-R>=Eatchar('\s')<CR>
++au BufRead,BufNewFile *.m        iabbr <silent> ER  error('');<Left><Left><Left><C-R>=Eatchar('\s')<CR>
+ au BufRead,BufNewFile *.c*       ab VV VecView(ug,PETSC_VIEWER_STDOUT_WORLD);
+ au BufRead,BufNewFile *.c*       ab AS _assert_();
+ au BufRead,BufNewFile *.c*       iab <expr> p0  "printf(\"-------------- file: ".expand('%')." line: %i\\n\",__LINE__);"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh	(revision 12953)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh	(revision 12954)
+@@ -16,5 +16,6 @@
+ echo "\"ISSM's objects begin" >> temp
+ find ../../../../../src/c/classes -name "*.h" | sed -e "s/\// /g" -e "s/\.h//"| awk '{print  $(NF)}' | awk '{ printf "syn keyword cType " $1 "\n"}'>> temp
+ cat c.vim | sed "1,/ISSM's objects end/d" >> temp
++echo "\"ISSM's objects end" >> temp
+ 
+ mv temp c.vim
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12953)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12954)
+@@ -407,7 +407,7 @@
+ "Petsc
+ syn keyword	cType		Vec Mat SeqVec SeqMat
+ "other ISSM's syntax
+-syn keyword	cType		mxArray ErrorException QuadtreeBox IssmDouble IssmPDouble
++syn keyword	cType		mxArray ErrorException QuadtreeBox IssmDouble IssmPDouble Observations
+ 
+ "ISSM's objects begin
+ syn keyword cType GaussPenta
+@@ -566,3 +566,4 @@
+ syn keyword cType OptPars
+ syn keyword cType IoModel
+ syn keyword cType FemModel
++"ISSM's objects end
Index: /issm/oecreview/Archive/12678-13393/ISSM-12954-12955.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12954-12955.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12954-12955.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 12954)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 12955)
+@@ -12,7 +12,7 @@
+ #include "../include/include.h"
+ #include "../solvers/solvers.h"
+ 
+-#if defined (_HAVE_TAO_) && defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ == 2)
++#if defined (_HAVE_TAO_) && defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 1)
+ #include <tao.h>
+ 
+ /*Local prototype*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-12955-12956.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12955-12956.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12955-12956.diff	(revision 13394)
@@ -0,0 +1,493 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh	(revision 12955)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh	(revision 12956)
+@@ -5,17 +5,17 @@
+ #Get all lines of EnumDefinitions.h which hold Enum 
+ cat c.vim | sed "/ISSM's Enums begin/,/vim: ts=8/d" > temp
+ echo "\"ISSM's Enums begin" >> temp
+-cat ../../../../../src/c/EnumDefinitions/EnumDefinitions.h | grep -e "[0-9]Enum," -e "[aA-zZ]Enum," | grep -v StringToEnum | sed -e "s/,//g" | awk '{ printf "syn keyword cConstant " $1 "\n"}' >> temp
++cat ../../../../../src/c/EnumDefinitions/EnumDefinitions.h | grep -e "[0-9]Enum," -e "[a-z]Enum," -e "[A-Z]Enum," | grep -v StringToEnum | sed -e "s/,//g" | awk '{ printf "syn keyword cConstant " $1 "\n"}' >> temp
+ echo "\"ISSM's Enums end" >> temp
+ cat c.vim | sed "1,/ISSM's Enums end/d" >> temp
+-
+ mv temp c.vim
++exit 1
+ 
+ #Synchronize objects
+ cat c.vim | sed "/ISSM's objects begin/,/vim: ts=8/d" > temp
+ echo "\"ISSM's objects begin" >> temp
+ find ../../../../../src/c/classes -name "*.h" | sed -e "s/\// /g" -e "s/\.h//"| awk '{print  $(NF)}' | awk '{ printf "syn keyword cType " $1 "\n"}'>> temp
++echo "\"ISSM's objects end" >> temp
+ cat c.vim | sed "1,/ISSM's objects end/d" >> temp
+-echo "\"ISSM's objects end" >> temp
+ 
+ mv temp c.vim
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12955)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12956)
+@@ -567,3 +567,463 @@
+ syn keyword cType IoModel
+ syn keyword cType FemModel
+ "ISSM's objects end
++"ISSM's Enums begin
++syn keyword cConstant AutodiffForwardEnum
++syn keyword cConstant AutodiffIsautodiffEnum
++syn keyword cConstant AutodiffReverseEnum
++syn keyword cConstant BalancethicknessSpcthicknessEnum
++syn keyword cConstant BalancethicknessStabilizationEnum
++syn keyword cConstant BalancethicknessThickeningRateEnum
++syn keyword cConstant BasalforcingsGeothermalfluxEnum
++syn keyword cConstant BasalforcingsMeltingRateCorrectionEnum
++syn keyword cConstant BasalforcingsMeltingRateEnum
++syn keyword cConstant BathymetryEnum
++syn keyword cConstant BedEnum
++syn keyword cConstant ConstantsGEnum
++syn keyword cConstant ConstantsReferencetemperatureEnum
++syn keyword cConstant ConstantsYtsEnum
++syn keyword cConstant DiagnosticAbstolEnum
++syn keyword cConstant DiagnosticIcefrontEnum
++syn keyword cConstant DiagnosticIsnewtonEnum
++syn keyword cConstant DiagnosticMaxiterEnum
++syn keyword cConstant DiagnosticNumRequestedOutputsEnum
++syn keyword cConstant DiagnosticPenaltyFactorEnum
++syn keyword cConstant DiagnosticReferentialEnum
++syn keyword cConstant DiagnosticReltolEnum
++syn keyword cConstant DiagnosticRequestedOutputsEnum
++syn keyword cConstant DiagnosticRestolEnum
++syn keyword cConstant DiagnosticRiftPenaltyLockEnum
++syn keyword cConstant DiagnosticRiftPenaltyThresholdEnum
++syn keyword cConstant DiagnosticShelfDampeningEnum
++syn keyword cConstant DiagnosticSpcvxEnum
++syn keyword cConstant DiagnosticSpcvyEnum
++syn keyword cConstant DiagnosticSpcvzEnum
++syn keyword cConstant DiagnosticStokesreconditioningEnum
++syn keyword cConstant DiagnosticVertexPairingEnum
++syn keyword cConstant DiagnosticViscosityOvershootEnum
++syn keyword cConstant FlowequationBordermacayealEnum
++syn keyword cConstant FlowequationBorderpattynEnum
++syn keyword cConstant FlowequationBorderstokesEnum
++syn keyword cConstant FlowequationElementEquationEnum
++syn keyword cConstant FlowequationIshutterEnum
++syn keyword cConstant FlowequationIsmacayealpattynEnum
++syn keyword cConstant FlowequationIsstokesEnum
++syn keyword cConstant FlowequationVertexEquationEnum
++syn keyword cConstant FrictionCoefficientEnum
++syn keyword cConstant FrictionPEnum
++syn keyword cConstant FrictionQEnum
++syn keyword cConstant GeometryHydrostaticRatioEnum
++syn keyword cConstant HydrologyCREnum
++syn keyword cConstant HydrologyKnEnum
++syn keyword cConstant HydrologyNEnum
++syn keyword cConstant HydrologyPEnum
++syn keyword cConstant HydrologyQEnum
++syn keyword cConstant HydrologySpcwatercolumnEnum
++syn keyword cConstant HydrologyStabilizationEnum
++syn keyword cConstant InversionControlParametersEnum
++syn keyword cConstant InversionCostFunctionEnum
++syn keyword cConstant InversionCostFunctionThresholdEnum
++syn keyword cConstant InversionCostFunctionsCoefficientsEnum
++syn keyword cConstant InversionCostFunctionsEnum
++syn keyword cConstant InversionGradientOnlyEnum
++syn keyword cConstant InversionGradientScalingEnum
++syn keyword cConstant InversionIscontrolEnum
++syn keyword cConstant InversionTaoEnum
++syn keyword cConstant InversionIncompleteAdjointEnum
++syn keyword cConstant InversionMaxParametersEnum
++syn keyword cConstant InversionMaxiterPerStepEnum
++syn keyword cConstant InversionMinParametersEnum
++syn keyword cConstant InversionNstepsEnum
++syn keyword cConstant InversionNumControlParametersEnum
++syn keyword cConstant InversionNumCostFunctionsEnum
++syn keyword cConstant InversionStepThresholdEnum
++syn keyword cConstant InversionThicknessObsEnum
++syn keyword cConstant InversionVelObsEnum
++syn keyword cConstant InversionVxObsEnum
++syn keyword cConstant InversionVyObsEnum
++syn keyword cConstant InversionVzObsEnum
++syn keyword cConstant MaskElementonfloatingiceEnum
++syn keyword cConstant MaskElementongroundediceEnum
++syn keyword cConstant MaskElementonwaterEnum
++syn keyword cConstant MaskVertexonfloatingiceEnum
++syn keyword cConstant MaskVertexongroundediceEnum
++syn keyword cConstant MaskVertexonwaterEnum
++syn keyword cConstant MaterialsBetaEnum
++syn keyword cConstant MaterialsHeatcapacityEnum
++syn keyword cConstant MaterialsLatentheatEnum
++syn keyword cConstant MaterialsMeltingpointEnum
++syn keyword cConstant MaterialsMixedLayerCapacityEnum
++syn keyword cConstant MaterialsRheologyBEnum
++syn keyword cConstant MaterialsRheologyBbarEnum
++syn keyword cConstant MaterialsRheologyLawEnum
++syn keyword cConstant MaterialsRheologyNEnum
++syn keyword cConstant MaterialsRhoIceEnum
++syn keyword cConstant MaterialsRhoWaterEnum
++syn keyword cConstant MaterialsRhoFreshwaterEnum
++syn keyword cConstant MaterialsMuWaterEnum
++syn keyword cConstant MaterialsThermalExchangeVelocityEnum
++syn keyword cConstant MaterialsThermalconductivityEnum
++syn keyword cConstant MeshAverageVertexConnectivityEnum
++syn keyword cConstant MeshDimensionEnum
++syn keyword cConstant MeshEdgesEnum
++syn keyword cConstant MeshElementconnectivityEnum
++syn keyword cConstant MeshElementonbedEnum
++syn keyword cConstant MeshElementonsurfaceEnum
++syn keyword cConstant MeshElements2dEnum
++syn keyword cConstant MeshElementsEnum
++syn keyword cConstant MeshLowerelementsEnum
++syn keyword cConstant MeshNumberofedgesEnum
++syn keyword cConstant MeshNumberofelements2dEnum
++syn keyword cConstant MeshNumberofelementsEnum
++syn keyword cConstant MeshNumberoflayersEnum
++syn keyword cConstant MeshNumberofvertices2dEnum
++syn keyword cConstant MeshNumberofverticesEnum
++syn keyword cConstant MeshUpperelementsEnum
++syn keyword cConstant MeshVertexonbedEnum
++syn keyword cConstant MeshVertexonsurfaceEnum
++syn keyword cConstant MeshXEnum
++syn keyword cConstant MeshYEnum
++syn keyword cConstant MeshZEnum
++syn keyword cConstant MiscellaneousNameEnum
++syn keyword cConstant PrognosticHydrostaticAdjustmentEnum
++syn keyword cConstant PrognosticMinThicknessEnum
++syn keyword cConstant PrognosticPenaltyFactorEnum
++syn keyword cConstant PrognosticSpcthicknessEnum
++syn keyword cConstant PrognosticStabilizationEnum
++syn keyword cConstant PrognosticVertexPairingEnum
++syn keyword cConstant QmuIsdakotaEnum
++syn keyword cConstant QmuMassFluxSegmentsEnum
++syn keyword cConstant QmuNumberofpartitionsEnum
++syn keyword cConstant QmuNumberofresponsesEnum
++syn keyword cConstant QmuPartitionEnum
++syn keyword cConstant QmuResponsedescriptorsEnum
++syn keyword cConstant QmuVariabledescriptorsEnum
++syn keyword cConstant RiftsNumriftsEnum
++syn keyword cConstant RiftsRiftstructEnum
++syn keyword cConstant SettingsIoGatherEnum
++syn keyword cConstant SettingsLowmemEnum
++syn keyword cConstant SettingsOutputFrequencyEnum
++syn keyword cConstant SettingsResultsAsPatchesEnum
++syn keyword cConstant SettingsWaitonlockEnum
++syn keyword cConstant SurfaceforcingsDelta18oEnum
++syn keyword cConstant SurfaceforcingsDelta18oSurfaceEnum
++syn keyword cConstant SurfaceforcingsIsdelta18oEnum
++syn keyword cConstant SurfaceforcingsPrecipitationsPresentdayEnum
++syn keyword cConstant SurfaceforcingsTemperaturesPresentdayEnum
++syn keyword cConstant SurfaceforcingsTemperaturesLgmEnum
++syn keyword cConstant DebugProfilingEnum
++syn keyword cConstant ProfilingCurrentMemEnum
++syn keyword cConstant ProfilingCurrentFlopsEnum
++syn keyword cConstant ProfilingSolutionTimeEnum
++syn keyword cConstant MaxIterationConvergenceFlagEnum
++syn keyword cConstant SteadystateMaxiterEnum
++syn keyword cConstant SteadystateNumRequestedOutputsEnum
++syn keyword cConstant SteadystateReltolEnum
++syn keyword cConstant SteadystateRequestedOutputsEnum
++syn keyword cConstant SurfaceEnum
++syn keyword cConstant SurfaceforcingsPrecipitationEnum
++syn keyword cConstant SurfaceforcingsMassBalanceEnum
++syn keyword cConstant SurfaceforcingsIspddEnum
++syn keyword cConstant SurfaceforcingsIssmbgradientsEnum
++syn keyword cConstant SurfaceforcingsMonthlytemperaturesEnum
++syn keyword cConstant SurfaceforcingsHcEnum
++syn keyword cConstant SurfaceforcingsSmbPosMaxEnum
++syn keyword cConstant SurfaceforcingsSmbPosMinEnum
++syn keyword cConstant SurfaceforcingsAPosEnum
++syn keyword cConstant SurfaceforcingsBPosEnum
++syn keyword cConstant SurfaceforcingsANegEnum
++syn keyword cConstant SurfaceforcingsBNegEnum
++syn keyword cConstant ThermalMaxiterEnum
++syn keyword cConstant ThermalPenaltyFactorEnum
++syn keyword cConstant ThermalPenaltyLockEnum
++syn keyword cConstant ThermalPenaltyThresholdEnum
++syn keyword cConstant ThermalSpctemperatureEnum
++syn keyword cConstant ThermalStabilizationEnum
++syn keyword cConstant ThermalIsenthalpyEnum
++syn keyword cConstant ThicknessEnum
++syn keyword cConstant TimesteppingStartTimeEnum
++syn keyword cConstant TimesteppingFinalTimeEnum
++syn keyword cConstant TimesteppingCflCoefficientEnum
++syn keyword cConstant TimesteppingTimeAdaptEnum
++syn keyword cConstant TimesteppingTimeStepEnum
++syn keyword cConstant TransientIsdiagnosticEnum
++syn keyword cConstant TransientIsgroundinglineEnum
++syn keyword cConstant TransientIsprognosticEnum
++syn keyword cConstant TransientIsthermalEnum
++syn keyword cConstant TransientNumRequestedOutputsEnum
++syn keyword cConstant TransientRequestedOutputsEnum
++syn keyword cConstant SolutionTypeEnum
++syn keyword cConstant AnalysisTypeEnum
++syn keyword cConstant ConfigurationTypeEnum
++syn keyword cConstant AdjointBalancethicknessAnalysisEnum
++syn keyword cConstant AdjointHorizAnalysisEnum
++syn keyword cConstant AdjointSolutionEnum
++syn keyword cConstant AnalysisCounterEnum
++syn keyword cConstant BalancethicknessAnalysisEnum
++syn keyword cConstant BalancethicknessSolutionEnum
++syn keyword cConstant BedSlopeAnalysisEnum
++syn keyword cConstant BedSlopeSolutionEnum
++syn keyword cConstant BedSlopeXAnalysisEnum
++syn keyword cConstant BedSlopeYAnalysisEnum
++syn keyword cConstant DiagnosticHorizAnalysisEnum
++syn keyword cConstant DiagnosticHutterAnalysisEnum
++syn keyword cConstant DiagnosticSolutionEnum
++syn keyword cConstant DiagnosticVertAnalysisEnum
++syn keyword cConstant EnthalpyAnalysisEnum
++syn keyword cConstant EnthalpySolutionEnum
++syn keyword cConstant FlaimAnalysisEnum
++syn keyword cConstant FlaimSolutionEnum
++syn keyword cConstant HydrologyAnalysisEnum
++syn keyword cConstant HydrologySolutionEnum
++syn keyword cConstant MeltingAnalysisEnum
++syn keyword cConstant NoneAnalysisEnum
++syn keyword cConstant PrognosticAnalysisEnum
++syn keyword cConstant PrognosticSolutionEnum
++syn keyword cConstant SteadystateSolutionEnum
++syn keyword cConstant SurfaceSlopeAnalysisEnum
++syn keyword cConstant SurfaceSlopeSolutionEnum
++syn keyword cConstant SurfaceSlopeXAnalysisEnum
++syn keyword cConstant SurfaceSlopeYAnalysisEnum
++syn keyword cConstant ThermalAnalysisEnum
++syn keyword cConstant ThermalSolutionEnum
++syn keyword cConstant TransientSolutionEnum
++syn keyword cConstant ApproximationEnum
++syn keyword cConstant HutterApproximationEnum
++syn keyword cConstant MacAyealApproximationEnum
++syn keyword cConstant MacAyealPattynApproximationEnum
++syn keyword cConstant MacAyealStokesApproximationEnum
++syn keyword cConstant NoneApproximationEnum
++syn keyword cConstant PattynApproximationEnum
++syn keyword cConstant PattynStokesApproximationEnum
++syn keyword cConstant StokesApproximationEnum
++syn keyword cConstant ConstraintsEnum
++syn keyword cConstant LoadsEnum
++syn keyword cConstant MaterialsEnum
++syn keyword cConstant NodesEnum
++syn keyword cConstant ParametersEnum
++syn keyword cConstant VerticesEnum
++syn keyword cConstant ResultsEnum
++syn keyword cConstant BoolInputEnum
++syn keyword cConstant BoolParamEnum
++syn keyword cConstant ContourEnum
++syn keyword cConstant ControlInputEnum
++syn keyword cConstant DatasetInputEnum
++syn keyword cConstant DofIndexingEnum
++syn keyword cConstant DoubleInputEnum
++syn keyword cConstant DoubleMatArrayParamEnum
++syn keyword cConstant DoubleMatParamEnum
++syn keyword cConstant DoubleParamEnum
++syn keyword cConstant DoubleVecParamEnum
++syn keyword cConstant ElementEnum
++syn keyword cConstant ElementResultEnum
++syn keyword cConstant ExternalResultEnum
++syn keyword cConstant FileParamEnum
++syn keyword cConstant HookEnum
++syn keyword cConstant IcefrontEnum
++syn keyword cConstant InputEnum
++syn keyword cConstant IntInputEnum
++syn keyword cConstant IntParamEnum
++syn keyword cConstant IntVecParamEnum
++syn keyword cConstant TransientParamEnum
++syn keyword cConstant MacAyeal2dIceFrontEnum
++syn keyword cConstant MacAyeal3dIceFrontEnum
++syn keyword cConstant MaticeEnum
++syn keyword cConstant MatparEnum
++syn keyword cConstant NodeEnum
++syn keyword cConstant NumericalfluxEnum
++syn keyword cConstant ParamEnum
++syn keyword cConstant PattynIceFrontEnum
++syn keyword cConstant PengridEnum
++syn keyword cConstant PenpairEnum
++syn keyword cConstant PentaEnum
++syn keyword cConstant PentaP1InputEnum
++syn keyword cConstant MatrixParamEnum
++syn keyword cConstant VectorParamEnum
++syn keyword cConstant RiftfrontEnum
++syn keyword cConstant SegmentEnum
++syn keyword cConstant SegmentRiftfrontEnum
++syn keyword cConstant SpcDynamicEnum
++syn keyword cConstant SpcStaticEnum
++syn keyword cConstant SpcTransientEnum
++syn keyword cConstant StokesIceFrontEnum
++syn keyword cConstant StringArrayParamEnum
++syn keyword cConstant StringParamEnum
++syn keyword cConstant TriaEnum
++syn keyword cConstant TriaP1InputEnum
++syn keyword cConstant VertexEnum
++syn keyword cConstant AirEnum
++syn keyword cConstant IceEnum
++syn keyword cConstant MelangeEnum
++syn keyword cConstant WaterEnum
++syn keyword cConstant ClosedEnum
++syn keyword cConstant FreeEnum
++syn keyword cConstant OpenEnum
++syn keyword cConstant AdjointpEnum
++syn keyword cConstant AdjointxEnum
++syn keyword cConstant AdjointyEnum
++syn keyword cConstant AdjointzEnum
++syn keyword cConstant BedSlopeXEnum
++syn keyword cConstant BedSlopeYEnum
++syn keyword cConstant BoundaryEnum
++syn keyword cConstant ConstantEnum
++syn keyword cConstant ConvergedEnum
++syn keyword cConstant ExtToIuEnum
++syn keyword cConstant FillEnum
++syn keyword cConstant FractionIncrementEnum
++syn keyword cConstant FrictionEnum
++syn keyword cConstant GroundinglineMeltingRateEnum
++syn keyword cConstant InternalEnum
++syn keyword cConstant IuToExtEnum
++syn keyword cConstant MassFluxEnum
++syn keyword cConstant MaxPenetrationEnum
++syn keyword cConstant MeltingOffsetEnum
++syn keyword cConstant MisfitEnum
++syn keyword cConstant NumberNodeToElementConnectivityEnum
++syn keyword cConstant PressureEnum
++syn keyword cConstant PressurePicardEnum
++syn keyword cConstant QmuPressureEnum
++syn keyword cConstant QmuVxEnum
++syn keyword cConstant QmuVyEnum
++syn keyword cConstant QmuVzEnum
++syn keyword cConstant QmuThicknessEnum
++syn keyword cConstant QmuBedEnum
++syn keyword cConstant QmuSurfaceEnum
++syn keyword cConstant QmuMeltingEnum
++syn keyword cConstant ResetPenaltiesEnum
++syn keyword cConstant SegmentOnIceShelfEnum
++syn keyword cConstant SurfaceAbsVelMisfitEnum
++syn keyword cConstant SurfaceAreaEnum
++syn keyword cConstant SurfaceAverageVelMisfitEnum
++syn keyword cConstant SurfaceLogVelMisfitEnum
++syn keyword cConstant SurfaceLogVxVyMisfitEnum
++syn keyword cConstant SurfaceRelVelMisfitEnum
++syn keyword cConstant SurfaceSlopeXEnum
++syn keyword cConstant SurfaceSlopeYEnum
++syn keyword cConstant TemperatureEnum
++syn keyword cConstant TemperatureOldEnum
++syn keyword cConstant TemperaturePicardEnum
++syn keyword cConstant ThicknessAbsMisfitEnum
++syn keyword cConstant TypeEnum
++syn keyword cConstant VelEnum
++syn keyword cConstant VelocityEnum
++syn keyword cConstant VxAverageEnum
++syn keyword cConstant VxEnum
++syn keyword cConstant VxPicardEnum
++syn keyword cConstant VyAverageEnum
++syn keyword cConstant VyEnum
++syn keyword cConstant VyPicardEnum
++syn keyword cConstant VzEnum
++syn keyword cConstant VzMacAyealEnum
++syn keyword cConstant VzPattynEnum
++syn keyword cConstant VzPicardEnum
++syn keyword cConstant VzStokesEnum
++syn keyword cConstant VxMeshEnum
++syn keyword cConstant VyMeshEnum
++syn keyword cConstant VzMeshEnum
++syn keyword cConstant EnthalpyEnum
++syn keyword cConstant EnthalpyPicardEnum
++syn keyword cConstant ThicknessAbsGradientEnum
++syn keyword cConstant StepResponsesEnum
++syn keyword cConstant IntMatParamEnum
++syn keyword cConstant RheologyBbarAbsGradientEnum
++syn keyword cConstant DragCoefficientAbsGradientEnum
++syn keyword cConstant TransientInputEnum
++syn keyword cConstant OutputfilenameEnum
++syn keyword cConstant WaterfractionEnum
++syn keyword cConstant WatercolumnEnum
++syn keyword cConstant BasalFrictionEnum
++syn keyword cConstant ViscousHeatingEnum
++syn keyword cConstant QmuTemperatureEnum
++syn keyword cConstant HydrologyWaterVxEnum
++syn keyword cConstant HydrologyWaterVyEnum
++syn keyword cConstant StressTensorEnum
++syn keyword cConstant StressTensorxxEnum
++syn keyword cConstant StressTensorxyEnum
++syn keyword cConstant StressTensorxzEnum
++syn keyword cConstant StressTensoryyEnum
++syn keyword cConstant StressTensoryzEnum
++syn keyword cConstant StressTensorzzEnum
++syn keyword cConstant IceVolumeEnum
++syn keyword cConstant TotalSmbEnum
++syn keyword cConstant ThicknessAlongGradientEnum
++syn keyword cConstant ThicknessAcrossGradientEnum
++syn keyword cConstant P0Enum
++syn keyword cConstant P1Enum
++syn keyword cConstant P1DGEnum
++syn keyword cConstant SaveResultsEnum
++syn keyword cConstant BoolElementResultEnum
++syn keyword cConstant BoolExternalResultEnum
++syn keyword cConstant DoubleElementResultEnum
++syn keyword cConstant DoubleExternalResultEnum
++syn keyword cConstant DoubleMatExternalResultEnum
++syn keyword cConstant DoubleVecExternalResultEnum
++syn keyword cConstant IntExternalResultEnum
++syn keyword cConstant JEnum
++syn keyword cConstant PatchEnum
++syn keyword cConstant PatchNodesEnum
++syn keyword cConstant PatchVerticesEnum
++syn keyword cConstant PentaP1ElementResultEnum
++syn keyword cConstant PetscVecExternalResultEnum
++syn keyword cConstant StringExternalResultEnum
++syn keyword cConstant StepEnum
++syn keyword cConstant TimeEnum
++syn keyword cConstant TriaP1ElementResultEnum
++syn keyword cConstant WaterColumnOldEnum
++syn keyword cConstant MinVelEnum
++syn keyword cConstant MaxVelEnum
++syn keyword cConstant MinVxEnum
++syn keyword cConstant MaxVxEnum
++syn keyword cConstant MaxAbsVxEnum
++syn keyword cConstant MinVyEnum
++syn keyword cConstant MaxVyEnum
++syn keyword cConstant MaxAbsVyEnum
++syn keyword cConstant MinVzEnum
++syn keyword cConstant MaxVzEnum
++syn keyword cConstant MaxAbsVzEnum
++syn keyword cConstant RelativeEnum
++syn keyword cConstant AbsoluteEnum
++syn keyword cConstant IncrementalEnum
++syn keyword cConstant AgressiveMigrationEnum
++syn keyword cConstant NoneEnum
++syn keyword cConstant SoftMigrationEnum
++syn keyword cConstant StokesSolverEnum
++syn keyword cConstant AdjointEnum
++syn keyword cConstant ColinearEnum
++syn keyword cConstant ControlSteadyEnum
++syn keyword cConstant FsetEnum
++syn keyword cConstant Gradient1Enum
++syn keyword cConstant Gradient2Enum
++syn keyword cConstant Gradient3Enum
++syn keyword cConstant GradientEnum
++syn keyword cConstant GroundinglineMigrationEnum
++syn keyword cConstant GsetEnum
++syn keyword cConstant IndexEnum
++syn keyword cConstant IndexedEnum
++syn keyword cConstant IntersectEnum
++syn keyword cConstant NodalEnum
++syn keyword cConstant OldGradientEnum
++syn keyword cConstant OutputFilePointerEnum
++syn keyword cConstant PetscOptionsAnalysesEnum
++syn keyword cConstant PetscOptionsStringsEnum
++syn keyword cConstant QmuErrNameEnum
++syn keyword cConstant QmuInNameEnum
++syn keyword cConstant QmuOutNameEnum
++syn keyword cConstant RegularEnum
++syn keyword cConstant ScaledEnum
++syn keyword cConstant SeparateEnum
++syn keyword cConstant SsetEnum
++syn keyword cConstant VerboseEnum
++syn keyword cConstant TriangleInterpEnum
++syn keyword cConstant BilinearInterpEnum
++syn keyword cConstant NearestInterpEnum
++syn keyword cConstant XYEnum
++syn keyword cConstant XYZPEnum
++syn keyword cConstant OptionEnum
++syn keyword cConstant OptionCellEnum
++syn keyword cConstant OptionCharEnum
++syn keyword cConstant OptionStructEnum
++syn keyword cConstant OptionDoubleEnum
++syn keyword cConstant OptionLogicalEnum
++syn keyword cConstant PatersonEnum
++syn keyword cConstant ArrheniusEnum
++"ISSM's Enums end
Index: /issm/oecreview/Archive/12678-13393/ISSM-12956-12957.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12956-12957.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12956-12957.diff	(revision 13394)
@@ -0,0 +1,289 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12956)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12957)
+@@ -1027,3 +1027,284 @@
+ syn keyword cConstant PatersonEnum
+ syn keyword cConstant ArrheniusEnum
+ "ISSM's Enums end
++"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
++
++if !exists("c_no_ansi") || exists("c_ansi_typedefs")
++	syn keyword   cType		size_t ssize_t wchar_t ptrdiff_t sig_atomic_t fpos_t
++	syn keyword   cType		clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t
++	syn keyword   cType		mbstate_t wctrans_t wint_t wctype_t
++	syn keyword   cType		lldiv_t float_t double_t fenv_t fexcept_t
++endif
++if !exists("c_no_c99") " ISO C99
++	syn keyword	cType		bool complex imaginary
++	syn keyword	cType		int8_t int16_t int32_t int64_t
++	syn keyword	cType		uint8_t uint16_t uint32_t uint64_t
++	syn keyword	cType		int_least8_t int_least16_t int_least32_t int_least64_t
++	syn keyword	cType		uint_least8_t uint_least16_t uint_least32_t uint_least64_t
++	syn keyword	cType		int_fast8_t int_fast16_t int_fast32_t int_fast64_t
++	syn keyword	cType		uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
++	syn keyword	cType		intptr_t uintptr_t
++	syn keyword	cType		intmax_t uintmax_t
++endif
++if exists("c_gnu")
++	syn keyword	cType		__label__ __complex__ __volatile__
++endif
++
++syn keyword	cStructure	struct union enum typedef
++syn keyword	cStorageClass	static register auto volatile extern const VOL
++if exists("c_gnu")
++	syn keyword	cStorageClass	inline __attribute__
++endif
++if !exists("c_no_c99")
++	syn keyword	cStorageClass	inline restrict
++endif
++
++if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
++	if exists("c_gnu")
++		syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__
++	endif
++	syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ __func__
++	syn keyword cConstant __STDC_VERSION__
++	syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX
++	syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
++	syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN
++	syn keyword cConstant CHAR_MAX INT_MAX LONG_MAX SHRT_MAX
++	syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
++	syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
++	if !exists("c_no_c99")
++		syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX
++		syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
++		syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX
++		syn keyword cConstant UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX
++		syn keyword cConstant INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN
++		syn keyword cConstant INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX
++		syn keyword cConstant UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX
++		syn keyword cConstant INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN
++		syn keyword cConstant INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX
++		syn keyword cConstant UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX
++		syn keyword cConstant INTPTR_MIN INTPTR_MAX UINTPTR_MAX
++		syn keyword cConstant INTMAX_MIN INTMAX_MAX UINTMAX_MAX
++		syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX
++		syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX
++	endif
++	syn keyword cConstant FLT_RADIX FLT_ROUNDS
++	syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON
++	syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON
++	syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON
++	syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP
++	syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
++	syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
++	syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
++	syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
++	syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
++	syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL _NO_LEAP_SECONDS _LOCALTIME
++	syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
++	syn keyword cConstant LC_NUMERIC LC_TIME
++	" syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
++	syn keyword cAnsiFuncPtr SIG_DFL SIG_ERR SIG_IGN
++	syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
++	syn keyword cConstant INFINITY     FP_SUBNORMAL FP_ILOGB0
++	syn keyword cConstant NAN          FP_ZERO      FP_ILOGBNAN
++	syn keyword cConstant FP_INFINITE  FP_FAST_FMA
++	syn keyword cConstant HUGE_VALF    FP_NAN       FP_FAST_FMAF
++	syn keyword cConstant HUGE_VALL    FP_NORMAL    FP_FAST_FMAL
++	syn keyword cConstant FE_OVERFLOW      FE_TOWARDZERO
++	syn keyword cConstant FE_UNDERFLOW     FE_UPWARD
++	syn keyword cConstant FE_DIVBYZERO     FE_ALL_EXCEPT    FE_DFL_ENV
++	syn keyword cConstant FE_INEXACT       FE_DOWNWARD
++	syn keyword cConstant FE_INVALID       FE_TONEAREST
++	syn keyword cConstant	_Complex_I _Imaginary_I 
++	" Add POSIX signals as well...
++	syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP
++	syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
++	syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU
++	syn keyword cConstant SIGUSR1 SIGUSR2
++	syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF
++	syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
++	syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
++	syn keyword cConstant TMP_MAX stderr stdin stdout
++	syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
++	" Add POSIX errors as well
++	syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
++	syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
++	syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR
++	syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV
++	syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS
++	syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM
++	syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV
++	" math.h
++	syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
++	syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2
++endif
++if !exists("c_no_c99") " ISO C99
++	syn keyword cConstant true false __bool_true_false_are_defined
++endif
++
++" Accept %: for # (C99)
++syn region	cPreCondit	start="^\s*\(%:\|#\)\s*\(ifdef\|ifndef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
++syn keyword	cDefined	defined contained
++"syn match	cDefined	display contained "\<defined(\w\+)" contains=cName,cAnsiName
++syn region	cPreConditIf	start="^\s*\(%:\|#\)\s*\(if\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cDefined,cComment,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
++syn match	cPreCondit	display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
++if !exists("c_no_if0")
++	syn region	cCppOut		start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2
++	syn region	cCppOut2	contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
++		syn region	cCppSkip	contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
++	endif
++	syn region	cIncluded	display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
++	syn match	cIncluded	display contained "<[^>]*>"
++	syn match	cInclude	display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
++	syn match cLineSkip	"\\$"
++	syn cluster	cPreProcGroup	contains=cPreConditIf,cPreCondit,cIncluded,cInclude,cDefined,cDefine,cErrInParen,cErrInBracket,cUserLabel,cUserLabel2,cGotoLabel,cSpecial,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti
++	"syn region	cDefine		start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@cPreProcGroup,@Spell
++	syn region	cDefine		start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@cPreProcGroup,cName,cFunction,cAnsiFunction,@Spell
++	syn region	cPreProc	start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
++
++	" Highlight User Labels
++	syn cluster	cMultiGroup	contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cUserLabel2,cGotoLabel,cBitField,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
++	syn region	cMulti		transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
++	" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
++	syn cluster	cLabelGroup	contains=cUserLabel
++	syn match	cUserCont	display "^\s*\I\i*\s*:$" contains=@cLabelGroup
++	syn match	cUserCont	display ";\s*\I\i*\s*:$" contains=@cLabelGroup
++	syn match	cUserCont	display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
++	syn match	cUserCont	display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
++
++	syn match	cUserLabel	display "\I\i*" contained
++	syn match	cUserLabel2	display "\I\i*:;\+"me=e-2
++	syn match	cGotoLabel	display "\<goto\s\+\I\i*;"me=e-1,hs=s+5 contains=cGoto
++	syn keyword	cGoto		contained goto
++
++	" Avoid recognizing most bitfields as labels
++	syn match	cBitField	display "^\s*\I\i*\s*:\s*[1-9]"me=e-1
++	syn match	cBitField	display ";\s*\I\i*\s*:\s*[1-9]"me=e-1
++
++	syn match cOperator	"\(<<\|>>\|[-+*/%&^|<>!=]\)="
++	syn match cOperator	"<<\|>>\|&&\|||\|++\|--\|->"
++	syn match cOperator	"[.!~*&%<>^|=+-]"
++	syn match cOperator	"/[^/*=]"me=e-1
++	syn match cOperator	"/$"
++	syn match cOperator	"[\\]"
++	syn match cOperator	"&&\|||"
++	syn match cSpecialCharacter	"[,;]"
++	syn match cDelimiter    "[][(){}]"
++	syn keyword	cType		CHAR byte BYTE uchar ushort uint ulong
++	syn keyword	cType		WORD DWORD QWORD INT INT2 INT4 UNS UNS2 UNS4 INT8 UNS8
++	syn keyword	cType		CFG_t cfap_t cBYTE cvoid
++	syn keyword	cType		_Bool _Complex _Imaginary __int64
++	if !exists("c_no_ansi") || exists("c_ansi_typedefs")
++		syn keyword   cMC	__near __far FAR __io __direct DIR
++	endif
++
++	if exists("c_minlines")
++		let b:c_minlines = c_minlines
++	else
++		if !exists("c_no_if0")
++			let b:c_minlines = 50	" #if 0 constructs can be long
++		else
++			let b:c_minlines = 15	" mostly for () constructs
++		endif
++	endif
++	exec "syn sync ccomment cComment minlines=" . b:c_minlines
++
++	" Define the default highlighting.
++	" For version 5.7 and earlier: only when not done already
++	" For version 5.8 and later: only when an item doesn't have highlighting yet
++	if version >= 508 || !exists("did_c_syn_inits")
++		if version < 508
++			let did_c_syn_inits = 1
++			command -nargs=+ HiLink hi link <args>
++		else
++			command -nargs=+ HiLink hi def link <args>
++		endif
++
++		HiLink cFormat	cSpecial
++		HiLink cCppString	cString
++		HiLink cCommentL	cComment
++		HiLink cCommentStart	cComment
++		HiLink cLabel		Label
++		" HiLink cUserLabel	Label
++		HiLink cUserLabel	UserLabel2
++		HiLink cUserLabel2	UserLabel2
++		HiLink cGotoLabel	UserLabel2
++		HiLink cGoto		Statement
++		HiLink cConditional	Conditional
++		HiLink cRepeat	Repeat
++		HiLink cCharacter	Character
++		HiLink cSpecialCharacter cSpecial
++		HiLink cNumber	Number
++		HiLink cOctal		Number
++		HiLink cOctalZero	PreProc		" link this to Error if you want
++		HiLink cFloat		Float
++		HiLink cOctalError	cError
++		HiLink cParenError	cError
++		HiLink cErrInParen	cError
++		HiLink cErrInBracket	cError
++		HiLink cCommentError	cError
++		HiLink cCommentStartError	cError
++		HiLink cSpaceError	cError
++		HiLink cSpecialError	cError
++		HiLink cOperator	Operator
++		HiLink cOperatorBold	OperatorBold
++		HiLink cStructure	Structure
++		HiLink cStorageClass	StorageClass
++		HiLink cInclude	Include
++		HiLink cPreProc	PreProc
++		HiLink cDefine	Macro
++		HiLink cDefined	PreCondit
++		HiLink cIncluded	cString
++		HiLink cError		Error
++		HiLink cStatement	Statement
++		HiLink cPreCondit	PreCondit
++		HiLink cPreConditIf	PreCondit
++		HiLink cType		Type
++		HiLink cConstant	Constant
++		HiLink cCommentString cString
++		HiLink cComment2String cString
++		HiLink cCommentSkip	cComment
++		HiLink cString	String
++		HiLink cComment	Comment
++		HiLink cDelimiter     Delimiter
++		HiLink cSpecial	SpecialChar
++		HiLink cTodo		Todo
++		HiLink cCppSkip	cCppOut
++		HiLink cCppOut2	cCppOut
++		HiLink cCppOut	Comment
++		HiLink cMulti		Operator
++		HiLink cMultiMG	Operator
++		HiLink cFunction	Function
++		HiLink cAnsiFunction	StdFunction
++		HiLink cName		Name
++		HiLink cBitField	Name
++		HiLink cAnsiName	StdName
++		"HiLink cBlock	BlockBraces
++		HiLink cBraces	BlockBraces
++		"HiLink cBraceError	Error
++		HiLink cMC		MicroController
++		HiLink cAnsiFuncPtr	AnsiFuncPtr
++
++		hi Function		gui=NONE guifg=#e86f00
++		"hi StdFunction	gui=bold guifg=#ee0040
++		hi StdFunction	gui=bold guifg=#e86f00
++		hi Statement		gui=bold guifg=#a06129
++		hi UserLabel2		gui=bold guifg=#c96129
++		hi Operator		gui=NONE guifg=#000000
++		hi OperatorBold	gui=bold guifg=#000000
++		hi StdName		gui=bold guifg=#5276e6
++		hi Name		gui=NONE guifg=#5276e6
++		hi BlockBraces	gui=bold guifg=#000000
++		hi Special		gui=NONE guifg=#a000a0
++		hi Comment		gui=NONE guifg=grey62
++		hi MicroController	gui=bold guifg=#d00000
++		hi AnsiFuncPtr	gui=NONE guifg=#ff0000
++		" hi PreProc        	gui=NONE guifg=#6a5acd
++		hi PreCondit      	gui=NONE guifg=#6a5acd
++		" hi Macro          	gui=NONE guifg=#0000ff
++
++		delcommand HiLink
++	endif
++	hi Normal		gui=NONE guifg=#000000 guibg=Ivory1
++
++	let b:current_syntax = "c"
++
++	" vim: ts=8
Index: /issm/oecreview/Archive/12678-13393/ISSM-12957-12958.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12957-12958.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12957-12958.diff	(revision 13394)
@@ -0,0 +1,1415 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/isnans.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/isnans.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/isnans.py	(revision 12958)
+@@ -0,0 +1,18 @@
++import numpy
++
++def isnans(array):
++	"""
++	ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
++
++	   Usage:    isnans(array)
++
++	      See also : ISNAN 
++	"""
++
++	if   isinstance(array,(tuple,list,dict)): 
++		returnvalue=0
++	else:
++		returnvalue=numpy.isnan(array)
++
++	return returnvalue
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class thermal:
++class thermal(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/settings.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/settings.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/settings.py	(revision 12958)
+@@ -1,7 +1,17 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+-class settings:
++class settings(object):
++	"""
++	SETTINGS class definition
++
++	   Usage:
++	      settings=settings();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -15,39 +25,57 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string="   general settings parameters:"
+ 
+-		string="%s\n%s"%(string,fielddisplay(obj,"io_gather","I/O gathering strategy for result outputs (default 1)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"lowmem","is the memory limited ? (0 or 1)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"results_as_patches","provide results as patches for each element (0 or 1)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"output_frequency","frequency at which results are saved in all solutions with multiple time_steps"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"waitonlock","maximum number of minutes to wait for batch results, or return 0"))
++		string="%s\n%s"%(string,fielddisplay(self,"io_gather","I/O gathering strategy for result outputs (default 1)"))
++		string="%s\n%s"%(string,fielddisplay(self,"lowmem","is the memory limited ? (0 or 1)"))
++		string="%s\n%s"%(string,fielddisplay(self,"results_as_patches","provide results as patches for each element (0 or 1)"))
++		string="%s\n%s"%(string,fielddisplay(self,"output_frequency","frequency at which results are saved in all solutions with multiple time_steps"))
++		string="%s\n%s"%(string,fielddisplay(self,"waitonlock","maximum number of minutes to wait for batch results, or return 0"))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#are we short in memory ? (0 faster but requires more memory)
+-		obj.lowmem=0
++		self.lowmem=0
+ 
+ 		#i/o:
+-		obj.io_gather=1
++		self.io_gather=1
+ 
+ 		#results frequency by default every step
+-		obj.output_frequency=1
++		self.output_frequency=1
+ 
+ 		#do not use patches by default (difficult to plot)
+-		obj.results_as_patches=0
++		self.results_as_patches=0
+ 
+ 		#this option can be activated to load automatically the results
+ 		#onto the model after a parallel run by waiting for the lock file
+ 		#N minutes that is generated once the solution has converged
+ 		#0 to desactivate
+-		obj.waitonlock=float('Inf')
++		self.waitonlock=float('Inf')
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		md = checkfield(md,'settings.io_gather','numel',1,'values',[0,1])
++		md = checkfield(md,'settings.lowmem','numel',1,'values',[0,1])
++		md = checkfield(md,'settings.results_as_patches','numel',1,'values',[0,1])
++		md = checkfield(md,'settings.output_frequency','numel',1,'>=',1)
++		md = checkfield(md,'settings.waitonlock','numel',1)
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','io_gather','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','lowmem','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','results_as_patches','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','output_frequency','format','Integer')
++		WriteData(fid,'object',self,'fieldname','waitonlock','format','Boolean')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/balancethickness.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/balancethickness.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/balancethickness.py	(revision 12958)
+@@ -1,6 +1,6 @@
+ #module imports
+ from fielddisplay import fielddisplay
+-class balancethickness:
++class balancethickness(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class groundingline:
++class groundingline(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class transient:
++class transient(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class hydrology:
++class hydrology(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py	(revision 12958)
+@@ -4,7 +4,14 @@
+ from checkfield import *
+ from WriteData import *
+ 
+-class surfaceforcings:
++class surfaceforcings(object):
++	"""
++	SURFACEFORCING Class definition
++
++	   Usage:
++	      surfaceforcings=surfaceforcings();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -31,42 +38,42 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string="   surface forcings parameters:"
+ 
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'precipitation','surface precipitation [m/yr water eq]'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'mass_balance','surface mass balance [m/yr ice eq]'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'ispdd','is pdd activated (0 or 1, default is 0)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'monthlytemperatures','monthly surface temperatures [Kelvin], required if pdd is activated and delta18o not activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'precipitation','surface precipitation [m/yr water eq]'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'temperatures_presentday','monthly present day surface temperatures [Kelvin], required if pdd is activated and delta18o activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'temperatures_lgm','monthly LGM surface temperatures [Kelvin], required if pdd is activated and delta18o activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'delta18o','delta18o, required if pdd is activated and delta18o activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'issmbgradients','is smb gradients method activated (0 or 1, default is 0)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'hc',' elevation of intersection between accumulation and ablation regime required if smb gradients is activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'smb_pos_max',' maximum value of positive smb required if smb gradients is activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'smb_pos_min',' minimum value of positive smb required if smb gradients is activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'a_pos',' intercept of hs - smb regression line for accumulation regime required if smb gradients is activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'b_pos',' slope of hs - smb regression line for accumulation regime required if smb gradients is activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'a_neg',' intercept of hs - smb regression line for ablation regime required if smb gradients is activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'b_neg',' slope of hs - smb regression line for ablation regime required if smb gradients is activated'))
++		string="%s\n\n%s"%(string,fielddisplay(self,'precipitation','surface precipitation [m/yr water eq]'))
++		string="%s\n%s"%(string,fielddisplay(self,'mass_balance','surface mass balance [m/yr ice eq]'))
++		string="%s\n%s"%(string,fielddisplay(self,'ispdd','is pdd activated (0 or 1, default is 0)'))
++		string="%s\n%s"%(string,fielddisplay(self,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'))
++		string="%s\n%s"%(string,fielddisplay(self,'monthlytemperatures','monthly surface temperatures [Kelvin], required if pdd is activated and delta18o not activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'precipitation','surface precipitation [m/yr water eq]'))
++		string="%s\n%s"%(string,fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [Kelvin], required if pdd is activated and delta18o activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'temperatures_lgm','monthly LGM surface temperatures [Kelvin], required if pdd is activated and delta18o activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'delta18o','delta18o, required if pdd is activated and delta18o activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'issmbgradients','is smb gradients method activated (0 or 1, default is 0)'))
++		string="%s\n%s"%(string,fielddisplay(self,'hc',' elevation of intersection between accumulation and ablation regime required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'smb_pos_max',' maximum value of positive smb required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'smb_pos_min',' minimum value of positive smb required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'a_pos',' intercept of hs - smb regression line for accumulation regime required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'b_pos',' slope of hs - smb regression line for accumulation regime required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'a_neg',' intercept of hs - smb regression line for ablation regime required if smb gradients is activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'b_neg',' slope of hs - smb regression line for ablation regime required if smb gradients is activated'))
+ 
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		  
+ 		#pdd method not used in default mode
+-		obj.ispdd=0
+-		obj.issmbgradients=0
+-		obj.isdelta18o=0
++		self.ispdd=0
++		self.issmbgradients=0
++		self.isdelta18o=0
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py	(revision 12958)
+@@ -1,7 +1,19 @@
+ #module imports
++import numpy
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
++from isnans import *
+ 
+-class rifts:
++class rifts(object):
++	"""
++	RIFTS class definition
++
++	   Usage:
++	      rifts=rifts();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -12,17 +24,68 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   rifts parameters:'
+ 
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'riftstruct','structure containing all rift information (vertices coordinates, segments, type of melange, ...)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'riftproperties',''))
++		string="%s\n\n%s"%(string,fielddisplay(self,'riftstruct','structure containing all rift information (vertices coordinates, segments, type of melange, ...)'))
++		string="%s\n%s"%(string,fielddisplay(self,'riftproperties',''))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		if (not self.riftstruct) or any(isnans(self.riftstruct)):
++			numrifts=0
++		else:
++			numrifts=len(self.riftstruct)
++
++		if numrifts:
++			if not md.mesh.dimension==2:
++				md.checkmessage("models with rifts are only supported in 2d for now!")
++			if not isinstance(self.riftstruct,list):
++				md.checkmessage("rifts.riftstruct should be a structure!")
++			if any(md.mesh.segmentmarkers>=2):
++				#We have segments with rift markers, but no rift structure!
++				md.checkmessage("model should be processed for rifts (run meshprocessrifts)!")
++			md = checkfield(md,'rifts.riftstruct.fill','values',[WaterEnum(),AirEnum(),IceEnum(),MelangeEnum()])
++		else:
++			if any(numpy.logical_not(isnans(self.riftstruct))):
++				md.checkmessage("riftstruct shoud be NaN since numrifts is 0!")
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++
++		#Process rift info
++		if (not self.riftstruct) or any(isnans(self.riftstruct)):
++			numrifts=0
++		else:
++			numrifts=len(self.riftstruct)
++
++		numpairs=0
++		for i in xrange(0,numrifts):
++			numpairs+=numpy.size(self.riftstruct[i].penaltypairs,0)
++
++		# 2 for nodes + 2 for elements+ 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
++		data=numpy.zeros(numpairs,12)
++		count=0
++		for i in xrange(0,numrifts):
++			numpairsforthisrift=numpy.size(self.riftstruct[i]['penaltypairs'],0)
++			data[count:count+numpairsforthisrift-1,0:6]=self.riftstruct[i]['penaltypairs']
++			data[count:count+numpairsforthisrift-1,7]=self.riftstruct[i]['fill']
++			data[count:count+numpairsforthisrift-1,8]=self.riftstruct[i]['friction']
++			data[count:count+numpairsforthisrift-1,9]=self.riftstruct[i]['fraction']
++			data[count:count+numpairsforthisrift-1,10]=self.riftstruct[i]['fractionincrement']
++			data[count:count+numpairsforthisrift-1,11]=self.riftstruct[i]['state']
++			count+=numpairsforthisrift
++
++		WriteData(fid,'data',numrifts,'enum',RiftsNumriftsEnum,'format','Integer')
++		WriteData(fid,'data',data,'enum',RiftsRiftstructEnum,'format','DoubleMat','mattype',3)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py	(revision 12958)
+@@ -5,7 +5,14 @@
+ from checkfield import *
+ from MatlabFuncs import *
+ 
+-class mesh:
++class mesh(object):
++	"""
++	MESH class definition
++
++	   Usage:
++	      mesh=mesh();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -53,60 +60,60 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 
+-		if obj.dimension==3:
++		if self.dimension==3:
+ 			string="\n%s"%("      Elements and vertices of the original 2d mesh:")
+ 			
+-			string="%s\n%s"%(string,fielddisplay(obj,"numberofelements2d","number of elements"))
+-			string="%s\n%s"%(string,fielddisplay(obj,"numberofvertices2d","number of vertices"))
+-			string="%s\n%s"%(string,fielddisplay(obj,"elements2d","index into (x,y,z), coordinates of the vertices"))
+-			string="%s\n%s"%(string,fielddisplay(obj,"x2d","vertices x coordinate"))
+-			string="%s\n%s"%(string,fielddisplay(obj,"y2d","vertices y coordinate"))
++			string="%s\n%s"%(string,fielddisplay(self,"numberofelements2d","number of elements"))
++			string="%s\n%s"%(string,fielddisplay(self,"numberofvertices2d","number of vertices"))
++			string="%s\n%s"%(string,fielddisplay(self,"elements2d","index into (x,y,z), coordinates of the vertices"))
++			string="%s\n%s"%(string,fielddisplay(self,"x2d","vertices x coordinate"))
++			string="%s\n%s"%(string,fielddisplay(self,"y2d","vertices y coordinate"))
+ 
+ 			string="%s\n%s" %(string,"Elements and vertices of the extruded 3d mesh:")
+ 		else:
+ 			string="\n%s"%("      Elements and vertices:")
+-		string="%s\n%s"%(string,fielddisplay(obj,"numberofelements","number of elements"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"numberofvertices","number of vertices"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"elements","index into (x,y,z), coordinates of the vertices"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"x","vertices x coordinate"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"y","vertices y coordinate"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"z","vertices z coordinate"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"edges","edges of the 2d mesh (vertex1 vertex2 element1 element2)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"numberofedges","number of edges of the 2d mesh"))
++		string="%s\n%s"%(string,fielddisplay(self,"numberofelements","number of elements"))
++		string="%s\n%s"%(string,fielddisplay(self,"numberofvertices","number of vertices"))
++		string="%s\n%s"%(string,fielddisplay(self,"elements","index into (x,y,z), coordinates of the vertices"))
++		string="%s\n%s"%(string,fielddisplay(self,"x","vertices x coordinate"))
++		string="%s\n%s"%(string,fielddisplay(self,"y","vertices y coordinate"))
++		string="%s\n%s"%(string,fielddisplay(self,"z","vertices z coordinate"))
++		string="%s\n%s"%(string,fielddisplay(self,"edges","edges of the 2d mesh (vertex1 vertex2 element1 element2)"))
++		string="%s\n%s"%(string,fielddisplay(self,"numberofedges","number of edges of the 2d mesh"))
+ 
+ 		string="%s%s"%(string,"\n      Properties:")
+-		string="%s\n%s"%(string,fielddisplay(obj,"dimension","mesh dimension (2d or 3d)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"numberoflayers","number of extrusion layers"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"vertexonbed","lower vertices flags list"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"elementonbed","lower elements flags list"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"vertexonsurface","upper vertices flags list"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"elementonsurface","upper elements flags list"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"uppervertex","upper vertex list (NaN for vertex on the upper surface)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"upperelements","upper element list (NaN for element on the upper layer)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"lowervertex","lower vertex list (NaN for vertex on the lower surface)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"lowerelements","lower element list (NaN for element on the lower layer"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"vertexonboundary","vertices on the boundary of the domain flag list"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"segments","edges on domain boundary (vertex1 vertex2 element)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"segmentmarkers","number associated to each segment"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"vertexconnectivity","list of vertices connected to vertex_i"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"elementconnectivity","list of vertices connected to element_i"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"average_vertex_connectivity","average number of vertices connected to one vertex"))
++		string="%s\n%s"%(string,fielddisplay(self,"dimension","mesh dimension (2d or 3d)"))
++		string="%s\n%s"%(string,fielddisplay(self,"numberoflayers","number of extrusion layers"))
++		string="%s\n%s"%(string,fielddisplay(self,"vertexonbed","lower vertices flags list"))
++		string="%s\n%s"%(string,fielddisplay(self,"elementonbed","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 (NaN for vertex on the upper surface)"))
++		string="%s\n%s"%(string,fielddisplay(self,"upperelements","upper element list (NaN for element on the upper layer)"))
++		string="%s\n%s"%(string,fielddisplay(self,"lowervertex","lower vertex list (NaN for vertex on the lower surface)"))
++		string="%s\n%s"%(string,fielddisplay(self,"lowerelements","lower element list (NaN for element on the lower layer"))
++		string="%s\n%s"%(string,fielddisplay(self,"vertexonboundary","vertices on the boundary of the domain flag list"))
++		string="%s\n%s"%(string,fielddisplay(self,"segments","edges on domain boundary (vertex1 vertex2 element)"))
++		string="%s\n%s"%(string,fielddisplay(self,"segmentmarkers","number associated to each segment"))
++		string="%s\n%s"%(string,fielddisplay(self,"vertexconnectivity","list of vertices connected to vertex_i"))
++		string="%s\n%s"%(string,fielddisplay(self,"elementconnectivity","list of vertices connected to element_i"))
++		string="%s\n%s"%(string,fielddisplay(self,"average_vertex_connectivity","average number of vertices connected to one vertex"))
+ 
+ 		string="%s%s"%(string,"\n      Extracted model:")
+-		string="%s\n%s"%(string,fielddisplay(obj,"extractedvertices","vertices extracted from the model"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"extractedelements","elements extracted from the model"))
++		string="%s\n%s"%(string,fielddisplay(self,"extractedvertices","vertices extracted from the model"))
++		string="%s\n%s"%(string,fielddisplay(self,"extractedelements","elements extracted from the model"))
+ 
+ 		string="%s%s"%(string,"\n      Projection:")
+-		string="%s\n%s"%(string,fielddisplay(obj,"lat","vertices latitude"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"long","vertices longitude"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"hemisphere","Indicate hemisphere ""n"" or ""s"" "))
++		string="%s\n%s"%(string,fielddisplay(self,"lat","vertices latitude"))
++		string="%s\n%s"%(string,fielddisplay(self,"long","vertices longitude"))
++		string="%s\n%s"%(string,fielddisplay(self,"hemisphere","Indicate hemisphere ""n"" or ""s"" "))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#the connectivity is the averaged number of nodes linked to a
+@@ -114,9 +121,9 @@
+ 		#allocate memory to the stiffness matrix. A value of 16 seems to
+ 		#give a good memory/time ration. This value can be checked in
+ 		#trunk/test/Miscellaneous/runme.m
+-		obj.average_vertex_connectivity=25
++		self.average_vertex_connectivity=25
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.py	(revision 12958)
+@@ -4,7 +4,14 @@
+ from checkfield import *
+ from WriteData import *
+ 
+-class timestepping:
++class timestepping(object):
++	"""
++	TIMESTEPPING Class definition
++
++	   Usage:
++	      timestepping=timestepping();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -18,31 +25,31 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string="   timestepping parameters:"
+-		string="%s\n\n%s"%(string,fielddisplay(obj,"start_time","simulation starting time [yrs]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"final_time","final time to stop the simulation [yrs]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"time_step","length of time steps [yrs]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"time_adapt","use cfl condition to define time step ? (0 or 1) "))
+-		string="%s\n%s"%(string,fielddisplay(obj,"cfl_coefficient","coefficient applied to cfl condition"))
++		string="%s\n\n%s"%(string,fielddisplay(self,"start_time","simulation starting time [yrs]"))
++		string="%s\n%s"%(string,fielddisplay(self,"final_time","final time to stop the simulation [yrs]"))
++		string="%s\n%s"%(string,fielddisplay(self,"time_step","length of time steps [yrs]"))
++		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"))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#time between 2 time steps
+-		obj.time_step=1/2
++		self.time_step=1/2
+ 
+ 		#final time
+-		obj.final_time=10*obj.time_step
++		self.final_time=10*self.time_step
+ 
+ 		#time adaptation? 
+-		obj.time_adapt=0
+-		obj.cfl_coefficient=.5
++		self.time_adapt=0
++		self.cfl_coefficient=.5
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/constants.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/constants.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/constants.py	(revision 12958)
+@@ -4,7 +4,14 @@
+ from checkfield import *
+ from WriteData import *
+ 
+-class constants:
++class constants(object):
++	"""
++	CONSTANTS class definition
++
++	   Usage:
++	      constants=constants();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -16,30 +23,30 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string="   constants parameters:"
+-		string="%s\n\n%s"%(string,fielddisplay(obj,"g","gravitational acceleration"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"yts","number of seconds in a year"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"referencetemperature","reference temperature used in the enthalpy model"))
++		string="%s\n\n%s"%(string,fielddisplay(self,"g","gravitational acceleration"))
++		string="%s\n%s"%(string,fielddisplay(self,"yts","number of seconds in a year"))
++		string="%s\n%s"%(string,fielddisplay(self,"referencetemperature","reference temperature used in the enthalpy model"))
+ 
+ 
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#acceleration due to gravity (m/s^2)
+-		obj.g=9.81
++		self.g=9.81
+ 
+ 		#converstion from year to seconds
+-		obj.yts=365*24*3600
++		self.yts=365*24*3600
+ 
+ 		#the reference temperature for enthalpy model (cf Aschwanden)
+-		obj.referencetemperature=223.15
++		self.referencetemperature=223.15
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py	(revision 12958)
+@@ -4,7 +4,14 @@
+ from checkfield import *
+ from WriteData import *
+ 
+-class friction:
++class friction(object):
++	"""
++	FRICTION class definition
++
++	   Usage:
++	      friction=friction();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -16,18 +23,18 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string="Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p"
+-		string="%s\n\n%s"%(string,fielddisplay(obj,"coefficient","friction coefficient [SI]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"p","p exponent"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"q","q exponent"))
++		string="%s\n\n%s"%(string,fielddisplay(self,"coefficient","friction coefficient [SI]"))
++		string="%s\n%s"%(string,fielddisplay(self,"p","p exponent"))
++		string="%s\n%s"%(string,fielddisplay(self,"q","q exponent"))
+ 		return string
+ 		#}}}
+ 
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 12958)
+@@ -4,7 +4,14 @@
+ from checkfield import *
+ from WriteData import *
+ 
+-class materials:
++class materials(object):
++	"""
++	MATERIALS class definition
++
++	   Usage:
++	      materials=materials();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -24,62 +31,62 @@
+ 
+ 		self.setdefaultparameters()
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string="   Materials:"
+ 
+-		string="%s\n\n%s"%(string,fielddisplay(obj,"rho_ice","ice density [kg/m^3]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"rho_water","water density [kg/m^3]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"mu_water","water viscosity [N s/m^2]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"heatcapacity","heat capacity [J/kg/K]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"thermalconductivity","ice thermal conductivity [W/m/K]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"meltingpoint","melting point of ice at 1atm in K"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"latentheat","latent heat of fusion [J/m^3]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"beta","rate of change of melting point with pressure [K/Pa]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"rheology_B","flow law parameter [Pa/s^(1/n)]"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"rheology_n","Glen""s flow law exponent"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"rheology_law","law for the temperature dependance of the rheology: ""None"", ""Paterson"" or ""Arrhenius"""))
++		string="%s\n\n%s"%(string,fielddisplay(self,"rho_ice","ice density [kg/m^3]"))
++		string="%s\n%s"%(string,fielddisplay(self,"rho_water","water density [kg/m^3]"))
++		string="%s\n%s"%(string,fielddisplay(self,"mu_water","water viscosity [N s/m^2]"))
++		string="%s\n%s"%(string,fielddisplay(self,"heatcapacity","heat capacity [J/kg/K]"))
++		string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]"))
++		string="%s\n%s"%(string,fielddisplay(self,"meltingpoint","melting point of ice at 1atm in K"))
++		string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
++		string="%s\n%s"%(string,fielddisplay(self,"beta","rate of change of melting point with pressure [K/Pa]"))
++		string="%s\n%s"%(string,fielddisplay(self,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
++		string="%s\n%s"%(string,fielddisplay(self,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
++		string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa/s^(1/n)]"))
++		string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen""s flow law exponent"))
++		string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: ""None"", ""Paterson"" or ""Arrhenius"""))
+ 
+ 		return string
+ 		#}}}
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		#ice density (kg/m^3)
+-		obj.rho_ice=917
++		self.rho_ice=917
+ 
+ 		#water density (kg/m^3)
+-		obj.rho_water=1023
++		self.rho_water=1023
+ 
+ 		#water viscosity (N.s/m^2)
+-		obj.mu_water=0.001787  
++		self.mu_water=0.001787  
+ 
+ 		#ice heat capacity cp (J/kg/K)
+-		obj.heatcapacity=2093
++		self.heatcapacity=2093
+ 
+ 		#ice latent heat of fusion L (J/kg)
+-		obj.latentheat=3.34*10**5
++		self.latentheat=3.34*10**5
+ 
+ 		#ice thermal conductivity (W/m/K)
+-		obj.thermalconductivity=2.4
++		self.thermalconductivity=2.4
+ 
+ 		#the melting point of ice at 1 atmosphere of pressure in K
+-		obj.meltingpoint=273.15
++		self.meltingpoint=273.15
+ 
+ 		#rate of change of melting point with pressure (K/Pa)
+-		obj.beta=9.8*10**-8
++		self.beta=9.8*10**-8
+ 
+ 		#mixed layer (ice-water interface) heat capacity (J/kg/K)
+-		obj.mixed_layer_capacity=3974
++		self.mixed_layer_capacity=3974
+ 
+ 		#thermal exchange velocity (ice-water interface) (m/s)
+-		obj.thermal_exchange_velocity=1.00*10**-4
++		self.thermal_exchange_velocity=1.00*10**-4
+ 
+ 		#Rheology law: what is the temperature dependence of B with T
+ 		#available: none, paterson and arrhenius
+-		obj.rheology_law='Paterson'
+-		return obj
++		self.rheology_law='Paterson'
++		return self
+ 		#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class diagnostic:
++class diagnostic(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/debug.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/debug.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/debug.py	(revision 12958)
+@@ -1,28 +1,42 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from WriteData import *
+ 
+-class debug:
++class debug(object):
++	"""
++	DEBUG class definition
++
++	   Usage:
++	      debug=debug();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+-		self.valgrind=False
+-		self.gprof   = False
++		self.valgrind  = False
++		self.gprof     = False
++		self.profiling = False
+ 		
+ 		#set defaults
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string="   debug parameters:"
+ 
+-		string="%s\n\n%s"%(string,fielddisplay(obj,"valgrind","use Valgrind to debug (0 or 1)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"gprof","use gnu-profiler to find out where the time is spent"))
++		string="%s\n\n%s"%(string,fielddisplay(self,"valgrind","use Valgrind to debug (0 or 1)"))
++		string="%s\n%s"%(string,fielddisplay(self,"gprof","use gnu-profiler to find out where the time is spent"))
++		string="%s\n%s"%(string,fielddisplay(self,'profiling','enables profiling (memory, flops, time)'))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','profiling','format','Boolean')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py	(revision 12958)
+@@ -5,7 +5,14 @@
+ from checkfield import *
+ from WriteData import *
+ 
+-class initialization:
++class initialization(object):
++	"""
++	INITIALIZATION class definition
++
++	   Usage:
++	      initialization=initialization();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -23,28 +30,28 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   initial field values:'
+ 
+-		string="%s\n%s"%(string,fielddisplay(obj,'vx','x component of velocity'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'vy','y component of velocity'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'vz','z component of velocity'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'vel','velocity norm'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'pressure','pressure field'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'temperature','temperature in Kelvins'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'watercolumn','thickness of subglacial water'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'waterfraction','fraction of water in the ice'))
++		string="%s\n%s"%(string,fielddisplay(self,'vx','x component of velocity'))
++		string="%s\n%s"%(string,fielddisplay(self,'vy','y component of velocity'))
++		string="%s\n%s"%(string,fielddisplay(self,'vz','z component of velocity'))
++		string="%s\n%s"%(string,fielddisplay(self,'vel','velocity norm'))
++		string="%s\n%s"%(string,fielddisplay(self,'pressure','pressure field'))
++		string="%s\n%s"%(string,fielddisplay(self,'temperature','temperature in Kelvins'))
++		string="%s\n%s"%(string,fielddisplay(self,'watercolumn','thickness of subglacial water'))
++		string="%s\n%s"%(string,fielddisplay(self,'waterfraction','fraction of water in the ice'))
+ 
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
+-	def checkconsistency(obj,md,solution,analyses):    # {{{
++	def checkconsistency(self,md,solution,analyses):    # {{{
+ 		if DiagnosticHorizAnalysisEnum in analyses:
+ 			if not any(numpy.isnan(md.initialization.vx) or numpy.isnan(md.initialization.vy)):
+ 				md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
+@@ -72,13 +79,13 @@
+ 		return md
+ 	# }}}
+ 
+-	def marshall(obj,fid):    # {{{
+-		WriteData(fid,'data',obj.vx,'format','DoubleMat','mattype',1,'enum',VxEnum)
+-		WriteData(fid,'data',obj.vy,'format','DoubleMat','mattype',1,'enum',VyEnum)
+-		WriteData(fid,'data',obj.vz,'format','DoubleMat','mattype',1,'enum',VzEnum)
+-		WriteData(fid,'data',obj.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum)
+-		WriteData(fid,'data',obj.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum)
+-		WriteData(fid,'data',obj.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum)
+-		WriteData(fid,'data',obj.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum)
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'data',self.vx,'format','DoubleMat','mattype',1,'enum',VxEnum)
++		WriteData(fid,'data',self.vy,'format','DoubleMat','mattype',1,'enum',VyEnum)
++		WriteData(fid,'data',self.vz,'format','DoubleMat','mattype',1,'enum',VzEnum)
++		WriteData(fid,'data',self.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum)
++		WriteData(fid,'data',self.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum)
++		WriteData(fid,'data',self.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum)
++		WriteData(fid,'data',self.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum)
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class prognostic:
++class prognostic(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mask.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mask.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mask.py	(revision 12958)
+@@ -4,7 +4,14 @@
+ from checkfield import *
+ from WriteData import *
+ 
+-class mask:
++class mask(object):
++	"""
++	MASK class definition
++
++	   Usage:
++	      mask=mask();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -19,22 +26,22 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 
+ 		string="";
+-		string="%s\n%s"%(string,fielddisplay(obj,"elementonfloatingice","element on floating ice flags list"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"vertexonfloatingice","vertex on floating ice flags list"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"elementongroundedice","element on grounded ice  list"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"vertexongroundedice","vertex on grounded ice flags list"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"elementonwater","element on water flags list"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"vertexonwater","vertex on water flags list"))
++		string="%s\n%s"%(string,fielddisplay(self,"elementonfloatingice","element on floating ice flags list"))
++		string="%s\n%s"%(string,fielddisplay(self,"vertexonfloatingice","vertex on floating ice flags list"))
++		string="%s\n%s"%(string,fielddisplay(self,"elementongroundedice","element on grounded ice  list"))
++		string="%s\n%s"%(string,fielddisplay(self,"vertexongroundedice","vertex on grounded ice flags list"))
++		string="%s\n%s"%(string,fielddisplay(self,"elementonwater","element on water flags list"))
++		string="%s\n%s"%(string,fielddisplay(self,"vertexonwater","vertex on water flags list"))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/radaroverlay.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/radaroverlay.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/radaroverlay.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class radaroverlay:
++class radaroverlay(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class autodiff:
++class autodiff(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ from pairoptions import *
+ from MatlabFuncs import *
++from EnumDefinitions import *
+ from WriteData import *
+-from EnumDefinitions import *
+ 
+ class verbose(object):
+ 	"""
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py	(revision 12958)
+@@ -1,49 +1,106 @@
+-#module imports {{{
+-import fielddisplay 
+-import ismumps
+-from  mumpsoptions import *
+-from  iluasmoptions import *
+-#}}}
+-class solver:
+-	#properties
+-	def __init__(self):
+-		# {{{ Properties
++from ismumps import *
++from mumpsoptions import *
++from iluasmoptions import *
++from MatlabFuncs import *
++from EnumDefinitions import *
++from checkfield import *
++
++class solver(object):
++	"""
++	SOLVER class definition
++
++	   Usage:
++	      obj=solver();
++	"""
++
++	def __init__(self):    # {{{
++		#MUMPS is the default solver
+ 		if ismumps:
+-			self.options=[["NoneAnalysis",mumpsoptions()]]
++			self.NoneAnalysis=mumpsoptions()
+ 		else:
+-			self.options=[["NoneAnalysis",iluasmoptions()]]
+-		#}}}
+-	def __repr__(obj):
+-		# {{{ Display
+-		
+-		string2="   solver parameters:"
+-		for i in range(len(obj.options)):
+-			option=obj.options[i]
+-			analysis=option[0]
+-			ioptions=option[1]
++			self.NoneAnalysis=iluasmoptions()
+ 
+-			string=""
+-			for i in range(len(ioptions)):
+-				option=ioptions[i]
+-				if not option:
+-					#do nothing
+-					pass
+-				elif len(option)==1:
++		#The other properties are dynamic
++	# }}}
++
++	def addoptions(self,analysis,*args):    # {{{
++		# Usage example:
++		#    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum,stokesoptions());
++		#    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum);
++
++		#Convert analysis from enum to string
++#		need EnumToString
++#		analysis=EnumToString(analysis)
++
++		#Create dynamic property if property does not exist yet
++		if not hasattr(self,analysis):
++#			exec("self.%s = None" % analysis)
++			setattr(self,analysis,None)
++
++		#Add solver options to analysis
++		if len(args)==1:
++			setattr(self,analysis,args[0])
++
++		return self
++	# }}}
++
++	def __repr__(self):    # {{{
++		s ="List of solver options per analysis:\n\n"
++		for analysis in vars(self).iterkeys():
++			s+="%s :\n" % analysis
++			s+="%s\n" % getattr(self,analysis)
++
++		return s
++	# }}}
++
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		for analysis in vars(self).iterkeys():
++			if not getattr(self,analysis):
++				md.checkmessage("md.solver.%s is empty" % analysis)
++
++		return md
++	# }}}
++
++	def PetscFile(self,filename):    # {{{
++		"""
++		PETSCFILE - build petsc file
++
++		   Build a Petsc compatible options file, from the solver model field  + return options string
++
++		   Usage:     PetscFile(solver,filename);
++		"""
++
++		#open file for writing
++		try:
++			fid=open(filename,'w')
++		except IOError as e:
++			raise IOError("PetscFile error: could not open '%s' for writing." % filename)
++
++		#write header
++		fid.write("%s%s%s\n" % ('%Petsc options file: ',filename,' written from Matlab solver array'))
++
++		#start writing options
++		for analysis in vars(self).iterkeys():
++			options=getattr(self,analysis)
++
++			#first write analysis:
++			fid.write("\n+%s\n" % analysis)    #append a + to recognize it's an analysis enum
++
++			#now, write options
++			for optionname,optionvalue in options.iteritems():
++
++				if not optionvalue:
+ 					#this option has only one argument
+-					string="%s%s%s"%(string," -",option[0])
+-				elif len(option)==2:
++					fid.write("-%s\n" % optionname)
++				else:
+ 					#option with value. value can be string or scalar
+-					if isinstance(option[1],float):
+-						string="%s%s%s%s%s"%(string," -",option[0]," ","%g"%(option[1]))
+-					elif isinstance(option[1],str):
+-						string="%s%s%s%s%s"%(string," -",option[0]," ",option[1])
+-					elif isinstance(option[1],int):
+-						string="%s%s%s%s%s"%(string," -",option[0]," ","%i"%(option[1]))
++					if   isinstance(optionvalue,(bool,int,float)):
++						fid.write("-%s %g\n" % (optionname,optionvalue))
++					elif isinstance(optionvalue,str):
++						fid.write("-%s %s\n" % (optionname,optionvalue))
+ 					else:
+-						raise RuntimeError("%s%s%s"%("PetscString error: option #","%i"%(i)," is not well formatted"))
+-				else:
+-					raise RuntimeError("%s%s%s"%("PetscString error: option #","%i"%(i)," is not well formatted"))
++						raise TypeError("PetscFile error: option '%s' is not well formatted." % optionname)
+ 
+-			string2="%s\n%s"%(string2,"   %s -> '%s'"%(analysis,string))
+-		return string2
+-	#}}}
++		fid.close()
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class flaim:
++class flaim(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/steadystate.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/steadystate.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/steadystate.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class steadystate:
++class steadystate(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py	(revision 12958)
+@@ -4,7 +4,14 @@
+ from checkfield import *
+ from WriteData import *
+ 
+-class geometry:
++class geometry(object):
++	"""
++	GEOMETRY class definition
++
++	   Usage:
++	      geometry=geometry();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -18,22 +25,22 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 
+ 		string="   geometry parameters:"
+ 
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'surface','surface elevation'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'thickness','ice thickness'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'bed','bed elevation'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'bathymetry','bathymetry elevation'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'hydrostatic_ratio','coefficient for ice shelves'' thickness correction: hydrostatic_ratio H_obs+ (1-hydrostatic_ratio) H_hydro'))
++		string="%s\n\n%s"%(string,fielddisplay(self,'surface','surface elevation'))
++		string="%s\n%s"%(string,fielddisplay(self,'thickness','ice thickness'))
++		string="%s\n%s"%(string,fielddisplay(self,'bed','bed elevation'))
++		string="%s\n%s"%(string,fielddisplay(self,'bathymetry','bathymetry elevation'))
++		string="%s\n%s"%(string,fielddisplay(self,'hydrostatic_ratio','coefficient for ice shelves'' thickness correction: hydrostatic_ratio H_obs+ (1-hydrostatic_ratio) H_hydro'))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class qmu:
++class qmu(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class miscellaneous:
++class miscellaneous(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class private:
++class private(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 12958)
+@@ -1,7 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ 
+-class inversion:
++class inversion(object):
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.py	(revision 12958)
+@@ -4,7 +4,14 @@
+ from checkfield import *
+ from WriteData import *
+ 
+-class basalforcings:
++class basalforcings(object):
++	"""
++	BASAL FORCINGS class definition
++
++	   Usage:
++	      basalforcings=basalforcings();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -16,18 +23,18 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string="   basal forcings parameters:"
+ 
+-		string="%s\n\n%s"%(string,fielddisplay(obj,"melting_rate","basal melting rate (positive if melting)"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"melting_rate_correction","additional melting applied when the grounding line retreats"))
+-		string="%s\n%s"%(string,fielddisplay(obj,"geothermalflux","geothermal heat flux [W/m^2]"))
++		string="%s\n\n%s"%(string,fielddisplay(self,"melting_rate","basal melting rate (positive if melting)"))
++		string="%s\n%s"%(string,fielddisplay(self,"melting_rate_correction","additional melting applied when the grounding line retreats"))
++		string="%s\n%s"%(string,fielddisplay(self,"geothermalflux","geothermal heat flux [W/m^2]"))
+ 		return string
+ 		#}}}
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 12957)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 12958)
+@@ -5,7 +5,14 @@
+ from checkfield import *
+ from WriteData import *
+ 
+-class flowequation:
++class flowequation(object):
++	"""
++	FLOWEQUATION class definition
++
++	   Usage:
++	      flowequation=flowequation();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -23,24 +30,24 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   flow equation parameters:'
+ 
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'ismacayealpattyn','is the macayeal or pattyn approximation used ?'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'ishutter','is the shallow ice approximation used ?'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'isstokes','are the Full-Stokes equations used ?'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'vertex_equation','flow equation for each vertex'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'element_equation','flow equation for each element'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'bordermacayeal','vertices on MacAyeal''s border (for tiling)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'borderpattyn','vertices on Pattyn''s border (for tiling)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'borderstokes','vertices on Stokes'' border (for tiling)'))
++		string="%s\n\n%s"%(string,fielddisplay(self,'ismacayealpattyn','is the macayeal or pattyn approximation used ?'))
++		string="%s\n%s"%(string,fielddisplay(self,'ishutter','is the shallow ice approximation used ?'))
++		string="%s\n%s"%(string,fielddisplay(self,'isstokes','are the Full-Stokes equations used ?'))
++		string="%s\n%s"%(string,fielddisplay(self,'vertex_equation','flow equation for each vertex'))
++		string="%s\n%s"%(string,fielddisplay(self,'element_equation','flow equation for each element'))
++		string="%s\n%s"%(string,fielddisplay(self,'bordermacayeal','vertices on MacAyeal''s border (for tiling)'))
++		string="%s\n%s"%(string,fielddisplay(self,'borderpattyn','vertices on Pattyn''s border (for tiling)'))
++		string="%s\n%s"%(string,fielddisplay(self,'borderstokes','vertices on Stokes'' border (for tiling)'))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
Index: /issm/oecreview/Archive/12678-13393/ISSM-12958-12959.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12958-12959.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12958-12959.diff	(revision 13394)
@@ -0,0 +1,85 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m	(revision 12958)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m	(revision 12959)
+@@ -71,13 +71,13 @@
+ if (numprocs<rank), numprocs=1; end
+ % }}}
+ %GET ids  {{{1
+-list=dir;%use dir, as it seems to act OS independent
++flist=dir;%use dir, as it seems to act OS independent
+ list_ids=[];
+-for i=1:numel(list),
+-	if ( strncmp(list(i).name,'test',4) &...                         %File name must start with 'test'
+-			strncmp(fliplr(list(i).name),fliplr('.m'),2)&...           %File name must end by '.m'
+-			~strcmp(list(i).name,'test.m'))                            %File name must be different than 'test.m'
+-		list_ids(end+1)=eval(list(i).name(5:end-2));                  %Keep test id only (skip 'test' and '.m')
++for i=1:numel(flist),
++	if ( strncmp(flist(i).name,'test',4) &...                         %File name must start with 'test'
++			strncmp(fliplr(flist(i).name),fliplr('.m'),2)&...           %File name must end by '.m'
++			~strcmp(flist(i).name,'test.m'))                            %File name must be different than 'test.m'
++		list_ids(end+1)=eval(flist(i).name(5:end-2));                  %Keep test id only (skip 'test' and '.m')
+ 	end
+ end
+ [i1,i2]=parallelrange(rank,numprocs,length(list_ids));               %Get tests for this cpu only
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m	(revision 12958)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m	(revision 12959)
+@@ -134,13 +134,13 @@
+ 
+ 		%rule out elements that don't touch the 2 boundaries
+ 		pos=find(macayealpattynflag);
+-		list=zeros(length(pos),1);
+-		list = list + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
+-		list = list - any(sum(nodeonpattyn(md.mesh.elements(pos,:))  ,2),2);
+-		pos1=find(list==1);
++		elist=zeros(length(pos),1);
++		elist = elist + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
++		elist = elist - any(sum(nodeonpattyn(md.mesh.elements(pos,:))  ,2),2);
++		pos1=find(elist==1);
+ 		macayealflag(pos(pos1))=1;
+ 		macayealpattynflag(pos(pos1))=0;
+-		pos2=find(list==-1);
++		pos2=find(elist==-1);
+ 		pattynflag(pos(pos2))=1;
+ 		macayealpattynflag(pos(pos2))=0;
+ 
+@@ -166,13 +166,13 @@
+ 
+ 		%rule out elements that don't touch the 2 boundaries
+ 		pos=find(pattynstokesflag);
+-		list=zeros(length(pos),1);
+-		list = list + any(sum(nodeonstokes(md.mesh.elements(pos,:)),2),2);
+-		list = list - any(sum(nodeonpattyn(md.mesh.elements(pos,:)),2),2);
+-		pos1=find(list==1);
++		elist=zeros(length(pos),1);
++		elist = elist + any(sum(nodeonstokes(md.mesh.elements(pos,:)),2),2);
++		elist = elist - any(sum(nodeonpattyn(md.mesh.elements(pos,:)),2),2);
++		pos1=find(elist==1);
+ 		stokesflag(pos(pos1))=1;
+ 		pattynstokesflag(pos(pos1))=0;
+-		pos2=find(list==-1);
++		pos2=find(elist==-1);
+ 		pattynflag(pos(pos2))=1;
+ 		pattynstokesflag(pos(pos2))=0;
+ 
+@@ -198,13 +198,13 @@
+ 
+ 		%rule out elements that don't touch the 2 boundaries
+ 		pos=find(macayealstokesflag);
+-		list=zeros(length(pos),1);
+-		list = list + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
+-		list = list - any(sum(nodeonstokes(md.mesh.elements(pos,:))  ,2),2);
+-		pos1=find(list==1);
++		elist=zeros(length(pos),1);
++		elist = elist + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
++		elist = elist - any(sum(nodeonstokes(md.mesh.elements(pos,:))  ,2),2);
++		pos1=find(elist==1);
+ 		macayealflag(pos(pos1))=1;
+ 		macayealstokesflag(pos(pos1))=0;
+-		pos2=find(list==-1);
++		pos2=find(elist==-1);
+ 		stokesflag(pos(pos2))=1;
+ 		macayealstokesflag(pos(pos2))=0;
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12959-12960.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12959-12960.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12959-12960.diff	(revision 13394)
@@ -0,0 +1,55 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.m	(revision 12959)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.m	(revision 12960)
+@@ -135,7 +135,7 @@
+ 	field2=reshape(field,prod(size(field)),1);
+ 	if any(field2<lowerbound),
+ 		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should have values above ' num2str(lowerbound)]));
++			['field ''' fieldname ''' should have values above ' num2str(lowerbound(1,1))]));
+ 	end
+ end
+ if exist(options,'>')
+@@ -143,7 +143,7 @@
+ 	field2=reshape(field,prod(size(field)),1);
+ 	if any(field2<=lowerbound),
+ 		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should have values above ' num2str(lowerbound)]));
++			['field ''' fieldname ''' should have values above ' num2str(lowerbound(1,1))]));
+ 	end
+ end
+ 
+@@ -153,7 +153,7 @@
+ 	field2=reshape(field,prod(size(field)),1);
+ 	if any(field2>upperbound),
+ 		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should have values below ' num2str(upperbound)]));
++			['field ''' fieldname ''' should have values below ' num2str(upperbound(1,1))]));
+ 	end
+ end
+ if exist(options,'<')
+@@ -161,7 +161,7 @@
+ 	field2=reshape(field,prod(size(field)),1);
+ 	if any(field2>=upperbound),
+ 		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should have values below ' num2str(upperbound)]));
++			['field ''' fieldname ''' should have values below ' num2str(upperbound(1,1))]));
+ 	end
+ end
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m	(revision 12959)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m	(revision 12960)
+@@ -86,6 +86,10 @@
+ 			md = checkfield(md,'mesh.elementonsurface','size',[md.mesh.numberofelements 1],'values',[0 1]);
+ 			md = checkfield(md,'mesh.vertexonbed','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 			md = checkfield(md,'mesh.vertexonsurface','size',[md.mesh.numberofvertices 1],'values',[0 1]);
++			if (md.mesh.dimension==3),
++				md = checkfield(md,'mesh.z','>=',md.geometry.bed,'message','''mesh.z'' should be above the bed');
++				md = checkfield(md,'mesh.z','<=',md.geometry.surface,'message','''mesh.z'' should be below the ice surface');
++			end
+ 			if (md.mesh.dimension==2),
+ 				md = checkfield(md,'mesh.average_vertex_connectivity','>=',9,'message','''mesh.average_vertex_connectivity'' should be at least 9 in 2d');
+ 			else
Index: /issm/oecreview/Archive/12678-13393/ISSM-12960-12961.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12960-12961.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12960-12961.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expdisp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expdisp.m	(revision 12960)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expdisp.m	(revision 12961)
+@@ -44,5 +44,9 @@
+ 
+ figure(figurenumber),hold on
+ for i=1:length(domain),
+-	plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,linestyle,'linewidth',linewidth);
++	if (isnumeric(linestyle))
++		plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'Color',linestyle,'linewidth',linewidth);
++	else
++		plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,linestyle,'linewidth',linewidth);
++	end
+ end
Index: /issm/oecreview/Archive/12678-13393/ISSM-12961-12962.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12961-12962.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12961-12962.diff	(revision 13394)
@@ -0,0 +1,34 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/applyoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/applyoptions.m	(revision 12961)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/applyoptions.m	(revision 12962)
+@@ -197,8 +197,28 @@
+ 		set(c,'Position',position);
+ 		set(gca,'Position',posaxes);
+ 	end
++	if exist(options,'cbYTickLabel');
++		tick_vals=getfieldvalue(options,'cbYTickLabel');
++		if ~isnumeric(tick_vals) & strcmp(tick_vals,'on')
++			tick_vals=get(c,'YTick')';
++			if exist(options,'log')
++				logval= getfieldvalue(options,'log');
++				for i= 1:size(tick_vals,1)
++					tick_vals(i)= logval^(tick_vals(i));
++				end
++			elseif size(tick_vals,1) == 3
++				tick_vals=[tick_vals(1); mean(tick_vals(1:2)); tick_vals(2); ...
++					mean(tick_vals(2:3)); tick_vals(3)];
++				set(c,'YTick',tick_vals);
++			end
++		end
++		labels = cell(1,size(tick_vals,1));
++		for i = 1:size(tick_vals,1)
++			labels{i} = sprintf('%-3.4g',round_ice(tick_vals(i),2));
++		end
++		set(c,'YTickLabel',labels);
++	end
+ 
+-
+ elseif getfieldvalue(options,'colorbar',1)==0,
+ 	colorbar('off');
+ else
Index: /issm/oecreview/Archive/12678-13393/ISSM-12962-12963.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12962-12963.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12962-12963.diff	(revision 13394)
@@ -0,0 +1,49 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/install.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/install.sh	(revision 12963)
+@@ -0,0 +1,24 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf src
++rm -rf pysvn-1.7.6
++mkdir src 
++
++export CC=/usr/local/gfortran/bin/gcc
++export CXX=/usr/local/gfortran/bin/g++
++export FFLAGS=-ff2c
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/pysvn-1.7.6.tar.gz' 'pysvn-1.7.6.tar.gz'
++
++#Untar 
++tar -zxvf  pysvn-1.7.6.tar.gz
++
++#Move pysvn into src directory
++mv pysvn-1.7.6/* src
++rm -rf pysvn-1.7.6
++
++$install
++cd src
++python setup.py install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/pysvn-1.7.6.tar.gz
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/pysvn-1.7.6.tar.gz
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/pysvn-1.7.6.tar.gz	(revision 12962)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/pysvn-1.7.6.tar.gz	(revision 12963)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/pysvn-1.7.6.tar.gz
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12963-12964.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12963-12964.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12963-12964.diff	(revision 13394)
@@ -0,0 +1,4 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/pysvn-1.7.6.tar.gz
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12964-12965.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12964-12965.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12964-12965.diff	(revision 13394)
@@ -0,0 +1,40 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh	(revision 12965)
+@@ -0,0 +1,29 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf src
++rm -rf install
++rm -rf subversion-1.6.18
++mkdir src install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/subversion-1.6.18.tar.gz' 'subversion-1.6.18.tar.gz'
++
++#Untar 
++tar -zxvf  subversion-1.6.18.tar.gz
++
++#Move subversion into src directory
++mv subversion-1.6.18/* src
++rm -rf subversion-1.6.18
++
++#Configure subversion
++cd src
++./configure --prefix="$ISSM_DIR/externalpackages/svn/install" 
++
++#Compile and install subversion
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++sudo make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12965-12966.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12965-12966.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12965-12966.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12965)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12966)
+@@ -327,3 +327,11 @@
+ 	export LIBRARY_PATH="$LIBRARY_PATH:$HDF5_DIR/lib"
+ 	export C_INCLUDE_PATH="$C_INCLUDE_PATH:$HDF5_DIR/include"
+ fi
++
++#SVN
++SVN_DIR=$ISSM_DIR/externalpackages/svn/install
++if [ -d "$SVN_DIR" ]; then
++	export PATH="$SVN_DIR/bin:$PATH"
++	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SVN_DIR/lib"
++	export LIBRARY_PATH="$LIBRARY_PATH:$SVN_DIR/lib"
++fi
Index: /issm/oecreview/Archive/12678-13393/ISSM-12966-12967.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12966-12967.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12966-12967.diff	(revision 13394)
@@ -0,0 +1,40 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr/install.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr/install.sh	(revision 12967)
+@@ -0,0 +1,29 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf src
++rm -rf install
++rm -rf apr-1.4.6
++mkdir src install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/apr-1.4.6.tar.gz' 'apr-1.4.6.tar.gz'
++
++#Untar 
++tar -zxvf  apr-1.4.6.tar.gz
++
++#Move apr into src directory
++mv apr-1.4.6/* src
++rm -rf apr-1.4.6
++
++#Configure apr
++cd src
++./configure  --prefix="$ISSM_DIR/externalpackages/apr/install" 
++
++#Compile and install apr
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12967-12968.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12967-12968.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12967-12968.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12967)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12968)
+@@ -335,3 +335,11 @@
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SVN_DIR/lib"
+ 	export LIBRARY_PATH="$LIBRARY_PATH:$SVN_DIR/lib"
+ fi
++
++#APR
++APR_DIR=$ISSM_DIR/externalpackages/apr/install
++if [ -d "$APR_DIR" ]; then
++	export PATH="$APR_DIR/bin:$PATH"
++	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APR_DIR/lib"
++	export LIBRARY_PATH="$LIBRARY_PATH:$APR_DIR/lib"
++fi
Index: /issm/oecreview/Archive/12678-13393/ISSM-12968-12969.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12968-12969.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12968-12969.diff	(revision 13394)
@@ -0,0 +1,40 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util/install.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util/install.sh	(revision 12969)
+@@ -0,0 +1,29 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf src
++rm -rf install
++rm -rf apr-util-1.4.1
++mkdir src install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/apr-util-1.4.1.tar.gz' 'apr-util-1.4.1.tar.gz'
++
++#Untar 
++tar -zxvf  apr-util-1.4.1.tar.gz
++
++#Move apr-util into src directory
++mv apr-util-1.4.1/* src
++rm -rf apr-util-1.4.1
++
++#Configure apr-util
++cd src
++./configure  --prefix="$ISSM_DIR/externalpackages/apr-util/install" --with-apr="$ISSM_DIR/externalpackages/apr/install"
++
++#Compile and install apr-util
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12969-12970.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12969-12970.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12969-12970.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12969)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12970)
+@@ -343,3 +343,11 @@
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APR_DIR/lib"
+ 	export LIBRARY_PATH="$LIBRARY_PATH:$APR_DIR/lib"
+ fi
++
++#APR_UTIL
++APR_UTIL_DIR=$ISSM_DIR/externalpackages/apr-util/install
++if [ -d "$APR_UTIL_DIR" ]; then
++	export PATH="$APR_UTIL_DIR/bin:$PATH"
++	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APR_UTIL_DIR/lib"
++	export LIBRARY_PATH="$LIBRARY_PATH:$APR_UTIL_DIR/lib"
++fi
Index: /issm/oecreview/Archive/12678-13393/ISSM-12970-12971.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12970-12971.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12970-12971.diff	(revision 13394)
@@ -0,0 +1,18 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12970)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12971)
+@@ -351,3 +351,13 @@
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APR_UTIL_DIR/lib"
+ 	export LIBRARY_PATH="$LIBRARY_PATH:$APR_UTIL_DIR/lib"
+ fi
++
++#SQLITE
++SQLITE_DIR=$ISSM_DIR/externalpackages/sqlite/install
++if [ -d "$SQLITE_DIR" ]; then
++	export PATH="$SQLITE_DIR/bin:$PATH"
++	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SQLITE_DIR/lib"
++	export LIBRARY_PATH="$LIBRARY_PATH:$SQLITE_DIR/lib"
++fi
++
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12971-12972.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12971-12972.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12971-12972.diff	(revision 13394)
@@ -0,0 +1,40 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite/install.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite/install.sh	(revision 12972)
+@@ -0,0 +1,29 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf src
++rm -rf install
++rm -rf sqlite-autoconf-3071300
++mkdir src install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/sqlite-autoconf-3071300.tar.gz' 'sqlite-autoconf-3071300.tar.gz'
++
++#Untar 
++tar -zxvf  sqlite-autoconf-3071300.tar.gz
++
++#Move sqlite-autoconf into src directory
++mv sqlite-autoconf-3071300/* src
++rm -rf sqlite-autoconf-3071300
++
++#Configure sqlite-autoconf
++cd src
++./configure  --prefix="$ISSM_DIR/externalpackages/sqlite/install" 
++
++#Compile and install sqlite-autoconf
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12972-12973.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12972-12973.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12972-12973.diff	(revision 13394)
@@ -0,0 +1,19 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh	(revision 12972)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh	(revision 12973)
+@@ -18,7 +18,7 @@
+ 
+ #Configure subversion
+ cd src
+-./configure --prefix="$ISSM_DIR/externalpackages/svn/install" 
++./configure --prefix="$ISSM_DIR/externalpackages/svn/install"  --with-sqlite="$ISSM_DIR/externalpackages/sqlite/install"
+ 
+ #Compile and install subversion
+ if [ -z $1 ]; then
+@@ -26,4 +26,4 @@
+ else
+ 	make -j $1
+ fi
+-sudo make install
++make install
Index: /issm/oecreview/Archive/12678-13393/ISSM-12973-12974.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12973-12974.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12973-12974.diff	(revision 13394)
@@ -0,0 +1,535 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh	(revision 12973)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.sh	(revision 12974)
+@@ -1,212 +0,0 @@
+-#
+-#
+-#This routine can only be run if the ISSM_DIR variable has been correctly set!
+-#
+-#
+-
+-#MATLAB
+-MATLAB_DIR="$ISSM_DIR/externalpackages/matlab/install"
+-
+-#MPI
+-MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install"
+-
+-#PETSC
+-PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"
+-
+-#SLEPC
+-SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install"
+-
+-#Dakota
+-DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"
+-
+-#Qhull
+-QHULL_DIR="$ISSM_DIR/externalpackages/qhull/install"
+-
+-#Doxygen
+-DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install"
+-
+-#MTOC
+-MTOC_DIR="$ISSM_DIR/externalpackages/mtoc/install"
+-
+-#Triangle
+-TRIANGLE_DIR="$ISSM_DIR/externalpackages/triangle/install"
+-
+-#METIS
+-METIS_DIR="$ISSM_DIR/externalpackages/metis/install"
+-
+-#BLAS
+-BLAS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack"
+-
+-#LAPACK
+-LAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH"
+-
+-#SCALAPACK
+-SCALAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH"
+-
+-#PLAPACK
+-PLAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32"
+-
+-#BLACS
+-BLACS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH"
+-
+-#sowing
+-SOWING_DIR="$ISSM_DIR/externalpackages/sowing/install"
+-
+-#BLACS
+-BLACS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH"
+-
+-#YAMS
+-YAMS_DIR="$ISSM_DIR/externalpackages/yams/install"
+-
+-#BAMG
+-BAMG_DIR="$ISSM_DIR/externalpackages/bamg/install"
+-
+-#Chaco
+-CHACO_DIR="$ISSM_DIR/externalpackages/chaco/install"
+-
+-#MeshPart
+-MESHPART_DIR="$ISSM_DIR/externalpackages/meshpart/install"
+-
+-#SCOTCH
+-SCOTCH_DIR="$ISSM_DIR/externalpackages/scotch/install"
+-
+-#Development packages
+-#automake
+-AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install"
+-
+-#libtool
+-LIBTOOL_DIR="$ISSM_DIR/externalpackages/libtool/install"
+-
+-#autoconf
+-AUTOCONF_DIR="$ISSM_DIR/externalpackages/autoconf/install"
+-
+-#borland
+-#BORLAND_DIR="/cygdrive/c/Borland/"
+-
+-#intel
+-#INTEL_DIR="C:/IntelInstall/Compiler/11.1/038/bin/ia32/"
+-
+-#TEX2IM			 
+-TEX2IM_DIR="$ISSM_DIR/externalpackages/tex2im/install" 
+-
+-#sdk
+-#SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU"
+-
+-#ssh 
+-SSH_DIR="$ISSM_DIR/externalpackages/ssh"
+-
+-#valgrind
+-VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install/bin"
+-
+-#graphviz
+-GRAPHVIZ_DIR="$ISSM_DIR/externalpackages/graphviz/install/bin"
+-
+-#cppcheck
+-CPPCHECK_DIR="$ISSM_DIR/externalpackages/cppcheck/install"
+-
+-#gdal
+-GDAL_DIR="$ISSM_DIR/externalpackages/gdal/install"
+-
+-#mercurial
+-MERCURIAL_DIR="$ISSM_DIR/externalpackages/mercurial/install"
+-
+-#boost
+-BOOST_DIR="$ISSM_DIR/externalpackages/boost/install"
+-BOOSTROOT="$ISSM_DIR/externalpackages/boost/install"
+-
+-#OpenAnalysis
+-OPENANALYSISROOT="$ISSM_DIR/externalpackages/openanalysis/install"
+-
+-#xerces
+-XERCESROOT="$ISSM_DIR/externalpackages/xerces/install"
+-XERCESCROOT="$ISSM_DIR/externalpackages/xerces/src"
+-
+-#xaifBooster
+-XAIFBOOSTERROOT="$ISSM_DIR/externalpackages/xaifbooster/"
+-XAIF_DIR="$ISSM_DIR/externalpackages/xaifbooster/xaifBooster"
+-XAIFBOOSTER_HOME="$ISSM_DIR/externalpackages/xaifbooster/xaifBooster"
+-PLATFORM=x86-Linux
+-
+-#angel
+-ANGELROOT="$ISSM_DIR/externalpackages/angel/angel"
+-
+-#java
+-JVM_DIR=/usr/local/gcc/4.3.2/lib64/gcj-4.3.2-9/
+-
+-#bbftp
+-BBFTP_DIR="$ISSM_DIR/externalpackages/bbftp/install"
+-
+-#adic2
+-ADIC_DIR="$ISSM_DIR/externalpackages/adic/install"
+-
+-#colpack
+-COLPACK_DIR="$ISSM_DIR/externalpackages/colpack/install"
+-
+-#eclipse
+-ECLIPSE_DIR="$ISSM_DIR/externalpackages/eclipse/install"
+-
+-#flaim
+-FLAIM_DIR="$ISSM_DIR/externalpackages/flaim/install"
+-
+-#appscan
+-APPSCAN_DIR="$ISSM_DIR/externalpackages/appscan"
+-
+-#cppcheck
+-CPPCHECK_DIR="$ISSM_DIR/externalpackages/cppcheck/install"
+-
+-#rats
+-RATS_DIR="$ISSM_DIR/externalpackages/rats/install"
+-
+-#dyson
+-DYSON_DIR="$ISSM_DIR/externalpackages/dyson/"
+-
+-#cmake
+-CMAKE_DIR="$ISSM_DIR/externalpackages/cmake/install"
+-
+-#shapelib
+-SHAPELIB_DIR="$ISSM_DIR/externalpackages/shapelib/install"
+-
+-#cccl
+-CCCL_DIR="$ISSM_DIR/externalpackages/cccl/install"
+-
+-#packagemaker
+-PACKAGEMAKER_DIR="$ISSM_DIR/externalpackages/packagemaker/install"
+-
+-#android-dev-dir
+-ANDROID_DIR="$ISSM_DIR/externalpackages/android"
+-
+-#android-ndk
+-ANDROID_NDK_DIR="$ANDROID_DIR/android-ndk/install"
+-
+-#android-sdk
+-ANDROID_SDK_DIR="$ANDROID_DIR/android-sdk/install-sdk"
+-
+-#gsl
+-GSL_DIR="$ISSM_DIR/externalpackages/gsl/install"
+-
+-#gnu make
+-GMAKE_DIR="$ISSM_DIR/externalpackages/gmake/install"
+-
+-#PYTHON
+-PYTHON_VER=2.7
+-PYTHON_DIR="$ISSM_DIR/externalpackages/python/install"
+-PYTHONSTARTUP="$ISSM_DIR/startup.py"
+-
+-#MODELE
+-MODELE_DIR="$ISSM_DIR/externalpackages/modelE"
+-
+-
+-#GIT
+-GIT_DIR="$ISSM_DIR/externalpackages/git"
+-
+-#NCVIEW
+-NCVIEW_DIR="$ISSM_DIR/externalpackages/ncview"
+-
+-#TCLX
+-TCLX_DIR="$ISSM_DIR/externalpackages/tclx/install/lib/tclx8.4"
+-
+-#ASPELL
+-ASPELL_DIR="$ISSM_DIR/externalpackages/aspell/"
+-
+-#HDF5
+-export HDF5_DIR=$ISSM_DIR/externalpackages/hdf5/install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.csh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.csh	(revision 12973)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment_variables.csh	(revision 12974)
+@@ -1,93 +0,0 @@
+-#
+-#
+-#This routine can only be run if the ISSM_DIR variable has been correctly set!
+-#
+-#
+-
+-#MATLAB
+-set MATLAB_DIR={$ISSM_DIR}/externalpackages/matlab/install
+-
+-#MPI
+-set MPI_DIR={$ISSM_DIR}/externalpackages/mpich2/install
+-
+-#PETSC
+-set PETSC_DIR={$ISSM_DIR}/externalpackages/petsc/install
+-
+-#SLEPC
+-set SLEPC_DIR={$ISSM_DIR}/externalpackages/slepc/install
+-
+-#Dakota
+-set DAKOTA_DIR={$ISSM_DIR}/externalpackages/dakota/install
+-
+-#Qhull
+-set QHULL_DIR={$ISSM_DIR}/externalpackages/qhull/install
+-
+-#Doxygen
+-set DOXYGEN_DIR={$ISSM_DIR}/externalpackages/doxygen/install
+-
+-#MTOC
+-set MTOC_DIR={$ISSM_DIR}/externalpackages/mtoc/install
+-
+-#Triangle
+-set TRIANGLE_DIR={$ISSM_DIR}/externalpackages/triangle/install
+-
+-#METIS
+-set METIS_DIR={$ISSM_DIR}/externalpackages/metis/install
+-
+-#BLAS
+-set BLAS_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/fblaslapack
+-
+-#LAPACK
+-set LAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/fblaslapack/$ISSM_ARCH
+-
+-#SCALAPACK
+-set SCALAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/SCALAPACK/$ISSM_ARCH
+-
+-#PLAPACK
+-set PLAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/PLAPACKR32
+-
+-#BLACS
+-set BLACS_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/blacs-dev/$ISSM_ARCH
+-
+-#sowing
+-set SOWING_DIR={$ISSM_DIR}/externalpackages/sowing/install
+-
+-#YAMS
+-set YAMS_DIR={$ISSM_DIR}/externalpackages/yams/install
+-
+-#TEX2IM
+-set TEX2IM_DIR={$ISSM_DIR}/externalpackages/tex2im/install
+-
+-#Chaco
+-set CHACO_DIR={$ISSM_DIR}/externalpackages/chaco/install
+-
+-#MeshPart
+-set MESHPART_DIR={$ISSM_DIR}/externalpackages/meshpart/install
+-
+-#SCOTCH
+-set SCOTCH_DIR={$ISSM_DIR}/externalpackages/scotch/install
+-
+-#Development packages
+-#automake
+-set AUTOMAKE_DIR={$ISSM_DIR}/externalpackages/automake/install
+-
+-#autoconf
+-set AUTOCONF_DIR={$ISSM_DIR}/externalpackages/autoconf/install
+-
+-#borland
+-set BORLAND_DIR=/cygdrive/c/Borland
+-
+-#ssh
+-set SSH_DIR={$ISSM_DIR}/externalpackages/ssh
+-
+-#mercurial
+-set MERCURIAL_DIR={$ISSM_DIR}/externalpackages/mercurial/install
+-
+-#valgrind
+-set VALGRIND_DIR={$ISSM_DIR}/externalpackages/valgrind/install/bin
+-
+-#gsl
+-set GSL_DIR={$ISSM_DIR}/externalpackages/gsl/install
+-
+-#cmake
+-set CMAKE_DIR={$ISSM_DIR}/externalpackages/cmake/install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh	(revision 12973)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh	(revision 12974)
+@@ -1,140 +1,91 @@
+ #ISSM_DIR and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...)
+-source $ISSM_DIR/etc/environment_variables.csh
+ 
+-#Do we have any command line arguments? (such as MATLAB_DIR=otherdirthandefault), source them before exporting the variables 
+-#to environment.
+-
+-#foreach i ($@)
+-#eval $i
+-#end
+-
+-#CRON utilities
+-setenv PATH {$PATH}:{$ISSM_DIR}/cron
+-
+-#SCRIPTS utilities
++#Load ISSM scripts
+ setenv PATH {$PATH}:{$ISSM_DIR}/scripts
+ 
+ #MATLAB
+-setenv MATLAB_DIR {$MATLAB_DIR}
+-setenv PATH {$MATLAB_DIR}/bin:{$PATH}
+-setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$MATLAB_DIR/lib
++set MATLAB_DIR="$ISSM_DIR/externalpackages/matlab/install"
++if (-d MATLAB_DIR) then
++	setenv MATLAB_DIR {$MATLAB_DIR}
++	setenv PATH {$MATLAB_DIR}/bin:{$PATH}
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$MATLAB_DIR}/bin/glnxa64
++endif
+ 
+ #MPI
+-setenv MPI_DIR {$MPI_DIR}
+-setenv PATH {$MPI_DIR}/bin:{$PATH}
+-setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$MPI_DIR/lib
+-setenv MANPATH {$MANPATH}:$MPI_DIR/man
+-setenv MPIRUN_NPROCS 8
++set MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install"
++if (-d $MPI_DIR) then
++	setenv MPI_DIR {$MPI_DIR}
++	setenv PATH {$MPI_DIR}/bin:{$PATH}
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$MPI_DIR/lib
++	setenv MANPATH {$MANPATH}:$MPI_DIR/man
++endif
+ 
+ #PETSC
+-setenv PETSC_DIR {$PETSC_DIR}
+-setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$PETSC_DIR/lib/{$ISSM_ARCH}
++set PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"
++if (-d $PETSC_DIR) then
++	setenv PETSC_DIR {$PETSC_DIR}
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$PETSC_DIR/lib/{$ISSM_ARCH}
++endif
+ 
+ #SLEPC
+-setenv SLEPC_DIR {$SLEPC_DIR}
+-setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SLEPC_DIR/lib/{$ISSM_ARCH}
++set SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install"
++if (-d $SLEPC_DIR) then
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SLEPC_DIR/lib/{$ISSM_ARCH}
++endif
+ 
+-
+ #Dakota
+-setenv DAKOTA_DIR {$DAKOTA_DIR}
+-setenv PATH {$PATH}:{$DAKOTA_DIR}/bin
+-setenv MANPATH {$MANPATH}:{$MPI_DIR}/man:{$DAKOTA_DIR}/docs/man:{$DAKOTA_DIR}/docs/man-ref
++set DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"
++if (-d $DAKOTA_DIR) then
++	setenv PATH {$PATH}:{$DAKOTA_DIR}/bin
++	setenv MANPATH {$MANPATH}:{$MPI_DIR}/man:{$DAKOTA_DIR}/docs/man:{$DAKOTA_DIR}/docs/man-ref
++endif
+ 
+-#Qhull
+-setenv QHULL_DIR {$QHULL_DIR}
+-setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$QHULL_DIR}/lib
+-
+-
+ #Doxygen
+-setenv DOXYGEN_DIR {$DOXYGEN_DIR}
+-setenv MANPATH {$MANPATH}:{$DOXYGEN_DIR}/man
+-setenv PATH {$PATH}:{$DOXYGEN_DIR}/bin
++set DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install"
++if (-d $DOXYGEN_DIR) then
++	setenv MANPATH {$MANPATH}:{$DOXYGEN_DIR}/man
++	setenv PATH {$PATH}:{$DOXYGEN_DIR}/bin
++endif
+ 
+-#MTOC
+-setenv MTOC_DIR {$MTOC_DIR}
+-setenv PATH {$PATH}:{$MTOC_DIR}
+-
+-#MATLAB
+-setenv MATLAB_DIR {$MATLAB_DIR}
+-setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$MATLAB_DIR}/bin/glnxa64
+-setenv PATH {$PATH}:{$MATLAB_DIR}/bin
+-
+-#TRIANGLE
+-setenv TRIANGLE_DIR {$TRIANGLE_DIR}
+-
+-#METIS
+-setenv METIS_DIR {$METIS_DIR}
+-	
+-#BLAS
+-setenv BLAS_DIR {$BLAS_DIR}
+-
+-#LAPACK
+-setenv LAPACK_DIR {$LAPACK_DIR}
+-
+-#SCALAPACK
+-setenv SCALAPACK_DIR {$SCALAPACK_DIR}
+-
+-#PLAPACK
+-setenv PLAPACK_DIR {$PLAPACK_DIR}
+-
+-#BLACS
+-setenv BLACS_DIR {$BLACS_DIR}
+-
+-#YAMS
+-setenv YAMS_DIR {$YAMS_DIR}
+-setenv PATH {$PATH}:{$YAMS_DIR}
+-
+-#TEX2IM
+-setenv TEX2IM_DIR {$TEX2IM_DIR}
+-setenv PATH {$PATH}:{$TEX2IM_DIR}
+-
+-#SOWING
+-setenv SOWING_DIR {$SOWING_DIR}
+-setenv PATH {$PATH}:{$SOWING_DIR}/bin
+-setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SOWING_DIR}/lib
+-setenv MANPATH {$MANPATH}:{$SOWING_DIR}/man
+-
+-#Chaco
+-setenv CHACO_DIR {$CHACO_DIR}
+-setenv PATH {$PATH}:{$CHACO_DIR}
+-
+-#MeshPart
+-setenv MESHPART_DIR {$MESHPART_DIR}
+-setenv PATH {$PATH}:{$MESHPART_DIR}
+-
+-#SCOTCH
+-setenv SCOTCH_DIR {$SCOTCH_DIR}
+-setenv PATH {$PATH}:{$SCOTCH_DIR}
+-setenv MANPATH {$MANPATH}:{$SCOTCH_DIR}/man
+-
+ #AUTOCONF
+-setenv AUTOCONF_DIR {$AUTOCONF_DIR}
+-setenv PATH {$AUTOCONF_DIR}/bin:{$PATH}
++set AUTOCONF_DIR="$ISSM_DIR/externalpackages/autoconf/install"
++if (-d $AUTOCONF_DIR) then
++	setenv PATH {$AUTOCONF_DIR}/bin:{$PATH}
++endif
+ 
+ #AUTOMAKE
+-setenv AUTOMAKE_DIR {$AUTOMAKE_DIR}
+-setenv PATH {$AUTOMAKE_DIR}/bin:{$PATH}
++set AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install"
++if (-d $AUTOMAKE_DIR) then
++	setenv PATH {$AUTOMAKE_DIR}/bin:{$PATH}
++endif
+ 
+-#BORLAND
+-setenv BORLAND_DIR {$BORLAND_DIR}
+-setenv PATH {$PATH}:{$BORLAND_DIR}/Bin
+-
+ #SSH
+-setenv SSH_DIR {$SSH_DIR}
+-setenv PATH {$PATH}:{$SSH_DIR}
++set SSH_DIR="$ISSM_DIR/externalpackages/ssh"
++if (-d $SSH_DIR) then
++	setenv PATH {$PATH}:{$SSH_DIR}
++endif
+ 
+ #VALGRIND
+-setenv VALGRIND_DIR {$VALGRIND_DIR}
+-setenv PATH {$PATH}:{$VALGRIND_DIR}
++set VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install/bin"
++if (-d $VALGRIND_DIR) then
++	setenv PATH {$PATH}:{$VALGRIND_DIR}
++endif
+ 
+ #MERCURIAL
+-#setenv PYTHONPATH {$PYTHONPATH}:{$MERCURIAL_DIR}/mercurial/pure/
+-setenv PYTHONPATH {$MERCURIAL_DIR}/mercurial/pure/
+-setenv PATH {$PATH}:{$MERCURIAL_DIR}
++set MERCURIAL_DIR="$ISSM_DIR/externalpackages/mercurial/install"
++if (-d $MERCURIAL_DIR) then
++	setenv PYTHONPATH {$MERCURIAL_DIR}/mercurial/pure/
++	setenv PATH {$PATH}:{$MERCURIAL_DIR}
++endif
+ 
+ #GSL
+-setenv GSL_DIR {$GSL_DIR}
+-setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_DIR}/lib
++set GSL_DIR="$ISSM_DIR/externalpackages/gsl/install"
++if (-d $GSL_DIR) then
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_DIR}/lib
++endif
+ 
+ #CMAKE
+-setenv PATH {$PATH}:{$CMAKE_DIR}/bin
++set CMAKE_DIR="$ISSM_DIR/externalpackages/cmake/install"
++if (-d $CMAKE_DIR) then
++	setenv PATH {$PATH}:{$CMAKE_DIR}/bin
++endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12973)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12974)
+@@ -5,8 +5,6 @@
+ 	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
+ fi
+ 
+-#source $ISSM_DIR/etc/environment_variables.sh
+-
+ #Some basic path, in case it is not included by default
+ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
+ export LD_RUN_PATH="$LD_RUN_PATH:/usr/local/lib"
Index: /issm/oecreview/Archive/12678-13393/ISSM-12974-12975.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12974-12975.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12974-12975.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12974)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12975)
+@@ -35,8 +35,8 @@
+ PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"
+ if [ -d "$PETSC_DIR" ]; then
+ 	export PETSC_DIR
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PETSC_DIR/lib/$ISSM_ARCH:$PETSC_DIR/lib"
+-	export LD_RUN_PATH="$LD_RUN_PATH:$PETSC_DIR/lib/$ISSM_ARCH"
++	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PETSC_DIR/lib:$PETSC_DIR/lib"
++	export LD_RUN_PATH="$LD_RUN_PATH:$PETSC_DIR/lib"
+ fi
+ 
+ #SLEPC
Index: /issm/oecreview/Archive/12678-13393/ISSM-12975-12976.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12975-12976.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12975-12976.diff	(revision 13394)
@@ -0,0 +1,79 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12975)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12976)
+@@ -4304,7 +4304,7 @@
+ 	IssmDouble  Jdet;
+ 	IssmDouble  xyz_list[NUMVERTICES][3];
+ 	IssmDouble  dp[NDOF2];
+-	IssmDouble  vx,vy;
++	IssmDouble  vx,vy,vel;
+ 	GaussTria  *gauss                    = NULL;
+ 
+ 	/*retrieve parameters and inputs*/
+@@ -4333,6 +4333,9 @@
+ 		thickness_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
+ 		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);
+ 
+ 		/*J = 1/2 ( vx*dH/dx + vy*dH/dy )^2 */
+ 		Jelem+=weight*1/2*(vx*dp[0] + vy*dp[1])*(vx*dp[0] + vy*dp[1])*Jdet*gauss->weight;
+@@ -4353,7 +4356,7 @@
+ 	IssmDouble  Jdet;
+ 	IssmDouble  xyz_list[NUMVERTICES][3];
+ 	IssmDouble  dp[NDOF2];
+-	IssmDouble  vx,vy;
++	IssmDouble  vx,vy,vel;
+ 	GaussTria  *gauss                    = NULL;
+ 
+ 	/*retrieve parameters and inputs*/
+@@ -4382,6 +4385,9 @@
+ 		thickness_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
+ 		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);
+ 
+ 		/*J = 1/2 ( -vy*dH/dx + vx*dH/dy )^2 */
+ 		Jelem+=weight*1/2*(-vy*dp[0] + vx*dp[1])*(-vy*dp[0] + vx*dp[1])*Jdet*gauss->weight;
+@@ -4452,7 +4458,7 @@
+ 	IssmDouble  basis[3];
+ 	IssmDouble  dbasis[NDOF2][NUMVERTICES];
+ 	IssmDouble  dH[2];
+-	IssmDouble  v[2];
++	IssmDouble  vx,vy,vel;
+ 	GaussTria *gauss     = NULL;
+ 	int       *responses = NULL;
+ 
+@@ -4497,15 +4503,21 @@
+ 				break;
+ 			case ThicknessAlongGradientEnum:
+ 				weights_input->GetInputValue(&weight, gauss,resp);
+-				vx_input->GetInputValue(&v[0],gauss);
+-				vy_input->GetInputValue(&v[1],gauss);
+-				for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*v[0]+dH[1]*v[1])*(dbasis[0][i]*v[0]+dbasis[1][i]*v[1])*Jdet*gauss->weight;
++				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<numdof;i++) pe->values[i]+= - weight*(dH[0]*vx+dH[1]*vy)*(dbasis[0][i]*vx+dbasis[1][i]*vy)*Jdet*gauss->weight;
+ 				break;
+ 			case ThicknessAcrossGradientEnum:
+ 				weights_input->GetInputValue(&weight, gauss,resp);
+-				vx_input->GetInputValue(&v[0],gauss);
+-				vy_input->GetInputValue(&v[1],gauss);
+-				for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*(-v[1])+dH[1]*v[0])*(dbasis[0][i]*(-v[1])+dbasis[1][i]*v[0])*Jdet*gauss->weight;
++				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<numdof;i++) pe->values[i]+= - weight*(dH[0]*(-vy)+dH[1]*vx)*(dbasis[0][i]*(-vy)+dbasis[1][i]*vx)*Jdet*gauss->weight;
+ 				break;
+ 			default:
+ 				_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
Index: /issm/oecreview/Archive/12678-13393/ISSM-12976-12977.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12976-12977.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12976-12977.diff	(revision 13394)
@@ -0,0 +1,19 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test225.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test225.m	(revision 12976)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test225.m	(revision 12977)
+@@ -1,9 +1,9 @@
+ md=triangle(model,'../Exp/Square.exp',200000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
++md.geometry.bed=md.geometry.bed+50; md.geometry.surface=md.geometry.surface+50;
+ md=extrude(md,3,1);
+ md=setflowequation(md,'pattyn','all');
+-md.geometry.bed=md.geometry.bed+50; md.geometry.surface=md.geometry.surface+50;
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.prognostic.hydrostatic_adjustment='Incremental';
+ md=solve(md,TransientSolutionEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive225.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-12977-12978.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12977-12978.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12977-12978.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m	(revision 12977)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m	(revision 12978)
+@@ -87,8 +87,8 @@
+ 			md = checkfield(md,'mesh.vertexonbed','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 			md = checkfield(md,'mesh.vertexonsurface','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 			if (md.mesh.dimension==3),
+-				md = checkfield(md,'mesh.z','>=',md.geometry.bed,'message','''mesh.z'' should be above the bed');
+-				md = checkfield(md,'mesh.z','<=',md.geometry.surface,'message','''mesh.z'' should be below the ice surface');
++				md = checkfield(md,'mesh.z','>=',md.geometry.bed-10^-10,'message','''mesh.z'' lower than bedrock');
++				md = checkfield(md,'mesh.z','<=',md.geometry.surface+10^-10,'message','''mesh.z'' higher than surface elevation');
+ 			end
+ 			if (md.mesh.dimension==2),
+ 				md = checkfield(md,'mesh.average_vertex_connectivity','>=',9,'message','''mesh.average_vertex_connectivity'' should be at least 9 in 2d');
Index: /issm/oecreview/Archive/12678-13393/ISSM-12978-12979.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12978-12979.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12978-12979.diff	(revision 13394)
@@ -0,0 +1,100 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processmesh.m	(revision 12978)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processmesh.m	(revision 12979)
+@@ -19,14 +19,14 @@
+ 
+ 	if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
+ 		x=md.mesh.x;
+-		x2d=md.mesh.x2d;
++		if isfield(md.mesh,'x2d'), x2d=md.mesh.x2d; end
+ 		y=md.mesh.y;
+-		y2d=md.mesh.y2d;
++		if isfield(md.mesh,'y2d'), y2d=md.mesh.y2d; end
+ 	else
+ 		x=md.mesh.long;
+-		x2d=md.mesh.x2d;
++		%x2d=md.mesh.x2d; this sounds like something that was forgotten
+ 		y=md.mesh.lat;
+-		y2d=md.mesh.y2d;
++		%y2d=md.mesh.y2d;
+ 	end
+ 
+ 	z_field=getfieldvalue(options,'z',md.mesh.z);
+@@ -39,7 +39,7 @@
+ 	end
+ 
+ 
+-	elements2d=md.mesh.elements2d;
++	if isfield(md.mesh,'elements2d'), elements2d=md.mesh.elements2d; end
+ 	elements=md.mesh.elements;
+ 
+ 	%is it a 2d plot?
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/applyoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/applyoptions.m	(revision 12978)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/applyoptions.m	(revision 12979)
+@@ -8,8 +8,10 @@
+ 		
+ 
+ %some defaults
+-if strcmpi(md.mesh.hemisphere,'n'), options=addfielddefault(options,'hemisphere','n'); 
+-elseif strcmpi(md.mesh.hemisphere,'s'), options=addfielddefault(options,'hemisphere','s'); 
++if isfield(md.mesh,'hemisphere'),
++	if strcmpi(md.mesh.hemisphere,'n'), options=addfielddefault(options,'hemisphere','n'); 
++	elseif strcmpi(md.mesh.hemisphere,'s'), options=addfielddefault(options,'hemisphere','s'); 
++	end
+ end
+ 
+ %fontsize
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processdata.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processdata.m	(revision 12978)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processdata.m	(revision 12979)
+@@ -16,6 +16,15 @@
+ 	error('plotmodel error message: data provided is empty');
+ end
+ 
++%needed later on
++if isfield(md.mesh,'numberofvertices2d'), 
++	numberofvertices2d=md.mesh.numberofvertices2d; 
++	numberofelements2d=md.mesh.numberofelements2d; 
++else 
++	numberofvertices2d=NaN;
++	numberofelements2d=NaN;
++end
++
+ %Process Patch
+ if isstruct(data) 
+ 	if (isfield(data,'index') & isfield(data,'value')),
+@@ -61,10 +70,11 @@
+ 	end
+ 
+ 	%check length
+-	if datasize(1)~=md.mesh.numberofvertices & datasize(1)~=md.mesh.numberofelements & datasize(1)~=md.mesh.numberofvertices*6 & (md.mesh.dimension==3 & ~(datasize(1)==md.mesh.numberofelements2d | datasize(1)==md.mesh.numberofvertices2d))
++	
++	if datasize(1)~=md.mesh.numberofvertices & datasize(1)~=md.mesh.numberofelements & datasize(1)~=md.mesh.numberofvertices*6 & (md.mesh.dimension==3 & ~(datasize(1)==numberofelements2d | datasize(1)==numberofvertices2d))
+ 		error('plotmodel error message: data not supported yet');
+ 	end
+-
++	
+ 	%quiver?
+ 	if datasize(2)>1,
+ 		datatype=3;
+@@ -92,14 +102,14 @@
+ 	end
+ 
+ 	%treat the case datasize(1)=nodes2d
+-	if (md.mesh.dimension==3 & datasize(1)==md.mesh.numberofvertices2d),
++	if (md.mesh.dimension==3 & datasize(1)==numberofvertices2d),
+ 		data=project3d(md,'vector',data,'type','node');
+ 		datasize(1)=md.mesh.numberofvertices;
+ 		%---> go to node data
+ 	end
+ 
+ 	%treat the case datasize(1)=nodes2d
+-	if (md.mesh.dimension==3 & datasize(1)==md.mesh.numberofelements2d),
++	if (md.mesh.dimension==3 & datasize(1)==numberofelements2d),
+ 		data=project3d(md,'vector',data,'type','element');
+ 		datasize(1)=md.mesh.numberofelements;
+ 		%---> go to node data
Index: /issm/oecreview/Archive/12678-13393/ISSM-12979-12980.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12979-12980.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12979-12980.diff	(revision 13394)
@@ -0,0 +1,136 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/planetmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/planetmesh.m	(revision 12979)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/planetmesh.m	(revision 12980)
+@@ -5,6 +5,9 @@
+ 
+ classdef planetmesh
+ 	properties (SetAccess=public) 
++		x                           = NaN;
++		y                           = NaN;
++		z                           = NaN;
+ 		r                           = NaN;
+ 		theta                       = NaN;
+ 		phi                         = NaN
+@@ -41,6 +44,9 @@
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
++			md = checkfield(md,'planetmesh.x','NaN',1,'size',[md.planetmesh.numberofvertices 1]);
++			md = checkfield(md,'planetmesh.y','NaN',1,'size',[md.planetmesh.numberofvertices 1]);
++			md = checkfield(md,'planetmesh.z','NaN',1,'size',[md.planetmesh.numberofvertices 1]);
+ 			md = checkfield(md,'planetmesh.r','NaN',1,'size',[md.planetmesh.numberofvertices 1]);
+ 			md = checkfield(md,'planetmesh.theta','NaN',1,'size',[md.planetmesh.numberofvertices 1]);
+ 			md = checkfield(md,'planetmesh.phi','NaN',1,'size',[md.planetmesh.numberofvertices 1]);
+@@ -86,6 +92,9 @@
+ 			fielddisplay(obj,'numberofelements','number of elements');
+ 			fielddisplay(obj,'numberofvertices','number of vertices');
+ 			fielddisplay(obj,'elements','index into (x,y,z), coordinates of the vertices');
++			fielddisplay(obj,'x','vertices x coordinate');
++			fielddisplay(obj,'y','vertices y coordinate');
++			fielddisplay(obj,'z','vertices z coordinate');
+ 			fielddisplay(obj,'r','vertices r coordinate');
+ 			fielddisplay(obj,'theta','vertices theta coordinate');
+ 			fielddisplay(obj,'phi','vertices phi coordinate');
+@@ -100,6 +109,9 @@
+ 
+ 		end % }}}
+ 		function marshall(obj,fid) % {{{
++			WriteData(fid,'object',obj,'fieldname','x','format','DoubleMat','mattype',1);
++			WriteData(fid,'object',obj,'fieldname','y','format','DoubleMat','mattype',1);
++			WriteData(fid,'object',obj,'fieldname','z','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','r','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','theta','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','phi','format','DoubleMat','mattype',1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/planet.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/planet.m	(revision 12979)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/planet.m	(revision 12980)
+@@ -13,36 +13,58 @@
+ 		 %}}}
+ 	 end
+ 	 methods
+-		function md=planetmesh(md,varargin) % {{{
+-		%PLANETMESH: build 2d shell mesh
+-		%
+-		% Usage: md=planetmesh(md,'method','mixed','radius',6378000,'angleresol',1);
+-		%        md=planetmesh(md,'method','tria','shape','iso','radius',6378000,'refinement',5);
+-		%
++		 function md = planet(varargin) % {{{
+ 
+-		%recover options
+-		options=pairoptions(varargin{:});
++			 switch nargin
++				 case 0
++					 md=setdefaultparameters(md);
++				 otherwise
++					 error('planet constructor error message: 0 of 1 argument only in input.');
++				 end
++		 end
++		 %}}}
++		 function md = setdefaultparameters(md) % {{{
+ 
+-		method=getfieldvalue(options,'method','mixed');
+-		
+-		if strcmpi(method,'mixed'),
+-			%recover radius and angleresol: 
+-			radius=getfieldvalue(options,'radius',6378000); %earth radius as default
+-			angleresol=getfieldvalue(options,'angleresol',10); %10 degree resolution
+-			
+-			%call mixed mesh 
+-			md=planetmixedmesh(md,radius,angleresol);
+-		else
+-			%recover radius, shape and level of refinmenet
+-			radius=getfieldvalue(options,'radius',6378000); %earth radius as default
+-			refinement=getfieldvalue(options,'refinement',5); %refine 5 times
+-			shape=getfieldvalue(options,'shape','ico'); 
+-			
+-			%call triangular mesh
+-			md=planettrimesh(md,shape,radius,refinement);
+-		end
+-
+-		end
+-		% }}}
++			 %initialize subclasses
++			 md.mesh             = planetmesh();
++			 md.mask             = mask();
++			 md.constants        = constants();
++			 md.geometry         = geometry();
++			 md.initialization   = initialization();
++			 md.surfaceforcings  = surfaceforcings();
++			 md.basalforcings    = basalforcings();
++			 md.friction         = friction();
++			 md.rifts            = rifts();
++			 md.timestepping     = timestepping();
++			 md.groundingline    = groundingline();
++			 md.materials        = materials();
++			 md.flowequation     = flowequation();
++			 md.debug            = debug();
++			 md.verbose          = verbose('solution',true,'qmu',true,'control',true);
++			 md.settings         = settings();
++			 md.solver           = solver();
++			 if ismumps,
++				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,mumpsoptions);
++			 else
++				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,iluasmoptions);
++			 end
++			 md.cluster          = generic();
++			 md.balancethickness = balancethickness();
++			 md.diagnostic       = diagnostic();
++			 md.hydrology        = hydrology();
++			 md.prognostic       = prognostic();
++			 md.thermal          = thermal();
++			 md.steadystate      = steadystate();
++			 md.transient        = transient();
++			 md.autodiff         = autodiff();
++			 md.flaim            = flaim();
++			 md.inversion        = inversion();
++			 md.qmu              = qmu();
++			 md.radaroverlay     = radaroverlay();
++			 md.results          = struct();
++			 md.miscellaneous    = miscellaneous();
++			 md.private          = private();
++		 end
++		 %}}}
+ 	 end
+  end
Index: /issm/oecreview/Archive/12678-13393/ISSM-12980-12981.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12980-12981.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12980-12981.diff	(revision 13394)
@@ -0,0 +1,78 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/runme.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/runme.m	(revision 12980)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/runme.m	(revision 12981)
+@@ -1,4 +0,0 @@
+-% 5 -> level of refinment
+-% 1000 -> radius
+-FV = sphere_tri('ico',5,1000); 
+-patch('vertices',FV.vertices,'faces',FV.faces,'facecolor',[1 0 0],'edgecolor',[.2 .2 .6]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmesher.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmesher.m	(revision 12980)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmesher.m	(revision 12981)
+@@ -6,8 +6,8 @@
+ %   (method 'tria')
+ %   where md is a @planet object, varargin is a list of options
+ %
+-% Usage: md=planetmesh(md,'method','mixed','radius',6378000,'angleresol',1);
+-%        md=planetmesh(md,'method','tria','shape','iso','radius',6378000,'refinement',5);
++% Usage: md=planetmesher(md,'method','mixed','radius',6378000,'angleresol',1);
++%        md=planetmesher(md,'method','tria','shape','iso','radius',6378000,'refinement',5);
+ %
+ %
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m	(revision 12980)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m	(revision 12981)
+@@ -86,14 +86,14 @@
+ 
+ 
+ md.mesh.elements=quads;
+-md.x=x;
+-md.y=y;
+-md.z=z;
+-md.r=sqrt(x.^2+y.^2+z.^2);
+-md.theta=acos(z./r);
+-md.phi=atan2(y,x);
++md.mesh.x=x;
++md.mesh.y=y;
++md.mesh.z=z;
++md.mesh.r=sqrt(x.^2+y.^2+z.^2);
++md.mesh.theta=acos(z./md.mesh.r);
++md.mesh.phi=atan2(y,x);
+ 
+-md.mesh.numberofvertices=length(md.x);
++md.mesh.numberofvertices=length(md.mesh.x);
+ md.mesh.numberofelements=size(md.mesh.elements,1);
+ 
+ md.mesh.dimension=3;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planettrimesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planettrimesh.m	(revision 12980)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planettrimesh.m	(revision 12981)
+@@ -5,16 +5,16 @@
+ %
+ 
+ results = sphere_tri(shape,refinement,radius);
+-md.x=results.vertices(:,1);
+-md.y=results.vertices(:,2);
+-md.z=results.vertices(:,3);
++md.mesh.x=results.vertices(:,1);
++md.mesh.y=results.vertices(:,2);
++md.mesh.z=results.vertices(:,3);
+ md.mesh.elements=results.faces;
+ 
+-md.r=sqrt(md.x.^2+md.y.^2+md.z.^2);
+-md.theta=acos(md.z./md.r);
+-md.phi=atan2(md.y,md.x);
++md.mesh.r=sqrt(md.mesh.x.^2+md.mesh.y.^2+md.mesh.z.^2);
++md.mesh.theta=acos(md.mesh.z./md.mesh.r);
++md.mesh.phi=atan2(md.mesh.y,md.mesh.x);
+ 
+-md.mesh.numberofvertices=length(md.x);
++md.mesh.numberofvertices=length(md.mesh.x);
+ md.mesh.numberofelements=size(md.mesh.elements,1);
+ 
+ md.mesh.dimension=3;
Index: /issm/oecreview/Archive/12678-13393/ISSM-12981-12982.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12981-12982.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12981-12982.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/planet.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/planet.m	(revision 12981)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/planet.m	(revision 12982)
+@@ -5,12 +5,6 @@
+ 
+ classdef planet < model
+     properties (SetAccess=public) %Planet fields
+-		 % {{{
+-		 %Planet specific fields
+-		 r=NaN;
+-		 theta=NaN;
+-		 phi=NaN;
+-		 %}}}
+ 	 end
+ 	 methods
+ 		 function md = planet(varargin) % {{{
Index: /issm/oecreview/Archive/12678-13393/ISSM-12982-12983.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12982-12983.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12982-12983.diff	(revision 13394)
@@ -0,0 +1,19 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 12982)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 12983)
+@@ -76,8 +76,13 @@
+ 				else
+ 					%Add --gen-suppressions=all to get suppression lines
+ 					fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+-					fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
++					if ismac, 
++						fprintf(fid,'mpiexec -np %i %s --leak-check=full --dsymutil=yes --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
+ 						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++					else
++						fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
++						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++					end
+ 				end
+ 				if ~io_gather, %concatenate the output files:
+ 					fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
Index: /issm/oecreview/Archive/12678-13393/ISSM-12983-12984.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12983-12984.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12983-12984.diff	(revision 13394)
@@ -0,0 +1,29 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh	(revision 12983)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh	(revision 12984)
+@@ -18,7 +18,10 @@
+ 
+ #Configure subversion
+ cd src
+-./configure --prefix="$ISSM_DIR/externalpackages/svn/install"  --with-sqlite="$ISSM_DIR/externalpackages/sqlite/install"
++./configure --prefix="$ISSM_DIR/externalpackages/svn/install" \
++	--with-swig="$ISSM_DIR/externalpackages/swig/install"  \
++	PYTHON2="$ISSM_DIR/externalpackages/python/install/bin/python" \
++	--with-sqlite="$ISSM_DIR/externalpackages/sqlite/install"
+ 
+ #Compile and install subversion
+ if [ -z $1 ]; then
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn	(revision 12983)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn	(revision 12984)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,4 ##
++install
++src*
++*.gz
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12984-12985.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12984-12985.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12984-12985.diff	(revision 13394)
@@ -0,0 +1,37 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh	(revision 12984)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh	(revision 12985)
+@@ -20,10 +20,17 @@
+ export CFLAGS="$CFLAGS -I$ISSM_DIR/externalpackages/pcre/install"
+ export LDFLAGS="-L$ISSM_DIR/externalpackages/pcre/install/.libs/"
+ export LIBS="-lpcre"
+-#Configure doxygen
++#Configure swig
+ ./configure \
+- --prefix="$ISSM_DIR/externalpackages/python/install" \
++ --prefix="$ISSM_DIR/externalpackages/swig/install" \
+  --with-pcre-prefix="$ISSM_DIR/externalpackages/pcre/install" \
+- --with-pcre-exec-prefix="$ISSM_DIR/externalpackages/pcre/install"
+-make 
++ --with-pcre-exec-prefix="$ISSM_DIR/externalpackages/pcre/install" \
++ --with-python="$ISSM_DIR/externalpackages/python/install/bin/python"
++
++#Compile and install gdal
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
+ make install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig	(revision 12984)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig	(revision 12985)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++install
++*.gz
Index: /issm/oecreview/Archive/12678-13393/ISSM-12985-12986.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12985-12986.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12985-12986.diff	(revision 13394)
@@ -0,0 +1,93 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr	(revision 12985)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr	(revision 12986)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++install
++src
++*.gz
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/distribute
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/distribute	(revision 12985)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/distribute	(revision 12986)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/distribute
+___________________________________________________________________
+Modified: svn:ignore
+## -1 +1,2 ##
++*.gz
+ distribute_setup.py
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/install.sh	(revision 12985)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/install.sh	(revision 12986)
+@@ -21,4 +21,5 @@
+ 
+ $install
+ cd src
++python setup.py build
+ python setup.py install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn	(revision 12985)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn	(revision 12986)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++install
++src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite	(revision 12985)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite	(revision 12986)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++*.gz
++install
++src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util	(revision 12985)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util	(revision 12986)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++install
++src
++*.gz
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/readline
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/readline	(revision 12985)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/readline	(revision 12986)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/readline
+___________________________________________________________________
+Modified: svn:ignore
+## -1,2 +1,3 ##
++*.gz
+ src
+ src-*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages	(revision 12985)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages	(revision 12986)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++archive
+ MITgcm
+ OpenAD
+ ivins
Index: /issm/oecreview/Archive/12678-13393/ISSM-12986-12987.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12986-12987.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12986-12987.diff	(revision 13394)
@@ -0,0 +1,151 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12986)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12987)
+@@ -153,8 +153,6 @@
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix->Echo();
+-		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+@@ -170,8 +168,6 @@
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix->Assemble();
+-		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+@@ -190,8 +186,6 @@
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		norm=this->pmatrix->Norm(norm_type);
+-		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+@@ -208,8 +202,6 @@
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix->GetSize(pM,pN);
+-		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+@@ -225,8 +217,6 @@
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix->GetLocalSize(pM,pN);
+-		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+@@ -242,8 +232,6 @@
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix->MatMult(X->pvector,AX->pvector);
+-		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+@@ -263,8 +251,6 @@
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		output->pmatrix=this->pmatrix->Duplicate();
+-		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+@@ -283,8 +269,6 @@
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		output=this->pmatrix->ToSerial();
+-		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+@@ -302,8 +286,6 @@
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix->SetValues(m,idxm,n,idxn,values,mode);
+-		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+@@ -318,8 +300,6 @@
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix->Convert(newtype);
+-		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 12986)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 12987)
+@@ -33,11 +33,15 @@
+ 
+ 		/*Vector constructors, destructors {{{*/
+ 		Vector();
++		#ifdef _HAVE_PETSC_
++		Vector(Vec petsc_vector);
+ 		Vector(int M,bool fromlocalsize=false,int type=PetscVecType);
+ 		Vector(IssmDouble* serial_vec,int pM,int type=PetscVecType);
+-		#ifdef _HAVE_PETSC_
+-		Vector(Vec petsc_vector);
++		#else
++		Vector(int M,bool fromlocalsize=false,int type=SeqVecType);
++		Vector(IssmDouble* serial_vec,int pM,int type=SeqVecType);
+ 		#endif
++
+ 		~Vector();
+ 		/*}}}*/
+ 		/*Vector specific routines {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 12986)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 12987)
+@@ -31,10 +31,17 @@
+ 
+ 		/*Matrix constructors, destructors {{{*/
+ 		Matrix();
++		#ifdef _HAVE_PETSC_
+ 		Matrix(int M,int N,int type=PetscMatType);
+ 		Matrix(int M,int N,IssmDouble sparsity,int type=PetscMatType);
+ 		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=PetscMatType);
+ 		Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=PetscMatType);
++		#else
++		Matrix(int M,int N,int type=SeqMatType);
++		Matrix(int M,int N,IssmDouble sparsity,int type=SeqMatType);
++		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=SeqMatType);
++		Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=SeqMatType);
++		#endif
+ 		~Matrix();
+ 		/*}}}*/
+ 		/*Matrix specific routines {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl	(revision 12986)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl	(revision 12987)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++projects
+ autom4te.cache
+ aclocal.m4
+ bin
Index: /issm/oecreview/Archive/12678-13393/ISSM-12987-12988.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12987-12988.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12987-12988.diff	(revision 13394)
@@ -0,0 +1,258 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 12987)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 12988)
+@@ -13,6 +13,9 @@
+ 	bool  waitonlock       = false;
+ 	bool  dakota_analysis,control_analysis,tao_analysis;
+ 
++	/*AD: */
++	int   tape_stats[11];
++
+ 	/*FemModel: */
+ 	FemModel *femmodel = NULL;
+ 
+@@ -41,6 +44,11 @@
+ 
+ 	ISSMBOOT();
+ 
++	/*If running AD, then initialize the tape: */
++	#ifdef _HAVE_ADOLC_
++	trace_on(1);
++	#endif
++
+ 	/*Initialize environments: Petsc, MPI, etc...: */
+ 	#ifdef _HAVE_PETSC_
+ 	ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
+@@ -199,6 +207,19 @@
+ 	MPI_Finalize();
+ 	#endif
+ 	#endif
++
++	/*If running AD, close our tape, print statistics: */
++	#ifdef _HAVE_ADOLC_
++	trace_off();
++	tapestats(1,tape_stats); //reading of tape statistics
++	_pprintLine_("   ADOLC statistics: ");
++	_pprintLine_("   "<<setw(45)<<left<<"Number of independents: " <<tape_stats[0]);
++	_pprintLine_("   "<<setw(45)<<left<<"Number of dependents: " <<tape_stats[1]);
++	_pprintLine_("   "<<setw(45)<<left<<"Maximal number of live active variables: " <<tape_stats[2]);
++	_pprintLine_("   "<<setw(45)<<left<<"Size of value stack (number of overwrites): " <<tape_stats[3]);
++	_pprintLine_("   "<<setw(45)<<left<<"Buffer size (a multiple of eight): " <<tape_stats[4]);
++	_pprintLine_("   "<<setw(45)<<left<<"Total number of operations recorded: " <<tape_stats[5]);
++	#endif
+ 	
+ 	/*end module: */
+ 	ISSMEND();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 12987)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 12988)
+@@ -79,7 +79,7 @@
+       /*********compute PD ****************/
+       if (tstar < PDup){
+ 	pd = 1.;
+-	if (tstar >= -siglimc){ pd = pds[int(tstar/DT + siglim0c)];}}
++	if (tstar >= -siglimc){ pd = pds[reCast<int,IssmDouble>(tstar/DT + siglim0c)];}}
+       else { 
+ 	pd = 0.;}
+       
+@@ -99,7 +99,7 @@
+       if (iqj>5 &&  iqj<9){ Tsum=Tsum+tstar;} 
+       if (tstar >= siglim) {pdd = pdd + tstar*deltm;}
+       else if (tstar> -siglim){
+-	pddsig=pdds[int(tstar/DT + siglim0)];
++	pddsig=pdds[reCast<int,IssmDouble>(tstar/DT + siglim0)];
+ 	pdd = pdd + pddsig*deltm;
+ 	frzndd = frzndd - (tstar-pddsig)*deltm;}
+       else{frzndd = frzndd - tstar*deltm; }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 12987)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 12988)
+@@ -24,6 +24,7 @@
+ 
+ void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf);
+ void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n);
++void SolverxSeq(double** pX,double* A,double* B,int n);
+ 
+ #endif  /* _SOLVERX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 12987)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 12988)
+@@ -43,47 +43,83 @@
+ 	#endif
+ 
+ }/*}}}*/
+-void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){/*{{{*/
++#ifdef _HAVE_ADOLC_
++void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){//{{{
++	/* if we use Adol-C then the IssmDouble will be an adouble
++	   and the calls to gsl_... will not work. 
++	   We therefore call a wrapped solver instead. 
++	*/
+ 
++	/*Output: */
++	IssmDouble* X=NULL;
++
++	/*Intermediary: */
++	int     i;
++	double* doubleA=NULL;
++	double* doubleB=NULL;
++	double* doubleX=NULL;
++
++	/*First, transfer from IssmDouble to double all our matrices and vectors: */
++	doubleA=xNew<double>(n*n);
++	doubleB=xNew<double>(n);
++	for(i=0;i<n*n;i++)A[i]>>=doubleA[i];
++	for(i=0;i<n;i++)B[i]>>=doubleB[i];
++	
++	/*Call wrapped solver: */
++	SolverxSeq(&doubleX,doubleA, doubleB, n);
++
++	/*Transfer solution vector from double to IssmDouble: */
++	X = xNew<IssmDouble>(n);
++	for(i=0;i<n;i++)X[i]<<=doubleX[i];
++
++	/*Free ressources:*/
++	xDelete<double>(doubleA);
++	xDelete<double>(doubleB);
++
++	/*Assign output pointers: */
++	*pX=X;
++}
++/*}}}*/
++#endif
++//void SolverxSeq(double** pX,double* A,double* B,int n){ //{{{
++#ifdef _HAVE_ADOLC_
++void SolverxSeq(double** pX,double* A,double* B,int n){ 
++#else
++void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){
++#endif
+ 	#ifdef _HAVE_GSL_
+-		/*GSL Matrices and vectors: */
+-		int              s;
+-		gsl_matrix_view  a;
+-		gsl_vector_view  b;
+-		gsl_vector      *x = NULL;
+-		gsl_permutation *p = NULL;
+-		#ifdef _HAVE_ADOLC_
+-			// if we use Adol-C then the IssmDouble will be an adouble
+-			// and the calls to gsl_... will not work
+-			// and we should call  a suitable wrapped solve instead
+-			_error2_("SolverxSeq: should not be here with Adol-C");
+-		#else
+-			/*A will be modified by LU decomposition. Use copy*/
+-			IssmDouble* Acopy = xNew<IssmDouble>(n*n);
+-			xMemCpy<IssmDouble>(Acopy,A,n*n);
++	/*GSL Matrices and vectors: */
++	int              s;
++	gsl_matrix_view  a;
++	gsl_vector_view  b;
++	gsl_vector      *x = NULL;
++	gsl_permutation *p = NULL;
++	/*A will be modified by LU decomposition. Use copy*/
++	double* Acopy = xNew<double>(n*n);
++	xMemCpy<double>(Acopy,A,n*n);
+ 
+-			/*Initialize gsl matrices and vectors: */
+-			a = gsl_matrix_view_array (Acopy,n,n);
+-			b = gsl_vector_view_array (B,n);
+-			x = gsl_vector_alloc (n);
++	/*Initialize gsl matrices and vectors: */
++	a = gsl_matrix_view_array (Acopy,n,n);
++	b = gsl_vector_view_array (B,n);
++	x = gsl_vector_alloc (n);
+ 
+-			/*Run LU and solve: */
+-			p = gsl_permutation_alloc (n);
+-			gsl_linalg_LU_decomp (&a.matrix, p, &s);
+-			gsl_linalg_LU_solve (&a.matrix, p, &b.vector, x);
++	/*Run LU and solve: */
++	p = gsl_permutation_alloc (n);
++	gsl_linalg_LU_decomp (&a.matrix, p, &s);
++	gsl_linalg_LU_solve (&a.matrix, p, &b.vector, x);
+ 
+-			//printf ("x = \n");
+-			//gsl_vector_fprintf (stdout, x, "%g");
++	//printf ("x = \n");
++	//gsl_vector_fprintf (stdout, x, "%g");
+ 
+-			/*Copy result*/
+-			IssmDouble* X = xNew<IssmDouble>(n);
+-			memcpy(X,gsl_vector_ptr(x,0),n*sizeof(IssmDouble));
++	/*Copy result*/
++	double* X = xNew<double>(n);
++	memcpy(X,gsl_vector_ptr(x,0),n*sizeof(double));
+ 
+-			/*Clean up and assign output pointer*/
+-			xDelete<IssmDouble>(Acopy);
+-			gsl_permutation_free(p);
+-			gsl_vector_free(x);
+-			*pX=X;
+-		#endif
++	/*Clean up and assign output pointer*/
++	xDelete<double>(Acopy);
++	gsl_permutation_free(p);
++	gsl_vector_free(x);
++	*pX=X;
+ 	#endif
+-}/*}}}*/
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp	(revision 12987)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp	(revision 12988)
+@@ -98,7 +98,7 @@
+ /*FUNCTION TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){{{*/
+ void  TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){
+ 
+-	double output;
++	IssmDouble output;
+ 	bool   found;
+ 
+ 	/*Ok, we have the time, go through the timesteps, and figure out which interval we 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.m	(revision 12987)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.m	(revision 12988)
+@@ -67,17 +67,19 @@
+ 	return;
+ end
+ 
+-%Wite all input files
+-marshall(md);                                          % bin file
+-PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file
+-BuildQueueScript(cluster,md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); % queue file
+-
+ %we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+ if ~ispetsc,
+ 	disp('PETSC support not included, running on 1 cpu only!');
+ 	cluster.np=1;
+ end
+ 
++
++%Wite all input files
++marshall(md);                                          % bin file
++PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file
++BuildQueueScript(cluster,md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); % queue file
++
++
+ %Stop here if batch mode
+ if strcmpi(options.batch,'yes')
+ 	disp('batch mode requested: not launching job interactively');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh	(revision 12987)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh	(revision 12988)
+@@ -16,5 +16,5 @@
+ 	--without-3d \
+ 	--without-groundingline \
+ 	--without-kriging  \
+-	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install
+-	#--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install\
++	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
++	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install
Index: /issm/oecreview/Archive/12678-13393/ISSM-12988-12989.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12988-12989.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12988-12989.diff	(revision 13394)
@@ -0,0 +1,122 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 12988)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 12989)
+@@ -220,7 +220,7 @@
+ 		AC_SUBST([MEX])
+ 		MATLABWRAPPEREXT=$MEXEXT
+ 		AC_SUBST([MATLABWRAPPEREXT])
+-		AC_SUBST([MEXLIB]) 
++	    AC_SUBST([MEXLIB]) 
+ 		AC_SUBST([MEXLINK])
+ 	fi
+ 	dnl }}}
+@@ -665,23 +665,23 @@
+ 		case "${host_os}" in
+ 			*cygwin*)
+ 			if test "$PETSC_MAJOR" = "2" ; then
+-				PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/$PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetscksp.lib  libpetscdm.lib  libpetscmat.lib  libpetscvec.lib libpetscsnes.lib libpetscts.lib libmpiuni.lib libpetsc.lib"
++				PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetscksp.lib  libpetscdm.lib  libpetscmat.lib  libpetscvec.lib libpetscsnes.lib libpetscts.lib libmpiuni.lib libpetsc.lib"
+ 			else
+-				PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/$PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetsc.lib"
++				PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetsc.lib"
+ 			fi
+ 			;;
+ 			*linux*)
+ 			if test "$PETSC_MAJOR" = "2" ; then
+-			PETSCLIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
++			PETSCLIB="-L$PETSC_ROOT/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+ 			else
+-			PETSCLIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetsc -ldl"
++			PETSCLIB="-L$PETSC_ROOT/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetsc -ldl"
+ 			fi
+ 			;;
+ 			*darwin*)
+ 			if test "$PETSC_MAJOR" = "2" ; then
+-			PETSCLIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib/$PETSC_ARCH/ -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
++			PETSCLIB="-L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH/ -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
+ 			else
+-			PETSCLIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib/$PETSC_ARCH/ -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetsc"
++			PETSCLIB="-L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH/ -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetsc"
+ 			fi
+ 			;;
+ 		esac
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12988)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12989)
+@@ -1,4 +1,4 @@
+-INCLUDES = @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @GSLINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @GSLINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
+ 
+ EXEEXT=$(ISSMEXT)
+ 
+@@ -12,9 +12,15 @@
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+ if MATLAB
++#if SHARED
++#lib_LTLIBRARIES += libISSMMatlab.la
++#endif
+ lib_LIBRARIES += libISSMMatlab.a 
+ endif
+ if MODULES
++#if SHARED
++#lib_LTLIBRARIES += libISSMModules.la
++#endif
+ lib_LIBRARIES += libISSMModules.a 
+ endif
+ #}}}
+@@ -383,9 +389,7 @@
+ 					  ./modules/Dakotax/DakotaFree.cpp\
+ 					  ./modules/Dakotax/SpawnCore.cpp\
+ 					  ./modules/Dakotax/DescriptorIndex.cpp\
+-					  ./modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp\
+ 					  ./modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp\
+-					  ./modules/AverageOntoPartitionx/AverageOntoPartitionx.h\
+ 					  ./modules/Dakotax/SpawnCoreParallel.cpp
+ #}}}
+ #Transient sources  {{{
+@@ -1016,6 +1020,12 @@
+ #endif
+ 
+ if MODULES
++#if SHARED
++#libISSMModules_la_SOURCES = $(module_sources)
++#libISSMModules_la_SOURCES += $(bamg_sources)
++#libISSMModules_la_SOURCES += $(kriging_sources)
++#libISSMModules_la_SOURCES += $(kml_sources)
++#endif
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+ libISSMModules_a_SOURCES += $(kriging_sources)
+@@ -1029,6 +1039,9 @@
+ endif
+ 
+ if MATLAB
++if SHARED
++libISSMMatlab_la_SOURCES = $(matlab_sources)
++endif
+ libISSMMatlab_a_SOURCES = $(matlab_sources)
+ libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
+ endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 12988)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 12989)
+@@ -1,4 +1,4 @@
+-INCLUDES = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
+ EXEEXT=$(PYTHONWRAPPEREXT)
+ #Bin programs {{{1
+ if MODULES
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 12988)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 12989)
+@@ -1,4 +1,4 @@
+-INCLUDES = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
+ EXEEXT=$(MATLABWRAPPEREXT)
+ #Bin programs {{{1
+ if MODULES
Index: /issm/oecreview/Archive/12678-13393/ISSM-12989-12990.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12989-12990.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12989-12990.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12989)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 12990)
+@@ -1039,9 +1039,9 @@
+ endif
+ 
+ if MATLAB
+-if SHARED
+-libISSMMatlab_la_SOURCES = $(matlab_sources)
+-endif
++#if SHARED
++#libISSMMatlab_la_SOURCES = $(matlab_sources)
++#endif
+ libISSMMatlab_a_SOURCES = $(matlab_sources)
+ libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
+ endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-12990-12991.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12990-12991.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12990-12991.diff	(revision 13394)
@@ -0,0 +1,140 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12990)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12991)
+@@ -91,9 +91,9 @@
+ fi
+ 
+ #VALGRIND
+-VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install/bin"
++VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install"
+ if [ -d "$VALGRIND_DIR" ]; then
+-	export PATH="$VALGRIND_DIR:$PATH"
++	export PATH="$VALGRIND_DIR/bin:$PATH"
+ fi
+ 
+ #CPPCHECK
+@@ -194,9 +194,8 @@
+ fi
+ 
+ #APPSCAN
+-APPSCAN_DIR="$ISSM_DIR/externalpackages/appscan"
++APPSCAN_DIR="$ISSM_DIR/externalpackages/appscan/install"
+ if [ -d "$APPSCAN_DIR" ]; then
+-	export PATH="$PATH:$APPSCAN_DIR/install/bin"
+ 	export PATH="$PATH:$APPSCAN_DIR/bin"
+ fi
+ 
+@@ -237,18 +236,11 @@
+ fi
+ 
+ #ANDROID_NDK:
+-ANDROID_DIR="$ISSM_DIR/externalpackages/android"
+-if [ -d "$ANDROID_DIR" ]; then
+-	export ANDROID_NDK_DIR
++ANDROID_NDK_DIR="$ISSM_DIR/externalpackages/android-ndk/install"
++if [ -d "$ANDROID_NDK_DIR" ]; then
+ 	export PATH="$PATH:$ANDROID_NDK_DIR/"
+ fi
+ 
+-#ANDROID_DIR
+-ANDROID_NDK_DIR="$ANDROID_DIR/android-ndk/install"
+-if [ -d "$ANDROID_NDK_DIR" ]; then
+-	export ANDROID_DIR
+-fi
+-
+ #ANDROID_SDK
+ ANDROID_SDK_DIR="$ANDROID_DIR/android-sdk/install-sdk"
+ if [ -d "$ANDROID_SDK_DIR" ]; then
+@@ -279,21 +271,21 @@
+ fi
+ 
+ #MODELE
+-MODELE_DIR="$ISSM_DIR/externalpackages/modelE"
++MODELE_DIR="$ISSM_DIR/externalpackages/modelE/install"
+ if [ -d "$MODELE_DIR" ]; then
+ 	export PATH="$MODELE_DIR/src/exec:$PATH"
+ fi
+ 
+ #GIT
+-GIT_DIR="$ISSM_DIR/externalpackages/git"
++GIT_DIR="$ISSM_DIR/externalpackages/git/install"
+ if [ -d "$GIT_DIR" ]; then
+-	export PATH="$PATH:$GIT_DIR/install/bin"
++	export PATH="$PATH:$GIT_DIR/bin"
+ fi
+ 
+ #NCVIEW
+-NCVIEW_DIR="$ISSM_DIR/externalpackages/ncview"
++NCVIEW_DIR="$ISSM_DIR/externalpackages/ncview/install"
+ if [ -d "$NCVIEW_DIR" ]; then
+-	export PATH="$PATH:$NCVIEW_DIR/install"
++	export PATH="$PATH:$NCVIEW_DIR"
+ fi
+ 
+ #TCLX
+@@ -304,21 +296,20 @@
+ fi
+ 
+ #ASPELL
+-ASPELL_DIR="$ISSM_DIR/externalpackages/aspell/"
++ASPELL_DIR="$ISSM_DIR/externalpackages/aspell/install"
+ if [ -d "$ASPELL_DIR" ]; then
+-	export PATH="$ASPELL_DIR/install/bin:$PATH"
++	export PATH="$ASPELL_DIR/bin:$PATH"
+ fi
+ 
+ #ESMF
+ ESMF_DIR="$ISSM_DIR/externalpackages/esmf/esmf"
+ if [ -d "$ESMF_DIR" ]; then
+-	export ESMF_DIR=$ISSM_DIR/externalpackages/esmf/esmf
+ 	export ESMF_COMPILER=gfortran
+ 	export ESMF_COMM=mpich2
+ fi
+ 
+ #HDF5
+-HDF5_DIR=$ISSM_DIR/externalpackages/hdf5/install
++HDF5_DIR="$ISSM_DIR/externalpackages/hdf5/install"
+ if [ -d "$HDF5_DIR" ]; then
+ 	export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$HDF5_DIR/lib"
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HDF5_DIR/lib"
+@@ -327,7 +318,7 @@
+ fi
+ 
+ #SVN
+-SVN_DIR=$ISSM_DIR/externalpackages/svn/install
++SVN_DIR="$ISSM_DIR/externalpackages/svn/install"
+ if [ -d "$SVN_DIR" ]; then
+ 	export PATH="$SVN_DIR/bin:$PATH"
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SVN_DIR/lib"
+@@ -335,7 +326,7 @@
+ fi
+ 
+ #APR
+-APR_DIR=$ISSM_DIR/externalpackages/apr/install
++APR_DIR="$ISSM_DIR/externalpackages/apr/install"
+ if [ -d "$APR_DIR" ]; then
+ 	export PATH="$APR_DIR/bin:$PATH"
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APR_DIR/lib"
+@@ -343,7 +334,7 @@
+ fi
+ 
+ #APR_UTIL
+-APR_UTIL_DIR=$ISSM_DIR/externalpackages/apr-util/install
++APR_UTIL_DIR="$ISSM_DIR/externalpackages/apr-util/install"
+ if [ -d "$APR_UTIL_DIR" ]; then
+ 	export PATH="$APR_UTIL_DIR/bin:$PATH"
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APR_UTIL_DIR/lib"
+@@ -351,11 +342,9 @@
+ fi
+ 
+ #SQLITE
+-SQLITE_DIR=$ISSM_DIR/externalpackages/sqlite/install
++SQLITE_DIR="$ISSM_DIR/externalpackages/sqlite/install"
+ if [ -d "$SQLITE_DIR" ]; then
+ 	export PATH="$SQLITE_DIR/bin:$PATH"
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SQLITE_DIR/lib"
+ 	export LIBRARY_PATH="$LIBRARY_PATH:$SQLITE_DIR/lib"
+ fi
+-
+-
Index: /issm/oecreview/Archive/12678-13393/ISSM-12991-12992.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12991-12992.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12991-12992.diff	(revision 13394)
@@ -0,0 +1,81 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12991)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 12992)
+@@ -1,5 +1,10 @@
+ #ISSM_DIR and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...)
+ 
++#FIXME: during installation packages are installed one by one but environment.sh was sourced
++#before so new packages are NOT in the path.
++#may resource environment.sh with:
++#if [ -z $(echo "$PATH" | grep "$MATLAB_DIR") ]; then export $PATH...; fi
++
+ #Windows compilers: 
+ if [[ "$ISSM_ARCH" == "cygwin-intel" ]]; then
+ 	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
+@@ -14,30 +19,30 @@
+ 
+ #MATLAB
+ MATLAB_DIR="$ISSM_DIR/externalpackages/matlab/install"
+-if [ -d "$MATLAB_DIR" ]; then
++#if [ -d "$MATLAB_DIR" ]; then
+ 	export MATLAB_DIR
+ 	export PATH="$MATLAB_DIR/bin:$PATH" #take precedence over /usr/local/bin/matlab
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MATLAB_DIR/lib"
+ 	export LD_RUN_PATH="$LD_RUN_PATH:$MATLAB_DIR/lib"
+-fi
++#fi
+ 
+ #MPI
+ MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install"
+-if [ -d "$MPI_DIR" ]; then
++#if [ -d "$MPI_DIR" ]; then
+ 	export MPI_DIR
+ 	export PATH="$MPI_DIR/bin:$PATH"
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MPI_DIR/lib"
+ 	export LD_RUN_PATH="$LD_RUN_PATH:$MPI_DIR/lib"
+ 	export MANPATH="$MANPATH:$MPI_DIR/man"
+-fi
++#fi
+ 
+ #PETSC
+ PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"
+-if [ -d "$PETSC_DIR" ]; then
++#if [ -d "$PETSC_DIR" ]; then
+ 	export PETSC_DIR
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PETSC_DIR/lib:$PETSC_DIR/lib"
+ 	export LD_RUN_PATH="$LD_RUN_PATH:$PETSC_DIR/lib"
+-fi
++#fi
+ 
+ #SLEPC
+ SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install"
+@@ -62,21 +67,21 @@
+ 
+ #AUTOCONF
+ AUTOCONF_DIR="$ISSM_DIR/externalpackages/autoconf/install"
+-if [ -d "$AUTOCONF_DIR" ]; then
++#if [ -d "$AUTOCONF_DIR" ]; then
+ 	export PATH="$AUTOCONF_DIR/bin:$PATH"
+-fi
++#fi
+ 
+ #AUTOMAKE
+-AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install"
+-if [ -d "$AUTOMAKE_DIR" ]; then
++#AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install"
++#if [ -d "$AUTOMAKE_DIR" ]; then
+ 	export PATH="$AUTOMAKE_DIR/bin:$PATH"
+-fi
++#fi
+ 
+ #LIBTOOL
+ LIBTOOL_DIR="$ISSM_DIR/externalpackages/libtool/install"
+-if [ -d "$LIBTOOL_DIR" ]; then
++#if [ -d "$LIBTOOL_DIR" ]; then
+ 	export PATH="$LIBTOOL_DIR/bin:$PATH"
+-fi
++#fi
+ 
+ #SDK
+ SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU"
Index: /issm/oecreview/Archive/12678-13393/ISSM-12992-12993.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12992-12993.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12992-12993.diff	(revision 13394)
@@ -0,0 +1,58 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 12992)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 12993)
+@@ -65,7 +65,7 @@
+ 	if (!(  (nlhs==6) || (nrhs==5))){
+ 		mexPrintf("   %s format error.\n", __FUNCT__);
+ 		TriMeshProcessRiftsUsage();
+-		_error_("bad usage");
++		_error2_("bad usage");
+ 	}
+ 
+ 	/*Fetch index_in: */
+@@ -80,7 +80,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("first argument should be the element list");
++		_error2_("first argument should be the element list");
+ 	}
+ 
+ 	/*Fetch x_in: */
+@@ -93,7 +93,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("second argument should be the x corrdinate list");
++		_error2_("second argument should be the x corrdinate list");
+ 	}
+ 
+ 	/*Fetch y_in: */
+@@ -105,7 +105,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("third argument should be the y corrdinate list");
++		_error2_("third argument should be the y corrdinate list");
+ 	}	
+ 
+ 	/*Fetch segments_in: */
+@@ -120,7 +120,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("fourth argument should be the segments list");
++		_error2_("fourth argument should be the segments list");
+ 	}
+ 
+ 	/*Fetch segment markers: */
+@@ -132,7 +132,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("fourth argument should be the segmentmarkers list");
++		_error2_("fourth argument should be the segmentmarkers list");
+ 	}
+ 
+ 	/*First, do some fixing on the existing mesh: we do not want any element belonging entirely to the segment list (ie: 
Index: /issm/oecreview/Archive/12678-13393/ISSM-12993-12994.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12993-12994.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12993-12994.diff	(revision 13394)
@@ -0,0 +1,39 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp	(revision 12993)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp	(revision 12994)
+@@ -128,7 +128,7 @@
+ /*FUNCTION DoubleElementResult::GetVectorFromResults{{{1*/
+ void DoubleElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
+ 
+-	_error_("cannot return vector on vertices");
++	_error2_("cannot return vector on vertices");
+ } /*}}}*/
+ /*FUNCTION DoubleElementResult::GetElementVectorFromResults{{{1*/
+ void DoubleElementResult::GetElementVectorFromResults(Vector* vector,int dof){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12993)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12994)
+@@ -1265,7 +1265,7 @@
+ 	/*Get result*/
+ 	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
+ 	if(elementresult->InstanceEnum()!=enum_in){
+-		_error_("Results of offset %i is %s, when %s was expected",offset,EnumToStringx(elementresult->InstanceEnum()),EnumToStringx(enum_in));
++		_error2_("Results of offset "<<offset<<" is "<<EnumToStringx(elementresult->InstanceEnum())<<" when "<<EnumToStringx(enum_in)<<" was expected");
+ 	}
+ 	if(interp==P1Enum){
+ 		int doflist1[NUMVERTICES];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12993)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12994)
+@@ -1156,7 +1156,7 @@
+ 	/*Get result*/
+ 	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
+ 	if(elementresult->InstanceEnum()!=enum_in){
+-		_error_("Results of offset %i is %s, when %s was expected",offset,EnumToStringx(elementresult->InstanceEnum()),EnumToStringx(enum_in));
++		_error2_("Results of offset "<<offset<<" is "<<EnumToStringx(elementresult->InstanceEnum())<<" when "<<EnumToStringx(enum_in)<<" was expected");
+ 	}  
+ 	if(interp==P1Enum){
+ 		int doflist1[NUMVERTICES];
Index: /issm/oecreview/Archive/12678-13393/ISSM-12994-12995.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12994-12995.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12994-12995.diff	(revision 13394)
@@ -0,0 +1,768 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/lclist_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/lclist_write.m	(revision 12994)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/lclist_write.m	(revision 12995)
+@@ -1,62 +0,0 @@
+-%
+-%  function to write linear constraint list
+-%
+-function []=lclist_write(fidi,cstring,cstring2,dvar)
+-
+-if isempty(dvar)
+-    return;
+-end
+-
+-%  put linear constraints into lists for writing
+-
+-nvar=0;
+-pmatrix=[];
+-plower =[];
+-pupper =[];
+-ptarget=[];
+-pstype =[];
+-pscale =[];
+-
+-fnames=fieldnames(dvar);
+-for i=1:numel(fnames)
+-    nvar=nvar+numel(dvar.(fnames{i}));
+-    pmatrix=[pmatrix prop_matrix(dvar.(fnames{i}))];
+-    plower =[plower  prop_lower(dvar.(fnames{i})) ];
+-    pupper =[pupper  prop_upper(dvar.(fnames{i})) ];
+-    ptarget=[ptarget prop_target(dvar.(fnames{i}))];
+-    pstype =[pstype  prop_stype(dvar.(fnames{i})) ];
+-    pscale =[pscale  prop_scale(dvar.(fnames{i})) ];
+-end
+-
+-%  write linear constraints
+-
+-disp(sprintf('  Writing %d %s linear constraints.',...
+-    nvar,cstring));
+-
+-if ~isempty(pmatrix)
+-    fprintf(fidi,'\t  %s_matrix =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pmatrix,6,76);
+-end
+-if ~isempty(plower)
+-    fprintf(fidi,'\t  %s_lower_bounds =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),plower ,6,76);
+-end
+-if ~isempty(pupper)
+-    fprintf(fidi,'\t  %s_upper_bounds =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pupper ,6,76);
+-end
+-if ~isempty(ptarget)
+-    fprintf(fidi,'\t  %s_targets =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),ptarget,6,76);
+-end
+-if ~isempty(pstype)
+-    fprintf(fidi,'\t  %s_scale_types =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pstype ,6,76);
+-end
+-if ~isempty(pscale)
+-    fprintf(fidi,'\t  %s_scales =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pscale ,6,76);
+-end
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/rlist_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/rlist_write.m	(revision 12994)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/rlist_write.m	(revision 12995)
+@@ -1,70 +0,0 @@
+-%
+-%  function to write response list
+-%
+-function [rdesc]=rlist_write(fidi,cstring,cstring2,dresp,rdesc)
+-
+-if isempty(dresp)
+-    return;
+-end
+-
+-%  put responses into lists for writing
+-%  (and accumulate descriptors into list for subsequent writing)
+-
+-nresp=0;
+-pstype =[];
+-pscale =[];
+-pweight=[];
+-plower =[];
+-pupper =[];
+-ptarget=[];
+-
+-fnames=fieldnames(dresp);
+-for i=1:numel(fnames)
+-    nresp=nresp+numel(dresp.(fnames{i}));
+-    pstype =[pstype  prop_stype(dresp.(fnames{i})) ];
+-    pscale =[pscale  prop_scale(dresp.(fnames{i})) ];
+-    pweight=[pweight prop_weight(dresp.(fnames{i}))];
+-    plower =[plower  prop_lower(dresp.(fnames{i})) ];
+-    pupper =[pupper  prop_upper(dresp.(fnames{i})) ];
+-    ptarget=[ptarget prop_target(dresp.(fnames{i}))];
+-    rdesc  =[rdesc   prop_desc(dresp.(fnames{i}),fnames{i})];
+-end
+-
+-%  write responses
+-
+-disp(sprintf('  Writing %d %s responses.',nresp,cstring));
+-
+-fprintf(fidi,'\tnum_%s = %d\n',cstring,nresp);
+-if ~isempty(pstype)
+-    fprintf(fidi,'\t  %s_scale_types =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pstype ,6,76);
+-end
+-if ~isempty(pscale)
+-    fprintf(fidi,'\t  %s_scales =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pscale ,6,76);
+-end
+-if ~isempty(pweight)
+-    switch cstring2
+-        case 'objective_function'
+-            fprintf(fidi,'\t  %s_weights =\n','multi_objective');
+-            vector_write(fidi,sprintf('\t    '),pweight,6,76);
+-        case 'least_squares_term'
+-            fprintf(fidi,'\t  %s_weights =\n','least_squares');
+-            vector_write(fidi,sprintf('\t    '),pweight,6,76);
+-    end
+-end
+-if ~isempty(plower)
+-    fprintf(fidi,'\t  %s_lower_bounds =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),plower ,6,76);
+-end
+-if ~isempty(pupper)
+-    fprintf(fidi,'\t  %s_upper_bounds =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pupper ,6,76);
+-end
+-if ~isempty(ptarget)
+-    fprintf(fidi,'\t  %s_targets =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),ptarget,6,76);
+-end
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/param_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/param_write.m	(revision 12994)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/param_write.m	(revision 12995)
+@@ -1,24 +0,0 @@
+-%
+-%  function to write a parameter
+-%
+-function []=param_write(fidi,sbeg,pname,smid,send,params)
+-
+-if ~isfield(params,pname)
+-    warning('param_write:param_not_found',...
+-        'Parameter ''%s'' not found in structure.',pname);
+-    return
+-end
+-
+-if islogical(params.(pname)) && ~params.(pname)
+-    return
+-end
+-
+-if     islogical(params.(pname))
+-    fprintf(fidi,[sbeg '%s' send],pname);
+-elseif ischar   (params.(pname))
+-    fprintf(fidi,[sbeg '%s' smid '%s' send],pname,params.(pname));
+-elseif isnumeric(params.(pname))
+-    fprintf(fidi,[sbeg '%s' smid '%g' send],pname,params.(pname));
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/vlist_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/vlist_write.m	(revision 12994)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/vlist_write.m	(revision 12995)
+@@ -1,80 +0,0 @@
+-%
+-%  function to write variable list
+-%
+-function []=vlist_write(fidi,cstring,cstring2,dvar)
+-
+-if isempty(dvar)
+-    return;
+-end
+-
+-%  put variables into lists for writing
+-
+-nvar=0;
+-pinitpt=[];
+-plower =[];
+-pupper =[];
+-pmean  =[];
+-pstddev=[];
+-pinitst=[];
+-pstype =[];
+-pscale =[];
+-pdesc  =[];
+-
+-fnames=fieldnames(dvar);
+-for i=1:numel(fnames)
+-    nvar=nvar+numel(dvar.(fnames{i}));
+-    pinitpt=[pinitpt prop_initpt(dvar.(fnames{i}))];
+-    plower =[plower  prop_lower(dvar.(fnames{i})) ];
+-    pupper =[pupper  prop_upper(dvar.(fnames{i})) ];
+-    pmean  =[pmean   prop_mean(dvar.(fnames{i}))  ];
+-    pstddev=[pstddev prop_stddev(dvar.(fnames{i}))];
+-    pinitst=[pinitst prop_initst(dvar.(fnames{i}))];
+-    pstype =[pstype  prop_stype(dvar.(fnames{i})) ];
+-    pscale =[pscale  prop_scale(dvar.(fnames{i})) ];
+-    pdesc  =[pdesc   prop_desc(dvar.(fnames{i}),fnames{i})];
+-end
+-
+-%  write variables
+-%  (using Dakota 4.1 syntax for backward compatability)
+-
+-disp(sprintf('  Writing %d %s variables.',nvar,cstring));
+-
+-fprintf(fidi,'\t%s = %d\n',cstring,nvar);
+-if ~isempty(pinitpt)
+-    fprintf(fidi,'\t  %s_initial_point =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pinitpt,6,76);
+-end
+-if ~isempty(plower)
+-    fprintf(fidi,'\t  %s_lower_bounds =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),plower ,6,76);
+-end
+-if ~isempty(pupper)
+-    fprintf(fidi,'\t  %s_upper_bounds =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pupper ,6,76);
+-end
+-if ~isempty(pmean)
+-    fprintf(fidi,'\t  %s_means =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pmean  ,6,76);
+-end
+-if ~isempty(pstddev)
+-    fprintf(fidi,'\t  %s_std_deviations =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pstddev,6,76);
+-end
+-if ~isempty(pinitst)
+-    fprintf(fidi,'\t  %s_initial_state =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pinitst,6,76);
+-end
+-if ~isempty(pstype)
+-    fprintf(fidi,'\t  %s_scale_types =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pstype ,6,76);
+-end
+-if ~isempty(pscale)
+-    fprintf(fidi,'\t  %s_scales =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pscale ,6,76);
+-end
+-if ~isempty(pdesc)
+-    fprintf(fidi,'\t  %s_descriptors =\n',cstring2);
+-    vector_write(fidi,sprintf('\t    '),pdesc  ,6,76);
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/vector_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/vector_write.m	(revision 12994)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/vector_write.m	(revision 12995)
+@@ -1,52 +0,0 @@
+-
+-%%  function to write a vector on multiple lines
+-
+-function []=vector_write(fidi,sbeg,vec,nmax,cmax)
+-
+-if ~exist('nmax','var') || isempty(nmax)
+-    nmax=Inf;
+-end
+-if ~exist('cmax','var') || isempty(cmax)
+-    cmax=Inf;
+-end
+-
+-%  set up first iteration
+-
+-svec =[];
+-nitem=nmax;
+-lsvec=cmax;
+-
+-%  transpose vector from column-wise to row-wise
+-
+-vec=vec';
+-
+-%  assemble each line, flushing when necessary
+-
+-for i=1:numel(vec)
+-    if isnumeric(vec(i))
+-        sitem=sprintf('%g'    ,vec(i));
+-    else
+-        sitem=sprintf('''%s''',char(vec(i)));
+-    end
+-    nitem=nitem+1;
+-    lsvec=lsvec+1+length(sitem);
+-    
+-    if (nitem <= nmax) && (lsvec <= cmax)
+-        svec=[svec ' ' sitem];
+-    else
+-        if ~isempty(svec)
+-            fprintf(fidi,'%s\n',svec);
+-        end
+-        svec=[sbeg sitem];
+-        nitem=1;
+-        lsvec=length(svec);
+-    end
+-end
+-
+-%  flush buffer at end, if necessary
+-
+-if ~isempty(svec)
+-    fprintf(fidi,'%s\n',svec);
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/rlev_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/rlev_write.m	(revision 12994)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/qmu/rlev_write.m	(revision 12995)
+@@ -1,66 +0,0 @@
+-%
+-%  function to write response levels
+-%
+-function []=rlev_write(fidi,dresp,params)
+-
+-if isempty(dresp)
+-    return;
+-end
+-
+-%  put responses into lists for writing
+-
+-nresp=0;
+-respl={};
+-probl={};
+-rell ={};
+-grell={};
+-
+-fnames=fieldnames(dresp);
+-for i=1:numel(fnames)
+-    nresp=nresp+numel(dresp.(fnames{i}));
+-    [respli,probli,relli,grelli]=prop_levels(dresp.(fnames{i}));
+-    respl=[respl respli];
+-    probl=[probl probli];
+-    rell =[rell  relli ];
+-    grell=[grell grelli];
+-end
+-
+-%  write response levels
+-
+-param_write(fidi,'\t  ','distribution',' ','\n',params);
+-if ~isempty(respl)
+-    rlevi_write(fidi,'response_levels',respl);
+-    param_write(fidi,'\t  ','compute',' ','\n',params);
+-end 
+-if ~isempty(probl)
+-    rlevi_write(fidi,'probability_levels',probl);
+-end
+-if ~isempty(rell)
+-    rlevi_write(fidi,'reliability_levels',rell);
+-end
+-if ~isempty(grell)
+-    rlevi_write(fidi,'gen_reliability_levels',grell);
+-end
+-
+-end
+-
+-%
+-%  function to each type of response level
+-%
+-function []=rlevi_write(fidi,ltype,levels)
+-
+-fprintf(fidi,'\t  num_%s =',ltype);
+-for i=1:numel(levels)
+-    fprintf(fidi,' %d',length(levels{i}));
+-end
+-fprintf(fidi,'\n');
+-
+-fprintf(fidi,'\t  %s =\n',ltype);
+-
+-for i=1:numel(levels)
+-    if ~isempty(levels{i})
+-        vector_write(fidi,sprintf('\t    '),levels{i},8,76);
+-    end
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/rlist_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/rlist_write.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/rlist_write.m	(revision 12995)
+@@ -0,0 +1,70 @@
++%
++%  function to write response list
++%
++function [rdesc]=rlist_write(fidi,cstring,cstring2,dresp,rdesc)
++
++if isempty(dresp)
++    return;
++end
++
++%  put responses into lists for writing
++%  (and accumulate descriptors into list for subsequent writing)
++
++nresp=0;
++pstype =[];
++pscale =[];
++pweight=[];
++plower =[];
++pupper =[];
++ptarget=[];
++
++fnames=fieldnames(dresp);
++for i=1:numel(fnames)
++    nresp=nresp+numel(dresp.(fnames{i}));
++    pstype =[pstype  prop_stype(dresp.(fnames{i})) ];
++    pscale =[pscale  prop_scale(dresp.(fnames{i})) ];
++    pweight=[pweight prop_weight(dresp.(fnames{i}))];
++    plower =[plower  prop_lower(dresp.(fnames{i})) ];
++    pupper =[pupper  prop_upper(dresp.(fnames{i})) ];
++    ptarget=[ptarget prop_target(dresp.(fnames{i}))];
++    rdesc  =[rdesc   prop_desc(dresp.(fnames{i}),fnames{i})];
++end
++
++%  write responses
++
++disp(sprintf('  Writing %d %s responses.',nresp,cstring));
++
++fprintf(fidi,'\tnum_%s = %d\n',cstring,nresp);
++if ~isempty(pstype)
++    fprintf(fidi,'\t  %s_scale_types =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pstype ,6,76);
++end
++if ~isempty(pscale)
++    fprintf(fidi,'\t  %s_scales =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pscale ,6,76);
++end
++if ~isempty(pweight)
++    switch cstring2
++        case 'objective_function'
++            fprintf(fidi,'\t  %s_weights =\n','multi_objective');
++            vector_write(fidi,sprintf('\t    '),pweight,6,76);
++        case 'least_squares_term'
++            fprintf(fidi,'\t  %s_weights =\n','least_squares');
++            vector_write(fidi,sprintf('\t    '),pweight,6,76);
++    end
++end
++if ~isempty(plower)
++    fprintf(fidi,'\t  %s_lower_bounds =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),plower ,6,76);
++end
++if ~isempty(pupper)
++    fprintf(fidi,'\t  %s_upper_bounds =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pupper ,6,76);
++end
++if ~isempty(ptarget)
++    fprintf(fidi,'\t  %s_targets =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),ptarget,6,76);
++end
++
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/param_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/param_write.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/param_write.m	(revision 12995)
+@@ -0,0 +1,24 @@
++%
++%  function to write a parameter
++%
++function []=param_write(fidi,sbeg,pname,smid,send,params)
++
++if ~isfield(params,pname)
++    warning('param_write:param_not_found',...
++        'Parameter ''%s'' not found in structure.',pname);
++    return
++end
++
++if islogical(params.(pname)) && ~params.(pname)
++    return
++end
++
++if     islogical(params.(pname))
++    fprintf(fidi,[sbeg '%s' send],pname);
++elseif ischar   (params.(pname))
++    fprintf(fidi,[sbeg '%s' smid '%s' send],pname,params.(pname));
++elseif isnumeric(params.(pname))
++    fprintf(fidi,[sbeg '%s' smid '%g' send],pname,params.(pname));
++end
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/vlist_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/vlist_write.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/vlist_write.m	(revision 12995)
+@@ -0,0 +1,80 @@
++%
++%  function to write variable list
++%
++function []=vlist_write(fidi,cstring,cstring2,dvar)
++
++if isempty(dvar)
++    return;
++end
++
++%  put variables into lists for writing
++
++nvar=0;
++pinitpt=[];
++plower =[];
++pupper =[];
++pmean  =[];
++pstddev=[];
++pinitst=[];
++pstype =[];
++pscale =[];
++pdesc  =[];
++
++fnames=fieldnames(dvar);
++for i=1:numel(fnames)
++    nvar=nvar+numel(dvar.(fnames{i}));
++    pinitpt=[pinitpt prop_initpt(dvar.(fnames{i}))];
++    plower =[plower  prop_lower(dvar.(fnames{i})) ];
++    pupper =[pupper  prop_upper(dvar.(fnames{i})) ];
++    pmean  =[pmean   prop_mean(dvar.(fnames{i}))  ];
++    pstddev=[pstddev prop_stddev(dvar.(fnames{i}))];
++    pinitst=[pinitst prop_initst(dvar.(fnames{i}))];
++    pstype =[pstype  prop_stype(dvar.(fnames{i})) ];
++    pscale =[pscale  prop_scale(dvar.(fnames{i})) ];
++    pdesc  =[pdesc   prop_desc(dvar.(fnames{i}),fnames{i})];
++end
++
++%  write variables
++%  (using Dakota 4.1 syntax for backward compatability)
++
++disp(sprintf('  Writing %d %s variables.',nvar,cstring));
++
++fprintf(fidi,'\t%s = %d\n',cstring,nvar);
++if ~isempty(pinitpt)
++    fprintf(fidi,'\t  %s_initial_point =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pinitpt,6,76);
++end
++if ~isempty(plower)
++    fprintf(fidi,'\t  %s_lower_bounds =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),plower ,6,76);
++end
++if ~isempty(pupper)
++    fprintf(fidi,'\t  %s_upper_bounds =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pupper ,6,76);
++end
++if ~isempty(pmean)
++    fprintf(fidi,'\t  %s_means =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pmean  ,6,76);
++end
++if ~isempty(pstddev)
++    fprintf(fidi,'\t  %s_std_deviations =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pstddev,6,76);
++end
++if ~isempty(pinitst)
++    fprintf(fidi,'\t  %s_initial_state =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pinitst,6,76);
++end
++if ~isempty(pstype)
++    fprintf(fidi,'\t  %s_scale_types =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pstype ,6,76);
++end
++if ~isempty(pscale)
++    fprintf(fidi,'\t  %s_scales =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pscale ,6,76);
++end
++if ~isempty(pdesc)
++    fprintf(fidi,'\t  %s_descriptors =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pdesc  ,6,76);
++end
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/vector_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/vector_write.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/vector_write.m	(revision 12995)
+@@ -0,0 +1,52 @@
++
++%%  function to write a vector on multiple lines
++
++function []=vector_write(fidi,sbeg,vec,nmax,cmax)
++
++if ~exist('nmax','var') || isempty(nmax)
++    nmax=Inf;
++end
++if ~exist('cmax','var') || isempty(cmax)
++    cmax=Inf;
++end
++
++%  set up first iteration
++
++svec =[];
++nitem=nmax;
++lsvec=cmax;
++
++%  transpose vector from column-wise to row-wise
++
++vec=vec';
++
++%  assemble each line, flushing when necessary
++
++for i=1:numel(vec)
++    if isnumeric(vec(i))
++        sitem=sprintf('%g'    ,vec(i));
++    else
++        sitem=sprintf('''%s''',char(vec(i)));
++    end
++    nitem=nitem+1;
++    lsvec=lsvec+1+length(sitem);
++    
++    if (nitem <= nmax) && (lsvec <= cmax)
++        svec=[svec ' ' sitem];
++    else
++        if ~isempty(svec)
++            fprintf(fidi,'%s\n',svec);
++        end
++        svec=[sbeg sitem];
++        nitem=1;
++        lsvec=length(svec);
++    end
++end
++
++%  flush buffer at end, if necessary
++
++if ~isempty(svec)
++    fprintf(fidi,'%s\n',svec);
++end
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/rlev_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/rlev_write.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/rlev_write.m	(revision 12995)
+@@ -0,0 +1,66 @@
++%
++%  function to write response levels
++%
++function []=rlev_write(fidi,dresp,params)
++
++if isempty(dresp)
++    return;
++end
++
++%  put responses into lists for writing
++
++nresp=0;
++respl={};
++probl={};
++rell ={};
++grell={};
++
++fnames=fieldnames(dresp);
++for i=1:numel(fnames)
++    nresp=nresp+numel(dresp.(fnames{i}));
++    [respli,probli,relli,grelli]=prop_levels(dresp.(fnames{i}));
++    respl=[respl respli];
++    probl=[probl probli];
++    rell =[rell  relli ];
++    grell=[grell grelli];
++end
++
++%  write response levels
++
++param_write(fidi,'\t  ','distribution',' ','\n',params);
++if ~isempty(respl)
++    rlevi_write(fidi,'response_levels',respl);
++    param_write(fidi,'\t  ','compute',' ','\n',params);
++end 
++if ~isempty(probl)
++    rlevi_write(fidi,'probability_levels',probl);
++end
++if ~isempty(rell)
++    rlevi_write(fidi,'reliability_levels',rell);
++end
++if ~isempty(grell)
++    rlevi_write(fidi,'gen_reliability_levels',grell);
++end
++
++end
++
++%
++%  function to each type of response level
++%
++function []=rlevi_write(fidi,ltype,levels)
++
++fprintf(fidi,'\t  num_%s =',ltype);
++for i=1:numel(levels)
++    fprintf(fidi,' %d',length(levels{i}));
++end
++fprintf(fidi,'\n');
++
++fprintf(fidi,'\t  %s =\n',ltype);
++
++for i=1:numel(levels)
++    if ~isempty(levels{i})
++        vector_write(fidi,sprintf('\t    '),levels{i},8,76);
++    end
++end
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/lclist_write.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/lclist_write.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/lclist_write.m	(revision 12995)
+@@ -0,0 +1,62 @@
++%
++%  function to write linear constraint list
++%
++function []=lclist_write(fidi,cstring,cstring2,dvar)
++
++if isempty(dvar)
++    return;
++end
++
++%  put linear constraints into lists for writing
++
++nvar=0;
++pmatrix=[];
++plower =[];
++pupper =[];
++ptarget=[];
++pstype =[];
++pscale =[];
++
++fnames=fieldnames(dvar);
++for i=1:numel(fnames)
++    nvar=nvar+numel(dvar.(fnames{i}));
++    pmatrix=[pmatrix prop_matrix(dvar.(fnames{i}))];
++    plower =[plower  prop_lower(dvar.(fnames{i})) ];
++    pupper =[pupper  prop_upper(dvar.(fnames{i})) ];
++    ptarget=[ptarget prop_target(dvar.(fnames{i}))];
++    pstype =[pstype  prop_stype(dvar.(fnames{i})) ];
++    pscale =[pscale  prop_scale(dvar.(fnames{i})) ];
++end
++
++%  write linear constraints
++
++disp(sprintf('  Writing %d %s linear constraints.',...
++    nvar,cstring));
++
++if ~isempty(pmatrix)
++    fprintf(fidi,'\t  %s_matrix =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pmatrix,6,76);
++end
++if ~isempty(plower)
++    fprintf(fidi,'\t  %s_lower_bounds =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),plower ,6,76);
++end
++if ~isempty(pupper)
++    fprintf(fidi,'\t  %s_upper_bounds =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pupper ,6,76);
++end
++if ~isempty(ptarget)
++    fprintf(fidi,'\t  %s_targets =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),ptarget,6,76);
++end
++if ~isempty(pstype)
++    fprintf(fidi,'\t  %s_scale_types =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pstype ,6,76);
++end
++if ~isempty(pscale)
++    fprintf(fidi,'\t  %s_scales =\n',cstring2);
++    vector_write(fidi,sprintf('\t    '),pscale ,6,76);
++end
++
++end
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-12995-12996.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12995-12996.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12995-12996.diff	(revision 13394)
@@ -0,0 +1,21894 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/recursivepath.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/recursivepath.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/recursivepath.m	(revision 12996)
+@@ -1,38 +0,0 @@
+-function p = recursivepath(d)
+-%RECURSIVEPATH - generate paths in a directory
+-%
+-%   this routine is equivalent to Matlab's genpath except that it skips CVS and .svn directories
+-%
+-%   Usage:
+-%      p = recursivepath(d)
+-
+-%initialize path to be returned
+-p = '';
+-sep=pathsep;  %directory separator
+-
+-% Generate path based on given root directory
+-files=dir(d);
+-if isempty(files)
+-	return
+-end
+-
+-% Add d to the path even if it is empty.
+-p = [p d sep];
+-
+-% set logical vector for subdirectory entries in d
+-isdir = logical(cat(1,files.isdir));
+-
+-% Recursively goes through the subdirectories of d
+-dirs=files(isdir); % select only directory entries from the current listing
+-for i=1:length(dirs)
+-	dirname=dirs(i).name;
+-	if ~strcmp(dirname,'.')    & ...
+-		~strcmp(dirname,'..')   & ...
+-		~strcmp(dirname,'.svn') & ...
+-		~strcmp(dirname,'CVS')  & ...
+-		~strncmp(dirname,'@',1) & ... %Method directories not allowed in MATLAB path
+-		~strcmp(dirname,'private')    %private directories not allowed in MATLAB path
+-
+-		p = [p recursivepath(fullfile(d,dirname))];
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/isbasin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/isbasin.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/isbasin.m	(revision 12996)
+@@ -1,19 +0,0 @@
+-function isbasin(name)
+-%ISBASIN: figure out if a basin name exists.
+-%
+-%
+-%        Usage:  index=isbasin('jks');
+-%
+-%
+-
+-
+-%First, load basin names:
+-load([jplsvn '/projects/ModelData/Names/Names.mat']);
+-
+-
+-%go through names: 
+-for i=1:length(names),
+-	if ~isempty(strfind(names{i,1},name)),
+-		disp(['''' names{i,1} ''' Long:' num2str(names{i,2}) ' Lat:' num2str(names{i,3}) ]);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/plotbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/plotbasins.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/plotbasins.m	(revision 12996)
+@@ -1,18 +0,0 @@
+-%display all the domain outlines in a directory
+-
+-basins=listfiles;
+-
+-hold on
+-for i=1:length(basins), 
+-	%check whether this is a .exp file
+-	basin=basins{i};
+-	if strcmpi(basin(end-3:end),'.exp'),
+-
+-		contour=expread(basin,0);
+-		x=contour(1).x;
+-		y=contour(1).y;
+-		x0=mean(x); y0=mean(y);
+-		text(x0,y0,basin(1:end-4),'Fontsize',14);
+-		expdisp(basin);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/showbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/showbasins.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/showbasins.m	(revision 12996)
+@@ -1,69 +0,0 @@
+-function showbasins(varargin)
+-%SHOWBASINS - return basins that are within the xlim and ylim
+-%
+-%   Usage:
+-%      names=showbasins(options);
+-%   Options: 
+-%      'unit' default 1
+-%      'hemisphere': default +1;
+-%      'central_meridian: 45 for Greenland and 0 for Antarctica
+-%      'standard_parallel: 70 for Greenland and 71 for Antarctica
+-%
+-
+-%is varargin an options database already?
+-if nargin==0,
+-	options=pairoptions(varargin{:});
+-elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
+-	%do nothing to the varargin: 
+-	options=varargin{1};
+-else
+-	%process varargin for options: 
+-	options=pairoptions(varargin{:});
+-end
+-
+-
+-%recover some options, and set defaults
+-unitmultiplier=getfieldvalue(options,'unit',1);
+-fontsize=getfieldvalue(options,'fontsize',12);
+-hemisphere=getfieldvalue(options,'hemisphere');
+-
+-if strcmpi(hemisphere,'s'),
+-	hemisphere=-1;
+-elseif strcmpi(hemisphere,'n'),
+-	hemisphere=+1;
+-else
+-	error('showbasins error message: hemispehre should be either ''n'' or ''s''');
+-	end
+-
+-if hemisphere==+1,
+-	central_meridian=getfieldvalue(options,'central_meridian',45);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',70);
+-else
+-	central_meridian=getfieldvalue(options,'central_meridian',0);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',71);
+-end
+-
+-%Ok, find basin we are talking about: 
+-load([jplsvn '/projects/ModelData/Names/Names.mat']);
+-
+-%Get xlim and ylim, and convert into lat,long: 
+-xlimits=xlim; x0=xlimits(1); x1=xlimits(2);
+-ylimits=ylim; y0=ylimits(1); y1=ylimits(2);
+-
+-%Convert names lat and long into x,y:
+-lat=cell2mat(names(:,3));
+-long=cell2mat(names(:,2));
+-
+-%Now, convert lat,long into x,y:
+-[x,y]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
+-
+-%Find  x,y within xlimits and ylimits: 
+-locations=find(x>x0 & x<x1 & y>y0 & y<y1);
+-
+-%Go through locations, and display the names: 
+-for i=1:size(locations,1),
+-	hold on,
+-	plot(x(locations(i)),y(locations(i)),'r.');
+-	t=text(x(locations(i)),y(locations(i)),names{locations(i),1}); 
+-	set(t,'FontSize',fontsize);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/basinzoom.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/basinzoom.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Basins/basinzoom.m	(revision 12996)
+@@ -1,94 +0,0 @@
+-function varargout=basinzoom(varargin)
+-%ANTZOOM - zoom on a basin in Antarctica or Greenland.
+-%
+-%   This function zooms on an existing figure describing Antarctica or Greenland 
+-%   The zooming depends on the region name provided as input. 
+-%
+-%   Usage:
+-%      varargout=basinzoom(options)
+-
+-%recover some options, and set defaults
+-
+-%is varargin an options database already?
+-if nargin==0,
+-	options=pairoptions(varargin{:});
+-elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
+-	%do nothing to the varargin: 
+-	options=varargin{1};
+-else
+-	%process varargin for options: 
+-	options=pairoptions(varargin{:});
+-end
+-
+-unitmultiplier=getfieldvalue(options,'unit',NaN);
+-basin=getfieldvalue(options,'basin');
+-
+-if exist(options,'basindelta'),
+-
+-	basindeltax=getfieldvalue(options,'basindelta',300); 
+-	basindeltay=getfieldvalue(options,'basindelta',300); 
+-else
+-	basindeltax=getfieldvalue(options,'basindeltax',300); 
+-	basindeltay=getfieldvalue(options,'basindeltay',300);
+-end
+-
+-%multiply by 1000 to get kms
+-basindeltax=basindeltax*1000;
+-basindeltay=basindeltay*1000;
+-
+-%Ok, find basin we are talking about: 
+-load([jplsvn() '/projects/ModelData/Names/Names.mat']);
+-		
+-%Go through names: 
+-found=0;
+-for i=1:size(names,1),
+-	if strcmpi(names{i,1},basin),
+-		%ok, we've got the region. Get lat and long: 
+-		long=names{i,2};
+-		lat=names{i,3};
+-		hemisphere=names{i,4};
+-		found=1;
+-		break;
+-	end
+-end
+-
+-if ~found,
+-	error(['basinzoom error message: cannot find basin ' basin '. Use isbasin to determine a basin name.']);
+-end
+-
+-if hemisphere==+1,
+-	central_meridian=getfieldvalue(options,'central_meridian',45);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',70);
+-else
+-	central_meridian=getfieldvalue(options,'central_meridian',0);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',71);
+-end
+-
+-%Transform lat long into x,y: 
+-[xc,yc]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
+-
+-%compute x0,x1 and y0,y1 using basindeltax and basindeltay
+-x0=xc-basindeltax/2;
+-x1=xc+basindeltax/2;
+-y0=yc-basindeltay/2;
+-y1=yc+basindeltay/2;
+-
+-if ~isnan(unitmultiplier)
+-	x0=x0*unitmultiplier;
+-	x1=x1*unitmultiplier;
+-	y0=y0*unitmultiplier;
+-	y1=y1*unitmultiplier;
+-end
+-
+-%if output arguments are present, return the limits, 
+-%otherwise, set them on the current graphic. 
+-if nargout==2,
+-	found=1;
+-	varargout{1}=[x0 x1];
+-	varargout{2}=[y0 y1];
+-else
+-	xlim([x0 x1]);
+-	ylim([y0 y1]);
+-	found=1;
+-	daspect([1;1;1]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/immerge.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/immerge.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/immerge.m	(revision 12996)
+@@ -1,43 +0,0 @@
+-function out = immerge(bg, fg, coef)
+-% Creates an image 'out' of same type as bg.
+-% 'out' has 'bg' as background, and 'fg' (transparent, 
+-% weighted by 'coef') above 'bg'.
+-% Useful when one cannot use OpenGL as renderer, but still 
+-% wants to have transparency!
+-% 'out', 'bg', and 'fg' are RGB images.
+-%
+-% merged = immerged(bg, fg, coef)
+-%	- bg matrix of type double or uint8
+-%	- fg matrix of type double or uint8
+-%	- coef is a scalar between 0 and 1, or a matrix of 
+-%	  such scalars, same size as 'fg' and 'bg' (AlphaData).
+-%
+-% Suggestions for future development:
+-%	- allow to have 'coef' referring to the AlphaMap
+-%	- allow 'coef' to take values between 1 and 64.
+-%
+-% Gauthier Fleutot 28-07-2004
+-% fleutotg@esiee.fr
+-
+-intOutput = 0;	% if we want the output to be of type integer
+-
+-if ~isa(bg, 'double')
+-	bg = double(bg);	% because '-' isn't defined for uint8
+-	intOutput = 1;
+-end
+-if ~isa(fg, 'double')
+-	fg = double(fg);	% because '-' isn't defined for uint8
+-end
+-
+-dif = fg-bg;
+-
+-if size(coef) == [1 1]
+-	out = bg + coef.*dif;
+-else
+-	coef = cat(3,coef,coef,coef);	% extend the coef matric in the 3rd dim.
+-	out = bg + coef .* dif;
+-end
+-
+-if intOutput == 1
+-	out = uint8(out);
+-end
+\ No newline at end of file
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/mean_congrid.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/mean_congrid.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/mean_congrid.m	(revision 12996)
+@@ -1,59 +0,0 @@
+-function res=mean_congrid(a,n,choice);
+-%MEAN_CONGRID - average the values around a pixel
+-%
+-%   INPUT a,n,choice, where a is the matrix, and n the size of the area averaged around
+-%   one pixel, odd number. choice=1 if the NaN values remain NaN values.
+-%
+-%   Usage:
+-%      res=mean_congrid(a,n,choice)
+-
+-s=size(a);
+-aa=a;
+-pos=find(isnan(aa));
+-aa(pos)=0;
+-
+-if (mod(n,2)==0),
+-   disp('Cannot rebin, the dimensions of the matrix and n are not compatible');
+-   break
+-end
+-mm=(n-1)/2;
+-
+-res=zeros(s(1),s(2));
+-
+-for m=mm+1:s(1)-mm,
+-   if mod(m,10)==0,
+-      disp(m/s(1)*100);
+-   end
+-   
+-   for l=mm+1:s(2)-mm,
+-      
+-      
+-      if sum(sum(~isnan(a(m-mm:m+mm,l-mm:l+mm))))~=0,
+-      res(m,l)=sum(...
+-                   sum(...
+-                   ~isnan(...
+-                          a(m-mm:m+mm,l-mm:l+mm)...
+-                          ).*...
+-                          aa(m-mm:m+mm,l-mm:l+mm)...
+-                       )...
+-                   )...
+-                   /sum(sum(~isnan(a(m-mm:m+mm,l-mm:l+mm))));
+-             else
+-                res(m,l)=NaN;
+-             end
+-             
+-   end
+-end
+-
+-if choice==1,
+-   pos=find(isnan(a));
+-   res(pos)=NaN;
+-end
+-
+-   
+-
+-
+-
+-
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/im_resize.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/im_resize.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/im_resize.m	(revision 12996)
+@@ -1,16 +0,0 @@
+-function newimg = im_resize(img,nw,nh)
+-%IM_RESIZE - resize an image using bicubic interpolation
+-%
+-%   NEWIMG = IM_RESIZE(IMG,NW,NH) Given input image IMG,
+-%   returns a new image NEWIMG of size NWxNH.
+-%
+-% Matthew Dailey 2000
+-
+-  if nargin ~= 3
+-    error('usage: im_resize(image,new_wid,new_ht)');
+-  end;
+-  
+-  ht_scale = size(img,1) / nh;
+-  wid_scale = size(img,2) / nw;
+-  
+-  newimg = interp2(img,(1:nw)*wid_scale,(1:nh)'*ht_scale,'cubic');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/rebin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/rebin.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/ImageProcessing/rebin.m	(revision 12996)
+@@ -1,44 +0,0 @@
+-function res=rebin(a,n);
+-%REBIN - average values of a matrix by bloc
+-%
+-%   INPUT a,n, where a is the matrix, and n the size of the area averaged around
+-%   one pixel
+-%
+-%   Usage:
+-%      res=rebin(a,n)
+-
+-s=size(a);
+-
+-if (mod(s(1)/n,2)~=0 | mod(s(2)/n,2)~=0),
+-   disp('Cannot rebin, the dimensions of the matrix and n are not compatible');
+-   break
+-end
+-
+-res=zeros(s(1)/n,s(2)/n);
+-
+-for m=1:s(1)/n,
+-   for l=1:s(2)/n,
+-      if sum(sum(~isnan(a((m-1)*n+1:m*n,(l-1)*n+1:l*n))))~=0,
+-      res(m,l)=sum(...
+-                   sum(...
+-                       ~isnan(...
+-                              a((m-1)*n+1:m*n,(l-1)*n+1:l*n)...
+-                              ).*...
+-                       a((m-1)*n+1:m*n,(l-1)*n+1:l*n)...
+-                       )...
+-                   )...
+-                   /sum(sum(~isnan(a((m-1)*n+1:m*n,(l-1)*n+1:l*n))));
+-             else
+-                res(m,l)=NaN;
+-             end
+-             
+-   end
+-end
+-
+-   
+-
+-
+-
+-
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.py	(revision 12996)
+@@ -1,76 +0,0 @@
+-import socket
+-import platform
+-import subprocess
+-import os
+-import shutil
+-from MatlabFuncs import *
+-
+-def scpin(host, login,port,path, packages):
+-	"""
+-	SCPIN get packages from host, using scp on unix, and pscp on windows
+- 
+-	   usage: scpin(host,packages,path)
+-	"""
+-
+-	#first get hostname
+-	hostname=socket.gethostname().lower().split('.')[0]
+-
+-	#first be sure packages are not in the current directory, this could conflict with pscp on windows. 
+-	#remove warnings in case the files do not exist
+-	for package in packages:
+-		try:
+-			os.remove(package)
+-		except OSError as e:
+-			pass
+-
+-	#if hostname and host are the same, do a simple copy
+-	if strcmpi(hostname,host):
+-
+-		for package in packages:
+-			try:
+-				shutil.copy(os.path.join(path,package),os.getcwd())    #keep going, even if success=0
+-			except OSError as e:
+-				pass
+-
+-	else:
+-
+-		if 'Windows' in platform.system():
+-			#use the putty project pscp.exe: it should be in the path.
+-		
+-			#get ISSM_DIR variable
+-			if 'ISSM_DIR_WIN' in os.environ:
+-				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
+-			else:
+-				raise OSError("scpin error message: could not find ISSM_DIR_WIN environment variable.")
+-
+-			username=raw_input('Username: (quoted string) ')
+-			key=raw_input('Key: (quoted string) ')
+-
+-			for package in packages:
+-				try:
+-					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s:%s %s' % (ISSM_DIR,username,key,host,os.path.join(path,package),os.getcwd()),shell=True)
+-				except CalledProcessError as e:
+-					raise CalledProcessError("scpin error message: could not call putty pscp.")
+-
+-		else:
+-			#just use standard unix scp
+-			#string to copy multiple files using scp: 
+-			if len(packages)==1:
+-				string=packages[0]
+-			else:
+-				string='{'
+-				for package in packages:
+-					string+=packages[i]+','
+-				string=string[:-1]+'}'
+-
+-
+-			if port:
+-				subprocess.call('scp -P %d %s@localhost:%s %s' % (port,login,os.path.join(path,string),os.getcwd),shell=True)
+-			else:
+-				subprocess.call('scp %s@%s:%s %s' % (login,host,os.path.join(path,string),os.getcwd),shell=True)
+-		
+-			#check scp worked
+-			for package in packages:
+-				if not os.path.exists(os.path.join('.',package)):
+-					raise OSError("scpin error message: could not call scp on *nix system.")
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.py	(revision 12996)
+@@ -1,58 +0,0 @@
+-import socket
+-import platform
+-import subprocess
+-import os
+-import shutil
+-from MatlabFuncs import *
+-
+-def issmscpout(host,path,login,port,packages):
+-	"""
+-	SCPOUT send packages to a host, using scp on unix, and pscp on windows
+- 
+-	   usage: scpout(host,path,packages)
+-	"""
+-
+-	#get hostname
+-	hostname=socket.gethostname().lower().split('.')[0]
+-
+-	#if hostname and host are the same, do a simple copy
+-
+-	if strcmpi(host,hostname):
+-		for package in packages:
+-			here=os.getcwd()
+-			os.chdir(path)
+-			shutil.rmtree(package)
+-			subprocess.call('ln -s %s %s' % (os.path.join(here,package),path),shell=True)
+-			os.chdir(here)
+-	else:
+-		if 'Windows' in platform.system():
+-			#use the putty project pscp.exe: it should be in the path.
+-		
+-			#get ISSM_DIR variable
+-			if 'ISSM_DIR_WIN' in os.environ:
+-				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
+-			else:
+-				raise OSError("scpout error message: could not find ISSM_DIR_WIN environment variable.")
+-
+-			username=raw_input('Username: (quoted string) ')
+-			key=raw_input('Key: (quoted string) ')
+-
+-			for package in packages:
+-				try:
+-					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s %s:%s' % (ISSM_DIR,username,key,package,host,path),shell=True)
+-				except CalledProcessError as e:
+-					raise CalledProcessError("scpout error message: could not call putty pscp.")
+-
+-		else:
+-			#just use standard unix scp
+-			#create string of packages being sent
+-			string=''
+-			for package in packages:
+-				string+=' '+package
+-			string+=' '
+-		
+-			if port:
+-				subprocess.call('scp -P %d %s %s@localhost:%s' % (port,string,login,path),shell=True)
+-			else:
+-				subprocess.call('scp %s %s@%s:%s' % (string,login,host,path),shell=True)
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.py	(revision 12996)
+@@ -1,42 +0,0 @@
+-import socket
+-import platform
+-import subprocess
+-import os
+-from MatlabFuncs import *
+-
+-def issmssh(host,login,port,command):
+-	"""
+-	ISSMSSH - wrapper for OS independent ssh command.
+- 
+-	   usage: 
+-	      issmssh(host,command)
+-	"""
+-
+-	#first get hostname 
+-	hostname=socket.gethostname().lower().split('.')[0]
+-
+-	#if same as host, just run the command. 
+-	if strcmpi(host,hostname):
+-		subprocess.call(command,shell=True)
+-	else:
+-		if 'Windows' in platform.system():
+-			#use the putty project plink.exe: it should be in the path.
+-		
+-			#get ISSM_DIR variable
+-			if 'ISSM_DIR_WIN' in os.environ:
+-				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
+-			else:
+-				raise OSError("issmssh error message: could not find ISSM_DIR_WIN environment variable.")
+-
+-			username=raw_input('Username: (quoted string) ')
+-			key=raw_input('Key: (quoted string) ')
+-
+-			subprocess.call('%s/externalpackages/ssh/plink.exe -ssh -l "%s" -pw "%s" %s "%s"' % (ISSM_DIR,username,key,host,command),shell=True);
+-
+-		else:
+-			#just use standard unix ssh
+-			if port:
+-				subprocess.call('ssh -l %s -p %d localhost "%s"' % (login,port,command),shell=True)
+-			else:
+-				subprocess.call('ssh -l %s %s "%s"' % (login,host,command),shell=True)
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.py	(revision 12996)
+@@ -1,37 +0,0 @@
+-import os
+-from issmdir import *
+-from MatlabFuncs import *
+-
+-def ispetsc():
+-	"""
+-	ISPETSC - figure out if PETSC package was compiled with ISSM
+- 
+-	   Usage:
+-	      flag=ispetsc();
+-	"""
+-
+-	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
+-	if not os.path.exists(configfile):
+-		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
+-
+-	#go through the file, and recover the line we want
+-	flag=2
+-	try:
+-		fid=open(configfile,'r')
+-	except IOError as e:
+-		raise IOError("could not open file: '%s'" % configfile)
+-
+-	for tline in fid:
+-		if strncmp(tline,'/* #undef _HAVE_PETSC_ */',25):
+-			flag=0
+-			break
+-		if  strncmp(tline,'#define _HAVE_PETSC_',20):
+-			flag=1
+-			break
+-
+-	fid.close()
+-	if flag==2:
+-		raise RuntimeError("could not determine whether PETSC was or was not compiled.")
+-
+-	return flag
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpin.m	(revision 12996)
+@@ -1,78 +0,0 @@
+-function scpin(host, login,port,path, packages)
+-%SCPIN get packages from host, using scp on unix, and pscp on windows
+-%
+-%   usage: scpin(host,packages,path)
+-%
+-%
+-
+-%first get hostname
+-hostname=oshostname();
+-
+-%first be sure packages are not in the current directory, this could conflict with pscp on windows. 
+-%get initial warning mode
+-state=warning('query', 'all');
+-%remove warnings in case the files do not exist
+-warning off
+-for i=1:numel(packages),
+-	delete(packages{i});
+-end
+-%back to initial warning state
+-warning(state);
+-
+-%if hostname and host are the same, do a simple copy
+-if strcmpi(hostname,host),
+-
+-    for i=1:numel(packages),
+-		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
+-	end
+-
+-else
+-
+-	if ispc,
+-		%use the putty project pscp.exe: it should be in the path.
+-		
+-		%get ISSM_DIR variable
+-		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+-		if status, 
+-			error('scpin error message: could not find ISSM_DIR_WIN environment variable');
+-		end
+-		ISSM_DIR=ISSM_DIR(2:end-2);
+-
+-		username=input('Username: (quoted string) ');
+-		key=input('Key: (quoted string) ');
+-
+-		for i=1:numel(packages),
+-			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' host ':' path '/' packages{i} ' ./']);
+-			if status, 
+-				error('scpin error message: could not call putty pscp');
+-			end
+-		end
+-
+-	else
+-		%just use standard unix scp
+-		%string to copy multiple files using scp: 
+-		if numel(packages)==1,
+-			string=packages{1};
+-		else
+-			string='\{';
+-			for i=1:numel(packages)-1,
+-				string=[string packages{i} ','];
+-			end
+-			string=[string packages{end} '\}'];
+-		end
+-
+-
+-		if port,
+-			eval(['!scp -P ' num2str(port) ' ' login '@localhost:' path '/' string ' ./']);
+-		else
+-			eval(['!scp ' login '@' host ':' path '/' string ' ./']);
+-		end
+-		
+-		%check scp worked
+-		for i=1:numel(packages),
+-			if ~exist(['./' packages{i}]),
+-				error('scpin error message: could not call scp on *nix system');
+-			end
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmscpout.m	(revision 12996)
+@@ -1,57 +0,0 @@
+-function issmscpout(host,path,login,port,packages)
+-%SCPOUT send packages to a host, using scp on unix, and pscp on windows
+-%
+-%   usage: scpout(host,path,packages)
+-%
+-%
+-
+-%get hostname
+-hostname=oshostname();
+-
+-%if hostname and host are the same, do a simple copy
+-
+-if strcmpi(host,hostname),
+-	for i=1:numel(packages),
+-		here=pwd;
+-		eval(['cd ' path])
+-		system(['rm -rf ' packages{i} ]);
+-		system(['ln -s ' here '/' packages{i} ' .']);
+-		eval(['cd ' here]);
+-	end
+-else 
+-	if ispc,
+-		%use the putty project pscp.exe: it should be in the path.
+-		
+-		%get ISSM_DIR variable
+-		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+-		if status, 
+-			error('scpout error message: could not find ISSM_DIR_WIN environment variable');
+-		end
+-		ISSM_DIR=ISSM_DIR(2:end-2);
+-
+-		username=input('Username: (quoted string) ');
+-		key=input('Key: (quoted string) ');
+-
+-		for i=1:numel(packages),
+-			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' packages{i} ' ' host ':' path]);
+-			if status, 
+-				error('scpout error message: could not call putty pscp');
+-			end
+-		end
+-
+-	else
+-		%just use standard unix scp
+-		%create string of packages being sent
+-		string='';
+-		for i=1:numel(packages),
+-			string=[string ' ' packages{i}];
+-		end
+-		string=[string ' '];
+-		
+-		if port,
+-			eval(['!scp -P ' num2str(port) ' ' string ' ' login '@localhost:' path]);
+-		else
+-			eval(['!scp ' string ' ' login '@' host ':' path]);
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmssh.m	(revision 12996)
+@@ -1,37 +0,0 @@
+-function issmssh(host,login,port,command)
+-%ISSMSSH - wrapper for OS independent ssh command.
+-%
+-%   usage: 
+-%      issmssh(host,command)
+-
+-%first get hostname 
+-hostname=oshostname();
+-
+-%if same as host, just run the command. 
+-if strcmpi(host,hostname),
+-	system(command);
+-else
+-	if ispc,
+-		%use the putty project plink.exe: it should be in the path.
+-		
+-		%get ISSM_DIR variable
+-		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+-		if status, 
+-			error('issmssh error message: could not find ISSM_DIR_WIN environment variable');
+-		end
+-		ISSM_DIR=ISSM_DIR(2:end-2);
+-
+-		username=input('Username: (quoted string) ');
+-		key=input('Key: (quoted string) ');
+-
+-		system([ISSM_DIR '/externalpackages/ssh/plink.exe -ssh -l "' username '" -pw "' key '" ' host ' "' command '"']);
+-
+-	else
+-		%just use standard unix ssh
+-		if port,
+-			eval(['!ssh -l ' login ' -p ' num2str(port) ' localhost "' command '"']);
+-		else
+-			eval(['!ssh -l ' login ' ' host ' "' command '"']);
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.py	(revision 12996)
+@@ -1,37 +0,0 @@
+-import os
+-from issmdir import *
+-from MatlabFuncs import *
+-
+-def ismumps():
+-	"""
+-	ISMUMPS - figure out if MUMPS package was compiled with ISSM
+- 
+-	   Usage:
+-	      flag=ismumps();
+-	"""
+-
+-	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
+-	if not os.path.exists(configfile):
+-		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
+-
+-	#go through the file, and recover the line we want
+-	flag=2
+-	try:
+-		fid=open(configfile,'r')
+-	except IOError as e:
+-		raise IOError("could not open file: '%s'" % configfile)
+-
+-	for tline in fid:
+-		if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25):
+-			flag=0
+-			break
+-		if  strncmp(tline,'#define _HAVE_MUMPS_',20):
+-			flag=1
+-			break
+-
+-	fid.close()
+-	if flag==2:
+-		raise RuntimeError("could not determine whether MUMPS was or was not compiled.")
+-
+-	return flag
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ispetsc.m	(revision 12996)
+@@ -1,33 +0,0 @@
+-function flag=ispetsc()
+-%ISPETSC - figure out if PETSC package was compiled with ISSM
+-%
+-%   Usage:
+-%       flag=ispetsc();
+-
+-
+-configfile=[issmdir() '/bin/config.h']; %should find it in the install target
+-if ~exist(configfile,'file'),
+-	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
+-end
+-
+-%go through the file, and recover the line we want
+-flag=2;
+-fid=fopen(configfile,'r');
+-if(fid==-1), error(['could not open file: ' configfile]); end
+-
+-while(true),
+-	tline=fgets(fid);
+-	if ~ischar(tline), break, end
+-	if strncmp(tline,'/* #undef _HAVE_PETSC_ */',25),
+-		flag=0;
+-		break;
+-	end
+-	if  strncmp(tline,'#define _HAVE_PETSC_',20),
+-		flag=1;
+-		break;
+-	end
+-end
+-fclose(fid);
+-if flag==2,
+-	error('could not determine whether PETSC was or was not compiled');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/listfilesparallel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/listfilesparallel.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/listfilesparallel.m	(revision 12996)
+@@ -1,15 +0,0 @@
+-function list=listfilesparallel(rank,numprocs)
+-%LISTFILESPARALLEL list files inside a directory, depending on rank  and number of processors running this routine.
+-%        this is very OS dependent.
+-%
+-%   usage: list=listfilesparallel(rank,numprocs);
+-%
+-%
+-%   see also LS DIR LISTFILES
+-
+-list=listfiles';
+-numfiles=numel(list);
+-
+-%we now have a list, split it between all the processors.
+-[i1,i2]=parallelrange(rank,numprocs,numfiles);
+-list=list(i1:i2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/ismumps.m	(revision 12996)
+@@ -1,33 +0,0 @@
+-function flag=ismumps()
+-%ISMUMPS - figure out if MUMPS package was compiled with ISSM
+-%
+-%   Usage:
+-%       flag=ismumps();
+-
+-
+-configfile=[issmdir() '/bin/config.h']; %should find it in the install target
+-if ~exist(configfile,'file'),
+-	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
+-end
+-
+-%go through the file, and recover the line we want
+-flag=2;
+-fid=fopen(configfile,'r');
+-if(fid==-1), error(['could not open file: ' configfile]); end
+-
+-while(true),
+-	tline=fgets(fid);
+-	if ~ischar(tline), break, end
+-	if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25),
+-		flag=0;
+-		break;
+-	end
+-	if  strncmp(tline,'#define _HAVE_MUMPS_',20),
+-		flag=1;
+-		break;
+-	end
+-end
+-fclose(fid);
+-if flag==2,
+-	error('could not determine whether MUMPS was or was not compiled');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/listfiles.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/listfiles.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/listfiles.m	(revision 12996)
+@@ -1,22 +0,0 @@
+-function list=listfiles()
+-%LISTFILES list files inside a directory
+-%        this is very OS dependent.
+-%
+-%   usage: list=listfiles;
+-%
+-%
+-%   see also LS DIR
+-
+-%use dir, as it seems to act OS independent
+-
+-first_list=dir;
+-list={};
+-
+-for i=1:numel(first_list),
+-	if (  ~strcmpi(first_list(i).name,'.') &...
+-			~strcmpi(first_list(i).name,'..') &...
+-			~strcmpi(first_list(i).name,'NightlyRun') &...
+-			~strcmpi(first_list(i).name,'.svn')),
+-		list{end+1}=first_list(i).name;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/oshostname.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/oshostname.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/oshostname.m	(revision 12996)
+@@ -1,22 +0,0 @@
+-function hostname=oshostname()
+-%OSHOSTNAME figure out hostname, irrespective of os type
+-%
+-%   usage: hostname=oshostname();
+-%
+-%
+-
+-if ispc,
+-	[status,hostname]=system('hostname | sed ''s/-//g''');hostname=hostname(1:end-1);
+-
+-	if status, 
+-		error('oshostname error message: could not run hostname command on windows os');
+-	end
+-
+-else
+-	[status,hostname]=system(['hostname -s | sed ''s/-//g''']);
+-	if status, 
+-		error('oshostname error message: could not run hostname command on *nix os');
+-	end
+-	hostname=hostname(1:end-1);
+-	hostname=ddewhite(hostname);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmbbftpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmbbftpin.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmbbftpin.m	(revision 12996)
+@@ -1,48 +0,0 @@
+-function issmbbftpin(host, login,port,numstreams,path, packages)
+-%BBFTPIN get packages from host, using bbftp. assuming unix system here.
+-%
+-%   usage: scpin(host,packages,path)
+-%
+-%
+-
+-%first get hostname
+-hostname=oshostname();
+-
+-%first be sure packages are not in the current directory, this could conflict with pscp on windows. 
+-%get initial warning mode
+-state=warning('query', 'all');
+-%remove warnings in case the files do not exist
+-warning off
+-for i=1:numel(packages),
+-	delete(packages{i});
+-end
+-%back to initial warning state
+-warning(state);
+-
+-%if hostname and host are the same, do a simple copy
+-if strcmpi(hostname,host),
+-
+-    for i=1:numel(packages),
+-		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
+-	end
+-
+-else
+-
+-	%build a string of the type: bbftp -s -u elarour -e 'setnbstream 8; cd /nobackupp10/elarour/Testing/Interactive3/; get Antarctica.outbin' pfe1.nas.nasa.gov
+-	command=['!bbftp -s -V -u ' login ' -e ''setnbstream 8; cd ' path '; '];
+-	for i=1:length(packages),
+-		command=[command 'get ' packages{i} ';'];
+-	end
+-	command=[command '''  pfe1.nas.nasa.gov'];
+-	
+-	eval(command);
+-
+-	%check bbftp worked
+-	for i=1:numel(packages),
+-		if ~exist(['./' packages{i}]),
+-			error('scpin error message: could not call scp on *nix system');
+-		end
+-	end
+-
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmbbftpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmbbftpout.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/OS/issmbbftpout.m	(revision 12996)
+@@ -1,30 +0,0 @@
+-function issmbbftpout(host,path,login,port,numstreams,packages)
+-%BBFTPOUT put packages onto host, using bbftp. assuming unix system here.
+-%
+-%   usage: bbftpout(host,path,login,port,numstream,packages)
+-%
+-%
+-
+-%get hostname
+-hostname=oshostname();
+-
+-%if hostname and host are the same, do a simple copy
+-if strcmpi(host,hostname),
+-	for i=1:numel(packages),
+-		here=pwd;
+-		eval(['cd ' path])
+-		system(['rm -rf ' packages{i} ]);
+-		system(['ln -s ' here '/' packages{i} ' .']);
+-		eval(['cd ' here]);
+-	end
+-else 
+-	
+-	%build a string of the type: bbftp -s -u elarour -e 'setnbstream 8; cd /nobackupp10/elarour/Testing/Interactive3/; put Antarctica.tar.gz' pfe1.nas.nasa.gov
+-	command=['!bbftp -s -V -u ' login ' -e ''setnbstream 8; cd ' path '; ']
+-	for i=1:length(packages),
+-		command=[command 'put ' packages{i} ';'];
+-	end
+-	command=[command '''  pfe1.nas.nasa.gov'];
+-	
+-	eval(command);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.py	(revision 12996)
+@@ -1,25 +0,0 @@
+-#! /usr/bin/env python
+-def parallelrange(rank,numprocs,globalsize):
+-	"""
+-	PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
+- 
+-	   Usage: 
+-	      i1,i2=parallelrange(rank,numprocs,globalsize)
+-	"""
+-
+-	#We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
+-	num_local_rows=[int(globalsize/numprocs) for i in xrange(numprocs)]
+-
+-	#There may be some rows left. Distribute evenly.
+-	row_rest=globalsize - numprocs*int(globalsize/numprocs)
+-
+-	for i in xrange(row_rest):
+-		num_local_rows[i]=num_local_rows[i]+1
+-
+-	i1=0
+-	for i in xrange(rank-1):
+-		i1+=num_local_rows[i]
+-	i2=i1+num_local_rows[rank-1]-1
+-
+-	return i1,i2
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/QueueRequirements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/QueueRequirements.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/QueueRequirements.m	(revision 12996)
+@@ -1,35 +0,0 @@
+-function QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,queue,np,time)
+-%QUEUEREQUIREMENTS - queue requirements in time, number of cpus, by name of queue.
+-%
+-%   Usage: 
+-%      QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,np,time)
+-
+-%Ok, go through requirements for current queue:
+-index=ismemberi(queue,available_queues);
+-if  ~index,
+-	%ok, either we a generic cluster, with 'none' queue, or we could not find the queue reqruirements
+-	if strcmpi(available_queues{1},'none'),
+-		%reset index to 1, so we can fish the requirements
+-		index=1;
+-	else
+-		string=available_queues{1};
+-		for i=2:length(available_queues),
+-			string=[string ' ' available_queues{i}];
+-		end
+-		error(['QueueRequirements error message: availables queues are ' string]);
+-	end
+-end
+-
+-%check on time requirements
+-rtime=queue_requirements_time(index);
+-if time<=0,
+-	error('QueueRequirements: time should be a positive number');
+-end
+-if time>rtime,
+-	error(['QueueRequirements: time should be < ' num2str(rtime) ' for queue: ' queue]);
+-end
+-
+-%check on np requirements
+-if np<=0,
+-	error('QueueRequirements: np should be a positive number');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Cluster/parallelrange.m	(revision 12996)
+@@ -1,23 +0,0 @@
+-function [i1,i2]=parallelrange(rank,numprocs,globalsize)
+-%PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
+-%
+-%   Usage: 
+-%      [i1,i1]=parallelrange(rank,numprocs,globalsize)
+-
+-num_local_rows=zeros(numprocs,1);
+-
+-for i=1:numprocs,
+-	%we use floor. we under distribute rows. The rows left  are then redistributed, therefore resulting in a more even distribution.
+-	num_local_rows(i)=floor(globalsize/numprocs);
+-end
+-
+-
+-%There may be some rows left. Distribute evenly.
+-row_rest=globalsize - numprocs*floor(globalsize/numprocs);
+-
+-for i=1:row_rest,
+-	num_local_rows(i)=num_local_rows(i)+1;
+-end
+-
+-i1=sum(num_local_rows(1:rank-1))+1;
+-i2=i1+num_local_rows(rank)-1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/kml2expg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/kml2expg.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/kml2expg.m	(revision 12996)
+@@ -1,13 +0,0 @@
+-function kml2expg(filename)
+-
+-	[path,name,ext]=fileparts(filename);
+-
+-	if strcmpi(ext,'.kmz'),
+-		eval(['!unzip ' filename]);
+-		eval(['!mv doc.kml ' name '.kml']);
+-		kml2exp([name '.kml'],[name '.exp']);
+-		expll2xy([name '.exp'],1);
+-	end
+-
+-	kml2exp([name '.kml'],[name '.exp']);
+-	expll2xy([name '.exp'],1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/exp2kml.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/exp2kml.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/exp2kml.m	(revision 12996)
+@@ -1,19 +0,0 @@
+-function exp2kml(input,output)
+-%EXP2KML: transform Argus exp file to kml
+-%
+-% Usage:    exp2kml('temp.exp','temp2.kml')
+-%
+-%
+-
+-
+-%First, read exp file
+-domain=expread(input);
+-
+-
+-%then transform: 
+-string=ge_plot(domain.x,domain.y,'name',domain.name);
+-
+-%open kml file for writing: 
+-fid=fopen(output,'w');
+-fprintf(fid,'%s',string);
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/kml2exp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/kml2exp.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Kml/kml2exp.m	(revision 12996)
+@@ -1,29 +0,0 @@
+-function kml2exp(input,output)
+-%KML2EXP: transform kml file Argus exp file.
+-%
+-% Usage:    kmltoexp('temp.kml','temp2.exp')
+-%
+-%
+-
+-
+-
+-
+-%First, read polygon kml file.
+-structure=kml_shapefile(input);
+-	
+-%create exp file: 
+-domain=struct();
+-for i=1:length(structure),
+-
+-	if isfield(structure,'name'),
+-		domain(end+1).name=structure(i).name;
+-	else
+-		domain(end+1).name='NaN';
+-	end
+-
+-	domain(end).density=1;
+-	domain(end).x=structure(i).X;
+-	domain(end).y=structure(i).Y;
+-end
+-domain=domain(2:end);
+-expwrite(domain,output);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetMarineIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 12996)
+@@ -1,107 +0,0 @@
+-function md=SetMarineIceSheetBC(md,varargin)
+-%SETICEMARINESHEETBC - Create the boundary conditions for diagnostic and thermal models for a  Marine Ice Sheet with Ice Front
+-%
+-%   Neumann BC are used on the ice front (an ARGUS contour around the ice front
+-%   can be given in input, or it will be deduced as onfloatingice & onboundary)
+-%   Dirichlet BC are used elsewhere for diagnostic
+-%
+-%   Usage:
+-%      md=SetMarineIceSheetBC(md,icefrontfile)
+-%      md=SetMarineIceSheetBC(md)
+-%
+-%   Example:
+-%      md=SetMarineIceSheetBC(md,'Front.exp')
+-%      md=SetMarineIceSheetBC(md)
+-%
+-%   See also: SETICESHELFBC, SETMARINEICESHEETBC
+-
+-%node on Dirichlet (boundary and ~icefront)
+-if nargin==2,
+-	%User provided Front.exp, use it
+-	icefrontfile=varargin{1};
+-	if ~exist(icefrontfile)
+-		error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']);
+-	end
+-	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2);
+-	vertexonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
+-else
+-	%Guess where the ice front is
+-	vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
+-	vertexonfloatingice(md.mesh.elements(find(md.mask.elementonfloatingice),:))=1;
+-	vertexonicefront=double(md.mesh.vertexonboundary & vertexonfloatingice);
+-end
+-pos=find(md.mesh.vertexonboundary & ~vertexonicefront);
+-if isempty(pos),
+-	warning('SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually')
+-end
+-md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvx(pos)=0;
+-md.diagnostic.spcvy(pos)=0;
+-md.diagnostic.spcvz(pos)=0;
+-md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
+-
+-%Dirichlet Values
+-if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
+-	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
+-	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
+-	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
+-else
+-	disp('      boundary conditions for diagnostic model: spc set as zero');
+-end
+-
+-md.hydrology.spcwatercolumn=zeros(md.mesh.numberofvertices,2);
+-pos=find(md.mesh.vertexonboundary); 
+-md.hydrology.spcwatercolumn(pos,1)=1;
+-
+-%segment on Neumann (Ice Front)
+-pos=find(vertexonicefront(md.mesh.segments(:,1)) | vertexonicefront(md.mesh.segments(:,2)));
+-if (md.mesh.dimension==2)
+-	pressureload=md.mesh.segments(pos,:);
+-elseif md.mesh.dimension==3
+-	pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
+-	pressureload=[];
+-	for i=1:md.mesh.numberoflayers-1,
+-		pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
+-	end
+-end
+-
+-%Add water or air enum depending on the element
+-pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))+ 0*md.mask.elementongroundedice(pressureload(:,end))];
+-
+-%plug onto model
+-md.diagnostic.icefront=pressureload;
+-
+-
+-%Create zeros basalforcings and surfaceforcings
+-if (isnan(md.surfaceforcings.precipitation)& (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
+-	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.precipitation specified: values set as zero');
+-end
+-if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
+-	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.mass_balance specified: values set as zero');
+-end
+-if isnan(md.basalforcings.melting_rate),
+-	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no basalforcings.melting_rate specified: values set as zero');
+-end
+-if isnan(md.balancethickness.thickening_rate),
+-	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no balancethickness.thickening_rate specified: values set as zero');
+-end
+-
+-md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-
+-if (length(md.initialization.temperature)==md.mesh.numberofvertices),
+-	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
+-	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
+-	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
+-		md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1);
+-		md.basalforcings.geothermalflux(find(md.mask.vertexongroundedice))=50*10^-3; %50mW/m2
+-	end
+-else
+-	disp('      no thermal boundary conditions created: no observed temperature found');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceSheetBC.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceSheetBC.m	(revision 12996)
+@@ -1,64 +0,0 @@
+-function md=SetIceSheetBC(md)
+-%SETICESHEETBC - Create the boundary conditions for diagnostic and thermal models for an IceSheet with no Ice Front
+-%
+-%   Usage:
+-%      md=SetIceSheetBC(md)
+-%
+-%   See also: SETICESHELFBC, SETMARINEICESHEETBC
+-
+-%node on Dirichlet
+-pos=find(md.mesh.vertexonboundary);
+-md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvx(pos)=0;
+-md.diagnostic.spcvy(pos)=0;
+-md.diagnostic.spcvz(pos)=0;
+-md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
+-
+-%Dirichlet Values
+-if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
+-	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
+-	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
+-	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
+-else
+-	disp('      boundary conditions for diagnostic model: spc set as zero');
+-end
+-
+-%segment on neumann (Ice Front) -> none
+-if (md.mesh.dimension==2)
+-	md.diagnostic.icefront=zeros(0,4);
+-else
+-	md.diagnostic.icefront=zeros(0,6);
+-end
+-
+-%Create zeros basal melting rate and surface mass balance if not specified
+-if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
+-	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.precipitation specified: values set as zero');
+-end
+-if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
+-	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.mass_balance specified: values set as zero');
+-end
+-if isnan(md.basalforcings.melting_rate),
+-	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no basalforcings.melting_rate specified: values set as zero');
+-end
+-if isnan(md.balancethickness.thickening_rate),
+-	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no balancethickness.thickening_rate specified: values set as zero');
+-end
+-
+-md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-
+-if (length(md.initialization.temperature)==md.mesh.numberofvertices),
+-	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
+-	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
+-	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
+-		md.basalforcings.geothermalflux=50*10^-3*ones(md.mesh.numberofvertices,1); %50 mW/m^2
+-	end
+-else
+-	disp('      no thermal boundary conditions created: no observed temperature found');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.py	(revision 12996)
+@@ -1,98 +0,0 @@
+-import os
+-import numpy
+-
+-def SetIceShelfBC(md,icefrontfile=''):
+-	"""
+-	SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
+-
+-	   Neumann BC are used on the ice front (an ANRGUS contour around the ice front
+-	   must be given in input)
+-	   Dirichlet BC are used elsewhere for diagnostic
+-
+-	   Usage:
+-	      md=SetIceShelfBC(md,varargin)
+-
+-	   Example:
+-	      md=SetIceShelfBC(md);
+-	      md=SetIceShelfBC(md,'Front.exp');
+-
+-	   See also: SETICESHEETBC, SETMARINEICESHEETBC
+-	"""
+-
+-	#node on Dirichlet (boundary and ~icefront)
+-	if icefrontfile:
+-		if not os.path.exists(icefrontfile):
+-			raise IOError("SetIceShelfBC error message: ice front file '%s' not found." % icefrontfile)
+-		nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2)
+-		nodeonicefront=double(md.mesh.vertexonboundary and nodeinsideicefront)
+-	else:
+-		nodeonicefront=numpy.zeros(md.mesh.numberofvertices)
+-
+-#	pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
+-	pos=[i for i,(vob,noif) in enumerate(zip(md.mesh.vertexonboundary,nodeonicefront)) if vob and not noif]
+-	md.diagnostic.spcvx=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-	md.diagnostic.spcvy=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-	md.diagnostic.spcvz=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-	md.diagnostic.spcvx[pos]=0
+-	md.diagnostic.spcvy[pos]=0
+-	md.diagnostic.spcvz[pos]=0
+-	md.diagnostic.referential=float('NaN')*numpy.ones((md.mesh.numberofvertices,6))
+-
+-	#Dirichlet Values
+-	if numpy.size(md.inversion.vx_obs)==md.mesh.numberofvertices and numpy.size(md.inversion.vy_obs)==md.mesh.numberofvertices:
+-		print '      boundary conditions for diagnostic model: spc set as observed velocities'
+-		md.diagnostic.spcvx[pos]=md.inversion.vx_obs[pos]
+-		md.diagnostic.spcvy[pos]=md.inversion.vy_obs[pos]
+-	else:
+-		print '      boundary conditions for diagnostic model: spc set as zero'
+-
+-	#segment on Ice Front
+-	#segment on Neumann (Ice Front)
+-#	pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
+-	pos=[i for i,(noif1,noif2) in enumerate(zip(nodeonicefront[md.mesh.segments[:,0].astype('int')-1],nodeonicefront[md.mesh.segments[:,1].astype('int')-1])) if noif1 or noif2]
+-	if   md.mesh.dimension==2:
+-		pressureload=md.mesh.segments[pos,:]
+-	elif md.mesh.dimension==3:
+-#		pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
+-		pressureload_layer1=numpy.concatenate((md.mesh.segments[pos,0:2],md.mesh.segments[pos,1]+md.mesh.numberofvertices2d,md.mesh.segments[pos,0]+md.mesh.numberofvertices2d,md.mesh.segments[pos,2]),axis=1)
+-		pressureload=numpy.zeros((0,5))
+-		for i in xrange(1,md.mesh.numberoflayers):
+-#			pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
+-			pressureload=numpy.concatenate((pressureload,numpy.concatenate((pressureload_layer1[:,0:3]+(i-1)*md.mesh.numberofvertices2d,pressureload_layer1[:,4]+(i-1)*md.mesh.numberofelements2d),axis=1)),axis=0)
+-
+-	#Add water or air enum depending on the element
+-#	pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))];
+-	pressureload=numpy.concatenate((pressureload,1*md.mask.elementonfloatingice[pressureload[:,-1].astype('int')-1].reshape((-1,1))),axis=1)
+-
+-	#plug onto model
+-	md.diagnostic.icefront=pressureload
+-
+-	#Create zeros basalforcings and surfaceforcings
+-	if numpy.isnan(md.surfaceforcings.precipitation).all():
+-		md.surfaceforcings.precipitation=numpy.zeros(md.mesh.numberofvertices)
+-		print '      no surfaceforcings.precipitation specified: values set as zero'
+-	if numpy.isnan(md.surfaceforcings.mass_balance).all():
+-		md.surfaceforcings.mass_balance=numpy.zeros(md.mesh.numberofvertices)
+-		print '      no surfaceforcings.mass_balance specified: values set as zero'
+-	if numpy.isnan(md.basalforcings.melting_rate).all():
+-		md.basalforcings.melting_rate=numpy.zeros(md.mesh.numberofvertices)
+-		print '      no basalforcings.melting_rate specified: values set as zero'
+-	if numpy.isnan(md.balancethickness.thickening_rate).all():
+-		md.balancethickness.thickening_rate=numpy.zeros(md.mesh.numberofvertices)
+-		print '      no balancethickness.thickening_rate specified: values set as zero'
+-
+-	md.prognostic.spcthickness=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-	md.balancethickness.spcthickness=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-
+-	if numpy.size(md.initialization.temperature)==md.mesh.numberofvertices:
+-		md.thermal.spctemperature=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-#		pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
+-		pos=[i for i,vos in enumerate(md.mesh.vertexonsurface) if vos]
+-		md.thermal.spctemperature[pos]=md.initialization.temperature[pos]    # impose observed temperature on surface
+-		if not numpy.size(md.basalforcings.geothermalflux)==md.mesh.numberofvertices:
+-			md.basalforcings.geothermalflux=numpy.zeros(md.mesh.numberofvertices)
+-	else:
+-		print '      no thermal boundary conditions created: no observed temperature found'
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/BC/SetIceShelfBC.m	(revision 12996)
+@@ -1,95 +0,0 @@
+-function md=SetIceShelfBC(md,varargin)
+-%SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
+-%
+-%   Neumann BC are used on the ice front (an ANRGUS contour around the ice front
+-%   must be given in input)
+-%   Dirichlet BC are used elsewhere for diagnostic
+-%
+-%   Usage:
+-%      md=SetIceShelfBC(md,varargin)
+-%
+-%   Example:
+-%      md=SetIceShelfBC(md);
+-%      md=SetIceShelfBC(md,'Front.exp');
+-%
+-%   See also: SETICESHEETBC, SETMARINEICESHEETBC
+-
+-%node on Dirichlet (boundary and ~icefront)
+-if nargin==2,
+-	icefrontfile=varargin{1};
+-	if ~exist(icefrontfile), error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']); end
+-	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2);
+-	nodeonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
+-elseif nargin==1,
+-	nodeonicefront=zeros(md.mesh.numberofvertices,1);
+-else
+-	help SetIceShelfBC
+-	error('bad usage');
+-end
+-pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
+-md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvx(pos)=0;
+-md.diagnostic.spcvy(pos)=0;
+-md.diagnostic.spcvz(pos)=0;
+-md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
+-
+-%Dirichlet Values
+-if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
+-	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
+-	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
+-	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
+-else
+-	disp('      boundary conditions for diagnostic model: spc set as zero');
+-end
+-
+-%segment on Ice Front
+-%segment on Neumann (Ice Front)
+-pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
+-if (md.mesh.dimension==2)
+-	pressureload=md.mesh.segments(pos,:);
+-elseif md.mesh.dimension==3
+-	pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
+-	pressureload=[];
+-	for i=1:md.mesh.numberoflayers-1,
+-		pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
+-	end
+-end
+-
+-%Add water or air enum depending on the element
+-pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))];
+-
+-%plug onto model
+-md.diagnostic.icefront=pressureload;
+-
+-%Create zeros basalforcings and surfaceforcings
+-if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
+-	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.precipitation specified: values set as zero');
+-end
+-if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
+-	        md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+-		disp('      no surfaceforcings.mass_balance specified: values set as zero');
+-end
+-if isnan(md.basalforcings.melting_rate),
+-	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no basalforcings.melting_rate specified: values set as zero');
+-end
+-if isnan(md.balancethickness.thickening_rate),
+-	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no balancethickness.thickening_rate specified: values set as zero');
+-end
+-
+-md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-
+-if (length(md.initialization.temperature)==md.mesh.numberofvertices),
+-	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
+-	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
+-	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
+-		md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1);
+-	end
+-else
+-	disp('      no thermal boundary conditions created: no observed temperature found');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Numerics/cfl_step.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Numerics/cfl_step.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Numerics/cfl_step.m	(revision 12996)
+@@ -1,23 +0,0 @@
+-function maxtime=cfl_step(md,vx,vy);
+-%CFL_STEP - return the maximum time step for the model in years
+-%
+-%   Dt < 0.5 / ( u/Dx +v/Dy )
+-%
+-%   Usage:
+-%      maxtime=cfl_step(md,vx,vy);
+-%
+-%   Example:
+-%      dt=cfl_step(md,md.results.DiagnosticSolution.Vx,md.results.DiagnosticSolution.Vy)
+-
+-%Check length of velocities 
+-if size(vx,1)~=md.mesh.numberofvertices & size(vy,1)~=md.mesh.numberofvertices,
+-	error('timestpes error message: size of velocity components must be the same as md.mesh.numberofvertices');
+-end
+-
+-index=md.mesh.elements;
+-edgex=max(md.mesh.x(index),[],2)-min(md.mesh.x(index),[],2);
+-edgey=max(md.mesh.y(index),[],2)-min(md.mesh.y(index),[],2);
+-vx=max(abs(vx(index)),[],2);
+-vy=max(abs(vy(index)),[],2);
+-
+-maxtime=1/2*min(1./(vx./edgex+vy./edgey));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/isnans.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/isnans.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/isnans.py	(revision 12996)
+@@ -1,18 +0,0 @@
+-import numpy
+-
+-def isnans(array):
+-	"""
+-	ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
+-
+-	   Usage:    isnans(array)
+-
+-	      See also : ISNAN 
+-	"""
+-
+-	if   isinstance(array,(tuple,list,dict)): 
+-		returnvalue=0
+-	else:
+-		returnvalue=numpy.isnan(array)
+-
+-	return returnvalue
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/round_ice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/round_ice.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/round_ice.m	(revision 12996)
+@@ -1,38 +0,0 @@
+-function new_x=round_ice(x,numnonzeros)
+-%ROUND_ICE - rounds up x so that it has only numnonzeros non zero digits
+-%
+-%   numnonzeros must be an integer larger or equal to 1
+-%
+-%   Usage:
+-%      new_x=round_ice(x,numnonzeros)
+-
+-%some checks
+-if (nargin ~=2 | nargout>1),
+-	error('round_ice usage: new_x=round_ice(x,numonzeros)');
+-end
+-if ~isnumeric(x)
+-	error('round_ice error message: x must be a number and numzeros an integer');
+-end
+-if round(numnonzeros)~=numnonzeros
+-	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
+-end
+-if any(numnonzeros<1)
+-	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
+-end
+-if (length(numnonzeros)~=1 & size(numnonzeros)~=size(x))
+-	error('round_ice error message: numnonzeros must be an integer larger or equal to 1 or a list of integers of length length(x)')
+-end
+-
+-%figure out how long x is
+-lengthx=ceil(log10(abs(x)));
+-
+-%if x contains 0, lengthx=-Inf
+-lengthx(isinf(lengthx))=1;
+-
+-%get its sign
+-si=sign(x);
+-
+-%rule out zeros
+-new_x=si.*round(abs(x).*10.^(-lengthx+numnonzeros)).*10.^(lengthx-numnonzeros);
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/isnans.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/isnans.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/isnans.m	(revision 12996)
+@@ -1,15 +0,0 @@
+-function returnvalue=isnans(array)
+-%ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
+-%
+-%  Usage:    isnans(array)
+-%
+-%  See also : ISNAN 
+-
+-
+-if isstruct(array), 
+-	returnvalue=0;
+-elseif iscell(array)
+-	returnvalue=0;
+-else
+-	returnvalue=isnan(array);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/fixdec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/fixdec.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Math/fixdec.m	(revision 12996)
+@@ -1,41 +0,0 @@
+-function y = fixdec(x, n)
+-%FIXDEC -  Round towards zero with a specified number of decimals.
+-%
+-%   This routine rounds the elements of X to N decimals.
+-%
+-%   Usage:
+-%      y = fixdec(x, n)
+-%
+-%   Example:
+-%      fixdec(10*sqrt(2) + i*pi/10, 4) returns 14.1421 + 0.3141i
+-%
+-%   See also: FIX, FLOOR, CEIL, ROUND, FIXDIG, ROUNDDEC, ROUNDDIG.
+-
+-%   Author:      Peter J. Acklam
+-%   Time-stamp:  2004-09-22 20:08:10 +0200
+-%   E-mail:      pjacklam@online.no
+-%   URL:         http://home.online.no/~pjacklam
+-
+-   % Check number of input arguments.
+-   error(nargchk(2, 2, nargin));
+-
+-   % Quick exit if either argument is empty.
+-   if (isempty(x) |isempty(n))
+-      y = [];
+-      return
+-   end
+-
+-   % Get size of input arguments.
+-   size_x   = size(x);
+-   size_n   = size(n);
+-   scalar_x = all(size_x == 1);           % True if x is a scalar.
+-   scalar_n = all(size_n == 1);           % True if n is a scalar.
+-
+-   % Check size of input arguments.
+-   if ~scalar_x & ~scalar_n & ~isequal(size_x, size_n)
+-      error(['When both arguments are non-scalars they must have' ...
+-             ' the same size']);
+-   end
+-
+-   f = 10.^n;
+-   y = fix(x .* f) ./ f;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.m	(revision 12996)
+@@ -1,57 +0,0 @@
+-function flag=FlagElements(md,region),
+-%FLAGELEMENTS - flag the elements in an region
+-%
+-%   The region can be given with an exp file, a list of elements.
+-%
+-%   Usage: 
+-%      flag=FlagElements(md,region);
+-%
+-%   Example:
+-%      flag=FlagElements(md,'all');
+-%      flag=FlagElements(md,'');
+-%      flag=FlagElements(md,'Domain.exp');
+-%      flag=FlagElements(md,'~Domain.exp');
+-%      flag=FlagElements(md,md.mask.elementongroundedice);
+-
+-	if ischar(region),
+-		if isempty(region),
+-			flag=zeros(md.mesh.numberofelements,1);
+-			invert=0;
+-		elseif strcmpi(region,'all')
+-			flag=ones(md.mesh.numberofelements,1);
+-			invert=0;
+-		else
+-			%make sure that we actually don't want the elements outside the domain outline!
+-			if strcmpi(region(1),'~'),
+-				region=region(2:length(region));
+-				invert=1;
+-			else
+-				invert=0;
+-			end
+-
+-			%does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
+-			if ~exist(region,'file'),
+-				if (length(region)>3 & ~strcmp(region(end-3),'.exp')),
+-					error(['Error: File ' region ' not found!']);
+-				end
+-				[xlim,ylim]=basinzoom('basin',region);
+-				flag_nodes=double(md.mesh.x<xlim(2) & md.mesh.x>xlim(1) &  md.mesh.y<ylim(2) & md.mesh.y>ylim(1));
+-				flag=prod(flag_nodes(md.mesh.elements),2);
+-			else
+-				%ok, flag elements
+-				flag=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,region,'element',1);
+-			end
+-		end
+-		if invert,
+-			flag=~flag;
+-		end
+-	elseif isfloat(region) | islogical(region),
+-		if size(region,1)~=md.mesh.numberofelements,
+-			help FlagElements
+-			error('Flaglist for region must be of same size as number of elements in model');
+-		end
+-		flag=region;
+-	else
+-		error('Invalid region option');
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/find_point.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/find_point.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/find_point.m	(revision 12996)
+@@ -1,14 +0,0 @@
+-function f=find_point(tabx,taby,pointx,pointy)
+-%FIND_POINT - find closest point
+-%
+-%   find which point of the list (tabx,taby) is
+-%   the closest to (poinx,pointy)
+-%
+-%   Usage:
+-%      f=find_point(tabx,taby,pointx,pointy)
+-
+-%Compute distance between point and cloud of points
+-distance=sqrt((tabx-pointx).^2+(taby-pointy).^2);
+-
+-%find index of the minimum distance and return the first one only
+-f=find(distance==min(min(distance)),1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/SegIntersect.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/SegIntersect.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/SegIntersect.m	(revision 12996)
+@@ -1,81 +0,0 @@
+-function bool=SegIntersect(seg1,seg2)
+-%SEGINTERSECT - test of segments intersection
+-%
+-%   return 1 if the two segments intersect
+-%   seg1=[x1 y1; x2 y2]
+-%   seg2=[x1 y1; x2 y2]
+-%
+-%   Usage:
+-%      bool=SegIntersect(seg1,seg2)
+-
+-bool=1;
+-
+-xA=seg1(1,1); yA=seg1(1,2);
+-xB=seg1(2,1); yB=seg1(2,2);
+-xC=seg2(1,1); yC=seg2(1,2);
+-xD=seg2(2,1); yD=seg2(2,2);
+-
+-O2A=[xA;yA]-[xD/2+xC/2;yD/2+yC/2];
+-O2B=[xB;yB]-[xD/2+xC/2;yD/2+yC/2];
+-O1C=[xC;yC]-[xA/2+xB/2;yB/2+yA/2];
+-O1D=[xD;yD]-[xA/2+xB/2;yB/2+yA/2];
+-
+-n1=[yA-yB;xB-xA]; %normal vector to segA
+-n2=[yC-yD;xD-xC]; %normal vectot to segB
+-
+-test1=n2'*O2A;
+-test2=n2'*O2B;
+-
+-if test1*test2>0
+-	bool=0;
+-	return;
+-end
+-
+-test3=n1'*O1C;
+-test4=n1'*O1D;
+-
+-if test3*test4>0
+-	bool=0;
+-	return;
+-end
+-
+-%if colinear
+-if test1*test2==0 & test3*test4==0 & det([n1 n2])==0
+-
+-	%projection on the axis O1O2
+-	O2O1=[xA/2+xB/2;yB/2+yA/2]-[xD/2+xC/2;yD/2+yC/2];
+-	O1A=O2O1'*(O2A-O2O1);
+-	O1B=O2O1'*(O2B-O2O1);
+-	O1C=O2O1'*O1C;
+-	O1D=O2O1'*O1D;
+-	
+-	%test if one point is included in the other segment (->bool=1)
+-	if (O1C-O1A)*(O1D-O1A)<0
+-		bool=1;
+-		return;
+-	end
+-	if (O1C-O1B)*(O1D-O1B)<0
+-		bool=1;
+-		return;
+-	end
+-	if (O1A-O1C)*(O1B-O1C)<0
+-		bool=1;
+-		return;
+-	end
+-	if (O1A-O1D)*(O1B-O1D)<0
+-		bool=1;
+-		return;
+-	end
+-
+-	 %test if the 2 segments have the same middle (->bool=1)
+-	if O2O1==0
+-		bool=1;
+-		return;
+-	end
+-
+-	%else
+-	bool=0;
+-	return;
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Geometry/FlagElements.py	(revision 12996)
+@@ -1,62 +0,0 @@
+-import numpy
+-import os
+-#from basinzoom import *
+-#from ContourToMesh import *
+-from MatlabFuncs import *
+-
+-def FlagElements(md,region):
+-	"""
+-	FLAGELEMENTS - flag the elements in an region
+-
+-	   The region can be given with an exp file, a list of elements.
+-
+-	   Usage: 
+-	      flag=FlagElements(md,region);
+-
+-	   Example:
+-	      flag=FlagElements(md,'all');
+-	      flag=FlagElements(md,'');
+-	      flag=FlagElements(md,'Domain.exp');
+-	      flag=FlagElements(md,'~Domain.exp');
+-	      flag=FlagElements(md,md.mask.elementongroundedice);
+-	"""
+-
+-	if   isinstance(region,str):
+-		if   not region:
+-			flag=numpy.zeros(md.mesh.numberofelements,'bool')
+-			invert=0
+-		elif strcmpi(region,'all'):
+-			flag=numpy.ones(md.mesh.numberofelements,'bool')
+-			invert=0
+-		else:
+-			#make sure that we actually don't want the elements outside the domain outline!
+-			if strcmpi(region[0],'~'):
+-				region=region[1:]
+-				invert=1
+-			else:
+-				invert=0
+-
+-			#does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
+-			if not os.path.exists(region):
+-				if len(region)>3 and not strcmp(region[-4:],'.exp'):
+-					raise IOError("Error: File 'region' not found!" % region)
+-				xlim,ylim=basinzoom('basin',region)
+-				flag_nodes=numpy.logical_and(numpy.logical_and(md.mesh.x<xlim[1],md.mesh.x>xlim[0]),numpy.logical_and(md.mesh.y<ylim[1],md.mesh.y>ylim[0])).astype(float)
+-				flag=numpy.prod(flag_nodes[md.mesh.elements],axis=1)
+-			else:
+-				#ok, flag elements
+-				flag=ContourToMesh(md.mesh.elements[:,0:3],md.mesh.x,md.mesh.y,region,'element',1)
+-
+-		if invert:
+-			flag=numpy.logical_not(flag)
+-
+-	elif isinstance(region,numpy.nparray) or isinstance(region,bool):
+-		if not numpy.size(region,0)==md.mesh.numberofelements:
+-			raise TypeError("Flaglist for region must be of same size as number of elements in model.")
+-		flag=region
+-
+-	else:
+-		raise TypeError("Invalid region option")
+-
+-	return flag
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Ecco3/ecco32issm.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Ecco3/ecco32issm.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Ecco3/ecco32issm.m	(revision 12996)
+@@ -1,8 +0,0 @@
+-function nodefield=ecco32issm(field,transition,xecco3,yecco3)
+-
+-	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
+-	nodefieldlinear=zeros(length(xecco3linear),1);
+-	nodefieldlinear(transition(:,1))=field(transition(:,2));
+-	nodefield=xecco3;
+-	nodefield(:)=nodefieldlinear;
+-	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Ecco3/issm2ecco3.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Ecco3/issm2ecco3.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Ecco3/issm2ecco3.m	(revision 12996)
+@@ -1,8 +0,0 @@
+-function nodefield=issm2ecco3(field,transition,xecco3,yecco3)
+-
+-	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
+-	nodefieldlinear=zeros(length(xecco3linear),1);
+-	nodefieldlinear(transition(:,1))=field(transition(:,2));
+-	nodefield=xecco3;
+-	nodefield(:)=nodefieldlinear;
+-	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expremovestraightsegments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expremovestraightsegments.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expremovestraightsegments.m	(revision 12996)
+@@ -1,31 +0,0 @@
+-function expremovestraightsegments(newfilename,filename,cutoff)
+-%EXPREMOVESTRAIGHTSEGMENTS:  remove straight segments connecting contours.
+-%
+-% Usage: expremovestraightsegments('argus.exp',100); 
+-%
+-%
+-
+-a=expread(filename,1);
+-newcontours=a(1);
+-
+-for i=1:length(a),
+-	contour=a(i);
+-	
+-	s=sqrt(contour.x.^2+contour.y.^2);
+-	d=diff(s);
+-	
+-	pos=find(abs(d)>cutoff);
+-	pos=[0;pos;length(contour.x)];
+-
+-	for j=1:length(pos)-1,
+-
+-		newcontour=contour;
+-		newcontour.x=contour.x(pos(j)+1:pos(j+1));
+-		newcontour.y=contour.y(pos(j)+1:pos(j+1));
+-		newcontour.nods=length(newcontour.x);
+-		newcontours(end+1)=newcontour;
+-	end
+-end
+-newcontours=newcontours(2:end);
+-
+-expwrite(newcontours,newfilename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expgen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expgen.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expgen.m	(revision 12996)
+@@ -1,47 +0,0 @@
+-function expgen(file_name,contours,close_flag);
+-%EXPGEN - create an Argus file from x and y arrays
+-%
+-%   Create .exp domain outline type out of x,y  coordinates. 
+-%   The contour defined by arrays x and y should not be closed. 
+-%   Generated domain outline will not be closed, except if close_flag is set to 1.
+-%
+-%   Usage:
+-%      expgen(file_name,contours,close_flag)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%Check on inputs
+-if((close_flag~=0) & (close_flag~=1)),
+-error('close flag must be 0 of 1');
+-end
+-fid=fopen(file_name,'wt');
+-
+-for i=1:length(contours),
+-	if(length(contours(i).x)~=length(contours(i).y)),
+-	error('contours x and y coordinates must be of identical size');
+-	end
+-
+-	%get density for this profile.
+-	if isfield(contours,'density'),
+-		density=contours(i).density;
+-	end
+-
+-	fprintf(fid,'%s\n','## Name:');
+-	fprintf(fid,'%s\n','## Icon:0');
+-	fprintf(fid,'%s\n','# Points Count Value');
+-	if(close_flag==0),
+-	fprintf(fid,'%i %i\n',length(contours(i).x),density);
+-	else
+-	fprintf(fid,'%i %i\n',length(contours(i).x)+1,density);
+-	end
+-	fprintf(fid,'%s\n','# X pos Y pos');
+-	for j=1:length(contours(i).x),
+-	 fprintf(fid,'%f %f\n',contours(i).x(j),contours(i).y(j));
+-	end  
+-
+-	if(close_flag==1),
+-	fprintf(fid,'%f %f\n',contours(i).x(1),contours(i).y(1));
+-	end
+-	fprintf(fid,'%s\n','');
+-end
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expxy2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expxy2ll.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expxy2ll.m	(revision 12996)
+@@ -1,37 +0,0 @@
+-function expxy2ll(filename,sgn,central_meridian,standard_parallel)  
+-%EXPLL2XY: switch exp argus file from lat,long to x,y
+-%   Usage:
+-%      expxy2ll(filename,sgn,central_meridian,standard_parallel)
+-%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
+-%                               -1 : south latitude (default is mer=0  lat=71)
+-
+-
+-%Get central_meridian and standard_parallel depending on hemisphere
+-if nargin==4,
+-	delta = central_meridian;
+-	slat  = standard_parallel;
+-elseif nargin==2
+-	if sgn == 1,
+-		delta = 45; slat = 70;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-	elseif sgn==-1,
+-		delta = 0;  slat = 71;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
+-	else
+-		error('Sign should be either +1 or -1');
+-	end
+-else
+-	help expxy2ll
+-	error('bad usage');
+-end
+-
+-%read filename: 
+-domain=expread(filename);
+-
+-%change to x,y: 
+-for i=1:length(domain),
+-	[domain(i).y domain(i).x]= xy2ll(domain(i).x,domain(i).y,sgn,delta,slat); %watch out to swap lat and long
+-end
+-
+-%write back to filename: 
+-expwrite(domain,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expll2xy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expll2xy.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expll2xy.m	(revision 12996)
+@@ -1,37 +0,0 @@
+-function expll2xy(filename,sgn,central_meridian,standard_parallel)  
+-%EXPLL2XY: switch exp argus file from lat,long to x,y
+-%   Usage:
+-%      expll2xy(filename,sgn,central_meridian,standard_parallel)
+-%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
+-%                               -1 : south latitude (default is mer=0  lat=71)
+-
+-
+-%Get central_meridian and standard_parallel depending on hemisphere
+-if nargin==4,
+-	delta = central_meridian;
+-	slat  = standard_parallel;
+-elseif nargin==2
+-	if sgn == 1,
+-		delta = 45; slat = 70;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-	elseif sgn==-1,
+-		delta = 0;  slat = 71;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
+-	else
+-		error('Sign should be either +1 or -1');
+-	end
+-else
+-	help expll2xy
+-	error('bad usage');
+-end
+-
+-%read filename: 
+-domain=expread(filename);
+-
+-%change to x,y: 
+-for i=1:length(domain),
+-	[domain(i).x domain(i).y]= ll2xy(domain(i).y,domain(i).x,sgn,delta,slat);
+-end
+-
+-%write back to filename: 
+-expwrite(domain,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/clicktoflowline.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/clicktoflowline.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/clicktoflowline.m	(revision 12996)
+@@ -1,24 +0,0 @@
+-function clicktoflowline(index,x,y,u,v,filename)
+-%CLICKTOFLOWLINE - create a flowline ARGUS file
+-%
+-%   create a flowline contour file (named 'filename') by clicking
+-%   on a velocity field once (velocity must be plotted first)
+-%
+-%   Usage: 
+-%      clicktoflowline(index,x,y,u,v,x0,y0,filename)
+-%
+-%   Example: 
+-%      clicktoflowline(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vx_obs,md.inversion.vy_obs,'flowline.exp')
+-
+-%Get click position
+-[x0,y0]=ginput(1);
+-
+-%Get flowline
+-line=flowlines(index,x,y,u,v,x0,y0,200);
+-
+-%plot
+-hold on
+-plot(line.x,line.y,'r-');
+-
+-%Write argus file
+-expwrite(line,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/exptool.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/exptool.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/exptool.m	(revision 12996)
+@@ -1,342 +0,0 @@
+-function exptool(newfile,varargin)
+-%EXPMASTER - allow to create, modify, add, cut, .. segments of domain outline together
+-%
+-%   this routine is used to create, modify, cut,... an Argus file (.exp)
+-%
+-%   exptool(newprofile,'optionname',optionvalue)
+-%      creation of an argus file newprofile
+-%
+-%   Available options:
+-%      - include: include list of existing ARGUS files
+-%      - color: line color (default='r')
+-%      - selectioncolor: line color of selected profiles (default='b')
+-%      - linestyle (default='-')
+-%      - linewidth (default=0.2)
+-%      - marker (default='+')
+-%      - markersize (default=7)
+-%      - markeredgecolor (default='r')
+-%
+-%   Usage:
+-%      exptool(newfile,varargin)
+-%
+-%   Example:
+-%      exptool('domain.exp','include',{'domain1.exp' 'domain2.exp'},'color','g','marker','+')
+-%
+-%   See also EXPDOC
+-
+-%recover options
+-options=pairoptions(varargin{:});
+-
+-%Some checks
+-if ~nargin | nargout
+-	error('exptool usage: exptool(newfile,varargin)')
+-elseif exist(newfile,'file'),
+-	%recursive call to exptool if file already exists
+-	if ~exist(options,'include'),
+-		exptool(newfile,'include',newfile,varargin{:});
+-		return;
+-	end
+-
+-	%check modification
+-	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
+-	if ~strcmpi(choice,'y'),
+-		disp('no modification done ... exiting');
+-		return
+-	end
+-end
+-
+-%Add default options
+-options=addfielddefault(options,'color','r');
+-options=addfielddefault(options,'selectioncolor','b');
+-options=addfielddefault(options,'LineStyle','-');
+-options=addfielddefault(options,'LineWidth',0.2);
+-options=addfielddefault(options,'Marker','+');
+-options=addfielddefault(options,'MarkerSize',7);
+-options=addfielddefault(options,'MarkerEdgeColor','r');
+-
+-%put all the argus profiles given in input in one structure A
+-A=struct([]);
+-numprofiles=0;
+-numpoints=0;
+-closed=[];
+-
+-%initialize the variables with files provided by 'include' option
+-if exist(options,'include'),
+-	files=getfieldvalue(options,'include');
+-	if ischar(files), files={files}; end
+-	for i=1:length(files),
+-		filename=files{i};
+-		if ~exist(filename,'file'),
+-			error(['exptool error message:, ' filename ' does not exist. Exiting...']);
+-		else
+-			%read file
+-			B=expread(filename);
+-			%go through all profiles of B
+-			for i=1:size(B,2)
+-				%plug profile in A
+-				if numprofiles
+-					A(numprofiles+1)=B(i);
+-				else
+-					A=B(i);
+-				end
+-				%update numprofiles and numpoints
+-				numpoints=numpoints+length(B(i).x);
+-				numprofiles=numprofiles+1;
+-				%figure out if the profile is closed or not
+-				if (B(i).x(1)==B(i).x(end) & B(i).y(1)==B(i).y(end) & length(B(i).x)>1 )
+-					closed(numprofiles)=1;
+-				else
+-					closed(numprofiles)=0;
+-				end
+-			end
+-		end
+-	end
+-end
+-
+-%Get root of newfile
+-[path root ext]=fileparts(newfile);
+-
+-%get current figure
+-if ~isempty(get(0,'children')),%if there is already a figure (return the number of opened figures)
+-	set(gcf,'Renderer','zbuffer'); %fixes a bug on Mac OS X (not needed in future Matlab version)
+-	P=get(gcf,'position');
+-	F=getframe(gca);
+-	F=F.cdata;
+-	%get current axis
+-	xlim=get(gca,'Xlim');
+-	ylim=get(gca,'Ylim');
+-	%recreate x_m and y_m
+-	x_m=linspace(xlim(1),xlim(2),size(F,2));
+-	y_m=linspace(ylim(2),ylim(1),size(F,1)); %getframe reverse axis...
+-	%plot the data in another figure
+-	figure; set(gcf,'position',P);
+-	imagesc(x_m,y_m,F); set(gca,'Ydir','normal');
+-	prevplot=1;
+-	prevplot2=1;
+-else
+-	figure
+-	prevplot=0;
+-	prevplot2=0;
+-end
+-
+-%plot existing profile if any
+-hold on
+-
+-%Build backup structre for do and redo
+-backup=cell(1,3);
+-backup{1,1}=A;
+-backup{1,2}=numprofiles;
+-backup{1,3}=numpoints;
+-backup{1,4}=closed;
+-
+-loop=1;
+-counter=1;
+-while loop
+-
+-	%Go through A and rule out the empty profiles
+-	list=[];
+-	for i=1:size(A,2);
+-		if length(A(i).x)==0
+-			list(end+1)=i;
+-			numprofiles=numprofiles-1;
+-		end
+-	end
+-	A(list)=[];
+-	closed(list)=[];
+-
+-	%Now erase all that have been done and plot the new structure A as it is
+-	undoplots(prevplot);
+-	if numprofiles
+-		prevplot2=1;
+-		for i=1:numprofiles
+-			if length(A(i).x)==1,
+-				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-					'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker','o');
+-			else
+-				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			end
+-			prevplot2=prevplot2+1;
+-		end
+-	end
+-
+-	%display menu
+-	title('Main Menu','FontSize',14);
+-	button=menu('Menu','add a profile (open)',...%1
+-		'add a contour (closed)',...              %2
+-		'remove a profile',...                    %3
+-		'modify the position of a point',...      %4
+-		'add points inside a profile',...         %5
+-		'add points at the end of a profile',...  %6
+-		'remove points',...                       %7
+-		'remove several points',...               %8
+-		'cut a segment',...                       %9
+-		'cut a large area',...                    %10
+-		'merge profiles',...                      %11
+-		'close profile',...                       %12
+-		'undo',...                                %13
+-		'redo',...                                %14
+-		'quit');                                  %15
+-
+-
+-	%UNDO??
+-	if button==13;
+-		if counter==1
+-			disp('Already at oldest change');
+-		else
+-			counter=counter-1;
+-			A=backup{counter,1};
+-			numprofiles=backup{counter,2};
+-			numpoints=backup{counter,3};
+-			closed=backup{counter,4};
+-		end
+-	end
+-
+-	%REDO??
+-	if button==14
+-		if counter==size(backup,1)
+-			disp('Already at newest change');
+-		else
+-			counter=counter+1;
+-			A=backup{counter,1};
+-			numprofiles=backup{counter,2};
+-			numpoints=backup{counter,3};
+-			closed=backup{counter,4};
+-		end
+-	end
+-
+-	switch button
+-
+-		case 1
+-
+-			[A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 2
+-
+-			[A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot2,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 3
+-
+-			[A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 4
+-
+-			[A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 5
+-
+-			[A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 6
+-
+-			[A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 7
+-
+-			[A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 8
+-
+-			[A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 9
+-
+-			[A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 10
+-
+-			[A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 11
+-
+-			[A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-
+-		case 12
+-
+-			[A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-			%QUIT
+-		case 15
+-
+-			loop=0;
+-
+-		otherwise
+-
+-			%do nothing
+-
+-	end
+-
+-end
+-
+-hold off
+-
+-%write contour using expwrite
+-title('New file written, exiting...','FontSize',14);
+-if isempty(A)
+-	disp('Profile empty, no file written')
+-else
+-	expwrite(A,newfile);
+-end
+-
+-%close window
+-close;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcontract.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcontract.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcontract.m	(revision 12996)
+@@ -1,34 +0,0 @@
+-function normal_node=expcontract(newfile,oldfile,distance)
+-%EXPCONTRACT - contract or expand a profile, according to the normal.
+-% 
+-%   Usage:
+-%      expcontract(newfile,oldfile,distance)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-
+-contour=expread(oldfile);
+-num=numel(contour.x);
+-
+-normal=zeros(num-1,2);
+-normal_node=zeros(num-1,2);
+-
+-for i=1:num-1,
+-	normal(i,:)=[ contour.y(i)-contour.y(i+1) contour.x(i+1)-contour.x(i)];
+-	normal(i,:)=normal(i,:)/sqrt(normal(i,1)^2+normal(i,2)^2);
+-end
+-
+-normal_node(2:end,:)=[normal(1:end-1,:)+normal(2:end,:)];
+-normal_node(1,:)=normal(1,:)+normal(end,:);
+-
+-normal_node_norm=sqrt(normal_node(:,1).^2+normal_node(:,2).^2);
+-normal_node(:,1)=normal_node(:,1)./normal_node_norm;
+-normal_node(:,2)=normal_node(:,2)./normal_node_norm;
+-
+-contour.x(1:end-1)=contour.x(1:end-1)+distance*normal_node(:,1);
+-contour.y(1:end-1)=contour.y(1:end-1)+distance*normal_node(:,2);
+-
+-contour.x(end)=contour.x(1);
+-contour.y(end)=contour.y(1);
+-
+-expwrite(contour,newfile);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcreatecontour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcreatecontour.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcreatecontour.m	(revision 12996)
+@@ -1,36 +0,0 @@
+-function expcreatecontour(filename);
+-%EXPCREATECONTOUR - create a contour from a list of points
+-%
+-%   expcreatecontour: from a list of (x,y) points (retrieve using ginput on an undetermined
+-%   number of points: used RETURN key to end input), create an Argus .exp 
+-%   file holding the corresponding closed contour.
+-%    
+-%   Usage:
+-%      expcreatecontour(filename)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%Get root of filename
+-[path root ext ver]=fileparts(filename);
+-
+-%Get contour
+-disp('Click on contour points you desire. Type RETURN to end input of points');
+-[x,y]=ginputquick;
+-
+-%close contour
+-x=[x;x(1)];
+-y=[y;y(1);];
+-
+-%plot contour
+-hold on;
+-plot(x,y,'r-');
+-
+-%create structure for expwrite routine
+-a.x=x;
+-a.y=y;
+-a.name=root;
+-a.density=1;
+-
+-%write contour using expwrite
+-expwrite(a,filename);
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/readwrite/expwrite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/readwrite/expwrite.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/readwrite/expwrite.m	(revision 12996)
+@@ -1,38 +0,0 @@
+-function expwrite(a,filename);
+-%EXPWRITE - write an Argus file from a structure given in input
+-%
+-%   This routine write an Argus file form a structure containing the fields:
+-%   x and y of the coordinates of the points.
+-%   The first argument is the structure containing the points coordinates 
+-%   and the second one the file to be write.
+-%
+-%   Usage:
+-%      expwrite(a,filename)
+-% 
+-%   Example:
+-%      expwrite(coordstruct,'domainoutline.exp')
+-%
+-%   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
+-
+-fid=fopen(filename,'w');
+-for n=1:length(a),
+-   
+-   if isfield(a,'name'),
+-	   if ~isempty(a(n).name),
+-		   fprintf(fid,'%s%s\n','## Name:',a(n).name);
+-	   else
+-		   fprintf(fid,'%s\n','## Name:');
+-	   end
+-   else
+-	   fprintf(fid,'%s\n','## Name:');
+-   end
+-   
+-   fprintf(fid,'%s\n','## Icon:0');
+-   fprintf(fid,'%s\n','# Points Count Value');
+-   fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
+-   fprintf(fid,'%s\n','# X pos Y pos');
+-	fprintf(fid,'%10.10f %10.10f\n',[a(n).x a(n).y]');
+-	fprintf(fid,'\n','');
+-   
+-end
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/readwrite/expread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/readwrite/expread.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/readwrite/expread.m	(revision 12996)
+@@ -1,81 +0,0 @@
+-function Struct=expread(filename);
+-%EXPREAD - read a file exp and build a Structure
+-%
+-%   This routine reads a file .exp and build a Structure containing the 
+-%   fields x and y corresponding to the coordinates, one for the filename of
+-%   the exp file, for the density, for the nodes, and a field closed to 
+-%   indicate if the domain is closed. 
+-%   The first argument is the .exp file to be read and the second one (optional) 
+-%   indicate if the last point shall be read (1 to read it, 0 not to).
+-%
+-%   Usage:
+-%      Struct=expread(filename)
+-%  
+-%   Example:
+-%      Struct=expread('domainoutline.exp')
+-%      Struct=expread('domainoutline.exp')
+-%
+-%   See also EXPDOC, EXPWRITEASVERTICES
+-
+-%some checks
+-if ~exist(filename),
+-	error(['expread error message: file ' filename ' not found!']);
+-end
+-
+-%initialize number of profile
+-count=0;
+-
+-%open file
+-fid=fopen(filename,'r');
+-
+-%loop over the number of profiles
+-while (~feof(fid)),
+-
+-	%update number of profiles
+-   count=count+1;
+-
+-   %Get file name
+-	A=fscanf(fid,'%s %s',2);
+-	if ~strncmp(A,'##Name:',7), break; end
+-	if length(A)>7, 
+-		Struct(count).name=A(8:end);
+-	else
+-		Struct(count).name='';
+-	end
+-
+-	%Get Icon
+-	A=fscanf(fid,'%s %s',2);
+-	if ~strncmp(A,'##Icon:',6), break; end
+-
+-	%Get Info
+-	A=fscanf(fid,'%s %s %s %s',4);
+-	if ~strncmp(A,'#Points',7), break; end
+-
+-	%Get number of nods and density
+-   A=fscanf(fid,'%f %f',[1 2]);
+-   Struct(count).nods=A(1);
+-   Struct(count).density=A(2);
+-
+-	%Get Info
+-	A=fscanf(fid,'%s %s %s %s',5);
+-	if ~strncmp(A,'#XposYpos',9), break; end
+-
+-	%Get Coordinates
+-	A=fscanf(fid,'%f %f',[2 Struct(count).nods]);
+-	Struct(count).x=A(1,:)';
+-	Struct(count).y=A(2,:)';
+-
+-	if(Struct(count).nods~=length(Struct(count).x))error(['Profile ' num2str(count) ' reports incorrect length']); end;
+-
+-	%Check if closed
+-	if (Struct(count).nods > 1) && ...
+-	   (Struct(count).x(end) == Struct(count).x(1)) && ...
+-	   (Struct(count).y(end) == Struct(count).y(1))
+-		Struct(count).closed=true;
+-	else
+-		Struct(count).closed=false;
+-	end
+-end
+-
+-%close file
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expexcludeoutliers.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expexcludeoutliers.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expexcludeoutliers.m	(revision 12996)
+@@ -1,18 +0,0 @@
+-function excludeoutliers(newcontourname,contourname,domainname)
+-%EXCLUDEOUTLIERS exclude points of contour that are not within the domain  contour. return new contours in a different file.
+-%
+-%        Usage: excludeoutliers('NewContour.exp','Contour.exp','DomainOutline.exp');
+-%
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-
+-contour=expread(contourname);
+-
+-for i=1:length(contour),
+-	flags=ContourToNodes(contour(i).x,contour(i).y,domainname,0);
+-	contour(i).x=contour(i).x(find(flags));
+-	contour(i).y=contour(i).y(find(flags));
+-end
+-
+-expwrite(contour,newcontourname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expboxgen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expboxgen.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expboxgen.m	(revision 12996)
+@@ -1,99 +0,0 @@
+-function expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
+-%EXPBOXGEN -  creates a domain outline box for a tiff image
+-%
+-%   This function creates a domain outline box for a .tif image for the 
+-%   mosaic tiff. 
+-%   x0,y0 and x1,y1 are the cropping coordinates (upper left and lower right 
+-%   corners in the larger tiff image).
+-%   paramter_filename is the parameter file name for the mosaic tiff image.
+-%   box_filename is self explanatory.
+-%
+-%   Usage:
+-%      expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%initialize
+-nrows=-1;
+-ncols=-1;
+-X0=-1;
+-Y0=-1;
+-posting=-1;
+-
+-%first recover necessary information from the paramter_filename.
+-fid=fopen(parameter_filename,'r');
+-count=1;
+-while(1),
+-tline=fgetl(fid);
+-if ~isstr(tline), break; end;
+-
+-ind=findstr('ant125m',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-a=a(2); a=char(a); a=a(1:length(a)-1);
+-posting=str2num(a);
+-end
+-
+-
+-ind=findstr('no. of rows   :',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-nrows=str2num(char(a(length(a))));
+-end
+-
+-ind=findstr('no. of columns:',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-ncols=str2num(char(a(length(a))));
+-end
+-
+-ind=findstr('Upper Left X:',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-X0=str2num(char(a(length(a))));
+-end
+-
+-ind=findstr('Upper Left Y:',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-Y0=str2num(char(a(length(a))));
+-end
+-
+-
+-end %while(1),
+-
+-
+-fclose(fid);
+-
+-if (X0==-1 | Y0==-1 | nrows==-1  | ncols==-1 | posting==-1),
+-disp(' ');
+-disp(['Could not recover all parameters from ' parameter_filename]);
+-disp('Here are the paramters recovered thus far: ');
+-disp(['no. of rows: ' num2str(nrows)]);
+-disp(['no. of columns: ' num2str(ncols)]);
+-disp(['Upper Left X: ' num2str(X0)]);
+-disp(['Upper Left Y: ' num2str(Y0)]);
+-disp(['Posting: ' num2str(posting)]);
+-end
+-
+-disp(' ');
+-disp(['Recovered the following parameters from ' parameter_filename]);
+-disp(['no. of rows: ' num2str(nrows)]);
+-disp(['no. of columns: ' num2str(ncols)]);
+-disp(['Upper Left X: ' num2str(X0)]);
+-disp(['Upper Left Y: ' num2str(Y0)]);
+-disp(['Posting: ' num2str(posting)]);
+-
+-%Create X,Y, arrays of coordinates:
+-X(1)=X0+x0*posting
+-Y(1)=Y0-y0*posting
+-X(2)=X(1);
+-Y(2)=Y(1)-ny*posting;
+-X(3)=X(1)+nx*posting;
+-Y(3)=Y(2);
+-Y(4)=Y(1);
+-X(4)=X(3);
+-plot(X,Y,'r*');
+-
+-%Create box exp file using X and Y. Loop it.
+-expgen(box_filename,X,Y,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcreateprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcreateprofile.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcreateprofile.m	(revision 12996)
+@@ -1,31 +0,0 @@
+-function expcreateprofile(filename);
+-%EXPCREATEPROFILE - create an Argus file from a list of points
+-%
+-%   expcreateprofile: from a list of (x,y) points (retrieve using ginput on an undetermined
+-%   number of points: used RETURN key to end input), create an Argus .exp 
+-%   file holding the corresponding open profile.
+-%    
+-%   Usage:
+-%      expcreateprofile(filename)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%Get root of filename
+-[path root ext ver]=fileparts(filename);
+-
+-%Get profile
+-disp('Click on profile points you desire. Type RETURN to end input of points');
+-[x,y]=ginputquick;
+-
+-%plot contour
+-hold on;
+-plot(x,y,'r-');
+-
+-%create structure for expwrite routine
+-a.x=x;
+-a.y=y;
+-a.name=root;
+-a.density=1;
+-
+-%write profile using expwrite
+-expwrite(a,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/flowlines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/flowlines.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/flowlines.m	(revision 12996)
+@@ -1,163 +0,0 @@
+-function flowpath=flowlines(index,x,y,u,v,x0,y0,varargin)
+-%FLOWLINES - compute flowlines from a given set of seed points
+-%
+-%   Usage:
+-%      flowpath=flowlines(index,x,y,u,v,x0,y0)
+-%
+-%   the velocity field is given by the couple (u,v) and the coordinates
+-%   of the seed points are (x0,y0). One can use one or several seed 
+-%   points
+-%
+-%   Example:
+-%      flowpath=flowlines(md.mesh.elements,md.mesh.x,md.mesh.y,md.vx,md.initialization.vy,x0,y0)
+-
+-%check input size
+-if nargin>8 | nargin<7,
+-	help flowlines
+-	error('flowlines error message: bad usage');
+-end
+-
+-%check input
+-if (length(x)~=length(y) | length(x)~=length(u) | length(x)~=length(v)),
+-	error('flowlines error message: x,y,u and v must have the same length');
+-end
+-if length(x)<3,
+-	error('flowlines error message: at least one element is required');
+-end
+-if length(x0)~=length(y0),
+-	error('flowlines error message: x0 and y0 do not have the same length');
+-end
+-
+-%get maxiter and precision
+-if nargin==8
+-	maxiter=varargin{1};
+-else
+-	maxiter=200; %maximum number of iterations
+-end
+-precision=1; %division of each segment (higer precision increases number of segments)
+-
+-%check seed points
+-tria=TriaSearch(index,x,y,x0,y0);
+-pos=find(isnan(tria));
+-x0(pos)=[];
+-y0(pos)=[];
+-
+-%initialize other variables
+-N=length(x0);
+-X=x0; Y=y0;
+-flowpath=struct('x',cell(N,1),'y',cell(N,1),'name','','density',1);
+-for i=1:N,
+-	flowpath(i).x=x0(i);
+-	flowpath(i).y=y0(i);
+-end
+-done=zeros(N,1);
+-
+-%get avegared length of each element
+-length_tria=1/3*(sqrt( (x(index(:,1))-x(index(:,2))).^2+(y(index(:,1))-y(index(:,2))).^2 )+...
+-	sqrt((x(index(:,1))-x(index(:,3))).^2+(y(index(:,1))-y(index(:,3))).^2 )+...
+-	sqrt((x(index(:,2))-x(index(:,3))).^2+(y(index(:,2))-y(index(:,3))).^2 ));
+-
+-%take velocity for each element
+-u=u(index)*[1;1;1]/3;
+-v=v(index)*[1;1;1]/3;
+-
+-%initialization:
+-counter=1;
+-
+-while any(~done) 
+-
+-	%find current triangle
+-	queue=find(~done);
+-	tria=TriaSearch(index,x,y,X(queue),Y(queue));
+-
+-	%check that the point is actually inside a triangle of the mesh
+-	listnan=find(isnan(tria));
+-	for i=1:length(listnan)
+-		%remove the last point
+-		flowpath(queue(listnan(i))).x(end)=[];
+-		flowpath(queue(listnan(i))).y(end)=[];
+-		done(queue(listnan(i)))=1;
+-	end
+-	tria(listnan)=[]; 
+-	queue(listnan)=[];
+-
+-	if isempty(tria),
+-		break;
+-	end
+-
+-	%velocity of the current triangle and norm it
+-	ut=u(tria); vt=v(tria); normv=sqrt(ut.^2+vt.^2);
+-	ut=ut./normv;vt=vt./normv;
+-
+-	%check counter
+-	if counter>maxiter
+-		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going forward'])
+-		break
+-	end
+-	counter=counter+1;
+-
+-	%remove stagnant point
+-	done(queue(find(ut==0 & vt==0)))=1;
+-
+-	%build next point
+-	for i=1:length(queue)
+-		X(queue(i))=flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision;
+-		Y(queue(i))=flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision;
+-		flowpath(queue(i)).x=[flowpath(queue(i)).x;flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision];
+-		flowpath(queue(i)).y=[flowpath(queue(i)).y;flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision];
+-	end
+-end
+-
+-%same process but reverse (vel=-vel) to have a vcomplete flow line
+-counter=1;
+-X=x0; Y=y0;
+-done=zeros(N,1);
+-
+-while any(~done) 
+-
+-	%find current triangle
+-	queue=find(~done);
+-	tria=TriaSearch(index,x,y,X(queue),Y(queue));
+-
+-	%check that the point is actually inside a triangle of the mesh
+-	listnan=find(isnan(tria));
+-	for i=1:length(listnan)
+-		%remove the last point
+-		flowpath(queue(listnan(i))).x(1)=[];
+-		flowpath(queue(listnan(i))).y(1)=[];
+-		done(queue(listnan(i)))=1;
+-	end
+-	tria(listnan)=[]; 
+-	queue(listnan)=[];
+-
+-	if isempty(tria),
+-		break;
+-	end
+-
+-	%velocity of the current triangle and norm it
+-	ut=-u(tria); vt=-v(tria); normv=sqrt(ut.^2+vt.^2);
+-	ut=ut./normv;vt=vt./normv;
+-
+-	%check counter
+-	if counter>maxiter
+-		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going backward'])
+-		break
+-	end
+-	counter=counter+1;
+-
+-	%remove stagnant point
+-	done(queue(find(ut==0 & vt==0)))=1;
+-
+-	%build next point
+-	for i=1:length(queue)
+-		X(queue(i))=flowpath(queue(i)).x(1)+ut(i)*length_tria(tria(i))/precision;
+-		Y(queue(i))=flowpath(queue(i)).y(1)+vt(i)*length_tria(tria(i))/precision;
+-		flowpath(queue(i)).x=[flowpath(queue(i)).x(1)+ut(i)*length_tria(tria(i))/precision; flowpath(queue(i)).x];
+-		flowpath(queue(i)).y=[flowpath(queue(i)).y(1)+vt(i)*length_tria(tria(i))/precision; flowpath(queue(i)).y];
+-	end
+-end
+-
+-%EXP compatibility
+-for i=1:length(queue)
+-	flowpath(queue(i)).name=['flowline' num2str(i)];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcreatecircle.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcreatecircle.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcreatecircle.m	(revision 12996)
+@@ -1,31 +0,0 @@
+-function expcreatecircle(filename,x0,y0,radius,numberofnodes)
+-%EXPCREATECIRCLE - create a circular contour corresponding to given parameters
+-%
+-%   Creates a closed argus contour centered on x,y of radius size.
+-%   The contour is made of numberofnodes
+-%
+-%   Usage:
+-%      expcreatecircle(filename,x0,y0,radius,numberofnodes)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%Calculate the cartesians coordinates of the points
+-x_list=ones(numberofnodes+1,1);
+-y_list=ones(numberofnodes+1,1);
+-
+-theta=(0:2*pi/numberofnodes:2*pi*(1-1/numberofnodes))';
+-theta=[theta;0];
+-
+-x_list=radius*x_list.*cos(theta);
+-y_list=radius*y_list.*sin(theta);
+-
+-%offset x_list and y_list by x0 and y0:
+-x_list=x_list+x0;
+-y_list=y_list+y0;
+-
+-contour.x=x_list;
+-contour.y=y_list;
+-contour.density=1;
+-contour.name='circle';
+-
+-expwrite(contour,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/ginputquick.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/ginputquick.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/ginputquick.m	(revision 12996)
+@@ -1,221 +0,0 @@
+-function [out1,out2,out3] = ginput(arg1)
+-%GINPUT - Graphical input from mouse.
+-%
+-%   [X,Y] = GINPUT(N) gets N points from the current axes and returns 
+-%   the X- and Y-coordinates in length N vectors X and Y.  The cursor
+-%   can be positioned using a mouse (or by using the Arrow Keys on some 
+-%   systems).  Data points are entered by pressing a mouse button
+-%   or any key on the keyboard except carriage return, which terminates
+-%   the input before N points are entered.
+-%
+-%   [X,Y] = GINPUT gathers an unlimited number of points until the
+-%   return key is pressed.
+-% 
+-%   [X,Y,BUTTON] = GINPUT(N) returns a third result, BUTTON, that 
+-%   contains a vector of integers specifying which mouse button was
+-%   used (1,2,3 from left) or ASCII numbers if a key on the keyboard
+-%   was used.
+-%
+-%   Usage:
+-%      [out1,out2,out3] = ginput(arg1)
+-
+-%   Copyright 1984-2005 The MathWorks, Inc.
+-%   $Revision: 1.1 $  $Date: 2009/04/03 22:56:26 $
+-
+-out1 = []; out2 = []; out3 = []; y = [];
+-c = computer;
+-if ~strcmp(c(1:2),'PC') 
+-   tp = get(0,'TerminalProtocol');
+-else
+-   tp = 'micro';
+-end
+-
+-if ~strcmp(tp,'none') && ~strcmp(tp,'x') && ~strcmp(tp,'micro'),
+-   if nargout == 1,
+-      if nargin == 1,
+-         out1 = trmginput(arg1);
+-      else
+-         out1 = trmginput;
+-      end
+-   elseif nargout == 2 || nargout == 0,
+-      if nargin == 1,
+-         [out1,out2] = trmginput(arg1);
+-      else
+-         [out1,out2] = trmginput;
+-      end
+-      if  nargout == 0
+-         out1 = [ out1 out2 ];
+-      end
+-   elseif nargout == 3,
+-      if nargin == 1,
+-         [out1,out2,out3] = trmginput(arg1);
+-      else
+-         [out1,out2,out3] = trmginput;
+-      end
+-   end
+-else
+-   
+-   fig = gcf;
+-   figure(gcf);
+-   
+-   if nargin == 0
+-      how_many = -1;
+-      b = [];
+-   else
+-      how_many = arg1;
+-      b = [];
+-      if  ischar(how_many) ...
+-            || size(how_many,1) ~= 1 || size(how_many,2) ~= 1 ...
+-            || ~(fix(how_many) == how_many) ...
+-            || how_many < 0
+-         error('MATLAB:ginput:NeedPositiveInt', 'Requires a positive integer.')
+-      end
+-      if how_many == 0
+-         ptr_fig = 0;
+-         while(ptr_fig ~= fig)
+-            ptr_fig = get(0,'PointerWindow');
+-         end
+-         scrn_pt = get(0,'PointerLocation');
+-         loc = get(fig,'Position');
+-         pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+-         out1 = pt(1); y = pt(2);
+-      elseif how_many < 0
+-         error('MATLAB:ginput:InvalidArgument', 'Argument must be a positive integer.')
+-      end
+-   end
+-   
+-   % Suspend figure functions
+-   state = uisuspend(fig);
+-   
+-   toolbar = findobj(allchild(fig),'flat','Type','uitoolbar');
+-   if ~isempty(toolbar)
+-        ptButtons = [uigettool(toolbar,'Plottools.PlottoolsOff'), ...
+-                     uigettool(toolbar,'Plottools.PlottoolsOn')];
+-        ptState = get (ptButtons,'Enable');
+-        set (ptButtons,'Enable','off');
+-   end
+-
+-   set(fig,'pointer','fullcrosshair');
+-   fig_units = get(fig,'units');
+-   char = 0;
+-
+-   % We need to pump the event queue on unix
+-   % before calling WAITFORBUTTONPRESS 
+-   drawnow
+-   
+-   while how_many ~= 0
+-      % Use no-side effect WAITFORBUTTONPRESS
+-      waserr = 0;
+-      try
+-	keydown = wfbp;
+-      catch
+-	waserr = 1;
+-      end
+-      if(waserr == 1)
+-         if(ishandle(fig))
+-            set(fig,'units',fig_units);
+-	    uirestore(state);
+-            error('MATLAB:ginput:Interrupted', 'Interrupted');
+-         else
+-            error('MATLAB:ginput:FigureDeletionPause', 'Interrupted by figure deletion');
+-         end
+-      end
+-      
+-      ptr_fig = get(0,'CurrentFigure');
+-      if(ptr_fig == fig)
+-         if keydown
+-            char = get(fig, 'CurrentCharacter');
+-            button = abs(get(fig, 'CurrentCharacter'));
+-            scrn_pt = get(0, 'PointerLocation');
+-            set(fig,'units','pixels')
+-            loc = get(fig, 'Position');
+-            pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+-            set(fig,'CurrentPoint',pt);
+-         else
+-            button = get(fig, 'SelectionType');
+-            if strcmp(button,'open') 
+-               button = 1;
+-            elseif strcmp(button,'normal') 
+-               button = 1;
+-            elseif strcmp(button,'extend')
+-               button = 2;
+-            elseif strcmp(button,'alt') 
+-               button = 3;
+-            else
+-               error('MATLAB:ginput:InvalidSelection', 'Invalid mouse selection.')
+-            end
+-         end
+-         pt = get(gca, 'CurrentPoint');
+-         
+-         how_many = how_many - 1;
+-         
+-         if(char == 13) % & how_many ~= 0)
+-            % if the return key was pressed, char will == 13,
+-            % and that's our signal to break out of here whether
+-            % or not we have collected all the requested data
+-            % points.  
+-            % If this was an early breakout, don't include
+-            % the <Return> key info in the return arrays.
+-            % We will no longer count it if it's the last input.
+-            break;
+-         end
+-
+-         out1 = [out1;pt(1,1)];
+-         y = [y;pt(1,2)];
+-         b = [b;button];
+-      end
+-   end
+-   
+-   uirestore(state);
+-   if ~isempty(toolbar) && ~isempty(ptButtons)
+-        set (ptButtons(1),'Enable',ptState{1});
+-        set (ptButtons(2),'Enable',ptState{2});
+-   end
+-   set(fig,'units',fig_units);
+-   
+-   if nargout > 1
+-      out2 = y;
+-      if nargout > 2
+-         out3 = b;
+-      end
+-   else
+-      out1 = [out1 y];
+-   end
+-
+-   line(out1,y);
+-   line([out1(length(out1)) out1(1)],[y(length(y)) y(1)]);
+-   
+-end
+-
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-function key = wfbp
+-%WFBP   Replacement for WAITFORBUTTONPRESS that has no side effects.
+-
+-fig = gcf;
+-current_char = [];
+-
+-% Now wait for that buttonpress, and check for error conditions
+-waserr = 0;
+-try
+-  h=findall(fig,'type','uimenu','accel','C');   % Disabling ^C for edit menu so the only ^C is for
+-  set(h,'accel','');                            % interrupting the function.
+-  keydown = waitforbuttonpress;
+-  current_char = double(get(fig,'CurrentCharacter')); % Capturing the character.
+-  if~isempty(current_char) && (keydown == 1)           % If the character was generated by the 
+-	  if(current_char == 3)                       % current keypress AND is ^C, set 'waserr'to 1
+-		  waserr = 1;                             % so that it errors out. 
+-	  end
+-  end
+-  
+-  set(h,'accel','C');                                 % Set back the accelerator for edit menu.
+-catch
+-  waserr = 1;
+-end
+-drawnow;
+-if(waserr == 1)
+-   set(h,'accel','C');                                % Set back the accelerator if it errored out.
+-   error('MATLAB:ginput:Interrupted', 'Interrupted');
+-end
+-
+-if nargout>0, key = keydown; end
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expbox.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expbox.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expbox.m	(revision 12996)
+@@ -1,41 +0,0 @@
+-function expbox(filename)
+-%EXPBOX - Create a ARGUS file using to clicks
+-%
+-%   Two clicks on a plot are used to generate a rectangular box
+-%   This box is written in EXP format on filename
+-%
+-%   Usage:
+-%      expbox(filename)
+-
+-%check
+-if exist(filename,'file'),
+-	choice=input(['A file ' filename ' already exists, do you want to modify it? (y/n)'],'s');
+-	if ~strcmpi(choice,'y'),
+-		disp('no modification done ... exiting');
+-		return
+-	end
+-end
+-
+-%Get points
+-disp('Click twice to define a rectangular domain. First click for upper left corner, second for lower right corner');
+-[x,y]=ginput(2);
+-
+-x1=x(1);
+-x2=x(2);
+-x3=x2;
+-x4=x1;
+-
+-y1=y(1);
+-y2=y1;
+-y3=y(2);
+-y4=y3;
+-
+-%Build Exp structure
+-A=struct();
+-A.nods=5;
+-A.density=1;
+-A.x=[x1 x2 x3 x4 x1]';
+-A.y=[y1 y2 y3 y4 y1]';
+-
+-%Write structure
+-expwrite(A,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/cutarea.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/cutarea.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/cutarea.m	(revision 12996)
+@@ -1,156 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%CUTAREA - cut several point of a profile
+-%
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile. The user must click 3 times to select the
+-%   area to be removed. Twice to select the tips and one to select
+-%   the part of the profile to be removed
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	hold on
+-	loop=1;
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	end
+-
+-	points=[];
+-
+-	%loop (at least 3 clicks needed)
+-	while loop
+-
+-		%some checks
+-		if numprofiles==0
+-			disp('no profile present, exiting...')
+-			return
+-		end	   
+-		if numpoints<3
+-			disp('at least two points are needed, exiting...')
+-			return
+-		end	   
+-
+-		%select a point
+-		if isempty(points)
+-			title('click on the first tip, RETURN to exit','FontSize',14)
+-		elseif length(points)==1
+-			title('click on the second tip, RETURN to exit','FontSize',14)
+-		else
+-			title('click in the middle of the area to be cut, RETURN to exit','FontSize',14)
+-		end
+-
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-			%get the closest point
+-			%first time, look at all profiles
+-			if isempty(points)
+-				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-				if ((closed(profsel) & length(A(profsel).x)<4) |  (~closed(profsel) & length(A(profsel).x)<3)),
+-					disp('the selected profile has less than 3 points, make another selection');
+-				else
+-					selection=profsel;
+-					points(end+1)=indsel;
+-					plot(A(profsel).x,A(profsel).y,...
+-						'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-					text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
+-				end
+-			else
+-				%get the 2d or 3d point for the given contou
+-				[profsel indsel]=closestpoint(A(selection),1,xi,yi);
+-				if ismember(indsel,points)
+-					disp('the selected points must be distinct')
+-				else
+-					%second click?
+-					if length(points)==1,
+-						points(end+1)=indsel;
+-						text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
+-					%third click?
+-					else
+-						p1=points(1); p2=points(2); p3=indsel;
+-						x=A(selection).x; y=A(selection).y;
+-						if p1<p2
+-							if p3>p1 & p3<p2
+-								if closed(selection)
+-									%open the profile
+-									n=length(A(selection).x);
+-									A(selection).x=[A(selection).x(p2:end-1,1);A(selection).x(1:p1,1)];
+-									A(selection).y=[A(selection).y(p2:end-1,1);A(selection).y(1:p1,1)];
+-									numpoints=numpoints-(n-length(A(selection).x));
+-									closed(selection)=0;
+-								else
+-									%cut in 2 profiles
+-									A(selection).x=x(1:p1);
+-									A(selection).y=y(1:p1);
+-									closed(selection)=0;
+-									A(end+1).x=x(p2:end);
+-									A(end).y=y(p2:end);
+-									A(end).density=A(selection).density;
+-									A(end).name=A(selection).name;
+-									closed(end+1)=0;
+-									numprofiles=numprofiles+1;
+-									numpoints=numpoints-(p2-p1-1);
+-								end
+-							else
+-								%only point removal
+-								n=length(A(selection).x);
+-								A(selection).x=x(p1:p2);
+-								A(selection).y=y(p1:p2);
+-								numpoints=numpoints-(n-length(A(selection).x));
+-								closed(selection)=0;
+-							end
+-						else
+-							if p3>p2 & p3<p1
+-								if closed(selection)
+-									%open the profile
+-									n=length(A(selection).x);
+-									A(selection).x=[A(selection).x(p1:end-1,1);A(selection).x(1:p2,1)];
+-									A(selection).y=[A(selection).y(p1:end-1,1);A(selection).y(1:p2,1)];
+-									numpoints=numpoints-(n-length(A(selection).x));
+-									closed(selection)=0;
+-								else
+-									%cut in 2 profiles
+-									closed(selection)=0;
+-									A(selection).x=x(1:p2);
+-									A(selection).y=y(1:p2);
+-									A(end+1).x=x(p1:end);
+-									A(end).y=y(p1:end);
+-									A(end).density=A(selection).density;
+-									A(end).name=A(selection).name;
+-									closed(end+1)=0;
+-									numprofiles=numprofiles+1;
+-									numpoints=numpoints-(p1-p2-1);
+-								end
+-							else
+-								%only point removal
+-								n=length(A(selection).x);
+-								x(1:p2-1)=[];x(p1-p2+2:end)=[];%it should have been x(p2+1:end)
+-								y(1:p2-1)=[];y(p1-p2+2:end)=[];
+-								A(selection).x=x;
+-								A(selection).y=y;
+-								numpoints=numpoints-(n-length(A(selection).x));
+-								closed(selection)=0;
+-							end
+-						end
+-
+-						%plot new profile
+-						undoplots(prevplot);
+-						for i=1:numprofiles
+-							plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-								'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-						end
+-						points=[];
+-
+-					end
+-				end
+-			end
+-		else
+-			%RETRUN-> quit
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addinsideprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addinsideprofile.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addinsideprofile.m	(revision 12996)
+@@ -1,79 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%ADDINSIDEPROFILE - add apoint inside a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting...')
+-		return
+-	end	   
+-	if numpoints<2
+-		disp('at least two points are required, exiting...')
+-		return
+-	end	   
+-	hold on
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	end
+-
+-	loop=1;
+-	while loop
+-
+-		%first step, select a segment
+-		title('click on a segment, RETURN to exit','FontSize',14)
+-		[xi,yi] = ginput(1);
+-
+-		%first click
+-		if ~isempty(xi)
+-
+-			%get the closest segment
+-			[profsel indsel]=closestsegment(A,numprofiles,xi,yi);
+-
+-			%check that at least one segment exists
+-			if indsel==0
+-				disp('at least two points in one profile are required, exiting...')
+-				return
+-			end
+-
+-			%highlight selected segment
+-			plot([A(profsel).x(indsel) A(profsel).x(indsel+1)],[A(profsel).y(indsel) A(profsel).y(indsel+1)],...
+-				'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-			%next click
+-			title('click on the new point''s location, RETURN to exit','FontSize',14)
+-			[xi,yi,but] = ginput(1);
+-
+-			%second click
+-			if ~isempty(xi)
+-
+-				%add point to A
+-				A(profsel).x=[A(profsel).x(1:indsel,1); xi; A(profsel).x(indsel+1:end,1)];
+-				A(profsel).y=[A(profsel).y(1:indsel,1); yi; A(profsel).y(indsel+1:end,1)];
+-				numpoints=numpoints+1;
+-
+-				%plot new profile
+-				undoplots(prevplot);
+-				for i=1:numprofiles
+-					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-				end
+-
+-			else
+-				%RETURN->exit
+-				return
+-			end
+-		else
+-			%RETURN-> exit
+-			return
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/closestpoint.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/closestpoint.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/closestpoint.m	(revision 12996)
+@@ -1,21 +0,0 @@
+-function [profsel indsel]=closestpoint(A,numprofiles,xi,yi)
+-%CLOSESTPOINT - find the closest point of a profile
+-%
+-%   This routine find the point of the profile A that is the closest
+-%   to (xi,yi) and return the number of the profile and the number of
+-%   the point
+-%
+-%   Usage:
+-%     [profsel indsel]=closestpoint(A,numprofiles,xi,yi) 
+-
+-	%loop over the points of each profile, find the closest to (xi,yi)
+-	for i=1:numprofiles,
+-		distance=(xi-A(i).x).^2+(yi-A(i).y).^2;
+-		[newdistance p]=min(distance);
+-		if ((i==1) | (newdistance<olddistance)),
+-			indsel=p;
+-			profsel=i;
+-			olddistance=newdistance;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/closeprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/closeprofile.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/closeprofile.m	(revision 12996)
+@@ -1,68 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%CLOSEPROFILE - close one or several profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile to be closed')
+-		return
+-	end
+-		   
+-	title('click on the profiles to be closed, RETURN to exit','FontSize',14)
+-	hold on
+-
+-	loop=1;
+-	selection=[];
+-
+-	while loop
+-
+-		%some checks,
+-		if numprofiles==0    
+-			disp('no profile present, exiting...')
+-			return            
+-		end  
+-		if ~any(~closed),
+-			disp('All the profiles are closed, exiting...')
+-			return
+-		end
+-
+-		[xi,yi] = ginput(1);
+-					  
+-		if ~isempty(xi)
+-
+-			%get closest profile
+-			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-
+-			if ismember(profsel,selection)
+-				%profile was in selection, remove it from the selection
+-				selection(find(selection==profsel))=[];
+-				%back to regular color
+-				plot(A(profsel).x,A(profsel).y,...
+-					'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			elseif closed(profsel),
+-				%profile already closed, do nothing
+-				disp('selected profile aready closed, make another selection'),
+-			else
+-				%add the profile to the list to be closed
+-				selection(end+1)=profsel;
+-				%in selectioncolor
+-				plot(A(profsel).x,A(profsel).y,...
+-					'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			end
+-		else
+-			%close the profiles
+-			for i=1:length(selection),
+-				A(selection(i)).x(end+1)=A(selection(i)).x(1);
+-				A(selection(i)).y(end+1)=A(selection(i)).y(1);
+-				numpoints=numpoints+1;
+-				closed(selection(i))=1;
+-			end
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/undoplots.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/undoplots.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/undoplots.m	(revision 12996)
+@@ -1,12 +0,0 @@
+-function  undoplots(prevplot)
+-%UNDOPLOTS - undo plots
+-%
+-%   Usage:undoplots(prevplot)
+-
+-	%erase all previous plots
+-	g=get(gca,'children');
+-	L=length(g);
+-	for i=1:L-prevplot
+-		delete(g(i));
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addprofile.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addprofile.m	(revision 12996)
+@@ -1,48 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%ADDPROFILE - add a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		   
+-	title('click to add a point to the new profile, RETURN to exit','FontSize',14)
+-	hold on
+-
+-	loop=1;
+-	x=[];
+-	y=[];
+-
+-	while loop
+-
+-		[xi,yi] = ginput(1);
+-					  
+-		if ~isempty(xi)
+-			x(end+1,1)=xi;
+-			y(end+1,1)=yi;
+-
+-			%plot everything
+-			undoplots(prevplot);
+-			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-		else
+-
+-			%check that the profile is not empty
+-			if ~isempty(x)
+-				A(end+1).x=x; 
+-				A(end).y=y; 
+-				A(end).name=root; 
+-				A(end).density=1; 
+-				numprofiles=numprofiles+1;
+-				numpoints=numpoints+length(x);
+-				closed(end+1)=0;
+-			end
+-
+-			%get out
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/removepoints.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/removepoints.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/removepoints.m	(revision 12996)
+@@ -1,85 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%REMOVEPOINTS - remove a point from a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting...')
+-		return
+-	end
+-
+-	hold on
+-	loop=1;
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-	end
+-
+-	while loop
+-
+-		%check that at least one point is present
+-		if numpoints==0
+-			disp('at least one point are needed')
+-			return
+-		end	   
+-
+-		%select a point to be deleted
+-		title('click on the point to be removed, RETURN to exit','FontSize',14)
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-
+-			%get the closest point
+-			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-
+-			%remove point of A
+-			A(profsel).x(indsel)=[];
+-			A(profsel).y(indsel)=[];
+-
+-			%unclose the domain if only 2 points remaining
+-			if closed(profsel)
+-				if length(A(profsel).x)==3
+-					A(profsel).x(end)=[];
+-					A(profsel).y(end)=[];
+-					numpoints=numpoints-1;
+-					closed(profsel)=0;
+-				end
+-			end
+-
+-			%remove the last point if the profile is closed and indsel=end or 1
+-			if closed(profsel)
+-				if indsel==1 
+-					A(profsel).x(end)=A(profsel).x(1);
+-					A(profsel).y(end)=A(profsel).y(1);
+-				elseif indsel==length(A(profsel).x)
+-					A(profsel).x(1)=A(profsel).x(end);
+-					A(profsel).y(1)=A(profsel).y(end);
+-				end
+-			end
+-			numpoints=numpoints-1;
+-
+-			%plot new profile
+-			undoplots(prevplot);
+-			for i=1:numprofiles
+-				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-					'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-				if length(A(i).x)==1
+-					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker','o');
+-				end
+-			end
+-
+-		else
+-			%RETURN-> exit
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/removeseveralpoints.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/removeseveralpoints.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/removeseveralpoints.m	(revision 12996)
+@@ -1,130 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%REMOVESEVERALPOINTS - remove several point
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting...')
+-		return
+-	end	   
+-	if numpoints<3
+-		disp('at least 3 points are required, exiting...')
+-		return
+-	end	   
+-	hold on
+-	loop=1;
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	end
+-
+-	points=[];
+-
+-	%loop (at least 3 clicks needed)
+-	while loop
+-
+-		%some checks
+-		if numpoints<3
+-			disp('at least 3 points are required, exiting...')
+-			return
+-		end
+-
+-		%select a point
+-		if isempty(points)
+-			title('click on the first tip, RETURN to exit','FontSize',14)
+-		elseif length(points)==1
+-			title('click on the second tip, RETURN to exit','FontSize',14)
+-		else
+-			title('click in the middle of the area to be removed, RETURN to exit','FontSize',14)
+-		end
+-
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-			%get the closest point
+-			%first time, look at all profiles
+-			if isempty(points)
+-				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-				if ((closed(profsel) & length(A(profsel).x)<4) |  (~closed(profsel) & length(A(profsel).x)<3)),
+-					disp('the selected profile has less than 3 points, make another selection');
+-				else
+-					selection=profsel;
+-					points(end+1)=indsel;
+-					plot(A(profsel).x,A(profsel).y,...
+-						'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-					text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
+-				end
+-				%disp(['p1= ' num2str(indsel)]),
+-			else
+-				%get the 2d or 3d point for the given contou
+-				[profsel indsel]=closestpoint(A(selection),1,xi,yi);
+-				if ismember(indsel,points)
+-					disp('the selected points must be distinct')
+-				else
+-					%second click?
+-					if length(points)==1,
+-						points(end+1)=indsel;
+-						text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
+-						%disp(['p2= ' num2str(indsel)]),
+-					%third click?
+-					else
+-						p1=points(1); p2=points(2); p3=indsel;
+-						%disp(['p3= ' num2str(indsel)]),
+-						if p1<p2
+-							if p3>p1 & p3<p2
+-								A(selection).x(p1+1:p2-1)=[];
+-								A(selection).y(p1+1:p2-1)=[];
+-								numpoints=numpoints-(p2-p1-1);
+-							else
+-								A(selection).x=A(selection).x(p1:p2);
+-								A(selection).y=A(selection).y(p1:p2);
+-								numpoints=numpoints-(numpoints-1-p2)-(p1-1);
+-								if closed(selection)
+-									%reattach the tips
+-									A(selection).x(end+1)=A(selection).x(1);
+-									A(selection).y(end+1)=A(selection).y(1);
+-									numpoints=numpoints+1;
+-								end
+-							end
+-						else
+-							if p3>p2 & p3<p1
+-								A(selection).x(p2+1:p1-1)=[];
+-								A(selection).y(p2+1:p1-1)=[];
+-								numpoints=numpoints-(p1-p2-1);
+-							else
+-								A(selection).x=A(selection).x(p2:p1);
+-								A(selection).y=A(selection).y(p2:p1);
+-								numpoints=numpoints-(numpoints-1-p1)-(p2-1);
+-								if closed(selection)
+-									%reattach the tips
+-									A(selection).x(end+1)=A(selection).x(1);
+-									A(selection).y(end+1)=A(selection).y(1);
+-									numpoints=numpoints+1;
+-								end
+-							end
+-						end
+-
+-						%plot new profiles
+-						undoplots(prevplot);
+-						for i=1:numprofiles
+-							plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-								'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-						end
+-						points=[];
+-
+-					end
+-				end
+-			end
+-		else
+-			%RETRUN-> quit
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/modifyposition.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/modifyposition.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/modifyposition.m	(revision 12996)
+@@ -1,77 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%MODIFYPOSITION - modify the prosition of a point of a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting..')
+-		return
+-	end
+-
+-	hold on
+-	loop=1;
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	end
+-
+-	while loop
+-
+-		%select a point to be modified 
+-		title('click on the point to be modified, RETURN to exit','FontSize',14)
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-
+-			%get the closest point
+-			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-
+-			%plot the point in blue
+-			plot(A(profsel).x(indsel),A(profsel).y(indsel),...
+-				'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-				'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-			%select new location
+-			title('click on the new location, RETURN to exit','FontSize',14)
+-			[xi,yi] = ginput(1);
+-
+-			if ~isempty(xi)
+-
+-				%modification of its coordinates
+-				A(profsel).x(indsel)=xi;
+-				A(profsel).y(indsel)=yi;
+-
+-				%modify the last point if the profile is closed and indsel=end or 1
+-				if closed(profsel)
+-					if indsel==1 
+-						A(profsel).x(end)=xi;
+-						A(profsel).y(end)=yi;
+-					elseif indsel==length(A(profsel).x)
+-						A(profsel).x(1)=xi;
+-						A(profsel).y(1)=yi;
+-					end
+-				end
+-
+-				%plot new profile
+-				undoplots(prevplot);
+-				for i=1:numprofiles
+-					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-				end
+-			else
+-				%RETURN-> exit
+-				loop=0;
+-			end
+-		else
+-			%RETURN-> exit
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/cutprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/cutprofile.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/cutprofile.m	(revision 12996)
+@@ -1,79 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%CUTPROFILE - cut a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting...')
+-		return
+-	end	   
+-	if numpoints<2
+-		disp('at least two points are needed')
+-		return
+-	end	   
+-	hold on
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	end
+-
+-	loop=1;
+-	while loop
+-
+-		%select a segment
+-		title('click the segment to cut, RETURN to exit','FontSize',14)
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-
+-			%get the closest segment
+-			[profsel indsel]=closestsegment(A,numprofiles,xi,yi);
+-
+-			%check that at least one segment exists
+-			if indsel==0
+-				disp('at least 2 points are required');
+-				return,
+-			end
+-
+-			if ((closed(profsel) & length(A(profsel).x)<3) | (~closed(profsel) & length(A(profsel).x)<2))
+-				disp('at least 2 points are required, make another selection');
+-			else
+-				%cut A
+-				if closed(profsel)
+-					%open the contour
+-					A(profsel).x=[A(profsel).x(indsel+1:end-1,1);A(profsel).x(1:indsel,1)];
+-					A(profsel).y=[A(profsel).y(indsel+1:end-1,1);A(profsel).y(1:indsel,1)];
+-					numpoints=numpoints-1;
+-					closed(profsel)=0;
+-				else
+-					%cut the contour in 2 profiles
+-					A(end+1).x=A(profsel).x(indsel+1:end,1);
+-					A(end).y=A(profsel).y(indsel+1:end,1);
+-					A(end).name=root; 
+-					A(end).density=1; 
+-					A(profsel).x=A(profsel).x(1:indsel,1);
+-					A(profsel).y=A(profsel).y(1:indsel,1);
+-					numprofiles=numprofiles+1;
+-					closed(end+1)=0;
+-				end
+-
+-				%plot new profile
+-				undoplots(prevplot);
+-				for i=1:numprofiles
+-					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-				end
+-			end
+-		else
+-			%RETURN->exit
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/removeprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/removeprofile.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/removeprofile.m	(revision 12996)
+@@ -1,56 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%REMOVEPROFILE - delete a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-
+-	title('click on the profiles to be removed, RETURN to exit','FontSize',14)
+-	hold on
+-
+-	loop=1;
+-	selection=[];
+-
+-	while loop
+-
+-		%some checks
+-		if numprofiles==0
+-			disp('no profile to be removed, exiting...')
+-			return
+-		end
+-		   
+-		[xi,yi] = ginput(1);
+-					  
+-		if ~isempty(xi)
+-
+-			%get closest profile
+-			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-
+-			if ismember(profsel,selection)
+-				%profile was in selection, remove it
+-				selection(find(selection==profsel))=[];
+-				%back to regular color
+-				plot(A(profsel).x,A(profsel).y,...
+-					'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			else
+-				%add the profile to the list to be removed
+-				selection(end+1)=profsel;
+-				%in selectioncolor
+-				plot(A(profsel).x,A(profsel).y,...
+-					'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			end
+-		else
+-			%remove the profiles
+-			selection=sort(selection);
+-			for i=1:length(selection),
+-				numprofiles=numprofiles-1;
+-				numpoints=numpoints-length(A(selection(i)-(i-1)).x);
+-				A(selection(i)-(i-1))=[];
+-				closed(selection(i)-(i-1))=[];
+-			end
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/closestsegment.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/closestsegment.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/closestsegment.m	(revision 12996)
+@@ -1,28 +0,0 @@
+-function [profsel indsel]=closestsegment(A,numprofiles,xi,yi)
+-%CLOSESTSEGMENT - find the closest segment of a profile
+-%
+-%   This routine find the segment of the profile A that is the closest
+-%   to (xi,yi) and return the number of the profile and the number of
+-%   the first point belonging to this closest segment
+-%
+-%   Usage:
+-%     [profsel indsel]=closestsegment(A,numprofiles,xi,yi) 
+-
+-	%loop over the middles of each profile, find the closest to (xi,yi)
+-	profsel=0;
+-	indsel=0;
+-	first=1;
+-	for i=1:numprofiles,
+-		if length(A(i).x)>1
+-			middles=[(A(i).x(1:end-1)+A(i).x(2:end))/2 (A(i).y(1:end-1)+A(i).y(2:end))/2];
+-			distance=(xi-middles(:,1)).^2+(yi-middles(:,2)).^2;
+-			[newdistance p]=min(distance);
+-			if (first | (newdistance<olddistance)),
+-				first=0;
+-				indsel=p;
+-				profsel=i;
+-				olddistance=newdistance;
+-			end
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addendprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addendprofile.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addendprofile.m	(revision 12996)
+@@ -1,86 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%ADDENDPROFILE - add point at the end of a n existing profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting...')
+-		return
+-	end	   
+-	if ~any(~closed)
+-		disp('all profiles are closed')
+-		return
+-	end	   
+-	%select a profile first
+-	if numprofiles>1
+-		%first step, select a profile
+-		isclosed=1;
+-		title('click on a profile, RETURN to exit','FontSize',14)
+-		while isclosed
+-			[xi,yi] = ginput(1);
+-			if ~isempty(xi)
+-				%get the closest point 
+-				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-				if closed(profsel)
+-					disp('selected profile is closed, make another selection')
+-				else
+-					isclosed=0;
+-				end
+-
+-			else
+-				%RETURN -> out
+-				return
+-			end
+-		end
+-	else
+-		profsel=1;
+-	end
+-
+-	%initialize x and y
+-	x=A(profsel).x;
+-	y=A(profsel).y;
+-
+-	%plot the selected profile
+-	hold on
+-	plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-		'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-	loop=1;
+-	while loop
+-
+-		%first step, select a profile
+-		title('click to add point to the selected profile, RETURN to exit','FontSize',14)
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-			x(end+1,1)=xi;
+-			y(end+1,1)=yi;
+-
+-			%plot everything
+-			undoplots(prevplot);
+-			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize')+2,'Marker',getfieldvalue(options,'Marker'));
+-
+-		else
+-
+-			%check that the profile is not empty
+-			if ~isempty(x)
+-				A(profsel).x=x; 
+-				A(profsel).y=y; 
+-				A(profsel).name=root; 
+-				A(profsel).density=1; 
+-				numpoints=numpoints+length(x);
+-			end
+-
+-			%get out
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addcontour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addcontour.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/addcontour.m	(revision 12996)
+@@ -1,50 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%ADDCONTOUR - add a closed contour
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		   
+-	title('click to add a point to the new profile, RETURN to exit','FontSize',14)
+-	hold on
+-
+-	loop=1;
+-	x=[];
+-	y=[];
+-
+-	while loop
+-
+-		[xi,yi] = ginput(1);
+-					  
+-		if ~isempty(xi)
+-			x(end+1,1)=xi;
+-			y(end+1,1)=yi;
+-
+-			%plot everything
+-			undoplots(prevplot);
+-			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-		else
+-
+-			%check that the profile is not empty
+-			if ~isempty(x)
+-				x(end+1)=x(1);
+-				y(end+1)=y(1);
+-				A(end+1).x=x; 
+-				A(end).y=y; 
+-				A(end).name=root; 
+-				A(end).density=1; 
+-				numprofiles=numprofiles+1;
+-				numpoints=numpoints+length(x);
+-				closed(end+1)=1;
+-			end
+-
+-			%get out
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/mergeprofiles.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/mergeprofiles.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/manipulation/mergeprofiles.m	(revision 12996)
+@@ -1,152 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%MERGEPROFILES - merge profiles
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile. The user must select the two tips that
+-%   he/she wants to merge
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options)
+-
+-hold on
+-loop=1;
+-
+-%Take all the tips coordinates of open profiles
+-counter=1; tips=[];
+-for i=1:numprofiles
+-	if ~closed(i),
+-		%x and y coord, profile number, 1 if beginning, 2 and if end
+-		if length(A(i).x)==1,
+-			tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
+-			counter=counter+1;
+-		else
+-			tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
+-			tips(counter+1,:) = [A(i).x(end) A(i).y(end) i  2];
+-			counter=counter+2;
+-		end
+-	end
+-end
+-
+-if size(tips,1)<2
+-	disp('at least one unclosed profile is required')
+-	return
+-end
+-
+-%plot the tips only
+-plot(tips(:,1),tips(:,2),...
+-	'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-firsttip=1;
+-
+-%loop (at least 2 clicks needed)
+-while loop
+-
+-	%some checks
+-	if size(tips,1)<2
+-		disp('at least one unclosed profiles are required')
+-		return
+-	end
+-
+-	%select a point
+-	if firsttip
+-		title('click on the first tip, RETURN to exit','FontSize',14)
+-	else
+-		title('click on the second tip, RETURN to exit','FontSize',14)
+-	end
+-
+-	[xi,yi] = ginput(1);
+-
+-	if ~isempty(xi)
+-
+-		if firsttip
+-			%find the selected tip
+-			distance=(xi-tips(:,1)).^2+(yi-tips(:,2)).^2;
+-			[dmin tip1]=min(distance);
+-			numprofile1=tips(tip1,3);
+-			firsttip=0;
+-
+-			%remove tip1 from tips list
+-			newtips=tips;
+-			newtips(tip1,:)=[];
+-
+-			%plot selected tip
+-			plot(tips(tip1,1),tips(tip1,2),...
+-				'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-			plot(A(numprofile1).x,A(numprofile1).y,...
+-				'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-
+-		%second selection
+-		else
+-			distance=(xi-newtips(:,1)).^2+(yi-newtips(:,2)).^2;
+-			[dmin tip2]=min(distance);
+-			numprofile2=newtips(tip2,3);
+-
+-			if numprofile1==numprofile2
+-				%close the profile
+-				A(numprofile1).x(end+1)=A(numprofile1).x(1);
+-				A(numprofile1).y(end+1)=A(numprofile1).y(1);
+-				numpoints=numpoints+1;
+-				closed(numprofile1)=1;
+-
+-			else
+-
+-				if tips(tip1,4)==1 & newtips(tip2,4)==1,
+-					A(numprofile1).x=[flipud(A(numprofile2).x); A(numprofile1).x];
+-					A(numprofile1).y=[flipud(A(numprofile2).y); A(numprofile1).y];
+-					numprofiles=numprofiles-1;
+-
+-				elseif tips(tip1,4)==1 & newtips(tip2,4)==2,
+-					A(numprofile1).x=[A(numprofile2).x; A(numprofile1).x];
+-					A(numprofile1).y=[A(numprofile2).y; A(numprofile1).y];
+-					numprofiles=numprofiles-1;
+-
+-				elseif tips(tip1,4)==2 & newtips(tip2,4)==1,
+-					A(numprofile1).x=[A(numprofile1).x; A(numprofile2).x];
+-					A(numprofile1).y=[A(numprofile1).y; A(numprofile2).y];
+-					numprofiles=numprofiles-1;
+-
+-				elseif tips(tip1,4)==2 & newtips(tip2,4)==2,
+-					A(numprofile1).x=[A(numprofile1).x; flipud(A(numprofile2).x)];
+-					A(numprofile1).y=[A(numprofile1).y; flipud(A(numprofile2).y)];
+-					numprofiles=numprofiles-1;
+-				end
+-
+-				%delete profile2
+-				A(numprofile2)=[];
+-				closed(numprofile2)=[];
+-
+-			end
+-
+-			%update tips
+-			counter=1; tips=[];
+-			for i=1:numprofiles
+-				if ~closed(i),
+-					%x and y coord, profile number, 1 if beginning, 2 and if end
+-					if length(A(i).x)==1,
+-						tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
+-						counter=counter+1;
+-					else
+-						tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
+-						tips(counter+1,:) = [A(i).x(end) A(i).y(end) i  2];
+-						counter=counter+2;
+-					end
+-				end
+-			end
+-
+-			%plot new profile
+-			undoplots(prevplot);
+-			for i=1:numprofiles
+-				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			end
+-			if ~isempty(tips)
+-				plot(tips(:,1),tips(:,2),...
+-					'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-			end
+-
+-			%back to beginning
+-			firsttip=1;
+-		end
+-	else
+-		%RETRUN-> quit
+-		loop=0;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/downstreamflowlines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/downstreamflowlines.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/downstreamflowlines.m	(revision 12996)
+@@ -1,110 +0,0 @@
+-function flowpath=downstreamflowlines(index,x,y,u,v,x0,y0,varargin)
+-%DOWNSTREAMFLOWLINES - compute flowlines from a given set of seed points
+-%
+-%   Usage:
+-%      flowpath=downstreamflowlines(index,x,y,u,v,x0,y0)
+-%
+-%   the velocity field is given by the couple (u,v) and the coordinates
+-%   of the seed points are (x0,y0). One can use one or several seed 
+-%   points
+-%
+-%   Example:
+-%      flowpath=downstreamflowlines(md.mesh.elements,md.mesh.x,md.mesh.y,md.vx,md.initialization.vy,x0,y0)
+-
+-%check input size
+-if nargin>9 | nargin<7,
+-	help flowlines
+-	error('flowlines error message: bad usage');
+-end
+-
+-%check input
+-if (length(x)~=length(y) | length(x)~=length(u) | length(x)~=length(v)),
+-	error('flowlines error message: x,y,u and v must have the same length');
+-end
+-if length(x)<3,
+-	error('flowlines error message: at least one element is required');
+-end
+-if length(x0)~=length(y0),
+-	error('flowlines error message: x0 and y0 do not have the same length');
+-end
+-
+-%get maxiter and precision
+-if nargin==9
+-	maxiter=varargin{1};%maximum number of iterations
+-	precision=varargin{2}; %division of each segment (higer precision increases number of segments)
+-else
+-	maxiter=200; %maximum number of iterations
+-	precision=1; %division of each segment (higer precision increases number of segments)
+-end
+-
+-%check seed points
+-tria=TriaSearch(index,x,y,x0,y0);
+-pos=find(isnan(tria));
+-x0(pos)=[];
+-y0(pos)=[];
+-
+-%initialize other variables
+-N=length(x0);
+-X=x0; Y=y0;
+-flowpath=struct('x',cell(N,1),'y',cell(N,1),'name','','density',1);
+-for i=1:N,
+-	flowpath(i).x=x0(i);
+-	flowpath(i).y=y0(i);
+-end
+-done=zeros(N,1);
+-
+-%get avegared length of each element
+-length_tria=1/3*(sqrt( (x(index(:,1))-x(index(:,2))).^2+(y(index(:,1))-y(index(:,2))).^2 )+...
+-	sqrt((x(index(:,1))-x(index(:,3))).^2+(y(index(:,1))-y(index(:,3))).^2 )+...
+-	sqrt((x(index(:,2))-x(index(:,3))).^2+(y(index(:,2))-y(index(:,3))).^2 ));
+-
+-%take velocity for each element
+-u=u(index)*[1;1;1]/3;
+-v=v(index)*[1;1;1]/3;
+-
+-%initialization:
+-counter=1;
+-
+-while any(~done) 
+-
+-	%find current triangle
+-	queue=find(~done);
+-	tria=TriaSearch(index,x,y,X(queue),Y(queue));
+-
+-	%check that the point is actually inside a triangle of the mesh
+-	listnan=find(isnan(tria));
+-	for i=1:length(listnan)
+-		%remove the last point
+-		flowpath(queue(listnan(i))).x(end)=[];
+-		flowpath(queue(listnan(i))).y(end)=[];
+-		done(queue(listnan(i)))=1;
+-	end
+-	tria(listnan)=[]; 
+-	queue(listnan)=[];
+-
+-	if isempty(tria),
+-		break;
+-	end
+-
+-	%velocity of the current triangle and norm it
+-	ut=u(tria); vt=v(tria); normv=sqrt(ut.^2+vt.^2);
+-	ut=ut./normv;vt=vt./normv;
+-
+-	%check counter
+-	if counter>maxiter
+-		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going forward'])
+-		break
+-	end
+-	counter=counter+1;
+-
+-	%remove stagnant point
+-	done(queue(find(ut==0 & vt==0)))=1;
+-
+-	%build next point
+-	for i=1:length(queue)
+-		X(queue(i))=flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision;
+-		Y(queue(i))=flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision;
+-		flowpath(queue(i)).x=[flowpath(queue(i)).x;flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision];
+-		flowpath(queue(i)).y=[flowpath(queue(i)).y;flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision];
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expflip.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expflip.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expflip.m	(revision 12996)
+@@ -1,19 +0,0 @@
+-function expflip(domainname)
+-%EXPFLIP: flip orientation of all contours and domains in domainname exp file.
+-%
+-%Usage: expflip('MassFlux1.exp');a
+-%
+-%
+-
+-
+-
+-
+-
+-a=expread(domainname,1);
+-
+-for i=1:length(a),
+-	a(i).x=flipud(a(i).x);
+-	a(i).y=flipud(a(i).y);
+-end
+-
+-expwrite(a,domainname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcoarsen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcoarsen.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expcoarsen.m	(revision 12996)
+@@ -1,74 +0,0 @@
+-function expcoarsen(newfile,oldfile,resolution);
+-%EXPCOARSEN - coarsen an exp contour
+-%
+-%   This routine read an Argus file and remove points with respect to
+-%   the resolution (in meters) given in input. 
+-%
+-%   Usage:
+-%      expcoarsen(newfile,oldfile,resolution)
+-%
+-%   Example:
+-%       expcoarsen('DomainOutline.exp','Antarctica.exp',4000)
+-
+-%Some checks
+-if nargin~=3 | nargout
+-	error('expcoarsen usage: expcoarsen(newfile,oldfile,resolution)')
+-elseif ~exist(oldfile)
+-	error(['expcut error message: the file ' oldfile  'does not exist'])
+-elseif exist(newfile),
+-	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
+-	if ~strcmpi(choice,'y'),
+-		disp('no modification done ... exiting');
+-		return;
+-	end
+-end
+-
+-%Get exp oldfile
+-[path root ext ver]=fileparts(oldfile);
+-A=expread(oldfile);
+-numprofiles=size(A,2);
+-
+-%Go through the profiles
+-count=1;
+-while count<=numprofiles,
+-
+-	%get number of points and initialize j
+-	numpoints=length(A(count).x);
+-	j=1;
+-
+-	%stop if we have reached end of profile (always keep the last point)
+-	while j<numpoints,
+-
+-		%See whether we keep this point or not
+-		distance=sqrt((A(count).x(j)-A(count).x(j+1))^2+(A(count).y(j)-A(count).y(j+1))^2);
+-		if distance<resolution & j<numpoints-1  %do not remove last point
+-			A(count).x(j+1)=[];
+-			A(count).y(j+1)=[];
+-			numpoints=numpoints-1;
+-		else
+-			division=floor(distance/resolution)+1;
+-			if division>=2,
+-				x=linspace(A(count).x(j),A(count).x(j+1),division)';
+-				y=linspace(A(count).y(j),A(count).y(j+1),division)';
+-				A(count).x=[A(count).x(1:j);x(2:end-1); A(count).x(j+1:end)];
+-				A(count).y=[A(count).y(1:j);y(2:end-1); A(count).y(j+1:end)];
+-
+-				%update current point
+-				j=j+1+division-2;
+-				numpoints=numpoints+division-2;
+-			else
+-				%update current point
+-				j=j+1;
+-			end
+-		end
+-	end
+-	if length(A(count).x)<=1,
+-		A(count)=[];
+-		numprofiles=numprofiles-1;
+-	else
+-		count=count+1;
+-	end
+-end
+-
+-%write output
+-expwrite(A,newfile);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expmaster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expmaster.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expmaster.m	(revision 12996)
+@@ -1,2 +0,0 @@
+-function expmaster(newfile,varargin)
+-	disp('expmaster has been renamed exptool due to the unpopularity of its name')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/exporientation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/exporientation.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/exporientation.m	(revision 12996)
+@@ -1,12 +0,0 @@
+-function exporientation(filename)
+-
+-a=expread(filename);
+-
+-dx=diff(a.x);
+-dx=[dx;dx(end)];
+-
+-dy=diff(a.y);
+-dy=[dy;dy(end)];
+-
+-quiver(a.x,a.y,dx,dy);
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expsplit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expsplit.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expsplit.m	(revision 12996)
+@@ -1,31 +0,0 @@
+-function expsplit(domainoutline)
+-%EXPSPLIT - split exp file into sub-contours
+-%
+-%   This routine reads in a domain outline file (Argus format) and plots all the contours 
+-%   This will create as many files there are contours in the domain, each file will be postfix with _i
+-%   where i is the contour name. 
+-%
+-%   Usage:
+-%      expsplit(domainoutline)
+-%
+-%   Example:
+-%      expsplit('Domain.exp');
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%check nargin
+-if ~nargin | nargin>1
+-	help expsplit
+-	error('expsplit error message: bad usage');
+-end
+-
+-[path,root,ext]=fileparts(domainoutline);
+-
+-%Read file: 
+-domains=expread(domainoutline,1);
+-
+-%split and write contours: 
+-for i=1:length(domains),
+-	subdomain=domains(i);
+-	expwrite(subdomain,[root '_' num2str(i)  ext]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expswapxy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expswapxy.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expswapxy.m	(revision 12996)
+@@ -1,23 +0,0 @@
+-function expswapxy(filename)
+-%EXPSWAP - swap x and y fields
+-% 
+-%   Usage:
+-%      expswap(file)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-
+-contours=expread(filename,1);
+-
+-newcontours=contours(1);
+-
+-for i=1:length(contours), 
+-	contour=contours(i);
+-	newcontour=contour;
+-	newcontour.x=contour.y;
+-	newcontour.y=contour.x;
+-	newcontours(end+1)=newcontour;
+-end
+-newcontours=newcontours(2:end);
+-
+-expwrite(newcontours,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/explink.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/explink.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/explink.m	(revision 12996)
+@@ -1,29 +0,0 @@
+-function explink(domainoutline,minthreshold,step)
+-%EXPLINK - allow to link several segments of domain outline together
+-%
+-%   Takes a domain outline made of various segments, and links them together in one 
+-%   domain outline. Use expview to see end result.
+-%
+-%   Usage:
+-%      explink(domainoutline,minthreshold,step)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-notdone=1;
+-
+-while notdone,
+-
+-	for i=1:1000,
+-		status=expconcatenate(domainoutline,minthreshold+(i-1)*step);
+-		if status==0,
+-			return;
+-		end
+-		if status==1,
+-			break;
+-		end
+-		if status==-1,
+-			continue;
+-		end
+-	end
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expdisp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expdisp.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expdisp.m	(revision 12996)
+@@ -1,52 +0,0 @@
+-function expdisp(domainoutline,varargin)
+-%EXPDISP - plot the contours of a domain outline file
+-%
+-%   This routine reads in a domain outline file (Argus format) and plots all the contours 
+-%
+-%   Usage:
+-%      expdisp(domainoutline,varargin)
+-%      expdisp(domainoutline,figurenumber,linestyle,linewidth,unitmultiplier)
+-%
+-%   Example:
+-%      expdisp('Domain.exp',1,'--r',2,10^3);
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%check nargin
+-if ~nargin | nargin>5
+-	help expdisp
+-	error('expdisp error message: bad usage');
+-end
+-
+-%parse input
+-if nargin<=1,
+-	figurenumber=1;
+-else
+-	figurenumber=varargin{1};
+-end
+-if nargin<=2
+-	linestyle='r-';
+-else
+-	linestyle=varargin{2};
+-end
+-if nargin<=3
+-	linewidth=1;
+-else
+-	linewidth=varargin{3};
+-end
+-if nargin<=4
+-	unitmultiplier=1;
+-else
+-	unitmultiplier=varargin{4}; if isnan(unitmultiplier), unitmultiplier=1; end
+-end
+-
+-domain=expread(domainoutline);
+-
+-figure(figurenumber),hold on
+-for i=1:length(domain),
+-	if (isnumeric(linestyle))
+-		plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'Color',linestyle,'linewidth',linewidth);
+-	else
+-		plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,linestyle,'linewidth',linewidth);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expsquare.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expsquare.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expsquare.m	(revision 12996)
+@@ -1,45 +0,0 @@
+-function expbox(filename)
+-%EXPBOX - Create a ARGUS file using to clicks
+-%
+-%   Two clicks on a plot are used to generate a rectangular box
+-%   This box is written in EXP format on filename
+-%
+-%   Usage:
+-%      expbox(filename)
+-
+-%check
+-if exist(filename,'file'),
+-	choice=input(['A file ' filename ' already exists, do you want to modify it? (y/n)'],'s');
+-	if ~strcmpi(choice,'y'),
+-		disp('no modification done ... exiting');
+-		return
+-	end
+-end
+-
+-%Get points
+-disp('Click twice to define a rectangular domain. First click for upper left corner, second for lower right corner');
+-[x,y]=ginput(2);
+-
+-xmiddle=mean(x);
+-ymiddle=mean(y);
+-
+-x1=x(1); y1=y(1);
+-x3=x(2); y3=y(2);
+-
+-Diag=[x1-xmiddle;y1-ymiddle];
+-
+-Vector=[xmiddle;ymiddle]+[-Diag(2);Diag(1)];
+-x2=Vector(1); y2=Vector(2);
+-
+-Vector=[xmiddle;ymiddle]-[-Diag(2);Diag(1)];
+-x4=Vector(1); y4=Vector(2);
+-
+-%Build Exp structure
+-A=struct();
+-A.nods=5;
+-A.density=1;
+-A.x=[x1 x2 x3 x4 x1]';
+-A.y=[y1 y2 y3 y4 y1]';
+-
+-%Write structure
+-expwrite(A,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expdoc.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Exp/expdoc.m	(revision 12996)
+@@ -1,36 +0,0 @@
+-function expdoc()
+-%EXPDOC - create a doc for EXP routines
+-%
+-%   Usage:
+-%      expdoc()
+-
+-disp(' ');
+-disp('   Utilities dedicated to ARGUS Files (''.exp'' extension)'); 
+-disp('     expboxgen: creates a domain outline box for a .tif image for the mosaic tiff');
+-disp('            usage: expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)');
+-disp('            x0,y0 and nx,ny are the cropping coordinates (upper left and lower right corners in the larger tiff image)');
+-disp('            paramter_filename is the parameter file name for the mosaic tiff image. box_filename is self explanatory.');
+-disp('     expconcatenate: display all the profiles present in an Argus file and merge them accordingly to the tips selected by the user')
+-disp('            usage:  expconcatenate(newfile,oldfile)')
+-disp('     expcreatecircle: creates a closed Argus contour centered on (x,y), of radius radius_length. The contour is made of N points');
+-disp('            usage: expcreatecircle(filename,x0,y0,radius_length,N)');
+-disp('     expcreatecontour: creates a closed Argus contour delimited by the ''clicks'' of the user');
+-disp('            usage: expcreatecontour(filename)');
+-disp('     expcreateprofile: creates an Argus profile delimited by the ''clicks'' of the user');
+-disp('            usage: expcreateprofile(filename)');
+-disp('     expcut: display the contents of an Argus file and allow the user cut the profiles');
+-disp('            usage: expcut(newfilename,oldfilename)');
+-disp('     expdisp: display the contents of an Argus file');
+-disp('            usage:  expdisp(filename,[figure number],[line style])');
+-disp('     expgen: creates an Argus file from a contour (x,y) and a flag indicating if the contour must be closed or open');
+-disp('            usage:  expgen(filename,contours,close_flag)');
+-disp('     explink: takes a domain outline made of various segments, and links them together in one domain outline. Use expview to see end result');
+-disp('            usage: explink(domainoutline,minthreshold,step)');
+-disp('     exptool: allows the user to create, close, merge, remove,... Argus files and save the result in newfile');
+-disp('            usage: exptool(newfile,[oldfile1],[oldfile2],[oldfile3],[...]');
+-disp('     expread: reads an Argus file and build a structure that holds all the information of the file');
+-disp('            usage: expread(file,close_flag)');
+-disp('     expselect: display all the profiles of oldfile, the user clicks on the contour he/she wants to remove. Results saved in newfile');
+-disp('            usage: expselect(newfile,oldfile)');
+-disp('     expwrite: writes an Argus file from a structure given in input???');
+-disp('            usage: expwrite(structure,filename)');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ElementsFromEdge.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ElementsFromEdge.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ElementsFromEdge.m	(revision 12996)
+@@ -1,15 +0,0 @@
+-function edgeelements=ElementsFromEdge(elements,A,B) 
+-%ELEMENTSFROMEDGE: find elements connected to one edge defined by nodes A and B
+-%
+-% Usage: edgeelements=ElementsFromEdge(elements,A,B) 
+-%
+-% Eg:    edgeelements=ElementsFromEdge(md.mesh.elements,tip1,tip2)
+-%
+-%
+-edgeelements=find(...
+-(elements(:,1)==A & elements(:,2)==B )| ...
+-(elements(:,1)==A & elements(:,3)==B )| ...
+-(elements(:,2)==A & elements(:,3)==B )| ...
+-(elements(:,2)==A & elements(:,1)==B )| ...
+-(elements(:,3)==A & elements(:,1)==B )| ...
+-(elements(:,3)==A & elements(:,2)==B ));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/MergeMetrics.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/MergeMetrics.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/MergeMetrics.m	(revision 12996)
+@@ -1,15 +0,0 @@
+-function metric=MergeMetrics(metric1,metric2)
+-
+-M1xx=metric1(:,1); M1xy=metric1(:,2); M1yy=metric1(:,3);
+-M1lambda1=0.5*((M1xx+M1yy)+sqrt(4*M1xy.^2+(M1xx-M1yy).^2));
+-M1lambda2=0.5*((M1xx+M1yy)-sqrt(4*M1xy.^2+(M1xx-M1yy).^2));
+-lambda1=min(M1lambda1,M1lambda2);
+-
+-M2xx=metric1(:,1); M2xy=metric1(:,2); M2yy=metric1(:,3);
+-M2lambda1=0.5*((M2xx+M2yy)+sqrt(4*M2xy.^2+(M2xx-M2yy).^2));
+-M2lambda2=0.5*((M2xx+M2yy)-sqrt(4*M2xy.^2+(M2xx-M2yy).^2));
+-lambda2=min(M2lambda2,M2lambda2);
+-
+-metric=metric1;
+-pos=find(lambda2<lambda1);
+-metric(pos,:)=metric2(pos,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/NodeInElement.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/NodeInElement.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/NodeInElement.m	(revision 12996)
+@@ -1,41 +0,0 @@
+-function node_in_element=NodeInElement(newx,newy,elements,x,y,nodeconnectivity);
+-%NODEINELEMENT: find for a list of nodes (in newx,newy), which elements in the mesh (elements,x,y) they belong to.
+-%
+-%  Usage: node_in_element=NodeInElement(newx,newy,elements,x,y,md.mesh.vertexconnectivity);
+-%
+-%  See also Nodeconnectivity
+-%
+-epsilon=10^-10;
+-
+-%compute some quantities that will speed up the process
+-x3x1=x(elements(:,1))-x(elements(:,3));
+-y3y1=y(elements(:,1))-y(elements(:,3));
+-x3x2=x(elements(:,2))-x(elements(:,3));
+-y3y2=y(elements(:,2))-y(elements(:,3));
+-x3=x(elements(:,3));
+-y3=y(elements(:,3));
+-delta=x(elements(:,2)).*y(elements(:,3))-y(elements(:,2)).*x(elements(:,3))-x(elements(:,1)).*y(elements(:,3))+y(elements(:,1)).*x(elements(:,3))+x(elements(:,1)).*y(elements(:,2))-y(elements(:,1)).*x(elements(:,2));
+-
+-%max connectivity:
+-max_connectivity=max(nodeconnectivity(:,end));
+-node_in_element=zeros(length(newx),max_connectivity+1); %last column is the number of elements to which the row node is connected.
+-
+-for i=1:length(newx),
+-	x0=newx(i);
+-	y0=newy(i);
+-	
+-	%first area coordinate
+-	area_1=(y3y2.*(x0-x3)-x3x2.*(y0-y3))./delta;
+-	%second area coordinate
+-	area_2=(x3x1.*(y0-y3)-y3y1.*(x0-x3))./delta;
+-	%third area coordinate
+-	area_3=1-area_1-area_2;
+-	
+-	%get elements for which all area coordinates are positive (meaning (x0,y0) belongs to these elements
+-	pos=find((area_1>=0-epsilon) & (area_2>=0-epsilon) & (area_3>=0-epsilon));
+-
+-	num_elements=length(pos);
+-
+-	node_in_element(i,1:num_elements)=pos;
+-	node_in_element(i,end)=num_elements;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ComputeHessian.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ComputeHessian.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ComputeHessian.m	(revision 12996)
+@@ -1,60 +0,0 @@
+-function hessian=ComputeHessian(index,x,y,field,type)
+-%COMPUTEHESSIAN - compute hessian matrix from a field
+-%
+-%   Compute the hessian matrix of a given field
+-%   return the three components Hxx Hxy Hyy
+-%   for each element or each node
+-%
+-%   Usage:
+-%      hessian=ComputeHessian(index,x,y,field,type)
+-%
+-%   Example:
+-%      hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vel_obs,'node')
+-
+-%some variables
+-numberofnodes=length(x);
+-numberofelements=size(index,1);
+-
+-%some checks
+-if length(field)~=numberofnodes & length(field)~=numberofelements,
+-	error('ComputeHessian error message: the given field size not supported yet');
+-end
+-if strcmpi(type,'node') & strcmpi(type,'element'),
+-	error('ComputeHessian error message: only ''node'' or ''element'' type supported yet');
+-end
+-
+-%initialization
+-line=index(:);
+-linesize=3*numberofelements;
+-
+-%get areas and  nodal functions coefficients N(x,y)=alpha x + beta y + gamma 
+-[alpha beta]=GetNodalFunctionsCoeff(index,x,y);
+-areas=GetAreas(index,x,y);
+-
+-%comput weights that holds the volume of all the element holding the node i
+-weights=sparse(line,ones(linesize,1),repmat(areas,3,1),numberofnodes,1);
+-
+-%compute field on nodes if on elements
+-if length(field)==numberofelements,
+-	field=sparse(line,ones(linesize,1),repmat(areas.*field,3,1),numberofnodes,1)./weights ;
+-end
+-
+-%Compute gradient for each element
+-grad_elx=sum(field(index).*alpha,2); 
+-grad_ely=sum(field(index).*beta,2);
+-
+-%Compute gradient for each node (average of the elements around)
+-gradx=sparse(line,ones(linesize,1),repmat(areas.*grad_elx,3,1),numberofnodes,1);
+-grady=sparse(line,ones(linesize,1),repmat(areas.*grad_ely,3,1),numberofnodes,1);
+-gradx=gradx./weights;
+-grady=grady./weights;
+-
+-%Compute hessian for each element
+-hessian=[sum(gradx(index).*alpha,2) sum(grady(index).*alpha,2) sum(grady(index).*beta,2)];
+-
+-if strcmpi(type,'node')
+-	%Compute Hessian on the nodes (average of the elements around)
+-	hessian=[sparse(line,ones(linesize,1),repmat(areas.*hessian(:,1),3,1),numberofnodes,1)./weights ...
+-		sparse(line,ones(linesize,1),repmat(areas.*hessian(:,2),3,1),numberofnodes,1)./weights ...
+-		sparse(line,ones(linesize,1),repmat(areas.*hessian(:,3),3,1),numberofnodes,1)./weights ];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/meshread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/meshread.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/meshread.m	(revision 12996)
+@@ -1,41 +0,0 @@
+-function Struct=meshread(filename);
+-
+-%some checks
+-if ~exist(filename),
+-	error(['meshread error message: file ' filename ' not found!']);
+-end
+-
+-fid=fopen(filename,'r');
+-
+-while (~feof(fid)),
+-
+-	A=fscanf(fid,'%s',1);
+-
+-	if strcmp(A,'MeshVersionFormatted');
+-		Struct.Version=fscanf(fid,'%s',1);
+-
+-	elseif strcmp(A,'Dimension'),
+-		Struct.Dimension=fscanf(fid,'%i',1);
+-
+-	elseif strcmp(A,'Vertices'),
+-		Struct.nods=fscanf(fid,'%i',1);
+-		A=fscanf(fid,'%f %f %f',[3 Struct.nods]);
+-		Struct.x=A(1,:)';
+-		Struct.y=A(2,:)';
+-
+-	elseif strcmp(A,'Triangles'),
+-		Struct.nels=fscanf(fid,'%i',1);
+-		A=fscanf(fid,'%i %i %i',[4 Struct.nels]);
+-		Struct.index=A(1:3,:)';
+-
+-	elseif strcmp(A,'Quadrilaterals'),
+-		Struct.nels=fscanf(fid,'%i',1);
+-		A=fscanf(fid,'%i %i %i %i',[5 Struct.nels]);
+-		Struct.index=A(1:4,:)';
+-	else
+-		%do nothing
+-
+-	end
+-end
+-
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/GetNodalFunctionsCoeff.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/GetNodalFunctionsCoeff.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/GetNodalFunctionsCoeff.m	(revision 12996)
+@@ -1,56 +0,0 @@
+-function [alpha beta varargout]=GetNodalFunctionsCoeff(index,x,y)
+-%GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
+-%
+-%   Compute the coefficients alpha beta and optionaly gamma of
+-%   2d triangular elements. For each element, the nodal function
+-%   is defined as:
+-%   N(x,y)=sum(i=1:3) alpha_i * x + beta_i * y + gamma_i
+-%
+-%   Usage:
+-%      [alpha beta]=GetNodalFunctionsCoeff(index,x,y);
+-%      [alpha beta gamma]=GetNodalFunctionsCoeff(index,x,y);
+-%
+-%   Example:
+-%      [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
+-
+-%make columns out of x and y
+-x=x(:); y=y(:);
+-
+-%get nels and nods
+-nels=size(index,1);
+-nods=length(x);
+-
+-%some checks
+-if nargin~=3 | (nargout~=2 & nargout~=3),
+-	help GetNodalFunctionsCoeff
+-	error('GetNodalFunctionsCoeff error message: bad usage')
+-end
+-if length(y)~=nods,
+-	error('GetNodalFunctionsCoeff error message: x and y do not have the same length')
+-end
+-if max(index(:))>nods,
+-	error(['GetNodalFunctionsCoeff error message: index should not have values above ' num2str(nods) ])
+-end
+-if size(index,2)~=3,
+-	error('GetNodalFunctionsCoeff error message: only 2d meshes supported. index should have 3 columns.')
+-end
+-
+-%initialize output
+-alpha=zeros(nels,3);
+-beta=zeros(nels,3);
+-
+-%compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
+-x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
+-y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
+-invdet=1./(x1.*(y2-y3)-x2.*(y1-y3)+x3.*(y1-y2));
+-
+-%get alpha and beta
+-alpha=[invdet.*(y2-y3) invdet.*(y3-y1) invdet.*(y1-y2)];
+-beta =[invdet.*(x3-x2) invdet.*(x1-x3) invdet.*(x2-x1)];
+-
+-%get gamma if requested
+-if nargout==3,
+-	gamma=zeros(nels,3);
+-	gamma=[invdet.*(x2.*y3-x3.*y2) invdet.*(y1.*x3-y3.*x1) invdet.*(x1.*y2-x2.*y1)];
+-	varargout{1}=gamma;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/intersections.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/intersections.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/intersections.m	(revision 12996)
+@@ -1,279 +0,0 @@
+-function [x0,y0,iout,jout] = intersections(x1,y1,x2,y2,robust)
+-%INTERSECTIONS Intersections of curves.
+-%   Computes the (x,y) locations where two curves intersect.  The curves
+-%   can be broken with NaNs or have vertical segments.
+-%
+-% Example:
+-%   [X0,Y0] = intersections(X1,Y1,X2,Y2,ROBUST);
+-%
+-% where X1 and Y1 are equal-length vectors of at least two points and
+-% represent curve 1.  Similarly, X2 and Y2 represent curve 2.
+-% X0 and Y0 are column vectors containing the points at which the two
+-% curves intersect.
+-%
+-% ROBUST (optional) set to 1 or true means to use a slight variation of the
+-% algorithm that might return duplicates of some intersection points, and
+-% then remove those duplicates.  The default is true, but since the
+-% algorithm is slightly slower you can set it to false if you know that
+-% your curves don't intersect at any segment boundaries.  Also, the robust
+-% version properly handles parallel and overlapping segments.
+-%
+-% The algorithm can return two additional vectors that indicate which
+-% segment pairs contain intersections and where they are:
+-%
+-%   [X0,Y0,I,J] = intersections(X1,Y1,X2,Y2,ROBUST);
+-%
+-% For each element of the vector I, I(k) = (segment number of (X1,Y1)) +
+-% (how far along this segment the intersection is).  For example, if I(k) =
+-% 45.25 then the intersection lies a quarter of the way between the line
+-% segment connecting (X1(45),Y1(45)) and (X1(46),Y1(46)).  Similarly for
+-% the vector J and the segments in (X2,Y2).
+-%
+-% You can also get intersections of a curve with itself.  Simply pass in
+-% only one curve, i.e.,
+-%
+-%   [X0,Y0] = intersections(X1,Y1,ROBUST);
+-%
+-% where, as before, ROBUST is optional.
+-
+-% Version: 1.10, 25 February 2008
+-% Author:  Douglas M. Schwarz
+-% Email:   dmschwarz=ieee*org, dmschwarz=urgrad*rochester*edu
+-% Real_email = regexprep(Email,{'=','*'},{'@','.'})
+-
+-
+-% Theory of operation:
+-%
+-% Given two line segments, L1 and L2,
+-%
+-%   L1 endpoints:  (x1(1),y1(1)) and (x1(2),y1(2))
+-%   L2 endpoints:  (x2(1),y2(1)) and (x2(2),y2(2))
+-%
+-% we can write four equations with four unknowns and then solve them.  The
+-% four unknowns are t1, t2, x0 and y0, where (x0,y0) is the intersection of
+-% L1 and L2, t1 is the distance from the starting point of L1 to the
+-% intersection relative to the length of L1 and t2 is the distance from the
+-% starting point of L2 to the intersection relative to the length of L2.
+-%
+-% So, the four equations are
+-%
+-%    (x1(2) - x1(1))*t1 = x0 - x1(1)
+-%    (x2(2) - x2(1))*t2 = x0 - x2(1)
+-%    (y1(2) - y1(1))*t1 = y0 - y1(1)
+-%    (y2(2) - y2(1))*t2 = y0 - y2(1)
+-%
+-% Rearranging and writing in matrix form,
+-%
+-%  [x1(2)-x1(1)       0       -1   0;      [t1;      [-x1(1);
+-%        0       x2(2)-x2(1)  -1   0;   *   t2;   =   -x2(1);
+-%   y1(2)-y1(1)       0        0  -1;       x0;       -y1(1);
+-%        0       y2(2)-y2(1)   0  -1]       y0]       -y2(1)]
+-%
+-% Let's call that A*T = B.  We can solve for T with T = A\B.
+-%
+-% Once we have our solution we just have to look at t1 and t2 to determine
+-% whether L1 and L2 intersect.  If 0 <= t1 < 1 and 0 <= t2 < 1 then the two
+-% line segments cross and we can include (x0,y0) in the output.
+-%
+-% In principle, we have to perform this computation on every pair of line
+-% segments in the input data.  This can be quite a large number of pairs so
+-% we will reduce it by doing a simple preliminary check to eliminate line
+-% segment pairs that could not possibly cross.  The check is to look at the
+-% smallest enclosing rectangles (with sides parallel to the axes) for each
+-% line segment pair and see if they overlap.  If they do then we have to
+-% compute t1 and t2 (via the A\B computation) to see if the line segments
+-% cross, but if they don't then the line segments cannot cross.  In a
+-% typical application, this technique will eliminate most of the potential
+-% line segment pairs.
+-
+-
+-% Input checks.
+-error(nargchk(2,5,nargin))
+-
+-% Adjustments when fewer than five arguments are supplied.
+-switch nargin
+-	case 2
+-		robust = true;
+-		x2 = x1;
+-		y2 = y1;
+-		self_intersect = true;
+-	case 3
+-		robust = x2;
+-		x2 = x1;
+-		y2 = y1;
+-		self_intersect = true;
+-	case 4
+-		robust = true;
+-		self_intersect = false;
+-	case 5
+-		self_intersect = false;
+-end
+-
+-% x1 and y1 must be vectors with same number of points (at least 2).
+-if sum(size(x1) > 1) ~= 1 || sum(size(y1) > 1) ~= 1 || ...
+-		length(x1) ~= length(y1)
+-	error('X1 and Y1 must be equal-length vectors of at least 2 points.')
+-end
+-% x2 and y2 must be vectors with same number of points (at least 2).
+-if sum(size(x2) > 1) ~= 1 || sum(size(y2) > 1) ~= 1 || ...
+-		length(x2) ~= length(y2)
+-	error('X2 and Y2 must be equal-length vectors of at least 2 points.')
+-end
+-
+-
+-% Force all inputs to be column vectors.
+-x1 = x1(:);
+-y1 = y1(:);
+-x2 = x2(:);
+-y2 = y2(:);
+-
+-% Compute number of line segments in each curve and some differences we'll
+-% need later.
+-n1 = length(x1) - 1;
+-n2 = length(x2) - 1;
+-xy1 = [x1 y1];
+-xy2 = [x2 y2];
+-dxy1 = diff(xy1);
+-dxy2 = diff(xy2);
+-
+-% Determine the combinations of i and j where the rectangle enclosing the
+-% i'th line segment of curve 1 overlaps with the rectangle enclosing the
+-% j'th line segment of curve 2.
+-[i,j] = find(repmat(min(x1(1:end-1),x1(2:end)),1,n2) <= ...
+-	repmat(max(x2(1:end-1),x2(2:end)).',n1,1) & ...
+-	repmat(max(x1(1:end-1),x1(2:end)),1,n2) >= ...
+-	repmat(min(x2(1:end-1),x2(2:end)).',n1,1) & ...
+-	repmat(min(y1(1:end-1),y1(2:end)),1,n2) <= ...
+-	repmat(max(y2(1:end-1),y2(2:end)).',n1,1) & ...
+-	repmat(max(y1(1:end-1),y1(2:end)),1,n2) >= ...
+-	repmat(min(y2(1:end-1),y2(2:end)).',n1,1));
+-
+-% For one segment in x1,y1, i and j are returned as row vectors.  They
+-% need to be column vectors, or iout and jout below will err out.
+-% (jes, 6/11/10)
+-
+-if (size(i,1) == 1)
+-    i=i';
+-end
+-if (size(j,1) == 1)
+-    j=j';
+-end
+-
+-% Find segments pairs which have at least one vertex = NaN and remove them.
+-% This line is a fast way of finding such segment pairs.  We take
+-% advantage of the fact that NaNs propagate through calculations, in
+-% particular subtraction (in the calculation of dxy1 and dxy2, which we
+-% need anyway) and addition.
+-% At the same time we can remove redundant combinations of i and j in the
+-% case of finding intersections of a line with itself.
+-if self_intersect
+-	remove = isnan(sum(dxy1(i,:) + dxy2(j,:),2)) | j <= i + 1;
+-else
+-	remove = isnan(sum(dxy1(i,:) + dxy2(j,:),2));
+-end
+-i(remove) = [];
+-j(remove) = [];
+-
+-% Initialize matrices.  We'll put the T's and B's in matrices and use them
+-% one column at a time.  AA is a 3-D extension of A where we'll use one
+-% plane at a time.
+-n = length(i);
+-T = zeros(4,n);
+-AA = zeros(4,4,n);
+-AA([1 2],3,:) = -1;
+-AA([3 4],4,:) = -1;
+-AA([1 3],1,:) = dxy1(i,:).';
+-AA([2 4],2,:) = dxy2(j,:).';
+-B = -[x1(i) x2(j) y1(i) y2(j)].';
+-
+-% Loop through possibilities.  Trap singularity warning and then use
+-% lastwarn to see if that plane of AA is near singular.  Process any such
+-% segment pairs to determine if they are colinear (overlap) or merely
+-% parallel.  That test consists of checking to see if one of the endpoints
+-% of the curve 2 segment lies on the curve 1 segment.  This is done by
+-% checking the cross product
+-%
+-%   (x1(2),y1(2)) - (x1(1),y1(1)) x (x2(2),y2(2)) - (x1(1),y1(1)).
+-%
+-% If this is close to zero then the segments overlap.
+-
+-% If the robust option is false then we assume no two segment pairs are
+-% parallel and just go ahead and do the computation.  If A is ever singular
+-% a warning will appear.  This is faster and obviously you should use it
+-% only when you know you will never have overlapping or parallel segment
+-% pairs.
+-
+-if robust
+-	overlap = false(1,n);
+-	warning_state = warning('off','MATLAB:singularMatrix');
+-	% Use try-catch to guarantee original warning state is restored.
+-	try
+-		lastwarn('')
+-		for k = 1:n
+-			T(:,k) = AA(:,:,k)\B(:,k);
+-			[unused,last_warn] = lastwarn;
+-			lastwarn('')
+-			if strcmp(last_warn,'MATLAB:singularMatrix')
+-				% Force in_range(k) to be false.
+-				T(1,k) = NaN;
+-				% Determine if these segments overlap or are just parallel.
+-				overlap(k) = rcond([dxy1(i(k),:);xy2(j(k),:) - xy1(i(k),:)]) < eps;
+-			end
+-		end
+-		warning(warning_state)
+-	catch
+-		warning(warning_state)
+-		rethrow(lasterror)
+-	end
+-	% Find where t1 and t2 are between 0 and 1 and return the corresponding
+-	% x0 and y0 values.
+-	in_range = T(1,:) >= 0 & T(2,:) >= 0 & T(1,:) <= 1 & T(2,:) <= 1;
+-	% For overlapping segment pairs the algorithm will return an
+-	% intersection point that is at the center of the overlapping region.
+-	if any(overlap)
+-		ia = i(overlap);
+-		ja = j(overlap);
+-		% set x0 and y0 to middle of overlapping region.
+-		T(3,overlap) = (max(min(x1(ia),x1(ia+1)),min(x2(ja),x2(ja+1))) + ...
+-			min(max(x1(ia),x1(ia+1)),max(x2(ja),x2(ja+1)))).'/2;
+-		T(4,overlap) = (max(min(y1(ia),y1(ia+1)),min(y2(ja),y2(ja+1))) + ...
+-			min(max(y1(ia),y1(ia+1)),max(y2(ja),y2(ja+1)))).'/2;
+-		selected = in_range | overlap;
+-	else
+-		selected = in_range;
+-	end
+-	xy0 = T(3:4,selected).';
+-	
+-	% Remove duplicate intersection points.
+-	[xy0,index] = unique(xy0,'rows');
+-	x0 = xy0(:,1);
+-	y0 = xy0(:,2);
+-	
+-	% Compute how far along each line segment the intersections are.
+-	if nargout > 2
+-		sel_index = find(selected);
+-		sel = sel_index(index);
+-		iout = i(sel) + T(1,sel).';
+-		jout = j(sel) + T(2,sel).';
+-	end
+-else % non-robust option
+-	for k = 1:n
+-		[L,U] = lu(AA(:,:,k));
+-		T(:,k) = U\(L\B(:,k));
+-	end
+-	
+-	% Find where t1 and t2 are between 0 and 1 and return the corresponding
+-	% x0 and y0 values.
+-	in_range = T(1,:) >= 0 & T(2,:) >= 0 & T(1,:) < 1 & T(2,:) < 1;
+-	x0 = T(3,in_range).';
+-	y0 = T(4,in_range).';
+-	
+-	% Compute how far along each line segment the intersections are.
+-	if nargout > 2
+-		iout = i(in_range) + T(1,in_range).';
+-		jout = j(in_range) + T(2,in_range).';
+-	end
+-end
+-
+-% Plot the results (useful for debugging).
+-% plot(x1,y1,x2,y2,x0,y0,'ok');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/BamgCallFromMetric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/BamgCallFromMetric.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/BamgCallFromMetric.m	(revision 12996)
+@@ -1,65 +0,0 @@
+-function md=BamgCallFromMetric(md,metric,gradation),
+-%BAMGCALL - call bam
+-%
+-%   call Bamg and the output mesh is plugged onto the model
+-%   -gradation = maximum edge length gradation between 2 elements
+-%
+-%   Usage:
+-%      md=BamgCallFromMetric(md,metric,gradation);
+-%
+-%   Example:
+-%      md=BamgCall(md,metric,1500,10^8,1.3,0.9);
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%write files
+-t1=clock; fprintf('%s','      writing initial mesh files...');
+-fid=fopen('carre0.met','w');
+-fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
+-fprintf(fid,'%i %i %i\n',metric');
+-fclose(fid);
+-
+-fid=fopen('carre0.mesh','w');
+-
+-%initialiation
+-fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
+-
+-%dimension
+-fprintf(fid,'\n%s\n%i\n','Dimension',2);
+-
+-%Vertices
+-fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
+-fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
+-
+-%Triangles
+-fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
+-fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
+-numberofelements1=md.mesh.numberofelements;
+-
+-%close
+-fclose(fid);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%call bamg
+-fprintf('%s\n','      call Bamg...');
+-system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
+-
+-%plug new mesh
+-t1=clock; fprintf('\n%s','      reading final mesh files...');
+-A=meshread('carre1.mesh');
+-md.mesh.x=A.x;
+-md.mesh.y=A.y;
+-md.z=zeros(A.nods,1);
+-md.mesh.elements=A.index;
+-md.mesh.numberofvertices=A.nods;
+-md.mesh.numberofelements=A.nels;
+-numberofelements2=md.mesh.numberofelements;
+-t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%display number of elements
+-fprintf('\n%s %i','      inital number of elements:',numberofelements1);
+-fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
+-
+-%clean up:
+-system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/GetCharacteristicLength.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/GetCharacteristicLength.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/GetCharacteristicLength.m	(revision 12996)
+@@ -1,45 +0,0 @@
+-function length=GetCharacteristicLength(index,x,y,varargin)
+-%GETCHARACTERISTICLENGTH - compute characteristic length for a mesh
+-%
+-%   compute characteristic lengths of every element of a mesh.
+-%
+-%   Usage:
+-%      length  =GetCharacteristicLength(index,x,y);
+-%      length  =GetCharacteristicLength(index,x,y,z);
+-%
+-%   Examples:
+-%      length  =GetCharacteristicLength(md.mesh.elements,md.mesh.x,md.mesh.y);
+-%      length  =GetCharacteristicLength(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
+-
+-
+-%get number of elements and number of nodes
+-nels=size(index,1);
+-nods=numel(x);
+-
+-%some checks
+-if nargout~=1 | (nargin~=3 & nargin~=4),
+-	help GetCharacteristicLength
+-	error('GetCharacteristicLength error message: bad usage')
+-end
+-if ((numel(y)~=nods) | (nargin==4 & numel(z)~=nods)),
+-	error('GetCharacteristicLength error message: x,y and z do not have the same length')
+-end
+-if max(index(:))>nods,
+-	error(['GetCharacteristicLength error message: index should not have values above ' num2str(nods) ])
+-end
+-if (nargin==3 & size(index,2)~=3),
+-	error('GetCharacteristicLength error message: index should have 3 columns for 2d meshes.')
+-end
+-if (nargin==4 & size(index,2)~=6),
+-	error('GetCharacteristicLength error message: index should have 6 columns for 3d meshes.')
+-end
+-
+-%get areas or volumes.
+-areas=GetAreas(index,x,y,varargin{:});
+-
+-%for a 2d mesh: 
+-if nargin==3,
+-	length=sqrt(2*areas);
+-else
+-	error('not supported yet');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/GetAreas.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/GetAreas.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/GetAreas.m	(revision 12996)
+@@ -1,51 +0,0 @@
+-function areas=GetAreas(index,x,y,varargin)
+-%GETAREAS - compute areas or volumes of elements
+-%
+-%   compute areas of triangular elements or volumes 
+-%   of pentahedrons
+-%
+-%   Usage:
+-%      areas  =GetAreas(index,x,y);
+-%      volumes=GetAreas(index,x,y,z);
+-%
+-%   Examples:
+-%      areas  =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
+-%      volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
+-
+-%get number of elements and number of nodes
+-nels=size(index,1);
+-nods=length(x);
+-if nargin==4, z=varargin{1}; end
+-
+-%some checks
+-if nargout~=1 | (nargin~=3 & nargin~=4),
+-	help GetAreas
+-	error('GetAreas error message: bad usage')
+-end
+-if ((length(y)~=nods) | (nargin==4 & length(z)~=nods)),
+-	error('GetAreas error message: x,y and z do not have the same length')
+-end
+-if max(index(:))>nods,
+-	error(['GetAreas error message: index should not have values above ' num2str(nods) ])
+-end
+-if (nargin==3 & size(index,2)~=3),
+-	error('GetAreas error message: index should have 3 columns for 2d meshes.')
+-end
+-if (nargin==4 & size(index,2)~=6),
+-	error('GetAreas error message: index should have 6 columns for 3d meshes.')
+-end
+-
+-%initialization
+-areas=zeros(nels,1);
+-x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
+-y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
+-
+-%compute the volume of each element
+-if nargin==3,
+-	%compute the surface of the triangle
+-	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
+-else
+-	%V=area(triangle)*1/3(z1+z2+z3)
+-	thickness=mean(z(index(:,4:6)),2)-mean(z(index(:,1:3)),2);
+-	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1))).*thickness;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/isconnected.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/isconnected.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/isconnected.m	(revision 12996)
+@@ -1,13 +0,0 @@
+-function flag=isconnected(elements,A,B)
+-%ISCONNECTED: are two nodes connected by a triangulation?
+-%
+-%   Usage: flag=isconnected(elements,A,B)
+-%
+-%
+-
+-elements=ElementsFromEdge(elements,A,B);
+-if isempty(elements),
+-	flag=0;
+-else
+-	flag=1;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/argusmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/argusmesh.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/argusmesh.m	(revision 12996)
+@@ -1,96 +0,0 @@
+-function md=argusmesh(md,infile)
+-%ARGUSMESH - load an Argus mesh onto a model
+-%
+-%   Convert an Argus mesh contained in a file into
+-%   fields needed for the mesh in a model md.
+-%
+-%   Usage:
+-%      md=argusmesh(md,infile)
+-%
+-%   Example:
+-%     md=argusmesh(md,'TriMesh.exp')
+-
+-%some argument check: 
+-if nargin~=2 | nargout~=1,
+-	help argustomodel;
+-	error('argustomodel error message: bad usage');
+-end
+-
+-%determine root of infile: strip extension
+-[a,root,b,c]=fileparts(infile);
+-
+-%inform user we start the script: 
+-disp(['   Translating argus file ''' infile ''' into matlab model object']);
+-
+-%open infile: 
+-fileid=fopen(infile,'r');
+-if fileid==-1,
+-	error(['Could not open file ' infile  ' for reading']);
+-end
+-
+-%Read first line of the argus mesh: node and element parameters
+-[buffer,bytecount]=fscanf(fileid,'%i %i %i %i',[1 4]);
+-if bytecount~=4, 
+-	error(['Problem reading ' infile ' file at line #1']);
+-end
+-nel=buffer(1);
+-nods=buffer(2);
+-num_element_parameters=buffer(3);
+-num_node_parameters=buffer(4);
+-disp(['      argus model '''   root ''' contains ' num2str(nel) ' elements and ' num2str(nods) ' nodes.']);
+-
+-%initialize elements and nodes
+-elements=zeros(nel,3);
+-element_parameters=zeros(nel,num_element_parameters);
+-x=zeros(nods,1);
+-y=zeros(nods,1);
+-z=zeros(nods,1);
+-node_parameters=zeros(nods,num_node_parameters);
+-
+-%read nodes:
+-format_string='%s %i %f %f ';
+-for n=1:num_node_parameters,
+-	format_string=[format_string ' %i '];
+-end
+-
+-for n=1:nods,
+-	[buffer,bytecount]=fscanf(fileid,format_string,[1,num_node_parameters+4]);
+-	x(n)=buffer(3);
+-	y(n)=buffer(4);
+-	node_parameters(n,:)=buffer(5:length(buffer));
+-end
+-
+-%read elements: 
+-format_string='%s %i %i %i %i';
+-for n=1:num_element_parameters,
+-	format_string=[format_string ' %i '];
+-end
+-for n=1:nel,
+-	[buffer,bytecount]=fscanf(fileid,format_string,[1,num_element_parameters+5]);
+-	elements(n,:)=buffer(3:5);
+-	element_parameters(n,:)=buffer(6:length(buffer));
+-end
+-
+-%Create a name and a note for this model: 
+-notes=['Model created by Argus from input file: ' infile ' and parameter file: ' root '.par on: ' date];
+-name=root;
+-
+-%Finally, use model constructor to build a complete model: 
+-md.mesh.elements=elements;
+-md.mesh.x=x;
+-md.mesh.y=y;
+-md.z=z;
+-md.mesh.numberofvertices=size(md.mesh.x,1);
+-md.mesh.numberofelements=size(md.mesh.elements,1);
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+-md.mesh.dimension=2;
+-md=addnote(md,notes);
+-
+-%Add segments and nodes on boundary
+-md.mesh.segments=findsegments(md);
+-md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonboundary(md.mesh.segments(:,1))=1;
+-md.mesh.vertexonboundary(md.mesh.segments(:,2))=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/BamgCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/BamgCall.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/BamgCall.m	(revision 12996)
+@@ -1,84 +0,0 @@
+-function md=BamgCall(md,field,hmin,hmax,gradation,epsilon),
+-%BAMGCALL - call bam
+-%
+-%   build a metric using the Hessian of the given field
+-%   call Bamg and the output mesh is plugged onto the model
+-%   -hmin = minimum edge length (m)
+-%   -hmax = maximum edge length (m)
+-%   -gradation = maximum edge length gradation between 2 elements
+-%   -epsilon = average error on each element (m/yr)
+-%
+-%   Usage:
+-%      md=BamgCall(md,field,hmin,hmax,gradation,epsilon);
+-%
+-%   Example:
+-%      md=BamgCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%Compute Hessian
+-t1=clock; fprintf('%s','      computing Hessian...');
+-hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%Compute metric
+-t1=clock; fprintf('%s','      computing metric...');
+-if length(md.nodeonwater)==md.mesh.numberofvertices,
+-	pos=find(md.nodeonwater);
+-else
+-	pos=[];
+-end
+-metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%write files
+-t1=clock; fprintf('%s','      writing initial mesh files...');
+-fid=fopen('carre0.met','w');
+-fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
+-fprintf(fid,'%i %i %i\n',metric');
+-fclose(fid);
+-
+-fid=fopen('carre0.mesh','w');
+-
+-%initialiation
+-fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
+-
+-%dimension
+-fprintf(fid,'\n%s\n%i\n','Dimension',2);
+-
+-%Vertices
+-fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
+-fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
+-
+-%Triangles
+-fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
+-fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
+-numberofelements1=md.mesh.numberofelements;
+-
+-%close
+-fclose(fid);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%call bamg
+-fprintf('%s\n','      call Bamg...');
+-system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
+-
+-%plug new mesh
+-t1=clock; fprintf('\n%s','      reading final mesh files...');
+-A=meshread('carre1.mesh');
+-md.mesh.x=A.x;
+-md.mesh.y=A.y;
+-md.z=zeros(A.nods,1);
+-md.mesh.elements=A.index;
+-md.mesh.numberofvertices=A.nods;
+-md.mesh.numberofelements=A.nels;
+-numberofelements2=md.mesh.numberofelements;
+-t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%display number of elements
+-fprintf('\n%s %i','      inital number of elements:',numberofelements1);
+-fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
+-
+-%clean up:
+-system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/FixMesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/FixMesh.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/FixMesh.m	(revision 12996)
+@@ -1,45 +0,0 @@
+-function  [index2 x2 y2 value2]=FixMesh(index,x,y,value)
+-%FixMesh fix mesh with broken triangles, orphan vertices, etc ...
+-%
+-% Usage: 
+-%            [index2 x2 y2 value2]=FixMesh(index,x,y,value)
+-%            where index,x,y is a delaunay triangulation, 
+-%                  value is a field on the input triangulation, with values at the vertices
+-%                  index2,x2,y2,value2 is the repaired triangulation, with new values on new vertices
+-%
+-%
+-
+-%duplicate inputs
+-index2=index;
+-x2=x;
+-y2=y;
+-value2=value;
+-
+-%First, look for orphan vertices, and take them out.
+-flags=zeros(length(x2),1); flags(index2)=1;
+-orphans=find(flags==0);
+-
+-while ~isempty(orphans),
+-
+-	%take the first orphan, the lower numbered, and take it out
+-	orphan=orphans(1);
+-
+-	%first x,y,value
+-	x2(orphan)=[];
+-	y2(orphan)=[];
+-	value2(orphan)=[];
+-
+-	%now, the index:
+-	pos=find(index2>orphan); index2(pos)=index2(pos)-1;
+-	
+-	%look again for orphans on new mesh
+-	flags=zeros(length(x2),1);flags(index2)=1;
+-	orphans=find(flags==0);
+-end
+-
+-%Check all triangles are well oriented.
+-aires=GetAreas(index2,x2,y2);
+-pos=find(aires<0);
+-temp=index2(pos,1);
+-index2(pos,1)=index2(pos,2);
+-index2(pos,2)=temp;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/roundmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/roundmesh.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/roundmesh.m	(revision 12996)
+@@ -1,34 +0,0 @@
+-function md=roundmesh(md,radius,resolution)
+-%ROUNDMESH - create an unstructured round mesh 
+-%
+-%   This script will generate a structured round mesh
+-%   - radius     : specifies the radius of the circle in meters
+-%   - resolution : specifies the resolution in meters
+-%
+-%   Usage:
+-%      md=roundmesh(md,radius,resolution)
+-
+-%First we have to create the domain outline 
+-
+-%Get number of points on the circle
+-pointsonedge=floor((2*pi*radius) / resolution);
+-
+-%Calculate the cartesians coordinates of the points
+-x_list=ones(pointsonedge,1); y_list=ones(pointsonedge,1);
+-theta=(0:2*pi/pointsonedge:2*pi*(1-1/pointsonedge))';
+-x_list=radius*x_list.*cos(theta);
+-y_list=radius*y_list.*sin(theta);
+-A=struct('x',x_list,'y',y_list,'density',1);
+-expgen('RoundDomainOutline.exp',A,1);
+-
+-%Call Bamg
+-md=triangle(md,'RoundDomainOutline.exp',resolution);
+-%md=bamg(md,'domain','RoundDomainOutline.exp','hmin',resolution);
+-
+-%move the closest node to the center
+-[mini pos]=min(md.mesh.x.^2+md.mesh.y.^2);
+-md.mesh.x(pos)=0;
+-md.mesh.y(pos)=0;
+-
+-%delete domain
+-delete('RoundDomainOutline.exp')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ProfileProjectOntoMesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ProfileProjectOntoMesh.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ProfileProjectOntoMesh.m	(revision 12996)
+@@ -1,66 +0,0 @@
+-function mesh_profile=ProfileProjectOntoMesh(md,profile)
+-%PROFILEPROJECTONTOMESH: project a profile (made of arbitrary points) onto a mesh, so that we end 
+-%                        up with a list of segments self contained onto elements.
+-%
+-% Usage: mesh_profile=ProfileProjectOntoMesh(md,profile)
+-%
+-% See also intersections.m
+-
+-%make a curve out of the mesh, to use the intersections routine.
+-rows=[md.mesh.elements md.mesh.elements(:,1)]'; rows=rows(:);
+-x=md.mesh.x(rows);
+-y=md.mesh.y(rows);
+-
+-%[x0,y0] = intersections(profile.x,profile.y,x,y,1);
+-[x0,y0,indices,j] = intersections(profile.x,profile.y,x,y);
+-
+-%  sort intersections to create segments in order and continuous along profile
+-[indices,isort]=sort(indices);
+-j =j (isort);
+-x0=x0(isort);
+-y0=y0(isort);
+-
+-%process x0,y0 so they do not include profile.x or profile.y
+-processed_indices=[];
+-processed_x=[];
+-processed_y=[];
+-for i=1:numel(indices),
+-	if(((indices(i)-floor(indices(i)))~=0) && ((ceil(indices(i))-indices(i))~=0))
+-		processed_indices=[processed_indices;floor(indices(i))];
+-		processed_x=[processed_x;x0(i)];
+-		processed_y=[processed_y;y0(i)];
+-	end
+-end
+-
+-%now merge profile.x,profile.y with processed_x,processed_y, at locations processed_indices:
+-newx=profile.x;
+-newy=profile.y;
+-
+-count=1;
+-for i=1:numel(profile.x),
+-	pos=find(processed_indices==i);
+-	if ~isempty(pos),
+-		newx=[newx(1:count); processed_x(pos); newx(count+1:end)];
+-		newy=[newy(1:count); processed_y(pos); newy(count+1:end)];
+-		count=count+length(pos)+1;
+-	end
+-end
+-
+-%now, for each node, figure out which element it belongs to.
+-node_in_element=NodeInElement(newx,newy,md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.vertexconnectivity);
+-
+-% eliminate nodes that don't fall in any element
+-% (profile may start and/or end externally and/or cross holes in the model)
+-
+-ind=find(node_in_element(:,9)>0);
+-newx=newx(ind,:);
+-newy=newy(ind,:);
+-node_in_element=node_in_element(ind,:);
+-
+-mesh_profile=[newx(1:end-1) newy(1:end-1) newx(2:end) newy(2:end) zeros(length(newy(2:end)),1)];
+-
+-%find which element each segment belongs to.
+-for i=1:length(newx)-1,
+-	common=intersect(node_in_element(i,1:node_in_element(i,end)), node_in_element(i+1,1:node_in_element(i+1,end)));
+-	mesh_profile(i,end)=common(1);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/YamsCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/YamsCall.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/YamsCall.m	(revision 12996)
+@@ -1,104 +0,0 @@
+-function md=YamsCall(md,field,hmin,hmax,gradation,epsilon),
+-%YAMSCALL - call yams
+-%
+-%   build a metric using the Hessian of the given field
+-%   call Yams and the output mesh is plugged onto the model
+-%   -hmin = minimum edge length (m)
+-%   -hmax = maximum edge length (m)
+-%   -gradation = maximum edge length gradation between 2 elements
+-%   -epsilon = average error on each element (m/yr)
+-%
+-%   Usage:
+-%      md=YamsCall(md,field,hmin,hmax,gradation,epsilon);
+-%
+-%   Example:
+-%      md=YamsCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%Compute Hessian
+-t1=clock; fprintf('%s','      computing Hessian...');
+-hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%Compute metric
+-t1=clock; fprintf('%s','      computing metric...');
+-if length(md.mask.vertexonwater)==md.mesh.numberofvertices,
+-	pos=find(md.mask.vertexonwater);
+-else
+-	pos=[];
+-end
+-metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%write files
+-t1=clock; fprintf('%s','      writing initial mesh files...');
+-save -ascii carre0.met  metric
+-
+-fid=fopen('carre0.mesh','w');
+-
+-%initialiation
+-fprintf(fid,'\n%s\n%i\n','MeshVersionFormatted',1);
+-
+-%dimension
+-fprintf(fid,'\n%s\n%i\n','Dimension',2);
+-
+-%Vertices
+-fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
+-fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y zeros(md.mesh.numberofvertices,1)]');
+-
+-%Triangles
+-fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
+-fprintf(fid,'%i %i %i %i\n',[md.mesh.elements zeros(md.mesh.numberofelements,1)]');
+-numberofelements1=md.mesh.numberofelements;
+-	
+-%Deal with rifts
+-if ~isnan(md.rifts.riftstruct),
+-	
+-	%we have the list of triangles that make up the rift. keep those triangles around during refinement.
+-	triangles=[];
+-	for i=1:size(md.rifts.riftstruct,1),
+-		triangles=[triangles md.rifts(i).segments(:,3)'];
+-	end
+-
+-	fprintf(fid,'\n\n%s\n%i\n\n','RequiredTriangles',length(triangles));
+-	fprintf(fid,'%i\n',triangles);
+-end
+-
+-%close
+-fclose(fid);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%call yams
+-fprintf('%s\n','      call Yams...');
+-if ispc
+-	%windows
+-	system(['yams2-win -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
+-elseif ismac
+-	%Macosx
+-	system(['yams2-osx -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
+-else
+-	%Linux
+-	system(['yams2-linux -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
+-end
+-
+-%plug new mesh
+-t1=clock; fprintf('\n%s','      reading final mesh files...');
+-Tria=load('carre1.tria');
+-Coor=load('carre1.coor');
+-md.mesh.x=Coor(:,1);
+-md.mesh.y=Coor(:,2);
+-md.mesh.z=zeros(size(Coor,1),1);
+-md.mesh.elements=Tria;
+-md.mesh.numberofvertices=size(Coor,1);
+-md.mesh.numberofelements=size(Tria,1);
+-numberofelements2=md.mesh.numberofelements;
+-t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%display number of elements
+-fprintf('\n%s %i','      inital number of elements:',numberofelements1);
+-fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
+-
+-%clean up:
+-system('rm carre0.mesh carre0.met carre1.tria carre1.coor carre1.meshb');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/MeshQuality.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/MeshQuality.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/MeshQuality.m	(revision 12996)
+@@ -1,82 +0,0 @@
+-function quality=MeshQuality(md,epsilon,hmin,hmax);
+-%MESHQUALITY - compute mesh quality
+-%
+-%   Usage:
+-%      MeshQuality(md,epsilon,hmin,hmax);
+-
+-%Get some variables from the model
+-index=md.mesh.elements;
+-x=md.mesh.x;
+-y=md.mesh.y;
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%Compute Hessian
+-hessian=ComputeHessian(index,x,y,md.inversion.vel_obs,'node');
+-
+-%Compute metric
+-if length(md.nodeonwater)==md.mesh.numberofvertices,
+-	pos=find(md.nodeonwater);
+-else
+-	pos=[];
+-end
+-metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
+-
+-%Get Areas
+-areas=GetAreas(index,x,y);
+-
+-%length edges vectors
+-e1x=[x(index(:,2))-x(index(:,1))];
+-e1y=[y(index(:,2))-y(index(:,1))];
+-e2x=[x(index(:,3))-x(index(:,2))];
+-e2y=[y(index(:,3))-y(index(:,2))];
+-e3x=[x(index(:,1))-x(index(:,3))];
+-e3y=[y(index(:,1))-y(index(:,3))];
+-
+-%metric of each the 3 nodes for each element
+-M1=metric(index(:,1),:);
+-M2=metric(index(:,2),:);
+-M3=metric(index(:,3),:);
+-
+-%Get edge length in the metric
+-L1=1/2*(sqrt(e2x.*(M2(:,1).*e2x+M2(:,2).*e2y)+e2y.*(M2(:,2).*e2x+M2(:,3).*e2y))+sqrt(e1x.*(M1(:,1).*e1x+M1(:,2).*e1y)+e1y.*(M1(:,2).*e1x+M1(:,3).*e1y)));
+-L2=1/2*(sqrt(e3x.*(M3(:,1).*e3x+M3(:,2).*e3y)+e3y.*(M3(:,2).*e3x+M3(:,3).*e3y))+sqrt(e2x.*(M2(:,1).*e2x+M2(:,2).*e2y)+e2y.*(M2(:,2).*e2x+M2(:,3).*e2y)));
+-L3=1/2*(sqrt(e1x.*(M1(:,1).*e1x+M1(:,2).*e1y)+e1y.*(M1(:,2).*e1x+M1(:,3).*e1y))+sqrt(e3x.*(M3(:,1).*e3x+M3(:,2).*e3y)+e3y.*(M3(:,2).*e3x+M3(:,3).*e3y)));
+-
+-%area in the metric
+-V=1/3*areas.*(sqrt(M1(:,1).*M1(:,3)-M1(:,2).^2)+sqrt(M2(:,1).*M2(:,3)-M2(:,2).^2)+sqrt(M3(:,1).*M3(:,3)-M3(:,2).^2));
+-
+-%compute quality:
+-quality=4*sqrt(3)*V./(L1+L2+L3);
+-
+-%compute error
+-a=hessian(:,1); b=hessian(:,2); d=hessian(:,3);
+-a=a(index)*[1;1;1]/3;
+-b=b(index)*[1;1;1]/3;
+-d=d(index)*[1;1;1]/3;
+-lambda1=0.5*((a+d)+sqrt(4*b.^2+(a-d).^2));
+-lambda2=0.5*((a+d)-sqrt(4*b.^2+(a-d).^2));
+-lambda1=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
+-lambda2=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
+-if length(md.nodeonwater)==md.mesh.numberofvertices;
+-	pos=find(md.nodeonwater);
+-	lambda1(pos)=0;
+-	lambda2(pos)=0;
+-end
+-lambda1=lambda1(index)*[1;1;1]/3;
+-lambda2=lambda2(index)*[1;1;1]/3;
+-
+-lambdamax=max(lambda1,lambda2);
+-hmax=max(max(sqrt(e1x.^2+e1y.^2),sqrt(e2x.^2+e2y.^2)),sqrt(e3x.^2+e3y.^2));
+-epsilon=scale*hmax.^2.*lambdamax;
+-
+-%display
+-%X=0:0.1:4; hist(quality,X); xlim([0 3]); title('mesh quality distribution','FontSize',14);
+-%plotmodel(md,'data',epsilon,'title','Interpolation error','figure',2)
+-disp(sprintf('\n%s','Mesh Quality'));
+-disp(sprintf('   %s %g','Average Mesh quality: ',mean(quality)));
+-disp(sprintf('   %s %g','Worst Element quality:',max(quality)));
+-disp(sprintf('\n%s','Interpolation Error'));
+-disp(sprintf('   %s %g %s','Average interpolation error:',mean(epsilon),'m/yr'));
+-disp(sprintf('   %s %g %s','Maximum interpolation error:',max(epsilon),'m/yr'));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/squaremesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/squaremesh.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/squaremesh.m	(revision 12996)
+@@ -1,78 +0,0 @@
+-function md=squaremesh(md,Lx,Ly,nx,ny)
+-%SQUAREMESH - create a structured square mesh 
+-%
+-%   This script will generate a structured square mesh
+-%   Lx and Ly are the dimension of the domain (in meters)
+-%   nx anx ny are the number of nodes in the x and y direction
+-%   The coordinates x and y returned are in meters.
+-%
+-%   Usage:
+-%      [md]=squaremesh(md,Lx,Ly,nx,ny)
+-
+-%get number of elements and number of nodes
+-nel=(nx-1)*(ny-1)*2;
+-nods=nx*ny;
+-
+-%initialization
+-segments=zeros(0,3);
+-index=zeros(nel,3);
+-x=zeros(nx*ny,1);
+-y=zeros(nx*ny,1);
+-
+-%create coordinates
+-for n=1:nx,
+-	for m=1:ny,
+-		x((n-1)*ny+m)=(n-1);
+-		y((n-1)*ny+m)=(m-1);
+-	end
+-end
+-
+-%create index
+-for n=1:(nx-1)
+-	for m=1:(ny-1),
+-		A=(n-1)*ny+m;
+-		B=A+1;
+-		C=n*ny+m;
+-		D=C+1;
+-		index((n-1)*(ny-1)*2+2*(m-1)+1,:)=[A C B];
+-		index((n-1)*(ny-1)*2+2*m,:)=[B C D];
+-	end
+-end
+-
+-%Scale  x and y
+-x=x/max(x)*Lx;
+-y=y/max(y)*Ly;
+-
+-%create segments
+-segments=zeros(2*(nx-1)+2*(ny-1),3);
+-%left edge:
+-segments(1:ny-1,:)=[[2:ny]' [1:ny-1]' 2*[1:ny-1]'-1];
+-%right edge:
+-segments(ny:2*(ny-1),:)=[[ny*(nx-1)+1:nx*ny-1]' [ny*(nx-1)+2:nx*ny]' 2*[(ny-1)*(nx-2)+1:(nx-1)*(ny-1)]'];
+-%front edge:
+-segments(2*(ny-1)+1:2*(ny-1)+(nx-1),:)=[[2*ny:ny:ny*nx]' [ny:ny:ny*(nx-1)]' [2*(ny-1):2*(ny-1):2*(nx-1)*(ny-1)]'];
+-%back edge
+-segments(2*(ny-1)+(nx-1)+1:2*(nx-1)+2*(ny-1),:)=[[1:ny:(nx-2)*ny+1]' [ny+1:ny:ny*(nx-1)+1]' [1:2*(ny-1):2*(nx-2)*(ny-1)+1]'];
+-
+-%plug coordinates and nodes
+-md.mesh.x=x;
+-md.mesh.y=y;
+-md.mesh.z=zeros(nods,1);
+-md.mesh.numberofvertices=nods;
+-md.mesh.vertexonboundary=zeros(nods,1);md.mesh.vertexonboundary(segments(:,1:2))=1;
+-md.mesh.vertexonbed=ones(nods,1);
+-md.mesh.vertexonsurface=ones(nods,1);
+-
+-%plug elements
+-md.mesh.elements=index;
+-md.mesh.segments=segments;
+-md.mesh.numberofelements=nel;
+-md.mesh.elementonbed=ones(nel,1);
+-md.mesh.elementonsurface=ones(nel,1);
+-
+-%Now, build the connectivity tables for this mesh.
+-md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-
+-%plug other field
+-md.mesh.dimension=2;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/rifttipsonmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/rifttipsonmesh.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/rifttipsonmesh.m	(revision 12996)
+@@ -1,26 +0,0 @@
+-function tips=rifttipsonmesh(md,riftoutline)
+-%RIFTTIPSONMESH: identify, using a rift outline, the nodes that are tips of 
+-%                rifts.
+-
+-%read rifts from outline file
+-rifts=expread(riftoutline,1);
+-
+-tips=[];
+-
+-for i=1:length(rifts),
+-	rift=rifts(i);
+-
+-	x_tip=rift.x(1);
+-	y_tip=rift.y(1);
+-	
+-	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
+-	tips(end+1)=index;
+-
+-	x_tip=rift.x(end);
+-	y_tip=rift.y(end);
+-	
+-	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
+-	tips(end+1)=index;
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ComputeMetric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ComputeMetric.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Mesh/ComputeMetric.m	(revision 12996)
+@@ -1,66 +0,0 @@
+-function metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos)
+-%COMPUTEMETRIC - compute metric from an Hessian
+-%
+-%   Usage:
+-%      metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos)
+-%      pos is contains the positions where the metric is wished to be maximized (water?)
+-%
+-%   Example:
+-%      metric=ComputeMetric(hessian,2/9,10^-1,100,10^5,find(md.nodeonwater)
+-
+-%first, find the eigen values of eah line of H=[hessian(i,1) hessian(i,2); hessian(i,2)  hessian(i,3)]
+-a=hessian(:,1); b=hessian(:,2); d=hessian(:,3);
+-lambda1=0.5*((a+d)+sqrt(4*b.^2+(a-d).^2));
+-lambda2=0.5*((a+d)-sqrt(4*b.^2+(a-d).^2));
+-pos1=find(lambda1==0);
+-pos2=find(lambda2==0);
+-pos3=find(b==0 & lambda1==lambda2);
+-
+-%Modify the eigen values to control the shape of the elements
+-lambda1=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
+-lambda2=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
+-
+-%compute eigen vectors
+-norm1=sqrt(8*b.^2+2*(d-a).^2+2*(d-a).*sqrt((a-d).^2+4*b.^2));
+-v1x=2*b./norm1;
+-v1y=((d-a)+sqrt((a-d).^2+4*b.^2))./norm1;
+-norm2=sqrt(8*b.^2+2*(d-a).^2-2*(d-a).*sqrt((a-d).^2+4*b.^2));
+-v2x=2*b./norm2;
+-v2y=((d-a)-sqrt((a-d).^2+4*b.^2))./norm2;
+-
+-v1x(pos3)=1; v1y(pos3)=0;
+-v2x(pos3)=0; v2y(pos3)=1;
+-
+-%Compute new metric (for each node M=V*Lambda*V^-1)
+-metric=full([(v1x.*v2y-v1y.*v2x).^(-1).*(lambda1.*v2y.*v1x-lambda2.*v1y.*v2x) ...
+-	(v1x.*v2y-v1y.*v2x).^(-1).*(lambda1.*v1y.*v2y-lambda2.*v1y.*v2y) ...
+-	(v1x.*v2y-v1y.*v2x).^(-1).*(-lambda1.*v2x.*v1y+lambda2.*v1x.*v2y)]);
+-
+-%some corrections for 0 eigen values
+-metric(pos1,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos1),1);
+-metric(pos2,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos2),1);
+-
+-%take care of water elements
+-metric(pos,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos),1);
+-
+-%take care of NaNs if any (use Matlab eig in a loop)
+-[pos posj]=find(isnan(metric)); clear posj;
+-if ~isempty(pos),
+-	fprintf(' %i %s',length(pos),'NaN found in the metric. Use Matlab routine...');
+-	for i=1:length(pos)
+-		H=[hessian(pos(i),1) hessian(pos(i),2)
+-		hessian(pos(i),2) hessian(pos(i),3)];
+-		[u,v]=eig(full(H));
+-		lambda1=v(1,1);
+-		lambda2=v(2,2);
+-		v(1,1)=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
+-		v(2,2)=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
+-
+-		metricTria=u*v*u^(-1);
+-		metric(pos(i),:)=[metricTria(1,1) metricTria(1,2) metricTria(2,2)];
+-	end
+-end
+-
+-if any(isnan(metric)),
+-	error('ComputeMetric error message: NaN in the metric despite our efforts...')
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/ll2xy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/ll2xy.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/ll2xy.m	(revision 12996)
+@@ -1,66 +0,0 @@
+-function [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)  
+-%LL2XY - converts lat long to polar stereographic
+-%
+-%   Converts from geodetic latitude and longitude to Polar 
+-%   Stereographic (X,Y) coordinates for the polar regions.
+-%   Author: Michael P. Schodlok, December 2003 (map2ll)
+-%
+-%   Usage:
+-%      [x,y] = ll2xy(lat,lon,sgn)
+-%      [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)
+-%
+-%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
+-%                               -1 : south latitude (default is mer=0  lat=71)
+-
+-%Get central_meridian and standard_parallel depending on hemisphere
+-if nargin==5,
+-	delta = central_meridian;
+-	slat  = standard_parallel;
+-elseif nargin==3
+-	if sgn == 1,
+-		delta = 45; slat = 70;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-	elseif sgn==-1,
+-		delta = 0;  slat = 71;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
+-	else
+-		error('Sign should be either +1 or -1');
+-	end
+-else
+-	help ll2xy
+-	error('bad usage');
+-end
+-
+-% Conversion constant from degrees to radians
+-cde  = 57.29577951;
+-% Radius of the earth in meters
+-re   = 6378.273*10^3;
+-% Eccentricity of the Hughes ellipsoid squared
+-ex2   = .006693883;
+-% Eccentricity of the Hughes ellipsoid
+-ex    =  sqrt(ex2);
+-
+-latitude  = abs(lat) * pi/180.;
+-longitude = (lon + delta) * pi/180.;
+-
+-% compute X and Y in grid coordinates.
+-T = tan(pi/4-latitude/2) ./ ((1-ex*sin(latitude))./(1+ex*sin(latitude))).^(ex/2);
+-
+-if (90 - slat) <  1.e-5 
+-	rho = 2.*re*T/sqrt((1.+ex)^(1.+ex)*(1.-ex)^(1.-ex));
+-else
+-	sl  = slat*pi/180.;
+-	tc  = tan(pi/4.-sl/2.)/((1.-ex*sin(sl))/(1.+ex*sin(sl)))^(ex/2.);
+-	mc  = cos(sl)/sqrt(1.0-ex2*(sin(sl)^2));
+-	rho = re*mc*T/tc;
+-end
+-
+-y = -rho .* sgn .* cos(sgn.*longitude);
+-x =  rho .* sgn .* sin(sgn.*longitude);
+-
+-[cnt1,cnt2] = find(latitude >= pi / 2.);
+-
+-if cnt1
+-	x(cnt1,1) = 0.0;
+-	y(cnt1,1) = 0.0;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/xy2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/xy2ll.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/xy2ll.m	(revision 12996)
+@@ -1,72 +0,0 @@
+-function [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel)
+-%XY2LL - converts xy to lat long
+-%
+-%   Converts Polar  Stereographic (X,Y) coordinates for the polar regions to
+-%   latitude and longitude Stereographic (X,Y) coordinates for the polar
+-%   regions.
+-%   Author: Michael P. Schodlok, December 2003 (map2xy.m)
+-%
+-%   Usage:
+-%      [lat,lon] = xy2ll(x,y,sgn);
+-%      [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel);
+-%
+-%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
+-%                               -1 : south latitude (default is mer=0  lat=71)
+-
+-%Get central_meridian and standard_parallel depending on hemisphere
+-if nargin==5,
+-	delta = central_meridian;
+-	slat  = standard_parallel;
+-elseif nargin==3
+-	if sgn == 1,
+-		delta = 45; slat = 70;
+-		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-	elseif sgn==-1,
+-		delta = 0;  slat = 71;
+-		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
+-	else
+-		error('Sign should be either +1 or -1');
+-	end
+-else
+-	help xy2ll
+-	error('bad usage');
+-end
+-
+-% Conversion constant from degrees to radians
+-cde  = 57.29577951;
+-% Radius of the earth in meters
+-re   = 6378.273*10^3;
+-% Eccentricity of the Hughes ellipsoid squared
+-ex2   = .006693883;
+-% Eccentricity of the Hughes ellipsoid
+-ex    =  sqrt(ex2);
+-
+-sl  = slat*pi/180.;
+-rho = sqrt(x.^2 + y.^2);
+-cm = cos(sl) / sqrt(1.0 - ex2 * (sin(sl)^2));
+-T = tan((pi / 4.0) - (sl / 2.0)) / ((1.0 - ex * sin(sl)) / (1.0 + ex * sin(sl)))^(ex / 2.0);
+-
+-if  abs(slat-90.) < 1.e-5
+-	T = rho * sqrt((1. + ex)^(1. + ex) * (1. - ex)^(1. - ex)) / 2. / re;
+-else
+-	T = rho * T / (re * cm);
+-end
+-
+-chi = (pi / 2.0) - 2.0 * atan(T);
+-lat = chi + ((ex2 / 2.0) + (5.0 * ex2^2.0 / 24.0) + (ex2^3.0 / 12.0)) * ...
+-	sin(2 * chi) + ((7.0 * ex2^2.0 / 48.0) + (29.0 * ex2^3 / 240.0)) * ...
+-	sin(4.0 * chi) + (7.0 * ex2^3.0 / 120.0) * sin(6.0 * chi) ;
+-
+-lat = sgn * lat;
+-lon = atan2(sgn * x,-sgn * y);
+-lon = sgn * lon;
+-
+-[res1,res2] = find(rho <= 0.1);
+-if res1
+-	lat(res1,1) = 90. * sgn;
+-	lon(res1,1) = 0.0;
+-end
+-
+-lon = lon * 180. / pi;
+-lat = lat * 180. / pi;
+-lon = lon - delta; 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/pargenerate.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/pargenerate.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/pargenerate.m	(revision 12996)
+@@ -1,45 +0,0 @@
+-function pargenerate(filename,xm,ym,data,varargin)
+-%PARGENERATE - generate parameter file for images ala Rignot
+-%
+-%   Usage: 
+-%      pargenerate(filename,data,xm,ym,options);
+-%
+-%   Supported options:
+-%      - title: dataset title
+-%      - latitude: standard latitude (degree)
+-%      - meridian: meridian (degree)
+-%      - format: binary format
+-
+-%process options
+-options=pairoptions(varargin{:});
+-Title=getfieldvalue(options,'title','N/A');
+-latitude=getfieldvalue(options,'latitude','N/A');
+-meridian=getfieldvalue(options,'meridian','N/A');
+-format=getfieldvalue(options,'format','single');
+-
+-%Get data info
+-[nlines ncols]=size(data);
+-xmin=min(xm);
+-ymax=max(ym);
+-postx=abs(xm(2)-xm(1));
+-posty=abs(ym(2)-ym(1));
+-
+-%Open header file and get machine type
+-fid=fopen(filename,'wt');
+-[filename, permission, machineformat, encoding] = fopen(fid);
+-
+-%write header file
+-fprintf(fid,'%s\n','ISSM gridded dataset parameter file');
+-fprintf(fid,'%s%s\n','title: ',Title);
+-fprintf(fid,'%s  \n','DEM_projection: PS');
+-fprintf(fid,'%s%s\n','data_format: ',format);
+-fprintf(fid,'%s%s\n','endian:      ',machineformat);
+-fprintf(fid,'%s%d\n','width:  ',ncols);
+-fprintf(fid,'%s%d\n','nlines: ',nlines);
+-fprintf(fid,'%s%g%s\n','PS_secant_lat:    ',latitude,'   decimal degrees');
+-fprintf(fid,'%s%g%s\n','PS_meridian_long: ',meridian,'   decimal degrees');
+-fprintf(fid,'%s%-15.10g\n','PS_corner_north:  ',ymax);
+-fprintf(fid,'%s%-15.10g\n','PS_corner_east:   ',xmin);
+-fprintf(fid,'%s%g%s\n','PS_post_north:    ',postx,' m');
+-fprintf(fid,'%s%g%s\n','PS_post_east:     ',posty,' m');
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/utm2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/utm2ll.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/LatLong/utm2ll.m	(revision 12996)
+@@ -1,117 +0,0 @@
+-function  [Lat,Lon] = utm2ll(xx,yy,utmzone)
+-% -------------------------------------------------------------------------
+-% [Lat,Lon] = utm2ll(x,y,utmzone)
+-%
+-% Description: Function to convert vectors of UTM coordinates into Lat/Lon vectors (WGS84).
+-% Some code has been extracted from UTMIP.m function by Gabriel Ruiz Martinez.
+-%
+-% Inputs:on)
+-%    -3.485713    7.801235 -119.955246  -17.759537  -94.799019  121.640266
+-%
+-% Example 2: If you need Lat/Lon coordinates in Degrees, Minutes and Seconds
+-% [Lat, Lon]=utm2ll(x,y,utmzone);
+-% LatDMS=dms2mat(deg2dms(Lat))
+-%LatDMS =
+-%    40.00         18.00         55.55
+-%    46.00         17.00          2.01
+-%    37.00         34.00         40.17
+-%    28.00         38.00         44.33
+-%    38.00         51.00         19.96
+-%    25.00          3.00         42.41
+-% LonDMS=dms2mat(deg2dms(Lon))
+-%LonDMS =
+-%    -3.00         29.00          8.61
+-%     7.00         48.00          4.40
+-%  -119.00         57.00         18.93
+-%   -17.00         45.00         34.33
+-%   -94.00         47.00         56.47
+-%   121.00         38.00         24.96
+-%
+-% Author:
+-%   Rafael Palacios
+-%   Universidad Pontificia Comillas
+-%   Madrid, Spain
+-% Version: Apr/06, Jun/06, Aug/06
+-% Aug/06: corrected m-Lint warnings
+-%-------------------------------------------------------------------------
+-
+-% Argument checking
+-%
+-error(nargchk(3, 3, nargin)); %3 arguments required
+-n1=length(xx);
+-n2=length(yy);
+-n3=size(utmzone,1);
+-if (n1~=n2 || n1~=n3)
+-	error('x,y and utmzone vectors should have the same number or rows');
+-end
+-c=size(utmzone,2);
+-if (c~=4)
+-	error('utmzone should be a vector of strings like "30 T"');
+-end
+-
+-% Memory pre-allocation
+-%
+-Lat=zeros(n1,1);
+-Lon=zeros(n1,1);
+-
+-% Main Loop
+-%
+-for i=1:n1
+-	if (utmzone(i,4)>'X' || utmzone(i,4)<'C')
+-		fprintf('utm2ll: Warning utmzone should be a vector of strings like "30 T", not "30 t"\n');
+-	end
+-	if (utmzone(i,4)>'M')
+-		hemis='N';   % Northern hemisphere
+-	else
+-		hemis='S';
+-	end
+-
+-	x=xx(i);
+-	y=yy(i);
+-	zone=str2double(utmzone(i,1:2));
+-
+-	sa = 6378137.000000 ; sb = 6356752.314245;
+-
+-	%   e = ( ( ( sa ^ 2 ) - ( sb ^ 2 ) ) ^ 0.5 ) / sa;
+-	e2 = ( ( ( sa ^ 2 ) - ( sb ^ 2 ) ) ^ 0.5 ) / sb;
+-	e2cuadrada = e2 ^ 2;
+-	c = ( sa ^ 2 ) / sb;
+-	%   alpha = ( sa - sb ) / sa;             %f
+-	%   ablandamiento = 1 / alpha;   % 1/f
+-
+-	X = x - 500000;
+-
+-	if hemis == 'S' || hemis == 's'
+-		Y = y - 10000000;
+-	else
+-		Y = y;
+-	end
+-
+-	S = ( ( zone * 6 ) - 183 );
+-	lat =  Y / ( 6366197.724 * 0.9996 );
+-	v = ( c / ( ( 1 + ( e2cuadrada * ( cos(lat) ) ^ 2 ) ) ) ^ 0.5 ) * 0.9996;
+-	a = X / v;
+-	a1 = sin( 2 * lat );
+-	a2 = a1 * ( cos(lat) ) ^ 2;
+-	j2 = lat + ( a1 / 2 );
+-	j4 = ( ( 3 * j2 ) + a2 ) / 4;
+-	j6 = ( ( 5 * j4 ) + ( a2 * ( cos(lat) ) ^ 2) ) / 3;
+-	alfa = ( 3 / 4 ) * e2cuadrada;
+-	beta = ( 5 / 3 ) * alfa ^ 2;
+-	gama = ( 35 / 27 ) * alfa ^ 3;
+-	Bm = 0.9996 * c * ( lat - alfa * j2 + beta * j4 - gama * j6 );
+-	b = ( Y - Bm ) / v;
+-	Epsi = ( ( e2cuadrada * a^ 2 ) / 2 ) * ( cos(lat) )^ 2;
+-	Eps = a * ( 1 - ( Epsi / 3 ) );
+-	nab = ( b * ( 1 - Epsi ) ) + lat;
+-	senoheps = ( exp(Eps) - exp(-Eps) ) / 2;
+-	Delt = atan(senoheps / (cos(nab) ) );
+-	TaO = atan(cos(Delt) * tan(nab));
+-	longitude = (Delt *(180 / pi ) ) + S;
+-	latitude = ( lat + ( 1 + e2cuadrada* (cos(lat)^ 2) - ( 3 / 2 ) * e2cuadrada * sin(lat) * cos(lat) * ( TaO - lat ) ) * ( TaO - lat ) ) * ...
+-		(180 / pi);
+-
+-	Lat(i)=latitude;
+-	Lon(i)=longitude;
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Model/loadmodellist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Model/loadmodellist.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Model/loadmodellist.m	(revision 12996)
+@@ -1,50 +0,0 @@
+-function varargout=loadmodellist(path)
+-%LOADMODELLIST- load a model using built-in load module
+-%
+-%   check that modellist prototype has not changed. if so, adapt to new modellist prototype.
+-%
+-%   Usage:
+-%      mds=loadmodellist(path)
+-%      loadmodellist path
+-
+-%check nargout
+-if nargout>1,
+-	error('loadmodellist usage error: mds=loadmodellist(path)');
+-end
+-%check existence
+-if ~exist(path)
+-	error(['loadmodellist error message: file ' path ' does not exist']);
+-end
+-
+-%check that the file is readable
+-[stat,mess]=fileattrib(path);
+-if( stat==0 | mess.UserRead~=1),
+-	error(['loadmodellist error message: file ' path ' is not readable (permission dinied).']);
+-end
+-
+-%check number of variables
+-if length(whos('-file',path))>1,
+-	error(['loadmodellist error message: file ' path ' contains several variables. Only one model should be present.']);
+-end
+-
+-try,
+-	struc=load(path,'-mat');
+-
+-	%get name of model variable
+-	fieldname=char(fieldnames(struc));
+-	mds=eval(['struc.' fieldname]);
+-	if ~strcmpi(class(mds),'model'),
+-		mds2=modellist;
+-		mds2=structtomodel(mds2,mds);
+-		mds=mds2;
+-		clear mds2;
+-	end
+-	if nargout,
+-		varargout{1}=mds;
+-	else
+-		assignin('caller',fieldname,mds);
+-	end
+-catch me
+-	disp(getReport(me))
+-	error(['could not load model ' path]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Model/loadmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Model/loadmodel.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Model/loadmodel.m	(revision 12996)
+@@ -1,46 +0,0 @@
+-function varargout=loadmodel(path)
+-%LOADMODEL - load a model using built-in load module
+-%
+-%   check that model prototype has not changed. if so, adapt to new model prototype.
+-%
+-%   Usage:
+-%      md=loadmodel(path)
+-%      loadmodel path
+-
+-%check nargout
+-if nargout>1,
+-	error('loadmodel usage error: md=loadmodel(path)');
+-end
+-
+-%check existence
+-if exist(path,'file')
+-	%do nothing
+-elseif exist([path '.mat'],'file')
+-	%add extension
+-	path = [path '.mat'];
+-else
+-	error(['loadmodel error message: file ' path ' does not exist']);
+-end
+-
+-try,
+-	%recover model on file and name it md
+-	warning off MATLAB:unknownElementsNowStruc;
+-	warning off MATLAB:load:classNotFound
+-	struc=load(path,'-mat');
+-	warning on MATLAB:unknownElementsNowStruc;
+-	warning on MATLAB:load:classNotFound
+-
+-	name=char(fieldnames(struc));
+-	if size(name,1)>1,
+-		error(['loadmodel error message: file ' path ' contains several variables. Only one model should be present.']); 
+-	end
+-	md=struc.(name);
+-	if nargout,
+-		varargout{1}=md;
+-	else
+-		assignin('caller',name,md);
+-	end
+-catch me
+-	disp(getReport(me))
+-	error(['could not load model ' path]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/VelFindVarNames.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/VelFindVarNames.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/VelFindVarNames.m	(revision 12996)
+@@ -1,122 +0,0 @@
+-function Names=VelFindVarNames(filename)
+-%VELFINDVARNAMES - find names of variables in a velocity data set file
+-%
+-%   This routines looks at the variables contained in a file and finds out
+-%   the names of the variables that are needed for an interpolation (x,y,vx,vy)
+-%   or (index,x,y,vx,vy)
+-%
+-%   Usage:
+-%      Names=VelFindVarNames(filename)
+-%
+-%   Example:
+-%      Names=VelFindVarNames('velocities.mat')
+-%
+-%   See also: INTERPFROMFILE, GRIDDATA
+-
+-%some checks
+-if nargin~=1 | nargout~=1
+-	help VelFindVarNames
+-	error('VelFindVarNames error message: bad usage');
+-end
+-if ~exist(filename)
+-	error(['VelFindVarNames error message: file ' filename  ' does not exist']);
+-end
+-
+-%Get variables
+-A=whos('-file',filename);
+-
+-%find x,y,vx and vy
+-xenum=NaN; yenum=NaN; vxenum=NaN; vyenum=NaN; indexenum=NaN;
+-if length(A)==4,
+-	isnode=1;
+-	for i=1:4
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		else
+-			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
+-				vxenum=i;
+-			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
+-				vyenum=i;
+-			end
+-		end
+-	end
+-elseif length(A)==5,
+-	isnode=0;
+-	for i=1:5
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		elseif (strcmpi(A(i).name(1),'index') | strcmpi(A(i).name(1),'elements'));
+-			indexenum=i;
+-		else
+-			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
+-				vxenum=i;
+-			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
+-				vyenum=i;
+-			end
+-		end
+-	end
+-else
+-	error(['VelFindVarNames error message: file ' filename  ' not supported yet (it should hold 4 variables x,y,vx and vy (for nodes) OR 5 variables  x,y,index,vx and vy (for mesh))']);
+-end
+-
+-%assum that we have found at least vxenum and vyenum
+-if ( isnan(vxenum) | isnan(vyenum))
+-	error(['VelFindVarNames error message: file ' filename  ' not supported yet (the velocities should be named vx and vy)']);
+-end
+-
+-%find index
+-if (~isnode & isnan(indexenum)),
+-	for i=1:5
+-		lengthi=min(A(i).size);
+-		if (lengthi==3),
+-			indexenum=i;
+-		end
+-	end
+-	if isnan(indexenum),
+-		error(['VelFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
+-	end
+-end
+-
+-%find x y
+-if (isnan(xenum) | isnan(yenum))
+-
+-	%check the size
+-	if A(vxenum).size(1)==A(vxenum).size(2),
+-		error(['VelFindVarNames error message: file ' filename  ' not supported (velocities is a square matrix, save x and y with another name)']);
+-	end
+-	if ~(A(vxenum).size(1)==A(vyenum).size(1) & A(vxenum).size(2)==A(vyenum).size(2)),
+-		error(['VelFindVarNames error message: file ' filename  ' not supported (vx and vy matrices do not have the same size)']);
+-	end
+-
+-	%find xenum and yenum
+-	for i=1:4
+-		lengthi=max(A(i).size);
+-		if ((i~=vxenum) & (lengthi==A(vxenum).size(1) | lengthi==A(vxenum).size(1)+1)),
+-			yenum=i;
+-		elseif ((i~=vxenum) & (lengthi==A(vxenum).size(2) | lengthi==A(vxenum).size(2)+1)),
+-			xenum=i;
+-		end
+-	end
+-
+-	%last check
+-	if (isnan(xenum) | isnan(yenum))
+-		error(['plugdata error message: file ' filename  ' not supported yet']);
+-	end
+-end
+-
+-%create output
+-Names=struct();
+-Names.xname=A(xenum).name;
+-Names.yname=A(yenum).name;
+-Names.vxname=A(vxenum).name;
+-Names.vyname=A(vyenum).name;
+-if ~isnode,
+-	Names.indexname=A(indexenum).name; 
+-	Names.interp='mesh';
+-else
+-	Names.interp='node';
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/InterpFromFile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/InterpFromFile.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/InterpFromFile.m	(revision 12996)
+@@ -1,44 +0,0 @@
+-function data_out=InterpFromFile(x,y,filename,default_value)
+-%INTERPFROMFILE - load data and interpolate on the given nodes
+-%
+-%   load a matlab file (extension .mat) which holds 3 or 4 variables
+-%   and interpolate the data on the mesh and plug it onto the model.
+-%
+-%   o 3 variables
+-%     - a vector x (if the name of the variable do not begin with "x", an error can appear)
+-%     - a vector y (if the name of the variable do not begin with "y", an error can appear)
+-%     - a vector or matrix data (if the name of the variable do not begin with the field name, an error can appear)
+-%   o 4 variables
+-%     - a vector x (if the name of the variable do not begin with "x", an error can appear)
+-%     - a vector y (if the name of the variable do not begin with "y", an error can appear)
+-%     - a matrix with 3 columns (if the name of the variable do not begin with "index" or "elements", an error can appear)
+-%     - a vector data (if the name of the variable do not begin with the field name, an error can appear)
+-%
+-%   Usage:
+-%      data=InterpFromFile(x,y,filename,default_value);
+-%
+-%   Example:
+-%      md.geometry.surface=InterpFromFile(md.mesh.x,md.mesh.y,'surfacefile.mat',0);
+-%
+-%   See also: PLUGVELOCITIES, INTERPFROMGRID, INTERPFROMMESH2D, INTERPFROMMESH3D
+-
+-%some checks
+-if nargin~=4 | nargout~=1
+-	help InterpFromFile
+-	error('plugdata error message: bad usage');
+-end
+-if ~exist(filename)
+-	error(['plugdata error message: file ' filename  ' does not exist']);
+-end
+-if length(x)~=length(y),
+-	error('plugdata error message: x and y should have the same length');
+-end
+-
+-%load file
+-Names=FieldFindVarNames(filename);
+-Data=load(filename);
+-if strcmpi(Names.interp,'node'),
+-	data_out=InterpFromGridToMesh(Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y,default_value);
+-else
+-	data_out=InterpFromMeshToMesh2d(Data.(Names.indexname),Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/FillHole.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/FillHole.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/FillHole.m	(revision 12996)
+@@ -1,39 +0,0 @@
+-function field=FillHole(index,x,y,field)
+-%FILLHOLE - fill mesh data that has holes in it (hole is defined by field==NaN). Get the nearest neighboors to fill the holes.
+-%
+-%   Usage:
+-%      surface=FillHole(index,x,y,surface)
+-%
+-%   Example:
+-%      md.geometry.surface=FillHole(md.mesh.elements,x,md.mesh.y,md.geometry.surface)
+-%
+-
+-%some checks
+-if nargin~=4 | nargout~=1
+-	help FillHole
+-	error('FillHole error message: bad usage');
+-end
+-
+-if length(x)~=length(y),
+-	error('plugdata error message: x and y should have the same length');
+-end
+-
+-
+-pos_hole=find(isnan(field));
+-pos_full=find(~isnan(field));
+-
+-%reduce our field to not include any holes: 
+-field_noholes=field(pos_full);
+-x_noholes=x(pos_full);
+-y_noholes=y(pos_full);
+-
+-for i=1:length(pos_hole)
+-
+-	if (mod(i,100)==0),
+-		fprintf('\b\b\b\b\b\b\b%5.2f%s',i/length(pos_hole)*100,' %');
+-	end
+-
+-	%search the node on the closest to i, that is not in a hole either
+-	[d posd]=min(sqrt((x(pos_hole(i))-x_noholes).^2+(y(pos_hole(i))-y_noholes).^2));
+-	field(pos_hole(i))=field_noholes(posd);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/plugvelocities.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/plugvelocities.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/plugvelocities.m	(revision 12996)
+@@ -1,41 +0,0 @@
+-function md=plugvelocities(md,filename,default_value)
+-%PLUGVELOCITIES - load velocities on a model
+-%
+-%   load a matlab file (extension .mat) which holds 4 variables
+-%   x,y,vx,vy to be plugged onto the model (or similar names)
+-%   x and y must be vectors, vx, vy matrices
+-%
+-%   Usage:
+-%      md=plugvelocities(md,filename,default_value)
+-%
+-%   Example:
+-%      md=plugvelocities(md,'velocityfile.mat',0);
+-%
+-%   See also: INTERPFROMFILE, GRIDDATA
+-
+-%some checks
+-if nargin~=3 | nargout~=1
+-	help plugvelocities
+-	error('plugvelocities error message: bad usage');
+-end
+-if ~exist(filename)
+-	error(['plugvelocities error message: file ' filename  ' does not exist']);
+-end
+-
+-%load velocities 
+-Names=VelFindVarNames(filename);
+-Vel=load(filename);
+-
+-%Interpolation
+-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,default_value);
+-	md.inversion.vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,default_value);
+-else
+-	md.inversion.vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,default_value);
+-	md.inversion.vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,default_value);
+-end
+-
+-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.vel=md.inversion.vel_obs;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/PatchToVec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/PatchToVec.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/PatchToVec.m	(revision 12996)
+@@ -1,21 +0,0 @@
+-function vec=PatchToVec(Patch);
+-%PATCHTOVEC - converts a patch to a vector by averaging over each vertex
+-%
+-%   Usage:
+-%      vec=PatchToVec(Patch)
+-
+-%if the patch is P0: we have element values, return an element vector
+-switch(size(Patch.value,2)),
+-	case 1,
+-		vec(Patch.element)=Patch.value;
+-	case 3,
+-		connectivity=sparse(Patch.index(:),1,1);
+-		value       =sparse(Patch.index(:),1,Patch.value(:));
+-		vec=full(value./connectivity);
+-	case 6,
+-		connectivity=sparse(Patch.index(:),1,1);
+-		value       =sparse(Patch.index(:),1,Patch.value(:));
+-		vec=full(value./connectivity);
+-	otherwise,
+-		error('interpolation not supported yet');
+-	end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/FieldFindVarNames.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/FieldFindVarNames.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Interp/FieldFindVarNames.m	(revision 12996)
+@@ -1,153 +0,0 @@
+-function Names=FieldFindVarNames(filename)
+-%FIELDFINDVARNAMES - find names of variables in a data set file
+-%
+-%   This routines looks at the variables contained in a file and finds out
+-%   the names of the variables that are needed for an interpolation (x,y,data)
+-%   or (index,x,y,data)
+-%
+-%   Usage:
+-%      Names=FieldFindVarNames(filename)
+-%
+-%   Example:
+-%      Names=FieldFindVarNames('thickness.mat')
+-%
+-%   See also: INTERPFROMFILE, GRIDDATA
+-
+-%some checks
+-if nargin~=1 | nargout~=1
+-	help FieldFindVarNames
+-	error('FieldFindVarNames error message: bad usage');
+-end
+-if ~exist(filename)
+-	error(['FieldFindVarNames error message: file ' filename  ' does not exist']);
+-end
+-
+-%Get variables
+-A=whos('-file',filename);
+-
+-%find x,y,vx and vy
+-xenum=NaN; yenum=NaN; dataenum=NaN; indexenum=NaN;
+-if length(A)==3,
+-	isnode=1;
+-	for i=1:3
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
+-			dataenum=i;
+-		else
+-			%nothing
+-		end
+-	end
+-elseif length(A)==4,
+-	isnode=0;
+-	for i=1:4
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		elseif (strncmpi(A(i).name,'index',5) | strncmpi(A(i).name,'elements',7));
+-			indexenum=i;
+-		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
+-			dataenum=i;
+-		else
+-			%nothing
+-		end
+-	end
+-else
+-	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (it should hold 3 variables x,y and data (for nodes) OR 4 variables  x,y,index and data (for mesh))']);
+-end
+-
+-%2: if only one item is missing, find it by elimination
+-if ~isnode,
+-	pos=find(isnan([xenum yenum indexenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:4,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:4,list);
+-		elseif pos==3,
+-			indexenum=setdiff(1:4,list);
+-		elseif pos==4,
+-			dataenum=setdiff(1:4,list);
+-		end
+-	end
+-else
+-	pos=find(isnan([xenum yenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:3,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:3,list);
+-		elseif pos==3,
+-			dataenum=setdiff(1:3,list);
+-		end
+-	end
+-end
+-
+-%assum that we have found at least xenum and yenum
+-if ( isnan(xenum) | isnan(yenum))
+-	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (the coordinates vectors should be named x and y)']);
+-end
+-
+-%find index
+-if (~isnode & isnan(indexenum)),
+-	for i=1:4
+-		lengthi=min(A(i).size);
+-		if (lengthi==3),
+-			indexenum=i;
+-		end
+-	end
+-	if isnan(indexenum),
+-		error(['FieldFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
+-	end
+-end
+-
+-%4: last chance
+-if ~isnode,
+-	pos=find(isnan([xenum yenum indexenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:4,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:4,list);
+-		elseif pos==3,
+-			indexenum=setdiff(1:4,list);
+-		elseif pos==4,
+-			dataenum=setdiff(1:4,list);
+-		end
+-	end
+-else
+-	pos=find(isnan([xenum yenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:3,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:3,list);
+-		elseif pos==3,
+-			dataenum=setdiff(1:3,list);
+-		end
+-	end
+-end
+-
+-%last check
+-if isnan(dataenum)
+-	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (data not found)']);
+-end
+-
+-%create output
+-Names=struct();
+-Names.xname=A(xenum).name;
+-Names.yname=A(yenum).name;
+-Names.dataname=A(dataenum).name;
+-if ~isnode,
+-	Names.indexname=A(indexenum).name; 
+-	Names.interp='mesh';
+-else
+-	Names.interp='node';
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.py	(revision 12996)
+@@ -1,156 +0,0 @@
+-import numpy
+-import os
+-from pairoptions import *
+-from MatlabFuncs import *
+-
+-def checkfield(md,fieldname,*args):
+-	"""
+-	CHECKFIELD - check field consistency
+-
+-	   Used to check model consistency.
+-	   Available options:
+-	      - NaN: 1 if check that there is no NaN
+-	      - size: [lines cols], NaN for non checked dimensions
+-	      - >:  greater than provided value
+-	      - >=: greater or equal to provided value
+-	      - <:  smallerthan provided value
+-	      - <=: smaller or equal to provided value
+-	      - < vec:  smallerthan provided values on each vertex
+-	      - forcing: 1 if check forcing consistency (size and time)
+-	      - values: cell of strings or vector of acceptable values
+-	      - numel: list of acceptable number of elements
+-	      - cell: 1 if check that is cell
+-	      - empty: 1 if check that non empty
+-	      - message: overloaded error message
+-
+-	   Usage:
+-	      md = checkfield(md,fieldname,options);
+-
+-	   Example:
+-	      md = checkfield(md,'mesh.elementonbed','size',[md.mesh.numberofelements 1],'values',[0 1]);
+-	      md = checkfield(md,'diagnostic.icefront','size',[NaN 4],'NaN',1);
+-	      md = checkfield(md,'diagnostic.icefront(:,end)','values',[0 1 2]);
+-	"""
+-
+-	#get options
+-	options=pairoptions(*args)
+-
+-	#get field from model
+-#	field=getattr(md,fieldname)
+-	exec("field=md.%s" % fieldname)
+-
+-	#check empty
+-	if options.exist('empty'):
+-		if not field:
+-			md = md.checkmessage(options.getfieldvalue('message',\
+-				"field '%s' is empty" % fieldname))
+-
+-	#Check size
+-	if options.exist('size'):
+-		fieldsize=options.getfieldvalue('size')
+-		if   len(fieldsize) == 1:
+-			if (not numpy.size(field,0)==fieldsize[0]):
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' size should be %d" % (fieldname,fieldsize[0])))
+-		elif len(fieldsize) == 2:
+-			if   numpy.isnan(fieldsize[0]):
+-				if not numpy.size(field,1)==fieldsize[1]:
+-					md = md.checkmessage(options.getfieldvalue('message',\
+-						"field '%s' should have %d columns" % (fieldname,fieldsize[1])))
+-			elif numpy.isnan(fieldsize[1]):
+-				if not numpy.size(field,0)==fieldsize[0]:
+-					md = md.checkmessage(options.getfieldvalue('message',\
+-						"field '%s' should have %d lines" % (fieldname,fieldsize[0])))
+-			else:
+-				if (not numpy.size(field,0)==fieldsize[0]) or (not numpy.size(field,1)==fieldsize[1]):
+-					md = md.checkmessage(options.getfieldvalue('message',\
+-						"field '%s' size should be %d x %d" % (fieldname,fieldsize[0],fieldsize[1])))
+-	
+-	#Check numel
+-	if options.exist('numel'):
+-		fieldnumel=options.getfieldvalue('numel')
+-		if not numpy.size(field) in fieldnumel:
+-			if   len(fieldnumel)==1:
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' size should be %d" % (fieldname,fieldnumel)))
+-			elif len(fieldnumel)==2:
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' size should be %d or %d" % (fieldname,fieldnumel[0],fieldnumel[1])))
+-			else:
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' size should be %s" % (fieldname,fieldnumel)))
+-
+-	#check NaN
+-	if options.getfieldvalue('NaN',0):
+-		if True in numpy.isnan(field):
+-			md = md.checkmessage(options.getfieldvalue('message',\
+-				"NaN values found in field '%s'" % fieldname))
+-
+-	#check cell
+-	if options.getfieldvalue('cell',0):
+-		if not isinstance(field,(tuple,list,dict)):
+-			md = md.checkmessage(options.getfieldvalue('message',\
+-				"field '%s' should be a cell" % fieldname))
+-
+-	#check values
+-	if options.exist('values'):
+-		fieldvalues=options.getfieldvalue('values')
+-		if False in ismember(field,fieldvalues):
+-			if   len(fieldvalues)==1:
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' value should be '%s'"  % (fieldname,fieldvalues[0])))
+-			elif len(fieldvalues)==2:
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' values should be '%s' or '%s'"  % (fieldname,fieldvalues[0],fieldvalues[1])))
+-			else:
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' should have values in %s" % (fieldname,fieldvalues)))
+-
+-	#check greater
+-	if options.exist('>='):
+-		lowerbound=options.getfieldvalue('>=')
+-		if numpy.any(field<lowerbound):
+-			md = md.checkmessage(options.getfieldvalue('message',\
+-				"field '%s' should have values above %d" % (fieldname,lowerbound)))
+-	if options.exist('>'):
+-		lowerbound=options.getfieldvalue('>')
+-		if numpy.any(field<=lowerbound):
+-			md = md.checkmessage(options.getfieldvalue('message',\
+-				"field '%s' should have values above %d" % (fieldname,lowerbound)))
+-
+-	#check smaller
+-	if options.exist('<='):
+-		upperbound=options.getfieldvalue('<=')
+-		if numpy.any(field>upperbound):
+-			md = md.checkmessage(options.getfieldvalue('message',\
+-				"field '%s' should have values below %d" % (fieldname,upperbound)))
+-	if options.exist('<'):
+-		upperbound=options.getfieldvalue('<')
+-		if numpy.any(field>=upperbound):
+-			md = md.checkmessage(options.getfieldvalue('message',\
+-				"field '%s' should have values below %d" % (fieldname,upperbound)))
+-
+-	#check file
+-	if options.getfieldvalue('file',0):
+-		if not os.path.exists(field):
+-			md = md.checkmessage("file provided in '%s': '%s' does not exist" % (fieldname,field))
+-
+-	#Check forcings (size and times)
+-	if options.getfieldvalue('forcing',0):
+-		if   numpy.size(field,0)==md.mesh.numberofvertices:
+-			if not numpy.size(field,1)==1:
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' should have only one column as there are md.mesh.numberofvertices lines" % fieldname))
+-		elif numpy.size(field,0)==md.mesh.numberofvertices+1:
+-			if not numpy.all(field[-1,:]==numpy.sort(field[-1,:])):
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' columns should be sorted chronologically" % fieldname))
+-			if nump.any(field[-1,0:-1]==field[-1,1:]):
+-				md = md.checkmessage(options.getfieldvalue('message',\
+-					"field '%s' columns must not contain duplicate timesteps" % fieldname))
+-		else:
+-			md = md.checkmessage(options.getfieldvalue('message',\
+-				"field '%s' should have md.mesh.numberofvertices or md.mesh.numberofvertices+1 lines" % fieldname))
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.m	(revision 12996)
+@@ -1,195 +0,0 @@
+-function md = checkfield(md,fieldname,varargin)
+-%CHECKFIELD - check field consistency
+-%
+-%   Used to check model consistency.
+-%   Available options:
+-%      - NaN: 1 if check that there is no NaN
+-%      - size: [lines cols], NaN for non checked dimensions
+-%      - >:  greater than provided value
+-%      - >=: greater or equal to provided value
+-%      - <:  smallerthan provided value
+-%      - <=: smaller or equal to provided value
+-%      - < vec:  smallerthan provided values on each vertex
+-%      - forcing: 1 if check forcing consistency (size and time)
+-%      - values: cell of strings or vector of acceptable values
+-%      - numel: list of acceptable number of elements
+-%      - cell: 1 if check that is cell
+-%      - empty: 1 if check that non empty
+-%      - message: overloaded error message
+-%
+-%   Usage:
+-%      md = checkfield(md,fieldname,options);
+-%
+-%   Example:
+-%      md = checkfield(md,'mesh.elementonbed','size',[md.mesh.numberofelements 1],'values',[0 1]);
+-%      md = checkfield(md,'diagnostic.icefront','size',[NaN 4],'NaN',1);
+-%      md = checkfield(md,'diagnostic.icefront(:,end)','values',[0 1 2]);
+-
+-%get options
+-options=pairoptions(varargin{:});
+-
+-%get field from model
+-eval(['field=md.' fieldname ';']);
+-
+-%check empty
+-if exist(options,'empty')
+-	if isempty(field),
+-		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' is empty']));
+-	end
+-end
+-
+-%Check size
+-if exist(options,'size')
+-	fieldsize=getfieldvalue(options,'size');
+-	if isnan(fieldsize(1)),
+-		if (size(field,2)~=fieldsize(2)),
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' should have ' num2str(fieldsize(2)) ' columns']));
+-		end
+-	elseif isnan(fieldsize(2)),
+-		if (size(field,1)~=fieldsize(1)),
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' should have ' num2str(fieldsize(1)) ' lines']));
+-		end
+-	else
+-		if ((size(field,1)~=fieldsize(1)) |  (size(field,2)~=fieldsize(2)))
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' size should be ' num2str(fieldsize(1)) ' x ' num2str(fieldsize(2))]));
+-		end
+-	end
+-end
+-
+-%Check numel
+-if exist(options,'numel')
+-	fieldnumel=getfieldvalue(options,'numel');
+-	if ~ismember(numel(field),fieldnumel),
+-		if length(fieldnumel)==1
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' size should be ' sprintf('%g ',fieldnumel) ]));
+-		elseif length(fieldnumel)==2
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' size should be ' num2str(fieldnumel(1)) ' or ' num2str(fieldnumel(2)) ]));
+-		else
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' size should be ' sprintf('%g, ',fieldnumel(1:end-1)) ' or ' num2str(fieldnumel(end)) ]));
+-		end
+-	end
+-end
+-
+-%check NaN
+-if getfieldvalue(options,'NaN',0);
+-	field2=reshape(field,prod(size(field)),1);
+-	if any(isnan(field2)),
+-		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['NaN values found in field ''' fieldname '''']));
+-	end
+-end
+-
+-%check cell
+-if getfieldvalue(options,'cell',0);
+-	if ~iscell(field),
+-		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should be a cell']));
+-	end
+-end
+-
+-%check values
+-if exist(options,'values')
+-	fieldvalues=getfieldvalue(options,'values');
+-	if iscell(fieldvalues), %strings
+-		if ischar(field) | iscell(fieldvalues),
+-			if any(~ismember(field,fieldvalues)),
+-				if length(fieldvalues)==1
+-					md = checkmessage(md,getfieldvalue(options,'message',...
+-						['field ''' fieldname ''' value should be ''' fieldvalues{1} '''']));
+-				elseif length(fieldvalues)==2
+-					md = checkmessage(md,getfieldvalue(options,'message',...
+-						['field ''' fieldname ''' values should be ''' fieldvalues{1} ''' or ''' fieldvalues{2} '''']));
+-				else
+-					md = checkmessage(md,getfieldvalue(options,'message',...
+-						['field ''' fieldname ''' should have values in ' sprintf('''%s'', ',fieldvalues{1:end-1}) 'or ''' fieldvalues{end} '''']));
+-				end
+-			end
+-		else
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' should be one of the following strings: ' sprintf('''%s'', ',fieldvalues{1:end-1}) 'or ''' fieldvalues{end} '''']));
+-		end
+-	else
+-		field2=reshape(field,prod(size(field)),1);
+-		if isnumeric(field),
+-			if any(~ismember(field2,fieldvalues)),
+-				md = checkmessage(md,getfieldvalue(options,'message',...
+-					['field ''' fieldname ''' should have values in [' num2str(fieldvalues) ']']));
+-			end
+-		else
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' should be a number in [' num2str(fieldvalues) ']']));
+-		end
+-	end
+-end
+-
+-%check greater
+-if exist(options,'>=')
+-	lowerbound=getfieldvalue(options,'>=');
+-	field2=reshape(field,prod(size(field)),1);
+-	if any(field2<lowerbound),
+-		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should have values above ' num2str(lowerbound(1,1))]));
+-	end
+-end
+-if exist(options,'>')
+-	lowerbound=getfieldvalue(options,'>');
+-	field2=reshape(field,prod(size(field)),1);
+-	if any(field2<=lowerbound),
+-		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should have values above ' num2str(lowerbound(1,1))]));
+-	end
+-end
+-
+-%check smaller
+-if exist(options,'<=')
+-	upperbound=getfieldvalue(options,'<=');
+-	field2=reshape(field,prod(size(field)),1);
+-	if any(field2>upperbound),
+-		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should have values below ' num2str(upperbound(1,1))]));
+-	end
+-end
+-if exist(options,'<')
+-	upperbound=getfieldvalue(options,'<');
+-	field2=reshape(field,prod(size(field)),1);
+-	if any(field2>=upperbound),
+-		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should have values below ' num2str(upperbound(1,1))]));
+-	end
+-end
+-
+-%check file
+-if getfieldvalue(options,'file',0),
+-	if ~exist(field,'file')
+-		md = checkmessage(md,['file provided in ''' fieldname ''': ''' field ''' does not exist']);
+-	end
+-end
+-
+-%Check forcings (size and times)
+-if getfieldvalue(options,'forcing',0),
+-	if size(field,1)==md.mesh.numberofvertices,
+-		if ~size(field,2)==1,
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' should have only one column as there are md.mesh.numberofvertices lines']));
+-		end
+-	elseif size(field,1)==md.mesh.numberofvertices+1
+-		if any(field(end,:)~=sort(field(end,:))),
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' columns should be sorted chronologically']));
+-		end
+-		if any(field(end,1:end-1)==field(end,2:end)),
+-			md = checkmessage(md,getfieldvalue(options,'message',...
+-				['field ''' fieldname ''' columns must not contain duplicate timesteps']));
+-		end
+-	else
+-		md = checkmessage(md,getfieldvalue(options,'message',...
+-			['field ''' fieldname ''' should have md.mesh.numberofvertices or md.mesh.numberofvertices+1 lines']));
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/create_region.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/create_region.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/create_region.m	(revision 12996)
+@@ -1,15 +0,0 @@
+-function create_region(name)
+-%CREATE_REGION - create region  ????
+-%
+-%   very temporary function.
+-%   
+-%   Usage: 
+-%      create_region(name)
+-
+-eval(['mkdir ' name]);
+-eval(['cd ' name ]);
+-!mkdir Delivery Exp_Par Results
+-cd Exp_Par
+-!cp ../../RonneShelf/Exp_Par/* ./
+-!rm -rf Hole*
+-eval(['!mv Ronne.par ' name '.par']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/findarg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/findarg.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/findarg.m	(revision 12996)
+@@ -1,51 +0,0 @@
+-function  vals=findarg(arglist,field)
+-%FINDARG - find argument associated to a field in a list
+-%
+-%   This function parses through an argument list (typically varargin in a routine)
+-%   looking for a character array equal to field. Once this is found, we return the 
+-%   next value in the varargin (if possible). 
+-%   Because field might appear several times in the argument list, we return a structure 
+-%   holding all these values. 
+-%   Note that all comparisons to field value are case independent.
+-%
+-%   Usage:
+-%      vals=findarg(arglist,field)
+-%
+-%   Example:
+-%      routine foobar calls vals=findarg('Data',varargin)
+-%      with varargin='Data',1,'Data','foo','Plot','velocity','Arrow',4
+-%      findarg would return the following structure: vals(1).value=1, vals(2).value='foo'; 
+-
+-%some argument checking: 
+-if ((nargin==0) | (nargout==0)),
+-	help findarg;
+-	error('findarg error message');
+-end
+-
+-if ~ischar(field),
+-	error('findarg error message: field should be a string');
+-end
+-
+-if ~iscell(arglist),
+-	error('findarg error message: argument list should be a cell array.');
+-end
+-
+-%Recover data to plot
+-founddata=0;
+-
+-for i=1:(length(arglist)-1), %data in arglist comes in pairs, hence the -1.
+-	if ischar(arglist{i}),
+-		if (strcmpi(arglist{i},field)),
+-			founddata=founddata+1;
+-			if founddata==1,
+-				vals.value=arglist{i+1};
+-			else
+-				vals(end+1).value=arglist{i+1};
+-			end
+-		end
+-	end
+-end
+-
+-if founddata==0,
+-	vals=[];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/netcdf2struct.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/netcdf2struct.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/netcdf2struct.m	(revision 12996)
+@@ -1,27 +0,0 @@
+-function S=netcdf2struct(File)
+-%NETCDF2STRUCT - load netcdf file and convert to a matlab structure
+-%
+-%   Usage:
+-%      S=netcdf2struct(File);
+-
+-%Read netcdf file
+-data=netcdf(File);
+-
+-%initialize output
+-S=struct();
+-
+-%All the variables are in VarArray field
+-variables=data.VarArray;
+-for i=1:size(variables,2),
+-	fieldname=deblank(variables(i).Str);
+-	fieldvalue=double(squeeze(variables(i).Data));
+-	S.(fieldname)=fieldvalue;
+-end
+-
+-%All the variables are in AttArray field
+-variables=data.AttArray;
+-for i=1:size(variables,2),
+-	fieldname=deblank(variables(i).Str);
+-	fieldvalue=double(variables(i).Val);
+-	S.(fieldname)=fieldvalue;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/issmdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/issmdoc.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/issmdoc.m	(revision 12996)
+@@ -1,15 +0,0 @@
+-%Quick documentation for ISSM
+-
+-%First get ISSM tier: 
+-ISSM_DIR=issmdir;
+-
+-disp(sprintf('\n%s','  A comprehensive documentation is available on http://issm.jpl.nasa.gov'));
+-disp(sprintf('\n%s','  Example: how to create a square ice shelf'));
+-disp(sprintf('%s','	   go to ',ISSM_DIR,'/examples/SquareIceshelf'));
+-disp(sprintf('%s','	   md=model;                                %creates a new empty model structure'));
+-disp(sprintf('%s','	   md=triangle(md,''DomainOutline.exp'',50000);   %creates a mesh of the domain outline with a resolution of 50000m'));
+-disp(sprintf('%s','	   md=setmask(md,''all'','''');               %defines the glacier system as an ice shelf (no island)'));
+-disp(sprintf('%s','	   md=parameterize(md,''Square.par'');        %fills all the other fields of the model'));
+-disp(sprintf('%s','	   md=setflowequation(md,''macayeal'',''all''); %defines all elements as MacAyeal''s'));
+-disp(sprintf('%s','	   md=solve(md,DiagnosticSolutionEnum);   %generate the velocity field'));
+-disp(sprintf('%s','	   plotmodel(md,''data'',md.results.DiagnosticSolution.Vel);    %displays the velocity (type plotdoc for plotmodel help)'));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/structtoobj.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/structtoobj.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/structtoobj.m	(revision 12996)
+@@ -1,16 +0,0 @@
+-function obj=structtoobj(obj,S),
+-%Convert struct to object
+-
+-	%Get object and structure fields
+-	structfields=fields(S);
+-	objprops    =properties(class(obj));
+-
+-	%recover object properties
+-	for i=1:length(structfields),
+-		fieldname =structfields{i};
+-		if ismember(fieldname,objprops),
+-			fieldvalue=getfield(S,fieldname);
+-			obj=setfield(obj,fieldname,fieldvalue);
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/netcdf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/netcdf.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Miscellaneous/netcdf.m	(revision 12996)
+@@ -1,136 +0,0 @@
+-function S = netcdf(File,varargin)
+-% Function to read NetCDF files
+-%   S = netcdf(File)
+-% Input Arguments
+-%   File = NetCDF file to read
+-% Optional Input Arguments:
+-%   'Var',Var - Read data for VarArray(Var), default [1:length(S.VarArray)]
+-%   'Rec',Rec - Read data for Record(Rec), default [1:S.NumRecs]
+-% Output Arguments:
+-%   S    = Structure of NetCDF data organised as per NetCDF definition
+-% Notes:
+-%   Only version 1, classic 32bit, NetCDF files are supported. By default
+-% data are extracted into the S.VarArray().Data field for all variables.
+-% To read the header only call S = netcdf(File,'Var',[]);
+-%
+-% SEE ALSO
+-% ---------------------------------------------------------------------------
+-S = [];
+-
+-try
+-   if exist(File,'file') fp = fopen(File,'r','b');
+-   else fp = []; error('File not found'); end
+-   if fp == -1   error('Unable to open file'); end
+-
+-% Read header
+-   Magic = fread(fp,4,'uint8=>char');
+-   if strcmp(Magic(1:3),'CDF') error('Not a NetCDF file'); end
+-   if uint8(Magic(4))~=1       error('Version not supported'); end
+-   S.NumRecs  = fread(fp,1,'uint32=>uint32');
+-   S.DimArray = DimArray(fp);
+-   S.AttArray = AttArray(fp);
+-   S.VarArray = VarArray(fp);
+-
+-% Setup indexing to arrays and records
+-   Var = ones(1,length(S.VarArray));
+-   Rec = ones(1,S.NumRecs);
+-   for i = 1:2:length(varargin)
+-      if     strcmp(upper(varargin{i}),'VAR') Var=Var*0; Var(varargin{i+1})=1;
+-      elseif strcmp(upper(varargin{i}),'REC') Rec=Rec*0; Rec(varargin{i+1})=1;
+-      else error('Optional input argument not recognised'); end
+-   end
+-   if sum(Var)==0 fclose(fp); return; end
+-
+-% Read non-record variables
+-   Dim = double(cat(2,S.DimArray.Dim));
+-   ID  = double(cat(2,S.VarArray.Type));
+-
+-   for i = 1:length(S.VarArray)
+-      D = Dim(S.VarArray(i).DimID+1); N = prod(D); RecID{i}=find(D==0);
+-      if isempty(RecID{i})
+-         if length(D)==0 D = [1,1]; N = 1; elseif length(D)==1 D=[D,1]; end
+-         if Var(i)
+-            S.VarArray(i).Data = ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D);
+-            fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8');
+-         else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
+-      else S.VarArray(i).Data = []; end
+-   end
+-
+-% Read record variables
+-   for k = 1:S.NumRecs
+-      for i = 1:length(S.VarArray)
+-         if ~isempty(RecID{i})
+-            D = Dim(S.VarArray(i).DimID+1); D(RecID{i}) = 1; N = prod(D);
+-            if length(D)==1 D=[D,1]; end
+-            if Var(i) & Rec(k)
+-               S.VarArray(i).Data = cat(RecID{i},S.VarArray(i).Data,...
+-                  ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D));
+-               if N > 1 fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8'); end
+-            else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
+-         end
+-      end
+-   end
+-
+-   fclose(fp);
+-catch
+-   Err = lasterror; fprintf('%s\n',Err.message);
+-   if ~isempty(fp) && fp ~= -1 fclose(fp); end
+-end
+-
+-% ---------------------------------------------------------------------------------------
+-% Utility functions
+-
+-function S = Size(ID)
+-% Size of NetCDF data type, ID, in bytes
+-   S = subsref([1,1,2,4,4,8],struct('type','()','subs',{{ID}}));
+-
+-function T = Type(ID)
+-% Matlab string for CDF data type, ID
+-   T = subsref({'int8','char','int16','int32','single','double'},...
+-               struct('type','{}','subs',{{ID}}));
+-
+-function N = Pad(Num,ID)
+-% Number of elements to read after padding to 4 bytes for type ID
+-   N = (double(Num) + mod(4-double(Num)*Size(ID),4)/Size(ID)).*(Num~=0);
+-
+-function S = String(fp)
+-% Read a CDF string; Size,[String,[Padding]]
+-   S = fread(fp,Pad(fread(fp,1,'uint32=>uint32'),1),'uint8=>char').';
+-
+-function A = ReOrder(A,S)
+-% Rearrange CDF array A to size S with matlab ordering
+-   A = permute(reshape(A,fliplr(S)),fliplr(1:length(S)));
+-
+-function S = DimArray(fp)
+-% Read DimArray into structure
+-   if fread(fp,1,'uint32=>uint32') == 10 % NC_DIMENSION
+-      for i = 1:fread(fp,1,'uint32=>uint32')
+-         S(i).Str = String(fp);
+-         S(i).Dim = fread(fp,1,'uint32=>uint32');
+-      end
+-   else fread(fp,1,'uint32=>uint32'); S = []; end
+-
+-function S = AttArray(fp)
+-% Read AttArray into structure
+-   if fread(fp,1,'uint32=>uint32') == 12 % NC_ATTRIBUTE
+-      for i = 1:fread(fp,1,'uint32=>uint32')
+-         S(i).Str = String(fp);
+-         ID       = fread(fp,1,'uint32=>uint32');
+-         Num      = fread(fp,1,'uint32=>uint32');
+-         S(i).Val = fread(fp,Pad(Num,ID),[Type(ID),'=>',Type(ID)]).';
+-      end
+-   else fread(fp,1,'uint32=>uint32'); S = []; end
+-
+-function S = VarArray(fp)
+-% Read VarArray into structure
+-   if fread(fp,1,'uint32=>uint32') == 11 % NC_VARIABLE
+-      for i = 1:fread(fp,1,'uint32=>uint32')
+-         S(i).Str      = String(fp);
+-         Num           = double(fread(fp,1,'uint32=>uint32'));
+-         S(i).DimID    = double(fread(fp,Num,'uint32=>uint32'));
+-         S(i).AttArray = AttArray(fp);
+-         S(i).Type     = fread(fp,1,'uint32=>uint32');
+-         S(i).VSize    = fread(fp,1,'uint32=>uint32');
+-         S(i).Begin    = fread(fp,1,'uint32=>uint32'); % Classic 32 bit format only
+-      end
+-   else fread(fp,1,'uint32=>uint32'); S = []; end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/paterson.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/paterson.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/paterson.py	(revision 12996)
+@@ -1,50 +0,0 @@
+-from numpy import *
+-
+-def paterson(temperature):
+-
+-    # Local Variables: pos11, pos5, pos10, temperature, pos, T, pos8, pos9, pos6, pos7, pos4, rigidity, pos2, pos3, pos1
+-    # Function calls: length, zeros, argwhere, paterson, error
+-    #PATERSON - figure out the rigidity of ice for a given temperature
+-    #
+-    #   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
+-    #   temperature is in Kelvin degrees
+-    #
+-    #   Usage:
+-    #      rigidity=paterson(temperature)
+-    
+-	pos=argwhere(temperature<0.)
+-	if len(pos):
+-		print 'input temperature should be in Kelvin (positive)'
+-		return []
+-    
+-	T = temperature-273.15
+-	#The routine below is equivalent to:
+-	# n=3; T=temperature-273;
+-	# %From paterson,
+-	# Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
+-	# A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
+-	# 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
+-	# %Convert into rigidity B
+-	# B=A.^(-1/n)*10^3; %s^(1/3)Pa
+-	# %Now, do a cubic fit between Temp and B: 
+-	# fittedmodel=fit(Temp,B,'cubicspline');
+-	# rigidity=fittedmodel(temperature);
+-
+-	rigidity=zeros(len(T))
+-	pos1=argwhere(T<=-45);           rigidity[pos1]=10**8*(-0.000292866376675*(T[pos1]+50)**3+ 0.011672640664130*(T[pos1]+50)**2  -0.325004442485481*(T[pos1]+50)+  6.524779401948101)
+-	pos2=argwhere(logical_and(-45<=T,T<-40));   rigidity[pos2]=10**8*(-0.000292866376675*(T[pos2]+45)**3+ 0.007279645014004*(T[pos2]+45)**2  -0.230243014094813*(T[pos2]+45)+  5.154964909039554)
+-	pos3=argwhere(logical_and(-40<=T,T<-35));   rigidity[pos3]=10**8*(0.000072737147457*(T[pos3]+40)**3+  0.002886649363879*(T[pos3]+40)**2  -0.179411542205399*(T[pos3]+40)+  4.149132666831214)
+-	pos4=argwhere(logical_and(-35<=T,T<-30));   rigidity[pos4]=10**8*(-0.000086144770023*(T[pos4]+35)**3+ 0.003977706575736*(T[pos4]+35)**2  -0.145089762507325*(T[pos4]+35)+  3.333333333333331)
+-	pos5=argwhere(logical_and(-30<=T,T<-25));   rigidity[pos5]=10**8*(-0.000043984685769*(T[pos5]+30)**3+ 0.002685535025386*(T[pos5]+30)**2  -0.111773554501713*(T[pos5]+30)+  2.696559088937191)
+-	pos6=argwhere(logical_and(-25<=T,T<-20));   rigidity[pos6]=10**8*(-0.000029799523463*(T[pos6]+25)**3+ 0.002025764738854*(T[pos6]+25)**2  -0.088217055680511*(T[pos6]+25)+  2.199331606342181)
+-	pos7=argwhere(logical_and(-20<=T,T<-15));   rigidity[pos7]=10**8*(0.000136920904777*(T[pos7]+20)**3+  0.001578771886910*(T[pos7]+20)**2  -0.070194372551690*(T[pos7]+20)+  1.805165505978111)
+-	pos8=argwhere(logical_and(-15<=T,T<-10));   rigidity[pos8]=10**8*(-0.000899763781026*(T[pos8]+15)**3+ 0.003632585458564*(T[pos8]+15)**2  -0.044137585824322*(T[pos8]+15)+  1.510778053489523)
+-	pos9=argwhere(logical_and(-10<=T,T<-5));    rigidity[pos9]=10**8*(0.001676964325070*(T[pos9]+10)**3-  0.009863871256831*(T[pos9]+10)**2  -0.075294014815659*(T[pos9]+10)+  1.268434288203714)
+-	pos10=argwhere(logical_and(-5<=T,T<-2));    rigidity[pos10]=10**8*(-0.003748937622487*(T[pos10]+5)**3+0.015290593619213*(T[pos10]+5)**2  -0.048160403003748*(T[pos10]+5)+  0.854987973338348)
+-	pos11=argwhere(-2<=T);           rigidity[pos11]=10**8*(-0.003748937622488*(T[pos11]+2)**3-0.018449844983174*(T[pos11]+2)**2  -0.057638157095631*(T[pos11]+2)+  0.746900791092860)
+-
+-	#Now make sure that rigidity is positive
+-	pos=argwhere(rigidity<0);        rigidity[pos]=1**6 
+-
+-	return rigidity
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/paterson.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/paterson.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/paterson.m	(revision 12996)
+@@ -1,42 +0,0 @@
+-function rigidity=paterson(temperature)
+-%PATERSON - figure out the rigidity of ice for a given temperature
+-%
+-%   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
+-%   temperature is in Kelvin degrees
+-%
+-%   Usage:
+-%      rigidity=paterson(temperature)
+-
+-if(temperature<0)
+-	error('input temperature should be in Kelvin (positive)');
+-end
+-T=temperature-273.15;
+-
+-%The routine below is equivalent to:
+-
+-% n=3; T=temperature-273;
+-% %From paterson,
+-% Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
+-% A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
+-% 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
+-% %Convert into rigidity B
+-% B=A.^(-1/n)*10^3; %s^(1/3)Pa
+-% %Now, do a cubic fit between Temp and B: 
+-% fittedmodel=fit(Temp,B,'cubicspline');
+-% rigidity=fittedmodel(temperature);
+-
+-rigidity=zeros(length(T),1);
+-pos1=find(T<=-45);           rigidity(pos1)=10^8*(-0.000292866376675*(T(pos1)+50).^3+ 0.011672640664130*(T(pos1)+50).^2  -0.325004442485481*(T(pos1)+50)+  6.524779401948101);
+-pos2=find(-45<=T & T<-40);   rigidity(pos2)=10^8*(-0.000292866376675*(T(pos2)+45).^3+ 0.007279645014004*(T(pos2)+45).^2  -0.230243014094813*(T(pos2)+45)+  5.154964909039554);
+-pos3=find(-40<=T & T<-35);   rigidity(pos3)=10^8*(0.000072737147457*(T(pos3)+40).^3+  0.002886649363879*(T(pos3)+40).^2  -0.179411542205399*(T(pos3)+40)+  4.149132666831214);
+-pos4=find(-35<=T & T<-30);   rigidity(pos4)=10^8*(-0.000086144770023*(T(pos4)+35).^3+ 0.003977706575736*(T(pos4)+35).^2  -0.145089762507325*(T(pos4)+35)+  3.333333333333331);
+-pos5=find(-30<=T & T<-25);   rigidity(pos5)=10^8*(-0.000043984685769*(T(pos5)+30).^3+ 0.002685535025386*(T(pos5)+30).^2  -0.111773554501713*(T(pos5)+30)+  2.696559088937191);
+-pos6=find(-25<=T & T<-20);   rigidity(pos6)=10^8*(-0.000029799523463*(T(pos6)+25).^3+ 0.002025764738854*(T(pos6)+25).^2  -0.088217055680511*(T(pos6)+25)+  2.199331606342181);
+-pos7=find(-20<=T & T<-15);   rigidity(pos7)=10^8*(0.000136920904777*(T(pos7)+20).^3+  0.001578771886910*(T(pos7)+20).^2  -0.070194372551690*(T(pos7)+20)+  1.805165505978111);
+-pos8=find(-15<=T & T<-10);   rigidity(pos8)=10^8*(-0.000899763781026*(T(pos8)+15).^3+ 0.003632585458564*(T(pos8)+15).^2  -0.044137585824322*(T(pos8)+15)+  1.510778053489523);
+-pos9=find(-10<=T & T<-5);    rigidity(pos9)=10^8*(0.001676964325070*(T(pos9)+10).^3-  0.009863871256831*(T(pos9)+10).^2  -0.075294014815659*(T(pos9)+10)+  1.268434288203714);
+-pos10=find(-5<=T & T<-2);    rigidity(pos10)=10^8*(-0.003748937622487*(T(pos10)+5).^3+0.015290593619213*(T(pos10)+5).^2  -0.048160403003748*(T(pos10)+5)+  0.854987973338348);
+-pos11=find(-2<=T);           rigidity(pos11)=10^8*(-0.003748937622488*(T(pos11)+2).^3-0.018449844983174*(T(pos11)+2).^2  -0.057638157095631*(T(pos11)+2)+  0.746900791092860);
+-
+-%Now make sure that rigidity is positive
+-pos=find(rigidity<0);        rigidity(pos)=10^6;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/carter.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/carter.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/carter.m	(revision 12996)
+@@ -1,28 +0,0 @@
+-function attenuation=carter(temperature)
+-%CARTER - attenuation as a function of temperature
+-%
+-%   TWO WAY - Attenuation (in dB/m) as a function of temperature (K)
+-%   From Carter at al. 2007 (Radar-based subglacial lake classification in Antarctica)
+-%   Figure 4
+-%
+-%   Usage:
+-%      attenuation=carter(temperature)
+-
+-if(temperature<0)
+-	error('input temperature should be in Kelvin (positive)');
+-end
+-T=temperature-273.15;
+-
+-Temp=[-50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0]';
+-A=[0.0015 0.002 0.003 0.0042 0.0055 0.0083 0.012 0.0175 0.026 0.038 0.055]';
+-
+-%Now, do a cubic fit between Temp and B: 
+-[cfun,gof,output]=fit(Temp,A,'cubicspline');
+-%breaks=cfun.p.breaks;
+-%coeff=cfun.p.coefs;
+-
+-%Calculate attenuation
+-attenuation=cfun(T);
+-
+-%Make it a 2 way attenuation
+-attenuation=2*attenuation;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/lithostaticpressure.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/lithostaticpressure.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Meca/lithostaticpressure.m	(revision 12996)
+@@ -1,7 +0,0 @@
+-function pressure=lithostaticpressure(rho_ice,g,s,z);
+-%LITHOSTATICPRESSURE - compute the lithostatic pressure
+-%
+-%   Usage:
+-%      pressure=lithostacticpressure(rho_ice,g,surface,z)
+-
+-pressure=rho_ice*g*(s-z);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/varmap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/varmap.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/varmap.m	(revision 12996)
+@@ -1,55 +0,0 @@
+-function output = varmap(x,y,data,varargin);
+-%VARMAP - use gslib for Kriging
+-%
+-%   Usage:
+-%      output = varmap(x,y,data,varargin)
+-
+-options=pairoptions(varargin{:});
+-
+-nxlag = getfieldvalue(options,'nxlag', 20);
+-nylag = getfieldvalue(options,'nylag', 20);
+-dxlag = getfieldvalue(options,'dxlag', 1000);
+-dylag = getfieldvalue(options,'dylag', 1000);
+-
+-%Write data file
+-fid=fopen('cluster.dat','w');
+-fprintf(fid,'%s\n','Data file');
+-fprintf(fid,'%i\n',3);
+-fprintf(fid,'%s\n','Xlocation');
+-fprintf(fid,'%s\n','Ylocation');
+-fprintf(fid,'%s\n','Data');
+-fprintf(fid,'%g %g %g\n',[x y data]');
+-fclose(fid);
+-
+-%Write parameter file
+-fid=fopen('varmap.par','w');
+-fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
+-fprintf(fid,'\t\t\t\t%s\n','*******************');
+-fprintf(fid,'\n');
+-fprintf(fid,'%s\n','START OF PARAMETERS:');
+-fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
+-fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
+-fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
+-fprintf(fid,'%-30s %s\n','0    '                      ,'\1=regular grid, 0=scattered values');
+-fprintf(fid,'%-30s %s\n','50 50 1'                    ,'\if =1: nx, ny, nz');
+-fprintf(fid,'%-30s %s\n','1.0 1.0 1.0'                ,'\       xsiz, ysiz, zsiz if igrid=1');
+-fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\if =0: columns for x, y and z coordinates');
+-fprintf(fid,'%-30s %s\n','varmap.out'                 ,'\file for variogram output');
+-fprintf(fid,'%-30s %s\n',num2str([nxlag nylag 0],'%i '),'\nxlag, nylag, nzlag');
+-fprintf(fid,'%-30s %s\n',num2str([dxlag dylag 1],'%g %g %i'),'\dxlag, dylag, dzlag');
+-fprintf(fid,'%-30s %s\n','5'                          ,'\minimum number of pairs');
+-fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
+-fprintf(fid,'%-30s %s\n','1'                          ,'\number of variograms');
+-fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail, head, variogram type');
+-fclose(fid);
+-
+-%Call varmap
+-system([issmdir() '/externalpackages/gslib/install/varmap varmap.par']);
+-delete('varmap.par');
+-
+-%Read output
+-fid=fopen('varmap.out','r');
+-A = textscan(fid,'%f %f %f %f %f %f','headerlines',8);
+-fclose(fid);
+-delete('varmap.out')
+-output = reshape(A{1},[2*nxlag+1 2*nylag+1]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/CreateDataBoundaries.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/CreateDataBoundaries.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/CreateDataBoundaries.m	(revision 12996)
+@@ -1,43 +0,0 @@
+-function	[Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
+-%CREATEDATABOUNDARIES - Create values on the edge of the matrix
+-%
+-%   This function create vectors with coordinates and values to constrain a matrix 
+-%   on its edge from a given matrix tiwh data everywhere.
+-%   x_m and y_m belongs to the matrix to be constrained
+-%   x_matrix, y_matrix belongs to the matrix to be constrained with
+-%   datamatrix is the matrix with values for the constraint
+-%
+-%   Usage:
+-%      [Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
+-% 
+-%   See also: TRACKSTOMATRIX, CREATEDATAMATRIX
+-
+-%Check the consistency of the data matrix
+-if(length(x_matrix)~=(size(datamatrix,2)+1) | length(y_matrix)~=(size(datamatrix,1)+1)),
+-	error('CreateDataBoundaries error message: size of matrix and vectors to constrained not consistent')
+-end
+-
+-nxglobal=length(x_m);
+-nyglobal=length(y_m);
+-
+-%Create the edgevalues and coordinates
+-xedge1=x_m(1)*ones(nyglobal,1);
+-xedge2=x_m(2:end-1);
+-xedge3=x_m(end)*ones(nyglobal,1);
+-xedge4=x_m(2:end-1);
+-xedge5=x_m(2)*ones(nyglobal-2,1);
+-xedge6=x_m(3:end-2);
+-xedge7=x_m(end-1)*ones(nyglobal-2,1);
+-xedge8=x_m(3:end-2);
+-yedge1=y_m;
+-yedge2=y_m(1)*ones(nxglobal-2,1);
+-yedge3=y_m;
+-yedge4=y_m(end)*ones(nxglobal-2,1);
+-yedge5=y_m(2:end-1);
+-yedge6=y_m(2)*ones(nxglobal-4,1);
+-yedge7=y_m(2:end-1);
+-yedge8=y_m(end-1)*ones(nxglobal-4,1);
+-
+-Xedge=[xedge1;xedge2;xedge3;xedge4;xedge5;xedge6;xedge7;xedge8];
+-Yedge=[yedge1;yedge2;yedge3;yedge4;yedge5;yedge6;yedge7;yedge8];
+-EdgeValues=DataInterp(x_matrix,y_matrix,datamatrix,Xedge,Yedge);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/gamv.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/gamv.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/gamv.m	(revision 12996)
+@@ -1,70 +0,0 @@
+-function output = gamv(x,y,data,varargin);
+-%GAMV - use gslib for Kriging
+-%
+-%   Usage:
+-%      output = gamv(x,y,data,varargin)
+-
+-options=pairoptions(varargin{:});
+-
+-nlag = getfieldvalue(options,'nlag', 20);
+-dlag = getfieldvalue(options,'dlag', 1000);
+-
+-%Write data file
+-fid=fopen('cluster.dat','w');
+-fprintf(fid,'%s\n','Data file');
+-fprintf(fid,'%i\n',3);
+-fprintf(fid,'%s\n','Xlocation');
+-fprintf(fid,'%s\n','Ylocation');
+-fprintf(fid,'%s\n','Data');
+-fprintf(fid,'%g %g %g\n',[x y data]');
+-fclose(fid);
+-
+-%Write parameter file
+-fid=fopen('gamv.par','w');
+-fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
+-fprintf(fid,'\t\t\t\t%s\n','*******************');
+-fprintf(fid,'\n');
+-fprintf(fid,'%s\n','START OF PARAMETERS:');
+-fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
+-fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
+-fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
+-fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
+-fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
+-fprintf(fid,'%-30s %s\n',num2str(nlag,'%i')           ,'\number of lags');
+-fprintf(fid,'%-30s %s\n',num2str(dlag,'%g')           ,'\lag separation distance');
+-fprintf(fid,'%-30s %s\n',num2str(dlag/2,'%g')         ,'\lag tolerance');
+-fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
+-fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
+-fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
+-fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
+-fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
+-fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
+-fclose(fid);
+-
+-%Call gamv
+-system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
+-delete('gamv.par');
+-
+-%Read output
+-output   = struct('Semivariogram',[],'Covariance',[]);
+-counter1 = 1;
+-counter2 = 1;
+-fid=fopen('gamv.out','r');
+-while (~feof(fid)),
+-	A=fscanf(fid,'%s',1);
+-	if strcmp(A,'Covariance');
+-		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
+-		output(counter1).Covariance=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
+-		counter1=counter1+1;
+-	elseif strcmp(A,'Semivariogram'),
+-		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
+-		output(counter2).Semivariogram=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
+-		counter2=counter2+1;
+-	else
+-		%do nothing
+-	end
+-end
+-fclose(fid);
+-delete('gamv.out')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/pkriging.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/pkriging.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/pkriging.m	(revision 12996)
+@@ -1,55 +0,0 @@
+-function [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
+-%PKRIGING - parallel Kriging
+-%
+-%   Usage:
+-%      [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
+-
+-options=pairoptions(varargin{:});
+-cluster=getfieldvalue(options,'cluster',generic('np',10));
+-options=removefield(options,'cluster',0);
+-name   = ['krig' num2str(feature('GetPid'))];
+-
+-% =========================================   MARSHALL.m =================================================
+-disp(['marshalling file ' name '.bin']);
+-fid=fopen([name '.bin'],'wb');
+-if fid==-1,
+-	error(['marshall error message: could not open ' name '.bin file for binary writing']);
+-end
+-
+-%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
+-WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
+-
+-%Write all data
+-WriteData(fid,'enum',0,'data',x,'format','DoubleMat');
+-WriteData(fid,'enum',1,'data',y,'format','DoubleMat');
+-WriteData(fid,'enum',2,'data',observations,'format','DoubleMat');
+-WriteData(fid,'enum',3,'data',x_interp,'format','DoubleMat');
+-WriteData(fid,'enum',4,'data',y_interp,'format','DoubleMat');
+-options.marshall(fid,5);
+-st=fclose(fid);
+-if st==-1,
+-	error(['marshall error message: could not close file ' name '.bin']);
+-end
+-% =========================================   MARSHALL.m =================================================
+-
+-%Launch job on remote cluster
+-BuildKrigingQueueScript(cluster,name,'',1,0,0); %gather, valgrind, gprof
+-tic
+-LaunchQueueJob(cluster,name,name,{[name '.bin'] [name '.queue']});
+-toc
+-choice=input('Is the job successfully completed? (y/n)','s');
+-Download(cluster,name,{[name '.outbin']});
+-structure=parseresultsfromdisk([name '.outbin'],0);
+-delete([name '.outlog']);
+-delete([name '.errlog']);
+-delete([name '.outbin']);
+-delete([name '.bin']);
+-if ~ispc,
+-	delete([name '.tar.gz']);
+-end
+-
+-%Process results
+-B=structure.AutodiffForward;
+-B=reshape(B,size(x_interp,2),size(x_interp,1))';
+-E=structure.AutodiffIsautodiff;
+-E=reshape(E,size(x_interp,2),size(x_interp,1))';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/MisfitDeinterlace.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/MisfitDeinterlace.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/MisfitDeinterlace.m	(revision 12996)
+@@ -1,21 +0,0 @@
+-function Jstruct=MisfitDeinterlace(misfit,type)
+-%MISFITDEINTERLACE - deinterlace misfits that are mixed together, using type.
+-%
+-%   Usage:
+-%      Jstruct=MisfitDeinterlace(misfit,type)
+-%
+-%   Example:
+-%      Jstruct=MisfitDeinterlace(md.results.diagnostic.J,md.fit)
+-%
+-%
+-Jstruct=struct();
+-
+-count=1;
+-for i=0:max(type),
+-	pos=find(type==i);
+-	if length(pos),
+-		Jstruct(count).type=i;
+-		Jstruct(count).J=misfit(pos);
+-		count=count+1;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/data_processing_tool.fig
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/addtrack.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/addtrack.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/addtrack.m	(revision 12996)
+@@ -1,156 +0,0 @@
+-function [x_m2 y_m2 values2]=addtrack(x_m1,y_m1,values1,track_coord,track_values,distance,exponent,varargin),
+-%ADDTRACK - modify a map to take values of a track
+-%
+-%   This routine modifies a map to improve it with values of tracks.
+-%   This output map has more values than the input one so that the values
+-%   of the tracks are relevant.
+-%   x_m1 and y_m1 are two vectors containing the coordinates of the matrix
+-%   the distance between two points must be the same everywhere
+-%   values1 is a matrix of size (y_m1-1)*(x_m1-1)
+-%   trac_coord is an exp file containing the coordinates of the tracks (x and y)
+-%   trav_values is a vector with the values along the track coordinates
+-%   distance indicates the distance from the tracks where points have to be modified
+-%   exposant allows to chance the influence of the track and the map
+-%   it must be positive and usually is superior to 1.
+-%
+-%   Usage:
+-%      [x_m2 y_m2 values1 values2]=addtrack(x_m1,y_m1,values1,track_coord,track_values,distance,exposant[,subdivision])
+-%
+-%   Example:
+-%      [xnew ynew valuesnew]=addtrack(x_m,y_m,thickness,'trackcoord.exp',thickness_track,1000,2)
+-%      [xnew ynew valuesnew]=addtrack(x_m,y_m,thickness,'trackcoord.exp',thickness_track,1000,2,3)
+-
+-%Create a new picture precise enough to be modified by the tracks
+-%Read the points of the tracks
+-stru=expread(track_coord,1);
+-nods=stru.nods;
+-xtracks=stru.x';
+-ytracks=stru.y';
+-
+-%First check that the parameters are ok:
+-if (size(track_values,1)~=nods)  || (size(xtracks,2)~=nods) || (size(ytracks,2)~=nods),
+-	error('addtrack error message : track coordinates and track values must have the same size');
+-elseif distance<0,
+-	error('addtrack error message : the distance must be a positive value');
+-elseif exponent<0,
+-	error('addtrack error message : the exponent must be a positive value');
+-elseif (size(x_m1,1)~=(size(values1,2)+1)) || (size(y_m1,1)~=(size(values1,1)+1)),
+-	error('addtrack error message : problem in the map, check the size of x_m1, y_m1 and values1');
+-end
+-
+-%stru.nods=4;
+-%xtracks=[50 50 55 62]; % 2 3 4 5 6 7 8 9 1 ]';
+-%ytracks=[40 40.5 41 41]; % 5 5 5 5 5 5 5 5 8 ]';
+-%x_m1=[1:10:101]';
+-%y_m1=[1:10:101]';
+-%track_values=2*ones(4,1);
+-%values1=ones(10,10);
+-
+-%Find the average distance between two points of the tracks
+-av_x=sum(abs(diff(xtracks)))/(stru.nods-1);
+-av_y=sum(abs(diff(ytracks)))/(stru.nods-1);
+-dist_av=sqrt(av_x^2+av_y^2);
+-
+-%Calculate the multiplicate factor for the new values:
+-if nargin==7,
+-	mult=round((x_m1(2)-x_m1(1))/(1*dist_av));
+-else
+-	mult=varargin{1};
+-end
+-
+-%Plug the values in the new multiplied matrix
+-values=zeros(mult*size(values1,1),mult*size(values1,2));
+-
+-for i=1:mult,
+-	for j=1:mult,
+-		values(i:mult:end,j:mult:end)=values1;
+-	end
+-end
+-
+-%Create the new x and y addapted to the matrix
+-x_m2=linspace(x_m1(1),x_m1(end),mult*(size(x_m1,1)-1)+1)';
+-y_m2=linspace(y_m1(1),y_m1(end),mult*(size(y_m1,1)-1)+1)';
+-
+-%Create a new set of x and y correponding to the medium value on the matrix
+-x_med=(x_m2(1:end-1)+x_m2(2:end))/2;
+-y_med=(y_m2(1:end-1)+y_m2(2:end))/2;
+-
+-numrow=size(y_med,1);
+-numcol=size(x_med,1);
+-
+-%Create new x and y to have the hole matrix
+-x_mat=repmat(x_med',numrow,1);
+-y_mat=repmat(y_med,1,numcol);
+-
+-%Remove useless points of the track
+-points=find(track_values==0);
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-points=find(isnan(track_values));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-%Remove points outside of the map
+-points=find(xtracks<x_med(1) | xtracks>x_med(end) | ytracks<y_med(1) | ytracks>y_med(end));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-%initialize some matrices
+-numoverlap=zeros(numrow,numcol);
+-weights=zeros(numrow,numcol);
+-weightsvalues=zeros(numrow,numcol);
+-
+-%Loop over the points of the track
+-nel=size(track_values,1);
+-fprintf('%s','      track processing progress:   0.00 %');
+-for i=1:nel;
+-	if mod(i,1000)==0,
+-		fprintf('\b\b\b\b\b\b\b')
+-		fprintf('%5.2f%s',i/nel*100,' %');
+-	end
+-
+-	x=xtracks(i);
+-	y=ytracks(i);
+-
+-	%get indices that are modified
+-	indexx1=max(find(x_med<x-distance));
+-	if isempty( indexx1), indexx1=1; end
+-	indexx2=min(find(x_med>x+distance));
+-	if isempty( indexx2), indexx2=numrow; end
+-	indexy1=max(find(y_med<y-distance));
+-	if isempty( indexy1), indexy1=1; end
+-	indexy2=min(find(y_med>y+distance));
+-	if isempty( indexy2), indexy2=numcol; end
+-
+-
+-	%get weighing coefficient
+-	val=track_values(i);
+-	distances=sqrt((x-x_mat(indexy1:indexy2,indexx1:indexx2)).^2+(y-y_mat(indexy1:indexy2,indexx1:indexx2)).^2);
+-	coeff=min(1,(distances/distance)).^(1/exponent);
+-
+-	%update numoverlap and weights
+-	numoverlap(indexy1:indexy2,indexx1:indexx2)=numoverlap(indexy1:indexy2,indexx1:indexx2)+1;
+-	weights(indexy1:indexy2,indexx1:indexx2)=weights(indexy1:indexy2,indexx1:indexx2)+coeff;
+-	weightsvalues(indexy1:indexy2,indexx1:indexx2)=weightsvalues(indexy1:indexy2,indexx1:indexx2)+(1-coeff)*val;
+-
+-end
+-if nel>1000,
+-	fprintf('\b\b\b\b\b\b\b\b')
+-	fprintf('%4.2f%s\n',100,' %');
+-end
+-
+-
+-%Change the values of numoverlap to 1 if 0 since we are going to devide by this matrix
+-numoverlap(find(~numoverlap))=1;
+-
+-%Same thing for weights since values far from the tracks don't change
+-weights(find(~weights))=1;
+-
+-%Create the final matrix depending on the previous matrix
+-values=(values.*weights+weightsvalues)./numoverlap;
+-
+-%Plug the values of the track in the new matrix
+-values2=values;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/TracksToMatrix.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/TracksToMatrix.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/TracksToMatrix.m	(revision 12996)
+@@ -1,84 +0,0 @@
+-function [x_f y_f MatData]=TracksToMatrix(xmin,ymin,nx,ny,posting,track_coord,track_values,theta,varargin),
+-%TRACKSTOMATRIX - Create a map from tracks
+-%
+-%   This routine creates a map from tracks using a Kriging algorithm given by the package DACE.
+-%   - xmin and ymin are two scalars that are the extreme values of the data matrix one wants to create
+-%   - posting is a scalar giving the posting of the matrix to be created in meters
+-%   - trac_coord is an Argus file containing the coordinates of the tracks (x and y)
+-%   - trav_values is a vector with the values along the track coordinates
+-%   - theta is a parameter of the correlation function stricly positive
+-%   varagin can contain a matrix of data to constrain the matrix to be created
+-%   it shoud contain indices x and y and the matrix
+-%
+-%   Usage:
+-%      [x_ y_f MatData]=TracksToMatrix(xmin,ymin,nx,ny,posting,track_coord,track_values,theta),
+-%
+-%   Example:
+-%      [x_f y_f Thickness]=TracksToMatrix(-10^6,10^6,200,180,1000,'trackcoord.exp',thickness_values,theta),
+-%      [x_f y_f Thickness]=TracksToMatrix(-10^6,10^6,200,180,1000,'trackcoord.exp',thickness_values,theta,x_m,y_m,globalthickness),
+-%
+-%   See also: CREATEDATABOUNDARIES, CREATEDATAMATRIX
+-
+-%some checks
+-if nargin~=8 & nargin~=11,
+-	error(' TracksToMatrix error message: wrong number of arguments')
+-end
+-
+-%Add path to dace
+-addpath([issmdir() '/externalpackages/dace/install'])
+-
+-%First create the x_m and y_m fot the matrix
+-x_f=[xmin:posting:xmin+posting*nx]';
+-y_f=[ymin:posting:ymin+posting*ny]';
+-
+-%Now create a bigger map we will then truncate
+-x_m=[xmin-posting*nx/2:posting:xmin+posting*nx*3/2]';
+-y_m=[ymin-posting*ny/2:posting:ymin+posting*ny*3/2]';
+-
+-%Create DataMatrix with local averaging of tracks
+-[Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values);
+-
+-%Create vector for these coordinates and values
+-Svalue=sparse(Mvalue);
+-Sx=sparse(Mx);
+-Sy=sparse(My);
+-[i,j,Values]=find(Svalue);
+-[i,j,X]=find(Sx);
+-[i,j,Y]=find(Sy);
+-Coord=[X,Y];
+-
+-%Create boundaries for the track if specified
+-if nargin==11,
+-	disp('      constain the border of matrix with global matrix');
+-	%Find out the elements to counstrain the border
+-	x_matrix=varargin{1};
+-	y_matrix=varargin{2};
+-	datamatrix=varargin{3};
+-
+-	%Create values on the border of the smaller map
+-	[Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
+-
+-	%Create values on the border of the larger map
+-	[Xedge2,Yedge2,EdgeValues2]=CreateDataBoundaries(x_f,y_f,x_matrix,y_matrix,datamatrix);
+-
+-	%Add these values to the track values
+-	Values=[Values;EdgeValues;EdgeValues2];
+-	Coord=[X,Y;Xedge,Yedge;Xedge2,Yedge2];
+-end
+-
+-%Create model for data
+-disp('      create the statiscal model of the data');
+-[dmodel,perf]=dacefit(Coord,Values,@regpoly1,@corrgauss,theta);
+-
+-%Create design site(points where we are looking for the data)
+-Points=nodesamp([x_f(1)+posting/2,y_f(1)+posting/2;x_f(end)-posting/2,y_f(end)-posting/2],[length(x_f)-1;length(y_f)-1]);
+-
+-%Compute data on these points
+-disp('      predict the values');
+-VecData=predictor(Points,dmodel);
+-
+-%Reshape to get a matrix
+-MatData=reshape(VecData,ny,nx);
+-
+-%remove DACE path
+-rmpath([issmdir() '/externalpackages/dace/install']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/gslib.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/gslib.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/gslib.m	(revision 12996)
+@@ -1,112 +0,0 @@
+-function output = gslib(x,y,data,varargin);
+-%GSLIB - use gslib for Kriging
+-%
+-%   Usage:
+-%      output = gslib(x,y,data,varargin)
+-
+-%Output Matrix
+-xmin   = xl(1);
+-ymin   = yl(1);
+-nx     = 101;
+-ny     = 101;
+-deltax = 5000;
+-deltay = 5000;
+-
+-%Variogram
+-nugget=10;
+-sill  =164;
+-range =25763;
+-
+-%Kriging options
+-mindata = 1;
+-maxdata = 50;
+-maxsearchradius = 50000;
+-
+-%Some intermediaries (Convert to gslib's parameters);
+-c = (sill-nugget);
+-a = sqrt(3)*range;
+-
+-%Write data file
+-fid=fopen('cluster.dat','w');
+-fprintf(fid,'%s\n','Data file');
+-fprintf(fid,'%i\n',3);
+-fprintf(fid,'%s\n','Xlocation');
+-fprintf(fid,'%s\n','Ylocation');
+-fprintf(fid,'%s\n','Data');
+-fprintf(fid,'%g %g %g\n',[x y data]');
+-fclose(fid);
+-
+-if 0, %GAMV
+-	%Write parameter file
+-	fid=fopen('gamv.par','w');
+-	fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
+-	fprintf(fid,'\t\t\t\t%s\n','*******************');
+-	fprintf(fid,'\n');
+-	fprintf(fid,'%s\n','START OF PARAMETERS:');
+-	fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
+-	fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
+-	fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
+-	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
+-	fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
+-	fprintf(fid,'%-30s %s\n','20'                         ,'\number of lags');
+-	fprintf(fid,'%-30s %s\n','5.0'                        ,'\lag separation distance');
+-	fprintf(fid,'%-30s %s\n','3.0'                        ,'\lag tolerance');
+-	fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
+-	fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
+-	fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-	fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-	fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
+-	fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
+-	fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
+-	fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
+-	fclose(fid);
+-
+-	%Call gamv
+-	system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
+-
+-else, %Kriging KB2D
+-	%Write parameter file
+-	fid=fopen('kb2d.par','w');
+-	fprintf(fid,'\t\t\t\t%s\n','Parameters for KB2D');
+-	fprintf(fid,'\t\t\t\t%s\n','*******************');
+-	fprintf(fid,'\n');
+-	fprintf(fid,'%s\n','START OF PARAMETERS:');
+-	fprintf(fid,'%-30s %s\n','./cluster.dat'                  ,'\file with data');
+-	fprintf(fid,'%-30s %s\n','1 2 3'                          ,'\columns for X, Y and variable');
+-	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'                 ,'\trimming limits');
+-	fprintf(fid,'%-30s %s\n','0'                              ,'\debugging level: 0,1,2,3');
+-	fprintf(fid,'%-30s %s\n','kb2d.dbg'                       ,'\file for debuggging output');
+-	fprintf(fid,'%-30s %s\n','kb2d.out'                       ,'\file for kriged output');
+-	fprintf(fid,'%-30s %s\n',num2str([nx xmin deltax],'%i %10g %6g')  ,'\nx, xmn, xsiz');
+-	fprintf(fid,'%-30s %s\n',num2str([ny ymin deltay],'%i %10g %6g')  ,'\nx, xmn, xsiz');
+-	fprintf(fid,'%-30s %s\n','1 1'                            ,'\x and y block discretization');
+-	fprintf(fid,'%-30s %s\n',num2str([mindata maxdata],'%6g') ,'\min and max data for kriging');
+-	fprintf(fid,'%-30s %s\n',num2str(maxsearchradius,'%6g')   ,'\max search radius');
+-	fprintf(fid,'%-30s %s\n','1 2.302'                        ,'\0=SK, 1=OK, (mean if SK)');
+-	fprintf(fid,'%-30s %s\n',['1 ' num2str(nugget)]           ,'\nst, nugget effect');
+-	fprintf(fid,'%-30s %s\n',['3 ' num2str([c 0.0 a a],'%10g')],'\it, c, azm, a_max, a_min');
+-	fclose(fid);
+-
+-	tic;system([issmdir() '/externalpackages/gslib/install/kb2d kb2d.par']);toc;
+-	delete('kb2d.par');
+-
+-	%Read output
+-	fid=fopen('kb2d.out','r');
+-	while (~feof(fid)),
+-		A=fscanf(fid,'%s',1);
+-		if strcmp(A,'KB2D');
+-			A=fscanf(fid,'%s',1); %Read output
+-			params=fscanf(fid,'%i %i %i %i %g %g %g %g %g %g %1',[11 1]);
+-		elseif strcmp(A,' Estimate'),
+-			continue;
+-		elseif strcmp(A,'Estimation'),
+-			A=fscanf(fid,'%s',1); %Read Variance
+-			A=fscanf(fid,'%g %g',[params(1) params(2)*params(3)]);
+-			B=A(1,:); B=reshape(B,[params(3),params(2)])';
+-			E=A(2,:); E=reshape(E,[params(3),params(2)])';
+-		else
+-			%do nothing
+-		end
+-	end
+-	fclose(fid);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/CreateDataMatrix.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/CreateDataMatrix.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/CreateDataMatrix.m	(revision 12996)
+@@ -1,94 +0,0 @@
+-function [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values),
+-%CREATEDATAMATRIX - Create a map with average values of map 
+-%
+-%   This routine creates a map with average values of tracks.
+-%   x_m1 and y_m1 are two vectors containing the coordinates of the matrix
+-%   trac_coord is an exp file containing the coordinates of the tracks (x and y)
+-%   trav_values is a vector with the values along the track coordinates
+-%
+-%   Usage:
+-%      [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values),
+-%
+-%   Example:
+-%      [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,'trackcoord.exp',thickness_track)
+-%
+-%   See also: CREATEDATABOUNDARIES, TRACKSTOMATRIX
+-
+-%Read the points of the tracks
+-stru=expread(track_coord,1);
+-nods=stru.nods;
+-xtracks=stru.x';
+-ytracks=stru.y';
+-
+-%First check that the parameters are ok:
+-if (size(track_values,1)~=nods)  || (size(xtracks,2)~=nods) || (size(ytracks,2)~=nods),
+-	error('CreateDataMatrix error message : track coordinates and track values must have the same size');
+-end
+-
+-%Compute number of rows and columns
+-numrow=size(y_m,1)-1;
+-numcol=size(x_m,1)-1;
+-
+-%Remove useless points of the track
+-points=find(track_values==0);
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-points=find(isnan(track_values));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-points=find(track_values<0);
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-points=find(xtracks<x_m(1) | xtracks>x_m(end) | ytracks<y_m(1) | ytracks>y_m(end));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-%initialize some matrices
+-numpoints=zeros(numrow,numcol);
+-value=zeros(numrow,numcol);
+-coordx=zeros(numrow,numcol);
+-coordy=zeros(numrow,numcol);
+-
+-%Loop over the points of the track
+-nel=size(track_values,1);
+-fprintf('%s','      track processing progress:   0.00 %');
+-for i=1:nel;
+-	if mod(i,1000)==0,
+-		fprintf('\b\b\b\b\b\b\b')
+-		fprintf('%5.2f%s',i/nel*100,' %');
+-	end
+-
+-	x=xtracks(i);
+-	y=ytracks(i);
+-
+-	%get indices for the matrix
+-	indexx=max(find(x_m<x));
+-	indexy=max(find(y_m<y));
+-
+-	%get weighing coefficient
+-	val=track_values(i);
+-
+-	%update numoverlap and weights
+-	numpoints(indexy,indexx)=numpoints(indexy,indexx)+1;
+-	value(indexy,indexx)=value(indexy,indexx)+val;
+-	coordx(indexy,indexx)=coordx(indexy,indexx)+x;
+-	coordy(indexy,indexx)=coordy(indexy,indexx)+y;
+-
+-end
+-if nel>1000,
+-	fprintf('\b\b\b\b\b\b\b\b')
+-	fprintf('%4.2f%s\n',100,' %');
+-end
+-
+-%Change the values of numoverlap to 1 if 0 since we are going to devide by this matrix
+-numpoints(find(~numpoints))=1;
+-
+-%Create the center of mass for coordiantes and values.
+-Mvalue=value./numpoints;
+-Mx=coordx./numpoints;
+-My=coordy./numpoints;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/data_processing_tool.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/data_processing_tool.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/DataProcessing/data_processing_tool.m	(revision 12996)
+@@ -1,467 +0,0 @@
+-function varargout = data_processing_tool(varargin)
+-%DATA_PROCESSING_TOOL - GUI to process binary data
+-%
+-%   this routine is a GUI that helps the user to open
+-%   a binary file (Little Endian, Big Endian, Float 32,
+-%   double,...) and save a Matlab file (.mat) with the
+-%   processed data and the coordinates
+-%
+-%   Usage:
+-%      data_processing_tool
+-
+-	gui_Singleton = 1;
+-	gui_State = struct('gui_Name',       mfilename, ...
+-		'gui_Singleton',  gui_Singleton, ...
+-		'gui_OpeningFcn', @data_processing_tool_OpeningFcn, ...
+-		'gui_OutputFcn',  @data_processing_tool_OutputFcn, ...
+-		'gui_LayoutFcn',  [] , ...
+-		'gui_Callback',   []);
+-	if nargin && ischar(varargin{1})
+-		gui_State.gui_Callback = str2func(varargin{1});
+-	end
+-
+-	if nargout
+-		[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
+-	else
+-		gui_mainfcn(gui_State, varargin{:});
+-	end
+-end
+-
+-function data_processing_tool_OpeningFcn(hObject, eventdata, handles, varargin)
+-	handles.output = hObject;
+-
+-	%enable toolbar (useful for caxis...)
+-	set(hObject,'toolbar','figure');
+-
+-	% Update handles structure
+-	guidata(hObject, handles);
+-
+-	%this variable used to prevent users from breaking the GUI
+-	%the variable is set to 1 once the data has been processed
+-	handles.processDataCompleted=0;
+-
+-	%initialize other variables
+-	handles.Msize=NaN;
+-	handles.Nsize=NaN;
+-	handles.numvectors=NaN;
+-	handles.endian=NaN;
+-	handles.datatype=NaN;
+-	handles.dx=NaN;
+-	handles.dy=NaN;
+-	handles.xEast=NaN;
+-	handles.yNorth=NaN;
+-
+-	%two files permitted
+-	set(handles.inputFile,'Max',1);
+-	set(handles.inputFile,'Min',0);
+-
+-	% Update handles structure
+-	guidata(hObject, handles);
+-end
+-
+-% --- Outputs from this function are returned to the command line.
+-function varargout = data_processing_tool_OutputFcn(hObject, eventdata, handles) 
+-
+-	% Get default command line output from handles structure
+-	varargout{1} = handles.output;
+-end
+-
+-
+-function inputFile_Callback(hObject, eventdata, handles)
+-%no code needed for this callback, the listbox is only used as a visual
+-end
+-
+-function addFiles_pushbutton_Callback(hObject, eventdata, handles)
+-	%gets input file(s) from user. the sample data files have extension .s2p
+-	[input_file,pathname] = uigetfile( ...
+-		{'*.*', 'All Files (*.*)'}, ...
+-		'Select files', ... 
+-		'MultiSelect', 'on');
+-
+-	%if file selection is cancelled, pathname should be zero
+-	%and nothing should happen
+-	if pathname==0
+-		return
+-	end
+-
+-	handles.processDataCompleted=1;
+-
+-	%gets the current data file names inside the listbox
+-	inputFileName=get(handles.inputFile,'String');
+-
+-	%if they only select one file, then the data will not be a cell
+-	inputFileName= fullfile(pathname,input_file);
+-
+-	%updates the gui to display all filenames in the listbox
+-	set(handles.inputFile,'String',inputFileName);
+-
+-	%make sure first file is always selected so it doesn't go out of range
+-	%the GUI will break if this value is out of range
+-	set(handles.inputFile,'Value',1);
+-
+-	% Update handles structure
+-	guidata(hObject, handles);
+-end
+-
+-function reset_pushbutton_Callback(hObject, eventdata, handles)
+-	%resets the GUI by clearing all relevant fields
+-
+-	handles.processDataCompleted = 0;
+-
+-	%clears the axes
+-	cla(handles.axes1,'reset');
+-
+-	%set the popupmenu to default value
+-%	set(handles.plot_popupmenu,'Value',1);
+-
+-	%clears the contents of the listbox
+-	set(handles.inputFile,'String','');
+-	set(handles.inputFile,'Value',0);
+-
+-	%updates the handles structure
+-	guidata(hObject, handles);
+-end
+-
+-function plotdata_pushbutton_Callback(hObject, eventdata, handles)
+-
+-	%get the list of input file names from the listbox
+-	inputFileName=get(handles.inputFile,'String');
+-
+-	%checks to see if the user selected any input files
+-	%if not, nothing happens
+-	if isempty(inputFileName)
+-		errordlg('Select a file first!')
+-		return
+-	end
+-
+-	%disables the button while data is processing
+-	disableButtons(handles);
+-	refresh(data_processing_tool); 
+-
+-	%parse options
+-	if ~isnan(handles.Msize)
+-		M=handles.Msize;
+-	else
+-		errordlg('Number of lines (M) not valid')
+-		return
+-	end
+-	if ~isnan(handles.Nsize)
+-		N=handles.Nsize;
+-	else
+-		errordlg('Number of rows (N) not valid')
+-		return
+-	end
+-	if ~isnan(handles.numvectors)
+-		numvectors=handles.numvectors;
+-		%change M
+-		M=numvectors*M;
+-	else
+-		numvectors=1;
+-	end
+-	if ~isnan(handles.endian)
+-		endian=handles.endian;
+-	else
+-		endian=1;
+-	end
+-	if ~isnan(handles.datatype)
+-		datatype=handles.datatype;
+-	else
+-		datatype='float32';
+-	end
+-
+-	%open file
+-	if endian==1
+-		fid=fopen(inputFileName,'r','ieee-be');
+-	else
+-		fid=fopen(inputFileName,'r','ieee-le');
+-	end
+-
+-	%read file
+-	[u, numpoints]=fread(fid, [M,N],datatype);
+-
+-	%close file
+-	fclose(fid);
+-
+-	%Pair of vectors?
+-	if numvectors==2,
+-	   vx=u(1:2:M,:);vx=flipud(vx');
+-	   vy=u(2:2:M,:);vx=flipud(vx');
+-
+-		%keep track
+-		handles.vx=vx;
+-		handles.vy=vy;
+-
+-		u=sqrt(vx.^2+vy.^2);
+-	end
+-
+-	cla(handles.axes1); %clear the axes
+-	axes(handles.axes1); %set the axes to plot
+-	grid on
+-	imagesc(u)
+-	colorbar
+-
+-	%keep track
+-	handles.u=u;
+-
+-	%to see whether the data has been processed or not
+-	handles.processDataCompleted=2;
+-
+-	%data is done processing, so re-enable the buttons
+-	enableButtons(handles);
+-	guidata(hObject, handles);
+-end
+-
+-function plotcoord_Callback(hObject, eventdata, handles)
+-
+-	%check
+-	if handles.processDataCompleted<2
+-		errordlg('Process data first !')
+-		return
+-	end
+-
+-	%parse options
+-	if ~isnan(handles.dx)
+-		dx=handles.dx;
+-	else
+-		errordlg('value of x-spacing not supported')
+-		return
+-	end
+-	if ~isnan(handles.dy)
+-		dy=handles.dy;
+-	else
+-		errordlg('value of y-spacing not supported')
+-		return
+-	end
+-	if ~isnan(handles.xEast)
+-		xEast=handles.xEast;
+-	else
+-		errordlg('value of xEast not supported')
+-		return
+-	end
+-	if ~isnan(handles.yNorth)
+-		yNorth=handles.yNorth;
+-	else
+-		errordlg('value of yNorth not supported')
+-		return
+-	end
+-
+-	disableButtons(handles);
+-
+-	%process coordinates
+-	u=handles.u;
+-	s=size(u);
+-	M=s(1)+1;
+-	N=s(2)+1;
+-
+-	%correction North and East -> real
+-	yNorth=yNorth-M*dy; % corner north
+-	x_m=xEast+dx*(0:N-1)';
+-	y_m=yNorth+dy*(0:M-1)';
+-
+-	%plot new axes
+-	cla(handles.axes1); %clear the axes
+-	axes(handles.axes1); %set the axes to plot
+-	grid on
+-	imagesc(x_m,y_m,handles.u)
+-	set(handles.axes1,'Ydir','Normal');
+-	colorbar
+-
+-	%Keep track of x_m and y_m
+-	handles.x_m=x_m;
+-	handles.y_m=y_m;
+-
+-	%to see whether the data has been processed or not
+-	handles.processDataCompleted=3;
+-
+-	%data is done processing, so re-enable the buttons
+-	enableButtons(handles);
+-	guidata(hObject, handles);
+-
+-end
+-
+-
+-function save_pushbutton_Callback(hObject, eventdata, handles)
+-	%if the data hasn't been processed yet, 
+-	%nothing happens when this button is pressed
+-	if (handles.processDataCompleted ~= 3)
+-		return
+-	end
+-
+-	disableButtons(handles);
+-
+-	if handles.numvectors==2,
+-
+-		prompt={'Enter the name of the variable 1:','Enter the name of the variable 2:','Enter the name of the file:'};
+-		name='Save Matlab File';
+-		numlines=1;
+-		defaultanswer={'vx','vy','ProcessedFile'};
+-		answer=inputdlg(prompt,name,numlines,defaultanswer);
+-		variablename1=answer{1};
+-		variablename2=answer{2};
+-		filename=answer{3};
+-
+-		if ~isempty(variablename1) & ~isempty(variablename2) & ~isempty(filename)
+-			%get the variables
+-			x_m=handles.x_m;
+-			y_m=handles.y_m;
+-			eval([variablename1 ' = handles.vx;']);
+-			eval([variablename2 ' = handles.vy;']);
+-			x_m=handles.x_m;
+-			eval(['save ' filename ' x_m y_m ' variablename1 ' ' variablename2 ]);
+-			disp(['in the file ' filename ' have been saved the following variables: x_m, y_m, ' variablename1 ' and ' variablename2])
+-		end
+-	else
+-		prompt={'Enter the name of the variable:','Enter the name of the file:'};
+-		name='Save Matlab File';
+-		numlines=1;
+-		defaultanswer={'thickness','ProcessedFile'};
+-		answer=inputdlg(prompt,name,numlines,defaultanswer);
+-		variablename=answer{1};
+-		filename=answer{2};
+-
+-		if ~isempty(variablename) & ~isempty(filename)
+-			%get the variables
+-			x_m=handles.x_m;
+-			y_m=handles.y_m;
+-			eval([variablename ' = handles.u;']);
+-			eval(['save ' filename ' x_m y_m ' variablename]);
+-			disp(['in the file ' filename ' have been saved the following variables: x_m, y_m, and ' variablename])
+-		end
+-	end
+-	enableButtons(handles);
+-	guidata(hObject, handles);
+-end
+-
+-function inputFile_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function disableButtons(handles)
+-	set(handles.figure1,'Pointer','watch');
+-	set(handles.plotdata_pushbutton,'Enable','off');
+-	set(handles.plotcoord,'Enable','off');
+-	set(handles.save_pushbutton,'Enable','off');
+-	set(handles.addFiles_pushbutton,'Enable','off');
+-	set(handles.reset_pushbutton,'Enable','off');
+-end
+-
+-function enableButtons(handles)
+-	set(handles.figure1,'Pointer','arrow');
+-	set(handles.plotdata_pushbutton,'Enable','on');
+-	set(handles.plotcoord,'Enable','on');
+-	set(handles.save_pushbutton,'Enable','on');
+-	set(handles.addFiles_pushbutton,'Enable','on');
+-	set(handles.reset_pushbutton,'Enable','on');
+-end
+-
+-function EndianType_Callback(hObject, eventdata, handles)
+-	handles.endian=get(handles.EndianType,'Value');
+-	guidata(hObject, handles);
+-end
+-
+-function EndianType_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function DataType_Callback(hObject, eventdata, handles)
+-
+-	datatype= get(handles.DataType,'Value');
+-	switch datatype
+-		case 1
+-			string='float32';
+-
+-		case 2
+-			string='single';
+-
+-		case 3
+-			string='float64';
+-
+-		case 4
+-			string='double';
+-		end
+-	handles.datatype=string;
+-	guidata(hObject, handles);
+-end
+-
+-function DataType_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function PairOfVectors_Callback(hObject, eventdata, handles)
+-	handles.numvectors = get(handles.PairOfVectors,'Value');
+-	guidata(hObject, handles);
+-end
+-
+-function PairOfVectors_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function Msize_Callback(hObject, eventdata, handles)
+-	handles.Msize=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-
+-function Msize_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function Nsize_Callback(hObject, eventdata, handles)
+-	handles.Nsize=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-
+-function Nsize_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function dx_Callback(hObject, eventdata, handles)
+-	handles.dx=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function dx_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function dy_Callback(hObject, eventdata, handles)
+-	handles.dy=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function dy_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function xEast_Callback(hObject, eventdata, handles)
+-	handles.xEast=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function xEast_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function yNorth_Callback(hObject, eventdata, handles)
+-	handles.yNorth=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function yNorth_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/ddeblank.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/ddeblank.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/ddeblank.m	(revision 12996)
+@@ -1,29 +0,0 @@
+-function sout = ddeblank(s)
+-%DDEBLANK Double deblank. Strip both leading and trailing blanks.
+-%
+-%   DDEBLANK(S) removes leading and trailing blanks and null characters from
+-%   the string S.  A null character is one that has a value of 0.
+-%
+-%   See also DEBLANK, DEWHITE, DDEWHITE.
+-
+-%   Author:      Peter J. Acklam
+-%   Time-stamp:  2003-10-13 11:13:07 +0200
+-%   E-mail:      pjacklam@online.no
+-%   URL:         http://home.online.no/~pjacklam
+-
+-   error(nargchk(1, 1, nargin));
+-   if ~ischar(s)
+-      warning('Input must be a string (char array).');
+-   end
+-
+-   if isempty(s)
+-      sout = s;
+-      return;
+-   end
+-
+-   [r, c] = find( (s ~= ' ') & (s ~= 0) );
+-   if size(s, 1) == 1
+-      sout = s(min(c) : max(c));
+-   else
+-      sout = s(:, min(c) : max(c));
+-   end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/strsplit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/strsplit.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/strsplit.m	(revision 12996)
+@@ -1,91 +0,0 @@
+-function splittedstring = strsplit(inpstr,delimiter)
+-%STRSPLIT - split a tring of delimiter separated values
+-%
+-%   This function should be used to split a string of delimiter separated
+-%   values.  If all values are numerical values the returned matrix is a
+-%   double array but if there is one non numerical value a cell array is
+-%   returned.  You can check this with the iscell() function.
+-%   inpstr: string containing delimiter separatede numerical values, eg
+-%           3498,48869,23908,34.67
+-%   Output: An x by 1 matrix containing the splitted values
+-%   Delimiter: optional, if omitted the delimiter is , (comma)
+-%
+-%   Usage:
+-%      output = strsplit(inpstr[,delimiter])
+-%
+-
+-%   mailto:    gie.spaepen@ua.ac.be
+-
+-
+-
+-%Check input arguments
+-if(nargin < 1)
+-    error('There is no argument defined');
+-else
+-    if(nargin == 1)
+-        strdelim = ',';
+-        %Verbose off!! disp 'Delimiter set to ,';
+-    else
+-        strdelim = delimiter;
+-    end
+-end
+-
+-%deblank string
+-deblank(inpstr);
+-
+-%Get number of substrings
+-idx  = findstr(inpstr,strdelim);
+-if size(idx) == 0
+-    disp 'No delimiter in string, inputString is returned';
+-    splittedstring = inpstr;
+-else
+-    %Define size of the indices
+-    sz = size(idx,2);
+-    %Define splittedstring
+-    tempsplit = {};
+-    %Loop through string and itinerate from delimiter to delimiter
+-    for i = 1:sz
+-        %Define standard start and stop positions for the start position,
+-        %choose 1 as startup position because otherwise you get an array
+-        %overflow, for the endposition you can detemine it from the
+-        %delimiter position
+-        strtpos = 1;
+-        endpos = idx(i)-1;
+-        %If i is not the beginning of the string get it from the delimiter
+-        %position
+-        if i ~= 1
+-            strtpos = idx(i-1)+1;
+-        end
+-        %If i is equal to the number of delimiters get the last element
+-        %first by determining the lengt of the string and then replace the
+-        %endpos back to a standard position
+-        if i == sz
+-            endpos = size(inpstr,2); 
+-            tempsplit(i+1) = {inpstr(idx(i)+1 : endpos)};
+-            endpos = idx(i)-1;
+-        end
+-        %Add substring to output: splittedstring a cell array
+-        tempsplit(i) = {inpstr(strtpos : endpos)};   
+-    end
+-    %Flag 
+-    isallnums = 1;
+-    %Check is there are NaN values if matrix elements are converted to
+-    %doubles
+-    for i = 1:size(tempsplit,2)
+-        tempdouble = str2double(tempsplit(i));
+-        if(isnan(tempdouble))
+-            isallnums = 0;
+-        end
+-    end
+-    %If isallnums = 1 then return a double array otherwise return a cell
+-    %array
+-    if(isallnums == 1)
+-        for i = 1:size(tempsplit,2)
+-            splittedstring(i) = str2double(tempsplit(i));
+-        end
+-    else
+-        splittedstring = tempsplit;
+-    end
+-    
+-        
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/dewhite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/dewhite.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/dewhite.m	(revision 12996)
+@@ -1,30 +0,0 @@
+-function sout = dewhite(s)
+-%DEWHITE Dewhite. Strip trailing whitespace.
+-%
+-%   DEWHITE(S) removes leading and trailing white space and any null characters
+-%   from the string S.  A null character is one that has an absolute value of
+-%   0.
+-%
+-%   See also DDEWHITE, DEBLANK, DDEBLANK.
+-
+-%   Author:      Peter J. Acklam
+-%   Time-stamp:  2003-10-13 11:12:52 +0200
+-%   E-mail:      pjacklam@online.no
+-%   URL:         http://home.online.no/~pjacklam
+-
+-   error(nargchk(1, 1, nargin));
+-   if ~ischar(s)
+-      error( 'Input must be a string (char array).' );
+-   end
+-
+-   if isempty(s)
+-      sout = s;
+-      return;
+-   end
+-
+-   [r, c] = find(~isspace(s));
+-   if size(s, 1) == 1
+-      sout = s(1:max(c));
+-   else
+-      sout = s(:,1:max(c));
+-   end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/discardnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/discardnum.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/discardnum.m	(revision 12996)
+@@ -1,14 +0,0 @@
+-function string2=discardnum(string)
+-%DISCARDNUM -  ??????
+-%
+-%   Usage:
+-%      string2=discardnum(string)
+-
+-string2=string;
+-
+-for i=1:length(string),
+-	if (((string(i)-0) <=57) & ((string(i)-0) >=48)),
+-		string2=string(1:i-1);
+-		break;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/ismemberi.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/ismemberi.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/ismemberi.m	(revision 12996)
+@@ -1,26 +0,0 @@
+-function flag=ismemberi(string,list),
+-%ISMEMBERI - return 1 if a string belongs to a list (case insensitive)
+-%
+-%   same function as Matlab's ismember except that it
+-%   is case insensitive
+-%
+-%   Usage:
+-%      flag=ismemberi(string,list);
+-%
+-%   Example:
+-%      flag=ismemberi('test','{'test1','test2','test3'});
+-
+-if ~iscell(list)
+-	error('ismemberi error message: the list of string must be a cell!')
+-end
+-
+-%initialize output
+-flag=0;
+-
+-%go through the list
+-for i=1:length(list),
+-	if strcmpi(string,list{i}),
+-		flag=i;
+-		return
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/strsplit_strict.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/strsplit_strict.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/strsplit_strict.m	(revision 12996)
+@@ -1,37 +0,0 @@
+-function splittedstring = strsplit(inpstr,delimiter)
+-%STRSPLIT - split a tring of delimiter separated values
+-%
+-%   Usage:
+-%      output = strsplit_strict(inpstr,delimiter)
+-
+-
+-%Check input arguments
+-if(nargin ~= 2)
+-    error('There is no argument defined');
+-end
+-
+-%deblank string
+-deblank(inpstr);
+-
+-%Get number of substrings
+-idx  = findstr(inpstr,delimiter);
+-if size(idx) == 0
+-    splittedstring = {inpstr};
+-else
+-    sz = size(idx,2);
+-    splittedstring = {};
+-    %Loop through string and itinerate from delimiter to delimiter
+-    for i = 1:sz
+-        strtpos = 1;
+-        endpos = idx(i)-1;
+-        if i ~= 1
+-            strtpos = idx(i-1)+1;
+-        end
+-        if i == sz
+-            endpos = size(inpstr,2); 
+-            splittedstring(i+1) = {inpstr(idx(i)+1 : endpos)};
+-            endpos = idx(i)-1;
+-        end
+-        splittedstring(i) = {inpstr(strtpos : endpos)};   
+-    end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/ddewhite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/ddewhite.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/ddewhite.m	(revision 12996)
+@@ -1,30 +0,0 @@
+-function sout = ddewhite(s)
+-%DDEWHITE Double dewhite. Strip both leading and trailing whitespace.
+-%
+-%   DDEWHITE(S) removes leading and trailing white space and any null
+-%   characters from the string S.  A null character is one that has an absolute
+-%   value of 0.
+-%
+-%   See also DEWHITE, DEBLANK, DDEBLANK.
+-
+-%   Author:      Peter J. Acklam
+-%   Time-stamp:  2003-10-13 11:12:57 +0200
+-%   E-mail:      pjacklam@online.no
+-%   URL:         http://home.online.no/~pjacklam
+-
+-   error(nargchk(1, 1, nargin));
+-   if ~ischar(s)
+-      error('Input must be a string (char array).');
+-   end
+-
+-   if isempty(s)
+-      sout = s;
+-      return;
+-   end
+-
+-   [r, c] = find(~isspace(s));
+-   if size(s, 1) == 1
+-      sout = s(min(c) : max(c));
+-   else
+-      sout = s(:, min(c) : max(c));
+-   end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/issmprintf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/issmprintf.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/issmprintf.m	(revision 12996)
+@@ -1,13 +0,0 @@
+-function issmprintf(flag,format,varargin)
+-%ISSMPRINTF -  display string in solution sequences. wrapper to disp and sprintf.  
+-%
+-%   Usage:
+-%      issmprintf(flag,format,string)
+-%      flag can be used to switch display on and off
+-%
+-%   Example:
+-%      issmprintf(1,'%s\n','string to display');
+-	
+-if flag,
+-	disp(sprintf(format,varargin{:}));
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/logoutput.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/logoutput.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/String/logoutput.m	(revision 12996)
+@@ -1,7 +0,0 @@
+-function logoutput(logstring,message)
+-%LOGOUTPUT - embed a log string into an error message, used in the nightly runs.
+-%
+-%   Usage:
+-%      logoutput(logstring,message)
+-
+-disp(sprintf('%s%s',logstring,message));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.py	(revision 12996)
+@@ -1,24 +0,0 @@
+-import platform
+-import os
+-from MatlabFuncs import *
+-
+-def issmdir():
+-	"""
+-	ISSMDIR - Get ISSM_DIR environment variable
+- 
+-	   Usage:
+-	      ISSM_DIR=issmdir()
+-	"""
+-
+-	if not 'Windows' in platform.system():
+-		ISSM_DIR =os.environ['ISSM_DIR']
+-	else:
+-		ISSM_DIR =os.environ['ISSM_DIR_WIN']
+-		if strcmpi(ISSM_DIR[-1],'/') or strcmpi(ISSM_DIR[-1],'\\'):
+-			ISSM_DIR = ISSM_DIR[:-1]    #shave off the last '/'
+-
+-	if not ISSM_DIR:
+-		raise RuntimeError("issmdir error message: 'ISSM_DIR' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!")
+-
+-	return ISSM_DIR
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/flaimdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/flaimdir.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/flaimdir.m	(revision 12996)
+@@ -1,7 +0,0 @@
+-function FLAIM_DIR=flaimdir()
+-%ISSMDIR - Get FLAIM installation directory
+-%
+-%   Usage:
+-%      FLAIM_DIR=flaimdir()
+-
+-FLAIM_DIR=[issmdir '/externalpackages/flaim/install'];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/ucisvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/ucisvn.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/ucisvn.m	(revision 12996)
+@@ -1,15 +0,0 @@
+-function UCI_SVN=ucisvn()
+-%ISSMDIR - Get UCI_SVN environment variable
+-%
+-%   Usage:
+-%      UCI_SVN=ucisvn()
+-
+-if ~ispc,
+-	UCI_SVN =getenv('UCI_SVN');
+-else
+-	UCI_SVN =getenv('UCI_SVN_WIN');
+-end
+-
+-if (isempty(UCI_SVN)),
+-	error('ucisvn error message: ''UCI_SVN'' environment variable is empty! You should define UCI_SVN in your .cshrc or .bashrc');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/issmdir.m	(revision 12996)
+@@ -1,18 +0,0 @@
+-function ISSM_DIR=issmdir()
+-%ISSMDIR - Get ISSM_DIR environment variable
+-%
+-%   Usage:
+-%      ISSM_DIR=issmdir()
+-
+-if ~ispc,
+-	ISSM_DIR =getenv('ISSM_DIR');
+-else
+-	ISSM_DIR =getenv('ISSM_DIR_WIN');
+-	if strcmpi(ISSM_DIR(end),'/') | strcmpi(ISSM_DIR(end),'\'),
+-		ISSM_DIR = ISSM_DIR(1:end-1); %shave off the last '/'
+-	end
+-end
+-
+-if (isempty(ISSM_DIR)),
+-	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/jplsvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/jplsvn.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Shell/jplsvn.m	(revision 12996)
+@@ -1,15 +0,0 @@
+-function JPL_SVN=jplsvn()
+-%ISSMDIR - Get JPL_SVN environment variable
+-%
+-%   Usage:
+-%      JPL_SVN=jplsvn()
+-
+-if ~ispc,
+-	JPL_SVN =getenv('JPL_SVN');
+-else
+-	JPL_SVN =getenv('JPL_SVN_WIN');
+-end
+-
+-if (isempty(JPL_SVN)),
+-	error('jplsvn error message: ''JPL_SVN'' environment variable is empty! You should define JPL_SVN in your .cshrc or .bashrc');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Plot/squarezoom.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Plot/squarezoom.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Plot/squarezoom.m	(revision 12996)
+@@ -1,20 +0,0 @@
+-function squarezoom()
+-%SQUAREZOOM - zoom on a part of a figure
+-%
+-%   Usage:
+-%      squarezoom()
+-
+-disp('Click twice to define a square where you want to zoom. First click for upper left corner, second for lower right corner');
+-[x,y]=ginput(2);
+-dx=x(2)-x(1);
+-dy=y(1)-y(2);
+-
+-if dx>dy,
+-	delta=dx-dy;
+-	xlim([x(1) x(2)]);
+-	ylim([y(2)-delta/2 y(1)+delta/2]);
+-else
+-	delta=dy-dx;
+-	xlim([x(1)-delta/2 x(2)+delta/2]);
+-	ylim([y(2) y(1)]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Plot/plot2patch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Plot/plot2patch.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Plot/plot2patch.m	(revision 12996)
+@@ -1,16 +0,0 @@
+-function [px py]=plot2patch(x,y,miny)
+-%PLOT2PATCH: build patch out of x,y plot.
+-%
+-% Usage: [px,py]=plot2patch(x,y,miny)
+-%
+-%        where px and py are a list of point defining a closed polygon.
+-%              x,y are the values of the plot
+-%              miny is the y-value used to close the plot into a closed polygon.
+-% 
+-%      See also patch, plot
+-
+-px=x;
+-py=y;
+-
+-px=[px; flipud(x)];
+-py=[py; ; miny*ones(length(x),1)];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/struc_class.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/struc_class.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/struc_class.m	(revision 12996)
+@@ -1,30 +0,0 @@
+-%
+-%  function to find the structural fields of a specified class
+-%  
+-%  [sclasso]=struc_class(sclass,cstr)
+-%
+-function [sclasso]=struc_class(sclass,cstr)
+-
+-%  collect only the objects of the appropriate class
+-
+-if     isa(sclass,cstr)
+-    if ~isempty(inputname(1))
+-        sclasso.(inputname(1))=sclass;
+-    else
+-        sclasso.(cstr)        =sclass;
+-    end
+-
+-elseif isstruct(sclass)
+-    fnames=fieldnames(sclass);
+-    for i=1:numel(fnames)
+-        if isa(sclass.(fnames{i}),cstr)
+-            sclasso.(fnames{i})=sclass.(fnames{i});
+-        end
+-    end
+-end
+-
+-if ~exist('sclasso','var')
+-    sclasso=struct([]);
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/allempty.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/allempty.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/allempty.m	(revision 12996)
+@@ -1,22 +0,0 @@
+-%
+-%  function to return an empty cell array if all array elements are empty
+-%
+-%  function [cout]=allempty(cin)
+-%
+-function [cout]=allempty(cin)
+-
+-if ~nargin
+-    help allempty
+-    return
+-end
+-
+-for j=1:numel(cin)
+-    if ~isempty(cin{j})
+-        cout=cin;
+-        return
+-    end
+-end
+-cout={};
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/struc_desc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/struc_desc.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/struc_desc.m	(revision 12996)
+@@ -1,61 +0,0 @@
+-%
+-%  function to find the structures with the specified descriptors
+-%  
+-%  [sarrayo]=struc_desc(sarray,varargin)
+-%
+-function [sarrayo]=struc_desc(sarray,varargin)
+-
+-if ~isfield(sarray,'descriptor')
+-    if ~isempty(inputname(1))
+-        error('Field ''descriptor'' not found in array ''%s''.',inputname(1));
+-    else
+-        error('Field ''descriptor'' not found in array %d.',1);
+-    end
+-end
+-
+-sarrayo=struct([]);
+-
+-for iarg=1:nargin-1
+-    if     iscell(varargin{iarg})
+-        desc=        varargin{iarg};
+-    elseif ischar(varargin{iarg})
+-        desc=cellstr(varargin{iarg});
+-    end
+-    
+-    for i=1:length(desc)
+-        sarrayoi=struc_desci(sarray,desc{i});
+-        if ~isempty(sarrayoi)
+-            if isempty(sarrayo)
+-                sarrayo       =sarrayoi;
+-            else
+-                sarrayo(end+1)=sarrayoi;
+-            end
+-        end
+-    end
+-end
+-
+-%  if nothing found, return whole array
+-
+-if isempty(sarrayo)
+-    sarrayo=sarray;
+-end
+-
+-end
+-
+-%
+-%  function to find the structure with the specified descriptor
+-%  
+-function [sarrayo]=struc_desci(sarray,str)
+-
+-sarrayo=struct([]);
+-
+-for i=1:numel(sarray)
+-    if strcmp(sarray(i).descriptor,str)
+-        sarrayo=sarray(i);
+-        return
+-    end
+-end
+-
+-warning(['String ''' str ''' not found in array ''' inputname(1) '''.']);
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_dim.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_dim.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_dim.m	(revision 12996)
+@@ -1,72 +0,0 @@
+-%
+-%  function to return the string dimension of an array element
+-%
+-%  function [sdim]=string_dim(a,idim,varargin)
+-%
+-function [sdim]=string_dim(a,idim,varargin)
+-
+-if ~nargin
+-    help string_dim
+-    return
+-end
+-
+-%  check for scalar
+-
+-if (numel(a) == 1) && (idim == 1)
+-    sdim='';
+-    return
+-end
+-
+-%  check for overflow
+-
+-if (idim > numel(a))
+-    if ~isempty(inputname(1))
+-        error('Index %d exceeds number of elements in array ''%s''.',...
+-            idim,inputname(1));
+-    else
+-        error('Index %d exceeds number of elements in array %d.',...
+-            idim,1);
+-    end
+-end
+-
+-%  check for column or row vector (Matlab uses a minimum of two
+-%  dimensions, so this won't match Matlab standard output)
+-
+-for iarg=1:nargin-2
+-    if strcmpi(varargin{iarg},'vector')
+-        if (ndims(a) == 2) && ((size(a,1) == 1) || (size(a,2) == 1))
+-            sdim =['(' num2str(idim) ')'];
+-            return
+-        end
+-    end
+-end
+-
+-%  do the general case
+-
+-asize=size(a);
+-index=zeros(size(asize));
+-aprod=prod(asize);
+-idim =idim-1;
+-
+-%  calculate indices base 0 and convert to base 1
+-
+-%  note that ind2sub might be useful, except that it requires a list
+-%  of scalars rather than a vector for output.
+-
+-for i=length(asize):-1:1
+-    aprod=aprod/asize(i);
+-    index(i)=floor(idim/aprod);
+-    idim=idim-index(i)*aprod;
+-end
+-index=index+1;
+-
+-%  assemble string for output
+-
+-sdim ='(';
+-for i=1:length(asize)-1;
+-    sdim =[sdim num2str(index(i)) ','];
+-end
+-sdim =[sdim num2str(index(end)) ')'];
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/allequal.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/allequal.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/allequal.m	(revision 12996)
+@@ -1,70 +0,0 @@
+-%
+-%  function to return an empty array if all array elements are
+-%  equal to the given value, which may also be empty but not nan.
+-%
+-%  (note that by definition, nan is not equal to nan.  this could
+-%  be changed by using isequalwithequalnans.)
+-%
+-%  function [aout]=allequal(ain,aval)
+-%
+-function [aout]=allequal(ain,aval)
+-
+-if ~nargin
+-    help allequal
+-    return
+-end
+-
+-aout=ain;
+-
+-if     islogical(ain) && islogical(aval)
+-    for i=1:numel(ain)
+-        if ~isequal(ain(i),aval)
+-            return
+-        end
+-    end
+-    aout=logical([]);
+-
+-elseif isnumeric(ain) && isnumeric(aval)
+-    for i=1:numel(ain)
+-        if ~isequal(ain(i),aval)
+-            return
+-        end
+-    end
+-    aout=[];
+-
+-elseif ischar(ain) && ischar(aval)
+-    for i=1:size(ain,1)
+-        if ~strcmp(ain(i,:),aval)
+-            return
+-        end
+-    end
+-    aout='';
+-
+-elseif iscell(ain)
+-    if     islogical(aval)
+-        for i=1:numel(ain)
+-            if ~islogical(ain{i}) || ~isequal(ain{i},aval)
+-                return
+-            end
+-        end
+-        aout={};
+-
+-    elseif isnumeric(aval)
+-        for i=1:numel(ain)
+-            if ~isnumeric(ain{i}) || ~isequal(ain{i},aval)
+-                return
+-            end
+-        end
+-        aout={};
+-
+-    elseif ischar(aval)
+-        for i=1:size(ain,1)
+-            if ~ischar(ain{i}) || ~strcmp(ain{i},aval)
+-                return
+-            end
+-        end
+-        aout={};
+-    end
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_size.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_size.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_size.m	(revision 12996)
+@@ -1,38 +0,0 @@
+-%
+-%  function to return the string size of an array
+-%
+-%  function [ssize]=string_size(a,varargin)
+-%
+-function [ssize]=string_size(a,varargin)
+-
+-if ~nargin
+-    help string_size
+-    return
+-end
+-
+-%  check for column or row vector (Matlab uses a minimum of two
+-%  dimensions, so this won't match Matlab standard output)
+-
+-for iarg=1:nargin-1
+-    if strcmpi(varargin{iarg},'vector')
+-        if (ndims(a) == 2) && ((size(a,1) == 1) || (size(a,2) == 1))
+-            ssize =['(' num2str(numel(a)) ')'];
+-            return
+-        end
+-    end
+-end
+-
+-%  do the general case
+-
+-asize=size(a);
+-
+-%  assemble string for output
+-
+-ssize ='(';
+-for i=1:length(asize)-1;
+-    ssize =[ssize num2str(asize(i)) 'x'];
+-end
+-ssize =[ssize num2str(asize(end)) ')'];
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/any2str.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/any2str.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/any2str.m	(revision 12996)
+@@ -1,22 +0,0 @@
+-%
+-%  function to convert anything to a string
+-%
+-%  function [svec]=any2str(a,alim)
+-%
+-function [svec]=any2str(a,alim)
+-
+-if ~exist('alim','var') || (numel(a) <= alim)
+-    if iscell(a)
+-        svec=string_cell(a);
+-    else
+-        if (numel(a) > 1) && ~ischar(a)
+-            svec=string_vec(a);
+-        else
+-            svec=item2str(a);
+-        end
+-    end
+-else
+-	svec=[string_size(a) ' ''' class(a) ''''];
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_vec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_vec.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_vec.m	(revision 12996)
+@@ -1,26 +0,0 @@
+-%
+-%  function to return the string of an vector
+-%
+-%  function [svec]=string_vec(a)
+-%
+-function [svec]=string_vec(a)
+-
+-if ~nargin
+-    help string_vec
+-    return
+-end
+-
+-if (numel(a) == 0)
+-    svec='[]';
+-    return
+-end
+-
+-%  assemble string for output
+-
+-svec ='[';
+-for i=1:numel(a)-1;
+-    svec=[svec item2str(a(i)) ' '];
+-end
+-svec=[svec item2str(a(end)) ']'];
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/allnan.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/allnan.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/allnan.m	(revision 12996)
+@@ -1,22 +0,0 @@
+-%
+-%  function to return an empty double array if all array elements are NaN
+-%
+-%  function [dout]=allnan(din)
+-%
+-function [dout]=allnan(din)
+-
+-if ~nargin
+-    help allnan
+-    return
+-end
+-
+-for i=1:numel(din)
+-    if ~isnan(din(i))
+-        dout=din;
+-        return
+-    end
+-end
+-dout=[];
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/str2int.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/str2int.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/str2int.m	(revision 12996)
+@@ -1,46 +0,0 @@
+-%
+-%  function to find and read the first or last positive integer
+-%  in a character string.
+-%
+-%  function [aint]=str2int(astr,cfl)
+-%
+-function [aint]=str2int(astr,cfl);
+-
+-aint=[];
+-
+-if     ~exist('cfl','var') || strncmpi(cfl,'f',1)
+-    i=1;
+-
+-    while (i <= length(astr))
+-        if (astr(i) >= '0' && astr(i) <= '9')
+-            aint=sscanf(astr(i:length(astr)),'%d',[1,1]);
+-            return
+-        else
+-            i=i+1;
+-        end
+-	end
+-
+-elseif strncmpi(cfl,'l',1)
+-    i=length(astr);
+-    ifound=false;
+-
+-    while (i >= 1)
+-        if     (astr(i) >= '0' && astr(i) <= '9')
+-            ifound=true;
+-            i=i-1;
+-        elseif ~ifound
+-            i=i-1;
+-        else
+-            aint=sscanf(astr(i+1:length(astr)),'%d',[1,1]);
+-            return
+-        end
+-	end
+-
+-    if ifound
+-        aint=sscanf(astr,'%d',[1,1]);
+-        return
+-    end
+-end
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_cell.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_cell.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/string_cell.m	(revision 12996)
+@@ -1,26 +0,0 @@
+-%
+-%  function to return the string of a cell array
+-%
+-%  function [svec]=string_cell(a)
+-%
+-function [svec]=string_cell(a)
+-
+-if ~nargin
+-    help string_cell
+-    return
+-end
+-
+-if (numel(a) == 0)
+-    svec='{}';
+-    return
+-end
+-
+-%  assemble string for output
+-
+-svec ='{';
+-for i=1:numel(a)-1;
+-    svec=[svec item2str(a{i}) ' '];
+-end
+-svec=[svec item2str(a{end}) '}'];
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/find_string.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/find_string.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/find_string.m	(revision 12996)
+@@ -1,18 +0,0 @@
+-%
+-%  function to find a string in a cell array
+-%  (could probably be replaced by matlab strmatch)
+-%  
+-%  [ifound]=find_string(cells,str)
+-%
+-function [ifound]=find_string(cells,str)
+-
+-ifound=false;
+-
+-for i=1:numel(cells)
+-    if ischar(cells{i}) && strcmp(cells{i},str)
+-        ifound=i;
+-        return
+-    end
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/array_size.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/array_size.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/array_size.m	(revision 12996)
+@@ -1,35 +0,0 @@
+-%
+-%  function to find an array size from a list of arrays.
+-%  
+-%  [asize]=array_size(varargin)
+-%
+-%  see array_numel to check only the number of elements, if
+-%  single indices will be used.
+-%
+-function [asize]=array_size(varargin)
+-
+-asize=[1 1];
+-
+-for iarg=1:nargin
+-    if ischar(varargin{iarg})
+-        isize=size(cellstr(varargin{iarg}));
+-    else
+-        isize=size(varargin{iarg});
+-    end
+-    
+-    if ~isequal(isize,[1 1])
+-        if isequal(asize,[1 1])
+-            asize=isize;
+-        else
+-            if ~isequal(isize,asize)
+-                if ~isempty(inputname(iarg))
+-                    error('Array ''%s'' has inconsistent size.',inputname(iarg));
+-                else
+-                    error('Array %d has inconsistent size.',iarg);
+-                end
+-            end
+-        end
+-    end
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/item2str.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/item2str.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/item2str.m	(revision 12996)
+@@ -1,31 +0,0 @@
+-%
+-%  function to convert an item to a string
+-%
+-%  function [svec]=item2str(a)
+-%
+-function [svec]=item2str(a)
+-
+-if     islogical(a)
+-    if a
+-        svec='true';
+-    else
+-        svec='false';
+-    end
+-elseif ischar(a)
+-    svec=['''' a ''''];
+-elseif isnumeric(a)
+-    svec=num2str(a);
+-else
+-    if ~isempty(inputname(1))
+-        warning('item2str:item_unrecog',...
+-            'Item ''%s'' is of unrecognized type ''%s''.',...
+-            inputname(1),class(a));
+-    else
+-        warning('item2str:item_unrecog',...
+-            'Item %d is of unrecognized type ''%s''.',...
+-            1,class(a));
+-    end
+-    return
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/rotateticklabel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/rotateticklabel.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/rotateticklabel.m	(revision 12996)
+@@ -1,69 +0,0 @@
+-function th=rotateticklabel(h,rot,demo)
+-%ROTATETICKLABEL rotates tick labels
+-%   TH=ROTATETICKLABEL(H,ROT) is the calling form where H is a handle to
+-%   the axis that contains the XTickLabels that are to be rotated. ROT is
+-%   an optional parameter that specifies the angle of rotation. The default
+-%   angle is 90. TH is a handle to the text objects created. For long
+-%   strings such as those produced by datetick, you may have to adjust the
+-%   position of the axes so the labels don't get cut off.
+-%
+-%   Of course, GCA can be substituted for H if desired.
+-%
+-%   TH=ROTATETICKLABEL([],[],'demo') shows a demo figure.
+-%
+-%   Known deficiencies: if tick labels are raised to a power, the power
+-%   will be lost after rotation.
+-%
+-%   See also datetick.
+-
+-%   Written Oct 14, 2005 by Andy Bliss
+-%   Copyright 2005 by Andy Bliss
+-
+-%DEMO:
+-if nargin==3
+-    x=[now-.7 now-.3 now];
+-    y=[20 35 15];
+-    figure
+-    plot(x,y,'.-')
+-    datetick('x',0,'keepticks')
+-    h=gca;
+-    set(h,'position',[0.13 0.35 0.775 0.55])
+-    rot=90;
+-end
+-
+-%set the default rotation if user doesn't specify
+-if nargin==1
+-    rot=90;
+-end
+-%make sure the rotation is in the range 0:360 (brute force method)
+-while rot>360
+-    rot=rot-360;
+-end
+-while rot<0
+-    rot=rot+360;
+-end
+-%get current tick labels
+-a=get(h,'XTickLabel');
+-%erase current tick labels from figure
+-set(h,'XTickLabel',[]);
+-%get tick label positions
+-b=get(h,'XTick');
+-c=get(h,'YTick');
+-%make new tick labels
+-%  must consider yscale (jes, 9/14/10)
+-switch lower(get(h,'YScale'))
+-    case 'linear'
+-        if rot<180
+-            th=text(b,repmat(c(1)-.1*(c(2)-c(1)),length(b),1),a,'HorizontalAlignment','right','rotation',rot,'Interpreter','none');
+-        else
+-            th=text(b,repmat(c(1)-.1*(c(2)-c(1)),length(b),1),a,'HorizontalAlignment','left','rotation',rot,'Interpreter','none');
+-        end
+-    case 'log'
+-        if rot<180
+-            th=text(b,repmat(10^(log10(c(1))-.1*(log10(c(2))-log10(c(1)))),length(b),1),a,'HorizontalAlignment','right','rotation',rot,'Interpreter','none');
+-        else
+-            th=text(b,repmat(10^(log10(c(1))-.1*(log10(c(2))-log10(c(1)))),length(b),1),a,'HorizontalAlignment','left','rotation',rot,'Interpreter','none');
+-        end
+-    otherwise
+-        set(h,'XTickLabel',a);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/array_numel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/array_numel.m	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/Array/array_numel.m	(revision 12996)
+@@ -1,35 +0,0 @@
+-%
+-%  function to find a number of elements from a list of arrays.
+-%  
+-%  [asize]=array_numel(varargin)
+-%
+-%  see array_size to check the number and shape of elements, if
+-%  multiple indices will be used.
+-%
+-function [anum]=array_numel(varargin)
+-
+-anum=1;
+-
+-for iarg=1:nargin
+-    if ischar(varargin{iarg})
+-        inum=numel(cellstr(varargin{iarg}));
+-    else
+-        inum=numel(varargin{iarg});
+-    end
+-    
+-    if ~isequal(inum,1)
+-        if isequal(anum,1)
+-            anum=inum;
+-        else
+-            if ~isequal(inum,anum)
+-                if ~isempty(inputname(iarg))
+-                    error('Array ''%s'' has inconsistent number of elements.',inputname(iarg));
+-                else
+-                    error('Array %d has inconsistent number of elements.',iarg);
+-                end
+-            end
+-        end
+-    end
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/recursivepath.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/recursivepath.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/recursivepath.m	(revision 12996)
+@@ -0,0 +1,38 @@
++function p = recursivepath(d)
++%RECURSIVEPATH - generate paths in a directory
++%
++%   this routine is equivalent to Matlab's genpath except that it skips CVS and .svn directories
++%
++%   Usage:
++%      p = recursivepath(d)
++
++%initialize path to be returned
++p = '';
++sep=pathsep;  %directory separator
++
++% Generate path based on given root directory
++files=dir(d);
++if isempty(files)
++	return
++end
++
++% Add d to the path even if it is empty.
++p = [p d sep];
++
++% set logical vector for subdirectory entries in d
++isdir = logical(cat(1,files.isdir));
++
++% Recursively goes through the subdirectories of d
++dirs=files(isdir); % select only directory entries from the current listing
++for i=1:length(dirs)
++	dirname=dirs(i).name;
++	if ~strcmp(dirname,'.')    & ...
++		~strcmp(dirname,'..')   & ...
++		~strcmp(dirname,'.svn') & ...
++		~strcmp(dirname,'CVS')  & ...
++		~strncmp(dirname,'@',1) & ... %Method directories not allowed in MATLAB path
++		~strcmp(dirname,'private')    %private directories not allowed in MATLAB path
++
++		p = [p recursivepath(fullfile(d,dirname))];
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/isbasin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/isbasin.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/isbasin.m	(revision 12996)
+@@ -0,0 +1,19 @@
++function isbasin(name)
++%ISBASIN: figure out if a basin name exists.
++%
++%
++%        Usage:  index=isbasin('jks');
++%
++%
++
++
++%First, load basin names:
++load([jplsvn '/projects/ModelData/Names/Names.mat']);
++
++
++%go through names: 
++for i=1:length(names),
++	if ~isempty(strfind(names{i,1},name)),
++		disp(['''' names{i,1} ''' Long:' num2str(names{i,2}) ' Lat:' num2str(names{i,3}) ]);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/plotbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/plotbasins.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/plotbasins.m	(revision 12996)
+@@ -0,0 +1,18 @@
++%display all the domain outlines in a directory
++
++basins=listfiles;
++
++hold on
++for i=1:length(basins), 
++	%check whether this is a .exp file
++	basin=basins{i};
++	if strcmpi(basin(end-3:end),'.exp'),
++
++		contour=expread(basin,0);
++		x=contour(1).x;
++		y=contour(1).y;
++		x0=mean(x); y0=mean(y);
++		text(x0,y0,basin(1:end-4),'Fontsize',14);
++		expdisp(basin);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/showbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/showbasins.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/showbasins.m	(revision 12996)
+@@ -0,0 +1,69 @@
++function showbasins(varargin)
++%SHOWBASINS - return basins that are within the xlim and ylim
++%
++%   Usage:
++%      names=showbasins(options);
++%   Options: 
++%      'unit' default 1
++%      'hemisphere': default +1;
++%      'central_meridian: 45 for Greenland and 0 for Antarctica
++%      'standard_parallel: 70 for Greenland and 71 for Antarctica
++%
++
++%is varargin an options database already?
++if nargin==0,
++	options=pairoptions(varargin{:});
++elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
++	%do nothing to the varargin: 
++	options=varargin{1};
++else
++	%process varargin for options: 
++	options=pairoptions(varargin{:});
++end
++
++
++%recover some options, and set defaults
++unitmultiplier=getfieldvalue(options,'unit',1);
++fontsize=getfieldvalue(options,'fontsize',12);
++hemisphere=getfieldvalue(options,'hemisphere');
++
++if strcmpi(hemisphere,'s'),
++	hemisphere=-1;
++elseif strcmpi(hemisphere,'n'),
++	hemisphere=+1;
++else
++	error('showbasins error message: hemispehre should be either ''n'' or ''s''');
++	end
++
++if hemisphere==+1,
++	central_meridian=getfieldvalue(options,'central_meridian',45);
++	standard_parallel=getfieldvalue(options,'standard_parallel',70);
++else
++	central_meridian=getfieldvalue(options,'central_meridian',0);
++	standard_parallel=getfieldvalue(options,'standard_parallel',71);
++end
++
++%Ok, find basin we are talking about: 
++load([jplsvn '/projects/ModelData/Names/Names.mat']);
++
++%Get xlim and ylim, and convert into lat,long: 
++xlimits=xlim; x0=xlimits(1); x1=xlimits(2);
++ylimits=ylim; y0=ylimits(1); y1=ylimits(2);
++
++%Convert names lat and long into x,y:
++lat=cell2mat(names(:,3));
++long=cell2mat(names(:,2));
++
++%Now, convert lat,long into x,y:
++[x,y]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
++
++%Find  x,y within xlimits and ylimits: 
++locations=find(x>x0 & x<x1 & y>y0 & y<y1);
++
++%Go through locations, and display the names: 
++for i=1:size(locations,1),
++	hold on,
++	plot(x(locations(i)),y(locations(i)),'r.');
++	t=text(x(locations(i)),y(locations(i)),names{locations(i),1}); 
++	set(t,'FontSize',fontsize);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/basinzoom.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/basinzoom.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/basinzoom.m	(revision 12996)
+@@ -0,0 +1,94 @@
++function varargout=basinzoom(varargin)
++%ANTZOOM - zoom on a basin in Antarctica or Greenland.
++%
++%   This function zooms on an existing figure describing Antarctica or Greenland 
++%   The zooming depends on the region name provided as input. 
++%
++%   Usage:
++%      varargout=basinzoom(options)
++
++%recover some options, and set defaults
++
++%is varargin an options database already?
++if nargin==0,
++	options=pairoptions(varargin{:});
++elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
++	%do nothing to the varargin: 
++	options=varargin{1};
++else
++	%process varargin for options: 
++	options=pairoptions(varargin{:});
++end
++
++unitmultiplier=getfieldvalue(options,'unit',NaN);
++basin=getfieldvalue(options,'basin');
++
++if exist(options,'basindelta'),
++
++	basindeltax=getfieldvalue(options,'basindelta',300); 
++	basindeltay=getfieldvalue(options,'basindelta',300); 
++else
++	basindeltax=getfieldvalue(options,'basindeltax',300); 
++	basindeltay=getfieldvalue(options,'basindeltay',300);
++end
++
++%multiply by 1000 to get kms
++basindeltax=basindeltax*1000;
++basindeltay=basindeltay*1000;
++
++%Ok, find basin we are talking about: 
++load([jplsvn() '/projects/ModelData/Names/Names.mat']);
++		
++%Go through names: 
++found=0;
++for i=1:size(names,1),
++	if strcmpi(names{i,1},basin),
++		%ok, we've got the region. Get lat and long: 
++		long=names{i,2};
++		lat=names{i,3};
++		hemisphere=names{i,4};
++		found=1;
++		break;
++	end
++end
++
++if ~found,
++	error(['basinzoom error message: cannot find basin ' basin '. Use isbasin to determine a basin name.']);
++end
++
++if hemisphere==+1,
++	central_meridian=getfieldvalue(options,'central_meridian',45);
++	standard_parallel=getfieldvalue(options,'standard_parallel',70);
++else
++	central_meridian=getfieldvalue(options,'central_meridian',0);
++	standard_parallel=getfieldvalue(options,'standard_parallel',71);
++end
++
++%Transform lat long into x,y: 
++[xc,yc]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
++
++%compute x0,x1 and y0,y1 using basindeltax and basindeltay
++x0=xc-basindeltax/2;
++x1=xc+basindeltax/2;
++y0=yc-basindeltay/2;
++y1=yc+basindeltay/2;
++
++if ~isnan(unitmultiplier)
++	x0=x0*unitmultiplier;
++	x1=x1*unitmultiplier;
++	y0=y0*unitmultiplier;
++	y1=y1*unitmultiplier;
++end
++
++%if output arguments are present, return the limits, 
++%otherwise, set them on the current graphic. 
++if nargout==2,
++	found=1;
++	varargout{1}=[x0 x1];
++	varargout{2}=[y0 y1];
++else
++	xlim([x0 x1]);
++	ylim([y0 y1]);
++	found=1;
++	daspect([1;1;1]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/immerge.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/immerge.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/immerge.m	(revision 12996)
+@@ -0,0 +1,43 @@
++function out = immerge(bg, fg, coef)
++% Creates an image 'out' of same type as bg.
++% 'out' has 'bg' as background, and 'fg' (transparent, 
++% weighted by 'coef') above 'bg'.
++% Useful when one cannot use OpenGL as renderer, but still 
++% wants to have transparency!
++% 'out', 'bg', and 'fg' are RGB images.
++%
++% merged = immerged(bg, fg, coef)
++%	- bg matrix of type double or uint8
++%	- fg matrix of type double or uint8
++%	- coef is a scalar between 0 and 1, or a matrix of 
++%	  such scalars, same size as 'fg' and 'bg' (AlphaData).
++%
++% Suggestions for future development:
++%	- allow to have 'coef' referring to the AlphaMap
++%	- allow 'coef' to take values between 1 and 64.
++%
++% Gauthier Fleutot 28-07-2004
++% fleutotg@esiee.fr
++
++intOutput = 0;	% if we want the output to be of type integer
++
++if ~isa(bg, 'double')
++	bg = double(bg);	% because '-' isn't defined for uint8
++	intOutput = 1;
++end
++if ~isa(fg, 'double')
++	fg = double(fg);	% because '-' isn't defined for uint8
++end
++
++dif = fg-bg;
++
++if size(coef) == [1 1]
++	out = bg + coef.*dif;
++else
++	coef = cat(3,coef,coef,coef);	% extend the coef matric in the 3rd dim.
++	out = bg + coef .* dif;
++end
++
++if intOutput == 1
++	out = uint8(out);
++end
+\ No newline at end of file
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/mean_congrid.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/mean_congrid.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/mean_congrid.m	(revision 12996)
+@@ -0,0 +1,59 @@
++function res=mean_congrid(a,n,choice);
++%MEAN_CONGRID - average the values around a pixel
++%
++%   INPUT a,n,choice, where a is the matrix, and n the size of the area averaged around
++%   one pixel, odd number. choice=1 if the NaN values remain NaN values.
++%
++%   Usage:
++%      res=mean_congrid(a,n,choice)
++
++s=size(a);
++aa=a;
++pos=find(isnan(aa));
++aa(pos)=0;
++
++if (mod(n,2)==0),
++   disp('Cannot rebin, the dimensions of the matrix and n are not compatible');
++   break
++end
++mm=(n-1)/2;
++
++res=zeros(s(1),s(2));
++
++for m=mm+1:s(1)-mm,
++   if mod(m,10)==0,
++      disp(m/s(1)*100);
++   end
++   
++   for l=mm+1:s(2)-mm,
++      
++      
++      if sum(sum(~isnan(a(m-mm:m+mm,l-mm:l+mm))))~=0,
++      res(m,l)=sum(...
++                   sum(...
++                   ~isnan(...
++                          a(m-mm:m+mm,l-mm:l+mm)...
++                          ).*...
++                          aa(m-mm:m+mm,l-mm:l+mm)...
++                       )...
++                   )...
++                   /sum(sum(~isnan(a(m-mm:m+mm,l-mm:l+mm))));
++             else
++                res(m,l)=NaN;
++             end
++             
++   end
++end
++
++if choice==1,
++   pos=find(isnan(a));
++   res(pos)=NaN;
++end
++
++   
++
++
++
++
++
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/im_resize.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/im_resize.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/im_resize.m	(revision 12996)
+@@ -0,0 +1,16 @@
++function newimg = im_resize(img,nw,nh)
++%IM_RESIZE - resize an image using bicubic interpolation
++%
++%   NEWIMG = IM_RESIZE(IMG,NW,NH) Given input image IMG,
++%   returns a new image NEWIMG of size NWxNH.
++%
++% Matthew Dailey 2000
++
++  if nargin ~= 3
++    error('usage: im_resize(image,new_wid,new_ht)');
++  end;
++  
++  ht_scale = size(img,1) / nh;
++  wid_scale = size(img,2) / nw;
++  
++  newimg = interp2(img,(1:nw)*wid_scale,(1:nh)'*ht_scale,'cubic');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/rebin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/rebin.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/rebin.m	(revision 12996)
+@@ -0,0 +1,44 @@
++function res=rebin(a,n);
++%REBIN - average values of a matrix by bloc
++%
++%   INPUT a,n, where a is the matrix, and n the size of the area averaged around
++%   one pixel
++%
++%   Usage:
++%      res=rebin(a,n)
++
++s=size(a);
++
++if (mod(s(1)/n,2)~=0 | mod(s(2)/n,2)~=0),
++   disp('Cannot rebin, the dimensions of the matrix and n are not compatible');
++   break
++end
++
++res=zeros(s(1)/n,s(2)/n);
++
++for m=1:s(1)/n,
++   for l=1:s(2)/n,
++      if sum(sum(~isnan(a((m-1)*n+1:m*n,(l-1)*n+1:l*n))))~=0,
++      res(m,l)=sum(...
++                   sum(...
++                       ~isnan(...
++                              a((m-1)*n+1:m*n,(l-1)*n+1:l*n)...
++                              ).*...
++                       a((m-1)*n+1:m*n,(l-1)*n+1:l*n)...
++                       )...
++                   )...
++                   /sum(sum(~isnan(a((m-1)*n+1:m*n,(l-1)*n+1:l*n))));
++             else
++                res(m,l)=NaN;
++             end
++             
++   end
++end
++
++   
++
++
++
++
++
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.py	(revision 12996)
+@@ -0,0 +1,76 @@
++import socket
++import platform
++import subprocess
++import os
++import shutil
++from MatlabFuncs import *
++
++def scpin(host, login,port,path, packages):
++	"""
++	SCPIN get packages from host, using scp on unix, and pscp on windows
++ 
++	   usage: scpin(host,packages,path)
++	"""
++
++	#first get hostname
++	hostname=socket.gethostname().lower().split('.')[0]
++
++	#first be sure packages are not in the current directory, this could conflict with pscp on windows. 
++	#remove warnings in case the files do not exist
++	for package in packages:
++		try:
++			os.remove(package)
++		except OSError as e:
++			pass
++
++	#if hostname and host are the same, do a simple copy
++	if strcmpi(hostname,host):
++
++		for package in packages:
++			try:
++				shutil.copy(os.path.join(path,package),os.getcwd())    #keep going, even if success=0
++			except OSError as e:
++				pass
++
++	else:
++
++		if 'Windows' in platform.system():
++			#use the putty project pscp.exe: it should be in the path.
++		
++			#get ISSM_DIR variable
++			if 'ISSM_DIR_WIN' in os.environ:
++				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
++			else:
++				raise OSError("scpin error message: could not find ISSM_DIR_WIN environment variable.")
++
++			username=raw_input('Username: (quoted string) ')
++			key=raw_input('Key: (quoted string) ')
++
++			for package in packages:
++				try:
++					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s:%s %s' % (ISSM_DIR,username,key,host,os.path.join(path,package),os.getcwd()),shell=True)
++				except CalledProcessError as e:
++					raise CalledProcessError("scpin error message: could not call putty pscp.")
++
++		else:
++			#just use standard unix scp
++			#string to copy multiple files using scp: 
++			if len(packages)==1:
++				string=packages[0]
++			else:
++				string='{'
++				for package in packages:
++					string+=packages[i]+','
++				string=string[:-1]+'}'
++
++
++			if port:
++				subprocess.call('scp -P %d %s@localhost:%s %s' % (port,login,os.path.join(path,string),os.getcwd),shell=True)
++			else:
++				subprocess.call('scp %s@%s:%s %s' % (login,host,os.path.join(path,string),os.getcwd),shell=True)
++		
++			#check scp worked
++			for package in packages:
++				if not os.path.exists(os.path.join('.',package)):
++					raise OSError("scpin error message: could not call scp on *nix system.")
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.py	(revision 12996)
+@@ -0,0 +1,58 @@
++import socket
++import platform
++import subprocess
++import os
++import shutil
++from MatlabFuncs import *
++
++def issmscpout(host,path,login,port,packages):
++	"""
++	SCPOUT send packages to a host, using scp on unix, and pscp on windows
++ 
++	   usage: scpout(host,path,packages)
++	"""
++
++	#get hostname
++	hostname=socket.gethostname().lower().split('.')[0]
++
++	#if hostname and host are the same, do a simple copy
++
++	if strcmpi(host,hostname):
++		for package in packages:
++			here=os.getcwd()
++			os.chdir(path)
++			shutil.rmtree(package)
++			subprocess.call('ln -s %s %s' % (os.path.join(here,package),path),shell=True)
++			os.chdir(here)
++	else:
++		if 'Windows' in platform.system():
++			#use the putty project pscp.exe: it should be in the path.
++		
++			#get ISSM_DIR variable
++			if 'ISSM_DIR_WIN' in os.environ:
++				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
++			else:
++				raise OSError("scpout error message: could not find ISSM_DIR_WIN environment variable.")
++
++			username=raw_input('Username: (quoted string) ')
++			key=raw_input('Key: (quoted string) ')
++
++			for package in packages:
++				try:
++					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s %s:%s' % (ISSM_DIR,username,key,package,host,path),shell=True)
++				except CalledProcessError as e:
++					raise CalledProcessError("scpout error message: could not call putty pscp.")
++
++		else:
++			#just use standard unix scp
++			#create string of packages being sent
++			string=''
++			for package in packages:
++				string+=' '+package
++			string+=' '
++		
++			if port:
++				subprocess.call('scp -P %d %s %s@localhost:%s' % (port,string,login,path),shell=True)
++			else:
++				subprocess.call('scp %s %s@%s:%s' % (string,login,host,path),shell=True)
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.py	(revision 12996)
+@@ -0,0 +1,42 @@
++import socket
++import platform
++import subprocess
++import os
++from MatlabFuncs import *
++
++def issmssh(host,login,port,command):
++	"""
++	ISSMSSH - wrapper for OS independent ssh command.
++ 
++	   usage: 
++	      issmssh(host,command)
++	"""
++
++	#first get hostname 
++	hostname=socket.gethostname().lower().split('.')[0]
++
++	#if same as host, just run the command. 
++	if strcmpi(host,hostname):
++		subprocess.call(command,shell=True)
++	else:
++		if 'Windows' in platform.system():
++			#use the putty project plink.exe: it should be in the path.
++		
++			#get ISSM_DIR variable
++			if 'ISSM_DIR_WIN' in os.environ:
++				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
++			else:
++				raise OSError("issmssh error message: could not find ISSM_DIR_WIN environment variable.")
++
++			username=raw_input('Username: (quoted string) ')
++			key=raw_input('Key: (quoted string) ')
++
++			subprocess.call('%s/externalpackages/ssh/plink.exe -ssh -l "%s" -pw "%s" %s "%s"' % (ISSM_DIR,username,key,host,command),shell=True);
++
++		else:
++			#just use standard unix ssh
++			if port:
++				subprocess.call('ssh -l %s -p %d localhost "%s"' % (login,port,command),shell=True)
++			else:
++				subprocess.call('ssh -l %s %s "%s"' % (login,host,command),shell=True)
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.py	(revision 12996)
+@@ -0,0 +1,37 @@
++import os
++from issmdir import *
++from MatlabFuncs import *
++
++def ispetsc():
++	"""
++	ISPETSC - figure out if PETSC package was compiled with ISSM
++ 
++	   Usage:
++	      flag=ispetsc();
++	"""
++
++	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
++	if not os.path.exists(configfile):
++		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
++
++	#go through the file, and recover the line we want
++	flag=2
++	try:
++		fid=open(configfile,'r')
++	except IOError as e:
++		raise IOError("could not open file: '%s'" % configfile)
++
++	for tline in fid:
++		if strncmp(tline,'/* #undef _HAVE_PETSC_ */',25):
++			flag=0
++			break
++		if  strncmp(tline,'#define _HAVE_PETSC_',20):
++			flag=1
++			break
++
++	fid.close()
++	if flag==2:
++		raise RuntimeError("could not determine whether PETSC was or was not compiled.")
++
++	return flag
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.m	(revision 12996)
+@@ -0,0 +1,78 @@
++function scpin(host, login,port,path, packages)
++%SCPIN get packages from host, using scp on unix, and pscp on windows
++%
++%   usage: scpin(host,packages,path)
++%
++%
++
++%first get hostname
++hostname=oshostname();
++
++%first be sure packages are not in the current directory, this could conflict with pscp on windows. 
++%get initial warning mode
++state=warning('query', 'all');
++%remove warnings in case the files do not exist
++warning off
++for i=1:numel(packages),
++	delete(packages{i});
++end
++%back to initial warning state
++warning(state);
++
++%if hostname and host are the same, do a simple copy
++if strcmpi(hostname,host),
++
++    for i=1:numel(packages),
++		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
++	end
++
++else
++
++	if ispc,
++		%use the putty project pscp.exe: it should be in the path.
++		
++		%get ISSM_DIR variable
++		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
++		if status, 
++			error('scpin error message: could not find ISSM_DIR_WIN environment variable');
++		end
++		ISSM_DIR=ISSM_DIR(2:end-2);
++
++		username=input('Username: (quoted string) ');
++		key=input('Key: (quoted string) ');
++
++		for i=1:numel(packages),
++			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' host ':' path '/' packages{i} ' ./']);
++			if status, 
++				error('scpin error message: could not call putty pscp');
++			end
++		end
++
++	else
++		%just use standard unix scp
++		%string to copy multiple files using scp: 
++		if numel(packages)==1,
++			string=packages{1};
++		else
++			string='\{';
++			for i=1:numel(packages)-1,
++				string=[string packages{i} ','];
++			end
++			string=[string packages{end} '\}'];
++		end
++
++
++		if port,
++			eval(['!scp -P ' num2str(port) ' ' login '@localhost:' path '/' string ' ./']);
++		else
++			eval(['!scp ' login '@' host ':' path '/' string ' ./']);
++		end
++		
++		%check scp worked
++		for i=1:numel(packages),
++			if ~exist(['./' packages{i}]),
++				error('scpin error message: could not call scp on *nix system');
++			end
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.py	(revision 12996)
+@@ -0,0 +1,37 @@
++import os
++from issmdir import *
++from MatlabFuncs import *
++
++def ismumps():
++	"""
++	ISMUMPS - figure out if MUMPS package was compiled with ISSM
++ 
++	   Usage:
++	      flag=ismumps();
++	"""
++
++	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
++	if not os.path.exists(configfile):
++		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
++
++	#go through the file, and recover the line we want
++	flag=2
++	try:
++		fid=open(configfile,'r')
++	except IOError as e:
++		raise IOError("could not open file: '%s'" % configfile)
++
++	for tline in fid:
++		if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25):
++			flag=0
++			break
++		if  strncmp(tline,'#define _HAVE_MUMPS_',20):
++			flag=1
++			break
++
++	fid.close()
++	if flag==2:
++		raise RuntimeError("could not determine whether MUMPS was or was not compiled.")
++
++	return flag
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.m	(revision 12996)
+@@ -0,0 +1,57 @@
++function issmscpout(host,path,login,port,packages)
++%SCPOUT send packages to a host, using scp on unix, and pscp on windows
++%
++%   usage: scpout(host,path,packages)
++%
++%
++
++%get hostname
++hostname=oshostname();
++
++%if hostname and host are the same, do a simple copy
++
++if strcmpi(host,hostname),
++	for i=1:numel(packages),
++		here=pwd;
++		eval(['cd ' path])
++		system(['rm -rf ' packages{i} ]);
++		system(['ln -s ' here '/' packages{i} ' .']);
++		eval(['cd ' here]);
++	end
++else 
++	if ispc,
++		%use the putty project pscp.exe: it should be in the path.
++		
++		%get ISSM_DIR variable
++		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
++		if status, 
++			error('scpout error message: could not find ISSM_DIR_WIN environment variable');
++		end
++		ISSM_DIR=ISSM_DIR(2:end-2);
++
++		username=input('Username: (quoted string) ');
++		key=input('Key: (quoted string) ');
++
++		for i=1:numel(packages),
++			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' packages{i} ' ' host ':' path]);
++			if status, 
++				error('scpout error message: could not call putty pscp');
++			end
++		end
++
++	else
++		%just use standard unix scp
++		%create string of packages being sent
++		string='';
++		for i=1:numel(packages),
++			string=[string ' ' packages{i}];
++		end
++		string=[string ' '];
++		
++		if port,
++			eval(['!scp -P ' num2str(port) ' ' string ' ' login '@localhost:' path]);
++		else
++			eval(['!scp ' string ' ' login '@' host ':' path]);
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.m	(revision 12996)
+@@ -0,0 +1,37 @@
++function issmssh(host,login,port,command)
++%ISSMSSH - wrapper for OS independent ssh command.
++%
++%   usage: 
++%      issmssh(host,command)
++
++%first get hostname 
++hostname=oshostname();
++
++%if same as host, just run the command. 
++if strcmpi(host,hostname),
++	system(command);
++else
++	if ispc,
++		%use the putty project plink.exe: it should be in the path.
++		
++		%get ISSM_DIR variable
++		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
++		if status, 
++			error('issmssh error message: could not find ISSM_DIR_WIN environment variable');
++		end
++		ISSM_DIR=ISSM_DIR(2:end-2);
++
++		username=input('Username: (quoted string) ');
++		key=input('Key: (quoted string) ');
++
++		system([ISSM_DIR '/externalpackages/ssh/plink.exe -ssh -l "' username '" -pw "' key '" ' host ' "' command '"']);
++
++	else
++		%just use standard unix ssh
++		if port,
++			eval(['!ssh -l ' login ' -p ' num2str(port) ' localhost "' command '"']);
++		else
++			eval(['!ssh -l ' login ' ' host ' "' command '"']);
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.m	(revision 12996)
+@@ -0,0 +1,33 @@
++function flag=ispetsc()
++%ISPETSC - figure out if PETSC package was compiled with ISSM
++%
++%   Usage:
++%       flag=ispetsc();
++
++
++configfile=[issmdir() '/bin/config.h']; %should find it in the install target
++if ~exist(configfile,'file'),
++	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
++end
++
++%go through the file, and recover the line we want
++flag=2;
++fid=fopen(configfile,'r');
++if(fid==-1), error(['could not open file: ' configfile]); end
++
++while(true),
++	tline=fgets(fid);
++	if ~ischar(tline), break, end
++	if strncmp(tline,'/* #undef _HAVE_PETSC_ */',25),
++		flag=0;
++		break;
++	end
++	if  strncmp(tline,'#define _HAVE_PETSC_',20),
++		flag=1;
++		break;
++	end
++end
++fclose(fid);
++if flag==2,
++	error('could not determine whether PETSC was or was not compiled');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfilesparallel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfilesparallel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfilesparallel.m	(revision 12996)
+@@ -0,0 +1,15 @@
++function list=listfilesparallel(rank,numprocs)
++%LISTFILESPARALLEL list files inside a directory, depending on rank  and number of processors running this routine.
++%        this is very OS dependent.
++%
++%   usage: list=listfilesparallel(rank,numprocs);
++%
++%
++%   see also LS DIR LISTFILES
++
++list=listfiles';
++numfiles=numel(list);
++
++%we now have a list, split it between all the processors.
++[i1,i2]=parallelrange(rank,numprocs,numfiles);
++list=list(i1:i2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.m	(revision 12996)
+@@ -0,0 +1,33 @@
++function flag=ismumps()
++%ISMUMPS - figure out if MUMPS package was compiled with ISSM
++%
++%   Usage:
++%       flag=ismumps();
++
++
++configfile=[issmdir() '/bin/config.h']; %should find it in the install target
++if ~exist(configfile,'file'),
++	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
++end
++
++%go through the file, and recover the line we want
++flag=2;
++fid=fopen(configfile,'r');
++if(fid==-1), error(['could not open file: ' configfile]); end
++
++while(true),
++	tline=fgets(fid);
++	if ~ischar(tline), break, end
++	if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25),
++		flag=0;
++		break;
++	end
++	if  strncmp(tline,'#define _HAVE_MUMPS_',20),
++		flag=1;
++		break;
++	end
++end
++fclose(fid);
++if flag==2,
++	error('could not determine whether MUMPS was or was not compiled');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfiles.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfiles.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfiles.m	(revision 12996)
+@@ -0,0 +1,22 @@
++function list=listfiles()
++%LISTFILES list files inside a directory
++%        this is very OS dependent.
++%
++%   usage: list=listfiles;
++%
++%
++%   see also LS DIR
++
++%use dir, as it seems to act OS independent
++
++first_list=dir;
++list={};
++
++for i=1:numel(first_list),
++	if (  ~strcmpi(first_list(i).name,'.') &...
++			~strcmpi(first_list(i).name,'..') &...
++			~strcmpi(first_list(i).name,'NightlyRun') &...
++			~strcmpi(first_list(i).name,'.svn')),
++		list{end+1}=first_list(i).name;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpin.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpin.m	(revision 12996)
+@@ -0,0 +1,48 @@
++function issmbbftpin(host, login,port,numstreams,path, packages)
++%BBFTPIN get packages from host, using bbftp. assuming unix system here.
++%
++%   usage: scpin(host,packages,path)
++%
++%
++
++%first get hostname
++hostname=oshostname();
++
++%first be sure packages are not in the current directory, this could conflict with pscp on windows. 
++%get initial warning mode
++state=warning('query', 'all');
++%remove warnings in case the files do not exist
++warning off
++for i=1:numel(packages),
++	delete(packages{i});
++end
++%back to initial warning state
++warning(state);
++
++%if hostname and host are the same, do a simple copy
++if strcmpi(hostname,host),
++
++    for i=1:numel(packages),
++		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
++	end
++
++else
++
++	%build a string of the type: bbftp -s -u elarour -e 'setnbstream 8; cd /nobackupp10/elarour/Testing/Interactive3/; get Antarctica.outbin' pfe1.nas.nasa.gov
++	command=['!bbftp -s -V -u ' login ' -e ''setnbstream 8; cd ' path '; '];
++	for i=1:length(packages),
++		command=[command 'get ' packages{i} ';'];
++	end
++	command=[command '''  pfe1.nas.nasa.gov'];
++	
++	eval(command);
++
++	%check bbftp worked
++	for i=1:numel(packages),
++		if ~exist(['./' packages{i}]),
++			error('scpin error message: could not call scp on *nix system');
++		end
++	end
++
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/oshostname.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/oshostname.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/oshostname.m	(revision 12996)
+@@ -0,0 +1,22 @@
++function hostname=oshostname()
++%OSHOSTNAME figure out hostname, irrespective of os type
++%
++%   usage: hostname=oshostname();
++%
++%
++
++if ispc,
++	[status,hostname]=system('hostname | sed ''s/-//g''');hostname=hostname(1:end-1);
++
++	if status, 
++		error('oshostname error message: could not run hostname command on windows os');
++	end
++
++else
++	[status,hostname]=system(['hostname -s | sed ''s/-//g''']);
++	if status, 
++		error('oshostname error message: could not run hostname command on *nix os');
++	end
++	hostname=hostname(1:end-1);
++	hostname=ddewhite(hostname);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpout.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpout.m	(revision 12996)
+@@ -0,0 +1,30 @@
++function issmbbftpout(host,path,login,port,numstreams,packages)
++%BBFTPOUT put packages onto host, using bbftp. assuming unix system here.
++%
++%   usage: bbftpout(host,path,login,port,numstream,packages)
++%
++%
++
++%get hostname
++hostname=oshostname();
++
++%if hostname and host are the same, do a simple copy
++if strcmpi(host,hostname),
++	for i=1:numel(packages),
++		here=pwd;
++		eval(['cd ' path])
++		system(['rm -rf ' packages{i} ]);
++		system(['ln -s ' here '/' packages{i} ' .']);
++		eval(['cd ' here]);
++	end
++else 
++	
++	%build a string of the type: bbftp -s -u elarour -e 'setnbstream 8; cd /nobackupp10/elarour/Testing/Interactive3/; put Antarctica.tar.gz' pfe1.nas.nasa.gov
++	command=['!bbftp -s -V -u ' login ' -e ''setnbstream 8; cd ' path '; ']
++	for i=1:length(packages),
++		command=[command 'put ' packages{i} ';'];
++	end
++	command=[command '''  pfe1.nas.nasa.gov'];
++	
++	eval(command);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.py	(revision 12996)
+@@ -0,0 +1,25 @@
++#! /usr/bin/env python
++def parallelrange(rank,numprocs,globalsize):
++	"""
++	PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
++ 
++	   Usage: 
++	      i1,i2=parallelrange(rank,numprocs,globalsize)
++	"""
++
++	#We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
++	num_local_rows=[int(globalsize/numprocs) for i in xrange(numprocs)]
++
++	#There may be some rows left. Distribute evenly.
++	row_rest=globalsize - numprocs*int(globalsize/numprocs)
++
++	for i in xrange(row_rest):
++		num_local_rows[i]=num_local_rows[i]+1
++
++	i1=0
++	for i in xrange(rank-1):
++		i1+=num_local_rows[i]
++	i2=i1+num_local_rows[rank-1]-1
++
++	return i1,i2
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/QueueRequirements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/QueueRequirements.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/QueueRequirements.m	(revision 12996)
+@@ -0,0 +1,35 @@
++function QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,queue,np,time)
++%QUEUEREQUIREMENTS - queue requirements in time, number of cpus, by name of queue.
++%
++%   Usage: 
++%      QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,np,time)
++
++%Ok, go through requirements for current queue:
++index=ismemberi(queue,available_queues);
++if  ~index,
++	%ok, either we a generic cluster, with 'none' queue, or we could not find the queue reqruirements
++	if strcmpi(available_queues{1},'none'),
++		%reset index to 1, so we can fish the requirements
++		index=1;
++	else
++		string=available_queues{1};
++		for i=2:length(available_queues),
++			string=[string ' ' available_queues{i}];
++		end
++		error(['QueueRequirements error message: availables queues are ' string]);
++	end
++end
++
++%check on time requirements
++rtime=queue_requirements_time(index);
++if time<=0,
++	error('QueueRequirements: time should be a positive number');
++end
++if time>rtime,
++	error(['QueueRequirements: time should be < ' num2str(rtime) ' for queue: ' queue]);
++end
++
++%check on np requirements
++if np<=0,
++	error('QueueRequirements: np should be a positive number');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.m	(revision 12996)
+@@ -0,0 +1,23 @@
++function [i1,i2]=parallelrange(rank,numprocs,globalsize)
++%PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
++%
++%   Usage: 
++%      [i1,i1]=parallelrange(rank,numprocs,globalsize)
++
++num_local_rows=zeros(numprocs,1);
++
++for i=1:numprocs,
++	%we use floor. we under distribute rows. The rows left  are then redistributed, therefore resulting in a more even distribution.
++	num_local_rows(i)=floor(globalsize/numprocs);
++end
++
++
++%There may be some rows left. Distribute evenly.
++row_rest=globalsize - numprocs*floor(globalsize/numprocs);
++
++for i=1:row_rest,
++	num_local_rows(i)=num_local_rows(i)+1;
++end
++
++i1=sum(num_local_rows(1:rank-1))+1;
++i2=i1+num_local_rows(rank)-1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2expg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2expg.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2expg.m	(revision 12996)
+@@ -0,0 +1,13 @@
++function kml2expg(filename)
++
++	[path,name,ext]=fileparts(filename);
++
++	if strcmpi(ext,'.kmz'),
++		eval(['!unzip ' filename]);
++		eval(['!mv doc.kml ' name '.kml']);
++		kml2exp([name '.kml'],[name '.exp']);
++		expll2xy([name '.exp'],1);
++	end
++
++	kml2exp([name '.kml'],[name '.exp']);
++	expll2xy([name '.exp'],1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/exp2kml.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/exp2kml.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/exp2kml.m	(revision 12996)
+@@ -0,0 +1,19 @@
++function exp2kml(input,output)
++%EXP2KML: transform Argus exp file to kml
++%
++% Usage:    exp2kml('temp.exp','temp2.kml')
++%
++%
++
++
++%First, read exp file
++domain=expread(input);
++
++
++%then transform: 
++string=ge_plot(domain.x,domain.y,'name',domain.name);
++
++%open kml file for writing: 
++fid=fopen(output,'w');
++fprintf(fid,'%s',string);
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2exp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2exp.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2exp.m	(revision 12996)
+@@ -0,0 +1,29 @@
++function kml2exp(input,output)
++%KML2EXP: transform kml file Argus exp file.
++%
++% Usage:    kmltoexp('temp.kml','temp2.exp')
++%
++%
++
++
++
++
++%First, read polygon kml file.
++structure=kml_shapefile(input);
++	
++%create exp file: 
++domain=struct();
++for i=1:length(structure),
++
++	if isfield(structure,'name'),
++		domain(end+1).name=structure(i).name;
++	else
++		domain(end+1).name='NaN';
++	end
++
++	domain(end).density=1;
++	domain(end).x=structure(i).X;
++	domain(end).y=structure(i).Y;
++end
++domain=domain(2:end);
++expwrite(domain,output);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetMarineIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetMarineIceSheetBC.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetMarineIceSheetBC.m	(revision 12996)
+@@ -0,0 +1,107 @@
++function md=SetMarineIceSheetBC(md,varargin)
++%SETICEMARINESHEETBC - Create the boundary conditions for diagnostic and thermal models for a  Marine Ice Sheet with Ice Front
++%
++%   Neumann BC are used on the ice front (an ARGUS contour around the ice front
++%   can be given in input, or it will be deduced as onfloatingice & onboundary)
++%   Dirichlet BC are used elsewhere for diagnostic
++%
++%   Usage:
++%      md=SetMarineIceSheetBC(md,icefrontfile)
++%      md=SetMarineIceSheetBC(md)
++%
++%   Example:
++%      md=SetMarineIceSheetBC(md,'Front.exp')
++%      md=SetMarineIceSheetBC(md)
++%
++%   See also: SETICESHELFBC, SETMARINEICESHEETBC
++
++%node on Dirichlet (boundary and ~icefront)
++if nargin==2,
++	%User provided Front.exp, use it
++	icefrontfile=varargin{1};
++	if ~exist(icefrontfile)
++		error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']);
++	end
++	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2);
++	vertexonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
++else
++	%Guess where the ice front is
++	vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
++	vertexonfloatingice(md.mesh.elements(find(md.mask.elementonfloatingice),:))=1;
++	vertexonicefront=double(md.mesh.vertexonboundary & vertexonfloatingice);
++end
++pos=find(md.mesh.vertexonboundary & ~vertexonicefront);
++if isempty(pos),
++	warning('SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually')
++end
++md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvx(pos)=0;
++md.diagnostic.spcvy(pos)=0;
++md.diagnostic.spcvz(pos)=0;
++md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
++
++%Dirichlet Values
++if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
++	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
++	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
++	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
++else
++	disp('      boundary conditions for diagnostic model: spc set as zero');
++end
++
++md.hydrology.spcwatercolumn=zeros(md.mesh.numberofvertices,2);
++pos=find(md.mesh.vertexonboundary); 
++md.hydrology.spcwatercolumn(pos,1)=1;
++
++%segment on Neumann (Ice Front)
++pos=find(vertexonicefront(md.mesh.segments(:,1)) | vertexonicefront(md.mesh.segments(:,2)));
++if (md.mesh.dimension==2)
++	pressureload=md.mesh.segments(pos,:);
++elseif md.mesh.dimension==3
++	pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
++	pressureload=[];
++	for i=1:md.mesh.numberoflayers-1,
++		pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
++	end
++end
++
++%Add water or air enum depending on the element
++pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))+ 0*md.mask.elementongroundedice(pressureload(:,end))];
++
++%plug onto model
++md.diagnostic.icefront=pressureload;
++
++
++%Create zeros basalforcings and surfaceforcings
++if (isnan(md.surfaceforcings.precipitation)& (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
++	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
++	disp('      no surfaceforcings.precipitation specified: values set as zero');
++end
++if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
++	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
++	disp('      no surfaceforcings.mass_balance specified: values set as zero');
++end
++if isnan(md.basalforcings.melting_rate),
++	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no basalforcings.melting_rate specified: values set as zero');
++end
++if isnan(md.balancethickness.thickening_rate),
++	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no balancethickness.thickening_rate specified: values set as zero');
++end
++
++md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++
++if (length(md.initialization.temperature)==md.mesh.numberofvertices),
++	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
++	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
++	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
++		md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1);
++		md.basalforcings.geothermalflux(find(md.mask.vertexongroundedice))=50*10^-3; %50mW/m2
++	end
++else
++	disp('      no thermal boundary conditions created: no observed temperature found');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceSheetBC.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceSheetBC.m	(revision 12996)
+@@ -0,0 +1,64 @@
++function md=SetIceSheetBC(md)
++%SETICESHEETBC - Create the boundary conditions for diagnostic and thermal models for an IceSheet with no Ice Front
++%
++%   Usage:
++%      md=SetIceSheetBC(md)
++%
++%   See also: SETICESHELFBC, SETMARINEICESHEETBC
++
++%node on Dirichlet
++pos=find(md.mesh.vertexonboundary);
++md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvx(pos)=0;
++md.diagnostic.spcvy(pos)=0;
++md.diagnostic.spcvz(pos)=0;
++md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
++
++%Dirichlet Values
++if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
++	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
++	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
++	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
++else
++	disp('      boundary conditions for diagnostic model: spc set as zero');
++end
++
++%segment on neumann (Ice Front) -> none
++if (md.mesh.dimension==2)
++	md.diagnostic.icefront=zeros(0,4);
++else
++	md.diagnostic.icefront=zeros(0,6);
++end
++
++%Create zeros basal melting rate and surface mass balance if not specified
++if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
++	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
++	disp('      no surfaceforcings.precipitation specified: values set as zero');
++end
++if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
++	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
++	disp('      no surfaceforcings.mass_balance specified: values set as zero');
++end
++if isnan(md.basalforcings.melting_rate),
++	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no basalforcings.melting_rate specified: values set as zero');
++end
++if isnan(md.balancethickness.thickening_rate),
++	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no balancethickness.thickening_rate specified: values set as zero');
++end
++
++md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++
++if (length(md.initialization.temperature)==md.mesh.numberofvertices),
++	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
++	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
++	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
++		md.basalforcings.geothermalflux=50*10^-3*ones(md.mesh.numberofvertices,1); %50 mW/m^2
++	end
++else
++	disp('      no thermal boundary conditions created: no observed temperature found');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.py	(revision 12996)
+@@ -0,0 +1,98 @@
++import os
++import numpy
++
++def SetIceShelfBC(md,icefrontfile=''):
++	"""
++	SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
++
++	   Neumann BC are used on the ice front (an ANRGUS contour around the ice front
++	   must be given in input)
++	   Dirichlet BC are used elsewhere for diagnostic
++
++	   Usage:
++	      md=SetIceShelfBC(md,varargin)
++
++	   Example:
++	      md=SetIceShelfBC(md);
++	      md=SetIceShelfBC(md,'Front.exp');
++
++	   See also: SETICESHEETBC, SETMARINEICESHEETBC
++	"""
++
++	#node on Dirichlet (boundary and ~icefront)
++	if icefrontfile:
++		if not os.path.exists(icefrontfile):
++			raise IOError("SetIceShelfBC error message: ice front file '%s' not found." % icefrontfile)
++		nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2)
++		nodeonicefront=double(md.mesh.vertexonboundary and nodeinsideicefront)
++	else:
++		nodeonicefront=numpy.zeros(md.mesh.numberofvertices)
++
++#	pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
++	pos=[i for i,(vob,noif) in enumerate(zip(md.mesh.vertexonboundary,nodeonicefront)) if vob and not noif]
++	md.diagnostic.spcvx=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.diagnostic.spcvy=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.diagnostic.spcvz=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.diagnostic.spcvx[pos]=0
++	md.diagnostic.spcvy[pos]=0
++	md.diagnostic.spcvz[pos]=0
++	md.diagnostic.referential=float('NaN')*numpy.ones((md.mesh.numberofvertices,6))
++
++	#Dirichlet Values
++	if numpy.size(md.inversion.vx_obs)==md.mesh.numberofvertices and numpy.size(md.inversion.vy_obs)==md.mesh.numberofvertices:
++		print '      boundary conditions for diagnostic model: spc set as observed velocities'
++		md.diagnostic.spcvx[pos]=md.inversion.vx_obs[pos]
++		md.diagnostic.spcvy[pos]=md.inversion.vy_obs[pos]
++	else:
++		print '      boundary conditions for diagnostic model: spc set as zero'
++
++	#segment on Ice Front
++	#segment on Neumann (Ice Front)
++#	pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
++	pos=[i for i,(noif1,noif2) in enumerate(zip(nodeonicefront[md.mesh.segments[:,0].astype('int')-1],nodeonicefront[md.mesh.segments[:,1].astype('int')-1])) if noif1 or noif2]
++	if   md.mesh.dimension==2:
++		pressureload=md.mesh.segments[pos,:]
++	elif md.mesh.dimension==3:
++#		pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
++		pressureload_layer1=numpy.concatenate((md.mesh.segments[pos,0:2],md.mesh.segments[pos,1]+md.mesh.numberofvertices2d,md.mesh.segments[pos,0]+md.mesh.numberofvertices2d,md.mesh.segments[pos,2]),axis=1)
++		pressureload=numpy.zeros((0,5))
++		for i in xrange(1,md.mesh.numberoflayers):
++#			pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
++			pressureload=numpy.concatenate((pressureload,numpy.concatenate((pressureload_layer1[:,0:3]+(i-1)*md.mesh.numberofvertices2d,pressureload_layer1[:,4]+(i-1)*md.mesh.numberofelements2d),axis=1)),axis=0)
++
++	#Add water or air enum depending on the element
++#	pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))];
++	pressureload=numpy.concatenate((pressureload,1*md.mask.elementonfloatingice[pressureload[:,-1].astype('int')-1].reshape((-1,1))),axis=1)
++
++	#plug onto model
++	md.diagnostic.icefront=pressureload
++
++	#Create zeros basalforcings and surfaceforcings
++	if numpy.isnan(md.surfaceforcings.precipitation).all():
++		md.surfaceforcings.precipitation=numpy.zeros(md.mesh.numberofvertices)
++		print '      no surfaceforcings.precipitation specified: values set as zero'
++	if numpy.isnan(md.surfaceforcings.mass_balance).all():
++		md.surfaceforcings.mass_balance=numpy.zeros(md.mesh.numberofvertices)
++		print '      no surfaceforcings.mass_balance specified: values set as zero'
++	if numpy.isnan(md.basalforcings.melting_rate).all():
++		md.basalforcings.melting_rate=numpy.zeros(md.mesh.numberofvertices)
++		print '      no basalforcings.melting_rate specified: values set as zero'
++	if numpy.isnan(md.balancethickness.thickening_rate).all():
++		md.balancethickness.thickening_rate=numpy.zeros(md.mesh.numberofvertices)
++		print '      no balancethickness.thickening_rate specified: values set as zero'
++
++	md.prognostic.spcthickness=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.balancethickness.spcthickness=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++
++	if numpy.size(md.initialization.temperature)==md.mesh.numberofvertices:
++		md.thermal.spctemperature=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++#		pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
++		pos=[i for i,vos in enumerate(md.mesh.vertexonsurface) if vos]
++		md.thermal.spctemperature[pos]=md.initialization.temperature[pos]    # impose observed temperature on surface
++		if not numpy.size(md.basalforcings.geothermalflux)==md.mesh.numberofvertices:
++			md.basalforcings.geothermalflux=numpy.zeros(md.mesh.numberofvertices)
++	else:
++		print '      no thermal boundary conditions created: no observed temperature found'
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.m	(revision 12996)
+@@ -0,0 +1,95 @@
++function md=SetIceShelfBC(md,varargin)
++%SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
++%
++%   Neumann BC are used on the ice front (an ANRGUS contour around the ice front
++%   must be given in input)
++%   Dirichlet BC are used elsewhere for diagnostic
++%
++%   Usage:
++%      md=SetIceShelfBC(md,varargin)
++%
++%   Example:
++%      md=SetIceShelfBC(md);
++%      md=SetIceShelfBC(md,'Front.exp');
++%
++%   See also: SETICESHEETBC, SETMARINEICESHEETBC
++
++%node on Dirichlet (boundary and ~icefront)
++if nargin==2,
++	icefrontfile=varargin{1};
++	if ~exist(icefrontfile), error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']); end
++	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2);
++	nodeonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
++elseif nargin==1,
++	nodeonicefront=zeros(md.mesh.numberofvertices,1);
++else
++	help SetIceShelfBC
++	error('bad usage');
++end
++pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
++md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvx(pos)=0;
++md.diagnostic.spcvy(pos)=0;
++md.diagnostic.spcvz(pos)=0;
++md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
++
++%Dirichlet Values
++if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
++	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
++	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
++	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
++else
++	disp('      boundary conditions for diagnostic model: spc set as zero');
++end
++
++%segment on Ice Front
++%segment on Neumann (Ice Front)
++pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
++if (md.mesh.dimension==2)
++	pressureload=md.mesh.segments(pos,:);
++elseif md.mesh.dimension==3
++	pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
++	pressureload=[];
++	for i=1:md.mesh.numberoflayers-1,
++		pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
++	end
++end
++
++%Add water or air enum depending on the element
++pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))];
++
++%plug onto model
++md.diagnostic.icefront=pressureload;
++
++%Create zeros basalforcings and surfaceforcings
++if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
++	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
++	disp('      no surfaceforcings.precipitation specified: values set as zero');
++end
++if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
++	        md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
++		disp('      no surfaceforcings.mass_balance specified: values set as zero');
++end
++if isnan(md.basalforcings.melting_rate),
++	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no basalforcings.melting_rate specified: values set as zero');
++end
++if isnan(md.balancethickness.thickening_rate),
++	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no balancethickness.thickening_rate specified: values set as zero');
++end
++
++md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++
++if (length(md.initialization.temperature)==md.mesh.numberofvertices),
++	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
++	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
++	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
++		md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1);
++	end
++else
++	disp('      no thermal boundary conditions created: no observed temperature found');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics/cfl_step.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics/cfl_step.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics/cfl_step.m	(revision 12996)
+@@ -0,0 +1,23 @@
++function maxtime=cfl_step(md,vx,vy);
++%CFL_STEP - return the maximum time step for the model in years
++%
++%   Dt < 0.5 / ( u/Dx +v/Dy )
++%
++%   Usage:
++%      maxtime=cfl_step(md,vx,vy);
++%
++%   Example:
++%      dt=cfl_step(md,md.results.DiagnosticSolution.Vx,md.results.DiagnosticSolution.Vy)
++
++%Check length of velocities 
++if size(vx,1)~=md.mesh.numberofvertices & size(vy,1)~=md.mesh.numberofvertices,
++	error('timestpes error message: size of velocity components must be the same as md.mesh.numberofvertices');
++end
++
++index=md.mesh.elements;
++edgex=max(md.mesh.x(index),[],2)-min(md.mesh.x(index),[],2);
++edgey=max(md.mesh.y(index),[],2)-min(md.mesh.y(index),[],2);
++vx=max(abs(vx(index)),[],2);
++vy=max(abs(vy(index)),[],2);
++
++maxtime=1/2*min(1./(vx./edgex+vy./edgey));
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics/cfl_step.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.py	(revision 12996)
+@@ -0,0 +1,18 @@
++import numpy
++
++def isnans(array):
++	"""
++	ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
++
++	   Usage:    isnans(array)
++
++	      See also : ISNAN 
++	"""
++
++	if   isinstance(array,(tuple,list,dict)): 
++		returnvalue=0
++	else:
++		returnvalue=numpy.isnan(array)
++
++	return returnvalue
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/round_ice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/round_ice.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/round_ice.m	(revision 12996)
+@@ -0,0 +1,38 @@
++function new_x=round_ice(x,numnonzeros)
++%ROUND_ICE - rounds up x so that it has only numnonzeros non zero digits
++%
++%   numnonzeros must be an integer larger or equal to 1
++%
++%   Usage:
++%      new_x=round_ice(x,numnonzeros)
++
++%some checks
++if (nargin ~=2 | nargout>1),
++	error('round_ice usage: new_x=round_ice(x,numonzeros)');
++end
++if ~isnumeric(x)
++	error('round_ice error message: x must be a number and numzeros an integer');
++end
++if round(numnonzeros)~=numnonzeros
++	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
++end
++if any(numnonzeros<1)
++	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
++end
++if (length(numnonzeros)~=1 & size(numnonzeros)~=size(x))
++	error('round_ice error message: numnonzeros must be an integer larger or equal to 1 or a list of integers of length length(x)')
++end
++
++%figure out how long x is
++lengthx=ceil(log10(abs(x)));
++
++%if x contains 0, lengthx=-Inf
++lengthx(isinf(lengthx))=1;
++
++%get its sign
++si=sign(x);
++
++%rule out zeros
++new_x=si.*round(abs(x).*10.^(-lengthx+numnonzeros)).*10.^(lengthx-numnonzeros);
++
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.m	(revision 12996)
+@@ -0,0 +1,15 @@
++function returnvalue=isnans(array)
++%ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
++%
++%  Usage:    isnans(array)
++%
++%  See also : ISNAN 
++
++
++if isstruct(array), 
++	returnvalue=0;
++elseif iscell(array)
++	returnvalue=0;
++else
++	returnvalue=isnan(array);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/fixdec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/fixdec.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/fixdec.m	(revision 12996)
+@@ -0,0 +1,41 @@
++function y = fixdec(x, n)
++%FIXDEC -  Round towards zero with a specified number of decimals.
++%
++%   This routine rounds the elements of X to N decimals.
++%
++%   Usage:
++%      y = fixdec(x, n)
++%
++%   Example:
++%      fixdec(10*sqrt(2) + i*pi/10, 4) returns 14.1421 + 0.3141i
++%
++%   See also: FIX, FLOOR, CEIL, ROUND, FIXDIG, ROUNDDEC, ROUNDDIG.
++
++%   Author:      Peter J. Acklam
++%   Time-stamp:  2004-09-22 20:08:10 +0200
++%   E-mail:      pjacklam@online.no
++%   URL:         http://home.online.no/~pjacklam
++
++   % Check number of input arguments.
++   error(nargchk(2, 2, nargin));
++
++   % Quick exit if either argument is empty.
++   if (isempty(x) |isempty(n))
++      y = [];
++      return
++   end
++
++   % Get size of input arguments.
++   size_x   = size(x);
++   size_n   = size(n);
++   scalar_x = all(size_x == 1);           % True if x is a scalar.
++   scalar_n = all(size_n == 1);           % True if n is a scalar.
++
++   % Check size of input arguments.
++   if ~scalar_x & ~scalar_n & ~isequal(size_x, size_n)
++      error(['When both arguments are non-scalars they must have' ...
++             ' the same size']);
++   end
++
++   f = 10.^n;
++   y = fix(x .* f) ./ f;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.m	(revision 12996)
+@@ -0,0 +1,57 @@
++function flag=FlagElements(md,region),
++%FLAGELEMENTS - flag the elements in an region
++%
++%   The region can be given with an exp file, a list of elements.
++%
++%   Usage: 
++%      flag=FlagElements(md,region);
++%
++%   Example:
++%      flag=FlagElements(md,'all');
++%      flag=FlagElements(md,'');
++%      flag=FlagElements(md,'Domain.exp');
++%      flag=FlagElements(md,'~Domain.exp');
++%      flag=FlagElements(md,md.mask.elementongroundedice);
++
++	if ischar(region),
++		if isempty(region),
++			flag=zeros(md.mesh.numberofelements,1);
++			invert=0;
++		elseif strcmpi(region,'all')
++			flag=ones(md.mesh.numberofelements,1);
++			invert=0;
++		else
++			%make sure that we actually don't want the elements outside the domain outline!
++			if strcmpi(region(1),'~'),
++				region=region(2:length(region));
++				invert=1;
++			else
++				invert=0;
++			end
++
++			%does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
++			if ~exist(region,'file'),
++				if (length(region)>3 & ~strcmp(region(end-3),'.exp')),
++					error(['Error: File ' region ' not found!']);
++				end
++				[xlim,ylim]=basinzoom('basin',region);
++				flag_nodes=double(md.mesh.x<xlim(2) & md.mesh.x>xlim(1) &  md.mesh.y<ylim(2) & md.mesh.y>ylim(1));
++				flag=prod(flag_nodes(md.mesh.elements),2);
++			else
++				%ok, flag elements
++				flag=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,region,'element',1);
++			end
++		end
++		if invert,
++			flag=~flag;
++		end
++	elseif isfloat(region) | islogical(region),
++		if size(region,1)~=md.mesh.numberofelements,
++			help FlagElements
++			error('Flaglist for region must be of same size as number of elements in model');
++		end
++		flag=region;
++	else
++		error('Invalid region option');
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/find_point.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/find_point.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/find_point.m	(revision 12996)
+@@ -0,0 +1,14 @@
++function f=find_point(tabx,taby,pointx,pointy)
++%FIND_POINT - find closest point
++%
++%   find which point of the list (tabx,taby) is
++%   the closest to (poinx,pointy)
++%
++%   Usage:
++%      f=find_point(tabx,taby,pointx,pointy)
++
++%Compute distance between point and cloud of points
++distance=sqrt((tabx-pointx).^2+(taby-pointy).^2);
++
++%find index of the minimum distance and return the first one only
++f=find(distance==min(min(distance)),1);
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/find_point.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/SegIntersect.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/SegIntersect.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/SegIntersect.m	(revision 12996)
+@@ -0,0 +1,81 @@
++function bool=SegIntersect(seg1,seg2)
++%SEGINTERSECT - test of segments intersection
++%
++%   return 1 if the two segments intersect
++%   seg1=[x1 y1; x2 y2]
++%   seg2=[x1 y1; x2 y2]
++%
++%   Usage:
++%      bool=SegIntersect(seg1,seg2)
++
++bool=1;
++
++xA=seg1(1,1); yA=seg1(1,2);
++xB=seg1(2,1); yB=seg1(2,2);
++xC=seg2(1,1); yC=seg2(1,2);
++xD=seg2(2,1); yD=seg2(2,2);
++
++O2A=[xA;yA]-[xD/2+xC/2;yD/2+yC/2];
++O2B=[xB;yB]-[xD/2+xC/2;yD/2+yC/2];
++O1C=[xC;yC]-[xA/2+xB/2;yB/2+yA/2];
++O1D=[xD;yD]-[xA/2+xB/2;yB/2+yA/2];
++
++n1=[yA-yB;xB-xA]; %normal vector to segA
++n2=[yC-yD;xD-xC]; %normal vectot to segB
++
++test1=n2'*O2A;
++test2=n2'*O2B;
++
++if test1*test2>0
++	bool=0;
++	return;
++end
++
++test3=n1'*O1C;
++test4=n1'*O1D;
++
++if test3*test4>0
++	bool=0;
++	return;
++end
++
++%if colinear
++if test1*test2==0 & test3*test4==0 & det([n1 n2])==0
++
++	%projection on the axis O1O2
++	O2O1=[xA/2+xB/2;yB/2+yA/2]-[xD/2+xC/2;yD/2+yC/2];
++	O1A=O2O1'*(O2A-O2O1);
++	O1B=O2O1'*(O2B-O2O1);
++	O1C=O2O1'*O1C;
++	O1D=O2O1'*O1D;
++	
++	%test if one point is included in the other segment (->bool=1)
++	if (O1C-O1A)*(O1D-O1A)<0
++		bool=1;
++		return;
++	end
++	if (O1C-O1B)*(O1D-O1B)<0
++		bool=1;
++		return;
++	end
++	if (O1A-O1C)*(O1B-O1C)<0
++		bool=1;
++		return;
++	end
++	if (O1A-O1D)*(O1B-O1D)<0
++		bool=1;
++		return;
++	end
++
++	 %test if the 2 segments have the same middle (->bool=1)
++	if O2O1==0
++		bool=1;
++		return;
++	end
++
++	%else
++	bool=0;
++	return;
++
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.py	(revision 12996)
+@@ -0,0 +1,62 @@
++import numpy
++import os
++#from basinzoom import *
++#from ContourToMesh import *
++from MatlabFuncs import *
++
++def FlagElements(md,region):
++	"""
++	FLAGELEMENTS - flag the elements in an region
++
++	   The region can be given with an exp file, a list of elements.
++
++	   Usage: 
++	      flag=FlagElements(md,region);
++
++	   Example:
++	      flag=FlagElements(md,'all');
++	      flag=FlagElements(md,'');
++	      flag=FlagElements(md,'Domain.exp');
++	      flag=FlagElements(md,'~Domain.exp');
++	      flag=FlagElements(md,md.mask.elementongroundedice);
++	"""
++
++	if   isinstance(region,str):
++		if   not region:
++			flag=numpy.zeros(md.mesh.numberofelements,'bool')
++			invert=0
++		elif strcmpi(region,'all'):
++			flag=numpy.ones(md.mesh.numberofelements,'bool')
++			invert=0
++		else:
++			#make sure that we actually don't want the elements outside the domain outline!
++			if strcmpi(region[0],'~'):
++				region=region[1:]
++				invert=1
++			else:
++				invert=0
++
++			#does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
++			if not os.path.exists(region):
++				if len(region)>3 and not strcmp(region[-4:],'.exp'):
++					raise IOError("Error: File 'region' not found!" % region)
++				xlim,ylim=basinzoom('basin',region)
++				flag_nodes=numpy.logical_and(numpy.logical_and(md.mesh.x<xlim[1],md.mesh.x>xlim[0]),numpy.logical_and(md.mesh.y<ylim[1],md.mesh.y>ylim[0])).astype(float)
++				flag=numpy.prod(flag_nodes[md.mesh.elements],axis=1)
++			else:
++				#ok, flag elements
++				flag=ContourToMesh(md.mesh.elements[:,0:3],md.mesh.x,md.mesh.y,region,'element',1)
++
++		if invert:
++			flag=numpy.logical_not(flag)
++
++	elif isinstance(region,numpy.nparray) or isinstance(region,bool):
++		if not numpy.size(region,0)==md.mesh.numberofelements:
++			raise TypeError("Flaglist for region must be of same size as number of elements in model.")
++		flag=region
++
++	else:
++		raise TypeError("Invalid region option")
++
++	return flag
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/ecco32issm.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/ecco32issm.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/ecco32issm.m	(revision 12996)
+@@ -0,0 +1,8 @@
++function nodefield=ecco32issm(field,transition,xecco3,yecco3)
++
++	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
++	nodefieldlinear=zeros(length(xecco3linear),1);
++	nodefieldlinear(transition(:,1))=field(transition(:,2));
++	nodefield=xecco3;
++	nodefield(:)=nodefieldlinear;
++	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/issm2ecco3.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/issm2ecco3.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/issm2ecco3.m	(revision 12996)
+@@ -0,0 +1,8 @@
++function nodefield=issm2ecco3(field,transition,xecco3,yecco3)
++
++	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
++	nodefieldlinear=zeros(length(xecco3linear),1);
++	nodefieldlinear(transition(:,1))=field(transition(:,2));
++	nodefield=xecco3;
++	nodefield(:)=nodefieldlinear;
++	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expremovestraightsegments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expremovestraightsegments.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expremovestraightsegments.m	(revision 12996)
+@@ -0,0 +1,31 @@
++function expremovestraightsegments(newfilename,filename,cutoff)
++%EXPREMOVESTRAIGHTSEGMENTS:  remove straight segments connecting contours.
++%
++% Usage: expremovestraightsegments('argus.exp',100); 
++%
++%
++
++a=expread(filename,1);
++newcontours=a(1);
++
++for i=1:length(a),
++	contour=a(i);
++	
++	s=sqrt(contour.x.^2+contour.y.^2);
++	d=diff(s);
++	
++	pos=find(abs(d)>cutoff);
++	pos=[0;pos;length(contour.x)];
++
++	for j=1:length(pos)-1,
++
++		newcontour=contour;
++		newcontour.x=contour.x(pos(j)+1:pos(j+1));
++		newcontour.y=contour.y(pos(j)+1:pos(j+1));
++		newcontour.nods=length(newcontour.x);
++		newcontours(end+1)=newcontour;
++	end
++end
++newcontours=newcontours(2:end);
++
++expwrite(newcontours,newfilename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expgen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expgen.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expgen.m	(revision 12996)
+@@ -0,0 +1,47 @@
++function expgen(file_name,contours,close_flag);
++%EXPGEN - create an Argus file from x and y arrays
++%
++%   Create .exp domain outline type out of x,y  coordinates. 
++%   The contour defined by arrays x and y should not be closed. 
++%   Generated domain outline will not be closed, except if close_flag is set to 1.
++%
++%   Usage:
++%      expgen(file_name,contours,close_flag)
++%
++%   See also EXPMASTER, EXPDOC
++
++%Check on inputs
++if((close_flag~=0) & (close_flag~=1)),
++error('close flag must be 0 of 1');
++end
++fid=fopen(file_name,'wt');
++
++for i=1:length(contours),
++	if(length(contours(i).x)~=length(contours(i).y)),
++	error('contours x and y coordinates must be of identical size');
++	end
++
++	%get density for this profile.
++	if isfield(contours,'density'),
++		density=contours(i).density;
++	end
++
++	fprintf(fid,'%s\n','## Name:');
++	fprintf(fid,'%s\n','## Icon:0');
++	fprintf(fid,'%s\n','# Points Count Value');
++	if(close_flag==0),
++	fprintf(fid,'%i %i\n',length(contours(i).x),density);
++	else
++	fprintf(fid,'%i %i\n',length(contours(i).x)+1,density);
++	end
++	fprintf(fid,'%s\n','# X pos Y pos');
++	for j=1:length(contours(i).x),
++	 fprintf(fid,'%f %f\n',contours(i).x(j),contours(i).y(j));
++	end  
++
++	if(close_flag==1),
++	fprintf(fid,'%f %f\n',contours(i).x(1),contours(i).y(1));
++	end
++	fprintf(fid,'%s\n','');
++end
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expxy2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expxy2ll.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expxy2ll.m	(revision 12996)
+@@ -0,0 +1,37 @@
++function expxy2ll(filename,sgn,central_meridian,standard_parallel)  
++%EXPLL2XY: switch exp argus file from lat,long to x,y
++%   Usage:
++%      expxy2ll(filename,sgn,central_meridian,standard_parallel)
++%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
++%                               -1 : south latitude (default is mer=0  lat=71)
++
++
++%Get central_meridian and standard_parallel depending on hemisphere
++if nargin==4,
++	delta = central_meridian;
++	slat  = standard_parallel;
++elseif nargin==2
++	if sgn == 1,
++		delta = 45; slat = 70;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++	elseif sgn==-1,
++		delta = 0;  slat = 71;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
++	else
++		error('Sign should be either +1 or -1');
++	end
++else
++	help expxy2ll
++	error('bad usage');
++end
++
++%read filename: 
++domain=expread(filename);
++
++%change to x,y: 
++for i=1:length(domain),
++	[domain(i).y domain(i).x]= xy2ll(domain(i).x,domain(i).y,sgn,delta,slat); %watch out to swap lat and long
++end
++
++%write back to filename: 
++expwrite(domain,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expll2xy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expll2xy.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expll2xy.m	(revision 12996)
+@@ -0,0 +1,37 @@
++function expll2xy(filename,sgn,central_meridian,standard_parallel)  
++%EXPLL2XY: switch exp argus file from lat,long to x,y
++%   Usage:
++%      expll2xy(filename,sgn,central_meridian,standard_parallel)
++%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
++%                               -1 : south latitude (default is mer=0  lat=71)
++
++
++%Get central_meridian and standard_parallel depending on hemisphere
++if nargin==4,
++	delta = central_meridian;
++	slat  = standard_parallel;
++elseif nargin==2
++	if sgn == 1,
++		delta = 45; slat = 70;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++	elseif sgn==-1,
++		delta = 0;  slat = 71;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
++	else
++		error('Sign should be either +1 or -1');
++	end
++else
++	help expll2xy
++	error('bad usage');
++end
++
++%read filename: 
++domain=expread(filename);
++
++%change to x,y: 
++for i=1:length(domain),
++	[domain(i).x domain(i).y]= ll2xy(domain(i).y,domain(i).x,sgn,delta,slat);
++end
++
++%write back to filename: 
++expwrite(domain,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/clicktoflowline.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/clicktoflowline.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/clicktoflowline.m	(revision 12996)
+@@ -0,0 +1,24 @@
++function clicktoflowline(index,x,y,u,v,filename)
++%CLICKTOFLOWLINE - create a flowline ARGUS file
++%
++%   create a flowline contour file (named 'filename') by clicking
++%   on a velocity field once (velocity must be plotted first)
++%
++%   Usage: 
++%      clicktoflowline(index,x,y,u,v,x0,y0,filename)
++%
++%   Example: 
++%      clicktoflowline(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vx_obs,md.inversion.vy_obs,'flowline.exp')
++
++%Get click position
++[x0,y0]=ginput(1);
++
++%Get flowline
++line=flowlines(index,x,y,u,v,x0,y0,200);
++
++%plot
++hold on
++plot(line.x,line.y,'r-');
++
++%Write argus file
++expwrite(line,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exptool.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exptool.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exptool.m	(revision 12996)
+@@ -0,0 +1,342 @@
++function exptool(newfile,varargin)
++%EXPMASTER - allow to create, modify, add, cut, .. segments of domain outline together
++%
++%   this routine is used to create, modify, cut,... an Argus file (.exp)
++%
++%   exptool(newprofile,'optionname',optionvalue)
++%      creation of an argus file newprofile
++%
++%   Available options:
++%      - include: include list of existing ARGUS files
++%      - color: line color (default='r')
++%      - selectioncolor: line color of selected profiles (default='b')
++%      - linestyle (default='-')
++%      - linewidth (default=0.2)
++%      - marker (default='+')
++%      - markersize (default=7)
++%      - markeredgecolor (default='r')
++%
++%   Usage:
++%      exptool(newfile,varargin)
++%
++%   Example:
++%      exptool('domain.exp','include',{'domain1.exp' 'domain2.exp'},'color','g','marker','+')
++%
++%   See also EXPDOC
++
++%recover options
++options=pairoptions(varargin{:});
++
++%Some checks
++if ~nargin | nargout
++	error('exptool usage: exptool(newfile,varargin)')
++elseif exist(newfile,'file'),
++	%recursive call to exptool if file already exists
++	if ~exist(options,'include'),
++		exptool(newfile,'include',newfile,varargin{:});
++		return;
++	end
++
++	%check modification
++	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
++	if ~strcmpi(choice,'y'),
++		disp('no modification done ... exiting');
++		return
++	end
++end
++
++%Add default options
++options=addfielddefault(options,'color','r');
++options=addfielddefault(options,'selectioncolor','b');
++options=addfielddefault(options,'LineStyle','-');
++options=addfielddefault(options,'LineWidth',0.2);
++options=addfielddefault(options,'Marker','+');
++options=addfielddefault(options,'MarkerSize',7);
++options=addfielddefault(options,'MarkerEdgeColor','r');
++
++%put all the argus profiles given in input in one structure A
++A=struct([]);
++numprofiles=0;
++numpoints=0;
++closed=[];
++
++%initialize the variables with files provided by 'include' option
++if exist(options,'include'),
++	files=getfieldvalue(options,'include');
++	if ischar(files), files={files}; end
++	for i=1:length(files),
++		filename=files{i};
++		if ~exist(filename,'file'),
++			error(['exptool error message:, ' filename ' does not exist. Exiting...']);
++		else
++			%read file
++			B=expread(filename);
++			%go through all profiles of B
++			for i=1:size(B,2)
++				%plug profile in A
++				if numprofiles
++					A(numprofiles+1)=B(i);
++				else
++					A=B(i);
++				end
++				%update numprofiles and numpoints
++				numpoints=numpoints+length(B(i).x);
++				numprofiles=numprofiles+1;
++				%figure out if the profile is closed or not
++				if (B(i).x(1)==B(i).x(end) & B(i).y(1)==B(i).y(end) & length(B(i).x)>1 )
++					closed(numprofiles)=1;
++				else
++					closed(numprofiles)=0;
++				end
++			end
++		end
++	end
++end
++
++%Get root of newfile
++[path root ext]=fileparts(newfile);
++
++%get current figure
++if ~isempty(get(0,'children')),%if there is already a figure (return the number of opened figures)
++	set(gcf,'Renderer','zbuffer'); %fixes a bug on Mac OS X (not needed in future Matlab version)
++	P=get(gcf,'position');
++	F=getframe(gca);
++	F=F.cdata;
++	%get current axis
++	xlim=get(gca,'Xlim');
++	ylim=get(gca,'Ylim');
++	%recreate x_m and y_m
++	x_m=linspace(xlim(1),xlim(2),size(F,2));
++	y_m=linspace(ylim(2),ylim(1),size(F,1)); %getframe reverse axis...
++	%plot the data in another figure
++	figure; set(gcf,'position',P);
++	imagesc(x_m,y_m,F); set(gca,'Ydir','normal');
++	prevplot=1;
++	prevplot2=1;
++else
++	figure
++	prevplot=0;
++	prevplot2=0;
++end
++
++%plot existing profile if any
++hold on
++
++%Build backup structre for do and redo
++backup=cell(1,3);
++backup{1,1}=A;
++backup{1,2}=numprofiles;
++backup{1,3}=numpoints;
++backup{1,4}=closed;
++
++loop=1;
++counter=1;
++while loop
++
++	%Go through A and rule out the empty profiles
++	list=[];
++	for i=1:size(A,2);
++		if length(A(i).x)==0
++			list(end+1)=i;
++			numprofiles=numprofiles-1;
++		end
++	end
++	A(list)=[];
++	closed(list)=[];
++
++	%Now erase all that have been done and plot the new structure A as it is
++	undoplots(prevplot);
++	if numprofiles
++		prevplot2=1;
++		for i=1:numprofiles
++			if length(A(i).x)==1,
++				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++					'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker','o');
++			else
++				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			end
++			prevplot2=prevplot2+1;
++		end
++	end
++
++	%display menu
++	title('Main Menu','FontSize',14);
++	button=menu('Menu','add a profile (open)',...%1
++		'add a contour (closed)',...              %2
++		'remove a profile',...                    %3
++		'modify the position of a point',...      %4
++		'add points inside a profile',...         %5
++		'add points at the end of a profile',...  %6
++		'remove points',...                       %7
++		'remove several points',...               %8
++		'cut a segment',...                       %9
++		'cut a large area',...                    %10
++		'merge profiles',...                      %11
++		'close profile',...                       %12
++		'undo',...                                %13
++		'redo',...                                %14
++		'quit');                                  %15
++
++
++	%UNDO??
++	if button==13;
++		if counter==1
++			disp('Already at oldest change');
++		else
++			counter=counter-1;
++			A=backup{counter,1};
++			numprofiles=backup{counter,2};
++			numpoints=backup{counter,3};
++			closed=backup{counter,4};
++		end
++	end
++
++	%REDO??
++	if button==14
++		if counter==size(backup,1)
++			disp('Already at newest change');
++		else
++			counter=counter+1;
++			A=backup{counter,1};
++			numprofiles=backup{counter,2};
++			numpoints=backup{counter,3};
++			closed=backup{counter,4};
++		end
++	end
++
++	switch button
++
++		case 1
++
++			[A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 2
++
++			[A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot2,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 3
++
++			[A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 4
++
++			[A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 5
++
++			[A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 6
++
++			[A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 7
++
++			[A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 8
++
++			[A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 9
++
++			[A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 10
++
++			[A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 11
++
++			[A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++
++		case 12
++
++			[A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++			%QUIT
++		case 15
++
++			loop=0;
++
++		otherwise
++
++			%do nothing
++
++	end
++
++end
++
++hold off
++
++%write contour using expwrite
++title('New file written, exiting...','FontSize',14);
++if isempty(A)
++	disp('Profile empty, no file written')
++else
++	expwrite(A,newfile);
++end
++
++%close window
++close;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcontract.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcontract.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcontract.m	(revision 12996)
+@@ -0,0 +1,34 @@
++function normal_node=expcontract(newfile,oldfile,distance)
++%EXPCONTRACT - contract or expand a profile, according to the normal.
++% 
++%   Usage:
++%      expcontract(newfile,oldfile,distance)
++%
++%   See also EXPMASTER, EXPDOC
++
++
++contour=expread(oldfile);
++num=numel(contour.x);
++
++normal=zeros(num-1,2);
++normal_node=zeros(num-1,2);
++
++for i=1:num-1,
++	normal(i,:)=[ contour.y(i)-contour.y(i+1) contour.x(i+1)-contour.x(i)];
++	normal(i,:)=normal(i,:)/sqrt(normal(i,1)^2+normal(i,2)^2);
++end
++
++normal_node(2:end,:)=[normal(1:end-1,:)+normal(2:end,:)];
++normal_node(1,:)=normal(1,:)+normal(end,:);
++
++normal_node_norm=sqrt(normal_node(:,1).^2+normal_node(:,2).^2);
++normal_node(:,1)=normal_node(:,1)./normal_node_norm;
++normal_node(:,2)=normal_node(:,2)./normal_node_norm;
++
++contour.x(1:end-1)=contour.x(1:end-1)+distance*normal_node(:,1);
++contour.y(1:end-1)=contour.y(1:end-1)+distance*normal_node(:,2);
++
++contour.x(end)=contour.x(1);
++contour.y(end)=contour.y(1);
++
++expwrite(contour,newfile);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecontour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecontour.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecontour.m	(revision 12996)
+@@ -0,0 +1,36 @@
++function expcreatecontour(filename);
++%EXPCREATECONTOUR - create a contour from a list of points
++%
++%   expcreatecontour: from a list of (x,y) points (retrieve using ginput on an undetermined
++%   number of points: used RETURN key to end input), create an Argus .exp 
++%   file holding the corresponding closed contour.
++%    
++%   Usage:
++%      expcreatecontour(filename)
++%
++%   See also EXPMASTER, EXPDOC
++
++%Get root of filename
++[path root ext ver]=fileparts(filename);
++
++%Get contour
++disp('Click on contour points you desire. Type RETURN to end input of points');
++[x,y]=ginputquick;
++
++%close contour
++x=[x;x(1)];
++y=[y;y(1);];
++
++%plot contour
++hold on;
++plot(x,y,'r-');
++
++%create structure for expwrite routine
++a.x=x;
++a.y=y;
++a.name=root;
++a.density=1;
++
++%write contour using expwrite
++expwrite(a,filename);
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecontour.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expwrite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expwrite.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expwrite.m	(revision 12996)
+@@ -0,0 +1,38 @@
++function expwrite(a,filename);
++%EXPWRITE - write an Argus file from a structure given in input
++%
++%   This routine write an Argus file form a structure containing the fields:
++%   x and y of the coordinates of the points.
++%   The first argument is the structure containing the points coordinates 
++%   and the second one the file to be write.
++%
++%   Usage:
++%      expwrite(a,filename)
++% 
++%   Example:
++%      expwrite(coordstruct,'domainoutline.exp')
++%
++%   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
++
++fid=fopen(filename,'w');
++for n=1:length(a),
++   
++   if isfield(a,'name'),
++	   if ~isempty(a(n).name),
++		   fprintf(fid,'%s%s\n','## Name:',a(n).name);
++	   else
++		   fprintf(fid,'%s\n','## Name:');
++	   end
++   else
++	   fprintf(fid,'%s\n','## Name:');
++   end
++   
++   fprintf(fid,'%s\n','## Icon:0');
++   fprintf(fid,'%s\n','# Points Count Value');
++   fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
++   fprintf(fid,'%s\n','# X pos Y pos');
++	fprintf(fid,'%10.10f %10.10f\n',[a(n).x a(n).y]');
++	fprintf(fid,'\n','');
++   
++end
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expread.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expread.m	(revision 12996)
+@@ -0,0 +1,81 @@
++function Struct=expread(filename);
++%EXPREAD - read a file exp and build a Structure
++%
++%   This routine reads a file .exp and build a Structure containing the 
++%   fields x and y corresponding to the coordinates, one for the filename of
++%   the exp file, for the density, for the nodes, and a field closed to 
++%   indicate if the domain is closed. 
++%   The first argument is the .exp file to be read and the second one (optional) 
++%   indicate if the last point shall be read (1 to read it, 0 not to).
++%
++%   Usage:
++%      Struct=expread(filename)
++%  
++%   Example:
++%      Struct=expread('domainoutline.exp')
++%      Struct=expread('domainoutline.exp')
++%
++%   See also EXPDOC, EXPWRITEASVERTICES
++
++%some checks
++if ~exist(filename),
++	error(['expread error message: file ' filename ' not found!']);
++end
++
++%initialize number of profile
++count=0;
++
++%open file
++fid=fopen(filename,'r');
++
++%loop over the number of profiles
++while (~feof(fid)),
++
++	%update number of profiles
++   count=count+1;
++
++   %Get file name
++	A=fscanf(fid,'%s %s',2);
++	if ~strncmp(A,'##Name:',7), break; end
++	if length(A)>7, 
++		Struct(count).name=A(8:end);
++	else
++		Struct(count).name='';
++	end
++
++	%Get Icon
++	A=fscanf(fid,'%s %s',2);
++	if ~strncmp(A,'##Icon:',6), break; end
++
++	%Get Info
++	A=fscanf(fid,'%s %s %s %s',4);
++	if ~strncmp(A,'#Points',7), break; end
++
++	%Get number of nods and density
++   A=fscanf(fid,'%f %f',[1 2]);
++   Struct(count).nods=A(1);
++   Struct(count).density=A(2);
++
++	%Get Info
++	A=fscanf(fid,'%s %s %s %s',5);
++	if ~strncmp(A,'#XposYpos',9), break; end
++
++	%Get Coordinates
++	A=fscanf(fid,'%f %f',[2 Struct(count).nods]);
++	Struct(count).x=A(1,:)';
++	Struct(count).y=A(2,:)';
++
++	if(Struct(count).nods~=length(Struct(count).x))error(['Profile ' num2str(count) ' reports incorrect length']); end;
++
++	%Check if closed
++	if (Struct(count).nods > 1) && ...
++	   (Struct(count).x(end) == Struct(count).x(1)) && ...
++	   (Struct(count).y(end) == Struct(count).y(1))
++		Struct(count).closed=true;
++	else
++		Struct(count).closed=false;
++	end
++end
++
++%close file
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile
++Makefile.in
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expexcludeoutliers.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expexcludeoutliers.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expexcludeoutliers.m	(revision 12996)
+@@ -0,0 +1,18 @@
++function excludeoutliers(newcontourname,contourname,domainname)
++%EXCLUDEOUTLIERS exclude points of contour that are not within the domain  contour. return new contours in a different file.
++%
++%        Usage: excludeoutliers('NewContour.exp','Contour.exp','DomainOutline.exp');
++%
++%
++%   See also EXPMASTER, EXPDOC
++
++
++contour=expread(contourname);
++
++for i=1:length(contour),
++	flags=ContourToNodes(contour(i).x,contour(i).y,domainname,0);
++	contour(i).x=contour(i).x(find(flags));
++	contour(i).y=contour(i).y(find(flags));
++end
++
++expwrite(contour,newcontourname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expboxgen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expboxgen.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expboxgen.m	(revision 12996)
+@@ -0,0 +1,99 @@
++function expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
++%EXPBOXGEN -  creates a domain outline box for a tiff image
++%
++%   This function creates a domain outline box for a .tif image for the 
++%   mosaic tiff. 
++%   x0,y0 and x1,y1 are the cropping coordinates (upper left and lower right 
++%   corners in the larger tiff image).
++%   paramter_filename is the parameter file name for the mosaic tiff image.
++%   box_filename is self explanatory.
++%
++%   Usage:
++%      expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
++%
++%   See also EXPMASTER, EXPDOC
++
++%initialize
++nrows=-1;
++ncols=-1;
++X0=-1;
++Y0=-1;
++posting=-1;
++
++%first recover necessary information from the paramter_filename.
++fid=fopen(parameter_filename,'r');
++count=1;
++while(1),
++tline=fgetl(fid);
++if ~isstr(tline), break; end;
++
++ind=findstr('ant125m',tline);
++if ~isempty(ind),
++a=strsplit(tline,' ');
++a=a(2); a=char(a); a=a(1:length(a)-1);
++posting=str2num(a);
++end
++
++
++ind=findstr('no. of rows   :',tline);
++if ~isempty(ind),
++a=strsplit(tline,' ');
++nrows=str2num(char(a(length(a))));
++end
++
++ind=findstr('no. of columns:',tline);
++if ~isempty(ind),
++a=strsplit(tline,' ');
++ncols=str2num(char(a(length(a))));
++end
++
++ind=findstr('Upper Left X:',tline);
++if ~isempty(ind),
++a=strsplit(tline,' ');
++X0=str2num(char(a(length(a))));
++end
++
++ind=findstr('Upper Left Y:',tline);
++if ~isempty(ind),
++a=strsplit(tline,' ');
++Y0=str2num(char(a(length(a))));
++end
++
++
++end %while(1),
++
++
++fclose(fid);
++
++if (X0==-1 | Y0==-1 | nrows==-1  | ncols==-1 | posting==-1),
++disp(' ');
++disp(['Could not recover all parameters from ' parameter_filename]);
++disp('Here are the paramters recovered thus far: ');
++disp(['no. of rows: ' num2str(nrows)]);
++disp(['no. of columns: ' num2str(ncols)]);
++disp(['Upper Left X: ' num2str(X0)]);
++disp(['Upper Left Y: ' num2str(Y0)]);
++disp(['Posting: ' num2str(posting)]);
++end
++
++disp(' ');
++disp(['Recovered the following parameters from ' parameter_filename]);
++disp(['no. of rows: ' num2str(nrows)]);
++disp(['no. of columns: ' num2str(ncols)]);
++disp(['Upper Left X: ' num2str(X0)]);
++disp(['Upper Left Y: ' num2str(Y0)]);
++disp(['Posting: ' num2str(posting)]);
++
++%Create X,Y, arrays of coordinates:
++X(1)=X0+x0*posting
++Y(1)=Y0-y0*posting
++X(2)=X(1);
++Y(2)=Y(1)-ny*posting;
++X(3)=X(1)+nx*posting;
++Y(3)=Y(2);
++Y(4)=Y(1);
++X(4)=X(3);
++plot(X,Y,'r*');
++
++%Create box exp file using X and Y. Loop it.
++expgen(box_filename,X,Y,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreateprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreateprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreateprofile.m	(revision 12996)
+@@ -0,0 +1,31 @@
++function expcreateprofile(filename);
++%EXPCREATEPROFILE - create an Argus file from a list of points
++%
++%   expcreateprofile: from a list of (x,y) points (retrieve using ginput on an undetermined
++%   number of points: used RETURN key to end input), create an Argus .exp 
++%   file holding the corresponding open profile.
++%    
++%   Usage:
++%      expcreateprofile(filename)
++%
++%   See also EXPMASTER, EXPDOC
++
++%Get root of filename
++[path root ext ver]=fileparts(filename);
++
++%Get profile
++disp('Click on profile points you desire. Type RETURN to end input of points');
++[x,y]=ginputquick;
++
++%plot contour
++hold on;
++plot(x,y,'r-');
++
++%create structure for expwrite routine
++a.x=x;
++a.y=y;
++a.name=root;
++a.density=1;
++
++%write profile using expwrite
++expwrite(a,filename);
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreateprofile.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/flowlines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/flowlines.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/flowlines.m	(revision 12996)
+@@ -0,0 +1,163 @@
++function flowpath=flowlines(index,x,y,u,v,x0,y0,varargin)
++%FLOWLINES - compute flowlines from a given set of seed points
++%
++%   Usage:
++%      flowpath=flowlines(index,x,y,u,v,x0,y0)
++%
++%   the velocity field is given by the couple (u,v) and the coordinates
++%   of the seed points are (x0,y0). One can use one or several seed 
++%   points
++%
++%   Example:
++%      flowpath=flowlines(md.mesh.elements,md.mesh.x,md.mesh.y,md.vx,md.initialization.vy,x0,y0)
++
++%check input size
++if nargin>8 | nargin<7,
++	help flowlines
++	error('flowlines error message: bad usage');
++end
++
++%check input
++if (length(x)~=length(y) | length(x)~=length(u) | length(x)~=length(v)),
++	error('flowlines error message: x,y,u and v must have the same length');
++end
++if length(x)<3,
++	error('flowlines error message: at least one element is required');
++end
++if length(x0)~=length(y0),
++	error('flowlines error message: x0 and y0 do not have the same length');
++end
++
++%get maxiter and precision
++if nargin==8
++	maxiter=varargin{1};
++else
++	maxiter=200; %maximum number of iterations
++end
++precision=1; %division of each segment (higer precision increases number of segments)
++
++%check seed points
++tria=TriaSearch(index,x,y,x0,y0);
++pos=find(isnan(tria));
++x0(pos)=[];
++y0(pos)=[];
++
++%initialize other variables
++N=length(x0);
++X=x0; Y=y0;
++flowpath=struct('x',cell(N,1),'y',cell(N,1),'name','','density',1);
++for i=1:N,
++	flowpath(i).x=x0(i);
++	flowpath(i).y=y0(i);
++end
++done=zeros(N,1);
++
++%get avegared length of each element
++length_tria=1/3*(sqrt( (x(index(:,1))-x(index(:,2))).^2+(y(index(:,1))-y(index(:,2))).^2 )+...
++	sqrt((x(index(:,1))-x(index(:,3))).^2+(y(index(:,1))-y(index(:,3))).^2 )+...
++	sqrt((x(index(:,2))-x(index(:,3))).^2+(y(index(:,2))-y(index(:,3))).^2 ));
++
++%take velocity for each element
++u=u(index)*[1;1;1]/3;
++v=v(index)*[1;1;1]/3;
++
++%initialization:
++counter=1;
++
++while any(~done) 
++
++	%find current triangle
++	queue=find(~done);
++	tria=TriaSearch(index,x,y,X(queue),Y(queue));
++
++	%check that the point is actually inside a triangle of the mesh
++	listnan=find(isnan(tria));
++	for i=1:length(listnan)
++		%remove the last point
++		flowpath(queue(listnan(i))).x(end)=[];
++		flowpath(queue(listnan(i))).y(end)=[];
++		done(queue(listnan(i)))=1;
++	end
++	tria(listnan)=[]; 
++	queue(listnan)=[];
++
++	if isempty(tria),
++		break;
++	end
++
++	%velocity of the current triangle and norm it
++	ut=u(tria); vt=v(tria); normv=sqrt(ut.^2+vt.^2);
++	ut=ut./normv;vt=vt./normv;
++
++	%check counter
++	if counter>maxiter
++		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going forward'])
++		break
++	end
++	counter=counter+1;
++
++	%remove stagnant point
++	done(queue(find(ut==0 & vt==0)))=1;
++
++	%build next point
++	for i=1:length(queue)
++		X(queue(i))=flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision;
++		Y(queue(i))=flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision;
++		flowpath(queue(i)).x=[flowpath(queue(i)).x;flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision];
++		flowpath(queue(i)).y=[flowpath(queue(i)).y;flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision];
++	end
++end
++
++%same process but reverse (vel=-vel) to have a vcomplete flow line
++counter=1;
++X=x0; Y=y0;
++done=zeros(N,1);
++
++while any(~done) 
++
++	%find current triangle
++	queue=find(~done);
++	tria=TriaSearch(index,x,y,X(queue),Y(queue));
++
++	%check that the point is actually inside a triangle of the mesh
++	listnan=find(isnan(tria));
++	for i=1:length(listnan)
++		%remove the last point
++		flowpath(queue(listnan(i))).x(1)=[];
++		flowpath(queue(listnan(i))).y(1)=[];
++		done(queue(listnan(i)))=1;
++	end
++	tria(listnan)=[]; 
++	queue(listnan)=[];
++
++	if isempty(tria),
++		break;
++	end
++
++	%velocity of the current triangle and norm it
++	ut=-u(tria); vt=-v(tria); normv=sqrt(ut.^2+vt.^2);
++	ut=ut./normv;vt=vt./normv;
++
++	%check counter
++	if counter>maxiter
++		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going backward'])
++		break
++	end
++	counter=counter+1;
++
++	%remove stagnant point
++	done(queue(find(ut==0 & vt==0)))=1;
++
++	%build next point
++	for i=1:length(queue)
++		X(queue(i))=flowpath(queue(i)).x(1)+ut(i)*length_tria(tria(i))/precision;
++		Y(queue(i))=flowpath(queue(i)).y(1)+vt(i)*length_tria(tria(i))/precision;
++		flowpath(queue(i)).x=[flowpath(queue(i)).x(1)+ut(i)*length_tria(tria(i))/precision; flowpath(queue(i)).x];
++		flowpath(queue(i)).y=[flowpath(queue(i)).y(1)+vt(i)*length_tria(tria(i))/precision; flowpath(queue(i)).y];
++	end
++end
++
++%EXP compatibility
++for i=1:length(queue)
++	flowpath(queue(i)).name=['flowline' num2str(i)];
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecircle.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecircle.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecircle.m	(revision 12996)
+@@ -0,0 +1,31 @@
++function expcreatecircle(filename,x0,y0,radius,numberofnodes)
++%EXPCREATECIRCLE - create a circular contour corresponding to given parameters
++%
++%   Creates a closed argus contour centered on x,y of radius size.
++%   The contour is made of numberofnodes
++%
++%   Usage:
++%      expcreatecircle(filename,x0,y0,radius,numberofnodes)
++%
++%   See also EXPMASTER, EXPDOC
++
++%Calculate the cartesians coordinates of the points
++x_list=ones(numberofnodes+1,1);
++y_list=ones(numberofnodes+1,1);
++
++theta=(0:2*pi/numberofnodes:2*pi*(1-1/numberofnodes))';
++theta=[theta;0];
++
++x_list=radius*x_list.*cos(theta);
++y_list=radius*y_list.*sin(theta);
++
++%offset x_list and y_list by x0 and y0:
++x_list=x_list+x0;
++y_list=y_list+y0;
++
++contour.x=x_list;
++contour.y=y_list;
++contour.density=1;
++contour.name='circle';
++
++expwrite(contour,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/ginputquick.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/ginputquick.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/ginputquick.m	(revision 12996)
+@@ -0,0 +1,221 @@
++function [out1,out2,out3] = ginput(arg1)
++%GINPUT - Graphical input from mouse.
++%
++%   [X,Y] = GINPUT(N) gets N points from the current axes and returns 
++%   the X- and Y-coordinates in length N vectors X and Y.  The cursor
++%   can be positioned using a mouse (or by using the Arrow Keys on some 
++%   systems).  Data points are entered by pressing a mouse button
++%   or any key on the keyboard except carriage return, which terminates
++%   the input before N points are entered.
++%
++%   [X,Y] = GINPUT gathers an unlimited number of points until the
++%   return key is pressed.
++% 
++%   [X,Y,BUTTON] = GINPUT(N) returns a third result, BUTTON, that 
++%   contains a vector of integers specifying which mouse button was
++%   used (1,2,3 from left) or ASCII numbers if a key on the keyboard
++%   was used.
++%
++%   Usage:
++%      [out1,out2,out3] = ginput(arg1)
++
++%   Copyright 1984-2005 The MathWorks, Inc.
++%   $Revision: 1.1 $  $Date: 2009/04/03 22:56:26 $
++
++out1 = []; out2 = []; out3 = []; y = [];
++c = computer;
++if ~strcmp(c(1:2),'PC') 
++   tp = get(0,'TerminalProtocol');
++else
++   tp = 'micro';
++end
++
++if ~strcmp(tp,'none') && ~strcmp(tp,'x') && ~strcmp(tp,'micro'),
++   if nargout == 1,
++      if nargin == 1,
++         out1 = trmginput(arg1);
++      else
++         out1 = trmginput;
++      end
++   elseif nargout == 2 || nargout == 0,
++      if nargin == 1,
++         [out1,out2] = trmginput(arg1);
++      else
++         [out1,out2] = trmginput;
++      end
++      if  nargout == 0
++         out1 = [ out1 out2 ];
++      end
++   elseif nargout == 3,
++      if nargin == 1,
++         [out1,out2,out3] = trmginput(arg1);
++      else
++         [out1,out2,out3] = trmginput;
++      end
++   end
++else
++   
++   fig = gcf;
++   figure(gcf);
++   
++   if nargin == 0
++      how_many = -1;
++      b = [];
++   else
++      how_many = arg1;
++      b = [];
++      if  ischar(how_many) ...
++            || size(how_many,1) ~= 1 || size(how_many,2) ~= 1 ...
++            || ~(fix(how_many) == how_many) ...
++            || how_many < 0
++         error('MATLAB:ginput:NeedPositiveInt', 'Requires a positive integer.')
++      end
++      if how_many == 0
++         ptr_fig = 0;
++         while(ptr_fig ~= fig)
++            ptr_fig = get(0,'PointerWindow');
++         end
++         scrn_pt = get(0,'PointerLocation');
++         loc = get(fig,'Position');
++         pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
++         out1 = pt(1); y = pt(2);
++      elseif how_many < 0
++         error('MATLAB:ginput:InvalidArgument', 'Argument must be a positive integer.')
++      end
++   end
++   
++   % Suspend figure functions
++   state = uisuspend(fig);
++   
++   toolbar = findobj(allchild(fig),'flat','Type','uitoolbar');
++   if ~isempty(toolbar)
++        ptButtons = [uigettool(toolbar,'Plottools.PlottoolsOff'), ...
++                     uigettool(toolbar,'Plottools.PlottoolsOn')];
++        ptState = get (ptButtons,'Enable');
++        set (ptButtons,'Enable','off');
++   end
++
++   set(fig,'pointer','fullcrosshair');
++   fig_units = get(fig,'units');
++   char = 0;
++
++   % We need to pump the event queue on unix
++   % before calling WAITFORBUTTONPRESS 
++   drawnow
++   
++   while how_many ~= 0
++      % Use no-side effect WAITFORBUTTONPRESS
++      waserr = 0;
++      try
++	keydown = wfbp;
++      catch
++	waserr = 1;
++      end
++      if(waserr == 1)
++         if(ishandle(fig))
++            set(fig,'units',fig_units);
++	    uirestore(state);
++            error('MATLAB:ginput:Interrupted', 'Interrupted');
++         else
++            error('MATLAB:ginput:FigureDeletionPause', 'Interrupted by figure deletion');
++         end
++      end
++      
++      ptr_fig = get(0,'CurrentFigure');
++      if(ptr_fig == fig)
++         if keydown
++            char = get(fig, 'CurrentCharacter');
++            button = abs(get(fig, 'CurrentCharacter'));
++            scrn_pt = get(0, 'PointerLocation');
++            set(fig,'units','pixels')
++            loc = get(fig, 'Position');
++            pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
++            set(fig,'CurrentPoint',pt);
++         else
++            button = get(fig, 'SelectionType');
++            if strcmp(button,'open') 
++               button = 1;
++            elseif strcmp(button,'normal') 
++               button = 1;
++            elseif strcmp(button,'extend')
++               button = 2;
++            elseif strcmp(button,'alt') 
++               button = 3;
++            else
++               error('MATLAB:ginput:InvalidSelection', 'Invalid mouse selection.')
++            end
++         end
++         pt = get(gca, 'CurrentPoint');
++         
++         how_many = how_many - 1;
++         
++         if(char == 13) % & how_many ~= 0)
++            % if the return key was pressed, char will == 13,
++            % and that's our signal to break out of here whether
++            % or not we have collected all the requested data
++            % points.  
++            % If this was an early breakout, don't include
++            % the <Return> key info in the return arrays.
++            % We will no longer count it if it's the last input.
++            break;
++         end
++
++         out1 = [out1;pt(1,1)];
++         y = [y;pt(1,2)];
++         b = [b;button];
++      end
++   end
++   
++   uirestore(state);
++   if ~isempty(toolbar) && ~isempty(ptButtons)
++        set (ptButtons(1),'Enable',ptState{1});
++        set (ptButtons(2),'Enable',ptState{2});
++   end
++   set(fig,'units',fig_units);
++   
++   if nargout > 1
++      out2 = y;
++      if nargout > 2
++         out3 = b;
++      end
++   else
++      out1 = [out1 y];
++   end
++
++   line(out1,y);
++   line([out1(length(out1)) out1(1)],[y(length(y)) y(1)]);
++   
++end
++
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++function key = wfbp
++%WFBP   Replacement for WAITFORBUTTONPRESS that has no side effects.
++
++fig = gcf;
++current_char = [];
++
++% Now wait for that buttonpress, and check for error conditions
++waserr = 0;
++try
++  h=findall(fig,'type','uimenu','accel','C');   % Disabling ^C for edit menu so the only ^C is for
++  set(h,'accel','');                            % interrupting the function.
++  keydown = waitforbuttonpress;
++  current_char = double(get(fig,'CurrentCharacter')); % Capturing the character.
++  if~isempty(current_char) && (keydown == 1)           % If the character was generated by the 
++	  if(current_char == 3)                       % current keypress AND is ^C, set 'waserr'to 1
++		  waserr = 1;                             % so that it errors out. 
++	  end
++  end
++  
++  set(h,'accel','C');                                 % Set back the accelerator for edit menu.
++catch
++  waserr = 1;
++end
++drawnow;
++if(waserr == 1)
++   set(h,'accel','C');                                % Set back the accelerator if it errored out.
++   error('MATLAB:ginput:Interrupted', 'Interrupted');
++end
++
++if nargout>0, key = keydown; end
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expbox.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expbox.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expbox.m	(revision 12996)
+@@ -0,0 +1,41 @@
++function expbox(filename)
++%EXPBOX - Create a ARGUS file using to clicks
++%
++%   Two clicks on a plot are used to generate a rectangular box
++%   This box is written in EXP format on filename
++%
++%   Usage:
++%      expbox(filename)
++
++%check
++if exist(filename,'file'),
++	choice=input(['A file ' filename ' already exists, do you want to modify it? (y/n)'],'s');
++	if ~strcmpi(choice,'y'),
++		disp('no modification done ... exiting');
++		return
++	end
++end
++
++%Get points
++disp('Click twice to define a rectangular domain. First click for upper left corner, second for lower right corner');
++[x,y]=ginput(2);
++
++x1=x(1);
++x2=x(2);
++x3=x2;
++x4=x1;
++
++y1=y(1);
++y2=y1;
++y3=y(2);
++y4=y3;
++
++%Build Exp structure
++A=struct();
++A.nods=5;
++A.density=1;
++A.x=[x1 x2 x3 x4 x1]';
++A.y=[y1 y2 y3 y4 y1]';
++
++%Write structure
++expwrite(A,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutarea.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutarea.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutarea.m	(revision 12996)
+@@ -0,0 +1,156 @@
++function [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options);
++%CUTAREA - cut several point of a profile
++%
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile. The user must click 3 times to select the
++%   area to be removed. Twice to select the tips and one to select
++%   the part of the profile to be removed
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	hold on
++	loop=1;
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	end
++
++	points=[];
++
++	%loop (at least 3 clicks needed)
++	while loop
++
++		%some checks
++		if numprofiles==0
++			disp('no profile present, exiting...')
++			return
++		end	   
++		if numpoints<3
++			disp('at least two points are needed, exiting...')
++			return
++		end	   
++
++		%select a point
++		if isempty(points)
++			title('click on the first tip, RETURN to exit','FontSize',14)
++		elseif length(points)==1
++			title('click on the second tip, RETURN to exit','FontSize',14)
++		else
++			title('click in the middle of the area to be cut, RETURN to exit','FontSize',14)
++		end
++
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++			%get the closest point
++			%first time, look at all profiles
++			if isempty(points)
++				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++				if ((closed(profsel) & length(A(profsel).x)<4) |  (~closed(profsel) & length(A(profsel).x)<3)),
++					disp('the selected profile has less than 3 points, make another selection');
++				else
++					selection=profsel;
++					points(end+1)=indsel;
++					plot(A(profsel).x,A(profsel).y,...
++						'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++					text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
++				end
++			else
++				%get the 2d or 3d point for the given contou
++				[profsel indsel]=closestpoint(A(selection),1,xi,yi);
++				if ismember(indsel,points)
++					disp('the selected points must be distinct')
++				else
++					%second click?
++					if length(points)==1,
++						points(end+1)=indsel;
++						text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
++					%third click?
++					else
++						p1=points(1); p2=points(2); p3=indsel;
++						x=A(selection).x; y=A(selection).y;
++						if p1<p2
++							if p3>p1 & p3<p2
++								if closed(selection)
++									%open the profile
++									n=length(A(selection).x);
++									A(selection).x=[A(selection).x(p2:end-1,1);A(selection).x(1:p1,1)];
++									A(selection).y=[A(selection).y(p2:end-1,1);A(selection).y(1:p1,1)];
++									numpoints=numpoints-(n-length(A(selection).x));
++									closed(selection)=0;
++								else
++									%cut in 2 profiles
++									A(selection).x=x(1:p1);
++									A(selection).y=y(1:p1);
++									closed(selection)=0;
++									A(end+1).x=x(p2:end);
++									A(end).y=y(p2:end);
++									A(end).density=A(selection).density;
++									A(end).name=A(selection).name;
++									closed(end+1)=0;
++									numprofiles=numprofiles+1;
++									numpoints=numpoints-(p2-p1-1);
++								end
++							else
++								%only point removal
++								n=length(A(selection).x);
++								A(selection).x=x(p1:p2);
++								A(selection).y=y(p1:p2);
++								numpoints=numpoints-(n-length(A(selection).x));
++								closed(selection)=0;
++							end
++						else
++							if p3>p2 & p3<p1
++								if closed(selection)
++									%open the profile
++									n=length(A(selection).x);
++									A(selection).x=[A(selection).x(p1:end-1,1);A(selection).x(1:p2,1)];
++									A(selection).y=[A(selection).y(p1:end-1,1);A(selection).y(1:p2,1)];
++									numpoints=numpoints-(n-length(A(selection).x));
++									closed(selection)=0;
++								else
++									%cut in 2 profiles
++									closed(selection)=0;
++									A(selection).x=x(1:p2);
++									A(selection).y=y(1:p2);
++									A(end+1).x=x(p1:end);
++									A(end).y=y(p1:end);
++									A(end).density=A(selection).density;
++									A(end).name=A(selection).name;
++									closed(end+1)=0;
++									numprofiles=numprofiles+1;
++									numpoints=numpoints-(p1-p2-1);
++								end
++							else
++								%only point removal
++								n=length(A(selection).x);
++								x(1:p2-1)=[];x(p1-p2+2:end)=[];%it should have been x(p2+1:end)
++								y(1:p2-1)=[];y(p1-p2+2:end)=[];
++								A(selection).x=x;
++								A(selection).y=y;
++								numpoints=numpoints-(n-length(A(selection).x));
++								closed(selection)=0;
++							end
++						end
++
++						%plot new profile
++						undoplots(prevplot);
++						for i=1:numprofiles
++							plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++								'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++						end
++						points=[];
++
++					end
++				end
++			end
++		else
++			%RETRUN-> quit
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addinsideprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addinsideprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addinsideprofile.m	(revision 12996)
+@@ -0,0 +1,79 @@
++function [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%ADDINSIDEPROFILE - add apoint inside a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting...')
++		return
++	end	   
++	if numpoints<2
++		disp('at least two points are required, exiting...')
++		return
++	end	   
++	hold on
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	end
++
++	loop=1;
++	while loop
++
++		%first step, select a segment
++		title('click on a segment, RETURN to exit','FontSize',14)
++		[xi,yi] = ginput(1);
++
++		%first click
++		if ~isempty(xi)
++
++			%get the closest segment
++			[profsel indsel]=closestsegment(A,numprofiles,xi,yi);
++
++			%check that at least one segment exists
++			if indsel==0
++				disp('at least two points in one profile are required, exiting...')
++				return
++			end
++
++			%highlight selected segment
++			plot([A(profsel).x(indsel) A(profsel).x(indsel+1)],[A(profsel).y(indsel) A(profsel).y(indsel+1)],...
++				'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++			%next click
++			title('click on the new point''s location, RETURN to exit','FontSize',14)
++			[xi,yi,but] = ginput(1);
++
++			%second click
++			if ~isempty(xi)
++
++				%add point to A
++				A(profsel).x=[A(profsel).x(1:indsel,1); xi; A(profsel).x(indsel+1:end,1)];
++				A(profsel).y=[A(profsel).y(1:indsel,1); yi; A(profsel).y(indsel+1:end,1)];
++				numpoints=numpoints+1;
++
++				%plot new profile
++				undoplots(prevplot);
++				for i=1:numprofiles
++					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++				end
++
++			else
++				%RETURN->exit
++				return
++			end
++		else
++			%RETURN-> exit
++			return
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closeprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closeprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closeprofile.m	(revision 12996)
+@@ -0,0 +1,68 @@
++function [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%CLOSEPROFILE - close one or several profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++
++	%some checks
++	if numprofiles==0
++		disp('no profile to be closed')
++		return
++	end
++		   
++	title('click on the profiles to be closed, RETURN to exit','FontSize',14)
++	hold on
++
++	loop=1;
++	selection=[];
++
++	while loop
++
++		%some checks,
++		if numprofiles==0    
++			disp('no profile present, exiting...')
++			return            
++		end  
++		if ~any(~closed),
++			disp('All the profiles are closed, exiting...')
++			return
++		end
++
++		[xi,yi] = ginput(1);
++					  
++		if ~isempty(xi)
++
++			%get closest profile
++			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++
++			if ismember(profsel,selection)
++				%profile was in selection, remove it from the selection
++				selection(find(selection==profsel))=[];
++				%back to regular color
++				plot(A(profsel).x,A(profsel).y,...
++					'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			elseif closed(profsel),
++				%profile already closed, do nothing
++				disp('selected profile aready closed, make another selection'),
++			else
++				%add the profile to the list to be closed
++				selection(end+1)=profsel;
++				%in selectioncolor
++				plot(A(profsel).x,A(profsel).y,...
++					'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			end
++		else
++			%close the profiles
++			for i=1:length(selection),
++				A(selection(i)).x(end+1)=A(selection(i)).x(1);
++				A(selection(i)).y(end+1)=A(selection(i)).y(1);
++				numpoints=numpoints+1;
++				closed(selection(i))=1;
++			end
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestpoint.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestpoint.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestpoint.m	(revision 12996)
+@@ -0,0 +1,21 @@
++function [profsel indsel]=closestpoint(A,numprofiles,xi,yi)
++%CLOSESTPOINT - find the closest point of a profile
++%
++%   This routine find the point of the profile A that is the closest
++%   to (xi,yi) and return the number of the profile and the number of
++%   the point
++%
++%   Usage:
++%     [profsel indsel]=closestpoint(A,numprofiles,xi,yi) 
++
++	%loop over the points of each profile, find the closest to (xi,yi)
++	for i=1:numprofiles,
++		distance=(xi-A(i).x).^2+(yi-A(i).y).^2;
++		[newdistance p]=min(distance);
++		if ((i==1) | (newdistance<olddistance)),
++			indsel=p;
++			profsel=i;
++			olddistance=newdistance;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/undoplots.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/undoplots.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/undoplots.m	(revision 12996)
+@@ -0,0 +1,12 @@
++function  undoplots(prevplot)
++%UNDOPLOTS - undo plots
++%
++%   Usage:undoplots(prevplot)
++
++	%erase all previous plots
++	g=get(gca,'children');
++	L=length(g);
++	for i=1:L-prevplot
++		delete(g(i));
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addprofile.m	(revision 12996)
+@@ -0,0 +1,48 @@
++function [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%ADDPROFILE - add a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++		   
++	title('click to add a point to the new profile, RETURN to exit','FontSize',14)
++	hold on
++
++	loop=1;
++	x=[];
++	y=[];
++
++	while loop
++
++		[xi,yi] = ginput(1);
++					  
++		if ~isempty(xi)
++			x(end+1,1)=xi;
++			y(end+1,1)=yi;
++
++			%plot everything
++			undoplots(prevplot);
++			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++		else
++
++			%check that the profile is not empty
++			if ~isempty(x)
++				A(end+1).x=x; 
++				A(end).y=y; 
++				A(end).name=root; 
++				A(end).density=1; 
++				numprofiles=numprofiles+1;
++				numpoints=numpoints+length(x);
++				closed(end+1)=0;
++			end
++
++			%get out
++			loop=0;
++		end
++	end
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addprofile.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removepoints.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removepoints.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removepoints.m	(revision 12996)
+@@ -0,0 +1,85 @@
++function [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options);
++%REMOVEPOINTS - remove a point from a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting...')
++		return
++	end
++
++	hold on
++	loop=1;
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++	end
++
++	while loop
++
++		%check that at least one point is present
++		if numpoints==0
++			disp('at least one point are needed')
++			return
++		end	   
++
++		%select a point to be deleted
++		title('click on the point to be removed, RETURN to exit','FontSize',14)
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++
++			%get the closest point
++			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++
++			%remove point of A
++			A(profsel).x(indsel)=[];
++			A(profsel).y(indsel)=[];
++
++			%unclose the domain if only 2 points remaining
++			if closed(profsel)
++				if length(A(profsel).x)==3
++					A(profsel).x(end)=[];
++					A(profsel).y(end)=[];
++					numpoints=numpoints-1;
++					closed(profsel)=0;
++				end
++			end
++
++			%remove the last point if the profile is closed and indsel=end or 1
++			if closed(profsel)
++				if indsel==1 
++					A(profsel).x(end)=A(profsel).x(1);
++					A(profsel).y(end)=A(profsel).y(1);
++				elseif indsel==length(A(profsel).x)
++					A(profsel).x(1)=A(profsel).x(end);
++					A(profsel).y(1)=A(profsel).y(end);
++				end
++			end
++			numpoints=numpoints-1;
++
++			%plot new profile
++			undoplots(prevplot);
++			for i=1:numprofiles
++				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++					'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++				if length(A(i).x)==1
++					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker','o');
++				end
++			end
++
++		else
++			%RETURN-> exit
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutprofile.m	(revision 12996)
+@@ -0,0 +1,79 @@
++function [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%CUTPROFILE - cut a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting...')
++		return
++	end	   
++	if numpoints<2
++		disp('at least two points are needed')
++		return
++	end	   
++	hold on
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	end
++
++	loop=1;
++	while loop
++
++		%select a segment
++		title('click the segment to cut, RETURN to exit','FontSize',14)
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++
++			%get the closest segment
++			[profsel indsel]=closestsegment(A,numprofiles,xi,yi);
++
++			%check that at least one segment exists
++			if indsel==0
++				disp('at least 2 points are required');
++				return,
++			end
++
++			if ((closed(profsel) & length(A(profsel).x)<3) | (~closed(profsel) & length(A(profsel).x)<2))
++				disp('at least 2 points are required, make another selection');
++			else
++				%cut A
++				if closed(profsel)
++					%open the contour
++					A(profsel).x=[A(profsel).x(indsel+1:end-1,1);A(profsel).x(1:indsel,1)];
++					A(profsel).y=[A(profsel).y(indsel+1:end-1,1);A(profsel).y(1:indsel,1)];
++					numpoints=numpoints-1;
++					closed(profsel)=0;
++				else
++					%cut the contour in 2 profiles
++					A(end+1).x=A(profsel).x(indsel+1:end,1);
++					A(end).y=A(profsel).y(indsel+1:end,1);
++					A(end).name=root; 
++					A(end).density=1; 
++					A(profsel).x=A(profsel).x(1:indsel,1);
++					A(profsel).y=A(profsel).y(1:indsel,1);
++					numprofiles=numprofiles+1;
++					closed(end+1)=0;
++				end
++
++				%plot new profile
++				undoplots(prevplot);
++				for i=1:numprofiles
++					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++				end
++			end
++		else
++			%RETURN->exit
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/modifyposition.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/modifyposition.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/modifyposition.m	(revision 12996)
+@@ -0,0 +1,77 @@
++function [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options);
++%MODIFYPOSITION - modify the prosition of a point of a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting..')
++		return
++	end
++
++	hold on
++	loop=1;
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	end
++
++	while loop
++
++		%select a point to be modified 
++		title('click on the point to be modified, RETURN to exit','FontSize',14)
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++
++			%get the closest point
++			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++
++			%plot the point in blue
++			plot(A(profsel).x(indsel),A(profsel).y(indsel),...
++				'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++				'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++			%select new location
++			title('click on the new location, RETURN to exit','FontSize',14)
++			[xi,yi] = ginput(1);
++
++			if ~isempty(xi)
++
++				%modification of its coordinates
++				A(profsel).x(indsel)=xi;
++				A(profsel).y(indsel)=yi;
++
++				%modify the last point if the profile is closed and indsel=end or 1
++				if closed(profsel)
++					if indsel==1 
++						A(profsel).x(end)=xi;
++						A(profsel).y(end)=yi;
++					elseif indsel==length(A(profsel).x)
++						A(profsel).x(1)=xi;
++						A(profsel).y(1)=yi;
++					end
++				end
++
++				%plot new profile
++				undoplots(prevplot);
++				for i=1:numprofiles
++					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++				end
++			else
++				%RETURN-> exit
++				loop=0;
++			end
++		else
++			%RETURN-> exit
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeseveralpoints.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeseveralpoints.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeseveralpoints.m	(revision 12996)
+@@ -0,0 +1,130 @@
++function [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options);
++%REMOVESEVERALPOINTS - remove several point
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting...')
++		return
++	end	   
++	if numpoints<3
++		disp('at least 3 points are required, exiting...')
++		return
++	end	   
++	hold on
++	loop=1;
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	end
++
++	points=[];
++
++	%loop (at least 3 clicks needed)
++	while loop
++
++		%some checks
++		if numpoints<3
++			disp('at least 3 points are required, exiting...')
++			return
++		end
++
++		%select a point
++		if isempty(points)
++			title('click on the first tip, RETURN to exit','FontSize',14)
++		elseif length(points)==1
++			title('click on the second tip, RETURN to exit','FontSize',14)
++		else
++			title('click in the middle of the area to be removed, RETURN to exit','FontSize',14)
++		end
++
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++			%get the closest point
++			%first time, look at all profiles
++			if isempty(points)
++				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++				if ((closed(profsel) & length(A(profsel).x)<4) |  (~closed(profsel) & length(A(profsel).x)<3)),
++					disp('the selected profile has less than 3 points, make another selection');
++				else
++					selection=profsel;
++					points(end+1)=indsel;
++					plot(A(profsel).x,A(profsel).y,...
++						'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++					text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
++				end
++				%disp(['p1= ' num2str(indsel)]),
++			else
++				%get the 2d or 3d point for the given contou
++				[profsel indsel]=closestpoint(A(selection),1,xi,yi);
++				if ismember(indsel,points)
++					disp('the selected points must be distinct')
++				else
++					%second click?
++					if length(points)==1,
++						points(end+1)=indsel;
++						text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
++						%disp(['p2= ' num2str(indsel)]),
++					%third click?
++					else
++						p1=points(1); p2=points(2); p3=indsel;
++						%disp(['p3= ' num2str(indsel)]),
++						if p1<p2
++							if p3>p1 & p3<p2
++								A(selection).x(p1+1:p2-1)=[];
++								A(selection).y(p1+1:p2-1)=[];
++								numpoints=numpoints-(p2-p1-1);
++							else
++								A(selection).x=A(selection).x(p1:p2);
++								A(selection).y=A(selection).y(p1:p2);
++								numpoints=numpoints-(numpoints-1-p2)-(p1-1);
++								if closed(selection)
++									%reattach the tips
++									A(selection).x(end+1)=A(selection).x(1);
++									A(selection).y(end+1)=A(selection).y(1);
++									numpoints=numpoints+1;
++								end
++							end
++						else
++							if p3>p2 & p3<p1
++								A(selection).x(p2+1:p1-1)=[];
++								A(selection).y(p2+1:p1-1)=[];
++								numpoints=numpoints-(p1-p2-1);
++							else
++								A(selection).x=A(selection).x(p2:p1);
++								A(selection).y=A(selection).y(p2:p1);
++								numpoints=numpoints-(numpoints-1-p1)-(p2-1);
++								if closed(selection)
++									%reattach the tips
++									A(selection).x(end+1)=A(selection).x(1);
++									A(selection).y(end+1)=A(selection).y(1);
++									numpoints=numpoints+1;
++								end
++							end
++						end
++
++						%plot new profiles
++						undoplots(prevplot);
++						for i=1:numprofiles
++							plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++								'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++						end
++						points=[];
++
++					end
++				end
++			end
++		else
++			%RETRUN-> quit
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeprofile.m	(revision 12996)
+@@ -0,0 +1,56 @@
++function [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%REMOVEPROFILE - delete a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++
++	title('click on the profiles to be removed, RETURN to exit','FontSize',14)
++	hold on
++
++	loop=1;
++	selection=[];
++
++	while loop
++
++		%some checks
++		if numprofiles==0
++			disp('no profile to be removed, exiting...')
++			return
++		end
++		   
++		[xi,yi] = ginput(1);
++					  
++		if ~isempty(xi)
++
++			%get closest profile
++			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++
++			if ismember(profsel,selection)
++				%profile was in selection, remove it
++				selection(find(selection==profsel))=[];
++				%back to regular color
++				plot(A(profsel).x,A(profsel).y,...
++					'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			else
++				%add the profile to the list to be removed
++				selection(end+1)=profsel;
++				%in selectioncolor
++				plot(A(profsel).x,A(profsel).y,...
++					'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			end
++		else
++			%remove the profiles
++			selection=sort(selection);
++			for i=1:length(selection),
++				numprofiles=numprofiles-1;
++				numpoints=numpoints-length(A(selection(i)-(i-1)).x);
++				A(selection(i)-(i-1))=[];
++				closed(selection(i)-(i-1))=[];
++			end
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestsegment.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestsegment.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestsegment.m	(revision 12996)
+@@ -0,0 +1,28 @@
++function [profsel indsel]=closestsegment(A,numprofiles,xi,yi)
++%CLOSESTSEGMENT - find the closest segment of a profile
++%
++%   This routine find the segment of the profile A that is the closest
++%   to (xi,yi) and return the number of the profile and the number of
++%   the first point belonging to this closest segment
++%
++%   Usage:
++%     [profsel indsel]=closestsegment(A,numprofiles,xi,yi) 
++
++	%loop over the middles of each profile, find the closest to (xi,yi)
++	profsel=0;
++	indsel=0;
++	first=1;
++	for i=1:numprofiles,
++		if length(A(i).x)>1
++			middles=[(A(i).x(1:end-1)+A(i).x(2:end))/2 (A(i).y(1:end-1)+A(i).y(2:end))/2];
++			distance=(xi-middles(:,1)).^2+(yi-middles(:,2)).^2;
++			[newdistance p]=min(distance);
++			if (first | (newdistance<olddistance)),
++				first=0;
++				indsel=p;
++				profsel=i;
++				olddistance=newdistance;
++			end
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addendprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addendprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addendprofile.m	(revision 12996)
+@@ -0,0 +1,86 @@
++function [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%ADDENDPROFILE - add point at the end of a n existing profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting...')
++		return
++	end	   
++	if ~any(~closed)
++		disp('all profiles are closed')
++		return
++	end	   
++	%select a profile first
++	if numprofiles>1
++		%first step, select a profile
++		isclosed=1;
++		title('click on a profile, RETURN to exit','FontSize',14)
++		while isclosed
++			[xi,yi] = ginput(1);
++			if ~isempty(xi)
++				%get the closest point 
++				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++				if closed(profsel)
++					disp('selected profile is closed, make another selection')
++				else
++					isclosed=0;
++				end
++
++			else
++				%RETURN -> out
++				return
++			end
++		end
++	else
++		profsel=1;
++	end
++
++	%initialize x and y
++	x=A(profsel).x;
++	y=A(profsel).y;
++
++	%plot the selected profile
++	hold on
++	plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++		'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++	loop=1;
++	while loop
++
++		%first step, select a profile
++		title('click to add point to the selected profile, RETURN to exit','FontSize',14)
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++			x(end+1,1)=xi;
++			y(end+1,1)=yi;
++
++			%plot everything
++			undoplots(prevplot);
++			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize')+2,'Marker',getfieldvalue(options,'Marker'));
++
++		else
++
++			%check that the profile is not empty
++			if ~isempty(x)
++				A(profsel).x=x; 
++				A(profsel).y=y; 
++				A(profsel).name=root; 
++				A(profsel).density=1; 
++				numpoints=numpoints+length(x);
++			end
++
++			%get out
++			loop=0;
++		end
++	end
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addendprofile.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addcontour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addcontour.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addcontour.m	(revision 12996)
+@@ -0,0 +1,50 @@
++function [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot,root,options);
++%ADDCONTOUR - add a closed contour
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot,root,options)
++		   
++	title('click to add a point to the new profile, RETURN to exit','FontSize',14)
++	hold on
++
++	loop=1;
++	x=[];
++	y=[];
++
++	while loop
++
++		[xi,yi] = ginput(1);
++					  
++		if ~isempty(xi)
++			x(end+1,1)=xi;
++			y(end+1,1)=yi;
++
++			%plot everything
++			undoplots(prevplot);
++			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++		else
++
++			%check that the profile is not empty
++			if ~isempty(x)
++				x(end+1)=x(1);
++				y(end+1)=y(1);
++				A(end+1).x=x; 
++				A(end).y=y; 
++				A(end).name=root; 
++				A(end).density=1; 
++				numprofiles=numprofiles+1;
++				numpoints=numpoints+length(x);
++				closed(end+1)=1;
++			end
++
++			%get out
++			loop=0;
++		end
++	end
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addcontour.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/mergeprofiles.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/mergeprofiles.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/mergeprofiles.m	(revision 12996)
+@@ -0,0 +1,152 @@
++function [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options);
++%MERGEPROFILES - merge profiles
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile. The user must select the two tips that
++%   he/she wants to merge
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options)
++
++hold on
++loop=1;
++
++%Take all the tips coordinates of open profiles
++counter=1; tips=[];
++for i=1:numprofiles
++	if ~closed(i),
++		%x and y coord, profile number, 1 if beginning, 2 and if end
++		if length(A(i).x)==1,
++			tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
++			counter=counter+1;
++		else
++			tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
++			tips(counter+1,:) = [A(i).x(end) A(i).y(end) i  2];
++			counter=counter+2;
++		end
++	end
++end
++
++if size(tips,1)<2
++	disp('at least one unclosed profile is required')
++	return
++end
++
++%plot the tips only
++plot(tips(:,1),tips(:,2),...
++	'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++firsttip=1;
++
++%loop (at least 2 clicks needed)
++while loop
++
++	%some checks
++	if size(tips,1)<2
++		disp('at least one unclosed profiles are required')
++		return
++	end
++
++	%select a point
++	if firsttip
++		title('click on the first tip, RETURN to exit','FontSize',14)
++	else
++		title('click on the second tip, RETURN to exit','FontSize',14)
++	end
++
++	[xi,yi] = ginput(1);
++
++	if ~isempty(xi)
++
++		if firsttip
++			%find the selected tip
++			distance=(xi-tips(:,1)).^2+(yi-tips(:,2)).^2;
++			[dmin tip1]=min(distance);
++			numprofile1=tips(tip1,3);
++			firsttip=0;
++
++			%remove tip1 from tips list
++			newtips=tips;
++			newtips(tip1,:)=[];
++
++			%plot selected tip
++			plot(tips(tip1,1),tips(tip1,2),...
++				'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++			plot(A(numprofile1).x,A(numprofile1).y,...
++				'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++
++		%second selection
++		else
++			distance=(xi-newtips(:,1)).^2+(yi-newtips(:,2)).^2;
++			[dmin tip2]=min(distance);
++			numprofile2=newtips(tip2,3);
++
++			if numprofile1==numprofile2
++				%close the profile
++				A(numprofile1).x(end+1)=A(numprofile1).x(1);
++				A(numprofile1).y(end+1)=A(numprofile1).y(1);
++				numpoints=numpoints+1;
++				closed(numprofile1)=1;
++
++			else
++
++				if tips(tip1,4)==1 & newtips(tip2,4)==1,
++					A(numprofile1).x=[flipud(A(numprofile2).x); A(numprofile1).x];
++					A(numprofile1).y=[flipud(A(numprofile2).y); A(numprofile1).y];
++					numprofiles=numprofiles-1;
++
++				elseif tips(tip1,4)==1 & newtips(tip2,4)==2,
++					A(numprofile1).x=[A(numprofile2).x; A(numprofile1).x];
++					A(numprofile1).y=[A(numprofile2).y; A(numprofile1).y];
++					numprofiles=numprofiles-1;
++
++				elseif tips(tip1,4)==2 & newtips(tip2,4)==1,
++					A(numprofile1).x=[A(numprofile1).x; A(numprofile2).x];
++					A(numprofile1).y=[A(numprofile1).y; A(numprofile2).y];
++					numprofiles=numprofiles-1;
++
++				elseif tips(tip1,4)==2 & newtips(tip2,4)==2,
++					A(numprofile1).x=[A(numprofile1).x; flipud(A(numprofile2).x)];
++					A(numprofile1).y=[A(numprofile1).y; flipud(A(numprofile2).y)];
++					numprofiles=numprofiles-1;
++				end
++
++				%delete profile2
++				A(numprofile2)=[];
++				closed(numprofile2)=[];
++
++			end
++
++			%update tips
++			counter=1; tips=[];
++			for i=1:numprofiles
++				if ~closed(i),
++					%x and y coord, profile number, 1 if beginning, 2 and if end
++					if length(A(i).x)==1,
++						tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
++						counter=counter+1;
++					else
++						tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
++						tips(counter+1,:) = [A(i).x(end) A(i).y(end) i  2];
++						counter=counter+2;
++					end
++				end
++			end
++
++			%plot new profile
++			undoplots(prevplot);
++			for i=1:numprofiles
++				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			end
++			if ~isempty(tips)
++				plot(tips(:,1),tips(:,2),...
++					'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++			end
++
++			%back to beginning
++			firsttip=1;
++		end
++	else
++		%RETRUN-> quit
++		loop=0;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile
++Makefile.in
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/downstreamflowlines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/downstreamflowlines.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/downstreamflowlines.m	(revision 12996)
+@@ -0,0 +1,110 @@
++function flowpath=downstreamflowlines(index,x,y,u,v,x0,y0,varargin)
++%DOWNSTREAMFLOWLINES - compute flowlines from a given set of seed points
++%
++%   Usage:
++%      flowpath=downstreamflowlines(index,x,y,u,v,x0,y0)
++%
++%   the velocity field is given by the couple (u,v) and the coordinates
++%   of the seed points are (x0,y0). One can use one or several seed 
++%   points
++%
++%   Example:
++%      flowpath=downstreamflowlines(md.mesh.elements,md.mesh.x,md.mesh.y,md.vx,md.initialization.vy,x0,y0)
++
++%check input size
++if nargin>9 | nargin<7,
++	help flowlines
++	error('flowlines error message: bad usage');
++end
++
++%check input
++if (length(x)~=length(y) | length(x)~=length(u) | length(x)~=length(v)),
++	error('flowlines error message: x,y,u and v must have the same length');
++end
++if length(x)<3,
++	error('flowlines error message: at least one element is required');
++end
++if length(x0)~=length(y0),
++	error('flowlines error message: x0 and y0 do not have the same length');
++end
++
++%get maxiter and precision
++if nargin==9
++	maxiter=varargin{1};%maximum number of iterations
++	precision=varargin{2}; %division of each segment (higer precision increases number of segments)
++else
++	maxiter=200; %maximum number of iterations
++	precision=1; %division of each segment (higer precision increases number of segments)
++end
++
++%check seed points
++tria=TriaSearch(index,x,y,x0,y0);
++pos=find(isnan(tria));
++x0(pos)=[];
++y0(pos)=[];
++
++%initialize other variables
++N=length(x0);
++X=x0; Y=y0;
++flowpath=struct('x',cell(N,1),'y',cell(N,1),'name','','density',1);
++for i=1:N,
++	flowpath(i).x=x0(i);
++	flowpath(i).y=y0(i);
++end
++done=zeros(N,1);
++
++%get avegared length of each element
++length_tria=1/3*(sqrt( (x(index(:,1))-x(index(:,2))).^2+(y(index(:,1))-y(index(:,2))).^2 )+...
++	sqrt((x(index(:,1))-x(index(:,3))).^2+(y(index(:,1))-y(index(:,3))).^2 )+...
++	sqrt((x(index(:,2))-x(index(:,3))).^2+(y(index(:,2))-y(index(:,3))).^2 ));
++
++%take velocity for each element
++u=u(index)*[1;1;1]/3;
++v=v(index)*[1;1;1]/3;
++
++%initialization:
++counter=1;
++
++while any(~done) 
++
++	%find current triangle
++	queue=find(~done);
++	tria=TriaSearch(index,x,y,X(queue),Y(queue));
++
++	%check that the point is actually inside a triangle of the mesh
++	listnan=find(isnan(tria));
++	for i=1:length(listnan)
++		%remove the last point
++		flowpath(queue(listnan(i))).x(end)=[];
++		flowpath(queue(listnan(i))).y(end)=[];
++		done(queue(listnan(i)))=1;
++	end
++	tria(listnan)=[]; 
++	queue(listnan)=[];
++
++	if isempty(tria),
++		break;
++	end
++
++	%velocity of the current triangle and norm it
++	ut=u(tria); vt=v(tria); normv=sqrt(ut.^2+vt.^2);
++	ut=ut./normv;vt=vt./normv;
++
++	%check counter
++	if counter>maxiter
++		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going forward'])
++		break
++	end
++	counter=counter+1;
++
++	%remove stagnant point
++	done(queue(find(ut==0 & vt==0)))=1;
++
++	%build next point
++	for i=1:length(queue)
++		X(queue(i))=flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision;
++		Y(queue(i))=flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision;
++		flowpath(queue(i)).x=[flowpath(queue(i)).x;flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision];
++		flowpath(queue(i)).y=[flowpath(queue(i)).y;flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision];
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expflip.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expflip.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expflip.m	(revision 12996)
+@@ -0,0 +1,19 @@
++function expflip(domainname)
++%EXPFLIP: flip orientation of all contours and domains in domainname exp file.
++%
++%Usage: expflip('MassFlux1.exp');a
++%
++%
++
++
++
++
++
++a=expread(domainname,1);
++
++for i=1:length(a),
++	a(i).x=flipud(a(i).x);
++	a(i).y=flipud(a(i).y);
++end
++
++expwrite(a,domainname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcoarsen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcoarsen.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcoarsen.m	(revision 12996)
+@@ -0,0 +1,74 @@
++function expcoarsen(newfile,oldfile,resolution);
++%EXPCOARSEN - coarsen an exp contour
++%
++%   This routine read an Argus file and remove points with respect to
++%   the resolution (in meters) given in input. 
++%
++%   Usage:
++%      expcoarsen(newfile,oldfile,resolution)
++%
++%   Example:
++%       expcoarsen('DomainOutline.exp','Antarctica.exp',4000)
++
++%Some checks
++if nargin~=3 | nargout
++	error('expcoarsen usage: expcoarsen(newfile,oldfile,resolution)')
++elseif ~exist(oldfile)
++	error(['expcut error message: the file ' oldfile  'does not exist'])
++elseif exist(newfile),
++	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
++	if ~strcmpi(choice,'y'),
++		disp('no modification done ... exiting');
++		return;
++	end
++end
++
++%Get exp oldfile
++[path root ext ver]=fileparts(oldfile);
++A=expread(oldfile);
++numprofiles=size(A,2);
++
++%Go through the profiles
++count=1;
++while count<=numprofiles,
++
++	%get number of points and initialize j
++	numpoints=length(A(count).x);
++	j=1;
++
++	%stop if we have reached end of profile (always keep the last point)
++	while j<numpoints,
++
++		%See whether we keep this point or not
++		distance=sqrt((A(count).x(j)-A(count).x(j+1))^2+(A(count).y(j)-A(count).y(j+1))^2);
++		if distance<resolution & j<numpoints-1  %do not remove last point
++			A(count).x(j+1)=[];
++			A(count).y(j+1)=[];
++			numpoints=numpoints-1;
++		else
++			division=floor(distance/resolution)+1;
++			if division>=2,
++				x=linspace(A(count).x(j),A(count).x(j+1),division)';
++				y=linspace(A(count).y(j),A(count).y(j+1),division)';
++				A(count).x=[A(count).x(1:j);x(2:end-1); A(count).x(j+1:end)];
++				A(count).y=[A(count).y(1:j);y(2:end-1); A(count).y(j+1:end)];
++
++				%update current point
++				j=j+1+division-2;
++				numpoints=numpoints+division-2;
++			else
++				%update current point
++				j=j+1;
++			end
++		end
++	end
++	if length(A(count).x)<=1,
++		A(count)=[];
++		numprofiles=numprofiles-1;
++	else
++		count=count+1;
++	end
++end
++
++%write output
++expwrite(A,newfile);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expmaster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expmaster.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expmaster.m	(revision 12996)
+@@ -0,0 +1,2 @@
++function expmaster(newfile,varargin)
++	disp('expmaster has been renamed exptool due to the unpopularity of its name')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exporientation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exporientation.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exporientation.m	(revision 12996)
+@@ -0,0 +1,12 @@
++function exporientation(filename)
++
++a=expread(filename);
++
++dx=diff(a.x);
++dx=[dx;dx(end)];
++
++dy=diff(a.y);
++dy=[dy;dy(end)];
++
++quiver(a.x,a.y,dx,dy);
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsplit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsplit.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsplit.m	(revision 12996)
+@@ -0,0 +1,31 @@
++function expsplit(domainoutline)
++%EXPSPLIT - split exp file into sub-contours
++%
++%   This routine reads in a domain outline file (Argus format) and plots all the contours 
++%   This will create as many files there are contours in the domain, each file will be postfix with _i
++%   where i is the contour name. 
++%
++%   Usage:
++%      expsplit(domainoutline)
++%
++%   Example:
++%      expsplit('Domain.exp');
++%
++%   See also EXPMASTER, EXPDOC
++
++%check nargin
++if ~nargin | nargin>1
++	help expsplit
++	error('expsplit error message: bad usage');
++end
++
++[path,root,ext]=fileparts(domainoutline);
++
++%Read file: 
++domains=expread(domainoutline,1);
++
++%split and write contours: 
++for i=1:length(domains),
++	subdomain=domains(i);
++	expwrite(subdomain,[root '_' num2str(i)  ext]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expswapxy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expswapxy.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expswapxy.m	(revision 12996)
+@@ -0,0 +1,23 @@
++function expswapxy(filename)
++%EXPSWAP - swap x and y fields
++% 
++%   Usage:
++%      expswap(file)
++%
++%   See also EXPMASTER, EXPDOC
++
++
++contours=expread(filename,1);
++
++newcontours=contours(1);
++
++for i=1:length(contours), 
++	contour=contours(i);
++	newcontour=contour;
++	newcontour.x=contour.y;
++	newcontour.y=contour.x;
++	newcontours(end+1)=newcontour;
++end
++newcontours=newcontours(2:end);
++
++expwrite(newcontours,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/explink.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/explink.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/explink.m	(revision 12996)
+@@ -0,0 +1,29 @@
++function explink(domainoutline,minthreshold,step)
++%EXPLINK - allow to link several segments of domain outline together
++%
++%   Takes a domain outline made of various segments, and links them together in one 
++%   domain outline. Use expview to see end result.
++%
++%   Usage:
++%      explink(domainoutline,minthreshold,step)
++%
++%   See also EXPMASTER, EXPDOC
++
++notdone=1;
++
++while notdone,
++
++	for i=1:1000,
++		status=expconcatenate(domainoutline,minthreshold+(i-1)*step);
++		if status==0,
++			return;
++		end
++		if status==1,
++			break;
++		end
++		if status==-1,
++			continue;
++		end
++	end
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdisp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdisp.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdisp.m	(revision 12996)
+@@ -0,0 +1,52 @@
++function expdisp(domainoutline,varargin)
++%EXPDISP - plot the contours of a domain outline file
++%
++%   This routine reads in a domain outline file (Argus format) and plots all the contours 
++%
++%   Usage:
++%      expdisp(domainoutline,varargin)
++%      expdisp(domainoutline,figurenumber,linestyle,linewidth,unitmultiplier)
++%
++%   Example:
++%      expdisp('Domain.exp',1,'--r',2,10^3);
++%
++%   See also EXPMASTER, EXPDOC
++
++%check nargin
++if ~nargin | nargin>5
++	help expdisp
++	error('expdisp error message: bad usage');
++end
++
++%parse input
++if nargin<=1,
++	figurenumber=1;
++else
++	figurenumber=varargin{1};
++end
++if nargin<=2
++	linestyle='r-';
++else
++	linestyle=varargin{2};
++end
++if nargin<=3
++	linewidth=1;
++else
++	linewidth=varargin{3};
++end
++if nargin<=4
++	unitmultiplier=1;
++else
++	unitmultiplier=varargin{4}; if isnan(unitmultiplier), unitmultiplier=1; end
++end
++
++domain=expread(domainoutline);
++
++figure(figurenumber),hold on
++for i=1:length(domain),
++	if (isnumeric(linestyle))
++		plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'Color',linestyle,'linewidth',linewidth);
++	else
++		plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,linestyle,'linewidth',linewidth);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsquare.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsquare.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsquare.m	(revision 12996)
+@@ -0,0 +1,45 @@
++function expbox(filename)
++%EXPBOX - Create a ARGUS file using to clicks
++%
++%   Two clicks on a plot are used to generate a rectangular box
++%   This box is written in EXP format on filename
++%
++%   Usage:
++%      expbox(filename)
++
++%check
++if exist(filename,'file'),
++	choice=input(['A file ' filename ' already exists, do you want to modify it? (y/n)'],'s');
++	if ~strcmpi(choice,'y'),
++		disp('no modification done ... exiting');
++		return
++	end
++end
++
++%Get points
++disp('Click twice to define a rectangular domain. First click for upper left corner, second for lower right corner');
++[x,y]=ginput(2);
++
++xmiddle=mean(x);
++ymiddle=mean(y);
++
++x1=x(1); y1=y(1);
++x3=x(2); y3=y(2);
++
++Diag=[x1-xmiddle;y1-ymiddle];
++
++Vector=[xmiddle;ymiddle]+[-Diag(2);Diag(1)];
++x2=Vector(1); y2=Vector(2);
++
++Vector=[xmiddle;ymiddle]-[-Diag(2);Diag(1)];
++x4=Vector(1); y4=Vector(2);
++
++%Build Exp structure
++A=struct();
++A.nods=5;
++A.density=1;
++A.x=[x1 x2 x3 x4 x1]';
++A.y=[y1 y2 y3 y4 y1]';
++
++%Write structure
++expwrite(A,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdoc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdoc.m	(revision 12996)
+@@ -0,0 +1,36 @@
++function expdoc()
++%EXPDOC - create a doc for EXP routines
++%
++%   Usage:
++%      expdoc()
++
++disp(' ');
++disp('   Utilities dedicated to ARGUS Files (''.exp'' extension)'); 
++disp('     expboxgen: creates a domain outline box for a .tif image for the mosaic tiff');
++disp('            usage: expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)');
++disp('            x0,y0 and nx,ny are the cropping coordinates (upper left and lower right corners in the larger tiff image)');
++disp('            paramter_filename is the parameter file name for the mosaic tiff image. box_filename is self explanatory.');
++disp('     expconcatenate: display all the profiles present in an Argus file and merge them accordingly to the tips selected by the user')
++disp('            usage:  expconcatenate(newfile,oldfile)')
++disp('     expcreatecircle: creates a closed Argus contour centered on (x,y), of radius radius_length. The contour is made of N points');
++disp('            usage: expcreatecircle(filename,x0,y0,radius_length,N)');
++disp('     expcreatecontour: creates a closed Argus contour delimited by the ''clicks'' of the user');
++disp('            usage: expcreatecontour(filename)');
++disp('     expcreateprofile: creates an Argus profile delimited by the ''clicks'' of the user');
++disp('            usage: expcreateprofile(filename)');
++disp('     expcut: display the contents of an Argus file and allow the user cut the profiles');
++disp('            usage: expcut(newfilename,oldfilename)');
++disp('     expdisp: display the contents of an Argus file');
++disp('            usage:  expdisp(filename,[figure number],[line style])');
++disp('     expgen: creates an Argus file from a contour (x,y) and a flag indicating if the contour must be closed or open');
++disp('            usage:  expgen(filename,contours,close_flag)');
++disp('     explink: takes a domain outline made of various segments, and links them together in one domain outline. Use expview to see end result');
++disp('            usage: explink(domainoutline,minthreshold,step)');
++disp('     exptool: allows the user to create, close, merge, remove,... Argus files and save the result in newfile');
++disp('            usage: exptool(newfile,[oldfile1],[oldfile2],[oldfile3],[...]');
++disp('     expread: reads an Argus file and build a structure that holds all the information of the file');
++disp('            usage: expread(file,close_flag)');
++disp('     expselect: display all the profiles of oldfile, the user clicks on the contour he/she wants to remove. Results saved in newfile');
++disp('            usage: expselect(newfile,oldfile)');
++disp('     expwrite: writes an Argus file from a structure given in input???');
++disp('            usage: expwrite(structure,filename)');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ElementsFromEdge.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ElementsFromEdge.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ElementsFromEdge.m	(revision 12996)
+@@ -0,0 +1,15 @@
++function edgeelements=ElementsFromEdge(elements,A,B) 
++%ELEMENTSFROMEDGE: find elements connected to one edge defined by nodes A and B
++%
++% Usage: edgeelements=ElementsFromEdge(elements,A,B) 
++%
++% Eg:    edgeelements=ElementsFromEdge(md.mesh.elements,tip1,tip2)
++%
++%
++edgeelements=find(...
++(elements(:,1)==A & elements(:,2)==B )| ...
++(elements(:,1)==A & elements(:,3)==B )| ...
++(elements(:,2)==A & elements(:,3)==B )| ...
++(elements(:,2)==A & elements(:,1)==B )| ...
++(elements(:,3)==A & elements(:,1)==B )| ...
++(elements(:,3)==A & elements(:,2)==B ));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MergeMetrics.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MergeMetrics.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MergeMetrics.m	(revision 12996)
+@@ -0,0 +1,15 @@
++function metric=MergeMetrics(metric1,metric2)
++
++M1xx=metric1(:,1); M1xy=metric1(:,2); M1yy=metric1(:,3);
++M1lambda1=0.5*((M1xx+M1yy)+sqrt(4*M1xy.^2+(M1xx-M1yy).^2));
++M1lambda2=0.5*((M1xx+M1yy)-sqrt(4*M1xy.^2+(M1xx-M1yy).^2));
++lambda1=min(M1lambda1,M1lambda2);
++
++M2xx=metric1(:,1); M2xy=metric1(:,2); M2yy=metric1(:,3);
++M2lambda1=0.5*((M2xx+M2yy)+sqrt(4*M2xy.^2+(M2xx-M2yy).^2));
++M2lambda2=0.5*((M2xx+M2yy)-sqrt(4*M2xy.^2+(M2xx-M2yy).^2));
++lambda2=min(M2lambda2,M2lambda2);
++
++metric=metric1;
++pos=find(lambda2<lambda1);
++metric(pos,:)=metric2(pos,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/NodeInElement.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/NodeInElement.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/NodeInElement.m	(revision 12996)
+@@ -0,0 +1,41 @@
++function node_in_element=NodeInElement(newx,newy,elements,x,y,nodeconnectivity);
++%NODEINELEMENT: find for a list of nodes (in newx,newy), which elements in the mesh (elements,x,y) they belong to.
++%
++%  Usage: node_in_element=NodeInElement(newx,newy,elements,x,y,md.mesh.vertexconnectivity);
++%
++%  See also Nodeconnectivity
++%
++epsilon=10^-10;
++
++%compute some quantities that will speed up the process
++x3x1=x(elements(:,1))-x(elements(:,3));
++y3y1=y(elements(:,1))-y(elements(:,3));
++x3x2=x(elements(:,2))-x(elements(:,3));
++y3y2=y(elements(:,2))-y(elements(:,3));
++x3=x(elements(:,3));
++y3=y(elements(:,3));
++delta=x(elements(:,2)).*y(elements(:,3))-y(elements(:,2)).*x(elements(:,3))-x(elements(:,1)).*y(elements(:,3))+y(elements(:,1)).*x(elements(:,3))+x(elements(:,1)).*y(elements(:,2))-y(elements(:,1)).*x(elements(:,2));
++
++%max connectivity:
++max_connectivity=max(nodeconnectivity(:,end));
++node_in_element=zeros(length(newx),max_connectivity+1); %last column is the number of elements to which the row node is connected.
++
++for i=1:length(newx),
++	x0=newx(i);
++	y0=newy(i);
++	
++	%first area coordinate
++	area_1=(y3y2.*(x0-x3)-x3x2.*(y0-y3))./delta;
++	%second area coordinate
++	area_2=(x3x1.*(y0-y3)-y3y1.*(x0-x3))./delta;
++	%third area coordinate
++	area_3=1-area_1-area_2;
++	
++	%get elements for which all area coordinates are positive (meaning (x0,y0) belongs to these elements
++	pos=find((area_1>=0-epsilon) & (area_2>=0-epsilon) & (area_3>=0-epsilon));
++
++	num_elements=length(pos);
++
++	node_in_element(i,1:num_elements)=pos;
++	node_in_element(i,end)=num_elements;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeHessian.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeHessian.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeHessian.m	(revision 12996)
+@@ -0,0 +1,60 @@
++function hessian=ComputeHessian(index,x,y,field,type)
++%COMPUTEHESSIAN - compute hessian matrix from a field
++%
++%   Compute the hessian matrix of a given field
++%   return the three components Hxx Hxy Hyy
++%   for each element or each node
++%
++%   Usage:
++%      hessian=ComputeHessian(index,x,y,field,type)
++%
++%   Example:
++%      hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vel_obs,'node')
++
++%some variables
++numberofnodes=length(x);
++numberofelements=size(index,1);
++
++%some checks
++if length(field)~=numberofnodes & length(field)~=numberofelements,
++	error('ComputeHessian error message: the given field size not supported yet');
++end
++if strcmpi(type,'node') & strcmpi(type,'element'),
++	error('ComputeHessian error message: only ''node'' or ''element'' type supported yet');
++end
++
++%initialization
++line=index(:);
++linesize=3*numberofelements;
++
++%get areas and  nodal functions coefficients N(x,y)=alpha x + beta y + gamma 
++[alpha beta]=GetNodalFunctionsCoeff(index,x,y);
++areas=GetAreas(index,x,y);
++
++%comput weights that holds the volume of all the element holding the node i
++weights=sparse(line,ones(linesize,1),repmat(areas,3,1),numberofnodes,1);
++
++%compute field on nodes if on elements
++if length(field)==numberofelements,
++	field=sparse(line,ones(linesize,1),repmat(areas.*field,3,1),numberofnodes,1)./weights ;
++end
++
++%Compute gradient for each element
++grad_elx=sum(field(index).*alpha,2); 
++grad_ely=sum(field(index).*beta,2);
++
++%Compute gradient for each node (average of the elements around)
++gradx=sparse(line,ones(linesize,1),repmat(areas.*grad_elx,3,1),numberofnodes,1);
++grady=sparse(line,ones(linesize,1),repmat(areas.*grad_ely,3,1),numberofnodes,1);
++gradx=gradx./weights;
++grady=grady./weights;
++
++%Compute hessian for each element
++hessian=[sum(gradx(index).*alpha,2) sum(grady(index).*alpha,2) sum(grady(index).*beta,2)];
++
++if strcmpi(type,'node')
++	%Compute Hessian on the nodes (average of the elements around)
++	hessian=[sparse(line,ones(linesize,1),repmat(areas.*hessian(:,1),3,1),numberofnodes,1)./weights ...
++		sparse(line,ones(linesize,1),repmat(areas.*hessian(:,2),3,1),numberofnodes,1)./weights ...
++		sparse(line,ones(linesize,1),repmat(areas.*hessian(:,3),3,1),numberofnodes,1)./weights ];
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/meshread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/meshread.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/meshread.m	(revision 12996)
+@@ -0,0 +1,41 @@
++function Struct=meshread(filename);
++
++%some checks
++if ~exist(filename),
++	error(['meshread error message: file ' filename ' not found!']);
++end
++
++fid=fopen(filename,'r');
++
++while (~feof(fid)),
++
++	A=fscanf(fid,'%s',1);
++
++	if strcmp(A,'MeshVersionFormatted');
++		Struct.Version=fscanf(fid,'%s',1);
++
++	elseif strcmp(A,'Dimension'),
++		Struct.Dimension=fscanf(fid,'%i',1);
++
++	elseif strcmp(A,'Vertices'),
++		Struct.nods=fscanf(fid,'%i',1);
++		A=fscanf(fid,'%f %f %f',[3 Struct.nods]);
++		Struct.x=A(1,:)';
++		Struct.y=A(2,:)';
++
++	elseif strcmp(A,'Triangles'),
++		Struct.nels=fscanf(fid,'%i',1);
++		A=fscanf(fid,'%i %i %i',[4 Struct.nels]);
++		Struct.index=A(1:3,:)';
++
++	elseif strcmp(A,'Quadrilaterals'),
++		Struct.nels=fscanf(fid,'%i',1);
++		A=fscanf(fid,'%i %i %i %i',[5 Struct.nels]);
++		Struct.index=A(1:4,:)';
++	else
++		%do nothing
++
++	end
++end
++
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetNodalFunctionsCoeff.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetNodalFunctionsCoeff.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetNodalFunctionsCoeff.m	(revision 12996)
+@@ -0,0 +1,56 @@
++function [alpha beta varargout]=GetNodalFunctionsCoeff(index,x,y)
++%GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
++%
++%   Compute the coefficients alpha beta and optionaly gamma of
++%   2d triangular elements. For each element, the nodal function
++%   is defined as:
++%   N(x,y)=sum(i=1:3) alpha_i * x + beta_i * y + gamma_i
++%
++%   Usage:
++%      [alpha beta]=GetNodalFunctionsCoeff(index,x,y);
++%      [alpha beta gamma]=GetNodalFunctionsCoeff(index,x,y);
++%
++%   Example:
++%      [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
++
++%make columns out of x and y
++x=x(:); y=y(:);
++
++%get nels and nods
++nels=size(index,1);
++nods=length(x);
++
++%some checks
++if nargin~=3 | (nargout~=2 & nargout~=3),
++	help GetNodalFunctionsCoeff
++	error('GetNodalFunctionsCoeff error message: bad usage')
++end
++if length(y)~=nods,
++	error('GetNodalFunctionsCoeff error message: x and y do not have the same length')
++end
++if max(index(:))>nods,
++	error(['GetNodalFunctionsCoeff error message: index should not have values above ' num2str(nods) ])
++end
++if size(index,2)~=3,
++	error('GetNodalFunctionsCoeff error message: only 2d meshes supported. index should have 3 columns.')
++end
++
++%initialize output
++alpha=zeros(nels,3);
++beta=zeros(nels,3);
++
++%compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
++x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
++y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
++invdet=1./(x1.*(y2-y3)-x2.*(y1-y3)+x3.*(y1-y2));
++
++%get alpha and beta
++alpha=[invdet.*(y2-y3) invdet.*(y3-y1) invdet.*(y1-y2)];
++beta =[invdet.*(x3-x2) invdet.*(x1-x3) invdet.*(x2-x1)];
++
++%get gamma if requested
++if nargout==3,
++	gamma=zeros(nels,3);
++	gamma=[invdet.*(x2.*y3-x3.*y2) invdet.*(y1.*x3-y3.*x1) invdet.*(x1.*y2-x2.*y1)];
++	varargout{1}=gamma;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/intersections.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/intersections.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/intersections.m	(revision 12996)
+@@ -0,0 +1,279 @@
++function [x0,y0,iout,jout] = intersections(x1,y1,x2,y2,robust)
++%INTERSECTIONS Intersections of curves.
++%   Computes the (x,y) locations where two curves intersect.  The curves
++%   can be broken with NaNs or have vertical segments.
++%
++% Example:
++%   [X0,Y0] = intersections(X1,Y1,X2,Y2,ROBUST);
++%
++% where X1 and Y1 are equal-length vectors of at least two points and
++% represent curve 1.  Similarly, X2 and Y2 represent curve 2.
++% X0 and Y0 are column vectors containing the points at which the two
++% curves intersect.
++%
++% ROBUST (optional) set to 1 or true means to use a slight variation of the
++% algorithm that might return duplicates of some intersection points, and
++% then remove those duplicates.  The default is true, but since the
++% algorithm is slightly slower you can set it to false if you know that
++% your curves don't intersect at any segment boundaries.  Also, the robust
++% version properly handles parallel and overlapping segments.
++%
++% The algorithm can return two additional vectors that indicate which
++% segment pairs contain intersections and where they are:
++%
++%   [X0,Y0,I,J] = intersections(X1,Y1,X2,Y2,ROBUST);
++%
++% For each element of the vector I, I(k) = (segment number of (X1,Y1)) +
++% (how far along this segment the intersection is).  For example, if I(k) =
++% 45.25 then the intersection lies a quarter of the way between the line
++% segment connecting (X1(45),Y1(45)) and (X1(46),Y1(46)).  Similarly for
++% the vector J and the segments in (X2,Y2).
++%
++% You can also get intersections of a curve with itself.  Simply pass in
++% only one curve, i.e.,
++%
++%   [X0,Y0] = intersections(X1,Y1,ROBUST);
++%
++% where, as before, ROBUST is optional.
++
++% Version: 1.10, 25 February 2008
++% Author:  Douglas M. Schwarz
++% Email:   dmschwarz=ieee*org, dmschwarz=urgrad*rochester*edu
++% Real_email = regexprep(Email,{'=','*'},{'@','.'})
++
++
++% Theory of operation:
++%
++% Given two line segments, L1 and L2,
++%
++%   L1 endpoints:  (x1(1),y1(1)) and (x1(2),y1(2))
++%   L2 endpoints:  (x2(1),y2(1)) and (x2(2),y2(2))
++%
++% we can write four equations with four unknowns and then solve them.  The
++% four unknowns are t1, t2, x0 and y0, where (x0,y0) is the intersection of
++% L1 and L2, t1 is the distance from the starting point of L1 to the
++% intersection relative to the length of L1 and t2 is the distance from the
++% starting point of L2 to the intersection relative to the length of L2.
++%
++% So, the four equations are
++%
++%    (x1(2) - x1(1))*t1 = x0 - x1(1)
++%    (x2(2) - x2(1))*t2 = x0 - x2(1)
++%    (y1(2) - y1(1))*t1 = y0 - y1(1)
++%    (y2(2) - y2(1))*t2 = y0 - y2(1)
++%
++% Rearranging and writing in matrix form,
++%
++%  [x1(2)-x1(1)       0       -1   0;      [t1;      [-x1(1);
++%        0       x2(2)-x2(1)  -1   0;   *   t2;   =   -x2(1);
++%   y1(2)-y1(1)       0        0  -1;       x0;       -y1(1);
++%        0       y2(2)-y2(1)   0  -1]       y0]       -y2(1)]
++%
++% Let's call that A*T = B.  We can solve for T with T = A\B.
++%
++% Once we have our solution we just have to look at t1 and t2 to determine
++% whether L1 and L2 intersect.  If 0 <= t1 < 1 and 0 <= t2 < 1 then the two
++% line segments cross and we can include (x0,y0) in the output.
++%
++% In principle, we have to perform this computation on every pair of line
++% segments in the input data.  This can be quite a large number of pairs so
++% we will reduce it by doing a simple preliminary check to eliminate line
++% segment pairs that could not possibly cross.  The check is to look at the
++% smallest enclosing rectangles (with sides parallel to the axes) for each
++% line segment pair and see if they overlap.  If they do then we have to
++% compute t1 and t2 (via the A\B computation) to see if the line segments
++% cross, but if they don't then the line segments cannot cross.  In a
++% typical application, this technique will eliminate most of the potential
++% line segment pairs.
++
++
++% Input checks.
++error(nargchk(2,5,nargin))
++
++% Adjustments when fewer than five arguments are supplied.
++switch nargin
++	case 2
++		robust = true;
++		x2 = x1;
++		y2 = y1;
++		self_intersect = true;
++	case 3
++		robust = x2;
++		x2 = x1;
++		y2 = y1;
++		self_intersect = true;
++	case 4
++		robust = true;
++		self_intersect = false;
++	case 5
++		self_intersect = false;
++end
++
++% x1 and y1 must be vectors with same number of points (at least 2).
++if sum(size(x1) > 1) ~= 1 || sum(size(y1) > 1) ~= 1 || ...
++		length(x1) ~= length(y1)
++	error('X1 and Y1 must be equal-length vectors of at least 2 points.')
++end
++% x2 and y2 must be vectors with same number of points (at least 2).
++if sum(size(x2) > 1) ~= 1 || sum(size(y2) > 1) ~= 1 || ...
++		length(x2) ~= length(y2)
++	error('X2 and Y2 must be equal-length vectors of at least 2 points.')
++end
++
++
++% Force all inputs to be column vectors.
++x1 = x1(:);
++y1 = y1(:);
++x2 = x2(:);
++y2 = y2(:);
++
++% Compute number of line segments in each curve and some differences we'll
++% need later.
++n1 = length(x1) - 1;
++n2 = length(x2) - 1;
++xy1 = [x1 y1];
++xy2 = [x2 y2];
++dxy1 = diff(xy1);
++dxy2 = diff(xy2);
++
++% Determine the combinations of i and j where the rectangle enclosing the
++% i'th line segment of curve 1 overlaps with the rectangle enclosing the
++% j'th line segment of curve 2.
++[i,j] = find(repmat(min(x1(1:end-1),x1(2:end)),1,n2) <= ...
++	repmat(max(x2(1:end-1),x2(2:end)).',n1,1) & ...
++	repmat(max(x1(1:end-1),x1(2:end)),1,n2) >= ...
++	repmat(min(x2(1:end-1),x2(2:end)).',n1,1) & ...
++	repmat(min(y1(1:end-1),y1(2:end)),1,n2) <= ...
++	repmat(max(y2(1:end-1),y2(2:end)).',n1,1) & ...
++	repmat(max(y1(1:end-1),y1(2:end)),1,n2) >= ...
++	repmat(min(y2(1:end-1),y2(2:end)).',n1,1));
++
++% For one segment in x1,y1, i and j are returned as row vectors.  They
++% need to be column vectors, or iout and jout below will err out.
++% (jes, 6/11/10)
++
++if (size(i,1) == 1)
++    i=i';
++end
++if (size(j,1) == 1)
++    j=j';
++end
++
++% Find segments pairs which have at least one vertex = NaN and remove them.
++% This line is a fast way of finding such segment pairs.  We take
++% advantage of the fact that NaNs propagate through calculations, in
++% particular subtraction (in the calculation of dxy1 and dxy2, which we
++% need anyway) and addition.
++% At the same time we can remove redundant combinations of i and j in the
++% case of finding intersections of a line with itself.
++if self_intersect
++	remove = isnan(sum(dxy1(i,:) + dxy2(j,:),2)) | j <= i + 1;
++else
++	remove = isnan(sum(dxy1(i,:) + dxy2(j,:),2));
++end
++i(remove) = [];
++j(remove) = [];
++
++% Initialize matrices.  We'll put the T's and B's in matrices and use them
++% one column at a time.  AA is a 3-D extension of A where we'll use one
++% plane at a time.
++n = length(i);
++T = zeros(4,n);
++AA = zeros(4,4,n);
++AA([1 2],3,:) = -1;
++AA([3 4],4,:) = -1;
++AA([1 3],1,:) = dxy1(i,:).';
++AA([2 4],2,:) = dxy2(j,:).';
++B = -[x1(i) x2(j) y1(i) y2(j)].';
++
++% Loop through possibilities.  Trap singularity warning and then use
++% lastwarn to see if that plane of AA is near singular.  Process any such
++% segment pairs to determine if they are colinear (overlap) or merely
++% parallel.  That test consists of checking to see if one of the endpoints
++% of the curve 2 segment lies on the curve 1 segment.  This is done by
++% checking the cross product
++%
++%   (x1(2),y1(2)) - (x1(1),y1(1)) x (x2(2),y2(2)) - (x1(1),y1(1)).
++%
++% If this is close to zero then the segments overlap.
++
++% If the robust option is false then we assume no two segment pairs are
++% parallel and just go ahead and do the computation.  If A is ever singular
++% a warning will appear.  This is faster and obviously you should use it
++% only when you know you will never have overlapping or parallel segment
++% pairs.
++
++if robust
++	overlap = false(1,n);
++	warning_state = warning('off','MATLAB:singularMatrix');
++	% Use try-catch to guarantee original warning state is restored.
++	try
++		lastwarn('')
++		for k = 1:n
++			T(:,k) = AA(:,:,k)\B(:,k);
++			[unused,last_warn] = lastwarn;
++			lastwarn('')
++			if strcmp(last_warn,'MATLAB:singularMatrix')
++				% Force in_range(k) to be false.
++				T(1,k) = NaN;
++				% Determine if these segments overlap or are just parallel.
++				overlap(k) = rcond([dxy1(i(k),:);xy2(j(k),:) - xy1(i(k),:)]) < eps;
++			end
++		end
++		warning(warning_state)
++	catch
++		warning(warning_state)
++		rethrow(lasterror)
++	end
++	% Find where t1 and t2 are between 0 and 1 and return the corresponding
++	% x0 and y0 values.
++	in_range = T(1,:) >= 0 & T(2,:) >= 0 & T(1,:) <= 1 & T(2,:) <= 1;
++	% For overlapping segment pairs the algorithm will return an
++	% intersection point that is at the center of the overlapping region.
++	if any(overlap)
++		ia = i(overlap);
++		ja = j(overlap);
++		% set x0 and y0 to middle of overlapping region.
++		T(3,overlap) = (max(min(x1(ia),x1(ia+1)),min(x2(ja),x2(ja+1))) + ...
++			min(max(x1(ia),x1(ia+1)),max(x2(ja),x2(ja+1)))).'/2;
++		T(4,overlap) = (max(min(y1(ia),y1(ia+1)),min(y2(ja),y2(ja+1))) + ...
++			min(max(y1(ia),y1(ia+1)),max(y2(ja),y2(ja+1)))).'/2;
++		selected = in_range | overlap;
++	else
++		selected = in_range;
++	end
++	xy0 = T(3:4,selected).';
++	
++	% Remove duplicate intersection points.
++	[xy0,index] = unique(xy0,'rows');
++	x0 = xy0(:,1);
++	y0 = xy0(:,2);
++	
++	% Compute how far along each line segment the intersections are.
++	if nargout > 2
++		sel_index = find(selected);
++		sel = sel_index(index);
++		iout = i(sel) + T(1,sel).';
++		jout = j(sel) + T(2,sel).';
++	end
++else % non-robust option
++	for k = 1:n
++		[L,U] = lu(AA(:,:,k));
++		T(:,k) = U\(L\B(:,k));
++	end
++	
++	% Find where t1 and t2 are between 0 and 1 and return the corresponding
++	% x0 and y0 values.
++	in_range = T(1,:) >= 0 & T(2,:) >= 0 & T(1,:) < 1 & T(2,:) < 1;
++	x0 = T(3,in_range).';
++	y0 = T(4,in_range).';
++	
++	% Compute how far along each line segment the intersections are.
++	if nargout > 2
++		iout = i(in_range) + T(1,in_range).';
++		jout = j(in_range) + T(2,in_range).';
++	end
++end
++
++% Plot the results (useful for debugging).
++% plot(x1,y1,x2,y2,x0,y0,'ok');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCallFromMetric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCallFromMetric.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCallFromMetric.m	(revision 12996)
+@@ -0,0 +1,65 @@
++function md=BamgCallFromMetric(md,metric,gradation),
++%BAMGCALL - call bam
++%
++%   call Bamg and the output mesh is plugged onto the model
++%   -gradation = maximum edge length gradation between 2 elements
++%
++%   Usage:
++%      md=BamgCallFromMetric(md,metric,gradation);
++%
++%   Example:
++%      md=BamgCall(md,metric,1500,10^8,1.3,0.9);
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%write files
++t1=clock; fprintf('%s','      writing initial mesh files...');
++fid=fopen('carre0.met','w');
++fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
++fprintf(fid,'%i %i %i\n',metric');
++fclose(fid);
++
++fid=fopen('carre0.mesh','w');
++
++%initialiation
++fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
++
++%dimension
++fprintf(fid,'\n%s\n%i\n','Dimension',2);
++
++%Vertices
++fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
++fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
++
++%Triangles
++fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
++fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
++numberofelements1=md.mesh.numberofelements;
++
++%close
++fclose(fid);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%call bamg
++fprintf('%s\n','      call Bamg...');
++system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
++
++%plug new mesh
++t1=clock; fprintf('\n%s','      reading final mesh files...');
++A=meshread('carre1.mesh');
++md.mesh.x=A.x;
++md.mesh.y=A.y;
++md.z=zeros(A.nods,1);
++md.mesh.elements=A.index;
++md.mesh.numberofvertices=A.nods;
++md.mesh.numberofelements=A.nels;
++numberofelements2=md.mesh.numberofelements;
++t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%display number of elements
++fprintf('\n%s %i','      inital number of elements:',numberofelements1);
++fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
++
++%clean up:
++system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetCharacteristicLength.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetCharacteristicLength.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetCharacteristicLength.m	(revision 12996)
+@@ -0,0 +1,45 @@
++function length=GetCharacteristicLength(index,x,y,varargin)
++%GETCHARACTERISTICLENGTH - compute characteristic length for a mesh
++%
++%   compute characteristic lengths of every element of a mesh.
++%
++%   Usage:
++%      length  =GetCharacteristicLength(index,x,y);
++%      length  =GetCharacteristicLength(index,x,y,z);
++%
++%   Examples:
++%      length  =GetCharacteristicLength(md.mesh.elements,md.mesh.x,md.mesh.y);
++%      length  =GetCharacteristicLength(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
++
++
++%get number of elements and number of nodes
++nels=size(index,1);
++nods=numel(x);
++
++%some checks
++if nargout~=1 | (nargin~=3 & nargin~=4),
++	help GetCharacteristicLength
++	error('GetCharacteristicLength error message: bad usage')
++end
++if ((numel(y)~=nods) | (nargin==4 & numel(z)~=nods)),
++	error('GetCharacteristicLength error message: x,y and z do not have the same length')
++end
++if max(index(:))>nods,
++	error(['GetCharacteristicLength error message: index should not have values above ' num2str(nods) ])
++end
++if (nargin==3 & size(index,2)~=3),
++	error('GetCharacteristicLength error message: index should have 3 columns for 2d meshes.')
++end
++if (nargin==4 & size(index,2)~=6),
++	error('GetCharacteristicLength error message: index should have 6 columns for 3d meshes.')
++end
++
++%get areas or volumes.
++areas=GetAreas(index,x,y,varargin{:});
++
++%for a 2d mesh: 
++if nargin==3,
++	length=sqrt(2*areas);
++else
++	error('not supported yet');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetAreas.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetAreas.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetAreas.m	(revision 12996)
+@@ -0,0 +1,51 @@
++function areas=GetAreas(index,x,y,varargin)
++%GETAREAS - compute areas or volumes of elements
++%
++%   compute areas of triangular elements or volumes 
++%   of pentahedrons
++%
++%   Usage:
++%      areas  =GetAreas(index,x,y);
++%      volumes=GetAreas(index,x,y,z);
++%
++%   Examples:
++%      areas  =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
++%      volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
++
++%get number of elements and number of nodes
++nels=size(index,1);
++nods=length(x);
++if nargin==4, z=varargin{1}; end
++
++%some checks
++if nargout~=1 | (nargin~=3 & nargin~=4),
++	help GetAreas
++	error('GetAreas error message: bad usage')
++end
++if ((length(y)~=nods) | (nargin==4 & length(z)~=nods)),
++	error('GetAreas error message: x,y and z do not have the same length')
++end
++if max(index(:))>nods,
++	error(['GetAreas error message: index should not have values above ' num2str(nods) ])
++end
++if (nargin==3 & size(index,2)~=3),
++	error('GetAreas error message: index should have 3 columns for 2d meshes.')
++end
++if (nargin==4 & size(index,2)~=6),
++	error('GetAreas error message: index should have 6 columns for 3d meshes.')
++end
++
++%initialization
++areas=zeros(nels,1);
++x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
++y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
++
++%compute the volume of each element
++if nargin==3,
++	%compute the surface of the triangle
++	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
++else
++	%V=area(triangle)*1/3(z1+z2+z3)
++	thickness=mean(z(index(:,4:6)),2)-mean(z(index(:,1:3)),2);
++	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1))).*thickness;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/isconnected.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/isconnected.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/isconnected.m	(revision 12996)
+@@ -0,0 +1,13 @@
++function flag=isconnected(elements,A,B)
++%ISCONNECTED: are two nodes connected by a triangulation?
++%
++%   Usage: flag=isconnected(elements,A,B)
++%
++%
++
++elements=ElementsFromEdge(elements,A,B);
++if isempty(elements),
++	flag=0;
++else
++	flag=1;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/argusmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/argusmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/argusmesh.m	(revision 12996)
+@@ -0,0 +1,96 @@
++function md=argusmesh(md,infile)
++%ARGUSMESH - load an Argus mesh onto a model
++%
++%   Convert an Argus mesh contained in a file into
++%   fields needed for the mesh in a model md.
++%
++%   Usage:
++%      md=argusmesh(md,infile)
++%
++%   Example:
++%     md=argusmesh(md,'TriMesh.exp')
++
++%some argument check: 
++if nargin~=2 | nargout~=1,
++	help argustomodel;
++	error('argustomodel error message: bad usage');
++end
++
++%determine root of infile: strip extension
++[a,root,b,c]=fileparts(infile);
++
++%inform user we start the script: 
++disp(['   Translating argus file ''' infile ''' into matlab model object']);
++
++%open infile: 
++fileid=fopen(infile,'r');
++if fileid==-1,
++	error(['Could not open file ' infile  ' for reading']);
++end
++
++%Read first line of the argus mesh: node and element parameters
++[buffer,bytecount]=fscanf(fileid,'%i %i %i %i',[1 4]);
++if bytecount~=4, 
++	error(['Problem reading ' infile ' file at line #1']);
++end
++nel=buffer(1);
++nods=buffer(2);
++num_element_parameters=buffer(3);
++num_node_parameters=buffer(4);
++disp(['      argus model '''   root ''' contains ' num2str(nel) ' elements and ' num2str(nods) ' nodes.']);
++
++%initialize elements and nodes
++elements=zeros(nel,3);
++element_parameters=zeros(nel,num_element_parameters);
++x=zeros(nods,1);
++y=zeros(nods,1);
++z=zeros(nods,1);
++node_parameters=zeros(nods,num_node_parameters);
++
++%read nodes:
++format_string='%s %i %f %f ';
++for n=1:num_node_parameters,
++	format_string=[format_string ' %i '];
++end
++
++for n=1:nods,
++	[buffer,bytecount]=fscanf(fileid,format_string,[1,num_node_parameters+4]);
++	x(n)=buffer(3);
++	y(n)=buffer(4);
++	node_parameters(n,:)=buffer(5:length(buffer));
++end
++
++%read elements: 
++format_string='%s %i %i %i %i';
++for n=1:num_element_parameters,
++	format_string=[format_string ' %i '];
++end
++for n=1:nel,
++	[buffer,bytecount]=fscanf(fileid,format_string,[1,num_element_parameters+5]);
++	elements(n,:)=buffer(3:5);
++	element_parameters(n,:)=buffer(6:length(buffer));
++end
++
++%Create a name and a note for this model: 
++notes=['Model created by Argus from input file: ' infile ' and parameter file: ' root '.par on: ' date];
++name=root;
++
++%Finally, use model constructor to build a complete model: 
++md.mesh.elements=elements;
++md.mesh.x=x;
++md.mesh.y=y;
++md.z=z;
++md.mesh.numberofvertices=size(md.mesh.x,1);
++md.mesh.numberofelements=size(md.mesh.elements,1);
++md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
++md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
++md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
++md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
++md.mesh.dimension=2;
++md=addnote(md,notes);
++
++%Add segments and nodes on boundary
++md.mesh.segments=findsegments(md);
++md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonboundary(md.mesh.segments(:,1))=1;
++md.mesh.vertexonboundary(md.mesh.segments(:,2))=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCall.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCall.m	(revision 12996)
+@@ -0,0 +1,84 @@
++function md=BamgCall(md,field,hmin,hmax,gradation,epsilon),
++%BAMGCALL - call bam
++%
++%   build a metric using the Hessian of the given field
++%   call Bamg and the output mesh is plugged onto the model
++%   -hmin = minimum edge length (m)
++%   -hmax = maximum edge length (m)
++%   -gradation = maximum edge length gradation between 2 elements
++%   -epsilon = average error on each element (m/yr)
++%
++%   Usage:
++%      md=BamgCall(md,field,hmin,hmax,gradation,epsilon);
++%
++%   Example:
++%      md=BamgCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%Compute Hessian
++t1=clock; fprintf('%s','      computing Hessian...');
++hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%Compute metric
++t1=clock; fprintf('%s','      computing metric...');
++if length(md.nodeonwater)==md.mesh.numberofvertices,
++	pos=find(md.nodeonwater);
++else
++	pos=[];
++end
++metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%write files
++t1=clock; fprintf('%s','      writing initial mesh files...');
++fid=fopen('carre0.met','w');
++fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
++fprintf(fid,'%i %i %i\n',metric');
++fclose(fid);
++
++fid=fopen('carre0.mesh','w');
++
++%initialiation
++fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
++
++%dimension
++fprintf(fid,'\n%s\n%i\n','Dimension',2);
++
++%Vertices
++fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
++fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
++
++%Triangles
++fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
++fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
++numberofelements1=md.mesh.numberofelements;
++
++%close
++fclose(fid);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%call bamg
++fprintf('%s\n','      call Bamg...');
++system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
++
++%plug new mesh
++t1=clock; fprintf('\n%s','      reading final mesh files...');
++A=meshread('carre1.mesh');
++md.mesh.x=A.x;
++md.mesh.y=A.y;
++md.z=zeros(A.nods,1);
++md.mesh.elements=A.index;
++md.mesh.numberofvertices=A.nods;
++md.mesh.numberofelements=A.nels;
++numberofelements2=md.mesh.numberofelements;
++t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%display number of elements
++fprintf('\n%s %i','      inital number of elements:',numberofelements1);
++fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
++
++%clean up:
++system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/FixMesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/FixMesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/FixMesh.m	(revision 12996)
+@@ -0,0 +1,45 @@
++function  [index2 x2 y2 value2]=FixMesh(index,x,y,value)
++%FixMesh fix mesh with broken triangles, orphan vertices, etc ...
++%
++% Usage: 
++%            [index2 x2 y2 value2]=FixMesh(index,x,y,value)
++%            where index,x,y is a delaunay triangulation, 
++%                  value is a field on the input triangulation, with values at the vertices
++%                  index2,x2,y2,value2 is the repaired triangulation, with new values on new vertices
++%
++%
++
++%duplicate inputs
++index2=index;
++x2=x;
++y2=y;
++value2=value;
++
++%First, look for orphan vertices, and take them out.
++flags=zeros(length(x2),1); flags(index2)=1;
++orphans=find(flags==0);
++
++while ~isempty(orphans),
++
++	%take the first orphan, the lower numbered, and take it out
++	orphan=orphans(1);
++
++	%first x,y,value
++	x2(orphan)=[];
++	y2(orphan)=[];
++	value2(orphan)=[];
++
++	%now, the index:
++	pos=find(index2>orphan); index2(pos)=index2(pos)-1;
++	
++	%look again for orphans on new mesh
++	flags=zeros(length(x2),1);flags(index2)=1;
++	orphans=find(flags==0);
++end
++
++%Check all triangles are well oriented.
++aires=GetAreas(index2,x2,y2);
++pos=find(aires<0);
++temp=index2(pos,1);
++index2(pos,1)=index2(pos,2);
++index2(pos,2)=temp;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/roundmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/roundmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/roundmesh.m	(revision 12996)
+@@ -0,0 +1,34 @@
++function md=roundmesh(md,radius,resolution)
++%ROUNDMESH - create an unstructured round mesh 
++%
++%   This script will generate a structured round mesh
++%   - radius     : specifies the radius of the circle in meters
++%   - resolution : specifies the resolution in meters
++%
++%   Usage:
++%      md=roundmesh(md,radius,resolution)
++
++%First we have to create the domain outline 
++
++%Get number of points on the circle
++pointsonedge=floor((2*pi*radius) / resolution);
++
++%Calculate the cartesians coordinates of the points
++x_list=ones(pointsonedge,1); y_list=ones(pointsonedge,1);
++theta=(0:2*pi/pointsonedge:2*pi*(1-1/pointsonedge))';
++x_list=radius*x_list.*cos(theta);
++y_list=radius*y_list.*sin(theta);
++A=struct('x',x_list,'y',y_list,'density',1);
++expgen('RoundDomainOutline.exp',A,1);
++
++%Call Bamg
++md=triangle(md,'RoundDomainOutline.exp',resolution);
++%md=bamg(md,'domain','RoundDomainOutline.exp','hmin',resolution);
++
++%move the closest node to the center
++[mini pos]=min(md.mesh.x.^2+md.mesh.y.^2);
++md.mesh.x(pos)=0;
++md.mesh.y(pos)=0;
++
++%delete domain
++delete('RoundDomainOutline.exp')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ProfileProjectOntoMesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ProfileProjectOntoMesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ProfileProjectOntoMesh.m	(revision 12996)
+@@ -0,0 +1,66 @@
++function mesh_profile=ProfileProjectOntoMesh(md,profile)
++%PROFILEPROJECTONTOMESH: project a profile (made of arbitrary points) onto a mesh, so that we end 
++%                        up with a list of segments self contained onto elements.
++%
++% Usage: mesh_profile=ProfileProjectOntoMesh(md,profile)
++%
++% See also intersections.m
++
++%make a curve out of the mesh, to use the intersections routine.
++rows=[md.mesh.elements md.mesh.elements(:,1)]'; rows=rows(:);
++x=md.mesh.x(rows);
++y=md.mesh.y(rows);
++
++%[x0,y0] = intersections(profile.x,profile.y,x,y,1);
++[x0,y0,indices,j] = intersections(profile.x,profile.y,x,y);
++
++%  sort intersections to create segments in order and continuous along profile
++[indices,isort]=sort(indices);
++j =j (isort);
++x0=x0(isort);
++y0=y0(isort);
++
++%process x0,y0 so they do not include profile.x or profile.y
++processed_indices=[];
++processed_x=[];
++processed_y=[];
++for i=1:numel(indices),
++	if(((indices(i)-floor(indices(i)))~=0) && ((ceil(indices(i))-indices(i))~=0))
++		processed_indices=[processed_indices;floor(indices(i))];
++		processed_x=[processed_x;x0(i)];
++		processed_y=[processed_y;y0(i)];
++	end
++end
++
++%now merge profile.x,profile.y with processed_x,processed_y, at locations processed_indices:
++newx=profile.x;
++newy=profile.y;
++
++count=1;
++for i=1:numel(profile.x),
++	pos=find(processed_indices==i);
++	if ~isempty(pos),
++		newx=[newx(1:count); processed_x(pos); newx(count+1:end)];
++		newy=[newy(1:count); processed_y(pos); newy(count+1:end)];
++		count=count+length(pos)+1;
++	end
++end
++
++%now, for each node, figure out which element it belongs to.
++node_in_element=NodeInElement(newx,newy,md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.vertexconnectivity);
++
++% eliminate nodes that don't fall in any element
++% (profile may start and/or end externally and/or cross holes in the model)
++
++ind=find(node_in_element(:,9)>0);
++newx=newx(ind,:);
++newy=newy(ind,:);
++node_in_element=node_in_element(ind,:);
++
++mesh_profile=[newx(1:end-1) newy(1:end-1) newx(2:end) newy(2:end) zeros(length(newy(2:end)),1)];
++
++%find which element each segment belongs to.
++for i=1:length(newx)-1,
++	common=intersect(node_in_element(i,1:node_in_element(i,end)), node_in_element(i+1,1:node_in_element(i+1,end)));
++	mesh_profile(i,end)=common(1);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/YamsCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/YamsCall.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/YamsCall.m	(revision 12996)
+@@ -0,0 +1,104 @@
++function md=YamsCall(md,field,hmin,hmax,gradation,epsilon),
++%YAMSCALL - call yams
++%
++%   build a metric using the Hessian of the given field
++%   call Yams and the output mesh is plugged onto the model
++%   -hmin = minimum edge length (m)
++%   -hmax = maximum edge length (m)
++%   -gradation = maximum edge length gradation between 2 elements
++%   -epsilon = average error on each element (m/yr)
++%
++%   Usage:
++%      md=YamsCall(md,field,hmin,hmax,gradation,epsilon);
++%
++%   Example:
++%      md=YamsCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%Compute Hessian
++t1=clock; fprintf('%s','      computing Hessian...');
++hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%Compute metric
++t1=clock; fprintf('%s','      computing metric...');
++if length(md.mask.vertexonwater)==md.mesh.numberofvertices,
++	pos=find(md.mask.vertexonwater);
++else
++	pos=[];
++end
++metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%write files
++t1=clock; fprintf('%s','      writing initial mesh files...');
++save -ascii carre0.met  metric
++
++fid=fopen('carre0.mesh','w');
++
++%initialiation
++fprintf(fid,'\n%s\n%i\n','MeshVersionFormatted',1);
++
++%dimension
++fprintf(fid,'\n%s\n%i\n','Dimension',2);
++
++%Vertices
++fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
++fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y zeros(md.mesh.numberofvertices,1)]');
++
++%Triangles
++fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
++fprintf(fid,'%i %i %i %i\n',[md.mesh.elements zeros(md.mesh.numberofelements,1)]');
++numberofelements1=md.mesh.numberofelements;
++	
++%Deal with rifts
++if ~isnan(md.rifts.riftstruct),
++	
++	%we have the list of triangles that make up the rift. keep those triangles around during refinement.
++	triangles=[];
++	for i=1:size(md.rifts.riftstruct,1),
++		triangles=[triangles md.rifts(i).segments(:,3)'];
++	end
++
++	fprintf(fid,'\n\n%s\n%i\n\n','RequiredTriangles',length(triangles));
++	fprintf(fid,'%i\n',triangles);
++end
++
++%close
++fclose(fid);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%call yams
++fprintf('%s\n','      call Yams...');
++if ispc
++	%windows
++	system(['yams2-win -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
++elseif ismac
++	%Macosx
++	system(['yams2-osx -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
++else
++	%Linux
++	system(['yams2-linux -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
++end
++
++%plug new mesh
++t1=clock; fprintf('\n%s','      reading final mesh files...');
++Tria=load('carre1.tria');
++Coor=load('carre1.coor');
++md.mesh.x=Coor(:,1);
++md.mesh.y=Coor(:,2);
++md.mesh.z=zeros(size(Coor,1),1);
++md.mesh.elements=Tria;
++md.mesh.numberofvertices=size(Coor,1);
++md.mesh.numberofelements=size(Tria,1);
++numberofelements2=md.mesh.numberofelements;
++t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%display number of elements
++fprintf('\n%s %i','      inital number of elements:',numberofelements1);
++fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
++
++%clean up:
++system('rm carre0.mesh carre0.met carre1.tria carre1.coor carre1.meshb');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MeshQuality.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MeshQuality.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MeshQuality.m	(revision 12996)
+@@ -0,0 +1,82 @@
++function quality=MeshQuality(md,epsilon,hmin,hmax);
++%MESHQUALITY - compute mesh quality
++%
++%   Usage:
++%      MeshQuality(md,epsilon,hmin,hmax);
++
++%Get some variables from the model
++index=md.mesh.elements;
++x=md.mesh.x;
++y=md.mesh.y;
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%Compute Hessian
++hessian=ComputeHessian(index,x,y,md.inversion.vel_obs,'node');
++
++%Compute metric
++if length(md.nodeonwater)==md.mesh.numberofvertices,
++	pos=find(md.nodeonwater);
++else
++	pos=[];
++end
++metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
++
++%Get Areas
++areas=GetAreas(index,x,y);
++
++%length edges vectors
++e1x=[x(index(:,2))-x(index(:,1))];
++e1y=[y(index(:,2))-y(index(:,1))];
++e2x=[x(index(:,3))-x(index(:,2))];
++e2y=[y(index(:,3))-y(index(:,2))];
++e3x=[x(index(:,1))-x(index(:,3))];
++e3y=[y(index(:,1))-y(index(:,3))];
++
++%metric of each the 3 nodes for each element
++M1=metric(index(:,1),:);
++M2=metric(index(:,2),:);
++M3=metric(index(:,3),:);
++
++%Get edge length in the metric
++L1=1/2*(sqrt(e2x.*(M2(:,1).*e2x+M2(:,2).*e2y)+e2y.*(M2(:,2).*e2x+M2(:,3).*e2y))+sqrt(e1x.*(M1(:,1).*e1x+M1(:,2).*e1y)+e1y.*(M1(:,2).*e1x+M1(:,3).*e1y)));
++L2=1/2*(sqrt(e3x.*(M3(:,1).*e3x+M3(:,2).*e3y)+e3y.*(M3(:,2).*e3x+M3(:,3).*e3y))+sqrt(e2x.*(M2(:,1).*e2x+M2(:,2).*e2y)+e2y.*(M2(:,2).*e2x+M2(:,3).*e2y)));
++L3=1/2*(sqrt(e1x.*(M1(:,1).*e1x+M1(:,2).*e1y)+e1y.*(M1(:,2).*e1x+M1(:,3).*e1y))+sqrt(e3x.*(M3(:,1).*e3x+M3(:,2).*e3y)+e3y.*(M3(:,2).*e3x+M3(:,3).*e3y)));
++
++%area in the metric
++V=1/3*areas.*(sqrt(M1(:,1).*M1(:,3)-M1(:,2).^2)+sqrt(M2(:,1).*M2(:,3)-M2(:,2).^2)+sqrt(M3(:,1).*M3(:,3)-M3(:,2).^2));
++
++%compute quality:
++quality=4*sqrt(3)*V./(L1+L2+L3);
++
++%compute error
++a=hessian(:,1); b=hessian(:,2); d=hessian(:,3);
++a=a(index)*[1;1;1]/3;
++b=b(index)*[1;1;1]/3;
++d=d(index)*[1;1;1]/3;
++lambda1=0.5*((a+d)+sqrt(4*b.^2+(a-d).^2));
++lambda2=0.5*((a+d)-sqrt(4*b.^2+(a-d).^2));
++lambda1=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
++lambda2=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
++if length(md.nodeonwater)==md.mesh.numberofvertices;
++	pos=find(md.nodeonwater);
++	lambda1(pos)=0;
++	lambda2(pos)=0;
++end
++lambda1=lambda1(index)*[1;1;1]/3;
++lambda2=lambda2(index)*[1;1;1]/3;
++
++lambdamax=max(lambda1,lambda2);
++hmax=max(max(sqrt(e1x.^2+e1y.^2),sqrt(e2x.^2+e2y.^2)),sqrt(e3x.^2+e3y.^2));
++epsilon=scale*hmax.^2.*lambdamax;
++
++%display
++%X=0:0.1:4; hist(quality,X); xlim([0 3]); title('mesh quality distribution','FontSize',14);
++%plotmodel(md,'data',epsilon,'title','Interpolation error','figure',2)
++disp(sprintf('\n%s','Mesh Quality'));
++disp(sprintf('   %s %g','Average Mesh quality: ',mean(quality)));
++disp(sprintf('   %s %g','Worst Element quality:',max(quality)));
++disp(sprintf('\n%s','Interpolation Error'));
++disp(sprintf('   %s %g %s','Average interpolation error:',mean(epsilon),'m/yr'));
++disp(sprintf('   %s %g %s','Maximum interpolation error:',max(epsilon),'m/yr'));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/squaremesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/squaremesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/squaremesh.m	(revision 12996)
+@@ -0,0 +1,78 @@
++function md=squaremesh(md,Lx,Ly,nx,ny)
++%SQUAREMESH - create a structured square mesh 
++%
++%   This script will generate a structured square mesh
++%   Lx and Ly are the dimension of the domain (in meters)
++%   nx anx ny are the number of nodes in the x and y direction
++%   The coordinates x and y returned are in meters.
++%
++%   Usage:
++%      [md]=squaremesh(md,Lx,Ly,nx,ny)
++
++%get number of elements and number of nodes
++nel=(nx-1)*(ny-1)*2;
++nods=nx*ny;
++
++%initialization
++segments=zeros(0,3);
++index=zeros(nel,3);
++x=zeros(nx*ny,1);
++y=zeros(nx*ny,1);
++
++%create coordinates
++for n=1:nx,
++	for m=1:ny,
++		x((n-1)*ny+m)=(n-1);
++		y((n-1)*ny+m)=(m-1);
++	end
++end
++
++%create index
++for n=1:(nx-1)
++	for m=1:(ny-1),
++		A=(n-1)*ny+m;
++		B=A+1;
++		C=n*ny+m;
++		D=C+1;
++		index((n-1)*(ny-1)*2+2*(m-1)+1,:)=[A C B];
++		index((n-1)*(ny-1)*2+2*m,:)=[B C D];
++	end
++end
++
++%Scale  x and y
++x=x/max(x)*Lx;
++y=y/max(y)*Ly;
++
++%create segments
++segments=zeros(2*(nx-1)+2*(ny-1),3);
++%left edge:
++segments(1:ny-1,:)=[[2:ny]' [1:ny-1]' 2*[1:ny-1]'-1];
++%right edge:
++segments(ny:2*(ny-1),:)=[[ny*(nx-1)+1:nx*ny-1]' [ny*(nx-1)+2:nx*ny]' 2*[(ny-1)*(nx-2)+1:(nx-1)*(ny-1)]'];
++%front edge:
++segments(2*(ny-1)+1:2*(ny-1)+(nx-1),:)=[[2*ny:ny:ny*nx]' [ny:ny:ny*(nx-1)]' [2*(ny-1):2*(ny-1):2*(nx-1)*(ny-1)]'];
++%back edge
++segments(2*(ny-1)+(nx-1)+1:2*(nx-1)+2*(ny-1),:)=[[1:ny:(nx-2)*ny+1]' [ny+1:ny:ny*(nx-1)+1]' [1:2*(ny-1):2*(nx-2)*(ny-1)+1]'];
++
++%plug coordinates and nodes
++md.mesh.x=x;
++md.mesh.y=y;
++md.mesh.z=zeros(nods,1);
++md.mesh.numberofvertices=nods;
++md.mesh.vertexonboundary=zeros(nods,1);md.mesh.vertexonboundary(segments(:,1:2))=1;
++md.mesh.vertexonbed=ones(nods,1);
++md.mesh.vertexonsurface=ones(nods,1);
++
++%plug elements
++md.mesh.elements=index;
++md.mesh.segments=segments;
++md.mesh.numberofelements=nel;
++md.mesh.elementonbed=ones(nel,1);
++md.mesh.elementonsurface=ones(nel,1);
++
++%Now, build the connectivity tables for this mesh.
++md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++
++%plug other field
++md.mesh.dimension=2;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/rifttipsonmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/rifttipsonmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/rifttipsonmesh.m	(revision 12996)
+@@ -0,0 +1,26 @@
++function tips=rifttipsonmesh(md,riftoutline)
++%RIFTTIPSONMESH: identify, using a rift outline, the nodes that are tips of 
++%                rifts.
++
++%read rifts from outline file
++rifts=expread(riftoutline,1);
++
++tips=[];
++
++for i=1:length(rifts),
++	rift=rifts(i);
++
++	x_tip=rift.x(1);
++	y_tip=rift.y(1);
++	
++	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
++	tips(end+1)=index;
++
++	x_tip=rift.x(end);
++	y_tip=rift.y(end);
++	
++	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
++	tips(end+1)=index;
++
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeMetric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeMetric.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeMetric.m	(revision 12996)
+@@ -0,0 +1,66 @@
++function metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos)
++%COMPUTEMETRIC - compute metric from an Hessian
++%
++%   Usage:
++%      metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos)
++%      pos is contains the positions where the metric is wished to be maximized (water?)
++%
++%   Example:
++%      metric=ComputeMetric(hessian,2/9,10^-1,100,10^5,find(md.nodeonwater)
++
++%first, find the eigen values of eah line of H=[hessian(i,1) hessian(i,2); hessian(i,2)  hessian(i,3)]
++a=hessian(:,1); b=hessian(:,2); d=hessian(:,3);
++lambda1=0.5*((a+d)+sqrt(4*b.^2+(a-d).^2));
++lambda2=0.5*((a+d)-sqrt(4*b.^2+(a-d).^2));
++pos1=find(lambda1==0);
++pos2=find(lambda2==0);
++pos3=find(b==0 & lambda1==lambda2);
++
++%Modify the eigen values to control the shape of the elements
++lambda1=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
++lambda2=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
++
++%compute eigen vectors
++norm1=sqrt(8*b.^2+2*(d-a).^2+2*(d-a).*sqrt((a-d).^2+4*b.^2));
++v1x=2*b./norm1;
++v1y=((d-a)+sqrt((a-d).^2+4*b.^2))./norm1;
++norm2=sqrt(8*b.^2+2*(d-a).^2-2*(d-a).*sqrt((a-d).^2+4*b.^2));
++v2x=2*b./norm2;
++v2y=((d-a)-sqrt((a-d).^2+4*b.^2))./norm2;
++
++v1x(pos3)=1; v1y(pos3)=0;
++v2x(pos3)=0; v2y(pos3)=1;
++
++%Compute new metric (for each node M=V*Lambda*V^-1)
++metric=full([(v1x.*v2y-v1y.*v2x).^(-1).*(lambda1.*v2y.*v1x-lambda2.*v1y.*v2x) ...
++	(v1x.*v2y-v1y.*v2x).^(-1).*(lambda1.*v1y.*v2y-lambda2.*v1y.*v2y) ...
++	(v1x.*v2y-v1y.*v2x).^(-1).*(-lambda1.*v2x.*v1y+lambda2.*v1x.*v2y)]);
++
++%some corrections for 0 eigen values
++metric(pos1,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos1),1);
++metric(pos2,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos2),1);
++
++%take care of water elements
++metric(pos,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos),1);
++
++%take care of NaNs if any (use Matlab eig in a loop)
++[pos posj]=find(isnan(metric)); clear posj;
++if ~isempty(pos),
++	fprintf(' %i %s',length(pos),'NaN found in the metric. Use Matlab routine...');
++	for i=1:length(pos)
++		H=[hessian(pos(i),1) hessian(pos(i),2)
++		hessian(pos(i),2) hessian(pos(i),3)];
++		[u,v]=eig(full(H));
++		lambda1=v(1,1);
++		lambda2=v(2,2);
++		v(1,1)=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
++		v(2,2)=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
++
++		metricTria=u*v*u^(-1);
++		metric(pos(i),:)=[metricTria(1,1) metricTria(1,2) metricTria(2,2)];
++	end
++end
++
++if any(isnan(metric)),
++	error('ComputeMetric error message: NaN in the metric despite our efforts...')
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/ll2xy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/ll2xy.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/ll2xy.m	(revision 12996)
+@@ -0,0 +1,66 @@
++function [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)  
++%LL2XY - converts lat long to polar stereographic
++%
++%   Converts from geodetic latitude and longitude to Polar 
++%   Stereographic (X,Y) coordinates for the polar regions.
++%   Author: Michael P. Schodlok, December 2003 (map2ll)
++%
++%   Usage:
++%      [x,y] = ll2xy(lat,lon,sgn)
++%      [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)
++%
++%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
++%                               -1 : south latitude (default is mer=0  lat=71)
++
++%Get central_meridian and standard_parallel depending on hemisphere
++if nargin==5,
++	delta = central_meridian;
++	slat  = standard_parallel;
++elseif nargin==3
++	if sgn == 1,
++		delta = 45; slat = 70;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++	elseif sgn==-1,
++		delta = 0;  slat = 71;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
++	else
++		error('Sign should be either +1 or -1');
++	end
++else
++	help ll2xy
++	error('bad usage');
++end
++
++% Conversion constant from degrees to radians
++cde  = 57.29577951;
++% Radius of the earth in meters
++re   = 6378.273*10^3;
++% Eccentricity of the Hughes ellipsoid squared
++ex2   = .006693883;
++% Eccentricity of the Hughes ellipsoid
++ex    =  sqrt(ex2);
++
++latitude  = abs(lat) * pi/180.;
++longitude = (lon + delta) * pi/180.;
++
++% compute X and Y in grid coordinates.
++T = tan(pi/4-latitude/2) ./ ((1-ex*sin(latitude))./(1+ex*sin(latitude))).^(ex/2);
++
++if (90 - slat) <  1.e-5 
++	rho = 2.*re*T/sqrt((1.+ex)^(1.+ex)*(1.-ex)^(1.-ex));
++else
++	sl  = slat*pi/180.;
++	tc  = tan(pi/4.-sl/2.)/((1.-ex*sin(sl))/(1.+ex*sin(sl)))^(ex/2.);
++	mc  = cos(sl)/sqrt(1.0-ex2*(sin(sl)^2));
++	rho = re*mc*T/tc;
++end
++
++y = -rho .* sgn .* cos(sgn.*longitude);
++x =  rho .* sgn .* sin(sgn.*longitude);
++
++[cnt1,cnt2] = find(latitude >= pi / 2.);
++
++if cnt1
++	x(cnt1,1) = 0.0;
++	y(cnt1,1) = 0.0;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/xy2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/xy2ll.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/xy2ll.m	(revision 12996)
+@@ -0,0 +1,72 @@
++function [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel)
++%XY2LL - converts xy to lat long
++%
++%   Converts Polar  Stereographic (X,Y) coordinates for the polar regions to
++%   latitude and longitude Stereographic (X,Y) coordinates for the polar
++%   regions.
++%   Author: Michael P. Schodlok, December 2003 (map2xy.m)
++%
++%   Usage:
++%      [lat,lon] = xy2ll(x,y,sgn);
++%      [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel);
++%
++%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
++%                               -1 : south latitude (default is mer=0  lat=71)
++
++%Get central_meridian and standard_parallel depending on hemisphere
++if nargin==5,
++	delta = central_meridian;
++	slat  = standard_parallel;
++elseif nargin==3
++	if sgn == 1,
++		delta = 45; slat = 70;
++		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++	elseif sgn==-1,
++		delta = 0;  slat = 71;
++		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
++	else
++		error('Sign should be either +1 or -1');
++	end
++else
++	help xy2ll
++	error('bad usage');
++end
++
++% Conversion constant from degrees to radians
++cde  = 57.29577951;
++% Radius of the earth in meters
++re   = 6378.273*10^3;
++% Eccentricity of the Hughes ellipsoid squared
++ex2   = .006693883;
++% Eccentricity of the Hughes ellipsoid
++ex    =  sqrt(ex2);
++
++sl  = slat*pi/180.;
++rho = sqrt(x.^2 + y.^2);
++cm = cos(sl) / sqrt(1.0 - ex2 * (sin(sl)^2));
++T = tan((pi / 4.0) - (sl / 2.0)) / ((1.0 - ex * sin(sl)) / (1.0 + ex * sin(sl)))^(ex / 2.0);
++
++if  abs(slat-90.) < 1.e-5
++	T = rho * sqrt((1. + ex)^(1. + ex) * (1. - ex)^(1. - ex)) / 2. / re;
++else
++	T = rho * T / (re * cm);
++end
++
++chi = (pi / 2.0) - 2.0 * atan(T);
++lat = chi + ((ex2 / 2.0) + (5.0 * ex2^2.0 / 24.0) + (ex2^3.0 / 12.0)) * ...
++	sin(2 * chi) + ((7.0 * ex2^2.0 / 48.0) + (29.0 * ex2^3 / 240.0)) * ...
++	sin(4.0 * chi) + (7.0 * ex2^3.0 / 120.0) * sin(6.0 * chi) ;
++
++lat = sgn * lat;
++lon = atan2(sgn * x,-sgn * y);
++lon = sgn * lon;
++
++[res1,res2] = find(rho <= 0.1);
++if res1
++	lat(res1,1) = 90. * sgn;
++	lon(res1,1) = 0.0;
++end
++
++lon = lon * 180. / pi;
++lat = lat * 180. / pi;
++lon = lon - delta; 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/pargenerate.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/pargenerate.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/pargenerate.m	(revision 12996)
+@@ -0,0 +1,45 @@
++function pargenerate(filename,xm,ym,data,varargin)
++%PARGENERATE - generate parameter file for images ala Rignot
++%
++%   Usage: 
++%      pargenerate(filename,data,xm,ym,options);
++%
++%   Supported options:
++%      - title: dataset title
++%      - latitude: standard latitude (degree)
++%      - meridian: meridian (degree)
++%      - format: binary format
++
++%process options
++options=pairoptions(varargin{:});
++Title=getfieldvalue(options,'title','N/A');
++latitude=getfieldvalue(options,'latitude','N/A');
++meridian=getfieldvalue(options,'meridian','N/A');
++format=getfieldvalue(options,'format','single');
++
++%Get data info
++[nlines ncols]=size(data);
++xmin=min(xm);
++ymax=max(ym);
++postx=abs(xm(2)-xm(1));
++posty=abs(ym(2)-ym(1));
++
++%Open header file and get machine type
++fid=fopen(filename,'wt');
++[filename, permission, machineformat, encoding] = fopen(fid);
++
++%write header file
++fprintf(fid,'%s\n','ISSM gridded dataset parameter file');
++fprintf(fid,'%s%s\n','title: ',Title);
++fprintf(fid,'%s  \n','DEM_projection: PS');
++fprintf(fid,'%s%s\n','data_format: ',format);
++fprintf(fid,'%s%s\n','endian:      ',machineformat);
++fprintf(fid,'%s%d\n','width:  ',ncols);
++fprintf(fid,'%s%d\n','nlines: ',nlines);
++fprintf(fid,'%s%g%s\n','PS_secant_lat:    ',latitude,'   decimal degrees');
++fprintf(fid,'%s%g%s\n','PS_meridian_long: ',meridian,'   decimal degrees');
++fprintf(fid,'%s%-15.10g\n','PS_corner_north:  ',ymax);
++fprintf(fid,'%s%-15.10g\n','PS_corner_east:   ',xmin);
++fprintf(fid,'%s%g%s\n','PS_post_north:    ',postx,' m');
++fprintf(fid,'%s%g%s\n','PS_post_east:     ',posty,' m');
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/utm2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/utm2ll.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/utm2ll.m	(revision 12996)
+@@ -0,0 +1,117 @@
++function  [Lat,Lon] = utm2ll(xx,yy,utmzone)
++% -------------------------------------------------------------------------
++% [Lat,Lon] = utm2ll(x,y,utmzone)
++%
++% Description: Function to convert vectors of UTM coordinates into Lat/Lon vectors (WGS84).
++% Some code has been extracted from UTMIP.m function by Gabriel Ruiz Martinez.
++%
++% Inputs:on)
++%    -3.485713    7.801235 -119.955246  -17.759537  -94.799019  121.640266
++%
++% Example 2: If you need Lat/Lon coordinates in Degrees, Minutes and Seconds
++% [Lat, Lon]=utm2ll(x,y,utmzone);
++% LatDMS=dms2mat(deg2dms(Lat))
++%LatDMS =
++%    40.00         18.00         55.55
++%    46.00         17.00          2.01
++%    37.00         34.00         40.17
++%    28.00         38.00         44.33
++%    38.00         51.00         19.96
++%    25.00          3.00         42.41
++% LonDMS=dms2mat(deg2dms(Lon))
++%LonDMS =
++%    -3.00         29.00          8.61
++%     7.00         48.00          4.40
++%  -119.00         57.00         18.93
++%   -17.00         45.00         34.33
++%   -94.00         47.00         56.47
++%   121.00         38.00         24.96
++%
++% Author:
++%   Rafael Palacios
++%   Universidad Pontificia Comillas
++%   Madrid, Spain
++% Version: Apr/06, Jun/06, Aug/06
++% Aug/06: corrected m-Lint warnings
++%-------------------------------------------------------------------------
++
++% Argument checking
++%
++error(nargchk(3, 3, nargin)); %3 arguments required
++n1=length(xx);
++n2=length(yy);
++n3=size(utmzone,1);
++if (n1~=n2 || n1~=n3)
++	error('x,y and utmzone vectors should have the same number or rows');
++end
++c=size(utmzone,2);
++if (c~=4)
++	error('utmzone should be a vector of strings like "30 T"');
++end
++
++% Memory pre-allocation
++%
++Lat=zeros(n1,1);
++Lon=zeros(n1,1);
++
++% Main Loop
++%
++for i=1:n1
++	if (utmzone(i,4)>'X' || utmzone(i,4)<'C')
++		fprintf('utm2ll: Warning utmzone should be a vector of strings like "30 T", not "30 t"\n');
++	end
++	if (utmzone(i,4)>'M')
++		hemis='N';   % Northern hemisphere
++	else
++		hemis='S';
++	end
++
++	x=xx(i);
++	y=yy(i);
++	zone=str2double(utmzone(i,1:2));
++
++	sa = 6378137.000000 ; sb = 6356752.314245;
++
++	%   e = ( ( ( sa ^ 2 ) - ( sb ^ 2 ) ) ^ 0.5 ) / sa;
++	e2 = ( ( ( sa ^ 2 ) - ( sb ^ 2 ) ) ^ 0.5 ) / sb;
++	e2cuadrada = e2 ^ 2;
++	c = ( sa ^ 2 ) / sb;
++	%   alpha = ( sa - sb ) / sa;             %f
++	%   ablandamiento = 1 / alpha;   % 1/f
++
++	X = x - 500000;
++
++	if hemis == 'S' || hemis == 's'
++		Y = y - 10000000;
++	else
++		Y = y;
++	end
++
++	S = ( ( zone * 6 ) - 183 );
++	lat =  Y / ( 6366197.724 * 0.9996 );
++	v = ( c / ( ( 1 + ( e2cuadrada * ( cos(lat) ) ^ 2 ) ) ) ^ 0.5 ) * 0.9996;
++	a = X / v;
++	a1 = sin( 2 * lat );
++	a2 = a1 * ( cos(lat) ) ^ 2;
++	j2 = lat + ( a1 / 2 );
++	j4 = ( ( 3 * j2 ) + a2 ) / 4;
++	j6 = ( ( 5 * j4 ) + ( a2 * ( cos(lat) ) ^ 2) ) / 3;
++	alfa = ( 3 / 4 ) * e2cuadrada;
++	beta = ( 5 / 3 ) * alfa ^ 2;
++	gama = ( 35 / 27 ) * alfa ^ 3;
++	Bm = 0.9996 * c * ( lat - alfa * j2 + beta * j4 - gama * j6 );
++	b = ( Y - Bm ) / v;
++	Epsi = ( ( e2cuadrada * a^ 2 ) / 2 ) * ( cos(lat) )^ 2;
++	Eps = a * ( 1 - ( Epsi / 3 ) );
++	nab = ( b * ( 1 - Epsi ) ) + lat;
++	senoheps = ( exp(Eps) - exp(-Eps) ) / 2;
++	Delt = atan(senoheps / (cos(nab) ) );
++	TaO = atan(cos(Delt) * tan(nab));
++	longitude = (Delt *(180 / pi ) ) + S;
++	latitude = ( lat + ( 1 + e2cuadrada* (cos(lat)^ 2) - ( 3 / 2 ) * e2cuadrada * sin(lat) * cos(lat) * ( TaO - lat ) ) * ( TaO - lat ) ) * ...
++		(180 / pi);
++
++	Lat(i)=latitude;
++	Lon(i)=longitude;
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodellist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodellist.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodellist.m	(revision 12996)
+@@ -0,0 +1,50 @@
++function varargout=loadmodellist(path)
++%LOADMODELLIST- load a model using built-in load module
++%
++%   check that modellist prototype has not changed. if so, adapt to new modellist prototype.
++%
++%   Usage:
++%      mds=loadmodellist(path)
++%      loadmodellist path
++
++%check nargout
++if nargout>1,
++	error('loadmodellist usage error: mds=loadmodellist(path)');
++end
++%check existence
++if ~exist(path)
++	error(['loadmodellist error message: file ' path ' does not exist']);
++end
++
++%check that the file is readable
++[stat,mess]=fileattrib(path);
++if( stat==0 | mess.UserRead~=1),
++	error(['loadmodellist error message: file ' path ' is not readable (permission dinied).']);
++end
++
++%check number of variables
++if length(whos('-file',path))>1,
++	error(['loadmodellist error message: file ' path ' contains several variables. Only one model should be present.']);
++end
++
++try,
++	struc=load(path,'-mat');
++
++	%get name of model variable
++	fieldname=char(fieldnames(struc));
++	mds=eval(['struc.' fieldname]);
++	if ~strcmpi(class(mds),'model'),
++		mds2=modellist;
++		mds2=structtomodel(mds2,mds);
++		mds=mds2;
++		clear mds2;
++	end
++	if nargout,
++		varargout{1}=mds;
++	else
++		assignin('caller',fieldname,mds);
++	end
++catch me
++	disp(getReport(me))
++	error(['could not load model ' path]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodel.m	(revision 12996)
+@@ -0,0 +1,46 @@
++function varargout=loadmodel(path)
++%LOADMODEL - load a model using built-in load module
++%
++%   check that model prototype has not changed. if so, adapt to new model prototype.
++%
++%   Usage:
++%      md=loadmodel(path)
++%      loadmodel path
++
++%check nargout
++if nargout>1,
++	error('loadmodel usage error: md=loadmodel(path)');
++end
++
++%check existence
++if exist(path,'file')
++	%do nothing
++elseif exist([path '.mat'],'file')
++	%add extension
++	path = [path '.mat'];
++else
++	error(['loadmodel error message: file ' path ' does not exist']);
++end
++
++try,
++	%recover model on file and name it md
++	warning off MATLAB:unknownElementsNowStruc;
++	warning off MATLAB:load:classNotFound
++	struc=load(path,'-mat');
++	warning on MATLAB:unknownElementsNowStruc;
++	warning on MATLAB:load:classNotFound
++
++	name=char(fieldnames(struc));
++	if size(name,1)>1,
++		error(['loadmodel error message: file ' path ' contains several variables. Only one model should be present.']); 
++	end
++	md=struc.(name);
++	if nargout,
++		varargout{1}=md;
++	else
++		assignin('caller',name,md);
++	end
++catch me
++	disp(getReport(me))
++	error(['could not load model ' path]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/VelFindVarNames.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/VelFindVarNames.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/VelFindVarNames.m	(revision 12996)
+@@ -0,0 +1,122 @@
++function Names=VelFindVarNames(filename)
++%VELFINDVARNAMES - find names of variables in a velocity data set file
++%
++%   This routines looks at the variables contained in a file and finds out
++%   the names of the variables that are needed for an interpolation (x,y,vx,vy)
++%   or (index,x,y,vx,vy)
++%
++%   Usage:
++%      Names=VelFindVarNames(filename)
++%
++%   Example:
++%      Names=VelFindVarNames('velocities.mat')
++%
++%   See also: INTERPFROMFILE, GRIDDATA
++
++%some checks
++if nargin~=1 | nargout~=1
++	help VelFindVarNames
++	error('VelFindVarNames error message: bad usage');
++end
++if ~exist(filename)
++	error(['VelFindVarNames error message: file ' filename  ' does not exist']);
++end
++
++%Get variables
++A=whos('-file',filename);
++
++%find x,y,vx and vy
++xenum=NaN; yenum=NaN; vxenum=NaN; vyenum=NaN; indexenum=NaN;
++if length(A)==4,
++	isnode=1;
++	for i=1:4
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		else
++			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
++				vxenum=i;
++			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
++				vyenum=i;
++			end
++		end
++	end
++elseif length(A)==5,
++	isnode=0;
++	for i=1:5
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		elseif (strcmpi(A(i).name(1),'index') | strcmpi(A(i).name(1),'elements'));
++			indexenum=i;
++		else
++			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
++				vxenum=i;
++			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
++				vyenum=i;
++			end
++		end
++	end
++else
++	error(['VelFindVarNames error message: file ' filename  ' not supported yet (it should hold 4 variables x,y,vx and vy (for nodes) OR 5 variables  x,y,index,vx and vy (for mesh))']);
++end
++
++%assum that we have found at least vxenum and vyenum
++if ( isnan(vxenum) | isnan(vyenum))
++	error(['VelFindVarNames error message: file ' filename  ' not supported yet (the velocities should be named vx and vy)']);
++end
++
++%find index
++if (~isnode & isnan(indexenum)),
++	for i=1:5
++		lengthi=min(A(i).size);
++		if (lengthi==3),
++			indexenum=i;
++		end
++	end
++	if isnan(indexenum),
++		error(['VelFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
++	end
++end
++
++%find x y
++if (isnan(xenum) | isnan(yenum))
++
++	%check the size
++	if A(vxenum).size(1)==A(vxenum).size(2),
++		error(['VelFindVarNames error message: file ' filename  ' not supported (velocities is a square matrix, save x and y with another name)']);
++	end
++	if ~(A(vxenum).size(1)==A(vyenum).size(1) & A(vxenum).size(2)==A(vyenum).size(2)),
++		error(['VelFindVarNames error message: file ' filename  ' not supported (vx and vy matrices do not have the same size)']);
++	end
++
++	%find xenum and yenum
++	for i=1:4
++		lengthi=max(A(i).size);
++		if ((i~=vxenum) & (lengthi==A(vxenum).size(1) | lengthi==A(vxenum).size(1)+1)),
++			yenum=i;
++		elseif ((i~=vxenum) & (lengthi==A(vxenum).size(2) | lengthi==A(vxenum).size(2)+1)),
++			xenum=i;
++		end
++	end
++
++	%last check
++	if (isnan(xenum) | isnan(yenum))
++		error(['plugdata error message: file ' filename  ' not supported yet']);
++	end
++end
++
++%create output
++Names=struct();
++Names.xname=A(xenum).name;
++Names.yname=A(yenum).name;
++Names.vxname=A(vxenum).name;
++Names.vyname=A(vyenum).name;
++if ~isnode,
++	Names.indexname=A(indexenum).name; 
++	Names.interp='mesh';
++else
++	Names.interp='node';
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/InterpFromFile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/InterpFromFile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/InterpFromFile.m	(revision 12996)
+@@ -0,0 +1,44 @@
++function data_out=InterpFromFile(x,y,filename,default_value)
++%INTERPFROMFILE - load data and interpolate on the given nodes
++%
++%   load a matlab file (extension .mat) which holds 3 or 4 variables
++%   and interpolate the data on the mesh and plug it onto the model.
++%
++%   o 3 variables
++%     - a vector x (if the name of the variable do not begin with "x", an error can appear)
++%     - a vector y (if the name of the variable do not begin with "y", an error can appear)
++%     - a vector or matrix data (if the name of the variable do not begin with the field name, an error can appear)
++%   o 4 variables
++%     - a vector x (if the name of the variable do not begin with "x", an error can appear)
++%     - a vector y (if the name of the variable do not begin with "y", an error can appear)
++%     - a matrix with 3 columns (if the name of the variable do not begin with "index" or "elements", an error can appear)
++%     - a vector data (if the name of the variable do not begin with the field name, an error can appear)
++%
++%   Usage:
++%      data=InterpFromFile(x,y,filename,default_value);
++%
++%   Example:
++%      md.geometry.surface=InterpFromFile(md.mesh.x,md.mesh.y,'surfacefile.mat',0);
++%
++%   See also: PLUGVELOCITIES, INTERPFROMGRID, INTERPFROMMESH2D, INTERPFROMMESH3D
++
++%some checks
++if nargin~=4 | nargout~=1
++	help InterpFromFile
++	error('plugdata error message: bad usage');
++end
++if ~exist(filename)
++	error(['plugdata error message: file ' filename  ' does not exist']);
++end
++if length(x)~=length(y),
++	error('plugdata error message: x and y should have the same length');
++end
++
++%load file
++Names=FieldFindVarNames(filename);
++Data=load(filename);
++if strcmpi(Names.interp,'node'),
++	data_out=InterpFromGridToMesh(Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y,default_value);
++else
++	data_out=InterpFromMeshToMesh2d(Data.(Names.indexname),Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FillHole.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FillHole.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FillHole.m	(revision 12996)
+@@ -0,0 +1,39 @@
++function field=FillHole(index,x,y,field)
++%FILLHOLE - fill mesh data that has holes in it (hole is defined by field==NaN). Get the nearest neighboors to fill the holes.
++%
++%   Usage:
++%      surface=FillHole(index,x,y,surface)
++%
++%   Example:
++%      md.geometry.surface=FillHole(md.mesh.elements,x,md.mesh.y,md.geometry.surface)
++%
++
++%some checks
++if nargin~=4 | nargout~=1
++	help FillHole
++	error('FillHole error message: bad usage');
++end
++
++if length(x)~=length(y),
++	error('plugdata error message: x and y should have the same length');
++end
++
++
++pos_hole=find(isnan(field));
++pos_full=find(~isnan(field));
++
++%reduce our field to not include any holes: 
++field_noholes=field(pos_full);
++x_noholes=x(pos_full);
++y_noholes=y(pos_full);
++
++for i=1:length(pos_hole)
++
++	if (mod(i,100)==0),
++		fprintf('\b\b\b\b\b\b\b%5.2f%s',i/length(pos_hole)*100,' %');
++	end
++
++	%search the node on the closest to i, that is not in a hole either
++	[d posd]=min(sqrt((x(pos_hole(i))-x_noholes).^2+(y(pos_hole(i))-y_noholes).^2));
++	field(pos_hole(i))=field_noholes(posd);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/plugvelocities.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/plugvelocities.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/plugvelocities.m	(revision 12996)
+@@ -0,0 +1,41 @@
++function md=plugvelocities(md,filename,default_value)
++%PLUGVELOCITIES - load velocities on a model
++%
++%   load a matlab file (extension .mat) which holds 4 variables
++%   x,y,vx,vy to be plugged onto the model (or similar names)
++%   x and y must be vectors, vx, vy matrices
++%
++%   Usage:
++%      md=plugvelocities(md,filename,default_value)
++%
++%   Example:
++%      md=plugvelocities(md,'velocityfile.mat',0);
++%
++%   See also: INTERPFROMFILE, GRIDDATA
++
++%some checks
++if nargin~=3 | nargout~=1
++	help plugvelocities
++	error('plugvelocities error message: bad usage');
++end
++if ~exist(filename)
++	error(['plugvelocities error message: file ' filename  ' does not exist']);
++end
++
++%load velocities 
++Names=VelFindVarNames(filename);
++Vel=load(filename);
++
++%Interpolation
++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,default_value);
++	md.inversion.vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,default_value);
++else
++	md.inversion.vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,default_value);
++	md.inversion.vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,default_value);
++end
++
++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.vel=md.inversion.vel_obs;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/PatchToVec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/PatchToVec.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/PatchToVec.m	(revision 12996)
+@@ -0,0 +1,21 @@
++function vec=PatchToVec(Patch);
++%PATCHTOVEC - converts a patch to a vector by averaging over each vertex
++%
++%   Usage:
++%      vec=PatchToVec(Patch)
++
++%if the patch is P0: we have element values, return an element vector
++switch(size(Patch.value,2)),
++	case 1,
++		vec(Patch.element)=Patch.value;
++	case 3,
++		connectivity=sparse(Patch.index(:),1,1);
++		value       =sparse(Patch.index(:),1,Patch.value(:));
++		vec=full(value./connectivity);
++	case 6,
++		connectivity=sparse(Patch.index(:),1,1);
++		value       =sparse(Patch.index(:),1,Patch.value(:));
++		vec=full(value./connectivity);
++	otherwise,
++		error('interpolation not supported yet');
++	end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FieldFindVarNames.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FieldFindVarNames.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FieldFindVarNames.m	(revision 12996)
+@@ -0,0 +1,153 @@
++function Names=FieldFindVarNames(filename)
++%FIELDFINDVARNAMES - find names of variables in a data set file
++%
++%   This routines looks at the variables contained in a file and finds out
++%   the names of the variables that are needed for an interpolation (x,y,data)
++%   or (index,x,y,data)
++%
++%   Usage:
++%      Names=FieldFindVarNames(filename)
++%
++%   Example:
++%      Names=FieldFindVarNames('thickness.mat')
++%
++%   See also: INTERPFROMFILE, GRIDDATA
++
++%some checks
++if nargin~=1 | nargout~=1
++	help FieldFindVarNames
++	error('FieldFindVarNames error message: bad usage');
++end
++if ~exist(filename)
++	error(['FieldFindVarNames error message: file ' filename  ' does not exist']);
++end
++
++%Get variables
++A=whos('-file',filename);
++
++%find x,y,vx and vy
++xenum=NaN; yenum=NaN; dataenum=NaN; indexenum=NaN;
++if length(A)==3,
++	isnode=1;
++	for i=1:3
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
++			dataenum=i;
++		else
++			%nothing
++		end
++	end
++elseif length(A)==4,
++	isnode=0;
++	for i=1:4
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		elseif (strncmpi(A(i).name,'index',5) | strncmpi(A(i).name,'elements',7));
++			indexenum=i;
++		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
++			dataenum=i;
++		else
++			%nothing
++		end
++	end
++else
++	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (it should hold 3 variables x,y and data (for nodes) OR 4 variables  x,y,index and data (for mesh))']);
++end
++
++%2: if only one item is missing, find it by elimination
++if ~isnode,
++	pos=find(isnan([xenum yenum indexenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:4,list);
++		elseif pos==2,
++			yenum=setdiff(1:4,list);
++		elseif pos==3,
++			indexenum=setdiff(1:4,list);
++		elseif pos==4,
++			dataenum=setdiff(1:4,list);
++		end
++	end
++else
++	pos=find(isnan([xenum yenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:3,list);
++		elseif pos==2,
++			yenum=setdiff(1:3,list);
++		elseif pos==3,
++			dataenum=setdiff(1:3,list);
++		end
++	end
++end
++
++%assum that we have found at least xenum and yenum
++if ( isnan(xenum) | isnan(yenum))
++	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (the coordinates vectors should be named x and y)']);
++end
++
++%find index
++if (~isnode & isnan(indexenum)),
++	for i=1:4
++		lengthi=min(A(i).size);
++		if (lengthi==3),
++			indexenum=i;
++		end
++	end
++	if isnan(indexenum),
++		error(['FieldFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
++	end
++end
++
++%4: last chance
++if ~isnode,
++	pos=find(isnan([xenum yenum indexenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:4,list);
++		elseif pos==2,
++			yenum=setdiff(1:4,list);
++		elseif pos==3,
++			indexenum=setdiff(1:4,list);
++		elseif pos==4,
++			dataenum=setdiff(1:4,list);
++		end
++	end
++else
++	pos=find(isnan([xenum yenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:3,list);
++		elseif pos==2,
++			yenum=setdiff(1:3,list);
++		elseif pos==3,
++			dataenum=setdiff(1:3,list);
++		end
++	end
++end
++
++%last check
++if isnan(dataenum)
++	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (data not found)']);
++end
++
++%create output
++Names=struct();
++Names.xname=A(xenum).name;
++Names.yname=A(yenum).name;
++Names.dataname=A(dataenum).name;
++if ~isnode,
++	Names.indexname=A(indexenum).name; 
++	Names.interp='mesh';
++else
++	Names.interp='node';
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py	(revision 12996)
+@@ -0,0 +1,156 @@
++import numpy
++import os
++from pairoptions import *
++from MatlabFuncs import *
++
++def checkfield(md,fieldname,*args):
++	"""
++	CHECKFIELD - check field consistency
++
++	   Used to check model consistency.
++	   Available options:
++	      - NaN: 1 if check that there is no NaN
++	      - size: [lines cols], NaN for non checked dimensions
++	      - >:  greater than provided value
++	      - >=: greater or equal to provided value
++	      - <:  smallerthan provided value
++	      - <=: smaller or equal to provided value
++	      - < vec:  smallerthan provided values on each vertex
++	      - forcing: 1 if check forcing consistency (size and time)
++	      - values: cell of strings or vector of acceptable values
++	      - numel: list of acceptable number of elements
++	      - cell: 1 if check that is cell
++	      - empty: 1 if check that non empty
++	      - message: overloaded error message
++
++	   Usage:
++	      md = checkfield(md,fieldname,options);
++
++	   Example:
++	      md = checkfield(md,'mesh.elementonbed','size',[md.mesh.numberofelements 1],'values',[0 1]);
++	      md = checkfield(md,'diagnostic.icefront','size',[NaN 4],'NaN',1);
++	      md = checkfield(md,'diagnostic.icefront(:,end)','values',[0 1 2]);
++	"""
++
++	#get options
++	options=pairoptions(*args)
++
++	#get field from model
++#	field=getattr(md,fieldname)
++	exec("field=md.%s" % fieldname)
++
++	#check empty
++	if options.exist('empty'):
++		if not field:
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' is empty" % fieldname))
++
++	#Check size
++	if options.exist('size'):
++		fieldsize=options.getfieldvalue('size')
++		if   len(fieldsize) == 1:
++			if (not numpy.size(field,0)==fieldsize[0]):
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' size should be %d" % (fieldname,fieldsize[0])))
++		elif len(fieldsize) == 2:
++			if   numpy.isnan(fieldsize[0]):
++				if not numpy.size(field,1)==fieldsize[1]:
++					md = md.checkmessage(options.getfieldvalue('message',\
++						"field '%s' should have %d columns" % (fieldname,fieldsize[1])))
++			elif numpy.isnan(fieldsize[1]):
++				if not numpy.size(field,0)==fieldsize[0]:
++					md = md.checkmessage(options.getfieldvalue('message',\
++						"field '%s' should have %d lines" % (fieldname,fieldsize[0])))
++			else:
++				if (not numpy.size(field,0)==fieldsize[0]) or (not numpy.size(field,1)==fieldsize[1]):
++					md = md.checkmessage(options.getfieldvalue('message',\
++						"field '%s' size should be %d x %d" % (fieldname,fieldsize[0],fieldsize[1])))
++	
++	#Check numel
++	if options.exist('numel'):
++		fieldnumel=options.getfieldvalue('numel')
++		if not numpy.size(field) in fieldnumel:
++			if   len(fieldnumel)==1:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' size should be %d" % (fieldname,fieldnumel)))
++			elif len(fieldnumel)==2:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' size should be %d or %d" % (fieldname,fieldnumel[0],fieldnumel[1])))
++			else:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' size should be %s" % (fieldname,fieldnumel)))
++
++	#check NaN
++	if options.getfieldvalue('NaN',0):
++		if True in numpy.isnan(field):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"NaN values found in field '%s'" % fieldname))
++
++	#check cell
++	if options.getfieldvalue('cell',0):
++		if not isinstance(field,(tuple,list,dict)):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should be a cell" % fieldname))
++
++	#check values
++	if options.exist('values'):
++		fieldvalues=options.getfieldvalue('values')
++		if False in ismember(field,fieldvalues):
++			if   len(fieldvalues)==1:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' value should be '%s'"  % (fieldname,fieldvalues[0])))
++			elif len(fieldvalues)==2:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' values should be '%s' or '%s'"  % (fieldname,fieldvalues[0],fieldvalues[1])))
++			else:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' should have values in %s" % (fieldname,fieldvalues)))
++
++	#check greater
++	if options.exist('>='):
++		lowerbound=options.getfieldvalue('>=')
++		if numpy.any(field<lowerbound):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should have values above %d" % (fieldname,lowerbound)))
++	if options.exist('>'):
++		lowerbound=options.getfieldvalue('>')
++		if numpy.any(field<=lowerbound):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should have values above %d" % (fieldname,lowerbound)))
++
++	#check smaller
++	if options.exist('<='):
++		upperbound=options.getfieldvalue('<=')
++		if numpy.any(field>upperbound):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should have values below %d" % (fieldname,upperbound)))
++	if options.exist('<'):
++		upperbound=options.getfieldvalue('<')
++		if numpy.any(field>=upperbound):
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should have values below %d" % (fieldname,upperbound)))
++
++	#check file
++	if options.getfieldvalue('file',0):
++		if not os.path.exists(field):
++			md = md.checkmessage("file provided in '%s': '%s' does not exist" % (fieldname,field))
++
++	#Check forcings (size and times)
++	if options.getfieldvalue('forcing',0):
++		if   numpy.size(field,0)==md.mesh.numberofvertices:
++			if not numpy.size(field,1)==1:
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' should have only one column as there are md.mesh.numberofvertices lines" % fieldname))
++		elif numpy.size(field,0)==md.mesh.numberofvertices+1:
++			if not numpy.all(field[-1,:]==numpy.sort(field[-1,:])):
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' columns should be sorted chronologically" % fieldname))
++			if nump.any(field[-1,0:-1]==field[-1,1:]):
++				md = md.checkmessage(options.getfieldvalue('message',\
++					"field '%s' columns must not contain duplicate timesteps" % fieldname))
++		else:
++			md = md.checkmessage(options.getfieldvalue('message',\
++				"field '%s' should have md.mesh.numberofvertices or md.mesh.numberofvertices+1 lines" % fieldname))
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.m	(revision 12996)
+@@ -0,0 +1,195 @@
++function md = checkfield(md,fieldname,varargin)
++%CHECKFIELD - check field consistency
++%
++%   Used to check model consistency.
++%   Available options:
++%      - NaN: 1 if check that there is no NaN
++%      - size: [lines cols], NaN for non checked dimensions
++%      - >:  greater than provided value
++%      - >=: greater or equal to provided value
++%      - <:  smallerthan provided value
++%      - <=: smaller or equal to provided value
++%      - < vec:  smallerthan provided values on each vertex
++%      - forcing: 1 if check forcing consistency (size and time)
++%      - values: cell of strings or vector of acceptable values
++%      - numel: list of acceptable number of elements
++%      - cell: 1 if check that is cell
++%      - empty: 1 if check that non empty
++%      - message: overloaded error message
++%
++%   Usage:
++%      md = checkfield(md,fieldname,options);
++%
++%   Example:
++%      md = checkfield(md,'mesh.elementonbed','size',[md.mesh.numberofelements 1],'values',[0 1]);
++%      md = checkfield(md,'diagnostic.icefront','size',[NaN 4],'NaN',1);
++%      md = checkfield(md,'diagnostic.icefront(:,end)','values',[0 1 2]);
++
++%get options
++options=pairoptions(varargin{:});
++
++%get field from model
++eval(['field=md.' fieldname ';']);
++
++%check empty
++if exist(options,'empty')
++	if isempty(field),
++		md = checkmessage(md,getfieldvalue(options,'message',...
++			['field ''' fieldname ''' is empty']));
++	end
++end
++
++%Check size
++if exist(options,'size')
++	fieldsize=getfieldvalue(options,'size');
++	if isnan(fieldsize(1)),
++		if (size(field,2)~=fieldsize(2)),
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' should have ' num2str(fieldsize(2)) ' columns']));
++		end
++	elseif isnan(fieldsize(2)),
++		if (size(field,1)~=fieldsize(1)),
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' should have ' num2str(fieldsize(1)) ' lines']));
++		end
++	else
++		if ((size(field,1)~=fieldsize(1)) |  (size(field,2)~=fieldsize(2)))
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' size should be ' num2str(fieldsize(1)) ' x ' num2str(fieldsize(2))]));
++		end
++	end
++end
++
++%Check numel
++if exist(options,'numel')
++	fieldnumel=getfieldvalue(options,'numel');
++	if ~ismember(numel(field),fieldnumel),
++		if length(fieldnumel)==1
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' size should be ' sprintf('%g ',fieldnumel) ]));
++		elseif length(fieldnumel)==2
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' size should be ' num2str(fieldnumel(1)) ' or ' num2str(fieldnumel(2)) ]));
++		else
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' size should be ' sprintf('%g, ',fieldnumel(1:end-1)) ' or ' num2str(fieldnumel(end)) ]));
++		end
++	end
++end
++
++%check NaN
++if getfieldvalue(options,'NaN',0);
++	field2=reshape(field,prod(size(field)),1);
++	if any(isnan(field2)),
++		md = checkmessage(md,getfieldvalue(options,'message',...
++			['NaN values found in field ''' fieldname '''']));
++	end
++end
++
++%check cell
++if getfieldvalue(options,'cell',0);
++	if ~iscell(field),
++		md = checkmessage(md,getfieldvalue(options,'message',...
++			['field ''' fieldname ''' should be a cell']));
++	end
++end
++
++%check values
++if exist(options,'values')
++	fieldvalues=getfieldvalue(options,'values');
++	if iscell(fieldvalues), %strings
++		if ischar(field) | iscell(fieldvalues),
++			if any(~ismember(field,fieldvalues)),
++				if length(fieldvalues)==1
++					md = checkmessage(md,getfieldvalue(options,'message',...
++						['field ''' fieldname ''' value should be ''' fieldvalues{1} '''']));
++				elseif length(fieldvalues)==2
++					md = checkmessage(md,getfieldvalue(options,'message',...
++						['field ''' fieldname ''' values should be ''' fieldvalues{1} ''' or ''' fieldvalues{2} '''']));
++				else
++					md = checkmessage(md,getfieldvalue(options,'message',...
++						['field ''' fieldname ''' should have values in ' sprintf('''%s'', ',fieldvalues{1:end-1}) 'or ''' fieldvalues{end} '''']));
++				end
++			end
++		else
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' should be one of the following strings: ' sprintf('''%s'', ',fieldvalues{1:end-1}) 'or ''' fieldvalues{end} '''']));
++		end
++	else
++		field2=reshape(field,prod(size(field)),1);
++		if isnumeric(field),
++			if any(~ismember(field2,fieldvalues)),
++				md = checkmessage(md,getfieldvalue(options,'message',...
++					['field ''' fieldname ''' should have values in [' num2str(fieldvalues) ']']));
++			end
++		else
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' should be a number in [' num2str(fieldvalues) ']']));
++		end
++	end
++end
++
++%check greater
++if exist(options,'>=')
++	lowerbound=getfieldvalue(options,'>=');
++	field2=reshape(field,prod(size(field)),1);
++	if any(field2<lowerbound),
++		md = checkmessage(md,getfieldvalue(options,'message',...
++			['field ''' fieldname ''' should have values above ' num2str(lowerbound(1,1))]));
++	end
++end
++if exist(options,'>')
++	lowerbound=getfieldvalue(options,'>');
++	field2=reshape(field,prod(size(field)),1);
++	if any(field2<=lowerbound),
++		md = checkmessage(md,getfieldvalue(options,'message',...
++			['field ''' fieldname ''' should have values above ' num2str(lowerbound(1,1))]));
++	end
++end
++
++%check smaller
++if exist(options,'<=')
++	upperbound=getfieldvalue(options,'<=');
++	field2=reshape(field,prod(size(field)),1);
++	if any(field2>upperbound),
++		md = checkmessage(md,getfieldvalue(options,'message',...
++			['field ''' fieldname ''' should have values below ' num2str(upperbound(1,1))]));
++	end
++end
++if exist(options,'<')
++	upperbound=getfieldvalue(options,'<');
++	field2=reshape(field,prod(size(field)),1);
++	if any(field2>=upperbound),
++		md = checkmessage(md,getfieldvalue(options,'message',...
++			['field ''' fieldname ''' should have values below ' num2str(upperbound(1,1))]));
++	end
++end
++
++%check file
++if getfieldvalue(options,'file',0),
++	if ~exist(field,'file')
++		md = checkmessage(md,['file provided in ''' fieldname ''': ''' field ''' does not exist']);
++	end
++end
++
++%Check forcings (size and times)
++if getfieldvalue(options,'forcing',0),
++	if size(field,1)==md.mesh.numberofvertices,
++		if ~size(field,2)==1,
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' should have only one column as there are md.mesh.numberofvertices lines']));
++		end
++	elseif size(field,1)==md.mesh.numberofvertices+1
++		if any(field(end,:)~=sort(field(end,:))),
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' columns should be sorted chronologically']));
++		end
++		if any(field(end,1:end-1)==field(end,2:end)),
++			md = checkmessage(md,getfieldvalue(options,'message',...
++				['field ''' fieldname ''' columns must not contain duplicate timesteps']));
++		end
++	else
++		md = checkmessage(md,getfieldvalue(options,'message',...
++			['field ''' fieldname ''' should have md.mesh.numberofvertices or md.mesh.numberofvertices+1 lines']));
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/create_region.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/create_region.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/create_region.m	(revision 12996)
+@@ -0,0 +1,15 @@
++function create_region(name)
++%CREATE_REGION - create region  ????
++%
++%   very temporary function.
++%   
++%   Usage: 
++%      create_region(name)
++
++eval(['mkdir ' name]);
++eval(['cd ' name ]);
++!mkdir Delivery Exp_Par Results
++cd Exp_Par
++!cp ../../RonneShelf/Exp_Par/* ./
++!rm -rf Hole*
++eval(['!mv Ronne.par ' name '.par']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/findarg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/findarg.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/findarg.m	(revision 12996)
+@@ -0,0 +1,51 @@
++function  vals=findarg(arglist,field)
++%FINDARG - find argument associated to a field in a list
++%
++%   This function parses through an argument list (typically varargin in a routine)
++%   looking for a character array equal to field. Once this is found, we return the 
++%   next value in the varargin (if possible). 
++%   Because field might appear several times in the argument list, we return a structure 
++%   holding all these values. 
++%   Note that all comparisons to field value are case independent.
++%
++%   Usage:
++%      vals=findarg(arglist,field)
++%
++%   Example:
++%      routine foobar calls vals=findarg('Data',varargin)
++%      with varargin='Data',1,'Data','foo','Plot','velocity','Arrow',4
++%      findarg would return the following structure: vals(1).value=1, vals(2).value='foo'; 
++
++%some argument checking: 
++if ((nargin==0) | (nargout==0)),
++	help findarg;
++	error('findarg error message');
++end
++
++if ~ischar(field),
++	error('findarg error message: field should be a string');
++end
++
++if ~iscell(arglist),
++	error('findarg error message: argument list should be a cell array.');
++end
++
++%Recover data to plot
++founddata=0;
++
++for i=1:(length(arglist)-1), %data in arglist comes in pairs, hence the -1.
++	if ischar(arglist{i}),
++		if (strcmpi(arglist{i},field)),
++			founddata=founddata+1;
++			if founddata==1,
++				vals.value=arglist{i+1};
++			else
++				vals(end+1).value=arglist{i+1};
++			end
++		end
++	end
++end
++
++if founddata==0,
++	vals=[];
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf2struct.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf2struct.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf2struct.m	(revision 12996)
+@@ -0,0 +1,27 @@
++function S=netcdf2struct(File)
++%NETCDF2STRUCT - load netcdf file and convert to a matlab structure
++%
++%   Usage:
++%      S=netcdf2struct(File);
++
++%Read netcdf file
++data=netcdf(File);
++
++%initialize output
++S=struct();
++
++%All the variables are in VarArray field
++variables=data.VarArray;
++for i=1:size(variables,2),
++	fieldname=deblank(variables(i).Str);
++	fieldvalue=double(squeeze(variables(i).Data));
++	S.(fieldname)=fieldvalue;
++end
++
++%All the variables are in AttArray field
++variables=data.AttArray;
++for i=1:size(variables,2),
++	fieldname=deblank(variables(i).Str);
++	fieldvalue=double(variables(i).Val);
++	S.(fieldname)=fieldvalue;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/issmdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/issmdoc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/issmdoc.m	(revision 12996)
+@@ -0,0 +1,15 @@
++%Quick documentation for ISSM
++
++%First get ISSM tier: 
++ISSM_DIR=issmdir;
++
++disp(sprintf('\n%s','  A comprehensive documentation is available on http://issm.jpl.nasa.gov'));
++disp(sprintf('\n%s','  Example: how to create a square ice shelf'));
++disp(sprintf('%s','	   go to ',ISSM_DIR,'/examples/SquareIceshelf'));
++disp(sprintf('%s','	   md=model;                                %creates a new empty model structure'));
++disp(sprintf('%s','	   md=triangle(md,''DomainOutline.exp'',50000);   %creates a mesh of the domain outline with a resolution of 50000m'));
++disp(sprintf('%s','	   md=setmask(md,''all'','''');               %defines the glacier system as an ice shelf (no island)'));
++disp(sprintf('%s','	   md=parameterize(md,''Square.par'');        %fills all the other fields of the model'));
++disp(sprintf('%s','	   md=setflowequation(md,''macayeal'',''all''); %defines all elements as MacAyeal''s'));
++disp(sprintf('%s','	   md=solve(md,DiagnosticSolutionEnum);   %generate the velocity field'));
++disp(sprintf('%s','	   plotmodel(md,''data'',md.results.DiagnosticSolution.Vel);    %displays the velocity (type plotdoc for plotmodel help)'));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/structtoobj.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/structtoobj.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/structtoobj.m	(revision 12996)
+@@ -0,0 +1,16 @@
++function obj=structtoobj(obj,S),
++%Convert struct to object
++
++	%Get object and structure fields
++	structfields=fields(S);
++	objprops    =properties(class(obj));
++
++	%recover object properties
++	for i=1:length(structfields),
++		fieldname =structfields{i};
++		if ismember(fieldname,objprops),
++			fieldvalue=getfield(S,fieldname);
++			obj=setfield(obj,fieldname,fieldvalue);
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf.m	(revision 12996)
+@@ -0,0 +1,136 @@
++function S = netcdf(File,varargin)
++% Function to read NetCDF files
++%   S = netcdf(File)
++% Input Arguments
++%   File = NetCDF file to read
++% Optional Input Arguments:
++%   'Var',Var - Read data for VarArray(Var), default [1:length(S.VarArray)]
++%   'Rec',Rec - Read data for Record(Rec), default [1:S.NumRecs]
++% Output Arguments:
++%   S    = Structure of NetCDF data organised as per NetCDF definition
++% Notes:
++%   Only version 1, classic 32bit, NetCDF files are supported. By default
++% data are extracted into the S.VarArray().Data field for all variables.
++% To read the header only call S = netcdf(File,'Var',[]);
++%
++% SEE ALSO
++% ---------------------------------------------------------------------------
++S = [];
++
++try
++   if exist(File,'file') fp = fopen(File,'r','b');
++   else fp = []; error('File not found'); end
++   if fp == -1   error('Unable to open file'); end
++
++% Read header
++   Magic = fread(fp,4,'uint8=>char');
++   if strcmp(Magic(1:3),'CDF') error('Not a NetCDF file'); end
++   if uint8(Magic(4))~=1       error('Version not supported'); end
++   S.NumRecs  = fread(fp,1,'uint32=>uint32');
++   S.DimArray = DimArray(fp);
++   S.AttArray = AttArray(fp);
++   S.VarArray = VarArray(fp);
++
++% Setup indexing to arrays and records
++   Var = ones(1,length(S.VarArray));
++   Rec = ones(1,S.NumRecs);
++   for i = 1:2:length(varargin)
++      if     strcmp(upper(varargin{i}),'VAR') Var=Var*0; Var(varargin{i+1})=1;
++      elseif strcmp(upper(varargin{i}),'REC') Rec=Rec*0; Rec(varargin{i+1})=1;
++      else error('Optional input argument not recognised'); end
++   end
++   if sum(Var)==0 fclose(fp); return; end
++
++% Read non-record variables
++   Dim = double(cat(2,S.DimArray.Dim));
++   ID  = double(cat(2,S.VarArray.Type));
++
++   for i = 1:length(S.VarArray)
++      D = Dim(S.VarArray(i).DimID+1); N = prod(D); RecID{i}=find(D==0);
++      if isempty(RecID{i})
++         if length(D)==0 D = [1,1]; N = 1; elseif length(D)==1 D=[D,1]; end
++         if Var(i)
++            S.VarArray(i).Data = ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D);
++            fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8');
++         else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
++      else S.VarArray(i).Data = []; end
++   end
++
++% Read record variables
++   for k = 1:S.NumRecs
++      for i = 1:length(S.VarArray)
++         if ~isempty(RecID{i})
++            D = Dim(S.VarArray(i).DimID+1); D(RecID{i}) = 1; N = prod(D);
++            if length(D)==1 D=[D,1]; end
++            if Var(i) & Rec(k)
++               S.VarArray(i).Data = cat(RecID{i},S.VarArray(i).Data,...
++                  ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D));
++               if N > 1 fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8'); end
++            else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
++         end
++      end
++   end
++
++   fclose(fp);
++catch
++   Err = lasterror; fprintf('%s\n',Err.message);
++   if ~isempty(fp) && fp ~= -1 fclose(fp); end
++end
++
++% ---------------------------------------------------------------------------------------
++% Utility functions
++
++function S = Size(ID)
++% Size of NetCDF data type, ID, in bytes
++   S = subsref([1,1,2,4,4,8],struct('type','()','subs',{{ID}}));
++
++function T = Type(ID)
++% Matlab string for CDF data type, ID
++   T = subsref({'int8','char','int16','int32','single','double'},...
++               struct('type','{}','subs',{{ID}}));
++
++function N = Pad(Num,ID)
++% Number of elements to read after padding to 4 bytes for type ID
++   N = (double(Num) + mod(4-double(Num)*Size(ID),4)/Size(ID)).*(Num~=0);
++
++function S = String(fp)
++% Read a CDF string; Size,[String,[Padding]]
++   S = fread(fp,Pad(fread(fp,1,'uint32=>uint32'),1),'uint8=>char').';
++
++function A = ReOrder(A,S)
++% Rearrange CDF array A to size S with matlab ordering
++   A = permute(reshape(A,fliplr(S)),fliplr(1:length(S)));
++
++function S = DimArray(fp)
++% Read DimArray into structure
++   if fread(fp,1,'uint32=>uint32') == 10 % NC_DIMENSION
++      for i = 1:fread(fp,1,'uint32=>uint32')
++         S(i).Str = String(fp);
++         S(i).Dim = fread(fp,1,'uint32=>uint32');
++      end
++   else fread(fp,1,'uint32=>uint32'); S = []; end
++
++function S = AttArray(fp)
++% Read AttArray into structure
++   if fread(fp,1,'uint32=>uint32') == 12 % NC_ATTRIBUTE
++      for i = 1:fread(fp,1,'uint32=>uint32')
++         S(i).Str = String(fp);
++         ID       = fread(fp,1,'uint32=>uint32');
++         Num      = fread(fp,1,'uint32=>uint32');
++         S(i).Val = fread(fp,Pad(Num,ID),[Type(ID),'=>',Type(ID)]).';
++      end
++   else fread(fp,1,'uint32=>uint32'); S = []; end
++
++function S = VarArray(fp)
++% Read VarArray into structure
++   if fread(fp,1,'uint32=>uint32') == 11 % NC_VARIABLE
++      for i = 1:fread(fp,1,'uint32=>uint32')
++         S(i).Str      = String(fp);
++         Num           = double(fread(fp,1,'uint32=>uint32'));
++         S(i).DimID    = double(fread(fp,Num,'uint32=>uint32'));
++         S(i).AttArray = AttArray(fp);
++         S(i).Type     = fread(fp,1,'uint32=>uint32');
++         S(i).VSize    = fread(fp,1,'uint32=>uint32');
++         S(i).Begin    = fread(fp,1,'uint32=>uint32'); % Classic 32 bit format only
++      end
++   else fread(fp,1,'uint32=>uint32'); S = []; end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.py	(revision 12996)
+@@ -0,0 +1,50 @@
++from numpy import *
++
++def paterson(temperature):
++
++    # Local Variables: pos11, pos5, pos10, temperature, pos, T, pos8, pos9, pos6, pos7, pos4, rigidity, pos2, pos3, pos1
++    # Function calls: length, zeros, argwhere, paterson, error
++    #PATERSON - figure out the rigidity of ice for a given temperature
++    #
++    #   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
++    #   temperature is in Kelvin degrees
++    #
++    #   Usage:
++    #      rigidity=paterson(temperature)
++    
++	pos=argwhere(temperature<0.)
++	if len(pos):
++		print 'input temperature should be in Kelvin (positive)'
++		return []
++    
++	T = temperature-273.15
++	#The routine below is equivalent to:
++	# n=3; T=temperature-273;
++	# %From paterson,
++	# Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
++	# A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
++	# 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
++	# %Convert into rigidity B
++	# B=A.^(-1/n)*10^3; %s^(1/3)Pa
++	# %Now, do a cubic fit between Temp and B: 
++	# fittedmodel=fit(Temp,B,'cubicspline');
++	# rigidity=fittedmodel(temperature);
++
++	rigidity=zeros(len(T))
++	pos1=argwhere(T<=-45);           rigidity[pos1]=10**8*(-0.000292866376675*(T[pos1]+50)**3+ 0.011672640664130*(T[pos1]+50)**2  -0.325004442485481*(T[pos1]+50)+  6.524779401948101)
++	pos2=argwhere(logical_and(-45<=T,T<-40));   rigidity[pos2]=10**8*(-0.000292866376675*(T[pos2]+45)**3+ 0.007279645014004*(T[pos2]+45)**2  -0.230243014094813*(T[pos2]+45)+  5.154964909039554)
++	pos3=argwhere(logical_and(-40<=T,T<-35));   rigidity[pos3]=10**8*(0.000072737147457*(T[pos3]+40)**3+  0.002886649363879*(T[pos3]+40)**2  -0.179411542205399*(T[pos3]+40)+  4.149132666831214)
++	pos4=argwhere(logical_and(-35<=T,T<-30));   rigidity[pos4]=10**8*(-0.000086144770023*(T[pos4]+35)**3+ 0.003977706575736*(T[pos4]+35)**2  -0.145089762507325*(T[pos4]+35)+  3.333333333333331)
++	pos5=argwhere(logical_and(-30<=T,T<-25));   rigidity[pos5]=10**8*(-0.000043984685769*(T[pos5]+30)**3+ 0.002685535025386*(T[pos5]+30)**2  -0.111773554501713*(T[pos5]+30)+  2.696559088937191)
++	pos6=argwhere(logical_and(-25<=T,T<-20));   rigidity[pos6]=10**8*(-0.000029799523463*(T[pos6]+25)**3+ 0.002025764738854*(T[pos6]+25)**2  -0.088217055680511*(T[pos6]+25)+  2.199331606342181)
++	pos7=argwhere(logical_and(-20<=T,T<-15));   rigidity[pos7]=10**8*(0.000136920904777*(T[pos7]+20)**3+  0.001578771886910*(T[pos7]+20)**2  -0.070194372551690*(T[pos7]+20)+  1.805165505978111)
++	pos8=argwhere(logical_and(-15<=T,T<-10));   rigidity[pos8]=10**8*(-0.000899763781026*(T[pos8]+15)**3+ 0.003632585458564*(T[pos8]+15)**2  -0.044137585824322*(T[pos8]+15)+  1.510778053489523)
++	pos9=argwhere(logical_and(-10<=T,T<-5));    rigidity[pos9]=10**8*(0.001676964325070*(T[pos9]+10)**3-  0.009863871256831*(T[pos9]+10)**2  -0.075294014815659*(T[pos9]+10)+  1.268434288203714)
++	pos10=argwhere(logical_and(-5<=T,T<-2));    rigidity[pos10]=10**8*(-0.003748937622487*(T[pos10]+5)**3+0.015290593619213*(T[pos10]+5)**2  -0.048160403003748*(T[pos10]+5)+  0.854987973338348)
++	pos11=argwhere(-2<=T);           rigidity[pos11]=10**8*(-0.003748937622488*(T[pos11]+2)**3-0.018449844983174*(T[pos11]+2)**2  -0.057638157095631*(T[pos11]+2)+  0.746900791092860)
++
++	#Now make sure that rigidity is positive
++	pos=argwhere(rigidity<0);        rigidity[pos]=1**6 
++
++	return rigidity
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.m	(revision 12996)
+@@ -0,0 +1,42 @@
++function rigidity=paterson(temperature)
++%PATERSON - figure out the rigidity of ice for a given temperature
++%
++%   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
++%   temperature is in Kelvin degrees
++%
++%   Usage:
++%      rigidity=paterson(temperature)
++
++if(temperature<0)
++	error('input temperature should be in Kelvin (positive)');
++end
++T=temperature-273.15;
++
++%The routine below is equivalent to:
++
++% n=3; T=temperature-273;
++% %From paterson,
++% Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
++% A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
++% 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
++% %Convert into rigidity B
++% B=A.^(-1/n)*10^3; %s^(1/3)Pa
++% %Now, do a cubic fit between Temp and B: 
++% fittedmodel=fit(Temp,B,'cubicspline');
++% rigidity=fittedmodel(temperature);
++
++rigidity=zeros(length(T),1);
++pos1=find(T<=-45);           rigidity(pos1)=10^8*(-0.000292866376675*(T(pos1)+50).^3+ 0.011672640664130*(T(pos1)+50).^2  -0.325004442485481*(T(pos1)+50)+  6.524779401948101);
++pos2=find(-45<=T & T<-40);   rigidity(pos2)=10^8*(-0.000292866376675*(T(pos2)+45).^3+ 0.007279645014004*(T(pos2)+45).^2  -0.230243014094813*(T(pos2)+45)+  5.154964909039554);
++pos3=find(-40<=T & T<-35);   rigidity(pos3)=10^8*(0.000072737147457*(T(pos3)+40).^3+  0.002886649363879*(T(pos3)+40).^2  -0.179411542205399*(T(pos3)+40)+  4.149132666831214);
++pos4=find(-35<=T & T<-30);   rigidity(pos4)=10^8*(-0.000086144770023*(T(pos4)+35).^3+ 0.003977706575736*(T(pos4)+35).^2  -0.145089762507325*(T(pos4)+35)+  3.333333333333331);
++pos5=find(-30<=T & T<-25);   rigidity(pos5)=10^8*(-0.000043984685769*(T(pos5)+30).^3+ 0.002685535025386*(T(pos5)+30).^2  -0.111773554501713*(T(pos5)+30)+  2.696559088937191);
++pos6=find(-25<=T & T<-20);   rigidity(pos6)=10^8*(-0.000029799523463*(T(pos6)+25).^3+ 0.002025764738854*(T(pos6)+25).^2  -0.088217055680511*(T(pos6)+25)+  2.199331606342181);
++pos7=find(-20<=T & T<-15);   rigidity(pos7)=10^8*(0.000136920904777*(T(pos7)+20).^3+  0.001578771886910*(T(pos7)+20).^2  -0.070194372551690*(T(pos7)+20)+  1.805165505978111);
++pos8=find(-15<=T & T<-10);   rigidity(pos8)=10^8*(-0.000899763781026*(T(pos8)+15).^3+ 0.003632585458564*(T(pos8)+15).^2  -0.044137585824322*(T(pos8)+15)+  1.510778053489523);
++pos9=find(-10<=T & T<-5);    rigidity(pos9)=10^8*(0.001676964325070*(T(pos9)+10).^3-  0.009863871256831*(T(pos9)+10).^2  -0.075294014815659*(T(pos9)+10)+  1.268434288203714);
++pos10=find(-5<=T & T<-2);    rigidity(pos10)=10^8*(-0.003748937622487*(T(pos10)+5).^3+0.015290593619213*(T(pos10)+5).^2  -0.048160403003748*(T(pos10)+5)+  0.854987973338348);
++pos11=find(-2<=T);           rigidity(pos11)=10^8*(-0.003748937622488*(T(pos11)+2).^3-0.018449844983174*(T(pos11)+2).^2  -0.057638157095631*(T(pos11)+2)+  0.746900791092860);
++
++%Now make sure that rigidity is positive
++pos=find(rigidity<0);        rigidity(pos)=10^6;
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/carter.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/carter.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/carter.m	(revision 12996)
+@@ -0,0 +1,28 @@
++function attenuation=carter(temperature)
++%CARTER - attenuation as a function of temperature
++%
++%   TWO WAY - Attenuation (in dB/m) as a function of temperature (K)
++%   From Carter at al. 2007 (Radar-based subglacial lake classification in Antarctica)
++%   Figure 4
++%
++%   Usage:
++%      attenuation=carter(temperature)
++
++if(temperature<0)
++	error('input temperature should be in Kelvin (positive)');
++end
++T=temperature-273.15;
++
++Temp=[-50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0]';
++A=[0.0015 0.002 0.003 0.0042 0.0055 0.0083 0.012 0.0175 0.026 0.038 0.055]';
++
++%Now, do a cubic fit between Temp and B: 
++[cfun,gof,output]=fit(Temp,A,'cubicspline');
++%breaks=cfun.p.breaks;
++%coeff=cfun.p.coefs;
++
++%Calculate attenuation
++attenuation=cfun(T);
++
++%Make it a 2 way attenuation
++attenuation=2*attenuation;
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/carter.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/lithostaticpressure.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/lithostaticpressure.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/lithostaticpressure.m	(revision 12996)
+@@ -0,0 +1,7 @@
++function pressure=lithostaticpressure(rho_ice,g,s,z);
++%LITHOSTATICPRESSURE - compute the lithostatic pressure
++%
++%   Usage:
++%      pressure=lithostacticpressure(rho_ice,g,surface,z)
++
++pressure=rho_ice*g*(s-z);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/varmap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/varmap.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/varmap.m	(revision 12996)
+@@ -0,0 +1,55 @@
++function output = varmap(x,y,data,varargin);
++%VARMAP - use gslib for Kriging
++%
++%   Usage:
++%      output = varmap(x,y,data,varargin)
++
++options=pairoptions(varargin{:});
++
++nxlag = getfieldvalue(options,'nxlag', 20);
++nylag = getfieldvalue(options,'nylag', 20);
++dxlag = getfieldvalue(options,'dxlag', 1000);
++dylag = getfieldvalue(options,'dylag', 1000);
++
++%Write data file
++fid=fopen('cluster.dat','w');
++fprintf(fid,'%s\n','Data file');
++fprintf(fid,'%i\n',3);
++fprintf(fid,'%s\n','Xlocation');
++fprintf(fid,'%s\n','Ylocation');
++fprintf(fid,'%s\n','Data');
++fprintf(fid,'%g %g %g\n',[x y data]');
++fclose(fid);
++
++%Write parameter file
++fid=fopen('varmap.par','w');
++fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
++fprintf(fid,'\t\t\t\t%s\n','*******************');
++fprintf(fid,'\n');
++fprintf(fid,'%s\n','START OF PARAMETERS:');
++fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
++fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
++fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
++fprintf(fid,'%-30s %s\n','0    '                      ,'\1=regular grid, 0=scattered values');
++fprintf(fid,'%-30s %s\n','50 50 1'                    ,'\if =1: nx, ny, nz');
++fprintf(fid,'%-30s %s\n','1.0 1.0 1.0'                ,'\       xsiz, ysiz, zsiz if igrid=1');
++fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\if =0: columns for x, y and z coordinates');
++fprintf(fid,'%-30s %s\n','varmap.out'                 ,'\file for variogram output');
++fprintf(fid,'%-30s %s\n',num2str([nxlag nylag 0],'%i '),'\nxlag, nylag, nzlag');
++fprintf(fid,'%-30s %s\n',num2str([dxlag dylag 1],'%g %g %i'),'\dxlag, dylag, dzlag');
++fprintf(fid,'%-30s %s\n','5'                          ,'\minimum number of pairs');
++fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
++fprintf(fid,'%-30s %s\n','1'                          ,'\number of variograms');
++fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail, head, variogram type');
++fclose(fid);
++
++%Call varmap
++system([issmdir() '/externalpackages/gslib/install/varmap varmap.par']);
++delete('varmap.par');
++
++%Read output
++fid=fopen('varmap.out','r');
++A = textscan(fid,'%f %f %f %f %f %f','headerlines',8);
++fclose(fid);
++delete('varmap.out')
++output = reshape(A{1},[2*nxlag+1 2*nylag+1]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataBoundaries.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataBoundaries.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataBoundaries.m	(revision 12996)
+@@ -0,0 +1,43 @@
++function	[Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
++%CREATEDATABOUNDARIES - Create values on the edge of the matrix
++%
++%   This function create vectors with coordinates and values to constrain a matrix 
++%   on its edge from a given matrix tiwh data everywhere.
++%   x_m and y_m belongs to the matrix to be constrained
++%   x_matrix, y_matrix belongs to the matrix to be constrained with
++%   datamatrix is the matrix with values for the constraint
++%
++%   Usage:
++%      [Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
++% 
++%   See also: TRACKSTOMATRIX, CREATEDATAMATRIX
++
++%Check the consistency of the data matrix
++if(length(x_matrix)~=(size(datamatrix,2)+1) | length(y_matrix)~=(size(datamatrix,1)+1)),
++	error('CreateDataBoundaries error message: size of matrix and vectors to constrained not consistent')
++end
++
++nxglobal=length(x_m);
++nyglobal=length(y_m);
++
++%Create the edgevalues and coordinates
++xedge1=x_m(1)*ones(nyglobal,1);
++xedge2=x_m(2:end-1);
++xedge3=x_m(end)*ones(nyglobal,1);
++xedge4=x_m(2:end-1);
++xedge5=x_m(2)*ones(nyglobal-2,1);
++xedge6=x_m(3:end-2);
++xedge7=x_m(end-1)*ones(nyglobal-2,1);
++xedge8=x_m(3:end-2);
++yedge1=y_m;
++yedge2=y_m(1)*ones(nxglobal-2,1);
++yedge3=y_m;
++yedge4=y_m(end)*ones(nxglobal-2,1);
++yedge5=y_m(2:end-1);
++yedge6=y_m(2)*ones(nxglobal-4,1);
++yedge7=y_m(2:end-1);
++yedge8=y_m(end-1)*ones(nxglobal-4,1);
++
++Xedge=[xedge1;xedge2;xedge3;xedge4;xedge5;xedge6;xedge7;xedge8];
++Yedge=[yedge1;yedge2;yedge3;yedge4;yedge5;yedge6;yedge7;yedge8];
++EdgeValues=DataInterp(x_matrix,y_matrix,datamatrix,Xedge,Yedge);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gamv.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gamv.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gamv.m	(revision 12996)
+@@ -0,0 +1,70 @@
++function output = gamv(x,y,data,varargin);
++%GAMV - use gslib for Kriging
++%
++%   Usage:
++%      output = gamv(x,y,data,varargin)
++
++options=pairoptions(varargin{:});
++
++nlag = getfieldvalue(options,'nlag', 20);
++dlag = getfieldvalue(options,'dlag', 1000);
++
++%Write data file
++fid=fopen('cluster.dat','w');
++fprintf(fid,'%s\n','Data file');
++fprintf(fid,'%i\n',3);
++fprintf(fid,'%s\n','Xlocation');
++fprintf(fid,'%s\n','Ylocation');
++fprintf(fid,'%s\n','Data');
++fprintf(fid,'%g %g %g\n',[x y data]');
++fclose(fid);
++
++%Write parameter file
++fid=fopen('gamv.par','w');
++fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
++fprintf(fid,'\t\t\t\t%s\n','*******************');
++fprintf(fid,'\n');
++fprintf(fid,'%s\n','START OF PARAMETERS:');
++fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
++fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
++fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
++fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
++fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
++fprintf(fid,'%-30s %s\n',num2str(nlag,'%i')           ,'\number of lags');
++fprintf(fid,'%-30s %s\n',num2str(dlag,'%g')           ,'\lag separation distance');
++fprintf(fid,'%-30s %s\n',num2str(dlag/2,'%g')         ,'\lag tolerance');
++fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
++fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
++fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
++fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
++fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
++fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
++fclose(fid);
++
++%Call gamv
++system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
++delete('gamv.par');
++
++%Read output
++output   = struct('Semivariogram',[],'Covariance',[]);
++counter1 = 1;
++counter2 = 1;
++fid=fopen('gamv.out','r');
++while (~feof(fid)),
++	A=fscanf(fid,'%s',1);
++	if strcmp(A,'Covariance');
++		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
++		output(counter1).Covariance=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
++		counter1=counter1+1;
++	elseif strcmp(A,'Semivariogram'),
++		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
++		output(counter2).Semivariogram=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
++		counter2=counter2+1;
++	else
++		%do nothing
++	end
++end
++fclose(fid);
++delete('gamv.out')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/pkriging.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/pkriging.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/pkriging.m	(revision 12996)
+@@ -0,0 +1,55 @@
++function [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
++%PKRIGING - parallel Kriging
++%
++%   Usage:
++%      [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
++
++options=pairoptions(varargin{:});
++cluster=getfieldvalue(options,'cluster',generic('np',10));
++options=removefield(options,'cluster',0);
++name   = ['krig' num2str(feature('GetPid'))];
++
++% =========================================   MARSHALL.m =================================================
++disp(['marshalling file ' name '.bin']);
++fid=fopen([name '.bin'],'wb');
++if fid==-1,
++	error(['marshall error message: could not open ' name '.bin file for binary writing']);
++end
++
++%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
++WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
++
++%Write all data
++WriteData(fid,'enum',0,'data',x,'format','DoubleMat');
++WriteData(fid,'enum',1,'data',y,'format','DoubleMat');
++WriteData(fid,'enum',2,'data',observations,'format','DoubleMat');
++WriteData(fid,'enum',3,'data',x_interp,'format','DoubleMat');
++WriteData(fid,'enum',4,'data',y_interp,'format','DoubleMat');
++options.marshall(fid,5);
++st=fclose(fid);
++if st==-1,
++	error(['marshall error message: could not close file ' name '.bin']);
++end
++% =========================================   MARSHALL.m =================================================
++
++%Launch job on remote cluster
++BuildKrigingQueueScript(cluster,name,'',1,0,0); %gather, valgrind, gprof
++tic
++LaunchQueueJob(cluster,name,name,{[name '.bin'] [name '.queue']});
++toc
++choice=input('Is the job successfully completed? (y/n)','s');
++Download(cluster,name,{[name '.outbin']});
++structure=parseresultsfromdisk([name '.outbin'],0);
++delete([name '.outlog']);
++delete([name '.errlog']);
++delete([name '.outbin']);
++delete([name '.bin']);
++if ~ispc,
++	delete([name '.tar.gz']);
++end
++
++%Process results
++B=structure.AutodiffForward;
++B=reshape(B,size(x_interp,2),size(x_interp,1))';
++E=structure.AutodiffIsautodiff;
++E=reshape(E,size(x_interp,2),size(x_interp,1))';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/MisfitDeinterlace.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/MisfitDeinterlace.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/MisfitDeinterlace.m	(revision 12996)
+@@ -0,0 +1,21 @@
++function Jstruct=MisfitDeinterlace(misfit,type)
++%MISFITDEINTERLACE - deinterlace misfits that are mixed together, using type.
++%
++%   Usage:
++%      Jstruct=MisfitDeinterlace(misfit,type)
++%
++%   Example:
++%      Jstruct=MisfitDeinterlace(md.results.diagnostic.J,md.fit)
++%
++%
++Jstruct=struct();
++
++count=1;
++for i=0:max(type),
++	pos=find(type==i);
++	if length(pos),
++		Jstruct(count).type=i;
++		Jstruct(count).J=misfit(pos);
++		count=count+1;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.fig
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.fig
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.fig	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.fig	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.fig
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/addtrack.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/addtrack.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/addtrack.m	(revision 12996)
+@@ -0,0 +1,156 @@
++function [x_m2 y_m2 values2]=addtrack(x_m1,y_m1,values1,track_coord,track_values,distance,exponent,varargin),
++%ADDTRACK - modify a map to take values of a track
++%
++%   This routine modifies a map to improve it with values of tracks.
++%   This output map has more values than the input one so that the values
++%   of the tracks are relevant.
++%   x_m1 and y_m1 are two vectors containing the coordinates of the matrix
++%   the distance between two points must be the same everywhere
++%   values1 is a matrix of size (y_m1-1)*(x_m1-1)
++%   trac_coord is an exp file containing the coordinates of the tracks (x and y)
++%   trav_values is a vector with the values along the track coordinates
++%   distance indicates the distance from the tracks where points have to be modified
++%   exposant allows to chance the influence of the track and the map
++%   it must be positive and usually is superior to 1.
++%
++%   Usage:
++%      [x_m2 y_m2 values1 values2]=addtrack(x_m1,y_m1,values1,track_coord,track_values,distance,exposant[,subdivision])
++%
++%   Example:
++%      [xnew ynew valuesnew]=addtrack(x_m,y_m,thickness,'trackcoord.exp',thickness_track,1000,2)
++%      [xnew ynew valuesnew]=addtrack(x_m,y_m,thickness,'trackcoord.exp',thickness_track,1000,2,3)
++
++%Create a new picture precise enough to be modified by the tracks
++%Read the points of the tracks
++stru=expread(track_coord,1);
++nods=stru.nods;
++xtracks=stru.x';
++ytracks=stru.y';
++
++%First check that the parameters are ok:
++if (size(track_values,1)~=nods)  || (size(xtracks,2)~=nods) || (size(ytracks,2)~=nods),
++	error('addtrack error message : track coordinates and track values must have the same size');
++elseif distance<0,
++	error('addtrack error message : the distance must be a positive value');
++elseif exponent<0,
++	error('addtrack error message : the exponent must be a positive value');
++elseif (size(x_m1,1)~=(size(values1,2)+1)) || (size(y_m1,1)~=(size(values1,1)+1)),
++	error('addtrack error message : problem in the map, check the size of x_m1, y_m1 and values1');
++end
++
++%stru.nods=4;
++%xtracks=[50 50 55 62]; % 2 3 4 5 6 7 8 9 1 ]';
++%ytracks=[40 40.5 41 41]; % 5 5 5 5 5 5 5 5 8 ]';
++%x_m1=[1:10:101]';
++%y_m1=[1:10:101]';
++%track_values=2*ones(4,1);
++%values1=ones(10,10);
++
++%Find the average distance between two points of the tracks
++av_x=sum(abs(diff(xtracks)))/(stru.nods-1);
++av_y=sum(abs(diff(ytracks)))/(stru.nods-1);
++dist_av=sqrt(av_x^2+av_y^2);
++
++%Calculate the multiplicate factor for the new values:
++if nargin==7,
++	mult=round((x_m1(2)-x_m1(1))/(1*dist_av));
++else
++	mult=varargin{1};
++end
++
++%Plug the values in the new multiplied matrix
++values=zeros(mult*size(values1,1),mult*size(values1,2));
++
++for i=1:mult,
++	for j=1:mult,
++		values(i:mult:end,j:mult:end)=values1;
++	end
++end
++
++%Create the new x and y addapted to the matrix
++x_m2=linspace(x_m1(1),x_m1(end),mult*(size(x_m1,1)-1)+1)';
++y_m2=linspace(y_m1(1),y_m1(end),mult*(size(y_m1,1)-1)+1)';
++
++%Create a new set of x and y correponding to the medium value on the matrix
++x_med=(x_m2(1:end-1)+x_m2(2:end))/2;
++y_med=(y_m2(1:end-1)+y_m2(2:end))/2;
++
++numrow=size(y_med,1);
++numcol=size(x_med,1);
++
++%Create new x and y to have the hole matrix
++x_mat=repmat(x_med',numrow,1);
++y_mat=repmat(y_med,1,numcol);
++
++%Remove useless points of the track
++points=find(track_values==0);
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++points=find(isnan(track_values));
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++
++%Remove points outside of the map
++points=find(xtracks<x_med(1) | xtracks>x_med(end) | ytracks<y_med(1) | ytracks>y_med(end));
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++
++%initialize some matrices
++numoverlap=zeros(numrow,numcol);
++weights=zeros(numrow,numcol);
++weightsvalues=zeros(numrow,numcol);
++
++%Loop over the points of the track
++nel=size(track_values,1);
++fprintf('%s','      track processing progress:   0.00 %');
++for i=1:nel;
++	if mod(i,1000)==0,
++		fprintf('\b\b\b\b\b\b\b')
++		fprintf('%5.2f%s',i/nel*100,' %');
++	end
++
++	x=xtracks(i);
++	y=ytracks(i);
++
++	%get indices that are modified
++	indexx1=max(find(x_med<x-distance));
++	if isempty( indexx1), indexx1=1; end
++	indexx2=min(find(x_med>x+distance));
++	if isempty( indexx2), indexx2=numrow; end
++	indexy1=max(find(y_med<y-distance));
++	if isempty( indexy1), indexy1=1; end
++	indexy2=min(find(y_med>y+distance));
++	if isempty( indexy2), indexy2=numcol; end
++
++
++	%get weighing coefficient
++	val=track_values(i);
++	distances=sqrt((x-x_mat(indexy1:indexy2,indexx1:indexx2)).^2+(y-y_mat(indexy1:indexy2,indexx1:indexx2)).^2);
++	coeff=min(1,(distances/distance)).^(1/exponent);
++
++	%update numoverlap and weights
++	numoverlap(indexy1:indexy2,indexx1:indexx2)=numoverlap(indexy1:indexy2,indexx1:indexx2)+1;
++	weights(indexy1:indexy2,indexx1:indexx2)=weights(indexy1:indexy2,indexx1:indexx2)+coeff;
++	weightsvalues(indexy1:indexy2,indexx1:indexx2)=weightsvalues(indexy1:indexy2,indexx1:indexx2)+(1-coeff)*val;
++
++end
++if nel>1000,
++	fprintf('\b\b\b\b\b\b\b\b')
++	fprintf('%4.2f%s\n',100,' %');
++end
++
++
++%Change the values of numoverlap to 1 if 0 since we are going to devide by this matrix
++numoverlap(find(~numoverlap))=1;
++
++%Same thing for weights since values far from the tracks don't change
++weights(find(~weights))=1;
++
++%Create the final matrix depending on the previous matrix
++values=(values.*weights+weightsvalues)./numoverlap;
++
++%Plug the values of the track in the new matrix
++values2=values;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/TracksToMatrix.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/TracksToMatrix.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/TracksToMatrix.m	(revision 12996)
+@@ -0,0 +1,84 @@
++function [x_f y_f MatData]=TracksToMatrix(xmin,ymin,nx,ny,posting,track_coord,track_values,theta,varargin),
++%TRACKSTOMATRIX - Create a map from tracks
++%
++%   This routine creates a map from tracks using a Kriging algorithm given by the package DACE.
++%   - xmin and ymin are two scalars that are the extreme values of the data matrix one wants to create
++%   - posting is a scalar giving the posting of the matrix to be created in meters
++%   - trac_coord is an Argus file containing the coordinates of the tracks (x and y)
++%   - trav_values is a vector with the values along the track coordinates
++%   - theta is a parameter of the correlation function stricly positive
++%   varagin can contain a matrix of data to constrain the matrix to be created
++%   it shoud contain indices x and y and the matrix
++%
++%   Usage:
++%      [x_ y_f MatData]=TracksToMatrix(xmin,ymin,nx,ny,posting,track_coord,track_values,theta),
++%
++%   Example:
++%      [x_f y_f Thickness]=TracksToMatrix(-10^6,10^6,200,180,1000,'trackcoord.exp',thickness_values,theta),
++%      [x_f y_f Thickness]=TracksToMatrix(-10^6,10^6,200,180,1000,'trackcoord.exp',thickness_values,theta,x_m,y_m,globalthickness),
++%
++%   See also: CREATEDATABOUNDARIES, CREATEDATAMATRIX
++
++%some checks
++if nargin~=8 & nargin~=11,
++	error(' TracksToMatrix error message: wrong number of arguments')
++end
++
++%Add path to dace
++addpath([issmdir() '/externalpackages/dace/install'])
++
++%First create the x_m and y_m fot the matrix
++x_f=[xmin:posting:xmin+posting*nx]';
++y_f=[ymin:posting:ymin+posting*ny]';
++
++%Now create a bigger map we will then truncate
++x_m=[xmin-posting*nx/2:posting:xmin+posting*nx*3/2]';
++y_m=[ymin-posting*ny/2:posting:ymin+posting*ny*3/2]';
++
++%Create DataMatrix with local averaging of tracks
++[Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values);
++
++%Create vector for these coordinates and values
++Svalue=sparse(Mvalue);
++Sx=sparse(Mx);
++Sy=sparse(My);
++[i,j,Values]=find(Svalue);
++[i,j,X]=find(Sx);
++[i,j,Y]=find(Sy);
++Coord=[X,Y];
++
++%Create boundaries for the track if specified
++if nargin==11,
++	disp('      constain the border of matrix with global matrix');
++	%Find out the elements to counstrain the border
++	x_matrix=varargin{1};
++	y_matrix=varargin{2};
++	datamatrix=varargin{3};
++
++	%Create values on the border of the smaller map
++	[Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
++
++	%Create values on the border of the larger map
++	[Xedge2,Yedge2,EdgeValues2]=CreateDataBoundaries(x_f,y_f,x_matrix,y_matrix,datamatrix);
++
++	%Add these values to the track values
++	Values=[Values;EdgeValues;EdgeValues2];
++	Coord=[X,Y;Xedge,Yedge;Xedge2,Yedge2];
++end
++
++%Create model for data
++disp('      create the statiscal model of the data');
++[dmodel,perf]=dacefit(Coord,Values,@regpoly1,@corrgauss,theta);
++
++%Create design site(points where we are looking for the data)
++Points=nodesamp([x_f(1)+posting/2,y_f(1)+posting/2;x_f(end)-posting/2,y_f(end)-posting/2],[length(x_f)-1;length(y_f)-1]);
++
++%Compute data on these points
++disp('      predict the values');
++VecData=predictor(Points,dmodel);
++
++%Reshape to get a matrix
++MatData=reshape(VecData,ny,nx);
++
++%remove DACE path
++rmpath([issmdir() '/externalpackages/dace/install']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gslib.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gslib.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gslib.m	(revision 12996)
+@@ -0,0 +1,112 @@
++function output = gslib(x,y,data,varargin);
++%GSLIB - use gslib for Kriging
++%
++%   Usage:
++%      output = gslib(x,y,data,varargin)
++
++%Output Matrix
++xmin   = xl(1);
++ymin   = yl(1);
++nx     = 101;
++ny     = 101;
++deltax = 5000;
++deltay = 5000;
++
++%Variogram
++nugget=10;
++sill  =164;
++range =25763;
++
++%Kriging options
++mindata = 1;
++maxdata = 50;
++maxsearchradius = 50000;
++
++%Some intermediaries (Convert to gslib's parameters);
++c = (sill-nugget);
++a = sqrt(3)*range;
++
++%Write data file
++fid=fopen('cluster.dat','w');
++fprintf(fid,'%s\n','Data file');
++fprintf(fid,'%i\n',3);
++fprintf(fid,'%s\n','Xlocation');
++fprintf(fid,'%s\n','Ylocation');
++fprintf(fid,'%s\n','Data');
++fprintf(fid,'%g %g %g\n',[x y data]');
++fclose(fid);
++
++if 0, %GAMV
++	%Write parameter file
++	fid=fopen('gamv.par','w');
++	fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
++	fprintf(fid,'\t\t\t\t%s\n','*******************');
++	fprintf(fid,'\n');
++	fprintf(fid,'%s\n','START OF PARAMETERS:');
++	fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
++	fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
++	fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
++	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
++	fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
++	fprintf(fid,'%-30s %s\n','20'                         ,'\number of lags');
++	fprintf(fid,'%-30s %s\n','5.0'                        ,'\lag separation distance');
++	fprintf(fid,'%-30s %s\n','3.0'                        ,'\lag tolerance');
++	fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
++	fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
++	fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++	fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++	fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
++	fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
++	fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
++	fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
++	fclose(fid);
++
++	%Call gamv
++	system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
++
++else, %Kriging KB2D
++	%Write parameter file
++	fid=fopen('kb2d.par','w');
++	fprintf(fid,'\t\t\t\t%s\n','Parameters for KB2D');
++	fprintf(fid,'\t\t\t\t%s\n','*******************');
++	fprintf(fid,'\n');
++	fprintf(fid,'%s\n','START OF PARAMETERS:');
++	fprintf(fid,'%-30s %s\n','./cluster.dat'                  ,'\file with data');
++	fprintf(fid,'%-30s %s\n','1 2 3'                          ,'\columns for X, Y and variable');
++	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'                 ,'\trimming limits');
++	fprintf(fid,'%-30s %s\n','0'                              ,'\debugging level: 0,1,2,3');
++	fprintf(fid,'%-30s %s\n','kb2d.dbg'                       ,'\file for debuggging output');
++	fprintf(fid,'%-30s %s\n','kb2d.out'                       ,'\file for kriged output');
++	fprintf(fid,'%-30s %s\n',num2str([nx xmin deltax],'%i %10g %6g')  ,'\nx, xmn, xsiz');
++	fprintf(fid,'%-30s %s\n',num2str([ny ymin deltay],'%i %10g %6g')  ,'\nx, xmn, xsiz');
++	fprintf(fid,'%-30s %s\n','1 1'                            ,'\x and y block discretization');
++	fprintf(fid,'%-30s %s\n',num2str([mindata maxdata],'%6g') ,'\min and max data for kriging');
++	fprintf(fid,'%-30s %s\n',num2str(maxsearchradius,'%6g')   ,'\max search radius');
++	fprintf(fid,'%-30s %s\n','1 2.302'                        ,'\0=SK, 1=OK, (mean if SK)');
++	fprintf(fid,'%-30s %s\n',['1 ' num2str(nugget)]           ,'\nst, nugget effect');
++	fprintf(fid,'%-30s %s\n',['3 ' num2str([c 0.0 a a],'%10g')],'\it, c, azm, a_max, a_min');
++	fclose(fid);
++
++	tic;system([issmdir() '/externalpackages/gslib/install/kb2d kb2d.par']);toc;
++	delete('kb2d.par');
++
++	%Read output
++	fid=fopen('kb2d.out','r');
++	while (~feof(fid)),
++		A=fscanf(fid,'%s',1);
++		if strcmp(A,'KB2D');
++			A=fscanf(fid,'%s',1); %Read output
++			params=fscanf(fid,'%i %i %i %i %g %g %g %g %g %g %1',[11 1]);
++		elseif strcmp(A,' Estimate'),
++			continue;
++		elseif strcmp(A,'Estimation'),
++			A=fscanf(fid,'%s',1); %Read Variance
++			A=fscanf(fid,'%g %g',[params(1) params(2)*params(3)]);
++			B=A(1,:); B=reshape(B,[params(3),params(2)])';
++			E=A(2,:); E=reshape(E,[params(3),params(2)])';
++		else
++			%do nothing
++		end
++	end
++	fclose(fid);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataMatrix.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataMatrix.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataMatrix.m	(revision 12996)
+@@ -0,0 +1,94 @@
++function [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values),
++%CREATEDATAMATRIX - Create a map with average values of map 
++%
++%   This routine creates a map with average values of tracks.
++%   x_m1 and y_m1 are two vectors containing the coordinates of the matrix
++%   trac_coord is an exp file containing the coordinates of the tracks (x and y)
++%   trav_values is a vector with the values along the track coordinates
++%
++%   Usage:
++%      [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values),
++%
++%   Example:
++%      [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,'trackcoord.exp',thickness_track)
++%
++%   See also: CREATEDATABOUNDARIES, TRACKSTOMATRIX
++
++%Read the points of the tracks
++stru=expread(track_coord,1);
++nods=stru.nods;
++xtracks=stru.x';
++ytracks=stru.y';
++
++%First check that the parameters are ok:
++if (size(track_values,1)~=nods)  || (size(xtracks,2)~=nods) || (size(ytracks,2)~=nods),
++	error('CreateDataMatrix error message : track coordinates and track values must have the same size');
++end
++
++%Compute number of rows and columns
++numrow=size(y_m,1)-1;
++numcol=size(x_m,1)-1;
++
++%Remove useless points of the track
++points=find(track_values==0);
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++points=find(isnan(track_values));
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++points=find(track_values<0);
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++
++points=find(xtracks<x_m(1) | xtracks>x_m(end) | ytracks<y_m(1) | ytracks>y_m(end));
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++
++%initialize some matrices
++numpoints=zeros(numrow,numcol);
++value=zeros(numrow,numcol);
++coordx=zeros(numrow,numcol);
++coordy=zeros(numrow,numcol);
++
++%Loop over the points of the track
++nel=size(track_values,1);
++fprintf('%s','      track processing progress:   0.00 %');
++for i=1:nel;
++	if mod(i,1000)==0,
++		fprintf('\b\b\b\b\b\b\b')
++		fprintf('%5.2f%s',i/nel*100,' %');
++	end
++
++	x=xtracks(i);
++	y=ytracks(i);
++
++	%get indices for the matrix
++	indexx=max(find(x_m<x));
++	indexy=max(find(y_m<y));
++
++	%get weighing coefficient
++	val=track_values(i);
++
++	%update numoverlap and weights
++	numpoints(indexy,indexx)=numpoints(indexy,indexx)+1;
++	value(indexy,indexx)=value(indexy,indexx)+val;
++	coordx(indexy,indexx)=coordx(indexy,indexx)+x;
++	coordy(indexy,indexx)=coordy(indexy,indexx)+y;
++
++end
++if nel>1000,
++	fprintf('\b\b\b\b\b\b\b\b')
++	fprintf('%4.2f%s\n',100,' %');
++end
++
++%Change the values of numoverlap to 1 if 0 since we are going to devide by this matrix
++numpoints(find(~numpoints))=1;
++
++%Create the center of mass for coordiantes and values.
++Mvalue=value./numpoints;
++Mx=coordx./numpoints;
++My=coordy./numpoints;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.m	(revision 12996)
+@@ -0,0 +1,467 @@
++function varargout = data_processing_tool(varargin)
++%DATA_PROCESSING_TOOL - GUI to process binary data
++%
++%   this routine is a GUI that helps the user to open
++%   a binary file (Little Endian, Big Endian, Float 32,
++%   double,...) and save a Matlab file (.mat) with the
++%   processed data and the coordinates
++%
++%   Usage:
++%      data_processing_tool
++
++	gui_Singleton = 1;
++	gui_State = struct('gui_Name',       mfilename, ...
++		'gui_Singleton',  gui_Singleton, ...
++		'gui_OpeningFcn', @data_processing_tool_OpeningFcn, ...
++		'gui_OutputFcn',  @data_processing_tool_OutputFcn, ...
++		'gui_LayoutFcn',  [] , ...
++		'gui_Callback',   []);
++	if nargin && ischar(varargin{1})
++		gui_State.gui_Callback = str2func(varargin{1});
++	end
++
++	if nargout
++		[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
++	else
++		gui_mainfcn(gui_State, varargin{:});
++	end
++end
++
++function data_processing_tool_OpeningFcn(hObject, eventdata, handles, varargin)
++	handles.output = hObject;
++
++	%enable toolbar (useful for caxis...)
++	set(hObject,'toolbar','figure');
++
++	% Update handles structure
++	guidata(hObject, handles);
++
++	%this variable used to prevent users from breaking the GUI
++	%the variable is set to 1 once the data has been processed
++	handles.processDataCompleted=0;
++
++	%initialize other variables
++	handles.Msize=NaN;
++	handles.Nsize=NaN;
++	handles.numvectors=NaN;
++	handles.endian=NaN;
++	handles.datatype=NaN;
++	handles.dx=NaN;
++	handles.dy=NaN;
++	handles.xEast=NaN;
++	handles.yNorth=NaN;
++
++	%two files permitted
++	set(handles.inputFile,'Max',1);
++	set(handles.inputFile,'Min',0);
++
++	% Update handles structure
++	guidata(hObject, handles);
++end
++
++% --- Outputs from this function are returned to the command line.
++function varargout = data_processing_tool_OutputFcn(hObject, eventdata, handles) 
++
++	% Get default command line output from handles structure
++	varargout{1} = handles.output;
++end
++
++
++function inputFile_Callback(hObject, eventdata, handles)
++%no code needed for this callback, the listbox is only used as a visual
++end
++
++function addFiles_pushbutton_Callback(hObject, eventdata, handles)
++	%gets input file(s) from user. the sample data files have extension .s2p
++	[input_file,pathname] = uigetfile( ...
++		{'*.*', 'All Files (*.*)'}, ...
++		'Select files', ... 
++		'MultiSelect', 'on');
++
++	%if file selection is cancelled, pathname should be zero
++	%and nothing should happen
++	if pathname==0
++		return
++	end
++
++	handles.processDataCompleted=1;
++
++	%gets the current data file names inside the listbox
++	inputFileName=get(handles.inputFile,'String');
++
++	%if they only select one file, then the data will not be a cell
++	inputFileName= fullfile(pathname,input_file);
++
++	%updates the gui to display all filenames in the listbox
++	set(handles.inputFile,'String',inputFileName);
++
++	%make sure first file is always selected so it doesn't go out of range
++	%the GUI will break if this value is out of range
++	set(handles.inputFile,'Value',1);
++
++	% Update handles structure
++	guidata(hObject, handles);
++end
++
++function reset_pushbutton_Callback(hObject, eventdata, handles)
++	%resets the GUI by clearing all relevant fields
++
++	handles.processDataCompleted = 0;
++
++	%clears the axes
++	cla(handles.axes1,'reset');
++
++	%set the popupmenu to default value
++%	set(handles.plot_popupmenu,'Value',1);
++
++	%clears the contents of the listbox
++	set(handles.inputFile,'String','');
++	set(handles.inputFile,'Value',0);
++
++	%updates the handles structure
++	guidata(hObject, handles);
++end
++
++function plotdata_pushbutton_Callback(hObject, eventdata, handles)
++
++	%get the list of input file names from the listbox
++	inputFileName=get(handles.inputFile,'String');
++
++	%checks to see if the user selected any input files
++	%if not, nothing happens
++	if isempty(inputFileName)
++		errordlg('Select a file first!')
++		return
++	end
++
++	%disables the button while data is processing
++	disableButtons(handles);
++	refresh(data_processing_tool); 
++
++	%parse options
++	if ~isnan(handles.Msize)
++		M=handles.Msize;
++	else
++		errordlg('Number of lines (M) not valid')
++		return
++	end
++	if ~isnan(handles.Nsize)
++		N=handles.Nsize;
++	else
++		errordlg('Number of rows (N) not valid')
++		return
++	end
++	if ~isnan(handles.numvectors)
++		numvectors=handles.numvectors;
++		%change M
++		M=numvectors*M;
++	else
++		numvectors=1;
++	end
++	if ~isnan(handles.endian)
++		endian=handles.endian;
++	else
++		endian=1;
++	end
++	if ~isnan(handles.datatype)
++		datatype=handles.datatype;
++	else
++		datatype='float32';
++	end
++
++	%open file
++	if endian==1
++		fid=fopen(inputFileName,'r','ieee-be');
++	else
++		fid=fopen(inputFileName,'r','ieee-le');
++	end
++
++	%read file
++	[u, numpoints]=fread(fid, [M,N],datatype);
++
++	%close file
++	fclose(fid);
++
++	%Pair of vectors?
++	if numvectors==2,
++	   vx=u(1:2:M,:);vx=flipud(vx');
++	   vy=u(2:2:M,:);vx=flipud(vx');
++
++		%keep track
++		handles.vx=vx;
++		handles.vy=vy;
++
++		u=sqrt(vx.^2+vy.^2);
++	end
++
++	cla(handles.axes1); %clear the axes
++	axes(handles.axes1); %set the axes to plot
++	grid on
++	imagesc(u)
++	colorbar
++
++	%keep track
++	handles.u=u;
++
++	%to see whether the data has been processed or not
++	handles.processDataCompleted=2;
++
++	%data is done processing, so re-enable the buttons
++	enableButtons(handles);
++	guidata(hObject, handles);
++end
++
++function plotcoord_Callback(hObject, eventdata, handles)
++
++	%check
++	if handles.processDataCompleted<2
++		errordlg('Process data first !')
++		return
++	end
++
++	%parse options
++	if ~isnan(handles.dx)
++		dx=handles.dx;
++	else
++		errordlg('value of x-spacing not supported')
++		return
++	end
++	if ~isnan(handles.dy)
++		dy=handles.dy;
++	else
++		errordlg('value of y-spacing not supported')
++		return
++	end
++	if ~isnan(handles.xEast)
++		xEast=handles.xEast;
++	else
++		errordlg('value of xEast not supported')
++		return
++	end
++	if ~isnan(handles.yNorth)
++		yNorth=handles.yNorth;
++	else
++		errordlg('value of yNorth not supported')
++		return
++	end
++
++	disableButtons(handles);
++
++	%process coordinates
++	u=handles.u;
++	s=size(u);
++	M=s(1)+1;
++	N=s(2)+1;
++
++	%correction North and East -> real
++	yNorth=yNorth-M*dy; % corner north
++	x_m=xEast+dx*(0:N-1)';
++	y_m=yNorth+dy*(0:M-1)';
++
++	%plot new axes
++	cla(handles.axes1); %clear the axes
++	axes(handles.axes1); %set the axes to plot
++	grid on
++	imagesc(x_m,y_m,handles.u)
++	set(handles.axes1,'Ydir','Normal');
++	colorbar
++
++	%Keep track of x_m and y_m
++	handles.x_m=x_m;
++	handles.y_m=y_m;
++
++	%to see whether the data has been processed or not
++	handles.processDataCompleted=3;
++
++	%data is done processing, so re-enable the buttons
++	enableButtons(handles);
++	guidata(hObject, handles);
++
++end
++
++
++function save_pushbutton_Callback(hObject, eventdata, handles)
++	%if the data hasn't been processed yet, 
++	%nothing happens when this button is pressed
++	if (handles.processDataCompleted ~= 3)
++		return
++	end
++
++	disableButtons(handles);
++
++	if handles.numvectors==2,
++
++		prompt={'Enter the name of the variable 1:','Enter the name of the variable 2:','Enter the name of the file:'};
++		name='Save Matlab File';
++		numlines=1;
++		defaultanswer={'vx','vy','ProcessedFile'};
++		answer=inputdlg(prompt,name,numlines,defaultanswer);
++		variablename1=answer{1};
++		variablename2=answer{2};
++		filename=answer{3};
++
++		if ~isempty(variablename1) & ~isempty(variablename2) & ~isempty(filename)
++			%get the variables
++			x_m=handles.x_m;
++			y_m=handles.y_m;
++			eval([variablename1 ' = handles.vx;']);
++			eval([variablename2 ' = handles.vy;']);
++			x_m=handles.x_m;
++			eval(['save ' filename ' x_m y_m ' variablename1 ' ' variablename2 ]);
++			disp(['in the file ' filename ' have been saved the following variables: x_m, y_m, ' variablename1 ' and ' variablename2])
++		end
++	else
++		prompt={'Enter the name of the variable:','Enter the name of the file:'};
++		name='Save Matlab File';
++		numlines=1;
++		defaultanswer={'thickness','ProcessedFile'};
++		answer=inputdlg(prompt,name,numlines,defaultanswer);
++		variablename=answer{1};
++		filename=answer{2};
++
++		if ~isempty(variablename) & ~isempty(filename)
++			%get the variables
++			x_m=handles.x_m;
++			y_m=handles.y_m;
++			eval([variablename ' = handles.u;']);
++			eval(['save ' filename ' x_m y_m ' variablename]);
++			disp(['in the file ' filename ' have been saved the following variables: x_m, y_m, and ' variablename])
++		end
++	end
++	enableButtons(handles);
++	guidata(hObject, handles);
++end
++
++function inputFile_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function disableButtons(handles)
++	set(handles.figure1,'Pointer','watch');
++	set(handles.plotdata_pushbutton,'Enable','off');
++	set(handles.plotcoord,'Enable','off');
++	set(handles.save_pushbutton,'Enable','off');
++	set(handles.addFiles_pushbutton,'Enable','off');
++	set(handles.reset_pushbutton,'Enable','off');
++end
++
++function enableButtons(handles)
++	set(handles.figure1,'Pointer','arrow');
++	set(handles.plotdata_pushbutton,'Enable','on');
++	set(handles.plotcoord,'Enable','on');
++	set(handles.save_pushbutton,'Enable','on');
++	set(handles.addFiles_pushbutton,'Enable','on');
++	set(handles.reset_pushbutton,'Enable','on');
++end
++
++function EndianType_Callback(hObject, eventdata, handles)
++	handles.endian=get(handles.EndianType,'Value');
++	guidata(hObject, handles);
++end
++
++function EndianType_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function DataType_Callback(hObject, eventdata, handles)
++
++	datatype= get(handles.DataType,'Value');
++	switch datatype
++		case 1
++			string='float32';
++
++		case 2
++			string='single';
++
++		case 3
++			string='float64';
++
++		case 4
++			string='double';
++		end
++	handles.datatype=string;
++	guidata(hObject, handles);
++end
++
++function DataType_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function PairOfVectors_Callback(hObject, eventdata, handles)
++	handles.numvectors = get(handles.PairOfVectors,'Value');
++	guidata(hObject, handles);
++end
++
++function PairOfVectors_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function Msize_Callback(hObject, eventdata, handles)
++	handles.Msize=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++
++function Msize_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function Nsize_Callback(hObject, eventdata, handles)
++	handles.Nsize=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++
++function Nsize_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function dx_Callback(hObject, eventdata, handles)
++	handles.dx=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++function dx_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function dy_Callback(hObject, eventdata, handles)
++	handles.dy=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++function dy_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function xEast_Callback(hObject, eventdata, handles)
++	handles.xEast=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++function xEast_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function yNorth_Callback(hObject, eventdata, handles)
++	handles.yNorth=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++function yNorth_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddeblank.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddeblank.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddeblank.m	(revision 12996)
+@@ -0,0 +1,29 @@
++function sout = ddeblank(s)
++%DDEBLANK Double deblank. Strip both leading and trailing blanks.
++%
++%   DDEBLANK(S) removes leading and trailing blanks and null characters from
++%   the string S.  A null character is one that has a value of 0.
++%
++%   See also DEBLANK, DEWHITE, DDEWHITE.
++
++%   Author:      Peter J. Acklam
++%   Time-stamp:  2003-10-13 11:13:07 +0200
++%   E-mail:      pjacklam@online.no
++%   URL:         http://home.online.no/~pjacklam
++
++   error(nargchk(1, 1, nargin));
++   if ~ischar(s)
++      warning('Input must be a string (char array).');
++   end
++
++   if isempty(s)
++      sout = s;
++      return;
++   end
++
++   [r, c] = find( (s ~= ' ') & (s ~= 0) );
++   if size(s, 1) == 1
++      sout = s(min(c) : max(c));
++   else
++      sout = s(:, min(c) : max(c));
++   end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddeblank.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit.m	(revision 12996)
+@@ -0,0 +1,91 @@
++function splittedstring = strsplit(inpstr,delimiter)
++%STRSPLIT - split a tring of delimiter separated values
++%
++%   This function should be used to split a string of delimiter separated
++%   values.  If all values are numerical values the returned matrix is a
++%   double array but if there is one non numerical value a cell array is
++%   returned.  You can check this with the iscell() function.
++%   inpstr: string containing delimiter separatede numerical values, eg
++%           3498,48869,23908,34.67
++%   Output: An x by 1 matrix containing the splitted values
++%   Delimiter: optional, if omitted the delimiter is , (comma)
++%
++%   Usage:
++%      output = strsplit(inpstr[,delimiter])
++%
++
++%   mailto:    gie.spaepen@ua.ac.be
++
++
++
++%Check input arguments
++if(nargin < 1)
++    error('There is no argument defined');
++else
++    if(nargin == 1)
++        strdelim = ',';
++        %Verbose off!! disp 'Delimiter set to ,';
++    else
++        strdelim = delimiter;
++    end
++end
++
++%deblank string
++deblank(inpstr);
++
++%Get number of substrings
++idx  = findstr(inpstr,strdelim);
++if size(idx) == 0
++    disp 'No delimiter in string, inputString is returned';
++    splittedstring = inpstr;
++else
++    %Define size of the indices
++    sz = size(idx,2);
++    %Define splittedstring
++    tempsplit = {};
++    %Loop through string and itinerate from delimiter to delimiter
++    for i = 1:sz
++        %Define standard start and stop positions for the start position,
++        %choose 1 as startup position because otherwise you get an array
++        %overflow, for the endposition you can detemine it from the
++        %delimiter position
++        strtpos = 1;
++        endpos = idx(i)-1;
++        %If i is not the beginning of the string get it from the delimiter
++        %position
++        if i ~= 1
++            strtpos = idx(i-1)+1;
++        end
++        %If i is equal to the number of delimiters get the last element
++        %first by determining the lengt of the string and then replace the
++        %endpos back to a standard position
++        if i == sz
++            endpos = size(inpstr,2); 
++            tempsplit(i+1) = {inpstr(idx(i)+1 : endpos)};
++            endpos = idx(i)-1;
++        end
++        %Add substring to output: splittedstring a cell array
++        tempsplit(i) = {inpstr(strtpos : endpos)};   
++    end
++    %Flag 
++    isallnums = 1;
++    %Check is there are NaN values if matrix elements are converted to
++    %doubles
++    for i = 1:size(tempsplit,2)
++        tempdouble = str2double(tempsplit(i));
++        if(isnan(tempdouble))
++            isallnums = 0;
++        end
++    end
++    %If isallnums = 1 then return a double array otherwise return a cell
++    %array
++    if(isallnums == 1)
++        for i = 1:size(tempsplit,2)
++            splittedstring(i) = str2double(tempsplit(i));
++        end
++    else
++        splittedstring = tempsplit;
++    end
++    
++        
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/dewhite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/dewhite.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/dewhite.m	(revision 12996)
+@@ -0,0 +1,30 @@
++function sout = dewhite(s)
++%DEWHITE Dewhite. Strip trailing whitespace.
++%
++%   DEWHITE(S) removes leading and trailing white space and any null characters
++%   from the string S.  A null character is one that has an absolute value of
++%   0.
++%
++%   See also DDEWHITE, DEBLANK, DDEBLANK.
++
++%   Author:      Peter J. Acklam
++%   Time-stamp:  2003-10-13 11:12:52 +0200
++%   E-mail:      pjacklam@online.no
++%   URL:         http://home.online.no/~pjacklam
++
++   error(nargchk(1, 1, nargin));
++   if ~ischar(s)
++      error( 'Input must be a string (char array).' );
++   end
++
++   if isempty(s)
++      sout = s;
++      return;
++   end
++
++   [r, c] = find(~isspace(s));
++   if size(s, 1) == 1
++      sout = s(1:max(c));
++   else
++      sout = s(:,1:max(c));
++   end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/dewhite.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/discardnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/discardnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/discardnum.m	(revision 12996)
+@@ -0,0 +1,14 @@
++function string2=discardnum(string)
++%DISCARDNUM -  ??????
++%
++%   Usage:
++%      string2=discardnum(string)
++
++string2=string;
++
++for i=1:length(string),
++	if (((string(i)-0) <=57) & ((string(i)-0) >=48)),
++		string2=string(1:i-1);
++		break;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ismemberi.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ismemberi.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ismemberi.m	(revision 12996)
+@@ -0,0 +1,26 @@
++function flag=ismemberi(string,list),
++%ISMEMBERI - return 1 if a string belongs to a list (case insensitive)
++%
++%   same function as Matlab's ismember except that it
++%   is case insensitive
++%
++%   Usage:
++%      flag=ismemberi(string,list);
++%
++%   Example:
++%      flag=ismemberi('test','{'test1','test2','test3'});
++
++if ~iscell(list)
++	error('ismemberi error message: the list of string must be a cell!')
++end
++
++%initialize output
++flag=0;
++
++%go through the list
++for i=1:length(list),
++	if strcmpi(string,list{i}),
++		flag=i;
++		return
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit_strict.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit_strict.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit_strict.m	(revision 12996)
+@@ -0,0 +1,37 @@
++function splittedstring = strsplit(inpstr,delimiter)
++%STRSPLIT - split a tring of delimiter separated values
++%
++%   Usage:
++%      output = strsplit_strict(inpstr,delimiter)
++
++
++%Check input arguments
++if(nargin ~= 2)
++    error('There is no argument defined');
++end
++
++%deblank string
++deblank(inpstr);
++
++%Get number of substrings
++idx  = findstr(inpstr,delimiter);
++if size(idx) == 0
++    splittedstring = {inpstr};
++else
++    sz = size(idx,2);
++    splittedstring = {};
++    %Loop through string and itinerate from delimiter to delimiter
++    for i = 1:sz
++        strtpos = 1;
++        endpos = idx(i)-1;
++        if i ~= 1
++            strtpos = idx(i-1)+1;
++        end
++        if i == sz
++            endpos = size(inpstr,2); 
++            splittedstring(i+1) = {inpstr(idx(i)+1 : endpos)};
++            endpos = idx(i)-1;
++        end
++        splittedstring(i) = {inpstr(strtpos : endpos)};   
++    end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddewhite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddewhite.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddewhite.m	(revision 12996)
+@@ -0,0 +1,30 @@
++function sout = ddewhite(s)
++%DDEWHITE Double dewhite. Strip both leading and trailing whitespace.
++%
++%   DDEWHITE(S) removes leading and trailing white space and any null
++%   characters from the string S.  A null character is one that has an absolute
++%   value of 0.
++%
++%   See also DEWHITE, DEBLANK, DDEBLANK.
++
++%   Author:      Peter J. Acklam
++%   Time-stamp:  2003-10-13 11:12:57 +0200
++%   E-mail:      pjacklam@online.no
++%   URL:         http://home.online.no/~pjacklam
++
++   error(nargchk(1, 1, nargin));
++   if ~ischar(s)
++      error('Input must be a string (char array).');
++   end
++
++   if isempty(s)
++      sout = s;
++      return;
++   end
++
++   [r, c] = find(~isspace(s));
++   if size(s, 1) == 1
++      sout = s(min(c) : max(c));
++   else
++      sout = s(:, min(c) : max(c));
++   end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddewhite.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/issmprintf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/issmprintf.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/issmprintf.m	(revision 12996)
+@@ -0,0 +1,13 @@
++function issmprintf(flag,format,varargin)
++%ISSMPRINTF -  display string in solution sequences. wrapper to disp and sprintf.  
++%
++%   Usage:
++%      issmprintf(flag,format,string)
++%      flag can be used to switch display on and off
++%
++%   Example:
++%      issmprintf(1,'%s\n','string to display');
++	
++if flag,
++	disp(sprintf(format,varargin{:}));
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/logoutput.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/logoutput.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/logoutput.m	(revision 12996)
+@@ -0,0 +1,7 @@
++function logoutput(logstring,message)
++%LOGOUTPUT - embed a log string into an error message, used in the nightly runs.
++%
++%   Usage:
++%      logoutput(logstring,message)
++
++disp(sprintf('%s%s',logstring,message));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.py	(revision 12996)
+@@ -0,0 +1,24 @@
++import platform
++import os
++from MatlabFuncs import *
++
++def issmdir():
++	"""
++	ISSMDIR - Get ISSM_DIR environment variable
++ 
++	   Usage:
++	      ISSM_DIR=issmdir()
++	"""
++
++	if not 'Windows' in platform.system():
++		ISSM_DIR =os.environ['ISSM_DIR']
++	else:
++		ISSM_DIR =os.environ['ISSM_DIR_WIN']
++		if strcmpi(ISSM_DIR[-1],'/') or strcmpi(ISSM_DIR[-1],'\\'):
++			ISSM_DIR = ISSM_DIR[:-1]    #shave off the last '/'
++
++	if not ISSM_DIR:
++		raise RuntimeError("issmdir error message: 'ISSM_DIR' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!")
++
++	return ISSM_DIR
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/flaimdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/flaimdir.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/flaimdir.m	(revision 12996)
+@@ -0,0 +1,7 @@
++function FLAIM_DIR=flaimdir()
++%ISSMDIR - Get FLAIM installation directory
++%
++%   Usage:
++%      FLAIM_DIR=flaimdir()
++
++FLAIM_DIR=[issmdir '/externalpackages/flaim/install'];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/ucisvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/ucisvn.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/ucisvn.m	(revision 12996)
+@@ -0,0 +1,15 @@
++function UCI_SVN=ucisvn()
++%ISSMDIR - Get UCI_SVN environment variable
++%
++%   Usage:
++%      UCI_SVN=ucisvn()
++
++if ~ispc,
++	UCI_SVN =getenv('UCI_SVN');
++else
++	UCI_SVN =getenv('UCI_SVN_WIN');
++end
++
++if (isempty(UCI_SVN)),
++	error('ucisvn error message: ''UCI_SVN'' environment variable is empty! You should define UCI_SVN in your .cshrc or .bashrc');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.m	(revision 12996)
+@@ -0,0 +1,18 @@
++function ISSM_DIR=issmdir()
++%ISSMDIR - Get ISSM_DIR environment variable
++%
++%   Usage:
++%      ISSM_DIR=issmdir()
++
++if ~ispc,
++	ISSM_DIR =getenv('ISSM_DIR');
++else
++	ISSM_DIR =getenv('ISSM_DIR_WIN');
++	if strcmpi(ISSM_DIR(end),'/') | strcmpi(ISSM_DIR(end),'\'),
++		ISSM_DIR = ISSM_DIR(1:end-1); %shave off the last '/'
++	end
++end
++
++if (isempty(ISSM_DIR)),
++	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/jplsvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/jplsvn.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/jplsvn.m	(revision 12996)
+@@ -0,0 +1,15 @@
++function JPL_SVN=jplsvn()
++%ISSMDIR - Get JPL_SVN environment variable
++%
++%   Usage:
++%      JPL_SVN=jplsvn()
++
++if ~ispc,
++	JPL_SVN =getenv('JPL_SVN');
++else
++	JPL_SVN =getenv('JPL_SVN_WIN');
++end
++
++if (isempty(JPL_SVN)),
++	error('jplsvn error message: ''JPL_SVN'' environment variable is empty! You should define JPL_SVN in your .cshrc or .bashrc');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_class.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_class.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_class.m	(revision 12996)
+@@ -0,0 +1,30 @@
++%
++%  function to find the structural fields of a specified class
++%  
++%  [sclasso]=struc_class(sclass,cstr)
++%
++function [sclasso]=struc_class(sclass,cstr)
++
++%  collect only the objects of the appropriate class
++
++if     isa(sclass,cstr)
++    if ~isempty(inputname(1))
++        sclasso.(inputname(1))=sclass;
++    else
++        sclasso.(cstr)        =sclass;
++    end
++
++elseif isstruct(sclass)
++    fnames=fieldnames(sclass);
++    for i=1:numel(fnames)
++        if isa(sclass.(fnames{i}),cstr)
++            sclasso.(fnames{i})=sclass.(fnames{i});
++        end
++    end
++end
++
++if ~exist('sclasso','var')
++    sclasso=struct([]);
++end
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allempty.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allempty.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allempty.m	(revision 12996)
+@@ -0,0 +1,22 @@
++%
++%  function to return an empty cell array if all array elements are empty
++%
++%  function [cout]=allempty(cin)
++%
++function [cout]=allempty(cin)
++
++if ~nargin
++    help allempty
++    return
++end
++
++for j=1:numel(cin)
++    if ~isempty(cin{j})
++        cout=cin;
++        return
++    end
++end
++cout={};
++
++end
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allempty.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_desc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_desc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_desc.m	(revision 12996)
+@@ -0,0 +1,61 @@
++%
++%  function to find the structures with the specified descriptors
++%  
++%  [sarrayo]=struc_desc(sarray,varargin)
++%
++function [sarrayo]=struc_desc(sarray,varargin)
++
++if ~isfield(sarray,'descriptor')
++    if ~isempty(inputname(1))
++        error('Field ''descriptor'' not found in array ''%s''.',inputname(1));
++    else
++        error('Field ''descriptor'' not found in array %d.',1);
++    end
++end
++
++sarrayo=struct([]);
++
++for iarg=1:nargin-1
++    if     iscell(varargin{iarg})
++        desc=        varargin{iarg};
++    elseif ischar(varargin{iarg})
++        desc=cellstr(varargin{iarg});
++    end
++    
++    for i=1:length(desc)
++        sarrayoi=struc_desci(sarray,desc{i});
++        if ~isempty(sarrayoi)
++            if isempty(sarrayo)
++                sarrayo       =sarrayoi;
++            else
++                sarrayo(end+1)=sarrayoi;
++            end
++        end
++    end
++end
++
++%  if nothing found, return whole array
++
++if isempty(sarrayo)
++    sarrayo=sarray;
++end
++
++end
++
++%
++%  function to find the structure with the specified descriptor
++%  
++function [sarrayo]=struc_desci(sarray,str)
++
++sarrayo=struct([]);
++
++for i=1:numel(sarray)
++    if strcmp(sarray(i).descriptor,str)
++        sarrayo=sarray(i);
++        return
++    end
++end
++
++warning(['String ''' str ''' not found in array ''' inputname(1) '''.']);
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_dim.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_dim.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_dim.m	(revision 12996)
+@@ -0,0 +1,72 @@
++%
++%  function to return the string dimension of an array element
++%
++%  function [sdim]=string_dim(a,idim,varargin)
++%
++function [sdim]=string_dim(a,idim,varargin)
++
++if ~nargin
++    help string_dim
++    return
++end
++
++%  check for scalar
++
++if (numel(a) == 1) && (idim == 1)
++    sdim='';
++    return
++end
++
++%  check for overflow
++
++if (idim > numel(a))
++    if ~isempty(inputname(1))
++        error('Index %d exceeds number of elements in array ''%s''.',...
++            idim,inputname(1));
++    else
++        error('Index %d exceeds number of elements in array %d.',...
++            idim,1);
++    end
++end
++
++%  check for column or row vector (Matlab uses a minimum of two
++%  dimensions, so this won't match Matlab standard output)
++
++for iarg=1:nargin-2
++    if strcmpi(varargin{iarg},'vector')
++        if (ndims(a) == 2) && ((size(a,1) == 1) || (size(a,2) == 1))
++            sdim =['(' num2str(idim) ')'];
++            return
++        end
++    end
++end
++
++%  do the general case
++
++asize=size(a);
++index=zeros(size(asize));
++aprod=prod(asize);
++idim =idim-1;
++
++%  calculate indices base 0 and convert to base 1
++
++%  note that ind2sub might be useful, except that it requires a list
++%  of scalars rather than a vector for output.
++
++for i=length(asize):-1:1
++    aprod=aprod/asize(i);
++    index(i)=floor(idim/aprod);
++    idim=idim-index(i)*aprod;
++end
++index=index+1;
++
++%  assemble string for output
++
++sdim ='(';
++for i=1:length(asize)-1;
++    sdim =[sdim num2str(index(i)) ','];
++end
++sdim =[sdim num2str(index(end)) ')'];
++
++end
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_dim.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allequal.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allequal.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allequal.m	(revision 12996)
+@@ -0,0 +1,70 @@
++%
++%  function to return an empty array if all array elements are
++%  equal to the given value, which may also be empty but not nan.
++%
++%  (note that by definition, nan is not equal to nan.  this could
++%  be changed by using isequalwithequalnans.)
++%
++%  function [aout]=allequal(ain,aval)
++%
++function [aout]=allequal(ain,aval)
++
++if ~nargin
++    help allequal
++    return
++end
++
++aout=ain;
++
++if     islogical(ain) && islogical(aval)
++    for i=1:numel(ain)
++        if ~isequal(ain(i),aval)
++            return
++        end
++    end
++    aout=logical([]);
++
++elseif isnumeric(ain) && isnumeric(aval)
++    for i=1:numel(ain)
++        if ~isequal(ain(i),aval)
++            return
++        end
++    end
++    aout=[];
++
++elseif ischar(ain) && ischar(aval)
++    for i=1:size(ain,1)
++        if ~strcmp(ain(i,:),aval)
++            return
++        end
++    end
++    aout='';
++
++elseif iscell(ain)
++    if     islogical(aval)
++        for i=1:numel(ain)
++            if ~islogical(ain{i}) || ~isequal(ain{i},aval)
++                return
++            end
++        end
++        aout={};
++
++    elseif isnumeric(aval)
++        for i=1:numel(ain)
++            if ~isnumeric(ain{i}) || ~isequal(ain{i},aval)
++                return
++            end
++        end
++        aout={};
++
++    elseif ischar(aval)
++        for i=1:size(ain,1)
++            if ~ischar(ain{i}) || ~strcmp(ain{i},aval)
++                return
++            end
++        end
++        aout={};
++    end
++end
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allequal.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_size.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_size.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_size.m	(revision 12996)
+@@ -0,0 +1,38 @@
++%
++%  function to return the string size of an array
++%
++%  function [ssize]=string_size(a,varargin)
++%
++function [ssize]=string_size(a,varargin)
++
++if ~nargin
++    help string_size
++    return
++end
++
++%  check for column or row vector (Matlab uses a minimum of two
++%  dimensions, so this won't match Matlab standard output)
++
++for iarg=1:nargin-1
++    if strcmpi(varargin{iarg},'vector')
++        if (ndims(a) == 2) && ((size(a,1) == 1) || (size(a,2) == 1))
++            ssize =['(' num2str(numel(a)) ')'];
++            return
++        end
++    end
++end
++
++%  do the general case
++
++asize=size(a);
++
++%  assemble string for output
++
++ssize ='(';
++for i=1:length(asize)-1;
++    ssize =[ssize num2str(asize(i)) 'x'];
++end
++ssize =[ssize num2str(asize(end)) ')'];
++
++end
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_size.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/any2str.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/any2str.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/any2str.m	(revision 12996)
+@@ -0,0 +1,22 @@
++%
++%  function to convert anything to a string
++%
++%  function [svec]=any2str(a,alim)
++%
++function [svec]=any2str(a,alim)
++
++if ~exist('alim','var') || (numel(a) <= alim)
++    if iscell(a)
++        svec=string_cell(a);
++    else
++        if (numel(a) > 1) && ~ischar(a)
++            svec=string_vec(a);
++        else
++            svec=item2str(a);
++        end
++    end
++else
++	svec=[string_size(a) ' ''' class(a) ''''];
++end
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/any2str.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_vec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_vec.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_vec.m	(revision 12996)
+@@ -0,0 +1,26 @@
++%
++%  function to return the string of an vector
++%
++%  function [svec]=string_vec(a)
++%
++function [svec]=string_vec(a)
++
++if ~nargin
++    help string_vec
++    return
++end
++
++if (numel(a) == 0)
++    svec='[]';
++    return
++end
++
++%  assemble string for output
++
++svec ='[';
++for i=1:numel(a)-1;
++    svec=[svec item2str(a(i)) ' '];
++end
++svec=[svec item2str(a(end)) ']'];
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_vec.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allnan.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allnan.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allnan.m	(revision 12996)
+@@ -0,0 +1,22 @@
++%
++%  function to return an empty double array if all array elements are NaN
++%
++%  function [dout]=allnan(din)
++%
++function [dout]=allnan(din)
++
++if ~nargin
++    help allnan
++    return
++end
++
++for i=1:numel(din)
++    if ~isnan(din(i))
++        dout=din;
++        return
++    end
++end
++dout=[];
++
++end
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allnan.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/str2int.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/str2int.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/str2int.m	(revision 12996)
+@@ -0,0 +1,46 @@
++%
++%  function to find and read the first or last positive integer
++%  in a character string.
++%
++%  function [aint]=str2int(astr,cfl)
++%
++function [aint]=str2int(astr,cfl);
++
++aint=[];
++
++if     ~exist('cfl','var') || strncmpi(cfl,'f',1)
++    i=1;
++
++    while (i <= length(astr))
++        if (astr(i) >= '0' && astr(i) <= '9')
++            aint=sscanf(astr(i:length(astr)),'%d',[1,1]);
++            return
++        else
++            i=i+1;
++        end
++	end
++
++elseif strncmpi(cfl,'l',1)
++    i=length(astr);
++    ifound=false;
++
++    while (i >= 1)
++        if     (astr(i) >= '0' && astr(i) <= '9')
++            ifound=true;
++            i=i-1;
++        elseif ~ifound
++            i=i-1;
++        else
++            aint=sscanf(astr(i+1:length(astr)),'%d',[1,1]);
++            return
++        end
++	end
++
++    if ifound
++        aint=sscanf(astr,'%d',[1,1]);
++        return
++    end
++end
++
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_cell.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_cell.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_cell.m	(revision 12996)
+@@ -0,0 +1,26 @@
++%
++%  function to return the string of a cell array
++%
++%  function [svec]=string_cell(a)
++%
++function [svec]=string_cell(a)
++
++if ~nargin
++    help string_cell
++    return
++end
++
++if (numel(a) == 0)
++    svec='{}';
++    return
++end
++
++%  assemble string for output
++
++svec ='{';
++for i=1:numel(a)-1;
++    svec=[svec item2str(a{i}) ' '];
++end
++svec=[svec item2str(a{end}) '}'];
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_cell.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/find_string.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/find_string.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/find_string.m	(revision 12996)
+@@ -0,0 +1,18 @@
++%
++%  function to find a string in a cell array
++%  (could probably be replaced by matlab strmatch)
++%  
++%  [ifound]=find_string(cells,str)
++%
++function [ifound]=find_string(cells,str)
++
++ifound=false;
++
++for i=1:numel(cells)
++    if ischar(cells{i}) && strcmp(cells{i},str)
++        ifound=i;
++        return
++    end
++end
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/find_string.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_size.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_size.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_size.m	(revision 12996)
+@@ -0,0 +1,35 @@
++%
++%  function to find an array size from a list of arrays.
++%  
++%  [asize]=array_size(varargin)
++%
++%  see array_numel to check only the number of elements, if
++%  single indices will be used.
++%
++function [asize]=array_size(varargin)
++
++asize=[1 1];
++
++for iarg=1:nargin
++    if ischar(varargin{iarg})
++        isize=size(cellstr(varargin{iarg}));
++    else
++        isize=size(varargin{iarg});
++    end
++    
++    if ~isequal(isize,[1 1])
++        if isequal(asize,[1 1])
++            asize=isize;
++        else
++            if ~isequal(isize,asize)
++                if ~isempty(inputname(iarg))
++                    error('Array ''%s'' has inconsistent size.',inputname(iarg));
++                else
++                    error('Array %d has inconsistent size.',iarg);
++                end
++            end
++        end
++    end
++end
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/item2str.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/item2str.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/item2str.m	(revision 12996)
+@@ -0,0 +1,31 @@
++%
++%  function to convert an item to a string
++%
++%  function [svec]=item2str(a)
++%
++function [svec]=item2str(a)
++
++if     islogical(a)
++    if a
++        svec='true';
++    else
++        svec='false';
++    end
++elseif ischar(a)
++    svec=['''' a ''''];
++elseif isnumeric(a)
++    svec=num2str(a);
++else
++    if ~isempty(inputname(1))
++        warning('item2str:item_unrecog',...
++            'Item ''%s'' is of unrecognized type ''%s''.',...
++            inputname(1),class(a));
++    else
++        warning('item2str:item_unrecog',...
++            'Item %d is of unrecognized type ''%s''.',...
++            1,class(a));
++    end
++    return
++end
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/item2str.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/rotateticklabel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/rotateticklabel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/rotateticklabel.m	(revision 12996)
+@@ -0,0 +1,69 @@
++function th=rotateticklabel(h,rot,demo)
++%ROTATETICKLABEL rotates tick labels
++%   TH=ROTATETICKLABEL(H,ROT) is the calling form where H is a handle to
++%   the axis that contains the XTickLabels that are to be rotated. ROT is
++%   an optional parameter that specifies the angle of rotation. The default
++%   angle is 90. TH is a handle to the text objects created. For long
++%   strings such as those produced by datetick, you may have to adjust the
++%   position of the axes so the labels don't get cut off.
++%
++%   Of course, GCA can be substituted for H if desired.
++%
++%   TH=ROTATETICKLABEL([],[],'demo') shows a demo figure.
++%
++%   Known deficiencies: if tick labels are raised to a power, the power
++%   will be lost after rotation.
++%
++%   See also datetick.
++
++%   Written Oct 14, 2005 by Andy Bliss
++%   Copyright 2005 by Andy Bliss
++
++%DEMO:
++if nargin==3
++    x=[now-.7 now-.3 now];
++    y=[20 35 15];
++    figure
++    plot(x,y,'.-')
++    datetick('x',0,'keepticks')
++    h=gca;
++    set(h,'position',[0.13 0.35 0.775 0.55])
++    rot=90;
++end
++
++%set the default rotation if user doesn't specify
++if nargin==1
++    rot=90;
++end
++%make sure the rotation is in the range 0:360 (brute force method)
++while rot>360
++    rot=rot-360;
++end
++while rot<0
++    rot=rot+360;
++end
++%get current tick labels
++a=get(h,'XTickLabel');
++%erase current tick labels from figure
++set(h,'XTickLabel',[]);
++%get tick label positions
++b=get(h,'XTick');
++c=get(h,'YTick');
++%make new tick labels
++%  must consider yscale (jes, 9/14/10)
++switch lower(get(h,'YScale'))
++    case 'linear'
++        if rot<180
++            th=text(b,repmat(c(1)-.1*(c(2)-c(1)),length(b),1),a,'HorizontalAlignment','right','rotation',rot,'Interpreter','none');
++        else
++            th=text(b,repmat(c(1)-.1*(c(2)-c(1)),length(b),1),a,'HorizontalAlignment','left','rotation',rot,'Interpreter','none');
++        end
++    case 'log'
++        if rot<180
++            th=text(b,repmat(10^(log10(c(1))-.1*(log10(c(2))-log10(c(1)))),length(b),1),a,'HorizontalAlignment','right','rotation',rot,'Interpreter','none');
++        else
++            th=text(b,repmat(10^(log10(c(1))-.1*(log10(c(2))-log10(c(1)))),length(b),1),a,'HorizontalAlignment','left','rotation',rot,'Interpreter','none');
++        end
++    otherwise
++        set(h,'XTickLabel',a);
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/rotateticklabel.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_numel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_numel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_numel.m	(revision 12996)
+@@ -0,0 +1,35 @@
++%
++%  function to find a number of elements from a list of arrays.
++%  
++%  [asize]=array_numel(varargin)
++%
++%  see array_size to check the number and shape of elements, if
++%  multiple indices will be used.
++%
++function [anum]=array_numel(varargin)
++
++anum=1;
++
++for iarg=1:nargin
++    if ischar(varargin{iarg})
++        inum=numel(cellstr(varargin{iarg}));
++    else
++        inum=numel(varargin{iarg});
++    end
++    
++    if ~isequal(inum,1)
++        if isequal(anum,1)
++            anum=inum;
++        else
++            if ~isequal(inum,anum)
++                if ~isempty(inputname(iarg))
++                    error('Array ''%s'' has inconsistent number of elements.',inputname(iarg));
++                else
++                    error('Array %d has inconsistent number of elements.',iarg);
++                end
++            end
++        end
++    end
++end
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/squarezoom.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/squarezoom.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/squarezoom.m	(revision 12996)
+@@ -0,0 +1,20 @@
++function squarezoom()
++%SQUAREZOOM - zoom on a part of a figure
++%
++%   Usage:
++%      squarezoom()
++
++disp('Click twice to define a square where you want to zoom. First click for upper left corner, second for lower right corner');
++[x,y]=ginput(2);
++dx=x(2)-x(1);
++dy=y(1)-y(2);
++
++if dx>dy,
++	delta=dx-dy;
++	xlim([x(1) x(2)]);
++	ylim([y(2)-delta/2 y(1)+delta/2]);
++else
++	delta=dy-dx;
++	xlim([x(1)-delta/2 x(2)+delta/2]);
++	ylim([y(2) y(1)]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/plot2patch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/plot2patch.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/plot2patch.m	(revision 12996)
+@@ -0,0 +1,16 @@
++function [px py]=plot2patch(x,y,miny)
++%PLOT2PATCH: build patch out of x,y plot.
++%
++% Usage: [px,py]=plot2patch(x,y,miny)
++%
++%        where px and py are a list of point defining a closed polygon.
++%              x,y are the values of the plot
++%              miny is the y-value used to close the plot into a closed polygon.
++% 
++%      See also patch, plot
++
++px=x;
++py=y;
++
++px=[px; flipud(x)];
++py=[py; ; miny*ones(length(x),1)];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot	(revision 12995)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot	(revision 12996)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
Index: /issm/oecreview/Archive/12678-13393/ISSM-12996-12997.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12996-12997.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12996-12997.diff	(revision 13394)
@@ -0,0 +1,20859 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/isbasin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/isbasin.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/isbasin.m	(revision 12997)
+@@ -1,19 +0,0 @@
+-function isbasin(name)
+-%ISBASIN: figure out if a basin name exists.
+-%
+-%
+-%        Usage:  index=isbasin('jks');
+-%
+-%
+-
+-
+-%First, load basin names:
+-load([jplsvn '/projects/ModelData/Names/Names.mat']);
+-
+-
+-%go through names: 
+-for i=1:length(names),
+-	if ~isempty(strfind(names{i,1},name)),
+-		disp(['''' names{i,1} ''' Long:' num2str(names{i,2}) ' Lat:' num2str(names{i,3}) ]);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/plotbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/plotbasins.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/plotbasins.m	(revision 12997)
+@@ -1,18 +0,0 @@
+-%display all the domain outlines in a directory
+-
+-basins=listfiles;
+-
+-hold on
+-for i=1:length(basins), 
+-	%check whether this is a .exp file
+-	basin=basins{i};
+-	if strcmpi(basin(end-3:end),'.exp'),
+-
+-		contour=expread(basin,0);
+-		x=contour(1).x;
+-		y=contour(1).y;
+-		x0=mean(x); y0=mean(y);
+-		text(x0,y0,basin(1:end-4),'Fontsize',14);
+-		expdisp(basin);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/showbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/showbasins.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/showbasins.m	(revision 12997)
+@@ -1,69 +0,0 @@
+-function showbasins(varargin)
+-%SHOWBASINS - return basins that are within the xlim and ylim
+-%
+-%   Usage:
+-%      names=showbasins(options);
+-%   Options: 
+-%      'unit' default 1
+-%      'hemisphere': default +1;
+-%      'central_meridian: 45 for Greenland and 0 for Antarctica
+-%      'standard_parallel: 70 for Greenland and 71 for Antarctica
+-%
+-
+-%is varargin an options database already?
+-if nargin==0,
+-	options=pairoptions(varargin{:});
+-elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
+-	%do nothing to the varargin: 
+-	options=varargin{1};
+-else
+-	%process varargin for options: 
+-	options=pairoptions(varargin{:});
+-end
+-
+-
+-%recover some options, and set defaults
+-unitmultiplier=getfieldvalue(options,'unit',1);
+-fontsize=getfieldvalue(options,'fontsize',12);
+-hemisphere=getfieldvalue(options,'hemisphere');
+-
+-if strcmpi(hemisphere,'s'),
+-	hemisphere=-1;
+-elseif strcmpi(hemisphere,'n'),
+-	hemisphere=+1;
+-else
+-	error('showbasins error message: hemispehre should be either ''n'' or ''s''');
+-	end
+-
+-if hemisphere==+1,
+-	central_meridian=getfieldvalue(options,'central_meridian',45);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',70);
+-else
+-	central_meridian=getfieldvalue(options,'central_meridian',0);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',71);
+-end
+-
+-%Ok, find basin we are talking about: 
+-load([jplsvn '/projects/ModelData/Names/Names.mat']);
+-
+-%Get xlim and ylim, and convert into lat,long: 
+-xlimits=xlim; x0=xlimits(1); x1=xlimits(2);
+-ylimits=ylim; y0=ylimits(1); y1=ylimits(2);
+-
+-%Convert names lat and long into x,y:
+-lat=cell2mat(names(:,3));
+-long=cell2mat(names(:,2));
+-
+-%Now, convert lat,long into x,y:
+-[x,y]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
+-
+-%Find  x,y within xlimits and ylimits: 
+-locations=find(x>x0 & x<x1 & y>y0 & y<y1);
+-
+-%Go through locations, and display the names: 
+-for i=1:size(locations,1),
+-	hold on,
+-	plot(x(locations(i)),y(locations(i)),'r.');
+-	t=text(x(locations(i)),y(locations(i)),names{locations(i),1}); 
+-	set(t,'FontSize',fontsize);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/basinzoom.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/basinzoom.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Basins/basinzoom.m	(revision 12997)
+@@ -1,94 +0,0 @@
+-function varargout=basinzoom(varargin)
+-%ANTZOOM - zoom on a basin in Antarctica or Greenland.
+-%
+-%   This function zooms on an existing figure describing Antarctica or Greenland 
+-%   The zooming depends on the region name provided as input. 
+-%
+-%   Usage:
+-%      varargout=basinzoom(options)
+-
+-%recover some options, and set defaults
+-
+-%is varargin an options database already?
+-if nargin==0,
+-	options=pairoptions(varargin{:});
+-elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
+-	%do nothing to the varargin: 
+-	options=varargin{1};
+-else
+-	%process varargin for options: 
+-	options=pairoptions(varargin{:});
+-end
+-
+-unitmultiplier=getfieldvalue(options,'unit',NaN);
+-basin=getfieldvalue(options,'basin');
+-
+-if exist(options,'basindelta'),
+-
+-	basindeltax=getfieldvalue(options,'basindelta',300); 
+-	basindeltay=getfieldvalue(options,'basindelta',300); 
+-else
+-	basindeltax=getfieldvalue(options,'basindeltax',300); 
+-	basindeltay=getfieldvalue(options,'basindeltay',300);
+-end
+-
+-%multiply by 1000 to get kms
+-basindeltax=basindeltax*1000;
+-basindeltay=basindeltay*1000;
+-
+-%Ok, find basin we are talking about: 
+-load([jplsvn() '/projects/ModelData/Names/Names.mat']);
+-		
+-%Go through names: 
+-found=0;
+-for i=1:size(names,1),
+-	if strcmpi(names{i,1},basin),
+-		%ok, we've got the region. Get lat and long: 
+-		long=names{i,2};
+-		lat=names{i,3};
+-		hemisphere=names{i,4};
+-		found=1;
+-		break;
+-	end
+-end
+-
+-if ~found,
+-	error(['basinzoom error message: cannot find basin ' basin '. Use isbasin to determine a basin name.']);
+-end
+-
+-if hemisphere==+1,
+-	central_meridian=getfieldvalue(options,'central_meridian',45);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',70);
+-else
+-	central_meridian=getfieldvalue(options,'central_meridian',0);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',71);
+-end
+-
+-%Transform lat long into x,y: 
+-[xc,yc]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
+-
+-%compute x0,x1 and y0,y1 using basindeltax and basindeltay
+-x0=xc-basindeltax/2;
+-x1=xc+basindeltax/2;
+-y0=yc-basindeltay/2;
+-y1=yc+basindeltay/2;
+-
+-if ~isnan(unitmultiplier)
+-	x0=x0*unitmultiplier;
+-	x1=x1*unitmultiplier;
+-	y0=y0*unitmultiplier;
+-	y1=y1*unitmultiplier;
+-end
+-
+-%if output arguments are present, return the limits, 
+-%otherwise, set them on the current graphic. 
+-if nargout==2,
+-	found=1;
+-	varargout{1}=[x0 x1];
+-	varargout{2}=[y0 y1];
+-else
+-	xlim([x0 x1]);
+-	ylim([y0 y1]);
+-	found=1;
+-	daspect([1;1;1]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/immerge.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/immerge.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/immerge.m	(revision 12997)
+@@ -1,43 +0,0 @@
+-function out = immerge(bg, fg, coef)
+-% Creates an image 'out' of same type as bg.
+-% 'out' has 'bg' as background, and 'fg' (transparent, 
+-% weighted by 'coef') above 'bg'.
+-% Useful when one cannot use OpenGL as renderer, but still 
+-% wants to have transparency!
+-% 'out', 'bg', and 'fg' are RGB images.
+-%
+-% merged = immerged(bg, fg, coef)
+-%	- bg matrix of type double or uint8
+-%	- fg matrix of type double or uint8
+-%	- coef is a scalar between 0 and 1, or a matrix of 
+-%	  such scalars, same size as 'fg' and 'bg' (AlphaData).
+-%
+-% Suggestions for future development:
+-%	- allow to have 'coef' referring to the AlphaMap
+-%	- allow 'coef' to take values between 1 and 64.
+-%
+-% Gauthier Fleutot 28-07-2004
+-% fleutotg@esiee.fr
+-
+-intOutput = 0;	% if we want the output to be of type integer
+-
+-if ~isa(bg, 'double')
+-	bg = double(bg);	% because '-' isn't defined for uint8
+-	intOutput = 1;
+-end
+-if ~isa(fg, 'double')
+-	fg = double(fg);	% because '-' isn't defined for uint8
+-end
+-
+-dif = fg-bg;
+-
+-if size(coef) == [1 1]
+-	out = bg + coef.*dif;
+-else
+-	coef = cat(3,coef,coef,coef);	% extend the coef matric in the 3rd dim.
+-	out = bg + coef .* dif;
+-end
+-
+-if intOutput == 1
+-	out = uint8(out);
+-end
+\ No newline at end of file
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/mean_congrid.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/mean_congrid.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/mean_congrid.m	(revision 12997)
+@@ -1,59 +0,0 @@
+-function res=mean_congrid(a,n,choice);
+-%MEAN_CONGRID - average the values around a pixel
+-%
+-%   INPUT a,n,choice, where a is the matrix, and n the size of the area averaged around
+-%   one pixel, odd number. choice=1 if the NaN values remain NaN values.
+-%
+-%   Usage:
+-%      res=mean_congrid(a,n,choice)
+-
+-s=size(a);
+-aa=a;
+-pos=find(isnan(aa));
+-aa(pos)=0;
+-
+-if (mod(n,2)==0),
+-   disp('Cannot rebin, the dimensions of the matrix and n are not compatible');
+-   break
+-end
+-mm=(n-1)/2;
+-
+-res=zeros(s(1),s(2));
+-
+-for m=mm+1:s(1)-mm,
+-   if mod(m,10)==0,
+-      disp(m/s(1)*100);
+-   end
+-   
+-   for l=mm+1:s(2)-mm,
+-      
+-      
+-      if sum(sum(~isnan(a(m-mm:m+mm,l-mm:l+mm))))~=0,
+-      res(m,l)=sum(...
+-                   sum(...
+-                   ~isnan(...
+-                          a(m-mm:m+mm,l-mm:l+mm)...
+-                          ).*...
+-                          aa(m-mm:m+mm,l-mm:l+mm)...
+-                       )...
+-                   )...
+-                   /sum(sum(~isnan(a(m-mm:m+mm,l-mm:l+mm))));
+-             else
+-                res(m,l)=NaN;
+-             end
+-             
+-   end
+-end
+-
+-if choice==1,
+-   pos=find(isnan(a));
+-   res(pos)=NaN;
+-end
+-
+-   
+-
+-
+-
+-
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/im_resize.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/im_resize.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/im_resize.m	(revision 12997)
+@@ -1,16 +0,0 @@
+-function newimg = im_resize(img,nw,nh)
+-%IM_RESIZE - resize an image using bicubic interpolation
+-%
+-%   NEWIMG = IM_RESIZE(IMG,NW,NH) Given input image IMG,
+-%   returns a new image NEWIMG of size NWxNH.
+-%
+-% Matthew Dailey 2000
+-
+-  if nargin ~= 3
+-    error('usage: im_resize(image,new_wid,new_ht)');
+-  end;
+-  
+-  ht_scale = size(img,1) / nh;
+-  wid_scale = size(img,2) / nw;
+-  
+-  newimg = interp2(img,(1:nw)*wid_scale,(1:nh)'*ht_scale,'cubic');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/rebin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/rebin.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ImageProcessing/rebin.m	(revision 12997)
+@@ -1,44 +0,0 @@
+-function res=rebin(a,n);
+-%REBIN - average values of a matrix by bloc
+-%
+-%   INPUT a,n, where a is the matrix, and n the size of the area averaged around
+-%   one pixel
+-%
+-%   Usage:
+-%      res=rebin(a,n)
+-
+-s=size(a);
+-
+-if (mod(s(1)/n,2)~=0 | mod(s(2)/n,2)~=0),
+-   disp('Cannot rebin, the dimensions of the matrix and n are not compatible');
+-   break
+-end
+-
+-res=zeros(s(1)/n,s(2)/n);
+-
+-for m=1:s(1)/n,
+-   for l=1:s(2)/n,
+-      if sum(sum(~isnan(a((m-1)*n+1:m*n,(l-1)*n+1:l*n))))~=0,
+-      res(m,l)=sum(...
+-                   sum(...
+-                       ~isnan(...
+-                              a((m-1)*n+1:m*n,(l-1)*n+1:l*n)...
+-                              ).*...
+-                       a((m-1)*n+1:m*n,(l-1)*n+1:l*n)...
+-                       )...
+-                   )...
+-                   /sum(sum(~isnan(a((m-1)*n+1:m*n,(l-1)*n+1:l*n))));
+-             else
+-                res(m,l)=NaN;
+-             end
+-             
+-   end
+-end
+-
+-   
+-
+-
+-
+-
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.py	(revision 12997)
+@@ -1,76 +0,0 @@
+-import socket
+-import platform
+-import subprocess
+-import os
+-import shutil
+-from MatlabFuncs import *
+-
+-def scpin(host, login,port,path, packages):
+-	"""
+-	SCPIN get packages from host, using scp on unix, and pscp on windows
+- 
+-	   usage: scpin(host,packages,path)
+-	"""
+-
+-	#first get hostname
+-	hostname=socket.gethostname().lower().split('.')[0]
+-
+-	#first be sure packages are not in the current directory, this could conflict with pscp on windows. 
+-	#remove warnings in case the files do not exist
+-	for package in packages:
+-		try:
+-			os.remove(package)
+-		except OSError as e:
+-			pass
+-
+-	#if hostname and host are the same, do a simple copy
+-	if strcmpi(hostname,host):
+-
+-		for package in packages:
+-			try:
+-				shutil.copy(os.path.join(path,package),os.getcwd())    #keep going, even if success=0
+-			except OSError as e:
+-				pass
+-
+-	else:
+-
+-		if 'Windows' in platform.system():
+-			#use the putty project pscp.exe: it should be in the path.
+-		
+-			#get ISSM_DIR variable
+-			if 'ISSM_DIR_WIN' in os.environ:
+-				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
+-			else:
+-				raise OSError("scpin error message: could not find ISSM_DIR_WIN environment variable.")
+-
+-			username=raw_input('Username: (quoted string) ')
+-			key=raw_input('Key: (quoted string) ')
+-
+-			for package in packages:
+-				try:
+-					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s:%s %s' % (ISSM_DIR,username,key,host,os.path.join(path,package),os.getcwd()),shell=True)
+-				except CalledProcessError as e:
+-					raise CalledProcessError("scpin error message: could not call putty pscp.")
+-
+-		else:
+-			#just use standard unix scp
+-			#string to copy multiple files using scp: 
+-			if len(packages)==1:
+-				string=packages[0]
+-			else:
+-				string='{'
+-				for package in packages:
+-					string+=packages[i]+','
+-				string=string[:-1]+'}'
+-
+-
+-			if port:
+-				subprocess.call('scp -P %d %s@localhost:%s %s' % (port,login,os.path.join(path,string),os.getcwd),shell=True)
+-			else:
+-				subprocess.call('scp %s@%s:%s %s' % (login,host,os.path.join(path,string),os.getcwd),shell=True)
+-		
+-			#check scp worked
+-			for package in packages:
+-				if not os.path.exists(os.path.join('.',package)):
+-					raise OSError("scpin error message: could not call scp on *nix system.")
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.py	(revision 12997)
+@@ -1,58 +0,0 @@
+-import socket
+-import platform
+-import subprocess
+-import os
+-import shutil
+-from MatlabFuncs import *
+-
+-def issmscpout(host,path,login,port,packages):
+-	"""
+-	SCPOUT send packages to a host, using scp on unix, and pscp on windows
+- 
+-	   usage: scpout(host,path,packages)
+-	"""
+-
+-	#get hostname
+-	hostname=socket.gethostname().lower().split('.')[0]
+-
+-	#if hostname and host are the same, do a simple copy
+-
+-	if strcmpi(host,hostname):
+-		for package in packages:
+-			here=os.getcwd()
+-			os.chdir(path)
+-			shutil.rmtree(package)
+-			subprocess.call('ln -s %s %s' % (os.path.join(here,package),path),shell=True)
+-			os.chdir(here)
+-	else:
+-		if 'Windows' in platform.system():
+-			#use the putty project pscp.exe: it should be in the path.
+-		
+-			#get ISSM_DIR variable
+-			if 'ISSM_DIR_WIN' in os.environ:
+-				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
+-			else:
+-				raise OSError("scpout error message: could not find ISSM_DIR_WIN environment variable.")
+-
+-			username=raw_input('Username: (quoted string) ')
+-			key=raw_input('Key: (quoted string) ')
+-
+-			for package in packages:
+-				try:
+-					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s %s:%s' % (ISSM_DIR,username,key,package,host,path),shell=True)
+-				except CalledProcessError as e:
+-					raise CalledProcessError("scpout error message: could not call putty pscp.")
+-
+-		else:
+-			#just use standard unix scp
+-			#create string of packages being sent
+-			string=''
+-			for package in packages:
+-				string+=' '+package
+-			string+=' '
+-		
+-			if port:
+-				subprocess.call('scp -P %d %s %s@localhost:%s' % (port,string,login,path),shell=True)
+-			else:
+-				subprocess.call('scp %s %s@%s:%s' % (string,login,host,path),shell=True)
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.py	(revision 12997)
+@@ -1,42 +0,0 @@
+-import socket
+-import platform
+-import subprocess
+-import os
+-from MatlabFuncs import *
+-
+-def issmssh(host,login,port,command):
+-	"""
+-	ISSMSSH - wrapper for OS independent ssh command.
+- 
+-	   usage: 
+-	      issmssh(host,command)
+-	"""
+-
+-	#first get hostname 
+-	hostname=socket.gethostname().lower().split('.')[0]
+-
+-	#if same as host, just run the command. 
+-	if strcmpi(host,hostname):
+-		subprocess.call(command,shell=True)
+-	else:
+-		if 'Windows' in platform.system():
+-			#use the putty project plink.exe: it should be in the path.
+-		
+-			#get ISSM_DIR variable
+-			if 'ISSM_DIR_WIN' in os.environ:
+-				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
+-			else:
+-				raise OSError("issmssh error message: could not find ISSM_DIR_WIN environment variable.")
+-
+-			username=raw_input('Username: (quoted string) ')
+-			key=raw_input('Key: (quoted string) ')
+-
+-			subprocess.call('%s/externalpackages/ssh/plink.exe -ssh -l "%s" -pw "%s" %s "%s"' % (ISSM_DIR,username,key,host,command),shell=True);
+-
+-		else:
+-			#just use standard unix ssh
+-			if port:
+-				subprocess.call('ssh -l %s -p %d localhost "%s"' % (login,port,command),shell=True)
+-			else:
+-				subprocess.call('ssh -l %s %s "%s"' % (login,host,command),shell=True)
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.py	(revision 12997)
+@@ -1,37 +0,0 @@
+-import os
+-from issmdir import *
+-from MatlabFuncs import *
+-
+-def ispetsc():
+-	"""
+-	ISPETSC - figure out if PETSC package was compiled with ISSM
+- 
+-	   Usage:
+-	      flag=ispetsc();
+-	"""
+-
+-	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
+-	if not os.path.exists(configfile):
+-		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
+-
+-	#go through the file, and recover the line we want
+-	flag=2
+-	try:
+-		fid=open(configfile,'r')
+-	except IOError as e:
+-		raise IOError("could not open file: '%s'" % configfile)
+-
+-	for tline in fid:
+-		if strncmp(tline,'/* #undef _HAVE_PETSC_ */',25):
+-			flag=0
+-			break
+-		if  strncmp(tline,'#define _HAVE_PETSC_',20):
+-			flag=1
+-			break
+-
+-	fid.close()
+-	if flag==2:
+-		raise RuntimeError("could not determine whether PETSC was or was not compiled.")
+-
+-	return flag
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpin.m	(revision 12997)
+@@ -1,78 +0,0 @@
+-function scpin(host, login,port,path, packages)
+-%SCPIN get packages from host, using scp on unix, and pscp on windows
+-%
+-%   usage: scpin(host,packages,path)
+-%
+-%
+-
+-%first get hostname
+-hostname=oshostname();
+-
+-%first be sure packages are not in the current directory, this could conflict with pscp on windows. 
+-%get initial warning mode
+-state=warning('query', 'all');
+-%remove warnings in case the files do not exist
+-warning off
+-for i=1:numel(packages),
+-	delete(packages{i});
+-end
+-%back to initial warning state
+-warning(state);
+-
+-%if hostname and host are the same, do a simple copy
+-if strcmpi(hostname,host),
+-
+-    for i=1:numel(packages),
+-		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
+-	end
+-
+-else
+-
+-	if ispc,
+-		%use the putty project pscp.exe: it should be in the path.
+-		
+-		%get ISSM_DIR variable
+-		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+-		if status, 
+-			error('scpin error message: could not find ISSM_DIR_WIN environment variable');
+-		end
+-		ISSM_DIR=ISSM_DIR(2:end-2);
+-
+-		username=input('Username: (quoted string) ');
+-		key=input('Key: (quoted string) ');
+-
+-		for i=1:numel(packages),
+-			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' host ':' path '/' packages{i} ' ./']);
+-			if status, 
+-				error('scpin error message: could not call putty pscp');
+-			end
+-		end
+-
+-	else
+-		%just use standard unix scp
+-		%string to copy multiple files using scp: 
+-		if numel(packages)==1,
+-			string=packages{1};
+-		else
+-			string='\{';
+-			for i=1:numel(packages)-1,
+-				string=[string packages{i} ','];
+-			end
+-			string=[string packages{end} '\}'];
+-		end
+-
+-
+-		if port,
+-			eval(['!scp -P ' num2str(port) ' ' login '@localhost:' path '/' string ' ./']);
+-		else
+-			eval(['!scp ' login '@' host ':' path '/' string ' ./']);
+-		end
+-		
+-		%check scp worked
+-		for i=1:numel(packages),
+-			if ~exist(['./' packages{i}]),
+-				error('scpin error message: could not call scp on *nix system');
+-			end
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmscpout.m	(revision 12997)
+@@ -1,57 +0,0 @@
+-function issmscpout(host,path,login,port,packages)
+-%SCPOUT send packages to a host, using scp on unix, and pscp on windows
+-%
+-%   usage: scpout(host,path,packages)
+-%
+-%
+-
+-%get hostname
+-hostname=oshostname();
+-
+-%if hostname and host are the same, do a simple copy
+-
+-if strcmpi(host,hostname),
+-	for i=1:numel(packages),
+-		here=pwd;
+-		eval(['cd ' path])
+-		system(['rm -rf ' packages{i} ]);
+-		system(['ln -s ' here '/' packages{i} ' .']);
+-		eval(['cd ' here]);
+-	end
+-else 
+-	if ispc,
+-		%use the putty project pscp.exe: it should be in the path.
+-		
+-		%get ISSM_DIR variable
+-		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+-		if status, 
+-			error('scpout error message: could not find ISSM_DIR_WIN environment variable');
+-		end
+-		ISSM_DIR=ISSM_DIR(2:end-2);
+-
+-		username=input('Username: (quoted string) ');
+-		key=input('Key: (quoted string) ');
+-
+-		for i=1:numel(packages),
+-			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' packages{i} ' ' host ':' path]);
+-			if status, 
+-				error('scpout error message: could not call putty pscp');
+-			end
+-		end
+-
+-	else
+-		%just use standard unix scp
+-		%create string of packages being sent
+-		string='';
+-		for i=1:numel(packages),
+-			string=[string ' ' packages{i}];
+-		end
+-		string=[string ' '];
+-		
+-		if port,
+-			eval(['!scp -P ' num2str(port) ' ' string ' ' login '@localhost:' path]);
+-		else
+-			eval(['!scp ' string ' ' login '@' host ':' path]);
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmssh.m	(revision 12997)
+@@ -1,37 +0,0 @@
+-function issmssh(host,login,port,command)
+-%ISSMSSH - wrapper for OS independent ssh command.
+-%
+-%   usage: 
+-%      issmssh(host,command)
+-
+-%first get hostname 
+-hostname=oshostname();
+-
+-%if same as host, just run the command. 
+-if strcmpi(host,hostname),
+-	system(command);
+-else
+-	if ispc,
+-		%use the putty project plink.exe: it should be in the path.
+-		
+-		%get ISSM_DIR variable
+-		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+-		if status, 
+-			error('issmssh error message: could not find ISSM_DIR_WIN environment variable');
+-		end
+-		ISSM_DIR=ISSM_DIR(2:end-2);
+-
+-		username=input('Username: (quoted string) ');
+-		key=input('Key: (quoted string) ');
+-
+-		system([ISSM_DIR '/externalpackages/ssh/plink.exe -ssh -l "' username '" -pw "' key '" ' host ' "' command '"']);
+-
+-	else
+-		%just use standard unix ssh
+-		if port,
+-			eval(['!ssh -l ' login ' -p ' num2str(port) ' localhost "' command '"']);
+-		else
+-			eval(['!ssh -l ' login ' ' host ' "' command '"']);
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.py	(revision 12997)
+@@ -1,37 +0,0 @@
+-import os
+-from issmdir import *
+-from MatlabFuncs import *
+-
+-def ismumps():
+-	"""
+-	ISMUMPS - figure out if MUMPS package was compiled with ISSM
+- 
+-	   Usage:
+-	      flag=ismumps();
+-	"""
+-
+-	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
+-	if not os.path.exists(configfile):
+-		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
+-
+-	#go through the file, and recover the line we want
+-	flag=2
+-	try:
+-		fid=open(configfile,'r')
+-	except IOError as e:
+-		raise IOError("could not open file: '%s'" % configfile)
+-
+-	for tline in fid:
+-		if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25):
+-			flag=0
+-			break
+-		if  strncmp(tline,'#define _HAVE_MUMPS_',20):
+-			flag=1
+-			break
+-
+-	fid.close()
+-	if flag==2:
+-		raise RuntimeError("could not determine whether MUMPS was or was not compiled.")
+-
+-	return flag
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ispetsc.m	(revision 12997)
+@@ -1,33 +0,0 @@
+-function flag=ispetsc()
+-%ISPETSC - figure out if PETSC package was compiled with ISSM
+-%
+-%   Usage:
+-%       flag=ispetsc();
+-
+-
+-configfile=[issmdir() '/bin/config.h']; %should find it in the install target
+-if ~exist(configfile,'file'),
+-	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
+-end
+-
+-%go through the file, and recover the line we want
+-flag=2;
+-fid=fopen(configfile,'r');
+-if(fid==-1), error(['could not open file: ' configfile]); end
+-
+-while(true),
+-	tline=fgets(fid);
+-	if ~ischar(tline), break, end
+-	if strncmp(tline,'/* #undef _HAVE_PETSC_ */',25),
+-		flag=0;
+-		break;
+-	end
+-	if  strncmp(tline,'#define _HAVE_PETSC_',20),
+-		flag=1;
+-		break;
+-	end
+-end
+-fclose(fid);
+-if flag==2,
+-	error('could not determine whether PETSC was or was not compiled');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfilesparallel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfilesparallel.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfilesparallel.m	(revision 12997)
+@@ -1,15 +0,0 @@
+-function list=listfilesparallel(rank,numprocs)
+-%LISTFILESPARALLEL list files inside a directory, depending on rank  and number of processors running this routine.
+-%        this is very OS dependent.
+-%
+-%   usage: list=listfilesparallel(rank,numprocs);
+-%
+-%
+-%   see also LS DIR LISTFILES
+-
+-list=listfiles';
+-numfiles=numel(list);
+-
+-%we now have a list, split it between all the processors.
+-[i1,i2]=parallelrange(rank,numprocs,numfiles);
+-list=list(i1:i2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/ismumps.m	(revision 12997)
+@@ -1,33 +0,0 @@
+-function flag=ismumps()
+-%ISMUMPS - figure out if MUMPS package was compiled with ISSM
+-%
+-%   Usage:
+-%       flag=ismumps();
+-
+-
+-configfile=[issmdir() '/bin/config.h']; %should find it in the install target
+-if ~exist(configfile,'file'),
+-	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
+-end
+-
+-%go through the file, and recover the line we want
+-flag=2;
+-fid=fopen(configfile,'r');
+-if(fid==-1), error(['could not open file: ' configfile]); end
+-
+-while(true),
+-	tline=fgets(fid);
+-	if ~ischar(tline), break, end
+-	if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25),
+-		flag=0;
+-		break;
+-	end
+-	if  strncmp(tline,'#define _HAVE_MUMPS_',20),
+-		flag=1;
+-		break;
+-	end
+-end
+-fclose(fid);
+-if flag==2,
+-	error('could not determine whether MUMPS was or was not compiled');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfiles.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfiles.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/listfiles.m	(revision 12997)
+@@ -1,22 +0,0 @@
+-function list=listfiles()
+-%LISTFILES list files inside a directory
+-%        this is very OS dependent.
+-%
+-%   usage: list=listfiles;
+-%
+-%
+-%   see also LS DIR
+-
+-%use dir, as it seems to act OS independent
+-
+-first_list=dir;
+-list={};
+-
+-for i=1:numel(first_list),
+-	if (  ~strcmpi(first_list(i).name,'.') &...
+-			~strcmpi(first_list(i).name,'..') &...
+-			~strcmpi(first_list(i).name,'NightlyRun') &...
+-			~strcmpi(first_list(i).name,'.svn')),
+-		list{end+1}=first_list(i).name;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/oshostname.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/oshostname.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/oshostname.m	(revision 12997)
+@@ -1,22 +0,0 @@
+-function hostname=oshostname()
+-%OSHOSTNAME figure out hostname, irrespective of os type
+-%
+-%   usage: hostname=oshostname();
+-%
+-%
+-
+-if ispc,
+-	[status,hostname]=system('hostname | sed ''s/-//g''');hostname=hostname(1:end-1);
+-
+-	if status, 
+-		error('oshostname error message: could not run hostname command on windows os');
+-	end
+-
+-else
+-	[status,hostname]=system(['hostname -s | sed ''s/-//g''']);
+-	if status, 
+-		error('oshostname error message: could not run hostname command on *nix os');
+-	end
+-	hostname=hostname(1:end-1);
+-	hostname=ddewhite(hostname);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpin.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpin.m	(revision 12997)
+@@ -1,48 +0,0 @@
+-function issmbbftpin(host, login,port,numstreams,path, packages)
+-%BBFTPIN get packages from host, using bbftp. assuming unix system here.
+-%
+-%   usage: scpin(host,packages,path)
+-%
+-%
+-
+-%first get hostname
+-hostname=oshostname();
+-
+-%first be sure packages are not in the current directory, this could conflict with pscp on windows. 
+-%get initial warning mode
+-state=warning('query', 'all');
+-%remove warnings in case the files do not exist
+-warning off
+-for i=1:numel(packages),
+-	delete(packages{i});
+-end
+-%back to initial warning state
+-warning(state);
+-
+-%if hostname and host are the same, do a simple copy
+-if strcmpi(hostname,host),
+-
+-    for i=1:numel(packages),
+-		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
+-	end
+-
+-else
+-
+-	%build a string of the type: bbftp -s -u elarour -e 'setnbstream 8; cd /nobackupp10/elarour/Testing/Interactive3/; get Antarctica.outbin' pfe1.nas.nasa.gov
+-	command=['!bbftp -s -V -u ' login ' -e ''setnbstream 8; cd ' path '; '];
+-	for i=1:length(packages),
+-		command=[command 'get ' packages{i} ';'];
+-	end
+-	command=[command '''  pfe1.nas.nasa.gov'];
+-	
+-	eval(command);
+-
+-	%check bbftp worked
+-	for i=1:numel(packages),
+-		if ~exist(['./' packages{i}]),
+-			error('scpin error message: could not call scp on *nix system');
+-		end
+-	end
+-
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpout.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/OS/issmbbftpout.m	(revision 12997)
+@@ -1,30 +0,0 @@
+-function issmbbftpout(host,path,login,port,numstreams,packages)
+-%BBFTPOUT put packages onto host, using bbftp. assuming unix system here.
+-%
+-%   usage: bbftpout(host,path,login,port,numstream,packages)
+-%
+-%
+-
+-%get hostname
+-hostname=oshostname();
+-
+-%if hostname and host are the same, do a simple copy
+-if strcmpi(host,hostname),
+-	for i=1:numel(packages),
+-		here=pwd;
+-		eval(['cd ' path])
+-		system(['rm -rf ' packages{i} ]);
+-		system(['ln -s ' here '/' packages{i} ' .']);
+-		eval(['cd ' here]);
+-	end
+-else 
+-	
+-	%build a string of the type: bbftp -s -u elarour -e 'setnbstream 8; cd /nobackupp10/elarour/Testing/Interactive3/; put Antarctica.tar.gz' pfe1.nas.nasa.gov
+-	command=['!bbftp -s -V -u ' login ' -e ''setnbstream 8; cd ' path '; ']
+-	for i=1:length(packages),
+-		command=[command 'put ' packages{i} ';'];
+-	end
+-	command=[command '''  pfe1.nas.nasa.gov'];
+-	
+-	eval(command);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.py	(revision 12997)
+@@ -1,25 +0,0 @@
+-#! /usr/bin/env python
+-def parallelrange(rank,numprocs,globalsize):
+-	"""
+-	PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
+- 
+-	   Usage: 
+-	      i1,i2=parallelrange(rank,numprocs,globalsize)
+-	"""
+-
+-	#We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
+-	num_local_rows=[int(globalsize/numprocs) for i in xrange(numprocs)]
+-
+-	#There may be some rows left. Distribute evenly.
+-	row_rest=globalsize - numprocs*int(globalsize/numprocs)
+-
+-	for i in xrange(row_rest):
+-		num_local_rows[i]=num_local_rows[i]+1
+-
+-	i1=0
+-	for i in xrange(rank-1):
+-		i1+=num_local_rows[i]
+-	i2=i1+num_local_rows[rank-1]-1
+-
+-	return i1,i2
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/QueueRequirements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/QueueRequirements.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/QueueRequirements.m	(revision 12997)
+@@ -1,35 +0,0 @@
+-function QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,queue,np,time)
+-%QUEUEREQUIREMENTS - queue requirements in time, number of cpus, by name of queue.
+-%
+-%   Usage: 
+-%      QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,np,time)
+-
+-%Ok, go through requirements for current queue:
+-index=ismemberi(queue,available_queues);
+-if  ~index,
+-	%ok, either we a generic cluster, with 'none' queue, or we could not find the queue reqruirements
+-	if strcmpi(available_queues{1},'none'),
+-		%reset index to 1, so we can fish the requirements
+-		index=1;
+-	else
+-		string=available_queues{1};
+-		for i=2:length(available_queues),
+-			string=[string ' ' available_queues{i}];
+-		end
+-		error(['QueueRequirements error message: availables queues are ' string]);
+-	end
+-end
+-
+-%check on time requirements
+-rtime=queue_requirements_time(index);
+-if time<=0,
+-	error('QueueRequirements: time should be a positive number');
+-end
+-if time>rtime,
+-	error(['QueueRequirements: time should be < ' num2str(rtime) ' for queue: ' queue]);
+-end
+-
+-%check on np requirements
+-if np<=0,
+-	error('QueueRequirements: np should be a positive number');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Cluster/parallelrange.m	(revision 12997)
+@@ -1,23 +0,0 @@
+-function [i1,i2]=parallelrange(rank,numprocs,globalsize)
+-%PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
+-%
+-%   Usage: 
+-%      [i1,i1]=parallelrange(rank,numprocs,globalsize)
+-
+-num_local_rows=zeros(numprocs,1);
+-
+-for i=1:numprocs,
+-	%we use floor. we under distribute rows. The rows left  are then redistributed, therefore resulting in a more even distribution.
+-	num_local_rows(i)=floor(globalsize/numprocs);
+-end
+-
+-
+-%There may be some rows left. Distribute evenly.
+-row_rest=globalsize - numprocs*floor(globalsize/numprocs);
+-
+-for i=1:row_rest,
+-	num_local_rows(i)=num_local_rows(i)+1;
+-end
+-
+-i1=sum(num_local_rows(1:rank-1))+1;
+-i2=i1+num_local_rows(rank)-1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2expg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2expg.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2expg.m	(revision 12997)
+@@ -1,13 +0,0 @@
+-function kml2expg(filename)
+-
+-	[path,name,ext]=fileparts(filename);
+-
+-	if strcmpi(ext,'.kmz'),
+-		eval(['!unzip ' filename]);
+-		eval(['!mv doc.kml ' name '.kml']);
+-		kml2exp([name '.kml'],[name '.exp']);
+-		expll2xy([name '.exp'],1);
+-	end
+-
+-	kml2exp([name '.kml'],[name '.exp']);
+-	expll2xy([name '.exp'],1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/exp2kml.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/exp2kml.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/exp2kml.m	(revision 12997)
+@@ -1,19 +0,0 @@
+-function exp2kml(input,output)
+-%EXP2KML: transform Argus exp file to kml
+-%
+-% Usage:    exp2kml('temp.exp','temp2.kml')
+-%
+-%
+-
+-
+-%First, read exp file
+-domain=expread(input);
+-
+-
+-%then transform: 
+-string=ge_plot(domain.x,domain.y,'name',domain.name);
+-
+-%open kml file for writing: 
+-fid=fopen(output,'w');
+-fprintf(fid,'%s',string);
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2exp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2exp.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Kml/kml2exp.m	(revision 12997)
+@@ -1,29 +0,0 @@
+-function kml2exp(input,output)
+-%KML2EXP: transform kml file Argus exp file.
+-%
+-% Usage:    kmltoexp('temp.kml','temp2.exp')
+-%
+-%
+-
+-
+-
+-
+-%First, read polygon kml file.
+-structure=kml_shapefile(input);
+-	
+-%create exp file: 
+-domain=struct();
+-for i=1:length(structure),
+-
+-	if isfield(structure,'name'),
+-		domain(end+1).name=structure(i).name;
+-	else
+-		domain(end+1).name='NaN';
+-	end
+-
+-	domain(end).density=1;
+-	domain(end).x=structure(i).X;
+-	domain(end).y=structure(i).Y;
+-end
+-domain=domain(2:end);
+-expwrite(domain,output);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetMarineIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetMarineIceSheetBC.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetMarineIceSheetBC.m	(revision 12997)
+@@ -1,107 +0,0 @@
+-function md=SetMarineIceSheetBC(md,varargin)
+-%SETICEMARINESHEETBC - Create the boundary conditions for diagnostic and thermal models for a  Marine Ice Sheet with Ice Front
+-%
+-%   Neumann BC are used on the ice front (an ARGUS contour around the ice front
+-%   can be given in input, or it will be deduced as onfloatingice & onboundary)
+-%   Dirichlet BC are used elsewhere for diagnostic
+-%
+-%   Usage:
+-%      md=SetMarineIceSheetBC(md,icefrontfile)
+-%      md=SetMarineIceSheetBC(md)
+-%
+-%   Example:
+-%      md=SetMarineIceSheetBC(md,'Front.exp')
+-%      md=SetMarineIceSheetBC(md)
+-%
+-%   See also: SETICESHELFBC, SETMARINEICESHEETBC
+-
+-%node on Dirichlet (boundary and ~icefront)
+-if nargin==2,
+-	%User provided Front.exp, use it
+-	icefrontfile=varargin{1};
+-	if ~exist(icefrontfile)
+-		error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']);
+-	end
+-	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2);
+-	vertexonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
+-else
+-	%Guess where the ice front is
+-	vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
+-	vertexonfloatingice(md.mesh.elements(find(md.mask.elementonfloatingice),:))=1;
+-	vertexonicefront=double(md.mesh.vertexonboundary & vertexonfloatingice);
+-end
+-pos=find(md.mesh.vertexonboundary & ~vertexonicefront);
+-if isempty(pos),
+-	warning('SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually')
+-end
+-md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvx(pos)=0;
+-md.diagnostic.spcvy(pos)=0;
+-md.diagnostic.spcvz(pos)=0;
+-md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
+-
+-%Dirichlet Values
+-if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
+-	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
+-	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
+-	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
+-else
+-	disp('      boundary conditions for diagnostic model: spc set as zero');
+-end
+-
+-md.hydrology.spcwatercolumn=zeros(md.mesh.numberofvertices,2);
+-pos=find(md.mesh.vertexonboundary); 
+-md.hydrology.spcwatercolumn(pos,1)=1;
+-
+-%segment on Neumann (Ice Front)
+-pos=find(vertexonicefront(md.mesh.segments(:,1)) | vertexonicefront(md.mesh.segments(:,2)));
+-if (md.mesh.dimension==2)
+-	pressureload=md.mesh.segments(pos,:);
+-elseif md.mesh.dimension==3
+-	pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
+-	pressureload=[];
+-	for i=1:md.mesh.numberoflayers-1,
+-		pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
+-	end
+-end
+-
+-%Add water or air enum depending on the element
+-pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))+ 0*md.mask.elementongroundedice(pressureload(:,end))];
+-
+-%plug onto model
+-md.diagnostic.icefront=pressureload;
+-
+-
+-%Create zeros basalforcings and surfaceforcings
+-if (isnan(md.surfaceforcings.precipitation)& (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
+-	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.precipitation specified: values set as zero');
+-end
+-if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
+-	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.mass_balance specified: values set as zero');
+-end
+-if isnan(md.basalforcings.melting_rate),
+-	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no basalforcings.melting_rate specified: values set as zero');
+-end
+-if isnan(md.balancethickness.thickening_rate),
+-	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no balancethickness.thickening_rate specified: values set as zero');
+-end
+-
+-md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-
+-if (length(md.initialization.temperature)==md.mesh.numberofvertices),
+-	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
+-	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
+-	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
+-		md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1);
+-		md.basalforcings.geothermalflux(find(md.mask.vertexongroundedice))=50*10^-3; %50mW/m2
+-	end
+-else
+-	disp('      no thermal boundary conditions created: no observed temperature found');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceSheetBC.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceSheetBC.m	(revision 12997)
+@@ -1,64 +0,0 @@
+-function md=SetIceSheetBC(md)
+-%SETICESHEETBC - Create the boundary conditions for diagnostic and thermal models for an IceSheet with no Ice Front
+-%
+-%   Usage:
+-%      md=SetIceSheetBC(md)
+-%
+-%   See also: SETICESHELFBC, SETMARINEICESHEETBC
+-
+-%node on Dirichlet
+-pos=find(md.mesh.vertexonboundary);
+-md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvx(pos)=0;
+-md.diagnostic.spcvy(pos)=0;
+-md.diagnostic.spcvz(pos)=0;
+-md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
+-
+-%Dirichlet Values
+-if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
+-	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
+-	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
+-	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
+-else
+-	disp('      boundary conditions for diagnostic model: spc set as zero');
+-end
+-
+-%segment on neumann (Ice Front) -> none
+-if (md.mesh.dimension==2)
+-	md.diagnostic.icefront=zeros(0,4);
+-else
+-	md.diagnostic.icefront=zeros(0,6);
+-end
+-
+-%Create zeros basal melting rate and surface mass balance if not specified
+-if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
+-	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.precipitation specified: values set as zero');
+-end
+-if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
+-	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.mass_balance specified: values set as zero');
+-end
+-if isnan(md.basalforcings.melting_rate),
+-	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no basalforcings.melting_rate specified: values set as zero');
+-end
+-if isnan(md.balancethickness.thickening_rate),
+-	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no balancethickness.thickening_rate specified: values set as zero');
+-end
+-
+-md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-
+-if (length(md.initialization.temperature)==md.mesh.numberofvertices),
+-	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
+-	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
+-	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
+-		md.basalforcings.geothermalflux=50*10^-3*ones(md.mesh.numberofvertices,1); %50 mW/m^2
+-	end
+-else
+-	disp('      no thermal boundary conditions created: no observed temperature found');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.py	(revision 12997)
+@@ -1,98 +0,0 @@
+-import os
+-import numpy
+-
+-def SetIceShelfBC(md,icefrontfile=''):
+-	"""
+-	SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
+-
+-	   Neumann BC are used on the ice front (an ANRGUS contour around the ice front
+-	   must be given in input)
+-	   Dirichlet BC are used elsewhere for diagnostic
+-
+-	   Usage:
+-	      md=SetIceShelfBC(md,varargin)
+-
+-	   Example:
+-	      md=SetIceShelfBC(md);
+-	      md=SetIceShelfBC(md,'Front.exp');
+-
+-	   See also: SETICESHEETBC, SETMARINEICESHEETBC
+-	"""
+-
+-	#node on Dirichlet (boundary and ~icefront)
+-	if icefrontfile:
+-		if not os.path.exists(icefrontfile):
+-			raise IOError("SetIceShelfBC error message: ice front file '%s' not found." % icefrontfile)
+-		nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2)
+-		nodeonicefront=double(md.mesh.vertexonboundary and nodeinsideicefront)
+-	else:
+-		nodeonicefront=numpy.zeros(md.mesh.numberofvertices)
+-
+-#	pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
+-	pos=[i for i,(vob,noif) in enumerate(zip(md.mesh.vertexonboundary,nodeonicefront)) if vob and not noif]
+-	md.diagnostic.spcvx=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-	md.diagnostic.spcvy=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-	md.diagnostic.spcvz=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-	md.diagnostic.spcvx[pos]=0
+-	md.diagnostic.spcvy[pos]=0
+-	md.diagnostic.spcvz[pos]=0
+-	md.diagnostic.referential=float('NaN')*numpy.ones((md.mesh.numberofvertices,6))
+-
+-	#Dirichlet Values
+-	if numpy.size(md.inversion.vx_obs)==md.mesh.numberofvertices and numpy.size(md.inversion.vy_obs)==md.mesh.numberofvertices:
+-		print '      boundary conditions for diagnostic model: spc set as observed velocities'
+-		md.diagnostic.spcvx[pos]=md.inversion.vx_obs[pos]
+-		md.diagnostic.spcvy[pos]=md.inversion.vy_obs[pos]
+-	else:
+-		print '      boundary conditions for diagnostic model: spc set as zero'
+-
+-	#segment on Ice Front
+-	#segment on Neumann (Ice Front)
+-#	pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
+-	pos=[i for i,(noif1,noif2) in enumerate(zip(nodeonicefront[md.mesh.segments[:,0].astype('int')-1],nodeonicefront[md.mesh.segments[:,1].astype('int')-1])) if noif1 or noif2]
+-	if   md.mesh.dimension==2:
+-		pressureload=md.mesh.segments[pos,:]
+-	elif md.mesh.dimension==3:
+-#		pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
+-		pressureload_layer1=numpy.concatenate((md.mesh.segments[pos,0:2],md.mesh.segments[pos,1]+md.mesh.numberofvertices2d,md.mesh.segments[pos,0]+md.mesh.numberofvertices2d,md.mesh.segments[pos,2]),axis=1)
+-		pressureload=numpy.zeros((0,5))
+-		for i in xrange(1,md.mesh.numberoflayers):
+-#			pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
+-			pressureload=numpy.concatenate((pressureload,numpy.concatenate((pressureload_layer1[:,0:3]+(i-1)*md.mesh.numberofvertices2d,pressureload_layer1[:,4]+(i-1)*md.mesh.numberofelements2d),axis=1)),axis=0)
+-
+-	#Add water or air enum depending on the element
+-#	pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))];
+-	pressureload=numpy.concatenate((pressureload,1*md.mask.elementonfloatingice[pressureload[:,-1].astype('int')-1].reshape((-1,1))),axis=1)
+-
+-	#plug onto model
+-	md.diagnostic.icefront=pressureload
+-
+-	#Create zeros basalforcings and surfaceforcings
+-	if numpy.isnan(md.surfaceforcings.precipitation).all():
+-		md.surfaceforcings.precipitation=numpy.zeros(md.mesh.numberofvertices)
+-		print '      no surfaceforcings.precipitation specified: values set as zero'
+-	if numpy.isnan(md.surfaceforcings.mass_balance).all():
+-		md.surfaceforcings.mass_balance=numpy.zeros(md.mesh.numberofvertices)
+-		print '      no surfaceforcings.mass_balance specified: values set as zero'
+-	if numpy.isnan(md.basalforcings.melting_rate).all():
+-		md.basalforcings.melting_rate=numpy.zeros(md.mesh.numberofvertices)
+-		print '      no basalforcings.melting_rate specified: values set as zero'
+-	if numpy.isnan(md.balancethickness.thickening_rate).all():
+-		md.balancethickness.thickening_rate=numpy.zeros(md.mesh.numberofvertices)
+-		print '      no balancethickness.thickening_rate specified: values set as zero'
+-
+-	md.prognostic.spcthickness=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-	md.balancethickness.spcthickness=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-
+-	if numpy.size(md.initialization.temperature)==md.mesh.numberofvertices:
+-		md.thermal.spctemperature=float('NaN')*numpy.ones(md.mesh.numberofvertices)
+-#		pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
+-		pos=[i for i,vos in enumerate(md.mesh.vertexonsurface) if vos]
+-		md.thermal.spctemperature[pos]=md.initialization.temperature[pos]    # impose observed temperature on surface
+-		if not numpy.size(md.basalforcings.geothermalflux)==md.mesh.numberofvertices:
+-			md.basalforcings.geothermalflux=numpy.zeros(md.mesh.numberofvertices)
+-	else:
+-		print '      no thermal boundary conditions created: no observed temperature found'
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/BC/SetIceShelfBC.m	(revision 12997)
+@@ -1,95 +0,0 @@
+-function md=SetIceShelfBC(md,varargin)
+-%SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
+-%
+-%   Neumann BC are used on the ice front (an ANRGUS contour around the ice front
+-%   must be given in input)
+-%   Dirichlet BC are used elsewhere for diagnostic
+-%
+-%   Usage:
+-%      md=SetIceShelfBC(md,varargin)
+-%
+-%   Example:
+-%      md=SetIceShelfBC(md);
+-%      md=SetIceShelfBC(md,'Front.exp');
+-%
+-%   See also: SETICESHEETBC, SETMARINEICESHEETBC
+-
+-%node on Dirichlet (boundary and ~icefront)
+-if nargin==2,
+-	icefrontfile=varargin{1};
+-	if ~exist(icefrontfile), error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']); end
+-	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2);
+-	nodeonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
+-elseif nargin==1,
+-	nodeonicefront=zeros(md.mesh.numberofvertices,1);
+-else
+-	help SetIceShelfBC
+-	error('bad usage');
+-end
+-pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
+-md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
+-md.diagnostic.spcvx(pos)=0;
+-md.diagnostic.spcvy(pos)=0;
+-md.diagnostic.spcvz(pos)=0;
+-md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
+-
+-%Dirichlet Values
+-if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
+-	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
+-	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
+-	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
+-else
+-	disp('      boundary conditions for diagnostic model: spc set as zero');
+-end
+-
+-%segment on Ice Front
+-%segment on Neumann (Ice Front)
+-pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
+-if (md.mesh.dimension==2)
+-	pressureload=md.mesh.segments(pos,:);
+-elseif md.mesh.dimension==3
+-	pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
+-	pressureload=[];
+-	for i=1:md.mesh.numberoflayers-1,
+-		pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
+-	end
+-end
+-
+-%Add water or air enum depending on the element
+-pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))];
+-
+-%plug onto model
+-md.diagnostic.icefront=pressureload;
+-
+-%Create zeros basalforcings and surfaceforcings
+-if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
+-	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+-	disp('      no surfaceforcings.precipitation specified: values set as zero');
+-end
+-if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
+-	        md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+-		disp('      no surfaceforcings.mass_balance specified: values set as zero');
+-end
+-if isnan(md.basalforcings.melting_rate),
+-	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no basalforcings.melting_rate specified: values set as zero');
+-end
+-if isnan(md.balancethickness.thickening_rate),
+-	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
+-	disp('      no balancethickness.thickening_rate specified: values set as zero');
+-end
+-
+-md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+-
+-if (length(md.initialization.temperature)==md.mesh.numberofvertices),
+-	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
+-	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
+-	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
+-		md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1);
+-	end
+-else
+-	disp('      no thermal boundary conditions created: no observed temperature found');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics/cfl_step.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics/cfl_step.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Numerics/cfl_step.m	(revision 12997)
+@@ -1,23 +0,0 @@
+-function maxtime=cfl_step(md,vx,vy);
+-%CFL_STEP - return the maximum time step for the model in years
+-%
+-%   Dt < 0.5 / ( u/Dx +v/Dy )
+-%
+-%   Usage:
+-%      maxtime=cfl_step(md,vx,vy);
+-%
+-%   Example:
+-%      dt=cfl_step(md,md.results.DiagnosticSolution.Vx,md.results.DiagnosticSolution.Vy)
+-
+-%Check length of velocities 
+-if size(vx,1)~=md.mesh.numberofvertices & size(vy,1)~=md.mesh.numberofvertices,
+-	error('timestpes error message: size of velocity components must be the same as md.mesh.numberofvertices');
+-end
+-
+-index=md.mesh.elements;
+-edgex=max(md.mesh.x(index),[],2)-min(md.mesh.x(index),[],2);
+-edgey=max(md.mesh.y(index),[],2)-min(md.mesh.y(index),[],2);
+-vx=max(abs(vx(index)),[],2);
+-vy=max(abs(vy(index)),[],2);
+-
+-maxtime=1/2*min(1./(vx./edgex+vy./edgey));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.py	(revision 12997)
+@@ -1,18 +0,0 @@
+-import numpy
+-
+-def isnans(array):
+-	"""
+-	ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
+-
+-	   Usage:    isnans(array)
+-
+-	      See also : ISNAN 
+-	"""
+-
+-	if   isinstance(array,(tuple,list,dict)): 
+-		returnvalue=0
+-	else:
+-		returnvalue=numpy.isnan(array)
+-
+-	return returnvalue
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/round_ice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/round_ice.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/round_ice.m	(revision 12997)
+@@ -1,38 +0,0 @@
+-function new_x=round_ice(x,numnonzeros)
+-%ROUND_ICE - rounds up x so that it has only numnonzeros non zero digits
+-%
+-%   numnonzeros must be an integer larger or equal to 1
+-%
+-%   Usage:
+-%      new_x=round_ice(x,numnonzeros)
+-
+-%some checks
+-if (nargin ~=2 | nargout>1),
+-	error('round_ice usage: new_x=round_ice(x,numonzeros)');
+-end
+-if ~isnumeric(x)
+-	error('round_ice error message: x must be a number and numzeros an integer');
+-end
+-if round(numnonzeros)~=numnonzeros
+-	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
+-end
+-if any(numnonzeros<1)
+-	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
+-end
+-if (length(numnonzeros)~=1 & size(numnonzeros)~=size(x))
+-	error('round_ice error message: numnonzeros must be an integer larger or equal to 1 or a list of integers of length length(x)')
+-end
+-
+-%figure out how long x is
+-lengthx=ceil(log10(abs(x)));
+-
+-%if x contains 0, lengthx=-Inf
+-lengthx(isinf(lengthx))=1;
+-
+-%get its sign
+-si=sign(x);
+-
+-%rule out zeros
+-new_x=si.*round(abs(x).*10.^(-lengthx+numnonzeros)).*10.^(lengthx-numnonzeros);
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/isnans.m	(revision 12997)
+@@ -1,15 +0,0 @@
+-function returnvalue=isnans(array)
+-%ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
+-%
+-%  Usage:    isnans(array)
+-%
+-%  See also : ISNAN 
+-
+-
+-if isstruct(array), 
+-	returnvalue=0;
+-elseif iscell(array)
+-	returnvalue=0;
+-else
+-	returnvalue=isnan(array);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/fixdec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/fixdec.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Math/fixdec.m	(revision 12997)
+@@ -1,41 +0,0 @@
+-function y = fixdec(x, n)
+-%FIXDEC -  Round towards zero with a specified number of decimals.
+-%
+-%   This routine rounds the elements of X to N decimals.
+-%
+-%   Usage:
+-%      y = fixdec(x, n)
+-%
+-%   Example:
+-%      fixdec(10*sqrt(2) + i*pi/10, 4) returns 14.1421 + 0.3141i
+-%
+-%   See also: FIX, FLOOR, CEIL, ROUND, FIXDIG, ROUNDDEC, ROUNDDIG.
+-
+-%   Author:      Peter J. Acklam
+-%   Time-stamp:  2004-09-22 20:08:10 +0200
+-%   E-mail:      pjacklam@online.no
+-%   URL:         http://home.online.no/~pjacklam
+-
+-   % Check number of input arguments.
+-   error(nargchk(2, 2, nargin));
+-
+-   % Quick exit if either argument is empty.
+-   if (isempty(x) |isempty(n))
+-      y = [];
+-      return
+-   end
+-
+-   % Get size of input arguments.
+-   size_x   = size(x);
+-   size_n   = size(n);
+-   scalar_x = all(size_x == 1);           % True if x is a scalar.
+-   scalar_n = all(size_n == 1);           % True if n is a scalar.
+-
+-   % Check size of input arguments.
+-   if ~scalar_x & ~scalar_n & ~isequal(size_x, size_n)
+-      error(['When both arguments are non-scalars they must have' ...
+-             ' the same size']);
+-   end
+-
+-   f = 10.^n;
+-   y = fix(x .* f) ./ f;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.m	(revision 12997)
+@@ -1,57 +0,0 @@
+-function flag=FlagElements(md,region),
+-%FLAGELEMENTS - flag the elements in an region
+-%
+-%   The region can be given with an exp file, a list of elements.
+-%
+-%   Usage: 
+-%      flag=FlagElements(md,region);
+-%
+-%   Example:
+-%      flag=FlagElements(md,'all');
+-%      flag=FlagElements(md,'');
+-%      flag=FlagElements(md,'Domain.exp');
+-%      flag=FlagElements(md,'~Domain.exp');
+-%      flag=FlagElements(md,md.mask.elementongroundedice);
+-
+-	if ischar(region),
+-		if isempty(region),
+-			flag=zeros(md.mesh.numberofelements,1);
+-			invert=0;
+-		elseif strcmpi(region,'all')
+-			flag=ones(md.mesh.numberofelements,1);
+-			invert=0;
+-		else
+-			%make sure that we actually don't want the elements outside the domain outline!
+-			if strcmpi(region(1),'~'),
+-				region=region(2:length(region));
+-				invert=1;
+-			else
+-				invert=0;
+-			end
+-
+-			%does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
+-			if ~exist(region,'file'),
+-				if (length(region)>3 & ~strcmp(region(end-3),'.exp')),
+-					error(['Error: File ' region ' not found!']);
+-				end
+-				[xlim,ylim]=basinzoom('basin',region);
+-				flag_nodes=double(md.mesh.x<xlim(2) & md.mesh.x>xlim(1) &  md.mesh.y<ylim(2) & md.mesh.y>ylim(1));
+-				flag=prod(flag_nodes(md.mesh.elements),2);
+-			else
+-				%ok, flag elements
+-				flag=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,region,'element',1);
+-			end
+-		end
+-		if invert,
+-			flag=~flag;
+-		end
+-	elseif isfloat(region) | islogical(region),
+-		if size(region,1)~=md.mesh.numberofelements,
+-			help FlagElements
+-			error('Flaglist for region must be of same size as number of elements in model');
+-		end
+-		flag=region;
+-	else
+-		error('Invalid region option');
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/find_point.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/find_point.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/find_point.m	(revision 12997)
+@@ -1,14 +0,0 @@
+-function f=find_point(tabx,taby,pointx,pointy)
+-%FIND_POINT - find closest point
+-%
+-%   find which point of the list (tabx,taby) is
+-%   the closest to (poinx,pointy)
+-%
+-%   Usage:
+-%      f=find_point(tabx,taby,pointx,pointy)
+-
+-%Compute distance between point and cloud of points
+-distance=sqrt((tabx-pointx).^2+(taby-pointy).^2);
+-
+-%find index of the minimum distance and return the first one only
+-f=find(distance==min(min(distance)),1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/SegIntersect.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/SegIntersect.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/SegIntersect.m	(revision 12997)
+@@ -1,81 +0,0 @@
+-function bool=SegIntersect(seg1,seg2)
+-%SEGINTERSECT - test of segments intersection
+-%
+-%   return 1 if the two segments intersect
+-%   seg1=[x1 y1; x2 y2]
+-%   seg2=[x1 y1; x2 y2]
+-%
+-%   Usage:
+-%      bool=SegIntersect(seg1,seg2)
+-
+-bool=1;
+-
+-xA=seg1(1,1); yA=seg1(1,2);
+-xB=seg1(2,1); yB=seg1(2,2);
+-xC=seg2(1,1); yC=seg2(1,2);
+-xD=seg2(2,1); yD=seg2(2,2);
+-
+-O2A=[xA;yA]-[xD/2+xC/2;yD/2+yC/2];
+-O2B=[xB;yB]-[xD/2+xC/2;yD/2+yC/2];
+-O1C=[xC;yC]-[xA/2+xB/2;yB/2+yA/2];
+-O1D=[xD;yD]-[xA/2+xB/2;yB/2+yA/2];
+-
+-n1=[yA-yB;xB-xA]; %normal vector to segA
+-n2=[yC-yD;xD-xC]; %normal vectot to segB
+-
+-test1=n2'*O2A;
+-test2=n2'*O2B;
+-
+-if test1*test2>0
+-	bool=0;
+-	return;
+-end
+-
+-test3=n1'*O1C;
+-test4=n1'*O1D;
+-
+-if test3*test4>0
+-	bool=0;
+-	return;
+-end
+-
+-%if colinear
+-if test1*test2==0 & test3*test4==0 & det([n1 n2])==0
+-
+-	%projection on the axis O1O2
+-	O2O1=[xA/2+xB/2;yB/2+yA/2]-[xD/2+xC/2;yD/2+yC/2];
+-	O1A=O2O1'*(O2A-O2O1);
+-	O1B=O2O1'*(O2B-O2O1);
+-	O1C=O2O1'*O1C;
+-	O1D=O2O1'*O1D;
+-	
+-	%test if one point is included in the other segment (->bool=1)
+-	if (O1C-O1A)*(O1D-O1A)<0
+-		bool=1;
+-		return;
+-	end
+-	if (O1C-O1B)*(O1D-O1B)<0
+-		bool=1;
+-		return;
+-	end
+-	if (O1A-O1C)*(O1B-O1C)<0
+-		bool=1;
+-		return;
+-	end
+-	if (O1A-O1D)*(O1B-O1D)<0
+-		bool=1;
+-		return;
+-	end
+-
+-	 %test if the 2 segments have the same middle (->bool=1)
+-	if O2O1==0
+-		bool=1;
+-		return;
+-	end
+-
+-	%else
+-	bool=0;
+-	return;
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Geometry/FlagElements.py	(revision 12997)
+@@ -1,62 +0,0 @@
+-import numpy
+-import os
+-#from basinzoom import *
+-#from ContourToMesh import *
+-from MatlabFuncs import *
+-
+-def FlagElements(md,region):
+-	"""
+-	FLAGELEMENTS - flag the elements in an region
+-
+-	   The region can be given with an exp file, a list of elements.
+-
+-	   Usage: 
+-	      flag=FlagElements(md,region);
+-
+-	   Example:
+-	      flag=FlagElements(md,'all');
+-	      flag=FlagElements(md,'');
+-	      flag=FlagElements(md,'Domain.exp');
+-	      flag=FlagElements(md,'~Domain.exp');
+-	      flag=FlagElements(md,md.mask.elementongroundedice);
+-	"""
+-
+-	if   isinstance(region,str):
+-		if   not region:
+-			flag=numpy.zeros(md.mesh.numberofelements,'bool')
+-			invert=0
+-		elif strcmpi(region,'all'):
+-			flag=numpy.ones(md.mesh.numberofelements,'bool')
+-			invert=0
+-		else:
+-			#make sure that we actually don't want the elements outside the domain outline!
+-			if strcmpi(region[0],'~'):
+-				region=region[1:]
+-				invert=1
+-			else:
+-				invert=0
+-
+-			#does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
+-			if not os.path.exists(region):
+-				if len(region)>3 and not strcmp(region[-4:],'.exp'):
+-					raise IOError("Error: File 'region' not found!" % region)
+-				xlim,ylim=basinzoom('basin',region)
+-				flag_nodes=numpy.logical_and(numpy.logical_and(md.mesh.x<xlim[1],md.mesh.x>xlim[0]),numpy.logical_and(md.mesh.y<ylim[1],md.mesh.y>ylim[0])).astype(float)
+-				flag=numpy.prod(flag_nodes[md.mesh.elements],axis=1)
+-			else:
+-				#ok, flag elements
+-				flag=ContourToMesh(md.mesh.elements[:,0:3],md.mesh.x,md.mesh.y,region,'element',1)
+-
+-		if invert:
+-			flag=numpy.logical_not(flag)
+-
+-	elif isinstance(region,numpy.nparray) or isinstance(region,bool):
+-		if not numpy.size(region,0)==md.mesh.numberofelements:
+-			raise TypeError("Flaglist for region must be of same size as number of elements in model.")
+-		flag=region
+-
+-	else:
+-		raise TypeError("Invalid region option")
+-
+-	return flag
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/ecco32issm.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/ecco32issm.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/ecco32issm.m	(revision 12997)
+@@ -1,8 +0,0 @@
+-function nodefield=ecco32issm(field,transition,xecco3,yecco3)
+-
+-	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
+-	nodefieldlinear=zeros(length(xecco3linear),1);
+-	nodefieldlinear(transition(:,1))=field(transition(:,2));
+-	nodefield=xecco3;
+-	nodefield(:)=nodefieldlinear;
+-	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/issm2ecco3.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/issm2ecco3.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Ecco3/issm2ecco3.m	(revision 12997)
+@@ -1,8 +0,0 @@
+-function nodefield=issm2ecco3(field,transition,xecco3,yecco3)
+-
+-	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
+-	nodefieldlinear=zeros(length(xecco3linear),1);
+-	nodefieldlinear(transition(:,1))=field(transition(:,2));
+-	nodefield=xecco3;
+-	nodefield(:)=nodefieldlinear;
+-	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expremovestraightsegments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expremovestraightsegments.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expremovestraightsegments.m	(revision 12997)
+@@ -1,31 +0,0 @@
+-function expremovestraightsegments(newfilename,filename,cutoff)
+-%EXPREMOVESTRAIGHTSEGMENTS:  remove straight segments connecting contours.
+-%
+-% Usage: expremovestraightsegments('argus.exp',100); 
+-%
+-%
+-
+-a=expread(filename,1);
+-newcontours=a(1);
+-
+-for i=1:length(a),
+-	contour=a(i);
+-	
+-	s=sqrt(contour.x.^2+contour.y.^2);
+-	d=diff(s);
+-	
+-	pos=find(abs(d)>cutoff);
+-	pos=[0;pos;length(contour.x)];
+-
+-	for j=1:length(pos)-1,
+-
+-		newcontour=contour;
+-		newcontour.x=contour.x(pos(j)+1:pos(j+1));
+-		newcontour.y=contour.y(pos(j)+1:pos(j+1));
+-		newcontour.nods=length(newcontour.x);
+-		newcontours(end+1)=newcontour;
+-	end
+-end
+-newcontours=newcontours(2:end);
+-
+-expwrite(newcontours,newfilename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expgen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expgen.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expgen.m	(revision 12997)
+@@ -1,47 +0,0 @@
+-function expgen(file_name,contours,close_flag);
+-%EXPGEN - create an Argus file from x and y arrays
+-%
+-%   Create .exp domain outline type out of x,y  coordinates. 
+-%   The contour defined by arrays x and y should not be closed. 
+-%   Generated domain outline will not be closed, except if close_flag is set to 1.
+-%
+-%   Usage:
+-%      expgen(file_name,contours,close_flag)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%Check on inputs
+-if((close_flag~=0) & (close_flag~=1)),
+-error('close flag must be 0 of 1');
+-end
+-fid=fopen(file_name,'wt');
+-
+-for i=1:length(contours),
+-	if(length(contours(i).x)~=length(contours(i).y)),
+-	error('contours x and y coordinates must be of identical size');
+-	end
+-
+-	%get density for this profile.
+-	if isfield(contours,'density'),
+-		density=contours(i).density;
+-	end
+-
+-	fprintf(fid,'%s\n','## Name:');
+-	fprintf(fid,'%s\n','## Icon:0');
+-	fprintf(fid,'%s\n','# Points Count Value');
+-	if(close_flag==0),
+-	fprintf(fid,'%i %i\n',length(contours(i).x),density);
+-	else
+-	fprintf(fid,'%i %i\n',length(contours(i).x)+1,density);
+-	end
+-	fprintf(fid,'%s\n','# X pos Y pos');
+-	for j=1:length(contours(i).x),
+-	 fprintf(fid,'%f %f\n',contours(i).x(j),contours(i).y(j));
+-	end  
+-
+-	if(close_flag==1),
+-	fprintf(fid,'%f %f\n',contours(i).x(1),contours(i).y(1));
+-	end
+-	fprintf(fid,'%s\n','');
+-end
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expxy2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expxy2ll.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expxy2ll.m	(revision 12997)
+@@ -1,37 +0,0 @@
+-function expxy2ll(filename,sgn,central_meridian,standard_parallel)  
+-%EXPLL2XY: switch exp argus file from lat,long to x,y
+-%   Usage:
+-%      expxy2ll(filename,sgn,central_meridian,standard_parallel)
+-%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
+-%                               -1 : south latitude (default is mer=0  lat=71)
+-
+-
+-%Get central_meridian and standard_parallel depending on hemisphere
+-if nargin==4,
+-	delta = central_meridian;
+-	slat  = standard_parallel;
+-elseif nargin==2
+-	if sgn == 1,
+-		delta = 45; slat = 70;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-	elseif sgn==-1,
+-		delta = 0;  slat = 71;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
+-	else
+-		error('Sign should be either +1 or -1');
+-	end
+-else
+-	help expxy2ll
+-	error('bad usage');
+-end
+-
+-%read filename: 
+-domain=expread(filename);
+-
+-%change to x,y: 
+-for i=1:length(domain),
+-	[domain(i).y domain(i).x]= xy2ll(domain(i).x,domain(i).y,sgn,delta,slat); %watch out to swap lat and long
+-end
+-
+-%write back to filename: 
+-expwrite(domain,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expll2xy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expll2xy.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expll2xy.m	(revision 12997)
+@@ -1,37 +0,0 @@
+-function expll2xy(filename,sgn,central_meridian,standard_parallel)  
+-%EXPLL2XY: switch exp argus file from lat,long to x,y
+-%   Usage:
+-%      expll2xy(filename,sgn,central_meridian,standard_parallel)
+-%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
+-%                               -1 : south latitude (default is mer=0  lat=71)
+-
+-
+-%Get central_meridian and standard_parallel depending on hemisphere
+-if nargin==4,
+-	delta = central_meridian;
+-	slat  = standard_parallel;
+-elseif nargin==2
+-	if sgn == 1,
+-		delta = 45; slat = 70;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-	elseif sgn==-1,
+-		delta = 0;  slat = 71;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
+-	else
+-		error('Sign should be either +1 or -1');
+-	end
+-else
+-	help expll2xy
+-	error('bad usage');
+-end
+-
+-%read filename: 
+-domain=expread(filename);
+-
+-%change to x,y: 
+-for i=1:length(domain),
+-	[domain(i).x domain(i).y]= ll2xy(domain(i).y,domain(i).x,sgn,delta,slat);
+-end
+-
+-%write back to filename: 
+-expwrite(domain,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/clicktoflowline.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/clicktoflowline.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/clicktoflowline.m	(revision 12997)
+@@ -1,24 +0,0 @@
+-function clicktoflowline(index,x,y,u,v,filename)
+-%CLICKTOFLOWLINE - create a flowline ARGUS file
+-%
+-%   create a flowline contour file (named 'filename') by clicking
+-%   on a velocity field once (velocity must be plotted first)
+-%
+-%   Usage: 
+-%      clicktoflowline(index,x,y,u,v,x0,y0,filename)
+-%
+-%   Example: 
+-%      clicktoflowline(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vx_obs,md.inversion.vy_obs,'flowline.exp')
+-
+-%Get click position
+-[x0,y0]=ginput(1);
+-
+-%Get flowline
+-line=flowlines(index,x,y,u,v,x0,y0,200);
+-
+-%plot
+-hold on
+-plot(line.x,line.y,'r-');
+-
+-%Write argus file
+-expwrite(line,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exptool.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exptool.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exptool.m	(revision 12997)
+@@ -1,342 +0,0 @@
+-function exptool(newfile,varargin)
+-%EXPMASTER - allow to create, modify, add, cut, .. segments of domain outline together
+-%
+-%   this routine is used to create, modify, cut,... an Argus file (.exp)
+-%
+-%   exptool(newprofile,'optionname',optionvalue)
+-%      creation of an argus file newprofile
+-%
+-%   Available options:
+-%      - include: include list of existing ARGUS files
+-%      - color: line color (default='r')
+-%      - selectioncolor: line color of selected profiles (default='b')
+-%      - linestyle (default='-')
+-%      - linewidth (default=0.2)
+-%      - marker (default='+')
+-%      - markersize (default=7)
+-%      - markeredgecolor (default='r')
+-%
+-%   Usage:
+-%      exptool(newfile,varargin)
+-%
+-%   Example:
+-%      exptool('domain.exp','include',{'domain1.exp' 'domain2.exp'},'color','g','marker','+')
+-%
+-%   See also EXPDOC
+-
+-%recover options
+-options=pairoptions(varargin{:});
+-
+-%Some checks
+-if ~nargin | nargout
+-	error('exptool usage: exptool(newfile,varargin)')
+-elseif exist(newfile,'file'),
+-	%recursive call to exptool if file already exists
+-	if ~exist(options,'include'),
+-		exptool(newfile,'include',newfile,varargin{:});
+-		return;
+-	end
+-
+-	%check modification
+-	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
+-	if ~strcmpi(choice,'y'),
+-		disp('no modification done ... exiting');
+-		return
+-	end
+-end
+-
+-%Add default options
+-options=addfielddefault(options,'color','r');
+-options=addfielddefault(options,'selectioncolor','b');
+-options=addfielddefault(options,'LineStyle','-');
+-options=addfielddefault(options,'LineWidth',0.2);
+-options=addfielddefault(options,'Marker','+');
+-options=addfielddefault(options,'MarkerSize',7);
+-options=addfielddefault(options,'MarkerEdgeColor','r');
+-
+-%put all the argus profiles given in input in one structure A
+-A=struct([]);
+-numprofiles=0;
+-numpoints=0;
+-closed=[];
+-
+-%initialize the variables with files provided by 'include' option
+-if exist(options,'include'),
+-	files=getfieldvalue(options,'include');
+-	if ischar(files), files={files}; end
+-	for i=1:length(files),
+-		filename=files{i};
+-		if ~exist(filename,'file'),
+-			error(['exptool error message:, ' filename ' does not exist. Exiting...']);
+-		else
+-			%read file
+-			B=expread(filename);
+-			%go through all profiles of B
+-			for i=1:size(B,2)
+-				%plug profile in A
+-				if numprofiles
+-					A(numprofiles+1)=B(i);
+-				else
+-					A=B(i);
+-				end
+-				%update numprofiles and numpoints
+-				numpoints=numpoints+length(B(i).x);
+-				numprofiles=numprofiles+1;
+-				%figure out if the profile is closed or not
+-				if (B(i).x(1)==B(i).x(end) & B(i).y(1)==B(i).y(end) & length(B(i).x)>1 )
+-					closed(numprofiles)=1;
+-				else
+-					closed(numprofiles)=0;
+-				end
+-			end
+-		end
+-	end
+-end
+-
+-%Get root of newfile
+-[path root ext]=fileparts(newfile);
+-
+-%get current figure
+-if ~isempty(get(0,'children')),%if there is already a figure (return the number of opened figures)
+-	set(gcf,'Renderer','zbuffer'); %fixes a bug on Mac OS X (not needed in future Matlab version)
+-	P=get(gcf,'position');
+-	F=getframe(gca);
+-	F=F.cdata;
+-	%get current axis
+-	xlim=get(gca,'Xlim');
+-	ylim=get(gca,'Ylim');
+-	%recreate x_m and y_m
+-	x_m=linspace(xlim(1),xlim(2),size(F,2));
+-	y_m=linspace(ylim(2),ylim(1),size(F,1)); %getframe reverse axis...
+-	%plot the data in another figure
+-	figure; set(gcf,'position',P);
+-	imagesc(x_m,y_m,F); set(gca,'Ydir','normal');
+-	prevplot=1;
+-	prevplot2=1;
+-else
+-	figure
+-	prevplot=0;
+-	prevplot2=0;
+-end
+-
+-%plot existing profile if any
+-hold on
+-
+-%Build backup structre for do and redo
+-backup=cell(1,3);
+-backup{1,1}=A;
+-backup{1,2}=numprofiles;
+-backup{1,3}=numpoints;
+-backup{1,4}=closed;
+-
+-loop=1;
+-counter=1;
+-while loop
+-
+-	%Go through A and rule out the empty profiles
+-	list=[];
+-	for i=1:size(A,2);
+-		if length(A(i).x)==0
+-			list(end+1)=i;
+-			numprofiles=numprofiles-1;
+-		end
+-	end
+-	A(list)=[];
+-	closed(list)=[];
+-
+-	%Now erase all that have been done and plot the new structure A as it is
+-	undoplots(prevplot);
+-	if numprofiles
+-		prevplot2=1;
+-		for i=1:numprofiles
+-			if length(A(i).x)==1,
+-				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-					'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker','o');
+-			else
+-				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			end
+-			prevplot2=prevplot2+1;
+-		end
+-	end
+-
+-	%display menu
+-	title('Main Menu','FontSize',14);
+-	button=menu('Menu','add a profile (open)',...%1
+-		'add a contour (closed)',...              %2
+-		'remove a profile',...                    %3
+-		'modify the position of a point',...      %4
+-		'add points inside a profile',...         %5
+-		'add points at the end of a profile',...  %6
+-		'remove points',...                       %7
+-		'remove several points',...               %8
+-		'cut a segment',...                       %9
+-		'cut a large area',...                    %10
+-		'merge profiles',...                      %11
+-		'close profile',...                       %12
+-		'undo',...                                %13
+-		'redo',...                                %14
+-		'quit');                                  %15
+-
+-
+-	%UNDO??
+-	if button==13;
+-		if counter==1
+-			disp('Already at oldest change');
+-		else
+-			counter=counter-1;
+-			A=backup{counter,1};
+-			numprofiles=backup{counter,2};
+-			numpoints=backup{counter,3};
+-			closed=backup{counter,4};
+-		end
+-	end
+-
+-	%REDO??
+-	if button==14
+-		if counter==size(backup,1)
+-			disp('Already at newest change');
+-		else
+-			counter=counter+1;
+-			A=backup{counter,1};
+-			numprofiles=backup{counter,2};
+-			numpoints=backup{counter,3};
+-			closed=backup{counter,4};
+-		end
+-	end
+-
+-	switch button
+-
+-		case 1
+-
+-			[A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 2
+-
+-			[A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot2,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 3
+-
+-			[A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 4
+-
+-			[A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 5
+-
+-			[A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 6
+-
+-			[A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 7
+-
+-			[A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 8
+-
+-			[A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 9
+-
+-			[A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 10
+-
+-			[A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-		case 11
+-
+-			[A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-
+-		case 12
+-
+-			[A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-			counter=counter+1;
+-			backup{counter,1}=A;
+-			backup{counter,2}=numprofiles;
+-			backup{counter,3}=numpoints;
+-			backup{counter,4}=closed;
+-
+-			%QUIT
+-		case 15
+-
+-			loop=0;
+-
+-		otherwise
+-
+-			%do nothing
+-
+-	end
+-
+-end
+-
+-hold off
+-
+-%write contour using expwrite
+-title('New file written, exiting...','FontSize',14);
+-if isempty(A)
+-	disp('Profile empty, no file written')
+-else
+-	expwrite(A,newfile);
+-end
+-
+-%close window
+-close;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcontract.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcontract.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcontract.m	(revision 12997)
+@@ -1,34 +0,0 @@
+-function normal_node=expcontract(newfile,oldfile,distance)
+-%EXPCONTRACT - contract or expand a profile, according to the normal.
+-% 
+-%   Usage:
+-%      expcontract(newfile,oldfile,distance)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-
+-contour=expread(oldfile);
+-num=numel(contour.x);
+-
+-normal=zeros(num-1,2);
+-normal_node=zeros(num-1,2);
+-
+-for i=1:num-1,
+-	normal(i,:)=[ contour.y(i)-contour.y(i+1) contour.x(i+1)-contour.x(i)];
+-	normal(i,:)=normal(i,:)/sqrt(normal(i,1)^2+normal(i,2)^2);
+-end
+-
+-normal_node(2:end,:)=[normal(1:end-1,:)+normal(2:end,:)];
+-normal_node(1,:)=normal(1,:)+normal(end,:);
+-
+-normal_node_norm=sqrt(normal_node(:,1).^2+normal_node(:,2).^2);
+-normal_node(:,1)=normal_node(:,1)./normal_node_norm;
+-normal_node(:,2)=normal_node(:,2)./normal_node_norm;
+-
+-contour.x(1:end-1)=contour.x(1:end-1)+distance*normal_node(:,1);
+-contour.y(1:end-1)=contour.y(1:end-1)+distance*normal_node(:,2);
+-
+-contour.x(end)=contour.x(1);
+-contour.y(end)=contour.y(1);
+-
+-expwrite(contour,newfile);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecontour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecontour.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecontour.m	(revision 12997)
+@@ -1,36 +0,0 @@
+-function expcreatecontour(filename);
+-%EXPCREATECONTOUR - create a contour from a list of points
+-%
+-%   expcreatecontour: from a list of (x,y) points (retrieve using ginput on an undetermined
+-%   number of points: used RETURN key to end input), create an Argus .exp 
+-%   file holding the corresponding closed contour.
+-%    
+-%   Usage:
+-%      expcreatecontour(filename)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%Get root of filename
+-[path root ext ver]=fileparts(filename);
+-
+-%Get contour
+-disp('Click on contour points you desire. Type RETURN to end input of points');
+-[x,y]=ginputquick;
+-
+-%close contour
+-x=[x;x(1)];
+-y=[y;y(1);];
+-
+-%plot contour
+-hold on;
+-plot(x,y,'r-');
+-
+-%create structure for expwrite routine
+-a.x=x;
+-a.y=y;
+-a.name=root;
+-a.density=1;
+-
+-%write contour using expwrite
+-expwrite(a,filename);
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expwrite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expwrite.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expwrite.m	(revision 12997)
+@@ -1,38 +0,0 @@
+-function expwrite(a,filename);
+-%EXPWRITE - write an Argus file from a structure given in input
+-%
+-%   This routine write an Argus file form a structure containing the fields:
+-%   x and y of the coordinates of the points.
+-%   The first argument is the structure containing the points coordinates 
+-%   and the second one the file to be write.
+-%
+-%   Usage:
+-%      expwrite(a,filename)
+-% 
+-%   Example:
+-%      expwrite(coordstruct,'domainoutline.exp')
+-%
+-%   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
+-
+-fid=fopen(filename,'w');
+-for n=1:length(a),
+-   
+-   if isfield(a,'name'),
+-	   if ~isempty(a(n).name),
+-		   fprintf(fid,'%s%s\n','## Name:',a(n).name);
+-	   else
+-		   fprintf(fid,'%s\n','## Name:');
+-	   end
+-   else
+-	   fprintf(fid,'%s\n','## Name:');
+-   end
+-   
+-   fprintf(fid,'%s\n','## Icon:0');
+-   fprintf(fid,'%s\n','# Points Count Value');
+-   fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
+-   fprintf(fid,'%s\n','# X pos Y pos');
+-	fprintf(fid,'%10.10f %10.10f\n',[a(n).x a(n).y]');
+-	fprintf(fid,'\n','');
+-   
+-end
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expread.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/readwrite/expread.m	(revision 12997)
+@@ -1,81 +0,0 @@
+-function Struct=expread(filename);
+-%EXPREAD - read a file exp and build a Structure
+-%
+-%   This routine reads a file .exp and build a Structure containing the 
+-%   fields x and y corresponding to the coordinates, one for the filename of
+-%   the exp file, for the density, for the nodes, and a field closed to 
+-%   indicate if the domain is closed. 
+-%   The first argument is the .exp file to be read and the second one (optional) 
+-%   indicate if the last point shall be read (1 to read it, 0 not to).
+-%
+-%   Usage:
+-%      Struct=expread(filename)
+-%  
+-%   Example:
+-%      Struct=expread('domainoutline.exp')
+-%      Struct=expread('domainoutline.exp')
+-%
+-%   See also EXPDOC, EXPWRITEASVERTICES
+-
+-%some checks
+-if ~exist(filename),
+-	error(['expread error message: file ' filename ' not found!']);
+-end
+-
+-%initialize number of profile
+-count=0;
+-
+-%open file
+-fid=fopen(filename,'r');
+-
+-%loop over the number of profiles
+-while (~feof(fid)),
+-
+-	%update number of profiles
+-   count=count+1;
+-
+-   %Get file name
+-	A=fscanf(fid,'%s %s',2);
+-	if ~strncmp(A,'##Name:',7), break; end
+-	if length(A)>7, 
+-		Struct(count).name=A(8:end);
+-	else
+-		Struct(count).name='';
+-	end
+-
+-	%Get Icon
+-	A=fscanf(fid,'%s %s',2);
+-	if ~strncmp(A,'##Icon:',6), break; end
+-
+-	%Get Info
+-	A=fscanf(fid,'%s %s %s %s',4);
+-	if ~strncmp(A,'#Points',7), break; end
+-
+-	%Get number of nods and density
+-   A=fscanf(fid,'%f %f',[1 2]);
+-   Struct(count).nods=A(1);
+-   Struct(count).density=A(2);
+-
+-	%Get Info
+-	A=fscanf(fid,'%s %s %s %s',5);
+-	if ~strncmp(A,'#XposYpos',9), break; end
+-
+-	%Get Coordinates
+-	A=fscanf(fid,'%f %f',[2 Struct(count).nods]);
+-	Struct(count).x=A(1,:)';
+-	Struct(count).y=A(2,:)';
+-
+-	if(Struct(count).nods~=length(Struct(count).x))error(['Profile ' num2str(count) ' reports incorrect length']); end;
+-
+-	%Check if closed
+-	if (Struct(count).nods > 1) && ...
+-	   (Struct(count).x(end) == Struct(count).x(1)) && ...
+-	   (Struct(count).y(end) == Struct(count).y(1))
+-		Struct(count).closed=true;
+-	else
+-		Struct(count).closed=false;
+-	end
+-end
+-
+-%close file
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expexcludeoutliers.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expexcludeoutliers.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expexcludeoutliers.m	(revision 12997)
+@@ -1,18 +0,0 @@
+-function excludeoutliers(newcontourname,contourname,domainname)
+-%EXCLUDEOUTLIERS exclude points of contour that are not within the domain  contour. return new contours in a different file.
+-%
+-%        Usage: excludeoutliers('NewContour.exp','Contour.exp','DomainOutline.exp');
+-%
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-
+-contour=expread(contourname);
+-
+-for i=1:length(contour),
+-	flags=ContourToNodes(contour(i).x,contour(i).y,domainname,0);
+-	contour(i).x=contour(i).x(find(flags));
+-	contour(i).y=contour(i).y(find(flags));
+-end
+-
+-expwrite(contour,newcontourname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expboxgen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expboxgen.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expboxgen.m	(revision 12997)
+@@ -1,99 +0,0 @@
+-function expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
+-%EXPBOXGEN -  creates a domain outline box for a tiff image
+-%
+-%   This function creates a domain outline box for a .tif image for the 
+-%   mosaic tiff. 
+-%   x0,y0 and x1,y1 are the cropping coordinates (upper left and lower right 
+-%   corners in the larger tiff image).
+-%   paramter_filename is the parameter file name for the mosaic tiff image.
+-%   box_filename is self explanatory.
+-%
+-%   Usage:
+-%      expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%initialize
+-nrows=-1;
+-ncols=-1;
+-X0=-1;
+-Y0=-1;
+-posting=-1;
+-
+-%first recover necessary information from the paramter_filename.
+-fid=fopen(parameter_filename,'r');
+-count=1;
+-while(1),
+-tline=fgetl(fid);
+-if ~isstr(tline), break; end;
+-
+-ind=findstr('ant125m',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-a=a(2); a=char(a); a=a(1:length(a)-1);
+-posting=str2num(a);
+-end
+-
+-
+-ind=findstr('no. of rows   :',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-nrows=str2num(char(a(length(a))));
+-end
+-
+-ind=findstr('no. of columns:',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-ncols=str2num(char(a(length(a))));
+-end
+-
+-ind=findstr('Upper Left X:',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-X0=str2num(char(a(length(a))));
+-end
+-
+-ind=findstr('Upper Left Y:',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-Y0=str2num(char(a(length(a))));
+-end
+-
+-
+-end %while(1),
+-
+-
+-fclose(fid);
+-
+-if (X0==-1 | Y0==-1 | nrows==-1  | ncols==-1 | posting==-1),
+-disp(' ');
+-disp(['Could not recover all parameters from ' parameter_filename]);
+-disp('Here are the paramters recovered thus far: ');
+-disp(['no. of rows: ' num2str(nrows)]);
+-disp(['no. of columns: ' num2str(ncols)]);
+-disp(['Upper Left X: ' num2str(X0)]);
+-disp(['Upper Left Y: ' num2str(Y0)]);
+-disp(['Posting: ' num2str(posting)]);
+-end
+-
+-disp(' ');
+-disp(['Recovered the following parameters from ' parameter_filename]);
+-disp(['no. of rows: ' num2str(nrows)]);
+-disp(['no. of columns: ' num2str(ncols)]);
+-disp(['Upper Left X: ' num2str(X0)]);
+-disp(['Upper Left Y: ' num2str(Y0)]);
+-disp(['Posting: ' num2str(posting)]);
+-
+-%Create X,Y, arrays of coordinates:
+-X(1)=X0+x0*posting
+-Y(1)=Y0-y0*posting
+-X(2)=X(1);
+-Y(2)=Y(1)-ny*posting;
+-X(3)=X(1)+nx*posting;
+-Y(3)=Y(2);
+-Y(4)=Y(1);
+-X(4)=X(3);
+-plot(X,Y,'r*');
+-
+-%Create box exp file using X and Y. Loop it.
+-expgen(box_filename,X,Y,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreateprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreateprofile.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreateprofile.m	(revision 12997)
+@@ -1,31 +0,0 @@
+-function expcreateprofile(filename);
+-%EXPCREATEPROFILE - create an Argus file from a list of points
+-%
+-%   expcreateprofile: from a list of (x,y) points (retrieve using ginput on an undetermined
+-%   number of points: used RETURN key to end input), create an Argus .exp 
+-%   file holding the corresponding open profile.
+-%    
+-%   Usage:
+-%      expcreateprofile(filename)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%Get root of filename
+-[path root ext ver]=fileparts(filename);
+-
+-%Get profile
+-disp('Click on profile points you desire. Type RETURN to end input of points');
+-[x,y]=ginputquick;
+-
+-%plot contour
+-hold on;
+-plot(x,y,'r-');
+-
+-%create structure for expwrite routine
+-a.x=x;
+-a.y=y;
+-a.name=root;
+-a.density=1;
+-
+-%write profile using expwrite
+-expwrite(a,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/flowlines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/flowlines.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/flowlines.m	(revision 12997)
+@@ -1,163 +0,0 @@
+-function flowpath=flowlines(index,x,y,u,v,x0,y0,varargin)
+-%FLOWLINES - compute flowlines from a given set of seed points
+-%
+-%   Usage:
+-%      flowpath=flowlines(index,x,y,u,v,x0,y0)
+-%
+-%   the velocity field is given by the couple (u,v) and the coordinates
+-%   of the seed points are (x0,y0). One can use one or several seed 
+-%   points
+-%
+-%   Example:
+-%      flowpath=flowlines(md.mesh.elements,md.mesh.x,md.mesh.y,md.vx,md.initialization.vy,x0,y0)
+-
+-%check input size
+-if nargin>8 | nargin<7,
+-	help flowlines
+-	error('flowlines error message: bad usage');
+-end
+-
+-%check input
+-if (length(x)~=length(y) | length(x)~=length(u) | length(x)~=length(v)),
+-	error('flowlines error message: x,y,u and v must have the same length');
+-end
+-if length(x)<3,
+-	error('flowlines error message: at least one element is required');
+-end
+-if length(x0)~=length(y0),
+-	error('flowlines error message: x0 and y0 do not have the same length');
+-end
+-
+-%get maxiter and precision
+-if nargin==8
+-	maxiter=varargin{1};
+-else
+-	maxiter=200; %maximum number of iterations
+-end
+-precision=1; %division of each segment (higer precision increases number of segments)
+-
+-%check seed points
+-tria=TriaSearch(index,x,y,x0,y0);
+-pos=find(isnan(tria));
+-x0(pos)=[];
+-y0(pos)=[];
+-
+-%initialize other variables
+-N=length(x0);
+-X=x0; Y=y0;
+-flowpath=struct('x',cell(N,1),'y',cell(N,1),'name','','density',1);
+-for i=1:N,
+-	flowpath(i).x=x0(i);
+-	flowpath(i).y=y0(i);
+-end
+-done=zeros(N,1);
+-
+-%get avegared length of each element
+-length_tria=1/3*(sqrt( (x(index(:,1))-x(index(:,2))).^2+(y(index(:,1))-y(index(:,2))).^2 )+...
+-	sqrt((x(index(:,1))-x(index(:,3))).^2+(y(index(:,1))-y(index(:,3))).^2 )+...
+-	sqrt((x(index(:,2))-x(index(:,3))).^2+(y(index(:,2))-y(index(:,3))).^2 ));
+-
+-%take velocity for each element
+-u=u(index)*[1;1;1]/3;
+-v=v(index)*[1;1;1]/3;
+-
+-%initialization:
+-counter=1;
+-
+-while any(~done) 
+-
+-	%find current triangle
+-	queue=find(~done);
+-	tria=TriaSearch(index,x,y,X(queue),Y(queue));
+-
+-	%check that the point is actually inside a triangle of the mesh
+-	listnan=find(isnan(tria));
+-	for i=1:length(listnan)
+-		%remove the last point
+-		flowpath(queue(listnan(i))).x(end)=[];
+-		flowpath(queue(listnan(i))).y(end)=[];
+-		done(queue(listnan(i)))=1;
+-	end
+-	tria(listnan)=[]; 
+-	queue(listnan)=[];
+-
+-	if isempty(tria),
+-		break;
+-	end
+-
+-	%velocity of the current triangle and norm it
+-	ut=u(tria); vt=v(tria); normv=sqrt(ut.^2+vt.^2);
+-	ut=ut./normv;vt=vt./normv;
+-
+-	%check counter
+-	if counter>maxiter
+-		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going forward'])
+-		break
+-	end
+-	counter=counter+1;
+-
+-	%remove stagnant point
+-	done(queue(find(ut==0 & vt==0)))=1;
+-
+-	%build next point
+-	for i=1:length(queue)
+-		X(queue(i))=flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision;
+-		Y(queue(i))=flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision;
+-		flowpath(queue(i)).x=[flowpath(queue(i)).x;flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision];
+-		flowpath(queue(i)).y=[flowpath(queue(i)).y;flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision];
+-	end
+-end
+-
+-%same process but reverse (vel=-vel) to have a vcomplete flow line
+-counter=1;
+-X=x0; Y=y0;
+-done=zeros(N,1);
+-
+-while any(~done) 
+-
+-	%find current triangle
+-	queue=find(~done);
+-	tria=TriaSearch(index,x,y,X(queue),Y(queue));
+-
+-	%check that the point is actually inside a triangle of the mesh
+-	listnan=find(isnan(tria));
+-	for i=1:length(listnan)
+-		%remove the last point
+-		flowpath(queue(listnan(i))).x(1)=[];
+-		flowpath(queue(listnan(i))).y(1)=[];
+-		done(queue(listnan(i)))=1;
+-	end
+-	tria(listnan)=[]; 
+-	queue(listnan)=[];
+-
+-	if isempty(tria),
+-		break;
+-	end
+-
+-	%velocity of the current triangle and norm it
+-	ut=-u(tria); vt=-v(tria); normv=sqrt(ut.^2+vt.^2);
+-	ut=ut./normv;vt=vt./normv;
+-
+-	%check counter
+-	if counter>maxiter
+-		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going backward'])
+-		break
+-	end
+-	counter=counter+1;
+-
+-	%remove stagnant point
+-	done(queue(find(ut==0 & vt==0)))=1;
+-
+-	%build next point
+-	for i=1:length(queue)
+-		X(queue(i))=flowpath(queue(i)).x(1)+ut(i)*length_tria(tria(i))/precision;
+-		Y(queue(i))=flowpath(queue(i)).y(1)+vt(i)*length_tria(tria(i))/precision;
+-		flowpath(queue(i)).x=[flowpath(queue(i)).x(1)+ut(i)*length_tria(tria(i))/precision; flowpath(queue(i)).x];
+-		flowpath(queue(i)).y=[flowpath(queue(i)).y(1)+vt(i)*length_tria(tria(i))/precision; flowpath(queue(i)).y];
+-	end
+-end
+-
+-%EXP compatibility
+-for i=1:length(queue)
+-	flowpath(queue(i)).name=['flowline' num2str(i)];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecircle.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecircle.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcreatecircle.m	(revision 12997)
+@@ -1,31 +0,0 @@
+-function expcreatecircle(filename,x0,y0,radius,numberofnodes)
+-%EXPCREATECIRCLE - create a circular contour corresponding to given parameters
+-%
+-%   Creates a closed argus contour centered on x,y of radius size.
+-%   The contour is made of numberofnodes
+-%
+-%   Usage:
+-%      expcreatecircle(filename,x0,y0,radius,numberofnodes)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%Calculate the cartesians coordinates of the points
+-x_list=ones(numberofnodes+1,1);
+-y_list=ones(numberofnodes+1,1);
+-
+-theta=(0:2*pi/numberofnodes:2*pi*(1-1/numberofnodes))';
+-theta=[theta;0];
+-
+-x_list=radius*x_list.*cos(theta);
+-y_list=radius*y_list.*sin(theta);
+-
+-%offset x_list and y_list by x0 and y0:
+-x_list=x_list+x0;
+-y_list=y_list+y0;
+-
+-contour.x=x_list;
+-contour.y=y_list;
+-contour.density=1;
+-contour.name='circle';
+-
+-expwrite(contour,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/ginputquick.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/ginputquick.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/ginputquick.m	(revision 12997)
+@@ -1,221 +0,0 @@
+-function [out1,out2,out3] = ginput(arg1)
+-%GINPUT - Graphical input from mouse.
+-%
+-%   [X,Y] = GINPUT(N) gets N points from the current axes and returns 
+-%   the X- and Y-coordinates in length N vectors X and Y.  The cursor
+-%   can be positioned using a mouse (or by using the Arrow Keys on some 
+-%   systems).  Data points are entered by pressing a mouse button
+-%   or any key on the keyboard except carriage return, which terminates
+-%   the input before N points are entered.
+-%
+-%   [X,Y] = GINPUT gathers an unlimited number of points until the
+-%   return key is pressed.
+-% 
+-%   [X,Y,BUTTON] = GINPUT(N) returns a third result, BUTTON, that 
+-%   contains a vector of integers specifying which mouse button was
+-%   used (1,2,3 from left) or ASCII numbers if a key on the keyboard
+-%   was used.
+-%
+-%   Usage:
+-%      [out1,out2,out3] = ginput(arg1)
+-
+-%   Copyright 1984-2005 The MathWorks, Inc.
+-%   $Revision: 1.1 $  $Date: 2009/04/03 22:56:26 $
+-
+-out1 = []; out2 = []; out3 = []; y = [];
+-c = computer;
+-if ~strcmp(c(1:2),'PC') 
+-   tp = get(0,'TerminalProtocol');
+-else
+-   tp = 'micro';
+-end
+-
+-if ~strcmp(tp,'none') && ~strcmp(tp,'x') && ~strcmp(tp,'micro'),
+-   if nargout == 1,
+-      if nargin == 1,
+-         out1 = trmginput(arg1);
+-      else
+-         out1 = trmginput;
+-      end
+-   elseif nargout == 2 || nargout == 0,
+-      if nargin == 1,
+-         [out1,out2] = trmginput(arg1);
+-      else
+-         [out1,out2] = trmginput;
+-      end
+-      if  nargout == 0
+-         out1 = [ out1 out2 ];
+-      end
+-   elseif nargout == 3,
+-      if nargin == 1,
+-         [out1,out2,out3] = trmginput(arg1);
+-      else
+-         [out1,out2,out3] = trmginput;
+-      end
+-   end
+-else
+-   
+-   fig = gcf;
+-   figure(gcf);
+-   
+-   if nargin == 0
+-      how_many = -1;
+-      b = [];
+-   else
+-      how_many = arg1;
+-      b = [];
+-      if  ischar(how_many) ...
+-            || size(how_many,1) ~= 1 || size(how_many,2) ~= 1 ...
+-            || ~(fix(how_many) == how_many) ...
+-            || how_many < 0
+-         error('MATLAB:ginput:NeedPositiveInt', 'Requires a positive integer.')
+-      end
+-      if how_many == 0
+-         ptr_fig = 0;
+-         while(ptr_fig ~= fig)
+-            ptr_fig = get(0,'PointerWindow');
+-         end
+-         scrn_pt = get(0,'PointerLocation');
+-         loc = get(fig,'Position');
+-         pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+-         out1 = pt(1); y = pt(2);
+-      elseif how_many < 0
+-         error('MATLAB:ginput:InvalidArgument', 'Argument must be a positive integer.')
+-      end
+-   end
+-   
+-   % Suspend figure functions
+-   state = uisuspend(fig);
+-   
+-   toolbar = findobj(allchild(fig),'flat','Type','uitoolbar');
+-   if ~isempty(toolbar)
+-        ptButtons = [uigettool(toolbar,'Plottools.PlottoolsOff'), ...
+-                     uigettool(toolbar,'Plottools.PlottoolsOn')];
+-        ptState = get (ptButtons,'Enable');
+-        set (ptButtons,'Enable','off');
+-   end
+-
+-   set(fig,'pointer','fullcrosshair');
+-   fig_units = get(fig,'units');
+-   char = 0;
+-
+-   % We need to pump the event queue on unix
+-   % before calling WAITFORBUTTONPRESS 
+-   drawnow
+-   
+-   while how_many ~= 0
+-      % Use no-side effect WAITFORBUTTONPRESS
+-      waserr = 0;
+-      try
+-	keydown = wfbp;
+-      catch
+-	waserr = 1;
+-      end
+-      if(waserr == 1)
+-         if(ishandle(fig))
+-            set(fig,'units',fig_units);
+-	    uirestore(state);
+-            error('MATLAB:ginput:Interrupted', 'Interrupted');
+-         else
+-            error('MATLAB:ginput:FigureDeletionPause', 'Interrupted by figure deletion');
+-         end
+-      end
+-      
+-      ptr_fig = get(0,'CurrentFigure');
+-      if(ptr_fig == fig)
+-         if keydown
+-            char = get(fig, 'CurrentCharacter');
+-            button = abs(get(fig, 'CurrentCharacter'));
+-            scrn_pt = get(0, 'PointerLocation');
+-            set(fig,'units','pixels')
+-            loc = get(fig, 'Position');
+-            pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+-            set(fig,'CurrentPoint',pt);
+-         else
+-            button = get(fig, 'SelectionType');
+-            if strcmp(button,'open') 
+-               button = 1;
+-            elseif strcmp(button,'normal') 
+-               button = 1;
+-            elseif strcmp(button,'extend')
+-               button = 2;
+-            elseif strcmp(button,'alt') 
+-               button = 3;
+-            else
+-               error('MATLAB:ginput:InvalidSelection', 'Invalid mouse selection.')
+-            end
+-         end
+-         pt = get(gca, 'CurrentPoint');
+-         
+-         how_many = how_many - 1;
+-         
+-         if(char == 13) % & how_many ~= 0)
+-            % if the return key was pressed, char will == 13,
+-            % and that's our signal to break out of here whether
+-            % or not we have collected all the requested data
+-            % points.  
+-            % If this was an early breakout, don't include
+-            % the <Return> key info in the return arrays.
+-            % We will no longer count it if it's the last input.
+-            break;
+-         end
+-
+-         out1 = [out1;pt(1,1)];
+-         y = [y;pt(1,2)];
+-         b = [b;button];
+-      end
+-   end
+-   
+-   uirestore(state);
+-   if ~isempty(toolbar) && ~isempty(ptButtons)
+-        set (ptButtons(1),'Enable',ptState{1});
+-        set (ptButtons(2),'Enable',ptState{2});
+-   end
+-   set(fig,'units',fig_units);
+-   
+-   if nargout > 1
+-      out2 = y;
+-      if nargout > 2
+-         out3 = b;
+-      end
+-   else
+-      out1 = [out1 y];
+-   end
+-
+-   line(out1,y);
+-   line([out1(length(out1)) out1(1)],[y(length(y)) y(1)]);
+-   
+-end
+-
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-function key = wfbp
+-%WFBP   Replacement for WAITFORBUTTONPRESS that has no side effects.
+-
+-fig = gcf;
+-current_char = [];
+-
+-% Now wait for that buttonpress, and check for error conditions
+-waserr = 0;
+-try
+-  h=findall(fig,'type','uimenu','accel','C');   % Disabling ^C for edit menu so the only ^C is for
+-  set(h,'accel','');                            % interrupting the function.
+-  keydown = waitforbuttonpress;
+-  current_char = double(get(fig,'CurrentCharacter')); % Capturing the character.
+-  if~isempty(current_char) && (keydown == 1)           % If the character was generated by the 
+-	  if(current_char == 3)                       % current keypress AND is ^C, set 'waserr'to 1
+-		  waserr = 1;                             % so that it errors out. 
+-	  end
+-  end
+-  
+-  set(h,'accel','C');                                 % Set back the accelerator for edit menu.
+-catch
+-  waserr = 1;
+-end
+-drawnow;
+-if(waserr == 1)
+-   set(h,'accel','C');                                % Set back the accelerator if it errored out.
+-   error('MATLAB:ginput:Interrupted', 'Interrupted');
+-end
+-
+-if nargout>0, key = keydown; end
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expbox.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expbox.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expbox.m	(revision 12997)
+@@ -1,41 +0,0 @@
+-function expbox(filename)
+-%EXPBOX - Create a ARGUS file using to clicks
+-%
+-%   Two clicks on a plot are used to generate a rectangular box
+-%   This box is written in EXP format on filename
+-%
+-%   Usage:
+-%      expbox(filename)
+-
+-%check
+-if exist(filename,'file'),
+-	choice=input(['A file ' filename ' already exists, do you want to modify it? (y/n)'],'s');
+-	if ~strcmpi(choice,'y'),
+-		disp('no modification done ... exiting');
+-		return
+-	end
+-end
+-
+-%Get points
+-disp('Click twice to define a rectangular domain. First click for upper left corner, second for lower right corner');
+-[x,y]=ginput(2);
+-
+-x1=x(1);
+-x2=x(2);
+-x3=x2;
+-x4=x1;
+-
+-y1=y(1);
+-y2=y1;
+-y3=y(2);
+-y4=y3;
+-
+-%Build Exp structure
+-A=struct();
+-A.nods=5;
+-A.density=1;
+-A.x=[x1 x2 x3 x4 x1]';
+-A.y=[y1 y2 y3 y4 y1]';
+-
+-%Write structure
+-expwrite(A,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutarea.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutarea.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutarea.m	(revision 12997)
+@@ -1,156 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%CUTAREA - cut several point of a profile
+-%
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile. The user must click 3 times to select the
+-%   area to be removed. Twice to select the tips and one to select
+-%   the part of the profile to be removed
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	hold on
+-	loop=1;
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	end
+-
+-	points=[];
+-
+-	%loop (at least 3 clicks needed)
+-	while loop
+-
+-		%some checks
+-		if numprofiles==0
+-			disp('no profile present, exiting...')
+-			return
+-		end	   
+-		if numpoints<3
+-			disp('at least two points are needed, exiting...')
+-			return
+-		end	   
+-
+-		%select a point
+-		if isempty(points)
+-			title('click on the first tip, RETURN to exit','FontSize',14)
+-		elseif length(points)==1
+-			title('click on the second tip, RETURN to exit','FontSize',14)
+-		else
+-			title('click in the middle of the area to be cut, RETURN to exit','FontSize',14)
+-		end
+-
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-			%get the closest point
+-			%first time, look at all profiles
+-			if isempty(points)
+-				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-				if ((closed(profsel) & length(A(profsel).x)<4) |  (~closed(profsel) & length(A(profsel).x)<3)),
+-					disp('the selected profile has less than 3 points, make another selection');
+-				else
+-					selection=profsel;
+-					points(end+1)=indsel;
+-					plot(A(profsel).x,A(profsel).y,...
+-						'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-					text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
+-				end
+-			else
+-				%get the 2d or 3d point for the given contou
+-				[profsel indsel]=closestpoint(A(selection),1,xi,yi);
+-				if ismember(indsel,points)
+-					disp('the selected points must be distinct')
+-				else
+-					%second click?
+-					if length(points)==1,
+-						points(end+1)=indsel;
+-						text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
+-					%third click?
+-					else
+-						p1=points(1); p2=points(2); p3=indsel;
+-						x=A(selection).x; y=A(selection).y;
+-						if p1<p2
+-							if p3>p1 & p3<p2
+-								if closed(selection)
+-									%open the profile
+-									n=length(A(selection).x);
+-									A(selection).x=[A(selection).x(p2:end-1,1);A(selection).x(1:p1,1)];
+-									A(selection).y=[A(selection).y(p2:end-1,1);A(selection).y(1:p1,1)];
+-									numpoints=numpoints-(n-length(A(selection).x));
+-									closed(selection)=0;
+-								else
+-									%cut in 2 profiles
+-									A(selection).x=x(1:p1);
+-									A(selection).y=y(1:p1);
+-									closed(selection)=0;
+-									A(end+1).x=x(p2:end);
+-									A(end).y=y(p2:end);
+-									A(end).density=A(selection).density;
+-									A(end).name=A(selection).name;
+-									closed(end+1)=0;
+-									numprofiles=numprofiles+1;
+-									numpoints=numpoints-(p2-p1-1);
+-								end
+-							else
+-								%only point removal
+-								n=length(A(selection).x);
+-								A(selection).x=x(p1:p2);
+-								A(selection).y=y(p1:p2);
+-								numpoints=numpoints-(n-length(A(selection).x));
+-								closed(selection)=0;
+-							end
+-						else
+-							if p3>p2 & p3<p1
+-								if closed(selection)
+-									%open the profile
+-									n=length(A(selection).x);
+-									A(selection).x=[A(selection).x(p1:end-1,1);A(selection).x(1:p2,1)];
+-									A(selection).y=[A(selection).y(p1:end-1,1);A(selection).y(1:p2,1)];
+-									numpoints=numpoints-(n-length(A(selection).x));
+-									closed(selection)=0;
+-								else
+-									%cut in 2 profiles
+-									closed(selection)=0;
+-									A(selection).x=x(1:p2);
+-									A(selection).y=y(1:p2);
+-									A(end+1).x=x(p1:end);
+-									A(end).y=y(p1:end);
+-									A(end).density=A(selection).density;
+-									A(end).name=A(selection).name;
+-									closed(end+1)=0;
+-									numprofiles=numprofiles+1;
+-									numpoints=numpoints-(p1-p2-1);
+-								end
+-							else
+-								%only point removal
+-								n=length(A(selection).x);
+-								x(1:p2-1)=[];x(p1-p2+2:end)=[];%it should have been x(p2+1:end)
+-								y(1:p2-1)=[];y(p1-p2+2:end)=[];
+-								A(selection).x=x;
+-								A(selection).y=y;
+-								numpoints=numpoints-(n-length(A(selection).x));
+-								closed(selection)=0;
+-							end
+-						end
+-
+-						%plot new profile
+-						undoplots(prevplot);
+-						for i=1:numprofiles
+-							plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-								'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-						end
+-						points=[];
+-
+-					end
+-				end
+-			end
+-		else
+-			%RETRUN-> quit
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addinsideprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addinsideprofile.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addinsideprofile.m	(revision 12997)
+@@ -1,79 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%ADDINSIDEPROFILE - add apoint inside a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting...')
+-		return
+-	end	   
+-	if numpoints<2
+-		disp('at least two points are required, exiting...')
+-		return
+-	end	   
+-	hold on
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	end
+-
+-	loop=1;
+-	while loop
+-
+-		%first step, select a segment
+-		title('click on a segment, RETURN to exit','FontSize',14)
+-		[xi,yi] = ginput(1);
+-
+-		%first click
+-		if ~isempty(xi)
+-
+-			%get the closest segment
+-			[profsel indsel]=closestsegment(A,numprofiles,xi,yi);
+-
+-			%check that at least one segment exists
+-			if indsel==0
+-				disp('at least two points in one profile are required, exiting...')
+-				return
+-			end
+-
+-			%highlight selected segment
+-			plot([A(profsel).x(indsel) A(profsel).x(indsel+1)],[A(profsel).y(indsel) A(profsel).y(indsel+1)],...
+-				'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-			%next click
+-			title('click on the new point''s location, RETURN to exit','FontSize',14)
+-			[xi,yi,but] = ginput(1);
+-
+-			%second click
+-			if ~isempty(xi)
+-
+-				%add point to A
+-				A(profsel).x=[A(profsel).x(1:indsel,1); xi; A(profsel).x(indsel+1:end,1)];
+-				A(profsel).y=[A(profsel).y(1:indsel,1); yi; A(profsel).y(indsel+1:end,1)];
+-				numpoints=numpoints+1;
+-
+-				%plot new profile
+-				undoplots(prevplot);
+-				for i=1:numprofiles
+-					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-				end
+-
+-			else
+-				%RETURN->exit
+-				return
+-			end
+-		else
+-			%RETURN-> exit
+-			return
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestpoint.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestpoint.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestpoint.m	(revision 12997)
+@@ -1,21 +0,0 @@
+-function [profsel indsel]=closestpoint(A,numprofiles,xi,yi)
+-%CLOSESTPOINT - find the closest point of a profile
+-%
+-%   This routine find the point of the profile A that is the closest
+-%   to (xi,yi) and return the number of the profile and the number of
+-%   the point
+-%
+-%   Usage:
+-%     [profsel indsel]=closestpoint(A,numprofiles,xi,yi) 
+-
+-	%loop over the points of each profile, find the closest to (xi,yi)
+-	for i=1:numprofiles,
+-		distance=(xi-A(i).x).^2+(yi-A(i).y).^2;
+-		[newdistance p]=min(distance);
+-		if ((i==1) | (newdistance<olddistance)),
+-			indsel=p;
+-			profsel=i;
+-			olddistance=newdistance;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closeprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closeprofile.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closeprofile.m	(revision 12997)
+@@ -1,68 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%CLOSEPROFILE - close one or several profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile to be closed')
+-		return
+-	end
+-		   
+-	title('click on the profiles to be closed, RETURN to exit','FontSize',14)
+-	hold on
+-
+-	loop=1;
+-	selection=[];
+-
+-	while loop
+-
+-		%some checks,
+-		if numprofiles==0    
+-			disp('no profile present, exiting...')
+-			return            
+-		end  
+-		if ~any(~closed),
+-			disp('All the profiles are closed, exiting...')
+-			return
+-		end
+-
+-		[xi,yi] = ginput(1);
+-					  
+-		if ~isempty(xi)
+-
+-			%get closest profile
+-			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-
+-			if ismember(profsel,selection)
+-				%profile was in selection, remove it from the selection
+-				selection(find(selection==profsel))=[];
+-				%back to regular color
+-				plot(A(profsel).x,A(profsel).y,...
+-					'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			elseif closed(profsel),
+-				%profile already closed, do nothing
+-				disp('selected profile aready closed, make another selection'),
+-			else
+-				%add the profile to the list to be closed
+-				selection(end+1)=profsel;
+-				%in selectioncolor
+-				plot(A(profsel).x,A(profsel).y,...
+-					'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			end
+-		else
+-			%close the profiles
+-			for i=1:length(selection),
+-				A(selection(i)).x(end+1)=A(selection(i)).x(1);
+-				A(selection(i)).y(end+1)=A(selection(i)).y(1);
+-				numpoints=numpoints+1;
+-				closed(selection(i))=1;
+-			end
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/undoplots.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/undoplots.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/undoplots.m	(revision 12997)
+@@ -1,12 +0,0 @@
+-function  undoplots(prevplot)
+-%UNDOPLOTS - undo plots
+-%
+-%   Usage:undoplots(prevplot)
+-
+-	%erase all previous plots
+-	g=get(gca,'children');
+-	L=length(g);
+-	for i=1:L-prevplot
+-		delete(g(i));
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addprofile.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addprofile.m	(revision 12997)
+@@ -1,48 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%ADDPROFILE - add a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		   
+-	title('click to add a point to the new profile, RETURN to exit','FontSize',14)
+-	hold on
+-
+-	loop=1;
+-	x=[];
+-	y=[];
+-
+-	while loop
+-
+-		[xi,yi] = ginput(1);
+-					  
+-		if ~isempty(xi)
+-			x(end+1,1)=xi;
+-			y(end+1,1)=yi;
+-
+-			%plot everything
+-			undoplots(prevplot);
+-			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-		else
+-
+-			%check that the profile is not empty
+-			if ~isempty(x)
+-				A(end+1).x=x; 
+-				A(end).y=y; 
+-				A(end).name=root; 
+-				A(end).density=1; 
+-				numprofiles=numprofiles+1;
+-				numpoints=numpoints+length(x);
+-				closed(end+1)=0;
+-			end
+-
+-			%get out
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removepoints.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removepoints.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removepoints.m	(revision 12997)
+@@ -1,85 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%REMOVEPOINTS - remove a point from a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting...')
+-		return
+-	end
+-
+-	hold on
+-	loop=1;
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-	end
+-
+-	while loop
+-
+-		%check that at least one point is present
+-		if numpoints==0
+-			disp('at least one point are needed')
+-			return
+-		end	   
+-
+-		%select a point to be deleted
+-		title('click on the point to be removed, RETURN to exit','FontSize',14)
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-
+-			%get the closest point
+-			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-
+-			%remove point of A
+-			A(profsel).x(indsel)=[];
+-			A(profsel).y(indsel)=[];
+-
+-			%unclose the domain if only 2 points remaining
+-			if closed(profsel)
+-				if length(A(profsel).x)==3
+-					A(profsel).x(end)=[];
+-					A(profsel).y(end)=[];
+-					numpoints=numpoints-1;
+-					closed(profsel)=0;
+-				end
+-			end
+-
+-			%remove the last point if the profile is closed and indsel=end or 1
+-			if closed(profsel)
+-				if indsel==1 
+-					A(profsel).x(end)=A(profsel).x(1);
+-					A(profsel).y(end)=A(profsel).y(1);
+-				elseif indsel==length(A(profsel).x)
+-					A(profsel).x(1)=A(profsel).x(end);
+-					A(profsel).y(1)=A(profsel).y(end);
+-				end
+-			end
+-			numpoints=numpoints-1;
+-
+-			%plot new profile
+-			undoplots(prevplot);
+-			for i=1:numprofiles
+-				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-					'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-				if length(A(i).x)==1
+-					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker','o');
+-				end
+-			end
+-
+-		else
+-			%RETURN-> exit
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeseveralpoints.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeseveralpoints.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeseveralpoints.m	(revision 12997)
+@@ -1,130 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%REMOVESEVERALPOINTS - remove several point
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting...')
+-		return
+-	end	   
+-	if numpoints<3
+-		disp('at least 3 points are required, exiting...')
+-		return
+-	end	   
+-	hold on
+-	loop=1;
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	end
+-
+-	points=[];
+-
+-	%loop (at least 3 clicks needed)
+-	while loop
+-
+-		%some checks
+-		if numpoints<3
+-			disp('at least 3 points are required, exiting...')
+-			return
+-		end
+-
+-		%select a point
+-		if isempty(points)
+-			title('click on the first tip, RETURN to exit','FontSize',14)
+-		elseif length(points)==1
+-			title('click on the second tip, RETURN to exit','FontSize',14)
+-		else
+-			title('click in the middle of the area to be removed, RETURN to exit','FontSize',14)
+-		end
+-
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-			%get the closest point
+-			%first time, look at all profiles
+-			if isempty(points)
+-				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-				if ((closed(profsel) & length(A(profsel).x)<4) |  (~closed(profsel) & length(A(profsel).x)<3)),
+-					disp('the selected profile has less than 3 points, make another selection');
+-				else
+-					selection=profsel;
+-					points(end+1)=indsel;
+-					plot(A(profsel).x,A(profsel).y,...
+-						'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-					text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
+-				end
+-				%disp(['p1= ' num2str(indsel)]),
+-			else
+-				%get the 2d or 3d point for the given contou
+-				[profsel indsel]=closestpoint(A(selection),1,xi,yi);
+-				if ismember(indsel,points)
+-					disp('the selected points must be distinct')
+-				else
+-					%second click?
+-					if length(points)==1,
+-						points(end+1)=indsel;
+-						text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
+-						%disp(['p2= ' num2str(indsel)]),
+-					%third click?
+-					else
+-						p1=points(1); p2=points(2); p3=indsel;
+-						%disp(['p3= ' num2str(indsel)]),
+-						if p1<p2
+-							if p3>p1 & p3<p2
+-								A(selection).x(p1+1:p2-1)=[];
+-								A(selection).y(p1+1:p2-1)=[];
+-								numpoints=numpoints-(p2-p1-1);
+-							else
+-								A(selection).x=A(selection).x(p1:p2);
+-								A(selection).y=A(selection).y(p1:p2);
+-								numpoints=numpoints-(numpoints-1-p2)-(p1-1);
+-								if closed(selection)
+-									%reattach the tips
+-									A(selection).x(end+1)=A(selection).x(1);
+-									A(selection).y(end+1)=A(selection).y(1);
+-									numpoints=numpoints+1;
+-								end
+-							end
+-						else
+-							if p3>p2 & p3<p1
+-								A(selection).x(p2+1:p1-1)=[];
+-								A(selection).y(p2+1:p1-1)=[];
+-								numpoints=numpoints-(p1-p2-1);
+-							else
+-								A(selection).x=A(selection).x(p2:p1);
+-								A(selection).y=A(selection).y(p2:p1);
+-								numpoints=numpoints-(numpoints-1-p1)-(p2-1);
+-								if closed(selection)
+-									%reattach the tips
+-									A(selection).x(end+1)=A(selection).x(1);
+-									A(selection).y(end+1)=A(selection).y(1);
+-									numpoints=numpoints+1;
+-								end
+-							end
+-						end
+-
+-						%plot new profiles
+-						undoplots(prevplot);
+-						for i=1:numprofiles
+-							plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-								'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-						end
+-						points=[];
+-
+-					end
+-				end
+-			end
+-		else
+-			%RETRUN-> quit
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/modifyposition.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/modifyposition.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/modifyposition.m	(revision 12997)
+@@ -1,77 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%MODIFYPOSITION - modify the prosition of a point of a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting..')
+-		return
+-	end
+-
+-	hold on
+-	loop=1;
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	end
+-
+-	while loop
+-
+-		%select a point to be modified 
+-		title('click on the point to be modified, RETURN to exit','FontSize',14)
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-
+-			%get the closest point
+-			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-
+-			%plot the point in blue
+-			plot(A(profsel).x(indsel),A(profsel).y(indsel),...
+-				'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-				'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-			%select new location
+-			title('click on the new location, RETURN to exit','FontSize',14)
+-			[xi,yi] = ginput(1);
+-
+-			if ~isempty(xi)
+-
+-				%modification of its coordinates
+-				A(profsel).x(indsel)=xi;
+-				A(profsel).y(indsel)=yi;
+-
+-				%modify the last point if the profile is closed and indsel=end or 1
+-				if closed(profsel)
+-					if indsel==1 
+-						A(profsel).x(end)=xi;
+-						A(profsel).y(end)=yi;
+-					elseif indsel==length(A(profsel).x)
+-						A(profsel).x(1)=xi;
+-						A(profsel).y(1)=yi;
+-					end
+-				end
+-
+-				%plot new profile
+-				undoplots(prevplot);
+-				for i=1:numprofiles
+-					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-				end
+-			else
+-				%RETURN-> exit
+-				loop=0;
+-			end
+-		else
+-			%RETURN-> exit
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutprofile.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/cutprofile.m	(revision 12997)
+@@ -1,79 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%CUTPROFILE - cut a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting...')
+-		return
+-	end	   
+-	if numpoints<2
+-		disp('at least two points are needed')
+-		return
+-	end	   
+-	hold on
+-
+-	%plot squares
+-	for i=1:numprofiles
+-		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	end
+-
+-	loop=1;
+-	while loop
+-
+-		%select a segment
+-		title('click the segment to cut, RETURN to exit','FontSize',14)
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-
+-			%get the closest segment
+-			[profsel indsel]=closestsegment(A,numprofiles,xi,yi);
+-
+-			%check that at least one segment exists
+-			if indsel==0
+-				disp('at least 2 points are required');
+-				return,
+-			end
+-
+-			if ((closed(profsel) & length(A(profsel).x)<3) | (~closed(profsel) & length(A(profsel).x)<2))
+-				disp('at least 2 points are required, make another selection');
+-			else
+-				%cut A
+-				if closed(profsel)
+-					%open the contour
+-					A(profsel).x=[A(profsel).x(indsel+1:end-1,1);A(profsel).x(1:indsel,1)];
+-					A(profsel).y=[A(profsel).y(indsel+1:end-1,1);A(profsel).y(1:indsel,1)];
+-					numpoints=numpoints-1;
+-					closed(profsel)=0;
+-				else
+-					%cut the contour in 2 profiles
+-					A(end+1).x=A(profsel).x(indsel+1:end,1);
+-					A(end).y=A(profsel).y(indsel+1:end,1);
+-					A(end).name=root; 
+-					A(end).density=1; 
+-					A(profsel).x=A(profsel).x(1:indsel,1);
+-					A(profsel).y=A(profsel).y(1:indsel,1);
+-					numprofiles=numprofiles+1;
+-					closed(end+1)=0;
+-				end
+-
+-				%plot new profile
+-				undoplots(prevplot);
+-				for i=1:numprofiles
+-					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-				end
+-			end
+-		else
+-			%RETURN->exit
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeprofile.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/removeprofile.m	(revision 12997)
+@@ -1,56 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%REMOVEPROFILE - delete a profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-
+-	title('click on the profiles to be removed, RETURN to exit','FontSize',14)
+-	hold on
+-
+-	loop=1;
+-	selection=[];
+-
+-	while loop
+-
+-		%some checks
+-		if numprofiles==0
+-			disp('no profile to be removed, exiting...')
+-			return
+-		end
+-		   
+-		[xi,yi] = ginput(1);
+-					  
+-		if ~isempty(xi)
+-
+-			%get closest profile
+-			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-
+-			if ismember(profsel,selection)
+-				%profile was in selection, remove it
+-				selection(find(selection==profsel))=[];
+-				%back to regular color
+-				plot(A(profsel).x,A(profsel).y,...
+-					'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			else
+-				%add the profile to the list to be removed
+-				selection(end+1)=profsel;
+-				%in selectioncolor
+-				plot(A(profsel).x,A(profsel).y,...
+-					'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			end
+-		else
+-			%remove the profiles
+-			selection=sort(selection);
+-			for i=1:length(selection),
+-				numprofiles=numprofiles-1;
+-				numpoints=numpoints-length(A(selection(i)-(i-1)).x);
+-				A(selection(i)-(i-1))=[];
+-				closed(selection(i)-(i-1))=[];
+-			end
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestsegment.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestsegment.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/closestsegment.m	(revision 12997)
+@@ -1,28 +0,0 @@
+-function [profsel indsel]=closestsegment(A,numprofiles,xi,yi)
+-%CLOSESTSEGMENT - find the closest segment of a profile
+-%
+-%   This routine find the segment of the profile A that is the closest
+-%   to (xi,yi) and return the number of the profile and the number of
+-%   the first point belonging to this closest segment
+-%
+-%   Usage:
+-%     [profsel indsel]=closestsegment(A,numprofiles,xi,yi) 
+-
+-	%loop over the middles of each profile, find the closest to (xi,yi)
+-	profsel=0;
+-	indsel=0;
+-	first=1;
+-	for i=1:numprofiles,
+-		if length(A(i).x)>1
+-			middles=[(A(i).x(1:end-1)+A(i).x(2:end))/2 (A(i).y(1:end-1)+A(i).y(2:end))/2];
+-			distance=(xi-middles(:,1)).^2+(yi-middles(:,2)).^2;
+-			[newdistance p]=min(distance);
+-			if (first | (newdistance<olddistance)),
+-				first=0;
+-				indsel=p;
+-				profsel=i;
+-				olddistance=newdistance;
+-			end
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addendprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addendprofile.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addendprofile.m	(revision 12997)
+@@ -1,86 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%ADDENDPROFILE - add point at the end of a n existing profile
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		
+-	%some checks
+-	if numprofiles==0
+-		disp('no profile present, exiting...')
+-		return
+-	end	   
+-	if ~any(~closed)
+-		disp('all profiles are closed')
+-		return
+-	end	   
+-	%select a profile first
+-	if numprofiles>1
+-		%first step, select a profile
+-		isclosed=1;
+-		title('click on a profile, RETURN to exit','FontSize',14)
+-		while isclosed
+-			[xi,yi] = ginput(1);
+-			if ~isempty(xi)
+-				%get the closest point 
+-				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+-				if closed(profsel)
+-					disp('selected profile is closed, make another selection')
+-				else
+-					isclosed=0;
+-				end
+-
+-			else
+-				%RETURN -> out
+-				return
+-			end
+-		end
+-	else
+-		profsel=1;
+-	end
+-
+-	%initialize x and y
+-	x=A(profsel).x;
+-	y=A(profsel).y;
+-
+-	%plot the selected profile
+-	hold on
+-	plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-		'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-	plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-	loop=1;
+-	while loop
+-
+-		%first step, select a profile
+-		title('click to add point to the selected profile, RETURN to exit','FontSize',14)
+-		[xi,yi] = ginput(1);
+-
+-		if ~isempty(xi)
+-			x(end+1,1)=xi;
+-			y(end+1,1)=yi;
+-
+-			%plot everything
+-			undoplots(prevplot);
+-			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize')+2,'Marker',getfieldvalue(options,'Marker'));
+-
+-		else
+-
+-			%check that the profile is not empty
+-			if ~isempty(x)
+-				A(profsel).x=x; 
+-				A(profsel).y=y; 
+-				A(profsel).name=root; 
+-				A(profsel).density=1; 
+-				numpoints=numpoints+length(x);
+-			end
+-
+-			%get out
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addcontour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addcontour.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/addcontour.m	(revision 12997)
+@@ -1,50 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%ADDCONTOUR - add a closed contour
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot,root,options)
+-		   
+-	title('click to add a point to the new profile, RETURN to exit','FontSize',14)
+-	hold on
+-
+-	loop=1;
+-	x=[];
+-	y=[];
+-
+-	while loop
+-
+-		[xi,yi] = ginput(1);
+-					  
+-		if ~isempty(xi)
+-			x(end+1,1)=xi;
+-			y(end+1,1)=yi;
+-
+-			%plot everything
+-			undoplots(prevplot);
+-			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
+-				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-
+-		else
+-
+-			%check that the profile is not empty
+-			if ~isempty(x)
+-				x(end+1)=x(1);
+-				y(end+1)=y(1);
+-				A(end+1).x=x; 
+-				A(end).y=y; 
+-				A(end).name=root; 
+-				A(end).density=1; 
+-				numprofiles=numprofiles+1;
+-				numpoints=numpoints+length(x);
+-				closed(end+1)=1;
+-			end
+-
+-			%get out
+-			loop=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/mergeprofiles.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/mergeprofiles.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/manipulation/mergeprofiles.m	(revision 12997)
+@@ -1,152 +0,0 @@
+-function [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options);
+-%MERGEPROFILES - merge profiles
+-%
+-%   this script is used by exptool as an elementary operation
+-%   on an ARGUS profile. The user must select the two tips that
+-%   he/she wants to merge
+-%
+-%   Usage:
+-%      [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options)
+-
+-hold on
+-loop=1;
+-
+-%Take all the tips coordinates of open profiles
+-counter=1; tips=[];
+-for i=1:numprofiles
+-	if ~closed(i),
+-		%x and y coord, profile number, 1 if beginning, 2 and if end
+-		if length(A(i).x)==1,
+-			tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
+-			counter=counter+1;
+-		else
+-			tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
+-			tips(counter+1,:) = [A(i).x(end) A(i).y(end) i  2];
+-			counter=counter+2;
+-		end
+-	end
+-end
+-
+-if size(tips,1)<2
+-	disp('at least one unclosed profile is required')
+-	return
+-end
+-
+-%plot the tips only
+-plot(tips(:,1),tips(:,2),...
+-	'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-firsttip=1;
+-
+-%loop (at least 2 clicks needed)
+-while loop
+-
+-	%some checks
+-	if size(tips,1)<2
+-		disp('at least one unclosed profiles are required')
+-		return
+-	end
+-
+-	%select a point
+-	if firsttip
+-		title('click on the first tip, RETURN to exit','FontSize',14)
+-	else
+-		title('click on the second tip, RETURN to exit','FontSize',14)
+-	end
+-
+-	[xi,yi] = ginput(1);
+-
+-	if ~isempty(xi)
+-
+-		if firsttip
+-			%find the selected tip
+-			distance=(xi-tips(:,1)).^2+(yi-tips(:,2)).^2;
+-			[dmin tip1]=min(distance);
+-			numprofile1=tips(tip1,3);
+-			firsttip=0;
+-
+-			%remove tip1 from tips list
+-			newtips=tips;
+-			newtips(tip1,:)=[];
+-
+-			%plot selected tip
+-			plot(tips(tip1,1),tips(tip1,2),...
+-				'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-			plot(A(numprofile1).x,A(numprofile1).y,...
+-				'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-
+-		%second selection
+-		else
+-			distance=(xi-newtips(:,1)).^2+(yi-newtips(:,2)).^2;
+-			[dmin tip2]=min(distance);
+-			numprofile2=newtips(tip2,3);
+-
+-			if numprofile1==numprofile2
+-				%close the profile
+-				A(numprofile1).x(end+1)=A(numprofile1).x(1);
+-				A(numprofile1).y(end+1)=A(numprofile1).y(1);
+-				numpoints=numpoints+1;
+-				closed(numprofile1)=1;
+-
+-			else
+-
+-				if tips(tip1,4)==1 & newtips(tip2,4)==1,
+-					A(numprofile1).x=[flipud(A(numprofile2).x); A(numprofile1).x];
+-					A(numprofile1).y=[flipud(A(numprofile2).y); A(numprofile1).y];
+-					numprofiles=numprofiles-1;
+-
+-				elseif tips(tip1,4)==1 & newtips(tip2,4)==2,
+-					A(numprofile1).x=[A(numprofile2).x; A(numprofile1).x];
+-					A(numprofile1).y=[A(numprofile2).y; A(numprofile1).y];
+-					numprofiles=numprofiles-1;
+-
+-				elseif tips(tip1,4)==2 & newtips(tip2,4)==1,
+-					A(numprofile1).x=[A(numprofile1).x; A(numprofile2).x];
+-					A(numprofile1).y=[A(numprofile1).y; A(numprofile2).y];
+-					numprofiles=numprofiles-1;
+-
+-				elseif tips(tip1,4)==2 & newtips(tip2,4)==2,
+-					A(numprofile1).x=[A(numprofile1).x; flipud(A(numprofile2).x)];
+-					A(numprofile1).y=[A(numprofile1).y; flipud(A(numprofile2).y)];
+-					numprofiles=numprofiles-1;
+-				end
+-
+-				%delete profile2
+-				A(numprofile2)=[];
+-				closed(numprofile2)=[];
+-
+-			end
+-
+-			%update tips
+-			counter=1; tips=[];
+-			for i=1:numprofiles
+-				if ~closed(i),
+-					%x and y coord, profile number, 1 if beginning, 2 and if end
+-					if length(A(i).x)==1,
+-						tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
+-						counter=counter+1;
+-					else
+-						tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
+-						tips(counter+1,:) = [A(i).x(end) A(i).y(end) i  2];
+-						counter=counter+2;
+-					end
+-				end
+-			end
+-
+-			%plot new profile
+-			undoplots(prevplot);
+-			for i=1:numprofiles
+-				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
+-			end
+-			if ~isempty(tips)
+-				plot(tips(:,1),tips(:,2),...
+-					'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
+-			end
+-
+-			%back to beginning
+-			firsttip=1;
+-		end
+-	else
+-		%RETRUN-> quit
+-		loop=0;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/downstreamflowlines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/downstreamflowlines.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/downstreamflowlines.m	(revision 12997)
+@@ -1,110 +0,0 @@
+-function flowpath=downstreamflowlines(index,x,y,u,v,x0,y0,varargin)
+-%DOWNSTREAMFLOWLINES - compute flowlines from a given set of seed points
+-%
+-%   Usage:
+-%      flowpath=downstreamflowlines(index,x,y,u,v,x0,y0)
+-%
+-%   the velocity field is given by the couple (u,v) and the coordinates
+-%   of the seed points are (x0,y0). One can use one or several seed 
+-%   points
+-%
+-%   Example:
+-%      flowpath=downstreamflowlines(md.mesh.elements,md.mesh.x,md.mesh.y,md.vx,md.initialization.vy,x0,y0)
+-
+-%check input size
+-if nargin>9 | nargin<7,
+-	help flowlines
+-	error('flowlines error message: bad usage');
+-end
+-
+-%check input
+-if (length(x)~=length(y) | length(x)~=length(u) | length(x)~=length(v)),
+-	error('flowlines error message: x,y,u and v must have the same length');
+-end
+-if length(x)<3,
+-	error('flowlines error message: at least one element is required');
+-end
+-if length(x0)~=length(y0),
+-	error('flowlines error message: x0 and y0 do not have the same length');
+-end
+-
+-%get maxiter and precision
+-if nargin==9
+-	maxiter=varargin{1};%maximum number of iterations
+-	precision=varargin{2}; %division of each segment (higer precision increases number of segments)
+-else
+-	maxiter=200; %maximum number of iterations
+-	precision=1; %division of each segment (higer precision increases number of segments)
+-end
+-
+-%check seed points
+-tria=TriaSearch(index,x,y,x0,y0);
+-pos=find(isnan(tria));
+-x0(pos)=[];
+-y0(pos)=[];
+-
+-%initialize other variables
+-N=length(x0);
+-X=x0; Y=y0;
+-flowpath=struct('x',cell(N,1),'y',cell(N,1),'name','','density',1);
+-for i=1:N,
+-	flowpath(i).x=x0(i);
+-	flowpath(i).y=y0(i);
+-end
+-done=zeros(N,1);
+-
+-%get avegared length of each element
+-length_tria=1/3*(sqrt( (x(index(:,1))-x(index(:,2))).^2+(y(index(:,1))-y(index(:,2))).^2 )+...
+-	sqrt((x(index(:,1))-x(index(:,3))).^2+(y(index(:,1))-y(index(:,3))).^2 )+...
+-	sqrt((x(index(:,2))-x(index(:,3))).^2+(y(index(:,2))-y(index(:,3))).^2 ));
+-
+-%take velocity for each element
+-u=u(index)*[1;1;1]/3;
+-v=v(index)*[1;1;1]/3;
+-
+-%initialization:
+-counter=1;
+-
+-while any(~done) 
+-
+-	%find current triangle
+-	queue=find(~done);
+-	tria=TriaSearch(index,x,y,X(queue),Y(queue));
+-
+-	%check that the point is actually inside a triangle of the mesh
+-	listnan=find(isnan(tria));
+-	for i=1:length(listnan)
+-		%remove the last point
+-		flowpath(queue(listnan(i))).x(end)=[];
+-		flowpath(queue(listnan(i))).y(end)=[];
+-		done(queue(listnan(i)))=1;
+-	end
+-	tria(listnan)=[]; 
+-	queue(listnan)=[];
+-
+-	if isempty(tria),
+-		break;
+-	end
+-
+-	%velocity of the current triangle and norm it
+-	ut=u(tria); vt=v(tria); normv=sqrt(ut.^2+vt.^2);
+-	ut=ut./normv;vt=vt./normv;
+-
+-	%check counter
+-	if counter>maxiter
+-		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going forward'])
+-		break
+-	end
+-	counter=counter+1;
+-
+-	%remove stagnant point
+-	done(queue(find(ut==0 & vt==0)))=1;
+-
+-	%build next point
+-	for i=1:length(queue)
+-		X(queue(i))=flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision;
+-		Y(queue(i))=flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision;
+-		flowpath(queue(i)).x=[flowpath(queue(i)).x;flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision];
+-		flowpath(queue(i)).y=[flowpath(queue(i)).y;flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision];
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expflip.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expflip.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expflip.m	(revision 12997)
+@@ -1,19 +0,0 @@
+-function expflip(domainname)
+-%EXPFLIP: flip orientation of all contours and domains in domainname exp file.
+-%
+-%Usage: expflip('MassFlux1.exp');a
+-%
+-%
+-
+-
+-
+-
+-
+-a=expread(domainname,1);
+-
+-for i=1:length(a),
+-	a(i).x=flipud(a(i).x);
+-	a(i).y=flipud(a(i).y);
+-end
+-
+-expwrite(a,domainname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcoarsen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcoarsen.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expcoarsen.m	(revision 12997)
+@@ -1,74 +0,0 @@
+-function expcoarsen(newfile,oldfile,resolution);
+-%EXPCOARSEN - coarsen an exp contour
+-%
+-%   This routine read an Argus file and remove points with respect to
+-%   the resolution (in meters) given in input. 
+-%
+-%   Usage:
+-%      expcoarsen(newfile,oldfile,resolution)
+-%
+-%   Example:
+-%       expcoarsen('DomainOutline.exp','Antarctica.exp',4000)
+-
+-%Some checks
+-if nargin~=3 | nargout
+-	error('expcoarsen usage: expcoarsen(newfile,oldfile,resolution)')
+-elseif ~exist(oldfile)
+-	error(['expcut error message: the file ' oldfile  'does not exist'])
+-elseif exist(newfile),
+-	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
+-	if ~strcmpi(choice,'y'),
+-		disp('no modification done ... exiting');
+-		return;
+-	end
+-end
+-
+-%Get exp oldfile
+-[path root ext ver]=fileparts(oldfile);
+-A=expread(oldfile);
+-numprofiles=size(A,2);
+-
+-%Go through the profiles
+-count=1;
+-while count<=numprofiles,
+-
+-	%get number of points and initialize j
+-	numpoints=length(A(count).x);
+-	j=1;
+-
+-	%stop if we have reached end of profile (always keep the last point)
+-	while j<numpoints,
+-
+-		%See whether we keep this point or not
+-		distance=sqrt((A(count).x(j)-A(count).x(j+1))^2+(A(count).y(j)-A(count).y(j+1))^2);
+-		if distance<resolution & j<numpoints-1  %do not remove last point
+-			A(count).x(j+1)=[];
+-			A(count).y(j+1)=[];
+-			numpoints=numpoints-1;
+-		else
+-			division=floor(distance/resolution)+1;
+-			if division>=2,
+-				x=linspace(A(count).x(j),A(count).x(j+1),division)';
+-				y=linspace(A(count).y(j),A(count).y(j+1),division)';
+-				A(count).x=[A(count).x(1:j);x(2:end-1); A(count).x(j+1:end)];
+-				A(count).y=[A(count).y(1:j);y(2:end-1); A(count).y(j+1:end)];
+-
+-				%update current point
+-				j=j+1+division-2;
+-				numpoints=numpoints+division-2;
+-			else
+-				%update current point
+-				j=j+1;
+-			end
+-		end
+-	end
+-	if length(A(count).x)<=1,
+-		A(count)=[];
+-		numprofiles=numprofiles-1;
+-	else
+-		count=count+1;
+-	end
+-end
+-
+-%write output
+-expwrite(A,newfile);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expmaster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expmaster.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expmaster.m	(revision 12997)
+@@ -1,2 +0,0 @@
+-function expmaster(newfile,varargin)
+-	disp('expmaster has been renamed exptool due to the unpopularity of its name')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exporientation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exporientation.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/exporientation.m	(revision 12997)
+@@ -1,12 +0,0 @@
+-function exporientation(filename)
+-
+-a=expread(filename);
+-
+-dx=diff(a.x);
+-dx=[dx;dx(end)];
+-
+-dy=diff(a.y);
+-dy=[dy;dy(end)];
+-
+-quiver(a.x,a.y,dx,dy);
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsplit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsplit.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsplit.m	(revision 12997)
+@@ -1,31 +0,0 @@
+-function expsplit(domainoutline)
+-%EXPSPLIT - split exp file into sub-contours
+-%
+-%   This routine reads in a domain outline file (Argus format) and plots all the contours 
+-%   This will create as many files there are contours in the domain, each file will be postfix with _i
+-%   where i is the contour name. 
+-%
+-%   Usage:
+-%      expsplit(domainoutline)
+-%
+-%   Example:
+-%      expsplit('Domain.exp');
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%check nargin
+-if ~nargin | nargin>1
+-	help expsplit
+-	error('expsplit error message: bad usage');
+-end
+-
+-[path,root,ext]=fileparts(domainoutline);
+-
+-%Read file: 
+-domains=expread(domainoutline,1);
+-
+-%split and write contours: 
+-for i=1:length(domains),
+-	subdomain=domains(i);
+-	expwrite(subdomain,[root '_' num2str(i)  ext]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expswapxy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expswapxy.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expswapxy.m	(revision 12997)
+@@ -1,23 +0,0 @@
+-function expswapxy(filename)
+-%EXPSWAP - swap x and y fields
+-% 
+-%   Usage:
+-%      expswap(file)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-
+-contours=expread(filename,1);
+-
+-newcontours=contours(1);
+-
+-for i=1:length(contours), 
+-	contour=contours(i);
+-	newcontour=contour;
+-	newcontour.x=contour.y;
+-	newcontour.y=contour.x;
+-	newcontours(end+1)=newcontour;
+-end
+-newcontours=newcontours(2:end);
+-
+-expwrite(newcontours,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/explink.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/explink.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/explink.m	(revision 12997)
+@@ -1,29 +0,0 @@
+-function explink(domainoutline,minthreshold,step)
+-%EXPLINK - allow to link several segments of domain outline together
+-%
+-%   Takes a domain outline made of various segments, and links them together in one 
+-%   domain outline. Use expview to see end result.
+-%
+-%   Usage:
+-%      explink(domainoutline,minthreshold,step)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-notdone=1;
+-
+-while notdone,
+-
+-	for i=1:1000,
+-		status=expconcatenate(domainoutline,minthreshold+(i-1)*step);
+-		if status==0,
+-			return;
+-		end
+-		if status==1,
+-			break;
+-		end
+-		if status==-1,
+-			continue;
+-		end
+-	end
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdisp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdisp.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdisp.m	(revision 12997)
+@@ -1,52 +0,0 @@
+-function expdisp(domainoutline,varargin)
+-%EXPDISP - plot the contours of a domain outline file
+-%
+-%   This routine reads in a domain outline file (Argus format) and plots all the contours 
+-%
+-%   Usage:
+-%      expdisp(domainoutline,varargin)
+-%      expdisp(domainoutline,figurenumber,linestyle,linewidth,unitmultiplier)
+-%
+-%   Example:
+-%      expdisp('Domain.exp',1,'--r',2,10^3);
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%check nargin
+-if ~nargin | nargin>5
+-	help expdisp
+-	error('expdisp error message: bad usage');
+-end
+-
+-%parse input
+-if nargin<=1,
+-	figurenumber=1;
+-else
+-	figurenumber=varargin{1};
+-end
+-if nargin<=2
+-	linestyle='r-';
+-else
+-	linestyle=varargin{2};
+-end
+-if nargin<=3
+-	linewidth=1;
+-else
+-	linewidth=varargin{3};
+-end
+-if nargin<=4
+-	unitmultiplier=1;
+-else
+-	unitmultiplier=varargin{4}; if isnan(unitmultiplier), unitmultiplier=1; end
+-end
+-
+-domain=expread(domainoutline);
+-
+-figure(figurenumber),hold on
+-for i=1:length(domain),
+-	if (isnumeric(linestyle))
+-		plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'Color',linestyle,'linewidth',linewidth);
+-	else
+-		plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,linestyle,'linewidth',linewidth);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsquare.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsquare.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expsquare.m	(revision 12997)
+@@ -1,45 +0,0 @@
+-function expbox(filename)
+-%EXPBOX - Create a ARGUS file using to clicks
+-%
+-%   Two clicks on a plot are used to generate a rectangular box
+-%   This box is written in EXP format on filename
+-%
+-%   Usage:
+-%      expbox(filename)
+-
+-%check
+-if exist(filename,'file'),
+-	choice=input(['A file ' filename ' already exists, do you want to modify it? (y/n)'],'s');
+-	if ~strcmpi(choice,'y'),
+-		disp('no modification done ... exiting');
+-		return
+-	end
+-end
+-
+-%Get points
+-disp('Click twice to define a rectangular domain. First click for upper left corner, second for lower right corner');
+-[x,y]=ginput(2);
+-
+-xmiddle=mean(x);
+-ymiddle=mean(y);
+-
+-x1=x(1); y1=y(1);
+-x3=x(2); y3=y(2);
+-
+-Diag=[x1-xmiddle;y1-ymiddle];
+-
+-Vector=[xmiddle;ymiddle]+[-Diag(2);Diag(1)];
+-x2=Vector(1); y2=Vector(2);
+-
+-Vector=[xmiddle;ymiddle]-[-Diag(2);Diag(1)];
+-x4=Vector(1); y4=Vector(2);
+-
+-%Build Exp structure
+-A=struct();
+-A.nods=5;
+-A.density=1;
+-A.x=[x1 x2 x3 x4 x1]';
+-A.y=[y1 y2 y3 y4 y1]';
+-
+-%Write structure
+-expwrite(A,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdoc.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Exp/expdoc.m	(revision 12997)
+@@ -1,36 +0,0 @@
+-function expdoc()
+-%EXPDOC - create a doc for EXP routines
+-%
+-%   Usage:
+-%      expdoc()
+-
+-disp(' ');
+-disp('   Utilities dedicated to ARGUS Files (''.exp'' extension)'); 
+-disp('     expboxgen: creates a domain outline box for a .tif image for the mosaic tiff');
+-disp('            usage: expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)');
+-disp('            x0,y0 and nx,ny are the cropping coordinates (upper left and lower right corners in the larger tiff image)');
+-disp('            paramter_filename is the parameter file name for the mosaic tiff image. box_filename is self explanatory.');
+-disp('     expconcatenate: display all the profiles present in an Argus file and merge them accordingly to the tips selected by the user')
+-disp('            usage:  expconcatenate(newfile,oldfile)')
+-disp('     expcreatecircle: creates a closed Argus contour centered on (x,y), of radius radius_length. The contour is made of N points');
+-disp('            usage: expcreatecircle(filename,x0,y0,radius_length,N)');
+-disp('     expcreatecontour: creates a closed Argus contour delimited by the ''clicks'' of the user');
+-disp('            usage: expcreatecontour(filename)');
+-disp('     expcreateprofile: creates an Argus profile delimited by the ''clicks'' of the user');
+-disp('            usage: expcreateprofile(filename)');
+-disp('     expcut: display the contents of an Argus file and allow the user cut the profiles');
+-disp('            usage: expcut(newfilename,oldfilename)');
+-disp('     expdisp: display the contents of an Argus file');
+-disp('            usage:  expdisp(filename,[figure number],[line style])');
+-disp('     expgen: creates an Argus file from a contour (x,y) and a flag indicating if the contour must be closed or open');
+-disp('            usage:  expgen(filename,contours,close_flag)');
+-disp('     explink: takes a domain outline made of various segments, and links them together in one domain outline. Use expview to see end result');
+-disp('            usage: explink(domainoutline,minthreshold,step)');
+-disp('     exptool: allows the user to create, close, merge, remove,... Argus files and save the result in newfile');
+-disp('            usage: exptool(newfile,[oldfile1],[oldfile2],[oldfile3],[...]');
+-disp('     expread: reads an Argus file and build a structure that holds all the information of the file');
+-disp('            usage: expread(file,close_flag)');
+-disp('     expselect: display all the profiles of oldfile, the user clicks on the contour he/she wants to remove. Results saved in newfile');
+-disp('            usage: expselect(newfile,oldfile)');
+-disp('     expwrite: writes an Argus file from a structure given in input???');
+-disp('            usage: expwrite(structure,filename)');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ElementsFromEdge.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ElementsFromEdge.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ElementsFromEdge.m	(revision 12997)
+@@ -1,15 +0,0 @@
+-function edgeelements=ElementsFromEdge(elements,A,B) 
+-%ELEMENTSFROMEDGE: find elements connected to one edge defined by nodes A and B
+-%
+-% Usage: edgeelements=ElementsFromEdge(elements,A,B) 
+-%
+-% Eg:    edgeelements=ElementsFromEdge(md.mesh.elements,tip1,tip2)
+-%
+-%
+-edgeelements=find(...
+-(elements(:,1)==A & elements(:,2)==B )| ...
+-(elements(:,1)==A & elements(:,3)==B )| ...
+-(elements(:,2)==A & elements(:,3)==B )| ...
+-(elements(:,2)==A & elements(:,1)==B )| ...
+-(elements(:,3)==A & elements(:,1)==B )| ...
+-(elements(:,3)==A & elements(:,2)==B ));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MergeMetrics.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MergeMetrics.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MergeMetrics.m	(revision 12997)
+@@ -1,15 +0,0 @@
+-function metric=MergeMetrics(metric1,metric2)
+-
+-M1xx=metric1(:,1); M1xy=metric1(:,2); M1yy=metric1(:,3);
+-M1lambda1=0.5*((M1xx+M1yy)+sqrt(4*M1xy.^2+(M1xx-M1yy).^2));
+-M1lambda2=0.5*((M1xx+M1yy)-sqrt(4*M1xy.^2+(M1xx-M1yy).^2));
+-lambda1=min(M1lambda1,M1lambda2);
+-
+-M2xx=metric1(:,1); M2xy=metric1(:,2); M2yy=metric1(:,3);
+-M2lambda1=0.5*((M2xx+M2yy)+sqrt(4*M2xy.^2+(M2xx-M2yy).^2));
+-M2lambda2=0.5*((M2xx+M2yy)-sqrt(4*M2xy.^2+(M2xx-M2yy).^2));
+-lambda2=min(M2lambda2,M2lambda2);
+-
+-metric=metric1;
+-pos=find(lambda2<lambda1);
+-metric(pos,:)=metric2(pos,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/NodeInElement.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/NodeInElement.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/NodeInElement.m	(revision 12997)
+@@ -1,41 +0,0 @@
+-function node_in_element=NodeInElement(newx,newy,elements,x,y,nodeconnectivity);
+-%NODEINELEMENT: find for a list of nodes (in newx,newy), which elements in the mesh (elements,x,y) they belong to.
+-%
+-%  Usage: node_in_element=NodeInElement(newx,newy,elements,x,y,md.mesh.vertexconnectivity);
+-%
+-%  See also Nodeconnectivity
+-%
+-epsilon=10^-10;
+-
+-%compute some quantities that will speed up the process
+-x3x1=x(elements(:,1))-x(elements(:,3));
+-y3y1=y(elements(:,1))-y(elements(:,3));
+-x3x2=x(elements(:,2))-x(elements(:,3));
+-y3y2=y(elements(:,2))-y(elements(:,3));
+-x3=x(elements(:,3));
+-y3=y(elements(:,3));
+-delta=x(elements(:,2)).*y(elements(:,3))-y(elements(:,2)).*x(elements(:,3))-x(elements(:,1)).*y(elements(:,3))+y(elements(:,1)).*x(elements(:,3))+x(elements(:,1)).*y(elements(:,2))-y(elements(:,1)).*x(elements(:,2));
+-
+-%max connectivity:
+-max_connectivity=max(nodeconnectivity(:,end));
+-node_in_element=zeros(length(newx),max_connectivity+1); %last column is the number of elements to which the row node is connected.
+-
+-for i=1:length(newx),
+-	x0=newx(i);
+-	y0=newy(i);
+-	
+-	%first area coordinate
+-	area_1=(y3y2.*(x0-x3)-x3x2.*(y0-y3))./delta;
+-	%second area coordinate
+-	area_2=(x3x1.*(y0-y3)-y3y1.*(x0-x3))./delta;
+-	%third area coordinate
+-	area_3=1-area_1-area_2;
+-	
+-	%get elements for which all area coordinates are positive (meaning (x0,y0) belongs to these elements
+-	pos=find((area_1>=0-epsilon) & (area_2>=0-epsilon) & (area_3>=0-epsilon));
+-
+-	num_elements=length(pos);
+-
+-	node_in_element(i,1:num_elements)=pos;
+-	node_in_element(i,end)=num_elements;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeHessian.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeHessian.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeHessian.m	(revision 12997)
+@@ -1,60 +0,0 @@
+-function hessian=ComputeHessian(index,x,y,field,type)
+-%COMPUTEHESSIAN - compute hessian matrix from a field
+-%
+-%   Compute the hessian matrix of a given field
+-%   return the three components Hxx Hxy Hyy
+-%   for each element or each node
+-%
+-%   Usage:
+-%      hessian=ComputeHessian(index,x,y,field,type)
+-%
+-%   Example:
+-%      hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vel_obs,'node')
+-
+-%some variables
+-numberofnodes=length(x);
+-numberofelements=size(index,1);
+-
+-%some checks
+-if length(field)~=numberofnodes & length(field)~=numberofelements,
+-	error('ComputeHessian error message: the given field size not supported yet');
+-end
+-if strcmpi(type,'node') & strcmpi(type,'element'),
+-	error('ComputeHessian error message: only ''node'' or ''element'' type supported yet');
+-end
+-
+-%initialization
+-line=index(:);
+-linesize=3*numberofelements;
+-
+-%get areas and  nodal functions coefficients N(x,y)=alpha x + beta y + gamma 
+-[alpha beta]=GetNodalFunctionsCoeff(index,x,y);
+-areas=GetAreas(index,x,y);
+-
+-%comput weights that holds the volume of all the element holding the node i
+-weights=sparse(line,ones(linesize,1),repmat(areas,3,1),numberofnodes,1);
+-
+-%compute field on nodes if on elements
+-if length(field)==numberofelements,
+-	field=sparse(line,ones(linesize,1),repmat(areas.*field,3,1),numberofnodes,1)./weights ;
+-end
+-
+-%Compute gradient for each element
+-grad_elx=sum(field(index).*alpha,2); 
+-grad_ely=sum(field(index).*beta,2);
+-
+-%Compute gradient for each node (average of the elements around)
+-gradx=sparse(line,ones(linesize,1),repmat(areas.*grad_elx,3,1),numberofnodes,1);
+-grady=sparse(line,ones(linesize,1),repmat(areas.*grad_ely,3,1),numberofnodes,1);
+-gradx=gradx./weights;
+-grady=grady./weights;
+-
+-%Compute hessian for each element
+-hessian=[sum(gradx(index).*alpha,2) sum(grady(index).*alpha,2) sum(grady(index).*beta,2)];
+-
+-if strcmpi(type,'node')
+-	%Compute Hessian on the nodes (average of the elements around)
+-	hessian=[sparse(line,ones(linesize,1),repmat(areas.*hessian(:,1),3,1),numberofnodes,1)./weights ...
+-		sparse(line,ones(linesize,1),repmat(areas.*hessian(:,2),3,1),numberofnodes,1)./weights ...
+-		sparse(line,ones(linesize,1),repmat(areas.*hessian(:,3),3,1),numberofnodes,1)./weights ];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/meshread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/meshread.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/meshread.m	(revision 12997)
+@@ -1,41 +0,0 @@
+-function Struct=meshread(filename);
+-
+-%some checks
+-if ~exist(filename),
+-	error(['meshread error message: file ' filename ' not found!']);
+-end
+-
+-fid=fopen(filename,'r');
+-
+-while (~feof(fid)),
+-
+-	A=fscanf(fid,'%s',1);
+-
+-	if strcmp(A,'MeshVersionFormatted');
+-		Struct.Version=fscanf(fid,'%s',1);
+-
+-	elseif strcmp(A,'Dimension'),
+-		Struct.Dimension=fscanf(fid,'%i',1);
+-
+-	elseif strcmp(A,'Vertices'),
+-		Struct.nods=fscanf(fid,'%i',1);
+-		A=fscanf(fid,'%f %f %f',[3 Struct.nods]);
+-		Struct.x=A(1,:)';
+-		Struct.y=A(2,:)';
+-
+-	elseif strcmp(A,'Triangles'),
+-		Struct.nels=fscanf(fid,'%i',1);
+-		A=fscanf(fid,'%i %i %i',[4 Struct.nels]);
+-		Struct.index=A(1:3,:)';
+-
+-	elseif strcmp(A,'Quadrilaterals'),
+-		Struct.nels=fscanf(fid,'%i',1);
+-		A=fscanf(fid,'%i %i %i %i',[5 Struct.nels]);
+-		Struct.index=A(1:4,:)';
+-	else
+-		%do nothing
+-
+-	end
+-end
+-
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetNodalFunctionsCoeff.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetNodalFunctionsCoeff.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetNodalFunctionsCoeff.m	(revision 12997)
+@@ -1,56 +0,0 @@
+-function [alpha beta varargout]=GetNodalFunctionsCoeff(index,x,y)
+-%GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
+-%
+-%   Compute the coefficients alpha beta and optionaly gamma of
+-%   2d triangular elements. For each element, the nodal function
+-%   is defined as:
+-%   N(x,y)=sum(i=1:3) alpha_i * x + beta_i * y + gamma_i
+-%
+-%   Usage:
+-%      [alpha beta]=GetNodalFunctionsCoeff(index,x,y);
+-%      [alpha beta gamma]=GetNodalFunctionsCoeff(index,x,y);
+-%
+-%   Example:
+-%      [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
+-
+-%make columns out of x and y
+-x=x(:); y=y(:);
+-
+-%get nels and nods
+-nels=size(index,1);
+-nods=length(x);
+-
+-%some checks
+-if nargin~=3 | (nargout~=2 & nargout~=3),
+-	help GetNodalFunctionsCoeff
+-	error('GetNodalFunctionsCoeff error message: bad usage')
+-end
+-if length(y)~=nods,
+-	error('GetNodalFunctionsCoeff error message: x and y do not have the same length')
+-end
+-if max(index(:))>nods,
+-	error(['GetNodalFunctionsCoeff error message: index should not have values above ' num2str(nods) ])
+-end
+-if size(index,2)~=3,
+-	error('GetNodalFunctionsCoeff error message: only 2d meshes supported. index should have 3 columns.')
+-end
+-
+-%initialize output
+-alpha=zeros(nels,3);
+-beta=zeros(nels,3);
+-
+-%compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
+-x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
+-y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
+-invdet=1./(x1.*(y2-y3)-x2.*(y1-y3)+x3.*(y1-y2));
+-
+-%get alpha and beta
+-alpha=[invdet.*(y2-y3) invdet.*(y3-y1) invdet.*(y1-y2)];
+-beta =[invdet.*(x3-x2) invdet.*(x1-x3) invdet.*(x2-x1)];
+-
+-%get gamma if requested
+-if nargout==3,
+-	gamma=zeros(nels,3);
+-	gamma=[invdet.*(x2.*y3-x3.*y2) invdet.*(y1.*x3-y3.*x1) invdet.*(x1.*y2-x2.*y1)];
+-	varargout{1}=gamma;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/intersections.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/intersections.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/intersections.m	(revision 12997)
+@@ -1,279 +0,0 @@
+-function [x0,y0,iout,jout] = intersections(x1,y1,x2,y2,robust)
+-%INTERSECTIONS Intersections of curves.
+-%   Computes the (x,y) locations where two curves intersect.  The curves
+-%   can be broken with NaNs or have vertical segments.
+-%
+-% Example:
+-%   [X0,Y0] = intersections(X1,Y1,X2,Y2,ROBUST);
+-%
+-% where X1 and Y1 are equal-length vectors of at least two points and
+-% represent curve 1.  Similarly, X2 and Y2 represent curve 2.
+-% X0 and Y0 are column vectors containing the points at which the two
+-% curves intersect.
+-%
+-% ROBUST (optional) set to 1 or true means to use a slight variation of the
+-% algorithm that might return duplicates of some intersection points, and
+-% then remove those duplicates.  The default is true, but since the
+-% algorithm is slightly slower you can set it to false if you know that
+-% your curves don't intersect at any segment boundaries.  Also, the robust
+-% version properly handles parallel and overlapping segments.
+-%
+-% The algorithm can return two additional vectors that indicate which
+-% segment pairs contain intersections and where they are:
+-%
+-%   [X0,Y0,I,J] = intersections(X1,Y1,X2,Y2,ROBUST);
+-%
+-% For each element of the vector I, I(k) = (segment number of (X1,Y1)) +
+-% (how far along this segment the intersection is).  For example, if I(k) =
+-% 45.25 then the intersection lies a quarter of the way between the line
+-% segment connecting (X1(45),Y1(45)) and (X1(46),Y1(46)).  Similarly for
+-% the vector J and the segments in (X2,Y2).
+-%
+-% You can also get intersections of a curve with itself.  Simply pass in
+-% only one curve, i.e.,
+-%
+-%   [X0,Y0] = intersections(X1,Y1,ROBUST);
+-%
+-% where, as before, ROBUST is optional.
+-
+-% Version: 1.10, 25 February 2008
+-% Author:  Douglas M. Schwarz
+-% Email:   dmschwarz=ieee*org, dmschwarz=urgrad*rochester*edu
+-% Real_email = regexprep(Email,{'=','*'},{'@','.'})
+-
+-
+-% Theory of operation:
+-%
+-% Given two line segments, L1 and L2,
+-%
+-%   L1 endpoints:  (x1(1),y1(1)) and (x1(2),y1(2))
+-%   L2 endpoints:  (x2(1),y2(1)) and (x2(2),y2(2))
+-%
+-% we can write four equations with four unknowns and then solve them.  The
+-% four unknowns are t1, t2, x0 and y0, where (x0,y0) is the intersection of
+-% L1 and L2, t1 is the distance from the starting point of L1 to the
+-% intersection relative to the length of L1 and t2 is the distance from the
+-% starting point of L2 to the intersection relative to the length of L2.
+-%
+-% So, the four equations are
+-%
+-%    (x1(2) - x1(1))*t1 = x0 - x1(1)
+-%    (x2(2) - x2(1))*t2 = x0 - x2(1)
+-%    (y1(2) - y1(1))*t1 = y0 - y1(1)
+-%    (y2(2) - y2(1))*t2 = y0 - y2(1)
+-%
+-% Rearranging and writing in matrix form,
+-%
+-%  [x1(2)-x1(1)       0       -1   0;      [t1;      [-x1(1);
+-%        0       x2(2)-x2(1)  -1   0;   *   t2;   =   -x2(1);
+-%   y1(2)-y1(1)       0        0  -1;       x0;       -y1(1);
+-%        0       y2(2)-y2(1)   0  -1]       y0]       -y2(1)]
+-%
+-% Let's call that A*T = B.  We can solve for T with T = A\B.
+-%
+-% Once we have our solution we just have to look at t1 and t2 to determine
+-% whether L1 and L2 intersect.  If 0 <= t1 < 1 and 0 <= t2 < 1 then the two
+-% line segments cross and we can include (x0,y0) in the output.
+-%
+-% In principle, we have to perform this computation on every pair of line
+-% segments in the input data.  This can be quite a large number of pairs so
+-% we will reduce it by doing a simple preliminary check to eliminate line
+-% segment pairs that could not possibly cross.  The check is to look at the
+-% smallest enclosing rectangles (with sides parallel to the axes) for each
+-% line segment pair and see if they overlap.  If they do then we have to
+-% compute t1 and t2 (via the A\B computation) to see if the line segments
+-% cross, but if they don't then the line segments cannot cross.  In a
+-% typical application, this technique will eliminate most of the potential
+-% line segment pairs.
+-
+-
+-% Input checks.
+-error(nargchk(2,5,nargin))
+-
+-% Adjustments when fewer than five arguments are supplied.
+-switch nargin
+-	case 2
+-		robust = true;
+-		x2 = x1;
+-		y2 = y1;
+-		self_intersect = true;
+-	case 3
+-		robust = x2;
+-		x2 = x1;
+-		y2 = y1;
+-		self_intersect = true;
+-	case 4
+-		robust = true;
+-		self_intersect = false;
+-	case 5
+-		self_intersect = false;
+-end
+-
+-% x1 and y1 must be vectors with same number of points (at least 2).
+-if sum(size(x1) > 1) ~= 1 || sum(size(y1) > 1) ~= 1 || ...
+-		length(x1) ~= length(y1)
+-	error('X1 and Y1 must be equal-length vectors of at least 2 points.')
+-end
+-% x2 and y2 must be vectors with same number of points (at least 2).
+-if sum(size(x2) > 1) ~= 1 || sum(size(y2) > 1) ~= 1 || ...
+-		length(x2) ~= length(y2)
+-	error('X2 and Y2 must be equal-length vectors of at least 2 points.')
+-end
+-
+-
+-% Force all inputs to be column vectors.
+-x1 = x1(:);
+-y1 = y1(:);
+-x2 = x2(:);
+-y2 = y2(:);
+-
+-% Compute number of line segments in each curve and some differences we'll
+-% need later.
+-n1 = length(x1) - 1;
+-n2 = length(x2) - 1;
+-xy1 = [x1 y1];
+-xy2 = [x2 y2];
+-dxy1 = diff(xy1);
+-dxy2 = diff(xy2);
+-
+-% Determine the combinations of i and j where the rectangle enclosing the
+-% i'th line segment of curve 1 overlaps with the rectangle enclosing the
+-% j'th line segment of curve 2.
+-[i,j] = find(repmat(min(x1(1:end-1),x1(2:end)),1,n2) <= ...
+-	repmat(max(x2(1:end-1),x2(2:end)).',n1,1) & ...
+-	repmat(max(x1(1:end-1),x1(2:end)),1,n2) >= ...
+-	repmat(min(x2(1:end-1),x2(2:end)).',n1,1) & ...
+-	repmat(min(y1(1:end-1),y1(2:end)),1,n2) <= ...
+-	repmat(max(y2(1:end-1),y2(2:end)).',n1,1) & ...
+-	repmat(max(y1(1:end-1),y1(2:end)),1,n2) >= ...
+-	repmat(min(y2(1:end-1),y2(2:end)).',n1,1));
+-
+-% For one segment in x1,y1, i and j are returned as row vectors.  They
+-% need to be column vectors, or iout and jout below will err out.
+-% (jes, 6/11/10)
+-
+-if (size(i,1) == 1)
+-    i=i';
+-end
+-if (size(j,1) == 1)
+-    j=j';
+-end
+-
+-% Find segments pairs which have at least one vertex = NaN and remove them.
+-% This line is a fast way of finding such segment pairs.  We take
+-% advantage of the fact that NaNs propagate through calculations, in
+-% particular subtraction (in the calculation of dxy1 and dxy2, which we
+-% need anyway) and addition.
+-% At the same time we can remove redundant combinations of i and j in the
+-% case of finding intersections of a line with itself.
+-if self_intersect
+-	remove = isnan(sum(dxy1(i,:) + dxy2(j,:),2)) | j <= i + 1;
+-else
+-	remove = isnan(sum(dxy1(i,:) + dxy2(j,:),2));
+-end
+-i(remove) = [];
+-j(remove) = [];
+-
+-% Initialize matrices.  We'll put the T's and B's in matrices and use them
+-% one column at a time.  AA is a 3-D extension of A where we'll use one
+-% plane at a time.
+-n = length(i);
+-T = zeros(4,n);
+-AA = zeros(4,4,n);
+-AA([1 2],3,:) = -1;
+-AA([3 4],4,:) = -1;
+-AA([1 3],1,:) = dxy1(i,:).';
+-AA([2 4],2,:) = dxy2(j,:).';
+-B = -[x1(i) x2(j) y1(i) y2(j)].';
+-
+-% Loop through possibilities.  Trap singularity warning and then use
+-% lastwarn to see if that plane of AA is near singular.  Process any such
+-% segment pairs to determine if they are colinear (overlap) or merely
+-% parallel.  That test consists of checking to see if one of the endpoints
+-% of the curve 2 segment lies on the curve 1 segment.  This is done by
+-% checking the cross product
+-%
+-%   (x1(2),y1(2)) - (x1(1),y1(1)) x (x2(2),y2(2)) - (x1(1),y1(1)).
+-%
+-% If this is close to zero then the segments overlap.
+-
+-% If the robust option is false then we assume no two segment pairs are
+-% parallel and just go ahead and do the computation.  If A is ever singular
+-% a warning will appear.  This is faster and obviously you should use it
+-% only when you know you will never have overlapping or parallel segment
+-% pairs.
+-
+-if robust
+-	overlap = false(1,n);
+-	warning_state = warning('off','MATLAB:singularMatrix');
+-	% Use try-catch to guarantee original warning state is restored.
+-	try
+-		lastwarn('')
+-		for k = 1:n
+-			T(:,k) = AA(:,:,k)\B(:,k);
+-			[unused,last_warn] = lastwarn;
+-			lastwarn('')
+-			if strcmp(last_warn,'MATLAB:singularMatrix')
+-				% Force in_range(k) to be false.
+-				T(1,k) = NaN;
+-				% Determine if these segments overlap or are just parallel.
+-				overlap(k) = rcond([dxy1(i(k),:);xy2(j(k),:) - xy1(i(k),:)]) < eps;
+-			end
+-		end
+-		warning(warning_state)
+-	catch
+-		warning(warning_state)
+-		rethrow(lasterror)
+-	end
+-	% Find where t1 and t2 are between 0 and 1 and return the corresponding
+-	% x0 and y0 values.
+-	in_range = T(1,:) >= 0 & T(2,:) >= 0 & T(1,:) <= 1 & T(2,:) <= 1;
+-	% For overlapping segment pairs the algorithm will return an
+-	% intersection point that is at the center of the overlapping region.
+-	if any(overlap)
+-		ia = i(overlap);
+-		ja = j(overlap);
+-		% set x0 and y0 to middle of overlapping region.
+-		T(3,overlap) = (max(min(x1(ia),x1(ia+1)),min(x2(ja),x2(ja+1))) + ...
+-			min(max(x1(ia),x1(ia+1)),max(x2(ja),x2(ja+1)))).'/2;
+-		T(4,overlap) = (max(min(y1(ia),y1(ia+1)),min(y2(ja),y2(ja+1))) + ...
+-			min(max(y1(ia),y1(ia+1)),max(y2(ja),y2(ja+1)))).'/2;
+-		selected = in_range | overlap;
+-	else
+-		selected = in_range;
+-	end
+-	xy0 = T(3:4,selected).';
+-	
+-	% Remove duplicate intersection points.
+-	[xy0,index] = unique(xy0,'rows');
+-	x0 = xy0(:,1);
+-	y0 = xy0(:,2);
+-	
+-	% Compute how far along each line segment the intersections are.
+-	if nargout > 2
+-		sel_index = find(selected);
+-		sel = sel_index(index);
+-		iout = i(sel) + T(1,sel).';
+-		jout = j(sel) + T(2,sel).';
+-	end
+-else % non-robust option
+-	for k = 1:n
+-		[L,U] = lu(AA(:,:,k));
+-		T(:,k) = U\(L\B(:,k));
+-	end
+-	
+-	% Find where t1 and t2 are between 0 and 1 and return the corresponding
+-	% x0 and y0 values.
+-	in_range = T(1,:) >= 0 & T(2,:) >= 0 & T(1,:) < 1 & T(2,:) < 1;
+-	x0 = T(3,in_range).';
+-	y0 = T(4,in_range).';
+-	
+-	% Compute how far along each line segment the intersections are.
+-	if nargout > 2
+-		iout = i(in_range) + T(1,in_range).';
+-		jout = j(in_range) + T(2,in_range).';
+-	end
+-end
+-
+-% Plot the results (useful for debugging).
+-% plot(x1,y1,x2,y2,x0,y0,'ok');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCallFromMetric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCallFromMetric.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCallFromMetric.m	(revision 12997)
+@@ -1,65 +0,0 @@
+-function md=BamgCallFromMetric(md,metric,gradation),
+-%BAMGCALL - call bam
+-%
+-%   call Bamg and the output mesh is plugged onto the model
+-%   -gradation = maximum edge length gradation between 2 elements
+-%
+-%   Usage:
+-%      md=BamgCallFromMetric(md,metric,gradation);
+-%
+-%   Example:
+-%      md=BamgCall(md,metric,1500,10^8,1.3,0.9);
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%write files
+-t1=clock; fprintf('%s','      writing initial mesh files...');
+-fid=fopen('carre0.met','w');
+-fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
+-fprintf(fid,'%i %i %i\n',metric');
+-fclose(fid);
+-
+-fid=fopen('carre0.mesh','w');
+-
+-%initialiation
+-fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
+-
+-%dimension
+-fprintf(fid,'\n%s\n%i\n','Dimension',2);
+-
+-%Vertices
+-fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
+-fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
+-
+-%Triangles
+-fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
+-fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
+-numberofelements1=md.mesh.numberofelements;
+-
+-%close
+-fclose(fid);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%call bamg
+-fprintf('%s\n','      call Bamg...');
+-system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
+-
+-%plug new mesh
+-t1=clock; fprintf('\n%s','      reading final mesh files...');
+-A=meshread('carre1.mesh');
+-md.mesh.x=A.x;
+-md.mesh.y=A.y;
+-md.z=zeros(A.nods,1);
+-md.mesh.elements=A.index;
+-md.mesh.numberofvertices=A.nods;
+-md.mesh.numberofelements=A.nels;
+-numberofelements2=md.mesh.numberofelements;
+-t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%display number of elements
+-fprintf('\n%s %i','      inital number of elements:',numberofelements1);
+-fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
+-
+-%clean up:
+-system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetCharacteristicLength.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetCharacteristicLength.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetCharacteristicLength.m	(revision 12997)
+@@ -1,45 +0,0 @@
+-function length=GetCharacteristicLength(index,x,y,varargin)
+-%GETCHARACTERISTICLENGTH - compute characteristic length for a mesh
+-%
+-%   compute characteristic lengths of every element of a mesh.
+-%
+-%   Usage:
+-%      length  =GetCharacteristicLength(index,x,y);
+-%      length  =GetCharacteristicLength(index,x,y,z);
+-%
+-%   Examples:
+-%      length  =GetCharacteristicLength(md.mesh.elements,md.mesh.x,md.mesh.y);
+-%      length  =GetCharacteristicLength(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
+-
+-
+-%get number of elements and number of nodes
+-nels=size(index,1);
+-nods=numel(x);
+-
+-%some checks
+-if nargout~=1 | (nargin~=3 & nargin~=4),
+-	help GetCharacteristicLength
+-	error('GetCharacteristicLength error message: bad usage')
+-end
+-if ((numel(y)~=nods) | (nargin==4 & numel(z)~=nods)),
+-	error('GetCharacteristicLength error message: x,y and z do not have the same length')
+-end
+-if max(index(:))>nods,
+-	error(['GetCharacteristicLength error message: index should not have values above ' num2str(nods) ])
+-end
+-if (nargin==3 & size(index,2)~=3),
+-	error('GetCharacteristicLength error message: index should have 3 columns for 2d meshes.')
+-end
+-if (nargin==4 & size(index,2)~=6),
+-	error('GetCharacteristicLength error message: index should have 6 columns for 3d meshes.')
+-end
+-
+-%get areas or volumes.
+-areas=GetAreas(index,x,y,varargin{:});
+-
+-%for a 2d mesh: 
+-if nargin==3,
+-	length=sqrt(2*areas);
+-else
+-	error('not supported yet');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetAreas.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetAreas.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/GetAreas.m	(revision 12997)
+@@ -1,51 +0,0 @@
+-function areas=GetAreas(index,x,y,varargin)
+-%GETAREAS - compute areas or volumes of elements
+-%
+-%   compute areas of triangular elements or volumes 
+-%   of pentahedrons
+-%
+-%   Usage:
+-%      areas  =GetAreas(index,x,y);
+-%      volumes=GetAreas(index,x,y,z);
+-%
+-%   Examples:
+-%      areas  =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
+-%      volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
+-
+-%get number of elements and number of nodes
+-nels=size(index,1);
+-nods=length(x);
+-if nargin==4, z=varargin{1}; end
+-
+-%some checks
+-if nargout~=1 | (nargin~=3 & nargin~=4),
+-	help GetAreas
+-	error('GetAreas error message: bad usage')
+-end
+-if ((length(y)~=nods) | (nargin==4 & length(z)~=nods)),
+-	error('GetAreas error message: x,y and z do not have the same length')
+-end
+-if max(index(:))>nods,
+-	error(['GetAreas error message: index should not have values above ' num2str(nods) ])
+-end
+-if (nargin==3 & size(index,2)~=3),
+-	error('GetAreas error message: index should have 3 columns for 2d meshes.')
+-end
+-if (nargin==4 & size(index,2)~=6),
+-	error('GetAreas error message: index should have 6 columns for 3d meshes.')
+-end
+-
+-%initialization
+-areas=zeros(nels,1);
+-x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
+-y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
+-
+-%compute the volume of each element
+-if nargin==3,
+-	%compute the surface of the triangle
+-	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
+-else
+-	%V=area(triangle)*1/3(z1+z2+z3)
+-	thickness=mean(z(index(:,4:6)),2)-mean(z(index(:,1:3)),2);
+-	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1))).*thickness;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/isconnected.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/isconnected.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/isconnected.m	(revision 12997)
+@@ -1,13 +0,0 @@
+-function flag=isconnected(elements,A,B)
+-%ISCONNECTED: are two nodes connected by a triangulation?
+-%
+-%   Usage: flag=isconnected(elements,A,B)
+-%
+-%
+-
+-elements=ElementsFromEdge(elements,A,B);
+-if isempty(elements),
+-	flag=0;
+-else
+-	flag=1;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/argusmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/argusmesh.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/argusmesh.m	(revision 12997)
+@@ -1,96 +0,0 @@
+-function md=argusmesh(md,infile)
+-%ARGUSMESH - load an Argus mesh onto a model
+-%
+-%   Convert an Argus mesh contained in a file into
+-%   fields needed for the mesh in a model md.
+-%
+-%   Usage:
+-%      md=argusmesh(md,infile)
+-%
+-%   Example:
+-%     md=argusmesh(md,'TriMesh.exp')
+-
+-%some argument check: 
+-if nargin~=2 | nargout~=1,
+-	help argustomodel;
+-	error('argustomodel error message: bad usage');
+-end
+-
+-%determine root of infile: strip extension
+-[a,root,b,c]=fileparts(infile);
+-
+-%inform user we start the script: 
+-disp(['   Translating argus file ''' infile ''' into matlab model object']);
+-
+-%open infile: 
+-fileid=fopen(infile,'r');
+-if fileid==-1,
+-	error(['Could not open file ' infile  ' for reading']);
+-end
+-
+-%Read first line of the argus mesh: node and element parameters
+-[buffer,bytecount]=fscanf(fileid,'%i %i %i %i',[1 4]);
+-if bytecount~=4, 
+-	error(['Problem reading ' infile ' file at line #1']);
+-end
+-nel=buffer(1);
+-nods=buffer(2);
+-num_element_parameters=buffer(3);
+-num_node_parameters=buffer(4);
+-disp(['      argus model '''   root ''' contains ' num2str(nel) ' elements and ' num2str(nods) ' nodes.']);
+-
+-%initialize elements and nodes
+-elements=zeros(nel,3);
+-element_parameters=zeros(nel,num_element_parameters);
+-x=zeros(nods,1);
+-y=zeros(nods,1);
+-z=zeros(nods,1);
+-node_parameters=zeros(nods,num_node_parameters);
+-
+-%read nodes:
+-format_string='%s %i %f %f ';
+-for n=1:num_node_parameters,
+-	format_string=[format_string ' %i '];
+-end
+-
+-for n=1:nods,
+-	[buffer,bytecount]=fscanf(fileid,format_string,[1,num_node_parameters+4]);
+-	x(n)=buffer(3);
+-	y(n)=buffer(4);
+-	node_parameters(n,:)=buffer(5:length(buffer));
+-end
+-
+-%read elements: 
+-format_string='%s %i %i %i %i';
+-for n=1:num_element_parameters,
+-	format_string=[format_string ' %i '];
+-end
+-for n=1:nel,
+-	[buffer,bytecount]=fscanf(fileid,format_string,[1,num_element_parameters+5]);
+-	elements(n,:)=buffer(3:5);
+-	element_parameters(n,:)=buffer(6:length(buffer));
+-end
+-
+-%Create a name and a note for this model: 
+-notes=['Model created by Argus from input file: ' infile ' and parameter file: ' root '.par on: ' date];
+-name=root;
+-
+-%Finally, use model constructor to build a complete model: 
+-md.mesh.elements=elements;
+-md.mesh.x=x;
+-md.mesh.y=y;
+-md.z=z;
+-md.mesh.numberofvertices=size(md.mesh.x,1);
+-md.mesh.numberofelements=size(md.mesh.elements,1);
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+-md.mesh.dimension=2;
+-md=addnote(md,notes);
+-
+-%Add segments and nodes on boundary
+-md.mesh.segments=findsegments(md);
+-md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonboundary(md.mesh.segments(:,1))=1;
+-md.mesh.vertexonboundary(md.mesh.segments(:,2))=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCall.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/BamgCall.m	(revision 12997)
+@@ -1,84 +0,0 @@
+-function md=BamgCall(md,field,hmin,hmax,gradation,epsilon),
+-%BAMGCALL - call bam
+-%
+-%   build a metric using the Hessian of the given field
+-%   call Bamg and the output mesh is plugged onto the model
+-%   -hmin = minimum edge length (m)
+-%   -hmax = maximum edge length (m)
+-%   -gradation = maximum edge length gradation between 2 elements
+-%   -epsilon = average error on each element (m/yr)
+-%
+-%   Usage:
+-%      md=BamgCall(md,field,hmin,hmax,gradation,epsilon);
+-%
+-%   Example:
+-%      md=BamgCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%Compute Hessian
+-t1=clock; fprintf('%s','      computing Hessian...');
+-hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%Compute metric
+-t1=clock; fprintf('%s','      computing metric...');
+-if length(md.nodeonwater)==md.mesh.numberofvertices,
+-	pos=find(md.nodeonwater);
+-else
+-	pos=[];
+-end
+-metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%write files
+-t1=clock; fprintf('%s','      writing initial mesh files...');
+-fid=fopen('carre0.met','w');
+-fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
+-fprintf(fid,'%i %i %i\n',metric');
+-fclose(fid);
+-
+-fid=fopen('carre0.mesh','w');
+-
+-%initialiation
+-fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
+-
+-%dimension
+-fprintf(fid,'\n%s\n%i\n','Dimension',2);
+-
+-%Vertices
+-fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
+-fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
+-
+-%Triangles
+-fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
+-fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
+-numberofelements1=md.mesh.numberofelements;
+-
+-%close
+-fclose(fid);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%call bamg
+-fprintf('%s\n','      call Bamg...');
+-system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
+-
+-%plug new mesh
+-t1=clock; fprintf('\n%s','      reading final mesh files...');
+-A=meshread('carre1.mesh');
+-md.mesh.x=A.x;
+-md.mesh.y=A.y;
+-md.z=zeros(A.nods,1);
+-md.mesh.elements=A.index;
+-md.mesh.numberofvertices=A.nods;
+-md.mesh.numberofelements=A.nels;
+-numberofelements2=md.mesh.numberofelements;
+-t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%display number of elements
+-fprintf('\n%s %i','      inital number of elements:',numberofelements1);
+-fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
+-
+-%clean up:
+-system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/FixMesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/FixMesh.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/FixMesh.m	(revision 12997)
+@@ -1,45 +0,0 @@
+-function  [index2 x2 y2 value2]=FixMesh(index,x,y,value)
+-%FixMesh fix mesh with broken triangles, orphan vertices, etc ...
+-%
+-% Usage: 
+-%            [index2 x2 y2 value2]=FixMesh(index,x,y,value)
+-%            where index,x,y is a delaunay triangulation, 
+-%                  value is a field on the input triangulation, with values at the vertices
+-%                  index2,x2,y2,value2 is the repaired triangulation, with new values on new vertices
+-%
+-%
+-
+-%duplicate inputs
+-index2=index;
+-x2=x;
+-y2=y;
+-value2=value;
+-
+-%First, look for orphan vertices, and take them out.
+-flags=zeros(length(x2),1); flags(index2)=1;
+-orphans=find(flags==0);
+-
+-while ~isempty(orphans),
+-
+-	%take the first orphan, the lower numbered, and take it out
+-	orphan=orphans(1);
+-
+-	%first x,y,value
+-	x2(orphan)=[];
+-	y2(orphan)=[];
+-	value2(orphan)=[];
+-
+-	%now, the index:
+-	pos=find(index2>orphan); index2(pos)=index2(pos)-1;
+-	
+-	%look again for orphans on new mesh
+-	flags=zeros(length(x2),1);flags(index2)=1;
+-	orphans=find(flags==0);
+-end
+-
+-%Check all triangles are well oriented.
+-aires=GetAreas(index2,x2,y2);
+-pos=find(aires<0);
+-temp=index2(pos,1);
+-index2(pos,1)=index2(pos,2);
+-index2(pos,2)=temp;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/roundmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/roundmesh.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/roundmesh.m	(revision 12997)
+@@ -1,34 +0,0 @@
+-function md=roundmesh(md,radius,resolution)
+-%ROUNDMESH - create an unstructured round mesh 
+-%
+-%   This script will generate a structured round mesh
+-%   - radius     : specifies the radius of the circle in meters
+-%   - resolution : specifies the resolution in meters
+-%
+-%   Usage:
+-%      md=roundmesh(md,radius,resolution)
+-
+-%First we have to create the domain outline 
+-
+-%Get number of points on the circle
+-pointsonedge=floor((2*pi*radius) / resolution);
+-
+-%Calculate the cartesians coordinates of the points
+-x_list=ones(pointsonedge,1); y_list=ones(pointsonedge,1);
+-theta=(0:2*pi/pointsonedge:2*pi*(1-1/pointsonedge))';
+-x_list=radius*x_list.*cos(theta);
+-y_list=radius*y_list.*sin(theta);
+-A=struct('x',x_list,'y',y_list,'density',1);
+-expgen('RoundDomainOutline.exp',A,1);
+-
+-%Call Bamg
+-md=triangle(md,'RoundDomainOutline.exp',resolution);
+-%md=bamg(md,'domain','RoundDomainOutline.exp','hmin',resolution);
+-
+-%move the closest node to the center
+-[mini pos]=min(md.mesh.x.^2+md.mesh.y.^2);
+-md.mesh.x(pos)=0;
+-md.mesh.y(pos)=0;
+-
+-%delete domain
+-delete('RoundDomainOutline.exp')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ProfileProjectOntoMesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ProfileProjectOntoMesh.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ProfileProjectOntoMesh.m	(revision 12997)
+@@ -1,66 +0,0 @@
+-function mesh_profile=ProfileProjectOntoMesh(md,profile)
+-%PROFILEPROJECTONTOMESH: project a profile (made of arbitrary points) onto a mesh, so that we end 
+-%                        up with a list of segments self contained onto elements.
+-%
+-% Usage: mesh_profile=ProfileProjectOntoMesh(md,profile)
+-%
+-% See also intersections.m
+-
+-%make a curve out of the mesh, to use the intersections routine.
+-rows=[md.mesh.elements md.mesh.elements(:,1)]'; rows=rows(:);
+-x=md.mesh.x(rows);
+-y=md.mesh.y(rows);
+-
+-%[x0,y0] = intersections(profile.x,profile.y,x,y,1);
+-[x0,y0,indices,j] = intersections(profile.x,profile.y,x,y);
+-
+-%  sort intersections to create segments in order and continuous along profile
+-[indices,isort]=sort(indices);
+-j =j (isort);
+-x0=x0(isort);
+-y0=y0(isort);
+-
+-%process x0,y0 so they do not include profile.x or profile.y
+-processed_indices=[];
+-processed_x=[];
+-processed_y=[];
+-for i=1:numel(indices),
+-	if(((indices(i)-floor(indices(i)))~=0) && ((ceil(indices(i))-indices(i))~=0))
+-		processed_indices=[processed_indices;floor(indices(i))];
+-		processed_x=[processed_x;x0(i)];
+-		processed_y=[processed_y;y0(i)];
+-	end
+-end
+-
+-%now merge profile.x,profile.y with processed_x,processed_y, at locations processed_indices:
+-newx=profile.x;
+-newy=profile.y;
+-
+-count=1;
+-for i=1:numel(profile.x),
+-	pos=find(processed_indices==i);
+-	if ~isempty(pos),
+-		newx=[newx(1:count); processed_x(pos); newx(count+1:end)];
+-		newy=[newy(1:count); processed_y(pos); newy(count+1:end)];
+-		count=count+length(pos)+1;
+-	end
+-end
+-
+-%now, for each node, figure out which element it belongs to.
+-node_in_element=NodeInElement(newx,newy,md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.vertexconnectivity);
+-
+-% eliminate nodes that don't fall in any element
+-% (profile may start and/or end externally and/or cross holes in the model)
+-
+-ind=find(node_in_element(:,9)>0);
+-newx=newx(ind,:);
+-newy=newy(ind,:);
+-node_in_element=node_in_element(ind,:);
+-
+-mesh_profile=[newx(1:end-1) newy(1:end-1) newx(2:end) newy(2:end) zeros(length(newy(2:end)),1)];
+-
+-%find which element each segment belongs to.
+-for i=1:length(newx)-1,
+-	common=intersect(node_in_element(i,1:node_in_element(i,end)), node_in_element(i+1,1:node_in_element(i+1,end)));
+-	mesh_profile(i,end)=common(1);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/YamsCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/YamsCall.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/YamsCall.m	(revision 12997)
+@@ -1,104 +0,0 @@
+-function md=YamsCall(md,field,hmin,hmax,gradation,epsilon),
+-%YAMSCALL - call yams
+-%
+-%   build a metric using the Hessian of the given field
+-%   call Yams and the output mesh is plugged onto the model
+-%   -hmin = minimum edge length (m)
+-%   -hmax = maximum edge length (m)
+-%   -gradation = maximum edge length gradation between 2 elements
+-%   -epsilon = average error on each element (m/yr)
+-%
+-%   Usage:
+-%      md=YamsCall(md,field,hmin,hmax,gradation,epsilon);
+-%
+-%   Example:
+-%      md=YamsCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%Compute Hessian
+-t1=clock; fprintf('%s','      computing Hessian...');
+-hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%Compute metric
+-t1=clock; fprintf('%s','      computing metric...');
+-if length(md.mask.vertexonwater)==md.mesh.numberofvertices,
+-	pos=find(md.mask.vertexonwater);
+-else
+-	pos=[];
+-end
+-metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%write files
+-t1=clock; fprintf('%s','      writing initial mesh files...');
+-save -ascii carre0.met  metric
+-
+-fid=fopen('carre0.mesh','w');
+-
+-%initialiation
+-fprintf(fid,'\n%s\n%i\n','MeshVersionFormatted',1);
+-
+-%dimension
+-fprintf(fid,'\n%s\n%i\n','Dimension',2);
+-
+-%Vertices
+-fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
+-fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y zeros(md.mesh.numberofvertices,1)]');
+-
+-%Triangles
+-fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
+-fprintf(fid,'%i %i %i %i\n',[md.mesh.elements zeros(md.mesh.numberofelements,1)]');
+-numberofelements1=md.mesh.numberofelements;
+-	
+-%Deal with rifts
+-if ~isnan(md.rifts.riftstruct),
+-	
+-	%we have the list of triangles that make up the rift. keep those triangles around during refinement.
+-	triangles=[];
+-	for i=1:size(md.rifts.riftstruct,1),
+-		triangles=[triangles md.rifts(i).segments(:,3)'];
+-	end
+-
+-	fprintf(fid,'\n\n%s\n%i\n\n','RequiredTriangles',length(triangles));
+-	fprintf(fid,'%i\n',triangles);
+-end
+-
+-%close
+-fclose(fid);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%call yams
+-fprintf('%s\n','      call Yams...');
+-if ispc
+-	%windows
+-	system(['yams2-win -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
+-elseif ismac
+-	%Macosx
+-	system(['yams2-osx -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
+-else
+-	%Linux
+-	system(['yams2-linux -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
+-end
+-
+-%plug new mesh
+-t1=clock; fprintf('\n%s','      reading final mesh files...');
+-Tria=load('carre1.tria');
+-Coor=load('carre1.coor');
+-md.mesh.x=Coor(:,1);
+-md.mesh.y=Coor(:,2);
+-md.mesh.z=zeros(size(Coor,1),1);
+-md.mesh.elements=Tria;
+-md.mesh.numberofvertices=size(Coor,1);
+-md.mesh.numberofelements=size(Tria,1);
+-numberofelements2=md.mesh.numberofelements;
+-t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%display number of elements
+-fprintf('\n%s %i','      inital number of elements:',numberofelements1);
+-fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
+-
+-%clean up:
+-system('rm carre0.mesh carre0.met carre1.tria carre1.coor carre1.meshb');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MeshQuality.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MeshQuality.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/MeshQuality.m	(revision 12997)
+@@ -1,82 +0,0 @@
+-function quality=MeshQuality(md,epsilon,hmin,hmax);
+-%MESHQUALITY - compute mesh quality
+-%
+-%   Usage:
+-%      MeshQuality(md,epsilon,hmin,hmax);
+-
+-%Get some variables from the model
+-index=md.mesh.elements;
+-x=md.mesh.x;
+-y=md.mesh.y;
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%Compute Hessian
+-hessian=ComputeHessian(index,x,y,md.inversion.vel_obs,'node');
+-
+-%Compute metric
+-if length(md.nodeonwater)==md.mesh.numberofvertices,
+-	pos=find(md.nodeonwater);
+-else
+-	pos=[];
+-end
+-metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
+-
+-%Get Areas
+-areas=GetAreas(index,x,y);
+-
+-%length edges vectors
+-e1x=[x(index(:,2))-x(index(:,1))];
+-e1y=[y(index(:,2))-y(index(:,1))];
+-e2x=[x(index(:,3))-x(index(:,2))];
+-e2y=[y(index(:,3))-y(index(:,2))];
+-e3x=[x(index(:,1))-x(index(:,3))];
+-e3y=[y(index(:,1))-y(index(:,3))];
+-
+-%metric of each the 3 nodes for each element
+-M1=metric(index(:,1),:);
+-M2=metric(index(:,2),:);
+-M3=metric(index(:,3),:);
+-
+-%Get edge length in the metric
+-L1=1/2*(sqrt(e2x.*(M2(:,1).*e2x+M2(:,2).*e2y)+e2y.*(M2(:,2).*e2x+M2(:,3).*e2y))+sqrt(e1x.*(M1(:,1).*e1x+M1(:,2).*e1y)+e1y.*(M1(:,2).*e1x+M1(:,3).*e1y)));
+-L2=1/2*(sqrt(e3x.*(M3(:,1).*e3x+M3(:,2).*e3y)+e3y.*(M3(:,2).*e3x+M3(:,3).*e3y))+sqrt(e2x.*(M2(:,1).*e2x+M2(:,2).*e2y)+e2y.*(M2(:,2).*e2x+M2(:,3).*e2y)));
+-L3=1/2*(sqrt(e1x.*(M1(:,1).*e1x+M1(:,2).*e1y)+e1y.*(M1(:,2).*e1x+M1(:,3).*e1y))+sqrt(e3x.*(M3(:,1).*e3x+M3(:,2).*e3y)+e3y.*(M3(:,2).*e3x+M3(:,3).*e3y)));
+-
+-%area in the metric
+-V=1/3*areas.*(sqrt(M1(:,1).*M1(:,3)-M1(:,2).^2)+sqrt(M2(:,1).*M2(:,3)-M2(:,2).^2)+sqrt(M3(:,1).*M3(:,3)-M3(:,2).^2));
+-
+-%compute quality:
+-quality=4*sqrt(3)*V./(L1+L2+L3);
+-
+-%compute error
+-a=hessian(:,1); b=hessian(:,2); d=hessian(:,3);
+-a=a(index)*[1;1;1]/3;
+-b=b(index)*[1;1;1]/3;
+-d=d(index)*[1;1;1]/3;
+-lambda1=0.5*((a+d)+sqrt(4*b.^2+(a-d).^2));
+-lambda2=0.5*((a+d)-sqrt(4*b.^2+(a-d).^2));
+-lambda1=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
+-lambda2=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
+-if length(md.nodeonwater)==md.mesh.numberofvertices;
+-	pos=find(md.nodeonwater);
+-	lambda1(pos)=0;
+-	lambda2(pos)=0;
+-end
+-lambda1=lambda1(index)*[1;1;1]/3;
+-lambda2=lambda2(index)*[1;1;1]/3;
+-
+-lambdamax=max(lambda1,lambda2);
+-hmax=max(max(sqrt(e1x.^2+e1y.^2),sqrt(e2x.^2+e2y.^2)),sqrt(e3x.^2+e3y.^2));
+-epsilon=scale*hmax.^2.*lambdamax;
+-
+-%display
+-%X=0:0.1:4; hist(quality,X); xlim([0 3]); title('mesh quality distribution','FontSize',14);
+-%plotmodel(md,'data',epsilon,'title','Interpolation error','figure',2)
+-disp(sprintf('\n%s','Mesh Quality'));
+-disp(sprintf('   %s %g','Average Mesh quality: ',mean(quality)));
+-disp(sprintf('   %s %g','Worst Element quality:',max(quality)));
+-disp(sprintf('\n%s','Interpolation Error'));
+-disp(sprintf('   %s %g %s','Average interpolation error:',mean(epsilon),'m/yr'));
+-disp(sprintf('   %s %g %s','Maximum interpolation error:',max(epsilon),'m/yr'));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/squaremesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/squaremesh.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/squaremesh.m	(revision 12997)
+@@ -1,78 +0,0 @@
+-function md=squaremesh(md,Lx,Ly,nx,ny)
+-%SQUAREMESH - create a structured square mesh 
+-%
+-%   This script will generate a structured square mesh
+-%   Lx and Ly are the dimension of the domain (in meters)
+-%   nx anx ny are the number of nodes in the x and y direction
+-%   The coordinates x and y returned are in meters.
+-%
+-%   Usage:
+-%      [md]=squaremesh(md,Lx,Ly,nx,ny)
+-
+-%get number of elements and number of nodes
+-nel=(nx-1)*(ny-1)*2;
+-nods=nx*ny;
+-
+-%initialization
+-segments=zeros(0,3);
+-index=zeros(nel,3);
+-x=zeros(nx*ny,1);
+-y=zeros(nx*ny,1);
+-
+-%create coordinates
+-for n=1:nx,
+-	for m=1:ny,
+-		x((n-1)*ny+m)=(n-1);
+-		y((n-1)*ny+m)=(m-1);
+-	end
+-end
+-
+-%create index
+-for n=1:(nx-1)
+-	for m=1:(ny-1),
+-		A=(n-1)*ny+m;
+-		B=A+1;
+-		C=n*ny+m;
+-		D=C+1;
+-		index((n-1)*(ny-1)*2+2*(m-1)+1,:)=[A C B];
+-		index((n-1)*(ny-1)*2+2*m,:)=[B C D];
+-	end
+-end
+-
+-%Scale  x and y
+-x=x/max(x)*Lx;
+-y=y/max(y)*Ly;
+-
+-%create segments
+-segments=zeros(2*(nx-1)+2*(ny-1),3);
+-%left edge:
+-segments(1:ny-1,:)=[[2:ny]' [1:ny-1]' 2*[1:ny-1]'-1];
+-%right edge:
+-segments(ny:2*(ny-1),:)=[[ny*(nx-1)+1:nx*ny-1]' [ny*(nx-1)+2:nx*ny]' 2*[(ny-1)*(nx-2)+1:(nx-1)*(ny-1)]'];
+-%front edge:
+-segments(2*(ny-1)+1:2*(ny-1)+(nx-1),:)=[[2*ny:ny:ny*nx]' [ny:ny:ny*(nx-1)]' [2*(ny-1):2*(ny-1):2*(nx-1)*(ny-1)]'];
+-%back edge
+-segments(2*(ny-1)+(nx-1)+1:2*(nx-1)+2*(ny-1),:)=[[1:ny:(nx-2)*ny+1]' [ny+1:ny:ny*(nx-1)+1]' [1:2*(ny-1):2*(nx-2)*(ny-1)+1]'];
+-
+-%plug coordinates and nodes
+-md.mesh.x=x;
+-md.mesh.y=y;
+-md.mesh.z=zeros(nods,1);
+-md.mesh.numberofvertices=nods;
+-md.mesh.vertexonboundary=zeros(nods,1);md.mesh.vertexonboundary(segments(:,1:2))=1;
+-md.mesh.vertexonbed=ones(nods,1);
+-md.mesh.vertexonsurface=ones(nods,1);
+-
+-%plug elements
+-md.mesh.elements=index;
+-md.mesh.segments=segments;
+-md.mesh.numberofelements=nel;
+-md.mesh.elementonbed=ones(nel,1);
+-md.mesh.elementonsurface=ones(nel,1);
+-
+-%Now, build the connectivity tables for this mesh.
+-md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-
+-%plug other field
+-md.mesh.dimension=2;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/rifttipsonmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/rifttipsonmesh.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/rifttipsonmesh.m	(revision 12997)
+@@ -1,26 +0,0 @@
+-function tips=rifttipsonmesh(md,riftoutline)
+-%RIFTTIPSONMESH: identify, using a rift outline, the nodes that are tips of 
+-%                rifts.
+-
+-%read rifts from outline file
+-rifts=expread(riftoutline,1);
+-
+-tips=[];
+-
+-for i=1:length(rifts),
+-	rift=rifts(i);
+-
+-	x_tip=rift.x(1);
+-	y_tip=rift.y(1);
+-	
+-	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
+-	tips(end+1)=index;
+-
+-	x_tip=rift.x(end);
+-	y_tip=rift.y(end);
+-	
+-	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
+-	tips(end+1)=index;
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeMetric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeMetric.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Mesh/ComputeMetric.m	(revision 12997)
+@@ -1,66 +0,0 @@
+-function metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos)
+-%COMPUTEMETRIC - compute metric from an Hessian
+-%
+-%   Usage:
+-%      metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos)
+-%      pos is contains the positions where the metric is wished to be maximized (water?)
+-%
+-%   Example:
+-%      metric=ComputeMetric(hessian,2/9,10^-1,100,10^5,find(md.nodeonwater)
+-
+-%first, find the eigen values of eah line of H=[hessian(i,1) hessian(i,2); hessian(i,2)  hessian(i,3)]
+-a=hessian(:,1); b=hessian(:,2); d=hessian(:,3);
+-lambda1=0.5*((a+d)+sqrt(4*b.^2+(a-d).^2));
+-lambda2=0.5*((a+d)-sqrt(4*b.^2+(a-d).^2));
+-pos1=find(lambda1==0);
+-pos2=find(lambda2==0);
+-pos3=find(b==0 & lambda1==lambda2);
+-
+-%Modify the eigen values to control the shape of the elements
+-lambda1=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
+-lambda2=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
+-
+-%compute eigen vectors
+-norm1=sqrt(8*b.^2+2*(d-a).^2+2*(d-a).*sqrt((a-d).^2+4*b.^2));
+-v1x=2*b./norm1;
+-v1y=((d-a)+sqrt((a-d).^2+4*b.^2))./norm1;
+-norm2=sqrt(8*b.^2+2*(d-a).^2-2*(d-a).*sqrt((a-d).^2+4*b.^2));
+-v2x=2*b./norm2;
+-v2y=((d-a)-sqrt((a-d).^2+4*b.^2))./norm2;
+-
+-v1x(pos3)=1; v1y(pos3)=0;
+-v2x(pos3)=0; v2y(pos3)=1;
+-
+-%Compute new metric (for each node M=V*Lambda*V^-1)
+-metric=full([(v1x.*v2y-v1y.*v2x).^(-1).*(lambda1.*v2y.*v1x-lambda2.*v1y.*v2x) ...
+-	(v1x.*v2y-v1y.*v2x).^(-1).*(lambda1.*v1y.*v2y-lambda2.*v1y.*v2y) ...
+-	(v1x.*v2y-v1y.*v2x).^(-1).*(-lambda1.*v2x.*v1y+lambda2.*v1x.*v2y)]);
+-
+-%some corrections for 0 eigen values
+-metric(pos1,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos1),1);
+-metric(pos2,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos2),1);
+-
+-%take care of water elements
+-metric(pos,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos),1);
+-
+-%take care of NaNs if any (use Matlab eig in a loop)
+-[pos posj]=find(isnan(metric)); clear posj;
+-if ~isempty(pos),
+-	fprintf(' %i %s',length(pos),'NaN found in the metric. Use Matlab routine...');
+-	for i=1:length(pos)
+-		H=[hessian(pos(i),1) hessian(pos(i),2)
+-		hessian(pos(i),2) hessian(pos(i),3)];
+-		[u,v]=eig(full(H));
+-		lambda1=v(1,1);
+-		lambda2=v(2,2);
+-		v(1,1)=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
+-		v(2,2)=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
+-
+-		metricTria=u*v*u^(-1);
+-		metric(pos(i),:)=[metricTria(1,1) metricTria(1,2) metricTria(2,2)];
+-	end
+-end
+-
+-if any(isnan(metric)),
+-	error('ComputeMetric error message: NaN in the metric despite our efforts...')
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/ll2xy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/ll2xy.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/ll2xy.m	(revision 12997)
+@@ -1,66 +0,0 @@
+-function [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)  
+-%LL2XY - converts lat long to polar stereographic
+-%
+-%   Converts from geodetic latitude and longitude to Polar 
+-%   Stereographic (X,Y) coordinates for the polar regions.
+-%   Author: Michael P. Schodlok, December 2003 (map2ll)
+-%
+-%   Usage:
+-%      [x,y] = ll2xy(lat,lon,sgn)
+-%      [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)
+-%
+-%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
+-%                               -1 : south latitude (default is mer=0  lat=71)
+-
+-%Get central_meridian and standard_parallel depending on hemisphere
+-if nargin==5,
+-	delta = central_meridian;
+-	slat  = standard_parallel;
+-elseif nargin==3
+-	if sgn == 1,
+-		delta = 45; slat = 70;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-	elseif sgn==-1,
+-		delta = 0;  slat = 71;
+-		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
+-	else
+-		error('Sign should be either +1 or -1');
+-	end
+-else
+-	help ll2xy
+-	error('bad usage');
+-end
+-
+-% Conversion constant from degrees to radians
+-cde  = 57.29577951;
+-% Radius of the earth in meters
+-re   = 6378.273*10^3;
+-% Eccentricity of the Hughes ellipsoid squared
+-ex2   = .006693883;
+-% Eccentricity of the Hughes ellipsoid
+-ex    =  sqrt(ex2);
+-
+-latitude  = abs(lat) * pi/180.;
+-longitude = (lon + delta) * pi/180.;
+-
+-% compute X and Y in grid coordinates.
+-T = tan(pi/4-latitude/2) ./ ((1-ex*sin(latitude))./(1+ex*sin(latitude))).^(ex/2);
+-
+-if (90 - slat) <  1.e-5 
+-	rho = 2.*re*T/sqrt((1.+ex)^(1.+ex)*(1.-ex)^(1.-ex));
+-else
+-	sl  = slat*pi/180.;
+-	tc  = tan(pi/4.-sl/2.)/((1.-ex*sin(sl))/(1.+ex*sin(sl)))^(ex/2.);
+-	mc  = cos(sl)/sqrt(1.0-ex2*(sin(sl)^2));
+-	rho = re*mc*T/tc;
+-end
+-
+-y = -rho .* sgn .* cos(sgn.*longitude);
+-x =  rho .* sgn .* sin(sgn.*longitude);
+-
+-[cnt1,cnt2] = find(latitude >= pi / 2.);
+-
+-if cnt1
+-	x(cnt1,1) = 0.0;
+-	y(cnt1,1) = 0.0;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/xy2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/xy2ll.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/xy2ll.m	(revision 12997)
+@@ -1,72 +0,0 @@
+-function [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel)
+-%XY2LL - converts xy to lat long
+-%
+-%   Converts Polar  Stereographic (X,Y) coordinates for the polar regions to
+-%   latitude and longitude Stereographic (X,Y) coordinates for the polar
+-%   regions.
+-%   Author: Michael P. Schodlok, December 2003 (map2xy.m)
+-%
+-%   Usage:
+-%      [lat,lon] = xy2ll(x,y,sgn);
+-%      [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel);
+-%
+-%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
+-%                               -1 : south latitude (default is mer=0  lat=71)
+-
+-%Get central_meridian and standard_parallel depending on hemisphere
+-if nargin==5,
+-	delta = central_meridian;
+-	slat  = standard_parallel;
+-elseif nargin==3
+-	if sgn == 1,
+-		delta = 45; slat = 70;
+-		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-	elseif sgn==-1,
+-		delta = 0;  slat = 71;
+-		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
+-	else
+-		error('Sign should be either +1 or -1');
+-	end
+-else
+-	help xy2ll
+-	error('bad usage');
+-end
+-
+-% Conversion constant from degrees to radians
+-cde  = 57.29577951;
+-% Radius of the earth in meters
+-re   = 6378.273*10^3;
+-% Eccentricity of the Hughes ellipsoid squared
+-ex2   = .006693883;
+-% Eccentricity of the Hughes ellipsoid
+-ex    =  sqrt(ex2);
+-
+-sl  = slat*pi/180.;
+-rho = sqrt(x.^2 + y.^2);
+-cm = cos(sl) / sqrt(1.0 - ex2 * (sin(sl)^2));
+-T = tan((pi / 4.0) - (sl / 2.0)) / ((1.0 - ex * sin(sl)) / (1.0 + ex * sin(sl)))^(ex / 2.0);
+-
+-if  abs(slat-90.) < 1.e-5
+-	T = rho * sqrt((1. + ex)^(1. + ex) * (1. - ex)^(1. - ex)) / 2. / re;
+-else
+-	T = rho * T / (re * cm);
+-end
+-
+-chi = (pi / 2.0) - 2.0 * atan(T);
+-lat = chi + ((ex2 / 2.0) + (5.0 * ex2^2.0 / 24.0) + (ex2^3.0 / 12.0)) * ...
+-	sin(2 * chi) + ((7.0 * ex2^2.0 / 48.0) + (29.0 * ex2^3 / 240.0)) * ...
+-	sin(4.0 * chi) + (7.0 * ex2^3.0 / 120.0) * sin(6.0 * chi) ;
+-
+-lat = sgn * lat;
+-lon = atan2(sgn * x,-sgn * y);
+-lon = sgn * lon;
+-
+-[res1,res2] = find(rho <= 0.1);
+-if res1
+-	lat(res1,1) = 90. * sgn;
+-	lon(res1,1) = 0.0;
+-end
+-
+-lon = lon * 180. / pi;
+-lat = lat * 180. / pi;
+-lon = lon - delta; 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/pargenerate.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/pargenerate.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/pargenerate.m	(revision 12997)
+@@ -1,45 +0,0 @@
+-function pargenerate(filename,xm,ym,data,varargin)
+-%PARGENERATE - generate parameter file for images ala Rignot
+-%
+-%   Usage: 
+-%      pargenerate(filename,data,xm,ym,options);
+-%
+-%   Supported options:
+-%      - title: dataset title
+-%      - latitude: standard latitude (degree)
+-%      - meridian: meridian (degree)
+-%      - format: binary format
+-
+-%process options
+-options=pairoptions(varargin{:});
+-Title=getfieldvalue(options,'title','N/A');
+-latitude=getfieldvalue(options,'latitude','N/A');
+-meridian=getfieldvalue(options,'meridian','N/A');
+-format=getfieldvalue(options,'format','single');
+-
+-%Get data info
+-[nlines ncols]=size(data);
+-xmin=min(xm);
+-ymax=max(ym);
+-postx=abs(xm(2)-xm(1));
+-posty=abs(ym(2)-ym(1));
+-
+-%Open header file and get machine type
+-fid=fopen(filename,'wt');
+-[filename, permission, machineformat, encoding] = fopen(fid);
+-
+-%write header file
+-fprintf(fid,'%s\n','ISSM gridded dataset parameter file');
+-fprintf(fid,'%s%s\n','title: ',Title);
+-fprintf(fid,'%s  \n','DEM_projection: PS');
+-fprintf(fid,'%s%s\n','data_format: ',format);
+-fprintf(fid,'%s%s\n','endian:      ',machineformat);
+-fprintf(fid,'%s%d\n','width:  ',ncols);
+-fprintf(fid,'%s%d\n','nlines: ',nlines);
+-fprintf(fid,'%s%g%s\n','PS_secant_lat:    ',latitude,'   decimal degrees');
+-fprintf(fid,'%s%g%s\n','PS_meridian_long: ',meridian,'   decimal degrees');
+-fprintf(fid,'%s%-15.10g\n','PS_corner_north:  ',ymax);
+-fprintf(fid,'%s%-15.10g\n','PS_corner_east:   ',xmin);
+-fprintf(fid,'%s%g%s\n','PS_post_north:    ',postx,' m');
+-fprintf(fid,'%s%g%s\n','PS_post_east:     ',posty,' m');
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/utm2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/utm2ll.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/LatLong/utm2ll.m	(revision 12997)
+@@ -1,117 +0,0 @@
+-function  [Lat,Lon] = utm2ll(xx,yy,utmzone)
+-% -------------------------------------------------------------------------
+-% [Lat,Lon] = utm2ll(x,y,utmzone)
+-%
+-% Description: Function to convert vectors of UTM coordinates into Lat/Lon vectors (WGS84).
+-% Some code has been extracted from UTMIP.m function by Gabriel Ruiz Martinez.
+-%
+-% Inputs:on)
+-%    -3.485713    7.801235 -119.955246  -17.759537  -94.799019  121.640266
+-%
+-% Example 2: If you need Lat/Lon coordinates in Degrees, Minutes and Seconds
+-% [Lat, Lon]=utm2ll(x,y,utmzone);
+-% LatDMS=dms2mat(deg2dms(Lat))
+-%LatDMS =
+-%    40.00         18.00         55.55
+-%    46.00         17.00          2.01
+-%    37.00         34.00         40.17
+-%    28.00         38.00         44.33
+-%    38.00         51.00         19.96
+-%    25.00          3.00         42.41
+-% LonDMS=dms2mat(deg2dms(Lon))
+-%LonDMS =
+-%    -3.00         29.00          8.61
+-%     7.00         48.00          4.40
+-%  -119.00         57.00         18.93
+-%   -17.00         45.00         34.33
+-%   -94.00         47.00         56.47
+-%   121.00         38.00         24.96
+-%
+-% Author:
+-%   Rafael Palacios
+-%   Universidad Pontificia Comillas
+-%   Madrid, Spain
+-% Version: Apr/06, Jun/06, Aug/06
+-% Aug/06: corrected m-Lint warnings
+-%-------------------------------------------------------------------------
+-
+-% Argument checking
+-%
+-error(nargchk(3, 3, nargin)); %3 arguments required
+-n1=length(xx);
+-n2=length(yy);
+-n3=size(utmzone,1);
+-if (n1~=n2 || n1~=n3)
+-	error('x,y and utmzone vectors should have the same number or rows');
+-end
+-c=size(utmzone,2);
+-if (c~=4)
+-	error('utmzone should be a vector of strings like "30 T"');
+-end
+-
+-% Memory pre-allocation
+-%
+-Lat=zeros(n1,1);
+-Lon=zeros(n1,1);
+-
+-% Main Loop
+-%
+-for i=1:n1
+-	if (utmzone(i,4)>'X' || utmzone(i,4)<'C')
+-		fprintf('utm2ll: Warning utmzone should be a vector of strings like "30 T", not "30 t"\n');
+-	end
+-	if (utmzone(i,4)>'M')
+-		hemis='N';   % Northern hemisphere
+-	else
+-		hemis='S';
+-	end
+-
+-	x=xx(i);
+-	y=yy(i);
+-	zone=str2double(utmzone(i,1:2));
+-
+-	sa = 6378137.000000 ; sb = 6356752.314245;
+-
+-	%   e = ( ( ( sa ^ 2 ) - ( sb ^ 2 ) ) ^ 0.5 ) / sa;
+-	e2 = ( ( ( sa ^ 2 ) - ( sb ^ 2 ) ) ^ 0.5 ) / sb;
+-	e2cuadrada = e2 ^ 2;
+-	c = ( sa ^ 2 ) / sb;
+-	%   alpha = ( sa - sb ) / sa;             %f
+-	%   ablandamiento = 1 / alpha;   % 1/f
+-
+-	X = x - 500000;
+-
+-	if hemis == 'S' || hemis == 's'
+-		Y = y - 10000000;
+-	else
+-		Y = y;
+-	end
+-
+-	S = ( ( zone * 6 ) - 183 );
+-	lat =  Y / ( 6366197.724 * 0.9996 );
+-	v = ( c / ( ( 1 + ( e2cuadrada * ( cos(lat) ) ^ 2 ) ) ) ^ 0.5 ) * 0.9996;
+-	a = X / v;
+-	a1 = sin( 2 * lat );
+-	a2 = a1 * ( cos(lat) ) ^ 2;
+-	j2 = lat + ( a1 / 2 );
+-	j4 = ( ( 3 * j2 ) + a2 ) / 4;
+-	j6 = ( ( 5 * j4 ) + ( a2 * ( cos(lat) ) ^ 2) ) / 3;
+-	alfa = ( 3 / 4 ) * e2cuadrada;
+-	beta = ( 5 / 3 ) * alfa ^ 2;
+-	gama = ( 35 / 27 ) * alfa ^ 3;
+-	Bm = 0.9996 * c * ( lat - alfa * j2 + beta * j4 - gama * j6 );
+-	b = ( Y - Bm ) / v;
+-	Epsi = ( ( e2cuadrada * a^ 2 ) / 2 ) * ( cos(lat) )^ 2;
+-	Eps = a * ( 1 - ( Epsi / 3 ) );
+-	nab = ( b * ( 1 - Epsi ) ) + lat;
+-	senoheps = ( exp(Eps) - exp(-Eps) ) / 2;
+-	Delt = atan(senoheps / (cos(nab) ) );
+-	TaO = atan(cos(Delt) * tan(nab));
+-	longitude = (Delt *(180 / pi ) ) + S;
+-	latitude = ( lat + ( 1 + e2cuadrada* (cos(lat)^ 2) - ( 3 / 2 ) * e2cuadrada * sin(lat) * cos(lat) * ( TaO - lat ) ) * ( TaO - lat ) ) * ...
+-		(180 / pi);
+-
+-	Lat(i)=latitude;
+-	Lon(i)=longitude;
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodellist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodellist.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodellist.m	(revision 12997)
+@@ -1,50 +0,0 @@
+-function varargout=loadmodellist(path)
+-%LOADMODELLIST- load a model using built-in load module
+-%
+-%   check that modellist prototype has not changed. if so, adapt to new modellist prototype.
+-%
+-%   Usage:
+-%      mds=loadmodellist(path)
+-%      loadmodellist path
+-
+-%check nargout
+-if nargout>1,
+-	error('loadmodellist usage error: mds=loadmodellist(path)');
+-end
+-%check existence
+-if ~exist(path)
+-	error(['loadmodellist error message: file ' path ' does not exist']);
+-end
+-
+-%check that the file is readable
+-[stat,mess]=fileattrib(path);
+-if( stat==0 | mess.UserRead~=1),
+-	error(['loadmodellist error message: file ' path ' is not readable (permission dinied).']);
+-end
+-
+-%check number of variables
+-if length(whos('-file',path))>1,
+-	error(['loadmodellist error message: file ' path ' contains several variables. Only one model should be present.']);
+-end
+-
+-try,
+-	struc=load(path,'-mat');
+-
+-	%get name of model variable
+-	fieldname=char(fieldnames(struc));
+-	mds=eval(['struc.' fieldname]);
+-	if ~strcmpi(class(mds),'model'),
+-		mds2=modellist;
+-		mds2=structtomodel(mds2,mds);
+-		mds=mds2;
+-		clear mds2;
+-	end
+-	if nargout,
+-		varargout{1}=mds;
+-	else
+-		assignin('caller',fieldname,mds);
+-	end
+-catch me
+-	disp(getReport(me))
+-	error(['could not load model ' path]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodel.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Model/loadmodel.m	(revision 12997)
+@@ -1,46 +0,0 @@
+-function varargout=loadmodel(path)
+-%LOADMODEL - load a model using built-in load module
+-%
+-%   check that model prototype has not changed. if so, adapt to new model prototype.
+-%
+-%   Usage:
+-%      md=loadmodel(path)
+-%      loadmodel path
+-
+-%check nargout
+-if nargout>1,
+-	error('loadmodel usage error: md=loadmodel(path)');
+-end
+-
+-%check existence
+-if exist(path,'file')
+-	%do nothing
+-elseif exist([path '.mat'],'file')
+-	%add extension
+-	path = [path '.mat'];
+-else
+-	error(['loadmodel error message: file ' path ' does not exist']);
+-end
+-
+-try,
+-	%recover model on file and name it md
+-	warning off MATLAB:unknownElementsNowStruc;
+-	warning off MATLAB:load:classNotFound
+-	struc=load(path,'-mat');
+-	warning on MATLAB:unknownElementsNowStruc;
+-	warning on MATLAB:load:classNotFound
+-
+-	name=char(fieldnames(struc));
+-	if size(name,1)>1,
+-		error(['loadmodel error message: file ' path ' contains several variables. Only one model should be present.']); 
+-	end
+-	md=struc.(name);
+-	if nargout,
+-		varargout{1}=md;
+-	else
+-		assignin('caller',name,md);
+-	end
+-catch me
+-	disp(getReport(me))
+-	error(['could not load model ' path]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/VelFindVarNames.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/VelFindVarNames.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/VelFindVarNames.m	(revision 12997)
+@@ -1,122 +0,0 @@
+-function Names=VelFindVarNames(filename)
+-%VELFINDVARNAMES - find names of variables in a velocity data set file
+-%
+-%   This routines looks at the variables contained in a file and finds out
+-%   the names of the variables that are needed for an interpolation (x,y,vx,vy)
+-%   or (index,x,y,vx,vy)
+-%
+-%   Usage:
+-%      Names=VelFindVarNames(filename)
+-%
+-%   Example:
+-%      Names=VelFindVarNames('velocities.mat')
+-%
+-%   See also: INTERPFROMFILE, GRIDDATA
+-
+-%some checks
+-if nargin~=1 | nargout~=1
+-	help VelFindVarNames
+-	error('VelFindVarNames error message: bad usage');
+-end
+-if ~exist(filename)
+-	error(['VelFindVarNames error message: file ' filename  ' does not exist']);
+-end
+-
+-%Get variables
+-A=whos('-file',filename);
+-
+-%find x,y,vx and vy
+-xenum=NaN; yenum=NaN; vxenum=NaN; vyenum=NaN; indexenum=NaN;
+-if length(A)==4,
+-	isnode=1;
+-	for i=1:4
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		else
+-			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
+-				vxenum=i;
+-			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
+-				vyenum=i;
+-			end
+-		end
+-	end
+-elseif length(A)==5,
+-	isnode=0;
+-	for i=1:5
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		elseif (strcmpi(A(i).name(1),'index') | strcmpi(A(i).name(1),'elements'));
+-			indexenum=i;
+-		else
+-			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
+-				vxenum=i;
+-			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
+-				vyenum=i;
+-			end
+-		end
+-	end
+-else
+-	error(['VelFindVarNames error message: file ' filename  ' not supported yet (it should hold 4 variables x,y,vx and vy (for nodes) OR 5 variables  x,y,index,vx and vy (for mesh))']);
+-end
+-
+-%assum that we have found at least vxenum and vyenum
+-if ( isnan(vxenum) | isnan(vyenum))
+-	error(['VelFindVarNames error message: file ' filename  ' not supported yet (the velocities should be named vx and vy)']);
+-end
+-
+-%find index
+-if (~isnode & isnan(indexenum)),
+-	for i=1:5
+-		lengthi=min(A(i).size);
+-		if (lengthi==3),
+-			indexenum=i;
+-		end
+-	end
+-	if isnan(indexenum),
+-		error(['VelFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
+-	end
+-end
+-
+-%find x y
+-if (isnan(xenum) | isnan(yenum))
+-
+-	%check the size
+-	if A(vxenum).size(1)==A(vxenum).size(2),
+-		error(['VelFindVarNames error message: file ' filename  ' not supported (velocities is a square matrix, save x and y with another name)']);
+-	end
+-	if ~(A(vxenum).size(1)==A(vyenum).size(1) & A(vxenum).size(2)==A(vyenum).size(2)),
+-		error(['VelFindVarNames error message: file ' filename  ' not supported (vx and vy matrices do not have the same size)']);
+-	end
+-
+-	%find xenum and yenum
+-	for i=1:4
+-		lengthi=max(A(i).size);
+-		if ((i~=vxenum) & (lengthi==A(vxenum).size(1) | lengthi==A(vxenum).size(1)+1)),
+-			yenum=i;
+-		elseif ((i~=vxenum) & (lengthi==A(vxenum).size(2) | lengthi==A(vxenum).size(2)+1)),
+-			xenum=i;
+-		end
+-	end
+-
+-	%last check
+-	if (isnan(xenum) | isnan(yenum))
+-		error(['plugdata error message: file ' filename  ' not supported yet']);
+-	end
+-end
+-
+-%create output
+-Names=struct();
+-Names.xname=A(xenum).name;
+-Names.yname=A(yenum).name;
+-Names.vxname=A(vxenum).name;
+-Names.vyname=A(vyenum).name;
+-if ~isnode,
+-	Names.indexname=A(indexenum).name; 
+-	Names.interp='mesh';
+-else
+-	Names.interp='node';
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/InterpFromFile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/InterpFromFile.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/InterpFromFile.m	(revision 12997)
+@@ -1,44 +0,0 @@
+-function data_out=InterpFromFile(x,y,filename,default_value)
+-%INTERPFROMFILE - load data and interpolate on the given nodes
+-%
+-%   load a matlab file (extension .mat) which holds 3 or 4 variables
+-%   and interpolate the data on the mesh and plug it onto the model.
+-%
+-%   o 3 variables
+-%     - a vector x (if the name of the variable do not begin with "x", an error can appear)
+-%     - a vector y (if the name of the variable do not begin with "y", an error can appear)
+-%     - a vector or matrix data (if the name of the variable do not begin with the field name, an error can appear)
+-%   o 4 variables
+-%     - a vector x (if the name of the variable do not begin with "x", an error can appear)
+-%     - a vector y (if the name of the variable do not begin with "y", an error can appear)
+-%     - a matrix with 3 columns (if the name of the variable do not begin with "index" or "elements", an error can appear)
+-%     - a vector data (if the name of the variable do not begin with the field name, an error can appear)
+-%
+-%   Usage:
+-%      data=InterpFromFile(x,y,filename,default_value);
+-%
+-%   Example:
+-%      md.geometry.surface=InterpFromFile(md.mesh.x,md.mesh.y,'surfacefile.mat',0);
+-%
+-%   See also: PLUGVELOCITIES, INTERPFROMGRID, INTERPFROMMESH2D, INTERPFROMMESH3D
+-
+-%some checks
+-if nargin~=4 | nargout~=1
+-	help InterpFromFile
+-	error('plugdata error message: bad usage');
+-end
+-if ~exist(filename)
+-	error(['plugdata error message: file ' filename  ' does not exist']);
+-end
+-if length(x)~=length(y),
+-	error('plugdata error message: x and y should have the same length');
+-end
+-
+-%load file
+-Names=FieldFindVarNames(filename);
+-Data=load(filename);
+-if strcmpi(Names.interp,'node'),
+-	data_out=InterpFromGridToMesh(Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y,default_value);
+-else
+-	data_out=InterpFromMeshToMesh2d(Data.(Names.indexname),Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FillHole.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FillHole.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FillHole.m	(revision 12997)
+@@ -1,39 +0,0 @@
+-function field=FillHole(index,x,y,field)
+-%FILLHOLE - fill mesh data that has holes in it (hole is defined by field==NaN). Get the nearest neighboors to fill the holes.
+-%
+-%   Usage:
+-%      surface=FillHole(index,x,y,surface)
+-%
+-%   Example:
+-%      md.geometry.surface=FillHole(md.mesh.elements,x,md.mesh.y,md.geometry.surface)
+-%
+-
+-%some checks
+-if nargin~=4 | nargout~=1
+-	help FillHole
+-	error('FillHole error message: bad usage');
+-end
+-
+-if length(x)~=length(y),
+-	error('plugdata error message: x and y should have the same length');
+-end
+-
+-
+-pos_hole=find(isnan(field));
+-pos_full=find(~isnan(field));
+-
+-%reduce our field to not include any holes: 
+-field_noholes=field(pos_full);
+-x_noholes=x(pos_full);
+-y_noholes=y(pos_full);
+-
+-for i=1:length(pos_hole)
+-
+-	if (mod(i,100)==0),
+-		fprintf('\b\b\b\b\b\b\b%5.2f%s',i/length(pos_hole)*100,' %');
+-	end
+-
+-	%search the node on the closest to i, that is not in a hole either
+-	[d posd]=min(sqrt((x(pos_hole(i))-x_noholes).^2+(y(pos_hole(i))-y_noholes).^2));
+-	field(pos_hole(i))=field_noholes(posd);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/plugvelocities.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/plugvelocities.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/plugvelocities.m	(revision 12997)
+@@ -1,41 +0,0 @@
+-function md=plugvelocities(md,filename,default_value)
+-%PLUGVELOCITIES - load velocities on a model
+-%
+-%   load a matlab file (extension .mat) which holds 4 variables
+-%   x,y,vx,vy to be plugged onto the model (or similar names)
+-%   x and y must be vectors, vx, vy matrices
+-%
+-%   Usage:
+-%      md=plugvelocities(md,filename,default_value)
+-%
+-%   Example:
+-%      md=plugvelocities(md,'velocityfile.mat',0);
+-%
+-%   See also: INTERPFROMFILE, GRIDDATA
+-
+-%some checks
+-if nargin~=3 | nargout~=1
+-	help plugvelocities
+-	error('plugvelocities error message: bad usage');
+-end
+-if ~exist(filename)
+-	error(['plugvelocities error message: file ' filename  ' does not exist']);
+-end
+-
+-%load velocities 
+-Names=VelFindVarNames(filename);
+-Vel=load(filename);
+-
+-%Interpolation
+-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,default_value);
+-	md.inversion.vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,default_value);
+-else
+-	md.inversion.vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,default_value);
+-	md.inversion.vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,default_value);
+-end
+-
+-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.vel=md.inversion.vel_obs;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/PatchToVec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/PatchToVec.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/PatchToVec.m	(revision 12997)
+@@ -1,21 +0,0 @@
+-function vec=PatchToVec(Patch);
+-%PATCHTOVEC - converts a patch to a vector by averaging over each vertex
+-%
+-%   Usage:
+-%      vec=PatchToVec(Patch)
+-
+-%if the patch is P0: we have element values, return an element vector
+-switch(size(Patch.value,2)),
+-	case 1,
+-		vec(Patch.element)=Patch.value;
+-	case 3,
+-		connectivity=sparse(Patch.index(:),1,1);
+-		value       =sparse(Patch.index(:),1,Patch.value(:));
+-		vec=full(value./connectivity);
+-	case 6,
+-		connectivity=sparse(Patch.index(:),1,1);
+-		value       =sparse(Patch.index(:),1,Patch.value(:));
+-		vec=full(value./connectivity);
+-	otherwise,
+-		error('interpolation not supported yet');
+-	end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FieldFindVarNames.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FieldFindVarNames.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Interp/FieldFindVarNames.m	(revision 12997)
+@@ -1,153 +0,0 @@
+-function Names=FieldFindVarNames(filename)
+-%FIELDFINDVARNAMES - find names of variables in a data set file
+-%
+-%   This routines looks at the variables contained in a file and finds out
+-%   the names of the variables that are needed for an interpolation (x,y,data)
+-%   or (index,x,y,data)
+-%
+-%   Usage:
+-%      Names=FieldFindVarNames(filename)
+-%
+-%   Example:
+-%      Names=FieldFindVarNames('thickness.mat')
+-%
+-%   See also: INTERPFROMFILE, GRIDDATA
+-
+-%some checks
+-if nargin~=1 | nargout~=1
+-	help FieldFindVarNames
+-	error('FieldFindVarNames error message: bad usage');
+-end
+-if ~exist(filename)
+-	error(['FieldFindVarNames error message: file ' filename  ' does not exist']);
+-end
+-
+-%Get variables
+-A=whos('-file',filename);
+-
+-%find x,y,vx and vy
+-xenum=NaN; yenum=NaN; dataenum=NaN; indexenum=NaN;
+-if length(A)==3,
+-	isnode=1;
+-	for i=1:3
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
+-			dataenum=i;
+-		else
+-			%nothing
+-		end
+-	end
+-elseif length(A)==4,
+-	isnode=0;
+-	for i=1:4
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		elseif (strncmpi(A(i).name,'index',5) | strncmpi(A(i).name,'elements',7));
+-			indexenum=i;
+-		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
+-			dataenum=i;
+-		else
+-			%nothing
+-		end
+-	end
+-else
+-	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (it should hold 3 variables x,y and data (for nodes) OR 4 variables  x,y,index and data (for mesh))']);
+-end
+-
+-%2: if only one item is missing, find it by elimination
+-if ~isnode,
+-	pos=find(isnan([xenum yenum indexenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:4,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:4,list);
+-		elseif pos==3,
+-			indexenum=setdiff(1:4,list);
+-		elseif pos==4,
+-			dataenum=setdiff(1:4,list);
+-		end
+-	end
+-else
+-	pos=find(isnan([xenum yenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:3,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:3,list);
+-		elseif pos==3,
+-			dataenum=setdiff(1:3,list);
+-		end
+-	end
+-end
+-
+-%assum that we have found at least xenum and yenum
+-if ( isnan(xenum) | isnan(yenum))
+-	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (the coordinates vectors should be named x and y)']);
+-end
+-
+-%find index
+-if (~isnode & isnan(indexenum)),
+-	for i=1:4
+-		lengthi=min(A(i).size);
+-		if (lengthi==3),
+-			indexenum=i;
+-		end
+-	end
+-	if isnan(indexenum),
+-		error(['FieldFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
+-	end
+-end
+-
+-%4: last chance
+-if ~isnode,
+-	pos=find(isnan([xenum yenum indexenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:4,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:4,list);
+-		elseif pos==3,
+-			indexenum=setdiff(1:4,list);
+-		elseif pos==4,
+-			dataenum=setdiff(1:4,list);
+-		end
+-	end
+-else
+-	pos=find(isnan([xenum yenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:3,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:3,list);
+-		elseif pos==3,
+-			dataenum=setdiff(1:3,list);
+-		end
+-	end
+-end
+-
+-%last check
+-if isnan(dataenum)
+-	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (data not found)']);
+-end
+-
+-%create output
+-Names=struct();
+-Names.xname=A(xenum).name;
+-Names.yname=A(yenum).name;
+-Names.dataname=A(dataenum).name;
+-if ~isnode,
+-	Names.indexname=A(indexenum).name; 
+-	Names.interp='mesh';
+-else
+-	Names.interp='node';
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/create_region.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/create_region.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/create_region.m	(revision 12997)
+@@ -1,15 +0,0 @@
+-function create_region(name)
+-%CREATE_REGION - create region  ????
+-%
+-%   very temporary function.
+-%   
+-%   Usage: 
+-%      create_region(name)
+-
+-eval(['mkdir ' name]);
+-eval(['cd ' name ]);
+-!mkdir Delivery Exp_Par Results
+-cd Exp_Par
+-!cp ../../RonneShelf/Exp_Par/* ./
+-!rm -rf Hole*
+-eval(['!mv Ronne.par ' name '.par']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/findarg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/findarg.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/findarg.m	(revision 12997)
+@@ -1,51 +0,0 @@
+-function  vals=findarg(arglist,field)
+-%FINDARG - find argument associated to a field in a list
+-%
+-%   This function parses through an argument list (typically varargin in a routine)
+-%   looking for a character array equal to field. Once this is found, we return the 
+-%   next value in the varargin (if possible). 
+-%   Because field might appear several times in the argument list, we return a structure 
+-%   holding all these values. 
+-%   Note that all comparisons to field value are case independent.
+-%
+-%   Usage:
+-%      vals=findarg(arglist,field)
+-%
+-%   Example:
+-%      routine foobar calls vals=findarg('Data',varargin)
+-%      with varargin='Data',1,'Data','foo','Plot','velocity','Arrow',4
+-%      findarg would return the following structure: vals(1).value=1, vals(2).value='foo'; 
+-
+-%some argument checking: 
+-if ((nargin==0) | (nargout==0)),
+-	help findarg;
+-	error('findarg error message');
+-end
+-
+-if ~ischar(field),
+-	error('findarg error message: field should be a string');
+-end
+-
+-if ~iscell(arglist),
+-	error('findarg error message: argument list should be a cell array.');
+-end
+-
+-%Recover data to plot
+-founddata=0;
+-
+-for i=1:(length(arglist)-1), %data in arglist comes in pairs, hence the -1.
+-	if ischar(arglist{i}),
+-		if (strcmpi(arglist{i},field)),
+-			founddata=founddata+1;
+-			if founddata==1,
+-				vals.value=arglist{i+1};
+-			else
+-				vals(end+1).value=arglist{i+1};
+-			end
+-		end
+-	end
+-end
+-
+-if founddata==0,
+-	vals=[];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf2struct.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf2struct.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf2struct.m	(revision 12997)
+@@ -1,27 +0,0 @@
+-function S=netcdf2struct(File)
+-%NETCDF2STRUCT - load netcdf file and convert to a matlab structure
+-%
+-%   Usage:
+-%      S=netcdf2struct(File);
+-
+-%Read netcdf file
+-data=netcdf(File);
+-
+-%initialize output
+-S=struct();
+-
+-%All the variables are in VarArray field
+-variables=data.VarArray;
+-for i=1:size(variables,2),
+-	fieldname=deblank(variables(i).Str);
+-	fieldvalue=double(squeeze(variables(i).Data));
+-	S.(fieldname)=fieldvalue;
+-end
+-
+-%All the variables are in AttArray field
+-variables=data.AttArray;
+-for i=1:size(variables,2),
+-	fieldname=deblank(variables(i).Str);
+-	fieldvalue=double(variables(i).Val);
+-	S.(fieldname)=fieldvalue;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/issmdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/issmdoc.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/issmdoc.m	(revision 12997)
+@@ -1,15 +0,0 @@
+-%Quick documentation for ISSM
+-
+-%First get ISSM tier: 
+-ISSM_DIR=issmdir;
+-
+-disp(sprintf('\n%s','  A comprehensive documentation is available on http://issm.jpl.nasa.gov'));
+-disp(sprintf('\n%s','  Example: how to create a square ice shelf'));
+-disp(sprintf('%s','	   go to ',ISSM_DIR,'/examples/SquareIceshelf'));
+-disp(sprintf('%s','	   md=model;                                %creates a new empty model structure'));
+-disp(sprintf('%s','	   md=triangle(md,''DomainOutline.exp'',50000);   %creates a mesh of the domain outline with a resolution of 50000m'));
+-disp(sprintf('%s','	   md=setmask(md,''all'','''');               %defines the glacier system as an ice shelf (no island)'));
+-disp(sprintf('%s','	   md=parameterize(md,''Square.par'');        %fills all the other fields of the model'));
+-disp(sprintf('%s','	   md=setflowequation(md,''macayeal'',''all''); %defines all elements as MacAyeal''s'));
+-disp(sprintf('%s','	   md=solve(md,DiagnosticSolutionEnum);   %generate the velocity field'));
+-disp(sprintf('%s','	   plotmodel(md,''data'',md.results.DiagnosticSolution.Vel);    %displays the velocity (type plotdoc for plotmodel help)'));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/structtoobj.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/structtoobj.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/structtoobj.m	(revision 12997)
+@@ -1,16 +0,0 @@
+-function obj=structtoobj(obj,S),
+-%Convert struct to object
+-
+-	%Get object and structure fields
+-	structfields=fields(S);
+-	objprops    =properties(class(obj));
+-
+-	%recover object properties
+-	for i=1:length(structfields),
+-		fieldname =structfields{i};
+-		if ismember(fieldname,objprops),
+-			fieldvalue=getfield(S,fieldname);
+-			obj=setfield(obj,fieldname,fieldvalue);
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Miscellaneous/netcdf.m	(revision 12997)
+@@ -1,136 +0,0 @@
+-function S = netcdf(File,varargin)
+-% Function to read NetCDF files
+-%   S = netcdf(File)
+-% Input Arguments
+-%   File = NetCDF file to read
+-% Optional Input Arguments:
+-%   'Var',Var - Read data for VarArray(Var), default [1:length(S.VarArray)]
+-%   'Rec',Rec - Read data for Record(Rec), default [1:S.NumRecs]
+-% Output Arguments:
+-%   S    = Structure of NetCDF data organised as per NetCDF definition
+-% Notes:
+-%   Only version 1, classic 32bit, NetCDF files are supported. By default
+-% data are extracted into the S.VarArray().Data field for all variables.
+-% To read the header only call S = netcdf(File,'Var',[]);
+-%
+-% SEE ALSO
+-% ---------------------------------------------------------------------------
+-S = [];
+-
+-try
+-   if exist(File,'file') fp = fopen(File,'r','b');
+-   else fp = []; error('File not found'); end
+-   if fp == -1   error('Unable to open file'); end
+-
+-% Read header
+-   Magic = fread(fp,4,'uint8=>char');
+-   if strcmp(Magic(1:3),'CDF') error('Not a NetCDF file'); end
+-   if uint8(Magic(4))~=1       error('Version not supported'); end
+-   S.NumRecs  = fread(fp,1,'uint32=>uint32');
+-   S.DimArray = DimArray(fp);
+-   S.AttArray = AttArray(fp);
+-   S.VarArray = VarArray(fp);
+-
+-% Setup indexing to arrays and records
+-   Var = ones(1,length(S.VarArray));
+-   Rec = ones(1,S.NumRecs);
+-   for i = 1:2:length(varargin)
+-      if     strcmp(upper(varargin{i}),'VAR') Var=Var*0; Var(varargin{i+1})=1;
+-      elseif strcmp(upper(varargin{i}),'REC') Rec=Rec*0; Rec(varargin{i+1})=1;
+-      else error('Optional input argument not recognised'); end
+-   end
+-   if sum(Var)==0 fclose(fp); return; end
+-
+-% Read non-record variables
+-   Dim = double(cat(2,S.DimArray.Dim));
+-   ID  = double(cat(2,S.VarArray.Type));
+-
+-   for i = 1:length(S.VarArray)
+-      D = Dim(S.VarArray(i).DimID+1); N = prod(D); RecID{i}=find(D==0);
+-      if isempty(RecID{i})
+-         if length(D)==0 D = [1,1]; N = 1; elseif length(D)==1 D=[D,1]; end
+-         if Var(i)
+-            S.VarArray(i).Data = ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D);
+-            fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8');
+-         else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
+-      else S.VarArray(i).Data = []; end
+-   end
+-
+-% Read record variables
+-   for k = 1:S.NumRecs
+-      for i = 1:length(S.VarArray)
+-         if ~isempty(RecID{i})
+-            D = Dim(S.VarArray(i).DimID+1); D(RecID{i}) = 1; N = prod(D);
+-            if length(D)==1 D=[D,1]; end
+-            if Var(i) & Rec(k)
+-               S.VarArray(i).Data = cat(RecID{i},S.VarArray(i).Data,...
+-                  ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D));
+-               if N > 1 fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8'); end
+-            else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
+-         end
+-      end
+-   end
+-
+-   fclose(fp);
+-catch
+-   Err = lasterror; fprintf('%s\n',Err.message);
+-   if ~isempty(fp) && fp ~= -1 fclose(fp); end
+-end
+-
+-% ---------------------------------------------------------------------------------------
+-% Utility functions
+-
+-function S = Size(ID)
+-% Size of NetCDF data type, ID, in bytes
+-   S = subsref([1,1,2,4,4,8],struct('type','()','subs',{{ID}}));
+-
+-function T = Type(ID)
+-% Matlab string for CDF data type, ID
+-   T = subsref({'int8','char','int16','int32','single','double'},...
+-               struct('type','{}','subs',{{ID}}));
+-
+-function N = Pad(Num,ID)
+-% Number of elements to read after padding to 4 bytes for type ID
+-   N = (double(Num) + mod(4-double(Num)*Size(ID),4)/Size(ID)).*(Num~=0);
+-
+-function S = String(fp)
+-% Read a CDF string; Size,[String,[Padding]]
+-   S = fread(fp,Pad(fread(fp,1,'uint32=>uint32'),1),'uint8=>char').';
+-
+-function A = ReOrder(A,S)
+-% Rearrange CDF array A to size S with matlab ordering
+-   A = permute(reshape(A,fliplr(S)),fliplr(1:length(S)));
+-
+-function S = DimArray(fp)
+-% Read DimArray into structure
+-   if fread(fp,1,'uint32=>uint32') == 10 % NC_DIMENSION
+-      for i = 1:fread(fp,1,'uint32=>uint32')
+-         S(i).Str = String(fp);
+-         S(i).Dim = fread(fp,1,'uint32=>uint32');
+-      end
+-   else fread(fp,1,'uint32=>uint32'); S = []; end
+-
+-function S = AttArray(fp)
+-% Read AttArray into structure
+-   if fread(fp,1,'uint32=>uint32') == 12 % NC_ATTRIBUTE
+-      for i = 1:fread(fp,1,'uint32=>uint32')
+-         S(i).Str = String(fp);
+-         ID       = fread(fp,1,'uint32=>uint32');
+-         Num      = fread(fp,1,'uint32=>uint32');
+-         S(i).Val = fread(fp,Pad(Num,ID),[Type(ID),'=>',Type(ID)]).';
+-      end
+-   else fread(fp,1,'uint32=>uint32'); S = []; end
+-
+-function S = VarArray(fp)
+-% Read VarArray into structure
+-   if fread(fp,1,'uint32=>uint32') == 11 % NC_VARIABLE
+-      for i = 1:fread(fp,1,'uint32=>uint32')
+-         S(i).Str      = String(fp);
+-         Num           = double(fread(fp,1,'uint32=>uint32'));
+-         S(i).DimID    = double(fread(fp,Num,'uint32=>uint32'));
+-         S(i).AttArray = AttArray(fp);
+-         S(i).Type     = fread(fp,1,'uint32=>uint32');
+-         S(i).VSize    = fread(fp,1,'uint32=>uint32');
+-         S(i).Begin    = fread(fp,1,'uint32=>uint32'); % Classic 32 bit format only
+-      end
+-   else fread(fp,1,'uint32=>uint32'); S = []; end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.py	(revision 12997)
+@@ -1,50 +0,0 @@
+-from numpy import *
+-
+-def paterson(temperature):
+-
+-    # Local Variables: pos11, pos5, pos10, temperature, pos, T, pos8, pos9, pos6, pos7, pos4, rigidity, pos2, pos3, pos1
+-    # Function calls: length, zeros, argwhere, paterson, error
+-    #PATERSON - figure out the rigidity of ice for a given temperature
+-    #
+-    #   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
+-    #   temperature is in Kelvin degrees
+-    #
+-    #   Usage:
+-    #      rigidity=paterson(temperature)
+-    
+-	pos=argwhere(temperature<0.)
+-	if len(pos):
+-		print 'input temperature should be in Kelvin (positive)'
+-		return []
+-    
+-	T = temperature-273.15
+-	#The routine below is equivalent to:
+-	# n=3; T=temperature-273;
+-	# %From paterson,
+-	# Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
+-	# A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
+-	# 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
+-	# %Convert into rigidity B
+-	# B=A.^(-1/n)*10^3; %s^(1/3)Pa
+-	# %Now, do a cubic fit between Temp and B: 
+-	# fittedmodel=fit(Temp,B,'cubicspline');
+-	# rigidity=fittedmodel(temperature);
+-
+-	rigidity=zeros(len(T))
+-	pos1=argwhere(T<=-45);           rigidity[pos1]=10**8*(-0.000292866376675*(T[pos1]+50)**3+ 0.011672640664130*(T[pos1]+50)**2  -0.325004442485481*(T[pos1]+50)+  6.524779401948101)
+-	pos2=argwhere(logical_and(-45<=T,T<-40));   rigidity[pos2]=10**8*(-0.000292866376675*(T[pos2]+45)**3+ 0.007279645014004*(T[pos2]+45)**2  -0.230243014094813*(T[pos2]+45)+  5.154964909039554)
+-	pos3=argwhere(logical_and(-40<=T,T<-35));   rigidity[pos3]=10**8*(0.000072737147457*(T[pos3]+40)**3+  0.002886649363879*(T[pos3]+40)**2  -0.179411542205399*(T[pos3]+40)+  4.149132666831214)
+-	pos4=argwhere(logical_and(-35<=T,T<-30));   rigidity[pos4]=10**8*(-0.000086144770023*(T[pos4]+35)**3+ 0.003977706575736*(T[pos4]+35)**2  -0.145089762507325*(T[pos4]+35)+  3.333333333333331)
+-	pos5=argwhere(logical_and(-30<=T,T<-25));   rigidity[pos5]=10**8*(-0.000043984685769*(T[pos5]+30)**3+ 0.002685535025386*(T[pos5]+30)**2  -0.111773554501713*(T[pos5]+30)+  2.696559088937191)
+-	pos6=argwhere(logical_and(-25<=T,T<-20));   rigidity[pos6]=10**8*(-0.000029799523463*(T[pos6]+25)**3+ 0.002025764738854*(T[pos6]+25)**2  -0.088217055680511*(T[pos6]+25)+  2.199331606342181)
+-	pos7=argwhere(logical_and(-20<=T,T<-15));   rigidity[pos7]=10**8*(0.000136920904777*(T[pos7]+20)**3+  0.001578771886910*(T[pos7]+20)**2  -0.070194372551690*(T[pos7]+20)+  1.805165505978111)
+-	pos8=argwhere(logical_and(-15<=T,T<-10));   rigidity[pos8]=10**8*(-0.000899763781026*(T[pos8]+15)**3+ 0.003632585458564*(T[pos8]+15)**2  -0.044137585824322*(T[pos8]+15)+  1.510778053489523)
+-	pos9=argwhere(logical_and(-10<=T,T<-5));    rigidity[pos9]=10**8*(0.001676964325070*(T[pos9]+10)**3-  0.009863871256831*(T[pos9]+10)**2  -0.075294014815659*(T[pos9]+10)+  1.268434288203714)
+-	pos10=argwhere(logical_and(-5<=T,T<-2));    rigidity[pos10]=10**8*(-0.003748937622487*(T[pos10]+5)**3+0.015290593619213*(T[pos10]+5)**2  -0.048160403003748*(T[pos10]+5)+  0.854987973338348)
+-	pos11=argwhere(-2<=T);           rigidity[pos11]=10**8*(-0.003748937622488*(T[pos11]+2)**3-0.018449844983174*(T[pos11]+2)**2  -0.057638157095631*(T[pos11]+2)+  0.746900791092860)
+-
+-	#Now make sure that rigidity is positive
+-	pos=argwhere(rigidity<0);        rigidity[pos]=1**6 
+-
+-	return rigidity
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/paterson.m	(revision 12997)
+@@ -1,42 +0,0 @@
+-function rigidity=paterson(temperature)
+-%PATERSON - figure out the rigidity of ice for a given temperature
+-%
+-%   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
+-%   temperature is in Kelvin degrees
+-%
+-%   Usage:
+-%      rigidity=paterson(temperature)
+-
+-if(temperature<0)
+-	error('input temperature should be in Kelvin (positive)');
+-end
+-T=temperature-273.15;
+-
+-%The routine below is equivalent to:
+-
+-% n=3; T=temperature-273;
+-% %From paterson,
+-% Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
+-% A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
+-% 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
+-% %Convert into rigidity B
+-% B=A.^(-1/n)*10^3; %s^(1/3)Pa
+-% %Now, do a cubic fit between Temp and B: 
+-% fittedmodel=fit(Temp,B,'cubicspline');
+-% rigidity=fittedmodel(temperature);
+-
+-rigidity=zeros(length(T),1);
+-pos1=find(T<=-45);           rigidity(pos1)=10^8*(-0.000292866376675*(T(pos1)+50).^3+ 0.011672640664130*(T(pos1)+50).^2  -0.325004442485481*(T(pos1)+50)+  6.524779401948101);
+-pos2=find(-45<=T & T<-40);   rigidity(pos2)=10^8*(-0.000292866376675*(T(pos2)+45).^3+ 0.007279645014004*(T(pos2)+45).^2  -0.230243014094813*(T(pos2)+45)+  5.154964909039554);
+-pos3=find(-40<=T & T<-35);   rigidity(pos3)=10^8*(0.000072737147457*(T(pos3)+40).^3+  0.002886649363879*(T(pos3)+40).^2  -0.179411542205399*(T(pos3)+40)+  4.149132666831214);
+-pos4=find(-35<=T & T<-30);   rigidity(pos4)=10^8*(-0.000086144770023*(T(pos4)+35).^3+ 0.003977706575736*(T(pos4)+35).^2  -0.145089762507325*(T(pos4)+35)+  3.333333333333331);
+-pos5=find(-30<=T & T<-25);   rigidity(pos5)=10^8*(-0.000043984685769*(T(pos5)+30).^3+ 0.002685535025386*(T(pos5)+30).^2  -0.111773554501713*(T(pos5)+30)+  2.696559088937191);
+-pos6=find(-25<=T & T<-20);   rigidity(pos6)=10^8*(-0.000029799523463*(T(pos6)+25).^3+ 0.002025764738854*(T(pos6)+25).^2  -0.088217055680511*(T(pos6)+25)+  2.199331606342181);
+-pos7=find(-20<=T & T<-15);   rigidity(pos7)=10^8*(0.000136920904777*(T(pos7)+20).^3+  0.001578771886910*(T(pos7)+20).^2  -0.070194372551690*(T(pos7)+20)+  1.805165505978111);
+-pos8=find(-15<=T & T<-10);   rigidity(pos8)=10^8*(-0.000899763781026*(T(pos8)+15).^3+ 0.003632585458564*(T(pos8)+15).^2  -0.044137585824322*(T(pos8)+15)+  1.510778053489523);
+-pos9=find(-10<=T & T<-5);    rigidity(pos9)=10^8*(0.001676964325070*(T(pos9)+10).^3-  0.009863871256831*(T(pos9)+10).^2  -0.075294014815659*(T(pos9)+10)+  1.268434288203714);
+-pos10=find(-5<=T & T<-2);    rigidity(pos10)=10^8*(-0.003748937622487*(T(pos10)+5).^3+0.015290593619213*(T(pos10)+5).^2  -0.048160403003748*(T(pos10)+5)+  0.854987973338348);
+-pos11=find(-2<=T);           rigidity(pos11)=10^8*(-0.003748937622488*(T(pos11)+2).^3-0.018449844983174*(T(pos11)+2).^2  -0.057638157095631*(T(pos11)+2)+  0.746900791092860);
+-
+-%Now make sure that rigidity is positive
+-pos=find(rigidity<0);        rigidity(pos)=10^6;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/carter.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/carter.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/carter.m	(revision 12997)
+@@ -1,28 +0,0 @@
+-function attenuation=carter(temperature)
+-%CARTER - attenuation as a function of temperature
+-%
+-%   TWO WAY - Attenuation (in dB/m) as a function of temperature (K)
+-%   From Carter at al. 2007 (Radar-based subglacial lake classification in Antarctica)
+-%   Figure 4
+-%
+-%   Usage:
+-%      attenuation=carter(temperature)
+-
+-if(temperature<0)
+-	error('input temperature should be in Kelvin (positive)');
+-end
+-T=temperature-273.15;
+-
+-Temp=[-50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0]';
+-A=[0.0015 0.002 0.003 0.0042 0.0055 0.0083 0.012 0.0175 0.026 0.038 0.055]';
+-
+-%Now, do a cubic fit between Temp and B: 
+-[cfun,gof,output]=fit(Temp,A,'cubicspline');
+-%breaks=cfun.p.breaks;
+-%coeff=cfun.p.coefs;
+-
+-%Calculate attenuation
+-attenuation=cfun(T);
+-
+-%Make it a 2 way attenuation
+-attenuation=2*attenuation;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/lithostaticpressure.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/lithostaticpressure.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Meca/lithostaticpressure.m	(revision 12997)
+@@ -1,7 +0,0 @@
+-function pressure=lithostaticpressure(rho_ice,g,s,z);
+-%LITHOSTATICPRESSURE - compute the lithostatic pressure
+-%
+-%   Usage:
+-%      pressure=lithostacticpressure(rho_ice,g,surface,z)
+-
+-pressure=rho_ice*g*(s-z);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/varmap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/varmap.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/varmap.m	(revision 12997)
+@@ -1,55 +0,0 @@
+-function output = varmap(x,y,data,varargin);
+-%VARMAP - use gslib for Kriging
+-%
+-%   Usage:
+-%      output = varmap(x,y,data,varargin)
+-
+-options=pairoptions(varargin{:});
+-
+-nxlag = getfieldvalue(options,'nxlag', 20);
+-nylag = getfieldvalue(options,'nylag', 20);
+-dxlag = getfieldvalue(options,'dxlag', 1000);
+-dylag = getfieldvalue(options,'dylag', 1000);
+-
+-%Write data file
+-fid=fopen('cluster.dat','w');
+-fprintf(fid,'%s\n','Data file');
+-fprintf(fid,'%i\n',3);
+-fprintf(fid,'%s\n','Xlocation');
+-fprintf(fid,'%s\n','Ylocation');
+-fprintf(fid,'%s\n','Data');
+-fprintf(fid,'%g %g %g\n',[x y data]');
+-fclose(fid);
+-
+-%Write parameter file
+-fid=fopen('varmap.par','w');
+-fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
+-fprintf(fid,'\t\t\t\t%s\n','*******************');
+-fprintf(fid,'\n');
+-fprintf(fid,'%s\n','START OF PARAMETERS:');
+-fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
+-fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
+-fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
+-fprintf(fid,'%-30s %s\n','0    '                      ,'\1=regular grid, 0=scattered values');
+-fprintf(fid,'%-30s %s\n','50 50 1'                    ,'\if =1: nx, ny, nz');
+-fprintf(fid,'%-30s %s\n','1.0 1.0 1.0'                ,'\       xsiz, ysiz, zsiz if igrid=1');
+-fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\if =0: columns for x, y and z coordinates');
+-fprintf(fid,'%-30s %s\n','varmap.out'                 ,'\file for variogram output');
+-fprintf(fid,'%-30s %s\n',num2str([nxlag nylag 0],'%i '),'\nxlag, nylag, nzlag');
+-fprintf(fid,'%-30s %s\n',num2str([dxlag dylag 1],'%g %g %i'),'\dxlag, dylag, dzlag');
+-fprintf(fid,'%-30s %s\n','5'                          ,'\minimum number of pairs');
+-fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
+-fprintf(fid,'%-30s %s\n','1'                          ,'\number of variograms');
+-fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail, head, variogram type');
+-fclose(fid);
+-
+-%Call varmap
+-system([issmdir() '/externalpackages/gslib/install/varmap varmap.par']);
+-delete('varmap.par');
+-
+-%Read output
+-fid=fopen('varmap.out','r');
+-A = textscan(fid,'%f %f %f %f %f %f','headerlines',8);
+-fclose(fid);
+-delete('varmap.out')
+-output = reshape(A{1},[2*nxlag+1 2*nylag+1]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataBoundaries.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataBoundaries.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataBoundaries.m	(revision 12997)
+@@ -1,43 +0,0 @@
+-function	[Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
+-%CREATEDATABOUNDARIES - Create values on the edge of the matrix
+-%
+-%   This function create vectors with coordinates and values to constrain a matrix 
+-%   on its edge from a given matrix tiwh data everywhere.
+-%   x_m and y_m belongs to the matrix to be constrained
+-%   x_matrix, y_matrix belongs to the matrix to be constrained with
+-%   datamatrix is the matrix with values for the constraint
+-%
+-%   Usage:
+-%      [Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
+-% 
+-%   See also: TRACKSTOMATRIX, CREATEDATAMATRIX
+-
+-%Check the consistency of the data matrix
+-if(length(x_matrix)~=(size(datamatrix,2)+1) | length(y_matrix)~=(size(datamatrix,1)+1)),
+-	error('CreateDataBoundaries error message: size of matrix and vectors to constrained not consistent')
+-end
+-
+-nxglobal=length(x_m);
+-nyglobal=length(y_m);
+-
+-%Create the edgevalues and coordinates
+-xedge1=x_m(1)*ones(nyglobal,1);
+-xedge2=x_m(2:end-1);
+-xedge3=x_m(end)*ones(nyglobal,1);
+-xedge4=x_m(2:end-1);
+-xedge5=x_m(2)*ones(nyglobal-2,1);
+-xedge6=x_m(3:end-2);
+-xedge7=x_m(end-1)*ones(nyglobal-2,1);
+-xedge8=x_m(3:end-2);
+-yedge1=y_m;
+-yedge2=y_m(1)*ones(nxglobal-2,1);
+-yedge3=y_m;
+-yedge4=y_m(end)*ones(nxglobal-2,1);
+-yedge5=y_m(2:end-1);
+-yedge6=y_m(2)*ones(nxglobal-4,1);
+-yedge7=y_m(2:end-1);
+-yedge8=y_m(end-1)*ones(nxglobal-4,1);
+-
+-Xedge=[xedge1;xedge2;xedge3;xedge4;xedge5;xedge6;xedge7;xedge8];
+-Yedge=[yedge1;yedge2;yedge3;yedge4;yedge5;yedge6;yedge7;yedge8];
+-EdgeValues=DataInterp(x_matrix,y_matrix,datamatrix,Xedge,Yedge);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gamv.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gamv.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gamv.m	(revision 12997)
+@@ -1,70 +0,0 @@
+-function output = gamv(x,y,data,varargin);
+-%GAMV - use gslib for Kriging
+-%
+-%   Usage:
+-%      output = gamv(x,y,data,varargin)
+-
+-options=pairoptions(varargin{:});
+-
+-nlag = getfieldvalue(options,'nlag', 20);
+-dlag = getfieldvalue(options,'dlag', 1000);
+-
+-%Write data file
+-fid=fopen('cluster.dat','w');
+-fprintf(fid,'%s\n','Data file');
+-fprintf(fid,'%i\n',3);
+-fprintf(fid,'%s\n','Xlocation');
+-fprintf(fid,'%s\n','Ylocation');
+-fprintf(fid,'%s\n','Data');
+-fprintf(fid,'%g %g %g\n',[x y data]');
+-fclose(fid);
+-
+-%Write parameter file
+-fid=fopen('gamv.par','w');
+-fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
+-fprintf(fid,'\t\t\t\t%s\n','*******************');
+-fprintf(fid,'\n');
+-fprintf(fid,'%s\n','START OF PARAMETERS:');
+-fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
+-fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
+-fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
+-fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
+-fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
+-fprintf(fid,'%-30s %s\n',num2str(nlag,'%i')           ,'\number of lags');
+-fprintf(fid,'%-30s %s\n',num2str(dlag,'%g')           ,'\lag separation distance');
+-fprintf(fid,'%-30s %s\n',num2str(dlag/2,'%g')         ,'\lag tolerance');
+-fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
+-fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
+-fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
+-fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
+-fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
+-fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
+-fclose(fid);
+-
+-%Call gamv
+-system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
+-delete('gamv.par');
+-
+-%Read output
+-output   = struct('Semivariogram',[],'Covariance',[]);
+-counter1 = 1;
+-counter2 = 1;
+-fid=fopen('gamv.out','r');
+-while (~feof(fid)),
+-	A=fscanf(fid,'%s',1);
+-	if strcmp(A,'Covariance');
+-		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
+-		output(counter1).Covariance=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
+-		counter1=counter1+1;
+-	elseif strcmp(A,'Semivariogram'),
+-		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
+-		output(counter2).Semivariogram=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
+-		counter2=counter2+1;
+-	else
+-		%do nothing
+-	end
+-end
+-fclose(fid);
+-delete('gamv.out')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/pkriging.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/pkriging.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/pkriging.m	(revision 12997)
+@@ -1,55 +0,0 @@
+-function [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
+-%PKRIGING - parallel Kriging
+-%
+-%   Usage:
+-%      [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
+-
+-options=pairoptions(varargin{:});
+-cluster=getfieldvalue(options,'cluster',generic('np',10));
+-options=removefield(options,'cluster',0);
+-name   = ['krig' num2str(feature('GetPid'))];
+-
+-% =========================================   MARSHALL.m =================================================
+-disp(['marshalling file ' name '.bin']);
+-fid=fopen([name '.bin'],'wb');
+-if fid==-1,
+-	error(['marshall error message: could not open ' name '.bin file for binary writing']);
+-end
+-
+-%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
+-WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
+-
+-%Write all data
+-WriteData(fid,'enum',0,'data',x,'format','DoubleMat');
+-WriteData(fid,'enum',1,'data',y,'format','DoubleMat');
+-WriteData(fid,'enum',2,'data',observations,'format','DoubleMat');
+-WriteData(fid,'enum',3,'data',x_interp,'format','DoubleMat');
+-WriteData(fid,'enum',4,'data',y_interp,'format','DoubleMat');
+-options.marshall(fid,5);
+-st=fclose(fid);
+-if st==-1,
+-	error(['marshall error message: could not close file ' name '.bin']);
+-end
+-% =========================================   MARSHALL.m =================================================
+-
+-%Launch job on remote cluster
+-BuildKrigingQueueScript(cluster,name,'',1,0,0); %gather, valgrind, gprof
+-tic
+-LaunchQueueJob(cluster,name,name,{[name '.bin'] [name '.queue']});
+-toc
+-choice=input('Is the job successfully completed? (y/n)','s');
+-Download(cluster,name,{[name '.outbin']});
+-structure=parseresultsfromdisk([name '.outbin'],0);
+-delete([name '.outlog']);
+-delete([name '.errlog']);
+-delete([name '.outbin']);
+-delete([name '.bin']);
+-if ~ispc,
+-	delete([name '.tar.gz']);
+-end
+-
+-%Process results
+-B=structure.AutodiffForward;
+-B=reshape(B,size(x_interp,2),size(x_interp,1))';
+-E=structure.AutodiffIsautodiff;
+-E=reshape(E,size(x_interp,2),size(x_interp,1))';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/MisfitDeinterlace.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/MisfitDeinterlace.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/MisfitDeinterlace.m	(revision 12997)
+@@ -1,21 +0,0 @@
+-function Jstruct=MisfitDeinterlace(misfit,type)
+-%MISFITDEINTERLACE - deinterlace misfits that are mixed together, using type.
+-%
+-%   Usage:
+-%      Jstruct=MisfitDeinterlace(misfit,type)
+-%
+-%   Example:
+-%      Jstruct=MisfitDeinterlace(md.results.diagnostic.J,md.fit)
+-%
+-%
+-Jstruct=struct();
+-
+-count=1;
+-for i=0:max(type),
+-	pos=find(type==i);
+-	if length(pos),
+-		Jstruct(count).type=i;
+-		Jstruct(count).J=misfit(pos);
+-		count=count+1;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.fig
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/addtrack.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/addtrack.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/addtrack.m	(revision 12997)
+@@ -1,156 +0,0 @@
+-function [x_m2 y_m2 values2]=addtrack(x_m1,y_m1,values1,track_coord,track_values,distance,exponent,varargin),
+-%ADDTRACK - modify a map to take values of a track
+-%
+-%   This routine modifies a map to improve it with values of tracks.
+-%   This output map has more values than the input one so that the values
+-%   of the tracks are relevant.
+-%   x_m1 and y_m1 are two vectors containing the coordinates of the matrix
+-%   the distance between two points must be the same everywhere
+-%   values1 is a matrix of size (y_m1-1)*(x_m1-1)
+-%   trac_coord is an exp file containing the coordinates of the tracks (x and y)
+-%   trav_values is a vector with the values along the track coordinates
+-%   distance indicates the distance from the tracks where points have to be modified
+-%   exposant allows to chance the influence of the track and the map
+-%   it must be positive and usually is superior to 1.
+-%
+-%   Usage:
+-%      [x_m2 y_m2 values1 values2]=addtrack(x_m1,y_m1,values1,track_coord,track_values,distance,exposant[,subdivision])
+-%
+-%   Example:
+-%      [xnew ynew valuesnew]=addtrack(x_m,y_m,thickness,'trackcoord.exp',thickness_track,1000,2)
+-%      [xnew ynew valuesnew]=addtrack(x_m,y_m,thickness,'trackcoord.exp',thickness_track,1000,2,3)
+-
+-%Create a new picture precise enough to be modified by the tracks
+-%Read the points of the tracks
+-stru=expread(track_coord,1);
+-nods=stru.nods;
+-xtracks=stru.x';
+-ytracks=stru.y';
+-
+-%First check that the parameters are ok:
+-if (size(track_values,1)~=nods)  || (size(xtracks,2)~=nods) || (size(ytracks,2)~=nods),
+-	error('addtrack error message : track coordinates and track values must have the same size');
+-elseif distance<0,
+-	error('addtrack error message : the distance must be a positive value');
+-elseif exponent<0,
+-	error('addtrack error message : the exponent must be a positive value');
+-elseif (size(x_m1,1)~=(size(values1,2)+1)) || (size(y_m1,1)~=(size(values1,1)+1)),
+-	error('addtrack error message : problem in the map, check the size of x_m1, y_m1 and values1');
+-end
+-
+-%stru.nods=4;
+-%xtracks=[50 50 55 62]; % 2 3 4 5 6 7 8 9 1 ]';
+-%ytracks=[40 40.5 41 41]; % 5 5 5 5 5 5 5 5 8 ]';
+-%x_m1=[1:10:101]';
+-%y_m1=[1:10:101]';
+-%track_values=2*ones(4,1);
+-%values1=ones(10,10);
+-
+-%Find the average distance between two points of the tracks
+-av_x=sum(abs(diff(xtracks)))/(stru.nods-1);
+-av_y=sum(abs(diff(ytracks)))/(stru.nods-1);
+-dist_av=sqrt(av_x^2+av_y^2);
+-
+-%Calculate the multiplicate factor for the new values:
+-if nargin==7,
+-	mult=round((x_m1(2)-x_m1(1))/(1*dist_av));
+-else
+-	mult=varargin{1};
+-end
+-
+-%Plug the values in the new multiplied matrix
+-values=zeros(mult*size(values1,1),mult*size(values1,2));
+-
+-for i=1:mult,
+-	for j=1:mult,
+-		values(i:mult:end,j:mult:end)=values1;
+-	end
+-end
+-
+-%Create the new x and y addapted to the matrix
+-x_m2=linspace(x_m1(1),x_m1(end),mult*(size(x_m1,1)-1)+1)';
+-y_m2=linspace(y_m1(1),y_m1(end),mult*(size(y_m1,1)-1)+1)';
+-
+-%Create a new set of x and y correponding to the medium value on the matrix
+-x_med=(x_m2(1:end-1)+x_m2(2:end))/2;
+-y_med=(y_m2(1:end-1)+y_m2(2:end))/2;
+-
+-numrow=size(y_med,1);
+-numcol=size(x_med,1);
+-
+-%Create new x and y to have the hole matrix
+-x_mat=repmat(x_med',numrow,1);
+-y_mat=repmat(y_med,1,numcol);
+-
+-%Remove useless points of the track
+-points=find(track_values==0);
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-points=find(isnan(track_values));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-%Remove points outside of the map
+-points=find(xtracks<x_med(1) | xtracks>x_med(end) | ytracks<y_med(1) | ytracks>y_med(end));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-%initialize some matrices
+-numoverlap=zeros(numrow,numcol);
+-weights=zeros(numrow,numcol);
+-weightsvalues=zeros(numrow,numcol);
+-
+-%Loop over the points of the track
+-nel=size(track_values,1);
+-fprintf('%s','      track processing progress:   0.00 %');
+-for i=1:nel;
+-	if mod(i,1000)==0,
+-		fprintf('\b\b\b\b\b\b\b')
+-		fprintf('%5.2f%s',i/nel*100,' %');
+-	end
+-
+-	x=xtracks(i);
+-	y=ytracks(i);
+-
+-	%get indices that are modified
+-	indexx1=max(find(x_med<x-distance));
+-	if isempty( indexx1), indexx1=1; end
+-	indexx2=min(find(x_med>x+distance));
+-	if isempty( indexx2), indexx2=numrow; end
+-	indexy1=max(find(y_med<y-distance));
+-	if isempty( indexy1), indexy1=1; end
+-	indexy2=min(find(y_med>y+distance));
+-	if isempty( indexy2), indexy2=numcol; end
+-
+-
+-	%get weighing coefficient
+-	val=track_values(i);
+-	distances=sqrt((x-x_mat(indexy1:indexy2,indexx1:indexx2)).^2+(y-y_mat(indexy1:indexy2,indexx1:indexx2)).^2);
+-	coeff=min(1,(distances/distance)).^(1/exponent);
+-
+-	%update numoverlap and weights
+-	numoverlap(indexy1:indexy2,indexx1:indexx2)=numoverlap(indexy1:indexy2,indexx1:indexx2)+1;
+-	weights(indexy1:indexy2,indexx1:indexx2)=weights(indexy1:indexy2,indexx1:indexx2)+coeff;
+-	weightsvalues(indexy1:indexy2,indexx1:indexx2)=weightsvalues(indexy1:indexy2,indexx1:indexx2)+(1-coeff)*val;
+-
+-end
+-if nel>1000,
+-	fprintf('\b\b\b\b\b\b\b\b')
+-	fprintf('%4.2f%s\n',100,' %');
+-end
+-
+-
+-%Change the values of numoverlap to 1 if 0 since we are going to devide by this matrix
+-numoverlap(find(~numoverlap))=1;
+-
+-%Same thing for weights since values far from the tracks don't change
+-weights(find(~weights))=1;
+-
+-%Create the final matrix depending on the previous matrix
+-values=(values.*weights+weightsvalues)./numoverlap;
+-
+-%Plug the values of the track in the new matrix
+-values2=values;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/TracksToMatrix.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/TracksToMatrix.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/TracksToMatrix.m	(revision 12997)
+@@ -1,84 +0,0 @@
+-function [x_f y_f MatData]=TracksToMatrix(xmin,ymin,nx,ny,posting,track_coord,track_values,theta,varargin),
+-%TRACKSTOMATRIX - Create a map from tracks
+-%
+-%   This routine creates a map from tracks using a Kriging algorithm given by the package DACE.
+-%   - xmin and ymin are two scalars that are the extreme values of the data matrix one wants to create
+-%   - posting is a scalar giving the posting of the matrix to be created in meters
+-%   - trac_coord is an Argus file containing the coordinates of the tracks (x and y)
+-%   - trav_values is a vector with the values along the track coordinates
+-%   - theta is a parameter of the correlation function stricly positive
+-%   varagin can contain a matrix of data to constrain the matrix to be created
+-%   it shoud contain indices x and y and the matrix
+-%
+-%   Usage:
+-%      [x_ y_f MatData]=TracksToMatrix(xmin,ymin,nx,ny,posting,track_coord,track_values,theta),
+-%
+-%   Example:
+-%      [x_f y_f Thickness]=TracksToMatrix(-10^6,10^6,200,180,1000,'trackcoord.exp',thickness_values,theta),
+-%      [x_f y_f Thickness]=TracksToMatrix(-10^6,10^6,200,180,1000,'trackcoord.exp',thickness_values,theta,x_m,y_m,globalthickness),
+-%
+-%   See also: CREATEDATABOUNDARIES, CREATEDATAMATRIX
+-
+-%some checks
+-if nargin~=8 & nargin~=11,
+-	error(' TracksToMatrix error message: wrong number of arguments')
+-end
+-
+-%Add path to dace
+-addpath([issmdir() '/externalpackages/dace/install'])
+-
+-%First create the x_m and y_m fot the matrix
+-x_f=[xmin:posting:xmin+posting*nx]';
+-y_f=[ymin:posting:ymin+posting*ny]';
+-
+-%Now create a bigger map we will then truncate
+-x_m=[xmin-posting*nx/2:posting:xmin+posting*nx*3/2]';
+-y_m=[ymin-posting*ny/2:posting:ymin+posting*ny*3/2]';
+-
+-%Create DataMatrix with local averaging of tracks
+-[Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values);
+-
+-%Create vector for these coordinates and values
+-Svalue=sparse(Mvalue);
+-Sx=sparse(Mx);
+-Sy=sparse(My);
+-[i,j,Values]=find(Svalue);
+-[i,j,X]=find(Sx);
+-[i,j,Y]=find(Sy);
+-Coord=[X,Y];
+-
+-%Create boundaries for the track if specified
+-if nargin==11,
+-	disp('      constain the border of matrix with global matrix');
+-	%Find out the elements to counstrain the border
+-	x_matrix=varargin{1};
+-	y_matrix=varargin{2};
+-	datamatrix=varargin{3};
+-
+-	%Create values on the border of the smaller map
+-	[Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
+-
+-	%Create values on the border of the larger map
+-	[Xedge2,Yedge2,EdgeValues2]=CreateDataBoundaries(x_f,y_f,x_matrix,y_matrix,datamatrix);
+-
+-	%Add these values to the track values
+-	Values=[Values;EdgeValues;EdgeValues2];
+-	Coord=[X,Y;Xedge,Yedge;Xedge2,Yedge2];
+-end
+-
+-%Create model for data
+-disp('      create the statiscal model of the data');
+-[dmodel,perf]=dacefit(Coord,Values,@regpoly1,@corrgauss,theta);
+-
+-%Create design site(points where we are looking for the data)
+-Points=nodesamp([x_f(1)+posting/2,y_f(1)+posting/2;x_f(end)-posting/2,y_f(end)-posting/2],[length(x_f)-1;length(y_f)-1]);
+-
+-%Compute data on these points
+-disp('      predict the values');
+-VecData=predictor(Points,dmodel);
+-
+-%Reshape to get a matrix
+-MatData=reshape(VecData,ny,nx);
+-
+-%remove DACE path
+-rmpath([issmdir() '/externalpackages/dace/install']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gslib.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gslib.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/gslib.m	(revision 12997)
+@@ -1,112 +0,0 @@
+-function output = gslib(x,y,data,varargin);
+-%GSLIB - use gslib for Kriging
+-%
+-%   Usage:
+-%      output = gslib(x,y,data,varargin)
+-
+-%Output Matrix
+-xmin   = xl(1);
+-ymin   = yl(1);
+-nx     = 101;
+-ny     = 101;
+-deltax = 5000;
+-deltay = 5000;
+-
+-%Variogram
+-nugget=10;
+-sill  =164;
+-range =25763;
+-
+-%Kriging options
+-mindata = 1;
+-maxdata = 50;
+-maxsearchradius = 50000;
+-
+-%Some intermediaries (Convert to gslib's parameters);
+-c = (sill-nugget);
+-a = sqrt(3)*range;
+-
+-%Write data file
+-fid=fopen('cluster.dat','w');
+-fprintf(fid,'%s\n','Data file');
+-fprintf(fid,'%i\n',3);
+-fprintf(fid,'%s\n','Xlocation');
+-fprintf(fid,'%s\n','Ylocation');
+-fprintf(fid,'%s\n','Data');
+-fprintf(fid,'%g %g %g\n',[x y data]');
+-fclose(fid);
+-
+-if 0, %GAMV
+-	%Write parameter file
+-	fid=fopen('gamv.par','w');
+-	fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
+-	fprintf(fid,'\t\t\t\t%s\n','*******************');
+-	fprintf(fid,'\n');
+-	fprintf(fid,'%s\n','START OF PARAMETERS:');
+-	fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
+-	fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
+-	fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
+-	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
+-	fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
+-	fprintf(fid,'%-30s %s\n','20'                         ,'\number of lags');
+-	fprintf(fid,'%-30s %s\n','5.0'                        ,'\lag separation distance');
+-	fprintf(fid,'%-30s %s\n','3.0'                        ,'\lag tolerance');
+-	fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
+-	fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
+-	fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-	fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-	fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
+-	fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
+-	fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
+-	fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
+-	fclose(fid);
+-
+-	%Call gamv
+-	system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
+-
+-else, %Kriging KB2D
+-	%Write parameter file
+-	fid=fopen('kb2d.par','w');
+-	fprintf(fid,'\t\t\t\t%s\n','Parameters for KB2D');
+-	fprintf(fid,'\t\t\t\t%s\n','*******************');
+-	fprintf(fid,'\n');
+-	fprintf(fid,'%s\n','START OF PARAMETERS:');
+-	fprintf(fid,'%-30s %s\n','./cluster.dat'                  ,'\file with data');
+-	fprintf(fid,'%-30s %s\n','1 2 3'                          ,'\columns for X, Y and variable');
+-	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'                 ,'\trimming limits');
+-	fprintf(fid,'%-30s %s\n','0'                              ,'\debugging level: 0,1,2,3');
+-	fprintf(fid,'%-30s %s\n','kb2d.dbg'                       ,'\file for debuggging output');
+-	fprintf(fid,'%-30s %s\n','kb2d.out'                       ,'\file for kriged output');
+-	fprintf(fid,'%-30s %s\n',num2str([nx xmin deltax],'%i %10g %6g')  ,'\nx, xmn, xsiz');
+-	fprintf(fid,'%-30s %s\n',num2str([ny ymin deltay],'%i %10g %6g')  ,'\nx, xmn, xsiz');
+-	fprintf(fid,'%-30s %s\n','1 1'                            ,'\x and y block discretization');
+-	fprintf(fid,'%-30s %s\n',num2str([mindata maxdata],'%6g') ,'\min and max data for kriging');
+-	fprintf(fid,'%-30s %s\n',num2str(maxsearchradius,'%6g')   ,'\max search radius');
+-	fprintf(fid,'%-30s %s\n','1 2.302'                        ,'\0=SK, 1=OK, (mean if SK)');
+-	fprintf(fid,'%-30s %s\n',['1 ' num2str(nugget)]           ,'\nst, nugget effect');
+-	fprintf(fid,'%-30s %s\n',['3 ' num2str([c 0.0 a a],'%10g')],'\it, c, azm, a_max, a_min');
+-	fclose(fid);
+-
+-	tic;system([issmdir() '/externalpackages/gslib/install/kb2d kb2d.par']);toc;
+-	delete('kb2d.par');
+-
+-	%Read output
+-	fid=fopen('kb2d.out','r');
+-	while (~feof(fid)),
+-		A=fscanf(fid,'%s',1);
+-		if strcmp(A,'KB2D');
+-			A=fscanf(fid,'%s',1); %Read output
+-			params=fscanf(fid,'%i %i %i %i %g %g %g %g %g %g %1',[11 1]);
+-		elseif strcmp(A,' Estimate'),
+-			continue;
+-		elseif strcmp(A,'Estimation'),
+-			A=fscanf(fid,'%s',1); %Read Variance
+-			A=fscanf(fid,'%g %g',[params(1) params(2)*params(3)]);
+-			B=A(1,:); B=reshape(B,[params(3),params(2)])';
+-			E=A(2,:); E=reshape(E,[params(3),params(2)])';
+-		else
+-			%do nothing
+-		end
+-	end
+-	fclose(fid);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataMatrix.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataMatrix.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/CreateDataMatrix.m	(revision 12997)
+@@ -1,94 +0,0 @@
+-function [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values),
+-%CREATEDATAMATRIX - Create a map with average values of map 
+-%
+-%   This routine creates a map with average values of tracks.
+-%   x_m1 and y_m1 are two vectors containing the coordinates of the matrix
+-%   trac_coord is an exp file containing the coordinates of the tracks (x and y)
+-%   trav_values is a vector with the values along the track coordinates
+-%
+-%   Usage:
+-%      [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values),
+-%
+-%   Example:
+-%      [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,'trackcoord.exp',thickness_track)
+-%
+-%   See also: CREATEDATABOUNDARIES, TRACKSTOMATRIX
+-
+-%Read the points of the tracks
+-stru=expread(track_coord,1);
+-nods=stru.nods;
+-xtracks=stru.x';
+-ytracks=stru.y';
+-
+-%First check that the parameters are ok:
+-if (size(track_values,1)~=nods)  || (size(xtracks,2)~=nods) || (size(ytracks,2)~=nods),
+-	error('CreateDataMatrix error message : track coordinates and track values must have the same size');
+-end
+-
+-%Compute number of rows and columns
+-numrow=size(y_m,1)-1;
+-numcol=size(x_m,1)-1;
+-
+-%Remove useless points of the track
+-points=find(track_values==0);
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-points=find(isnan(track_values));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-points=find(track_values<0);
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-points=find(xtracks<x_m(1) | xtracks>x_m(end) | ytracks<y_m(1) | ytracks>y_m(end));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-%initialize some matrices
+-numpoints=zeros(numrow,numcol);
+-value=zeros(numrow,numcol);
+-coordx=zeros(numrow,numcol);
+-coordy=zeros(numrow,numcol);
+-
+-%Loop over the points of the track
+-nel=size(track_values,1);
+-fprintf('%s','      track processing progress:   0.00 %');
+-for i=1:nel;
+-	if mod(i,1000)==0,
+-		fprintf('\b\b\b\b\b\b\b')
+-		fprintf('%5.2f%s',i/nel*100,' %');
+-	end
+-
+-	x=xtracks(i);
+-	y=ytracks(i);
+-
+-	%get indices for the matrix
+-	indexx=max(find(x_m<x));
+-	indexy=max(find(y_m<y));
+-
+-	%get weighing coefficient
+-	val=track_values(i);
+-
+-	%update numoverlap and weights
+-	numpoints(indexy,indexx)=numpoints(indexy,indexx)+1;
+-	value(indexy,indexx)=value(indexy,indexx)+val;
+-	coordx(indexy,indexx)=coordx(indexy,indexx)+x;
+-	coordy(indexy,indexx)=coordy(indexy,indexx)+y;
+-
+-end
+-if nel>1000,
+-	fprintf('\b\b\b\b\b\b\b\b')
+-	fprintf('%4.2f%s\n',100,' %');
+-end
+-
+-%Change the values of numoverlap to 1 if 0 since we are going to devide by this matrix
+-numpoints(find(~numpoints))=1;
+-
+-%Create the center of mass for coordiantes and values.
+-Mvalue=value./numpoints;
+-Mx=coordx./numpoints;
+-My=coordy./numpoints;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/DataProcessing/data_processing_tool.m	(revision 12997)
+@@ -1,467 +0,0 @@
+-function varargout = data_processing_tool(varargin)
+-%DATA_PROCESSING_TOOL - GUI to process binary data
+-%
+-%   this routine is a GUI that helps the user to open
+-%   a binary file (Little Endian, Big Endian, Float 32,
+-%   double,...) and save a Matlab file (.mat) with the
+-%   processed data and the coordinates
+-%
+-%   Usage:
+-%      data_processing_tool
+-
+-	gui_Singleton = 1;
+-	gui_State = struct('gui_Name',       mfilename, ...
+-		'gui_Singleton',  gui_Singleton, ...
+-		'gui_OpeningFcn', @data_processing_tool_OpeningFcn, ...
+-		'gui_OutputFcn',  @data_processing_tool_OutputFcn, ...
+-		'gui_LayoutFcn',  [] , ...
+-		'gui_Callback',   []);
+-	if nargin && ischar(varargin{1})
+-		gui_State.gui_Callback = str2func(varargin{1});
+-	end
+-
+-	if nargout
+-		[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
+-	else
+-		gui_mainfcn(gui_State, varargin{:});
+-	end
+-end
+-
+-function data_processing_tool_OpeningFcn(hObject, eventdata, handles, varargin)
+-	handles.output = hObject;
+-
+-	%enable toolbar (useful for caxis...)
+-	set(hObject,'toolbar','figure');
+-
+-	% Update handles structure
+-	guidata(hObject, handles);
+-
+-	%this variable used to prevent users from breaking the GUI
+-	%the variable is set to 1 once the data has been processed
+-	handles.processDataCompleted=0;
+-
+-	%initialize other variables
+-	handles.Msize=NaN;
+-	handles.Nsize=NaN;
+-	handles.numvectors=NaN;
+-	handles.endian=NaN;
+-	handles.datatype=NaN;
+-	handles.dx=NaN;
+-	handles.dy=NaN;
+-	handles.xEast=NaN;
+-	handles.yNorth=NaN;
+-
+-	%two files permitted
+-	set(handles.inputFile,'Max',1);
+-	set(handles.inputFile,'Min',0);
+-
+-	% Update handles structure
+-	guidata(hObject, handles);
+-end
+-
+-% --- Outputs from this function are returned to the command line.
+-function varargout = data_processing_tool_OutputFcn(hObject, eventdata, handles) 
+-
+-	% Get default command line output from handles structure
+-	varargout{1} = handles.output;
+-end
+-
+-
+-function inputFile_Callback(hObject, eventdata, handles)
+-%no code needed for this callback, the listbox is only used as a visual
+-end
+-
+-function addFiles_pushbutton_Callback(hObject, eventdata, handles)
+-	%gets input file(s) from user. the sample data files have extension .s2p
+-	[input_file,pathname] = uigetfile( ...
+-		{'*.*', 'All Files (*.*)'}, ...
+-		'Select files', ... 
+-		'MultiSelect', 'on');
+-
+-	%if file selection is cancelled, pathname should be zero
+-	%and nothing should happen
+-	if pathname==0
+-		return
+-	end
+-
+-	handles.processDataCompleted=1;
+-
+-	%gets the current data file names inside the listbox
+-	inputFileName=get(handles.inputFile,'String');
+-
+-	%if they only select one file, then the data will not be a cell
+-	inputFileName= fullfile(pathname,input_file);
+-
+-	%updates the gui to display all filenames in the listbox
+-	set(handles.inputFile,'String',inputFileName);
+-
+-	%make sure first file is always selected so it doesn't go out of range
+-	%the GUI will break if this value is out of range
+-	set(handles.inputFile,'Value',1);
+-
+-	% Update handles structure
+-	guidata(hObject, handles);
+-end
+-
+-function reset_pushbutton_Callback(hObject, eventdata, handles)
+-	%resets the GUI by clearing all relevant fields
+-
+-	handles.processDataCompleted = 0;
+-
+-	%clears the axes
+-	cla(handles.axes1,'reset');
+-
+-	%set the popupmenu to default value
+-%	set(handles.plot_popupmenu,'Value',1);
+-
+-	%clears the contents of the listbox
+-	set(handles.inputFile,'String','');
+-	set(handles.inputFile,'Value',0);
+-
+-	%updates the handles structure
+-	guidata(hObject, handles);
+-end
+-
+-function plotdata_pushbutton_Callback(hObject, eventdata, handles)
+-
+-	%get the list of input file names from the listbox
+-	inputFileName=get(handles.inputFile,'String');
+-
+-	%checks to see if the user selected any input files
+-	%if not, nothing happens
+-	if isempty(inputFileName)
+-		errordlg('Select a file first!')
+-		return
+-	end
+-
+-	%disables the button while data is processing
+-	disableButtons(handles);
+-	refresh(data_processing_tool); 
+-
+-	%parse options
+-	if ~isnan(handles.Msize)
+-		M=handles.Msize;
+-	else
+-		errordlg('Number of lines (M) not valid')
+-		return
+-	end
+-	if ~isnan(handles.Nsize)
+-		N=handles.Nsize;
+-	else
+-		errordlg('Number of rows (N) not valid')
+-		return
+-	end
+-	if ~isnan(handles.numvectors)
+-		numvectors=handles.numvectors;
+-		%change M
+-		M=numvectors*M;
+-	else
+-		numvectors=1;
+-	end
+-	if ~isnan(handles.endian)
+-		endian=handles.endian;
+-	else
+-		endian=1;
+-	end
+-	if ~isnan(handles.datatype)
+-		datatype=handles.datatype;
+-	else
+-		datatype='float32';
+-	end
+-
+-	%open file
+-	if endian==1
+-		fid=fopen(inputFileName,'r','ieee-be');
+-	else
+-		fid=fopen(inputFileName,'r','ieee-le');
+-	end
+-
+-	%read file
+-	[u, numpoints]=fread(fid, [M,N],datatype);
+-
+-	%close file
+-	fclose(fid);
+-
+-	%Pair of vectors?
+-	if numvectors==2,
+-	   vx=u(1:2:M,:);vx=flipud(vx');
+-	   vy=u(2:2:M,:);vx=flipud(vx');
+-
+-		%keep track
+-		handles.vx=vx;
+-		handles.vy=vy;
+-
+-		u=sqrt(vx.^2+vy.^2);
+-	end
+-
+-	cla(handles.axes1); %clear the axes
+-	axes(handles.axes1); %set the axes to plot
+-	grid on
+-	imagesc(u)
+-	colorbar
+-
+-	%keep track
+-	handles.u=u;
+-
+-	%to see whether the data has been processed or not
+-	handles.processDataCompleted=2;
+-
+-	%data is done processing, so re-enable the buttons
+-	enableButtons(handles);
+-	guidata(hObject, handles);
+-end
+-
+-function plotcoord_Callback(hObject, eventdata, handles)
+-
+-	%check
+-	if handles.processDataCompleted<2
+-		errordlg('Process data first !')
+-		return
+-	end
+-
+-	%parse options
+-	if ~isnan(handles.dx)
+-		dx=handles.dx;
+-	else
+-		errordlg('value of x-spacing not supported')
+-		return
+-	end
+-	if ~isnan(handles.dy)
+-		dy=handles.dy;
+-	else
+-		errordlg('value of y-spacing not supported')
+-		return
+-	end
+-	if ~isnan(handles.xEast)
+-		xEast=handles.xEast;
+-	else
+-		errordlg('value of xEast not supported')
+-		return
+-	end
+-	if ~isnan(handles.yNorth)
+-		yNorth=handles.yNorth;
+-	else
+-		errordlg('value of yNorth not supported')
+-		return
+-	end
+-
+-	disableButtons(handles);
+-
+-	%process coordinates
+-	u=handles.u;
+-	s=size(u);
+-	M=s(1)+1;
+-	N=s(2)+1;
+-
+-	%correction North and East -> real
+-	yNorth=yNorth-M*dy; % corner north
+-	x_m=xEast+dx*(0:N-1)';
+-	y_m=yNorth+dy*(0:M-1)';
+-
+-	%plot new axes
+-	cla(handles.axes1); %clear the axes
+-	axes(handles.axes1); %set the axes to plot
+-	grid on
+-	imagesc(x_m,y_m,handles.u)
+-	set(handles.axes1,'Ydir','Normal');
+-	colorbar
+-
+-	%Keep track of x_m and y_m
+-	handles.x_m=x_m;
+-	handles.y_m=y_m;
+-
+-	%to see whether the data has been processed or not
+-	handles.processDataCompleted=3;
+-
+-	%data is done processing, so re-enable the buttons
+-	enableButtons(handles);
+-	guidata(hObject, handles);
+-
+-end
+-
+-
+-function save_pushbutton_Callback(hObject, eventdata, handles)
+-	%if the data hasn't been processed yet, 
+-	%nothing happens when this button is pressed
+-	if (handles.processDataCompleted ~= 3)
+-		return
+-	end
+-
+-	disableButtons(handles);
+-
+-	if handles.numvectors==2,
+-
+-		prompt={'Enter the name of the variable 1:','Enter the name of the variable 2:','Enter the name of the file:'};
+-		name='Save Matlab File';
+-		numlines=1;
+-		defaultanswer={'vx','vy','ProcessedFile'};
+-		answer=inputdlg(prompt,name,numlines,defaultanswer);
+-		variablename1=answer{1};
+-		variablename2=answer{2};
+-		filename=answer{3};
+-
+-		if ~isempty(variablename1) & ~isempty(variablename2) & ~isempty(filename)
+-			%get the variables
+-			x_m=handles.x_m;
+-			y_m=handles.y_m;
+-			eval([variablename1 ' = handles.vx;']);
+-			eval([variablename2 ' = handles.vy;']);
+-			x_m=handles.x_m;
+-			eval(['save ' filename ' x_m y_m ' variablename1 ' ' variablename2 ]);
+-			disp(['in the file ' filename ' have been saved the following variables: x_m, y_m, ' variablename1 ' and ' variablename2])
+-		end
+-	else
+-		prompt={'Enter the name of the variable:','Enter the name of the file:'};
+-		name='Save Matlab File';
+-		numlines=1;
+-		defaultanswer={'thickness','ProcessedFile'};
+-		answer=inputdlg(prompt,name,numlines,defaultanswer);
+-		variablename=answer{1};
+-		filename=answer{2};
+-
+-		if ~isempty(variablename) & ~isempty(filename)
+-			%get the variables
+-			x_m=handles.x_m;
+-			y_m=handles.y_m;
+-			eval([variablename ' = handles.u;']);
+-			eval(['save ' filename ' x_m y_m ' variablename]);
+-			disp(['in the file ' filename ' have been saved the following variables: x_m, y_m, and ' variablename])
+-		end
+-	end
+-	enableButtons(handles);
+-	guidata(hObject, handles);
+-end
+-
+-function inputFile_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function disableButtons(handles)
+-	set(handles.figure1,'Pointer','watch');
+-	set(handles.plotdata_pushbutton,'Enable','off');
+-	set(handles.plotcoord,'Enable','off');
+-	set(handles.save_pushbutton,'Enable','off');
+-	set(handles.addFiles_pushbutton,'Enable','off');
+-	set(handles.reset_pushbutton,'Enable','off');
+-end
+-
+-function enableButtons(handles)
+-	set(handles.figure1,'Pointer','arrow');
+-	set(handles.plotdata_pushbutton,'Enable','on');
+-	set(handles.plotcoord,'Enable','on');
+-	set(handles.save_pushbutton,'Enable','on');
+-	set(handles.addFiles_pushbutton,'Enable','on');
+-	set(handles.reset_pushbutton,'Enable','on');
+-end
+-
+-function EndianType_Callback(hObject, eventdata, handles)
+-	handles.endian=get(handles.EndianType,'Value');
+-	guidata(hObject, handles);
+-end
+-
+-function EndianType_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function DataType_Callback(hObject, eventdata, handles)
+-
+-	datatype= get(handles.DataType,'Value');
+-	switch datatype
+-		case 1
+-			string='float32';
+-
+-		case 2
+-			string='single';
+-
+-		case 3
+-			string='float64';
+-
+-		case 4
+-			string='double';
+-		end
+-	handles.datatype=string;
+-	guidata(hObject, handles);
+-end
+-
+-function DataType_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function PairOfVectors_Callback(hObject, eventdata, handles)
+-	handles.numvectors = get(handles.PairOfVectors,'Value');
+-	guidata(hObject, handles);
+-end
+-
+-function PairOfVectors_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function Msize_Callback(hObject, eventdata, handles)
+-	handles.Msize=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-
+-function Msize_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function Nsize_Callback(hObject, eventdata, handles)
+-	handles.Nsize=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-
+-function Nsize_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function dx_Callback(hObject, eventdata, handles)
+-	handles.dx=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function dx_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function dy_Callback(hObject, eventdata, handles)
+-	handles.dy=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function dy_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function xEast_Callback(hObject, eventdata, handles)
+-	handles.xEast=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function xEast_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function yNorth_Callback(hObject, eventdata, handles)
+-	handles.yNorth=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function yNorth_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddeblank.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddeblank.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddeblank.m	(revision 12997)
+@@ -1,29 +0,0 @@
+-function sout = ddeblank(s)
+-%DDEBLANK Double deblank. Strip both leading and trailing blanks.
+-%
+-%   DDEBLANK(S) removes leading and trailing blanks and null characters from
+-%   the string S.  A null character is one that has a value of 0.
+-%
+-%   See also DEBLANK, DEWHITE, DDEWHITE.
+-
+-%   Author:      Peter J. Acklam
+-%   Time-stamp:  2003-10-13 11:13:07 +0200
+-%   E-mail:      pjacklam@online.no
+-%   URL:         http://home.online.no/~pjacklam
+-
+-   error(nargchk(1, 1, nargin));
+-   if ~ischar(s)
+-      warning('Input must be a string (char array).');
+-   end
+-
+-   if isempty(s)
+-      sout = s;
+-      return;
+-   end
+-
+-   [r, c] = find( (s ~= ' ') & (s ~= 0) );
+-   if size(s, 1) == 1
+-      sout = s(min(c) : max(c));
+-   else
+-      sout = s(:, min(c) : max(c));
+-   end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit.m	(revision 12997)
+@@ -1,91 +0,0 @@
+-function splittedstring = strsplit(inpstr,delimiter)
+-%STRSPLIT - split a tring of delimiter separated values
+-%
+-%   This function should be used to split a string of delimiter separated
+-%   values.  If all values are numerical values the returned matrix is a
+-%   double array but if there is one non numerical value a cell array is
+-%   returned.  You can check this with the iscell() function.
+-%   inpstr: string containing delimiter separatede numerical values, eg
+-%           3498,48869,23908,34.67
+-%   Output: An x by 1 matrix containing the splitted values
+-%   Delimiter: optional, if omitted the delimiter is , (comma)
+-%
+-%   Usage:
+-%      output = strsplit(inpstr[,delimiter])
+-%
+-
+-%   mailto:    gie.spaepen@ua.ac.be
+-
+-
+-
+-%Check input arguments
+-if(nargin < 1)
+-    error('There is no argument defined');
+-else
+-    if(nargin == 1)
+-        strdelim = ',';
+-        %Verbose off!! disp 'Delimiter set to ,';
+-    else
+-        strdelim = delimiter;
+-    end
+-end
+-
+-%deblank string
+-deblank(inpstr);
+-
+-%Get number of substrings
+-idx  = findstr(inpstr,strdelim);
+-if size(idx) == 0
+-    disp 'No delimiter in string, inputString is returned';
+-    splittedstring = inpstr;
+-else
+-    %Define size of the indices
+-    sz = size(idx,2);
+-    %Define splittedstring
+-    tempsplit = {};
+-    %Loop through string and itinerate from delimiter to delimiter
+-    for i = 1:sz
+-        %Define standard start and stop positions for the start position,
+-        %choose 1 as startup position because otherwise you get an array
+-        %overflow, for the endposition you can detemine it from the
+-        %delimiter position
+-        strtpos = 1;
+-        endpos = idx(i)-1;
+-        %If i is not the beginning of the string get it from the delimiter
+-        %position
+-        if i ~= 1
+-            strtpos = idx(i-1)+1;
+-        end
+-        %If i is equal to the number of delimiters get the last element
+-        %first by determining the lengt of the string and then replace the
+-        %endpos back to a standard position
+-        if i == sz
+-            endpos = size(inpstr,2); 
+-            tempsplit(i+1) = {inpstr(idx(i)+1 : endpos)};
+-            endpos = idx(i)-1;
+-        end
+-        %Add substring to output: splittedstring a cell array
+-        tempsplit(i) = {inpstr(strtpos : endpos)};   
+-    end
+-    %Flag 
+-    isallnums = 1;
+-    %Check is there are NaN values if matrix elements are converted to
+-    %doubles
+-    for i = 1:size(tempsplit,2)
+-        tempdouble = str2double(tempsplit(i));
+-        if(isnan(tempdouble))
+-            isallnums = 0;
+-        end
+-    end
+-    %If isallnums = 1 then return a double array otherwise return a cell
+-    %array
+-    if(isallnums == 1)
+-        for i = 1:size(tempsplit,2)
+-            splittedstring(i) = str2double(tempsplit(i));
+-        end
+-    else
+-        splittedstring = tempsplit;
+-    end
+-    
+-        
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/dewhite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/dewhite.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/dewhite.m	(revision 12997)
+@@ -1,30 +0,0 @@
+-function sout = dewhite(s)
+-%DEWHITE Dewhite. Strip trailing whitespace.
+-%
+-%   DEWHITE(S) removes leading and trailing white space and any null characters
+-%   from the string S.  A null character is one that has an absolute value of
+-%   0.
+-%
+-%   See also DDEWHITE, DEBLANK, DDEBLANK.
+-
+-%   Author:      Peter J. Acklam
+-%   Time-stamp:  2003-10-13 11:12:52 +0200
+-%   E-mail:      pjacklam@online.no
+-%   URL:         http://home.online.no/~pjacklam
+-
+-   error(nargchk(1, 1, nargin));
+-   if ~ischar(s)
+-      error( 'Input must be a string (char array).' );
+-   end
+-
+-   if isempty(s)
+-      sout = s;
+-      return;
+-   end
+-
+-   [r, c] = find(~isspace(s));
+-   if size(s, 1) == 1
+-      sout = s(1:max(c));
+-   else
+-      sout = s(:,1:max(c));
+-   end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/discardnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/discardnum.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/discardnum.m	(revision 12997)
+@@ -1,14 +0,0 @@
+-function string2=discardnum(string)
+-%DISCARDNUM -  ??????
+-%
+-%   Usage:
+-%      string2=discardnum(string)
+-
+-string2=string;
+-
+-for i=1:length(string),
+-	if (((string(i)-0) <=57) & ((string(i)-0) >=48)),
+-		string2=string(1:i-1);
+-		break;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ismemberi.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ismemberi.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ismemberi.m	(revision 12997)
+@@ -1,26 +0,0 @@
+-function flag=ismemberi(string,list),
+-%ISMEMBERI - return 1 if a string belongs to a list (case insensitive)
+-%
+-%   same function as Matlab's ismember except that it
+-%   is case insensitive
+-%
+-%   Usage:
+-%      flag=ismemberi(string,list);
+-%
+-%   Example:
+-%      flag=ismemberi('test','{'test1','test2','test3'});
+-
+-if ~iscell(list)
+-	error('ismemberi error message: the list of string must be a cell!')
+-end
+-
+-%initialize output
+-flag=0;
+-
+-%go through the list
+-for i=1:length(list),
+-	if strcmpi(string,list{i}),
+-		flag=i;
+-		return
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit_strict.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit_strict.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/strsplit_strict.m	(revision 12997)
+@@ -1,37 +0,0 @@
+-function splittedstring = strsplit(inpstr,delimiter)
+-%STRSPLIT - split a tring of delimiter separated values
+-%
+-%   Usage:
+-%      output = strsplit_strict(inpstr,delimiter)
+-
+-
+-%Check input arguments
+-if(nargin ~= 2)
+-    error('There is no argument defined');
+-end
+-
+-%deblank string
+-deblank(inpstr);
+-
+-%Get number of substrings
+-idx  = findstr(inpstr,delimiter);
+-if size(idx) == 0
+-    splittedstring = {inpstr};
+-else
+-    sz = size(idx,2);
+-    splittedstring = {};
+-    %Loop through string and itinerate from delimiter to delimiter
+-    for i = 1:sz
+-        strtpos = 1;
+-        endpos = idx(i)-1;
+-        if i ~= 1
+-            strtpos = idx(i-1)+1;
+-        end
+-        if i == sz
+-            endpos = size(inpstr,2); 
+-            splittedstring(i+1) = {inpstr(idx(i)+1 : endpos)};
+-            endpos = idx(i)-1;
+-        end
+-        splittedstring(i) = {inpstr(strtpos : endpos)};   
+-    end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddewhite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddewhite.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/ddewhite.m	(revision 12997)
+@@ -1,30 +0,0 @@
+-function sout = ddewhite(s)
+-%DDEWHITE Double dewhite. Strip both leading and trailing whitespace.
+-%
+-%   DDEWHITE(S) removes leading and trailing white space and any null
+-%   characters from the string S.  A null character is one that has an absolute
+-%   value of 0.
+-%
+-%   See also DEWHITE, DEBLANK, DDEBLANK.
+-
+-%   Author:      Peter J. Acklam
+-%   Time-stamp:  2003-10-13 11:12:57 +0200
+-%   E-mail:      pjacklam@online.no
+-%   URL:         http://home.online.no/~pjacklam
+-
+-   error(nargchk(1, 1, nargin));
+-   if ~ischar(s)
+-      error('Input must be a string (char array).');
+-   end
+-
+-   if isempty(s)
+-      sout = s;
+-      return;
+-   end
+-
+-   [r, c] = find(~isspace(s));
+-   if size(s, 1) == 1
+-      sout = s(min(c) : max(c));
+-   else
+-      sout = s(:, min(c) : max(c));
+-   end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/issmprintf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/issmprintf.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/issmprintf.m	(revision 12997)
+@@ -1,13 +0,0 @@
+-function issmprintf(flag,format,varargin)
+-%ISSMPRINTF -  display string in solution sequences. wrapper to disp and sprintf.  
+-%
+-%   Usage:
+-%      issmprintf(flag,format,string)
+-%      flag can be used to switch display on and off
+-%
+-%   Example:
+-%      issmprintf(1,'%s\n','string to display');
+-	
+-if flag,
+-	disp(sprintf(format,varargin{:}));
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/logoutput.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/logoutput.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/String/logoutput.m	(revision 12997)
+@@ -1,7 +0,0 @@
+-function logoutput(logstring,message)
+-%LOGOUTPUT - embed a log string into an error message, used in the nightly runs.
+-%
+-%   Usage:
+-%      logoutput(logstring,message)
+-
+-disp(sprintf('%s%s',logstring,message));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.py	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.py	(revision 12997)
+@@ -1,24 +0,0 @@
+-import platform
+-import os
+-from MatlabFuncs import *
+-
+-def issmdir():
+-	"""
+-	ISSMDIR - Get ISSM_DIR environment variable
+- 
+-	   Usage:
+-	      ISSM_DIR=issmdir()
+-	"""
+-
+-	if not 'Windows' in platform.system():
+-		ISSM_DIR =os.environ['ISSM_DIR']
+-	else:
+-		ISSM_DIR =os.environ['ISSM_DIR_WIN']
+-		if strcmpi(ISSM_DIR[-1],'/') or strcmpi(ISSM_DIR[-1],'\\'):
+-			ISSM_DIR = ISSM_DIR[:-1]    #shave off the last '/'
+-
+-	if not ISSM_DIR:
+-		raise RuntimeError("issmdir error message: 'ISSM_DIR' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!")
+-
+-	return ISSM_DIR
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/flaimdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/flaimdir.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/flaimdir.m	(revision 12997)
+@@ -1,7 +0,0 @@
+-function FLAIM_DIR=flaimdir()
+-%ISSMDIR - Get FLAIM installation directory
+-%
+-%   Usage:
+-%      FLAIM_DIR=flaimdir()
+-
+-FLAIM_DIR=[issmdir '/externalpackages/flaim/install'];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/ucisvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/ucisvn.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/ucisvn.m	(revision 12997)
+@@ -1,15 +0,0 @@
+-function UCI_SVN=ucisvn()
+-%ISSMDIR - Get UCI_SVN environment variable
+-%
+-%   Usage:
+-%      UCI_SVN=ucisvn()
+-
+-if ~ispc,
+-	UCI_SVN =getenv('UCI_SVN');
+-else
+-	UCI_SVN =getenv('UCI_SVN_WIN');
+-end
+-
+-if (isempty(UCI_SVN)),
+-	error('ucisvn error message: ''UCI_SVN'' environment variable is empty! You should define UCI_SVN in your .cshrc or .bashrc');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/issmdir.m	(revision 12997)
+@@ -1,18 +0,0 @@
+-function ISSM_DIR=issmdir()
+-%ISSMDIR - Get ISSM_DIR environment variable
+-%
+-%   Usage:
+-%      ISSM_DIR=issmdir()
+-
+-if ~ispc,
+-	ISSM_DIR =getenv('ISSM_DIR');
+-else
+-	ISSM_DIR =getenv('ISSM_DIR_WIN');
+-	if strcmpi(ISSM_DIR(end),'/') | strcmpi(ISSM_DIR(end),'\'),
+-		ISSM_DIR = ISSM_DIR(1:end-1); %shave off the last '/'
+-	end
+-end
+-
+-if (isempty(ISSM_DIR)),
+-	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/jplsvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/jplsvn.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Shell/jplsvn.m	(revision 12997)
+@@ -1,15 +0,0 @@
+-function JPL_SVN=jplsvn()
+-%ISSMDIR - Get JPL_SVN environment variable
+-%
+-%   Usage:
+-%      JPL_SVN=jplsvn()
+-
+-if ~ispc,
+-	JPL_SVN =getenv('JPL_SVN');
+-else
+-	JPL_SVN =getenv('JPL_SVN_WIN');
+-end
+-
+-if (isempty(JPL_SVN)),
+-	error('jplsvn error message: ''JPL_SVN'' environment variable is empty! You should define JPL_SVN in your .cshrc or .bashrc');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_class.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_class.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_class.m	(revision 12997)
+@@ -1,30 +0,0 @@
+-%
+-%  function to find the structural fields of a specified class
+-%  
+-%  [sclasso]=struc_class(sclass,cstr)
+-%
+-function [sclasso]=struc_class(sclass,cstr)
+-
+-%  collect only the objects of the appropriate class
+-
+-if     isa(sclass,cstr)
+-    if ~isempty(inputname(1))
+-        sclasso.(inputname(1))=sclass;
+-    else
+-        sclasso.(cstr)        =sclass;
+-    end
+-
+-elseif isstruct(sclass)
+-    fnames=fieldnames(sclass);
+-    for i=1:numel(fnames)
+-        if isa(sclass.(fnames{i}),cstr)
+-            sclasso.(fnames{i})=sclass.(fnames{i});
+-        end
+-    end
+-end
+-
+-if ~exist('sclasso','var')
+-    sclasso=struct([]);
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allempty.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allempty.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allempty.m	(revision 12997)
+@@ -1,22 +0,0 @@
+-%
+-%  function to return an empty cell array if all array elements are empty
+-%
+-%  function [cout]=allempty(cin)
+-%
+-function [cout]=allempty(cin)
+-
+-if ~nargin
+-    help allempty
+-    return
+-end
+-
+-for j=1:numel(cin)
+-    if ~isempty(cin{j})
+-        cout=cin;
+-        return
+-    end
+-end
+-cout={};
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_desc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_desc.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/struc_desc.m	(revision 12997)
+@@ -1,61 +0,0 @@
+-%
+-%  function to find the structures with the specified descriptors
+-%  
+-%  [sarrayo]=struc_desc(sarray,varargin)
+-%
+-function [sarrayo]=struc_desc(sarray,varargin)
+-
+-if ~isfield(sarray,'descriptor')
+-    if ~isempty(inputname(1))
+-        error('Field ''descriptor'' not found in array ''%s''.',inputname(1));
+-    else
+-        error('Field ''descriptor'' not found in array %d.',1);
+-    end
+-end
+-
+-sarrayo=struct([]);
+-
+-for iarg=1:nargin-1
+-    if     iscell(varargin{iarg})
+-        desc=        varargin{iarg};
+-    elseif ischar(varargin{iarg})
+-        desc=cellstr(varargin{iarg});
+-    end
+-    
+-    for i=1:length(desc)
+-        sarrayoi=struc_desci(sarray,desc{i});
+-        if ~isempty(sarrayoi)
+-            if isempty(sarrayo)
+-                sarrayo       =sarrayoi;
+-            else
+-                sarrayo(end+1)=sarrayoi;
+-            end
+-        end
+-    end
+-end
+-
+-%  if nothing found, return whole array
+-
+-if isempty(sarrayo)
+-    sarrayo=sarray;
+-end
+-
+-end
+-
+-%
+-%  function to find the structure with the specified descriptor
+-%  
+-function [sarrayo]=struc_desci(sarray,str)
+-
+-sarrayo=struct([]);
+-
+-for i=1:numel(sarray)
+-    if strcmp(sarray(i).descriptor,str)
+-        sarrayo=sarray(i);
+-        return
+-    end
+-end
+-
+-warning(['String ''' str ''' not found in array ''' inputname(1) '''.']);
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_dim.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_dim.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_dim.m	(revision 12997)
+@@ -1,72 +0,0 @@
+-%
+-%  function to return the string dimension of an array element
+-%
+-%  function [sdim]=string_dim(a,idim,varargin)
+-%
+-function [sdim]=string_dim(a,idim,varargin)
+-
+-if ~nargin
+-    help string_dim
+-    return
+-end
+-
+-%  check for scalar
+-
+-if (numel(a) == 1) && (idim == 1)
+-    sdim='';
+-    return
+-end
+-
+-%  check for overflow
+-
+-if (idim > numel(a))
+-    if ~isempty(inputname(1))
+-        error('Index %d exceeds number of elements in array ''%s''.',...
+-            idim,inputname(1));
+-    else
+-        error('Index %d exceeds number of elements in array %d.',...
+-            idim,1);
+-    end
+-end
+-
+-%  check for column or row vector (Matlab uses a minimum of two
+-%  dimensions, so this won't match Matlab standard output)
+-
+-for iarg=1:nargin-2
+-    if strcmpi(varargin{iarg},'vector')
+-        if (ndims(a) == 2) && ((size(a,1) == 1) || (size(a,2) == 1))
+-            sdim =['(' num2str(idim) ')'];
+-            return
+-        end
+-    end
+-end
+-
+-%  do the general case
+-
+-asize=size(a);
+-index=zeros(size(asize));
+-aprod=prod(asize);
+-idim =idim-1;
+-
+-%  calculate indices base 0 and convert to base 1
+-
+-%  note that ind2sub might be useful, except that it requires a list
+-%  of scalars rather than a vector for output.
+-
+-for i=length(asize):-1:1
+-    aprod=aprod/asize(i);
+-    index(i)=floor(idim/aprod);
+-    idim=idim-index(i)*aprod;
+-end
+-index=index+1;
+-
+-%  assemble string for output
+-
+-sdim ='(';
+-for i=1:length(asize)-1;
+-    sdim =[sdim num2str(index(i)) ','];
+-end
+-sdim =[sdim num2str(index(end)) ')'];
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allequal.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allequal.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allequal.m	(revision 12997)
+@@ -1,70 +0,0 @@
+-%
+-%  function to return an empty array if all array elements are
+-%  equal to the given value, which may also be empty but not nan.
+-%
+-%  (note that by definition, nan is not equal to nan.  this could
+-%  be changed by using isequalwithequalnans.)
+-%
+-%  function [aout]=allequal(ain,aval)
+-%
+-function [aout]=allequal(ain,aval)
+-
+-if ~nargin
+-    help allequal
+-    return
+-end
+-
+-aout=ain;
+-
+-if     islogical(ain) && islogical(aval)
+-    for i=1:numel(ain)
+-        if ~isequal(ain(i),aval)
+-            return
+-        end
+-    end
+-    aout=logical([]);
+-
+-elseif isnumeric(ain) && isnumeric(aval)
+-    for i=1:numel(ain)
+-        if ~isequal(ain(i),aval)
+-            return
+-        end
+-    end
+-    aout=[];
+-
+-elseif ischar(ain) && ischar(aval)
+-    for i=1:size(ain,1)
+-        if ~strcmp(ain(i,:),aval)
+-            return
+-        end
+-    end
+-    aout='';
+-
+-elseif iscell(ain)
+-    if     islogical(aval)
+-        for i=1:numel(ain)
+-            if ~islogical(ain{i}) || ~isequal(ain{i},aval)
+-                return
+-            end
+-        end
+-        aout={};
+-
+-    elseif isnumeric(aval)
+-        for i=1:numel(ain)
+-            if ~isnumeric(ain{i}) || ~isequal(ain{i},aval)
+-                return
+-            end
+-        end
+-        aout={};
+-
+-    elseif ischar(aval)
+-        for i=1:size(ain,1)
+-            if ~ischar(ain{i}) || ~strcmp(ain{i},aval)
+-                return
+-            end
+-        end
+-        aout={};
+-    end
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_size.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_size.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_size.m	(revision 12997)
+@@ -1,38 +0,0 @@
+-%
+-%  function to return the string size of an array
+-%
+-%  function [ssize]=string_size(a,varargin)
+-%
+-function [ssize]=string_size(a,varargin)
+-
+-if ~nargin
+-    help string_size
+-    return
+-end
+-
+-%  check for column or row vector (Matlab uses a minimum of two
+-%  dimensions, so this won't match Matlab standard output)
+-
+-for iarg=1:nargin-1
+-    if strcmpi(varargin{iarg},'vector')
+-        if (ndims(a) == 2) && ((size(a,1) == 1) || (size(a,2) == 1))
+-            ssize =['(' num2str(numel(a)) ')'];
+-            return
+-        end
+-    end
+-end
+-
+-%  do the general case
+-
+-asize=size(a);
+-
+-%  assemble string for output
+-
+-ssize ='(';
+-for i=1:length(asize)-1;
+-    ssize =[ssize num2str(asize(i)) 'x'];
+-end
+-ssize =[ssize num2str(asize(end)) ')'];
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/any2str.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/any2str.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/any2str.m	(revision 12997)
+@@ -1,22 +0,0 @@
+-%
+-%  function to convert anything to a string
+-%
+-%  function [svec]=any2str(a,alim)
+-%
+-function [svec]=any2str(a,alim)
+-
+-if ~exist('alim','var') || (numel(a) <= alim)
+-    if iscell(a)
+-        svec=string_cell(a);
+-    else
+-        if (numel(a) > 1) && ~ischar(a)
+-            svec=string_vec(a);
+-        else
+-            svec=item2str(a);
+-        end
+-    end
+-else
+-	svec=[string_size(a) ' ''' class(a) ''''];
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_vec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_vec.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_vec.m	(revision 12997)
+@@ -1,26 +0,0 @@
+-%
+-%  function to return the string of an vector
+-%
+-%  function [svec]=string_vec(a)
+-%
+-function [svec]=string_vec(a)
+-
+-if ~nargin
+-    help string_vec
+-    return
+-end
+-
+-if (numel(a) == 0)
+-    svec='[]';
+-    return
+-end
+-
+-%  assemble string for output
+-
+-svec ='[';
+-for i=1:numel(a)-1;
+-    svec=[svec item2str(a(i)) ' '];
+-end
+-svec=[svec item2str(a(end)) ']'];
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allnan.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allnan.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/allnan.m	(revision 12997)
+@@ -1,22 +0,0 @@
+-%
+-%  function to return an empty double array if all array elements are NaN
+-%
+-%  function [dout]=allnan(din)
+-%
+-function [dout]=allnan(din)
+-
+-if ~nargin
+-    help allnan
+-    return
+-end
+-
+-for i=1:numel(din)
+-    if ~isnan(din(i))
+-        dout=din;
+-        return
+-    end
+-end
+-dout=[];
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/str2int.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/str2int.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/str2int.m	(revision 12997)
+@@ -1,46 +0,0 @@
+-%
+-%  function to find and read the first or last positive integer
+-%  in a character string.
+-%
+-%  function [aint]=str2int(astr,cfl)
+-%
+-function [aint]=str2int(astr,cfl);
+-
+-aint=[];
+-
+-if     ~exist('cfl','var') || strncmpi(cfl,'f',1)
+-    i=1;
+-
+-    while (i <= length(astr))
+-        if (astr(i) >= '0' && astr(i) <= '9')
+-            aint=sscanf(astr(i:length(astr)),'%d',[1,1]);
+-            return
+-        else
+-            i=i+1;
+-        end
+-	end
+-
+-elseif strncmpi(cfl,'l',1)
+-    i=length(astr);
+-    ifound=false;
+-
+-    while (i >= 1)
+-        if     (astr(i) >= '0' && astr(i) <= '9')
+-            ifound=true;
+-            i=i-1;
+-        elseif ~ifound
+-            i=i-1;
+-        else
+-            aint=sscanf(astr(i+1:length(astr)),'%d',[1,1]);
+-            return
+-        end
+-	end
+-
+-    if ifound
+-        aint=sscanf(astr,'%d',[1,1]);
+-        return
+-    end
+-end
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_cell.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_cell.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/string_cell.m	(revision 12997)
+@@ -1,26 +0,0 @@
+-%
+-%  function to return the string of a cell array
+-%
+-%  function [svec]=string_cell(a)
+-%
+-function [svec]=string_cell(a)
+-
+-if ~nargin
+-    help string_cell
+-    return
+-end
+-
+-if (numel(a) == 0)
+-    svec='{}';
+-    return
+-end
+-
+-%  assemble string for output
+-
+-svec ='{';
+-for i=1:numel(a)-1;
+-    svec=[svec item2str(a{i}) ' '];
+-end
+-svec=[svec item2str(a{end}) '}'];
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/find_string.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/find_string.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/find_string.m	(revision 12997)
+@@ -1,18 +0,0 @@
+-%
+-%  function to find a string in a cell array
+-%  (could probably be replaced by matlab strmatch)
+-%  
+-%  [ifound]=find_string(cells,str)
+-%
+-function [ifound]=find_string(cells,str)
+-
+-ifound=false;
+-
+-for i=1:numel(cells)
+-    if ischar(cells{i}) && strcmp(cells{i},str)
+-        ifound=i;
+-        return
+-    end
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_size.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_size.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_size.m	(revision 12997)
+@@ -1,35 +0,0 @@
+-%
+-%  function to find an array size from a list of arrays.
+-%  
+-%  [asize]=array_size(varargin)
+-%
+-%  see array_numel to check only the number of elements, if
+-%  single indices will be used.
+-%
+-function [asize]=array_size(varargin)
+-
+-asize=[1 1];
+-
+-for iarg=1:nargin
+-    if ischar(varargin{iarg})
+-        isize=size(cellstr(varargin{iarg}));
+-    else
+-        isize=size(varargin{iarg});
+-    end
+-    
+-    if ~isequal(isize,[1 1])
+-        if isequal(asize,[1 1])
+-            asize=isize;
+-        else
+-            if ~isequal(isize,asize)
+-                if ~isempty(inputname(iarg))
+-                    error('Array ''%s'' has inconsistent size.',inputname(iarg));
+-                else
+-                    error('Array %d has inconsistent size.',iarg);
+-                end
+-            end
+-        end
+-    end
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/item2str.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/item2str.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/item2str.m	(revision 12997)
+@@ -1,31 +0,0 @@
+-%
+-%  function to convert an item to a string
+-%
+-%  function [svec]=item2str(a)
+-%
+-function [svec]=item2str(a)
+-
+-if     islogical(a)
+-    if a
+-        svec='true';
+-    else
+-        svec='false';
+-    end
+-elseif ischar(a)
+-    svec=['''' a ''''];
+-elseif isnumeric(a)
+-    svec=num2str(a);
+-else
+-    if ~isempty(inputname(1))
+-        warning('item2str:item_unrecog',...
+-            'Item ''%s'' is of unrecognized type ''%s''.',...
+-            inputname(1),class(a));
+-    else
+-        warning('item2str:item_unrecog',...
+-            'Item %d is of unrecognized type ''%s''.',...
+-            1,class(a));
+-    end
+-    return
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/rotateticklabel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/rotateticklabel.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/rotateticklabel.m	(revision 12997)
+@@ -1,69 +0,0 @@
+-function th=rotateticklabel(h,rot,demo)
+-%ROTATETICKLABEL rotates tick labels
+-%   TH=ROTATETICKLABEL(H,ROT) is the calling form where H is a handle to
+-%   the axis that contains the XTickLabels that are to be rotated. ROT is
+-%   an optional parameter that specifies the angle of rotation. The default
+-%   angle is 90. TH is a handle to the text objects created. For long
+-%   strings such as those produced by datetick, you may have to adjust the
+-%   position of the axes so the labels don't get cut off.
+-%
+-%   Of course, GCA can be substituted for H if desired.
+-%
+-%   TH=ROTATETICKLABEL([],[],'demo') shows a demo figure.
+-%
+-%   Known deficiencies: if tick labels are raised to a power, the power
+-%   will be lost after rotation.
+-%
+-%   See also datetick.
+-
+-%   Written Oct 14, 2005 by Andy Bliss
+-%   Copyright 2005 by Andy Bliss
+-
+-%DEMO:
+-if nargin==3
+-    x=[now-.7 now-.3 now];
+-    y=[20 35 15];
+-    figure
+-    plot(x,y,'.-')
+-    datetick('x',0,'keepticks')
+-    h=gca;
+-    set(h,'position',[0.13 0.35 0.775 0.55])
+-    rot=90;
+-end
+-
+-%set the default rotation if user doesn't specify
+-if nargin==1
+-    rot=90;
+-end
+-%make sure the rotation is in the range 0:360 (brute force method)
+-while rot>360
+-    rot=rot-360;
+-end
+-while rot<0
+-    rot=rot+360;
+-end
+-%get current tick labels
+-a=get(h,'XTickLabel');
+-%erase current tick labels from figure
+-set(h,'XTickLabel',[]);
+-%get tick label positions
+-b=get(h,'XTick');
+-c=get(h,'YTick');
+-%make new tick labels
+-%  must consider yscale (jes, 9/14/10)
+-switch lower(get(h,'YScale'))
+-    case 'linear'
+-        if rot<180
+-            th=text(b,repmat(c(1)-.1*(c(2)-c(1)),length(b),1),a,'HorizontalAlignment','right','rotation',rot,'Interpreter','none');
+-        else
+-            th=text(b,repmat(c(1)-.1*(c(2)-c(1)),length(b),1),a,'HorizontalAlignment','left','rotation',rot,'Interpreter','none');
+-        end
+-    case 'log'
+-        if rot<180
+-            th=text(b,repmat(10^(log10(c(1))-.1*(log10(c(2))-log10(c(1)))),length(b),1),a,'HorizontalAlignment','right','rotation',rot,'Interpreter','none');
+-        else
+-            th=text(b,repmat(10^(log10(c(1))-.1*(log10(c(2))-log10(c(1)))),length(b),1),a,'HorizontalAlignment','left','rotation',rot,'Interpreter','none');
+-        end
+-    otherwise
+-        set(h,'XTickLabel',a);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_numel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_numel.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Array/array_numel.m	(revision 12997)
+@@ -1,35 +0,0 @@
+-%
+-%  function to find a number of elements from a list of arrays.
+-%  
+-%  [asize]=array_numel(varargin)
+-%
+-%  see array_size to check the number and shape of elements, if
+-%  multiple indices will be used.
+-%
+-function [anum]=array_numel(varargin)
+-
+-anum=1;
+-
+-for iarg=1:nargin
+-    if ischar(varargin{iarg})
+-        inum=numel(cellstr(varargin{iarg}));
+-    else
+-        inum=numel(varargin{iarg});
+-    end
+-    
+-    if ~isequal(inum,1)
+-        if isequal(anum,1)
+-            anum=inum;
+-        else
+-            if ~isequal(inum,anum)
+-                if ~isempty(inputname(iarg))
+-                    error('Array ''%s'' has inconsistent number of elements.',inputname(iarg));
+-                else
+-                    error('Array %d has inconsistent number of elements.',iarg);
+-                end
+-            end
+-        end
+-    end
+-end
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/squarezoom.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/squarezoom.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/squarezoom.m	(revision 12997)
+@@ -1,20 +0,0 @@
+-function squarezoom()
+-%SQUAREZOOM - zoom on a part of a figure
+-%
+-%   Usage:
+-%      squarezoom()
+-
+-disp('Click twice to define a square where you want to zoom. First click for upper left corner, second for lower right corner');
+-[x,y]=ginput(2);
+-dx=x(2)-x(1);
+-dy=y(1)-y(2);
+-
+-if dx>dy,
+-	delta=dx-dy;
+-	xlim([x(1) x(2)]);
+-	ylim([y(2)-delta/2 y(1)+delta/2]);
+-else
+-	delta=dy-dx;
+-	xlim([x(1)-delta/2 x(2)+delta/2]);
+-	ylim([y(2) y(1)]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/plot2patch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/plot2patch.m	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Plot/plot2patch.m	(revision 12997)
+@@ -1,16 +0,0 @@
+-function [px py]=plot2patch(x,y,miny)
+-%PLOT2PATCH: build patch out of x,y plot.
+-%
+-% Usage: [px,py]=plot2patch(x,y,miny)
+-%
+-%        where px and py are a list of point defining a closed polygon.
+-%              x,y are the values of the plot
+-%              miny is the y-value used to close the plot into a closed polygon.
+-% 
+-%      See also patch, plot
+-
+-px=x;
+-py=y;
+-
+-px=[px; flipud(x)];
+-py=[py; ; miny*ones(length(x),1)];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/isbasin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/isbasin.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/isbasin.m	(revision 12997)
+@@ -0,0 +1,19 @@
++function isbasin(name)
++%ISBASIN: figure out if a basin name exists.
++%
++%
++%        Usage:  index=isbasin('jks');
++%
++%
++
++
++%First, load basin names:
++load([jplsvn '/projects/ModelData/Names/Names.mat']);
++
++
++%go through names: 
++for i=1:length(names),
++	if ~isempty(strfind(names{i,1},name)),
++		disp(['''' names{i,1} ''' Long:' num2str(names{i,2}) ' Lat:' num2str(names{i,3}) ]);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/plotbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/plotbasins.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/plotbasins.m	(revision 12997)
+@@ -0,0 +1,18 @@
++%display all the domain outlines in a directory
++
++basins=listfiles;
++
++hold on
++for i=1:length(basins), 
++	%check whether this is a .exp file
++	basin=basins{i};
++	if strcmpi(basin(end-3:end),'.exp'),
++
++		contour=expread(basin,0);
++		x=contour(1).x;
++		y=contour(1).y;
++		x0=mean(x); y0=mean(y);
++		text(x0,y0,basin(1:end-4),'Fontsize',14);
++		expdisp(basin);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/showbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/showbasins.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/showbasins.m	(revision 12997)
+@@ -0,0 +1,69 @@
++function showbasins(varargin)
++%SHOWBASINS - return basins that are within the xlim and ylim
++%
++%   Usage:
++%      names=showbasins(options);
++%   Options: 
++%      'unit' default 1
++%      'hemisphere': default +1;
++%      'central_meridian: 45 for Greenland and 0 for Antarctica
++%      'standard_parallel: 70 for Greenland and 71 for Antarctica
++%
++
++%is varargin an options database already?
++if nargin==0,
++	options=pairoptions(varargin{:});
++elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
++	%do nothing to the varargin: 
++	options=varargin{1};
++else
++	%process varargin for options: 
++	options=pairoptions(varargin{:});
++end
++
++
++%recover some options, and set defaults
++unitmultiplier=getfieldvalue(options,'unit',1);
++fontsize=getfieldvalue(options,'fontsize',12);
++hemisphere=getfieldvalue(options,'hemisphere');
++
++if strcmpi(hemisphere,'s'),
++	hemisphere=-1;
++elseif strcmpi(hemisphere,'n'),
++	hemisphere=+1;
++else
++	error('showbasins error message: hemispehre should be either ''n'' or ''s''');
++	end
++
++if hemisphere==+1,
++	central_meridian=getfieldvalue(options,'central_meridian',45);
++	standard_parallel=getfieldvalue(options,'standard_parallel',70);
++else
++	central_meridian=getfieldvalue(options,'central_meridian',0);
++	standard_parallel=getfieldvalue(options,'standard_parallel',71);
++end
++
++%Ok, find basin we are talking about: 
++load([jplsvn '/projects/ModelData/Names/Names.mat']);
++
++%Get xlim and ylim, and convert into lat,long: 
++xlimits=xlim; x0=xlimits(1); x1=xlimits(2);
++ylimits=ylim; y0=ylimits(1); y1=ylimits(2);
++
++%Convert names lat and long into x,y:
++lat=cell2mat(names(:,3));
++long=cell2mat(names(:,2));
++
++%Now, convert lat,long into x,y:
++[x,y]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
++
++%Find  x,y within xlimits and ylimits: 
++locations=find(x>x0 & x<x1 & y>y0 & y<y1);
++
++%Go through locations, and display the names: 
++for i=1:size(locations,1),
++	hold on,
++	plot(x(locations(i)),y(locations(i)),'r.');
++	t=text(x(locations(i)),y(locations(i)),names{locations(i),1}); 
++	set(t,'FontSize',fontsize);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/basinzoom.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/basinzoom.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/basinzoom.m	(revision 12997)
+@@ -0,0 +1,94 @@
++function varargout=basinzoom(varargin)
++%ANTZOOM - zoom on a basin in Antarctica or Greenland.
++%
++%   This function zooms on an existing figure describing Antarctica or Greenland 
++%   The zooming depends on the region name provided as input. 
++%
++%   Usage:
++%      varargout=basinzoom(options)
++
++%recover some options, and set defaults
++
++%is varargin an options database already?
++if nargin==0,
++	options=pairoptions(varargin{:});
++elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
++	%do nothing to the varargin: 
++	options=varargin{1};
++else
++	%process varargin for options: 
++	options=pairoptions(varargin{:});
++end
++
++unitmultiplier=getfieldvalue(options,'unit',NaN);
++basin=getfieldvalue(options,'basin');
++
++if exist(options,'basindelta'),
++
++	basindeltax=getfieldvalue(options,'basindelta',300); 
++	basindeltay=getfieldvalue(options,'basindelta',300); 
++else
++	basindeltax=getfieldvalue(options,'basindeltax',300); 
++	basindeltay=getfieldvalue(options,'basindeltay',300);
++end
++
++%multiply by 1000 to get kms
++basindeltax=basindeltax*1000;
++basindeltay=basindeltay*1000;
++
++%Ok, find basin we are talking about: 
++load([jplsvn() '/projects/ModelData/Names/Names.mat']);
++		
++%Go through names: 
++found=0;
++for i=1:size(names,1),
++	if strcmpi(names{i,1},basin),
++		%ok, we've got the region. Get lat and long: 
++		long=names{i,2};
++		lat=names{i,3};
++		hemisphere=names{i,4};
++		found=1;
++		break;
++	end
++end
++
++if ~found,
++	error(['basinzoom error message: cannot find basin ' basin '. Use isbasin to determine a basin name.']);
++end
++
++if hemisphere==+1,
++	central_meridian=getfieldvalue(options,'central_meridian',45);
++	standard_parallel=getfieldvalue(options,'standard_parallel',70);
++else
++	central_meridian=getfieldvalue(options,'central_meridian',0);
++	standard_parallel=getfieldvalue(options,'standard_parallel',71);
++end
++
++%Transform lat long into x,y: 
++[xc,yc]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
++
++%compute x0,x1 and y0,y1 using basindeltax and basindeltay
++x0=xc-basindeltax/2;
++x1=xc+basindeltax/2;
++y0=yc-basindeltay/2;
++y1=yc+basindeltay/2;
++
++if ~isnan(unitmultiplier)
++	x0=x0*unitmultiplier;
++	x1=x1*unitmultiplier;
++	y0=y0*unitmultiplier;
++	y1=y1*unitmultiplier;
++end
++
++%if output arguments are present, return the limits, 
++%otherwise, set them on the current graphic. 
++if nargout==2,
++	found=1;
++	varargout{1}=[x0 x1];
++	varargout{2}=[y0 y1];
++else
++	xlim([x0 x1]);
++	ylim([y0 y1]);
++	found=1;
++	daspect([1;1;1]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py	(revision 12997)
+@@ -0,0 +1,76 @@
++import socket
++import platform
++import subprocess
++import os
++import shutil
++from MatlabFuncs import *
++
++def scpin(host, login,port,path, packages):
++	"""
++	SCPIN get packages from host, using scp on unix, and pscp on windows
++ 
++	   usage: scpin(host,packages,path)
++	"""
++
++	#first get hostname
++	hostname=socket.gethostname().lower().split('.')[0]
++
++	#first be sure packages are not in the current directory, this could conflict with pscp on windows. 
++	#remove warnings in case the files do not exist
++	for package in packages:
++		try:
++			os.remove(package)
++		except OSError as e:
++			pass
++
++	#if hostname and host are the same, do a simple copy
++	if strcmpi(hostname,host):
++
++		for package in packages:
++			try:
++				shutil.copy(os.path.join(path,package),os.getcwd())    #keep going, even if success=0
++			except OSError as e:
++				pass
++
++	else:
++
++		if 'Windows' in platform.system():
++			#use the putty project pscp.exe: it should be in the path.
++		
++			#get ISSM_DIR variable
++			if 'ISSM_DIR_WIN' in os.environ:
++				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
++			else:
++				raise OSError("scpin error message: could not find ISSM_DIR_WIN environment variable.")
++
++			username=raw_input('Username: (quoted string) ')
++			key=raw_input('Key: (quoted string) ')
++
++			for package in packages:
++				try:
++					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s:%s %s' % (ISSM_DIR,username,key,host,os.path.join(path,package),os.getcwd()),shell=True)
++				except CalledProcessError as e:
++					raise CalledProcessError("scpin error message: could not call putty pscp.")
++
++		else:
++			#just use standard unix scp
++			#string to copy multiple files using scp: 
++			if len(packages)==1:
++				string=packages[0]
++			else:
++				string='{'
++				for package in packages:
++					string+=packages[i]+','
++				string=string[:-1]+'}'
++
++
++			if port:
++				subprocess.call('scp -P %d %s@localhost:%s %s' % (port,login,os.path.join(path,string),os.getcwd),shell=True)
++			else:
++				subprocess.call('scp %s@%s:%s %s' % (login,host,os.path.join(path,string),os.getcwd),shell=True)
++		
++			#check scp worked
++			for package in packages:
++				if not os.path.exists(os.path.join('.',package)):
++					raise OSError("scpin error message: could not call scp on *nix system.")
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py	(revision 12997)
+@@ -0,0 +1,58 @@
++import socket
++import platform
++import subprocess
++import os
++import shutil
++from MatlabFuncs import *
++
++def issmscpout(host,path,login,port,packages):
++	"""
++	SCPOUT send packages to a host, using scp on unix, and pscp on windows
++ 
++	   usage: scpout(host,path,packages)
++	"""
++
++	#get hostname
++	hostname=socket.gethostname().lower().split('.')[0]
++
++	#if hostname and host are the same, do a simple copy
++
++	if strcmpi(host,hostname):
++		for package in packages:
++			here=os.getcwd()
++			os.chdir(path)
++			shutil.rmtree(package)
++			subprocess.call('ln -s %s %s' % (os.path.join(here,package),path),shell=True)
++			os.chdir(here)
++	else:
++		if 'Windows' in platform.system():
++			#use the putty project pscp.exe: it should be in the path.
++		
++			#get ISSM_DIR variable
++			if 'ISSM_DIR_WIN' in os.environ:
++				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
++			else:
++				raise OSError("scpout error message: could not find ISSM_DIR_WIN environment variable.")
++
++			username=raw_input('Username: (quoted string) ')
++			key=raw_input('Key: (quoted string) ')
++
++			for package in packages:
++				try:
++					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s %s:%s' % (ISSM_DIR,username,key,package,host,path),shell=True)
++				except CalledProcessError as e:
++					raise CalledProcessError("scpout error message: could not call putty pscp.")
++
++		else:
++			#just use standard unix scp
++			#create string of packages being sent
++			string=''
++			for package in packages:
++				string+=' '+package
++			string+=' '
++		
++			if port:
++				subprocess.call('scp -P %d %s %s@localhost:%s' % (port,string,login,path),shell=True)
++			else:
++				subprocess.call('scp %s %s@%s:%s' % (string,login,host,path),shell=True)
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.py	(revision 12997)
+@@ -0,0 +1,42 @@
++import socket
++import platform
++import subprocess
++import os
++from MatlabFuncs import *
++
++def issmssh(host,login,port,command):
++	"""
++	ISSMSSH - wrapper for OS independent ssh command.
++ 
++	   usage: 
++	      issmssh(host,command)
++	"""
++
++	#first get hostname 
++	hostname=socket.gethostname().lower().split('.')[0]
++
++	#if same as host, just run the command. 
++	if strcmpi(host,hostname):
++		subprocess.call(command,shell=True)
++	else:
++		if 'Windows' in platform.system():
++			#use the putty project plink.exe: it should be in the path.
++		
++			#get ISSM_DIR variable
++			if 'ISSM_DIR_WIN' in os.environ:
++				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
++			else:
++				raise OSError("issmssh error message: could not find ISSM_DIR_WIN environment variable.")
++
++			username=raw_input('Username: (quoted string) ')
++			key=raw_input('Key: (quoted string) ')
++
++			subprocess.call('%s/externalpackages/ssh/plink.exe -ssh -l "%s" -pw "%s" %s "%s"' % (ISSM_DIR,username,key,host,command),shell=True);
++
++		else:
++			#just use standard unix ssh
++			if port:
++				subprocess.call('ssh -l %s -p %d localhost "%s"' % (login,port,command),shell=True)
++			else:
++				subprocess.call('ssh -l %s %s "%s"' % (login,host,command),shell=True)
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ispetsc.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ispetsc.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ispetsc.py	(revision 12997)
+@@ -0,0 +1,37 @@
++import os
++from issmdir import *
++from MatlabFuncs import *
++
++def ispetsc():
++	"""
++	ISPETSC - figure out if PETSC package was compiled with ISSM
++ 
++	   Usage:
++	      flag=ispetsc();
++	"""
++
++	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
++	if not os.path.exists(configfile):
++		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
++
++	#go through the file, and recover the line we want
++	flag=2
++	try:
++		fid=open(configfile,'r')
++	except IOError as e:
++		raise IOError("could not open file: '%s'" % configfile)
++
++	for tline in fid:
++		if strncmp(tline,'/* #undef _HAVE_PETSC_ */',25):
++			flag=0
++			break
++		if  strncmp(tline,'#define _HAVE_PETSC_',20):
++			flag=1
++			break
++
++	fid.close()
++	if flag==2:
++		raise RuntimeError("could not determine whether PETSC was or was not compiled.")
++
++	return flag
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.m	(revision 12997)
+@@ -0,0 +1,78 @@
++function scpin(host, login,port,path, packages)
++%SCPIN get packages from host, using scp on unix, and pscp on windows
++%
++%   usage: scpin(host,packages,path)
++%
++%
++
++%first get hostname
++hostname=oshostname();
++
++%first be sure packages are not in the current directory, this could conflict with pscp on windows. 
++%get initial warning mode
++state=warning('query', 'all');
++%remove warnings in case the files do not exist
++warning off
++for i=1:numel(packages),
++	delete(packages{i});
++end
++%back to initial warning state
++warning(state);
++
++%if hostname and host are the same, do a simple copy
++if strcmpi(hostname,host),
++
++    for i=1:numel(packages),
++		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
++	end
++
++else
++
++	if ispc,
++		%use the putty project pscp.exe: it should be in the path.
++		
++		%get ISSM_DIR variable
++		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
++		if status, 
++			error('scpin error message: could not find ISSM_DIR_WIN environment variable');
++		end
++		ISSM_DIR=ISSM_DIR(2:end-2);
++
++		username=input('Username: (quoted string) ');
++		key=input('Key: (quoted string) ');
++
++		for i=1:numel(packages),
++			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' host ':' path '/' packages{i} ' ./']);
++			if status, 
++				error('scpin error message: could not call putty pscp');
++			end
++		end
++
++	else
++		%just use standard unix scp
++		%string to copy multiple files using scp: 
++		if numel(packages)==1,
++			string=packages{1};
++		else
++			string='\{';
++			for i=1:numel(packages)-1,
++				string=[string packages{i} ','];
++			end
++			string=[string packages{end} '\}'];
++		end
++
++
++		if port,
++			eval(['!scp -P ' num2str(port) ' ' login '@localhost:' path '/' string ' ./']);
++		else
++			eval(['!scp ' login '@' host ':' path '/' string ' ./']);
++		end
++		
++		%check scp worked
++		for i=1:numel(packages),
++			if ~exist(['./' packages{i}]),
++				error('scpin error message: could not call scp on *nix system');
++			end
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismumps.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismumps.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismumps.py	(revision 12997)
+@@ -0,0 +1,37 @@
++import os
++from issmdir import *
++from MatlabFuncs import *
++
++def ismumps():
++	"""
++	ISMUMPS - figure out if MUMPS package was compiled with ISSM
++ 
++	   Usage:
++	      flag=ismumps();
++	"""
++
++	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
++	if not os.path.exists(configfile):
++		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
++
++	#go through the file, and recover the line we want
++	flag=2
++	try:
++		fid=open(configfile,'r')
++	except IOError as e:
++		raise IOError("could not open file: '%s'" % configfile)
++
++	for tline in fid:
++		if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25):
++			flag=0
++			break
++		if  strncmp(tline,'#define _HAVE_MUMPS_',20):
++			flag=1
++			break
++
++	fid.close()
++	if flag==2:
++		raise RuntimeError("could not determine whether MUMPS was or was not compiled.")
++
++	return flag
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.m	(revision 12997)
+@@ -0,0 +1,57 @@
++function issmscpout(host,path,login,port,packages)
++%SCPOUT send packages to a host, using scp on unix, and pscp on windows
++%
++%   usage: scpout(host,path,packages)
++%
++%
++
++%get hostname
++hostname=oshostname();
++
++%if hostname and host are the same, do a simple copy
++
++if strcmpi(host,hostname),
++	for i=1:numel(packages),
++		here=pwd;
++		eval(['cd ' path])
++		system(['rm -rf ' packages{i} ]);
++		system(['ln -s ' here '/' packages{i} ' .']);
++		eval(['cd ' here]);
++	end
++else 
++	if ispc,
++		%use the putty project pscp.exe: it should be in the path.
++		
++		%get ISSM_DIR variable
++		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
++		if status, 
++			error('scpout error message: could not find ISSM_DIR_WIN environment variable');
++		end
++		ISSM_DIR=ISSM_DIR(2:end-2);
++
++		username=input('Username: (quoted string) ');
++		key=input('Key: (quoted string) ');
++
++		for i=1:numel(packages),
++			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' packages{i} ' ' host ':' path]);
++			if status, 
++				error('scpout error message: could not call putty pscp');
++			end
++		end
++
++	else
++		%just use standard unix scp
++		%create string of packages being sent
++		string='';
++		for i=1:numel(packages),
++			string=[string ' ' packages{i}];
++		end
++		string=[string ' '];
++		
++		if port,
++			eval(['!scp -P ' num2str(port) ' ' string ' ' login '@localhost:' path]);
++		else
++			eval(['!scp ' string ' ' login '@' host ':' path]);
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.m	(revision 12997)
+@@ -0,0 +1,37 @@
++function issmssh(host,login,port,command)
++%ISSMSSH - wrapper for OS independent ssh command.
++%
++%   usage: 
++%      issmssh(host,command)
++
++%first get hostname 
++hostname=oshostname();
++
++%if same as host, just run the command. 
++if strcmpi(host,hostname),
++	system(command);
++else
++	if ispc,
++		%use the putty project plink.exe: it should be in the path.
++		
++		%get ISSM_DIR variable
++		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
++		if status, 
++			error('issmssh error message: could not find ISSM_DIR_WIN environment variable');
++		end
++		ISSM_DIR=ISSM_DIR(2:end-2);
++
++		username=input('Username: (quoted string) ');
++		key=input('Key: (quoted string) ');
++
++		system([ISSM_DIR '/externalpackages/ssh/plink.exe -ssh -l "' username '" -pw "' key '" ' host ' "' command '"']);
++
++	else
++		%just use standard unix ssh
++		if port,
++			eval(['!ssh -l ' login ' -p ' num2str(port) ' localhost "' command '"']);
++		else
++			eval(['!ssh -l ' login ' ' host ' "' command '"']);
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ispetsc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ispetsc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ispetsc.m	(revision 12997)
+@@ -0,0 +1,33 @@
++function flag=ispetsc()
++%ISPETSC - figure out if PETSC package was compiled with ISSM
++%
++%   Usage:
++%       flag=ispetsc();
++
++
++configfile=[issmdir() '/bin/config.h']; %should find it in the install target
++if ~exist(configfile,'file'),
++	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
++end
++
++%go through the file, and recover the line we want
++flag=2;
++fid=fopen(configfile,'r');
++if(fid==-1), error(['could not open file: ' configfile]); end
++
++while(true),
++	tline=fgets(fid);
++	if ~ischar(tline), break, end
++	if strncmp(tline,'/* #undef _HAVE_PETSC_ */',25),
++		flag=0;
++		break;
++	end
++	if  strncmp(tline,'#define _HAVE_PETSC_',20),
++		flag=1;
++		break;
++	end
++end
++fclose(fid);
++if flag==2,
++	error('could not determine whether PETSC was or was not compiled');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/listfilesparallel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/listfilesparallel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/listfilesparallel.m	(revision 12997)
+@@ -0,0 +1,15 @@
++function list=listfilesparallel(rank,numprocs)
++%LISTFILESPARALLEL list files inside a directory, depending on rank  and number of processors running this routine.
++%        this is very OS dependent.
++%
++%   usage: list=listfilesparallel(rank,numprocs);
++%
++%
++%   see also LS DIR LISTFILES
++
++list=listfiles';
++numfiles=numel(list);
++
++%we now have a list, split it between all the processors.
++[i1,i2]=parallelrange(rank,numprocs,numfiles);
++list=list(i1:i2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismumps.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismumps.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismumps.m	(revision 12997)
+@@ -0,0 +1,33 @@
++function flag=ismumps()
++%ISMUMPS - figure out if MUMPS package was compiled with ISSM
++%
++%   Usage:
++%       flag=ismumps();
++
++
++configfile=[issmdir() '/bin/config.h']; %should find it in the install target
++if ~exist(configfile,'file'),
++	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
++end
++
++%go through the file, and recover the line we want
++flag=2;
++fid=fopen(configfile,'r');
++if(fid==-1), error(['could not open file: ' configfile]); end
++
++while(true),
++	tline=fgets(fid);
++	if ~ischar(tline), break, end
++	if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25),
++		flag=0;
++		break;
++	end
++	if  strncmp(tline,'#define _HAVE_MUMPS_',20),
++		flag=1;
++		break;
++	end
++end
++fclose(fid);
++if flag==2,
++	error('could not determine whether MUMPS was or was not compiled');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/listfiles.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/listfiles.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/listfiles.m	(revision 12997)
+@@ -0,0 +1,22 @@
++function list=listfiles()
++%LISTFILES list files inside a directory
++%        this is very OS dependent.
++%
++%   usage: list=listfiles;
++%
++%
++%   see also LS DIR
++
++%use dir, as it seems to act OS independent
++
++first_list=dir;
++list={};
++
++for i=1:numel(first_list),
++	if (  ~strcmpi(first_list(i).name,'.') &...
++			~strcmpi(first_list(i).name,'..') &...
++			~strcmpi(first_list(i).name,'NightlyRun') &...
++			~strcmpi(first_list(i).name,'.svn')),
++		list{end+1}=first_list(i).name;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmbbftpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmbbftpin.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmbbftpin.m	(revision 12997)
+@@ -0,0 +1,48 @@
++function issmbbftpin(host, login,port,numstreams,path, packages)
++%BBFTPIN get packages from host, using bbftp. assuming unix system here.
++%
++%   usage: scpin(host,packages,path)
++%
++%
++
++%first get hostname
++hostname=oshostname();
++
++%first be sure packages are not in the current directory, this could conflict with pscp on windows. 
++%get initial warning mode
++state=warning('query', 'all');
++%remove warnings in case the files do not exist
++warning off
++for i=1:numel(packages),
++	delete(packages{i});
++end
++%back to initial warning state
++warning(state);
++
++%if hostname and host are the same, do a simple copy
++if strcmpi(hostname,host),
++
++    for i=1:numel(packages),
++		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
++	end
++
++else
++
++	%build a string of the type: bbftp -s -u elarour -e 'setnbstream 8; cd /nobackupp10/elarour/Testing/Interactive3/; get Antarctica.outbin' pfe1.nas.nasa.gov
++	command=['!bbftp -s -V -u ' login ' -e ''setnbstream 8; cd ' path '; '];
++	for i=1:length(packages),
++		command=[command 'get ' packages{i} ';'];
++	end
++	command=[command '''  pfe1.nas.nasa.gov'];
++	
++	eval(command);
++
++	%check bbftp worked
++	for i=1:numel(packages),
++		if ~exist(['./' packages{i}]),
++			error('scpin error message: could not call scp on *nix system');
++		end
++	end
++
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/oshostname.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/oshostname.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/oshostname.m	(revision 12997)
+@@ -0,0 +1,22 @@
++function hostname=oshostname()
++%OSHOSTNAME figure out hostname, irrespective of os type
++%
++%   usage: hostname=oshostname();
++%
++%
++
++if ispc,
++	[status,hostname]=system('hostname | sed ''s/-//g''');hostname=hostname(1:end-1);
++
++	if status, 
++		error('oshostname error message: could not run hostname command on windows os');
++	end
++
++else
++	[status,hostname]=system(['hostname -s | sed ''s/-//g''']);
++	if status, 
++		error('oshostname error message: could not run hostname command on *nix os');
++	end
++	hostname=hostname(1:end-1);
++	hostname=ddewhite(hostname);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmbbftpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmbbftpout.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmbbftpout.m	(revision 12997)
+@@ -0,0 +1,30 @@
++function issmbbftpout(host,path,login,port,numstreams,packages)
++%BBFTPOUT put packages onto host, using bbftp. assuming unix system here.
++%
++%   usage: bbftpout(host,path,login,port,numstream,packages)
++%
++%
++
++%get hostname
++hostname=oshostname();
++
++%if hostname and host are the same, do a simple copy
++if strcmpi(host,hostname),
++	for i=1:numel(packages),
++		here=pwd;
++		eval(['cd ' path])
++		system(['rm -rf ' packages{i} ]);
++		system(['ln -s ' here '/' packages{i} ' .']);
++		eval(['cd ' here]);
++	end
++else 
++	
++	%build a string of the type: bbftp -s -u elarour -e 'setnbstream 8; cd /nobackupp10/elarour/Testing/Interactive3/; put Antarctica.tar.gz' pfe1.nas.nasa.gov
++	command=['!bbftp -s -V -u ' login ' -e ''setnbstream 8; cd ' path '; ']
++	for i=1:length(packages),
++		command=[command 'put ' packages{i} ';'];
++	end
++	command=[command '''  pfe1.nas.nasa.gov'];
++	
++	eval(command);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.py	(revision 12997)
+@@ -0,0 +1,25 @@
++#! /usr/bin/env python
++def parallelrange(rank,numprocs,globalsize):
++	"""
++	PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
++ 
++	   Usage: 
++	      i1,i2=parallelrange(rank,numprocs,globalsize)
++	"""
++
++	#We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
++	num_local_rows=[int(globalsize/numprocs) for i in xrange(numprocs)]
++
++	#There may be some rows left. Distribute evenly.
++	row_rest=globalsize - numprocs*int(globalsize/numprocs)
++
++	for i in xrange(row_rest):
++		num_local_rows[i]=num_local_rows[i]+1
++
++	i1=0
++	for i in xrange(rank-1):
++		i1+=num_local_rows[i]
++	i2=i1+num_local_rows[rank-1]-1
++
++	return i1,i2
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/QueueRequirements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/QueueRequirements.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/QueueRequirements.m	(revision 12997)
+@@ -0,0 +1,35 @@
++function QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,queue,np,time)
++%QUEUEREQUIREMENTS - queue requirements in time, number of cpus, by name of queue.
++%
++%   Usage: 
++%      QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,np,time)
++
++%Ok, go through requirements for current queue:
++index=ismemberi(queue,available_queues);
++if  ~index,
++	%ok, either we a generic cluster, with 'none' queue, or we could not find the queue reqruirements
++	if strcmpi(available_queues{1},'none'),
++		%reset index to 1, so we can fish the requirements
++		index=1;
++	else
++		string=available_queues{1};
++		for i=2:length(available_queues),
++			string=[string ' ' available_queues{i}];
++		end
++		error(['QueueRequirements error message: availables queues are ' string]);
++	end
++end
++
++%check on time requirements
++rtime=queue_requirements_time(index);
++if time<=0,
++	error('QueueRequirements: time should be a positive number');
++end
++if time>rtime,
++	error(['QueueRequirements: time should be < ' num2str(rtime) ' for queue: ' queue]);
++end
++
++%check on np requirements
++if np<=0,
++	error('QueueRequirements: np should be a positive number');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.m	(revision 12997)
+@@ -0,0 +1,23 @@
++function [i1,i2]=parallelrange(rank,numprocs,globalsize)
++%PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
++%
++%   Usage: 
++%      [i1,i1]=parallelrange(rank,numprocs,globalsize)
++
++num_local_rows=zeros(numprocs,1);
++
++for i=1:numprocs,
++	%we use floor. we under distribute rows. The rows left  are then redistributed, therefore resulting in a more even distribution.
++	num_local_rows(i)=floor(globalsize/numprocs);
++end
++
++
++%There may be some rows left. Distribute evenly.
++row_rest=globalsize - numprocs*floor(globalsize/numprocs);
++
++for i=1:row_rest,
++	num_local_rows(i)=num_local_rows(i)+1;
++end
++
++i1=sum(num_local_rows(1:rank-1))+1;
++i2=i1+num_local_rows(rank)-1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/kml2expg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/kml2expg.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/kml2expg.m	(revision 12997)
+@@ -0,0 +1,13 @@
++function kml2expg(filename)
++
++	[path,name,ext]=fileparts(filename);
++
++	if strcmpi(ext,'.kmz'),
++		eval(['!unzip ' filename]);
++		eval(['!mv doc.kml ' name '.kml']);
++		kml2exp([name '.kml'],[name '.exp']);
++		expll2xy([name '.exp'],1);
++	end
++
++	kml2exp([name '.kml'],[name '.exp']);
++	expll2xy([name '.exp'],1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/exp2kml.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/exp2kml.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/exp2kml.m	(revision 12997)
+@@ -0,0 +1,19 @@
++function exp2kml(input,output)
++%EXP2KML: transform Argus exp file to kml
++%
++% Usage:    exp2kml('temp.exp','temp2.kml')
++%
++%
++
++
++%First, read exp file
++domain=expread(input);
++
++
++%then transform: 
++string=ge_plot(domain.x,domain.y,'name',domain.name);
++
++%open kml file for writing: 
++fid=fopen(output,'w');
++fprintf(fid,'%s',string);
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/kml2exp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/kml2exp.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/kml2exp.m	(revision 12997)
+@@ -0,0 +1,29 @@
++function kml2exp(input,output)
++%KML2EXP: transform kml file Argus exp file.
++%
++% Usage:    kmltoexp('temp.kml','temp2.exp')
++%
++%
++
++
++
++
++%First, read polygon kml file.
++structure=kml_shapefile(input);
++	
++%create exp file: 
++domain=struct();
++for i=1:length(structure),
++
++	if isfield(structure,'name'),
++		domain(end+1).name=structure(i).name;
++	else
++		domain(end+1).name='NaN';
++	end
++
++	domain(end).density=1;
++	domain(end).x=structure(i).X;
++	domain(end).y=structure(i).Y;
++end
++domain=domain(2:end);
++expwrite(domain,output);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics/cfl_step.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics/cfl_step.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics/cfl_step.m	(revision 12997)
+@@ -0,0 +1,23 @@
++function maxtime=cfl_step(md,vx,vy);
++%CFL_STEP - return the maximum time step for the model in years
++%
++%   Dt < 0.5 / ( u/Dx +v/Dy )
++%
++%   Usage:
++%      maxtime=cfl_step(md,vx,vy);
++%
++%   Example:
++%      dt=cfl_step(md,md.results.DiagnosticSolution.Vx,md.results.DiagnosticSolution.Vy)
++
++%Check length of velocities 
++if size(vx,1)~=md.mesh.numberofvertices & size(vy,1)~=md.mesh.numberofvertices,
++	error('timestpes error message: size of velocity components must be the same as md.mesh.numberofvertices');
++end
++
++index=md.mesh.elements;
++edgex=max(md.mesh.x(index),[],2)-min(md.mesh.x(index),[],2);
++edgey=max(md.mesh.y(index),[],2)-min(md.mesh.y(index),[],2);
++vx=max(abs(vx(index)),[],2);
++vy=max(abs(vy(index)),[],2);
++
++maxtime=1/2*min(1./(vx./edgex+vy./edgey));
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics/cfl_step.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.py	(revision 12997)
+@@ -0,0 +1,18 @@
++import numpy
++
++def isnans(array):
++	"""
++	ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
++
++	   Usage:    isnans(array)
++
++	      See also : ISNAN 
++	"""
++
++	if   isinstance(array,(tuple,list,dict)): 
++		returnvalue=0
++	else:
++		returnvalue=numpy.isnan(array)
++
++	return returnvalue
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/round_ice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/round_ice.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/round_ice.m	(revision 12997)
+@@ -0,0 +1,38 @@
++function new_x=round_ice(x,numnonzeros)
++%ROUND_ICE - rounds up x so that it has only numnonzeros non zero digits
++%
++%   numnonzeros must be an integer larger or equal to 1
++%
++%   Usage:
++%      new_x=round_ice(x,numnonzeros)
++
++%some checks
++if (nargin ~=2 | nargout>1),
++	error('round_ice usage: new_x=round_ice(x,numonzeros)');
++end
++if ~isnumeric(x)
++	error('round_ice error message: x must be a number and numzeros an integer');
++end
++if round(numnonzeros)~=numnonzeros
++	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
++end
++if any(numnonzeros<1)
++	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
++end
++if (length(numnonzeros)~=1 & size(numnonzeros)~=size(x))
++	error('round_ice error message: numnonzeros must be an integer larger or equal to 1 or a list of integers of length length(x)')
++end
++
++%figure out how long x is
++lengthx=ceil(log10(abs(x)));
++
++%if x contains 0, lengthx=-Inf
++lengthx(isinf(lengthx))=1;
++
++%get its sign
++si=sign(x);
++
++%rule out zeros
++new_x=si.*round(abs(x).*10.^(-lengthx+numnonzeros)).*10.^(lengthx-numnonzeros);
++
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.m	(revision 12997)
+@@ -0,0 +1,15 @@
++function returnvalue=isnans(array)
++%ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
++%
++%  Usage:    isnans(array)
++%
++%  See also : ISNAN 
++
++
++if isstruct(array), 
++	returnvalue=0;
++elseif iscell(array)
++	returnvalue=0;
++else
++	returnvalue=isnan(array);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/fixdec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/fixdec.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/fixdec.m	(revision 12997)
+@@ -0,0 +1,41 @@
++function y = fixdec(x, n)
++%FIXDEC -  Round towards zero with a specified number of decimals.
++%
++%   This routine rounds the elements of X to N decimals.
++%
++%   Usage:
++%      y = fixdec(x, n)
++%
++%   Example:
++%      fixdec(10*sqrt(2) + i*pi/10, 4) returns 14.1421 + 0.3141i
++%
++%   See also: FIX, FLOOR, CEIL, ROUND, FIXDIG, ROUNDDEC, ROUNDDIG.
++
++%   Author:      Peter J. Acklam
++%   Time-stamp:  2004-09-22 20:08:10 +0200
++%   E-mail:      pjacklam@online.no
++%   URL:         http://home.online.no/~pjacklam
++
++   % Check number of input arguments.
++   error(nargchk(2, 2, nargin));
++
++   % Quick exit if either argument is empty.
++   if (isempty(x) |isempty(n))
++      y = [];
++      return
++   end
++
++   % Get size of input arguments.
++   size_x   = size(x);
++   size_n   = size(n);
++   scalar_x = all(size_x == 1);           % True if x is a scalar.
++   scalar_n = all(size_n == 1);           % True if n is a scalar.
++
++   % Check size of input arguments.
++   if ~scalar_x & ~scalar_n & ~isequal(size_x, size_n)
++      error(['When both arguments are non-scalars they must have' ...
++             ' the same size']);
++   end
++
++   f = 10.^n;
++   y = fix(x .* f) ./ f;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/FlagElements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/FlagElements.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/FlagElements.m	(revision 12997)
+@@ -0,0 +1,57 @@
++function flag=FlagElements(md,region),
++%FLAGELEMENTS - flag the elements in an region
++%
++%   The region can be given with an exp file, a list of elements.
++%
++%   Usage: 
++%      flag=FlagElements(md,region);
++%
++%   Example:
++%      flag=FlagElements(md,'all');
++%      flag=FlagElements(md,'');
++%      flag=FlagElements(md,'Domain.exp');
++%      flag=FlagElements(md,'~Domain.exp');
++%      flag=FlagElements(md,md.mask.elementongroundedice);
++
++	if ischar(region),
++		if isempty(region),
++			flag=zeros(md.mesh.numberofelements,1);
++			invert=0;
++		elseif strcmpi(region,'all')
++			flag=ones(md.mesh.numberofelements,1);
++			invert=0;
++		else
++			%make sure that we actually don't want the elements outside the domain outline!
++			if strcmpi(region(1),'~'),
++				region=region(2:length(region));
++				invert=1;
++			else
++				invert=0;
++			end
++
++			%does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
++			if ~exist(region,'file'),
++				if (length(region)>3 & ~strcmp(region(end-3),'.exp')),
++					error(['Error: File ' region ' not found!']);
++				end
++				[xlim,ylim]=basinzoom('basin',region);
++				flag_nodes=double(md.mesh.x<xlim(2) & md.mesh.x>xlim(1) &  md.mesh.y<ylim(2) & md.mesh.y>ylim(1));
++				flag=prod(flag_nodes(md.mesh.elements),2);
++			else
++				%ok, flag elements
++				flag=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,region,'element',1);
++			end
++		end
++		if invert,
++			flag=~flag;
++		end
++	elseif isfloat(region) | islogical(region),
++		if size(region,1)~=md.mesh.numberofelements,
++			help FlagElements
++			error('Flaglist for region must be of same size as number of elements in model');
++		end
++		flag=region;
++	else
++		error('Invalid region option');
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/find_point.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/find_point.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/find_point.m	(revision 12997)
+@@ -0,0 +1,14 @@
++function f=find_point(tabx,taby,pointx,pointy)
++%FIND_POINT - find closest point
++%
++%   find which point of the list (tabx,taby) is
++%   the closest to (poinx,pointy)
++%
++%   Usage:
++%      f=find_point(tabx,taby,pointx,pointy)
++
++%Compute distance between point and cloud of points
++distance=sqrt((tabx-pointx).^2+(taby-pointy).^2);
++
++%find index of the minimum distance and return the first one only
++f=find(distance==min(min(distance)),1);
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/find_point.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.m	(revision 12997)
+@@ -0,0 +1,81 @@
++function bool=SegIntersect(seg1,seg2)
++%SEGINTERSECT - test of segments intersection
++%
++%   return 1 if the two segments intersect
++%   seg1=[x1 y1; x2 y2]
++%   seg2=[x1 y1; x2 y2]
++%
++%   Usage:
++%      bool=SegIntersect(seg1,seg2)
++
++bool=1;
++
++xA=seg1(1,1); yA=seg1(1,2);
++xB=seg1(2,1); yB=seg1(2,2);
++xC=seg2(1,1); yC=seg2(1,2);
++xD=seg2(2,1); yD=seg2(2,2);
++
++O2A=[xA;yA]-[xD/2+xC/2;yD/2+yC/2];
++O2B=[xB;yB]-[xD/2+xC/2;yD/2+yC/2];
++O1C=[xC;yC]-[xA/2+xB/2;yB/2+yA/2];
++O1D=[xD;yD]-[xA/2+xB/2;yB/2+yA/2];
++
++n1=[yA-yB;xB-xA]; %normal vector to segA
++n2=[yC-yD;xD-xC]; %normal vectot to segB
++
++test1=n2'*O2A;
++test2=n2'*O2B;
++
++if test1*test2>0
++	bool=0;
++	return;
++end
++
++test3=n1'*O1C;
++test4=n1'*O1D;
++
++if test3*test4>0
++	bool=0;
++	return;
++end
++
++%if colinear
++if test1*test2==0 & test3*test4==0 & det([n1 n2])==0
++
++	%projection on the axis O1O2
++	O2O1=[xA/2+xB/2;yB/2+yA/2]-[xD/2+xC/2;yD/2+yC/2];
++	O1A=O2O1'*(O2A-O2O1);
++	O1B=O2O1'*(O2B-O2O1);
++	O1C=O2O1'*O1C;
++	O1D=O2O1'*O1D;
++	
++	%test if one point is included in the other segment (->bool=1)
++	if (O1C-O1A)*(O1D-O1A)<0
++		bool=1;
++		return;
++	end
++	if (O1C-O1B)*(O1D-O1B)<0
++		bool=1;
++		return;
++	end
++	if (O1A-O1C)*(O1B-O1C)<0
++		bool=1;
++		return;
++	end
++	if (O1A-O1D)*(O1B-O1D)<0
++		bool=1;
++		return;
++	end
++
++	 %test if the 2 segments have the same middle (->bool=1)
++	if O2O1==0
++		bool=1;
++		return;
++	end
++
++	%else
++	bool=0;
++	return;
++
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/FlagElements.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/FlagElements.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/FlagElements.py	(revision 12997)
+@@ -0,0 +1,62 @@
++import numpy
++import os
++#from basinzoom import *
++#from ContourToMesh import *
++from MatlabFuncs import *
++
++def FlagElements(md,region):
++	"""
++	FLAGELEMENTS - flag the elements in an region
++
++	   The region can be given with an exp file, a list of elements.
++
++	   Usage: 
++	      flag=FlagElements(md,region);
++
++	   Example:
++	      flag=FlagElements(md,'all');
++	      flag=FlagElements(md,'');
++	      flag=FlagElements(md,'Domain.exp');
++	      flag=FlagElements(md,'~Domain.exp');
++	      flag=FlagElements(md,md.mask.elementongroundedice);
++	"""
++
++	if   isinstance(region,str):
++		if   not region:
++			flag=numpy.zeros(md.mesh.numberofelements,'bool')
++			invert=0
++		elif strcmpi(region,'all'):
++			flag=numpy.ones(md.mesh.numberofelements,'bool')
++			invert=0
++		else:
++			#make sure that we actually don't want the elements outside the domain outline!
++			if strcmpi(region[0],'~'):
++				region=region[1:]
++				invert=1
++			else:
++				invert=0
++
++			#does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
++			if not os.path.exists(region):
++				if len(region)>3 and not strcmp(region[-4:],'.exp'):
++					raise IOError("Error: File 'region' not found!" % region)
++				xlim,ylim=basinzoom('basin',region)
++				flag_nodes=numpy.logical_and(numpy.logical_and(md.mesh.x<xlim[1],md.mesh.x>xlim[0]),numpy.logical_and(md.mesh.y<ylim[1],md.mesh.y>ylim[0])).astype(float)
++				flag=numpy.prod(flag_nodes[md.mesh.elements],axis=1)
++			else:
++				#ok, flag elements
++				flag=ContourToMesh(md.mesh.elements[:,0:3],md.mesh.x,md.mesh.y,region,'element',1)
++
++		if invert:
++			flag=numpy.logical_not(flag)
++
++	elif isinstance(region,numpy.nparray) or isinstance(region,bool):
++		if not numpy.size(region,0)==md.mesh.numberofelements:
++			raise TypeError("Flaglist for region must be of same size as number of elements in model.")
++		flag=region
++
++	else:
++		raise TypeError("Invalid region option")
++
++	return flag
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ElementsFromEdge.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ElementsFromEdge.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ElementsFromEdge.m	(revision 12997)
+@@ -0,0 +1,15 @@
++function edgeelements=ElementsFromEdge(elements,A,B) 
++%ELEMENTSFROMEDGE: find elements connected to one edge defined by nodes A and B
++%
++% Usage: edgeelements=ElementsFromEdge(elements,A,B) 
++%
++% Eg:    edgeelements=ElementsFromEdge(md.mesh.elements,tip1,tip2)
++%
++%
++edgeelements=find(...
++(elements(:,1)==A & elements(:,2)==B )| ...
++(elements(:,1)==A & elements(:,3)==B )| ...
++(elements(:,2)==A & elements(:,3)==B )| ...
++(elements(:,2)==A & elements(:,1)==B )| ...
++(elements(:,3)==A & elements(:,1)==B )| ...
++(elements(:,3)==A & elements(:,2)==B ));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/MergeMetrics.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/MergeMetrics.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/MergeMetrics.m	(revision 12997)
+@@ -0,0 +1,15 @@
++function metric=MergeMetrics(metric1,metric2)
++
++M1xx=metric1(:,1); M1xy=metric1(:,2); M1yy=metric1(:,3);
++M1lambda1=0.5*((M1xx+M1yy)+sqrt(4*M1xy.^2+(M1xx-M1yy).^2));
++M1lambda2=0.5*((M1xx+M1yy)-sqrt(4*M1xy.^2+(M1xx-M1yy).^2));
++lambda1=min(M1lambda1,M1lambda2);
++
++M2xx=metric1(:,1); M2xy=metric1(:,2); M2yy=metric1(:,3);
++M2lambda1=0.5*((M2xx+M2yy)+sqrt(4*M2xy.^2+(M2xx-M2yy).^2));
++M2lambda2=0.5*((M2xx+M2yy)-sqrt(4*M2xy.^2+(M2xx-M2yy).^2));
++lambda2=min(M2lambda2,M2lambda2);
++
++metric=metric1;
++pos=find(lambda2<lambda1);
++metric(pos,:)=metric2(pos,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/NodeInElement.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/NodeInElement.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/NodeInElement.m	(revision 12997)
+@@ -0,0 +1,41 @@
++function node_in_element=NodeInElement(newx,newy,elements,x,y,nodeconnectivity);
++%NODEINELEMENT: find for a list of nodes (in newx,newy), which elements in the mesh (elements,x,y) they belong to.
++%
++%  Usage: node_in_element=NodeInElement(newx,newy,elements,x,y,md.mesh.vertexconnectivity);
++%
++%  See also Nodeconnectivity
++%
++epsilon=10^-10;
++
++%compute some quantities that will speed up the process
++x3x1=x(elements(:,1))-x(elements(:,3));
++y3y1=y(elements(:,1))-y(elements(:,3));
++x3x2=x(elements(:,2))-x(elements(:,3));
++y3y2=y(elements(:,2))-y(elements(:,3));
++x3=x(elements(:,3));
++y3=y(elements(:,3));
++delta=x(elements(:,2)).*y(elements(:,3))-y(elements(:,2)).*x(elements(:,3))-x(elements(:,1)).*y(elements(:,3))+y(elements(:,1)).*x(elements(:,3))+x(elements(:,1)).*y(elements(:,2))-y(elements(:,1)).*x(elements(:,2));
++
++%max connectivity:
++max_connectivity=max(nodeconnectivity(:,end));
++node_in_element=zeros(length(newx),max_connectivity+1); %last column is the number of elements to which the row node is connected.
++
++for i=1:length(newx),
++	x0=newx(i);
++	y0=newy(i);
++	
++	%first area coordinate
++	area_1=(y3y2.*(x0-x3)-x3x2.*(y0-y3))./delta;
++	%second area coordinate
++	area_2=(x3x1.*(y0-y3)-y3y1.*(x0-x3))./delta;
++	%third area coordinate
++	area_3=1-area_1-area_2;
++	
++	%get elements for which all area coordinates are positive (meaning (x0,y0) belongs to these elements
++	pos=find((area_1>=0-epsilon) & (area_2>=0-epsilon) & (area_3>=0-epsilon));
++
++	num_elements=length(pos);
++
++	node_in_element(i,1:num_elements)=pos;
++	node_in_element(i,end)=num_elements;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ComputeHessian.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ComputeHessian.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ComputeHessian.m	(revision 12997)
+@@ -0,0 +1,60 @@
++function hessian=ComputeHessian(index,x,y,field,type)
++%COMPUTEHESSIAN - compute hessian matrix from a field
++%
++%   Compute the hessian matrix of a given field
++%   return the three components Hxx Hxy Hyy
++%   for each element or each node
++%
++%   Usage:
++%      hessian=ComputeHessian(index,x,y,field,type)
++%
++%   Example:
++%      hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vel_obs,'node')
++
++%some variables
++numberofnodes=length(x);
++numberofelements=size(index,1);
++
++%some checks
++if length(field)~=numberofnodes & length(field)~=numberofelements,
++	error('ComputeHessian error message: the given field size not supported yet');
++end
++if strcmpi(type,'node') & strcmpi(type,'element'),
++	error('ComputeHessian error message: only ''node'' or ''element'' type supported yet');
++end
++
++%initialization
++line=index(:);
++linesize=3*numberofelements;
++
++%get areas and  nodal functions coefficients N(x,y)=alpha x + beta y + gamma 
++[alpha beta]=GetNodalFunctionsCoeff(index,x,y);
++areas=GetAreas(index,x,y);
++
++%comput weights that holds the volume of all the element holding the node i
++weights=sparse(line,ones(linesize,1),repmat(areas,3,1),numberofnodes,1);
++
++%compute field on nodes if on elements
++if length(field)==numberofelements,
++	field=sparse(line,ones(linesize,1),repmat(areas.*field,3,1),numberofnodes,1)./weights ;
++end
++
++%Compute gradient for each element
++grad_elx=sum(field(index).*alpha,2); 
++grad_ely=sum(field(index).*beta,2);
++
++%Compute gradient for each node (average of the elements around)
++gradx=sparse(line,ones(linesize,1),repmat(areas.*grad_elx,3,1),numberofnodes,1);
++grady=sparse(line,ones(linesize,1),repmat(areas.*grad_ely,3,1),numberofnodes,1);
++gradx=gradx./weights;
++grady=grady./weights;
++
++%Compute hessian for each element
++hessian=[sum(gradx(index).*alpha,2) sum(grady(index).*alpha,2) sum(grady(index).*beta,2)];
++
++if strcmpi(type,'node')
++	%Compute Hessian on the nodes (average of the elements around)
++	hessian=[sparse(line,ones(linesize,1),repmat(areas.*hessian(:,1),3,1),numberofnodes,1)./weights ...
++		sparse(line,ones(linesize,1),repmat(areas.*hessian(:,2),3,1),numberofnodes,1)./weights ...
++		sparse(line,ones(linesize,1),repmat(areas.*hessian(:,3),3,1),numberofnodes,1)./weights ];
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshread.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshread.m	(revision 12997)
+@@ -0,0 +1,41 @@
++function Struct=meshread(filename);
++
++%some checks
++if ~exist(filename),
++	error(['meshread error message: file ' filename ' not found!']);
++end
++
++fid=fopen(filename,'r');
++
++while (~feof(fid)),
++
++	A=fscanf(fid,'%s',1);
++
++	if strcmp(A,'MeshVersionFormatted');
++		Struct.Version=fscanf(fid,'%s',1);
++
++	elseif strcmp(A,'Dimension'),
++		Struct.Dimension=fscanf(fid,'%i',1);
++
++	elseif strcmp(A,'Vertices'),
++		Struct.nods=fscanf(fid,'%i',1);
++		A=fscanf(fid,'%f %f %f',[3 Struct.nods]);
++		Struct.x=A(1,:)';
++		Struct.y=A(2,:)';
++
++	elseif strcmp(A,'Triangles'),
++		Struct.nels=fscanf(fid,'%i',1);
++		A=fscanf(fid,'%i %i %i',[4 Struct.nels]);
++		Struct.index=A(1:3,:)';
++
++	elseif strcmp(A,'Quadrilaterals'),
++		Struct.nels=fscanf(fid,'%i',1);
++		A=fscanf(fid,'%i %i %i %i',[5 Struct.nels]);
++		Struct.index=A(1:4,:)';
++	else
++		%do nothing
++
++	end
++end
++
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetNodalFunctionsCoeff.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetNodalFunctionsCoeff.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetNodalFunctionsCoeff.m	(revision 12997)
+@@ -0,0 +1,56 @@
++function [alpha beta varargout]=GetNodalFunctionsCoeff(index,x,y)
++%GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
++%
++%   Compute the coefficients alpha beta and optionaly gamma of
++%   2d triangular elements. For each element, the nodal function
++%   is defined as:
++%   N(x,y)=sum(i=1:3) alpha_i * x + beta_i * y + gamma_i
++%
++%   Usage:
++%      [alpha beta]=GetNodalFunctionsCoeff(index,x,y);
++%      [alpha beta gamma]=GetNodalFunctionsCoeff(index,x,y);
++%
++%   Example:
++%      [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
++
++%make columns out of x and y
++x=x(:); y=y(:);
++
++%get nels and nods
++nels=size(index,1);
++nods=length(x);
++
++%some checks
++if nargin~=3 | (nargout~=2 & nargout~=3),
++	help GetNodalFunctionsCoeff
++	error('GetNodalFunctionsCoeff error message: bad usage')
++end
++if length(y)~=nods,
++	error('GetNodalFunctionsCoeff error message: x and y do not have the same length')
++end
++if max(index(:))>nods,
++	error(['GetNodalFunctionsCoeff error message: index should not have values above ' num2str(nods) ])
++end
++if size(index,2)~=3,
++	error('GetNodalFunctionsCoeff error message: only 2d meshes supported. index should have 3 columns.')
++end
++
++%initialize output
++alpha=zeros(nels,3);
++beta=zeros(nels,3);
++
++%compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
++x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
++y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
++invdet=1./(x1.*(y2-y3)-x2.*(y1-y3)+x3.*(y1-y2));
++
++%get alpha and beta
++alpha=[invdet.*(y2-y3) invdet.*(y3-y1) invdet.*(y1-y2)];
++beta =[invdet.*(x3-x2) invdet.*(x1-x3) invdet.*(x2-x1)];
++
++%get gamma if requested
++if nargout==3,
++	gamma=zeros(nels,3);
++	gamma=[invdet.*(x2.*y3-x3.*y2) invdet.*(y1.*x3-y3.*x1) invdet.*(x1.*y2-x2.*y1)];
++	varargout{1}=gamma;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/intersections.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/intersections.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/intersections.m	(revision 12997)
+@@ -0,0 +1,279 @@
++function [x0,y0,iout,jout] = intersections(x1,y1,x2,y2,robust)
++%INTERSECTIONS Intersections of curves.
++%   Computes the (x,y) locations where two curves intersect.  The curves
++%   can be broken with NaNs or have vertical segments.
++%
++% Example:
++%   [X0,Y0] = intersections(X1,Y1,X2,Y2,ROBUST);
++%
++% where X1 and Y1 are equal-length vectors of at least two points and
++% represent curve 1.  Similarly, X2 and Y2 represent curve 2.
++% X0 and Y0 are column vectors containing the points at which the two
++% curves intersect.
++%
++% ROBUST (optional) set to 1 or true means to use a slight variation of the
++% algorithm that might return duplicates of some intersection points, and
++% then remove those duplicates.  The default is true, but since the
++% algorithm is slightly slower you can set it to false if you know that
++% your curves don't intersect at any segment boundaries.  Also, the robust
++% version properly handles parallel and overlapping segments.
++%
++% The algorithm can return two additional vectors that indicate which
++% segment pairs contain intersections and where they are:
++%
++%   [X0,Y0,I,J] = intersections(X1,Y1,X2,Y2,ROBUST);
++%
++% For each element of the vector I, I(k) = (segment number of (X1,Y1)) +
++% (how far along this segment the intersection is).  For example, if I(k) =
++% 45.25 then the intersection lies a quarter of the way between the line
++% segment connecting (X1(45),Y1(45)) and (X1(46),Y1(46)).  Similarly for
++% the vector J and the segments in (X2,Y2).
++%
++% You can also get intersections of a curve with itself.  Simply pass in
++% only one curve, i.e.,
++%
++%   [X0,Y0] = intersections(X1,Y1,ROBUST);
++%
++% where, as before, ROBUST is optional.
++
++% Version: 1.10, 25 February 2008
++% Author:  Douglas M. Schwarz
++% Email:   dmschwarz=ieee*org, dmschwarz=urgrad*rochester*edu
++% Real_email = regexprep(Email,{'=','*'},{'@','.'})
++
++
++% Theory of operation:
++%
++% Given two line segments, L1 and L2,
++%
++%   L1 endpoints:  (x1(1),y1(1)) and (x1(2),y1(2))
++%   L2 endpoints:  (x2(1),y2(1)) and (x2(2),y2(2))
++%
++% we can write four equations with four unknowns and then solve them.  The
++% four unknowns are t1, t2, x0 and y0, where (x0,y0) is the intersection of
++% L1 and L2, t1 is the distance from the starting point of L1 to the
++% intersection relative to the length of L1 and t2 is the distance from the
++% starting point of L2 to the intersection relative to the length of L2.
++%
++% So, the four equations are
++%
++%    (x1(2) - x1(1))*t1 = x0 - x1(1)
++%    (x2(2) - x2(1))*t2 = x0 - x2(1)
++%    (y1(2) - y1(1))*t1 = y0 - y1(1)
++%    (y2(2) - y2(1))*t2 = y0 - y2(1)
++%
++% Rearranging and writing in matrix form,
++%
++%  [x1(2)-x1(1)       0       -1   0;      [t1;      [-x1(1);
++%        0       x2(2)-x2(1)  -1   0;   *   t2;   =   -x2(1);
++%   y1(2)-y1(1)       0        0  -1;       x0;       -y1(1);
++%        0       y2(2)-y2(1)   0  -1]       y0]       -y2(1)]
++%
++% Let's call that A*T = B.  We can solve for T with T = A\B.
++%
++% Once we have our solution we just have to look at t1 and t2 to determine
++% whether L1 and L2 intersect.  If 0 <= t1 < 1 and 0 <= t2 < 1 then the two
++% line segments cross and we can include (x0,y0) in the output.
++%
++% In principle, we have to perform this computation on every pair of line
++% segments in the input data.  This can be quite a large number of pairs so
++% we will reduce it by doing a simple preliminary check to eliminate line
++% segment pairs that could not possibly cross.  The check is to look at the
++% smallest enclosing rectangles (with sides parallel to the axes) for each
++% line segment pair and see if they overlap.  If they do then we have to
++% compute t1 and t2 (via the A\B computation) to see if the line segments
++% cross, but if they don't then the line segments cannot cross.  In a
++% typical application, this technique will eliminate most of the potential
++% line segment pairs.
++
++
++% Input checks.
++error(nargchk(2,5,nargin))
++
++% Adjustments when fewer than five arguments are supplied.
++switch nargin
++	case 2
++		robust = true;
++		x2 = x1;
++		y2 = y1;
++		self_intersect = true;
++	case 3
++		robust = x2;
++		x2 = x1;
++		y2 = y1;
++		self_intersect = true;
++	case 4
++		robust = true;
++		self_intersect = false;
++	case 5
++		self_intersect = false;
++end
++
++% x1 and y1 must be vectors with same number of points (at least 2).
++if sum(size(x1) > 1) ~= 1 || sum(size(y1) > 1) ~= 1 || ...
++		length(x1) ~= length(y1)
++	error('X1 and Y1 must be equal-length vectors of at least 2 points.')
++end
++% x2 and y2 must be vectors with same number of points (at least 2).
++if sum(size(x2) > 1) ~= 1 || sum(size(y2) > 1) ~= 1 || ...
++		length(x2) ~= length(y2)
++	error('X2 and Y2 must be equal-length vectors of at least 2 points.')
++end
++
++
++% Force all inputs to be column vectors.
++x1 = x1(:);
++y1 = y1(:);
++x2 = x2(:);
++y2 = y2(:);
++
++% Compute number of line segments in each curve and some differences we'll
++% need later.
++n1 = length(x1) - 1;
++n2 = length(x2) - 1;
++xy1 = [x1 y1];
++xy2 = [x2 y2];
++dxy1 = diff(xy1);
++dxy2 = diff(xy2);
++
++% Determine the combinations of i and j where the rectangle enclosing the
++% i'th line segment of curve 1 overlaps with the rectangle enclosing the
++% j'th line segment of curve 2.
++[i,j] = find(repmat(min(x1(1:end-1),x1(2:end)),1,n2) <= ...
++	repmat(max(x2(1:end-1),x2(2:end)).',n1,1) & ...
++	repmat(max(x1(1:end-1),x1(2:end)),1,n2) >= ...
++	repmat(min(x2(1:end-1),x2(2:end)).',n1,1) & ...
++	repmat(min(y1(1:end-1),y1(2:end)),1,n2) <= ...
++	repmat(max(y2(1:end-1),y2(2:end)).',n1,1) & ...
++	repmat(max(y1(1:end-1),y1(2:end)),1,n2) >= ...
++	repmat(min(y2(1:end-1),y2(2:end)).',n1,1));
++
++% For one segment in x1,y1, i and j are returned as row vectors.  They
++% need to be column vectors, or iout and jout below will err out.
++% (jes, 6/11/10)
++
++if (size(i,1) == 1)
++    i=i';
++end
++if (size(j,1) == 1)
++    j=j';
++end
++
++% Find segments pairs which have at least one vertex = NaN and remove them.
++% This line is a fast way of finding such segment pairs.  We take
++% advantage of the fact that NaNs propagate through calculations, in
++% particular subtraction (in the calculation of dxy1 and dxy2, which we
++% need anyway) and addition.
++% At the same time we can remove redundant combinations of i and j in the
++% case of finding intersections of a line with itself.
++if self_intersect
++	remove = isnan(sum(dxy1(i,:) + dxy2(j,:),2)) | j <= i + 1;
++else
++	remove = isnan(sum(dxy1(i,:) + dxy2(j,:),2));
++end
++i(remove) = [];
++j(remove) = [];
++
++% Initialize matrices.  We'll put the T's and B's in matrices and use them
++% one column at a time.  AA is a 3-D extension of A where we'll use one
++% plane at a time.
++n = length(i);
++T = zeros(4,n);
++AA = zeros(4,4,n);
++AA([1 2],3,:) = -1;
++AA([3 4],4,:) = -1;
++AA([1 3],1,:) = dxy1(i,:).';
++AA([2 4],2,:) = dxy2(j,:).';
++B = -[x1(i) x2(j) y1(i) y2(j)].';
++
++% Loop through possibilities.  Trap singularity warning and then use
++% lastwarn to see if that plane of AA is near singular.  Process any such
++% segment pairs to determine if they are colinear (overlap) or merely
++% parallel.  That test consists of checking to see if one of the endpoints
++% of the curve 2 segment lies on the curve 1 segment.  This is done by
++% checking the cross product
++%
++%   (x1(2),y1(2)) - (x1(1),y1(1)) x (x2(2),y2(2)) - (x1(1),y1(1)).
++%
++% If this is close to zero then the segments overlap.
++
++% If the robust option is false then we assume no two segment pairs are
++% parallel and just go ahead and do the computation.  If A is ever singular
++% a warning will appear.  This is faster and obviously you should use it
++% only when you know you will never have overlapping or parallel segment
++% pairs.
++
++if robust
++	overlap = false(1,n);
++	warning_state = warning('off','MATLAB:singularMatrix');
++	% Use try-catch to guarantee original warning state is restored.
++	try
++		lastwarn('')
++		for k = 1:n
++			T(:,k) = AA(:,:,k)\B(:,k);
++			[unused,last_warn] = lastwarn;
++			lastwarn('')
++			if strcmp(last_warn,'MATLAB:singularMatrix')
++				% Force in_range(k) to be false.
++				T(1,k) = NaN;
++				% Determine if these segments overlap or are just parallel.
++				overlap(k) = rcond([dxy1(i(k),:);xy2(j(k),:) - xy1(i(k),:)]) < eps;
++			end
++		end
++		warning(warning_state)
++	catch
++		warning(warning_state)
++		rethrow(lasterror)
++	end
++	% Find where t1 and t2 are between 0 and 1 and return the corresponding
++	% x0 and y0 values.
++	in_range = T(1,:) >= 0 & T(2,:) >= 0 & T(1,:) <= 1 & T(2,:) <= 1;
++	% For overlapping segment pairs the algorithm will return an
++	% intersection point that is at the center of the overlapping region.
++	if any(overlap)
++		ia = i(overlap);
++		ja = j(overlap);
++		% set x0 and y0 to middle of overlapping region.
++		T(3,overlap) = (max(min(x1(ia),x1(ia+1)),min(x2(ja),x2(ja+1))) + ...
++			min(max(x1(ia),x1(ia+1)),max(x2(ja),x2(ja+1)))).'/2;
++		T(4,overlap) = (max(min(y1(ia),y1(ia+1)),min(y2(ja),y2(ja+1))) + ...
++			min(max(y1(ia),y1(ia+1)),max(y2(ja),y2(ja+1)))).'/2;
++		selected = in_range | overlap;
++	else
++		selected = in_range;
++	end
++	xy0 = T(3:4,selected).';
++	
++	% Remove duplicate intersection points.
++	[xy0,index] = unique(xy0,'rows');
++	x0 = xy0(:,1);
++	y0 = xy0(:,2);
++	
++	% Compute how far along each line segment the intersections are.
++	if nargout > 2
++		sel_index = find(selected);
++		sel = sel_index(index);
++		iout = i(sel) + T(1,sel).';
++		jout = j(sel) + T(2,sel).';
++	end
++else % non-robust option
++	for k = 1:n
++		[L,U] = lu(AA(:,:,k));
++		T(:,k) = U\(L\B(:,k));
++	end
++	
++	% Find where t1 and t2 are between 0 and 1 and return the corresponding
++	% x0 and y0 values.
++	in_range = T(1,:) >= 0 & T(2,:) >= 0 & T(1,:) < 1 & T(2,:) < 1;
++	x0 = T(3,in_range).';
++	y0 = T(4,in_range).';
++	
++	% Compute how far along each line segment the intersections are.
++	if nargout > 2
++		iout = i(in_range) + T(1,in_range).';
++		jout = j(in_range) + T(2,in_range).';
++	end
++end
++
++% Plot the results (useful for debugging).
++% plot(x1,y1,x2,y2,x0,y0,'ok');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCallFromMetric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCallFromMetric.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCallFromMetric.m	(revision 12997)
+@@ -0,0 +1,65 @@
++function md=BamgCallFromMetric(md,metric,gradation),
++%BAMGCALL - call bam
++%
++%   call Bamg and the output mesh is plugged onto the model
++%   -gradation = maximum edge length gradation between 2 elements
++%
++%   Usage:
++%      md=BamgCallFromMetric(md,metric,gradation);
++%
++%   Example:
++%      md=BamgCall(md,metric,1500,10^8,1.3,0.9);
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%write files
++t1=clock; fprintf('%s','      writing initial mesh files...');
++fid=fopen('carre0.met','w');
++fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
++fprintf(fid,'%i %i %i\n',metric');
++fclose(fid);
++
++fid=fopen('carre0.mesh','w');
++
++%initialiation
++fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
++
++%dimension
++fprintf(fid,'\n%s\n%i\n','Dimension',2);
++
++%Vertices
++fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
++fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
++
++%Triangles
++fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
++fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
++numberofelements1=md.mesh.numberofelements;
++
++%close
++fclose(fid);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%call bamg
++fprintf('%s\n','      call Bamg...');
++system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
++
++%plug new mesh
++t1=clock; fprintf('\n%s','      reading final mesh files...');
++A=meshread('carre1.mesh');
++md.mesh.x=A.x;
++md.mesh.y=A.y;
++md.z=zeros(A.nods,1);
++md.mesh.elements=A.index;
++md.mesh.numberofvertices=A.nods;
++md.mesh.numberofelements=A.nels;
++numberofelements2=md.mesh.numberofelements;
++t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%display number of elements
++fprintf('\n%s %i','      inital number of elements:',numberofelements1);
++fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
++
++%clean up:
++system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetCharacteristicLength.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetCharacteristicLength.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetCharacteristicLength.m	(revision 12997)
+@@ -0,0 +1,45 @@
++function length=GetCharacteristicLength(index,x,y,varargin)
++%GETCHARACTERISTICLENGTH - compute characteristic length for a mesh
++%
++%   compute characteristic lengths of every element of a mesh.
++%
++%   Usage:
++%      length  =GetCharacteristicLength(index,x,y);
++%      length  =GetCharacteristicLength(index,x,y,z);
++%
++%   Examples:
++%      length  =GetCharacteristicLength(md.mesh.elements,md.mesh.x,md.mesh.y);
++%      length  =GetCharacteristicLength(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
++
++
++%get number of elements and number of nodes
++nels=size(index,1);
++nods=numel(x);
++
++%some checks
++if nargout~=1 | (nargin~=3 & nargin~=4),
++	help GetCharacteristicLength
++	error('GetCharacteristicLength error message: bad usage')
++end
++if ((numel(y)~=nods) | (nargin==4 & numel(z)~=nods)),
++	error('GetCharacteristicLength error message: x,y and z do not have the same length')
++end
++if max(index(:))>nods,
++	error(['GetCharacteristicLength error message: index should not have values above ' num2str(nods) ])
++end
++if (nargin==3 & size(index,2)~=3),
++	error('GetCharacteristicLength error message: index should have 3 columns for 2d meshes.')
++end
++if (nargin==4 & size(index,2)~=6),
++	error('GetCharacteristicLength error message: index should have 6 columns for 3d meshes.')
++end
++
++%get areas or volumes.
++areas=GetAreas(index,x,y,varargin{:});
++
++%for a 2d mesh: 
++if nargin==3,
++	length=sqrt(2*areas);
++else
++	error('not supported yet');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetAreas.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetAreas.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetAreas.m	(revision 12997)
+@@ -0,0 +1,51 @@
++function areas=GetAreas(index,x,y,varargin)
++%GETAREAS - compute areas or volumes of elements
++%
++%   compute areas of triangular elements or volumes 
++%   of pentahedrons
++%
++%   Usage:
++%      areas  =GetAreas(index,x,y);
++%      volumes=GetAreas(index,x,y,z);
++%
++%   Examples:
++%      areas  =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
++%      volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
++
++%get number of elements and number of nodes
++nels=size(index,1);
++nods=length(x);
++if nargin==4, z=varargin{1}; end
++
++%some checks
++if nargout~=1 | (nargin~=3 & nargin~=4),
++	help GetAreas
++	error('GetAreas error message: bad usage')
++end
++if ((length(y)~=nods) | (nargin==4 & length(z)~=nods)),
++	error('GetAreas error message: x,y and z do not have the same length')
++end
++if max(index(:))>nods,
++	error(['GetAreas error message: index should not have values above ' num2str(nods) ])
++end
++if (nargin==3 & size(index,2)~=3),
++	error('GetAreas error message: index should have 3 columns for 2d meshes.')
++end
++if (nargin==4 & size(index,2)~=6),
++	error('GetAreas error message: index should have 6 columns for 3d meshes.')
++end
++
++%initialization
++areas=zeros(nels,1);
++x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
++y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
++
++%compute the volume of each element
++if nargin==3,
++	%compute the surface of the triangle
++	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
++else
++	%V=area(triangle)*1/3(z1+z2+z3)
++	thickness=mean(z(index(:,4:6)),2)-mean(z(index(:,1:3)),2);
++	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1))).*thickness;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/isconnected.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/isconnected.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/isconnected.m	(revision 12997)
+@@ -0,0 +1,13 @@
++function flag=isconnected(elements,A,B)
++%ISCONNECTED: are two nodes connected by a triangulation?
++%
++%   Usage: flag=isconnected(elements,A,B)
++%
++%
++
++elements=ElementsFromEdge(elements,A,B);
++if isempty(elements),
++	flag=0;
++else
++	flag=1;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/argusmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/argusmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/argusmesh.m	(revision 12997)
+@@ -0,0 +1,96 @@
++function md=argusmesh(md,infile)
++%ARGUSMESH - load an Argus mesh onto a model
++%
++%   Convert an Argus mesh contained in a file into
++%   fields needed for the mesh in a model md.
++%
++%   Usage:
++%      md=argusmesh(md,infile)
++%
++%   Example:
++%     md=argusmesh(md,'TriMesh.exp')
++
++%some argument check: 
++if nargin~=2 | nargout~=1,
++	help argustomodel;
++	error('argustomodel error message: bad usage');
++end
++
++%determine root of infile: strip extension
++[a,root,b,c]=fileparts(infile);
++
++%inform user we start the script: 
++disp(['   Translating argus file ''' infile ''' into matlab model object']);
++
++%open infile: 
++fileid=fopen(infile,'r');
++if fileid==-1,
++	error(['Could not open file ' infile  ' for reading']);
++end
++
++%Read first line of the argus mesh: node and element parameters
++[buffer,bytecount]=fscanf(fileid,'%i %i %i %i',[1 4]);
++if bytecount~=4, 
++	error(['Problem reading ' infile ' file at line #1']);
++end
++nel=buffer(1);
++nods=buffer(2);
++num_element_parameters=buffer(3);
++num_node_parameters=buffer(4);
++disp(['      argus model '''   root ''' contains ' num2str(nel) ' elements and ' num2str(nods) ' nodes.']);
++
++%initialize elements and nodes
++elements=zeros(nel,3);
++element_parameters=zeros(nel,num_element_parameters);
++x=zeros(nods,1);
++y=zeros(nods,1);
++z=zeros(nods,1);
++node_parameters=zeros(nods,num_node_parameters);
++
++%read nodes:
++format_string='%s %i %f %f ';
++for n=1:num_node_parameters,
++	format_string=[format_string ' %i '];
++end
++
++for n=1:nods,
++	[buffer,bytecount]=fscanf(fileid,format_string,[1,num_node_parameters+4]);
++	x(n)=buffer(3);
++	y(n)=buffer(4);
++	node_parameters(n,:)=buffer(5:length(buffer));
++end
++
++%read elements: 
++format_string='%s %i %i %i %i';
++for n=1:num_element_parameters,
++	format_string=[format_string ' %i '];
++end
++for n=1:nel,
++	[buffer,bytecount]=fscanf(fileid,format_string,[1,num_element_parameters+5]);
++	elements(n,:)=buffer(3:5);
++	element_parameters(n,:)=buffer(6:length(buffer));
++end
++
++%Create a name and a note for this model: 
++notes=['Model created by Argus from input file: ' infile ' and parameter file: ' root '.par on: ' date];
++name=root;
++
++%Finally, use model constructor to build a complete model: 
++md.mesh.elements=elements;
++md.mesh.x=x;
++md.mesh.y=y;
++md.z=z;
++md.mesh.numberofvertices=size(md.mesh.x,1);
++md.mesh.numberofelements=size(md.mesh.elements,1);
++md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
++md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
++md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
++md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
++md.mesh.dimension=2;
++md=addnote(md,notes);
++
++%Add segments and nodes on boundary
++md.mesh.segments=findsegments(md);
++md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonboundary(md.mesh.segments(:,1))=1;
++md.mesh.vertexonboundary(md.mesh.segments(:,2))=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCall.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCall.m	(revision 12997)
+@@ -0,0 +1,84 @@
++function md=BamgCall(md,field,hmin,hmax,gradation,epsilon),
++%BAMGCALL - call bam
++%
++%   build a metric using the Hessian of the given field
++%   call Bamg and the output mesh is plugged onto the model
++%   -hmin = minimum edge length (m)
++%   -hmax = maximum edge length (m)
++%   -gradation = maximum edge length gradation between 2 elements
++%   -epsilon = average error on each element (m/yr)
++%
++%   Usage:
++%      md=BamgCall(md,field,hmin,hmax,gradation,epsilon);
++%
++%   Example:
++%      md=BamgCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%Compute Hessian
++t1=clock; fprintf('%s','      computing Hessian...');
++hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%Compute metric
++t1=clock; fprintf('%s','      computing metric...');
++if length(md.nodeonwater)==md.mesh.numberofvertices,
++	pos=find(md.nodeonwater);
++else
++	pos=[];
++end
++metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%write files
++t1=clock; fprintf('%s','      writing initial mesh files...');
++fid=fopen('carre0.met','w');
++fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
++fprintf(fid,'%i %i %i\n',metric');
++fclose(fid);
++
++fid=fopen('carre0.mesh','w');
++
++%initialiation
++fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
++
++%dimension
++fprintf(fid,'\n%s\n%i\n','Dimension',2);
++
++%Vertices
++fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
++fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
++
++%Triangles
++fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
++fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
++numberofelements1=md.mesh.numberofelements;
++
++%close
++fclose(fid);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%call bamg
++fprintf('%s\n','      call Bamg...');
++system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
++
++%plug new mesh
++t1=clock; fprintf('\n%s','      reading final mesh files...');
++A=meshread('carre1.mesh');
++md.mesh.x=A.x;
++md.mesh.y=A.y;
++md.z=zeros(A.nods,1);
++md.mesh.elements=A.index;
++md.mesh.numberofvertices=A.nods;
++md.mesh.numberofelements=A.nels;
++numberofelements2=md.mesh.numberofelements;
++t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%display number of elements
++fprintf('\n%s %i','      inital number of elements:',numberofelements1);
++fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
++
++%clean up:
++system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/FixMesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/FixMesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/FixMesh.m	(revision 12997)
+@@ -0,0 +1,45 @@
++function  [index2 x2 y2 value2]=FixMesh(index,x,y,value)
++%FixMesh fix mesh with broken triangles, orphan vertices, etc ...
++%
++% Usage: 
++%            [index2 x2 y2 value2]=FixMesh(index,x,y,value)
++%            where index,x,y is a delaunay triangulation, 
++%                  value is a field on the input triangulation, with values at the vertices
++%                  index2,x2,y2,value2 is the repaired triangulation, with new values on new vertices
++%
++%
++
++%duplicate inputs
++index2=index;
++x2=x;
++y2=y;
++value2=value;
++
++%First, look for orphan vertices, and take them out.
++flags=zeros(length(x2),1); flags(index2)=1;
++orphans=find(flags==0);
++
++while ~isempty(orphans),
++
++	%take the first orphan, the lower numbered, and take it out
++	orphan=orphans(1);
++
++	%first x,y,value
++	x2(orphan)=[];
++	y2(orphan)=[];
++	value2(orphan)=[];
++
++	%now, the index:
++	pos=find(index2>orphan); index2(pos)=index2(pos)-1;
++	
++	%look again for orphans on new mesh
++	flags=zeros(length(x2),1);flags(index2)=1;
++	orphans=find(flags==0);
++end
++
++%Check all triangles are well oriented.
++aires=GetAreas(index2,x2,y2);
++pos=find(aires<0);
++temp=index2(pos,1);
++index2(pos,1)=index2(pos,2);
++index2(pos,2)=temp;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/roundmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/roundmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/roundmesh.m	(revision 12997)
+@@ -0,0 +1,34 @@
++function md=roundmesh(md,radius,resolution)
++%ROUNDMESH - create an unstructured round mesh 
++%
++%   This script will generate a structured round mesh
++%   - radius     : specifies the radius of the circle in meters
++%   - resolution : specifies the resolution in meters
++%
++%   Usage:
++%      md=roundmesh(md,radius,resolution)
++
++%First we have to create the domain outline 
++
++%Get number of points on the circle
++pointsonedge=floor((2*pi*radius) / resolution);
++
++%Calculate the cartesians coordinates of the points
++x_list=ones(pointsonedge,1); y_list=ones(pointsonedge,1);
++theta=(0:2*pi/pointsonedge:2*pi*(1-1/pointsonedge))';
++x_list=radius*x_list.*cos(theta);
++y_list=radius*y_list.*sin(theta);
++A=struct('x',x_list,'y',y_list,'density',1);
++expgen('RoundDomainOutline.exp',A,1);
++
++%Call Bamg
++md=triangle(md,'RoundDomainOutline.exp',resolution);
++%md=bamg(md,'domain','RoundDomainOutline.exp','hmin',resolution);
++
++%move the closest node to the center
++[mini pos]=min(md.mesh.x.^2+md.mesh.y.^2);
++md.mesh.x(pos)=0;
++md.mesh.y(pos)=0;
++
++%delete domain
++delete('RoundDomainOutline.exp')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ProfileProjectOntoMesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ProfileProjectOntoMesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ProfileProjectOntoMesh.m	(revision 12997)
+@@ -0,0 +1,66 @@
++function mesh_profile=ProfileProjectOntoMesh(md,profile)
++%PROFILEPROJECTONTOMESH: project a profile (made of arbitrary points) onto a mesh, so that we end 
++%                        up with a list of segments self contained onto elements.
++%
++% Usage: mesh_profile=ProfileProjectOntoMesh(md,profile)
++%
++% See also intersections.m
++
++%make a curve out of the mesh, to use the intersections routine.
++rows=[md.mesh.elements md.mesh.elements(:,1)]'; rows=rows(:);
++x=md.mesh.x(rows);
++y=md.mesh.y(rows);
++
++%[x0,y0] = intersections(profile.x,profile.y,x,y,1);
++[x0,y0,indices,j] = intersections(profile.x,profile.y,x,y);
++
++%  sort intersections to create segments in order and continuous along profile
++[indices,isort]=sort(indices);
++j =j (isort);
++x0=x0(isort);
++y0=y0(isort);
++
++%process x0,y0 so they do not include profile.x or profile.y
++processed_indices=[];
++processed_x=[];
++processed_y=[];
++for i=1:numel(indices),
++	if(((indices(i)-floor(indices(i)))~=0) && ((ceil(indices(i))-indices(i))~=0))
++		processed_indices=[processed_indices;floor(indices(i))];
++		processed_x=[processed_x;x0(i)];
++		processed_y=[processed_y;y0(i)];
++	end
++end
++
++%now merge profile.x,profile.y with processed_x,processed_y, at locations processed_indices:
++newx=profile.x;
++newy=profile.y;
++
++count=1;
++for i=1:numel(profile.x),
++	pos=find(processed_indices==i);
++	if ~isempty(pos),
++		newx=[newx(1:count); processed_x(pos); newx(count+1:end)];
++		newy=[newy(1:count); processed_y(pos); newy(count+1:end)];
++		count=count+length(pos)+1;
++	end
++end
++
++%now, for each node, figure out which element it belongs to.
++node_in_element=NodeInElement(newx,newy,md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.vertexconnectivity);
++
++% eliminate nodes that don't fall in any element
++% (profile may start and/or end externally and/or cross holes in the model)
++
++ind=find(node_in_element(:,9)>0);
++newx=newx(ind,:);
++newy=newy(ind,:);
++node_in_element=node_in_element(ind,:);
++
++mesh_profile=[newx(1:end-1) newy(1:end-1) newx(2:end) newy(2:end) zeros(length(newy(2:end)),1)];
++
++%find which element each segment belongs to.
++for i=1:length(newx)-1,
++	common=intersect(node_in_element(i,1:node_in_element(i,end)), node_in_element(i+1,1:node_in_element(i+1,end)));
++	mesh_profile(i,end)=common(1);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/YamsCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/YamsCall.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/YamsCall.m	(revision 12997)
+@@ -0,0 +1,104 @@
++function md=YamsCall(md,field,hmin,hmax,gradation,epsilon),
++%YAMSCALL - call yams
++%
++%   build a metric using the Hessian of the given field
++%   call Yams and the output mesh is plugged onto the model
++%   -hmin = minimum edge length (m)
++%   -hmax = maximum edge length (m)
++%   -gradation = maximum edge length gradation between 2 elements
++%   -epsilon = average error on each element (m/yr)
++%
++%   Usage:
++%      md=YamsCall(md,field,hmin,hmax,gradation,epsilon);
++%
++%   Example:
++%      md=YamsCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%Compute Hessian
++t1=clock; fprintf('%s','      computing Hessian...');
++hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%Compute metric
++t1=clock; fprintf('%s','      computing metric...');
++if length(md.mask.vertexonwater)==md.mesh.numberofvertices,
++	pos=find(md.mask.vertexonwater);
++else
++	pos=[];
++end
++metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%write files
++t1=clock; fprintf('%s','      writing initial mesh files...');
++save -ascii carre0.met  metric
++
++fid=fopen('carre0.mesh','w');
++
++%initialiation
++fprintf(fid,'\n%s\n%i\n','MeshVersionFormatted',1);
++
++%dimension
++fprintf(fid,'\n%s\n%i\n','Dimension',2);
++
++%Vertices
++fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
++fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y zeros(md.mesh.numberofvertices,1)]');
++
++%Triangles
++fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
++fprintf(fid,'%i %i %i %i\n',[md.mesh.elements zeros(md.mesh.numberofelements,1)]');
++numberofelements1=md.mesh.numberofelements;
++	
++%Deal with rifts
++if ~isnan(md.rifts.riftstruct),
++	
++	%we have the list of triangles that make up the rift. keep those triangles around during refinement.
++	triangles=[];
++	for i=1:size(md.rifts.riftstruct,1),
++		triangles=[triangles md.rifts(i).segments(:,3)'];
++	end
++
++	fprintf(fid,'\n\n%s\n%i\n\n','RequiredTriangles',length(triangles));
++	fprintf(fid,'%i\n',triangles);
++end
++
++%close
++fclose(fid);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%call yams
++fprintf('%s\n','      call Yams...');
++if ispc
++	%windows
++	system(['yams2-win -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
++elseif ismac
++	%Macosx
++	system(['yams2-osx -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
++else
++	%Linux
++	system(['yams2-linux -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
++end
++
++%plug new mesh
++t1=clock; fprintf('\n%s','      reading final mesh files...');
++Tria=load('carre1.tria');
++Coor=load('carre1.coor');
++md.mesh.x=Coor(:,1);
++md.mesh.y=Coor(:,2);
++md.mesh.z=zeros(size(Coor,1),1);
++md.mesh.elements=Tria;
++md.mesh.numberofvertices=size(Coor,1);
++md.mesh.numberofelements=size(Tria,1);
++numberofelements2=md.mesh.numberofelements;
++t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%display number of elements
++fprintf('\n%s %i','      inital number of elements:',numberofelements1);
++fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
++
++%clean up:
++system('rm carre0.mesh carre0.met carre1.tria carre1.coor carre1.meshb');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/MeshQuality.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/MeshQuality.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/MeshQuality.m	(revision 12997)
+@@ -0,0 +1,82 @@
++function quality=MeshQuality(md,epsilon,hmin,hmax);
++%MESHQUALITY - compute mesh quality
++%
++%   Usage:
++%      MeshQuality(md,epsilon,hmin,hmax);
++
++%Get some variables from the model
++index=md.mesh.elements;
++x=md.mesh.x;
++y=md.mesh.y;
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%Compute Hessian
++hessian=ComputeHessian(index,x,y,md.inversion.vel_obs,'node');
++
++%Compute metric
++if length(md.nodeonwater)==md.mesh.numberofvertices,
++	pos=find(md.nodeonwater);
++else
++	pos=[];
++end
++metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
++
++%Get Areas
++areas=GetAreas(index,x,y);
++
++%length edges vectors
++e1x=[x(index(:,2))-x(index(:,1))];
++e1y=[y(index(:,2))-y(index(:,1))];
++e2x=[x(index(:,3))-x(index(:,2))];
++e2y=[y(index(:,3))-y(index(:,2))];
++e3x=[x(index(:,1))-x(index(:,3))];
++e3y=[y(index(:,1))-y(index(:,3))];
++
++%metric of each the 3 nodes for each element
++M1=metric(index(:,1),:);
++M2=metric(index(:,2),:);
++M3=metric(index(:,3),:);
++
++%Get edge length in the metric
++L1=1/2*(sqrt(e2x.*(M2(:,1).*e2x+M2(:,2).*e2y)+e2y.*(M2(:,2).*e2x+M2(:,3).*e2y))+sqrt(e1x.*(M1(:,1).*e1x+M1(:,2).*e1y)+e1y.*(M1(:,2).*e1x+M1(:,3).*e1y)));
++L2=1/2*(sqrt(e3x.*(M3(:,1).*e3x+M3(:,2).*e3y)+e3y.*(M3(:,2).*e3x+M3(:,3).*e3y))+sqrt(e2x.*(M2(:,1).*e2x+M2(:,2).*e2y)+e2y.*(M2(:,2).*e2x+M2(:,3).*e2y)));
++L3=1/2*(sqrt(e1x.*(M1(:,1).*e1x+M1(:,2).*e1y)+e1y.*(M1(:,2).*e1x+M1(:,3).*e1y))+sqrt(e3x.*(M3(:,1).*e3x+M3(:,2).*e3y)+e3y.*(M3(:,2).*e3x+M3(:,3).*e3y)));
++
++%area in the metric
++V=1/3*areas.*(sqrt(M1(:,1).*M1(:,3)-M1(:,2).^2)+sqrt(M2(:,1).*M2(:,3)-M2(:,2).^2)+sqrt(M3(:,1).*M3(:,3)-M3(:,2).^2));
++
++%compute quality:
++quality=4*sqrt(3)*V./(L1+L2+L3);
++
++%compute error
++a=hessian(:,1); b=hessian(:,2); d=hessian(:,3);
++a=a(index)*[1;1;1]/3;
++b=b(index)*[1;1;1]/3;
++d=d(index)*[1;1;1]/3;
++lambda1=0.5*((a+d)+sqrt(4*b.^2+(a-d).^2));
++lambda2=0.5*((a+d)-sqrt(4*b.^2+(a-d).^2));
++lambda1=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
++lambda2=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
++if length(md.nodeonwater)==md.mesh.numberofvertices;
++	pos=find(md.nodeonwater);
++	lambda1(pos)=0;
++	lambda2(pos)=0;
++end
++lambda1=lambda1(index)*[1;1;1]/3;
++lambda2=lambda2(index)*[1;1;1]/3;
++
++lambdamax=max(lambda1,lambda2);
++hmax=max(max(sqrt(e1x.^2+e1y.^2),sqrt(e2x.^2+e2y.^2)),sqrt(e3x.^2+e3y.^2));
++epsilon=scale*hmax.^2.*lambdamax;
++
++%display
++%X=0:0.1:4; hist(quality,X); xlim([0 3]); title('mesh quality distribution','FontSize',14);
++%plotmodel(md,'data',epsilon,'title','Interpolation error','figure',2)
++disp(sprintf('\n%s','Mesh Quality'));
++disp(sprintf('   %s %g','Average Mesh quality: ',mean(quality)));
++disp(sprintf('   %s %g','Worst Element quality:',max(quality)));
++disp(sprintf('\n%s','Interpolation Error'));
++disp(sprintf('   %s %g %s','Average interpolation error:',mean(epsilon),'m/yr'));
++disp(sprintf('   %s %g %s','Maximum interpolation error:',max(epsilon),'m/yr'));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/squaremesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/squaremesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/squaremesh.m	(revision 12997)
+@@ -0,0 +1,78 @@
++function md=squaremesh(md,Lx,Ly,nx,ny)
++%SQUAREMESH - create a structured square mesh 
++%
++%   This script will generate a structured square mesh
++%   Lx and Ly are the dimension of the domain (in meters)
++%   nx anx ny are the number of nodes in the x and y direction
++%   The coordinates x and y returned are in meters.
++%
++%   Usage:
++%      [md]=squaremesh(md,Lx,Ly,nx,ny)
++
++%get number of elements and number of nodes
++nel=(nx-1)*(ny-1)*2;
++nods=nx*ny;
++
++%initialization
++segments=zeros(0,3);
++index=zeros(nel,3);
++x=zeros(nx*ny,1);
++y=zeros(nx*ny,1);
++
++%create coordinates
++for n=1:nx,
++	for m=1:ny,
++		x((n-1)*ny+m)=(n-1);
++		y((n-1)*ny+m)=(m-1);
++	end
++end
++
++%create index
++for n=1:(nx-1)
++	for m=1:(ny-1),
++		A=(n-1)*ny+m;
++		B=A+1;
++		C=n*ny+m;
++		D=C+1;
++		index((n-1)*(ny-1)*2+2*(m-1)+1,:)=[A C B];
++		index((n-1)*(ny-1)*2+2*m,:)=[B C D];
++	end
++end
++
++%Scale  x and y
++x=x/max(x)*Lx;
++y=y/max(y)*Ly;
++
++%create segments
++segments=zeros(2*(nx-1)+2*(ny-1),3);
++%left edge:
++segments(1:ny-1,:)=[[2:ny]' [1:ny-1]' 2*[1:ny-1]'-1];
++%right edge:
++segments(ny:2*(ny-1),:)=[[ny*(nx-1)+1:nx*ny-1]' [ny*(nx-1)+2:nx*ny]' 2*[(ny-1)*(nx-2)+1:(nx-1)*(ny-1)]'];
++%front edge:
++segments(2*(ny-1)+1:2*(ny-1)+(nx-1),:)=[[2*ny:ny:ny*nx]' [ny:ny:ny*(nx-1)]' [2*(ny-1):2*(ny-1):2*(nx-1)*(ny-1)]'];
++%back edge
++segments(2*(ny-1)+(nx-1)+1:2*(nx-1)+2*(ny-1),:)=[[1:ny:(nx-2)*ny+1]' [ny+1:ny:ny*(nx-1)+1]' [1:2*(ny-1):2*(nx-2)*(ny-1)+1]'];
++
++%plug coordinates and nodes
++md.mesh.x=x;
++md.mesh.y=y;
++md.mesh.z=zeros(nods,1);
++md.mesh.numberofvertices=nods;
++md.mesh.vertexonboundary=zeros(nods,1);md.mesh.vertexonboundary(segments(:,1:2))=1;
++md.mesh.vertexonbed=ones(nods,1);
++md.mesh.vertexonsurface=ones(nods,1);
++
++%plug elements
++md.mesh.elements=index;
++md.mesh.segments=segments;
++md.mesh.numberofelements=nel;
++md.mesh.elementonbed=ones(nel,1);
++md.mesh.elementonsurface=ones(nel,1);
++
++%Now, build the connectivity tables for this mesh.
++md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++
++%plug other field
++md.mesh.dimension=2;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifttipsonmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifttipsonmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifttipsonmesh.m	(revision 12997)
+@@ -0,0 +1,26 @@
++function tips=rifttipsonmesh(md,riftoutline)
++%RIFTTIPSONMESH: identify, using a rift outline, the nodes that are tips of 
++%                rifts.
++
++%read rifts from outline file
++rifts=expread(riftoutline,1);
++
++tips=[];
++
++for i=1:length(rifts),
++	rift=rifts(i);
++
++	x_tip=rift.x(1);
++	y_tip=rift.y(1);
++	
++	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
++	tips(end+1)=index;
++
++	x_tip=rift.x(end);
++	y_tip=rift.y(end);
++	
++	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
++	tips(end+1)=index;
++
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ComputeMetric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ComputeMetric.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/ComputeMetric.m	(revision 12997)
+@@ -0,0 +1,66 @@
++function metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos)
++%COMPUTEMETRIC - compute metric from an Hessian
++%
++%   Usage:
++%      metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos)
++%      pos is contains the positions where the metric is wished to be maximized (water?)
++%
++%   Example:
++%      metric=ComputeMetric(hessian,2/9,10^-1,100,10^5,find(md.nodeonwater)
++
++%first, find the eigen values of eah line of H=[hessian(i,1) hessian(i,2); hessian(i,2)  hessian(i,3)]
++a=hessian(:,1); b=hessian(:,2); d=hessian(:,3);
++lambda1=0.5*((a+d)+sqrt(4*b.^2+(a-d).^2));
++lambda2=0.5*((a+d)-sqrt(4*b.^2+(a-d).^2));
++pos1=find(lambda1==0);
++pos2=find(lambda2==0);
++pos3=find(b==0 & lambda1==lambda2);
++
++%Modify the eigen values to control the shape of the elements
++lambda1=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
++lambda2=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
++
++%compute eigen vectors
++norm1=sqrt(8*b.^2+2*(d-a).^2+2*(d-a).*sqrt((a-d).^2+4*b.^2));
++v1x=2*b./norm1;
++v1y=((d-a)+sqrt((a-d).^2+4*b.^2))./norm1;
++norm2=sqrt(8*b.^2+2*(d-a).^2-2*(d-a).*sqrt((a-d).^2+4*b.^2));
++v2x=2*b./norm2;
++v2y=((d-a)-sqrt((a-d).^2+4*b.^2))./norm2;
++
++v1x(pos3)=1; v1y(pos3)=0;
++v2x(pos3)=0; v2y(pos3)=1;
++
++%Compute new metric (for each node M=V*Lambda*V^-1)
++metric=full([(v1x.*v2y-v1y.*v2x).^(-1).*(lambda1.*v2y.*v1x-lambda2.*v1y.*v2x) ...
++	(v1x.*v2y-v1y.*v2x).^(-1).*(lambda1.*v1y.*v2y-lambda2.*v1y.*v2y) ...
++	(v1x.*v2y-v1y.*v2x).^(-1).*(-lambda1.*v2x.*v1y+lambda2.*v1x.*v2y)]);
++
++%some corrections for 0 eigen values
++metric(pos1,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos1),1);
++metric(pos2,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos2),1);
++
++%take care of water elements
++metric(pos,:)=repmat([1/hmax^2 0 1/hmax^2],length(pos),1);
++
++%take care of NaNs if any (use Matlab eig in a loop)
++[pos posj]=find(isnan(metric)); clear posj;
++if ~isempty(pos),
++	fprintf(' %i %s',length(pos),'NaN found in the metric. Use Matlab routine...');
++	for i=1:length(pos)
++		H=[hessian(pos(i),1) hessian(pos(i),2)
++		hessian(pos(i),2) hessian(pos(i),3)];
++		[u,v]=eig(full(H));
++		lambda1=v(1,1);
++		lambda2=v(2,2);
++		v(1,1)=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
++		v(2,2)=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
++
++		metricTria=u*v*u^(-1);
++		metric(pos(i),:)=[metricTria(1,1) metricTria(1,2) metricTria(2,2)];
++	end
++end
++
++if any(isnan(metric)),
++	error('ComputeMetric error message: NaN in the metric despite our efforts...')
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/ecco32issm.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/ecco32issm.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/ecco32issm.m	(revision 12997)
+@@ -0,0 +1,8 @@
++function nodefield=ecco32issm(field,transition,xecco3,yecco3)
++
++	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
++	nodefieldlinear=zeros(length(xecco3linear),1);
++	nodefieldlinear(transition(:,1))=field(transition(:,2));
++	nodefield=xecco3;
++	nodefield(:)=nodefieldlinear;
++	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/issm2ecco3.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/issm2ecco3.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/issm2ecco3.m	(revision 12997)
+@@ -0,0 +1,8 @@
++function nodefield=issm2ecco3(field,transition,xecco3,yecco3)
++
++	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
++	nodefieldlinear=zeros(length(xecco3linear),1);
++	nodefieldlinear(transition(:,1))=field(transition(:,2));
++	nodefield=xecco3;
++	nodefield(:)=nodefieldlinear;
++	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expremovestraightsegments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expremovestraightsegments.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expremovestraightsegments.m	(revision 12997)
+@@ -0,0 +1,31 @@
++function expremovestraightsegments(newfilename,filename,cutoff)
++%EXPREMOVESTRAIGHTSEGMENTS:  remove straight segments connecting contours.
++%
++% Usage: expremovestraightsegments('argus.exp',100); 
++%
++%
++
++a=expread(filename,1);
++newcontours=a(1);
++
++for i=1:length(a),
++	contour=a(i);
++	
++	s=sqrt(contour.x.^2+contour.y.^2);
++	d=diff(s);
++	
++	pos=find(abs(d)>cutoff);
++	pos=[0;pos;length(contour.x)];
++
++	for j=1:length(pos)-1,
++
++		newcontour=contour;
++		newcontour.x=contour.x(pos(j)+1:pos(j+1));
++		newcontour.y=contour.y(pos(j)+1:pos(j+1));
++		newcontour.nods=length(newcontour.x);
++		newcontours(end+1)=newcontour;
++	end
++end
++newcontours=newcontours(2:end);
++
++expwrite(newcontours,newfilename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expgen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expgen.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expgen.m	(revision 12997)
+@@ -0,0 +1,47 @@
++function expgen(file_name,contours,close_flag);
++%EXPGEN - create an Argus file from x and y arrays
++%
++%   Create .exp domain outline type out of x,y  coordinates. 
++%   The contour defined by arrays x and y should not be closed. 
++%   Generated domain outline will not be closed, except if close_flag is set to 1.
++%
++%   Usage:
++%      expgen(file_name,contours,close_flag)
++%
++%   See also EXPMASTER, EXPDOC
++
++%Check on inputs
++if((close_flag~=0) & (close_flag~=1)),
++error('close flag must be 0 of 1');
++end
++fid=fopen(file_name,'wt');
++
++for i=1:length(contours),
++	if(length(contours(i).x)~=length(contours(i).y)),
++	error('contours x and y coordinates must be of identical size');
++	end
++
++	%get density for this profile.
++	if isfield(contours,'density'),
++		density=contours(i).density;
++	end
++
++	fprintf(fid,'%s\n','## Name:');
++	fprintf(fid,'%s\n','## Icon:0');
++	fprintf(fid,'%s\n','# Points Count Value');
++	if(close_flag==0),
++	fprintf(fid,'%i %i\n',length(contours(i).x),density);
++	else
++	fprintf(fid,'%i %i\n',length(contours(i).x)+1,density);
++	end
++	fprintf(fid,'%s\n','# X pos Y pos');
++	for j=1:length(contours(i).x),
++	 fprintf(fid,'%f %f\n',contours(i).x(j),contours(i).y(j));
++	end  
++
++	if(close_flag==1),
++	fprintf(fid,'%f %f\n',contours(i).x(1),contours(i).y(1));
++	end
++	fprintf(fid,'%s\n','');
++end
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expxy2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expxy2ll.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expxy2ll.m	(revision 12997)
+@@ -0,0 +1,37 @@
++function expxy2ll(filename,sgn,central_meridian,standard_parallel)  
++%EXPLL2XY: switch exp argus file from lat,long to x,y
++%   Usage:
++%      expxy2ll(filename,sgn,central_meridian,standard_parallel)
++%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
++%                               -1 : south latitude (default is mer=0  lat=71)
++
++
++%Get central_meridian and standard_parallel depending on hemisphere
++if nargin==4,
++	delta = central_meridian;
++	slat  = standard_parallel;
++elseif nargin==2
++	if sgn == 1,
++		delta = 45; slat = 70;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++	elseif sgn==-1,
++		delta = 0;  slat = 71;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
++	else
++		error('Sign should be either +1 or -1');
++	end
++else
++	help expxy2ll
++	error('bad usage');
++end
++
++%read filename: 
++domain=expread(filename);
++
++%change to x,y: 
++for i=1:length(domain),
++	[domain(i).y domain(i).x]= xy2ll(domain(i).x,domain(i).y,sgn,delta,slat); %watch out to swap lat and long
++end
++
++%write back to filename: 
++expwrite(domain,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expll2xy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expll2xy.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expll2xy.m	(revision 12997)
+@@ -0,0 +1,37 @@
++function expll2xy(filename,sgn,central_meridian,standard_parallel)  
++%EXPLL2XY: switch exp argus file from lat,long to x,y
++%   Usage:
++%      expll2xy(filename,sgn,central_meridian,standard_parallel)
++%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
++%                               -1 : south latitude (default is mer=0  lat=71)
++
++
++%Get central_meridian and standard_parallel depending on hemisphere
++if nargin==4,
++	delta = central_meridian;
++	slat  = standard_parallel;
++elseif nargin==2
++	if sgn == 1,
++		delta = 45; slat = 70;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++	elseif sgn==-1,
++		delta = 0;  slat = 71;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
++	else
++		error('Sign should be either +1 or -1');
++	end
++else
++	help expll2xy
++	error('bad usage');
++end
++
++%read filename: 
++domain=expread(filename);
++
++%change to x,y: 
++for i=1:length(domain),
++	[domain(i).x domain(i).y]= ll2xy(domain(i).y,domain(i).x,sgn,delta,slat);
++end
++
++%write back to filename: 
++expwrite(domain,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/clicktoflowline.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/clicktoflowline.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/clicktoflowline.m	(revision 12997)
+@@ -0,0 +1,24 @@
++function clicktoflowline(index,x,y,u,v,filename)
++%CLICKTOFLOWLINE - create a flowline ARGUS file
++%
++%   create a flowline contour file (named 'filename') by clicking
++%   on a velocity field once (velocity must be plotted first)
++%
++%   Usage: 
++%      clicktoflowline(index,x,y,u,v,x0,y0,filename)
++%
++%   Example: 
++%      clicktoflowline(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vx_obs,md.inversion.vy_obs,'flowline.exp')
++
++%Get click position
++[x0,y0]=ginput(1);
++
++%Get flowline
++line=flowlines(index,x,y,u,v,x0,y0,200);
++
++%plot
++hold on
++plot(line.x,line.y,'r-');
++
++%Write argus file
++expwrite(line,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exptool.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exptool.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exptool.m	(revision 12997)
+@@ -0,0 +1,342 @@
++function exptool(newfile,varargin)
++%EXPMASTER - allow to create, modify, add, cut, .. segments of domain outline together
++%
++%   this routine is used to create, modify, cut,... an Argus file (.exp)
++%
++%   exptool(newprofile,'optionname',optionvalue)
++%      creation of an argus file newprofile
++%
++%   Available options:
++%      - include: include list of existing ARGUS files
++%      - color: line color (default='r')
++%      - selectioncolor: line color of selected profiles (default='b')
++%      - linestyle (default='-')
++%      - linewidth (default=0.2)
++%      - marker (default='+')
++%      - markersize (default=7)
++%      - markeredgecolor (default='r')
++%
++%   Usage:
++%      exptool(newfile,varargin)
++%
++%   Example:
++%      exptool('domain.exp','include',{'domain1.exp' 'domain2.exp'},'color','g','marker','+')
++%
++%   See also EXPDOC
++
++%recover options
++options=pairoptions(varargin{:});
++
++%Some checks
++if ~nargin | nargout
++	error('exptool usage: exptool(newfile,varargin)')
++elseif exist(newfile,'file'),
++	%recursive call to exptool if file already exists
++	if ~exist(options,'include'),
++		exptool(newfile,'include',newfile,varargin{:});
++		return;
++	end
++
++	%check modification
++	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
++	if ~strcmpi(choice,'y'),
++		disp('no modification done ... exiting');
++		return
++	end
++end
++
++%Add default options
++options=addfielddefault(options,'color','r');
++options=addfielddefault(options,'selectioncolor','b');
++options=addfielddefault(options,'LineStyle','-');
++options=addfielddefault(options,'LineWidth',0.2);
++options=addfielddefault(options,'Marker','+');
++options=addfielddefault(options,'MarkerSize',7);
++options=addfielddefault(options,'MarkerEdgeColor','r');
++
++%put all the argus profiles given in input in one structure A
++A=struct([]);
++numprofiles=0;
++numpoints=0;
++closed=[];
++
++%initialize the variables with files provided by 'include' option
++if exist(options,'include'),
++	files=getfieldvalue(options,'include');
++	if ischar(files), files={files}; end
++	for i=1:length(files),
++		filename=files{i};
++		if ~exist(filename,'file'),
++			error(['exptool error message:, ' filename ' does not exist. Exiting...']);
++		else
++			%read file
++			B=expread(filename);
++			%go through all profiles of B
++			for i=1:size(B,2)
++				%plug profile in A
++				if numprofiles
++					A(numprofiles+1)=B(i);
++				else
++					A=B(i);
++				end
++				%update numprofiles and numpoints
++				numpoints=numpoints+length(B(i).x);
++				numprofiles=numprofiles+1;
++				%figure out if the profile is closed or not
++				if (B(i).x(1)==B(i).x(end) & B(i).y(1)==B(i).y(end) & length(B(i).x)>1 )
++					closed(numprofiles)=1;
++				else
++					closed(numprofiles)=0;
++				end
++			end
++		end
++	end
++end
++
++%Get root of newfile
++[path root ext]=fileparts(newfile);
++
++%get current figure
++if ~isempty(get(0,'children')),%if there is already a figure (return the number of opened figures)
++	set(gcf,'Renderer','zbuffer'); %fixes a bug on Mac OS X (not needed in future Matlab version)
++	P=get(gcf,'position');
++	F=getframe(gca);
++	F=F.cdata;
++	%get current axis
++	xlim=get(gca,'Xlim');
++	ylim=get(gca,'Ylim');
++	%recreate x_m and y_m
++	x_m=linspace(xlim(1),xlim(2),size(F,2));
++	y_m=linspace(ylim(2),ylim(1),size(F,1)); %getframe reverse axis...
++	%plot the data in another figure
++	figure; set(gcf,'position',P);
++	imagesc(x_m,y_m,F); set(gca,'Ydir','normal');
++	prevplot=1;
++	prevplot2=1;
++else
++	figure
++	prevplot=0;
++	prevplot2=0;
++end
++
++%plot existing profile if any
++hold on
++
++%Build backup structre for do and redo
++backup=cell(1,3);
++backup{1,1}=A;
++backup{1,2}=numprofiles;
++backup{1,3}=numpoints;
++backup{1,4}=closed;
++
++loop=1;
++counter=1;
++while loop
++
++	%Go through A and rule out the empty profiles
++	list=[];
++	for i=1:size(A,2);
++		if length(A(i).x)==0
++			list(end+1)=i;
++			numprofiles=numprofiles-1;
++		end
++	end
++	A(list)=[];
++	closed(list)=[];
++
++	%Now erase all that have been done and plot the new structure A as it is
++	undoplots(prevplot);
++	if numprofiles
++		prevplot2=1;
++		for i=1:numprofiles
++			if length(A(i).x)==1,
++				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++					'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker','o');
++			else
++				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			end
++			prevplot2=prevplot2+1;
++		end
++	end
++
++	%display menu
++	title('Main Menu','FontSize',14);
++	button=menu('Menu','add a profile (open)',...%1
++		'add a contour (closed)',...              %2
++		'remove a profile',...                    %3
++		'modify the position of a point',...      %4
++		'add points inside a profile',...         %5
++		'add points at the end of a profile',...  %6
++		'remove points',...                       %7
++		'remove several points',...               %8
++		'cut a segment',...                       %9
++		'cut a large area',...                    %10
++		'merge profiles',...                      %11
++		'close profile',...                       %12
++		'undo',...                                %13
++		'redo',...                                %14
++		'quit');                                  %15
++
++
++	%UNDO??
++	if button==13;
++		if counter==1
++			disp('Already at oldest change');
++		else
++			counter=counter-1;
++			A=backup{counter,1};
++			numprofiles=backup{counter,2};
++			numpoints=backup{counter,3};
++			closed=backup{counter,4};
++		end
++	end
++
++	%REDO??
++	if button==14
++		if counter==size(backup,1)
++			disp('Already at newest change');
++		else
++			counter=counter+1;
++			A=backup{counter,1};
++			numprofiles=backup{counter,2};
++			numpoints=backup{counter,3};
++			closed=backup{counter,4};
++		end
++	end
++
++	switch button
++
++		case 1
++
++			[A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 2
++
++			[A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot2,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 3
++
++			[A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 4
++
++			[A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 5
++
++			[A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 6
++
++			[A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot2,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 7
++
++			[A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 8
++
++			[A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 9
++
++			[A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 10
++
++			[A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++		case 11
++
++			[A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++
++		case 12
++
++			[A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
++			%QUIT
++		case 15
++
++			loop=0;
++
++		otherwise
++
++			%do nothing
++
++	end
++
++end
++
++hold off
++
++%write contour using expwrite
++title('New file written, exiting...','FontSize',14);
++if isempty(A)
++	disp('Profile empty, no file written')
++else
++	expwrite(A,newfile);
++end
++
++%close window
++close;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcontract.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcontract.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcontract.m	(revision 12997)
+@@ -0,0 +1,34 @@
++function normal_node=expcontract(newfile,oldfile,distance)
++%EXPCONTRACT - contract or expand a profile, according to the normal.
++% 
++%   Usage:
++%      expcontract(newfile,oldfile,distance)
++%
++%   See also EXPMASTER, EXPDOC
++
++
++contour=expread(oldfile);
++num=numel(contour.x);
++
++normal=zeros(num-1,2);
++normal_node=zeros(num-1,2);
++
++for i=1:num-1,
++	normal(i,:)=[ contour.y(i)-contour.y(i+1) contour.x(i+1)-contour.x(i)];
++	normal(i,:)=normal(i,:)/sqrt(normal(i,1)^2+normal(i,2)^2);
++end
++
++normal_node(2:end,:)=[normal(1:end-1,:)+normal(2:end,:)];
++normal_node(1,:)=normal(1,:)+normal(end,:);
++
++normal_node_norm=sqrt(normal_node(:,1).^2+normal_node(:,2).^2);
++normal_node(:,1)=normal_node(:,1)./normal_node_norm;
++normal_node(:,2)=normal_node(:,2)./normal_node_norm;
++
++contour.x(1:end-1)=contour.x(1:end-1)+distance*normal_node(:,1);
++contour.y(1:end-1)=contour.y(1:end-1)+distance*normal_node(:,2);
++
++contour.x(end)=contour.x(1);
++contour.y(end)=contour.y(1);
++
++expwrite(contour,newfile);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecontour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecontour.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecontour.m	(revision 12997)
+@@ -0,0 +1,36 @@
++function expcreatecontour(filename);
++%EXPCREATECONTOUR - create a contour from a list of points
++%
++%   expcreatecontour: from a list of (x,y) points (retrieve using ginput on an undetermined
++%   number of points: used RETURN key to end input), create an Argus .exp 
++%   file holding the corresponding closed contour.
++%    
++%   Usage:
++%      expcreatecontour(filename)
++%
++%   See also EXPMASTER, EXPDOC
++
++%Get root of filename
++[path root ext ver]=fileparts(filename);
++
++%Get contour
++disp('Click on contour points you desire. Type RETURN to end input of points');
++[x,y]=ginputquick;
++
++%close contour
++x=[x;x(1)];
++y=[y;y(1);];
++
++%plot contour
++hold on;
++plot(x,y,'r-');
++
++%create structure for expwrite routine
++a.x=x;
++a.y=y;
++a.name=root;
++a.density=1;
++
++%write contour using expwrite
++expwrite(a,filename);
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecontour.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expwrite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expwrite.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expwrite.m	(revision 12997)
+@@ -0,0 +1,38 @@
++function expwrite(a,filename);
++%EXPWRITE - write an Argus file from a structure given in input
++%
++%   This routine write an Argus file form a structure containing the fields:
++%   x and y of the coordinates of the points.
++%   The first argument is the structure containing the points coordinates 
++%   and the second one the file to be write.
++%
++%   Usage:
++%      expwrite(a,filename)
++% 
++%   Example:
++%      expwrite(coordstruct,'domainoutline.exp')
++%
++%   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
++
++fid=fopen(filename,'w');
++for n=1:length(a),
++   
++   if isfield(a,'name'),
++	   if ~isempty(a(n).name),
++		   fprintf(fid,'%s%s\n','## Name:',a(n).name);
++	   else
++		   fprintf(fid,'%s\n','## Name:');
++	   end
++   else
++	   fprintf(fid,'%s\n','## Name:');
++   end
++   
++   fprintf(fid,'%s\n','## Icon:0');
++   fprintf(fid,'%s\n','# Points Count Value');
++   fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
++   fprintf(fid,'%s\n','# X pos Y pos');
++	fprintf(fid,'%10.10f %10.10f\n',[a(n).x a(n).y]');
++	fprintf(fid,'\n','');
++   
++end
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expread.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expread.m	(revision 12997)
+@@ -0,0 +1,81 @@
++function Struct=expread(filename);
++%EXPREAD - read a file exp and build a Structure
++%
++%   This routine reads a file .exp and build a Structure containing the 
++%   fields x and y corresponding to the coordinates, one for the filename of
++%   the exp file, for the density, for the nodes, and a field closed to 
++%   indicate if the domain is closed. 
++%   The first argument is the .exp file to be read and the second one (optional) 
++%   indicate if the last point shall be read (1 to read it, 0 not to).
++%
++%   Usage:
++%      Struct=expread(filename)
++%  
++%   Example:
++%      Struct=expread('domainoutline.exp')
++%      Struct=expread('domainoutline.exp')
++%
++%   See also EXPDOC, EXPWRITEASVERTICES
++
++%some checks
++if ~exist(filename),
++	error(['expread error message: file ' filename ' not found!']);
++end
++
++%initialize number of profile
++count=0;
++
++%open file
++fid=fopen(filename,'r');
++
++%loop over the number of profiles
++while (~feof(fid)),
++
++	%update number of profiles
++   count=count+1;
++
++   %Get file name
++	A=fscanf(fid,'%s %s',2);
++	if ~strncmp(A,'##Name:',7), break; end
++	if length(A)>7, 
++		Struct(count).name=A(8:end);
++	else
++		Struct(count).name='';
++	end
++
++	%Get Icon
++	A=fscanf(fid,'%s %s',2);
++	if ~strncmp(A,'##Icon:',6), break; end
++
++	%Get Info
++	A=fscanf(fid,'%s %s %s %s',4);
++	if ~strncmp(A,'#Points',7), break; end
++
++	%Get number of nods and density
++   A=fscanf(fid,'%f %f',[1 2]);
++   Struct(count).nods=A(1);
++   Struct(count).density=A(2);
++
++	%Get Info
++	A=fscanf(fid,'%s %s %s %s',5);
++	if ~strncmp(A,'#XposYpos',9), break; end
++
++	%Get Coordinates
++	A=fscanf(fid,'%f %f',[2 Struct(count).nods]);
++	Struct(count).x=A(1,:)';
++	Struct(count).y=A(2,:)';
++
++	if(Struct(count).nods~=length(Struct(count).x))error(['Profile ' num2str(count) ' reports incorrect length']); end;
++
++	%Check if closed
++	if (Struct(count).nods > 1) && ...
++	   (Struct(count).x(end) == Struct(count).x(1)) && ...
++	   (Struct(count).y(end) == Struct(count).y(1))
++		Struct(count).closed=true;
++	else
++		Struct(count).closed=false;
++	end
++end
++
++%close file
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile
++Makefile.in
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expexcludeoutliers.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expexcludeoutliers.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expexcludeoutliers.m	(revision 12997)
+@@ -0,0 +1,18 @@
++function excludeoutliers(newcontourname,contourname,domainname)
++%EXCLUDEOUTLIERS exclude points of contour that are not within the domain  contour. return new contours in a different file.
++%
++%        Usage: excludeoutliers('NewContour.exp','Contour.exp','DomainOutline.exp');
++%
++%
++%   See also EXPMASTER, EXPDOC
++
++
++contour=expread(contourname);
++
++for i=1:length(contour),
++	flags=ContourToNodes(contour(i).x,contour(i).y,domainname,0);
++	contour(i).x=contour(i).x(find(flags));
++	contour(i).y=contour(i).y(find(flags));
++end
++
++expwrite(contour,newcontourname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expboxgen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expboxgen.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expboxgen.m	(revision 12997)
+@@ -0,0 +1,99 @@
++function expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
++%EXPBOXGEN -  creates a domain outline box for a tiff image
++%
++%   This function creates a domain outline box for a .tif image for the 
++%   mosaic tiff. 
++%   x0,y0 and x1,y1 are the cropping coordinates (upper left and lower right 
++%   corners in the larger tiff image).
++%   paramter_filename is the parameter file name for the mosaic tiff image.
++%   box_filename is self explanatory.
++%
++%   Usage:
++%      expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
++%
++%   See also EXPMASTER, EXPDOC
++
++%initialize
++nrows=-1;
++ncols=-1;
++X0=-1;
++Y0=-1;
++posting=-1;
++
++%first recover necessary information from the paramter_filename.
++fid=fopen(parameter_filename,'r');
++count=1;
++while(1),
++tline=fgetl(fid);
++if ~isstr(tline), break; end;
++
++ind=findstr('ant125m',tline);
++if ~isempty(ind),
++a=strsplit(tline,' ');
++a=a(2); a=char(a); a=a(1:length(a)-1);
++posting=str2num(a);
++end
++
++
++ind=findstr('no. of rows   :',tline);
++if ~isempty(ind),
++a=strsplit(tline,' ');
++nrows=str2num(char(a(length(a))));
++end
++
++ind=findstr('no. of columns:',tline);
++if ~isempty(ind),
++a=strsplit(tline,' ');
++ncols=str2num(char(a(length(a))));
++end
++
++ind=findstr('Upper Left X:',tline);
++if ~isempty(ind),
++a=strsplit(tline,' ');
++X0=str2num(char(a(length(a))));
++end
++
++ind=findstr('Upper Left Y:',tline);
++if ~isempty(ind),
++a=strsplit(tline,' ');
++Y0=str2num(char(a(length(a))));
++end
++
++
++end %while(1),
++
++
++fclose(fid);
++
++if (X0==-1 | Y0==-1 | nrows==-1  | ncols==-1 | posting==-1),
++disp(' ');
++disp(['Could not recover all parameters from ' parameter_filename]);
++disp('Here are the paramters recovered thus far: ');
++disp(['no. of rows: ' num2str(nrows)]);
++disp(['no. of columns: ' num2str(ncols)]);
++disp(['Upper Left X: ' num2str(X0)]);
++disp(['Upper Left Y: ' num2str(Y0)]);
++disp(['Posting: ' num2str(posting)]);
++end
++
++disp(' ');
++disp(['Recovered the following parameters from ' parameter_filename]);
++disp(['no. of rows: ' num2str(nrows)]);
++disp(['no. of columns: ' num2str(ncols)]);
++disp(['Upper Left X: ' num2str(X0)]);
++disp(['Upper Left Y: ' num2str(Y0)]);
++disp(['Posting: ' num2str(posting)]);
++
++%Create X,Y, arrays of coordinates:
++X(1)=X0+x0*posting
++Y(1)=Y0-y0*posting
++X(2)=X(1);
++Y(2)=Y(1)-ny*posting;
++X(3)=X(1)+nx*posting;
++Y(3)=Y(2);
++Y(4)=Y(1);
++X(4)=X(3);
++plot(X,Y,'r*');
++
++%Create box exp file using X and Y. Loop it.
++expgen(box_filename,X,Y,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreateprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreateprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreateprofile.m	(revision 12997)
+@@ -0,0 +1,31 @@
++function expcreateprofile(filename);
++%EXPCREATEPROFILE - create an Argus file from a list of points
++%
++%   expcreateprofile: from a list of (x,y) points (retrieve using ginput on an undetermined
++%   number of points: used RETURN key to end input), create an Argus .exp 
++%   file holding the corresponding open profile.
++%    
++%   Usage:
++%      expcreateprofile(filename)
++%
++%   See also EXPMASTER, EXPDOC
++
++%Get root of filename
++[path root ext ver]=fileparts(filename);
++
++%Get profile
++disp('Click on profile points you desire. Type RETURN to end input of points');
++[x,y]=ginputquick;
++
++%plot contour
++hold on;
++plot(x,y,'r-');
++
++%create structure for expwrite routine
++a.x=x;
++a.y=y;
++a.name=root;
++a.density=1;
++
++%write profile using expwrite
++expwrite(a,filename);
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreateprofile.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/flowlines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/flowlines.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/flowlines.m	(revision 12997)
+@@ -0,0 +1,163 @@
++function flowpath=flowlines(index,x,y,u,v,x0,y0,varargin)
++%FLOWLINES - compute flowlines from a given set of seed points
++%
++%   Usage:
++%      flowpath=flowlines(index,x,y,u,v,x0,y0)
++%
++%   the velocity field is given by the couple (u,v) and the coordinates
++%   of the seed points are (x0,y0). One can use one or several seed 
++%   points
++%
++%   Example:
++%      flowpath=flowlines(md.mesh.elements,md.mesh.x,md.mesh.y,md.vx,md.initialization.vy,x0,y0)
++
++%check input size
++if nargin>8 | nargin<7,
++	help flowlines
++	error('flowlines error message: bad usage');
++end
++
++%check input
++if (length(x)~=length(y) | length(x)~=length(u) | length(x)~=length(v)),
++	error('flowlines error message: x,y,u and v must have the same length');
++end
++if length(x)<3,
++	error('flowlines error message: at least one element is required');
++end
++if length(x0)~=length(y0),
++	error('flowlines error message: x0 and y0 do not have the same length');
++end
++
++%get maxiter and precision
++if nargin==8
++	maxiter=varargin{1};
++else
++	maxiter=200; %maximum number of iterations
++end
++precision=1; %division of each segment (higer precision increases number of segments)
++
++%check seed points
++tria=TriaSearch(index,x,y,x0,y0);
++pos=find(isnan(tria));
++x0(pos)=[];
++y0(pos)=[];
++
++%initialize other variables
++N=length(x0);
++X=x0; Y=y0;
++flowpath=struct('x',cell(N,1),'y',cell(N,1),'name','','density',1);
++for i=1:N,
++	flowpath(i).x=x0(i);
++	flowpath(i).y=y0(i);
++end
++done=zeros(N,1);
++
++%get avegared length of each element
++length_tria=1/3*(sqrt( (x(index(:,1))-x(index(:,2))).^2+(y(index(:,1))-y(index(:,2))).^2 )+...
++	sqrt((x(index(:,1))-x(index(:,3))).^2+(y(index(:,1))-y(index(:,3))).^2 )+...
++	sqrt((x(index(:,2))-x(index(:,3))).^2+(y(index(:,2))-y(index(:,3))).^2 ));
++
++%take velocity for each element
++u=u(index)*[1;1;1]/3;
++v=v(index)*[1;1;1]/3;
++
++%initialization:
++counter=1;
++
++while any(~done) 
++
++	%find current triangle
++	queue=find(~done);
++	tria=TriaSearch(index,x,y,X(queue),Y(queue));
++
++	%check that the point is actually inside a triangle of the mesh
++	listnan=find(isnan(tria));
++	for i=1:length(listnan)
++		%remove the last point
++		flowpath(queue(listnan(i))).x(end)=[];
++		flowpath(queue(listnan(i))).y(end)=[];
++		done(queue(listnan(i)))=1;
++	end
++	tria(listnan)=[]; 
++	queue(listnan)=[];
++
++	if isempty(tria),
++		break;
++	end
++
++	%velocity of the current triangle and norm it
++	ut=u(tria); vt=v(tria); normv=sqrt(ut.^2+vt.^2);
++	ut=ut./normv;vt=vt./normv;
++
++	%check counter
++	if counter>maxiter
++		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going forward'])
++		break
++	end
++	counter=counter+1;
++
++	%remove stagnant point
++	done(queue(find(ut==0 & vt==0)))=1;
++
++	%build next point
++	for i=1:length(queue)
++		X(queue(i))=flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision;
++		Y(queue(i))=flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision;
++		flowpath(queue(i)).x=[flowpath(queue(i)).x;flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision];
++		flowpath(queue(i)).y=[flowpath(queue(i)).y;flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision];
++	end
++end
++
++%same process but reverse (vel=-vel) to have a vcomplete flow line
++counter=1;
++X=x0; Y=y0;
++done=zeros(N,1);
++
++while any(~done) 
++
++	%find current triangle
++	queue=find(~done);
++	tria=TriaSearch(index,x,y,X(queue),Y(queue));
++
++	%check that the point is actually inside a triangle of the mesh
++	listnan=find(isnan(tria));
++	for i=1:length(listnan)
++		%remove the last point
++		flowpath(queue(listnan(i))).x(1)=[];
++		flowpath(queue(listnan(i))).y(1)=[];
++		done(queue(listnan(i)))=1;
++	end
++	tria(listnan)=[]; 
++	queue(listnan)=[];
++
++	if isempty(tria),
++		break;
++	end
++
++	%velocity of the current triangle and norm it
++	ut=-u(tria); vt=-v(tria); normv=sqrt(ut.^2+vt.^2);
++	ut=ut./normv;vt=vt./normv;
++
++	%check counter
++	if counter>maxiter
++		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going backward'])
++		break
++	end
++	counter=counter+1;
++
++	%remove stagnant point
++	done(queue(find(ut==0 & vt==0)))=1;
++
++	%build next point
++	for i=1:length(queue)
++		X(queue(i))=flowpath(queue(i)).x(1)+ut(i)*length_tria(tria(i))/precision;
++		Y(queue(i))=flowpath(queue(i)).y(1)+vt(i)*length_tria(tria(i))/precision;
++		flowpath(queue(i)).x=[flowpath(queue(i)).x(1)+ut(i)*length_tria(tria(i))/precision; flowpath(queue(i)).x];
++		flowpath(queue(i)).y=[flowpath(queue(i)).y(1)+vt(i)*length_tria(tria(i))/precision; flowpath(queue(i)).y];
++	end
++end
++
++%EXP compatibility
++for i=1:length(queue)
++	flowpath(queue(i)).name=['flowline' num2str(i)];
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecircle.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecircle.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecircle.m	(revision 12997)
+@@ -0,0 +1,31 @@
++function expcreatecircle(filename,x0,y0,radius,numberofnodes)
++%EXPCREATECIRCLE - create a circular contour corresponding to given parameters
++%
++%   Creates a closed argus contour centered on x,y of radius size.
++%   The contour is made of numberofnodes
++%
++%   Usage:
++%      expcreatecircle(filename,x0,y0,radius,numberofnodes)
++%
++%   See also EXPMASTER, EXPDOC
++
++%Calculate the cartesians coordinates of the points
++x_list=ones(numberofnodes+1,1);
++y_list=ones(numberofnodes+1,1);
++
++theta=(0:2*pi/numberofnodes:2*pi*(1-1/numberofnodes))';
++theta=[theta;0];
++
++x_list=radius*x_list.*cos(theta);
++y_list=radius*y_list.*sin(theta);
++
++%offset x_list and y_list by x0 and y0:
++x_list=x_list+x0;
++y_list=y_list+y0;
++
++contour.x=x_list;
++contour.y=y_list;
++contour.density=1;
++contour.name='circle';
++
++expwrite(contour,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/ginputquick.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/ginputquick.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/ginputquick.m	(revision 12997)
+@@ -0,0 +1,221 @@
++function [out1,out2,out3] = ginput(arg1)
++%GINPUT - Graphical input from mouse.
++%
++%   [X,Y] = GINPUT(N) gets N points from the current axes and returns 
++%   the X- and Y-coordinates in length N vectors X and Y.  The cursor
++%   can be positioned using a mouse (or by using the Arrow Keys on some 
++%   systems).  Data points are entered by pressing a mouse button
++%   or any key on the keyboard except carriage return, which terminates
++%   the input before N points are entered.
++%
++%   [X,Y] = GINPUT gathers an unlimited number of points until the
++%   return key is pressed.
++% 
++%   [X,Y,BUTTON] = GINPUT(N) returns a third result, BUTTON, that 
++%   contains a vector of integers specifying which mouse button was
++%   used (1,2,3 from left) or ASCII numbers if a key on the keyboard
++%   was used.
++%
++%   Usage:
++%      [out1,out2,out3] = ginput(arg1)
++
++%   Copyright 1984-2005 The MathWorks, Inc.
++%   $Revision: 1.1 $  $Date: 2009/04/03 22:56:26 $
++
++out1 = []; out2 = []; out3 = []; y = [];
++c = computer;
++if ~strcmp(c(1:2),'PC') 
++   tp = get(0,'TerminalProtocol');
++else
++   tp = 'micro';
++end
++
++if ~strcmp(tp,'none') && ~strcmp(tp,'x') && ~strcmp(tp,'micro'),
++   if nargout == 1,
++      if nargin == 1,
++         out1 = trmginput(arg1);
++      else
++         out1 = trmginput;
++      end
++   elseif nargout == 2 || nargout == 0,
++      if nargin == 1,
++         [out1,out2] = trmginput(arg1);
++      else
++         [out1,out2] = trmginput;
++      end
++      if  nargout == 0
++         out1 = [ out1 out2 ];
++      end
++   elseif nargout == 3,
++      if nargin == 1,
++         [out1,out2,out3] = trmginput(arg1);
++      else
++         [out1,out2,out3] = trmginput;
++      end
++   end
++else
++   
++   fig = gcf;
++   figure(gcf);
++   
++   if nargin == 0
++      how_many = -1;
++      b = [];
++   else
++      how_many = arg1;
++      b = [];
++      if  ischar(how_many) ...
++            || size(how_many,1) ~= 1 || size(how_many,2) ~= 1 ...
++            || ~(fix(how_many) == how_many) ...
++            || how_many < 0
++         error('MATLAB:ginput:NeedPositiveInt', 'Requires a positive integer.')
++      end
++      if how_many == 0
++         ptr_fig = 0;
++         while(ptr_fig ~= fig)
++            ptr_fig = get(0,'PointerWindow');
++         end
++         scrn_pt = get(0,'PointerLocation');
++         loc = get(fig,'Position');
++         pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
++         out1 = pt(1); y = pt(2);
++      elseif how_many < 0
++         error('MATLAB:ginput:InvalidArgument', 'Argument must be a positive integer.')
++      end
++   end
++   
++   % Suspend figure functions
++   state = uisuspend(fig);
++   
++   toolbar = findobj(allchild(fig),'flat','Type','uitoolbar');
++   if ~isempty(toolbar)
++        ptButtons = [uigettool(toolbar,'Plottools.PlottoolsOff'), ...
++                     uigettool(toolbar,'Plottools.PlottoolsOn')];
++        ptState = get (ptButtons,'Enable');
++        set (ptButtons,'Enable','off');
++   end
++
++   set(fig,'pointer','fullcrosshair');
++   fig_units = get(fig,'units');
++   char = 0;
++
++   % We need to pump the event queue on unix
++   % before calling WAITFORBUTTONPRESS 
++   drawnow
++   
++   while how_many ~= 0
++      % Use no-side effect WAITFORBUTTONPRESS
++      waserr = 0;
++      try
++	keydown = wfbp;
++      catch
++	waserr = 1;
++      end
++      if(waserr == 1)
++         if(ishandle(fig))
++            set(fig,'units',fig_units);
++	    uirestore(state);
++            error('MATLAB:ginput:Interrupted', 'Interrupted');
++         else
++            error('MATLAB:ginput:FigureDeletionPause', 'Interrupted by figure deletion');
++         end
++      end
++      
++      ptr_fig = get(0,'CurrentFigure');
++      if(ptr_fig == fig)
++         if keydown
++            char = get(fig, 'CurrentCharacter');
++            button = abs(get(fig, 'CurrentCharacter'));
++            scrn_pt = get(0, 'PointerLocation');
++            set(fig,'units','pixels')
++            loc = get(fig, 'Position');
++            pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
++            set(fig,'CurrentPoint',pt);
++         else
++            button = get(fig, 'SelectionType');
++            if strcmp(button,'open') 
++               button = 1;
++            elseif strcmp(button,'normal') 
++               button = 1;
++            elseif strcmp(button,'extend')
++               button = 2;
++            elseif strcmp(button,'alt') 
++               button = 3;
++            else
++               error('MATLAB:ginput:InvalidSelection', 'Invalid mouse selection.')
++            end
++         end
++         pt = get(gca, 'CurrentPoint');
++         
++         how_many = how_many - 1;
++         
++         if(char == 13) % & how_many ~= 0)
++            % if the return key was pressed, char will == 13,
++            % and that's our signal to break out of here whether
++            % or not we have collected all the requested data
++            % points.  
++            % If this was an early breakout, don't include
++            % the <Return> key info in the return arrays.
++            % We will no longer count it if it's the last input.
++            break;
++         end
++
++         out1 = [out1;pt(1,1)];
++         y = [y;pt(1,2)];
++         b = [b;button];
++      end
++   end
++   
++   uirestore(state);
++   if ~isempty(toolbar) && ~isempty(ptButtons)
++        set (ptButtons(1),'Enable',ptState{1});
++        set (ptButtons(2),'Enable',ptState{2});
++   end
++   set(fig,'units',fig_units);
++   
++   if nargout > 1
++      out2 = y;
++      if nargout > 2
++         out3 = b;
++      end
++   else
++      out1 = [out1 y];
++   end
++
++   line(out1,y);
++   line([out1(length(out1)) out1(1)],[y(length(y)) y(1)]);
++   
++end
++
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++function key = wfbp
++%WFBP   Replacement for WAITFORBUTTONPRESS that has no side effects.
++
++fig = gcf;
++current_char = [];
++
++% Now wait for that buttonpress, and check for error conditions
++waserr = 0;
++try
++  h=findall(fig,'type','uimenu','accel','C');   % Disabling ^C for edit menu so the only ^C is for
++  set(h,'accel','');                            % interrupting the function.
++  keydown = waitforbuttonpress;
++  current_char = double(get(fig,'CurrentCharacter')); % Capturing the character.
++  if~isempty(current_char) && (keydown == 1)           % If the character was generated by the 
++	  if(current_char == 3)                       % current keypress AND is ^C, set 'waserr'to 1
++		  waserr = 1;                             % so that it errors out. 
++	  end
++  end
++  
++  set(h,'accel','C');                                 % Set back the accelerator for edit menu.
++catch
++  waserr = 1;
++end
++drawnow;
++if(waserr == 1)
++   set(h,'accel','C');                                % Set back the accelerator if it errored out.
++   error('MATLAB:ginput:Interrupted', 'Interrupted');
++end
++
++if nargout>0, key = keydown; end
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expbox.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expbox.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expbox.m	(revision 12997)
+@@ -0,0 +1,41 @@
++function expbox(filename)
++%EXPBOX - Create a ARGUS file using to clicks
++%
++%   Two clicks on a plot are used to generate a rectangular box
++%   This box is written in EXP format on filename
++%
++%   Usage:
++%      expbox(filename)
++
++%check
++if exist(filename,'file'),
++	choice=input(['A file ' filename ' already exists, do you want to modify it? (y/n)'],'s');
++	if ~strcmpi(choice,'y'),
++		disp('no modification done ... exiting');
++		return
++	end
++end
++
++%Get points
++disp('Click twice to define a rectangular domain. First click for upper left corner, second for lower right corner');
++[x,y]=ginput(2);
++
++x1=x(1);
++x2=x(2);
++x3=x2;
++x4=x1;
++
++y1=y(1);
++y2=y1;
++y3=y(2);
++y4=y3;
++
++%Build Exp structure
++A=struct();
++A.nods=5;
++A.density=1;
++A.x=[x1 x2 x3 x4 x1]';
++A.y=[y1 y2 y3 y4 y1]';
++
++%Write structure
++expwrite(A,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/cutarea.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/cutarea.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/cutarea.m	(revision 12997)
+@@ -0,0 +1,156 @@
++function [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options);
++%CUTAREA - cut several point of a profile
++%
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile. The user must click 3 times to select the
++%   area to be removed. Twice to select the tips and one to select
++%   the part of the profile to be removed
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	hold on
++	loop=1;
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	end
++
++	points=[];
++
++	%loop (at least 3 clicks needed)
++	while loop
++
++		%some checks
++		if numprofiles==0
++			disp('no profile present, exiting...')
++			return
++		end	   
++		if numpoints<3
++			disp('at least two points are needed, exiting...')
++			return
++		end	   
++
++		%select a point
++		if isempty(points)
++			title('click on the first tip, RETURN to exit','FontSize',14)
++		elseif length(points)==1
++			title('click on the second tip, RETURN to exit','FontSize',14)
++		else
++			title('click in the middle of the area to be cut, RETURN to exit','FontSize',14)
++		end
++
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++			%get the closest point
++			%first time, look at all profiles
++			if isempty(points)
++				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++				if ((closed(profsel) & length(A(profsel).x)<4) |  (~closed(profsel) & length(A(profsel).x)<3)),
++					disp('the selected profile has less than 3 points, make another selection');
++				else
++					selection=profsel;
++					points(end+1)=indsel;
++					plot(A(profsel).x,A(profsel).y,...
++						'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++					text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
++				end
++			else
++				%get the 2d or 3d point for the given contou
++				[profsel indsel]=closestpoint(A(selection),1,xi,yi);
++				if ismember(indsel,points)
++					disp('the selected points must be distinct')
++				else
++					%second click?
++					if length(points)==1,
++						points(end+1)=indsel;
++						text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
++					%third click?
++					else
++						p1=points(1); p2=points(2); p3=indsel;
++						x=A(selection).x; y=A(selection).y;
++						if p1<p2
++							if p3>p1 & p3<p2
++								if closed(selection)
++									%open the profile
++									n=length(A(selection).x);
++									A(selection).x=[A(selection).x(p2:end-1,1);A(selection).x(1:p1,1)];
++									A(selection).y=[A(selection).y(p2:end-1,1);A(selection).y(1:p1,1)];
++									numpoints=numpoints-(n-length(A(selection).x));
++									closed(selection)=0;
++								else
++									%cut in 2 profiles
++									A(selection).x=x(1:p1);
++									A(selection).y=y(1:p1);
++									closed(selection)=0;
++									A(end+1).x=x(p2:end);
++									A(end).y=y(p2:end);
++									A(end).density=A(selection).density;
++									A(end).name=A(selection).name;
++									closed(end+1)=0;
++									numprofiles=numprofiles+1;
++									numpoints=numpoints-(p2-p1-1);
++								end
++							else
++								%only point removal
++								n=length(A(selection).x);
++								A(selection).x=x(p1:p2);
++								A(selection).y=y(p1:p2);
++								numpoints=numpoints-(n-length(A(selection).x));
++								closed(selection)=0;
++							end
++						else
++							if p3>p2 & p3<p1
++								if closed(selection)
++									%open the profile
++									n=length(A(selection).x);
++									A(selection).x=[A(selection).x(p1:end-1,1);A(selection).x(1:p2,1)];
++									A(selection).y=[A(selection).y(p1:end-1,1);A(selection).y(1:p2,1)];
++									numpoints=numpoints-(n-length(A(selection).x));
++									closed(selection)=0;
++								else
++									%cut in 2 profiles
++									closed(selection)=0;
++									A(selection).x=x(1:p2);
++									A(selection).y=y(1:p2);
++									A(end+1).x=x(p1:end);
++									A(end).y=y(p1:end);
++									A(end).density=A(selection).density;
++									A(end).name=A(selection).name;
++									closed(end+1)=0;
++									numprofiles=numprofiles+1;
++									numpoints=numpoints-(p1-p2-1);
++								end
++							else
++								%only point removal
++								n=length(A(selection).x);
++								x(1:p2-1)=[];x(p1-p2+2:end)=[];%it should have been x(p2+1:end)
++								y(1:p2-1)=[];y(p1-p2+2:end)=[];
++								A(selection).x=x;
++								A(selection).y=y;
++								numpoints=numpoints-(n-length(A(selection).x));
++								closed(selection)=0;
++							end
++						end
++
++						%plot new profile
++						undoplots(prevplot);
++						for i=1:numprofiles
++							plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++								'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++						end
++						points=[];
++
++					end
++				end
++			end
++		else
++			%RETRUN-> quit
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addinsideprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addinsideprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addinsideprofile.m	(revision 12997)
+@@ -0,0 +1,79 @@
++function [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%ADDINSIDEPROFILE - add apoint inside a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting...')
++		return
++	end	   
++	if numpoints<2
++		disp('at least two points are required, exiting...')
++		return
++	end	   
++	hold on
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	end
++
++	loop=1;
++	while loop
++
++		%first step, select a segment
++		title('click on a segment, RETURN to exit','FontSize',14)
++		[xi,yi] = ginput(1);
++
++		%first click
++		if ~isempty(xi)
++
++			%get the closest segment
++			[profsel indsel]=closestsegment(A,numprofiles,xi,yi);
++
++			%check that at least one segment exists
++			if indsel==0
++				disp('at least two points in one profile are required, exiting...')
++				return
++			end
++
++			%highlight selected segment
++			plot([A(profsel).x(indsel) A(profsel).x(indsel+1)],[A(profsel).y(indsel) A(profsel).y(indsel+1)],...
++				'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++			%next click
++			title('click on the new point''s location, RETURN to exit','FontSize',14)
++			[xi,yi,but] = ginput(1);
++
++			%second click
++			if ~isempty(xi)
++
++				%add point to A
++				A(profsel).x=[A(profsel).x(1:indsel,1); xi; A(profsel).x(indsel+1:end,1)];
++				A(profsel).y=[A(profsel).y(1:indsel,1); yi; A(profsel).y(indsel+1:end,1)];
++				numpoints=numpoints+1;
++
++				%plot new profile
++				undoplots(prevplot);
++				for i=1:numprofiles
++					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++				end
++
++			else
++				%RETURN->exit
++				return
++			end
++		else
++			%RETURN-> exit
++			return
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/closeprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/closeprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/closeprofile.m	(revision 12997)
+@@ -0,0 +1,68 @@
++function [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%CLOSEPROFILE - close one or several profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++
++	%some checks
++	if numprofiles==0
++		disp('no profile to be closed')
++		return
++	end
++		   
++	title('click on the profiles to be closed, RETURN to exit','FontSize',14)
++	hold on
++
++	loop=1;
++	selection=[];
++
++	while loop
++
++		%some checks,
++		if numprofiles==0    
++			disp('no profile present, exiting...')
++			return            
++		end  
++		if ~any(~closed),
++			disp('All the profiles are closed, exiting...')
++			return
++		end
++
++		[xi,yi] = ginput(1);
++					  
++		if ~isempty(xi)
++
++			%get closest profile
++			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++
++			if ismember(profsel,selection)
++				%profile was in selection, remove it from the selection
++				selection(find(selection==profsel))=[];
++				%back to regular color
++				plot(A(profsel).x,A(profsel).y,...
++					'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			elseif closed(profsel),
++				%profile already closed, do nothing
++				disp('selected profile aready closed, make another selection'),
++			else
++				%add the profile to the list to be closed
++				selection(end+1)=profsel;
++				%in selectioncolor
++				plot(A(profsel).x,A(profsel).y,...
++					'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			end
++		else
++			%close the profiles
++			for i=1:length(selection),
++				A(selection(i)).x(end+1)=A(selection(i)).x(1);
++				A(selection(i)).y(end+1)=A(selection(i)).y(1);
++				numpoints=numpoints+1;
++				closed(selection(i))=1;
++			end
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/closestpoint.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/closestpoint.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/closestpoint.m	(revision 12997)
+@@ -0,0 +1,21 @@
++function [profsel indsel]=closestpoint(A,numprofiles,xi,yi)
++%CLOSESTPOINT - find the closest point of a profile
++%
++%   This routine find the point of the profile A that is the closest
++%   to (xi,yi) and return the number of the profile and the number of
++%   the point
++%
++%   Usage:
++%     [profsel indsel]=closestpoint(A,numprofiles,xi,yi) 
++
++	%loop over the points of each profile, find the closest to (xi,yi)
++	for i=1:numprofiles,
++		distance=(xi-A(i).x).^2+(yi-A(i).y).^2;
++		[newdistance p]=min(distance);
++		if ((i==1) | (newdistance<olddistance)),
++			indsel=p;
++			profsel=i;
++			olddistance=newdistance;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/undoplots.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/undoplots.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/undoplots.m	(revision 12997)
+@@ -0,0 +1,12 @@
++function  undoplots(prevplot)
++%UNDOPLOTS - undo plots
++%
++%   Usage:undoplots(prevplot)
++
++	%erase all previous plots
++	g=get(gca,'children');
++	L=length(g);
++	for i=1:L-prevplot
++		delete(g(i));
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addprofile.m	(revision 12997)
+@@ -0,0 +1,48 @@
++function [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%ADDPROFILE - add a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++		   
++	title('click to add a point to the new profile, RETURN to exit','FontSize',14)
++	hold on
++
++	loop=1;
++	x=[];
++	y=[];
++
++	while loop
++
++		[xi,yi] = ginput(1);
++					  
++		if ~isempty(xi)
++			x(end+1,1)=xi;
++			y(end+1,1)=yi;
++
++			%plot everything
++			undoplots(prevplot);
++			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++		else
++
++			%check that the profile is not empty
++			if ~isempty(x)
++				A(end+1).x=x; 
++				A(end).y=y; 
++				A(end).name=root; 
++				A(end).density=1; 
++				numprofiles=numprofiles+1;
++				numpoints=numpoints+length(x);
++				closed(end+1)=0;
++			end
++
++			%get out
++			loop=0;
++		end
++	end
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addprofile.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/removepoints.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/removepoints.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/removepoints.m	(revision 12997)
+@@ -0,0 +1,85 @@
++function [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options);
++%REMOVEPOINTS - remove a point from a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting...')
++		return
++	end
++
++	hold on
++	loop=1;
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++	end
++
++	while loop
++
++		%check that at least one point is present
++		if numpoints==0
++			disp('at least one point are needed')
++			return
++		end	   
++
++		%select a point to be deleted
++		title('click on the point to be removed, RETURN to exit','FontSize',14)
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++
++			%get the closest point
++			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++
++			%remove point of A
++			A(profsel).x(indsel)=[];
++			A(profsel).y(indsel)=[];
++
++			%unclose the domain if only 2 points remaining
++			if closed(profsel)
++				if length(A(profsel).x)==3
++					A(profsel).x(end)=[];
++					A(profsel).y(end)=[];
++					numpoints=numpoints-1;
++					closed(profsel)=0;
++				end
++			end
++
++			%remove the last point if the profile is closed and indsel=end or 1
++			if closed(profsel)
++				if indsel==1 
++					A(profsel).x(end)=A(profsel).x(1);
++					A(profsel).y(end)=A(profsel).y(1);
++				elseif indsel==length(A(profsel).x)
++					A(profsel).x(1)=A(profsel).x(end);
++					A(profsel).y(1)=A(profsel).y(end);
++				end
++			end
++			numpoints=numpoints-1;
++
++			%plot new profile
++			undoplots(prevplot);
++			for i=1:numprofiles
++				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++					'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++				if length(A(i).x)==1
++					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker','o');
++				end
++			end
++
++		else
++			%RETURN-> exit
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/cutprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/cutprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/cutprofile.m	(revision 12997)
+@@ -0,0 +1,79 @@
++function [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%CUTPROFILE - cut a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting...')
++		return
++	end	   
++	if numpoints<2
++		disp('at least two points are needed')
++		return
++	end	   
++	hold on
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	end
++
++	loop=1;
++	while loop
++
++		%select a segment
++		title('click the segment to cut, RETURN to exit','FontSize',14)
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++
++			%get the closest segment
++			[profsel indsel]=closestsegment(A,numprofiles,xi,yi);
++
++			%check that at least one segment exists
++			if indsel==0
++				disp('at least 2 points are required');
++				return,
++			end
++
++			if ((closed(profsel) & length(A(profsel).x)<3) | (~closed(profsel) & length(A(profsel).x)<2))
++				disp('at least 2 points are required, make another selection');
++			else
++				%cut A
++				if closed(profsel)
++					%open the contour
++					A(profsel).x=[A(profsel).x(indsel+1:end-1,1);A(profsel).x(1:indsel,1)];
++					A(profsel).y=[A(profsel).y(indsel+1:end-1,1);A(profsel).y(1:indsel,1)];
++					numpoints=numpoints-1;
++					closed(profsel)=0;
++				else
++					%cut the contour in 2 profiles
++					A(end+1).x=A(profsel).x(indsel+1:end,1);
++					A(end).y=A(profsel).y(indsel+1:end,1);
++					A(end).name=root; 
++					A(end).density=1; 
++					A(profsel).x=A(profsel).x(1:indsel,1);
++					A(profsel).y=A(profsel).y(1:indsel,1);
++					numprofiles=numprofiles+1;
++					closed(end+1)=0;
++				end
++
++				%plot new profile
++				undoplots(prevplot);
++				for i=1:numprofiles
++					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++				end
++			end
++		else
++			%RETURN->exit
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/modifyposition.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/modifyposition.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/modifyposition.m	(revision 12997)
+@@ -0,0 +1,77 @@
++function [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options);
++%MODIFYPOSITION - modify the prosition of a point of a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting..')
++		return
++	end
++
++	hold on
++	loop=1;
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	end
++
++	while loop
++
++		%select a point to be modified 
++		title('click on the point to be modified, RETURN to exit','FontSize',14)
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++
++			%get the closest point
++			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++
++			%plot the point in blue
++			plot(A(profsel).x(indsel),A(profsel).y(indsel),...
++				'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++				'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++			%select new location
++			title('click on the new location, RETURN to exit','FontSize',14)
++			[xi,yi] = ginput(1);
++
++			if ~isempty(xi)
++
++				%modification of its coordinates
++				A(profsel).x(indsel)=xi;
++				A(profsel).y(indsel)=yi;
++
++				%modify the last point if the profile is closed and indsel=end or 1
++				if closed(profsel)
++					if indsel==1 
++						A(profsel).x(end)=xi;
++						A(profsel).y(end)=yi;
++					elseif indsel==length(A(profsel).x)
++						A(profsel).x(1)=xi;
++						A(profsel).y(1)=yi;
++					end
++				end
++
++				%plot new profile
++				undoplots(prevplot);
++				for i=1:numprofiles
++					plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++						'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++				end
++			else
++				%RETURN-> exit
++				loop=0;
++			end
++		else
++			%RETURN-> exit
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/removeseveralpoints.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/removeseveralpoints.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/removeseveralpoints.m	(revision 12997)
+@@ -0,0 +1,130 @@
++function [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options);
++%REMOVESEVERALPOINTS - remove several point
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting...')
++		return
++	end	   
++	if numpoints<3
++		disp('at least 3 points are required, exiting...')
++		return
++	end	   
++	hold on
++	loop=1;
++
++	%plot squares
++	for i=1:numprofiles
++		plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++			'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	end
++
++	points=[];
++
++	%loop (at least 3 clicks needed)
++	while loop
++
++		%some checks
++		if numpoints<3
++			disp('at least 3 points are required, exiting...')
++			return
++		end
++
++		%select a point
++		if isempty(points)
++			title('click on the first tip, RETURN to exit','FontSize',14)
++		elseif length(points)==1
++			title('click on the second tip, RETURN to exit','FontSize',14)
++		else
++			title('click in the middle of the area to be removed, RETURN to exit','FontSize',14)
++		end
++
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++			%get the closest point
++			%first time, look at all profiles
++			if isempty(points)
++				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++				if ((closed(profsel) & length(A(profsel).x)<4) |  (~closed(profsel) & length(A(profsel).x)<3)),
++					disp('the selected profile has less than 3 points, make another selection');
++				else
++					selection=profsel;
++					points(end+1)=indsel;
++					plot(A(profsel).x,A(profsel).y,...
++						'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++					text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
++				end
++				%disp(['p1= ' num2str(indsel)]),
++			else
++				%get the 2d or 3d point for the given contou
++				[profsel indsel]=closestpoint(A(selection),1,xi,yi);
++				if ismember(indsel,points)
++					disp('the selected points must be distinct')
++				else
++					%second click?
++					if length(points)==1,
++						points(end+1)=indsel;
++						text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
++						%disp(['p2= ' num2str(indsel)]),
++					%third click?
++					else
++						p1=points(1); p2=points(2); p3=indsel;
++						%disp(['p3= ' num2str(indsel)]),
++						if p1<p2
++							if p3>p1 & p3<p2
++								A(selection).x(p1+1:p2-1)=[];
++								A(selection).y(p1+1:p2-1)=[];
++								numpoints=numpoints-(p2-p1-1);
++							else
++								A(selection).x=A(selection).x(p1:p2);
++								A(selection).y=A(selection).y(p1:p2);
++								numpoints=numpoints-(numpoints-1-p2)-(p1-1);
++								if closed(selection)
++									%reattach the tips
++									A(selection).x(end+1)=A(selection).x(1);
++									A(selection).y(end+1)=A(selection).y(1);
++									numpoints=numpoints+1;
++								end
++							end
++						else
++							if p3>p2 & p3<p1
++								A(selection).x(p2+1:p1-1)=[];
++								A(selection).y(p2+1:p1-1)=[];
++								numpoints=numpoints-(p1-p2-1);
++							else
++								A(selection).x=A(selection).x(p2:p1);
++								A(selection).y=A(selection).y(p2:p1);
++								numpoints=numpoints-(numpoints-1-p1)-(p2-1);
++								if closed(selection)
++									%reattach the tips
++									A(selection).x(end+1)=A(selection).x(1);
++									A(selection).y(end+1)=A(selection).y(1);
++									numpoints=numpoints+1;
++								end
++							end
++						end
++
++						%plot new profiles
++						undoplots(prevplot);
++						for i=1:numprofiles
++							plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++								'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++						end
++						points=[];
++
++					end
++				end
++			end
++		else
++			%RETRUN-> quit
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/removeprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/removeprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/removeprofile.m	(revision 12997)
+@@ -0,0 +1,56 @@
++function [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%REMOVEPROFILE - delete a profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++
++	title('click on the profiles to be removed, RETURN to exit','FontSize',14)
++	hold on
++
++	loop=1;
++	selection=[];
++
++	while loop
++
++		%some checks
++		if numprofiles==0
++			disp('no profile to be removed, exiting...')
++			return
++		end
++		   
++		[xi,yi] = ginput(1);
++					  
++		if ~isempty(xi)
++
++			%get closest profile
++			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++
++			if ismember(profsel,selection)
++				%profile was in selection, remove it
++				selection(find(selection==profsel))=[];
++				%back to regular color
++				plot(A(profsel).x,A(profsel).y,...
++					'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			else
++				%add the profile to the list to be removed
++				selection(end+1)=profsel;
++				%in selectioncolor
++				plot(A(profsel).x,A(profsel).y,...
++					'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			end
++		else
++			%remove the profiles
++			selection=sort(selection);
++			for i=1:length(selection),
++				numprofiles=numprofiles-1;
++				numpoints=numpoints-length(A(selection(i)-(i-1)).x);
++				A(selection(i)-(i-1))=[];
++				closed(selection(i)-(i-1))=[];
++			end
++			loop=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/closestsegment.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/closestsegment.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/closestsegment.m	(revision 12997)
+@@ -0,0 +1,28 @@
++function [profsel indsel]=closestsegment(A,numprofiles,xi,yi)
++%CLOSESTSEGMENT - find the closest segment of a profile
++%
++%   This routine find the segment of the profile A that is the closest
++%   to (xi,yi) and return the number of the profile and the number of
++%   the first point belonging to this closest segment
++%
++%   Usage:
++%     [profsel indsel]=closestsegment(A,numprofiles,xi,yi) 
++
++	%loop over the middles of each profile, find the closest to (xi,yi)
++	profsel=0;
++	indsel=0;
++	first=1;
++	for i=1:numprofiles,
++		if length(A(i).x)>1
++			middles=[(A(i).x(1:end-1)+A(i).x(2:end))/2 (A(i).y(1:end-1)+A(i).y(2:end))/2];
++			distance=(xi-middles(:,1)).^2+(yi-middles(:,2)).^2;
++			[newdistance p]=min(distance);
++			if (first | (newdistance<olddistance)),
++				first=0;
++				indsel=p;
++				profsel=i;
++				olddistance=newdistance;
++			end
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addendprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addendprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addendprofile.m	(revision 12997)
+@@ -0,0 +1,86 @@
++function [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%ADDENDPROFILE - add point at the end of a n existing profile
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++		
++	%some checks
++	if numprofiles==0
++		disp('no profile present, exiting...')
++		return
++	end	   
++	if ~any(~closed)
++		disp('all profiles are closed')
++		return
++	end	   
++	%select a profile first
++	if numprofiles>1
++		%first step, select a profile
++		isclosed=1;
++		title('click on a profile, RETURN to exit','FontSize',14)
++		while isclosed
++			[xi,yi] = ginput(1);
++			if ~isempty(xi)
++				%get the closest point 
++				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++				if closed(profsel)
++					disp('selected profile is closed, make another selection')
++				else
++					isclosed=0;
++				end
++
++			else
++				%RETURN -> out
++				return
++			end
++		end
++	else
++		profsel=1;
++	end
++
++	%initialize x and y
++	x=A(profsel).x;
++	y=A(profsel).y;
++
++	%plot the selected profile
++	hold on
++	plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++		'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++	plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++	loop=1;
++	while loop
++
++		%first step, select a profile
++		title('click to add point to the selected profile, RETURN to exit','FontSize',14)
++		[xi,yi] = ginput(1);
++
++		if ~isempty(xi)
++			x(end+1,1)=xi;
++			y(end+1,1)=yi;
++
++			%plot everything
++			undoplots(prevplot);
++			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize')+2,'Marker',getfieldvalue(options,'Marker'));
++
++		else
++
++			%check that the profile is not empty
++			if ~isempty(x)
++				A(profsel).x=x; 
++				A(profsel).y=y; 
++				A(profsel).name=root; 
++				A(profsel).density=1; 
++				numpoints=numpoints+length(x);
++			end
++
++			%get out
++			loop=0;
++		end
++	end
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addendprofile.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addcontour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addcontour.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addcontour.m	(revision 12997)
+@@ -0,0 +1,50 @@
++function [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot,root,options);
++%ADDCONTOUR - add a closed contour
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot,root,options)
++		   
++	title('click to add a point to the new profile, RETURN to exit','FontSize',14)
++	hold on
++
++	loop=1;
++	x=[];
++	y=[];
++
++	while loop
++
++		[xi,yi] = ginput(1);
++					  
++		if ~isempty(xi)
++			x(end+1,1)=xi;
++			y(end+1,1)=yi;
++
++			%plot everything
++			undoplots(prevplot);
++			plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
++				'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++			plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++
++		else
++
++			%check that the profile is not empty
++			if ~isempty(x)
++				x(end+1)=x(1);
++				y(end+1)=y(1);
++				A(end+1).x=x; 
++				A(end).y=y; 
++				A(end).name=root; 
++				A(end).density=1; 
++				numprofiles=numprofiles+1;
++				numpoints=numpoints+length(x);
++				closed(end+1)=1;
++			end
++
++			%get out
++			loop=0;
++		end
++	end
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/addcontour.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/mergeprofiles.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/mergeprofiles.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/mergeprofiles.m	(revision 12997)
+@@ -0,0 +1,152 @@
++function [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options);
++%MERGEPROFILES - merge profiles
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile. The user must select the two tips that
++%   he/she wants to merge
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root,options)
++
++hold on
++loop=1;
++
++%Take all the tips coordinates of open profiles
++counter=1; tips=[];
++for i=1:numprofiles
++	if ~closed(i),
++		%x and y coord, profile number, 1 if beginning, 2 and if end
++		if length(A(i).x)==1,
++			tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
++			counter=counter+1;
++		else
++			tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
++			tips(counter+1,:) = [A(i).x(end) A(i).y(end) i  2];
++			counter=counter+2;
++		end
++	end
++end
++
++if size(tips,1)<2
++	disp('at least one unclosed profile is required')
++	return
++end
++
++%plot the tips only
++plot(tips(:,1),tips(:,2),...
++	'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++firsttip=1;
++
++%loop (at least 2 clicks needed)
++while loop
++
++	%some checks
++	if size(tips,1)<2
++		disp('at least one unclosed profiles are required')
++		return
++	end
++
++	%select a point
++	if firsttip
++		title('click on the first tip, RETURN to exit','FontSize',14)
++	else
++		title('click on the second tip, RETURN to exit','FontSize',14)
++	end
++
++	[xi,yi] = ginput(1);
++
++	if ~isempty(xi)
++
++		if firsttip
++			%find the selected tip
++			distance=(xi-tips(:,1)).^2+(yi-tips(:,2)).^2;
++			[dmin tip1]=min(distance);
++			numprofile1=tips(tip1,3);
++			firsttip=0;
++
++			%remove tip1 from tips list
++			newtips=tips;
++			newtips(tip1,:)=[];
++
++			%plot selected tip
++			plot(tips(tip1,1),tips(tip1,2),...
++				'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++			plot(A(numprofile1).x,A(numprofile1).y,...
++				'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++
++		%second selection
++		else
++			distance=(xi-newtips(:,1)).^2+(yi-newtips(:,2)).^2;
++			[dmin tip2]=min(distance);
++			numprofile2=newtips(tip2,3);
++
++			if numprofile1==numprofile2
++				%close the profile
++				A(numprofile1).x(end+1)=A(numprofile1).x(1);
++				A(numprofile1).y(end+1)=A(numprofile1).y(1);
++				numpoints=numpoints+1;
++				closed(numprofile1)=1;
++
++			else
++
++				if tips(tip1,4)==1 & newtips(tip2,4)==1,
++					A(numprofile1).x=[flipud(A(numprofile2).x); A(numprofile1).x];
++					A(numprofile1).y=[flipud(A(numprofile2).y); A(numprofile1).y];
++					numprofiles=numprofiles-1;
++
++				elseif tips(tip1,4)==1 & newtips(tip2,4)==2,
++					A(numprofile1).x=[A(numprofile2).x; A(numprofile1).x];
++					A(numprofile1).y=[A(numprofile2).y; A(numprofile1).y];
++					numprofiles=numprofiles-1;
++
++				elseif tips(tip1,4)==2 & newtips(tip2,4)==1,
++					A(numprofile1).x=[A(numprofile1).x; A(numprofile2).x];
++					A(numprofile1).y=[A(numprofile1).y; A(numprofile2).y];
++					numprofiles=numprofiles-1;
++
++				elseif tips(tip1,4)==2 & newtips(tip2,4)==2,
++					A(numprofile1).x=[A(numprofile1).x; flipud(A(numprofile2).x)];
++					A(numprofile1).y=[A(numprofile1).y; flipud(A(numprofile2).y)];
++					numprofiles=numprofiles-1;
++				end
++
++				%delete profile2
++				A(numprofile2)=[];
++				closed(numprofile2)=[];
++
++			end
++
++			%update tips
++			counter=1; tips=[];
++			for i=1:numprofiles
++				if ~closed(i),
++					%x and y coord, profile number, 1 if beginning, 2 and if end
++					if length(A(i).x)==1,
++						tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
++						counter=counter+1;
++					else
++						tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
++						tips(counter+1,:) = [A(i).x(end) A(i).y(end) i  2];
++						counter=counter+2;
++					end
++				end
++			end
++
++			%plot new profile
++			undoplots(prevplot);
++			for i=1:numprofiles
++				plot(A(i).x,A(i).y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			end
++			if ~isempty(tips)
++				plot(tips(:,1),tips(:,2),...
++					'LineStyle','none','MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
++			end
++
++			%back to beginning
++			firsttip=1;
++		end
++	else
++		%RETRUN-> quit
++		loop=0;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile
++Makefile.in
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/downstreamflowlines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/downstreamflowlines.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/downstreamflowlines.m	(revision 12997)
+@@ -0,0 +1,110 @@
++function flowpath=downstreamflowlines(index,x,y,u,v,x0,y0,varargin)
++%DOWNSTREAMFLOWLINES - compute flowlines from a given set of seed points
++%
++%   Usage:
++%      flowpath=downstreamflowlines(index,x,y,u,v,x0,y0)
++%
++%   the velocity field is given by the couple (u,v) and the coordinates
++%   of the seed points are (x0,y0). One can use one or several seed 
++%   points
++%
++%   Example:
++%      flowpath=downstreamflowlines(md.mesh.elements,md.mesh.x,md.mesh.y,md.vx,md.initialization.vy,x0,y0)
++
++%check input size
++if nargin>9 | nargin<7,
++	help flowlines
++	error('flowlines error message: bad usage');
++end
++
++%check input
++if (length(x)~=length(y) | length(x)~=length(u) | length(x)~=length(v)),
++	error('flowlines error message: x,y,u and v must have the same length');
++end
++if length(x)<3,
++	error('flowlines error message: at least one element is required');
++end
++if length(x0)~=length(y0),
++	error('flowlines error message: x0 and y0 do not have the same length');
++end
++
++%get maxiter and precision
++if nargin==9
++	maxiter=varargin{1};%maximum number of iterations
++	precision=varargin{2}; %division of each segment (higer precision increases number of segments)
++else
++	maxiter=200; %maximum number of iterations
++	precision=1; %division of each segment (higer precision increases number of segments)
++end
++
++%check seed points
++tria=TriaSearch(index,x,y,x0,y0);
++pos=find(isnan(tria));
++x0(pos)=[];
++y0(pos)=[];
++
++%initialize other variables
++N=length(x0);
++X=x0; Y=y0;
++flowpath=struct('x',cell(N,1),'y',cell(N,1),'name','','density',1);
++for i=1:N,
++	flowpath(i).x=x0(i);
++	flowpath(i).y=y0(i);
++end
++done=zeros(N,1);
++
++%get avegared length of each element
++length_tria=1/3*(sqrt( (x(index(:,1))-x(index(:,2))).^2+(y(index(:,1))-y(index(:,2))).^2 )+...
++	sqrt((x(index(:,1))-x(index(:,3))).^2+(y(index(:,1))-y(index(:,3))).^2 )+...
++	sqrt((x(index(:,2))-x(index(:,3))).^2+(y(index(:,2))-y(index(:,3))).^2 ));
++
++%take velocity for each element
++u=u(index)*[1;1;1]/3;
++v=v(index)*[1;1;1]/3;
++
++%initialization:
++counter=1;
++
++while any(~done) 
++
++	%find current triangle
++	queue=find(~done);
++	tria=TriaSearch(index,x,y,X(queue),Y(queue));
++
++	%check that the point is actually inside a triangle of the mesh
++	listnan=find(isnan(tria));
++	for i=1:length(listnan)
++		%remove the last point
++		flowpath(queue(listnan(i))).x(end)=[];
++		flowpath(queue(listnan(i))).y(end)=[];
++		done(queue(listnan(i)))=1;
++	end
++	tria(listnan)=[]; 
++	queue(listnan)=[];
++
++	if isempty(tria),
++		break;
++	end
++
++	%velocity of the current triangle and norm it
++	ut=u(tria); vt=v(tria); normv=sqrt(ut.^2+vt.^2);
++	ut=ut./normv;vt=vt./normv;
++
++	%check counter
++	if counter>maxiter
++		disp(['Maximum number of iterations (' num2str(maxiter) ') reached while going forward'])
++		break
++	end
++	counter=counter+1;
++
++	%remove stagnant point
++	done(queue(find(ut==0 & vt==0)))=1;
++
++	%build next point
++	for i=1:length(queue)
++		X(queue(i))=flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision;
++		Y(queue(i))=flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision;
++		flowpath(queue(i)).x=[flowpath(queue(i)).x;flowpath(queue(i)).x(end)+ut(i)*length_tria(tria(i))/precision];
++		flowpath(queue(i)).y=[flowpath(queue(i)).y;flowpath(queue(i)).y(end)+vt(i)*length_tria(tria(i))/precision];
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expflip.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expflip.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expflip.m	(revision 12997)
+@@ -0,0 +1,19 @@
++function expflip(domainname)
++%EXPFLIP: flip orientation of all contours and domains in domainname exp file.
++%
++%Usage: expflip('MassFlux1.exp');a
++%
++%
++
++
++
++
++
++a=expread(domainname,1);
++
++for i=1:length(a),
++	a(i).x=flipud(a(i).x);
++	a(i).y=flipud(a(i).y);
++end
++
++expwrite(a,domainname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcoarsen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcoarsen.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcoarsen.m	(revision 12997)
+@@ -0,0 +1,74 @@
++function expcoarsen(newfile,oldfile,resolution);
++%EXPCOARSEN - coarsen an exp contour
++%
++%   This routine read an Argus file and remove points with respect to
++%   the resolution (in meters) given in input. 
++%
++%   Usage:
++%      expcoarsen(newfile,oldfile,resolution)
++%
++%   Example:
++%       expcoarsen('DomainOutline.exp','Antarctica.exp',4000)
++
++%Some checks
++if nargin~=3 | nargout
++	error('expcoarsen usage: expcoarsen(newfile,oldfile,resolution)')
++elseif ~exist(oldfile)
++	error(['expcut error message: the file ' oldfile  'does not exist'])
++elseif exist(newfile),
++	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
++	if ~strcmpi(choice,'y'),
++		disp('no modification done ... exiting');
++		return;
++	end
++end
++
++%Get exp oldfile
++[path root ext ver]=fileparts(oldfile);
++A=expread(oldfile);
++numprofiles=size(A,2);
++
++%Go through the profiles
++count=1;
++while count<=numprofiles,
++
++	%get number of points and initialize j
++	numpoints=length(A(count).x);
++	j=1;
++
++	%stop if we have reached end of profile (always keep the last point)
++	while j<numpoints,
++
++		%See whether we keep this point or not
++		distance=sqrt((A(count).x(j)-A(count).x(j+1))^2+(A(count).y(j)-A(count).y(j+1))^2);
++		if distance<resolution & j<numpoints-1  %do not remove last point
++			A(count).x(j+1)=[];
++			A(count).y(j+1)=[];
++			numpoints=numpoints-1;
++		else
++			division=floor(distance/resolution)+1;
++			if division>=2,
++				x=linspace(A(count).x(j),A(count).x(j+1),division)';
++				y=linspace(A(count).y(j),A(count).y(j+1),division)';
++				A(count).x=[A(count).x(1:j);x(2:end-1); A(count).x(j+1:end)];
++				A(count).y=[A(count).y(1:j);y(2:end-1); A(count).y(j+1:end)];
++
++				%update current point
++				j=j+1+division-2;
++				numpoints=numpoints+division-2;
++			else
++				%update current point
++				j=j+1;
++			end
++		end
++	end
++	if length(A(count).x)<=1,
++		A(count)=[];
++		numprofiles=numprofiles-1;
++	else
++		count=count+1;
++	end
++end
++
++%write output
++expwrite(A,newfile);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expmaster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expmaster.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expmaster.m	(revision 12997)
+@@ -0,0 +1,2 @@
++function expmaster(newfile,varargin)
++	disp('expmaster has been renamed exptool due to the unpopularity of its name')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exporientation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exporientation.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exporientation.m	(revision 12997)
+@@ -0,0 +1,12 @@
++function exporientation(filename)
++
++a=expread(filename);
++
++dx=diff(a.x);
++dx=[dx;dx(end)];
++
++dy=diff(a.y);
++dy=[dy;dy(end)];
++
++quiver(a.x,a.y,dx,dy);
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsplit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsplit.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsplit.m	(revision 12997)
+@@ -0,0 +1,31 @@
++function expsplit(domainoutline)
++%EXPSPLIT - split exp file into sub-contours
++%
++%   This routine reads in a domain outline file (Argus format) and plots all the contours 
++%   This will create as many files there are contours in the domain, each file will be postfix with _i
++%   where i is the contour name. 
++%
++%   Usage:
++%      expsplit(domainoutline)
++%
++%   Example:
++%      expsplit('Domain.exp');
++%
++%   See also EXPMASTER, EXPDOC
++
++%check nargin
++if ~nargin | nargin>1
++	help expsplit
++	error('expsplit error message: bad usage');
++end
++
++[path,root,ext]=fileparts(domainoutline);
++
++%Read file: 
++domains=expread(domainoutline,1);
++
++%split and write contours: 
++for i=1:length(domains),
++	subdomain=domains(i);
++	expwrite(subdomain,[root '_' num2str(i)  ext]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expswapxy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expswapxy.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expswapxy.m	(revision 12997)
+@@ -0,0 +1,23 @@
++function expswapxy(filename)
++%EXPSWAP - swap x and y fields
++% 
++%   Usage:
++%      expswap(file)
++%
++%   See also EXPMASTER, EXPDOC
++
++
++contours=expread(filename,1);
++
++newcontours=contours(1);
++
++for i=1:length(contours), 
++	contour=contours(i);
++	newcontour=contour;
++	newcontour.x=contour.y;
++	newcontour.y=contour.x;
++	newcontours(end+1)=newcontour;
++end
++newcontours=newcontours(2:end);
++
++expwrite(newcontours,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/explink.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/explink.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/explink.m	(revision 12997)
+@@ -0,0 +1,29 @@
++function explink(domainoutline,minthreshold,step)
++%EXPLINK - allow to link several segments of domain outline together
++%
++%   Takes a domain outline made of various segments, and links them together in one 
++%   domain outline. Use expview to see end result.
++%
++%   Usage:
++%      explink(domainoutline,minthreshold,step)
++%
++%   See also EXPMASTER, EXPDOC
++
++notdone=1;
++
++while notdone,
++
++	for i=1:1000,
++		status=expconcatenate(domainoutline,minthreshold+(i-1)*step);
++		if status==0,
++			return;
++		end
++		if status==1,
++			break;
++		end
++		if status==-1,
++			continue;
++		end
++	end
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expdisp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expdisp.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expdisp.m	(revision 12997)
+@@ -0,0 +1,52 @@
++function expdisp(domainoutline,varargin)
++%EXPDISP - plot the contours of a domain outline file
++%
++%   This routine reads in a domain outline file (Argus format) and plots all the contours 
++%
++%   Usage:
++%      expdisp(domainoutline,varargin)
++%      expdisp(domainoutline,figurenumber,linestyle,linewidth,unitmultiplier)
++%
++%   Example:
++%      expdisp('Domain.exp',1,'--r',2,10^3);
++%
++%   See also EXPMASTER, EXPDOC
++
++%check nargin
++if ~nargin | nargin>5
++	help expdisp
++	error('expdisp error message: bad usage');
++end
++
++%parse input
++if nargin<=1,
++	figurenumber=1;
++else
++	figurenumber=varargin{1};
++end
++if nargin<=2
++	linestyle='r-';
++else
++	linestyle=varargin{2};
++end
++if nargin<=3
++	linewidth=1;
++else
++	linewidth=varargin{3};
++end
++if nargin<=4
++	unitmultiplier=1;
++else
++	unitmultiplier=varargin{4}; if isnan(unitmultiplier), unitmultiplier=1; end
++end
++
++domain=expread(domainoutline);
++
++figure(figurenumber),hold on
++for i=1:length(domain),
++	if (isnumeric(linestyle))
++		plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'Color',linestyle,'linewidth',linewidth);
++	else
++		plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,linestyle,'linewidth',linewidth);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsquare.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsquare.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsquare.m	(revision 12997)
+@@ -0,0 +1,45 @@
++function expbox(filename)
++%EXPBOX - Create a ARGUS file using to clicks
++%
++%   Two clicks on a plot are used to generate a rectangular box
++%   This box is written in EXP format on filename
++%
++%   Usage:
++%      expbox(filename)
++
++%check
++if exist(filename,'file'),
++	choice=input(['A file ' filename ' already exists, do you want to modify it? (y/n)'],'s');
++	if ~strcmpi(choice,'y'),
++		disp('no modification done ... exiting');
++		return
++	end
++end
++
++%Get points
++disp('Click twice to define a rectangular domain. First click for upper left corner, second for lower right corner');
++[x,y]=ginput(2);
++
++xmiddle=mean(x);
++ymiddle=mean(y);
++
++x1=x(1); y1=y(1);
++x3=x(2); y3=y(2);
++
++Diag=[x1-xmiddle;y1-ymiddle];
++
++Vector=[xmiddle;ymiddle]+[-Diag(2);Diag(1)];
++x2=Vector(1); y2=Vector(2);
++
++Vector=[xmiddle;ymiddle]-[-Diag(2);Diag(1)];
++x4=Vector(1); y4=Vector(2);
++
++%Build Exp structure
++A=struct();
++A.nods=5;
++A.density=1;
++A.x=[x1 x2 x3 x4 x1]';
++A.y=[y1 y2 y3 y4 y1]';
++
++%Write structure
++expwrite(A,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expdoc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expdoc.m	(revision 12997)
+@@ -0,0 +1,36 @@
++function expdoc()
++%EXPDOC - create a doc for EXP routines
++%
++%   Usage:
++%      expdoc()
++
++disp(' ');
++disp('   Utilities dedicated to ARGUS Files (''.exp'' extension)'); 
++disp('     expboxgen: creates a domain outline box for a .tif image for the mosaic tiff');
++disp('            usage: expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)');
++disp('            x0,y0 and nx,ny are the cropping coordinates (upper left and lower right corners in the larger tiff image)');
++disp('            paramter_filename is the parameter file name for the mosaic tiff image. box_filename is self explanatory.');
++disp('     expconcatenate: display all the profiles present in an Argus file and merge them accordingly to the tips selected by the user')
++disp('            usage:  expconcatenate(newfile,oldfile)')
++disp('     expcreatecircle: creates a closed Argus contour centered on (x,y), of radius radius_length. The contour is made of N points');
++disp('            usage: expcreatecircle(filename,x0,y0,radius_length,N)');
++disp('     expcreatecontour: creates a closed Argus contour delimited by the ''clicks'' of the user');
++disp('            usage: expcreatecontour(filename)');
++disp('     expcreateprofile: creates an Argus profile delimited by the ''clicks'' of the user');
++disp('            usage: expcreateprofile(filename)');
++disp('     expcut: display the contents of an Argus file and allow the user cut the profiles');
++disp('            usage: expcut(newfilename,oldfilename)');
++disp('     expdisp: display the contents of an Argus file');
++disp('            usage:  expdisp(filename,[figure number],[line style])');
++disp('     expgen: creates an Argus file from a contour (x,y) and a flag indicating if the contour must be closed or open');
++disp('            usage:  expgen(filename,contours,close_flag)');
++disp('     explink: takes a domain outline made of various segments, and links them together in one domain outline. Use expview to see end result');
++disp('            usage: explink(domainoutline,minthreshold,step)');
++disp('     exptool: allows the user to create, close, merge, remove,... Argus files and save the result in newfile');
++disp('            usage: exptool(newfile,[oldfile1],[oldfile2],[oldfile3],[...]');
++disp('     expread: reads an Argus file and build a structure that holds all the information of the file');
++disp('            usage: expread(file,close_flag)');
++disp('     expselect: display all the profiles of oldfile, the user clicks on the contour he/she wants to remove. Results saved in newfile');
++disp('            usage: expselect(newfile,oldfile)');
++disp('     expwrite: writes an Argus file from a structure given in input???');
++disp('            usage: expwrite(structure,filename)');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodellist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodellist.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodellist.m	(revision 12997)
+@@ -0,0 +1,50 @@
++function varargout=loadmodellist(path)
++%LOADMODELLIST- load a model using built-in load module
++%
++%   check that modellist prototype has not changed. if so, adapt to new modellist prototype.
++%
++%   Usage:
++%      mds=loadmodellist(path)
++%      loadmodellist path
++
++%check nargout
++if nargout>1,
++	error('loadmodellist usage error: mds=loadmodellist(path)');
++end
++%check existence
++if ~exist(path)
++	error(['loadmodellist error message: file ' path ' does not exist']);
++end
++
++%check that the file is readable
++[stat,mess]=fileattrib(path);
++if( stat==0 | mess.UserRead~=1),
++	error(['loadmodellist error message: file ' path ' is not readable (permission dinied).']);
++end
++
++%check number of variables
++if length(whos('-file',path))>1,
++	error(['loadmodellist error message: file ' path ' contains several variables. Only one model should be present.']);
++end
++
++try,
++	struc=load(path,'-mat');
++
++	%get name of model variable
++	fieldname=char(fieldnames(struc));
++	mds=eval(['struc.' fieldname]);
++	if ~strcmpi(class(mds),'model'),
++		mds2=modellist;
++		mds2=structtomodel(mds2,mds);
++		mds=mds2;
++		clear mds2;
++	end
++	if nargout,
++		varargout{1}=mds;
++	else
++		assignin('caller',fieldname,mds);
++	end
++catch me
++	disp(getReport(me))
++	error(['could not load model ' path]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodel.m	(revision 12997)
+@@ -0,0 +1,46 @@
++function varargout=loadmodel(path)
++%LOADMODEL - load a model using built-in load module
++%
++%   check that model prototype has not changed. if so, adapt to new model prototype.
++%
++%   Usage:
++%      md=loadmodel(path)
++%      loadmodel path
++
++%check nargout
++if nargout>1,
++	error('loadmodel usage error: md=loadmodel(path)');
++end
++
++%check existence
++if exist(path,'file')
++	%do nothing
++elseif exist([path '.mat'],'file')
++	%add extension
++	path = [path '.mat'];
++else
++	error(['loadmodel error message: file ' path ' does not exist']);
++end
++
++try,
++	%recover model on file and name it md
++	warning off MATLAB:unknownElementsNowStruc;
++	warning off MATLAB:load:classNotFound
++	struc=load(path,'-mat');
++	warning on MATLAB:unknownElementsNowStruc;
++	warning on MATLAB:load:classNotFound
++
++	name=char(fieldnames(struc));
++	if size(name,1)>1,
++		error(['loadmodel error message: file ' path ' contains several variables. Only one model should be present.']); 
++	end
++	md=struc.(name);
++	if nargout,
++		varargout{1}=md;
++	else
++		assignin('caller',name,md);
++	end
++catch me
++	disp(getReport(me))
++	error(['could not load model ' path]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/ll2xy.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/ll2xy.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/ll2xy.m	(revision 12997)
+@@ -0,0 +1,66 @@
++function [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)  
++%LL2XY - converts lat long to polar stereographic
++%
++%   Converts from geodetic latitude and longitude to Polar 
++%   Stereographic (X,Y) coordinates for the polar regions.
++%   Author: Michael P. Schodlok, December 2003 (map2ll)
++%
++%   Usage:
++%      [x,y] = ll2xy(lat,lon,sgn)
++%      [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)
++%
++%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
++%                               -1 : south latitude (default is mer=0  lat=71)
++
++%Get central_meridian and standard_parallel depending on hemisphere
++if nargin==5,
++	delta = central_meridian;
++	slat  = standard_parallel;
++elseif nargin==3
++	if sgn == 1,
++		delta = 45; slat = 70;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++	elseif sgn==-1,
++		delta = 0;  slat = 71;
++		disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
++	else
++		error('Sign should be either +1 or -1');
++	end
++else
++	help ll2xy
++	error('bad usage');
++end
++
++% Conversion constant from degrees to radians
++cde  = 57.29577951;
++% Radius of the earth in meters
++re   = 6378.273*10^3;
++% Eccentricity of the Hughes ellipsoid squared
++ex2   = .006693883;
++% Eccentricity of the Hughes ellipsoid
++ex    =  sqrt(ex2);
++
++latitude  = abs(lat) * pi/180.;
++longitude = (lon + delta) * pi/180.;
++
++% compute X and Y in grid coordinates.
++T = tan(pi/4-latitude/2) ./ ((1-ex*sin(latitude))./(1+ex*sin(latitude))).^(ex/2);
++
++if (90 - slat) <  1.e-5 
++	rho = 2.*re*T/sqrt((1.+ex)^(1.+ex)*(1.-ex)^(1.-ex));
++else
++	sl  = slat*pi/180.;
++	tc  = tan(pi/4.-sl/2.)/((1.-ex*sin(sl))/(1.+ex*sin(sl)))^(ex/2.);
++	mc  = cos(sl)/sqrt(1.0-ex2*(sin(sl)^2));
++	rho = re*mc*T/tc;
++end
++
++y = -rho .* sgn .* cos(sgn.*longitude);
++x =  rho .* sgn .* sin(sgn.*longitude);
++
++[cnt1,cnt2] = find(latitude >= pi / 2.);
++
++if cnt1
++	x(cnt1,1) = 0.0;
++	y(cnt1,1) = 0.0;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/xy2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/xy2ll.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/xy2ll.m	(revision 12997)
+@@ -0,0 +1,72 @@
++function [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel)
++%XY2LL - converts xy to lat long
++%
++%   Converts Polar  Stereographic (X,Y) coordinates for the polar regions to
++%   latitude and longitude Stereographic (X,Y) coordinates for the polar
++%   regions.
++%   Author: Michael P. Schodlok, December 2003 (map2xy.m)
++%
++%   Usage:
++%      [lat,lon] = xy2ll(x,y,sgn);
++%      [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel);
++%
++%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
++%                               -1 : south latitude (default is mer=0  lat=71)
++
++%Get central_meridian and standard_parallel depending on hemisphere
++if nargin==5,
++	delta = central_meridian;
++	slat  = standard_parallel;
++elseif nargin==3
++	if sgn == 1,
++		delta = 45; slat = 70;
++		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++	elseif sgn==-1,
++		delta = 0;  slat = 71;
++		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
++	else
++		error('Sign should be either +1 or -1');
++	end
++else
++	help xy2ll
++	error('bad usage');
++end
++
++% Conversion constant from degrees to radians
++cde  = 57.29577951;
++% Radius of the earth in meters
++re   = 6378.273*10^3;
++% Eccentricity of the Hughes ellipsoid squared
++ex2   = .006693883;
++% Eccentricity of the Hughes ellipsoid
++ex    =  sqrt(ex2);
++
++sl  = slat*pi/180.;
++rho = sqrt(x.^2 + y.^2);
++cm = cos(sl) / sqrt(1.0 - ex2 * (sin(sl)^2));
++T = tan((pi / 4.0) - (sl / 2.0)) / ((1.0 - ex * sin(sl)) / (1.0 + ex * sin(sl)))^(ex / 2.0);
++
++if  abs(slat-90.) < 1.e-5
++	T = rho * sqrt((1. + ex)^(1. + ex) * (1. - ex)^(1. - ex)) / 2. / re;
++else
++	T = rho * T / (re * cm);
++end
++
++chi = (pi / 2.0) - 2.0 * atan(T);
++lat = chi + ((ex2 / 2.0) + (5.0 * ex2^2.0 / 24.0) + (ex2^3.0 / 12.0)) * ...
++	sin(2 * chi) + ((7.0 * ex2^2.0 / 48.0) + (29.0 * ex2^3 / 240.0)) * ...
++	sin(4.0 * chi) + (7.0 * ex2^3.0 / 120.0) * sin(6.0 * chi) ;
++
++lat = sgn * lat;
++lon = atan2(sgn * x,-sgn * y);
++lon = sgn * lon;
++
++[res1,res2] = find(rho <= 0.1);
++if res1
++	lat(res1,1) = 90. * sgn;
++	lon(res1,1) = 0.0;
++end
++
++lon = lon * 180. / pi;
++lat = lat * 180. / pi;
++lon = lon - delta; 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/pargenerate.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/pargenerate.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/pargenerate.m	(revision 12997)
+@@ -0,0 +1,45 @@
++function pargenerate(filename,xm,ym,data,varargin)
++%PARGENERATE - generate parameter file for images ala Rignot
++%
++%   Usage: 
++%      pargenerate(filename,data,xm,ym,options);
++%
++%   Supported options:
++%      - title: dataset title
++%      - latitude: standard latitude (degree)
++%      - meridian: meridian (degree)
++%      - format: binary format
++
++%process options
++options=pairoptions(varargin{:});
++Title=getfieldvalue(options,'title','N/A');
++latitude=getfieldvalue(options,'latitude','N/A');
++meridian=getfieldvalue(options,'meridian','N/A');
++format=getfieldvalue(options,'format','single');
++
++%Get data info
++[nlines ncols]=size(data);
++xmin=min(xm);
++ymax=max(ym);
++postx=abs(xm(2)-xm(1));
++posty=abs(ym(2)-ym(1));
++
++%Open header file and get machine type
++fid=fopen(filename,'wt');
++[filename, permission, machineformat, encoding] = fopen(fid);
++
++%write header file
++fprintf(fid,'%s\n','ISSM gridded dataset parameter file');
++fprintf(fid,'%s%s\n','title: ',Title);
++fprintf(fid,'%s  \n','DEM_projection: PS');
++fprintf(fid,'%s%s\n','data_format: ',format);
++fprintf(fid,'%s%s\n','endian:      ',machineformat);
++fprintf(fid,'%s%d\n','width:  ',ncols);
++fprintf(fid,'%s%d\n','nlines: ',nlines);
++fprintf(fid,'%s%g%s\n','PS_secant_lat:    ',latitude,'   decimal degrees');
++fprintf(fid,'%s%g%s\n','PS_meridian_long: ',meridian,'   decimal degrees');
++fprintf(fid,'%s%-15.10g\n','PS_corner_north:  ',ymax);
++fprintf(fid,'%s%-15.10g\n','PS_corner_east:   ',xmin);
++fprintf(fid,'%s%g%s\n','PS_post_north:    ',postx,' m');
++fprintf(fid,'%s%g%s\n','PS_post_east:     ',posty,' m');
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/utm2ll.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/utm2ll.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/utm2ll.m	(revision 12997)
+@@ -0,0 +1,117 @@
++function  [Lat,Lon] = utm2ll(xx,yy,utmzone)
++% -------------------------------------------------------------------------
++% [Lat,Lon] = utm2ll(x,y,utmzone)
++%
++% Description: Function to convert vectors of UTM coordinates into Lat/Lon vectors (WGS84).
++% Some code has been extracted from UTMIP.m function by Gabriel Ruiz Martinez.
++%
++% Inputs:on)
++%    -3.485713    7.801235 -119.955246  -17.759537  -94.799019  121.640266
++%
++% Example 2: If you need Lat/Lon coordinates in Degrees, Minutes and Seconds
++% [Lat, Lon]=utm2ll(x,y,utmzone);
++% LatDMS=dms2mat(deg2dms(Lat))
++%LatDMS =
++%    40.00         18.00         55.55
++%    46.00         17.00          2.01
++%    37.00         34.00         40.17
++%    28.00         38.00         44.33
++%    38.00         51.00         19.96
++%    25.00          3.00         42.41
++% LonDMS=dms2mat(deg2dms(Lon))
++%LonDMS =
++%    -3.00         29.00          8.61
++%     7.00         48.00          4.40
++%  -119.00         57.00         18.93
++%   -17.00         45.00         34.33
++%   -94.00         47.00         56.47
++%   121.00         38.00         24.96
++%
++% Author:
++%   Rafael Palacios
++%   Universidad Pontificia Comillas
++%   Madrid, Spain
++% Version: Apr/06, Jun/06, Aug/06
++% Aug/06: corrected m-Lint warnings
++%-------------------------------------------------------------------------
++
++% Argument checking
++%
++error(nargchk(3, 3, nargin)); %3 arguments required
++n1=length(xx);
++n2=length(yy);
++n3=size(utmzone,1);
++if (n1~=n2 || n1~=n3)
++	error('x,y and utmzone vectors should have the same number or rows');
++end
++c=size(utmzone,2);
++if (c~=4)
++	error('utmzone should be a vector of strings like "30 T"');
++end
++
++% Memory pre-allocation
++%
++Lat=zeros(n1,1);
++Lon=zeros(n1,1);
++
++% Main Loop
++%
++for i=1:n1
++	if (utmzone(i,4)>'X' || utmzone(i,4)<'C')
++		fprintf('utm2ll: Warning utmzone should be a vector of strings like "30 T", not "30 t"\n');
++	end
++	if (utmzone(i,4)>'M')
++		hemis='N';   % Northern hemisphere
++	else
++		hemis='S';
++	end
++
++	x=xx(i);
++	y=yy(i);
++	zone=str2double(utmzone(i,1:2));
++
++	sa = 6378137.000000 ; sb = 6356752.314245;
++
++	%   e = ( ( ( sa ^ 2 ) - ( sb ^ 2 ) ) ^ 0.5 ) / sa;
++	e2 = ( ( ( sa ^ 2 ) - ( sb ^ 2 ) ) ^ 0.5 ) / sb;
++	e2cuadrada = e2 ^ 2;
++	c = ( sa ^ 2 ) / sb;
++	%   alpha = ( sa - sb ) / sa;             %f
++	%   ablandamiento = 1 / alpha;   % 1/f
++
++	X = x - 500000;
++
++	if hemis == 'S' || hemis == 's'
++		Y = y - 10000000;
++	else
++		Y = y;
++	end
++
++	S = ( ( zone * 6 ) - 183 );
++	lat =  Y / ( 6366197.724 * 0.9996 );
++	v = ( c / ( ( 1 + ( e2cuadrada * ( cos(lat) ) ^ 2 ) ) ) ^ 0.5 ) * 0.9996;
++	a = X / v;
++	a1 = sin( 2 * lat );
++	a2 = a1 * ( cos(lat) ) ^ 2;
++	j2 = lat + ( a1 / 2 );
++	j4 = ( ( 3 * j2 ) + a2 ) / 4;
++	j6 = ( ( 5 * j4 ) + ( a2 * ( cos(lat) ) ^ 2) ) / 3;
++	alfa = ( 3 / 4 ) * e2cuadrada;
++	beta = ( 5 / 3 ) * alfa ^ 2;
++	gama = ( 35 / 27 ) * alfa ^ 3;
++	Bm = 0.9996 * c * ( lat - alfa * j2 + beta * j4 - gama * j6 );
++	b = ( Y - Bm ) / v;
++	Epsi = ( ( e2cuadrada * a^ 2 ) / 2 ) * ( cos(lat) )^ 2;
++	Eps = a * ( 1 - ( Epsi / 3 ) );
++	nab = ( b * ( 1 - Epsi ) ) + lat;
++	senoheps = ( exp(Eps) - exp(-Eps) ) / 2;
++	Delt = atan(senoheps / (cos(nab) ) );
++	TaO = atan(cos(Delt) * tan(nab));
++	longitude = (Delt *(180 / pi ) ) + S;
++	latitude = ( lat + ( 1 + e2cuadrada* (cos(lat)^ 2) - ( 3 / 2 ) * e2cuadrada * sin(lat) * cos(lat) * ( TaO - lat ) ) * ( TaO - lat ) ) * ...
++		(180 / pi);
++
++	Lat(i)=latitude;
++	Lon(i)=longitude;
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/VelFindVarNames.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/VelFindVarNames.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/VelFindVarNames.m	(revision 12997)
+@@ -0,0 +1,122 @@
++function Names=VelFindVarNames(filename)
++%VELFINDVARNAMES - find names of variables in a velocity data set file
++%
++%   This routines looks at the variables contained in a file and finds out
++%   the names of the variables that are needed for an interpolation (x,y,vx,vy)
++%   or (index,x,y,vx,vy)
++%
++%   Usage:
++%      Names=VelFindVarNames(filename)
++%
++%   Example:
++%      Names=VelFindVarNames('velocities.mat')
++%
++%   See also: INTERPFROMFILE, GRIDDATA
++
++%some checks
++if nargin~=1 | nargout~=1
++	help VelFindVarNames
++	error('VelFindVarNames error message: bad usage');
++end
++if ~exist(filename)
++	error(['VelFindVarNames error message: file ' filename  ' does not exist']);
++end
++
++%Get variables
++A=whos('-file',filename);
++
++%find x,y,vx and vy
++xenum=NaN; yenum=NaN; vxenum=NaN; vyenum=NaN; indexenum=NaN;
++if length(A)==4,
++	isnode=1;
++	for i=1:4
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		else
++			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
++				vxenum=i;
++			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
++				vyenum=i;
++			end
++		end
++	end
++elseif length(A)==5,
++	isnode=0;
++	for i=1:5
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		elseif (strcmpi(A(i).name(1),'index') | strcmpi(A(i).name(1),'elements'));
++			indexenum=i;
++		else
++			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
++				vxenum=i;
++			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
++				vyenum=i;
++			end
++		end
++	end
++else
++	error(['VelFindVarNames error message: file ' filename  ' not supported yet (it should hold 4 variables x,y,vx and vy (for nodes) OR 5 variables  x,y,index,vx and vy (for mesh))']);
++end
++
++%assum that we have found at least vxenum and vyenum
++if ( isnan(vxenum) | isnan(vyenum))
++	error(['VelFindVarNames error message: file ' filename  ' not supported yet (the velocities should be named vx and vy)']);
++end
++
++%find index
++if (~isnode & isnan(indexenum)),
++	for i=1:5
++		lengthi=min(A(i).size);
++		if (lengthi==3),
++			indexenum=i;
++		end
++	end
++	if isnan(indexenum),
++		error(['VelFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
++	end
++end
++
++%find x y
++if (isnan(xenum) | isnan(yenum))
++
++	%check the size
++	if A(vxenum).size(1)==A(vxenum).size(2),
++		error(['VelFindVarNames error message: file ' filename  ' not supported (velocities is a square matrix, save x and y with another name)']);
++	end
++	if ~(A(vxenum).size(1)==A(vyenum).size(1) & A(vxenum).size(2)==A(vyenum).size(2)),
++		error(['VelFindVarNames error message: file ' filename  ' not supported (vx and vy matrices do not have the same size)']);
++	end
++
++	%find xenum and yenum
++	for i=1:4
++		lengthi=max(A(i).size);
++		if ((i~=vxenum) & (lengthi==A(vxenum).size(1) | lengthi==A(vxenum).size(1)+1)),
++			yenum=i;
++		elseif ((i~=vxenum) & (lengthi==A(vxenum).size(2) | lengthi==A(vxenum).size(2)+1)),
++			xenum=i;
++		end
++	end
++
++	%last check
++	if (isnan(xenum) | isnan(yenum))
++		error(['plugdata error message: file ' filename  ' not supported yet']);
++	end
++end
++
++%create output
++Names=struct();
++Names.xname=A(xenum).name;
++Names.yname=A(yenum).name;
++Names.vxname=A(vxenum).name;
++Names.vyname=A(vyenum).name;
++if ~isnode,
++	Names.indexname=A(indexenum).name; 
++	Names.interp='mesh';
++else
++	Names.interp='node';
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/InterpFromFile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/InterpFromFile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/InterpFromFile.m	(revision 12997)
+@@ -0,0 +1,44 @@
++function data_out=InterpFromFile(x,y,filename,default_value)
++%INTERPFROMFILE - load data and interpolate on the given nodes
++%
++%   load a matlab file (extension .mat) which holds 3 or 4 variables
++%   and interpolate the data on the mesh and plug it onto the model.
++%
++%   o 3 variables
++%     - a vector x (if the name of the variable do not begin with "x", an error can appear)
++%     - a vector y (if the name of the variable do not begin with "y", an error can appear)
++%     - a vector or matrix data (if the name of the variable do not begin with the field name, an error can appear)
++%   o 4 variables
++%     - a vector x (if the name of the variable do not begin with "x", an error can appear)
++%     - a vector y (if the name of the variable do not begin with "y", an error can appear)
++%     - a matrix with 3 columns (if the name of the variable do not begin with "index" or "elements", an error can appear)
++%     - a vector data (if the name of the variable do not begin with the field name, an error can appear)
++%
++%   Usage:
++%      data=InterpFromFile(x,y,filename,default_value);
++%
++%   Example:
++%      md.geometry.surface=InterpFromFile(md.mesh.x,md.mesh.y,'surfacefile.mat',0);
++%
++%   See also: PLUGVELOCITIES, INTERPFROMGRID, INTERPFROMMESH2D, INTERPFROMMESH3D
++
++%some checks
++if nargin~=4 | nargout~=1
++	help InterpFromFile
++	error('plugdata error message: bad usage');
++end
++if ~exist(filename)
++	error(['plugdata error message: file ' filename  ' does not exist']);
++end
++if length(x)~=length(y),
++	error('plugdata error message: x and y should have the same length');
++end
++
++%load file
++Names=FieldFindVarNames(filename);
++Data=load(filename);
++if strcmpi(Names.interp,'node'),
++	data_out=InterpFromGridToMesh(Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y,default_value);
++else
++	data_out=InterpFromMeshToMesh2d(Data.(Names.indexname),Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FillHole.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FillHole.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FillHole.m	(revision 12997)
+@@ -0,0 +1,39 @@
++function field=FillHole(index,x,y,field)
++%FILLHOLE - fill mesh data that has holes in it (hole is defined by field==NaN). Get the nearest neighboors to fill the holes.
++%
++%   Usage:
++%      surface=FillHole(index,x,y,surface)
++%
++%   Example:
++%      md.geometry.surface=FillHole(md.mesh.elements,x,md.mesh.y,md.geometry.surface)
++%
++
++%some checks
++if nargin~=4 | nargout~=1
++	help FillHole
++	error('FillHole error message: bad usage');
++end
++
++if length(x)~=length(y),
++	error('plugdata error message: x and y should have the same length');
++end
++
++
++pos_hole=find(isnan(field));
++pos_full=find(~isnan(field));
++
++%reduce our field to not include any holes: 
++field_noholes=field(pos_full);
++x_noholes=x(pos_full);
++y_noholes=y(pos_full);
++
++for i=1:length(pos_hole)
++
++	if (mod(i,100)==0),
++		fprintf('\b\b\b\b\b\b\b%5.2f%s',i/length(pos_hole)*100,' %');
++	end
++
++	%search the node on the closest to i, that is not in a hole either
++	[d posd]=min(sqrt((x(pos_hole(i))-x_noholes).^2+(y(pos_hole(i))-y_noholes).^2));
++	field(pos_hole(i))=field_noholes(posd);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/plugvelocities.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/plugvelocities.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/plugvelocities.m	(revision 12997)
+@@ -0,0 +1,41 @@
++function md=plugvelocities(md,filename,default_value)
++%PLUGVELOCITIES - load velocities on a model
++%
++%   load a matlab file (extension .mat) which holds 4 variables
++%   x,y,vx,vy to be plugged onto the model (or similar names)
++%   x and y must be vectors, vx, vy matrices
++%
++%   Usage:
++%      md=plugvelocities(md,filename,default_value)
++%
++%   Example:
++%      md=plugvelocities(md,'velocityfile.mat',0);
++%
++%   See also: INTERPFROMFILE, GRIDDATA
++
++%some checks
++if nargin~=3 | nargout~=1
++	help plugvelocities
++	error('plugvelocities error message: bad usage');
++end
++if ~exist(filename)
++	error(['plugvelocities error message: file ' filename  ' does not exist']);
++end
++
++%load velocities 
++Names=VelFindVarNames(filename);
++Vel=load(filename);
++
++%Interpolation
++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,default_value);
++	md.inversion.vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,default_value);
++else
++	md.inversion.vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,default_value);
++	md.inversion.vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,default_value);
++end
++
++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.vel=md.inversion.vel_obs;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/PatchToVec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/PatchToVec.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/PatchToVec.m	(revision 12997)
+@@ -0,0 +1,21 @@
++function vec=PatchToVec(Patch);
++%PATCHTOVEC - converts a patch to a vector by averaging over each vertex
++%
++%   Usage:
++%      vec=PatchToVec(Patch)
++
++%if the patch is P0: we have element values, return an element vector
++switch(size(Patch.value,2)),
++	case 1,
++		vec(Patch.element)=Patch.value;
++	case 3,
++		connectivity=sparse(Patch.index(:),1,1);
++		value       =sparse(Patch.index(:),1,Patch.value(:));
++		vec=full(value./connectivity);
++	case 6,
++		connectivity=sparse(Patch.index(:),1,1);
++		value       =sparse(Patch.index(:),1,Patch.value(:));
++		vec=full(value./connectivity);
++	otherwise,
++		error('interpolation not supported yet');
++	end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FieldFindVarNames.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FieldFindVarNames.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FieldFindVarNames.m	(revision 12997)
+@@ -0,0 +1,153 @@
++function Names=FieldFindVarNames(filename)
++%FIELDFINDVARNAMES - find names of variables in a data set file
++%
++%   This routines looks at the variables contained in a file and finds out
++%   the names of the variables that are needed for an interpolation (x,y,data)
++%   or (index,x,y,data)
++%
++%   Usage:
++%      Names=FieldFindVarNames(filename)
++%
++%   Example:
++%      Names=FieldFindVarNames('thickness.mat')
++%
++%   See also: INTERPFROMFILE, GRIDDATA
++
++%some checks
++if nargin~=1 | nargout~=1
++	help FieldFindVarNames
++	error('FieldFindVarNames error message: bad usage');
++end
++if ~exist(filename)
++	error(['FieldFindVarNames error message: file ' filename  ' does not exist']);
++end
++
++%Get variables
++A=whos('-file',filename);
++
++%find x,y,vx and vy
++xenum=NaN; yenum=NaN; dataenum=NaN; indexenum=NaN;
++if length(A)==3,
++	isnode=1;
++	for i=1:3
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
++			dataenum=i;
++		else
++			%nothing
++		end
++	end
++elseif length(A)==4,
++	isnode=0;
++	for i=1:4
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		elseif (strncmpi(A(i).name,'index',5) | strncmpi(A(i).name,'elements',7));
++			indexenum=i;
++		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
++			dataenum=i;
++		else
++			%nothing
++		end
++	end
++else
++	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (it should hold 3 variables x,y and data (for nodes) OR 4 variables  x,y,index and data (for mesh))']);
++end
++
++%2: if only one item is missing, find it by elimination
++if ~isnode,
++	pos=find(isnan([xenum yenum indexenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:4,list);
++		elseif pos==2,
++			yenum=setdiff(1:4,list);
++		elseif pos==3,
++			indexenum=setdiff(1:4,list);
++		elseif pos==4,
++			dataenum=setdiff(1:4,list);
++		end
++	end
++else
++	pos=find(isnan([xenum yenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:3,list);
++		elseif pos==2,
++			yenum=setdiff(1:3,list);
++		elseif pos==3,
++			dataenum=setdiff(1:3,list);
++		end
++	end
++end
++
++%assum that we have found at least xenum and yenum
++if ( isnan(xenum) | isnan(yenum))
++	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (the coordinates vectors should be named x and y)']);
++end
++
++%find index
++if (~isnode & isnan(indexenum)),
++	for i=1:4
++		lengthi=min(A(i).size);
++		if (lengthi==3),
++			indexenum=i;
++		end
++	end
++	if isnan(indexenum),
++		error(['FieldFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
++	end
++end
++
++%4: last chance
++if ~isnode,
++	pos=find(isnan([xenum yenum indexenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:4,list);
++		elseif pos==2,
++			yenum=setdiff(1:4,list);
++		elseif pos==3,
++			indexenum=setdiff(1:4,list);
++		elseif pos==4,
++			dataenum=setdiff(1:4,list);
++		end
++	end
++else
++	pos=find(isnan([xenum yenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:3,list);
++		elseif pos==2,
++			yenum=setdiff(1:3,list);
++		elseif pos==3,
++			dataenum=setdiff(1:3,list);
++		end
++	end
++end
++
++%last check
++if isnan(dataenum)
++	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (data not found)']);
++end
++
++%create output
++Names=struct();
++Names.xname=A(xenum).name;
++Names.yname=A(yenum).name;
++Names.dataname=A(dataenum).name;
++if ~isnode,
++	Names.indexname=A(indexenum).name; 
++	Names.interp='mesh';
++else
++	Names.interp='node';
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/create_region.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/create_region.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/create_region.m	(revision 12997)
+@@ -0,0 +1,15 @@
++function create_region(name)
++%CREATE_REGION - create region  ????
++%
++%   very temporary function.
++%   
++%   Usage: 
++%      create_region(name)
++
++eval(['mkdir ' name]);
++eval(['cd ' name ]);
++!mkdir Delivery Exp_Par Results
++cd Exp_Par
++!cp ../../RonneShelf/Exp_Par/* ./
++!rm -rf Hole*
++eval(['!mv Ronne.par ' name '.par']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/findarg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/findarg.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/findarg.m	(revision 12997)
+@@ -0,0 +1,51 @@
++function  vals=findarg(arglist,field)
++%FINDARG - find argument associated to a field in a list
++%
++%   This function parses through an argument list (typically varargin in a routine)
++%   looking for a character array equal to field. Once this is found, we return the 
++%   next value in the varargin (if possible). 
++%   Because field might appear several times in the argument list, we return a structure 
++%   holding all these values. 
++%   Note that all comparisons to field value are case independent.
++%
++%   Usage:
++%      vals=findarg(arglist,field)
++%
++%   Example:
++%      routine foobar calls vals=findarg('Data',varargin)
++%      with varargin='Data',1,'Data','foo','Plot','velocity','Arrow',4
++%      findarg would return the following structure: vals(1).value=1, vals(2).value='foo'; 
++
++%some argument checking: 
++if ((nargin==0) | (nargout==0)),
++	help findarg;
++	error('findarg error message');
++end
++
++if ~ischar(field),
++	error('findarg error message: field should be a string');
++end
++
++if ~iscell(arglist),
++	error('findarg error message: argument list should be a cell array.');
++end
++
++%Recover data to plot
++founddata=0;
++
++for i=1:(length(arglist)-1), %data in arglist comes in pairs, hence the -1.
++	if ischar(arglist{i}),
++		if (strcmpi(arglist{i},field)),
++			founddata=founddata+1;
++			if founddata==1,
++				vals.value=arglist{i+1};
++			else
++				vals(end+1).value=arglist{i+1};
++			end
++		end
++	end
++end
++
++if founddata==0,
++	vals=[];
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf2struct.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf2struct.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf2struct.m	(revision 12997)
+@@ -0,0 +1,27 @@
++function S=netcdf2struct(File)
++%NETCDF2STRUCT - load netcdf file and convert to a matlab structure
++%
++%   Usage:
++%      S=netcdf2struct(File);
++
++%Read netcdf file
++data=netcdf(File);
++
++%initialize output
++S=struct();
++
++%All the variables are in VarArray field
++variables=data.VarArray;
++for i=1:size(variables,2),
++	fieldname=deblank(variables(i).Str);
++	fieldvalue=double(squeeze(variables(i).Data));
++	S.(fieldname)=fieldvalue;
++end
++
++%All the variables are in AttArray field
++variables=data.AttArray;
++for i=1:size(variables,2),
++	fieldname=deblank(variables(i).Str);
++	fieldvalue=double(variables(i).Val);
++	S.(fieldname)=fieldvalue;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/issmdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/issmdoc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/issmdoc.m	(revision 12997)
+@@ -0,0 +1,15 @@
++%Quick documentation for ISSM
++
++%First get ISSM tier: 
++ISSM_DIR=issmdir;
++
++disp(sprintf('\n%s','  A comprehensive documentation is available on http://issm.jpl.nasa.gov'));
++disp(sprintf('\n%s','  Example: how to create a square ice shelf'));
++disp(sprintf('%s','	   go to ',ISSM_DIR,'/examples/SquareIceshelf'));
++disp(sprintf('%s','	   md=model;                                %creates a new empty model structure'));
++disp(sprintf('%s','	   md=triangle(md,''DomainOutline.exp'',50000);   %creates a mesh of the domain outline with a resolution of 50000m'));
++disp(sprintf('%s','	   md=setmask(md,''all'','''');               %defines the glacier system as an ice shelf (no island)'));
++disp(sprintf('%s','	   md=parameterize(md,''Square.par'');        %fills all the other fields of the model'));
++disp(sprintf('%s','	   md=setflowequation(md,''macayeal'',''all''); %defines all elements as MacAyeal''s'));
++disp(sprintf('%s','	   md=solve(md,DiagnosticSolutionEnum);   %generate the velocity field'));
++disp(sprintf('%s','	   plotmodel(md,''data'',md.results.DiagnosticSolution.Vel);    %displays the velocity (type plotdoc for plotmodel help)'));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/structtoobj.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/structtoobj.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/structtoobj.m	(revision 12997)
+@@ -0,0 +1,16 @@
++function obj=structtoobj(obj,S),
++%Convert struct to object
++
++	%Get object and structure fields
++	structfields=fields(S);
++	objprops    =properties(class(obj));
++
++	%recover object properties
++	for i=1:length(structfields),
++		fieldname =structfields{i};
++		if ismember(fieldname,objprops),
++			fieldvalue=getfield(S,fieldname);
++			obj=setfield(obj,fieldname,fieldvalue);
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf.m	(revision 12997)
+@@ -0,0 +1,136 @@
++function S = netcdf(File,varargin)
++% Function to read NetCDF files
++%   S = netcdf(File)
++% Input Arguments
++%   File = NetCDF file to read
++% Optional Input Arguments:
++%   'Var',Var - Read data for VarArray(Var), default [1:length(S.VarArray)]
++%   'Rec',Rec - Read data for Record(Rec), default [1:S.NumRecs]
++% Output Arguments:
++%   S    = Structure of NetCDF data organised as per NetCDF definition
++% Notes:
++%   Only version 1, classic 32bit, NetCDF files are supported. By default
++% data are extracted into the S.VarArray().Data field for all variables.
++% To read the header only call S = netcdf(File,'Var',[]);
++%
++% SEE ALSO
++% ---------------------------------------------------------------------------
++S = [];
++
++try
++   if exist(File,'file') fp = fopen(File,'r','b');
++   else fp = []; error('File not found'); end
++   if fp == -1   error('Unable to open file'); end
++
++% Read header
++   Magic = fread(fp,4,'uint8=>char');
++   if strcmp(Magic(1:3),'CDF') error('Not a NetCDF file'); end
++   if uint8(Magic(4))~=1       error('Version not supported'); end
++   S.NumRecs  = fread(fp,1,'uint32=>uint32');
++   S.DimArray = DimArray(fp);
++   S.AttArray = AttArray(fp);
++   S.VarArray = VarArray(fp);
++
++% Setup indexing to arrays and records
++   Var = ones(1,length(S.VarArray));
++   Rec = ones(1,S.NumRecs);
++   for i = 1:2:length(varargin)
++      if     strcmp(upper(varargin{i}),'VAR') Var=Var*0; Var(varargin{i+1})=1;
++      elseif strcmp(upper(varargin{i}),'REC') Rec=Rec*0; Rec(varargin{i+1})=1;
++      else error('Optional input argument not recognised'); end
++   end
++   if sum(Var)==0 fclose(fp); return; end
++
++% Read non-record variables
++   Dim = double(cat(2,S.DimArray.Dim));
++   ID  = double(cat(2,S.VarArray.Type));
++
++   for i = 1:length(S.VarArray)
++      D = Dim(S.VarArray(i).DimID+1); N = prod(D); RecID{i}=find(D==0);
++      if isempty(RecID{i})
++         if length(D)==0 D = [1,1]; N = 1; elseif length(D)==1 D=[D,1]; end
++         if Var(i)
++            S.VarArray(i).Data = ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D);
++            fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8');
++         else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
++      else S.VarArray(i).Data = []; end
++   end
++
++% Read record variables
++   for k = 1:S.NumRecs
++      for i = 1:length(S.VarArray)
++         if ~isempty(RecID{i})
++            D = Dim(S.VarArray(i).DimID+1); D(RecID{i}) = 1; N = prod(D);
++            if length(D)==1 D=[D,1]; end
++            if Var(i) & Rec(k)
++               S.VarArray(i).Data = cat(RecID{i},S.VarArray(i).Data,...
++                  ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D));
++               if N > 1 fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8'); end
++            else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
++         end
++      end
++   end
++
++   fclose(fp);
++catch
++   Err = lasterror; fprintf('%s\n',Err.message);
++   if ~isempty(fp) && fp ~= -1 fclose(fp); end
++end
++
++% ---------------------------------------------------------------------------------------
++% Utility functions
++
++function S = Size(ID)
++% Size of NetCDF data type, ID, in bytes
++   S = subsref([1,1,2,4,4,8],struct('type','()','subs',{{ID}}));
++
++function T = Type(ID)
++% Matlab string for CDF data type, ID
++   T = subsref({'int8','char','int16','int32','single','double'},...
++               struct('type','{}','subs',{{ID}}));
++
++function N = Pad(Num,ID)
++% Number of elements to read after padding to 4 bytes for type ID
++   N = (double(Num) + mod(4-double(Num)*Size(ID),4)/Size(ID)).*(Num~=0);
++
++function S = String(fp)
++% Read a CDF string; Size,[String,[Padding]]
++   S = fread(fp,Pad(fread(fp,1,'uint32=>uint32'),1),'uint8=>char').';
++
++function A = ReOrder(A,S)
++% Rearrange CDF array A to size S with matlab ordering
++   A = permute(reshape(A,fliplr(S)),fliplr(1:length(S)));
++
++function S = DimArray(fp)
++% Read DimArray into structure
++   if fread(fp,1,'uint32=>uint32') == 10 % NC_DIMENSION
++      for i = 1:fread(fp,1,'uint32=>uint32')
++         S(i).Str = String(fp);
++         S(i).Dim = fread(fp,1,'uint32=>uint32');
++      end
++   else fread(fp,1,'uint32=>uint32'); S = []; end
++
++function S = AttArray(fp)
++% Read AttArray into structure
++   if fread(fp,1,'uint32=>uint32') == 12 % NC_ATTRIBUTE
++      for i = 1:fread(fp,1,'uint32=>uint32')
++         S(i).Str = String(fp);
++         ID       = fread(fp,1,'uint32=>uint32');
++         Num      = fread(fp,1,'uint32=>uint32');
++         S(i).Val = fread(fp,Pad(Num,ID),[Type(ID),'=>',Type(ID)]).';
++      end
++   else fread(fp,1,'uint32=>uint32'); S = []; end
++
++function S = VarArray(fp)
++% Read VarArray into structure
++   if fread(fp,1,'uint32=>uint32') == 11 % NC_VARIABLE
++      for i = 1:fread(fp,1,'uint32=>uint32')
++         S(i).Str      = String(fp);
++         Num           = double(fread(fp,1,'uint32=>uint32'));
++         S(i).DimID    = double(fread(fp,Num,'uint32=>uint32'));
++         S(i).AttArray = AttArray(fp);
++         S(i).Type     = fread(fp,1,'uint32=>uint32');
++         S(i).VSize    = fread(fp,1,'uint32=>uint32');
++         S(i).Begin    = fread(fp,1,'uint32=>uint32'); % Classic 32 bit format only
++      end
++   else fread(fp,1,'uint32=>uint32'); S = []; end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.py	(revision 12997)
+@@ -0,0 +1,50 @@
++from numpy import *
++
++def paterson(temperature):
++
++    # Local Variables: pos11, pos5, pos10, temperature, pos, T, pos8, pos9, pos6, pos7, pos4, rigidity, pos2, pos3, pos1
++    # Function calls: length, zeros, argwhere, paterson, error
++    #PATERSON - figure out the rigidity of ice for a given temperature
++    #
++    #   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
++    #   temperature is in Kelvin degrees
++    #
++    #   Usage:
++    #      rigidity=paterson(temperature)
++    
++	pos=argwhere(temperature<0.)
++	if len(pos):
++		print 'input temperature should be in Kelvin (positive)'
++		return []
++    
++	T = temperature-273.15
++	#The routine below is equivalent to:
++	# n=3; T=temperature-273;
++	# %From paterson,
++	# Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
++	# A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
++	# 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
++	# %Convert into rigidity B
++	# B=A.^(-1/n)*10^3; %s^(1/3)Pa
++	# %Now, do a cubic fit between Temp and B: 
++	# fittedmodel=fit(Temp,B,'cubicspline');
++	# rigidity=fittedmodel(temperature);
++
++	rigidity=zeros(len(T))
++	pos1=argwhere(T<=-45);           rigidity[pos1]=10**8*(-0.000292866376675*(T[pos1]+50)**3+ 0.011672640664130*(T[pos1]+50)**2  -0.325004442485481*(T[pos1]+50)+  6.524779401948101)
++	pos2=argwhere(logical_and(-45<=T,T<-40));   rigidity[pos2]=10**8*(-0.000292866376675*(T[pos2]+45)**3+ 0.007279645014004*(T[pos2]+45)**2  -0.230243014094813*(T[pos2]+45)+  5.154964909039554)
++	pos3=argwhere(logical_and(-40<=T,T<-35));   rigidity[pos3]=10**8*(0.000072737147457*(T[pos3]+40)**3+  0.002886649363879*(T[pos3]+40)**2  -0.179411542205399*(T[pos3]+40)+  4.149132666831214)
++	pos4=argwhere(logical_and(-35<=T,T<-30));   rigidity[pos4]=10**8*(-0.000086144770023*(T[pos4]+35)**3+ 0.003977706575736*(T[pos4]+35)**2  -0.145089762507325*(T[pos4]+35)+  3.333333333333331)
++	pos5=argwhere(logical_and(-30<=T,T<-25));   rigidity[pos5]=10**8*(-0.000043984685769*(T[pos5]+30)**3+ 0.002685535025386*(T[pos5]+30)**2  -0.111773554501713*(T[pos5]+30)+  2.696559088937191)
++	pos6=argwhere(logical_and(-25<=T,T<-20));   rigidity[pos6]=10**8*(-0.000029799523463*(T[pos6]+25)**3+ 0.002025764738854*(T[pos6]+25)**2  -0.088217055680511*(T[pos6]+25)+  2.199331606342181)
++	pos7=argwhere(logical_and(-20<=T,T<-15));   rigidity[pos7]=10**8*(0.000136920904777*(T[pos7]+20)**3+  0.001578771886910*(T[pos7]+20)**2  -0.070194372551690*(T[pos7]+20)+  1.805165505978111)
++	pos8=argwhere(logical_and(-15<=T,T<-10));   rigidity[pos8]=10**8*(-0.000899763781026*(T[pos8]+15)**3+ 0.003632585458564*(T[pos8]+15)**2  -0.044137585824322*(T[pos8]+15)+  1.510778053489523)
++	pos9=argwhere(logical_and(-10<=T,T<-5));    rigidity[pos9]=10**8*(0.001676964325070*(T[pos9]+10)**3-  0.009863871256831*(T[pos9]+10)**2  -0.075294014815659*(T[pos9]+10)+  1.268434288203714)
++	pos10=argwhere(logical_and(-5<=T,T<-2));    rigidity[pos10]=10**8*(-0.003748937622487*(T[pos10]+5)**3+0.015290593619213*(T[pos10]+5)**2  -0.048160403003748*(T[pos10]+5)+  0.854987973338348)
++	pos11=argwhere(-2<=T);           rigidity[pos11]=10**8*(-0.003748937622488*(T[pos11]+2)**3-0.018449844983174*(T[pos11]+2)**2  -0.057638157095631*(T[pos11]+2)+  0.746900791092860)
++
++	#Now make sure that rigidity is positive
++	pos=argwhere(rigidity<0);        rigidity[pos]=1**6 
++
++	return rigidity
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.m	(revision 12997)
+@@ -0,0 +1,42 @@
++function rigidity=paterson(temperature)
++%PATERSON - figure out the rigidity of ice for a given temperature
++%
++%   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
++%   temperature is in Kelvin degrees
++%
++%   Usage:
++%      rigidity=paterson(temperature)
++
++if(temperature<0)
++	error('input temperature should be in Kelvin (positive)');
++end
++T=temperature-273.15;
++
++%The routine below is equivalent to:
++
++% n=3; T=temperature-273;
++% %From paterson,
++% Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
++% A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
++% 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
++% %Convert into rigidity B
++% B=A.^(-1/n)*10^3; %s^(1/3)Pa
++% %Now, do a cubic fit between Temp and B: 
++% fittedmodel=fit(Temp,B,'cubicspline');
++% rigidity=fittedmodel(temperature);
++
++rigidity=zeros(length(T),1);
++pos1=find(T<=-45);           rigidity(pos1)=10^8*(-0.000292866376675*(T(pos1)+50).^3+ 0.011672640664130*(T(pos1)+50).^2  -0.325004442485481*(T(pos1)+50)+  6.524779401948101);
++pos2=find(-45<=T & T<-40);   rigidity(pos2)=10^8*(-0.000292866376675*(T(pos2)+45).^3+ 0.007279645014004*(T(pos2)+45).^2  -0.230243014094813*(T(pos2)+45)+  5.154964909039554);
++pos3=find(-40<=T & T<-35);   rigidity(pos3)=10^8*(0.000072737147457*(T(pos3)+40).^3+  0.002886649363879*(T(pos3)+40).^2  -0.179411542205399*(T(pos3)+40)+  4.149132666831214);
++pos4=find(-35<=T & T<-30);   rigidity(pos4)=10^8*(-0.000086144770023*(T(pos4)+35).^3+ 0.003977706575736*(T(pos4)+35).^2  -0.145089762507325*(T(pos4)+35)+  3.333333333333331);
++pos5=find(-30<=T & T<-25);   rigidity(pos5)=10^8*(-0.000043984685769*(T(pos5)+30).^3+ 0.002685535025386*(T(pos5)+30).^2  -0.111773554501713*(T(pos5)+30)+  2.696559088937191);
++pos6=find(-25<=T & T<-20);   rigidity(pos6)=10^8*(-0.000029799523463*(T(pos6)+25).^3+ 0.002025764738854*(T(pos6)+25).^2  -0.088217055680511*(T(pos6)+25)+  2.199331606342181);
++pos7=find(-20<=T & T<-15);   rigidity(pos7)=10^8*(0.000136920904777*(T(pos7)+20).^3+  0.001578771886910*(T(pos7)+20).^2  -0.070194372551690*(T(pos7)+20)+  1.805165505978111);
++pos8=find(-15<=T & T<-10);   rigidity(pos8)=10^8*(-0.000899763781026*(T(pos8)+15).^3+ 0.003632585458564*(T(pos8)+15).^2  -0.044137585824322*(T(pos8)+15)+  1.510778053489523);
++pos9=find(-10<=T & T<-5);    rigidity(pos9)=10^8*(0.001676964325070*(T(pos9)+10).^3-  0.009863871256831*(T(pos9)+10).^2  -0.075294014815659*(T(pos9)+10)+  1.268434288203714);
++pos10=find(-5<=T & T<-2);    rigidity(pos10)=10^8*(-0.003748937622487*(T(pos10)+5).^3+0.015290593619213*(T(pos10)+5).^2  -0.048160403003748*(T(pos10)+5)+  0.854987973338348);
++pos11=find(-2<=T);           rigidity(pos11)=10^8*(-0.003748937622488*(T(pos11)+2).^3-0.018449844983174*(T(pos11)+2).^2  -0.057638157095631*(T(pos11)+2)+  0.746900791092860);
++
++%Now make sure that rigidity is positive
++pos=find(rigidity<0);        rigidity(pos)=10^6;
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/carter.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/carter.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/carter.m	(revision 12997)
+@@ -0,0 +1,28 @@
++function attenuation=carter(temperature)
++%CARTER - attenuation as a function of temperature
++%
++%   TWO WAY - Attenuation (in dB/m) as a function of temperature (K)
++%   From Carter at al. 2007 (Radar-based subglacial lake classification in Antarctica)
++%   Figure 4
++%
++%   Usage:
++%      attenuation=carter(temperature)
++
++if(temperature<0)
++	error('input temperature should be in Kelvin (positive)');
++end
++T=temperature-273.15;
++
++Temp=[-50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0]';
++A=[0.0015 0.002 0.003 0.0042 0.0055 0.0083 0.012 0.0175 0.026 0.038 0.055]';
++
++%Now, do a cubic fit between Temp and B: 
++[cfun,gof,output]=fit(Temp,A,'cubicspline');
++%breaks=cfun.p.breaks;
++%coeff=cfun.p.coefs;
++
++%Calculate attenuation
++attenuation=cfun(T);
++
++%Make it a 2 way attenuation
++attenuation=2*attenuation;
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/carter.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/lithostaticpressure.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/lithostaticpressure.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/lithostaticpressure.m	(revision 12997)
+@@ -0,0 +1,7 @@
++function pressure=lithostaticpressure(rho_ice,g,s,z);
++%LITHOSTATICPRESSURE - compute the lithostatic pressure
++%
++%   Usage:
++%      pressure=lithostacticpressure(rho_ice,g,surface,z)
++
++pressure=rho_ice*g*(s-z);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/varmap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/varmap.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/varmap.m	(revision 12997)
+@@ -0,0 +1,55 @@
++function output = varmap(x,y,data,varargin);
++%VARMAP - use gslib for Kriging
++%
++%   Usage:
++%      output = varmap(x,y,data,varargin)
++
++options=pairoptions(varargin{:});
++
++nxlag = getfieldvalue(options,'nxlag', 20);
++nylag = getfieldvalue(options,'nylag', 20);
++dxlag = getfieldvalue(options,'dxlag', 1000);
++dylag = getfieldvalue(options,'dylag', 1000);
++
++%Write data file
++fid=fopen('cluster.dat','w');
++fprintf(fid,'%s\n','Data file');
++fprintf(fid,'%i\n',3);
++fprintf(fid,'%s\n','Xlocation');
++fprintf(fid,'%s\n','Ylocation');
++fprintf(fid,'%s\n','Data');
++fprintf(fid,'%g %g %g\n',[x y data]');
++fclose(fid);
++
++%Write parameter file
++fid=fopen('varmap.par','w');
++fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
++fprintf(fid,'\t\t\t\t%s\n','*******************');
++fprintf(fid,'\n');
++fprintf(fid,'%s\n','START OF PARAMETERS:');
++fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
++fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
++fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
++fprintf(fid,'%-30s %s\n','0    '                      ,'\1=regular grid, 0=scattered values');
++fprintf(fid,'%-30s %s\n','50 50 1'                    ,'\if =1: nx, ny, nz');
++fprintf(fid,'%-30s %s\n','1.0 1.0 1.0'                ,'\       xsiz, ysiz, zsiz if igrid=1');
++fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\if =0: columns for x, y and z coordinates');
++fprintf(fid,'%-30s %s\n','varmap.out'                 ,'\file for variogram output');
++fprintf(fid,'%-30s %s\n',num2str([nxlag nylag 0],'%i '),'\nxlag, nylag, nzlag');
++fprintf(fid,'%-30s %s\n',num2str([dxlag dylag 1],'%g %g %i'),'\dxlag, dylag, dzlag');
++fprintf(fid,'%-30s %s\n','5'                          ,'\minimum number of pairs');
++fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
++fprintf(fid,'%-30s %s\n','1'                          ,'\number of variograms');
++fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail, head, variogram type');
++fclose(fid);
++
++%Call varmap
++system([issmdir() '/externalpackages/gslib/install/varmap varmap.par']);
++delete('varmap.par');
++
++%Read output
++fid=fopen('varmap.out','r');
++A = textscan(fid,'%f %f %f %f %f %f','headerlines',8);
++fclose(fid);
++delete('varmap.out')
++output = reshape(A{1},[2*nxlag+1 2*nylag+1]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataBoundaries.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataBoundaries.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataBoundaries.m	(revision 12997)
+@@ -0,0 +1,43 @@
++function	[Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
++%CREATEDATABOUNDARIES - Create values on the edge of the matrix
++%
++%   This function create vectors with coordinates and values to constrain a matrix 
++%   on its edge from a given matrix tiwh data everywhere.
++%   x_m and y_m belongs to the matrix to be constrained
++%   x_matrix, y_matrix belongs to the matrix to be constrained with
++%   datamatrix is the matrix with values for the constraint
++%
++%   Usage:
++%      [Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
++% 
++%   See also: TRACKSTOMATRIX, CREATEDATAMATRIX
++
++%Check the consistency of the data matrix
++if(length(x_matrix)~=(size(datamatrix,2)+1) | length(y_matrix)~=(size(datamatrix,1)+1)),
++	error('CreateDataBoundaries error message: size of matrix and vectors to constrained not consistent')
++end
++
++nxglobal=length(x_m);
++nyglobal=length(y_m);
++
++%Create the edgevalues and coordinates
++xedge1=x_m(1)*ones(nyglobal,1);
++xedge2=x_m(2:end-1);
++xedge3=x_m(end)*ones(nyglobal,1);
++xedge4=x_m(2:end-1);
++xedge5=x_m(2)*ones(nyglobal-2,1);
++xedge6=x_m(3:end-2);
++xedge7=x_m(end-1)*ones(nyglobal-2,1);
++xedge8=x_m(3:end-2);
++yedge1=y_m;
++yedge2=y_m(1)*ones(nxglobal-2,1);
++yedge3=y_m;
++yedge4=y_m(end)*ones(nxglobal-2,1);
++yedge5=y_m(2:end-1);
++yedge6=y_m(2)*ones(nxglobal-4,1);
++yedge7=y_m(2:end-1);
++yedge8=y_m(end-1)*ones(nxglobal-4,1);
++
++Xedge=[xedge1;xedge2;xedge3;xedge4;xedge5;xedge6;xedge7;xedge8];
++Yedge=[yedge1;yedge2;yedge3;yedge4;yedge5;yedge6;yedge7;yedge8];
++EdgeValues=DataInterp(x_matrix,y_matrix,datamatrix,Xedge,Yedge);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gamv.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gamv.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gamv.m	(revision 12997)
+@@ -0,0 +1,70 @@
++function output = gamv(x,y,data,varargin);
++%GAMV - use gslib for Kriging
++%
++%   Usage:
++%      output = gamv(x,y,data,varargin)
++
++options=pairoptions(varargin{:});
++
++nlag = getfieldvalue(options,'nlag', 20);
++dlag = getfieldvalue(options,'dlag', 1000);
++
++%Write data file
++fid=fopen('cluster.dat','w');
++fprintf(fid,'%s\n','Data file');
++fprintf(fid,'%i\n',3);
++fprintf(fid,'%s\n','Xlocation');
++fprintf(fid,'%s\n','Ylocation');
++fprintf(fid,'%s\n','Data');
++fprintf(fid,'%g %g %g\n',[x y data]');
++fclose(fid);
++
++%Write parameter file
++fid=fopen('gamv.par','w');
++fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
++fprintf(fid,'\t\t\t\t%s\n','*******************');
++fprintf(fid,'\n');
++fprintf(fid,'%s\n','START OF PARAMETERS:');
++fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
++fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
++fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
++fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
++fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
++fprintf(fid,'%-30s %s\n',num2str(nlag,'%i')           ,'\number of lags');
++fprintf(fid,'%-30s %s\n',num2str(dlag,'%g')           ,'\lag separation distance');
++fprintf(fid,'%-30s %s\n',num2str(dlag/2,'%g')         ,'\lag tolerance');
++fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
++fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
++fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
++fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
++fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
++fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
++fclose(fid);
++
++%Call gamv
++system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
++delete('gamv.par');
++
++%Read output
++output   = struct('Semivariogram',[],'Covariance',[]);
++counter1 = 1;
++counter2 = 1;
++fid=fopen('gamv.out','r');
++while (~feof(fid)),
++	A=fscanf(fid,'%s',1);
++	if strcmp(A,'Covariance');
++		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
++		output(counter1).Covariance=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
++		counter1=counter1+1;
++	elseif strcmp(A,'Semivariogram'),
++		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
++		output(counter2).Semivariogram=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
++		counter2=counter2+1;
++	else
++		%do nothing
++	end
++end
++fclose(fid);
++delete('gamv.out')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/pkriging.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/pkriging.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/pkriging.m	(revision 12997)
+@@ -0,0 +1,55 @@
++function [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
++%PKRIGING - parallel Kriging
++%
++%   Usage:
++%      [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
++
++options=pairoptions(varargin{:});
++cluster=getfieldvalue(options,'cluster',generic('np',10));
++options=removefield(options,'cluster',0);
++name   = ['krig' num2str(feature('GetPid'))];
++
++% =========================================   MARSHALL.m =================================================
++disp(['marshalling file ' name '.bin']);
++fid=fopen([name '.bin'],'wb');
++if fid==-1,
++	error(['marshall error message: could not open ' name '.bin file for binary writing']);
++end
++
++%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
++WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
++
++%Write all data
++WriteData(fid,'enum',0,'data',x,'format','DoubleMat');
++WriteData(fid,'enum',1,'data',y,'format','DoubleMat');
++WriteData(fid,'enum',2,'data',observations,'format','DoubleMat');
++WriteData(fid,'enum',3,'data',x_interp,'format','DoubleMat');
++WriteData(fid,'enum',4,'data',y_interp,'format','DoubleMat');
++options.marshall(fid,5);
++st=fclose(fid);
++if st==-1,
++	error(['marshall error message: could not close file ' name '.bin']);
++end
++% =========================================   MARSHALL.m =================================================
++
++%Launch job on remote cluster
++BuildKrigingQueueScript(cluster,name,'',1,0,0); %gather, valgrind, gprof
++tic
++LaunchQueueJob(cluster,name,name,{[name '.bin'] [name '.queue']});
++toc
++choice=input('Is the job successfully completed? (y/n)','s');
++Download(cluster,name,{[name '.outbin']});
++structure=parseresultsfromdisk([name '.outbin'],0);
++delete([name '.outlog']);
++delete([name '.errlog']);
++delete([name '.outbin']);
++delete([name '.bin']);
++if ~ispc,
++	delete([name '.tar.gz']);
++end
++
++%Process results
++B=structure.AutodiffForward;
++B=reshape(B,size(x_interp,2),size(x_interp,1))';
++E=structure.AutodiffIsautodiff;
++E=reshape(E,size(x_interp,2),size(x_interp,1))';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/MisfitDeinterlace.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/MisfitDeinterlace.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/MisfitDeinterlace.m	(revision 12997)
+@@ -0,0 +1,21 @@
++function Jstruct=MisfitDeinterlace(misfit,type)
++%MISFITDEINTERLACE - deinterlace misfits that are mixed together, using type.
++%
++%   Usage:
++%      Jstruct=MisfitDeinterlace(misfit,type)
++%
++%   Example:
++%      Jstruct=MisfitDeinterlace(md.results.diagnostic.J,md.fit)
++%
++%
++Jstruct=struct();
++
++count=1;
++for i=0:max(type),
++	pos=find(type==i);
++	if length(pos),
++		Jstruct(count).type=i;
++		Jstruct(count).J=misfit(pos);
++		count=count+1;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.fig
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.fig
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.fig	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.fig	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.fig
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/addtrack.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/addtrack.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/addtrack.m	(revision 12997)
+@@ -0,0 +1,156 @@
++function [x_m2 y_m2 values2]=addtrack(x_m1,y_m1,values1,track_coord,track_values,distance,exponent,varargin),
++%ADDTRACK - modify a map to take values of a track
++%
++%   This routine modifies a map to improve it with values of tracks.
++%   This output map has more values than the input one so that the values
++%   of the tracks are relevant.
++%   x_m1 and y_m1 are two vectors containing the coordinates of the matrix
++%   the distance between two points must be the same everywhere
++%   values1 is a matrix of size (y_m1-1)*(x_m1-1)
++%   trac_coord is an exp file containing the coordinates of the tracks (x and y)
++%   trav_values is a vector with the values along the track coordinates
++%   distance indicates the distance from the tracks where points have to be modified
++%   exposant allows to chance the influence of the track and the map
++%   it must be positive and usually is superior to 1.
++%
++%   Usage:
++%      [x_m2 y_m2 values1 values2]=addtrack(x_m1,y_m1,values1,track_coord,track_values,distance,exposant[,subdivision])
++%
++%   Example:
++%      [xnew ynew valuesnew]=addtrack(x_m,y_m,thickness,'trackcoord.exp',thickness_track,1000,2)
++%      [xnew ynew valuesnew]=addtrack(x_m,y_m,thickness,'trackcoord.exp',thickness_track,1000,2,3)
++
++%Create a new picture precise enough to be modified by the tracks
++%Read the points of the tracks
++stru=expread(track_coord,1);
++nods=stru.nods;
++xtracks=stru.x';
++ytracks=stru.y';
++
++%First check that the parameters are ok:
++if (size(track_values,1)~=nods)  || (size(xtracks,2)~=nods) || (size(ytracks,2)~=nods),
++	error('addtrack error message : track coordinates and track values must have the same size');
++elseif distance<0,
++	error('addtrack error message : the distance must be a positive value');
++elseif exponent<0,
++	error('addtrack error message : the exponent must be a positive value');
++elseif (size(x_m1,1)~=(size(values1,2)+1)) || (size(y_m1,1)~=(size(values1,1)+1)),
++	error('addtrack error message : problem in the map, check the size of x_m1, y_m1 and values1');
++end
++
++%stru.nods=4;
++%xtracks=[50 50 55 62]; % 2 3 4 5 6 7 8 9 1 ]';
++%ytracks=[40 40.5 41 41]; % 5 5 5 5 5 5 5 5 8 ]';
++%x_m1=[1:10:101]';
++%y_m1=[1:10:101]';
++%track_values=2*ones(4,1);
++%values1=ones(10,10);
++
++%Find the average distance between two points of the tracks
++av_x=sum(abs(diff(xtracks)))/(stru.nods-1);
++av_y=sum(abs(diff(ytracks)))/(stru.nods-1);
++dist_av=sqrt(av_x^2+av_y^2);
++
++%Calculate the multiplicate factor for the new values:
++if nargin==7,
++	mult=round((x_m1(2)-x_m1(1))/(1*dist_av));
++else
++	mult=varargin{1};
++end
++
++%Plug the values in the new multiplied matrix
++values=zeros(mult*size(values1,1),mult*size(values1,2));
++
++for i=1:mult,
++	for j=1:mult,
++		values(i:mult:end,j:mult:end)=values1;
++	end
++end
++
++%Create the new x and y addapted to the matrix
++x_m2=linspace(x_m1(1),x_m1(end),mult*(size(x_m1,1)-1)+1)';
++y_m2=linspace(y_m1(1),y_m1(end),mult*(size(y_m1,1)-1)+1)';
++
++%Create a new set of x and y correponding to the medium value on the matrix
++x_med=(x_m2(1:end-1)+x_m2(2:end))/2;
++y_med=(y_m2(1:end-1)+y_m2(2:end))/2;
++
++numrow=size(y_med,1);
++numcol=size(x_med,1);
++
++%Create new x and y to have the hole matrix
++x_mat=repmat(x_med',numrow,1);
++y_mat=repmat(y_med,1,numcol);
++
++%Remove useless points of the track
++points=find(track_values==0);
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++points=find(isnan(track_values));
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++
++%Remove points outside of the map
++points=find(xtracks<x_med(1) | xtracks>x_med(end) | ytracks<y_med(1) | ytracks>y_med(end));
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++
++%initialize some matrices
++numoverlap=zeros(numrow,numcol);
++weights=zeros(numrow,numcol);
++weightsvalues=zeros(numrow,numcol);
++
++%Loop over the points of the track
++nel=size(track_values,1);
++fprintf('%s','      track processing progress:   0.00 %');
++for i=1:nel;
++	if mod(i,1000)==0,
++		fprintf('\b\b\b\b\b\b\b')
++		fprintf('%5.2f%s',i/nel*100,' %');
++	end
++
++	x=xtracks(i);
++	y=ytracks(i);
++
++	%get indices that are modified
++	indexx1=max(find(x_med<x-distance));
++	if isempty( indexx1), indexx1=1; end
++	indexx2=min(find(x_med>x+distance));
++	if isempty( indexx2), indexx2=numrow; end
++	indexy1=max(find(y_med<y-distance));
++	if isempty( indexy1), indexy1=1; end
++	indexy2=min(find(y_med>y+distance));
++	if isempty( indexy2), indexy2=numcol; end
++
++
++	%get weighing coefficient
++	val=track_values(i);
++	distances=sqrt((x-x_mat(indexy1:indexy2,indexx1:indexx2)).^2+(y-y_mat(indexy1:indexy2,indexx1:indexx2)).^2);
++	coeff=min(1,(distances/distance)).^(1/exponent);
++
++	%update numoverlap and weights
++	numoverlap(indexy1:indexy2,indexx1:indexx2)=numoverlap(indexy1:indexy2,indexx1:indexx2)+1;
++	weights(indexy1:indexy2,indexx1:indexx2)=weights(indexy1:indexy2,indexx1:indexx2)+coeff;
++	weightsvalues(indexy1:indexy2,indexx1:indexx2)=weightsvalues(indexy1:indexy2,indexx1:indexx2)+(1-coeff)*val;
++
++end
++if nel>1000,
++	fprintf('\b\b\b\b\b\b\b\b')
++	fprintf('%4.2f%s\n',100,' %');
++end
++
++
++%Change the values of numoverlap to 1 if 0 since we are going to devide by this matrix
++numoverlap(find(~numoverlap))=1;
++
++%Same thing for weights since values far from the tracks don't change
++weights(find(~weights))=1;
++
++%Create the final matrix depending on the previous matrix
++values=(values.*weights+weightsvalues)./numoverlap;
++
++%Plug the values of the track in the new matrix
++values2=values;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/TracksToMatrix.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/TracksToMatrix.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/TracksToMatrix.m	(revision 12997)
+@@ -0,0 +1,84 @@
++function [x_f y_f MatData]=TracksToMatrix(xmin,ymin,nx,ny,posting,track_coord,track_values,theta,varargin),
++%TRACKSTOMATRIX - Create a map from tracks
++%
++%   This routine creates a map from tracks using a Kriging algorithm given by the package DACE.
++%   - xmin and ymin are two scalars that are the extreme values of the data matrix one wants to create
++%   - posting is a scalar giving the posting of the matrix to be created in meters
++%   - trac_coord is an Argus file containing the coordinates of the tracks (x and y)
++%   - trav_values is a vector with the values along the track coordinates
++%   - theta is a parameter of the correlation function stricly positive
++%   varagin can contain a matrix of data to constrain the matrix to be created
++%   it shoud contain indices x and y and the matrix
++%
++%   Usage:
++%      [x_ y_f MatData]=TracksToMatrix(xmin,ymin,nx,ny,posting,track_coord,track_values,theta),
++%
++%   Example:
++%      [x_f y_f Thickness]=TracksToMatrix(-10^6,10^6,200,180,1000,'trackcoord.exp',thickness_values,theta),
++%      [x_f y_f Thickness]=TracksToMatrix(-10^6,10^6,200,180,1000,'trackcoord.exp',thickness_values,theta,x_m,y_m,globalthickness),
++%
++%   See also: CREATEDATABOUNDARIES, CREATEDATAMATRIX
++
++%some checks
++if nargin~=8 & nargin~=11,
++	error(' TracksToMatrix error message: wrong number of arguments')
++end
++
++%Add path to dace
++addpath([issmdir() '/externalpackages/dace/install'])
++
++%First create the x_m and y_m fot the matrix
++x_f=[xmin:posting:xmin+posting*nx]';
++y_f=[ymin:posting:ymin+posting*ny]';
++
++%Now create a bigger map we will then truncate
++x_m=[xmin-posting*nx/2:posting:xmin+posting*nx*3/2]';
++y_m=[ymin-posting*ny/2:posting:ymin+posting*ny*3/2]';
++
++%Create DataMatrix with local averaging of tracks
++[Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values);
++
++%Create vector for these coordinates and values
++Svalue=sparse(Mvalue);
++Sx=sparse(Mx);
++Sy=sparse(My);
++[i,j,Values]=find(Svalue);
++[i,j,X]=find(Sx);
++[i,j,Y]=find(Sy);
++Coord=[X,Y];
++
++%Create boundaries for the track if specified
++if nargin==11,
++	disp('      constain the border of matrix with global matrix');
++	%Find out the elements to counstrain the border
++	x_matrix=varargin{1};
++	y_matrix=varargin{2};
++	datamatrix=varargin{3};
++
++	%Create values on the border of the smaller map
++	[Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
++
++	%Create values on the border of the larger map
++	[Xedge2,Yedge2,EdgeValues2]=CreateDataBoundaries(x_f,y_f,x_matrix,y_matrix,datamatrix);
++
++	%Add these values to the track values
++	Values=[Values;EdgeValues;EdgeValues2];
++	Coord=[X,Y;Xedge,Yedge;Xedge2,Yedge2];
++end
++
++%Create model for data
++disp('      create the statiscal model of the data');
++[dmodel,perf]=dacefit(Coord,Values,@regpoly1,@corrgauss,theta);
++
++%Create design site(points where we are looking for the data)
++Points=nodesamp([x_f(1)+posting/2,y_f(1)+posting/2;x_f(end)-posting/2,y_f(end)-posting/2],[length(x_f)-1;length(y_f)-1]);
++
++%Compute data on these points
++disp('      predict the values');
++VecData=predictor(Points,dmodel);
++
++%Reshape to get a matrix
++MatData=reshape(VecData,ny,nx);
++
++%remove DACE path
++rmpath([issmdir() '/externalpackages/dace/install']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gslib.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gslib.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gslib.m	(revision 12997)
+@@ -0,0 +1,112 @@
++function output = gslib(x,y,data,varargin);
++%GSLIB - use gslib for Kriging
++%
++%   Usage:
++%      output = gslib(x,y,data,varargin)
++
++%Output Matrix
++xmin   = xl(1);
++ymin   = yl(1);
++nx     = 101;
++ny     = 101;
++deltax = 5000;
++deltay = 5000;
++
++%Variogram
++nugget=10;
++sill  =164;
++range =25763;
++
++%Kriging options
++mindata = 1;
++maxdata = 50;
++maxsearchradius = 50000;
++
++%Some intermediaries (Convert to gslib's parameters);
++c = (sill-nugget);
++a = sqrt(3)*range;
++
++%Write data file
++fid=fopen('cluster.dat','w');
++fprintf(fid,'%s\n','Data file');
++fprintf(fid,'%i\n',3);
++fprintf(fid,'%s\n','Xlocation');
++fprintf(fid,'%s\n','Ylocation');
++fprintf(fid,'%s\n','Data');
++fprintf(fid,'%g %g %g\n',[x y data]');
++fclose(fid);
++
++if 0, %GAMV
++	%Write parameter file
++	fid=fopen('gamv.par','w');
++	fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
++	fprintf(fid,'\t\t\t\t%s\n','*******************');
++	fprintf(fid,'\n');
++	fprintf(fid,'%s\n','START OF PARAMETERS:');
++	fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
++	fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
++	fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
++	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
++	fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
++	fprintf(fid,'%-30s %s\n','20'                         ,'\number of lags');
++	fprintf(fid,'%-30s %s\n','5.0'                        ,'\lag separation distance');
++	fprintf(fid,'%-30s %s\n','3.0'                        ,'\lag tolerance');
++	fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
++	fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
++	fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++	fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++	fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
++	fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
++	fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
++	fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
++	fclose(fid);
++
++	%Call gamv
++	system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
++
++else, %Kriging KB2D
++	%Write parameter file
++	fid=fopen('kb2d.par','w');
++	fprintf(fid,'\t\t\t\t%s\n','Parameters for KB2D');
++	fprintf(fid,'\t\t\t\t%s\n','*******************');
++	fprintf(fid,'\n');
++	fprintf(fid,'%s\n','START OF PARAMETERS:');
++	fprintf(fid,'%-30s %s\n','./cluster.dat'                  ,'\file with data');
++	fprintf(fid,'%-30s %s\n','1 2 3'                          ,'\columns for X, Y and variable');
++	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'                 ,'\trimming limits');
++	fprintf(fid,'%-30s %s\n','0'                              ,'\debugging level: 0,1,2,3');
++	fprintf(fid,'%-30s %s\n','kb2d.dbg'                       ,'\file for debuggging output');
++	fprintf(fid,'%-30s %s\n','kb2d.out'                       ,'\file for kriged output');
++	fprintf(fid,'%-30s %s\n',num2str([nx xmin deltax],'%i %10g %6g')  ,'\nx, xmn, xsiz');
++	fprintf(fid,'%-30s %s\n',num2str([ny ymin deltay],'%i %10g %6g')  ,'\nx, xmn, xsiz');
++	fprintf(fid,'%-30s %s\n','1 1'                            ,'\x and y block discretization');
++	fprintf(fid,'%-30s %s\n',num2str([mindata maxdata],'%6g') ,'\min and max data for kriging');
++	fprintf(fid,'%-30s %s\n',num2str(maxsearchradius,'%6g')   ,'\max search radius');
++	fprintf(fid,'%-30s %s\n','1 2.302'                        ,'\0=SK, 1=OK, (mean if SK)');
++	fprintf(fid,'%-30s %s\n',['1 ' num2str(nugget)]           ,'\nst, nugget effect');
++	fprintf(fid,'%-30s %s\n',['3 ' num2str([c 0.0 a a],'%10g')],'\it, c, azm, a_max, a_min');
++	fclose(fid);
++
++	tic;system([issmdir() '/externalpackages/gslib/install/kb2d kb2d.par']);toc;
++	delete('kb2d.par');
++
++	%Read output
++	fid=fopen('kb2d.out','r');
++	while (~feof(fid)),
++		A=fscanf(fid,'%s',1);
++		if strcmp(A,'KB2D');
++			A=fscanf(fid,'%s',1); %Read output
++			params=fscanf(fid,'%i %i %i %i %g %g %g %g %g %g %1',[11 1]);
++		elseif strcmp(A,' Estimate'),
++			continue;
++		elseif strcmp(A,'Estimation'),
++			A=fscanf(fid,'%s',1); %Read Variance
++			A=fscanf(fid,'%g %g',[params(1) params(2)*params(3)]);
++			B=A(1,:); B=reshape(B,[params(3),params(2)])';
++			E=A(2,:); E=reshape(E,[params(3),params(2)])';
++		else
++			%do nothing
++		end
++	end
++	fclose(fid);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataMatrix.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataMatrix.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataMatrix.m	(revision 12997)
+@@ -0,0 +1,94 @@
++function [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values),
++%CREATEDATAMATRIX - Create a map with average values of map 
++%
++%   This routine creates a map with average values of tracks.
++%   x_m1 and y_m1 are two vectors containing the coordinates of the matrix
++%   trac_coord is an exp file containing the coordinates of the tracks (x and y)
++%   trav_values is a vector with the values along the track coordinates
++%
++%   Usage:
++%      [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values),
++%
++%   Example:
++%      [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,'trackcoord.exp',thickness_track)
++%
++%   See also: CREATEDATABOUNDARIES, TRACKSTOMATRIX
++
++%Read the points of the tracks
++stru=expread(track_coord,1);
++nods=stru.nods;
++xtracks=stru.x';
++ytracks=stru.y';
++
++%First check that the parameters are ok:
++if (size(track_values,1)~=nods)  || (size(xtracks,2)~=nods) || (size(ytracks,2)~=nods),
++	error('CreateDataMatrix error message : track coordinates and track values must have the same size');
++end
++
++%Compute number of rows and columns
++numrow=size(y_m,1)-1;
++numcol=size(x_m,1)-1;
++
++%Remove useless points of the track
++points=find(track_values==0);
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++points=find(isnan(track_values));
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++points=find(track_values<0);
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++
++points=find(xtracks<x_m(1) | xtracks>x_m(end) | ytracks<y_m(1) | ytracks>y_m(end));
++track_values(points)=[];
++xtracks(points)=[];
++ytracks(points)=[];
++
++%initialize some matrices
++numpoints=zeros(numrow,numcol);
++value=zeros(numrow,numcol);
++coordx=zeros(numrow,numcol);
++coordy=zeros(numrow,numcol);
++
++%Loop over the points of the track
++nel=size(track_values,1);
++fprintf('%s','      track processing progress:   0.00 %');
++for i=1:nel;
++	if mod(i,1000)==0,
++		fprintf('\b\b\b\b\b\b\b')
++		fprintf('%5.2f%s',i/nel*100,' %');
++	end
++
++	x=xtracks(i);
++	y=ytracks(i);
++
++	%get indices for the matrix
++	indexx=max(find(x_m<x));
++	indexy=max(find(y_m<y));
++
++	%get weighing coefficient
++	val=track_values(i);
++
++	%update numoverlap and weights
++	numpoints(indexy,indexx)=numpoints(indexy,indexx)+1;
++	value(indexy,indexx)=value(indexy,indexx)+val;
++	coordx(indexy,indexx)=coordx(indexy,indexx)+x;
++	coordy(indexy,indexx)=coordy(indexy,indexx)+y;
++
++end
++if nel>1000,
++	fprintf('\b\b\b\b\b\b\b\b')
++	fprintf('%4.2f%s\n',100,' %');
++end
++
++%Change the values of numoverlap to 1 if 0 since we are going to devide by this matrix
++numpoints(find(~numpoints))=1;
++
++%Create the center of mass for coordiantes and values.
++Mvalue=value./numpoints;
++Mx=coordx./numpoints;
++My=coordy./numpoints;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.m	(revision 12997)
+@@ -0,0 +1,467 @@
++function varargout = data_processing_tool(varargin)
++%DATA_PROCESSING_TOOL - GUI to process binary data
++%
++%   this routine is a GUI that helps the user to open
++%   a binary file (Little Endian, Big Endian, Float 32,
++%   double,...) and save a Matlab file (.mat) with the
++%   processed data and the coordinates
++%
++%   Usage:
++%      data_processing_tool
++
++	gui_Singleton = 1;
++	gui_State = struct('gui_Name',       mfilename, ...
++		'gui_Singleton',  gui_Singleton, ...
++		'gui_OpeningFcn', @data_processing_tool_OpeningFcn, ...
++		'gui_OutputFcn',  @data_processing_tool_OutputFcn, ...
++		'gui_LayoutFcn',  [] , ...
++		'gui_Callback',   []);
++	if nargin && ischar(varargin{1})
++		gui_State.gui_Callback = str2func(varargin{1});
++	end
++
++	if nargout
++		[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
++	else
++		gui_mainfcn(gui_State, varargin{:});
++	end
++end
++
++function data_processing_tool_OpeningFcn(hObject, eventdata, handles, varargin)
++	handles.output = hObject;
++
++	%enable toolbar (useful for caxis...)
++	set(hObject,'toolbar','figure');
++
++	% Update handles structure
++	guidata(hObject, handles);
++
++	%this variable used to prevent users from breaking the GUI
++	%the variable is set to 1 once the data has been processed
++	handles.processDataCompleted=0;
++
++	%initialize other variables
++	handles.Msize=NaN;
++	handles.Nsize=NaN;
++	handles.numvectors=NaN;
++	handles.endian=NaN;
++	handles.datatype=NaN;
++	handles.dx=NaN;
++	handles.dy=NaN;
++	handles.xEast=NaN;
++	handles.yNorth=NaN;
++
++	%two files permitted
++	set(handles.inputFile,'Max',1);
++	set(handles.inputFile,'Min',0);
++
++	% Update handles structure
++	guidata(hObject, handles);
++end
++
++% --- Outputs from this function are returned to the command line.
++function varargout = data_processing_tool_OutputFcn(hObject, eventdata, handles) 
++
++	% Get default command line output from handles structure
++	varargout{1} = handles.output;
++end
++
++
++function inputFile_Callback(hObject, eventdata, handles)
++%no code needed for this callback, the listbox is only used as a visual
++end
++
++function addFiles_pushbutton_Callback(hObject, eventdata, handles)
++	%gets input file(s) from user. the sample data files have extension .s2p
++	[input_file,pathname] = uigetfile( ...
++		{'*.*', 'All Files (*.*)'}, ...
++		'Select files', ... 
++		'MultiSelect', 'on');
++
++	%if file selection is cancelled, pathname should be zero
++	%and nothing should happen
++	if pathname==0
++		return
++	end
++
++	handles.processDataCompleted=1;
++
++	%gets the current data file names inside the listbox
++	inputFileName=get(handles.inputFile,'String');
++
++	%if they only select one file, then the data will not be a cell
++	inputFileName= fullfile(pathname,input_file);
++
++	%updates the gui to display all filenames in the listbox
++	set(handles.inputFile,'String',inputFileName);
++
++	%make sure first file is always selected so it doesn't go out of range
++	%the GUI will break if this value is out of range
++	set(handles.inputFile,'Value',1);
++
++	% Update handles structure
++	guidata(hObject, handles);
++end
++
++function reset_pushbutton_Callback(hObject, eventdata, handles)
++	%resets the GUI by clearing all relevant fields
++
++	handles.processDataCompleted = 0;
++
++	%clears the axes
++	cla(handles.axes1,'reset');
++
++	%set the popupmenu to default value
++%	set(handles.plot_popupmenu,'Value',1);
++
++	%clears the contents of the listbox
++	set(handles.inputFile,'String','');
++	set(handles.inputFile,'Value',0);
++
++	%updates the handles structure
++	guidata(hObject, handles);
++end
++
++function plotdata_pushbutton_Callback(hObject, eventdata, handles)
++
++	%get the list of input file names from the listbox
++	inputFileName=get(handles.inputFile,'String');
++
++	%checks to see if the user selected any input files
++	%if not, nothing happens
++	if isempty(inputFileName)
++		errordlg('Select a file first!')
++		return
++	end
++
++	%disables the button while data is processing
++	disableButtons(handles);
++	refresh(data_processing_tool); 
++
++	%parse options
++	if ~isnan(handles.Msize)
++		M=handles.Msize;
++	else
++		errordlg('Number of lines (M) not valid')
++		return
++	end
++	if ~isnan(handles.Nsize)
++		N=handles.Nsize;
++	else
++		errordlg('Number of rows (N) not valid')
++		return
++	end
++	if ~isnan(handles.numvectors)
++		numvectors=handles.numvectors;
++		%change M
++		M=numvectors*M;
++	else
++		numvectors=1;
++	end
++	if ~isnan(handles.endian)
++		endian=handles.endian;
++	else
++		endian=1;
++	end
++	if ~isnan(handles.datatype)
++		datatype=handles.datatype;
++	else
++		datatype='float32';
++	end
++
++	%open file
++	if endian==1
++		fid=fopen(inputFileName,'r','ieee-be');
++	else
++		fid=fopen(inputFileName,'r','ieee-le');
++	end
++
++	%read file
++	[u, numpoints]=fread(fid, [M,N],datatype);
++
++	%close file
++	fclose(fid);
++
++	%Pair of vectors?
++	if numvectors==2,
++	   vx=u(1:2:M,:);vx=flipud(vx');
++	   vy=u(2:2:M,:);vx=flipud(vx');
++
++		%keep track
++		handles.vx=vx;
++		handles.vy=vy;
++
++		u=sqrt(vx.^2+vy.^2);
++	end
++
++	cla(handles.axes1); %clear the axes
++	axes(handles.axes1); %set the axes to plot
++	grid on
++	imagesc(u)
++	colorbar
++
++	%keep track
++	handles.u=u;
++
++	%to see whether the data has been processed or not
++	handles.processDataCompleted=2;
++
++	%data is done processing, so re-enable the buttons
++	enableButtons(handles);
++	guidata(hObject, handles);
++end
++
++function plotcoord_Callback(hObject, eventdata, handles)
++
++	%check
++	if handles.processDataCompleted<2
++		errordlg('Process data first !')
++		return
++	end
++
++	%parse options
++	if ~isnan(handles.dx)
++		dx=handles.dx;
++	else
++		errordlg('value of x-spacing not supported')
++		return
++	end
++	if ~isnan(handles.dy)
++		dy=handles.dy;
++	else
++		errordlg('value of y-spacing not supported')
++		return
++	end
++	if ~isnan(handles.xEast)
++		xEast=handles.xEast;
++	else
++		errordlg('value of xEast not supported')
++		return
++	end
++	if ~isnan(handles.yNorth)
++		yNorth=handles.yNorth;
++	else
++		errordlg('value of yNorth not supported')
++		return
++	end
++
++	disableButtons(handles);
++
++	%process coordinates
++	u=handles.u;
++	s=size(u);
++	M=s(1)+1;
++	N=s(2)+1;
++
++	%correction North and East -> real
++	yNorth=yNorth-M*dy; % corner north
++	x_m=xEast+dx*(0:N-1)';
++	y_m=yNorth+dy*(0:M-1)';
++
++	%plot new axes
++	cla(handles.axes1); %clear the axes
++	axes(handles.axes1); %set the axes to plot
++	grid on
++	imagesc(x_m,y_m,handles.u)
++	set(handles.axes1,'Ydir','Normal');
++	colorbar
++
++	%Keep track of x_m and y_m
++	handles.x_m=x_m;
++	handles.y_m=y_m;
++
++	%to see whether the data has been processed or not
++	handles.processDataCompleted=3;
++
++	%data is done processing, so re-enable the buttons
++	enableButtons(handles);
++	guidata(hObject, handles);
++
++end
++
++
++function save_pushbutton_Callback(hObject, eventdata, handles)
++	%if the data hasn't been processed yet, 
++	%nothing happens when this button is pressed
++	if (handles.processDataCompleted ~= 3)
++		return
++	end
++
++	disableButtons(handles);
++
++	if handles.numvectors==2,
++
++		prompt={'Enter the name of the variable 1:','Enter the name of the variable 2:','Enter the name of the file:'};
++		name='Save Matlab File';
++		numlines=1;
++		defaultanswer={'vx','vy','ProcessedFile'};
++		answer=inputdlg(prompt,name,numlines,defaultanswer);
++		variablename1=answer{1};
++		variablename2=answer{2};
++		filename=answer{3};
++
++		if ~isempty(variablename1) & ~isempty(variablename2) & ~isempty(filename)
++			%get the variables
++			x_m=handles.x_m;
++			y_m=handles.y_m;
++			eval([variablename1 ' = handles.vx;']);
++			eval([variablename2 ' = handles.vy;']);
++			x_m=handles.x_m;
++			eval(['save ' filename ' x_m y_m ' variablename1 ' ' variablename2 ]);
++			disp(['in the file ' filename ' have been saved the following variables: x_m, y_m, ' variablename1 ' and ' variablename2])
++		end
++	else
++		prompt={'Enter the name of the variable:','Enter the name of the file:'};
++		name='Save Matlab File';
++		numlines=1;
++		defaultanswer={'thickness','ProcessedFile'};
++		answer=inputdlg(prompt,name,numlines,defaultanswer);
++		variablename=answer{1};
++		filename=answer{2};
++
++		if ~isempty(variablename) & ~isempty(filename)
++			%get the variables
++			x_m=handles.x_m;
++			y_m=handles.y_m;
++			eval([variablename ' = handles.u;']);
++			eval(['save ' filename ' x_m y_m ' variablename]);
++			disp(['in the file ' filename ' have been saved the following variables: x_m, y_m, and ' variablename])
++		end
++	end
++	enableButtons(handles);
++	guidata(hObject, handles);
++end
++
++function inputFile_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function disableButtons(handles)
++	set(handles.figure1,'Pointer','watch');
++	set(handles.plotdata_pushbutton,'Enable','off');
++	set(handles.plotcoord,'Enable','off');
++	set(handles.save_pushbutton,'Enable','off');
++	set(handles.addFiles_pushbutton,'Enable','off');
++	set(handles.reset_pushbutton,'Enable','off');
++end
++
++function enableButtons(handles)
++	set(handles.figure1,'Pointer','arrow');
++	set(handles.plotdata_pushbutton,'Enable','on');
++	set(handles.plotcoord,'Enable','on');
++	set(handles.save_pushbutton,'Enable','on');
++	set(handles.addFiles_pushbutton,'Enable','on');
++	set(handles.reset_pushbutton,'Enable','on');
++end
++
++function EndianType_Callback(hObject, eventdata, handles)
++	handles.endian=get(handles.EndianType,'Value');
++	guidata(hObject, handles);
++end
++
++function EndianType_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function DataType_Callback(hObject, eventdata, handles)
++
++	datatype= get(handles.DataType,'Value');
++	switch datatype
++		case 1
++			string='float32';
++
++		case 2
++			string='single';
++
++		case 3
++			string='float64';
++
++		case 4
++			string='double';
++		end
++	handles.datatype=string;
++	guidata(hObject, handles);
++end
++
++function DataType_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function PairOfVectors_Callback(hObject, eventdata, handles)
++	handles.numvectors = get(handles.PairOfVectors,'Value');
++	guidata(hObject, handles);
++end
++
++function PairOfVectors_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function Msize_Callback(hObject, eventdata, handles)
++	handles.Msize=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++
++function Msize_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function Nsize_Callback(hObject, eventdata, handles)
++	handles.Nsize=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++
++function Nsize_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function dx_Callback(hObject, eventdata, handles)
++	handles.dx=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++function dx_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function dy_Callback(hObject, eventdata, handles)
++	handles.dy=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++function dy_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function xEast_Callback(hObject, eventdata, handles)
++	handles.xEast=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++function xEast_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
++
++function yNorth_Callback(hObject, eventdata, handles)
++	handles.yNorth=eval(get(hObject,'String'));
++	guidata(hObject, handles);
++end
++function yNorth_CreateFcn(hObject, eventdata, handles)
++	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
++		set(hObject,'BackgroundColor','white');
++	end
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddeblank.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddeblank.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddeblank.m	(revision 12997)
+@@ -0,0 +1,29 @@
++function sout = ddeblank(s)
++%DDEBLANK Double deblank. Strip both leading and trailing blanks.
++%
++%   DDEBLANK(S) removes leading and trailing blanks and null characters from
++%   the string S.  A null character is one that has a value of 0.
++%
++%   See also DEBLANK, DEWHITE, DDEWHITE.
++
++%   Author:      Peter J. Acklam
++%   Time-stamp:  2003-10-13 11:13:07 +0200
++%   E-mail:      pjacklam@online.no
++%   URL:         http://home.online.no/~pjacklam
++
++   error(nargchk(1, 1, nargin));
++   if ~ischar(s)
++      warning('Input must be a string (char array).');
++   end
++
++   if isempty(s)
++      sout = s;
++      return;
++   end
++
++   [r, c] = find( (s ~= ' ') & (s ~= 0) );
++   if size(s, 1) == 1
++      sout = s(min(c) : max(c));
++   else
++      sout = s(:, min(c) : max(c));
++   end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddeblank.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/strsplit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/strsplit.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/strsplit.m	(revision 12997)
+@@ -0,0 +1,91 @@
++function splittedstring = strsplit(inpstr,delimiter)
++%STRSPLIT - split a tring of delimiter separated values
++%
++%   This function should be used to split a string of delimiter separated
++%   values.  If all values are numerical values the returned matrix is a
++%   double array but if there is one non numerical value a cell array is
++%   returned.  You can check this with the iscell() function.
++%   inpstr: string containing delimiter separatede numerical values, eg
++%           3498,48869,23908,34.67
++%   Output: An x by 1 matrix containing the splitted values
++%   Delimiter: optional, if omitted the delimiter is , (comma)
++%
++%   Usage:
++%      output = strsplit(inpstr[,delimiter])
++%
++
++%   mailto:    gie.spaepen@ua.ac.be
++
++
++
++%Check input arguments
++if(nargin < 1)
++    error('There is no argument defined');
++else
++    if(nargin == 1)
++        strdelim = ',';
++        %Verbose off!! disp 'Delimiter set to ,';
++    else
++        strdelim = delimiter;
++    end
++end
++
++%deblank string
++deblank(inpstr);
++
++%Get number of substrings
++idx  = findstr(inpstr,strdelim);
++if size(idx) == 0
++    disp 'No delimiter in string, inputString is returned';
++    splittedstring = inpstr;
++else
++    %Define size of the indices
++    sz = size(idx,2);
++    %Define splittedstring
++    tempsplit = {};
++    %Loop through string and itinerate from delimiter to delimiter
++    for i = 1:sz
++        %Define standard start and stop positions for the start position,
++        %choose 1 as startup position because otherwise you get an array
++        %overflow, for the endposition you can detemine it from the
++        %delimiter position
++        strtpos = 1;
++        endpos = idx(i)-1;
++        %If i is not the beginning of the string get it from the delimiter
++        %position
++        if i ~= 1
++            strtpos = idx(i-1)+1;
++        end
++        %If i is equal to the number of delimiters get the last element
++        %first by determining the lengt of the string and then replace the
++        %endpos back to a standard position
++        if i == sz
++            endpos = size(inpstr,2); 
++            tempsplit(i+1) = {inpstr(idx(i)+1 : endpos)};
++            endpos = idx(i)-1;
++        end
++        %Add substring to output: splittedstring a cell array
++        tempsplit(i) = {inpstr(strtpos : endpos)};   
++    end
++    %Flag 
++    isallnums = 1;
++    %Check is there are NaN values if matrix elements are converted to
++    %doubles
++    for i = 1:size(tempsplit,2)
++        tempdouble = str2double(tempsplit(i));
++        if(isnan(tempdouble))
++            isallnums = 0;
++        end
++    end
++    %If isallnums = 1 then return a double array otherwise return a cell
++    %array
++    if(isallnums == 1)
++        for i = 1:size(tempsplit,2)
++            splittedstring(i) = str2double(tempsplit(i));
++        end
++    else
++        splittedstring = tempsplit;
++    end
++    
++        
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/dewhite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/dewhite.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/dewhite.m	(revision 12997)
+@@ -0,0 +1,30 @@
++function sout = dewhite(s)
++%DEWHITE Dewhite. Strip trailing whitespace.
++%
++%   DEWHITE(S) removes leading and trailing white space and any null characters
++%   from the string S.  A null character is one that has an absolute value of
++%   0.
++%
++%   See also DDEWHITE, DEBLANK, DDEBLANK.
++
++%   Author:      Peter J. Acklam
++%   Time-stamp:  2003-10-13 11:12:52 +0200
++%   E-mail:      pjacklam@online.no
++%   URL:         http://home.online.no/~pjacklam
++
++   error(nargchk(1, 1, nargin));
++   if ~ischar(s)
++      error( 'Input must be a string (char array).' );
++   end
++
++   if isempty(s)
++      sout = s;
++      return;
++   end
++
++   [r, c] = find(~isspace(s));
++   if size(s, 1) == 1
++      sout = s(1:max(c));
++   else
++      sout = s(:,1:max(c));
++   end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/dewhite.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/discardnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/discardnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/discardnum.m	(revision 12997)
+@@ -0,0 +1,14 @@
++function string2=discardnum(string)
++%DISCARDNUM -  ??????
++%
++%   Usage:
++%      string2=discardnum(string)
++
++string2=string;
++
++for i=1:length(string),
++	if (((string(i)-0) <=57) & ((string(i)-0) >=48)),
++		string2=string(1:i-1);
++		break;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ismemberi.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ismemberi.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ismemberi.m	(revision 12997)
+@@ -0,0 +1,26 @@
++function flag=ismemberi(string,list),
++%ISMEMBERI - return 1 if a string belongs to a list (case insensitive)
++%
++%   same function as Matlab's ismember except that it
++%   is case insensitive
++%
++%   Usage:
++%      flag=ismemberi(string,list);
++%
++%   Example:
++%      flag=ismemberi('test','{'test1','test2','test3'});
++
++if ~iscell(list)
++	error('ismemberi error message: the list of string must be a cell!')
++end
++
++%initialize output
++flag=0;
++
++%go through the list
++for i=1:length(list),
++	if strcmpi(string,list{i}),
++		flag=i;
++		return
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/strsplit_strict.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/strsplit_strict.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/strsplit_strict.m	(revision 12997)
+@@ -0,0 +1,37 @@
++function splittedstring = strsplit(inpstr,delimiter)
++%STRSPLIT - split a tring of delimiter separated values
++%
++%   Usage:
++%      output = strsplit_strict(inpstr,delimiter)
++
++
++%Check input arguments
++if(nargin ~= 2)
++    error('There is no argument defined');
++end
++
++%deblank string
++deblank(inpstr);
++
++%Get number of substrings
++idx  = findstr(inpstr,delimiter);
++if size(idx) == 0
++    splittedstring = {inpstr};
++else
++    sz = size(idx,2);
++    splittedstring = {};
++    %Loop through string and itinerate from delimiter to delimiter
++    for i = 1:sz
++        strtpos = 1;
++        endpos = idx(i)-1;
++        if i ~= 1
++            strtpos = idx(i-1)+1;
++        end
++        if i == sz
++            endpos = size(inpstr,2); 
++            splittedstring(i+1) = {inpstr(idx(i)+1 : endpos)};
++            endpos = idx(i)-1;
++        end
++        splittedstring(i) = {inpstr(strtpos : endpos)};   
++    end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddewhite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddewhite.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddewhite.m	(revision 12997)
+@@ -0,0 +1,30 @@
++function sout = ddewhite(s)
++%DDEWHITE Double dewhite. Strip both leading and trailing whitespace.
++%
++%   DDEWHITE(S) removes leading and trailing white space and any null
++%   characters from the string S.  A null character is one that has an absolute
++%   value of 0.
++%
++%   See also DEWHITE, DEBLANK, DDEBLANK.
++
++%   Author:      Peter J. Acklam
++%   Time-stamp:  2003-10-13 11:12:57 +0200
++%   E-mail:      pjacklam@online.no
++%   URL:         http://home.online.no/~pjacklam
++
++   error(nargchk(1, 1, nargin));
++   if ~ischar(s)
++      error('Input must be a string (char array).');
++   end
++
++   if isempty(s)
++      sout = s;
++      return;
++   end
++
++   [r, c] = find(~isspace(s));
++   if size(s, 1) == 1
++      sout = s(min(c) : max(c));
++   else
++      sout = s(:, min(c) : max(c));
++   end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddewhite.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/issmprintf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/issmprintf.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/issmprintf.m	(revision 12997)
+@@ -0,0 +1,13 @@
++function issmprintf(flag,format,varargin)
++%ISSMPRINTF -  display string in solution sequences. wrapper to disp and sprintf.  
++%
++%   Usage:
++%      issmprintf(flag,format,string)
++%      flag can be used to switch display on and off
++%
++%   Example:
++%      issmprintf(1,'%s\n','string to display');
++	
++if flag,
++	disp(sprintf(format,varargin{:}));
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/logoutput.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/logoutput.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/logoutput.m	(revision 12997)
+@@ -0,0 +1,7 @@
++function logoutput(logstring,message)
++%LOGOUTPUT - embed a log string into an error message, used in the nightly runs.
++%
++%   Usage:
++%      logoutput(logstring,message)
++
++disp(sprintf('%s%s',logstring,message));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.py	(revision 12997)
+@@ -0,0 +1,24 @@
++import platform
++import os
++from MatlabFuncs import *
++
++def issmdir():
++	"""
++	ISSMDIR - Get ISSM_DIR environment variable
++ 
++	   Usage:
++	      ISSM_DIR=issmdir()
++	"""
++
++	if not 'Windows' in platform.system():
++		ISSM_DIR =os.environ['ISSM_DIR']
++	else:
++		ISSM_DIR =os.environ['ISSM_DIR_WIN']
++		if strcmpi(ISSM_DIR[-1],'/') or strcmpi(ISSM_DIR[-1],'\\'):
++			ISSM_DIR = ISSM_DIR[:-1]    #shave off the last '/'
++
++	if not ISSM_DIR:
++		raise RuntimeError("issmdir error message: 'ISSM_DIR' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!")
++
++	return ISSM_DIR
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/flaimdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/flaimdir.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/flaimdir.m	(revision 12997)
+@@ -0,0 +1,7 @@
++function FLAIM_DIR=flaimdir()
++%ISSMDIR - Get FLAIM installation directory
++%
++%   Usage:
++%      FLAIM_DIR=flaimdir()
++
++FLAIM_DIR=[issmdir '/externalpackages/flaim/install'];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/ucisvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/ucisvn.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/ucisvn.m	(revision 12997)
+@@ -0,0 +1,15 @@
++function UCI_SVN=ucisvn()
++%ISSMDIR - Get UCI_SVN environment variable
++%
++%   Usage:
++%      UCI_SVN=ucisvn()
++
++if ~ispc,
++	UCI_SVN =getenv('UCI_SVN');
++else
++	UCI_SVN =getenv('UCI_SVN_WIN');
++end
++
++if (isempty(UCI_SVN)),
++	error('ucisvn error message: ''UCI_SVN'' environment variable is empty! You should define UCI_SVN in your .cshrc or .bashrc');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.m	(revision 12997)
+@@ -0,0 +1,18 @@
++function ISSM_DIR=issmdir()
++%ISSMDIR - Get ISSM_DIR environment variable
++%
++%   Usage:
++%      ISSM_DIR=issmdir()
++
++if ~ispc,
++	ISSM_DIR =getenv('ISSM_DIR');
++else
++	ISSM_DIR =getenv('ISSM_DIR_WIN');
++	if strcmpi(ISSM_DIR(end),'/') | strcmpi(ISSM_DIR(end),'\'),
++		ISSM_DIR = ISSM_DIR(1:end-1); %shave off the last '/'
++	end
++end
++
++if (isempty(ISSM_DIR)),
++	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/jplsvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/jplsvn.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/jplsvn.m	(revision 12997)
+@@ -0,0 +1,15 @@
++function JPL_SVN=jplsvn()
++%ISSMDIR - Get JPL_SVN environment variable
++%
++%   Usage:
++%      JPL_SVN=jplsvn()
++
++if ~ispc,
++	JPL_SVN =getenv('JPL_SVN');
++else
++	JPL_SVN =getenv('JPL_SVN_WIN');
++end
++
++if (isempty(JPL_SVN)),
++	error('jplsvn error message: ''JPL_SVN'' environment variable is empty! You should define JPL_SVN in your .cshrc or .bashrc');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 12997)
+@@ -0,0 +1,107 @@
++function md=SetMarineIceSheetBC(md,varargin)
++%SETICEMARINESHEETBC - Create the boundary conditions for diagnostic and thermal models for a  Marine Ice Sheet with Ice Front
++%
++%   Neumann BC are used on the ice front (an ARGUS contour around the ice front
++%   can be given in input, or it will be deduced as onfloatingice & onboundary)
++%   Dirichlet BC are used elsewhere for diagnostic
++%
++%   Usage:
++%      md=SetMarineIceSheetBC(md,icefrontfile)
++%      md=SetMarineIceSheetBC(md)
++%
++%   Example:
++%      md=SetMarineIceSheetBC(md,'Front.exp')
++%      md=SetMarineIceSheetBC(md)
++%
++%   See also: SETICESHELFBC, SETMARINEICESHEETBC
++
++%node on Dirichlet (boundary and ~icefront)
++if nargin==2,
++	%User provided Front.exp, use it
++	icefrontfile=varargin{1};
++	if ~exist(icefrontfile)
++		error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']);
++	end
++	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2);
++	vertexonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
++else
++	%Guess where the ice front is
++	vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
++	vertexonfloatingice(md.mesh.elements(find(md.mask.elementonfloatingice),:))=1;
++	vertexonicefront=double(md.mesh.vertexonboundary & vertexonfloatingice);
++end
++pos=find(md.mesh.vertexonboundary & ~vertexonicefront);
++if isempty(pos),
++	warning('SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually')
++end
++md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvx(pos)=0;
++md.diagnostic.spcvy(pos)=0;
++md.diagnostic.spcvz(pos)=0;
++md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
++
++%Dirichlet Values
++if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
++	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
++	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
++	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
++else
++	disp('      boundary conditions for diagnostic model: spc set as zero');
++end
++
++md.hydrology.spcwatercolumn=zeros(md.mesh.numberofvertices,2);
++pos=find(md.mesh.vertexonboundary); 
++md.hydrology.spcwatercolumn(pos,1)=1;
++
++%segment on Neumann (Ice Front)
++pos=find(vertexonicefront(md.mesh.segments(:,1)) | vertexonicefront(md.mesh.segments(:,2)));
++if (md.mesh.dimension==2)
++	pressureload=md.mesh.segments(pos,:);
++elseif md.mesh.dimension==3
++	pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
++	pressureload=[];
++	for i=1:md.mesh.numberoflayers-1,
++		pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
++	end
++end
++
++%Add water or air enum depending on the element
++pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))+ 0*md.mask.elementongroundedice(pressureload(:,end))];
++
++%plug onto model
++md.diagnostic.icefront=pressureload;
++
++
++%Create zeros basalforcings and surfaceforcings
++if (isnan(md.surfaceforcings.precipitation)& (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
++	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
++	disp('      no surfaceforcings.precipitation specified: values set as zero');
++end
++if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
++	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
++	disp('      no surfaceforcings.mass_balance specified: values set as zero');
++end
++if isnan(md.basalforcings.melting_rate),
++	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no basalforcings.melting_rate specified: values set as zero');
++end
++if isnan(md.balancethickness.thickening_rate),
++	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no balancethickness.thickening_rate specified: values set as zero');
++end
++
++md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++
++if (length(md.initialization.temperature)==md.mesh.numberofvertices),
++	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
++	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
++	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
++		md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1);
++		md.basalforcings.geothermalflux(find(md.mask.vertexongroundedice))=50*10^-3; %50mW/m2
++	end
++else
++	disp('      no thermal boundary conditions created: no observed temperature found');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m	(revision 12997)
+@@ -0,0 +1,64 @@
++function md=SetIceSheetBC(md)
++%SETICESHEETBC - Create the boundary conditions for diagnostic and thermal models for an IceSheet with no Ice Front
++%
++%   Usage:
++%      md=SetIceSheetBC(md)
++%
++%   See also: SETICESHELFBC, SETMARINEICESHEETBC
++
++%node on Dirichlet
++pos=find(md.mesh.vertexonboundary);
++md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvx(pos)=0;
++md.diagnostic.spcvy(pos)=0;
++md.diagnostic.spcvz(pos)=0;
++md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
++
++%Dirichlet Values
++if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
++	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
++	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
++	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
++else
++	disp('      boundary conditions for diagnostic model: spc set as zero');
++end
++
++%segment on neumann (Ice Front) -> none
++if (md.mesh.dimension==2)
++	md.diagnostic.icefront=zeros(0,4);
++else
++	md.diagnostic.icefront=zeros(0,6);
++end
++
++%Create zeros basal melting rate and surface mass balance if not specified
++if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
++	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
++	disp('      no surfaceforcings.precipitation specified: values set as zero');
++end
++if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
++	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
++	disp('      no surfaceforcings.mass_balance specified: values set as zero');
++end
++if isnan(md.basalforcings.melting_rate),
++	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no basalforcings.melting_rate specified: values set as zero');
++end
++if isnan(md.balancethickness.thickening_rate),
++	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no balancethickness.thickening_rate specified: values set as zero');
++end
++
++md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++
++if (length(md.initialization.temperature)==md.mesh.numberofvertices),
++	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
++	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
++	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
++		md.basalforcings.geothermalflux=50*10^-3*ones(md.mesh.numberofvertices,1); %50 mW/m^2
++	end
++else
++	disp('      no thermal boundary conditions created: no observed temperature found');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 12997)
+@@ -0,0 +1,98 @@
++import os
++import numpy
++
++def SetIceShelfBC(md,icefrontfile=''):
++	"""
++	SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
++
++	   Neumann BC are used on the ice front (an ANRGUS contour around the ice front
++	   must be given in input)
++	   Dirichlet BC are used elsewhere for diagnostic
++
++	   Usage:
++	      md=SetIceShelfBC(md,varargin)
++
++	   Example:
++	      md=SetIceShelfBC(md);
++	      md=SetIceShelfBC(md,'Front.exp');
++
++	   See also: SETICESHEETBC, SETMARINEICESHEETBC
++	"""
++
++	#node on Dirichlet (boundary and ~icefront)
++	if icefrontfile:
++		if not os.path.exists(icefrontfile):
++			raise IOError("SetIceShelfBC error message: ice front file '%s' not found." % icefrontfile)
++		nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2)
++		nodeonicefront=double(md.mesh.vertexonboundary and nodeinsideicefront)
++	else:
++		nodeonicefront=numpy.zeros(md.mesh.numberofvertices)
++
++#	pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
++	pos=[i for i,(vob,noif) in enumerate(zip(md.mesh.vertexonboundary,nodeonicefront)) if vob and not noif]
++	md.diagnostic.spcvx=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.diagnostic.spcvy=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.diagnostic.spcvz=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.diagnostic.spcvx[pos]=0
++	md.diagnostic.spcvy[pos]=0
++	md.diagnostic.spcvz[pos]=0
++	md.diagnostic.referential=float('NaN')*numpy.ones((md.mesh.numberofvertices,6))
++
++	#Dirichlet Values
++	if numpy.size(md.inversion.vx_obs)==md.mesh.numberofvertices and numpy.size(md.inversion.vy_obs)==md.mesh.numberofvertices:
++		print '      boundary conditions for diagnostic model: spc set as observed velocities'
++		md.diagnostic.spcvx[pos]=md.inversion.vx_obs[pos]
++		md.diagnostic.spcvy[pos]=md.inversion.vy_obs[pos]
++	else:
++		print '      boundary conditions for diagnostic model: spc set as zero'
++
++	#segment on Ice Front
++	#segment on Neumann (Ice Front)
++#	pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
++	pos=[i for i,(noif1,noif2) in enumerate(zip(nodeonicefront[md.mesh.segments[:,0].astype('int')-1],nodeonicefront[md.mesh.segments[:,1].astype('int')-1])) if noif1 or noif2]
++	if   md.mesh.dimension==2:
++		pressureload=md.mesh.segments[pos,:]
++	elif md.mesh.dimension==3:
++#		pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
++		pressureload_layer1=numpy.concatenate((md.mesh.segments[pos,0:2],md.mesh.segments[pos,1]+md.mesh.numberofvertices2d,md.mesh.segments[pos,0]+md.mesh.numberofvertices2d,md.mesh.segments[pos,2]),axis=1)
++		pressureload=numpy.zeros((0,5))
++		for i in xrange(1,md.mesh.numberoflayers):
++#			pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
++			pressureload=numpy.concatenate((pressureload,numpy.concatenate((pressureload_layer1[:,0:3]+(i-1)*md.mesh.numberofvertices2d,pressureload_layer1[:,4]+(i-1)*md.mesh.numberofelements2d),axis=1)),axis=0)
++
++	#Add water or air enum depending on the element
++#	pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))];
++	pressureload=numpy.concatenate((pressureload,1*md.mask.elementonfloatingice[pressureload[:,-1].astype('int')-1].reshape((-1,1))),axis=1)
++
++	#plug onto model
++	md.diagnostic.icefront=pressureload
++
++	#Create zeros basalforcings and surfaceforcings
++	if numpy.isnan(md.surfaceforcings.precipitation).all():
++		md.surfaceforcings.precipitation=numpy.zeros(md.mesh.numberofvertices)
++		print '      no surfaceforcings.precipitation specified: values set as zero'
++	if numpy.isnan(md.surfaceforcings.mass_balance).all():
++		md.surfaceforcings.mass_balance=numpy.zeros(md.mesh.numberofvertices)
++		print '      no surfaceforcings.mass_balance specified: values set as zero'
++	if numpy.isnan(md.basalforcings.melting_rate).all():
++		md.basalforcings.melting_rate=numpy.zeros(md.mesh.numberofvertices)
++		print '      no basalforcings.melting_rate specified: values set as zero'
++	if numpy.isnan(md.balancethickness.thickening_rate).all():
++		md.balancethickness.thickening_rate=numpy.zeros(md.mesh.numberofvertices)
++		print '      no balancethickness.thickening_rate specified: values set as zero'
++
++	md.prognostic.spcthickness=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++	md.balancethickness.spcthickness=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++
++	if numpy.size(md.initialization.temperature)==md.mesh.numberofvertices:
++		md.thermal.spctemperature=float('NaN')*numpy.ones(md.mesh.numberofvertices)
++#		pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
++		pos=[i for i,vos in enumerate(md.mesh.vertexonsurface) if vos]
++		md.thermal.spctemperature[pos]=md.initialization.temperature[pos]    # impose observed temperature on surface
++		if not numpy.size(md.basalforcings.geothermalflux)==md.mesh.numberofvertices:
++			md.basalforcings.geothermalflux=numpy.zeros(md.mesh.numberofvertices)
++	else:
++		print '      no thermal boundary conditions created: no observed temperature found'
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m	(revision 12997)
+@@ -0,0 +1,95 @@
++function md=SetIceShelfBC(md,varargin)
++%SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
++%
++%   Neumann BC are used on the ice front (an ANRGUS contour around the ice front
++%   must be given in input)
++%   Dirichlet BC are used elsewhere for diagnostic
++%
++%   Usage:
++%      md=SetIceShelfBC(md,varargin)
++%
++%   Example:
++%      md=SetIceShelfBC(md);
++%      md=SetIceShelfBC(md,'Front.exp');
++%
++%   See also: SETICESHEETBC, SETMARINEICESHEETBC
++
++%node on Dirichlet (boundary and ~icefront)
++if nargin==2,
++	icefrontfile=varargin{1};
++	if ~exist(icefrontfile), error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']); end
++	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2);
++	nodeonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
++elseif nargin==1,
++	nodeonicefront=zeros(md.mesh.numberofvertices,1);
++else
++	help SetIceShelfBC
++	error('bad usage');
++end
++pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
++md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++md.diagnostic.spcvx(pos)=0;
++md.diagnostic.spcvy(pos)=0;
++md.diagnostic.spcvz(pos)=0;
++md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
++
++%Dirichlet Values
++if (length(md.inversion.vx_obs)==md.mesh.numberofvertices & length(md.inversion.vy_obs)==md.mesh.numberofvertices)
++	disp('      boundary conditions for diagnostic model: spc set as observed velocities');
++	md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos);
++	md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos);
++else
++	disp('      boundary conditions for diagnostic model: spc set as zero');
++end
++
++%segment on Ice Front
++%segment on Neumann (Ice Front)
++pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
++if (md.mesh.dimension==2)
++	pressureload=md.mesh.segments(pos,:);
++elseif md.mesh.dimension==3
++	pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
++	pressureload=[];
++	for i=1:md.mesh.numberoflayers-1,
++		pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
++	end
++end
++
++%Add water or air enum depending on the element
++pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))];
++
++%plug onto model
++md.diagnostic.icefront=pressureload;
++
++%Create zeros basalforcings and surfaceforcings
++if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
++	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
++	disp('      no surfaceforcings.precipitation specified: values set as zero');
++end
++if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
++	        md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
++		disp('      no surfaceforcings.mass_balance specified: values set as zero');
++end
++if isnan(md.basalforcings.melting_rate),
++	md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no basalforcings.melting_rate specified: values set as zero');
++end
++if isnan(md.balancethickness.thickening_rate),
++	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
++	disp('      no balancethickness.thickening_rate specified: values set as zero');
++end
++
++md.prognostic.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++md.balancethickness.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
++
++if (length(md.initialization.temperature)==md.mesh.numberofvertices),
++	md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
++	pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
++	if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices),
++		md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1);
++	end
++else
++	disp('      no thermal boundary conditions created: no observed temperature found');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/struc_class.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/struc_class.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/struc_class.m	(revision 12997)
+@@ -0,0 +1,30 @@
++%
++%  function to find the structural fields of a specified class
++%  
++%  [sclasso]=struc_class(sclass,cstr)
++%
++function [sclasso]=struc_class(sclass,cstr)
++
++%  collect only the objects of the appropriate class
++
++if     isa(sclass,cstr)
++    if ~isempty(inputname(1))
++        sclasso.(inputname(1))=sclass;
++    else
++        sclasso.(cstr)        =sclass;
++    end
++
++elseif isstruct(sclass)
++    fnames=fieldnames(sclass);
++    for i=1:numel(fnames)
++        if isa(sclass.(fnames{i}),cstr)
++            sclasso.(fnames{i})=sclass.(fnames{i});
++        end
++    end
++end
++
++if ~exist('sclasso','var')
++    sclasso=struct([]);
++end
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allempty.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allempty.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allempty.m	(revision 12997)
+@@ -0,0 +1,22 @@
++%
++%  function to return an empty cell array if all array elements are empty
++%
++%  function [cout]=allempty(cin)
++%
++function [cout]=allempty(cin)
++
++if ~nargin
++    help allempty
++    return
++end
++
++for j=1:numel(cin)
++    if ~isempty(cin{j})
++        cout=cin;
++        return
++    end
++end
++cout={};
++
++end
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allempty.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/struc_desc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/struc_desc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/struc_desc.m	(revision 12997)
+@@ -0,0 +1,61 @@
++%
++%  function to find the structures with the specified descriptors
++%  
++%  [sarrayo]=struc_desc(sarray,varargin)
++%
++function [sarrayo]=struc_desc(sarray,varargin)
++
++if ~isfield(sarray,'descriptor')
++    if ~isempty(inputname(1))
++        error('Field ''descriptor'' not found in array ''%s''.',inputname(1));
++    else
++        error('Field ''descriptor'' not found in array %d.',1);
++    end
++end
++
++sarrayo=struct([]);
++
++for iarg=1:nargin-1
++    if     iscell(varargin{iarg})
++        desc=        varargin{iarg};
++    elseif ischar(varargin{iarg})
++        desc=cellstr(varargin{iarg});
++    end
++    
++    for i=1:length(desc)
++        sarrayoi=struc_desci(sarray,desc{i});
++        if ~isempty(sarrayoi)
++            if isempty(sarrayo)
++                sarrayo       =sarrayoi;
++            else
++                sarrayo(end+1)=sarrayoi;
++            end
++        end
++    end
++end
++
++%  if nothing found, return whole array
++
++if isempty(sarrayo)
++    sarrayo=sarray;
++end
++
++end
++
++%
++%  function to find the structure with the specified descriptor
++%  
++function [sarrayo]=struc_desci(sarray,str)
++
++sarrayo=struct([]);
++
++for i=1:numel(sarray)
++    if strcmp(sarray(i).descriptor,str)
++        sarrayo=sarray(i);
++        return
++    end
++end
++
++warning(['String ''' str ''' not found in array ''' inputname(1) '''.']);
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_dim.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_dim.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_dim.m	(revision 12997)
+@@ -0,0 +1,72 @@
++%
++%  function to return the string dimension of an array element
++%
++%  function [sdim]=string_dim(a,idim,varargin)
++%
++function [sdim]=string_dim(a,idim,varargin)
++
++if ~nargin
++    help string_dim
++    return
++end
++
++%  check for scalar
++
++if (numel(a) == 1) && (idim == 1)
++    sdim='';
++    return
++end
++
++%  check for overflow
++
++if (idim > numel(a))
++    if ~isempty(inputname(1))
++        error('Index %d exceeds number of elements in array ''%s''.',...
++            idim,inputname(1));
++    else
++        error('Index %d exceeds number of elements in array %d.',...
++            idim,1);
++    end
++end
++
++%  check for column or row vector (Matlab uses a minimum of two
++%  dimensions, so this won't match Matlab standard output)
++
++for iarg=1:nargin-2
++    if strcmpi(varargin{iarg},'vector')
++        if (ndims(a) == 2) && ((size(a,1) == 1) || (size(a,2) == 1))
++            sdim =['(' num2str(idim) ')'];
++            return
++        end
++    end
++end
++
++%  do the general case
++
++asize=size(a);
++index=zeros(size(asize));
++aprod=prod(asize);
++idim =idim-1;
++
++%  calculate indices base 0 and convert to base 1
++
++%  note that ind2sub might be useful, except that it requires a list
++%  of scalars rather than a vector for output.
++
++for i=length(asize):-1:1
++    aprod=aprod/asize(i);
++    index(i)=floor(idim/aprod);
++    idim=idim-index(i)*aprod;
++end
++index=index+1;
++
++%  assemble string for output
++
++sdim ='(';
++for i=1:length(asize)-1;
++    sdim =[sdim num2str(index(i)) ','];
++end
++sdim =[sdim num2str(index(end)) ')'];
++
++end
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_dim.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allequal.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allequal.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allequal.m	(revision 12997)
+@@ -0,0 +1,70 @@
++%
++%  function to return an empty array if all array elements are
++%  equal to the given value, which may also be empty but not nan.
++%
++%  (note that by definition, nan is not equal to nan.  this could
++%  be changed by using isequalwithequalnans.)
++%
++%  function [aout]=allequal(ain,aval)
++%
++function [aout]=allequal(ain,aval)
++
++if ~nargin
++    help allequal
++    return
++end
++
++aout=ain;
++
++if     islogical(ain) && islogical(aval)
++    for i=1:numel(ain)
++        if ~isequal(ain(i),aval)
++            return
++        end
++    end
++    aout=logical([]);
++
++elseif isnumeric(ain) && isnumeric(aval)
++    for i=1:numel(ain)
++        if ~isequal(ain(i),aval)
++            return
++        end
++    end
++    aout=[];
++
++elseif ischar(ain) && ischar(aval)
++    for i=1:size(ain,1)
++        if ~strcmp(ain(i,:),aval)
++            return
++        end
++    end
++    aout='';
++
++elseif iscell(ain)
++    if     islogical(aval)
++        for i=1:numel(ain)
++            if ~islogical(ain{i}) || ~isequal(ain{i},aval)
++                return
++            end
++        end
++        aout={};
++
++    elseif isnumeric(aval)
++        for i=1:numel(ain)
++            if ~isnumeric(ain{i}) || ~isequal(ain{i},aval)
++                return
++            end
++        end
++        aout={};
++
++    elseif ischar(aval)
++        for i=1:size(ain,1)
++            if ~ischar(ain{i}) || ~strcmp(ain{i},aval)
++                return
++            end
++        end
++        aout={};
++    end
++end
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allequal.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_size.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_size.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_size.m	(revision 12997)
+@@ -0,0 +1,38 @@
++%
++%  function to return the string size of an array
++%
++%  function [ssize]=string_size(a,varargin)
++%
++function [ssize]=string_size(a,varargin)
++
++if ~nargin
++    help string_size
++    return
++end
++
++%  check for column or row vector (Matlab uses a minimum of two
++%  dimensions, so this won't match Matlab standard output)
++
++for iarg=1:nargin-1
++    if strcmpi(varargin{iarg},'vector')
++        if (ndims(a) == 2) && ((size(a,1) == 1) || (size(a,2) == 1))
++            ssize =['(' num2str(numel(a)) ')'];
++            return
++        end
++    end
++end
++
++%  do the general case
++
++asize=size(a);
++
++%  assemble string for output
++
++ssize ='(';
++for i=1:length(asize)-1;
++    ssize =[ssize num2str(asize(i)) 'x'];
++end
++ssize =[ssize num2str(asize(end)) ')'];
++
++end
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_size.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/any2str.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/any2str.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/any2str.m	(revision 12997)
+@@ -0,0 +1,22 @@
++%
++%  function to convert anything to a string
++%
++%  function [svec]=any2str(a,alim)
++%
++function [svec]=any2str(a,alim)
++
++if ~exist('alim','var') || (numel(a) <= alim)
++    if iscell(a)
++        svec=string_cell(a);
++    else
++        if (numel(a) > 1) && ~ischar(a)
++            svec=string_vec(a);
++        else
++            svec=item2str(a);
++        end
++    end
++else
++	svec=[string_size(a) ' ''' class(a) ''''];
++end
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/any2str.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_vec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_vec.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_vec.m	(revision 12997)
+@@ -0,0 +1,26 @@
++%
++%  function to return the string of an vector
++%
++%  function [svec]=string_vec(a)
++%
++function [svec]=string_vec(a)
++
++if ~nargin
++    help string_vec
++    return
++end
++
++if (numel(a) == 0)
++    svec='[]';
++    return
++end
++
++%  assemble string for output
++
++svec ='[';
++for i=1:numel(a)-1;
++    svec=[svec item2str(a(i)) ' '];
++end
++svec=[svec item2str(a(end)) ']'];
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_vec.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allnan.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allnan.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allnan.m	(revision 12997)
+@@ -0,0 +1,22 @@
++%
++%  function to return an empty double array if all array elements are NaN
++%
++%  function [dout]=allnan(din)
++%
++function [dout]=allnan(din)
++
++if ~nargin
++    help allnan
++    return
++end
++
++for i=1:numel(din)
++    if ~isnan(din(i))
++        dout=din;
++        return
++    end
++end
++dout=[];
++
++end
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/allnan.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/str2int.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/str2int.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/str2int.m	(revision 12997)
+@@ -0,0 +1,46 @@
++%
++%  function to find and read the first or last positive integer
++%  in a character string.
++%
++%  function [aint]=str2int(astr,cfl)
++%
++function [aint]=str2int(astr,cfl);
++
++aint=[];
++
++if     ~exist('cfl','var') || strncmpi(cfl,'f',1)
++    i=1;
++
++    while (i <= length(astr))
++        if (astr(i) >= '0' && astr(i) <= '9')
++            aint=sscanf(astr(i:length(astr)),'%d',[1,1]);
++            return
++        else
++            i=i+1;
++        end
++	end
++
++elseif strncmpi(cfl,'l',1)
++    i=length(astr);
++    ifound=false;
++
++    while (i >= 1)
++        if     (astr(i) >= '0' && astr(i) <= '9')
++            ifound=true;
++            i=i-1;
++        elseif ~ifound
++            i=i-1;
++        else
++            aint=sscanf(astr(i+1:length(astr)),'%d',[1,1]);
++            return
++        end
++	end
++
++    if ifound
++        aint=sscanf(astr,'%d',[1,1]);
++        return
++    end
++end
++
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_cell.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_cell.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_cell.m	(revision 12997)
+@@ -0,0 +1,26 @@
++%
++%  function to return the string of a cell array
++%
++%  function [svec]=string_cell(a)
++%
++function [svec]=string_cell(a)
++
++if ~nargin
++    help string_cell
++    return
++end
++
++if (numel(a) == 0)
++    svec='{}';
++    return
++end
++
++%  assemble string for output
++
++svec ='{';
++for i=1:numel(a)-1;
++    svec=[svec item2str(a{i}) ' '];
++end
++svec=[svec item2str(a{end}) '}'];
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/string_cell.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/find_string.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/find_string.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/find_string.m	(revision 12997)
+@@ -0,0 +1,18 @@
++%
++%  function to find a string in a cell array
++%  (could probably be replaced by matlab strmatch)
++%  
++%  [ifound]=find_string(cells,str)
++%
++function [ifound]=find_string(cells,str)
++
++ifound=false;
++
++for i=1:numel(cells)
++    if ischar(cells{i}) && strcmp(cells{i},str)
++        ifound=i;
++        return
++    end
++end
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/find_string.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/array_size.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/array_size.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/array_size.m	(revision 12997)
+@@ -0,0 +1,35 @@
++%
++%  function to find an array size from a list of arrays.
++%  
++%  [asize]=array_size(varargin)
++%
++%  see array_numel to check only the number of elements, if
++%  single indices will be used.
++%
++function [asize]=array_size(varargin)
++
++asize=[1 1];
++
++for iarg=1:nargin
++    if ischar(varargin{iarg})
++        isize=size(cellstr(varargin{iarg}));
++    else
++        isize=size(varargin{iarg});
++    end
++    
++    if ~isequal(isize,[1 1])
++        if isequal(asize,[1 1])
++            asize=isize;
++        else
++            if ~isequal(isize,asize)
++                if ~isempty(inputname(iarg))
++                    error('Array ''%s'' has inconsistent size.',inputname(iarg));
++                else
++                    error('Array %d has inconsistent size.',iarg);
++                end
++            end
++        end
++    end
++end
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/item2str.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/item2str.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/item2str.m	(revision 12997)
+@@ -0,0 +1,31 @@
++%
++%  function to convert an item to a string
++%
++%  function [svec]=item2str(a)
++%
++function [svec]=item2str(a)
++
++if     islogical(a)
++    if a
++        svec='true';
++    else
++        svec='false';
++    end
++elseif ischar(a)
++    svec=['''' a ''''];
++elseif isnumeric(a)
++    svec=num2str(a);
++else
++    if ~isempty(inputname(1))
++        warning('item2str:item_unrecog',...
++            'Item ''%s'' is of unrecognized type ''%s''.',...
++            inputname(1),class(a));
++    else
++        warning('item2str:item_unrecog',...
++            'Item %d is of unrecognized type ''%s''.',...
++            1,class(a));
++    end
++    return
++end
++
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/item2str.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/rotateticklabel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/rotateticklabel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/rotateticklabel.m	(revision 12997)
+@@ -0,0 +1,69 @@
++function th=rotateticklabel(h,rot,demo)
++%ROTATETICKLABEL rotates tick labels
++%   TH=ROTATETICKLABEL(H,ROT) is the calling form where H is a handle to
++%   the axis that contains the XTickLabels that are to be rotated. ROT is
++%   an optional parameter that specifies the angle of rotation. The default
++%   angle is 90. TH is a handle to the text objects created. For long
++%   strings such as those produced by datetick, you may have to adjust the
++%   position of the axes so the labels don't get cut off.
++%
++%   Of course, GCA can be substituted for H if desired.
++%
++%   TH=ROTATETICKLABEL([],[],'demo') shows a demo figure.
++%
++%   Known deficiencies: if tick labels are raised to a power, the power
++%   will be lost after rotation.
++%
++%   See also datetick.
++
++%   Written Oct 14, 2005 by Andy Bliss
++%   Copyright 2005 by Andy Bliss
++
++%DEMO:
++if nargin==3
++    x=[now-.7 now-.3 now];
++    y=[20 35 15];
++    figure
++    plot(x,y,'.-')
++    datetick('x',0,'keepticks')
++    h=gca;
++    set(h,'position',[0.13 0.35 0.775 0.55])
++    rot=90;
++end
++
++%set the default rotation if user doesn't specify
++if nargin==1
++    rot=90;
++end
++%make sure the rotation is in the range 0:360 (brute force method)
++while rot>360
++    rot=rot-360;
++end
++while rot<0
++    rot=rot+360;
++end
++%get current tick labels
++a=get(h,'XTickLabel');
++%erase current tick labels from figure
++set(h,'XTickLabel',[]);
++%get tick label positions
++b=get(h,'XTick');
++c=get(h,'YTick');
++%make new tick labels
++%  must consider yscale (jes, 9/14/10)
++switch lower(get(h,'YScale'))
++    case 'linear'
++        if rot<180
++            th=text(b,repmat(c(1)-.1*(c(2)-c(1)),length(b),1),a,'HorizontalAlignment','right','rotation',rot,'Interpreter','none');
++        else
++            th=text(b,repmat(c(1)-.1*(c(2)-c(1)),length(b),1),a,'HorizontalAlignment','left','rotation',rot,'Interpreter','none');
++        end
++    case 'log'
++        if rot<180
++            th=text(b,repmat(10^(log10(c(1))-.1*(log10(c(2))-log10(c(1)))),length(b),1),a,'HorizontalAlignment','right','rotation',rot,'Interpreter','none');
++        else
++            th=text(b,repmat(10^(log10(c(1))-.1*(log10(c(2))-log10(c(1)))),length(b),1),a,'HorizontalAlignment','left','rotation',rot,'Interpreter','none');
++        end
++    otherwise
++        set(h,'XTickLabel',a);
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/rotateticklabel.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/array_numel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/array_numel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array/array_numel.m	(revision 12997)
+@@ -0,0 +1,35 @@
++%
++%  function to find a number of elements from a list of arrays.
++%  
++%  [asize]=array_numel(varargin)
++%
++%  see array_size to check the number and shape of elements, if
++%  multiple indices will be used.
++%
++function [anum]=array_numel(varargin)
++
++anum=1;
++
++for iarg=1:nargin
++    if ischar(varargin{iarg})
++        inum=numel(cellstr(varargin{iarg}));
++    else
++        inum=numel(varargin{iarg});
++    end
++    
++    if ~isequal(inum,1)
++        if isequal(anum,1)
++            anum=inum;
++        else
++            if ~isequal(inum,anum)
++                if ~isempty(inputname(iarg))
++                    error('Array ''%s'' has inconsistent number of elements.',inputname(iarg));
++                else
++                    error('Array %d has inconsistent number of elements.',iarg);
++                end
++            end
++        end
++    end
++end
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/array
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/squarezoom.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/squarezoom.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/squarezoom.m	(revision 12997)
+@@ -0,0 +1,20 @@
++function squarezoom()
++%SQUAREZOOM - zoom on a part of a figure
++%
++%   Usage:
++%      squarezoom()
++
++disp('Click twice to define a square where you want to zoom. First click for upper left corner, second for lower right corner');
++[x,y]=ginput(2);
++dx=x(2)-x(1);
++dy=y(1)-y(2);
++
++if dx>dy,
++	delta=dx-dy;
++	xlim([x(1) x(2)]);
++	ylim([y(2)-delta/2 y(1)+delta/2]);
++else
++	delta=dy-dx;
++	xlim([x(1)-delta/2 x(2)+delta/2]);
++	ylim([y(2) y(1)]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot2patch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot2patch.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot2patch.m	(revision 12997)
+@@ -0,0 +1,16 @@
++function [px py]=plot2patch(x,y,miny)
++%PLOT2PATCH: build patch out of x,y plot.
++%
++% Usage: [px,py]=plot2patch(x,y,miny)
++%
++%        where px and py are a list of point defining a closed polygon.
++%              x,y are the values of the plot
++%              miny is the y-value used to close the plot into a closed polygon.
++% 
++%      See also patch, plot
++
++px=x;
++py=y;
++
++px=[px; flipud(x)];
++py=[py; ; miny*ones(length(x),1)];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot	(revision 12996)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot	(revision 12997)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
Index: /issm/oecreview/Archive/12678-13393/ISSM-12997-12998.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12997-12998.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12997-12998.diff	(revision 13394)
@@ -0,0 +1,62 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics/cfl_step.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics/cfl_step.m	(revision 12997)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/numerics/cfl_step.m	(revision 12998)
+@@ -1,23 +0,0 @@
+-function maxtime=cfl_step(md,vx,vy);
+-%CFL_STEP - return the maximum time step for the model in years
+-%
+-%   Dt < 0.5 / ( u/Dx +v/Dy )
+-%
+-%   Usage:
+-%      maxtime=cfl_step(md,vx,vy);
+-%
+-%   Example:
+-%      dt=cfl_step(md,md.results.DiagnosticSolution.Vx,md.results.DiagnosticSolution.Vy)
+-
+-%Check length of velocities 
+-if size(vx,1)~=md.mesh.numberofvertices & size(vy,1)~=md.mesh.numberofvertices,
+-	error('timestpes error message: size of velocity components must be the same as md.mesh.numberofvertices');
+-end
+-
+-index=md.mesh.elements;
+-edgex=max(md.mesh.x(index),[],2)-min(md.mesh.x(index),[],2);
+-edgey=max(md.mesh.y(index),[],2)-min(md.mesh.y(index),[],2);
+-vx=max(abs(vx(index)),[],2);
+-vy=max(abs(vy(index)),[],2);
+-
+-maxtime=1/2*min(1./(vx./edgex+vy./edgey));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/cfl_step.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/cfl_step.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/cfl_step.m	(revision 12998)
+@@ -0,0 +1,23 @@
++function maxtime=cfl_step(md,vx,vy);
++%CFL_STEP - return the maximum time step for the model in years
++%
++%   Dt < 0.5 / ( u/Dx +v/Dy )
++%
++%   Usage:
++%      maxtime=cfl_step(md,vx,vy);
++%
++%   Example:
++%      dt=cfl_step(md,md.results.DiagnosticSolution.Vx,md.results.DiagnosticSolution.Vy)
++
++%Check length of velocities 
++if size(vx,1)~=md.mesh.numberofvertices & size(vy,1)~=md.mesh.numberofvertices,
++	error('timestpes error message: size of velocity components must be the same as md.mesh.numberofvertices');
++end
++
++index=md.mesh.elements;
++edgex=max(md.mesh.x(index),[],2)-min(md.mesh.x(index),[],2);
++edgey=max(md.mesh.y(index),[],2)-min(md.mesh.y(index),[],2);
++vx=max(abs(vx(index)),[],2);
++vy=max(abs(vy(index)),[],2);
++
++maxtime=1/2*min(1./(vx./edgex+vy./edgey));
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/cfl_step.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-12998-12999.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-12998-12999.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-12998-12999.diff	(revision 13394)
@@ -0,0 +1,219 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.py	(revision 12998)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.py	(revision 12999)
+@@ -1,24 +0,0 @@
+-import platform
+-import os
+-from MatlabFuncs import *
+-
+-def issmdir():
+-	"""
+-	ISSMDIR - Get ISSM_DIR environment variable
+- 
+-	   Usage:
+-	      ISSM_DIR=issmdir()
+-	"""
+-
+-	if not 'Windows' in platform.system():
+-		ISSM_DIR =os.environ['ISSM_DIR']
+-	else:
+-		ISSM_DIR =os.environ['ISSM_DIR_WIN']
+-		if strcmpi(ISSM_DIR[-1],'/') or strcmpi(ISSM_DIR[-1],'\\'):
+-			ISSM_DIR = ISSM_DIR[:-1]    #shave off the last '/'
+-
+-	if not ISSM_DIR:
+-		raise RuntimeError("issmdir error message: 'ISSM_DIR' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!")
+-
+-	return ISSM_DIR
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/flaimdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/flaimdir.m	(revision 12998)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/flaimdir.m	(revision 12999)
+@@ -1,7 +0,0 @@
+-function FLAIM_DIR=flaimdir()
+-%ISSMDIR - Get FLAIM installation directory
+-%
+-%   Usage:
+-%      FLAIM_DIR=flaimdir()
+-
+-FLAIM_DIR=[issmdir '/externalpackages/flaim/install'];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/ucisvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/ucisvn.m	(revision 12998)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/ucisvn.m	(revision 12999)
+@@ -1,15 +0,0 @@
+-function UCI_SVN=ucisvn()
+-%ISSMDIR - Get UCI_SVN environment variable
+-%
+-%   Usage:
+-%      UCI_SVN=ucisvn()
+-
+-if ~ispc,
+-	UCI_SVN =getenv('UCI_SVN');
+-else
+-	UCI_SVN =getenv('UCI_SVN_WIN');
+-end
+-
+-if (isempty(UCI_SVN)),
+-	error('ucisvn error message: ''UCI_SVN'' environment variable is empty! You should define UCI_SVN in your .cshrc or .bashrc');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.m	(revision 12998)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/issmdir.m	(revision 12999)
+@@ -1,18 +0,0 @@
+-function ISSM_DIR=issmdir()
+-%ISSMDIR - Get ISSM_DIR environment variable
+-%
+-%   Usage:
+-%      ISSM_DIR=issmdir()
+-
+-if ~ispc,
+-	ISSM_DIR =getenv('ISSM_DIR');
+-else
+-	ISSM_DIR =getenv('ISSM_DIR_WIN');
+-	if strcmpi(ISSM_DIR(end),'/') | strcmpi(ISSM_DIR(end),'\'),
+-		ISSM_DIR = ISSM_DIR(1:end-1); %shave off the last '/'
+-	end
+-end
+-
+-if (isempty(ISSM_DIR)),
+-	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/jplsvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/jplsvn.m	(revision 12998)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/shell/jplsvn.m	(revision 12999)
+@@ -1,15 +0,0 @@
+-function JPL_SVN=jplsvn()
+-%ISSMDIR - Get JPL_SVN environment variable
+-%
+-%   Usage:
+-%      JPL_SVN=jplsvn()
+-
+-if ~ispc,
+-	JPL_SVN =getenv('JPL_SVN');
+-else
+-	JPL_SVN =getenv('JPL_SVN_WIN');
+-end
+-
+-if (isempty(JPL_SVN)),
+-	error('jplsvn error message: ''JPL_SVN'' environment variable is empty! You should define JPL_SVN in your .cshrc or .bashrc');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/flaimdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/flaimdir.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/flaimdir.m	(revision 12999)
+@@ -0,0 +1,7 @@
++function FLAIM_DIR=flaimdir()
++%ISSMDIR - Get FLAIM installation directory
++%
++%   Usage:
++%      FLAIM_DIR=flaimdir()
++
++FLAIM_DIR=[issmdir '/externalpackages/flaim/install'];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.py	(revision 12999)
+@@ -0,0 +1,24 @@
++import platform
++import os
++from MatlabFuncs import *
++
++def issmdir():
++	"""
++	ISSMDIR - Get ISSM_DIR environment variable
++ 
++	   Usage:
++	      ISSM_DIR=issmdir()
++	"""
++
++	if not 'Windows' in platform.system():
++		ISSM_DIR =os.environ['ISSM_DIR']
++	else:
++		ISSM_DIR =os.environ['ISSM_DIR_WIN']
++		if strcmpi(ISSM_DIR[-1],'/') or strcmpi(ISSM_DIR[-1],'\\'):
++			ISSM_DIR = ISSM_DIR[:-1]    #shave off the last '/'
++
++	if not ISSM_DIR:
++		raise RuntimeError("issmdir error message: 'ISSM_DIR' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!")
++
++	return ISSM_DIR
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ucisvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ucisvn.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ucisvn.m	(revision 12999)
+@@ -0,0 +1,15 @@
++function UCI_SVN=ucisvn()
++%ISSMDIR - Get UCI_SVN environment variable
++%
++%   Usage:
++%      UCI_SVN=ucisvn()
++
++if ~ispc,
++	UCI_SVN =getenv('UCI_SVN');
++else
++	UCI_SVN =getenv('UCI_SVN_WIN');
++end
++
++if (isempty(UCI_SVN)),
++	error('ucisvn error message: ''UCI_SVN'' environment variable is empty! You should define UCI_SVN in your .cshrc or .bashrc');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.m	(revision 12999)
+@@ -0,0 +1,18 @@
++function ISSM_DIR=issmdir()
++%ISSMDIR - Get ISSM_DIR environment variable
++%
++%   Usage:
++%      ISSM_DIR=issmdir()
++
++if ~ispc,
++	ISSM_DIR =getenv('ISSM_DIR');
++else
++	ISSM_DIR =getenv('ISSM_DIR_WIN');
++	if strcmpi(ISSM_DIR(end),'/') | strcmpi(ISSM_DIR(end),'\'),
++		ISSM_DIR = ISSM_DIR(1:end-1); %shave off the last '/'
++	end
++end
++
++if (isempty(ISSM_DIR)),
++	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/jplsvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/jplsvn.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/jplsvn.m	(revision 12999)
+@@ -0,0 +1,15 @@
++function JPL_SVN=jplsvn()
++%ISSMDIR - Get JPL_SVN environment variable
++%
++%   Usage:
++%      JPL_SVN=jplsvn()
++
++if ~ispc,
++	JPL_SVN =getenv('JPL_SVN');
++else
++	JPL_SVN =getenv('JPL_SVN_WIN');
++end
++
++if (isempty(JPL_SVN)),
++	error('jplsvn error message: ''JPL_SVN'' environment variable is empty! You should define JPL_SVN in your .cshrc or .bashrc');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/shell
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/shell	(revision 12998)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/shell	(revision 12999)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/shell
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
Index: /issm/oecreview/Archive/12678-13393/ISSM-13000-13001.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13000-13001.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13000-13001.diff	(revision 13394)
@@ -0,0 +1,87 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/recursivepath.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/recursivepath.m	(revision 13000)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/recursivepath.m	(revision 13001)
+@@ -1,38 +0,0 @@
+-function p = recursivepath(d)
+-%RECURSIVEPATH - generate paths in a directory
+-%
+-%   this routine is equivalent to Matlab's genpath except that it skips CVS and .svn directories
+-%
+-%   Usage:
+-%      p = recursivepath(d)
+-
+-%initialize path to be returned
+-p = '';
+-sep=pathsep;  %directory separator
+-
+-% Generate path based on given root directory
+-files=dir(d);
+-if isempty(files)
+-	return
+-end
+-
+-% Add d to the path even if it is empty.
+-p = [p d sep];
+-
+-% set logical vector for subdirectory entries in d
+-isdir = logical(cat(1,files.isdir));
+-
+-% Recursively goes through the subdirectories of d
+-dirs=files(isdir); % select only directory entries from the current listing
+-for i=1:length(dirs)
+-	dirname=dirs(i).name;
+-	if ~strcmp(dirname,'.')    & ...
+-		~strcmp(dirname,'..')   & ...
+-		~strcmp(dirname,'.svn') & ...
+-		~strcmp(dirname,'CVS')  & ...
+-		~strncmp(dirname,'@',1) & ... %Method directories not allowed in MATLAB path
+-		~strcmp(dirname,'private')    %private directories not allowed in MATLAB path
+-
+-		p = [p recursivepath(fullfile(d,dirname))];
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/recursivepath.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/recursivepath.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/recursivepath.m	(revision 13001)
+@@ -0,0 +1,39 @@
++function p = recursivepath(d)
++%RECURSIVEPATH - generate paths in a directory
++%
++%   this routine is equivalent to Matlab's genpath except that it skips CVS and
++%   .svn directories
++%
++%   Usage:
++%      p = recursivepath(d)
++
++%initialize path to be returned
++p = '';
++sep=pathsep;  %directory separator
++
++% Generate path based on given root directory
++files=dir(d);
++if isempty(files)
++	return
++end
++
++% Add d to the path even if it is empty.
++p = [p d sep];
++
++% set logical vector for subdirectory entries in d
++isdir = logical(cat(1,files.isdir));
++
++% Recursively goes through the subdirectories of d
++dirs=files(isdir); % select only directory entries from the current listing
++for i=1:length(dirs)
++	dirname=dirs(i).name;
++	if ~strcmp(dirname,'.')    & ...
++		~strcmp(dirname,'..')   & ...
++		~strcmp(dirname,'.svn') & ...
++		~strcmp(dirname,'CVS')  & ...
++		~strncmp(dirname,'@',1) & ... %Method directories not allowed in MATLAB path
++		~strcmp(dirname,'private')    %private directories not allowed in MATLAB path
++
++		p = [p recursivepath(fullfile(d,dirname))];
++	end
++end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13001-13002.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13001-13002.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13001-13002.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.m	(revision 13001)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.m	(revision 13002)
+@@ -26,7 +26,7 @@
+ %the variable ISSM_DIR in this file, in case it is not correctly setup. 
+ 
+ %ISSM path
+-addpath([ISSM_DIR '/src/m/utils/']); %loads recursivepath
++addpath([ISSM_DIR '/src/m/os/']); %loads recursivepath
+ addpath([ISSM_DIR '/bin']);
+ addpath(recursivepath([ISSM_DIR '/src/m']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/scotch']));
Index: /issm/oecreview/Archive/12678-13393/ISSM-13003-13004.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13003-13004.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13003-13004.diff	(revision 13394)
@@ -0,0 +1,2908 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/petscversion.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/petscversion.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/petscversion.m	(revision 13004)
+@@ -0,0 +1,26 @@
++function PETSC_VERSION=petscversion()
++%PETSCVERSION - recover petsc version number, inside config.h file
++%
++%   Usage:
++%       PETSC_VERSION=petscversion();
++
++%default
++PETSC_VERSION=3;
++
++configfile=[issmdir() '/config.h'];
++if ~exist(configfile,'file'),
++	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
++end
++
++%go through the file, and recover the line we want
++fid=fopen(configfile,'r');
++if(fid==-1), error(['could not open file: ' configfile]); end
++
++while(true),
++	tline=fgets(fid);
++	if ~ischar(tline), break, end
++	if  strncmp(tline,'#define _PETSC_MAJOR_',21),
++		PETSC_VERSION=str2num(tline(23));
++	end
++end
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/petscversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/petscversion.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/petscversion.py	(revision 13004)
+@@ -0,0 +1,34 @@
++import os
++from issmdir import *
++from MatlabFuncs import *
++
++def petscversion():
++	"""
++	PETSCVERSION - recover petsc version number, inside config.h file
++ 
++	   Usage:
++	      PETSC_VERSION=petscversion();
++	"""
++
++	#default
++	PETSC_VERSION=3
++
++	configfile=os.path.join(issmdir(),'config.h')
++	if not os.path.exists(configfile):
++		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
++
++	#go through the file, and recover the line we want
++	try:
++		fid=open(configfile,'r')
++	except IOError as e:
++		raise IOerror("could not open file: '%s'" % configfile)
++
++	for tline in fid:
++		if strncmp(tline,'#define _PETSC_MAJOR_',21):
++			PETSC_VERSION=int(tline[22])
++			break
++
++	fid.close()
++
++	return PETSC_VERSION
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.py	(revision 13004)
+@@ -1,119 +0,0 @@
+-import datetime
+-import os
+-import shutil
+-from pairoptions import *
+-from process_solve_options import *
+-from EnumDefinitions import *
+-from ismodelselfconsistent import *
+-
+-def solve(md,solutionenum,*args):
+-	"""
+-	SOLVE - apply solution sequence for this model
+- 
+-	   Usage:
+-	      md=solve(md,solutionenum,varargin)
+-	      where varargin is a list of paired arguments of string OR enums
+- 
+-	   solution types available comprise:
+-	      - DiagnosticSolutionEnum
+-	      - PrognosticSolutionEnum
+-	      - ThermalSolutionEnum
+-	      - SteadystateSolutionEnum
+-	      - TransientSolutionEnum...
+-	      - BalancethicknessSolutionEnum
+-	      - BedSlopeSolutionEnum
+-	      - SurfaceSlopeSolutionEnum
+-	      - HydrologySolutionEnum
+-	      - FlaimSolutionEnum
+- 
+-	   extra options:
+-	      - loadonly : does not solve. only load results
+- 
+-	   Examples:
+-	      md=solve(md,DiagnosticSolutionEnum);
+-	"""
+-
+-	#recover and process solve options
+-	options=pairoptions('solution_type',solutionenum,*args)
+-	options=process_solve_options(options)
+-
+-	#recover some fields
+-	md.private.solution=options['solution_type']
+-	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)
+-
+-	#First, build a runtime name that is unique
+-	c=datetime.datetime.now()
+-	md.private.runtimename="%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name,c.month,c.day,c.year,c.hour,c.minute,c.second,os.getpid())
+-
+-	#if running qmu analysis, some preprocessing of dakota files using models
+-	#fields needs to be carried out. 
+-	if md.qmu.isdakota:
+-		md=preqmu(md,options)
+-
+-	#flaim analysis
+-	if options['solution_type'] == FlaimSolutionEnum:
+-		md=flaim_sol(md,options)
+-		md.private.solution=EnumToString(options['solution_type'])
+-		return md
+-
+-	#Do we load results only?
+-	if options['loadonly']:  
+-		md=loadresultsfromcluster(md)
+-		return md
+-
+-	#Wite all input files
+-	marshall(md)                                           # bin file
+-	md.solver.PetscFile(md.miscellaneous.name+'.petsc')    # petsc file
+-	cluster.BuildQueueScript(md.miscellaneous.name,md.private.runtimename,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
+-
+-	#we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+-	if not ispetsc:
+-		print "PETSC support not included, running on 1 cpu only!"
+-		cluster.np=1
+-
+-	#Stop here if batch mode
+-	if strcmpi(options['batch'],'yes'):
+-		print 'batch mode requested: not launching job interactively'
+-		print 'launch solution sequence on remote cluster by hand'
+-		return md
+-
+-	#Launch job
+-	modelname = md.miscellaneous.name
+-	filelist  = [modelname+'.bin ',modelname+'.petsc ',modelname+'.queue ']
+-	if md.qmu.isdakota:
+-		filelist.append(modelname+'.qmu.in')
+-	cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist)
+-
+-	#did we even try to run? if so, wait on lock
+-	if strcmpi(options['upload'],'on'):
+-		print 'solve done uploading test decks'
+-		return md
+-
+-	#wait on lock
+-	if md.settings.waitonlock>0:
+-		#we wait for the done file
+-		islock=waitonlock(md)
+-		if islock==0:    #no results to be loaded
+-			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
+-		else:            #load results
+-			print 'loading results from cluster'
+-			md=loadresultsfromcluster(md)
+-
+-	#post processes qmu results if necessary
+-	if md.qmu.isdakota:
+-		if not strncmpi(options['keep'],'y',1):
+-			shutil.rmtree('qmu'+str(os.getpid()))
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.m	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.m	(revision 13004)
+@@ -1,26 +0,0 @@
+-function PETSC_VERSION=petscversion()
+-%PETSCVERSION - recover petsc version number, inside config.h file
+-%
+-%   Usage:
+-%       PETSC_VERSION=petscversion();
+-
+-%default
+-PETSC_VERSION=3;
+-
+-configfile=[issmdir() '/config.h'];
+-if ~exist(configfile,'file'),
+-	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
+-end
+-
+-%go through the file, and recover the line we want
+-fid=fopen(configfile,'r');
+-if(fid==-1), error(['could not open file: ' configfile]); end
+-
+-while(true),
+-	tline=fgets(fid);
+-	if ~ischar(tline), break, end
+-	if  strncmp(tline,'#define _PETSC_MAJOR_',21),
+-		PETSC_VERSION=str2num(tline(23));
+-	end
+-end
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.m	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.m	(revision 13004)
+@@ -1,60 +0,0 @@
+-function md=loadresultsfromcluster(md,runtimename)
+-%LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
+-%
+-%   Usage:
+-%      md=loadresultsfromcluster(md,runtimename);
+-
+-%retrieve cluster, to be able to call its methods
+-cluster=md.cluster;
+-
+-if nargin==2,
+-	md.private.runtimename=runtimename;
+-end
+-
+-%Download outputs from the cluster
+-filelist={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
+-if md.qmu.isdakota,
+-	filelist{end+1}=[md.miscellaneous.name '.qmu.err'];
+-	filelist{end+1}=[md.miscellaneous.name '.qmu.out'];
+-	if isfield(md.qmu.params,'tabular_graphics_data'),
+-		if md.qmu.params.tabular_graphics_data==true,
+-			filelist{end+1}='dakota_tabular.dat';
+-		end
+-	end
+-else
+-	filelist{end+1}=[md.miscellaneous.name '.outbin'];
+-end
+-Download(cluster,md.private.runtimename,filelist);
+-
+-%If we are here, no errors in the solution sequence, call loadresultsfromdisk.
+-md=loadresultsfromdisk(md,[md.miscellaneous.name '.outbin']);
+-
+-%erase the log and output files
+-if md.qmu.isdakota,
+-	delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.outlog']);
+-	delete([['qmu' num2str(feature('GetPid')) '/']  md.miscellaneous.name '.errlog']);
+-else
+-	delete([md.miscellaneous.name '.outlog']);
+-	delete([md.miscellaneous.name '.errlog']);
+-	delete([md.miscellaneous.name '.outbin']);
+-	if ~ispc,
+-		delete([md.private.runtimename '.tar.gz']);
+-	end
+-end
+-
+-%erase input file if run was carried out on same platform.
+-hostname=oshostname();
+-if strcmpi(hostname,cluster.name),
+-	if md.qmu.isdakota,
+-		delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.bin']);
+-		delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.queue']);
+-	else
+-		delete([md.miscellaneous.name '.bin']);
+-		delete([md.miscellaneous.name '.petsc']);
+-		if ~ispc,
+-			delete([md.miscellaneous.name '.queue']);
+-		else
+-			delete([md.miscellaneous.name '.bat']);
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.py	(revision 13004)
+@@ -1,48 +0,0 @@
+-import os
+-from EnumDefinitions import *
+-
+-def process_solve_options(options):
+-	"""
+-	DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
+- 
+-	   Usage:
+-	      options=process_solve_options(options)
+- 
+-	   See also: SOLVE
+-	"""
+-
+-	outoptions={}
+-
+-	#solution_type: check on this option, error out otherwise
+-	solution_type=options.getfieldvalue('solution_type')
+-	if not solution_type in (DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,\
+-			SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,\
+-			BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum):
+-		raise ValueError("process_solve_options error message: solution_type '%s' not supported yet!" % EnumToString(solution_type))
+-	outoptions['solution_type']=solution_type
+-
+-	outoptions['upload']=options.getfieldvalue('upload','off')
+-	outoptions['batch']=options.getfieldvalue('batch','no')
+-	outoptions['loadonly']=options.getfieldvalue('loadonly',False)
+-	outoptions['directory']=options.getfieldvalue('directory','')
+-
+-	#  process qmu arguments
+-	outoptions['qmudir']=options.getfieldvalue('qmudir','qmu'+str(os.getpid()))
+-	outoptions['qmufile']=options.getfieldvalue('qmufile','qmu')    # qmufile cannot be changed unless ????script.sh is also changed
+-	outoptions['overwrite']=options.getfieldvalue('overwrite','n')
+-	outoptions['keep']=options.getfieldvalue('keep','n')
+-	outoptions['ivar']=options.getfieldvalue('ivar',1)
+-	outoptions['iresp']=options.getfieldvalue('iresp',1)
+-	outoptions['imethod']=options.getfieldvalue('imethod',1)
+-	outoptions['iparams']=options.getfieldvalue('iparams',1)
+-	outoptions['runmpi']=options.getfieldvalue('runmpi',False)
+-
+-	#  process flaim arguments
+-	outoptions['fmdir']=options.getfieldvalue('fmdir','fm'+str(os.getpid()))
+-	outoptions['overwrite']=options.getfieldvalue('overwrite','n')
+-	outoptions['keep']=options.getfieldvalue('keep','y')
+-	outoptions['latsgn']=options.getfieldvalue('latsgn',0)
+-	outoptions['cmap']=options.getfieldvalue('cmap',[])
+-
+-	return outoptions
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.py	(revision 13004)
+@@ -1,47 +0,0 @@
+-from WriteData import *
+-
+-def marshall(md):
+-	"""
+-	MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
+-
+-	   The routine creates a compatible binary file from @model md
+-	   This binary file will be used for parallel runs in JPL-package
+-
+-	   Usage:
+-	      marshall(md)
+-	"""
+-
+-	print "marshalling file '%s.bin'." % md.miscellaneous.name
+-
+-	#open file for binary writing
+-	try:
+-		fid=open(md.miscellaneous.name+'.bin','wb')
+-	except IOError as e:
+-		raise IOError("marshall error message: could not open '%s.bin' file for binary writing." % md.miscellaneous.name)
+-
+-	#First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
+-	WriteData(fid,'enum',MaximumNumberOfEnums(),'data',True,'format','Boolean')
+-
+-	#Go through all model fields: check that it is a class and call checkconsistency
+-	fields=vars(md)
+-
+-	for field in fields.iterkeys():
+-
+-		#Some properties do not need to be marshalled
+-		if field in ['results','radaroverlay','solver','cluster','flaim','private']:
+-			continue
+-
+-		#Check that current field is an object
+-		if not hasattr(getattr(md,field),'marshall'):
+-			raise TypeError("field '%s' is not an object." % field)
+-
+-		#Marshall current object
+-		#print "marshalling %s ..." % field
+-		exec("md.%s.marshall(fid)" % field)
+-
+-	#close file
+-	try:
+-		f.close(fid)
+-	except IOError as e:
+-		raise IOError("marshall error message: could not close file '%s.bin'." % md.miscellaneous.name)
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.m	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/process_solve_options.m	(revision 13004)
+@@ -1,39 +0,0 @@
+-function outoptions=process_solve_options(options)
+-%DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
+-%
+-%   Usage:
+-%      options=process_solve_options(options)
+-%
+-%   See also: SOLVE
+-
+-%solution_type: check on this option, error out otherwise
+-solution_type=getfieldvalue(options,'solution_type');
+-if ~ismember(solution_type,[DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,...
+-		SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,...
+-		BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum]),
+-	error(['process_solve_options error message: solution_type ' EnumToString(solution_type) ' not supported yet!']);
+-end
+-outoptions.solution_type=solution_type;
+-
+-outoptions.upload=getfieldvalue(options,'upload','off');
+-outoptions.batch=getfieldvalue(options,'batch','no');
+-outoptions.loadonly=getfieldvalue(options,'loadonly',false);
+-outoptions.directory=getfieldvalue(options,'directory','');
+-
+-%  process qmu arguments
+-outoptions.qmudir=getfieldvalue(options,'qmudir',['qmu' num2str(feature('GetPid'))]);  % qmudir =['qmu_' datestr(now,'yyyymmdd_HHMMSS')];
+-outoptions.qmufile=getfieldvalue(options,'qmufile','qmu');% qmufile cannot be changed unless ????script.sh is also changed
+-outoptions.overwrite=getfieldvalue(options,'overwrite','n');
+-outoptions.keep=getfieldvalue(options,'keep','n');
+-outoptions.ivar=getfieldvalue(options,'ivar',1);
+-outoptions.iresp=getfieldvalue(options,'iresp',1);
+-outoptions.imethod=getfieldvalue(options,'imethod',1);
+-outoptions.iparams=getfieldvalue(options,'iparams',1);
+-outoptions.runmpi=getfieldvalue(options,'runmpi',false);
+-
+-%  process flaim arguments
+-outoptions.fmdir=getfieldvalue(options,'fmdir',['fm' num2str(feature('GetPid'))]);
+-outoptions.overwrite=getfieldvalue(options,'overwrite','n');
+-outoptions.keep=getfieldvalue(options,'keep','y');
+-outoptions.latsgn=getfieldvalue(options,'latsgn',0);
+-outoptions.cmap=getfieldvalue(options,'cmap',[]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.m	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve.m	(revision 13004)
+@@ -1,121 +0,0 @@
+-function md=solve(md,solutionenum,varargin)
+-%SOLVE - apply solution sequence for this model
+-%
+-%   Usage:
+-%      md=solve(md,solutionenum,varargin)
+-%      where varargin is a lit of paired arguments of string OR enums
+-%
+-%   solution types available comprise:
+-%		 - DiagnosticSolutionEnum
+-%		 - PrognosticSolutionEnum
+-%		 - ThermalSolutionEnum
+-%		 - SteadystateSolutionEnum
+-%		 - TransientSolutionEnum...
+-%		 - BalancethicknessSolutionEnum
+-%		 - BedSlopeSolutionEnum
+-%		 - SurfaceSlopeSolutionEnum
+-%		 - HydrologySolutionEnum
+-%		 - FlaimSolutionEnum
+-%
+-%  extra options:
+-%      - loadonly : does not solve. only load results
+-%
+-%   Examples:
+-%      md=solve(md,DiagnosticSolutionEnum);
+-
+-%recover and process solve options
+-options=pairoptions(varargin{:},'solution_type',solutionenum);
+-options=process_solve_options(options);
+-
+-%recover some fields
+-md.private.solution=options.solution_type;
+-cluster=md.cluster;
+-
+-%check model consistency
+-disp('checking model consistency');
+-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
+-
+-%First, build a runtime name that is unique
+-c=clock;
+-md.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',md.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
+-
+-%if running qmu analysis, some preprocessing of dakota files using models
+-%fields needs to be carried out. 
+-if md.qmu.isdakota,
+-	md=preqmu(md,options);
+-end
+-
+-%flaim analysis
+-if (options.solution_type == FlaimSolutionEnum)
+-	md=flaim_sol(md,options);
+-	md.private.solution=EnumToString(options.solution_type);
+-	return;
+-end
+-
+-%Do we load results only?
+-if options.loadonly,  
+-	md=loadresultsfromcluster(md);
+-	return;
+-end
+-
+-%we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+-if ~ispetsc,
+-	disp('PETSC support not included, running on 1 cpu only!');
+-	cluster.np=1;
+-end
+-
+-
+-%Wite all input files
+-marshall(md);                                          % bin file
+-PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file
+-BuildQueueScript(cluster,md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); % queue file
+-
+-
+-%Stop here if batch mode
+-if strcmpi(options.batch,'yes')
+-	disp('batch mode requested: not launching job interactively');
+-	disp('launch solution sequence on remote cluster by hand');
+-	return;
+-end
+-
+-%Launch job
+-modelname = md.miscellaneous.name;
+-filelist  = {[modelname '.bin '] [modelname '.petsc '] [modelname '.queue ']};
+-if md.qmu.isdakota,
+-	filelist{end+1} = [modelname '.qmu.in'];
+-end
+-LaunchQueueJob(cluster,md.miscellaneous.name,md.private.runtimename,filelist);
+-
+-%did we even try to run? if so, wait on lock
+-if strcmpi(options.upload,'on'),
+-	disp('solve done uploading test decks');
+-	return;
+-end
+-
+-%wait on lock
+-if md.settings.waitonlock>0,
+-	%we wait for the done file
+-	islock=waitonlock(md);
+-	if islock==0, %no results to be loaded
+-		disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
+-	else          %load results
+-		disp('loading results from cluster');
+-		md=loadresultsfromcluster(md);
+-	end
+-end
+-
+-%post processes qmu results if necessary
+-if md.qmu.isdakota,
+-	if ~strncmpi(options.keep,'y',1)
+-		system(['rm -rf qmu' num2str(feature('GetPid'))]);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.py	(revision 13004)
+@@ -1,60 +0,0 @@
+-import os
+-
+-def loadresultsfromdisk(md,filename):
+-	"""
+-	LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
+- 
+-	   Usage:
+-	      md=loadresultsfromdisk(md=False,filename=False);
+-	"""
+-
+-	#check number of inputs/outputs
+-	if not md or not filename:
+-		raise ValueError("loadresultsfromdisk: error message.")
+-
+-	if not md.qmu.isdakota:
+-
+-		#Check that file exists
+-		if not os.path.exists(filename):
+-			raise ValueError("binary file '%s' not found." % filename)
+-
+-		#initialize md.results if not a structure yet
+-		if not isinstance(md.results,dict):
+-			md.results={}
+-
+-		#load results onto model
+-		structure=parseresultsfromdisk(filename,~md.settings.io_gather)
+-		if not len(structure):
+-			raise RuntimeError("No result found in binary file '%s'. Check for solution crash." % filename)
+-		end
+-		md.results[structure[1]['SolutionType']]=structure;
+-
+-		#recover solution_type from results
+-		md.private.solution=structure[1]['SolutionType']
+-
+-		#read log files onto fields
+-		if os.path.exists(md.miscellaneous.name+'.errlog'):
+-			with open(md.miscellaneous.name+'.errlog','r') as f:
+-				md.results[structure[1]['SolutionType']]['errlog']=[line[:-1] for line in f]
+-		else:
+-			md.results[structure[1]['SolutionType']]['errlog']=[]
+-
+-		if os.path.exists(md.miscellaneous.name+'.outlog'):
+-			with open(md.miscellaneous.name+'.outlog','r') as f:
+-				md.results[structure[1]['SolutionType']]['outlog']=[line[:-1] for line in f]
+-		else:
+-			md.results[structure[1]['SolutionType']]['outlog']=[]
+-
+-		if len(md.results[structure[1]['SolutionType']]['errlog']):
+-			print ("loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields.")
+-
+-	#post processes qmu results if necessary
+-	else:
+-
+-		if not isinstance(md.private.solution,str):
+-			md.private.solution=EnumToString(md.private.solution)
+-		md=postqmu(md)
+-		os.chdir('..')
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.py	(revision 13004)
+@@ -1,274 +0,0 @@
+-import numpy
+-import math
+-import struct
+-from MatlabFuncs import *
+-
+-def WriteData(fid,*args):
+-	"""
+-	WRITEDATA - write model field in binary file
+- 
+-	   Usage:
+-	      WriteData(fid,varargin)
+-	"""
+-
+-	#process options
+-	options=pairoptions(*args)
+-
+-	#Get data properties
+-	if options.exist('object'):
+-		#This is an object field, construct enum and data
+-		obj       = options.getfieldvalue('object')
+-		fieldname = options.getfieldvalue('fieldname')
+-		classname = type(obj)
+-
+-		enum      = BuildEnum(classname+'_'+fieldname)
+-		data      = getattr(obj,fieldname)
+-	else:
+-		#No processing required
+-		data = options.getfieldvalue('data')
+-		enum = options.getfieldvalue('enum')
+-	format  = options.getfieldvalue('format')
+-	mattype = options.getfieldvalue('mattype',0)    #only required for matrices
+-
+-	#Process sparse matrices
+-#	if issparse(data),
+-#		data=full(data);
+-#	end
+-
+-	#Step 1: write the enum to identify this record uniquely
+-	fid.write(struct.pack('i',enum)) 
+-
+-	#Step 2: write the data itself.
+-	if   strcmpi(format,'Boolean'):    # {{{
+-		if len(data) !=1:
+-			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',4+4))  #1 bool (disguised as an int)+code
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#now write integer
+-		fid.write(struct.pack('i',data))  #send an int, not easy to send a bool
+-		# }}}
+-
+-	elif strcmpi(format,'Integer'):    # {{{
+-		if len(data) !=1:
+-			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',4+4))  #1 integer + code
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#now write integer
+-		fid.write(struct.pack('i',data)) 
+-		# }}}
+-
+-	elif strcmpi(format,'Double'):    # {{{
+-		if len(data) !=1:
+-			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',8+4))  #1 double+code
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#now write double
+-		fid.write(struct.pack('d',data)) 
+-		# }}}
+-
+-	elif strcmpi(format,'String'):    # {{{
+-		#first write length of record
+-		fid.write(struct.pack('i',len(data)+4+4))  #string + string size + code
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#now write string
+-		fid.write(struct.pack('i',len(data))) 
+-		fid.write(struct.pack('%ds' % len(data),data)) 
+-		# }}}
+-
+-	elif strcmpi(format,'BooleanMat'):    # {{{
+-
+-		#Get size
+-		s=data.shape
+-		#if matrix = NaN, then do not write anything
+-		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
+-			s[0]=0
+-			s[1]=0
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
+-
+-		#write data code and matrix type: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-		fid.write(struct.pack('i',mattype))
+-
+-		#now write matrix
+-		fid.write(struct.pack('i',s[0])) 
+-		fid.write(struct.pack('i',s[1])) 
+-		for i in xrange(s[0]):
+-			for j in xrange(s[1]):
+-				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
+-		# }}}
+-
+-	elif strcmpi(format,'IntMat'):    # {{{
+-
+-		#Get size
+-		s=data.shape
+-		#if matrix = NaN, then do not write anything
+-		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
+-			s[0]=0
+-			s[1]=0
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
+-
+-		#write data code and matrix type: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-		fid.write(struct.pack('i',mattype))
+-
+-		#now write matrix
+-		fid.write(struct.pack('i',s[0])) 
+-		fid.write(struct.pack('i',s[1])) 
+-		for i in xrange(s[0]):
+-			for j in xrange(s[1]):
+-				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
+-		# }}}
+-
+-	elif strcmpi(format,'DoubleMat'):    # {{{
+-
+-		#Get size
+-		s=data.shape
+-		#if matrix = NaN, then do not write anything
+-		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
+-			s[0]=0
+-			s[1]=0
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
+-
+-		#write data code and matrix type: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-		fid.write(struct.pack('i',mattype))
+-
+-		#now write matrix
+-		fid.write(struct.pack('i',s[0])) 
+-		fid.write(struct.pack('i',s[1])) 
+-		for i in xrange(s[0]):
+-			for j in xrange(s[1]):
+-				fid.write(struct.pack('d',data[i][j]))    #get to the "c" convention, hence the transpose
+-		# }}}
+-
+-	elif strcmpi(format,'MatArray'):    # {{{
+-
+-		#first get length of record
+-		recordlength=4+4    #number of records + code
+-		for matrix in data:
+-			s=matrix.shape
+-			recordlength+=4*2+s[0]*s[1]*8    #row and col of matrix + matrix of doubles
+-
+-		#write length of record
+-		fid.write(struct.pack('i',recordlength)) 
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#write data, first number of records
+-		fid.write(struct.pack('i',len(data))) 
+-
+-		#write each matrix: 
+-		for matrix in data:
+-			s=matrix.shape
+-			fid.write(struct.pack('i',s[0])) 
+-			fid.write(struct.pack('i',s[1])) 
+-			for i in xrange(s[0]):
+-				for j in xrange(s[1]):
+-					fid.write(struct.pack('d',matrix[i][j]))
+-		# }}}
+-
+-	elif strcmpi(format,'StringArray'):    # {{{
+-
+-		#first get length of record
+-		recordlength=4+4    #for length of array + code
+-		for string in data:
+-			recordlength+=4+len(string)    #for each string
+-
+-		#write length of record
+-		fid.write(struct.pack('i',recordlength)) 
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#now write length of string array
+-		fid.write(struct.pack('i',len(data))) 
+-
+-		#now write the strings
+-		for string in data:
+-			fid.write(struct.pack('i',len(string))) 
+-			fid.write(struct.pack('%ds' % len(string),string)) 
+-		# }}}
+-
+-	else:    # {{{
+-		raise TypeError('WriteData error message: data type: %d not supported yet! (%s)' % (format,EnumToString(enum)))
+-	# }}}
+-
+-def BuildEnum(string): # {{{
+-	"""
+-	BUILDENUM - build enum out of string
+- 
+-    Usage:
+-       enum=BuildEnum(string)
+-	"""
+-
+-	if '_' in string:
+-		substrs=string.split('_')
+-		string=''
+-		for str in substrs:
+-			string+=str[0].upper()+str[1:]
+-	else:
+-		#take first letter of string and make it uppercase: 
+-		string=str[0].upper()+str[1:]
+-
+-	#Get Enum
+-	exec('enum='+string+'Enum()',globals())
+-
+-	return enum
+-# }}}
+-
+-def FormatToCode(format): # {{{
+-	"""
+-	This routine takes the format string, and hardcodes it into an integer, which 
+-	is passed along the record, in order to identify the nature of the dataset being 
+-	sent.
+-	"""
+-
+-	if   strcmpi(format,'Boolean'):
+-		code=1
+-	elif strcmpi(format,'Integer'):
+-		code=2
+-	elif strcmpi(format,'Double'):
+-		code=3
+-	elif strcmpi(format,'String'):
+-		code=4
+-	elif strcmpi(format,'BooleanMat'):
+-		code=5
+-	elif strcmpi(format,'IntMat'):
+-		code=6
+-	elif strcmpi(format,'DoubleMat'):
+-		code=7
+-	elif strcmpi(format,'MatArray'):
+-		code=8
+-	elif strcmpi(format,'StringArray'):
+-		code=9
+-	else:
+-		raise InputError('FormatToCode error message: data type not supported yet!')
+-
+-	return code
+-# }}}
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromcluster.py	(revision 13004)
+@@ -1,61 +0,0 @@
+-import os
+-import platform
+-import socket
+-from MatlabFuncs import *
+-
+-def loadresultsfromcluster(md,runtimename=False):
+-	"""
+-	LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
+- 
+-	   Usage:
+-	      md=loadresultsfromcluster(md,runtimename);
+-	"""
+-
+-	#retrieve cluster, to be able to call its methods
+-	cluster=md.cluster
+-
+-	if runtimename:
+-		md.private.runtimename=runtimename
+-	end
+-
+-	#Download outputs from the cluster
+-	filelist=[md.miscellaneous.name+'.outlog',md.miscellaneous.name+'.errlog']
+-	if md.qmu.isdakota:
+-		filelist.append(md.miscellaneous.name+'.qmu.err')
+-		filelist.append(md.miscellaneous.name+'.qmu.out')
+-		if 'tabular_graphics_data' in md.qmu.params:
+-			if md.qmu.params['tabular_graphics_data']:
+-				filelist.append('dakota_tabular.dat')
+-		filelist.append(md.miscellaneous.name+'.outbin')
+-	Download(cluster,md.private.runtimename,filelist)
+-
+-	#If we are here, no errors in the solution sequence, call loadresultsfromdisk.
+-	md=loadresultsfromdisk(md,md.miscellaneous.name+'.outbin')
+-
+-	#erase the log and output files
+-	if md.qmu.isdakota:
+-		os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.outlog'))
+-		os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.errlog'))
+-	else:
+-		os.remove(md.miscellaneous.name+'.outlog')
+-		os.remove(md.miscellaneous.name+'.errlog')
+-		os.remove(md.miscellaneous.name+'.outbin')
+-		if not 'Windows' in platform.system():
+-			os.remove(md.private.runtimename+'.tar.gz')
+-
+-	#erase input file if run was carried out on same platform.
+-	hostname=socket.gethostname().lower().split('.')[0]
+-	if strcmpi(hostname,cluster.name):
+-		if md.qmu.isdakota:
+-			os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.bin'))
+-			os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.queue'))
+-		else:
+-			os.remove(md.miscellaneous.name+'.bin')
+-			os.remove(md.miscellaneous.name+'.petsc')
+-			if not 'Windows' in platform.system():
+-				os.remove(md.miscellaneous.name+'.queue')
+-			else:
+-				os.remove(md.miscellaneous.name+'.bat')
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.m	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadresultsfromdisk.m	(revision 13004)
+@@ -1,61 +0,0 @@
+-function md=loadresultsfromdisk(md,filename)
+-%LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
+-%
+-%   Usage:
+-%      md=loadresultsfromdisk(md,filename);
+-
+-%check number of inputs/outputs
+-if ((nargin~=2) | (nargout~=1)),
+-	help loadresultsfromdisk;
+-	error('loadresultsfromdisk: error message.');
+-end
+-
+-if ~md.qmu.isdakota,
+-
+-	%Check that file exists
+-	if ~exist(filename,'file'),
+-		error(['binary file ' filename ' not found.']);
+-	end
+-
+-	%initialize md.results if not a structure yet
+-	if ~isstruct(md.results),
+-		md.results=struct();
+-	end
+-
+-	%load results onto model
+-	structure=parseresultsfromdisk(filename,~md.settings.io_gather);
+-	if isempty(fieldnames(structure)),
+-		error(['No result found in binary file ' filename '. Check for solution crash.']);
+-	end
+-	md.results.(structure(1).SolutionType)=structure;
+-
+-	%recover solution_type from results
+-	md.private.solution=structure(1).SolutionType;
+-
+-	%read log files onto  fields
+-	if exist([md.miscellaneous.name '.errlog'],'file'),
+-		md.results.(structure(1).SolutionType)(1).errlog=char(textread([md.miscellaneous.name '.errlog'],'%s','delimiter','\n'));
+-	else
+-		md.results.(structure(1).SolutionType)(1).errlog='';
+-	end
+-
+-	if exist([md.miscellaneous.name '.outlog'],'file'),
+-		md.results.(structure(1).SolutionType)(1).outlog=char(textread([md.miscellaneous.name '.outlog'],'%s','delimiter','\n'));
+-	else
+-		md.results.(structure(1).SolutionType)(1).outlog='';
+-	end
+-
+-	if ~isempty(md.results.(structure(1).SolutionType)(1).errlog),
+-		disp(['loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields']);
+-	end
+-
+-
+-%post processes qmu results if necessary
+-else
+-
+-	if isscalar(md.private.solution),
+-		md.private.solution=EnumToString(md.private.solution);
+-	end
+-	md=postqmu(md);
+-	cd ..
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.m	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/marshall.m	(revision 13004)
+@@ -1,49 +0,0 @@
+-function marshall(md)
+-%MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
+-%
+-%   The routine creates a compatible binary file from @model md
+-%   This binary file will be used for parallel runs in JPL-package
+-%
+-%   Usage:
+-%      marshall(md)
+-
+-disp(['marshalling file ' md.miscellaneous.name '.bin']);
+-
+-%open file for binary writing
+-fid=fopen([ md.miscellaneous.name '.bin'],'wb');
+-if fid==-1,
+-	error(['marshall error message: could not open ' [md.miscellaneous.name '.bin'],' file for binary writing']);
+-end
+-
+-%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
+-WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
+-
+-%Go through all model fields: check that it is a class and call checkconsistency
+-fields=properties('model');
+-for i=1:length(fields),
+-	field=fields{i};
+-
+-	%Some properties do not need to be marshalled
+-	if ismember(field,{'results' 'radaroverlay' 'solver' 'cluster'  'flaim' 'private'}),
+-		continue;
+-	end
+-
+-	%Check that current field is an object
+-	if ~isobject(md.(field))
+-		error(['field ''' char(field) ''' is not an object']);
+-	end
+-
+-	%Marshall current object
+-	%disp(['marshalling ' field '...']);
+-	if verLessThan('matlab', '7.6')
+-		marshall(md.(field),fid);
+-	else
+-		md.(field).marshall(fid);
+-	end
+-end
+-
+-%close file
+-st=fclose(fid);
+-if st==-1,
+-	error(['marshall error message: could not close file ' [md.miscellaneous.name '.bin']]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.py	(revision 13004)
+@@ -1,36 +0,0 @@
+-from AnalysisConfiguration import *
+-
+-def ismodelselfconsistent(md):
+-	"""
+-	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+-
+-	   Usage:
+-	      ismodelselfconsistent(md),
+-	"""
+-
+-	#initialize consistency as true
+-	md.private.isconsistent=True
+-
+-	#Get solution and associated analyses
+-	solution=md.private.solution
+-	analyses,numanalyses=AnalysisConfiguration(solution)
+-
+-	#Go through a model fields, check that it is a class, and call checkconsistency
+-	fields=vars(md)
+-	for field in fields.iterkeys():
+-
+-		#Some properties do not need to be checked
+-		if field in ['results','debug','radaroverlay']:
+-			continue
+-
+-		#Check that current field is an object
+-		if not hasattr(getattr(md,field),'checkconsistency'):
+-			md.checkmessage("field '%s' is not an object." % field)
+-
+-		#Check consistency of the object
+-		exec("md.%s.checkconsistency(md,solution,analyses)" % field)
+-
+-	#error message if mode is not consistent
+-	if not md.private.isconsistent:
+-		raise RuntimeError('Model not consistent, see messages above.')
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/petscversion.py	(revision 13004)
+@@ -1,34 +0,0 @@
+-import os
+-from issmdir import *
+-from MatlabFuncs import *
+-
+-def petscversion():
+-	"""
+-	PETSCVERSION - recover petsc version number, inside config.h file
+- 
+-	   Usage:
+-	      PETSC_VERSION=petscversion();
+-	"""
+-
+-	#default
+-	PETSC_VERSION=3
+-
+-	configfile=os.path.join(issmdir(),'config.h')
+-	if not os.path.exists(configfile):
+-		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
+-
+-	#go through the file, and recover the line we want
+-	try:
+-		fid=open(configfile,'r')
+-	except IOError as e:
+-		raise IOerror("could not open file: '%s'" % configfile)
+-
+-	for tline in fid:
+-		if strncmp(tline,'#define _PETSC_MAJOR_',21):
+-			PETSC_VERSION=int(tline[22])
+-			break
+-
+-	fid.close()
+-
+-	return PETSC_VERSION
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.m	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/WriteData.m	(revision 13004)
+@@ -1,260 +0,0 @@
+-function WriteData(fid,varargin)
+-%WRITEDATA - write model field in binary file
+-%
+-%   Usage:
+-%      WriteData(fid,varargin);
+-
+-%process options
+-options=pairoptions(varargin{:});
+-
+-%Get data properties
+-if exist(options,'object');
+-	%This is a object field, construct enum and data
+-	obj       = getfieldvalue(options,'object');
+-	fieldname = getfieldvalue(options,'fieldname');
+-	classname = class(obj);
+-
+-	enum      = BuildEnum([classname '_' fieldname]);
+-	data      = obj.(fieldname);
+-else
+-	%No processing required
+-	data = getfieldvalue(options,'data');
+-	enum = getfieldvalue(options,'enum');
+-end
+-format  = getfieldvalue(options,'format');
+-mattype = getfieldvalue(options,'mattype',0);    %only required for matrices
+-
+-%Process sparse matrices
+-if issparse(data),
+-	data=full(data);
+-end
+-
+-%Step 1: write the enum to identify this record uniquely
+-fwrite(fid,enum,'int'); 
+-
+-%Step 2: write the data itself.
+-if     strcmpi(format,'Boolean'),% {{{
+-	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
+-
+-	%first write length of record
+-	fwrite(fid,4+4,'int');  %1 bool (disguised as an int)+code
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%now write integer
+-	fwrite(fid,data,'int');  %send an int, not easy to send a bool
+-	% }}}
+-elseif strcmpi(format,'Integer'), % {{{
+-	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
+-
+-	%first write length of record
+-	fwrite(fid,4+4,'int');  %1 integer + code
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%now write integer
+-	fwrite(fid,data,'int'); 
+-	% }}}
+-elseif strcmpi(format,'Double'), % {{{
+-	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
+-
+-	%first write length of record
+-	fwrite(fid,8+4,'int');  %1 double+code
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%now write double
+-	fwrite(fid,data,'double'); 
+-	% }}}
+-elseif strcmpi(format,'String'), % {{{
+-	%first write length of record
+-	fwrite(fid,length(data)+4+4,'int');  %string + string size + code
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%now write string
+-	fwrite(fid,length(data),'int'); 
+-	fwrite(fid,data,'char'); 
+-	% }}}
+-elseif strcmpi(format,'BooleanMat'), % {{{
+-
+-	%Get size
+-	s=size(data);
+-	%if matrix = NaN, then do not write anything
+-	if (s(1)==1 & s(2)==1 & isnan(data)),
+-		s(1)=0; s(2)=0;
+-	end
+-
+-	%first write length of record
+-	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
+-
+-	%write data code and matrix type: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-	fwrite(fid,mattype,'int');
+-
+-	%now write matrix
+-	fwrite(fid,s(1),'int'); 
+-	fwrite(fid,s(2),'int'); 
+-	if s(1)*s(2),
+-		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
+-	end
+-	% }}}
+-elseif strcmpi(format,'IntMat'), % {{{
+-
+-	%Get size
+-	s=size(data);
+-	%if matrix = NaN, then do not write anything
+-	if (s(1)==1 & s(2)==1 & isnan(data)),
+-		s(1)=0; s(2)=0;
+-	end
+-
+-	%first write length of record
+-	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
+-
+-	%write data code and matrix type: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-	fwrite(fid,mattype,'int');
+-
+-	%now write matrix
+-	fwrite(fid,s(1),'int'); 
+-	fwrite(fid,s(2),'int'); 
+-	if s(1)*s(2),
+-		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
+-	end
+-	% }}}
+-elseif strcmpi(format,'DoubleMat'), % {{{
+-
+-	%Get size
+-	s=size(data);
+-	%if matrix = NaN, then do not write anything
+-	if (s(1)==1 & s(2)==1 & isnan(data)),
+-		s(1)=0; s(2)=0;
+-	end
+-
+-	%first write length of record
+-	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
+-
+-	%write data code and matrix type: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-	fwrite(fid,mattype,'int');
+-
+-	%now write matrix
+-	fwrite(fid,s(1),'int'); 
+-	fwrite(fid,s(2),'int'); 
+-	if s(1)*s(2),
+-		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
+-	end
+-	% }}}
+-elseif strcmpi(format,'MatArray'), % {{{
+-
+-	numrecords=numel(data);
+-
+-	%first get length of record
+-	recordlength=4+4; %number of records + code
+-	for i=1:numrecords,
+-		matrix=data{i};
+-		s=size(matrix);
+-		recordlength=recordlength+4*2+... %row and col of matrix
+-			s(1)*s(2)*8; %matrix of doubles
+-	end
+-
+-	%write length of record
+-	fwrite(fid,recordlength,'int'); 
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%write data, first number of records
+-	fwrite(fid,numrecords,'int'); 
+-
+-	%write each matrix: 
+-	for i=1:numrecords,
+-		matrix=data{i};
+-		s=size(matrix);
+-		fwrite(fid,s(1),'int'); 
+-		fwrite(fid,s(2),'int'); 
+-		fwrite(fid,matrix','double');
+-	end
+-	% }}}
+-elseif strcmpi(format,'StringArray'), % {{{
+-
+-	%first get length of string array: 
+-	num=numel(data);
+-	%now get length of record: 
+-	recordlength=4+4; %for length of array + code
+-	for i=1:num,
+-		string=data{i};
+-		recordlength=recordlength+4+length(string); %for each string
+-	end
+-
+-	%write length of record
+-	fwrite(fid,recordlength,'int'); 
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%now write length of string array
+-	fwrite(fid,num,'int'); 
+-
+-	%now write the strings
+-	for i=1:num,
+-		string=data{i};
+-		fwrite(fid,length(string),'int'); 
+-		fwrite(fid,string,'char'); 
+-	end
+-	% }}}
+-else  % {{{
+-	error(['WriteData error message: data type: ' num2str(format) ' not supported yet! (' EnumToString(enum) ')']);
+-end % }}}
+-end
+-
+-function enum=BuildEnum(string) % {{{
+-%BUILDENUM - build enum out of string
+-%
+-%   Usage:
+-%      enum=BuildEnum(string)
+-
+-	if findstr(string,'_'),
+-		indices=findstr(string,'_');
+-		for i=1:length(indices),
+-			string(indices(i)+1)=upper(string(indices(i)+1));
+-		end
+-		string(indices)=[];
+-	end
+-
+-	%take first letter of string and make it uppercase: 
+-	string(1)=upper(string(1));
+-
+-	%Get Enum
+-	enum=eval([string 'Enum();']); 
+-end % }}}
+-function code=FormatToCode(format) % {{{
+-%This routine takes the format string, and hardcodes it into an integer, which 
+-%is passed along the record, in order to identify the nature of the dataset being 
+-%sent.
+-	if     strcmpi(format,'Boolean'),
+-		code=1;
+-	elseif strcmpi(format,'Integer'), 
+-		code=2;
+-	elseif strcmpi(format,'Double'), 
+-		code=3;
+-	elseif strcmpi(format,'String'), 
+-		code=4;
+-	elseif strcmpi(format,'BooleanMat'),
+-		code=5;
+-	elseif strcmpi(format,'IntMat'),
+-		code=6;
+-	elseif strcmpi(format,'DoubleMat'),
+-		code=7;
+-	elseif strcmpi(format,'MatArray'), 
+-		code=8;
+-	elseif strcmpi(format,'StringArray'),
+-		code=9;
+-	else 
+-		error('FormatToCode error message: data type not supported yet!');
+-	end
+-end% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmultipleresultsfromcluster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmultipleresultsfromcluster.m	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmultipleresultsfromcluster.m	(revision 13004)
+@@ -1,34 +0,0 @@
+-function md_list=loadmultipleresultsfromcluster(md_list)
+-%LOADMULTIPLERESULTSFROMCLUSTER - load multiple results of solution sequences from cluster
+-%
+-%   Usage:
+-%      md_list=loadresultsfromcluster(md_list);
+-
+-nummodels=length(md_list);
+-
+-%Get cluster settings
+-cluster=md_list{1}.cluster;
+-name=md_list{1}.name;
+-cluster_rc_location=which('cluster.rc');
+-[codepath,executionpath,login]=ClusterParameters(cluster,cluster_rc_location);
+-
+-%Remote tar: 
+-disp('tarring results');
+-issmssh(cluster,['"cd ' executionpath ' && rm -rf file_list.txt ModelResults.tar.gz && find -iname ''*_*vs*.outbin'' > file_list.txt && tar zcvf ModelResults.tar.gz --files-from file_list.txt  && rm -rf file_list.txt "']);
+-
+-%copy results from cluster to present directory
+-scpin(cluster, executionpath, {'ModelResults.tar.gz'});
+-
+-%untar:
+-!tar -zxvf ModelResults.tar.gz
+-
+-%ok, go through list and load results from disk: 
+-for i=1:nummodels,
+-	%load  results for this model
+-	md_list{i}=loadresultsfromdisk(md_list{i},[md_list{i}.name '.outbin']);
+-
+-	delete([name '.outbin']);
+-end
+-
+-%erase files 
+-delete('ModelResults.tar.gz');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.m	(revision 13003)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ismodelselfconsistent.m	(revision 13004)
+@@ -1,40 +0,0 @@
+-function ismodelselfconsistent(md),
+-%ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+-%
+-%   Usage:
+-%      ismodelselfconsistent(md),
+-
+-%initialize consistency as true
+-md.private.isconsistent=true;
+-
+-%Get solution and associated analyses
+-solution=md.private.solution;
+-[analyses,numanalyses]=AnalysisConfiguration(solution);
+-
+-%Go through a model field, check that it is a class, and call checkconsistency
+-fields=properties('model');
+-for i=1:length(fields),
+-	field=fields{i};
+-
+-	%Some properties do not need to be checked
+-	if ismember(field,{'results' 'debug' 'radaroverlay'}),
+-		continue;
+-	end
+-
+-	%Check that current field is an object
+-	if ~isobject(md.(field))
+-		md=checkmessage(md,['field ''' char(field) ''' is not an object']);
+-	end
+-
+-	%Check consistency of the object
+-	if verLessThan('matlab', '7.6')
+-		md=checkconsistency(md.(field),md,solution,analyses);
+-	else
+-		md=md.(field).checkconsistency(md,solution,analyses);
+-	end
+-end
+-
+-%error message if mode is not consistent
+-if md.private.isconsistent==false,
+-	error('Model not consistent, see messages above');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.m	(revision 13004)
+@@ -0,0 +1,260 @@
++function WriteData(fid,varargin)
++%WRITEDATA - write model field in binary file
++%
++%   Usage:
++%      WriteData(fid,varargin);
++
++%process options
++options=pairoptions(varargin{:});
++
++%Get data properties
++if exist(options,'object');
++	%This is a object field, construct enum and data
++	obj       = getfieldvalue(options,'object');
++	fieldname = getfieldvalue(options,'fieldname');
++	classname = class(obj);
++
++	enum      = BuildEnum([classname '_' fieldname]);
++	data      = obj.(fieldname);
++else
++	%No processing required
++	data = getfieldvalue(options,'data');
++	enum = getfieldvalue(options,'enum');
++end
++format  = getfieldvalue(options,'format');
++mattype = getfieldvalue(options,'mattype',0);    %only required for matrices
++
++%Process sparse matrices
++if issparse(data),
++	data=full(data);
++end
++
++%Step 1: write the enum to identify this record uniquely
++fwrite(fid,enum,'int'); 
++
++%Step 2: write the data itself.
++if     strcmpi(format,'Boolean'),% {{{
++	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
++
++	%first write length of record
++	fwrite(fid,4+4,'int');  %1 bool (disguised as an int)+code
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%now write integer
++	fwrite(fid,data,'int');  %send an int, not easy to send a bool
++	% }}}
++elseif strcmpi(format,'Integer'), % {{{
++	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
++
++	%first write length of record
++	fwrite(fid,4+4,'int');  %1 integer + code
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%now write integer
++	fwrite(fid,data,'int'); 
++	% }}}
++elseif strcmpi(format,'Double'), % {{{
++	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
++
++	%first write length of record
++	fwrite(fid,8+4,'int');  %1 double+code
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%now write double
++	fwrite(fid,data,'double'); 
++	% }}}
++elseif strcmpi(format,'String'), % {{{
++	%first write length of record
++	fwrite(fid,length(data)+4+4,'int');  %string + string size + code
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%now write string
++	fwrite(fid,length(data),'int'); 
++	fwrite(fid,data,'char'); 
++	% }}}
++elseif strcmpi(format,'BooleanMat'), % {{{
++
++	%Get size
++	s=size(data);
++	%if matrix = NaN, then do not write anything
++	if (s(1)==1 & s(2)==1 & isnan(data)),
++		s(1)=0; s(2)=0;
++	end
++
++	%first write length of record
++	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
++
++	%write data code and matrix type: 
++	fwrite(fid,FormatToCode(format),'int'); 
++	fwrite(fid,mattype,'int');
++
++	%now write matrix
++	fwrite(fid,s(1),'int'); 
++	fwrite(fid,s(2),'int'); 
++	if s(1)*s(2),
++		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
++	end
++	% }}}
++elseif strcmpi(format,'IntMat'), % {{{
++
++	%Get size
++	s=size(data);
++	%if matrix = NaN, then do not write anything
++	if (s(1)==1 & s(2)==1 & isnan(data)),
++		s(1)=0; s(2)=0;
++	end
++
++	%first write length of record
++	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
++
++	%write data code and matrix type: 
++	fwrite(fid,FormatToCode(format),'int'); 
++	fwrite(fid,mattype,'int');
++
++	%now write matrix
++	fwrite(fid,s(1),'int'); 
++	fwrite(fid,s(2),'int'); 
++	if s(1)*s(2),
++		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
++	end
++	% }}}
++elseif strcmpi(format,'DoubleMat'), % {{{
++
++	%Get size
++	s=size(data);
++	%if matrix = NaN, then do not write anything
++	if (s(1)==1 & s(2)==1 & isnan(data)),
++		s(1)=0; s(2)=0;
++	end
++
++	%first write length of record
++	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
++
++	%write data code and matrix type: 
++	fwrite(fid,FormatToCode(format),'int'); 
++	fwrite(fid,mattype,'int');
++
++	%now write matrix
++	fwrite(fid,s(1),'int'); 
++	fwrite(fid,s(2),'int'); 
++	if s(1)*s(2),
++		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
++	end
++	% }}}
++elseif strcmpi(format,'MatArray'), % {{{
++
++	numrecords=numel(data);
++
++	%first get length of record
++	recordlength=4+4; %number of records + code
++	for i=1:numrecords,
++		matrix=data{i};
++		s=size(matrix);
++		recordlength=recordlength+4*2+... %row and col of matrix
++			s(1)*s(2)*8; %matrix of doubles
++	end
++
++	%write length of record
++	fwrite(fid,recordlength,'int'); 
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%write data, first number of records
++	fwrite(fid,numrecords,'int'); 
++
++	%write each matrix: 
++	for i=1:numrecords,
++		matrix=data{i};
++		s=size(matrix);
++		fwrite(fid,s(1),'int'); 
++		fwrite(fid,s(2),'int'); 
++		fwrite(fid,matrix','double');
++	end
++	% }}}
++elseif strcmpi(format,'StringArray'), % {{{
++
++	%first get length of string array: 
++	num=numel(data);
++	%now get length of record: 
++	recordlength=4+4; %for length of array + code
++	for i=1:num,
++		string=data{i};
++		recordlength=recordlength+4+length(string); %for each string
++	end
++
++	%write length of record
++	fwrite(fid,recordlength,'int'); 
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%now write length of string array
++	fwrite(fid,num,'int'); 
++
++	%now write the strings
++	for i=1:num,
++		string=data{i};
++		fwrite(fid,length(string),'int'); 
++		fwrite(fid,string,'char'); 
++	end
++	% }}}
++else  % {{{
++	error(['WriteData error message: data type: ' num2str(format) ' not supported yet! (' EnumToString(enum) ')']);
++end % }}}
++end
++
++function enum=BuildEnum(string) % {{{
++%BUILDENUM - build enum out of string
++%
++%   Usage:
++%      enum=BuildEnum(string)
++
++	if findstr(string,'_'),
++		indices=findstr(string,'_');
++		for i=1:length(indices),
++			string(indices(i)+1)=upper(string(indices(i)+1));
++		end
++		string(indices)=[];
++	end
++
++	%take first letter of string and make it uppercase: 
++	string(1)=upper(string(1));
++
++	%Get Enum
++	enum=eval([string 'Enum();']); 
++end % }}}
++function code=FormatToCode(format) % {{{
++%This routine takes the format string, and hardcodes it into an integer, which 
++%is passed along the record, in order to identify the nature of the dataset being 
++%sent.
++	if     strcmpi(format,'Boolean'),
++		code=1;
++	elseif strcmpi(format,'Integer'), 
++		code=2;
++	elseif strcmpi(format,'Double'), 
++		code=3;
++	elseif strcmpi(format,'String'), 
++		code=4;
++	elseif strcmpi(format,'BooleanMat'),
++		code=5;
++	elseif strcmpi(format,'IntMat'),
++		code=6;
++	elseif strcmpi(format,'DoubleMat'),
++		code=7;
++	elseif strcmpi(format,'MatArray'), 
++		code=8;
++	elseif strcmpi(format,'StringArray'),
++		code=9;
++	else 
++		error('FormatToCode error message: data type not supported yet!');
++	end
++end% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.py	(revision 13004)
+@@ -0,0 +1,119 @@
++import datetime
++import os
++import shutil
++from pairoptions import *
++from process_solve_options import *
++from EnumDefinitions import *
++from ismodelselfconsistent import *
++
++def solve(md,solutionenum,*args):
++	"""
++	SOLVE - apply solution sequence for this model
++ 
++	   Usage:
++	      md=solve(md,solutionenum,varargin)
++	      where varargin is a list of paired arguments of string OR enums
++ 
++	   solution types available comprise:
++	      - DiagnosticSolutionEnum
++	      - PrognosticSolutionEnum
++	      - ThermalSolutionEnum
++	      - SteadystateSolutionEnum
++	      - TransientSolutionEnum...
++	      - BalancethicknessSolutionEnum
++	      - BedSlopeSolutionEnum
++	      - SurfaceSlopeSolutionEnum
++	      - HydrologySolutionEnum
++	      - FlaimSolutionEnum
++ 
++	   extra options:
++	      - loadonly : does not solve. only load results
++ 
++	   Examples:
++	      md=solve(md,DiagnosticSolutionEnum);
++	"""
++
++	#recover and process solve options
++	options=pairoptions('solution_type',solutionenum,*args)
++	options=process_solve_options(options)
++
++	#recover some fields
++	md.private.solution=options['solution_type']
++	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)
++
++	#First, build a runtime name that is unique
++	c=datetime.datetime.now()
++	md.private.runtimename="%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name,c.month,c.day,c.year,c.hour,c.minute,c.second,os.getpid())
++
++	#if running qmu analysis, some preprocessing of dakota files using models
++	#fields needs to be carried out. 
++	if md.qmu.isdakota:
++		md=preqmu(md,options)
++
++	#flaim analysis
++	if options['solution_type'] == FlaimSolutionEnum:
++		md=flaim_sol(md,options)
++		md.private.solution=EnumToString(options['solution_type'])
++		return md
++
++	#Do we load results only?
++	if options['loadonly']:  
++		md=loadresultsfromcluster(md)
++		return md
++
++	#Wite all input files
++	marshall(md)                                           # bin file
++	md.solver.PetscFile(md.miscellaneous.name+'.petsc')    # petsc file
++	cluster.BuildQueueScript(md.miscellaneous.name,md.private.runtimename,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
++
++	#we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
++	if not ispetsc:
++		print "PETSC support not included, running on 1 cpu only!"
++		cluster.np=1
++
++	#Stop here if batch mode
++	if strcmpi(options['batch'],'yes'):
++		print 'batch mode requested: not launching job interactively'
++		print 'launch solution sequence on remote cluster by hand'
++		return md
++
++	#Launch job
++	modelname = md.miscellaneous.name
++	filelist  = [modelname+'.bin ',modelname+'.petsc ',modelname+'.queue ']
++	if md.qmu.isdakota:
++		filelist.append(modelname+'.qmu.in')
++	cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist)
++
++	#did we even try to run? if so, wait on lock
++	if strcmpi(options['upload'],'on'):
++		print 'solve done uploading test decks'
++		return md
++
++	#wait on lock
++	if md.settings.waitonlock>0:
++		#we wait for the done file
++		islock=waitonlock(md)
++		if islock==0:    #no results to be loaded
++			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
++		else:            #load results
++			print 'loading results from cluster'
++			md=loadresultsfromcluster(md)
++
++	#post processes qmu results if necessary
++	if md.qmu.isdakota:
++		if not strncmpi(options['keep'],'y',1):
++			shutil.rmtree('qmu'+str(os.getpid()))
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.m	(revision 13004)
+@@ -0,0 +1,60 @@
++function md=loadresultsfromcluster(md,runtimename)
++%LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
++%
++%   Usage:
++%      md=loadresultsfromcluster(md,runtimename);
++
++%retrieve cluster, to be able to call its methods
++cluster=md.cluster;
++
++if nargin==2,
++	md.private.runtimename=runtimename;
++end
++
++%Download outputs from the cluster
++filelist={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
++if md.qmu.isdakota,
++	filelist{end+1}=[md.miscellaneous.name '.qmu.err'];
++	filelist{end+1}=[md.miscellaneous.name '.qmu.out'];
++	if isfield(md.qmu.params,'tabular_graphics_data'),
++		if md.qmu.params.tabular_graphics_data==true,
++			filelist{end+1}='dakota_tabular.dat';
++		end
++	end
++else
++	filelist{end+1}=[md.miscellaneous.name '.outbin'];
++end
++Download(cluster,md.private.runtimename,filelist);
++
++%If we are here, no errors in the solution sequence, call loadresultsfromdisk.
++md=loadresultsfromdisk(md,[md.miscellaneous.name '.outbin']);
++
++%erase the log and output files
++if md.qmu.isdakota,
++	delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.outlog']);
++	delete([['qmu' num2str(feature('GetPid')) '/']  md.miscellaneous.name '.errlog']);
++else
++	delete([md.miscellaneous.name '.outlog']);
++	delete([md.miscellaneous.name '.errlog']);
++	delete([md.miscellaneous.name '.outbin']);
++	if ~ispc,
++		delete([md.private.runtimename '.tar.gz']);
++	end
++end
++
++%erase input file if run was carried out on same platform.
++hostname=oshostname();
++if strcmpi(hostname,cluster.name),
++	if md.qmu.isdakota,
++		delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.bin']);
++		delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.queue']);
++	else
++		delete([md.miscellaneous.name '.bin']);
++		delete([md.miscellaneous.name '.petsc']);
++		if ~ispc,
++			delete([md.miscellaneous.name '.queue']);
++		else
++			delete([md.miscellaneous.name '.bat']);
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.m	(revision 13004)
+@@ -0,0 +1,121 @@
++function md=solve(md,solutionenum,varargin)
++%SOLVE - apply solution sequence for this model
++%
++%   Usage:
++%      md=solve(md,solutionenum,varargin)
++%      where varargin is a lit of paired arguments of string OR enums
++%
++%   solution types available comprise:
++%		 - DiagnosticSolutionEnum
++%		 - PrognosticSolutionEnum
++%		 - ThermalSolutionEnum
++%		 - SteadystateSolutionEnum
++%		 - TransientSolutionEnum...
++%		 - BalancethicknessSolutionEnum
++%		 - BedSlopeSolutionEnum
++%		 - SurfaceSlopeSolutionEnum
++%		 - HydrologySolutionEnum
++%		 - FlaimSolutionEnum
++%
++%  extra options:
++%      - loadonly : does not solve. only load results
++%
++%   Examples:
++%      md=solve(md,DiagnosticSolutionEnum);
++
++%recover and process solve options
++options=pairoptions(varargin{:},'solution_type',solutionenum);
++options=process_solve_options(options);
++
++%recover some fields
++md.private.solution=options.solution_type;
++cluster=md.cluster;
++
++%check model consistency
++disp('checking model consistency');
++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
++
++%First, build a runtime name that is unique
++c=clock;
++md.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',md.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
++
++%if running qmu analysis, some preprocessing of dakota files using models
++%fields needs to be carried out. 
++if md.qmu.isdakota,
++	md=preqmu(md,options);
++end
++
++%flaim analysis
++if (options.solution_type == FlaimSolutionEnum)
++	md=flaim_sol(md,options);
++	md.private.solution=EnumToString(options.solution_type);
++	return;
++end
++
++%Do we load results only?
++if options.loadonly,  
++	md=loadresultsfromcluster(md);
++	return;
++end
++
++%we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
++if ~ispetsc,
++	disp('PETSC support not included, running on 1 cpu only!');
++	cluster.np=1;
++end
++
++
++%Wite all input files
++marshall(md);                                          % bin file
++PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file
++BuildQueueScript(cluster,md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); % queue file
++
++
++%Stop here if batch mode
++if strcmpi(options.batch,'yes')
++	disp('batch mode requested: not launching job interactively');
++	disp('launch solution sequence on remote cluster by hand');
++	return;
++end
++
++%Launch job
++modelname = md.miscellaneous.name;
++filelist  = {[modelname '.bin '] [modelname '.petsc '] [modelname '.queue ']};
++if md.qmu.isdakota,
++	filelist{end+1} = [modelname '.qmu.in'];
++end
++LaunchQueueJob(cluster,md.miscellaneous.name,md.private.runtimename,filelist);
++
++%did we even try to run? if so, wait on lock
++if strcmpi(options.upload,'on'),
++	disp('solve done uploading test decks');
++	return;
++end
++
++%wait on lock
++if md.settings.waitonlock>0,
++	%we wait for the done file
++	islock=waitonlock(md);
++	if islock==0, %no results to be loaded
++		disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
++	else          %load results
++		disp('loading results from cluster');
++		md=loadresultsfromcluster(md);
++	end
++end
++
++%post processes qmu results if necessary
++if md.qmu.isdakota,
++	if ~strncmpi(options.keep,'y',1)
++		system(['rm -rf qmu' num2str(feature('GetPid'))]);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.py	(revision 13004)
+@@ -0,0 +1,36 @@
++from AnalysisConfiguration import *
++
++def ismodelselfconsistent(md):
++	"""
++	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
++
++	   Usage:
++	      ismodelselfconsistent(md),
++	"""
++
++	#initialize consistency as true
++	md.private.isconsistent=True
++
++	#Get solution and associated analyses
++	solution=md.private.solution
++	analyses,numanalyses=AnalysisConfiguration(solution)
++
++	#Go through a model fields, check that it is a class, and call checkconsistency
++	fields=vars(md)
++	for field in fields.iterkeys():
++
++		#Some properties do not need to be checked
++		if field in ['results','debug','radaroverlay']:
++			continue
++
++		#Check that current field is an object
++		if not hasattr(getattr(md,field),'checkconsistency'):
++			md.checkmessage("field '%s' is not an object." % field)
++
++		#Check consistency of the object
++		exec("md.%s.checkconsistency(md,solution,analyses)" % field)
++
++	#error message if mode is not consistent
++	if not md.private.isconsistent:
++		raise RuntimeError('Model not consistent, see messages above.')
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.py	(revision 13004)
+@@ -0,0 +1,60 @@
++import os
++
++def loadresultsfromdisk(md,filename):
++	"""
++	LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
++ 
++	   Usage:
++	      md=loadresultsfromdisk(md=False,filename=False);
++	"""
++
++	#check number of inputs/outputs
++	if not md or not filename:
++		raise ValueError("loadresultsfromdisk: error message.")
++
++	if not md.qmu.isdakota:
++
++		#Check that file exists
++		if not os.path.exists(filename):
++			raise ValueError("binary file '%s' not found." % filename)
++
++		#initialize md.results if not a structure yet
++		if not isinstance(md.results,dict):
++			md.results={}
++
++		#load results onto model
++		structure=parseresultsfromdisk(filename,~md.settings.io_gather)
++		if not len(structure):
++			raise RuntimeError("No result found in binary file '%s'. Check for solution crash." % filename)
++		end
++		md.results[structure[1]['SolutionType']]=structure;
++
++		#recover solution_type from results
++		md.private.solution=structure[1]['SolutionType']
++
++		#read log files onto fields
++		if os.path.exists(md.miscellaneous.name+'.errlog'):
++			with open(md.miscellaneous.name+'.errlog','r') as f:
++				md.results[structure[1]['SolutionType']]['errlog']=[line[:-1] for line in f]
++		else:
++			md.results[structure[1]['SolutionType']]['errlog']=[]
++
++		if os.path.exists(md.miscellaneous.name+'.outlog'):
++			with open(md.miscellaneous.name+'.outlog','r') as f:
++				md.results[structure[1]['SolutionType']]['outlog']=[line[:-1] for line in f]
++		else:
++			md.results[structure[1]['SolutionType']]['outlog']=[]
++
++		if len(md.results[structure[1]['SolutionType']]['errlog']):
++			print ("loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields.")
++
++	#post processes qmu results if necessary
++	else:
++
++		if not isinstance(md.private.solution,str):
++			md.private.solution=EnumToString(md.private.solution)
++		md=postqmu(md)
++		os.chdir('..')
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.py	(revision 13004)
+@@ -0,0 +1,48 @@
++import os
++from EnumDefinitions import *
++
++def process_solve_options(options):
++	"""
++	DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
++ 
++	   Usage:
++	      options=process_solve_options(options)
++ 
++	   See also: SOLVE
++	"""
++
++	outoptions={}
++
++	#solution_type: check on this option, error out otherwise
++	solution_type=options.getfieldvalue('solution_type')
++	if not solution_type in (DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,\
++			SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,\
++			BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum):
++		raise ValueError("process_solve_options error message: solution_type '%s' not supported yet!" % EnumToString(solution_type))
++	outoptions['solution_type']=solution_type
++
++	outoptions['upload']=options.getfieldvalue('upload','off')
++	outoptions['batch']=options.getfieldvalue('batch','no')
++	outoptions['loadonly']=options.getfieldvalue('loadonly',False)
++	outoptions['directory']=options.getfieldvalue('directory','')
++
++	#  process qmu arguments
++	outoptions['qmudir']=options.getfieldvalue('qmudir','qmu'+str(os.getpid()))
++	outoptions['qmufile']=options.getfieldvalue('qmufile','qmu')    # qmufile cannot be changed unless ????script.sh is also changed
++	outoptions['overwrite']=options.getfieldvalue('overwrite','n')
++	outoptions['keep']=options.getfieldvalue('keep','n')
++	outoptions['ivar']=options.getfieldvalue('ivar',1)
++	outoptions['iresp']=options.getfieldvalue('iresp',1)
++	outoptions['imethod']=options.getfieldvalue('imethod',1)
++	outoptions['iparams']=options.getfieldvalue('iparams',1)
++	outoptions['runmpi']=options.getfieldvalue('runmpi',False)
++
++	#  process flaim arguments
++	outoptions['fmdir']=options.getfieldvalue('fmdir','fm'+str(os.getpid()))
++	outoptions['overwrite']=options.getfieldvalue('overwrite','n')
++	outoptions['keep']=options.getfieldvalue('keep','y')
++	outoptions['latsgn']=options.getfieldvalue('latsgn',0)
++	outoptions['cmap']=options.getfieldvalue('cmap',[])
++
++	return outoptions
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.py	(revision 13004)
+@@ -0,0 +1,47 @@
++from WriteData import *
++
++def marshall(md):
++	"""
++	MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
++
++	   The routine creates a compatible binary file from @model md
++	   This binary file will be used for parallel runs in JPL-package
++
++	   Usage:
++	      marshall(md)
++	"""
++
++	print "marshalling file '%s.bin'." % md.miscellaneous.name
++
++	#open file for binary writing
++	try:
++		fid=open(md.miscellaneous.name+'.bin','wb')
++	except IOError as e:
++		raise IOError("marshall error message: could not open '%s.bin' file for binary writing." % md.miscellaneous.name)
++
++	#First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
++	WriteData(fid,'enum',MaximumNumberOfEnums(),'data',True,'format','Boolean')
++
++	#Go through all model fields: check that it is a class and call checkconsistency
++	fields=vars(md)
++
++	for field in fields.iterkeys():
++
++		#Some properties do not need to be marshalled
++		if field in ['results','radaroverlay','solver','cluster','flaim','private']:
++			continue
++
++		#Check that current field is an object
++		if not hasattr(getattr(md,field),'marshall'):
++			raise TypeError("field '%s' is not an object." % field)
++
++		#Marshall current object
++		#print "marshalling %s ..." % field
++		exec("md.%s.marshall(fid)" % field)
++
++	#close file
++	try:
++		f.close(fid)
++	except IOError as e:
++		raise IOError("marshall error message: could not close file '%s.bin'." % md.miscellaneous.name)
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.py	(revision 13004)
+@@ -0,0 +1,274 @@
++import numpy
++import math
++import struct
++from MatlabFuncs import *
++
++def WriteData(fid,*args):
++	"""
++	WRITEDATA - write model field in binary file
++ 
++	   Usage:
++	      WriteData(fid,varargin)
++	"""
++
++	#process options
++	options=pairoptions(*args)
++
++	#Get data properties
++	if options.exist('object'):
++		#This is an object field, construct enum and data
++		obj       = options.getfieldvalue('object')
++		fieldname = options.getfieldvalue('fieldname')
++		classname = type(obj)
++
++		enum      = BuildEnum(classname+'_'+fieldname)
++		data      = getattr(obj,fieldname)
++	else:
++		#No processing required
++		data = options.getfieldvalue('data')
++		enum = options.getfieldvalue('enum')
++	format  = options.getfieldvalue('format')
++	mattype = options.getfieldvalue('mattype',0)    #only required for matrices
++
++	#Process sparse matrices
++#	if issparse(data),
++#		data=full(data);
++#	end
++
++	#Step 1: write the enum to identify this record uniquely
++	fid.write(struct.pack('i',enum)) 
++
++	#Step 2: write the data itself.
++	if   strcmpi(format,'Boolean'):    # {{{
++		if len(data) !=1:
++			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
++
++		#first write length of record
++		fid.write(struct.pack('i',4+4))  #1 bool (disguised as an int)+code
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#now write integer
++		fid.write(struct.pack('i',data))  #send an int, not easy to send a bool
++		# }}}
++
++	elif strcmpi(format,'Integer'):    # {{{
++		if len(data) !=1:
++			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
++
++		#first write length of record
++		fid.write(struct.pack('i',4+4))  #1 integer + code
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#now write integer
++		fid.write(struct.pack('i',data)) 
++		# }}}
++
++	elif strcmpi(format,'Double'):    # {{{
++		if len(data) !=1:
++			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
++
++		#first write length of record
++		fid.write(struct.pack('i',8+4))  #1 double+code
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#now write double
++		fid.write(struct.pack('d',data)) 
++		# }}}
++
++	elif strcmpi(format,'String'):    # {{{
++		#first write length of record
++		fid.write(struct.pack('i',len(data)+4+4))  #string + string size + code
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#now write string
++		fid.write(struct.pack('i',len(data))) 
++		fid.write(struct.pack('%ds' % len(data),data)) 
++		# }}}
++
++	elif strcmpi(format,'BooleanMat'):    # {{{
++
++		#Get size
++		s=data.shape
++		#if matrix = NaN, then do not write anything
++		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
++			s[0]=0
++			s[1]=0
++
++		#first write length of record
++		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
++
++		#write data code and matrix type: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++		fid.write(struct.pack('i',mattype))
++
++		#now write matrix
++		fid.write(struct.pack('i',s[0])) 
++		fid.write(struct.pack('i',s[1])) 
++		for i in xrange(s[0]):
++			for j in xrange(s[1]):
++				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
++		# }}}
++
++	elif strcmpi(format,'IntMat'):    # {{{
++
++		#Get size
++		s=data.shape
++		#if matrix = NaN, then do not write anything
++		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
++			s[0]=0
++			s[1]=0
++
++		#first write length of record
++		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
++
++		#write data code and matrix type: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++		fid.write(struct.pack('i',mattype))
++
++		#now write matrix
++		fid.write(struct.pack('i',s[0])) 
++		fid.write(struct.pack('i',s[1])) 
++		for i in xrange(s[0]):
++			for j in xrange(s[1]):
++				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
++		# }}}
++
++	elif strcmpi(format,'DoubleMat'):    # {{{
++
++		#Get size
++		s=data.shape
++		#if matrix = NaN, then do not write anything
++		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
++			s[0]=0
++			s[1]=0
++
++		#first write length of record
++		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
++
++		#write data code and matrix type: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++		fid.write(struct.pack('i',mattype))
++
++		#now write matrix
++		fid.write(struct.pack('i',s[0])) 
++		fid.write(struct.pack('i',s[1])) 
++		for i in xrange(s[0]):
++			for j in xrange(s[1]):
++				fid.write(struct.pack('d',data[i][j]))    #get to the "c" convention, hence the transpose
++		# }}}
++
++	elif strcmpi(format,'MatArray'):    # {{{
++
++		#first get length of record
++		recordlength=4+4    #number of records + code
++		for matrix in data:
++			s=matrix.shape
++			recordlength+=4*2+s[0]*s[1]*8    #row and col of matrix + matrix of doubles
++
++		#write length of record
++		fid.write(struct.pack('i',recordlength)) 
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#write data, first number of records
++		fid.write(struct.pack('i',len(data))) 
++
++		#write each matrix: 
++		for matrix in data:
++			s=matrix.shape
++			fid.write(struct.pack('i',s[0])) 
++			fid.write(struct.pack('i',s[1])) 
++			for i in xrange(s[0]):
++				for j in xrange(s[1]):
++					fid.write(struct.pack('d',matrix[i][j]))
++		# }}}
++
++	elif strcmpi(format,'StringArray'):    # {{{
++
++		#first get length of record
++		recordlength=4+4    #for length of array + code
++		for string in data:
++			recordlength+=4+len(string)    #for each string
++
++		#write length of record
++		fid.write(struct.pack('i',recordlength)) 
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#now write length of string array
++		fid.write(struct.pack('i',len(data))) 
++
++		#now write the strings
++		for string in data:
++			fid.write(struct.pack('i',len(string))) 
++			fid.write(struct.pack('%ds' % len(string),string)) 
++		# }}}
++
++	else:    # {{{
++		raise TypeError('WriteData error message: data type: %d not supported yet! (%s)' % (format,EnumToString(enum)))
++	# }}}
++
++def BuildEnum(string): # {{{
++	"""
++	BUILDENUM - build enum out of string
++ 
++    Usage:
++       enum=BuildEnum(string)
++	"""
++
++	if '_' in string:
++		substrs=string.split('_')
++		string=''
++		for str in substrs:
++			string+=str[0].upper()+str[1:]
++	else:
++		#take first letter of string and make it uppercase: 
++		string=str[0].upper()+str[1:]
++
++	#Get Enum
++	exec('enum='+string+'Enum()',globals())
++
++	return enum
++# }}}
++
++def FormatToCode(format): # {{{
++	"""
++	This routine takes the format string, and hardcodes it into an integer, which 
++	is passed along the record, in order to identify the nature of the dataset being 
++	sent.
++	"""
++
++	if   strcmpi(format,'Boolean'):
++		code=1
++	elif strcmpi(format,'Integer'):
++		code=2
++	elif strcmpi(format,'Double'):
++		code=3
++	elif strcmpi(format,'String'):
++		code=4
++	elif strcmpi(format,'BooleanMat'):
++		code=5
++	elif strcmpi(format,'IntMat'):
++		code=6
++	elif strcmpi(format,'DoubleMat'):
++		code=7
++	elif strcmpi(format,'MatArray'):
++		code=8
++	elif strcmpi(format,'StringArray'):
++		code=9
++	else:
++		raise InputError('FormatToCode error message: data type not supported yet!')
++
++	return code
++# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.m	(revision 13004)
+@@ -0,0 +1,40 @@
++function ismodelselfconsistent(md),
++%ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
++%
++%   Usage:
++%      ismodelselfconsistent(md),
++
++%initialize consistency as true
++md.private.isconsistent=true;
++
++%Get solution and associated analyses
++solution=md.private.solution;
++[analyses,numanalyses]=AnalysisConfiguration(solution);
++
++%Go through a model field, check that it is a class, and call checkconsistency
++fields=properties('model');
++for i=1:length(fields),
++	field=fields{i};
++
++	%Some properties do not need to be checked
++	if ismember(field,{'results' 'debug' 'radaroverlay'}),
++		continue;
++	end
++
++	%Check that current field is an object
++	if ~isobject(md.(field))
++		md=checkmessage(md,['field ''' char(field) ''' is not an object']);
++	end
++
++	%Check consistency of the object
++	if verLessThan('matlab', '7.6')
++		md=checkconsistency(md.(field),md,solution,analyses);
++	else
++		md=md.(field).checkconsistency(md,solution,analyses);
++	end
++end
++
++%error message if mode is not consistent
++if md.private.isconsistent==false,
++	error('Model not consistent, see messages above');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.m	(revision 13004)
+@@ -0,0 +1,61 @@
++function md=loadresultsfromdisk(md,filename)
++%LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
++%
++%   Usage:
++%      md=loadresultsfromdisk(md,filename);
++
++%check number of inputs/outputs
++if ((nargin~=2) | (nargout~=1)),
++	help loadresultsfromdisk;
++	error('loadresultsfromdisk: error message.');
++end
++
++if ~md.qmu.isdakota,
++
++	%Check that file exists
++	if ~exist(filename,'file'),
++		error(['binary file ' filename ' not found.']);
++	end
++
++	%initialize md.results if not a structure yet
++	if ~isstruct(md.results),
++		md.results=struct();
++	end
++
++	%load results onto model
++	structure=parseresultsfromdisk(filename,~md.settings.io_gather);
++	if isempty(fieldnames(structure)),
++		error(['No result found in binary file ' filename '. Check for solution crash.']);
++	end
++	md.results.(structure(1).SolutionType)=structure;
++
++	%recover solution_type from results
++	md.private.solution=structure(1).SolutionType;
++
++	%read log files onto  fields
++	if exist([md.miscellaneous.name '.errlog'],'file'),
++		md.results.(structure(1).SolutionType)(1).errlog=char(textread([md.miscellaneous.name '.errlog'],'%s','delimiter','\n'));
++	else
++		md.results.(structure(1).SolutionType)(1).errlog='';
++	end
++
++	if exist([md.miscellaneous.name '.outlog'],'file'),
++		md.results.(structure(1).SolutionType)(1).outlog=char(textread([md.miscellaneous.name '.outlog'],'%s','delimiter','\n'));
++	else
++		md.results.(structure(1).SolutionType)(1).outlog='';
++	end
++
++	if ~isempty(md.results.(structure(1).SolutionType)(1).errlog),
++		disp(['loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields']);
++	end
++
++
++%post processes qmu results if necessary
++else
++
++	if isscalar(md.private.solution),
++		md.private.solution=EnumToString(md.private.solution);
++	end
++	md=postqmu(md);
++	cd ..
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.m	(revision 13004)
+@@ -0,0 +1,39 @@
++function outoptions=process_solve_options(options)
++%DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
++%
++%   Usage:
++%      options=process_solve_options(options)
++%
++%   See also: SOLVE
++
++%solution_type: check on this option, error out otherwise
++solution_type=getfieldvalue(options,'solution_type');
++if ~ismember(solution_type,[DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,...
++		SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,...
++		BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum]),
++	error(['process_solve_options error message: solution_type ' EnumToString(solution_type) ' not supported yet!']);
++end
++outoptions.solution_type=solution_type;
++
++outoptions.upload=getfieldvalue(options,'upload','off');
++outoptions.batch=getfieldvalue(options,'batch','no');
++outoptions.loadonly=getfieldvalue(options,'loadonly',false);
++outoptions.directory=getfieldvalue(options,'directory','');
++
++%  process qmu arguments
++outoptions.qmudir=getfieldvalue(options,'qmudir',['qmu' num2str(feature('GetPid'))]);  % qmudir =['qmu_' datestr(now,'yyyymmdd_HHMMSS')];
++outoptions.qmufile=getfieldvalue(options,'qmufile','qmu');% qmufile cannot be changed unless ????script.sh is also changed
++outoptions.overwrite=getfieldvalue(options,'overwrite','n');
++outoptions.keep=getfieldvalue(options,'keep','n');
++outoptions.ivar=getfieldvalue(options,'ivar',1);
++outoptions.iresp=getfieldvalue(options,'iresp',1);
++outoptions.imethod=getfieldvalue(options,'imethod',1);
++outoptions.iparams=getfieldvalue(options,'iparams',1);
++outoptions.runmpi=getfieldvalue(options,'runmpi',false);
++
++%  process flaim arguments
++outoptions.fmdir=getfieldvalue(options,'fmdir',['fm' num2str(feature('GetPid'))]);
++outoptions.overwrite=getfieldvalue(options,'overwrite','n');
++outoptions.keep=getfieldvalue(options,'keep','y');
++outoptions.latsgn=getfieldvalue(options,'latsgn',0);
++outoptions.cmap=getfieldvalue(options,'cmap',[]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadmultipleresultsfromcluster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadmultipleresultsfromcluster.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadmultipleresultsfromcluster.m	(revision 13004)
+@@ -0,0 +1,34 @@
++function md_list=loadmultipleresultsfromcluster(md_list)
++%LOADMULTIPLERESULTSFROMCLUSTER - load multiple results of solution sequences from cluster
++%
++%   Usage:
++%      md_list=loadresultsfromcluster(md_list);
++
++nummodels=length(md_list);
++
++%Get cluster settings
++cluster=md_list{1}.cluster;
++name=md_list{1}.name;
++cluster_rc_location=which('cluster.rc');
++[codepath,executionpath,login]=ClusterParameters(cluster,cluster_rc_location);
++
++%Remote tar: 
++disp('tarring results');
++issmssh(cluster,['"cd ' executionpath ' && rm -rf file_list.txt ModelResults.tar.gz && find -iname ''*_*vs*.outbin'' > file_list.txt && tar zcvf ModelResults.tar.gz --files-from file_list.txt  && rm -rf file_list.txt "']);
++
++%copy results from cluster to present directory
++scpin(cluster, executionpath, {'ModelResults.tar.gz'});
++
++%untar:
++!tar -zxvf ModelResults.tar.gz
++
++%ok, go through list and load results from disk: 
++for i=1:nummodels,
++	%load  results for this model
++	md_list{i}=loadresultsfromdisk(md_list{i},[md_list{i}.name '.outbin']);
++
++	delete([name '.outbin']);
++end
++
++%erase files 
++delete('ModelResults.tar.gz');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.py	(revision 13004)
+@@ -0,0 +1,61 @@
++import os
++import platform
++import socket
++from MatlabFuncs import *
++
++def loadresultsfromcluster(md,runtimename=False):
++	"""
++	LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
++ 
++	   Usage:
++	      md=loadresultsfromcluster(md,runtimename);
++	"""
++
++	#retrieve cluster, to be able to call its methods
++	cluster=md.cluster
++
++	if runtimename:
++		md.private.runtimename=runtimename
++	end
++
++	#Download outputs from the cluster
++	filelist=[md.miscellaneous.name+'.outlog',md.miscellaneous.name+'.errlog']
++	if md.qmu.isdakota:
++		filelist.append(md.miscellaneous.name+'.qmu.err')
++		filelist.append(md.miscellaneous.name+'.qmu.out')
++		if 'tabular_graphics_data' in md.qmu.params:
++			if md.qmu.params['tabular_graphics_data']:
++				filelist.append('dakota_tabular.dat')
++		filelist.append(md.miscellaneous.name+'.outbin')
++	Download(cluster,md.private.runtimename,filelist)
++
++	#If we are here, no errors in the solution sequence, call loadresultsfromdisk.
++	md=loadresultsfromdisk(md,md.miscellaneous.name+'.outbin')
++
++	#erase the log and output files
++	if md.qmu.isdakota:
++		os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.outlog'))
++		os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.errlog'))
++	else:
++		os.remove(md.miscellaneous.name+'.outlog')
++		os.remove(md.miscellaneous.name+'.errlog')
++		os.remove(md.miscellaneous.name+'.outbin')
++		if not 'Windows' in platform.system():
++			os.remove(md.private.runtimename+'.tar.gz')
++
++	#erase input file if run was carried out on same platform.
++	hostname=socket.gethostname().lower().split('.')[0]
++	if strcmpi(hostname,cluster.name):
++		if md.qmu.isdakota:
++			os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.bin'))
++			os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.queue'))
++		else:
++			os.remove(md.miscellaneous.name+'.bin')
++			os.remove(md.miscellaneous.name+'.petsc')
++			if not 'Windows' in platform.system():
++				os.remove(md.miscellaneous.name+'.queue')
++			else:
++				os.remove(md.miscellaneous.name+'.bat')
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.m	(revision 13004)
+@@ -0,0 +1,49 @@
++function marshall(md)
++%MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
++%
++%   The routine creates a compatible binary file from @model md
++%   This binary file will be used for parallel runs in JPL-package
++%
++%   Usage:
++%      marshall(md)
++
++disp(['marshalling file ' md.miscellaneous.name '.bin']);
++
++%open file for binary writing
++fid=fopen([ md.miscellaneous.name '.bin'],'wb');
++if fid==-1,
++	error(['marshall error message: could not open ' [md.miscellaneous.name '.bin'],' file for binary writing']);
++end
++
++%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
++WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
++
++%Go through all model fields: check that it is a class and call checkconsistency
++fields=properties('model');
++for i=1:length(fields),
++	field=fields{i};
++
++	%Some properties do not need to be marshalled
++	if ismember(field,{'results' 'radaroverlay' 'solver' 'cluster'  'flaim' 'private'}),
++		continue;
++	end
++
++	%Check that current field is an object
++	if ~isobject(md.(field))
++		error(['field ''' char(field) ''' is not an object']);
++	end
++
++	%Marshall current object
++	%disp(['marshalling ' field '...']);
++	if verLessThan('matlab', '7.6')
++		marshall(md.(field),fid);
++	else
++		md.(field).marshall(fid);
++	end
++end
++
++%close file
++st=fclose(fid);
++if st==-1,
++	error(['marshall error message: could not close file ' [md.miscellaneous.name '.bin']]);
++end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13004-13005.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13004-13005.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13004-13005.diff	(revision 13394)
@@ -0,0 +1,2553 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13005)
+@@ -90,6 +90,669 @@
+ 			 md.private.isconsistent=false;
+ 		 end
+ 		 %}}}
++		 function md = collapse(md)% {{{
++			 %COLLAPSE - collapses a 3d mesh into a 2d mesh
++			 %
++			 %   This routine collapses a 3d model into a 2d model
++			 %   and collapses all the fileds of the 3d model by
++			 %   taking their depth-averaged values
++			 %
++			 %   Usage:
++			 %      md=collapse(md)
++			 %
++			 %   See also: EXTRUDE, MODELEXTRACT
++
++			 %Check that the model is really a 3d model
++			 if ~md.mesh.dimension==3,
++				 error('collapse error message: only 3d mesh can be collapsed')
++			 end
++
++			 %Start with changing alle the fields from the 3d mesh 
++
++			 %drag is limited to nodes that are on the bedrock.
++			 md.friction.coefficient=project2d(md,md.friction.coefficient,1);
++
++			 %p and q (same deal, except for element that are on the bedrock: )
++			 md.friction.p=project2d(md,md.friction.p,1);
++			 md.friction.q=project2d(md,md.friction.q,1);
++
++			 %observations
++			 if ~isnan(md.inversion.vx_obs), md.inversion.vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers); end;
++			 if ~isnan(md.inversion.vy_obs), md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers); end;
++			 if ~isnan(md.inversion.vel_obs), md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers); end;
++			 if ~isnan(md.inversion.cost_functions_coefficients), md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers); end;
++			 if numel(md.inversion.min_parameters)>1, md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers); end;
++			 if numel(md.inversion.max_parameters)>1, md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers); end;
++			 if ~isnan(md.surfaceforcings.mass_balance),
++				 md.surfaceforcings.mass_balance=project2d(md,md.surfaceforcings.mass_balance,md.mesh.numberoflayers); 
++			 end;
++			 if ~isnan(md.balancethickness.thickening_rate), md.balancethickness.thickening_rate=project2d(md,md.balancethickness.thickening_rate,md.mesh.numberoflayers); end;
++
++			 %results
++			 if ~isnan(md.initialization.vx),md.initialization.vx=DepthAverage(md,md.initialization.vx);end;
++			 if ~isnan(md.initialization.vy),md.initialization.vy=DepthAverage(md,md.initialization.vy);end;
++			 if ~isnan(md.initialization.vz),md.initialization.vz=DepthAverage(md,md.initialization.vz);end;
++			 if ~isnan(md.initialization.vel),md.initialization.vel=DepthAverage(md,md.initialization.vel);end;
++			 if ~isnan(md.initialization.temperature),md.initialization.temperature=DepthAverage(md,md.initialization.temperature);end;
++
++			 %bedinfo and surface info
++			 md.mesh.elementonbed=ones(md.mesh.numberofelements2d,1);
++			 md.mesh.elementonsurface=ones(md.mesh.numberofelements2d,1);
++			 md.mesh.vertexonbed=ones(md.mesh.numberofvertices2d,1);
++			 md.mesh.vertexonsurface=ones(md.mesh.numberofvertices2d,1);
++
++			 %elementstype
++			 if ~isnan(md.flowequation.element_equation)
++				 md.flowequation.element_equation=project2d(md,md.flowequation.element_equation,1);
++				 md.flowequation.vertex_equation=project2d(md,md.flowequation.vertex_equation,1);
++				 md.flowequation.bordermacayeal=project2d(md,md.flowequation.bordermacayeal,1);
++				 md.flowequation.borderpattyn=project2d(md,md.flowequation.borderpattyn,1);
++				 md.flowequation.borderstokes=project2d(md,md.flowequation.borderstokes,1);
++			 end	
++
++			 %boundary conditions
++			 md.diagnostic.spcvx=project2d(md,md.diagnostic.spcvx,md.mesh.numberoflayers);
++			 md.diagnostic.spcvy=project2d(md,md.diagnostic.spcvy,md.mesh.numberoflayers);
++			 md.diagnostic.spcvz=project2d(md,md.diagnostic.spcvz,md.mesh.numberoflayers);
++			 md.diagnostic.referential=project2d(md,md.diagnostic.referential,md.mesh.numberoflayers);
++			 md.prognostic.spcthickness=project2d(md,md.prognostic.spcthickness,md.mesh.numberoflayers);
++			 md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers);
++
++			 %Extrusion of Neumann BC
++			 if ~isnan(md.diagnostic.icefront),
++				 numberofneumann2d=size(md.diagnostic.icefront,1)/(md.mesh.numberoflayers-1);
++				 md.diagnostic.icefront=[md.diagnostic.icefront(1:numberofneumann2d,1:2) md.diagnostic.icefront(1:numberofneumann2d,5:6)]; %Add two columns on the first layer 
++			 end
++
++			 %materials
++			 md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
++			 md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
++
++			 %special for thermal modeling:
++			 md.basalforcings.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
++			 md.mesh.average_vertex_connectivity=25;
++
++			 %Collapse the mesh
++			 nodes2d=md.mesh.numberofvertices2d;
++			 elements2d=md.mesh.numberofelements2d;
++
++			 %parameters
++			 md.geometry.surface=project2d(md,md.geometry.surface,1);
++			 md.geometry.thickness=project2d(md,md.geometry.thickness,1);
++			 md.geometry.bed=project2d(md,md.geometry.bed,1);
++			 md.geometry.bathymetry=project2d(md,md.geometry.bathymetry,1);
++			 md.mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
++			 md.mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1);
++			 md.mask.elementonfloatingice=project2d(md,md.mask.elementonfloatingice,1);
++			 md.mask.vertexonfloatingice=project2d(md,md.mask.vertexonfloatingice,1);
++			 md.mask.elementongroundedice=project2d(md,md.mask.elementongroundedice,1);
++			 md.mask.vertexongroundedice=project2d(md,md.mask.vertexongroundedice,1);
++			 md.mask.elementonwater=project2d(md,md.mask.elementonwater,1);
++			 md.mask.vertexonwater=project2d(md,md.mask.vertexonwater,1);
++
++			 %lat long
++			 if numel(md.mesh.lat) ==md.mesh.numberofvertices,  md.mesh.lat=project2d(md,md.mesh.lat,1); end
++			 if numel(md.mesh.long)==md.mesh.numberofvertices, md.mesh.long=project2d(md,md.mesh.long,1); end
++
++			 %Initialize with the 2d mesh
++			 md.mesh.x=md.mesh.x2d;
++			 md.mesh.y=md.mesh.y2d;
++			 md.mesh.z=zeros(size(md.mesh.x2d));
++			 md.mesh.numberofvertices=md.mesh.numberofvertices2d;
++			 md.mesh.numberofelements=md.mesh.numberofelements2d;
++			 md.mesh.elements=md.mesh.elements2d;
++
++			 %Keep a trace of lower and upper nodes
++			 md.mesh.lowervertex=NaN;
++			 md.mesh.uppervertex=NaN;
++			 md.mesh.lowerelements=NaN;
++			 md.mesh.upperelements=NaN;
++
++			 %Remove old mesh 
++			 md.mesh.x2d=NaN;
++			 md.mesh.y2d=NaN;
++			 md.mesh.elements2d=NaN;
++			 md.mesh.numberofelements2d=md.mesh.numberofelements;
++			 md.mesh.numberofvertices2d=md.mesh.numberofvertices;
++			 md.mesh.numberoflayers=0;
++
++			 %Update mesh type
++			 md.mesh.dimension=2;
++		 end % }}}
++		 function md2 = extract(md,area) % {{{
++			 %extract - extract a model according to an Argus contour or flag list
++			 %
++			 %   This routine extracts a submodel from a bigger model with respect to a given contour
++			 %   md must be followed by the corresponding exp file or flags list
++			 %   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
++			 %   If user wants every element outside the domain to be 
++			 %   extract2d, add '~' to the name of the domain file (ex: '~Pattyn.exp');
++			 %   an empty string '' will be considered as an empty domain
++			 %   a string 'all' will be considered as the entire domain
++			 %   add an argument 0 if you do not want the elements to be checked (faster)
++			 %
++			 %   Usage:
++			 %      md2=extract(md,area);
++			 %
++			 %   Examples:
++			 %      md2=extract(md,'Domain.exp');
++			 %      md2=extract(md,md.mask.elementonfloatingice);
++			 %
++			 %   See also: EXTRUDE, COLLAPSE
++
++			 %copy model
++			 md1=md;
++
++			 %some checks
++			 if ((nargin~=2) | (nargout~=1)),
++				 help extract
++				 error('extract error message: bad usage');
++			 end
++
++			 %get check option
++			 if (nargin==3 & varargin{1}==0),
++				 checkoutline=0;
++			 else
++				 checkoutline=1;
++			 end
++
++			 %get elements that are inside area
++			 flag_elem=FlagElements(md1,area);
++			 if ~any(flag_elem),
++				 error('extracted model is empty');
++			 end
++
++			 %kick out all elements with 3 dirichlets
++			 spc_elem=find(~flag_elem);
++			 spc_node=sort(unique(md1.mesh.elements(spc_elem,:)));
++			 flag=ones(md1.mesh.numberofvertices,1);
++			 flag(spc_node)=0;
++			 pos=find(sum(flag(md1.mesh.elements),2)==0);
++			 flag_elem(pos)=0;
++
++			 %extracted elements and nodes lists
++			 pos_elem=find(flag_elem);
++			 pos_node=sort(unique(md1.mesh.elements(pos_elem,:)));
++
++			 %keep track of some fields
++			 numberofvertices1=md1.mesh.numberofvertices;
++			 numberofelements1=md1.mesh.numberofelements;
++			 numberofvertices2=length(pos_node);
++			 numberofelements2=length(pos_elem);
++			 flag_node=zeros(numberofvertices1,1);
++			 flag_node(pos_node)=1;
++
++			 %Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
++			 Pelem=zeros(numberofelements1,1);
++			 Pelem(pos_elem)=[1:numberofelements2]';
++			 Pnode=zeros(numberofvertices1,1);
++			 Pnode(pos_node)=[1:numberofvertices2]';
++
++			 %renumber the elements (some node won't exist anymore)
++			 elements_1=md1.mesh.elements;
++			 elements_2=elements_1(pos_elem,:);
++			 elements_2(:,1)=Pnode(elements_2(:,1));
++			 elements_2(:,2)=Pnode(elements_2(:,2));
++			 elements_2(:,3)=Pnode(elements_2(:,3));
++			 if md1.mesh.dimension==3,
++				 elements_2(:,4)=Pnode(elements_2(:,4));
++				 elements_2(:,5)=Pnode(elements_2(:,5));
++				 elements_2(:,6)=Pnode(elements_2(:,6));
++			 end
++
++			 %OK, now create the new model !
++
++			 %take every fields from model
++			 md2=md1;
++
++			 %automatically modify fields
++
++			 %loop over model fields
++			 model_fields=fields(md1);
++			 for i=1:length(model_fields),
++				 %get field
++				 field=md1.(model_fields{i});
++				 fieldsize=size(field);
++				 if isobject(field), %recursive call
++					 object_fields=fields(md1.(model_fields{i}));
++					 for j=1:length(object_fields),
++						 %get field
++						 field=md1.(model_fields{i}).(object_fields{j});
++						 fieldsize=size(field);
++						 %size = number of nodes * n
++						 if fieldsize(1)==numberofvertices1
++							 md2.(model_fields{i}).(object_fields{j})=field(pos_node,:);
++						 elseif (fieldsize(1)==numberofvertices1+1)
++							 md2.(model_fields{i}).(object_fields{j})=[field(pos_node,:); field(end,:)];
++							 %size = number of elements * n
++						 elseif fieldsize(1)==numberofelements1
++							 md2.(model_fields{i}).(object_fields{j})=field(pos_elem,:);
++						 end
++					 end
++				 else
++					 %size = number of nodes * n
++					 if fieldsize(1)==numberofvertices1
++						 md2.(model_fields{i})=field(pos_node,:);
++					 elseif (fieldsize(1)==numberofvertices1+1)
++						 md2.(model_fields{i})=[field(pos_node,:); field(end,:)];
++						 %size = number of elements * n
++					 elseif fieldsize(1)==numberofelements1
++						 md2.(model_fields{i})=field(pos_elem,:);
++					 end
++				 end
++			 end
++
++			 %modify some specific fields
++
++			 %Mesh
++			 md2.mesh.numberofelements=numberofelements2;
++			 md2.mesh.numberofvertices=numberofvertices2;
++			 md2.mesh.elements=elements_2;
++
++			 %mesh.uppervertex mesh.lowervertex
++			 if md1.mesh.dimension==3
++				 md2.mesh.uppervertex=md1.mesh.uppervertex(pos_node);
++				 pos=find(~isnan(md2.mesh.uppervertex));
++				 md2.mesh.uppervertex(pos)=Pnode(md2.mesh.uppervertex(pos));
++
++				 md2.mesh.lowervertex=md1.mesh.lowervertex(pos_node);
++				 pos=find(~isnan(md2.mesh.lowervertex));
++				 md2.mesh.lowervertex(pos)=Pnode(md2.mesh.lowervertex(pos));
++
++				 md2.mesh.upperelements=md1.mesh.upperelements(pos_elem);
++				 pos=find(~isnan(md2.mesh.upperelements));
++				 md2.mesh.upperelements(pos)=Pelem(md2.mesh.upperelements(pos));
++
++				 md2.mesh.lowerelements=md1.mesh.lowerelements(pos_elem);
++				 pos=find(~isnan(md2.mesh.lowerelements));
++				 md2.mesh.lowerelements(pos)=Pelem(md2.mesh.lowerelements(pos));
++			 end
++
++			 %Initial 2d mesh 
++			 if md1.mesh.dimension==3
++				 flag_elem_2d=flag_elem(1:md1.mesh.numberofelements2d);
++				 pos_elem_2d=find(flag_elem_2d);
++				 flag_node_2d=flag_node(1:md1.mesh.numberofvertices2d);
++				 pos_node_2d=find(flag_node_2d);
++
++				 md2.mesh.numberofelements2d=length(pos_elem_2d);
++				 md2.mesh.numberofvertices2d=length(pos_node_2d);
++				 md2.mesh.elements2d=md1.mesh.elements2d(pos_elem_2d,:);
++				 md2.mesh.elements2d(:,1)=Pnode(md2.mesh.elements2d(:,1));
++				 md2.mesh.elements2d(:,2)=Pnode(md2.mesh.elements2d(:,2));
++				 md2.mesh.elements2d(:,3)=Pnode(md2.mesh.elements2d(:,3));
++
++				 md2.mesh.x2d=md1.mesh.x(pos_node_2d);
++				 md2.mesh.y2d=md1.mesh.y(pos_node_2d);
++			 end
++
++			 %Edges
++			 if size(md2.mesh.edges,2)>1, %do not use ~isnan because there are some NaNs...
++				 %renumber first two columns
++				 pos=find(md2.mesh.edges(:,4)~=-1);
++				 md2.mesh.edges(:  ,1)=Pnode(md2.mesh.edges(:,1)); 
++				 md2.mesh.edges(:  ,2)=Pnode(md2.mesh.edges(:,2)); 
++				 md2.mesh.edges(:  ,3)=Pelem(md2.mesh.edges(:,3));
++				 md2.mesh.edges(pos,4)=Pelem(md2.mesh.edges(pos,4));
++				 %remove edges when the 2 vertices are not in the domain.
++				 md2.mesh.edges=md2.mesh.edges(find(md2.mesh.edges(:,1) & md2.mesh.edges(:,2)),:);
++				 %Replace all zeros by -1 in the last two columns;
++				 pos=find(md2.mesh.edges(:,3)==0);
++				 md2.mesh.edges(pos,3)=-1;
++				 pos=find(md2.mesh.edges(:,4)==0);
++				 md2.mesh.edges(pos,4)=-1;
++				 %Invert -1 on the third column with last column (Also invert first two columns!!)
++				 pos=find(md2.mesh.edges(:,3)==-1);
++				 md2.mesh.edges(pos,3)=md2.mesh.edges(pos,4);
++				 md2.mesh.edges(pos,4)=-1;
++				 values=md2.mesh.edges(pos,2);
++				 md2.mesh.edges(pos,2)=md2.mesh.edges(pos,1);
++				 md2.mesh.edges(pos,1)=values;
++				 %Finally remove edges that do not belong to any element
++				 pos=find(md2.mesh.edges(:,3)==-1 & md2.mesh.edges(:,4)==-1);
++				 md2.mesh.edges(pos,:)=[];
++			 end
++
++			 %Penalties
++			 if ~isnan(md2.diagnostic.vertex_pairing),
++				 for i=1:size(md1.diagnostic.vertex_pairing,1);
++					 md2.diagnostic.vertex_pairing(i,:)=Pnode(md1.diagnostic.vertex_pairing(i,:));
++				 end
++				 md2.diagnostic.vertex_pairing=md2.diagnostic.vertex_pairing(find(md2.diagnostic.vertex_pairing(:,1)),:);
++			 end
++			 if ~isnan(md2.prognostic.vertex_pairing),
++				 for i=1:size(md1.prognostic.vertex_pairing,1);
++					 md2.prognostic.vertex_pairing(i,:)=Pnode(md1.prognostic.vertex_pairing(i,:));
++				 end
++				 md2.prognostic.vertex_pairing=md2.prognostic.vertex_pairing(find(md2.prognostic.vertex_pairing(:,1)),:);
++			 end
++
++			 %recreate segments
++			 if md1.mesh.dimension==2
++				 md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices);
++				 md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity);
++				 md2.mesh.segments=contourenvelope(md2);
++				 md2.mesh.vertexonboundary=zeros(numberofvertices2,1); md2.mesh.vertexonboundary(md2.mesh.segments(:,1:2))=1;
++			 else
++				 %First do the connectivity for the contourenvelope in 2d
++				 md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements2d,md2.mesh.numberofvertices2d);
++				 md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements2d,md2.mesh.vertexconnectivity);
++				 md2.mesh.segments=contourenvelope(md2);
++				 md2.mesh.vertexonboundary=zeros(numberofvertices2/md2.mesh.numberoflayers,1); md2.mesh.vertexonboundary(md2.mesh.segments(:,1:2))=1;
++				 md2.mesh.vertexonboundary=repmat(md2.mesh.vertexonboundary,md2.mesh.numberoflayers,1);
++				 %Then do it for 3d as usual
++				 md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices);
++				 md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity);
++			 end
++
++			 %Boundary conditions: Dirichlets on new boundary
++			 %Catch the elements that have not been extracted
++			 orphans_elem=find(~flag_elem);
++			 orphans_node=unique(md1.mesh.elements(orphans_elem,:))';
++			 %Figure out which node are on the boundary between md2 and md1
++			 nodestoflag1=intersect(orphans_node,pos_node);
++			 nodestoflag2=Pnode(nodestoflag1);
++			 if numel(md1.diagnostic.spcvx)>1 & numel(md1.diagnostic.spcvy)>2 & numel(md1.diagnostic.spcvz)>2,
++				 if numel(md1.inversion.vx_obs)>1 & numel(md1.inversion.vy_obs)>1
++					 md2.diagnostic.spcvx(nodestoflag2)=md2.inversion.vx_obs(nodestoflag2); 
++					 md2.diagnostic.spcvy(nodestoflag2)=md2.inversion.vy_obs(nodestoflag2);
++				 else
++					 md2.diagnostic.spcvx(nodestoflag2)=NaN;
++					 md2.diagnostic.spcvy(nodestoflag2)=NaN;
++					 disp(' ')
++					 disp('!! extract warning: spc values should be checked !!')
++					 disp(' ')
++				 end
++				 %put 0 for vz
++				 md2.diagnostic.spcvz(nodestoflag2)=0;
++			 end
++			 if ~isnan(md1.thermal.spctemperature),
++				 md2.thermal.spctemperature(nodestoflag2,1)=1;
++			 end
++
++			 %Diagnostic
++			 if ~isnan(md2.diagnostic.icefront)
++				 md2.diagnostic.icefront(:,1)=Pnode(md1.diagnostic.icefront(:,1)); 
++				 md2.diagnostic.icefront(:,2)=Pnode(md1.diagnostic.icefront(:,2)); 
++				 md2.diagnostic.icefront(:,end-1)=Pelem(md1.diagnostic.icefront(:,end-1));
++				 if md1.mesh.dimension==3
++					 md2.diagnostic.icefront(:,3)=Pnode(md1.diagnostic.icefront(:,3)); 
++					 md2.diagnostic.icefront(:,4)=Pnode(md1.diagnostic.icefront(:,4)); 
++				 end
++				 md2.diagnostic.icefront=md2.diagnostic.icefront(find(md2.diagnostic.icefront(:,1) & md2.diagnostic.icefront(:,2) & md2.diagnostic.icefront(:,end)),:);
++			 end
++
++			 %Results fields
++			 if isstruct(md1.results),
++				 md2.results=struct();
++				 solutionfields=fields(md1.results);
++				 for i=1:length(solutionfields),
++					 %get subfields
++					 solutionsubfields=fields(md1.results.(solutionfields{i}));
++					 for j=1:length(solutionsubfields),
++						 field=md1.results.(solutionfields{i}).(solutionsubfields{j});
++						 if length(field)==numberofvertices1,
++							 md2.results.(solutionfields{i}).(solutionsubfields{j})=field(pos_node);
++						 elseif length(field)==numberofelements1,
++							 md2.results.(solutionfields{i}).(solutionsubfields{j})=field(pos_elem);
++						 else
++							 md2.results.(solutionfields{i}).(solutionsubfields{j})=field;
++						 end
++					 end
++				 end
++			 end
++
++			 %Keep track of pos_node and pos_elem
++			 md2.mesh.extractedvertices=pos_node;
++			 md2.mesh.extractedelements=pos_elem;
++		 end % }}}
++		 function md = extrude(md,varargin) % {{{
++			 %EXTRUDE - vertically extrude a 2d mesh
++			 %
++			 %   vertically extrude a 2d mesh and create corresponding 3d mesh.
++			 %   The vertical distribution can:
++			 %    - follow a polynomial law
++			 %    - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
++			 %    - be discribed by a list of coefficients (between 0 and 1)
++			 %   
++			 %
++			 %   Usage:
++			 %      md=extrude(md,numlayers,extrusionexponent);
++			 %      md=extrude(md,numlayers,lowerexponent,upperexponent);
++			 %      md=extrude(md,listofcoefficients);
++			 %
++			 %   Example:
++			 %      md=extrude(md,8,3);
++			 %      md=extrude(md,8,3,2);
++			 %      md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1]);
++			 %
++			 %   See also: MODELEXTRACT, COLLAPSE
++
++			 %some checks on list of arguments
++			 if ((nargin>4) | (nargin<2) | (nargout~=1)),
++				 help extrude;
++				 error('extrude error message');
++			 end
++
++			 %Extrude the mesh
++			 if nargin==2, %list of coefficients
++				 list=varargin{1};
++				 if any(list<0) | any(list>1),
++					 error('extrusioncoefficients must be between 0 and 1');
++				 end
++				 extrusionlist=sort(unique([list(:);0;1]));
++				 numlayers=length(extrusionlist);
++			 elseif nargin==3, %one polynomial law
++				 if varargin{2}<=0,
++					 help extrude;
++					 error('extrusionexponent must be >=0');
++				 end
++				 numlayers=varargin{1};
++				 extrusionlist=((0:1:numlayers-1)/(numlayers-1)).^varargin{2};
++			 elseif nargin==4, %two polynomial laws
++				 numlayers=varargin{1};
++				 lowerexp=varargin{2};
++				 upperexp=varargin{3};
++
++				 if varargin{2}<=0 | varargin{3}<=0,
++					 help extrude;
++					 error('lower and upper extrusionexponents must be >=0');
++				 end
++
++				 lowerextrusionlist=[(0:2/(numlayers-1):1).^lowerexp]/2;
++				 upperextrusionlist=[(0:2/(numlayers-1):1).^upperexp]/2;
++				 extrusionlist=sort(unique([lowerextrusionlist 1-upperextrusionlist]));
++
++			 end
++
++			 if numlayers<2,
++				 error('number of layers should be at least 2');
++			 end
++			 if md.mesh.dimension==3,
++				 error('Cannot extrude a 3d mesh (extrude cannot be called more than once)');
++			 end
++
++			 %Initialize with the 2d mesh
++			 x3d=[]; 
++			 y3d=[];
++			 z3d=[];  %the lower node is on the bed
++			 thickness3d=md.geometry.thickness; %thickness and bed for these nodes
++			 bed3d=md.geometry.bed;
++
++			 %Create the new layers
++			 for i=1:numlayers,
++				 x3d=[x3d; md.mesh.x]; 
++				 y3d=[y3d; md.mesh.y];
++				 %nodes are distributed between bed and surface accordingly to the given exponent
++				 z3d=[z3d; bed3d+thickness3d*extrusionlist(i)]; 
++			 end
++			 number_nodes3d=size(x3d,1); %number of 3d nodes for the non extruded part of the mesh
++
++			 %Extrude elements 
++			 elements3d=[];
++			 for i=1:numlayers-1,
++				 elements3d=[elements3d;[md.mesh.elements+(i-1)*md.mesh.numberofvertices md.mesh.elements+i*md.mesh.numberofvertices]]; %Create the elements of the 3d mesh for the non extruded part
++			 end
++			 number_el3d=size(elements3d,1); %number of 3d nodes for the non extruded part of the mesh
++
++			 %Keep a trace of lower and upper nodes
++			 mesh.lowervertex=NaN*ones(number_nodes3d,1);
++			 mesh.uppervertex=NaN*ones(number_nodes3d,1);
++			 mesh.lowervertex(md.mesh.numberofvertices+1:end)=1:(numlayers-1)*md.mesh.numberofvertices;
++			 mesh.uppervertex(1:(numlayers-1)*md.mesh.numberofvertices)=md.mesh.numberofvertices+1:number_nodes3d;
++			 md.mesh.lowervertex=mesh.lowervertex;
++			 md.mesh.uppervertex=mesh.uppervertex;
++
++			 %same for lower and upper elements
++			 mesh.lowerelements=NaN*ones(number_el3d,1);
++			 mesh.upperelements=NaN*ones(number_el3d,1);
++			 mesh.lowerelements(md.mesh.numberofelements+1:end)=1:(numlayers-2)*md.mesh.numberofelements;
++			 mesh.upperelements(1:(numlayers-2)*md.mesh.numberofelements)=md.mesh.numberofelements+1:(numlayers-1)*md.mesh.numberofelements;
++			 md.mesh.lowerelements=mesh.lowerelements;
++			 md.mesh.upperelements=mesh.upperelements;
++
++			 %Save old mesh 
++			 md.mesh.x2d=md.mesh.x;
++			 md.mesh.y2d=md.mesh.y;
++			 md.mesh.elements2d=md.mesh.elements;
++			 md.mesh.numberofelements2d=md.mesh.numberofelements;
++			 md.mesh.numberofvertices2d=md.mesh.numberofvertices;
++
++			 %Update mesh type
++			 md.mesh.dimension=3;
++
++			 %Build global 3d mesh 
++			 md.mesh.elements=elements3d;
++			 md.mesh.x=x3d;
++			 md.mesh.y=y3d;
++			 md.mesh.z=z3d;
++			 md.mesh.numberofelements=number_el3d;
++			 md.mesh.numberofvertices=number_nodes3d;
++			 md.mesh.numberoflayers=numlayers;
++
++			 %Ok, now deal with the other fields from the 2d mesh:
++
++			 %lat long
++			 md.mesh.lat=project3d(md,'vector',md.mesh.lat,'type','node');
++			 md.mesh.long=project3d(md,'vector',md.mesh.long,'type','node');
++
++			 %drag coefficient is limited to nodes that are on the bedrock.
++			 md.friction.coefficient=project3d(md,'vector',md.friction.coefficient,'type','node','layer',1);
++
++			 %p and q (same deal, except for element that are on the bedrock: )
++			 md.friction.p=project3d(md,'vector',md.friction.p,'type','element');
++			 md.friction.q=project3d(md,'vector',md.friction.q,'type','element');
++
++			 %observations
++			 md.inversion.vx_obs=project3d(md,'vector',md.inversion.vx_obs,'type','node');
++			 md.inversion.vy_obs=project3d(md,'vector',md.inversion.vy_obs,'type','node');
++			 md.inversion.vel_obs=project3d(md,'vector',md.inversion.vel_obs,'type','node');
++			 md.surfaceforcings.mass_balance=project3d(md,'vector',md.surfaceforcings.mass_balance,'type','node');
++			 md.surfaceforcings.precipitation=project3d(md,'vector',md.surfaceforcings.precipitation,'type','node');
++			 md.balancethickness.thickening_rate=project3d(md,'vector',md.balancethickness.thickening_rate,'type','node');
++			 md.surfaceforcings.monthlytemperatures=project3d(md,'vector',md.surfaceforcings.monthlytemperatures,'type','node');
++
++			 %results
++			 if ~isnan(md.initialization.vx),md.initialization.vx=project3d(md,'vector',md.initialization.vx,'type','node');end;
++			 if ~isnan(md.initialization.vy),md.initialization.vy=project3d(md,'vector',md.initialization.vy,'type','node');end;
++			 if ~isnan(md.initialization.vz),md.initialization.vz=project3d(md,'vector',md.initialization.vz,'type','node');end;
++			 if ~isnan(md.initialization.vel),md.initialization.vel=project3d(md,'vector',md.initialization.vel,'type','node');end;
++			 if ~isnan(md.initialization.temperature),md.initialization.temperature=project3d(md,'vector',md.initialization.temperature,'type','node');end;
++			 if ~isnan(md.initialization.waterfraction),md.initialization.waterfraction=project3d(md,'vector',md.initialization.waterfraction,'type','node');end;
++
++			 %bedinfo and surface info
++			 md.mesh.elementonbed=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.vertexonbed=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);
++
++			 %elementstype
++			 if ~isnan(md.flowequation.element_equation)
++				 oldelements_type=md.flowequation.element_equation;
++				 md.flowequation.element_equation=zeros(number_el3d,1);
++				 md.flowequation.element_equation=project3d(md,'vector',oldelements_type,'type','element');
++			 end
++
++			 %verticestype
++			 if ~isnan(md.flowequation.vertex_equation)
++				 oldvertices_type=md.flowequation.vertex_equation;
++				 md.flowequation.vertex_equation=zeros(number_nodes3d,1);
++				 md.flowequation.vertex_equation=project3d(md,'vector',oldvertices_type,'type','node');
++			 end
++			 md.flowequation.bordermacayeal=project3d(md,'vector',md.flowequation.bordermacayeal,'type','node');
++			 md.flowequation.borderpattyn=project3d(md,'vector',md.flowequation.borderpattyn,'type','node');
++			 md.flowequation.borderstokes=project3d(md,'vector',md.flowequation.borderstokes,'type','node');
++
++			 %boundary conditions
++			 md.diagnostic.spcvx=project3d(md,'vector',md.diagnostic.spcvx,'type','node');
++			 md.diagnostic.spcvy=project3d(md,'vector',md.diagnostic.spcvy,'type','node');
++			 md.diagnostic.spcvz=project3d(md,'vector',md.diagnostic.spcvz,'type','node');
++			 md.thermal.spctemperature=project3d(md,'vector',md.thermal.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',NaN);
++			 md.prognostic.spcthickness=project3d(md,'vector',md.prognostic.spcthickness,'type','node');
++			 md.balancethickness.spcthickness=project3d(md,'vector',md.balancethickness.spcthickness,'type','node');
++			 md.diagnostic.referential=project3d(md,'vector',md.diagnostic.referential,'type','node');
++
++			 %in 3d, pressureload: [node1 node2 node3 node4 element]
++			 pressureload_layer1=[md.diagnostic.icefront(:,1:2)  md.diagnostic.icefront(:,2)+md.mesh.numberofvertices2d  md.diagnostic.icefront(:,1)+md.mesh.numberofvertices2d  md.diagnostic.icefront(:,3:4)]; %Add two columns on the first layer 
++			 pressureload=[];
++			 for i=1:numlayers-1,
++				 pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d pressureload_layer1(:,6)];
++			 end
++			 md.diagnostic.icefront=pressureload;
++
++			 %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;
++			 end
++			 md.mesh.elementconnectivity(find(isnan(md.mesh.elementconnectivity)))=0;
++
++			 %materials
++			 md.materials.rheology_B=project3d(md,'vector',md.materials.rheology_B,'type','node');
++			 md.materials.rheology_n=project3d(md,'vector',md.materials.rheology_n,'type','element');
++
++			 %parameters
++			 md.geometry.surface=project3d(md,'vector',md.geometry.surface,'type','node');
++			 md.geometry.thickness=project3d(md,'vector',md.geometry.thickness,'type','node');
++			 md.geometry.hydrostatic_ratio=project3d(md,'vector',md.geometry.hydrostatic_ratio,'type','node');
++			 md.geometry.bed=project3d(md,'vector',md.geometry.bed,'type','node');
++			 md.geometry.bathymetry=project3d(md,'vector',md.geometry.bathymetry,'type','node');
++			 md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node');
++			 md.mask.elementonfloatingice=project3d(md,'vector',md.mask.elementonfloatingice,'type','element');
++			 md.mask.vertexonfloatingice=project3d(md,'vector',md.mask.vertexonfloatingice,'type','node');
++			 md.mask.elementongroundedice=project3d(md,'vector',md.mask.elementongroundedice,'type','element');
++			 md.mask.vertexongroundedice=project3d(md,'vector',md.mask.vertexongroundedice,'type','node');
++			 md.mask.elementonwater=project3d(md,'vector',md.mask.elementonwater,'type','element');
++			 md.mask.vertexonwater=project3d(md,'vector',md.mask.vertexonwater,'type','node');
++			 if ~isnan(md.inversion.cost_functions_coefficients),md.inversion.cost_functions_coefficients=project3d(md,'vector',md.inversion.cost_functions_coefficients,'type','node');end;
++			 if ~isnan(md.inversion.min_parameters),md.inversion.min_parameters=project3d(md,'vector',md.inversion.min_parameters,'type','node');end;
++			 if ~isnan(md.inversion.max_parameters),md.inversion.max_parameters=project3d(md,'vector',md.inversion.max_parameters,'type','node');end;
++			 if ~isnan(md.qmu.partition),md.qmu.partition=project3d(md,'vector',md.qmu.partition','type','node');end
++			 if(md.surfaceforcings.isdelta18o),md.surfaceforcings.temperatures_lgm=project3d(md,'vector',md.surfaceforcings.temperatures_lgm,'type','node');end
++			 if(md.surfaceforcings.isdelta18o),md.surfaceforcings.temperatures_presentday=project3d(md,'vector',md.surfaceforcings.temperatures_presentday,'type','node');end
++			 if(md.surfaceforcings.isdelta18o),md.surfaceforcings.precipitations_presentday=project3d(md,'vector',md.surfaceforcings.precipitations_presentday,'type','node');end
++
++			 %Put lithostatic pressure if there is an existing pressure
++			 if ~isnan(md.initialization.pressure),
++				 md.initialization.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
++			 end
++
++			 %special for thermal modeling:
++			 md.basalforcings.melting_rate=project3d(md,'vector',md.basalforcings.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
++
++			 %increase connectivity if less than 25:
++			 if md.mesh.average_vertex_connectivity<=25,
++				 md.mesh.average_vertex_connectivity=100;
++			 end
++			end % }}}
+ 		 function md = structtomodel(md,structmd) % {{{
+ 
+ 			 if ~isstruct(structmd) error('input model is not a structure'); end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/basalstress.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/basalstress.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/basalstress.m	(revision 13005)
+@@ -1,22 +0,0 @@
+-function [bx by b]=basalstress(md)
+-%BASALSTRESS - compute basal stress from basal drag and geometric information. 
+-%
+-%   Usage:
+-%      [bx by b]=basalstress(md);
+-%
+-%   See also: plot_basaldrag
+-
+-
+-%compute exponents
+-s=averaging(md,1./md.friction.p,0);
+-r=averaging(md,md.friction.q./md.friction.p,0);
+-
+-%compute horizontal velocity
+-ub=sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
+-ubx=md.initialization.vx/md.constants.yts;
+-uby=md.initialization.vy/md.constants.yts;
+-
+-%compute basal drag
+-bx=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*ubx.^s;
+-by=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*uby.^s;
+-b=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*ub.^s;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/collapse.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/collapse.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/collapse.m	(revision 13005)
+@@ -1,131 +0,0 @@
+-function md=collapse(md)
+-%COLLAPSE - collapses a 3d mesh into a 2d mesh
+-%
+-%   This routine collapses a 3d model into a 2d model
+-%   and collapses all the fileds of the 3d model by
+-%   taking their depth-averaged values
+-%
+-%   Usage:
+-%      md=collapse(md)
+-%
+-%   See also: EXTRUDE, MODELEXTRACT
+-
+-%Check that the model is really a 3d model
+-if ~md.mesh.dimension==3,
+-	error('collapse error message: only 3d mesh can be collapsed')
+-end
+-
+-%Start with changing alle the fields from the 3d mesh 
+-
+-%drag is limited to nodes that are on the bedrock.
+-md.friction.coefficient=project2d(md,md.friction.coefficient,1);
+-
+-%p and q (same deal, except for element that are on the bedrock: )
+-md.friction.p=project2d(md,md.friction.p,1);
+-md.friction.q=project2d(md,md.friction.q,1);
+-
+-%observations
+-if ~isnan(md.inversion.vx_obs), md.inversion.vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers); end;
+-if ~isnan(md.inversion.vy_obs), md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers); end;
+-if ~isnan(md.inversion.vel_obs), md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers); end;
+-if ~isnan(md.inversion.cost_functions_coefficients), md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers); end;
+-if numel(md.inversion.min_parameters)>1, md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers); end;
+-if numel(md.inversion.max_parameters)>1, md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers); end;
+-if ~isnan(md.surfaceforcings.mass_balance),
+-	md.surfaceforcings.mass_balance=project2d(md,md.surfaceforcings.mass_balance,md.mesh.numberoflayers); 
+-end;
+-if ~isnan(md.balancethickness.thickening_rate), md.balancethickness.thickening_rate=project2d(md,md.balancethickness.thickening_rate,md.mesh.numberoflayers); end;
+-
+-%results
+-if ~isnan(md.initialization.vx),md.initialization.vx=DepthAverage(md,md.initialization.vx);end;
+-if ~isnan(md.initialization.vy),md.initialization.vy=DepthAverage(md,md.initialization.vy);end;
+-if ~isnan(md.initialization.vz),md.initialization.vz=DepthAverage(md,md.initialization.vz);end;
+-if ~isnan(md.initialization.vel),md.initialization.vel=DepthAverage(md,md.initialization.vel);end;
+-if ~isnan(md.initialization.temperature),md.initialization.temperature=DepthAverage(md,md.initialization.temperature);end;
+-
+-%bedinfo and surface info
+-md.mesh.elementonbed=ones(md.mesh.numberofelements2d,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements2d,1);
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices2d,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices2d,1);
+-
+-%elementstype
+-if ~isnan(md.flowequation.element_equation)
+-	md.flowequation.element_equation=project2d(md,md.flowequation.element_equation,1);
+-	md.flowequation.vertex_equation=project2d(md,md.flowequation.vertex_equation,1);
+-	md.flowequation.bordermacayeal=project2d(md,md.flowequation.bordermacayeal,1);
+-	md.flowequation.borderpattyn=project2d(md,md.flowequation.borderpattyn,1);
+-	md.flowequation.borderstokes=project2d(md,md.flowequation.borderstokes,1);
+-end	
+-
+-%boundary conditions
+-md.diagnostic.spcvx=project2d(md,md.diagnostic.spcvx,md.mesh.numberoflayers);
+-md.diagnostic.spcvy=project2d(md,md.diagnostic.spcvy,md.mesh.numberoflayers);
+-md.diagnostic.spcvz=project2d(md,md.diagnostic.spcvz,md.mesh.numberoflayers);
+-md.diagnostic.referential=project2d(md,md.diagnostic.referential,md.mesh.numberoflayers);
+-md.prognostic.spcthickness=project2d(md,md.prognostic.spcthickness,md.mesh.numberoflayers);
+-md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers);
+-
+-%Extrusion of Neumann BC
+-if ~isnan(md.diagnostic.icefront),
+-	numberofneumann2d=size(md.diagnostic.icefront,1)/(md.mesh.numberoflayers-1);
+-	md.diagnostic.icefront=[md.diagnostic.icefront(1:numberofneumann2d,1:2) md.diagnostic.icefront(1:numberofneumann2d,5:6)]; %Add two columns on the first layer 
+-end
+-
+-%materials
+-md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
+-md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
+-
+-%special for thermal modeling:
+-md.basalforcings.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
+-md.mesh.average_vertex_connectivity=25;
+-
+-%Collapse the mesh
+-nodes2d=md.mesh.numberofvertices2d;
+-elements2d=md.mesh.numberofelements2d;
+-
+-%parameters
+-md.geometry.surface=project2d(md,md.geometry.surface,1);
+-md.geometry.thickness=project2d(md,md.geometry.thickness,1);
+-md.geometry.bed=project2d(md,md.geometry.bed,1);
+-md.geometry.bathymetry=project2d(md,md.geometry.bathymetry,1);
+-md.mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
+-md.mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1);
+-md.mask.elementonfloatingice=project2d(md,md.mask.elementonfloatingice,1);
+-md.mask.vertexonfloatingice=project2d(md,md.mask.vertexonfloatingice,1);
+-md.mask.elementongroundedice=project2d(md,md.mask.elementongroundedice,1);
+-md.mask.vertexongroundedice=project2d(md,md.mask.vertexongroundedice,1);
+-md.mask.elementonwater=project2d(md,md.mask.elementonwater,1);
+-md.mask.vertexonwater=project2d(md,md.mask.vertexonwater,1);
+-
+-%lat long
+-if numel(md.mesh.lat) ==md.mesh.numberofvertices,  md.mesh.lat=project2d(md,md.mesh.lat,1); end
+-if numel(md.mesh.long)==md.mesh.numberofvertices, md.mesh.long=project2d(md,md.mesh.long,1); end
+-
+-%Initialize with the 2d mesh
+-md.mesh.x=md.mesh.x2d;
+-md.mesh.y=md.mesh.y2d;
+-md.mesh.z=zeros(size(md.mesh.x2d));
+-md.mesh.numberofvertices=md.mesh.numberofvertices2d;
+-md.mesh.numberofelements=md.mesh.numberofelements2d;
+-md.mesh.elements=md.mesh.elements2d;
+-
+-%Keep a trace of lower and upper nodes
+-md.mesh.lowervertex=NaN;
+-md.mesh.uppervertex=NaN;
+-md.mesh.lowerelements=NaN;
+-md.mesh.upperelements=NaN;
+-
+-%Remove old mesh 
+-md.mesh.x2d=NaN;
+-md.mesh.y2d=NaN;
+-md.mesh.elements2d=NaN;
+-md.mesh.numberofelements2d=md.mesh.numberofelements;
+-md.mesh.numberofvertices2d=md.mesh.numberofvertices;
+-md.mesh.numberoflayers=0;
+-
+-%Update mesh type
+-md.mesh.dimension=2;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.py	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.py	(revision 13005)
+@@ -1,59 +0,0 @@
+-from EnumDefinitions import *
+-
+-def AnalysisConfiguration(solutiontype):
+-	"""
+-	ANALYSISCONFIGURATION - return type of analyses, number of analyses 
+-
+-	   Usage:
+-	      [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
+-	"""
+-
+-	if   solutiontype == DiagnosticSolutionEnum:
+-		numanalyses=5
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum]
+-
+-	elif solutiontype == SteadystateSolutionEnum:
+-		numanalyses=7 
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum]
+-
+-	elif solutiontype == ThermalSolutionEnum:
+-		numanalyses=2 
+-		analyses=[ThermalAnalysisEnum,MeltingAnalysisEnum]
+-
+-	elif solutiontype == EnthalpySolutionEnum:
+-		numanalyses=1 
+-		analyses=[EnthalpyAnalysisEnum]
+-
+-	elif solutiontype == PrognosticSolutionEnum:
+-		numanalyses=1 
+-		analyses=[PrognosticAnalysisEnum]
+-
+-	elif solutiontype == BalancethicknessSolutionEnum:
+-		numanalyses=1 
+-		analyses=[BalancethicknessAnalysisEnum]
+-
+-	elif solutiontype == SurfaceSlopeSolutionEnum:
+-		numanalyses=1 
+-		analyses=[SurfaceSlopeAnalysisEnum]
+-
+-	elif solutiontype == BedSlopeSolutionEnum:
+-		numanalyses=1 
+-		analyses=[BedSlopeAnalysisEnum]
+-
+-	elif solutiontype == TransientSolutionEnum:
+-		numanalyses=9 
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum,EnthalpyAnalysisEnum,PrognosticAnalysisEnum]
+-
+-	elif solutiontype == FlaimSolutionEnum:
+-		numanalyses=1 
+-		analyses=[FlaimAnalysisEnum]
+-
+-	elif solutiontype == HydrologySolutionEnum:
+-		numanalyses=3 
+-		analyses=[BedSlopeAnalysisEnum,SurfaceSlopeAnalysisEnum,HydrologyAnalysisEnum]
+-
+-	else:
+-		raise TypeError("solution type: '%s' not supported yet!" % EnumToString(solutiontype))
+-
+-	return analyses,numanalyses
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modelextract.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modelextract.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modelextract.m	(revision 13005)
+@@ -1,283 +0,0 @@
+-function md2=modelextract(md1,area)
+-%modelextract - extract a model according to an Argus contour or flag list
+-%
+-%   This routine extracts a submodel from a bigger model with respect to a given contour
+-%   md must be followed by the corresponding exp file or flags list
+-%   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+-%   If user wants every element outside the domain to be 
+-%   modelextract2d, add '~' to the name of the domain file (ex: '~Pattyn.exp');
+-%   an empty string '' will be considered as an empty domain
+-%   a string 'all' will be considered as the entire domain
+-%   add an argument 0 if you do not want the elements to be checked (faster)
+-%
+-%   Usage:
+-%      md2=modelextract(md1,area);
+-%
+-%   Examples:
+-%      md2=modelextract(md,'Domain.exp');
+-%      md2=modelextract(md,md.mask.elementonfloatingice);
+-%
+-%   See also: EXTRUDE, COLLAPSE
+-
+-%some checks
+-if ((nargin~=2) | (nargout~=1)),
+-	help modelextract
+-	error('modelextract error message: bad usage');
+-end
+-
+-%get check option
+-if (nargin==3 & varargin{1}==0),
+-	checkoutline=0;
+-else
+-	checkoutline=1;
+-end
+-
+-%get elements that are inside area
+-flag_elem=FlagElements(md1,area);
+-if ~any(flag_elem),
+-	error('extracted model is empty');
+-end
+-
+-%kick out all elements with 3 dirichlets
+-spc_elem=find(~flag_elem);
+-spc_node=sort(unique(md1.mesh.elements(spc_elem,:)));
+-flag=ones(md1.mesh.numberofvertices,1);
+-flag(spc_node)=0;
+-pos=find(sum(flag(md1.mesh.elements),2)==0);
+-flag_elem(pos)=0;
+-
+-%extracted elements and nodes lists
+-pos_elem=find(flag_elem);
+-pos_node=sort(unique(md1.mesh.elements(pos_elem,:)));
+-
+-%keep track of some fields
+-numberofvertices1=md1.mesh.numberofvertices;
+-numberofelements1=md1.mesh.numberofelements;
+-numberofvertices2=length(pos_node);
+-numberofelements2=length(pos_elem);
+-flag_node=zeros(numberofvertices1,1);
+-flag_node(pos_node)=1;
+-
+-%Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
+-Pelem=zeros(numberofelements1,1);
+-Pelem(pos_elem)=[1:numberofelements2]';
+-Pnode=zeros(numberofvertices1,1);
+-Pnode(pos_node)=[1:numberofvertices2]';
+-
+-%renumber the elements (some node won't exist anymore)
+-elements_1=md1.mesh.elements;
+-elements_2=elements_1(pos_elem,:);
+-elements_2(:,1)=Pnode(elements_2(:,1));
+-elements_2(:,2)=Pnode(elements_2(:,2));
+-elements_2(:,3)=Pnode(elements_2(:,3));
+-if md1.mesh.dimension==3,
+-	elements_2(:,4)=Pnode(elements_2(:,4));
+-	elements_2(:,5)=Pnode(elements_2(:,5));
+-	elements_2(:,6)=Pnode(elements_2(:,6));
+-end
+-
+-%OK, now create the new model !
+-
+-	%take every fields from model
+-	md2=md1;
+-
+-	%automatically modify fields
+-
+-	%loop over model fields
+-	model_fields=fields(md1);
+-	for i=1:length(model_fields),
+-		%get field
+-		field=md1.(model_fields{i});
+-		fieldsize=size(field);
+-		if isobject(field), %recursive call
+-			object_fields=fields(md1.(model_fields{i}));
+-			for j=1:length(object_fields),
+-				%get field
+-				field=md1.(model_fields{i}).(object_fields{j});
+-				fieldsize=size(field);
+-				%size = number of nodes * n
+-				if fieldsize(1)==numberofvertices1
+-					md2.(model_fields{i}).(object_fields{j})=field(pos_node,:);
+-				elseif (fieldsize(1)==numberofvertices1+1)
+-					md2.(model_fields{i}).(object_fields{j})=[field(pos_node,:); field(end,:)];
+-					%size = number of elements * n
+-				elseif fieldsize(1)==numberofelements1
+-					md2.(model_fields{i}).(object_fields{j})=field(pos_elem,:);
+-				end
+-			end
+-		else
+-			%size = number of nodes * n
+-			if fieldsize(1)==numberofvertices1
+-				md2.(model_fields{i})=field(pos_node,:);
+-			elseif (fieldsize(1)==numberofvertices1+1)
+-				md2.(model_fields{i})=[field(pos_node,:); field(end,:)];
+-				%size = number of elements * n
+-			elseif fieldsize(1)==numberofelements1
+-				md2.(model_fields{i})=field(pos_elem,:);
+-			end
+-		end
+-	end
+-
+-	%modify some specific fields
+-
+-	%Mesh
+-	md2.mesh.numberofelements=numberofelements2;
+-	md2.mesh.numberofvertices=numberofvertices2;
+-	md2.mesh.elements=elements_2;
+-
+-	%mesh.uppervertex mesh.lowervertex
+-	if md1.mesh.dimension==3
+-		md2.mesh.uppervertex=md1.mesh.uppervertex(pos_node);
+-		pos=find(~isnan(md2.mesh.uppervertex));
+-		md2.mesh.uppervertex(pos)=Pnode(md2.mesh.uppervertex(pos));
+-
+-		md2.mesh.lowervertex=md1.mesh.lowervertex(pos_node);
+-		pos=find(~isnan(md2.mesh.lowervertex));
+-		md2.mesh.lowervertex(pos)=Pnode(md2.mesh.lowervertex(pos));
+-
+-		md2.mesh.upperelements=md1.mesh.upperelements(pos_elem);
+-		pos=find(~isnan(md2.mesh.upperelements));
+-		md2.mesh.upperelements(pos)=Pelem(md2.mesh.upperelements(pos));
+-
+-		md2.mesh.lowerelements=md1.mesh.lowerelements(pos_elem);
+-		pos=find(~isnan(md2.mesh.lowerelements));
+-		md2.mesh.lowerelements(pos)=Pelem(md2.mesh.lowerelements(pos));
+-	end
+-
+-	%Initial 2d mesh 
+-	if md1.mesh.dimension==3
+-		flag_elem_2d=flag_elem(1:md1.mesh.numberofelements2d);
+-		pos_elem_2d=find(flag_elem_2d);
+-		flag_node_2d=flag_node(1:md1.mesh.numberofvertices2d);
+-		pos_node_2d=find(flag_node_2d);
+-
+-		md2.mesh.numberofelements2d=length(pos_elem_2d);
+-		md2.mesh.numberofvertices2d=length(pos_node_2d);
+-		md2.mesh.elements2d=md1.mesh.elements2d(pos_elem_2d,:);
+-		md2.mesh.elements2d(:,1)=Pnode(md2.mesh.elements2d(:,1));
+-		md2.mesh.elements2d(:,2)=Pnode(md2.mesh.elements2d(:,2));
+-		md2.mesh.elements2d(:,3)=Pnode(md2.mesh.elements2d(:,3));
+-
+-		md2.mesh.x2d=md1.mesh.x(pos_node_2d);
+-		md2.mesh.y2d=md1.mesh.y(pos_node_2d);
+-	end
+-
+-	%Edges
+-	if size(md2.mesh.edges,2)>1, %do not use ~isnan because there are some NaNs...
+-		%renumber first two columns
+-		pos=find(md2.mesh.edges(:,4)~=-1);
+-		md2.mesh.edges(:  ,1)=Pnode(md2.mesh.edges(:,1)); 
+-		md2.mesh.edges(:  ,2)=Pnode(md2.mesh.edges(:,2)); 
+-		md2.mesh.edges(:  ,3)=Pelem(md2.mesh.edges(:,3));
+-		md2.mesh.edges(pos,4)=Pelem(md2.mesh.edges(pos,4));
+-		%remove edges when the 2 vertices are not in the domain.
+-		md2.mesh.edges=md2.mesh.edges(find(md2.mesh.edges(:,1) & md2.mesh.edges(:,2)),:);
+-		%Replace all zeros by -1 in the last two columns;
+-		pos=find(md2.mesh.edges(:,3)==0);
+-		md2.mesh.edges(pos,3)=-1;
+-		pos=find(md2.mesh.edges(:,4)==0);
+-		md2.mesh.edges(pos,4)=-1;
+-		%Invert -1 on the third column with last column (Also invert first two columns!!)
+-		pos=find(md2.mesh.edges(:,3)==-1);
+-		md2.mesh.edges(pos,3)=md2.mesh.edges(pos,4);
+-		md2.mesh.edges(pos,4)=-1;
+-		values=md2.mesh.edges(pos,2);
+-		md2.mesh.edges(pos,2)=md2.mesh.edges(pos,1);
+-		md2.mesh.edges(pos,1)=values;
+-		%Finally remove edges that do not belong to any element
+-		pos=find(md2.mesh.edges(:,3)==-1 & md2.mesh.edges(:,4)==-1);
+-		md2.mesh.edges(pos,:)=[];
+-	end
+-
+-	%Penalties
+-	if ~isnan(md2.diagnostic.vertex_pairing),
+-		for i=1:size(md1.diagnostic.vertex_pairing,1);
+-			md2.diagnostic.vertex_pairing(i,:)=Pnode(md1.diagnostic.vertex_pairing(i,:));
+-		end
+-		md2.diagnostic.vertex_pairing=md2.diagnostic.vertex_pairing(find(md2.diagnostic.vertex_pairing(:,1)),:);
+-	end
+-	if ~isnan(md2.prognostic.vertex_pairing),
+-		for i=1:size(md1.prognostic.vertex_pairing,1);
+-			md2.prognostic.vertex_pairing(i,:)=Pnode(md1.prognostic.vertex_pairing(i,:));
+-		end
+-		md2.prognostic.vertex_pairing=md2.prognostic.vertex_pairing(find(md2.prognostic.vertex_pairing(:,1)),:);
+-	end
+-
+-	%recreate segments
+-	if md1.mesh.dimension==2
+-		md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices);
+-		md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity);
+-		md2.mesh.segments=contourenvelope(md2);
+-		md2.mesh.vertexonboundary=zeros(numberofvertices2,1); md2.mesh.vertexonboundary(md2.mesh.segments(:,1:2))=1;
+-	else
+-		%First do the connectivity for the contourenvelope in 2d
+-		md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements2d,md2.mesh.numberofvertices2d);
+-		md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements2d,md2.mesh.vertexconnectivity);
+-		md2.mesh.segments=contourenvelope(md2);
+-		md2.mesh.vertexonboundary=zeros(numberofvertices2/md2.mesh.numberoflayers,1); md2.mesh.vertexonboundary(md2.mesh.segments(:,1:2))=1;
+-		md2.mesh.vertexonboundary=repmat(md2.mesh.vertexonboundary,md2.mesh.numberoflayers,1);
+-		%Then do it for 3d as usual
+-		md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices);
+-		md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity);
+-	end
+-
+-	%Boundary conditions: Dirichlets on new boundary
+-	%Catch the elements that have not been extracted
+-	orphans_elem=find(~flag_elem);
+-	orphans_node=unique(md1.mesh.elements(orphans_elem,:))';
+-	%Figure out which node are on the boundary between md2 and md1
+-	nodestoflag1=intersect(orphans_node,pos_node);
+-	nodestoflag2=Pnode(nodestoflag1);
+-	if numel(md1.diagnostic.spcvx)>1 & numel(md1.diagnostic.spcvy)>2 & numel(md1.diagnostic.spcvz)>2,
+-		if numel(md1.inversion.vx_obs)>1 & numel(md1.inversion.vy_obs)>1
+-			md2.diagnostic.spcvx(nodestoflag2)=md2.inversion.vx_obs(nodestoflag2); 
+-			md2.diagnostic.spcvy(nodestoflag2)=md2.inversion.vy_obs(nodestoflag2);
+-		else
+-			md2.diagnostic.spcvx(nodestoflag2)=NaN;
+-			md2.diagnostic.spcvy(nodestoflag2)=NaN;
+-			disp(' ')
+-			disp('!! modelextract warning: spc values should be checked !!')
+-			disp(' ')
+-		end
+-		%put 0 for vz
+-		md2.diagnostic.spcvz(nodestoflag2)=0;
+-	end
+-	if ~isnan(md1.thermal.spctemperature),
+-		md2.thermal.spctemperature(nodestoflag2,1)=1;
+-	end
+-
+-	%Diagnostic
+-	if ~isnan(md2.diagnostic.icefront)
+-		md2.diagnostic.icefront(:,1)=Pnode(md1.diagnostic.icefront(:,1)); 
+-		md2.diagnostic.icefront(:,2)=Pnode(md1.diagnostic.icefront(:,2)); 
+-		md2.diagnostic.icefront(:,end-1)=Pelem(md1.diagnostic.icefront(:,end-1));
+-		if md1.mesh.dimension==3
+-			md2.diagnostic.icefront(:,3)=Pnode(md1.diagnostic.icefront(:,3)); 
+-			md2.diagnostic.icefront(:,4)=Pnode(md1.diagnostic.icefront(:,4)); 
+-		end
+-		md2.diagnostic.icefront=md2.diagnostic.icefront(find(md2.diagnostic.icefront(:,1) & md2.diagnostic.icefront(:,2) & md2.diagnostic.icefront(:,end)),:);
+-	end
+-
+-	%Results fields
+-	if isstruct(md1.results),
+-		md2.results=struct();
+-		solutionfields=fields(md1.results);
+-		for i=1:length(solutionfields),
+-			%get subfields
+-			solutionsubfields=fields(md1.results.(solutionfields{i}));
+-			for j=1:length(solutionsubfields),
+-				field=md1.results.(solutionfields{i}).(solutionsubfields{j});
+-				if length(field)==numberofvertices1,
+-					md2.results.(solutionfields{i}).(solutionsubfields{j})=field(pos_node);
+-				elseif length(field)==numberofelements1,
+-					md2.results.(solutionfields{i}).(solutionsubfields{j})=field(pos_elem);
+-				else
+-					md2.results.(solutionfields{i}).(solutionsubfields{j})=field;
+-				end
+-			end
+-		end
+-	end
+-
+-%Keep track of pos_node and pos_elem
+-md2.mesh.extractedvertices=pos_node;
+-md2.mesh.extractedelements=pos_elem;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mechanicalproperties.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mechanicalproperties.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mechanicalproperties.m	(revision 13005)
+@@ -1,118 +0,0 @@
+-function md=mechanicalproperties(md,vx,vy)
+-%MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
+-%
+-%   this routine computes the components of the stress tensor
+-%   strain rate tensor and their respective principal directions.
+-%   the results are in the model md: md.results
+-%
+-%   Usage:
+-%      md=mechanicalproperties(md,vx,vy)
+-%
+-%   Example:
+-%      md=mechanicalproperties(md,md.initialization.vx,md.initialization.vy);
+-%      md=mechanicalproperties(md,md.inversion.vx_obs,md.inversion.vy_obs);
+-
+-%some checks
+-if length(vx)~=md.mesh.numberofvertices | length(vy)~=md.mesh.numberofvertices,
+-	error(['the input velocity should be of size ' num2str(md.mesh.numberofvertices) '!'])
+-end
+-if ~(md.mesh.dimension==2)
+-	error('only 2d model supported yet');
+-end
+-if any(md.flowequation.element_equation~=2),
+-	disp('Warning: the model has some non macayeal elements. These will be treated like MacAyeal''s elements');
+-end
+-
+-%initialization
+-numberofelements=md.mesh.numberofelements;
+-index=md.mesh.elements;
+-summation=[1;1;1];
+-directionsstress=zeros(numberofelements,4);
+-directionsstrain=zeros(numberofelements,4);
+-valuesstress=zeros(numberofelements,2);
+-valuesstrain=zeros(numberofelements,2);
+-
+-%compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
+-[alpha beta]=GetNodalFunctionsCoeff(index,md.mesh.x,md.mesh.y);
+-
+-%compute shear
+-vxlist=vx(index)/md.constants.yts;
+-vylist=vy(index)/md.constants.yts;
+-ux=(vxlist.*alpha)*summation;
+-uy=(vxlist.*beta)*summation;
+-vx=(vylist.*alpha)*summation;
+-vy=(vylist.*beta)*summation;						
+-uyvx=(vx+uy)./2;
+-clear vxlist vylist
+-
+-%compute viscosity
+-nu=zeros(numberofelements,1);
+-B_bar=md.materials.rheology_B(index)*summation/3;
+-power=(md.materials.rheology_n-1)./(2*md.materials.rheology_n);
+-second_inv=(ux.^2+vy.^2+((uy+vx).^2)/4+ux.*vy);
+-%some corrections
+-location=find(second_inv~=0);
+-nu(location)=B_bar(location)./(second_inv(location).^power(location));
+-location=find(second_inv==0 & power~=0);
+-nu(location)=10^18; 	%arbitrary maximum viscosity to apply where there is no effective shear
+-location=find(second_inv==0 & power==0);
+-nu(location)=B_bar(location);
+-clear B_bar location second_inv power
+-
+-%compute stress
+-tau_xx=nu.*ux;
+-tau_yy=nu.*vy;
+-tau_xy=nu.*uyvx;
+-
+-%compute principal properties of stress
+-for i=1:numberofelements,
+-
+-	%compute stress and strainrate matrices
+-	stress=[tau_xx(i) tau_xy(i)
+-	tau_xy(i)  tau_yy(i)];
+-	strain=[ux(i) uyvx(i)
+-	uyvx(i)  vy(i)];
+-
+-	%eigen values and vectors
+-	[directions,value]=eig(stress);
+-	valuesstress(i,:)=[value(1,1) value(2,2)];
+-	directionsstress(i,:)=directions(:)';
+-	[directions,value]=eig(strain);
+-	valuesstrain(i,:)=[value(1,1) value(2,2)];
+-	directionsstrain(i,:)=directions(:)';
+-end
+-
+-%plug onto the model
+-%NB: Matlab sorts the eigen value in increasing order, we want the reverse
+-stress=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
+-stress.xx=tau_xx;
+-stress.yy=tau_yy;
+-stress.xy=tau_xy;
+-stress.principalvalue2=valuesstress(:,1);
+-stress.principalaxis2=directionsstress(:,1:2);
+-stress.principalvalue1=valuesstress(:,2);
+-stress.principalaxis1=directionsstress(:,3:4);
+-stress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+2*stress.xy.^2);
+-md.results.stress=stress;
+-
+-strainrate=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
+-strainrate.xx=ux;
+-strainrate.yy=vy;
+-strainrate.xy=uyvx;
+-strainrate.principalvalue2=valuesstrain(:,1)*(365.25*24*3600); %strain rate in 1/a instead of 1/s
+-strainrate.principalaxis2=directionsstrain(:,1:2);
+-strainrate.principalvalue1=valuesstrain(:,2)*(365.25*24*3600); %strain rate in 1/a instead of 1/s
+-strainrate.principalaxis1=directionsstrain(:,3:4);
+-strainrate.effectivevalue=1/sqrt(2)*sqrt(strainrate.xx.^2+strainrate.yy.^2+2*strainrate.xy.^2);
+-md.results.strainrate=strainrate;
+-
+-deviatoricstress=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
+-deviatoricstress.xx=tau_xx;
+-deviatoricstress.yy=tau_yy;
+-deviatoricstress.xy=tau_xy;
+-deviatoricstress.principalvalue2=valuesstress(:,1);
+-deviatoricstress.principalaxis2=directionsstress(:,1:2);
+-deviatoricstress.principalvalue1=valuesstress(:,2);
+-deviatoricstress.principalaxis1=directionsstress(:,3:4);
+-deviatoricstress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+2*stress.xy.^2);
+-md.results.deviatoricstress=deviatoricstress;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.m	(revision 13005)
+@@ -1,31 +0,0 @@
+-function md=addnote(md,string)
+-%ADDNOTE - add a note to the existing model notes field
+-%
+-%   Usage:
+-%      md=addnote(md,string);
+-%
+-%   Example:
+-%      md=addnote(md,'Pine Island, Geometry of 2007');
+-
+-if (nargin~=2) & (nargout~=1),
+-	help addnote
+-end
+-
+-if ~ischar(string),
+-	error('addnote error message: second input argument should be a string');
+-end
+-notes=md.miscellaneous.notes;
+-
+-if ischar(notes),
+-	newnotes=cell(2,1);
+-	newnotes(1)={notes};
+-	newnotes(2)={string};
+-else
+-	newnotes=cell(length(notes)+1,1);
+-	for i=1:length(notes),
+-		newnotes(i)=notes(i);
+-	end
+-	newnotes(length(notes)+1)={string};
+-end
+-
+-md.miscellaneous.notes=newnotes;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.py	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/addnote.py	(revision 13005)
+@@ -1,25 +0,0 @@
+-def addnote(md,string):
+-	"""
+-	ADDNOTE - add a note to the existing model notes field
+-
+-	   Usage:
+-	      md=addnote(md,string);
+-
+-	   Example:
+-	      md=addnote(md,'Pine Island, Geometry of 2007');
+-	"""
+-
+-	if not isinstance(string,str):
+-		raise TypeError('addnote error message: second input argument should be a string')
+-
+-	notes=md.miscellaneous.notes
+-
+-	if isinstance(notes,str):
+-		newnotes=[notes,string]
+-	else:
+-		newnotes=notes.append(string)
+-
+-	md.miscellaneous.notes=newnotes
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/basevert.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/basevert.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/basevert.m	(revision 13005)
+@@ -1,35 +0,0 @@
+-function wb=basevert(md)
+-%BASEVERT - computes the basal vertical velcities
+-%
+-%   This routine computes the basal vertical velocities of ice shelves
+-%   for 2d models only using the following formula:
+-%   wb=rho_ice/rho_water*div(thickness*vel_horiz)+vel_horiz.grad(base)
+-%
+-%   Usage:
+-%      wb=basevert(md);
+-
+-alpha=zeros(md.mesh.numberofelements,3);
+-beta=zeros(md.mesh.numberofelements,3);
+-gamma=zeros(md.mesh.numberofelements,3);
+-
+-for n=1:md.mesh.numberofelements
+-	X=inv([md.mesh.x(md.mesh.elements(n,:)) md.mesh.y(md.mesh.elements(n,:)) ones(3,1)]);
+-	alpha(n,:)=X(1,:);
+-	beta(n,:)=X(2,:);
+-	gamma(n,:)=X(3,:);
+-end
+-
+-hu=md.geometry.thickness.*md.initialization.vx;
+-hv=md.geometry.thickness.*md.initialization.vy;
+-
+-summation=[1;1;1];
+-hux=(hu(md.mesh.elements).*alpha)*summation;
+-hvy=(hv(md.mesh.elements).*beta)*summation;
+-
+-uelem=md.initialization.vx(md.mesh.elements)*summation/3;
+-velem=md.initialization.vy(md.mesh.elements)*summation/3;
+-
+-dbdx=(md.geometry.bed(md.mesh.elements).*alpha)*summation;
+-dbdy=(md.geometry.bed(md.mesh.elements).*beta)*summation;
+-
+-wb=-md.materials.rho_ice/md.materials.rho_water*(hux+hvy)+uelem.*dbdx+velem.*dbdy;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/AnalysisConfiguration.m	(revision 13005)
+@@ -1,58 +0,0 @@
+-function [analyses,numanalyses]=AnalysisConfiguration(solutiontype),
+-%ANALYSISCONFIGURATION - return type of analyses, number of analyses 
+-%
+-%   Usage:
+-%      [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
+-
+-
+-
+-switch solutiontype,
+-
+-	case DiagnosticSolutionEnum,
+-		numanalyses=5;
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum];
+-
+-	case SteadystateSolutionEnum,
+-		numanalyses=7; 
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum];
+-
+-	case ThermalSolutionEnum,
+-		numanalyses=2; 
+-		analyses=[ThermalAnalysisEnum;MeltingAnalysisEnum];
+-
+-	case EnthalpySolutionEnum,
+-		numanalyses=1; 
+-		analyses=[EnthalpyAnalysisEnum];
+-
+-	case PrognosticSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[PrognosticAnalysisEnum];
+-
+-	case BalancethicknessSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[BalancethicknessAnalysisEnum];
+-
+-	case SurfaceSlopeSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[SurfaceSlopeAnalysisEnum];
+-
+-	case BedSlopeSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[BedSlopeAnalysisEnum];
+-
+-	case TransientSolutionEnum,
+-		numanalyses=9; 
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;EnthalpyAnalysisEnum;PrognosticAnalysisEnum];
+-
+-	case FlaimSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[FlaimAnalysisEnum];
+-
+-	case HydrologySolutionEnum,
+-		numanalyses=3; 
+-		analyses=[BedSlopeAnalysisEnum;SurfaceSlopeAnalysisEnum;HydrologyAnalysisEnum];
+-
+-	otherwise
+-		error('%s%s%s',' solution type: ',EnumToString(solutiontype),' not supported yet!');
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrude.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrude.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrude.m	(revision 13005)
+@@ -1,243 +0,0 @@
+-function md=extrude(md,varargin)
+-%EXTRUDE - vertically extrude a 2d mesh
+-%
+-%   vertically extrude a 2d mesh and create corresponding 3d mesh.
+-%   The vertical distribution can:
+-%    - follow a polynomial law
+-%    - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
+-%    - be discribed by a list of coefficients (between 0 and 1)
+-%   
+-%
+-%   Usage:
+-%      md=extrude(md,numlayers,extrusionexponent);
+-%      md=extrude(md,numlayers,lowerexponent,upperexponent);
+-%      md=extrude(md,listofcoefficients);
+-%
+-%   Example:
+-%      md=extrude(md,8,3);
+-%      md=extrude(md,8,3,2);
+-%      md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1]);
+-%
+-%   See also: MODELEXTRACT, COLLAPSE
+-
+-%some checks on list of arguments
+-if ((nargin>4) | (nargin<2) | (nargout~=1)),
+-	help extrude;
+-	error('extrude error message');
+-end
+-
+-%Extrude the mesh
+-if nargin==2, %list of coefficients
+-	list=varargin{1};
+-	if any(list<0) | any(list>1),
+-		error('extrusioncoefficients must be between 0 and 1');
+-	end
+-	extrusionlist=sort(unique([list(:);0;1]));
+-	numlayers=length(extrusionlist);
+-elseif nargin==3, %one polynomial law
+-	if varargin{2}<=0,
+-		help extrude;
+-		error('extrusionexponent must be >=0');
+-	end
+-	numlayers=varargin{1};
+-	extrusionlist=((0:1:numlayers-1)/(numlayers-1)).^varargin{2};
+-elseif nargin==4, %two polynomial laws
+-	numlayers=varargin{1};
+-	lowerexp=varargin{2};
+-	upperexp=varargin{3};
+-
+-	if varargin{2}<=0 | varargin{3}<=0,
+-		help extrude;
+-		error('lower and upper extrusionexponents must be >=0');
+-	end
+-
+-	lowerextrusionlist=[(0:2/(numlayers-1):1).^lowerexp]/2;
+-	upperextrusionlist=[(0:2/(numlayers-1):1).^upperexp]/2;
+-	extrusionlist=sort(unique([lowerextrusionlist 1-upperextrusionlist]));
+-
+-end
+-
+-if numlayers<2,
+-	error('number of layers should be at least 2');
+-end
+-if md.mesh.dimension==3,
+-	error('Cannot extrude a 3d mesh (extrude cannot be called more than once)');
+-end
+-
+-%Initialize with the 2d mesh
+-x3d=[]; 
+-y3d=[];
+-z3d=[];  %the lower node is on the bed
+-thickness3d=md.geometry.thickness; %thickness and bed for these nodes
+-bed3d=md.geometry.bed;
+-
+-%Create the new layers
+-for i=1:numlayers,
+-	x3d=[x3d; md.mesh.x]; 
+-	y3d=[y3d; md.mesh.y];
+-	%nodes are distributed between bed and surface accordingly to the given exponent
+-	z3d=[z3d; bed3d+thickness3d*extrusionlist(i)]; 
+-end
+-number_nodes3d=size(x3d,1); %number of 3d nodes for the non extruded part of the mesh
+-
+-%Extrude elements 
+-elements3d=[];
+-for i=1:numlayers-1,
+-	elements3d=[elements3d;[md.mesh.elements+(i-1)*md.mesh.numberofvertices md.mesh.elements+i*md.mesh.numberofvertices]]; %Create the elements of the 3d mesh for the non extruded part
+-end
+-number_el3d=size(elements3d,1); %number of 3d nodes for the non extruded part of the mesh
+-
+-%Keep a trace of lower and upper nodes
+-mesh.lowervertex=NaN*ones(number_nodes3d,1);
+-mesh.uppervertex=NaN*ones(number_nodes3d,1);
+-mesh.lowervertex(md.mesh.numberofvertices+1:end)=1:(numlayers-1)*md.mesh.numberofvertices;
+-mesh.uppervertex(1:(numlayers-1)*md.mesh.numberofvertices)=md.mesh.numberofvertices+1:number_nodes3d;
+-md.mesh.lowervertex=mesh.lowervertex;
+-md.mesh.uppervertex=mesh.uppervertex;
+-
+-%same for lower and upper elements
+-mesh.lowerelements=NaN*ones(number_el3d,1);
+-mesh.upperelements=NaN*ones(number_el3d,1);
+-mesh.lowerelements(md.mesh.numberofelements+1:end)=1:(numlayers-2)*md.mesh.numberofelements;
+-mesh.upperelements(1:(numlayers-2)*md.mesh.numberofelements)=md.mesh.numberofelements+1:(numlayers-1)*md.mesh.numberofelements;
+-md.mesh.lowerelements=mesh.lowerelements;
+-md.mesh.upperelements=mesh.upperelements;
+-
+-%Save old mesh 
+-md.mesh.x2d=md.mesh.x;
+-md.mesh.y2d=md.mesh.y;
+-md.mesh.elements2d=md.mesh.elements;
+-md.mesh.numberofelements2d=md.mesh.numberofelements;
+-md.mesh.numberofvertices2d=md.mesh.numberofvertices;
+-
+-%Update mesh type
+-md.mesh.dimension=3;
+-
+-%Build global 3d mesh 
+-md.mesh.elements=elements3d;
+-md.mesh.x=x3d;
+-md.mesh.y=y3d;
+-md.mesh.z=z3d;
+-md.mesh.numberofelements=number_el3d;
+-md.mesh.numberofvertices=number_nodes3d;
+-md.mesh.numberoflayers=numlayers;
+-
+-%Ok, now deal with the other fields from the 2d mesh:
+-
+-%lat long
+-md.mesh.lat=project3d(md,'vector',md.mesh.lat,'type','node');
+-md.mesh.long=project3d(md,'vector',md.mesh.long,'type','node');
+-
+-%drag coefficient is limited to nodes that are on the bedrock.
+-md.friction.coefficient=project3d(md,'vector',md.friction.coefficient,'type','node','layer',1);
+-
+-%p and q (same deal, except for element that are on the bedrock: )
+-md.friction.p=project3d(md,'vector',md.friction.p,'type','element');
+-md.friction.q=project3d(md,'vector',md.friction.q,'type','element');
+-
+-%observations
+-md.inversion.vx_obs=project3d(md,'vector',md.inversion.vx_obs,'type','node');
+-md.inversion.vy_obs=project3d(md,'vector',md.inversion.vy_obs,'type','node');
+-md.inversion.vel_obs=project3d(md,'vector',md.inversion.vel_obs,'type','node');
+-md.surfaceforcings.mass_balance=project3d(md,'vector',md.surfaceforcings.mass_balance,'type','node');
+-md.surfaceforcings.precipitation=project3d(md,'vector',md.surfaceforcings.precipitation,'type','node');
+-md.balancethickness.thickening_rate=project3d(md,'vector',md.balancethickness.thickening_rate,'type','node');
+-md.surfaceforcings.monthlytemperatures=project3d(md,'vector',md.surfaceforcings.monthlytemperatures,'type','node');
+-
+-%results
+-if ~isnan(md.initialization.vx),md.initialization.vx=project3d(md,'vector',md.initialization.vx,'type','node');end;
+-if ~isnan(md.initialization.vy),md.initialization.vy=project3d(md,'vector',md.initialization.vy,'type','node');end;
+-if ~isnan(md.initialization.vz),md.initialization.vz=project3d(md,'vector',md.initialization.vz,'type','node');end;
+-if ~isnan(md.initialization.vel),md.initialization.vel=project3d(md,'vector',md.initialization.vel,'type','node');end;
+-if ~isnan(md.initialization.temperature),md.initialization.temperature=project3d(md,'vector',md.initialization.temperature,'type','node');end;
+-if ~isnan(md.initialization.waterfraction),md.initialization.waterfraction=project3d(md,'vector',md.initialization.waterfraction,'type','node');end;
+-
+-%bedinfo and surface info
+-md.mesh.elementonbed=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.vertexonbed=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);
+-
+-%elementstype
+-if ~isnan(md.flowequation.element_equation)
+-	oldelements_type=md.flowequation.element_equation;
+-	md.flowequation.element_equation=zeros(number_el3d,1);
+-	md.flowequation.element_equation=project3d(md,'vector',oldelements_type,'type','element');
+-end
+-
+-%verticestype
+-if ~isnan(md.flowequation.vertex_equation)
+-	oldvertices_type=md.flowequation.vertex_equation;
+-	md.flowequation.vertex_equation=zeros(number_nodes3d,1);
+-	md.flowequation.vertex_equation=project3d(md,'vector',oldvertices_type,'type','node');
+-end
+-md.flowequation.bordermacayeal=project3d(md,'vector',md.flowequation.bordermacayeal,'type','node');
+-md.flowequation.borderpattyn=project3d(md,'vector',md.flowequation.borderpattyn,'type','node');
+-md.flowequation.borderstokes=project3d(md,'vector',md.flowequation.borderstokes,'type','node');
+-
+-%boundary conditions
+-md.diagnostic.spcvx=project3d(md,'vector',md.diagnostic.spcvx,'type','node');
+-md.diagnostic.spcvy=project3d(md,'vector',md.diagnostic.spcvy,'type','node');
+-md.diagnostic.spcvz=project3d(md,'vector',md.diagnostic.spcvz,'type','node');
+-md.thermal.spctemperature=project3d(md,'vector',md.thermal.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',NaN);
+-md.prognostic.spcthickness=project3d(md,'vector',md.prognostic.spcthickness,'type','node');
+-md.balancethickness.spcthickness=project3d(md,'vector',md.balancethickness.spcthickness,'type','node');
+-md.diagnostic.referential=project3d(md,'vector',md.diagnostic.referential,'type','node');
+-
+-%in 3d, pressureload: [node1 node2 node3 node4 element]
+-pressureload_layer1=[md.diagnostic.icefront(:,1:2)  md.diagnostic.icefront(:,2)+md.mesh.numberofvertices2d  md.diagnostic.icefront(:,1)+md.mesh.numberofvertices2d  md.diagnostic.icefront(:,3:4)]; %Add two columns on the first layer 
+-pressureload=[];
+-for i=1:numlayers-1,
+-	pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d pressureload_layer1(:,6)];
+-end
+-md.diagnostic.icefront=pressureload;
+-
+-%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;
+-end
+-md.mesh.elementconnectivity(find(isnan(md.mesh.elementconnectivity)))=0;
+-
+-%materials
+-md.materials.rheology_B=project3d(md,'vector',md.materials.rheology_B,'type','node');
+-md.materials.rheology_n=project3d(md,'vector',md.materials.rheology_n,'type','element');
+-
+-%parameters
+-md.geometry.surface=project3d(md,'vector',md.geometry.surface,'type','node');
+-md.geometry.thickness=project3d(md,'vector',md.geometry.thickness,'type','node');
+-md.geometry.hydrostatic_ratio=project3d(md,'vector',md.geometry.hydrostatic_ratio,'type','node');
+-md.geometry.bed=project3d(md,'vector',md.geometry.bed,'type','node');
+-md.geometry.bathymetry=project3d(md,'vector',md.geometry.bathymetry,'type','node');
+-md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node');
+-md.mask.elementonfloatingice=project3d(md,'vector',md.mask.elementonfloatingice,'type','element');
+-md.mask.vertexonfloatingice=project3d(md,'vector',md.mask.vertexonfloatingice,'type','node');
+-md.mask.elementongroundedice=project3d(md,'vector',md.mask.elementongroundedice,'type','element');
+-md.mask.vertexongroundedice=project3d(md,'vector',md.mask.vertexongroundedice,'type','node');
+-md.mask.elementonwater=project3d(md,'vector',md.mask.elementonwater,'type','element');
+-md.mask.vertexonwater=project3d(md,'vector',md.mask.vertexonwater,'type','node');
+-if ~isnan(md.inversion.cost_functions_coefficients),md.inversion.cost_functions_coefficients=project3d(md,'vector',md.inversion.cost_functions_coefficients,'type','node');end;
+-if ~isnan(md.inversion.min_parameters),md.inversion.min_parameters=project3d(md,'vector',md.inversion.min_parameters,'type','node');end;
+-if ~isnan(md.inversion.max_parameters),md.inversion.max_parameters=project3d(md,'vector',md.inversion.max_parameters,'type','node');end;
+-if ~isnan(md.qmu.partition),md.qmu.partition=project3d(md,'vector',md.qmu.partition','type','node');end
+-if(md.surfaceforcings.isdelta18o),md.surfaceforcings.temperatures_lgm=project3d(md,'vector',md.surfaceforcings.temperatures_lgm,'type','node');end
+-if(md.surfaceforcings.isdelta18o),md.surfaceforcings.temperatures_presentday=project3d(md,'vector',md.surfaceforcings.temperatures_presentday,'type','node');end
+-if(md.surfaceforcings.isdelta18o),md.surfaceforcings.precipitations_presentday=project3d(md,'vector',md.surfaceforcings.precipitations_presentday,'type','node');end
+-
+-%Put lithostatic pressure if there is an existing pressure
+-if ~isnan(md.initialization.pressure),
+-	md.initialization.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
+-end
+-
+-%special for thermal modeling:
+-md.basalforcings.melting_rate=project3d(md,'vector',md.basalforcings.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
+-
+-%increase connectivity if less than 25:
+-if md.mesh.average_vertex_connectivity<=25,
+-	md.mesh.average_vertex_connectivity=100;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/bedslope.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/bedslope.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/bedslope.m	(revision 13005)
+@@ -1,32 +0,0 @@
+-function [bx,by,b]=bedslope(md)
+-%BEDSLOPE - compute the bed slope
+-%
+-%   Usage:
+-%      [bx,by,s]=bedslope(md)
+-
+-%load some variables (it is much faster if the variab;es are loaded from md once for all) 
+-if (md.mesh.dimension==2),
+-	numberofelements=md.mesh.numberofelements;
+-	numberofnodes=md.mesh.numberofvertices;
+-	index=md.mesh.elements;
+-	x=md.mesh.x; y=md.mesh.y;
+-else
+-	numberofelements=md.mesh.numberofelements2d;
+-	numberofnodes=md.mesh.numberofvertices2d;
+-	index=md.mesh.elements2d;
+-	x=md.mesh.x2d; y=md.mesh.y2d;
+-end
+-
+-%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
+-[alpha beta]=GetNodalFunctionsCoeff(index,x,y);
+-
+-summation=[1;1;1];
+-bx=(md.geometry.bed(index).*alpha)*summation;
+-by=(md.geometry.bed(index).*beta)*summation;
+-b=sqrt(bx.^2+by.^2);
+-
+-if md.mesh.dimension==3,
+-	bx=project3d(md,bx,'element');
+-	by=project3d(md,by,'element');
+-	b=sqrt(bx.^2+by.^2);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/BasinConstrainShelf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/BasinConstrainShelf.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/BasinConstrainShelf.m	(revision 13005)
+@@ -1,74 +0,0 @@
+-function md=BasinConstrainShelf(md,domain);
+-%BASINCONSTRAIN - constrain basin
+-%
+-%   Constrain basin using a constraint domain outline, 
+-%   to dirichlet boundary conditions.
+-%   constraindomain is an Argus domain outline file enclosing 
+-%   the geographical area of interest.
+-%
+-%   Usage: 
+-%      md=BasinConstrain(md,constraindomain)
+-%
+-%   Example:
+-%      md=BasinConstrain(md,'DomainOutline.exp');
+-%      md=BasinConstrain(md,'~Iceshelves.exp');
+-
+-%now, flag nodes and elements outside the domain outline.
+-if ischar(domain),
+-	if isempty(domain),
+-		elementondomain=zeros(md.mesh.numberofelements,1);
+-		vertexondomain=zeros(md.mesh.numberofvertices,1);
+-		invert=0;
+-	elseif strcmpi(domain,'all')
+-		elementondomain=ones(md.mesh.numberofelements,1);
+-		vertexondomain=ones(md.mesh.numberofvertices,1);
+-		invert=0;
+-	else
+-		%make sure that we actually don't want the elements outside the domain outline!
+-		if strcmpi(domain(1),'~'),
+-			domain=domain(2:end);
+-			invert=1;
+-		else
+-			invert=0;
+-		end
+-		%ok, flag elements and nodes
+-		[vertexondomain elementondomain]=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,domain,'element and node',2);
+-	end
+-	if invert,
+-		vertexondomain=~vertexondomain;
+-		elementondomain=~elementondomain;
+-	end
+-else
+-	error('BasinConstrain error message: domain type not supported yet');
+-end
+-
+-%list of elements and nodes not on domain
+-vertexnotondomain=find(~vertexondomain);
+-elementnotondomain=find(~elementondomain);
+-
+-%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
+-md.diagnostic.spcvx(vertexnotondomain)=md.inversion.vx_obs(vertexnotondomain);
+-md.diagnostic.spcvy(vertexnotondomain)=md.inversion.vy_obs(vertexnotondomain);
+-md.mask.elementonwater(elementnotondomain)=1;
+-
+-%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
+-pos=find(~md.mask.elementonwater);
+-numpos=unique(md.mesh.elements(pos,:));
+-nodes=setdiff(1:1:md.mesh.numberofvertices,numpos);
+-md.diagnostic.spcvx(nodes)=md.inversion.vx_obs(nodes);
+-md.diagnostic.spcvy(nodes)=md.inversion.vy_obs(nodes);
+-
+-%make sure any node with NaN velocity is spc'd:
+-%we spc to the smoothed value, so that control methods don't go berserk trying to figure out what reaction force to apply for the spc to stand.
+-pos=find(isnan(md.inversion.vel_obs_raw));
+-md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos); 
+-md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos); 
+-
+-%iceshelves: any vertex on floating ice is spc'd
+-pos=find(md.mask.vertexongroundedice);
+-md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos); 
+-md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos); 
+-
+-%make sure icefronts that are completely spc'd are taken out:
+-free_segments=find((~isnan(md.diagnostic.spcvx(md.diagnostic.icefront(:,1:2))) + ~isnan(md.diagnostic.spcvy(md.diagnostic.icefront(:,1:2))) )~=2);
+-md.diagnostic.icefront=md.diagnostic.icefront(free_segments,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/averaging.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/averaging.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/averaging.m	(revision 13005)
+@@ -1,90 +0,0 @@
+-function average=averaging(md,data,iterations,varargin)
+-%AVERAGING - smooths the input over the mesh
+-%
+-%   This routine takes a list over the elements or the nodes in input
+-%   and return a list over the nodes.
+-%   For each iterations it computes the average over each element (average 
+-%   of the vertices values) and then computes the average over each node
+-%   by taking the average of the element around a node weighted by the
+-%   elements volume
+-%   For 3d mesh, a last argument can be added to specify the layer to be averaged on.
+-%
+-%   Usage:
+-%      smoothdata=averaging(md,data,iterations)
+-%      smoothdata=averaging(md,data,iterations,layer)
+-%
+-%   Examples:
+-%      velsmoothed=averaging(md,md.initialization.vel,4);
+-%      pressure=averaging(md,md.initialization.pressure,0);
+-%      temperature=averaging(md,md.initialization.temperature,1,1);
+-
+-if ((nargin~=4) & (nargin~=3)),
+-	error('averaging error message');
+-end
+-if (length(data)~=md.mesh.numberofelements & length(data)~=md.mesh.numberofvertices),
+-	error('averaging error message: data not supported yet');
+-end
+-if md.mesh.dimension==3 & nargin==4,
+-	if varargin{1}<=0 | varargin{1}>md.mesh.numberoflayers,
+-		error('layer should be between 1 and md.mesh.numberoflayers');
+-	end
+-	layer=varargin{1};
+-else
+-	layer=0;
+-end
+-
+-%initialization
+-if layer==0,
+-	weights=zeros(md.mesh.numberofvertices,1);
+-	data=data(:);
+-else 
+-	weights=zeros(md.mesh.numberofvertices2d,1);
+-	data=data((layer-1)*md.mesh.numberofvertices2d+1:layer*md.mesh.numberofvertices2d,:);
+-end
+-
+-%load some variables (it is much faster if the variabes are loaded from md once for all)
+-if layer==0,
+-	index=md.mesh.elements;
+-	numberofnodes=md.mesh.numberofvertices;
+-	numberofelements=md.mesh.numberofelements;
+-else
+-	index=md.mesh.elements2d;
+-	numberofnodes=md.mesh.numberofvertices2d;
+-	numberofelements=md.mesh.numberofelements2d;
+-end
+-
+-%build some variables
+-line=index(:);
+-if md.mesh.dimension==3 & layer==0,
+-	rep=6;
+-	areas=GetAreas(index,md.mesh.x,md.mesh.y,md.mesh.z);
+-elseif md.mesh.dimension==2,
+-	rep=3;
+-	areas=GetAreas(index,md.mesh.x,md.mesh.y);
+-else
+-	rep=3;
+-	areas=GetAreas(index,md.mesh.x2d,md.mesh.y2d);
+-end
+-summation=1/rep*ones(rep,1);
+-linesize=rep*numberofelements;
+-
+-%update weights that holds the volume of all the element holding the node i
+-weights=sparse(line,ones(linesize,1),repmat(areas,rep,1),numberofnodes,1);
+-
+-%initialization
+-if length(data)==numberofelements
+-	average_node=sparse(line,ones(linesize,1),repmat(areas.*data,rep,1),numberofnodes,1);
+-	average_node=average_node./weights;
+-else
+-	average_node=data;
+-end
+-
+-%loop over iteration
+-for i=1:iterations
+-	average_el=average_node(index)*summation;
+-	average_node=sparse(line,ones(linesize,1),repmat(areas.*average_el,rep,1),numberofnodes,1);
+-	average_node=average_node./weights;
+-end
+-
+-%return output as a full matrix (C code do not like sparse matrices)
+-average=full(average_node);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/averageconnectivity.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/averageconnectivity.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/averageconnectivity.m	(revision 13005)
+@@ -1,11 +0,0 @@
+-function conn=averageconnectivity(md)
+-%AVERAGECONNECTIVITY - computes the average connectivity of a model
+-%
+-%   Usage:
+-%      connectivity=averageconnectivity(md);
+-
+-nnz=0;
+-for i=1:md.mesh.numberofvertices,
+-	nnz=nnz+length(find(md.mesh.elements==i));
+-end
+-conn=nnz/md.mesh.numberofvertices;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/BasinConstrain.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/BasinConstrain.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/BasinConstrain.m	(revision 13005)
+@@ -1,63 +0,0 @@
+-function md=BasinConstrain(md,domain);
+-%BASINCONSTRAIN - constrain basin
+-%
+-%   Constrain basin using a constraint domain outline, 
+-%   to dirichlet boundary conditions.
+-%   constraindomain is an Argus domain outline file enclosing 
+-%   the geographical area of interest.
+-%
+-%   Usage: 
+-%      md=BasinConstrain(md,constraindomain)
+-%
+-%   Example:
+-%      md=BasinConstrain(md,'DomainOutline.exp');
+-%      md=BasinConstrain(md,'~Iceshelves.exp');
+-
+-%now, flag nodes and elements outside the domain outline.
+-if ischar(domain),
+-	if isempty(domain),
+-		elementondomain=zeros(md.mesh.numberofelements,1);
+-		vertexondomain=zeros(md.mesh.numberofvertices,1);
+-		invert=0;
+-	elseif strcmpi(domain,'all')
+-		elementondomain=ones(md.mesh.numberofelements,1);
+-		vertexondomain=ones(md.mesh.numberofvertices,1);
+-		invert=0;
+-	else
+-		%make sure that we actually don't want the elements outside the domain outline!
+-		if strcmpi(domain(1),'~'),
+-			domain=domain(2:end);
+-			invert=1;
+-		else
+-			invert=0;
+-		end
+-		%ok, flag elements and nodes
+-		[vertexondomain elementondomain]=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,domain,'element and node',2);
+-	end
+-	if invert,
+-		vertexondomain=~vertexondomain;
+-		elementondomain=~elementondomain;
+-	end
+-else
+-	error('BasinConstrain error message: domain type not supported yet');
+-end
+-
+-%list of elements and nodes not on domain
+-vertexnotondomain=find(~vertexondomain);
+-elementnotondomain=find(~elementondomain);
+-
+-%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
+-md.diagnostic.spcvx(vertexnotondomain)=md.inversion.vx_obs(vertexnotondomain);
+-md.diagnostic.spcvy(vertexnotondomain)=md.inversion.vy_obs(vertexnotondomain);
+-md.mask.elementonwater(elementnotondomain)=1;
+-
+-%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
+-pos=find(~md.mask.elementonwater);
+-numpos=unique(md.mesh.elements(pos,:));
+-nodes=setdiff(1:1:md.mesh.numberofvertices,numpos);
+-md.diagnostic.spcvx(nodes)=md.inversion.vx_obs(nodes);
+-md.diagnostic.spcvy(nodes)=md.inversion.vy_obs(nodes);
+-
+-%make sure icefronts that are completely spc'd are taken out:
+-free_segments=find((~isnan(md.diagnostic.spcvx(md.diagnostic.icefront(:,1:2))) + ~isnan(md.diagnostic.spcvy(md.diagnostic.icefront(:,1:2))))~=2);
+-md.diagnostic.icefront=md.diagnostic.icefront(free_segments,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.py	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.py	(revision 13005)
+@@ -1,5 +1,64 @@
+ from AnalysisConfiguration import *
++from EnumDefinitions import *
+ 
++def AnalysisConfiguration(solutiontype): #{{{
++	"""
++	ANALYSISCONFIGURATION - return type of analyses, number of analyses 
++
++		Usage:
++			[analyses, numanalyses]=AnalysisConfiguration(solutiontype);
++	"""
++
++	if   solutiontype == DiagnosticSolutionEnum:
++		numanalyses=5
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum]
++
++	elif solutiontype == SteadystateSolutionEnum:
++		numanalyses=7 
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum]
++
++	elif solutiontype == ThermalSolutionEnum:
++		numanalyses=2 
++		analyses=[ThermalAnalysisEnum,MeltingAnalysisEnum]
++
++	elif solutiontype == EnthalpySolutionEnum:
++		numanalyses=1 
++		analyses=[EnthalpyAnalysisEnum]
++
++	elif solutiontype == PrognosticSolutionEnum:
++		numanalyses=1 
++		analyses=[PrognosticAnalysisEnum]
++
++	elif solutiontype == BalancethicknessSolutionEnum:
++		numanalyses=1 
++		analyses=[BalancethicknessAnalysisEnum]
++
++	elif solutiontype == SurfaceSlopeSolutionEnum:
++		numanalyses=1 
++		analyses=[SurfaceSlopeAnalysisEnum]
++
++	elif solutiontype == BedSlopeSolutionEnum:
++		numanalyses=1 
++		analyses=[BedSlopeAnalysisEnum]
++
++	elif solutiontype == TransientSolutionEnum:
++		numanalyses=9 
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum,EnthalpyAnalysisEnum,PrognosticAnalysisEnum]
++
++	elif solutiontype == FlaimSolutionEnum:
++		numanalyses=1 
++		analyses=[FlaimAnalysisEnum]
++
++	elif solutiontype == HydrologySolutionEnum:
++		numanalyses=3 
++		analyses=[BedSlopeAnalysisEnum,SurfaceSlopeAnalysisEnum,HydrologyAnalysisEnum]
++
++	else:
++		raise TypeError("solution type: '%s' not supported yet!" % EnumToString(solutiontype))
++
++	return analyses,numanalyses
++#}}}
++
+ def ismodelselfconsistent(md):
+ 	"""
+ 	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.m	(revision 13004)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.m	(revision 13005)
+@@ -38,3 +38,63 @@
+ if md.private.isconsistent==false,
+ 	error('Model not consistent, see messages above');
+ end
++end
++
++function [analyses,numanalyses]=AnalysisConfiguration(solutiontype), % {{{
++%ANALYSISCONFIGURATION - return type of analyses, number of analyses 
++%
++%   Usage:
++%      [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
++
++
++
++switch solutiontype,
++
++	case DiagnosticSolutionEnum,
++		numanalyses=5;
++		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum];
++
++	case SteadystateSolutionEnum,
++		numanalyses=7; 
++		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum];
++
++	case ThermalSolutionEnum,
++		numanalyses=2; 
++		analyses=[ThermalAnalysisEnum;MeltingAnalysisEnum];
++
++	case EnthalpySolutionEnum,
++		numanalyses=1; 
++		analyses=[EnthalpyAnalysisEnum];
++
++	case PrognosticSolutionEnum,
++		numanalyses=1; 
++		analyses=[PrognosticAnalysisEnum];
++
++	case BalancethicknessSolutionEnum,
++		numanalyses=1; 
++		analyses=[BalancethicknessAnalysisEnum];
++
++	case SurfaceSlopeSolutionEnum,
++		numanalyses=1; 
++		analyses=[SurfaceSlopeAnalysisEnum];
++
++	case BedSlopeSolutionEnum,
++		numanalyses=1; 
++		analyses=[BedSlopeAnalysisEnum];
++
++	case TransientSolutionEnum,
++		numanalyses=9; 
++		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;EnthalpyAnalysisEnum;PrognosticAnalysisEnum];
++
++	case FlaimSolutionEnum,
++		numanalyses=1; 
++		analyses=[FlaimAnalysisEnum];
++
++	case HydrologySolutionEnum,
++		numanalyses=3; 
++		analyses=[BedSlopeAnalysisEnum;SurfaceSlopeAnalysisEnum;HydrologyAnalysisEnum];
++
++	otherwise
++		error('%s%s%s',' solution type: ',EnumToString(solutiontype),' not supported yet!');
++
++end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrain.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrain.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrain.m	(revision 13005)
+@@ -0,0 +1,63 @@
++function md=BasinConstrain(md,domain);
++%BASINCONSTRAIN - constrain basin
++%
++%   Constrain basin using a constraint domain outline, 
++%   to dirichlet boundary conditions.
++%   constraindomain is an Argus domain outline file enclosing 
++%   the geographical area of interest.
++%
++%   Usage: 
++%      md=BasinConstrain(md,constraindomain)
++%
++%   Example:
++%      md=BasinConstrain(md,'DomainOutline.exp');
++%      md=BasinConstrain(md,'~Iceshelves.exp');
++
++%now, flag nodes and elements outside the domain outline.
++if ischar(domain),
++	if isempty(domain),
++		elementondomain=zeros(md.mesh.numberofelements,1);
++		vertexondomain=zeros(md.mesh.numberofvertices,1);
++		invert=0;
++	elseif strcmpi(domain,'all')
++		elementondomain=ones(md.mesh.numberofelements,1);
++		vertexondomain=ones(md.mesh.numberofvertices,1);
++		invert=0;
++	else
++		%make sure that we actually don't want the elements outside the domain outline!
++		if strcmpi(domain(1),'~'),
++			domain=domain(2:end);
++			invert=1;
++		else
++			invert=0;
++		end
++		%ok, flag elements and nodes
++		[vertexondomain elementondomain]=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,domain,'element and node',2);
++	end
++	if invert,
++		vertexondomain=~vertexondomain;
++		elementondomain=~elementondomain;
++	end
++else
++	error('BasinConstrain error message: domain type not supported yet');
++end
++
++%list of elements and nodes not on domain
++vertexnotondomain=find(~vertexondomain);
++elementnotondomain=find(~elementondomain);
++
++%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
++md.diagnostic.spcvx(vertexnotondomain)=md.inversion.vx_obs(vertexnotondomain);
++md.diagnostic.spcvy(vertexnotondomain)=md.inversion.vy_obs(vertexnotondomain);
++md.mask.elementonwater(elementnotondomain)=1;
++
++%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
++pos=find(~md.mask.elementonwater);
++numpos=unique(md.mesh.elements(pos,:));
++nodes=setdiff(1:1:md.mesh.numberofvertices,numpos);
++md.diagnostic.spcvx(nodes)=md.inversion.vx_obs(nodes);
++md.diagnostic.spcvy(nodes)=md.inversion.vy_obs(nodes);
++
++%make sure icefronts that are completely spc'd are taken out:
++free_segments=find((~isnan(md.diagnostic.spcvx(md.diagnostic.icefront(:,1:2))) + ~isnan(md.diagnostic.spcvy(md.diagnostic.icefront(:,1:2))))~=2);
++md.diagnostic.icefront=md.diagnostic.icefront(free_segments,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrainShelf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrainShelf.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrainShelf.m	(revision 13005)
+@@ -0,0 +1,74 @@
++function md=BasinConstrainShelf(md,domain);
++%BASINCONSTRAIN - constrain basin
++%
++%   Constrain basin using a constraint domain outline, 
++%   to dirichlet boundary conditions.
++%   constraindomain is an Argus domain outline file enclosing 
++%   the geographical area of interest.
++%
++%   Usage: 
++%      md=BasinConstrain(md,constraindomain)
++%
++%   Example:
++%      md=BasinConstrain(md,'DomainOutline.exp');
++%      md=BasinConstrain(md,'~Iceshelves.exp');
++
++%now, flag nodes and elements outside the domain outline.
++if ischar(domain),
++	if isempty(domain),
++		elementondomain=zeros(md.mesh.numberofelements,1);
++		vertexondomain=zeros(md.mesh.numberofvertices,1);
++		invert=0;
++	elseif strcmpi(domain,'all')
++		elementondomain=ones(md.mesh.numberofelements,1);
++		vertexondomain=ones(md.mesh.numberofvertices,1);
++		invert=0;
++	else
++		%make sure that we actually don't want the elements outside the domain outline!
++		if strcmpi(domain(1),'~'),
++			domain=domain(2:end);
++			invert=1;
++		else
++			invert=0;
++		end
++		%ok, flag elements and nodes
++		[vertexondomain elementondomain]=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,domain,'element and node',2);
++	end
++	if invert,
++		vertexondomain=~vertexondomain;
++		elementondomain=~elementondomain;
++	end
++else
++	error('BasinConstrain error message: domain type not supported yet');
++end
++
++%list of elements and nodes not on domain
++vertexnotondomain=find(~vertexondomain);
++elementnotondomain=find(~elementondomain);
++
++%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
++md.diagnostic.spcvx(vertexnotondomain)=md.inversion.vx_obs(vertexnotondomain);
++md.diagnostic.spcvy(vertexnotondomain)=md.inversion.vy_obs(vertexnotondomain);
++md.mask.elementonwater(elementnotondomain)=1;
++
++%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
++pos=find(~md.mask.elementonwater);
++numpos=unique(md.mesh.elements(pos,:));
++nodes=setdiff(1:1:md.mesh.numberofvertices,numpos);
++md.diagnostic.spcvx(nodes)=md.inversion.vx_obs(nodes);
++md.diagnostic.spcvy(nodes)=md.inversion.vy_obs(nodes);
++
++%make sure any node with NaN velocity is spc'd:
++%we spc to the smoothed value, so that control methods don't go berserk trying to figure out what reaction force to apply for the spc to stand.
++pos=find(isnan(md.inversion.vel_obs_raw));
++md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos); 
++md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos); 
++
++%iceshelves: any vertex on floating ice is spc'd
++pos=find(md.mask.vertexongroundedice);
++md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos); 
++md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos); 
++
++%make sure icefronts that are completely spc'd are taken out:
++free_segments=find((~isnan(md.diagnostic.spcvx(md.diagnostic.icefront(:,1:2))) + ~isnan(md.diagnostic.spcvy(md.diagnostic.icefront(:,1:2))) )~=2);
++md.diagnostic.icefront=md.diagnostic.icefront(free_segments,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/averaging.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/averaging.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/averaging.m	(revision 13005)
+@@ -0,0 +1,90 @@
++function average=averaging(md,data,iterations,varargin)
++%AVERAGING - smooths the input over the mesh
++%
++%   This routine takes a list over the elements or the nodes in input
++%   and return a list over the nodes.
++%   For each iterations it computes the average over each element (average 
++%   of the vertices values) and then computes the average over each node
++%   by taking the average of the element around a node weighted by the
++%   elements volume
++%   For 3d mesh, a last argument can be added to specify the layer to be averaged on.
++%
++%   Usage:
++%      smoothdata=averaging(md,data,iterations)
++%      smoothdata=averaging(md,data,iterations,layer)
++%
++%   Examples:
++%      velsmoothed=averaging(md,md.initialization.vel,4);
++%      pressure=averaging(md,md.initialization.pressure,0);
++%      temperature=averaging(md,md.initialization.temperature,1,1);
++
++if ((nargin~=4) & (nargin~=3)),
++	error('averaging error message');
++end
++if (length(data)~=md.mesh.numberofelements & length(data)~=md.mesh.numberofvertices),
++	error('averaging error message: data not supported yet');
++end
++if md.mesh.dimension==3 & nargin==4,
++	if varargin{1}<=0 | varargin{1}>md.mesh.numberoflayers,
++		error('layer should be between 1 and md.mesh.numberoflayers');
++	end
++	layer=varargin{1};
++else
++	layer=0;
++end
++
++%initialization
++if layer==0,
++	weights=zeros(md.mesh.numberofvertices,1);
++	data=data(:);
++else 
++	weights=zeros(md.mesh.numberofvertices2d,1);
++	data=data((layer-1)*md.mesh.numberofvertices2d+1:layer*md.mesh.numberofvertices2d,:);
++end
++
++%load some variables (it is much faster if the variabes are loaded from md once for all)
++if layer==0,
++	index=md.mesh.elements;
++	numberofnodes=md.mesh.numberofvertices;
++	numberofelements=md.mesh.numberofelements;
++else
++	index=md.mesh.elements2d;
++	numberofnodes=md.mesh.numberofvertices2d;
++	numberofelements=md.mesh.numberofelements2d;
++end
++
++%build some variables
++line=index(:);
++if md.mesh.dimension==3 & layer==0,
++	rep=6;
++	areas=GetAreas(index,md.mesh.x,md.mesh.y,md.mesh.z);
++elseif md.mesh.dimension==2,
++	rep=3;
++	areas=GetAreas(index,md.mesh.x,md.mesh.y);
++else
++	rep=3;
++	areas=GetAreas(index,md.mesh.x2d,md.mesh.y2d);
++end
++summation=1/rep*ones(rep,1);
++linesize=rep*numberofelements;
++
++%update weights that holds the volume of all the element holding the node i
++weights=sparse(line,ones(linesize,1),repmat(areas,rep,1),numberofnodes,1);
++
++%initialization
++if length(data)==numberofelements
++	average_node=sparse(line,ones(linesize,1),repmat(areas.*data,rep,1),numberofnodes,1);
++	average_node=average_node./weights;
++else
++	average_node=data;
++end
++
++%loop over iteration
++for i=1:iterations
++	average_el=average_node(index)*summation;
++	average_node=sparse(line,ones(linesize,1),repmat(areas.*average_el,rep,1),numberofnodes,1);
++	average_node=average_node./weights;
++end
++
++%return output as a full matrix (C code do not like sparse matrices)
++average=full(average_node);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/basalstress.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/basalstress.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/basalstress.m	(revision 13005)
+@@ -0,0 +1,22 @@
++function [bx by b]=basalstress(md)
++%BASALSTRESS - compute basal stress from basal drag and geometric information. 
++%
++%   Usage:
++%      [bx by b]=basalstress(md);
++%
++%   See also: plot_basaldrag
++
++
++%compute exponents
++s=averaging(md,1./md.friction.p,0);
++r=averaging(md,md.friction.q./md.friction.p,0);
++
++%compute horizontal velocity
++ub=sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
++ubx=md.initialization.vx/md.constants.yts;
++uby=md.initialization.vy/md.constants.yts;
++
++%compute basal drag
++bx=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*ubx.^s;
++by=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*uby.^s;
++b=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*ub.^s;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/mechanicalproperties.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/mechanicalproperties.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/mechanicalproperties.m	(revision 13005)
+@@ -0,0 +1,118 @@
++function md=mechanicalproperties(md,vx,vy)
++%MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
++%
++%   this routine computes the components of the stress tensor
++%   strain rate tensor and their respective principal directions.
++%   the results are in the model md: md.results
++%
++%   Usage:
++%      md=mechanicalproperties(md,vx,vy)
++%
++%   Example:
++%      md=mechanicalproperties(md,md.initialization.vx,md.initialization.vy);
++%      md=mechanicalproperties(md,md.inversion.vx_obs,md.inversion.vy_obs);
++
++%some checks
++if length(vx)~=md.mesh.numberofvertices | length(vy)~=md.mesh.numberofvertices,
++	error(['the input velocity should be of size ' num2str(md.mesh.numberofvertices) '!'])
++end
++if ~(md.mesh.dimension==2)
++	error('only 2d model supported yet');
++end
++if any(md.flowequation.element_equation~=2),
++	disp('Warning: the model has some non macayeal elements. These will be treated like MacAyeal''s elements');
++end
++
++%initialization
++numberofelements=md.mesh.numberofelements;
++index=md.mesh.elements;
++summation=[1;1;1];
++directionsstress=zeros(numberofelements,4);
++directionsstrain=zeros(numberofelements,4);
++valuesstress=zeros(numberofelements,2);
++valuesstrain=zeros(numberofelements,2);
++
++%compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
++[alpha beta]=GetNodalFunctionsCoeff(index,md.mesh.x,md.mesh.y);
++
++%compute shear
++vxlist=vx(index)/md.constants.yts;
++vylist=vy(index)/md.constants.yts;
++ux=(vxlist.*alpha)*summation;
++uy=(vxlist.*beta)*summation;
++vx=(vylist.*alpha)*summation;
++vy=(vylist.*beta)*summation;						
++uyvx=(vx+uy)./2;
++clear vxlist vylist
++
++%compute viscosity
++nu=zeros(numberofelements,1);
++B_bar=md.materials.rheology_B(index)*summation/3;
++power=(md.materials.rheology_n-1)./(2*md.materials.rheology_n);
++second_inv=(ux.^2+vy.^2+((uy+vx).^2)/4+ux.*vy);
++%some corrections
++location=find(second_inv~=0);
++nu(location)=B_bar(location)./(second_inv(location).^power(location));
++location=find(second_inv==0 & power~=0);
++nu(location)=10^18; 	%arbitrary maximum viscosity to apply where there is no effective shear
++location=find(second_inv==0 & power==0);
++nu(location)=B_bar(location);
++clear B_bar location second_inv power
++
++%compute stress
++tau_xx=nu.*ux;
++tau_yy=nu.*vy;
++tau_xy=nu.*uyvx;
++
++%compute principal properties of stress
++for i=1:numberofelements,
++
++	%compute stress and strainrate matrices
++	stress=[tau_xx(i) tau_xy(i)
++	tau_xy(i)  tau_yy(i)];
++	strain=[ux(i) uyvx(i)
++	uyvx(i)  vy(i)];
++
++	%eigen values and vectors
++	[directions,value]=eig(stress);
++	valuesstress(i,:)=[value(1,1) value(2,2)];
++	directionsstress(i,:)=directions(:)';
++	[directions,value]=eig(strain);
++	valuesstrain(i,:)=[value(1,1) value(2,2)];
++	directionsstrain(i,:)=directions(:)';
++end
++
++%plug onto the model
++%NB: Matlab sorts the eigen value in increasing order, we want the reverse
++stress=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
++stress.xx=tau_xx;
++stress.yy=tau_yy;
++stress.xy=tau_xy;
++stress.principalvalue2=valuesstress(:,1);
++stress.principalaxis2=directionsstress(:,1:2);
++stress.principalvalue1=valuesstress(:,2);
++stress.principalaxis1=directionsstress(:,3:4);
++stress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+2*stress.xy.^2);
++md.results.stress=stress;
++
++strainrate=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
++strainrate.xx=ux;
++strainrate.yy=vy;
++strainrate.xy=uyvx;
++strainrate.principalvalue2=valuesstrain(:,1)*(365.25*24*3600); %strain rate in 1/a instead of 1/s
++strainrate.principalaxis2=directionsstrain(:,1:2);
++strainrate.principalvalue1=valuesstrain(:,2)*(365.25*24*3600); %strain rate in 1/a instead of 1/s
++strainrate.principalaxis1=directionsstrain(:,3:4);
++strainrate.effectivevalue=1/sqrt(2)*sqrt(strainrate.xx.^2+strainrate.yy.^2+2*strainrate.xy.^2);
++md.results.strainrate=strainrate;
++
++deviatoricstress=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
++deviatoricstress.xx=tau_xx;
++deviatoricstress.yy=tau_yy;
++deviatoricstress.xy=tau_xy;
++deviatoricstress.principalvalue2=valuesstress(:,1);
++deviatoricstress.principalaxis2=directionsstress(:,1:2);
++deviatoricstress.principalvalue1=valuesstress(:,2);
++deviatoricstress.principalaxis1=directionsstress(:,3:4);
++deviatoricstress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+2*stress.xy.^2);
++md.results.deviatoricstress=deviatoricstress;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13005-13006.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13005-13006.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13005-13006.diff	(revision 13394)
@@ -0,0 +1,4041 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.py	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.py	(revision 13006)
+@@ -1,235 +0,0 @@
+-import struct
+-import numpy
+-from MatlabFuncs import *
+-from MatlabProcessPatch import *
+-
+-def parseresultsfromdisk(filename,iosplit):
+-	"""
+-	PARSERESULTSFROMDISK - ...
+-
+-	   Usage:
+-	      results=parseresultsfromdisk(filename,iosplit)
+-	"""
+-
+-	if iosplit:
+-		results=parseresultsfromdiskiosplit(filename)
+-	else:
+-		results=parseresultsfromdiskioserial(filename)
+-
+-	#process patch if necessary
+-	results=MatlabProcessPatch(results)
+-
+-	return results
+-
+-def parseresultsfromdiskioserial(filename):    # {{{
+-	"""
+-	PARSERESULTSFROMDISK - ...
+-	 
+-	    Usage:
+-	       results=parseresultsfromdiskioserial(filename)
+-	"""
+-
+-	#Open file
+-	try:
+-		fid=open(filename,'rb')
+-	except IOError as e:
+-		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
+-
+-	results={}
+-
+-	#Read fields until the end of the file.
+-	result=ReadData(fid)
+-	while result:
+-		#Get time and step
+-		if not result['step'] in results:
+-			results[result['step']]={}
+-			results[result['step']]['step']=result['step']
+-			results[result['step']]['time']=result['time'] 
+-	
+-		#Add result
+-		if result['step'] in results and \
+-		   result['fieldname'] in results[result['step']] and \
+-		   not strcmp(result['fieldname'],'SolutionType'):
+-			results[result['step']][result['fieldname']]=numpy.concatenate((results[result['step']][result['fieldname']],result['field']),axis=0)
+-		else:
+-			results[result['step']][result['fieldname']]=result['field']
+-
+-		#read next result
+-		result=ReadData(fid)
+-
+-	fid.close()
+-
+-	return results
+-	# }}}
+-
+-def parseresultsfromdiskiosplit(filename):    # {{{
+-	"""
+-	PARSERESULTSFROMDISKIOSPLIT - ...
+-	 
+-	    Usage:
+-	       results=parseresultsfromdiskiosplit(filename)
+-	"""
+-
+-	#Open file
+-	try:
+-		fid=open(filename,'rb')
+-	except IOError as e:
+-		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
+-
+-	results={}
+-
+-	#if we have done split I/O, ie, we have results that are fragmented across patches, 
+-	#do a first pass, and figure out the structure of results
+-	result=ReadDataDimensions(fid)
+-	while result:
+-
+-		#Get time and step
+-		if not result['step'] in results:
+-			results[result['step']]={}
+-			results[result['step']]['step']=result['step']
+-			results[result['step']]['time']=result['time'] 
+-
+-		#Add result
+-		if strcmpi(result['fieldname'],'Patch'):
+-			results[result['step']][result['fieldname']]=[0,result['N']]
+-		else:
+-			results[result['step']][result['fieldname']]=float('NaN')
+-
+-		#read next result
+-		result=ReadDataDimensions(fid)
+-
+-	#do a second pass, and figure out the size of the patches
+-	fid.seek(0)    #rewind
+-	result=ReadDataDimensions(fid)
+-	while result:
+-
+-		#Add result
+-		if strcmpi(result['fieldname'],'Patch'):
+-			patchdimensions=results[result['step']][result['fieldname']]
+-			results[result['step']][result['fieldname']]=[patchdimensions[0]+result['M'],result['N']]
+-
+-		#read next result
+-		result=ReadDataDimensions(fid)
+-
+-	#allocate patches
+-	for result in results.itervalues():
+-		if 'Patch' in result:
+-			result['Patch']=numpy.zeros(shape=(result['Patch'][0],result['Patch'][1]),dtype=float)
+-			result['counter']=0    #use to index into the patch
+-
+-	#third pass, this time to read the real information
+-	fid.seek(0)    #rewind
+-	result=ReadData(fid)
+-	while result:
+-
+-		#Get time and step
+-		if not result['step'] in results:
+-			results[result['step']]={}
+-			results[result['step']]['step']=result['step']
+-			results[result['step']]['time']=result['time'] 
+-
+-		#Add result
+-		if strcmpi(result['fieldname'],'Patch'):
+-			counter=results[result['step']]['counter']
+-			counter2=counter+result['field'].shape[0]-1
+-			results[result['step']][result['fieldname']][counter:counter2,:]=result['field']
+-
+-			#increment counter: 
+-			results[result['step']]['counter']=counter2+1
+-		else:
+-			results[result['step']][result['fieldname']]=result['field']
+-
+-		#read next result
+-		result=ReadData(fid)
+-
+-	#close file
+-	fid.close()
+-
+-	return results
+-	# }}}
+-
+-def ReadData(fid):    # {{{
+-	"""
+-	READDATA - ...
+-	 
+-	    Usage:
+-	       field=ReadData(fid)
+-	"""
+-
+-	#read field
+-	try:
+-		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-
+-		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
+-		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
+-		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-
+-		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-		if   type==1:
+-			field=numpy.array(struct.unpack('%dd' % M,fid.read(M*struct.calcsize('d'))),dtype=float)
+-		elif type==2:
+-			field=struct.unpack('%ds' % M,fid.read(M))[0][:-1]
+-		elif type==3:
+-			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-#			field=transpose(fread(fid,[N M],'double'));
+-			field=numpy.zeros(shape=(M,N),dtype=float)
+-			for i in xrange(M):
+-				field[i,:]=struct.unpack('%dd' % N,fid.read(N*struct.calcsize('d')))
+-		else:
+-			raise TypeError("cannot read data of type %d" % type)
+-
+-		result={}
+-		result['fieldname']=fieldname
+-		result['time']=time
+-		result['step']=step
+-		result['field']=field
+-
+-	except struct.error as e:
+-		result={}
+-
+-	return result
+-	# }}}
+-
+-def ReadDataDimensions(fid):    # {{{
+-	"""
+-	READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
+-	 
+-	    Usage:
+-	       field=ReadDataDimensions(fid)
+-	"""
+-
+-	#read field
+-	try:
+-		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-
+-		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
+-		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
+-		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-
+-		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-		N=1    #default
+-		if   type==1:
+-			fid.seek(M*8,1)
+-		elif type==2:
+-			fid.seek(M,1)
+-		elif type==3:
+-			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-			fid.seek(N*M*8,1)
+-		else:
+-			raise TypeError("cannot read data of type %d" % type)
+-
+-		result={}
+-		result['fieldname']=fieldname
+-		result['time']=time
+-		result['step']=step
+-		result['M']=M
+-		result['N']=N
+-
+-	except struct.error as e:
+-		result={}
+-
+-	return result
+-	# }}}
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parametercontroloptimization.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parametercontroloptimization.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parametercontroloptimization.m	(revision 13006)
+@@ -1,70 +0,0 @@
+-function md=parametercontroloptimization(md,varargin),
+-%PARAMETERCONTROLOPTIMIZATION - parameterization for control method on drag
+-%
+-%   It is possible to specify the number of steps, values for the
+-%   minimum and maximum values of the drag, specify the 
+-%   kind of fit to use or the the optscal.
+-%   
+-%   Usage:
+-%       md=parametercontroloptimization(md,varargin)
+-%
+-%   Example:
+-%      md=parametercontroloptimization(md,'nsteps',6)
+-
+-%process options
+-options=pairoptions(varargin{:});
+-
+-%Copy model
+-md2=md;
+-
+-%Hard coded parameters
+-%variable
+-cmax_max=1000;
+-cm_maxs=linspace(cmax_max/10,cmax_max,3);
+-optscal_max=1000;
+-optscals=linspace(optscal_max/10,optscal_max,3);
+-fits=[0 2];
+-%Kept constant
+-md2.verbose=0;
+-md2.cm_min=1;
+-md2.eps_cm=NaN;
+-md2.nsteps=getfieldvalue(options,'nsteps',5);
+-md2.inversion.control_parameters=getfieldvalue(options,'md2.inversion.control_parameters',{'FrictionCoefficient'});
+-md2.maxiter=10*ones(md2.nsteps,1);
+-md2.cm_jump=0.99*ones(md2.nsteps,1);
+-md2.inversion.iscontrol=1;
+-md2.weights=ones(md2.numberofnodes,1);
+-
+-%loop over the set of parameters
+-best=0;
+-count=1;
+-for fit=fits,
+-	md2.fit=fit*ones(md2.nsteps,1);
+-	for cm_max=cm_maxs;
+-		md2.cm_max=cm_max;
+-		for optscal=optscals;
+-			md2.optscal=optscal*ones(md2.nsteps,1);
+-
+-			%current run
+-			disp(sprintf('\n   Step %i/%i, fit=%i, cm_max=%g, optscal=%g\n',count,length(cm_maxs)*length(optscals)*length(fits),fit,cm_max,optscal))
+-			md2=solve(md2,'analysis_type','DiagnosticAnalysis');
+-			count=count+1;
+-
+-			%Check misfit difference
+-			rel=(md2.results.DiagnosticAnalysis.J(1)-md2.results.DiagnosticAnalysis.J(end))/md2.results.DiagnosticAnalysis.J(1);
+-			disp(['   ΔJ/J=' num2str(rel*100) '% for fit=' num2str(fit) ',cm_max=' num2str(cm_max) ', and optscal=' num2str(optscal) ]);
+-			if (rel>best),
+-				disp(sprintf('   --> current best'))
+-				fit_final    =md2.fit;
+-				cmmax_final  =md2.cm_max;
+-				optscal_final=md2.optscal;
+-				best=rel;
+-			end
+-		end
+-	end
+-end
+-
+-%load final parameters onto initial model
+-md.fit    =fit_final;
+-md.inversion.max_parameters =cmmax_final;
+-md.inversion.gradient_scaling=optscal_final;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parseresultsfromdisk.m	(revision 13006)
+@@ -1,212 +0,0 @@
+-function results=parseresultsfromdisk(filename,iosplit)
+-%PARSERESULTSFROMDISK - ...
+-%
+-%   Usage:
+-%      results=parseresultsfromdisk(filename,iosplit)
+-
+-if iosplit,
+-	results=parseresultsfromdiskiosplit(filename);
+-else
+-	results=parseresultsfromdiskioserial(filename);
+-end
+-
+-%process patch if necessary
+-results=MatlabProcessPatch(results);
+-
+-function results=parseresultsfromdiskioserial(filename) % {{{
+-%PARSERESULTSFROMDISK - ...
+-%
+-%   Usage:
+-%      results=parseresultsfromdiskioserial(filename)
+-
+-
+-%Open file
+-fid=fopen(filename,'rb');
+-if(fid==-1),
+-	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
+-end
+-results=struct();
+-
+-%Read fields until the end of the file.
+-result=ReadData(fid);
+-while ~isempty(result), 
+-	%Get time and step
+-	results(result.step).step=result.step;
+-	results(result.step).time=result.time; 
+-
+-	%Add result
+-	if (length(results)>=result.step & isfield(results,result.fieldname) & ~strcmp(result.fieldname,'SolutionType')),
+-			results(result.step).(result.fieldname)=[ results(result.step).(result.fieldname); result.field];
+-	else
+-		results(result.step).(result.fieldname)=result.field;
+-	end
+-
+-	%read next result
+-	result=ReadData(fid);
+-
+-end
+-
+-fclose(fid);
+-% }}}
+-function results=parseresultsfromdiskiosplit(filename) % {{{
+-%PARSERESULTSFROMDISKIOSPLIT - ...
+-%
+-%   Usage:
+-%      results=parseresultsfromdiskiosplit(filename)
+-
+-
+-%Open file
+-fid=fopen(filename,'rb');
+-if(fid==-1),
+-	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
+-end
+-results=struct();
+-
+-%if we have done split I/O, ie, we have results that are fragmented across patches, 
+-%do a first pass, and figure out the structure of results
+-result=ReadDataDimensions(fid);
+-while ~isempty(result),
+-
+-	%Get time and step
+-	results(result.step).step=result.step;
+-	results(result.step).time=result.time; 
+-
+-	%Add result
+-	if strcmpi(result.fieldname,'Patch'),
+-		results(result.step).(result.fieldname)=[0 result.N];
+-	else
+-		results(result.step).(result.fieldname)=NaN;
+-	end
+-
+-	%read next result
+-	result=ReadDataDimensions(fid);
+-end
+-
+-%do a second pass, and figure out the size of the patches
+-fseek(fid,0,-1); %rewind
+-result=ReadDataDimensions(fid);
+-while ~isempty(result),
+-
+-	%Add result
+-	if strcmpi(result.fieldname,'Patch'),
+-		patchdimensions=results(result.step).(result.fieldname);
+-		results(result.step).(result.fieldname)=[patchdimensions(1)+result.M result.N];
+-	end
+-
+-	%read next result
+-	result=ReadDataDimensions(fid);
+-end
+-
+-%allocate patches
+-for i=1:length(results),
+-	results(i).Patch=zeros(results(i).Patch(1),results(i).Patch(2));
+-	results(i).counter=1; %use to index into the patch
+-end
+-
+-%third pass, this time to read the real information
+-fseek(fid,0,-1); %rewind
+-result=ReadData(fid);
+-while ~isempty(result),
+-
+-	%Get time and step
+-	results(result.step).step=result.step;
+-	results(result.step).time=result.time; 
+-
+-	%Add result
+-	if strcmpi(result.fieldname,'Patch'),
+-		counter=results(result.step).counter;
+-		counter2=counter+size(result.field,1)-1;
+-		results(result.step).(result.fieldname)(counter:counter2,:)=result.field;
+-
+-		%increment counter: 
+-		results(result.step).counter=counter2+1;
+-	else
+-		results(result.step).(result.fieldname)=result.field;
+-	end
+-
+-	%read next result
+-	result=ReadData(fid);
+-
+-end
+-
+-%close file
+-fclose(fid);
+-	% }}}
+-function result=ReadData(fid) % {{{
+-%READDATA - ...
+-%
+-%   Usage:
+-%      field=ReadData(fid)
+-
+-%read field
+-[length,count]=fread(fid,1,'int');
+-
+-if count==0,
+-	result=struct([]);
+-else
+-	fieldname=fread(fid,length,'char');
+-	fieldname=fieldname(1:end-1)';
+-	fieldname=char(fieldname);
+-	time=fread(fid,1,'double');
+-	step=fread(fid,1,'int');
+-
+-	type=fread(fid,1,'int');
+-	M=fread(fid,1,'int');
+-	if type==1,
+-		field=fread(fid,M,'double');
+-	elseif type==2,
+-		field=fread(fid,M,'char');
+-		field=char(field(1:end-1)');
+-	elseif type==3,
+-		N=fread(fid,1,'int');
+-		field=transpose(fread(fid,[N M],'double'));
+-	else
+-		error(['cannot read data of type ' num2str(type) ]);
+-	end
+-
+-	result.fieldname=fieldname;
+-	result.time=time;
+-	result.step=step;
+-	result.field=field;
+-end
+-% }}}
+-function result=ReadDataDimensions(fid) % {{{
+-%READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
+-%
+-%   Usage:
+-%      field=ReadDataDimensions(fid)
+-
+-
+-%read field
+-[length,count]=fread(fid,1,'int');
+-
+-if count==0,
+-	result=struct([]);
+-else
+-	fieldname=fread(fid,length,'char');
+-	fieldname=fieldname(1:end-1)';
+-	fieldname=char(fieldname);
+-	time=fread(fid,1,'double');
+-	step=fread(fid,1,'int');
+-
+-	type=fread(fid,1,'int');
+-	M=fread(fid,1,'int');
+-	N=1; %default
+-	if type==1,
+-		fseek(fid,M*8,0);
+-	elseif type==2,
+-		fseek(fid,M,0);
+-	elseif type==3,
+-		N=fread(fid,1,'int');
+-		fseek(fid,N*M*8,0);
+-	else
+-		error(['cannot read data of type ' num2str(type) ]);
+-	end
+-
+-	result.fieldname=fieldname;
+-	result.time=time;
+-	result.step=step;
+-	result.M=M;
+-	result.N=N;
+-end
+-% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.m	(revision 13006)
+@@ -1,58 +0,0 @@
+-function flag=waitonlock(md,executionpath,login,port)
+-%WAITONLOCK - wait for a file
+-%
+-%   This routine will return when a file named 'filename' is written to disk.
+-%   If the time limit given in input is exceeded, return 0
+-%
+-%   Usage:
+-%      flag=waitonlock(md,executionpath)
+-
+-%Get filename (lock file) and options
+-executionpath=md.cluster.executionpath;
+-cluster=md.cluster.name;
+-login=md.cluster.login;
+-port=md.cluster.port;
+-timelimit=md.settings.waitonlock;
+-filename=[executionpath '/' md.private.runtimename '/' md.miscellaneous.name '.lock'];
+-
+-%waitonlock will work if the lock is on the same machine only: 
+-if ~strcmpi(oshostname(),cluster),
+-
+-	disp('solution launched on remote cluster. log in to detect job completion.');
+-	choice=input('Is the job successfully completed? (y/n)','s');
+-	if ~strcmp(choice,'y'), 
+-		disp('Results not loaded... exiting'); 
+-		flag=0;
+-	else
+-		flag=1;
+-	end
+-
+-%job is running on the same machine
+-else
+-
+-	if ismember('interactive',properties(md.cluster)) & md.cluster.interactive
+-		%We are in interactive mode, no need to check for job completion
+-		flag=1;
+-		return;
+-	end
+-	%initialize time and file presence test flag
+-	time=0; ispresent=0;
+-	disp(['waiting for ' filename ' hold on... (Ctrl+C to exit)'])
+-
+-	%loop till file .lock exist or time is up
+-	while (ispresent==0 & time<timelimit)
+-		ispresent=exist(filename,'file');
+-		pause(1);
+-		time=time+1/60;
+-	end
+-
+-	%build output
+-	if (time>timelimit),
+-		disp('Time limit exceeded. Increase md.settings.waitonlock');
+-		disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
+-		error(['waitonlock error message: time limit exceeded']);
+-		flag=0;
+-	else
+-		flag=1;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.py	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.py	(revision 13006)
+@@ -1,278 +0,0 @@
+-import numpy
+-from model import *
+-from pairoptions import *
+-from recover_areas import *
+-from MatlabFuncs import *
+-
+-def setflowequation(md,*args):
+-	"""
+-	SETELEMENTSTYPE - associate a solution type to each element
+-
+-	   This routine works like plotmodel: it works with an even number of inputs
+-	   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
+-	   that must be followed by the corresponding exp file or flags list
+-	   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+-	   If user wants every element outside the domain to be 
+-	   setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
+-	   an empty string '' will be considered as an empty domain
+-	   a string 'all' will be considered as the entire domain
+-	   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
+-
+-	   Usage:
+-	      md=setflowequation(md,varargin)
+-
+-	   Example:
+-	      md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
+-	      md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
+-	"""
+-
+-	#some checks on list of arguments
+-	if not isinstance(md,model) or not len(args):
+-		raise TypeError("setflowequation error message")
+-
+-	#Find_out what kind of coupling to use
+-	options=pairoptions(*args)
+-	coupling_method=options.getfieldvalue('coupling','tiling')
+-	if not strcmpi(coupling_method,'tiling') and not strcmpi(coupling_method,'penalties'):
+-		raise TypeError("coupling type can only be: tiling or penalties")
+-
+-	hutterflag,macayealflag,pattynflag,stokesflag,filltype=recover_areas(md,*args)
+-
+-	#Flag the elements that have not been flagged as filltype
+-	if   strcmpi(filltype,'hutter'):
+-		hutterflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(macayealflag,pattynflag)))]=1
+-	elif strcmpi(filltype,'macayeal'):
+-		macayealflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(pattynflag,stokesflag))))]=1
+-	elif strcmpi(filltype,'pattyn'):
+-		pattynflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(macayealflag,stokesflag))))]=1
+-
+-	#check that each element has at least one flag
+-	if not numpy.any(hutterflag+macayealflag+pattynflag+stokesflag):
+-		raise TypeError("setflowequation error message: elements type not assigned, must be specified")
+-
+-	#check that each element has only one flag
+-	if numpy.any(hutterflag+macayealflag+pattynflag+stokesflag>1):
+-		print "setflowequation warning message: some elements have several types, higher order type is used for them"
+-		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,macayealflag))]=0
+-		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,pattynflag))]=0
+-		macayealflag[numpy.nonzero(numpy.logical_and(macayealflag,pattynflag))]=0
+-
+-	#Check that no pattyn or stokes for 2d mesh
+-	if md.mesh.dimension==2:
+-		if numpy.any(numpy.logical_or(stokesflag,pattynflag)):
+-			raise TypeError("setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first")
+-
+-	#Stokes can only be used alone for now:
+-	if numpy.any(stokesflag) and numpy.any(hutterflag):
+-		raise TypeError("setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere")
+-
+-	#Initialize node fields
+-	nodeonhutter=numpy.zeros(md.mesh.numberofvertices)
+-	nodeonhutter[md.mesh.elements[numpy.nonzero(hutterflag),:].astype(int)-1]=1
+-	nodeonmacayeal=numpy.zeros(md.mesh.numberofvertices)
+-	nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
+-	nodeonpattyn=numpy.zeros(md.mesh.numberofvertices)
+-	nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
+-	nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
+-	noneflag=numpy.zeros(md.mesh.numberofelements)
+-
+-	#First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
+-	if any(stokesflag):
+-#		fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
+-		fullspcnodes=numpy.logical_or(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx))+ \
+-		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvy))+ \
+-		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvz))==3, \
+-		                              numpy.logical_and(nodeonpattyn,nodeonstokes)).astype(int)    #find all the nodes on the boundary of the domain without icefront
+-#		fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
+-		fullspcelems=(numpy.sum(fullspcnodes[md.mesh.elements.astype(int)-1],axis=1)==6).astype(int)    #find all the nodes on the boundary of the domain without icefront
+-		stokesflag[numpy.nonzero(fullspcelems)]=0
+-		nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
+-
+-	#Then complete with NoneApproximation or the other model used if there is no stokes
+-	if any(stokesflag): 
+-		if   any(pattynflag):    #fill with pattyn
+-			pattynflag[numpy.logical_not(stokesflag)]=1
+-			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
+-		elif any(macayealflag):    #fill with macayeal
+-			macayealflag[numpy.logical_not(stokesflag)]=1
+-			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
+-		else:    #fill with none 
+-			noneflag[numpy.nonzero(numpy.logical_not(stokesflag))]=1
+-
+-	#Now take care of the coupling between MacAyeal and Pattyn
+-	md.diagnostic.vertex_pairing=numpy.array([])
+-	nodeonmacayealpattyn=numpy.zeros(md.mesh.numberofvertices)
+-	nodeonpattynstokes=numpy.zeros(md.mesh.numberofvertices)
+-	nodeonmacayealstokes=numpy.zeros(md.mesh.numberofvertices)
+-	macayealpattynflag=numpy.zeros(md.mesh.numberofelements)
+-	macayealstokesflag=numpy.zeros(md.mesh.numberofelements)
+-	pattynstokesflag=numpy.zeros(md.mesh.numberofelements)
+-	if   strcmpi(coupling_method,'penalties'):
+-		#Create the border nodes between Pattyn and MacAyeal and extrude them
+-		numnodes2d=md.mesh.numberofvertices2d
+-		numlayers=md.mesh.numberoflayers
+-		bordernodes2d=numpy.nonzero(numpy.logical_and(nodeonpattyn[1:numnodes2d],nodeonmacayeal[1:numnodes2d]))    #Nodes connected to two different types of elements
+-
+-		#initialize and fill in penalties structure
+-		if numpy.all(numpy.logical_not(numpy.isnan(bordernodes2d))):
+-			penalties=numpy.zeros((0,2))
+-			for	i in xrange(1,numlayers):
+-				penalties=numpy.concatenate((penalties,numpy.concatenate((bordernodes2d,bordernodes2d+md.mesh.numberofvertices2d*(i)),axis=1)),axis=0)
+-			md.diagnostic.vertex_pairing=penalties
+-
+-	elif strcmpi(coupling_method,'tiling'):
+-		if   numpy.any(macayealflag) and numpy.any(pattynflag):    #coupling macayeal pattyn
+-			#Find node at the border
+-			nodeonmacayealpattyn[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonpattyn))]=1
+-			#Macayeal elements in contact with this layer become MacAyealPattyn elements
+-			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonmacayealpattyn))
+-			commonelements=numpy.sum(matrixelements,axis=1)!=0
+-			commonelements[numpy.nonzero(pattynflag)]=0    #only one layer: the elements previously in macayeal
+-			macayealflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealpattynelements
+-			macayealpattynflag[numpy.nonzero(commonelements)]=1
+-			nodeonmacayeal[:]=0
+-			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
+-
+-			#rule out elements that don't touch the 2 boundaries
+-			pos=numpy.nonzero(macayealpattynflag)
+-			elist=numpy.zeros(len(pos))
+-			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
+-			pos1=[i for i,item in enumerate(elist) if item==1]
+-			macayealflag[pos[pos1]]=1
+-			macayealpattynflag[pos[pos1]]=0
+-			pos2=[i for i,item in enumerate(elist) if item==-1]
+-			pattynflag[pos[pos2]]=1
+-			macayealpattynflag[pos[pos2]]=0
+-
+-			#Recompute nodes associated to these elements
+-			nodeonmacayeal[:]=0
+-			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
+-			nodeonpattyn[:]=0
+-			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
+-			nodeonmacayealpattyn[:]=0
+-			nodeonmacayealpattyn[md.mesh.elements[numpy.nonzero(macayealpattynflag),:].astype(int)-1]=1
+-
+-		elif numpy.any(pattynflag) and numpy.any(stokesflag):    #coupling pattyn stokes
+-			#Find node at the border
+-			nodeonpattynstokes[numpy.nonzero(numpy.logical_and(nodeonpattyn,nodeonstokes))]=1
+-			#Stokes elements in contact with this layer become PattynStokes elements
+-			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonpattynstokes))
+-			commonelements=numpy.sum(matrixelements,axis=1)!=0
+-			commonelements[numpy.nonzero(pattynflag)]=0    #only one layer: the elements previously in macayeal
+-			stokesflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealpattynelements
+-			pattynstokesflag[numpy.nonzero(commonelements)]=1
+-			nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
+-			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
+-
+-			#rule out elements that don't touch the 2 boundaries
+-			pos=numpy.nonzero(pattynstokesflag)
+-			elist=numpy.zeros(len(pos))
+-			elist = elist + numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			pos1=[i for i,item in enumerate(elist) if item==1]
+-			stokesflag[pos[pos1]]=1
+-			pattynstokesflag[pos[pos1]]=0
+-			pos2=[i for i,item in enumerate(elist) if item==-1]
+-			pattynflag[pos[pos2]]=1
+-			pattynstokesflag[pos[pos2]]=0
+-
+-			#Recompute nodes associated to these elements
+-			nodeonstokes[:]=0
+-			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
+-			nodeonpattyn[:]=0
+-			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
+-			nodeonpattynstokes[:]=0
+-			nodeonpattynstokes[md.mesh.elements[numpy.nonzero(pattynstokesflag),:].astype(int)-1]=1
+-
+-		elif numpy.any(stokesflag) and numpy.any(macayealflag):
+-			#Find node at the border
+-			nodeonmacayealstokes[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonstokes))]=1
+-			#Stokes elements in contact with this layer become MacAyealStokes elements
+-			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonmacayealstokes))
+-			commonelements=numpy.sum(matrixelements,axis=1)!=0
+-			commonelements[numpy.nonzero(macayealflag)]=0    #only one layer: the elements previously in macayeal
+-			stokesflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealmacayealelements
+-			macayealstokesflag[numpy.nonzero(commonelements)]=1
+-			nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
+-			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
+-
+-			#rule out elements that don't touch the 2 boundaries
+-			pos=numpy.nonzero(macayealstokesflag)
+-			elist=numpy.zeros(len(pos))
+-			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
+-			pos1=[i for i,item in enumerate(elist) if item==1]
+-			macayealflag[pos[pos1]]=1
+-			macayealstokesflag[pos[pos1]]=0
+-			pos2=[i for i,item in enumerate(elist) if item==-1]
+-			stokesflag[pos[pos2]]=1
+-			macayealstokesflag[pos[pos2]]=0
+-
+-			#Recompute nodes associated to these elements
+-			nodeonmacayeal[:]=0
+-			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
+-			nodeonstokes[:]=0
+-			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
+-			nodeonmacayealstokes[:]=0
+-			nodeonmacayealstokes[md.mesh.elements[numpy.nonzero(macayealstokesflag),:].astype(int)-1]=1
+-
+-		elif numpy.any(stokesflag) and numpy.any(hutterflag):
+-			raise TypeError("type of coupling not supported yet")
+-
+-	#Create MacaAyealPattynApproximation where needed
+-	md.flowequation.element_equation=numpy.zeros(md.mesh.numberofelements)
+-	md.flowequation.element_equation[numpy.nonzero(noneflag)]=0
+-	md.flowequation.element_equation[numpy.nonzero(hutterflag)]=1
+-	md.flowequation.element_equation[numpy.nonzero(macayealflag)]=2
+-	md.flowequation.element_equation[numpy.nonzero(pattynflag)]=3
+-	md.flowequation.element_equation[numpy.nonzero(stokesflag)]=4
+-	md.flowequation.element_equation[numpy.nonzero(macayealpattynflag)]=5
+-	md.flowequation.element_equation[numpy.nonzero(macayealstokesflag)]=6
+-	md.flowequation.element_equation[numpy.nonzero(pattynstokesflag)]=7
+-
+-	#border
+-	md.flowequation.borderpattyn=nodeonpattyn
+-	md.flowequation.bordermacayeal=nodeonmacayeal
+-	md.flowequation.borderstokes=nodeonstokes
+-
+-	#Create vertices_type
+-	md.flowequation.vertex_equation=numpy.zeros(md.mesh.numberofvertices)
+-	pos=numpy.nonzero(nodeonhutter)
+-	md.flowequation.vertex_equation[pos]=1
+-	pos=numpy.nonzero(nodeonmacayeal)
+-	md.flowequation.vertex_equation[pos]=2
+-	pos=numpy.nonzero(nodeonpattyn)
+-	md.flowequation.vertex_equation[pos]=3
+-	pos=numpy.nonzero(nodeonhutter)
+-	md.flowequation.vertex_equation[pos]=1
+-	pos=numpy.nonzero(nodeonmacayealpattyn)
+-	md.flowequation.vertex_equation[pos]=5
+-	pos=numpy.nonzero(nodeonstokes)
+-	md.flowequation.vertex_equation[pos]=4
+-	if numpy.any(stokesflag):
+-		pos=numpy.nonzero(numpy.logical_not(nodeonstokes))
+-		if not (numpy.any(pattynflag) or numpy.any(macayealflag)):
+-			md.flowequation.vertex_equation[pos]=0
+-	pos=numpy.nonzero(nodeonpattynstokes)
+-	md.flowequation.vertex_equation[pos]=7
+-	pos=numpy.nonzero(nodeonmacayealstokes)
+-	md.flowequation.vertex_equation[pos]=6
+-
+-	#figure out solution types
+-	md.flowequation.ishutter=float(numpy.any(md.flowequation.element_equation==1))
+-	md.flowequation.ismacayealpattyn=float(numpy.any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
+-	md.flowequation.isstokes=float(numpy.any(md.flowequation.element_equation==4))
+-
+-	return md
+-
+-	#Check that tiling can work:
+-	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal !=1):
+-		raise TypeError("error coupling domain too irregular")
+-	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderstokes + md.flowequation.bordermacayeal !=1):
+-		raise TypeError("error coupling domain too irregular")
+-	if numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.borderstokes !=1):
+-		raise TypeError("error coupling domain too irregular")
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/contourenvelope.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/contourenvelope.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/contourenvelope.m	(revision 13006)
+@@ -1,139 +0,0 @@
+-function segments=contourenvelope(md,varargin)
+-%CONTOURENVELOPE - build a set of segments enveloping a contour .exp
+-%
+-%   Usage:
+-%      segments=contourenvelope(md,varargin)
+-%
+-%   Example:
+-%      segments=contourenvelope(md,'Stream.exp');
+-%      segments=contourenvelope(md,md.mask.elementonfloatingice)
+-%      segments=contourenvelope(md);
+-
+-%some checks
+-if nargin>2,
+-	help contourenvelope
+-	error('contourenvelope error message: bad usage');
+-end
+-if nargin==2,
+-	flags=varargin{1};
+-
+-	if ischar(flags),
+-		file=flags;
+-		file=varargin{1};
+-		if ~exist(file),
+-			error(['contourenvelope error message: file ' file ' not found']);
+-		end
+-		isfile=1;
+-	elseif isnumeric(flags),
+-		%do nothing for now
+-		isfile=0;
+-	else
+-		error('contourenvelope error message:  second argument should a file or an elements flag');
+-	end
+-end
+-
+-%Now, build the connectivity tables for this mesh.
+-%Computing connectivity
+-if (size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices & size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices2d),
+-	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-end
+-if (size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements & size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements2d),
+-	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-end
+-
+-%get nodes inside profile
+-mesh.elementconnectivity=md.mesh.elementconnectivity;
+-if md.mesh.dimension==2;
+-	mesh.elements=md.mesh.elements;
+-	mesh.x=md.mesh.x;
+-	mesh.y=md.mesh.y;
+-	mesh.numberofvertices=md.mesh.numberofvertices;
+-	mesh.numberofelements=md.mesh.numberofelements;
+-else
+-	mesh.elements=md.mesh.elements2d;
+-	mesh.x=md.mesh.x2d;
+-	mesh.y=md.mesh.y2d;
+-	mesh.numberofvertices=md.mesh.numberofvertices2d;
+-	mesh.numberofelements=md.mesh.numberofelements2d;
+-end
+-
+-if nargin==2,
+-
+-	if isfile,
+-		%get flag list of elements and nodes inside the contour
+-		nodein=ContourToMesh(mesh.elements,mesh.x,mesh.y,file,'node',1);
+-		elemin=(sum(nodein(mesh.elements),2)==size(mesh.elements,2));
+-		%modify element connectivity
+-		elemout=find(~elemin);
+-		mesh.elementconnectivity(elemout,:)=0;
+-		mesh.elementconnectivity(find(ismember(mesh.elementconnectivity,elemout)))=0;
+-	else
+-		%get flag list of elements and nodes inside the contour
+-		nodein=zeros(mesh.numberofvertices,1); 
+-		elemin=zeros(mesh.numberofelements,1); 
+-		
+-		pos=find(flags); 
+-		elemin(pos)=1;
+-		nodein(mesh.elements(pos,:))=1;
+-
+-		%modify element connectivity
+-		elemout=find(~elemin);
+-		mesh.elementconnectivity(elemout,:)=0;
+-		mesh.elementconnectivity(find(ismember(mesh.elementconnectivity,elemout)))=0;
+-	end
+-end
+-
+-%Find element on boundary
+-%First: find elements on the boundary of the domain
+-flag=mesh.elementconnectivity;
+-if nargin==2,
+-	flag(find(flag))=elemin(flag(find(flag)));
+-end
+-elementonboundary=double(prod(flag,2)==0 & sum(flag,2)>0);
+-
+-%Find segments on boundary
+-pos=find(elementonboundary);
+-num_segments=length(pos);
+-segments=zeros(num_segments,3);
+-count=1;
+-
+-for i=1:num_segments,
+-	el1=pos(i);
+-	els2=mesh.elementconnectivity(el1,find(mesh.elementconnectivity(el1,:)));
+-	if length(els2)>1,
+-		flag=intersect(mesh.elements(els2(1),:),mesh.elements(els2(2),:));
+-		nods1=mesh.elements(el1,:);
+-		nods1(find(nods1==flag))=[];
+-		segments(count,:)=[nods1 el1];
+-
+-		ord1=find(nods1(1)==mesh.elements(el1,:));
+-		ord2=find(nods1(2)==mesh.elements(el1,:));
+-
+-		%swap segment nodes if necessary
+-		if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
+-			temp=segments(count,1);
+-			segments(count,1)=segments(count,2);
+-			segments(count,2)=temp;
+-		end
+-		segments(count,1:2)=fliplr(segments(count,1:2));
+-		count=count+1;
+-	else
+-		nods1=mesh.elements(el1,:);
+-		flag=setdiff(nods1,mesh.elements(els2,:));
+-		for j=1:3,
+-			nods=nods1; nods(j)=[];
+-			if any(ismember(flag,nods)),
+-				segments(count,:)=[nods el1];
+-				ord1=find(nods(1)==mesh.elements(el1,:));
+-				ord2=find(nods(2)==mesh.elements(el1,:));
+-				if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
+-					temp=segments(count,1);
+-					segments(count,1)=segments(count,2);
+-					segments(count,2)=temp;
+-				end
+-				segments(count,1:2)=fliplr(segments(count,1:2));
+-				count=count+1;
+-			end
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setmask2.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setmask2.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setmask2.m	(revision 13006)
+@@ -1,148 +0,0 @@
+-function md=setmask2(md,landname,floatingicename,groundedicename)
+-%GEOGRAPHY2 - establish land, ice sheet and ice shelf areas in a domains.
+-%
+-%   Usage:
+-%      md=setmask2(md,landname,floatingicename,groundedicename)
+-%
+-%   Examples:
+-%      md=setmask2(md,'LandName.exp','Iceshelves.exp','Islands.exp');
+-
+-%Get assigned fields
+-x=md.mesh.x;
+-y=md.mesh.y;
+-elements=md.mesh.elements;
+-
+-%recover elements and nodes on land.
+-if ischar(landname),
+-	[vertexonland,elementonland]=ContourToMesh(elements,x,y,landname,'element and node',2);
+-elseif isfloat(landname),
+-	if size(landname,1)~=md.mesh.numberofelements,
+-		error('Landname for area must be of same size as number of elements in model');
+-	end
+-	elementonland=landname;
+-	vertexonland=zeros(md.mesh.numberofvertices,1);
+-	vertexonland(md.mesh.elements(find(elementonland),:))=1;
+-else
+-	error('Invalid area option option');
+-end
+-
+-%Now, build the connectivity tables for this mesh.
+-if size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices,
+-	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-end
+-if size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements,
+-	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-end
+-
+-%any element with 3 nodes on land should be on land:
+-elementsonwater=find(~elementonland);
+-wrongelements=elementsonwater(find(( vertexonland(md.mesh.elements(elementsonwater,1)) + vertexonland(md.mesh.elements(elementsonwater,2)) + vertexonland(md.mesh.elements(elementsonwater,3)) ...
+-                  )==3));
+-elementonland(wrongelements)=1;
+-
+-%any element with its barycentre on land should be on land: (only if landname is an expfile)
+-if ischar(landname),
+-weights={[1;1;1],[2;1;1],[1;2;1],[1;1;2]};
+-	for i=1:length(weights),
+-		xelem=x(md.mesh.elements)*weights{i}/sum(weights{i});
+-		yelem=y(md.mesh.elements)*weights{i}/sum(weights{i});
+-	end
+-	baryonland=ContourToNodes(xelem,yelem,landname,1);
+-	pos=find(~baryonland); elementonland(pos)=0;
+-	pos=find(baryonland); elementonland(pos)=1;
+-end
+-
+-%figure out which elements on land are actually in the middle of the ocean!
+-pos1=find(elementonland); 
+-connectedtoland=md.mesh.elementconnectivity(pos1,:);
+-pos=find(connectedtoland); connectedtoland(pos)=1-elementonland(connectedtoland(pos));
+-connectedtolandsum=sum(connectedtoland,2);
+-waterelements=pos1(find(connectedtolandsum==3));
+-elementonland(waterelements)=0;
+-
+-%figure out which elements on water  are actually in the middle of the land!
+-pos1=find(~elementonland); 
+-connectedtowater=md.mesh.elementconnectivity(pos1,:);
+-pos=find(connectedtowater); connectedtowater(pos)=elementonland(connectedtowater(pos));
+-connectedtowatersum=sum(connectedtowater,2);
+-landelements=pos1(find(connectedtowatersum==3));
+-elementonland(landelements)=1;
+-
+-%recover arrays of ice shelf nodes and elements, and ice sheet nodes and elements.
+-elementonfloatingice=FlagElements(md,floatingicename);
+-elementongroundedice=FlagElements(md,groundedicename);
+-
+-%Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
+-%arrays come from domain outlines that can intersect one another: 
+-vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
+-vertexongroundedice=zeros(md.mesh.numberofvertices,1);
+-elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
+-elementongroundedice=double(~elementonfloatingice);
+-vertexonfloatingice(md.mesh.elements(find(elementonfloatingice),:))=1;
+-vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
+-
+-%now correct, so that none of the floatingice and groundedice elements and nodes are in the water.
+-pos=find(~elementonland);
+-elementonfloatingice(pos)=0; 
+-elementongroundedice(pos)=0;
+-
+-pos=find(~vertexonland);
+-vertexonfloatingice(pos)=0; 
+-vertexongroundedice(pos)=0;
+-
+-%create vertexonwater and elementonwater: 
+-vertexonwater=double(~vertexonland);
+-elementonwater=double(~elementonland);
+-
+-%correct for islands:
+-vertexonfloatingice=double(vertexonfloatingice & ~vertexongroundedice);
+-elementonfloatingice=double(elementonfloatingice & ~elementongroundedice);
+-
+-%now, groundedices are everything except iceshelves and water
+-vertexongroundedice=double(~vertexonfloatingice & ~vertexonwater);
+-elementongroundedice=double(~elementonfloatingice & ~elementonwater);
+-
+-%Deal with segments on neumann:
+-
+-%Get current connectivity
+-mesh.elementconnectivity=md.mesh.elementconnectivity;
+-
+-%put 0 for elements on water
+-pos=find(mesh.elementconnectivity);
+-mesh.elementconnectivity(pos)=mesh.elementconnectivity(pos).*(~elementonwater(mesh.elementconnectivity(pos)));
+-
+-%put line of ones for elements on water
+-pos=find(elementonwater);
+-mesh.elementconnectivity(pos,:)=1;% line of ones for elements on water so they won't be considered
+-
+-%resort lines (zeros must be at the last column for findsegments)
+-mesh.elementconnectivity=sort(mesh.elementconnectivity,2,'descend');
+-
+-%call findsegments to build segment using THIS conectivity
+-md.mesh.segments=findsegments(md,'mesh.elementconnectivity',mesh.elementconnectivity);
+-
+-%some final checks: 
+-%check that no node thinks it's on an ice shelf or ice sheet, and lies actually in the middle of the water.
+-nodesgrounded=find(~vertexonwater);
+-lengthconnectivity=size(md.mesh.vertexconnectivity,2);
+-groundedcounters=md.mesh.vertexconnectivity(nodesgrounded,lengthconnectivity);
+-groundedconnectivity=md.mesh.vertexconnectivity(nodesgrounded,1:lengthconnectivity-1);
+-pos=find(groundedconnectivity);
+-groundedconnectivity(pos)=elementonwater(groundedconnectivity(pos));
+-groundedsum=sum(groundedconnectivity,2);
+-errorflags=find(groundedsum==groundedcounters);
+-errornodes=nodesgrounded(errorflags);
+-
+-vertexonwater(errornodes)=1;
+-vertexongroundedice(errornodes)=0;
+-vertexonfloatingice(errornodes)=0;
+-
+-%Return: 
+-md.mask.vertexonfloatingice=vertexonfloatingice;
+-md.mask.elementonfloatingice=elementonfloatingice;
+-md.mask.vertexonwater=vertexonwater;
+-md.mask.elementonwater=elementonwater;
+-md.mask.vertexongroundedice=vertexongroundedice;
+-md.mask.elementongroundedice=elementongroundedice;
+-
+-md.mesh.segmentmarkers(:)=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setflowequation.m	(revision 13006)
+@@ -1,281 +0,0 @@
+-function md=setflowequation(md,varargin)
+-%SETELEMENTSTYPE - associate a solution type to each element
+-%
+-%   This routine works like plotmodel: it works with an even number of inputs
+-%   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
+-%   that must be followed by the corresponding exp file or flags list
+-%   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+-%   If user wants every element outside the domain to be 
+-%   setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
+-%   an empty string '' will be considered as an empty domain
+-%   a string 'all' will be considered as the entire domain
+-%   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
+-%
+-%   Usage:
+-%      md=setflowequation(md,varargin)
+-%
+-%   Example:
+-%      md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
+-%      md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
+-
+-%some checks on list of arguments
+-if ((nargin<2) | (nargout~=1)),
+-	error('setflowequation error message');
+-end
+-
+-%Find_out what kind of coupling to use
+-options=pairoptions(varargin{:});
+-coupling_method=getfieldvalue(options,'coupling','tiling');
+-if (~strcmpi(coupling_method,'tiling') & ~strcmpi(coupling_method,'penalties')),
+-	error('coupling type can only be: tiling or penalties');
+-end
+-
+-[hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin{:});
+-
+-%Flag the elements that have not been flagged as filltype
+-if strcmpi(filltype,'hutter'),
+-	hutterflag(find(~(macayealflag | pattynflag)))=1;
+-elseif strcmpi(filltype,'macayeal'),
+-	macayealflag(find(~(hutterflag | pattynflag | stokesflag)))=1;
+-elseif strcmpi(filltype,'pattyn'),
+-	pattynflag(find(~(hutterflag | macayealflag | stokesflag)))=1;
+-end
+-
+-%check that each element has at least one flag
+-if any(hutterflag+ macayealflag+pattynflag+stokesflag==0),
+-	error('setflowequation error message: elements type not assigned, must be specified')
+-end
+-
+-%check that each element has only one flag
+-if any(hutterflag+ macayealflag+pattynflag+stokesflag>1),
+-	disp('setflowequation warning message: some elements have several types, higher order type is used for them')
+-	hutterflag(find(hutterflag & macayealflag))=0;
+-	hutterflag(find(hutterflag & pattynflag))=0;
+-	macayealflag(find(macayealflag & pattynflag))=0;
+-end
+-
+-%Check that no pattyn or stokes for 2d mesh
+-if (md.mesh.dimension==2),
+-	if any(stokesflag | pattynflag)
+-		error('setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first')
+-	end
+-end
+-
+-%Stokes can only be used alone for now:
+-if any(stokesflag) &any(hutterflag),
+-	error('setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere')
+-end
+-
+-%Initialize node fields
+-nodeonhutter=zeros(md.mesh.numberofvertices,1);
+-nodeonhutter(md.mesh.elements(find(hutterflag),:))=1;
+-nodeonmacayeal=zeros(md.mesh.numberofvertices,1);
+-nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+-nodeonpattyn=zeros(md.mesh.numberofvertices,1);
+-nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
+-nodeonstokes=zeros(md.mesh.numberofvertices,1);
+-noneflag=zeros(md.mesh.numberofelements,1);
+-
+-%First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
+-if any(stokesflag),
+-	fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
+-	fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
+-	stokesflag(find(fullspcelems))=0;
+-	nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
+-end
+-
+-%Then complete with NoneApproximation or the other model used if there is no stokes
+-if any(stokesflag), 
+-	if any(pattynflag), %fill with pattyn
+-		pattynflag(~stokesflag)=1;
+-		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
+-	elseif any(macayealflag), %fill with macayeal
+-		macayealflag(~stokesflag)=1;
+-		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+-	else %fill with none 
+-		noneflag(find(~stokesflag))=1;
+-	end
+-end
+-
+-%Now take care of the coupling between MacAyeal and Pattyn
+-md.diagnostic.vertex_pairing=[];
+-nodeonmacayealpattyn=zeros(md.mesh.numberofvertices,1);
+-nodeonpattynstokes=zeros(md.mesh.numberofvertices,1);
+-nodeonmacayealstokes=zeros(md.mesh.numberofvertices,1);
+-macayealpattynflag=zeros(md.mesh.numberofelements,1);
+-macayealstokesflag=zeros(md.mesh.numberofelements,1);
+-pattynstokesflag=zeros(md.mesh.numberofelements,1);
+-if strcmpi(coupling_method,'penalties'),
+-	%Create the border nodes between Pattyn and MacAyeal and extrude them
+-	numnodes2d=md.mesh.numberofvertices2d;
+-	numlayers=md.mesh.numberoflayers;
+-	bordernodes2d=find(nodeonpattyn(1:numnodes2d) & nodeonmacayeal(1:numnodes2d)); %Nodes connected to two different types of elements
+-
+-	%initialize and fill in penalties structure
+-	if ~isnan(bordernodes2d),
+-		penalties=[];
+-		for	i=1:numlayers-1,
+-			penalties=[penalties; [bordernodes2d bordernodes2d+md.mesh.numberofvertices2d*(i)]];
+-		end
+-		md.diagnostic.vertex_pairing=penalties;
+-	end
+-elseif strcmpi(coupling_method,'tiling'),
+-	if any(macayealflag) & any(pattynflag), %coupling macayeal pattyn
+-		%Find node at the border
+-		nodeonmacayealpattyn(find(nodeonmacayeal & nodeonpattyn))=1;
+-		%Macayeal elements in contact with this layer become MacAyealPattyn elements
+-		matrixelements=ismember(md.mesh.elements,find(nodeonmacayealpattyn));
+-		commonelements=sum(matrixelements,2)~=0;
+-		commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
+-		macayealflag(find(commonelements))=0; %these elements are now macayealpattynelements
+-		macayealpattynflag(find(commonelements))=1;
+-		nodeonmacayeal(:)=0;
+-		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+-
+-		%rule out elements that don't touch the 2 boundaries
+-		pos=find(macayealpattynflag);
+-		elist=zeros(length(pos),1);
+-		elist = elist + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
+-		elist = elist - any(sum(nodeonpattyn(md.mesh.elements(pos,:))  ,2),2);
+-		pos1=find(elist==1);
+-		macayealflag(pos(pos1))=1;
+-		macayealpattynflag(pos(pos1))=0;
+-		pos2=find(elist==-1);
+-		pattynflag(pos(pos2))=1;
+-		macayealpattynflag(pos(pos2))=0;
+-
+-		%Recompute nodes associated to these elements
+-		nodeonmacayeal(:)=0;
+-		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+-		nodeonpattyn(:)=0;
+-		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
+-		nodeonmacayealpattyn(:)=0;
+-		nodeonmacayealpattyn(md.mesh.elements(find(macayealpattynflag),:))=1;
+-
+-	elseif any(pattynflag) & any(stokesflag), %coupling pattyn stokes
+-		%Find node at the border
+-		nodeonpattynstokes(find(nodeonpattyn & nodeonstokes))=1;
+-		%Stokes elements in contact with this layer become PattynStokes elements
+-		matrixelements=ismember(md.mesh.elements,find(nodeonpattynstokes));
+-		commonelements=sum(matrixelements,2)~=0;
+-		commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
+-		stokesflag(find(commonelements))=0; %these elements are now macayealpattynelements
+-		pattynstokesflag(find(commonelements))=1;
+-		nodeonstokes=zeros(md.mesh.numberofvertices,1);
+-		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
+-
+-		%rule out elements that don't touch the 2 boundaries
+-		pos=find(pattynstokesflag);
+-		elist=zeros(length(pos),1);
+-		elist = elist + any(sum(nodeonstokes(md.mesh.elements(pos,:)),2),2);
+-		elist = elist - any(sum(nodeonpattyn(md.mesh.elements(pos,:)),2),2);
+-		pos1=find(elist==1);
+-		stokesflag(pos(pos1))=1;
+-		pattynstokesflag(pos(pos1))=0;
+-		pos2=find(elist==-1);
+-		pattynflag(pos(pos2))=1;
+-		pattynstokesflag(pos(pos2))=0;
+-
+-		%Recompute nodes associated to these elements
+-		nodeonstokes(:)=0;
+-		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
+-		nodeonpattyn(:)=0;
+-		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
+-		nodeonpattynstokes(:)=0;
+-		nodeonpattynstokes(md.mesh.elements(find(pattynstokesflag),:))=1;
+-
+-	elseif any(stokesflag) & any(macayealflag),
+-		%Find node at the border
+-		nodeonmacayealstokes(find(nodeonmacayeal & nodeonstokes))=1;
+-		%Stokes elements in contact with this layer become MacAyealStokes elements
+-		matrixelements=ismember(md.mesh.elements,find(nodeonmacayealstokes));
+-		commonelements=sum(matrixelements,2)~=0;
+-		commonelements(find(macayealflag))=0; %only one layer: the elements previously in macayeal
+-		stokesflag(find(commonelements))=0; %these elements are now macayealmacayealelements
+-		macayealstokesflag(find(commonelements))=1;
+-		nodeonstokes=zeros(md.mesh.numberofvertices,1);
+-		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
+-
+-		%rule out elements that don't touch the 2 boundaries
+-		pos=find(macayealstokesflag);
+-		elist=zeros(length(pos),1);
+-		elist = elist + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
+-		elist = elist - any(sum(nodeonstokes(md.mesh.elements(pos,:))  ,2),2);
+-		pos1=find(elist==1);
+-		macayealflag(pos(pos1))=1;
+-		macayealstokesflag(pos(pos1))=0;
+-		pos2=find(elist==-1);
+-		stokesflag(pos(pos2))=1;
+-		macayealstokesflag(pos(pos2))=0;
+-
+-		%Recompute nodes associated to these elements
+-		nodeonmacayeal(:)=0;
+-		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+-		nodeonstokes(:)=0;
+-		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
+-		nodeonmacayealstokes(:)=0;
+-		nodeonmacayealstokes(md.mesh.elements(find(macayealstokesflag),:))=1;
+-
+-	elseif any(stokesflag) & any(hutterflag),
+-		error('type of coupling not supported yet');
+-	end
+-end
+-
+-%Create MacaAyealPattynApproximation where needed
+-md.flowequation.element_equation=zeros(md.mesh.numberofelements,1);
+-md.flowequation.element_equation(find(noneflag))=0;
+-md.flowequation.element_equation(find(hutterflag))=1;
+-md.flowequation.element_equation(find(macayealflag))=2;
+-md.flowequation.element_equation(find(pattynflag))=3;
+-md.flowequation.element_equation(find(stokesflag))=4;
+-md.flowequation.element_equation(find(macayealpattynflag))=5;
+-md.flowequation.element_equation(find(macayealstokesflag))=6;
+-md.flowequation.element_equation(find(pattynstokesflag))=7;
+-
+-%border
+-md.flowequation.borderpattyn=nodeonpattyn;
+-md.flowequation.bordermacayeal=nodeonmacayeal;
+-md.flowequation.borderstokes=nodeonstokes;
+-
+-%Create vertices_type
+-md.flowequation.vertex_equation=zeros(md.mesh.numberofvertices,1);
+-pos=find(nodeonhutter);
+-md.flowequation.vertex_equation(pos)=1;
+-pos=find(nodeonmacayeal);
+-md.flowequation.vertex_equation(pos)=2;
+-pos=find(nodeonpattyn);
+-md.flowequation.vertex_equation(pos)=3;
+-pos=find(nodeonhutter);
+-md.flowequation.vertex_equation(pos)=1;
+-pos=find(nodeonmacayealpattyn);
+-md.flowequation.vertex_equation(pos)=5;
+-pos=find(nodeonstokes);
+-md.flowequation.vertex_equation(pos)=4;
+-if any(stokesflag),
+-	pos=find(~nodeonstokes);
+-	if(~any(pattynflag) & ~any(macayealflag)),
+-		md.flowequation.vertex_equation(pos)=0;
+-	end
+-end
+-pos=find(nodeonpattynstokes);
+-md.flowequation.vertex_equation(pos)=7;
+-pos=find(nodeonmacayealstokes);
+-md.flowequation.vertex_equation(pos)=6;
+-
+-%figure out solution types
+-md.flowequation.ishutter=double(any(md.flowequation.element_equation==1));
+-md.flowequation.ismacayealpattyn=double(any(md.flowequation.element_equation==2 | md.flowequation.element_equation==3));
+-md.flowequation.isstokes=double(any(md.flowequation.element_equation==4));
+-
+-return
+-
+-%Check that tiling can work:
+-if any(md.flowequation.bordermacayeal) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal ~=1),
+-	error('error coupling domain too irregular');
+-end
+-if any(md.flowequation.bordermacayeal) & any(md.flowequation.borderstokes) & any(md.flowequation.borderstokes + md.flowequation.bordermacayeal ~=1),
+-	error('error coupling domain too irregular');
+-end
+-if any(md.flowequation.borderstokes) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.borderstokes~=1),
+-	error('error coupling domain too irregular');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/qpr.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/qpr.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/qpr.m	(revision 13006)
+@@ -1,7 +0,0 @@
+-function qpr(name,format)
+-%QPR: quick print of a model
+-%
+-% Usage: qpr(name,format)
+-
+-printmodel(name,format,'trim','on','resolution',1,'margin','on','marginsize',25,'frame','on','framesize',3);
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setmask.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setmask.py	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setmask.py	(revision 13006)
+@@ -1,55 +0,0 @@
+-from numpy import *
+-import FlagElements as fe
+-
+-def setmask(md, floatingicename, groundedicename):
+-	#SETMASK - establish boundaries between grounded and floating ice.
+-	#
+-	#   By default, ice is considered grounded. The contour floatingicename defines nodes 
+-	#   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
+-	#   that are grounded (ie: ice rises, islands, etc ...)
+-	#   All input files are in the Argus format (extension .exp).
+-	#
+-	#   Usage:
+-	#      md=setmask(md,floatingicename,groundedicename)
+-	#
+-	#   Examples:
+-	#      md=setmask(md,'all','');
+-	#      md=setmask(md,'Iceshelves.exp','Islands.exp');
+-
+-	#%Get assigned fields
+-	x = md.mesh.x
+-	y = md.mesh.y
+-	elements = md.mesh.elements
+-
+-	#Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
+-	elementonfloatingice = fe.FlagElements(md, floatingicename)
+-	elementongroundedice = fe.FlagElements(md, groundedicename) 
+-
+-	#Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
+-	#arrays come from domain outlines that can intersect one another: 
+-
+-	elementonfloatingice = logical_and(elementonfloatingice,~elementongroundedice)
+-	elementongroundedice = ~elementonfloatingice
+-
+-	#the order here is important. we choose vertexongroundedice as default on the grounding line.
+-	vertexonfloatingice = zeros(md.mesh.numberofvertices,'bool')
+-	vertexongroundedice = zeros(md.mesh.numberofvertices,'bool')
+-
+-	pos=argwhere(elementongroundedice==1)
+-	pos=md.mesh.elements[pos,:]-1
+-	if pos.size:
+-		vertexongroundedice[pos]=True
+-
+-	pos=argwhere(~vertexongroundedice)
+-	if pos.size:
+-		vertexonfloatingice[pos]=True;
+-	#%}}}
+-
+-	#Return: 
+-	md.mask.elementonfloatingice = double(elementonfloatingice)
+-	md.mask.vertexonfloatingice = double(vertexonfloatingice)
+-	md.mask.elementongroundedice = double(elementongroundedice)
+-	md.mask.vertexongroundedice = double(vertexongroundedice)
+-	md.mask.vertexonwater = zeros(md.mesh.numberofvertices)
+-	md.mask.elementonwater = zeros(md.mesh.numberofelements)
+-	return md
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.py	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/waitonlock.py	(revision 13006)
+@@ -1,64 +0,0 @@
+-import os
+-import socket
+-import time
+-from MatlabFuncs import *
+-
+-def waitonlock(md,executionpath,login,port):
+-	"""
+-	WAITONLOCK - wait for a file
+- 
+-	   This routine will return when a file named 'filename' is written to disk.
+-	   If the time limit given in input is exceeded, return 0
+- 
+-	   Usage:
+-	      flag=waitonlock(md,executionpath)
+-	"""
+-
+-	#Get filename (lock file) and options
+-	executionpath=md.cluster.executionpath
+-	cluster=md.cluster.name
+-	login=md.cluster.login
+-	port=md.cluster.port
+-	timelimit=md.settings.waitonlock
+-	filename=os.path.join(executionpath,md.private.runtimename,md.miscellaneous.name+'.lock')
+-
+-	#waitonlock will work if the lock is on the same machine only: 
+-	if not strcmpi(socket.gethostname().lower().split('.')[0],cluster):
+-
+-		print 'solution launched on remote cluster. log in to detect job completion.'
+-		choice=raw_input('Is the job successfully completed? (y/n) ')
+-		if not strcmp(choice,'y'): 
+-			print 'Results not loaded... exiting' 
+-			flag=0
+-		else:
+-			flag=1
+-
+-	#job is running on the same machine
+-	else:
+-
+-		if 'interactive' in vars(md.cluster) and md.cluster.interactive:
+-			#We are in interactive mode, no need to check for job completion
+-			flag=1
+-			return flag
+-		#initialize time and file presence test flag
+-		etime=0
+-		ispresent=0
+-		print "waiting for '%s' hold on... (Ctrl+C to exit)" % filename
+-
+-		#loop till file .lock exist or time is up
+-		while ispresent==0 and etime<timelimit:
+-			ispresent=os.path.exist(filename)
+-			time.sleep(1)
+-			etime+=1/60
+-
+-		#build output
+-		if etime>timelimit:
+-			print 'Time limit exceeded. Increase md.settings.waitonlock'
+-			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
+-			raise RuntimeError('waitonlock error message: time limit exceeded.')
+-			flag=0
+-		else:
+-			flag=1
+-
+-	return flag
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setmask.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setmask.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/setmask.m	(revision 13006)
+@@ -1,49 +0,0 @@
+-function md=setmask(md,floatingicename,groundedicename)
+-%SETMASK - establish boundaries between grounded and floating ice.
+-%
+-%   By default, ice is considered grounded. The contour floatingicename defines nodes 
+-%   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
+-%   that are grounded (ie: ice rises, islands, etc ...)
+-%   All input files are in the Argus format (extension .exp).
+-%
+-%   Usage:
+-%      md=setmask(md,floatingicename,groundedicename)
+-%
+-%   Examples:
+-%      md=setmask(md,'all','');
+-%      md=setmask(md,'Iceshelves.exp','Islands.exp');
+-
+-%some checks on list of arguments
+-if ((nargin~=3) | (nargout~=1)),
+-	help mask
+-	error('mask error message');
+-end
+-
+-%Get assigned fields
+-x=md.mesh.x;
+-y=md.mesh.y;
+-elements=md.mesh.elements;
+-
+-%Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
+-elementonfloatingice=FlagElements(md,floatingicename);
+-elementongroundedice=FlagElements(md,groundedicename);
+-
+-%Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
+-%arrays come from domain outlines that can intersect one another: 
+-elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
+-elementongroundedice=double(~elementonfloatingice);
+-
+-%the order here is important. we choose vertexongroundedice as default on the grounding line.
+-vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
+-vertexongroundedice=zeros(md.mesh.numberofvertices,1);
+-vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
+-vertexonfloatingice(find(~vertexongroundedice))=1;
+-%}}}
+-
+-%Return: 
+-md.mask.elementonfloatingice=elementonfloatingice;
+-md.mask.vertexonfloatingice=vertexonfloatingice;
+-md.mask.elementongroundedice=elementongroundedice;
+-md.mask.vertexongroundedice=vertexongroundedice;
+-md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
+-md.mask.elementonwater=zeros(md.mesh.numberofelements,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/printmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/printmodel.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/printmodel.m	(revision 13006)
+@@ -1,100 +0,0 @@
+-function printmodel(filename,format,varargin)
+-%PRINTMODEL - save an image of current figure
+-%
+-%   filename: output name of image file (no extension)
+-%   format: image format (ex: 'tiff','jpg','pdf') 
+-%
+-%   List of options to printfmodel: 
+-%
+-%   figure: number of figure to print (default: current figure)
+-%   resolution: use higher resolution to anti-alias (default 2)
+-%   margin: add margin around final image  
+-%   marginsize: size of margin around final image (default 5)
+-%   frame: add frame around final image
+-%   framesize: size of frame around final image (default 5)
+-%   framecolor: color of frame around final image (default 'black')
+-%   trim: trim empty space around image (default 'off')
+-%   hardcopy: 'off' to impose MATLAB to use the same colors (default 'off')
+-%   
+-%   Usage:
+-%      printmodel(filename,format,varargin);
+-%
+-%   Examples:
+-%      printmodel('image','tiff')
+-%      printmodel('image','eps','margin','on','frame','on','hardcopy','on')
+-
+-
+-%get options: 
+-options=pairoptions(varargin{:});
+-
+-%set defaults
+-options=addfielddefault(options,'figure','gcf');
+-options=addfielddefault(options,'format','tiff');
+-options=addfielddefault(options,'resolution',2);
+-options=addfielddefault(options,'margin','on');
+-options=addfielddefault(options,'marginsize',5);
+-options=addfielddefault(options,'frame','on');
+-options=addfielddefault(options,'framesize',2);
+-options=addfielddefault(options,'framecolor','black');
+-options=addfielddefault(options,'trim','on');
+-options=addfielddefault(options,'hardcopy','off');
+-
+-%get fig: 
+-fig=getfieldvalue(options,'figure');
+-if ischar(fig),
+-	fig=gcf;
+-else
+-	figure(fig);
+-	fig=gcf;
+-end
+-
+-%In auto mode, MATLAB prints the figure the same size as it appears on the computer screen, centered on the page
+-set(fig, 'PaperPositionMode', 'auto');
+-
+-%InvertHardcopy off imposes MATLAB to use the same colors
+-set(fig, 'InvertHardcopy', getfieldvalue(options,'hardcopy'));
+-
+-
+-%we could have several formats, as a cell array of strings.
+-formats=format;
+-if ~iscell(formats),
+-	formats={formats};
+-end
+-
+-%loop on formats:
+-for i=1:length(formats),
+-	format=formats{i};
+-
+-	%Use higher resolution to anti-alias and use zbuffer to have smooth colors
+-	print(fig, '-zbuffer','-dtiff',['-r' num2str(get(0,'ScreenPixelsPerInch')*getfieldvalue(options,'resolution'))],filename);
+-
+-	%some trimming involved? 
+-	if ~strcmpi(format,'pdf'),
+-		if strcmpi(getfieldvalue(options,'trim'),'on'),
+-			system(['convert -trim ' filename '.tif ' filename '.tif']);
+-		end
+-	end
+-
+-	%margin?
+-	if ~strcmpi(format,'pdf'),
+-		if strcmpi(getfieldvalue(options,'margin'),'on'),
+-			marginsize=getfieldvalue(options,'marginsize');
+-			system(['convert -border ' num2str(marginsize) 'x' num2str(marginsize) ' -bordercolor "white" ' filename '.tif ' filename '.tif']);
+-		end
+-	end
+-
+-	%frame?
+-	if ~strcmpi(format,'pdf'),
+-		if strcmpi(getfieldvalue(options,'frame'),'on'),
+-			framesize=getfieldvalue(options,'framesize');
+-			framecolor=getfieldvalue(options,'framecolor');
+-			system(['convert -border ' num2str(framesize) 'x' num2str(framesize) ' -bordercolor "' framecolor '" ' filename '.tif ' filename '.tif']);
+-		end
+-	end
+-
+-	%convert image to correct format
+-	if ~strcmpi(format,'tiff') & ~strcmpi(format,'tif'),
+-		system(['convert ' filename '.tif ' filename '.' format]);
+-		delete([ filename '.tif']);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/contourmassbalance.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/contourmassbalance.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/contourmassbalance.m	(revision 13006)
+@@ -1,45 +0,0 @@
+-function dhdt=contourmassbalance(md,file)
+-%CONTOURMASSBALANCE - compute the mass balance on a given profile
+-%
+-%   Usage:
+-%      dhdt=contourmassbalance(md,file)
+-
+-%some checks
+-if nargin~=2,
+-	help contourmassbalance
+-	error('contourmassbalance error message: bad usage');
+-end
+-if ((length(md.initialization.vx)~=md.mesh.numberofvertices)|(length(md.initialization.vy)~=md.mesh.numberofvertices))
+-	error(['thicknessevolution error message: vx and vy should have a length of ' num2str(md.mesh.numberofvertices)])
+-end
+-if ~exist(file),
+-	error(['thicknessevolution error message: file ' file ' not found']);
+-end
+-
+-%Get segments enveloping contour
+-segments=contourenvelope(md,file);
+-%md.diagnostic.icefront=segments; plotmodel(md,'data','pressureload','expdisp',file);
+-
+-%get flag list of elements and nodes inside the contour
+-nodein=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,file,'node',1);
+-elemin=(sum(nodein(md.mesh.elements),2)==size(md.mesh.elements,2));
+-
+-%conputing Mass flux
+-x=md.mesh.x;
+-y=md.mesh.y;
+-vx=mean(md.initialization.vx(segments(:,1:end-1)),2);
+-vy=mean(md.initialization.vy(segments(:,1:end-1)),2);
+-H=mean(md.geometry.thickness(segments(:,1:end-1)),2);
+-nx=cos(atan2((x(segments(:,1))-x(segments(:,2))) , (y(segments(:,2))-y(segments(:,1)))));
+-ny=sin(atan2((x(segments(:,1))-x(segments(:,2))) , (y(segments(:,2))-y(segments(:,1)))));
+-L=sqrt((x(segments(:,1))-x(segments(:,2))).^2+(y(segments(:,2))-y(segments(:,1))).^2);
+-flux = - md.materials.rho_ice*sum(L.*H.*(vx.*nx+vy.*ny)); %outflux is negative!
+-disp(['mass outflux on ' file ' = ' num2str(-flux/10^9) ' Gt/yr']);
+-areas=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
+-dhdt=flux/(sum(areas(find(elemin)))*md.materials.rho_ice);
+-disp(['dhdt on ' file ' (Flux  method) = ' num2str(dhdt) ' m/yr']);
+-
+-dhdt=thicknessevolution(md);
+-in=find(elemin);
+-dhdt=sum(dhdt(in).*areas(in))/sum(areas(in));
+-disp(['dhdt on ' file ' (divHV method) = ' num2str(dhdt) ' m/yr']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.py	(revision 13006)
+@@ -0,0 +1,235 @@
++import struct
++import numpy
++from MatlabFuncs import *
++from MatlabProcessPatch import *
++
++def parseresultsfromdisk(filename,iosplit):
++	"""
++	PARSERESULTSFROMDISK - ...
++
++	   Usage:
++	      results=parseresultsfromdisk(filename,iosplit)
++	"""
++
++	if iosplit:
++		results=parseresultsfromdiskiosplit(filename)
++	else:
++		results=parseresultsfromdiskioserial(filename)
++
++	#process patch if necessary
++	results=MatlabProcessPatch(results)
++
++	return results
++
++def parseresultsfromdiskioserial(filename):    # {{{
++	"""
++	PARSERESULTSFROMDISK - ...
++	 
++	    Usage:
++	       results=parseresultsfromdiskioserial(filename)
++	"""
++
++	#Open file
++	try:
++		fid=open(filename,'rb')
++	except IOError as e:
++		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
++
++	results={}
++
++	#Read fields until the end of the file.
++	result=ReadData(fid)
++	while result:
++		#Get time and step
++		if not result['step'] in results:
++			results[result['step']]={}
++			results[result['step']]['step']=result['step']
++			results[result['step']]['time']=result['time'] 
++	
++		#Add result
++		if result['step'] in results and \
++		   result['fieldname'] in results[result['step']] and \
++		   not strcmp(result['fieldname'],'SolutionType'):
++			results[result['step']][result['fieldname']]=numpy.concatenate((results[result['step']][result['fieldname']],result['field']),axis=0)
++		else:
++			results[result['step']][result['fieldname']]=result['field']
++
++		#read next result
++		result=ReadData(fid)
++
++	fid.close()
++
++	return results
++	# }}}
++
++def parseresultsfromdiskiosplit(filename):    # {{{
++	"""
++	PARSERESULTSFROMDISKIOSPLIT - ...
++	 
++	    Usage:
++	       results=parseresultsfromdiskiosplit(filename)
++	"""
++
++	#Open file
++	try:
++		fid=open(filename,'rb')
++	except IOError as e:
++		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
++
++	results={}
++
++	#if we have done split I/O, ie, we have results that are fragmented across patches, 
++	#do a first pass, and figure out the structure of results
++	result=ReadDataDimensions(fid)
++	while result:
++
++		#Get time and step
++		if not result['step'] in results:
++			results[result['step']]={}
++			results[result['step']]['step']=result['step']
++			results[result['step']]['time']=result['time'] 
++
++		#Add result
++		if strcmpi(result['fieldname'],'Patch'):
++			results[result['step']][result['fieldname']]=[0,result['N']]
++		else:
++			results[result['step']][result['fieldname']]=float('NaN')
++
++		#read next result
++		result=ReadDataDimensions(fid)
++
++	#do a second pass, and figure out the size of the patches
++	fid.seek(0)    #rewind
++	result=ReadDataDimensions(fid)
++	while result:
++
++		#Add result
++		if strcmpi(result['fieldname'],'Patch'):
++			patchdimensions=results[result['step']][result['fieldname']]
++			results[result['step']][result['fieldname']]=[patchdimensions[0]+result['M'],result['N']]
++
++		#read next result
++		result=ReadDataDimensions(fid)
++
++	#allocate patches
++	for result in results.itervalues():
++		if 'Patch' in result:
++			result['Patch']=numpy.zeros(shape=(result['Patch'][0],result['Patch'][1]),dtype=float)
++			result['counter']=0    #use to index into the patch
++
++	#third pass, this time to read the real information
++	fid.seek(0)    #rewind
++	result=ReadData(fid)
++	while result:
++
++		#Get time and step
++		if not result['step'] in results:
++			results[result['step']]={}
++			results[result['step']]['step']=result['step']
++			results[result['step']]['time']=result['time'] 
++
++		#Add result
++		if strcmpi(result['fieldname'],'Patch'):
++			counter=results[result['step']]['counter']
++			counter2=counter+result['field'].shape[0]-1
++			results[result['step']][result['fieldname']][counter:counter2,:]=result['field']
++
++			#increment counter: 
++			results[result['step']]['counter']=counter2+1
++		else:
++			results[result['step']][result['fieldname']]=result['field']
++
++		#read next result
++		result=ReadData(fid)
++
++	#close file
++	fid.close()
++
++	return results
++	# }}}
++
++def ReadData(fid):    # {{{
++	"""
++	READDATA - ...
++	 
++	    Usage:
++	       field=ReadData(fid)
++	"""
++
++	#read field
++	try:
++		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
++		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
++		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		if   type==1:
++			field=numpy.array(struct.unpack('%dd' % M,fid.read(M*struct.calcsize('d'))),dtype=float)
++		elif type==2:
++			field=struct.unpack('%ds' % M,fid.read(M))[0][:-1]
++		elif type==3:
++			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++#			field=transpose(fread(fid,[N M],'double'));
++			field=numpy.zeros(shape=(M,N),dtype=float)
++			for i in xrange(M):
++				field[i,:]=struct.unpack('%dd' % N,fid.read(N*struct.calcsize('d')))
++		else:
++			raise TypeError("cannot read data of type %d" % type)
++
++		result={}
++		result['fieldname']=fieldname
++		result['time']=time
++		result['step']=step
++		result['field']=field
++
++	except struct.error as e:
++		result={}
++
++	return result
++	# }}}
++
++def ReadDataDimensions(fid):    # {{{
++	"""
++	READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
++	 
++	    Usage:
++	       field=ReadDataDimensions(fid)
++	"""
++
++	#read field
++	try:
++		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
++		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
++		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		N=1    #default
++		if   type==1:
++			fid.seek(M*8,1)
++		elif type==2:
++			fid.seek(M,1)
++		elif type==3:
++			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++			fid.seek(N*M*8,1)
++		else:
++			raise TypeError("cannot read data of type %d" % type)
++
++		result={}
++		result['fieldname']=fieldname
++		result['time']=time
++		result['step']=step
++		result['M']=M
++		result['N']=N
++
++	except struct.error as e:
++		result={}
++
++	return result
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.m	(revision 13006)
+@@ -0,0 +1,212 @@
++function results=parseresultsfromdisk(filename,iosplit)
++%PARSERESULTSFROMDISK - ...
++%
++%   Usage:
++%      results=parseresultsfromdisk(filename,iosplit)
++
++if iosplit,
++	results=parseresultsfromdiskiosplit(filename);
++else
++	results=parseresultsfromdiskioserial(filename);
++end
++
++%process patch if necessary
++results=MatlabProcessPatch(results);
++
++function results=parseresultsfromdiskioserial(filename) % {{{
++%PARSERESULTSFROMDISK - ...
++%
++%   Usage:
++%      results=parseresultsfromdiskioserial(filename)
++
++
++%Open file
++fid=fopen(filename,'rb');
++if(fid==-1),
++	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
++end
++results=struct();
++
++%Read fields until the end of the file.
++result=ReadData(fid);
++while ~isempty(result), 
++	%Get time and step
++	results(result.step).step=result.step;
++	results(result.step).time=result.time; 
++
++	%Add result
++	if (length(results)>=result.step & isfield(results,result.fieldname) & ~strcmp(result.fieldname,'SolutionType')),
++			results(result.step).(result.fieldname)=[ results(result.step).(result.fieldname); result.field];
++	else
++		results(result.step).(result.fieldname)=result.field;
++	end
++
++	%read next result
++	result=ReadData(fid);
++
++end
++
++fclose(fid);
++% }}}
++function results=parseresultsfromdiskiosplit(filename) % {{{
++%PARSERESULTSFROMDISKIOSPLIT - ...
++%
++%   Usage:
++%      results=parseresultsfromdiskiosplit(filename)
++
++
++%Open file
++fid=fopen(filename,'rb');
++if(fid==-1),
++	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
++end
++results=struct();
++
++%if we have done split I/O, ie, we have results that are fragmented across patches, 
++%do a first pass, and figure out the structure of results
++result=ReadDataDimensions(fid);
++while ~isempty(result),
++
++	%Get time and step
++	results(result.step).step=result.step;
++	results(result.step).time=result.time; 
++
++	%Add result
++	if strcmpi(result.fieldname,'Patch'),
++		results(result.step).(result.fieldname)=[0 result.N];
++	else
++		results(result.step).(result.fieldname)=NaN;
++	end
++
++	%read next result
++	result=ReadDataDimensions(fid);
++end
++
++%do a second pass, and figure out the size of the patches
++fseek(fid,0,-1); %rewind
++result=ReadDataDimensions(fid);
++while ~isempty(result),
++
++	%Add result
++	if strcmpi(result.fieldname,'Patch'),
++		patchdimensions=results(result.step).(result.fieldname);
++		results(result.step).(result.fieldname)=[patchdimensions(1)+result.M result.N];
++	end
++
++	%read next result
++	result=ReadDataDimensions(fid);
++end
++
++%allocate patches
++for i=1:length(results),
++	results(i).Patch=zeros(results(i).Patch(1),results(i).Patch(2));
++	results(i).counter=1; %use to index into the patch
++end
++
++%third pass, this time to read the real information
++fseek(fid,0,-1); %rewind
++result=ReadData(fid);
++while ~isempty(result),
++
++	%Get time and step
++	results(result.step).step=result.step;
++	results(result.step).time=result.time; 
++
++	%Add result
++	if strcmpi(result.fieldname,'Patch'),
++		counter=results(result.step).counter;
++		counter2=counter+size(result.field,1)-1;
++		results(result.step).(result.fieldname)(counter:counter2,:)=result.field;
++
++		%increment counter: 
++		results(result.step).counter=counter2+1;
++	else
++		results(result.step).(result.fieldname)=result.field;
++	end
++
++	%read next result
++	result=ReadData(fid);
++
++end
++
++%close file
++fclose(fid);
++	% }}}
++function result=ReadData(fid) % {{{
++%READDATA - ...
++%
++%   Usage:
++%      field=ReadData(fid)
++
++%read field
++[length,count]=fread(fid,1,'int');
++
++if count==0,
++	result=struct([]);
++else
++	fieldname=fread(fid,length,'char');
++	fieldname=fieldname(1:end-1)';
++	fieldname=char(fieldname);
++	time=fread(fid,1,'double');
++	step=fread(fid,1,'int');
++
++	type=fread(fid,1,'int');
++	M=fread(fid,1,'int');
++	if type==1,
++		field=fread(fid,M,'double');
++	elseif type==2,
++		field=fread(fid,M,'char');
++		field=char(field(1:end-1)');
++	elseif type==3,
++		N=fread(fid,1,'int');
++		field=transpose(fread(fid,[N M],'double'));
++	else
++		error(['cannot read data of type ' num2str(type) ]);
++	end
++
++	result.fieldname=fieldname;
++	result.time=time;
++	result.step=step;
++	result.field=field;
++end
++% }}}
++function result=ReadDataDimensions(fid) % {{{
++%READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
++%
++%   Usage:
++%      field=ReadDataDimensions(fid)
++
++
++%read field
++[length,count]=fread(fid,1,'int');
++
++if count==0,
++	result=struct([]);
++else
++	fieldname=fread(fid,length,'char');
++	fieldname=fieldname(1:end-1)';
++	fieldname=char(fieldname);
++	time=fread(fid,1,'double');
++	step=fread(fid,1,'int');
++
++	type=fread(fid,1,'int');
++	M=fread(fid,1,'int');
++	N=1; %default
++	if type==1,
++		fseek(fid,M*8,0);
++	elseif type==2,
++		fseek(fid,M,0);
++	elseif type==3,
++		N=fread(fid,1,'int');
++		fseek(fid,N*M*8,0);
++	else
++		error(['cannot read data of type ' num2str(type) ]);
++	end
++
++	result.fieldname=fieldname;
++	result.time=time;
++	result.step=step;
++	result.M=M;
++	result.N=N;
++end
++% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.py	(revision 13006)
+@@ -0,0 +1,64 @@
++import os
++import socket
++import time
++from MatlabFuncs import *
++
++def waitonlock(md,executionpath,login,port):
++	"""
++	WAITONLOCK - wait for a file
++ 
++	   This routine will return when a file named 'filename' is written to disk.
++	   If the time limit given in input is exceeded, return 0
++ 
++	   Usage:
++	      flag=waitonlock(md,executionpath)
++	"""
++
++	#Get filename (lock file) and options
++	executionpath=md.cluster.executionpath
++	cluster=md.cluster.name
++	login=md.cluster.login
++	port=md.cluster.port
++	timelimit=md.settings.waitonlock
++	filename=os.path.join(executionpath,md.private.runtimename,md.miscellaneous.name+'.lock')
++
++	#waitonlock will work if the lock is on the same machine only: 
++	if not strcmpi(socket.gethostname().lower().split('.')[0],cluster):
++
++		print 'solution launched on remote cluster. log in to detect job completion.'
++		choice=raw_input('Is the job successfully completed? (y/n) ')
++		if not strcmp(choice,'y'): 
++			print 'Results not loaded... exiting' 
++			flag=0
++		else:
++			flag=1
++
++	#job is running on the same machine
++	else:
++
++		if 'interactive' in vars(md.cluster) and md.cluster.interactive:
++			#We are in interactive mode, no need to check for job completion
++			flag=1
++			return flag
++		#initialize time and file presence test flag
++		etime=0
++		ispresent=0
++		print "waiting for '%s' hold on... (Ctrl+C to exit)" % filename
++
++		#loop till file .lock exist or time is up
++		while ispresent==0 and etime<timelimit:
++			ispresent=os.path.exist(filename)
++			time.sleep(1)
++			etime+=1/60
++
++		#build output
++		if etime>timelimit:
++			print 'Time limit exceeded. Increase md.settings.waitonlock'
++			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
++			raise RuntimeError('waitonlock error message: time limit exceeded.')
++			flag=0
++		else:
++			flag=1
++
++	return flag
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.m	(revision 13006)
+@@ -0,0 +1,58 @@
++function flag=waitonlock(md,executionpath,login,port)
++%WAITONLOCK - wait for a file
++%
++%   This routine will return when a file named 'filename' is written to disk.
++%   If the time limit given in input is exceeded, return 0
++%
++%   Usage:
++%      flag=waitonlock(md,executionpath)
++
++%Get filename (lock file) and options
++executionpath=md.cluster.executionpath;
++cluster=md.cluster.name;
++login=md.cluster.login;
++port=md.cluster.port;
++timelimit=md.settings.waitonlock;
++filename=[executionpath '/' md.private.runtimename '/' md.miscellaneous.name '.lock'];
++
++%waitonlock will work if the lock is on the same machine only: 
++if ~strcmpi(oshostname(),cluster),
++
++	disp('solution launched on remote cluster. log in to detect job completion.');
++	choice=input('Is the job successfully completed? (y/n)','s');
++	if ~strcmp(choice,'y'), 
++		disp('Results not loaded... exiting'); 
++		flag=0;
++	else
++		flag=1;
++	end
++
++%job is running on the same machine
++else
++
++	if ismember('interactive',properties(md.cluster)) & md.cluster.interactive
++		%We are in interactive mode, no need to check for job completion
++		flag=1;
++		return;
++	end
++	%initialize time and file presence test flag
++	time=0; ispresent=0;
++	disp(['waiting for ' filename ' hold on... (Ctrl+C to exit)'])
++
++	%loop till file .lock exist or time is up
++	while (ispresent==0 & time<timelimit)
++		ispresent=exist(filename,'file');
++		pause(1);
++		time=time+1/60;
++	end
++
++	%build output
++	if (time>timelimit),
++		disp('Time limit exceeded. Increase md.settings.waitonlock');
++		disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
++		error(['waitonlock error message: time limit exceeded']);
++		flag=0;
++	else
++		flag=1;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontroldrag.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontroldrag.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontroldrag.m	(revision 13006)
+@@ -0,0 +1,121 @@
++function md=parametercontroldrag(md,varargin),
++%PARAMETERCONTROLDRAG - parameterization for control method on drag
++%
++%   It is possible to specify the number of steps, values for the
++%   minimum and maximum values of the drag, the 
++%   kind of cm_responses to use or the the optscal.
++%   
++%   Usage:
++%       md=parametercontroldrag(md,varargin)
++%
++%   Example:
++%      md=parametercontroldrag(md)
++%      md=parametercontroldrag(md,'nsteps',20,'cm_responses',0)
++%      md=parametercontroldrag(md,'cm_min',1,'cm_max',150,'cm_jump',0.99,'maxiter',20)
++%      md=parametercontroldrag(md,eps_cm',10^-4,'optscal',[10^7 10^8])
++%
++%   See also PARAMETERCONTROLB
++
++%process options
++options=pairoptions(varargin{:});
++
++%control type
++md.inversion.control_parameters={'FrictionCoefficient'};
++
++%weights
++weights=getfieldvalue(options,'weights',ones(md.mesh.numberofvertices,1));
++if (length(weights)~=md.mesh.numberofvertices)
++	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++else
++	md.inversion.cost_functions_coefficients=weights;
++end
++
++%nsteps
++nsteps=getfieldvalue(options,'nsteps',100);
++if (length(nsteps)~=1 | nsteps<=0 | floor(nsteps)~=nsteps)
++	md.inversion.nsteps=100;
++else
++	md.inversion.nsteps=nsteps;
++end
++
++%cm_min
++cm_min=getfieldvalue(options,'cm_min',1*ones(md.mesh.numberofvertices,1));
++if (length(cm_min)==1)
++	md.inversion.min_parameters=cm_min*ones(md.mesh.numberofvertices,1);
++elseif (length(cm_min)==md.mesh.numberofvertices)
++	md.inversion.min_parameters=cm_min;
++else
++	md.inversion.min_parameters=cm_min;
++end
++
++%cm_max
++cm_max=getfieldvalue(options,'cm_max',250*ones(md.mesh.numberofvertices,1));
++if (length(cm_max)==1)
++	md.inversion.max_parameters=cm_max*ones(md.mesh.numberofvertices,1);
++elseif (length(cm_max)==md.mesh.numberofvertices)
++	md.inversion.max_parameters=cm_max;
++else
++	md.inversion.max_parameters=cm_max;
++end
++
++%eps_cm
++eps_cm=getfieldvalue(options,'eps_cm',NaN);
++if (length(eps_cm)~=1 | eps_cm<0 )
++	md.inversion.cost_function_threshold=NaN;
++else
++	md.inversion.cost_function_threshold=eps_cm;
++end
++
++%maxiter
++maxiter=getfieldvalue(options,'maxiter',10*ones(md.inversion.nsteps,1));
++if (any(maxiter<0) | any(floor(maxiter)~=maxiter))
++	md.inversion.maxiter_per_step=10*ones(md.inversion.nsteps,1);
++else
++	md.inversion.maxiter_per_step=repmat(maxiter(:),md.inversion.nsteps,1);
++	md.inversion.maxiter_per_step(md.inversion.nsteps+1:end)=[];
++end
++
++%cm_jump
++cm_jump=getfieldvalue(options,'cm_jump',0.8*ones(md.inversion.nsteps,1));
++if ~isreal(cm_jump)
++	md.inversion.step_threshold=0.8*ones(md.inversion.nsteps,1);
++else
++	md.inversion.step_threshold=repmat(cm_jump(:),md.inversion.nsteps,1);
++	md.inversion.step_threshold(md.inversion.nsteps+1:end)=[];
++end
++
++%cm_responses
++found=0;
++if exist(options,'cm_responses'),
++	cm_responses=getfieldvalue(options,'cm_responses');
++	if ~any(~ismember(cm_responses,[101 105]))
++		md.inversion.cost_functions=repmat(cm_responses(:),md.inversion.nsteps,1);
++		md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
++		found=1;
++	end
++end
++if ~found
++	third=ceil(md.inversion.nsteps/3);
++	md.inversion.cost_functions=[...
++		103*ones(third,1);...
++		101*ones(third,1);...
++		repmat([101;101;103;101],third,1)...
++		];
++	md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
++end
++
++%optscal
++found=0;
++if exist(options,'optscal'),
++	optscal=getfieldvalue(options,'optscal');
++	if ~any(optscal<0),
++		md.inversion.gradient_scaling=repmat(optscal(:),md.inversion.nsteps,1);
++		md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
++		found=1;
++	end
++end
++if ~found
++	third=ceil(md.inversion.nsteps/3);
++	md.inversion.gradient_scaling=[50*ones(3,1);15*ones(third-3,1);10*ones(third,1);repmat([10;10;20;10],third,1)];
++	md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontrolB.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontrolB.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontrolB.m	(revision 13006)
+@@ -0,0 +1,122 @@
++function md=parametercontrolB(md,varargin),
++%PARAMETERCONTROLB - parameterization for control method on B
++%
++%   It is possible to specify the number of steps, values for the
++%   minimum and maximum values of B, the 
++%   kind of cm_responses to use or the the optscal.
++%   
++%   Usage:
++%       md=parametercontrolB(md,varargin)
++%
++%   Example:
++%      md=parametercontrolB(md)
++%      md=parametercontrolB(md,'nsteps',20,'cm_responses',0)
++%      md=parametercontrolB(md,'cm_min',10,'cm_max',10^8,'cm_jump',0.99,'maxiter',20)
++%      md=parametercontrolB(md,eps_cm',10^-4,'optscal',[10^7 10^8])
++%
++%   See also  PARAMETERCONTROLDRAG
++
++%process options
++options=pairoptions(varargin{:});
++
++%control type
++md.inversion.control_parameters={'MaterialsRheologyBbar'};
++
++%weights
++weights=getfieldvalue(options,'weights',ones(md.mesh.numberofvertices,1));
++if (length(weights)~=md.mesh.numberofvertices)
++	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++else
++	md.inversion.cost_functions_coefficients=weights;
++end
++
++%nsteps
++nsteps=getfieldvalue(options,'nsteps',100);
++if (length(nsteps)~=1 | nsteps<=0 | floor(nsteps)~=nsteps)
++	md.inversion.nsteps=100;
++else
++	md.inversion.nsteps=nsteps;
++end
++
++
++%cm_min
++cm_min=getfieldvalue(options,'cm_min',paterson(273.15+5)*ones(md.mesh.numberofvertices,1));
++if (length(cm_min)==1)
++	md.inversion.min_parameters=cm_min*ones(md.mesh.numberofvertices,1);
++elseif (length(cm_min)==md.mesh.numberofvertices)
++	md.inversion.min_parameters=cm_min;
++else
++	md.inversion.min_parameters=cm_min;
++end
++
++%cm_max
++cm_max=getfieldvalue(options,'cm_max',paterson(273.15-70)*ones(md.mesh.numberofvertices,1));
++if (length(cm_max)==1)
++	md.inversion.max_parameters=cm_max*ones(md.mesh.numberofvertices,1);
++elseif (length(cm_max)==md.mesh.numberofvertices)
++	md.inversion.max_parameters=cm_max;
++else
++	md.inversion.max_parameters=cm_max;
++end
++
++%eps_cm
++eps_cm=getfieldvalue(options,'eps_cm',NaN);
++if (length(eps_cm)~=1 | eps_cm<0 )
++	md.inversion.cost_function_threshold=NaN;
++else
++	md.inversion.cost_function_threshold=eps_cm;
++end
++
++%maxiter
++maxiter=getfieldvalue(options,'maxiter',10*ones(md.inversion.nsteps,1));
++if (any(maxiter<0) | any(floor(maxiter)~=maxiter))
++	md.inversion.maxiter_per_step=10*ones(md.inversion.nsteps,1);
++else
++	md.inversion.maxiter_per_step=repmat(maxiter(:),md.inversion.nsteps,1);
++	md.inversion.maxiter_per_step(md.inversion.nsteps+1:end)=[];
++end
++
++%cm_jump
++cm_jump=getfieldvalue(options,'cm_jump',0.9*ones(md.inversion.nsteps,1));
++if ~isreal(cm_jump)
++	md.inversion.step_threshold=0.9*ones(md.inversion.nsteps,1);
++else
++	md.inversion.step_threshold=repmat(cm_jump(:),md.inversion.nsteps,1);
++	md.inversion.step_threshold(md.inversion.nsteps+1:end)=[];
++end
++
++%cm_responses
++found=0;
++if exist(options,'cm_responses'),
++	cm_responses=getfieldvalue(options,'cm_responses');
++	if ~any(~ismember(cm_responses,[ 101:105])),
++		md.inversion.cost_functions=repmat(cm_responses(:),md.inversion.nsteps,1);
++		md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
++		found=1;
++	end
++end
++if ~found
++	third=ceil(md.inversion.nsteps/3);
++	md.inversion.cost_functions=[...
++		103*ones(third,1);...
++		101*ones(third,1);...
++		repmat([101;101;103;101],third,1)...
++		];
++	md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
++end
++
++%optscal
++found=0;
++if exist(options,'optscal'),
++	optscal=getfieldvalue(options,'optscal');
++	if ~any(optscal<0),
++		md.inversion.gradient_scaling=repmat(optscal(:),md.inversion.nsteps,1);
++		md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
++		found=1;
++	end
++end
++if ~found
++	third=ceil(md.inversion.nsteps/3);
++	md.inversion.gradient_scaling=[2*10^8*ones(3,1);10^8*ones(third-3,1);10^7*ones(2*third,1);];
++	md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/print/printmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/print/printmodel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/print/printmodel.m	(revision 13006)
+@@ -0,0 +1,100 @@
++function printmodel(filename,format,varargin)
++%PRINTMODEL - save an image of current figure
++%
++%   filename: output name of image file (no extension)
++%   format: image format (ex: 'tiff','jpg','pdf') 
++%
++%   List of options to printfmodel: 
++%
++%   figure: number of figure to print (default: current figure)
++%   resolution: use higher resolution to anti-alias (default 2)
++%   margin: add margin around final image  
++%   marginsize: size of margin around final image (default 5)
++%   frame: add frame around final image
++%   framesize: size of frame around final image (default 5)
++%   framecolor: color of frame around final image (default 'black')
++%   trim: trim empty space around image (default 'off')
++%   hardcopy: 'off' to impose MATLAB to use the same colors (default 'off')
++%   
++%   Usage:
++%      printmodel(filename,format,varargin);
++%
++%   Examples:
++%      printmodel('image','tiff')
++%      printmodel('image','eps','margin','on','frame','on','hardcopy','on')
++
++
++%get options: 
++options=pairoptions(varargin{:});
++
++%set defaults
++options=addfielddefault(options,'figure','gcf');
++options=addfielddefault(options,'format','tiff');
++options=addfielddefault(options,'resolution',1);
++options=addfielddefault(options,'margin','on');
++options=addfielddefault(options,'marginsize',25);
++options=addfielddefault(options,'frame','on');
++options=addfielddefault(options,'framesize',3);
++options=addfielddefault(options,'framecolor','black');
++options=addfielddefault(options,'trim','on');
++options=addfielddefault(options,'hardcopy','off');
++
++%get fig: 
++fig=getfieldvalue(options,'figure');
++if ischar(fig),
++	fig=gcf;
++else
++	figure(fig);
++	fig=gcf;
++end
++
++%In auto mode, MATLAB prints the figure the same size as it appears on the computer screen, centered on the page
++set(fig, 'PaperPositionMode', 'auto');
++
++%InvertHardcopy off imposes MATLAB to use the same colors
++set(fig, 'InvertHardcopy', getfieldvalue(options,'hardcopy'));
++
++
++%we could have several formats, as a cell array of strings.
++formats=format;
++if ~iscell(formats),
++	formats={formats};
++end
++
++%loop on formats:
++for i=1:length(formats),
++	format=formats{i};
++
++	%Use higher resolution to anti-alias and use zbuffer to have smooth colors
++	print(fig, '-zbuffer','-dtiff',['-r' num2str(get(0,'ScreenPixelsPerInch')*getfieldvalue(options,'resolution'))],filename);
++
++	%some trimming involved? 
++	if ~strcmpi(format,'pdf'),
++		if strcmpi(getfieldvalue(options,'trim'),'on'),
++			system(['convert -trim ' filename '.tif ' filename '.tif']);
++		end
++	end
++
++	%margin?
++	if ~strcmpi(format,'pdf'),
++		if strcmpi(getfieldvalue(options,'margin'),'on'),
++			marginsize=getfieldvalue(options,'marginsize');
++			system(['convert -border ' num2str(marginsize) 'x' num2str(marginsize) ' -bordercolor "white" ' filename '.tif ' filename '.tif']);
++		end
++	end
++
++	%frame?
++	if ~strcmpi(format,'pdf'),
++		if strcmpi(getfieldvalue(options,'frame'),'on'),
++			framesize=getfieldvalue(options,'framesize');
++			framecolor=getfieldvalue(options,'framecolor');
++			system(['convert -border ' num2str(framesize) 'x' num2str(framesize) ' -bordercolor "' framecolor '" ' filename '.tif ' filename '.tif']);
++		end
++	end
++
++	%convert image to correct format
++	if ~strcmpi(format,'tiff') & ~strcmpi(format,'tif'),
++		system(['convert ' filename '.tif ' filename '.' format]);
++		delete([ filename '.tif']);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parametercontroldrag.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parametercontroldrag.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parametercontroldrag.m	(revision 13006)
+@@ -1,121 +0,0 @@
+-function md=parametercontroldrag(md,varargin),
+-%PARAMETERCONTROLDRAG - parameterization for control method on drag
+-%
+-%   It is possible to specify the number of steps, values for the
+-%   minimum and maximum values of the drag, the 
+-%   kind of cm_responses to use or the the optscal.
+-%   
+-%   Usage:
+-%       md=parametercontroldrag(md,varargin)
+-%
+-%   Example:
+-%      md=parametercontroldrag(md)
+-%      md=parametercontroldrag(md,'nsteps',20,'cm_responses',0)
+-%      md=parametercontroldrag(md,'cm_min',1,'cm_max',150,'cm_jump',0.99,'maxiter',20)
+-%      md=parametercontroldrag(md,eps_cm',10^-4,'optscal',[10^7 10^8])
+-%
+-%   See also PARAMETERCONTROLB
+-
+-%process options
+-options=pairoptions(varargin{:});
+-
+-%control type
+-md.inversion.control_parameters={'FrictionCoefficient'};
+-
+-%weights
+-weights=getfieldvalue(options,'weights',ones(md.mesh.numberofvertices,1));
+-if (length(weights)~=md.mesh.numberofvertices)
+-	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-else
+-	md.inversion.cost_functions_coefficients=weights;
+-end
+-
+-%nsteps
+-nsteps=getfieldvalue(options,'nsteps',100);
+-if (length(nsteps)~=1 | nsteps<=0 | floor(nsteps)~=nsteps)
+-	md.inversion.nsteps=100;
+-else
+-	md.inversion.nsteps=nsteps;
+-end
+-
+-%cm_min
+-cm_min=getfieldvalue(options,'cm_min',1*ones(md.mesh.numberofvertices,1));
+-if (length(cm_min)==1)
+-	md.inversion.min_parameters=cm_min*ones(md.mesh.numberofvertices,1);
+-elseif (length(cm_min)==md.mesh.numberofvertices)
+-	md.inversion.min_parameters=cm_min;
+-else
+-	md.inversion.min_parameters=cm_min;
+-end
+-
+-%cm_max
+-cm_max=getfieldvalue(options,'cm_max',250*ones(md.mesh.numberofvertices,1));
+-if (length(cm_max)==1)
+-	md.inversion.max_parameters=cm_max*ones(md.mesh.numberofvertices,1);
+-elseif (length(cm_max)==md.mesh.numberofvertices)
+-	md.inversion.max_parameters=cm_max;
+-else
+-	md.inversion.max_parameters=cm_max;
+-end
+-
+-%eps_cm
+-eps_cm=getfieldvalue(options,'eps_cm',NaN);
+-if (length(eps_cm)~=1 | eps_cm<0 )
+-	md.inversion.cost_function_threshold=NaN;
+-else
+-	md.inversion.cost_function_threshold=eps_cm;
+-end
+-
+-%maxiter
+-maxiter=getfieldvalue(options,'maxiter',10*ones(md.inversion.nsteps,1));
+-if (any(maxiter<0) | any(floor(maxiter)~=maxiter))
+-	md.inversion.maxiter_per_step=10*ones(md.inversion.nsteps,1);
+-else
+-	md.inversion.maxiter_per_step=repmat(maxiter(:),md.inversion.nsteps,1);
+-	md.inversion.maxiter_per_step(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%cm_jump
+-cm_jump=getfieldvalue(options,'cm_jump',0.8*ones(md.inversion.nsteps,1));
+-if ~isreal(cm_jump)
+-	md.inversion.step_threshold=0.8*ones(md.inversion.nsteps,1);
+-else
+-	md.inversion.step_threshold=repmat(cm_jump(:),md.inversion.nsteps,1);
+-	md.inversion.step_threshold(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%cm_responses
+-found=0;
+-if exist(options,'cm_responses'),
+-	cm_responses=getfieldvalue(options,'cm_responses');
+-	if ~any(~ismember(cm_responses,[101 105]))
+-		md.inversion.cost_functions=repmat(cm_responses(:),md.inversion.nsteps,1);
+-		md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
+-		found=1;
+-	end
+-end
+-if ~found
+-	third=ceil(md.inversion.nsteps/3);
+-	md.inversion.cost_functions=[...
+-		103*ones(third,1);...
+-		101*ones(third,1);...
+-		repmat([101;101;103;101],third,1)...
+-		];
+-	md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%optscal
+-found=0;
+-if exist(options,'optscal'),
+-	optscal=getfieldvalue(options,'optscal');
+-	if ~any(optscal<0),
+-		md.inversion.gradient_scaling=repmat(optscal(:),md.inversion.nsteps,1);
+-		md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
+-		found=1;
+-	end
+-end
+-if ~found
+-	third=ceil(md.inversion.nsteps/3);
+-	md.inversion.gradient_scaling=[50*ones(3,1);15*ones(third-3,1);10*ones(third,1);repmat([10;10;20;10],third,1)];
+-	md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parametercontrolB.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parametercontrolB.m	(revision 13005)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parametercontrolB.m	(revision 13006)
+@@ -1,122 +0,0 @@
+-function md=parametercontrolB(md,varargin),
+-%PARAMETERCONTROLB - parameterization for control method on B
+-%
+-%   It is possible to specify the number of steps, values for the
+-%   minimum and maximum values of B, the 
+-%   kind of cm_responses to use or the the optscal.
+-%   
+-%   Usage:
+-%       md=parametercontrolB(md,varargin)
+-%
+-%   Example:
+-%      md=parametercontrolB(md)
+-%      md=parametercontrolB(md,'nsteps',20,'cm_responses',0)
+-%      md=parametercontrolB(md,'cm_min',10,'cm_max',10^8,'cm_jump',0.99,'maxiter',20)
+-%      md=parametercontrolB(md,eps_cm',10^-4,'optscal',[10^7 10^8])
+-%
+-%   See also  PARAMETERCONTROLDRAG
+-
+-%process options
+-options=pairoptions(varargin{:});
+-
+-%control type
+-md.inversion.control_parameters={'MaterialsRheologyBbar'};
+-
+-%weights
+-weights=getfieldvalue(options,'weights',ones(md.mesh.numberofvertices,1));
+-if (length(weights)~=md.mesh.numberofvertices)
+-	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-else
+-	md.inversion.cost_functions_coefficients=weights;
+-end
+-
+-%nsteps
+-nsteps=getfieldvalue(options,'nsteps',100);
+-if (length(nsteps)~=1 | nsteps<=0 | floor(nsteps)~=nsteps)
+-	md.inversion.nsteps=100;
+-else
+-	md.inversion.nsteps=nsteps;
+-end
+-
+-
+-%cm_min
+-cm_min=getfieldvalue(options,'cm_min',paterson(273.15+5)*ones(md.mesh.numberofvertices,1));
+-if (length(cm_min)==1)
+-	md.inversion.min_parameters=cm_min*ones(md.mesh.numberofvertices,1);
+-elseif (length(cm_min)==md.mesh.numberofvertices)
+-	md.inversion.min_parameters=cm_min;
+-else
+-	md.inversion.min_parameters=cm_min;
+-end
+-
+-%cm_max
+-cm_max=getfieldvalue(options,'cm_max',paterson(273.15-70)*ones(md.mesh.numberofvertices,1));
+-if (length(cm_max)==1)
+-	md.inversion.max_parameters=cm_max*ones(md.mesh.numberofvertices,1);
+-elseif (length(cm_max)==md.mesh.numberofvertices)
+-	md.inversion.max_parameters=cm_max;
+-else
+-	md.inversion.max_parameters=cm_max;
+-end
+-
+-%eps_cm
+-eps_cm=getfieldvalue(options,'eps_cm',NaN);
+-if (length(eps_cm)~=1 | eps_cm<0 )
+-	md.inversion.cost_function_threshold=NaN;
+-else
+-	md.inversion.cost_function_threshold=eps_cm;
+-end
+-
+-%maxiter
+-maxiter=getfieldvalue(options,'maxiter',10*ones(md.inversion.nsteps,1));
+-if (any(maxiter<0) | any(floor(maxiter)~=maxiter))
+-	md.inversion.maxiter_per_step=10*ones(md.inversion.nsteps,1);
+-else
+-	md.inversion.maxiter_per_step=repmat(maxiter(:),md.inversion.nsteps,1);
+-	md.inversion.maxiter_per_step(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%cm_jump
+-cm_jump=getfieldvalue(options,'cm_jump',0.9*ones(md.inversion.nsteps,1));
+-if ~isreal(cm_jump)
+-	md.inversion.step_threshold=0.9*ones(md.inversion.nsteps,1);
+-else
+-	md.inversion.step_threshold=repmat(cm_jump(:),md.inversion.nsteps,1);
+-	md.inversion.step_threshold(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%cm_responses
+-found=0;
+-if exist(options,'cm_responses'),
+-	cm_responses=getfieldvalue(options,'cm_responses');
+-	if ~any(~ismember(cm_responses,[ 101:105])),
+-		md.inversion.cost_functions=repmat(cm_responses(:),md.inversion.nsteps,1);
+-		md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
+-		found=1;
+-	end
+-end
+-if ~found
+-	third=ceil(md.inversion.nsteps/3);
+-	md.inversion.cost_functions=[...
+-		103*ones(third,1);...
+-		101*ones(third,1);...
+-		repmat([101;101;103;101],third,1)...
+-		];
+-	md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%optscal
+-found=0;
+-if exist(options,'optscal'),
+-	optscal=getfieldvalue(options,'optscal');
+-	if ~any(optscal<0),
+-		md.inversion.gradient_scaling=repmat(optscal(:),md.inversion.nsteps,1);
+-		md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
+-		found=1;
+-	end
+-end
+-if ~found
+-	third=ceil(md.inversion.nsteps/3);
+-	md.inversion.gradient_scaling=[2*10^8*ones(3,1);10^8*ones(third-3,1);10^7*ones(2*third,1);];
+-	md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.py	(revision 13006)
+@@ -0,0 +1,278 @@
++import numpy
++from model import *
++from pairoptions import *
++from recover_areas import *
++from MatlabFuncs import *
++
++def setflowequation(md,*args):
++	"""
++	SETELEMENTSTYPE - associate a solution type to each element
++
++	   This routine works like plotmodel: it works with an even number of inputs
++	   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
++	   that must be followed by the corresponding exp file or flags list
++	   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
++	   If user wants every element outside the domain to be 
++	   setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
++	   an empty string '' will be considered as an empty domain
++	   a string 'all' will be considered as the entire domain
++	   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
++
++	   Usage:
++	      md=setflowequation(md,varargin)
++
++	   Example:
++	      md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
++	      md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
++	"""
++
++	#some checks on list of arguments
++	if not isinstance(md,model) or not len(args):
++		raise TypeError("setflowequation error message")
++
++	#Find_out what kind of coupling to use
++	options=pairoptions(*args)
++	coupling_method=options.getfieldvalue('coupling','tiling')
++	if not strcmpi(coupling_method,'tiling') and not strcmpi(coupling_method,'penalties'):
++		raise TypeError("coupling type can only be: tiling or penalties")
++
++	hutterflag,macayealflag,pattynflag,stokesflag,filltype=recover_areas(md,*args)
++
++	#Flag the elements that have not been flagged as filltype
++	if   strcmpi(filltype,'hutter'):
++		hutterflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(macayealflag,pattynflag)))]=1
++	elif strcmpi(filltype,'macayeal'):
++		macayealflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(pattynflag,stokesflag))))]=1
++	elif strcmpi(filltype,'pattyn'):
++		pattynflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(macayealflag,stokesflag))))]=1
++
++	#check that each element has at least one flag
++	if not numpy.any(hutterflag+macayealflag+pattynflag+stokesflag):
++		raise TypeError("setflowequation error message: elements type not assigned, must be specified")
++
++	#check that each element has only one flag
++	if numpy.any(hutterflag+macayealflag+pattynflag+stokesflag>1):
++		print "setflowequation warning message: some elements have several types, higher order type is used for them"
++		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,macayealflag))]=0
++		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,pattynflag))]=0
++		macayealflag[numpy.nonzero(numpy.logical_and(macayealflag,pattynflag))]=0
++
++	#Check that no pattyn or stokes for 2d mesh
++	if md.mesh.dimension==2:
++		if numpy.any(numpy.logical_or(stokesflag,pattynflag)):
++			raise TypeError("setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first")
++
++	#Stokes can only be used alone for now:
++	if numpy.any(stokesflag) and numpy.any(hutterflag):
++		raise TypeError("setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere")
++
++	#Initialize node fields
++	nodeonhutter=numpy.zeros(md.mesh.numberofvertices)
++	nodeonhutter[md.mesh.elements[numpy.nonzero(hutterflag),:].astype(int)-1]=1
++	nodeonmacayeal=numpy.zeros(md.mesh.numberofvertices)
++	nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++	nodeonpattyn=numpy.zeros(md.mesh.numberofvertices)
++	nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++	nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
++	noneflag=numpy.zeros(md.mesh.numberofelements)
++
++	#First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
++	if any(stokesflag):
++#		fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
++		fullspcnodes=numpy.logical_or(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx))+ \
++		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvy))+ \
++		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvz))==3, \
++		                              numpy.logical_and(nodeonpattyn,nodeonstokes)).astype(int)    #find all the nodes on the boundary of the domain without icefront
++#		fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
++		fullspcelems=(numpy.sum(fullspcnodes[md.mesh.elements.astype(int)-1],axis=1)==6).astype(int)    #find all the nodes on the boundary of the domain without icefront
++		stokesflag[numpy.nonzero(fullspcelems)]=0
++		nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++
++	#Then complete with NoneApproximation or the other model used if there is no stokes
++	if any(stokesflag): 
++		if   any(pattynflag):    #fill with pattyn
++			pattynflag[numpy.logical_not(stokesflag)]=1
++			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++		elif any(macayealflag):    #fill with macayeal
++			macayealflag[numpy.logical_not(stokesflag)]=1
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++		else:    #fill with none 
++			noneflag[numpy.nonzero(numpy.logical_not(stokesflag))]=1
++
++	#Now take care of the coupling between MacAyeal and Pattyn
++	md.diagnostic.vertex_pairing=numpy.array([])
++	nodeonmacayealpattyn=numpy.zeros(md.mesh.numberofvertices)
++	nodeonpattynstokes=numpy.zeros(md.mesh.numberofvertices)
++	nodeonmacayealstokes=numpy.zeros(md.mesh.numberofvertices)
++	macayealpattynflag=numpy.zeros(md.mesh.numberofelements)
++	macayealstokesflag=numpy.zeros(md.mesh.numberofelements)
++	pattynstokesflag=numpy.zeros(md.mesh.numberofelements)
++	if   strcmpi(coupling_method,'penalties'):
++		#Create the border nodes between Pattyn and MacAyeal and extrude them
++		numnodes2d=md.mesh.numberofvertices2d
++		numlayers=md.mesh.numberoflayers
++		bordernodes2d=numpy.nonzero(numpy.logical_and(nodeonpattyn[1:numnodes2d],nodeonmacayeal[1:numnodes2d]))    #Nodes connected to two different types of elements
++
++		#initialize and fill in penalties structure
++		if numpy.all(numpy.logical_not(numpy.isnan(bordernodes2d))):
++			penalties=numpy.zeros((0,2))
++			for	i in xrange(1,numlayers):
++				penalties=numpy.concatenate((penalties,numpy.concatenate((bordernodes2d,bordernodes2d+md.mesh.numberofvertices2d*(i)),axis=1)),axis=0)
++			md.diagnostic.vertex_pairing=penalties
++
++	elif strcmpi(coupling_method,'tiling'):
++		if   numpy.any(macayealflag) and numpy.any(pattynflag):    #coupling macayeal pattyn
++			#Find node at the border
++			nodeonmacayealpattyn[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonpattyn))]=1
++			#Macayeal elements in contact with this layer become MacAyealPattyn elements
++			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonmacayealpattyn))
++			commonelements=numpy.sum(matrixelements,axis=1)!=0
++			commonelements[numpy.nonzero(pattynflag)]=0    #only one layer: the elements previously in macayeal
++			macayealflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealpattynelements
++			macayealpattynflag[numpy.nonzero(commonelements)]=1
++			nodeonmacayeal[:]=0
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++
++			#rule out elements that don't touch the 2 boundaries
++			pos=numpy.nonzero(macayealpattynflag)
++			elist=numpy.zeros(len(pos))
++			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
++			pos1=[i for i,item in enumerate(elist) if item==1]
++			macayealflag[pos[pos1]]=1
++			macayealpattynflag[pos[pos1]]=0
++			pos2=[i for i,item in enumerate(elist) if item==-1]
++			pattynflag[pos[pos2]]=1
++			macayealpattynflag[pos[pos2]]=0
++
++			#Recompute nodes associated to these elements
++			nodeonmacayeal[:]=0
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++			nodeonpattyn[:]=0
++			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++			nodeonmacayealpattyn[:]=0
++			nodeonmacayealpattyn[md.mesh.elements[numpy.nonzero(macayealpattynflag),:].astype(int)-1]=1
++
++		elif numpy.any(pattynflag) and numpy.any(stokesflag):    #coupling pattyn stokes
++			#Find node at the border
++			nodeonpattynstokes[numpy.nonzero(numpy.logical_and(nodeonpattyn,nodeonstokes))]=1
++			#Stokes elements in contact with this layer become PattynStokes elements
++			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonpattynstokes))
++			commonelements=numpy.sum(matrixelements,axis=1)!=0
++			commonelements[numpy.nonzero(pattynflag)]=0    #only one layer: the elements previously in macayeal
++			stokesflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealpattynelements
++			pattynstokesflag[numpy.nonzero(commonelements)]=1
++			nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++
++			#rule out elements that don't touch the 2 boundaries
++			pos=numpy.nonzero(pattynstokesflag)
++			elist=numpy.zeros(len(pos))
++			elist = elist + numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			pos1=[i for i,item in enumerate(elist) if item==1]
++			stokesflag[pos[pos1]]=1
++			pattynstokesflag[pos[pos1]]=0
++			pos2=[i for i,item in enumerate(elist) if item==-1]
++			pattynflag[pos[pos2]]=1
++			pattynstokesflag[pos[pos2]]=0
++
++			#Recompute nodes associated to these elements
++			nodeonstokes[:]=0
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++			nodeonpattyn[:]=0
++			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++			nodeonpattynstokes[:]=0
++			nodeonpattynstokes[md.mesh.elements[numpy.nonzero(pattynstokesflag),:].astype(int)-1]=1
++
++		elif numpy.any(stokesflag) and numpy.any(macayealflag):
++			#Find node at the border
++			nodeonmacayealstokes[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonstokes))]=1
++			#Stokes elements in contact with this layer become MacAyealStokes elements
++			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonmacayealstokes))
++			commonelements=numpy.sum(matrixelements,axis=1)!=0
++			commonelements[numpy.nonzero(macayealflag)]=0    #only one layer: the elements previously in macayeal
++			stokesflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealmacayealelements
++			macayealstokesflag[numpy.nonzero(commonelements)]=1
++			nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++
++			#rule out elements that don't touch the 2 boundaries
++			pos=numpy.nonzero(macayealstokesflag)
++			elist=numpy.zeros(len(pos))
++			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
++			pos1=[i for i,item in enumerate(elist) if item==1]
++			macayealflag[pos[pos1]]=1
++			macayealstokesflag[pos[pos1]]=0
++			pos2=[i for i,item in enumerate(elist) if item==-1]
++			stokesflag[pos[pos2]]=1
++			macayealstokesflag[pos[pos2]]=0
++
++			#Recompute nodes associated to these elements
++			nodeonmacayeal[:]=0
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++			nodeonstokes[:]=0
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++			nodeonmacayealstokes[:]=0
++			nodeonmacayealstokes[md.mesh.elements[numpy.nonzero(macayealstokesflag),:].astype(int)-1]=1
++
++		elif numpy.any(stokesflag) and numpy.any(hutterflag):
++			raise TypeError("type of coupling not supported yet")
++
++	#Create MacaAyealPattynApproximation where needed
++	md.flowequation.element_equation=numpy.zeros(md.mesh.numberofelements)
++	md.flowequation.element_equation[numpy.nonzero(noneflag)]=0
++	md.flowequation.element_equation[numpy.nonzero(hutterflag)]=1
++	md.flowequation.element_equation[numpy.nonzero(macayealflag)]=2
++	md.flowequation.element_equation[numpy.nonzero(pattynflag)]=3
++	md.flowequation.element_equation[numpy.nonzero(stokesflag)]=4
++	md.flowequation.element_equation[numpy.nonzero(macayealpattynflag)]=5
++	md.flowequation.element_equation[numpy.nonzero(macayealstokesflag)]=6
++	md.flowequation.element_equation[numpy.nonzero(pattynstokesflag)]=7
++
++	#border
++	md.flowequation.borderpattyn=nodeonpattyn
++	md.flowequation.bordermacayeal=nodeonmacayeal
++	md.flowequation.borderstokes=nodeonstokes
++
++	#Create vertices_type
++	md.flowequation.vertex_equation=numpy.zeros(md.mesh.numberofvertices)
++	pos=numpy.nonzero(nodeonhutter)
++	md.flowequation.vertex_equation[pos]=1
++	pos=numpy.nonzero(nodeonmacayeal)
++	md.flowequation.vertex_equation[pos]=2
++	pos=numpy.nonzero(nodeonpattyn)
++	md.flowequation.vertex_equation[pos]=3
++	pos=numpy.nonzero(nodeonhutter)
++	md.flowequation.vertex_equation[pos]=1
++	pos=numpy.nonzero(nodeonmacayealpattyn)
++	md.flowequation.vertex_equation[pos]=5
++	pos=numpy.nonzero(nodeonstokes)
++	md.flowequation.vertex_equation[pos]=4
++	if numpy.any(stokesflag):
++		pos=numpy.nonzero(numpy.logical_not(nodeonstokes))
++		if not (numpy.any(pattynflag) or numpy.any(macayealflag)):
++			md.flowequation.vertex_equation[pos]=0
++	pos=numpy.nonzero(nodeonpattynstokes)
++	md.flowequation.vertex_equation[pos]=7
++	pos=numpy.nonzero(nodeonmacayealstokes)
++	md.flowequation.vertex_equation[pos]=6
++
++	#figure out solution types
++	md.flowequation.ishutter=float(numpy.any(md.flowequation.element_equation==1))
++	md.flowequation.ismacayealpattyn=float(numpy.any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
++	md.flowequation.isstokes=float(numpy.any(md.flowequation.element_equation==4))
++
++	return md
++
++	#Check that tiling can work:
++	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal !=1):
++		raise TypeError("error coupling domain too irregular")
++	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderstokes + md.flowequation.bordermacayeal !=1):
++		raise TypeError("error coupling domain too irregular")
++	if numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.borderstokes !=1):
++		raise TypeError("error coupling domain too irregular")
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/contourenvelope.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/contourenvelope.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/contourenvelope.m	(revision 13006)
+@@ -0,0 +1,139 @@
++function segments=contourenvelope(md,varargin)
++%CONTOURENVELOPE - build a set of segments enveloping a contour .exp
++%
++%   Usage:
++%      segments=contourenvelope(md,varargin)
++%
++%   Example:
++%      segments=contourenvelope(md,'Stream.exp');
++%      segments=contourenvelope(md,md.mask.elementonfloatingice)
++%      segments=contourenvelope(md);
++
++%some checks
++if nargin>2,
++	help contourenvelope
++	error('contourenvelope error message: bad usage');
++end
++if nargin==2,
++	flags=varargin{1};
++
++	if ischar(flags),
++		file=flags;
++		file=varargin{1};
++		if ~exist(file),
++			error(['contourenvelope error message: file ' file ' not found']);
++		end
++		isfile=1;
++	elseif isnumeric(flags),
++		%do nothing for now
++		isfile=0;
++	else
++		error('contourenvelope error message:  second argument should a file or an elements flag');
++	end
++end
++
++%Now, build the connectivity tables for this mesh.
++%Computing connectivity
++if (size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices & size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices2d),
++	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++end
++if (size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements & size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements2d),
++	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++end
++
++%get nodes inside profile
++mesh.elementconnectivity=md.mesh.elementconnectivity;
++if md.mesh.dimension==2;
++	mesh.elements=md.mesh.elements;
++	mesh.x=md.mesh.x;
++	mesh.y=md.mesh.y;
++	mesh.numberofvertices=md.mesh.numberofvertices;
++	mesh.numberofelements=md.mesh.numberofelements;
++else
++	mesh.elements=md.mesh.elements2d;
++	mesh.x=md.mesh.x2d;
++	mesh.y=md.mesh.y2d;
++	mesh.numberofvertices=md.mesh.numberofvertices2d;
++	mesh.numberofelements=md.mesh.numberofelements2d;
++end
++
++if nargin==2,
++
++	if isfile,
++		%get flag list of elements and nodes inside the contour
++		nodein=ContourToMesh(mesh.elements,mesh.x,mesh.y,file,'node',1);
++		elemin=(sum(nodein(mesh.elements),2)==size(mesh.elements,2));
++		%modify element connectivity
++		elemout=find(~elemin);
++		mesh.elementconnectivity(elemout,:)=0;
++		mesh.elementconnectivity(find(ismember(mesh.elementconnectivity,elemout)))=0;
++	else
++		%get flag list of elements and nodes inside the contour
++		nodein=zeros(mesh.numberofvertices,1); 
++		elemin=zeros(mesh.numberofelements,1); 
++		
++		pos=find(flags); 
++		elemin(pos)=1;
++		nodein(mesh.elements(pos,:))=1;
++
++		%modify element connectivity
++		elemout=find(~elemin);
++		mesh.elementconnectivity(elemout,:)=0;
++		mesh.elementconnectivity(find(ismember(mesh.elementconnectivity,elemout)))=0;
++	end
++end
++
++%Find element on boundary
++%First: find elements on the boundary of the domain
++flag=mesh.elementconnectivity;
++if nargin==2,
++	flag(find(flag))=elemin(flag(find(flag)));
++end
++elementonboundary=double(prod(flag,2)==0 & sum(flag,2)>0);
++
++%Find segments on boundary
++pos=find(elementonboundary);
++num_segments=length(pos);
++segments=zeros(num_segments,3);
++count=1;
++
++for i=1:num_segments,
++	el1=pos(i);
++	els2=mesh.elementconnectivity(el1,find(mesh.elementconnectivity(el1,:)));
++	if length(els2)>1,
++		flag=intersect(mesh.elements(els2(1),:),mesh.elements(els2(2),:));
++		nods1=mesh.elements(el1,:);
++		nods1(find(nods1==flag))=[];
++		segments(count,:)=[nods1 el1];
++
++		ord1=find(nods1(1)==mesh.elements(el1,:));
++		ord2=find(nods1(2)==mesh.elements(el1,:));
++
++		%swap segment nodes if necessary
++		if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
++			temp=segments(count,1);
++			segments(count,1)=segments(count,2);
++			segments(count,2)=temp;
++		end
++		segments(count,1:2)=fliplr(segments(count,1:2));
++		count=count+1;
++	else
++		nods1=mesh.elements(el1,:);
++		flag=setdiff(nods1,mesh.elements(els2,:));
++		for j=1:3,
++			nods=nods1; nods(j)=[];
++			if any(ismember(flag,nods)),
++				segments(count,:)=[nods el1];
++				ord1=find(nods(1)==mesh.elements(el1,:));
++				ord2=find(nods(2)==mesh.elements(el1,:));
++				if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
++					temp=segments(count,1);
++					segments(count,1)=segments(count,2);
++					segments(count,2)=temp;
++				end
++				segments(count,1:2)=fliplr(segments(count,1:2));
++				count=count+1;
++			end
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.m	(revision 13006)
+@@ -0,0 +1,49 @@
++function md=setmask(md,floatingicename,groundedicename)
++%SETMASK - establish boundaries between grounded and floating ice.
++%
++%   By default, ice is considered grounded. The contour floatingicename defines nodes 
++%   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
++%   that are grounded (ie: ice rises, islands, etc ...)
++%   All input files are in the Argus format (extension .exp).
++%
++%   Usage:
++%      md=setmask(md,floatingicename,groundedicename)
++%
++%   Examples:
++%      md=setmask(md,'all','');
++%      md=setmask(md,'Iceshelves.exp','Islands.exp');
++
++%some checks on list of arguments
++if ((nargin~=3) | (nargout~=1)),
++	help mask
++	error('mask error message');
++end
++
++%Get assigned fields
++x=md.mesh.x;
++y=md.mesh.y;
++elements=md.mesh.elements;
++
++%Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
++elementonfloatingice=FlagElements(md,floatingicename);
++elementongroundedice=FlagElements(md,groundedicename);
++
++%Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
++%arrays come from domain outlines that can intersect one another: 
++elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
++elementongroundedice=double(~elementonfloatingice);
++
++%the order here is important. we choose vertexongroundedice as default on the grounding line.
++vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
++vertexongroundedice=zeros(md.mesh.numberofvertices,1);
++vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
++vertexonfloatingice(find(~vertexongroundedice))=1;
++%}}}
++
++%Return: 
++md.mask.elementonfloatingice=elementonfloatingice;
++md.mask.vertexonfloatingice=vertexonfloatingice;
++md.mask.elementongroundedice=elementongroundedice;
++md.mask.vertexongroundedice=vertexongroundedice;
++md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
++md.mask.elementonwater=zeros(md.mesh.numberofelements,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.m	(revision 13006)
+@@ -0,0 +1,281 @@
++function md=setflowequation(md,varargin)
++%SETELEMENTSTYPE - associate a solution type to each element
++%
++%   This routine works like plotmodel: it works with an even number of inputs
++%   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
++%   that must be followed by the corresponding exp file or flags list
++%   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
++%   If user wants every element outside the domain to be 
++%   setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
++%   an empty string '' will be considered as an empty domain
++%   a string 'all' will be considered as the entire domain
++%   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
++%
++%   Usage:
++%      md=setflowequation(md,varargin)
++%
++%   Example:
++%      md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
++%      md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
++
++%some checks on list of arguments
++if ((nargin<2) | (nargout~=1)),
++	error('setflowequation error message');
++end
++
++%Find_out what kind of coupling to use
++options=pairoptions(varargin{:});
++coupling_method=getfieldvalue(options,'coupling','tiling');
++if (~strcmpi(coupling_method,'tiling') & ~strcmpi(coupling_method,'penalties')),
++	error('coupling type can only be: tiling or penalties');
++end
++
++[hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin{:});
++
++%Flag the elements that have not been flagged as filltype
++if strcmpi(filltype,'hutter'),
++	hutterflag(find(~(macayealflag | pattynflag)))=1;
++elseif strcmpi(filltype,'macayeal'),
++	macayealflag(find(~(hutterflag | pattynflag | stokesflag)))=1;
++elseif strcmpi(filltype,'pattyn'),
++	pattynflag(find(~(hutterflag | macayealflag | stokesflag)))=1;
++end
++
++%check that each element has at least one flag
++if any(hutterflag+ macayealflag+pattynflag+stokesflag==0),
++	error('setflowequation error message: elements type not assigned, must be specified')
++end
++
++%check that each element has only one flag
++if any(hutterflag+ macayealflag+pattynflag+stokesflag>1),
++	disp('setflowequation warning message: some elements have several types, higher order type is used for them')
++	hutterflag(find(hutterflag & macayealflag))=0;
++	hutterflag(find(hutterflag & pattynflag))=0;
++	macayealflag(find(macayealflag & pattynflag))=0;
++end
++
++%Check that no pattyn or stokes for 2d mesh
++if (md.mesh.dimension==2),
++	if any(stokesflag | pattynflag)
++		error('setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first')
++	end
++end
++
++%Stokes can only be used alone for now:
++if any(stokesflag) &any(hutterflag),
++	error('setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere')
++end
++
++%Initialize node fields
++nodeonhutter=zeros(md.mesh.numberofvertices,1);
++nodeonhutter(md.mesh.elements(find(hutterflag),:))=1;
++nodeonmacayeal=zeros(md.mesh.numberofvertices,1);
++nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
++nodeonpattyn=zeros(md.mesh.numberofvertices,1);
++nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
++nodeonstokes=zeros(md.mesh.numberofvertices,1);
++noneflag=zeros(md.mesh.numberofelements,1);
++
++%First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
++if any(stokesflag),
++	fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
++	fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
++	stokesflag(find(fullspcelems))=0;
++	nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
++end
++
++%Then complete with NoneApproximation or the other model used if there is no stokes
++if any(stokesflag), 
++	if any(pattynflag), %fill with pattyn
++		pattynflag(~stokesflag)=1;
++		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
++	elseif any(macayealflag), %fill with macayeal
++		macayealflag(~stokesflag)=1;
++		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
++	else %fill with none 
++		noneflag(find(~stokesflag))=1;
++	end
++end
++
++%Now take care of the coupling between MacAyeal and Pattyn
++md.diagnostic.vertex_pairing=[];
++nodeonmacayealpattyn=zeros(md.mesh.numberofvertices,1);
++nodeonpattynstokes=zeros(md.mesh.numberofvertices,1);
++nodeonmacayealstokes=zeros(md.mesh.numberofvertices,1);
++macayealpattynflag=zeros(md.mesh.numberofelements,1);
++macayealstokesflag=zeros(md.mesh.numberofelements,1);
++pattynstokesflag=zeros(md.mesh.numberofelements,1);
++if strcmpi(coupling_method,'penalties'),
++	%Create the border nodes between Pattyn and MacAyeal and extrude them
++	numnodes2d=md.mesh.numberofvertices2d;
++	numlayers=md.mesh.numberoflayers;
++	bordernodes2d=find(nodeonpattyn(1:numnodes2d) & nodeonmacayeal(1:numnodes2d)); %Nodes connected to two different types of elements
++
++	%initialize and fill in penalties structure
++	if ~isnan(bordernodes2d),
++		penalties=[];
++		for	i=1:numlayers-1,
++			penalties=[penalties; [bordernodes2d bordernodes2d+md.mesh.numberofvertices2d*(i)]];
++		end
++		md.diagnostic.vertex_pairing=penalties;
++	end
++elseif strcmpi(coupling_method,'tiling'),
++	if any(macayealflag) & any(pattynflag), %coupling macayeal pattyn
++		%Find node at the border
++		nodeonmacayealpattyn(find(nodeonmacayeal & nodeonpattyn))=1;
++		%Macayeal elements in contact with this layer become MacAyealPattyn elements
++		matrixelements=ismember(md.mesh.elements,find(nodeonmacayealpattyn));
++		commonelements=sum(matrixelements,2)~=0;
++		commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
++		macayealflag(find(commonelements))=0; %these elements are now macayealpattynelements
++		macayealpattynflag(find(commonelements))=1;
++		nodeonmacayeal(:)=0;
++		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
++
++		%rule out elements that don't touch the 2 boundaries
++		pos=find(macayealpattynflag);
++		elist=zeros(length(pos),1);
++		elist = elist + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
++		elist = elist - any(sum(nodeonpattyn(md.mesh.elements(pos,:))  ,2),2);
++		pos1=find(elist==1);
++		macayealflag(pos(pos1))=1;
++		macayealpattynflag(pos(pos1))=0;
++		pos2=find(elist==-1);
++		pattynflag(pos(pos2))=1;
++		macayealpattynflag(pos(pos2))=0;
++
++		%Recompute nodes associated to these elements
++		nodeonmacayeal(:)=0;
++		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
++		nodeonpattyn(:)=0;
++		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
++		nodeonmacayealpattyn(:)=0;
++		nodeonmacayealpattyn(md.mesh.elements(find(macayealpattynflag),:))=1;
++
++	elseif any(pattynflag) & any(stokesflag), %coupling pattyn stokes
++		%Find node at the border
++		nodeonpattynstokes(find(nodeonpattyn & nodeonstokes))=1;
++		%Stokes elements in contact with this layer become PattynStokes elements
++		matrixelements=ismember(md.mesh.elements,find(nodeonpattynstokes));
++		commonelements=sum(matrixelements,2)~=0;
++		commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
++		stokesflag(find(commonelements))=0; %these elements are now macayealpattynelements
++		pattynstokesflag(find(commonelements))=1;
++		nodeonstokes=zeros(md.mesh.numberofvertices,1);
++		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
++
++		%rule out elements that don't touch the 2 boundaries
++		pos=find(pattynstokesflag);
++		elist=zeros(length(pos),1);
++		elist = elist + any(sum(nodeonstokes(md.mesh.elements(pos,:)),2),2);
++		elist = elist - any(sum(nodeonpattyn(md.mesh.elements(pos,:)),2),2);
++		pos1=find(elist==1);
++		stokesflag(pos(pos1))=1;
++		pattynstokesflag(pos(pos1))=0;
++		pos2=find(elist==-1);
++		pattynflag(pos(pos2))=1;
++		pattynstokesflag(pos(pos2))=0;
++
++		%Recompute nodes associated to these elements
++		nodeonstokes(:)=0;
++		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
++		nodeonpattyn(:)=0;
++		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
++		nodeonpattynstokes(:)=0;
++		nodeonpattynstokes(md.mesh.elements(find(pattynstokesflag),:))=1;
++
++	elseif any(stokesflag) & any(macayealflag),
++		%Find node at the border
++		nodeonmacayealstokes(find(nodeonmacayeal & nodeonstokes))=1;
++		%Stokes elements in contact with this layer become MacAyealStokes elements
++		matrixelements=ismember(md.mesh.elements,find(nodeonmacayealstokes));
++		commonelements=sum(matrixelements,2)~=0;
++		commonelements(find(macayealflag))=0; %only one layer: the elements previously in macayeal
++		stokesflag(find(commonelements))=0; %these elements are now macayealmacayealelements
++		macayealstokesflag(find(commonelements))=1;
++		nodeonstokes=zeros(md.mesh.numberofvertices,1);
++		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
++
++		%rule out elements that don't touch the 2 boundaries
++		pos=find(macayealstokesflag);
++		elist=zeros(length(pos),1);
++		elist = elist + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
++		elist = elist - any(sum(nodeonstokes(md.mesh.elements(pos,:))  ,2),2);
++		pos1=find(elist==1);
++		macayealflag(pos(pos1))=1;
++		macayealstokesflag(pos(pos1))=0;
++		pos2=find(elist==-1);
++		stokesflag(pos(pos2))=1;
++		macayealstokesflag(pos(pos2))=0;
++
++		%Recompute nodes associated to these elements
++		nodeonmacayeal(:)=0;
++		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
++		nodeonstokes(:)=0;
++		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
++		nodeonmacayealstokes(:)=0;
++		nodeonmacayealstokes(md.mesh.elements(find(macayealstokesflag),:))=1;
++
++	elseif any(stokesflag) & any(hutterflag),
++		error('type of coupling not supported yet');
++	end
++end
++
++%Create MacaAyealPattynApproximation where needed
++md.flowequation.element_equation=zeros(md.mesh.numberofelements,1);
++md.flowequation.element_equation(find(noneflag))=0;
++md.flowequation.element_equation(find(hutterflag))=1;
++md.flowequation.element_equation(find(macayealflag))=2;
++md.flowequation.element_equation(find(pattynflag))=3;
++md.flowequation.element_equation(find(stokesflag))=4;
++md.flowequation.element_equation(find(macayealpattynflag))=5;
++md.flowequation.element_equation(find(macayealstokesflag))=6;
++md.flowequation.element_equation(find(pattynstokesflag))=7;
++
++%border
++md.flowequation.borderpattyn=nodeonpattyn;
++md.flowequation.bordermacayeal=nodeonmacayeal;
++md.flowequation.borderstokes=nodeonstokes;
++
++%Create vertices_type
++md.flowequation.vertex_equation=zeros(md.mesh.numberofvertices,1);
++pos=find(nodeonhutter);
++md.flowequation.vertex_equation(pos)=1;
++pos=find(nodeonmacayeal);
++md.flowequation.vertex_equation(pos)=2;
++pos=find(nodeonpattyn);
++md.flowequation.vertex_equation(pos)=3;
++pos=find(nodeonhutter);
++md.flowequation.vertex_equation(pos)=1;
++pos=find(nodeonmacayealpattyn);
++md.flowequation.vertex_equation(pos)=5;
++pos=find(nodeonstokes);
++md.flowequation.vertex_equation(pos)=4;
++if any(stokesflag),
++	pos=find(~nodeonstokes);
++	if(~any(pattynflag) & ~any(macayealflag)),
++		md.flowequation.vertex_equation(pos)=0;
++	end
++end
++pos=find(nodeonpattynstokes);
++md.flowequation.vertex_equation(pos)=7;
++pos=find(nodeonmacayealstokes);
++md.flowequation.vertex_equation(pos)=6;
++
++%figure out solution types
++md.flowequation.ishutter=double(any(md.flowequation.element_equation==1));
++md.flowequation.ismacayealpattyn=double(any(md.flowequation.element_equation==2 | md.flowequation.element_equation==3));
++md.flowequation.isstokes=double(any(md.flowequation.element_equation==4));
++
++return
++
++%Check that tiling can work:
++if any(md.flowequation.bordermacayeal) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal ~=1),
++	error('error coupling domain too irregular');
++end
++if any(md.flowequation.bordermacayeal) & any(md.flowequation.borderstokes) & any(md.flowequation.borderstokes + md.flowequation.bordermacayeal ~=1),
++	error('error coupling domain too irregular');
++end
++if any(md.flowequation.borderstokes) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.borderstokes~=1),
++	error('error coupling domain too irregular');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask2.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask2.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask2.m	(revision 13006)
+@@ -0,0 +1,148 @@
++function md=setmask2(md,landname,floatingicename,groundedicename)
++%GEOGRAPHY2 - establish land, ice sheet and ice shelf areas in a domains.
++%
++%   Usage:
++%      md=setmask2(md,landname,floatingicename,groundedicename)
++%
++%   Examples:
++%      md=setmask2(md,'LandName.exp','Iceshelves.exp','Islands.exp');
++
++%Get assigned fields
++x=md.mesh.x;
++y=md.mesh.y;
++elements=md.mesh.elements;
++
++%recover elements and nodes on land.
++if ischar(landname),
++	[vertexonland,elementonland]=ContourToMesh(elements,x,y,landname,'element and node',2);
++elseif isfloat(landname),
++	if size(landname,1)~=md.mesh.numberofelements,
++		error('Landname for area must be of same size as number of elements in model');
++	end
++	elementonland=landname;
++	vertexonland=zeros(md.mesh.numberofvertices,1);
++	vertexonland(md.mesh.elements(find(elementonland),:))=1;
++else
++	error('Invalid area option option');
++end
++
++%Now, build the connectivity tables for this mesh.
++if size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices,
++	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++end
++if size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements,
++	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++end
++
++%any element with 3 nodes on land should be on land:
++elementsonwater=find(~elementonland);
++wrongelements=elementsonwater(find(( vertexonland(md.mesh.elements(elementsonwater,1)) + vertexonland(md.mesh.elements(elementsonwater,2)) + vertexonland(md.mesh.elements(elementsonwater,3)) ...
++                  )==3));
++elementonland(wrongelements)=1;
++
++%any element with its barycentre on land should be on land: (only if landname is an expfile)
++if ischar(landname),
++weights={[1;1;1],[2;1;1],[1;2;1],[1;1;2]};
++	for i=1:length(weights),
++		xelem=x(md.mesh.elements)*weights{i}/sum(weights{i});
++		yelem=y(md.mesh.elements)*weights{i}/sum(weights{i});
++	end
++	baryonland=ContourToNodes(xelem,yelem,landname,1);
++	pos=find(~baryonland); elementonland(pos)=0;
++	pos=find(baryonland); elementonland(pos)=1;
++end
++
++%figure out which elements on land are actually in the middle of the ocean!
++pos1=find(elementonland); 
++connectedtoland=md.mesh.elementconnectivity(pos1,:);
++pos=find(connectedtoland); connectedtoland(pos)=1-elementonland(connectedtoland(pos));
++connectedtolandsum=sum(connectedtoland,2);
++waterelements=pos1(find(connectedtolandsum==3));
++elementonland(waterelements)=0;
++
++%figure out which elements on water  are actually in the middle of the land!
++pos1=find(~elementonland); 
++connectedtowater=md.mesh.elementconnectivity(pos1,:);
++pos=find(connectedtowater); connectedtowater(pos)=elementonland(connectedtowater(pos));
++connectedtowatersum=sum(connectedtowater,2);
++landelements=pos1(find(connectedtowatersum==3));
++elementonland(landelements)=1;
++
++%recover arrays of ice shelf nodes and elements, and ice sheet nodes and elements.
++elementonfloatingice=FlagElements(md,floatingicename);
++elementongroundedice=FlagElements(md,groundedicename);
++
++%Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
++%arrays come from domain outlines that can intersect one another: 
++vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
++vertexongroundedice=zeros(md.mesh.numberofvertices,1);
++elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
++elementongroundedice=double(~elementonfloatingice);
++vertexonfloatingice(md.mesh.elements(find(elementonfloatingice),:))=1;
++vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
++
++%now correct, so that none of the floatingice and groundedice elements and nodes are in the water.
++pos=find(~elementonland);
++elementonfloatingice(pos)=0; 
++elementongroundedice(pos)=0;
++
++pos=find(~vertexonland);
++vertexonfloatingice(pos)=0; 
++vertexongroundedice(pos)=0;
++
++%create vertexonwater and elementonwater: 
++vertexonwater=double(~vertexonland);
++elementonwater=double(~elementonland);
++
++%correct for islands:
++vertexonfloatingice=double(vertexonfloatingice & ~vertexongroundedice);
++elementonfloatingice=double(elementonfloatingice & ~elementongroundedice);
++
++%now, groundedices are everything except iceshelves and water
++vertexongroundedice=double(~vertexonfloatingice & ~vertexonwater);
++elementongroundedice=double(~elementonfloatingice & ~elementonwater);
++
++%Deal with segments on neumann:
++
++%Get current connectivity
++mesh.elementconnectivity=md.mesh.elementconnectivity;
++
++%put 0 for elements on water
++pos=find(mesh.elementconnectivity);
++mesh.elementconnectivity(pos)=mesh.elementconnectivity(pos).*(~elementonwater(mesh.elementconnectivity(pos)));
++
++%put line of ones for elements on water
++pos=find(elementonwater);
++mesh.elementconnectivity(pos,:)=1;% line of ones for elements on water so they won't be considered
++
++%resort lines (zeros must be at the last column for findsegments)
++mesh.elementconnectivity=sort(mesh.elementconnectivity,2,'descend');
++
++%call findsegments to build segment using THIS conectivity
++md.mesh.segments=findsegments(md,'mesh.elementconnectivity',mesh.elementconnectivity);
++
++%some final checks: 
++%check that no node thinks it's on an ice shelf or ice sheet, and lies actually in the middle of the water.
++nodesgrounded=find(~vertexonwater);
++lengthconnectivity=size(md.mesh.vertexconnectivity,2);
++groundedcounters=md.mesh.vertexconnectivity(nodesgrounded,lengthconnectivity);
++groundedconnectivity=md.mesh.vertexconnectivity(nodesgrounded,1:lengthconnectivity-1);
++pos=find(groundedconnectivity);
++groundedconnectivity(pos)=elementonwater(groundedconnectivity(pos));
++groundedsum=sum(groundedconnectivity,2);
++errorflags=find(groundedsum==groundedcounters);
++errornodes=nodesgrounded(errorflags);
++
++vertexonwater(errornodes)=1;
++vertexongroundedice(errornodes)=0;
++vertexonfloatingice(errornodes)=0;
++
++%Return: 
++md.mask.vertexonfloatingice=vertexonfloatingice;
++md.mask.elementonfloatingice=elementonfloatingice;
++md.mask.vertexonwater=vertexonwater;
++md.mask.elementonwater=elementonwater;
++md.mask.vertexongroundedice=vertexongroundedice;
++md.mask.elementongroundedice=elementongroundedice;
++
++md.mesh.segmentmarkers(:)=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.py	(revision 13006)
+@@ -0,0 +1,55 @@
++from numpy import *
++import FlagElements as fe
++
++def setmask(md, floatingicename, groundedicename):
++	#SETMASK - establish boundaries between grounded and floating ice.
++	#
++	#   By default, ice is considered grounded. The contour floatingicename defines nodes 
++	#   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
++	#   that are grounded (ie: ice rises, islands, etc ...)
++	#   All input files are in the Argus format (extension .exp).
++	#
++	#   Usage:
++	#      md=setmask(md,floatingicename,groundedicename)
++	#
++	#   Examples:
++	#      md=setmask(md,'all','');
++	#      md=setmask(md,'Iceshelves.exp','Islands.exp');
++
++	#%Get assigned fields
++	x = md.mesh.x
++	y = md.mesh.y
++	elements = md.mesh.elements
++
++	#Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
++	elementonfloatingice = fe.FlagElements(md, floatingicename)
++	elementongroundedice = fe.FlagElements(md, groundedicename) 
++
++	#Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
++	#arrays come from domain outlines that can intersect one another: 
++
++	elementonfloatingice = logical_and(elementonfloatingice,~elementongroundedice)
++	elementongroundedice = ~elementonfloatingice
++
++	#the order here is important. we choose vertexongroundedice as default on the grounding line.
++	vertexonfloatingice = zeros(md.mesh.numberofvertices,'bool')
++	vertexongroundedice = zeros(md.mesh.numberofvertices,'bool')
++
++	pos=argwhere(elementongroundedice==1)
++	pos=md.mesh.elements[pos,:]-1
++	if pos.size:
++		vertexongroundedice[pos]=True
++
++	pos=argwhere(~vertexongroundedice)
++	if pos.size:
++		vertexonfloatingice[pos]=True;
++	#%}}}
++
++	#Return: 
++	md.mask.elementonfloatingice = double(elementonfloatingice)
++	md.mask.vertexonfloatingice = double(vertexonfloatingice)
++	md.mask.elementongroundedice = double(elementongroundedice)
++	md.mask.vertexongroundedice = double(vertexongroundedice)
++	md.mask.vertexonwater = zeros(md.mesh.numberofvertices)
++	md.mask.elementonwater = zeros(md.mesh.numberofelements)
++	return md
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/massbalance/contourmassbalance.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/massbalance/contourmassbalance.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/massbalance/contourmassbalance.m	(revision 13006)
+@@ -0,0 +1,45 @@
++function dhdt=contourmassbalance(md,file)
++%CONTOURMASSBALANCE - compute the mass balance on a contour
++%
++%   Usage:
++%      dhdt=contourmassbalance(md,file)
++
++%some checks
++if nargin~=2,
++	help contourmassbalance
++	error('contourmassbalance error message: bad usage');
++end
++if ((length(md.initialization.vx)~=md.mesh.numberofvertices)|(length(md.initialization.vy)~=md.mesh.numberofvertices))
++	error(['thicknessevolution error message: vx and vy should have a length of ' num2str(md.mesh.numberofvertices)])
++end
++if ~exist(file),
++	error(['thicknessevolution error message: file ' file ' not found']);
++end
++
++%Get segments enveloping contour
++segments=contourenvelope(md,file);
++%md.diagnostic.icefront=segments; plotmodel(md,'data','pressureload','expdisp',file);
++
++%get flag list of elements and nodes inside the contour
++nodein=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,file,'node',1);
++elemin=(sum(nodein(md.mesh.elements),2)==size(md.mesh.elements,2));
++
++%conputing Mass flux
++x=md.mesh.x;
++y=md.mesh.y;
++vx=mean(md.initialization.vx(segments(:,1:end-1)),2);
++vy=mean(md.initialization.vy(segments(:,1:end-1)),2);
++H=mean(md.geometry.thickness(segments(:,1:end-1)),2);
++nx=cos(atan2((x(segments(:,1))-x(segments(:,2))) , (y(segments(:,2))-y(segments(:,1)))));
++ny=sin(atan2((x(segments(:,1))-x(segments(:,2))) , (y(segments(:,2))-y(segments(:,1)))));
++L=sqrt((x(segments(:,1))-x(segments(:,2))).^2+(y(segments(:,2))-y(segments(:,1))).^2);
++flux = - md.materials.rho_ice*sum(L.*H.*(vx.*nx+vy.*ny)); %outflux is negative!
++disp(['mass outflux on ' file ' = ' num2str(-flux/10^9) ' Gt/yr']);
++areas=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
++dhdt=flux/(sum(areas(find(elemin)))*md.materials.rho_ice);
++disp(['dhdt on ' file ' (Flux  method) = ' num2str(dhdt) ' m/yr']);
++
++dhdt=thicknessevolution(md);
++in=find(elemin);
++dhdt=sum(dhdt(in).*areas(in))/sum(areas(in));
++disp(['dhdt on ' file ' (divHV method) = ' num2str(dhdt) ' m/yr']);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13006-13007.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13006-13007.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13006-13007.diff	(revision 13394)
@@ -0,0 +1,1239 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/kmlimagesc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/kmlimagesc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/kml/kmlimagesc.m	(revision 13007)
+@@ -0,0 +1,67 @@
++function kmlimagesc(md,fieldname,varargin)
++%KMLIMAGESC - create lat,long kml image
++%
++%   Usage:
++%      kmlimagesc(md,field,options);
++%
++%   Options: 
++%      'hemisphere': default +1;
++%      'central_meridian: 45 for Greenland and 0 for Antarctica
++%      'standard_parallel: 70 for Greenland and 71 for Antarctica
++%      'posting': default .1 degree
++%
++
++%process varargin for options: 
++options=pairoptions(varargin{:});
++
++%recover field: 
++field=md.(fieldname);
++
++%recover some options, and set defaults
++fontsize=getfieldvalue(options,'fontsize',12);
++posting=getfieldvalue(options,'posting',.1);
++minlong=getfieldvalue(options,'minlong',min(md.mesh.long));
++maxlong=getfieldvalue(options,'maxlong',max(md.mesh.long));
++minlat=getfieldvalue(options,'minlat',min(md.mesh.lat));
++maxlat=getfieldvalue(options,'maxlat',max(md.mesh.lat));
++minfield=getfieldvalue(options,'minfield',min(field));
++maxfield=getfieldvalue(options,'maxfield',max(field));
++
++%do we have hemisphere setup?:
++if ~isstr(md.mesh.hemisphere),
++	error('md.mesh.hemisphere should be ''s'' or ''n''');
++end
++
++if strcmpi(md.mesh.hemisphere,'s'),
++	hemisphere=1;
++	central_meridian=getfieldvalue(options,'central_meridian',45);
++	standard_parallel=getfieldvalue(options,'standard_parallel',70);
++elseif strcmpi(md.mesh.hemisphere,'n'),
++	hemisphere=-1;
++	central_meridian=getfieldvalue(options,'central_meridian',0);
++	standard_parallel=getfieldvalue(options,'standard_parallel',71);
++else
++	error('md.mesh.hemisphere should be ''s'' or ''n''');
++end
++
++%figure out nlines and ncols in our image
++nlines=(maxlat-minlat)/posting;
++ncols=(maxlong-minlong)/posting;
++
++%regrid to lat,long grid
++[x_m,y_m,field]=InterpFromMeshToGrid(md.mesh.elements,md.mesh.long,md.mesh.lat,field,minlong,maxlat,posting,posting,nlines,ncols,NaN);
++field=flipud(field);
++
++%massage  and log:
++pos=find(field<minfield); field(pos)=minfield;
++pos=find(field>maxfield);field(pos)=maxfield;
++
++%create google earth kml file out of this regridded dataset:
++imagestr=ge_imagesc(x_m,y_m,field,'imgURL',[fieldname '.png'],'name',fieldname);
++imagestr=ge_folder(fieldname,imagestr);
++colorbarstr=ge_colorbar((min(x_m)+max(x_m))/2,(min(y_m)+max(y_m))/2,field,'name',fieldname);
++colorbarstr=ge_folder('Colorbar',colorbarstr);
++ge_output([fieldname '.kml'],[imagestr colorbarstr]);
++
++%now, create kmz file:
++system(['mv ' [fieldname '.kml'] ' doc.kml && zip ' [fieldname '.kmz'] ' doc.kml ' fieldname '.png && rm -rf doc.kml ' [fieldname '.png'] ]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabFuncs.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabFuncs.py	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabFuncs.py	(revision 13007)
+@@ -1,52 +0,0 @@
+-def oshostname():
+-	import socket
+-
+-	return socket.gethostname().lower().split('.')[0]
+-
+-def strcmp(s1,s2):
+-
+-	if s1 == s2:
+-		return True
+-	else:
+-		return False
+-
+-def strncmp(s1,s2,n):
+-
+-	if s1[0:n] == s2[0:n]:
+-		return True
+-	else:
+-		return False
+-
+-def strcmpi(s1,s2):
+-
+-	if s1.lower() == s2.lower():
+-		return True
+-	else:
+-		return False
+-
+-def strncmpi(s1,s2,n):
+-
+-	if s1.lower()[0:n] == s2.lower()[0:n]:
+-		return True
+-	else:
+-		return False
+-
+-def ismember(a,s):
+-	import numpy
+-
+-	if not isinstance(s,(tuple,list,dict,numpy.ndarray)):
+-		s=[s]
+-
+-	if not isinstance(a,(tuple,list,dict,numpy.ndarray)):
+-		a=[a]
+-
+-	if not isinstance(a,numpy.ndarray):
+-		b=[item in s for item in a]
+-
+-	else:
+-		b=numpy.empty_like(a)
+-		for i,item in enumerate(a.flat):
+-			b.flat[i]=item in s
+-
+-	return b
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodellist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodellist.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodellist.m	(revision 13007)
+@@ -1,50 +0,0 @@
+-function varargout=loadmodellist(path)
+-%LOADMODELLIST- load a model using built-in load module
+-%
+-%   check that modellist prototype has not changed. if so, adapt to new modellist prototype.
+-%
+-%   Usage:
+-%      mds=loadmodellist(path)
+-%      loadmodellist path
+-
+-%check nargout
+-if nargout>1,
+-	error('loadmodellist usage error: mds=loadmodellist(path)');
+-end
+-%check existence
+-if ~exist(path)
+-	error(['loadmodellist error message: file ' path ' does not exist']);
+-end
+-
+-%check that the file is readable
+-[stat,mess]=fileattrib(path);
+-if( stat==0 | mess.UserRead~=1),
+-	error(['loadmodellist error message: file ' path ' is not readable (permission dinied).']);
+-end
+-
+-%check number of variables
+-if length(whos('-file',path))>1,
+-	error(['loadmodellist error message: file ' path ' contains several variables. Only one model should be present.']);
+-end
+-
+-try,
+-	struc=load(path,'-mat');
+-
+-	%get name of model variable
+-	fieldname=char(fieldnames(struc));
+-	mds=eval(['struc.' fieldname]);
+-	if ~strcmpi(class(mds),'model'),
+-		mds2=modellist;
+-		mds2=structtomodel(mds2,mds);
+-		mds=mds2;
+-		clear mds2;
+-	end
+-	if nargout,
+-		varargout{1}=mds;
+-	else
+-		assignin('caller',fieldname,mds);
+-	end
+-catch me
+-	disp(getReport(me))
+-	error(['could not load model ' path]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/EnumToModelField.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/EnumToModelField.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/EnumToModelField.m	(revision 13007)
+@@ -1,26 +0,0 @@
+-function string=EnumToModelField(enum)
+-%ENUMTOMODELFIELD - output string of model field associated to enum
+-%
+-%   Usage:
+-%      string=EnumToModelField(enum)
+-
+-disp('Warning: EnumToModelField is deprecated, it cannot work with new model definition. This function will be removed in the future');
+-
+-switch enum,
+-
+-		case ThicknessEnum(), string='thickness'; return
+-		case FrictionCoefficientEnum(), string='drag_coefficient'; return
+-		case MaterialsRheologyBEnum(), string='rheology_B'; return
+-		case MaterialsRheologyBbarEnum(), string='rheology_B'; return
+-		case BalancethicknessThickeningRateEnum: string='dhdt'; return
+-		case VxEnum(), string='vx'; return
+-		case InversionVxObsEnum(), string='vx_obs'; return
+-		case VyEnum(), string='vy'; return
+-		case InversionVyObsEnum(), string='vy_obs'; return
+-		case BasalforcingsMeltingRateEnum(), string='basal_melting_rate'; return
+-      case SurfaceforcingsAccumulationRateEnum(), string='surface_accumulation_rate'; return
+-		case SurfaceforcingsAblationRateEnum(), string='surface_ablation_rate'; return
+-		case SurfaceforcingsMassBalanceEnum(), string='surface_mass_balance'; return
+-		otherwise, error(['Enum ' num2str(enum)  ' not found associated to any model field']);
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/project2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/project2d.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/project2d.m	(revision 13007)
+@@ -1,36 +0,0 @@
+-function projection_value=project2d(md3d,value,layer)
+-%PROJECT2D - returns the value of a field for a given layer of the mesh
+-%
+-%   project 'value' vector taken at layer 'layer' from extruded 2d-3d mesh onto 2d mesh 
+-%   used to do the extrusion. This routine is used to compare values between a 2d-3d mesh
+-%   at a certain layer, and the equivalent value (if it exists), on the original 2d mesh. 
+-%   This routine relies heavily on projections (contained in 3d model md) recored during 
+-%   the extrude operation.
+-%
+-%   Usage:
+-%      projection_value=project2d(md3d,value,layer)
+-%
+-%   Example:
+-%      vel2=project2d(md3d,md3d.vel,2);
+-
+-%some checks on list of arguments
+-if ((nargin~=3) ),
+-	help project2d
+-	error('project2d error message');
+-end
+-
+-if (md3d.mesh.dimension~=3),
+-	error('wrong model type ... should be ''3d''');
+-end
+-
+-if ((layer<1) | (layer>md3d.mesh.numberoflayers)),
+-	error(['layer must be between 1 and ' num2str(md3d.mesh.numberoflayers)]);
+-end
+-
+-if size(value,1)==md3d.mesh.numberofvertices,
+-	projection_value=value((layer-1)*md3d.mesh.numberofvertices2d+1:layer*md3d.mesh.numberofvertices2d,:);
+-elseif size(value,1)==md3d.mesh.numberofvertices+1,
+-	projection_value=[value((layer-1)*md3d.mesh.numberofvertices2d+1:layer*md3d.mesh.numberofvertices2d,:); value(end,:)];
+-else
+-	projection_value=value((layer-1)*md3d.mesh.numberofelements2d+1:layer*md3d.mesh.numberofelements2d,:);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.py	(revision 13007)
+@@ -1,19 +0,0 @@
+-def MatlabProcessPatch(structure):
+-	"""
+-	PROCESSPATCH - create a structure from a patch
+- 
+-	   Usage:
+-	      Result=ProcessPatch(Result);
+-	"""
+-
+-	#loop over steps
+-	for structurei in structure.itervalues():
+-
+-		#return if there is no field Patch
+-		if not 'Patch' in structurei:
+-			continue
+-
+-		raise SystemError("MatlabProcessPatch not implemented in Python.")
+-
+-	return structure
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/graddetection.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/graddetection.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/graddetection.m	(revision 13007)
+@@ -1,33 +0,0 @@
+-function [direction,direction2]=graddetection(md)
+-%GRADDETECTION detect gradient of control method between steps nsteps+1 and nsteps
+-%
+-% Usage: direction=graddetection(md);
+-
+-%keep copy of md: 
+-md2=md;
+-
+-%solve first batch of control methods, with given settings.
+-md2=solve(md2,'solution_type','DiagnosticAnalysis');
+-
+-%record final optimized parameter. 
+-parameter1=md2.results.DiagnosticAnalysis.parameter;
+-
+-%plug optimized parameter in model. 
+-md2.(EnumToModelField(md2.results.DiagnosticAnalysis.inversion.control_parameters))=parameter1;
+-
+-%put nsteps to 1: 
+-md2.nsteps=1;
+-md2.optscal=md2.optscal(end)*ones(md2.nsteps,1);
+-md2.fit=md2.fit(end)*ones(md2.nsteps,1);
+-md2.cm_jump=md2.cm_jump(end)*ones(md2.nsteps,1);
+-md2.maxiter=md2.maxiter(end)*ones(md2.nsteps,1);
+-
+-%rerun control method with optimized parameter, only for 1 more step.
+-md2=solve(md2,'solution_type','DiagnosticAnalysis');
+-
+-%get optimized parameter after 1 more step. 
+-parameter2=md2.results.DiagnosticAnalysis.parameter;
+-
+-%return relative  difference between nsteps+1 and nsteps;
+-direction=(parameter2-parameter1)./parameter1;
+-direction2=(parameter2-parameter1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MatlabProcessPatch.m	(revision 13007)
+@@ -1,65 +0,0 @@
+-function structure=MatlabProcessPatch(structure);
+-%PROCESSPATCH - create a structure from a patch
+-%
+-%   Usage:
+-%      Result=ProcessPatch(Result);
+-
+-%return if there is no field Patch
+-if (~isfield(structure,'Patch')),
+-	return;
+-end
+-
+-%loop over steps
+-for i=1:length(structure),
+-
+-	%Get Patch for current step
+-	Patch=structure(i).Patch;
+-	numvertices=structure(i).PatchVertices;
+-
+-	%check that Patch is not empty
+-	if length(Patch)==0 continue; end
+-
+-	%Get number of fields;
+-	fields=unique(Patch(:,1));
+-	steps=unique(Patch(:,2));
+-
+-	%parse steps
+-	for j=1:length(steps),
+-
+-		posstep=find(Patch(:,2)==steps(j));
+-
+-		%Take all the lines of the Patch for this timestep
+-		temporarypatch=Patch(posstep,:);
+-		time=temporarypatch(1,3);
+-		step=temporarypatch(1,2);
+-
+-		%parse fields
+-		for i=1:length(fields),
+-
+-			%get name
+-			fieldname=EnumToString(fields(i));
+-
+-			%get line positions
+-			pos=find(temporarypatch(:,1)==fields(i));
+-
+-			%Fill Result structure
+-			structure(step).steps=step;
+-			structure(step).time=time;
+-			structure(step).(fieldname).element=temporarypatch(pos,4);
+-			structure(step).(fieldname).interpolation=temporarypatch(pos,5);
+-			structure(step).(fieldname).index=temporarypatch(pos,6:5+numvertices);
+-			if structure(step).(fieldname).interpolation==P1Enum,
+-				structure(step).(fieldname).value=temporarypatch(pos,6+numvertices:end);
+-			end
+-			if structure(step).(fieldname).interpolation==P0Enum,
+-				structure(step).(fieldname).value=temporarypatch(pos,6+numvertices);
+-			end
+-
+-		end
+-	end
+-end
+-
+-%remove fields
+-structure=rmfield(structure,'Patch');
+-structure=rmfield(structure,'PatchVertices');
+-structure=rmfield(structure,'PatchNodes');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/effectivepressure.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/effectivepressure.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/effectivepressure.m	(revision 13007)
+@@ -1,12 +0,0 @@
+-function Neff=effectivepressure(md)
+-%EFFECTIVEPRESSURE - compute effective pressure
+-%
+-%   Usage:
+-%      Neff=effectivepressure(md)
+-%
+-%   Example:
+-%      Neff=effectivepressure(md)
+-
+-Neff=md.materials.rho_ice*md.constants.g*md.geometry.thickness+md.materials.rho_ice*md.constants.g*md.geometry.bed;
+-pos=find(Neff<0);
+-Neff(pos)=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/project3d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/project3d.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/project3d.m	(revision 13007)
+@@ -1,82 +0,0 @@
+-function projected_vector=project3d(md,varargin);
+-%PROJECT3D - vertically project a vector from 2d mesh
+-%
+-%   vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh.
+-%   This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an 
+-%   element vector of size (md.mesh.numberofelements2d,N/A). 
+-%   arguments: 
+-%      'vector': 2d vector
+-%      'type': 'element' or 'node'. 
+-%   options: 
+-%      'layer' a layer number where vector should keep its values. If not specified, all layers adopt the 
+-%             value of the 2d vector.
+-%      'padding': default to 0 (value adopted by other 3d layers not being projected0
+-%
+-%   Egs:
+-%      extruded_vector=project3d(md,'vector',vector2d,'type','node','layer',1,'padding',NaN);
+-%      extruded_vector=project3d(md,'vector',vector2d,'type','element','padding',0);
+-%      extruded_vector=project3d(md,'vector',vector2d,'type','node');
+-
+-%some regular checks
+-if nargin==0,
+-	help project3d
+-	error('bad usage');
+-end
+-if md.mesh.dimension~=3
+-	error('input model is not 3d');
+-end
+-
+-%retrieve parameters from options.
+-options      = pairoptions(varargin{:});
+-vector2d     = getfieldvalue(options,'vector');     %mandatory
+-type         = getfieldvalue(options,'type');       %mandatory
+-layer        = getfieldvalue(options,'layer',0);    %optional (do all layers otherwise)
+-paddingvalue = getfieldvalue(options,'padding',0);  %0 by default
+-
+-if length(vector2d)==1,
+-	projected_vector=vector2d;
+-elseif strcmpi(type,'node'),
+-
+-	%Initialize 3d vector
+-	if size(vector2d,1)==md.mesh.numberofvertices2d
+-		projected_vector=paddingvalue*ones(md.mesh.numberofvertices,  size(vector2d,2));
+-	elseif size(vector2d,1)==md.mesh.numberofvertices2d+1
+-		projected_vector=paddingvalue*ones(md.mesh.numberofvertices+1,size(vector2d,2));
+-		projected_vector(end,:)=vector2d(end,:);
+-		vector2d=vector2d(1:end-1,:);
+-	else
+-		error('vector length not supported')
+-	end
+-
+-	%Fill in
+-	if layer==0,
+-		for i=1:md.mesh.numberoflayers,
+-			projected_vector(((i-1)*md.mesh.numberofvertices2d+1):(i*md.mesh.numberofvertices2d),:)=vector2d;
+-		end
+-	else
+-		projected_vector(((layer-1)*md.mesh.numberofvertices2d+1):(layer*md.mesh.numberofvertices2d),:)=vector2d;
+-	end
+-elseif strcmpi(type,'element'),
+-
+-	%Initialize 3d vector
+-	if size(vector2d,1)==md.mesh.numberofelements2d
+-		projected_vector=paddingvalue*ones(md.mesh.numberofelements,  size(vector2d,2));
+-	elseif size(vector2d,1)==md.mesh.numberofelements2d+1
+-		projected_vector=paddingvalue*ones(md.mesh.numberofelements+1,size(vector2d,2));
+-		projected_vector(end,:)=vector2d(end,:);
+-		vector2d=vector2d(1:end-1,:);
+-	else
+-		error('vector length not supported')
+-	end
+-
+-	if layer==0,
+-		for i=1:(md.mesh.numberoflayers-1),
+-			projected_vector( ((i-1)*md.mesh.numberofelements2d+1):(i*md.mesh.numberofelements2d),:)=vector2d;
+-		end
+-
+-	else
+-		projected_vector( ((layer-1)*md.mesh.numberofelements2d+1):(layer*md.mesh.numberofelements2d),:)=vector2d;
+-	end
+-else
+-	error('project3d error message: unknown projection type');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/DepthAverage.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/DepthAverage.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/DepthAverage.m	(revision 13007)
+@@ -1,33 +0,0 @@
+-function  vector_average=DepthAverage(md,vector);
+-%DEPTHAVERAGE - computes depth average of 3d vector, and return value on 2d mesh. 
+-%
+-%   Usage:
+-%      vector_average=DepthAverage(md,vector);
+-%
+-%   Example:
+-%      vel_bar=DepthAverage(md,md.initialization.vel);
+-
+-%check that the model given in input is 3d
+-if ~md.mesh.dimension==3;
+-	error('DepthAverage error message: the model given in input must be 3d')
+-end
+-
+-%nods data
+-if (length(vector)==md.mesh.numberofvertices),
+-	vector_average=zeros(md.mesh.numberofvertices2d,1);
+-	for i=1:md.mesh.numberoflayers-1,
+-		vector_average=vector_average+(project2d(md,vector,i)+project2d(md,vector,i+1))/2.*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
+-	end
+-	vector_average=vector_average./project2d(md,md.geometry.thickness,1);
+-
+-%element data
+-elseif (length(vector)==md.mesh.numberofelements),
+-	vector_average=zeros(md.mesh.numberofelements2d,1);
+-	for i=1:md.mesh.numberoflayers-1,
+-		vector_average=vector_average+project2d(md,vector,i).*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
+-	end
+-	vector_average=vector_average./project2d(md,md.geometry.thickness,1);
+-
+-else
+-	error('vector size not supported yet');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodel.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/loadmodel.m	(revision 13007)
+@@ -1,46 +0,0 @@
+-function varargout=loadmodel(path)
+-%LOADMODEL - load a model using built-in load module
+-%
+-%   check that model prototype has not changed. if so, adapt to new model prototype.
+-%
+-%   Usage:
+-%      md=loadmodel(path)
+-%      loadmodel path
+-
+-%check nargout
+-if nargout>1,
+-	error('loadmodel usage error: md=loadmodel(path)');
+-end
+-
+-%check existence
+-if exist(path,'file')
+-	%do nothing
+-elseif exist([path '.mat'],'file')
+-	%add extension
+-	path = [path '.mat'];
+-else
+-	error(['loadmodel error message: file ' path ' does not exist']);
+-end
+-
+-try,
+-	%recover model on file and name it md
+-	warning off MATLAB:unknownElementsNowStruc;
+-	warning off MATLAB:load:classNotFound
+-	struc=load(path,'-mat');
+-	warning on MATLAB:unknownElementsNowStruc;
+-	warning on MATLAB:load:classNotFound
+-
+-	name=char(fieldnames(struc));
+-	if size(name,1)>1,
+-		error(['loadmodel error message: file ' path ' contains several variables. Only one model should be present.']); 
+-	end
+-	md=struc.(name);
+-	if nargout,
+-		varargout{1}=md;
+-	else
+-		assignin('caller',name,md);
+-	end
+-catch me
+-	disp(getReport(me))
+-	error(['could not load model ' path]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/drivingstress.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/drivingstress.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/drivingstress.m	(revision 13007)
+@@ -1,18 +0,0 @@
+-function [px,py,pmag]=drivingstress(md)
+-%DRIVINGSTRESS -  evaluates the driving stress
+-%
+-%   The driving stress is computed according to the following formula: 
+-%   driving stress= rho_ice*g*H*slope
+-%
+-%   Usage:
+-%      [Fx,Fy,Fmag]=drivingstress(md)
+-
+-%Get slope
+-[sx,sy,s]=slope(md);
+-
+-%Average thickness over elements
+-thickness_bar=(md.geometry.thickness(md.mesh.elements(:,1))+md.geometry.thickness(md.mesh.elements(:,2))+md.geometry.thickness(md.mesh.elements(:,3)))/3;
+-
+-px=md.materials.rho_ice*md.constants.g*thickness_bar.*sx;
+-py=md.materials.rho_ice*md.constants.g*thickness_bar.*sy;
+-pmag=sqrt(px.^2+py.^2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/divergence.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/divergence.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/divergence.m	(revision 13007)
+@@ -1,27 +0,0 @@
+-function div=divergence(md,a,b)
+-%DIVERGENCE - divergence of [a;b] vector, using model's triangulation.
+-%
+-%   Usage:
+-%      div=divergence(md,a,b)
+-
+-if (md.mesh.dimension==2),
+-	numberofelements=md.mesh.numberofelements;
+-	numberofnodes=md.mesh.numberofvertices;
+-	index=md.mesh.elements;
+-	x=md.mesh.x; y=md.mesh.y; z=md.mesh.z;
+-else
+-	numberofelements=md.mesh.numberofelements2d;
+-	numberofnodes=md.mesh.numberofvertices2d;
+-	index=md.mesh.elements2d;
+-	x=md.mesh.x2d; y=md.mesh.y2d;
+-end
+-
+-%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
+-[alpha beta]=GetNodalFunctionsCoeff(index,x,y);
+-
+-summation=[1;1;1];
+-dx=(a(index).*alpha)*summation;
+-dy=(b(index).*beta)*summation;
+-
+-div=dx+dy;
+-div=averaging(md,div,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/kmlimagesc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/kmlimagesc.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/kmlimagesc.m	(revision 13007)
+@@ -1,67 +0,0 @@
+-function kmlimagesc(md,fieldname,varargin)
+-%KMLIMAGESC - create lat,long kml image
+-%
+-%   Usage:
+-%      kmlimagesc(md,field,options);
+-%   Options: 
+-%      'hemisphere': default +1;
+-%      'central_meridian: 45 for Greenland and 0 for Antarctica
+-%      'standard_parallel: 70 for Greenland and 71 for Antarctica
+-%      'posting': default .1 degree
+-%
+-
+-%process varargin for options: 
+-options=pairoptions(varargin{:});
+-
+-%recover field: 
+-field=md.(fieldname);
+-
+-%recover some options, and set defaults
+-fontsize=getfieldvalue(options,'fontsize',12);
+-posting=getfieldvalue(options,'posting',.1);
+-minlong=getfieldvalue(options,'minlong',min(md.mesh.long));
+-maxlong=getfieldvalue(options,'maxlong',max(md.mesh.long));
+-minlat=getfieldvalue(options,'minlat',min(md.mesh.lat));
+-maxlat=getfieldvalue(options,'maxlat',max(md.mesh.lat));
+-minfield=getfieldvalue(options,'minfield',min(field));
+-maxfield=getfieldvalue(options,'maxfield',max(field));
+-
+-%do we have hemisphere setup?:
+-if ~isstr(md.mesh.hemisphere),
+-	error('md.mesh.hemisphere should be ''s'' or ''n''');
+-end
+-
+-if strcmpi(md.mesh.hemisphere,'s'),
+-	hemisphere=1;
+-	central_meridian=getfieldvalue(options,'central_meridian',45);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',70);
+-elseif strcmpi(md.mesh.hemisphere,'n'),
+-	hemisphere=-1;
+-	central_meridian=getfieldvalue(options,'central_meridian',0);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',71);
+-else
+-	error('md.mesh.hemisphere should be ''s'' or ''n''');
+-end
+-
+-%figure out nlines and ncols in our image
+-nlines=(maxlat-minlat)/posting;
+-ncols=(maxlong-minlong)/posting;
+-
+-%regrid to lat,long grid
+-[x_m,y_m,field]=InterpFromMeshToGrid(md.mesh.elements,md.mesh.long,md.mesh.lat,field,minlong,maxlat,posting,posting,nlines,ncols,NaN);
+-field=flipud(field);
+-
+-%massage  and log:
+-pos=find(field<minfield); field(pos)=minfield;
+-pos=find(field>maxfield);field(pos)=maxfield;
+-
+-%create google earth kml file out of this regridded dataset:
+-imagestr=ge_imagesc(x_m,y_m,field,'imgURL',[fieldname '.png'],'name',fieldname);
+-imagestr=ge_folder(fieldname,imagestr);
+-colorbarstr=ge_colorbar((min(x_m)+max(x_m))/2,(min(y_m)+max(y_m))/2,field,'name',fieldname);
+-colorbarstr=ge_folder('Colorbar',colorbarstr);
+-ge_output([fieldname '.kml'],[imagestr colorbarstr]);
+-
+-
+-%now, create kmz file:
+-system(['mv ' [fieldname '.kml'] ' doc.kml && zip ' [fieldname '.kmz'] ' doc.kml ' fieldname '.png && rm -rf doc.kml ' [fieldname '.png'] ]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.py	(revision 13007)
+@@ -0,0 +1,19 @@
++def MatlabProcessPatch(structure):
++	"""
++	PROCESSPATCH - create a structure from a patch
++ 
++	   Usage:
++	      Result=ProcessPatch(Result);
++	"""
++
++	#loop over steps
++	for structurei in structure.itervalues():
++
++		#return if there is no field Patch
++		if not 'Patch' in structurei:
++			continue
++
++		raise SystemError("MatlabProcessPatch not implemented in Python.")
++
++	return structure
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.m	(revision 13007)
+@@ -0,0 +1,65 @@
++function structure=MatlabProcessPatch(structure);
++%PROCESSPATCH - create a structure from a patch
++%
++%   Usage:
++%      Result=ProcessPatch(Result);
++
++%return if there is no field Patch
++if (~isfield(structure,'Patch')),
++	return;
++end
++
++%loop over steps
++for i=1:length(structure),
++
++	%Get Patch for current step
++	Patch=structure(i).Patch;
++	numvertices=structure(i).PatchVertices;
++
++	%check that Patch is not empty
++	if length(Patch)==0 continue; end
++
++	%Get number of fields;
++	fields=unique(Patch(:,1));
++	steps=unique(Patch(:,2));
++
++	%parse steps
++	for j=1:length(steps),
++
++		posstep=find(Patch(:,2)==steps(j));
++
++		%Take all the lines of the Patch for this timestep
++		temporarypatch=Patch(posstep,:);
++		time=temporarypatch(1,3);
++		step=temporarypatch(1,2);
++
++		%parse fields
++		for i=1:length(fields),
++
++			%get name
++			fieldname=EnumToString(fields(i));
++
++			%get line positions
++			pos=find(temporarypatch(:,1)==fields(i));
++
++			%Fill Result structure
++			structure(step).steps=step;
++			structure(step).time=time;
++			structure(step).(fieldname).element=temporarypatch(pos,4);
++			structure(step).(fieldname).interpolation=temporarypatch(pos,5);
++			structure(step).(fieldname).index=temporarypatch(pos,6:5+numvertices);
++			if structure(step).(fieldname).interpolation==P1Enum,
++				structure(step).(fieldname).value=temporarypatch(pos,6+numvertices:end);
++			end
++			if structure(step).(fieldname).interpolation==P0Enum,
++				structure(step).(fieldname).value=temporarypatch(pos,6+numvertices);
++			end
++
++		end
++	end
++end
++
++%remove fields
++structure=rmfield(structure,'Patch');
++structure=rmfield(structure,'PatchVertices');
++structure=rmfield(structure,'PatchNodes');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project2d.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project2d.m	(revision 13007)
+@@ -0,0 +1,36 @@
++function projection_value=project2d(md3d,value,layer)
++%PROJECT2D - returns the value of a field for a given layer of the mesh
++%
++%   project 'value' vector taken at layer 'layer' from extruded 2d-3d mesh onto 2d mesh 
++%   used to do the extrusion. This routine is used to compare values between a 2d-3d mesh
++%   at a certain layer, and the equivalent value (if it exists), on the original 2d mesh. 
++%   This routine relies heavily on projections (contained in 3d model md) recored during 
++%   the extrude operation.
++%
++%   Usage:
++%      projection_value=project2d(md3d,value,layer)
++%
++%   Example:
++%      vel2=project2d(md3d,md3d.vel,2);
++
++%some checks on list of arguments
++if ((nargin~=3) ),
++	help project2d
++	error('project2d error message');
++end
++
++if (md3d.mesh.dimension~=3),
++	error('wrong model type ... should be ''3d''');
++end
++
++if ((layer<1) | (layer>md3d.mesh.numberoflayers)),
++	error(['layer must be between 1 and ' num2str(md3d.mesh.numberoflayers)]);
++end
++
++if size(value,1)==md3d.mesh.numberofvertices,
++	projection_value=value((layer-1)*md3d.mesh.numberofvertices2d+1:layer*md3d.mesh.numberofvertices2d,:);
++elseif size(value,1)==md3d.mesh.numberofvertices+1,
++	projection_value=[value((layer-1)*md3d.mesh.numberofvertices2d+1:layer*md3d.mesh.numberofvertices2d,:); value(end,:)];
++else
++	projection_value=value((layer-1)*md3d.mesh.numberofelements2d+1:layer*md3d.mesh.numberofelements2d,:);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project3d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project3d.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project3d.m	(revision 13007)
+@@ -0,0 +1,82 @@
++function projected_vector=project3d(md,varargin);
++%PROJECT3D - vertically project a vector from 2d mesh
++%
++%   vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh.
++%   This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an 
++%   element vector of size (md.mesh.numberofelements2d,N/A). 
++%   arguments: 
++%      'vector': 2d vector
++%      'type': 'element' or 'node'. 
++%   options: 
++%      'layer' a layer number where vector should keep its values. If not specified, all layers adopt the 
++%             value of the 2d vector.
++%      'padding': default to 0 (value adopted by other 3d layers not being projected0
++%
++%   Egs:
++%      extruded_vector=project3d(md,'vector',vector2d,'type','node','layer',1,'padding',NaN);
++%      extruded_vector=project3d(md,'vector',vector2d,'type','element','padding',0);
++%      extruded_vector=project3d(md,'vector',vector2d,'type','node');
++
++%some regular checks
++if nargin==0,
++	help project3d
++	error('bad usage');
++end
++if md.mesh.dimension~=3
++	error('input model is not 3d');
++end
++
++%retrieve parameters from options.
++options      = pairoptions(varargin{:});
++vector2d     = getfieldvalue(options,'vector');     %mandatory
++type         = getfieldvalue(options,'type');       %mandatory
++layer        = getfieldvalue(options,'layer',0);    %optional (do all layers otherwise)
++paddingvalue = getfieldvalue(options,'padding',0);  %0 by default
++
++if length(vector2d)==1,
++	projected_vector=vector2d;
++elseif strcmpi(type,'node'),
++
++	%Initialize 3d vector
++	if size(vector2d,1)==md.mesh.numberofvertices2d
++		projected_vector=paddingvalue*ones(md.mesh.numberofvertices,  size(vector2d,2));
++	elseif size(vector2d,1)==md.mesh.numberofvertices2d+1
++		projected_vector=paddingvalue*ones(md.mesh.numberofvertices+1,size(vector2d,2));
++		projected_vector(end,:)=vector2d(end,:);
++		vector2d=vector2d(1:end-1,:);
++	else
++		error('vector length not supported')
++	end
++
++	%Fill in
++	if layer==0,
++		for i=1:md.mesh.numberoflayers,
++			projected_vector(((i-1)*md.mesh.numberofvertices2d+1):(i*md.mesh.numberofvertices2d),:)=vector2d;
++		end
++	else
++		projected_vector(((layer-1)*md.mesh.numberofvertices2d+1):(layer*md.mesh.numberofvertices2d),:)=vector2d;
++	end
++elseif strcmpi(type,'element'),
++
++	%Initialize 3d vector
++	if size(vector2d,1)==md.mesh.numberofelements2d
++		projected_vector=paddingvalue*ones(md.mesh.numberofelements,  size(vector2d,2));
++	elseif size(vector2d,1)==md.mesh.numberofelements2d+1
++		projected_vector=paddingvalue*ones(md.mesh.numberofelements+1,size(vector2d,2));
++		projected_vector(end,:)=vector2d(end,:);
++		vector2d=vector2d(1:end-1,:);
++	else
++		error('vector length not supported')
++	end
++
++	if layer==0,
++		for i=1:(md.mesh.numberoflayers-1),
++			projected_vector( ((i-1)*md.mesh.numberofelements2d+1):(i*md.mesh.numberofelements2d),:)=vector2d;
++		end
++
++	else
++		projected_vector( ((layer-1)*md.mesh.numberofelements2d+1):(layer*md.mesh.numberofelements2d),:)=vector2d;
++	end
++else
++	error('project3d error message: unknown projection type');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/DepthAverage.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/DepthAverage.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/DepthAverage.m	(revision 13007)
+@@ -0,0 +1,33 @@
++function  vector_average=DepthAverage(md,vector);
++%DEPTHAVERAGE - computes depth average of 3d vector, and return value on 2d mesh. 
++%
++%   Usage:
++%      vector_average=DepthAverage(md,vector);
++%
++%   Example:
++%      vel_bar=DepthAverage(md,md.initialization.vel);
++
++%check that the model given in input is 3d
++if ~md.mesh.dimension==3;
++	error('DepthAverage error message: the model given in input must be 3d')
++end
++
++%nods data
++if (length(vector)==md.mesh.numberofvertices),
++	vector_average=zeros(md.mesh.numberofvertices2d,1);
++	for i=1:md.mesh.numberoflayers-1,
++		vector_average=vector_average+(project2d(md,vector,i)+project2d(md,vector,i+1))/2.*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
++	end
++	vector_average=vector_average./project2d(md,md.geometry.thickness,1);
++
++%element data
++elseif (length(vector)==md.mesh.numberofelements),
++	vector_average=zeros(md.mesh.numberofelements2d,1);
++	for i=1:md.mesh.numberoflayers-1,
++		vector_average=vector_average+project2d(md,vector,i).*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
++	end
++	vector_average=vector_average./project2d(md,md.geometry.thickness,1);
++
++else
++	error('vector size not supported yet');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodellist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodellist.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodellist.m	(revision 13007)
+@@ -0,0 +1,50 @@
++function varargout=loadmodellist(path)
++%LOADMODELLIST- load a model using built-in load module
++%
++%   check that modellist prototype has not changed. if so, adapt to new modellist prototype.
++%
++%   Usage:
++%      mds=loadmodellist(path)
++%      loadmodellist path
++
++%check nargout
++if nargout>1,
++	error('loadmodellist usage error: mds=loadmodellist(path)');
++end
++%check existence
++if ~exist(path)
++	error(['loadmodellist error message: file ' path ' does not exist']);
++end
++
++%check that the file is readable
++[stat,mess]=fileattrib(path);
++if( stat==0 | mess.UserRead~=1),
++	error(['loadmodellist error message: file ' path ' is not readable (permission dinied).']);
++end
++
++%check number of variables
++if length(whos('-file',path))>1,
++	error(['loadmodellist error message: file ' path ' contains several variables. Only one model should be present.']);
++end
++
++try,
++	struc=load(path,'-mat');
++
++	%get name of model variable
++	fieldname=char(fieldnames(struc));
++	mds=eval(['struc.' fieldname]);
++	if ~strcmpi(class(mds),'model'),
++		mds2=modellist;
++		mds2=structtomodel(mds2,mds);
++		mds=mds2;
++		clear mds2;
++	end
++	if nargout,
++		varargout{1}=mds;
++	else
++		assignin('caller',fieldname,mds);
++	end
++catch me
++	disp(getReport(me))
++	error(['could not load model ' path]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodel.m	(revision 13007)
+@@ -0,0 +1,46 @@
++function varargout=loadmodel(path)
++%LOADMODEL - load a model using built-in load module
++%
++%   check that model prototype has not changed. if so, adapt to new model prototype.
++%
++%   Usage:
++%      md=loadmodel(path)
++%      loadmodel path
++
++%check nargout
++if nargout>1,
++	error('loadmodel usage error: md=loadmodel(path)');
++end
++
++%check existence
++if exist(path,'file')
++	%do nothing
++elseif exist([path '.mat'],'file')
++	%add extension
++	path = [path '.mat'];
++else
++	error(['loadmodel error message: file ' path ' does not exist']);
++end
++
++try,
++	%recover model on file and name it md
++	warning off MATLAB:unknownElementsNowStruc;
++	warning off MATLAB:load:classNotFound
++	struc=load(path,'-mat');
++	warning on MATLAB:unknownElementsNowStruc;
++	warning on MATLAB:load:classNotFound
++
++	name=char(fieldnames(struc));
++	if size(name,1)>1,
++		error(['loadmodel error message: file ' path ' contains several variables. Only one model should be present.']); 
++	end
++	md=struc.(name);
++	if nargout,
++		varargout{1}=md;
++	else
++		assignin('caller',name,md);
++	end
++catch me
++	disp(getReport(me))
++	error(['could not load model ' path]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/tres.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/tres.m	(revision 13006)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/tres.m	(revision 13007)
+@@ -89,3 +89,31 @@
+ else 
+ 	error(['tres error message: analysis ' string ' not supported yet!']);
+ end
++end 
++function string=EnumToModelField(enum) % {{{
++	%ENUMTOMODELFIELD - output string of model field associated to enum
++	%
++	%   Usage:
++	%      string=EnumToModelField(enum)
++
++	disp('Warning: EnumToModelField is deprecated, it cannot work with new model definition. This function will be removed in the future');
++
++	switch enum,
++
++		case ThicknessEnum(), string='thickness'; return
++		case FrictionCoefficientEnum(), string='drag_coefficient'; return
++		case MaterialsRheologyBEnum(), string='rheology_B'; return
++		case MaterialsRheologyBbarEnum(), string='rheology_B'; return
++		case BalancethicknessThickeningRateEnum: string='dhdt'; return
++		case VxEnum(), string='vx'; return
++		case InversionVxObsEnum(), string='vx_obs'; return
++		case VyEnum(), string='vy'; return
++		case InversionVyObsEnum(), string='vy_obs'; return
++		case BasalforcingsMeltingRateEnum(), string='basal_melting_rate'; return
++		case SurfaceforcingsAccumulationRateEnum(), string='surface_accumulation_rate'; return
++		case SurfaceforcingsAblationRateEnum(), string='surface_ablation_rate'; return
++		case SurfaceforcingsMassBalanceEnum(), string='surface_mass_balance'; return
++		otherwise, error(['Enum ' num2str(enum)  ' not found associated to any model field']);
++
++		end
++	end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hydrology/effectivepressure.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hydrology/effectivepressure.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hydrology/effectivepressure.m	(revision 13007)
+@@ -0,0 +1,12 @@
++function Neff=effectivepressure(md)
++%EFFECTIVEPRESSURE - compute effective pressure
++%
++%   Usage:
++%      Neff=effectivepressure(md)
++%
++%   Example:
++%      Neff=effectivepressure(md)
++
++Neff=md.materials.rho_ice*md.constants.g*md.geometry.thickness+md.materials.rho_ice*md.constants.g*md.geometry.bed;
++pos=find(Neff<0);
++Neff(pos)=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/massbalance/divergence.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/massbalance/divergence.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/massbalance/divergence.m	(revision 13007)
+@@ -0,0 +1,27 @@
++function div=divergence(md,a,b)
++%DIVERGENCE - divergence of [a;b] vector, using model's triangulation.
++%
++%   Usage:
++%      div=divergence(md,a,b)
++
++if (md.mesh.dimension==2),
++	numberofelements=md.mesh.numberofelements;
++	numberofnodes=md.mesh.numberofvertices;
++	index=md.mesh.elements;
++	x=md.mesh.x; y=md.mesh.y; z=md.mesh.z;
++else
++	numberofelements=md.mesh.numberofelements2d;
++	numberofnodes=md.mesh.numberofvertices2d;
++	index=md.mesh.elements2d;
++	x=md.mesh.x2d; y=md.mesh.y2d;
++end
++
++%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
++[alpha beta]=GetNodalFunctionsCoeff(index,x,y);
++
++summation=[1;1;1];
++dx=(a(index).*alpha)*summation;
++dy=(b(index).*beta)*summation;
++
++div=dx+dy;
++div=averaging(md,div,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 13007)
+@@ -0,0 +1,52 @@
++def oshostname():
++	import socket
++
++	return socket.gethostname().lower().split('.')[0]
++
++def strcmp(s1,s2):
++
++	if s1 == s2:
++		return True
++	else:
++		return False
++
++def strncmp(s1,s2,n):
++
++	if s1[0:n] == s2[0:n]:
++		return True
++	else:
++		return False
++
++def strcmpi(s1,s2):
++
++	if s1.lower() == s2.lower():
++		return True
++	else:
++		return False
++
++def strncmpi(s1,s2,n):
++
++	if s1.lower()[0:n] == s2.lower()[0:n]:
++		return True
++	else:
++		return False
++
++def ismember(a,s):
++	import numpy
++
++	if not isinstance(s,(tuple,list,dict,numpy.ndarray)):
++		s=[s]
++
++	if not isinstance(a,(tuple,list,dict,numpy.ndarray)):
++		a=[a]
++
++	if not isinstance(a,numpy.ndarray):
++		b=[item in s for item in a]
++
++	else:
++		b=numpy.empty_like(a)
++		for i,item in enumerate(a.flat):
++			b.flat[i]=item in s
++
++	return b
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/drivingstress.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/drivingstress.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/drivingstress.m	(revision 13007)
+@@ -0,0 +1,18 @@
++function [px,py,pmag]=drivingstress(md)
++%DRIVINGSTRESS -  evaluates the driving stress
++%
++%   The driving stress is computed according to the following formula: 
++%   driving stress= rho_ice*g*H*slope
++%
++%   Usage:
++%      [Fx,Fy,Fmag]=drivingstress(md)
++
++%Get slope
++[sx,sy,s]=slope(md);
++
++%Average thickness over elements
++thickness_bar=(md.geometry.thickness(md.mesh.elements(:,1))+md.geometry.thickness(md.mesh.elements(:,2))+md.geometry.thickness(md.mesh.elements(:,3)))/3;
++
++px=md.materials.rho_ice*md.constants.g*thickness_bar.*sx;
++py=md.materials.rho_ice*md.constants.g*thickness_bar.*sy;
++pmag=sqrt(px.^2+py.^2);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13007-13008.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13007-13008.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13007-13008.diff	(revision 13394)
@@ -0,0 +1,2579 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.py	(revision 13008)
+@@ -0,0 +1,26 @@
++from pairoptions import *
++from FlagElements import *
++
++def recover_areas(md,*args):
++	"""
++	RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
++
++	   This routine is called by setelementstype, do not use
++
++	   Usage:
++	      [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
++	"""
++
++	#go through varargin, extract options and plug them into subtype options, by order of appearance
++	options=pairoptions(*args)
++#	options=deleteduplicates(options,1);
++
++	#recover elements distribution
++	hutterflag  =FlagElements(md,options.getfieldvalue('hutter',''))
++	macayealflag=FlagElements(md,options.getfieldvalue('macayeal',''))
++	pattynflag  =FlagElements(md,options.getfieldvalue('pattyn',''))
++	stokesflag  =FlagElements(md,options.getfieldvalue('stokes',''))
++	filltype    =options.getfieldvalue('fill','none')
++
++	return hutterflag,macayealflag,pattynflag,stokesflag,filltype
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.m	(revision 13008)
+@@ -0,0 +1,22 @@
++function [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
++%RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
++%
++%   This routine is called by setelementstype, do not use
++%
++%   Usage:
++%      [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
++
++	%go through varargin, extract options and plug them into subtype options, by order of appearance
++	options=pairoptions(varargin{:});
++	options=deleteduplicates(options,1);
++
++	%recover elements distribution
++	hutterflag  =FlagElements(md,getfieldvalue(options,'hutter',''));
++	macayealflag=FlagElements(md,getfieldvalue(options,'macayeal',''));
++	pattynflag  =FlagElements(md,getfieldvalue(options,'pattyn',''));
++	stokesflag  =FlagElements(md,getfieldvalue(options,'stokes',''));
++	filltype    =getfieldvalue(options,'fill','none');
++
++end %end function
++
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/slope.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/slope.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/slope.m	(revision 13008)
+@@ -0,0 +1,32 @@
++function [sx,sy,s]=slope(md)
++%SLOPE - compute the surface slope
++%
++%   Usage:
++%      [sx,sy,s]=slope(md)
++
++%load some variables (it is much faster if the variab;es are loaded from md once for all) 
++if (md.mesh.dimension==2),
++	numberofelements=md.mesh.numberofelements;
++	numberofnodes=md.mesh.numberofvertices;
++	index=md.mesh.elements;
++	x=md.mesh.x; y=md.mesh.y;
++else
++	numberofelements=md.mesh.numberofelements2d;
++	numberofnodes=md.mesh.numberofvertices2d;
++	index=md.mesh.elements2d;
++	x=md.mesh.x2d; y=md.mesh.y2d;
++end
++
++%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
++[alpha beta]=GetNodalFunctionsCoeff(index,x,y);
++
++summation=[1;1;1];
++sx=(md.geometry.surface(index).*alpha)*summation;
++sy=(md.geometry.surface(index).*beta)*summation;
++s=sqrt(sx.^2+sy.^2);
++
++if md.mesh.dimension==3,
++	sx=project3d(md,'vector',sx,'type','element');
++	sy=project3d(md,'vector',sy,'type','element');
++	s=sqrt(sx.^2+sy.^2);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/ThicknessCorrection.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/ThicknessCorrection.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/ThicknessCorrection.m	(revision 13008)
+@@ -0,0 +1,77 @@
++function md=ThicknessCorrection(md,varargin)
++%THICKNESSCORRECTION - correct the thickness of the ice shelf near the grounding line
++%
++%   This routine corrects the thickness and the bed on the transition zone
++%   by forcing the hydrostatic equilibrium.
++%   the thickness is modified as follows:
++%      thickness = (1-coeff) * thickness_observation + coeff * thickness_hydrostatic
++%   where:
++%      coeff=(d/distance)^2;
++%      distance=10km by default but can be specified
++%
++%   Usage:
++%      md=ThicknessCorrection(md,varargin);
++%
++%   Example:
++%      md=ThicknessCorrection(md);
++%      md=ThicknessCorrection(md,15000);
++
++%initialize thickness with the observations, and get hydrostatic thickness from the dem
++thickness=md.geometry.thickness;
++thickness_hydro=md.geometry.surface/(1-md.materials.rho_ice/md.materials.rho_water);
++hydrostatic_ratio=zeros(size(md.geometry.thickness));
++
++%get nodes on ice sheet and on ice shelf
++pos_shelf=find(~md.mask.vertexongroundedice);
++pos_GL=intersect(unique(md.mesh.elements(find(md.mask.elementongroundedice),:)),unique(md.mesh.elements(find(md.mask.elementonfloatingice),:)));
++debug=(length(pos_shelf)>50000);
++
++%check that there is a GL
++if isempty(pos_GL)
++	error('ThicknessCorrection error message: no grounding line has been detected. Check the model mask');
++end
++
++%get distance
++if nargin==2,
++	distance=varargin{1};
++else
++	distance=10000;
++end
++
++%modify thickness
++if (debug), fprintf('%s','      correction progress:   0.00 %'); end
++for i=1:length(pos_shelf)
++
++	if (debug & mod(i,100)==0),
++		fprintf('\b\b\b\b\b\b\b%5.2f%s',i/length(pos_shelf)*100,' %');
++	end
++
++	%search the node on ice sheet the closest to i
++	[d posd]=min(sqrt((md.mesh.x(pos_shelf(i))-md.mesh.x(pos_GL)).^2+(md.mesh.y(pos_shelf(i))-md.mesh.y(pos_GL)).^2));
++
++	if d>distance,
++
++		%if d > 15km, hydrostatic equilibrium
++		hydrostatic_ratio(pos_shelf(i))=1;
++		thickness(pos_shelf(i))=thickness_hydro(pos_shelf(i));
++
++	else
++
++		%else: quadratic combination of hydrostatic equilibrium and observations
++		hydrostatic_ratio(pos_shelf(i))=(d/distance)^2;
++		thickness(pos_shelf(i))=(1-hydrostatic_ratio(pos_shelf(i)))*thickness(pos_shelf(i))+hydrostatic_ratio(pos_shelf(i))*thickness_hydro(pos_shelf(i));
++
++	end
++end
++if (debug), fprintf('\b\b\b\b\b\b\b%5.2f%s\n',100,' %'); end
++
++%check the computed thickness
++minth=1/(1-md.materials.rho_ice/md.materials.rho_water);
++pos=find(isnan(thickness) | (thickness<=0));
++thickness(pos)=minth;
++hydrostatic_ratio(pos)=-1;
++
++%change bed to take into account the changes in thickness
++md.geometry.thickness=thickness;
++md.geometry.hydrostatic_ratio=hydrostatic_ratio;
++md.geometry.bed=md.geometry.surface-md.geometry.thickness;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/modellist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/modellist.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/modellist.m	(revision 13008)
+@@ -9,6 +9,118 @@
+ 		cluster = generic();
+ 	end
+ 	methods
++		function md_list=modelsextract(md,flags,minel,varargin) % {{{
++			%modelsextract - extract several self contained models according to a list of element flags.
++			%
++			%   The difference between this routine and the modelextract.m routine (without an 's') is that 
++			%   as many models are extracted as there are closed contours defined in area. 
++			%   This routine is needed for example when doing data assimilation of ice shelves in Antarctica. 
++			%   Many independent ice shelves are present, and we don't want data assimilation on one ice shelf 
++			%   to be hindered by another totally independent ice shelf.
++			%
++			%   Usage:
++			%      md_list=modelsextract(md,elementfalgs,minel);
++			%
++			%   Examples:
++			%      md_list=modelsextract(md,md.mask.elementonfloatingice,1000);
++			%
++			%   See also: EXTRUDE, COLLAPSE, MODELEXTRACT
++
++			disp('selecting pools of elements');
++			%go through flags and build as many independent element flags as there are groups of connected 1s
++			%in flags.
++
++			%2D or 3D?
++			if md.mesh.dimension==3,
++				numberofelements=md.mesh.numberofelements2d; %this will be forgotten when we get out.
++				flags=project2d(md,flags,1);
++			else
++				numberofelements=md.mesh.numberofelements;
++			end
++
++			%recover extra arguments: 
++			distance=0;
++			if nargin==4,
++				distance=varargin{1};
++			end
++
++			flag_list=cell(0,1);
++
++			for i=1:size(flags,1),
++
++				if (flags(i)),
++
++					%ok, we are sure element i is part of a new pool.
++					pool=zeros(numberofelements,1);
++					pool=PropagateFlagsFromConnectivity(md.mesh.elementconnectivity,pool,i,flags);
++					flag_list{end+1,1}=pool;
++
++					%speed up rest of computation by taking pool out of flags: 
++					pos=find(pool);flags(pos)=0;
++
++				end
++			end
++
++			%go through flag_list and discard any pool of less than minel elements: 
++			ex_pos=[];
++			for i=1:length(flag_list),
++				if length(find(flag_list{i}))<minel,
++					ex_pos=[ex_pos; i];
++				end
++			end
++			flag_list(ex_pos)=[];
++
++			%now, if distance was specified, expand the flag_list by distance km: 
++			if distance,
++				for i=1:length(flag_list),
++					flag_list{i}=PropagateFlagsUntilDistance(md,flag_list{i},distance);
++				end
++			end
++
++			%now, go use the pools of flags to extract models: 
++			disp(['extracting ' num2str(size(flag_list,1)) ' models']);
++			models=cell(0,1);
++
++			for i=1:size(flag_list,1),
++				disp(['   ' num2str(i) '/' num2str(size(flag_list,1))]);
++				if md.mesh.dimension==3,
++					flags2d=flag_list{i};
++					realflags=project3d(md,flags2d,'element');
++				else
++					realflags=flag_list{i};
++				end
++				models{end+1,1}=modelextract(md,realflags);
++			end
++
++			%return model list
++			md_list=modellist(models);
++
++		end %end of this function }}}
++		function md_list=modelsextractfromdomains(md,directory) % {{{
++			%modelsextractfromdomains- extract several self contained models according to a list of domains
++			%
++			%   Usage:
++			%      md_list=modelsextractfromdomains(md,'Basins/');
++			%
++			%   Examples:
++			%      md_list=modelsextract(md,'Basins/');
++			%
++			%   See also: MODELSEXTRACTS, MODELEXTRACT
++
++			%go into directory and get list of files.
++			cd(directory);
++			basins=listfiles;
++			cd ..
++
++			models=cell(0,1);
++			for i=1:length(basins),
++				models{end+1,1}=modelextract(md,[directory '/' basins{i}]);
++			end
++
++			%return model list: 
++			md_list=modellist(models);
++
++		end % }}}
+ 		function obj = modellist(varargin) % {{{
+ 
+ 			%initialize list
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/SectionValues.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/SectionValues.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/SectionValues.m	(revision 13008)
+@@ -1,127 +0,0 @@
+-function [index,X,Y,Z,S,data_interp]=SectionValues(md,data,infile,resolution)
+-%SECTIONVALUES - compute the value of a field on a section
+-%
+-%   This routine gets the value of a given field of the model on points
+-%   given by filname (Argus type file)
+-%
+-%   Usage:
+-%      [elements,x,y,z,s,data]=SectionValues(md,data,filename,resolution)
+-%      [elements,x,y,z,s,data]=SectionValues(md,data,profile_structure,resolution)
+-
+-%check what we have for profile as input
+-if ischar(infile),
+-	%read infile:
+-	profile=expread(infile);
+-	nods=profile.nods;
+-	x=profile.x;
+-	y=profile.y;
+-else
+-	%read infile:
+-	nods=infile.nods;
+-	x=infile.x;
+-	y=infile.y;
+-end
+-
+-
+-%get the specified resolution
+-if isnumeric(resolution(1))
+-	res_h=resolution(1);
+-else
+-	error('SectionValues error message: wrong resolution type. Resolution must be an array [horizontal_resolution vertical_resolution]')
+-end
+-if md.mesh.dimension==3
+-	if (length(resolution)==2 & isnumeric(resolution(2)))
+-		res_v=resolution(2);
+-	else
+-		error('SectionValues error message: wrong resolution type. Resolution must be an array [horizontal_resolution vertical_resolution]')
+-	end
+-end
+-
+-%initialization
+-X=[]; %X-coordinate
+-Y=[]; %Y-coordinate
+-S=0;  %curvilinear coordinate
+-
+-for i=1:nods-1
+-
+-	x_start=x(i);
+-	x_end=x(i+1);
+-	y_start=y(i);
+-	y_end=y(i+1);
+-	s_start=S(end);
+-
+-	length_segment=sqrt((x_end-x_start)^2+(y_end-y_start)^2);
+-	portion=ceil(length_segment/res_h);
+-
+-	x_segment=zeros(portion,1);
+-	y_segment=zeros(portion,1);
+-	s_segment=zeros(portion,1);
+-
+-	for j=1:portion
+-		x_segment(j)=x_start+(j-1)*(x_end-x_start)/portion;
+-		y_segment(j)=y_start+(j-1)*(y_end-y_start)/portion;
+-		s_segment(j)=s_start+j*length_segment/portion;
+-	end
+-
+-	%plug into X and Y
+-	X=[X;x_segment];
+-	Y=[Y;y_segment];
+-	S=[S;s_segment];
+-end
+-X(end+1)=x(nods);
+-Y(end+1)=y(nods);
+-
+-%Number of nodes:
+-numberofnodes=size(X,1);
+-
+-%Compute Z
+-Z=zeros(numberofnodes,1);
+-
+-%New mesh and Data interpolation
+-if (md.mesh.dimension==2)
+-
+-	%Interpolation of data on specified points
+-	data_interp=InterpFromMesh2d(md.mesh.elements,md.mesh.x,md.mesh.y,data,X,Y);
+-	%data_interp=InterpFromMeshToMesh2d(md.mesh.elements,md.mesh.x,md.mesh.y,data,X,Y);
+-	%data_interp=griddata(md.mesh.x,md.mesh.y,data,X,Y);
+-
+-	%Compute index
+-	index=[1:1:(numberofnodes-1);2:1:numberofnodes]';
+-
+-else
+-
+-	%vertically extrude mesh
+-
+-	%Get bed and surface for each 2d point, offset to make sure that it is inside the glacier system
+-	offset=10^-3;
+-	bed=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.bed,1),X,Y)+offset;
+-	surface=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.surface,1),X,Y)-offset;
+-
+-	%Some useful parameters
+-	layers=ceil(mean(md.geometry.thickness)/res_v);
+-	nodesperlayer=numberofnodes;
+-	nodestot=nodesperlayer*layers;
+-	elementsperlayer=nodesperlayer-1;
+-	elementstot=(nodesperlayer-1)*(layers-1);
+-
+-	%initialization
+-	X3=zeros(nodesperlayer*layers,1); Y3=zeros(nodesperlayer*layers,1); Z3=zeros(nodesperlayer*layers,1); S3=zeros(nodesperlayer*layers,1); index3=zeros(elementstot,4);
+-
+-	%Get new coordinates in 3d
+-	for i=1:layers
+-		X3(i:layers:end)=X;
+-		Y3(i:layers:end)=Y;
+-		Z3(i:layers:end)=bed+(i-1)*(surface-bed)/(layers-1);
+-		S3(i:layers:end)=S;
+-
+-		if i<layers %Build index3 with quads
+-			index3((i-1)*elementsperlayer+1:i*elementsperlayer,:)=[i:layers:nodestot-layers; i+1:layers:nodestot-layers; i+layers+1:layers:nodestot; i+layers:layers:nodestot]';
+-		end
+-	end
+-
+-	%Interpolation of data on specified points
+-	data_interp=InterpFromMeshToMesh3d(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z,data,X3,Y3,Z3,NaN);
+-
+-	%build outputs
+-	X=X3; Y=Y3; Z=Z3;  S=S3; index=index3;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/PropagateFlagsUntilDistance.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/PropagateFlagsUntilDistance.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/PropagateFlagsUntilDistance.m	(revision 13008)
+@@ -1,64 +0,0 @@
+-function new_flags=PropagateFlagsUntilDistance(md,flags,distance)
+-%PROPAGATEFLAGSUNTILDISTANCE
+-%
+-% Usage: 
+-%              flags=PropagateFlagsUntilDistance(md,flags,distance)
+-%
+-%
+-
+-
+-	
+-new_flags=flags;
+-
+-%make 3d work in 2d: 
+-if md.mesh.dimension==3,
+-	md.mesh.x=md.mesh.x2d;
+-	md.mesh.y=md.mesh.y2d;
+-	md.mesh.elements=md.mesh.elements2d;
+-end
+-
+-%find elements that are at the border of flags: 
+-flag_elements=find(flags);
+-conn=md.mesh.elementconnectivity(flag_elements,:);
+-pos=find(conn);conn(pos)=~flags(conn(pos));
+-sum_conn=sum(conn,2);
+-border_elements=flag_elements(find(sum_conn>=1));
+-
+-
+-%average x and y over elements: 
+-x_elem=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+-y_elem=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+-
+-while 1,
+-
+-	%keep copy of new_flags for this loop: 
+-	new_flags_bak=new_flags;
+-
+-	%extend new flags by connectivity
+-	pos=find(new_flags);
+-
+-	connected_elements=md.mesh.elementconnectivity(pos,:);
+-	connected_elements=connected_elements(find(connected_elements));
+-	new_flags(connected_elements)=1;
+-
+-	%get new elements: 
+-	new_elements=find(new_flags & ~new_flags_bak);
+-	if ~length(new_elements),
+-		%we are done!
+-		break;
+-	end
+-
+-
+-	%check which of these new elements are more than distance away from the border elements
+-	for i=1:length(new_elements),
+-		dist=sqrt(     (x_elem(border_elements)-x_elem(new_elements(i))).^2 + (y_elem(border_elements)-y_elem(new_elements(i))).^2)-distance;
+-		if ~any(dist<0)
+-			%none of the border elements are within distance, this element is outside out area of interest.
+-			%ensure this element never gets found again in the connectivity.
+-			pos=find(md.mesh.elementconnectivity==new_elements(i));
+-			md.mesh.elementconnectivity(pos)=0;
+-			%exclude this new element from the new_flags!
+-			new_flags(new_elements(i))=0;
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/misfit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/misfit.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/misfit.m	(revision 13008)
+@@ -1,37 +0,0 @@
+-function J=misfit(md)
+-%MISFIT - compute misfit
+-%
+-%   Usage:
+-%      J=misfit(md)
+-%
+-%   Example:
+-%      J=misfit(md)
+-%
+-
+-if md.mesh.dimension==2,
+-	elements=md.mesh.elements;
+-	x=md.mesh.x;
+-	y=md.mesh.y;
+-	vx=md.initialization.vx;
+-	vy=md.initialization.vy;
+-	vx_obs=md.inversion.vx_obs;
+-	vy_obs=md.inversion.vy_obs;
+-else
+-	elements=md.mesh.elements2d;
+-	x=md.mesh.x2d;
+-	y=md.mesh.y2d;
+-	vx=project2d(md,md.initialization.vx,md.mesh.numberoflayers);
+-	vy=project2d(md,md.initialization.vy,md.mesh.numberoflayers);
+-	vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers);
+-	vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers);
+-end
+-
+-%compute areas;
+-areas=GetAreas(elements,x,y);
+-
+-%compute delta v on elements
+-deltav=1/2*(   (vx-vx_obs).^2+(vy-vy_obs).^2)/md.constants.yts^2;
+-deltav_elem=deltav(elements)*[1;1;1]/3;
+-
+-%compute misfit
+-J=sum(deltav_elem.*areas);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/qstat.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/qstat.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/qstat.m	(revision 13008)
+@@ -1,8 +0,0 @@
+-function qstat(md)
+-%QSTAT - check job status on remote cluster
+-%
+-%   Usage:
+-%      qstat(md)
+-
+-%run qstat command on remote cluster
+-issmssh(md.cluster,['qstat -a']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/radarpower.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/radarpower.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/radarpower.m	(revision 13008)
+@@ -1,118 +0,0 @@
+-function md=radarpower(md,varargin)
+-%RADARPOWER - overlay a power radar image on an existing mesh
+-%
+-%   This routine will overlay a power radar image on an existing mesh.
+-%   The power amplitude will be output to vel for now.
+-%   In the future, think about a field to hold this value.
+-%
+-%   Usage:
+-%      md=radarpower(md,options);
+-%      md=radarpower(md)
+-
+-%If gdal does not work, uncomment the following line
+-%setenv('LD_LIBRARY_PATH','/proj/ice/larour/issm/trunk/externalpackages/gdal/install/lib/');
+-%Parse inputs
+-if nargin==1,
+-	options=pairoptions;
+-else
+-	options=varargin{:};
+-	if ~isa(options,'pairoptions'),
+-		options=pairoptions(varargin{:});
+-	end
+-end
+-
+-highres=getfieldvalue(options,'highres',0);
+-xlim=getfieldvalue(options,'xlim',[min(md.mesh.x) max(md.mesh.x)]);
+-ylim=getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]);
+-posting=getfieldvalue(options,'posting',0); % 0 -> image posting default
+-
+-%find gdal coordinates
+-x0=min(xlim); x1=max(xlim);
+-y0=min(ylim); y1=max(ylim);
+-
+-%figure out if we should go look for Greenland or Antarctica geotiff, or if user provided one.
+-if ~exist(options,'overlay_image'),
+-	if strcmpi(md.mesh.hemisphere,'n'),
+-		if ~exist([jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg']),
+-			error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg not found.']);
+-		end
+-		name = 'mog150_greenland_map';
+-		%name = 'mog100_hp1_v10';
+-		%name = 'mog500_hp1_v10';
+-		jpgim=[jplsvn() '/projects/ModelData/MOG/' name '.jpg'];
+-		geom=load([jplsvn() '/projects/ModelData/MOG/' name '.jpgw'],'ascii');
+-
+-		%geom:   xposting nbcols nbrows yposting xmin ymax
+-		xmin=max(geom(5),x0);
+-		xmax=min(geom(5)+geom(1)*geom(2),x1);
+-		ymin=max(geom(6)-geom(3)*geom(4),y0);
+-		ymax=min(geom(6),y1);
+-
+-		firstcol=max(1,floor((xmin-geom(5))/geom(1))); %x min
+-		firstrow=max(1,floor((geom(6)-ymax)/geom(4))); %y max
+-		numcols=floor((xmax-xmin)/geom(1)); % x posting
+-		numrows=floor((ymax-ymin)/geom(4)); % y posting
+-		pixelskip=max(1,ceil(posting/geom(1)));
+-
+-		%Read and crop file
+-		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-		im=imread(jpgim);
+-		im=im(firstrow:firstrow+numrows-1,firstcol:firstcol+numcols-1);
+-		md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
+-		md.radaroverlay.x=(xmin:(xmax-xmin)/(size(md.radaroverlay.pwr,2)-1):xmax);
+-		md.radaroverlay.y=(ymin:(ymax-ymin)/(size(md.radaroverlay.pwr,1)-1):ymax);
+-
+-	elseif strcmpi(md.mesh.hemisphere,'s'),
+-		if highres,
+-			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif']),
+-				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif not found.']);
+-			end
+-			geotiff_name=[jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif'];
+-		else
+-			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif']),
+-				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif not found.']);
+-			end
+-			geotiff_name=[jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif'];
+-		end
+-
+-		%Name of image
+-		inputname='./temp.tif';
+-		eval(['!gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ]);
+-
+-		%Read in temp.tif:
+-		im=imread('temp.tif','TIFF');
+-		pixelskip=max(1,ceil(posting/((x1-x0)/(size(im,2)))));
+-		md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
+-		md.radaroverlay.x=(x0:(x1-x0)/(size(md.radaroverlay.pwr,2)-1):x1);
+-		md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
+-
+-		%Erase image
+-		system('rm -rf ./temp.tif');
+-
+-	else
+-		error('field hemisphere should either be ''n'' or ''s''');
+-	end
+-else
+-	%ok, user provided an image. check we also have overlay_xlim and overlay_ylim  options, to know what range of coordinates the image covers.
+-	if (~exist(options,'overlay_xlim') | ~exist(options,'overlay_xlim')| ~exist(options,'overlay_xposting')| ~exist(options,'overlay_yposting')),
+-		error('radarpower error message: please provide overlay_xlim, overlay_ylim, overlay_xposting and overlay_yposting options together with overlay_image option');
+-	end
+-	overlay_image=getfieldvalue(options,'overlay_image');
+-	overlay_xlim=getfieldvalue(options,'overlay_xlim');
+-	overlay_ylim=getfieldvalue(options,'overlay_ylim');
+-	overlay_xposting=getfieldvalue(options,'overlay_xposting');
+-	overlay_yposting=getfieldvalue(options,'overlay_yposting');
+-
+-	sizex=floor((x1-x0)/overlay_xposting);
+-	sizey=floor((y1-y0)/overlay_yposting);
+-	topleftx=floor((x0-overlay_xlim(1))/overlay_xposting); % x min
+-	toplefty=floor((overlay_ylim(2)-y1)/overlay_yposting); % y max
+-
+-	%Read and crop file
+-	disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-	im=imread(overlay_image);
+-	im=im(toplefty:toplefty+sizey,topleftx:topleftx+sizex);
+-	md.radaroverlay.pwr=double(flipud(im));
+-	md.radaroverlay.x=(x0:(x1-x0)/(size(md.radaroverlay.pwr,2)-1):x1);
+-	md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modelsextract.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modelsextract.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modelsextract.m	(revision 13008)
+@@ -1,87 +0,0 @@
+-function md_list=modelsextract(md,flags,minel,varargin)
+-%modelsextract - extract several self contained models according to a list of element flags.
+-%
+-%   The difference between this routine and the modelextract.m routine (without an 's') is that 
+-%   as many models are extracted as there are closed contours defined in area. 
+-%   This routine is needed for example when doing data assimilation of ice shelves in Antarctica. 
+-%   Many independent ice shelves are present, and we don't want data assimilation on one ice shelf 
+-%   to be hindered by another totally independent ice shelf.
+-%
+-%   Usage:
+-%      md_list=modelsextract(md,elementfalgs,minel);
+-%
+-%   Examples:
+-%      md_list=modelsextract(md,md.mask.elementonfloatingice,1000);
+-%
+-%   See also: EXTRUDE, COLLAPSE, MODELEXTRACT
+-
+-disp('selecting pools of elements');
+-%go through flags and build as many independent element flags as there are groups of connected 1s
+-%in flags.
+-
+-%2D or 3D?
+-if md.mesh.dimension==3,
+-	numberofelements=md.mesh.numberofelements2d; %this will be forgotten when we get out.
+-	flags=project2d(md,flags,1);
+-else
+-	numberofelements=md.mesh.numberofelements;
+-end
+-
+-%recover extra arguments: 
+-distance=0;
+-if nargin==4,
+-	distance=varargin{1};
+-end
+-
+-flag_list=cell(0,1);
+-
+-for i=1:size(flags,1),
+-
+-	if (flags(i)),
+-
+-		%ok, we are sure element i is part of a new pool.
+-		pool=zeros(numberofelements,1);
+-		pool=PropagateFlagsFromConnectivity(md.mesh.elementconnectivity,pool,i,flags);
+-		flag_list{end+1,1}=pool;
+-		
+-		%speed up rest of computation by taking pool out of flags: 
+-		pos=find(pool);flags(pos)=0;
+-
+-	end
+-end
+-
+-%go through flag_list and discard any pool of less than minel elements: 
+-ex_pos=[];
+-for i=1:length(flag_list),
+-	if length(find(flag_list{i}))<minel,
+-		ex_pos=[ex_pos; i];
+-	end
+-end
+-flag_list(ex_pos)=[];
+-
+-%now, if distance was specified, expand the flag_list by distance km: 
+-if distance,
+-	for i=1:length(flag_list),
+-		flag_list{i}=PropagateFlagsUntilDistance(md,flag_list{i},distance);
+-	end
+-end
+-
+-%now, go use the pools of flags to extract models: 
+-disp(['extracting ' num2str(size(flag_list,1)) ' models']);
+-models=cell(0,1);
+-
+-for i=1:size(flag_list,1),
+-	disp(['   ' num2str(i) '/' num2str(size(flag_list,1))]);
+-	if md.mesh.dimension==3,
+-		flags2d=flag_list{i};
+-		realflags=project3d(md,flags2d,'element');
+-	else
+-		realflags=flag_list{i};
+-	end
+-	models{end+1,1}=modelextract(md,realflags);
+-end
+-
+-%return model list
+-md_list=modellist(models);
+-
+-end %end of this function
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.m	(revision 13008)
+@@ -1,22 +0,0 @@
+-function [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+-%RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
+-%
+-%   This routine is called by setelementstype, do not use
+-%
+-%   Usage:
+-%      [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+-
+-	%go through varargin, extract options and plug them into subtype options, by order of appearance
+-	options=pairoptions(varargin{:});
+-	options=deleteduplicates(options,1);
+-
+-	%recover elements distribution
+-	hutterflag  =FlagElements(md,getfieldvalue(options,'hutter',''));
+-	macayealflag=FlagElements(md,getfieldvalue(options,'macayeal',''));
+-	pattynflag  =FlagElements(md,getfieldvalue(options,'pattyn',''));
+-	stokesflag  =FlagElements(md,getfieldvalue(options,'stokes',''));
+-	filltype    =getfieldvalue(options,'fill','none');
+-
+-end %end function
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/shear2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/shear2d.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/shear2d.m	(revision 13008)
+@@ -1,23 +0,0 @@
+-function [sx,sy,sxy,s]=shear2d(md)
+-%SHEAR2D - computes 2d strain rate
+-%
+-%   This routine computes the strain rate of 2d models
+-%
+-%   Usage:
+-%      [sx,sy,sxy,s]=shear2d(md);
+-%      s=shear2d(md);
+-
+-[alpha beta]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y); 
+-
+-summation=[1;1;1];
+-sx=(md.initialization.vx(md.mesh.elements).*alpha)*summation;
+-uy=(md.initialization.vx(md.mesh.elements).*beta)*summation;
+-vx=(md.initialization.vy(md.mesh.elements).*alpha)*summation;
+-sy=(md.initialization.vy(md.mesh.elements).*beta)*summation;						
+-sxy=(uy+vx)/2;
+-s=sqrt(sx.^2+sy.^2+sxy.^2+sx.*sy);
+-
+-%if user requested only one output, it must be the norm
+-if nargout==1,
+-	sx=s;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/processgeometry.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/processgeometry.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/processgeometry.m	(revision 13008)
+@@ -1,140 +0,0 @@
+-function geom=processgeometry(geom,tol,outline);
+-
+-%Deal with edges
+-disp('Checking Edge crossing...');
+-i=0;
+-while (i<size(geom.Edges,1)),
+-
+-	%edge counter
+-	i=i+1;
+-
+-	%Get coordinates
+-	x1=geom.Vertices(geom.Edges(i,1),1);
+-	y1=geom.Vertices(geom.Edges(i,1),2);
+-	x2=geom.Vertices(geom.Edges(i,2),1);
+-	y2=geom.Vertices(geom.Edges(i,2),2);
+-	color1=geom.Edges(i,3);
+-
+-	j=i; %test edges located AFTER i only
+-	while (j<size(geom.Edges,1)),
+-
+-		%edge counter
+-		j=j+1;
+-
+-		%Skip if the two edges already have a vertex in common
+-		if any(ismember(geom.Edges(i,1:2),geom.Edges(j,1:2))),
+-			continue
+-		end
+-
+-		%Get coordinates
+-		x3=geom.Vertices(geom.Edges(j,1),1);
+-		y3=geom.Vertices(geom.Edges(j,1),2);
+-		x4=geom.Vertices(geom.Edges(j,2),1);
+-		y4=geom.Vertices(geom.Edges(j,2),2);
+-		color2=geom.Edges(j,3);
+-
+-		%Check if the two edges are crossing one another
+-		if SegIntersect([x1 y1; x2 y2],[x3 y3; x4 y4]),
+-
+-			%Get coordinate of intersection point (http://mathworld.wolfram.com/Line-LineIntersection.html)
+-			x=det([det([x1 y1; x2 y2])  x1-x2;det([x3 y3; x4 y4])  x3-x4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
+-			y=det([det([x1 y1; x2 y2])  y1-y2;det([x3 y3; x4 y4])  y3-y4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
+-
+-			%Add vertex to the list of vertices
+-			geom.Vertices(end+1,:)=[x y min(color1,color2)];
+-			id=size(geom.Vertices,1);
+-
+-			%Update edges i and j
+-			edgei=geom.Edges(i,:);
+-			edgej=geom.Edges(j,:);
+-			geom.Edges(i,:)    =[edgei(1) id       edgei(3)];
+-			geom.Edges(end+1,:)=[id       edgei(2) edgei(3)];
+-			geom.Edges(j,:)    =[edgej(1) id       edgej(3)];
+-			geom.Edges(end+1,:)=[id       edgej(2) edgej(3)];
+-
+-			%update current edge second tip
+-			x2=x; y2=y;
+-		end
+-	end
+-
+-end
+-
+-%Check point outside
+-disp('Checking for points outside the domain...');
+-i=0;
+-num=0;
+-while (i<size(geom.Vertices,1)),
+-
+-	%vertex counter
+-	i=i+1;
+-
+-	%Get coordinates
+-	x=geom.Vertices(i,1);
+-	y=geom.Vertices(i,2);
+-	color=geom.Vertices(i,3);
+-
+-	%Check that the point is inside the domain
+-	if (color~=1 & ~ContourToNodes(x,y,outline(1),1)),
+-
+-		%Remove points from list of Vertices
+-		num=num+1;
+-		geom.Vertices(i,:)=[];
+-
+-		%update edges
+-		[posedges dummy]=find(geom.Edges==i);
+-		geom.Edges(posedges,:)=[];
+-		posedges=find(geom.Edges>i);
+-		geom.Edges(posedges)=geom.Edges(posedges)-1;
+-
+-		%update counter
+-		i=i-1;
+-	end
+-end
+-if num,
+-	disp(['WARNING: ' num2str(num) ' points outside the domain outline have been removed']);
+-end
+-
+-%Check point spacing
+-if ~isnan(tol),
+-	disp('Checking point spacing...');
+-	i=0;
+-	while (i<size(geom.Vertices,1)),
+-
+-		%vertex counter
+-		i=i+1;
+-
+-		%Get coordinates
+-		x1=geom.Vertices(i,1);
+-		y1=geom.Vertices(i,2);
+-
+-		j=i; %test edges located AFTER i only
+-		while (j<size(geom.Vertices,1)),
+-
+-			%vertex counter
+-			j=j+1;
+-
+-			%Get coordinates
+-			x2=geom.Vertices(j,1);
+-			y2=geom.Vertices(j,2);
+-
+-			%Check whether the two vertices are too close
+-			if ((x2-x1)^2+(y2-y1)^2<tol^2)
+-
+-				%Remove points from list of Vertices
+-				geom.Vertices(j,:)=[];
+-
+-				%update edges
+-				posedges=find(ismember(geom.Edges,j));
+-				geom.Edges(posedges)=i;
+-				posedges=find(geom.Edges>j);
+-				geom.Edges(posedges)=geom.Edges(posedges)-1;
+-
+-				%update counter
+-				j=j-1;
+-
+-			end
+-		end
+-	end
+-end
+-%remove empty edges
+-geom.Edges(find(geom.Edges(:,1)==geom.Edges(:,2)),:)=[];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/outflow.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/outflow.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/outflow.m	(revision 13008)
+@@ -1,18 +0,0 @@
+-function flag=outflow(md);
+-%OUTFLOW - flag nodes on outflux boundary
+-%
+-%   Usage:
+-%      flag=outflow(md);
+-
+-A=md.mesh.segments(:,1);
+-B=md.mesh.segments(:,2);
+-Nx=-(md.mesh.y(A)-md.mesh.y(B));
+-Ny=  md.mesh.x(A)-md.mesh.x(B);
+-Vx=(md.initialization.vx(A)+md.initialization.vx(B))/2;
+-Vy=(md.initialization.vy(A)+md.initialization.vy(B))/2;
+-
+-%dot product
+-VdotN=Vx.*Nx+Vy.*Ny;
+-
+-flag=zeros(md.mesh.numberofvertices,1);
+-flag(A(find(VdotN>0)))=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/thicknessevolution.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/thicknessevolution.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/thicknessevolution.m	(revision 13008)
+@@ -1,28 +0,0 @@
+-function dhdt=thicknessevolution(md)
+-%THICKNESSEVOLUTION - compute the new thickness of a model after ∆t
+-%
+-%   This routine compute the new thickness of a model after a time step
+-%   according to the following formula:
+-%   dh/dt=-div(Hu)
+-%
+-%   Usage:
+-%      dhdt=thicknessevolution(md)
+-
+-if (length(md.initialization.vx)~=md.mesh.numberofvertices)|(length(md.initialization.vy)~=md.mesh.numberofvertices)
+-	error(['thicknessevolution error message: vx and vy should have a length of ' num2str(md.mesh.numberofvertices)])
+-end
+-
+-%load some variables 
+-H=md.geometry.thickness;
+-vx=md.initialization.vx;
+-vy=md.initialization.vy;
+-index=md.mesh.elements;
+-
+-%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
+-[alpha beta]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y); 
+-
+-%compute dhdt=div(Hu)
+-summation=1/3*ones(3,1);
+-dhdt=(vx(index)*summation).*sum( H(index).*alpha,2) + (vy(index)*summation).*sum(H(index).*beta,2) ...
+-	+ ( H(index)*summation).*sum(vx(index).*alpha,2) + ( H(index)*summation).*sum(vy(index).*beta,2);
+-dhdt=-dhdt;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/README
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/README	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/README	(revision 13008)
+@@ -1,11 +0,0 @@
+-This directory is similar to @model, in that it only deals
+-with methods proper to the @model class. But we need a different 
+-directory from @model, to make those methods public, not private. 
+-The advantage of public methods is that they will use subsref and 
+-susasgn to access data in a @model object.
+-
+-For ex: 
+-calling md.x in a "@model" routine just accesses the x field in the md 
+-structure. But calling md.x in a "model" routine will access the x field 
+-through the susref routine in @model. This ensures that we protect the 
+-data in @model classes from improper use.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MeltingGroundingLines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MeltingGroundingLines.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/MeltingGroundingLines.m	(revision 13008)
+@@ -1,26 +0,0 @@
+-function md=MeltingGroundingLines(md,distance,value)
+-%MELTINGGROUNDINGLINES - set melting near grounding lines to a constant value
+-%
+-%   Usage:
+-%      md=MeltingGroundingLines(md,distance,value)
+-%
+-
+-%get nodes on ice sheet and on ice shelf
+-pos_shelf=find(~md.mask.vertexongroundedice);
+-pos_GL=intersect(unique(md.mesh.elements(find(md.mask.elementongroundedice),:)),unique(md.mesh.elements(find(md.mask.elementonfloatingice),:)));
+-
+-for i=1:length(pos_shelf)
+-
+-	if (mod(i,100)==0),
+-		fprintf('\b\b\b\b\b\b\b%5.2f%s',i/length(pos_shelf)*100,' %');
+-	end
+-
+-	%search the node on ice sheet the closest to i
+-	[d posd]=min(sqrt((md.mesh.x(pos_shelf(i))-md.mesh.x(pos_GL)).^2+(md.mesh.y(pos_shelf(i))-md.mesh.y(pos_GL)).^2));
+-
+-	if d<distance,
+-
+-		md.melting(pos_shelf(i))=value;
+-
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modis.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modis.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modis.m	(revision 13008)
+@@ -1,35 +0,0 @@
+-function [xm,ym,modis]=modis(modisgeotif,xlim,ylim)
+-%MODIS - from modis geotiff, return image
+-%
+-%   Usage:
+-%      [xm,ym,modis]=modis(modisgeotif,xlim,ylim)
+-%
+-
+-%find gdal coordinates
+-x0=min(xlim);
+-x1=max(xlim);
+-
+-y0=min(ylim);
+-y1=max(ylim);
+-
+-%Get path  to gdal binaries
+-path_gdal=[issmdir() '/externalpackages/gdal/install/bin/'];
+-
+-%Was gdal compiled? 
+-if ~exist([path_gdal 'gdal_translate']),
+-	error(['modis error message: GDAL library needs to be compiled to use this routine. Compile GDAL in ' issmdir() '/externalpackages/gdal to use this routine.']);
+-end
+-
+-inputname='./temp.tif';
+-system([path_gdal 'gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' modisgeotif ' ' inputname ]);
+-
+-%Read in temp.tif:
+-modis=double(flipud(imread('temp.tif','TIFF')));
+-xm=(x0:(x1-x0)/(size(md.radaroverlay.pwr,2)-1):x1);
+-ym=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
+-
+-%Erase image
+-system('rm -rf ./temp.tif');
+-
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.py	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/recover_areas.py	(revision 13008)
+@@ -1,26 +0,0 @@
+-from pairoptions import *
+-from FlagElements import *
+-
+-def recover_areas(md,*args):
+-	"""
+-	RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
+-
+-	   This routine is called by setelementstype, do not use
+-
+-	   Usage:
+-	      [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+-	"""
+-
+-	#go through varargin, extract options and plug them into subtype options, by order of appearance
+-	options=pairoptions(*args)
+-#	options=deleteduplicates(options,1);
+-
+-	#recover elements distribution
+-	hutterflag  =FlagElements(md,options.getfieldvalue('hutter',''))
+-	macayealflag=FlagElements(md,options.getfieldvalue('macayeal',''))
+-	pattynflag  =FlagElements(md,options.getfieldvalue('pattyn',''))
+-	stokesflag  =FlagElements(md,options.getfieldvalue('stokes',''))
+-	filltype    =options.getfieldvalue('fill','none')
+-
+-	return hutterflag,macayealflag,pattynflag,stokesflag,filltype
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/sia.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/sia.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/sia.m	(revision 13008)
+@@ -1,26 +0,0 @@
+-function [velx,vely,vel]=sia(md)
+-%BALVEL - computation of Shallow Ice velocities
+-%
+-%   This routine uses the model of Hutter to compute the velocities
+-%   of a 2d model using the surface slope
+-%
+-%   Usage:
+-%      [velx,vely,vel]=sia(md)
+-
+-if md.mesh.dimension~=2,
+-	error('Only 2d meshes are allowed to compute velocity balances');
+-end
+-
+-%Get slope
+-[sx,sy,s]=slope(md);
+-
+-%Average thickness and B over all elements.
+-summer=[1;1;1];
+-hel=md.geometry.thickness(md.mesh.elements)*summer/3;
+-Bel=md.B(md.mesh.elements)*summer/3;
+-
+-Ael=Bel.^(-3);
+-
+-velx=-2*(md.materials.rho_ice*md.constants.g)^3*s.^2.*sx.*Ael/4.*hel.^4;
+-vely=-2*(md.materials.rho_ice*md.constants.g)^3*s.^2.*sy.*Ael/4.*hel.^4;
+-vel=sqrt(velx.^2+vely.^2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/tres.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/tres.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/tres.m	(revision 13008)
+@@ -1,119 +0,0 @@
+-function md=tres(md,string)
+-%TRES - transfer results results to corresponding model fields. 
+-%
+-%    Usage: md=tres(md,string)
+-%
+-%    Example: md=tres(md,'diagnostic');
+-
+-%check number of arguments
+-
+-if strcmpi(string,'diagnostic'),
+-	if md.mesh.dimension==2,
+-		md.initialization.vx=md.results.DiagnosticSolution.Vx;
+-		md.initialization.vy=md.results.DiagnosticSolution.Vy;
+-	else 
+-		md.initialization.vx=md.results.DiagnosticSolution.Vx;
+-		md.initialization.vy=md.results.DiagnosticSolution.Vy;
+-		md.initialization.vz=md.results.DiagnosticSolution.Vz;
+-	end
+-	md.initialization.vel=md.results.DiagnosticSolution.Vel;
+-
+-	if isfield(md.results.DiagnosticSolution,'Pressure'),
+-		md.initialization.pressure=md.results.DiagnosticSolution.Pressure;
+-	end
+-	if md.rifts.numrifts,
+-		if isfield(md.results.DiagnosticSolution,'riftproperties'),
+-			md.rifts.riftproperties=md.results.DiagnosticSolution.riftproperties;
+-		end
+-	end
+-	if md.inversion.iscontrol==1,
+-		for control_parameters=md.inversion.control_parameters
+-			%Will need to be updated... good luck ;)
+-			md.(EnumToModelField(control_parameters))=md.results.DiagnosticSolution.(EnumToString(control_parameters));
+-		end
+-	end
+-
+-elseif strcmpi(string,'dakota'),
+-	md.qmu.results=md.results.dakota;
+-
+-elseif strcmpi(string,'flaim'),
+-	md.flaim.solution=md.results.FlaimSolution.solution;
+-	md.flaim.quality =md.results.FlaimSolution.quality;
+-
+-elseif strcmpi(string,'transient'),
+-	results=md.results.TransientSolution;
+-	results2.Vel=NaN;
+-	count=1;
+-	for i=1:length(results),
+-		if ~isempty(md.results.TransientSolution(i).Vel),
+-			results2(count).Vel=md.results.TransientSolution(i).Vel;
+-			results2(count).Surface=md.results.TransientSolution(i).Surface;
+-			results2(count).Thickness=md.results.TransientSolution(i).Thickness;
+-			results2(count).Bed=md.results.TransientSolution(i).Bed;
+-			results2(count).Vx=md.results.TransientSolution(i).Vx;
+-			results2(count).Vy=md.results.TransientSolution(i).Vy;
+-			results2(count).time=md.results.TransientSolution(i).time;
+-			results2(count).step=md.results.TransientSolution(i).step;
+-			if ~strcmpi(md.groundingline.migration,'None'),
+-				results2(count).ElementOnIceShelf=md.results.TransientSolution(i).ElementOnIceShelf;
+-			end
+-			count=count+1;
+-		end
+-	end
+-	md.results.TransientSolution=results2;
+-	clear results,results2;
+-elseif strcmpi(string,'steadystate'),
+-	md.initialization.vx=md.results.SteadystateSolution.Vx;
+-	md.initialization.vy=md.results.SteadystateSolution.Vy;
+-	if isfield(md.results.SteadystateSolution,'Vz'),
+-		md.initialization.vz=md.results.SteadystateSolution.Vz;
+-	end
+-
+-	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;
+-
+-	if md.inversion.iscontrol==1,
+-		for control_parameters=md.inversion.control_parameters
+-			md.(EnumToModelField(control_parameters))=md.results.SteadystateSolution.(EnumToString(control_parameters));
+-		end
+-	end
+-
+-elseif strcmpi(string,'thermal'),
+-	md.initialization.temperature=md.results.ThermalSolution.Temperature;
+-	md.basalforcings.melting_rate=md.results.ThermalSolution.BasalMeltingRate;
+-elseif strcmpi(string,'hydrology'),
+-	md.initialization.watercolumn=md.results.HydrologySolution.Watercolumn;
+-
+-else 
+-	error(['tres error message: analysis ' string ' not supported yet!']);
+-end
+-end 
+-function string=EnumToModelField(enum) % {{{
+-	%ENUMTOMODELFIELD - output string of model field associated to enum
+-	%
+-	%   Usage:
+-	%      string=EnumToModelField(enum)
+-
+-	disp('Warning: EnumToModelField is deprecated, it cannot work with new model definition. This function will be removed in the future');
+-
+-	switch enum,
+-
+-		case ThicknessEnum(), string='thickness'; return
+-		case FrictionCoefficientEnum(), string='drag_coefficient'; return
+-		case MaterialsRheologyBEnum(), string='rheology_B'; return
+-		case MaterialsRheologyBbarEnum(), string='rheology_B'; return
+-		case BalancethicknessThickeningRateEnum: string='dhdt'; return
+-		case VxEnum(), string='vx'; return
+-		case InversionVxObsEnum(), string='vx_obs'; return
+-		case VyEnum(), string='vy'; return
+-		case InversionVyObsEnum(), string='vy_obs'; return
+-		case BasalforcingsMeltingRateEnum(), string='basal_melting_rate'; return
+-		case SurfaceforcingsAccumulationRateEnum(), string='surface_accumulation_rate'; return
+-		case SurfaceforcingsAblationRateEnum(), string='surface_ablation_rate'; return
+-		case SurfaceforcingsMassBalanceEnum(), string='surface_mass_balance'; return
+-		otherwise, error(['Enum ' num2str(enum)  ' not found associated to any model field']);
+-
+-		end
+-	end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modelsextractfromdomains.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modelsextractfromdomains.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/modelsextractfromdomains.m	(revision 13008)
+@@ -1,25 +0,0 @@
+-function md_list=modelsextractfromdomains(md,directory)
+-%modelsextractfromdomains- extract several self contained models according to a list of domains
+-%
+-%   Usage:
+-%      md_list=modelsextractfromdomains(md,'Basins/');
+-%
+-%   Examples:
+-%      md_list=modelsextract(md,'Basins/');
+-%
+-%   See also: MODELSEXTRACTS, MODELEXTRACT
+-
+-%go into directory and get list of files.
+-cd(directory);
+-basins=listfiles;
+-cd ..
+-
+-models=cell(0,1);
+-for i=1:length(basins),
+-	models{end+1,1}=modelextract(md,[directory '/' basins{i}]);
+-end
+-
+-%return model list: 
+-md_list=modellist(models);
+-
+-end 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regionaltransient2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regionaltransient2d.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regionaltransient2d.m	(revision 13008)
+@@ -1,158 +0,0 @@
+-function md2=regionaltransient2d(md1,area,hmin,hmax,err,stepres)
+-%regionaltransient2d - extract a model according to an Argus contour or flag list and remesh
+-%               at new resolution res
+-%
+-%   This routine extracts a submodel from a bigger model with respect to a given contour
+-%   md must be followed by the corresponding exp domain file (argus type, .exp extension). 
+-%   The model will be remeshed at high rsolution hmin and low resolution hmax.  The ice 
+-%   boundary velocities will be spc'd to the transient velocities at saved transient steps
+-%   at the resolution optionally provided for stepres.  A stepres of 2 means that you wish
+-%   to skip every other saved transient step.  This is useful when extracting a long transient.
+-%
+-%   Usage:
+-%      md2=regionaltransient2d(md1,area,hmin,hmax,err);
+-%
+-%   Examples:
+-%      md2=regionaltransient2d(md,'Domain.exp',500,10000,[15 250]);
+-%      md2=regionaltransient2d(md,'Domain.exp',3000,15000,[10 300],2);
+-%
+-%   See also: MODELEXTRACT, EXTRUDE, COLLAPSE
+-
+-%some checks
+-if ((nargin~=5) & (nargin~=6)),
+-	help regionaltransient2d 
+-	error('regionaltransient2d error message: bad usage');
+-end
+-
+-%get check option
+-if (nargin==5),
+-	stepres=1;
+-end
+-
+-%take every fields from model
+-mde=modelextract(md1,area);
+-mde.private.bamg=[];
+-mde.mesh.extractedvertices=nan;
+-mde.mesh.extractedelements=nan;
+-
+-%remesh
+-md2=bamg(mde,'hmin',hmin,'hmax',hmax,'field',[mde.inversion.vel_obs mde.geometry.surface],'splitcorner',1,'KeepVertices',0,'err',err);
+-md2=setmask(md2,'','');
+-
+-%automatically modify fields
+-
+-	%loop over model fields
+-	model_fields=fields(md1);
+-	for i=1:length(model_fields),
+-
+-		%get field
+-		field=md1.(model_fields{i});
+-		fieldsize=size(field);
+-
+-		%copy field, interpolated to new mesh
+-		if isobject(field), %recursive call
+-			object_fields=fields(md1.(model_fields{i}));
+-			fname=['(model_fields{i}).(object_fields{j})'];
+-		else
+-			object_fields=field;
+-			fname=['(model_fields{i})'];
+-		end
+-		for j=1:length(object_fields),
+-			%get field
+-			field=eval(['md2.' fname]);
+-			fieldsize=size(field);
+-
+-			%size = number of nodes * n
+-			for n=1:fieldsize(2)
+-				if fieldsize(1)==mde.mesh.numberofvertices
+-					if(sum(field(:,n) ~= field(1,n)) == 0)
+-						eval(['md2.' fname '(1:md2.mesh.numberofvertices,n)=field(1,n)*ones(md2.mesh.numberofvertices,1);']);
+-					else
+-						eval(['md2.' fname '(1:md2.mesh.numberofvertices,n)=InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(:,n),md2.mesh.x,md2.mesh.y);']);
+-					end
+-					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofvertices,n);']);
+-				elseif fieldsize(1)==mde.mesh.numberofvertices+1
+-					if(sum(field(1:end-1,n) ~= field(1,n)) == 0)
+-						eval(['md2.' fname '(1:md2.mesh.numberofvertices+1,n)=[field(1,n)*ones(md2.mesh.numberofvertices,1); field(end,n)];']);
+-					else
+-						eval(['md2.' fname '(1:md2.mesh.numberofvertices+1,n)=[InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(1:end-1,n),md2.mesh.x,md2.mesh.y); field(end,n)];']);
+-					end
+-					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofvertices+1,n)']);
+-					%size = number of elements * n
+-				elseif fieldsize(1)==mde.mesh.numberofelements
+-					if(sum(field(1:end-1,n) ~= field(1,n)) == 0)
+-						eval(['md2.' fname '(1:md2.mesh.numberofelements,n)=field(1,n)*ones(md2.mesh.numberofelements,1);']);
+-					else
+-						eval(['md2.' fname '(1:md2.mesh.numberofelements,n)=InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(:,n),md2.mesh.x,md2.mesh.y);']);
+-					end
+-					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofelements,n);']);
+-				end
+-			end
+-		end
+-	end
+-
+-	%Read transient velocities and thickness, looping through only the populated times
+-	spcx=[];
+-	spcy=[];
+-	spct=[];
+-	steps=[];
+-	nsteps=length(md1.results.TransientSolution);
+-	count=0;
+-	numElements=arrayfun(@(x) numel(x.step), md1.results.TransientSolution);
+-	for t=find(numElements==1)
+-		if ~isempty(md1.results.TransientSolution(t).Vel) & mod(count,stepres)==0,
+-			vx=PatchToVec(md1.results.TransientSolution(t).Vx);
+-			vy=PatchToVec(md1.results.TransientSolution(t).Vy);
+-			thickness=PatchToVec(md1.results.TransientSolution(t).Thickness);
+-			spcx=[spcx InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,vx,md2.mesh.x,md2.mesh.y)];
+-			spcy=[spcy InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,vy,md2.mesh.x,md2.mesh.y)];
+-			spct=[spct InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,thickness,md2.mesh.x,md2.mesh.y)];
+-			steps=[steps t*md1.timestepping.time_step];
+-		end
+-		count=count+1;
+-	end
+-
+-	%As long as there are recorded time steps, spc the boundaries with velocities
+-	if nsteps > 0
+-		md2.diagnostic.spcvx=md2.diagnostic.spcvx*ones(1,size(spcx,2));
+-		md2.diagnostic.spcvy=md2.diagnostic.spcvy*ones(1,size(spcy,2));
+-		md2.diagnostic.spcvz=md2.diagnostic.spcvz*ones(1,size(spcx,2));
+-		md2.prognostic.spcthickness=md2.prognostic.spcthickness*ones(1,size(spct,2));
+-		md2.diagnostic.spcvx(find(md2.mesh.vertexonboundary),:)=spcx(find(md2.mesh.vertexonboundary),:);
+-		md2.diagnostic.spcvy(find(md2.mesh.vertexonboundary),:)=spcy(find(md2.mesh.vertexonboundary),:);
+-		md2.diagnostic.spcvz(find(md2.mesh.vertexonboundary),:)=0;
+-		md2.prognostic.spcthickness(find(md2.mesh.vertexonboundary),:)=spct(find(md2.mesh.vertexonboundary),:);
+-		md2.diagnostic.spcvx=[md2.diagnostic.spcvx; steps];
+-		md2.diagnostic.spcvy=[md2.diagnostic.spcvy; steps];
+-		md2.diagnostic.spcvz=[md2.diagnostic.spcvz; steps];
+-		md2.prognostic.spcthickness=[md2.prognostic.spcthickness; steps];
+-	end
+-
+-	%Diagnostic.  Don't spc the icefront vertices.
+-	if ~isnan(md2.diagnostic.icefront)
+-		md1s=modelextract(md1,area);
+-		%md2.diagnostic.icefront=[md2.mesh.segments 2];
+-		e2=md2.mesh.segments(:,end);
+-		e1=md1s.mesh.segments(:,end);
+-
+-		pload = nan*ones(size(md1s.mesh.elements,1),1);
+-		pload(md1s.diagnostic.icefront(:,end-1))=md1s.diagnostic.icefront(:,end);
+-
+-		x2=mean(md2.mesh.x(md2.mesh.elements(e2,:)),2);
+-      y2=mean(md2.mesh.y(md2.mesh.elements(e2,:)),2);
+-		x1=mean(md1s.mesh.x(md1s.mesh.elements),2);
+-      y1=mean(md1s.mesh.y(md1s.mesh.elements),2);
+-
+-		pload2=griddata(x1,y1,pload,x2,y2,'nearest');
+-		md2.diagnostic.icefront=[md2.mesh.segments(~isnan(pload2),:) pload2(~isnan(pload2))];
+-		md2.diagnostic.spcvx(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
+-		md2.diagnostic.spcvy(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
+-		md2.diagnostic.spcvz(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
+-		md2.prognostic.spcthickness(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
+-	end
+-
+-	%Clear results fields
+-	if isstruct(md1.results),
+-		md2.results=[];
+-	end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ProfileValues.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ProfileValues.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ProfileValues.m	(revision 13008)
+@@ -1,21 +0,0 @@
+-function [Z,data_interp]=ProfileValues(md,data,xprof,yprof,resolution)
+-%PROFILEVALUES - compute the value of a field on a vertical profile
+-%
+-%   This routine gets the value of a given field of the model on points
+-%   given by filname (Argus type file)
+-%
+-%   Usage:
+-%      [z,data]=ProfileValues(md,data,filename,resolution)
+-%      [z,data]=ProfileValues(md,data,profile_structure,resolution)
+-
+-%Get bed and surface for each 2d point, offset to make sure that it is inside the glacier system
+-offset=10^-3;
+-bed=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.bed,1),xprof,yprof)+offset;
+-surface=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.surface,1),xprof,yprof)-offset;
+-
+-%Some useful parameters
+-layers=ceil(mean(md.geometry.thickness)/resolution);
+-Z=(bed:resolution:surface)';
+-X=xprof*ones(size(Z));
+-Y=yprof*ones(size(Z));
+-data_interp=InterpFromMeshToMesh3d(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z,data,X,Y,Z,NaN);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/slope.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/slope.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/slope.m	(revision 13008)
+@@ -1,32 +0,0 @@
+-function [sx,sy,s]=slope(md)
+-%SLOPE - compute the surface slope
+-%
+-%   Usage:
+-%      [sx,sy,s]=slope(md)
+-
+-%load some variables (it is much faster if the variab;es are loaded from md once for all) 
+-if (md.mesh.dimension==2),
+-	numberofelements=md.mesh.numberofelements;
+-	numberofnodes=md.mesh.numberofvertices;
+-	index=md.mesh.elements;
+-	x=md.mesh.x; y=md.mesh.y;
+-else
+-	numberofelements=md.mesh.numberofelements2d;
+-	numberofnodes=md.mesh.numberofvertices2d;
+-	index=md.mesh.elements2d;
+-	x=md.mesh.x2d; y=md.mesh.y2d;
+-end
+-
+-%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
+-[alpha beta]=GetNodalFunctionsCoeff(index,x,y);
+-
+-summation=[1;1;1];
+-sx=(md.geometry.surface(index).*alpha)*summation;
+-sy=(md.geometry.surface(index).*beta)*summation;
+-s=sqrt(sx.^2+sy.^2);
+-
+-if md.mesh.dimension==3,
+-	sx=project3d(md,'vector',sx,'type','element');
+-	sy=project3d(md,'vector',sy,'type','element');
+-	s=sqrt(sx.^2+sy.^2);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ThicknessCorrection.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ThicknessCorrection.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ThicknessCorrection.m	(revision 13008)
+@@ -1,77 +0,0 @@
+-function md=ThicknessCorrection(md,varargin)
+-%THICKNESSCORRECTION - correct the thickness of the ice shelf near the grounding line
+-%
+-%   This routine corrects the thickness and the bed on the transition zone
+-%   by forcing the hydrostatic equilibrium.
+-%   the thickness is modified as follows:
+-%      thickness = (1-coeff) * thickness_observation + coeff * thickness_hydrostatic
+-%   where:
+-%      coeff=(d/distance)^2;
+-%      distance=10km by default but can be specified
+-%
+-%   Usage:
+-%      md=ThicknessCorrection(md,varargin);
+-%
+-%   Example:
+-%      md=ThicknessCorrection(md);
+-%      md=ThicknessCorrection(md,15000);
+-
+-%initialize thickness with the observations, and get hydrostatic thickness from the dem
+-thickness=md.geometry.thickness;
+-thickness_hydro=md.geometry.surface/(1-md.materials.rho_ice/md.materials.rho_water);
+-hydrostatic_ratio=zeros(size(md.geometry.thickness));
+-
+-%get nodes on ice sheet and on ice shelf
+-pos_shelf=find(~md.mask.vertexongroundedice);
+-pos_GL=intersect(unique(md.mesh.elements(find(md.mask.elementongroundedice),:)),unique(md.mesh.elements(find(md.mask.elementonfloatingice),:)));
+-debug=(length(pos_shelf)>50000);
+-
+-%check that there is a GL
+-if isempty(pos_GL)
+-	error('ThicknessCorrection error message: no grounding line has been detected. Check the model mask');
+-end
+-
+-%get distance
+-if nargin==2,
+-	distance=varargin{1};
+-else
+-	distance=10000;
+-end
+-
+-%modify thickness
+-if (debug), fprintf('%s','      correction progress:   0.00 %'); end
+-for i=1:length(pos_shelf)
+-
+-	if (debug & mod(i,100)==0),
+-		fprintf('\b\b\b\b\b\b\b%5.2f%s',i/length(pos_shelf)*100,' %');
+-	end
+-
+-	%search the node on ice sheet the closest to i
+-	[d posd]=min(sqrt((md.mesh.x(pos_shelf(i))-md.mesh.x(pos_GL)).^2+(md.mesh.y(pos_shelf(i))-md.mesh.y(pos_GL)).^2));
+-
+-	if d>distance,
+-
+-		%if d > 15km, hydrostatic equilibrium
+-		hydrostatic_ratio(pos_shelf(i))=1;
+-		thickness(pos_shelf(i))=thickness_hydro(pos_shelf(i));
+-
+-	else
+-
+-		%else: quadratic combination of hydrostatic equilibrium and observations
+-		hydrostatic_ratio(pos_shelf(i))=(d/distance)^2;
+-		thickness(pos_shelf(i))=(1-hydrostatic_ratio(pos_shelf(i)))*thickness(pos_shelf(i))+hydrostatic_ratio(pos_shelf(i))*thickness_hydro(pos_shelf(i));
+-
+-	end
+-end
+-if (debug), fprintf('\b\b\b\b\b\b\b%5.2f%s\n',100,' %'); end
+-
+-%check the computed thickness
+-minth=1/(1-md.materials.rho_ice/md.materials.rho_water);
+-pos=find(isnan(thickness) | (thickness<=0));
+-thickness(pos)=minth;
+-hydrostatic_ratio(pos)=-1;
+-
+-%change bed to take into account the changes in thickness
+-md.geometry.thickness=thickness;
+-md.geometry.hydrostatic_ratio=hydrostatic_ratio;
+-md.geometry.bed=md.geometry.surface-md.geometry.thickness;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/misfit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/misfit.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/misfit.m	(revision 13008)
+@@ -0,0 +1,37 @@
++function J=misfit(md)
++%MISFIT - compute misfit
++%
++%   Usage:
++%      J=misfit(md)
++%
++%   Example:
++%      J=misfit(md)
++%
++
++if md.mesh.dimension==2,
++	elements=md.mesh.elements;
++	x=md.mesh.x;
++	y=md.mesh.y;
++	vx=md.initialization.vx;
++	vy=md.initialization.vy;
++	vx_obs=md.inversion.vx_obs;
++	vy_obs=md.inversion.vy_obs;
++else
++	elements=md.mesh.elements2d;
++	x=md.mesh.x2d;
++	y=md.mesh.y2d;
++	vx=project2d(md,md.initialization.vx,md.mesh.numberoflayers);
++	vy=project2d(md,md.initialization.vy,md.mesh.numberoflayers);
++	vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers);
++	vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers);
++end
++
++%compute areas;
++areas=GetAreas(elements,x,y);
++
++%compute delta v on elements
++deltav=1/2*(   (vx-vx_obs).^2+(vy-vy_obs).^2)/md.constants.yts^2;
++deltav_elem=deltav(elements)*[1;1;1]/3;
++
++%compute misfit
++J=sum(deltav_elem.*areas);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/regionaltransient2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/regionaltransient2d.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/regionaltransient2d.m	(revision 13008)
+@@ -0,0 +1,158 @@
++function md2=regionaltransient2d(md1,area,hmin,hmax,err,stepres)
++%regionaltransient2d - extract a model according to an Argus contour or flag list and remesh
++%               at new resolution res
++%
++%   This routine extracts a submodel from a bigger model with respect to a given contour
++%   md must be followed by the corresponding exp domain file (argus type, .exp extension). 
++%   The model will be remeshed at high rsolution hmin and low resolution hmax.  The ice 
++%   boundary velocities will be spc'd to the transient velocities at saved transient steps
++%   at the resolution optionally provided for stepres.  A stepres of 2 means that you wish
++%   to skip every other saved transient step.  This is useful when extracting a long transient.
++%
++%   Usage:
++%      md2=regionaltransient2d(md1,area,hmin,hmax,err);
++%
++%   Examples:
++%      md2=regionaltransient2d(md,'Domain.exp',500,10000,[15 250]);
++%      md2=regionaltransient2d(md,'Domain.exp',3000,15000,[10 300],2);
++%
++%   See also: MODELEXTRACT, EXTRUDE, COLLAPSE
++
++%some checks
++if ((nargin~=5) & (nargin~=6)),
++	help regionaltransient2d 
++	error('regionaltransient2d error message: bad usage');
++end
++
++%get check option
++if (nargin==5),
++	stepres=1;
++end
++
++%take every fields from model
++mde=modelextract(md1,area);
++mde.private.bamg=[];
++mde.mesh.extractedvertices=nan;
++mde.mesh.extractedelements=nan;
++
++%remesh
++md2=bamg(mde,'hmin',hmin,'hmax',hmax,'field',[mde.inversion.vel_obs mde.geometry.surface],'splitcorner',1,'KeepVertices',0,'err',err);
++md2=setmask(md2,'','');
++
++%automatically modify fields
++
++	%loop over model fields
++	model_fields=fields(md1);
++	for i=1:length(model_fields),
++
++		%get field
++		field=md1.(model_fields{i});
++		fieldsize=size(field);
++
++		%copy field, interpolated to new mesh
++		if isobject(field), %recursive call
++			object_fields=fields(md1.(model_fields{i}));
++			fname=['(model_fields{i}).(object_fields{j})'];
++		else
++			object_fields=field;
++			fname=['(model_fields{i})'];
++		end
++		for j=1:length(object_fields),
++			%get field
++			field=eval(['md2.' fname]);
++			fieldsize=size(field);
++
++			%size = number of nodes * n
++			for n=1:fieldsize(2)
++				if fieldsize(1)==mde.mesh.numberofvertices
++					if(sum(field(:,n) ~= field(1,n)) == 0)
++						eval(['md2.' fname '(1:md2.mesh.numberofvertices,n)=field(1,n)*ones(md2.mesh.numberofvertices,1);']);
++					else
++						eval(['md2.' fname '(1:md2.mesh.numberofvertices,n)=InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(:,n),md2.mesh.x,md2.mesh.y);']);
++					end
++					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofvertices,n);']);
++				elseif fieldsize(1)==mde.mesh.numberofvertices+1
++					if(sum(field(1:end-1,n) ~= field(1,n)) == 0)
++						eval(['md2.' fname '(1:md2.mesh.numberofvertices+1,n)=[field(1,n)*ones(md2.mesh.numberofvertices,1); field(end,n)];']);
++					else
++						eval(['md2.' fname '(1:md2.mesh.numberofvertices+1,n)=[InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(1:end-1,n),md2.mesh.x,md2.mesh.y); field(end,n)];']);
++					end
++					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofvertices+1,n)']);
++					%size = number of elements * n
++				elseif fieldsize(1)==mde.mesh.numberofelements
++					if(sum(field(1:end-1,n) ~= field(1,n)) == 0)
++						eval(['md2.' fname '(1:md2.mesh.numberofelements,n)=field(1,n)*ones(md2.mesh.numberofelements,1);']);
++					else
++						eval(['md2.' fname '(1:md2.mesh.numberofelements,n)=InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(:,n),md2.mesh.x,md2.mesh.y);']);
++					end
++					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofelements,n);']);
++				end
++			end
++		end
++	end
++
++	%Read transient velocities and thickness, looping through only the populated times
++	spcx=[];
++	spcy=[];
++	spct=[];
++	steps=[];
++	nsteps=length(md1.results.TransientSolution);
++	count=0;
++	numElements=arrayfun(@(x) numel(x.step), md1.results.TransientSolution);
++	for t=find(numElements==1)
++		if ~isempty(md1.results.TransientSolution(t).Vel) & mod(count,stepres)==0,
++			vx=PatchToVec(md1.results.TransientSolution(t).Vx);
++			vy=PatchToVec(md1.results.TransientSolution(t).Vy);
++			thickness=PatchToVec(md1.results.TransientSolution(t).Thickness);
++			spcx=[spcx InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,vx,md2.mesh.x,md2.mesh.y)];
++			spcy=[spcy InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,vy,md2.mesh.x,md2.mesh.y)];
++			spct=[spct InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,thickness,md2.mesh.x,md2.mesh.y)];
++			steps=[steps t*md1.timestepping.time_step];
++		end
++		count=count+1;
++	end
++
++	%As long as there are recorded time steps, spc the boundaries with velocities
++	if nsteps > 0
++		md2.diagnostic.spcvx=md2.diagnostic.spcvx*ones(1,size(spcx,2));
++		md2.diagnostic.spcvy=md2.diagnostic.spcvy*ones(1,size(spcy,2));
++		md2.diagnostic.spcvz=md2.diagnostic.spcvz*ones(1,size(spcx,2));
++		md2.prognostic.spcthickness=md2.prognostic.spcthickness*ones(1,size(spct,2));
++		md2.diagnostic.spcvx(find(md2.mesh.vertexonboundary),:)=spcx(find(md2.mesh.vertexonboundary),:);
++		md2.diagnostic.spcvy(find(md2.mesh.vertexonboundary),:)=spcy(find(md2.mesh.vertexonboundary),:);
++		md2.diagnostic.spcvz(find(md2.mesh.vertexonboundary),:)=0;
++		md2.prognostic.spcthickness(find(md2.mesh.vertexonboundary),:)=spct(find(md2.mesh.vertexonboundary),:);
++		md2.diagnostic.spcvx=[md2.diagnostic.spcvx; steps];
++		md2.diagnostic.spcvy=[md2.diagnostic.spcvy; steps];
++		md2.diagnostic.spcvz=[md2.diagnostic.spcvz; steps];
++		md2.prognostic.spcthickness=[md2.prognostic.spcthickness; steps];
++	end
++
++	%Diagnostic.  Don't spc the icefront vertices.
++	if ~isnan(md2.diagnostic.icefront)
++		md1s=modelextract(md1,area);
++		%md2.diagnostic.icefront=[md2.mesh.segments 2];
++		e2=md2.mesh.segments(:,end);
++		e1=md1s.mesh.segments(:,end);
++
++		pload = nan*ones(size(md1s.mesh.elements,1),1);
++		pload(md1s.diagnostic.icefront(:,end-1))=md1s.diagnostic.icefront(:,end);
++
++		x2=mean(md2.mesh.x(md2.mesh.elements(e2,:)),2);
++      y2=mean(md2.mesh.y(md2.mesh.elements(e2,:)),2);
++		x1=mean(md1s.mesh.x(md1s.mesh.elements),2);
++      y1=mean(md1s.mesh.y(md1s.mesh.elements),2);
++
++		pload2=griddata(x1,y1,pload,x2,y2,'nearest');
++		md2.diagnostic.icefront=[md2.mesh.segments(~isnan(pload2),:) pload2(~isnan(pload2))];
++		md2.diagnostic.spcvx(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
++		md2.diagnostic.spcvy(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
++		md2.diagnostic.spcvz(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
++		md2.prognostic.spcthickness(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
++	end
++
++	%Clear results fields
++	if isstruct(md1.results),
++		md2.results=[];
++	end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/bamg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/bamg.m	(revision 13007)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/bamg.m	(revision 13008)
+@@ -338,3 +338,146 @@
+ if any(~ismember(1:md.mesh.numberofvertices,sort(unique(reshape(md.mesh.elements,3*md.mesh.numberofelements,1)))))
+ 	error('Output mesh has orphans. Decrease MaxCornerAngle to prevent outside points (ex: 0.01)');
+ end
++end 
++
++function geom=processgeometry(geom,tol,outline); % {{{
++
++%Deal with edges
++disp('Checking Edge crossing...');
++i=0;
++while (i<size(geom.Edges,1)),
++
++	%edge counter
++	i=i+1;
++
++	%Get coordinates
++	x1=geom.Vertices(geom.Edges(i,1),1);
++	y1=geom.Vertices(geom.Edges(i,1),2);
++	x2=geom.Vertices(geom.Edges(i,2),1);
++	y2=geom.Vertices(geom.Edges(i,2),2);
++	color1=geom.Edges(i,3);
++
++	j=i; %test edges located AFTER i only
++	while (j<size(geom.Edges,1)),
++
++		%edge counter
++		j=j+1;
++
++		%Skip if the two edges already have a vertex in common
++		if any(ismember(geom.Edges(i,1:2),geom.Edges(j,1:2))),
++			continue
++		end
++
++		%Get coordinates
++		x3=geom.Vertices(geom.Edges(j,1),1);
++		y3=geom.Vertices(geom.Edges(j,1),2);
++		x4=geom.Vertices(geom.Edges(j,2),1);
++		y4=geom.Vertices(geom.Edges(j,2),2);
++		color2=geom.Edges(j,3);
++
++		%Check if the two edges are crossing one another
++		if SegIntersect([x1 y1; x2 y2],[x3 y3; x4 y4]),
++
++			%Get coordinate of intersection point (http://mathworld.wolfram.com/Line-LineIntersection.html)
++			x=det([det([x1 y1; x2 y2])  x1-x2;det([x3 y3; x4 y4])  x3-x4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
++			y=det([det([x1 y1; x2 y2])  y1-y2;det([x3 y3; x4 y4])  y3-y4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
++
++			%Add vertex to the list of vertices
++			geom.Vertices(end+1,:)=[x y min(color1,color2)];
++			id=size(geom.Vertices,1);
++
++			%Update edges i and j
++			edgei=geom.Edges(i,:);
++			edgej=geom.Edges(j,:);
++			geom.Edges(i,:)    =[edgei(1) id       edgei(3)];
++			geom.Edges(end+1,:)=[id       edgei(2) edgei(3)];
++			geom.Edges(j,:)    =[edgej(1) id       edgej(3)];
++			geom.Edges(end+1,:)=[id       edgej(2) edgej(3)];
++
++			%update current edge second tip
++			x2=x; y2=y;
++		end
++	end
++
++end
++
++%Check point outside
++disp('Checking for points outside the domain...');
++i=0;
++num=0;
++while (i<size(geom.Vertices,1)),
++
++	%vertex counter
++	i=i+1;
++
++	%Get coordinates
++	x=geom.Vertices(i,1);
++	y=geom.Vertices(i,2);
++	color=geom.Vertices(i,3);
++
++	%Check that the point is inside the domain
++	if (color~=1 & ~ContourToNodes(x,y,outline(1),1)),
++
++		%Remove points from list of Vertices
++		num=num+1;
++		geom.Vertices(i,:)=[];
++
++		%update edges
++		[posedges dummy]=find(geom.Edges==i);
++		geom.Edges(posedges,:)=[];
++		posedges=find(geom.Edges>i);
++		geom.Edges(posedges)=geom.Edges(posedges)-1;
++
++		%update counter
++		i=i-1;
++	end
++end
++if num,
++	disp(['WARNING: ' num2str(num) ' points outside the domain outline have been removed']);
++end
++
++%Check point spacing
++if ~isnan(tol),
++	disp('Checking point spacing...');
++	i=0;
++	while (i<size(geom.Vertices,1)),
++
++		%vertex counter
++		i=i+1;
++
++		%Get coordinates
++		x1=geom.Vertices(i,1);
++		y1=geom.Vertices(i,2);
++
++		j=i; %test edges located AFTER i only
++		while (j<size(geom.Vertices,1)),
++
++			%vertex counter
++			j=j+1;
++
++			%Get coordinates
++			x2=geom.Vertices(j,1);
++			y2=geom.Vertices(j,2);
++
++			%Check whether the two vertices are too close
++			if ((x2-x1)^2+(y2-y1)^2<tol^2)
++
++				%Remove points from list of Vertices
++				geom.Vertices(j,:)=[];
++
++				%update edges
++				posedges=find(ismember(geom.Edges,j));
++				geom.Edges(posedges)=i;
++				posedges=find(geom.Edges>j);
++				geom.Edges(posedges)=geom.Edges(posedges)-1;
++
++				%update counter
++				j=j-1;
++
++			end
++		end
++	end
++end
++%remove empty edges
++geom.Edges(find(geom.Edges(:,1)==geom.Edges(:,2)),:)=[];
++end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/radarpower.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/radarpower.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/radarpower.m	(revision 13008)
+@@ -0,0 +1,118 @@
++function md=radarpower(md,varargin)
++%RADARPOWER - overlay a power radar image on an existing mesh
++%
++%   This routine will overlay a power radar image on an existing mesh.
++%   The power amplitude will be output to vel for now.
++%   In the future, think about a field to hold this value.
++%
++%   Usage:
++%      md=radarpower(md,options);
++%      md=radarpower(md)
++
++%If gdal does not work, uncomment the following line
++%setenv('LD_LIBRARY_PATH','/proj/ice/larour/issm/trunk/externalpackages/gdal/install/lib/');
++%Parse inputs
++if nargin==1,
++	options=pairoptions;
++else
++	options=varargin{:};
++	if ~isa(options,'pairoptions'),
++		options=pairoptions(varargin{:});
++	end
++end
++
++highres=getfieldvalue(options,'highres',0);
++xlim=getfieldvalue(options,'xlim',[min(md.mesh.x) max(md.mesh.x)]);
++ylim=getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]);
++posting=getfieldvalue(options,'posting',0); % 0 -> image posting default
++
++%find gdal coordinates
++x0=min(xlim); x1=max(xlim);
++y0=min(ylim); y1=max(ylim);
++
++%figure out if we should go look for Greenland or Antarctica geotiff, or if user provided one.
++if ~exist(options,'overlay_image'),
++	if strcmpi(md.mesh.hemisphere,'n'),
++		if ~exist([jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg']),
++			error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg not found.']);
++		end
++		name = 'mog150_greenland_map';
++		%name = 'mog100_hp1_v10';
++		%name = 'mog500_hp1_v10';
++		jpgim=[jplsvn() '/projects/ModelData/MOG/' name '.jpg'];
++		geom=load([jplsvn() '/projects/ModelData/MOG/' name '.jpgw'],'ascii');
++
++		%geom:   xposting nbcols nbrows yposting xmin ymax
++		xmin=max(geom(5),x0);
++		xmax=min(geom(5)+geom(1)*geom(2),x1);
++		ymin=max(geom(6)-geom(3)*geom(4),y0);
++		ymax=min(geom(6),y1);
++
++		firstcol=max(1,floor((xmin-geom(5))/geom(1))); %x min
++		firstrow=max(1,floor((geom(6)-ymax)/geom(4))); %y max
++		numcols=floor((xmax-xmin)/geom(1)); % x posting
++		numrows=floor((ymax-ymin)/geom(4)); % y posting
++		pixelskip=max(1,ceil(posting/geom(1)));
++
++		%Read and crop file
++		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++		im=imread(jpgim);
++		im=im(firstrow:firstrow+numrows-1,firstcol:firstcol+numcols-1);
++		md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
++		md.radaroverlay.x=(xmin:(xmax-xmin)/(size(md.radaroverlay.pwr,2)-1):xmax);
++		md.radaroverlay.y=(ymin:(ymax-ymin)/(size(md.radaroverlay.pwr,1)-1):ymax);
++
++	elseif strcmpi(md.mesh.hemisphere,'s'),
++		if highres,
++			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif']),
++				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif not found.']);
++			end
++			geotiff_name=[jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif'];
++		else
++			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif']),
++				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif not found.']);
++			end
++			geotiff_name=[jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif'];
++		end
++
++		%Name of image
++		inputname='./temp.tif';
++		eval(['!gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ]);
++
++		%Read in temp.tif:
++		im=imread('temp.tif','TIFF');
++		pixelskip=max(1,ceil(posting/((x1-x0)/(size(im,2)))));
++		md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
++		md.radaroverlay.x=(x0:(x1-x0)/(size(md.radaroverlay.pwr,2)-1):x1);
++		md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
++
++		%Erase image
++		system('rm -rf ./temp.tif');
++
++	else
++		error('field hemisphere should either be ''n'' or ''s''');
++	end
++else
++	%ok, user provided an image. check we also have overlay_xlim and overlay_ylim  options, to know what range of coordinates the image covers.
++	if (~exist(options,'overlay_xlim') | ~exist(options,'overlay_xlim')| ~exist(options,'overlay_xposting')| ~exist(options,'overlay_yposting')),
++		error('radarpower error message: please provide overlay_xlim, overlay_ylim, overlay_xposting and overlay_yposting options together with overlay_image option');
++	end
++	overlay_image=getfieldvalue(options,'overlay_image');
++	overlay_xlim=getfieldvalue(options,'overlay_xlim');
++	overlay_ylim=getfieldvalue(options,'overlay_ylim');
++	overlay_xposting=getfieldvalue(options,'overlay_xposting');
++	overlay_yposting=getfieldvalue(options,'overlay_yposting');
++
++	sizex=floor((x1-x0)/overlay_xposting);
++	sizey=floor((y1-y0)/overlay_yposting);
++	topleftx=floor((x0-overlay_xlim(1))/overlay_xposting); % x min
++	toplefty=floor((overlay_ylim(2)-y1)/overlay_yposting); % y max
++
++	%Read and crop file
++	disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++	im=imread(overlay_image);
++	im=im(toplefty:toplefty+sizey,topleftx:topleftx+sizex);
++	md.radaroverlay.pwr=double(flipud(im));
++	md.radaroverlay.x=(x0:(x1-x0)/(size(md.radaroverlay.pwr,2)-1):x1);
++	md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/tres.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/tres.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/tres.m	(revision 13008)
+@@ -0,0 +1,119 @@
++function md=tres(md,string)
++%TRES - transfer results results to corresponding model fields. 
++%
++%    Usage: md=tres(md,string)
++%
++%    Example: md=tres(md,'diagnostic');
++
++%check number of arguments
++
++if strcmpi(string,'diagnostic'),
++	if md.mesh.dimension==2,
++		md.initialization.vx=md.results.DiagnosticSolution.Vx;
++		md.initialization.vy=md.results.DiagnosticSolution.Vy;
++	else 
++		md.initialization.vx=md.results.DiagnosticSolution.Vx;
++		md.initialization.vy=md.results.DiagnosticSolution.Vy;
++		md.initialization.vz=md.results.DiagnosticSolution.Vz;
++	end
++	md.initialization.vel=md.results.DiagnosticSolution.Vel;
++
++	if isfield(md.results.DiagnosticSolution,'Pressure'),
++		md.initialization.pressure=md.results.DiagnosticSolution.Pressure;
++	end
++	if md.rifts.numrifts,
++		if isfield(md.results.DiagnosticSolution,'riftproperties'),
++			md.rifts.riftproperties=md.results.DiagnosticSolution.riftproperties;
++		end
++	end
++	if md.inversion.iscontrol==1,
++		for control_parameters=md.inversion.control_parameters
++			%Will need to be updated... good luck ;)
++			md.(EnumToModelField(control_parameters))=md.results.DiagnosticSolution.(EnumToString(control_parameters));
++		end
++	end
++
++elseif strcmpi(string,'dakota'),
++	md.qmu.results=md.results.dakota;
++
++elseif strcmpi(string,'flaim'),
++	md.flaim.solution=md.results.FlaimSolution.solution;
++	md.flaim.quality =md.results.FlaimSolution.quality;
++
++elseif strcmpi(string,'transient'),
++	results=md.results.TransientSolution;
++	results2.Vel=NaN;
++	count=1;
++	for i=1:length(results),
++		if ~isempty(md.results.TransientSolution(i).Vel),
++			results2(count).Vel=md.results.TransientSolution(i).Vel;
++			results2(count).Surface=md.results.TransientSolution(i).Surface;
++			results2(count).Thickness=md.results.TransientSolution(i).Thickness;
++			results2(count).Bed=md.results.TransientSolution(i).Bed;
++			results2(count).Vx=md.results.TransientSolution(i).Vx;
++			results2(count).Vy=md.results.TransientSolution(i).Vy;
++			results2(count).time=md.results.TransientSolution(i).time;
++			results2(count).step=md.results.TransientSolution(i).step;
++			if ~strcmpi(md.groundingline.migration,'None'),
++				results2(count).ElementOnIceShelf=md.results.TransientSolution(i).ElementOnIceShelf;
++			end
++			count=count+1;
++		end
++	end
++	md.results.TransientSolution=results2;
++	clear results,results2;
++elseif strcmpi(string,'steadystate'),
++	md.initialization.vx=md.results.SteadystateSolution.Vx;
++	md.initialization.vy=md.results.SteadystateSolution.Vy;
++	if isfield(md.results.SteadystateSolution,'Vz'),
++		md.initialization.vz=md.results.SteadystateSolution.Vz;
++	end
++
++	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;
++
++	if md.inversion.iscontrol==1,
++		for control_parameters=md.inversion.control_parameters
++			md.(EnumToModelField(control_parameters))=md.results.SteadystateSolution.(EnumToString(control_parameters));
++		end
++	end
++
++elseif strcmpi(string,'thermal'),
++	md.initialization.temperature=md.results.ThermalSolution.Temperature;
++	md.basalforcings.melting_rate=md.results.ThermalSolution.BasalMeltingRate;
++elseif strcmpi(string,'hydrology'),
++	md.initialization.watercolumn=md.results.HydrologySolution.Watercolumn;
++
++else 
++	error(['tres error message: analysis ' string ' not supported yet!']);
++end
++end 
++function string=EnumToModelField(enum) % {{{
++	%ENUMTOMODELFIELD - output string of model field associated to enum
++	%
++	%   Usage:
++	%      string=EnumToModelField(enum)
++
++	disp('Warning: EnumToModelField is deprecated, it cannot work with new model definition. This function will be removed in the future');
++
++	switch enum,
++
++		case ThicknessEnum(), string='thickness'; return
++		case FrictionCoefficientEnum(), string='drag_coefficient'; return
++		case MaterialsRheologyBEnum(), string='rheology_B'; return
++		case MaterialsRheologyBbarEnum(), string='rheology_B'; return
++		case BalancethicknessThickeningRateEnum: string='dhdt'; return
++		case VxEnum(), string='vx'; return
++		case InversionVxObsEnum(), string='vx_obs'; return
++		case VyEnum(), string='vy'; return
++		case InversionVyObsEnum(), string='vy_obs'; return
++		case BasalforcingsMeltingRateEnum(), string='basal_melting_rate'; return
++		case SurfaceforcingsAccumulationRateEnum(), string='surface_accumulation_rate'; return
++		case SurfaceforcingsAblationRateEnum(), string='surface_ablation_rate'; return
++		case SurfaceforcingsMassBalanceEnum(), string='surface_mass_balance'; return
++		otherwise, error(['Enum ' num2str(enum)  ' not found associated to any model field']);
++
++		end
++	end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/thicknessevolution.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/thicknessevolution.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/thicknessevolution.m	(revision 13008)
+@@ -0,0 +1,28 @@
++function dhdt=thicknessevolution(md)
++%THICKNESSEVOLUTION - compute the new thickness of a model after ∆t
++%
++%   This routine compute the new thickness of a model after a time step
++%   according to the following formula:
++%   dh/dt=-div(Hu)
++%
++%   Usage:
++%      dhdt=thicknessevolution(md)
++
++if (length(md.initialization.vx)~=md.mesh.numberofvertices)|(length(md.initialization.vy)~=md.mesh.numberofvertices)
++	error(['thicknessevolution error message: vx and vy should have a length of ' num2str(md.mesh.numberofvertices)])
++end
++
++%load some variables 
++H=md.geometry.thickness;
++vx=md.initialization.vx;
++vy=md.initialization.vy;
++index=md.mesh.elements;
++
++%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
++[alpha beta]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y); 
++
++%compute dhdt=div(Hu)
++summation=1/3*ones(3,1);
++dhdt=(vx(index)*summation).*sum( H(index).*alpha,2) + (vy(index)*summation).*sum(H(index).*beta,2) ...
++	+ ( H(index)*summation).*sum(vx(index).*alpha,2) + ( H(index)*summation).*sum(vy(index).*beta,2);
++dhdt=-dhdt;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/PropagateFlagsUntilDistance.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/PropagateFlagsUntilDistance.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/PropagateFlagsUntilDistance.m	(revision 13008)
+@@ -0,0 +1,60 @@
++function new_flags=PropagateFlagsUntilDistance(md,flags,distance)
++%PROPAGATEFLAGSUNTILDISTANCE
++%
++% Usage: 
++%              flags=PropagateFlagsUntilDistance(md,flags,distance)
++%
++%
++
++new_flags=flags;
++
++%make 3d work in 2d: 
++if md.mesh.dimension==3,
++	md.mesh.x=md.mesh.x2d;
++	md.mesh.y=md.mesh.y2d;
++	md.mesh.elements=md.mesh.elements2d;
++end
++
++%find elements that are at the border of flags: 
++flag_elements=find(flags);
++conn=md.mesh.elementconnectivity(flag_elements,:);
++pos=find(conn);conn(pos)=~flags(conn(pos));
++sum_conn=sum(conn,2);
++border_elements=flag_elements(find(sum_conn>=1));
++
++%average x and y over elements: 
++x_elem=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
++y_elem=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
++
++while 1,
++
++	%keep copy of new_flags for this loop: 
++	new_flags_bak=new_flags;
++
++	%extend new flags by connectivity
++	pos=find(new_flags);
++
++	connected_elements=md.mesh.elementconnectivity(pos,:);
++	connected_elements=connected_elements(find(connected_elements));
++	new_flags(connected_elements)=1;
++
++	%get new elements: 
++	new_elements=find(new_flags & ~new_flags_bak);
++	if ~length(new_elements),
++		%we are done!
++		break;
++	end
++
++	%check which of these new elements are more than distance away from the border elements
++	for i=1:length(new_elements),
++		dist=sqrt(     (x_elem(border_elements)-x_elem(new_elements(i))).^2 + (y_elem(border_elements)-y_elem(new_elements(i))).^2)-distance;
++		if ~any(dist<0)
++			%none of the border elements are within distance, this element is outside out area of interest.
++			%ensure this element never gets found again in the connectivity.
++			pos=find(md.mesh.elementconnectivity==new_elements(i));
++			md.mesh.elementconnectivity(pos)=0;
++			%exclude this new element from the new_flags!
++			new_flags(new_elements(i))=0;
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/MeltingGroundingLines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/MeltingGroundingLines.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/MeltingGroundingLines.m	(revision 13008)
+@@ -0,0 +1,26 @@
++function md=MeltingGroundingLines(md,distance,value)
++%MELTINGGROUNDINGLINES - set melting near grounding lines to a constant value
++%
++%   Usage:
++%      md=MeltingGroundingLines(md,distance,value)
++%
++
++%get nodes on ice sheet and on ice shelf
++pos_shelf=find(~md.mask.vertexongroundedice);
++pos_GL=intersect(unique(md.mesh.elements(find(md.mask.elementongroundedice),:)),unique(md.mesh.elements(find(md.mask.elementonfloatingice),:)));
++
++for i=1:length(pos_shelf)
++
++	if (mod(i,100)==0),
++		fprintf('\b\b\b\b\b\b\b%5.2f%s',i/length(pos_shelf)*100,' %');
++	end
++
++	%search the node on ice sheet the closest to i
++	[d posd]=min(sqrt((md.mesh.x(pos_shelf(i))-md.mesh.x(pos_GL)).^2+(md.mesh.y(pos_shelf(i))-md.mesh.y(pos_GL)).^2));
++
++	if d<distance,
++
++		md.melting(pos_shelf(i))=value;
++
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/massbalance/outflow.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/massbalance/outflow.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/massbalance/outflow.m	(revision 13008)
+@@ -0,0 +1,18 @@
++function flag=outflow(md);
++%OUTFLOW - flag nodes on outflux boundary
++%
++%   Usage:
++%      flag=outflow(md);
++
++A=md.mesh.segments(:,1);
++B=md.mesh.segments(:,2);
++Nx=-(md.mesh.y(A)-md.mesh.y(B));
++Ny=  md.mesh.x(A)-md.mesh.x(B);
++Vx=(md.initialization.vx(A)+md.initialization.vx(B))/2;
++Vy=(md.initialization.vy(A)+md.initialization.vy(B))/2;
++
++%dot product
++VdotN=Vx.*Nx+Vy.*Ny;
++
++flag=zeros(md.mesh.numberofvertices,1);
++flag(A(find(VdotN>0)))=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/SectionValues.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/SectionValues.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/SectionValues.m	(revision 13008)
+@@ -0,0 +1,127 @@
++function [index,X,Y,Z,S,data_interp]=SectionValues(md,data,infile,resolution)
++%SECTIONVALUES - compute the value of a field on a section
++%
++%   This routine gets the value of a given field of the model on points
++%   given by filname (Argus type file)
++%
++%   Usage:
++%      [elements,x,y,z,s,data]=SectionValues(md,data,filename,resolution)
++%      [elements,x,y,z,s,data]=SectionValues(md,data,profile_structure,resolution)
++
++%check what we have for profile as input
++if ischar(infile),
++	%read infile:
++	profile=expread(infile);
++	nods=profile.nods;
++	x=profile.x;
++	y=profile.y;
++else
++	%read infile:
++	nods=infile.nods;
++	x=infile.x;
++	y=infile.y;
++end
++
++
++%get the specified resolution
++if isnumeric(resolution(1))
++	res_h=resolution(1);
++else
++	error('SectionValues error message: wrong resolution type. Resolution must be an array [horizontal_resolution vertical_resolution]')
++end
++if md.mesh.dimension==3
++	if (length(resolution)==2 & isnumeric(resolution(2)))
++		res_v=resolution(2);
++	else
++		error('SectionValues error message: wrong resolution type. Resolution must be an array [horizontal_resolution vertical_resolution]')
++	end
++end
++
++%initialization
++X=[]; %X-coordinate
++Y=[]; %Y-coordinate
++S=0;  %curvilinear coordinate
++
++for i=1:nods-1
++
++	x_start=x(i);
++	x_end=x(i+1);
++	y_start=y(i);
++	y_end=y(i+1);
++	s_start=S(end);
++
++	length_segment=sqrt((x_end-x_start)^2+(y_end-y_start)^2);
++	portion=ceil(length_segment/res_h);
++
++	x_segment=zeros(portion,1);
++	y_segment=zeros(portion,1);
++	s_segment=zeros(portion,1);
++
++	for j=1:portion
++		x_segment(j)=x_start+(j-1)*(x_end-x_start)/portion;
++		y_segment(j)=y_start+(j-1)*(y_end-y_start)/portion;
++		s_segment(j)=s_start+j*length_segment/portion;
++	end
++
++	%plug into X and Y
++	X=[X;x_segment];
++	Y=[Y;y_segment];
++	S=[S;s_segment];
++end
++X(end+1)=x(nods);
++Y(end+1)=y(nods);
++
++%Number of nodes:
++numberofnodes=size(X,1);
++
++%Compute Z
++Z=zeros(numberofnodes,1);
++
++%New mesh and Data interpolation
++if (md.mesh.dimension==2)
++
++	%Interpolation of data on specified points
++	data_interp=InterpFromMesh2d(md.mesh.elements,md.mesh.x,md.mesh.y,data,X,Y);
++	%data_interp=InterpFromMeshToMesh2d(md.mesh.elements,md.mesh.x,md.mesh.y,data,X,Y);
++	%data_interp=griddata(md.mesh.x,md.mesh.y,data,X,Y);
++
++	%Compute index
++	index=[1:1:(numberofnodes-1);2:1:numberofnodes]';
++
++else
++
++	%vertically extrude mesh
++
++	%Get bed and surface for each 2d point, offset to make sure that it is inside the glacier system
++	offset=10^-3;
++	bed=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.bed,1),X,Y)+offset;
++	surface=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.surface,1),X,Y)-offset;
++
++	%Some useful parameters
++	layers=ceil(mean(md.geometry.thickness)/res_v);
++	nodesperlayer=numberofnodes;
++	nodestot=nodesperlayer*layers;
++	elementsperlayer=nodesperlayer-1;
++	elementstot=(nodesperlayer-1)*(layers-1);
++
++	%initialization
++	X3=zeros(nodesperlayer*layers,1); Y3=zeros(nodesperlayer*layers,1); Z3=zeros(nodesperlayer*layers,1); S3=zeros(nodesperlayer*layers,1); index3=zeros(elementstot,4);
++
++	%Get new coordinates in 3d
++	for i=1:layers
++		X3(i:layers:end)=X;
++		Y3(i:layers:end)=Y;
++		Z3(i:layers:end)=bed+(i-1)*(surface-bed)/(layers-1);
++		S3(i:layers:end)=S;
++
++		if i<layers %Build index3 with quads
++			index3((i-1)*elementsperlayer+1:i*elementsperlayer,:)=[i:layers:nodestot-layers; i+1:layers:nodestot-layers; i+layers+1:layers:nodestot; i+layers:layers:nodestot]';
++		end
++	end
++
++	%Interpolation of data on specified points
++	data_interp=InterpFromMeshToMesh3d(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z,data,X3,Y3,Z3,NaN);
++
++	%build outputs
++	X=X3; Y=Y3; Z=Z3;  S=S3; index=index3;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/ProfileValues.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/ProfileValues.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/ProfileValues.m	(revision 13008)
+@@ -0,0 +1,21 @@
++function [Z,data_interp]=ProfileValues(md,data,xprof,yprof,resolution)
++%PROFILEVALUES - compute the value of a field on a vertical profile
++%
++%   This routine gets the value of a given field of the model on points
++%   given by filname (Argus type file)
++%
++%   Usage:
++%      [z,data]=ProfileValues(md,data,filename,resolution)
++%      [z,data]=ProfileValues(md,data,profile_structure,resolution)
++
++%Get bed and surface for each 2d point, offset to make sure that it is inside the glacier system
++offset=10^-3;
++bed=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.bed,1),xprof,yprof)+offset;
++surface=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.surface,1),xprof,yprof)-offset;
++
++%Some useful parameters
++layers=ceil(mean(md.geometry.thickness)/resolution);
++Z=(bed:resolution:surface)';
++X=xprof*ones(size(Z));
++Y=yprof*ones(size(Z));
++data_interp=InterpFromMeshToMesh3d(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z,data,X,Y,Z,NaN);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/shear2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/shear2d.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/shear2d.m	(revision 13008)
+@@ -0,0 +1,23 @@
++function [sx,sy,sxy,s]=shear2d(md)
++%SHEAR2D - computes 2d strain rate
++%
++%   This routine computes the strain rate of 2d models
++%
++%   Usage:
++%      [sx,sy,sxy,s]=shear2d(md);
++%      s=shear2d(md);
++
++[alpha beta]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y); 
++
++summation=[1;1;1];
++sx=(md.initialization.vx(md.mesh.elements).*alpha)*summation;
++uy=(md.initialization.vx(md.mesh.elements).*beta)*summation;
++vx=(md.initialization.vy(md.mesh.elements).*alpha)*summation;
++sy=(md.initialization.vy(md.mesh.elements).*beta)*summation;						
++sxy=(uy+vx)/2;
++s=sqrt(sx.^2+sy.^2+sxy.^2+sx.*sy);
++
++%if user requested only one output, it must be the norm
++if nargout==1,
++	sx=s;
++end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13008-13009.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13008-13009.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13008-13009.diff	(revision 13394)
@@ -0,0 +1,27795 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/misfit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/misfit.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/misfit.m	(revision 13009)
+@@ -1,37 +0,0 @@
+-function J=misfit(md)
+-%MISFIT - compute misfit
+-%
+-%   Usage:
+-%      J=misfit(md)
+-%
+-%   Example:
+-%      J=misfit(md)
+-%
+-
+-if md.mesh.dimension==2,
+-	elements=md.mesh.elements;
+-	x=md.mesh.x;
+-	y=md.mesh.y;
+-	vx=md.initialization.vx;
+-	vy=md.initialization.vy;
+-	vx_obs=md.inversion.vx_obs;
+-	vy_obs=md.inversion.vy_obs;
+-else
+-	elements=md.mesh.elements2d;
+-	x=md.mesh.x2d;
+-	y=md.mesh.y2d;
+-	vx=project2d(md,md.initialization.vx,md.mesh.numberoflayers);
+-	vy=project2d(md,md.initialization.vy,md.mesh.numberoflayers);
+-	vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers);
+-	vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers);
+-end
+-
+-%compute areas;
+-areas=GetAreas(elements,x,y);
+-
+-%compute delta v on elements
+-deltav=1/2*(   (vx-vx_obs).^2+(vy-vy_obs).^2)/md.constants.yts^2;
+-deltav_elem=deltav(elements)*[1;1;1]/3;
+-
+-%compute misfit
+-J=sum(deltav_elem.*areas);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontroldrag.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontroldrag.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontroldrag.m	(revision 13009)
+@@ -1,121 +0,0 @@
+-function md=parametercontroldrag(md,varargin),
+-%PARAMETERCONTROLDRAG - parameterization for control method on drag
+-%
+-%   It is possible to specify the number of steps, values for the
+-%   minimum and maximum values of the drag, the 
+-%   kind of cm_responses to use or the the optscal.
+-%   
+-%   Usage:
+-%       md=parametercontroldrag(md,varargin)
+-%
+-%   Example:
+-%      md=parametercontroldrag(md)
+-%      md=parametercontroldrag(md,'nsteps',20,'cm_responses',0)
+-%      md=parametercontroldrag(md,'cm_min',1,'cm_max',150,'cm_jump',0.99,'maxiter',20)
+-%      md=parametercontroldrag(md,eps_cm',10^-4,'optscal',[10^7 10^8])
+-%
+-%   See also PARAMETERCONTROLB
+-
+-%process options
+-options=pairoptions(varargin{:});
+-
+-%control type
+-md.inversion.control_parameters={'FrictionCoefficient'};
+-
+-%weights
+-weights=getfieldvalue(options,'weights',ones(md.mesh.numberofvertices,1));
+-if (length(weights)~=md.mesh.numberofvertices)
+-	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-else
+-	md.inversion.cost_functions_coefficients=weights;
+-end
+-
+-%nsteps
+-nsteps=getfieldvalue(options,'nsteps',100);
+-if (length(nsteps)~=1 | nsteps<=0 | floor(nsteps)~=nsteps)
+-	md.inversion.nsteps=100;
+-else
+-	md.inversion.nsteps=nsteps;
+-end
+-
+-%cm_min
+-cm_min=getfieldvalue(options,'cm_min',1*ones(md.mesh.numberofvertices,1));
+-if (length(cm_min)==1)
+-	md.inversion.min_parameters=cm_min*ones(md.mesh.numberofvertices,1);
+-elseif (length(cm_min)==md.mesh.numberofvertices)
+-	md.inversion.min_parameters=cm_min;
+-else
+-	md.inversion.min_parameters=cm_min;
+-end
+-
+-%cm_max
+-cm_max=getfieldvalue(options,'cm_max',250*ones(md.mesh.numberofvertices,1));
+-if (length(cm_max)==1)
+-	md.inversion.max_parameters=cm_max*ones(md.mesh.numberofvertices,1);
+-elseif (length(cm_max)==md.mesh.numberofvertices)
+-	md.inversion.max_parameters=cm_max;
+-else
+-	md.inversion.max_parameters=cm_max;
+-end
+-
+-%eps_cm
+-eps_cm=getfieldvalue(options,'eps_cm',NaN);
+-if (length(eps_cm)~=1 | eps_cm<0 )
+-	md.inversion.cost_function_threshold=NaN;
+-else
+-	md.inversion.cost_function_threshold=eps_cm;
+-end
+-
+-%maxiter
+-maxiter=getfieldvalue(options,'maxiter',10*ones(md.inversion.nsteps,1));
+-if (any(maxiter<0) | any(floor(maxiter)~=maxiter))
+-	md.inversion.maxiter_per_step=10*ones(md.inversion.nsteps,1);
+-else
+-	md.inversion.maxiter_per_step=repmat(maxiter(:),md.inversion.nsteps,1);
+-	md.inversion.maxiter_per_step(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%cm_jump
+-cm_jump=getfieldvalue(options,'cm_jump',0.8*ones(md.inversion.nsteps,1));
+-if ~isreal(cm_jump)
+-	md.inversion.step_threshold=0.8*ones(md.inversion.nsteps,1);
+-else
+-	md.inversion.step_threshold=repmat(cm_jump(:),md.inversion.nsteps,1);
+-	md.inversion.step_threshold(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%cm_responses
+-found=0;
+-if exist(options,'cm_responses'),
+-	cm_responses=getfieldvalue(options,'cm_responses');
+-	if ~any(~ismember(cm_responses,[101 105]))
+-		md.inversion.cost_functions=repmat(cm_responses(:),md.inversion.nsteps,1);
+-		md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
+-		found=1;
+-	end
+-end
+-if ~found
+-	third=ceil(md.inversion.nsteps/3);
+-	md.inversion.cost_functions=[...
+-		103*ones(third,1);...
+-		101*ones(third,1);...
+-		repmat([101;101;103;101],third,1)...
+-		];
+-	md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%optscal
+-found=0;
+-if exist(options,'optscal'),
+-	optscal=getfieldvalue(options,'optscal');
+-	if ~any(optscal<0),
+-		md.inversion.gradient_scaling=repmat(optscal(:),md.inversion.nsteps,1);
+-		md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
+-		found=1;
+-	end
+-end
+-if ~found
+-	third=ceil(md.inversion.nsteps/3);
+-	md.inversion.gradient_scaling=[50*ones(3,1);15*ones(third-3,1);10*ones(third,1);repmat([10;10;20;10],third,1)];
+-	md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontrolB.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontrolB.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/inversions/parametercontrolB.m	(revision 13009)
+@@ -1,122 +0,0 @@
+-function md=parametercontrolB(md,varargin),
+-%PARAMETERCONTROLB - parameterization for control method on B
+-%
+-%   It is possible to specify the number of steps, values for the
+-%   minimum and maximum values of B, the 
+-%   kind of cm_responses to use or the the optscal.
+-%   
+-%   Usage:
+-%       md=parametercontrolB(md,varargin)
+-%
+-%   Example:
+-%      md=parametercontrolB(md)
+-%      md=parametercontrolB(md,'nsteps',20,'cm_responses',0)
+-%      md=parametercontrolB(md,'cm_min',10,'cm_max',10^8,'cm_jump',0.99,'maxiter',20)
+-%      md=parametercontrolB(md,eps_cm',10^-4,'optscal',[10^7 10^8])
+-%
+-%   See also  PARAMETERCONTROLDRAG
+-
+-%process options
+-options=pairoptions(varargin{:});
+-
+-%control type
+-md.inversion.control_parameters={'MaterialsRheologyBbar'};
+-
+-%weights
+-weights=getfieldvalue(options,'weights',ones(md.mesh.numberofvertices,1));
+-if (length(weights)~=md.mesh.numberofvertices)
+-	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+-else
+-	md.inversion.cost_functions_coefficients=weights;
+-end
+-
+-%nsteps
+-nsteps=getfieldvalue(options,'nsteps',100);
+-if (length(nsteps)~=1 | nsteps<=0 | floor(nsteps)~=nsteps)
+-	md.inversion.nsteps=100;
+-else
+-	md.inversion.nsteps=nsteps;
+-end
+-
+-
+-%cm_min
+-cm_min=getfieldvalue(options,'cm_min',paterson(273.15+5)*ones(md.mesh.numberofvertices,1));
+-if (length(cm_min)==1)
+-	md.inversion.min_parameters=cm_min*ones(md.mesh.numberofvertices,1);
+-elseif (length(cm_min)==md.mesh.numberofvertices)
+-	md.inversion.min_parameters=cm_min;
+-else
+-	md.inversion.min_parameters=cm_min;
+-end
+-
+-%cm_max
+-cm_max=getfieldvalue(options,'cm_max',paterson(273.15-70)*ones(md.mesh.numberofvertices,1));
+-if (length(cm_max)==1)
+-	md.inversion.max_parameters=cm_max*ones(md.mesh.numberofvertices,1);
+-elseif (length(cm_max)==md.mesh.numberofvertices)
+-	md.inversion.max_parameters=cm_max;
+-else
+-	md.inversion.max_parameters=cm_max;
+-end
+-
+-%eps_cm
+-eps_cm=getfieldvalue(options,'eps_cm',NaN);
+-if (length(eps_cm)~=1 | eps_cm<0 )
+-	md.inversion.cost_function_threshold=NaN;
+-else
+-	md.inversion.cost_function_threshold=eps_cm;
+-end
+-
+-%maxiter
+-maxiter=getfieldvalue(options,'maxiter',10*ones(md.inversion.nsteps,1));
+-if (any(maxiter<0) | any(floor(maxiter)~=maxiter))
+-	md.inversion.maxiter_per_step=10*ones(md.inversion.nsteps,1);
+-else
+-	md.inversion.maxiter_per_step=repmat(maxiter(:),md.inversion.nsteps,1);
+-	md.inversion.maxiter_per_step(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%cm_jump
+-cm_jump=getfieldvalue(options,'cm_jump',0.9*ones(md.inversion.nsteps,1));
+-if ~isreal(cm_jump)
+-	md.inversion.step_threshold=0.9*ones(md.inversion.nsteps,1);
+-else
+-	md.inversion.step_threshold=repmat(cm_jump(:),md.inversion.nsteps,1);
+-	md.inversion.step_threshold(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%cm_responses
+-found=0;
+-if exist(options,'cm_responses'),
+-	cm_responses=getfieldvalue(options,'cm_responses');
+-	if ~any(~ismember(cm_responses,[ 101:105])),
+-		md.inversion.cost_functions=repmat(cm_responses(:),md.inversion.nsteps,1);
+-		md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
+-		found=1;
+-	end
+-end
+-if ~found
+-	third=ceil(md.inversion.nsteps/3);
+-	md.inversion.cost_functions=[...
+-		103*ones(third,1);...
+-		101*ones(third,1);...
+-		repmat([101;101;103;101],third,1)...
+-		];
+-	md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
+-end
+-
+-%optscal
+-found=0;
+-if exist(options,'optscal'),
+-	optscal=getfieldvalue(options,'optscal');
+-	if ~any(optscal<0),
+-		md.inversion.gradient_scaling=repmat(optscal(:),md.inversion.nsteps,1);
+-		md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
+-		found=1;
+-	end
+-end
+-if ~found
+-	third=ceil(md.inversion.nsteps/3);
+-	md.inversion.gradient_scaling=[2*10^8*ones(3,1);10^8*ones(third-3,1);10^7*ones(2*third,1);];
+-	md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project2d.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project2d.m	(revision 13009)
+@@ -1,36 +0,0 @@
+-function projection_value=project2d(md3d,value,layer)
+-%PROJECT2D - returns the value of a field for a given layer of the mesh
+-%
+-%   project 'value' vector taken at layer 'layer' from extruded 2d-3d mesh onto 2d mesh 
+-%   used to do the extrusion. This routine is used to compare values between a 2d-3d mesh
+-%   at a certain layer, and the equivalent value (if it exists), on the original 2d mesh. 
+-%   This routine relies heavily on projections (contained in 3d model md) recored during 
+-%   the extrude operation.
+-%
+-%   Usage:
+-%      projection_value=project2d(md3d,value,layer)
+-%
+-%   Example:
+-%      vel2=project2d(md3d,md3d.vel,2);
+-
+-%some checks on list of arguments
+-if ((nargin~=3) ),
+-	help project2d
+-	error('project2d error message');
+-end
+-
+-if (md3d.mesh.dimension~=3),
+-	error('wrong model type ... should be ''3d''');
+-end
+-
+-if ((layer<1) | (layer>md3d.mesh.numberoflayers)),
+-	error(['layer must be between 1 and ' num2str(md3d.mesh.numberoflayers)]);
+-end
+-
+-if size(value,1)==md3d.mesh.numberofvertices,
+-	projection_value=value((layer-1)*md3d.mesh.numberofvertices2d+1:layer*md3d.mesh.numberofvertices2d,:);
+-elseif size(value,1)==md3d.mesh.numberofvertices+1,
+-	projection_value=[value((layer-1)*md3d.mesh.numberofvertices2d+1:layer*md3d.mesh.numberofvertices2d,:); value(end,:)];
+-else
+-	projection_value=value((layer-1)*md3d.mesh.numberofelements2d+1:layer*md3d.mesh.numberofelements2d,:);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project3d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project3d.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/project3d.m	(revision 13009)
+@@ -1,82 +0,0 @@
+-function projected_vector=project3d(md,varargin);
+-%PROJECT3D - vertically project a vector from 2d mesh
+-%
+-%   vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh.
+-%   This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an 
+-%   element vector of size (md.mesh.numberofelements2d,N/A). 
+-%   arguments: 
+-%      'vector': 2d vector
+-%      'type': 'element' or 'node'. 
+-%   options: 
+-%      'layer' a layer number where vector should keep its values. If not specified, all layers adopt the 
+-%             value of the 2d vector.
+-%      'padding': default to 0 (value adopted by other 3d layers not being projected0
+-%
+-%   Egs:
+-%      extruded_vector=project3d(md,'vector',vector2d,'type','node','layer',1,'padding',NaN);
+-%      extruded_vector=project3d(md,'vector',vector2d,'type','element','padding',0);
+-%      extruded_vector=project3d(md,'vector',vector2d,'type','node');
+-
+-%some regular checks
+-if nargin==0,
+-	help project3d
+-	error('bad usage');
+-end
+-if md.mesh.dimension~=3
+-	error('input model is not 3d');
+-end
+-
+-%retrieve parameters from options.
+-options      = pairoptions(varargin{:});
+-vector2d     = getfieldvalue(options,'vector');     %mandatory
+-type         = getfieldvalue(options,'type');       %mandatory
+-layer        = getfieldvalue(options,'layer',0);    %optional (do all layers otherwise)
+-paddingvalue = getfieldvalue(options,'padding',0);  %0 by default
+-
+-if length(vector2d)==1,
+-	projected_vector=vector2d;
+-elseif strcmpi(type,'node'),
+-
+-	%Initialize 3d vector
+-	if size(vector2d,1)==md.mesh.numberofvertices2d
+-		projected_vector=paddingvalue*ones(md.mesh.numberofvertices,  size(vector2d,2));
+-	elseif size(vector2d,1)==md.mesh.numberofvertices2d+1
+-		projected_vector=paddingvalue*ones(md.mesh.numberofvertices+1,size(vector2d,2));
+-		projected_vector(end,:)=vector2d(end,:);
+-		vector2d=vector2d(1:end-1,:);
+-	else
+-		error('vector length not supported')
+-	end
+-
+-	%Fill in
+-	if layer==0,
+-		for i=1:md.mesh.numberoflayers,
+-			projected_vector(((i-1)*md.mesh.numberofvertices2d+1):(i*md.mesh.numberofvertices2d),:)=vector2d;
+-		end
+-	else
+-		projected_vector(((layer-1)*md.mesh.numberofvertices2d+1):(layer*md.mesh.numberofvertices2d),:)=vector2d;
+-	end
+-elseif strcmpi(type,'element'),
+-
+-	%Initialize 3d vector
+-	if size(vector2d,1)==md.mesh.numberofelements2d
+-		projected_vector=paddingvalue*ones(md.mesh.numberofelements,  size(vector2d,2));
+-	elseif size(vector2d,1)==md.mesh.numberofelements2d+1
+-		projected_vector=paddingvalue*ones(md.mesh.numberofelements+1,size(vector2d,2));
+-		projected_vector(end,:)=vector2d(end,:);
+-		vector2d=vector2d(1:end-1,:);
+-	else
+-		error('vector length not supported')
+-	end
+-
+-	if layer==0,
+-		for i=1:(md.mesh.numberoflayers-1),
+-			projected_vector( ((i-1)*md.mesh.numberofelements2d+1):(i*md.mesh.numberofelements2d),:)=vector2d;
+-		end
+-
+-	else
+-		projected_vector( ((layer-1)*md.mesh.numberofelements2d+1):(layer*md.mesh.numberofelements2d),:)=vector2d;
+-	end
+-else
+-	error('project3d error message: unknown projection type');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/DepthAverage.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/DepthAverage.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/extrusion/DepthAverage.m	(revision 13009)
+@@ -1,33 +0,0 @@
+-function  vector_average=DepthAverage(md,vector);
+-%DEPTHAVERAGE - computes depth average of 3d vector, and return value on 2d mesh. 
+-%
+-%   Usage:
+-%      vector_average=DepthAverage(md,vector);
+-%
+-%   Example:
+-%      vel_bar=DepthAverage(md,md.initialization.vel);
+-
+-%check that the model given in input is 3d
+-if ~md.mesh.dimension==3;
+-	error('DepthAverage error message: the model given in input must be 3d')
+-end
+-
+-%nods data
+-if (length(vector)==md.mesh.numberofvertices),
+-	vector_average=zeros(md.mesh.numberofvertices2d,1);
+-	for i=1:md.mesh.numberoflayers-1,
+-		vector_average=vector_average+(project2d(md,vector,i)+project2d(md,vector,i+1))/2.*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
+-	end
+-	vector_average=vector_average./project2d(md,md.geometry.thickness,1);
+-
+-%element data
+-elseif (length(vector)==md.mesh.numberofelements),
+-	vector_average=zeros(md.mesh.numberofelements2d,1);
+-	for i=1:md.mesh.numberoflayers-1,
+-		vector_average=vector_average+project2d(md,vector,i).*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
+-	end
+-	vector_average=vector_average./project2d(md,md.geometry.thickness,1);
+-
+-else
+-	error('vector size not supported yet');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/LaunchMultipleQueueJob.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/LaunchMultipleQueueJob.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/LaunchMultipleQueueJob.m	(revision 13009)
+@@ -1,21 +0,0 @@
+-function LaunchMultipleQueueJob(cluster,name,executionpath)
+-%LAUNCHMULTIPLEQUEUEJOB - ...
+-%
+-%   Usage:
+-%      LaunchMultipleQueueJob(executionpath)
+-
+-%First try and figure out if there is a special script for thie particular cluster
+-function_name=['LaunchMultipleQueueJob' cluster];
+-
+-%some specific treatment of identical cluster, gemini, castor and pollux
+-if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
+-	function_name='LaunchMultipleQueueJobgemini';
+-end
+-
+-if exist(function_name,'file'),
+-	%Call this function:
+-	eval([function_name '(cluster,name,executionpath);']);
+-else
+-	%Call the generic LaunchMultipleQueueJob:
+-	LaunchMultipleQueueJobGeneric(cluster,name,executionpath);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/BuildMultipleQueueingScriptgemini.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/BuildMultipleQueueingScriptgemini.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/BuildMultipleQueueingScriptgemini.m	(revision 13009)
+@@ -1,23 +0,0 @@
+-function BuildQueueingScriptgemini(name,executionpath,codepath)
+-%BUILDQUEUEINGSCRIPTGEMINI - ...
+-%
+-%   Usage:
+-%      BuildQueueingScriptgemini(md,executionpath,codepath)
+-
+-scriptname=[name '.queue'];
+-
+-fid=fopen(scriptname,'w');
+-if fid==-1,
+-	error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']);
+-end
+-
+-fprintf(fid,'#!/bin/sh\n');
+-fprintf(fid,'cd %s\n',executionpath);
+-fprintf(fid,'mkdir %s\n',name);
+-fprintf(fid,'cd %s\n',name);
+-fprintf(fid,'mv ../ModelList.tar.gz ./\n');
+-fprintf(fid,'tar -zxvf ModelList.tar.gz\n');
+-fprintf(fid,'foreach i (%s-*vs*.queue)\n',name);
+-fprintf(fid,'qsub $i\n');
+-fprintf(fid,'end\n');
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/LaunchMultipleQueueJobgemini.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/LaunchMultipleQueueJobgemini.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/LaunchMultipleQueueJobgemini.m	(revision 13009)
+@@ -1,22 +0,0 @@
+-function md=LaunchMultipleQueueJobgemini(cluster,name,executionpath)
+-%LAUNCHMULTIPLEQUEUEJOBGEMINI - Launch multiple queueing script on Gemini cluster
+-%
+-%   Usage:
+-%      LaunchMultipleQueueJobgemini(cluster,name,executionpath)
+-
+-
+-%first, check we have the binary file and the queueing script
+-if ~exist([ name '.queue'],'file'),
+-	error('LaunchMultipleQueueJobgemini error message: queueing script issing, cannot go forward');
+-end
+-
+-if ~exist('ModelList.tar.gz','file'),
+-	error('LaunchMultipleQueueJobgemini error message: inputs models file missing, cannot go forward');
+-end
+-
+-%upload both files to cluster
+-disp('uploading input file,  queueing script and variables script');
+-eval(['!scp ModelList.tar.gz ' name '.queue '  cluster ':' executionpath]);
+-
+-disp('launching solution sequence on remote cluster');
+-issmssh(cluster,login,['"cd ' executionpath ' && source ' name '.queue "']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/BuildMultipleQueueingScriptGeneric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/BuildMultipleQueueingScriptGeneric.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/BuildMultipleQueueingScriptGeneric.m	(revision 13009)
+@@ -1,9 +0,0 @@
+-function BuildMultipleQueueingScriptGeneric(name,executionpath,codepath)
+-%BUILDMULTIPLEQUEUEINGSCRIPTGENERIC - ...
+-%
+-%   Usage:
+-%      BuildMultipleQueueingScriptGeneric(executionpath,codepath)
+-
+-%not done yet
+-error('BuildMultipleQueueingScriptGenericerror message: not supported yet!');
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/BuildMultipleQueueingScript.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/BuildMultipleQueueingScript.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/BuildMultipleQueueingScript.m	(revision 13009)
+@@ -1,23 +0,0 @@
+-function BuildMultipleQueueingScript(cluster,name,executionpath,codepath)
+-%BUILDMULTIPLEQUEUEINGSCRIPT - 
+-%
+-%   Usage:
+-%      BuildMultipleQueueingScript(executionpath,codepath)
+-
+-disp('building queueing script');
+-
+-%First try and figure out if there is a special script for this particular cluster
+-function_name=['BuildMultipleQueueingScript' cluster];
+-
+-%some specific treatment of identical cluster, gemini, castor and pollux
+-if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
+-	function_name='BuildMultipleQueueingScriptgemini';
+-end
+-
+-if exist(function_name,'file'),
+-	%Call this function:
+-	eval([function_name '(name,executionpath,codepath);']);
+-else
+-	%Call the generic BuildQueueingScript:
+-	BuildMultipleQueueingScriptGeneric(name,executionpath,codepath);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/LaunchMultipleQueueJobGeneric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/LaunchMultipleQueueJobGeneric.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/multiplequeue/LaunchMultipleQueueJobGeneric.m	(revision 13009)
+@@ -1,7 +0,0 @@
+-function LaunchMultipleQueueJobGeneric(cluster,name,executionpath)
+-%LAUNCHMULTIPLEQUEUEJOBGENERIC - Generic routine to launch multiple queueing job
+-%
+-%   Usage:
+-%      LaunchMultipleQueueJobGeneric(cluster,name,executionpath)
+-
+-error('LaunchMultipleQueueJobGeneric error message: not supported yet!');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrain.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrain.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrain.m	(revision 13009)
+@@ -1,63 +0,0 @@
+-function md=BasinConstrain(md,domain);
+-%BASINCONSTRAIN - constrain basin
+-%
+-%   Constrain basin using a constraint domain outline, 
+-%   to dirichlet boundary conditions.
+-%   constraindomain is an Argus domain outline file enclosing 
+-%   the geographical area of interest.
+-%
+-%   Usage: 
+-%      md=BasinConstrain(md,constraindomain)
+-%
+-%   Example:
+-%      md=BasinConstrain(md,'DomainOutline.exp');
+-%      md=BasinConstrain(md,'~Iceshelves.exp');
+-
+-%now, flag nodes and elements outside the domain outline.
+-if ischar(domain),
+-	if isempty(domain),
+-		elementondomain=zeros(md.mesh.numberofelements,1);
+-		vertexondomain=zeros(md.mesh.numberofvertices,1);
+-		invert=0;
+-	elseif strcmpi(domain,'all')
+-		elementondomain=ones(md.mesh.numberofelements,1);
+-		vertexondomain=ones(md.mesh.numberofvertices,1);
+-		invert=0;
+-	else
+-		%make sure that we actually don't want the elements outside the domain outline!
+-		if strcmpi(domain(1),'~'),
+-			domain=domain(2:end);
+-			invert=1;
+-		else
+-			invert=0;
+-		end
+-		%ok, flag elements and nodes
+-		[vertexondomain elementondomain]=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,domain,'element and node',2);
+-	end
+-	if invert,
+-		vertexondomain=~vertexondomain;
+-		elementondomain=~elementondomain;
+-	end
+-else
+-	error('BasinConstrain error message: domain type not supported yet');
+-end
+-
+-%list of elements and nodes not on domain
+-vertexnotondomain=find(~vertexondomain);
+-elementnotondomain=find(~elementondomain);
+-
+-%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
+-md.diagnostic.spcvx(vertexnotondomain)=md.inversion.vx_obs(vertexnotondomain);
+-md.diagnostic.spcvy(vertexnotondomain)=md.inversion.vy_obs(vertexnotondomain);
+-md.mask.elementonwater(elementnotondomain)=1;
+-
+-%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
+-pos=find(~md.mask.elementonwater);
+-numpos=unique(md.mesh.elements(pos,:));
+-nodes=setdiff(1:1:md.mesh.numberofvertices,numpos);
+-md.diagnostic.spcvx(nodes)=md.inversion.vx_obs(nodes);
+-md.diagnostic.spcvy(nodes)=md.inversion.vy_obs(nodes);
+-
+-%make sure icefronts that are completely spc'd are taken out:
+-free_segments=find((~isnan(md.diagnostic.spcvx(md.diagnostic.icefront(:,1:2))) + ~isnan(md.diagnostic.spcvy(md.diagnostic.icefront(:,1:2))))~=2);
+-md.diagnostic.icefront=md.diagnostic.icefront(free_segments,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/regionaltransient2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/regionaltransient2d.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/regionaltransient2d.m	(revision 13009)
+@@ -1,158 +0,0 @@
+-function md2=regionaltransient2d(md1,area,hmin,hmax,err,stepres)
+-%regionaltransient2d - extract a model according to an Argus contour or flag list and remesh
+-%               at new resolution res
+-%
+-%   This routine extracts a submodel from a bigger model with respect to a given contour
+-%   md must be followed by the corresponding exp domain file (argus type, .exp extension). 
+-%   The model will be remeshed at high rsolution hmin and low resolution hmax.  The ice 
+-%   boundary velocities will be spc'd to the transient velocities at saved transient steps
+-%   at the resolution optionally provided for stepres.  A stepres of 2 means that you wish
+-%   to skip every other saved transient step.  This is useful when extracting a long transient.
+-%
+-%   Usage:
+-%      md2=regionaltransient2d(md1,area,hmin,hmax,err);
+-%
+-%   Examples:
+-%      md2=regionaltransient2d(md,'Domain.exp',500,10000,[15 250]);
+-%      md2=regionaltransient2d(md,'Domain.exp',3000,15000,[10 300],2);
+-%
+-%   See also: MODELEXTRACT, EXTRUDE, COLLAPSE
+-
+-%some checks
+-if ((nargin~=5) & (nargin~=6)),
+-	help regionaltransient2d 
+-	error('regionaltransient2d error message: bad usage');
+-end
+-
+-%get check option
+-if (nargin==5),
+-	stepres=1;
+-end
+-
+-%take every fields from model
+-mde=modelextract(md1,area);
+-mde.private.bamg=[];
+-mde.mesh.extractedvertices=nan;
+-mde.mesh.extractedelements=nan;
+-
+-%remesh
+-md2=bamg(mde,'hmin',hmin,'hmax',hmax,'field',[mde.inversion.vel_obs mde.geometry.surface],'splitcorner',1,'KeepVertices',0,'err',err);
+-md2=setmask(md2,'','');
+-
+-%automatically modify fields
+-
+-	%loop over model fields
+-	model_fields=fields(md1);
+-	for i=1:length(model_fields),
+-
+-		%get field
+-		field=md1.(model_fields{i});
+-		fieldsize=size(field);
+-
+-		%copy field, interpolated to new mesh
+-		if isobject(field), %recursive call
+-			object_fields=fields(md1.(model_fields{i}));
+-			fname=['(model_fields{i}).(object_fields{j})'];
+-		else
+-			object_fields=field;
+-			fname=['(model_fields{i})'];
+-		end
+-		for j=1:length(object_fields),
+-			%get field
+-			field=eval(['md2.' fname]);
+-			fieldsize=size(field);
+-
+-			%size = number of nodes * n
+-			for n=1:fieldsize(2)
+-				if fieldsize(1)==mde.mesh.numberofvertices
+-					if(sum(field(:,n) ~= field(1,n)) == 0)
+-						eval(['md2.' fname '(1:md2.mesh.numberofvertices,n)=field(1,n)*ones(md2.mesh.numberofvertices,1);']);
+-					else
+-						eval(['md2.' fname '(1:md2.mesh.numberofvertices,n)=InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(:,n),md2.mesh.x,md2.mesh.y);']);
+-					end
+-					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofvertices,n);']);
+-				elseif fieldsize(1)==mde.mesh.numberofvertices+1
+-					if(sum(field(1:end-1,n) ~= field(1,n)) == 0)
+-						eval(['md2.' fname '(1:md2.mesh.numberofvertices+1,n)=[field(1,n)*ones(md2.mesh.numberofvertices,1); field(end,n)];']);
+-					else
+-						eval(['md2.' fname '(1:md2.mesh.numberofvertices+1,n)=[InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(1:end-1,n),md2.mesh.x,md2.mesh.y); field(end,n)];']);
+-					end
+-					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofvertices+1,n)']);
+-					%size = number of elements * n
+-				elseif fieldsize(1)==mde.mesh.numberofelements
+-					if(sum(field(1:end-1,n) ~= field(1,n)) == 0)
+-						eval(['md2.' fname '(1:md2.mesh.numberofelements,n)=field(1,n)*ones(md2.mesh.numberofelements,1);']);
+-					else
+-						eval(['md2.' fname '(1:md2.mesh.numberofelements,n)=InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(:,n),md2.mesh.x,md2.mesh.y);']);
+-					end
+-					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofelements,n);']);
+-				end
+-			end
+-		end
+-	end
+-
+-	%Read transient velocities and thickness, looping through only the populated times
+-	spcx=[];
+-	spcy=[];
+-	spct=[];
+-	steps=[];
+-	nsteps=length(md1.results.TransientSolution);
+-	count=0;
+-	numElements=arrayfun(@(x) numel(x.step), md1.results.TransientSolution);
+-	for t=find(numElements==1)
+-		if ~isempty(md1.results.TransientSolution(t).Vel) & mod(count,stepres)==0,
+-			vx=PatchToVec(md1.results.TransientSolution(t).Vx);
+-			vy=PatchToVec(md1.results.TransientSolution(t).Vy);
+-			thickness=PatchToVec(md1.results.TransientSolution(t).Thickness);
+-			spcx=[spcx InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,vx,md2.mesh.x,md2.mesh.y)];
+-			spcy=[spcy InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,vy,md2.mesh.x,md2.mesh.y)];
+-			spct=[spct InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,thickness,md2.mesh.x,md2.mesh.y)];
+-			steps=[steps t*md1.timestepping.time_step];
+-		end
+-		count=count+1;
+-	end
+-
+-	%As long as there are recorded time steps, spc the boundaries with velocities
+-	if nsteps > 0
+-		md2.diagnostic.spcvx=md2.diagnostic.spcvx*ones(1,size(spcx,2));
+-		md2.diagnostic.spcvy=md2.diagnostic.spcvy*ones(1,size(spcy,2));
+-		md2.diagnostic.spcvz=md2.diagnostic.spcvz*ones(1,size(spcx,2));
+-		md2.prognostic.spcthickness=md2.prognostic.spcthickness*ones(1,size(spct,2));
+-		md2.diagnostic.spcvx(find(md2.mesh.vertexonboundary),:)=spcx(find(md2.mesh.vertexonboundary),:);
+-		md2.diagnostic.spcvy(find(md2.mesh.vertexonboundary),:)=spcy(find(md2.mesh.vertexonboundary),:);
+-		md2.diagnostic.spcvz(find(md2.mesh.vertexonboundary),:)=0;
+-		md2.prognostic.spcthickness(find(md2.mesh.vertexonboundary),:)=spct(find(md2.mesh.vertexonboundary),:);
+-		md2.diagnostic.spcvx=[md2.diagnostic.spcvx; steps];
+-		md2.diagnostic.spcvy=[md2.diagnostic.spcvy; steps];
+-		md2.diagnostic.spcvz=[md2.diagnostic.spcvz; steps];
+-		md2.prognostic.spcthickness=[md2.prognostic.spcthickness; steps];
+-	end
+-
+-	%Diagnostic.  Don't spc the icefront vertices.
+-	if ~isnan(md2.diagnostic.icefront)
+-		md1s=modelextract(md1,area);
+-		%md2.diagnostic.icefront=[md2.mesh.segments 2];
+-		e2=md2.mesh.segments(:,end);
+-		e1=md1s.mesh.segments(:,end);
+-
+-		pload = nan*ones(size(md1s.mesh.elements,1),1);
+-		pload(md1s.diagnostic.icefront(:,end-1))=md1s.diagnostic.icefront(:,end);
+-
+-		x2=mean(md2.mesh.x(md2.mesh.elements(e2,:)),2);
+-      y2=mean(md2.mesh.y(md2.mesh.elements(e2,:)),2);
+-		x1=mean(md1s.mesh.x(md1s.mesh.elements),2);
+-      y1=mean(md1s.mesh.y(md1s.mesh.elements),2);
+-
+-		pload2=griddata(x1,y1,pload,x2,y2,'nearest');
+-		md2.diagnostic.icefront=[md2.mesh.segments(~isnan(pload2),:) pload2(~isnan(pload2))];
+-		md2.diagnostic.spcvx(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
+-		md2.diagnostic.spcvy(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
+-		md2.diagnostic.spcvz(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
+-		md2.prognostic.spcthickness(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
+-	end
+-
+-	%Clear results fields
+-	if isstruct(md1.results),
+-		md2.results=[];
+-	end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrainShelf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrainShelf.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/regional/BasinConstrainShelf.m	(revision 13009)
+@@ -1,74 +0,0 @@
+-function md=BasinConstrainShelf(md,domain);
+-%BASINCONSTRAIN - constrain basin
+-%
+-%   Constrain basin using a constraint domain outline, 
+-%   to dirichlet boundary conditions.
+-%   constraindomain is an Argus domain outline file enclosing 
+-%   the geographical area of interest.
+-%
+-%   Usage: 
+-%      md=BasinConstrain(md,constraindomain)
+-%
+-%   Example:
+-%      md=BasinConstrain(md,'DomainOutline.exp');
+-%      md=BasinConstrain(md,'~Iceshelves.exp');
+-
+-%now, flag nodes and elements outside the domain outline.
+-if ischar(domain),
+-	if isempty(domain),
+-		elementondomain=zeros(md.mesh.numberofelements,1);
+-		vertexondomain=zeros(md.mesh.numberofvertices,1);
+-		invert=0;
+-	elseif strcmpi(domain,'all')
+-		elementondomain=ones(md.mesh.numberofelements,1);
+-		vertexondomain=ones(md.mesh.numberofvertices,1);
+-		invert=0;
+-	else
+-		%make sure that we actually don't want the elements outside the domain outline!
+-		if strcmpi(domain(1),'~'),
+-			domain=domain(2:end);
+-			invert=1;
+-		else
+-			invert=0;
+-		end
+-		%ok, flag elements and nodes
+-		[vertexondomain elementondomain]=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,domain,'element and node',2);
+-	end
+-	if invert,
+-		vertexondomain=~vertexondomain;
+-		elementondomain=~elementondomain;
+-	end
+-else
+-	error('BasinConstrain error message: domain type not supported yet');
+-end
+-
+-%list of elements and nodes not on domain
+-vertexnotondomain=find(~vertexondomain);
+-elementnotondomain=find(~elementondomain);
+-
+-%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
+-md.diagnostic.spcvx(vertexnotondomain)=md.inversion.vx_obs(vertexnotondomain);
+-md.diagnostic.spcvy(vertexnotondomain)=md.inversion.vy_obs(vertexnotondomain);
+-md.mask.elementonwater(elementnotondomain)=1;
+-
+-%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
+-pos=find(~md.mask.elementonwater);
+-numpos=unique(md.mesh.elements(pos,:));
+-nodes=setdiff(1:1:md.mesh.numberofvertices,numpos);
+-md.diagnostic.spcvx(nodes)=md.inversion.vx_obs(nodes);
+-md.diagnostic.spcvy(nodes)=md.inversion.vy_obs(nodes);
+-
+-%make sure any node with NaN velocity is spc'd:
+-%we spc to the smoothed value, so that control methods don't go berserk trying to figure out what reaction force to apply for the spc to stand.
+-pos=find(isnan(md.inversion.vel_obs_raw));
+-md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos); 
+-md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos); 
+-
+-%iceshelves: any vertex on floating ice is spc'd
+-pos=find(md.mask.vertexongroundedice);
+-md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos); 
+-md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos); 
+-
+-%make sure icefronts that are completely spc'd are taken out:
+-free_segments=find((~isnan(md.diagnostic.spcvx(md.diagnostic.icefront(:,1:2))) + ~isnan(md.diagnostic.spcvy(md.diagnostic.icefront(:,1:2))) )~=2);
+-md.diagnostic.icefront=md.diagnostic.icefront(free_segments,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/display/fielddisplay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/display/fielddisplay.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/display/fielddisplay.m	(revision 13009)
+@@ -1,154 +0,0 @@
+-function fielddisplay(md,name,comment)
+-%FIELDDISPLAY - display model field
+-%
+-%   Usage:
+-%      fielddisplay(md,offset,name,comment)
+-
+-	%get field
+-	field=md.(name);
+-
+-	%disp corresponding line as a function of field type (offset set as 9 spaces)
+-	parsedisplay('         ',name,field,comment);
+-
+-end %function
+-
+-function parsedisplay(offset,name,field,comment); %{{{
+-
+-	%string
+-	if ischar(field),
+-
+-		if length(field)>30;
+-			displayunit(offset,name,'not displayed',comment),
+-		else
+-			displayunit(offset,name,['''' field ''''],comment),
+-		end
+-
+-	%numeric
+-	elseif isnumeric(field)
+-
+-		%get size
+-		fieldsize=size(field);
+-
+-		%double
+-		if max(fieldsize)==1,
+-			displayunit(offset,name,num2str(field),comment),
+-		%matrix
+-		else
+-			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
+-		end
+-
+-	%logical
+-	elseif islogical(field)
+-
+-		%get size
+-		fieldsize=size(field);
+-
+-		%single value
+-		if max(fieldsize)==1,
+-			if (field)
+-				displayunit(offset,name,'true',comment),
+-			else
+-				displayunit(offset,name,'false',comment),
+-			end
+-		%matrix
+-		else
+-			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
+-		end
+-
+-		%structure
+-	elseif isstruct(field),
+-		if ~isempty(fields(field))
+-			displayunit(offset,name,'(structure)',comment),
+-			struct_display(field,[offset '   ']),
+-		else
+-			displayunit(offset,name,'N/A',comment),
+-		end
+-
+-	%cell
+-	elseif iscell(field),
+-		cell_display(offset,name,field,comment),
+-
+-	else
+-		displayunit(offset,name,'not displayed',comment),
+-
+-	end
+-end%}}}
+-
+-function struct_display(structure,offset) % {{{
+-
+-	structure_fields=fields(structure);
+-
+-	for i=1:length(structure_fields),
+-
+-		%get current field
+-		field=structure.(structure_fields{i});
+-
+-		%recursive call if necessary
+-		if isstruct(field),
+-			displayunit(offset,structure_fields{i},'(structure)',''),
+-			struct_display(field,[offset '   ']);
+-
+-		%display value
+-		else
+-			parsedisplay(offset,structure_fields{i},field,'');
+-		end
+-	end
+-end% }}}
+-function cell_display(offset,name,field,comment) % {{{
+-
+-	%initialization
+-	string='{';
+-
+-	%go through the cell and fill string
+-	if length(field)<5;
+-		for i=1:length(field),
+-			if ischar(field{i}),
+-				string=[string ''''  field{i} ''','];
+-			elseif (isnumeric(field{i}) & length(field{i})==1)
+-				string=[string num2str(field{i}) ',' ];
+-			else
+-				string='{';
+-				break
+-			end
+-		end
+-	end
+-	if strcmp(string,'{'),
+-		string=['(' num2str(size(field,1)) 'x' num2str(size(field,2)) ')'];
+-	else
+-		string=[string(1:end-1) '}'];
+-	end
+-
+-	%call displayunit
+-	displayunit(offset,name,string,comment);
+-end% }}}
+-function displayunit(offset,name,characterization,comment),% {{{
+-
+-	%take care of name
+-	if length(name)>23,
+-		name=[name(1:20) '...'];
+-	end
+-
+-	%take care of characterization
+-	if (strcmp(characterization,['''' '''']) | strcmp(characterization,'NaN')),
+-		characterization='N/A';
+-	end
+-	if length(characterization)>15,
+-		characterization=[characterization(1:12) '...'];
+-	end
+-
+-	%print
+-	if isempty(comment)
+-		disp(sprintf('%s%-23s: %-15s',offset,name,characterization));
+-	else
+-		if ischar(comment),
+-			disp(sprintf('%s%-23s: %-15s -- %s',offset,name,characterization,comment));
+-		elseif iscell(comment),
+-			disp(sprintf('%s%-23s: %-15s -- %s',offset,name,characterization,comment{1}));
+-			for i=2:length(comment),
+-				disp(sprintf('%s%-23s  %-15s    %s',offset,'','',comment{i}));
+-			end
+-		else
+-			error('fielddisplay error message: format for comment not supportet yet');
+-		end
+-	end
+-end% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/display/fielddisplay2.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/display/fielddisplay2.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/display/fielddisplay2.m	(revision 13009)
+@@ -1,14 +0,0 @@
+-function fielddisplay2(md,name,comment)
+-%FIELDDISPLAY2 - display model field
+-%
+-%   Usage:
+-%      fielddisplay2(md,offset,name,comment)
+-
+-	%get field
+-	field=md.(name);
+-
+-	if length(name)>23,
+-		name=[name(1:20) '...'];
+-	end
+-
+-	disp(sprintf('%s%-23s -- %s','      ',name,comment));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodellist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodellist.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodellist.m	(revision 13009)
+@@ -1,50 +0,0 @@
+-function varargout=loadmodellist(path)
+-%LOADMODELLIST- load a model using built-in load module
+-%
+-%   check that modellist prototype has not changed. if so, adapt to new modellist prototype.
+-%
+-%   Usage:
+-%      mds=loadmodellist(path)
+-%      loadmodellist path
+-
+-%check nargout
+-if nargout>1,
+-	error('loadmodellist usage error: mds=loadmodellist(path)');
+-end
+-%check existence
+-if ~exist(path)
+-	error(['loadmodellist error message: file ' path ' does not exist']);
+-end
+-
+-%check that the file is readable
+-[stat,mess]=fileattrib(path);
+-if( stat==0 | mess.UserRead~=1),
+-	error(['loadmodellist error message: file ' path ' is not readable (permission dinied).']);
+-end
+-
+-%check number of variables
+-if length(whos('-file',path))>1,
+-	error(['loadmodellist error message: file ' path ' contains several variables. Only one model should be present.']);
+-end
+-
+-try,
+-	struc=load(path,'-mat');
+-
+-	%get name of model variable
+-	fieldname=char(fieldnames(struc));
+-	mds=eval(['struc.' fieldname]);
+-	if ~strcmpi(class(mds),'model'),
+-		mds2=modellist;
+-		mds2=structtomodel(mds2,mds);
+-		mds=mds2;
+-		clear mds2;
+-	end
+-	if nargout,
+-		varargout{1}=mds;
+-	else
+-		assignin('caller',fieldname,mds);
+-	end
+-catch me
+-	disp(getReport(me))
+-	error(['could not load model ' path]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodel.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/io/loadmodel.m	(revision 13009)
+@@ -1,46 +0,0 @@
+-function varargout=loadmodel(path)
+-%LOADMODEL - load a model using built-in load module
+-%
+-%   check that model prototype has not changed. if so, adapt to new model prototype.
+-%
+-%   Usage:
+-%      md=loadmodel(path)
+-%      loadmodel path
+-
+-%check nargout
+-if nargout>1,
+-	error('loadmodel usage error: md=loadmodel(path)');
+-end
+-
+-%check existence
+-if exist(path,'file')
+-	%do nothing
+-elseif exist([path '.mat'],'file')
+-	%add extension
+-	path = [path '.mat'];
+-else
+-	error(['loadmodel error message: file ' path ' does not exist']);
+-end
+-
+-try,
+-	%recover model on file and name it md
+-	warning off MATLAB:unknownElementsNowStruc;
+-	warning off MATLAB:load:classNotFound
+-	struc=load(path,'-mat');
+-	warning on MATLAB:unknownElementsNowStruc;
+-	warning on MATLAB:load:classNotFound
+-
+-	name=char(fieldnames(struc));
+-	if size(name,1)>1,
+-		error(['loadmodel error message: file ' path ' contains several variables. Only one model should be present.']); 
+-	end
+-	md=struc.(name);
+-	if nargout,
+-		varargout{1}=md;
+-	else
+-		assignin('caller',name,md);
+-	end
+-catch me
+-	disp(getReport(me))
+-	error(['could not load model ' path]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.py	(revision 13009)
+@@ -1,119 +0,0 @@
+-import datetime
+-import os
+-import shutil
+-from pairoptions import *
+-from process_solve_options import *
+-from EnumDefinitions import *
+-from ismodelselfconsistent import *
+-
+-def solve(md,solutionenum,*args):
+-	"""
+-	SOLVE - apply solution sequence for this model
+- 
+-	   Usage:
+-	      md=solve(md,solutionenum,varargin)
+-	      where varargin is a list of paired arguments of string OR enums
+- 
+-	   solution types available comprise:
+-	      - DiagnosticSolutionEnum
+-	      - PrognosticSolutionEnum
+-	      - ThermalSolutionEnum
+-	      - SteadystateSolutionEnum
+-	      - TransientSolutionEnum...
+-	      - BalancethicknessSolutionEnum
+-	      - BedSlopeSolutionEnum
+-	      - SurfaceSlopeSolutionEnum
+-	      - HydrologySolutionEnum
+-	      - FlaimSolutionEnum
+- 
+-	   extra options:
+-	      - loadonly : does not solve. only load results
+- 
+-	   Examples:
+-	      md=solve(md,DiagnosticSolutionEnum);
+-	"""
+-
+-	#recover and process solve options
+-	options=pairoptions('solution_type',solutionenum,*args)
+-	options=process_solve_options(options)
+-
+-	#recover some fields
+-	md.private.solution=options['solution_type']
+-	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)
+-
+-	#First, build a runtime name that is unique
+-	c=datetime.datetime.now()
+-	md.private.runtimename="%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name,c.month,c.day,c.year,c.hour,c.minute,c.second,os.getpid())
+-
+-	#if running qmu analysis, some preprocessing of dakota files using models
+-	#fields needs to be carried out. 
+-	if md.qmu.isdakota:
+-		md=preqmu(md,options)
+-
+-	#flaim analysis
+-	if options['solution_type'] == FlaimSolutionEnum:
+-		md=flaim_sol(md,options)
+-		md.private.solution=EnumToString(options['solution_type'])
+-		return md
+-
+-	#Do we load results only?
+-	if options['loadonly']:  
+-		md=loadresultsfromcluster(md)
+-		return md
+-
+-	#Wite all input files
+-	marshall(md)                                           # bin file
+-	md.solver.PetscFile(md.miscellaneous.name+'.petsc')    # petsc file
+-	cluster.BuildQueueScript(md.miscellaneous.name,md.private.runtimename,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
+-
+-	#we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+-	if not ispetsc:
+-		print "PETSC support not included, running on 1 cpu only!"
+-		cluster.np=1
+-
+-	#Stop here if batch mode
+-	if strcmpi(options['batch'],'yes'):
+-		print 'batch mode requested: not launching job interactively'
+-		print 'launch solution sequence on remote cluster by hand'
+-		return md
+-
+-	#Launch job
+-	modelname = md.miscellaneous.name
+-	filelist  = [modelname+'.bin ',modelname+'.petsc ',modelname+'.queue ']
+-	if md.qmu.isdakota:
+-		filelist.append(modelname+'.qmu.in')
+-	cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist)
+-
+-	#did we even try to run? if so, wait on lock
+-	if strcmpi(options['upload'],'on'):
+-		print 'solve done uploading test decks'
+-		return md
+-
+-	#wait on lock
+-	if md.settings.waitonlock>0:
+-		#we wait for the done file
+-		islock=waitonlock(md)
+-		if islock==0:    #no results to be loaded
+-			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
+-		else:            #load results
+-			print 'loading results from cluster'
+-			md=loadresultsfromcluster(md)
+-
+-	#post processes qmu results if necessary
+-	if md.qmu.isdakota:
+-		if not strncmpi(options['keep'],'y',1):
+-			shutil.rmtree('qmu'+str(os.getpid()))
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.m	(revision 13009)
+@@ -1,260 +0,0 @@
+-function WriteData(fid,varargin)
+-%WRITEDATA - write model field in binary file
+-%
+-%   Usage:
+-%      WriteData(fid,varargin);
+-
+-%process options
+-options=pairoptions(varargin{:});
+-
+-%Get data properties
+-if exist(options,'object');
+-	%This is a object field, construct enum and data
+-	obj       = getfieldvalue(options,'object');
+-	fieldname = getfieldvalue(options,'fieldname');
+-	classname = class(obj);
+-
+-	enum      = BuildEnum([classname '_' fieldname]);
+-	data      = obj.(fieldname);
+-else
+-	%No processing required
+-	data = getfieldvalue(options,'data');
+-	enum = getfieldvalue(options,'enum');
+-end
+-format  = getfieldvalue(options,'format');
+-mattype = getfieldvalue(options,'mattype',0);    %only required for matrices
+-
+-%Process sparse matrices
+-if issparse(data),
+-	data=full(data);
+-end
+-
+-%Step 1: write the enum to identify this record uniquely
+-fwrite(fid,enum,'int'); 
+-
+-%Step 2: write the data itself.
+-if     strcmpi(format,'Boolean'),% {{{
+-	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
+-
+-	%first write length of record
+-	fwrite(fid,4+4,'int');  %1 bool (disguised as an int)+code
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%now write integer
+-	fwrite(fid,data,'int');  %send an int, not easy to send a bool
+-	% }}}
+-elseif strcmpi(format,'Integer'), % {{{
+-	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
+-
+-	%first write length of record
+-	fwrite(fid,4+4,'int');  %1 integer + code
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%now write integer
+-	fwrite(fid,data,'int'); 
+-	% }}}
+-elseif strcmpi(format,'Double'), % {{{
+-	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
+-
+-	%first write length of record
+-	fwrite(fid,8+4,'int');  %1 double+code
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%now write double
+-	fwrite(fid,data,'double'); 
+-	% }}}
+-elseif strcmpi(format,'String'), % {{{
+-	%first write length of record
+-	fwrite(fid,length(data)+4+4,'int');  %string + string size + code
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%now write string
+-	fwrite(fid,length(data),'int'); 
+-	fwrite(fid,data,'char'); 
+-	% }}}
+-elseif strcmpi(format,'BooleanMat'), % {{{
+-
+-	%Get size
+-	s=size(data);
+-	%if matrix = NaN, then do not write anything
+-	if (s(1)==1 & s(2)==1 & isnan(data)),
+-		s(1)=0; s(2)=0;
+-	end
+-
+-	%first write length of record
+-	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
+-
+-	%write data code and matrix type: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-	fwrite(fid,mattype,'int');
+-
+-	%now write matrix
+-	fwrite(fid,s(1),'int'); 
+-	fwrite(fid,s(2),'int'); 
+-	if s(1)*s(2),
+-		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
+-	end
+-	% }}}
+-elseif strcmpi(format,'IntMat'), % {{{
+-
+-	%Get size
+-	s=size(data);
+-	%if matrix = NaN, then do not write anything
+-	if (s(1)==1 & s(2)==1 & isnan(data)),
+-		s(1)=0; s(2)=0;
+-	end
+-
+-	%first write length of record
+-	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
+-
+-	%write data code and matrix type: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-	fwrite(fid,mattype,'int');
+-
+-	%now write matrix
+-	fwrite(fid,s(1),'int'); 
+-	fwrite(fid,s(2),'int'); 
+-	if s(1)*s(2),
+-		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
+-	end
+-	% }}}
+-elseif strcmpi(format,'DoubleMat'), % {{{
+-
+-	%Get size
+-	s=size(data);
+-	%if matrix = NaN, then do not write anything
+-	if (s(1)==1 & s(2)==1 & isnan(data)),
+-		s(1)=0; s(2)=0;
+-	end
+-
+-	%first write length of record
+-	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
+-
+-	%write data code and matrix type: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-	fwrite(fid,mattype,'int');
+-
+-	%now write matrix
+-	fwrite(fid,s(1),'int'); 
+-	fwrite(fid,s(2),'int'); 
+-	if s(1)*s(2),
+-		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
+-	end
+-	% }}}
+-elseif strcmpi(format,'MatArray'), % {{{
+-
+-	numrecords=numel(data);
+-
+-	%first get length of record
+-	recordlength=4+4; %number of records + code
+-	for i=1:numrecords,
+-		matrix=data{i};
+-		s=size(matrix);
+-		recordlength=recordlength+4*2+... %row and col of matrix
+-			s(1)*s(2)*8; %matrix of doubles
+-	end
+-
+-	%write length of record
+-	fwrite(fid,recordlength,'int'); 
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%write data, first number of records
+-	fwrite(fid,numrecords,'int'); 
+-
+-	%write each matrix: 
+-	for i=1:numrecords,
+-		matrix=data{i};
+-		s=size(matrix);
+-		fwrite(fid,s(1),'int'); 
+-		fwrite(fid,s(2),'int'); 
+-		fwrite(fid,matrix','double');
+-	end
+-	% }}}
+-elseif strcmpi(format,'StringArray'), % {{{
+-
+-	%first get length of string array: 
+-	num=numel(data);
+-	%now get length of record: 
+-	recordlength=4+4; %for length of array + code
+-	for i=1:num,
+-		string=data{i};
+-		recordlength=recordlength+4+length(string); %for each string
+-	end
+-
+-	%write length of record
+-	fwrite(fid,recordlength,'int'); 
+-
+-	%write data code: 
+-	fwrite(fid,FormatToCode(format),'int'); 
+-
+-	%now write length of string array
+-	fwrite(fid,num,'int'); 
+-
+-	%now write the strings
+-	for i=1:num,
+-		string=data{i};
+-		fwrite(fid,length(string),'int'); 
+-		fwrite(fid,string,'char'); 
+-	end
+-	% }}}
+-else  % {{{
+-	error(['WriteData error message: data type: ' num2str(format) ' not supported yet! (' EnumToString(enum) ')']);
+-end % }}}
+-end
+-
+-function enum=BuildEnum(string) % {{{
+-%BUILDENUM - build enum out of string
+-%
+-%   Usage:
+-%      enum=BuildEnum(string)
+-
+-	if findstr(string,'_'),
+-		indices=findstr(string,'_');
+-		for i=1:length(indices),
+-			string(indices(i)+1)=upper(string(indices(i)+1));
+-		end
+-		string(indices)=[];
+-	end
+-
+-	%take first letter of string and make it uppercase: 
+-	string(1)=upper(string(1));
+-
+-	%Get Enum
+-	enum=eval([string 'Enum();']); 
+-end % }}}
+-function code=FormatToCode(format) % {{{
+-%This routine takes the format string, and hardcodes it into an integer, which 
+-%is passed along the record, in order to identify the nature of the dataset being 
+-%sent.
+-	if     strcmpi(format,'Boolean'),
+-		code=1;
+-	elseif strcmpi(format,'Integer'), 
+-		code=2;
+-	elseif strcmpi(format,'Double'), 
+-		code=3;
+-	elseif strcmpi(format,'String'), 
+-		code=4;
+-	elseif strcmpi(format,'BooleanMat'),
+-		code=5;
+-	elseif strcmpi(format,'IntMat'),
+-		code=6;
+-	elseif strcmpi(format,'DoubleMat'),
+-		code=7;
+-	elseif strcmpi(format,'MatArray'), 
+-		code=8;
+-	elseif strcmpi(format,'StringArray'),
+-		code=9;
+-	else 
+-		error('FormatToCode error message: data type not supported yet!');
+-	end
+-end% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.m	(revision 13009)
+@@ -1,60 +0,0 @@
+-function md=loadresultsfromcluster(md,runtimename)
+-%LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
+-%
+-%   Usage:
+-%      md=loadresultsfromcluster(md,runtimename);
+-
+-%retrieve cluster, to be able to call its methods
+-cluster=md.cluster;
+-
+-if nargin==2,
+-	md.private.runtimename=runtimename;
+-end
+-
+-%Download outputs from the cluster
+-filelist={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
+-if md.qmu.isdakota,
+-	filelist{end+1}=[md.miscellaneous.name '.qmu.err'];
+-	filelist{end+1}=[md.miscellaneous.name '.qmu.out'];
+-	if isfield(md.qmu.params,'tabular_graphics_data'),
+-		if md.qmu.params.tabular_graphics_data==true,
+-			filelist{end+1}='dakota_tabular.dat';
+-		end
+-	end
+-else
+-	filelist{end+1}=[md.miscellaneous.name '.outbin'];
+-end
+-Download(cluster,md.private.runtimename,filelist);
+-
+-%If we are here, no errors in the solution sequence, call loadresultsfromdisk.
+-md=loadresultsfromdisk(md,[md.miscellaneous.name '.outbin']);
+-
+-%erase the log and output files
+-if md.qmu.isdakota,
+-	delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.outlog']);
+-	delete([['qmu' num2str(feature('GetPid')) '/']  md.miscellaneous.name '.errlog']);
+-else
+-	delete([md.miscellaneous.name '.outlog']);
+-	delete([md.miscellaneous.name '.errlog']);
+-	delete([md.miscellaneous.name '.outbin']);
+-	if ~ispc,
+-		delete([md.private.runtimename '.tar.gz']);
+-	end
+-end
+-
+-%erase input file if run was carried out on same platform.
+-hostname=oshostname();
+-if strcmpi(hostname,cluster.name),
+-	if md.qmu.isdakota,
+-		delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.bin']);
+-		delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.queue']);
+-	else
+-		delete([md.miscellaneous.name '.bin']);
+-		delete([md.miscellaneous.name '.petsc']);
+-		if ~ispc,
+-			delete([md.miscellaneous.name '.queue']);
+-		else
+-			delete([md.miscellaneous.name '.bat']);
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.py	(revision 13009)
+@@ -1,235 +0,0 @@
+-import struct
+-import numpy
+-from MatlabFuncs import *
+-from MatlabProcessPatch import *
+-
+-def parseresultsfromdisk(filename,iosplit):
+-	"""
+-	PARSERESULTSFROMDISK - ...
+-
+-	   Usage:
+-	      results=parseresultsfromdisk(filename,iosplit)
+-	"""
+-
+-	if iosplit:
+-		results=parseresultsfromdiskiosplit(filename)
+-	else:
+-		results=parseresultsfromdiskioserial(filename)
+-
+-	#process patch if necessary
+-	results=MatlabProcessPatch(results)
+-
+-	return results
+-
+-def parseresultsfromdiskioserial(filename):    # {{{
+-	"""
+-	PARSERESULTSFROMDISK - ...
+-	 
+-	    Usage:
+-	       results=parseresultsfromdiskioserial(filename)
+-	"""
+-
+-	#Open file
+-	try:
+-		fid=open(filename,'rb')
+-	except IOError as e:
+-		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
+-
+-	results={}
+-
+-	#Read fields until the end of the file.
+-	result=ReadData(fid)
+-	while result:
+-		#Get time and step
+-		if not result['step'] in results:
+-			results[result['step']]={}
+-			results[result['step']]['step']=result['step']
+-			results[result['step']]['time']=result['time'] 
+-	
+-		#Add result
+-		if result['step'] in results and \
+-		   result['fieldname'] in results[result['step']] and \
+-		   not strcmp(result['fieldname'],'SolutionType'):
+-			results[result['step']][result['fieldname']]=numpy.concatenate((results[result['step']][result['fieldname']],result['field']),axis=0)
+-		else:
+-			results[result['step']][result['fieldname']]=result['field']
+-
+-		#read next result
+-		result=ReadData(fid)
+-
+-	fid.close()
+-
+-	return results
+-	# }}}
+-
+-def parseresultsfromdiskiosplit(filename):    # {{{
+-	"""
+-	PARSERESULTSFROMDISKIOSPLIT - ...
+-	 
+-	    Usage:
+-	       results=parseresultsfromdiskiosplit(filename)
+-	"""
+-
+-	#Open file
+-	try:
+-		fid=open(filename,'rb')
+-	except IOError as e:
+-		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
+-
+-	results={}
+-
+-	#if we have done split I/O, ie, we have results that are fragmented across patches, 
+-	#do a first pass, and figure out the structure of results
+-	result=ReadDataDimensions(fid)
+-	while result:
+-
+-		#Get time and step
+-		if not result['step'] in results:
+-			results[result['step']]={}
+-			results[result['step']]['step']=result['step']
+-			results[result['step']]['time']=result['time'] 
+-
+-		#Add result
+-		if strcmpi(result['fieldname'],'Patch'):
+-			results[result['step']][result['fieldname']]=[0,result['N']]
+-		else:
+-			results[result['step']][result['fieldname']]=float('NaN')
+-
+-		#read next result
+-		result=ReadDataDimensions(fid)
+-
+-	#do a second pass, and figure out the size of the patches
+-	fid.seek(0)    #rewind
+-	result=ReadDataDimensions(fid)
+-	while result:
+-
+-		#Add result
+-		if strcmpi(result['fieldname'],'Patch'):
+-			patchdimensions=results[result['step']][result['fieldname']]
+-			results[result['step']][result['fieldname']]=[patchdimensions[0]+result['M'],result['N']]
+-
+-		#read next result
+-		result=ReadDataDimensions(fid)
+-
+-	#allocate patches
+-	for result in results.itervalues():
+-		if 'Patch' in result:
+-			result['Patch']=numpy.zeros(shape=(result['Patch'][0],result['Patch'][1]),dtype=float)
+-			result['counter']=0    #use to index into the patch
+-
+-	#third pass, this time to read the real information
+-	fid.seek(0)    #rewind
+-	result=ReadData(fid)
+-	while result:
+-
+-		#Get time and step
+-		if not result['step'] in results:
+-			results[result['step']]={}
+-			results[result['step']]['step']=result['step']
+-			results[result['step']]['time']=result['time'] 
+-
+-		#Add result
+-		if strcmpi(result['fieldname'],'Patch'):
+-			counter=results[result['step']]['counter']
+-			counter2=counter+result['field'].shape[0]-1
+-			results[result['step']][result['fieldname']][counter:counter2,:]=result['field']
+-
+-			#increment counter: 
+-			results[result['step']]['counter']=counter2+1
+-		else:
+-			results[result['step']][result['fieldname']]=result['field']
+-
+-		#read next result
+-		result=ReadData(fid)
+-
+-	#close file
+-	fid.close()
+-
+-	return results
+-	# }}}
+-
+-def ReadData(fid):    # {{{
+-	"""
+-	READDATA - ...
+-	 
+-	    Usage:
+-	       field=ReadData(fid)
+-	"""
+-
+-	#read field
+-	try:
+-		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-
+-		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
+-		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
+-		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-
+-		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-		if   type==1:
+-			field=numpy.array(struct.unpack('%dd' % M,fid.read(M*struct.calcsize('d'))),dtype=float)
+-		elif type==2:
+-			field=struct.unpack('%ds' % M,fid.read(M))[0][:-1]
+-		elif type==3:
+-			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-#			field=transpose(fread(fid,[N M],'double'));
+-			field=numpy.zeros(shape=(M,N),dtype=float)
+-			for i in xrange(M):
+-				field[i,:]=struct.unpack('%dd' % N,fid.read(N*struct.calcsize('d')))
+-		else:
+-			raise TypeError("cannot read data of type %d" % type)
+-
+-		result={}
+-		result['fieldname']=fieldname
+-		result['time']=time
+-		result['step']=step
+-		result['field']=field
+-
+-	except struct.error as e:
+-		result={}
+-
+-	return result
+-	# }}}
+-
+-def ReadDataDimensions(fid):    # {{{
+-	"""
+-	READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
+-	 
+-	    Usage:
+-	       field=ReadDataDimensions(fid)
+-	"""
+-
+-	#read field
+-	try:
+-		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-
+-		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
+-		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
+-		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-
+-		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-		N=1    #default
+-		if   type==1:
+-			fid.seek(M*8,1)
+-		elif type==2:
+-			fid.seek(M,1)
+-		elif type==3:
+-			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+-			fid.seek(N*M*8,1)
+-		else:
+-			raise TypeError("cannot read data of type %d" % type)
+-
+-		result={}
+-		result['fieldname']=fieldname
+-		result['time']=time
+-		result['step']=step
+-		result['M']=M
+-		result['N']=N
+-
+-	except struct.error as e:
+-		result={}
+-
+-	return result
+-	# }}}
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/solve.m	(revision 13009)
+@@ -1,121 +0,0 @@
+-function md=solve(md,solutionenum,varargin)
+-%SOLVE - apply solution sequence for this model
+-%
+-%   Usage:
+-%      md=solve(md,solutionenum,varargin)
+-%      where varargin is a lit of paired arguments of string OR enums
+-%
+-%   solution types available comprise:
+-%		 - DiagnosticSolutionEnum
+-%		 - PrognosticSolutionEnum
+-%		 - ThermalSolutionEnum
+-%		 - SteadystateSolutionEnum
+-%		 - TransientSolutionEnum...
+-%		 - BalancethicknessSolutionEnum
+-%		 - BedSlopeSolutionEnum
+-%		 - SurfaceSlopeSolutionEnum
+-%		 - HydrologySolutionEnum
+-%		 - FlaimSolutionEnum
+-%
+-%  extra options:
+-%      - loadonly : does not solve. only load results
+-%
+-%   Examples:
+-%      md=solve(md,DiagnosticSolutionEnum);
+-
+-%recover and process solve options
+-options=pairoptions(varargin{:},'solution_type',solutionenum);
+-options=process_solve_options(options);
+-
+-%recover some fields
+-md.private.solution=options.solution_type;
+-cluster=md.cluster;
+-
+-%check model consistency
+-disp('checking model consistency');
+-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
+-
+-%First, build a runtime name that is unique
+-c=clock;
+-md.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',md.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
+-
+-%if running qmu analysis, some preprocessing of dakota files using models
+-%fields needs to be carried out. 
+-if md.qmu.isdakota,
+-	md=preqmu(md,options);
+-end
+-
+-%flaim analysis
+-if (options.solution_type == FlaimSolutionEnum)
+-	md=flaim_sol(md,options);
+-	md.private.solution=EnumToString(options.solution_type);
+-	return;
+-end
+-
+-%Do we load results only?
+-if options.loadonly,  
+-	md=loadresultsfromcluster(md);
+-	return;
+-end
+-
+-%we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+-if ~ispetsc,
+-	disp('PETSC support not included, running on 1 cpu only!');
+-	cluster.np=1;
+-end
+-
+-
+-%Wite all input files
+-marshall(md);                                          % bin file
+-PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file
+-BuildQueueScript(cluster,md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); % queue file
+-
+-
+-%Stop here if batch mode
+-if strcmpi(options.batch,'yes')
+-	disp('batch mode requested: not launching job interactively');
+-	disp('launch solution sequence on remote cluster by hand');
+-	return;
+-end
+-
+-%Launch job
+-modelname = md.miscellaneous.name;
+-filelist  = {[modelname '.bin '] [modelname '.petsc '] [modelname '.queue ']};
+-if md.qmu.isdakota,
+-	filelist{end+1} = [modelname '.qmu.in'];
+-end
+-LaunchQueueJob(cluster,md.miscellaneous.name,md.private.runtimename,filelist);
+-
+-%did we even try to run? if so, wait on lock
+-if strcmpi(options.upload,'on'),
+-	disp('solve done uploading test decks');
+-	return;
+-end
+-
+-%wait on lock
+-if md.settings.waitonlock>0,
+-	%we wait for the done file
+-	islock=waitonlock(md);
+-	if islock==0, %no results to be loaded
+-		disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
+-	else          %load results
+-		disp('loading results from cluster');
+-		md=loadresultsfromcluster(md);
+-	end
+-end
+-
+-%post processes qmu results if necessary
+-if md.qmu.isdakota,
+-	if ~strncmpi(options.keep,'y',1)
+-		system(['rm -rf qmu' num2str(feature('GetPid'))]);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/parseresultsfromdisk.m	(revision 13009)
+@@ -1,212 +0,0 @@
+-function results=parseresultsfromdisk(filename,iosplit)
+-%PARSERESULTSFROMDISK - ...
+-%
+-%   Usage:
+-%      results=parseresultsfromdisk(filename,iosplit)
+-
+-if iosplit,
+-	results=parseresultsfromdiskiosplit(filename);
+-else
+-	results=parseresultsfromdiskioserial(filename);
+-end
+-
+-%process patch if necessary
+-results=MatlabProcessPatch(results);
+-
+-function results=parseresultsfromdiskioserial(filename) % {{{
+-%PARSERESULTSFROMDISK - ...
+-%
+-%   Usage:
+-%      results=parseresultsfromdiskioserial(filename)
+-
+-
+-%Open file
+-fid=fopen(filename,'rb');
+-if(fid==-1),
+-	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
+-end
+-results=struct();
+-
+-%Read fields until the end of the file.
+-result=ReadData(fid);
+-while ~isempty(result), 
+-	%Get time and step
+-	results(result.step).step=result.step;
+-	results(result.step).time=result.time; 
+-
+-	%Add result
+-	if (length(results)>=result.step & isfield(results,result.fieldname) & ~strcmp(result.fieldname,'SolutionType')),
+-			results(result.step).(result.fieldname)=[ results(result.step).(result.fieldname); result.field];
+-	else
+-		results(result.step).(result.fieldname)=result.field;
+-	end
+-
+-	%read next result
+-	result=ReadData(fid);
+-
+-end
+-
+-fclose(fid);
+-% }}}
+-function results=parseresultsfromdiskiosplit(filename) % {{{
+-%PARSERESULTSFROMDISKIOSPLIT - ...
+-%
+-%   Usage:
+-%      results=parseresultsfromdiskiosplit(filename)
+-
+-
+-%Open file
+-fid=fopen(filename,'rb');
+-if(fid==-1),
+-	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
+-end
+-results=struct();
+-
+-%if we have done split I/O, ie, we have results that are fragmented across patches, 
+-%do a first pass, and figure out the structure of results
+-result=ReadDataDimensions(fid);
+-while ~isempty(result),
+-
+-	%Get time and step
+-	results(result.step).step=result.step;
+-	results(result.step).time=result.time; 
+-
+-	%Add result
+-	if strcmpi(result.fieldname,'Patch'),
+-		results(result.step).(result.fieldname)=[0 result.N];
+-	else
+-		results(result.step).(result.fieldname)=NaN;
+-	end
+-
+-	%read next result
+-	result=ReadDataDimensions(fid);
+-end
+-
+-%do a second pass, and figure out the size of the patches
+-fseek(fid,0,-1); %rewind
+-result=ReadDataDimensions(fid);
+-while ~isempty(result),
+-
+-	%Add result
+-	if strcmpi(result.fieldname,'Patch'),
+-		patchdimensions=results(result.step).(result.fieldname);
+-		results(result.step).(result.fieldname)=[patchdimensions(1)+result.M result.N];
+-	end
+-
+-	%read next result
+-	result=ReadDataDimensions(fid);
+-end
+-
+-%allocate patches
+-for i=1:length(results),
+-	results(i).Patch=zeros(results(i).Patch(1),results(i).Patch(2));
+-	results(i).counter=1; %use to index into the patch
+-end
+-
+-%third pass, this time to read the real information
+-fseek(fid,0,-1); %rewind
+-result=ReadData(fid);
+-while ~isempty(result),
+-
+-	%Get time and step
+-	results(result.step).step=result.step;
+-	results(result.step).time=result.time; 
+-
+-	%Add result
+-	if strcmpi(result.fieldname,'Patch'),
+-		counter=results(result.step).counter;
+-		counter2=counter+size(result.field,1)-1;
+-		results(result.step).(result.fieldname)(counter:counter2,:)=result.field;
+-
+-		%increment counter: 
+-		results(result.step).counter=counter2+1;
+-	else
+-		results(result.step).(result.fieldname)=result.field;
+-	end
+-
+-	%read next result
+-	result=ReadData(fid);
+-
+-end
+-
+-%close file
+-fclose(fid);
+-	% }}}
+-function result=ReadData(fid) % {{{
+-%READDATA - ...
+-%
+-%   Usage:
+-%      field=ReadData(fid)
+-
+-%read field
+-[length,count]=fread(fid,1,'int');
+-
+-if count==0,
+-	result=struct([]);
+-else
+-	fieldname=fread(fid,length,'char');
+-	fieldname=fieldname(1:end-1)';
+-	fieldname=char(fieldname);
+-	time=fread(fid,1,'double');
+-	step=fread(fid,1,'int');
+-
+-	type=fread(fid,1,'int');
+-	M=fread(fid,1,'int');
+-	if type==1,
+-		field=fread(fid,M,'double');
+-	elseif type==2,
+-		field=fread(fid,M,'char');
+-		field=char(field(1:end-1)');
+-	elseif type==3,
+-		N=fread(fid,1,'int');
+-		field=transpose(fread(fid,[N M],'double'));
+-	else
+-		error(['cannot read data of type ' num2str(type) ]);
+-	end
+-
+-	result.fieldname=fieldname;
+-	result.time=time;
+-	result.step=step;
+-	result.field=field;
+-end
+-% }}}
+-function result=ReadDataDimensions(fid) % {{{
+-%READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
+-%
+-%   Usage:
+-%      field=ReadDataDimensions(fid)
+-
+-
+-%read field
+-[length,count]=fread(fid,1,'int');
+-
+-if count==0,
+-	result=struct([]);
+-else
+-	fieldname=fread(fid,length,'char');
+-	fieldname=fieldname(1:end-1)';
+-	fieldname=char(fieldname);
+-	time=fread(fid,1,'double');
+-	step=fread(fid,1,'int');
+-
+-	type=fread(fid,1,'int');
+-	M=fread(fid,1,'int');
+-	N=1; %default
+-	if type==1,
+-		fseek(fid,M*8,0);
+-	elseif type==2,
+-		fseek(fid,M,0);
+-	elseif type==3,
+-		N=fread(fid,1,'int');
+-		fseek(fid,N*M*8,0);
+-	else
+-		error(['cannot read data of type ' num2str(type) ]);
+-	end
+-
+-	result.fieldname=fieldname;
+-	result.time=time;
+-	result.step=step;
+-	result.M=M;
+-	result.N=N;
+-end
+-% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.py	(revision 13009)
+@@ -1,60 +0,0 @@
+-import os
+-
+-def loadresultsfromdisk(md,filename):
+-	"""
+-	LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
+- 
+-	   Usage:
+-	      md=loadresultsfromdisk(md=False,filename=False);
+-	"""
+-
+-	#check number of inputs/outputs
+-	if not md or not filename:
+-		raise ValueError("loadresultsfromdisk: error message.")
+-
+-	if not md.qmu.isdakota:
+-
+-		#Check that file exists
+-		if not os.path.exists(filename):
+-			raise ValueError("binary file '%s' not found." % filename)
+-
+-		#initialize md.results if not a structure yet
+-		if not isinstance(md.results,dict):
+-			md.results={}
+-
+-		#load results onto model
+-		structure=parseresultsfromdisk(filename,~md.settings.io_gather)
+-		if not len(structure):
+-			raise RuntimeError("No result found in binary file '%s'. Check for solution crash." % filename)
+-		end
+-		md.results[structure[1]['SolutionType']]=structure;
+-
+-		#recover solution_type from results
+-		md.private.solution=structure[1]['SolutionType']
+-
+-		#read log files onto fields
+-		if os.path.exists(md.miscellaneous.name+'.errlog'):
+-			with open(md.miscellaneous.name+'.errlog','r') as f:
+-				md.results[structure[1]['SolutionType']]['errlog']=[line[:-1] for line in f]
+-		else:
+-			md.results[structure[1]['SolutionType']]['errlog']=[]
+-
+-		if os.path.exists(md.miscellaneous.name+'.outlog'):
+-			with open(md.miscellaneous.name+'.outlog','r') as f:
+-				md.results[structure[1]['SolutionType']]['outlog']=[line[:-1] for line in f]
+-		else:
+-			md.results[structure[1]['SolutionType']]['outlog']=[]
+-
+-		if len(md.results[structure[1]['SolutionType']]['errlog']):
+-			print ("loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields.")
+-
+-	#post processes qmu results if necessary
+-	else:
+-
+-		if not isinstance(md.private.solution,str):
+-			md.private.solution=EnumToString(md.private.solution)
+-		md=postqmu(md)
+-		os.chdir('..')
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.py	(revision 13009)
+@@ -1,48 +0,0 @@
+-import os
+-from EnumDefinitions import *
+-
+-def process_solve_options(options):
+-	"""
+-	DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
+- 
+-	   Usage:
+-	      options=process_solve_options(options)
+- 
+-	   See also: SOLVE
+-	"""
+-
+-	outoptions={}
+-
+-	#solution_type: check on this option, error out otherwise
+-	solution_type=options.getfieldvalue('solution_type')
+-	if not solution_type in (DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,\
+-			SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,\
+-			BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum):
+-		raise ValueError("process_solve_options error message: solution_type '%s' not supported yet!" % EnumToString(solution_type))
+-	outoptions['solution_type']=solution_type
+-
+-	outoptions['upload']=options.getfieldvalue('upload','off')
+-	outoptions['batch']=options.getfieldvalue('batch','no')
+-	outoptions['loadonly']=options.getfieldvalue('loadonly',False)
+-	outoptions['directory']=options.getfieldvalue('directory','')
+-
+-	#  process qmu arguments
+-	outoptions['qmudir']=options.getfieldvalue('qmudir','qmu'+str(os.getpid()))
+-	outoptions['qmufile']=options.getfieldvalue('qmufile','qmu')    # qmufile cannot be changed unless ????script.sh is also changed
+-	outoptions['overwrite']=options.getfieldvalue('overwrite','n')
+-	outoptions['keep']=options.getfieldvalue('keep','n')
+-	outoptions['ivar']=options.getfieldvalue('ivar',1)
+-	outoptions['iresp']=options.getfieldvalue('iresp',1)
+-	outoptions['imethod']=options.getfieldvalue('imethod',1)
+-	outoptions['iparams']=options.getfieldvalue('iparams',1)
+-	outoptions['runmpi']=options.getfieldvalue('runmpi',False)
+-
+-	#  process flaim arguments
+-	outoptions['fmdir']=options.getfieldvalue('fmdir','fm'+str(os.getpid()))
+-	outoptions['overwrite']=options.getfieldvalue('overwrite','n')
+-	outoptions['keep']=options.getfieldvalue('keep','y')
+-	outoptions['latsgn']=options.getfieldvalue('latsgn',0)
+-	outoptions['cmap']=options.getfieldvalue('cmap',[])
+-
+-	return outoptions
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.py	(revision 13009)
+@@ -1,47 +0,0 @@
+-from WriteData import *
+-
+-def marshall(md):
+-	"""
+-	MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
+-
+-	   The routine creates a compatible binary file from @model md
+-	   This binary file will be used for parallel runs in JPL-package
+-
+-	   Usage:
+-	      marshall(md)
+-	"""
+-
+-	print "marshalling file '%s.bin'." % md.miscellaneous.name
+-
+-	#open file for binary writing
+-	try:
+-		fid=open(md.miscellaneous.name+'.bin','wb')
+-	except IOError as e:
+-		raise IOError("marshall error message: could not open '%s.bin' file for binary writing." % md.miscellaneous.name)
+-
+-	#First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
+-	WriteData(fid,'enum',MaximumNumberOfEnums(),'data',True,'format','Boolean')
+-
+-	#Go through all model fields: check that it is a class and call checkconsistency
+-	fields=vars(md)
+-
+-	for field in fields.iterkeys():
+-
+-		#Some properties do not need to be marshalled
+-		if field in ['results','radaroverlay','solver','cluster','flaim','private']:
+-			continue
+-
+-		#Check that current field is an object
+-		if not hasattr(getattr(md,field),'marshall'):
+-			raise TypeError("field '%s' is not an object." % field)
+-
+-		#Marshall current object
+-		#print "marshalling %s ..." % field
+-		exec("md.%s.marshall(fid)" % field)
+-
+-	#close file
+-	try:
+-		f.close(fid)
+-	except IOError as e:
+-		raise IOError("marshall error message: could not close file '%s.bin'." % md.miscellaneous.name)
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromdisk.m	(revision 13009)
+@@ -1,61 +0,0 @@
+-function md=loadresultsfromdisk(md,filename)
+-%LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
+-%
+-%   Usage:
+-%      md=loadresultsfromdisk(md,filename);
+-
+-%check number of inputs/outputs
+-if ((nargin~=2) | (nargout~=1)),
+-	help loadresultsfromdisk;
+-	error('loadresultsfromdisk: error message.');
+-end
+-
+-if ~md.qmu.isdakota,
+-
+-	%Check that file exists
+-	if ~exist(filename,'file'),
+-		error(['binary file ' filename ' not found.']);
+-	end
+-
+-	%initialize md.results if not a structure yet
+-	if ~isstruct(md.results),
+-		md.results=struct();
+-	end
+-
+-	%load results onto model
+-	structure=parseresultsfromdisk(filename,~md.settings.io_gather);
+-	if isempty(fieldnames(structure)),
+-		error(['No result found in binary file ' filename '. Check for solution crash.']);
+-	end
+-	md.results.(structure(1).SolutionType)=structure;
+-
+-	%recover solution_type from results
+-	md.private.solution=structure(1).SolutionType;
+-
+-	%read log files onto  fields
+-	if exist([md.miscellaneous.name '.errlog'],'file'),
+-		md.results.(structure(1).SolutionType)(1).errlog=char(textread([md.miscellaneous.name '.errlog'],'%s','delimiter','\n'));
+-	else
+-		md.results.(structure(1).SolutionType)(1).errlog='';
+-	end
+-
+-	if exist([md.miscellaneous.name '.outlog'],'file'),
+-		md.results.(structure(1).SolutionType)(1).outlog=char(textread([md.miscellaneous.name '.outlog'],'%s','delimiter','\n'));
+-	else
+-		md.results.(structure(1).SolutionType)(1).outlog='';
+-	end
+-
+-	if ~isempty(md.results.(structure(1).SolutionType)(1).errlog),
+-		disp(['loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields']);
+-	end
+-
+-
+-%post processes qmu results if necessary
+-else
+-
+-	if isscalar(md.private.solution),
+-		md.private.solution=EnumToString(md.private.solution);
+-	end
+-	md=postqmu(md);
+-	cd ..
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/process_solve_options.m	(revision 13009)
+@@ -1,39 +0,0 @@
+-function outoptions=process_solve_options(options)
+-%DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
+-%
+-%   Usage:
+-%      options=process_solve_options(options)
+-%
+-%   See also: SOLVE
+-
+-%solution_type: check on this option, error out otherwise
+-solution_type=getfieldvalue(options,'solution_type');
+-if ~ismember(solution_type,[DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,...
+-		SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,...
+-		BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum]),
+-	error(['process_solve_options error message: solution_type ' EnumToString(solution_type) ' not supported yet!']);
+-end
+-outoptions.solution_type=solution_type;
+-
+-outoptions.upload=getfieldvalue(options,'upload','off');
+-outoptions.batch=getfieldvalue(options,'batch','no');
+-outoptions.loadonly=getfieldvalue(options,'loadonly',false);
+-outoptions.directory=getfieldvalue(options,'directory','');
+-
+-%  process qmu arguments
+-outoptions.qmudir=getfieldvalue(options,'qmudir',['qmu' num2str(feature('GetPid'))]);  % qmudir =['qmu_' datestr(now,'yyyymmdd_HHMMSS')];
+-outoptions.qmufile=getfieldvalue(options,'qmufile','qmu');% qmufile cannot be changed unless ????script.sh is also changed
+-outoptions.overwrite=getfieldvalue(options,'overwrite','n');
+-outoptions.keep=getfieldvalue(options,'keep','n');
+-outoptions.ivar=getfieldvalue(options,'ivar',1);
+-outoptions.iresp=getfieldvalue(options,'iresp',1);
+-outoptions.imethod=getfieldvalue(options,'imethod',1);
+-outoptions.iparams=getfieldvalue(options,'iparams',1);
+-outoptions.runmpi=getfieldvalue(options,'runmpi',false);
+-
+-%  process flaim arguments
+-outoptions.fmdir=getfieldvalue(options,'fmdir',['fm' num2str(feature('GetPid'))]);
+-outoptions.overwrite=getfieldvalue(options,'overwrite','n');
+-outoptions.keep=getfieldvalue(options,'keep','y');
+-outoptions.latsgn=getfieldvalue(options,'latsgn',0);
+-outoptions.cmap=getfieldvalue(options,'cmap',[]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadmultipleresultsfromcluster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadmultipleresultsfromcluster.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadmultipleresultsfromcluster.m	(revision 13009)
+@@ -1,34 +0,0 @@
+-function md_list=loadmultipleresultsfromcluster(md_list)
+-%LOADMULTIPLERESULTSFROMCLUSTER - load multiple results of solution sequences from cluster
+-%
+-%   Usage:
+-%      md_list=loadresultsfromcluster(md_list);
+-
+-nummodels=length(md_list);
+-
+-%Get cluster settings
+-cluster=md_list{1}.cluster;
+-name=md_list{1}.name;
+-cluster_rc_location=which('cluster.rc');
+-[codepath,executionpath,login]=ClusterParameters(cluster,cluster_rc_location);
+-
+-%Remote tar: 
+-disp('tarring results');
+-issmssh(cluster,['"cd ' executionpath ' && rm -rf file_list.txt ModelResults.tar.gz && find -iname ''*_*vs*.outbin'' > file_list.txt && tar zcvf ModelResults.tar.gz --files-from file_list.txt  && rm -rf file_list.txt "']);
+-
+-%copy results from cluster to present directory
+-scpin(cluster, executionpath, {'ModelResults.tar.gz'});
+-
+-%untar:
+-!tar -zxvf ModelResults.tar.gz
+-
+-%ok, go through list and load results from disk: 
+-for i=1:nummodels,
+-	%load  results for this model
+-	md_list{i}=loadresultsfromdisk(md_list{i},[md_list{i}.name '.outbin']);
+-
+-	delete([name '.outbin']);
+-end
+-
+-%erase files 
+-delete('ModelResults.tar.gz');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/marshall.m	(revision 13009)
+@@ -1,49 +0,0 @@
+-function marshall(md)
+-%MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
+-%
+-%   The routine creates a compatible binary file from @model md
+-%   This binary file will be used for parallel runs in JPL-package
+-%
+-%   Usage:
+-%      marshall(md)
+-
+-disp(['marshalling file ' md.miscellaneous.name '.bin']);
+-
+-%open file for binary writing
+-fid=fopen([ md.miscellaneous.name '.bin'],'wb');
+-if fid==-1,
+-	error(['marshall error message: could not open ' [md.miscellaneous.name '.bin'],' file for binary writing']);
+-end
+-
+-%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
+-WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
+-
+-%Go through all model fields: check that it is a class and call checkconsistency
+-fields=properties('model');
+-for i=1:length(fields),
+-	field=fields{i};
+-
+-	%Some properties do not need to be marshalled
+-	if ismember(field,{'results' 'radaroverlay' 'solver' 'cluster'  'flaim' 'private'}),
+-		continue;
+-	end
+-
+-	%Check that current field is an object
+-	if ~isobject(md.(field))
+-		error(['field ''' char(field) ''' is not an object']);
+-	end
+-
+-	%Marshall current object
+-	%disp(['marshalling ' field '...']);
+-	if verLessThan('matlab', '7.6')
+-		marshall(md.(field),fid);
+-	else
+-		md.(field).marshall(fid);
+-	end
+-end
+-
+-%close file
+-st=fclose(fid);
+-if st==-1,
+-	error(['marshall error message: could not close file ' [md.miscellaneous.name '.bin']]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.py	(revision 13009)
+@@ -1,64 +0,0 @@
+-import os
+-import socket
+-import time
+-from MatlabFuncs import *
+-
+-def waitonlock(md,executionpath,login,port):
+-	"""
+-	WAITONLOCK - wait for a file
+- 
+-	   This routine will return when a file named 'filename' is written to disk.
+-	   If the time limit given in input is exceeded, return 0
+- 
+-	   Usage:
+-	      flag=waitonlock(md,executionpath)
+-	"""
+-
+-	#Get filename (lock file) and options
+-	executionpath=md.cluster.executionpath
+-	cluster=md.cluster.name
+-	login=md.cluster.login
+-	port=md.cluster.port
+-	timelimit=md.settings.waitonlock
+-	filename=os.path.join(executionpath,md.private.runtimename,md.miscellaneous.name+'.lock')
+-
+-	#waitonlock will work if the lock is on the same machine only: 
+-	if not strcmpi(socket.gethostname().lower().split('.')[0],cluster):
+-
+-		print 'solution launched on remote cluster. log in to detect job completion.'
+-		choice=raw_input('Is the job successfully completed? (y/n) ')
+-		if not strcmp(choice,'y'): 
+-			print 'Results not loaded... exiting' 
+-			flag=0
+-		else:
+-			flag=1
+-
+-	#job is running on the same machine
+-	else:
+-
+-		if 'interactive' in vars(md.cluster) and md.cluster.interactive:
+-			#We are in interactive mode, no need to check for job completion
+-			flag=1
+-			return flag
+-		#initialize time and file presence test flag
+-		etime=0
+-		ispresent=0
+-		print "waiting for '%s' hold on... (Ctrl+C to exit)" % filename
+-
+-		#loop till file .lock exist or time is up
+-		while ispresent==0 and etime<timelimit:
+-			ispresent=os.path.exist(filename)
+-			time.sleep(1)
+-			etime+=1/60
+-
+-		#build output
+-		if etime>timelimit:
+-			print 'Time limit exceeded. Increase md.settings.waitonlock'
+-			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
+-			raise RuntimeError('waitonlock error message: time limit exceeded.')
+-			flag=0
+-		else:
+-			flag=1
+-
+-	return flag
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/waitonlock.m	(revision 13009)
+@@ -1,58 +0,0 @@
+-function flag=waitonlock(md,executionpath,login,port)
+-%WAITONLOCK - wait for a file
+-%
+-%   This routine will return when a file named 'filename' is written to disk.
+-%   If the time limit given in input is exceeded, return 0
+-%
+-%   Usage:
+-%      flag=waitonlock(md,executionpath)
+-
+-%Get filename (lock file) and options
+-executionpath=md.cluster.executionpath;
+-cluster=md.cluster.name;
+-login=md.cluster.login;
+-port=md.cluster.port;
+-timelimit=md.settings.waitonlock;
+-filename=[executionpath '/' md.private.runtimename '/' md.miscellaneous.name '.lock'];
+-
+-%waitonlock will work if the lock is on the same machine only: 
+-if ~strcmpi(oshostname(),cluster),
+-
+-	disp('solution launched on remote cluster. log in to detect job completion.');
+-	choice=input('Is the job successfully completed? (y/n)','s');
+-	if ~strcmp(choice,'y'), 
+-		disp('Results not loaded... exiting'); 
+-		flag=0;
+-	else
+-		flag=1;
+-	end
+-
+-%job is running on the same machine
+-else
+-
+-	if ismember('interactive',properties(md.cluster)) & md.cluster.interactive
+-		%We are in interactive mode, no need to check for job completion
+-		flag=1;
+-		return;
+-	end
+-	%initialize time and file presence test flag
+-	time=0; ispresent=0;
+-	disp(['waiting for ' filename ' hold on... (Ctrl+C to exit)'])
+-
+-	%loop till file .lock exist or time is up
+-	while (ispresent==0 & time<timelimit)
+-		ispresent=exist(filename,'file');
+-		pause(1);
+-		time=time+1/60;
+-	end
+-
+-	%build output
+-	if (time>timelimit),
+-		disp('Time limit exceeded. Increase md.settings.waitonlock');
+-		disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
+-		error(['waitonlock error message: time limit exceeded']);
+-		flag=0;
+-	else
+-		flag=1;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.py	(revision 13009)
+@@ -1,19 +0,0 @@
+-def MatlabProcessPatch(structure):
+-	"""
+-	PROCESSPATCH - create a structure from a patch
+- 
+-	   Usage:
+-	      Result=ProcessPatch(Result);
+-	"""
+-
+-	#loop over steps
+-	for structurei in structure.itervalues():
+-
+-		#return if there is no field Patch
+-		if not 'Patch' in structurei:
+-			continue
+-
+-		raise SystemError("MatlabProcessPatch not implemented in Python.")
+-
+-	return structure
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.py	(revision 13009)
+@@ -1,95 +0,0 @@
+-from AnalysisConfiguration import *
+-from EnumDefinitions import *
+-
+-def AnalysisConfiguration(solutiontype): #{{{
+-	"""
+-	ANALYSISCONFIGURATION - return type of analyses, number of analyses 
+-
+-		Usage:
+-			[analyses, numanalyses]=AnalysisConfiguration(solutiontype);
+-	"""
+-
+-	if   solutiontype == DiagnosticSolutionEnum:
+-		numanalyses=5
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum]
+-
+-	elif solutiontype == SteadystateSolutionEnum:
+-		numanalyses=7 
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum]
+-
+-	elif solutiontype == ThermalSolutionEnum:
+-		numanalyses=2 
+-		analyses=[ThermalAnalysisEnum,MeltingAnalysisEnum]
+-
+-	elif solutiontype == EnthalpySolutionEnum:
+-		numanalyses=1 
+-		analyses=[EnthalpyAnalysisEnum]
+-
+-	elif solutiontype == PrognosticSolutionEnum:
+-		numanalyses=1 
+-		analyses=[PrognosticAnalysisEnum]
+-
+-	elif solutiontype == BalancethicknessSolutionEnum:
+-		numanalyses=1 
+-		analyses=[BalancethicknessAnalysisEnum]
+-
+-	elif solutiontype == SurfaceSlopeSolutionEnum:
+-		numanalyses=1 
+-		analyses=[SurfaceSlopeAnalysisEnum]
+-
+-	elif solutiontype == BedSlopeSolutionEnum:
+-		numanalyses=1 
+-		analyses=[BedSlopeAnalysisEnum]
+-
+-	elif solutiontype == TransientSolutionEnum:
+-		numanalyses=9 
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum,EnthalpyAnalysisEnum,PrognosticAnalysisEnum]
+-
+-	elif solutiontype == FlaimSolutionEnum:
+-		numanalyses=1 
+-		analyses=[FlaimAnalysisEnum]
+-
+-	elif solutiontype == HydrologySolutionEnum:
+-		numanalyses=3 
+-		analyses=[BedSlopeAnalysisEnum,SurfaceSlopeAnalysisEnum,HydrologyAnalysisEnum]
+-
+-	else:
+-		raise TypeError("solution type: '%s' not supported yet!" % EnumToString(solutiontype))
+-
+-	return analyses,numanalyses
+-#}}}
+-
+-def ismodelselfconsistent(md):
+-	"""
+-	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+-
+-	   Usage:
+-	      ismodelselfconsistent(md),
+-	"""
+-
+-	#initialize consistency as true
+-	md.private.isconsistent=True
+-
+-	#Get solution and associated analyses
+-	solution=md.private.solution
+-	analyses,numanalyses=AnalysisConfiguration(solution)
+-
+-	#Go through a model fields, check that it is a class, and call checkconsistency
+-	fields=vars(md)
+-	for field in fields.iterkeys():
+-
+-		#Some properties do not need to be checked
+-		if field in ['results','debug','radaroverlay']:
+-			continue
+-
+-		#Check that current field is an object
+-		if not hasattr(getattr(md,field),'checkconsistency'):
+-			md.checkmessage("field '%s' is not an object." % field)
+-
+-		#Check consistency of the object
+-		exec("md.%s.checkconsistency(md,solution,analyses)" % field)
+-
+-	#error message if mode is not consistent
+-	if not md.private.isconsistent:
+-		raise RuntimeError('Model not consistent, see messages above.')
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/MatlabProcessPatch.m	(revision 13009)
+@@ -1,65 +0,0 @@
+-function structure=MatlabProcessPatch(structure);
+-%PROCESSPATCH - create a structure from a patch
+-%
+-%   Usage:
+-%      Result=ProcessPatch(Result);
+-
+-%return if there is no field Patch
+-if (~isfield(structure,'Patch')),
+-	return;
+-end
+-
+-%loop over steps
+-for i=1:length(structure),
+-
+-	%Get Patch for current step
+-	Patch=structure(i).Patch;
+-	numvertices=structure(i).PatchVertices;
+-
+-	%check that Patch is not empty
+-	if length(Patch)==0 continue; end
+-
+-	%Get number of fields;
+-	fields=unique(Patch(:,1));
+-	steps=unique(Patch(:,2));
+-
+-	%parse steps
+-	for j=1:length(steps),
+-
+-		posstep=find(Patch(:,2)==steps(j));
+-
+-		%Take all the lines of the Patch for this timestep
+-		temporarypatch=Patch(posstep,:);
+-		time=temporarypatch(1,3);
+-		step=temporarypatch(1,2);
+-
+-		%parse fields
+-		for i=1:length(fields),
+-
+-			%get name
+-			fieldname=EnumToString(fields(i));
+-
+-			%get line positions
+-			pos=find(temporarypatch(:,1)==fields(i));
+-
+-			%Fill Result structure
+-			structure(step).steps=step;
+-			structure(step).time=time;
+-			structure(step).(fieldname).element=temporarypatch(pos,4);
+-			structure(step).(fieldname).interpolation=temporarypatch(pos,5);
+-			structure(step).(fieldname).index=temporarypatch(pos,6:5+numvertices);
+-			if structure(step).(fieldname).interpolation==P1Enum,
+-				structure(step).(fieldname).value=temporarypatch(pos,6+numvertices:end);
+-			end
+-			if structure(step).(fieldname).interpolation==P0Enum,
+-				structure(step).(fieldname).value=temporarypatch(pos,6+numvertices);
+-			end
+-
+-		end
+-	end
+-end
+-
+-%remove fields
+-structure=rmfield(structure,'Patch');
+-structure=rmfield(structure,'PatchVertices');
+-structure=rmfield(structure,'PatchNodes');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/WriteData.py	(revision 13009)
+@@ -1,274 +0,0 @@
+-import numpy
+-import math
+-import struct
+-from MatlabFuncs import *
+-
+-def WriteData(fid,*args):
+-	"""
+-	WRITEDATA - write model field in binary file
+- 
+-	   Usage:
+-	      WriteData(fid,varargin)
+-	"""
+-
+-	#process options
+-	options=pairoptions(*args)
+-
+-	#Get data properties
+-	if options.exist('object'):
+-		#This is an object field, construct enum and data
+-		obj       = options.getfieldvalue('object')
+-		fieldname = options.getfieldvalue('fieldname')
+-		classname = type(obj)
+-
+-		enum      = BuildEnum(classname+'_'+fieldname)
+-		data      = getattr(obj,fieldname)
+-	else:
+-		#No processing required
+-		data = options.getfieldvalue('data')
+-		enum = options.getfieldvalue('enum')
+-	format  = options.getfieldvalue('format')
+-	mattype = options.getfieldvalue('mattype',0)    #only required for matrices
+-
+-	#Process sparse matrices
+-#	if issparse(data),
+-#		data=full(data);
+-#	end
+-
+-	#Step 1: write the enum to identify this record uniquely
+-	fid.write(struct.pack('i',enum)) 
+-
+-	#Step 2: write the data itself.
+-	if   strcmpi(format,'Boolean'):    # {{{
+-		if len(data) !=1:
+-			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',4+4))  #1 bool (disguised as an int)+code
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#now write integer
+-		fid.write(struct.pack('i',data))  #send an int, not easy to send a bool
+-		# }}}
+-
+-	elif strcmpi(format,'Integer'):    # {{{
+-		if len(data) !=1:
+-			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',4+4))  #1 integer + code
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#now write integer
+-		fid.write(struct.pack('i',data)) 
+-		# }}}
+-
+-	elif strcmpi(format,'Double'):    # {{{
+-		if len(data) !=1:
+-			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',8+4))  #1 double+code
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#now write double
+-		fid.write(struct.pack('d',data)) 
+-		# }}}
+-
+-	elif strcmpi(format,'String'):    # {{{
+-		#first write length of record
+-		fid.write(struct.pack('i',len(data)+4+4))  #string + string size + code
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#now write string
+-		fid.write(struct.pack('i',len(data))) 
+-		fid.write(struct.pack('%ds' % len(data),data)) 
+-		# }}}
+-
+-	elif strcmpi(format,'BooleanMat'):    # {{{
+-
+-		#Get size
+-		s=data.shape
+-		#if matrix = NaN, then do not write anything
+-		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
+-			s[0]=0
+-			s[1]=0
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
+-
+-		#write data code and matrix type: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-		fid.write(struct.pack('i',mattype))
+-
+-		#now write matrix
+-		fid.write(struct.pack('i',s[0])) 
+-		fid.write(struct.pack('i',s[1])) 
+-		for i in xrange(s[0]):
+-			for j in xrange(s[1]):
+-				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
+-		# }}}
+-
+-	elif strcmpi(format,'IntMat'):    # {{{
+-
+-		#Get size
+-		s=data.shape
+-		#if matrix = NaN, then do not write anything
+-		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
+-			s[0]=0
+-			s[1]=0
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
+-
+-		#write data code and matrix type: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-		fid.write(struct.pack('i',mattype))
+-
+-		#now write matrix
+-		fid.write(struct.pack('i',s[0])) 
+-		fid.write(struct.pack('i',s[1])) 
+-		for i in xrange(s[0]):
+-			for j in xrange(s[1]):
+-				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
+-		# }}}
+-
+-	elif strcmpi(format,'DoubleMat'):    # {{{
+-
+-		#Get size
+-		s=data.shape
+-		#if matrix = NaN, then do not write anything
+-		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
+-			s[0]=0
+-			s[1]=0
+-
+-		#first write length of record
+-		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
+-
+-		#write data code and matrix type: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-		fid.write(struct.pack('i',mattype))
+-
+-		#now write matrix
+-		fid.write(struct.pack('i',s[0])) 
+-		fid.write(struct.pack('i',s[1])) 
+-		for i in xrange(s[0]):
+-			for j in xrange(s[1]):
+-				fid.write(struct.pack('d',data[i][j]))    #get to the "c" convention, hence the transpose
+-		# }}}
+-
+-	elif strcmpi(format,'MatArray'):    # {{{
+-
+-		#first get length of record
+-		recordlength=4+4    #number of records + code
+-		for matrix in data:
+-			s=matrix.shape
+-			recordlength+=4*2+s[0]*s[1]*8    #row and col of matrix + matrix of doubles
+-
+-		#write length of record
+-		fid.write(struct.pack('i',recordlength)) 
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#write data, first number of records
+-		fid.write(struct.pack('i',len(data))) 
+-
+-		#write each matrix: 
+-		for matrix in data:
+-			s=matrix.shape
+-			fid.write(struct.pack('i',s[0])) 
+-			fid.write(struct.pack('i',s[1])) 
+-			for i in xrange(s[0]):
+-				for j in xrange(s[1]):
+-					fid.write(struct.pack('d',matrix[i][j]))
+-		# }}}
+-
+-	elif strcmpi(format,'StringArray'):    # {{{
+-
+-		#first get length of record
+-		recordlength=4+4    #for length of array + code
+-		for string in data:
+-			recordlength+=4+len(string)    #for each string
+-
+-		#write length of record
+-		fid.write(struct.pack('i',recordlength)) 
+-
+-		#write data code: 
+-		fid.write(struct.pack('i',FormatToCode(format))) 
+-
+-		#now write length of string array
+-		fid.write(struct.pack('i',len(data))) 
+-
+-		#now write the strings
+-		for string in data:
+-			fid.write(struct.pack('i',len(string))) 
+-			fid.write(struct.pack('%ds' % len(string),string)) 
+-		# }}}
+-
+-	else:    # {{{
+-		raise TypeError('WriteData error message: data type: %d not supported yet! (%s)' % (format,EnumToString(enum)))
+-	# }}}
+-
+-def BuildEnum(string): # {{{
+-	"""
+-	BUILDENUM - build enum out of string
+- 
+-    Usage:
+-       enum=BuildEnum(string)
+-	"""
+-
+-	if '_' in string:
+-		substrs=string.split('_')
+-		string=''
+-		for str in substrs:
+-			string+=str[0].upper()+str[1:]
+-	else:
+-		#take first letter of string and make it uppercase: 
+-		string=str[0].upper()+str[1:]
+-
+-	#Get Enum
+-	exec('enum='+string+'Enum()',globals())
+-
+-	return enum
+-# }}}
+-
+-def FormatToCode(format): # {{{
+-	"""
+-	This routine takes the format string, and hardcodes it into an integer, which 
+-	is passed along the record, in order to identify the nature of the dataset being 
+-	sent.
+-	"""
+-
+-	if   strcmpi(format,'Boolean'):
+-		code=1
+-	elif strcmpi(format,'Integer'):
+-		code=2
+-	elif strcmpi(format,'Double'):
+-		code=3
+-	elif strcmpi(format,'String'):
+-		code=4
+-	elif strcmpi(format,'BooleanMat'):
+-		code=5
+-	elif strcmpi(format,'IntMat'):
+-		code=6
+-	elif strcmpi(format,'DoubleMat'):
+-		code=7
+-	elif strcmpi(format,'MatArray'):
+-		code=8
+-	elif strcmpi(format,'StringArray'):
+-		code=9
+-	else:
+-		raise InputError('FormatToCode error message: data type not supported yet!')
+-
+-	return code
+-# }}}
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/ismodelselfconsistent.m	(revision 13009)
+@@ -1,100 +0,0 @@
+-function ismodelselfconsistent(md),
+-%ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+-%
+-%   Usage:
+-%      ismodelselfconsistent(md),
+-
+-%initialize consistency as true
+-md.private.isconsistent=true;
+-
+-%Get solution and associated analyses
+-solution=md.private.solution;
+-[analyses,numanalyses]=AnalysisConfiguration(solution);
+-
+-%Go through a model field, check that it is a class, and call checkconsistency
+-fields=properties('model');
+-for i=1:length(fields),
+-	field=fields{i};
+-
+-	%Some properties do not need to be checked
+-	if ismember(field,{'results' 'debug' 'radaroverlay'}),
+-		continue;
+-	end
+-
+-	%Check that current field is an object
+-	if ~isobject(md.(field))
+-		md=checkmessage(md,['field ''' char(field) ''' is not an object']);
+-	end
+-
+-	%Check consistency of the object
+-	if verLessThan('matlab', '7.6')
+-		md=checkconsistency(md.(field),md,solution,analyses);
+-	else
+-		md=md.(field).checkconsistency(md,solution,analyses);
+-	end
+-end
+-
+-%error message if mode is not consistent
+-if md.private.isconsistent==false,
+-	error('Model not consistent, see messages above');
+-end
+-end
+-
+-function [analyses,numanalyses]=AnalysisConfiguration(solutiontype), % {{{
+-%ANALYSISCONFIGURATION - return type of analyses, number of analyses 
+-%
+-%   Usage:
+-%      [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
+-
+-
+-
+-switch solutiontype,
+-
+-	case DiagnosticSolutionEnum,
+-		numanalyses=5;
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum];
+-
+-	case SteadystateSolutionEnum,
+-		numanalyses=7; 
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum];
+-
+-	case ThermalSolutionEnum,
+-		numanalyses=2; 
+-		analyses=[ThermalAnalysisEnum;MeltingAnalysisEnum];
+-
+-	case EnthalpySolutionEnum,
+-		numanalyses=1; 
+-		analyses=[EnthalpyAnalysisEnum];
+-
+-	case PrognosticSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[PrognosticAnalysisEnum];
+-
+-	case BalancethicknessSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[BalancethicknessAnalysisEnum];
+-
+-	case SurfaceSlopeSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[SurfaceSlopeAnalysisEnum];
+-
+-	case BedSlopeSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[BedSlopeAnalysisEnum];
+-
+-	case TransientSolutionEnum,
+-		numanalyses=9; 
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;EnthalpyAnalysisEnum;PrognosticAnalysisEnum];
+-
+-	case FlaimSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[FlaimAnalysisEnum];
+-
+-	case HydrologySolutionEnum,
+-		numanalyses=3; 
+-		analyses=[BedSlopeAnalysisEnum;SurfaceSlopeAnalysisEnum;HydrologyAnalysisEnum];
+-
+-	otherwise
+-		error('%s%s%s',' solution type: ',EnumToString(solutiontype),' not supported yet!');
+-
+-end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solve/loadresultsfromcluster.py	(revision 13009)
+@@ -1,61 +0,0 @@
+-import os
+-import platform
+-import socket
+-from MatlabFuncs import *
+-
+-def loadresultsfromcluster(md,runtimename=False):
+-	"""
+-	LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
+- 
+-	   Usage:
+-	      md=loadresultsfromcluster(md,runtimename);
+-	"""
+-
+-	#retrieve cluster, to be able to call its methods
+-	cluster=md.cluster
+-
+-	if runtimename:
+-		md.private.runtimename=runtimename
+-	end
+-
+-	#Download outputs from the cluster
+-	filelist=[md.miscellaneous.name+'.outlog',md.miscellaneous.name+'.errlog']
+-	if md.qmu.isdakota:
+-		filelist.append(md.miscellaneous.name+'.qmu.err')
+-		filelist.append(md.miscellaneous.name+'.qmu.out')
+-		if 'tabular_graphics_data' in md.qmu.params:
+-			if md.qmu.params['tabular_graphics_data']:
+-				filelist.append('dakota_tabular.dat')
+-		filelist.append(md.miscellaneous.name+'.outbin')
+-	Download(cluster,md.private.runtimename,filelist)
+-
+-	#If we are here, no errors in the solution sequence, call loadresultsfromdisk.
+-	md=loadresultsfromdisk(md,md.miscellaneous.name+'.outbin')
+-
+-	#erase the log and output files
+-	if md.qmu.isdakota:
+-		os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.outlog'))
+-		os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.errlog'))
+-	else:
+-		os.remove(md.miscellaneous.name+'.outlog')
+-		os.remove(md.miscellaneous.name+'.errlog')
+-		os.remove(md.miscellaneous.name+'.outbin')
+-		if not 'Windows' in platform.system():
+-			os.remove(md.private.runtimename+'.tar.gz')
+-
+-	#erase input file if run was carried out on same platform.
+-	hostname=socket.gethostname().lower().split('.')[0]
+-	if strcmpi(hostname,cluster.name):
+-		if md.qmu.isdakota:
+-			os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.bin'))
+-			os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.queue'))
+-		else:
+-			os.remove(md.miscellaneous.name+'.bin')
+-			os.remove(md.miscellaneous.name+'.petsc')
+-			if not 'Windows' in platform.system():
+-				os.remove(md.miscellaneous.name+'.queue')
+-			else:
+-				os.remove(md.miscellaneous.name+'.bat')
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/AreaAverageOntoPartition.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/AreaAverageOntoPartition.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/AreaAverageOntoPartition.m	(revision 13009)
+@@ -1,55 +0,0 @@
+-function partvector=AreaAverageOntoPartition(md,vector,layer)
+-%AREAAVERAGEONTOPARTITION 
+-%   compute partition values for a certain vector expressed on the vertices of the mesh.
+-%   Use area weighted average.
+-%
+-%   Usage:
+-%      average=AreaAverageOntoPartition(md,vector)
+-%      average=AreaAverageOntoPartition(md,vector,layer) %if in 3D, chose which layer is partitioned
+-
+-%some checks
+-if md.mesh.dimension==3,
+-	if nargin~=3,
+-		error('layer should be provided onto which Area Averaging occurs');
+-	end
+-	%save 3D model
+-	md3d=md;
+-	
+-	md.mesh.elements=md.mesh.elements2d;
+-	md.mesh.x=md.mesh.x2d;
+-	md.mesh.y=md.mesh.y2d;
+-	md.mesh.numberofvertices=md.mesh.numberofvertices2d;
+-	md.mesh.numberofelements=md.mesh.numberofelements2d;
+-	md.qmu.vertex_weight=[];
+-	md.mesh.vertexconnectivity=[];
+-
+-	%run connectivity routine
+-	md=adjacency(md);
+-
+-	%finally, project vector: 
+-	vector=project2d(md3d,vector,layer);
+-	md.qmu.partition=project2d(md3d,md3d.qmu.partition,layer);
+-end
+-
+-%ok, first check that part is Matlab indexed
+-part=md.qmu.partition+1;
+-
+-%some check: 
+-if md.qmu.numberofpartitions~=max(part),
+-	error('AreaAverageOntoPartition error message: ''npart'' should be equal to max(md.qmu.partition)');
+-end
+-
+-%initialize output
+-partvector=zeros(max(part),1);
+-
+-%start weight average
+-weightedvector=vector.*md.qmu.vertex_weight;
+-for i=1:max(part),
+-	pos=find(part==i);
+-	partvector(i)=sum(weightedvector(pos))/sum(md.qmu.vertex_weight(pos));
+-end
+-
+-%in 3D, restore 3D model:
+-if md.mesh.dimension==3,
+-	md=md3d;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/partitioner.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/partitioner.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/partitioner.m	(revision 13009)
+@@ -1,107 +0,0 @@
+-function md=partitioner(md,varargin)
+-%PARTITIONER - partition mesh 
+-%
+-%   List of options to partitioner: 
+-%
+-%   package: 'chaco', 'metis' or 'scotch'
+-%   npart: number of partitions.
+-%   weighting: 'on' or 'off': default off
+-%   section:  1 by defaults(1=bisection, 2=quadrisection, 3=octasection)
+-%   recomputeadjacency:  'on' by default (set to 'off' to compute existing one)
+-%   Output: md.qmu.partition recover the partition vector
+-%   
+-%   Usage:
+-%      md=partitioner(md,'package','chaco','npart',100,'weighting','on');
+-%
+-
+-%get options: 
+-options=pairoptions(varargin{:});
+-
+-%set defaults
+-options=addfielddefault(options,'package','chaco');
+-options=addfielddefault(options,'npart',10);
+-options=addfielddefault(options,'weighting','on');
+-options=addfielddefault(options,'section',1);
+-options=addfielddefault(options,'recomputeadjacency','on');
+-
+-%get package: 
+-package=getfieldvalue(options,'package');
+-npart=getfieldvalue(options,'npart');
+-recomputeadjacency=getfieldvalue(options,'recomputeadjacency');
+-
+-if(md.mesh.dimension==3),
+-	%partitioning essentially happens in 2D. So partition in 2D, then 
+-	%extrude the partition vector vertically. 
+-	md3d=md; %save  for later
+-	md.mesh.elements=md.mesh.elements2d;
+-	md.mesh.x=md.mesh.x2d;
+-	md.mesh.y=md.mesh.y2d;
+-	md.mesh.numberofvertices=md.mesh.numberofvertices2d;
+-	md.mesh.numberofelements=md.mesh.numberofelements2d;
+-	md.qmu.vertex_weight=[];
+-	md.mesh.vertexconnectivity=[];
+-end
+-
+-%adjacency matrix if needed:
+-if strcmpi(recomputeadjacency,'on'),
+-	md=adjacency(md);
+-else
+-	disp('skipping adjacency matrix computation as requested in the options');
+-end
+-
+-
+-if strcmpi(package,'chaco'),
+-
+-	%  default method (from chaco.m)
+-	method=[1 1 0 0 1 1 50 0 .001 7654321]';
+-	method(1)=3;    %  global method (3=inertial (geometric))
+-	method(3)=0;    %  vertex weights (0=off, 1=on)
+-	
+-	%specify bisection
+-	method(6)=getfieldvalue(options,'section');%  ndims (1=bisection, 2=quadrisection, 3=octasection)
+-
+-	%are we using weights? 
+-	if strcmpi(getfieldvalue(options,'weighting'),'on'),
+-		weights=floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight));
+-		method(3)=1;
+-	else 
+-		weights=[];
+-	end
+-	
+-	%  partition into nparts
+-	part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y ,md.mesh.z,method,npart,[])'+1; %index partitions from 1 up. like metis.
+-
+-elseif strcmpi(package,'scotch'),
+-
+-	%are we using weights? 
+-	if strcmpi(getfieldvalue(options,'weighting'),'on'),
+-		weights=floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight));
+-	end
+-	maptab=Scotch(md.qmu.adjacency,[],weights,[],'cmplt',[npart]);
+-	
+-	part=maptab(:,2);%index partitions from 1 up. like metis.
+-
+-
+-elseif strcmpi(package,'linear'),
+-
+-	part=1:1:md.mesh.numberofvertices;
+-
+-elseif strcmpi(package,'metis'),
+-
+-	[element_partitioning,part]=MeshPartition(md.mesh,md.qmu.numberofpartitions);
+-
+-else
+-
+-	error(['partitioner error message: could not find ' package ' partitioner']);
+-	help partitioner
+-end
+-
+-%extrude if we are in 3D:
+-if md.mesh.dimension==3,
+-	md3d.qmu.vertex_weight=md.qmu.vertex_weight;
+-	md3d.qmu.adjacency=md.qmu.adjacency;
+-	md=md3d;
+-	part=project3d(md,'vector',part','type','node');
+-end
+-
+-md.qmu.partition=part;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/adjacency.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/adjacency.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/adjacency.m	(revision 13009)
+@@ -1,26 +0,0 @@
+-function md=adjacency(md);
+-%ADJACENCY -  compute adjacency matrix, list of vertices and list of weights.
+-%
+-%  function to create the adjacency matrix from the connectivity table.
+-%
+-%  the required output is:
+-%    md.adj_mat     (double [sparse nv x nv], vertex adjacency matrix)
+-%    md.qmu.vertex_weight        (double [nv], vertex weights)
+-
+-indi=[md.mesh.elements(:,1);md.mesh.elements(:,2);md.mesh.elements(:,3)];
+-indj=[md.mesh.elements(:,2);md.mesh.elements(:,3);md.mesh.elements(:,1)];
+-values=1;
+-
+-md.qmu.adjacency=sparse(indi,indj,values,md.mesh.numberofvertices,md.mesh.numberofvertices);
+-md.qmu.adjacency=double([md.qmu.adjacency | md.qmu.adjacency']);
+-
+-%now, build vwgt:
+-areas=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
+-
+-%get node connectivity
+-md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-
+-connectivity=md.mesh.vertexconnectivity(:,1:end-1);
+-pos=find(connectivity);
+-connectivity(pos)=areas(connectivity(pos))/3;
+-md.qmu.vertex_weight=sum(connectivity,2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/flagedges.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/flagedges.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/partition/flagedges.m	(revision 13009)
+@@ -1,45 +0,0 @@
+-function [xsegments ysegments]=flagedges(elements,x,y,partition);
+-%FLAGEDGES - return pairs of x,y segments, delimiting partitions.
+-%
+-%   Usage:
+-%      [xsegments ysegments]=flagedges(elements,x,y,partition)
+-
+-xsegments=[];
+-ysegments=[];
+-
+-for i=1:size(elements,1),
+-	m1=partition(elements(i,1));
+-	m2=partition(elements(i,2));
+-	m3=partition(elements(i,3));
+-	x1=x(elements(i,1));
+-	x2=x(elements(i,2));
+-	x3=x(elements(i,3));
+-	y1=y(elements(i,1));
+-	y2=y(elements(i,2));
+-	y3=y(elements(i,3));
+-
+-	if (m1~=m2) & (m1~=m3) & (m2~=m3),
+-		xmiddle=(x1+x2+x3)/3;
+-		ymiddle=(y1+y2+y3)/3;
+-		xsegments=[xsegments; (x1+x2)/2 xmiddle];
+-		xsegments=[xsegments; (x1+x3)/2 xmiddle];
+-		xsegments=[xsegments; (x2+x3)/2 xmiddle];
+-		ysegments=[ysegments; (y1+y2)/2 ymiddle];
+-		ysegments=[ysegments; (y1+y3)/2 ymiddle];
+-		ysegments=[ysegments; (y2+y3)/2 ymiddle];
+-	end
+-
+-	if (m1==m2) & (m1~=m3),
+-		xsegments=[xsegments; (x1+x3)/2 (x2+x3)/2];
+-		ysegments=[ysegments; (y1+y3)/2 (y2+y3)/2];
+-	end
+-	if (m1==m3) & (m2~=m3),
+-		xsegments=[xsegments; (x1+x2)/2 (x2+x3)/2];
+-		ysegments=[ysegments; (y1+y2)/2 (y2+y3)/2];
+-	end
+-
+-	if (m2==m3) & (m1~=m3),
+-		xsegments=[xsegments; (x1+x2)/2 (x1+x3)/2];
+-		ysegments=[ysegments; (y1+y2)/2 (y1+y3)/2];
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/triangle.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/triangle.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/triangle.m	(revision 13009)
+@@ -1,82 +0,0 @@
+-function md=triangle(md,domainname,varargin)
+-%TRIANGLE - create model mesh using the triangle package
+-%
+-%   This routine creates a model mesh using TriMesh and a domain outline, to within a certain resolution
+-%   where md is a @model object, domainname is the name of an Argus domain outline file, 
+-%   and resolution is a characteristic length for the mesh (same unit as the domain outline
+-%   unit). Riftname is an optional argument (Argus domain outline) describing rifts.
+-%
+-%   Usage:
+-%      md=triangle(md,domainname,resolution)
+-%   or md=triangle(md,domainname,riftname, resolution)
+-%
+-%   Examples:
+-%      md=triangle(md,'DomainOutline.exp',1000);
+-%      md=triangle(md,'DomainOutline.exp','Rifts.exp',1500);
+-
+-%Figure out a characteristic area. Resolution is a node oriented concept (ex a 1000m  resolution node would 
+-%be made of 1000*1000 area squares). 
+-if (nargin==3),
+-	resolution=varargin{1};
+-	riftname='';
+-end
+-if (nargin==4),
+-	riftname=varargin{1};
+-	resolution=varargin{2};
+-end
+-
+-%Check that mesh was not already run, and warn user: 
+-if md.mesh.numberofelements~=0,
+-	choice=input('This model already has a mesh. Are you sure you want to go ahead? (y/n)','s');
+-	if ~strcmp(choice,'y')
+-		disp('no meshing done ... exiting');
+-		return
+-	end
+-end
+-
+-area=resolution^2;
+-
+-%Mesh using TriMesh
+-[elements,x,y,segments,segmentmarkers]=TriMesh(domainname,riftname,area);
+-
+-%check that all the created nodes belong to at least one element
+-orphan=find(~ismember([1:length(x)],sort(unique(elements(:)))));
+-for i=1:length(orphan),
+-	disp('WARNING: removing orphans');
+-	%get rid of the orphan node i
+-	%update x and y
+-	x=[x(1:orphan(i)-(i-1)-1); x(orphan(i)-(i-1)+1:end)];
+-	y=[y(1:orphan(i)-(i-1)-1); y(orphan(i)-(i-1)+1:end)];
+-	%update elements
+-	pos=find(elements>orphan(i)-(i-1));
+-	elements(pos)=elements(pos)-1;
+-	%update segments
+-	pos1=find(segments(:,1)>orphan(i)-(i-1));
+-	pos2=find(segments(:,2)>orphan(i)-(i-1));
+-	segments(pos1,1)=segments(pos1,1)-1;
+-	segments(pos2,2)=segments(pos2,2)-1;
+-end
+-
+-%plug into md
+-md.mesh.x=x;
+-md.mesh.y=y;
+-md.mesh.elements=elements;
+-md.mesh.segments=segments;
+-md.mesh.segmentmarkers=segmentmarkers;
+-
+-%Fill in rest of fields:
+-md.mesh.numberofelements=length(md.mesh.elements);
+-md.mesh.numberofvertices=length(md.mesh.x);
+-md.mesh.z=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+-
+-%Now, build the connectivity tables for this mesh.
+-md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-
+-%type of model
+-md.mesh.dimension=2;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/bamg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/bamg.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/bamg.m	(revision 13009)
+@@ -1,483 +0,0 @@
+-function md=bamg(md,varargin)
+-%BAMG - mesh generation
+-%
+-%   Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
+-%
+-%   - domain :            followed by an ARGUS file that prescribes the domain outline
+-%   - hmin :              minimum edge length (default is 10^-100)
+-%   - hmax :              maximum edge length (default is 10^100)
+-%   - hVertices :         imposed edge length for each vertex (geometry or mesh)
+-%   - hminVertices :      minimum edge length for each vertex (mesh)
+-%   - hmaxVertices :      maximum edge length for each vertex (mesh)
+-%
+-%   - anisomax :          maximum ratio between the smallest and largest edges (default is 10^30)
+-%   - coeff :             coefficient applied to the metric (2-> twice as many elements, default is 1)
+-%   - cutoff :            scalar used to compute the metric when metric type 2 or 3 are applied
+-%   - err :               error used to generate the metric from a field
+-%   - errg :              geometric error (default is 0.1)
+-%   - field :             field of the model that will be used to compute the metric
+-%                         to apply several fields, use one column per field
+-%   - gradation :         maximum ratio between two adjacent edges
+-%   - Hessiantype :       0 -> use double P2 projection (default)
+-%                         1 -> use Green formula
+-%   - KeepVertices :      try to keep initial vertices when adaptation is done on an existing mesh (default 1)
+-%   - MaxCornerAngle :    maximum angle of corners in degree (default is 10)
+-%   - maxnbv :            maximum number of vertices used to allocate memory (default is 10^6)
+-%   - maxsubdiv :         maximum subdivision of exisiting elements (default is 10)
+-%   - metric :            matrix (numberofnodes x 3) used as a metric
+-%   - Metrictype :        1 -> absolute error          c/(err coeff^2) * Abs(H)        (default)
+-%                         2 -> relative error          c/(err coeff^2) * Abs(H)/max(s,cutoff*max(s))
+-%                         3 -> rescaled absolute error c/(err coeff^2) * Abs(H)/(smax-smin)
+-%   - nbjacoby :          correction used by Hessiantype=1 (default is 1)
+-%   - nbsmooth :          number of metric smoothing procedure (default is 3)
+-%   - omega :             relaxation parameter of the smoothing procedure (default is 1.8)
+-%   - power :             power applied to the metric (default is 1)
+-%   - splitcorners :      split triangles whuch have 3 vertices on the outline (default is 1)
+-%   - geometricalmetric : take the geometry into account to generate the metric (default is 0)
+-%   - verbose :           level of verbosity (default is 1)
+-%
+-%   - rifts :             followed by an ARGUS file that prescribes the rifts
+-%   - toltip :            tolerance to move tip on an existing point of the domain outline
+-%   - tracks :            followed by an ARGUS file that prescribes the tracks that the mesh will stick to
+-%   - RequiredVertices :  mesh vertices that are required. [x,y,ref]; ref is optional
+-%   - tol :               if the distance between 2 points of the domain outline is less than tol, they
+-%                         will be merged
+-%
+-%   Examples:
+-%      md=bamg(md,'domain','DomainOutline.exp','hmax',3000);
+-%      md=bamg(md,'field',[md.inversion.vel_obs md.geometry.thickness],'hmax',20000,'hmin',1000);
+-%      md=bamg(md,'metric',A,'hmin',1000,'hmax',20000,'gradation',3,'anisomax',1);
+-
+-%process options
+-options=pairoptions(varargin{:});
+-options=deleteduplicates(options,1);
+-
+-%initialize the structures required as input of Bamg
+-bamg_options=struct();
+-bamg_geometry=bamggeom;
+-bamg_mesh=bamgmesh;
+-
+-% Bamg Geometry parameters {{{
+-if exist(options,'domain'),
+-
+-	%Check that file exists
+-	domainfile=getfieldvalue(options,'domain');
+-	if ~exist(domainfile,'file') error(['bamg error message: file ' domainfile ' not found ']); end
+-
+-	%Build geometry 
+-	domain=expread(domainfile);
+-	count=0;
+-	for i=1:length(domain),
+-
+-		%Check that the domain is closed
+-		if (domain(i).x(1)~=domain(i).x(end) | domain(i).y(1)~=domain(i).y(end)),
+-			error('bamg error message: all contours provided in ''domain'' should be closed');
+-		end
+-
+-		%Checks that all holes are INSIDE the principle domain outline
+-		if i>1,
+-			flags=ContourToNodes(domain(i).x,domain(i).y,domain(1),0);
+-			if any(~flags),
+-				error('bamg error message: All holes should be stricly inside the principal domain');
+-			end
+-		end
+-
+-		%Add all points to bamg_geometry
+-		nods=domain(i).nods-1; %the domain are closed 1=end;
+-		bamg_geometry.Vertices=[bamg_geometry.Vertices; [domain(i).x(1:nods) domain(i).y(1:nods) ones(nods,1)]];
+-		bamg_geometry.Edges   =[bamg_geometry.Edges;    [transpose(count+1:count+nods) transpose([count+2:count+nods count+1])  1*ones(nods,1)]];
+-		if i>1, bamg_geometry.SubDomains=[bamg_geometry.SubDomains; 2 count+1 1 1]; end
+-
+-		%update counter
+-		count=count+nods;
+-	end
+-
+-	%take care of rifts
+-	if exist(options,'rifts'),
+-
+-		%Check that file exists
+-		riftfile=getfieldvalue(options,'rifts');
+-		if ~exist(riftfile,'file')
+-			error(['bamg error message: file ' riftfile ' not found ']);
+-		end
+-		rift=expread(riftfile);
+-
+-		for i=1:length(rift),
+-
+-			%detect wether all points of the rift are inside the domain
+-			flags=ContourToNodes(rift(i).x,rift(i).y,domain(1),0);
+-			if ~flags,
+-				error('one Rift has all his points outside of the domain outline'),
+-
+-			elseif any(~flags),
+-				%We LOTS of work to do
+-				disp('Rift tip outside of or on the domain has been detected and is being processed...');
+-
+-				%check that only one point is outsie (for now)
+-				if sum(~flags)~=1,
+-					error('bamg error message: only one point outside of the domain is supported yet');
+-				end
+-
+-				%Move tip outside to the first position
+-				if flags(1)==0,
+-					%OK, first point is outside (do nothing),
+-				elseif (flags(end)==0),
+-					rift(i).x=flipud(rift(i).x);
+-					rift(i).y=flipud(rift(i).y);
+-				else
+-					error('bamg error message: only a rift tip can be outside of the domain');
+-				end
+-
+-				%Get cordinate of intersection point
+-				x1=rift(i).x(1); y1=rift(i).y(1);
+-				x2=rift(i).x(2); y2=rift(i).y(2);
+-				for j=1:length(domain(1).x)-1;
+-					if SegIntersect([x1 y1; x2 y2],[domain(1).x(j) domain(1).y(j); domain(1).x(j+1) domain(1).y(j+1)]),
+-
+-						%Get position of the two nodes of the edge in domain
+-						i1=j;
+-						i2=mod(j+1,domain(1).nods);
+-
+-						%rift is crossing edge [i1 i2] of the domain
+-						%Get coordinate of intersection point (http://mathworld.wolfram.com/Line-LineIntersection.html)
+-						x3=domain(1).x(i1); y3=domain(1).y(i1);
+-						x4=domain(1).x(i2); y4=domain(1).y(i2);
+-						x=det([det([x1 y1; x2 y2])  x1-x2;det([x3 y3; x4 y4])  x3-x4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
+-						y=det([det([x1 y1; x2 y2])  y1-y2;det([x3 y3; x4 y4])  y3-y4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
+-
+-						segdis= sqrt((x4-x3)^2+(y4-y3)^2);
+-						tipdis=[sqrt((x-x3)^2+(y-y3)^2)  sqrt((x-x4)^2+(y-y4)^2)];
+-
+-						if (min(tipdis)/segdis) < getfieldvalue(options,'toltip',0),
+-							disp('moving tip-domain intersection point');
+-
+-							%Get position of the closest point
+-							if tipdis(1)>tipdis(2),
+-								pos=i2;
+-							else
+-								pos=i1;
+-							end
+-
+-							%This point is only in Vertices (number pos).
+-							%OK, no we can add our own rift
+-							nods=rift(i).nods-1;
+-							bamg_geometry.Vertices=[bamg_geometry.Vertices; [rift(i).x(2:end) rift(i).y(2:end) ones(nods,1)]];
+-							bamg_geometry.Edges=[bamg_geometry.Edges;...
+-								pos count+1  (1+i);...
+-								[transpose(count+1:count+nods-1) transpose([count+2:count+nods])  (1+i)*ones(nods-1,1)]];
+-							count=count+nods;
+-
+-							break;
+-
+-						else
+-							%Add intersection point to Vertices
+-							bamg_geometry.Vertices=[bamg_geometry.Vertices; x y 1];
+-							count=count+1;
+-
+-							%Decompose the crossing edge in 2 subedges
+-							pos=find(bamg_geometry.Edges(:,1)==i1 & bamg_geometry.Edges(:,2)==i2);
+-							if isempty(pos) error('bamg error message: a problem occured...'); end
+-							bamg_geometry.Edges=[bamg_geometry.Edges(1:pos-1,:);...
+-								bamg_geometry.Edges(pos,1) count                           bamg_geometry.Edges(pos,3);...
+-								count                      bamg_geometry.Edges(pos,2)   bamg_geometry.Edges(pos,3);...
+-								bamg_geometry.Edges(pos+1:end,:)];
+-
+-							%OK, no we can add our own rift
+-							nods=rift(i).nods-1;
+-							bamg_geometry.Vertices=[bamg_geometry.Vertices; [rift(i).x(2:end) rift(i).y(2:end) ones(nods,1)]];
+-							bamg_geometry.Edges=[bamg_geometry.Edges;...
+-								count  count+1  2 ;...
+-								[transpose(count+1:count+nods-1) transpose([count+2:count+nods])  (1+i)*ones(nods-1,1)]];
+-							count=count+nods;
+-
+-							break;
+-						end
+-					end
+-				end
+-			else
+-				nods=rift(i).nods-1;
+-				bamg_geometry.Vertices=[bamg_geometry.Vertices; [rift(i).x(:) rift(i).y(:) ones(nods+1,1)]];
+-				bamg_geometry.Edges=[bamg_geometry.Edges; [transpose(count+1:count+nods) transpose([count+2:count+nods+1])  (1+i)*ones(nods,1)]];
+-				count=count+nods+1;
+-			end
+-		end
+-	end
+-
+-	%Deal with tracks
+-	if exist(options,'tracks'),
+-
+-		%read tracks
+-		track=getfieldvalue(options,'tracks');
+-		if all(ischar(track)),
+-			A=expread(track); 
+-			track=[A.x A.y];
+-		else
+-			track=double(track); %for some reason, it is of class "single"
+-		end
+-		if(size(track,2)==2), track=[track 3*ones(size(track,1),1)]; end
+-
+-		%only keep those inside
+-		flags=ContourToNodes(track(:,1),track(:,2),domainfile,0);
+-		track=track(find(flags),:);
+-
+-		%Add all points to bamg_geometry
+-		nods=size(track,1);
+-		bamg_geometry.Vertices=[bamg_geometry.Vertices; track];
+-		bamg_geometry.Edges=[bamg_geometry.Edges; [transpose(count+1:count+nods-1) transpose([count+2:count+nods])  3*ones(nods-1,1)]];
+-
+-		%update counter
+-		count=count+nods;
+-	end
+-
+-	%Deal with vertices that need to be kept by mesher
+-	if exist(options,'RequiredVertices'),
+-
+-		%recover RequiredVertices
+-		requiredvertices=double(getfieldvalue(options,'RequiredVertices')); %for some reason, it is of class "single"
+-		if(size(requiredvertices,2)==2), requiredvertices=[requiredvertices 4*ones(size(requiredvertices,1),1)]; end
+-	
+-		%only keep those inside
+-		flags=ContourToNodes(requiredvertices(:,1),requiredvertices(:,2),domain(1),0);
+-		requiredvertices=requiredvertices(find(flags),:);
+-
+-		%Add all points to bamg_geometry
+-		nods=size(requiredvertices,1);
+-		bamg_geometry.Vertices=[bamg_geometry.Vertices; requiredvertices];
+-
+-		%update counter
+-		count=count+nods;
+-
+-	end
+-
+-	%process geom
+-	%bamg_geometry=processgeometry(bamg_geometry,getfieldvalue(options,'tol',NaN),domain(1));
+-
+-elseif isstruct(md.private.bamg) & isfield(md.private.bamg,'geometry'),
+-	bamg_geometry=bamggeom(md.private.bamg.geometry); 
+-else
+-	%do nothing...
+-end
+-%}}}
+-% Bamg Mesh parameters {{{
+-if (~exist(options,'domain') & md.mesh.numberofvertices~=0 & md.mesh.dimension==2),
+-
+-	if isstruct(md.private.bamg) & isfield(md.private.bamg,'mesh'),
+-		bamg_mesh=bamgmesh(md.private.bamg.mesh);
+-	else
+-		bamg_mesh.Vertices=[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)];
+-		bamg_mesh.Triangles=[md.mesh.elements ones(md.mesh.numberofelements,1)];
+-	end
+-
+-	if isstruct(md.rifts.riftstruct)
+-		error('bamg error message: rifts not supported yet. Do meshprocessrift AFTER bamg');
+-	end
+-end
+-%}}}
+-% Bamg Options {{{
+-bamg_options.Crack=getfieldvalue(options,'Crack',0);
+-bamg_options.anisomax=getfieldvalue(options,'anisomax',10^30);
+-bamg_options.coeff=getfieldvalue(options,'coeff',1);
+-bamg_options.cutoff=getfieldvalue(options,'cutoff',10^-5);
+-bamg_options.err=getfieldvalue(options,'err',0.01);
+-bamg_options.errg=getfieldvalue(options,'errg',0.1);
+-bamg_options.field=getfieldvalue(options,'field',[]);
+-bamg_options.gradation=getfieldvalue(options,'gradation',1.5);
+-bamg_options.Hessiantype=getfieldvalue(options,'Hessiantype',0);
+-bamg_options.hmin=getfieldvalue(options,'hmin',10^-100);
+-bamg_options.hmax=getfieldvalue(options,'hmax',10^100);
+-bamg_options.hminVertices=getfieldvalue(options,'hminVertices',[]);
+-bamg_options.hmaxVertices=getfieldvalue(options,'hmaxVertices',[]);
+-bamg_options.hVertices=getfieldvalue(options,'hVertices',[]);
+-bamg_options.KeepVertices=getfieldvalue(options,'KeepVertices',1);
+-bamg_options.MaxCornerAngle=getfieldvalue(options,'MaxCornerAngle',10);
+-bamg_options.maxnbv=getfieldvalue(options,'maxnbv',10^6);
+-bamg_options.maxsubdiv=getfieldvalue(options,'maxsubdiv',10);
+-bamg_options.metric=getfieldvalue(options,'metric',[]);
+-bamg_options.Metrictype=getfieldvalue(options,'Metrictype',0);
+-bamg_options.nbjacobi=getfieldvalue(options,'nbjacobi',1);
+-bamg_options.nbsmooth=getfieldvalue(options,'nbsmooth',3);
+-bamg_options.omega=getfieldvalue(options,'omega',1.8);
+-bamg_options.power=getfieldvalue(options,'power',1);
+-bamg_options.splitcorners=getfieldvalue(options,'splitcorners',1);
+-bamg_options.geometricalmetric=getfieldvalue(options,'geometricalmetric',0);
+-bamg_options.verbose=getfieldvalue(options,'verbose',1);
+-%}}}
+-
+-%call Bamg
+-[bamgmesh_out bamggeom_out]=BamgMesher(bamg_mesh,bamg_geometry,bamg_options);
+-
+-% plug results onto model
+-md.private.bamg=struct();
+-md.private.bamg.mesh=bamgmesh(bamgmesh_out);
+-md.private.bamg.geometry=bamggeom(bamggeom_out);
+-md.mesh.x=bamgmesh_out.Vertices(:,1);
+-md.mesh.y=bamgmesh_out.Vertices(:,2);
+-md.mesh.elements=bamgmesh_out.Triangles(:,1:3);
+-md.mesh.edges=bamgmesh_out.IssmEdges;
+-md.mesh.segments=bamgmesh_out.IssmSegments(:,1:3);
+-md.mesh.segmentmarkers=bamgmesh_out.IssmSegments(:,4);
+-
+-%Fill in rest of fields:
+-md.mesh.dimension=2;
+-md.mesh.numberofelements=size(md.mesh.elements,1);
+-md.mesh.numberofvertices=length(md.mesh.x);
+-md.mesh.numberofedges=size(md.mesh.edges,1);
+-md.mesh.z=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
+-md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+-md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+-md.mesh.elementconnectivity=md.private.bamg.mesh.ElementConnectivity;
+-md.mesh.elementconnectivity(find(isnan(md.mesh.elementconnectivity)))=0;
+-
+-%Check for orphan
+-reshape(md.mesh.elements,3*md.mesh.numberofelements,1);
+-(~ismember(1:md.mesh.numberofvertices,sort(unique(reshape(md.mesh.elements,3*md.mesh.numberofelements,1)))));
+-if any(~ismember(1:md.mesh.numberofvertices,sort(unique(reshape(md.mesh.elements,3*md.mesh.numberofelements,1)))))
+-	error('Output mesh has orphans. Decrease MaxCornerAngle to prevent outside points (ex: 0.01)');
+-end
+-end 
+-
+-function geom=processgeometry(geom,tol,outline); % {{{
+-
+-%Deal with edges
+-disp('Checking Edge crossing...');
+-i=0;
+-while (i<size(geom.Edges,1)),
+-
+-	%edge counter
+-	i=i+1;
+-
+-	%Get coordinates
+-	x1=geom.Vertices(geom.Edges(i,1),1);
+-	y1=geom.Vertices(geom.Edges(i,1),2);
+-	x2=geom.Vertices(geom.Edges(i,2),1);
+-	y2=geom.Vertices(geom.Edges(i,2),2);
+-	color1=geom.Edges(i,3);
+-
+-	j=i; %test edges located AFTER i only
+-	while (j<size(geom.Edges,1)),
+-
+-		%edge counter
+-		j=j+1;
+-
+-		%Skip if the two edges already have a vertex in common
+-		if any(ismember(geom.Edges(i,1:2),geom.Edges(j,1:2))),
+-			continue
+-		end
+-
+-		%Get coordinates
+-		x3=geom.Vertices(geom.Edges(j,1),1);
+-		y3=geom.Vertices(geom.Edges(j,1),2);
+-		x4=geom.Vertices(geom.Edges(j,2),1);
+-		y4=geom.Vertices(geom.Edges(j,2),2);
+-		color2=geom.Edges(j,3);
+-
+-		%Check if the two edges are crossing one another
+-		if SegIntersect([x1 y1; x2 y2],[x3 y3; x4 y4]),
+-
+-			%Get coordinate of intersection point (http://mathworld.wolfram.com/Line-LineIntersection.html)
+-			x=det([det([x1 y1; x2 y2])  x1-x2;det([x3 y3; x4 y4])  x3-x4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
+-			y=det([det([x1 y1; x2 y2])  y1-y2;det([x3 y3; x4 y4])  y3-y4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
+-
+-			%Add vertex to the list of vertices
+-			geom.Vertices(end+1,:)=[x y min(color1,color2)];
+-			id=size(geom.Vertices,1);
+-
+-			%Update edges i and j
+-			edgei=geom.Edges(i,:);
+-			edgej=geom.Edges(j,:);
+-			geom.Edges(i,:)    =[edgei(1) id       edgei(3)];
+-			geom.Edges(end+1,:)=[id       edgei(2) edgei(3)];
+-			geom.Edges(j,:)    =[edgej(1) id       edgej(3)];
+-			geom.Edges(end+1,:)=[id       edgej(2) edgej(3)];
+-
+-			%update current edge second tip
+-			x2=x; y2=y;
+-		end
+-	end
+-
+-end
+-
+-%Check point outside
+-disp('Checking for points outside the domain...');
+-i=0;
+-num=0;
+-while (i<size(geom.Vertices,1)),
+-
+-	%vertex counter
+-	i=i+1;
+-
+-	%Get coordinates
+-	x=geom.Vertices(i,1);
+-	y=geom.Vertices(i,2);
+-	color=geom.Vertices(i,3);
+-
+-	%Check that the point is inside the domain
+-	if (color~=1 & ~ContourToNodes(x,y,outline(1),1)),
+-
+-		%Remove points from list of Vertices
+-		num=num+1;
+-		geom.Vertices(i,:)=[];
+-
+-		%update edges
+-		[posedges dummy]=find(geom.Edges==i);
+-		geom.Edges(posedges,:)=[];
+-		posedges=find(geom.Edges>i);
+-		geom.Edges(posedges)=geom.Edges(posedges)-1;
+-
+-		%update counter
+-		i=i-1;
+-	end
+-end
+-if num,
+-	disp(['WARNING: ' num2str(num) ' points outside the domain outline have been removed']);
+-end
+-
+-%Check point spacing
+-if ~isnan(tol),
+-	disp('Checking point spacing...');
+-	i=0;
+-	while (i<size(geom.Vertices,1)),
+-
+-		%vertex counter
+-		i=i+1;
+-
+-		%Get coordinates
+-		x1=geom.Vertices(i,1);
+-		y1=geom.Vertices(i,2);
+-
+-		j=i; %test edges located AFTER i only
+-		while (j<size(geom.Vertices,1)),
+-
+-			%vertex counter
+-			j=j+1;
+-
+-			%Get coordinates
+-			x2=geom.Vertices(j,1);
+-			y2=geom.Vertices(j,2);
+-
+-			%Check whether the two vertices are too close
+-			if ((x2-x1)^2+(y2-y1)^2<tol^2)
+-
+-				%Remove points from list of Vertices
+-				geom.Vertices(j,:)=[];
+-
+-				%update edges
+-				posedges=find(ismember(geom.Edges,j));
+-				geom.Edges(posedges)=i;
+-				posedges=find(geom.Edges>j);
+-				geom.Edges(posedges)=geom.Edges(posedges)-1;
+-
+-				%update counter
+-				j=j-1;
+-
+-			end
+-		end
+-	end
+-end
+-%remove empty edges
+-geom.Edges(find(geom.Edges(:,1)==geom.Edges(:,2)),:)=[];
+-end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/findsegments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/findsegments.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/findsegments.m	(revision 13009)
+@@ -1,92 +0,0 @@
+-function segments=findsegments(md,varargin)
+-%FINDSEGMENTS - build segments model field
+-%
+-%   Optional inputs:
+-%      'mesh.elementconnectivity'
+-%
+-%   Usage:
+-%      segments=findsegments(md,varargin);
+-
+-%get options
+-options=pairoptions(varargin{:});
+-
+-%Get connectivity
+-mesh.elementconnectivity=getfieldvalue(options,'mesh.elementconnectivity',md.mesh.elementconnectivity);
+-
+-%Now, build the connectivity tables for this mesh if not correclty done
+-if size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements,
+-	if exist(options,'mesh.elementconnectivity'),
+-		error(' ''mesh.elementconnectivity'' option does not have thge right size.');
+-	else
+-		mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-	end
+-end
+-
+-%Recreate the segments
+-elementonboundary=double(mesh.elementconnectivity(:,3)==0);
+-pos=find(elementonboundary);
+-num_segments=length(pos);
+-segments=zeros(num_segments,3);
+-count=1;
+-
+-%loop over the segments
+-for i=1:num_segments,
+-
+-	%get current element on boundary
+-	el1=pos(i);
+-
+-	%get elements connected to el1
+-	els2=mesh.elementconnectivity(el1,find(mesh.elementconnectivity(el1,:)));
+-
+-	%el1 is connected to 2 other elements
+-	if length(els2)>1,
+-
+-		%get nodes of el1
+-		nods1=md.mesh.elements(el1,:);
+-
+-		%find the common vertices to the two elements connected to el1 (1 or 2)
+-		flag=intersect(md.mesh.elements(els2(1),:),md.mesh.elements(els2(2),:));
+-
+-		%get the vertices on the boundary and build segment
+-		nods1(find(ismember(nods1,flag)))=[];
+-		segments(count,:)=[nods1 el1];
+-
+-		%swap segment nodes if necessary
+-		ord1=find(nods1(1)==md.mesh.elements(el1,:));
+-		ord2=find(nods1(2)==md.mesh.elements(el1,:));
+-		if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
+-			temp=segments(count,1);
+-			segments(count,1)=segments(count,2);
+-			segments(count,2)=temp;
+-		end
+-		segments(count,1:2)=fliplr(segments(count,1:2));
+-		count=count+1;
+-
+-	%el1 is connected to only one element
+-	else
+-		%get nodes of el1
+-		nods1=md.mesh.elements(el1,:);
+-
+-		%find the vertex  the el1 to not share with els2
+-		flag=setdiff(nods1,md.mesh.elements(els2,:));
+-
+-		for j=1:3,
+-			nods=nods1; nods(j)=[];
+-			if any(ismember(flag,nods)),
+-
+-				segments(count,:)=[nods el1];
+-
+-				%swap segment nodes if necessary
+-				ord1=find(nods(1)==md.mesh.elements(el1,:));
+-				ord2=find(nods(2)==md.mesh.elements(el1,:));
+-				if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
+-					temp=segments(count,1);
+-					segments(count,1)=segments(count,2);
+-					segments(count,2)=temp;
+-				end
+-				segments(count,1:2)=fliplr(segments(count,1:2));
+-				count=count+1;
+-			end
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_tri.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_tri.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_tri.m	(revision 13009)
+@@ -1,204 +0,0 @@
+-function [FV] = sphere_tri(shape,maxlevel,r,winding)
+-
+-% sphere_tri - generate a triangle mesh approximating a sphere
+-% 
+-% Usage: FV = sphere_tri(shape,Nrecurse,r,winding)
+-% 
+-%   shape is a string, either of the following:
+-%   'ico'   starts with icosahedron (most even, default)
+-%   'oct'   starts with octahedron
+-%   'tetra' starts with tetrahedron (least even)
+-%
+-%   Nrecurse is int >= 0, setting the recursions (default 0)
+-%
+-%   r is the radius of the sphere (default 1)
+-%
+-%   winding is 0 for clockwise, 1 for counterclockwise (default 0).  The
+-%   matlab patch command gives outward surface normals for clockwise
+-%   order of vertices in the faces (viewed from outside the surface).
+-%
+-%   FV has fields FV.vertices and FV.faces.  The vertices 
+-%   are listed in clockwise order in FV.faces, as viewed 
+-%   from the outside in a RHS coordinate system.
+-% 
+-% The function uses recursive subdivision.  The first
+-% approximation is an platonic solid, either an  icosahedron,
+-% octahedron or a tetrahedron.  Each level of refinement 
+-% subdivides each triangle face by a factor of 4 (see also 
+-% mesh_refine).  At each refinement, the vertices are 
+-% projected to the sphere surface (see sphere_project).
+-% 
+-% A recursion level of 3 or 4 is a good sphere surface, if
+-% gouraud shading is used for rendering.
+-% 
+-% The returned struct can be used in the patch command, eg:
+-% 
+-% % create and plot, vertices: [2562x3] and faces: [5120x3]
+-% FV = sphere_tri('ico',4,1);
+-% lighting phong; shading interp; figure;
+-% patch('vertices',FV.vertices,'faces',FV.faces,...
+-%       'facecolor',[1 0 0],'edgecolor',[.2 .2 .6]);
+-% axis off; camlight infinite; camproj('perspective');
+-% 
+-% See also: mesh_refine, sphere_project
+-%
+-
+-
+-
+-% $Revision: 1.2 $ $Date: 2005/07/20 23:07:03 $
+-
+-% Licence:  GNU GPL, no implied or express warranties
+-% Jon Leech (leech @ cs.unc.edu) 3/24/89
+-% icosahedral code added by Jim Buddenhagen (jb1556@daditz.sbc.com) 5/93
+-% 06/2002, adapted from c to matlab by Darren.Weber_at_radiology.ucsf.edu
+-% 05/2004, reorder of the faces for the 'ico' surface so they are indeed
+-% clockwise!  Now the surface normals are directed outward.  Also reset the
+-% default recursions to zero, so we can get out just the platonic solids.
+-%
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-
+-eegversion = '$Revision: 1.2 $';
+-fprintf('SPHERE_TRI [v %s]\n',eegversion(11:15)); tic
+-
+-if ~exist('shape','var') || isempty(shape),
+-    shape = 'ico';
+-end
+-fprintf('...creating sphere tesselation based on %s\n',shape);
+-
+-% default maximum subdivision level
+-if ~exist('maxlevel','var') || isempty(maxlevel) || maxlevel < 0,
+-    maxlevel = 0;
+-end
+-
+-% default radius
+-if ~exist('r','var') || isempty(r),
+-    r = 1;
+-end
+-
+-if ~exist('winding','var') || isempty(winding),
+-    winding = 0;
+-end
+-
+-
+-% -----------------
+-% define the starting shapes
+-
+-shape = lower(shape);
+-
+-switch shape,
+-case 'tetra',
+-    
+-    % Vertices of a tetrahedron
+-    sqrt_3 = 0.5773502692;
+-    
+-    tetra.v = [  sqrt_3,  sqrt_3,  sqrt_3 ;   % +X, +Y, +Z  - PPP
+-                -sqrt_3, -sqrt_3,  sqrt_3 ;   % -X, -Y, +Z  - MMP
+-                -sqrt_3,  sqrt_3, -sqrt_3 ;   % -X, +Y, -Z  - MPM
+-                 sqrt_3, -sqrt_3, -sqrt_3 ];  % +X, -Y, -Z  - PMM
+-	
+-    % Structure describing a tetrahedron
+-    tetra.f = [ 1, 2, 3;
+-                1, 4, 2;
+-                3, 2, 4;
+-                4, 1, 3 ];
+-    
+-    FV.vertices = tetra.v;
+-    FV.faces    = tetra.f;
+-    
+-case 'oct',
+-    
+-    % Six equidistant points lying on the unit sphere
+-    oct.v = [  1,  0,  0 ;  %  X
+-              -1,  0,  0 ; 	% -X
+-               0,  1,  0 ;  %  Y
+-               0, -1,  0 ; 	% -Y
+-               0,  0,  1 ; 	%  Z
+-               0,  0, -1 ];	% -Z
+-	
+-    % Join vertices to create a unit octahedron
+-    oct.f = [ 1 5 3 ;    %  X  Z  Y  -  First the top half
+-              3 5 2 ;    %  Y  Z -X
+-              2 5 4 ;    % -X  Z -Y
+-              4 5 1 ;    % -Y  Z  X
+-              1 3 6 ;    %  X  Y -Z  -  Now the bottom half
+-              3 2 6 ;    %  Y  Z -Z
+-              2 4 6 ;    % -X  Z -Z
+-              4 1 6 ];   % -Y  Z -Z
+-    
+-    FV.vertices = oct.v;
+-    FV.faces    = oct.f;
+-    
+-case 'ico',
+-    
+-    % Twelve vertices of icosahedron on unit sphere
+-    tau = 0.8506508084; % t=(1+sqrt(5))/2, tau=t/sqrt(1+t^2)
+-    one = 0.5257311121; % one=1/sqrt(1+t^2) , unit sphere
+-    
+-    ico.v( 1,:) = [  tau,  one,    0 ]; % ZA
+-    ico.v( 2,:) = [ -tau,  one,    0 ]; % ZB
+-    ico.v( 3,:) = [ -tau, -one,    0 ]; % ZC
+-    ico.v( 4,:) = [  tau, -one,    0 ]; % ZD
+-    ico.v( 5,:) = [  one,   0 ,  tau ]; % YA
+-    ico.v( 6,:) = [  one,   0 , -tau ]; % YB
+-    ico.v( 7,:) = [ -one,   0 , -tau ]; % YC
+-    ico.v( 8,:) = [ -one,   0 ,  tau ]; % YD
+-    ico.v( 9,:) = [   0 ,  tau,  one ]; % XA
+-    ico.v(10,:) = [   0 , -tau,  one ]; % XB
+-    ico.v(11,:) = [   0 , -tau, -one ]; % XC
+-    ico.v(12,:) = [   0 ,  tau, -one ]; % XD
+-    
+-    % Structure for unit icosahedron
+-    ico.f = [  5,  8,  9 ;
+-               5, 10,  8 ;
+-               6, 12,  7 ;
+-               6,  7, 11 ;
+-               1,  4,  5 ;
+-               1,  6,  4 ;
+-               3,  2,  8 ;
+-               3,  7,  2 ;
+-               9, 12,  1 ;
+-               9,  2, 12 ;
+-              10,  4, 11 ;
+-              10, 11,  3 ;
+-               9,  1,  5 ;
+-              12,  6,  1 ;
+-               5,  4, 10 ;
+-               6, 11,  4 ;
+-               8,  2,  9 ;
+-               7, 12,  2 ;
+-               8, 10,  3 ;
+-               7,  3, 11 ];
+-	
+-    FV.vertices = ico.v;
+-    FV.faces    = ico.f;
+-end
+-
+-
+-% -----------------
+-% refine the starting shapes with subdivisions
+-if maxlevel,
+-    
+-    % Subdivide each starting triangle (maxlevel) times
+-    for level = 1:maxlevel,
+-        
+-        % Subdivide each triangle and normalize the new points thus
+-        % generated to lie on the surface of a sphere radius r.
+-        FV = mesh_refine_tri4(FV);
+-        FV.vertices = sphere_project(FV.vertices,r);
+-        
+-        % An alternative might be to define a min distance
+-        % between vertices and recurse or use fminsearch
+-        
+-    end
+-end
+-
+-if winding,
+-    fprintf('...returning counterclockwise vertex order (viewed from outside)\n');
+-    FV.faces = FV.faces(:,[1 3 2]);
+-else
+-    fprintf('...returning clockwise vertex order (viewed from outside)\n');
+-end
+-
+-t=toc; fprintf('...done (%6.2f sec)\n\n',t);
+-
+-return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/mesh_refine_tri4.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/mesh_refine_tri4.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/mesh_refine_tri4.m	(revision 13009)
+@@ -1,146 +0,0 @@
+-function [ FV ] = mesh_refine_tri4(FV)
+-
+-% mesh_refine_tri4 - creates 4 triangle from each triangle of a mesh
+-%
+-% [ FV ] = mesh_refine_tri4( FV )
+-%
+-% FV.vertices   - mesh vertices (Nx3 matrix)
+-% FV.faces      - faces with indices into 3 rows
+-%                 of FV.vertices (Mx3 matrix)
+-% 
+-% For each face, 3 new vertices are created at the 
+-% triangle edge midpoints.  Each face is divided into 4
+-% faces and returned in FV.
+-%
+-%        B
+-%       /\
+-%      /  \
+-%    a/____\b       Construct new triangles
+-%    /\    /\       [A,a,c]
+-%   /  \  /  \      [a,B,b]
+-%  /____\/____\     [c,b,C]
+-% A	     c	   C    [a,b,c]
+-% 
+-% It is assumed that the vertices are listed in clockwise order in
+-% FV.faces (A,B,C above), as viewed from the outside in a RHS coordinate
+-% system.
+-% 
+-% See also: mesh_refine, sphere_tri, sphere_project
+-% 
+-
+-
+-% ---this method is not implemented, but the idea here remains...
+-% This can be done until some minimal distance (D) of the mean 
+-% distance between vertices of all triangles is achieved.  If
+-% no D argument is given, the function refines the mesh once.
+-% Alternatively, it could be done until some minimum mean 
+-% area of faces is achieved.  As is, it just refines once.
+-
+-
+-% $Revision: 1.1 $ $Date: 2004/11/12 01:32:35 $
+-
+-% Licence:  GNU GPL, no implied or express warranties
+-% History:  05/2002, Darren.Weber_at_radiology.ucsf.edu, created
+-%
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-
+-tic;
+-fprintf('...refining mesh (tri4)...')
+-
+-% NOTE
+-% The centroid is located one third of the way from each vertex to 
+-% the midpoint of the opposite side. Each median divides the triangle 
+-% into two equal areas; all the medians together divide it into six 
+-% equal parts, and the lines from the median point to the vertices 
+-% divide the whole into three equivalent triangles.
+-
+-% Each input triangle with vertices labelled [A,B,C] as shown
+-% below will be turned into four new triangles:
+-%
+-% Make new midpoints
+-% a = (A+B)/2
+-% b = (B+C)/2
+-% c = (C+A)/2
+-%
+-%        B
+-%       /\
+-%      /  \
+-%    a/____\b       Construct new triangles
+-%    /\    /\       [A,a,c]
+-%   /  \  /  \      [a,B,b]
+-%  /____\/____\     [c,b,C]
+-% A	     c	   C    [a,b,c]
+-%
+-
+-% Initialise a new vertices and faces matrix
+-Nvert = size(FV.vertices,1);
+-Nface = size(FV.faces,1);
+-V2 = zeros(Nface*3,3);
+-F2 = zeros(Nface*4,3);
+-
+-for f = 1:Nface,
+-    
+-    % Get the triangle vertex indices
+-    NA = FV.faces(f,1);
+-    NB = FV.faces(f,2);
+-    NC = FV.faces(f,3);
+-    
+-    % Get the triangle vertex coordinates
+-    A = FV.vertices(NA,:);
+-    B = FV.vertices(NB,:);
+-    C = FV.vertices(NC,:);
+-    
+-    % Now find the midpoints between vertices
+-    a = (A + B) ./ 2;
+-    b = (B + C) ./ 2;
+-    c = (C + A) ./ 2;
+-    
+-    % Find the length of each median
+-    %A2blen = sqrt ( sum( (A - b).^2, 2 ) );
+-    %B2clen = sqrt ( sum( (B - c).^2, 2 ) );
+-    %C2alen = sqrt ( sum( (C - a).^2, 2 ) );
+-    
+-    % Store the midpoint vertices, while
+-    % checking if midpoint vertex already exists
+-    [FV, Na] = mesh_find_vertex(FV,a);
+-    [FV, Nb] = mesh_find_vertex(FV,b);
+-    [FV, Nc] = mesh_find_vertex(FV,c);
+-    
+-    % Create new faces with orig vertices plus midpoints
+-    F2(f*4-3,:) = [ NA, Na, Nc ];
+-    F2(f*4-2,:) = [ Na, NB, Nb ];
+-    F2(f*4-1,:) = [ Nc, Nb, NC ];
+-    F2(f*4-0,:) = [ Na, Nb, Nc ];
+-    
+-end
+-
+-% Replace the faces matrix
+-FV.faces = F2;
+-
+-t=toc; fprintf('done (%5.2f sec)\n',t);
+-
+-return
+-
+-
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-function [FV, N] = mesh_find_vertex(FV,vertex)
+-
+-    Vn = size(FV.vertices,1);
+-    Va = repmat(vertex,Vn,1);
+-    Vexist = find( FV.vertices(:,1) == Va(:,1) & ...
+-                   FV.vertices(:,2) == Va(:,2) & ...
+-                   FV.vertices(:,3) == Va(:,3) );
+-    if Vexist,
+-        if size(Vexist) == [1,1],
+-            N = Vexist;
+-        else,
+-            msg = sprintf('replicated vertices');
+-            error(msg);
+-        end
+-    else
+-        FV.vertices(end+1,:) = vertex;
+-        N = size(FV.vertices,1);
+-    end
+-
+-return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmesher.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmesher.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmesher.m	(revision 13009)
+@@ -1,35 +0,0 @@
+-function md=planetmesher(md,varargin)
+-%PLANETMESHER - create planet mesh using several packages
+-%
+-%   This routine creates a planet mesh using several packages: a custom made 
+-%   ISSM mesher (called planetmixedmesh.m, method 'mixed') and the planettrimesh
+-%   (method 'tria')
+-%   where md is a @planet object, varargin is a list of options
+-%
+-% Usage: md=planetmesher(md,'method','mixed','radius',6378000,'angleresol',1);
+-%        md=planetmesher(md,'method','tria','shape','iso','radius',6378000,'refinement',5);
+-%
+-%
+-
+-	%recover options
+-	options=pairoptions(varargin{:});
+-
+-	method=getfieldvalue(options,'method','mixed');
+-
+-	if strcmpi(method,'mixed'),
+-		%recover radius and angleresol: 
+-		radius=getfieldvalue(options,'radius',6378000); %earth radius as default
+-		angleresol=getfieldvalue(options,'angleresol',10); %10 degree resolution
+-
+-		%call mixed mesh 
+-		md=planetmixedmesh(md,radius,angleresol);
+-	else
+-		%recover radius, shape and level of refinmenet
+-		radius=getfieldvalue(options,'radius',6378000); %earth radius as default
+-		refinement=getfieldvalue(options,'refinement',5); %refine 5 times
+-		shape=getfieldvalue(options,'shape','ico'); 
+-
+-		%call triangular mesh
+-		md=planettrimesh(md,shape,radius,refinement);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m	(revision 13009)
+@@ -1,99 +0,0 @@
+-function md=planetmixedmesh(md,radius,angleresol)
+-%PLANETMIXEDMESH: build 2d shell mesh
+-%
+-% Usage: md=planetmixedshell(md,radius,angleresol)
+-%
+-
+-conv=pi/180;
+-
+-r=radius;
+-theta=(0:angleresol:360)';
+-theta=theta*conv;
+-phi=(0:angleresol:180)';
+-phi=phi(2:end-1)*conv;
+-
+-nphi=length(phi);
+-nthetha=length(theta);
+-
+-x=zeros(nphi*nthetha,1);
+-y=zeros(nphi*nthetha,1);
+-z=zeros(nphi*nthetha,1);
+-
+-for i=1:nphi,
+-	phii=phi(i);
+-	x((i-1)*nthetha+1:i*nthetha)=r.*cos(theta).*sin(phii);
+-	y((i-1)*nthetha+1:i*nthetha)=r.*sin(theta).*sin(phii);
+-	z((i-1)*nthetha+1:i*nthetha)=r.*cos(phii);
+-end
+-
+-quads=zeros((nthetha-1)*(nphi-1),4);
+-
+-%build elements
+-for i=1:nphi-1,
+-	for j=1:nthetha-1,
+-		count=(i-1)*(nthetha-1)+j;
+-	
+-		A=(i-1)*nthetha+j;
+-		B=(i-1)*nthetha+j+1;
+-		C=(i)*nthetha+j+1;
+-		D=(i)*nthetha+j;
+-		
+-		quads(count,:)=[A B C D];
+-	end
+-end
+-
+-%now, add polar elements:
+-%first north: phi = 0;
+-x=[r.*cos(0).*sin(0);x];
+-y=[r.*sin(0).*sin(0);y];
+-z=[r.*cos(0);z];
+-
+-%add 1 to quads: 
+-quads=quads+1;
+-
+-%add tria elements:
+-trias=zeros(nthetha-1,4);
+-
+-for i=1:nthetha-1,
+-	A=1;
+-	B=i+1;
+-	C=i+2;
+-	trias(i,:)=[A B C NaN];
+-end
+-
+-quads=[trias;quads];
+-
+-
+-% now add south pole: 
+-phii=180*conv;
+-x=[x;r.*cos(phii).*sin(phii)];
+-y=[y;r.*sin(phii).*sin(phii)];
+-z=[z;r.*cos(phii)];
+-nods=length(x);
+-
+-%add tria elements:
+-trias=zeros(nthetha-1,4);
+-
+-start=nods-nthetha;
+-for i=1:nthetha-1,
+-	A=start+i-1;
+-	B=start+i;
+-	C=nods;
+-	trias(i,:)=[A B C NaN];
+-end
+-
+-quads=[quads;trias];
+-
+-
+-md.mesh.elements=quads;
+-md.mesh.x=x;
+-md.mesh.y=y;
+-md.mesh.z=z;
+-md.mesh.r=sqrt(x.^2+y.^2+z.^2);
+-md.mesh.theta=acos(z./md.mesh.r);
+-md.mesh.phi=atan2(y,x);
+-
+-md.mesh.numberofvertices=length(md.mesh.x);
+-md.mesh.numberofelements=size(md.mesh.elements,1);
+-
+-md.mesh.dimension=3;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_project.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_project.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/sphere_project.m	(revision 13009)
+@@ -1,66 +0,0 @@
+-function V = sphere_project(v,r,c)
+-
+-% sphere_project - project point X,Y,Z to the surface of sphere radius r
+-% 
+-% V = sphere_project(v,r,c)
+-% 
+-% Cartesian inputs:
+-% v is the vertex matrix, Nx3 (XYZ)
+-% r is the sphere radius, 1x1 (default 1)
+-% c is the sphere centroid, 1x3 (default 0,0,0)
+-%
+-% XYZ are converted to spherical coordinates and their radius is
+-% adjusted according to r, from c toward XYZ (defined with theta,phi)
+-% 
+-% V is returned as Cartesian 3D coordinates
+-% 
+-
+-% $Revision: 1.1 $ $Date: 2004/11/12 01:32:36 $
+-
+-% Licence:  GNU GPL, no implied or express warranties
+-% History:  06/2002, Darren.Weber_at_radiology.ucsf.edu, created
+-%
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-
+-if ~exist('v','var'),
+-    msg = sprintf('SPHERE_PROJECT: No input vertices (X,Y,Z)\n');
+-    error(msg);
+-end
+-
+-X = v(:,1);
+-Y = v(:,2);
+-Z = v(:,3);
+-
+-if ~exist('c','var'),
+-    xo = 0;
+-    yo = 0;
+-    zo = 0;
+-else
+-    xo = c(1);
+-    yo = c(2);
+-    zo = c(3);
+-end
+-
+-if ~exist('r','var'), r = 1; end
+-
+-% alternate method is to use unit vector of V
+-% [ n = 'magnitude(V)'; unitV = V ./ n; ]
+-% to change the radius, multiply the unitV
+-% by the radius required.  This avoids the
+-% use of arctan functions, which have branches.
+-
+-
+-% Convert Cartesian X,Y,Z to spherical (radians)
+-theta = atan2( (Y-yo), (X-xo) );
+-phi   = atan2( sqrt( (X-xo).^2 + (Y-yo).^2 ), (Z-zo) );
+-% do not calc: r = sqrt( (X-xo).^2 + (Y-yo).^2 + (Z-zo).^2);
+-
+-%   Recalculate X,Y,Z for constant r, given theta & phi.
+-R = ones(size(phi)) * r;
+-x = R .* sin(phi) .* cos(theta);
+-y = R .* sin(phi) .* sin(theta);
+-z = R .* cos(phi);
+-
+-V = [x y z];
+-
+-return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planettrimesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planettrimesh.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/planet/planettrimesh.m	(revision 13009)
+@@ -1,20 +0,0 @@
+-function md=planettrimesh(md,shape,radius,refinement)
+-%PLANETTRIMESH: build 2d shell mesh
+-%
+-% Usage: md=planettrimesh(md,shape,radius,refinement)
+-%
+-
+-results = sphere_tri(shape,refinement,radius);
+-md.mesh.x=results.vertices(:,1);
+-md.mesh.y=results.vertices(:,2);
+-md.mesh.z=results.vertices(:,3);
+-md.mesh.elements=results.faces;
+-
+-md.mesh.r=sqrt(md.mesh.x.^2+md.mesh.y.^2+md.mesh.z.^2);
+-md.mesh.theta=acos(md.mesh.z./md.mesh.r);
+-md.mesh.phi=atan2(md.mesh.y,md.mesh.x);
+-
+-md.mesh.numberofvertices=length(md.mesh.x);
+-md.mesh.numberofelements=size(md.mesh.elements,1);
+-
+-md.mesh.dimension=3;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/yams.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/yams.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/yams.m	(revision 13009)
+@@ -1,171 +0,0 @@
+-function md=yams(md,varargin);
+-%MESHYAMS - Build model of Antarctica by refining according to observed velocity error estimator
+-%
+-%   Usage:
+-%      md=yams(md,varargin);
+-%      where varargin is a lit of paired arguments. 
+-%      arguments can be: 'domainoutline': Argus file containing the outline of the domain to be meshed
+-%      arguments can be: 'velocities': matlab file containing the velocities [m/yr]
+-%      optional arguments: 'groundeddomain': Argus file containing the outline of the grounded ice
+-%                          this option is used to minimize the metric on water (no refinement)
+-%      optional arguments: 'resolution': initial mesh resolution [m]
+-%      optional arguments: 'nsteps': number of steps of mesh adaptation
+-%      optional arguments: 'epsilon': average interpolation error wished [m/yr]
+-%      optional arguments: 'hmin': minimum edge length
+-%      optional arguments: 'hmanx': maximum edge
+-%      optional arguments: 'riftoutline': if rifts are present, specifies rift outline file.
+-%      
+-%
+-%   Examples:
+-%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat');
+-%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat','groundeddomain','ground.exp');
+-%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat','groundeddomain','ground.exp','nsteps',6,'epsilon',2,'hmin',500,'hmax',30000);
+-
+-%recover options
+-options=pairoptions(varargin{:});
+-options=deleteduplicates(options,1);
+-
+-%recover some fields
+-disp('MeshYams Options:')
+-domainoutline=getfieldvalue(options,'domainoutline');
+-disp(sprintf('   %-15s: ''%s''','DomainOutline',domainoutline));
+-riftoutline=getfieldvalue(options,'riftoutline','N/A');
+-disp(sprintf('   %-15s: ''%s''','riftoutline',riftoutline));
+-groundeddomain=getfieldvalue(options,'groundeddomain','N/A');
+-disp(sprintf('   %-15s: ''%s''','GroundedDomain',groundeddomain));
+-velocities=getfieldvalue(options,'velocities');
+-disp(sprintf('   %-15s: ''%s''','Velocities',velocities));
+-resolution=getfieldvalue(options,'resolution',5000);
+-disp(sprintf('   %-15s: %f','Resolution',resolution));
+-nsteps=getfieldvalue(options,'nsteps',6);
+-disp(sprintf('   %-15s: %i','nsteps',nsteps));
+-gradation=getfieldvalue(options,'gradation',2*ones(nsteps,1));
+-disp(sprintf('   %-15s: %g','gradation',gradation(1)));
+-epsilon=getfieldvalue(options,'epsilon',3);
+-disp(sprintf('   %-15s: %f','epsilon',epsilon));
+-hmin=getfieldvalue(options,'hmin',500);
+-disp(sprintf('   %-15s: %f','hmin',hmin));
+-hmax=getfieldvalue(options,'hmax',150*10^3);
+-disp(sprintf('   %-15s: %f\n','hmax',hmax));
+-
+-%mesh with initial resolution
+-disp('Initial mesh generation...');
+-if strcmpi(riftoutline,'N/A');
+-	md=setmesh(md,domainoutline,resolution);
+-else
+-	md=setmesh(md,domainoutline,riftoutline,resolution);
+-	md=meshprocessrifts(md,domainoutline);
+-end
+-disp(['Initial mesh, number of elements: ' num2str(md.mesh.numberofelements)]);
+-
+-%load velocities 
+-disp('loading velocities...');
+-Names=VelFindVarNames(velocities);
+-Vel=load(velocities);
+-
+-%start mesh adaptation
+-for i=1:nsteps,
+-	disp(['Iteration #' num2str(i) '/' num2str(nsteps)]);
+-
+-	%interpolate velocities onto mesh
+-	disp('   interpolating velocities...');
+-	if strcmpi(Names.interp,'node'),
+-		vx_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
+-		vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
+-	else
+-		vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
+-		vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
+-	end
+-	field=sqrt(vx_obs.^2+vy_obs.^2);
+-
+-	%set mask.vertexonwater  field
+-	if ~strcmp(groundeddomain,'N/A'),
+-		nodeground=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,groundeddomain,'node',2);
+-		md.mask.vertexonwater=ones(md.mesh.numberofvertices,1);
+-		md.mask.vertexonwater(find(nodeground))=0;
+-	else
+-		md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
+-	end
+-
+-	%adapt according to velocities
+-	disp('   adapting...');
+-	md=YamsCall(md,field,hmin,hmax,gradation(i),epsilon);
+-
+-	%if we have rifts, we just messed them up, we need to recreate the segments that constitute those 
+-	%rifts, because the segments are used in YamsCall to freeze the rifts elements during refinement.
+-	if md.rifts.numrifts, 
+-		md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-		md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-		md.mesh.segments=findsegments(md);
+-		md=yamsrecreateriftsegments(md);
+-	end
+-
+-end
+-	
+-disp(['Final mesh, number of elements: ' num2str(md.mesh.numberofelements)]);
+-
+-%Now, build the connectivity tables for this mesh.
+-md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-
+-%recreate segments
+-md.mesh.segments=findsegments(md);
+-md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+-
+-%Fill in rest of fields:
+-md.mesh.z=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+-if ~strcmp(groundeddomain,'N/A'),
+-	nodeground=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,groundeddomain,'node',2);
+-	md.mask.vertexonwater=ones(md.mesh.numberofvertices,1);
+-	md.mask.vertexonwater(find(nodeground))=0;
+-else
+-	md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
+-end
+-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);
+-else
+-	md.inversion.vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
+-	md.inversion.vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
+-end
+-md.inversion.vel_obs=sqrt(md.inversion.vx_obs.^2+md.inversion.vy_obs.^2);
+-
+-%deal with rifts 
+-if md.rifts.numrifts,
+-	%first, recreate rift segments
+-	md=meshyamsrecreateriftsegments(md);
+-
+-	%using the segments, recreate the penaltypairs
+-	for j=1:md.rifts.numrifts,
+-		rift=md.rifts.riftstruct(j);
+-
+-		%build normals and lengths of segments:
+-		lengths=sqrt((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))).^2 + (md.mesh.y(rift.segments(:,1))-md.mesh.y(rift.segments(:,2))).^2 );
+-		normalsx=cos(atan2((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))) , (md.mesh.y(rift.segments(:,2))-md.mesh.y(rift.segments(:,1)))));
+-		normalsy=sin(atan2((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))) , (md.mesh.y(rift.segments(:,2))-md.mesh.y(rift.segments(:,1)))));
+-
+-		%ok, build penaltypairs: 
+-		numpenaltypairs=length(rift.segments)/2-1;
+-		rift.penaltypairs=zeros(numpenaltypairs,7);
+-
+-		for i=1:numpenaltypairs,
+-			rift.penaltypairs(i,1)=rift.segments(i,2);
+-			rift.penaltypairs(i,2)=rift.segments(end-i,2);
+-			rift.penaltypairs(i,3)=rift.segments(i,3);
+-			rift.penaltypairs(i,4)=rift.segments(end-i,3);
+-			rift.penaltypairs(i,5)=normalsx(i)+normalsx(i+1);
+-			rift.penaltypairs(i,6)=normalsy(i)+normalsy(i+1);
+-			rift.penaltypairs(i,7)=(lengths(i)+lengths(i+1))/2;
+-		end
+-		%renormalize norms: 
+-		norms=sqrt(rift.penaltypairs(:,5).^2+rift.penaltypairs(:,6).^2);
+-		rift.penaltypairs(:,5)=rift.penaltypairs(:,5)./norms;
+-		rift.penaltypairs(:,6)=rift.penaltypairs(:,6)./norms;
+-
+-		md.rifts.riftstruct(j)=rift;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshplug.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshplug.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshplug.m	(revision 13009)
+@@ -1,89 +0,0 @@
+-function [elements,x,y,z,numberofelements,numberofnodes,elconv,nodeconv,elconv2,nodeconv2]=meshplug(elements,x,y,z,elements2,x2,y2,z2,extractednodes,extractedelements,domain);
+-%MESHPLUG - embed mesh into another one
+-%     See also meshaddrifts
+-
+-
+-%initialize elconv,nodeconv conversion tables from md mesh to new md mesh
+-elconv=1:size(elements,1); elconv=elconv';
+-nodeconv=1:size(x,1); nodeconv=nodeconv';
+-
+-%take away old elements in area of interest: 
+-elements(extractedelements,:)=[];
+-element_offset=size(elements,1);
+-
+-%update elconv after having extracted the area of interest elements
+-temp_elconv=elconv; temp_elconv(extractedelements)=[];
+-temp_elconvnum=1:length(temp_elconv);
+-elconv(temp_elconv)=temp_elconvnum;
+-elconv(extractedelements)=NaN;
+-
+-%initialize elconv2 and nodeconv2, conversion tables from md2 mesh to new md mesh
+-elconv2=1:size(elements2,1);elconv2=elconv2'+element_offset;
+-nodeconv2=(size(x,1)+1):(size(x,1)+size(x2,1)); nodeconv2=nodeconv2';
+-
+-extractednodes_minusborder=extractednodes;
+-extractednodes_minusborder(domain)=[];
+-
+-x(extractednodes_minusborder)=NaN;
+-y(extractednodes_minusborder)=NaN;
+-
+-%now, plug md2 mesh: 
+-
+-%first, offset all ids of md2 mesh
+-elements2=elements2+length(x);
+-
+-%NaN border nodes in second mesh
+-x2(1:length(domain))=NaN;
+-y2(1:length(domain))=NaN;
+-
+-%redirect border nodes in elements2  to elements
+-for i=1:length(domain),
+-	pos=find(elements2==(i+length(x)));
+-	elements2(pos)=extractednodes(domain(i));
+-end
+-
+-%same deal for nodeconv2:
+-for i=1:length(domain),
+-	nodeconv2(i)=extractednodes(domain(i));
+-end
+-
+-
+-%plug elements
+-elements=[elements;elements2];
+-
+-
+-%now, increase number of nodes
+-x=[x; x2];
+-y=[y; y2];
+-z=[z; z2];
+-
+-%now, get rid of NaN in x:
+-while  ~isempty(find(isnan(x))),
+-
+-	pos=find(isnan(x));
+-	node=pos(1);
+-
+-	%collapse node
+-	x(node)=[];
+-	y(node)=[];
+-	z(node)=[];
+-
+-	%renumber all nodes > node in elements
+-	pos=find(elements>node);
+-	elements(pos)=elements(pos)-1;
+-
+-	%same deal for nodeconv2: 
+-	pos=find(nodeconv2>node);
+-	nodeconv2(pos)=nodeconv2(pos)-1;
+-
+-end
+-
+-numberofnodes=length(x);
+-numberofelements=length(elements);
+-
+-%finish nodeconv: 
+-temp_nodeconv=nodeconv;  temp_nodeconv(extractednodes_minusborder)=[];
+-temp_nodeconvnum=1:length(temp_nodeconv);
+-nodeconv(temp_nodeconv)=temp_nodeconvnum;
+-nodeconv(extractednodes_minusborder)=NaN;
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshyamsrecreateriftsegments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshyamsrecreateriftsegments.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshyamsrecreateriftsegments.m	(revision 13009)
+@@ -1,90 +0,0 @@
+-function md=meshyamsrecreateriftsegments(md)
+-
+-	%recreate rift segments: just used for yams. temporaroy routine.
+-	pos_record=[];
+-	if md.rifts.numrifts,
+-		for i=1:md.rifts.numrifts,
+-			rift=md.rifts.riftstruct(i);
+-
+-			%closed rifts first:
+-			if length(rift.tips)==2,
+-
+-				%find tip1 and tip2 for this rift, in the new mesh created by yams.
+-				pos=find_point(md.mesh.x(md.mesh.segments(:,1)),md.mesh.y(md.mesh.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
+-				tip1=md.mesh.segments(pos,1);
+-				pos=find_point(md.mesh.x(md.mesh.segments(:,1)),md.mesh.y(md.mesh.segments(:,1)),rift.tip2coordinates(1),rift.tip2coordinates(2));
+-				tip2=md.mesh.segments(pos,1);
+-
+-				%start from tip1, and build segments of this rift. 
+-				pos=find_point(md.mesh.x(md.mesh.segments(:,1)),md.mesh.y(md.mesh.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
+-				pos_record=[pos_record; pos];
+-				riftsegs=md.mesh.segments(pos,:);
+-				while 1,
+-					A=riftsegs(end,1); B=riftsegs(end,2); el=riftsegs(end,3);
+-					%find other segment that holds B.
+-					pos=find(md.mesh.segments(:,1)==B);
+-					pos_record=[pos_record; pos];
+-					riftsegs=[riftsegs; md.mesh.segments(pos,:)];
+-					if riftsegs(end,2)==tip1, 
+-						break;
+-					end
+-				end
+-				md.rifts.riftstruct(i).segments=riftsegs;
+-				md.rifts.riftstruct(i).tips=[tip1 tip2];
+-
+-			else
+-				%ok, this is a rift that opens up to the domain outline.  One tip is going to be 
+-				%double, the other one, single. We are going to start from the single tip, towards the two 
+-				%other doubles
+-
+-				%find tip1 and tip2 for this rift, in the new mesh created by yams.
+-				pos1=find_point(md.mesh.x(md.mesh.segments(:,1)),md.mesh.y(md.mesh.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
+-				tip1=md.mesh.segments(pos1,1);
+-				pos2=find_point(md.mesh.x(md.mesh.segments(:,1)),md.mesh.y(md.mesh.segments(:,1)),rift.tip2coordinates(1),rift.tip2coordinates(2));
+-				tip2=md.mesh.segments(pos2,1);
+-				if length(tip1)==2,
+-					%swap.
+-					temp=tip1; tip1=tip2; tip2=temp;
+-					temp=pos1; pos1=pos2; pos2=temp;
+-					pos=pos1;
+-				else
+-					pos=pos1;
+-				end
+-
+-				pos_record=[pos_record; pos];
+-				riftsegs=md.mesh.segments(pos,:);
+-				while 1,
+-					A=riftsegs(end,1); B=riftsegs(end,2); el=riftsegs(end,3);
+-					%find other segment that holds B.
+-					pos=find(md.mesh.segments(:,1)==B);
+-					pos_record=[pos_record; pos];
+-					riftsegs=[riftsegs; md.mesh.segments(pos,:)];
+-					if ((riftsegs(end,2)==tip2(1)) | (riftsegs(end,2)==tip2(2))), 
+-						%figure out which tip we reached
+-						if riftsegs(end,2)==tip2(1), index=2; else index=1; end
+-						break;
+-					end
+-				end
+-
+-				%ok, now, we start from the other tip2, towards tip1
+-				pos=pos2(index);
+-				pos_record=[pos_record; pos];
+-				riftsegs=[riftsegs; md.mesh.segments(pos,:)];
+-				while 1,
+-					A=riftsegs(end,1); B=riftsegs(end,2); el=riftsegs(end,3);
+-					%find other segment that holds B.
+-					pos=find(md.mesh.segments(:,1)==B);
+-					pos_record=[pos_record; pos];
+-					riftsegs=[riftsegs; md.mesh.segments(pos,:)];
+-					if riftsegs(end,2)==tip1, 
+-						break;
+-					end
+-				end
+-				md.rifts.riftstruct(i).segments=riftsegs;
+-				md.rifts.riftstruct(i).tips=[tip1 tip2(1) tip2(2)];
+-
+-			end
+-		end
+-	end
+-	%take out rift segments from segments
+-	md.mesh.segments(pos_record,:)=[];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshaddrifts.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshaddrifts.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshaddrifts.m	(revision 13009)
+@@ -1,93 +0,0 @@
+-function md=meshaddrifts(md,riftname);
+-%MESHADDRIFTS - add rifts to a preloaded mesh (typically, an argus mesh)
+-%
+-%   Usage:
+-%      md=meshaddrifts(md,riftname);
+-%
+-%        where md is a model with a preexisting mesh, and riftname is the name of an .exp file.
+-%        The format of the riftname file is as follows: a list of pairs of closed and open contours. 
+-%        The closed contour defines the envelop of the rift, the open contour that follows in the 
+-%        file defines the rift. The density of the rift should be chosen carefully in the file, as it 
+-%        will be used to define the rift contour density of the mesh. The open contour density will 
+-%        be preserved. There can be as many pairs of closed contour and rift contour as wished.
+-
+-
+-%read rift: 
+-domains=expread(riftname,1);
+-contours=domains(1:2:end);
+-rifts=domains(2:2:end);
+-
+-%now loop over rifts: 
+-for rift_i=1:length(rifts),
+-	
+-	%refine rift to desired resolution: 
+-	contour=contours(rift_i);
+-	rift=rifts(rift_i);
+-	
+-	delete('Meshaddrifts.Rift.exp');
+-	expwrite(rift,'Meshaddrifts.Rift.Coarse.exp');
+-	expcoarsen('Meshaddrifts.Rift.exp','Meshaddrifts.Rift.Coarse.exp',rift.density);
+-	delete('Meshaddrifts.Rift.Coarse.exp');
+-	
+-	%extract model:
+-	expwrite(contour,'Meshaddrifts.Contour.exp');
+-	md2=modelextract(md,'Meshaddrifts.Contour.exp');
+-	
+-	%create domain of md2 model: 
+-	md2.mesh.segments=contourenvelope(md2,'Meshaddrifts.Contour.exp');
+-	domain_index=md2.mesh.segments(1,1:2);
+-	while (domain_index(end)~=domain_index(1)),
+-		pos=find(md2.mesh.segments(:,1)==domain_index(end));
+-		domain_index(end+1)=md2.mesh.segments(pos,2);
+-	end
+-	
+-	domain.x=md2.mesh.x(domain_index);
+-	domain.y=md2.mesh.y(domain_index);
+-	domain.name='Meshaddrifts.Domain.exp';
+-	domain.density=1;
+-	expwrite(domain,'Meshaddrifts.Domain.exp');
+-	
+-	%unloop domain index: used for later.
+-	domain_index=domain_index(1:end-1);
+-	
+-	%remesh md2 using new domain outline, and rift profile: 
+-	md2=meshnodensity(md2,'Meshaddrifts.Domain.exp','Meshaddrifts.Rift.exp');
+-	md2=meshprocessrifts(md2);
+-	
+-	%plug md2 mesh into md mesh: 
+-	[md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z,md.mesh.numberofelements,md.mesh.numberofvertices,elconv,nodeconv,elconv2,nodeconv2]=meshplug(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z,...
+-								md2.mesh.elements,md2.mesh.x,md2.mesh.y,md2.mesh.z,md2.extractednodes,md2.extractedelements,domain_index);
+-
+-	%update md2 rifts using elconv and nodeconv, and plug them into md: 
+-	md2.rifts=updateriftindexing(md2.rifts,elconv2,nodeconv2);
+-	
+-	for i=1:md.rifts.numrifts,
+-		md.rifts.riftstruct(i)=updateriftindexing(md.rifts.riftstruct(i),elconv,nodeconv);
+-	end
+-	
+-	if md.rifts.numrifts==0,
+-		md.rifts.riftstruct=md2.rifts;
+-		md.rifts.numrifts=1;
+-	else
+-		md.rifts.riftstruct(end+1,1)=md2.rifts;
+-		md.rifts.numrifts=md.rifts.numrifts+1;
+-	end
+-	
+-	md.mesh.segments(:,1:2)=nodeconv(md.mesh.segments(:,1:2));
+-	md.mesh.segments(:,3)=elconv(md.mesh.segments(:,3));
+-
+-end
+-
+-%finish up "a la" mesh.h
+-md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+-
+-%Now, build the connectivity tables for this mesh.
+-md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-
+-%type of model
+-md.mesh.dimension=2;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/rifttipsrefine.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/rifttipsrefine.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/rifttipsrefine.m	(revision 13009)
+@@ -1,26 +0,0 @@
+-function md=rifttipsrefine(md,filename,resolution,circleradius);
+-%RIFTTIPSREFINE - refine mesh near rift tips
+-%
+-%   Usage:
+-%      md=rifttipsrefine(md,filename,resolution,circleradius);
+-
+-numberofnodes=50;
+-
+-%take rifts, and create refinement circles around tips
+-rifts=expread(filename,1);
+-
+-!echo -n "" > Circles.exp
+-for i=1:length(rifts),
+-	tip1=[rifts(i).x(1) rifts(i).y(1)];
+-	tip2=[rifts(i).x(end) rifts(i).y(end)];
+-	%create circle around tip
+-	expcreatecircle('Circle1.exp',tip1(1),tip1(2),circleradius,numberofnodes);
+-	expcreatecircle('Circle2.exp',tip2(1),tip2(2),circleradius,numberofnodes);
+-	!cat Circles.exp Circle1.exp Circle2.exp > Circles2.exp
+-	!mv Circles2.exp Circles.exp
+-	!rm -rf Circle1.exp Circle2.exp
+-end
+-
+-md=meshexprefine(md,'Circles.exp',resolution);
+-
+-system('rm -rf Circles.exp');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/updateriftindexing.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/updateriftindexing.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/updateriftindexing.m	(revision 13009)
+@@ -1,11 +0,0 @@
+-function rift=updateriftindexing(rift,elconv,nodeconv)
+-%UPDATERIFTINDEXING - update rift indexing, using mesh to new mesh conversion tables
+-%     See also meshaddrift
+-
+-rift.segments(:,1:2)=nodeconv(rift.segments(:,1:2));
+-rift.segments(:,3)=elconv(rift.segments(:,3));
+-rift.pairs=elconv(rift.pairs);
+-rift.tips=nodeconv(rift.tips);
+-
+-rift.penaltypairs(:,1:2)=nodeconv(rift.penaltypairs(:,1:2));
+-rift.penaltypairs(:,3:4)=elconv(rift.penaltypairs(:,3:4));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshprocessoutsiderifts.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshprocessoutsiderifts.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshprocessoutsiderifts.m	(revision 13009)
+@@ -1,94 +0,0 @@
+-function md=meshprocessoutsiderifts(md,domainoutline)
+-%MESHPROCESSOUTSIDERIFTS - process rifts when they touch the domain outline
+-%
+-%   Usage:
+-%      md=meshprocessoutsiderifts(md,domain)
+-%
+-
+-
+-
+-%go through rifts, and figure out which ones touch the domain outline
+-for i=1:md.rifts.numrifts,
+-	
+-	%first, flag nodes that belong to the domain outline
+-	flags=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,domainoutline,'node',0);
+-
+-	rift=md.rifts.riftstruct(i);
+-	tips=rift.tips;
+-	outsidetips=tips(find(flags(rift.tips)==0));
+-
+-	%we have found outsidetips, tips that touch the domain outline. go through them
+-	for j=1:length(outsidetips),
+-		
+-		tip=outsidetips(j);
+-		%find tip in the segments, take first segment (there should be 2) that holds tip, 
+-		%and node_connected_to_tip is the other node on this segment:
+-		tipindex=find(rift.segments(:,1)==tip); 
+-		if length(tipindex),
+-			tipindex=tipindex(1);
+-			node_connected_to_tip=rift.segments(tipindex,2);
+-		else
+-			tipindex=find(rift.segments(:,2)==tip); tipindex=tipindex(1);
+-			node_connected_to_tip=rift.segments(tipindex,1);
+-		end
+-
+-		%ok, we have the tip node, and the first node connected to it, on the rift. Now, 
+-		%identify all the elements that are connected to the tip, and that are on the same 
+-		%side of the rift.
+-		A=tip;
+-		B=node_connected_to_tip;
+-
+-		elements=[];
+-
+-		while  flags(B), %as long as B does not belong to the domain outline, keep looking.
+-			%detect elements on edge A,B:
+-			edgeelements=ElementsFromEdge(md.mesh.elements,A,B);
+-			%rule out those we already detected
+-			already_detected=ismember(edgeelements,elements);
+-			nextelement=edgeelements(find(~already_detected));
+-			%add new detected element to the list of elements we are looking for.
+-			elements=[elements;nextelement];
+-			%new B:
+-			B=md.mesh.elements(nextelement,find(~ismember(md.mesh.elements(nextelement,:),[A B])));
+-		end
+-		
+-		%take the list of elements on one side of the rift that connect to the tip, 
+-		%and duplicate the tip on them, so as to open the rift to the outside.
+-		num=length(md.mesh.x)+1;
+-		md.mesh.x=[md.mesh.x;md.mesh.x(tip)];
+-		md.mesh.y=[md.mesh.y;md.mesh.y(tip)];
+-		md.mesh.numberofvertices=num;
+-		
+-		%replace tip in elements
+-		newelements=md.mesh.elements(elements,:);
+-		pos=find(newelements==tip);
+-		newelements(pos)=num;
+-		md.mesh.elements(elements,:)=newelements;
+-		md.rifts.riftstruct(i).tips=[md.rifts.riftstruct(i).tips num];
+-
+-		%deal with segments
+-		tipsegments=find((md.mesh.segments(:,1)==tip) | (md.mesh.segments(:,2)==tip));
+-		for  k=1:length(tipsegments),
+-			segment_index=tipsegments(k);
+-			pos=find(md.mesh.segments(segment_index,1:2)~=tip);
+-			other_node=md.mesh.segments(segment_index,pos);
+-			if ~isconnected(md.mesh.elements,other_node,tip),
+-				pos=find(md.mesh.segments(segment_index,1:2)==tip);
+-				md.mesh.segments(segment_index,pos)=num;
+-			end
+-		end
+-	end
+-end
+-
+-
+-%Fill in rest of fields:
+-md.mesh.numberofelements=length(md.mesh.elements);
+-md.mesh.numberofvertices=length(md.mesh.x);
+-md.mesh.z=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonboundary=zeros(length(md.mesh.x),1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+-md.rifts.numrifts=length(md.rifts.riftstruct);
+-md.flowequation.element_equation=3*ones(md.mesh.numberofelements,1);
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshprocessrifts.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshprocessrifts.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/rifts/meshprocessrifts.m	(revision 13009)
+@@ -1,69 +0,0 @@
+-function md=meshprocessrifts(md,domainoutline)
+-%MESHPROCESSRIFTS - process mesh when rifts are present
+-%
+-%   split rifts inside mesh (rifts are defined by presence of
+-%   segments inside the domain outline)
+-%   if domain outline is provided, check for rifts that could touch it, and open them up.
+-%
+-%   Usage:
+-%      md=meshprocessrifts(md,domainoutline)
+-%
+-%   Ex: 
+-%      md=meshprocessrifts(md,'DomainOutline.exp');
+-%
+-
+-%some checks on arguments: 
+-if nargout~=1,
+-	help meshprocessrifts
+-	error('meshprocessrifts usage error:');
+-end
+-
+-if nargin~=2,
+-	help meshprocessrifts
+-	error('meshprocessrifts usage error:');
+-end
+-
+-%Call MEX file
+-[md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers,md.rifts.riftstruct]=TriMeshProcessRifts(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers);
+-if ~isstruct(md.rifts.riftstruct),
+-	error('TriMeshProcessRifts did not find any rift');
+-end
+-
+-%Fill in rest of fields:
+-numrifts=length(md.rifts.riftstruct);
+-md.mesh.numberofelements=length(md.mesh.elements);
+-md.mesh.numberofvertices=length(md.mesh.x);
+-md.mesh.z=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonboundary=zeros(length(md.mesh.x),1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+-
+-%get coordinates of rift tips
+-for i=1:numrifts,
+-	md.rifts.riftstruct(i).tip1coordinates=[md.mesh.x(md.rifts.riftstruct(i).tips(1)) md.mesh.y(md.rifts.riftstruct(i).tips(1))];
+-	md.rifts.riftstruct(i).tip2coordinates=[md.mesh.x(md.rifts.riftstruct(i).tips(2)) md.mesh.y(md.rifts.riftstruct(i).tips(2))];
+-end
+-
+-%In case we have rifts that open up the domain outline, we need to open them: 
+-flags=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,domainoutline,'node',0);
+-found=0;
+-for i=1:numrifts,
+-	if flags(md.rifts.riftstruct(i).tips(1))==0,
+-		found=1;
+-		break;
+-	end
+-	if flags(md.rifts.riftstruct(i).tips(2))==0,
+-		found=1;
+-		break;
+-	end
+-end
+-if found,
+-	md=meshprocessoutsiderifts(md,domainoutline);
+-end
+-
+-%get elements that are not correctly oriented in the correct direction:
+-aires=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
+-pos=find(aires<0);
+-md.mesh.elements(pos,:)=[md.mesh.elements(pos,2) md.mesh.elements(pos,1) md.mesh.elements(pos,3)];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/meshconvert.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/meshconvert.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/meshconvert.m	(revision 13009)
+@@ -1,48 +0,0 @@
+-function md=meshconvert(md,varargin)
+-%CONVERTMESH - convert mesh to bamg mesh
+-%
+-%   Usage:
+-%      md=meshconvert(md);
+-%      md=meshconvert(md,index,x,y);
+-
+-if nargin~=1 & nargin~=4,
+-	help meshconvert
+-	error('meshconvert error message: bad usage');
+-end
+-
+-if nargin==1,
+-	x=md.mesh.x;
+-	y=md.mesh.y;
+-	index=md.mesh.elements;
+-else
+-	x=varargin{1};
+-	y=varargin{2};
+-	index=varargin{3};
+-end
+-
+-%call Bamg
+-[bamgmesh_out bamggeom_out]=BamgConvertMesh(index,x,y);
+-
+-% plug results onto model
+-md.private.bamg=struct();
+-md.private.bamg.mesh=bamgmesh(bamgmesh_out);
+-md.private.bamg.geometry=bamggeom(bamggeom_out);
+-md.mesh.x=bamgmesh_out.Vertices(:,1);
+-md.mesh.y=bamgmesh_out.Vertices(:,2);
+-md.mesh.elements=bamgmesh_out.Triangles(:,1:3);
+-md.mesh.edges=bamgmesh_out.IssmEdges;
+-md.mesh.segments=bamgmesh_out.IssmSegments(:,1:3);
+-md.mesh.segmentmarkers=bamgmesh_out.IssmSegments(:,4);
+-
+-%Fill in rest of fields:
+-md.mesh.dimension=2;
+-md.mesh.numberofelements=size(md.mesh.elements,1);
+-md.mesh.numberofvertices=length(md.mesh.x);
+-md.mesh.numberofedges=size(md.mesh.edges,1);
+-md.mesh.z=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
+-md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+-md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/triangle.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/triangle.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/mesh/triangle.py	(revision 13009)
+@@ -1,56 +0,0 @@
+-from numpy import *
+-import TriMesh as tm
+-import NodeConnectivity as nc
+-import ElementConnectivity as ec
+-
+-def triangle(md, domainname, resolution,riftname=''):
+-	#TRIANGLE - create model mesh using the triangle package
+-	#
+-	#   This routine creates a model mesh using TriMesh and a domain outline, to within a certain resolution
+-	#   where md is a @model object, domainname is the name of an Argus domain outline file, 
+-	#   and resolution is a characteristic length for the mesh (same unit as the domain outline
+-	#   unit). Riftname is an optional argument (Argus domain outline) describing rifts.
+-	#
+-	#   Usage:
+-	#      md=triangle(md,domainname,resolution)
+-	#   or md=triangle(md,domainname, resolution, riftname)
+-	#
+-	#   Examples:
+-	#      md=triangle(md,'DomainOutline.exp',1000);
+-	#      md=triangle(md,'DomainOutline.exp',1000,'Rifts.exp');
+-
+-
+-	#Figure out a characteristic area. Resolution is a node oriented concept (ex a 1000m  resolution node would 
+-	#be made of 1000*1000 area squares). 
+-
+-	#Check that mesh was not already run, and warn user: 
+-	if md.mesh.numberofelements != 0.:
+-		choice = input('This model already has a mesh. Are you sure you want to go ahead? (y/n)')
+-		if choice != 'y':
+-			print 'no meshing done ... exiting'
+-			return []
+-		
+-	area = resolution**2.
+-
+-	#Mesh using TriMesh
+-	[md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers]=tm.TriMesh(domainname,riftname,area)
+-
+-
+-	#Fill in rest of fields:
+-	md.mesh.numberofelements = len(md.mesh.elements)
+-	md.mesh.numberofvertices = len(md.mesh.x)
+-	md.mesh.z = zeros(md.mesh.numberofvertices)
+-	md.mesh.vertexonboundary = zeros(md.mesh.numberofvertices)
+-	md.mesh.vertexonboundary[md.mesh.segments[:,0:2].astype(int)-1] = 1.
+-	md.mesh.vertexonbed = ones(md.mesh.numberofvertices)
+-	md.mesh.vertexonsurface = ones(md.mesh.numberofvertices)
+-	md.mesh.elementonbed = ones(md.mesh.numberofelements)
+-	md.mesh.elementonsurface = ones(md.mesh.numberofelements)
+-
+-	#Now, build the connectivity tables for this mesh.
+-	[md.mesh.vertexconnectivity]= nc.NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)
+-	[md.mesh.elementconnectivity] = ec.ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)
+-	
+-	#type of model
+-	md.mesh.dimension = 2.
+-	return md
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/print/printmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/print/printmodel.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/print/printmodel.m	(revision 13009)
+@@ -1,100 +0,0 @@
+-function printmodel(filename,format,varargin)
+-%PRINTMODEL - save an image of current figure
+-%
+-%   filename: output name of image file (no extension)
+-%   format: image format (ex: 'tiff','jpg','pdf') 
+-%
+-%   List of options to printfmodel: 
+-%
+-%   figure: number of figure to print (default: current figure)
+-%   resolution: use higher resolution to anti-alias (default 2)
+-%   margin: add margin around final image  
+-%   marginsize: size of margin around final image (default 5)
+-%   frame: add frame around final image
+-%   framesize: size of frame around final image (default 5)
+-%   framecolor: color of frame around final image (default 'black')
+-%   trim: trim empty space around image (default 'off')
+-%   hardcopy: 'off' to impose MATLAB to use the same colors (default 'off')
+-%   
+-%   Usage:
+-%      printmodel(filename,format,varargin);
+-%
+-%   Examples:
+-%      printmodel('image','tiff')
+-%      printmodel('image','eps','margin','on','frame','on','hardcopy','on')
+-
+-
+-%get options: 
+-options=pairoptions(varargin{:});
+-
+-%set defaults
+-options=addfielddefault(options,'figure','gcf');
+-options=addfielddefault(options,'format','tiff');
+-options=addfielddefault(options,'resolution',1);
+-options=addfielddefault(options,'margin','on');
+-options=addfielddefault(options,'marginsize',25);
+-options=addfielddefault(options,'frame','on');
+-options=addfielddefault(options,'framesize',3);
+-options=addfielddefault(options,'framecolor','black');
+-options=addfielddefault(options,'trim','on');
+-options=addfielddefault(options,'hardcopy','off');
+-
+-%get fig: 
+-fig=getfieldvalue(options,'figure');
+-if ischar(fig),
+-	fig=gcf;
+-else
+-	figure(fig);
+-	fig=gcf;
+-end
+-
+-%In auto mode, MATLAB prints the figure the same size as it appears on the computer screen, centered on the page
+-set(fig, 'PaperPositionMode', 'auto');
+-
+-%InvertHardcopy off imposes MATLAB to use the same colors
+-set(fig, 'InvertHardcopy', getfieldvalue(options,'hardcopy'));
+-
+-
+-%we could have several formats, as a cell array of strings.
+-formats=format;
+-if ~iscell(formats),
+-	formats={formats};
+-end
+-
+-%loop on formats:
+-for i=1:length(formats),
+-	format=formats{i};
+-
+-	%Use higher resolution to anti-alias and use zbuffer to have smooth colors
+-	print(fig, '-zbuffer','-dtiff',['-r' num2str(get(0,'ScreenPixelsPerInch')*getfieldvalue(options,'resolution'))],filename);
+-
+-	%some trimming involved? 
+-	if ~strcmpi(format,'pdf'),
+-		if strcmpi(getfieldvalue(options,'trim'),'on'),
+-			system(['convert -trim ' filename '.tif ' filename '.tif']);
+-		end
+-	end
+-
+-	%margin?
+-	if ~strcmpi(format,'pdf'),
+-		if strcmpi(getfieldvalue(options,'margin'),'on'),
+-			marginsize=getfieldvalue(options,'marginsize');
+-			system(['convert -border ' num2str(marginsize) 'x' num2str(marginsize) ' -bordercolor "white" ' filename '.tif ' filename '.tif']);
+-		end
+-	end
+-
+-	%frame?
+-	if ~strcmpi(format,'pdf'),
+-		if strcmpi(getfieldvalue(options,'frame'),'on'),
+-			framesize=getfieldvalue(options,'framesize');
+-			framecolor=getfieldvalue(options,'framecolor');
+-			system(['convert -border ' num2str(framesize) 'x' num2str(framesize) ' -bordercolor "' framecolor '" ' filename '.tif ' filename '.tif']);
+-		end
+-	end
+-
+-	%convert image to correct format
+-	if ~strcmpi(format,'tiff') & ~strcmpi(format,'tif'),
+-		system(['convert ' filename '.tif ' filename '.' format]);
+-		delete([ filename '.tif']);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/stokesoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/stokesoptions.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/stokesoptions.m	(revision 13009)
+@@ -1,28 +0,0 @@
+-function stokes=stokesoptions(varargin)
+-%STOKESOPTIONS - return STOKES multi-physics solver petsc options
+-%
+-%   Usage:
+-%      options=stokesoptions;
+-
+-%retrieve options provided in varargin
+-options=pairoptions(varargin{:});
+-stokes=struct();
+-
+-%default stokes options
+-PETSC_VERSION=petscversion();
+-if PETSC_VERSION==2,
+-	error('stokesoptions error message: multi-physics options not supported in Petsc 2');
+-end
+-if PETSC_VERSION==3,
+-	stokes.mat_type=getfieldvalue(options,'mat_type','mpiaij');
+-	stokes.ksp_max_it=getfieldvalue(options,'ksp_max_it',1000);
+-	stokes.ksp_type=getfieldvalue(options,'ksp_type','gmres');
+-	stokes.pc_type=getfieldvalue(options,'pc_type','fieldsplit');
+-	stokes.pc_field_split_type=getfieldvalue(options,'pc_field_split_type','schur');
+-	stokes.fieldsplit_0_pc_type=getfieldvalue(options,'fieldsplit_0_pc_type','hypre');
+-	stokes.fieldsplit_0_ksp_type=getfieldvalue(options,'fieldsplit_0_ksp_type','gmres');
+-	stokes.fieldsplit_0_pc_hypre_type=getfieldvalue(options,'fieldsplit_0_pc_hypre_type','boomerang');
+-	stokes.fieldsplit_1_pc_type=getfieldvalue(options,'fieldsplit_1_pc_type','jacobi');
+-	stokes.fieldsplit_1_ksp_type=getfieldvalue(options,'fieldsplit_1_ksp_type','preonly');
+-	stokes.issm_option_solver=getfieldvalue(options,'issm_option_solver','stokes');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/asmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/asmoptions.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/asmoptions.py	(revision 13009)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def asmoptions(*args):
+-	#ASMOPTIONS - return ASM petsc options
+-	#
+-	#   Usage:
+-	#      options=asmoptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['mat_type','aij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','lu'],['pc_asm_overlap',3],['ksp_max_it',100],['ksp_rtol',1e-30]];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/asmoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/asmoptions.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/asmoptions.m	(revision 13009)
+@@ -1,18 +0,0 @@
+-function asm=asmoptions(varargin)
+-%ASMOPTIONS - return Additive Shwartz Method petsc options
+-%
+-%   Usage:
+-%      options=asmoptions;
+-			 
+-%retrieve options provided in varargin
+-options=pairoptions(varargin{:});
+-asm=struct();
+-
+-%default asm options
+-asm.mat_type=getfieldvalue(options,'mat_type','aij');
+-asm.ksp_type=getfieldvalue(options,'ksp_type','gmres');
+-asm.pc_type=getfieldvalue(options,'pc_type','asm');
+-asm.sub_pc_type=getfieldvalue(options,'sub_pc_type','lu');
+-asm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',3);
+-asm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
+-asm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-30);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobiasmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobiasmoptions.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobiasmoptions.py	(revision 13009)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def jacobiasmoptions(*args):
+-	#ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
+-	#
+-	#   Usage:
+-	#      options=jacobiasmoptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['mat_type','aij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','jacobi'],['pc_asm_overlap',3],['ksp_max_it',100],['ksp_rtol',1e-15]];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.py	(revision 13009)
+@@ -1,25 +0,0 @@
+-from pairoptions import *
+-
+-def iluasmoptions(*args):
+-	"""
+-	ILUASMOPTIONS - 
+-
+-	   Usage:
+-	      options=iluasmoptions;
+-	"""
+-			 
+-	#retrieve options provided in varargin
+-	options=pairoptions(*args)
+-	iluasm={}
+-
+-	#default iluasm options
+-	iluasm['mat_type']=options.getfieldvalue('mat_type','aij')
+-	iluasm['ksp_type']=options.getfieldvalue('ksp_type','gmres')
+-	iluasm['pc_type']=options.getfieldvalue('pc_type','asm')
+-	iluasm['sub_pc_type']=options.getfieldvalue('sub_pc_type','ilu')
+-	iluasm['pc_asm_overlap']=options.getfieldvalue('pc_asm_overlap',5)
+-	iluasm['ksp_max_it']=options.getfieldvalue('ksp_max_it',100)
+-	iluasm['ksp_rtol']=options.getfieldvalue('ksp_rtol',1e-15)
+-
+-	return iluasm
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobiasmoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobiasmoptions.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobiasmoptions.m	(revision 13009)
+@@ -1,18 +0,0 @@
+-function jacobiasm=jacobiasmoptions(varargin)
+-%ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
+-%
+-%   Usage:
+-%      options=jacobiasmoptions;
+-			 
+-%retrieve options provided in varargin
+-options=pairoptions(varargin{:});
+-jacobiasm=struct();
+-
+-%default jacobiasm options
+-jacobiasm.mat_type=getfieldvalue(options,'mat_type','aij');
+-jacobiasm.ksp_type=getfieldvalue(options,'ksp_type','gmres');
+-jacobiasm.pc_type=getfieldvalue(options,'pc_type','asm');
+-jacobiasm.sub_pc_type=getfieldvalue(options,'sub_pc_type','jacobi');
+-jacobiasm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',3);
+-jacobiasm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
+-jacobiasm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-15);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/iluasmoptions.m	(revision 13009)
+@@ -1,18 +0,0 @@
+-function iluasm=iluasmoptions(varargin)
+-%ILUASMOPTIONS - 
+-%
+-%   Usage:
+-%      options=iluasmoptions;
+-			 
+-%retrieve options provided in varargin
+-options=pairoptions(varargin{:});
+-iluasm=struct();
+-
+-%default iluasm options
+-iluasm.mat_type=getfieldvalue(options,'mat_type','aij');
+-iluasm.ksp_type=getfieldvalue(options,'ksp_type','gmres');
+-iluasm.pc_type=getfieldvalue(options,'pc_type','asm');
+-iluasm.sub_pc_type=getfieldvalue(options,'sub_pc_type','ilu');
+-iluasm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',5);
+-iluasm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
+-iluasm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-15);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/matlaboptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/matlaboptions.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/matlaboptions.py	(revision 13009)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def matlaboptions(*args):
+-	#MATLABOPTIONS - return Matlab petsc options
+-	#
+-	#   Usage:
+-	#      options=matlaboptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['ksp_type','matlab']];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobicgoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobicgoptions.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobicgoptions.py	(revision 13009)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def jacobicgoptions(*args):
+-	#ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
+-	#
+-	#   Usage:
+-	#      options=jacobicgoptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['mat_type','aij'],['ksp_type','cg'],['ksp_max_it',100],['ksp_rtol',1e-15]];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/mumpsoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/mumpsoptions.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/mumpsoptions.py	(revision 13009)
+@@ -1,33 +0,0 @@
+-from pairoptions import *
+-from petscversion import *
+-
+-def mumpsoptions(*args):
+-	"""
+-	MUMPSOPTIONS - return MUMPS direct solver  petsc options
+-
+-	   Usage:
+-	      options=mumpsoptions;
+-	"""
+-
+-	#retrieve options provided in varargin
+-	options=pairoptions(*args)
+-	mumps={}
+-
+-	#default mumps options
+-	PETSC_VERSION=petscversion()
+-	if PETSC_VERSION==2:
+-		mumps['mat_type']=options.getfieldvalue('mat_type','aijmumps')
+-		mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
+-		mumps['pc_type']=options.getfieldvalue('pc_type','lu')
+-		mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
+-		mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
+-	if PETSC_VERSION==3:
+-		mumps['mat_type']=options.getfieldvalue('mat_type','mpiaij')
+-		mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
+-		mumps['pc_type']=options.getfieldvalue('pc_type','lu')
+-		mumps['pc_factor_mat_solver_package']=options.getfieldvalue('pc_factor_mat_solver_package','mumps')
+-		mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
+-		mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
+-
+-	return mumps
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/soroptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/soroptions.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/soroptions.py	(revision 13009)
+@@ -1,31 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def soroptions(*args):
+-	#SOROPTIONS - return Relaxation Solver petsc options
+-	#
+-	#   Usage:
+-	#      options=soroptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-	
+-	options=[['mat_type','aij'],['ksp_type','cg'],['pc_type','sor'],['pc_sor_omega',1.1],['pc_sor_its',2]];
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/matlaboptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/matlaboptions.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/matlaboptions.m	(revision 13009)
+@@ -1,12 +0,0 @@
+-function maltab=matlaboptions(varargin)
+-%MATLABOPTIONS - return Matlab petsc options
+-%
+-%   Usage:
+-%      options=matlaboptions;
+-			 
+-%retrieve options provided in varargin
+-options=pairoptions(varargin{:});
+-maltab=struct();
+-
+-%default matlab options
+-maltab.ksp_type='matlab';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobicgoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobicgoptions.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/jacobicgoptions.m	(revision 13009)
+@@ -1,15 +0,0 @@
+-function jacobicg=jacobiacgoptions(varargin)
+-%ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
+-%
+-%   Usage:
+-%      options=jacobiasmoptions;
+-			 
+-%retrieve options provided in varargin
+-options=pairoptions(varargin{:});
+-jacobicg=struct();
+-
+-%default jacobiasm options
+-jacobicg.mat_type=getfieldvalue(options,'mat_type','aij');
+-jacobicg.ksp_type=getfieldvalue(options,'ksp_type','cg');
+-jacobicg.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
+-jacobicg.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-15);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/mumpsoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/mumpsoptions.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/mumpsoptions.m	(revision 13009)
+@@ -1,27 +0,0 @@
+-function mumps=mumpsoptions(varargin)
+-%MUMPSOPTIONS - return MUMPS direct solver  petsc options
+-%
+-%   Usage:
+-%      options=mumpsoptions;
+-
+-%retrieve options provided in varargin
+-options=pairoptions(varargin{:});
+-mumps=struct();
+-
+-%default mumps options
+-PETSC_VERSION=petscversion();
+-if PETSC_VERSION==2,
+-	mumps.mat_type=getfieldvalue(options,'mat_type','aijmumps');
+-	mumps.ksp_type=getfieldvalue(options,'ksp_type','preonly');
+-	mumps.pc_type=getfieldvalue(options,'pc_type','lu');
+-	mumps.mat_mumps_icntl_14=getfieldvalue(options,'mat_mumps_icntl_14',120);
+-	mumps.pc_factor_shift_positive_definite=getfieldvalue(options,'pc_factor_shift_positive_definite','true');
+-end
+-if PETSC_VERSION==3,
+-	mumps.mat_type=getfieldvalue(options,'mat_type','mpiaij');
+-	mumps.ksp_type=getfieldvalue(options,'ksp_type','preonly');
+-	mumps.pc_type=getfieldvalue(options,'pc_type','lu');
+-	mumps.pc_factor_mat_solver_package=getfieldvalue(options,'pc_factor_mat_solver_package','mumps');
+-	mumps.mat_mumps_icntl_14=getfieldvalue(options,'mat_mumps_icntl_14',120);
+-	mumps.pc_factor_shift_positive_definite=getfieldvalue(options,'pc_factor_shift_positive_definite','true');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/soroptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/soroptions.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/soroptions.m	(revision 13009)
+@@ -1,16 +0,0 @@
+-function sor=soroptions(varargin)
+-%SOROPTIONS - return Relaxation Solver petsc options
+-%
+-%   Usage:
+-%      options=soroptions;
+-			 
+-%retrieve options provided in varargin
+-options=pairoptions(varargin{:});
+-sor=struct();
+-
+-%default sor options
+-sor.mat_type=getfieldvalue(options,'mat_type','aij');
+-sor.ksp_type=getfieldvalue(options,'ksp_type','cg');
+-sor.pc_type=getfieldvalue(options,'pc_type','sor');
+-sor.pc_sor_omega=getfieldvalue(options,'pc_sor_omega',1.1);
+-sor.pc_sor_its=getfieldvalue(options,'pc_sor_its',2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/stokesoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/stokesoptions.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/solvers/stokesoptions.py	(revision 13009)
+@@ -1,40 +0,0 @@
+-#module imports {{{
+-from pairoptions import *
+-from petscversion  import *
+-#}}}
+-def stokesoptions(*args):
+-	#STOKESOPTIONS - return STOKES multi-physics solver petsc options
+-	#
+-	#   Usage:
+-	#      options=stokesoptions;
+-	
+-	#retrieve options provided in varargin
+-	arguments=pairoptions(*args) 
+-
+-
+-	#default stokes options
+-	PETSC_VERSION=petscversion()
+-
+-	if PETSC_VERSION==2:
+-		raise RuntimeError('stokesoptions error message: multi-physics options not supported in Petsc 2')
+-	if PETSC_VERSION==3:
+-		options=[['mat_type','mpiaij'],['ksp_max_it',1000],['ksp_type','gmres'],['pc_type','fieldsplit'],['pc_field_split_type','schur'],\
+-	['fieldsplit_0_pc_type','hypre'],['fieldsplit_0_ksp_type','gmres'],['fieldsplit_0_pc_hypre_type','boomerang'],\
+-	['fieldsplit_1_pc_type','jacobi'],['fieldsplit_1_ksp_type','preonly'],['issm_option_solver','stokes']]
+-
+-	#now, go through our arguments, and write over default options.
+-	for i in range(len(arguments.list)):
+-		arg1=arguments.list[i][0]
+-		arg2=arguments.list[i][1]
+-		found=0;
+-		for j in range(len(options)):
+-			joption=options[j][0]
+-			if joption==arg1:
+-				joption[1]=arg2;
+-				options[j]=joption;
+-				found=1;
+-				break
+-		if not found:
+-			#this option did not exist, add it: 
+-			options.append([arg1,arg2])
+-	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.py	(revision 13009)
+@@ -1,34 +0,0 @@
+-import os
+-import datetime
+-from addnote import *
+-
+-def parameterize(md,parametername):
+-	"""
+-	PARAMETERIZE - parameterize a model
+-
+-	   from a parameter python file, start filling in all the model fields that were not 
+-	   filled in by the mesh.py and mask.py model methods.
+-	   Warning: the parameter file must be able to be run in Python
+-
+-	   Usage:
+-	      md=parameterize(md,parametername)
+-
+-	   Example:
+-	      md=parameterize(md,'Square.par');
+-	"""
+-
+-	#some checks
+-	if not os.path.exists(parametername):
+-		raise IOError("parameterize error message: file '%s' not found!" % parametername)
+-
+-	#Try and run parameter file.
+-	execfile(parametername)
+-
+-	#Name and notes
+-	if not md.miscellaneous.name:
+-		md.miscellaneous.name=os.path.basename(parametername).split('.')[0]
+-
+-	md=addnote(md,"Model created by using parameter file: '%s' on: %s." % (parametername,datetime.datetime.strftime(datetime.datetime.now(),'%c') ))
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.py	(revision 13009)
+@@ -1,278 +0,0 @@
+-import numpy
+-from model import *
+-from pairoptions import *
+-from recover_areas import *
+-from MatlabFuncs import *
+-
+-def setflowequation(md,*args):
+-	"""
+-	SETELEMENTSTYPE - associate a solution type to each element
+-
+-	   This routine works like plotmodel: it works with an even number of inputs
+-	   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
+-	   that must be followed by the corresponding exp file or flags list
+-	   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+-	   If user wants every element outside the domain to be 
+-	   setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
+-	   an empty string '' will be considered as an empty domain
+-	   a string 'all' will be considered as the entire domain
+-	   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
+-
+-	   Usage:
+-	      md=setflowequation(md,varargin)
+-
+-	   Example:
+-	      md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
+-	      md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
+-	"""
+-
+-	#some checks on list of arguments
+-	if not isinstance(md,model) or not len(args):
+-		raise TypeError("setflowequation error message")
+-
+-	#Find_out what kind of coupling to use
+-	options=pairoptions(*args)
+-	coupling_method=options.getfieldvalue('coupling','tiling')
+-	if not strcmpi(coupling_method,'tiling') and not strcmpi(coupling_method,'penalties'):
+-		raise TypeError("coupling type can only be: tiling or penalties")
+-
+-	hutterflag,macayealflag,pattynflag,stokesflag,filltype=recover_areas(md,*args)
+-
+-	#Flag the elements that have not been flagged as filltype
+-	if   strcmpi(filltype,'hutter'):
+-		hutterflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(macayealflag,pattynflag)))]=1
+-	elif strcmpi(filltype,'macayeal'):
+-		macayealflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(pattynflag,stokesflag))))]=1
+-	elif strcmpi(filltype,'pattyn'):
+-		pattynflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(macayealflag,stokesflag))))]=1
+-
+-	#check that each element has at least one flag
+-	if not numpy.any(hutterflag+macayealflag+pattynflag+stokesflag):
+-		raise TypeError("setflowequation error message: elements type not assigned, must be specified")
+-
+-	#check that each element has only one flag
+-	if numpy.any(hutterflag+macayealflag+pattynflag+stokesflag>1):
+-		print "setflowequation warning message: some elements have several types, higher order type is used for them"
+-		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,macayealflag))]=0
+-		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,pattynflag))]=0
+-		macayealflag[numpy.nonzero(numpy.logical_and(macayealflag,pattynflag))]=0
+-
+-	#Check that no pattyn or stokes for 2d mesh
+-	if md.mesh.dimension==2:
+-		if numpy.any(numpy.logical_or(stokesflag,pattynflag)):
+-			raise TypeError("setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first")
+-
+-	#Stokes can only be used alone for now:
+-	if numpy.any(stokesflag) and numpy.any(hutterflag):
+-		raise TypeError("setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere")
+-
+-	#Initialize node fields
+-	nodeonhutter=numpy.zeros(md.mesh.numberofvertices)
+-	nodeonhutter[md.mesh.elements[numpy.nonzero(hutterflag),:].astype(int)-1]=1
+-	nodeonmacayeal=numpy.zeros(md.mesh.numberofvertices)
+-	nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
+-	nodeonpattyn=numpy.zeros(md.mesh.numberofvertices)
+-	nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
+-	nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
+-	noneflag=numpy.zeros(md.mesh.numberofelements)
+-
+-	#First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
+-	if any(stokesflag):
+-#		fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
+-		fullspcnodes=numpy.logical_or(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx))+ \
+-		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvy))+ \
+-		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvz))==3, \
+-		                              numpy.logical_and(nodeonpattyn,nodeonstokes)).astype(int)    #find all the nodes on the boundary of the domain without icefront
+-#		fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
+-		fullspcelems=(numpy.sum(fullspcnodes[md.mesh.elements.astype(int)-1],axis=1)==6).astype(int)    #find all the nodes on the boundary of the domain without icefront
+-		stokesflag[numpy.nonzero(fullspcelems)]=0
+-		nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
+-
+-	#Then complete with NoneApproximation or the other model used if there is no stokes
+-	if any(stokesflag): 
+-		if   any(pattynflag):    #fill with pattyn
+-			pattynflag[numpy.logical_not(stokesflag)]=1
+-			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
+-		elif any(macayealflag):    #fill with macayeal
+-			macayealflag[numpy.logical_not(stokesflag)]=1
+-			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
+-		else:    #fill with none 
+-			noneflag[numpy.nonzero(numpy.logical_not(stokesflag))]=1
+-
+-	#Now take care of the coupling between MacAyeal and Pattyn
+-	md.diagnostic.vertex_pairing=numpy.array([])
+-	nodeonmacayealpattyn=numpy.zeros(md.mesh.numberofvertices)
+-	nodeonpattynstokes=numpy.zeros(md.mesh.numberofvertices)
+-	nodeonmacayealstokes=numpy.zeros(md.mesh.numberofvertices)
+-	macayealpattynflag=numpy.zeros(md.mesh.numberofelements)
+-	macayealstokesflag=numpy.zeros(md.mesh.numberofelements)
+-	pattynstokesflag=numpy.zeros(md.mesh.numberofelements)
+-	if   strcmpi(coupling_method,'penalties'):
+-		#Create the border nodes between Pattyn and MacAyeal and extrude them
+-		numnodes2d=md.mesh.numberofvertices2d
+-		numlayers=md.mesh.numberoflayers
+-		bordernodes2d=numpy.nonzero(numpy.logical_and(nodeonpattyn[1:numnodes2d],nodeonmacayeal[1:numnodes2d]))    #Nodes connected to two different types of elements
+-
+-		#initialize and fill in penalties structure
+-		if numpy.all(numpy.logical_not(numpy.isnan(bordernodes2d))):
+-			penalties=numpy.zeros((0,2))
+-			for	i in xrange(1,numlayers):
+-				penalties=numpy.concatenate((penalties,numpy.concatenate((bordernodes2d,bordernodes2d+md.mesh.numberofvertices2d*(i)),axis=1)),axis=0)
+-			md.diagnostic.vertex_pairing=penalties
+-
+-	elif strcmpi(coupling_method,'tiling'):
+-		if   numpy.any(macayealflag) and numpy.any(pattynflag):    #coupling macayeal pattyn
+-			#Find node at the border
+-			nodeonmacayealpattyn[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonpattyn))]=1
+-			#Macayeal elements in contact with this layer become MacAyealPattyn elements
+-			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonmacayealpattyn))
+-			commonelements=numpy.sum(matrixelements,axis=1)!=0
+-			commonelements[numpy.nonzero(pattynflag)]=0    #only one layer: the elements previously in macayeal
+-			macayealflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealpattynelements
+-			macayealpattynflag[numpy.nonzero(commonelements)]=1
+-			nodeonmacayeal[:]=0
+-			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
+-
+-			#rule out elements that don't touch the 2 boundaries
+-			pos=numpy.nonzero(macayealpattynflag)
+-			elist=numpy.zeros(len(pos))
+-			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
+-			pos1=[i for i,item in enumerate(elist) if item==1]
+-			macayealflag[pos[pos1]]=1
+-			macayealpattynflag[pos[pos1]]=0
+-			pos2=[i for i,item in enumerate(elist) if item==-1]
+-			pattynflag[pos[pos2]]=1
+-			macayealpattynflag[pos[pos2]]=0
+-
+-			#Recompute nodes associated to these elements
+-			nodeonmacayeal[:]=0
+-			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
+-			nodeonpattyn[:]=0
+-			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
+-			nodeonmacayealpattyn[:]=0
+-			nodeonmacayealpattyn[md.mesh.elements[numpy.nonzero(macayealpattynflag),:].astype(int)-1]=1
+-
+-		elif numpy.any(pattynflag) and numpy.any(stokesflag):    #coupling pattyn stokes
+-			#Find node at the border
+-			nodeonpattynstokes[numpy.nonzero(numpy.logical_and(nodeonpattyn,nodeonstokes))]=1
+-			#Stokes elements in contact with this layer become PattynStokes elements
+-			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonpattynstokes))
+-			commonelements=numpy.sum(matrixelements,axis=1)!=0
+-			commonelements[numpy.nonzero(pattynflag)]=0    #only one layer: the elements previously in macayeal
+-			stokesflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealpattynelements
+-			pattynstokesflag[numpy.nonzero(commonelements)]=1
+-			nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
+-			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
+-
+-			#rule out elements that don't touch the 2 boundaries
+-			pos=numpy.nonzero(pattynstokesflag)
+-			elist=numpy.zeros(len(pos))
+-			elist = elist + numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			pos1=[i for i,item in enumerate(elist) if item==1]
+-			stokesflag[pos[pos1]]=1
+-			pattynstokesflag[pos[pos1]]=0
+-			pos2=[i for i,item in enumerate(elist) if item==-1]
+-			pattynflag[pos[pos2]]=1
+-			pattynstokesflag[pos[pos2]]=0
+-
+-			#Recompute nodes associated to these elements
+-			nodeonstokes[:]=0
+-			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
+-			nodeonpattyn[:]=0
+-			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
+-			nodeonpattynstokes[:]=0
+-			nodeonpattynstokes[md.mesh.elements[numpy.nonzero(pattynstokesflag),:].astype(int)-1]=1
+-
+-		elif numpy.any(stokesflag) and numpy.any(macayealflag):
+-			#Find node at the border
+-			nodeonmacayealstokes[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonstokes))]=1
+-			#Stokes elements in contact with this layer become MacAyealStokes elements
+-			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonmacayealstokes))
+-			commonelements=numpy.sum(matrixelements,axis=1)!=0
+-			commonelements[numpy.nonzero(macayealflag)]=0    #only one layer: the elements previously in macayeal
+-			stokesflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealmacayealelements
+-			macayealstokesflag[numpy.nonzero(commonelements)]=1
+-			nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
+-			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
+-
+-			#rule out elements that don't touch the 2 boundaries
+-			pos=numpy.nonzero(macayealstokesflag)
+-			elist=numpy.zeros(len(pos))
+-			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
+-			pos1=[i for i,item in enumerate(elist) if item==1]
+-			macayealflag[pos[pos1]]=1
+-			macayealstokesflag[pos[pos1]]=0
+-			pos2=[i for i,item in enumerate(elist) if item==-1]
+-			stokesflag[pos[pos2]]=1
+-			macayealstokesflag[pos[pos2]]=0
+-
+-			#Recompute nodes associated to these elements
+-			nodeonmacayeal[:]=0
+-			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
+-			nodeonstokes[:]=0
+-			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
+-			nodeonmacayealstokes[:]=0
+-			nodeonmacayealstokes[md.mesh.elements[numpy.nonzero(macayealstokesflag),:].astype(int)-1]=1
+-
+-		elif numpy.any(stokesflag) and numpy.any(hutterflag):
+-			raise TypeError("type of coupling not supported yet")
+-
+-	#Create MacaAyealPattynApproximation where needed
+-	md.flowequation.element_equation=numpy.zeros(md.mesh.numberofelements)
+-	md.flowequation.element_equation[numpy.nonzero(noneflag)]=0
+-	md.flowequation.element_equation[numpy.nonzero(hutterflag)]=1
+-	md.flowequation.element_equation[numpy.nonzero(macayealflag)]=2
+-	md.flowequation.element_equation[numpy.nonzero(pattynflag)]=3
+-	md.flowequation.element_equation[numpy.nonzero(stokesflag)]=4
+-	md.flowequation.element_equation[numpy.nonzero(macayealpattynflag)]=5
+-	md.flowequation.element_equation[numpy.nonzero(macayealstokesflag)]=6
+-	md.flowequation.element_equation[numpy.nonzero(pattynstokesflag)]=7
+-
+-	#border
+-	md.flowequation.borderpattyn=nodeonpattyn
+-	md.flowequation.bordermacayeal=nodeonmacayeal
+-	md.flowequation.borderstokes=nodeonstokes
+-
+-	#Create vertices_type
+-	md.flowequation.vertex_equation=numpy.zeros(md.mesh.numberofvertices)
+-	pos=numpy.nonzero(nodeonhutter)
+-	md.flowequation.vertex_equation[pos]=1
+-	pos=numpy.nonzero(nodeonmacayeal)
+-	md.flowequation.vertex_equation[pos]=2
+-	pos=numpy.nonzero(nodeonpattyn)
+-	md.flowequation.vertex_equation[pos]=3
+-	pos=numpy.nonzero(nodeonhutter)
+-	md.flowequation.vertex_equation[pos]=1
+-	pos=numpy.nonzero(nodeonmacayealpattyn)
+-	md.flowequation.vertex_equation[pos]=5
+-	pos=numpy.nonzero(nodeonstokes)
+-	md.flowequation.vertex_equation[pos]=4
+-	if numpy.any(stokesflag):
+-		pos=numpy.nonzero(numpy.logical_not(nodeonstokes))
+-		if not (numpy.any(pattynflag) or numpy.any(macayealflag)):
+-			md.flowequation.vertex_equation[pos]=0
+-	pos=numpy.nonzero(nodeonpattynstokes)
+-	md.flowequation.vertex_equation[pos]=7
+-	pos=numpy.nonzero(nodeonmacayealstokes)
+-	md.flowequation.vertex_equation[pos]=6
+-
+-	#figure out solution types
+-	md.flowequation.ishutter=float(numpy.any(md.flowequation.element_equation==1))
+-	md.flowequation.ismacayealpattyn=float(numpy.any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
+-	md.flowequation.isstokes=float(numpy.any(md.flowequation.element_equation==4))
+-
+-	return md
+-
+-	#Check that tiling can work:
+-	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal !=1):
+-		raise TypeError("error coupling domain too irregular")
+-	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderstokes + md.flowequation.bordermacayeal !=1):
+-		raise TypeError("error coupling domain too irregular")
+-	if numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.borderstokes !=1):
+-		raise TypeError("error coupling domain too irregular")
+-
+-	return md
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/contourenvelope.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/contourenvelope.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/contourenvelope.m	(revision 13009)
+@@ -1,139 +0,0 @@
+-function segments=contourenvelope(md,varargin)
+-%CONTOURENVELOPE - build a set of segments enveloping a contour .exp
+-%
+-%   Usage:
+-%      segments=contourenvelope(md,varargin)
+-%
+-%   Example:
+-%      segments=contourenvelope(md,'Stream.exp');
+-%      segments=contourenvelope(md,md.mask.elementonfloatingice)
+-%      segments=contourenvelope(md);
+-
+-%some checks
+-if nargin>2,
+-	help contourenvelope
+-	error('contourenvelope error message: bad usage');
+-end
+-if nargin==2,
+-	flags=varargin{1};
+-
+-	if ischar(flags),
+-		file=flags;
+-		file=varargin{1};
+-		if ~exist(file),
+-			error(['contourenvelope error message: file ' file ' not found']);
+-		end
+-		isfile=1;
+-	elseif isnumeric(flags),
+-		%do nothing for now
+-		isfile=0;
+-	else
+-		error('contourenvelope error message:  second argument should a file or an elements flag');
+-	end
+-end
+-
+-%Now, build the connectivity tables for this mesh.
+-%Computing connectivity
+-if (size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices & size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices2d),
+-	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-end
+-if (size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements & size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements2d),
+-	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-end
+-
+-%get nodes inside profile
+-mesh.elementconnectivity=md.mesh.elementconnectivity;
+-if md.mesh.dimension==2;
+-	mesh.elements=md.mesh.elements;
+-	mesh.x=md.mesh.x;
+-	mesh.y=md.mesh.y;
+-	mesh.numberofvertices=md.mesh.numberofvertices;
+-	mesh.numberofelements=md.mesh.numberofelements;
+-else
+-	mesh.elements=md.mesh.elements2d;
+-	mesh.x=md.mesh.x2d;
+-	mesh.y=md.mesh.y2d;
+-	mesh.numberofvertices=md.mesh.numberofvertices2d;
+-	mesh.numberofelements=md.mesh.numberofelements2d;
+-end
+-
+-if nargin==2,
+-
+-	if isfile,
+-		%get flag list of elements and nodes inside the contour
+-		nodein=ContourToMesh(mesh.elements,mesh.x,mesh.y,file,'node',1);
+-		elemin=(sum(nodein(mesh.elements),2)==size(mesh.elements,2));
+-		%modify element connectivity
+-		elemout=find(~elemin);
+-		mesh.elementconnectivity(elemout,:)=0;
+-		mesh.elementconnectivity(find(ismember(mesh.elementconnectivity,elemout)))=0;
+-	else
+-		%get flag list of elements and nodes inside the contour
+-		nodein=zeros(mesh.numberofvertices,1); 
+-		elemin=zeros(mesh.numberofelements,1); 
+-		
+-		pos=find(flags); 
+-		elemin(pos)=1;
+-		nodein(mesh.elements(pos,:))=1;
+-
+-		%modify element connectivity
+-		elemout=find(~elemin);
+-		mesh.elementconnectivity(elemout,:)=0;
+-		mesh.elementconnectivity(find(ismember(mesh.elementconnectivity,elemout)))=0;
+-	end
+-end
+-
+-%Find element on boundary
+-%First: find elements on the boundary of the domain
+-flag=mesh.elementconnectivity;
+-if nargin==2,
+-	flag(find(flag))=elemin(flag(find(flag)));
+-end
+-elementonboundary=double(prod(flag,2)==0 & sum(flag,2)>0);
+-
+-%Find segments on boundary
+-pos=find(elementonboundary);
+-num_segments=length(pos);
+-segments=zeros(num_segments,3);
+-count=1;
+-
+-for i=1:num_segments,
+-	el1=pos(i);
+-	els2=mesh.elementconnectivity(el1,find(mesh.elementconnectivity(el1,:)));
+-	if length(els2)>1,
+-		flag=intersect(mesh.elements(els2(1),:),mesh.elements(els2(2),:));
+-		nods1=mesh.elements(el1,:);
+-		nods1(find(nods1==flag))=[];
+-		segments(count,:)=[nods1 el1];
+-
+-		ord1=find(nods1(1)==mesh.elements(el1,:));
+-		ord2=find(nods1(2)==mesh.elements(el1,:));
+-
+-		%swap segment nodes if necessary
+-		if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
+-			temp=segments(count,1);
+-			segments(count,1)=segments(count,2);
+-			segments(count,2)=temp;
+-		end
+-		segments(count,1:2)=fliplr(segments(count,1:2));
+-		count=count+1;
+-	else
+-		nods1=mesh.elements(el1,:);
+-		flag=setdiff(nods1,mesh.elements(els2,:));
+-		for j=1:3,
+-			nods=nods1; nods(j)=[];
+-			if any(ismember(flag,nods)),
+-				segments(count,:)=[nods el1];
+-				ord1=find(nods(1)==mesh.elements(el1,:));
+-				ord2=find(nods(2)==mesh.elements(el1,:));
+-				if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
+-					temp=segments(count,1);
+-					segments(count,1)=segments(count,2);
+-					segments(count,2)=temp;
+-				end
+-				segments(count,1:2)=fliplr(segments(count,1:2));
+-				count=count+1;
+-			end
+-		end
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.m	(revision 13009)
+@@ -1,49 +0,0 @@
+-function md=setmask(md,floatingicename,groundedicename)
+-%SETMASK - establish boundaries between grounded and floating ice.
+-%
+-%   By default, ice is considered grounded. The contour floatingicename defines nodes 
+-%   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
+-%   that are grounded (ie: ice rises, islands, etc ...)
+-%   All input files are in the Argus format (extension .exp).
+-%
+-%   Usage:
+-%      md=setmask(md,floatingicename,groundedicename)
+-%
+-%   Examples:
+-%      md=setmask(md,'all','');
+-%      md=setmask(md,'Iceshelves.exp','Islands.exp');
+-
+-%some checks on list of arguments
+-if ((nargin~=3) | (nargout~=1)),
+-	help mask
+-	error('mask error message');
+-end
+-
+-%Get assigned fields
+-x=md.mesh.x;
+-y=md.mesh.y;
+-elements=md.mesh.elements;
+-
+-%Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
+-elementonfloatingice=FlagElements(md,floatingicename);
+-elementongroundedice=FlagElements(md,groundedicename);
+-
+-%Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
+-%arrays come from domain outlines that can intersect one another: 
+-elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
+-elementongroundedice=double(~elementonfloatingice);
+-
+-%the order here is important. we choose vertexongroundedice as default on the grounding line.
+-vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
+-vertexongroundedice=zeros(md.mesh.numberofvertices,1);
+-vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
+-vertexonfloatingice(find(~vertexongroundedice))=1;
+-%}}}
+-
+-%Return: 
+-md.mask.elementonfloatingice=elementonfloatingice;
+-md.mask.vertexonfloatingice=vertexonfloatingice;
+-md.mask.elementongroundedice=elementongroundedice;
+-md.mask.vertexongroundedice=vertexongroundedice;
+-md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
+-md.mask.elementonwater=zeros(md.mesh.numberofelements,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/parameterize.m	(revision 13009)
+@@ -1,57 +0,0 @@
+-function md=parameterize(md,parametername)
+-%PARAMETERIZE - parameterize a model
+-%
+-%   from a parameter matlab file, start filling in all the @model fields that were not 
+-%   filled in by the mesh.m and mask.m @model methods.
+-%   Warning: the parameter file must be able to be run in Matlab
+-%
+-%   Usage:
+-%      md=parameterize(md,parametername)
+-%
+-%   Example:
+-%      md=parameterize(md,'Square.par');
+-
+-%some checks
+-if ~exist(parametername),
+-	error(['parameterize error message: file ' parametername ' not found!']);
+-end
+-
+-%Try and run parameter file.
+-temporaryname=['TemporaryParameterFile' num2str(feature('GetPid')) ];
+-copyfile(parametername,[temporaryname '.m']);
+-
+-%WARNING: this is a bug of matlab: the TemporaryParameterFile must be cleared
+-%otherwise matlab keeps the previous version of this file which is not what
+-%we want!!!
+-eval(['clear ' temporaryname]);
+-
+-try,
+-	eval(temporaryname);
+-	delete([temporaryname '.m']);
+-catch me,
+-	delete([temporaryname '.m']);
+-
+-	%copy error message
+-	me2=struct('message',me.message,'stack',me.stack);
+-
+-	%rename parameter file
+-	me2.message=regexprep(me2.message,[temporaryname '.m'],parametername);
+-	for i=1:length(me2.stack)-1,
+-		me2.stack(i).file=regexprep(me2.stack(i).file,[temporaryname '.m'],parametername);
+-		me2.stack(i).name=regexprep(me2.stack(i).name,[temporaryname],parametername);
+-		if strcmp(me2.stack(i).name,'parameterize'),
+-			%remove error (eval(temporaryname);) misleading
+-			me2.stack(i)=[];
+-		end
+-	end
+-
+-	%throw error message
+-	rethrow(me2);
+-end
+-
+-%Name and notes
+-if isempty(md.miscellaneous.name), 
+-	[path,root,ext]=fileparts(parametername);
+-	md.miscellaneous.name=root; 
+-end
+-md=addnote(md,['Model created by using parameter file: ' parametername ' on: ' datestr(now)]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setflowequation.m	(revision 13009)
+@@ -1,281 +0,0 @@
+-function md=setflowequation(md,varargin)
+-%SETELEMENTSTYPE - associate a solution type to each element
+-%
+-%   This routine works like plotmodel: it works with an even number of inputs
+-%   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
+-%   that must be followed by the corresponding exp file or flags list
+-%   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+-%   If user wants every element outside the domain to be 
+-%   setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
+-%   an empty string '' will be considered as an empty domain
+-%   a string 'all' will be considered as the entire domain
+-%   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
+-%
+-%   Usage:
+-%      md=setflowequation(md,varargin)
+-%
+-%   Example:
+-%      md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
+-%      md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
+-
+-%some checks on list of arguments
+-if ((nargin<2) | (nargout~=1)),
+-	error('setflowequation error message');
+-end
+-
+-%Find_out what kind of coupling to use
+-options=pairoptions(varargin{:});
+-coupling_method=getfieldvalue(options,'coupling','tiling');
+-if (~strcmpi(coupling_method,'tiling') & ~strcmpi(coupling_method,'penalties')),
+-	error('coupling type can only be: tiling or penalties');
+-end
+-
+-[hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin{:});
+-
+-%Flag the elements that have not been flagged as filltype
+-if strcmpi(filltype,'hutter'),
+-	hutterflag(find(~(macayealflag | pattynflag)))=1;
+-elseif strcmpi(filltype,'macayeal'),
+-	macayealflag(find(~(hutterflag | pattynflag | stokesflag)))=1;
+-elseif strcmpi(filltype,'pattyn'),
+-	pattynflag(find(~(hutterflag | macayealflag | stokesflag)))=1;
+-end
+-
+-%check that each element has at least one flag
+-if any(hutterflag+ macayealflag+pattynflag+stokesflag==0),
+-	error('setflowequation error message: elements type not assigned, must be specified')
+-end
+-
+-%check that each element has only one flag
+-if any(hutterflag+ macayealflag+pattynflag+stokesflag>1),
+-	disp('setflowequation warning message: some elements have several types, higher order type is used for them')
+-	hutterflag(find(hutterflag & macayealflag))=0;
+-	hutterflag(find(hutterflag & pattynflag))=0;
+-	macayealflag(find(macayealflag & pattynflag))=0;
+-end
+-
+-%Check that no pattyn or stokes for 2d mesh
+-if (md.mesh.dimension==2),
+-	if any(stokesflag | pattynflag)
+-		error('setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first')
+-	end
+-end
+-
+-%Stokes can only be used alone for now:
+-if any(stokesflag) &any(hutterflag),
+-	error('setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere')
+-end
+-
+-%Initialize node fields
+-nodeonhutter=zeros(md.mesh.numberofvertices,1);
+-nodeonhutter(md.mesh.elements(find(hutterflag),:))=1;
+-nodeonmacayeal=zeros(md.mesh.numberofvertices,1);
+-nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+-nodeonpattyn=zeros(md.mesh.numberofvertices,1);
+-nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
+-nodeonstokes=zeros(md.mesh.numberofvertices,1);
+-noneflag=zeros(md.mesh.numberofelements,1);
+-
+-%First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
+-if any(stokesflag),
+-	fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
+-	fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
+-	stokesflag(find(fullspcelems))=0;
+-	nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
+-end
+-
+-%Then complete with NoneApproximation or the other model used if there is no stokes
+-if any(stokesflag), 
+-	if any(pattynflag), %fill with pattyn
+-		pattynflag(~stokesflag)=1;
+-		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
+-	elseif any(macayealflag), %fill with macayeal
+-		macayealflag(~stokesflag)=1;
+-		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+-	else %fill with none 
+-		noneflag(find(~stokesflag))=1;
+-	end
+-end
+-
+-%Now take care of the coupling between MacAyeal and Pattyn
+-md.diagnostic.vertex_pairing=[];
+-nodeonmacayealpattyn=zeros(md.mesh.numberofvertices,1);
+-nodeonpattynstokes=zeros(md.mesh.numberofvertices,1);
+-nodeonmacayealstokes=zeros(md.mesh.numberofvertices,1);
+-macayealpattynflag=zeros(md.mesh.numberofelements,1);
+-macayealstokesflag=zeros(md.mesh.numberofelements,1);
+-pattynstokesflag=zeros(md.mesh.numberofelements,1);
+-if strcmpi(coupling_method,'penalties'),
+-	%Create the border nodes between Pattyn and MacAyeal and extrude them
+-	numnodes2d=md.mesh.numberofvertices2d;
+-	numlayers=md.mesh.numberoflayers;
+-	bordernodes2d=find(nodeonpattyn(1:numnodes2d) & nodeonmacayeal(1:numnodes2d)); %Nodes connected to two different types of elements
+-
+-	%initialize and fill in penalties structure
+-	if ~isnan(bordernodes2d),
+-		penalties=[];
+-		for	i=1:numlayers-1,
+-			penalties=[penalties; [bordernodes2d bordernodes2d+md.mesh.numberofvertices2d*(i)]];
+-		end
+-		md.diagnostic.vertex_pairing=penalties;
+-	end
+-elseif strcmpi(coupling_method,'tiling'),
+-	if any(macayealflag) & any(pattynflag), %coupling macayeal pattyn
+-		%Find node at the border
+-		nodeonmacayealpattyn(find(nodeonmacayeal & nodeonpattyn))=1;
+-		%Macayeal elements in contact with this layer become MacAyealPattyn elements
+-		matrixelements=ismember(md.mesh.elements,find(nodeonmacayealpattyn));
+-		commonelements=sum(matrixelements,2)~=0;
+-		commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
+-		macayealflag(find(commonelements))=0; %these elements are now macayealpattynelements
+-		macayealpattynflag(find(commonelements))=1;
+-		nodeonmacayeal(:)=0;
+-		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+-
+-		%rule out elements that don't touch the 2 boundaries
+-		pos=find(macayealpattynflag);
+-		elist=zeros(length(pos),1);
+-		elist = elist + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
+-		elist = elist - any(sum(nodeonpattyn(md.mesh.elements(pos,:))  ,2),2);
+-		pos1=find(elist==1);
+-		macayealflag(pos(pos1))=1;
+-		macayealpattynflag(pos(pos1))=0;
+-		pos2=find(elist==-1);
+-		pattynflag(pos(pos2))=1;
+-		macayealpattynflag(pos(pos2))=0;
+-
+-		%Recompute nodes associated to these elements
+-		nodeonmacayeal(:)=0;
+-		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+-		nodeonpattyn(:)=0;
+-		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
+-		nodeonmacayealpattyn(:)=0;
+-		nodeonmacayealpattyn(md.mesh.elements(find(macayealpattynflag),:))=1;
+-
+-	elseif any(pattynflag) & any(stokesflag), %coupling pattyn stokes
+-		%Find node at the border
+-		nodeonpattynstokes(find(nodeonpattyn & nodeonstokes))=1;
+-		%Stokes elements in contact with this layer become PattynStokes elements
+-		matrixelements=ismember(md.mesh.elements,find(nodeonpattynstokes));
+-		commonelements=sum(matrixelements,2)~=0;
+-		commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
+-		stokesflag(find(commonelements))=0; %these elements are now macayealpattynelements
+-		pattynstokesflag(find(commonelements))=1;
+-		nodeonstokes=zeros(md.mesh.numberofvertices,1);
+-		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
+-
+-		%rule out elements that don't touch the 2 boundaries
+-		pos=find(pattynstokesflag);
+-		elist=zeros(length(pos),1);
+-		elist = elist + any(sum(nodeonstokes(md.mesh.elements(pos,:)),2),2);
+-		elist = elist - any(sum(nodeonpattyn(md.mesh.elements(pos,:)),2),2);
+-		pos1=find(elist==1);
+-		stokesflag(pos(pos1))=1;
+-		pattynstokesflag(pos(pos1))=0;
+-		pos2=find(elist==-1);
+-		pattynflag(pos(pos2))=1;
+-		pattynstokesflag(pos(pos2))=0;
+-
+-		%Recompute nodes associated to these elements
+-		nodeonstokes(:)=0;
+-		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
+-		nodeonpattyn(:)=0;
+-		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
+-		nodeonpattynstokes(:)=0;
+-		nodeonpattynstokes(md.mesh.elements(find(pattynstokesflag),:))=1;
+-
+-	elseif any(stokesflag) & any(macayealflag),
+-		%Find node at the border
+-		nodeonmacayealstokes(find(nodeonmacayeal & nodeonstokes))=1;
+-		%Stokes elements in contact with this layer become MacAyealStokes elements
+-		matrixelements=ismember(md.mesh.elements,find(nodeonmacayealstokes));
+-		commonelements=sum(matrixelements,2)~=0;
+-		commonelements(find(macayealflag))=0; %only one layer: the elements previously in macayeal
+-		stokesflag(find(commonelements))=0; %these elements are now macayealmacayealelements
+-		macayealstokesflag(find(commonelements))=1;
+-		nodeonstokes=zeros(md.mesh.numberofvertices,1);
+-		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
+-
+-		%rule out elements that don't touch the 2 boundaries
+-		pos=find(macayealstokesflag);
+-		elist=zeros(length(pos),1);
+-		elist = elist + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
+-		elist = elist - any(sum(nodeonstokes(md.mesh.elements(pos,:))  ,2),2);
+-		pos1=find(elist==1);
+-		macayealflag(pos(pos1))=1;
+-		macayealstokesflag(pos(pos1))=0;
+-		pos2=find(elist==-1);
+-		stokesflag(pos(pos2))=1;
+-		macayealstokesflag(pos(pos2))=0;
+-
+-		%Recompute nodes associated to these elements
+-		nodeonmacayeal(:)=0;
+-		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+-		nodeonstokes(:)=0;
+-		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
+-		nodeonmacayealstokes(:)=0;
+-		nodeonmacayealstokes(md.mesh.elements(find(macayealstokesflag),:))=1;
+-
+-	elseif any(stokesflag) & any(hutterflag),
+-		error('type of coupling not supported yet');
+-	end
+-end
+-
+-%Create MacaAyealPattynApproximation where needed
+-md.flowequation.element_equation=zeros(md.mesh.numberofelements,1);
+-md.flowequation.element_equation(find(noneflag))=0;
+-md.flowequation.element_equation(find(hutterflag))=1;
+-md.flowequation.element_equation(find(macayealflag))=2;
+-md.flowequation.element_equation(find(pattynflag))=3;
+-md.flowequation.element_equation(find(stokesflag))=4;
+-md.flowequation.element_equation(find(macayealpattynflag))=5;
+-md.flowequation.element_equation(find(macayealstokesflag))=6;
+-md.flowequation.element_equation(find(pattynstokesflag))=7;
+-
+-%border
+-md.flowequation.borderpattyn=nodeonpattyn;
+-md.flowequation.bordermacayeal=nodeonmacayeal;
+-md.flowequation.borderstokes=nodeonstokes;
+-
+-%Create vertices_type
+-md.flowequation.vertex_equation=zeros(md.mesh.numberofvertices,1);
+-pos=find(nodeonhutter);
+-md.flowequation.vertex_equation(pos)=1;
+-pos=find(nodeonmacayeal);
+-md.flowequation.vertex_equation(pos)=2;
+-pos=find(nodeonpattyn);
+-md.flowequation.vertex_equation(pos)=3;
+-pos=find(nodeonhutter);
+-md.flowequation.vertex_equation(pos)=1;
+-pos=find(nodeonmacayealpattyn);
+-md.flowequation.vertex_equation(pos)=5;
+-pos=find(nodeonstokes);
+-md.flowequation.vertex_equation(pos)=4;
+-if any(stokesflag),
+-	pos=find(~nodeonstokes);
+-	if(~any(pattynflag) & ~any(macayealflag)),
+-		md.flowequation.vertex_equation(pos)=0;
+-	end
+-end
+-pos=find(nodeonpattynstokes);
+-md.flowequation.vertex_equation(pos)=7;
+-pos=find(nodeonmacayealstokes);
+-md.flowequation.vertex_equation(pos)=6;
+-
+-%figure out solution types
+-md.flowequation.ishutter=double(any(md.flowequation.element_equation==1));
+-md.flowequation.ismacayealpattyn=double(any(md.flowequation.element_equation==2 | md.flowequation.element_equation==3));
+-md.flowequation.isstokes=double(any(md.flowequation.element_equation==4));
+-
+-return
+-
+-%Check that tiling can work:
+-if any(md.flowequation.bordermacayeal) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal ~=1),
+-	error('error coupling domain too irregular');
+-end
+-if any(md.flowequation.bordermacayeal) & any(md.flowequation.borderstokes) & any(md.flowequation.borderstokes + md.flowequation.bordermacayeal ~=1),
+-	error('error coupling domain too irregular');
+-end
+-if any(md.flowequation.borderstokes) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.borderstokes~=1),
+-	error('error coupling domain too irregular');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask2.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask2.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask2.m	(revision 13009)
+@@ -1,148 +0,0 @@
+-function md=setmask2(md,landname,floatingicename,groundedicename)
+-%GEOGRAPHY2 - establish land, ice sheet and ice shelf areas in a domains.
+-%
+-%   Usage:
+-%      md=setmask2(md,landname,floatingicename,groundedicename)
+-%
+-%   Examples:
+-%      md=setmask2(md,'LandName.exp','Iceshelves.exp','Islands.exp');
+-
+-%Get assigned fields
+-x=md.mesh.x;
+-y=md.mesh.y;
+-elements=md.mesh.elements;
+-
+-%recover elements and nodes on land.
+-if ischar(landname),
+-	[vertexonland,elementonland]=ContourToMesh(elements,x,y,landname,'element and node',2);
+-elseif isfloat(landname),
+-	if size(landname,1)~=md.mesh.numberofelements,
+-		error('Landname for area must be of same size as number of elements in model');
+-	end
+-	elementonland=landname;
+-	vertexonland=zeros(md.mesh.numberofvertices,1);
+-	vertexonland(md.mesh.elements(find(elementonland),:))=1;
+-else
+-	error('Invalid area option option');
+-end
+-
+-%Now, build the connectivity tables for this mesh.
+-if size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices,
+-	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-end
+-if size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements,
+-	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-end
+-
+-%any element with 3 nodes on land should be on land:
+-elementsonwater=find(~elementonland);
+-wrongelements=elementsonwater(find(( vertexonland(md.mesh.elements(elementsonwater,1)) + vertexonland(md.mesh.elements(elementsonwater,2)) + vertexonland(md.mesh.elements(elementsonwater,3)) ...
+-                  )==3));
+-elementonland(wrongelements)=1;
+-
+-%any element with its barycentre on land should be on land: (only if landname is an expfile)
+-if ischar(landname),
+-weights={[1;1;1],[2;1;1],[1;2;1],[1;1;2]};
+-	for i=1:length(weights),
+-		xelem=x(md.mesh.elements)*weights{i}/sum(weights{i});
+-		yelem=y(md.mesh.elements)*weights{i}/sum(weights{i});
+-	end
+-	baryonland=ContourToNodes(xelem,yelem,landname,1);
+-	pos=find(~baryonland); elementonland(pos)=0;
+-	pos=find(baryonland); elementonland(pos)=1;
+-end
+-
+-%figure out which elements on land are actually in the middle of the ocean!
+-pos1=find(elementonland); 
+-connectedtoland=md.mesh.elementconnectivity(pos1,:);
+-pos=find(connectedtoland); connectedtoland(pos)=1-elementonland(connectedtoland(pos));
+-connectedtolandsum=sum(connectedtoland,2);
+-waterelements=pos1(find(connectedtolandsum==3));
+-elementonland(waterelements)=0;
+-
+-%figure out which elements on water  are actually in the middle of the land!
+-pos1=find(~elementonland); 
+-connectedtowater=md.mesh.elementconnectivity(pos1,:);
+-pos=find(connectedtowater); connectedtowater(pos)=elementonland(connectedtowater(pos));
+-connectedtowatersum=sum(connectedtowater,2);
+-landelements=pos1(find(connectedtowatersum==3));
+-elementonland(landelements)=1;
+-
+-%recover arrays of ice shelf nodes and elements, and ice sheet nodes and elements.
+-elementonfloatingice=FlagElements(md,floatingicename);
+-elementongroundedice=FlagElements(md,groundedicename);
+-
+-%Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
+-%arrays come from domain outlines that can intersect one another: 
+-vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
+-vertexongroundedice=zeros(md.mesh.numberofvertices,1);
+-elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
+-elementongroundedice=double(~elementonfloatingice);
+-vertexonfloatingice(md.mesh.elements(find(elementonfloatingice),:))=1;
+-vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
+-
+-%now correct, so that none of the floatingice and groundedice elements and nodes are in the water.
+-pos=find(~elementonland);
+-elementonfloatingice(pos)=0; 
+-elementongroundedice(pos)=0;
+-
+-pos=find(~vertexonland);
+-vertexonfloatingice(pos)=0; 
+-vertexongroundedice(pos)=0;
+-
+-%create vertexonwater and elementonwater: 
+-vertexonwater=double(~vertexonland);
+-elementonwater=double(~elementonland);
+-
+-%correct for islands:
+-vertexonfloatingice=double(vertexonfloatingice & ~vertexongroundedice);
+-elementonfloatingice=double(elementonfloatingice & ~elementongroundedice);
+-
+-%now, groundedices are everything except iceshelves and water
+-vertexongroundedice=double(~vertexonfloatingice & ~vertexonwater);
+-elementongroundedice=double(~elementonfloatingice & ~elementonwater);
+-
+-%Deal with segments on neumann:
+-
+-%Get current connectivity
+-mesh.elementconnectivity=md.mesh.elementconnectivity;
+-
+-%put 0 for elements on water
+-pos=find(mesh.elementconnectivity);
+-mesh.elementconnectivity(pos)=mesh.elementconnectivity(pos).*(~elementonwater(mesh.elementconnectivity(pos)));
+-
+-%put line of ones for elements on water
+-pos=find(elementonwater);
+-mesh.elementconnectivity(pos,:)=1;% line of ones for elements on water so they won't be considered
+-
+-%resort lines (zeros must be at the last column for findsegments)
+-mesh.elementconnectivity=sort(mesh.elementconnectivity,2,'descend');
+-
+-%call findsegments to build segment using THIS conectivity
+-md.mesh.segments=findsegments(md,'mesh.elementconnectivity',mesh.elementconnectivity);
+-
+-%some final checks: 
+-%check that no node thinks it's on an ice shelf or ice sheet, and lies actually in the middle of the water.
+-nodesgrounded=find(~vertexonwater);
+-lengthconnectivity=size(md.mesh.vertexconnectivity,2);
+-groundedcounters=md.mesh.vertexconnectivity(nodesgrounded,lengthconnectivity);
+-groundedconnectivity=md.mesh.vertexconnectivity(nodesgrounded,1:lengthconnectivity-1);
+-pos=find(groundedconnectivity);
+-groundedconnectivity(pos)=elementonwater(groundedconnectivity(pos));
+-groundedsum=sum(groundedconnectivity,2);
+-errorflags=find(groundedsum==groundedcounters);
+-errornodes=nodesgrounded(errorflags);
+-
+-vertexonwater(errornodes)=1;
+-vertexongroundedice(errornodes)=0;
+-vertexonfloatingice(errornodes)=0;
+-
+-%Return: 
+-md.mask.vertexonfloatingice=vertexonfloatingice;
+-md.mask.elementonfloatingice=elementonfloatingice;
+-md.mask.vertexonwater=vertexonwater;
+-md.mask.elementonwater=elementonwater;
+-md.mask.vertexongroundedice=vertexongroundedice;
+-md.mask.elementongroundedice=elementongroundedice;
+-
+-md.mesh.segmentmarkers(:)=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.py	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/parameterization/setmask.py	(revision 13009)
+@@ -1,55 +0,0 @@
+-from numpy import *
+-import FlagElements as fe
+-
+-def setmask(md, floatingicename, groundedicename):
+-	#SETMASK - establish boundaries between grounded and floating ice.
+-	#
+-	#   By default, ice is considered grounded. The contour floatingicename defines nodes 
+-	#   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
+-	#   that are grounded (ie: ice rises, islands, etc ...)
+-	#   All input files are in the Argus format (extension .exp).
+-	#
+-	#   Usage:
+-	#      md=setmask(md,floatingicename,groundedicename)
+-	#
+-	#   Examples:
+-	#      md=setmask(md,'all','');
+-	#      md=setmask(md,'Iceshelves.exp','Islands.exp');
+-
+-	#%Get assigned fields
+-	x = md.mesh.x
+-	y = md.mesh.y
+-	elements = md.mesh.elements
+-
+-	#Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
+-	elementonfloatingice = fe.FlagElements(md, floatingicename)
+-	elementongroundedice = fe.FlagElements(md, groundedicename) 
+-
+-	#Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
+-	#arrays come from domain outlines that can intersect one another: 
+-
+-	elementonfloatingice = logical_and(elementonfloatingice,~elementongroundedice)
+-	elementongroundedice = ~elementonfloatingice
+-
+-	#the order here is important. we choose vertexongroundedice as default on the grounding line.
+-	vertexonfloatingice = zeros(md.mesh.numberofvertices,'bool')
+-	vertexongroundedice = zeros(md.mesh.numberofvertices,'bool')
+-
+-	pos=argwhere(elementongroundedice==1)
+-	pos=md.mesh.elements[pos,:]-1
+-	if pos.size:
+-		vertexongroundedice[pos]=True
+-
+-	pos=argwhere(~vertexongroundedice)
+-	if pos.size:
+-		vertexonfloatingice[pos]=True;
+-	#%}}}
+-
+-	#Return: 
+-	md.mask.elementonfloatingice = double(elementonfloatingice)
+-	md.mask.vertexonfloatingice = double(vertexonfloatingice)
+-	md.mask.elementongroundedice = double(elementongroundedice)
+-	md.mask.vertexongroundedice = double(vertexongroundedice)
+-	md.mask.vertexonwater = zeros(md.mesh.numberofvertices)
+-	md.mask.elementonwater = zeros(md.mesh.numberofelements)
+-	return md
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_rifts.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_rifts.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_rifts.m	(revision 13009)
+@@ -1,77 +0,0 @@
+-function plot_rifts(md,options,nlines,ncols,index);
+-%PLOT_RIFTS - plot rifts in a mesh
+-%
+-%   Usage:
+-%      plot_rifts(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-%plot mesh
+-subplot(nlines,ncols,index); 
+-
+-%offset to separate rift flanks.
+-offset=getfieldvalue(options,'offset',500);
+-if isstruct(md.rifts.riftstruct),
+-	
+-	for i=1:size(md.rifts.riftstruct,1),
+-		penaltypairs=md.rifts.riftstruct(i).penaltypairs;
+-
+-		normal=zeros(2,1);
+-		for j=1:size(penaltypairs,1),
+-			normal(1)=penaltypairs(j,5);
+-			normal(2)=penaltypairs(j,6);
+-			x(penaltypairs(j,1))=x(penaltypairs(j,1))-normal(1)*offset;
+-			y(penaltypairs(j,1))=y(penaltypairs(j,1))-normal(2)*offset;
+-		end
+-		if length(md.rifts.riftstruct(i).tips)==3,
+-			tip=md.rifts.riftstruct(i).tips(3);
+-			%who is tip connected to? 
+-			if isconnected(md.mesh.elements,penaltypairs(1,1),tip),
+-				normal(1)=penaltypairs(1,5);
+-				normal(2)=penaltypairs(1,6);
+-				x(tip)=x(tip)-normal(1)*offset;
+-				y(tip)=y(tip)-normal(2)*offset;
+-			end
+-
+-			if isconnected(md.mesh.elements,penaltypairs(1,2),tip),
+-				normal(1)=penaltypairs(1,5);
+-				normal(2)=penaltypairs(1,6);
+-				x(tip)=x(tip)+normal(1)*offset;
+-				y(tip)=y(tip)+normal(2)*offset;
+-			end
+-			if isconnected(md.mesh.elements,penaltypairs(end,1),tip),
+-				normal(1)=penaltypairs(end,5);
+-				normal(2)=penaltypairs(end,6);
+-				x(tip)=x(tip)-normal(1)*offset;
+-				y(tip)=y(tip)-normal(2)*offset;
+-			end
+-			if isconnected(md.mesh.elements,penaltypairs(end,2),tip),
+-				normal(1)=penaltypairs(end,5);
+-				normal(2)=penaltypairs(end,6);
+-				x(tip)=x(tip)+normal(1)*offset;
+-				y(tip)=y(tip)+normal(2)*offset;
+-			end
+-		end
+-	end
+-end
+-
+-%plot mesh
+-if is2d
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-else
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Rifts');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_contour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_contour.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_contour.m	(revision 13009)
+@@ -1,245 +0,0 @@
+-function plot_contour(md,datain,options);
+-%PLOT_CONTOUR - plot contours of a given field
+-%
+-%   Usage:
+-%      plot_contour(md,data,options);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z index is2d isplanet]=processmesh(md,[],options);
+-options=removefield(options,'log',0);
+-[data datatype]=processdata(md,datain,options);
+-
+-%check is2d
+-if ~is2d,
+-	error('plot_contour error message: contour not supported for 3d meshes, project on a layer');
+-end
+-
+-%first, process data: must be on nodes
+-if datatype==1,
+-	%elements -> take average
+-	data=averaging(md,data,0);
+-elseif datatype==2,
+-	%nodes -> do nothing
+-elseif datatype==3,
+-	%quiver -> take norm
+-	data=sqrt(sum(datain.*datain,2));
+-else
+-	error('datatype not supported yet');
+-end
+-
+-%prepare colors
+-if exist(options,'contouronly')
+-	%remove the previous plots
+-	cla
+-end
+-color=getfieldvalue(options,'contourcolor','y');
+-linewidth=getfieldvalue(options,'linewidth',1);
+-
+-%get contours levels
+-contourlevels=getfieldvalue(options,'contourlevels');
+-if isnumeric(contourlevels),
+-	levels=round_ice(linspace(max(data),min(data),contourlevels),2);
+-else
+-	levels=[];
+-	for i=1:length(contourlevels)
+-		levels(end+1)=contourlevels{i};
+-	end
+-	levels=sort(unique(levels),'descend');
+-end
+-numlevels=length(levels);
+-
+-%initialization of some variables
+-numberofelements=size(index,1);
+-elementslist=1:numberofelements;
+-c=[];
+-h=[];
+-
+-%get unique edges in mesh
+-%1: list of edges
+-edges=[index(:,[1,2]); index(:,[2,3]); index(:,[3,1])];
+-%2: find unique edges
+-[edges,I,J]=unique(sort(edges,2),'rows');
+-%3: unique edge numbers
+-vec=J;
+-%4: unique edges numbers in each triangle (2 triangles sharing the same edge will have
+-%   the same edge number)
+-edges_tria=[vec(elementslist), vec(elementslist+numberofelements), vec(elementslist+2*numberofelements)];
+-
+-%segments [nodes1 nodes2]
+-Seg1=index(:,[1 2]);
+-Seg2=index(:,[2 3]);
+-Seg3=index(:,[3 1]);
+-
+-%segment numbers [1;4;6;...]
+-Seg1_num=edges_tria(:,1);
+-Seg2_num=edges_tria(:,2);
+-Seg3_num=edges_tria(:,3);
+-
+-%value of data on each tips of the segments
+-Data1=data(Seg1);
+-Data2=data(Seg2);
+-Data3=data(Seg3);
+-
+-%get the ranges for each segment
+-Range1=sort(Data1,2);
+-Range2=sort(Data2,2);
+-Range3=sort(Data3,2);
+-
+-for i=1:numlevels
+-
+-	level=levels(i);
+-
+-	%find the segments that contain this value
+-	pos1=(Range1(:,1)<level & Range1(:,2)>level);
+-	pos2=(Range2(:,1)<level & Range2(:,2)>level);
+-	pos3=(Range3(:,1)<level & Range3(:,2)>level);
+-
+-	%get elements
+-	poselem12=(pos1 & pos2);
+-	poselem13=(pos1 & pos3);
+-	poselem23=(pos2 & pos3);
+-	poselem=find(poselem12 | poselem13 | poselem23);
+-	numelems=length(poselem);
+-
+-	%if no element has been flagged, skip to the next level
+-	if numelems==0,
+-		continue,
+-	end
+-
+-	%go through the elements and build the coordinates for each segment (1 by element)
+-	x1=zeros(numelems,1);
+-	x2=zeros(numelems,1);
+-	y1=zeros(numelems,1);
+-	y2=zeros(numelems,1);
+-	edge_l=zeros(numelems,2);
+-
+-	for j=1:numelems,
+-
+-		weight1=(level-Data1(poselem(j),1))/(Data1(poselem(j),2)-Data1(poselem(j),1));
+-		weight2=(level-Data2(poselem(j),1))/(Data2(poselem(j),2)-Data2(poselem(j),1));
+-		weight3=(level-Data3(poselem(j),1))/(Data3(poselem(j),2)-Data3(poselem(j),1));
+-
+-		if poselem12(poselem(j));
+-
+-			x1(j)=x(Seg1(poselem(j),1))+weight1*(x(Seg1(poselem(j),2))-x(Seg1(poselem(j),1)));
+-			x2(j)=x(Seg2(poselem(j),1))+weight2*(x(Seg2(poselem(j),2))-x(Seg2(poselem(j),1)));
+-			y1(j)=y(Seg1(poselem(j),1))+weight1*(y(Seg1(poselem(j),2))-y(Seg1(poselem(j),1)));
+-			y2(j)=y(Seg2(poselem(j),1))+weight2*(y(Seg2(poselem(j),2))-y(Seg2(poselem(j),1)));
+-			edge_l(j,1)=Seg1_num(poselem(j));
+-			edge_l(j,2)=Seg2_num(poselem(j));
+-
+-		elseif poselem13(poselem(j)),
+-
+-			x1(j)=x(Seg1(poselem(j),1))+weight1*(x(Seg1(poselem(j),2))-x(Seg1(poselem(j),1)));
+-			x2(j)=x(Seg3(poselem(j),1))+weight3*(x(Seg3(poselem(j),2))-x(Seg3(poselem(j),1)));
+-			y1(j)=y(Seg1(poselem(j),1))+weight1*(y(Seg1(poselem(j),2))-y(Seg1(poselem(j),1)));
+-			y2(j)=y(Seg3(poselem(j),1))+weight3*(y(Seg3(poselem(j),2))-y(Seg3(poselem(j),1)));
+-			edge_l(j,1)=Seg1_num(poselem(j));
+-			edge_l(j,2)=Seg3_num(poselem(j));
+-
+-		elseif poselem23(poselem(j)),
+-
+-			x1(j)=x(Seg2(poselem(j),1))+weight2*(x(Seg2(poselem(j),2))-x(Seg2(poselem(j),1)));
+-			x2(j)=x(Seg3(poselem(j),1))+weight3*(x(Seg3(poselem(j),2))-x(Seg3(poselem(j),1)));
+-			y1(j)=y(Seg2(poselem(j),1))+weight2*(y(Seg2(poselem(j),2))-y(Seg2(poselem(j),1)));
+-			y2(j)=y(Seg3(poselem(j),1))+weight3*(y(Seg3(poselem(j),2))-y(Seg3(poselem(j),1)));
+-			edge_l(j,1)=Seg2_num(poselem(j));
+-			edge_l(j,2)=Seg3_num(poselem(j));
+-		else
+-			%it shoud not go here
+-		end
+-	end
+-
+-	%now that we have the segments, we must try to connect them...
+-
+-	%loop over the subcontours
+-	while ~isempty(edge_l),
+-
+-		%take the right edge of the second segment and connect it to the next segments if any
+-		e1=edge_l(1,1);   e2=edge_l(1,2);
+-		xc=[x1(1);x2(1)]; yc=[y1(1);y2(1)];
+-
+-		%erase the lines corresponding to this edge
+-		edge_l(1,:)=[];
+-		x1(1)=[]; x2(1)=[];
+-		y1(1)=[]; y2(1)=[];
+-
+-		[ro1,co1]=find(edge_l==e1);
+-
+-		while ~isempty(ro1)
+-
+-			if co1==1,
+-				xc=[x2(ro1);xc]; yc=[y2(ro1);yc];
+-
+-				%next edge:
+-				e1=edge_l(ro1,2);
+-
+-			else
+-				xc=[x1(ro1);xc]; yc=[y1(ro1);yc];
+-
+-				%next edge:
+-				e1=edge_l(ro1,1);
+-			end
+-
+-			%erase the lines of this
+-			edge_l(ro1,:)=[];
+-			x1(ro1)=[]; x2(ro1)=[];
+-			y1(ro1)=[]; y2(ro1)=[];
+-
+-			%next connection
+-			[ro1,co1]=find(edge_l==e1);
+-		end
+-
+-		%same thing the other way (to the right)
+-		[ro2,co2]=find(edge_l==e2);
+-
+-		while ~isempty(ro2)
+-
+-			if co2==1,
+-				xc=[xc;x2(ro2)]; yc=[yc;y2(ro2)];
+-
+-				%next edge:
+-				e2=edge_l(ro2,2);
+-			else
+-				xc=[xc;x1(ro2)]; yc=[yc;y1(ro2)];
+-
+-				%next edge:
+-				e2=edge_l(ro2,1);
+-			end
+-
+-			%erase the lines of this
+-			edge_l(ro2,:)=[];
+-			x1(ro2)=[]; x2(ro2)=[];
+-			y1(ro2)=[]; y2(ro2)=[];
+-
+-			%next connection
+-			[ro2,co2]=find(edge_l==e2);
+-		end
+-
+-		%we now have one subcontour ready to be plotted
+-		zc=level*ones(length(xc)+1,1);
+-		if getfieldvalue(options,'contouronly',0),
+-			h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'Zdata',zc,'Cdata',zc,'facecolor','none','edgecolor','flat','linewidth',linewidth)];
+-			hold on      
+-		else
+-			h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'facecolor','none','edgecolor',color,'linewidth',linewidth)];
+-			hold on
+-		end
+-
+-		% Update the CS data structure as per "contours.m"
+-		% so that clabel works
+-		c = horzcat(c,[level, xc'; length(xc), yc']);
+-
+-	end
+-end
+-
+-%labels?
+-if (~strcmpi(getfieldvalue(options,'contourticks','on'),'off') & ~isempty(c) & ~isempty(h))
+-	if exist(options,'contouronly')
+-		clabel(c,h);
+-	else
+-		clabel(c,h,'color',color,'FontSize',14);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processmesh.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processmesh.m	(revision 13009)
+@@ -1,98 +0,0 @@
+-function [x y z elements is2d isplanet]=processmesh(md,data,options);
+-%PROCESSMESH - process mesh to be plotted
+-%
+-%   Usage:
+-%      [x y z elements is2d]=processmesh(md,data,options)
+-%
+-%   See also: PLOTMODEL, PROCESSDATA
+-
+-%some checks
+-if md.mesh.numberofvertices==0,
+-	error('plot error message: mesh is empty')
+-end
+-if md.mesh.numberofvertices==md.mesh.numberofelements
+-	error(['plot error message: the number of elements is the same as the number of nodes...']);
+-end
+-
+-if (isempty(data) | ~isstruct(data)),
+-	%first load x,y, etc ... to speed up plot
+-
+-	if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
+-		x=md.mesh.x;
+-		if isfield(md.mesh,'x2d'), x2d=md.mesh.x2d; end
+-		y=md.mesh.y;
+-		if isfield(md.mesh,'y2d'), y2d=md.mesh.y2d; end
+-	else
+-		x=md.mesh.long;
+-		%x2d=md.mesh.x2d; this sounds like something that was forgotten
+-		y=md.mesh.lat;
+-		%y2d=md.mesh.y2d;
+-	end
+-
+-	z_field=getfieldvalue(options,'z',md.mesh.z);
+-	if ischar(z_field),
+-		z=md.(z_field);
+-	elseif isnumeric(z_field),
+-		z=z_field;
+-	else
+-		z=md.mesh.z;
+-	end
+-
+-
+-	if isfield(md.mesh,'elements2d'), elements2d=md.mesh.elements2d; end
+-	elements=md.mesh.elements;
+-
+-	%is it a 2d plot?
+-	if (md.mesh.dimension==2);
+-		is2d=1;
+-	elseif (md.mesh.dimension==3),
+-		if getfieldvalue(options,'layer',0)>=1,
+-			is2d=1;
+-		else
+-			is2d=0;
+-		end
+-	else
+-		error(['dim = ' num2str(md.mesh.dimension) ' not supported yet']);
+-	end
+-
+-	%layer projection? 
+-	if getfieldvalue(options,'layer',0)>=1,
+-		if strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
+-			error('processmesh error message: cannot work with 3D meshes for now');
+-		end
+-		%we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded. 
+-		x=x2d;
+-		y=y2d;
+-		z=zeros(size(x2d));
+-		elements=elements2d;
+-	end
+-else
+-	%Process Patch
+-	if (md.mesh.dimension==2),
+-		elements=transpose(reshape(1:3*md.mesh.numberofelements,3,md.mesh.numberofelements));
+-		x=transpose(reshape(md.mesh.x(data.index)',1,3*md.mesh.numberofelements));
+-		y=transpose(reshape(md.mesh.y(data.index)',1,3*md.mesh.numberofelements));
+-		z=zeros(3*md.mesh.numberofelements,1);
+-		is2d=1;
+-	else
+-		elements=transpose(reshape(1:6*md.mesh.numberofelements,6,md.mesh.numberofelements));
+-		x=transpose(reshape(md.mesh.x(data.index)',1,6*md.mesh.numberofelements));
+-		y=transpose(reshape(md.mesh.y(data.index)',1,6*md.mesh.numberofelements));
+-		z=transpose(reshape(md.mesh.z(data.index)',1,6*md.mesh.numberofelements));
+-		is2d=0;
+-	end
+-end
+-
+-%units
+-if exist(options,'unit'),
+-	unit=getfieldvalue(options,'unit');
+-	x=x*unit;
+-	y=y*unit;
+-	z=z*unit;
+-end
+-
+-if isa(md,'planet'),
+-	isplanet=1;
+-else
+-	isplanet=0;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_parthist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_parthist.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_parthist.m	(revision 13009)
+@@ -1,34 +0,0 @@
+-function plot_parthist(md,options,nlines,ncols,i);
+-%PLOT_PARTHIST - plot partitioning histogram
+-%
+-%   Usage:
+-%      plot_parthist(md,options,nlines,ncols,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-%plot mesh
+-subplot(nlines,ncols,i); 
+-
+-imin=min(md.qmu.partition);
+-imax=max(md.qmu.partition);
+-
+-part=zeros(imax-imin+1,2);
+-
+-for i=imin:imax
+-    ind=find(md.qmu.partition == i);
+-    part(i-imin+1,1)=length(ind);
+-	part(i-imin+1,2)=sum(md.vertex_weight(ind));
+-end
+-
+-subplot(2,1,1)
+-bar(imin:imax,part(:,1));
+-xlim([imin-0.5 imax+0.5])
+-title('Number of Nodes in Each Partition')
+-
+-subplot(2,1,2)
+-bar(imin:imax,part(:,2));
+-xlim([imin-0.5 imax+0.5])
+-title('Total Weight in Each Partition')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmumean.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmumean.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmumean.m	(revision 13009)
+@@ -1,59 +0,0 @@
+-function plot_qmumean(md,options,nlines,ncols,i);
+-%PLOT_QMUMEAN - plot mean of a scaled response 
+-%
+-%   Usage:
+-%      plot_qmumean(md,options,nlines,ncols,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%plot mesh
+-subplot(nlines,ncols,i); 
+-
+-%edgecolor
+-edgecolor=getfieldvalue(options,'edgecolor','none');
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-%find response function
+-if exist(options,'qmudata'), 
+-	descriptor=getfieldvalue(options,'qmudata'); 
+-	if ~ischar(descriptor),
+-		error('plot_qmumean error message:  descriptor should be a string');
+-	end
+-else 
+-	error('plot_qmumean error message:  provide descriptor of response function in ''qmudata'' option');
+-end
+-
+-%go pick up the response: 
+-allresponses=md.qmu.results.dresp_out;
+-responses=zeros(md.qmu.numberofpartitions,1);
+-
+-count=1;
+-for i=1:length(allresponses),
+-	d=allresponses(i).descriptor;
+-	if strncmpi(d,'scaled_',7),
+-		d=d(8:end);
+-		if strncmpi(d,descriptor,length(descriptor)),
+-			responses(count)=allresponses(i).mean;
+-			count=count+1;
+-		end
+-	end
+-end
+-
+-%log?
+-if exist(options,'log'),
+-	responses=log(responses)/log(getfieldvalue(options,'log'));
+-end
+-
+-%now, project onto vertices
+-responses_on_node=responses(md.qmu.partition+1);
+-
+-%plot
+-A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', responses_on_node,'FaceColor','interp','EdgeColor',edgecolor);
+-
+-%apply options
+-options=addfielddefault(options,'title',['Mean distribution of ' descriptor]);
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/imagescnan.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/imagescnan.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/imagescnan.m	(revision 13009)
+@@ -1,303 +0,0 @@
+-function [h,hcb] = imagescnan(x,y,U,varargin)
+-%IMAGESCNAN Scale data and display as image with uncolored NaNs.
+-%
+-%   Syntax
+-%               imagescnan(x,y,U)
+-%               imagescnan(x,y,U,...,colormask)
+-%               imagescnan(x,y,U,...,color)
+-%               imagescnan(x,y,U,...,cbfit_opt)
+-%           h = imagescnan(...);
+-%     [h,hcb] = imagescnan(...,cbfit_opt);
+-%
+-%   Input:
+-%     x          - X-axis vector data. Optional, i.e., can be empty.
+-%                  Default: 1:n (rows index).
+-%     y          - Y-axis vector data. Optional, i.e., can be empty.
+-%                  Default: 1:m (column index).
+-%     U          - Matrix [m x n] data or an RGB image [m x n x 3] (with/
+-%                  without NaNs). 
+-%     colormask  - Logical matrix indicating the U elements to be
+-%                  uncolored, if is empty then ISNAN(U) is used. Or it can
+-%                  be a single value which will be uncolored.
+-%                  Default: ~isfinite(U) (NaNs and Infs elements uncolored)
+-%     color      - A vector with 3 elements specifying the [R G B] color
+-%                  for the NaNs color. It can be specified by the known
+-%                  char colors: 'k', etcerera. Optional.  
+-%                  Default: get(gca,'color') (axes background color)
+-%     cbfit_opt  - Cell array with the options to call COLORBARFIT.
+-%                  Default: COLORBARFIT function is not used by default.
+-%
+-%   Output:
+-%     h   - Image handle. Optional
+-%     hcb - Colorbar handle. Optional
+-%
+-%   Description:
+-%      This function draws a matrix data as an image with uncolored NaN's
+-%      elements using IMAGESC. The difference between IMAGESC and the
+-%      PCOLOR, MESH or SURF function is that EVERY element is colored and
+-%      no one is interpolated, besides, the pixels are centered with the
+-%      axis value, although it is a flat image.
+-%
+-%      The color mask is added because IMAGESC do not work with NaN's, in
+-%      fact it colors them with the lower value of the current colormap.
+-%      
+-%      The cbfit_opt is include in order to be able to define a diferent
+-%      color map with the COLORBARFIT function which can be found at:
+-%           http://www.mathworks.com/matlabcentral/fileexchange/.
+-%      If this function is not found, a normal COLORBAR is generated.
+-%
+-%      The data and the colorbar are scaled with the current colormap, so,
+-%      the use of COLORMAP after this function doesn't affects the
+-%      generated image and colorbar! Therefore, COLORMAP and CAXIS should
+-%      be used before this function.
+-%
+-%      Notes: * The inputs arguments for the COLORBARFIT function are 3
+-%               plus the normal COLORBAR function options, for this reason,
+-%               if the former is not found, the latter is used ignoring
+-%               these first 3 options. Anyway, to generate a colorbar, at
+-%               least an empty cell is needed for cbfit_opt = {[]}.
+-%   
+-%   Examples:
+-%
+-%      % Compares with normal IMAGESC:
+-%       N = 100;
+-%       PNaNs = 0.10;
+-%       X = peaks(N);
+-%       X(round(1 + (N^2-1).*rand(N^2*PNaNs,1))) = NaN;
+-%       subplot(221), imagesc(X)
+-%        title('With IMAGESC: ugly NaNs')
+-%       subplot(222), imagescnan([],[],X) 
+-%        title('With IMAGESCNAN: uncolored NaNs')
+-%
+-%      % Compares with SPY:
+-%       subplot(223), spy(isnan(X))
+-%        title('SPY NaNs')
+-%       subplot(224), imagescnan([],[],isnan(X),0), axis equal tight
+-%        title('No-NaNs with IMAGESCNAN')
+-%
+-%   See also IMAGE, IMAGESC, COLORBAR, IMREAD, IMWRITE and COLORBARFIT by
+-%   Carlos Vargas. 
+-
+-%   Copyright 2008 Carlos Adrian Vargas Aguilera
+-%   $Revision: 1.1 $  $Date: 2009/04/03 22:56:05 $
+-
+-%   Written by
+-%   M.S. Carlos Adrian Vargas Aguilera
+-%   Physical Oceanography PhD candidate
+-%   CICESE 
+-%   Mexico, 2008
+-%   nubeobscura@hotmail.com
+-%
+-%   Download from:
+-%   http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objec
+-%   tType=author&objectId=1093874
+-
+-%   1.0     Released (30/06/2008)
+-%   1.1     Fixed bug when CAXIS used.
+-%   1.2     Colorbar freezed colormap.
+-%   1.3     Fixed bug in color vector input (Found by Greg King) and now
+-%           accets RGB image as input.
+-
+-%% INPUTS:
+-
+-% Error checking:
+-% Note: At least 3 inputs and no more than 6:
+-if nargin<3 || nargin>6
+- error('Imagescnan:IncorrectInputNumber',...
+-       'Input arguments must be at least 3 and less than 7.')
+-end
+-
+-% Check the x,y,U:
+-% Note: x,y should be the axes data.
+-m = size(U);
+-if numel(m)>3
+- error('Imagescnan:IncorrectInputSize',...
+-       'Input image must be a matrix or an RGB image.')
+-else
+- if isempty(x) || numel(x)~=m(2)
+-  %warning('Imagescnan:IncorrectInputSize',...
+-  %        'Index column axis has been used.')
+-  x = 1:m(2); 
+- end
+- if isempty(y) || numel(y)~=m(1)
+-  %warning('Imagescnan:IncorrectInputSize',...
+-  %        'Index row axis has been used.')
+-  y = 1:m(1); 
+- end
+-end
+-
+-% Get color limits:
+-% Note: If you would like to use specific color limits, use CAXIS before
+-%       this function.
+-switch get(gca,'CLimMode')
+- case 'manual'
+-  clim = caxis;
+- otherwise
+-  clim = [min(U(:)) max(U(:))];
+-end
+-
+-% Parse inputs and defaults:
+-% Note: * Mask color will be the not-finite elements plus the elements
+-%         indicated by the user.
+-%       * Default colormask is the current axes background.
+-%       * Default currentmap is current figure colormap (probably JET).
+-colormask = ~isfinite(U);
+-color_nan = get(gca,'color');
+-color_map = get(gcf,'colormap'); 
+-cbfit_opt = [];
+-ycolorbarfit = (exist('colorbarfit','file')==2);
+-if nargin>3
+- while ~isempty(varargin)
+-  if     iscell(varargin{1})
+-   if length(varargin{1})<3
+-    error('Imagescnan:IncorrectInputType',...
+-     'Options for COLORBARFIT must be at least 3, although empty.')
+-   end
+-   caxis(clim)
+-   cbfit_opt = varargin{1};
+-   if ycolorbarfit
+-    colorbarfit(cbfit_opt{:})
+-    color_map = get(gcf,'colormap');
+-   else
+-    % warning('Imagescnan:ColorBarFitNotFound',...
+-    %  'COLORBARFIT function not found, used default COLORBAR.') 
+-   end
+-   varargin(1) = [];
+-  elseif ischar(varargin{1})
+-   switch varargin{1}
+-    case 'y', color_nan = [1 1 0];
+-    case 'm', color_nan = [1 0 0];
+-    case 'c', color_nan = [0 1 1];
+-    case 'r', color_nan = [1 0 0];
+-    case 'g', color_nan = [0 1 0];
+-    case 'b', color_nan = [0 0 1];
+-    case 'w', color_nan = [1 1 1];
+-    case 'k', color_nan = [0 0 0];
+-   otherwise
+-   error('Imagescnan:InvalidColor',...
+-    'Color char must be one of: ''ymcrgbwk''.')
+-   end
+-   varargin(1) = [];
+-  elseif islogical(varargin{1})
+-   if numel(varargin{1})~=numel(U)
+-    error('Imagescnan:InvalidMask',...
+-     'The logical mask must have the same elements as the matrix.')
+-   end
+-   colormask = varargin{1} | colormask;
+-   varargin(1) = [];
+-  elseif length(varargin{1})==3
+-   if (max(varargin{1})>1) || (min(varargin{1})<0) % Fixed BUG 2008/07/11
+-    error('Imagescnan:InvalidColor',...
+-     'The color must be on the range of [0 1].')
+-   end
+-   color_nan = varargin{1};
+-   varargin(1) = [];
+-  elseif length(varargin{1})==1
+-   colormask = (U==varargin{1}) | colormask;
+-   varargin(1) = [];
+-  else
+-   error('Imagescnan:IncorrectInputType',...
+-    'Incorrect optional(s) argument(s).')
+-  end
+- end
+-end
+-
+-
+-%% MAIN:
+-
+-% Matrix data to RGB:
+-if numel(m)==2
+-
+- % Sets to double data:
+- if ~isfloat(U)
+-  U = double(U);
+- end
+-
+- % Normalizes and rounds data to range [0 N]:
+- N = size(color_map,1);
+- U = (U - clim(1))/diff(clim);          % Fixed bug when CAXIS used
+- U = U*N;
+- if N<=256
+-  U = uint8(U);
+- else
+-  U = uint16(U);
+- end
+-
+- % Scales data with colormap:
+- U = ind2rgb(U,color_map);              % 2D to 3D RGB values [0 1]
+-else
+- % Already is an RGB image, so do nothing.
+-end
+-
+- % Set mask color to color_nan:
+- mn = prod(m(1:2));
+- ind = find(colormask);
+- U(ind)      = color_nan(1); % Red color
+- U(ind+mn)   = color_nan(2); % Green color
+- U(ind+mn*2) = color_nan(3); % Blue color
+-
+- % Draws the RGB image:
+- h = imagesc(x,y,U,clim);
+-
+-%% OUTPUTS:
+-
+-% Calls to colorbarfit and freezes his colormap:
+-if ~isempty(cbfit_opt)
+- % Creates a temporary colorbar:
+- if ycolorbarfit
+-  hcb   = colorbarfit(cbfit_opt{:});
+- else
+-  Nopt = min([3 length(cbfit_opt)]);
+-  cbfit_opt(1:Nopt) = [];
+-  hcb   = colorbar(cbfit_opt{:});
+- end
+- % Save image position:
+- ha    = gca; position = get(ha,'Position'); 
+- % Gets colorbar axes properties:
+- ghcb  = get(hcb);
+- CData = ind2rgb(get(ghcb.Children,'CData'),color_map);
+- XData = get(ghcb.Children,'XData');
+- YData = get(ghcb.Children,'YData');
+- % Move ticks because IMAGESC draws them like centered pixels:
+- XTick = ghcb.XTick;
+- YTick = ghcb.YTick;
+- if ~isempty(XTick)
+-  XTick = XTick(1:end-1) + diff(XTick(1:2))/2;
+- end
+- if ~isempty(YTick)
+-  YTick = YTick(1:end-1) + diff(YTick(1:2))/2;
+- end
+- % Deletes the colorbar:
+- delete(hcb)            
+- % Generates other colorbar:
+- hcb = axes('Position',ghcb.Position);
+- hcbim = imagesc(XTick,YTick,CData,'Parent',hcb); axis tight
+- set(hcbim,...
+-  'HitTest','off',...
+-  'Interruptible','off',...
+-  'SelectionHighlight','off',...
+-  'Tag','TMW_COLORBAR',...
+-  'XData',XData,...
+-  'YData',YData)
+- set(hcb,...
+-  'XAxisLocation',ghcb.XAxisLocation,...
+-  'YAxisLocation',ghcb.YAxisLocation,...
+-  'XLim',ghcb.XLim,...
+-  'YLim',ghcb.YLim,...
+-  'XDir',ghcb.XDir,...
+-  'YDir',ghcb.YDir,...
+-  'XTick',ghcb.XTick,...
+-  'YTick',ghcb.YTick,...
+-  'XTickLabel',ghcb.XTickLabel,...
+-  'YTickLabel',ghcb.YTickLabel,...
+-  'ButtonDownFcn',@resetCurrentAxes,...
+-  'Interruptible','off',...
+-  'Tag','Colorbar')
+- % Returns the image position:
+- axes(ha), set(ha,'Position',position)
+-end
+-
+-% Sets output:
+-if ~nargout
+- clear h
+-end
+\ No newline at end of file
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/radarpower.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/radarpower.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/radarpower.m	(revision 13009)
+@@ -1,118 +0,0 @@
+-function md=radarpower(md,varargin)
+-%RADARPOWER - overlay a power radar image on an existing mesh
+-%
+-%   This routine will overlay a power radar image on an existing mesh.
+-%   The power amplitude will be output to vel for now.
+-%   In the future, think about a field to hold this value.
+-%
+-%   Usage:
+-%      md=radarpower(md,options);
+-%      md=radarpower(md)
+-
+-%If gdal does not work, uncomment the following line
+-%setenv('LD_LIBRARY_PATH','/proj/ice/larour/issm/trunk/externalpackages/gdal/install/lib/');
+-%Parse inputs
+-if nargin==1,
+-	options=pairoptions;
+-else
+-	options=varargin{:};
+-	if ~isa(options,'pairoptions'),
+-		options=pairoptions(varargin{:});
+-	end
+-end
+-
+-highres=getfieldvalue(options,'highres',0);
+-xlim=getfieldvalue(options,'xlim',[min(md.mesh.x) max(md.mesh.x)]);
+-ylim=getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]);
+-posting=getfieldvalue(options,'posting',0); % 0 -> image posting default
+-
+-%find gdal coordinates
+-x0=min(xlim); x1=max(xlim);
+-y0=min(ylim); y1=max(ylim);
+-
+-%figure out if we should go look for Greenland or Antarctica geotiff, or if user provided one.
+-if ~exist(options,'overlay_image'),
+-	if strcmpi(md.mesh.hemisphere,'n'),
+-		if ~exist([jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg']),
+-			error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg not found.']);
+-		end
+-		name = 'mog150_greenland_map';
+-		%name = 'mog100_hp1_v10';
+-		%name = 'mog500_hp1_v10';
+-		jpgim=[jplsvn() '/projects/ModelData/MOG/' name '.jpg'];
+-		geom=load([jplsvn() '/projects/ModelData/MOG/' name '.jpgw'],'ascii');
+-
+-		%geom:   xposting nbcols nbrows yposting xmin ymax
+-		xmin=max(geom(5),x0);
+-		xmax=min(geom(5)+geom(1)*geom(2),x1);
+-		ymin=max(geom(6)-geom(3)*geom(4),y0);
+-		ymax=min(geom(6),y1);
+-
+-		firstcol=max(1,floor((xmin-geom(5))/geom(1))); %x min
+-		firstrow=max(1,floor((geom(6)-ymax)/geom(4))); %y max
+-		numcols=floor((xmax-xmin)/geom(1)); % x posting
+-		numrows=floor((ymax-ymin)/geom(4)); % y posting
+-		pixelskip=max(1,ceil(posting/geom(1)));
+-
+-		%Read and crop file
+-		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-		im=imread(jpgim);
+-		im=im(firstrow:firstrow+numrows-1,firstcol:firstcol+numcols-1);
+-		md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
+-		md.radaroverlay.x=(xmin:(xmax-xmin)/(size(md.radaroverlay.pwr,2)-1):xmax);
+-		md.radaroverlay.y=(ymin:(ymax-ymin)/(size(md.radaroverlay.pwr,1)-1):ymax);
+-
+-	elseif strcmpi(md.mesh.hemisphere,'s'),
+-		if highres,
+-			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif']),
+-				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif not found.']);
+-			end
+-			geotiff_name=[jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif'];
+-		else
+-			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif']),
+-				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif not found.']);
+-			end
+-			geotiff_name=[jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif'];
+-		end
+-
+-		%Name of image
+-		inputname='./temp.tif';
+-		eval(['!gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ]);
+-
+-		%Read in temp.tif:
+-		im=imread('temp.tif','TIFF');
+-		pixelskip=max(1,ceil(posting/((x1-x0)/(size(im,2)))));
+-		md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
+-		md.radaroverlay.x=(x0:(x1-x0)/(size(md.radaroverlay.pwr,2)-1):x1);
+-		md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
+-
+-		%Erase image
+-		system('rm -rf ./temp.tif');
+-
+-	else
+-		error('field hemisphere should either be ''n'' or ''s''');
+-	end
+-else
+-	%ok, user provided an image. check we also have overlay_xlim and overlay_ylim  options, to know what range of coordinates the image covers.
+-	if (~exist(options,'overlay_xlim') | ~exist(options,'overlay_xlim')| ~exist(options,'overlay_xposting')| ~exist(options,'overlay_yposting')),
+-		error('radarpower error message: please provide overlay_xlim, overlay_ylim, overlay_xposting and overlay_yposting options together with overlay_image option');
+-	end
+-	overlay_image=getfieldvalue(options,'overlay_image');
+-	overlay_xlim=getfieldvalue(options,'overlay_xlim');
+-	overlay_ylim=getfieldvalue(options,'overlay_ylim');
+-	overlay_xposting=getfieldvalue(options,'overlay_xposting');
+-	overlay_yposting=getfieldvalue(options,'overlay_yposting');
+-
+-	sizex=floor((x1-x0)/overlay_xposting);
+-	sizey=floor((y1-y0)/overlay_yposting);
+-	topleftx=floor((x0-overlay_xlim(1))/overlay_xposting); % x min
+-	toplefty=floor((overlay_ylim(2)-y1)/overlay_yposting); % y max
+-
+-	%Read and crop file
+-	disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-	im=imread(overlay_image);
+-	im=im(toplefty:toplefty+sizey,topleftx:topleftx+sizex);
+-	md.radaroverlay.pwr=double(flipud(im));
+-	md.radaroverlay.x=(x0:(x1-x0)/(size(md.radaroverlay.pwr,2)-1):x1);
+-	md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_icefront.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_icefront.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_icefront.m	(revision 13009)
+@@ -1,106 +0,0 @@
+-function plot_icefront(md,options,width,i,data);
+-%PLOT_ICEFRONT - plot segment on neumann BC
+-%
+-%   Usage:
+-%      plot_icefront(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%plot mesh boundaries
+-subplot(width,width,i); 
+-
+-%process mesh and data
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-icefront=md.diagnostic.icefront;
+-
+-if (md.mesh.dimension==2),
+-
+-	%plot mesh
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-	h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	hold on;
+-
+-	%highlight elements on neumann
+-	pos=find(icefront(:,end)==1);
+-	pos=icefront(pos,end-1);
+-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
+-	h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+-	pos=find(icefront(:,end)==0);
+-	pos=icefront(pos,end-1);
+-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
+-	h3=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+-
+-	pos=find(icefront(:,end)==2);
+-	pos=icefront(pos,end-1);
+-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
+-	h3bis=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+-
+-	%display arrows pointing outward
+-	xstart=mean(x(icefront(:,1:end-2)),2);
+-	ystart=mean(y(icefront(:,1:end-2)),2);
+-	length=sqrt((x(icefront(:,1))-x(icefront(:,2))).^2 + (y(icefront(:,1))-y(icefront(:,2))).^2 );
+-	normal(:,1)=cos(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
+-	normal(:,2)=sin(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
+-	xend=xstart+length.*normal(:,1);
+-	yend=ystart+length.*normal(:,2);
+-	q=quiver(xstart,ystart,xend-xstart,yend-ystart); hold on;
+-	h4=plot(xstart,ystart,'r*');
+-else
+-
+-	%plot mesh
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-	h1=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	hold on;
+-
+-	%highlight elements on neumann
+-	pos=find(icefront(:,end)==1);
+-	pos=icefront(pos,end-1);
+-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
+-	h2=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+-	pos=find(icefront(:,end)==0);
+-	pos=icefront(pos,end-1);
+-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
+-	h3=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+-	pos=find(icefront(:,end)==2);
+-	pos=icefront(pos,end-1);
+-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
+-	h3bis=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+-
+-	%display arrows pointing outward
+-	xstart=mean(x(icefront(:,1:end-2)),2);
+-	ystart=mean(y(icefront(:,1:end-2)),2);
+-	zstart=mean(z(icefront(:,1:end-2)),2);
+-	length=sqrt((x(icefront(:,1))-x(icefront(:,2))).^2 + (y(icefront(:,1))-y(icefront(:,2))).^2 );
+-	normal(:,1)=cos(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
+-	normal(:,2)=sin(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
+-	xend=xstart+length.*normal(:,1);
+-	yend=ystart+length.*normal(:,2);
+-	q=quiver3(xstart,ystart,zstart,xend-xstart,yend-ystart,zeros(numel(xstart),1)); hold on;
+-	h4=plot3(xstart,ystart,zstart,'r*');
+-end
+-
+-%legend (disable warnings)
+-warning off
+-legend([h2,h3,h3bis,q],'element on ice front (Water)','element on ice front (Air)','element on ice front (Ice)','normal vectors')
+-warning on
+-
+-%apply options
+-options=addfielddefault(options,'title','Neumann boundary conditions');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_transient_field.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_transient_field.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_transient_field.m	(revision 13009)
+@@ -1,43 +0,0 @@
+-function plot_transient_field(md,options,width,i,data)
+-%PLOT_TRANSIENT_FIELD - plot transient results
+-%
+-%   Usage:
+-%      plot_transient_field(md,options,width,i,data);
+-%
+-%   See also: PLOTMODEL
+-
+-%Check that they are transient results
+-if (~isfield(md.results,'TransientSolution')),
+-	error('plot_transient_field error message: no transient results in the model');
+-end
+-
+-%Figure out the iterations to plot and check if it is possible
+-transient=md.results.TransientSolution;
+-maxiteration=size(transient,2);
+-steps=getfieldvalue(options,'steps',1:1:maxiteration);
+-
+-if max(steps)>maxiteration | min(steps)<1,
+-	error(['plot_transient_field error message: problem with the steps requested, must be an interger between 0 and ' num2str(maxiteration)]);
+-end
+-subplotwidth=ceil(sqrt(length(steps)));
+-
+-%Figure out the field to plot
+-
+-field=getfieldvalue(options,'field','Vel');
+-
+-%process mes only once
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-%plot data for all steps
+-for i=1:length(steps),
+-
+-	%process data and change title if needed
+-	[data datatype]=processdata(md,transient(steps(i)).(field),options);
+-	options=changefieldvalue(options,'title',[field ' at time ' num2str(transient(steps(i)).time/md.constants.yts) ' a']);
+-
+-	%create plot of step i
+-	subplot(subplotwidth,subplotwidth,i);
+-	plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
+-	applyoptions(md,data,options);
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/subplotmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/subplotmodel.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/subplotmodel.m	(revision 13009)
+@@ -1,35 +0,0 @@
+-function ha=subplotmodel(nlines,ncols,num,options);
+-%SUBPLOTMODEL -  tight subplot that includes margins
+-%
+-%   Usage:
+-%      h=subplotmodel(nlines,ncols,i,options)
+-
+-%Regular subplot
+-if ~exist(options,'tightsubplot')
+-	subplot(nlines,ncols,num);
+-	return;
+-end
+-
+-gap     = getfieldvalue(options,'gap',[.01 .01]);
+-hmargin = getfieldvalue(options,'hmargin',[.01 .01]);
+-vmargin = getfieldvalue(options,'vmargin',[.01 .01]);
+-
+-height = (1-sum(vmargin)-(nlines-1)*gap(1))/nlines; 
+-width  = (1-sum(hmargin)-(ncols-1)*gap(2))/ncols;
+-ymin   = 1-vmargin(2)-height; 
+-
+-for i = 1:nlines
+-	xmin = hmargin(1);
+-	for j = 1:ncols
+-		if(((i-1)*ncols+j)==num)
+-			ha = axes('Units','normalized', ...
+-				'Position',[xmin ymin width height],'XTickLabel','','YTickLabel','','Visible','off');
+-			return
+-		end
+-		xmin = xmin+width+gap(2);
+-	end
+-	ymin = ymin-height-gap(1);
+-end
+-
+-%Activate new axes
+-axes(ha);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/quiver_process.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/quiver_process.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/quiver_process.m	(revision 13009)
+@@ -1,70 +0,0 @@
+-function [quivers,palette]=quiver_process(x,y,u,v,options)
+-%QUIVER_PROCESS - process data for color quiver plot
+-%
+-%   Usage:
+-%      [quivers,palette]=quiver_process(x,y,u,v,options)
+-
+-%keep only non NaN elements
+-pos=find(~isnan(x) & ~isnan(y) & ~isnan(u) & ~isnan(v));
+-x=x(pos); y=y(pos);
+-u=u(pos); v=v(pos);
+-
+-%get Norm Min and Max
+-Norm=sqrt(u.^2+v.^2);
+-Min=min(Norm);
+-Max=max(Norm);
+-
+-%Scale data
+-scalingfactor=getfieldvalue(options,'scaling',0.40);
+-if strcmpi(getfieldvalue(options,'autoscale','on'),'off'),
+-	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
+-	u=scalingfactor*sqrt(delta)*u./Norm;
+-	v=scalingfactor*sqrt(delta)*v./Norm;
+-else
+-	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
+-	u=scalingfactor*sqrt(delta)*u./max(Norm);
+-	v=scalingfactor*sqrt(delta)*v./max(Norm);
+-end
+-
+-%number of colors?
+-colorlevels=getfieldvalue(options,'colorlevels',30);
+-if isnumeric(colorlevels),
+-	if isnan(colorlevels),
+-		numcolors=30;
+-	else
+-		numcolors=colorlevels;
+-	end
+-	levels=round_ice(linspace(Min,Max,numcolors+1),2);
+-else
+-	levels=zeros(1,length(colorlevels)+2);
+-	levels(1)=Min;
+-	for i=1:length(colorlevels)
+-		levels(i+1)=colorlevels{i};
+-	end
+-	levels(end)=Max;
+-	levels=sort(unique(levels));
+-	numcolors=length(levels)-1;
+-end
+-
+-%create colorind for colors
+-colorind=ones(length(u),1);
+-for i=1:numcolors
+-	pos=find((Norm>=levels(i)) & (Norm<=levels(i+1)) );
+-	colorind(pos)=i;
+-end
+-colorind(find(Norm>levels(end)))=numcolors;
+-
+-%build output
+-quivers=struct('x',x,'y',y,'u',u,'v',v,'levels',levels,'colorind',colorind,'numcolors',numcolors);
+-
+-%set the colormap 
+-if numcolors==2;
+-	%blue and red
+-	palette=colormap([0 0 1;1 0 0]);
+-elseif numcolors==3,
+-	%blue yellow and red
+-	palette=colormap([0 0 1;1 1 0;1 0 0]);
+-else
+-	%let jet choose
+-	palette=colormap(jet(numcolors));
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_parthistn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_parthistn.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_parthistn.m	(revision 13009)
+@@ -1,43 +0,0 @@
+-function plot_parthist(md,options,nlines,ncols,i);
+-%PLOT_PARTHIST - plot partitioning histogram
+-%
+-%   Usage:
+-%      plot_parthist(md,options,nlines,ncols,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-%plot mesh
+-subplot(nlines,ncols,i); 
+-
+-imin=min(md.qmu.partition);
+-imax=max(md.qmu.partition);
+-
+-part=zeros(imax-imin+1,2);
+-
+-for i=imin:imax
+-    ind=find(md.qmu.partition == i);
+-    part(i-imin+1,1)=length(ind);
+-	part(i-imin+1,2)=sum(md.vertex_weight(ind));
+-end
+-
+-%subplot(2,1,1)
+-bar(imin:imax,part(:,1));
+-%xlim([imin-0.5 imax+0.5])
+-%title('Number of Nodes in Each Partition')
+-options=addfielddefault(options,'xlim',[imin-0.5 imax+0.5]);
+-options=addfielddefault(options,'title','Number of Nodes in Each Partition');
+-options=addfielddefault(options,'colorbar','off');
+-
+-%subplot(2,1,2)
+-%bar(imin:imax,part(:,2));
+-%xlim([imin-0.5 imax+0.5])
+-%title('Total Weight in Each Partition')
+-%options=addfielddefault(options,'xlim',[imin-0.5 imax+0.5]);
+-%options=addfielddefault(options,'title','Total Weight in Each Partition');
+-%options=addfielddefault(options,'colorbar','off');
+-
+-%apply options
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_highlightvertices.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_highlightvertices.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_highlightvertices.m	(revision 13009)
+@@ -1,46 +0,0 @@
+-function plot_highlightvertices(md,options,width,i);
+-%PLOT_HIGHLIGHTVERTICES - plot selected vertices
+-%
+-%   Usage:
+-%      plot_highlightvertices(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[nodenumbers datatype]=processdata(md,[1:md.mesh.numberofvertices]',options);
+-
+-%plot
+-subplot(width,width,i); 
+-
+-if is2d
+-	%plot mesh 
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3);
+-	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-
+-	%Highlight
+-	pos=getfieldvalue(options,'highlight',[]);
+-	text(x(pos),y(pos),z(pos),num2str(transpose(pos)),...
+-		'backgroundcolor',[1 0 0],'HorizontalAlignment','center','VerticalAlignment','middle');
+-else
+-	%plot mesh 
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-
+-	%Highlight
+-	pos=getfieldvalue(options,'highlight',[]);
+-	text(x(pos),y(pos),z(pos),num2str(transpose(pos)),...
+-		'backgroundcolor',[1 0 0],'HorizontalAlignment','center','VerticalAlignment','middle');
+-end
+-
+-%apply options
+-if ~exist(options,'highlight')
+-	disp('highlightvertices warning : highlight option empty, not node highlighted');
+-end
+-options=addfielddefault(options,'title','Highlighted Nodes');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftrelvel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftrelvel.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftrelvel.m	(revision 13009)
+@@ -1,115 +0,0 @@
+-function plot_riftrelvel(md,options,nlines,ncols,index);
+-%PLOT_RIFTRELVEL - plot rift relative velocities
+-%
+-%   Usage:
+-%      plot_riftrelvel(md,options,nlines,ncols,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%some checks
+-if (length(md.initialization.vx)~=md.mesh.numberofvertices | length(md.initialization.vy)~=md.mesh.numberofvertices),
+-	error('plot_riftvel error message: vx and vy do not have the right size'),
+-end
+-if ~isstruct(md.rifts.riftstruct),
+-	error('plot error message: no rifts available!');
+-end
+-options=addfielddefault(options,'scaling',2);
+-
+-%recover vx and vy:
+-vx=getfieldvalue(options,'riftrelvel_vx',md.initialization.vx);
+-vy=getfieldvalue(options,'riftrelvel_vy',md.initialization.vy);
+-
+-%set as NaN all velocities not on rifts
+-u=NaN*ones(md.mesh.numberofvertices,1);
+-v=NaN*ones(md.mesh.numberofvertices,1);
+-for i=1:size(md.rifts.riftstruct,1),
+-	penaltypairs=md.rifts.riftstruct(i).penaltypairs(:,[1 2]);
+-	u(md.rifts.riftstruct(i).penaltypairs(:,1))=vx(penaltypairs(:,1))-vx(penaltypairs(:,2));
+-	v(md.rifts.riftstruct(i).penaltypairs(:,1))=vy(penaltypairs(:,1))-vy(penaltypairs(:,2));
+-end
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[vel datatype]=processdata(md,[u v],options);
+-[quivers,palette]=quiver_process(x,y,vel(:,1),vel(:,2),options);
+-
+-%prepare plot
+-subplot(nlines,ncols,index); 
+-hold on
+-
+-%plot mesh boundaries
+-for i=1:size(md.mesh.segments,1),
+-	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k-');
+-end
+-
+-%plot rifts vel
+-h3=[];
+-for i=1:quivers.numcolors
+-	pos=find(quivers.colorind==i);
+-	hprime=quiver(quivers.x(pos),quivers.y(pos),quivers.u(pos),quivers.v(pos),...
+-		'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
+-	hprime=quiver(quivers.x(pos),quivers.y(pos),-quivers.u(pos),-quivers.v(pos),...
+-		'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
+-	h3=[h3;hprime];
+-end
+-
+-%plot rift velocities
+-isp1=0;
+-isp2=0;
+-
+-%plot mesh boundaries
+-for i=1:size(md.mesh.segments,1),
+-	h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
+-end
+-for i=1:size(md.rifts.riftstruct,1),
+-	
+-	%get nodes on rift
+-	penaltypairs=md.rifts.riftstruct(i).penaltypairs;
+-
+-	segments=md.rifts.riftstruct(i).segments;
+-	for j=1:size(segments,1),
+-		plot(x(segments(j,1:2)),y(segments(j,1:2)),'k-');
+-	end
+-
+-	normal=zeros(2,1);
+-	for j=1:size(penaltypairs,1),
+-		normal(1)=penaltypairs(j,5);
+-		normal(2)=penaltypairs(j,6);
+-
+-		vx1=vx(penaltypairs(j,1)); vx2=vx(penaltypairs(j,2)); vy1=vy(penaltypairs(j,1)); vy2=vy(penaltypairs(j,2));
+-		penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
+-		%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
+-		if(penetration>0),
+-			p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'*'); set(p2,'Color',[140 140 140]/255);
+-			isp2=1;
+-		else
+-			p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k*');
+-			isp1=1;
+-		end
+-	end
+-
+-	%point out the tips
+-	h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g*');
+-	plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g*');
+-	segments=md.rifts.riftstruct(i).segments(:,1:2);
+-end
+-%legend
+-if strcmpi(getfieldvalue(options,'legend','on'),'on'),
+-	if isp1 & isp2
+-		l=legend([h1,h2,p1,p2],'mesh boundaries','crack tips','faults','rifts');
+-	elseif isp1
+-		l=legend([h1,h2,p1],'mesh boundaries','crack tips','faults');
+-	elseif isp2
+-		l=legend([h1,h2,p2],'mesh boundaries','crack tips','rifts');
+-	else
+-		l=legend([h1,h2],'mesh boundaries','crack tips');
+-	end
+-set(l,'Location',getfieldvalue(options,'legend_location','NorthEast'));
+-end
+-hold off
+-
+-%apply options
+-quiver_colorbar(quivers,options);
+-options=changefieldvalue(options,'colorbar',2);
+-options=addfielddefault(options,'title','Rift/Fault Relative Velocity');
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_sarpwr.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_sarpwr.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_sarpwr.m	(revision 13009)
+@@ -1,26 +0,0 @@
+-function plot_sarpwr(md,options,width,i);
+-%PLOT_SARPWR - plot radar image
+-%
+-%   Usage:
+-%      plot_sarpwr(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%plot mesh sarpwr
+-subplot(width,width,i); 
+-
+-%units
+-if exist(options,'unit'),
+-	unit=getfieldvalue(options,'unit');
+-	md.mesh.x=md.mesh.x*unit;
+-	md.mesh.y=md.mesh.y*unit;
+-	md.mesh.z=md.mesh.z*unit;
+-end
+-					
+-imagesc(md.radaroverlay.x,md.radaroverlay.y,double(md.radaroverlay.pwr)),set(gca,'YDir','normal');colormap(gray);
+-
+-%apply options
+-options=addfielddefault(options,'colorbar',0);
+-options=changefieldvalue(options,'colormap','gray');
+-
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_vertexnumbering.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_vertexnumbering.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_vertexnumbering.m	(revision 13009)
+@@ -1,51 +0,0 @@
+-function plot_vertexnumbering(md,options,width,i);
+-%PLOT_VERTEXNUMBERING - plot vertex numbering
+-%
+-%   Usage:
+-%      plot_vertexnumbering(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[vertexnumbers datatype]=processdata(md,[1:md.mesh.numberofvertices]',options);
+-
+-%plot
+-subplot(width,width,i); 
+-
+-if is2d
+-	%plot mesh 
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3);
+-	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-
+-	%numbering
+-	text(x,y,z,num2str(transpose(1:size(x,1))),...
+-		'backgroundcolor',[0.8 0.9 0.8],'HorizontalAlignment','center','VerticalAlignment','middle');
+-
+-	%Highlight
+-	pos=getfieldvalue(options,'highlight',[]);
+-	text(x(pos),y(pos),z(pos),num2str(transpose(pos)),...
+-		'backgroundcolor',[1 0 0],'HorizontalAlignment','center','VerticalAlignment','middle');
+-else
+-	%plot mesh 
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-
+-	%numbering
+-	text(x,y,z,num2str(transpose(1:size(x,1))),...
+-		'backgroundcolor',[0.8 0.9 0.8],'HorizontalAlignment','center','VerticalAlignment','middle');
+-
+-	%Highlight
+-	pos=getfieldvalue(options,'highlight',[]);
+-	text(x(pos),y(pos),z(pos),num2str(transpose(pos)),...
+-		'backgroundcolor',[1 0 0],'HorizontalAlignment','center','VerticalAlignment','middle');
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Node numbering');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/showregion.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/showregion.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/showregion.m	(revision 13009)
+@@ -1,34 +0,0 @@
+-function showregion(md,insetpos)
+-%SHOWREGION - show region on plot
+-%
+-%   Usage:
+-%      showregion(md,insetpos);
+-
+-%get inset relative position (x,y,width,height)
+-%insetpos=getfieldvalue(options,'insetpos',[0.02 0.70 0.18 0.18]);
+-
+-%get current plos position
+-cplotpos=get(gca,'pos');
+-%compute inset position
+-PosInset=[cplotpos(1)+insetpos(1)*cplotpos(3),cplotpos(2)+insetpos(2)*cplotpos(4), insetpos(3)*cplotpos(3), insetpos(4)*cplotpos(4)];
+-axes('pos',PosInset);
+-axis equal off
+-%box off
+-if strcmpi(md.mesh.hemisphere,'n') | strcmpi(md.mesh.hemisphere,'north'),
+-	A=expread([issmdir() 'projects/Exp/Greenland.exp']);
+-elseif strcmpi(md.mesh.hemisphere,'s') | strcmpi(md.mesh.hemisphere,'south'),
+-	A=expread([issmdir() '/projects/Exp/Antarctica.exp']);
+-else
+-	error('applyoptions error message: hemisphere not defined');
+-end
+-
+-Ax=[min(A.x) max(A.x)];
+-Ay=[min(A.y) max(A.y)];
+-
+-mdx=[min(md.mesh.x) max(md.mesh.x)];
+-mdy=[min(md.mesh.y) max(md.mesh.y)];
+-
+-line(A.x,A.y,'color','b');
+-patch([Ax(1)  Ax(2)  Ax(2)  Ax(1) Ax(1)],[Ay(1)  Ay(1)  Ay(2)  Ay(2) Ay(1)],[1 1 1],'EdgeColor',[0 0 0],'LineWidth',1,'FaceLighting','none')
+-patch( [mdx(1) mdx(2) mdx(2) mdx(1)],[mdy(1) mdy(1) mdy(2) mdy(2)],ones(4,1),'EdgeColor',[0 0 0],'FaceColor','r','FaceAlpha',0.5)
+-colorbar('off');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_boundaries.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_boundaries.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_boundaries.m	(revision 13009)
+@@ -1,39 +0,0 @@
+-function plot_boundaries(md,options,width,i);
+-%PLOT_BOUNDARIES - plot mesh boundaries
+-%
+-%   Usage:
+-%      plot_boundaries(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-subplot(width,width,i); 
+-
+-%process data and model
+-if getfieldvalue(options,'layer',0)
+-	options=removefield(options,'layer',1);
+-end
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-for i=1:size(md.mesh.segments,1),
+-	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');hold on;
+-end
+-
+-%plot rifts if present: 
+-if isstruct(md.rifts.riftstruct),
+-	for i=1:size(md.rifts.riftstruct,1),
+-		segments=md.rifts.riftstruct(i).segments;
+-		for j=1:size(segments,1),
+-			plot(x(segments(j,1:2)),y(segments(j,1:2)),'r.-');
+-		end
+-		text(x(segments(floor(size(segments,1)/4),1)),y(segments(floor(size(segments,1)/4),1)),['Rift #' num2str(i)]);
+-		%point out the tips
+-		plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'b*');
+-		plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'b*');
+-	end
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Mesh boundaries');
+-options=addfielddefault(options,'colorbar',0);
+-options=addfielddefault(options,'view',2);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_mesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_mesh.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_mesh.m	(revision 13009)
+@@ -1,41 +0,0 @@
+-function plot_mesh(md,options,nlines,ncols,i);
+-%PLOT_MESH - plot model mesh
+-%
+-%   Usage:
+-%      plot_mesh(md,options,nlines,ncols,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-%plot mesh
+-subplot(nlines,ncols,i); 
+-
+-%retrieve some options
+-linewidth=getfieldvalue(options,'linewidth',1);
+-edgecolor=getfieldvalue(options,'edgecolor','black');
+-
+-%plot mesh
+-if is2d
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
+-else
+-	if ~isplanet,
+-		A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-		patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
+-		patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
+-		patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
+-		patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
+-		patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
+-	else
+-		A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-		if (size(elements,2)==4), D=elements(:,4); else D=C; end
+-		patch( 'Faces', [A B C D],  'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
+-	end
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Mesh');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_quiver3.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_quiver3.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_quiver3.m	(revision 13009)
+@@ -1,104 +0,0 @@
+-function plot_quiver3(x,y,z,u,v,w,options),
+-%PLOT_QUIVER3 - 3d quiver plot with colors
+-%
+-%   to be perfected tomorrow
+-%
+-%   Usage:
+-%      plot_quiver3(x,y,z,u,v,w,options)
+-%
+-%   Example:
+-%      plot_quiver(md.mesh.x,md.mesh.y,md.mesh.z,md.initialization.vx,md.initialization.vy,md.initialization.vz,options);
+-
+-%keep only non NaN elements
+-pos=find(~isnan(x) & ~isnan(y) & ~isnan(z) & ~isnan(u) & ~isnan(v) & ~isnan(w));
+-x=x(pos); y=y(pos); z=z(pos);
+-u=u(pos); v=v(pos); w=w(pos);
+-
+-%get norm Min and Max
+-Norm=sqrt(u.^2+v.^2+w.^2);
+-Min=min(Norm);
+-Max=max(Norm);
+-
+-%process options: scaling factor?
+-scalingfactor=getfieldvalue(options,'scaling',0.40);
+-
+-%number of colors?
+-colorlevels=getfieldvalue(options,'colorlevels',NaN);
+-if isnumeric(colorlevels),
+-	if isnan(colorlevels),
+-		numcolors=30;
+-	else
+-		numcolors=colorlevels;
+-	end
+-	levels=round_ice(linspace(Min,Max,numcolors+1),2);
+-else
+-	levels=zeros(1,length(colorlevels)+2);
+-	levels(1)=Min;
+-	for i=1:length(colorlevels)
+-		levels(i+1)=colorlevels{i};
+-	end
+-	levels(end)=Max;
+-	levels=sort(unique(levels));
+-	numcolors=length(levels)-1;
+-end
+-
+-%set the colormap 
+-if numcolors==2;
+-	%blue and red
+-	c=[0 0 1;1 0 0];
+-elseif numcolors==3,
+-	%blue yellow and red
+-	c=[0 0 1;1 1 0;1 0 0];
+-else
+-	%let jet choose
+-	c=colormap(jet(numcolors));
+-end
+-
+-%Scale data
+-if strcmpi(getfieldvalue(options,'autoscale','on'),'off'),
+-	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
+-	u=scalingfactor*sqrt(delta)*u./Norm;
+-	v=scalingfactor*sqrt(delta)*v./Norm;
+-else
+-	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
+-	u=scalingfactor*sqrt(delta)*u./max(Norm);
+-	v=scalingfactor*sqrt(delta)*v./max(Norm);
+-end
+-
+-%loop over the number of colors
+-hold on
+-h=[];
+-for i=1:numcolors
+-	pos=find( (Norm>=levels(i)) & (Norm<=levels(i+1)) );
+-	hprime=quiver3(x(pos),y(pos),z(pos),u(pos),v(pos),w(pos),'Color',c(i,:),'ShowArrowHead','on','AutoScale','off');
+-	h=[h;hprime];
+-end
+-
+-%take care of colorbar
+-if  ~strcmpi(getfieldvalue(options,'colorbar','on'),'off'),
+-
+-	%build ticks
+-	hcb=colorbar('peer',gca,'location','EastOutside');
+-	ticklabel=cell(1,length(levels));
+-	for i=1:length(levels),
+-		ticklabel{i}=num2str(round_ice(levels(i),3));
+-	end
+-	tickpos=1:numcolors+1;
+-
+-	%remove ticks if to many have been created
+-	proportion=round(length(levels)/10);
+-	if proportion>1,
+-		ticklabel=ticklabel(1:proportion:end);
+-		tickpos=tickpos(1:proportion:end);
+-	end
+-
+-	%draw colorbar
+-	set(hcb,'YTickLabel',ticklabel,'YTick',tickpos);
+-	%position
+-	if exist(options,'colorbarpos'),
+-		set(hcb,'Position',getfieldvalue(options,'colorbarpos'));
+-	end
+-	%fontsize
+-	fontsize=getfieldvalue(options,'fontsize',14);
+-	set(hcb,'FontSize',fontsize);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_none.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_none.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_none.m	(revision 13009)
+@@ -1,20 +0,0 @@
+-function plot_none(md,options,nlines,ncols,i);
+-%PLOT_NONE - plot nothing, just apply options
+-%
+-%   Usage:
+-%      plot_mesh(md,options,nlines,ncols,i);
+-%
+-%   See also: PLOTMODEL
+-return;
+-
+-options=addfielddefault(options,'colorbar','none');
+-options=addfielddefault(options,'map','none');
+-options=addfielddefault(options,'axis','equal');
+-
+-if exist(options,'overlay'),
+-	plot_overlay(md,'none',options,nlines,ncols,i);
+-	return;
+-end
+-
+-%apply options
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_elementnumbering.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_elementnumbering.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_elementnumbering.m	(revision 13009)
+@@ -1,57 +0,0 @@
+-function plot_elementnumbering(md,options,width,i);
+-%PLOT_ELEMENTNUMBERING - plot element numbering
+-%
+-%   Usage:
+-%      plot_elementnumbering(md,options,width,i);
+-%
+-%   See also: PLOTMODEL, PLOT_UNIT, PLOT_MANAGER
+-
+-subplot(width,width,i); 
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[elementnumbers datatype]=processdata(md,[1:md.mesh.numberofelements]',options);
+-
+-%plot
+-if is2d
+-	%plot mesh 
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3);
+-	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-
+-	%highlight
+-	pos=getfieldvalue(options,'highlight',[]);
+-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
+-	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+-
+-	%numbering
+-	text(sum(x(elements(:,1:3)),2)/3,sum(y(elements(:,1:3)),2)/3,sum(z(elements(:,1:3)),2)/3,...
+-		num2str(transpose(1:size(elements,1))),...
+-		'HorizontalAlignment','center','VerticalAlignment','middle');
+-else
+-	%plot mesh 
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-
+-	%highlight
+-	pos=getfieldvalue(options,'highlight',[]);
+-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
+-	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','none','EdgeColor','black');
+-
+-	%numbering
+-	text(sum(x(elements(:,1:6)),2)/6,sum(y(elements(:,1:6)),2)/6,sum(z(elements(:,1:6)),2)/6,...
+-		num2str(transpose(1:size(elements,1))),...
+-		'HorizontalAlignment','center','VerticalAlignment','middle');
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Element numbering');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor_principalaxis.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor_principalaxis.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor_principalaxis.m	(revision 13009)
+@@ -1,95 +0,0 @@
+-function plot_tensor_principalaxis(md,options,width,i,tensor,type,plot_options);
+-%PLOT_TENSOR_PRINCIPALAXIS - plot ytensor principal axis
+-%
+-%   Usage:
+-%      plot_tensor_principalaxis(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%prepare subplot
+-subplot(width,width,i); 
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-if ((md.mesh.dimension==2)),
+-	eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2);'])
+-	eval(['value=tensor.principalvalue' type(end) ';']);
+-	[Vx datatype]=processdata(md,Vx,options);
+-	[Vy datatype]=processdata(md,Vy,options);
+-	[value datatype]=processdata(md,value,options);
+-else
+-	eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2); Vz=tensor.principalaxis' type(end) '(:,3);'])
+-	[Vx datatype]=processdata(md,Vx,options);
+-	[Vy datatype]=processdata(md,Vy,options);
+-	[Vz datatype]=processdata(md,Vz,options);
+-	[value datatype]=processdata(md,value,options);
+-end
+-
+-%take the center of each element if ~isonnode
+-if datatype==1,
+-	x=mean(md.mesh.x(md.mesh.elements'))'; y=mean(md.mesh.y(md.mesh.elements'))'; z=mean(md.mesh.z(md.mesh.elements'))';
+-end
+-
+-%plot quivers
+-if (md.mesh.dimension==2),
+-
+-	%density
+-	if exist(options,'density')
+-		density=getfieldvalue(options,'density');
+-		x=x(1:density:end);
+-		y=y(1:density:end);
+-		Vx=Vx(1:density:end);
+-		Vy=Vy(1:density:end);
+-		value=value(1:density:end);
+-	end
+-
+-	%scaling:
+-	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
+-	scale=0.5/max(sqrt((Vx.^2+Vy.^2)/delta));
+-	Vx=scale*Vx; Vy=scale*Vy;
+-
+-	pos=find(value>=0);
+-	q1=quiver(x(pos),y(pos),Vx(pos),Vy(pos),'Color','r','ShowArrowHead','off','AutoScale','off');
+-	hold on
+-	pos=find(value<0);
+-	q2=quiver(x(pos),y(pos),Vx(pos),Vy(pos),'Color','b','ShowArrowHead','off','AutoScale','off');
+-
+-else
+-	%density
+-	if exist(options,'density')
+-		density=getfieldvalue(options,'density');
+-		x=x(1:density:end);
+-		y=y(1:density:end);
+-		z=z(1:density:end);
+-		Vx=Vx(1:density:end);
+-		Vy=Vy(1:density:end);
+-		Vz=Vz(1:density:end);
+-		value=value(1:density:end);
+-	end
+-
+-	%scaling:
+-	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
+-	scale=0.5/max(sqrt((Vx.^2+Vy.^2)/delta));
+-	Vx=scale*Vx; Vy=scale*Vy; Vz=scale*Vz;
+-
+-	pos=find(value>=0);
+-	q1=quiver3(x(pos),y(pos),z(pos),Vx(pos),Vy(pos),Vz(pos),'Color','r','ShowArrowHead','off','AutoScale','off');
+-	hold on
+-	pos=find(value<0);
+-	q2=quiver3(x(pos),y(pos),z(pos),Vx(pos),Vy(pos),Vz(pos),'Color','b','ShowArrowHead','off','AutoScale','off');
+-end
+-
+-%legend
+-if strcmpi(type(1:6),'strain')
+-	legend([q1 q2],'extension','compression')
+-elseif strcmpi(type(1:6),'stress')
+-	legend([q1 q2],'compression','traction')
+-end
+-
+-%apply options
+-strings=strsplit(type,'_');
+-string=strings{1};
+-options=addfielddefault(options,'title',[upper(string(1)) string(2:end) ' principal axis ' type(end)]);
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plotmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plotmodel.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plotmodel.m	(revision 13009)
+@@ -1,57 +0,0 @@
+-function plotmodel(md,varargin)
+-%At command prompt, type plotdoc for help on documentation.
+-
+-%First process options
+-options=plotoptions(varargin{:});
+-
+-%get number of subplots
+-subplotwidth=ceil(sqrt(options.numberofplots));
+-
+-%if nlines and ncols specified, then bypass.
+-if exist(options.list{1},'nlines'),
+-	nlines=getfieldvalue(options.list{1},'nlines');
+-else 
+-	nlines=subplotwidth;
+-end
+-
+-if exist(options.list{1},'ncols'),
+-	ncols=getfieldvalue(options.list{1},'ncols');
+-else 
+-	ncols=subplotwidth;
+-end
+-
+-%check that nlines and ncols were given at the same time!
+-if ((exist(options.list{1},'ncols') & ~exist(options.list{1},'ncols')) | (~exist(options.list{1},'ncols') & exist(options.list{1},'ncols')))
+-	error('plotmodel error message: nlines and ncols  need to be specified together, or not at all');
+-end
+-
+-%Get figure number and number of plots
+-figurenumber=options.figurenumber;
+-numberofplots=options.numberofplots;
+-
+-%go through subplots
+-if numberofplots,
+-		
+-	%Create figure 
+-	if strcmpi(getfieldvalue(options.list{1},'visible','on'),'off'),
+-		F=figure(figurenumber);clf;
+-		set(F,'Visible','Off');
+-	else
+-		figure(figurenumber);clf;
+-	end
+-
+-	%Use zbuffer renderer (snoother colors)
+-	set(gcf,'Renderer','zbuffer');
+-
+-	%Go through all data plottable and close window if an error occurs
+-	try,
+-		for i=1:numberofplots,
+-			plot_manager(getfieldvalue(options.list{i},'model',md),options.list{i},subplotwidth,nlines,ncols,i);
+-		end
+-	catch me,
+-		%figure(figurenumber),close;
+-		rethrow(me);
+-	end
+-else
+-	error('plotmodel error message: no output data found. ');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_gridded.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_gridded.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_gridded.m	(revision 13009)
+@@ -1,64 +0,0 @@
+-function plot_gridded(md,data,options,plotlines,plotcols,i)
+-%PLOT_OVERLAY - superimpose radar image to a given field
+-%
+-%   Usage:
+-%      plot_gridded(md,options,plotlines,plotcols,i)
+-%
+-%   See also: PLOTMODEL
+-
+-%process mesh and data
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[data datatype]=processdata(md,data,options);
+-
+-%check is2d
+-if ~is2d, 
+-	error('buildgridded error message: gridded not supported for 3d meshes, project on a layer');
+-end
+-
+-%Get xlim and ylim (used to extract radar image)
+-xlim=getfieldvalue(options,'xlim',[min(x) max(x)]);
+-ylim=getfieldvalue(options,'ylim',[min(y) max(y)]);
+-post=getfieldvalue(options,'posting',diff(xlim)/1000);
+-
+-%Interpolating data on grid
+-[x_m y_m data_grid]=InterpFromMeshToGrid(elements,x,y,data,xlim(1),ylim(2),post,post,round(diff(ylim)/post),round(diff(xlim)/post),NaN);
+-if size(data_grid,1)<3 | size(data_grid,2)<3,
+-	error('data_grid size too small in plot_gridded, check posting and uni');
+-end
+-
+-%Get and change colormap
+-map    = getcolormap(options);
+-lenmap = size(map,1);
+-map    = [1 1 1; map];
+-options=changefieldvalue(options,'colormap',map);
+-
+-%Process data_grid: add white in NaN and correct caxis accordingly
+-if exist(options,'caxis'),
+-	caxis_opt=getfieldvalue(options,'caxis');
+-	data_grid(find(data_grid<caxis_opt(1)))=caxis_opt(1);
+-	data_grid(find(data_grid>caxis_opt(2)))=caxis_opt(2);
+-	data_min=caxis_opt(1);
+-	data_max=caxis_opt(2);
+-else
+-	data_min=min(data_grid(:));
+-	data_max=max(data_grid(:));
+-end
+-options = changefieldvalue(options,'cbYLim',[data_min data_max]);
+-white   = data_min - (data_max-data_min)/(lenmap);
+-options = changefieldvalue(options,'caxis',[white data_max]);
+-data_grid(isnan(data_grid))=white;
+-
+-%Select plot area 
+-subplotmodel(plotlines,plotcols,i,options);
+-
+-%shading interp;
+-h=imagesc(xlim,ylim,data_grid);set(gca,'YDir','normal');
+-
+-%last step: mesh gridded?
+-if exist(options,'edgecolor'),
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-	patch('Faces',[A B C],'Vertices', [x y z],'FaceVertexCData',data_grid(1)*ones(size(x)),'FaceColor','none','EdgeColor',getfieldvalue(options,'edgecolor'));
+-end
+-
+-%Apply options
+-applyoptions(md,data,options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_section.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_section.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_section.m	(revision 13009)
+@@ -1,210 +0,0 @@
+-function plot_section(md,data,options,nlines,ncols,i)
+-%PLOT_SECTION - plot a given field on a section
+-%
+-%   Usage:
+-%      plot_section(md,data,options,nlines,ncols,i)
+-%
+-%   See also: PLOTMODEL
+-
+-%How many subplots?
+-if exist(options,'showsection')
+-
+-	%Compute the indexes of the 2 plots (one for the sectionvalue and one for showsection
+-	upperplots=floor((i-1)/ncols);
+-	if upperplots==0, leftplots=i-1; else leftplots=i-ncols*upperplots-1; end
+-	index1=4*ncols*upperplots+2*leftplots+1;
+-	index2=index1+1;
+-	ncols=2*ncols;
+-else
+-	index1=i;
+-end
+-
+-%process model
+-[x_m y_m z_m elements_m is2d isplanet]=processmesh(md,[],options);
+-
+-%Get number of curves and generate random colors
+-numcurves=size(data,2);
+-colorm=getfieldvalue(options,'colormap','lines');
+-color=eval([ colorm '(numcurves);']);
+-options=removefield(options,'colormap',0); %back to default colormap
+-
+-%replug x and y onto model so that SectionValue treats the problem correctly
+-md3d=md;
+-if exist(options,'layer')
+-	md.mesh.x=md.mesh.x2d; md.mesh.y=md.mesh.y2d; md.mesh.elements=md.mesh.elements2d; md.mesh.dimension=2;
+-end
+-
+-%read contours: 
+-profiles=expread(getfieldvalue(options,'sectionvalue'));
+-numprofiles=length(profiles);
+-
+-%Loop over number of profiles: 
+-for profile_i=1:numprofiles,
+-	profile=profiles(profile_i);
+-
+-	%Loop over number of curves
+-	for i=1:numcurves,
+-
+-		[datai datatype]=processdata(md3d,data(:,i),options);
+-
+-		%resolution
+-		if exist(options,'resolution'),
+-			resolution=getfieldvalue(options,'resolution');
+-		else %Default resolution
+-			resolution=[1000 10*md.mesh.numberoflayers];
+-			disp(['plot_section warning: no resolution specified, use default resolution: [horizontal_resolution vertical_resolution]=[' num2str(resolution)  ']']);
+-		end
+-
+-		%Compute section value
+-		[elements,x,y,z,s,data_s]=SectionValues(md,datai,profile,resolution);
+-
+-		%units
+-		if exist(options,'unit'),
+-			unit=getfieldvalue(options,'unit');
+-			x=x*unit;
+-			y=y*unit;
+-			z=z*unit;
+-			s=s*unit;
+-		end
+-
+-		%2D
+-		if is2d,
+-%		%plot section value
+-%		hold on;
+-%		subplot(nlines,ncols,index1)
+-%		%subplot(1,3,[2 3])
+-%		plot(s,data_s,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1))
+-%		%3D
+-%	else
+-%		%plot section value
+-%		%if user requested view2: 2d plot with curvilinear coordinate
+-%		if (getfieldvalue(options,'view',3)==2 )
+-
+-			%Show Section if requested by user
+-			if exist(options,'showsection')
+-
+-				%compute number of labels
+-				numlabels=min(getfieldvalue(options,'showsection'),length(s));
+-				shift=fix(length(s)/numlabels);
+-
+-				%plot labels on current graph
+-				hold on
+-				text(s(1),data_s(1),'1','backgroundcolor',[0.8 0.9 0.8])
+-				for i=2:numlabels-1
+-					text(s(1+(i-1)*shift),data_s(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
+-				end
+-				text(s(end),data_s(end),'end','backgroundcolor',[0.8 0.9 0.8])
+-
+-				%plot section only with labels
+-				subplot(nlines,ncols,index2)
+-				plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,isplanet,datatype,options)
+-				hold on
+-				text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8])
+-				for i=2:numlabels-1
+-					text(x(1+(i-1)*shift),y(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
+-				end
+-				text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8])
+-				plot(x,y,'-r')
+-				axis([min(md.mesh.x)-1 max(md.mesh.x)+1 min(md.mesh.y)-1 max(md.mesh.y)+1])
+-				view(2)
+-			end
+-
+-			%plot section value
+-			if(i==1), subplot(nlines,ncols,index1); end
+-			plot(s,data_s,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1))
+-			hold on
+-
+-
+-			%3D
+-		else
+-			%plot section value
+-			%if user requested view2: 2d plot with curvilinear coordinate
+-			if (getfieldvalue(options,'view',3)==2 )
+-
+-				%Show Section if requested by user
+-				if exist(options,'showsection')
+-
+-					%compute number of labels
+-					numlabels=min(getfieldvalue(options,'showsection'),length(s));
+-					shift=fix(length(s)/numlabels);
+-
+-					%plot labels on current graph
+-					hold on
+-					text(s(1),z(1),'1','backgroundcolor',[0.8 0.9 0.8])
+-					for i=2:numlabels-1
+-						text(s(1+(i-1)*shift),z(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
+-					end
+-					text(s(end),z(end),'end','backgroundcolor',[0.8 0.9 0.8])
+-
+-					%plot section only with labels
+-					subplot(nlines,ncols,index2)
+-					plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,datatype,options)
+-					hold on
+-					text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8])
+-					for i=2:numlabels-1
+-						text(x(1+(i-1)*shift),y(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
+-					end
+-					text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8])
+-					plot(x,y,'-r')
+-					axis([min(md.mesh.x)-1 max(md.mesh.x)+1 min(md.mesh.y)-1 max(md.mesh.y)+1])
+-					view(2)
+-				end
+-
+-				subplot(nlines,ncols,index1)
+-				A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4); 
+-				patch( 'Faces', [A B C D], 'Vertices', [s z zeros(length(s),1)],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none');
+-
+-			else
+-
+-				%Show Section if requested by user
+-				if exist(options,'showsection')
+-
+-					%compute number of labels
+-					numlabels=min(getfieldvalue(options,'showsection'),length(s));
+-					shift=fix(length(x)/numlabels);
+-
+-					%plot labels on current graph
+-					hold on
+-					text(x(1),y(1),z(1),'1','backgroundcolor',[0.8 0.9 0.8])
+-					for i=2:numlabels-1
+-						text(x(1+(i-1)*shift),y(1+(i-1)*shift),z(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
+-					end
+-					text(x(end),y(end),z(end),'end','backgroundcolor',[0.8 0.9 0.8])
+-
+-					%plot section only with labels
+-					subplot(nlines,ncols,index2)
+-					plot_unit(x_m,y_m,z_m,elements_m,data,is2d,datatype,options)
+-					hold on
+-					text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8])
+-					for i=2:numlabels-1
+-						text(x(1+(i-1)*shift),y(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
+-					end
+-					text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8])
+-					plot(x,y,'-r')
+-					axis([min(md.mesh.x)-1 max(md.mesh.x)+1 min(md.mesh.y)-1 max(md.mesh.y)+1])
+-					view(2)
+-				end
+-
+-				subplot(nlines,ncols,index1)
+-				A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4); 
+-				patch( 'Faces', [A B C D], 'Vertices', [x y z],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none');
+-				view(3)
+-
+-			end
+-		end
+-	end
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Section value');
+-if (md.mesh.dimension==2)
+-	options=addfielddefault(options,'colorbar',0);
+-end
+-if ((md.mesh.dimension==2) | getfieldvalue(options,'view')==2 )
+-	options=addfielddefault(options,'xlabel','Curvilinear coordinate');
+-	options=addfielddefault(options,'axis','auto');
+-end
+-if (md.mesh.dimension==3 & getfieldvalue(options,'view')==2 )
+-	options=addfielddefault(options,'ylabel','z');
+-end
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_scatter.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_scatter.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_scatter.m	(revision 13009)
+@@ -1,74 +0,0 @@
+-function plot_scatter(x,y,mksize,level),
+-
+-%check input
+-if numel(x)~=numel(y) | numel(x)~=numel(level),
+-	error('x, y and data should have the same size');
+-end
+-
+-%Some processing
+-Min=min(level);
+-Max=max(level);
+-Siz=length(level);
+-nlab=10;
+-
+-%OK, should we create a new colorbar for the occasion?
+-if isempty(findobj(gcf,'tag','TMW_COLORBAR')),
+-	alreadyplot=false;
+-else
+-	alreadyplot=true;
+-end
+-
+-%generate levels
+-if (alreadyplot),
+-	phch = get(findall(gcf,'type','image','tag','TMW_COLORBAR'),{'parent'});
+-	h    = phch{1};
+-	ylim=get(h,'YLim');
+-	palette=colormap;
+-	numcolors=size(palette,1);
+-	levels=round_ice(linspace(ylim(1),ylim(2),numcolors+1),2);
+-else
+-	numcolors=30;
+-	levels=round_ice(linspace(Min,Max,numcolors+1),2);
+-	palette=colormap(jet(numcolors));
+-end
+-
+-colorind=ones(Siz,1);
+-for i=1:numcolors
+-	pos=find((level>=levels(i)) & (level<=levels(i+1)) );
+-	colorind(pos)=i;
+-end
+-colorind(find(level>levels(end)))=numcolors;
+-
+-%loop over the number of colors
+-hold on
+-hp=[];
+-for i=1:numcolors
+-	pos=find(colorind==i);
+-	hprime=plot(x(pos),y(pos),...
+-		'o','MarkerSize',mksize,'MarkerEdgeColor',palette(i,:),...
+-		'MarkerFaceColor',palette(i,:));
+-	hp=[hp;hprime];
+-end
+-
+-if ~alreadyplot,
+-	% format the colorbar
+-	h    = colorbar;
+-	nlab = abs(nlab);                       % number of labels must be positive
+-	set(h,'YLim',[1 numcolors]);                  % set colorbar limits
+-	set(h,'YTick',linspace(1,numcolors,nlab));    % set tick mark locations
+-
+-	labels = cell(1,nlab);
+-	tick_vals = linspace(Min,Max,nlab);
+-	warning off MATLAB:log:logOfZero;
+-	for i = 1:nlab
+-		if min(log10(abs(tick_vals))) <= 3, fm = '%-4.0f';   % fixed
+-		else                                fm = '%-4.0E';   % floating
+-		end
+-		labels{i} = sprintf(fm,tick_vals(i));
+-	end
+-	warning on MATLAB:log:logOfZero;
+-
+-	% set tick label strings
+-	set(h,'YTickLabel',labels);
+-	%colorbar %one last time required sometimes
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_manager.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_manager.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_manager.m	(revision 13009)
+@@ -1,204 +0,0 @@
+-function plot_manager(md,options,subplotwidth,nlines,ncols,i);
+-%PLOT__MANAGER - distribute the plots, called by plotmodel
+-%
+-%   Usage:
+-%      plot_manager(md,options,subplotwidth,i);
+-%
+-%   See also: PLOTMODEL, PLOT_UNIT
+-
+-%parse options and get a structure of options. 
+-options=checkplotoptions(md,options);
+-
+-%get data to be displayed
+-data=getfieldvalue(options,'data');
+-
+-%figure out if this is a special plot
+-if ischar(data),
+-
+-	switch data,
+-
+-		case 'boundaries',
+-			plot_boundaries(md,options,subplotwidth,i);
+-			return;
+-		case 'BC',
+-			plot_BC(md,options,subplotwidth,i,data);
+-			return;
+-		case 'edges'
+-			plot_edges(md,options,subplotwidth,i,data)
+-			return
+-		case 'elementnumbering',
+-			plot_elementnumbering(md,options,subplotwidth,i);
+-			return;
+-		case 'highlightelements',
+-			plot_highlightelements(md,options,subplotwidth,i);
+-			return;
+-		
+-		case 'qmumean',
+-			plot_qmumean(md,options,nlines,ncols,i);
+-			return;
+-		
+-		case 'qmustddev',
+-			plot_qmustddev(md,options,nlines,ncols,i);
+-			return;
+-		
+-		case 'qmuhistnorm',
+-			plot_qmuhistnorm(md,options,nlines,ncols,i);
+-			return;
+-
+-		case 'qmu_mass_flux_segments',
+-			plot_qmu_mass_flux_segments(md,options,nlines,ncols,i);
+-			return;
+-
+-		case 'part_hist',
+-			plot_parthist(md,options,nlines,ncols,i);
+-			return;
+-		case 'part_hist_n',
+-			plot_parthistn(md,options,nlines,ncols,i);
+-			return;
+-		case 'part_hist_w',
+-			plot_parthistw(md,options,nlines,ncols,i);
+-			return;
+-		case 'elements_type',
+-			plot_elementstype(md,options,subplotwidth,i);
+-			return;
+-		case 'vertexnumbering',
+-			plot_vertexnumbering(md,options,subplotwidth,i);
+-			return;
+-		case 'highlightvertices',
+-			plot_highlightvertices(md,options,subplotwidth,i);
+-			return;
+-		case {'basal_drag','basal_dragx','basal_dragy'},
+-			plot_basaldrag(md,options,subplotwidth,i,data);
+-			return;
+-		case 'driving_stress',
+-			plot_drivingstress(md,options,subplotwidth,i);
+-			return;
+-		case 'mesh',
+-			plot_mesh(md,options,nlines,ncols,i);
+-			return;
+-		case 'none',
+-			if ~exist(options,'overlay'),
+-				plot_none(md,options,nlines,ncols,i);
+-				return;
+-			end
+-		case 'penalties',
+-			plot_penalties(md,options,subplotwidth,i);
+-			return;
+-		case 'partition',
+-			plot_partition(md,options,nlines,ncols,i);
+-			return;
+-		case 'referential',
+-			plot_referential(md,options,nlines,ncols,i);
+-			return;
+-		case 'riftvel',
+-			plot_riftvel(md,options,nlines,ncols,i);
+-			return;
+-		case 'riftnumbering',
+-			plot_riftnumbering(md,options,nlines,ncols,i);
+-			return;
+-		case 'rifts',
+-			plot_rifts(md,options,nlines,ncols,i);
+-			return;
+-		case 'riftrelvel',
+-			plot_riftrelvel(md,options,nlines,ncols,i);
+-			return;
+-		case 'riftpenetration',
+-			plot_riftpenetration(md,options,nlines,ncols,i);
+-			return;
+-		case 'riftfraction',
+-			plot_riftfraction(md,options,nlines,ncols,i);
+-			return;
+-		case 'sarpwr',
+-			plot_sarpwr(md,options,subplotwidth,i)
+-			return
+-		case 'icefront'
+-			plot_icefront(md,options,subplotwidth,i,data)
+-			return
+-		case 'segments'
+-			plot_segments(md,options,subplotwidth,i,data)
+-			return
+-		
+-		case 'quiver'
+-			data=[md.initialization.vx md.initialization.vy]; %Go ahead and try plot_unit
+-
+-		case {'strainrate_tensor','strainrate','strainrate_principal','strainrate_principalaxis1','strainrate_principalaxis2','strainrate_principalaxis3',...
+-				'stress_tensor','stress','stress_principal','stress_principalaxis1','stress_principalaxis2','stress_principalaxis3',...
+-				'deviatoricstress_tensor','deviatoricstress','deviatoricstress_principal','deviatoricstress_principalaxis1','deviatoricstress_principalaxis2','deviatoricstress_principalaxis3'},
+-			plot_tensor(md,options,subplotwidth,i,data);
+-			return;
+-		case 'thermaltransient_results',
+-			plot_thermaltransient_results(md,options,subplotwidth,i);
+-			return;
+-		case 'transient_movie',
+-			plot_transient_movie(md,options,subplotwidth,i);
+-			return;
+-		case 'transient_results',
+-			plot_transient_results(md,options,subplotwidth,i);
+-
+-		case 'transient_field',
+-			plot_transient_field(md,options,subplotwidth,i);
+-			return;
+-
+-	otherwise,
+-
+-		if ismember(data,properties('model')),
+-			data=eval(['md.' data ';']);
+-		else
+-			error('plot error message: data provided not supported yet. Type plotdoc for help');
+-		end
+-	end
+-end
+-
+-%Figure out if this is a semi-transparent plot.
+-if exist(options,'overlay'),
+-	plot_overlay(md,data,options,nlines,ncols,i);
+-	return;
+-end
+-
+-%Figure out if this is a semi-transparent plot.
+-if exist(options,'gridded'),
+-	plot_gridded(md,data,options,nlines,ncols,i);
+-	return;
+-end
+-
+-%Figure out if this is a Section plot
+-if exist(options,'sectionvalue')
+-	plot_section(md,data,options,nlines,ncols,i);
+-	return;
+-end
+-
+-%Figure out if this is a Profile plot
+-if exist(options,'profile')
+-	plot_profile(md,data,options,nlines,ncols,i);
+-	return;
+-end
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,data,options);
+-[data2 datatype]=processdata(md,data,options);
+-
+-%standard plot:
+-subplot(nlines,ncols,i);
+-
+-%plot unit
+-plot_unit(x,y,z,elements,data2,is2d,isplanet,datatype,options);
+-
+-%apply all options
+-if datatype==3,
+-	options=changefieldvalue(options,'colorbar',2);
+-	if exist(options,'contourlevels'),
+-		data2=data;
+-	end
+-end
+-
+-applyoptions(md,data2,options);
+-
+-%do ground overlay on kml plot_unit? 
+-if (strcmpi(getfieldvalue(options,'kmlgroundoverlay','off'),'on')),
+-	if ((nlines*ncols~=1) | (i~=1)),
+-		error('cannot kmlgroundoverlay on multi-plots');
+-	end
+-	
+-	%call routine to build kml file and image that goes with it.
+-	kmlgroundoverlay(md,options);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftvel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftvel.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftvel.m	(revision 13009)
+@@ -1,108 +0,0 @@
+-function plot_riftvel(md,options,nlines,ncols,index);
+-%PLOT_RIFTVEL - plot rift velocity
+-%
+-%   Usage:
+-%      plot_riftvel(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%some checks
+-if (length(md.initialization.vx)~=md.mesh.numberofvertices | length(md.initialization.vy)~=md.mesh.numberofvertices),
+-	error('plot_riftvel error message: vx and vy do not have the right size'),
+-end
+-if ~isstruct(md.rifts.riftstruct),
+-	error('plot error message: no rifts available!');
+-end
+-options=addfielddefault(options,'scaling',2);
+-
+-%set as NaN all velocities not on rifts
+-u=NaN*ones(md.mesh.numberofvertices,1);
+-v=NaN*ones(md.mesh.numberofvertices,1);
+-for i=1:size(md.rifts.riftstruct,1),
+-	penaltypairs=md.rifts.riftstruct(i).penaltypairs(:,[1 2]);
+-	u(penaltypairs(:))=md.initialization.vx(penaltypairs(:));
+-	v(penaltypairs(:))=md.initialization.vy(penaltypairs(:));
+-end
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[vel datatype]=processdata(md,[u v],options);
+-[quivers,palette]=quiver_process(x,y,vel(:,1),vel(:,2),options);
+-
+-%prepare plot
+-subplot(nlines,ncols,index); 
+-hold on
+-
+-%plot mesh boundaries
+-for i=1:size(md.mesh.segments,1),
+-	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');
+-end
+-
+-%plot rifts vel
+-h3=[];
+-for i=1:quivers.numcolors
+-	pos=find(quivers.colorind==i);
+-	hprime=quiver(quivers.x(pos),quivers.y(pos),quivers.u(pos),quivers.v(pos),...
+-		'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
+-	h3=[h3;hprime];
+-end
+-
+-%plot rift velocities
+-isp1=0;
+-isp2=0;
+-
+-%plot mesh boundaries
+-for i=1:size(md.mesh.segments,1),
+-	h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
+-end
+-
+-for i=1:size(md.rifts.riftstruct,1),
+-	%get nodes on rift
+-	penaltypairs=md.rifts.riftstruct(i).penaltypairs;
+-
+-	segments=md.rifts.riftstruct(i).segments;
+-	for j=1:size(segments,1),
+-		plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
+-	end
+-
+-	normal=zeros(2,1);
+-	for j=1:size(penaltypairs,1),
+-		normal(1)=penaltypairs(j,5);
+-		normal(2)=penaltypairs(j,6);
+-
+-		vx1=md.initialization.vx(penaltypairs(j,1)); vx2=md.initialization.vx(penaltypairs(j,2)); vy1=md.initialization.vy(penaltypairs(j,1)); vy2=md.initialization.vy(penaltypairs(j,2));
+-		penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
+-		%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
+-		if(penetration>0),
+-			p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'*'); set(p2,'Color',[140 140 140]/255);
+-			isp2=1;
+-		else
+-			p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k*');
+-			isp1=1;
+-		end
+-	end
+-
+-	%point out the tips
+-	h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g*');
+-	plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g*');
+-	segments=md.rifts.riftstruct(i).segments(:,1:2);
+-end
+-
+-
+-%legend
+-if isp1 & isp2
+-	legend([h1,h2,p1,p2],'mesh boundaries','rift tips',' rifts closing','rifts opening')
+-elseif isp1
+-	legend([h1,h2,p1],'mesh boundaries','rift tips',' rifts closing')
+-elseif isp2
+-	legend([h1,h2,p2],'mesh boundaries','rift tips','rifts opening')
+-else
+-	legend([h1,h2],'mesh boundaries','rift tips')
+-end
+-hold off
+-
+-%apply options
+-quiver_colorbar(quivers,options);
+-options=changefieldvalue(options,'colorbar',2);
+-options=addfielddefault(options,'title','Rift Velocities');
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor_principal.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor_principal.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor_principal.m	(revision 13009)
+@@ -1,77 +0,0 @@
+-function plot_tensor_principal(md,options,width,i,tensor,type,plot_options);
+-%PLOT_TENSOR_PRINCIPAL - plot principal values
+-%
+-%   Usage:
+-%      plot_tensor_principal(md,options,width,i,tensor,type,plot_options);
+-%
+-%   See also: PLOTMODEL, PLOT_UNIT, PLOT_MANAGER
+-
+-%Compute the indexes of the components plots
+-upperplots=fix((i-1)/width);
+-if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
+-if (md.mesh.dimension==2)%3 components -> 3 indexes
+-	index1=4*width*upperplots+2*leftplots+1;
+-	index2=index1+1;
+-	index3=index1+width*2;
+-	index4=index3+1;
+-	newwidth=2*width;
+-elseif md.mesh.dimension==3%6 components -> 6 indexes
+-	index1=3*3*width*upperplots+3*leftplots+1;
+-	index2=index1+1;
+-	index3=index1+2;
+-	index4=index1+width*3;
+-	index5=index4+1;
+-	index6=index4+2;
+-	newwidth=3*width;
+-end
+-
+-%plot principal axis
+-type1=[type 'axis1'];
+-plot_tensor_principalaxis(md,options,newwidth,index1,tensor,type1,plot_options);
+-type2=[type 'axis2'];
+-plot_tensor_principalaxis(md,options,newwidth,index2,tensor,type2,plot_options);
+-if  md.mesh.dimension==3
+-	type3=[type 'axis3'];
+-	plot_tensor_principalaxis(md,options,newwidth,index3,tensor,type3,plot_options);
+-end
+-
+-%now plot principal values
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[tensor.principalvalue1 datatype]=processdata(md,tensor.principalvalue1,options);
+-[tensor.principalvalue2 datatype]=processdata(md,tensor.principalvalue2,options);
+-if  md.mesh.dimension==3
+-	[tensor.principalvalue3 datatype]=processdata(md,tensor.principalvalue3,options);
+-end
+-
+-if ((md.mesh.dimension==2)),
+-	subplot(2*width,2*width,index3)
+-	plot_unit(x,y,z,elements,tensor.principalvalue1,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'principal value 1')
+-	subplot(2*width,2*width,index4)
+-	plot_unit(x,y,z,elements,tensor.principalvalue2,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'principal value 2')
+-else
+-	subplot(3*width,3*width,index4)
+-	plot_unit(x,y,z,elements,tensor.principalvalue1,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'principal value 1')
+-	subplot(3*width,3*width,index5)
+-	plot_unit(x,y,z,elements,tensor.principalvalue2,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'principal value 2')
+-	subplot(3*width,3*width,index6)
+-	plot_unit(x,y,z,elements,tensor.principalvalue3,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'principal value 3')
+-end
+-end
+-
+-function Apply_options_tensor(md,options,type,component)
+-%apply options
+-if ismember('_',type) %user plotet stress_tensor
+-	strings=strsplit(type,'_');
+-	string=strings{1};
+-else %default plot: user requested stress
+-	string=type;
+-end
+-options=addfielddefault(options,'title',[upper(string(1)) string(2:end) ' ' component]);
+-options=changefieldvalue(options,'colorbar',2);
+-applyoptions(md,[],options);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmustddev.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmustddev.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmustddev.m	(revision 13009)
+@@ -1,60 +0,0 @@
+-function plot_qmustddev(md,options,nlines,ncols,i);
+-%PLOT_QMUMEAN - plot stddev of a scaled response 
+-%
+-%   Usage:
+-%      plot_qmustddev(md,options,nlines,ncols,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%plot mesh
+-subplot(nlines,ncols,i); 
+-
+-%edgecolor
+-edgecolor=getfieldvalue(options,'edgecolor','none');
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-%find response function
+-if exist(options,'qmudata'), 
+-	descriptor=getfieldvalue(options,'qmudata'); 
+-	if ~ischar(descriptor),
+-		error('plot_qmustddev error message:  descriptor should be a string');
+-	end
+-else 
+-	error('plot_qmustddev error message:  provide descriptor of response function in ''qmudata'' option');
+-end
+-
+-%go pick up the response: 
+-allresponses=md.qmu.results.dresp_out;
+-responses=zeros(md.qmu.numberofpartitions,1);
+-
+-count=1;
+-for i=1:length(allresponses),
+-	d=allresponses(i).descriptor;
+-	if strncmpi(d,'scaled_',7),
+-		d=d(8:end);
+-		if strncmpi(d,descriptor,length(descriptor)),
+-			responses(count)=allresponses(i).stddev/allresponses(i).mean*100;
+-			count=count+1;
+-		end
+-	end
+-end
+-
+-%log?
+-if exist(options,'log'),
+-	responses=log(responses)/log(getfieldvalue(options,'log'));
+-end
+-
+-
+-%now, project onto vertices
+-responses_on_node=responses(md.qmu.partition+1);
+-
+-%plot
+-A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', responses_on_node,'FaceColor','interp','EdgeColor',edgecolor);
+-
+-%apply options
+-options=addfielddefault(options,'title',['Stddev  distribution of ' descriptor ' in %']);
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_elementstype.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_elementstype.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_elementstype.m	(revision 13009)
+@@ -1,131 +0,0 @@
+-function plot_elementstype(md,options,width,i);
+-%PLOT_ELEMENTSTYPE - plot elements type
+-%
+-%   Usage:
+-%      plot_elementstype(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[data datatype]=processdata(md,md.flowequation.element_equation,options);
+-
+-%edgecolor?
+-edgecolor=getfieldvalue(options,'edgecolor','none');
+-
+-%plot
+-subplot(width,width,i);
+-
+-if is2d
+-	%Hutter 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);
+-	%MacAyeal 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);
+-	%Pattyn element
+-	posP=find(data==3);
+-	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);
+-	%MacAyealPattyn 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);
+-	%Stokes elements
+-	posS=find(data==4);
+-	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);
+-	%MacAyealStokes 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);
+-	%PattynStokes 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);
+-
+-	legend([p1 p2 p3 p5 p6 p7 p8 p9],...
+-		'Hutter''s elements','MacAyeal''s elements','Pattyn''s elements',...
+-		'MacAyealPattyn''s elements','Stokes''s elements','MacAyealStokes''s elements','PattynStokes''s elements','None element');
+-
+-else
+-	%Hutter 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);
+-	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);
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
+-	%MacAyeal 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);
+-	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);
+-	%Pattyn 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);
+-	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);
+-	%Stokes 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);
+-	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);
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
+-	%MacAyealPattyn 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);
+-	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);
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
+-	%PattynStokes 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);
+-	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);
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
+-	%MacAyealStokes 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);
+-	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],...
+-		'Hutter''s elements','MacAyeal''s elements','Pattyn''s elements','Stokes''s elements',...
+-		'MacAyealPattyn''s elements','PattynStokes''s elements','MacAyealStokes''s elements','None elements');
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Elements type');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_basaldrag.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_basaldrag.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_basaldrag.m	(revision 13009)
+@@ -1,53 +0,0 @@
+-function plot_basaldrag(md,options,width,i,type);
+-
+-%PLOT_BASALDRAG - plot basal drag
+-%
+-%   Usage:
+-%      plot_basaldrag(md,options,width,i,type);
+-%
+-%   See also: PLOTMODEL
+-
+-%check layer
+-if md.mesh.dimension==3,
+-	if getfieldvalue(options,'layer',1)~=1;
+-		disp('plot_basaldrag warning: basal drag is displayed in the lower layer')
+-		changefieldvalue(options,'layer',1);
+-	end
+-end
+-
+-%compute exponents
+-s=averaging(md,1./md.friction.p,0);
+-r=averaging(md,md.friction.q./md.friction.p,0);
+-
+-%compute horizontal velocity
+-if strcmpi(type,'basal_drag')
+-	ub=sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
+-elseif strcmpi(type,'basal_dragx')
+-	ub=md.initialization.vx/md.constants.yts;
+-elseif strcmpi(type,'basal_dragy')
+-	ub=md.initialization.vy/md.constants.yts;
+-end
+-
+-%compute basal drag
+-drag=(max(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed),0)).^r.*(md.friction.coefficient).^2.*ub.^s/1000;
+-
+-%Figure out if this is a Section plot
+-if exist(options,'sectionvalue')
+-	plot_section(md,drag,options,width,i);
+-	return;
+-else
+-
+-	%process data and model
+-	[x y z elements is2d isplanet]=processmesh(md,[],options);
+-	[basal_drag datatype]=processdata(md,drag,options);
+-
+-	%plot basaldrag
+-	subplot(width,width,i); 
+-	plot_unit(x,y,z,elements,basal_drag,is2d,isplanet,datatype,options);
+-
+-	%apply options
+-	options=addfielddefault(options,'title','Basal drag [kPa]');
+-	options=addfielddefault(options,'view',2);
+-	applyoptions(md,basal_drag,options);
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_BC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_BC.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_BC.m	(revision 13009)
+@@ -1,41 +0,0 @@
+-function plot_BC(md,options,width,i,data);
+-
+-%plot neuman
+-plot_icefront(md,options,width,i,data)
+-
+-hold on
+-
+-%plot dirichlets
+-h1=plot3(...
+-	md.mesh.x(find(~isnan(md.diagnostic.spcvx(1:md.mesh.numberofvertices,1)))),...
+-	md.mesh.y(find(~isnan(md.diagnostic.spcvx(1:md.mesh.numberofvertices,1)))),...
+-	md.mesh.z(find(~isnan(md.diagnostic.spcvx(1:md.mesh.numberofvertices,1)))),...
+-	'ro','MarkerSize',14,'MarkerFaceColor','r');
+-h2=plot3(...
+-	md.mesh.x(find(~isnan(md.diagnostic.spcvy(1:md.mesh.numberofvertices,1)))),...
+-	md.mesh.y(find(~isnan(md.diagnostic.spcvy(1:md.mesh.numberofvertices,1)))),...
+-	md.mesh.z(find(~isnan(md.diagnostic.spcvy(1:md.mesh.numberofvertices,1)))),...
+-	'bo','MarkerSize',10,'MarkerFaceColor','b');
+-h3=plot3(...
+-	md.mesh.x(find(~isnan(md.diagnostic.spcvz(1:md.mesh.numberofvertices,1)))),...
+-	md.mesh.y(find(~isnan(md.diagnostic.spcvz(1:md.mesh.numberofvertices,1)))),...
+-	md.mesh.z(find(~isnan(md.diagnostic.spcvz(1:md.mesh.numberofvertices,1)))),...
+-	'yo','MarkerSize',6 ,'MarkerFaceColor','y');
+-
+-%update legend
+-[legend_h,object_h,plot_h,text_strings]=legend();
+-legend('off');
+-text_strings{end+1}='vx Dirichlet';
+-text_strings{end+1}='vy Dirichlet';
+-if h3, text_strings{end+1}='vz Dirichlet'; end
+-plot_h(end+1)=h1;
+-plot_h(end+1)=h2;
+-if h3, plot_h(end+1)=h3; end
+-legend(plot_h,text_strings,'location','NorthEast')
+-
+-hold off
+-
+-%apply options
+-options=addfielddefault(options,'title','Boundary conditions');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_segments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_segments.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_segments.m	(revision 13009)
+@@ -1,57 +0,0 @@
+-function plot_segments(md,options,width,i,datai);
+-%PLOT_SEGMENTS - plot segments, with different colors according to segment markers.
+-%
+-%   Usage:
+-%      plot_segments(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%plot mesh boundaries
+-subplot(width,width,i); 
+-
+-%process mesh and data
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-segments=md.mesh.segments;
+-
+-if (md.mesh.dimension==2),
+-	%plot mesh
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-	h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	hold on;
+-
+-	%highlight elements on neumann
+-	pos=segments(:,end);
+-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
+-	h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+-
+-	if strcmpi(getfieldvalue(options,'segmentnumbering','off'),'on'),
+-		text(sum(x(segments(:,1:2)),2)/2,sum(y(segments(:,1:2)),2)/2,sum(z(segments(:,1:2)),2)/2+1,...
+-			num2str(md.mesh.segmentmarkers),...
+-			'backgroundcolor',[0.8 0.9 0.8],'HorizontalAlignment','center','VerticalAlignment','middle');
+-	end
+-
+-	%display arrows pointing outward
+-	xstart=mean(x(segments(:,1:end-1)),2);
+-	ystart=mean(y(segments(:,1:end-1)),2);
+-	length=sqrt((x(segments(:,1))-x(segments(:,2))).^2 + (y(segments(:,1))-y(segments(:,2))).^2 );
+-	normal(:,1)=cos(atan2((x(segments(:,1))-x(segments(:,2))) , (y(segments(:,2))-y(segments(:,1)))));
+-	normal(:,2)=sin(atan2((x(segments(:,1))-x(segments(:,2))) , (y(segments(:,2))-y(segments(:,1)))));
+-	xend=xstart+length.*normal(:,1);
+-	yend=ystart+length.*normal(:,2);
+-	q=quiver(xstart,ystart,xend-xstart,yend-ystart); hold on;
+-	h3=plot(xstart,ystart,'r*');
+-
+-
+-else
+-	error('plot_segments: 3d plot of segments not supported yet!');
+-end
+-
+-%legend (disable warnings)
+-warning off
+-legend([h2,q],'element on segment','normal vectors')
+-warning on
+-
+-%apply options
+-options=addfielddefault(options,'title','Segment boundaries');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmuhistnorm.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmuhistnorm.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmuhistnorm.m	(revision 13009)
+@@ -1,48 +0,0 @@
+-function plot_qmuhistnorm(md,options,nlines,ncols,index);
+-
+-%prepare plot
+-subplot(nlines,ncols,index); 
+-hold on
+-
+-
+-%recover histnorm data
+-if ~exist(options,'qmudata')
+-	error('plot_qmuhistnorm error message: option qmudata is required');
+-else
+-	qmudata=getfieldvalue(options,'qmudata');
+-end
+-
+-%process options for the qmu plot: 
+-
+-%    hmin          (numeric, minimum for histogram)
+-%    hmax          (numeric, maximum for histogram)
+-%    hnint         (numeric, number of intervals for histogram)
+-%    ymin1         (numeric, minimum of histogram y-axis)
+-%    ymax1         (numeric, maximum of histogram y-axis)
+-%    ymin2         (numeric, minimum of cdf y-axis)
+-%    ymax2         (numeric, maximum of cdf y-axis)
+-%    cdfplt        (char, 'off' to turn off cdf line plots)
+-%    cdfleg        (char, 'off' to turn off cdf legends)
+-%
+-
+-qmuoptions='';
+-
+-if exist(options,'hmin'), hmin=getfieldvalue(options,'hmin'); qmuoptions=[qmuoptions ',''hmin'',' num2str(hmin)]; end
+-if exist(options,'hmax'), hmax=getfieldvalue(options,'hmax'); qmuoptions=[qmuoptions ',''hmax'',' num2str(hmax)]; end
+-if exist(options,'hnint'), hnint=getfieldvalue(options,'hnint'); qmuoptions=[qmuoptions ',''hnint'',' num2str(hnint)]; end
+-if exist(options,'ymin1'), ymin1=getfieldvalue(options,'ymin1'); qmuoptions=[qmuoptions ',''ymin1'',' num2str(ymin1)]; end
+-if exist(options,'ymax1'), ymax1=getfieldvalue(options,'ymax1'); qmuoptions=[qmuoptions ',''ymax1'',' num2str(ymax1)]; end
+-if exist(options,'ymin2'), ymin2=getfieldvalue(options,'ymin2'); qmuoptions=[qmuoptions ',''ymin2'',' num2str(ymin2)]; end
+-if exist(options,'ymax2'), ymax2=getfieldvalue(options,'ymax2'); qmuoptions=[qmuoptions ',''ymax2'',' num2str(ymax2)]; end
+-if exist(options,'cdfplt'), cdfplt=getfieldvalue(options,'cdfplt'); qmuoptions=[qmuoptions ',''cdfplt'',''' cdfplt '''']; end
+-if exist(options,'cdfleg'), cdfleg=getfieldvalue(options,'cdfleg'); qmuoptions=[qmuoptions ',''cdfleg'',''' cdfleg '''']; end
+-if exist(options,'nrmplt'), nrmplt=getfieldvalue(options,'nrmplt'); qmuoptions=[qmuoptions ',''nrmplt'',''' nrmplt '''']; end
+-if exist(options,'EdgeColor'), EdgeColor=getfieldvalue(options,'EdgeColor'); qmuoptions=[qmuoptions ',''EdgeColor'',''' EdgeColor '''']; end
+-if exist(options,'FaceColor'), FaceColor=getfieldvalue(options,'FaceColor'); qmuoptions=[qmuoptions ',''FaceColor'',''' FaceColor '''']; end
+-
+-%use qmu plot
+-eval(['plot_hist_norm(qmudata' qmuoptions ');']);
+-
+-%apply options
+-options=changefieldvalue(options,'colorbar','off');
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmu_mass_flux_segments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmu_mass_flux_segments.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmu_mass_flux_segments.m	(revision 13009)
+@@ -1,49 +0,0 @@
+-function plot_qmu_mass_flux_segments(md,options,nlines,ncols,i);
+-%PLOT_QMU_MASS_FLUX_SEGMENTS - plot segments from the qmu analysis of mass fluxes
+-%
+-%   Usage:
+-%      plot_qmu_mass_flux_segments(md,options,nlines,ncols,i);
+-%
+-
+-subplot(nlines,ncols,i); 
+-
+-%process mesh and data
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-allsegments=md.qmu.mass_flux_segments;
+-
+-if (md.mesh.dimension==2),
+-
+-	%recover segments
+-	hold on
+-	for i=1:length(allsegments),
+-		segments=allsegments{i};
+-
+-		%plot semgnets
+-		for j=1:length(segments),
+-			plot([segments(j,1) segments(j,3)],[segments(j,2) segments(j,4)]);
+-		end
+-		text(segments(j,1),segments(j,2),['Profile #' num2str(i)]);
+-
+-		%plot normals
+-		
+-		for j=1:length(segments),
+-			xstart=mean([segments(j,1) segments(j,3)]);
+-			ystart=mean([segments(j,2) segments(j,4)]);
+-			length1=sqrt((segments(j,1)-segments(j,3)).^2 + (segments(j,2)-segments(j,4)).^2);
+-			normal(:,1)=cos(atan2(segments(j,1)-segments(j,3) , segments(j,4)-segments(j,2)));
+-			normal(:,2)=sin(atan2(segments(j,1)-segments(j,3) , segments(j,4)-segments(j,2)));
+-			xend=xstart+length1.*normal(:,1);
+-			yend=ystart+length1.*normal(:,2);
+-			plot([xstart xend],[ystart yend],'r-');
+-		end
+-
+-	end
+-else
+-	error('plot_qmu_mass_flux_segments: 3d plot of segments not supported yet!');
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Mass Flux segments and normals');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_transient_results.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_transient_results.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_transient_results.m	(revision 13009)
+@@ -1,77 +0,0 @@
+-function plot_transient_results(md,options,width,i)
+-%PLOT_TRANSIENT_RESULTS - plot transient results
+-%
+-%   Usage:
+-%      plot_transient_results(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-fontsize=getfieldvalue(options,'fontsize',14);
+-fontweight=getfieldvalue(options,'fontweight','n');
+-
+-%Prepare window distribution
+-%Get screen geometry
+-mp = get(0, 'MonitorPositions');
+-%Build window sizes
+-if size(mp,1)>=2        %several monitors, use the second one
+-	bdwidth=mp(2,1)+5; topbdwidth=mp(2,2)+20; W=mp(2,3)/3; H=mp(2,4)/2;
+-else                    %only one monitor
+-	bdwidth=5;         topbdwidth=20;         W=mp(1,3)/3; H=mp(1,4)/2;
+-end
+-pos1=[bdwidth  H+bdwidth  W-2*bdwidth  H-bdwidth-topbdwidth];
+-pos2=pos1+[W 0 0 0]; pos3=pos1+[2*W 0 0 0]; pos4=pos1+[0 -H 0 0]; pos5=pos1+[W -H 0 0]; pos6=pos1+[2*W -H 0 0];
+-%Create windows
+-figure(1);close;
+-figure('Position',pos1); figure('Position',pos2);figure('Position',pos3);figure('Position',pos4);figure('Position',pos5);figure('Position',pos6);
+-
+-string='plotmodel(md';
+-for i=1:length(md.results.transient),
+-	string=[string ',''data'',md.results.transient(' num2str(i) ').thickness,''title'',''Thickness at time ' num2str(md.results.transient(i).time) ' a'''];
+-end
+-string=[string ',''figure'',1,''colorbar#all'',''on'',''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight ''');'];
+-eval(string);
+-clear string;
+-
+-string='plotmodel(md';
+-for i=1:length(md.results.transient),
+-	string=[string ',''data'',md.results.transient(' num2str(i) ').vel,''view'',3,''title'',''Velocity at time ' num2str(md.results.transient(i).time) ' a'''];
+-end
+-string=[string ',''figure'',2,''colorbar#all'',''on'',''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight  ''');'];
+-eval(string);
+-clear string;
+-
+-if md.mesh.dimension==3,
+-	string='plotmodel(md';
+-	for i=1:length(md.results.transient),
+-		string=[string ',''data'',md.results.transient(' num2str(i) ').temperature,''view'',3,''title'',''Temperature at time ' num2str(md.results.transient(i).time) ' a'''];
+-	end
+-	string=[string ',''figure'',3,''colorbar#all'',''on'',''view'',3,''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight  ''');'];
+-	eval(string);
+-	clear string;
+-end
+-
+-string='plotmodel(md';
+-for i=2:length(md.results.transient),
+-	string=[string ',''data'',md.results.transient(' num2str(i) ').thickness-md.results.transient(' num2str(i-1) ').thickness,''title'',''Delta thickness at time ' num2str(md.results.transient(i).time) ' a'''];
+-end
+-string=[string ',''figure'',4,''colorbar#all'',''on'',''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight  ''');'];
+-eval(string);
+-clear string;
+-
+-string='plotmodel(md';
+-for i=2:length(md.results.transient),
+-	string=[string ',''data'',md.results.transient(' num2str(i) ').vel-md.results.transient(' num2str(i-1) ').vel,''view'',3,''title'',''Delta velocity at time ' num2str(md.results.transient(i).time) ' a'''];
+-end
+-string=[string ',''figure'',5,''colorbar#all'',''on'',''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight  ''');'];
+-eval(string);
+-clear string;
+-
+-if md.mesh.dimension==3,
+-	string='plotmodel(md';
+-	for i=2:length(md.results.transient),
+-		string=[string ',''data'',md.results.transient(' num2str(i) ').temperature-md.results.transient(' num2str(i-1) ').temperature,''view'',3,''title'',''Delta temperature at time ' num2str(md.results.transient(i).time) ' a'''];
+-	end
+-	string=[string ',''figure'',6,''colorbar#all'',''on'',''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight  ''');'];
+-	eval(string);
+-	clear string;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftfraction.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftfraction.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftfraction.m	(revision 13009)
+@@ -1,48 +0,0 @@
+-function plot_riftfraction(md,options,nlines,ncols,index);
+-%PLOT_RIFTFRACTION - plot rift fractions
+-%
+-%   Usage:
+-%      plot_riftfraction(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%check that there is something in riftproperties
+-if isnan(md.rifts.riftstruct.riftproperties),
+-	error('plot_riftfraction error message: field riftproperies is empty, run the model first')
+-end
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-subplot(nlines,ncols,index); 
+-hold on
+-
+-%plot mesh boundaries
+-for i=1:size(md.mesh.segments,1),
+-	h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');
+-end
+-
+-%first, build a vector of fractions, over all nodes. 
+-fractions=zeros(md.mesh.numberofvertices,1);
+-
+-%complete the tips.
+-for i=1:length(md.rifts.riftstruct), 
+-	tips=md.rifts.riftstruct(i).tips;
+-	fractions(tips)=1;
+-end
+-
+-hold on;
+-for i=1:length(md.rifts.riftstruct), 
+-	segments=md.rifts.riftstruct(i).segments(:,1:2)';
+-	xc=x(segments(:));
+-	yc=y(segments(:));
+-	zc=fractions(segments(:));
+-	h2=patch('Xdata',xc,'Ydata',yc,'Zdata',zc,'Cdata',zc,'facecolor','none','edgecolor','flat');
+-end
+-legend([h1,h2],'mesh boundaries','rifts')
+-hold off
+-
+-%apply options
+-options=addfielddefault(options,'title','Rift ice/water fraction ???????'); %Eric, could you enter a better title?
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmunormplot.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmunormplot.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_qmunormplot.m	(revision 13009)
+@@ -1,45 +0,0 @@
+-%
+-%  plot a normal probability plot of the response functions.
+-%
+-%  []=plot_normplot(rfunc)
+-%
+-function []=plot_qmunormplot(rfunc,width,ii)
+-
+-if ~nargin
+-    help plot_normplot
+-    return
+-end
+-
+-%%  assemble the data into a matrix
+-
+-desc=cell (1,length(rfunc));
+-for i=1:length(rfunc)
+-    ldata(i)=length(rfunc(i).sample);
+-end
+-data=zeros(max(ldata),length(rfunc));
+-
+-for i=1:length(rfunc)
+-    desc(i)=cellstr(rfunc(i).descriptor);
+-    data(1:ldata(i),i)=rfunc(i).sample;
+-end
+-
+-%standard plot:
+-subplot(width,width,ii);
+-
+-%%  draw the plot
+-
+-%  draw normal probability plot
+-
+-normplot(data)
+-ax1=gca;
+-
+-%  add the annotation
+-
+-title('Normal Probability Plot of Design Variables and/or Response Functions')
+-xlabel('Value')
+-ylabel('Probability')
+-
+-hleg1=legend(ax1,desc,'Location','EastOutside',...
+-             'Orientation','vertical','Interpreter','none');
+-
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_referential.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_referential.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_referential.m	(revision 13009)
+@@ -1,91 +0,0 @@
+-function plot_referential(md,options,width,i,data);
+-%PLOT_PRESSURELOAD - plot segment on neumann BC
+-%
+-%   Usage:
+-%      plot_referential(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%plot mesh boundaries
+-subplot(width,width,i); 
+-
+-%process mesh and data
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-referential=md.diagnostic.referential;
+-
+-Xhat=md.diagnostic.referential(:,1:3);
+-pos=find(sum(isnan(Xhat),2));
+-Xhat(pos,:)=repmat([1 0 0],size(pos,1),1);
+-Xhatnorm=sqrt(Xhat(:,1).^2+Xhat(:,2).^2+Xhat(:,3).^2);
+-Xhat=Xhat./[Xhatnorm Xhatnorm Xhatnorm];
+-
+-Zhat=md.diagnostic.referential(:,4:6);
+-pos=find(sum(isnan(Zhat),2));
+-Zhat(pos,:)=repmat([0 0 1],size(pos,1),1);
+-Zhatnorm=sqrt(Zhat(:,1).^2+Zhat(:,2).^2+Zhat(:,3).^2);
+-Zhat=Zhat./[Zhatnorm Zhatnorm Zhatnorm];
+-
+-Yhat=cross(Zhat,Xhat);
+-
+-if (md.mesh.dimension==2),
+-
+-	%plot mesh
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-	h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	hold on;
+-
+-	xstart=x;
+-	ystart=y;
+-	zstart=z;
+-	edgex=max(md.mesh.x(elements),[],2)-min(md.mesh.x(elements),[],2);
+-	len=min(edgex)/1.5;
+-	%plot X axis
+-	xend=xstart+len*Xhat(:,1);
+-	yend=ystart+len*Xhat(:,2);
+-	hx=quiver(xstart,ystart,xend-xstart,yend-ystart,'Color','blue','ShowArrowHead','on','AutoScale','off');
+-	%plot Y axis
+-	xend=xstart+len*Yhat(:,1);
+-	yend=ystart+len*Yhat(:,2);
+-	hy=quiver(xstart,ystart,xend-xstart,yend-ystart,'Color','red','ShowArrowHead','on','AutoScale','off');
+-
+-	legend([hx,hy],'local X direction','local Y direction')
+-else
+-	%plot mesh
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-	h1=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	hold on;
+-
+-	xstart=x;
+-	ystart=y;
+-	zstart=z;
+-	edgex=max(md.mesh.x(elements),[],2)-min(md.mesh.x(elements),[],2);
+-	edgez=max(md.mesh.z(elements),[],2)-min(md.mesh.z(elements),[],2);
+-	len=min(edgex)/1.5;
+-	lenz=min(edgez)/1.5;
+-	%plot X axis
+-	xend=xstart+len*Xhat(:,1);
+-	yend=ystart+len*Xhat(:,2);
+-	zend=zstart+len*Xhat(:,3);
+-	hx=quiver3(xstart,ystart,zstart,xend-xstart,yend-ystart,zend-zstart,'Color','blue','ShowArrowHead','on','AutoScale','off');
+-	%plot Y axis
+-	xend=xstart+len*Yhat(:,1);
+-	yend=ystart+len*Yhat(:,2);
+-	zend=zstart+len*Yhat(:,3);
+-	hy=quiver3(xstart,ystart,zstart,xend-xstart,yend-ystart,zend-zstart,'Color','red','ShowArrowHead','on','AutoScale','off');
+-	%plot Z axis
+-	xend=xstart+lenz*Zhat(:,1);
+-	yend=ystart+lenz*Zhat(:,2);
+-	zend=zstart+lenz*Zhat(:,3);
+-	hz=quiver3(xstart,ystart,zstart,xend-xstart,yend-ystart,zend-zstart,'Color','green','ShowArrowHead','on','AutoScale','off');
+-
+-	legend([hx,hy,hz],'local X direction','local Y direction','local Z direction')
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Diagnostic referential');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/quiver_colorbar.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/quiver_colorbar.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/quiver_colorbar.m	(revision 13009)
+@@ -1,41 +0,0 @@
+-function quiver_colorbar(quivers,options)
+-%QUIVER_COLORBAR - colorbar for quiver plots
+-%
+-%   Usage:
+-%      quiver_colorbar(quivers,options)
+-
+-if  strcmpi(getfieldvalue(options,'colorbar','on'),'on'),
+-
+-	%build ticks
+-	hcb=colorbar('peer',gca,'location','EastOutside');
+-	ticklabel=cell(1,length(quivers.levels));
+-	for i=1:length(quivers.levels),
+-		ticklabel{i}=num2str(round_ice(quivers.levels(i),3));
+-	end
+-	tickpos=1:quivers.numcolors+1;
+-
+-	%remove ticks if to many have been created
+-	proportion=round(length(quivers.levels)/4);
+-	if proportion>1,
+-		ticklabel=ticklabel(1:proportion:end);
+-		tickpos=tickpos(1:proportion:end);
+-	end
+-
+-	%draw colorbar
+-	set(hcb,'YTickLabel',ticklabel,'YTick',tickpos);
+-	%position
+-	if exist(options,'colorbarpos'),
+-		set(hcb,'Position',getfieldvalue(options,'colorbarpos'));
+-	end
+-	%fontsize
+-	fontsize=getfieldvalue(options,'fontsize',14);
+-	set(hcb,'FontSize',fontsize);
+-	
+-	if exist(options,'colorbartitle'),
+-		backup=gca;
+-		axes(hcb);lab=title(getfieldvalue(options,'colorbartitle'));
+-		set(lab,'Rotation',getfieldvalue(options,'colorbartitlerotation',0));
+-		set(lab,'VerticalAlignment','bottom');
+-		axes(backup);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_transient_movie.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_transient_movie.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_transient_movie.m	(revision 13009)
+@@ -1,70 +0,0 @@
+-function plot_transient_movie(md,options,width,i);
+-%PLOT_TRANSIENT_MOVIE - plot a transient result as a movie
+-%   Usage:
+-%      plot_transient_movie(md,options,width,i);
+-%
+-%   See also: PLOTMODEL, PLOT_UNIT, PLOT_MANAGER
+-
+-	%prepare subplot
+-	subplot(width,width,i); 
+-
+-	%xlim
+-	if exist(options,'transient_movie_field'),
+-		field=getfieldvalue(options,'transient_movie_field');
+-	else
+-		error('specify transient_movie_field in options list');
+-	end
+-
+-	results=md.results.TransientSolution;
+-	%loop over the time steps
+-	if exist(options,'transient_movie_limit'),
+-		limit=getfieldvalue(options,'transient_movie_limit');
+-		steps=[limit(1):limit(end)];
+-	else
+-		steps=1:length(results);
+-	end
+-	results=md.results.TransientSolution;
+-	nstep=1;
+-	for i=steps
+-
+-		if ~isempty(results(i).(field)),
+-			%process data
+-			[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options);
+-			[data datatype]=processdata(md,results(i).(field),options);
+-
+-			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);
+-
+-			if exist(options,'transient_movie_output'),
+-				set(gcf,'Renderer','zbuffer','color','white'); %fixes a bug on Mac OS X (not needed in future Matlab version)
+-				if nstep==1,
+-					%initialize images and frame
+-					frame=getframe(gcf);
+-					[images,map]=rgb2ind(frame.cdata,256,'nodither');
+-					images(1,1,1,length(steps))=0;
+-				else
+-					frame=getframe(gcf);
+-					images(:,:,1,nstep) = rgb2ind(frame.cdata,map,'nodither');
+-				end
+-			else
+-				pause(0.1)
+-			end
+-			nstep=nstep+1;
+-		end
+-	end
+-
+-	%output movie if requested.
+-	if exist(options,'transient_movie_output'),
+-		filename=getfieldvalue(options,'transient_movie_output');
+-		imwrite(images,map,filename,'DelayTime',getfieldvalue(options,'transient_movie_time',2),'LoopCount',inf)
+-	end
+-
+-end %function
+-
+-function apply_options_movie(md,options,titlestring)
+-	%apply options
+-	options=addfielddefault(options,'title',titlestring);
+-	options=addfielddefault(options,'colorbar',1);
+-	applyoptions(md,[],options);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_drivingstress.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_drivingstress.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_drivingstress.m	(revision 13009)
+@@ -1,24 +0,0 @@
+-function plot_drivingstress(md,options,width,i);
+-%PLOT_DRIVINGSTRESS - plot driving stress
+-%
+-%   Usage:
+-%      plot_drivingstress(md,options,width,i);
+-%
+-%   See also: PLOTMODEL, PLOT_UNIT, PLOT_MANAGER
+-
+-%get driving stress
+-[sx sy s]=drivingstress(md);
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[dstress datatype]=processdata(md,s,options);
+-dstress=dstress/1000;
+-
+-%plot mesh quivervel
+-subplot(width,width,i); 
+-plot_unit(x,y,z,elements,dstress,is2d,isplanet,datatype,options)
+-
+-%apply options
+-options=addfielddefault(options,'title','Driving stress [kPa]');
+-options=addfielddefault(options,'view',2);
+-applyoptions(md,dstress,options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/kmlgroundoverlay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/kmlgroundoverlay.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/kmlgroundoverlay.m	(revision 13009)
+@@ -1,61 +0,0 @@
+-function kmlgroundoverlay(md,options);
+-%KMLGROUNDOVERLAY: create ground overlay image in kml format
+-%
+-%
+-%    options: 
+-%         kmlfilename
+-%         imagename
+-%
+-%    Usage: 
+-%         kmlgroundoverlay(md,'kmlfilename','temp.kml','imagename','greenland.jpeg');
+-%
+-
+-%first figure out if lat and long were computed!
+-if (isempty(md.mesh.lat) | isempty(md.mesh.long)),
+-	error('kmlgroundoverlay error message: project x,y onto lat,long fields of model!');
+-end
+-
+-%process kml options
+-kmlfilename=getfieldvalue(options,'kmlfilename','tempfile.kml');
+-kmlroot=getfieldvalue(options,'kmlroot','./');
+-kmlimagename=getfieldvalue(options,'kmlimagename','tempimage');
+-kmlimagetype=getfieldvalue(options,'kmlimagetype','png');
+-kmlresolution=getfieldvalue(options,'kmlresolution',1);
+-kmlfolder=getfieldvalue(options,'kmlfolder','Ground Overlay');
+-kmlfolderdescription=getfieldvalue(options,'kmlfolderdescription','');
+-kmlgroundoverlayname=getfieldvalue(options,'kmlgroundoverlayname','');
+-kmlgroundoverlaydescription=getfieldvalue(options,'kmlgroundoverlaydescription','');
+-
+-%figure out  min and max for lat and long of this image:
+-west=min(md.mesh.long);
+-east=max(md.mesh.long);
+-south=min(md.mesh.lat);
+-north=max(md.mesh.lat);
+-
+-%print image at high resolution
+-printmodel([kmlroot '/' kmlimagename],kmlimagetype,'trim','on','resolution',kmlresolution,'margin','off','frame','off');
+-
+-%now write kml file
+-fid=fopen([kmlroot '/' kmlfilename],'w');
+-
+-fprintf(fid,'%s\n','<?xml version="1.0" encoding="UTF-8"?>');
+-fprintf(fid,'%s\n','<kml xmlns="http://www.opengis.net/kml/2.2">');
+-fprintf(fid,'%s\n','<Folder>');
+-fprintf(fid,'%s%s%s\n','<name>',kmlfolder,'</name>');
+-fprintf(fid,'%s%s%s\n','<description>',kmlfolderdescription,'</description>');
+-fprintf(fid,'%s\n','<GroundOverlay>');
+-fprintf(fid,'%s%s%s\n','<name>',kmlgroundoverlayname,'</name>');
+-fprintf(fid,'%s\n','<description>',kmlgroundoverlaydescription,'</description>');
+-fprintf(fid,'%s%s.%s%s\n','<Icon>',kmlimagename,kmlimagetype,'</Icon>');
+-fprintf(fid,'%s\n','<LatLonBox>');
+-fprintf(fid,'%s%f%s\n','<north>',north,'</north>');
+-fprintf(fid,'%s%f%s\n','<south>',south,'</south>');
+-fprintf(fid,'%s%f%s\n','<east>',east,'</east>');
+-fprintf(fid,'%s%f%s\n','<west>',west,'</west>');
+-fprintf(fid,'%s\n','<rotation>0</rotation>');
+-fprintf(fid,'%s\n','</LatLonBox>');
+-fprintf(fid,'%s\n','</GroundOverlay>');
+-fprintf(fid,'%s\n','</Folder>');
+-fprintf(fid,'%s\n','</kml>');
+-
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/northarrow.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/northarrow.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/northarrow.m	(revision 13009)
+@@ -1,76 +0,0 @@
+-function northarrow(structure)
+-%NORTHARROW - overlay an arrow pointing north on the current plot
+-%
+-%   Usage:
+-%      northarrow(structure)
+-
+-%Go through structure and fill missing arguments
+-if length(structure)<3
+-	error('plotmodel error message: the position or the length of the North arrow is missing');
+-elseif length(structure)==3
+-	structure(4)=0.5; %default ratio headarrow/length
+-	structure(5)=structure(3)/10; %default width =length/10
+-elseif length(structure)==4
+-	structure(5)=structure(3)/10; %default width =length/10
+-elseif length(structure)==5
+-	structure(6)=16; %default fontsize
+-elseif length(structure)>6
+-	error('plotmodel error message: to many input arguments for northarrow: [x0 y0 length [ratio width fontsize]]');
+-end
+-
+-%retrieve north arrow parameters
+-x0=structure(1);
+-y0=structure(2);
+-lengtharrow=structure(3);
+-ratio=structure(4);
+-width=structure(5);
+-fontsize=structure(6);
+-
+-%Figure out angle to point towards north
+-ang=atan2(y0,x0);
+-
+-%Build the two points Ap and Bp
+-x=zeros(2,1);
+-y=zeros(2,1);
+-x(1)=x0;
+-y(1)=y0;
+-
+-x(2)=x(1)+lengtharrow*cos(ang);
+-y(2)=y(1)+lengtharrow*sin(ang);
+-
+-Ap=[x(1)
+-   y(1)];
+-Bp=[x(2)
+-   y(2)];
+-
+-%Build arrowhead first
+-ang2=150*2*pi/360;
+-rotation=[cos(ang2), sin(ang2); -sin(ang2), cos(ang2)];
+-
+-E=ratio*rotation*(Bp-Ap)+Bp;
+-F=Bp;
+-G=ratio*rotation'*(Bp-Ap)+Bp;
+-H=Bp/4+E*3/8+G*3/8;
+-
+-%Build rectangle
+-u=Bp-Ap;
+-alpha=atan2(u(2),u(1));
+-
+-A=Ap-[-width/2*sin(alpha)
+-   width/2*cos(alpha)];
+- B=H-[-width/2*sin(alpha)
+-   width/2*cos(alpha)];
+-C=H+[-width/2*sin(alpha)
+-   width/2*cos(alpha)];
+-D=Ap+[-width/2*sin(alpha)
+-   width/2*cos(alpha)];
+-
+-%Plot arrow
+-hold on
+-p1=patch([A(1) B(1) C(1) D(1)],[A(2) B(2) C(2) D(2)],'Black');
+-p2=patch([E(1) F(1) G(1) H(1)],[E(2) F(2) G(2) H(2)],'Black');
+-
+-%Text North
+-xN=max([A(1) D(1) E(1) F(1) G(1)])+ratio/3*abs(lengtharrow);
+-yN=mean([A(2) F(2) H(2)]);
+-text(xN,yN,'North','FontSize',fontsize,'FontWeight','b');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftpenetration.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftpenetration.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftpenetration.m	(revision 13009)
+@@ -1,82 +0,0 @@
+-function plot_rifpenetration(md,options,nlines,ncols,index);
+-%PLOT_RIFTPENETRATION - plot rift penetration
+-%
+-%   Usage:
+-%      plot_rifpenetration(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-subplot(nlines,ncols,index); 
+-hold on
+-
+-%plot mesh boundaries
+-for i=1:size(md.mesh.segments,1),
+-	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k-');
+-end
+-
+-isp1=0;
+-isp2=0;
+-
+-if isstruct(md.rifts.riftstruct),
+-	%plot mesh boundaries
+-	for i=1:size(md.mesh.segments,1),
+-		h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
+-	end
+-	for i=1:size(md.rifts.riftstruct,1),
+-		penaltypairs=md.rifts.riftstruct(i).penaltypairs;
+-
+-		segments=md.rifts.riftstruct(i).segments;
+-		for j=1:size(segments,1),
+-			plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
+-		end
+-
+-		normal=zeros(2,1);
+-		for j=1:size(penaltypairs,1),
+-			normal(1)=penaltypairs(j,5);
+-			normal(2)=penaltypairs(j,6);
+-
+-			vx1=md.initialization.vx(penaltypairs(j,1)); 
+-			vx2=md.initialization.vx(penaltypairs(j,2));
+-			vy1=md.initialization.vy(penaltypairs(j,1)); 
+-			vy2=md.initialization.vy(penaltypairs(j,2));
+-			penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
+-			%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
+-			if(penetration>0),
+-				p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'ro-','LineWidth',1);
+-				set(p2,'MarkerSize',3);
+-				isp2=1;
+-			else
+-				p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'ko-','LineWidth',1);
+-				set(p1,'MarkerSize',3);
+-				isp1=1;
+-			end
+-		end
+-
+-		%point out the tips
+-		h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g*');
+-		plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g*');
+-	end
+-	if strcmpi(getfieldvalue(options,'legend','on'),'on'),
+-		if isp1 & isp2
+-			l=legend([h1,h2,p1,p2],'mesh boundaries','crack tips','faults','rifts');
+-		elseif isp1
+-			l=legend([h1,h2,p1],'mesh boundaries','crack tips','faults');
+-		elseif isp2
+-			l=legend([h1,h2,p2],'mesh boundaries','crack tips','rifts');
+-		else
+-			l=legend([h1,h2],'mesh boundaries','crack tips');
+-		end
+-		set(l,'Location',getfieldvalue(options,'legend_location','NorthEast'));
+-	end
+-else
+-	error('plot error message: no rifts available!');
+-end
+-hold off
+-
+-%apply options
+-options=addfielddefault(options,'title','Rift/Fault location');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_overlay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_overlay.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_overlay.m	(revision 13009)
+@@ -1,154 +0,0 @@
+-function plot_overlay(md,data,options,plotlines,plotcols,i)
+-%PLOT_OVERLAY - superimpose radar image to a given field
+-%
+-%   Usage:
+-%      plot_overlay(md,options,plotlines,plotcols,i)
+-%
+-%   See also: PLOTMODEL
+-
+-%process mesh and data
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-if strcmpi(data,'none'),
+-	radaronly=1;
+-	data=NaN*ones(md.mesh.numberofvertices,1);
+-	datatype=1;
+-else
+-	radaronly=0;
+-	[data datatype]=processdata(md,data,options);
+-end
+-
+-%check is2d
+-if ~is2d, 
+-	error('buildoverlay error message: overlay not supported for 3d meshes, project on a layer');
+-end
+-if datatype==3,
+-	error('buildoverlay error message: overlay not supported for quiver plots');
+-end
+-
+-
+-%radar power
+-if ~any(isnan(md.radaroverlay.x)) & ~any(isnan(md.radaroverlay.y)) & ~any(isnan(md.radaroverlay.pwr)),
+-	disp('plot_overlay info: the radar image held by the model is being used');
+-	xlim=[min(md.radaroverlay.x) max(md.radaroverlay.x)];
+-	ylim=[min(md.radaroverlay.y) max(md.radaroverlay.y)];
+-else
+-	disp('Extracting radar image...');
+-	%Get xlim and ylim (used to extract radar image)
+-	xlim=getfieldvalue(options,'xlim',[min(x) max(x)])/getfieldvalue(options,'unit',1);
+-	ylim=getfieldvalue(options,'ylim',[min(y) max(y)])/getfieldvalue(options,'unit',1);
+-	options=addfielddefault(options,'xlim',xlim);
+-	options=addfielddefault(options,'ylim',ylim);
+-	md=radarpower(md,options);
+-end
+-contrast = getfieldvalue(options,'contrast',1);  
+-radar = (md.radaroverlay.pwr).^(contrast);
+-radar = radar./max(radar(:));
+-%radar(find(radar==0))=1; %Change background from black to white
+-
+-%InterpFromMeshToGrid
+-xmin=min(md.radaroverlay.x);
+-ymax=max(md.radaroverlay.y);
+-xspacing=(max(md.radaroverlay.x)-min(md.radaroverlay.x))/(length(md.radaroverlay.x));
+-yspacing=(max(md.radaroverlay.y)-min(md.radaroverlay.y))/(length(md.radaroverlay.y));
+-nlines=length(md.radaroverlay.y);
+-ncols =length(md.radaroverlay.x);
+-disp('Interpolating data on grid...');
+-if radaronly,
+-	x_m=xmin:xspacing:xmin+ncols*xspacing;
+-	y_m=ymax-nlines*yspacing:yspacing:ymax;
+-	data_grid=NaN*ones(nlines,ncols);
+-else
+-	[x_m y_m data_grid]=InterpFromMeshToGrid(elements,x/getfieldvalue(options,'unit',1),y/getfieldvalue(options,'unit',1),...
+-		data,xmin,ymax,xspacing,yspacing,nlines,ncols,NaN);
+-end
+-
+-%Process data_grid (For processing, it is better not to have nan)
+-pos=find(isinf(data_grid));
+-if ~isempty(pos),
+-	disp('Warning: removing Infs from vector (probably log(0)?)');
+-	data_grid(pos)=NaN;
+-end
+-if exist(options,'caxis'),
+-	caxis_opt=getfieldvalue(options,'caxis');
+-	data_grid(find(data_grid<caxis_opt(1)))=caxis_opt(1);
+-	data_grid(find(data_grid>caxis_opt(2)))=caxis_opt(2);
+-	data_min=caxis_opt(1);
+-	data_max=caxis_opt(2);
+-else
+-	data_min=min(data_grid(:));
+-	data_max=max(data_grid(:));
+-end
+-data_nan=find(isnan(data_grid));
+-data_grid(data_nan)=data_min; 
+-
+-%Special colormaps that require hsv treatment
+-colorm=getfieldvalue(options,'colormap','Rignot');
+-if strcmpi(colorm,'Rignot') | strcmpi(colorm,'Seroussi') | strcmpi(colorm,'redblue')
+-	if strcmpi(colorm,'Rignot'),
+-		transparency=getfieldvalue(options,'alpha',1);
+-		h=(data_grid-data_min)/(data_max-data_min+eps);
+-		if radaronly, h(:)=0; end
+-		s=max(min((0.1+h).^(1/transparency),1),0);
+-	elseif strcmpi(colorm,'Seroussi'),
+-		transparency=getfieldvalue(options,'alpha',1);
+-		h=1-(data_grid-data_min)/(data_max-data_min+eps)*0.7;
+-		if radaronly, h(:)=0; end
+-		s=max(min((0.1+h).^(1/transparency),1),0);
+-	elseif strcmpi(colorm,'redblue')
+-		data_mean=data_min+(data_max-data_min)/2;
+-		h=1*ones(size(data_grid));
+-		h(find(data_grid<data_mean))=0.7;
+-		s=max(min(abs(data_grid-data_mean)/(data_max-data_mean) ,1),0);
+-	else
+-		error('colormap not supported yet. (''Rignot'' and ''redblue'' are the only cupported colormaps)');
+-	end
+-	%(S) Saturation is 0 in NaNs
+-	s(data_nan)=0;
+-	%(V) intensity is based on radar image
+-	v=radar; %use radar power as intensity
+-
+-	%Transform HSV to RGB
+-	image_hsv=zeros(size(data_grid,1),size(data_grid,2),3);
+-	image_hsv(:,:,1)=h; clear h;
+-	image_hsv(:,:,2)=s; clear s;
+-	image_hsv(:,:,3)=v; clear v;
+-	image_rgb=hsv2rgb(image_hsv);
+-else
+-	colorm = getcolormap(options);
+-	len    = size(colorm,1);
+-
+-	ind = ceil((len-1)*(data_grid-data_min)/(data_max - data_min + eps) +1);
+-	ind(find(ind>len))=len;
+-	image_rgb=zeros(size(data_grid,1),size(data_grid,2),3);
+-	r=colorm(:,1); image_rgb(:,:,1)=r(ind); clear r;
+-	g=colorm(:,2); image_rgb(:,:,2)=g(ind); clear g;
+-	b=colorm(:,3); image_rgb(:,:,3)=b(ind); clear b;
+-
+-	%Now add radarmap
+-	r = image_rgb(:,:,1).*radar;  r(data_nan) = radar(data_nan);  image_rgb(:,:,1) = r;  clear r;
+-	g = image_rgb(:,:,2).*radar;  g(data_nan) = radar(data_nan);  image_rgb(:,:,2) = g;  clear g;
+-	b = image_rgb(:,:,3).*radar;  b(data_nan) = radar(data_nan);  image_rgb(:,:,3) = b;  clear b;
+-end
+-
+-%Select plot area 
+-subplotmodel(plotlines,plotcols,i,options);
+-
+-%Plot: 
+-imagesc(md.radaroverlay.x*getfieldvalue(options,'unit',1),md.radaroverlay.y*getfieldvalue(options,'unit',1),image_rgb);set(gca,'YDir','normal');
+-
+-%last step: mesh overlay?
+-if exist(options,'edgecolor'),
+-	hold on
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-	patch('Faces',[A B C],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none',...
+-		'EdgeColor',getfieldvalue(options,'edgecolor'),'LineWidth',getfieldvalue(options,'linewidth',1));
+-end
+-
+-%Apply options, without colorbar and without grid
+-options=changefieldvalue(options,'colormap',colorm);              % We used an HSV colorbar
+-if ~isnan(data_min),
+-	options=changefieldvalue(options,'caxis',[data_min data_max]); % force caxis so that the colorbar is ready
+-end
+-options=addfielddefault(options,'axis','equal off');              % default axis
+-applyoptions(md,data,options);
+-drawnow
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_importancefactors.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_importancefactors.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_importancefactors.m	(revision 13009)
+@@ -1,83 +0,0 @@
+-function plot_importancefactors(md,options,width,ii);
+-%PLOT_IMPORTANCEFACTORS - plot importance factors
+-%
+-%   Usage:
+-%      plot_importancefactors(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%first recover design variable descriptor
+-if exist(options,'designvariable'),
+-	descriptor=getfieldvalue(options,'designvariable');
+-else
+-	error('plot_importancefactors error message: Need to supply design variable descriptor');
+-end
+-descriptorlength=length(descriptor);
+-
+-%then recover responsfunction name
+-if exist(options,'responsefunction'),
+-	responsefunctiondescriptor=getfieldvalue(options,'responsefunction');
+-else
+-	error('plot_importancefactors error message: Need to supply response function descriptor');
+-end
+-
+-%go through all response functions and find the one corresponding to the correct responsefunctiondescriptor
+-responsefunctions=md.qmu.results{2};
+-found=0;
+-for i=1:length(responsefunctions),
+-	if strcmpi(responsefunctions(i).descriptor,responsefunctiondescriptor),
+-		found=i;
+-		break;
+-	end
+-end
+-if ~found,
+-	error('plot_importancefactors error message: could not find correct response function');
+-end
+-responsefunctions=responsefunctions(found);
+-nfun=size(responsefunctions.desvar,1);
+-
+-%Now recover response to the correct desgin variable
+-importancefactors=zeros(md.qmu.numberofpartitions,1);
+-count=0;
+-for i=1:nfun,
+-	desvar=responsefunctions.desvar{i};
+-	if strncmpi(desvar,descriptor,descriptorlength),
+-		count=count+1;
+-		importancefactors(count)=responsefunctions.impfac(i);
+-	end
+-end
+-if count==0,
+-	error('plot_importancefactors error message: could not find to response functions with corresponding design variable');
+-end
+-
+-%log?
+-if exist(options,'log'),
+-	logvalue=getfieldvalue(options,'log');
+-	importancefactors=log(importancefactors)/log(logvalue);
+-end
+-
+-%Ok, get partitioning.
+-[epart npart]=MeshPartition(md,md.qmu.numberofpartitions);
+-
+-%distribute importance factor
+-nodeimportance=importancefactors(npart);
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-%edgecolor
+-edgecolor=getfieldvalue(options,'edgecolor','none');
+-
+-%standard plot:
+-subplot(width,width,ii);
+-
+-%ok, plot nodeimportance now.
+-if is2d,
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', nodeimportance,'FaceColor','interp','EdgeColor',edgecolor);
+-else
+-	error('plot_importancefactors error message: 3d meshes not supported yet');
+-end
+-
+-%apply options
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_penalties.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_penalties.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_penalties.m	(revision 13009)
+@@ -1,48 +0,0 @@
+-function plot_penalties(md,options,width,i);
+-%PLOT_PENALTIES - plot penalties
+-%
+-%   Usage:
+-%      plot_penalties(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-%plot mesh penalties
+-subplot(width,width,i); 
+-
+-%units
+-if exist(options,'unit'),
+-	unit=getfieldvalue(options,'unit');
+-	x=x*unit;
+-	y=y*unit;
+-	z=z*unit;
+-end
+-
+-if ~md.mesh.dimension==3,
+-	error('no penalties to plot for ''2d'' model');
+-elseif isempty(md.penalties),
+-	disp('no penalty applied in this model');
+-	return;
+-else
+-	%plot mesh
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-
+-	hold on;
+-	for (i=1:size(md.penalties,1)),
+-		P1=plot3(x(md.penalties(i,1)),y(md.penalties(i,1)),z(md.penalties(i,1)),'ro','MarkerSize',15,'MarkerFaceColor','r');
+-		P2=plot3(x(md.penalties(i,:)),y(md.penalties(i,:)),z(md.penalties(i,:)),'bo-','LineWidth',2,'MarkerSize',8,'MarkerFaceColor','b');
+-	end
+-	legend([P1 P2],'MacAyeal''s penalized nodes','Pattyn''s penalized nodes');
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Penalties');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_parthistw.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_parthistw.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_parthistw.m	(revision 13009)
+@@ -1,43 +0,0 @@
+-function plot_parthist(md,options,nlines,ncols,i);
+-%PLOT_PARTHIST - plot partitioning histogram
+-%
+-%   Usage:
+-%      plot_parthist(md,options,nlines,ncols,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-
+-%plot mesh
+-subplot(nlines,ncols,i); 
+-
+-imin=min(md.qmu.partition);
+-imax=max(md.qmu.partition);
+-
+-part=zeros(imax-imin+1,2);
+-
+-for i=imin:imax
+-    ind=find(md.qmu.partition == i);
+-    part(i-imin+1,1)=length(ind);
+-	part(i-imin+1,2)=sum(md.vertex_weight(ind));
+-end
+-
+-%subplot(2,1,1)
+-%bar(imin:imax,part(:,1));
+-%xlim([imin-0.5 imax+0.5])
+-%title('Number of Nodes in Each Partition')
+-%options=addfielddefault(options,'xlim',[imin-0.5 imax+0.5]);
+-%options=addfielddefault(options,'title','Number of Nodes in Each Partition');
+-%options=addfielddefault(options,'colorbar','off');
+-
+-%subplot(2,1,2)
+-bar(imin:imax,part(:,2));
+-%xlim([imin-0.5 imax+0.5])
+-%title('Total Weight in Each Partition')
+-options=addfielddefault(options,'xlim',[imin-0.5 imax+0.5]);
+-options=addfielddefault(options,'title','Total Weight in Each Partition');
+-options=addfielddefault(options,'colorbar','off');
+-
+-%apply options
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_streamlines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_streamlines.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_streamlines.m	(revision 13009)
+@@ -1,41 +0,0 @@
+-function plot_streamlines(md,options)
+-%PLOT_STREAMLINES - plot stream lines on a figure
+-%
+-%   Usage:
+-%      plot_streamlines(md,options)
+-
+-%process data and model
+-[x y z index is2d isplanet]=processmesh(md,[],options);
+-[u datatype]=processdata(md,md.initialization.vx,options);
+-[v datatype]=processdata(md,md.initialization.vy,options);
+-
+-%some checks
+-if ~is2d,
+-	disp('plot_streamlines error: streamlines option not supported for 3d plots. Project on a layer')
+-	return
+-end
+-
+-%initialize flowpath
+-streamlines=getfieldvalue(options,'streamlines');
+-if ischar(streamlines) & strcmpi(streamlines,'on');
+-	streamlines=60;
+-end
+-if iscell(streamlines)
+-	x0=[]; y0=[];
+-	for i=1:size(streamlines,2)
+-		coord=streamlines{i};
+-		x0=[x0;coord(1)]; y0=[y0;coord(2)];
+-	end
+-else
+-	x0=x(1:ceil(length(x)/streamlines):end);
+-	y0=y(1:ceil(length(x)/streamlines):end);
+-end
+-
+-%Get flow lines
+-flowpath=flowlines(index,x,y,u,v,x0,y0);
+-
+-%plot
+-hold on
+-for i=1:length(flowpath)
+-	patch('Xdata',[flowpath(i).x;NaN],'Ydata',[flowpath(i).y;NaN],'facecolor','none','edgecolor','y');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_edges.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_edges.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_edges.m	(revision 13009)
+@@ -1,34 +0,0 @@
+-function plot_edges(md,options,width,i,datai);
+-%PLOT_SEGMENTS - plot edges, with different colors according to segment markers.
+-%
+-%   Usage:
+-%      plot_edges(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%plot mesh boundaries
+-subplot(width,width,i); 
+-
+-%process mesh and data
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-edges=md.mesh.edges;
+-if isnan(edges)
+-	error('edges in NaN')
+-end
+-
+-if (md.mesh.dimension==2),
+-	%plot mesh
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-	h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	hold on;
+-	text(sum(x(edges(:,1:2)),2)/2,sum(y(edges(:,1:2)),2)/2,sum(z(edges(:,1:2)),2)/2,...
+-		num2str(transpose(1:size(edges,1))),...
+-		'backgroundcolor',[0.8 0.9 0.8],'HorizontalAlignment','center','VerticalAlignment','middle');
+-else
+-	error('plot_edges: 3d plot of edges not supported yet!');
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Edges');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/checkplotoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/checkplotoptions.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/checkplotoptions.m	(revision 13009)
+@@ -1,206 +0,0 @@
+-function options=checkplotoptions(md,options);
+-%PARSE_OPTIONS - build a structure that holds all plot options
+-%
+-%   Usage:
+-%      options=checkplotoptions(md,options);
+-%
+-%   See also: PLOTMODEL
+-
+-%units
+-if exist(options,'unit'),
+-	if strcmpi(getfieldvalue(options,'unit'),'km')
+-		options=changefieldvalue(options,'unit',10^-3);
+-	end
+-	if strcmpi(getfieldvalue(options,'unit'),'100km')
+-		options=changefieldvalue(options,'unit',10^-5);
+-	end
+-
+-end
+-
+-%density
+-if exist(options,'density'),
+-	density=getfieldvalue(options,'density');
+-	options=changefieldvalue(options,'density',abs(ceil(density)));
+-end
+-
+-%Show section
+-if exist(options,'showsection'),
+-	if strcmpi(getfieldvalue(options,'showsection'),'on')
+-		options=changefieldvalue(options,'showsection',4);
+-	end
+-end
+-
+-%smooth values
+-if exist(options,'smooth'),
+-	if strcmpi(getfieldvalue(options,'smooth'),'on')
+-		options=changefieldvalue(options,'smooth',0);
+-	end
+-end
+-
+-%contouronly values
+-if exist(options,'contouronly'),
+-	if strcmpi(getfieldvalue(options,'contouronly'),'on')
+-		options=changefieldvalue(options,'contouronly',1);
+-	end
+-end
+-
+-%Colorbar;
+-if exist(options,'colorbar'),
+-	if strcmpi(getfieldvalue(options,'colorbar'),'on')
+-		options=changefieldvalue(options,'colorbar',1);
+-	elseif strcmpi(getfieldvalue(options,'colorbar'),'off')
+-			options=changefieldvalue(options,'colorbar',0);
+-	end
+-end
+-	
+-%text
+-if exist(options,'text'),
+-	%1: textvalue
+-	textvalues=getfieldvalue(options,'text');
+-	%ischar if only one expstyle -> create a cell
+-	if ischar(textvalues),
+-		textvalues={textvalues};
+-		numtext=1;
+-	elseif iscell(textvalues),
+-		numtext=length(textvalues);
+-	else
+-		error('plot error message: ''text'' option should be either a string or a cell');
+-	end
+-
+-	%2: textweight
+-	if exist(options,'textweight'),
+-		textweightvalues=getfieldvalue(options,'textweight');
+-		%ischar if only one textweight -> create a cell
+-		if ischar(textweightvalues),
+-			textweightvalues={textweightvalues};
+-		elseif ~iscell(textweightvalues);
+-			error('plot error message: ''textweight'' option should be either a string or a cell');
+-		end
+-	else
+-		textweightvalues={'n'};
+-	end
+-	textweightvalues=repmat(textweightvalues,1,numtext); textweightvalues(numtext+1:end)=[];
+-	%3: textsize
+-	if exist(options,'textsize'),
+-		textsizevalues=getfieldvalue(options,'textsize');
+-		%ischar if only one textsize -> create a cell
+-		if isnumeric(textsizevalues),
+-			textsizevalues={textsizevalues};
+-		elseif ~iscell(textsizevalues);
+-			error('plot error message: ''textsize'' option should be either a number or a cell');
+-		end
+-	else
+-		textsizevalues={14};
+-	end
+-	textsizevalues=repmat(textsizevalues,1,numtext); textsizevalues(numtext+1:end)=[];
+-	%4: textcolor
+-	if exist(options,'textcolor'),
+-		textcolorvalues=getfieldvalue(options,'textcolor');
+-		%ischar if only one textcolor -> create a cell
+-		if ischar(textcolorvalues),
+-			textcolorvalues={textcolorvalues};
+-		elseif ~iscell(textcolorvalues);
+-			error('plot error message: ''textcolor'' option should be either a string or a cell');
+-		end
+-	else
+-		textcolorvalues={'k'};
+-	end
+-	textcolorvalues=repmat(textcolorvalues,1,numtext); textcolorvalues(numtext+1:end)=[];
+-	%4: textposition
+-	if exist(options,'textposition'),
+-		textpositionvalues=getfieldvalue(options,'textposition');
+-		%ischar if only one textposition -> create a cell
+-		if isnumeric(textpositionvalues),
+-			textpositionvalues={textpositionvalues};
+-		elseif ~iscell(textpositionvalues);
+-			error('plot error message: ''textposition'' option should be either a string or a cell');
+-		end
+-	else
+-		error('plot error message: ''textposition'' option is missing');
+-	end
+-	%6: textrotation
+-	if exist(options,'textrotation'),
+-		textrotationvalues=getfieldvalue(options,'textrotation');
+-		%ischar if only one textsize -> create a cell
+-		if isnumeric(textrotationvalues),
+-			textrotationvalues={textrotationvalues};
+-		elseif ~iscell(textrotationvalues);
+-			error('plot error message: ''textrotation'' option should be either a number or a cell');
+-		end
+-	else
+-		textrotationvalues={0};
+-	end
+-	textrotationvalues=repmat(textrotationvalues,1,numtext); textrotationvalues(numtext+1:end)=[];
+-	options=changefieldvalue(options,'text',textvalues);
+-	options=changefieldvalue(options,'textsize',textsizevalues);
+-	options=changefieldvalue(options,'textweight',textweightvalues);
+-	options=changefieldvalue(options,'textcolor',textcolorvalues);
+-	options=changefieldvalue(options,'textposition',textpositionvalues);
+-	options=changefieldvalue(options,'textrotation',textrotationvalues);
+-end
+-
+-%expdisp
+-expdispvaluesarray=cell(0,0);
+-expstylevaluesarray=cell(0,0);
+-expstylevalues=cell(0,0);
+-if exist(options,'expstyle'),
+-	expstylevalues=getfieldvalue(options,'expstyle');
+-	%ischar if only one expstyle -> create a cell
+-	if ischar(expstylevalues),
+-		expstylevalues={expstylevalues};
+-	end
+-end
+-if exist(options,'expdisp'),
+-	expdispvalues=getfieldvalue(options,'expdisp');
+-	%ischar if only one expstyle -> create a cell
+-	if ischar(expdispvalues),
+-		expdispvalues={expdispvalues};
+-	end
+-	for i=1:length(expdispvalues)
+-		expdispvaluesarray{end+1}=expdispvalues{i};
+-		if (length(expstylevalues)>=i),
+-			expstylevaluesarray{end+1}=expstylevalues{i};
+-		else
+-			expstylevaluesarray{end+1}='g-';
+-		end
+-	end
+-end
+-options=changefieldvalue(options,'expstyle',expstylevaluesarray);
+-options=changefieldvalue(options,'expdisp',expdispvaluesarray);
+-
+-%latlonnumbering
+-if exist(options,'latlonclick'),
+-	if strcmpi(getfieldvalue(options,'latlonclick'),'on')
+-		options=changefieldvalue(options,'latlonclick',1);
+-	end
+-end
+-
+-%north arrow
+-if exist(options,'northarrow'),
+-	if strcmpi(getfieldvalue(options,'northarrow'),'on')
+-		%default values
+-		Lx=max(md.mesh.y)-min(md.mesh.y);
+-		Ly=max(md.mesh.y)-min(md.mesh.y);
+-		%default values
+-		options=changefieldvalue(options,'northarrow',[min(md.mesh.x)+1/6*Lx   min(md.mesh.y)+5/6*Ly   1/15*Ly   0.25   1/250*Ly]);
+-	end
+-end
+-
+-%scale ruler
+-if exist(options,'scaleruler'),
+-	if strcmpi(getfieldvalue(options,'scaleruler'),'on')
+-		%default values
+-		Lx=max(md.mesh.y)-min(md.mesh.y);
+-		Ly=max(md.mesh.y)-min(md.mesh.y);
+-		%default values
+-		options=changefieldvalue(options,'scaleruler',[min(md.mesh.x)+6/8*Lx   min(md.mesh.y)+1/10*Ly   10^(ceil(log10(Lx)))/5 floor(Lx/100) 5]);
+-	end
+-end
+-
+-%Log scale (LOTS of changes to be performed
+-if exist(options,'log'),
+-	if exist(options,'caxis')
+-		options=changefieldvalue(options,'caxis',log(getfieldvalue(options,'caxis'))/log(getfieldvalue(options,'log')));
+-	end
+-	options=changefieldvalue(options,'cutoff',log(getfieldvalue(options,'cutoff',1.5))/log(getfieldvalue(options,'log')));
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/arrow.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/arrow.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/arrow.m	(revision 13009)
+@@ -1,60 +0,0 @@
+-function arrow(x0,y0,x1,y1,varargin)
+-%ARROW - plot arrow, using (x0,y0) and (x1,y1) as initial and end points. options can be specified.
+-%
+-%   Usage:
+-%      arrow(x1,y1,x2,y2,options)
+-%      where options is a lit of paired arguments of string OR enums
+-%      options can be: 
+-%            'ratio': default .5 (ratio headarrow/length)
+-%            'widthratio': default is 1/10 of length
+-
+-
+-%recover options
+-options=pairoptions(varargin{:});
+-ratio=getfieldvalue(options,'ratio',.5);
+-widthratio=getfieldvalue(options,'widthratio',.1);
+-color=getfieldvalue(options,'color','k');
+-
+-%compute some values out of (x1,y1) and (x2,y2)
+-length=sqrt((x1-x0)^2+(y1-y0)^2);
+-width=length*widthratio;
+-
+-%Build the two points Ap and Bp
+-x=zeros(2,1);
+-y=zeros(2,1);
+-x(1)=x0; y(1)=y0;
+-x(2)=x1; y(2)=y1;
+-
+-Ap=[x(1)
+-   y(1)];
+-Bp=[x(2)
+-   y(2)];
+-
+-%Build arrowhead first
+-ang2=150*2*pi/360;
+-rotation=[cos(ang2), sin(ang2); -sin(ang2), cos(ang2)];
+-
+-E=ratio*rotation*(Bp-Ap)+Bp;
+-F=Bp;
+-G=ratio*rotation'*(Bp-Ap)+Bp;
+-H=Bp/4+E*3/8+G*3/8;
+-
+-%Build rectangle
+-u=Bp-Ap;
+-alpha=atan2(u(2),u(1));
+-
+-A=Ap-[-width/2*sin(alpha)
+-   width/2*cos(alpha)];
+- B=H-[-width/2*sin(alpha)
+-   width/2*cos(alpha)];
+-C=H+[-width/2*sin(alpha)
+-   width/2*cos(alpha)];
+-D=Ap+[-width/2*sin(alpha)
+-   width/2*cos(alpha)];
+-
+-%Plot arrow
+-hold on
+-p1=patch([A(1) B(1) C(1) D(1)],[A(2) B(2) C(2) D(2)],color);
+-set(p1,'EdgeColor',color); set(p1,'FaceColor',color);
+-p2=patch([E(1) F(1) G(1) H(1)],[E(2) F(2) G(2) H(2)],color);
+-set(p2,'EdgeColor',color); set(p2,'FaceColor',color);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/latlonoverlay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/latlonoverlay.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/latlonoverlay.m	(revision 13009)
+@@ -1,149 +0,0 @@
+-function latlonoverlay(md,options)
+-%LATLONOVERLAY - overlay latitude and longitude lines on current figure
+-%
+-%   latstep,lonstep, in latitude and longitude degreees, between two latitudinal, longitudinal profiles.
+-%   color: [1 1 1] for example
+-%   resolution: profile resolution ( in lat,lon degrees) 
+-%   gap: gap (in meters) to plug lat,lon degree numbers;
+-%
+-%   Usage:
+-%      latlonoverlay(options)
+-
+-%get options
+-latlon=getfieldvalue(options,'latlon');
+-numbering=getfieldvalue(options,'latlonnumbering','off');
+-latlonclick=getfieldvalue(options,'latlonclick',0);
+-fontsize=getfieldvalue(options,'fontsize',16);
+-
+-%recover arguments (set default parameters if needed)
+-%1: latlon
+-if ~iscell(latlon),
+-	if ischar(latlon) & strcmpi(latlon,'on'),
+-		%defaults
+-		latstep=3; lonstep=3;
+-		resolution=0.1;
+-		color=[1 0 1];
+-	else return; end
+-else
+-	if length(latlon)<2
+-		error('latlonoverlay error message: at least 2 arguments are required, or use ''on'' option.');
+-	end
+-	if length(latlon)>3, color=latlon{4};      else color=[1 1 1]; end
+-	if length(latlon)>2, resolution=latlon{3}; else resolution=0.1;end
+-	latstep=latlon{1};
+-	lonstep=latlon{2};
+-end
+-
+-%2: numbering
+-if ~iscell(numbering) & isnan(numbering),
+-	numbering=false;
+-else
+-	if ~iscell(numbering),
+-		if strcmpi(char(numbering),'on'),
+-			%defaults
+-			latgap=2; longap=2;
+-			colornumber=color;
+-			latangle=0; lonangle=0;
+-			numbering=true;
+-		else
+-			numbering=false;
+-		end
+-	else
+-		latgap=numbering{1}; longap=numbering{2};
+-		colornumber=numbering{3};
+-		latangle=numbering{4}; lonangle=numbering{5};
+-		numbering=true;
+-	end
+-end
+-
+-%what are the x and y limits
+-xlimits=getfieldvalue(options,'xlim',xlim);
+-ylimits=getfieldvalue(options,'ylim',ylim);
+-
+-%lat
+-for lat=-90:latstep:90
+-	longitudes=0:resolution:360;
+-	latitudes =lat*ones(size(longitudes));
+-
+-	if strcmpi(md.mesh.hemisphere,'n'),
+-		if lat<0, continue; end
+-		[x,y]=ll2xy(latitudes,longitudes,+1,45,70);
+-	elseif strcmpi(md.mesh.hemisphere,'s'),
+-		if lat>0, continue; end
+-		[x,y]=ll2xy(latitudes,longitudes,-1, 0,71);
+-	else error('field hemisphere should either be ''n'' or ''s'''); end
+-
+-	pos=find(x<=xlimits(2) & x>=xlimits(1) & y<=ylimits(2) & y>=ylimits(1));
+-	if length(pos)<=1, continue; end
+-	x=x(pos);y=y(pos);
+-	l=line(x,y,'Color',color);
+-
+-	if numbering
+-		ind=length(x)-2*latgap;
+-		if (ind<=0), continue; end
+-		xcorner=x(ind);            ycorner=y(ind);
+-		xcorner2=x(max(ind-10,1)); ycorner2=y(max(ind-10,1));
+-
+-		if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
+-			angle=mod((180)/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner))+latangle,360);
+-			if lat<0, label=[num2str(abs(lat)) '^{\circ}S'];
+-			else      label=[num2str(abs(lat)) '^{\circ}N']; end
+-			th=text(xcorner,ycorner,label);
+-			set(th,'Color',colornumber,'Rotation',angle,'FontSize',fontsize,'HorizontalAlignment','center','VerticalAlignment','middle','Clipping','on');
+-
+-			%erase line and redraw it in two parts, to leave space for latitude number
+-			delete(l);
+-			line(x(1:ind-latgap),y(1:ind-latgap),'Color',color);hold on;
+-			line(x(ind+latgap:end),y(ind+latgap:end),'Color',color);
+-			set(gcf,'InvertHardcopy','off');
+-		end
+-
+-	end
+-end
+-
+-%lon
+-for lon=-180:lonstep:180
+-
+-	if strcmpi(md.mesh.hemisphere,'n'),
+-		latitudes =0:resolution:90;
+-		longitudes=lon*ones(size(latitudes));
+-		[x,y]=ll2xy(latitudes,longitudes,+1,45,70);
+-	elseif strcmpi(md.mesh.hemisphere,'s'),
+-		latitudes =-90:resolution:0;
+-		longitudes=lon*ones(size(latitudes));
+-		[x,y]=ll2xy(latitudes,longitudes,-1, 0,71);
+-	else
+-		error('field hemisphere should either be ''n'' or ''s'''); 
+-	end
+-
+-
+-	pos=find(x<=xlimits(2) & x>=xlimits(1) & y<=ylimits(2) & y>=ylimits(1));
+-	if length(pos)<=1, continue; end
+-	x=x(pos);y=y(pos);
+-	l=line(x,y,'Color',color);
+-
+-	if numbering,
+-		ind=length(x)-2*longap;
+-		if (ind<=0), continue; end
+-		xcorner=x(ind);            ycorner=y(ind);
+-		xcorner2=x(max(ind-10,1)); ycorner2=y(max(ind-10,1));
+-
+-		if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
+-			angle=mod((180)/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner))+lonangle,360);
+-			if lon<0, label=[num2str(abs(lon)) '^{\circ}W'];
+-			else      label=[num2str(abs(lon)) '^{\circ}E']; end
+-			th=text(xcorner,ycorner,label);
+-			set(th,'Color',colornumber,'Rotation',angle,'FontSize',fontsize,'HorizontalAlignment','center','VerticalAlignment','middle','Clipping','on');
+-
+-			%erase line and redraw it in two parts, to leave space for latitude number
+-			delete(l);
+-			line(x(1:ind-longap),y(1:ind-longap),'Color',color);hold on;
+-			line(x(ind+longap:end),y(ind+longap:end),'Color',color);
+-		end
+-
+-	end
+-end
+-
+-%Back to original limits
+-xlim(xlimits);
+-ylim(ylimits);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_profile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_profile.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_profile.m	(revision 13009)
+@@ -1,55 +0,0 @@
+-function plot_profile(md,data,options,nlines,ncols,ii)
+-%PLOT_SECTION - plot a given field on a profile
+-%
+-%   Usage:
+-%      plot_profile(md,data,options,nlines,ncols,i)
+-%
+-%   See also: PLOTMODEL
+-
+-%process model
+-[x_m y_m z_m elements_m is2d isplanet]=processmesh(md,[],options);
+-if is2d, error('only 3d model supported'); end
+-
+-%Get number of curves and generate random colors
+-numcurves=size(data,2);
+-colorm=getfieldvalue(options,'colormap','lines');
+-color=eval([ colorm '(numcurves);']);
+-options=removefield(options,'colormap',0); %back to default colormap
+-
+-%Get coordinates
+-location=getfieldvalue(options,'profile');
+-if ~isnumeric(location) | numel(location)~=2,
+-	error('location provided not supported (should be [x y])');
+-end
+-xprof=location(1);
+-yprof=location(2);
+-
+-%Loop over number of curves
+-for i=1:numcurves,
+-
+-	%Process data
+-	[datai datatype]=processdata(md,data(:,i),options);
+-
+-	%resolution
+-	if exist(options,'resolution'),
+-		resolution=getfieldvalue(options,'resolution');
+-	else %Default resolution
+-		resolution=[100];
+-		disp(['plot_profile warning: no resolution specified, using default: ' num2str(resolution) ]);
+-	end
+-
+-	%Compute profile value
+-	[z,data_interp]=ProfileValues(md,datai,xprof,yprof,resolution);
+-
+-	%plot profile
+-	subplot(nlines,ncols,ii)
+-	plot(data_interp,z,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1),'LineStyle','-');
+-	hold on;
+-end
+-
+-%apply options
+-options=addfielddefault(options,'title','Profile');
+-options=addfielddefault(options,'colorbar',0);
+-options=addfielddefault(options,'ylabel','z');
+-options=addfielddefault(options,'view',2);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/scaleruler.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/scaleruler.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/scaleruler.m	(revision 13009)
+@@ -1,61 +0,0 @@
+-function scaleruler(options)
+-%SCALERULER - overlay a scale ruler on current plot
+-%
+-%   Usage:
+-%      scaleruler(options)
+-
+-%get options
+-structure=getfieldvalue(options,'scaleruler');
+-fontsize=getfieldvalue(options,'scaleruler_fontsize',16);
+-
+-%Go through structure and fill missing arguments
+-if length(structure)~=5
+-	error('plotmodel error message: bad number of input arguments for scaleruler: [x0 y0 length thickness numberofticks]');
+-end
+-
+-%retrieve north arrow parameters
+-x0=structure(1);
+-y0=structure(2);
+-lengthscale=structure(3);
+-widthscale=structure(4);
+-numberofticks=structure(5);
+-
+-%initialize some coordinates
+-unitlength=lengthscale/(numberofticks -1);
+-flag=-1;
+-
+-Bd=[x0 y0];
+-Bu=[x0 y0+widthscale];
+-Tick=0;
+-
+-%Text
+-xt=Bu(1);
+-yt=Bu(2)+widthscale;
+-text(xt,yt,num2str(Tick),'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
+-
+-%loope over the patches
+-for i=1:numberofticks-1,
+-	Au=Bu;
+-	Ad=Bd;
+-	Bu=[Au(1)+unitlength Ad(2)+widthscale];
+-	Bd=[Ad(1)+unitlength Ad(2)];
+-	Tick=Tick+unitlength;
+-
+-	%pathes
+-	if flag==-1
+-		p=patch([Ad(1) Bd(1) Bu(1) Au(1)],[Ad(2) Bd(2) Bu(2) Au(2)],'Black','FaceAlpha',0.5);
+-	else
+-		p=patch([Ad(1) Bd(1) Bu(1) Au(1)],[Ad(2) Bd(2) Bu(2) Au(2)],'White','FaceAlpha',0.3);
+-	end
+-
+-	%flip flag
+-	flag=-flag;
+-
+-	%Text
+-	xt=Bu(1);
+-	yt=Bu(2)+widthscale;
+-	if i~=numberofticks-1,
+-		text(xt,yt,num2str(round_ice(Tick/1000,3)),'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
+-	end
+-end
+-text(xt,yt,[num2str(round_ice(Tick/1000,3)) ' km'],'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/applyoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/applyoptions.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/applyoptions.m	(revision 13009)
+@@ -1,509 +0,0 @@
+-function applyoptions(md,data,options)
+-%APPLYOPTIONS - apply the options to current plot
+-%
+-%   Usage:
+-%      applyoptions(md,data,options)
+-%
+-%   See also: PLOTMODEL, PARSE_OPTIONS
+-		
+-
+-%some defaults
+-if isfield(md.mesh,'hemisphere'),
+-	if strcmpi(md.mesh.hemisphere,'n'), options=addfielddefault(options,'hemisphere','n'); 
+-	elseif strcmpi(md.mesh.hemisphere,'s'), options=addfielddefault(options,'hemisphere','s'); 
+-	end
+-end
+-
+-%fontsize
+-fontsize=getfieldvalue(options,'fontsize',14);
+-
+-%fontweight
+-fontweight=getfieldvalue(options,'fontweight','normal');
+-
+-%title
+-if exist(options,'title')
+-	titlevalue=getfieldvalue(options,'title');
+-	if iscell(titlevalue),
+-		title(titlevalue,'FontSize',fontsize,'FontWeight',fontweight);
+-	else
+-		if ~isnan(titlevalue),
+-			title(titlevalue,'FontSize',fontsize,'FontWeight',fontweight);
+-		end
+-	end
+-end
+-
+-%xlabel, ylabel and zlabel
+-if exist(options,'xlabel');
+-	xlabel(getfieldvalue(options,'xlabel'),'FontSize',fontsize,'FontWeight',fontweight);
+-end
+-if exist(options,'ylabel');
+-	ylabel(getfieldvalue(options,'ylabel'),'FontSize',fontsize,'FontWeight',fontweight);
+-end
+-if exist(options,'zlabel');
+-	zlabel(getfieldvalue(options,'zlabel'),'FontSize',fontsize,'FontWeight',fontweight);
+-end
+-
+-%xticks, yticks and zticks
+-if exist(options,'xtick'), set(gca,'XTick',getfieldvalue(options,'xtick')); end
+-if exist(options,'ytick'), set(gca,'YTick',getfieldvalue(options,'ytick')); end
+-if exist(options,'ztick'), set(gca,'ZTick',getfieldvalue(options,'ztick')); end
+-
+-%view 
+-if md.mesh.dimension==3 & ~exist(options,'layer'),
+-	view(getfieldvalue(options,'view',3));
+-else
+-	view(getfieldvalue(options,'view',2));
+-end
+-
+-%axis
+-set(gca,'FontSize',getfieldvalue(options,'axisfontsize',fontsize));;
+-if exist(options,'axis')
+-	eval(['axis ' getfieldvalue(options,'axis')]);
+-else
+-	if ((md.mesh.dimension==2) | exist(options,'layer')),
+-		axis tight equal;
+-	else
+-		axis auto tight
+-	end
+-end
+-
+-%box
+-if exist(options,'box')
+-	eval(['box ' getfieldvalue(options,'box')]);
+-end
+-
+-%xlim, ylim and zlim
+-if exist(options,'xlim');
+-	xlim(getfieldvalue(options,'xlim'));
+-end
+-if exist(options,'ylim');
+-	ylim(getfieldvalue(options,'ylim'));
+-end
+-if exist(options,'zlim');
+-	zlim(getfieldvalue(options,'zlim'));
+-end
+-
+-%latlon
+-%Must be done here (before xlim and ylim??) so that it uses the same xlim and ylim as plot_overlay
+-%these are changed by axis that follows
+-if ~strcmpi(getfieldvalue(options,'latlon','off'),'off')
+-	latlonoverlay(md,options);
+-end
+-
+-%Basinzoom
+-if exist(options,'basin');
+-	basinzoom(options);
+-end
+-
+-%ShowBasins
+-if strcmpi(getfieldvalue(options,'showbasins','off'),'on')
+-	showbasins(options);
+-end
+-
+-%Caxis
+-if exist(options,'caxis'),
+-	caxis(getfieldvalue(options,'caxis'));
+-end
+-
+-%shading
+-if exist(options,'shading'),
+-	shading(getfieldvalue(options,'shading'));
+-end
+-
+-%grid
+-if exist(options,'grid'),
+-	if strcmpi(getfieldvalue(options,'grid'),'on'),
+-		grid on;
+-	end
+-end
+-
+-%colormap
+-c = getcolormap(options);
+-h = colormap(c);
+-
+-%wrapping
+-if exist(options,'wrapping'),
+-	if ~exist(options,'colormap'),
+-		h=jet;
+-	end
+-	colormap(repmat(h,getfieldvalue(options,'wrapping',1),1));
+-end
+-
+-%colorbar
+-if getfieldvalue(options,'colorbar',1)==1,
+-	if exist(options,'colorbarcornerposition'),
+-		c=colorbar(getfieldvalue(options,'colorbarcornerposition'),'peer',gca);
+-	else 
+-		c=colorbar('peer',gca);
+-	end
+-	set(c,'FontSize',getfieldvalue(options,'colorbarfontsize',fontsize),'YColor',getfieldvalue(options,'FontColor','k'));
+-	if exist(options,'wrapping')
+-		lim=get(c,'Ylim');
+-		lim=[lim(1) lim(1)+(lim(2)-lim(1))/getfieldvalue(options,'wrapping')];
+-		set(c,'Ylim',lim);
+-	end
+-	if exist(options,'colorbarpos'),
+-		set(c,'Position',getfieldvalue(options,'colorbarpos'));
+-	end
+-	if exist(options,'log'),
+-		nlab=5;
+-		logvalue=getfieldvalue(options,'log');
+-
+-		scaleminmax=caxis;
+-		Min=min(scaleminmax);
+-		Max=max(scaleminmax);
+-		set(c,'YLim',[Min Max]); % set colorbar limits
+-		set(c,'YTick',linspace(Min,Max,nlab));     % set tick mark locations
+-
+-		labels = cell(1,nlab);
+-		tick_vals = linspace(Min,Max,nlab);
+-		tick_vals = exp(log(logvalue)*tick_vals);
+-		warning off MATLAB:log:logOfZero;
+-		for i = 1:nlab
+-			labels{i} = sprintf('%-3.4g',round_ice(tick_vals(i),2));
+-			%labels{i} = sprintf('%-.4g',round_ice(tick_vals(i),2));
+-		end
+-		warning on MATLAB:log:logOfZero;
+-		set(c,'YTickLabel',labels);
+-	end 
+- 	if exist(options,'cbYLim'); 
+-		set(c,'YLim',getfieldvalue(options,'cbYLim'));
+-	end
+-	if exist(options,'colorbartitle'),
+-		set(get(c,'title'),'FontSize',getfieldvalue(options,'colorbarfontsize',fontsize),'String',getfieldvalue(options,'colorbartitle'),...
+-			'Color',getfieldvalue(options,'FontColor','k'));
+-	end
+-	if exist(options,'colorbarYLabel'),
+-		set(get(c,'Ylabel'),'FontSize',getfieldvalue(options,'colorbarfontsize',fontsize),'String',getfieldvalue(options,'colorbarYLabel'),...
+-			'Color',getfieldvalue(options,'FontColor','k'),'Interpreter',getfieldvalue(options,'Interpreter','none'));
+-	end
+-	if exist(options,'colorbarwidth'),
+-		posaxes=get(gca,'Position');
+-		alpha=getfieldvalue(options,'colorbarwidth',1);
+-		position=get(c,'Position');
+-		dx=position(3);
+-		newdx=dx*alpha;
+-		position(1)=position(1)+(dx-newdx)/2;
+-		position(3)=newdx;
+-		set(c,'Position',position);
+-		set(gca,'Position',posaxes);
+-	end
+-	if exist(options,'colorbarheight'),
+-		posaxes=get(gca,'Position');
+-		alpha=getfieldvalue(options,'colorbarheight',1);
+-		position=get(c,'Position');
+-		dy=position(4);
+-		newdy=dy*alpha;
+-		position(2)=position(2)+(dy-newdy)/2;
+-		position(4)=newdy;
+-		set(c,'Position',position);
+-		set(gca,'Position',posaxes);
+-	end
+-	if exist(options,'cbYTickLabel');
+-		tick_vals=getfieldvalue(options,'cbYTickLabel');
+-		if ~isnumeric(tick_vals) & strcmp(tick_vals,'on')
+-			tick_vals=get(c,'YTick')';
+-			if exist(options,'log')
+-				logval= getfieldvalue(options,'log');
+-				for i= 1:size(tick_vals,1)
+-					tick_vals(i)= logval^(tick_vals(i));
+-				end
+-			elseif size(tick_vals,1) == 3
+-				tick_vals=[tick_vals(1); mean(tick_vals(1:2)); tick_vals(2); ...
+-					mean(tick_vals(2:3)); tick_vals(3)];
+-				set(c,'YTick',tick_vals);
+-			end
+-		end
+-		labels = cell(1,size(tick_vals,1));
+-		for i = 1:size(tick_vals,1)
+-			labels{i} = sprintf('%-3.4g',round_ice(tick_vals(i),2));
+-		end
+-		set(c,'YTickLabel',labels);
+-	end
+-
+-elseif getfieldvalue(options,'colorbar',1)==0,
+-	colorbar('off');
+-else
+-	%do nothing
+-	
+-end
+-
+-
+-%area
+-if exist(options,'area'),
+-	antzoom(getfieldvalue(options,'area'));
+-end
+-
+-%expdisp
+-filename=(getfieldvalue(options,'expdisp'));
+-style=(getfieldvalue(options,'expstyle'));
+-for i=1:length(getfieldvalue(options,'expdisp')),
+-	filenamei=filename{i};
+-	stylei=style{i};
+-	expdisp(filenamei,gcf,stylei,getfieldvalue(options,'linewidth',1),getfieldvalue(options,'unit',1));
+-end
+-
+-%text (default value is empty, not NaN...)
+-if exist(options,'text');
+-	textstring=getfieldvalue(options,'text');
+-	textweight=getfieldvalue(options,'textweight','b');
+-	textsize=getfieldvalue(options,'textsize');
+-	textcolor=getfieldvalue(options,'textcolor');
+-	textposition=getfieldvalue(options,'textposition');
+-	textrotation=getfieldvalue(options,'textrotation');
+-	for i=1:length(getfieldvalue(options,'text'));
+-		textstringi=textstring{i};
+-		textweighti=textweight{i};
+-		textsizei=textsize{i};
+-		textcolori=textcolor{i};
+-		textpositioni=textposition{i};
+-		textrotationi=textrotation{i};
+-		h=text(textpositioni(1),textpositioni(2),10,textstringi,'FontSize',textsizei,'FontWeight',textweighti,'Color',textcolori,'Rotation',textrotationi);
+-		set(h,'Clipping','on'); %prevent text from appearing outside of the box
+-	end
+-end
+-
+-%north arrow
+-if exist(options,'northarrow'),
+-	northarrow(getfieldvalue(options,'northarrow'));
+-end
+-
+-%Scale ruler
+-if exist(options,'scaleruler'),
+-	scaleruler(options);
+-end
+-
+-%streamliness
+-if exist(options,'streamlines'),
+-	plot_streamlines(md,options);
+-end
+-
+-%contours
+-if exist(options,'contourlevels'),
+-	plot_contour(md,data,options);
+-end
+-
+-%YTickLabel
+-if exist(options,'yticklabel'),
+-	set(gca,'YTickLabel',getfieldvalue(options,'YTickLabel'));
+-end
+-
+-%XTickLabel
+-if exist(options,'xticklabel'),
+-	set(gca,'XTickLabel',getfieldvalue(options,'XTickLabel'));
+-end
+-
+-%xtick
+-if exist(options,'xtick'),
+-	set(gca,'xtick',getfieldvalue(options,'xtick'));
+-end
+-
+-%ytick
+-if exist(options,'ytick'),
+-	set(gca,'ytick',getfieldvalue(options,'ytick'));
+-end
+-
+-%Axis positions
+-if exist(options,'offsetaxispos'),
+-	offset=getfieldvalue(options,'offsetaxispos');
+-	P=get(gca,'pos');
+-	P(1)=P(1)+offset(1);
+-	P(2)=P(2)+offset(2);
+-	P(3)=P(3)+offset(3);
+-	P(3)=P(4)+offset(4);
+-	set(gca,'pos',P);
+-end
+-if exist(options,'axispos'),
+-	Axis=getfieldvalue(options,'axispos');
+-	hold on
+-	set(gca,'pos',Axis);
+-end
+-
+-
+-%position of figure
+-if exist(options,'figposition'),
+-	
+-	figposition=getfieldvalue(options,'figposition');
+-	if ischar(figposition),
+-		if strcmpi(figposition,'larour'),
+-			set(gcf,'Position',[1604 4 1594 1177]);
+-		elseif strcmpi(figposition,'larour2'),
+-			set(gcf,'Position',[756    62   827   504]);
+-		elseif strcmpi(figposition,'mathieu'),
+-			set(gcf,'Position',[300 1 1580 1150]);
+-		elseif strcmpi(figposition,'fullscreen'),
+-			set(gcf,'Position',get(0,'ScreenSize'));
+-		elseif strcmpi(figposition,'halfright'),
+-			screen=get(0,'ScreenSize');
+-			left=screen(1); bott=screen(2); widt=screen(3); heig=screen(4)-25;
+-			set(gcf,'Position',fix([left+widt/2 bott widt/2 heig]));
+-		elseif strcmpi(figposition,'halfleft'),
+-			screen=get(0,'ScreenSize');
+-			left=screen(1); bott=screen(2); widt=screen(3); heig=screen(4)-25;
+-			set(gcf,'Position',fix([left bott widt/2 heig]));
+-		elseif strcmpi(figposition,'square'),
+-			screen=get(0,'ScreenSize');
+-			left=screen(1); bott=screen(2); widt=min(screen(3)-25,screen(4)-25);
+-			set(gcf,'Position',fix([left+(screen(3)-widt) bott widt widt]));
+-		elseif strcmpi(figposition,'portrait'),
+-			%reformat with letter paper size (8.5" x 11")
+-			screen=get(0,'ScreenSize');
+-			left=screen(1); bott=screen(2); widt=screen(3); heig=screen(4)-25;
+-			portrait=fix([left+widt-(heig*8.5/11) bott heig*8.5/11 heig]);
+-			set(gcf,'Position',portrait)
+-		elseif strcmpi(figposition,'landscape'),
+-			%reformat with letter paper size (8.5" x 11")
+-			screen=get(0,'ScreenSize');
+-			left=screen(1); bott=screen(2); widt=screen(3); heig=screen(4)-25;
+-			landscape=fix([left+widt-(heig*11/8.5) bott heig*11/8.5 heig]);
+-			set(gcf,'Position',landscape)
+-		else
+-			disp('''figposition'' string not supported yet');
+-		end
+-	else
+-		set(gcf,'Position',figposition);
+-	end
+-
+-end
+-
+-%axes position
+-if exist(options,'axesPosition')
+-	set(gca,'Position',getfieldvalue(options,'axesPosition'));
+-end
+-
+-%showregion
+-if strcmpi(getfieldvalue(options,'showregion','off'),'on'),
+-	%Keep pointer of main axis
+-	maingca=gca;
+-	%get inset relative position (x,y,width,height)
+-	insetpos=getfieldvalue(options,'insetpos',[0.02 0.70 0.18 0.18]);
+-	%get current plos position
+-	cplotpos=get(maingca,'pos');
+-	%compute inset position
+-	PosInset=[cplotpos(1)+insetpos(1)*cplotpos(3),cplotpos(2)+insetpos(2)*cplotpos(4), insetpos(3)*cplotpos(3), insetpos(4)*cplotpos(4)];
+-	axes('pos',PosInset);
+-	axis equal off
+-	%box off
+-	if strcmpi(md.mesh.hemisphere,'n') | strcmpi(md.mesh.hemisphere,'north'),
+-		A=expread([ jplsvn() '/projects/Exp/GreenlandBoxFront.exp']);
+-		[A.x A.y]=ll2xy(A.x,A.y,+1,45,70);
+-		A.x = A.x(1:30:end);
+-		A.y = A.y(1:30:end);
+-	elseif strcmpi(md.mesh.hemisphere,'s') | strcmpi(md.mesh.hemisphere,'south'),
+-		A=expread([ jplsvn() '/projects/Exp/Antarctica.exp']);
+-	else
+-		error('applyoptions error message: hemisphere not defined');
+-	end
+-	offset=3*10^4;
+-	Ax=[min(A.x)-offset max(A.x)+offset];
+-	Ay=[min(A.y)-offset max(A.y)+offset];
+-	%if we are zooming on a basin, don't take the mesh for the boundaries!
+-	if exist(options,'basin'),
+-		[mdx mdy]=basinzoom(options);
+-	else
+-		mdx=[min(md.mesh.x)-offset max(md.mesh.x)+offset];
+-		mdy=[min(md.mesh.y)-offset max(md.mesh.y)+offset];
+-	end
+-	line(A.x,A.y,ones(size(A.x)),'color','b');
+-	patch([Ax(1)  Ax(2)  Ax(2)  Ax(1) Ax(1)],[Ay(1)  Ay(1)  Ay(2)  Ay(2) Ay(1)],[1 1 1],'EdgeColor',[0 0 0],'LineWidth',1,'FaceLighting','none')
+-	patch([mdx(1) mdx(2) mdx(2) mdx(1)],[mdy(1) mdy(1) mdy(2) mdy(2)],ones(4,1),'EdgeColor',[0 0 0],'FaceColor','r','FaceAlpha',0.5)
+-	colorbar('off');
+-	%back to main gca
+-	set(gcf,'CurrentAxes',maingca)
+-end
+-
+-%flag edges of a partition
+-if exist(options,'partitionedges')
+-	[xsegments ysegments]=flagedges(md.mesh.elements,md.mesh.x,md.mesh.y,md.qmu.partition);
+-	xsegments=xsegments*getfieldvalue(options,'unit',1);
+-	ysegments=ysegments*getfieldvalue(options,'unit',1);
+-	color=getfieldvalue(options,'partitionedgescolor','r-');
+-	linewidth=getfieldvalue(options,'linewidth',1);
+-	hold on;
+-	for i=1:length(xsegments),
+-		plot(xsegments(i,:),ysegments(i,:),color,'LineWidth',linewidth);
+-	end
+-end
+-
+-%Scatter
+-if exist(options,'scatter')
+-	data=getfieldvalue(options,'scatter');
+-	hold on
+-	plot_scatter(data(:,1),data(:,2),getfieldvalue(options,'scattersize',3),data(:,3),options);
+-end
+-
+-%backgroundcolor
+-set(gca,'color',getfieldvalue(options,'backgroundcolor','none'));
+-
+-%figurebackgrounbcolor
+-set(gcf,'color',getfieldvalue(options,'figurebackgroundcolor','w'));
+-
+-%lighting
+-if strcmpi(getfieldvalue(options,'light','off'),'on'),
+-	set(gca,'FaceLighting','gouraud','FaceColor','interp','AmbientStrength',0.5);
+-	light('Position',[0 0.1 0.1],'Style','infinite');
+-end
+-
+-%cloud of points: 
+-if exist(options,'cloud'),
+-	field=getfieldvalue(options,'cloud');
+-	x=field(:,1);
+-	y=field(:,2);
+-	%unit multiplier:
+-	if exist(options,'unit'),
+-		unit=getfieldvalue(options,'unit');
+-		x=x*unit;
+-		y=y*unit;
+-	end
+-	hold on,p=plot(x,y,'k.');
+-	markersize=getfieldvalue(options,'markersize',5);
+-	color=getfieldvalue(options,'cloudcolor','k');
+-	set(p,'Color',color);
+-end
+-
+-%========================%
+-%OK VERY LAST STEP: INSET|
+-%========================%
+-if exist(options,'inset'),
+-
+-	%Keep pointer of main axis
+-	maingca=gca;
+-	%get inset relative position (x,y,width,height)
+-	insetpos=getfieldvalue(options,'insetpos',[0.56 0.55 0.35 0.35]);
+-	%get current plot position
+-	cplotpos=get(gca,'pos');
+-	%compute inset position
+-	PosInset=[cplotpos(1)+insetpos(1)*cplotpos(3),cplotpos(2)+insetpos(2)*cplotpos(4), insetpos(3)*cplotpos(3), insetpos(4)*cplotpos(4)];
+-	%show pos
+-	X1=getfieldvalue(options,'insetx',xlim);
+-	Y1=getfieldvalue(options,'insety',ylim);
+-	if strcmpi(getfieldvalue(options,'showinset','off'),'on')
+-		line(X1([1 2 2 1 1]),Y1([1 1 2 2 1]),zeros(1,5),'Color','k','LineWidth',2);
+-	end
+-
+-	%Get current figure
+-	ax1=gca;
+-
+-	%plot inset
+-	axes('pos',PosInset);
+-	copyobj(get(ax1,'children'),gca);
+-	patch('Faces',[1 2 3 4 1],'Vertices',[X1([1 2 2 1])' Y1([1 1 2 2])'],'FaceColor','None','EdgeColor','k','LineWidth',2);
+-
+-	%applay options
+-	options=removefield(options,'text',0);
+-	options=removefield(options,'title',0);
+-	options=removefield(options,'xlabel',0);
+-	options=removefield(options,'ylabel',0);
+-	options=removefield(options,'inset',0);
+-	options=removefield(options,'offsetaxispos',0);
+-	options=removefield(options,'showregion',0);
+-	options=changefieldvalue(options,'colorbar',0);
+-	options=changefieldvalue(options,'latlon','off');
+-	options=changefieldvalue(options,'axis','equal off');
+-	options=changefieldvalue(options,'xlim',getfieldvalue(options,'insetx',xlim));
+-	options=changefieldvalue(options,'ylim',getfieldvalue(options,'insety',ylim));
+-	applyoptions(md,data,options);
+-
+-	%back to main gca
+-	set(gcf,'CurrentAxes',maingca)
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_highlightelements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_highlightelements.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_highlightelements.m	(revision 13009)
+@@ -1,51 +0,0 @@
+-function plot_highlightelements(md,options,width,i);
+-%PLOT_HIGHLIGHTELEMENTS - plot selected elements
+-%
+-%   Usage:
+-%      plot_highlightelements(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%plot mesh boundaries
+-subplot(width,width,i); 
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[elementnumbers datatype]=processdata(md,[1:md.mesh.numberofelements]',options);
+-
+-%plot
+-if is2d
+-	%plot mesh 
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3);
+-	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-
+-	%Highlight
+-	pos=getfieldvalue(options,'highlight',[]);
+-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
+-	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+-else
+-	%plot mesh 
+-	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+-
+-	%Highlight
+-	pos=getfieldvalue(options,'highlight',[]);
+-	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],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+-end
+-
+-%apply options
+-if ~exist(options,'highlight')
+-	disp('highlightelements warning : highlight option empty, not element highlighted');
+-end
+-options=addfielddefault(options,'title','Highlighted Elements');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_thermaltransient_results.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_thermaltransient_results.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_thermaltransient_results.m	(revision 13009)
+@@ -1,24 +0,0 @@
+-function plot_thermaltransient_results(md,options,width,i)
+-%PLOT_THERMALTRANSIENT_RESULTS - plot  results of a thermal transient solution
+-%
+-%   Usage:
+-%      plot_thermaltransient_results(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-string='plot(md';
+-for i=1:length(md.thermaltransient_results),
+-	string=[string ',''data'',''thermaltransient_results(' num2str(i) ').temperature'',''view'',3,''title'',''Temperature at time ' num2str(md.thermaltransient_results(i).time) ' a'''];
+-end
+-string=[string ',''figure'',1,''colorbar#all'',''on'',''view'',3,''fontsize'',' num2str(options.fontsize) ',''fontweight'',' options.fontweight ');'];
+-eval(string);
+-clear string;
+-
+-string='plot(md';
+-for i=2:length(md.thermaltransient_results),
+-	string=[string ',''data'',md.thermaltransient_results(' num2str(i) ').temperature-md.thermaltransient_results(' num2str(i-1) ').temperature,''view'',3,''title'',''Delta temperature at time ' num2str(md.thermaltransient_results(i).time) ' a'''];
+-end
+-string=[string ',''figure'',2,''colorbar#all'',''on'',''fontsize'',' num2str(options.fontsize) ',''fontweight'',' options.fontweight ');'];
+-eval(string);
+-clear string;
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/haxby.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/haxby.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/haxby.m	(revision 13009)
+@@ -1,36 +0,0 @@
+-function map = haxby(m);
+-%HAXBY - Haxby color map
+-%   HAXBY(M) returns an M-by-3 matrix containing a colormap with Haxby's
+-%   colors, commonly used for displaying bathymetry data.
+-%   HAXBY, by itself, is the same length as the current colormap.
+-%
+-%   Colormap is based on the colors used by W. F. Haxby's Gravity
+-%   field of World's oceans, 1985, developed for geoid and gravity maps.
+-%   The version used here is formed from a linear interpolation of
+-%   the GMT color table used by MB-System by David W. Caress and Dale N. Chayes.
+-%   <http://www.ldeo.columbia.edu/res/pi/MB-System>
+-
+-if nargin < 1, m = size(get(gcf,'colormap'),1); end
+-
+-ncolors=11;
+-c=[...
+-	37     57   175
+-	40    127   251
+-	50    190   255
+-	106   235   255
+-	138   236   174
+-	205   255   162
+-	240   236   121
+-	255   189    87
+-	255   161    68
+-	255   186   133
+-	255   255   255];
+-
+-pp=1:(m-1)/(ncolors-1):m;
+-r=interp1(pp,c(:,1),1:m);
+-g=interp1(pp,c(:,2),1:m);
+-b=interp1(pp,c(:,3),1:m);
+-map=[r' g' b']/255;
+-
+-%Fix bug of interp1 (M. Morlighem)
+-map(find(map>1))=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/lbmap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/lbmap.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/lbmap.m	(revision 13009)
+@@ -1,109 +0,0 @@
+-function map = lbmap(n,scheme)
+-%LBMAP Returns specified Light-Bertlein colormap.
+-%
+-%   LBMAP(N,SCHEME) returns an Nx3 colormap. SCHEME can be one of the
+-%   following strings:
+-%
+-%       'Blue'       Single-hue progression to purlish-blue (default)
+-%       'BlueGray'   Diverging progression from blue to gray
+-%       'BrownBlue'  Orange-white-purple diverging scheme
+-%       'RedBlue'    Modified spectral scheme
+-%
+-%   If N is not specified, the size of the colormap is determined by the
+-%   current figure. If no figure exists, MATLAB creates one.
+-%
+-%Example 1: 7-color single-hue blue (default)
+-%   load penny
+-%   imagesc(P)
+-%   colormap(lbmap(7))
+-%   colorbar
+-%
+-%Example 2: 11-color modified spectrum
+-%   load penny
+-%   imagesc(P)
+-%   colormap(lbmap(11,'RedBlue'))
+-%   colorbar
+-%
+-%   See also HSV, GRAY, HOT, BONE, COPPER, PINK, FLAG, COLORMAP, RGBPLOT.
+-
+-% Reference:
+-% A. Light & P.J. Bartlein, "The End of the Rainbow? Color Schemes for
+-% Improved Data Graphics," Eos,Vol. 85, No. 40, 5 October 2004.
+-% http://geography.uoregon.edu/datagraphics/EOS/Light&Bartlein_EOS2004.pdf
+-
+-% Copyright 2007-2010 The MathWorks, Inc.
+-
+-%defensive programming
+-error(nargchk(0,2,nargin))
+-error(nargoutchk(0,1,nargout))
+-
+-%defaults
+-if nargin<2
+-	scheme = 'Blue';
+-end
+-if nargin<1
+-	n = size(get(gcf,'colormap'),1);
+-end
+-
+-%valid schemes
+-switch lower(scheme)
+-	case 'blue'
+-		baseMap = BlueMap;
+-	case 'bluegray'
+-		baseMap = BlueGrayMap;
+-	case 'brownblue'
+-		baseMap = BrownBlueMap;
+-	case 'redblue'
+-		baseMap = RedBlueMap;
+-	otherwise
+-		error(['Invalid scheme ' scheme])
+-	end
+-	idx1 = linspace(0,1,size(baseMap,1));
+-	idx2 = linspace(0,1,n);
+-	map = interp1(idx1,baseMap,idx2);
+-
+-function baseMap = BlueMap
+-	baseMap = [243 246 248;
+-	224 232 240;
+-	171 209 236;
+-	115 180 224;
+-	35 157 213;
+-	0 142 205;
+-	0 122 192]/255;
+-
+-function baseMap = BlueGrayMap
+-	%DivergingBlueGray
+-	baseMap = [  0 170 227;
+-	53 196 238;
+-	133 212 234;
+-	190 230 242;
+-	217 224 230;
+-	146 161 170;
+-	109 122 129;
+-	65  79  81]/255;
+-
+-function baseMap = BrownBlueMap
+-	baseMap = [144 100  44;
+-	187 120  54;
+-	225 146  65;
+-	248 184 139;
+-	244 218 200;
+-	241 244 245;
+-	207 226 240;
+-	160 190 225;
+-	109 153 206;
+-	70  99 174;
+-	24  79 162]/255;
+-
+-function baseMap = RedBlueMap
+-	baseMap = [175  53  71;
+-	216  82  88;
+-	239 133 122;
+-	245 177 139;
+-	249 216 168;
+-	242 238 197;
+-	216 236 241;
+-	154 217 238;
+-	68 199 239;
+-	0 170 226;
+-	0 116 188]/255;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/getcolormap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/getcolormap.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/colormaps/getcolormap.m	(revision 13009)
+@@ -1,55 +0,0 @@
+-function map = getcolormap(options)
+-%GETCOLORMAP - get colormap from options
+-%
+-%   Usage:
+-%      map = getcolormap(options)
+-
+-%default is jet
+-if ~exist(options,'colormap'),
+-	map = jet;
+-	return
+-end
+-
+-map = getfieldvalue(options,'colormap');
+-if isnumeric(map);
+-	%user provided a full colormap
+-	return;
+-end
+-
+-%OK this is an in-house colormap
+-if ~ischar(map), error('colormap format not supported'); end
+-
+-if strcmpi(map,'Ala'),
+-	map = jet(256);
+-	map = map(128:end,:);
+-elseif strcmpi(map,'redblue'),
+-	map = hsv(256);
+-	map = rgb2hsv(map);
+-	map(:,2)       = max(min( abs(map(:,1)-0.5)/0.5 ,1),0);
+-	map(1:128,1)   = 0.7;
+-	map(129:end,1) = 1;
+-	map = hsv2rgb(map);
+-elseif strcmpi(map,'Rignot'),
+-	alpha=getfieldvalue(options,'alpha',1);
+-	map = hsv(256);
+-	map = rgb2hsv(map);
+-	map(:,2) = max(min( (0.1+map(:,1)).^(1/alpha) ,1),0);
+-	map = hsv2rgb(map);
+-elseif strcmpi(map,'Rignot2'),
+-	alpha=getfieldvalue(options,'alpha',1);
+-	map = hsv(256);
+-	map = rgb2hsv(map);
+-	map(:,2) = max(min( (0.1+map(:,1)).^(1/alpha) ,1),0);
+-	map = hsv2rgb(map);
+-	map=flipud(map);
+-elseif strcmpi(map,'Seroussi'),
+-	alpha=getfieldvalue(options,'alpha',1);
+-	map = hsv(256);
+-	map = flipud(map);
+-	map = map(1:floor(0.7*size(map,1)),:);
+-	map = rgb2hsv(map);
+-	map(:,2) = max(min( (0.1+map(:,1)).^(1/alpha) ,1),0);
+-	map = hsv2rgb(map);
+-else
+-	eval(['map = ' map ';']);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plotdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plotdoc.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plotdoc.m	(revision 13009)
+@@ -1,174 +0,0 @@
+-function plotdoc()
+-%PLOTDOC - plot documentation
+-%
+-%   Usage:
+-%      plotdoc()
+-
+-disp(' ');
+-disp('   Plot usage: plotm(model,varargin)');
+-disp('   Options: ');
+-disp('       ''figure'': figure number');
+-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_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).');
+-disp('                  - ''BC'': this will draw all the boundary conditions (Dirichlet and Neumann).');
+-disp('                  - ''deviatoricstress_tensor'': plot the components of the deviatoric stress tensor (tauxx,tauyy,tauzz,tauxy,tauxz,tauyz) if computed');
+-disp('                  - ''deviatoricstress_principal'': plot the deviatoricstress tensor principal axis and principal values');
+-disp('                  - ''deviatoricstress_principalaxis1'': arrow plot the first principal axis of the deviatoricstress tensor(replace 1 by 2 or 3 if needed)');
+-disp('                  - ''driving_stress'': plot the driving stress (in kPa)');
+-disp('                  - ''elements_type'': model used for each element');
+-disp('                  - ''elementnumbering'': numbering of elements');
+-disp('                  - ''vertexnumbering'': numbering of vertices');
+-disp('                  - ''highlightelements'': to highlight elements to highlight the element list');
+-disp('                  - ''highlightvertices'': to highlight vertices (use highlight option to enter the vertex list');
+-disp('                  - ''mesh'': draw mesh using trisurf');
+-disp('                  - ''referential'': diagnostic referential');
+-disp('                  - ''riftvel'': velocities along rifts');
+-disp('                  - ''riftrelvel'': relative velocities along rifts');
+-disp('                  - ''riftpenetration'': penetration levels for a fault');
+-disp('                  - ''riftfraction'': fill fractions for every node of the rifts');
+-disp('                  - ''rifts'': plot mesh with an offset so that rifts are visible');
+-disp('                  - ''strainrate_tensor'': plot the components of the strainrate tensor (exx,eyy,ezz,exy,exz,eyz) if computed');
+-disp('                  - ''strainrate_principal'': plot the strainrate tensor principal axis and principal values)');
+-disp('                  - ''strainrate_principalaxis1'': arrow plot the first principal axis of the strainrate tensor(replace 1 by 2 or 3 if needed)');
+-disp('                  - ''stress_tensor'': plot the components of stress tensor (sxx,syy,szz,sxy,sxz,syz) if computed');
+-disp('                  - ''stress_principal'': plot the stress tensor principal axis and principal values');
+-disp('                  - ''stress_principalaxis1'': arrow plot the first principal axis of the stress tensor(replace 1 by 2 or 3 if needed)');
+-disp('                  - ''transient_results'': this will display all the time steps of a transient run (use steps to specify the steps requested)');
+-disp('                  - ''transient_vel'': this will display the velocity for the time steps requested in ''steps'' of a transient run');
+-disp('                  - ''transient_vel'': vel can be by any field of the transient results (vx, vy, vz, vel, temperature, melting, pressure, bed, thickness, surface)');
+-disp('                  - ''transient_field'': dynamic plot of results. specify ''steps'' option, as fell as ''field'' (defaults are all steps, for ''Vel'' field)');
+-disp('                  - ''transient_movie'': this will display the time steps of a given field of a transient run');
+-disp('                  - ''transient_movie_field'': field to be displayed when doing  transient_movie data display');
+-disp('                  - ''transient_movie_output'': filename if output is desired for movie');
+-disp('                  - ''transient_movie_time'': time for each image (default 2 seconds)');
+-disp('                  - ''thermaltransient_results'': this will display all the time steps of a thermal transient run');
+-disp('                  - ''qmuhistnorm'': histogram normal distribution. needs option qmudata');
+-disp('                  - ''qmumean'': plot of mean distribution in sampling analysis with scaled response. needs option qmudata for descriptor');
+-disp('                  - ''qmustddev'': plot of stddev distribution in sampling analysis with scaled response. needs option qmudata for descriptor');
+-disp('                  - ''part_hist'': partitioning node and area histogram');
+-disp('                  - ''quiver'': quiver plot');
+-
+-disp('       ''alloptions'': apply the options to all subplots if ''on''');
+-disp('       ''axis'': same as standard matlab option (''equal'',''off'',''equal on'',...)');
+-disp('       ''basin'': zoom on a given basin (''pineislandglacier'',''ronneiceshelf'', use isbasin to identify a basin');
+-disp('                 ''hemisphere'': specify +1 or -1');
+-disp('                 ''basindeltax'': in m');
+-disp('                 ''showbasins'': write lables for every existing basin name around the center of the plot');
+-disp('       ''caxis'': modify  colorbar range. (array of type [a b] where b>=a)');
+-disp('       ''backgroundcolor'': plot background color. (default is ''w'')');
+-disp('       ''figurebackgroundcolor'': figure background color. (default is ''none'')');
+-disp('       ''coord'':  ''xy'' (default) or ''latlon''');
+-disp('       ''colorlevels'':  N or {value1,valu2,value3,...} used if quiver, use different colors for the given number of colors or limits');
+-disp('       ''colorbar'': add colorbar (string ''on'' or ''off'')');
+-disp('       ''colorbartitle'': colorbar title (string)');
+-disp('       ''colorbarYlabel'': colorbar Y label (string)');
+-disp('       ''colorbarpos'': [x,y,dx,dy] where x,y,dx and dy are within [0 1]');
+-disp('       ''colorbarcornerposition'': ''West'',''North'',etc ...');
+-disp('       ''colorbartitlerotation'': -90, etc ...');
+-disp('       ''colorbarfontsize'': specify colorbar fontsize');
+-disp('       ''colorbarwidth'': multiplier (default 1) to the default width colorbar');
+-disp('       ''colorbarheight'': multiplier (default 1) to the default height colorbar');
+-disp('       ''colormap'': same as standard matlab option (''jet'',''hsv'',''cool'',''spring'',''gray'',''Ala'',''Rignot'',...)');
+-disp('       ''contourlevels'': N or {value1,valu2,value3,...} add the contours of the specified values or N contours');
+-disp('       ''contourticks'': ''on'' or ''off'' to display the ticks of the contours');
+-disp('       ''contouronly'': ''on'' or ''off'' to display the contours on a white background');
+-disp('       ''contourcolor'': ticks and contour color');
+-disp('       ''density'': density of quivers (one arrow every N nodes, N integer)');
+-disp('       ''inset'': add an inset (zoom) of the current figure if 1 (use ''insetx'', ''insety'' and ''insetpos'' to determine the inset position and content)');
+-disp('       ''insetx'': [min(x) max(x)] where min(x) and max(x) are values determining the inset content');
+-disp('       ''insety'': [min(y) max(y)] where min(y) and max(y) are values determining the inset content');
+-disp('       ''insetpos'': [x,y,dx,dy] where x,y,dx and dy are within [0 1]');
+-disp('       ''streamlines'': N (number of stream lines) or {[x1 y1],...} (coordinates of seed points) add streanlines on current figure');
+-disp('       ''edgecolor'': same as standard matlab option EdgeColor (color name: ''black'' or RGB array: [0.5 0.2 0.8])');
+-disp('       ''fontsize'': same as standard matlab option (10,14,...)');
+-disp('       ''fontweight'': same as standard matlab option (normal: ''n'',bold: ''b'',light: ''l'',demi: ''d'')');
+-disp('       ''fontcolor'': same as standard matlab option');
+-disp('       ''highlight'': highlights certain nodes or elements when using ''nodenumbering'' or ''elementnumbering'' or ''highlightnodes '' or ''highlightelements'' option');
+-disp('       ''resolution'': resolution used by section value (array of type [horizontal_resolution vertical_resolution])');
+-disp('                       horizontal_resolution must be in meter, and vertical_resolution a number of layers');
+-disp('       ''showsection'': show section used by ''sectionvalue'' (string ''on'' or a number of labels)');
+-disp('       ''sectionvalue'': give the value of data on a profile given by an Argus file (string ''Argusfile_name.exp'')');
+-disp('       ''profile'': give the value of data along a vertical profile ([xlocation ylocation])');
+-disp('       ''smooth'': smooth element data (string ''yes'' or integer)');
+-disp('       ''title'': same as standard matlab option');
+-disp('       ''view'': same as standard matlab option (ex: 2, 3 or [90 180]');
+-disp('       ''xlim'': same as standard matlab option (ex: [0 500])');
+-disp('       ''ylim'': same as standard matlab option');
+-disp('       ''zlim'': same as standard matlab option');
+-disp('       ''xlabel'': same as standard matlab option (ex:''km'')');
+-disp('       ''ylabel'': same as standard matlab option');
+-disp('       ''xticklabel'': specifiy xticklabel');
+-disp('       ''yticklabel'': specifiy yticklabel');
+-disp('       ''overlay'': yes or no. This will overlay a radar amplitude image behind');
+-disp('       ''overlay_image'': path to overlay image. provide overlay_xlim, overlay_ylim, overlay_xposting and overlay_yposting options also');
+-disp('       ''contrast'': (default 1) coefficient to add contrast to the radar amplitude image used in overlays');
+-disp('       ''highres'': resolution of overlayed radar amplitude image (default is 0, high resolution is 1).');
+-disp('       ''hem'': specify hemisphere ''n'' or ''s'' (default is ''s'').');
+-disp('       ''alpha'': transparency coefficient (the higher, the more transparent). Default is 1.5');
+-disp('       ''scaling'': scaling factor used by quiver plots. Default is 0.4');
+-disp('       ''autoscale'': set to ''off'' to have all the quivers with the same size. Default is ''on''');
+-disp('       ''expdisp'': plot exp file on top of a data plot. provide exp file as an argument (use a cell of strings if more than one)');
+-disp('       ''expstyle'': marker style for expdisp plot (use a cell of strings if more than one)');
+-disp('       ''linewidth'': line width for expdisp plot');
+-disp('       ''border'': size of display border (in pixels). active only for overlay plots');
+-disp('       ''text'': print string, use a cell of strings if more than one');
+-disp('       ''textposition'': [x y] position of text, use a cell of strings if more than one');
+-disp('       ''textsize'':  same as standard ''FontSize'' matlab option applied to text, use a cell of strings if more than one');
+-disp('       ''textweight'':  same as standard ''FontWeight'' matlab option applied to text, use a cell of strings if more than one');
+-disp('       ''textcolor'':  same as standard ''color'' matlab option applied to text, use a cell of strings if more than one');
+-disp('       ''textrotation'':  same as standard ''Rotation'' matlab option applied to text, use a cell of strings if more than one');
+-disp('       ''mask'': list of flags of size numberofnodes or numberofelements. Only ''true'' values are plotted ');
+-disp('       ''nan'': value assigned to NaNs (convenient when plotting BC)');
+-disp('       ''partitionedges'': ''off'' by default. overlay plot of partition edges');
+-disp('       ''log'': value of log');
+-disp('       ''latlon'': ''on'' or {latstep lonstep [resolution [color]]} where latstep,longstep and resolution are in degrees, color is a [r g b] array');
+-disp('       ''latlonnumbering'': ''on'' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers,'); 
+-disp('       ''latlonclick'': ''on'' to click on latlon ticks positions');
+-disp('                   colornumber is a [r g b] array and latangle and lonangle are angles to flip the numbers');
+-disp('       ''northarrow'': add an arrow pointing north, ''on'' for default value or [x0 y0 length [ratio width fontsize]] where (x0,y0) are the coordinates of the base, ratio=headlength/length');
+-disp('       ''offset'': mesh offset used by ''rifts'', default is 500');
+-disp('       ''scaleruler'': add a scale ruler, ''on'' for default value or [x0 y0 length width numberofticks] where (x0,y0) are the coordinates of the lower left corner');
+-disp('       ''showregion'': show domain in Antarctica on an inset, use ''insetpos'' properties');
+-disp('       ''visible'': ''off'' to make figure unvisible, default is ''on''');
+-disp('       ''wrapping'': repeat ''n'' times the colormap (''n'' must be an integer)');
+-disp('       ''unit'': by default, in m, otherwise, ''km'' is available');
+-disp('       ''legend_position'': by default, ''NorthEasth''');
+-disp('       ''qmudata'': data for qmu  plots.');
+-disp('                  {dresp1   ,dresp2  ,hmin,hmax,hnint} or {samp,desc,mu,sigma,hmin,hmax,hnint}');
+-disp('                  where dresp1 is a structure array of responses (where we need samp and desc), ');
+-disp('                  dresp2 is a structure array of responses (where we only need mu and sigma)');
+-disp('                  hmin,hmax and hnint are the minimum, maximum and number of intervals of the histogram (optional)');
+-disp('       ''figposition'': position of figure: ''fullscreen'', ''halfright'', ''halfleft'', ''portrait'', ''landscape'',... (hardcoded in applyoptions.m)');
+-disp('       ''offsetaxispos'': offset of current axis position to get more space (ex: [-0.02 0  0.04 0])');
+-disp('       ''axispos'': axis position to get more space');
+-disp('       ''hmin'': (numeric, minimum for histogram)');
+-disp('       ''hmax'': (numeric, maximum for histogram)');
+-disp('       ''hnint'': (numeric, number of intervals for histogram)');
+-disp('       ''ymin1'': (numeric, minimum of histogram y-axis)');
+-disp('       ''ymax1'': (numeric, maximum of histogram y-axis)');
+-disp('       ''ymin2'': (numeric, minimum of cdf y-axis)');
+-disp('       ''ymax2'': (numeric, maximum of cdf y-axis)');
+-disp('       ''cdfplt'': (char, ''off'' to turn off cdf line plots)');
+-disp('       ''cdfleg'': (char, ''off'' to turn off cdf legends)');
+-disp('       ''segmentnumbering'': (''off'' by default)');
+-disp('       ''kmlgroundoverlay'': (''off'' by default)');
+-disp('       ''kmlfilename'': (''tempfile.kml'' by default)');
+-disp('       ''kmlroot'': (''./'' by default)');
+-disp('       ''kmlimagename'': (''tempimage'' by default)');
+-disp('       ''kmlimagetype'': (''png'' by default)');
+-disp('       ''kmlresolution'': (1 by default)');
+-disp('       ''kmlfolder'': (''Ground Overlay'' by default)');
+-disp('       ''kmlfolderdescription'': ('''' by default)');
+-disp('       ''kmlgroundoverlayname'': ('''' by default)');
+-disp('       ''kmlgroundoverlaydescription'': ('''' by default)');
+-
+-disp('       any options (except ''data'') can be followed by ''#i'' where ''i'' is the subplot number, or ''#all'' if applied to all plots');
+-disp('  ');
+-disp('   Examples:');
+-disp('       plotmodel(md,''data'',''vel'',''data'',''mesh'',''view#2'',3,''colorbar#all'',''on'',''axis#1'',''off equal'')');
+-disp('       plotmodel(md,''data'',''highlightelements'',''highlight'',[1 4 10],''expdisp'',{''domain1.exp'' ''domain2.exp'' ''domain3.exp''})');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processdata.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processdata.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/processdata.m	(revision 13009)
+@@ -1,203 +0,0 @@
+-function [data datatype]=processdata(md,data,options);
+-%PROCESSDATA - process data to be plotted
+-%
+-%   datatype = 1 -> elements
+-%   datatype = 2 -> nodes
+-%   datatype = 3 -> node quivers
+-%   datatype = 4 -> patch
+-%
+-%   Usage:
+-%      [data datatype]=processdata(md,data,options);
+-%
+-%   See also: PLOTMODEL, PROCESSMESH
+-
+-%check format
+-if (iscell(data) | isempty(data) | length(data)==0 | (length(data)==1 & ~isstruct(data) & isnan(data))),
+-	error('plotmodel error message: data provided is empty');
+-end
+-
+-%needed later on
+-if isfield(md.mesh,'numberofvertices2d'), 
+-	numberofvertices2d=md.mesh.numberofvertices2d; 
+-	numberofelements2d=md.mesh.numberofelements2d; 
+-else 
+-	numberofvertices2d=NaN;
+-	numberofelements2d=NaN;
+-end
+-
+-%Process Patch
+-if isstruct(data) 
+-	if (isfield(data,'index') & isfield(data,'value')),
+-		if data.interpolation(1)==P1Enum(),
+-			data=data.value;
+-			data=data';
+-			data=data(:);
+-			datatype=4;
+-		elseif data.interpolation(1)==P0Enum(),
+-			data=data.value;
+-			datatype=5;
+-		else
+-			error(['interpolation ' data.interpolation(1) ' not supported yet']);
+-		end
+-	else
+-		error('structure other than Patch not supported yet');
+-	end
+-else
+-	%initialize datatype
+-	datatype=0;
+-end
+-
+-%get datatype
+-datasize=size(data);
+-
+-%Process NaN if any (do not now before mask is applied)
+-if exist(options,'nan')
+-	data(find(isnan(data)))=getfieldvalue(options,'nan',0);
+-end
+-%non patch processing
+-if datatype~=4 & datatype~=5,
+-
+-	%transpose data if necessary
+-	if (size(data,2) > size(data,1)),
+-		data=data';
+-	end
+-	datasize=size(data);
+-
+-	%convert to double if necessary
+-	if ~isnumeric(data);
+-		disp('processdata info message: data is not numeric (logical?). Converted to double');
+-		data=double(data);
+-	end
+-
+-	%check length
+-	
+-	if datasize(1)~=md.mesh.numberofvertices & datasize(1)~=md.mesh.numberofelements & datasize(1)~=md.mesh.numberofvertices*6 & (md.mesh.dimension==3 & ~(datasize(1)==numberofelements2d | datasize(1)==numberofvertices2d))
+-		error('plotmodel error message: data not supported yet');
+-	end
+-	
+-	%quiver?
+-	if datasize(2)>1,
+-		datatype=3;
+-
+-		%check number of columns, add zeros if necessary,
+-		if (md.mesh.dimension==3)
+-			if datasize(2)==2,
+-				data=[data, zeros(datasize(1),1)];
+-			elseif datasize(2)~=3,
+-				error('plotmodel error message: data provided should have 2 or 3 columns for quiver plot, and 1 for regular plot');
+-			end
+-		%elseif ((md.mesh.dimension==2) & datasize(2)~=2),
+-		%	error('plotmodel error message: data provided should have 2 columns for quiver plot, and 1 for regular plot');
+-		end
+-	end
+-
+-	%treat the case datasize(1)=6*nodes
+-	if datasize(1)==6*md.mesh.numberofvertices
+-		%keep the only norm of data
+-		data1=data(1:6:md.mesh.numberofvertices*6,:);
+-		data2=data(2:6:md.mesh.numberofvertices*6,:);
+-		data=sqrt(data1.^2+data2.^2);
+-		datasize(1)=md.mesh.numberofvertices;
+-		%---> go to node data
+-	end
+-
+-	%treat the case datasize(1)=nodes2d
+-	if (md.mesh.dimension==3 & datasize(1)==numberofvertices2d),
+-		data=project3d(md,'vector',data,'type','node');
+-		datasize(1)=md.mesh.numberofvertices;
+-		%---> go to node data
+-	end
+-
+-	%treat the case datasize(1)=nodes2d
+-	if (md.mesh.dimension==3 & datasize(1)==numberofelements2d),
+-		data=project3d(md,'vector',data,'type','element');
+-		datasize(1)=md.mesh.numberofelements;
+-		%---> go to node data
+-	end
+-
+-	%smoothing?
+-	if exist(options,'smooth')
+-		data=averaging(md,data,getfieldvalue(options,'smooth'));
+-		datasize(1)=md.mesh.numberofvertices;
+-		%---> go to node data
+-	end
+-end
+-
+-%element data
+-if (datasize(1)==md.mesh.numberofelements & datasize(2)==1),
+-
+-	%Initialize datatype if non patch
+-	if datatype~=4 & datatype~=5,
+-		datatype=1;
+-	end
+-
+-	%Mask?
+-	if exist(options,'mask'),
+-		flags=getfieldvalue(options,'mask');
+-		pos=find(~flags);
+-		if length(flags)==md.mesh.numberofvertices,
+-			[pos2 dummy]=find(ismember(md.mesh.elements,pos));
+-			data(pos2,:)=NaN;
+-		elseif length(flags)==md.mesh.numberofelements
+-			data(pos,:)=NaN;
+-		else
+-			disp('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements');
+-		end
+-	end
+-
+-	%log?
+-	if exist(options,'log'),
+-		bounds=getfieldvalue(options,'caxis',[min(data(:)) max(data(:))]);
+-		data(find(data<bounds(1)))=bounds(1);
+-		if any(data<=0),
+-			error('Log option cannot be applied on negative values. Use caxis option (Rignot''s settings: [1.5 max(data)])');
+-		end
+-		pos=find(~isnan(data));
+-		data(pos)=log(data(pos))/log(getfieldvalue(options,'log'));
+-	end
+-end
+-
+-%node data
+-if (datasize(1)==md.mesh.numberofvertices & datasize(2)==1),
+-	datatype=2;
+-
+-	%Mask?
+-	if exist(options,'mask'),
+-		flags=getfieldvalue(options,'mask');
+-		pos=find(~flags);
+-		if length(flags)==md.mesh.numberofvertices,
+-			data(pos,:)=NaN;
+-		elseif length(flags)==md.mesh.numberofelements
+-			data(md.mesh.elements(pos,:),:)=NaN;
+-		else
+-			disp('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements');
+-		end
+-	end
+-
+-	%log?
+-	if exist(options,'log'),
+-		%if any(data<=0),
+-		%	error('Log option cannot be applied on negative values. Use caxis option (Rignot''s settings: [1.5 max(data)])');
+-		%end
+-		data=log(data)/log(getfieldvalue(options,'log'));
+-	end
+-end
+-
+-%layer projection? 
+-if getfieldvalue(options,'layer',0)>=1,
+-	data=project2d(md,data,getfieldvalue(options,'layer')); %project onto 2d mesh
+-end
+-
+-%control arrow density if quiverplot
+-if datatype==3 & exist(options,'density')
+-	databak=data;
+-	data=NaN*ones(datasize);
+-	density=getfieldvalue(options,'density');
+-	data(1:density:end,:)=databak(1:density:end,:);
+-	clear databak
+-end
+-
+-%OK, if datatype=0 error out
+-if datatype==0,
+-	error(['data provided not recognized or not supported']);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor.m	(revision 13009)
+@@ -1,40 +0,0 @@
+-function plot_tensor(md,options,width,i,type);
+-%PLOT_TENSOR - plot tensor components
+-%
+-%   Usage:
+-%      plot_tensor(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-h=subplot(width,width,i); axis off; pos=get(h,'Position');
+-
+-plot_options.offsetx=pos(1);
+-plot_options.offsety=pos(2);
+-plot_options.width=pos(3);
+-plot_options.height=pos(4);
+-
+-%Figure out tensor type:
+-%FIXME does not work anymore
+-if strncmpi(type,'strain',6),
+-	tensor=md.results.strainrate;
+-elseif strncmpi(type,'stress',6),
+-	tensor=md.results.stress;
+-elseif strncmpi(type,'deviatoricstress',16),
+-	tensor=md.results.deviatoricstress;
+-else
+-	error('plot_tensor error message: unsupported type of tensor');
+-end
+-
+-%Figure out type of plot being requested
+-if strncmpi(fliplr(type),fliplr('tensor'),6) | strcmpi(type,'strainrate') | strcmpi(type,'deviatoricstress') | strcmpi(type,'stress'),
+-	plot_tensor_components(md,options,width,i,tensor,type,plot_options);
+-	return;
+-elseif strncmpi(fliplr(type),fliplr('principal'),9),
+-	plot_tensor_principal(md,options,width,i,tensor,type,plot_options);
+-	return;
+-elseif strncmpi(fliplr(type(1:end-1)),fliplr('principalaxis'),13),
+-	plot_tensor_principalaxis(md,options,width,i,tensor,type,plot_options);
+-	return;
+-else
+-	error('plot_tensor error message: unsurported type of plot');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftnumbering.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftnumbering.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_riftnumbering.m	(revision 13009)
+@@ -1,94 +0,0 @@
+-function plot_riftnumbering(md,options,nlines,ncols,index);
+-%PLOT_RIFTNUMBERING - plot rift penetration + numbering of all rift vertices, as well as rift numbers.
+-%
+-%   Usage:
+-%      plot_riftnumbering(md,options,width,i);
+-%
+-%   See also: PLOTMODEL
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-fontsize=getfieldvalue(options,'FontSize',8);
+-
+-subplot(nlines,ncols,index); 
+-hold on
+-
+-%plot mesh boundaries
+-for i=1:size(md.mesh.segments,1),
+-	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');
+-end
+-
+-isp1=0;
+-isp2=0;
+-
+-if isstruct(md.rifts.riftstruct),
+-	%plot mesh boundaries
+-	for i=1:size(md.mesh.segments,1),
+-		h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
+-	end
+-	for i=1:size(md.rifts.riftstruct,1),
+-		penaltypairs=md.rifts.riftstruct(i).penaltypairs;
+-
+-		segments=md.rifts.riftstruct(i).segments;
+-		for j=1:size(segments,1),
+-			plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
+-		end
+-
+-		normal=zeros(2,1);
+-		for j=1:size(penaltypairs,1),
+-			normal(1)=penaltypairs(j,5);
+-			normal(2)=penaltypairs(j,6);
+-
+-			vx1=md.initialization.vx(penaltypairs(j,1)); 
+-			vx2=md.initialization.vx(penaltypairs(j,2));
+-			vy1=md.initialization.vy(penaltypairs(j,1)); 
+-			vy2=md.initialization.vy(penaltypairs(j,2));
+-			penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
+-			%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
+-			if(penetration>0),
+-				p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'ro-','LineWidth',1);
+-				set(p2,'MarkerSize',3);
+-				isp2=1;
+-			else
+-				p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'ko-','LineWidth',1);
+-				set(p1,'MarkerSize',3);
+-				isp1=1;
+-			end
+-		end
+-
+-		%point out the tips
+-		h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g*');
+-		plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g*');
+-	end
+-	if strcmpi(getfieldvalue(options,'legend','on'),'on'),
+-		if isp1 & isp2
+-			l=legend([h1,h2,p1,p2],'mesh boundaries','crack tips','faults','rifts');
+-		elseif isp1
+-			l=legend([h1,h2,p1],'mesh boundaries','crack tips','faults');
+-		elseif isp2
+-			l=legend([h1,h2,p2],'mesh boundaries','crack tips','rifts');
+-		else
+-			l=legend([h1,h2],'mesh boundaries','crack tips');
+-		end
+-		set(l,'Location',getfieldvalue(options,'legend_location','NorthEast'));
+-	end
+-else
+-	error('plot error message: no rifts available!');
+-end
+-
+-%Now, plot rift vertices numbers.
+-for i=1:size(md.rifts.riftstruct,1),
+-	penaltypairs=md.rifts.riftstruct(i).penaltypairs;
+-
+-	for j=1:size(penaltypairs,1),
+-		node=penaltypairs(j,1);
+-		t=text(x(node),y(node),[num2str(i) '.' num2str(j)]);
+-		set(t,'FontSize',fontsize);
+-	end
+-end
+-
+-
+-%apply options
+-options=addfielddefault(options,'title','Rift/Fault location');
+-options=addfielddefault(options,'colorbar',0);
+-applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_quiver.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_quiver.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_quiver.m	(revision 13009)
+@@ -1,26 +0,0 @@
+-function plot_quiver(x,y,u,v,options),
+-%PLOT_QUIVER - quiver plot with colors
+-%
+-%   to be perfected tomorrow
+-%
+-%   Usage:
+-%      plot_quiver(x,y,u,v,options)
+-%
+-%   Example:
+-%      plot_quiver(md.mesh.x,md.mesh.y,md.initialization.vx,md.initialization.vy,options);
+-
+-%process fields
+-[quivers,palette]=quiver_process(x,y,u,v,options);
+-
+-%loop over the number of colors
+-hold on
+-h=[];
+-for i=1:quivers.numcolors
+-	pos=find(quivers.colorind==i);
+-	hprime=quiver(quivers.x(pos),quivers.y(pos),quivers.u(pos),quivers.v(pos),...
+-		'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
+-	h=[h;hprime];
+-end
+-
+-%take care of colorbar
+-quiver_colorbar(quivers,options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_unit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_unit.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_unit.m	(revision 13009)
+@@ -1,92 +0,0 @@
+-function plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
+-%PLOT_UNIT - unit plot, display data
+-%
+-%   Usage:
+-%      plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options);
+-%
+-%   See also: PLOTMODEL, PLOT_MANAGER
+-
+-%edgecolor
+-edgecolor=getfieldvalue(options,'edgecolor','none');
+-
+-switch datatype,
+-
+-	%element plot
+-	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
+-			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);
+-		end
+-
+-	%node plot
+-	case 2,
+-
+-		if is2d,
+-			A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
+-		else
+-			if ~isplanet,
+-				A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-				patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
+-				patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
+-				patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
+-				patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
+-				patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
+-			else
+-				A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-				if size(elements,2)==4, D=elements(:,4); else D=C; end
+-				patch( 'Faces', [A B C D],  'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
+-			end
+-		end
+-
+-	%quiver plot
+-	case 3,
+-
+-		if is2d,
+-			plot_quiver(x,y,data(:,1),data(:,2),options);
+-		else
+-			plot_quiver3(x,y,z,data(:,1),data(:,2),data(:,3),options);
+-		end
+-
+-	%Patch plot P1
+-	case 4,
+-
+-		if is2d,
+-			patch( 'Faces',elements,'Vertices',[x y],'CData',data,'FaceColor','interp','EdgeColor',edgecolor);
+-		else
+-			A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-			patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
+-			patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
+-			patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
+-			patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
+-			patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
+-		end
+-
+-	%Patch plot P0
+-	case 5,
+-
+-		if is2d,
+-			A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+-			patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(:),'FaceColor','flat','EdgeColor',edgecolor);
+-		else
+-			A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+-			patch( 'Faces', [A B C],  'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
+-			patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
+-			patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
+-			patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
+-			patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
+-		end
+-
+-	otherwise,
+-		error(['case ' num2str(datatype) ' not supported']);
+-
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor_components.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor_components.m	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_tensor_components.m	(revision 13009)
+@@ -1,78 +0,0 @@
+-function plot_tensor_components(md,options,width,i,tensor,type,plot_options);
+-%PLOT_TENSOR_COMPONENT - plot component of a tensor
+-%
+-%   Usage:
+-%      plot_tensor_components(md,options,width,i,tensor,type,plot_option);
+-%
+-%   See also: PLOTMODEL, PLOT_UNIT, PLOT_MANAGER
+-
+-%Compute the indexes of the components plots
+-upperplots=fix((i-1)/width);
+-if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
+-if (md.mesh.dimension==2)%3 components -> 3 indexes
+-	index1=4*width*upperplots+2*leftplots+1;
+-	index2=index1+1;
+-	index3=index1+width*2;
+-elseif md.mesh.dimension==3%6 components -> 6 indexes
+-	index1=3*3*width*upperplots+3*leftplots+1;
+-	index2=index1+1;
+-	index3=index1+2;
+-	index4=index1+width*3;
+-	index5=index4+1;
+-	index6=index4+2;
+-end
+-
+-%process data and model
+-[x y z elements is2d isplanet]=processmesh(md,[],options);
+-[tensor.xx datatype]=processdata(md,tensor.xx,options);
+-[tensor.yy datatype]=processdata(md,tensor.yy,options);
+-[tensor.xy datatype]=processdata(md,tensor.xy,options);
+-if  md.mesh.dimension==3
+-	[tensor.xz datatype]=processdata(md,tensor.xz,options);
+-	[tensor.yz datatype]=processdata(md,tensor.yz,options);
+-	[tensor.zz datatype]=processdata(md,tensor.zz,options);
+-end
+-
+-if ((md.mesh.dimension==2)),
+-	subplot(2*width,2*width,index1),
+-	plot_unit(x,y,z,elements,tensor.xx,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'xx')
+-	subplot(2*width,2*width,index2),
+-	plot_unit(x,y,z,elements,tensor.yy,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'yy')
+-	subplot(2*width,2*width,index3),
+-	plot_unit(x,y,z,elements,tensor.xy,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'xy')
+-else
+-	subplot(3*width,3*width,index1),
+-	plot_unit(x,y,z,elements,tensor.xx,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'xx')
+-	subplot(3*width,3*width,index2),
+-	plot_unit(x,y,z,elements,tensor.yy,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'yy')
+-	subplot(3*width,3*width,index3),
+-	plot_unit(x,y,z,elements,tensor.zz,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'zz')
+-	subplot(3*width,3*width,index4),
+-	plot_unit(x,y,z,elements,tensor.xy,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'xy')
+-	subplot(3*width,3*width,index5),
+-	plot_unit(x,y,z,elements,tensor.xz,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'xz')
+-	subplot(3*width,3*width,index6),
+-	plot_unit(x,y,z,elements,tensor.yz,is2d,isplanet,datatype,options)
+-	Apply_options_tensor(md,options,type,'yz')
+-end
+-end
+-
+-function Apply_options_tensor(md,options,type,component)
+-	%apply options
+-	if ismember('_',type) %user plotet stress_tensor
+-		strings=strsplit(type,'_');
+-		string=strings{1};
+-	else %default plot: user requested stress
+-		string=type;
+-	end
+-	options=addfielddefault(options,'title',[upper(string(1)) string(2:end) ' ' component]);
+-	applyoptions(md,[],options);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.py	(revision 13009)
+@@ -0,0 +1,119 @@
++import datetime
++import os
++import shutil
++from pairoptions import *
++from process_solve_options import *
++from EnumDefinitions import *
++from ismodelselfconsistent import *
++
++def solve(md,solutionenum,*args):
++	"""
++	SOLVE - apply solution sequence for this model
++ 
++	   Usage:
++	      md=solve(md,solutionenum,varargin)
++	      where varargin is a list of paired arguments of string OR enums
++ 
++	   solution types available comprise:
++	      - DiagnosticSolutionEnum
++	      - PrognosticSolutionEnum
++	      - ThermalSolutionEnum
++	      - SteadystateSolutionEnum
++	      - TransientSolutionEnum...
++	      - BalancethicknessSolutionEnum
++	      - BedSlopeSolutionEnum
++	      - SurfaceSlopeSolutionEnum
++	      - HydrologySolutionEnum
++	      - FlaimSolutionEnum
++ 
++	   extra options:
++	      - loadonly : does not solve. only load results
++ 
++	   Examples:
++	      md=solve(md,DiagnosticSolutionEnum);
++	"""
++
++	#recover and process solve options
++	options=pairoptions('solution_type',solutionenum,*args)
++	options=process_solve_options(options)
++
++	#recover some fields
++	md.private.solution=options['solution_type']
++	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)
++
++	#First, build a runtime name that is unique
++	c=datetime.datetime.now()
++	md.private.runtimename="%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name,c.month,c.day,c.year,c.hour,c.minute,c.second,os.getpid())
++
++	#if running qmu analysis, some preprocessing of dakota files using models
++	#fields needs to be carried out. 
++	if md.qmu.isdakota:
++		md=preqmu(md,options)
++
++	#flaim analysis
++	if options['solution_type'] == FlaimSolutionEnum:
++		md=flaim_sol(md,options)
++		md.private.solution=EnumToString(options['solution_type'])
++		return md
++
++	#Do we load results only?
++	if options['loadonly']:  
++		md=loadresultsfromcluster(md)
++		return md
++
++	#Wite all input files
++	marshall(md)                                           # bin file
++	md.solver.PetscFile(md.miscellaneous.name+'.petsc')    # petsc file
++	cluster.BuildQueueScript(md.miscellaneous.name,md.private.runtimename,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
++
++	#we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
++	if not ispetsc:
++		print "PETSC support not included, running on 1 cpu only!"
++		cluster.np=1
++
++	#Stop here if batch mode
++	if strcmpi(options['batch'],'yes'):
++		print 'batch mode requested: not launching job interactively'
++		print 'launch solution sequence on remote cluster by hand'
++		return md
++
++	#Launch job
++	modelname = md.miscellaneous.name
++	filelist  = [modelname+'.bin ',modelname+'.petsc ',modelname+'.queue ']
++	if md.qmu.isdakota:
++		filelist.append(modelname+'.qmu.in')
++	cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist)
++
++	#did we even try to run? if so, wait on lock
++	if strcmpi(options['upload'],'on'):
++		print 'solve done uploading test decks'
++		return md
++
++	#wait on lock
++	if md.settings.waitonlock>0:
++		#we wait for the done file
++		islock=waitonlock(md)
++		if islock==0:    #no results to be loaded
++			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
++		else:            #load results
++			print 'loading results from cluster'
++			md=loadresultsfromcluster(md)
++
++	#post processes qmu results if necessary
++	if md.qmu.isdakota:
++		if not strncmpi(options['keep'],'y',1):
++			shutil.rmtree('qmu'+str(os.getpid()))
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.m	(revision 13009)
+@@ -0,0 +1,260 @@
++function WriteData(fid,varargin)
++%WRITEDATA - write model field in binary file
++%
++%   Usage:
++%      WriteData(fid,varargin);
++
++%process options
++options=pairoptions(varargin{:});
++
++%Get data properties
++if exist(options,'object');
++	%This is a object field, construct enum and data
++	obj       = getfieldvalue(options,'object');
++	fieldname = getfieldvalue(options,'fieldname');
++	classname = class(obj);
++
++	enum      = BuildEnum([classname '_' fieldname]);
++	data      = obj.(fieldname);
++else
++	%No processing required
++	data = getfieldvalue(options,'data');
++	enum = getfieldvalue(options,'enum');
++end
++format  = getfieldvalue(options,'format');
++mattype = getfieldvalue(options,'mattype',0);    %only required for matrices
++
++%Process sparse matrices
++if issparse(data),
++	data=full(data);
++end
++
++%Step 1: write the enum to identify this record uniquely
++fwrite(fid,enum,'int'); 
++
++%Step 2: write the data itself.
++if     strcmpi(format,'Boolean'),% {{{
++	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
++
++	%first write length of record
++	fwrite(fid,4+4,'int');  %1 bool (disguised as an int)+code
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%now write integer
++	fwrite(fid,data,'int');  %send an int, not easy to send a bool
++	% }}}
++elseif strcmpi(format,'Integer'), % {{{
++	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
++
++	%first write length of record
++	fwrite(fid,4+4,'int');  %1 integer + code
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%now write integer
++	fwrite(fid,data,'int'); 
++	% }}}
++elseif strcmpi(format,'Double'), % {{{
++	if(numel(data)~=1), error(['field ' EnumToString(enum) ' cannot be marshalled as it has more than one element!']); end
++
++	%first write length of record
++	fwrite(fid,8+4,'int');  %1 double+code
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%now write double
++	fwrite(fid,data,'double'); 
++	% }}}
++elseif strcmpi(format,'String'), % {{{
++	%first write length of record
++	fwrite(fid,length(data)+4+4,'int');  %string + string size + code
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%now write string
++	fwrite(fid,length(data),'int'); 
++	fwrite(fid,data,'char'); 
++	% }}}
++elseif strcmpi(format,'BooleanMat'), % {{{
++
++	%Get size
++	s=size(data);
++	%if matrix = NaN, then do not write anything
++	if (s(1)==1 & s(2)==1 & isnan(data)),
++		s(1)=0; s(2)=0;
++	end
++
++	%first write length of record
++	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
++
++	%write data code and matrix type: 
++	fwrite(fid,FormatToCode(format),'int'); 
++	fwrite(fid,mattype,'int');
++
++	%now write matrix
++	fwrite(fid,s(1),'int'); 
++	fwrite(fid,s(2),'int'); 
++	if s(1)*s(2),
++		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
++	end
++	% }}}
++elseif strcmpi(format,'IntMat'), % {{{
++
++	%Get size
++	s=size(data);
++	%if matrix = NaN, then do not write anything
++	if (s(1)==1 & s(2)==1 & isnan(data)),
++		s(1)=0; s(2)=0;
++	end
++
++	%first write length of record
++	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
++
++	%write data code and matrix type: 
++	fwrite(fid,FormatToCode(format),'int'); 
++	fwrite(fid,mattype,'int');
++
++	%now write matrix
++	fwrite(fid,s(1),'int'); 
++	fwrite(fid,s(2),'int'); 
++	if s(1)*s(2),
++		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
++	end
++	% }}}
++elseif strcmpi(format,'DoubleMat'), % {{{
++
++	%Get size
++	s=size(data);
++	%if matrix = NaN, then do not write anything
++	if (s(1)==1 & s(2)==1 & isnan(data)),
++		s(1)=0; s(2)=0;
++	end
++
++	%first write length of record
++	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
++
++	%write data code and matrix type: 
++	fwrite(fid,FormatToCode(format),'int'); 
++	fwrite(fid,mattype,'int');
++
++	%now write matrix
++	fwrite(fid,s(1),'int'); 
++	fwrite(fid,s(2),'int'); 
++	if s(1)*s(2),
++		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
++	end
++	% }}}
++elseif strcmpi(format,'MatArray'), % {{{
++
++	numrecords=numel(data);
++
++	%first get length of record
++	recordlength=4+4; %number of records + code
++	for i=1:numrecords,
++		matrix=data{i};
++		s=size(matrix);
++		recordlength=recordlength+4*2+... %row and col of matrix
++			s(1)*s(2)*8; %matrix of doubles
++	end
++
++	%write length of record
++	fwrite(fid,recordlength,'int'); 
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%write data, first number of records
++	fwrite(fid,numrecords,'int'); 
++
++	%write each matrix: 
++	for i=1:numrecords,
++		matrix=data{i};
++		s=size(matrix);
++		fwrite(fid,s(1),'int'); 
++		fwrite(fid,s(2),'int'); 
++		fwrite(fid,matrix','double');
++	end
++	% }}}
++elseif strcmpi(format,'StringArray'), % {{{
++
++	%first get length of string array: 
++	num=numel(data);
++	%now get length of record: 
++	recordlength=4+4; %for length of array + code
++	for i=1:num,
++		string=data{i};
++		recordlength=recordlength+4+length(string); %for each string
++	end
++
++	%write length of record
++	fwrite(fid,recordlength,'int'); 
++
++	%write data code: 
++	fwrite(fid,FormatToCode(format),'int'); 
++
++	%now write length of string array
++	fwrite(fid,num,'int'); 
++
++	%now write the strings
++	for i=1:num,
++		string=data{i};
++		fwrite(fid,length(string),'int'); 
++		fwrite(fid,string,'char'); 
++	end
++	% }}}
++else  % {{{
++	error(['WriteData error message: data type: ' num2str(format) ' not supported yet! (' EnumToString(enum) ')']);
++end % }}}
++end
++
++function enum=BuildEnum(string) % {{{
++%BUILDENUM - build enum out of string
++%
++%   Usage:
++%      enum=BuildEnum(string)
++
++	if findstr(string,'_'),
++		indices=findstr(string,'_');
++		for i=1:length(indices),
++			string(indices(i)+1)=upper(string(indices(i)+1));
++		end
++		string(indices)=[];
++	end
++
++	%take first letter of string and make it uppercase: 
++	string(1)=upper(string(1));
++
++	%Get Enum
++	enum=eval([string 'Enum();']); 
++end % }}}
++function code=FormatToCode(format) % {{{
++%This routine takes the format string, and hardcodes it into an integer, which 
++%is passed along the record, in order to identify the nature of the dataset being 
++%sent.
++	if     strcmpi(format,'Boolean'),
++		code=1;
++	elseif strcmpi(format,'Integer'), 
++		code=2;
++	elseif strcmpi(format,'Double'), 
++		code=3;
++	elseif strcmpi(format,'String'), 
++		code=4;
++	elseif strcmpi(format,'BooleanMat'),
++		code=5;
++	elseif strcmpi(format,'IntMat'),
++		code=6;
++	elseif strcmpi(format,'DoubleMat'),
++		code=7;
++	elseif strcmpi(format,'MatArray'), 
++		code=8;
++	elseif strcmpi(format,'StringArray'),
++		code=9;
++	else 
++		error('FormatToCode error message: data type not supported yet!');
++	end
++end% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.m	(revision 13009)
+@@ -0,0 +1,60 @@
++function md=loadresultsfromcluster(md,runtimename)
++%LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
++%
++%   Usage:
++%      md=loadresultsfromcluster(md,runtimename);
++
++%retrieve cluster, to be able to call its methods
++cluster=md.cluster;
++
++if nargin==2,
++	md.private.runtimename=runtimename;
++end
++
++%Download outputs from the cluster
++filelist={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
++if md.qmu.isdakota,
++	filelist{end+1}=[md.miscellaneous.name '.qmu.err'];
++	filelist{end+1}=[md.miscellaneous.name '.qmu.out'];
++	if isfield(md.qmu.params,'tabular_graphics_data'),
++		if md.qmu.params.tabular_graphics_data==true,
++			filelist{end+1}='dakota_tabular.dat';
++		end
++	end
++else
++	filelist{end+1}=[md.miscellaneous.name '.outbin'];
++end
++Download(cluster,md.private.runtimename,filelist);
++
++%If we are here, no errors in the solution sequence, call loadresultsfromdisk.
++md=loadresultsfromdisk(md,[md.miscellaneous.name '.outbin']);
++
++%erase the log and output files
++if md.qmu.isdakota,
++	delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.outlog']);
++	delete([['qmu' num2str(feature('GetPid')) '/']  md.miscellaneous.name '.errlog']);
++else
++	delete([md.miscellaneous.name '.outlog']);
++	delete([md.miscellaneous.name '.errlog']);
++	delete([md.miscellaneous.name '.outbin']);
++	if ~ispc,
++		delete([md.private.runtimename '.tar.gz']);
++	end
++end
++
++%erase input file if run was carried out on same platform.
++hostname=oshostname();
++if strcmpi(hostname,cluster.name),
++	if md.qmu.isdakota,
++		delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.bin']);
++		delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.queue']);
++	else
++		delete([md.miscellaneous.name '.bin']);
++		delete([md.miscellaneous.name '.petsc']);
++		if ~ispc,
++			delete([md.miscellaneous.name '.queue']);
++		else
++			delete([md.miscellaneous.name '.bat']);
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 13009)
+@@ -0,0 +1,235 @@
++import struct
++import numpy
++from MatlabFuncs import *
++from MatlabProcessPatch import *
++
++def parseresultsfromdisk(filename,iosplit):
++	"""
++	PARSERESULTSFROMDISK - ...
++
++	   Usage:
++	      results=parseresultsfromdisk(filename,iosplit)
++	"""
++
++	if iosplit:
++		results=parseresultsfromdiskiosplit(filename)
++	else:
++		results=parseresultsfromdiskioserial(filename)
++
++	#process patch if necessary
++	results=MatlabProcessPatch(results)
++
++	return results
++
++def parseresultsfromdiskioserial(filename):    # {{{
++	"""
++	PARSERESULTSFROMDISK - ...
++	 
++	    Usage:
++	       results=parseresultsfromdiskioserial(filename)
++	"""
++
++	#Open file
++	try:
++		fid=open(filename,'rb')
++	except IOError as e:
++		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
++
++	results={}
++
++	#Read fields until the end of the file.
++	result=ReadData(fid)
++	while result:
++		#Get time and step
++		if not result['step'] in results:
++			results[result['step']]={}
++			results[result['step']]['step']=result['step']
++			results[result['step']]['time']=result['time'] 
++	
++		#Add result
++		if result['step'] in results and \
++		   result['fieldname'] in results[result['step']] and \
++		   not strcmp(result['fieldname'],'SolutionType'):
++			results[result['step']][result['fieldname']]=numpy.concatenate((results[result['step']][result['fieldname']],result['field']),axis=0)
++		else:
++			results[result['step']][result['fieldname']]=result['field']
++
++		#read next result
++		result=ReadData(fid)
++
++	fid.close()
++
++	return results
++	# }}}
++
++def parseresultsfromdiskiosplit(filename):    # {{{
++	"""
++	PARSERESULTSFROMDISKIOSPLIT - ...
++	 
++	    Usage:
++	       results=parseresultsfromdiskiosplit(filename)
++	"""
++
++	#Open file
++	try:
++		fid=open(filename,'rb')
++	except IOError as e:
++		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
++
++	results={}
++
++	#if we have done split I/O, ie, we have results that are fragmented across patches, 
++	#do a first pass, and figure out the structure of results
++	result=ReadDataDimensions(fid)
++	while result:
++
++		#Get time and step
++		if not result['step'] in results:
++			results[result['step']]={}
++			results[result['step']]['step']=result['step']
++			results[result['step']]['time']=result['time'] 
++
++		#Add result
++		if strcmpi(result['fieldname'],'Patch'):
++			results[result['step']][result['fieldname']]=[0,result['N']]
++		else:
++			results[result['step']][result['fieldname']]=float('NaN')
++
++		#read next result
++		result=ReadDataDimensions(fid)
++
++	#do a second pass, and figure out the size of the patches
++	fid.seek(0)    #rewind
++	result=ReadDataDimensions(fid)
++	while result:
++
++		#Add result
++		if strcmpi(result['fieldname'],'Patch'):
++			patchdimensions=results[result['step']][result['fieldname']]
++			results[result['step']][result['fieldname']]=[patchdimensions[0]+result['M'],result['N']]
++
++		#read next result
++		result=ReadDataDimensions(fid)
++
++	#allocate patches
++	for result in results.itervalues():
++		if 'Patch' in result:
++			result['Patch']=numpy.zeros(shape=(result['Patch'][0],result['Patch'][1]),dtype=float)
++			result['counter']=0    #use to index into the patch
++
++	#third pass, this time to read the real information
++	fid.seek(0)    #rewind
++	result=ReadData(fid)
++	while result:
++
++		#Get time and step
++		if not result['step'] in results:
++			results[result['step']]={}
++			results[result['step']]['step']=result['step']
++			results[result['step']]['time']=result['time'] 
++
++		#Add result
++		if strcmpi(result['fieldname'],'Patch'):
++			counter=results[result['step']]['counter']
++			counter2=counter+result['field'].shape[0]-1
++			results[result['step']][result['fieldname']][counter:counter2,:]=result['field']
++
++			#increment counter: 
++			results[result['step']]['counter']=counter2+1
++		else:
++			results[result['step']][result['fieldname']]=result['field']
++
++		#read next result
++		result=ReadData(fid)
++
++	#close file
++	fid.close()
++
++	return results
++	# }}}
++
++def ReadData(fid):    # {{{
++	"""
++	READDATA - ...
++	 
++	    Usage:
++	       field=ReadData(fid)
++	"""
++
++	#read field
++	try:
++		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
++		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
++		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		if   type==1:
++			field=numpy.array(struct.unpack('%dd' % M,fid.read(M*struct.calcsize('d'))),dtype=float)
++		elif type==2:
++			field=struct.unpack('%ds' % M,fid.read(M))[0][:-1]
++		elif type==3:
++			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++#			field=transpose(fread(fid,[N M],'double'));
++			field=numpy.zeros(shape=(M,N),dtype=float)
++			for i in xrange(M):
++				field[i,:]=struct.unpack('%dd' % N,fid.read(N*struct.calcsize('d')))
++		else:
++			raise TypeError("cannot read data of type %d" % type)
++
++		result={}
++		result['fieldname']=fieldname
++		result['time']=time
++		result['step']=step
++		result['field']=field
++
++	except struct.error as e:
++		result={}
++
++	return result
++	# }}}
++
++def ReadDataDimensions(fid):    # {{{
++	"""
++	READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
++	 
++	    Usage:
++	       field=ReadDataDimensions(fid)
++	"""
++
++	#read field
++	try:
++		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
++		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
++		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++
++		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++		N=1    #default
++		if   type==1:
++			fid.seek(M*8,1)
++		elif type==2:
++			fid.seek(M,1)
++		elif type==3:
++			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
++			fid.seek(N*M*8,1)
++		else:
++			raise TypeError("cannot read data of type %d" % type)
++
++		result={}
++		result['fieldname']=fieldname
++		result['time']=time
++		result['step']=step
++		result['M']=M
++		result['N']=N
++
++	except struct.error as e:
++		result={}
++
++	return result
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.m	(revision 13009)
+@@ -0,0 +1,121 @@
++function md=solve(md,solutionenum,varargin)
++%SOLVE - apply solution sequence for this model
++%
++%   Usage:
++%      md=solve(md,solutionenum,varargin)
++%      where varargin is a lit of paired arguments of string OR enums
++%
++%   solution types available comprise:
++%		 - DiagnosticSolutionEnum
++%		 - PrognosticSolutionEnum
++%		 - ThermalSolutionEnum
++%		 - SteadystateSolutionEnum
++%		 - TransientSolutionEnum...
++%		 - BalancethicknessSolutionEnum
++%		 - BedSlopeSolutionEnum
++%		 - SurfaceSlopeSolutionEnum
++%		 - HydrologySolutionEnum
++%		 - FlaimSolutionEnum
++%
++%  extra options:
++%      - loadonly : does not solve. only load results
++%
++%   Examples:
++%      md=solve(md,DiagnosticSolutionEnum);
++
++%recover and process solve options
++options=pairoptions(varargin{:},'solution_type',solutionenum);
++options=process_solve_options(options);
++
++%recover some fields
++md.private.solution=options.solution_type;
++cluster=md.cluster;
++
++%check model consistency
++disp('checking model consistency');
++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
++
++%First, build a runtime name that is unique
++c=clock;
++md.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',md.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
++
++%if running qmu analysis, some preprocessing of dakota files using models
++%fields needs to be carried out. 
++if md.qmu.isdakota,
++	md=preqmu(md,options);
++end
++
++%flaim analysis
++if (options.solution_type == FlaimSolutionEnum)
++	md=flaim_sol(md,options);
++	md.private.solution=EnumToString(options.solution_type);
++	return;
++end
++
++%Do we load results only?
++if options.loadonly,  
++	md=loadresultsfromcluster(md);
++	return;
++end
++
++%we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
++if ~ispetsc,
++	disp('PETSC support not included, running on 1 cpu only!');
++	cluster.np=1;
++end
++
++
++%Wite all input files
++marshall(md);                                          % bin file
++PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file
++BuildQueueScript(cluster,md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); % queue file
++
++
++%Stop here if batch mode
++if strcmpi(options.batch,'yes')
++	disp('batch mode requested: not launching job interactively');
++	disp('launch solution sequence on remote cluster by hand');
++	return;
++end
++
++%Launch job
++modelname = md.miscellaneous.name;
++filelist  = {[modelname '.bin '] [modelname '.petsc '] [modelname '.queue ']};
++if md.qmu.isdakota,
++	filelist{end+1} = [modelname '.qmu.in'];
++end
++LaunchQueueJob(cluster,md.miscellaneous.name,md.private.runtimename,filelist);
++
++%did we even try to run? if so, wait on lock
++if strcmpi(options.upload,'on'),
++	disp('solve done uploading test decks');
++	return;
++end
++
++%wait on lock
++if md.settings.waitonlock>0,
++	%we wait for the done file
++	islock=waitonlock(md);
++	if islock==0, %no results to be loaded
++		disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
++	else          %load results
++		disp('loading results from cluster');
++		md=loadresultsfromcluster(md);
++	end
++end
++
++%post processes qmu results if necessary
++if md.qmu.isdakota,
++	if ~strncmpi(options.keep,'y',1)
++		system(['rm -rf qmu' num2str(feature('GetPid'))]);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 13009)
+@@ -0,0 +1,212 @@
++function results=parseresultsfromdisk(filename,iosplit)
++%PARSERESULTSFROMDISK - ...
++%
++%   Usage:
++%      results=parseresultsfromdisk(filename,iosplit)
++
++if iosplit,
++	results=parseresultsfromdiskiosplit(filename);
++else
++	results=parseresultsfromdiskioserial(filename);
++end
++
++%process patch if necessary
++results=MatlabProcessPatch(results);
++
++function results=parseresultsfromdiskioserial(filename) % {{{
++%PARSERESULTSFROMDISK - ...
++%
++%   Usage:
++%      results=parseresultsfromdiskioserial(filename)
++
++
++%Open file
++fid=fopen(filename,'rb');
++if(fid==-1),
++	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
++end
++results=struct();
++
++%Read fields until the end of the file.
++result=ReadData(fid);
++while ~isempty(result), 
++	%Get time and step
++	results(result.step).step=result.step;
++	results(result.step).time=result.time; 
++
++	%Add result
++	if (length(results)>=result.step & isfield(results,result.fieldname) & ~strcmp(result.fieldname,'SolutionType')),
++			results(result.step).(result.fieldname)=[ results(result.step).(result.fieldname); result.field];
++	else
++		results(result.step).(result.fieldname)=result.field;
++	end
++
++	%read next result
++	result=ReadData(fid);
++
++end
++
++fclose(fid);
++% }}}
++function results=parseresultsfromdiskiosplit(filename) % {{{
++%PARSERESULTSFROMDISKIOSPLIT - ...
++%
++%   Usage:
++%      results=parseresultsfromdiskiosplit(filename)
++
++
++%Open file
++fid=fopen(filename,'rb');
++if(fid==-1),
++	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
++end
++results=struct();
++
++%if we have done split I/O, ie, we have results that are fragmented across patches, 
++%do a first pass, and figure out the structure of results
++result=ReadDataDimensions(fid);
++while ~isempty(result),
++
++	%Get time and step
++	results(result.step).step=result.step;
++	results(result.step).time=result.time; 
++
++	%Add result
++	if strcmpi(result.fieldname,'Patch'),
++		results(result.step).(result.fieldname)=[0 result.N];
++	else
++		results(result.step).(result.fieldname)=NaN;
++	end
++
++	%read next result
++	result=ReadDataDimensions(fid);
++end
++
++%do a second pass, and figure out the size of the patches
++fseek(fid,0,-1); %rewind
++result=ReadDataDimensions(fid);
++while ~isempty(result),
++
++	%Add result
++	if strcmpi(result.fieldname,'Patch'),
++		patchdimensions=results(result.step).(result.fieldname);
++		results(result.step).(result.fieldname)=[patchdimensions(1)+result.M result.N];
++	end
++
++	%read next result
++	result=ReadDataDimensions(fid);
++end
++
++%allocate patches
++for i=1:length(results),
++	results(i).Patch=zeros(results(i).Patch(1),results(i).Patch(2));
++	results(i).counter=1; %use to index into the patch
++end
++
++%third pass, this time to read the real information
++fseek(fid,0,-1); %rewind
++result=ReadData(fid);
++while ~isempty(result),
++
++	%Get time and step
++	results(result.step).step=result.step;
++	results(result.step).time=result.time; 
++
++	%Add result
++	if strcmpi(result.fieldname,'Patch'),
++		counter=results(result.step).counter;
++		counter2=counter+size(result.field,1)-1;
++		results(result.step).(result.fieldname)(counter:counter2,:)=result.field;
++
++		%increment counter: 
++		results(result.step).counter=counter2+1;
++	else
++		results(result.step).(result.fieldname)=result.field;
++	end
++
++	%read next result
++	result=ReadData(fid);
++
++end
++
++%close file
++fclose(fid);
++	% }}}
++function result=ReadData(fid) % {{{
++%READDATA - ...
++%
++%   Usage:
++%      field=ReadData(fid)
++
++%read field
++[length,count]=fread(fid,1,'int');
++
++if count==0,
++	result=struct([]);
++else
++	fieldname=fread(fid,length,'char');
++	fieldname=fieldname(1:end-1)';
++	fieldname=char(fieldname);
++	time=fread(fid,1,'double');
++	step=fread(fid,1,'int');
++
++	type=fread(fid,1,'int');
++	M=fread(fid,1,'int');
++	if type==1,
++		field=fread(fid,M,'double');
++	elseif type==2,
++		field=fread(fid,M,'char');
++		field=char(field(1:end-1)');
++	elseif type==3,
++		N=fread(fid,1,'int');
++		field=transpose(fread(fid,[N M],'double'));
++	else
++		error(['cannot read data of type ' num2str(type) ]);
++	end
++
++	result.fieldname=fieldname;
++	result.time=time;
++	result.step=step;
++	result.field=field;
++end
++% }}}
++function result=ReadDataDimensions(fid) % {{{
++%READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
++%
++%   Usage:
++%      field=ReadDataDimensions(fid)
++
++
++%read field
++[length,count]=fread(fid,1,'int');
++
++if count==0,
++	result=struct([]);
++else
++	fieldname=fread(fid,length,'char');
++	fieldname=fieldname(1:end-1)';
++	fieldname=char(fieldname);
++	time=fread(fid,1,'double');
++	step=fread(fid,1,'int');
++
++	type=fread(fid,1,'int');
++	M=fread(fid,1,'int');
++	N=1; %default
++	if type==1,
++		fseek(fid,M*8,0);
++	elseif type==2,
++		fseek(fid,M,0);
++	elseif type==3,
++		N=fread(fid,1,'int');
++		fseek(fid,N*M*8,0);
++	else
++		error(['cannot read data of type ' num2str(type) ]);
++	end
++
++	result.fieldname=fieldname;
++	result.time=time;
++	result.step=step;
++	result.M=M;
++	result.N=N;
++end
++% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13009)
+@@ -0,0 +1,60 @@
++import os
++
++def loadresultsfromdisk(md,filename):
++	"""
++	LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
++ 
++	   Usage:
++	      md=loadresultsfromdisk(md=False,filename=False);
++	"""
++
++	#check number of inputs/outputs
++	if not md or not filename:
++		raise ValueError("loadresultsfromdisk: error message.")
++
++	if not md.qmu.isdakota:
++
++		#Check that file exists
++		if not os.path.exists(filename):
++			raise ValueError("binary file '%s' not found." % filename)
++
++		#initialize md.results if not a structure yet
++		if not isinstance(md.results,dict):
++			md.results={}
++
++		#load results onto model
++		structure=parseresultsfromdisk(filename,~md.settings.io_gather)
++		if not len(structure):
++			raise RuntimeError("No result found in binary file '%s'. Check for solution crash." % filename)
++		end
++		md.results[structure[1]['SolutionType']]=structure;
++
++		#recover solution_type from results
++		md.private.solution=structure[1]['SolutionType']
++
++		#read log files onto fields
++		if os.path.exists(md.miscellaneous.name+'.errlog'):
++			with open(md.miscellaneous.name+'.errlog','r') as f:
++				md.results[structure[1]['SolutionType']]['errlog']=[line[:-1] for line in f]
++		else:
++			md.results[structure[1]['SolutionType']]['errlog']=[]
++
++		if os.path.exists(md.miscellaneous.name+'.outlog'):
++			with open(md.miscellaneous.name+'.outlog','r') as f:
++				md.results[structure[1]['SolutionType']]['outlog']=[line[:-1] for line in f]
++		else:
++			md.results[structure[1]['SolutionType']]['outlog']=[]
++
++		if len(md.results[structure[1]['SolutionType']]['errlog']):
++			print ("loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields.")
++
++	#post processes qmu results if necessary
++	else:
++
++		if not isinstance(md.private.solution,str):
++			md.private.solution=EnumToString(md.private.solution)
++		md=postqmu(md)
++		os.chdir('..')
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py	(revision 13009)
+@@ -0,0 +1,48 @@
++import os
++from EnumDefinitions import *
++
++def process_solve_options(options):
++	"""
++	DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
++ 
++	   Usage:
++	      options=process_solve_options(options)
++ 
++	   See also: SOLVE
++	"""
++
++	outoptions={}
++
++	#solution_type: check on this option, error out otherwise
++	solution_type=options.getfieldvalue('solution_type')
++	if not solution_type in (DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,\
++			SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,\
++			BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum):
++		raise ValueError("process_solve_options error message: solution_type '%s' not supported yet!" % EnumToString(solution_type))
++	outoptions['solution_type']=solution_type
++
++	outoptions['upload']=options.getfieldvalue('upload','off')
++	outoptions['batch']=options.getfieldvalue('batch','no')
++	outoptions['loadonly']=options.getfieldvalue('loadonly',False)
++	outoptions['directory']=options.getfieldvalue('directory','')
++
++	#  process qmu arguments
++	outoptions['qmudir']=options.getfieldvalue('qmudir','qmu'+str(os.getpid()))
++	outoptions['qmufile']=options.getfieldvalue('qmufile','qmu')    # qmufile cannot be changed unless ????script.sh is also changed
++	outoptions['overwrite']=options.getfieldvalue('overwrite','n')
++	outoptions['keep']=options.getfieldvalue('keep','n')
++	outoptions['ivar']=options.getfieldvalue('ivar',1)
++	outoptions['iresp']=options.getfieldvalue('iresp',1)
++	outoptions['imethod']=options.getfieldvalue('imethod',1)
++	outoptions['iparams']=options.getfieldvalue('iparams',1)
++	outoptions['runmpi']=options.getfieldvalue('runmpi',False)
++
++	#  process flaim arguments
++	outoptions['fmdir']=options.getfieldvalue('fmdir','fm'+str(os.getpid()))
++	outoptions['overwrite']=options.getfieldvalue('overwrite','n')
++	outoptions['keep']=options.getfieldvalue('keep','y')
++	outoptions['latsgn']=options.getfieldvalue('latsgn',0)
++	outoptions['cmap']=options.getfieldvalue('cmap',[])
++
++	return outoptions
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py	(revision 13009)
+@@ -0,0 +1,47 @@
++from WriteData import *
++
++def marshall(md):
++	"""
++	MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
++
++	   The routine creates a compatible binary file from @model md
++	   This binary file will be used for parallel runs in JPL-package
++
++	   Usage:
++	      marshall(md)
++	"""
++
++	print "marshalling file '%s.bin'." % md.miscellaneous.name
++
++	#open file for binary writing
++	try:
++		fid=open(md.miscellaneous.name+'.bin','wb')
++	except IOError as e:
++		raise IOError("marshall error message: could not open '%s.bin' file for binary writing." % md.miscellaneous.name)
++
++	#First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
++	WriteData(fid,'enum',MaximumNumberOfEnums(),'data',True,'format','Boolean')
++
++	#Go through all model fields: check that it is a class and call checkconsistency
++	fields=vars(md)
++
++	for field in fields.iterkeys():
++
++		#Some properties do not need to be marshalled
++		if field in ['results','radaroverlay','solver','cluster','flaim','private']:
++			continue
++
++		#Check that current field is an object
++		if not hasattr(getattr(md,field),'marshall'):
++			raise TypeError("field '%s' is not an object." % field)
++
++		#Marshall current object
++		#print "marshalling %s ..." % field
++		exec("md.%s.marshall(fid)" % field)
++
++	#close file
++	try:
++		f.close(fid)
++	except IOError as e:
++		raise IOError("marshall error message: could not close file '%s.bin'." % md.miscellaneous.name)
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.m	(revision 13009)
+@@ -0,0 +1,61 @@
++function md=loadresultsfromdisk(md,filename)
++%LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
++%
++%   Usage:
++%      md=loadresultsfromdisk(md,filename);
++
++%check number of inputs/outputs
++if ((nargin~=2) | (nargout~=1)),
++	help loadresultsfromdisk;
++	error('loadresultsfromdisk: error message.');
++end
++
++if ~md.qmu.isdakota,
++
++	%Check that file exists
++	if ~exist(filename,'file'),
++		error(['binary file ' filename ' not found.']);
++	end
++
++	%initialize md.results if not a structure yet
++	if ~isstruct(md.results),
++		md.results=struct();
++	end
++
++	%load results onto model
++	structure=parseresultsfromdisk(filename,~md.settings.io_gather);
++	if isempty(fieldnames(structure)),
++		error(['No result found in binary file ' filename '. Check for solution crash.']);
++	end
++	md.results.(structure(1).SolutionType)=structure;
++
++	%recover solution_type from results
++	md.private.solution=structure(1).SolutionType;
++
++	%read log files onto  fields
++	if exist([md.miscellaneous.name '.errlog'],'file'),
++		md.results.(structure(1).SolutionType)(1).errlog=char(textread([md.miscellaneous.name '.errlog'],'%s','delimiter','\n'));
++	else
++		md.results.(structure(1).SolutionType)(1).errlog='';
++	end
++
++	if exist([md.miscellaneous.name '.outlog'],'file'),
++		md.results.(structure(1).SolutionType)(1).outlog=char(textread([md.miscellaneous.name '.outlog'],'%s','delimiter','\n'));
++	else
++		md.results.(structure(1).SolutionType)(1).outlog='';
++	end
++
++	if ~isempty(md.results.(structure(1).SolutionType)(1).errlog),
++		disp(['loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields']);
++	end
++
++
++%post processes qmu results if necessary
++else
++
++	if isscalar(md.private.solution),
++		md.private.solution=EnumToString(md.private.solution);
++	end
++	md=postqmu(md);
++	cd ..
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.m	(revision 13009)
+@@ -0,0 +1,39 @@
++function outoptions=process_solve_options(options)
++%DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
++%
++%   Usage:
++%      options=process_solve_options(options)
++%
++%   See also: SOLVE
++
++%solution_type: check on this option, error out otherwise
++solution_type=getfieldvalue(options,'solution_type');
++if ~ismember(solution_type,[DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,...
++		SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,...
++		BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum]),
++	error(['process_solve_options error message: solution_type ' EnumToString(solution_type) ' not supported yet!']);
++end
++outoptions.solution_type=solution_type;
++
++outoptions.upload=getfieldvalue(options,'upload','off');
++outoptions.batch=getfieldvalue(options,'batch','no');
++outoptions.loadonly=getfieldvalue(options,'loadonly',false);
++outoptions.directory=getfieldvalue(options,'directory','');
++
++%  process qmu arguments
++outoptions.qmudir=getfieldvalue(options,'qmudir',['qmu' num2str(feature('GetPid'))]);  % qmudir =['qmu_' datestr(now,'yyyymmdd_HHMMSS')];
++outoptions.qmufile=getfieldvalue(options,'qmufile','qmu');% qmufile cannot be changed unless ????script.sh is also changed
++outoptions.overwrite=getfieldvalue(options,'overwrite','n');
++outoptions.keep=getfieldvalue(options,'keep','n');
++outoptions.ivar=getfieldvalue(options,'ivar',1);
++outoptions.iresp=getfieldvalue(options,'iresp',1);
++outoptions.imethod=getfieldvalue(options,'imethod',1);
++outoptions.iparams=getfieldvalue(options,'iparams',1);
++outoptions.runmpi=getfieldvalue(options,'runmpi',false);
++
++%  process flaim arguments
++outoptions.fmdir=getfieldvalue(options,'fmdir',['fm' num2str(feature('GetPid'))]);
++outoptions.overwrite=getfieldvalue(options,'overwrite','n');
++outoptions.keep=getfieldvalue(options,'keep','y');
++outoptions.latsgn=getfieldvalue(options,'latsgn',0);
++outoptions.cmap=getfieldvalue(options,'cmap',[]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadmultipleresultsfromcluster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadmultipleresultsfromcluster.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadmultipleresultsfromcluster.m	(revision 13009)
+@@ -0,0 +1,34 @@
++function md_list=loadmultipleresultsfromcluster(md_list)
++%LOADMULTIPLERESULTSFROMCLUSTER - load multiple results of solution sequences from cluster
++%
++%   Usage:
++%      md_list=loadresultsfromcluster(md_list);
++
++nummodels=length(md_list);
++
++%Get cluster settings
++cluster=md_list{1}.cluster;
++name=md_list{1}.name;
++cluster_rc_location=which('cluster.rc');
++[codepath,executionpath,login]=ClusterParameters(cluster,cluster_rc_location);
++
++%Remote tar: 
++disp('tarring results');
++issmssh(cluster,['"cd ' executionpath ' && rm -rf file_list.txt ModelResults.tar.gz && find -iname ''*_*vs*.outbin'' > file_list.txt && tar zcvf ModelResults.tar.gz --files-from file_list.txt  && rm -rf file_list.txt "']);
++
++%copy results from cluster to present directory
++scpin(cluster, executionpath, {'ModelResults.tar.gz'});
++
++%untar:
++!tar -zxvf ModelResults.tar.gz
++
++%ok, go through list and load results from disk: 
++for i=1:nummodels,
++	%load  results for this model
++	md_list{i}=loadresultsfromdisk(md_list{i},[md_list{i}.name '.outbin']);
++
++	delete([name '.outbin']);
++end
++
++%erase files 
++delete('ModelResults.tar.gz');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.m	(revision 13009)
+@@ -0,0 +1,49 @@
++function marshall(md)
++%MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
++%
++%   The routine creates a compatible binary file from @model md
++%   This binary file will be used for parallel runs in JPL-package
++%
++%   Usage:
++%      marshall(md)
++
++disp(['marshalling file ' md.miscellaneous.name '.bin']);
++
++%open file for binary writing
++fid=fopen([ md.miscellaneous.name '.bin'],'wb');
++if fid==-1,
++	error(['marshall error message: could not open ' [md.miscellaneous.name '.bin'],' file for binary writing']);
++end
++
++%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
++WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
++
++%Go through all model fields: check that it is a class and call checkconsistency
++fields=properties('model');
++for i=1:length(fields),
++	field=fields{i};
++
++	%Some properties do not need to be marshalled
++	if ismember(field,{'results' 'radaroverlay' 'solver' 'cluster'  'flaim' 'private'}),
++		continue;
++	end
++
++	%Check that current field is an object
++	if ~isobject(md.(field))
++		error(['field ''' char(field) ''' is not an object']);
++	end
++
++	%Marshall current object
++	%disp(['marshalling ' field '...']);
++	if verLessThan('matlab', '7.6')
++		marshall(md.(field),fid);
++	else
++		md.(field).marshall(fid);
++	end
++end
++
++%close file
++st=fclose(fid);
++if st==-1,
++	error(['marshall error message: could not close file ' [md.miscellaneous.name '.bin']]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.py	(revision 13009)
+@@ -0,0 +1,64 @@
++import os
++import socket
++import time
++from MatlabFuncs import *
++
++def waitonlock(md,executionpath,login,port):
++	"""
++	WAITONLOCK - wait for a file
++ 
++	   This routine will return when a file named 'filename' is written to disk.
++	   If the time limit given in input is exceeded, return 0
++ 
++	   Usage:
++	      flag=waitonlock(md,executionpath)
++	"""
++
++	#Get filename (lock file) and options
++	executionpath=md.cluster.executionpath
++	cluster=md.cluster.name
++	login=md.cluster.login
++	port=md.cluster.port
++	timelimit=md.settings.waitonlock
++	filename=os.path.join(executionpath,md.private.runtimename,md.miscellaneous.name+'.lock')
++
++	#waitonlock will work if the lock is on the same machine only: 
++	if not strcmpi(socket.gethostname().lower().split('.')[0],cluster):
++
++		print 'solution launched on remote cluster. log in to detect job completion.'
++		choice=raw_input('Is the job successfully completed? (y/n) ')
++		if not strcmp(choice,'y'): 
++			print 'Results not loaded... exiting' 
++			flag=0
++		else:
++			flag=1
++
++	#job is running on the same machine
++	else:
++
++		if 'interactive' in vars(md.cluster) and md.cluster.interactive:
++			#We are in interactive mode, no need to check for job completion
++			flag=1
++			return flag
++		#initialize time and file presence test flag
++		etime=0
++		ispresent=0
++		print "waiting for '%s' hold on... (Ctrl+C to exit)" % filename
++
++		#loop till file .lock exist or time is up
++		while ispresent==0 and etime<timelimit:
++			ispresent=os.path.exist(filename)
++			time.sleep(1)
++			etime+=1/60
++
++		#build output
++		if etime>timelimit:
++			print 'Time limit exceeded. Increase md.settings.waitonlock'
++			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
++			raise RuntimeError('waitonlock error message: time limit exceeded.')
++			flag=0
++		else:
++			flag=1
++
++	return flag
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.m	(revision 13009)
+@@ -0,0 +1,58 @@
++function flag=waitonlock(md,executionpath,login,port)
++%WAITONLOCK - wait for a file
++%
++%   This routine will return when a file named 'filename' is written to disk.
++%   If the time limit given in input is exceeded, return 0
++%
++%   Usage:
++%      flag=waitonlock(md,executionpath)
++
++%Get filename (lock file) and options
++executionpath=md.cluster.executionpath;
++cluster=md.cluster.name;
++login=md.cluster.login;
++port=md.cluster.port;
++timelimit=md.settings.waitonlock;
++filename=[executionpath '/' md.private.runtimename '/' md.miscellaneous.name '.lock'];
++
++%waitonlock will work if the lock is on the same machine only: 
++if ~strcmpi(oshostname(),cluster),
++
++	disp('solution launched on remote cluster. log in to detect job completion.');
++	choice=input('Is the job successfully completed? (y/n)','s');
++	if ~strcmp(choice,'y'), 
++		disp('Results not loaded... exiting'); 
++		flag=0;
++	else
++		flag=1;
++	end
++
++%job is running on the same machine
++else
++
++	if ismember('interactive',properties(md.cluster)) & md.cluster.interactive
++		%We are in interactive mode, no need to check for job completion
++		flag=1;
++		return;
++	end
++	%initialize time and file presence test flag
++	time=0; ispresent=0;
++	disp(['waiting for ' filename ' hold on... (Ctrl+C to exit)'])
++
++	%loop till file .lock exist or time is up
++	while (ispresent==0 & time<timelimit)
++		ispresent=exist(filename,'file');
++		pause(1);
++		time=time+1/60;
++	end
++
++	%build output
++	if (time>timelimit),
++		disp('Time limit exceeded. Increase md.settings.waitonlock');
++		disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
++		error(['waitonlock error message: time limit exceeded']);
++		flag=0;
++	else
++		flag=1;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.py	(revision 13009)
+@@ -0,0 +1,19 @@
++def MatlabProcessPatch(structure):
++	"""
++	PROCESSPATCH - create a structure from a patch
++ 
++	   Usage:
++	      Result=ProcessPatch(Result);
++	"""
++
++	#loop over steps
++	for structurei in structure.itervalues():
++
++		#return if there is no field Patch
++		if not 'Patch' in structurei:
++			continue
++
++		raise SystemError("MatlabProcessPatch not implemented in Python.")
++
++	return structure
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.py	(revision 13009)
+@@ -0,0 +1,95 @@
++from AnalysisConfiguration import *
++from EnumDefinitions import *
++
++def AnalysisConfiguration(solutiontype): #{{{
++	"""
++	ANALYSISCONFIGURATION - return type of analyses, number of analyses 
++
++		Usage:
++			[analyses, numanalyses]=AnalysisConfiguration(solutiontype);
++	"""
++
++	if   solutiontype == DiagnosticSolutionEnum:
++		numanalyses=5
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum]
++
++	elif solutiontype == SteadystateSolutionEnum:
++		numanalyses=7 
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum]
++
++	elif solutiontype == ThermalSolutionEnum:
++		numanalyses=2 
++		analyses=[ThermalAnalysisEnum,MeltingAnalysisEnum]
++
++	elif solutiontype == EnthalpySolutionEnum:
++		numanalyses=1 
++		analyses=[EnthalpyAnalysisEnum]
++
++	elif solutiontype == PrognosticSolutionEnum:
++		numanalyses=1 
++		analyses=[PrognosticAnalysisEnum]
++
++	elif solutiontype == BalancethicknessSolutionEnum:
++		numanalyses=1 
++		analyses=[BalancethicknessAnalysisEnum]
++
++	elif solutiontype == SurfaceSlopeSolutionEnum:
++		numanalyses=1 
++		analyses=[SurfaceSlopeAnalysisEnum]
++
++	elif solutiontype == BedSlopeSolutionEnum:
++		numanalyses=1 
++		analyses=[BedSlopeAnalysisEnum]
++
++	elif solutiontype == TransientSolutionEnum:
++		numanalyses=9 
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum,EnthalpyAnalysisEnum,PrognosticAnalysisEnum]
++
++	elif solutiontype == FlaimSolutionEnum:
++		numanalyses=1 
++		analyses=[FlaimAnalysisEnum]
++
++	elif solutiontype == HydrologySolutionEnum:
++		numanalyses=3 
++		analyses=[BedSlopeAnalysisEnum,SurfaceSlopeAnalysisEnum,HydrologyAnalysisEnum]
++
++	else:
++		raise TypeError("solution type: '%s' not supported yet!" % EnumToString(solutiontype))
++
++	return analyses,numanalyses
++#}}}
++
++def ismodelselfconsistent(md):
++	"""
++	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
++
++	   Usage:
++	      ismodelselfconsistent(md),
++	"""
++
++	#initialize consistency as true
++	md.private.isconsistent=True
++
++	#Get solution and associated analyses
++	solution=md.private.solution
++	analyses,numanalyses=AnalysisConfiguration(solution)
++
++	#Go through a model fields, check that it is a class, and call checkconsistency
++	fields=vars(md)
++	for field in fields.iterkeys():
++
++		#Some properties do not need to be checked
++		if field in ['results','debug','radaroverlay']:
++			continue
++
++		#Check that current field is an object
++		if not hasattr(getattr(md,field),'checkconsistency'):
++			md.checkmessage("field '%s' is not an object." % field)
++
++		#Check consistency of the object
++		exec("md.%s.checkconsistency(md,solution,analyses)" % field)
++
++	#error message if mode is not consistent
++	if not md.private.isconsistent:
++		raise RuntimeError('Model not consistent, see messages above.')
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.m	(revision 13009)
+@@ -0,0 +1,65 @@
++function structure=MatlabProcessPatch(structure);
++%PROCESSPATCH - create a structure from a patch
++%
++%   Usage:
++%      Result=ProcessPatch(Result);
++
++%return if there is no field Patch
++if (~isfield(structure,'Patch')),
++	return;
++end
++
++%loop over steps
++for i=1:length(structure),
++
++	%Get Patch for current step
++	Patch=structure(i).Patch;
++	numvertices=structure(i).PatchVertices;
++
++	%check that Patch is not empty
++	if length(Patch)==0 continue; end
++
++	%Get number of fields;
++	fields=unique(Patch(:,1));
++	steps=unique(Patch(:,2));
++
++	%parse steps
++	for j=1:length(steps),
++
++		posstep=find(Patch(:,2)==steps(j));
++
++		%Take all the lines of the Patch for this timestep
++		temporarypatch=Patch(posstep,:);
++		time=temporarypatch(1,3);
++		step=temporarypatch(1,2);
++
++		%parse fields
++		for i=1:length(fields),
++
++			%get name
++			fieldname=EnumToString(fields(i));
++
++			%get line positions
++			pos=find(temporarypatch(:,1)==fields(i));
++
++			%Fill Result structure
++			structure(step).steps=step;
++			structure(step).time=time;
++			structure(step).(fieldname).element=temporarypatch(pos,4);
++			structure(step).(fieldname).interpolation=temporarypatch(pos,5);
++			structure(step).(fieldname).index=temporarypatch(pos,6:5+numvertices);
++			if structure(step).(fieldname).interpolation==P1Enum,
++				structure(step).(fieldname).value=temporarypatch(pos,6+numvertices:end);
++			end
++			if structure(step).(fieldname).interpolation==P0Enum,
++				structure(step).(fieldname).value=temporarypatch(pos,6+numvertices);
++			end
++
++		end
++	end
++end
++
++%remove fields
++structure=rmfield(structure,'Patch');
++structure=rmfield(structure,'PatchVertices');
++structure=rmfield(structure,'PatchNodes');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.m	(revision 13009)
+@@ -0,0 +1,100 @@
++function ismodelselfconsistent(md),
++%ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
++%
++%   Usage:
++%      ismodelselfconsistent(md),
++
++%initialize consistency as true
++md.private.isconsistent=true;
++
++%Get solution and associated analyses
++solution=md.private.solution;
++[analyses,numanalyses]=AnalysisConfiguration(solution);
++
++%Go through a model field, check that it is a class, and call checkconsistency
++fields=properties('model');
++for i=1:length(fields),
++	field=fields{i};
++
++	%Some properties do not need to be checked
++	if ismember(field,{'results' 'debug' 'radaroverlay'}),
++		continue;
++	end
++
++	%Check that current field is an object
++	if ~isobject(md.(field))
++		md=checkmessage(md,['field ''' char(field) ''' is not an object']);
++	end
++
++	%Check consistency of the object
++	if verLessThan('matlab', '7.6')
++		md=checkconsistency(md.(field),md,solution,analyses);
++	else
++		md=md.(field).checkconsistency(md,solution,analyses);
++	end
++end
++
++%error message if mode is not consistent
++if md.private.isconsistent==false,
++	error('Model not consistent, see messages above');
++end
++end
++
++function [analyses,numanalyses]=AnalysisConfiguration(solutiontype), % {{{
++%ANALYSISCONFIGURATION - return type of analyses, number of analyses 
++%
++%   Usage:
++%      [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
++
++
++
++switch solutiontype,
++
++	case DiagnosticSolutionEnum,
++		numanalyses=5;
++		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum];
++
++	case SteadystateSolutionEnum,
++		numanalyses=7; 
++		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum];
++
++	case ThermalSolutionEnum,
++		numanalyses=2; 
++		analyses=[ThermalAnalysisEnum;MeltingAnalysisEnum];
++
++	case EnthalpySolutionEnum,
++		numanalyses=1; 
++		analyses=[EnthalpyAnalysisEnum];
++
++	case PrognosticSolutionEnum,
++		numanalyses=1; 
++		analyses=[PrognosticAnalysisEnum];
++
++	case BalancethicknessSolutionEnum,
++		numanalyses=1; 
++		analyses=[BalancethicknessAnalysisEnum];
++
++	case SurfaceSlopeSolutionEnum,
++		numanalyses=1; 
++		analyses=[SurfaceSlopeAnalysisEnum];
++
++	case BedSlopeSolutionEnum,
++		numanalyses=1; 
++		analyses=[BedSlopeAnalysisEnum];
++
++	case TransientSolutionEnum,
++		numanalyses=9; 
++		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;EnthalpyAnalysisEnum;PrognosticAnalysisEnum];
++
++	case FlaimSolutionEnum,
++		numanalyses=1; 
++		analyses=[FlaimAnalysisEnum];
++
++	case HydrologySolutionEnum,
++		numanalyses=3; 
++		analyses=[BedSlopeAnalysisEnum;SurfaceSlopeAnalysisEnum;HydrologyAnalysisEnum];
++
++	otherwise
++		error('%s%s%s',' solution type: ',EnumToString(solutiontype),' not supported yet!');
++
++end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13009)
+@@ -0,0 +1,274 @@
++import numpy
++import math
++import struct
++from MatlabFuncs import *
++
++def WriteData(fid,*args):
++	"""
++	WRITEDATA - write model field in binary file
++ 
++	   Usage:
++	      WriteData(fid,varargin)
++	"""
++
++	#process options
++	options=pairoptions(*args)
++
++	#Get data properties
++	if options.exist('object'):
++		#This is an object field, construct enum and data
++		obj       = options.getfieldvalue('object')
++		fieldname = options.getfieldvalue('fieldname')
++		classname = type(obj)
++
++		enum      = BuildEnum(classname+'_'+fieldname)
++		data      = getattr(obj,fieldname)
++	else:
++		#No processing required
++		data = options.getfieldvalue('data')
++		enum = options.getfieldvalue('enum')
++	format  = options.getfieldvalue('format')
++	mattype = options.getfieldvalue('mattype',0)    #only required for matrices
++
++	#Process sparse matrices
++#	if issparse(data),
++#		data=full(data);
++#	end
++
++	#Step 1: write the enum to identify this record uniquely
++	fid.write(struct.pack('i',enum)) 
++
++	#Step 2: write the data itself.
++	if   strcmpi(format,'Boolean'):    # {{{
++		if len(data) !=1:
++			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
++
++		#first write length of record
++		fid.write(struct.pack('i',4+4))  #1 bool (disguised as an int)+code
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#now write integer
++		fid.write(struct.pack('i',data))  #send an int, not easy to send a bool
++		# }}}
++
++	elif strcmpi(format,'Integer'):    # {{{
++		if len(data) !=1:
++			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
++
++		#first write length of record
++		fid.write(struct.pack('i',4+4))  #1 integer + code
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#now write integer
++		fid.write(struct.pack('i',data)) 
++		# }}}
++
++	elif strcmpi(format,'Double'):    # {{{
++		if len(data) !=1:
++			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
++
++		#first write length of record
++		fid.write(struct.pack('i',8+4))  #1 double+code
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#now write double
++		fid.write(struct.pack('d',data)) 
++		# }}}
++
++	elif strcmpi(format,'String'):    # {{{
++		#first write length of record
++		fid.write(struct.pack('i',len(data)+4+4))  #string + string size + code
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#now write string
++		fid.write(struct.pack('i',len(data))) 
++		fid.write(struct.pack('%ds' % len(data),data)) 
++		# }}}
++
++	elif strcmpi(format,'BooleanMat'):    # {{{
++
++		#Get size
++		s=data.shape
++		#if matrix = NaN, then do not write anything
++		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
++			s[0]=0
++			s[1]=0
++
++		#first write length of record
++		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
++
++		#write data code and matrix type: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++		fid.write(struct.pack('i',mattype))
++
++		#now write matrix
++		fid.write(struct.pack('i',s[0])) 
++		fid.write(struct.pack('i',s[1])) 
++		for i in xrange(s[0]):
++			for j in xrange(s[1]):
++				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
++		# }}}
++
++	elif strcmpi(format,'IntMat'):    # {{{
++
++		#Get size
++		s=data.shape
++		#if matrix = NaN, then do not write anything
++		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
++			s[0]=0
++			s[1]=0
++
++		#first write length of record
++		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
++
++		#write data code and matrix type: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++		fid.write(struct.pack('i',mattype))
++
++		#now write matrix
++		fid.write(struct.pack('i',s[0])) 
++		fid.write(struct.pack('i',s[1])) 
++		for i in xrange(s[0]):
++			for j in xrange(s[1]):
++				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
++		# }}}
++
++	elif strcmpi(format,'DoubleMat'):    # {{{
++
++		#Get size
++		s=data.shape
++		#if matrix = NaN, then do not write anything
++		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
++			s[0]=0
++			s[1]=0
++
++		#first write length of record
++		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
++
++		#write data code and matrix type: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++		fid.write(struct.pack('i',mattype))
++
++		#now write matrix
++		fid.write(struct.pack('i',s[0])) 
++		fid.write(struct.pack('i',s[1])) 
++		for i in xrange(s[0]):
++			for j in xrange(s[1]):
++				fid.write(struct.pack('d',data[i][j]))    #get to the "c" convention, hence the transpose
++		# }}}
++
++	elif strcmpi(format,'MatArray'):    # {{{
++
++		#first get length of record
++		recordlength=4+4    #number of records + code
++		for matrix in data:
++			s=matrix.shape
++			recordlength+=4*2+s[0]*s[1]*8    #row and col of matrix + matrix of doubles
++
++		#write length of record
++		fid.write(struct.pack('i',recordlength)) 
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#write data, first number of records
++		fid.write(struct.pack('i',len(data))) 
++
++		#write each matrix: 
++		for matrix in data:
++			s=matrix.shape
++			fid.write(struct.pack('i',s[0])) 
++			fid.write(struct.pack('i',s[1])) 
++			for i in xrange(s[0]):
++				for j in xrange(s[1]):
++					fid.write(struct.pack('d',matrix[i][j]))
++		# }}}
++
++	elif strcmpi(format,'StringArray'):    # {{{
++
++		#first get length of record
++		recordlength=4+4    #for length of array + code
++		for string in data:
++			recordlength+=4+len(string)    #for each string
++
++		#write length of record
++		fid.write(struct.pack('i',recordlength)) 
++
++		#write data code: 
++		fid.write(struct.pack('i',FormatToCode(format))) 
++
++		#now write length of string array
++		fid.write(struct.pack('i',len(data))) 
++
++		#now write the strings
++		for string in data:
++			fid.write(struct.pack('i',len(string))) 
++			fid.write(struct.pack('%ds' % len(string),string)) 
++		# }}}
++
++	else:    # {{{
++		raise TypeError('WriteData error message: data type: %d not supported yet! (%s)' % (format,EnumToString(enum)))
++	# }}}
++
++def BuildEnum(string): # {{{
++	"""
++	BUILDENUM - build enum out of string
++ 
++    Usage:
++       enum=BuildEnum(string)
++	"""
++
++	if '_' in string:
++		substrs=string.split('_')
++		string=''
++		for str in substrs:
++			string+=str[0].upper()+str[1:]
++	else:
++		#take first letter of string and make it uppercase: 
++		string=str[0].upper()+str[1:]
++
++	#Get Enum
++	exec('enum='+string+'Enum()',globals())
++
++	return enum
++# }}}
++
++def FormatToCode(format): # {{{
++	"""
++	This routine takes the format string, and hardcodes it into an integer, which 
++	is passed along the record, in order to identify the nature of the dataset being 
++	sent.
++	"""
++
++	if   strcmpi(format,'Boolean'):
++		code=1
++	elif strcmpi(format,'Integer'):
++		code=2
++	elif strcmpi(format,'Double'):
++		code=3
++	elif strcmpi(format,'String'):
++		code=4
++	elif strcmpi(format,'BooleanMat'):
++		code=5
++	elif strcmpi(format,'IntMat'):
++		code=6
++	elif strcmpi(format,'DoubleMat'):
++		code=7
++	elif strcmpi(format,'MatArray'):
++		code=8
++	elif strcmpi(format,'StringArray'):
++		code=9
++	else:
++		raise InputError('FormatToCode error message: data type not supported yet!')
++
++	return code
++# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13009)
+@@ -0,0 +1,61 @@
++import os
++import platform
++import socket
++from MatlabFuncs import *
++
++def loadresultsfromcluster(md,runtimename=False):
++	"""
++	LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
++ 
++	   Usage:
++	      md=loadresultsfromcluster(md,runtimename);
++	"""
++
++	#retrieve cluster, to be able to call its methods
++	cluster=md.cluster
++
++	if runtimename:
++		md.private.runtimename=runtimename
++	end
++
++	#Download outputs from the cluster
++	filelist=[md.miscellaneous.name+'.outlog',md.miscellaneous.name+'.errlog']
++	if md.qmu.isdakota:
++		filelist.append(md.miscellaneous.name+'.qmu.err')
++		filelist.append(md.miscellaneous.name+'.qmu.out')
++		if 'tabular_graphics_data' in md.qmu.params:
++			if md.qmu.params['tabular_graphics_data']:
++				filelist.append('dakota_tabular.dat')
++		filelist.append(md.miscellaneous.name+'.outbin')
++	Download(cluster,md.private.runtimename,filelist)
++
++	#If we are here, no errors in the solution sequence, call loadresultsfromdisk.
++	md=loadresultsfromdisk(md,md.miscellaneous.name+'.outbin')
++
++	#erase the log and output files
++	if md.qmu.isdakota:
++		os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.outlog'))
++		os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.errlog'))
++	else:
++		os.remove(md.miscellaneous.name+'.outlog')
++		os.remove(md.miscellaneous.name+'.errlog')
++		os.remove(md.miscellaneous.name+'.outbin')
++		if not 'Windows' in platform.system():
++			os.remove(md.private.runtimename+'.tar.gz')
++
++	#erase input file if run was carried out on same platform.
++	hostname=socket.gethostname().lower().split('.')[0]
++	if strcmpi(hostname,cluster.name):
++		if md.qmu.isdakota:
++			os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.bin'))
++			os.remove(os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name+'.queue'))
++		else:
++			os.remove(md.miscellaneous.name+'.bin')
++			os.remove(md.miscellaneous.name+'.petsc')
++			if not 'Windows' in platform.system():
++				os.remove(md.miscellaneous.name+'.queue')
++			else:
++				os.remove(md.miscellaneous.name+'.bat')
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/misfit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/misfit.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/misfit.m	(revision 13009)
+@@ -0,0 +1,37 @@
++function J=misfit(md)
++%MISFIT - compute misfit
++%
++%   Usage:
++%      J=misfit(md)
++%
++%   Example:
++%      J=misfit(md)
++%
++
++if md.mesh.dimension==2,
++	elements=md.mesh.elements;
++	x=md.mesh.x;
++	y=md.mesh.y;
++	vx=md.initialization.vx;
++	vy=md.initialization.vy;
++	vx_obs=md.inversion.vx_obs;
++	vy_obs=md.inversion.vy_obs;
++else
++	elements=md.mesh.elements2d;
++	x=md.mesh.x2d;
++	y=md.mesh.y2d;
++	vx=project2d(md,md.initialization.vx,md.mesh.numberoflayers);
++	vy=project2d(md,md.initialization.vy,md.mesh.numberoflayers);
++	vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers);
++	vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers);
++end
++
++%compute areas;
++areas=GetAreas(elements,x,y);
++
++%compute delta v on elements
++deltav=1/2*(   (vx-vx_obs).^2+(vy-vy_obs).^2)/md.constants.yts^2;
++deltav_elem=deltav(elements)*[1;1;1]/3;
++
++%compute misfit
++J=sum(deltav_elem.*areas);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/parametercontroldrag.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/parametercontroldrag.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/parametercontroldrag.m	(revision 13009)
+@@ -0,0 +1,121 @@
++function md=parametercontroldrag(md,varargin),
++%PARAMETERCONTROLDRAG - parameterization for control method on drag
++%
++%   It is possible to specify the number of steps, values for the
++%   minimum and maximum values of the drag, the 
++%   kind of cm_responses to use or the the optscal.
++%   
++%   Usage:
++%       md=parametercontroldrag(md,varargin)
++%
++%   Example:
++%      md=parametercontroldrag(md)
++%      md=parametercontroldrag(md,'nsteps',20,'cm_responses',0)
++%      md=parametercontroldrag(md,'cm_min',1,'cm_max',150,'cm_jump',0.99,'maxiter',20)
++%      md=parametercontroldrag(md,eps_cm',10^-4,'optscal',[10^7 10^8])
++%
++%   See also PARAMETERCONTROLB
++
++%process options
++options=pairoptions(varargin{:});
++
++%control type
++md.inversion.control_parameters={'FrictionCoefficient'};
++
++%weights
++weights=getfieldvalue(options,'weights',ones(md.mesh.numberofvertices,1));
++if (length(weights)~=md.mesh.numberofvertices)
++	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++else
++	md.inversion.cost_functions_coefficients=weights;
++end
++
++%nsteps
++nsteps=getfieldvalue(options,'nsteps',100);
++if (length(nsteps)~=1 | nsteps<=0 | floor(nsteps)~=nsteps)
++	md.inversion.nsteps=100;
++else
++	md.inversion.nsteps=nsteps;
++end
++
++%cm_min
++cm_min=getfieldvalue(options,'cm_min',1*ones(md.mesh.numberofvertices,1));
++if (length(cm_min)==1)
++	md.inversion.min_parameters=cm_min*ones(md.mesh.numberofvertices,1);
++elseif (length(cm_min)==md.mesh.numberofvertices)
++	md.inversion.min_parameters=cm_min;
++else
++	md.inversion.min_parameters=cm_min;
++end
++
++%cm_max
++cm_max=getfieldvalue(options,'cm_max',250*ones(md.mesh.numberofvertices,1));
++if (length(cm_max)==1)
++	md.inversion.max_parameters=cm_max*ones(md.mesh.numberofvertices,1);
++elseif (length(cm_max)==md.mesh.numberofvertices)
++	md.inversion.max_parameters=cm_max;
++else
++	md.inversion.max_parameters=cm_max;
++end
++
++%eps_cm
++eps_cm=getfieldvalue(options,'eps_cm',NaN);
++if (length(eps_cm)~=1 | eps_cm<0 )
++	md.inversion.cost_function_threshold=NaN;
++else
++	md.inversion.cost_function_threshold=eps_cm;
++end
++
++%maxiter
++maxiter=getfieldvalue(options,'maxiter',10*ones(md.inversion.nsteps,1));
++if (any(maxiter<0) | any(floor(maxiter)~=maxiter))
++	md.inversion.maxiter_per_step=10*ones(md.inversion.nsteps,1);
++else
++	md.inversion.maxiter_per_step=repmat(maxiter(:),md.inversion.nsteps,1);
++	md.inversion.maxiter_per_step(md.inversion.nsteps+1:end)=[];
++end
++
++%cm_jump
++cm_jump=getfieldvalue(options,'cm_jump',0.8*ones(md.inversion.nsteps,1));
++if ~isreal(cm_jump)
++	md.inversion.step_threshold=0.8*ones(md.inversion.nsteps,1);
++else
++	md.inversion.step_threshold=repmat(cm_jump(:),md.inversion.nsteps,1);
++	md.inversion.step_threshold(md.inversion.nsteps+1:end)=[];
++end
++
++%cm_responses
++found=0;
++if exist(options,'cm_responses'),
++	cm_responses=getfieldvalue(options,'cm_responses');
++	if ~any(~ismember(cm_responses,[101 105]))
++		md.inversion.cost_functions=repmat(cm_responses(:),md.inversion.nsteps,1);
++		md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
++		found=1;
++	end
++end
++if ~found
++	third=ceil(md.inversion.nsteps/3);
++	md.inversion.cost_functions=[...
++		103*ones(third,1);...
++		101*ones(third,1);...
++		repmat([101;101;103;101],third,1)...
++		];
++	md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
++end
++
++%optscal
++found=0;
++if exist(options,'optscal'),
++	optscal=getfieldvalue(options,'optscal');
++	if ~any(optscal<0),
++		md.inversion.gradient_scaling=repmat(optscal(:),md.inversion.nsteps,1);
++		md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
++		found=1;
++	end
++end
++if ~found
++	third=ceil(md.inversion.nsteps/3);
++	md.inversion.gradient_scaling=[50*ones(3,1);15*ones(third-3,1);10*ones(third,1);repmat([10;10;20;10],third,1)];
++	md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/parametercontrolB.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/parametercontrolB.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/parametercontrolB.m	(revision 13009)
+@@ -0,0 +1,122 @@
++function md=parametercontrolB(md,varargin),
++%PARAMETERCONTROLB - parameterization for control method on B
++%
++%   It is possible to specify the number of steps, values for the
++%   minimum and maximum values of B, the 
++%   kind of cm_responses to use or the the optscal.
++%   
++%   Usage:
++%       md=parametercontrolB(md,varargin)
++%
++%   Example:
++%      md=parametercontrolB(md)
++%      md=parametercontrolB(md,'nsteps',20,'cm_responses',0)
++%      md=parametercontrolB(md,'cm_min',10,'cm_max',10^8,'cm_jump',0.99,'maxiter',20)
++%      md=parametercontrolB(md,eps_cm',10^-4,'optscal',[10^7 10^8])
++%
++%   See also  PARAMETERCONTROLDRAG
++
++%process options
++options=pairoptions(varargin{:});
++
++%control type
++md.inversion.control_parameters={'MaterialsRheologyBbar'};
++
++%weights
++weights=getfieldvalue(options,'weights',ones(md.mesh.numberofvertices,1));
++if (length(weights)~=md.mesh.numberofvertices)
++	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++else
++	md.inversion.cost_functions_coefficients=weights;
++end
++
++%nsteps
++nsteps=getfieldvalue(options,'nsteps',100);
++if (length(nsteps)~=1 | nsteps<=0 | floor(nsteps)~=nsteps)
++	md.inversion.nsteps=100;
++else
++	md.inversion.nsteps=nsteps;
++end
++
++
++%cm_min
++cm_min=getfieldvalue(options,'cm_min',paterson(273.15+5)*ones(md.mesh.numberofvertices,1));
++if (length(cm_min)==1)
++	md.inversion.min_parameters=cm_min*ones(md.mesh.numberofvertices,1);
++elseif (length(cm_min)==md.mesh.numberofvertices)
++	md.inversion.min_parameters=cm_min;
++else
++	md.inversion.min_parameters=cm_min;
++end
++
++%cm_max
++cm_max=getfieldvalue(options,'cm_max',paterson(273.15-70)*ones(md.mesh.numberofvertices,1));
++if (length(cm_max)==1)
++	md.inversion.max_parameters=cm_max*ones(md.mesh.numberofvertices,1);
++elseif (length(cm_max)==md.mesh.numberofvertices)
++	md.inversion.max_parameters=cm_max;
++else
++	md.inversion.max_parameters=cm_max;
++end
++
++%eps_cm
++eps_cm=getfieldvalue(options,'eps_cm',NaN);
++if (length(eps_cm)~=1 | eps_cm<0 )
++	md.inversion.cost_function_threshold=NaN;
++else
++	md.inversion.cost_function_threshold=eps_cm;
++end
++
++%maxiter
++maxiter=getfieldvalue(options,'maxiter',10*ones(md.inversion.nsteps,1));
++if (any(maxiter<0) | any(floor(maxiter)~=maxiter))
++	md.inversion.maxiter_per_step=10*ones(md.inversion.nsteps,1);
++else
++	md.inversion.maxiter_per_step=repmat(maxiter(:),md.inversion.nsteps,1);
++	md.inversion.maxiter_per_step(md.inversion.nsteps+1:end)=[];
++end
++
++%cm_jump
++cm_jump=getfieldvalue(options,'cm_jump',0.9*ones(md.inversion.nsteps,1));
++if ~isreal(cm_jump)
++	md.inversion.step_threshold=0.9*ones(md.inversion.nsteps,1);
++else
++	md.inversion.step_threshold=repmat(cm_jump(:),md.inversion.nsteps,1);
++	md.inversion.step_threshold(md.inversion.nsteps+1:end)=[];
++end
++
++%cm_responses
++found=0;
++if exist(options,'cm_responses'),
++	cm_responses=getfieldvalue(options,'cm_responses');
++	if ~any(~ismember(cm_responses,[ 101:105])),
++		md.inversion.cost_functions=repmat(cm_responses(:),md.inversion.nsteps,1);
++		md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
++		found=1;
++	end
++end
++if ~found
++	third=ceil(md.inversion.nsteps/3);
++	md.inversion.cost_functions=[...
++		103*ones(third,1);...
++		101*ones(third,1);...
++		repmat([101;101;103;101],third,1)...
++		];
++	md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
++end
++
++%optscal
++found=0;
++if exist(options,'optscal'),
++	optscal=getfieldvalue(options,'optscal');
++	if ~any(optscal<0),
++		md.inversion.gradient_scaling=repmat(optscal(:),md.inversion.nsteps,1);
++		md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
++		found=1;
++	end
++end
++if ~found
++	third=ceil(md.inversion.nsteps/3);
++	md.inversion.gradient_scaling=[2*10^8*ones(3,1);10^8*ones(third-3,1);10^7*ones(2*third,1);];
++	md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJob.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJob.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJob.m	(revision 13009)
+@@ -0,0 +1,21 @@
++function LaunchMultipleQueueJob(cluster,name,executionpath)
++%LAUNCHMULTIPLEQUEUEJOB - ...
++%
++%   Usage:
++%      LaunchMultipleQueueJob(executionpath)
++
++%First try and figure out if there is a special script for thie particular cluster
++function_name=['LaunchMultipleQueueJob' cluster];
++
++%some specific treatment of identical cluster, gemini, castor and pollux
++if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
++	function_name='LaunchMultipleQueueJobgemini';
++end
++
++if exist(function_name,'file'),
++	%Call this function:
++	eval([function_name '(cluster,name,executionpath);']);
++else
++	%Call the generic LaunchMultipleQueueJob:
++	LaunchMultipleQueueJobGeneric(cluster,name,executionpath);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptgemini.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptgemini.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptgemini.m	(revision 13009)
+@@ -0,0 +1,23 @@
++function BuildQueueingScriptgemini(name,executionpath,codepath)
++%BUILDQUEUEINGSCRIPTGEMINI - ...
++%
++%   Usage:
++%      BuildQueueingScriptgemini(md,executionpath,codepath)
++
++scriptname=[name '.queue'];
++
++fid=fopen(scriptname,'w');
++if fid==-1,
++	error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']);
++end
++
++fprintf(fid,'#!/bin/sh\n');
++fprintf(fid,'cd %s\n',executionpath);
++fprintf(fid,'mkdir %s\n',name);
++fprintf(fid,'cd %s\n',name);
++fprintf(fid,'mv ../ModelList.tar.gz ./\n');
++fprintf(fid,'tar -zxvf ModelList.tar.gz\n');
++fprintf(fid,'foreach i (%s-*vs*.queue)\n',name);
++fprintf(fid,'qsub $i\n');
++fprintf(fid,'end\n');
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobgemini.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobgemini.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobgemini.m	(revision 13009)
+@@ -0,0 +1,22 @@
++function md=LaunchMultipleQueueJobgemini(cluster,name,executionpath)
++%LAUNCHMULTIPLEQUEUEJOBGEMINI - Launch multiple queueing script on Gemini cluster
++%
++%   Usage:
++%      LaunchMultipleQueueJobgemini(cluster,name,executionpath)
++
++
++%first, check we have the binary file and the queueing script
++if ~exist([ name '.queue'],'file'),
++	error('LaunchMultipleQueueJobgemini error message: queueing script issing, cannot go forward');
++end
++
++if ~exist('ModelList.tar.gz','file'),
++	error('LaunchMultipleQueueJobgemini error message: inputs models file missing, cannot go forward');
++end
++
++%upload both files to cluster
++disp('uploading input file,  queueing script and variables script');
++eval(['!scp ModelList.tar.gz ' name '.queue '  cluster ':' executionpath]);
++
++disp('launching solution sequence on remote cluster');
++issmssh(cluster,login,['"cd ' executionpath ' && source ' name '.queue "']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptGeneric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptGeneric.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptGeneric.m	(revision 13009)
+@@ -0,0 +1,9 @@
++function BuildMultipleQueueingScriptGeneric(name,executionpath,codepath)
++%BUILDMULTIPLEQUEUEINGSCRIPTGENERIC - ...
++%
++%   Usage:
++%      BuildMultipleQueueingScriptGeneric(executionpath,codepath)
++
++%not done yet
++error('BuildMultipleQueueingScriptGenericerror message: not supported yet!');
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScript.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScript.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScript.m	(revision 13009)
+@@ -0,0 +1,23 @@
++function BuildMultipleQueueingScript(cluster,name,executionpath,codepath)
++%BUILDMULTIPLEQUEUEINGSCRIPT - 
++%
++%   Usage:
++%      BuildMultipleQueueingScript(executionpath,codepath)
++
++disp('building queueing script');
++
++%First try and figure out if there is a special script for this particular cluster
++function_name=['BuildMultipleQueueingScript' cluster];
++
++%some specific treatment of identical cluster, gemini, castor and pollux
++if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
++	function_name='BuildMultipleQueueingScriptgemini';
++end
++
++if exist(function_name,'file'),
++	%Call this function:
++	eval([function_name '(name,executionpath,codepath);']);
++else
++	%Call the generic BuildQueueingScript:
++	BuildMultipleQueueingScriptGeneric(name,executionpath,codepath);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobGeneric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobGeneric.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobGeneric.m	(revision 13009)
+@@ -0,0 +1,7 @@
++function LaunchMultipleQueueJobGeneric(cluster,name,executionpath)
++%LAUNCHMULTIPLEQUEUEJOBGENERIC - Generic routine to launch multiple queueing job
++%
++%   Usage:
++%      LaunchMultipleQueueJobGeneric(cluster,name,executionpath)
++
++error('LaunchMultipleQueueJobGeneric error message: not supported yet!');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/AreaAverageOntoPartition.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/AreaAverageOntoPartition.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/AreaAverageOntoPartition.m	(revision 13009)
+@@ -0,0 +1,55 @@
++function partvector=AreaAverageOntoPartition(md,vector,layer)
++%AREAAVERAGEONTOPARTITION 
++%   compute partition values for a certain vector expressed on the vertices of the mesh.
++%   Use area weighted average.
++%
++%   Usage:
++%      average=AreaAverageOntoPartition(md,vector)
++%      average=AreaAverageOntoPartition(md,vector,layer) %if in 3D, chose which layer is partitioned
++
++%some checks
++if md.mesh.dimension==3,
++	if nargin~=3,
++		error('layer should be provided onto which Area Averaging occurs');
++	end
++	%save 3D model
++	md3d=md;
++	
++	md.mesh.elements=md.mesh.elements2d;
++	md.mesh.x=md.mesh.x2d;
++	md.mesh.y=md.mesh.y2d;
++	md.mesh.numberofvertices=md.mesh.numberofvertices2d;
++	md.mesh.numberofelements=md.mesh.numberofelements2d;
++	md.qmu.vertex_weight=[];
++	md.mesh.vertexconnectivity=[];
++
++	%run connectivity routine
++	md=adjacency(md);
++
++	%finally, project vector: 
++	vector=project2d(md3d,vector,layer);
++	md.qmu.partition=project2d(md3d,md3d.qmu.partition,layer);
++end
++
++%ok, first check that part is Matlab indexed
++part=md.qmu.partition+1;
++
++%some check: 
++if md.qmu.numberofpartitions~=max(part),
++	error('AreaAverageOntoPartition error message: ''npart'' should be equal to max(md.qmu.partition)');
++end
++
++%initialize output
++partvector=zeros(max(part),1);
++
++%start weight average
++weightedvector=vector.*md.qmu.vertex_weight;
++for i=1:max(part),
++	pos=find(part==i);
++	partvector(i)=sum(weightedvector(pos))/sum(md.qmu.vertex_weight(pos));
++end
++
++%in 3D, restore 3D model:
++if md.mesh.dimension==3,
++	md=md3d;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/partitioner.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/partitioner.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/partitioner.m	(revision 13009)
+@@ -0,0 +1,107 @@
++function md=partitioner(md,varargin)
++%PARTITIONER - partition mesh 
++%
++%   List of options to partitioner: 
++%
++%   package: 'chaco', 'metis' or 'scotch'
++%   npart: number of partitions.
++%   weighting: 'on' or 'off': default off
++%   section:  1 by defaults(1=bisection, 2=quadrisection, 3=octasection)
++%   recomputeadjacency:  'on' by default (set to 'off' to compute existing one)
++%   Output: md.qmu.partition recover the partition vector
++%   
++%   Usage:
++%      md=partitioner(md,'package','chaco','npart',100,'weighting','on');
++%
++
++%get options: 
++options=pairoptions(varargin{:});
++
++%set defaults
++options=addfielddefault(options,'package','chaco');
++options=addfielddefault(options,'npart',10);
++options=addfielddefault(options,'weighting','on');
++options=addfielddefault(options,'section',1);
++options=addfielddefault(options,'recomputeadjacency','on');
++
++%get package: 
++package=getfieldvalue(options,'package');
++npart=getfieldvalue(options,'npart');
++recomputeadjacency=getfieldvalue(options,'recomputeadjacency');
++
++if(md.mesh.dimension==3),
++	%partitioning essentially happens in 2D. So partition in 2D, then 
++	%extrude the partition vector vertically. 
++	md3d=md; %save  for later
++	md.mesh.elements=md.mesh.elements2d;
++	md.mesh.x=md.mesh.x2d;
++	md.mesh.y=md.mesh.y2d;
++	md.mesh.numberofvertices=md.mesh.numberofvertices2d;
++	md.mesh.numberofelements=md.mesh.numberofelements2d;
++	md.qmu.vertex_weight=[];
++	md.mesh.vertexconnectivity=[];
++end
++
++%adjacency matrix if needed:
++if strcmpi(recomputeadjacency,'on'),
++	md=adjacency(md);
++else
++	disp('skipping adjacency matrix computation as requested in the options');
++end
++
++
++if strcmpi(package,'chaco'),
++
++	%  default method (from chaco.m)
++	method=[1 1 0 0 1 1 50 0 .001 7654321]';
++	method(1)=3;    %  global method (3=inertial (geometric))
++	method(3)=0;    %  vertex weights (0=off, 1=on)
++	
++	%specify bisection
++	method(6)=getfieldvalue(options,'section');%  ndims (1=bisection, 2=quadrisection, 3=octasection)
++
++	%are we using weights? 
++	if strcmpi(getfieldvalue(options,'weighting'),'on'),
++		weights=floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight));
++		method(3)=1;
++	else 
++		weights=[];
++	end
++	
++	%  partition into nparts
++	part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y ,md.mesh.z,method,npart,[])'+1; %index partitions from 1 up. like metis.
++
++elseif strcmpi(package,'scotch'),
++
++	%are we using weights? 
++	if strcmpi(getfieldvalue(options,'weighting'),'on'),
++		weights=floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight));
++	end
++	maptab=Scotch(md.qmu.adjacency,[],weights,[],'cmplt',[npart]);
++	
++	part=maptab(:,2);%index partitions from 1 up. like metis.
++
++
++elseif strcmpi(package,'linear'),
++
++	part=1:1:md.mesh.numberofvertices;
++
++elseif strcmpi(package,'metis'),
++
++	[element_partitioning,part]=MeshPartition(md.mesh,md.qmu.numberofpartitions);
++
++else
++
++	error(['partitioner error message: could not find ' package ' partitioner']);
++	help partitioner
++end
++
++%extrude if we are in 3D:
++if md.mesh.dimension==3,
++	md3d.qmu.vertex_weight=md.qmu.vertex_weight;
++	md3d.qmu.adjacency=md.qmu.adjacency;
++	md=md3d;
++	part=project3d(md,'vector',part','type','node');
++end
++
++md.qmu.partition=part;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/adjacency.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/adjacency.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/adjacency.m	(revision 13009)
+@@ -0,0 +1,26 @@
++function md=adjacency(md);
++%ADJACENCY -  compute adjacency matrix, list of vertices and list of weights.
++%
++%  function to create the adjacency matrix from the connectivity table.
++%
++%  the required output is:
++%    md.adj_mat     (double [sparse nv x nv], vertex adjacency matrix)
++%    md.qmu.vertex_weight        (double [nv], vertex weights)
++
++indi=[md.mesh.elements(:,1);md.mesh.elements(:,2);md.mesh.elements(:,3)];
++indj=[md.mesh.elements(:,2);md.mesh.elements(:,3);md.mesh.elements(:,1)];
++values=1;
++
++md.qmu.adjacency=sparse(indi,indj,values,md.mesh.numberofvertices,md.mesh.numberofvertices);
++md.qmu.adjacency=double([md.qmu.adjacency | md.qmu.adjacency']);
++
++%now, build vwgt:
++areas=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
++
++%get node connectivity
++md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++
++connectivity=md.mesh.vertexconnectivity(:,1:end-1);
++pos=find(connectivity);
++connectivity(pos)=areas(connectivity(pos))/3;
++md.qmu.vertex_weight=sum(connectivity,2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/flagedges.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/flagedges.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition/flagedges.m	(revision 13009)
+@@ -0,0 +1,45 @@
++function [xsegments ysegments]=flagedges(elements,x,y,partition);
++%FLAGEDGES - return pairs of x,y segments, delimiting partitions.
++%
++%   Usage:
++%      [xsegments ysegments]=flagedges(elements,x,y,partition)
++
++xsegments=[];
++ysegments=[];
++
++for i=1:size(elements,1),
++	m1=partition(elements(i,1));
++	m2=partition(elements(i,2));
++	m3=partition(elements(i,3));
++	x1=x(elements(i,1));
++	x2=x(elements(i,2));
++	x3=x(elements(i,3));
++	y1=y(elements(i,1));
++	y2=y(elements(i,2));
++	y3=y(elements(i,3));
++
++	if (m1~=m2) & (m1~=m3) & (m2~=m3),
++		xmiddle=(x1+x2+x3)/3;
++		ymiddle=(y1+y2+y3)/3;
++		xsegments=[xsegments; (x1+x2)/2 xmiddle];
++		xsegments=[xsegments; (x1+x3)/2 xmiddle];
++		xsegments=[xsegments; (x2+x3)/2 xmiddle];
++		ysegments=[ysegments; (y1+y2)/2 ymiddle];
++		ysegments=[ysegments; (y1+y3)/2 ymiddle];
++		ysegments=[ysegments; (y2+y3)/2 ymiddle];
++	end
++
++	if (m1==m2) & (m1~=m3),
++		xsegments=[xsegments; (x1+x3)/2 (x2+x3)/2];
++		ysegments=[ysegments; (y1+y3)/2 (y2+y3)/2];
++	end
++	if (m1==m3) & (m2~=m3),
++		xsegments=[xsegments; (x1+x2)/2 (x2+x3)/2];
++		ysegments=[ysegments; (y1+y2)/2 (y2+y3)/2];
++	end
++
++	if (m2==m3) & (m1~=m3),
++		xsegments=[xsegments; (x1+x2)/2 (x1+x3)/2];
++		ysegments=[ysegments; (y1+y2)/2 (y1+y3)/2];
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition	(revision 13009)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/partition
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_rifts.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_rifts.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_rifts.m	(revision 13009)
+@@ -0,0 +1,77 @@
++function plot_rifts(md,options,nlines,ncols,index);
++%PLOT_RIFTS - plot rifts in a mesh
++%
++%   Usage:
++%      plot_rifts(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++%plot mesh
++subplot(nlines,ncols,index); 
++
++%offset to separate rift flanks.
++offset=getfieldvalue(options,'offset',500);
++if isstruct(md.rifts.riftstruct),
++	
++	for i=1:size(md.rifts.riftstruct,1),
++		penaltypairs=md.rifts.riftstruct(i).penaltypairs;
++
++		normal=zeros(2,1);
++		for j=1:size(penaltypairs,1),
++			normal(1)=penaltypairs(j,5);
++			normal(2)=penaltypairs(j,6);
++			x(penaltypairs(j,1))=x(penaltypairs(j,1))-normal(1)*offset;
++			y(penaltypairs(j,1))=y(penaltypairs(j,1))-normal(2)*offset;
++		end
++		if length(md.rifts.riftstruct(i).tips)==3,
++			tip=md.rifts.riftstruct(i).tips(3);
++			%who is tip connected to? 
++			if isconnected(md.mesh.elements,penaltypairs(1,1),tip),
++				normal(1)=penaltypairs(1,5);
++				normal(2)=penaltypairs(1,6);
++				x(tip)=x(tip)-normal(1)*offset;
++				y(tip)=y(tip)-normal(2)*offset;
++			end
++
++			if isconnected(md.mesh.elements,penaltypairs(1,2),tip),
++				normal(1)=penaltypairs(1,5);
++				normal(2)=penaltypairs(1,6);
++				x(tip)=x(tip)+normal(1)*offset;
++				y(tip)=y(tip)+normal(2)*offset;
++			end
++			if isconnected(md.mesh.elements,penaltypairs(end,1),tip),
++				normal(1)=penaltypairs(end,5);
++				normal(2)=penaltypairs(end,6);
++				x(tip)=x(tip)-normal(1)*offset;
++				y(tip)=y(tip)-normal(2)*offset;
++			end
++			if isconnected(md.mesh.elements,penaltypairs(end,2),tip),
++				normal(1)=penaltypairs(end,5);
++				normal(2)=penaltypairs(end,6);
++				x(tip)=x(tip)+normal(1)*offset;
++				y(tip)=y(tip)+normal(2)*offset;
++			end
++		end
++	end
++end
++
++%plot mesh
++if is2d
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++else
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++end
++
++%apply options
++options=addfielddefault(options,'title','Rifts');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_contour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_contour.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_contour.m	(revision 13009)
+@@ -0,0 +1,245 @@
++function plot_contour(md,datain,options);
++%PLOT_CONTOUR - plot contours of a given field
++%
++%   Usage:
++%      plot_contour(md,data,options);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z index is2d isplanet]=processmesh(md,[],options);
++options=removefield(options,'log',0);
++[data datatype]=processdata(md,datain,options);
++
++%check is2d
++if ~is2d,
++	error('plot_contour error message: contour not supported for 3d meshes, project on a layer');
++end
++
++%first, process data: must be on nodes
++if datatype==1,
++	%elements -> take average
++	data=averaging(md,data,0);
++elseif datatype==2,
++	%nodes -> do nothing
++elseif datatype==3,
++	%quiver -> take norm
++	data=sqrt(sum(datain.*datain,2));
++else
++	error('datatype not supported yet');
++end
++
++%prepare colors
++if exist(options,'contouronly')
++	%remove the previous plots
++	cla
++end
++color=getfieldvalue(options,'contourcolor','y');
++linewidth=getfieldvalue(options,'linewidth',1);
++
++%get contours levels
++contourlevels=getfieldvalue(options,'contourlevels');
++if isnumeric(contourlevels),
++	levels=round_ice(linspace(max(data),min(data),contourlevels),2);
++else
++	levels=[];
++	for i=1:length(contourlevels)
++		levels(end+1)=contourlevels{i};
++	end
++	levels=sort(unique(levels),'descend');
++end
++numlevels=length(levels);
++
++%initialization of some variables
++numberofelements=size(index,1);
++elementslist=1:numberofelements;
++c=[];
++h=[];
++
++%get unique edges in mesh
++%1: list of edges
++edges=[index(:,[1,2]); index(:,[2,3]); index(:,[3,1])];
++%2: find unique edges
++[edges,I,J]=unique(sort(edges,2),'rows');
++%3: unique edge numbers
++vec=J;
++%4: unique edges numbers in each triangle (2 triangles sharing the same edge will have
++%   the same edge number)
++edges_tria=[vec(elementslist), vec(elementslist+numberofelements), vec(elementslist+2*numberofelements)];
++
++%segments [nodes1 nodes2]
++Seg1=index(:,[1 2]);
++Seg2=index(:,[2 3]);
++Seg3=index(:,[3 1]);
++
++%segment numbers [1;4;6;...]
++Seg1_num=edges_tria(:,1);
++Seg2_num=edges_tria(:,2);
++Seg3_num=edges_tria(:,3);
++
++%value of data on each tips of the segments
++Data1=data(Seg1);
++Data2=data(Seg2);
++Data3=data(Seg3);
++
++%get the ranges for each segment
++Range1=sort(Data1,2);
++Range2=sort(Data2,2);
++Range3=sort(Data3,2);
++
++for i=1:numlevels
++
++	level=levels(i);
++
++	%find the segments that contain this value
++	pos1=(Range1(:,1)<level & Range1(:,2)>level);
++	pos2=(Range2(:,1)<level & Range2(:,2)>level);
++	pos3=(Range3(:,1)<level & Range3(:,2)>level);
++
++	%get elements
++	poselem12=(pos1 & pos2);
++	poselem13=(pos1 & pos3);
++	poselem23=(pos2 & pos3);
++	poselem=find(poselem12 | poselem13 | poselem23);
++	numelems=length(poselem);
++
++	%if no element has been flagged, skip to the next level
++	if numelems==0,
++		continue,
++	end
++
++	%go through the elements and build the coordinates for each segment (1 by element)
++	x1=zeros(numelems,1);
++	x2=zeros(numelems,1);
++	y1=zeros(numelems,1);
++	y2=zeros(numelems,1);
++	edge_l=zeros(numelems,2);
++
++	for j=1:numelems,
++
++		weight1=(level-Data1(poselem(j),1))/(Data1(poselem(j),2)-Data1(poselem(j),1));
++		weight2=(level-Data2(poselem(j),1))/(Data2(poselem(j),2)-Data2(poselem(j),1));
++		weight3=(level-Data3(poselem(j),1))/(Data3(poselem(j),2)-Data3(poselem(j),1));
++
++		if poselem12(poselem(j));
++
++			x1(j)=x(Seg1(poselem(j),1))+weight1*(x(Seg1(poselem(j),2))-x(Seg1(poselem(j),1)));
++			x2(j)=x(Seg2(poselem(j),1))+weight2*(x(Seg2(poselem(j),2))-x(Seg2(poselem(j),1)));
++			y1(j)=y(Seg1(poselem(j),1))+weight1*(y(Seg1(poselem(j),2))-y(Seg1(poselem(j),1)));
++			y2(j)=y(Seg2(poselem(j),1))+weight2*(y(Seg2(poselem(j),2))-y(Seg2(poselem(j),1)));
++			edge_l(j,1)=Seg1_num(poselem(j));
++			edge_l(j,2)=Seg2_num(poselem(j));
++
++		elseif poselem13(poselem(j)),
++
++			x1(j)=x(Seg1(poselem(j),1))+weight1*(x(Seg1(poselem(j),2))-x(Seg1(poselem(j),1)));
++			x2(j)=x(Seg3(poselem(j),1))+weight3*(x(Seg3(poselem(j),2))-x(Seg3(poselem(j),1)));
++			y1(j)=y(Seg1(poselem(j),1))+weight1*(y(Seg1(poselem(j),2))-y(Seg1(poselem(j),1)));
++			y2(j)=y(Seg3(poselem(j),1))+weight3*(y(Seg3(poselem(j),2))-y(Seg3(poselem(j),1)));
++			edge_l(j,1)=Seg1_num(poselem(j));
++			edge_l(j,2)=Seg3_num(poselem(j));
++
++		elseif poselem23(poselem(j)),
++
++			x1(j)=x(Seg2(poselem(j),1))+weight2*(x(Seg2(poselem(j),2))-x(Seg2(poselem(j),1)));
++			x2(j)=x(Seg3(poselem(j),1))+weight3*(x(Seg3(poselem(j),2))-x(Seg3(poselem(j),1)));
++			y1(j)=y(Seg2(poselem(j),1))+weight2*(y(Seg2(poselem(j),2))-y(Seg2(poselem(j),1)));
++			y2(j)=y(Seg3(poselem(j),1))+weight3*(y(Seg3(poselem(j),2))-y(Seg3(poselem(j),1)));
++			edge_l(j,1)=Seg2_num(poselem(j));
++			edge_l(j,2)=Seg3_num(poselem(j));
++		else
++			%it shoud not go here
++		end
++	end
++
++	%now that we have the segments, we must try to connect them...
++
++	%loop over the subcontours
++	while ~isempty(edge_l),
++
++		%take the right edge of the second segment and connect it to the next segments if any
++		e1=edge_l(1,1);   e2=edge_l(1,2);
++		xc=[x1(1);x2(1)]; yc=[y1(1);y2(1)];
++
++		%erase the lines corresponding to this edge
++		edge_l(1,:)=[];
++		x1(1)=[]; x2(1)=[];
++		y1(1)=[]; y2(1)=[];
++
++		[ro1,co1]=find(edge_l==e1);
++
++		while ~isempty(ro1)
++
++			if co1==1,
++				xc=[x2(ro1);xc]; yc=[y2(ro1);yc];
++
++				%next edge:
++				e1=edge_l(ro1,2);
++
++			else
++				xc=[x1(ro1);xc]; yc=[y1(ro1);yc];
++
++				%next edge:
++				e1=edge_l(ro1,1);
++			end
++
++			%erase the lines of this
++			edge_l(ro1,:)=[];
++			x1(ro1)=[]; x2(ro1)=[];
++			y1(ro1)=[]; y2(ro1)=[];
++
++			%next connection
++			[ro1,co1]=find(edge_l==e1);
++		end
++
++		%same thing the other way (to the right)
++		[ro2,co2]=find(edge_l==e2);
++
++		while ~isempty(ro2)
++
++			if co2==1,
++				xc=[xc;x2(ro2)]; yc=[yc;y2(ro2)];
++
++				%next edge:
++				e2=edge_l(ro2,2);
++			else
++				xc=[xc;x1(ro2)]; yc=[yc;y1(ro2)];
++
++				%next edge:
++				e2=edge_l(ro2,1);
++			end
++
++			%erase the lines of this
++			edge_l(ro2,:)=[];
++			x1(ro2)=[]; x2(ro2)=[];
++			y1(ro2)=[]; y2(ro2)=[];
++
++			%next connection
++			[ro2,co2]=find(edge_l==e2);
++		end
++
++		%we now have one subcontour ready to be plotted
++		zc=level*ones(length(xc)+1,1);
++		if getfieldvalue(options,'contouronly',0),
++			h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'Zdata',zc,'Cdata',zc,'facecolor','none','edgecolor','flat','linewidth',linewidth)];
++			hold on      
++		else
++			h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'facecolor','none','edgecolor',color,'linewidth',linewidth)];
++			hold on
++		end
++
++		% Update the CS data structure as per "contours.m"
++		% so that clabel works
++		c = horzcat(c,[level, xc'; length(xc), yc']);
++
++	end
++end
++
++%labels?
++if (~strcmpi(getfieldvalue(options,'contourticks','on'),'off') & ~isempty(c) & ~isempty(h))
++	if exist(options,'contouronly')
++		clabel(c,h);
++	else
++		clabel(c,h,'color',color,'FontSize',14);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processmesh.m	(revision 13009)
+@@ -0,0 +1,98 @@
++function [x y z elements is2d isplanet]=processmesh(md,data,options);
++%PROCESSMESH - process mesh to be plotted
++%
++%   Usage:
++%      [x y z elements is2d]=processmesh(md,data,options)
++%
++%   See also: PLOTMODEL, PROCESSDATA
++
++%some checks
++if md.mesh.numberofvertices==0,
++	error('plot error message: mesh is empty')
++end
++if md.mesh.numberofvertices==md.mesh.numberofelements
++	error(['plot error message: the number of elements is the same as the number of nodes...']);
++end
++
++if (isempty(data) | ~isstruct(data)),
++	%first load x,y, etc ... to speed up plot
++
++	if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
++		x=md.mesh.x;
++		if isfield(md.mesh,'x2d'), x2d=md.mesh.x2d; end
++		y=md.mesh.y;
++		if isfield(md.mesh,'y2d'), y2d=md.mesh.y2d; end
++	else
++		x=md.mesh.long;
++		%x2d=md.mesh.x2d; this sounds like something that was forgotten
++		y=md.mesh.lat;
++		%y2d=md.mesh.y2d;
++	end
++
++	z_field=getfieldvalue(options,'z',md.mesh.z);
++	if ischar(z_field),
++		z=md.(z_field);
++	elseif isnumeric(z_field),
++		z=z_field;
++	else
++		z=md.mesh.z;
++	end
++
++
++	if isfield(md.mesh,'elements2d'), elements2d=md.mesh.elements2d; end
++	elements=md.mesh.elements;
++
++	%is it a 2d plot?
++	if (md.mesh.dimension==2);
++		is2d=1;
++	elseif (md.mesh.dimension==3),
++		if getfieldvalue(options,'layer',0)>=1,
++			is2d=1;
++		else
++			is2d=0;
++		end
++	else
++		error(['dim = ' num2str(md.mesh.dimension) ' not supported yet']);
++	end
++
++	%layer projection? 
++	if getfieldvalue(options,'layer',0)>=1,
++		if strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
++			error('processmesh error message: cannot work with 3D meshes for now');
++		end
++		%we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded. 
++		x=x2d;
++		y=y2d;
++		z=zeros(size(x2d));
++		elements=elements2d;
++	end
++else
++	%Process Patch
++	if (md.mesh.dimension==2),
++		elements=transpose(reshape(1:3*md.mesh.numberofelements,3,md.mesh.numberofelements));
++		x=transpose(reshape(md.mesh.x(data.index)',1,3*md.mesh.numberofelements));
++		y=transpose(reshape(md.mesh.y(data.index)',1,3*md.mesh.numberofelements));
++		z=zeros(3*md.mesh.numberofelements,1);
++		is2d=1;
++	else
++		elements=transpose(reshape(1:6*md.mesh.numberofelements,6,md.mesh.numberofelements));
++		x=transpose(reshape(md.mesh.x(data.index)',1,6*md.mesh.numberofelements));
++		y=transpose(reshape(md.mesh.y(data.index)',1,6*md.mesh.numberofelements));
++		z=transpose(reshape(md.mesh.z(data.index)',1,6*md.mesh.numberofelements));
++		is2d=0;
++	end
++end
++
++%units
++if exist(options,'unit'),
++	unit=getfieldvalue(options,'unit');
++	x=x*unit;
++	y=y*unit;
++	z=z*unit;
++end
++
++if isa(md,'planet'),
++	isplanet=1;
++else
++	isplanet=0;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_parthist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_parthist.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_parthist.m	(revision 13009)
+@@ -0,0 +1,34 @@
++function plot_parthist(md,options,nlines,ncols,i);
++%PLOT_PARTHIST - plot partitioning histogram
++%
++%   Usage:
++%      plot_parthist(md,options,nlines,ncols,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++%plot mesh
++subplot(nlines,ncols,i); 
++
++imin=min(md.qmu.partition);
++imax=max(md.qmu.partition);
++
++part=zeros(imax-imin+1,2);
++
++for i=imin:imax
++    ind=find(md.qmu.partition == i);
++    part(i-imin+1,1)=length(ind);
++	part(i-imin+1,2)=sum(md.vertex_weight(ind));
++end
++
++subplot(2,1,1)
++bar(imin:imax,part(:,1));
++xlim([imin-0.5 imax+0.5])
++title('Number of Nodes in Each Partition')
++
++subplot(2,1,2)
++bar(imin:imax,part(:,2));
++xlim([imin-0.5 imax+0.5])
++title('Total Weight in Each Partition')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmumean.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmumean.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmumean.m	(revision 13009)
+@@ -0,0 +1,59 @@
++function plot_qmumean(md,options,nlines,ncols,i);
++%PLOT_QMUMEAN - plot mean of a scaled response 
++%
++%   Usage:
++%      plot_qmumean(md,options,nlines,ncols,i);
++%
++%   See also: PLOTMODEL
++
++%plot mesh
++subplot(nlines,ncols,i); 
++
++%edgecolor
++edgecolor=getfieldvalue(options,'edgecolor','none');
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++%find response function
++if exist(options,'qmudata'), 
++	descriptor=getfieldvalue(options,'qmudata'); 
++	if ~ischar(descriptor),
++		error('plot_qmumean error message:  descriptor should be a string');
++	end
++else 
++	error('plot_qmumean error message:  provide descriptor of response function in ''qmudata'' option');
++end
++
++%go pick up the response: 
++allresponses=md.qmu.results.dresp_out;
++responses=zeros(md.qmu.numberofpartitions,1);
++
++count=1;
++for i=1:length(allresponses),
++	d=allresponses(i).descriptor;
++	if strncmpi(d,'scaled_',7),
++		d=d(8:end);
++		if strncmpi(d,descriptor,length(descriptor)),
++			responses(count)=allresponses(i).mean;
++			count=count+1;
++		end
++	end
++end
++
++%log?
++if exist(options,'log'),
++	responses=log(responses)/log(getfieldvalue(options,'log'));
++end
++
++%now, project onto vertices
++responses_on_node=responses(md.qmu.partition+1);
++
++%plot
++A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', responses_on_node,'FaceColor','interp','EdgeColor',edgecolor);
++
++%apply options
++options=addfielddefault(options,'title',['Mean distribution of ' descriptor]);
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/imagescnan.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/imagescnan.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/imagescnan.m	(revision 13009)
+@@ -0,0 +1,303 @@
++function [h,hcb] = imagescnan(x,y,U,varargin)
++%IMAGESCNAN Scale data and display as image with uncolored NaNs.
++%
++%   Syntax
++%               imagescnan(x,y,U)
++%               imagescnan(x,y,U,...,colormask)
++%               imagescnan(x,y,U,...,color)
++%               imagescnan(x,y,U,...,cbfit_opt)
++%           h = imagescnan(...);
++%     [h,hcb] = imagescnan(...,cbfit_opt);
++%
++%   Input:
++%     x          - X-axis vector data. Optional, i.e., can be empty.
++%                  Default: 1:n (rows index).
++%     y          - Y-axis vector data. Optional, i.e., can be empty.
++%                  Default: 1:m (column index).
++%     U          - Matrix [m x n] data or an RGB image [m x n x 3] (with/
++%                  without NaNs). 
++%     colormask  - Logical matrix indicating the U elements to be
++%                  uncolored, if is empty then ISNAN(U) is used. Or it can
++%                  be a single value which will be uncolored.
++%                  Default: ~isfinite(U) (NaNs and Infs elements uncolored)
++%     color      - A vector with 3 elements specifying the [R G B] color
++%                  for the NaNs color. It can be specified by the known
++%                  char colors: 'k', etcerera. Optional.  
++%                  Default: get(gca,'color') (axes background color)
++%     cbfit_opt  - Cell array with the options to call COLORBARFIT.
++%                  Default: COLORBARFIT function is not used by default.
++%
++%   Output:
++%     h   - Image handle. Optional
++%     hcb - Colorbar handle. Optional
++%
++%   Description:
++%      This function draws a matrix data as an image with uncolored NaN's
++%      elements using IMAGESC. The difference between IMAGESC and the
++%      PCOLOR, MESH or SURF function is that EVERY element is colored and
++%      no one is interpolated, besides, the pixels are centered with the
++%      axis value, although it is a flat image.
++%
++%      The color mask is added because IMAGESC do not work with NaN's, in
++%      fact it colors them with the lower value of the current colormap.
++%      
++%      The cbfit_opt is include in order to be able to define a diferent
++%      color map with the COLORBARFIT function which can be found at:
++%           http://www.mathworks.com/matlabcentral/fileexchange/.
++%      If this function is not found, a normal COLORBAR is generated.
++%
++%      The data and the colorbar are scaled with the current colormap, so,
++%      the use of COLORMAP after this function doesn't affects the
++%      generated image and colorbar! Therefore, COLORMAP and CAXIS should
++%      be used before this function.
++%
++%      Notes: * The inputs arguments for the COLORBARFIT function are 3
++%               plus the normal COLORBAR function options, for this reason,
++%               if the former is not found, the latter is used ignoring
++%               these first 3 options. Anyway, to generate a colorbar, at
++%               least an empty cell is needed for cbfit_opt = {[]}.
++%   
++%   Examples:
++%
++%      % Compares with normal IMAGESC:
++%       N = 100;
++%       PNaNs = 0.10;
++%       X = peaks(N);
++%       X(round(1 + (N^2-1).*rand(N^2*PNaNs,1))) = NaN;
++%       subplot(221), imagesc(X)
++%        title('With IMAGESC: ugly NaNs')
++%       subplot(222), imagescnan([],[],X) 
++%        title('With IMAGESCNAN: uncolored NaNs')
++%
++%      % Compares with SPY:
++%       subplot(223), spy(isnan(X))
++%        title('SPY NaNs')
++%       subplot(224), imagescnan([],[],isnan(X),0), axis equal tight
++%        title('No-NaNs with IMAGESCNAN')
++%
++%   See also IMAGE, IMAGESC, COLORBAR, IMREAD, IMWRITE and COLORBARFIT by
++%   Carlos Vargas. 
++
++%   Copyright 2008 Carlos Adrian Vargas Aguilera
++%   $Revision: 1.1 $  $Date: 2009/04/03 22:56:05 $
++
++%   Written by
++%   M.S. Carlos Adrian Vargas Aguilera
++%   Physical Oceanography PhD candidate
++%   CICESE 
++%   Mexico, 2008
++%   nubeobscura@hotmail.com
++%
++%   Download from:
++%   http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objec
++%   tType=author&objectId=1093874
++
++%   1.0     Released (30/06/2008)
++%   1.1     Fixed bug when CAXIS used.
++%   1.2     Colorbar freezed colormap.
++%   1.3     Fixed bug in color vector input (Found by Greg King) and now
++%           accets RGB image as input.
++
++%% INPUTS:
++
++% Error checking:
++% Note: At least 3 inputs and no more than 6:
++if nargin<3 || nargin>6
++ error('Imagescnan:IncorrectInputNumber',...
++       'Input arguments must be at least 3 and less than 7.')
++end
++
++% Check the x,y,U:
++% Note: x,y should be the axes data.
++m = size(U);
++if numel(m)>3
++ error('Imagescnan:IncorrectInputSize',...
++       'Input image must be a matrix or an RGB image.')
++else
++ if isempty(x) || numel(x)~=m(2)
++  %warning('Imagescnan:IncorrectInputSize',...
++  %        'Index column axis has been used.')
++  x = 1:m(2); 
++ end
++ if isempty(y) || numel(y)~=m(1)
++  %warning('Imagescnan:IncorrectInputSize',...
++  %        'Index row axis has been used.')
++  y = 1:m(1); 
++ end
++end
++
++% Get color limits:
++% Note: If you would like to use specific color limits, use CAXIS before
++%       this function.
++switch get(gca,'CLimMode')
++ case 'manual'
++  clim = caxis;
++ otherwise
++  clim = [min(U(:)) max(U(:))];
++end
++
++% Parse inputs and defaults:
++% Note: * Mask color will be the not-finite elements plus the elements
++%         indicated by the user.
++%       * Default colormask is the current axes background.
++%       * Default currentmap is current figure colormap (probably JET).
++colormask = ~isfinite(U);
++color_nan = get(gca,'color');
++color_map = get(gcf,'colormap'); 
++cbfit_opt = [];
++ycolorbarfit = (exist('colorbarfit','file')==2);
++if nargin>3
++ while ~isempty(varargin)
++  if     iscell(varargin{1})
++   if length(varargin{1})<3
++    error('Imagescnan:IncorrectInputType',...
++     'Options for COLORBARFIT must be at least 3, although empty.')
++   end
++   caxis(clim)
++   cbfit_opt = varargin{1};
++   if ycolorbarfit
++    colorbarfit(cbfit_opt{:})
++    color_map = get(gcf,'colormap');
++   else
++    % warning('Imagescnan:ColorBarFitNotFound',...
++    %  'COLORBARFIT function not found, used default COLORBAR.') 
++   end
++   varargin(1) = [];
++  elseif ischar(varargin{1})
++   switch varargin{1}
++    case 'y', color_nan = [1 1 0];
++    case 'm', color_nan = [1 0 0];
++    case 'c', color_nan = [0 1 1];
++    case 'r', color_nan = [1 0 0];
++    case 'g', color_nan = [0 1 0];
++    case 'b', color_nan = [0 0 1];
++    case 'w', color_nan = [1 1 1];
++    case 'k', color_nan = [0 0 0];
++   otherwise
++   error('Imagescnan:InvalidColor',...
++    'Color char must be one of: ''ymcrgbwk''.')
++   end
++   varargin(1) = [];
++  elseif islogical(varargin{1})
++   if numel(varargin{1})~=numel(U)
++    error('Imagescnan:InvalidMask',...
++     'The logical mask must have the same elements as the matrix.')
++   end
++   colormask = varargin{1} | colormask;
++   varargin(1) = [];
++  elseif length(varargin{1})==3
++   if (max(varargin{1})>1) || (min(varargin{1})<0) % Fixed BUG 2008/07/11
++    error('Imagescnan:InvalidColor',...
++     'The color must be on the range of [0 1].')
++   end
++   color_nan = varargin{1};
++   varargin(1) = [];
++  elseif length(varargin{1})==1
++   colormask = (U==varargin{1}) | colormask;
++   varargin(1) = [];
++  else
++   error('Imagescnan:IncorrectInputType',...
++    'Incorrect optional(s) argument(s).')
++  end
++ end
++end
++
++
++%% MAIN:
++
++% Matrix data to RGB:
++if numel(m)==2
++
++ % Sets to double data:
++ if ~isfloat(U)
++  U = double(U);
++ end
++
++ % Normalizes and rounds data to range [0 N]:
++ N = size(color_map,1);
++ U = (U - clim(1))/diff(clim);          % Fixed bug when CAXIS used
++ U = U*N;
++ if N<=256
++  U = uint8(U);
++ else
++  U = uint16(U);
++ end
++
++ % Scales data with colormap:
++ U = ind2rgb(U,color_map);              % 2D to 3D RGB values [0 1]
++else
++ % Already is an RGB image, so do nothing.
++end
++
++ % Set mask color to color_nan:
++ mn = prod(m(1:2));
++ ind = find(colormask);
++ U(ind)      = color_nan(1); % Red color
++ U(ind+mn)   = color_nan(2); % Green color
++ U(ind+mn*2) = color_nan(3); % Blue color
++
++ % Draws the RGB image:
++ h = imagesc(x,y,U,clim);
++
++%% OUTPUTS:
++
++% Calls to colorbarfit and freezes his colormap:
++if ~isempty(cbfit_opt)
++ % Creates a temporary colorbar:
++ if ycolorbarfit
++  hcb   = colorbarfit(cbfit_opt{:});
++ else
++  Nopt = min([3 length(cbfit_opt)]);
++  cbfit_opt(1:Nopt) = [];
++  hcb   = colorbar(cbfit_opt{:});
++ end
++ % Save image position:
++ ha    = gca; position = get(ha,'Position'); 
++ % Gets colorbar axes properties:
++ ghcb  = get(hcb);
++ CData = ind2rgb(get(ghcb.Children,'CData'),color_map);
++ XData = get(ghcb.Children,'XData');
++ YData = get(ghcb.Children,'YData');
++ % Move ticks because IMAGESC draws them like centered pixels:
++ XTick = ghcb.XTick;
++ YTick = ghcb.YTick;
++ if ~isempty(XTick)
++  XTick = XTick(1:end-1) + diff(XTick(1:2))/2;
++ end
++ if ~isempty(YTick)
++  YTick = YTick(1:end-1) + diff(YTick(1:2))/2;
++ end
++ % Deletes the colorbar:
++ delete(hcb)            
++ % Generates other colorbar:
++ hcb = axes('Position',ghcb.Position);
++ hcbim = imagesc(XTick,YTick,CData,'Parent',hcb); axis tight
++ set(hcbim,...
++  'HitTest','off',...
++  'Interruptible','off',...
++  'SelectionHighlight','off',...
++  'Tag','TMW_COLORBAR',...
++  'XData',XData,...
++  'YData',YData)
++ set(hcb,...
++  'XAxisLocation',ghcb.XAxisLocation,...
++  'YAxisLocation',ghcb.YAxisLocation,...
++  'XLim',ghcb.XLim,...
++  'YLim',ghcb.YLim,...
++  'XDir',ghcb.XDir,...
++  'YDir',ghcb.YDir,...
++  'XTick',ghcb.XTick,...
++  'YTick',ghcb.YTick,...
++  'XTickLabel',ghcb.XTickLabel,...
++  'YTickLabel',ghcb.YTickLabel,...
++  'ButtonDownFcn',@resetCurrentAxes,...
++  'Interruptible','off',...
++  'Tag','Colorbar')
++ % Returns the image position:
++ axes(ha), set(ha,'Position',position)
++end
++
++% Sets output:
++if ~nargout
++ clear h
++end
+\ No newline at end of file
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/radarpower.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/radarpower.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/radarpower.m	(revision 13009)
+@@ -0,0 +1,118 @@
++function md=radarpower(md,varargin)
++%RADARPOWER - overlay a power radar image on an existing mesh
++%
++%   This routine will overlay a power radar image on an existing mesh.
++%   The power amplitude will be output to vel for now.
++%   In the future, think about a field to hold this value.
++%
++%   Usage:
++%      md=radarpower(md,options);
++%      md=radarpower(md)
++
++%If gdal does not work, uncomment the following line
++%setenv('LD_LIBRARY_PATH','/proj/ice/larour/issm/trunk/externalpackages/gdal/install/lib/');
++%Parse inputs
++if nargin==1,
++	options=pairoptions;
++else
++	options=varargin{:};
++	if ~isa(options,'pairoptions'),
++		options=pairoptions(varargin{:});
++	end
++end
++
++highres=getfieldvalue(options,'highres',0);
++xlim=getfieldvalue(options,'xlim',[min(md.mesh.x) max(md.mesh.x)]);
++ylim=getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]);
++posting=getfieldvalue(options,'posting',0); % 0 -> image posting default
++
++%find gdal coordinates
++x0=min(xlim); x1=max(xlim);
++y0=min(ylim); y1=max(ylim);
++
++%figure out if we should go look for Greenland or Antarctica geotiff, or if user provided one.
++if ~exist(options,'overlay_image'),
++	if strcmpi(md.mesh.hemisphere,'n'),
++		if ~exist([jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg']),
++			error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg not found.']);
++		end
++		name = 'mog150_greenland_map';
++		%name = 'mog100_hp1_v10';
++		%name = 'mog500_hp1_v10';
++		jpgim=[jplsvn() '/projects/ModelData/MOG/' name '.jpg'];
++		geom=load([jplsvn() '/projects/ModelData/MOG/' name '.jpgw'],'ascii');
++
++		%geom:   xposting nbcols nbrows yposting xmin ymax
++		xmin=max(geom(5),x0);
++		xmax=min(geom(5)+geom(1)*geom(2),x1);
++		ymin=max(geom(6)-geom(3)*geom(4),y0);
++		ymax=min(geom(6),y1);
++
++		firstcol=max(1,floor((xmin-geom(5))/geom(1))); %x min
++		firstrow=max(1,floor((geom(6)-ymax)/geom(4))); %y max
++		numcols=floor((xmax-xmin)/geom(1)); % x posting
++		numrows=floor((ymax-ymin)/geom(4)); % y posting
++		pixelskip=max(1,ceil(posting/geom(1)));
++
++		%Read and crop file
++		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++		im=imread(jpgim);
++		im=im(firstrow:firstrow+numrows-1,firstcol:firstcol+numcols-1);
++		md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
++		md.radaroverlay.x=(xmin:(xmax-xmin)/(size(md.radaroverlay.pwr,2)-1):xmax);
++		md.radaroverlay.y=(ymin:(ymax-ymin)/(size(md.radaroverlay.pwr,1)-1):ymax);
++
++	elseif strcmpi(md.mesh.hemisphere,'s'),
++		if highres,
++			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif']),
++				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif not found.']);
++			end
++			geotiff_name=[jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif'];
++		else
++			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif']),
++				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif not found.']);
++			end
++			geotiff_name=[jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif'];
++		end
++
++		%Name of image
++		inputname='./temp.tif';
++		eval(['!gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ]);
++
++		%Read in temp.tif:
++		im=imread('temp.tif','TIFF');
++		pixelskip=max(1,ceil(posting/((x1-x0)/(size(im,2)))));
++		md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
++		md.radaroverlay.x=(x0:(x1-x0)/(size(md.radaroverlay.pwr,2)-1):x1);
++		md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
++
++		%Erase image
++		system('rm -rf ./temp.tif');
++
++	else
++		error('field hemisphere should either be ''n'' or ''s''');
++	end
++else
++	%ok, user provided an image. check we also have overlay_xlim and overlay_ylim  options, to know what range of coordinates the image covers.
++	if (~exist(options,'overlay_xlim') | ~exist(options,'overlay_xlim')| ~exist(options,'overlay_xposting')| ~exist(options,'overlay_yposting')),
++		error('radarpower error message: please provide overlay_xlim, overlay_ylim, overlay_xposting and overlay_yposting options together with overlay_image option');
++	end
++	overlay_image=getfieldvalue(options,'overlay_image');
++	overlay_xlim=getfieldvalue(options,'overlay_xlim');
++	overlay_ylim=getfieldvalue(options,'overlay_ylim');
++	overlay_xposting=getfieldvalue(options,'overlay_xposting');
++	overlay_yposting=getfieldvalue(options,'overlay_yposting');
++
++	sizex=floor((x1-x0)/overlay_xposting);
++	sizey=floor((y1-y0)/overlay_yposting);
++	topleftx=floor((x0-overlay_xlim(1))/overlay_xposting); % x min
++	toplefty=floor((overlay_ylim(2)-y1)/overlay_yposting); % y max
++
++	%Read and crop file
++	disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++	im=imread(overlay_image);
++	im=im(toplefty:toplefty+sizey,topleftx:topleftx+sizex);
++	md.radaroverlay.pwr=double(flipud(im));
++	md.radaroverlay.x=(x0:(x1-x0)/(size(md.radaroverlay.pwr,2)-1):x1);
++	md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_icefront.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_icefront.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_icefront.m	(revision 13009)
+@@ -0,0 +1,106 @@
++function plot_icefront(md,options,width,i,data);
++%PLOT_ICEFRONT - plot segment on neumann BC
++%
++%   Usage:
++%      plot_icefront(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%plot mesh boundaries
++subplot(width,width,i); 
++
++%process mesh and data
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++icefront=md.diagnostic.icefront;
++
++if (md.mesh.dimension==2),
++
++	%plot mesh
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++	h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	hold on;
++
++	%highlight elements on neumann
++	pos=find(icefront(:,end)==1);
++	pos=icefront(pos,end-1);
++	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
++	h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
++	pos=find(icefront(:,end)==0);
++	pos=icefront(pos,end-1);
++	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
++	h3=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
++
++	pos=find(icefront(:,end)==2);
++	pos=icefront(pos,end-1);
++	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
++	h3bis=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
++
++	%display arrows pointing outward
++	xstart=mean(x(icefront(:,1:end-2)),2);
++	ystart=mean(y(icefront(:,1:end-2)),2);
++	length=sqrt((x(icefront(:,1))-x(icefront(:,2))).^2 + (y(icefront(:,1))-y(icefront(:,2))).^2 );
++	normal(:,1)=cos(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
++	normal(:,2)=sin(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
++	xend=xstart+length.*normal(:,1);
++	yend=ystart+length.*normal(:,2);
++	q=quiver(xstart,ystart,xend-xstart,yend-ystart); hold on;
++	h4=plot(xstart,ystart,'r*');
++else
++
++	%plot mesh
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++	h1=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	hold on;
++
++	%highlight elements on neumann
++	pos=find(icefront(:,end)==1);
++	pos=icefront(pos,end-1);
++	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
++	h2=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
++	pos=find(icefront(:,end)==0);
++	pos=icefront(pos,end-1);
++	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
++	h3=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
++	pos=find(icefront(:,end)==2);
++	pos=icefront(pos,end-1);
++	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
++	h3bis=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
++
++	%display arrows pointing outward
++	xstart=mean(x(icefront(:,1:end-2)),2);
++	ystart=mean(y(icefront(:,1:end-2)),2);
++	zstart=mean(z(icefront(:,1:end-2)),2);
++	length=sqrt((x(icefront(:,1))-x(icefront(:,2))).^2 + (y(icefront(:,1))-y(icefront(:,2))).^2 );
++	normal(:,1)=cos(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
++	normal(:,2)=sin(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
++	xend=xstart+length.*normal(:,1);
++	yend=ystart+length.*normal(:,2);
++	q=quiver3(xstart,ystart,zstart,xend-xstart,yend-ystart,zeros(numel(xstart),1)); hold on;
++	h4=plot3(xstart,ystart,zstart,'r*');
++end
++
++%legend (disable warnings)
++warning off
++legend([h2,h3,h3bis,q],'element on ice front (Water)','element on ice front (Air)','element on ice front (Ice)','normal vectors')
++warning on
++
++%apply options
++options=addfielddefault(options,'title','Neumann boundary conditions');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_transient_field.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_transient_field.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_transient_field.m	(revision 13009)
+@@ -0,0 +1,43 @@
++function plot_transient_field(md,options,width,i,data)
++%PLOT_TRANSIENT_FIELD - plot transient results
++%
++%   Usage:
++%      plot_transient_field(md,options,width,i,data);
++%
++%   See also: PLOTMODEL
++
++%Check that they are transient results
++if (~isfield(md.results,'TransientSolution')),
++	error('plot_transient_field error message: no transient results in the model');
++end
++
++%Figure out the iterations to plot and check if it is possible
++transient=md.results.TransientSolution;
++maxiteration=size(transient,2);
++steps=getfieldvalue(options,'steps',1:1:maxiteration);
++
++if max(steps)>maxiteration | min(steps)<1,
++	error(['plot_transient_field error message: problem with the steps requested, must be an interger between 0 and ' num2str(maxiteration)]);
++end
++subplotwidth=ceil(sqrt(length(steps)));
++
++%Figure out the field to plot
++
++field=getfieldvalue(options,'field','Vel');
++
++%process mes only once
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++%plot data for all steps
++for i=1:length(steps),
++
++	%process data and change title if needed
++	[data datatype]=processdata(md,transient(steps(i)).(field),options);
++	options=changefieldvalue(options,'title',[field ' at time ' num2str(transient(steps(i)).time/md.constants.yts) ' a']);
++
++	%create plot of step i
++	subplot(subplotwidth,subplotwidth,i);
++	plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
++	applyoptions(md,data,options);
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/subplotmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/subplotmodel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/subplotmodel.m	(revision 13009)
+@@ -0,0 +1,35 @@
++function ha=subplotmodel(nlines,ncols,num,options);
++%SUBPLOTMODEL -  tight subplot that includes margins
++%
++%   Usage:
++%      h=subplotmodel(nlines,ncols,i,options)
++
++%Regular subplot
++if ~exist(options,'tightsubplot')
++	subplot(nlines,ncols,num);
++	return;
++end
++
++gap     = getfieldvalue(options,'gap',[.01 .01]);
++hmargin = getfieldvalue(options,'hmargin',[.01 .01]);
++vmargin = getfieldvalue(options,'vmargin',[.01 .01]);
++
++height = (1-sum(vmargin)-(nlines-1)*gap(1))/nlines; 
++width  = (1-sum(hmargin)-(ncols-1)*gap(2))/ncols;
++ymin   = 1-vmargin(2)-height; 
++
++for i = 1:nlines
++	xmin = hmargin(1);
++	for j = 1:ncols
++		if(((i-1)*ncols+j)==num)
++			ha = axes('Units','normalized', ...
++				'Position',[xmin ymin width height],'XTickLabel','','YTickLabel','','Visible','off');
++			return
++		end
++		xmin = xmin+width+gap(2);
++	end
++	ymin = ymin-height-gap(1);
++end
++
++%Activate new axes
++axes(ha);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/quiver_process.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/quiver_process.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/quiver_process.m	(revision 13009)
+@@ -0,0 +1,70 @@
++function [quivers,palette]=quiver_process(x,y,u,v,options)
++%QUIVER_PROCESS - process data for color quiver plot
++%
++%   Usage:
++%      [quivers,palette]=quiver_process(x,y,u,v,options)
++
++%keep only non NaN elements
++pos=find(~isnan(x) & ~isnan(y) & ~isnan(u) & ~isnan(v));
++x=x(pos); y=y(pos);
++u=u(pos); v=v(pos);
++
++%get Norm Min and Max
++Norm=sqrt(u.^2+v.^2);
++Min=min(Norm);
++Max=max(Norm);
++
++%Scale data
++scalingfactor=getfieldvalue(options,'scaling',0.40);
++if strcmpi(getfieldvalue(options,'autoscale','on'),'off'),
++	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
++	u=scalingfactor*sqrt(delta)*u./Norm;
++	v=scalingfactor*sqrt(delta)*v./Norm;
++else
++	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
++	u=scalingfactor*sqrt(delta)*u./max(Norm);
++	v=scalingfactor*sqrt(delta)*v./max(Norm);
++end
++
++%number of colors?
++colorlevels=getfieldvalue(options,'colorlevels',30);
++if isnumeric(colorlevels),
++	if isnan(colorlevels),
++		numcolors=30;
++	else
++		numcolors=colorlevels;
++	end
++	levels=round_ice(linspace(Min,Max,numcolors+1),2);
++else
++	levels=zeros(1,length(colorlevels)+2);
++	levels(1)=Min;
++	for i=1:length(colorlevels)
++		levels(i+1)=colorlevels{i};
++	end
++	levels(end)=Max;
++	levels=sort(unique(levels));
++	numcolors=length(levels)-1;
++end
++
++%create colorind for colors
++colorind=ones(length(u),1);
++for i=1:numcolors
++	pos=find((Norm>=levels(i)) & (Norm<=levels(i+1)) );
++	colorind(pos)=i;
++end
++colorind(find(Norm>levels(end)))=numcolors;
++
++%build output
++quivers=struct('x',x,'y',y,'u',u,'v',v,'levels',levels,'colorind',colorind,'numcolors',numcolors);
++
++%set the colormap 
++if numcolors==2;
++	%blue and red
++	palette=colormap([0 0 1;1 0 0]);
++elseif numcolors==3,
++	%blue yellow and red
++	palette=colormap([0 0 1;1 1 0;1 0 0]);
++else
++	%let jet choose
++	palette=colormap(jet(numcolors));
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_parthistn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_parthistn.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_parthistn.m	(revision 13009)
+@@ -0,0 +1,43 @@
++function plot_parthist(md,options,nlines,ncols,i);
++%PLOT_PARTHIST - plot partitioning histogram
++%
++%   Usage:
++%      plot_parthist(md,options,nlines,ncols,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++%plot mesh
++subplot(nlines,ncols,i); 
++
++imin=min(md.qmu.partition);
++imax=max(md.qmu.partition);
++
++part=zeros(imax-imin+1,2);
++
++for i=imin:imax
++    ind=find(md.qmu.partition == i);
++    part(i-imin+1,1)=length(ind);
++	part(i-imin+1,2)=sum(md.vertex_weight(ind));
++end
++
++%subplot(2,1,1)
++bar(imin:imax,part(:,1));
++%xlim([imin-0.5 imax+0.5])
++%title('Number of Nodes in Each Partition')
++options=addfielddefault(options,'xlim',[imin-0.5 imax+0.5]);
++options=addfielddefault(options,'title','Number of Nodes in Each Partition');
++options=addfielddefault(options,'colorbar','off');
++
++%subplot(2,1,2)
++%bar(imin:imax,part(:,2));
++%xlim([imin-0.5 imax+0.5])
++%title('Total Weight in Each Partition')
++%options=addfielddefault(options,'xlim',[imin-0.5 imax+0.5]);
++%options=addfielddefault(options,'title','Total Weight in Each Partition');
++%options=addfielddefault(options,'colorbar','off');
++
++%apply options
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_highlightvertices.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_highlightvertices.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_highlightvertices.m	(revision 13009)
+@@ -0,0 +1,46 @@
++function plot_highlightvertices(md,options,width,i);
++%PLOT_HIGHLIGHTVERTICES - plot selected vertices
++%
++%   Usage:
++%      plot_highlightvertices(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[nodenumbers datatype]=processdata(md,[1:md.mesh.numberofvertices]',options);
++
++%plot
++subplot(width,width,i); 
++
++if is2d
++	%plot mesh 
++	A=elements(:,1); B=elements(:,2); C=elements(:,3);
++	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++
++	%Highlight
++	pos=getfieldvalue(options,'highlight',[]);
++	text(x(pos),y(pos),z(pos),num2str(transpose(pos)),...
++		'backgroundcolor',[1 0 0],'HorizontalAlignment','center','VerticalAlignment','middle');
++else
++	%plot mesh 
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++
++	%Highlight
++	pos=getfieldvalue(options,'highlight',[]);
++	text(x(pos),y(pos),z(pos),num2str(transpose(pos)),...
++		'backgroundcolor',[1 0 0],'HorizontalAlignment','center','VerticalAlignment','middle');
++end
++
++%apply options
++if ~exist(options,'highlight')
++	disp('highlightvertices warning : highlight option empty, not node highlighted');
++end
++options=addfielddefault(options,'title','Highlighted Nodes');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftrelvel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftrelvel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftrelvel.m	(revision 13009)
+@@ -0,0 +1,115 @@
++function plot_riftrelvel(md,options,nlines,ncols,index);
++%PLOT_RIFTRELVEL - plot rift relative velocities
++%
++%   Usage:
++%      plot_riftrelvel(md,options,nlines,ncols,i);
++%
++%   See also: PLOTMODEL
++
++%some checks
++if (length(md.initialization.vx)~=md.mesh.numberofvertices | length(md.initialization.vy)~=md.mesh.numberofvertices),
++	error('plot_riftvel error message: vx and vy do not have the right size'),
++end
++if ~isstruct(md.rifts.riftstruct),
++	error('plot error message: no rifts available!');
++end
++options=addfielddefault(options,'scaling',2);
++
++%recover vx and vy:
++vx=getfieldvalue(options,'riftrelvel_vx',md.initialization.vx);
++vy=getfieldvalue(options,'riftrelvel_vy',md.initialization.vy);
++
++%set as NaN all velocities not on rifts
++u=NaN*ones(md.mesh.numberofvertices,1);
++v=NaN*ones(md.mesh.numberofvertices,1);
++for i=1:size(md.rifts.riftstruct,1),
++	penaltypairs=md.rifts.riftstruct(i).penaltypairs(:,[1 2]);
++	u(md.rifts.riftstruct(i).penaltypairs(:,1))=vx(penaltypairs(:,1))-vx(penaltypairs(:,2));
++	v(md.rifts.riftstruct(i).penaltypairs(:,1))=vy(penaltypairs(:,1))-vy(penaltypairs(:,2));
++end
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[vel datatype]=processdata(md,[u v],options);
++[quivers,palette]=quiver_process(x,y,vel(:,1),vel(:,2),options);
++
++%prepare plot
++subplot(nlines,ncols,index); 
++hold on
++
++%plot mesh boundaries
++for i=1:size(md.mesh.segments,1),
++	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k-');
++end
++
++%plot rifts vel
++h3=[];
++for i=1:quivers.numcolors
++	pos=find(quivers.colorind==i);
++	hprime=quiver(quivers.x(pos),quivers.y(pos),quivers.u(pos),quivers.v(pos),...
++		'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
++	hprime=quiver(quivers.x(pos),quivers.y(pos),-quivers.u(pos),-quivers.v(pos),...
++		'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
++	h3=[h3;hprime];
++end
++
++%plot rift velocities
++isp1=0;
++isp2=0;
++
++%plot mesh boundaries
++for i=1:size(md.mesh.segments,1),
++	h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
++end
++for i=1:size(md.rifts.riftstruct,1),
++	
++	%get nodes on rift
++	penaltypairs=md.rifts.riftstruct(i).penaltypairs;
++
++	segments=md.rifts.riftstruct(i).segments;
++	for j=1:size(segments,1),
++		plot(x(segments(j,1:2)),y(segments(j,1:2)),'k-');
++	end
++
++	normal=zeros(2,1);
++	for j=1:size(penaltypairs,1),
++		normal(1)=penaltypairs(j,5);
++		normal(2)=penaltypairs(j,6);
++
++		vx1=vx(penaltypairs(j,1)); vx2=vx(penaltypairs(j,2)); vy1=vy(penaltypairs(j,1)); vy2=vy(penaltypairs(j,2));
++		penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
++		%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
++		if(penetration>0),
++			p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'*'); set(p2,'Color',[140 140 140]/255);
++			isp2=1;
++		else
++			p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k*');
++			isp1=1;
++		end
++	end
++
++	%point out the tips
++	h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g*');
++	plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g*');
++	segments=md.rifts.riftstruct(i).segments(:,1:2);
++end
++%legend
++if strcmpi(getfieldvalue(options,'legend','on'),'on'),
++	if isp1 & isp2
++		l=legend([h1,h2,p1,p2],'mesh boundaries','crack tips','faults','rifts');
++	elseif isp1
++		l=legend([h1,h2,p1],'mesh boundaries','crack tips','faults');
++	elseif isp2
++		l=legend([h1,h2,p2],'mesh boundaries','crack tips','rifts');
++	else
++		l=legend([h1,h2],'mesh boundaries','crack tips');
++	end
++set(l,'Location',getfieldvalue(options,'legend_location','NorthEast'));
++end
++hold off
++
++%apply options
++quiver_colorbar(quivers,options);
++options=changefieldvalue(options,'colorbar',2);
++options=addfielddefault(options,'title','Rift/Fault Relative Velocity');
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_sarpwr.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_sarpwr.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_sarpwr.m	(revision 13009)
+@@ -0,0 +1,26 @@
++function plot_sarpwr(md,options,width,i);
++%PLOT_SARPWR - plot radar image
++%
++%   Usage:
++%      plot_sarpwr(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%plot mesh sarpwr
++subplot(width,width,i); 
++
++%units
++if exist(options,'unit'),
++	unit=getfieldvalue(options,'unit');
++	md.mesh.x=md.mesh.x*unit;
++	md.mesh.y=md.mesh.y*unit;
++	md.mesh.z=md.mesh.z*unit;
++end
++					
++imagesc(md.radaroverlay.x,md.radaroverlay.y,double(md.radaroverlay.pwr)),set(gca,'YDir','normal');colormap(gray);
++
++%apply options
++options=addfielddefault(options,'colorbar',0);
++options=changefieldvalue(options,'colormap','gray');
++
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_vertexnumbering.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_vertexnumbering.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_vertexnumbering.m	(revision 13009)
+@@ -0,0 +1,51 @@
++function plot_vertexnumbering(md,options,width,i);
++%PLOT_VERTEXNUMBERING - plot vertex numbering
++%
++%   Usage:
++%      plot_vertexnumbering(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[vertexnumbers datatype]=processdata(md,[1:md.mesh.numberofvertices]',options);
++
++%plot
++subplot(width,width,i); 
++
++if is2d
++	%plot mesh 
++	A=elements(:,1); B=elements(:,2); C=elements(:,3);
++	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++
++	%numbering
++	text(x,y,z,num2str(transpose(1:size(x,1))),...
++		'backgroundcolor',[0.8 0.9 0.8],'HorizontalAlignment','center','VerticalAlignment','middle');
++
++	%Highlight
++	pos=getfieldvalue(options,'highlight',[]);
++	text(x(pos),y(pos),z(pos),num2str(transpose(pos)),...
++		'backgroundcolor',[1 0 0],'HorizontalAlignment','center','VerticalAlignment','middle');
++else
++	%plot mesh 
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++
++	%numbering
++	text(x,y,z,num2str(transpose(1:size(x,1))),...
++		'backgroundcolor',[0.8 0.9 0.8],'HorizontalAlignment','center','VerticalAlignment','middle');
++
++	%Highlight
++	pos=getfieldvalue(options,'highlight',[]);
++	text(x(pos),y(pos),z(pos),num2str(transpose(pos)),...
++		'backgroundcolor',[1 0 0],'HorizontalAlignment','center','VerticalAlignment','middle');
++end
++
++%apply options
++options=addfielddefault(options,'title','Node numbering');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/showregion.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/showregion.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/showregion.m	(revision 13009)
+@@ -0,0 +1,34 @@
++function showregion(md,insetpos)
++%SHOWREGION - show region on plot
++%
++%   Usage:
++%      showregion(md,insetpos);
++
++%get inset relative position (x,y,width,height)
++%insetpos=getfieldvalue(options,'insetpos',[0.02 0.70 0.18 0.18]);
++
++%get current plos position
++cplotpos=get(gca,'pos');
++%compute inset position
++PosInset=[cplotpos(1)+insetpos(1)*cplotpos(3),cplotpos(2)+insetpos(2)*cplotpos(4), insetpos(3)*cplotpos(3), insetpos(4)*cplotpos(4)];
++axes('pos',PosInset);
++axis equal off
++%box off
++if strcmpi(md.mesh.hemisphere,'n') | strcmpi(md.mesh.hemisphere,'north'),
++	A=expread([issmdir() 'projects/Exp/Greenland.exp']);
++elseif strcmpi(md.mesh.hemisphere,'s') | strcmpi(md.mesh.hemisphere,'south'),
++	A=expread([issmdir() '/projects/Exp/Antarctica.exp']);
++else
++	error('applyoptions error message: hemisphere not defined');
++end
++
++Ax=[min(A.x) max(A.x)];
++Ay=[min(A.y) max(A.y)];
++
++mdx=[min(md.mesh.x) max(md.mesh.x)];
++mdy=[min(md.mesh.y) max(md.mesh.y)];
++
++line(A.x,A.y,'color','b');
++patch([Ax(1)  Ax(2)  Ax(2)  Ax(1) Ax(1)],[Ay(1)  Ay(1)  Ay(2)  Ay(2) Ay(1)],[1 1 1],'EdgeColor',[0 0 0],'LineWidth',1,'FaceLighting','none')
++patch( [mdx(1) mdx(2) mdx(2) mdx(1)],[mdy(1) mdy(1) mdy(2) mdy(2)],ones(4,1),'EdgeColor',[0 0 0],'FaceColor','r','FaceAlpha',0.5)
++colorbar('off');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_boundaries.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_boundaries.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_boundaries.m	(revision 13009)
+@@ -0,0 +1,39 @@
++function plot_boundaries(md,options,width,i);
++%PLOT_BOUNDARIES - plot mesh boundaries
++%
++%   Usage:
++%      plot_boundaries(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++subplot(width,width,i); 
++
++%process data and model
++if getfieldvalue(options,'layer',0)
++	options=removefield(options,'layer',1);
++end
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++for i=1:size(md.mesh.segments,1),
++	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');hold on;
++end
++
++%plot rifts if present: 
++if isstruct(md.rifts.riftstruct),
++	for i=1:size(md.rifts.riftstruct,1),
++		segments=md.rifts.riftstruct(i).segments;
++		for j=1:size(segments,1),
++			plot(x(segments(j,1:2)),y(segments(j,1:2)),'r.-');
++		end
++		text(x(segments(floor(size(segments,1)/4),1)),y(segments(floor(size(segments,1)/4),1)),['Rift #' num2str(i)]);
++		%point out the tips
++		plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'b*');
++		plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'b*');
++	end
++end
++
++%apply options
++options=addfielddefault(options,'title','Mesh boundaries');
++options=addfielddefault(options,'colorbar',0);
++options=addfielddefault(options,'view',2);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_mesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_mesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_mesh.m	(revision 13009)
+@@ -0,0 +1,41 @@
++function plot_mesh(md,options,nlines,ncols,i);
++%PLOT_MESH - plot model mesh
++%
++%   Usage:
++%      plot_mesh(md,options,nlines,ncols,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++%plot mesh
++subplot(nlines,ncols,i); 
++
++%retrieve some options
++linewidth=getfieldvalue(options,'linewidth',1);
++edgecolor=getfieldvalue(options,'edgecolor','black');
++
++%plot mesh
++if is2d
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
++else
++	if ~isplanet,
++		A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++		patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
++		patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
++		patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
++		patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
++		patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
++	else
++		A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++		if (size(elements,2)==4), D=elements(:,4); else D=C; end
++		patch( 'Faces', [A B C D],  'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
++	end
++end
++
++%apply options
++options=addfielddefault(options,'title','Mesh');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_quiver3.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_quiver3.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_quiver3.m	(revision 13009)
+@@ -0,0 +1,104 @@
++function plot_quiver3(x,y,z,u,v,w,options),
++%PLOT_QUIVER3 - 3d quiver plot with colors
++%
++%   to be perfected tomorrow
++%
++%   Usage:
++%      plot_quiver3(x,y,z,u,v,w,options)
++%
++%   Example:
++%      plot_quiver(md.mesh.x,md.mesh.y,md.mesh.z,md.initialization.vx,md.initialization.vy,md.initialization.vz,options);
++
++%keep only non NaN elements
++pos=find(~isnan(x) & ~isnan(y) & ~isnan(z) & ~isnan(u) & ~isnan(v) & ~isnan(w));
++x=x(pos); y=y(pos); z=z(pos);
++u=u(pos); v=v(pos); w=w(pos);
++
++%get norm Min and Max
++Norm=sqrt(u.^2+v.^2+w.^2);
++Min=min(Norm);
++Max=max(Norm);
++
++%process options: scaling factor?
++scalingfactor=getfieldvalue(options,'scaling',0.40);
++
++%number of colors?
++colorlevels=getfieldvalue(options,'colorlevels',NaN);
++if isnumeric(colorlevels),
++	if isnan(colorlevels),
++		numcolors=30;
++	else
++		numcolors=colorlevels;
++	end
++	levels=round_ice(linspace(Min,Max,numcolors+1),2);
++else
++	levels=zeros(1,length(colorlevels)+2);
++	levels(1)=Min;
++	for i=1:length(colorlevels)
++		levels(i+1)=colorlevels{i};
++	end
++	levels(end)=Max;
++	levels=sort(unique(levels));
++	numcolors=length(levels)-1;
++end
++
++%set the colormap 
++if numcolors==2;
++	%blue and red
++	c=[0 0 1;1 0 0];
++elseif numcolors==3,
++	%blue yellow and red
++	c=[0 0 1;1 1 0;1 0 0];
++else
++	%let jet choose
++	c=colormap(jet(numcolors));
++end
++
++%Scale data
++if strcmpi(getfieldvalue(options,'autoscale','on'),'off'),
++	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
++	u=scalingfactor*sqrt(delta)*u./Norm;
++	v=scalingfactor*sqrt(delta)*v./Norm;
++else
++	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
++	u=scalingfactor*sqrt(delta)*u./max(Norm);
++	v=scalingfactor*sqrt(delta)*v./max(Norm);
++end
++
++%loop over the number of colors
++hold on
++h=[];
++for i=1:numcolors
++	pos=find( (Norm>=levels(i)) & (Norm<=levels(i+1)) );
++	hprime=quiver3(x(pos),y(pos),z(pos),u(pos),v(pos),w(pos),'Color',c(i,:),'ShowArrowHead','on','AutoScale','off');
++	h=[h;hprime];
++end
++
++%take care of colorbar
++if  ~strcmpi(getfieldvalue(options,'colorbar','on'),'off'),
++
++	%build ticks
++	hcb=colorbar('peer',gca,'location','EastOutside');
++	ticklabel=cell(1,length(levels));
++	for i=1:length(levels),
++		ticklabel{i}=num2str(round_ice(levels(i),3));
++	end
++	tickpos=1:numcolors+1;
++
++	%remove ticks if to many have been created
++	proportion=round(length(levels)/10);
++	if proportion>1,
++		ticklabel=ticklabel(1:proportion:end);
++		tickpos=tickpos(1:proportion:end);
++	end
++
++	%draw colorbar
++	set(hcb,'YTickLabel',ticklabel,'YTick',tickpos);
++	%position
++	if exist(options,'colorbarpos'),
++		set(hcb,'Position',getfieldvalue(options,'colorbarpos'));
++	end
++	%fontsize
++	fontsize=getfieldvalue(options,'fontsize',14);
++	set(hcb,'FontSize',fontsize);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_none.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_none.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_none.m	(revision 13009)
+@@ -0,0 +1,20 @@
++function plot_none(md,options,nlines,ncols,i);
++%PLOT_NONE - plot nothing, just apply options
++%
++%   Usage:
++%      plot_mesh(md,options,nlines,ncols,i);
++%
++%   See also: PLOTMODEL
++return;
++
++options=addfielddefault(options,'colorbar','none');
++options=addfielddefault(options,'map','none');
++options=addfielddefault(options,'axis','equal');
++
++if exist(options,'overlay'),
++	plot_overlay(md,'none',options,nlines,ncols,i);
++	return;
++end
++
++%apply options
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor_principalaxis.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor_principalaxis.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor_principalaxis.m	(revision 13009)
+@@ -0,0 +1,95 @@
++function plot_tensor_principalaxis(md,options,width,i,tensor,type,plot_options);
++%PLOT_TENSOR_PRINCIPALAXIS - plot ytensor principal axis
++%
++%   Usage:
++%      plot_tensor_principalaxis(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%prepare subplot
++subplot(width,width,i); 
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++if ((md.mesh.dimension==2)),
++	eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2);'])
++	eval(['value=tensor.principalvalue' type(end) ';']);
++	[Vx datatype]=processdata(md,Vx,options);
++	[Vy datatype]=processdata(md,Vy,options);
++	[value datatype]=processdata(md,value,options);
++else
++	eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2); Vz=tensor.principalaxis' type(end) '(:,3);'])
++	[Vx datatype]=processdata(md,Vx,options);
++	[Vy datatype]=processdata(md,Vy,options);
++	[Vz datatype]=processdata(md,Vz,options);
++	[value datatype]=processdata(md,value,options);
++end
++
++%take the center of each element if ~isonnode
++if datatype==1,
++	x=mean(md.mesh.x(md.mesh.elements'))'; y=mean(md.mesh.y(md.mesh.elements'))'; z=mean(md.mesh.z(md.mesh.elements'))';
++end
++
++%plot quivers
++if (md.mesh.dimension==2),
++
++	%density
++	if exist(options,'density')
++		density=getfieldvalue(options,'density');
++		x=x(1:density:end);
++		y=y(1:density:end);
++		Vx=Vx(1:density:end);
++		Vy=Vy(1:density:end);
++		value=value(1:density:end);
++	end
++
++	%scaling:
++	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
++	scale=0.5/max(sqrt((Vx.^2+Vy.^2)/delta));
++	Vx=scale*Vx; Vy=scale*Vy;
++
++	pos=find(value>=0);
++	q1=quiver(x(pos),y(pos),Vx(pos),Vy(pos),'Color','r','ShowArrowHead','off','AutoScale','off');
++	hold on
++	pos=find(value<0);
++	q2=quiver(x(pos),y(pos),Vx(pos),Vy(pos),'Color','b','ShowArrowHead','off','AutoScale','off');
++
++else
++	%density
++	if exist(options,'density')
++		density=getfieldvalue(options,'density');
++		x=x(1:density:end);
++		y=y(1:density:end);
++		z=z(1:density:end);
++		Vx=Vx(1:density:end);
++		Vy=Vy(1:density:end);
++		Vz=Vz(1:density:end);
++		value=value(1:density:end);
++	end
++
++	%scaling:
++	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
++	scale=0.5/max(sqrt((Vx.^2+Vy.^2)/delta));
++	Vx=scale*Vx; Vy=scale*Vy; Vz=scale*Vz;
++
++	pos=find(value>=0);
++	q1=quiver3(x(pos),y(pos),z(pos),Vx(pos),Vy(pos),Vz(pos),'Color','r','ShowArrowHead','off','AutoScale','off');
++	hold on
++	pos=find(value<0);
++	q2=quiver3(x(pos),y(pos),z(pos),Vx(pos),Vy(pos),Vz(pos),'Color','b','ShowArrowHead','off','AutoScale','off');
++end
++
++%legend
++if strcmpi(type(1:6),'strain')
++	legend([q1 q2],'extension','compression')
++elseif strcmpi(type(1:6),'stress')
++	legend([q1 q2],'compression','traction')
++end
++
++%apply options
++strings=strsplit(type,'_');
++string=strings{1};
++options=addfielddefault(options,'title',[upper(string(1)) string(2:end) ' principal axis ' type(end)]);
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_elementnumbering.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_elementnumbering.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_elementnumbering.m	(revision 13009)
+@@ -0,0 +1,57 @@
++function plot_elementnumbering(md,options,width,i);
++%PLOT_ELEMENTNUMBERING - plot element numbering
++%
++%   Usage:
++%      plot_elementnumbering(md,options,width,i);
++%
++%   See also: PLOTMODEL, PLOT_UNIT, PLOT_MANAGER
++
++subplot(width,width,i); 
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[elementnumbers datatype]=processdata(md,[1:md.mesh.numberofelements]',options);
++
++%plot
++if is2d
++	%plot mesh 
++	A=elements(:,1); B=elements(:,2); C=elements(:,3);
++	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++
++	%highlight
++	pos=getfieldvalue(options,'highlight',[]);
++	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
++	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
++
++	%numbering
++	text(sum(x(elements(:,1:3)),2)/3,sum(y(elements(:,1:3)),2)/3,sum(z(elements(:,1:3)),2)/3,...
++		num2str(transpose(1:size(elements,1))),...
++		'HorizontalAlignment','center','VerticalAlignment','middle');
++else
++	%plot mesh 
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++
++	%highlight
++	pos=getfieldvalue(options,'highlight',[]);
++	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
++	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','none','EdgeColor','black');
++
++	%numbering
++	text(sum(x(elements(:,1:6)),2)/6,sum(y(elements(:,1:6)),2)/6,sum(z(elements(:,1:6)),2)/6,...
++		num2str(transpose(1:size(elements,1))),...
++		'HorizontalAlignment','center','VerticalAlignment','middle');
++end
++
++%apply options
++options=addfielddefault(options,'title','Element numbering');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plotmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plotmodel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plotmodel.m	(revision 13009)
+@@ -0,0 +1,57 @@
++function plotmodel(md,varargin)
++%At command prompt, type plotdoc for help on documentation.
++
++%First process options
++options=plotoptions(varargin{:});
++
++%get number of subplots
++subplotwidth=ceil(sqrt(options.numberofplots));
++
++%if nlines and ncols specified, then bypass.
++if exist(options.list{1},'nlines'),
++	nlines=getfieldvalue(options.list{1},'nlines');
++else 
++	nlines=subplotwidth;
++end
++
++if exist(options.list{1},'ncols'),
++	ncols=getfieldvalue(options.list{1},'ncols');
++else 
++	ncols=subplotwidth;
++end
++
++%check that nlines and ncols were given at the same time!
++if ((exist(options.list{1},'ncols') & ~exist(options.list{1},'ncols')) | (~exist(options.list{1},'ncols') & exist(options.list{1},'ncols')))
++	error('plotmodel error message: nlines and ncols  need to be specified together, or not at all');
++end
++
++%Get figure number and number of plots
++figurenumber=options.figurenumber;
++numberofplots=options.numberofplots;
++
++%go through subplots
++if numberofplots,
++		
++	%Create figure 
++	if strcmpi(getfieldvalue(options.list{1},'visible','on'),'off'),
++		F=figure(figurenumber);clf;
++		set(F,'Visible','Off');
++	else
++		figure(figurenumber);clf;
++	end
++
++	%Use zbuffer renderer (snoother colors)
++	set(gcf,'Renderer','zbuffer');
++
++	%Go through all data plottable and close window if an error occurs
++	try,
++		for i=1:numberofplots,
++			plot_manager(getfieldvalue(options.list{i},'model',md),options.list{i},subplotwidth,nlines,ncols,i);
++		end
++	catch me,
++		%figure(figurenumber),close;
++		rethrow(me);
++	end
++else
++	error('plotmodel error message: no output data found. ');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_gridded.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_gridded.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_gridded.m	(revision 13009)
+@@ -0,0 +1,64 @@
++function plot_gridded(md,data,options,plotlines,plotcols,i)
++%PLOT_OVERLAY - superimpose radar image to a given field
++%
++%   Usage:
++%      plot_gridded(md,options,plotlines,plotcols,i)
++%
++%   See also: PLOTMODEL
++
++%process mesh and data
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[data datatype]=processdata(md,data,options);
++
++%check is2d
++if ~is2d, 
++	error('buildgridded error message: gridded not supported for 3d meshes, project on a layer');
++end
++
++%Get xlim and ylim (used to extract radar image)
++xlim=getfieldvalue(options,'xlim',[min(x) max(x)]);
++ylim=getfieldvalue(options,'ylim',[min(y) max(y)]);
++post=getfieldvalue(options,'posting',diff(xlim)/1000);
++
++%Interpolating data on grid
++[x_m y_m data_grid]=InterpFromMeshToGrid(elements,x,y,data,xlim(1),ylim(2),post,post,round(diff(ylim)/post),round(diff(xlim)/post),NaN);
++if size(data_grid,1)<3 | size(data_grid,2)<3,
++	error('data_grid size too small in plot_gridded, check posting and uni');
++end
++
++%Get and change colormap
++map    = getcolormap(options);
++lenmap = size(map,1);
++map    = [1 1 1; map];
++options=changefieldvalue(options,'colormap',map);
++
++%Process data_grid: add white in NaN and correct caxis accordingly
++if exist(options,'caxis'),
++	caxis_opt=getfieldvalue(options,'caxis');
++	data_grid(find(data_grid<caxis_opt(1)))=caxis_opt(1);
++	data_grid(find(data_grid>caxis_opt(2)))=caxis_opt(2);
++	data_min=caxis_opt(1);
++	data_max=caxis_opt(2);
++else
++	data_min=min(data_grid(:));
++	data_max=max(data_grid(:));
++end
++options = changefieldvalue(options,'cbYLim',[data_min data_max]);
++white   = data_min - (data_max-data_min)/(lenmap);
++options = changefieldvalue(options,'caxis',[white data_max]);
++data_grid(isnan(data_grid))=white;
++
++%Select plot area 
++subplotmodel(plotlines,plotcols,i,options);
++
++%shading interp;
++h=imagesc(xlim,ylim,data_grid);set(gca,'YDir','normal');
++
++%last step: mesh gridded?
++if exist(options,'edgecolor'),
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++	patch('Faces',[A B C],'Vertices', [x y z],'FaceVertexCData',data_grid(1)*ones(size(x)),'FaceColor','none','EdgeColor',getfieldvalue(options,'edgecolor'));
++end
++
++%Apply options
++applyoptions(md,data,options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_section.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_section.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_section.m	(revision 13009)
+@@ -0,0 +1,210 @@
++function plot_section(md,data,options,nlines,ncols,i)
++%PLOT_SECTION - plot a given field on a section
++%
++%   Usage:
++%      plot_section(md,data,options,nlines,ncols,i)
++%
++%   See also: PLOTMODEL
++
++%How many subplots?
++if exist(options,'showsection')
++
++	%Compute the indexes of the 2 plots (one for the sectionvalue and one for showsection
++	upperplots=floor((i-1)/ncols);
++	if upperplots==0, leftplots=i-1; else leftplots=i-ncols*upperplots-1; end
++	index1=4*ncols*upperplots+2*leftplots+1;
++	index2=index1+1;
++	ncols=2*ncols;
++else
++	index1=i;
++end
++
++%process model
++[x_m y_m z_m elements_m is2d isplanet]=processmesh(md,[],options);
++
++%Get number of curves and generate random colors
++numcurves=size(data,2);
++colorm=getfieldvalue(options,'colormap','lines');
++color=eval([ colorm '(numcurves);']);
++options=removefield(options,'colormap',0); %back to default colormap
++
++%replug x and y onto model so that SectionValue treats the problem correctly
++md3d=md;
++if exist(options,'layer')
++	md.mesh.x=md.mesh.x2d; md.mesh.y=md.mesh.y2d; md.mesh.elements=md.mesh.elements2d; md.mesh.dimension=2;
++end
++
++%read contours: 
++profiles=expread(getfieldvalue(options,'sectionvalue'));
++numprofiles=length(profiles);
++
++%Loop over number of profiles: 
++for profile_i=1:numprofiles,
++	profile=profiles(profile_i);
++
++	%Loop over number of curves
++	for i=1:numcurves,
++
++		[datai datatype]=processdata(md3d,data(:,i),options);
++
++		%resolution
++		if exist(options,'resolution'),
++			resolution=getfieldvalue(options,'resolution');
++		else %Default resolution
++			resolution=[1000 10*md.mesh.numberoflayers];
++			disp(['plot_section warning: no resolution specified, use default resolution: [horizontal_resolution vertical_resolution]=[' num2str(resolution)  ']']);
++		end
++
++		%Compute section value
++		[elements,x,y,z,s,data_s]=SectionValues(md,datai,profile,resolution);
++
++		%units
++		if exist(options,'unit'),
++			unit=getfieldvalue(options,'unit');
++			x=x*unit;
++			y=y*unit;
++			z=z*unit;
++			s=s*unit;
++		end
++
++		%2D
++		if is2d,
++%		%plot section value
++%		hold on;
++%		subplot(nlines,ncols,index1)
++%		%subplot(1,3,[2 3])
++%		plot(s,data_s,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1))
++%		%3D
++%	else
++%		%plot section value
++%		%if user requested view2: 2d plot with curvilinear coordinate
++%		if (getfieldvalue(options,'view',3)==2 )
++
++			%Show Section if requested by user
++			if exist(options,'showsection')
++
++				%compute number of labels
++				numlabels=min(getfieldvalue(options,'showsection'),length(s));
++				shift=fix(length(s)/numlabels);
++
++				%plot labels on current graph
++				hold on
++				text(s(1),data_s(1),'1','backgroundcolor',[0.8 0.9 0.8])
++				for i=2:numlabels-1
++					text(s(1+(i-1)*shift),data_s(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
++				end
++				text(s(end),data_s(end),'end','backgroundcolor',[0.8 0.9 0.8])
++
++				%plot section only with labels
++				subplot(nlines,ncols,index2)
++				plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,isplanet,datatype,options)
++				hold on
++				text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8])
++				for i=2:numlabels-1
++					text(x(1+(i-1)*shift),y(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
++				end
++				text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8])
++				plot(x,y,'-r')
++				axis([min(md.mesh.x)-1 max(md.mesh.x)+1 min(md.mesh.y)-1 max(md.mesh.y)+1])
++				view(2)
++			end
++
++			%plot section value
++			if(i==1), subplot(nlines,ncols,index1); end
++			plot(s,data_s,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1))
++			hold on
++
++
++			%3D
++		else
++			%plot section value
++			%if user requested view2: 2d plot with curvilinear coordinate
++			if (getfieldvalue(options,'view',3)==2 )
++
++				%Show Section if requested by user
++				if exist(options,'showsection')
++
++					%compute number of labels
++					numlabels=min(getfieldvalue(options,'showsection'),length(s));
++					shift=fix(length(s)/numlabels);
++
++					%plot labels on current graph
++					hold on
++					text(s(1),z(1),'1','backgroundcolor',[0.8 0.9 0.8])
++					for i=2:numlabels-1
++						text(s(1+(i-1)*shift),z(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
++					end
++					text(s(end),z(end),'end','backgroundcolor',[0.8 0.9 0.8])
++
++					%plot section only with labels
++					subplot(nlines,ncols,index2)
++					plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,datatype,options)
++					hold on
++					text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8])
++					for i=2:numlabels-1
++						text(x(1+(i-1)*shift),y(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
++					end
++					text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8])
++					plot(x,y,'-r')
++					axis([min(md.mesh.x)-1 max(md.mesh.x)+1 min(md.mesh.y)-1 max(md.mesh.y)+1])
++					view(2)
++				end
++
++				subplot(nlines,ncols,index1)
++				A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4); 
++				patch( 'Faces', [A B C D], 'Vertices', [s z zeros(length(s),1)],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none');
++
++			else
++
++				%Show Section if requested by user
++				if exist(options,'showsection')
++
++					%compute number of labels
++					numlabels=min(getfieldvalue(options,'showsection'),length(s));
++					shift=fix(length(x)/numlabels);
++
++					%plot labels on current graph
++					hold on
++					text(x(1),y(1),z(1),'1','backgroundcolor',[0.8 0.9 0.8])
++					for i=2:numlabels-1
++						text(x(1+(i-1)*shift),y(1+(i-1)*shift),z(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
++					end
++					text(x(end),y(end),z(end),'end','backgroundcolor',[0.8 0.9 0.8])
++
++					%plot section only with labels
++					subplot(nlines,ncols,index2)
++					plot_unit(x_m,y_m,z_m,elements_m,data,is2d,datatype,options)
++					hold on
++					text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8])
++					for i=2:numlabels-1
++						text(x(1+(i-1)*shift),y(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])
++					end
++					text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8])
++					plot(x,y,'-r')
++					axis([min(md.mesh.x)-1 max(md.mesh.x)+1 min(md.mesh.y)-1 max(md.mesh.y)+1])
++					view(2)
++				end
++
++				subplot(nlines,ncols,index1)
++				A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4); 
++				patch( 'Faces', [A B C D], 'Vertices', [x y z],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none');
++				view(3)
++
++			end
++		end
++	end
++end
++
++%apply options
++options=addfielddefault(options,'title','Section value');
++if (md.mesh.dimension==2)
++	options=addfielddefault(options,'colorbar',0);
++end
++if ((md.mesh.dimension==2) | getfieldvalue(options,'view')==2 )
++	options=addfielddefault(options,'xlabel','Curvilinear coordinate');
++	options=addfielddefault(options,'axis','auto');
++end
++if (md.mesh.dimension==3 & getfieldvalue(options,'view')==2 )
++	options=addfielddefault(options,'ylabel','z');
++end
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_scatter.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_scatter.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_scatter.m	(revision 13009)
+@@ -0,0 +1,74 @@
++function plot_scatter(x,y,mksize,level),
++
++%check input
++if numel(x)~=numel(y) | numel(x)~=numel(level),
++	error('x, y and data should have the same size');
++end
++
++%Some processing
++Min=min(level);
++Max=max(level);
++Siz=length(level);
++nlab=10;
++
++%OK, should we create a new colorbar for the occasion?
++if isempty(findobj(gcf,'tag','TMW_COLORBAR')),
++	alreadyplot=false;
++else
++	alreadyplot=true;
++end
++
++%generate levels
++if (alreadyplot),
++	phch = get(findall(gcf,'type','image','tag','TMW_COLORBAR'),{'parent'});
++	h    = phch{1};
++	ylim=get(h,'YLim');
++	palette=colormap;
++	numcolors=size(palette,1);
++	levels=round_ice(linspace(ylim(1),ylim(2),numcolors+1),2);
++else
++	numcolors=30;
++	levels=round_ice(linspace(Min,Max,numcolors+1),2);
++	palette=colormap(jet(numcolors));
++end
++
++colorind=ones(Siz,1);
++for i=1:numcolors
++	pos=find((level>=levels(i)) & (level<=levels(i+1)) );
++	colorind(pos)=i;
++end
++colorind(find(level>levels(end)))=numcolors;
++
++%loop over the number of colors
++hold on
++hp=[];
++for i=1:numcolors
++	pos=find(colorind==i);
++	hprime=plot(x(pos),y(pos),...
++		'o','MarkerSize',mksize,'MarkerEdgeColor',palette(i,:),...
++		'MarkerFaceColor',palette(i,:));
++	hp=[hp;hprime];
++end
++
++if ~alreadyplot,
++	% format the colorbar
++	h    = colorbar;
++	nlab = abs(nlab);                       % number of labels must be positive
++	set(h,'YLim',[1 numcolors]);                  % set colorbar limits
++	set(h,'YTick',linspace(1,numcolors,nlab));    % set tick mark locations
++
++	labels = cell(1,nlab);
++	tick_vals = linspace(Min,Max,nlab);
++	warning off MATLAB:log:logOfZero;
++	for i = 1:nlab
++		if min(log10(abs(tick_vals))) <= 3, fm = '%-4.0f';   % fixed
++		else                                fm = '%-4.0E';   % floating
++		end
++		labels{i} = sprintf(fm,tick_vals(i));
++	end
++	warning on MATLAB:log:logOfZero;
++
++	% set tick label strings
++	set(h,'YTickLabel',labels);
++	%colorbar %one last time required sometimes
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_manager.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_manager.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_manager.m	(revision 13009)
+@@ -0,0 +1,204 @@
++function plot_manager(md,options,subplotwidth,nlines,ncols,i);
++%PLOT__MANAGER - distribute the plots, called by plotmodel
++%
++%   Usage:
++%      plot_manager(md,options,subplotwidth,i);
++%
++%   See also: PLOTMODEL, PLOT_UNIT
++
++%parse options and get a structure of options. 
++options=checkplotoptions(md,options);
++
++%get data to be displayed
++data=getfieldvalue(options,'data');
++
++%figure out if this is a special plot
++if ischar(data),
++
++	switch data,
++
++		case 'boundaries',
++			plot_boundaries(md,options,subplotwidth,i);
++			return;
++		case 'BC',
++			plot_BC(md,options,subplotwidth,i,data);
++			return;
++		case 'edges'
++			plot_edges(md,options,subplotwidth,i,data)
++			return
++		case 'elementnumbering',
++			plot_elementnumbering(md,options,subplotwidth,i);
++			return;
++		case 'highlightelements',
++			plot_highlightelements(md,options,subplotwidth,i);
++			return;
++		
++		case 'qmumean',
++			plot_qmumean(md,options,nlines,ncols,i);
++			return;
++		
++		case 'qmustddev',
++			plot_qmustddev(md,options,nlines,ncols,i);
++			return;
++		
++		case 'qmuhistnorm',
++			plot_qmuhistnorm(md,options,nlines,ncols,i);
++			return;
++
++		case 'qmu_mass_flux_segments',
++			plot_qmu_mass_flux_segments(md,options,nlines,ncols,i);
++			return;
++
++		case 'part_hist',
++			plot_parthist(md,options,nlines,ncols,i);
++			return;
++		case 'part_hist_n',
++			plot_parthistn(md,options,nlines,ncols,i);
++			return;
++		case 'part_hist_w',
++			plot_parthistw(md,options,nlines,ncols,i);
++			return;
++		case 'elements_type',
++			plot_elementstype(md,options,subplotwidth,i);
++			return;
++		case 'vertexnumbering',
++			plot_vertexnumbering(md,options,subplotwidth,i);
++			return;
++		case 'highlightvertices',
++			plot_highlightvertices(md,options,subplotwidth,i);
++			return;
++		case {'basal_drag','basal_dragx','basal_dragy'},
++			plot_basaldrag(md,options,subplotwidth,i,data);
++			return;
++		case 'driving_stress',
++			plot_drivingstress(md,options,subplotwidth,i);
++			return;
++		case 'mesh',
++			plot_mesh(md,options,nlines,ncols,i);
++			return;
++		case 'none',
++			if ~exist(options,'overlay'),
++				plot_none(md,options,nlines,ncols,i);
++				return;
++			end
++		case 'penalties',
++			plot_penalties(md,options,subplotwidth,i);
++			return;
++		case 'partition',
++			plot_partition(md,options,nlines,ncols,i);
++			return;
++		case 'referential',
++			plot_referential(md,options,nlines,ncols,i);
++			return;
++		case 'riftvel',
++			plot_riftvel(md,options,nlines,ncols,i);
++			return;
++		case 'riftnumbering',
++			plot_riftnumbering(md,options,nlines,ncols,i);
++			return;
++		case 'rifts',
++			plot_rifts(md,options,nlines,ncols,i);
++			return;
++		case 'riftrelvel',
++			plot_riftrelvel(md,options,nlines,ncols,i);
++			return;
++		case 'riftpenetration',
++			plot_riftpenetration(md,options,nlines,ncols,i);
++			return;
++		case 'riftfraction',
++			plot_riftfraction(md,options,nlines,ncols,i);
++			return;
++		case 'sarpwr',
++			plot_sarpwr(md,options,subplotwidth,i)
++			return
++		case 'icefront'
++			plot_icefront(md,options,subplotwidth,i,data)
++			return
++		case 'segments'
++			plot_segments(md,options,subplotwidth,i,data)
++			return
++		
++		case 'quiver'
++			data=[md.initialization.vx md.initialization.vy]; %Go ahead and try plot_unit
++
++		case {'strainrate_tensor','strainrate','strainrate_principal','strainrate_principalaxis1','strainrate_principalaxis2','strainrate_principalaxis3',...
++				'stress_tensor','stress','stress_principal','stress_principalaxis1','stress_principalaxis2','stress_principalaxis3',...
++				'deviatoricstress_tensor','deviatoricstress','deviatoricstress_principal','deviatoricstress_principalaxis1','deviatoricstress_principalaxis2','deviatoricstress_principalaxis3'},
++			plot_tensor(md,options,subplotwidth,i,data);
++			return;
++		case 'thermaltransient_results',
++			plot_thermaltransient_results(md,options,subplotwidth,i);
++			return;
++		case 'transient_movie',
++			plot_transient_movie(md,options,subplotwidth,i);
++			return;
++		case 'transient_results',
++			plot_transient_results(md,options,subplotwidth,i);
++
++		case 'transient_field',
++			plot_transient_field(md,options,subplotwidth,i);
++			return;
++
++	otherwise,
++
++		if ismember(data,properties('model')),
++			data=eval(['md.' data ';']);
++		else
++			error('plot error message: data provided not supported yet. Type plotdoc for help');
++		end
++	end
++end
++
++%Figure out if this is a semi-transparent plot.
++if exist(options,'overlay'),
++	plot_overlay(md,data,options,nlines,ncols,i);
++	return;
++end
++
++%Figure out if this is a semi-transparent plot.
++if exist(options,'gridded'),
++	plot_gridded(md,data,options,nlines,ncols,i);
++	return;
++end
++
++%Figure out if this is a Section plot
++if exist(options,'sectionvalue')
++	plot_section(md,data,options,nlines,ncols,i);
++	return;
++end
++
++%Figure out if this is a Profile plot
++if exist(options,'profile')
++	plot_profile(md,data,options,nlines,ncols,i);
++	return;
++end
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,data,options);
++[data2 datatype]=processdata(md,data,options);
++
++%standard plot:
++subplot(nlines,ncols,i);
++
++%plot unit
++plot_unit(x,y,z,elements,data2,is2d,isplanet,datatype,options);
++
++%apply all options
++if datatype==3,
++	options=changefieldvalue(options,'colorbar',2);
++	if exist(options,'contourlevels'),
++		data2=data;
++	end
++end
++
++applyoptions(md,data2,options);
++
++%do ground overlay on kml plot_unit? 
++if (strcmpi(getfieldvalue(options,'kmlgroundoverlay','off'),'on')),
++	if ((nlines*ncols~=1) | (i~=1)),
++		error('cannot kmlgroundoverlay on multi-plots');
++	end
++	
++	%call routine to build kml file and image that goes with it.
++	kmlgroundoverlay(md,options);
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_manager.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor_principal.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor_principal.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor_principal.m	(revision 13009)
+@@ -0,0 +1,77 @@
++function plot_tensor_principal(md,options,width,i,tensor,type,plot_options);
++%PLOT_TENSOR_PRINCIPAL - plot principal values
++%
++%   Usage:
++%      plot_tensor_principal(md,options,width,i,tensor,type,plot_options);
++%
++%   See also: PLOTMODEL, PLOT_UNIT, PLOT_MANAGER
++
++%Compute the indexes of the components plots
++upperplots=fix((i-1)/width);
++if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
++if (md.mesh.dimension==2)%3 components -> 3 indexes
++	index1=4*width*upperplots+2*leftplots+1;
++	index2=index1+1;
++	index3=index1+width*2;
++	index4=index3+1;
++	newwidth=2*width;
++elseif md.mesh.dimension==3%6 components -> 6 indexes
++	index1=3*3*width*upperplots+3*leftplots+1;
++	index2=index1+1;
++	index3=index1+2;
++	index4=index1+width*3;
++	index5=index4+1;
++	index6=index4+2;
++	newwidth=3*width;
++end
++
++%plot principal axis
++type1=[type 'axis1'];
++plot_tensor_principalaxis(md,options,newwidth,index1,tensor,type1,plot_options);
++type2=[type 'axis2'];
++plot_tensor_principalaxis(md,options,newwidth,index2,tensor,type2,plot_options);
++if  md.mesh.dimension==3
++	type3=[type 'axis3'];
++	plot_tensor_principalaxis(md,options,newwidth,index3,tensor,type3,plot_options);
++end
++
++%now plot principal values
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[tensor.principalvalue1 datatype]=processdata(md,tensor.principalvalue1,options);
++[tensor.principalvalue2 datatype]=processdata(md,tensor.principalvalue2,options);
++if  md.mesh.dimension==3
++	[tensor.principalvalue3 datatype]=processdata(md,tensor.principalvalue3,options);
++end
++
++if ((md.mesh.dimension==2)),
++	subplot(2*width,2*width,index3)
++	plot_unit(x,y,z,elements,tensor.principalvalue1,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'principal value 1')
++	subplot(2*width,2*width,index4)
++	plot_unit(x,y,z,elements,tensor.principalvalue2,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'principal value 2')
++else
++	subplot(3*width,3*width,index4)
++	plot_unit(x,y,z,elements,tensor.principalvalue1,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'principal value 1')
++	subplot(3*width,3*width,index5)
++	plot_unit(x,y,z,elements,tensor.principalvalue2,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'principal value 2')
++	subplot(3*width,3*width,index6)
++	plot_unit(x,y,z,elements,tensor.principalvalue3,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'principal value 3')
++end
++end
++
++function Apply_options_tensor(md,options,type,component)
++%apply options
++if ismember('_',type) %user plotet stress_tensor
++	strings=strsplit(type,'_');
++	string=strings{1};
++else %default plot: user requested stress
++	string=type;
++end
++options=addfielddefault(options,'title',[upper(string(1)) string(2:end) ' ' component]);
++options=changefieldvalue(options,'colorbar',2);
++applyoptions(md,[],options);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftvel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftvel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftvel.m	(revision 13009)
+@@ -0,0 +1,108 @@
++function plot_riftvel(md,options,nlines,ncols,index);
++%PLOT_RIFTVEL - plot rift velocity
++%
++%   Usage:
++%      plot_riftvel(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%some checks
++if (length(md.initialization.vx)~=md.mesh.numberofvertices | length(md.initialization.vy)~=md.mesh.numberofvertices),
++	error('plot_riftvel error message: vx and vy do not have the right size'),
++end
++if ~isstruct(md.rifts.riftstruct),
++	error('plot error message: no rifts available!');
++end
++options=addfielddefault(options,'scaling',2);
++
++%set as NaN all velocities not on rifts
++u=NaN*ones(md.mesh.numberofvertices,1);
++v=NaN*ones(md.mesh.numberofvertices,1);
++for i=1:size(md.rifts.riftstruct,1),
++	penaltypairs=md.rifts.riftstruct(i).penaltypairs(:,[1 2]);
++	u(penaltypairs(:))=md.initialization.vx(penaltypairs(:));
++	v(penaltypairs(:))=md.initialization.vy(penaltypairs(:));
++end
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[vel datatype]=processdata(md,[u v],options);
++[quivers,palette]=quiver_process(x,y,vel(:,1),vel(:,2),options);
++
++%prepare plot
++subplot(nlines,ncols,index); 
++hold on
++
++%plot mesh boundaries
++for i=1:size(md.mesh.segments,1),
++	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');
++end
++
++%plot rifts vel
++h3=[];
++for i=1:quivers.numcolors
++	pos=find(quivers.colorind==i);
++	hprime=quiver(quivers.x(pos),quivers.y(pos),quivers.u(pos),quivers.v(pos),...
++		'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
++	h3=[h3;hprime];
++end
++
++%plot rift velocities
++isp1=0;
++isp2=0;
++
++%plot mesh boundaries
++for i=1:size(md.mesh.segments,1),
++	h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
++end
++
++for i=1:size(md.rifts.riftstruct,1),
++	%get nodes on rift
++	penaltypairs=md.rifts.riftstruct(i).penaltypairs;
++
++	segments=md.rifts.riftstruct(i).segments;
++	for j=1:size(segments,1),
++		plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
++	end
++
++	normal=zeros(2,1);
++	for j=1:size(penaltypairs,1),
++		normal(1)=penaltypairs(j,5);
++		normal(2)=penaltypairs(j,6);
++
++		vx1=md.initialization.vx(penaltypairs(j,1)); vx2=md.initialization.vx(penaltypairs(j,2)); vy1=md.initialization.vy(penaltypairs(j,1)); vy2=md.initialization.vy(penaltypairs(j,2));
++		penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
++		%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
++		if(penetration>0),
++			p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'*'); set(p2,'Color',[140 140 140]/255);
++			isp2=1;
++		else
++			p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k*');
++			isp1=1;
++		end
++	end
++
++	%point out the tips
++	h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g*');
++	plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g*');
++	segments=md.rifts.riftstruct(i).segments(:,1:2);
++end
++
++
++%legend
++if isp1 & isp2
++	legend([h1,h2,p1,p2],'mesh boundaries','rift tips',' rifts closing','rifts opening')
++elseif isp1
++	legend([h1,h2,p1],'mesh boundaries','rift tips',' rifts closing')
++elseif isp2
++	legend([h1,h2,p2],'mesh boundaries','rift tips','rifts opening')
++else
++	legend([h1,h2],'mesh boundaries','rift tips')
++end
++hold off
++
++%apply options
++quiver_colorbar(quivers,options);
++options=changefieldvalue(options,'colorbar',2);
++options=addfielddefault(options,'title','Rift Velocities');
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmustddev.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmustddev.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmustddev.m	(revision 13009)
+@@ -0,0 +1,60 @@
++function plot_qmustddev(md,options,nlines,ncols,i);
++%PLOT_QMUMEAN - plot stddev of a scaled response 
++%
++%   Usage:
++%      plot_qmustddev(md,options,nlines,ncols,i);
++%
++%   See also: PLOTMODEL
++
++%plot mesh
++subplot(nlines,ncols,i); 
++
++%edgecolor
++edgecolor=getfieldvalue(options,'edgecolor','none');
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++%find response function
++if exist(options,'qmudata'), 
++	descriptor=getfieldvalue(options,'qmudata'); 
++	if ~ischar(descriptor),
++		error('plot_qmustddev error message:  descriptor should be a string');
++	end
++else 
++	error('plot_qmustddev error message:  provide descriptor of response function in ''qmudata'' option');
++end
++
++%go pick up the response: 
++allresponses=md.qmu.results.dresp_out;
++responses=zeros(md.qmu.numberofpartitions,1);
++
++count=1;
++for i=1:length(allresponses),
++	d=allresponses(i).descriptor;
++	if strncmpi(d,'scaled_',7),
++		d=d(8:end);
++		if strncmpi(d,descriptor,length(descriptor)),
++			responses(count)=allresponses(i).stddev/allresponses(i).mean*100;
++			count=count+1;
++		end
++	end
++end
++
++%log?
++if exist(options,'log'),
++	responses=log(responses)/log(getfieldvalue(options,'log'));
++end
++
++
++%now, project onto vertices
++responses_on_node=responses(md.qmu.partition+1);
++
++%plot
++A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', responses_on_node,'FaceColor','interp','EdgeColor',edgecolor);
++
++%apply options
++options=addfielddefault(options,'title',['Stddev  distribution of ' descriptor ' in %']);
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_elementstype.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_elementstype.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_elementstype.m	(revision 13009)
+@@ -0,0 +1,131 @@
++function plot_elementstype(md,options,width,i);
++%PLOT_ELEMENTSTYPE - plot elements type
++%
++%   Usage:
++%      plot_elementstype(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[data datatype]=processdata(md,md.flowequation.element_equation,options);
++
++%edgecolor?
++edgecolor=getfieldvalue(options,'edgecolor','none');
++
++%plot
++subplot(width,width,i);
++
++if is2d
++	%Hutter 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);
++	%MacAyeal 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);
++	%Pattyn element
++	posP=find(data==3);
++	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);
++	%MacAyealPattyn 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);
++	%Stokes elements
++	posS=find(data==4);
++	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);
++	%MacAyealStokes 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);
++	%PattynStokes 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);
++
++	legend([p1 p2 p3 p5 p6 p7 p8 p9],...
++		'Hutter''s elements','MacAyeal''s elements','Pattyn''s elements',...
++		'MacAyealPattyn''s elements','Stokes''s elements','MacAyealStokes''s elements','PattynStokes''s elements','None element');
++
++else
++	%Hutter 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);
++	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);
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
++	%MacAyeal 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);
++	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);
++	%Pattyn 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);
++	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);
++	%Stokes 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);
++	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);
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
++	%MacAyealPattyn 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);
++	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);
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
++	%PattynStokes 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);
++	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);
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
++	%MacAyealStokes 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);
++	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],...
++		'Hutter''s elements','MacAyeal''s elements','Pattyn''s elements','Stokes''s elements',...
++		'MacAyealPattyn''s elements','PattynStokes''s elements','MacAyealStokes''s elements','None elements');
++end
++
++%apply options
++options=addfielddefault(options,'title','Elements type');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_basaldrag.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_basaldrag.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_basaldrag.m	(revision 13009)
+@@ -0,0 +1,53 @@
++function plot_basaldrag(md,options,width,i,type);
++
++%PLOT_BASALDRAG - plot basal drag
++%
++%   Usage:
++%      plot_basaldrag(md,options,width,i,type);
++%
++%   See also: PLOTMODEL
++
++%check layer
++if md.mesh.dimension==3,
++	if getfieldvalue(options,'layer',1)~=1;
++		disp('plot_basaldrag warning: basal drag is displayed in the lower layer')
++		changefieldvalue(options,'layer',1);
++	end
++end
++
++%compute exponents
++s=averaging(md,1./md.friction.p,0);
++r=averaging(md,md.friction.q./md.friction.p,0);
++
++%compute horizontal velocity
++if strcmpi(type,'basal_drag')
++	ub=sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
++elseif strcmpi(type,'basal_dragx')
++	ub=md.initialization.vx/md.constants.yts;
++elseif strcmpi(type,'basal_dragy')
++	ub=md.initialization.vy/md.constants.yts;
++end
++
++%compute basal drag
++drag=(max(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed),0)).^r.*(md.friction.coefficient).^2.*ub.^s/1000;
++
++%Figure out if this is a Section plot
++if exist(options,'sectionvalue')
++	plot_section(md,drag,options,width,i);
++	return;
++else
++
++	%process data and model
++	[x y z elements is2d isplanet]=processmesh(md,[],options);
++	[basal_drag datatype]=processdata(md,drag,options);
++
++	%plot basaldrag
++	subplot(width,width,i); 
++	plot_unit(x,y,z,elements,basal_drag,is2d,isplanet,datatype,options);
++
++	%apply options
++	options=addfielddefault(options,'title','Basal drag [kPa]');
++	options=addfielddefault(options,'view',2);
++	applyoptions(md,basal_drag,options);
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_BC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_BC.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_BC.m	(revision 13009)
+@@ -0,0 +1,41 @@
++function plot_BC(md,options,width,i,data);
++
++%plot neuman
++plot_icefront(md,options,width,i,data)
++
++hold on
++
++%plot dirichlets
++h1=plot3(...
++	md.mesh.x(find(~isnan(md.diagnostic.spcvx(1:md.mesh.numberofvertices,1)))),...
++	md.mesh.y(find(~isnan(md.diagnostic.spcvx(1:md.mesh.numberofvertices,1)))),...
++	md.mesh.z(find(~isnan(md.diagnostic.spcvx(1:md.mesh.numberofvertices,1)))),...
++	'ro','MarkerSize',14,'MarkerFaceColor','r');
++h2=plot3(...
++	md.mesh.x(find(~isnan(md.diagnostic.spcvy(1:md.mesh.numberofvertices,1)))),...
++	md.mesh.y(find(~isnan(md.diagnostic.spcvy(1:md.mesh.numberofvertices,1)))),...
++	md.mesh.z(find(~isnan(md.diagnostic.spcvy(1:md.mesh.numberofvertices,1)))),...
++	'bo','MarkerSize',10,'MarkerFaceColor','b');
++h3=plot3(...
++	md.mesh.x(find(~isnan(md.diagnostic.spcvz(1:md.mesh.numberofvertices,1)))),...
++	md.mesh.y(find(~isnan(md.diagnostic.spcvz(1:md.mesh.numberofvertices,1)))),...
++	md.mesh.z(find(~isnan(md.diagnostic.spcvz(1:md.mesh.numberofvertices,1)))),...
++	'yo','MarkerSize',6 ,'MarkerFaceColor','y');
++
++%update legend
++[legend_h,object_h,plot_h,text_strings]=legend();
++legend('off');
++text_strings{end+1}='vx Dirichlet';
++text_strings{end+1}='vy Dirichlet';
++if h3, text_strings{end+1}='vz Dirichlet'; end
++plot_h(end+1)=h1;
++plot_h(end+1)=h2;
++if h3, plot_h(end+1)=h3; end
++legend(plot_h,text_strings,'location','NorthEast')
++
++hold off
++
++%apply options
++options=addfielddefault(options,'title','Boundary conditions');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_segments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_segments.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_segments.m	(revision 13009)
+@@ -0,0 +1,57 @@
++function plot_segments(md,options,width,i,datai);
++%PLOT_SEGMENTS - plot segments, with different colors according to segment markers.
++%
++%   Usage:
++%      plot_segments(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%plot mesh boundaries
++subplot(width,width,i); 
++
++%process mesh and data
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++segments=md.mesh.segments;
++
++if (md.mesh.dimension==2),
++	%plot mesh
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++	h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	hold on;
++
++	%highlight elements on neumann
++	pos=segments(:,end);
++	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
++	h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
++
++	if strcmpi(getfieldvalue(options,'segmentnumbering','off'),'on'),
++		text(sum(x(segments(:,1:2)),2)/2,sum(y(segments(:,1:2)),2)/2,sum(z(segments(:,1:2)),2)/2+1,...
++			num2str(md.mesh.segmentmarkers),...
++			'backgroundcolor',[0.8 0.9 0.8],'HorizontalAlignment','center','VerticalAlignment','middle');
++	end
++
++	%display arrows pointing outward
++	xstart=mean(x(segments(:,1:end-1)),2);
++	ystart=mean(y(segments(:,1:end-1)),2);
++	length=sqrt((x(segments(:,1))-x(segments(:,2))).^2 + (y(segments(:,1))-y(segments(:,2))).^2 );
++	normal(:,1)=cos(atan2((x(segments(:,1))-x(segments(:,2))) , (y(segments(:,2))-y(segments(:,1)))));
++	normal(:,2)=sin(atan2((x(segments(:,1))-x(segments(:,2))) , (y(segments(:,2))-y(segments(:,1)))));
++	xend=xstart+length.*normal(:,1);
++	yend=ystart+length.*normal(:,2);
++	q=quiver(xstart,ystart,xend-xstart,yend-ystart); hold on;
++	h3=plot(xstart,ystart,'r*');
++
++
++else
++	error('plot_segments: 3d plot of segments not supported yet!');
++end
++
++%legend (disable warnings)
++warning off
++legend([h2,q],'element on segment','normal vectors')
++warning on
++
++%apply options
++options=addfielddefault(options,'title','Segment boundaries');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmuhistnorm.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmuhistnorm.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmuhistnorm.m	(revision 13009)
+@@ -0,0 +1,48 @@
++function plot_qmuhistnorm(md,options,nlines,ncols,index);
++
++%prepare plot
++subplot(nlines,ncols,index); 
++hold on
++
++
++%recover histnorm data
++if ~exist(options,'qmudata')
++	error('plot_qmuhistnorm error message: option qmudata is required');
++else
++	qmudata=getfieldvalue(options,'qmudata');
++end
++
++%process options for the qmu plot: 
++
++%    hmin          (numeric, minimum for histogram)
++%    hmax          (numeric, maximum for histogram)
++%    hnint         (numeric, number of intervals for histogram)
++%    ymin1         (numeric, minimum of histogram y-axis)
++%    ymax1         (numeric, maximum of histogram y-axis)
++%    ymin2         (numeric, minimum of cdf y-axis)
++%    ymax2         (numeric, maximum of cdf y-axis)
++%    cdfplt        (char, 'off' to turn off cdf line plots)
++%    cdfleg        (char, 'off' to turn off cdf legends)
++%
++
++qmuoptions='';
++
++if exist(options,'hmin'), hmin=getfieldvalue(options,'hmin'); qmuoptions=[qmuoptions ',''hmin'',' num2str(hmin)]; end
++if exist(options,'hmax'), hmax=getfieldvalue(options,'hmax'); qmuoptions=[qmuoptions ',''hmax'',' num2str(hmax)]; end
++if exist(options,'hnint'), hnint=getfieldvalue(options,'hnint'); qmuoptions=[qmuoptions ',''hnint'',' num2str(hnint)]; end
++if exist(options,'ymin1'), ymin1=getfieldvalue(options,'ymin1'); qmuoptions=[qmuoptions ',''ymin1'',' num2str(ymin1)]; end
++if exist(options,'ymax1'), ymax1=getfieldvalue(options,'ymax1'); qmuoptions=[qmuoptions ',''ymax1'',' num2str(ymax1)]; end
++if exist(options,'ymin2'), ymin2=getfieldvalue(options,'ymin2'); qmuoptions=[qmuoptions ',''ymin2'',' num2str(ymin2)]; end
++if exist(options,'ymax2'), ymax2=getfieldvalue(options,'ymax2'); qmuoptions=[qmuoptions ',''ymax2'',' num2str(ymax2)]; end
++if exist(options,'cdfplt'), cdfplt=getfieldvalue(options,'cdfplt'); qmuoptions=[qmuoptions ',''cdfplt'',''' cdfplt '''']; end
++if exist(options,'cdfleg'), cdfleg=getfieldvalue(options,'cdfleg'); qmuoptions=[qmuoptions ',''cdfleg'',''' cdfleg '''']; end
++if exist(options,'nrmplt'), nrmplt=getfieldvalue(options,'nrmplt'); qmuoptions=[qmuoptions ',''nrmplt'',''' nrmplt '''']; end
++if exist(options,'EdgeColor'), EdgeColor=getfieldvalue(options,'EdgeColor'); qmuoptions=[qmuoptions ',''EdgeColor'',''' EdgeColor '''']; end
++if exist(options,'FaceColor'), FaceColor=getfieldvalue(options,'FaceColor'); qmuoptions=[qmuoptions ',''FaceColor'',''' FaceColor '''']; end
++
++%use qmu plot
++eval(['plot_hist_norm(qmudata' qmuoptions ');']);
++
++%apply options
++options=changefieldvalue(options,'colorbar','off');
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmu_mass_flux_segments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmu_mass_flux_segments.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmu_mass_flux_segments.m	(revision 13009)
+@@ -0,0 +1,49 @@
++function plot_qmu_mass_flux_segments(md,options,nlines,ncols,i);
++%PLOT_QMU_MASS_FLUX_SEGMENTS - plot segments from the qmu analysis of mass fluxes
++%
++%   Usage:
++%      plot_qmu_mass_flux_segments(md,options,nlines,ncols,i);
++%
++
++subplot(nlines,ncols,i); 
++
++%process mesh and data
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++allsegments=md.qmu.mass_flux_segments;
++
++if (md.mesh.dimension==2),
++
++	%recover segments
++	hold on
++	for i=1:length(allsegments),
++		segments=allsegments{i};
++
++		%plot semgnets
++		for j=1:length(segments),
++			plot([segments(j,1) segments(j,3)],[segments(j,2) segments(j,4)]);
++		end
++		text(segments(j,1),segments(j,2),['Profile #' num2str(i)]);
++
++		%plot normals
++		
++		for j=1:length(segments),
++			xstart=mean([segments(j,1) segments(j,3)]);
++			ystart=mean([segments(j,2) segments(j,4)]);
++			length1=sqrt((segments(j,1)-segments(j,3)).^2 + (segments(j,2)-segments(j,4)).^2);
++			normal(:,1)=cos(atan2(segments(j,1)-segments(j,3) , segments(j,4)-segments(j,2)));
++			normal(:,2)=sin(atan2(segments(j,1)-segments(j,3) , segments(j,4)-segments(j,2)));
++			xend=xstart+length1.*normal(:,1);
++			yend=ystart+length1.*normal(:,2);
++			plot([xstart xend],[ystart yend],'r-');
++		end
++
++	end
++else
++	error('plot_qmu_mass_flux_segments: 3d plot of segments not supported yet!');
++end
++
++%apply options
++options=addfielddefault(options,'title','Mass Flux segments and normals');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_transient_results.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_transient_results.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_transient_results.m	(revision 13009)
+@@ -0,0 +1,77 @@
++function plot_transient_results(md,options,width,i)
++%PLOT_TRANSIENT_RESULTS - plot transient results
++%
++%   Usage:
++%      plot_transient_results(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++fontsize=getfieldvalue(options,'fontsize',14);
++fontweight=getfieldvalue(options,'fontweight','n');
++
++%Prepare window distribution
++%Get screen geometry
++mp = get(0, 'MonitorPositions');
++%Build window sizes
++if size(mp,1)>=2        %several monitors, use the second one
++	bdwidth=mp(2,1)+5; topbdwidth=mp(2,2)+20; W=mp(2,3)/3; H=mp(2,4)/2;
++else                    %only one monitor
++	bdwidth=5;         topbdwidth=20;         W=mp(1,3)/3; H=mp(1,4)/2;
++end
++pos1=[bdwidth  H+bdwidth  W-2*bdwidth  H-bdwidth-topbdwidth];
++pos2=pos1+[W 0 0 0]; pos3=pos1+[2*W 0 0 0]; pos4=pos1+[0 -H 0 0]; pos5=pos1+[W -H 0 0]; pos6=pos1+[2*W -H 0 0];
++%Create windows
++figure(1);close;
++figure('Position',pos1); figure('Position',pos2);figure('Position',pos3);figure('Position',pos4);figure('Position',pos5);figure('Position',pos6);
++
++string='plotmodel(md';
++for i=1:length(md.results.transient),
++	string=[string ',''data'',md.results.transient(' num2str(i) ').thickness,''title'',''Thickness at time ' num2str(md.results.transient(i).time) ' a'''];
++end
++string=[string ',''figure'',1,''colorbar#all'',''on'',''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight ''');'];
++eval(string);
++clear string;
++
++string='plotmodel(md';
++for i=1:length(md.results.transient),
++	string=[string ',''data'',md.results.transient(' num2str(i) ').vel,''view'',3,''title'',''Velocity at time ' num2str(md.results.transient(i).time) ' a'''];
++end
++string=[string ',''figure'',2,''colorbar#all'',''on'',''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight  ''');'];
++eval(string);
++clear string;
++
++if md.mesh.dimension==3,
++	string='plotmodel(md';
++	for i=1:length(md.results.transient),
++		string=[string ',''data'',md.results.transient(' num2str(i) ').temperature,''view'',3,''title'',''Temperature at time ' num2str(md.results.transient(i).time) ' a'''];
++	end
++	string=[string ',''figure'',3,''colorbar#all'',''on'',''view'',3,''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight  ''');'];
++	eval(string);
++	clear string;
++end
++
++string='plotmodel(md';
++for i=2:length(md.results.transient),
++	string=[string ',''data'',md.results.transient(' num2str(i) ').thickness-md.results.transient(' num2str(i-1) ').thickness,''title'',''Delta thickness at time ' num2str(md.results.transient(i).time) ' a'''];
++end
++string=[string ',''figure'',4,''colorbar#all'',''on'',''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight  ''');'];
++eval(string);
++clear string;
++
++string='plotmodel(md';
++for i=2:length(md.results.transient),
++	string=[string ',''data'',md.results.transient(' num2str(i) ').vel-md.results.transient(' num2str(i-1) ').vel,''view'',3,''title'',''Delta velocity at time ' num2str(md.results.transient(i).time) ' a'''];
++end
++string=[string ',''figure'',5,''colorbar#all'',''on'',''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight  ''');'];
++eval(string);
++clear string;
++
++if md.mesh.dimension==3,
++	string='plotmodel(md';
++	for i=2:length(md.results.transient),
++		string=[string ',''data'',md.results.transient(' num2str(i) ').temperature-md.results.transient(' num2str(i-1) ').temperature,''view'',3,''title'',''Delta temperature at time ' num2str(md.results.transient(i).time) ' a'''];
++	end
++	string=[string ',''figure'',6,''colorbar#all'',''on'',''fontsize'',' num2str(fontsize) ',''fontweight'',''' fontweight  ''');'];
++	eval(string);
++	clear string;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftfraction.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftfraction.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftfraction.m	(revision 13009)
+@@ -0,0 +1,48 @@
++function plot_riftfraction(md,options,nlines,ncols,index);
++%PLOT_RIFTFRACTION - plot rift fractions
++%
++%   Usage:
++%      plot_riftfraction(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%check that there is something in riftproperties
++if isnan(md.rifts.riftstruct.riftproperties),
++	error('plot_riftfraction error message: field riftproperies is empty, run the model first')
++end
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++subplot(nlines,ncols,index); 
++hold on
++
++%plot mesh boundaries
++for i=1:size(md.mesh.segments,1),
++	h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');
++end
++
++%first, build a vector of fractions, over all nodes. 
++fractions=zeros(md.mesh.numberofvertices,1);
++
++%complete the tips.
++for i=1:length(md.rifts.riftstruct), 
++	tips=md.rifts.riftstruct(i).tips;
++	fractions(tips)=1;
++end
++
++hold on;
++for i=1:length(md.rifts.riftstruct), 
++	segments=md.rifts.riftstruct(i).segments(:,1:2)';
++	xc=x(segments(:));
++	yc=y(segments(:));
++	zc=fractions(segments(:));
++	h2=patch('Xdata',xc,'Ydata',yc,'Zdata',zc,'Cdata',zc,'facecolor','none','edgecolor','flat');
++end
++legend([h1,h2],'mesh boundaries','rifts')
++hold off
++
++%apply options
++options=addfielddefault(options,'title','Rift ice/water fraction ???????'); %Eric, could you enter a better title?
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmunormplot.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmunormplot.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_qmunormplot.m	(revision 13009)
+@@ -0,0 +1,45 @@
++%
++%  plot a normal probability plot of the response functions.
++%
++%  []=plot_normplot(rfunc)
++%
++function []=plot_qmunormplot(rfunc,width,ii)
++
++if ~nargin
++    help plot_normplot
++    return
++end
++
++%%  assemble the data into a matrix
++
++desc=cell (1,length(rfunc));
++for i=1:length(rfunc)
++    ldata(i)=length(rfunc(i).sample);
++end
++data=zeros(max(ldata),length(rfunc));
++
++for i=1:length(rfunc)
++    desc(i)=cellstr(rfunc(i).descriptor);
++    data(1:ldata(i),i)=rfunc(i).sample;
++end
++
++%standard plot:
++subplot(width,width,ii);
++
++%%  draw the plot
++
++%  draw normal probability plot
++
++normplot(data)
++ax1=gca;
++
++%  add the annotation
++
++title('Normal Probability Plot of Design Variables and/or Response Functions')
++xlabel('Value')
++ylabel('Probability')
++
++hleg1=legend(ax1,desc,'Location','EastOutside',...
++             'Orientation','vertical','Interpreter','none');
++
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/quiver_colorbar.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/quiver_colorbar.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/quiver_colorbar.m	(revision 13009)
+@@ -0,0 +1,41 @@
++function quiver_colorbar(quivers,options)
++%QUIVER_COLORBAR - colorbar for quiver plots
++%
++%   Usage:
++%      quiver_colorbar(quivers,options)
++
++if  strcmpi(getfieldvalue(options,'colorbar','on'),'on'),
++
++	%build ticks
++	hcb=colorbar('peer',gca,'location','EastOutside');
++	ticklabel=cell(1,length(quivers.levels));
++	for i=1:length(quivers.levels),
++		ticklabel{i}=num2str(round_ice(quivers.levels(i),3));
++	end
++	tickpos=1:quivers.numcolors+1;
++
++	%remove ticks if to many have been created
++	proportion=round(length(quivers.levels)/4);
++	if proportion>1,
++		ticklabel=ticklabel(1:proportion:end);
++		tickpos=tickpos(1:proportion:end);
++	end
++
++	%draw colorbar
++	set(hcb,'YTickLabel',ticklabel,'YTick',tickpos);
++	%position
++	if exist(options,'colorbarpos'),
++		set(hcb,'Position',getfieldvalue(options,'colorbarpos'));
++	end
++	%fontsize
++	fontsize=getfieldvalue(options,'fontsize',14);
++	set(hcb,'FontSize',fontsize);
++	
++	if exist(options,'colorbartitle'),
++		backup=gca;
++		axes(hcb);lab=title(getfieldvalue(options,'colorbartitle'));
++		set(lab,'Rotation',getfieldvalue(options,'colorbartitlerotation',0));
++		set(lab,'VerticalAlignment','bottom');
++		axes(backup);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_referential.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_referential.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_referential.m	(revision 13009)
+@@ -0,0 +1,91 @@
++function plot_referential(md,options,width,i,data);
++%PLOT_PRESSURELOAD - plot segment on neumann BC
++%
++%   Usage:
++%      plot_referential(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%plot mesh boundaries
++subplot(width,width,i); 
++
++%process mesh and data
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++referential=md.diagnostic.referential;
++
++Xhat=md.diagnostic.referential(:,1:3);
++pos=find(sum(isnan(Xhat),2));
++Xhat(pos,:)=repmat([1 0 0],size(pos,1),1);
++Xhatnorm=sqrt(Xhat(:,1).^2+Xhat(:,2).^2+Xhat(:,3).^2);
++Xhat=Xhat./[Xhatnorm Xhatnorm Xhatnorm];
++
++Zhat=md.diagnostic.referential(:,4:6);
++pos=find(sum(isnan(Zhat),2));
++Zhat(pos,:)=repmat([0 0 1],size(pos,1),1);
++Zhatnorm=sqrt(Zhat(:,1).^2+Zhat(:,2).^2+Zhat(:,3).^2);
++Zhat=Zhat./[Zhatnorm Zhatnorm Zhatnorm];
++
++Yhat=cross(Zhat,Xhat);
++
++if (md.mesh.dimension==2),
++
++	%plot mesh
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++	h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	hold on;
++
++	xstart=x;
++	ystart=y;
++	zstart=z;
++	edgex=max(md.mesh.x(elements),[],2)-min(md.mesh.x(elements),[],2);
++	len=min(edgex)/1.5;
++	%plot X axis
++	xend=xstart+len*Xhat(:,1);
++	yend=ystart+len*Xhat(:,2);
++	hx=quiver(xstart,ystart,xend-xstart,yend-ystart,'Color','blue','ShowArrowHead','on','AutoScale','off');
++	%plot Y axis
++	xend=xstart+len*Yhat(:,1);
++	yend=ystart+len*Yhat(:,2);
++	hy=quiver(xstart,ystart,xend-xstart,yend-ystart,'Color','red','ShowArrowHead','on','AutoScale','off');
++
++	legend([hx,hy],'local X direction','local Y direction')
++else
++	%plot mesh
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++	h1=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	hold on;
++
++	xstart=x;
++	ystart=y;
++	zstart=z;
++	edgex=max(md.mesh.x(elements),[],2)-min(md.mesh.x(elements),[],2);
++	edgez=max(md.mesh.z(elements),[],2)-min(md.mesh.z(elements),[],2);
++	len=min(edgex)/1.5;
++	lenz=min(edgez)/1.5;
++	%plot X axis
++	xend=xstart+len*Xhat(:,1);
++	yend=ystart+len*Xhat(:,2);
++	zend=zstart+len*Xhat(:,3);
++	hx=quiver3(xstart,ystart,zstart,xend-xstart,yend-ystart,zend-zstart,'Color','blue','ShowArrowHead','on','AutoScale','off');
++	%plot Y axis
++	xend=xstart+len*Yhat(:,1);
++	yend=ystart+len*Yhat(:,2);
++	zend=zstart+len*Yhat(:,3);
++	hy=quiver3(xstart,ystart,zstart,xend-xstart,yend-ystart,zend-zstart,'Color','red','ShowArrowHead','on','AutoScale','off');
++	%plot Z axis
++	xend=xstart+lenz*Zhat(:,1);
++	yend=ystart+lenz*Zhat(:,2);
++	zend=zstart+lenz*Zhat(:,3);
++	hz=quiver3(xstart,ystart,zstart,xend-xstart,yend-ystart,zend-zstart,'Color','green','ShowArrowHead','on','AutoScale','off');
++
++	legend([hx,hy,hz],'local X direction','local Y direction','local Z direction')
++end
++
++%apply options
++options=addfielddefault(options,'title','Diagnostic referential');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/kmlgroundoverlay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/kmlgroundoverlay.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/kmlgroundoverlay.m	(revision 13009)
+@@ -0,0 +1,61 @@
++function kmlgroundoverlay(md,options);
++%KMLGROUNDOVERLAY: create ground overlay image in kml format
++%
++%
++%    options: 
++%         kmlfilename
++%         imagename
++%
++%    Usage: 
++%         kmlgroundoverlay(md,'kmlfilename','temp.kml','imagename','greenland.jpeg');
++%
++
++%first figure out if lat and long were computed!
++if (isempty(md.mesh.lat) | isempty(md.mesh.long)),
++	error('kmlgroundoverlay error message: project x,y onto lat,long fields of model!');
++end
++
++%process kml options
++kmlfilename=getfieldvalue(options,'kmlfilename','tempfile.kml');
++kmlroot=getfieldvalue(options,'kmlroot','./');
++kmlimagename=getfieldvalue(options,'kmlimagename','tempimage');
++kmlimagetype=getfieldvalue(options,'kmlimagetype','png');
++kmlresolution=getfieldvalue(options,'kmlresolution',1);
++kmlfolder=getfieldvalue(options,'kmlfolder','Ground Overlay');
++kmlfolderdescription=getfieldvalue(options,'kmlfolderdescription','');
++kmlgroundoverlayname=getfieldvalue(options,'kmlgroundoverlayname','');
++kmlgroundoverlaydescription=getfieldvalue(options,'kmlgroundoverlaydescription','');
++
++%figure out  min and max for lat and long of this image:
++west=min(md.mesh.long);
++east=max(md.mesh.long);
++south=min(md.mesh.lat);
++north=max(md.mesh.lat);
++
++%print image at high resolution
++printmodel([kmlroot '/' kmlimagename],kmlimagetype,'trim','on','resolution',kmlresolution,'margin','off','frame','off');
++
++%now write kml file
++fid=fopen([kmlroot '/' kmlfilename],'w');
++
++fprintf(fid,'%s\n','<?xml version="1.0" encoding="UTF-8"?>');
++fprintf(fid,'%s\n','<kml xmlns="http://www.opengis.net/kml/2.2">');
++fprintf(fid,'%s\n','<Folder>');
++fprintf(fid,'%s%s%s\n','<name>',kmlfolder,'</name>');
++fprintf(fid,'%s%s%s\n','<description>',kmlfolderdescription,'</description>');
++fprintf(fid,'%s\n','<GroundOverlay>');
++fprintf(fid,'%s%s%s\n','<name>',kmlgroundoverlayname,'</name>');
++fprintf(fid,'%s\n','<description>',kmlgroundoverlaydescription,'</description>');
++fprintf(fid,'%s%s.%s%s\n','<Icon>',kmlimagename,kmlimagetype,'</Icon>');
++fprintf(fid,'%s\n','<LatLonBox>');
++fprintf(fid,'%s%f%s\n','<north>',north,'</north>');
++fprintf(fid,'%s%f%s\n','<south>',south,'</south>');
++fprintf(fid,'%s%f%s\n','<east>',east,'</east>');
++fprintf(fid,'%s%f%s\n','<west>',west,'</west>');
++fprintf(fid,'%s\n','<rotation>0</rotation>');
++fprintf(fid,'%s\n','</LatLonBox>');
++fprintf(fid,'%s\n','</GroundOverlay>');
++fprintf(fid,'%s\n','</Folder>');
++fprintf(fid,'%s\n','</kml>');
++
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_drivingstress.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_drivingstress.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_drivingstress.m	(revision 13009)
+@@ -0,0 +1,24 @@
++function plot_drivingstress(md,options,width,i);
++%PLOT_DRIVINGSTRESS - plot driving stress
++%
++%   Usage:
++%      plot_drivingstress(md,options,width,i);
++%
++%   See also: PLOTMODEL, PLOT_UNIT, PLOT_MANAGER
++
++%get driving stress
++[sx sy s]=drivingstress(md);
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[dstress datatype]=processdata(md,s,options);
++dstress=dstress/1000;
++
++%plot mesh quivervel
++subplot(width,width,i); 
++plot_unit(x,y,z,elements,dstress,is2d,isplanet,datatype,options)
++
++%apply options
++options=addfielddefault(options,'title','Driving stress [kPa]');
++options=addfielddefault(options,'view',2);
++applyoptions(md,dstress,options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_transient_movie.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_transient_movie.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_transient_movie.m	(revision 13009)
+@@ -0,0 +1,70 @@
++function plot_transient_movie(md,options,width,i);
++%PLOT_TRANSIENT_MOVIE - plot a transient result as a movie
++%   Usage:
++%      plot_transient_movie(md,options,width,i);
++%
++%   See also: PLOTMODEL, PLOT_UNIT, PLOT_MANAGER
++
++	%prepare subplot
++	subplot(width,width,i); 
++
++	%xlim
++	if exist(options,'transient_movie_field'),
++		field=getfieldvalue(options,'transient_movie_field');
++	else
++		error('specify transient_movie_field in options list');
++	end
++
++	results=md.results.TransientSolution;
++	%loop over the time steps
++	if exist(options,'transient_movie_limit'),
++		limit=getfieldvalue(options,'transient_movie_limit');
++		steps=[limit(1):limit(end)];
++	else
++		steps=1:length(results);
++	end
++	results=md.results.TransientSolution;
++	nstep=1;
++	for i=steps
++
++		if ~isempty(results(i).(field)),
++			%process data
++			[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options);
++			[data datatype]=processdata(md,results(i).(field),options);
++
++			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);
++
++			if exist(options,'transient_movie_output'),
++				set(gcf,'Renderer','zbuffer','color','white'); %fixes a bug on Mac OS X (not needed in future Matlab version)
++				if nstep==1,
++					%initialize images and frame
++					frame=getframe(gcf);
++					[images,map]=rgb2ind(frame.cdata,256,'nodither');
++					images(1,1,1,length(steps))=0;
++				else
++					frame=getframe(gcf);
++					images(:,:,1,nstep) = rgb2ind(frame.cdata,map,'nodither');
++				end
++			else
++				pause(0.1)
++			end
++			nstep=nstep+1;
++		end
++	end
++
++	%output movie if requested.
++	if exist(options,'transient_movie_output'),
++		filename=getfieldvalue(options,'transient_movie_output');
++		imwrite(images,map,filename,'DelayTime',getfieldvalue(options,'transient_movie_time',2),'LoopCount',inf)
++	end
++
++end %function
++
++function apply_options_movie(md,options,titlestring)
++	%apply options
++	options=addfielddefault(options,'title',titlestring);
++	options=addfielddefault(options,'colorbar',1);
++	applyoptions(md,[],options);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/northarrow.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/northarrow.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/northarrow.m	(revision 13009)
+@@ -0,0 +1,76 @@
++function northarrow(structure)
++%NORTHARROW - overlay an arrow pointing north on the current plot
++%
++%   Usage:
++%      northarrow(structure)
++
++%Go through structure and fill missing arguments
++if length(structure)<3
++	error('plotmodel error message: the position or the length of the North arrow is missing');
++elseif length(structure)==3
++	structure(4)=0.5; %default ratio headarrow/length
++	structure(5)=structure(3)/10; %default width =length/10
++elseif length(structure)==4
++	structure(5)=structure(3)/10; %default width =length/10
++elseif length(structure)==5
++	structure(6)=16; %default fontsize
++elseif length(structure)>6
++	error('plotmodel error message: to many input arguments for northarrow: [x0 y0 length [ratio width fontsize]]');
++end
++
++%retrieve north arrow parameters
++x0=structure(1);
++y0=structure(2);
++lengtharrow=structure(3);
++ratio=structure(4);
++width=structure(5);
++fontsize=structure(6);
++
++%Figure out angle to point towards north
++ang=atan2(y0,x0);
++
++%Build the two points Ap and Bp
++x=zeros(2,1);
++y=zeros(2,1);
++x(1)=x0;
++y(1)=y0;
++
++x(2)=x(1)+lengtharrow*cos(ang);
++y(2)=y(1)+lengtharrow*sin(ang);
++
++Ap=[x(1)
++   y(1)];
++Bp=[x(2)
++   y(2)];
++
++%Build arrowhead first
++ang2=150*2*pi/360;
++rotation=[cos(ang2), sin(ang2); -sin(ang2), cos(ang2)];
++
++E=ratio*rotation*(Bp-Ap)+Bp;
++F=Bp;
++G=ratio*rotation'*(Bp-Ap)+Bp;
++H=Bp/4+E*3/8+G*3/8;
++
++%Build rectangle
++u=Bp-Ap;
++alpha=atan2(u(2),u(1));
++
++A=Ap-[-width/2*sin(alpha)
++   width/2*cos(alpha)];
++ B=H-[-width/2*sin(alpha)
++   width/2*cos(alpha)];
++C=H+[-width/2*sin(alpha)
++   width/2*cos(alpha)];
++D=Ap+[-width/2*sin(alpha)
++   width/2*cos(alpha)];
++
++%Plot arrow
++hold on
++p1=patch([A(1) B(1) C(1) D(1)],[A(2) B(2) C(2) D(2)],'Black');
++p2=patch([E(1) F(1) G(1) H(1)],[E(2) F(2) G(2) H(2)],'Black');
++
++%Text North
++xN=max([A(1) D(1) E(1) F(1) G(1)])+ratio/3*abs(lengtharrow);
++yN=mean([A(2) F(2) H(2)]);
++text(xN,yN,'North','FontSize',fontsize,'FontWeight','b');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftpenetration.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftpenetration.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftpenetration.m	(revision 13009)
+@@ -0,0 +1,82 @@
++function plot_rifpenetration(md,options,nlines,ncols,index);
++%PLOT_RIFTPENETRATION - plot rift penetration
++%
++%   Usage:
++%      plot_rifpenetration(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++subplot(nlines,ncols,index); 
++hold on
++
++%plot mesh boundaries
++for i=1:size(md.mesh.segments,1),
++	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k-');
++end
++
++isp1=0;
++isp2=0;
++
++if isstruct(md.rifts.riftstruct),
++	%plot mesh boundaries
++	for i=1:size(md.mesh.segments,1),
++		h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
++	end
++	for i=1:size(md.rifts.riftstruct,1),
++		penaltypairs=md.rifts.riftstruct(i).penaltypairs;
++
++		segments=md.rifts.riftstruct(i).segments;
++		for j=1:size(segments,1),
++			plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
++		end
++
++		normal=zeros(2,1);
++		for j=1:size(penaltypairs,1),
++			normal(1)=penaltypairs(j,5);
++			normal(2)=penaltypairs(j,6);
++
++			vx1=md.initialization.vx(penaltypairs(j,1)); 
++			vx2=md.initialization.vx(penaltypairs(j,2));
++			vy1=md.initialization.vy(penaltypairs(j,1)); 
++			vy2=md.initialization.vy(penaltypairs(j,2));
++			penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
++			%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
++			if(penetration>0),
++				p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'ro-','LineWidth',1);
++				set(p2,'MarkerSize',3);
++				isp2=1;
++			else
++				p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'ko-','LineWidth',1);
++				set(p1,'MarkerSize',3);
++				isp1=1;
++			end
++		end
++
++		%point out the tips
++		h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g*');
++		plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g*');
++	end
++	if strcmpi(getfieldvalue(options,'legend','on'),'on'),
++		if isp1 & isp2
++			l=legend([h1,h2,p1,p2],'mesh boundaries','crack tips','faults','rifts');
++		elseif isp1
++			l=legend([h1,h2,p1],'mesh boundaries','crack tips','faults');
++		elseif isp2
++			l=legend([h1,h2,p2],'mesh boundaries','crack tips','rifts');
++		else
++			l=legend([h1,h2],'mesh boundaries','crack tips');
++		end
++		set(l,'Location',getfieldvalue(options,'legend_location','NorthEast'));
++	end
++else
++	error('plot error message: no rifts available!');
++end
++hold off
++
++%apply options
++options=addfielddefault(options,'title','Rift/Fault location');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_overlay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_overlay.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_overlay.m	(revision 13009)
+@@ -0,0 +1,154 @@
++function plot_overlay(md,data,options,plotlines,plotcols,i)
++%PLOT_OVERLAY - superimpose radar image to a given field
++%
++%   Usage:
++%      plot_overlay(md,options,plotlines,plotcols,i)
++%
++%   See also: PLOTMODEL
++
++%process mesh and data
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++if strcmpi(data,'none'),
++	radaronly=1;
++	data=NaN*ones(md.mesh.numberofvertices,1);
++	datatype=1;
++else
++	radaronly=0;
++	[data datatype]=processdata(md,data,options);
++end
++
++%check is2d
++if ~is2d, 
++	error('buildoverlay error message: overlay not supported for 3d meshes, project on a layer');
++end
++if datatype==3,
++	error('buildoverlay error message: overlay not supported for quiver plots');
++end
++
++
++%radar power
++if ~any(isnan(md.radaroverlay.x)) & ~any(isnan(md.radaroverlay.y)) & ~any(isnan(md.radaroverlay.pwr)),
++	disp('plot_overlay info: the radar image held by the model is being used');
++	xlim=[min(md.radaroverlay.x) max(md.radaroverlay.x)];
++	ylim=[min(md.radaroverlay.y) max(md.radaroverlay.y)];
++else
++	disp('Extracting radar image...');
++	%Get xlim and ylim (used to extract radar image)
++	xlim=getfieldvalue(options,'xlim',[min(x) max(x)])/getfieldvalue(options,'unit',1);
++	ylim=getfieldvalue(options,'ylim',[min(y) max(y)])/getfieldvalue(options,'unit',1);
++	options=addfielddefault(options,'xlim',xlim);
++	options=addfielddefault(options,'ylim',ylim);
++	md=radarpower(md,options);
++end
++contrast = getfieldvalue(options,'contrast',1);  
++radar = (md.radaroverlay.pwr).^(contrast);
++radar = radar./max(radar(:));
++%radar(find(radar==0))=1; %Change background from black to white
++
++%InterpFromMeshToGrid
++xmin=min(md.radaroverlay.x);
++ymax=max(md.radaroverlay.y);
++xspacing=(max(md.radaroverlay.x)-min(md.radaroverlay.x))/(length(md.radaroverlay.x));
++yspacing=(max(md.radaroverlay.y)-min(md.radaroverlay.y))/(length(md.radaroverlay.y));
++nlines=length(md.radaroverlay.y);
++ncols =length(md.radaroverlay.x);
++disp('Interpolating data on grid...');
++if radaronly,
++	x_m=xmin:xspacing:xmin+ncols*xspacing;
++	y_m=ymax-nlines*yspacing:yspacing:ymax;
++	data_grid=NaN*ones(nlines,ncols);
++else
++	[x_m y_m data_grid]=InterpFromMeshToGrid(elements,x/getfieldvalue(options,'unit',1),y/getfieldvalue(options,'unit',1),...
++		data,xmin,ymax,xspacing,yspacing,nlines,ncols,NaN);
++end
++
++%Process data_grid (For processing, it is better not to have nan)
++pos=find(isinf(data_grid));
++if ~isempty(pos),
++	disp('Warning: removing Infs from vector (probably log(0)?)');
++	data_grid(pos)=NaN;
++end
++if exist(options,'caxis'),
++	caxis_opt=getfieldvalue(options,'caxis');
++	data_grid(find(data_grid<caxis_opt(1)))=caxis_opt(1);
++	data_grid(find(data_grid>caxis_opt(2)))=caxis_opt(2);
++	data_min=caxis_opt(1);
++	data_max=caxis_opt(2);
++else
++	data_min=min(data_grid(:));
++	data_max=max(data_grid(:));
++end
++data_nan=find(isnan(data_grid));
++data_grid(data_nan)=data_min; 
++
++%Special colormaps that require hsv treatment
++colorm=getfieldvalue(options,'colormap','Rignot');
++if strcmpi(colorm,'Rignot') | strcmpi(colorm,'Seroussi') | strcmpi(colorm,'redblue')
++	if strcmpi(colorm,'Rignot'),
++		transparency=getfieldvalue(options,'alpha',1);
++		h=(data_grid-data_min)/(data_max-data_min+eps);
++		if radaronly, h(:)=0; end
++		s=max(min((0.1+h).^(1/transparency),1),0);
++	elseif strcmpi(colorm,'Seroussi'),
++		transparency=getfieldvalue(options,'alpha',1);
++		h=1-(data_grid-data_min)/(data_max-data_min+eps)*0.7;
++		if radaronly, h(:)=0; end
++		s=max(min((0.1+h).^(1/transparency),1),0);
++	elseif strcmpi(colorm,'redblue')
++		data_mean=data_min+(data_max-data_min)/2;
++		h=1*ones(size(data_grid));
++		h(find(data_grid<data_mean))=0.7;
++		s=max(min(abs(data_grid-data_mean)/(data_max-data_mean) ,1),0);
++	else
++		error('colormap not supported yet. (''Rignot'' and ''redblue'' are the only cupported colormaps)');
++	end
++	%(S) Saturation is 0 in NaNs
++	s(data_nan)=0;
++	%(V) intensity is based on radar image
++	v=radar; %use radar power as intensity
++
++	%Transform HSV to RGB
++	image_hsv=zeros(size(data_grid,1),size(data_grid,2),3);
++	image_hsv(:,:,1)=h; clear h;
++	image_hsv(:,:,2)=s; clear s;
++	image_hsv(:,:,3)=v; clear v;
++	image_rgb=hsv2rgb(image_hsv);
++else
++	colorm = getcolormap(options);
++	len    = size(colorm,1);
++
++	ind = ceil((len-1)*(data_grid-data_min)/(data_max - data_min + eps) +1);
++	ind(find(ind>len))=len;
++	image_rgb=zeros(size(data_grid,1),size(data_grid,2),3);
++	r=colorm(:,1); image_rgb(:,:,1)=r(ind); clear r;
++	g=colorm(:,2); image_rgb(:,:,2)=g(ind); clear g;
++	b=colorm(:,3); image_rgb(:,:,3)=b(ind); clear b;
++
++	%Now add radarmap
++	r = image_rgb(:,:,1).*radar;  r(data_nan) = radar(data_nan);  image_rgb(:,:,1) = r;  clear r;
++	g = image_rgb(:,:,2).*radar;  g(data_nan) = radar(data_nan);  image_rgb(:,:,2) = g;  clear g;
++	b = image_rgb(:,:,3).*radar;  b(data_nan) = radar(data_nan);  image_rgb(:,:,3) = b;  clear b;
++end
++
++%Select plot area 
++subplotmodel(plotlines,plotcols,i,options);
++
++%Plot: 
++imagesc(md.radaroverlay.x*getfieldvalue(options,'unit',1),md.radaroverlay.y*getfieldvalue(options,'unit',1),image_rgb);set(gca,'YDir','normal');
++
++%last step: mesh overlay?
++if exist(options,'edgecolor'),
++	hold on
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++	patch('Faces',[A B C],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none',...
++		'EdgeColor',getfieldvalue(options,'edgecolor'),'LineWidth',getfieldvalue(options,'linewidth',1));
++end
++
++%Apply options, without colorbar and without grid
++options=changefieldvalue(options,'colormap',colorm);              % We used an HSV colorbar
++if ~isnan(data_min),
++	options=changefieldvalue(options,'caxis',[data_min data_max]); % force caxis so that the colorbar is ready
++end
++options=addfielddefault(options,'axis','equal off');              % default axis
++applyoptions(md,data,options);
++drawnow
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_importancefactors.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_importancefactors.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_importancefactors.m	(revision 13009)
+@@ -0,0 +1,83 @@
++function plot_importancefactors(md,options,width,ii);
++%PLOT_IMPORTANCEFACTORS - plot importance factors
++%
++%   Usage:
++%      plot_importancefactors(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%first recover design variable descriptor
++if exist(options,'designvariable'),
++	descriptor=getfieldvalue(options,'designvariable');
++else
++	error('plot_importancefactors error message: Need to supply design variable descriptor');
++end
++descriptorlength=length(descriptor);
++
++%then recover responsfunction name
++if exist(options,'responsefunction'),
++	responsefunctiondescriptor=getfieldvalue(options,'responsefunction');
++else
++	error('plot_importancefactors error message: Need to supply response function descriptor');
++end
++
++%go through all response functions and find the one corresponding to the correct responsefunctiondescriptor
++responsefunctions=md.qmu.results{2};
++found=0;
++for i=1:length(responsefunctions),
++	if strcmpi(responsefunctions(i).descriptor,responsefunctiondescriptor),
++		found=i;
++		break;
++	end
++end
++if ~found,
++	error('plot_importancefactors error message: could not find correct response function');
++end
++responsefunctions=responsefunctions(found);
++nfun=size(responsefunctions.desvar,1);
++
++%Now recover response to the correct desgin variable
++importancefactors=zeros(md.qmu.numberofpartitions,1);
++count=0;
++for i=1:nfun,
++	desvar=responsefunctions.desvar{i};
++	if strncmpi(desvar,descriptor,descriptorlength),
++		count=count+1;
++		importancefactors(count)=responsefunctions.impfac(i);
++	end
++end
++if count==0,
++	error('plot_importancefactors error message: could not find to response functions with corresponding design variable');
++end
++
++%log?
++if exist(options,'log'),
++	logvalue=getfieldvalue(options,'log');
++	importancefactors=log(importancefactors)/log(logvalue);
++end
++
++%Ok, get partitioning.
++[epart npart]=MeshPartition(md,md.qmu.numberofpartitions);
++
++%distribute importance factor
++nodeimportance=importancefactors(npart);
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++%edgecolor
++edgecolor=getfieldvalue(options,'edgecolor','none');
++
++%standard plot:
++subplot(width,width,ii);
++
++%ok, plot nodeimportance now.
++if is2d,
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', nodeimportance,'FaceColor','interp','EdgeColor',edgecolor);
++else
++	error('plot_importancefactors error message: 3d meshes not supported yet');
++end
++
++%apply options
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_penalties.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_penalties.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_penalties.m	(revision 13009)
+@@ -0,0 +1,48 @@
++function plot_penalties(md,options,width,i);
++%PLOT_PENALTIES - plot penalties
++%
++%   Usage:
++%      plot_penalties(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++%plot mesh penalties
++subplot(width,width,i); 
++
++%units
++if exist(options,'unit'),
++	unit=getfieldvalue(options,'unit');
++	x=x*unit;
++	y=y*unit;
++	z=z*unit;
++end
++
++if ~md.mesh.dimension==3,
++	error('no penalties to plot for ''2d'' model');
++elseif isempty(md.penalties),
++	disp('no penalty applied in this model');
++	return;
++else
++	%plot mesh
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++
++	hold on;
++	for (i=1:size(md.penalties,1)),
++		P1=plot3(x(md.penalties(i,1)),y(md.penalties(i,1)),z(md.penalties(i,1)),'ro','MarkerSize',15,'MarkerFaceColor','r');
++		P2=plot3(x(md.penalties(i,:)),y(md.penalties(i,:)),z(md.penalties(i,:)),'bo-','LineWidth',2,'MarkerSize',8,'MarkerFaceColor','b');
++	end
++	legend([P1 P2],'MacAyeal''s penalized nodes','Pattyn''s penalized nodes');
++end
++
++%apply options
++options=addfielddefault(options,'title','Penalties');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_parthistw.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_parthistw.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_parthistw.m	(revision 13009)
+@@ -0,0 +1,43 @@
++function plot_parthist(md,options,nlines,ncols,i);
++%PLOT_PARTHIST - plot partitioning histogram
++%
++%   Usage:
++%      plot_parthist(md,options,nlines,ncols,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++
++%plot mesh
++subplot(nlines,ncols,i); 
++
++imin=min(md.qmu.partition);
++imax=max(md.qmu.partition);
++
++part=zeros(imax-imin+1,2);
++
++for i=imin:imax
++    ind=find(md.qmu.partition == i);
++    part(i-imin+1,1)=length(ind);
++	part(i-imin+1,2)=sum(md.vertex_weight(ind));
++end
++
++%subplot(2,1,1)
++%bar(imin:imax,part(:,1));
++%xlim([imin-0.5 imax+0.5])
++%title('Number of Nodes in Each Partition')
++%options=addfielddefault(options,'xlim',[imin-0.5 imax+0.5]);
++%options=addfielddefault(options,'title','Number of Nodes in Each Partition');
++%options=addfielddefault(options,'colorbar','off');
++
++%subplot(2,1,2)
++bar(imin:imax,part(:,2));
++%xlim([imin-0.5 imax+0.5])
++%title('Total Weight in Each Partition')
++options=addfielddefault(options,'xlim',[imin-0.5 imax+0.5]);
++options=addfielddefault(options,'title','Total Weight in Each Partition');
++options=addfielddefault(options,'colorbar','off');
++
++%apply options
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_streamlines.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_streamlines.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_streamlines.m	(revision 13009)
+@@ -0,0 +1,41 @@
++function plot_streamlines(md,options)
++%PLOT_STREAMLINES - plot stream lines on a figure
++%
++%   Usage:
++%      plot_streamlines(md,options)
++
++%process data and model
++[x y z index is2d isplanet]=processmesh(md,[],options);
++[u datatype]=processdata(md,md.initialization.vx,options);
++[v datatype]=processdata(md,md.initialization.vy,options);
++
++%some checks
++if ~is2d,
++	disp('plot_streamlines error: streamlines option not supported for 3d plots. Project on a layer')
++	return
++end
++
++%initialize flowpath
++streamlines=getfieldvalue(options,'streamlines');
++if ischar(streamlines) & strcmpi(streamlines,'on');
++	streamlines=60;
++end
++if iscell(streamlines)
++	x0=[]; y0=[];
++	for i=1:size(streamlines,2)
++		coord=streamlines{i};
++		x0=[x0;coord(1)]; y0=[y0;coord(2)];
++	end
++else
++	x0=x(1:ceil(length(x)/streamlines):end);
++	y0=y(1:ceil(length(x)/streamlines):end);
++end
++
++%Get flow lines
++flowpath=flowlines(index,x,y,u,v,x0,y0);
++
++%plot
++hold on
++for i=1:length(flowpath)
++	patch('Xdata',[flowpath(i).x;NaN],'Ydata',[flowpath(i).y;NaN],'facecolor','none','edgecolor','y');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_edges.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_edges.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_edges.m	(revision 13009)
+@@ -0,0 +1,34 @@
++function plot_edges(md,options,width,i,datai);
++%PLOT_SEGMENTS - plot edges, with different colors according to segment markers.
++%
++%   Usage:
++%      plot_edges(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%plot mesh boundaries
++subplot(width,width,i); 
++
++%process mesh and data
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++edges=md.mesh.edges;
++if isnan(edges)
++	error('edges in NaN')
++end
++
++if (md.mesh.dimension==2),
++	%plot mesh
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++	h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	hold on;
++	text(sum(x(edges(:,1:2)),2)/2,sum(y(edges(:,1:2)),2)/2,sum(z(edges(:,1:2)),2)/2,...
++		num2str(transpose(1:size(edges,1))),...
++		'backgroundcolor',[0.8 0.9 0.8],'HorizontalAlignment','center','VerticalAlignment','middle');
++else
++	error('plot_edges: 3d plot of edges not supported yet!');
++end
++
++%apply options
++options=addfielddefault(options,'title','Edges');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/checkplotoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/checkplotoptions.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/checkplotoptions.m	(revision 13009)
+@@ -0,0 +1,206 @@
++function options=checkplotoptions(md,options);
++%PARSE_OPTIONS - build a structure that holds all plot options
++%
++%   Usage:
++%      options=checkplotoptions(md,options);
++%
++%   See also: PLOTMODEL
++
++%units
++if exist(options,'unit'),
++	if strcmpi(getfieldvalue(options,'unit'),'km')
++		options=changefieldvalue(options,'unit',10^-3);
++	end
++	if strcmpi(getfieldvalue(options,'unit'),'100km')
++		options=changefieldvalue(options,'unit',10^-5);
++	end
++
++end
++
++%density
++if exist(options,'density'),
++	density=getfieldvalue(options,'density');
++	options=changefieldvalue(options,'density',abs(ceil(density)));
++end
++
++%Show section
++if exist(options,'showsection'),
++	if strcmpi(getfieldvalue(options,'showsection'),'on')
++		options=changefieldvalue(options,'showsection',4);
++	end
++end
++
++%smooth values
++if exist(options,'smooth'),
++	if strcmpi(getfieldvalue(options,'smooth'),'on')
++		options=changefieldvalue(options,'smooth',0);
++	end
++end
++
++%contouronly values
++if exist(options,'contouronly'),
++	if strcmpi(getfieldvalue(options,'contouronly'),'on')
++		options=changefieldvalue(options,'contouronly',1);
++	end
++end
++
++%Colorbar;
++if exist(options,'colorbar'),
++	if strcmpi(getfieldvalue(options,'colorbar'),'on')
++		options=changefieldvalue(options,'colorbar',1);
++	elseif strcmpi(getfieldvalue(options,'colorbar'),'off')
++			options=changefieldvalue(options,'colorbar',0);
++	end
++end
++	
++%text
++if exist(options,'text'),
++	%1: textvalue
++	textvalues=getfieldvalue(options,'text');
++	%ischar if only one expstyle -> create a cell
++	if ischar(textvalues),
++		textvalues={textvalues};
++		numtext=1;
++	elseif iscell(textvalues),
++		numtext=length(textvalues);
++	else
++		error('plot error message: ''text'' option should be either a string or a cell');
++	end
++
++	%2: textweight
++	if exist(options,'textweight'),
++		textweightvalues=getfieldvalue(options,'textweight');
++		%ischar if only one textweight -> create a cell
++		if ischar(textweightvalues),
++			textweightvalues={textweightvalues};
++		elseif ~iscell(textweightvalues);
++			error('plot error message: ''textweight'' option should be either a string or a cell');
++		end
++	else
++		textweightvalues={'n'};
++	end
++	textweightvalues=repmat(textweightvalues,1,numtext); textweightvalues(numtext+1:end)=[];
++	%3: textsize
++	if exist(options,'textsize'),
++		textsizevalues=getfieldvalue(options,'textsize');
++		%ischar if only one textsize -> create a cell
++		if isnumeric(textsizevalues),
++			textsizevalues={textsizevalues};
++		elseif ~iscell(textsizevalues);
++			error('plot error message: ''textsize'' option should be either a number or a cell');
++		end
++	else
++		textsizevalues={14};
++	end
++	textsizevalues=repmat(textsizevalues,1,numtext); textsizevalues(numtext+1:end)=[];
++	%4: textcolor
++	if exist(options,'textcolor'),
++		textcolorvalues=getfieldvalue(options,'textcolor');
++		%ischar if only one textcolor -> create a cell
++		if ischar(textcolorvalues),
++			textcolorvalues={textcolorvalues};
++		elseif ~iscell(textcolorvalues);
++			error('plot error message: ''textcolor'' option should be either a string or a cell');
++		end
++	else
++		textcolorvalues={'k'};
++	end
++	textcolorvalues=repmat(textcolorvalues,1,numtext); textcolorvalues(numtext+1:end)=[];
++	%4: textposition
++	if exist(options,'textposition'),
++		textpositionvalues=getfieldvalue(options,'textposition');
++		%ischar if only one textposition -> create a cell
++		if isnumeric(textpositionvalues),
++			textpositionvalues={textpositionvalues};
++		elseif ~iscell(textpositionvalues);
++			error('plot error message: ''textposition'' option should be either a string or a cell');
++		end
++	else
++		error('plot error message: ''textposition'' option is missing');
++	end
++	%6: textrotation
++	if exist(options,'textrotation'),
++		textrotationvalues=getfieldvalue(options,'textrotation');
++		%ischar if only one textsize -> create a cell
++		if isnumeric(textrotationvalues),
++			textrotationvalues={textrotationvalues};
++		elseif ~iscell(textrotationvalues);
++			error('plot error message: ''textrotation'' option should be either a number or a cell');
++		end
++	else
++		textrotationvalues={0};
++	end
++	textrotationvalues=repmat(textrotationvalues,1,numtext); textrotationvalues(numtext+1:end)=[];
++	options=changefieldvalue(options,'text',textvalues);
++	options=changefieldvalue(options,'textsize',textsizevalues);
++	options=changefieldvalue(options,'textweight',textweightvalues);
++	options=changefieldvalue(options,'textcolor',textcolorvalues);
++	options=changefieldvalue(options,'textposition',textpositionvalues);
++	options=changefieldvalue(options,'textrotation',textrotationvalues);
++end
++
++%expdisp
++expdispvaluesarray=cell(0,0);
++expstylevaluesarray=cell(0,0);
++expstylevalues=cell(0,0);
++if exist(options,'expstyle'),
++	expstylevalues=getfieldvalue(options,'expstyle');
++	%ischar if only one expstyle -> create a cell
++	if ischar(expstylevalues),
++		expstylevalues={expstylevalues};
++	end
++end
++if exist(options,'expdisp'),
++	expdispvalues=getfieldvalue(options,'expdisp');
++	%ischar if only one expstyle -> create a cell
++	if ischar(expdispvalues),
++		expdispvalues={expdispvalues};
++	end
++	for i=1:length(expdispvalues)
++		expdispvaluesarray{end+1}=expdispvalues{i};
++		if (length(expstylevalues)>=i),
++			expstylevaluesarray{end+1}=expstylevalues{i};
++		else
++			expstylevaluesarray{end+1}='g-';
++		end
++	end
++end
++options=changefieldvalue(options,'expstyle',expstylevaluesarray);
++options=changefieldvalue(options,'expdisp',expdispvaluesarray);
++
++%latlonnumbering
++if exist(options,'latlonclick'),
++	if strcmpi(getfieldvalue(options,'latlonclick'),'on')
++		options=changefieldvalue(options,'latlonclick',1);
++	end
++end
++
++%north arrow
++if exist(options,'northarrow'),
++	if strcmpi(getfieldvalue(options,'northarrow'),'on')
++		%default values
++		Lx=max(md.mesh.y)-min(md.mesh.y);
++		Ly=max(md.mesh.y)-min(md.mesh.y);
++		%default values
++		options=changefieldvalue(options,'northarrow',[min(md.mesh.x)+1/6*Lx   min(md.mesh.y)+5/6*Ly   1/15*Ly   0.25   1/250*Ly]);
++	end
++end
++
++%scale ruler
++if exist(options,'scaleruler'),
++	if strcmpi(getfieldvalue(options,'scaleruler'),'on')
++		%default values
++		Lx=max(md.mesh.y)-min(md.mesh.y);
++		Ly=max(md.mesh.y)-min(md.mesh.y);
++		%default values
++		options=changefieldvalue(options,'scaleruler',[min(md.mesh.x)+6/8*Lx   min(md.mesh.y)+1/10*Ly   10^(ceil(log10(Lx)))/5 floor(Lx/100) 5]);
++	end
++end
++
++%Log scale (LOTS of changes to be performed
++if exist(options,'log'),
++	if exist(options,'caxis')
++		options=changefieldvalue(options,'caxis',log(getfieldvalue(options,'caxis'))/log(getfieldvalue(options,'log')));
++	end
++	options=changefieldvalue(options,'cutoff',log(getfieldvalue(options,'cutoff',1.5))/log(getfieldvalue(options,'log')));
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/arrow.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/arrow.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/arrow.m	(revision 13009)
+@@ -0,0 +1,60 @@
++function arrow(x0,y0,x1,y1,varargin)
++%ARROW - plot arrow, using (x0,y0) and (x1,y1) as initial and end points. options can be specified.
++%
++%   Usage:
++%      arrow(x1,y1,x2,y2,options)
++%      where options is a lit of paired arguments of string OR enums
++%      options can be: 
++%            'ratio': default .5 (ratio headarrow/length)
++%            'widthratio': default is 1/10 of length
++
++
++%recover options
++options=pairoptions(varargin{:});
++ratio=getfieldvalue(options,'ratio',.5);
++widthratio=getfieldvalue(options,'widthratio',.1);
++color=getfieldvalue(options,'color','k');
++
++%compute some values out of (x1,y1) and (x2,y2)
++length=sqrt((x1-x0)^2+(y1-y0)^2);
++width=length*widthratio;
++
++%Build the two points Ap and Bp
++x=zeros(2,1);
++y=zeros(2,1);
++x(1)=x0; y(1)=y0;
++x(2)=x1; y(2)=y1;
++
++Ap=[x(1)
++   y(1)];
++Bp=[x(2)
++   y(2)];
++
++%Build arrowhead first
++ang2=150*2*pi/360;
++rotation=[cos(ang2), sin(ang2); -sin(ang2), cos(ang2)];
++
++E=ratio*rotation*(Bp-Ap)+Bp;
++F=Bp;
++G=ratio*rotation'*(Bp-Ap)+Bp;
++H=Bp/4+E*3/8+G*3/8;
++
++%Build rectangle
++u=Bp-Ap;
++alpha=atan2(u(2),u(1));
++
++A=Ap-[-width/2*sin(alpha)
++   width/2*cos(alpha)];
++ B=H-[-width/2*sin(alpha)
++   width/2*cos(alpha)];
++C=H+[-width/2*sin(alpha)
++   width/2*cos(alpha)];
++D=Ap+[-width/2*sin(alpha)
++   width/2*cos(alpha)];
++
++%Plot arrow
++hold on
++p1=patch([A(1) B(1) C(1) D(1)],[A(2) B(2) C(2) D(2)],color);
++set(p1,'EdgeColor',color); set(p1,'FaceColor',color);
++p2=patch([E(1) F(1) G(1) H(1)],[E(2) F(2) G(2) H(2)],color);
++set(p2,'EdgeColor',color); set(p2,'FaceColor',color);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/latlonoverlay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/latlonoverlay.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/latlonoverlay.m	(revision 13009)
+@@ -0,0 +1,149 @@
++function latlonoverlay(md,options)
++%LATLONOVERLAY - overlay latitude and longitude lines on current figure
++%
++%   latstep,lonstep, in latitude and longitude degreees, between two latitudinal, longitudinal profiles.
++%   color: [1 1 1] for example
++%   resolution: profile resolution ( in lat,lon degrees) 
++%   gap: gap (in meters) to plug lat,lon degree numbers;
++%
++%   Usage:
++%      latlonoverlay(options)
++
++%get options
++latlon=getfieldvalue(options,'latlon');
++numbering=getfieldvalue(options,'latlonnumbering','off');
++latlonclick=getfieldvalue(options,'latlonclick',0);
++fontsize=getfieldvalue(options,'fontsize',16);
++
++%recover arguments (set default parameters if needed)
++%1: latlon
++if ~iscell(latlon),
++	if ischar(latlon) & strcmpi(latlon,'on'),
++		%defaults
++		latstep=3; lonstep=3;
++		resolution=0.1;
++		color=[1 0 1];
++	else return; end
++else
++	if length(latlon)<2
++		error('latlonoverlay error message: at least 2 arguments are required, or use ''on'' option.');
++	end
++	if length(latlon)>3, color=latlon{4};      else color=[1 1 1]; end
++	if length(latlon)>2, resolution=latlon{3}; else resolution=0.1;end
++	latstep=latlon{1};
++	lonstep=latlon{2};
++end
++
++%2: numbering
++if ~iscell(numbering) & isnan(numbering),
++	numbering=false;
++else
++	if ~iscell(numbering),
++		if strcmpi(char(numbering),'on'),
++			%defaults
++			latgap=2; longap=2;
++			colornumber=color;
++			latangle=0; lonangle=0;
++			numbering=true;
++		else
++			numbering=false;
++		end
++	else
++		latgap=numbering{1}; longap=numbering{2};
++		colornumber=numbering{3};
++		latangle=numbering{4}; lonangle=numbering{5};
++		numbering=true;
++	end
++end
++
++%what are the x and y limits
++xlimits=getfieldvalue(options,'xlim',xlim);
++ylimits=getfieldvalue(options,'ylim',ylim);
++
++%lat
++for lat=-90:latstep:90
++	longitudes=0:resolution:360;
++	latitudes =lat*ones(size(longitudes));
++
++	if strcmpi(md.mesh.hemisphere,'n'),
++		if lat<0, continue; end
++		[x,y]=ll2xy(latitudes,longitudes,+1,45,70);
++	elseif strcmpi(md.mesh.hemisphere,'s'),
++		if lat>0, continue; end
++		[x,y]=ll2xy(latitudes,longitudes,-1, 0,71);
++	else error('field hemisphere should either be ''n'' or ''s'''); end
++
++	pos=find(x<=xlimits(2) & x>=xlimits(1) & y<=ylimits(2) & y>=ylimits(1));
++	if length(pos)<=1, continue; end
++	x=x(pos);y=y(pos);
++	l=line(x,y,'Color',color);
++
++	if numbering
++		ind=length(x)-2*latgap;
++		if (ind<=0), continue; end
++		xcorner=x(ind);            ycorner=y(ind);
++		xcorner2=x(max(ind-10,1)); ycorner2=y(max(ind-10,1));
++
++		if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
++			angle=mod((180)/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner))+latangle,360);
++			if lat<0, label=[num2str(abs(lat)) '^{\circ}S'];
++			else      label=[num2str(abs(lat)) '^{\circ}N']; end
++			th=text(xcorner,ycorner,label);
++			set(th,'Color',colornumber,'Rotation',angle,'FontSize',fontsize,'HorizontalAlignment','center','VerticalAlignment','middle','Clipping','on');
++
++			%erase line and redraw it in two parts, to leave space for latitude number
++			delete(l);
++			line(x(1:ind-latgap),y(1:ind-latgap),'Color',color);hold on;
++			line(x(ind+latgap:end),y(ind+latgap:end),'Color',color);
++			set(gcf,'InvertHardcopy','off');
++		end
++
++	end
++end
++
++%lon
++for lon=-180:lonstep:180
++
++	if strcmpi(md.mesh.hemisphere,'n'),
++		latitudes =0:resolution:90;
++		longitudes=lon*ones(size(latitudes));
++		[x,y]=ll2xy(latitudes,longitudes,+1,45,70);
++	elseif strcmpi(md.mesh.hemisphere,'s'),
++		latitudes =-90:resolution:0;
++		longitudes=lon*ones(size(latitudes));
++		[x,y]=ll2xy(latitudes,longitudes,-1, 0,71);
++	else
++		error('field hemisphere should either be ''n'' or ''s'''); 
++	end
++
++
++	pos=find(x<=xlimits(2) & x>=xlimits(1) & y<=ylimits(2) & y>=ylimits(1));
++	if length(pos)<=1, continue; end
++	x=x(pos);y=y(pos);
++	l=line(x,y,'Color',color);
++
++	if numbering,
++		ind=length(x)-2*longap;
++		if (ind<=0), continue; end
++		xcorner=x(ind);            ycorner=y(ind);
++		xcorner2=x(max(ind-10,1)); ycorner2=y(max(ind-10,1));
++
++		if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
++			angle=mod((180)/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner))+lonangle,360);
++			if lon<0, label=[num2str(abs(lon)) '^{\circ}W'];
++			else      label=[num2str(abs(lon)) '^{\circ}E']; end
++			th=text(xcorner,ycorner,label);
++			set(th,'Color',colornumber,'Rotation',angle,'FontSize',fontsize,'HorizontalAlignment','center','VerticalAlignment','middle','Clipping','on');
++
++			%erase line and redraw it in two parts, to leave space for latitude number
++			delete(l);
++			line(x(1:ind-longap),y(1:ind-longap),'Color',color);hold on;
++			line(x(ind+longap:end),y(ind+longap:end),'Color',color);
++		end
++
++	end
++end
++
++%Back to original limits
++xlim(xlimits);
++ylim(ylimits);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_profile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_profile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_profile.m	(revision 13009)
+@@ -0,0 +1,55 @@
++function plot_profile(md,data,options,nlines,ncols,ii)
++%PLOT_SECTION - plot a given field on a profile
++%
++%   Usage:
++%      plot_profile(md,data,options,nlines,ncols,i)
++%
++%   See also: PLOTMODEL
++
++%process model
++[x_m y_m z_m elements_m is2d isplanet]=processmesh(md,[],options);
++if is2d, error('only 3d model supported'); end
++
++%Get number of curves and generate random colors
++numcurves=size(data,2);
++colorm=getfieldvalue(options,'colormap','lines');
++color=eval([ colorm '(numcurves);']);
++options=removefield(options,'colormap',0); %back to default colormap
++
++%Get coordinates
++location=getfieldvalue(options,'profile');
++if ~isnumeric(location) | numel(location)~=2,
++	error('location provided not supported (should be [x y])');
++end
++xprof=location(1);
++yprof=location(2);
++
++%Loop over number of curves
++for i=1:numcurves,
++
++	%Process data
++	[datai datatype]=processdata(md,data(:,i),options);
++
++	%resolution
++	if exist(options,'resolution'),
++		resolution=getfieldvalue(options,'resolution');
++	else %Default resolution
++		resolution=[100];
++		disp(['plot_profile warning: no resolution specified, using default: ' num2str(resolution) ]);
++	end
++
++	%Compute profile value
++	[z,data_interp]=ProfileValues(md,datai,xprof,yprof,resolution);
++
++	%plot profile
++	subplot(nlines,ncols,ii)
++	plot(data_interp,z,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1),'LineStyle','-');
++	hold on;
++end
++
++%apply options
++options=addfielddefault(options,'title','Profile');
++options=addfielddefault(options,'colorbar',0);
++options=addfielddefault(options,'ylabel','z');
++options=addfielddefault(options,'view',2);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/scaleruler.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/scaleruler.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/scaleruler.m	(revision 13009)
+@@ -0,0 +1,61 @@
++function scaleruler(options)
++%SCALERULER - overlay a scale ruler on current plot
++%
++%   Usage:
++%      scaleruler(options)
++
++%get options
++structure=getfieldvalue(options,'scaleruler');
++fontsize=getfieldvalue(options,'scaleruler_fontsize',16);
++
++%Go through structure and fill missing arguments
++if length(structure)~=5
++	error('plotmodel error message: bad number of input arguments for scaleruler: [x0 y0 length thickness numberofticks]');
++end
++
++%retrieve north arrow parameters
++x0=structure(1);
++y0=structure(2);
++lengthscale=structure(3);
++widthscale=structure(4);
++numberofticks=structure(5);
++
++%initialize some coordinates
++unitlength=lengthscale/(numberofticks -1);
++flag=-1;
++
++Bd=[x0 y0];
++Bu=[x0 y0+widthscale];
++Tick=0;
++
++%Text
++xt=Bu(1);
++yt=Bu(2)+widthscale;
++text(xt,yt,num2str(Tick),'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
++
++%loope over the patches
++for i=1:numberofticks-1,
++	Au=Bu;
++	Ad=Bd;
++	Bu=[Au(1)+unitlength Ad(2)+widthscale];
++	Bd=[Ad(1)+unitlength Ad(2)];
++	Tick=Tick+unitlength;
++
++	%pathes
++	if flag==-1
++		p=patch([Ad(1) Bd(1) Bu(1) Au(1)],[Ad(2) Bd(2) Bu(2) Au(2)],'Black','FaceAlpha',0.5);
++	else
++		p=patch([Ad(1) Bd(1) Bu(1) Au(1)],[Ad(2) Bd(2) Bu(2) Au(2)],'White','FaceAlpha',0.3);
++	end
++
++	%flip flag
++	flag=-flag;
++
++	%Text
++	xt=Bu(1);
++	yt=Bu(2)+widthscale;
++	if i~=numberofticks-1,
++		text(xt,yt,num2str(round_ice(Tick/1000,3)),'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
++	end
++end
++text(xt,yt,[num2str(round_ice(Tick/1000,3)) ' km'],'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/applyoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/applyoptions.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/applyoptions.m	(revision 13009)
+@@ -0,0 +1,509 @@
++function applyoptions(md,data,options)
++%APPLYOPTIONS - apply the options to current plot
++%
++%   Usage:
++%      applyoptions(md,data,options)
++%
++%   See also: PLOTMODEL, PARSE_OPTIONS
++		
++
++%some defaults
++if isfield(md.mesh,'hemisphere'),
++	if strcmpi(md.mesh.hemisphere,'n'), options=addfielddefault(options,'hemisphere','n'); 
++	elseif strcmpi(md.mesh.hemisphere,'s'), options=addfielddefault(options,'hemisphere','s'); 
++	end
++end
++
++%fontsize
++fontsize=getfieldvalue(options,'fontsize',14);
++
++%fontweight
++fontweight=getfieldvalue(options,'fontweight','normal');
++
++%title
++if exist(options,'title')
++	titlevalue=getfieldvalue(options,'title');
++	if iscell(titlevalue),
++		title(titlevalue,'FontSize',fontsize,'FontWeight',fontweight);
++	else
++		if ~isnan(titlevalue),
++			title(titlevalue,'FontSize',fontsize,'FontWeight',fontweight);
++		end
++	end
++end
++
++%xlabel, ylabel and zlabel
++if exist(options,'xlabel');
++	xlabel(getfieldvalue(options,'xlabel'),'FontSize',fontsize,'FontWeight',fontweight);
++end
++if exist(options,'ylabel');
++	ylabel(getfieldvalue(options,'ylabel'),'FontSize',fontsize,'FontWeight',fontweight);
++end
++if exist(options,'zlabel');
++	zlabel(getfieldvalue(options,'zlabel'),'FontSize',fontsize,'FontWeight',fontweight);
++end
++
++%xticks, yticks and zticks
++if exist(options,'xtick'), set(gca,'XTick',getfieldvalue(options,'xtick')); end
++if exist(options,'ytick'), set(gca,'YTick',getfieldvalue(options,'ytick')); end
++if exist(options,'ztick'), set(gca,'ZTick',getfieldvalue(options,'ztick')); end
++
++%view 
++if md.mesh.dimension==3 & ~exist(options,'layer'),
++	view(getfieldvalue(options,'view',3));
++else
++	view(getfieldvalue(options,'view',2));
++end
++
++%axis
++set(gca,'FontSize',getfieldvalue(options,'axisfontsize',fontsize));;
++if exist(options,'axis')
++	eval(['axis ' getfieldvalue(options,'axis')]);
++else
++	if ((md.mesh.dimension==2) | exist(options,'layer')),
++		axis tight equal;
++	else
++		axis auto tight
++	end
++end
++
++%box
++if exist(options,'box')
++	eval(['box ' getfieldvalue(options,'box')]);
++end
++
++%xlim, ylim and zlim
++if exist(options,'xlim');
++	xlim(getfieldvalue(options,'xlim'));
++end
++if exist(options,'ylim');
++	ylim(getfieldvalue(options,'ylim'));
++end
++if exist(options,'zlim');
++	zlim(getfieldvalue(options,'zlim'));
++end
++
++%latlon
++%Must be done here (before xlim and ylim??) so that it uses the same xlim and ylim as plot_overlay
++%these are changed by axis that follows
++if ~strcmpi(getfieldvalue(options,'latlon','off'),'off')
++	latlonoverlay(md,options);
++end
++
++%Basinzoom
++if exist(options,'basin');
++	basinzoom(options);
++end
++
++%ShowBasins
++if strcmpi(getfieldvalue(options,'showbasins','off'),'on')
++	showbasins(options);
++end
++
++%Caxis
++if exist(options,'caxis'),
++	caxis(getfieldvalue(options,'caxis'));
++end
++
++%shading
++if exist(options,'shading'),
++	shading(getfieldvalue(options,'shading'));
++end
++
++%grid
++if exist(options,'grid'),
++	if strcmpi(getfieldvalue(options,'grid'),'on'),
++		grid on;
++	end
++end
++
++%colormap
++c = getcolormap(options);
++h = colormap(c);
++
++%wrapping
++if exist(options,'wrapping'),
++	if ~exist(options,'colormap'),
++		h=jet;
++	end
++	colormap(repmat(h,getfieldvalue(options,'wrapping',1),1));
++end
++
++%colorbar
++if getfieldvalue(options,'colorbar',1)==1,
++	if exist(options,'colorbarcornerposition'),
++		c=colorbar(getfieldvalue(options,'colorbarcornerposition'),'peer',gca);
++	else 
++		c=colorbar('peer',gca);
++	end
++	set(c,'FontSize',getfieldvalue(options,'colorbarfontsize',fontsize),'YColor',getfieldvalue(options,'FontColor','k'));
++	if exist(options,'wrapping')
++		lim=get(c,'Ylim');
++		lim=[lim(1) lim(1)+(lim(2)-lim(1))/getfieldvalue(options,'wrapping')];
++		set(c,'Ylim',lim);
++	end
++	if exist(options,'colorbarpos'),
++		set(c,'Position',getfieldvalue(options,'colorbarpos'));
++	end
++	if exist(options,'log'),
++		nlab=5;
++		logvalue=getfieldvalue(options,'log');
++
++		scaleminmax=caxis;
++		Min=min(scaleminmax);
++		Max=max(scaleminmax);
++		set(c,'YLim',[Min Max]); % set colorbar limits
++		set(c,'YTick',linspace(Min,Max,nlab));     % set tick mark locations
++
++		labels = cell(1,nlab);
++		tick_vals = linspace(Min,Max,nlab);
++		tick_vals = exp(log(logvalue)*tick_vals);
++		warning off MATLAB:log:logOfZero;
++		for i = 1:nlab
++			labels{i} = sprintf('%-3.4g',round_ice(tick_vals(i),2));
++			%labels{i} = sprintf('%-.4g',round_ice(tick_vals(i),2));
++		end
++		warning on MATLAB:log:logOfZero;
++		set(c,'YTickLabel',labels);
++	end 
++ 	if exist(options,'cbYLim'); 
++		set(c,'YLim',getfieldvalue(options,'cbYLim'));
++	end
++	if exist(options,'colorbartitle'),
++		set(get(c,'title'),'FontSize',getfieldvalue(options,'colorbarfontsize',fontsize),'String',getfieldvalue(options,'colorbartitle'),...
++			'Color',getfieldvalue(options,'FontColor','k'));
++	end
++	if exist(options,'colorbarYLabel'),
++		set(get(c,'Ylabel'),'FontSize',getfieldvalue(options,'colorbarfontsize',fontsize),'String',getfieldvalue(options,'colorbarYLabel'),...
++			'Color',getfieldvalue(options,'FontColor','k'),'Interpreter',getfieldvalue(options,'Interpreter','none'));
++	end
++	if exist(options,'colorbarwidth'),
++		posaxes=get(gca,'Position');
++		alpha=getfieldvalue(options,'colorbarwidth',1);
++		position=get(c,'Position');
++		dx=position(3);
++		newdx=dx*alpha;
++		position(1)=position(1)+(dx-newdx)/2;
++		position(3)=newdx;
++		set(c,'Position',position);
++		set(gca,'Position',posaxes);
++	end
++	if exist(options,'colorbarheight'),
++		posaxes=get(gca,'Position');
++		alpha=getfieldvalue(options,'colorbarheight',1);
++		position=get(c,'Position');
++		dy=position(4);
++		newdy=dy*alpha;
++		position(2)=position(2)+(dy-newdy)/2;
++		position(4)=newdy;
++		set(c,'Position',position);
++		set(gca,'Position',posaxes);
++	end
++	if exist(options,'cbYTickLabel');
++		tick_vals=getfieldvalue(options,'cbYTickLabel');
++		if ~isnumeric(tick_vals) & strcmp(tick_vals,'on')
++			tick_vals=get(c,'YTick')';
++			if exist(options,'log')
++				logval= getfieldvalue(options,'log');
++				for i= 1:size(tick_vals,1)
++					tick_vals(i)= logval^(tick_vals(i));
++				end
++			elseif size(tick_vals,1) == 3
++				tick_vals=[tick_vals(1); mean(tick_vals(1:2)); tick_vals(2); ...
++					mean(tick_vals(2:3)); tick_vals(3)];
++				set(c,'YTick',tick_vals);
++			end
++		end
++		labels = cell(1,size(tick_vals,1));
++		for i = 1:size(tick_vals,1)
++			labels{i} = sprintf('%-3.4g',round_ice(tick_vals(i),2));
++		end
++		set(c,'YTickLabel',labels);
++	end
++
++elseif getfieldvalue(options,'colorbar',1)==0,
++	colorbar('off');
++else
++	%do nothing
++	
++end
++
++
++%area
++if exist(options,'area'),
++	antzoom(getfieldvalue(options,'area'));
++end
++
++%expdisp
++filename=(getfieldvalue(options,'expdisp'));
++style=(getfieldvalue(options,'expstyle'));
++for i=1:length(getfieldvalue(options,'expdisp')),
++	filenamei=filename{i};
++	stylei=style{i};
++	expdisp(filenamei,gcf,stylei,getfieldvalue(options,'linewidth',1),getfieldvalue(options,'unit',1));
++end
++
++%text (default value is empty, not NaN...)
++if exist(options,'text');
++	textstring=getfieldvalue(options,'text');
++	textweight=getfieldvalue(options,'textweight','b');
++	textsize=getfieldvalue(options,'textsize');
++	textcolor=getfieldvalue(options,'textcolor');
++	textposition=getfieldvalue(options,'textposition');
++	textrotation=getfieldvalue(options,'textrotation');
++	for i=1:length(getfieldvalue(options,'text'));
++		textstringi=textstring{i};
++		textweighti=textweight{i};
++		textsizei=textsize{i};
++		textcolori=textcolor{i};
++		textpositioni=textposition{i};
++		textrotationi=textrotation{i};
++		h=text(textpositioni(1),textpositioni(2),10,textstringi,'FontSize',textsizei,'FontWeight',textweighti,'Color',textcolori,'Rotation',textrotationi);
++		set(h,'Clipping','on'); %prevent text from appearing outside of the box
++	end
++end
++
++%north arrow
++if exist(options,'northarrow'),
++	northarrow(getfieldvalue(options,'northarrow'));
++end
++
++%Scale ruler
++if exist(options,'scaleruler'),
++	scaleruler(options);
++end
++
++%streamliness
++if exist(options,'streamlines'),
++	plot_streamlines(md,options);
++end
++
++%contours
++if exist(options,'contourlevels'),
++	plot_contour(md,data,options);
++end
++
++%YTickLabel
++if exist(options,'yticklabel'),
++	set(gca,'YTickLabel',getfieldvalue(options,'YTickLabel'));
++end
++
++%XTickLabel
++if exist(options,'xticklabel'),
++	set(gca,'XTickLabel',getfieldvalue(options,'XTickLabel'));
++end
++
++%xtick
++if exist(options,'xtick'),
++	set(gca,'xtick',getfieldvalue(options,'xtick'));
++end
++
++%ytick
++if exist(options,'ytick'),
++	set(gca,'ytick',getfieldvalue(options,'ytick'));
++end
++
++%Axis positions
++if exist(options,'offsetaxispos'),
++	offset=getfieldvalue(options,'offsetaxispos');
++	P=get(gca,'pos');
++	P(1)=P(1)+offset(1);
++	P(2)=P(2)+offset(2);
++	P(3)=P(3)+offset(3);
++	P(3)=P(4)+offset(4);
++	set(gca,'pos',P);
++end
++if exist(options,'axispos'),
++	Axis=getfieldvalue(options,'axispos');
++	hold on
++	set(gca,'pos',Axis);
++end
++
++
++%position of figure
++if exist(options,'figposition'),
++	
++	figposition=getfieldvalue(options,'figposition');
++	if ischar(figposition),
++		if strcmpi(figposition,'larour'),
++			set(gcf,'Position',[1604 4 1594 1177]);
++		elseif strcmpi(figposition,'larour2'),
++			set(gcf,'Position',[756    62   827   504]);
++		elseif strcmpi(figposition,'mathieu'),
++			set(gcf,'Position',[300 1 1580 1150]);
++		elseif strcmpi(figposition,'fullscreen'),
++			set(gcf,'Position',get(0,'ScreenSize'));
++		elseif strcmpi(figposition,'halfright'),
++			screen=get(0,'ScreenSize');
++			left=screen(1); bott=screen(2); widt=screen(3); heig=screen(4)-25;
++			set(gcf,'Position',fix([left+widt/2 bott widt/2 heig]));
++		elseif strcmpi(figposition,'halfleft'),
++			screen=get(0,'ScreenSize');
++			left=screen(1); bott=screen(2); widt=screen(3); heig=screen(4)-25;
++			set(gcf,'Position',fix([left bott widt/2 heig]));
++		elseif strcmpi(figposition,'square'),
++			screen=get(0,'ScreenSize');
++			left=screen(1); bott=screen(2); widt=min(screen(3)-25,screen(4)-25);
++			set(gcf,'Position',fix([left+(screen(3)-widt) bott widt widt]));
++		elseif strcmpi(figposition,'portrait'),
++			%reformat with letter paper size (8.5" x 11")
++			screen=get(0,'ScreenSize');
++			left=screen(1); bott=screen(2); widt=screen(3); heig=screen(4)-25;
++			portrait=fix([left+widt-(heig*8.5/11) bott heig*8.5/11 heig]);
++			set(gcf,'Position',portrait)
++		elseif strcmpi(figposition,'landscape'),
++			%reformat with letter paper size (8.5" x 11")
++			screen=get(0,'ScreenSize');
++			left=screen(1); bott=screen(2); widt=screen(3); heig=screen(4)-25;
++			landscape=fix([left+widt-(heig*11/8.5) bott heig*11/8.5 heig]);
++			set(gcf,'Position',landscape)
++		else
++			disp('''figposition'' string not supported yet');
++		end
++	else
++		set(gcf,'Position',figposition);
++	end
++
++end
++
++%axes position
++if exist(options,'axesPosition')
++	set(gca,'Position',getfieldvalue(options,'axesPosition'));
++end
++
++%showregion
++if strcmpi(getfieldvalue(options,'showregion','off'),'on'),
++	%Keep pointer of main axis
++	maingca=gca;
++	%get inset relative position (x,y,width,height)
++	insetpos=getfieldvalue(options,'insetpos',[0.02 0.70 0.18 0.18]);
++	%get current plos position
++	cplotpos=get(maingca,'pos');
++	%compute inset position
++	PosInset=[cplotpos(1)+insetpos(1)*cplotpos(3),cplotpos(2)+insetpos(2)*cplotpos(4), insetpos(3)*cplotpos(3), insetpos(4)*cplotpos(4)];
++	axes('pos',PosInset);
++	axis equal off
++	%box off
++	if strcmpi(md.mesh.hemisphere,'n') | strcmpi(md.mesh.hemisphere,'north'),
++		A=expread([ jplsvn() '/projects/Exp/GreenlandBoxFront.exp']);
++		[A.x A.y]=ll2xy(A.x,A.y,+1,45,70);
++		A.x = A.x(1:30:end);
++		A.y = A.y(1:30:end);
++	elseif strcmpi(md.mesh.hemisphere,'s') | strcmpi(md.mesh.hemisphere,'south'),
++		A=expread([ jplsvn() '/projects/Exp/Antarctica.exp']);
++	else
++		error('applyoptions error message: hemisphere not defined');
++	end
++	offset=3*10^4;
++	Ax=[min(A.x)-offset max(A.x)+offset];
++	Ay=[min(A.y)-offset max(A.y)+offset];
++	%if we are zooming on a basin, don't take the mesh for the boundaries!
++	if exist(options,'basin'),
++		[mdx mdy]=basinzoom(options);
++	else
++		mdx=[min(md.mesh.x)-offset max(md.mesh.x)+offset];
++		mdy=[min(md.mesh.y)-offset max(md.mesh.y)+offset];
++	end
++	line(A.x,A.y,ones(size(A.x)),'color','b');
++	patch([Ax(1)  Ax(2)  Ax(2)  Ax(1) Ax(1)],[Ay(1)  Ay(1)  Ay(2)  Ay(2) Ay(1)],[1 1 1],'EdgeColor',[0 0 0],'LineWidth',1,'FaceLighting','none')
++	patch([mdx(1) mdx(2) mdx(2) mdx(1)],[mdy(1) mdy(1) mdy(2) mdy(2)],ones(4,1),'EdgeColor',[0 0 0],'FaceColor','r','FaceAlpha',0.5)
++	colorbar('off');
++	%back to main gca
++	set(gcf,'CurrentAxes',maingca)
++end
++
++%flag edges of a partition
++if exist(options,'partitionedges')
++	[xsegments ysegments]=flagedges(md.mesh.elements,md.mesh.x,md.mesh.y,md.qmu.partition);
++	xsegments=xsegments*getfieldvalue(options,'unit',1);
++	ysegments=ysegments*getfieldvalue(options,'unit',1);
++	color=getfieldvalue(options,'partitionedgescolor','r-');
++	linewidth=getfieldvalue(options,'linewidth',1);
++	hold on;
++	for i=1:length(xsegments),
++		plot(xsegments(i,:),ysegments(i,:),color,'LineWidth',linewidth);
++	end
++end
++
++%Scatter
++if exist(options,'scatter')
++	data=getfieldvalue(options,'scatter');
++	hold on
++	plot_scatter(data(:,1),data(:,2),getfieldvalue(options,'scattersize',3),data(:,3),options);
++end
++
++%backgroundcolor
++set(gca,'color',getfieldvalue(options,'backgroundcolor','none'));
++
++%figurebackgrounbcolor
++set(gcf,'color',getfieldvalue(options,'figurebackgroundcolor','w'));
++
++%lighting
++if strcmpi(getfieldvalue(options,'light','off'),'on'),
++	set(gca,'FaceLighting','gouraud','FaceColor','interp','AmbientStrength',0.5);
++	light('Position',[0 0.1 0.1],'Style','infinite');
++end
++
++%cloud of points: 
++if exist(options,'cloud'),
++	field=getfieldvalue(options,'cloud');
++	x=field(:,1);
++	y=field(:,2);
++	%unit multiplier:
++	if exist(options,'unit'),
++		unit=getfieldvalue(options,'unit');
++		x=x*unit;
++		y=y*unit;
++	end
++	hold on,p=plot(x,y,'k.');
++	markersize=getfieldvalue(options,'markersize',5);
++	color=getfieldvalue(options,'cloudcolor','k');
++	set(p,'Color',color);
++end
++
++%========================%
++%OK VERY LAST STEP: INSET|
++%========================%
++if exist(options,'inset'),
++
++	%Keep pointer of main axis
++	maingca=gca;
++	%get inset relative position (x,y,width,height)
++	insetpos=getfieldvalue(options,'insetpos',[0.56 0.55 0.35 0.35]);
++	%get current plot position
++	cplotpos=get(gca,'pos');
++	%compute inset position
++	PosInset=[cplotpos(1)+insetpos(1)*cplotpos(3),cplotpos(2)+insetpos(2)*cplotpos(4), insetpos(3)*cplotpos(3), insetpos(4)*cplotpos(4)];
++	%show pos
++	X1=getfieldvalue(options,'insetx',xlim);
++	Y1=getfieldvalue(options,'insety',ylim);
++	if strcmpi(getfieldvalue(options,'showinset','off'),'on')
++		line(X1([1 2 2 1 1]),Y1([1 1 2 2 1]),zeros(1,5),'Color','k','LineWidth',2);
++	end
++
++	%Get current figure
++	ax1=gca;
++
++	%plot inset
++	axes('pos',PosInset);
++	copyobj(get(ax1,'children'),gca);
++	patch('Faces',[1 2 3 4 1],'Vertices',[X1([1 2 2 1])' Y1([1 1 2 2])'],'FaceColor','None','EdgeColor','k','LineWidth',2);
++
++	%applay options
++	options=removefield(options,'text',0);
++	options=removefield(options,'title',0);
++	options=removefield(options,'xlabel',0);
++	options=removefield(options,'ylabel',0);
++	options=removefield(options,'inset',0);
++	options=removefield(options,'offsetaxispos',0);
++	options=removefield(options,'showregion',0);
++	options=changefieldvalue(options,'colorbar',0);
++	options=changefieldvalue(options,'latlon','off');
++	options=changefieldvalue(options,'axis','equal off');
++	options=changefieldvalue(options,'xlim',getfieldvalue(options,'insetx',xlim));
++	options=changefieldvalue(options,'ylim',getfieldvalue(options,'insety',ylim));
++	applyoptions(md,data,options);
++
++	%back to main gca
++	set(gcf,'CurrentAxes',maingca)
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_highlightelements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_highlightelements.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_highlightelements.m	(revision 13009)
+@@ -0,0 +1,51 @@
++function plot_highlightelements(md,options,width,i);
++%PLOT_HIGHLIGHTELEMENTS - plot selected elements
++%
++%   Usage:
++%      plot_highlightelements(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%plot mesh boundaries
++subplot(width,width,i); 
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[elementnumbers datatype]=processdata(md,[1:md.mesh.numberofelements]',options);
++
++%plot
++if is2d
++	%plot mesh 
++	A=elements(:,1); B=elements(:,2); C=elements(:,3);
++	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++
++	%Highlight
++	pos=getfieldvalue(options,'highlight',[]);
++	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
++	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
++else
++	%plot mesh 
++	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++	patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
++
++	%Highlight
++	pos=getfieldvalue(options,'highlight',[]);
++	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],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
++end
++
++%apply options
++if ~exist(options,'highlight')
++	disp('highlightelements warning : highlight option empty, not element highlighted');
++end
++options=addfielddefault(options,'title','Highlighted Elements');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_thermaltransient_results.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_thermaltransient_results.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_thermaltransient_results.m	(revision 13009)
+@@ -0,0 +1,24 @@
++function plot_thermaltransient_results(md,options,width,i)
++%PLOT_THERMALTRANSIENT_RESULTS - plot  results of a thermal transient solution
++%
++%   Usage:
++%      plot_thermaltransient_results(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++string='plot(md';
++for i=1:length(md.thermaltransient_results),
++	string=[string ',''data'',''thermaltransient_results(' num2str(i) ').temperature'',''view'',3,''title'',''Temperature at time ' num2str(md.thermaltransient_results(i).time) ' a'''];
++end
++string=[string ',''figure'',1,''colorbar#all'',''on'',''view'',3,''fontsize'',' num2str(options.fontsize) ',''fontweight'',' options.fontweight ');'];
++eval(string);
++clear string;
++
++string='plot(md';
++for i=2:length(md.thermaltransient_results),
++	string=[string ',''data'',md.thermaltransient_results(' num2str(i) ').temperature-md.thermaltransient_results(' num2str(i-1) ').temperature,''view'',3,''title'',''Delta temperature at time ' num2str(md.thermaltransient_results(i).time) ' a'''];
++end
++string=[string ',''figure'',2,''colorbar#all'',''on'',''fontsize'',' num2str(options.fontsize) ',''fontweight'',' options.fontweight ');'];
++eval(string);
++clear string;
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plotdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plotdoc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plotdoc.m	(revision 13009)
+@@ -0,0 +1,174 @@
++function plotdoc()
++%PLOTDOC - plot documentation
++%
++%   Usage:
++%      plotdoc()
++
++disp(' ');
++disp('   Plot usage: plotm(model,varargin)');
++disp('   Options: ');
++disp('       ''figure'': figure number');
++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_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).');
++disp('                  - ''BC'': this will draw all the boundary conditions (Dirichlet and Neumann).');
++disp('                  - ''deviatoricstress_tensor'': plot the components of the deviatoric stress tensor (tauxx,tauyy,tauzz,tauxy,tauxz,tauyz) if computed');
++disp('                  - ''deviatoricstress_principal'': plot the deviatoricstress tensor principal axis and principal values');
++disp('                  - ''deviatoricstress_principalaxis1'': arrow plot the first principal axis of the deviatoricstress tensor(replace 1 by 2 or 3 if needed)');
++disp('                  - ''driving_stress'': plot the driving stress (in kPa)');
++disp('                  - ''elements_type'': model used for each element');
++disp('                  - ''elementnumbering'': numbering of elements');
++disp('                  - ''vertexnumbering'': numbering of vertices');
++disp('                  - ''highlightelements'': to highlight elements to highlight the element list');
++disp('                  - ''highlightvertices'': to highlight vertices (use highlight option to enter the vertex list');
++disp('                  - ''mesh'': draw mesh using trisurf');
++disp('                  - ''referential'': diagnostic referential');
++disp('                  - ''riftvel'': velocities along rifts');
++disp('                  - ''riftrelvel'': relative velocities along rifts');
++disp('                  - ''riftpenetration'': penetration levels for a fault');
++disp('                  - ''riftfraction'': fill fractions for every node of the rifts');
++disp('                  - ''rifts'': plot mesh with an offset so that rifts are visible');
++disp('                  - ''strainrate_tensor'': plot the components of the strainrate tensor (exx,eyy,ezz,exy,exz,eyz) if computed');
++disp('                  - ''strainrate_principal'': plot the strainrate tensor principal axis and principal values)');
++disp('                  - ''strainrate_principalaxis1'': arrow plot the first principal axis of the strainrate tensor(replace 1 by 2 or 3 if needed)');
++disp('                  - ''stress_tensor'': plot the components of stress tensor (sxx,syy,szz,sxy,sxz,syz) if computed');
++disp('                  - ''stress_principal'': plot the stress tensor principal axis and principal values');
++disp('                  - ''stress_principalaxis1'': arrow plot the first principal axis of the stress tensor(replace 1 by 2 or 3 if needed)');
++disp('                  - ''transient_results'': this will display all the time steps of a transient run (use steps to specify the steps requested)');
++disp('                  - ''transient_vel'': this will display the velocity for the time steps requested in ''steps'' of a transient run');
++disp('                  - ''transient_vel'': vel can be by any field of the transient results (vx, vy, vz, vel, temperature, melting, pressure, bed, thickness, surface)');
++disp('                  - ''transient_field'': dynamic plot of results. specify ''steps'' option, as fell as ''field'' (defaults are all steps, for ''Vel'' field)');
++disp('                  - ''transient_movie'': this will display the time steps of a given field of a transient run');
++disp('                  - ''transient_movie_field'': field to be displayed when doing  transient_movie data display');
++disp('                  - ''transient_movie_output'': filename if output is desired for movie');
++disp('                  - ''transient_movie_time'': time for each image (default 2 seconds)');
++disp('                  - ''thermaltransient_results'': this will display all the time steps of a thermal transient run');
++disp('                  - ''qmuhistnorm'': histogram normal distribution. needs option qmudata');
++disp('                  - ''qmumean'': plot of mean distribution in sampling analysis with scaled response. needs option qmudata for descriptor');
++disp('                  - ''qmustddev'': plot of stddev distribution in sampling analysis with scaled response. needs option qmudata for descriptor');
++disp('                  - ''part_hist'': partitioning node and area histogram');
++disp('                  - ''quiver'': quiver plot');
++
++disp('       ''alloptions'': apply the options to all subplots if ''on''');
++disp('       ''axis'': same as standard matlab option (''equal'',''off'',''equal on'',...)');
++disp('       ''basin'': zoom on a given basin (''pineislandglacier'',''ronneiceshelf'', use isbasin to identify a basin');
++disp('                 ''hemisphere'': specify +1 or -1');
++disp('                 ''basindeltax'': in m');
++disp('                 ''showbasins'': write lables for every existing basin name around the center of the plot');
++disp('       ''caxis'': modify  colorbar range. (array of type [a b] where b>=a)');
++disp('       ''backgroundcolor'': plot background color. (default is ''w'')');
++disp('       ''figurebackgroundcolor'': figure background color. (default is ''none'')');
++disp('       ''coord'':  ''xy'' (default) or ''latlon''');
++disp('       ''colorlevels'':  N or {value1,valu2,value3,...} used if quiver, use different colors for the given number of colors or limits');
++disp('       ''colorbar'': add colorbar (string ''on'' or ''off'')');
++disp('       ''colorbartitle'': colorbar title (string)');
++disp('       ''colorbarYlabel'': colorbar Y label (string)');
++disp('       ''colorbarpos'': [x,y,dx,dy] where x,y,dx and dy are within [0 1]');
++disp('       ''colorbarcornerposition'': ''West'',''North'',etc ...');
++disp('       ''colorbartitlerotation'': -90, etc ...');
++disp('       ''colorbarfontsize'': specify colorbar fontsize');
++disp('       ''colorbarwidth'': multiplier (default 1) to the default width colorbar');
++disp('       ''colorbarheight'': multiplier (default 1) to the default height colorbar');
++disp('       ''colormap'': same as standard matlab option (''jet'',''hsv'',''cool'',''spring'',''gray'',''Ala'',''Rignot'',...)');
++disp('       ''contourlevels'': N or {value1,valu2,value3,...} add the contours of the specified values or N contours');
++disp('       ''contourticks'': ''on'' or ''off'' to display the ticks of the contours');
++disp('       ''contouronly'': ''on'' or ''off'' to display the contours on a white background');
++disp('       ''contourcolor'': ticks and contour color');
++disp('       ''density'': density of quivers (one arrow every N nodes, N integer)');
++disp('       ''inset'': add an inset (zoom) of the current figure if 1 (use ''insetx'', ''insety'' and ''insetpos'' to determine the inset position and content)');
++disp('       ''insetx'': [min(x) max(x)] where min(x) and max(x) are values determining the inset content');
++disp('       ''insety'': [min(y) max(y)] where min(y) and max(y) are values determining the inset content');
++disp('       ''insetpos'': [x,y,dx,dy] where x,y,dx and dy are within [0 1]');
++disp('       ''streamlines'': N (number of stream lines) or {[x1 y1],...} (coordinates of seed points) add streanlines on current figure');
++disp('       ''edgecolor'': same as standard matlab option EdgeColor (color name: ''black'' or RGB array: [0.5 0.2 0.8])');
++disp('       ''fontsize'': same as standard matlab option (10,14,...)');
++disp('       ''fontweight'': same as standard matlab option (normal: ''n'',bold: ''b'',light: ''l'',demi: ''d'')');
++disp('       ''fontcolor'': same as standard matlab option');
++disp('       ''highlight'': highlights certain nodes or elements when using ''nodenumbering'' or ''elementnumbering'' or ''highlightnodes '' or ''highlightelements'' option');
++disp('       ''resolution'': resolution used by section value (array of type [horizontal_resolution vertical_resolution])');
++disp('                       horizontal_resolution must be in meter, and vertical_resolution a number of layers');
++disp('       ''showsection'': show section used by ''sectionvalue'' (string ''on'' or a number of labels)');
++disp('       ''sectionvalue'': give the value of data on a profile given by an Argus file (string ''Argusfile_name.exp'')');
++disp('       ''profile'': give the value of data along a vertical profile ([xlocation ylocation])');
++disp('       ''smooth'': smooth element data (string ''yes'' or integer)');
++disp('       ''title'': same as standard matlab option');
++disp('       ''view'': same as standard matlab option (ex: 2, 3 or [90 180]');
++disp('       ''xlim'': same as standard matlab option (ex: [0 500])');
++disp('       ''ylim'': same as standard matlab option');
++disp('       ''zlim'': same as standard matlab option');
++disp('       ''xlabel'': same as standard matlab option (ex:''km'')');
++disp('       ''ylabel'': same as standard matlab option');
++disp('       ''xticklabel'': specifiy xticklabel');
++disp('       ''yticklabel'': specifiy yticklabel');
++disp('       ''overlay'': yes or no. This will overlay a radar amplitude image behind');
++disp('       ''overlay_image'': path to overlay image. provide overlay_xlim, overlay_ylim, overlay_xposting and overlay_yposting options also');
++disp('       ''contrast'': (default 1) coefficient to add contrast to the radar amplitude image used in overlays');
++disp('       ''highres'': resolution of overlayed radar amplitude image (default is 0, high resolution is 1).');
++disp('       ''hem'': specify hemisphere ''n'' or ''s'' (default is ''s'').');
++disp('       ''alpha'': transparency coefficient (the higher, the more transparent). Default is 1.5');
++disp('       ''scaling'': scaling factor used by quiver plots. Default is 0.4');
++disp('       ''autoscale'': set to ''off'' to have all the quivers with the same size. Default is ''on''');
++disp('       ''expdisp'': plot exp file on top of a data plot. provide exp file as an argument (use a cell of strings if more than one)');
++disp('       ''expstyle'': marker style for expdisp plot (use a cell of strings if more than one)');
++disp('       ''linewidth'': line width for expdisp plot');
++disp('       ''border'': size of display border (in pixels). active only for overlay plots');
++disp('       ''text'': print string, use a cell of strings if more than one');
++disp('       ''textposition'': [x y] position of text, use a cell of strings if more than one');
++disp('       ''textsize'':  same as standard ''FontSize'' matlab option applied to text, use a cell of strings if more than one');
++disp('       ''textweight'':  same as standard ''FontWeight'' matlab option applied to text, use a cell of strings if more than one');
++disp('       ''textcolor'':  same as standard ''color'' matlab option applied to text, use a cell of strings if more than one');
++disp('       ''textrotation'':  same as standard ''Rotation'' matlab option applied to text, use a cell of strings if more than one');
++disp('       ''mask'': list of flags of size numberofnodes or numberofelements. Only ''true'' values are plotted ');
++disp('       ''nan'': value assigned to NaNs (convenient when plotting BC)');
++disp('       ''partitionedges'': ''off'' by default. overlay plot of partition edges');
++disp('       ''log'': value of log');
++disp('       ''latlon'': ''on'' or {latstep lonstep [resolution [color]]} where latstep,longstep and resolution are in degrees, color is a [r g b] array');
++disp('       ''latlonnumbering'': ''on'' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers,'); 
++disp('       ''latlonclick'': ''on'' to click on latlon ticks positions');
++disp('                   colornumber is a [r g b] array and latangle and lonangle are angles to flip the numbers');
++disp('       ''northarrow'': add an arrow pointing north, ''on'' for default value or [x0 y0 length [ratio width fontsize]] where (x0,y0) are the coordinates of the base, ratio=headlength/length');
++disp('       ''offset'': mesh offset used by ''rifts'', default is 500');
++disp('       ''scaleruler'': add a scale ruler, ''on'' for default value or [x0 y0 length width numberofticks] where (x0,y0) are the coordinates of the lower left corner');
++disp('       ''showregion'': show domain in Antarctica on an inset, use ''insetpos'' properties');
++disp('       ''visible'': ''off'' to make figure unvisible, default is ''on''');
++disp('       ''wrapping'': repeat ''n'' times the colormap (''n'' must be an integer)');
++disp('       ''unit'': by default, in m, otherwise, ''km'' is available');
++disp('       ''legend_position'': by default, ''NorthEasth''');
++disp('       ''qmudata'': data for qmu  plots.');
++disp('                  {dresp1   ,dresp2  ,hmin,hmax,hnint} or {samp,desc,mu,sigma,hmin,hmax,hnint}');
++disp('                  where dresp1 is a structure array of responses (where we need samp and desc), ');
++disp('                  dresp2 is a structure array of responses (where we only need mu and sigma)');
++disp('                  hmin,hmax and hnint are the minimum, maximum and number of intervals of the histogram (optional)');
++disp('       ''figposition'': position of figure: ''fullscreen'', ''halfright'', ''halfleft'', ''portrait'', ''landscape'',... (hardcoded in applyoptions.m)');
++disp('       ''offsetaxispos'': offset of current axis position to get more space (ex: [-0.02 0  0.04 0])');
++disp('       ''axispos'': axis position to get more space');
++disp('       ''hmin'': (numeric, minimum for histogram)');
++disp('       ''hmax'': (numeric, maximum for histogram)');
++disp('       ''hnint'': (numeric, number of intervals for histogram)');
++disp('       ''ymin1'': (numeric, minimum of histogram y-axis)');
++disp('       ''ymax1'': (numeric, maximum of histogram y-axis)');
++disp('       ''ymin2'': (numeric, minimum of cdf y-axis)');
++disp('       ''ymax2'': (numeric, maximum of cdf y-axis)');
++disp('       ''cdfplt'': (char, ''off'' to turn off cdf line plots)');
++disp('       ''cdfleg'': (char, ''off'' to turn off cdf legends)');
++disp('       ''segmentnumbering'': (''off'' by default)');
++disp('       ''kmlgroundoverlay'': (''off'' by default)');
++disp('       ''kmlfilename'': (''tempfile.kml'' by default)');
++disp('       ''kmlroot'': (''./'' by default)');
++disp('       ''kmlimagename'': (''tempimage'' by default)');
++disp('       ''kmlimagetype'': (''png'' by default)');
++disp('       ''kmlresolution'': (1 by default)');
++disp('       ''kmlfolder'': (''Ground Overlay'' by default)');
++disp('       ''kmlfolderdescription'': ('''' by default)');
++disp('       ''kmlgroundoverlayname'': ('''' by default)');
++disp('       ''kmlgroundoverlaydescription'': ('''' by default)');
++
++disp('       any options (except ''data'') can be followed by ''#i'' where ''i'' is the subplot number, or ''#all'' if applied to all plots');
++disp('  ');
++disp('   Examples:');
++disp('       plotmodel(md,''data'',''vel'',''data'',''mesh'',''view#2'',3,''colorbar#all'',''on'',''axis#1'',''off equal'')');
++disp('       plotmodel(md,''data'',''highlightelements'',''highlight'',[1 4 10],''expdisp'',{''domain1.exp'' ''domain2.exp'' ''domain3.exp''})');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/haxby.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/haxby.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/haxby.m	(revision 13009)
+@@ -0,0 +1,36 @@
++function map = haxby(m);
++%HAXBY - Haxby color map
++%   HAXBY(M) returns an M-by-3 matrix containing a colormap with Haxby's
++%   colors, commonly used for displaying bathymetry data.
++%   HAXBY, by itself, is the same length as the current colormap.
++%
++%   Colormap is based on the colors used by W. F. Haxby's Gravity
++%   field of World's oceans, 1985, developed for geoid and gravity maps.
++%   The version used here is formed from a linear interpolation of
++%   the GMT color table used by MB-System by David W. Caress and Dale N. Chayes.
++%   <http://www.ldeo.columbia.edu/res/pi/MB-System>
++
++if nargin < 1, m = size(get(gcf,'colormap'),1); end
++
++ncolors=11;
++c=[...
++	37     57   175
++	40    127   251
++	50    190   255
++	106   235   255
++	138   236   174
++	205   255   162
++	240   236   121
++	255   189    87
++	255   161    68
++	255   186   133
++	255   255   255];
++
++pp=1:(m-1)/(ncolors-1):m;
++r=interp1(pp,c(:,1),1:m);
++g=interp1(pp,c(:,2),1:m);
++b=interp1(pp,c(:,3),1:m);
++map=[r' g' b']/255;
++
++%Fix bug of interp1 (M. Morlighem)
++map(find(map>1))=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/lbmap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/lbmap.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/lbmap.m	(revision 13009)
+@@ -0,0 +1,109 @@
++function map = lbmap(n,scheme)
++%LBMAP Returns specified Light-Bertlein colormap.
++%
++%   LBMAP(N,SCHEME) returns an Nx3 colormap. SCHEME can be one of the
++%   following strings:
++%
++%       'Blue'       Single-hue progression to purlish-blue (default)
++%       'BlueGray'   Diverging progression from blue to gray
++%       'BrownBlue'  Orange-white-purple diverging scheme
++%       'RedBlue'    Modified spectral scheme
++%
++%   If N is not specified, the size of the colormap is determined by the
++%   current figure. If no figure exists, MATLAB creates one.
++%
++%Example 1: 7-color single-hue blue (default)
++%   load penny
++%   imagesc(P)
++%   colormap(lbmap(7))
++%   colorbar
++%
++%Example 2: 11-color modified spectrum
++%   load penny
++%   imagesc(P)
++%   colormap(lbmap(11,'RedBlue'))
++%   colorbar
++%
++%   See also HSV, GRAY, HOT, BONE, COPPER, PINK, FLAG, COLORMAP, RGBPLOT.
++
++% Reference:
++% A. Light & P.J. Bartlein, "The End of the Rainbow? Color Schemes for
++% Improved Data Graphics," Eos,Vol. 85, No. 40, 5 October 2004.
++% http://geography.uoregon.edu/datagraphics/EOS/Light&Bartlein_EOS2004.pdf
++
++% Copyright 2007-2010 The MathWorks, Inc.
++
++%defensive programming
++error(nargchk(0,2,nargin))
++error(nargoutchk(0,1,nargout))
++
++%defaults
++if nargin<2
++	scheme = 'Blue';
++end
++if nargin<1
++	n = size(get(gcf,'colormap'),1);
++end
++
++%valid schemes
++switch lower(scheme)
++	case 'blue'
++		baseMap = BlueMap;
++	case 'bluegray'
++		baseMap = BlueGrayMap;
++	case 'brownblue'
++		baseMap = BrownBlueMap;
++	case 'redblue'
++		baseMap = RedBlueMap;
++	otherwise
++		error(['Invalid scheme ' scheme])
++	end
++	idx1 = linspace(0,1,size(baseMap,1));
++	idx2 = linspace(0,1,n);
++	map = interp1(idx1,baseMap,idx2);
++
++function baseMap = BlueMap
++	baseMap = [243 246 248;
++	224 232 240;
++	171 209 236;
++	115 180 224;
++	35 157 213;
++	0 142 205;
++	0 122 192]/255;
++
++function baseMap = BlueGrayMap
++	%DivergingBlueGray
++	baseMap = [  0 170 227;
++	53 196 238;
++	133 212 234;
++	190 230 242;
++	217 224 230;
++	146 161 170;
++	109 122 129;
++	65  79  81]/255;
++
++function baseMap = BrownBlueMap
++	baseMap = [144 100  44;
++	187 120  54;
++	225 146  65;
++	248 184 139;
++	244 218 200;
++	241 244 245;
++	207 226 240;
++	160 190 225;
++	109 153 206;
++	70  99 174;
++	24  79 162]/255;
++
++function baseMap = RedBlueMap
++	baseMap = [175  53  71;
++	216  82  88;
++	239 133 122;
++	245 177 139;
++	249 216 168;
++	242 238 197;
++	216 236 241;
++	154 217 238;
++	68 199 239;
++	0 170 226;
++	0 116 188]/255;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/getcolormap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/getcolormap.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/getcolormap.m	(revision 13009)
+@@ -0,0 +1,55 @@
++function map = getcolormap(options)
++%GETCOLORMAP - get colormap from options
++%
++%   Usage:
++%      map = getcolormap(options)
++
++%default is jet
++if ~exist(options,'colormap'),
++	map = jet;
++	return
++end
++
++map = getfieldvalue(options,'colormap');
++if isnumeric(map);
++	%user provided a full colormap
++	return;
++end
++
++%OK this is an in-house colormap
++if ~ischar(map), error('colormap format not supported'); end
++
++if strcmpi(map,'Ala'),
++	map = jet(256);
++	map = map(128:end,:);
++elseif strcmpi(map,'redblue'),
++	map = hsv(256);
++	map = rgb2hsv(map);
++	map(:,2)       = max(min( abs(map(:,1)-0.5)/0.5 ,1),0);
++	map(1:128,1)   = 0.7;
++	map(129:end,1) = 1;
++	map = hsv2rgb(map);
++elseif strcmpi(map,'Rignot'),
++	alpha=getfieldvalue(options,'alpha',1);
++	map = hsv(256);
++	map = rgb2hsv(map);
++	map(:,2) = max(min( (0.1+map(:,1)).^(1/alpha) ,1),0);
++	map = hsv2rgb(map);
++elseif strcmpi(map,'Rignot2'),
++	alpha=getfieldvalue(options,'alpha',1);
++	map = hsv(256);
++	map = rgb2hsv(map);
++	map(:,2) = max(min( (0.1+map(:,1)).^(1/alpha) ,1),0);
++	map = hsv2rgb(map);
++	map=flipud(map);
++elseif strcmpi(map,'Seroussi'),
++	alpha=getfieldvalue(options,'alpha',1);
++	map = hsv(256);
++	map = flipud(map);
++	map = map(1:floor(0.7*size(map,1)),:);
++	map = rgb2hsv(map);
++	map(:,2) = max(min( (0.1+map(:,1)).^(1/alpha) ,1),0);
++	map = hsv2rgb(map);
++else
++	eval(['map = ' map ';']);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processdata.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processdata.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processdata.m	(revision 13009)
+@@ -0,0 +1,203 @@
++function [data datatype]=processdata(md,data,options);
++%PROCESSDATA - process data to be plotted
++%
++%   datatype = 1 -> elements
++%   datatype = 2 -> nodes
++%   datatype = 3 -> node quivers
++%   datatype = 4 -> patch
++%
++%   Usage:
++%      [data datatype]=processdata(md,data,options);
++%
++%   See also: PLOTMODEL, PROCESSMESH
++
++%check format
++if (iscell(data) | isempty(data) | length(data)==0 | (length(data)==1 & ~isstruct(data) & isnan(data))),
++	error('plotmodel error message: data provided is empty');
++end
++
++%needed later on
++if isfield(md.mesh,'numberofvertices2d'), 
++	numberofvertices2d=md.mesh.numberofvertices2d; 
++	numberofelements2d=md.mesh.numberofelements2d; 
++else 
++	numberofvertices2d=NaN;
++	numberofelements2d=NaN;
++end
++
++%Process Patch
++if isstruct(data) 
++	if (isfield(data,'index') & isfield(data,'value')),
++		if data.interpolation(1)==P1Enum(),
++			data=data.value;
++			data=data';
++			data=data(:);
++			datatype=4;
++		elseif data.interpolation(1)==P0Enum(),
++			data=data.value;
++			datatype=5;
++		else
++			error(['interpolation ' data.interpolation(1) ' not supported yet']);
++		end
++	else
++		error('structure other than Patch not supported yet');
++	end
++else
++	%initialize datatype
++	datatype=0;
++end
++
++%get datatype
++datasize=size(data);
++
++%Process NaN if any (do not now before mask is applied)
++if exist(options,'nan')
++	data(find(isnan(data)))=getfieldvalue(options,'nan',0);
++end
++%non patch processing
++if datatype~=4 & datatype~=5,
++
++	%transpose data if necessary
++	if (size(data,2) > size(data,1)),
++		data=data';
++	end
++	datasize=size(data);
++
++	%convert to double if necessary
++	if ~isnumeric(data);
++		disp('processdata info message: data is not numeric (logical?). Converted to double');
++		data=double(data);
++	end
++
++	%check length
++	
++	if datasize(1)~=md.mesh.numberofvertices & datasize(1)~=md.mesh.numberofelements & datasize(1)~=md.mesh.numberofvertices*6 & (md.mesh.dimension==3 & ~(datasize(1)==numberofelements2d | datasize(1)==numberofvertices2d))
++		error('plotmodel error message: data not supported yet');
++	end
++	
++	%quiver?
++	if datasize(2)>1,
++		datatype=3;
++
++		%check number of columns, add zeros if necessary,
++		if (md.mesh.dimension==3)
++			if datasize(2)==2,
++				data=[data, zeros(datasize(1),1)];
++			elseif datasize(2)~=3,
++				error('plotmodel error message: data provided should have 2 or 3 columns for quiver plot, and 1 for regular plot');
++			end
++		%elseif ((md.mesh.dimension==2) & datasize(2)~=2),
++		%	error('plotmodel error message: data provided should have 2 columns for quiver plot, and 1 for regular plot');
++		end
++	end
++
++	%treat the case datasize(1)=6*nodes
++	if datasize(1)==6*md.mesh.numberofvertices
++		%keep the only norm of data
++		data1=data(1:6:md.mesh.numberofvertices*6,:);
++		data2=data(2:6:md.mesh.numberofvertices*6,:);
++		data=sqrt(data1.^2+data2.^2);
++		datasize(1)=md.mesh.numberofvertices;
++		%---> go to node data
++	end
++
++	%treat the case datasize(1)=nodes2d
++	if (md.mesh.dimension==3 & datasize(1)==numberofvertices2d),
++		data=project3d(md,'vector',data,'type','node');
++		datasize(1)=md.mesh.numberofvertices;
++		%---> go to node data
++	end
++
++	%treat the case datasize(1)=nodes2d
++	if (md.mesh.dimension==3 & datasize(1)==numberofelements2d),
++		data=project3d(md,'vector',data,'type','element');
++		datasize(1)=md.mesh.numberofelements;
++		%---> go to node data
++	end
++
++	%smoothing?
++	if exist(options,'smooth')
++		data=averaging(md,data,getfieldvalue(options,'smooth'));
++		datasize(1)=md.mesh.numberofvertices;
++		%---> go to node data
++	end
++end
++
++%element data
++if (datasize(1)==md.mesh.numberofelements & datasize(2)==1),
++
++	%Initialize datatype if non patch
++	if datatype~=4 & datatype~=5,
++		datatype=1;
++	end
++
++	%Mask?
++	if exist(options,'mask'),
++		flags=getfieldvalue(options,'mask');
++		pos=find(~flags);
++		if length(flags)==md.mesh.numberofvertices,
++			[pos2 dummy]=find(ismember(md.mesh.elements,pos));
++			data(pos2,:)=NaN;
++		elseif length(flags)==md.mesh.numberofelements
++			data(pos,:)=NaN;
++		else
++			disp('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements');
++		end
++	end
++
++	%log?
++	if exist(options,'log'),
++		bounds=getfieldvalue(options,'caxis',[min(data(:)) max(data(:))]);
++		data(find(data<bounds(1)))=bounds(1);
++		if any(data<=0),
++			error('Log option cannot be applied on negative values. Use caxis option (Rignot''s settings: [1.5 max(data)])');
++		end
++		pos=find(~isnan(data));
++		data(pos)=log(data(pos))/log(getfieldvalue(options,'log'));
++	end
++end
++
++%node data
++if (datasize(1)==md.mesh.numberofvertices & datasize(2)==1),
++	datatype=2;
++
++	%Mask?
++	if exist(options,'mask'),
++		flags=getfieldvalue(options,'mask');
++		pos=find(~flags);
++		if length(flags)==md.mesh.numberofvertices,
++			data(pos,:)=NaN;
++		elseif length(flags)==md.mesh.numberofelements
++			data(md.mesh.elements(pos,:),:)=NaN;
++		else
++			disp('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements');
++		end
++	end
++
++	%log?
++	if exist(options,'log'),
++		%if any(data<=0),
++		%	error('Log option cannot be applied on negative values. Use caxis option (Rignot''s settings: [1.5 max(data)])');
++		%end
++		data=log(data)/log(getfieldvalue(options,'log'));
++	end
++end
++
++%layer projection? 
++if getfieldvalue(options,'layer',0)>=1,
++	data=project2d(md,data,getfieldvalue(options,'layer')); %project onto 2d mesh
++end
++
++%control arrow density if quiverplot
++if datatype==3 & exist(options,'density')
++	databak=data;
++	data=NaN*ones(datasize);
++	density=getfieldvalue(options,'density');
++	data(1:density:end,:)=databak(1:density:end,:);
++	clear databak
++end
++
++%OK, if datatype=0 error out
++if datatype==0,
++	error(['data provided not recognized or not supported']);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor.m	(revision 13009)
+@@ -0,0 +1,40 @@
++function plot_tensor(md,options,width,i,type);
++%PLOT_TENSOR - plot tensor components
++%
++%   Usage:
++%      plot_tensor(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++h=subplot(width,width,i); axis off; pos=get(h,'Position');
++
++plot_options.offsetx=pos(1);
++plot_options.offsety=pos(2);
++plot_options.width=pos(3);
++plot_options.height=pos(4);
++
++%Figure out tensor type:
++%FIXME does not work anymore
++if strncmpi(type,'strain',6),
++	tensor=md.results.strainrate;
++elseif strncmpi(type,'stress',6),
++	tensor=md.results.stress;
++elseif strncmpi(type,'deviatoricstress',16),
++	tensor=md.results.deviatoricstress;
++else
++	error('plot_tensor error message: unsupported type of tensor');
++end
++
++%Figure out type of plot being requested
++if strncmpi(fliplr(type),fliplr('tensor'),6) | strcmpi(type,'strainrate') | strcmpi(type,'deviatoricstress') | strcmpi(type,'stress'),
++	plot_tensor_components(md,options,width,i,tensor,type,plot_options);
++	return;
++elseif strncmpi(fliplr(type),fliplr('principal'),9),
++	plot_tensor_principal(md,options,width,i,tensor,type,plot_options);
++	return;
++elseif strncmpi(fliplr(type(1:end-1)),fliplr('principalaxis'),13),
++	plot_tensor_principalaxis(md,options,width,i,tensor,type,plot_options);
++	return;
++else
++	error('plot_tensor error message: unsurported type of plot');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftnumbering.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftnumbering.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_riftnumbering.m	(revision 13009)
+@@ -0,0 +1,94 @@
++function plot_riftnumbering(md,options,nlines,ncols,index);
++%PLOT_RIFTNUMBERING - plot rift penetration + numbering of all rift vertices, as well as rift numbers.
++%
++%   Usage:
++%      plot_riftnumbering(md,options,width,i);
++%
++%   See also: PLOTMODEL
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++fontsize=getfieldvalue(options,'FontSize',8);
++
++subplot(nlines,ncols,index); 
++hold on
++
++%plot mesh boundaries
++for i=1:size(md.mesh.segments,1),
++	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');
++end
++
++isp1=0;
++isp2=0;
++
++if isstruct(md.rifts.riftstruct),
++	%plot mesh boundaries
++	for i=1:size(md.mesh.segments,1),
++		h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
++	end
++	for i=1:size(md.rifts.riftstruct,1),
++		penaltypairs=md.rifts.riftstruct(i).penaltypairs;
++
++		segments=md.rifts.riftstruct(i).segments;
++		for j=1:size(segments,1),
++			plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
++		end
++
++		normal=zeros(2,1);
++		for j=1:size(penaltypairs,1),
++			normal(1)=penaltypairs(j,5);
++			normal(2)=penaltypairs(j,6);
++
++			vx1=md.initialization.vx(penaltypairs(j,1)); 
++			vx2=md.initialization.vx(penaltypairs(j,2));
++			vy1=md.initialization.vy(penaltypairs(j,1)); 
++			vy2=md.initialization.vy(penaltypairs(j,2));
++			penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
++			%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
++			if(penetration>0),
++				p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'ro-','LineWidth',1);
++				set(p2,'MarkerSize',3);
++				isp2=1;
++			else
++				p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'ko-','LineWidth',1);
++				set(p1,'MarkerSize',3);
++				isp1=1;
++			end
++		end
++
++		%point out the tips
++		h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g*');
++		plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g*');
++	end
++	if strcmpi(getfieldvalue(options,'legend','on'),'on'),
++		if isp1 & isp2
++			l=legend([h1,h2,p1,p2],'mesh boundaries','crack tips','faults','rifts');
++		elseif isp1
++			l=legend([h1,h2,p1],'mesh boundaries','crack tips','faults');
++		elseif isp2
++			l=legend([h1,h2,p2],'mesh boundaries','crack tips','rifts');
++		else
++			l=legend([h1,h2],'mesh boundaries','crack tips');
++		end
++		set(l,'Location',getfieldvalue(options,'legend_location','NorthEast'));
++	end
++else
++	error('plot error message: no rifts available!');
++end
++
++%Now, plot rift vertices numbers.
++for i=1:size(md.rifts.riftstruct,1),
++	penaltypairs=md.rifts.riftstruct(i).penaltypairs;
++
++	for j=1:size(penaltypairs,1),
++		node=penaltypairs(j,1);
++		t=text(x(node),y(node),[num2str(i) '.' num2str(j)]);
++		set(t,'FontSize',fontsize);
++	end
++end
++
++
++%apply options
++options=addfielddefault(options,'title','Rift/Fault location');
++options=addfielddefault(options,'colorbar',0);
++applyoptions(md,[],options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_quiver.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_quiver.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_quiver.m	(revision 13009)
+@@ -0,0 +1,26 @@
++function plot_quiver(x,y,u,v,options),
++%PLOT_QUIVER - quiver plot with colors
++%
++%   to be perfected tomorrow
++%
++%   Usage:
++%      plot_quiver(x,y,u,v,options)
++%
++%   Example:
++%      plot_quiver(md.mesh.x,md.mesh.y,md.initialization.vx,md.initialization.vy,options);
++
++%process fields
++[quivers,palette]=quiver_process(x,y,u,v,options);
++
++%loop over the number of colors
++hold on
++h=[];
++for i=1:quivers.numcolors
++	pos=find(quivers.colorind==i);
++	hprime=quiver(quivers.x(pos),quivers.y(pos),quivers.u(pos),quivers.v(pos),...
++		'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
++	h=[h;hprime];
++end
++
++%take care of colorbar
++quiver_colorbar(quivers,options);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_unit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_unit.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_unit.m	(revision 13009)
+@@ -0,0 +1,92 @@
++function plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
++%PLOT_UNIT - unit plot, display data
++%
++%   Usage:
++%      plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options);
++%
++%   See also: PLOTMODEL, PLOT_MANAGER
++
++%edgecolor
++edgecolor=getfieldvalue(options,'edgecolor','none');
++
++switch datatype,
++
++	%element plot
++	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
++			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);
++		end
++
++	%node plot
++	case 2,
++
++		if is2d,
++			A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
++		else
++			if ~isplanet,
++				A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++				patch( 'Faces', [A B C],  'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
++				patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
++				patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
++				patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
++				patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
++			else
++				A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++				if size(elements,2)==4, D=elements(:,4); else D=C; end
++				patch( 'Faces', [A B C D],  'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
++			end
++		end
++
++	%quiver plot
++	case 3,
++
++		if is2d,
++			plot_quiver(x,y,data(:,1),data(:,2),options);
++		else
++			plot_quiver3(x,y,z,data(:,1),data(:,2),data(:,3),options);
++		end
++
++	%Patch plot P1
++	case 4,
++
++		if is2d,
++			patch( 'Faces',elements,'Vertices',[x y],'CData',data,'FaceColor','interp','EdgeColor',edgecolor);
++		else
++			A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++			patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
++			patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
++			patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
++			patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
++			patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
++		end
++
++	%Patch plot P0
++	case 5,
++
++		if is2d,
++			A=elements(:,1); B=elements(:,2); C=elements(:,3); 
++			patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(:),'FaceColor','flat','EdgeColor',edgecolor);
++		else
++			A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
++			patch( 'Faces', [A B C],  'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
++			patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
++			patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
++			patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
++			patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
++		end
++
++	otherwise,
++		error(['case ' num2str(datatype) ' not supported']);
++
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor_components.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor_components.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_tensor_components.m	(revision 13009)
+@@ -0,0 +1,78 @@
++function plot_tensor_components(md,options,width,i,tensor,type,plot_options);
++%PLOT_TENSOR_COMPONENT - plot component of a tensor
++%
++%   Usage:
++%      plot_tensor_components(md,options,width,i,tensor,type,plot_option);
++%
++%   See also: PLOTMODEL, PLOT_UNIT, PLOT_MANAGER
++
++%Compute the indexes of the components plots
++upperplots=fix((i-1)/width);
++if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
++if (md.mesh.dimension==2)%3 components -> 3 indexes
++	index1=4*width*upperplots+2*leftplots+1;
++	index2=index1+1;
++	index3=index1+width*2;
++elseif md.mesh.dimension==3%6 components -> 6 indexes
++	index1=3*3*width*upperplots+3*leftplots+1;
++	index2=index1+1;
++	index3=index1+2;
++	index4=index1+width*3;
++	index5=index4+1;
++	index6=index4+2;
++end
++
++%process data and model
++[x y z elements is2d isplanet]=processmesh(md,[],options);
++[tensor.xx datatype]=processdata(md,tensor.xx,options);
++[tensor.yy datatype]=processdata(md,tensor.yy,options);
++[tensor.xy datatype]=processdata(md,tensor.xy,options);
++if  md.mesh.dimension==3
++	[tensor.xz datatype]=processdata(md,tensor.xz,options);
++	[tensor.yz datatype]=processdata(md,tensor.yz,options);
++	[tensor.zz datatype]=processdata(md,tensor.zz,options);
++end
++
++if ((md.mesh.dimension==2)),
++	subplot(2*width,2*width,index1),
++	plot_unit(x,y,z,elements,tensor.xx,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'xx')
++	subplot(2*width,2*width,index2),
++	plot_unit(x,y,z,elements,tensor.yy,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'yy')
++	subplot(2*width,2*width,index3),
++	plot_unit(x,y,z,elements,tensor.xy,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'xy')
++else
++	subplot(3*width,3*width,index1),
++	plot_unit(x,y,z,elements,tensor.xx,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'xx')
++	subplot(3*width,3*width,index2),
++	plot_unit(x,y,z,elements,tensor.yy,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'yy')
++	subplot(3*width,3*width,index3),
++	plot_unit(x,y,z,elements,tensor.zz,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'zz')
++	subplot(3*width,3*width,index4),
++	plot_unit(x,y,z,elements,tensor.xy,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'xy')
++	subplot(3*width,3*width,index5),
++	plot_unit(x,y,z,elements,tensor.xz,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'xz')
++	subplot(3*width,3*width,index6),
++	plot_unit(x,y,z,elements,tensor.yz,is2d,isplanet,datatype,options)
++	Apply_options_tensor(md,options,type,'yz')
++end
++end
++
++function Apply_options_tensor(md,options,type,component)
++	%apply options
++	if ismember('_',type) %user plotet stress_tensor
++		strings=strsplit(type,'_');
++		string=strings{1};
++	else %default plot: user requested stress
++		string=type;
++	end
++	options=addfielddefault(options,'title',[upper(string(1)) string(2:end) ' ' component]);
++	applyoptions(md,[],options);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/findsegments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/findsegments.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/findsegments.m	(revision 13009)
+@@ -0,0 +1,92 @@
++function segments=findsegments(md,varargin)
++%FINDSEGMENTS - build segments model field
++%
++%   Optional inputs:
++%      'mesh.elementconnectivity'
++%
++%   Usage:
++%      segments=findsegments(md,varargin);
++
++%get options
++options=pairoptions(varargin{:});
++
++%Get connectivity
++mesh.elementconnectivity=getfieldvalue(options,'mesh.elementconnectivity',md.mesh.elementconnectivity);
++
++%Now, build the connectivity tables for this mesh if not correclty done
++if size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements,
++	if exist(options,'mesh.elementconnectivity'),
++		error(' ''mesh.elementconnectivity'' option does not have thge right size.');
++	else
++		mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++	end
++end
++
++%Recreate the segments
++elementonboundary=double(mesh.elementconnectivity(:,3)==0);
++pos=find(elementonboundary);
++num_segments=length(pos);
++segments=zeros(num_segments,3);
++count=1;
++
++%loop over the segments
++for i=1:num_segments,
++
++	%get current element on boundary
++	el1=pos(i);
++
++	%get elements connected to el1
++	els2=mesh.elementconnectivity(el1,find(mesh.elementconnectivity(el1,:)));
++
++	%el1 is connected to 2 other elements
++	if length(els2)>1,
++
++		%get nodes of el1
++		nods1=md.mesh.elements(el1,:);
++
++		%find the common vertices to the two elements connected to el1 (1 or 2)
++		flag=intersect(md.mesh.elements(els2(1),:),md.mesh.elements(els2(2),:));
++
++		%get the vertices on the boundary and build segment
++		nods1(find(ismember(nods1,flag)))=[];
++		segments(count,:)=[nods1 el1];
++
++		%swap segment nodes if necessary
++		ord1=find(nods1(1)==md.mesh.elements(el1,:));
++		ord2=find(nods1(2)==md.mesh.elements(el1,:));
++		if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
++			temp=segments(count,1);
++			segments(count,1)=segments(count,2);
++			segments(count,2)=temp;
++		end
++		segments(count,1:2)=fliplr(segments(count,1:2));
++		count=count+1;
++
++	%el1 is connected to only one element
++	else
++		%get nodes of el1
++		nods1=md.mesh.elements(el1,:);
++
++		%find the vertex  the el1 to not share with els2
++		flag=setdiff(nods1,md.mesh.elements(els2,:));
++
++		for j=1:3,
++			nods=nods1; nods(j)=[];
++			if any(ismember(flag,nods)),
++
++				segments(count,:)=[nods el1];
++
++				%swap segment nodes if necessary
++				ord1=find(nods(1)==md.mesh.elements(el1,:));
++				ord2=find(nods(2)==md.mesh.elements(el1,:));
++				if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
++					temp=segments(count,1);
++					segments(count,1)=segments(count,2);
++					segments(count,2)=temp;
++				end
++				segments(count,1:2)=fliplr(segments(count,1:2));
++				count=count+1;
++			end
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/sphere_tri.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/sphere_tri.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/sphere_tri.m	(revision 13009)
+@@ -0,0 +1,204 @@
++function [FV] = sphere_tri(shape,maxlevel,r,winding)
++
++% sphere_tri - generate a triangle mesh approximating a sphere
++% 
++% Usage: FV = sphere_tri(shape,Nrecurse,r,winding)
++% 
++%   shape is a string, either of the following:
++%   'ico'   starts with icosahedron (most even, default)
++%   'oct'   starts with octahedron
++%   'tetra' starts with tetrahedron (least even)
++%
++%   Nrecurse is int >= 0, setting the recursions (default 0)
++%
++%   r is the radius of the sphere (default 1)
++%
++%   winding is 0 for clockwise, 1 for counterclockwise (default 0).  The
++%   matlab patch command gives outward surface normals for clockwise
++%   order of vertices in the faces (viewed from outside the surface).
++%
++%   FV has fields FV.vertices and FV.faces.  The vertices 
++%   are listed in clockwise order in FV.faces, as viewed 
++%   from the outside in a RHS coordinate system.
++% 
++% The function uses recursive subdivision.  The first
++% approximation is an platonic solid, either an  icosahedron,
++% octahedron or a tetrahedron.  Each level of refinement 
++% subdivides each triangle face by a factor of 4 (see also 
++% mesh_refine).  At each refinement, the vertices are 
++% projected to the sphere surface (see sphere_project).
++% 
++% A recursion level of 3 or 4 is a good sphere surface, if
++% gouraud shading is used for rendering.
++% 
++% The returned struct can be used in the patch command, eg:
++% 
++% % create and plot, vertices: [2562x3] and faces: [5120x3]
++% FV = sphere_tri('ico',4,1);
++% lighting phong; shading interp; figure;
++% patch('vertices',FV.vertices,'faces',FV.faces,...
++%       'facecolor',[1 0 0],'edgecolor',[.2 .2 .6]);
++% axis off; camlight infinite; camproj('perspective');
++% 
++% See also: mesh_refine, sphere_project
++%
++
++
++
++% $Revision: 1.2 $ $Date: 2005/07/20 23:07:03 $
++
++% Licence:  GNU GPL, no implied or express warranties
++% Jon Leech (leech @ cs.unc.edu) 3/24/89
++% icosahedral code added by Jim Buddenhagen (jb1556@daditz.sbc.com) 5/93
++% 06/2002, adapted from c to matlab by Darren.Weber_at_radiology.ucsf.edu
++% 05/2004, reorder of the faces for the 'ico' surface so they are indeed
++% clockwise!  Now the surface normals are directed outward.  Also reset the
++% default recursions to zero, so we can get out just the platonic solids.
++%
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++
++eegversion = '$Revision: 1.2 $';
++fprintf('SPHERE_TRI [v %s]\n',eegversion(11:15)); tic
++
++if ~exist('shape','var') || isempty(shape),
++    shape = 'ico';
++end
++fprintf('...creating sphere tesselation based on %s\n',shape);
++
++% default maximum subdivision level
++if ~exist('maxlevel','var') || isempty(maxlevel) || maxlevel < 0,
++    maxlevel = 0;
++end
++
++% default radius
++if ~exist('r','var') || isempty(r),
++    r = 1;
++end
++
++if ~exist('winding','var') || isempty(winding),
++    winding = 0;
++end
++
++
++% -----------------
++% define the starting shapes
++
++shape = lower(shape);
++
++switch shape,
++case 'tetra',
++    
++    % Vertices of a tetrahedron
++    sqrt_3 = 0.5773502692;
++    
++    tetra.v = [  sqrt_3,  sqrt_3,  sqrt_3 ;   % +X, +Y, +Z  - PPP
++                -sqrt_3, -sqrt_3,  sqrt_3 ;   % -X, -Y, +Z  - MMP
++                -sqrt_3,  sqrt_3, -sqrt_3 ;   % -X, +Y, -Z  - MPM
++                 sqrt_3, -sqrt_3, -sqrt_3 ];  % +X, -Y, -Z  - PMM
++	
++    % Structure describing a tetrahedron
++    tetra.f = [ 1, 2, 3;
++                1, 4, 2;
++                3, 2, 4;
++                4, 1, 3 ];
++    
++    FV.vertices = tetra.v;
++    FV.faces    = tetra.f;
++    
++case 'oct',
++    
++    % Six equidistant points lying on the unit sphere
++    oct.v = [  1,  0,  0 ;  %  X
++              -1,  0,  0 ; 	% -X
++               0,  1,  0 ;  %  Y
++               0, -1,  0 ; 	% -Y
++               0,  0,  1 ; 	%  Z
++               0,  0, -1 ];	% -Z
++	
++    % Join vertices to create a unit octahedron
++    oct.f = [ 1 5 3 ;    %  X  Z  Y  -  First the top half
++              3 5 2 ;    %  Y  Z -X
++              2 5 4 ;    % -X  Z -Y
++              4 5 1 ;    % -Y  Z  X
++              1 3 6 ;    %  X  Y -Z  -  Now the bottom half
++              3 2 6 ;    %  Y  Z -Z
++              2 4 6 ;    % -X  Z -Z
++              4 1 6 ];   % -Y  Z -Z
++    
++    FV.vertices = oct.v;
++    FV.faces    = oct.f;
++    
++case 'ico',
++    
++    % Twelve vertices of icosahedron on unit sphere
++    tau = 0.8506508084; % t=(1+sqrt(5))/2, tau=t/sqrt(1+t^2)
++    one = 0.5257311121; % one=1/sqrt(1+t^2) , unit sphere
++    
++    ico.v( 1,:) = [  tau,  one,    0 ]; % ZA
++    ico.v( 2,:) = [ -tau,  one,    0 ]; % ZB
++    ico.v( 3,:) = [ -tau, -one,    0 ]; % ZC
++    ico.v( 4,:) = [  tau, -one,    0 ]; % ZD
++    ico.v( 5,:) = [  one,   0 ,  tau ]; % YA
++    ico.v( 6,:) = [  one,   0 , -tau ]; % YB
++    ico.v( 7,:) = [ -one,   0 , -tau ]; % YC
++    ico.v( 8,:) = [ -one,   0 ,  tau ]; % YD
++    ico.v( 9,:) = [   0 ,  tau,  one ]; % XA
++    ico.v(10,:) = [   0 , -tau,  one ]; % XB
++    ico.v(11,:) = [   0 , -tau, -one ]; % XC
++    ico.v(12,:) = [   0 ,  tau, -one ]; % XD
++    
++    % Structure for unit icosahedron
++    ico.f = [  5,  8,  9 ;
++               5, 10,  8 ;
++               6, 12,  7 ;
++               6,  7, 11 ;
++               1,  4,  5 ;
++               1,  6,  4 ;
++               3,  2,  8 ;
++               3,  7,  2 ;
++               9, 12,  1 ;
++               9,  2, 12 ;
++              10,  4, 11 ;
++              10, 11,  3 ;
++               9,  1,  5 ;
++              12,  6,  1 ;
++               5,  4, 10 ;
++               6, 11,  4 ;
++               8,  2,  9 ;
++               7, 12,  2 ;
++               8, 10,  3 ;
++               7,  3, 11 ];
++	
++    FV.vertices = ico.v;
++    FV.faces    = ico.f;
++end
++
++
++% -----------------
++% refine the starting shapes with subdivisions
++if maxlevel,
++    
++    % Subdivide each starting triangle (maxlevel) times
++    for level = 1:maxlevel,
++        
++        % Subdivide each triangle and normalize the new points thus
++        % generated to lie on the surface of a sphere radius r.
++        FV = mesh_refine_tri4(FV);
++        FV.vertices = sphere_project(FV.vertices,r);
++        
++        % An alternative might be to define a min distance
++        % between vertices and recurse or use fminsearch
++        
++    end
++end
++
++if winding,
++    fprintf('...returning counterclockwise vertex order (viewed from outside)\n');
++    FV.faces = FV.faces(:,[1 3 2]);
++else
++    fprintf('...returning clockwise vertex order (viewed from outside)\n');
++end
++
++t=toc; fprintf('...done (%6.2f sec)\n\n',t);
++
++return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/mesh_refine_tri4.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/mesh_refine_tri4.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/mesh_refine_tri4.m	(revision 13009)
+@@ -0,0 +1,146 @@
++function [ FV ] = mesh_refine_tri4(FV)
++
++% mesh_refine_tri4 - creates 4 triangle from each triangle of a mesh
++%
++% [ FV ] = mesh_refine_tri4( FV )
++%
++% FV.vertices   - mesh vertices (Nx3 matrix)
++% FV.faces      - faces with indices into 3 rows
++%                 of FV.vertices (Mx3 matrix)
++% 
++% For each face, 3 new vertices are created at the 
++% triangle edge midpoints.  Each face is divided into 4
++% faces and returned in FV.
++%
++%        B
++%       /\
++%      /  \
++%    a/____\b       Construct new triangles
++%    /\    /\       [A,a,c]
++%   /  \  /  \      [a,B,b]
++%  /____\/____\     [c,b,C]
++% A	     c	   C    [a,b,c]
++% 
++% It is assumed that the vertices are listed in clockwise order in
++% FV.faces (A,B,C above), as viewed from the outside in a RHS coordinate
++% system.
++% 
++% See also: mesh_refine, sphere_tri, sphere_project
++% 
++
++
++% ---this method is not implemented, but the idea here remains...
++% This can be done until some minimal distance (D) of the mean 
++% distance between vertices of all triangles is achieved.  If
++% no D argument is given, the function refines the mesh once.
++% Alternatively, it could be done until some minimum mean 
++% area of faces is achieved.  As is, it just refines once.
++
++
++% $Revision: 1.1 $ $Date: 2004/11/12 01:32:35 $
++
++% Licence:  GNU GPL, no implied or express warranties
++% History:  05/2002, Darren.Weber_at_radiology.ucsf.edu, created
++%
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++
++tic;
++fprintf('...refining mesh (tri4)...')
++
++% NOTE
++% The centroid is located one third of the way from each vertex to 
++% the midpoint of the opposite side. Each median divides the triangle 
++% into two equal areas; all the medians together divide it into six 
++% equal parts, and the lines from the median point to the vertices 
++% divide the whole into three equivalent triangles.
++
++% Each input triangle with vertices labelled [A,B,C] as shown
++% below will be turned into four new triangles:
++%
++% Make new midpoints
++% a = (A+B)/2
++% b = (B+C)/2
++% c = (C+A)/2
++%
++%        B
++%       /\
++%      /  \
++%    a/____\b       Construct new triangles
++%    /\    /\       [A,a,c]
++%   /  \  /  \      [a,B,b]
++%  /____\/____\     [c,b,C]
++% A	     c	   C    [a,b,c]
++%
++
++% Initialise a new vertices and faces matrix
++Nvert = size(FV.vertices,1);
++Nface = size(FV.faces,1);
++V2 = zeros(Nface*3,3);
++F2 = zeros(Nface*4,3);
++
++for f = 1:Nface,
++    
++    % Get the triangle vertex indices
++    NA = FV.faces(f,1);
++    NB = FV.faces(f,2);
++    NC = FV.faces(f,3);
++    
++    % Get the triangle vertex coordinates
++    A = FV.vertices(NA,:);
++    B = FV.vertices(NB,:);
++    C = FV.vertices(NC,:);
++    
++    % Now find the midpoints between vertices
++    a = (A + B) ./ 2;
++    b = (B + C) ./ 2;
++    c = (C + A) ./ 2;
++    
++    % Find the length of each median
++    %A2blen = sqrt ( sum( (A - b).^2, 2 ) );
++    %B2clen = sqrt ( sum( (B - c).^2, 2 ) );
++    %C2alen = sqrt ( sum( (C - a).^2, 2 ) );
++    
++    % Store the midpoint vertices, while
++    % checking if midpoint vertex already exists
++    [FV, Na] = mesh_find_vertex(FV,a);
++    [FV, Nb] = mesh_find_vertex(FV,b);
++    [FV, Nc] = mesh_find_vertex(FV,c);
++    
++    % Create new faces with orig vertices plus midpoints
++    F2(f*4-3,:) = [ NA, Na, Nc ];
++    F2(f*4-2,:) = [ Na, NB, Nb ];
++    F2(f*4-1,:) = [ Nc, Nb, NC ];
++    F2(f*4-0,:) = [ Na, Nb, Nc ];
++    
++end
++
++% Replace the faces matrix
++FV.faces = F2;
++
++t=toc; fprintf('done (%5.2f sec)\n',t);
++
++return
++
++
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++function [FV, N] = mesh_find_vertex(FV,vertex)
++
++    Vn = size(FV.vertices,1);
++    Va = repmat(vertex,Vn,1);
++    Vexist = find( FV.vertices(:,1) == Va(:,1) & ...
++                   FV.vertices(:,2) == Va(:,2) & ...
++                   FV.vertices(:,3) == Va(:,3) );
++    if Vexist,
++        if size(Vexist) == [1,1],
++            N = Vexist;
++        else,
++            msg = sprintf('replicated vertices');
++            error(msg);
++        end
++    else
++        FV.vertices(end+1,:) = vertex;
++        N = size(FV.vertices,1);
++    end
++
++return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/planetmesher.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/planetmesher.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/planetmesher.m	(revision 13009)
+@@ -0,0 +1,35 @@
++function md=planetmesher(md,varargin)
++%PLANETMESHER - create planet mesh using several packages
++%
++%   This routine creates a planet mesh using several packages: a custom made 
++%   ISSM mesher (called planetmixedmesh.m, method 'mixed') and the planettrimesh
++%   (method 'tria')
++%   where md is a @planet object, varargin is a list of options
++%
++% Usage: md=planetmesher(md,'method','mixed','radius',6378000,'angleresol',1);
++%        md=planetmesher(md,'method','tria','shape','iso','radius',6378000,'refinement',5);
++%
++%
++
++	%recover options
++	options=pairoptions(varargin{:});
++
++	method=getfieldvalue(options,'method','mixed');
++
++	if strcmpi(method,'mixed'),
++		%recover radius and angleresol: 
++		radius=getfieldvalue(options,'radius',6378000); %earth radius as default
++		angleresol=getfieldvalue(options,'angleresol',10); %10 degree resolution
++
++		%call mixed mesh 
++		md=planetmixedmesh(md,radius,angleresol);
++	else
++		%recover radius, shape and level of refinmenet
++		radius=getfieldvalue(options,'radius',6378000); %earth radius as default
++		refinement=getfieldvalue(options,'refinement',5); %refine 5 times
++		shape=getfieldvalue(options,'shape','ico'); 
++
++		%call triangular mesh
++		md=planettrimesh(md,shape,radius,refinement);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/planetmixedmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/planetmixedmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/planetmixedmesh.m	(revision 13009)
+@@ -0,0 +1,99 @@
++function md=planetmixedmesh(md,radius,angleresol)
++%PLANETMIXEDMESH: build 2d shell mesh
++%
++% Usage: md=planetmixedshell(md,radius,angleresol)
++%
++
++conv=pi/180;
++
++r=radius;
++theta=(0:angleresol:360)';
++theta=theta*conv;
++phi=(0:angleresol:180)';
++phi=phi(2:end-1)*conv;
++
++nphi=length(phi);
++nthetha=length(theta);
++
++x=zeros(nphi*nthetha,1);
++y=zeros(nphi*nthetha,1);
++z=zeros(nphi*nthetha,1);
++
++for i=1:nphi,
++	phii=phi(i);
++	x((i-1)*nthetha+1:i*nthetha)=r.*cos(theta).*sin(phii);
++	y((i-1)*nthetha+1:i*nthetha)=r.*sin(theta).*sin(phii);
++	z((i-1)*nthetha+1:i*nthetha)=r.*cos(phii);
++end
++
++quads=zeros((nthetha-1)*(nphi-1),4);
++
++%build elements
++for i=1:nphi-1,
++	for j=1:nthetha-1,
++		count=(i-1)*(nthetha-1)+j;
++	
++		A=(i-1)*nthetha+j;
++		B=(i-1)*nthetha+j+1;
++		C=(i)*nthetha+j+1;
++		D=(i)*nthetha+j;
++		
++		quads(count,:)=[A B C D];
++	end
++end
++
++%now, add polar elements:
++%first north: phi = 0;
++x=[r.*cos(0).*sin(0);x];
++y=[r.*sin(0).*sin(0);y];
++z=[r.*cos(0);z];
++
++%add 1 to quads: 
++quads=quads+1;
++
++%add tria elements:
++trias=zeros(nthetha-1,4);
++
++for i=1:nthetha-1,
++	A=1;
++	B=i+1;
++	C=i+2;
++	trias(i,:)=[A B C NaN];
++end
++
++quads=[trias;quads];
++
++
++% now add south pole: 
++phii=180*conv;
++x=[x;r.*cos(phii).*sin(phii)];
++y=[y;r.*sin(phii).*sin(phii)];
++z=[z;r.*cos(phii)];
++nods=length(x);
++
++%add tria elements:
++trias=zeros(nthetha-1,4);
++
++start=nods-nthetha;
++for i=1:nthetha-1,
++	A=start+i-1;
++	B=start+i;
++	C=nods;
++	trias(i,:)=[A B C NaN];
++end
++
++quads=[quads;trias];
++
++
++md.mesh.elements=quads;
++md.mesh.x=x;
++md.mesh.y=y;
++md.mesh.z=z;
++md.mesh.r=sqrt(x.^2+y.^2+z.^2);
++md.mesh.theta=acos(z./md.mesh.r);
++md.mesh.phi=atan2(y,x);
++
++md.mesh.numberofvertices=length(md.mesh.x);
++md.mesh.numberofelements=size(md.mesh.elements,1);
++
++md.mesh.dimension=3;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/sphere_project.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/sphere_project.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/sphere_project.m	(revision 13009)
+@@ -0,0 +1,66 @@
++function V = sphere_project(v,r,c)
++
++% sphere_project - project point X,Y,Z to the surface of sphere radius r
++% 
++% V = sphere_project(v,r,c)
++% 
++% Cartesian inputs:
++% v is the vertex matrix, Nx3 (XYZ)
++% r is the sphere radius, 1x1 (default 1)
++% c is the sphere centroid, 1x3 (default 0,0,0)
++%
++% XYZ are converted to spherical coordinates and their radius is
++% adjusted according to r, from c toward XYZ (defined with theta,phi)
++% 
++% V is returned as Cartesian 3D coordinates
++% 
++
++% $Revision: 1.1 $ $Date: 2004/11/12 01:32:36 $
++
++% Licence:  GNU GPL, no implied or express warranties
++% History:  06/2002, Darren.Weber_at_radiology.ucsf.edu, created
++%
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++
++if ~exist('v','var'),
++    msg = sprintf('SPHERE_PROJECT: No input vertices (X,Y,Z)\n');
++    error(msg);
++end
++
++X = v(:,1);
++Y = v(:,2);
++Z = v(:,3);
++
++if ~exist('c','var'),
++    xo = 0;
++    yo = 0;
++    zo = 0;
++else
++    xo = c(1);
++    yo = c(2);
++    zo = c(3);
++end
++
++if ~exist('r','var'), r = 1; end
++
++% alternate method is to use unit vector of V
++% [ n = 'magnitude(V)'; unitV = V ./ n; ]
++% to change the radius, multiply the unitV
++% by the radius required.  This avoids the
++% use of arctan functions, which have branches.
++
++
++% Convert Cartesian X,Y,Z to spherical (radians)
++theta = atan2( (Y-yo), (X-xo) );
++phi   = atan2( sqrt( (X-xo).^2 + (Y-yo).^2 ), (Z-zo) );
++% do not calc: r = sqrt( (X-xo).^2 + (Y-yo).^2 + (Z-zo).^2);
++
++%   Recalculate X,Y,Z for constant r, given theta & phi.
++R = ones(size(phi)) * r;
++x = R .* sin(phi) .* cos(theta);
++y = R .* sin(phi) .* sin(theta);
++z = R .* cos(phi);
++
++V = [x y z];
++
++return
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/planettrimesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/planettrimesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/planet/planettrimesh.m	(revision 13009)
+@@ -0,0 +1,20 @@
++function md=planettrimesh(md,shape,radius,refinement)
++%PLANETTRIMESH: build 2d shell mesh
++%
++% Usage: md=planettrimesh(md,shape,radius,refinement)
++%
++
++results = sphere_tri(shape,refinement,radius);
++md.mesh.x=results.vertices(:,1);
++md.mesh.y=results.vertices(:,2);
++md.mesh.z=results.vertices(:,3);
++md.mesh.elements=results.faces;
++
++md.mesh.r=sqrt(md.mesh.x.^2+md.mesh.y.^2+md.mesh.z.^2);
++md.mesh.theta=acos(md.mesh.z./md.mesh.r);
++md.mesh.phi=atan2(md.mesh.y,md.mesh.x);
++
++md.mesh.numberofvertices=length(md.mesh.x);
++md.mesh.numberofelements=size(md.mesh.elements,1);
++
++md.mesh.dimension=3;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshplug.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshplug.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshplug.m	(revision 13009)
+@@ -0,0 +1,89 @@
++function [elements,x,y,z,numberofelements,numberofnodes,elconv,nodeconv,elconv2,nodeconv2]=meshplug(elements,x,y,z,elements2,x2,y2,z2,extractednodes,extractedelements,domain);
++%MESHPLUG - embed mesh into another one
++%     See also meshaddrifts
++
++
++%initialize elconv,nodeconv conversion tables from md mesh to new md mesh
++elconv=1:size(elements,1); elconv=elconv';
++nodeconv=1:size(x,1); nodeconv=nodeconv';
++
++%take away old elements in area of interest: 
++elements(extractedelements,:)=[];
++element_offset=size(elements,1);
++
++%update elconv after having extracted the area of interest elements
++temp_elconv=elconv; temp_elconv(extractedelements)=[];
++temp_elconvnum=1:length(temp_elconv);
++elconv(temp_elconv)=temp_elconvnum;
++elconv(extractedelements)=NaN;
++
++%initialize elconv2 and nodeconv2, conversion tables from md2 mesh to new md mesh
++elconv2=1:size(elements2,1);elconv2=elconv2'+element_offset;
++nodeconv2=(size(x,1)+1):(size(x,1)+size(x2,1)); nodeconv2=nodeconv2';
++
++extractednodes_minusborder=extractednodes;
++extractednodes_minusborder(domain)=[];
++
++x(extractednodes_minusborder)=NaN;
++y(extractednodes_minusborder)=NaN;
++
++%now, plug md2 mesh: 
++
++%first, offset all ids of md2 mesh
++elements2=elements2+length(x);
++
++%NaN border nodes in second mesh
++x2(1:length(domain))=NaN;
++y2(1:length(domain))=NaN;
++
++%redirect border nodes in elements2  to elements
++for i=1:length(domain),
++	pos=find(elements2==(i+length(x)));
++	elements2(pos)=extractednodes(domain(i));
++end
++
++%same deal for nodeconv2:
++for i=1:length(domain),
++	nodeconv2(i)=extractednodes(domain(i));
++end
++
++
++%plug elements
++elements=[elements;elements2];
++
++
++%now, increase number of nodes
++x=[x; x2];
++y=[y; y2];
++z=[z; z2];
++
++%now, get rid of NaN in x:
++while  ~isempty(find(isnan(x))),
++
++	pos=find(isnan(x));
++	node=pos(1);
++
++	%collapse node
++	x(node)=[];
++	y(node)=[];
++	z(node)=[];
++
++	%renumber all nodes > node in elements
++	pos=find(elements>node);
++	elements(pos)=elements(pos)-1;
++
++	%same deal for nodeconv2: 
++	pos=find(nodeconv2>node);
++	nodeconv2(pos)=nodeconv2(pos)-1;
++
++end
++
++numberofnodes=length(x);
++numberofelements=length(elements);
++
++%finish nodeconv: 
++temp_nodeconv=nodeconv;  temp_nodeconv(extractednodes_minusborder)=[];
++temp_nodeconvnum=1:length(temp_nodeconv);
++nodeconv(temp_nodeconv)=temp_nodeconvnum;
++nodeconv(extractednodes_minusborder)=NaN;
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshyamsrecreateriftsegments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshyamsrecreateriftsegments.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshyamsrecreateriftsegments.m	(revision 13009)
+@@ -0,0 +1,90 @@
++function md=meshyamsrecreateriftsegments(md)
++
++	%recreate rift segments: just used for yams. temporaroy routine.
++	pos_record=[];
++	if md.rifts.numrifts,
++		for i=1:md.rifts.numrifts,
++			rift=md.rifts.riftstruct(i);
++
++			%closed rifts first:
++			if length(rift.tips)==2,
++
++				%find tip1 and tip2 for this rift, in the new mesh created by yams.
++				pos=find_point(md.mesh.x(md.mesh.segments(:,1)),md.mesh.y(md.mesh.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
++				tip1=md.mesh.segments(pos,1);
++				pos=find_point(md.mesh.x(md.mesh.segments(:,1)),md.mesh.y(md.mesh.segments(:,1)),rift.tip2coordinates(1),rift.tip2coordinates(2));
++				tip2=md.mesh.segments(pos,1);
++
++				%start from tip1, and build segments of this rift. 
++				pos=find_point(md.mesh.x(md.mesh.segments(:,1)),md.mesh.y(md.mesh.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
++				pos_record=[pos_record; pos];
++				riftsegs=md.mesh.segments(pos,:);
++				while 1,
++					A=riftsegs(end,1); B=riftsegs(end,2); el=riftsegs(end,3);
++					%find other segment that holds B.
++					pos=find(md.mesh.segments(:,1)==B);
++					pos_record=[pos_record; pos];
++					riftsegs=[riftsegs; md.mesh.segments(pos,:)];
++					if riftsegs(end,2)==tip1, 
++						break;
++					end
++				end
++				md.rifts.riftstruct(i).segments=riftsegs;
++				md.rifts.riftstruct(i).tips=[tip1 tip2];
++
++			else
++				%ok, this is a rift that opens up to the domain outline.  One tip is going to be 
++				%double, the other one, single. We are going to start from the single tip, towards the two 
++				%other doubles
++
++				%find tip1 and tip2 for this rift, in the new mesh created by yams.
++				pos1=find_point(md.mesh.x(md.mesh.segments(:,1)),md.mesh.y(md.mesh.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
++				tip1=md.mesh.segments(pos1,1);
++				pos2=find_point(md.mesh.x(md.mesh.segments(:,1)),md.mesh.y(md.mesh.segments(:,1)),rift.tip2coordinates(1),rift.tip2coordinates(2));
++				tip2=md.mesh.segments(pos2,1);
++				if length(tip1)==2,
++					%swap.
++					temp=tip1; tip1=tip2; tip2=temp;
++					temp=pos1; pos1=pos2; pos2=temp;
++					pos=pos1;
++				else
++					pos=pos1;
++				end
++
++				pos_record=[pos_record; pos];
++				riftsegs=md.mesh.segments(pos,:);
++				while 1,
++					A=riftsegs(end,1); B=riftsegs(end,2); el=riftsegs(end,3);
++					%find other segment that holds B.
++					pos=find(md.mesh.segments(:,1)==B);
++					pos_record=[pos_record; pos];
++					riftsegs=[riftsegs; md.mesh.segments(pos,:)];
++					if ((riftsegs(end,2)==tip2(1)) | (riftsegs(end,2)==tip2(2))), 
++						%figure out which tip we reached
++						if riftsegs(end,2)==tip2(1), index=2; else index=1; end
++						break;
++					end
++				end
++
++				%ok, now, we start from the other tip2, towards tip1
++				pos=pos2(index);
++				pos_record=[pos_record; pos];
++				riftsegs=[riftsegs; md.mesh.segments(pos,:)];
++				while 1,
++					A=riftsegs(end,1); B=riftsegs(end,2); el=riftsegs(end,3);
++					%find other segment that holds B.
++					pos=find(md.mesh.segments(:,1)==B);
++					pos_record=[pos_record; pos];
++					riftsegs=[riftsegs; md.mesh.segments(pos,:)];
++					if riftsegs(end,2)==tip1, 
++						break;
++					end
++				end
++				md.rifts.riftstruct(i).segments=riftsegs;
++				md.rifts.riftstruct(i).tips=[tip1 tip2(1) tip2(2)];
++
++			end
++		end
++	end
++	%take out rift segments from segments
++	md.mesh.segments(pos_record,:)=[];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshaddrifts.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshaddrifts.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshaddrifts.m	(revision 13009)
+@@ -0,0 +1,93 @@
++function md=meshaddrifts(md,riftname);
++%MESHADDRIFTS - add rifts to a preloaded mesh (typically, an argus mesh)
++%
++%   Usage:
++%      md=meshaddrifts(md,riftname);
++%
++%        where md is a model with a preexisting mesh, and riftname is the name of an .exp file.
++%        The format of the riftname file is as follows: a list of pairs of closed and open contours. 
++%        The closed contour defines the envelop of the rift, the open contour that follows in the 
++%        file defines the rift. The density of the rift should be chosen carefully in the file, as it 
++%        will be used to define the rift contour density of the mesh. The open contour density will 
++%        be preserved. There can be as many pairs of closed contour and rift contour as wished.
++
++
++%read rift: 
++domains=expread(riftname,1);
++contours=domains(1:2:end);
++rifts=domains(2:2:end);
++
++%now loop over rifts: 
++for rift_i=1:length(rifts),
++	
++	%refine rift to desired resolution: 
++	contour=contours(rift_i);
++	rift=rifts(rift_i);
++	
++	delete('Meshaddrifts.Rift.exp');
++	expwrite(rift,'Meshaddrifts.Rift.Coarse.exp');
++	expcoarsen('Meshaddrifts.Rift.exp','Meshaddrifts.Rift.Coarse.exp',rift.density);
++	delete('Meshaddrifts.Rift.Coarse.exp');
++	
++	%extract model:
++	expwrite(contour,'Meshaddrifts.Contour.exp');
++	md2=modelextract(md,'Meshaddrifts.Contour.exp');
++	
++	%create domain of md2 model: 
++	md2.mesh.segments=contourenvelope(md2,'Meshaddrifts.Contour.exp');
++	domain_index=md2.mesh.segments(1,1:2);
++	while (domain_index(end)~=domain_index(1)),
++		pos=find(md2.mesh.segments(:,1)==domain_index(end));
++		domain_index(end+1)=md2.mesh.segments(pos,2);
++	end
++	
++	domain.x=md2.mesh.x(domain_index);
++	domain.y=md2.mesh.y(domain_index);
++	domain.name='Meshaddrifts.Domain.exp';
++	domain.density=1;
++	expwrite(domain,'Meshaddrifts.Domain.exp');
++	
++	%unloop domain index: used for later.
++	domain_index=domain_index(1:end-1);
++	
++	%remesh md2 using new domain outline, and rift profile: 
++	md2=meshnodensity(md2,'Meshaddrifts.Domain.exp','Meshaddrifts.Rift.exp');
++	md2=meshprocessrifts(md2);
++	
++	%plug md2 mesh into md mesh: 
++	[md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z,md.mesh.numberofelements,md.mesh.numberofvertices,elconv,nodeconv,elconv2,nodeconv2]=meshplug(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z,...
++								md2.mesh.elements,md2.mesh.x,md2.mesh.y,md2.mesh.z,md2.extractednodes,md2.extractedelements,domain_index);
++
++	%update md2 rifts using elconv and nodeconv, and plug them into md: 
++	md2.rifts=updateriftindexing(md2.rifts,elconv2,nodeconv2);
++	
++	for i=1:md.rifts.numrifts,
++		md.rifts.riftstruct(i)=updateriftindexing(md.rifts.riftstruct(i),elconv,nodeconv);
++	end
++	
++	if md.rifts.numrifts==0,
++		md.rifts.riftstruct=md2.rifts;
++		md.rifts.numrifts=1;
++	else
++		md.rifts.riftstruct(end+1,1)=md2.rifts;
++		md.rifts.numrifts=md.rifts.numrifts+1;
++	end
++	
++	md.mesh.segments(:,1:2)=nodeconv(md.mesh.segments(:,1:2));
++	md.mesh.segments(:,3)=elconv(md.mesh.segments(:,3));
++
++end
++
++%finish up "a la" mesh.h
++md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
++md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
++md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
++md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
++md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
++
++%Now, build the connectivity tables for this mesh.
++md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++
++%type of model
++md.mesh.dimension=2;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/rifttipsrefine.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/rifttipsrefine.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/rifttipsrefine.m	(revision 13009)
+@@ -0,0 +1,26 @@
++function md=rifttipsrefine(md,filename,resolution,circleradius);
++%RIFTTIPSREFINE - refine mesh near rift tips
++%
++%   Usage:
++%      md=rifttipsrefine(md,filename,resolution,circleradius);
++
++numberofnodes=50;
++
++%take rifts, and create refinement circles around tips
++rifts=expread(filename,1);
++
++!echo -n "" > Circles.exp
++for i=1:length(rifts),
++	tip1=[rifts(i).x(1) rifts(i).y(1)];
++	tip2=[rifts(i).x(end) rifts(i).y(end)];
++	%create circle around tip
++	expcreatecircle('Circle1.exp',tip1(1),tip1(2),circleradius,numberofnodes);
++	expcreatecircle('Circle2.exp',tip2(1),tip2(2),circleradius,numberofnodes);
++	!cat Circles.exp Circle1.exp Circle2.exp > Circles2.exp
++	!mv Circles2.exp Circles.exp
++	!rm -rf Circle1.exp Circle2.exp
++end
++
++md=meshexprefine(md,'Circles.exp',resolution);
++
++system('rm -rf Circles.exp');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/updateriftindexing.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/updateriftindexing.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/updateriftindexing.m	(revision 13009)
+@@ -0,0 +1,11 @@
++function rift=updateriftindexing(rift,elconv,nodeconv)
++%UPDATERIFTINDEXING - update rift indexing, using mesh to new mesh conversion tables
++%     See also meshaddrift
++
++rift.segments(:,1:2)=nodeconv(rift.segments(:,1:2));
++rift.segments(:,3)=elconv(rift.segments(:,3));
++rift.pairs=elconv(rift.pairs);
++rift.tips=nodeconv(rift.tips);
++
++rift.penaltypairs(:,1:2)=nodeconv(rift.penaltypairs(:,1:2));
++rift.penaltypairs(:,3:4)=elconv(rift.penaltypairs(:,3:4));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshprocessoutsiderifts.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshprocessoutsiderifts.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshprocessoutsiderifts.m	(revision 13009)
+@@ -0,0 +1,94 @@
++function md=meshprocessoutsiderifts(md,domainoutline)
++%MESHPROCESSOUTSIDERIFTS - process rifts when they touch the domain outline
++%
++%   Usage:
++%      md=meshprocessoutsiderifts(md,domain)
++%
++
++
++
++%go through rifts, and figure out which ones touch the domain outline
++for i=1:md.rifts.numrifts,
++	
++	%first, flag nodes that belong to the domain outline
++	flags=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,domainoutline,'node',0);
++
++	rift=md.rifts.riftstruct(i);
++	tips=rift.tips;
++	outsidetips=tips(find(flags(rift.tips)==0));
++
++	%we have found outsidetips, tips that touch the domain outline. go through them
++	for j=1:length(outsidetips),
++		
++		tip=outsidetips(j);
++		%find tip in the segments, take first segment (there should be 2) that holds tip, 
++		%and node_connected_to_tip is the other node on this segment:
++		tipindex=find(rift.segments(:,1)==tip); 
++		if length(tipindex),
++			tipindex=tipindex(1);
++			node_connected_to_tip=rift.segments(tipindex,2);
++		else
++			tipindex=find(rift.segments(:,2)==tip); tipindex=tipindex(1);
++			node_connected_to_tip=rift.segments(tipindex,1);
++		end
++
++		%ok, we have the tip node, and the first node connected to it, on the rift. Now, 
++		%identify all the elements that are connected to the tip, and that are on the same 
++		%side of the rift.
++		A=tip;
++		B=node_connected_to_tip;
++
++		elements=[];
++
++		while  flags(B), %as long as B does not belong to the domain outline, keep looking.
++			%detect elements on edge A,B:
++			edgeelements=ElementsFromEdge(md.mesh.elements,A,B);
++			%rule out those we already detected
++			already_detected=ismember(edgeelements,elements);
++			nextelement=edgeelements(find(~already_detected));
++			%add new detected element to the list of elements we are looking for.
++			elements=[elements;nextelement];
++			%new B:
++			B=md.mesh.elements(nextelement,find(~ismember(md.mesh.elements(nextelement,:),[A B])));
++		end
++		
++		%take the list of elements on one side of the rift that connect to the tip, 
++		%and duplicate the tip on them, so as to open the rift to the outside.
++		num=length(md.mesh.x)+1;
++		md.mesh.x=[md.mesh.x;md.mesh.x(tip)];
++		md.mesh.y=[md.mesh.y;md.mesh.y(tip)];
++		md.mesh.numberofvertices=num;
++		
++		%replace tip in elements
++		newelements=md.mesh.elements(elements,:);
++		pos=find(newelements==tip);
++		newelements(pos)=num;
++		md.mesh.elements(elements,:)=newelements;
++		md.rifts.riftstruct(i).tips=[md.rifts.riftstruct(i).tips num];
++
++		%deal with segments
++		tipsegments=find((md.mesh.segments(:,1)==tip) | (md.mesh.segments(:,2)==tip));
++		for  k=1:length(tipsegments),
++			segment_index=tipsegments(k);
++			pos=find(md.mesh.segments(segment_index,1:2)~=tip);
++			other_node=md.mesh.segments(segment_index,pos);
++			if ~isconnected(md.mesh.elements,other_node,tip),
++				pos=find(md.mesh.segments(segment_index,1:2)==tip);
++				md.mesh.segments(segment_index,pos)=num;
++			end
++		end
++	end
++end
++
++
++%Fill in rest of fields:
++md.mesh.numberofelements=length(md.mesh.elements);
++md.mesh.numberofvertices=length(md.mesh.x);
++md.mesh.z=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonboundary=zeros(length(md.mesh.x),1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
++md.rifts.numrifts=length(md.rifts.riftstruct);
++md.flowequation.element_equation=3*ones(md.mesh.numberofelements,1);
++md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
++md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
++md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
++md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshprocessrifts.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshprocessrifts.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshprocessrifts.m	(revision 13009)
+@@ -0,0 +1,69 @@
++function md=meshprocessrifts(md,domainoutline)
++%MESHPROCESSRIFTS - process mesh when rifts are present
++%
++%   split rifts inside mesh (rifts are defined by presence of
++%   segments inside the domain outline)
++%   if domain outline is provided, check for rifts that could touch it, and open them up.
++%
++%   Usage:
++%      md=meshprocessrifts(md,domainoutline)
++%
++%   Ex: 
++%      md=meshprocessrifts(md,'DomainOutline.exp');
++%
++
++%some checks on arguments: 
++if nargout~=1,
++	help meshprocessrifts
++	error('meshprocessrifts usage error:');
++end
++
++if nargin~=2,
++	help meshprocessrifts
++	error('meshprocessrifts usage error:');
++end
++
++%Call MEX file
++[md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers,md.rifts.riftstruct]=TriMeshProcessRifts(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers);
++if ~isstruct(md.rifts.riftstruct),
++	error('TriMeshProcessRifts did not find any rift');
++end
++
++%Fill in rest of fields:
++numrifts=length(md.rifts.riftstruct);
++md.mesh.numberofelements=length(md.mesh.elements);
++md.mesh.numberofvertices=length(md.mesh.x);
++md.mesh.z=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonboundary=zeros(length(md.mesh.x),1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
++md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
++md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
++md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
++md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
++
++%get coordinates of rift tips
++for i=1:numrifts,
++	md.rifts.riftstruct(i).tip1coordinates=[md.mesh.x(md.rifts.riftstruct(i).tips(1)) md.mesh.y(md.rifts.riftstruct(i).tips(1))];
++	md.rifts.riftstruct(i).tip2coordinates=[md.mesh.x(md.rifts.riftstruct(i).tips(2)) md.mesh.y(md.rifts.riftstruct(i).tips(2))];
++end
++
++%In case we have rifts that open up the domain outline, we need to open them: 
++flags=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,domainoutline,'node',0);
++found=0;
++for i=1:numrifts,
++	if flags(md.rifts.riftstruct(i).tips(1))==0,
++		found=1;
++		break;
++	end
++	if flags(md.rifts.riftstruct(i).tips(2))==0,
++		found=1;
++		break;
++	end
++end
++if found,
++	md=meshprocessoutsiderifts(md,domainoutline);
++end
++
++%get elements that are not correctly oriented in the correct direction:
++aires=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
++pos=find(aires<0);
++md.mesh.elements(pos,:)=[md.mesh.elements(pos,2) md.mesh.elements(pos,1) md.mesh.elements(pos,3)];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshconvert.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshconvert.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshconvert.m	(revision 13009)
+@@ -0,0 +1,48 @@
++function md=meshconvert(md,varargin)
++%CONVERTMESH - convert mesh to bamg mesh
++%
++%   Usage:
++%      md=meshconvert(md);
++%      md=meshconvert(md,index,x,y);
++
++if nargin~=1 & nargin~=4,
++	help meshconvert
++	error('meshconvert error message: bad usage');
++end
++
++if nargin==1,
++	x=md.mesh.x;
++	y=md.mesh.y;
++	index=md.mesh.elements;
++else
++	x=varargin{1};
++	y=varargin{2};
++	index=varargin{3};
++end
++
++%call Bamg
++[bamgmesh_out bamggeom_out]=BamgConvertMesh(index,x,y);
++
++% plug results onto model
++md.private.bamg=struct();
++md.private.bamg.mesh=bamgmesh(bamgmesh_out);
++md.private.bamg.geometry=bamggeom(bamggeom_out);
++md.mesh.x=bamgmesh_out.Vertices(:,1);
++md.mesh.y=bamgmesh_out.Vertices(:,2);
++md.mesh.elements=bamgmesh_out.Triangles(:,1:3);
++md.mesh.edges=bamgmesh_out.IssmEdges;
++md.mesh.segments=bamgmesh_out.IssmSegments(:,1:3);
++md.mesh.segmentmarkers=bamgmesh_out.IssmSegments(:,4);
++
++%Fill in rest of fields:
++md.mesh.dimension=2;
++md.mesh.numberofelements=size(md.mesh.elements,1);
++md.mesh.numberofvertices=length(md.mesh.x);
++md.mesh.numberofedges=size(md.mesh.edges,1);
++md.mesh.z=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
++md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
++md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
++md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
++md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/triangle.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/triangle.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/triangle.py	(revision 13009)
+@@ -0,0 +1,56 @@
++from numpy import *
++import TriMesh as tm
++import NodeConnectivity as nc
++import ElementConnectivity as ec
++
++def triangle(md, domainname, resolution,riftname=''):
++	#TRIANGLE - create model mesh using the triangle package
++	#
++	#   This routine creates a model mesh using TriMesh and a domain outline, to within a certain resolution
++	#   where md is a @model object, domainname is the name of an Argus domain outline file, 
++	#   and resolution is a characteristic length for the mesh (same unit as the domain outline
++	#   unit). Riftname is an optional argument (Argus domain outline) describing rifts.
++	#
++	#   Usage:
++	#      md=triangle(md,domainname,resolution)
++	#   or md=triangle(md,domainname, resolution, riftname)
++	#
++	#   Examples:
++	#      md=triangle(md,'DomainOutline.exp',1000);
++	#      md=triangle(md,'DomainOutline.exp',1000,'Rifts.exp');
++
++
++	#Figure out a characteristic area. Resolution is a node oriented concept (ex a 1000m  resolution node would 
++	#be made of 1000*1000 area squares). 
++
++	#Check that mesh was not already run, and warn user: 
++	if md.mesh.numberofelements != 0.:
++		choice = input('This model already has a mesh. Are you sure you want to go ahead? (y/n)')
++		if choice != 'y':
++			print 'no meshing done ... exiting'
++			return []
++		
++	area = resolution**2.
++
++	#Mesh using TriMesh
++	[md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers]=tm.TriMesh(domainname,riftname,area)
++
++
++	#Fill in rest of fields:
++	md.mesh.numberofelements = len(md.mesh.elements)
++	md.mesh.numberofvertices = len(md.mesh.x)
++	md.mesh.z = zeros(md.mesh.numberofvertices)
++	md.mesh.vertexonboundary = zeros(md.mesh.numberofvertices)
++	md.mesh.vertexonboundary[md.mesh.segments[:,0:2].astype(int)-1] = 1.
++	md.mesh.vertexonbed = ones(md.mesh.numberofvertices)
++	md.mesh.vertexonsurface = ones(md.mesh.numberofvertices)
++	md.mesh.elementonbed = ones(md.mesh.numberofelements)
++	md.mesh.elementonsurface = ones(md.mesh.numberofelements)
++
++	#Now, build the connectivity tables for this mesh.
++	[md.mesh.vertexconnectivity]= nc.NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)
++	[md.mesh.elementconnectivity] = ec.ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)
++	
++	#type of model
++	md.mesh.dimension = 2.
++	return md
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/triangle.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/triangle.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/triangle.m	(revision 13009)
+@@ -0,0 +1,82 @@
++function md=triangle(md,domainname,varargin)
++%TRIANGLE - create model mesh using the triangle package
++%
++%   This routine creates a model mesh using TriMesh and a domain outline, to within a certain resolution
++%   where md is a @model object, domainname is the name of an Argus domain outline file, 
++%   and resolution is a characteristic length for the mesh (same unit as the domain outline
++%   unit). Riftname is an optional argument (Argus domain outline) describing rifts.
++%
++%   Usage:
++%      md=triangle(md,domainname,resolution)
++%   or md=triangle(md,domainname,riftname, resolution)
++%
++%   Examples:
++%      md=triangle(md,'DomainOutline.exp',1000);
++%      md=triangle(md,'DomainOutline.exp','Rifts.exp',1500);
++
++%Figure out a characteristic area. Resolution is a node oriented concept (ex a 1000m  resolution node would 
++%be made of 1000*1000 area squares). 
++if (nargin==3),
++	resolution=varargin{1};
++	riftname='';
++end
++if (nargin==4),
++	riftname=varargin{1};
++	resolution=varargin{2};
++end
++
++%Check that mesh was not already run, and warn user: 
++if md.mesh.numberofelements~=0,
++	choice=input('This model already has a mesh. Are you sure you want to go ahead? (y/n)','s');
++	if ~strcmp(choice,'y')
++		disp('no meshing done ... exiting');
++		return
++	end
++end
++
++area=resolution^2;
++
++%Mesh using TriMesh
++[elements,x,y,segments,segmentmarkers]=TriMesh(domainname,riftname,area);
++
++%check that all the created nodes belong to at least one element
++orphan=find(~ismember([1:length(x)],sort(unique(elements(:)))));
++for i=1:length(orphan),
++	disp('WARNING: removing orphans');
++	%get rid of the orphan node i
++	%update x and y
++	x=[x(1:orphan(i)-(i-1)-1); x(orphan(i)-(i-1)+1:end)];
++	y=[y(1:orphan(i)-(i-1)-1); y(orphan(i)-(i-1)+1:end)];
++	%update elements
++	pos=find(elements>orphan(i)-(i-1));
++	elements(pos)=elements(pos)-1;
++	%update segments
++	pos1=find(segments(:,1)>orphan(i)-(i-1));
++	pos2=find(segments(:,2)>orphan(i)-(i-1));
++	segments(pos1,1)=segments(pos1,1)-1;
++	segments(pos2,2)=segments(pos2,2)-1;
++end
++
++%plug into md
++md.mesh.x=x;
++md.mesh.y=y;
++md.mesh.elements=elements;
++md.mesh.segments=segments;
++md.mesh.segmentmarkers=segmentmarkers;
++
++%Fill in rest of fields:
++md.mesh.numberofelements=length(md.mesh.elements);
++md.mesh.numberofvertices=length(md.mesh.x);
++md.mesh.z=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
++md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
++md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
++md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
++md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
++
++%Now, build the connectivity tables for this mesh.
++md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++
++%type of model
++md.mesh.dimension=2;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/bamg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/bamg.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/bamg.m	(revision 13009)
+@@ -0,0 +1,483 @@
++function md=bamg(md,varargin)
++%BAMG - mesh generation
++%
++%   Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
++%
++%   - domain :            followed by an ARGUS file that prescribes the domain outline
++%   - hmin :              minimum edge length (default is 10^-100)
++%   - hmax :              maximum edge length (default is 10^100)
++%   - hVertices :         imposed edge length for each vertex (geometry or mesh)
++%   - hminVertices :      minimum edge length for each vertex (mesh)
++%   - hmaxVertices :      maximum edge length for each vertex (mesh)
++%
++%   - anisomax :          maximum ratio between the smallest and largest edges (default is 10^30)
++%   - coeff :             coefficient applied to the metric (2-> twice as many elements, default is 1)
++%   - cutoff :            scalar used to compute the metric when metric type 2 or 3 are applied
++%   - err :               error used to generate the metric from a field
++%   - errg :              geometric error (default is 0.1)
++%   - field :             field of the model that will be used to compute the metric
++%                         to apply several fields, use one column per field
++%   - gradation :         maximum ratio between two adjacent edges
++%   - Hessiantype :       0 -> use double P2 projection (default)
++%                         1 -> use Green formula
++%   - KeepVertices :      try to keep initial vertices when adaptation is done on an existing mesh (default 1)
++%   - MaxCornerAngle :    maximum angle of corners in degree (default is 10)
++%   - maxnbv :            maximum number of vertices used to allocate memory (default is 10^6)
++%   - maxsubdiv :         maximum subdivision of exisiting elements (default is 10)
++%   - metric :            matrix (numberofnodes x 3) used as a metric
++%   - Metrictype :        1 -> absolute error          c/(err coeff^2) * Abs(H)        (default)
++%                         2 -> relative error          c/(err coeff^2) * Abs(H)/max(s,cutoff*max(s))
++%                         3 -> rescaled absolute error c/(err coeff^2) * Abs(H)/(smax-smin)
++%   - nbjacoby :          correction used by Hessiantype=1 (default is 1)
++%   - nbsmooth :          number of metric smoothing procedure (default is 3)
++%   - omega :             relaxation parameter of the smoothing procedure (default is 1.8)
++%   - power :             power applied to the metric (default is 1)
++%   - splitcorners :      split triangles whuch have 3 vertices on the outline (default is 1)
++%   - geometricalmetric : take the geometry into account to generate the metric (default is 0)
++%   - verbose :           level of verbosity (default is 1)
++%
++%   - rifts :             followed by an ARGUS file that prescribes the rifts
++%   - toltip :            tolerance to move tip on an existing point of the domain outline
++%   - tracks :            followed by an ARGUS file that prescribes the tracks that the mesh will stick to
++%   - RequiredVertices :  mesh vertices that are required. [x,y,ref]; ref is optional
++%   - tol :               if the distance between 2 points of the domain outline is less than tol, they
++%                         will be merged
++%
++%   Examples:
++%      md=bamg(md,'domain','DomainOutline.exp','hmax',3000);
++%      md=bamg(md,'field',[md.inversion.vel_obs md.geometry.thickness],'hmax',20000,'hmin',1000);
++%      md=bamg(md,'metric',A,'hmin',1000,'hmax',20000,'gradation',3,'anisomax',1);
++
++%process options
++options=pairoptions(varargin{:});
++options=deleteduplicates(options,1);
++
++%initialize the structures required as input of Bamg
++bamg_options=struct();
++bamg_geometry=bamggeom;
++bamg_mesh=bamgmesh;
++
++% Bamg Geometry parameters {{{
++if exist(options,'domain'),
++
++	%Check that file exists
++	domainfile=getfieldvalue(options,'domain');
++	if ~exist(domainfile,'file') error(['bamg error message: file ' domainfile ' not found ']); end
++
++	%Build geometry 
++	domain=expread(domainfile);
++	count=0;
++	for i=1:length(domain),
++
++		%Check that the domain is closed
++		if (domain(i).x(1)~=domain(i).x(end) | domain(i).y(1)~=domain(i).y(end)),
++			error('bamg error message: all contours provided in ''domain'' should be closed');
++		end
++
++		%Checks that all holes are INSIDE the principle domain outline
++		if i>1,
++			flags=ContourToNodes(domain(i).x,domain(i).y,domain(1),0);
++			if any(~flags),
++				error('bamg error message: All holes should be stricly inside the principal domain');
++			end
++		end
++
++		%Add all points to bamg_geometry
++		nods=domain(i).nods-1; %the domain are closed 1=end;
++		bamg_geometry.Vertices=[bamg_geometry.Vertices; [domain(i).x(1:nods) domain(i).y(1:nods) ones(nods,1)]];
++		bamg_geometry.Edges   =[bamg_geometry.Edges;    [transpose(count+1:count+nods) transpose([count+2:count+nods count+1])  1*ones(nods,1)]];
++		if i>1, bamg_geometry.SubDomains=[bamg_geometry.SubDomains; 2 count+1 1 1]; end
++
++		%update counter
++		count=count+nods;
++	end
++
++	%take care of rifts
++	if exist(options,'rifts'),
++
++		%Check that file exists
++		riftfile=getfieldvalue(options,'rifts');
++		if ~exist(riftfile,'file')
++			error(['bamg error message: file ' riftfile ' not found ']);
++		end
++		rift=expread(riftfile);
++
++		for i=1:length(rift),
++
++			%detect wether all points of the rift are inside the domain
++			flags=ContourToNodes(rift(i).x,rift(i).y,domain(1),0);
++			if ~flags,
++				error('one Rift has all his points outside of the domain outline'),
++
++			elseif any(~flags),
++				%We LOTS of work to do
++				disp('Rift tip outside of or on the domain has been detected and is being processed...');
++
++				%check that only one point is outsie (for now)
++				if sum(~flags)~=1,
++					error('bamg error message: only one point outside of the domain is supported yet');
++				end
++
++				%Move tip outside to the first position
++				if flags(1)==0,
++					%OK, first point is outside (do nothing),
++				elseif (flags(end)==0),
++					rift(i).x=flipud(rift(i).x);
++					rift(i).y=flipud(rift(i).y);
++				else
++					error('bamg error message: only a rift tip can be outside of the domain');
++				end
++
++				%Get cordinate of intersection point
++				x1=rift(i).x(1); y1=rift(i).y(1);
++				x2=rift(i).x(2); y2=rift(i).y(2);
++				for j=1:length(domain(1).x)-1;
++					if SegIntersect([x1 y1; x2 y2],[domain(1).x(j) domain(1).y(j); domain(1).x(j+1) domain(1).y(j+1)]),
++
++						%Get position of the two nodes of the edge in domain
++						i1=j;
++						i2=mod(j+1,domain(1).nods);
++
++						%rift is crossing edge [i1 i2] of the domain
++						%Get coordinate of intersection point (http://mathworld.wolfram.com/Line-LineIntersection.html)
++						x3=domain(1).x(i1); y3=domain(1).y(i1);
++						x4=domain(1).x(i2); y4=domain(1).y(i2);
++						x=det([det([x1 y1; x2 y2])  x1-x2;det([x3 y3; x4 y4])  x3-x4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
++						y=det([det([x1 y1; x2 y2])  y1-y2;det([x3 y3; x4 y4])  y3-y4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
++
++						segdis= sqrt((x4-x3)^2+(y4-y3)^2);
++						tipdis=[sqrt((x-x3)^2+(y-y3)^2)  sqrt((x-x4)^2+(y-y4)^2)];
++
++						if (min(tipdis)/segdis) < getfieldvalue(options,'toltip',0),
++							disp('moving tip-domain intersection point');
++
++							%Get position of the closest point
++							if tipdis(1)>tipdis(2),
++								pos=i2;
++							else
++								pos=i1;
++							end
++
++							%This point is only in Vertices (number pos).
++							%OK, no we can add our own rift
++							nods=rift(i).nods-1;
++							bamg_geometry.Vertices=[bamg_geometry.Vertices; [rift(i).x(2:end) rift(i).y(2:end) ones(nods,1)]];
++							bamg_geometry.Edges=[bamg_geometry.Edges;...
++								pos count+1  (1+i);...
++								[transpose(count+1:count+nods-1) transpose([count+2:count+nods])  (1+i)*ones(nods-1,1)]];
++							count=count+nods;
++
++							break;
++
++						else
++							%Add intersection point to Vertices
++							bamg_geometry.Vertices=[bamg_geometry.Vertices; x y 1];
++							count=count+1;
++
++							%Decompose the crossing edge in 2 subedges
++							pos=find(bamg_geometry.Edges(:,1)==i1 & bamg_geometry.Edges(:,2)==i2);
++							if isempty(pos) error('bamg error message: a problem occured...'); end
++							bamg_geometry.Edges=[bamg_geometry.Edges(1:pos-1,:);...
++								bamg_geometry.Edges(pos,1) count                           bamg_geometry.Edges(pos,3);...
++								count                      bamg_geometry.Edges(pos,2)   bamg_geometry.Edges(pos,3);...
++								bamg_geometry.Edges(pos+1:end,:)];
++
++							%OK, no we can add our own rift
++							nods=rift(i).nods-1;
++							bamg_geometry.Vertices=[bamg_geometry.Vertices; [rift(i).x(2:end) rift(i).y(2:end) ones(nods,1)]];
++							bamg_geometry.Edges=[bamg_geometry.Edges;...
++								count  count+1  2 ;...
++								[transpose(count+1:count+nods-1) transpose([count+2:count+nods])  (1+i)*ones(nods-1,1)]];
++							count=count+nods;
++
++							break;
++						end
++					end
++				end
++			else
++				nods=rift(i).nods-1;
++				bamg_geometry.Vertices=[bamg_geometry.Vertices; [rift(i).x(:) rift(i).y(:) ones(nods+1,1)]];
++				bamg_geometry.Edges=[bamg_geometry.Edges; [transpose(count+1:count+nods) transpose([count+2:count+nods+1])  (1+i)*ones(nods,1)]];
++				count=count+nods+1;
++			end
++		end
++	end
++
++	%Deal with tracks
++	if exist(options,'tracks'),
++
++		%read tracks
++		track=getfieldvalue(options,'tracks');
++		if all(ischar(track)),
++			A=expread(track); 
++			track=[A.x A.y];
++		else
++			track=double(track); %for some reason, it is of class "single"
++		end
++		if(size(track,2)==2), track=[track 3*ones(size(track,1),1)]; end
++
++		%only keep those inside
++		flags=ContourToNodes(track(:,1),track(:,2),domainfile,0);
++		track=track(find(flags),:);
++
++		%Add all points to bamg_geometry
++		nods=size(track,1);
++		bamg_geometry.Vertices=[bamg_geometry.Vertices; track];
++		bamg_geometry.Edges=[bamg_geometry.Edges; [transpose(count+1:count+nods-1) transpose([count+2:count+nods])  3*ones(nods-1,1)]];
++
++		%update counter
++		count=count+nods;
++	end
++
++	%Deal with vertices that need to be kept by mesher
++	if exist(options,'RequiredVertices'),
++
++		%recover RequiredVertices
++		requiredvertices=double(getfieldvalue(options,'RequiredVertices')); %for some reason, it is of class "single"
++		if(size(requiredvertices,2)==2), requiredvertices=[requiredvertices 4*ones(size(requiredvertices,1),1)]; end
++	
++		%only keep those inside
++		flags=ContourToNodes(requiredvertices(:,1),requiredvertices(:,2),domain(1),0);
++		requiredvertices=requiredvertices(find(flags),:);
++
++		%Add all points to bamg_geometry
++		nods=size(requiredvertices,1);
++		bamg_geometry.Vertices=[bamg_geometry.Vertices; requiredvertices];
++
++		%update counter
++		count=count+nods;
++
++	end
++
++	%process geom
++	%bamg_geometry=processgeometry(bamg_geometry,getfieldvalue(options,'tol',NaN),domain(1));
++
++elseif isstruct(md.private.bamg) & isfield(md.private.bamg,'geometry'),
++	bamg_geometry=bamggeom(md.private.bamg.geometry); 
++else
++	%do nothing...
++end
++%}}}
++% Bamg Mesh parameters {{{
++if (~exist(options,'domain') & md.mesh.numberofvertices~=0 & md.mesh.dimension==2),
++
++	if isstruct(md.private.bamg) & isfield(md.private.bamg,'mesh'),
++		bamg_mesh=bamgmesh(md.private.bamg.mesh);
++	else
++		bamg_mesh.Vertices=[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)];
++		bamg_mesh.Triangles=[md.mesh.elements ones(md.mesh.numberofelements,1)];
++	end
++
++	if isstruct(md.rifts.riftstruct)
++		error('bamg error message: rifts not supported yet. Do meshprocessrift AFTER bamg');
++	end
++end
++%}}}
++% Bamg Options {{{
++bamg_options.Crack=getfieldvalue(options,'Crack',0);
++bamg_options.anisomax=getfieldvalue(options,'anisomax',10^30);
++bamg_options.coeff=getfieldvalue(options,'coeff',1);
++bamg_options.cutoff=getfieldvalue(options,'cutoff',10^-5);
++bamg_options.err=getfieldvalue(options,'err',0.01);
++bamg_options.errg=getfieldvalue(options,'errg',0.1);
++bamg_options.field=getfieldvalue(options,'field',[]);
++bamg_options.gradation=getfieldvalue(options,'gradation',1.5);
++bamg_options.Hessiantype=getfieldvalue(options,'Hessiantype',0);
++bamg_options.hmin=getfieldvalue(options,'hmin',10^-100);
++bamg_options.hmax=getfieldvalue(options,'hmax',10^100);
++bamg_options.hminVertices=getfieldvalue(options,'hminVertices',[]);
++bamg_options.hmaxVertices=getfieldvalue(options,'hmaxVertices',[]);
++bamg_options.hVertices=getfieldvalue(options,'hVertices',[]);
++bamg_options.KeepVertices=getfieldvalue(options,'KeepVertices',1);
++bamg_options.MaxCornerAngle=getfieldvalue(options,'MaxCornerAngle',10);
++bamg_options.maxnbv=getfieldvalue(options,'maxnbv',10^6);
++bamg_options.maxsubdiv=getfieldvalue(options,'maxsubdiv',10);
++bamg_options.metric=getfieldvalue(options,'metric',[]);
++bamg_options.Metrictype=getfieldvalue(options,'Metrictype',0);
++bamg_options.nbjacobi=getfieldvalue(options,'nbjacobi',1);
++bamg_options.nbsmooth=getfieldvalue(options,'nbsmooth',3);
++bamg_options.omega=getfieldvalue(options,'omega',1.8);
++bamg_options.power=getfieldvalue(options,'power',1);
++bamg_options.splitcorners=getfieldvalue(options,'splitcorners',1);
++bamg_options.geometricalmetric=getfieldvalue(options,'geometricalmetric',0);
++bamg_options.verbose=getfieldvalue(options,'verbose',1);
++%}}}
++
++%call Bamg
++[bamgmesh_out bamggeom_out]=BamgMesher(bamg_mesh,bamg_geometry,bamg_options);
++
++% plug results onto model
++md.private.bamg=struct();
++md.private.bamg.mesh=bamgmesh(bamgmesh_out);
++md.private.bamg.geometry=bamggeom(bamggeom_out);
++md.mesh.x=bamgmesh_out.Vertices(:,1);
++md.mesh.y=bamgmesh_out.Vertices(:,2);
++md.mesh.elements=bamgmesh_out.Triangles(:,1:3);
++md.mesh.edges=bamgmesh_out.IssmEdges;
++md.mesh.segments=bamgmesh_out.IssmSegments(:,1:3);
++md.mesh.segmentmarkers=bamgmesh_out.IssmSegments(:,4);
++
++%Fill in rest of fields:
++md.mesh.dimension=2;
++md.mesh.numberofelements=size(md.mesh.elements,1);
++md.mesh.numberofvertices=length(md.mesh.x);
++md.mesh.numberofedges=size(md.mesh.edges,1);
++md.mesh.z=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
++md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
++md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
++md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
++md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
++md.mesh.elementconnectivity=md.private.bamg.mesh.ElementConnectivity;
++md.mesh.elementconnectivity(find(isnan(md.mesh.elementconnectivity)))=0;
++
++%Check for orphan
++reshape(md.mesh.elements,3*md.mesh.numberofelements,1);
++(~ismember(1:md.mesh.numberofvertices,sort(unique(reshape(md.mesh.elements,3*md.mesh.numberofelements,1)))));
++if any(~ismember(1:md.mesh.numberofvertices,sort(unique(reshape(md.mesh.elements,3*md.mesh.numberofelements,1)))))
++	error('Output mesh has orphans. Decrease MaxCornerAngle to prevent outside points (ex: 0.01)');
++end
++end 
++
++function geom=processgeometry(geom,tol,outline); % {{{
++
++%Deal with edges
++disp('Checking Edge crossing...');
++i=0;
++while (i<size(geom.Edges,1)),
++
++	%edge counter
++	i=i+1;
++
++	%Get coordinates
++	x1=geom.Vertices(geom.Edges(i,1),1);
++	y1=geom.Vertices(geom.Edges(i,1),2);
++	x2=geom.Vertices(geom.Edges(i,2),1);
++	y2=geom.Vertices(geom.Edges(i,2),2);
++	color1=geom.Edges(i,3);
++
++	j=i; %test edges located AFTER i only
++	while (j<size(geom.Edges,1)),
++
++		%edge counter
++		j=j+1;
++
++		%Skip if the two edges already have a vertex in common
++		if any(ismember(geom.Edges(i,1:2),geom.Edges(j,1:2))),
++			continue
++		end
++
++		%Get coordinates
++		x3=geom.Vertices(geom.Edges(j,1),1);
++		y3=geom.Vertices(geom.Edges(j,1),2);
++		x4=geom.Vertices(geom.Edges(j,2),1);
++		y4=geom.Vertices(geom.Edges(j,2),2);
++		color2=geom.Edges(j,3);
++
++		%Check if the two edges are crossing one another
++		if SegIntersect([x1 y1; x2 y2],[x3 y3; x4 y4]),
++
++			%Get coordinate of intersection point (http://mathworld.wolfram.com/Line-LineIntersection.html)
++			x=det([det([x1 y1; x2 y2])  x1-x2;det([x3 y3; x4 y4])  x3-x4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
++			y=det([det([x1 y1; x2 y2])  y1-y2;det([x3 y3; x4 y4])  y3-y4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
++
++			%Add vertex to the list of vertices
++			geom.Vertices(end+1,:)=[x y min(color1,color2)];
++			id=size(geom.Vertices,1);
++
++			%Update edges i and j
++			edgei=geom.Edges(i,:);
++			edgej=geom.Edges(j,:);
++			geom.Edges(i,:)    =[edgei(1) id       edgei(3)];
++			geom.Edges(end+1,:)=[id       edgei(2) edgei(3)];
++			geom.Edges(j,:)    =[edgej(1) id       edgej(3)];
++			geom.Edges(end+1,:)=[id       edgej(2) edgej(3)];
++
++			%update current edge second tip
++			x2=x; y2=y;
++		end
++	end
++
++end
++
++%Check point outside
++disp('Checking for points outside the domain...');
++i=0;
++num=0;
++while (i<size(geom.Vertices,1)),
++
++	%vertex counter
++	i=i+1;
++
++	%Get coordinates
++	x=geom.Vertices(i,1);
++	y=geom.Vertices(i,2);
++	color=geom.Vertices(i,3);
++
++	%Check that the point is inside the domain
++	if (color~=1 & ~ContourToNodes(x,y,outline(1),1)),
++
++		%Remove points from list of Vertices
++		num=num+1;
++		geom.Vertices(i,:)=[];
++
++		%update edges
++		[posedges dummy]=find(geom.Edges==i);
++		geom.Edges(posedges,:)=[];
++		posedges=find(geom.Edges>i);
++		geom.Edges(posedges)=geom.Edges(posedges)-1;
++
++		%update counter
++		i=i-1;
++	end
++end
++if num,
++	disp(['WARNING: ' num2str(num) ' points outside the domain outline have been removed']);
++end
++
++%Check point spacing
++if ~isnan(tol),
++	disp('Checking point spacing...');
++	i=0;
++	while (i<size(geom.Vertices,1)),
++
++		%vertex counter
++		i=i+1;
++
++		%Get coordinates
++		x1=geom.Vertices(i,1);
++		y1=geom.Vertices(i,2);
++
++		j=i; %test edges located AFTER i only
++		while (j<size(geom.Vertices,1)),
++
++			%vertex counter
++			j=j+1;
++
++			%Get coordinates
++			x2=geom.Vertices(j,1);
++			y2=geom.Vertices(j,2);
++
++			%Check whether the two vertices are too close
++			if ((x2-x1)^2+(y2-y1)^2<tol^2)
++
++				%Remove points from list of Vertices
++				geom.Vertices(j,:)=[];
++
++				%update edges
++				posedges=find(ismember(geom.Edges,j));
++				geom.Edges(posedges)=i;
++				posedges=find(geom.Edges>j);
++				geom.Edges(posedges)=geom.Edges(posedges)-1;
++
++				%update counter
++				j=j-1;
++
++			end
++		end
++	end
++end
++%remove empty edges
++geom.Edges(find(geom.Edges(:,1)==geom.Edges(:,2)),:)=[];
++end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/yams.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/yams.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/yams.m	(revision 13009)
+@@ -0,0 +1,171 @@
++function md=yams(md,varargin);
++%MESHYAMS - Build model of Antarctica by refining according to observed velocity error estimator
++%
++%   Usage:
++%      md=yams(md,varargin);
++%      where varargin is a lit of paired arguments. 
++%      arguments can be: 'domainoutline': Argus file containing the outline of the domain to be meshed
++%      arguments can be: 'velocities': matlab file containing the velocities [m/yr]
++%      optional arguments: 'groundeddomain': Argus file containing the outline of the grounded ice
++%                          this option is used to minimize the metric on water (no refinement)
++%      optional arguments: 'resolution': initial mesh resolution [m]
++%      optional arguments: 'nsteps': number of steps of mesh adaptation
++%      optional arguments: 'epsilon': average interpolation error wished [m/yr]
++%      optional arguments: 'hmin': minimum edge length
++%      optional arguments: 'hmanx': maximum edge
++%      optional arguments: 'riftoutline': if rifts are present, specifies rift outline file.
++%      
++%
++%   Examples:
++%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat');
++%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat','groundeddomain','ground.exp');
++%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat','groundeddomain','ground.exp','nsteps',6,'epsilon',2,'hmin',500,'hmax',30000);
++
++%recover options
++options=pairoptions(varargin{:});
++options=deleteduplicates(options,1);
++
++%recover some fields
++disp('MeshYams Options:')
++domainoutline=getfieldvalue(options,'domainoutline');
++disp(sprintf('   %-15s: ''%s''','DomainOutline',domainoutline));
++riftoutline=getfieldvalue(options,'riftoutline','N/A');
++disp(sprintf('   %-15s: ''%s''','riftoutline',riftoutline));
++groundeddomain=getfieldvalue(options,'groundeddomain','N/A');
++disp(sprintf('   %-15s: ''%s''','GroundedDomain',groundeddomain));
++velocities=getfieldvalue(options,'velocities');
++disp(sprintf('   %-15s: ''%s''','Velocities',velocities));
++resolution=getfieldvalue(options,'resolution',5000);
++disp(sprintf('   %-15s: %f','Resolution',resolution));
++nsteps=getfieldvalue(options,'nsteps',6);
++disp(sprintf('   %-15s: %i','nsteps',nsteps));
++gradation=getfieldvalue(options,'gradation',2*ones(nsteps,1));
++disp(sprintf('   %-15s: %g','gradation',gradation(1)));
++epsilon=getfieldvalue(options,'epsilon',3);
++disp(sprintf('   %-15s: %f','epsilon',epsilon));
++hmin=getfieldvalue(options,'hmin',500);
++disp(sprintf('   %-15s: %f','hmin',hmin));
++hmax=getfieldvalue(options,'hmax',150*10^3);
++disp(sprintf('   %-15s: %f\n','hmax',hmax));
++
++%mesh with initial resolution
++disp('Initial mesh generation...');
++if strcmpi(riftoutline,'N/A');
++	md=setmesh(md,domainoutline,resolution);
++else
++	md=setmesh(md,domainoutline,riftoutline,resolution);
++	md=meshprocessrifts(md,domainoutline);
++end
++disp(['Initial mesh, number of elements: ' num2str(md.mesh.numberofelements)]);
++
++%load velocities 
++disp('loading velocities...');
++Names=VelFindVarNames(velocities);
++Vel=load(velocities);
++
++%start mesh adaptation
++for i=1:nsteps,
++	disp(['Iteration #' num2str(i) '/' num2str(nsteps)]);
++
++	%interpolate velocities onto mesh
++	disp('   interpolating velocities...');
++	if strcmpi(Names.interp,'node'),
++		vx_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
++		vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
++	else
++		vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
++		vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
++	end
++	field=sqrt(vx_obs.^2+vy_obs.^2);
++
++	%set mask.vertexonwater  field
++	if ~strcmp(groundeddomain,'N/A'),
++		nodeground=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,groundeddomain,'node',2);
++		md.mask.vertexonwater=ones(md.mesh.numberofvertices,1);
++		md.mask.vertexonwater(find(nodeground))=0;
++	else
++		md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
++	end
++
++	%adapt according to velocities
++	disp('   adapting...');
++	md=YamsCall(md,field,hmin,hmax,gradation(i),epsilon);
++
++	%if we have rifts, we just messed them up, we need to recreate the segments that constitute those 
++	%rifts, because the segments are used in YamsCall to freeze the rifts elements during refinement.
++	if md.rifts.numrifts, 
++		md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++		md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++		md.mesh.segments=findsegments(md);
++		md=yamsrecreateriftsegments(md);
++	end
++
++end
++	
++disp(['Final mesh, number of elements: ' num2str(md.mesh.numberofelements)]);
++
++%Now, build the connectivity tables for this mesh.
++md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++
++%recreate segments
++md.mesh.segments=findsegments(md);
++md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
++
++%Fill in rest of fields:
++md.mesh.z=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
++md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
++md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
++md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
++if ~strcmp(groundeddomain,'N/A'),
++	nodeground=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,groundeddomain,'node',2);
++	md.mask.vertexonwater=ones(md.mesh.numberofvertices,1);
++	md.mask.vertexonwater(find(nodeground))=0;
++else
++	md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
++end
++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);
++else
++	md.inversion.vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
++	md.inversion.vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
++end
++md.inversion.vel_obs=sqrt(md.inversion.vx_obs.^2+md.inversion.vy_obs.^2);
++
++%deal with rifts 
++if md.rifts.numrifts,
++	%first, recreate rift segments
++	md=meshyamsrecreateriftsegments(md);
++
++	%using the segments, recreate the penaltypairs
++	for j=1:md.rifts.numrifts,
++		rift=md.rifts.riftstruct(j);
++
++		%build normals and lengths of segments:
++		lengths=sqrt((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))).^2 + (md.mesh.y(rift.segments(:,1))-md.mesh.y(rift.segments(:,2))).^2 );
++		normalsx=cos(atan2((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))) , (md.mesh.y(rift.segments(:,2))-md.mesh.y(rift.segments(:,1)))));
++		normalsy=sin(atan2((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))) , (md.mesh.y(rift.segments(:,2))-md.mesh.y(rift.segments(:,1)))));
++
++		%ok, build penaltypairs: 
++		numpenaltypairs=length(rift.segments)/2-1;
++		rift.penaltypairs=zeros(numpenaltypairs,7);
++
++		for i=1:numpenaltypairs,
++			rift.penaltypairs(i,1)=rift.segments(i,2);
++			rift.penaltypairs(i,2)=rift.segments(end-i,2);
++			rift.penaltypairs(i,3)=rift.segments(i,3);
++			rift.penaltypairs(i,4)=rift.segments(end-i,3);
++			rift.penaltypairs(i,5)=normalsx(i)+normalsx(i+1);
++			rift.penaltypairs(i,6)=normalsy(i)+normalsy(i+1);
++			rift.penaltypairs(i,7)=(lengths(i)+lengths(i+1))/2;
++		end
++		%renormalize norms: 
++		norms=sqrt(rift.penaltypairs(:,5).^2+rift.penaltypairs(:,6).^2);
++		rift.penaltypairs(:,5)=rift.penaltypairs(:,5)./norms;
++		rift.penaltypairs(:,6)=rift.penaltypairs(:,6)./norms;
++
++		md.rifts.riftstruct(j)=rift;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/print/printmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/print/printmodel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/print/printmodel.m	(revision 13009)
+@@ -0,0 +1,100 @@
++function printmodel(filename,format,varargin)
++%PRINTMODEL - save an image of current figure
++%
++%   filename: output name of image file (no extension)
++%   format: image format (ex: 'tiff','jpg','pdf') 
++%
++%   List of options to printfmodel: 
++%
++%   figure: number of figure to print (default: current figure)
++%   resolution: use higher resolution to anti-alias (default 2)
++%   margin: add margin around final image  
++%   marginsize: size of margin around final image (default 5)
++%   frame: add frame around final image
++%   framesize: size of frame around final image (default 5)
++%   framecolor: color of frame around final image (default 'black')
++%   trim: trim empty space around image (default 'off')
++%   hardcopy: 'off' to impose MATLAB to use the same colors (default 'off')
++%   
++%   Usage:
++%      printmodel(filename,format,varargin);
++%
++%   Examples:
++%      printmodel('image','tiff')
++%      printmodel('image','eps','margin','on','frame','on','hardcopy','on')
++
++
++%get options: 
++options=pairoptions(varargin{:});
++
++%set defaults
++options=addfielddefault(options,'figure','gcf');
++options=addfielddefault(options,'format','tiff');
++options=addfielddefault(options,'resolution',1);
++options=addfielddefault(options,'margin','on');
++options=addfielddefault(options,'marginsize',25);
++options=addfielddefault(options,'frame','on');
++options=addfielddefault(options,'framesize',3);
++options=addfielddefault(options,'framecolor','black');
++options=addfielddefault(options,'trim','on');
++options=addfielddefault(options,'hardcopy','off');
++
++%get fig: 
++fig=getfieldvalue(options,'figure');
++if ischar(fig),
++	fig=gcf;
++else
++	figure(fig);
++	fig=gcf;
++end
++
++%In auto mode, MATLAB prints the figure the same size as it appears on the computer screen, centered on the page
++set(fig, 'PaperPositionMode', 'auto');
++
++%InvertHardcopy off imposes MATLAB to use the same colors
++set(fig, 'InvertHardcopy', getfieldvalue(options,'hardcopy'));
++
++
++%we could have several formats, as a cell array of strings.
++formats=format;
++if ~iscell(formats),
++	formats={formats};
++end
++
++%loop on formats:
++for i=1:length(formats),
++	format=formats{i};
++
++	%Use higher resolution to anti-alias and use zbuffer to have smooth colors
++	print(fig, '-zbuffer','-dtiff',['-r' num2str(get(0,'ScreenPixelsPerInch')*getfieldvalue(options,'resolution'))],filename);
++
++	%some trimming involved? 
++	if ~strcmpi(format,'pdf'),
++		if strcmpi(getfieldvalue(options,'trim'),'on'),
++			system(['convert -trim ' filename '.tif ' filename '.tif']);
++		end
++	end
++
++	%margin?
++	if ~strcmpi(format,'pdf'),
++		if strcmpi(getfieldvalue(options,'margin'),'on'),
++			marginsize=getfieldvalue(options,'marginsize');
++			system(['convert -border ' num2str(marginsize) 'x' num2str(marginsize) ' -bordercolor "white" ' filename '.tif ' filename '.tif']);
++		end
++	end
++
++	%frame?
++	if ~strcmpi(format,'pdf'),
++		if strcmpi(getfieldvalue(options,'frame'),'on'),
++			framesize=getfieldvalue(options,'framesize');
++			framecolor=getfieldvalue(options,'framecolor');
++			system(['convert -border ' num2str(framesize) 'x' num2str(framesize) ' -bordercolor "' framecolor '" ' filename '.tif ' filename '.tif']);
++		end
++	end
++
++	%convert image to correct format
++	if ~strcmpi(format,'tiff') & ~strcmpi(format,'tif'),
++		system(['convert ' filename '.tif ' filename '.' format]);
++		delete([ filename '.tif']);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/stokesoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/stokesoptions.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/stokesoptions.m	(revision 13009)
+@@ -0,0 +1,28 @@
++function stokes=stokesoptions(varargin)
++%STOKESOPTIONS - return STOKES multi-physics solver petsc options
++%
++%   Usage:
++%      options=stokesoptions;
++
++%retrieve options provided in varargin
++options=pairoptions(varargin{:});
++stokes=struct();
++
++%default stokes options
++PETSC_VERSION=petscversion();
++if PETSC_VERSION==2,
++	error('stokesoptions error message: multi-physics options not supported in Petsc 2');
++end
++if PETSC_VERSION==3,
++	stokes.mat_type=getfieldvalue(options,'mat_type','mpiaij');
++	stokes.ksp_max_it=getfieldvalue(options,'ksp_max_it',1000);
++	stokes.ksp_type=getfieldvalue(options,'ksp_type','gmres');
++	stokes.pc_type=getfieldvalue(options,'pc_type','fieldsplit');
++	stokes.pc_field_split_type=getfieldvalue(options,'pc_field_split_type','schur');
++	stokes.fieldsplit_0_pc_type=getfieldvalue(options,'fieldsplit_0_pc_type','hypre');
++	stokes.fieldsplit_0_ksp_type=getfieldvalue(options,'fieldsplit_0_ksp_type','gmres');
++	stokes.fieldsplit_0_pc_hypre_type=getfieldvalue(options,'fieldsplit_0_pc_hypre_type','boomerang');
++	stokes.fieldsplit_1_pc_type=getfieldvalue(options,'fieldsplit_1_pc_type','jacobi');
++	stokes.fieldsplit_1_ksp_type=getfieldvalue(options,'fieldsplit_1_ksp_type','preonly');
++	stokes.issm_option_solver=getfieldvalue(options,'issm_option_solver','stokes');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/asmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/asmoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/asmoptions.py	(revision 13009)
+@@ -0,0 +1,31 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def asmoptions(*args):
++	#ASMOPTIONS - return ASM petsc options
++	#
++	#   Usage:
++	#      options=asmoptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++	
++	options=[['mat_type','aij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','lu'],['pc_asm_overlap',3],['ksp_max_it',100],['ksp_rtol',1e-30]];
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/asmoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/asmoptions.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/asmoptions.m	(revision 13009)
+@@ -0,0 +1,18 @@
++function asm=asmoptions(varargin)
++%ASMOPTIONS - return Additive Shwartz Method petsc options
++%
++%   Usage:
++%      options=asmoptions;
++			 
++%retrieve options provided in varargin
++options=pairoptions(varargin{:});
++asm=struct();
++
++%default asm options
++asm.mat_type=getfieldvalue(options,'mat_type','aij');
++asm.ksp_type=getfieldvalue(options,'ksp_type','gmres');
++asm.pc_type=getfieldvalue(options,'pc_type','asm');
++asm.sub_pc_type=getfieldvalue(options,'sub_pc_type','lu');
++asm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',3);
++asm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
++asm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-30);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobiasmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobiasmoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobiasmoptions.py	(revision 13009)
+@@ -0,0 +1,31 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def jacobiasmoptions(*args):
++	#ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
++	#
++	#   Usage:
++	#      options=jacobiasmoptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++	
++	options=[['mat_type','aij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','jacobi'],['pc_asm_overlap',3],['ksp_max_it',100],['ksp_rtol',1e-15]];
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/iluasmoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/iluasmoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/iluasmoptions.py	(revision 13009)
+@@ -0,0 +1,25 @@
++from pairoptions import *
++
++def iluasmoptions(*args):
++	"""
++	ILUASMOPTIONS - 
++
++	   Usage:
++	      options=iluasmoptions;
++	"""
++			 
++	#retrieve options provided in varargin
++	options=pairoptions(*args)
++	iluasm={}
++
++	#default iluasm options
++	iluasm['mat_type']=options.getfieldvalue('mat_type','aij')
++	iluasm['ksp_type']=options.getfieldvalue('ksp_type','gmres')
++	iluasm['pc_type']=options.getfieldvalue('pc_type','asm')
++	iluasm['sub_pc_type']=options.getfieldvalue('sub_pc_type','ilu')
++	iluasm['pc_asm_overlap']=options.getfieldvalue('pc_asm_overlap',5)
++	iluasm['ksp_max_it']=options.getfieldvalue('ksp_max_it',100)
++	iluasm['ksp_rtol']=options.getfieldvalue('ksp_rtol',1e-15)
++
++	return iluasm
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobiasmoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobiasmoptions.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobiasmoptions.m	(revision 13009)
+@@ -0,0 +1,18 @@
++function jacobiasm=jacobiasmoptions(varargin)
++%ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
++%
++%   Usage:
++%      options=jacobiasmoptions;
++			 
++%retrieve options provided in varargin
++options=pairoptions(varargin{:});
++jacobiasm=struct();
++
++%default jacobiasm options
++jacobiasm.mat_type=getfieldvalue(options,'mat_type','aij');
++jacobiasm.ksp_type=getfieldvalue(options,'ksp_type','gmres');
++jacobiasm.pc_type=getfieldvalue(options,'pc_type','asm');
++jacobiasm.sub_pc_type=getfieldvalue(options,'sub_pc_type','jacobi');
++jacobiasm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',3);
++jacobiasm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
++jacobiasm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-15);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/iluasmoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/iluasmoptions.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/iluasmoptions.m	(revision 13009)
+@@ -0,0 +1,18 @@
++function iluasm=iluasmoptions(varargin)
++%ILUASMOPTIONS - 
++%
++%   Usage:
++%      options=iluasmoptions;
++			 
++%retrieve options provided in varargin
++options=pairoptions(varargin{:});
++iluasm=struct();
++
++%default iluasm options
++iluasm.mat_type=getfieldvalue(options,'mat_type','aij');
++iluasm.ksp_type=getfieldvalue(options,'ksp_type','gmres');
++iluasm.pc_type=getfieldvalue(options,'pc_type','asm');
++iluasm.sub_pc_type=getfieldvalue(options,'sub_pc_type','ilu');
++iluasm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',5);
++iluasm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
++iluasm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-15);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/matlaboptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/matlaboptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/matlaboptions.py	(revision 13009)
+@@ -0,0 +1,31 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def matlaboptions(*args):
++	#MATLABOPTIONS - return Matlab petsc options
++	#
++	#   Usage:
++	#      options=matlaboptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++	
++	options=[['ksp_type','matlab']];
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobicgoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobicgoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobicgoptions.py	(revision 13009)
+@@ -0,0 +1,31 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def jacobicgoptions(*args):
++	#ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
++	#
++	#   Usage:
++	#      options=jacobicgoptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++	
++	options=[['mat_type','aij'],['ksp_type','cg'],['ksp_max_it',100],['ksp_rtol',1e-15]];
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/mumpsoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/mumpsoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/mumpsoptions.py	(revision 13009)
+@@ -0,0 +1,33 @@
++from pairoptions import *
++from petscversion import *
++
++def mumpsoptions(*args):
++	"""
++	MUMPSOPTIONS - return MUMPS direct solver  petsc options
++
++	   Usage:
++	      options=mumpsoptions;
++	"""
++
++	#retrieve options provided in varargin
++	options=pairoptions(*args)
++	mumps={}
++
++	#default mumps options
++	PETSC_VERSION=petscversion()
++	if PETSC_VERSION==2:
++		mumps['mat_type']=options.getfieldvalue('mat_type','aijmumps')
++		mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
++		mumps['pc_type']=options.getfieldvalue('pc_type','lu')
++		mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
++		mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
++	if PETSC_VERSION==3:
++		mumps['mat_type']=options.getfieldvalue('mat_type','mpiaij')
++		mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
++		mumps['pc_type']=options.getfieldvalue('pc_type','lu')
++		mumps['pc_factor_mat_solver_package']=options.getfieldvalue('pc_factor_mat_solver_package','mumps')
++		mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
++		mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
++
++	return mumps
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/soroptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/soroptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/soroptions.py	(revision 13009)
+@@ -0,0 +1,31 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def soroptions(*args):
++	#SOROPTIONS - return Relaxation Solver petsc options
++	#
++	#   Usage:
++	#      options=soroptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++	
++	options=[['mat_type','aij'],['ksp_type','cg'],['pc_type','sor'],['pc_sor_omega',1.1],['pc_sor_its',2]];
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/matlaboptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/matlaboptions.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/matlaboptions.m	(revision 13009)
+@@ -0,0 +1,12 @@
++function maltab=matlaboptions(varargin)
++%MATLABOPTIONS - return Matlab petsc options
++%
++%   Usage:
++%      options=matlaboptions;
++			 
++%retrieve options provided in varargin
++options=pairoptions(varargin{:});
++maltab=struct();
++
++%default matlab options
++maltab.ksp_type='matlab';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobicgoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobicgoptions.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/jacobicgoptions.m	(revision 13009)
+@@ -0,0 +1,15 @@
++function jacobicg=jacobiacgoptions(varargin)
++%ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
++%
++%   Usage:
++%      options=jacobiasmoptions;
++			 
++%retrieve options provided in varargin
++options=pairoptions(varargin{:});
++jacobicg=struct();
++
++%default jacobiasm options
++jacobicg.mat_type=getfieldvalue(options,'mat_type','aij');
++jacobicg.ksp_type=getfieldvalue(options,'ksp_type','cg');
++jacobicg.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
++jacobicg.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-15);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/mumpsoptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/mumpsoptions.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/mumpsoptions.m	(revision 13009)
+@@ -0,0 +1,27 @@
++function mumps=mumpsoptions(varargin)
++%MUMPSOPTIONS - return MUMPS direct solver  petsc options
++%
++%   Usage:
++%      options=mumpsoptions;
++
++%retrieve options provided in varargin
++options=pairoptions(varargin{:});
++mumps=struct();
++
++%default mumps options
++PETSC_VERSION=petscversion();
++if PETSC_VERSION==2,
++	mumps.mat_type=getfieldvalue(options,'mat_type','aijmumps');
++	mumps.ksp_type=getfieldvalue(options,'ksp_type','preonly');
++	mumps.pc_type=getfieldvalue(options,'pc_type','lu');
++	mumps.mat_mumps_icntl_14=getfieldvalue(options,'mat_mumps_icntl_14',120);
++	mumps.pc_factor_shift_positive_definite=getfieldvalue(options,'pc_factor_shift_positive_definite','true');
++end
++if PETSC_VERSION==3,
++	mumps.mat_type=getfieldvalue(options,'mat_type','mpiaij');
++	mumps.ksp_type=getfieldvalue(options,'ksp_type','preonly');
++	mumps.pc_type=getfieldvalue(options,'pc_type','lu');
++	mumps.pc_factor_mat_solver_package=getfieldvalue(options,'pc_factor_mat_solver_package','mumps');
++	mumps.mat_mumps_icntl_14=getfieldvalue(options,'mat_mumps_icntl_14',120);
++	mumps.pc_factor_shift_positive_definite=getfieldvalue(options,'pc_factor_shift_positive_definite','true');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/soroptions.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/soroptions.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/soroptions.m	(revision 13009)
+@@ -0,0 +1,16 @@
++function sor=soroptions(varargin)
++%SOROPTIONS - return Relaxation Solver petsc options
++%
++%   Usage:
++%      options=soroptions;
++			 
++%retrieve options provided in varargin
++options=pairoptions(varargin{:});
++sor=struct();
++
++%default sor options
++sor.mat_type=getfieldvalue(options,'mat_type','aij');
++sor.ksp_type=getfieldvalue(options,'ksp_type','cg');
++sor.pc_type=getfieldvalue(options,'pc_type','sor');
++sor.pc_sor_omega=getfieldvalue(options,'pc_sor_omega',1.1);
++sor.pc_sor_its=getfieldvalue(options,'pc_sor_its',2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/stokesoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/stokesoptions.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers/stokesoptions.py	(revision 13009)
+@@ -0,0 +1,40 @@
++#module imports {{{
++from pairoptions import *
++from petscversion  import *
++#}}}
++def stokesoptions(*args):
++	#STOKESOPTIONS - return STOKES multi-physics solver petsc options
++	#
++	#   Usage:
++	#      options=stokesoptions;
++	
++	#retrieve options provided in varargin
++	arguments=pairoptions(*args) 
++
++
++	#default stokes options
++	PETSC_VERSION=petscversion()
++
++	if PETSC_VERSION==2:
++		raise RuntimeError('stokesoptions error message: multi-physics options not supported in Petsc 2')
++	if PETSC_VERSION==3:
++		options=[['mat_type','mpiaij'],['ksp_max_it',1000],['ksp_type','gmres'],['pc_type','fieldsplit'],['pc_field_split_type','schur'],\
++	['fieldsplit_0_pc_type','hypre'],['fieldsplit_0_ksp_type','gmres'],['fieldsplit_0_pc_hypre_type','boomerang'],\
++	['fieldsplit_1_pc_type','jacobi'],['fieldsplit_1_ksp_type','preonly'],['issm_option_solver','stokes']]
++
++	#now, go through our arguments, and write over default options.
++	for i in range(len(arguments.list)):
++		arg1=arguments.list[i][0]
++		arg2=arguments.list[i][1]
++		found=0;
++		for j in range(len(options)):
++			joption=options[j][0]
++			if joption==arg1:
++				joption[1]=arg2;
++				options[j]=joption;
++				found=1;
++				break
++		if not found:
++			#this option did not exist, add it: 
++			options.append([arg1,arg2])
++	return options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers	(revision 13009)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solvers
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project2d.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project2d.m	(revision 13009)
+@@ -0,0 +1,36 @@
++function projection_value=project2d(md3d,value,layer)
++%PROJECT2D - returns the value of a field for a given layer of the mesh
++%
++%   project 'value' vector taken at layer 'layer' from extruded 2d-3d mesh onto 2d mesh 
++%   used to do the extrusion. This routine is used to compare values between a 2d-3d mesh
++%   at a certain layer, and the equivalent value (if it exists), on the original 2d mesh. 
++%   This routine relies heavily on projections (contained in 3d model md) recored during 
++%   the extrude operation.
++%
++%   Usage:
++%      projection_value=project2d(md3d,value,layer)
++%
++%   Example:
++%      vel2=project2d(md3d,md3d.vel,2);
++
++%some checks on list of arguments
++if ((nargin~=3) ),
++	help project2d
++	error('project2d error message');
++end
++
++if (md3d.mesh.dimension~=3),
++	error('wrong model type ... should be ''3d''');
++end
++
++if ((layer<1) | (layer>md3d.mesh.numberoflayers)),
++	error(['layer must be between 1 and ' num2str(md3d.mesh.numberoflayers)]);
++end
++
++if size(value,1)==md3d.mesh.numberofvertices,
++	projection_value=value((layer-1)*md3d.mesh.numberofvertices2d+1:layer*md3d.mesh.numberofvertices2d,:);
++elseif size(value,1)==md3d.mesh.numberofvertices+1,
++	projection_value=[value((layer-1)*md3d.mesh.numberofvertices2d+1:layer*md3d.mesh.numberofvertices2d,:); value(end,:)];
++else
++	projection_value=value((layer-1)*md3d.mesh.numberofelements2d+1:layer*md3d.mesh.numberofelements2d,:);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project3d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project3d.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project3d.m	(revision 13009)
+@@ -0,0 +1,82 @@
++function projected_vector=project3d(md,varargin);
++%PROJECT3D - vertically project a vector from 2d mesh
++%
++%   vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh.
++%   This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an 
++%   element vector of size (md.mesh.numberofelements2d,N/A). 
++%   arguments: 
++%      'vector': 2d vector
++%      'type': 'element' or 'node'. 
++%   options: 
++%      'layer' a layer number where vector should keep its values. If not specified, all layers adopt the 
++%             value of the 2d vector.
++%      'padding': default to 0 (value adopted by other 3d layers not being projected0
++%
++%   Egs:
++%      extruded_vector=project3d(md,'vector',vector2d,'type','node','layer',1,'padding',NaN);
++%      extruded_vector=project3d(md,'vector',vector2d,'type','element','padding',0);
++%      extruded_vector=project3d(md,'vector',vector2d,'type','node');
++
++%some regular checks
++if nargin==0,
++	help project3d
++	error('bad usage');
++end
++if md.mesh.dimension~=3
++	error('input model is not 3d');
++end
++
++%retrieve parameters from options.
++options      = pairoptions(varargin{:});
++vector2d     = getfieldvalue(options,'vector');     %mandatory
++type         = getfieldvalue(options,'type');       %mandatory
++layer        = getfieldvalue(options,'layer',0);    %optional (do all layers otherwise)
++paddingvalue = getfieldvalue(options,'padding',0);  %0 by default
++
++if length(vector2d)==1,
++	projected_vector=vector2d;
++elseif strcmpi(type,'node'),
++
++	%Initialize 3d vector
++	if size(vector2d,1)==md.mesh.numberofvertices2d
++		projected_vector=paddingvalue*ones(md.mesh.numberofvertices,  size(vector2d,2));
++	elseif size(vector2d,1)==md.mesh.numberofvertices2d+1
++		projected_vector=paddingvalue*ones(md.mesh.numberofvertices+1,size(vector2d,2));
++		projected_vector(end,:)=vector2d(end,:);
++		vector2d=vector2d(1:end-1,:);
++	else
++		error('vector length not supported')
++	end
++
++	%Fill in
++	if layer==0,
++		for i=1:md.mesh.numberoflayers,
++			projected_vector(((i-1)*md.mesh.numberofvertices2d+1):(i*md.mesh.numberofvertices2d),:)=vector2d;
++		end
++	else
++		projected_vector(((layer-1)*md.mesh.numberofvertices2d+1):(layer*md.mesh.numberofvertices2d),:)=vector2d;
++	end
++elseif strcmpi(type,'element'),
++
++	%Initialize 3d vector
++	if size(vector2d,1)==md.mesh.numberofelements2d
++		projected_vector=paddingvalue*ones(md.mesh.numberofelements,  size(vector2d,2));
++	elseif size(vector2d,1)==md.mesh.numberofelements2d+1
++		projected_vector=paddingvalue*ones(md.mesh.numberofelements+1,size(vector2d,2));
++		projected_vector(end,:)=vector2d(end,:);
++		vector2d=vector2d(1:end-1,:);
++	else
++		error('vector length not supported')
++	end
++
++	if layer==0,
++		for i=1:(md.mesh.numberoflayers-1),
++			projected_vector( ((i-1)*md.mesh.numberofelements2d+1):(i*md.mesh.numberofelements2d),:)=vector2d;
++		end
++
++	else
++		projected_vector( ((layer-1)*md.mesh.numberofelements2d+1):(layer*md.mesh.numberofelements2d),:)=vector2d;
++	end
++else
++	error('project3d error message: unknown projection type');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/DepthAverage.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/DepthAverage.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/DepthAverage.m	(revision 13009)
+@@ -0,0 +1,33 @@
++function  vector_average=DepthAverage(md,vector);
++%DEPTHAVERAGE - computes depth average of 3d vector, and return value on 2d mesh. 
++%
++%   Usage:
++%      vector_average=DepthAverage(md,vector);
++%
++%   Example:
++%      vel_bar=DepthAverage(md,md.initialization.vel);
++
++%check that the model given in input is 3d
++if ~md.mesh.dimension==3;
++	error('DepthAverage error message: the model given in input must be 3d')
++end
++
++%nods data
++if (length(vector)==md.mesh.numberofvertices),
++	vector_average=zeros(md.mesh.numberofvertices2d,1);
++	for i=1:md.mesh.numberoflayers-1,
++		vector_average=vector_average+(project2d(md,vector,i)+project2d(md,vector,i+1))/2.*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
++	end
++	vector_average=vector_average./project2d(md,md.geometry.thickness,1);
++
++%element data
++elseif (length(vector)==md.mesh.numberofelements),
++	vector_average=zeros(md.mesh.numberofelements2d,1);
++	for i=1:md.mesh.numberoflayers-1,
++		vector_average=vector_average+project2d(md,vector,i).*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
++	end
++	vector_average=vector_average./project2d(md,md.geometry.thickness,1);
++
++else
++	error('vector size not supported yet');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/sia.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/sia.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/sia.m	(revision 13009)
+@@ -0,0 +1,26 @@
++function [velx,vely,vel]=sia(md)
++%BALVEL - computation of Shallow Ice velocities
++%
++%   This routine uses the model of Hutter to compute the velocities
++%   of a 2d model using the surface slope
++%
++%   Usage:
++%      [velx,vely,vel]=sia(md)
++
++if md.mesh.dimension~=2,
++	error('Only 2d meshes are allowed to compute velocity balances');
++end
++
++%Get slope
++[sx,sy,s]=slope(md);
++
++%Average thickness and B over all elements.
++summer=[1;1;1];
++hel=md.geometry.thickness(md.mesh.elements)*summer/3;
++Bel=md.B(md.mesh.elements)*summer/3;
++
++Ael=Bel.^(-3);
++
++velx=-2*(md.materials.rho_ice*md.constants.g)^3*s.^2.*sx.*Ael/4.*hel.^4;
++vely=-2*(md.materials.rho_ice*md.constants.g)^3*s.^2.*sy.*Ael/4.*hel.^4;
++vel=sqrt(velx.^2+vely.^2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/BasinConstrain.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/BasinConstrain.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/BasinConstrain.m	(revision 13009)
+@@ -0,0 +1,63 @@
++function md=BasinConstrain(md,domain);
++%BASINCONSTRAIN - constrain basin
++%
++%   Constrain basin using a constraint domain outline, 
++%   to dirichlet boundary conditions.
++%   constraindomain is an Argus domain outline file enclosing 
++%   the geographical area of interest.
++%
++%   Usage: 
++%      md=BasinConstrain(md,constraindomain)
++%
++%   Example:
++%      md=BasinConstrain(md,'DomainOutline.exp');
++%      md=BasinConstrain(md,'~Iceshelves.exp');
++
++%now, flag nodes and elements outside the domain outline.
++if ischar(domain),
++	if isempty(domain),
++		elementondomain=zeros(md.mesh.numberofelements,1);
++		vertexondomain=zeros(md.mesh.numberofvertices,1);
++		invert=0;
++	elseif strcmpi(domain,'all')
++		elementondomain=ones(md.mesh.numberofelements,1);
++		vertexondomain=ones(md.mesh.numberofvertices,1);
++		invert=0;
++	else
++		%make sure that we actually don't want the elements outside the domain outline!
++		if strcmpi(domain(1),'~'),
++			domain=domain(2:end);
++			invert=1;
++		else
++			invert=0;
++		end
++		%ok, flag elements and nodes
++		[vertexondomain elementondomain]=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,domain,'element and node',2);
++	end
++	if invert,
++		vertexondomain=~vertexondomain;
++		elementondomain=~elementondomain;
++	end
++else
++	error('BasinConstrain error message: domain type not supported yet');
++end
++
++%list of elements and nodes not on domain
++vertexnotondomain=find(~vertexondomain);
++elementnotondomain=find(~elementondomain);
++
++%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
++md.diagnostic.spcvx(vertexnotondomain)=md.inversion.vx_obs(vertexnotondomain);
++md.diagnostic.spcvy(vertexnotondomain)=md.inversion.vy_obs(vertexnotondomain);
++md.mask.elementonwater(elementnotondomain)=1;
++
++%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
++pos=find(~md.mask.elementonwater);
++numpos=unique(md.mesh.elements(pos,:));
++nodes=setdiff(1:1:md.mesh.numberofvertices,numpos);
++md.diagnostic.spcvx(nodes)=md.inversion.vx_obs(nodes);
++md.diagnostic.spcvy(nodes)=md.inversion.vy_obs(nodes);
++
++%make sure icefronts that are completely spc'd are taken out:
++free_segments=find((~isnan(md.diagnostic.spcvx(md.diagnostic.icefront(:,1:2))) + ~isnan(md.diagnostic.spcvy(md.diagnostic.icefront(:,1:2))))~=2);
++md.diagnostic.icefront=md.diagnostic.icefront(free_segments,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/regionaltransient2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/regionaltransient2d.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/regionaltransient2d.m	(revision 13009)
+@@ -0,0 +1,158 @@
++function md2=regionaltransient2d(md1,area,hmin,hmax,err,stepres)
++%regionaltransient2d - extract a model according to an Argus contour or flag list and remesh
++%               at new resolution res
++%
++%   This routine extracts a submodel from a bigger model with respect to a given contour
++%   md must be followed by the corresponding exp domain file (argus type, .exp extension). 
++%   The model will be remeshed at high rsolution hmin and low resolution hmax.  The ice 
++%   boundary velocities will be spc'd to the transient velocities at saved transient steps
++%   at the resolution optionally provided for stepres.  A stepres of 2 means that you wish
++%   to skip every other saved transient step.  This is useful when extracting a long transient.
++%
++%   Usage:
++%      md2=regionaltransient2d(md1,area,hmin,hmax,err);
++%
++%   Examples:
++%      md2=regionaltransient2d(md,'Domain.exp',500,10000,[15 250]);
++%      md2=regionaltransient2d(md,'Domain.exp',3000,15000,[10 300],2);
++%
++%   See also: MODELEXTRACT, EXTRUDE, COLLAPSE
++
++%some checks
++if ((nargin~=5) & (nargin~=6)),
++	help regionaltransient2d 
++	error('regionaltransient2d error message: bad usage');
++end
++
++%get check option
++if (nargin==5),
++	stepres=1;
++end
++
++%take every fields from model
++mde=modelextract(md1,area);
++mde.private.bamg=[];
++mde.mesh.extractedvertices=nan;
++mde.mesh.extractedelements=nan;
++
++%remesh
++md2=bamg(mde,'hmin',hmin,'hmax',hmax,'field',[mde.inversion.vel_obs mde.geometry.surface],'splitcorner',1,'KeepVertices',0,'err',err);
++md2=setmask(md2,'','');
++
++%automatically modify fields
++
++	%loop over model fields
++	model_fields=fields(md1);
++	for i=1:length(model_fields),
++
++		%get field
++		field=md1.(model_fields{i});
++		fieldsize=size(field);
++
++		%copy field, interpolated to new mesh
++		if isobject(field), %recursive call
++			object_fields=fields(md1.(model_fields{i}));
++			fname=['(model_fields{i}).(object_fields{j})'];
++		else
++			object_fields=field;
++			fname=['(model_fields{i})'];
++		end
++		for j=1:length(object_fields),
++			%get field
++			field=eval(['md2.' fname]);
++			fieldsize=size(field);
++
++			%size = number of nodes * n
++			for n=1:fieldsize(2)
++				if fieldsize(1)==mde.mesh.numberofvertices
++					if(sum(field(:,n) ~= field(1,n)) == 0)
++						eval(['md2.' fname '(1:md2.mesh.numberofvertices,n)=field(1,n)*ones(md2.mesh.numberofvertices,1);']);
++					else
++						eval(['md2.' fname '(1:md2.mesh.numberofvertices,n)=InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(:,n),md2.mesh.x,md2.mesh.y);']);
++					end
++					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofvertices,n);']);
++				elseif fieldsize(1)==mde.mesh.numberofvertices+1
++					if(sum(field(1:end-1,n) ~= field(1,n)) == 0)
++						eval(['md2.' fname '(1:md2.mesh.numberofvertices+1,n)=[field(1,n)*ones(md2.mesh.numberofvertices,1); field(end,n)];']);
++					else
++						eval(['md2.' fname '(1:md2.mesh.numberofvertices+1,n)=[InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(1:end-1,n),md2.mesh.x,md2.mesh.y); field(end,n)];']);
++					end
++					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofvertices+1,n)']);
++					%size = number of elements * n
++				elseif fieldsize(1)==mde.mesh.numberofelements
++					if(sum(field(1:end-1,n) ~= field(1,n)) == 0)
++						eval(['md2.' fname '(1:md2.mesh.numberofelements,n)=field(1,n)*ones(md2.mesh.numberofelements,1);']);
++					else
++						eval(['md2.' fname '(1:md2.mesh.numberofelements,n)=InterpFromMeshToMesh2d(mde.mesh.elements,mde.mesh.x,mde.mesh.y,field(:,n),md2.mesh.x,md2.mesh.y);']);
++					end
++					eval(['md2.' fname '(:,n)=md2.' fname '(1:md2.mesh.numberofelements,n);']);
++				end
++			end
++		end
++	end
++
++	%Read transient velocities and thickness, looping through only the populated times
++	spcx=[];
++	spcy=[];
++	spct=[];
++	steps=[];
++	nsteps=length(md1.results.TransientSolution);
++	count=0;
++	numElements=arrayfun(@(x) numel(x.step), md1.results.TransientSolution);
++	for t=find(numElements==1)
++		if ~isempty(md1.results.TransientSolution(t).Vel) & mod(count,stepres)==0,
++			vx=PatchToVec(md1.results.TransientSolution(t).Vx);
++			vy=PatchToVec(md1.results.TransientSolution(t).Vy);
++			thickness=PatchToVec(md1.results.TransientSolution(t).Thickness);
++			spcx=[spcx InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,vx,md2.mesh.x,md2.mesh.y)];
++			spcy=[spcy InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,vy,md2.mesh.x,md2.mesh.y)];
++			spct=[spct InterpFromMeshToMesh2d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,thickness,md2.mesh.x,md2.mesh.y)];
++			steps=[steps t*md1.timestepping.time_step];
++		end
++		count=count+1;
++	end
++
++	%As long as there are recorded time steps, spc the boundaries with velocities
++	if nsteps > 0
++		md2.diagnostic.spcvx=md2.diagnostic.spcvx*ones(1,size(spcx,2));
++		md2.diagnostic.spcvy=md2.diagnostic.spcvy*ones(1,size(spcy,2));
++		md2.diagnostic.spcvz=md2.diagnostic.spcvz*ones(1,size(spcx,2));
++		md2.prognostic.spcthickness=md2.prognostic.spcthickness*ones(1,size(spct,2));
++		md2.diagnostic.spcvx(find(md2.mesh.vertexonboundary),:)=spcx(find(md2.mesh.vertexonboundary),:);
++		md2.diagnostic.spcvy(find(md2.mesh.vertexonboundary),:)=spcy(find(md2.mesh.vertexonboundary),:);
++		md2.diagnostic.spcvz(find(md2.mesh.vertexonboundary),:)=0;
++		md2.prognostic.spcthickness(find(md2.mesh.vertexonboundary),:)=spct(find(md2.mesh.vertexonboundary),:);
++		md2.diagnostic.spcvx=[md2.diagnostic.spcvx; steps];
++		md2.diagnostic.spcvy=[md2.diagnostic.spcvy; steps];
++		md2.diagnostic.spcvz=[md2.diagnostic.spcvz; steps];
++		md2.prognostic.spcthickness=[md2.prognostic.spcthickness; steps];
++	end
++
++	%Diagnostic.  Don't spc the icefront vertices.
++	if ~isnan(md2.diagnostic.icefront)
++		md1s=modelextract(md1,area);
++		%md2.diagnostic.icefront=[md2.mesh.segments 2];
++		e2=md2.mesh.segments(:,end);
++		e1=md1s.mesh.segments(:,end);
++
++		pload = nan*ones(size(md1s.mesh.elements,1),1);
++		pload(md1s.diagnostic.icefront(:,end-1))=md1s.diagnostic.icefront(:,end);
++
++		x2=mean(md2.mesh.x(md2.mesh.elements(e2,:)),2);
++      y2=mean(md2.mesh.y(md2.mesh.elements(e2,:)),2);
++		x1=mean(md1s.mesh.x(md1s.mesh.elements),2);
++      y1=mean(md1s.mesh.y(md1s.mesh.elements),2);
++
++		pload2=griddata(x1,y1,pload,x2,y2,'nearest');
++		md2.diagnostic.icefront=[md2.mesh.segments(~isnan(pload2),:) pload2(~isnan(pload2))];
++		md2.diagnostic.spcvx(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
++		md2.diagnostic.spcvy(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
++		md2.diagnostic.spcvz(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
++		md2.prognostic.spcthickness(unique(md2.diagnostic.icefront(:,1:2)),:)=nan;
++	end
++
++	%Clear results fields
++	if isstruct(md1.results),
++		md2.results=[];
++	end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/BasinConstrainShelf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/BasinConstrainShelf.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/BasinConstrainShelf.m	(revision 13009)
+@@ -0,0 +1,74 @@
++function md=BasinConstrainShelf(md,domain);
++%BASINCONSTRAIN - constrain basin
++%
++%   Constrain basin using a constraint domain outline, 
++%   to dirichlet boundary conditions.
++%   constraindomain is an Argus domain outline file enclosing 
++%   the geographical area of interest.
++%
++%   Usage: 
++%      md=BasinConstrain(md,constraindomain)
++%
++%   Example:
++%      md=BasinConstrain(md,'DomainOutline.exp');
++%      md=BasinConstrain(md,'~Iceshelves.exp');
++
++%now, flag nodes and elements outside the domain outline.
++if ischar(domain),
++	if isempty(domain),
++		elementondomain=zeros(md.mesh.numberofelements,1);
++		vertexondomain=zeros(md.mesh.numberofvertices,1);
++		invert=0;
++	elseif strcmpi(domain,'all')
++		elementondomain=ones(md.mesh.numberofelements,1);
++		vertexondomain=ones(md.mesh.numberofvertices,1);
++		invert=0;
++	else
++		%make sure that we actually don't want the elements outside the domain outline!
++		if strcmpi(domain(1),'~'),
++			domain=domain(2:end);
++			invert=1;
++		else
++			invert=0;
++		end
++		%ok, flag elements and nodes
++		[vertexondomain elementondomain]=ContourToMesh(md.mesh.elements(:,1:3),md.mesh.x,md.mesh.y,domain,'element and node',2);
++	end
++	if invert,
++		vertexondomain=~vertexondomain;
++		elementondomain=~elementondomain;
++	end
++else
++	error('BasinConstrain error message: domain type not supported yet');
++end
++
++%list of elements and nodes not on domain
++vertexnotondomain=find(~vertexondomain);
++elementnotondomain=find(~elementondomain);
++
++%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
++md.diagnostic.spcvx(vertexnotondomain)=md.inversion.vx_obs(vertexnotondomain);
++md.diagnostic.spcvy(vertexnotondomain)=md.inversion.vy_obs(vertexnotondomain);
++md.mask.elementonwater(elementnotondomain)=1;
++
++%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
++pos=find(~md.mask.elementonwater);
++numpos=unique(md.mesh.elements(pos,:));
++nodes=setdiff(1:1:md.mesh.numberofvertices,numpos);
++md.diagnostic.spcvx(nodes)=md.inversion.vx_obs(nodes);
++md.diagnostic.spcvy(nodes)=md.inversion.vy_obs(nodes);
++
++%make sure any node with NaN velocity is spc'd:
++%we spc to the smoothed value, so that control methods don't go berserk trying to figure out what reaction force to apply for the spc to stand.
++pos=find(isnan(md.inversion.vel_obs_raw));
++md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos); 
++md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos); 
++
++%iceshelves: any vertex on floating ice is spc'd
++pos=find(md.mask.vertexongroundedice);
++md.diagnostic.spcvx(pos)=md.inversion.vx_obs(pos); 
++md.diagnostic.spcvy(pos)=md.inversion.vy_obs(pos); 
++
++%make sure icefronts that are completely spc'd are taken out:
++free_segments=find((~isnan(md.diagnostic.spcvx(md.diagnostic.icefront(:,1:2))) + ~isnan(md.diagnostic.spcvy(md.diagnostic.icefront(:,1:2))) )~=2);
++md.diagnostic.icefront=md.diagnostic.icefront(free_segments,:);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay.m	(revision 13009)
+@@ -0,0 +1,154 @@
++function fielddisplay(md,name,comment)
++%FIELDDISPLAY - display model field
++%
++%   Usage:
++%      fielddisplay(md,offset,name,comment)
++
++	%get field
++	field=md.(name);
++
++	%disp corresponding line as a function of field type (offset set as 9 spaces)
++	parsedisplay('         ',name,field,comment);
++
++end %function
++
++function parsedisplay(offset,name,field,comment); %{{{
++
++	%string
++	if ischar(field),
++
++		if length(field)>30;
++			displayunit(offset,name,'not displayed',comment),
++		else
++			displayunit(offset,name,['''' field ''''],comment),
++		end
++
++	%numeric
++	elseif isnumeric(field)
++
++		%get size
++		fieldsize=size(field);
++
++		%double
++		if max(fieldsize)==1,
++			displayunit(offset,name,num2str(field),comment),
++		%matrix
++		else
++			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
++		end
++
++	%logical
++	elseif islogical(field)
++
++		%get size
++		fieldsize=size(field);
++
++		%single value
++		if max(fieldsize)==1,
++			if (field)
++				displayunit(offset,name,'true',comment),
++			else
++				displayunit(offset,name,'false',comment),
++			end
++		%matrix
++		else
++			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
++		end
++
++		%structure
++	elseif isstruct(field),
++		if ~isempty(fields(field))
++			displayunit(offset,name,'(structure)',comment),
++			struct_display(field,[offset '   ']),
++		else
++			displayunit(offset,name,'N/A',comment),
++		end
++
++	%cell
++	elseif iscell(field),
++		cell_display(offset,name,field,comment),
++
++	else
++		displayunit(offset,name,'not displayed',comment),
++
++	end
++end%}}}
++
++function struct_display(structure,offset) % {{{
++
++	structure_fields=fields(structure);
++
++	for i=1:length(structure_fields),
++
++		%get current field
++		field=structure.(structure_fields{i});
++
++		%recursive call if necessary
++		if isstruct(field),
++			displayunit(offset,structure_fields{i},'(structure)',''),
++			struct_display(field,[offset '   ']);
++
++		%display value
++		else
++			parsedisplay(offset,structure_fields{i},field,'');
++		end
++	end
++end% }}}
++function cell_display(offset,name,field,comment) % {{{
++
++	%initialization
++	string='{';
++
++	%go through the cell and fill string
++	if length(field)<5;
++		for i=1:length(field),
++			if ischar(field{i}),
++				string=[string ''''  field{i} ''','];
++			elseif (isnumeric(field{i}) & length(field{i})==1)
++				string=[string num2str(field{i}) ',' ];
++			else
++				string='{';
++				break
++			end
++		end
++	end
++	if strcmp(string,'{'),
++		string=['(' num2str(size(field,1)) 'x' num2str(size(field,2)) ')'];
++	else
++		string=[string(1:end-1) '}'];
++	end
++
++	%call displayunit
++	displayunit(offset,name,string,comment);
++end% }}}
++function displayunit(offset,name,characterization,comment),% {{{
++
++	%take care of name
++	if length(name)>23,
++		name=[name(1:20) '...'];
++	end
++
++	%take care of characterization
++	if (strcmp(characterization,['''' '''']) | strcmp(characterization,'NaN')),
++		characterization='N/A';
++	end
++	if length(characterization)>15,
++		characterization=[characterization(1:12) '...'];
++	end
++
++	%print
++	if isempty(comment)
++		disp(sprintf('%s%-23s: %-15s',offset,name,characterization));
++	else
++		if ischar(comment),
++			disp(sprintf('%s%-23s: %-15s -- %s',offset,name,characterization,comment));
++		elseif iscell(comment),
++			disp(sprintf('%s%-23s: %-15s -- %s',offset,name,characterization,comment{1}));
++			for i=2:length(comment),
++				disp(sprintf('%s%-23s  %-15s    %s',offset,'','',comment{i}));
++			end
++		else
++			error('fielddisplay error message: format for comment not supportet yet');
++		end
++	end
++end% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay2.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay2.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay2.m	(revision 13009)
+@@ -0,0 +1,14 @@
++function fielddisplay2(md,name,comment)
++%FIELDDISPLAY2 - display model field
++%
++%   Usage:
++%      fielddisplay2(md,offset,name,comment)
++
++	%get field
++	field=md.(name);
++
++	if length(name)>23,
++		name=[name(1:20) '...'];
++	end
++
++	disp(sprintf('%s%-23s -- %s','      ',name,comment));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display	(revision 13009)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/io/loadmodellist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/io/loadmodellist.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/io/loadmodellist.m	(revision 13009)
+@@ -0,0 +1,50 @@
++function varargout=loadmodellist(path)
++%LOADMODELLIST- load a model using built-in load module
++%
++%   check that modellist prototype has not changed. if so, adapt to new modellist prototype.
++%
++%   Usage:
++%      mds=loadmodellist(path)
++%      loadmodellist path
++
++%check nargout
++if nargout>1,
++	error('loadmodellist usage error: mds=loadmodellist(path)');
++end
++%check existence
++if ~exist(path)
++	error(['loadmodellist error message: file ' path ' does not exist']);
++end
++
++%check that the file is readable
++[stat,mess]=fileattrib(path);
++if( stat==0 | mess.UserRead~=1),
++	error(['loadmodellist error message: file ' path ' is not readable (permission dinied).']);
++end
++
++%check number of variables
++if length(whos('-file',path))>1,
++	error(['loadmodellist error message: file ' path ' contains several variables. Only one model should be present.']);
++end
++
++try,
++	struc=load(path,'-mat');
++
++	%get name of model variable
++	fieldname=char(fieldnames(struc));
++	mds=eval(['struc.' fieldname]);
++	if ~strcmpi(class(mds),'model'),
++		mds2=modellist;
++		mds2=structtomodel(mds2,mds);
++		mds=mds2;
++		clear mds2;
++	end
++	if nargout,
++		varargout{1}=mds;
++	else
++		assignin('caller',fieldname,mds);
++	end
++catch me
++	disp(getReport(me))
++	error(['could not load model ' path]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/io/loadmodel.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/io/loadmodel.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/io/loadmodel.m	(revision 13009)
+@@ -0,0 +1,46 @@
++function varargout=loadmodel(path)
++%LOADMODEL - load a model using built-in load module
++%
++%   check that model prototype has not changed. if so, adapt to new model prototype.
++%
++%   Usage:
++%      md=loadmodel(path)
++%      loadmodel path
++
++%check nargout
++if nargout>1,
++	error('loadmodel usage error: md=loadmodel(path)');
++end
++
++%check existence
++if exist(path,'file')
++	%do nothing
++elseif exist([path '.mat'],'file')
++	%add extension
++	path = [path '.mat'];
++else
++	error(['loadmodel error message: file ' path ' does not exist']);
++end
++
++try,
++	%recover model on file and name it md
++	warning off MATLAB:unknownElementsNowStruc;
++	warning off MATLAB:load:classNotFound
++	struc=load(path,'-mat');
++	warning on MATLAB:unknownElementsNowStruc;
++	warning on MATLAB:load:classNotFound
++
++	name=char(fieldnames(struc));
++	if size(name,1)>1,
++		error(['loadmodel error message: file ' path ' contains several variables. Only one model should be present.']); 
++	end
++	md=struc.(name);
++	if nargout,
++		varargout{1}=md;
++	else
++		assignin('caller',name,md);
++	end
++catch me
++	disp(getReport(me))
++	error(['could not load model ' path]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.py	(revision 13009)
+@@ -0,0 +1,34 @@
++import os
++import datetime
++from addnote import *
++
++def parameterize(md,parametername):
++	"""
++	PARAMETERIZE - parameterize a model
++
++	   from a parameter python file, start filling in all the model fields that were not 
++	   filled in by the mesh.py and mask.py model methods.
++	   Warning: the parameter file must be able to be run in Python
++
++	   Usage:
++	      md=parameterize(md,parametername)
++
++	   Example:
++	      md=parameterize(md,'Square.par');
++	"""
++
++	#some checks
++	if not os.path.exists(parametername):
++		raise IOError("parameterize error message: file '%s' not found!" % parametername)
++
++	#Try and run parameter file.
++	execfile(parametername)
++
++	#Name and notes
++	if not md.miscellaneous.name:
++		md.miscellaneous.name=os.path.basename(parametername).split('.')[0]
++
++	md=addnote(md,"Model created by using parameter file: '%s' on: %s." % (parametername,datetime.datetime.strftime(datetime.datetime.now(),'%c') ))
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13009)
+@@ -0,0 +1,278 @@
++import numpy
++from model import *
++from pairoptions import *
++from recover_areas import *
++from MatlabFuncs import *
++
++def setflowequation(md,*args):
++	"""
++	SETELEMENTSTYPE - associate a solution type to each element
++
++	   This routine works like plotmodel: it works with an even number of inputs
++	   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
++	   that must be followed by the corresponding exp file or flags list
++	   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
++	   If user wants every element outside the domain to be 
++	   setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
++	   an empty string '' will be considered as an empty domain
++	   a string 'all' will be considered as the entire domain
++	   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
++
++	   Usage:
++	      md=setflowequation(md,varargin)
++
++	   Example:
++	      md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
++	      md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
++	"""
++
++	#some checks on list of arguments
++	if not isinstance(md,model) or not len(args):
++		raise TypeError("setflowequation error message")
++
++	#Find_out what kind of coupling to use
++	options=pairoptions(*args)
++	coupling_method=options.getfieldvalue('coupling','tiling')
++	if not strcmpi(coupling_method,'tiling') and not strcmpi(coupling_method,'penalties'):
++		raise TypeError("coupling type can only be: tiling or penalties")
++
++	hutterflag,macayealflag,pattynflag,stokesflag,filltype=recover_areas(md,*args)
++
++	#Flag the elements that have not been flagged as filltype
++	if   strcmpi(filltype,'hutter'):
++		hutterflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(macayealflag,pattynflag)))]=1
++	elif strcmpi(filltype,'macayeal'):
++		macayealflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(pattynflag,stokesflag))))]=1
++	elif strcmpi(filltype,'pattyn'):
++		pattynflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(macayealflag,stokesflag))))]=1
++
++	#check that each element has at least one flag
++	if not numpy.any(hutterflag+macayealflag+pattynflag+stokesflag):
++		raise TypeError("setflowequation error message: elements type not assigned, must be specified")
++
++	#check that each element has only one flag
++	if numpy.any(hutterflag+macayealflag+pattynflag+stokesflag>1):
++		print "setflowequation warning message: some elements have several types, higher order type is used for them"
++		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,macayealflag))]=0
++		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,pattynflag))]=0
++		macayealflag[numpy.nonzero(numpy.logical_and(macayealflag,pattynflag))]=0
++
++	#Check that no pattyn or stokes for 2d mesh
++	if md.mesh.dimension==2:
++		if numpy.any(numpy.logical_or(stokesflag,pattynflag)):
++			raise TypeError("setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first")
++
++	#Stokes can only be used alone for now:
++	if numpy.any(stokesflag) and numpy.any(hutterflag):
++		raise TypeError("setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere")
++
++	#Initialize node fields
++	nodeonhutter=numpy.zeros(md.mesh.numberofvertices)
++	nodeonhutter[md.mesh.elements[numpy.nonzero(hutterflag),:].astype(int)-1]=1
++	nodeonmacayeal=numpy.zeros(md.mesh.numberofvertices)
++	nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++	nodeonpattyn=numpy.zeros(md.mesh.numberofvertices)
++	nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++	nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
++	noneflag=numpy.zeros(md.mesh.numberofelements)
++
++	#First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
++	if any(stokesflag):
++#		fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
++		fullspcnodes=numpy.logical_or(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx))+ \
++		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvy))+ \
++		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvz))==3, \
++		                              numpy.logical_and(nodeonpattyn,nodeonstokes)).astype(int)    #find all the nodes on the boundary of the domain without icefront
++#		fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
++		fullspcelems=(numpy.sum(fullspcnodes[md.mesh.elements.astype(int)-1],axis=1)==6).astype(int)    #find all the nodes on the boundary of the domain without icefront
++		stokesflag[numpy.nonzero(fullspcelems)]=0
++		nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++
++	#Then complete with NoneApproximation or the other model used if there is no stokes
++	if any(stokesflag): 
++		if   any(pattynflag):    #fill with pattyn
++			pattynflag[numpy.logical_not(stokesflag)]=1
++			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++		elif any(macayealflag):    #fill with macayeal
++			macayealflag[numpy.logical_not(stokesflag)]=1
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++		else:    #fill with none 
++			noneflag[numpy.nonzero(numpy.logical_not(stokesflag))]=1
++
++	#Now take care of the coupling between MacAyeal and Pattyn
++	md.diagnostic.vertex_pairing=numpy.array([])
++	nodeonmacayealpattyn=numpy.zeros(md.mesh.numberofvertices)
++	nodeonpattynstokes=numpy.zeros(md.mesh.numberofvertices)
++	nodeonmacayealstokes=numpy.zeros(md.mesh.numberofvertices)
++	macayealpattynflag=numpy.zeros(md.mesh.numberofelements)
++	macayealstokesflag=numpy.zeros(md.mesh.numberofelements)
++	pattynstokesflag=numpy.zeros(md.mesh.numberofelements)
++	if   strcmpi(coupling_method,'penalties'):
++		#Create the border nodes between Pattyn and MacAyeal and extrude them
++		numnodes2d=md.mesh.numberofvertices2d
++		numlayers=md.mesh.numberoflayers
++		bordernodes2d=numpy.nonzero(numpy.logical_and(nodeonpattyn[1:numnodes2d],nodeonmacayeal[1:numnodes2d]))    #Nodes connected to two different types of elements
++
++		#initialize and fill in penalties structure
++		if numpy.all(numpy.logical_not(numpy.isnan(bordernodes2d))):
++			penalties=numpy.zeros((0,2))
++			for	i in xrange(1,numlayers):
++				penalties=numpy.concatenate((penalties,numpy.concatenate((bordernodes2d,bordernodes2d+md.mesh.numberofvertices2d*(i)),axis=1)),axis=0)
++			md.diagnostic.vertex_pairing=penalties
++
++	elif strcmpi(coupling_method,'tiling'):
++		if   numpy.any(macayealflag) and numpy.any(pattynflag):    #coupling macayeal pattyn
++			#Find node at the border
++			nodeonmacayealpattyn[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonpattyn))]=1
++			#Macayeal elements in contact with this layer become MacAyealPattyn elements
++			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonmacayealpattyn))
++			commonelements=numpy.sum(matrixelements,axis=1)!=0
++			commonelements[numpy.nonzero(pattynflag)]=0    #only one layer: the elements previously in macayeal
++			macayealflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealpattynelements
++			macayealpattynflag[numpy.nonzero(commonelements)]=1
++			nodeonmacayeal[:]=0
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++
++			#rule out elements that don't touch the 2 boundaries
++			pos=numpy.nonzero(macayealpattynflag)
++			elist=numpy.zeros(len(pos))
++			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
++			pos1=[i for i,item in enumerate(elist) if item==1]
++			macayealflag[pos[pos1]]=1
++			macayealpattynflag[pos[pos1]]=0
++			pos2=[i for i,item in enumerate(elist) if item==-1]
++			pattynflag[pos[pos2]]=1
++			macayealpattynflag[pos[pos2]]=0
++
++			#Recompute nodes associated to these elements
++			nodeonmacayeal[:]=0
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++			nodeonpattyn[:]=0
++			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++			nodeonmacayealpattyn[:]=0
++			nodeonmacayealpattyn[md.mesh.elements[numpy.nonzero(macayealpattynflag),:].astype(int)-1]=1
++
++		elif numpy.any(pattynflag) and numpy.any(stokesflag):    #coupling pattyn stokes
++			#Find node at the border
++			nodeonpattynstokes[numpy.nonzero(numpy.logical_and(nodeonpattyn,nodeonstokes))]=1
++			#Stokes elements in contact with this layer become PattynStokes elements
++			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonpattynstokes))
++			commonelements=numpy.sum(matrixelements,axis=1)!=0
++			commonelements[numpy.nonzero(pattynflag)]=0    #only one layer: the elements previously in macayeal
++			stokesflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealpattynelements
++			pattynstokesflag[numpy.nonzero(commonelements)]=1
++			nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++
++			#rule out elements that don't touch the 2 boundaries
++			pos=numpy.nonzero(pattynstokesflag)
++			elist=numpy.zeros(len(pos))
++			elist = elist + numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			pos1=[i for i,item in enumerate(elist) if item==1]
++			stokesflag[pos[pos1]]=1
++			pattynstokesflag[pos[pos1]]=0
++			pos2=[i for i,item in enumerate(elist) if item==-1]
++			pattynflag[pos[pos2]]=1
++			pattynstokesflag[pos[pos2]]=0
++
++			#Recompute nodes associated to these elements
++			nodeonstokes[:]=0
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++			nodeonpattyn[:]=0
++			nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
++			nodeonpattynstokes[:]=0
++			nodeonpattynstokes[md.mesh.elements[numpy.nonzero(pattynstokesflag),:].astype(int)-1]=1
++
++		elif numpy.any(stokesflag) and numpy.any(macayealflag):
++			#Find node at the border
++			nodeonmacayealstokes[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonstokes))]=1
++			#Stokes elements in contact with this layer become MacAyealStokes elements
++			matrixelements=ismember(md.mesh.elements,numpy.nonzero(nodeonmacayealstokes))
++			commonelements=numpy.sum(matrixelements,axis=1)!=0
++			commonelements[numpy.nonzero(macayealflag)]=0    #only one layer: the elements previously in macayeal
++			stokesflag[numpy.nonzero(commonelements)]=0    #these elements are now macayealmacayealelements
++			macayealstokesflag[numpy.nonzero(commonelements)]=1
++			nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++
++			#rule out elements that don't touch the 2 boundaries
++			pos=numpy.nonzero(macayealstokesflag)
++			elist=numpy.zeros(len(pos))
++			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
++			pos1=[i for i,item in enumerate(elist) if item==1]
++			macayealflag[pos[pos1]]=1
++			macayealstokesflag[pos[pos1]]=0
++			pos2=[i for i,item in enumerate(elist) if item==-1]
++			stokesflag[pos[pos2]]=1
++			macayealstokesflag[pos[pos2]]=0
++
++			#Recompute nodes associated to these elements
++			nodeonmacayeal[:]=0
++			nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++			nodeonstokes[:]=0
++			nodeonstokes[md.mesh.elements[numpy.nonzero(stokesflag),:].astype(int)-1]=1
++			nodeonmacayealstokes[:]=0
++			nodeonmacayealstokes[md.mesh.elements[numpy.nonzero(macayealstokesflag),:].astype(int)-1]=1
++
++		elif numpy.any(stokesflag) and numpy.any(hutterflag):
++			raise TypeError("type of coupling not supported yet")
++
++	#Create MacaAyealPattynApproximation where needed
++	md.flowequation.element_equation=numpy.zeros(md.mesh.numberofelements)
++	md.flowequation.element_equation[numpy.nonzero(noneflag)]=0
++	md.flowequation.element_equation[numpy.nonzero(hutterflag)]=1
++	md.flowequation.element_equation[numpy.nonzero(macayealflag)]=2
++	md.flowequation.element_equation[numpy.nonzero(pattynflag)]=3
++	md.flowequation.element_equation[numpy.nonzero(stokesflag)]=4
++	md.flowequation.element_equation[numpy.nonzero(macayealpattynflag)]=5
++	md.flowequation.element_equation[numpy.nonzero(macayealstokesflag)]=6
++	md.flowequation.element_equation[numpy.nonzero(pattynstokesflag)]=7
++
++	#border
++	md.flowequation.borderpattyn=nodeonpattyn
++	md.flowequation.bordermacayeal=nodeonmacayeal
++	md.flowequation.borderstokes=nodeonstokes
++
++	#Create vertices_type
++	md.flowequation.vertex_equation=numpy.zeros(md.mesh.numberofvertices)
++	pos=numpy.nonzero(nodeonhutter)
++	md.flowequation.vertex_equation[pos]=1
++	pos=numpy.nonzero(nodeonmacayeal)
++	md.flowequation.vertex_equation[pos]=2
++	pos=numpy.nonzero(nodeonpattyn)
++	md.flowequation.vertex_equation[pos]=3
++	pos=numpy.nonzero(nodeonhutter)
++	md.flowequation.vertex_equation[pos]=1
++	pos=numpy.nonzero(nodeonmacayealpattyn)
++	md.flowequation.vertex_equation[pos]=5
++	pos=numpy.nonzero(nodeonstokes)
++	md.flowequation.vertex_equation[pos]=4
++	if numpy.any(stokesflag):
++		pos=numpy.nonzero(numpy.logical_not(nodeonstokes))
++		if not (numpy.any(pattynflag) or numpy.any(macayealflag)):
++			md.flowequation.vertex_equation[pos]=0
++	pos=numpy.nonzero(nodeonpattynstokes)
++	md.flowequation.vertex_equation[pos]=7
++	pos=numpy.nonzero(nodeonmacayealstokes)
++	md.flowequation.vertex_equation[pos]=6
++
++	#figure out solution types
++	md.flowequation.ishutter=float(numpy.any(md.flowequation.element_equation==1))
++	md.flowequation.ismacayealpattyn=float(numpy.any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
++	md.flowequation.isstokes=float(numpy.any(md.flowequation.element_equation==4))
++
++	return md
++
++	#Check that tiling can work:
++	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal !=1):
++		raise TypeError("error coupling domain too irregular")
++	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderstokes + md.flowequation.bordermacayeal !=1):
++		raise TypeError("error coupling domain too irregular")
++	if numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.borderstokes !=1):
++		raise TypeError("error coupling domain too irregular")
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/contourenvelope.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/contourenvelope.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/contourenvelope.m	(revision 13009)
+@@ -0,0 +1,139 @@
++function segments=contourenvelope(md,varargin)
++%CONTOURENVELOPE - build a set of segments enveloping a contour .exp
++%
++%   Usage:
++%      segments=contourenvelope(md,varargin)
++%
++%   Example:
++%      segments=contourenvelope(md,'Stream.exp');
++%      segments=contourenvelope(md,md.mask.elementonfloatingice)
++%      segments=contourenvelope(md);
++
++%some checks
++if nargin>2,
++	help contourenvelope
++	error('contourenvelope error message: bad usage');
++end
++if nargin==2,
++	flags=varargin{1};
++
++	if ischar(flags),
++		file=flags;
++		file=varargin{1};
++		if ~exist(file),
++			error(['contourenvelope error message: file ' file ' not found']);
++		end
++		isfile=1;
++	elseif isnumeric(flags),
++		%do nothing for now
++		isfile=0;
++	else
++		error('contourenvelope error message:  second argument should a file or an elements flag');
++	end
++end
++
++%Now, build the connectivity tables for this mesh.
++%Computing connectivity
++if (size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices & size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices2d),
++	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++end
++if (size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements & size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements2d),
++	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++end
++
++%get nodes inside profile
++mesh.elementconnectivity=md.mesh.elementconnectivity;
++if md.mesh.dimension==2;
++	mesh.elements=md.mesh.elements;
++	mesh.x=md.mesh.x;
++	mesh.y=md.mesh.y;
++	mesh.numberofvertices=md.mesh.numberofvertices;
++	mesh.numberofelements=md.mesh.numberofelements;
++else
++	mesh.elements=md.mesh.elements2d;
++	mesh.x=md.mesh.x2d;
++	mesh.y=md.mesh.y2d;
++	mesh.numberofvertices=md.mesh.numberofvertices2d;
++	mesh.numberofelements=md.mesh.numberofelements2d;
++end
++
++if nargin==2,
++
++	if isfile,
++		%get flag list of elements and nodes inside the contour
++		nodein=ContourToMesh(mesh.elements,mesh.x,mesh.y,file,'node',1);
++		elemin=(sum(nodein(mesh.elements),2)==size(mesh.elements,2));
++		%modify element connectivity
++		elemout=find(~elemin);
++		mesh.elementconnectivity(elemout,:)=0;
++		mesh.elementconnectivity(find(ismember(mesh.elementconnectivity,elemout)))=0;
++	else
++		%get flag list of elements and nodes inside the contour
++		nodein=zeros(mesh.numberofvertices,1); 
++		elemin=zeros(mesh.numberofelements,1); 
++		
++		pos=find(flags); 
++		elemin(pos)=1;
++		nodein(mesh.elements(pos,:))=1;
++
++		%modify element connectivity
++		elemout=find(~elemin);
++		mesh.elementconnectivity(elemout,:)=0;
++		mesh.elementconnectivity(find(ismember(mesh.elementconnectivity,elemout)))=0;
++	end
++end
++
++%Find element on boundary
++%First: find elements on the boundary of the domain
++flag=mesh.elementconnectivity;
++if nargin==2,
++	flag(find(flag))=elemin(flag(find(flag)));
++end
++elementonboundary=double(prod(flag,2)==0 & sum(flag,2)>0);
++
++%Find segments on boundary
++pos=find(elementonboundary);
++num_segments=length(pos);
++segments=zeros(num_segments,3);
++count=1;
++
++for i=1:num_segments,
++	el1=pos(i);
++	els2=mesh.elementconnectivity(el1,find(mesh.elementconnectivity(el1,:)));
++	if length(els2)>1,
++		flag=intersect(mesh.elements(els2(1),:),mesh.elements(els2(2),:));
++		nods1=mesh.elements(el1,:);
++		nods1(find(nods1==flag))=[];
++		segments(count,:)=[nods1 el1];
++
++		ord1=find(nods1(1)==mesh.elements(el1,:));
++		ord2=find(nods1(2)==mesh.elements(el1,:));
++
++		%swap segment nodes if necessary
++		if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
++			temp=segments(count,1);
++			segments(count,1)=segments(count,2);
++			segments(count,2)=temp;
++		end
++		segments(count,1:2)=fliplr(segments(count,1:2));
++		count=count+1;
++	else
++		nods1=mesh.elements(el1,:);
++		flag=setdiff(nods1,mesh.elements(els2,:));
++		for j=1:3,
++			nods=nods1; nods(j)=[];
++			if any(ismember(flag,nods)),
++				segments(count,:)=[nods el1];
++				ord1=find(nods(1)==mesh.elements(el1,:));
++				ord2=find(nods(2)==mesh.elements(el1,:));
++				if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
++					temp=segments(count,1);
++					segments(count,1)=segments(count,2);
++					segments(count,2)=temp;
++				end
++				segments(count,1:2)=fliplr(segments(count,1:2));
++				count=count+1;
++			end
++		end
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setmask.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setmask.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setmask.m	(revision 13009)
+@@ -0,0 +1,49 @@
++function md=setmask(md,floatingicename,groundedicename)
++%SETMASK - establish boundaries between grounded and floating ice.
++%
++%   By default, ice is considered grounded. The contour floatingicename defines nodes 
++%   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
++%   that are grounded (ie: ice rises, islands, etc ...)
++%   All input files are in the Argus format (extension .exp).
++%
++%   Usage:
++%      md=setmask(md,floatingicename,groundedicename)
++%
++%   Examples:
++%      md=setmask(md,'all','');
++%      md=setmask(md,'Iceshelves.exp','Islands.exp');
++
++%some checks on list of arguments
++if ((nargin~=3) | (nargout~=1)),
++	help mask
++	error('mask error message');
++end
++
++%Get assigned fields
++x=md.mesh.x;
++y=md.mesh.y;
++elements=md.mesh.elements;
++
++%Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
++elementonfloatingice=FlagElements(md,floatingicename);
++elementongroundedice=FlagElements(md,groundedicename);
++
++%Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
++%arrays come from domain outlines that can intersect one another: 
++elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
++elementongroundedice=double(~elementonfloatingice);
++
++%the order here is important. we choose vertexongroundedice as default on the grounding line.
++vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
++vertexongroundedice=zeros(md.mesh.numberofvertices,1);
++vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
++vertexonfloatingice(find(~vertexongroundedice))=1;
++%}}}
++
++%Return: 
++md.mask.elementonfloatingice=elementonfloatingice;
++md.mask.vertexonfloatingice=vertexonfloatingice;
++md.mask.elementongroundedice=elementongroundedice;
++md.mask.vertexongroundedice=vertexongroundedice;
++md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
++md.mask.elementonwater=zeros(md.mesh.numberofelements,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.m	(revision 13009)
+@@ -0,0 +1,57 @@
++function md=parameterize(md,parametername)
++%PARAMETERIZE - parameterize a model
++%
++%   from a parameter matlab file, start filling in all the @model fields that were not 
++%   filled in by the mesh.m and mask.m @model methods.
++%   Warning: the parameter file must be able to be run in Matlab
++%
++%   Usage:
++%      md=parameterize(md,parametername)
++%
++%   Example:
++%      md=parameterize(md,'Square.par');
++
++%some checks
++if ~exist(parametername),
++	error(['parameterize error message: file ' parametername ' not found!']);
++end
++
++%Try and run parameter file.
++temporaryname=['TemporaryParameterFile' num2str(feature('GetPid')) ];
++copyfile(parametername,[temporaryname '.m']);
++
++%WARNING: this is a bug of matlab: the TemporaryParameterFile must be cleared
++%otherwise matlab keeps the previous version of this file which is not what
++%we want!!!
++eval(['clear ' temporaryname]);
++
++try,
++	eval(temporaryname);
++	delete([temporaryname '.m']);
++catch me,
++	delete([temporaryname '.m']);
++
++	%copy error message
++	me2=struct('message',me.message,'stack',me.stack);
++
++	%rename parameter file
++	me2.message=regexprep(me2.message,[temporaryname '.m'],parametername);
++	for i=1:length(me2.stack)-1,
++		me2.stack(i).file=regexprep(me2.stack(i).file,[temporaryname '.m'],parametername);
++		me2.stack(i).name=regexprep(me2.stack(i).name,[temporaryname],parametername);
++		if strcmp(me2.stack(i).name,'parameterize'),
++			%remove error (eval(temporaryname);) misleading
++			me2.stack(i)=[];
++		end
++	end
++
++	%throw error message
++	rethrow(me2);
++end
++
++%Name and notes
++if isempty(md.miscellaneous.name), 
++	[path,root,ext]=fileparts(parametername);
++	md.miscellaneous.name=root; 
++end
++md=addnote(md,['Model created by using parameter file: ' parametername ' on: ' datestr(now)]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 13009)
+@@ -0,0 +1,281 @@
++function md=setflowequation(md,varargin)
++%SETELEMENTSTYPE - associate a solution type to each element
++%
++%   This routine works like plotmodel: it works with an even number of inputs
++%   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
++%   that must be followed by the corresponding exp file or flags list
++%   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
++%   If user wants every element outside the domain to be 
++%   setflowequationd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
++%   an empty string '' will be considered as an empty domain
++%   a string 'all' will be considered as the entire domain
++%   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
++%
++%   Usage:
++%      md=setflowequation(md,varargin)
++%
++%   Example:
++%      md=setflowequation(md,'pattyn','Pattyn.exp','macayeal',md.mask.elementonfloatingice,'fill','hutter');
++%      md=setflowequation(md,'pattyn','Pattyn.exp',fill','hutter','coupling','tiling');
++
++%some checks on list of arguments
++if ((nargin<2) | (nargout~=1)),
++	error('setflowequation error message');
++end
++
++%Find_out what kind of coupling to use
++options=pairoptions(varargin{:});
++coupling_method=getfieldvalue(options,'coupling','tiling');
++if (~strcmpi(coupling_method,'tiling') & ~strcmpi(coupling_method,'penalties')),
++	error('coupling type can only be: tiling or penalties');
++end
++
++[hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin{:});
++
++%Flag the elements that have not been flagged as filltype
++if strcmpi(filltype,'hutter'),
++	hutterflag(find(~(macayealflag | pattynflag)))=1;
++elseif strcmpi(filltype,'macayeal'),
++	macayealflag(find(~(hutterflag | pattynflag | stokesflag)))=1;
++elseif strcmpi(filltype,'pattyn'),
++	pattynflag(find(~(hutterflag | macayealflag | stokesflag)))=1;
++end
++
++%check that each element has at least one flag
++if any(hutterflag+ macayealflag+pattynflag+stokesflag==0),
++	error('setflowequation error message: elements type not assigned, must be specified')
++end
++
++%check that each element has only one flag
++if any(hutterflag+ macayealflag+pattynflag+stokesflag>1),
++	disp('setflowequation warning message: some elements have several types, higher order type is used for them')
++	hutterflag(find(hutterflag & macayealflag))=0;
++	hutterflag(find(hutterflag & pattynflag))=0;
++	macayealflag(find(macayealflag & pattynflag))=0;
++end
++
++%Check that no pattyn or stokes for 2d mesh
++if (md.mesh.dimension==2),
++	if any(stokesflag | pattynflag)
++		error('setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first')
++	end
++end
++
++%Stokes can only be used alone for now:
++if any(stokesflag) &any(hutterflag),
++	error('setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere')
++end
++
++%Initialize node fields
++nodeonhutter=zeros(md.mesh.numberofvertices,1);
++nodeonhutter(md.mesh.elements(find(hutterflag),:))=1;
++nodeonmacayeal=zeros(md.mesh.numberofvertices,1);
++nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
++nodeonpattyn=zeros(md.mesh.numberofvertices,1);
++nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
++nodeonstokes=zeros(md.mesh.numberofvertices,1);
++noneflag=zeros(md.mesh.numberofelements,1);
++
++%First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
++if any(stokesflag),
++	fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
++	fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
++	stokesflag(find(fullspcelems))=0;
++	nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
++end
++
++%Then complete with NoneApproximation or the other model used if there is no stokes
++if any(stokesflag), 
++	if any(pattynflag), %fill with pattyn
++		pattynflag(~stokesflag)=1;
++		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
++	elseif any(macayealflag), %fill with macayeal
++		macayealflag(~stokesflag)=1;
++		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
++	else %fill with none 
++		noneflag(find(~stokesflag))=1;
++	end
++end
++
++%Now take care of the coupling between MacAyeal and Pattyn
++md.diagnostic.vertex_pairing=[];
++nodeonmacayealpattyn=zeros(md.mesh.numberofvertices,1);
++nodeonpattynstokes=zeros(md.mesh.numberofvertices,1);
++nodeonmacayealstokes=zeros(md.mesh.numberofvertices,1);
++macayealpattynflag=zeros(md.mesh.numberofelements,1);
++macayealstokesflag=zeros(md.mesh.numberofelements,1);
++pattynstokesflag=zeros(md.mesh.numberofelements,1);
++if strcmpi(coupling_method,'penalties'),
++	%Create the border nodes between Pattyn and MacAyeal and extrude them
++	numnodes2d=md.mesh.numberofvertices2d;
++	numlayers=md.mesh.numberoflayers;
++	bordernodes2d=find(nodeonpattyn(1:numnodes2d) & nodeonmacayeal(1:numnodes2d)); %Nodes connected to two different types of elements
++
++	%initialize and fill in penalties structure
++	if ~isnan(bordernodes2d),
++		penalties=[];
++		for	i=1:numlayers-1,
++			penalties=[penalties; [bordernodes2d bordernodes2d+md.mesh.numberofvertices2d*(i)]];
++		end
++		md.diagnostic.vertex_pairing=penalties;
++	end
++elseif strcmpi(coupling_method,'tiling'),
++	if any(macayealflag) & any(pattynflag), %coupling macayeal pattyn
++		%Find node at the border
++		nodeonmacayealpattyn(find(nodeonmacayeal & nodeonpattyn))=1;
++		%Macayeal elements in contact with this layer become MacAyealPattyn elements
++		matrixelements=ismember(md.mesh.elements,find(nodeonmacayealpattyn));
++		commonelements=sum(matrixelements,2)~=0;
++		commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
++		macayealflag(find(commonelements))=0; %these elements are now macayealpattynelements
++		macayealpattynflag(find(commonelements))=1;
++		nodeonmacayeal(:)=0;
++		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
++
++		%rule out elements that don't touch the 2 boundaries
++		pos=find(macayealpattynflag);
++		elist=zeros(length(pos),1);
++		elist = elist + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
++		elist = elist - any(sum(nodeonpattyn(md.mesh.elements(pos,:))  ,2),2);
++		pos1=find(elist==1);
++		macayealflag(pos(pos1))=1;
++		macayealpattynflag(pos(pos1))=0;
++		pos2=find(elist==-1);
++		pattynflag(pos(pos2))=1;
++		macayealpattynflag(pos(pos2))=0;
++
++		%Recompute nodes associated to these elements
++		nodeonmacayeal(:)=0;
++		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
++		nodeonpattyn(:)=0;
++		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
++		nodeonmacayealpattyn(:)=0;
++		nodeonmacayealpattyn(md.mesh.elements(find(macayealpattynflag),:))=1;
++
++	elseif any(pattynflag) & any(stokesflag), %coupling pattyn stokes
++		%Find node at the border
++		nodeonpattynstokes(find(nodeonpattyn & nodeonstokes))=1;
++		%Stokes elements in contact with this layer become PattynStokes elements
++		matrixelements=ismember(md.mesh.elements,find(nodeonpattynstokes));
++		commonelements=sum(matrixelements,2)~=0;
++		commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
++		stokesflag(find(commonelements))=0; %these elements are now macayealpattynelements
++		pattynstokesflag(find(commonelements))=1;
++		nodeonstokes=zeros(md.mesh.numberofvertices,1);
++		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
++
++		%rule out elements that don't touch the 2 boundaries
++		pos=find(pattynstokesflag);
++		elist=zeros(length(pos),1);
++		elist = elist + any(sum(nodeonstokes(md.mesh.elements(pos,:)),2),2);
++		elist = elist - any(sum(nodeonpattyn(md.mesh.elements(pos,:)),2),2);
++		pos1=find(elist==1);
++		stokesflag(pos(pos1))=1;
++		pattynstokesflag(pos(pos1))=0;
++		pos2=find(elist==-1);
++		pattynflag(pos(pos2))=1;
++		pattynstokesflag(pos(pos2))=0;
++
++		%Recompute nodes associated to these elements
++		nodeonstokes(:)=0;
++		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
++		nodeonpattyn(:)=0;
++		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
++		nodeonpattynstokes(:)=0;
++		nodeonpattynstokes(md.mesh.elements(find(pattynstokesflag),:))=1;
++
++	elseif any(stokesflag) & any(macayealflag),
++		%Find node at the border
++		nodeonmacayealstokes(find(nodeonmacayeal & nodeonstokes))=1;
++		%Stokes elements in contact with this layer become MacAyealStokes elements
++		matrixelements=ismember(md.mesh.elements,find(nodeonmacayealstokes));
++		commonelements=sum(matrixelements,2)~=0;
++		commonelements(find(macayealflag))=0; %only one layer: the elements previously in macayeal
++		stokesflag(find(commonelements))=0; %these elements are now macayealmacayealelements
++		macayealstokesflag(find(commonelements))=1;
++		nodeonstokes=zeros(md.mesh.numberofvertices,1);
++		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
++
++		%rule out elements that don't touch the 2 boundaries
++		pos=find(macayealstokesflag);
++		elist=zeros(length(pos),1);
++		elist = elist + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2);
++		elist = elist - any(sum(nodeonstokes(md.mesh.elements(pos,:))  ,2),2);
++		pos1=find(elist==1);
++		macayealflag(pos(pos1))=1;
++		macayealstokesflag(pos(pos1))=0;
++		pos2=find(elist==-1);
++		stokesflag(pos(pos2))=1;
++		macayealstokesflag(pos(pos2))=0;
++
++		%Recompute nodes associated to these elements
++		nodeonmacayeal(:)=0;
++		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
++		nodeonstokes(:)=0;
++		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
++		nodeonmacayealstokes(:)=0;
++		nodeonmacayealstokes(md.mesh.elements(find(macayealstokesflag),:))=1;
++
++	elseif any(stokesflag) & any(hutterflag),
++		error('type of coupling not supported yet');
++	end
++end
++
++%Create MacaAyealPattynApproximation where needed
++md.flowequation.element_equation=zeros(md.mesh.numberofelements,1);
++md.flowequation.element_equation(find(noneflag))=0;
++md.flowequation.element_equation(find(hutterflag))=1;
++md.flowequation.element_equation(find(macayealflag))=2;
++md.flowequation.element_equation(find(pattynflag))=3;
++md.flowequation.element_equation(find(stokesflag))=4;
++md.flowequation.element_equation(find(macayealpattynflag))=5;
++md.flowequation.element_equation(find(macayealstokesflag))=6;
++md.flowequation.element_equation(find(pattynstokesflag))=7;
++
++%border
++md.flowequation.borderpattyn=nodeonpattyn;
++md.flowequation.bordermacayeal=nodeonmacayeal;
++md.flowequation.borderstokes=nodeonstokes;
++
++%Create vertices_type
++md.flowequation.vertex_equation=zeros(md.mesh.numberofvertices,1);
++pos=find(nodeonhutter);
++md.flowequation.vertex_equation(pos)=1;
++pos=find(nodeonmacayeal);
++md.flowequation.vertex_equation(pos)=2;
++pos=find(nodeonpattyn);
++md.flowequation.vertex_equation(pos)=3;
++pos=find(nodeonhutter);
++md.flowequation.vertex_equation(pos)=1;
++pos=find(nodeonmacayealpattyn);
++md.flowequation.vertex_equation(pos)=5;
++pos=find(nodeonstokes);
++md.flowequation.vertex_equation(pos)=4;
++if any(stokesflag),
++	pos=find(~nodeonstokes);
++	if(~any(pattynflag) & ~any(macayealflag)),
++		md.flowequation.vertex_equation(pos)=0;
++	end
++end
++pos=find(nodeonpattynstokes);
++md.flowequation.vertex_equation(pos)=7;
++pos=find(nodeonmacayealstokes);
++md.flowequation.vertex_equation(pos)=6;
++
++%figure out solution types
++md.flowequation.ishutter=double(any(md.flowequation.element_equation==1));
++md.flowequation.ismacayealpattyn=double(any(md.flowequation.element_equation==2 | md.flowequation.element_equation==3));
++md.flowequation.isstokes=double(any(md.flowequation.element_equation==4));
++
++return
++
++%Check that tiling can work:
++if any(md.flowequation.bordermacayeal) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal ~=1),
++	error('error coupling domain too irregular');
++end
++if any(md.flowequation.bordermacayeal) & any(md.flowequation.borderstokes) & any(md.flowequation.borderstokes + md.flowequation.bordermacayeal ~=1),
++	error('error coupling domain too irregular');
++end
++if any(md.flowequation.borderstokes) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.borderstokes~=1),
++	error('error coupling domain too irregular');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setmask2.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setmask2.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setmask2.m	(revision 13009)
+@@ -0,0 +1,148 @@
++function md=setmask2(md,landname,floatingicename,groundedicename)
++%GEOGRAPHY2 - establish land, ice sheet and ice shelf areas in a domains.
++%
++%   Usage:
++%      md=setmask2(md,landname,floatingicename,groundedicename)
++%
++%   Examples:
++%      md=setmask2(md,'LandName.exp','Iceshelves.exp','Islands.exp');
++
++%Get assigned fields
++x=md.mesh.x;
++y=md.mesh.y;
++elements=md.mesh.elements;
++
++%recover elements and nodes on land.
++if ischar(landname),
++	[vertexonland,elementonland]=ContourToMesh(elements,x,y,landname,'element and node',2);
++elseif isfloat(landname),
++	if size(landname,1)~=md.mesh.numberofelements,
++		error('Landname for area must be of same size as number of elements in model');
++	end
++	elementonland=landname;
++	vertexonland=zeros(md.mesh.numberofvertices,1);
++	vertexonland(md.mesh.elements(find(elementonland),:))=1;
++else
++	error('Invalid area option option');
++end
++
++%Now, build the connectivity tables for this mesh.
++if size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices,
++	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++end
++if size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements,
++	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++end
++
++%any element with 3 nodes on land should be on land:
++elementsonwater=find(~elementonland);
++wrongelements=elementsonwater(find(( vertexonland(md.mesh.elements(elementsonwater,1)) + vertexonland(md.mesh.elements(elementsonwater,2)) + vertexonland(md.mesh.elements(elementsonwater,3)) ...
++                  )==3));
++elementonland(wrongelements)=1;
++
++%any element with its barycentre on land should be on land: (only if landname is an expfile)
++if ischar(landname),
++weights={[1;1;1],[2;1;1],[1;2;1],[1;1;2]};
++	for i=1:length(weights),
++		xelem=x(md.mesh.elements)*weights{i}/sum(weights{i});
++		yelem=y(md.mesh.elements)*weights{i}/sum(weights{i});
++	end
++	baryonland=ContourToNodes(xelem,yelem,landname,1);
++	pos=find(~baryonland); elementonland(pos)=0;
++	pos=find(baryonland); elementonland(pos)=1;
++end
++
++%figure out which elements on land are actually in the middle of the ocean!
++pos1=find(elementonland); 
++connectedtoland=md.mesh.elementconnectivity(pos1,:);
++pos=find(connectedtoland); connectedtoland(pos)=1-elementonland(connectedtoland(pos));
++connectedtolandsum=sum(connectedtoland,2);
++waterelements=pos1(find(connectedtolandsum==3));
++elementonland(waterelements)=0;
++
++%figure out which elements on water  are actually in the middle of the land!
++pos1=find(~elementonland); 
++connectedtowater=md.mesh.elementconnectivity(pos1,:);
++pos=find(connectedtowater); connectedtowater(pos)=elementonland(connectedtowater(pos));
++connectedtowatersum=sum(connectedtowater,2);
++landelements=pos1(find(connectedtowatersum==3));
++elementonland(landelements)=1;
++
++%recover arrays of ice shelf nodes and elements, and ice sheet nodes and elements.
++elementonfloatingice=FlagElements(md,floatingicename);
++elementongroundedice=FlagElements(md,groundedicename);
++
++%Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
++%arrays come from domain outlines that can intersect one another: 
++vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
++vertexongroundedice=zeros(md.mesh.numberofvertices,1);
++elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
++elementongroundedice=double(~elementonfloatingice);
++vertexonfloatingice(md.mesh.elements(find(elementonfloatingice),:))=1;
++vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
++
++%now correct, so that none of the floatingice and groundedice elements and nodes are in the water.
++pos=find(~elementonland);
++elementonfloatingice(pos)=0; 
++elementongroundedice(pos)=0;
++
++pos=find(~vertexonland);
++vertexonfloatingice(pos)=0; 
++vertexongroundedice(pos)=0;
++
++%create vertexonwater and elementonwater: 
++vertexonwater=double(~vertexonland);
++elementonwater=double(~elementonland);
++
++%correct for islands:
++vertexonfloatingice=double(vertexonfloatingice & ~vertexongroundedice);
++elementonfloatingice=double(elementonfloatingice & ~elementongroundedice);
++
++%now, groundedices are everything except iceshelves and water
++vertexongroundedice=double(~vertexonfloatingice & ~vertexonwater);
++elementongroundedice=double(~elementonfloatingice & ~elementonwater);
++
++%Deal with segments on neumann:
++
++%Get current connectivity
++mesh.elementconnectivity=md.mesh.elementconnectivity;
++
++%put 0 for elements on water
++pos=find(mesh.elementconnectivity);
++mesh.elementconnectivity(pos)=mesh.elementconnectivity(pos).*(~elementonwater(mesh.elementconnectivity(pos)));
++
++%put line of ones for elements on water
++pos=find(elementonwater);
++mesh.elementconnectivity(pos,:)=1;% line of ones for elements on water so they won't be considered
++
++%resort lines (zeros must be at the last column for findsegments)
++mesh.elementconnectivity=sort(mesh.elementconnectivity,2,'descend');
++
++%call findsegments to build segment using THIS conectivity
++md.mesh.segments=findsegments(md,'mesh.elementconnectivity',mesh.elementconnectivity);
++
++%some final checks: 
++%check that no node thinks it's on an ice shelf or ice sheet, and lies actually in the middle of the water.
++nodesgrounded=find(~vertexonwater);
++lengthconnectivity=size(md.mesh.vertexconnectivity,2);
++groundedcounters=md.mesh.vertexconnectivity(nodesgrounded,lengthconnectivity);
++groundedconnectivity=md.mesh.vertexconnectivity(nodesgrounded,1:lengthconnectivity-1);
++pos=find(groundedconnectivity);
++groundedconnectivity(pos)=elementonwater(groundedconnectivity(pos));
++groundedsum=sum(groundedconnectivity,2);
++errorflags=find(groundedsum==groundedcounters);
++errornodes=nodesgrounded(errorflags);
++
++vertexonwater(errornodes)=1;
++vertexongroundedice(errornodes)=0;
++vertexonfloatingice(errornodes)=0;
++
++%Return: 
++md.mask.vertexonfloatingice=vertexonfloatingice;
++md.mask.elementonfloatingice=elementonfloatingice;
++md.mask.vertexonwater=vertexonwater;
++md.mask.elementonwater=elementonwater;
++md.mask.vertexongroundedice=vertexongroundedice;
++md.mask.elementongroundedice=elementongroundedice;
++
++md.mesh.segmentmarkers(:)=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setmask.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setmask.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setmask.py	(revision 13009)
+@@ -0,0 +1,55 @@
++from numpy import *
++import FlagElements as fe
++
++def setmask(md, floatingicename, groundedicename):
++	#SETMASK - establish boundaries between grounded and floating ice.
++	#
++	#   By default, ice is considered grounded. The contour floatingicename defines nodes 
++	#   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
++	#   that are grounded (ie: ice rises, islands, etc ...)
++	#   All input files are in the Argus format (extension .exp).
++	#
++	#   Usage:
++	#      md=setmask(md,floatingicename,groundedicename)
++	#
++	#   Examples:
++	#      md=setmask(md,'all','');
++	#      md=setmask(md,'Iceshelves.exp','Islands.exp');
++
++	#%Get assigned fields
++	x = md.mesh.x
++	y = md.mesh.y
++	elements = md.mesh.elements
++
++	#Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
++	elementonfloatingice = fe.FlagElements(md, floatingicename)
++	elementongroundedice = fe.FlagElements(md, groundedicename) 
++
++	#Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
++	#arrays come from domain outlines that can intersect one another: 
++
++	elementonfloatingice = logical_and(elementonfloatingice,~elementongroundedice)
++	elementongroundedice = ~elementonfloatingice
++
++	#the order here is important. we choose vertexongroundedice as default on the grounding line.
++	vertexonfloatingice = zeros(md.mesh.numberofvertices,'bool')
++	vertexongroundedice = zeros(md.mesh.numberofvertices,'bool')
++
++	pos=argwhere(elementongroundedice==1)
++	pos=md.mesh.elements[pos,:]-1
++	if pos.size:
++		vertexongroundedice[pos]=True
++
++	pos=argwhere(~vertexongroundedice)
++	if pos.size:
++		vertexonfloatingice[pos]=True;
++	#%}}}
++
++	#Return: 
++	md.mask.elementonfloatingice = double(elementonfloatingice)
++	md.mask.vertexonfloatingice = double(vertexonfloatingice)
++	md.mask.elementongroundedice = double(elementongroundedice)
++	md.mask.vertexongroundedice = double(vertexongroundedice)
++	md.mask.vertexonwater = zeros(md.mesh.numberofvertices)
++	md.mask.elementonwater = zeros(md.mesh.numberofelements)
++	return md
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization	(revision 13008)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization	(revision 13009)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
Index: /issm/oecreview/Archive/12678-13393/ISSM-13009-13010.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13009-13010.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13009-13010.diff	(revision 13394)
@@ -0,0 +1,4744 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.py	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.py	(revision 13010)
+@@ -1,25 +0,0 @@
+-#! /usr/bin/env python
+-def parallelrange(rank,numprocs,globalsize):
+-	"""
+-	PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
+- 
+-	   Usage: 
+-	      i1,i2=parallelrange(rank,numprocs,globalsize)
+-	"""
+-
+-	#We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
+-	num_local_rows=[int(globalsize/numprocs) for i in xrange(numprocs)]
+-
+-	#There may be some rows left. Distribute evenly.
+-	row_rest=globalsize - numprocs*int(globalsize/numprocs)
+-
+-	for i in xrange(row_rest):
+-		num_local_rows[i]=num_local_rows[i]+1
+-
+-	i1=0
+-	for i in xrange(rank-1):
+-		i1+=num_local_rows[i]
+-	i2=i1+num_local_rows[rank-1]-1
+-
+-	return i1,i2
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/QueueRequirements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/QueueRequirements.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/QueueRequirements.m	(revision 13010)
+@@ -1,35 +0,0 @@
+-function QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,queue,np,time)
+-%QUEUEREQUIREMENTS - queue requirements in time, number of cpus, by name of queue.
+-%
+-%   Usage: 
+-%      QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,np,time)
+-
+-%Ok, go through requirements for current queue:
+-index=ismemberi(queue,available_queues);
+-if  ~index,
+-	%ok, either we a generic cluster, with 'none' queue, or we could not find the queue reqruirements
+-	if strcmpi(available_queues{1},'none'),
+-		%reset index to 1, so we can fish the requirements
+-		index=1;
+-	else
+-		string=available_queues{1};
+-		for i=2:length(available_queues),
+-			string=[string ' ' available_queues{i}];
+-		end
+-		error(['QueueRequirements error message: availables queues are ' string]);
+-	end
+-end
+-
+-%check on time requirements
+-rtime=queue_requirements_time(index);
+-if time<=0,
+-	error('QueueRequirements: time should be a positive number');
+-end
+-if time>rtime,
+-	error(['QueueRequirements: time should be < ' num2str(rtime) ' for queue: ' queue]);
+-end
+-
+-%check on np requirements
+-if np<=0,
+-	error('QueueRequirements: np should be a positive number');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/cluster/parallelrange.m	(revision 13010)
+@@ -1,23 +0,0 @@
+-function [i1,i2]=parallelrange(rank,numprocs,globalsize)
+-%PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
+-%
+-%   Usage: 
+-%      [i1,i1]=parallelrange(rank,numprocs,globalsize)
+-
+-num_local_rows=zeros(numprocs,1);
+-
+-for i=1:numprocs,
+-	%we use floor. we under distribute rows. The rows left  are then redistributed, therefore resulting in a more even distribution.
+-	num_local_rows(i)=floor(globalsize/numprocs);
+-end
+-
+-
+-%There may be some rows left. Distribute evenly.
+-row_rest=globalsize - numprocs*floor(globalsize/numprocs);
+-
+-for i=1:row_rest,
+-	num_local_rows(i)=num_local_rows(i)+1;
+-end
+-
+-i1=sum(num_local_rows(1:rank-1))+1;
+-i2=i1+num_local_rows(rank)-1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/ecco32issm.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/ecco32issm.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/ecco32issm.m	(revision 13010)
+@@ -1,8 +0,0 @@
+-function nodefield=ecco32issm(field,transition,xecco3,yecco3)
+-
+-	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
+-	nodefieldlinear=zeros(length(xecco3linear),1);
+-	nodefieldlinear(transition(:,1))=field(transition(:,2));
+-	nodefield=xecco3;
+-	nodefield(:)=nodefieldlinear;
+-	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/issm2ecco3.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/issm2ecco3.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/ecco3/issm2ecco3.m	(revision 13010)
+@@ -1,8 +0,0 @@
+-function nodefield=issm2ecco3(field,transition,xecco3,yecco3)
+-
+-	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
+-	nodefieldlinear=zeros(length(xecco3linear),1);
+-	nodefieldlinear(transition(:,1))=field(transition(:,2));
+-	nodefield=xecco3;
+-	nodefield(:)=nodefieldlinear;
+-	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/isbasin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/isbasin.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/isbasin.m	(revision 13010)
+@@ -1,19 +0,0 @@
+-function isbasin(name)
+-%ISBASIN: figure out if a basin name exists.
+-%
+-%
+-%        Usage:  index=isbasin('jks');
+-%
+-%
+-
+-
+-%First, load basin names:
+-load([jplsvn '/projects/ModelData/Names/Names.mat']);
+-
+-
+-%go through names: 
+-for i=1:length(names),
+-	if ~isempty(strfind(names{i,1},name)),
+-		disp(['''' names{i,1} ''' Long:' num2str(names{i,2}) ' Lat:' num2str(names{i,3}) ]);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/plotbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/plotbasins.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/plotbasins.m	(revision 13010)
+@@ -1,18 +0,0 @@
+-%display all the domain outlines in a directory
+-
+-basins=listfiles;
+-
+-hold on
+-for i=1:length(basins), 
+-	%check whether this is a .exp file
+-	basin=basins{i};
+-	if strcmpi(basin(end-3:end),'.exp'),
+-
+-		contour=expread(basin,0);
+-		x=contour(1).x;
+-		y=contour(1).y;
+-		x0=mean(x); y0=mean(y);
+-		text(x0,y0,basin(1:end-4),'Fontsize',14);
+-		expdisp(basin);
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/showbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/showbasins.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/showbasins.m	(revision 13010)
+@@ -1,69 +0,0 @@
+-function showbasins(varargin)
+-%SHOWBASINS - return basins that are within the xlim and ylim
+-%
+-%   Usage:
+-%      names=showbasins(options);
+-%   Options: 
+-%      'unit' default 1
+-%      'hemisphere': default +1;
+-%      'central_meridian: 45 for Greenland and 0 for Antarctica
+-%      'standard_parallel: 70 for Greenland and 71 for Antarctica
+-%
+-
+-%is varargin an options database already?
+-if nargin==0,
+-	options=pairoptions(varargin{:});
+-elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
+-	%do nothing to the varargin: 
+-	options=varargin{1};
+-else
+-	%process varargin for options: 
+-	options=pairoptions(varargin{:});
+-end
+-
+-
+-%recover some options, and set defaults
+-unitmultiplier=getfieldvalue(options,'unit',1);
+-fontsize=getfieldvalue(options,'fontsize',12);
+-hemisphere=getfieldvalue(options,'hemisphere');
+-
+-if strcmpi(hemisphere,'s'),
+-	hemisphere=-1;
+-elseif strcmpi(hemisphere,'n'),
+-	hemisphere=+1;
+-else
+-	error('showbasins error message: hemispehre should be either ''n'' or ''s''');
+-	end
+-
+-if hemisphere==+1,
+-	central_meridian=getfieldvalue(options,'central_meridian',45);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',70);
+-else
+-	central_meridian=getfieldvalue(options,'central_meridian',0);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',71);
+-end
+-
+-%Ok, find basin we are talking about: 
+-load([jplsvn '/projects/ModelData/Names/Names.mat']);
+-
+-%Get xlim and ylim, and convert into lat,long: 
+-xlimits=xlim; x0=xlimits(1); x1=xlimits(2);
+-ylimits=ylim; y0=ylimits(1); y1=ylimits(2);
+-
+-%Convert names lat and long into x,y:
+-lat=cell2mat(names(:,3));
+-long=cell2mat(names(:,2));
+-
+-%Now, convert lat,long into x,y:
+-[x,y]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
+-
+-%Find  x,y within xlimits and ylimits: 
+-locations=find(x>x0 & x<x1 & y>y0 & y<y1);
+-
+-%Go through locations, and display the names: 
+-for i=1:size(locations,1),
+-	hold on,
+-	plot(x(locations(i)),y(locations(i)),'r.');
+-	t=text(x(locations(i)),y(locations(i)),names{locations(i),1}); 
+-	set(t,'FontSize',fontsize);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/basinzoom.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/basinzoom.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/basins/basinzoom.m	(revision 13010)
+@@ -1,94 +0,0 @@
+-function varargout=basinzoom(varargin)
+-%ANTZOOM - zoom on a basin in Antarctica or Greenland.
+-%
+-%   This function zooms on an existing figure describing Antarctica or Greenland 
+-%   The zooming depends on the region name provided as input. 
+-%
+-%   Usage:
+-%      varargout=basinzoom(options)
+-
+-%recover some options, and set defaults
+-
+-%is varargin an options database already?
+-if nargin==0,
+-	options=pairoptions(varargin{:});
+-elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
+-	%do nothing to the varargin: 
+-	options=varargin{1};
+-else
+-	%process varargin for options: 
+-	options=pairoptions(varargin{:});
+-end
+-
+-unitmultiplier=getfieldvalue(options,'unit',NaN);
+-basin=getfieldvalue(options,'basin');
+-
+-if exist(options,'basindelta'),
+-
+-	basindeltax=getfieldvalue(options,'basindelta',300); 
+-	basindeltay=getfieldvalue(options,'basindelta',300); 
+-else
+-	basindeltax=getfieldvalue(options,'basindeltax',300); 
+-	basindeltay=getfieldvalue(options,'basindeltay',300);
+-end
+-
+-%multiply by 1000 to get kms
+-basindeltax=basindeltax*1000;
+-basindeltay=basindeltay*1000;
+-
+-%Ok, find basin we are talking about: 
+-load([jplsvn() '/projects/ModelData/Names/Names.mat']);
+-		
+-%Go through names: 
+-found=0;
+-for i=1:size(names,1),
+-	if strcmpi(names{i,1},basin),
+-		%ok, we've got the region. Get lat and long: 
+-		long=names{i,2};
+-		lat=names{i,3};
+-		hemisphere=names{i,4};
+-		found=1;
+-		break;
+-	end
+-end
+-
+-if ~found,
+-	error(['basinzoom error message: cannot find basin ' basin '. Use isbasin to determine a basin name.']);
+-end
+-
+-if hemisphere==+1,
+-	central_meridian=getfieldvalue(options,'central_meridian',45);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',70);
+-else
+-	central_meridian=getfieldvalue(options,'central_meridian',0);
+-	standard_parallel=getfieldvalue(options,'standard_parallel',71);
+-end
+-
+-%Transform lat long into x,y: 
+-[xc,yc]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
+-
+-%compute x0,x1 and y0,y1 using basindeltax and basindeltay
+-x0=xc-basindeltax/2;
+-x1=xc+basindeltax/2;
+-y0=yc-basindeltay/2;
+-y1=yc+basindeltay/2;
+-
+-if ~isnan(unitmultiplier)
+-	x0=x0*unitmultiplier;
+-	x1=x1*unitmultiplier;
+-	y0=y0*unitmultiplier;
+-	y1=y1*unitmultiplier;
+-end
+-
+-%if output arguments are present, return the limits, 
+-%otherwise, set them on the current graphic. 
+-if nargout==2,
+-	found=1;
+-	varargout{1}=[x0 x1];
+-	varargout{2}=[y0 y1];
+-else
+-	xlim([x0 x1]);
+-	ylim([y0 y1]);
+-	found=1;
+-	daspect([1;1;1]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay.m	(revision 13010)
+@@ -1,154 +0,0 @@
+-function fielddisplay(md,name,comment)
+-%FIELDDISPLAY - display model field
+-%
+-%   Usage:
+-%      fielddisplay(md,offset,name,comment)
+-
+-	%get field
+-	field=md.(name);
+-
+-	%disp corresponding line as a function of field type (offset set as 9 spaces)
+-	parsedisplay('         ',name,field,comment);
+-
+-end %function
+-
+-function parsedisplay(offset,name,field,comment); %{{{
+-
+-	%string
+-	if ischar(field),
+-
+-		if length(field)>30;
+-			displayunit(offset,name,'not displayed',comment),
+-		else
+-			displayunit(offset,name,['''' field ''''],comment),
+-		end
+-
+-	%numeric
+-	elseif isnumeric(field)
+-
+-		%get size
+-		fieldsize=size(field);
+-
+-		%double
+-		if max(fieldsize)==1,
+-			displayunit(offset,name,num2str(field),comment),
+-		%matrix
+-		else
+-			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
+-		end
+-
+-	%logical
+-	elseif islogical(field)
+-
+-		%get size
+-		fieldsize=size(field);
+-
+-		%single value
+-		if max(fieldsize)==1,
+-			if (field)
+-				displayunit(offset,name,'true',comment),
+-			else
+-				displayunit(offset,name,'false',comment),
+-			end
+-		%matrix
+-		else
+-			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
+-		end
+-
+-		%structure
+-	elseif isstruct(field),
+-		if ~isempty(fields(field))
+-			displayunit(offset,name,'(structure)',comment),
+-			struct_display(field,[offset '   ']),
+-		else
+-			displayunit(offset,name,'N/A',comment),
+-		end
+-
+-	%cell
+-	elseif iscell(field),
+-		cell_display(offset,name,field,comment),
+-
+-	else
+-		displayunit(offset,name,'not displayed',comment),
+-
+-	end
+-end%}}}
+-
+-function struct_display(structure,offset) % {{{
+-
+-	structure_fields=fields(structure);
+-
+-	for i=1:length(structure_fields),
+-
+-		%get current field
+-		field=structure.(structure_fields{i});
+-
+-		%recursive call if necessary
+-		if isstruct(field),
+-			displayunit(offset,structure_fields{i},'(structure)',''),
+-			struct_display(field,[offset '   ']);
+-
+-		%display value
+-		else
+-			parsedisplay(offset,structure_fields{i},field,'');
+-		end
+-	end
+-end% }}}
+-function cell_display(offset,name,field,comment) % {{{
+-
+-	%initialization
+-	string='{';
+-
+-	%go through the cell and fill string
+-	if length(field)<5;
+-		for i=1:length(field),
+-			if ischar(field{i}),
+-				string=[string ''''  field{i} ''','];
+-			elseif (isnumeric(field{i}) & length(field{i})==1)
+-				string=[string num2str(field{i}) ',' ];
+-			else
+-				string='{';
+-				break
+-			end
+-		end
+-	end
+-	if strcmp(string,'{'),
+-		string=['(' num2str(size(field,1)) 'x' num2str(size(field,2)) ')'];
+-	else
+-		string=[string(1:end-1) '}'];
+-	end
+-
+-	%call displayunit
+-	displayunit(offset,name,string,comment);
+-end% }}}
+-function displayunit(offset,name,characterization,comment),% {{{
+-
+-	%take care of name
+-	if length(name)>23,
+-		name=[name(1:20) '...'];
+-	end
+-
+-	%take care of characterization
+-	if (strcmp(characterization,['''' '''']) | strcmp(characterization,'NaN')),
+-		characterization='N/A';
+-	end
+-	if length(characterization)>15,
+-		characterization=[characterization(1:12) '...'];
+-	end
+-
+-	%print
+-	if isempty(comment)
+-		disp(sprintf('%s%-23s: %-15s',offset,name,characterization));
+-	else
+-		if ischar(comment),
+-			disp(sprintf('%s%-23s: %-15s -- %s',offset,name,characterization,comment));
+-		elseif iscell(comment),
+-			disp(sprintf('%s%-23s: %-15s -- %s',offset,name,characterization,comment{1}));
+-			for i=2:length(comment),
+-				disp(sprintf('%s%-23s  %-15s    %s',offset,'','',comment{i}));
+-			end
+-		else
+-			error('fielddisplay error message: format for comment not supportet yet');
+-		end
+-	end
+-end% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay2.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay2.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/display/fielddisplay2.m	(revision 13010)
+@@ -1,14 +0,0 @@
+-function fielddisplay2(md,name,comment)
+-%FIELDDISPLAY2 - display model field
+-%
+-%   Usage:
+-%      fielddisplay2(md,offset,name,comment)
+-
+-	%get field
+-	field=md.(name);
+-
+-	if length(name)>23,
+-		name=[name(1:20) '...'];
+-	end
+-
+-	disp(sprintf('%s%-23s -- %s','      ',name,comment));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/varmap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/varmap.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/varmap.m	(revision 13010)
+@@ -1,55 +0,0 @@
+-function output = varmap(x,y,data,varargin);
+-%VARMAP - use gslib for Kriging
+-%
+-%   Usage:
+-%      output = varmap(x,y,data,varargin)
+-
+-options=pairoptions(varargin{:});
+-
+-nxlag = getfieldvalue(options,'nxlag', 20);
+-nylag = getfieldvalue(options,'nylag', 20);
+-dxlag = getfieldvalue(options,'dxlag', 1000);
+-dylag = getfieldvalue(options,'dylag', 1000);
+-
+-%Write data file
+-fid=fopen('cluster.dat','w');
+-fprintf(fid,'%s\n','Data file');
+-fprintf(fid,'%i\n',3);
+-fprintf(fid,'%s\n','Xlocation');
+-fprintf(fid,'%s\n','Ylocation');
+-fprintf(fid,'%s\n','Data');
+-fprintf(fid,'%g %g %g\n',[x y data]');
+-fclose(fid);
+-
+-%Write parameter file
+-fid=fopen('varmap.par','w');
+-fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
+-fprintf(fid,'\t\t\t\t%s\n','*******************');
+-fprintf(fid,'\n');
+-fprintf(fid,'%s\n','START OF PARAMETERS:');
+-fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
+-fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
+-fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
+-fprintf(fid,'%-30s %s\n','0    '                      ,'\1=regular grid, 0=scattered values');
+-fprintf(fid,'%-30s %s\n','50 50 1'                    ,'\if =1: nx, ny, nz');
+-fprintf(fid,'%-30s %s\n','1.0 1.0 1.0'                ,'\       xsiz, ysiz, zsiz if igrid=1');
+-fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\if =0: columns for x, y and z coordinates');
+-fprintf(fid,'%-30s %s\n','varmap.out'                 ,'\file for variogram output');
+-fprintf(fid,'%-30s %s\n',num2str([nxlag nylag 0],'%i '),'\nxlag, nylag, nzlag');
+-fprintf(fid,'%-30s %s\n',num2str([dxlag dylag 1],'%g %g %i'),'\dxlag, dylag, dzlag');
+-fprintf(fid,'%-30s %s\n','5'                          ,'\minimum number of pairs');
+-fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
+-fprintf(fid,'%-30s %s\n','1'                          ,'\number of variograms');
+-fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail, head, variogram type');
+-fclose(fid);
+-
+-%Call varmap
+-system([issmdir() '/externalpackages/gslib/install/varmap varmap.par']);
+-delete('varmap.par');
+-
+-%Read output
+-fid=fopen('varmap.out','r');
+-A = textscan(fid,'%f %f %f %f %f %f','headerlines',8);
+-fclose(fid);
+-delete('varmap.out')
+-output = reshape(A{1},[2*nxlag+1 2*nylag+1]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataBoundaries.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataBoundaries.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataBoundaries.m	(revision 13010)
+@@ -1,43 +0,0 @@
+-function	[Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
+-%CREATEDATABOUNDARIES - Create values on the edge of the matrix
+-%
+-%   This function create vectors with coordinates and values to constrain a matrix 
+-%   on its edge from a given matrix tiwh data everywhere.
+-%   x_m and y_m belongs to the matrix to be constrained
+-%   x_matrix, y_matrix belongs to the matrix to be constrained with
+-%   datamatrix is the matrix with values for the constraint
+-%
+-%   Usage:
+-%      [Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
+-% 
+-%   See also: TRACKSTOMATRIX, CREATEDATAMATRIX
+-
+-%Check the consistency of the data matrix
+-if(length(x_matrix)~=(size(datamatrix,2)+1) | length(y_matrix)~=(size(datamatrix,1)+1)),
+-	error('CreateDataBoundaries error message: size of matrix and vectors to constrained not consistent')
+-end
+-
+-nxglobal=length(x_m);
+-nyglobal=length(y_m);
+-
+-%Create the edgevalues and coordinates
+-xedge1=x_m(1)*ones(nyglobal,1);
+-xedge2=x_m(2:end-1);
+-xedge3=x_m(end)*ones(nyglobal,1);
+-xedge4=x_m(2:end-1);
+-xedge5=x_m(2)*ones(nyglobal-2,1);
+-xedge6=x_m(3:end-2);
+-xedge7=x_m(end-1)*ones(nyglobal-2,1);
+-xedge8=x_m(3:end-2);
+-yedge1=y_m;
+-yedge2=y_m(1)*ones(nxglobal-2,1);
+-yedge3=y_m;
+-yedge4=y_m(end)*ones(nxglobal-2,1);
+-yedge5=y_m(2:end-1);
+-yedge6=y_m(2)*ones(nxglobal-4,1);
+-yedge7=y_m(2:end-1);
+-yedge8=y_m(end-1)*ones(nxglobal-4,1);
+-
+-Xedge=[xedge1;xedge2;xedge3;xedge4;xedge5;xedge6;xedge7;xedge8];
+-Yedge=[yedge1;yedge2;yedge3;yedge4;yedge5;yedge6;yedge7;yedge8];
+-EdgeValues=DataInterp(x_matrix,y_matrix,datamatrix,Xedge,Yedge);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gamv.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gamv.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gamv.m	(revision 13010)
+@@ -1,70 +0,0 @@
+-function output = gamv(x,y,data,varargin);
+-%GAMV - use gslib for Kriging
+-%
+-%   Usage:
+-%      output = gamv(x,y,data,varargin)
+-
+-options=pairoptions(varargin{:});
+-
+-nlag = getfieldvalue(options,'nlag', 20);
+-dlag = getfieldvalue(options,'dlag', 1000);
+-
+-%Write data file
+-fid=fopen('cluster.dat','w');
+-fprintf(fid,'%s\n','Data file');
+-fprintf(fid,'%i\n',3);
+-fprintf(fid,'%s\n','Xlocation');
+-fprintf(fid,'%s\n','Ylocation');
+-fprintf(fid,'%s\n','Data');
+-fprintf(fid,'%g %g %g\n',[x y data]');
+-fclose(fid);
+-
+-%Write parameter file
+-fid=fopen('gamv.par','w');
+-fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
+-fprintf(fid,'\t\t\t\t%s\n','*******************');
+-fprintf(fid,'\n');
+-fprintf(fid,'%s\n','START OF PARAMETERS:');
+-fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
+-fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
+-fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
+-fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
+-fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
+-fprintf(fid,'%-30s %s\n',num2str(nlag,'%i')           ,'\number of lags');
+-fprintf(fid,'%-30s %s\n',num2str(dlag,'%g')           ,'\lag separation distance');
+-fprintf(fid,'%-30s %s\n',num2str(dlag/2,'%g')         ,'\lag tolerance');
+-fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
+-fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
+-fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
+-fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
+-fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
+-fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
+-fclose(fid);
+-
+-%Call gamv
+-system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
+-delete('gamv.par');
+-
+-%Read output
+-output   = struct('Semivariogram',[],'Covariance',[]);
+-counter1 = 1;
+-counter2 = 1;
+-fid=fopen('gamv.out','r');
+-while (~feof(fid)),
+-	A=fscanf(fid,'%s',1);
+-	if strcmp(A,'Covariance');
+-		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
+-		output(counter1).Covariance=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
+-		counter1=counter1+1;
+-	elseif strcmp(A,'Semivariogram'),
+-		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
+-		output(counter2).Semivariogram=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
+-		counter2=counter2+1;
+-	else
+-		%do nothing
+-	end
+-end
+-fclose(fid);
+-delete('gamv.out')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/pkriging.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/pkriging.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/pkriging.m	(revision 13010)
+@@ -1,55 +0,0 @@
+-function [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
+-%PKRIGING - parallel Kriging
+-%
+-%   Usage:
+-%      [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
+-
+-options=pairoptions(varargin{:});
+-cluster=getfieldvalue(options,'cluster',generic('np',10));
+-options=removefield(options,'cluster',0);
+-name   = ['krig' num2str(feature('GetPid'))];
+-
+-% =========================================   MARSHALL.m =================================================
+-disp(['marshalling file ' name '.bin']);
+-fid=fopen([name '.bin'],'wb');
+-if fid==-1,
+-	error(['marshall error message: could not open ' name '.bin file for binary writing']);
+-end
+-
+-%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
+-WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
+-
+-%Write all data
+-WriteData(fid,'enum',0,'data',x,'format','DoubleMat');
+-WriteData(fid,'enum',1,'data',y,'format','DoubleMat');
+-WriteData(fid,'enum',2,'data',observations,'format','DoubleMat');
+-WriteData(fid,'enum',3,'data',x_interp,'format','DoubleMat');
+-WriteData(fid,'enum',4,'data',y_interp,'format','DoubleMat');
+-options.marshall(fid,5);
+-st=fclose(fid);
+-if st==-1,
+-	error(['marshall error message: could not close file ' name '.bin']);
+-end
+-% =========================================   MARSHALL.m =================================================
+-
+-%Launch job on remote cluster
+-BuildKrigingQueueScript(cluster,name,'',1,0,0); %gather, valgrind, gprof
+-tic
+-LaunchQueueJob(cluster,name,name,{[name '.bin'] [name '.queue']});
+-toc
+-choice=input('Is the job successfully completed? (y/n)','s');
+-Download(cluster,name,{[name '.outbin']});
+-structure=parseresultsfromdisk([name '.outbin'],0);
+-delete([name '.outlog']);
+-delete([name '.errlog']);
+-delete([name '.outbin']);
+-delete([name '.bin']);
+-if ~ispc,
+-	delete([name '.tar.gz']);
+-end
+-
+-%Process results
+-B=structure.AutodiffForward;
+-B=reshape(B,size(x_interp,2),size(x_interp,1))';
+-E=structure.AutodiffIsautodiff;
+-E=reshape(E,size(x_interp,2),size(x_interp,1))';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/MisfitDeinterlace.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/MisfitDeinterlace.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/MisfitDeinterlace.m	(revision 13010)
+@@ -1,21 +0,0 @@
+-function Jstruct=MisfitDeinterlace(misfit,type)
+-%MISFITDEINTERLACE - deinterlace misfits that are mixed together, using type.
+-%
+-%   Usage:
+-%      Jstruct=MisfitDeinterlace(misfit,type)
+-%
+-%   Example:
+-%      Jstruct=MisfitDeinterlace(md.results.diagnostic.J,md.fit)
+-%
+-%
+-Jstruct=struct();
+-
+-count=1;
+-for i=0:max(type),
+-	pos=find(type==i);
+-	if length(pos),
+-		Jstruct(count).type=i;
+-		Jstruct(count).J=misfit(pos);
+-		count=count+1;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.fig
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/addtrack.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/addtrack.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/addtrack.m	(revision 13010)
+@@ -1,156 +0,0 @@
+-function [x_m2 y_m2 values2]=addtrack(x_m1,y_m1,values1,track_coord,track_values,distance,exponent,varargin),
+-%ADDTRACK - modify a map to take values of a track
+-%
+-%   This routine modifies a map to improve it with values of tracks.
+-%   This output map has more values than the input one so that the values
+-%   of the tracks are relevant.
+-%   x_m1 and y_m1 are two vectors containing the coordinates of the matrix
+-%   the distance between two points must be the same everywhere
+-%   values1 is a matrix of size (y_m1-1)*(x_m1-1)
+-%   trac_coord is an exp file containing the coordinates of the tracks (x and y)
+-%   trav_values is a vector with the values along the track coordinates
+-%   distance indicates the distance from the tracks where points have to be modified
+-%   exposant allows to chance the influence of the track and the map
+-%   it must be positive and usually is superior to 1.
+-%
+-%   Usage:
+-%      [x_m2 y_m2 values1 values2]=addtrack(x_m1,y_m1,values1,track_coord,track_values,distance,exposant[,subdivision])
+-%
+-%   Example:
+-%      [xnew ynew valuesnew]=addtrack(x_m,y_m,thickness,'trackcoord.exp',thickness_track,1000,2)
+-%      [xnew ynew valuesnew]=addtrack(x_m,y_m,thickness,'trackcoord.exp',thickness_track,1000,2,3)
+-
+-%Create a new picture precise enough to be modified by the tracks
+-%Read the points of the tracks
+-stru=expread(track_coord,1);
+-nods=stru.nods;
+-xtracks=stru.x';
+-ytracks=stru.y';
+-
+-%First check that the parameters are ok:
+-if (size(track_values,1)~=nods)  || (size(xtracks,2)~=nods) || (size(ytracks,2)~=nods),
+-	error('addtrack error message : track coordinates and track values must have the same size');
+-elseif distance<0,
+-	error('addtrack error message : the distance must be a positive value');
+-elseif exponent<0,
+-	error('addtrack error message : the exponent must be a positive value');
+-elseif (size(x_m1,1)~=(size(values1,2)+1)) || (size(y_m1,1)~=(size(values1,1)+1)),
+-	error('addtrack error message : problem in the map, check the size of x_m1, y_m1 and values1');
+-end
+-
+-%stru.nods=4;
+-%xtracks=[50 50 55 62]; % 2 3 4 5 6 7 8 9 1 ]';
+-%ytracks=[40 40.5 41 41]; % 5 5 5 5 5 5 5 5 8 ]';
+-%x_m1=[1:10:101]';
+-%y_m1=[1:10:101]';
+-%track_values=2*ones(4,1);
+-%values1=ones(10,10);
+-
+-%Find the average distance between two points of the tracks
+-av_x=sum(abs(diff(xtracks)))/(stru.nods-1);
+-av_y=sum(abs(diff(ytracks)))/(stru.nods-1);
+-dist_av=sqrt(av_x^2+av_y^2);
+-
+-%Calculate the multiplicate factor for the new values:
+-if nargin==7,
+-	mult=round((x_m1(2)-x_m1(1))/(1*dist_av));
+-else
+-	mult=varargin{1};
+-end
+-
+-%Plug the values in the new multiplied matrix
+-values=zeros(mult*size(values1,1),mult*size(values1,2));
+-
+-for i=1:mult,
+-	for j=1:mult,
+-		values(i:mult:end,j:mult:end)=values1;
+-	end
+-end
+-
+-%Create the new x and y addapted to the matrix
+-x_m2=linspace(x_m1(1),x_m1(end),mult*(size(x_m1,1)-1)+1)';
+-y_m2=linspace(y_m1(1),y_m1(end),mult*(size(y_m1,1)-1)+1)';
+-
+-%Create a new set of x and y correponding to the medium value on the matrix
+-x_med=(x_m2(1:end-1)+x_m2(2:end))/2;
+-y_med=(y_m2(1:end-1)+y_m2(2:end))/2;
+-
+-numrow=size(y_med,1);
+-numcol=size(x_med,1);
+-
+-%Create new x and y to have the hole matrix
+-x_mat=repmat(x_med',numrow,1);
+-y_mat=repmat(y_med,1,numcol);
+-
+-%Remove useless points of the track
+-points=find(track_values==0);
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-points=find(isnan(track_values));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-%Remove points outside of the map
+-points=find(xtracks<x_med(1) | xtracks>x_med(end) | ytracks<y_med(1) | ytracks>y_med(end));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-%initialize some matrices
+-numoverlap=zeros(numrow,numcol);
+-weights=zeros(numrow,numcol);
+-weightsvalues=zeros(numrow,numcol);
+-
+-%Loop over the points of the track
+-nel=size(track_values,1);
+-fprintf('%s','      track processing progress:   0.00 %');
+-for i=1:nel;
+-	if mod(i,1000)==0,
+-		fprintf('\b\b\b\b\b\b\b')
+-		fprintf('%5.2f%s',i/nel*100,' %');
+-	end
+-
+-	x=xtracks(i);
+-	y=ytracks(i);
+-
+-	%get indices that are modified
+-	indexx1=max(find(x_med<x-distance));
+-	if isempty( indexx1), indexx1=1; end
+-	indexx2=min(find(x_med>x+distance));
+-	if isempty( indexx2), indexx2=numrow; end
+-	indexy1=max(find(y_med<y-distance));
+-	if isempty( indexy1), indexy1=1; end
+-	indexy2=min(find(y_med>y+distance));
+-	if isempty( indexy2), indexy2=numcol; end
+-
+-
+-	%get weighing coefficient
+-	val=track_values(i);
+-	distances=sqrt((x-x_mat(indexy1:indexy2,indexx1:indexx2)).^2+(y-y_mat(indexy1:indexy2,indexx1:indexx2)).^2);
+-	coeff=min(1,(distances/distance)).^(1/exponent);
+-
+-	%update numoverlap and weights
+-	numoverlap(indexy1:indexy2,indexx1:indexx2)=numoverlap(indexy1:indexy2,indexx1:indexx2)+1;
+-	weights(indexy1:indexy2,indexx1:indexx2)=weights(indexy1:indexy2,indexx1:indexx2)+coeff;
+-	weightsvalues(indexy1:indexy2,indexx1:indexx2)=weightsvalues(indexy1:indexy2,indexx1:indexx2)+(1-coeff)*val;
+-
+-end
+-if nel>1000,
+-	fprintf('\b\b\b\b\b\b\b\b')
+-	fprintf('%4.2f%s\n',100,' %');
+-end
+-
+-
+-%Change the values of numoverlap to 1 if 0 since we are going to devide by this matrix
+-numoverlap(find(~numoverlap))=1;
+-
+-%Same thing for weights since values far from the tracks don't change
+-weights(find(~weights))=1;
+-
+-%Create the final matrix depending on the previous matrix
+-values=(values.*weights+weightsvalues)./numoverlap;
+-
+-%Plug the values of the track in the new matrix
+-values2=values;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/TracksToMatrix.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/TracksToMatrix.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/TracksToMatrix.m	(revision 13010)
+@@ -1,84 +0,0 @@
+-function [x_f y_f MatData]=TracksToMatrix(xmin,ymin,nx,ny,posting,track_coord,track_values,theta,varargin),
+-%TRACKSTOMATRIX - Create a map from tracks
+-%
+-%   This routine creates a map from tracks using a Kriging algorithm given by the package DACE.
+-%   - xmin and ymin are two scalars that are the extreme values of the data matrix one wants to create
+-%   - posting is a scalar giving the posting of the matrix to be created in meters
+-%   - trac_coord is an Argus file containing the coordinates of the tracks (x and y)
+-%   - trav_values is a vector with the values along the track coordinates
+-%   - theta is a parameter of the correlation function stricly positive
+-%   varagin can contain a matrix of data to constrain the matrix to be created
+-%   it shoud contain indices x and y and the matrix
+-%
+-%   Usage:
+-%      [x_ y_f MatData]=TracksToMatrix(xmin,ymin,nx,ny,posting,track_coord,track_values,theta),
+-%
+-%   Example:
+-%      [x_f y_f Thickness]=TracksToMatrix(-10^6,10^6,200,180,1000,'trackcoord.exp',thickness_values,theta),
+-%      [x_f y_f Thickness]=TracksToMatrix(-10^6,10^6,200,180,1000,'trackcoord.exp',thickness_values,theta,x_m,y_m,globalthickness),
+-%
+-%   See also: CREATEDATABOUNDARIES, CREATEDATAMATRIX
+-
+-%some checks
+-if nargin~=8 & nargin~=11,
+-	error(' TracksToMatrix error message: wrong number of arguments')
+-end
+-
+-%Add path to dace
+-addpath([issmdir() '/externalpackages/dace/install'])
+-
+-%First create the x_m and y_m fot the matrix
+-x_f=[xmin:posting:xmin+posting*nx]';
+-y_f=[ymin:posting:ymin+posting*ny]';
+-
+-%Now create a bigger map we will then truncate
+-x_m=[xmin-posting*nx/2:posting:xmin+posting*nx*3/2]';
+-y_m=[ymin-posting*ny/2:posting:ymin+posting*ny*3/2]';
+-
+-%Create DataMatrix with local averaging of tracks
+-[Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values);
+-
+-%Create vector for these coordinates and values
+-Svalue=sparse(Mvalue);
+-Sx=sparse(Mx);
+-Sy=sparse(My);
+-[i,j,Values]=find(Svalue);
+-[i,j,X]=find(Sx);
+-[i,j,Y]=find(Sy);
+-Coord=[X,Y];
+-
+-%Create boundaries for the track if specified
+-if nargin==11,
+-	disp('      constain the border of matrix with global matrix');
+-	%Find out the elements to counstrain the border
+-	x_matrix=varargin{1};
+-	y_matrix=varargin{2};
+-	datamatrix=varargin{3};
+-
+-	%Create values on the border of the smaller map
+-	[Xedge,Yedge,EdgeValues]=CreateDataBoundaries(x_m,y_m,x_matrix,y_matrix,datamatrix);
+-
+-	%Create values on the border of the larger map
+-	[Xedge2,Yedge2,EdgeValues2]=CreateDataBoundaries(x_f,y_f,x_matrix,y_matrix,datamatrix);
+-
+-	%Add these values to the track values
+-	Values=[Values;EdgeValues;EdgeValues2];
+-	Coord=[X,Y;Xedge,Yedge;Xedge2,Yedge2];
+-end
+-
+-%Create model for data
+-disp('      create the statiscal model of the data');
+-[dmodel,perf]=dacefit(Coord,Values,@regpoly1,@corrgauss,theta);
+-
+-%Create design site(points where we are looking for the data)
+-Points=nodesamp([x_f(1)+posting/2,y_f(1)+posting/2;x_f(end)-posting/2,y_f(end)-posting/2],[length(x_f)-1;length(y_f)-1]);
+-
+-%Compute data on these points
+-disp('      predict the values');
+-VecData=predictor(Points,dmodel);
+-
+-%Reshape to get a matrix
+-MatData=reshape(VecData,ny,nx);
+-
+-%remove DACE path
+-rmpath([issmdir() '/externalpackages/dace/install']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gslib.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gslib.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/gslib.m	(revision 13010)
+@@ -1,112 +0,0 @@
+-function output = gslib(x,y,data,varargin);
+-%GSLIB - use gslib for Kriging
+-%
+-%   Usage:
+-%      output = gslib(x,y,data,varargin)
+-
+-%Output Matrix
+-xmin   = xl(1);
+-ymin   = yl(1);
+-nx     = 101;
+-ny     = 101;
+-deltax = 5000;
+-deltay = 5000;
+-
+-%Variogram
+-nugget=10;
+-sill  =164;
+-range =25763;
+-
+-%Kriging options
+-mindata = 1;
+-maxdata = 50;
+-maxsearchradius = 50000;
+-
+-%Some intermediaries (Convert to gslib's parameters);
+-c = (sill-nugget);
+-a = sqrt(3)*range;
+-
+-%Write data file
+-fid=fopen('cluster.dat','w');
+-fprintf(fid,'%s\n','Data file');
+-fprintf(fid,'%i\n',3);
+-fprintf(fid,'%s\n','Xlocation');
+-fprintf(fid,'%s\n','Ylocation');
+-fprintf(fid,'%s\n','Data');
+-fprintf(fid,'%g %g %g\n',[x y data]');
+-fclose(fid);
+-
+-if 0, %GAMV
+-	%Write parameter file
+-	fid=fopen('gamv.par','w');
+-	fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
+-	fprintf(fid,'\t\t\t\t%s\n','*******************');
+-	fprintf(fid,'\n');
+-	fprintf(fid,'%s\n','START OF PARAMETERS:');
+-	fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
+-	fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
+-	fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
+-	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
+-	fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
+-	fprintf(fid,'%-30s %s\n','20'                         ,'\number of lags');
+-	fprintf(fid,'%-30s %s\n','5.0'                        ,'\lag separation distance');
+-	fprintf(fid,'%-30s %s\n','3.0'                        ,'\lag tolerance');
+-	fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
+-	fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
+-	fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-	fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
+-	fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
+-	fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
+-	fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
+-	fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
+-	fclose(fid);
+-
+-	%Call gamv
+-	system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
+-
+-else, %Kriging KB2D
+-	%Write parameter file
+-	fid=fopen('kb2d.par','w');
+-	fprintf(fid,'\t\t\t\t%s\n','Parameters for KB2D');
+-	fprintf(fid,'\t\t\t\t%s\n','*******************');
+-	fprintf(fid,'\n');
+-	fprintf(fid,'%s\n','START OF PARAMETERS:');
+-	fprintf(fid,'%-30s %s\n','./cluster.dat'                  ,'\file with data');
+-	fprintf(fid,'%-30s %s\n','1 2 3'                          ,'\columns for X, Y and variable');
+-	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'                 ,'\trimming limits');
+-	fprintf(fid,'%-30s %s\n','0'                              ,'\debugging level: 0,1,2,3');
+-	fprintf(fid,'%-30s %s\n','kb2d.dbg'                       ,'\file for debuggging output');
+-	fprintf(fid,'%-30s %s\n','kb2d.out'                       ,'\file for kriged output');
+-	fprintf(fid,'%-30s %s\n',num2str([nx xmin deltax],'%i %10g %6g')  ,'\nx, xmn, xsiz');
+-	fprintf(fid,'%-30s %s\n',num2str([ny ymin deltay],'%i %10g %6g')  ,'\nx, xmn, xsiz');
+-	fprintf(fid,'%-30s %s\n','1 1'                            ,'\x and y block discretization');
+-	fprintf(fid,'%-30s %s\n',num2str([mindata maxdata],'%6g') ,'\min and max data for kriging');
+-	fprintf(fid,'%-30s %s\n',num2str(maxsearchradius,'%6g')   ,'\max search radius');
+-	fprintf(fid,'%-30s %s\n','1 2.302'                        ,'\0=SK, 1=OK, (mean if SK)');
+-	fprintf(fid,'%-30s %s\n',['1 ' num2str(nugget)]           ,'\nst, nugget effect');
+-	fprintf(fid,'%-30s %s\n',['3 ' num2str([c 0.0 a a],'%10g')],'\it, c, azm, a_max, a_min');
+-	fclose(fid);
+-
+-	tic;system([issmdir() '/externalpackages/gslib/install/kb2d kb2d.par']);toc;
+-	delete('kb2d.par');
+-
+-	%Read output
+-	fid=fopen('kb2d.out','r');
+-	while (~feof(fid)),
+-		A=fscanf(fid,'%s',1);
+-		if strcmp(A,'KB2D');
+-			A=fscanf(fid,'%s',1); %Read output
+-			params=fscanf(fid,'%i %i %i %i %g %g %g %g %g %g %1',[11 1]);
+-		elseif strcmp(A,' Estimate'),
+-			continue;
+-		elseif strcmp(A,'Estimation'),
+-			A=fscanf(fid,'%s',1); %Read Variance
+-			A=fscanf(fid,'%g %g',[params(1) params(2)*params(3)]);
+-			B=A(1,:); B=reshape(B,[params(3),params(2)])';
+-			E=A(2,:); E=reshape(E,[params(3),params(2)])';
+-		else
+-			%do nothing
+-		end
+-	end
+-	fclose(fid);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataMatrix.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataMatrix.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/CreateDataMatrix.m	(revision 13010)
+@@ -1,94 +0,0 @@
+-function [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values),
+-%CREATEDATAMATRIX - Create a map with average values of map 
+-%
+-%   This routine creates a map with average values of tracks.
+-%   x_m1 and y_m1 are two vectors containing the coordinates of the matrix
+-%   trac_coord is an exp file containing the coordinates of the tracks (x and y)
+-%   trav_values is a vector with the values along the track coordinates
+-%
+-%   Usage:
+-%      [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,track_coord,track_values),
+-%
+-%   Example:
+-%      [Mvalue Mx My]=CreateDataMatrix(x_m,y_m,'trackcoord.exp',thickness_track)
+-%
+-%   See also: CREATEDATABOUNDARIES, TRACKSTOMATRIX
+-
+-%Read the points of the tracks
+-stru=expread(track_coord,1);
+-nods=stru.nods;
+-xtracks=stru.x';
+-ytracks=stru.y';
+-
+-%First check that the parameters are ok:
+-if (size(track_values,1)~=nods)  || (size(xtracks,2)~=nods) || (size(ytracks,2)~=nods),
+-	error('CreateDataMatrix error message : track coordinates and track values must have the same size');
+-end
+-
+-%Compute number of rows and columns
+-numrow=size(y_m,1)-1;
+-numcol=size(x_m,1)-1;
+-
+-%Remove useless points of the track
+-points=find(track_values==0);
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-points=find(isnan(track_values));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-points=find(track_values<0);
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-points=find(xtracks<x_m(1) | xtracks>x_m(end) | ytracks<y_m(1) | ytracks>y_m(end));
+-track_values(points)=[];
+-xtracks(points)=[];
+-ytracks(points)=[];
+-
+-%initialize some matrices
+-numpoints=zeros(numrow,numcol);
+-value=zeros(numrow,numcol);
+-coordx=zeros(numrow,numcol);
+-coordy=zeros(numrow,numcol);
+-
+-%Loop over the points of the track
+-nel=size(track_values,1);
+-fprintf('%s','      track processing progress:   0.00 %');
+-for i=1:nel;
+-	if mod(i,1000)==0,
+-		fprintf('\b\b\b\b\b\b\b')
+-		fprintf('%5.2f%s',i/nel*100,' %');
+-	end
+-
+-	x=xtracks(i);
+-	y=ytracks(i);
+-
+-	%get indices for the matrix
+-	indexx=max(find(x_m<x));
+-	indexy=max(find(y_m<y));
+-
+-	%get weighing coefficient
+-	val=track_values(i);
+-
+-	%update numoverlap and weights
+-	numpoints(indexy,indexx)=numpoints(indexy,indexx)+1;
+-	value(indexy,indexx)=value(indexy,indexx)+val;
+-	coordx(indexy,indexx)=coordx(indexy,indexx)+x;
+-	coordy(indexy,indexx)=coordy(indexy,indexx)+y;
+-
+-end
+-if nel>1000,
+-	fprintf('\b\b\b\b\b\b\b\b')
+-	fprintf('%4.2f%s\n',100,' %');
+-end
+-
+-%Change the values of numoverlap to 1 if 0 since we are going to devide by this matrix
+-numpoints(find(~numpoints))=1;
+-
+-%Create the center of mass for coordiantes and values.
+-Mvalue=value./numpoints;
+-Mx=coordx./numpoints;
+-My=coordy./numpoints;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/dataprocessing/data_processing_tool.m	(revision 13010)
+@@ -1,467 +0,0 @@
+-function varargout = data_processing_tool(varargin)
+-%DATA_PROCESSING_TOOL - GUI to process binary data
+-%
+-%   this routine is a GUI that helps the user to open
+-%   a binary file (Little Endian, Big Endian, Float 32,
+-%   double,...) and save a Matlab file (.mat) with the
+-%   processed data and the coordinates
+-%
+-%   Usage:
+-%      data_processing_tool
+-
+-	gui_Singleton = 1;
+-	gui_State = struct('gui_Name',       mfilename, ...
+-		'gui_Singleton',  gui_Singleton, ...
+-		'gui_OpeningFcn', @data_processing_tool_OpeningFcn, ...
+-		'gui_OutputFcn',  @data_processing_tool_OutputFcn, ...
+-		'gui_LayoutFcn',  [] , ...
+-		'gui_Callback',   []);
+-	if nargin && ischar(varargin{1})
+-		gui_State.gui_Callback = str2func(varargin{1});
+-	end
+-
+-	if nargout
+-		[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
+-	else
+-		gui_mainfcn(gui_State, varargin{:});
+-	end
+-end
+-
+-function data_processing_tool_OpeningFcn(hObject, eventdata, handles, varargin)
+-	handles.output = hObject;
+-
+-	%enable toolbar (useful for caxis...)
+-	set(hObject,'toolbar','figure');
+-
+-	% Update handles structure
+-	guidata(hObject, handles);
+-
+-	%this variable used to prevent users from breaking the GUI
+-	%the variable is set to 1 once the data has been processed
+-	handles.processDataCompleted=0;
+-
+-	%initialize other variables
+-	handles.Msize=NaN;
+-	handles.Nsize=NaN;
+-	handles.numvectors=NaN;
+-	handles.endian=NaN;
+-	handles.datatype=NaN;
+-	handles.dx=NaN;
+-	handles.dy=NaN;
+-	handles.xEast=NaN;
+-	handles.yNorth=NaN;
+-
+-	%two files permitted
+-	set(handles.inputFile,'Max',1);
+-	set(handles.inputFile,'Min',0);
+-
+-	% Update handles structure
+-	guidata(hObject, handles);
+-end
+-
+-% --- Outputs from this function are returned to the command line.
+-function varargout = data_processing_tool_OutputFcn(hObject, eventdata, handles) 
+-
+-	% Get default command line output from handles structure
+-	varargout{1} = handles.output;
+-end
+-
+-
+-function inputFile_Callback(hObject, eventdata, handles)
+-%no code needed for this callback, the listbox is only used as a visual
+-end
+-
+-function addFiles_pushbutton_Callback(hObject, eventdata, handles)
+-	%gets input file(s) from user. the sample data files have extension .s2p
+-	[input_file,pathname] = uigetfile( ...
+-		{'*.*', 'All Files (*.*)'}, ...
+-		'Select files', ... 
+-		'MultiSelect', 'on');
+-
+-	%if file selection is cancelled, pathname should be zero
+-	%and nothing should happen
+-	if pathname==0
+-		return
+-	end
+-
+-	handles.processDataCompleted=1;
+-
+-	%gets the current data file names inside the listbox
+-	inputFileName=get(handles.inputFile,'String');
+-
+-	%if they only select one file, then the data will not be a cell
+-	inputFileName= fullfile(pathname,input_file);
+-
+-	%updates the gui to display all filenames in the listbox
+-	set(handles.inputFile,'String',inputFileName);
+-
+-	%make sure first file is always selected so it doesn't go out of range
+-	%the GUI will break if this value is out of range
+-	set(handles.inputFile,'Value',1);
+-
+-	% Update handles structure
+-	guidata(hObject, handles);
+-end
+-
+-function reset_pushbutton_Callback(hObject, eventdata, handles)
+-	%resets the GUI by clearing all relevant fields
+-
+-	handles.processDataCompleted = 0;
+-
+-	%clears the axes
+-	cla(handles.axes1,'reset');
+-
+-	%set the popupmenu to default value
+-%	set(handles.plot_popupmenu,'Value',1);
+-
+-	%clears the contents of the listbox
+-	set(handles.inputFile,'String','');
+-	set(handles.inputFile,'Value',0);
+-
+-	%updates the handles structure
+-	guidata(hObject, handles);
+-end
+-
+-function plotdata_pushbutton_Callback(hObject, eventdata, handles)
+-
+-	%get the list of input file names from the listbox
+-	inputFileName=get(handles.inputFile,'String');
+-
+-	%checks to see if the user selected any input files
+-	%if not, nothing happens
+-	if isempty(inputFileName)
+-		errordlg('Select a file first!')
+-		return
+-	end
+-
+-	%disables the button while data is processing
+-	disableButtons(handles);
+-	refresh(data_processing_tool); 
+-
+-	%parse options
+-	if ~isnan(handles.Msize)
+-		M=handles.Msize;
+-	else
+-		errordlg('Number of lines (M) not valid')
+-		return
+-	end
+-	if ~isnan(handles.Nsize)
+-		N=handles.Nsize;
+-	else
+-		errordlg('Number of rows (N) not valid')
+-		return
+-	end
+-	if ~isnan(handles.numvectors)
+-		numvectors=handles.numvectors;
+-		%change M
+-		M=numvectors*M;
+-	else
+-		numvectors=1;
+-	end
+-	if ~isnan(handles.endian)
+-		endian=handles.endian;
+-	else
+-		endian=1;
+-	end
+-	if ~isnan(handles.datatype)
+-		datatype=handles.datatype;
+-	else
+-		datatype='float32';
+-	end
+-
+-	%open file
+-	if endian==1
+-		fid=fopen(inputFileName,'r','ieee-be');
+-	else
+-		fid=fopen(inputFileName,'r','ieee-le');
+-	end
+-
+-	%read file
+-	[u, numpoints]=fread(fid, [M,N],datatype);
+-
+-	%close file
+-	fclose(fid);
+-
+-	%Pair of vectors?
+-	if numvectors==2,
+-	   vx=u(1:2:M,:);vx=flipud(vx');
+-	   vy=u(2:2:M,:);vx=flipud(vx');
+-
+-		%keep track
+-		handles.vx=vx;
+-		handles.vy=vy;
+-
+-		u=sqrt(vx.^2+vy.^2);
+-	end
+-
+-	cla(handles.axes1); %clear the axes
+-	axes(handles.axes1); %set the axes to plot
+-	grid on
+-	imagesc(u)
+-	colorbar
+-
+-	%keep track
+-	handles.u=u;
+-
+-	%to see whether the data has been processed or not
+-	handles.processDataCompleted=2;
+-
+-	%data is done processing, so re-enable the buttons
+-	enableButtons(handles);
+-	guidata(hObject, handles);
+-end
+-
+-function plotcoord_Callback(hObject, eventdata, handles)
+-
+-	%check
+-	if handles.processDataCompleted<2
+-		errordlg('Process data first !')
+-		return
+-	end
+-
+-	%parse options
+-	if ~isnan(handles.dx)
+-		dx=handles.dx;
+-	else
+-		errordlg('value of x-spacing not supported')
+-		return
+-	end
+-	if ~isnan(handles.dy)
+-		dy=handles.dy;
+-	else
+-		errordlg('value of y-spacing not supported')
+-		return
+-	end
+-	if ~isnan(handles.xEast)
+-		xEast=handles.xEast;
+-	else
+-		errordlg('value of xEast not supported')
+-		return
+-	end
+-	if ~isnan(handles.yNorth)
+-		yNorth=handles.yNorth;
+-	else
+-		errordlg('value of yNorth not supported')
+-		return
+-	end
+-
+-	disableButtons(handles);
+-
+-	%process coordinates
+-	u=handles.u;
+-	s=size(u);
+-	M=s(1)+1;
+-	N=s(2)+1;
+-
+-	%correction North and East -> real
+-	yNorth=yNorth-M*dy; % corner north
+-	x_m=xEast+dx*(0:N-1)';
+-	y_m=yNorth+dy*(0:M-1)';
+-
+-	%plot new axes
+-	cla(handles.axes1); %clear the axes
+-	axes(handles.axes1); %set the axes to plot
+-	grid on
+-	imagesc(x_m,y_m,handles.u)
+-	set(handles.axes1,'Ydir','Normal');
+-	colorbar
+-
+-	%Keep track of x_m and y_m
+-	handles.x_m=x_m;
+-	handles.y_m=y_m;
+-
+-	%to see whether the data has been processed or not
+-	handles.processDataCompleted=3;
+-
+-	%data is done processing, so re-enable the buttons
+-	enableButtons(handles);
+-	guidata(hObject, handles);
+-
+-end
+-
+-
+-function save_pushbutton_Callback(hObject, eventdata, handles)
+-	%if the data hasn't been processed yet, 
+-	%nothing happens when this button is pressed
+-	if (handles.processDataCompleted ~= 3)
+-		return
+-	end
+-
+-	disableButtons(handles);
+-
+-	if handles.numvectors==2,
+-
+-		prompt={'Enter the name of the variable 1:','Enter the name of the variable 2:','Enter the name of the file:'};
+-		name='Save Matlab File';
+-		numlines=1;
+-		defaultanswer={'vx','vy','ProcessedFile'};
+-		answer=inputdlg(prompt,name,numlines,defaultanswer);
+-		variablename1=answer{1};
+-		variablename2=answer{2};
+-		filename=answer{3};
+-
+-		if ~isempty(variablename1) & ~isempty(variablename2) & ~isempty(filename)
+-			%get the variables
+-			x_m=handles.x_m;
+-			y_m=handles.y_m;
+-			eval([variablename1 ' = handles.vx;']);
+-			eval([variablename2 ' = handles.vy;']);
+-			x_m=handles.x_m;
+-			eval(['save ' filename ' x_m y_m ' variablename1 ' ' variablename2 ]);
+-			disp(['in the file ' filename ' have been saved the following variables: x_m, y_m, ' variablename1 ' and ' variablename2])
+-		end
+-	else
+-		prompt={'Enter the name of the variable:','Enter the name of the file:'};
+-		name='Save Matlab File';
+-		numlines=1;
+-		defaultanswer={'thickness','ProcessedFile'};
+-		answer=inputdlg(prompt,name,numlines,defaultanswer);
+-		variablename=answer{1};
+-		filename=answer{2};
+-
+-		if ~isempty(variablename) & ~isempty(filename)
+-			%get the variables
+-			x_m=handles.x_m;
+-			y_m=handles.y_m;
+-			eval([variablename ' = handles.u;']);
+-			eval(['save ' filename ' x_m y_m ' variablename]);
+-			disp(['in the file ' filename ' have been saved the following variables: x_m, y_m, and ' variablename])
+-		end
+-	end
+-	enableButtons(handles);
+-	guidata(hObject, handles);
+-end
+-
+-function inputFile_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function disableButtons(handles)
+-	set(handles.figure1,'Pointer','watch');
+-	set(handles.plotdata_pushbutton,'Enable','off');
+-	set(handles.plotcoord,'Enable','off');
+-	set(handles.save_pushbutton,'Enable','off');
+-	set(handles.addFiles_pushbutton,'Enable','off');
+-	set(handles.reset_pushbutton,'Enable','off');
+-end
+-
+-function enableButtons(handles)
+-	set(handles.figure1,'Pointer','arrow');
+-	set(handles.plotdata_pushbutton,'Enable','on');
+-	set(handles.plotcoord,'Enable','on');
+-	set(handles.save_pushbutton,'Enable','on');
+-	set(handles.addFiles_pushbutton,'Enable','on');
+-	set(handles.reset_pushbutton,'Enable','on');
+-end
+-
+-function EndianType_Callback(hObject, eventdata, handles)
+-	handles.endian=get(handles.EndianType,'Value');
+-	guidata(hObject, handles);
+-end
+-
+-function EndianType_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function DataType_Callback(hObject, eventdata, handles)
+-
+-	datatype= get(handles.DataType,'Value');
+-	switch datatype
+-		case 1
+-			string='float32';
+-
+-		case 2
+-			string='single';
+-
+-		case 3
+-			string='float64';
+-
+-		case 4
+-			string='double';
+-		end
+-	handles.datatype=string;
+-	guidata(hObject, handles);
+-end
+-
+-function DataType_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function PairOfVectors_Callback(hObject, eventdata, handles)
+-	handles.numvectors = get(handles.PairOfVectors,'Value');
+-	guidata(hObject, handles);
+-end
+-
+-function PairOfVectors_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function Msize_Callback(hObject, eventdata, handles)
+-	handles.Msize=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-
+-function Msize_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function Nsize_Callback(hObject, eventdata, handles)
+-	handles.Nsize=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-
+-function Nsize_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function dx_Callback(hObject, eventdata, handles)
+-	handles.dx=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function dx_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function dy_Callback(hObject, eventdata, handles)
+-	handles.dy=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function dy_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function xEast_Callback(hObject, eventdata, handles)
+-	handles.xEast=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function xEast_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+-
+-function yNorth_Callback(hObject, eventdata, handles)
+-	handles.yNorth=eval(get(hObject,'String'));
+-	guidata(hObject, handles);
+-end
+-function yNorth_CreateFcn(hObject, eventdata, handles)
+-	if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+-		set(hObject,'BackgroundColor','white');
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.py	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.py	(revision 13010)
+@@ -1,95 +0,0 @@
+-from AnalysisConfiguration import *
+-from EnumDefinitions import *
+-
+-def AnalysisConfiguration(solutiontype): #{{{
+-	"""
+-	ANALYSISCONFIGURATION - return type of analyses, number of analyses 
+-
+-		Usage:
+-			[analyses, numanalyses]=AnalysisConfiguration(solutiontype);
+-	"""
+-
+-	if   solutiontype == DiagnosticSolutionEnum:
+-		numanalyses=5
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum]
+-
+-	elif solutiontype == SteadystateSolutionEnum:
+-		numanalyses=7 
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum]
+-
+-	elif solutiontype == ThermalSolutionEnum:
+-		numanalyses=2 
+-		analyses=[ThermalAnalysisEnum,MeltingAnalysisEnum]
+-
+-	elif solutiontype == EnthalpySolutionEnum:
+-		numanalyses=1 
+-		analyses=[EnthalpyAnalysisEnum]
+-
+-	elif solutiontype == PrognosticSolutionEnum:
+-		numanalyses=1 
+-		analyses=[PrognosticAnalysisEnum]
+-
+-	elif solutiontype == BalancethicknessSolutionEnum:
+-		numanalyses=1 
+-		analyses=[BalancethicknessAnalysisEnum]
+-
+-	elif solutiontype == SurfaceSlopeSolutionEnum:
+-		numanalyses=1 
+-		analyses=[SurfaceSlopeAnalysisEnum]
+-
+-	elif solutiontype == BedSlopeSolutionEnum:
+-		numanalyses=1 
+-		analyses=[BedSlopeAnalysisEnum]
+-
+-	elif solutiontype == TransientSolutionEnum:
+-		numanalyses=9 
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum,EnthalpyAnalysisEnum,PrognosticAnalysisEnum]
+-
+-	elif solutiontype == FlaimSolutionEnum:
+-		numanalyses=1 
+-		analyses=[FlaimAnalysisEnum]
+-
+-	elif solutiontype == HydrologySolutionEnum:
+-		numanalyses=3 
+-		analyses=[BedSlopeAnalysisEnum,SurfaceSlopeAnalysisEnum,HydrologyAnalysisEnum]
+-
+-	else:
+-		raise TypeError("solution type: '%s' not supported yet!" % EnumToString(solutiontype))
+-
+-	return analyses,numanalyses
+-#}}}
+-
+-def ismodelselfconsistent(md):
+-	"""
+-	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+-
+-	   Usage:
+-	      ismodelselfconsistent(md),
+-	"""
+-
+-	#initialize consistency as true
+-	md.private.isconsistent=True
+-
+-	#Get solution and associated analyses
+-	solution=md.private.solution
+-	analyses,numanalyses=AnalysisConfiguration(solution)
+-
+-	#Go through a model fields, check that it is a class, and call checkconsistency
+-	fields=vars(md)
+-	for field in fields.iterkeys():
+-
+-		#Some properties do not need to be checked
+-		if field in ['results','debug','radaroverlay']:
+-			continue
+-
+-		#Check that current field is an object
+-		if not hasattr(getattr(md,field),'checkconsistency'):
+-			md.checkmessage("field '%s' is not an object." % field)
+-
+-		#Check consistency of the object
+-		exec("md.%s.checkconsistency(md,solution,analyses)" % field)
+-
+-	#error message if mode is not consistent
+-	if not md.private.isconsistent:
+-		raise RuntimeError('Model not consistent, see messages above.')
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/ismodelselfconsistent.m	(revision 13010)
+@@ -1,100 +0,0 @@
+-function ismodelselfconsistent(md),
+-%ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+-%
+-%   Usage:
+-%      ismodelselfconsistent(md),
+-
+-%initialize consistency as true
+-md.private.isconsistent=true;
+-
+-%Get solution and associated analyses
+-solution=md.private.solution;
+-[analyses,numanalyses]=AnalysisConfiguration(solution);
+-
+-%Go through a model field, check that it is a class, and call checkconsistency
+-fields=properties('model');
+-for i=1:length(fields),
+-	field=fields{i};
+-
+-	%Some properties do not need to be checked
+-	if ismember(field,{'results' 'debug' 'radaroverlay'}),
+-		continue;
+-	end
+-
+-	%Check that current field is an object
+-	if ~isobject(md.(field))
+-		md=checkmessage(md,['field ''' char(field) ''' is not an object']);
+-	end
+-
+-	%Check consistency of the object
+-	if verLessThan('matlab', '7.6')
+-		md=checkconsistency(md.(field),md,solution,analyses);
+-	else
+-		md=md.(field).checkconsistency(md,solution,analyses);
+-	end
+-end
+-
+-%error message if mode is not consistent
+-if md.private.isconsistent==false,
+-	error('Model not consistent, see messages above');
+-end
+-end
+-
+-function [analyses,numanalyses]=AnalysisConfiguration(solutiontype), % {{{
+-%ANALYSISCONFIGURATION - return type of analyses, number of analyses 
+-%
+-%   Usage:
+-%      [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
+-
+-
+-
+-switch solutiontype,
+-
+-	case DiagnosticSolutionEnum,
+-		numanalyses=5;
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum];
+-
+-	case SteadystateSolutionEnum,
+-		numanalyses=7; 
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum];
+-
+-	case ThermalSolutionEnum,
+-		numanalyses=2; 
+-		analyses=[ThermalAnalysisEnum;MeltingAnalysisEnum];
+-
+-	case EnthalpySolutionEnum,
+-		numanalyses=1; 
+-		analyses=[EnthalpyAnalysisEnum];
+-
+-	case PrognosticSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[PrognosticAnalysisEnum];
+-
+-	case BalancethicknessSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[BalancethicknessAnalysisEnum];
+-
+-	case SurfaceSlopeSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[SurfaceSlopeAnalysisEnum];
+-
+-	case BedSlopeSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[BedSlopeAnalysisEnum];
+-
+-	case TransientSolutionEnum,
+-		numanalyses=9; 
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;EnthalpyAnalysisEnum;PrognosticAnalysisEnum];
+-
+-	case FlaimSolutionEnum,
+-		numanalyses=1; 
+-		analyses=[FlaimAnalysisEnum];
+-
+-	case HydrologySolutionEnum,
+-		numanalyses=3; 
+-		analyses=[BedSlopeAnalysisEnum;SurfaceSlopeAnalysisEnum;HydrologyAnalysisEnum];
+-
+-	otherwise
+-		error('%s%s%s',' solution type: ',EnumToString(solutiontype),' not supported yet!');
+-
+-end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.m	(revision 13010)
+@@ -76,6 +76,4 @@
+ 	%else
+ 	bool=0;
+ 	return;
+-
+ end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/roundmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/roundmesh.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/roundmesh.m	(revision 13010)
+@@ -19,7 +19,7 @@
+ x_list=radius*x_list.*cos(theta);
+ y_list=radius*y_list.*sin(theta);
+ A=struct('x',x_list,'y',y_list,'density',1);
+-expgen('RoundDomainOutline.exp',A,1);
++expwrite('RoundDomainOutline.exp',A);
+ 
+ %Call Bamg
+ md=triangle(md,'RoundDomainOutline.exp',resolution);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expremovestraightsegments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expremovestraightsegments.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expremovestraightsegments.m	(revision 13010)
+@@ -1,31 +0,0 @@
+-function expremovestraightsegments(newfilename,filename,cutoff)
+-%EXPREMOVESTRAIGHTSEGMENTS:  remove straight segments connecting contours.
+-%
+-% Usage: expremovestraightsegments('argus.exp',100); 
+-%
+-%
+-
+-a=expread(filename,1);
+-newcontours=a(1);
+-
+-for i=1:length(a),
+-	contour=a(i);
+-	
+-	s=sqrt(contour.x.^2+contour.y.^2);
+-	d=diff(s);
+-	
+-	pos=find(abs(d)>cutoff);
+-	pos=[0;pos;length(contour.x)];
+-
+-	for j=1:length(pos)-1,
+-
+-		newcontour=contour;
+-		newcontour.x=contour.x(pos(j)+1:pos(j+1));
+-		newcontour.y=contour.y(pos(j)+1:pos(j+1));
+-		newcontour.nods=length(newcontour.x);
+-		newcontours(end+1)=newcontour;
+-	end
+-end
+-newcontours=newcontours(2:end);
+-
+-expwrite(newcontours,newfilename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expgen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expgen.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expgen.m	(revision 13010)
+@@ -1,47 +0,0 @@
+-function expgen(file_name,contours,close_flag);
+-%EXPGEN - create an Argus file from x and y arrays
+-%
+-%   Create .exp domain outline type out of x,y  coordinates. 
+-%   The contour defined by arrays x and y should not be closed. 
+-%   Generated domain outline will not be closed, except if close_flag is set to 1.
+-%
+-%   Usage:
+-%      expgen(file_name,contours,close_flag)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%Check on inputs
+-if((close_flag~=0) & (close_flag~=1)),
+-error('close flag must be 0 of 1');
+-end
+-fid=fopen(file_name,'wt');
+-
+-for i=1:length(contours),
+-	if(length(contours(i).x)~=length(contours(i).y)),
+-	error('contours x and y coordinates must be of identical size');
+-	end
+-
+-	%get density for this profile.
+-	if isfield(contours,'density'),
+-		density=contours(i).density;
+-	end
+-
+-	fprintf(fid,'%s\n','## Name:');
+-	fprintf(fid,'%s\n','## Icon:0');
+-	fprintf(fid,'%s\n','# Points Count Value');
+-	if(close_flag==0),
+-	fprintf(fid,'%i %i\n',length(contours(i).x),density);
+-	else
+-	fprintf(fid,'%i %i\n',length(contours(i).x)+1,density);
+-	end
+-	fprintf(fid,'%s\n','# X pos Y pos');
+-	for j=1:length(contours(i).x),
+-	 fprintf(fid,'%f %f\n',contours(i).x(j),contours(i).y(j));
+-	end  
+-
+-	if(close_flag==1),
+-	fprintf(fid,'%f %f\n',contours(i).x(1),contours(i).y(1));
+-	end
+-	fprintf(fid,'%s\n','');
+-end
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expwrite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expwrite.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expwrite.m	(revision 13010)
+@@ -1,38 +0,0 @@
+-function expwrite(a,filename);
+-%EXPWRITE - write an Argus file from a structure given in input
+-%
+-%   This routine write an Argus file form a structure containing the fields:
+-%   x and y of the coordinates of the points.
+-%   The first argument is the structure containing the points coordinates 
+-%   and the second one the file to be write.
+-%
+-%   Usage:
+-%      expwrite(a,filename)
+-% 
+-%   Example:
+-%      expwrite(coordstruct,'domainoutline.exp')
+-%
+-%   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
+-
+-fid=fopen(filename,'w');
+-for n=1:length(a),
+-   
+-   if isfield(a,'name'),
+-	   if ~isempty(a(n).name),
+-		   fprintf(fid,'%s%s\n','## Name:',a(n).name);
+-	   else
+-		   fprintf(fid,'%s\n','## Name:');
+-	   end
+-   else
+-	   fprintf(fid,'%s\n','## Name:');
+-   end
+-   
+-   fprintf(fid,'%s\n','## Icon:0');
+-   fprintf(fid,'%s\n','# Points Count Value');
+-   fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
+-   fprintf(fid,'%s\n','# X pos Y pos');
+-	fprintf(fid,'%10.10f %10.10f\n',[a(n).x a(n).y]');
+-	fprintf(fid,'\n','');
+-   
+-end
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expread.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/readwrite/expread.m	(revision 13010)
+@@ -1,81 +0,0 @@
+-function Struct=expread(filename);
+-%EXPREAD - read a file exp and build a Structure
+-%
+-%   This routine reads a file .exp and build a Structure containing the 
+-%   fields x and y corresponding to the coordinates, one for the filename of
+-%   the exp file, for the density, for the nodes, and a field closed to 
+-%   indicate if the domain is closed. 
+-%   The first argument is the .exp file to be read and the second one (optional) 
+-%   indicate if the last point shall be read (1 to read it, 0 not to).
+-%
+-%   Usage:
+-%      Struct=expread(filename)
+-%  
+-%   Example:
+-%      Struct=expread('domainoutline.exp')
+-%      Struct=expread('domainoutline.exp')
+-%
+-%   See also EXPDOC, EXPWRITEASVERTICES
+-
+-%some checks
+-if ~exist(filename),
+-	error(['expread error message: file ' filename ' not found!']);
+-end
+-
+-%initialize number of profile
+-count=0;
+-
+-%open file
+-fid=fopen(filename,'r');
+-
+-%loop over the number of profiles
+-while (~feof(fid)),
+-
+-	%update number of profiles
+-   count=count+1;
+-
+-   %Get file name
+-	A=fscanf(fid,'%s %s',2);
+-	if ~strncmp(A,'##Name:',7), break; end
+-	if length(A)>7, 
+-		Struct(count).name=A(8:end);
+-	else
+-		Struct(count).name='';
+-	end
+-
+-	%Get Icon
+-	A=fscanf(fid,'%s %s',2);
+-	if ~strncmp(A,'##Icon:',6), break; end
+-
+-	%Get Info
+-	A=fscanf(fid,'%s %s %s %s',4);
+-	if ~strncmp(A,'#Points',7), break; end
+-
+-	%Get number of nods and density
+-   A=fscanf(fid,'%f %f',[1 2]);
+-   Struct(count).nods=A(1);
+-   Struct(count).density=A(2);
+-
+-	%Get Info
+-	A=fscanf(fid,'%s %s %s %s',5);
+-	if ~strncmp(A,'#XposYpos',9), break; end
+-
+-	%Get Coordinates
+-	A=fscanf(fid,'%f %f',[2 Struct(count).nods]);
+-	Struct(count).x=A(1,:)';
+-	Struct(count).y=A(2,:)';
+-
+-	if(Struct(count).nods~=length(Struct(count).x))error(['Profile ' num2str(count) ' reports incorrect length']); end;
+-
+-	%Check if closed
+-	if (Struct(count).nods > 1) && ...
+-	   (Struct(count).x(end) == Struct(count).x(1)) && ...
+-	   (Struct(count).y(end) == Struct(count).y(1))
+-		Struct(count).closed=true;
+-	else
+-		Struct(count).closed=false;
+-	end
+-end
+-
+-%close file
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expboxgen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expboxgen.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expboxgen.m	(revision 13010)
+@@ -1,99 +0,0 @@
+-function expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
+-%EXPBOXGEN -  creates a domain outline box for a tiff image
+-%
+-%   This function creates a domain outline box for a .tif image for the 
+-%   mosaic tiff. 
+-%   x0,y0 and x1,y1 are the cropping coordinates (upper left and lower right 
+-%   corners in the larger tiff image).
+-%   paramter_filename is the parameter file name for the mosaic tiff image.
+-%   box_filename is self explanatory.
+-%
+-%   Usage:
+-%      expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%initialize
+-nrows=-1;
+-ncols=-1;
+-X0=-1;
+-Y0=-1;
+-posting=-1;
+-
+-%first recover necessary information from the paramter_filename.
+-fid=fopen(parameter_filename,'r');
+-count=1;
+-while(1),
+-tline=fgetl(fid);
+-if ~isstr(tline), break; end;
+-
+-ind=findstr('ant125m',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-a=a(2); a=char(a); a=a(1:length(a)-1);
+-posting=str2num(a);
+-end
+-
+-
+-ind=findstr('no. of rows   :',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-nrows=str2num(char(a(length(a))));
+-end
+-
+-ind=findstr('no. of columns:',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-ncols=str2num(char(a(length(a))));
+-end
+-
+-ind=findstr('Upper Left X:',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-X0=str2num(char(a(length(a))));
+-end
+-
+-ind=findstr('Upper Left Y:',tline);
+-if ~isempty(ind),
+-a=strsplit(tline,' ');
+-Y0=str2num(char(a(length(a))));
+-end
+-
+-
+-end %while(1),
+-
+-
+-fclose(fid);
+-
+-if (X0==-1 | Y0==-1 | nrows==-1  | ncols==-1 | posting==-1),
+-disp(' ');
+-disp(['Could not recover all parameters from ' parameter_filename]);
+-disp('Here are the paramters recovered thus far: ');
+-disp(['no. of rows: ' num2str(nrows)]);
+-disp(['no. of columns: ' num2str(ncols)]);
+-disp(['Upper Left X: ' num2str(X0)]);
+-disp(['Upper Left Y: ' num2str(Y0)]);
+-disp(['Posting: ' num2str(posting)]);
+-end
+-
+-disp(' ');
+-disp(['Recovered the following parameters from ' parameter_filename]);
+-disp(['no. of rows: ' num2str(nrows)]);
+-disp(['no. of columns: ' num2str(ncols)]);
+-disp(['Upper Left X: ' num2str(X0)]);
+-disp(['Upper Left Y: ' num2str(Y0)]);
+-disp(['Posting: ' num2str(posting)]);
+-
+-%Create X,Y, arrays of coordinates:
+-X(1)=X0+x0*posting
+-Y(1)=Y0-y0*posting
+-X(2)=X(1);
+-Y(2)=Y(1)-ny*posting;
+-X(3)=X(1)+nx*posting;
+-Y(3)=Y(2);
+-Y(4)=Y(1);
+-X(4)=X(3);
+-plot(X,Y,'r*');
+-
+-%Create box exp file using X and Y. Loop it.
+-expgen(box_filename,X,Y,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecircle.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecircle.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecircle.m	(revision 13010)
+@@ -1,31 +0,0 @@
+-function expcreatecircle(filename,x0,y0,radius,numberofnodes)
+-%EXPCREATECIRCLE - create a circular contour corresponding to given parameters
+-%
+-%   Creates a closed argus contour centered on x,y of radius size.
+-%   The contour is made of numberofnodes
+-%
+-%   Usage:
+-%      expcreatecircle(filename,x0,y0,radius,numberofnodes)
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%Calculate the cartesians coordinates of the points
+-x_list=ones(numberofnodes+1,1);
+-y_list=ones(numberofnodes+1,1);
+-
+-theta=(0:2*pi/numberofnodes:2*pi*(1-1/numberofnodes))';
+-theta=[theta;0];
+-
+-x_list=radius*x_list.*cos(theta);
+-y_list=radius*y_list.*sin(theta);
+-
+-%offset x_list and y_list by x0 and y0:
+-x_list=x_list+x0;
+-y_list=y_list+y0;
+-
+-contour.x=x_list;
+-contour.y=y_list;
+-contour.density=1;
+-contour.name='circle';
+-
+-expwrite(contour,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/ginputquick.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/ginputquick.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/ginputquick.m	(revision 13010)
+@@ -1,221 +0,0 @@
+-function [out1,out2,out3] = ginput(arg1)
+-%GINPUT - Graphical input from mouse.
+-%
+-%   [X,Y] = GINPUT(N) gets N points from the current axes and returns 
+-%   the X- and Y-coordinates in length N vectors X and Y.  The cursor
+-%   can be positioned using a mouse (or by using the Arrow Keys on some 
+-%   systems).  Data points are entered by pressing a mouse button
+-%   or any key on the keyboard except carriage return, which terminates
+-%   the input before N points are entered.
+-%
+-%   [X,Y] = GINPUT gathers an unlimited number of points until the
+-%   return key is pressed.
+-% 
+-%   [X,Y,BUTTON] = GINPUT(N) returns a third result, BUTTON, that 
+-%   contains a vector of integers specifying which mouse button was
+-%   used (1,2,3 from left) or ASCII numbers if a key on the keyboard
+-%   was used.
+-%
+-%   Usage:
+-%      [out1,out2,out3] = ginput(arg1)
+-
+-%   Copyright 1984-2005 The MathWorks, Inc.
+-%   $Revision: 1.1 $  $Date: 2009/04/03 22:56:26 $
+-
+-out1 = []; out2 = []; out3 = []; y = [];
+-c = computer;
+-if ~strcmp(c(1:2),'PC') 
+-   tp = get(0,'TerminalProtocol');
+-else
+-   tp = 'micro';
+-end
+-
+-if ~strcmp(tp,'none') && ~strcmp(tp,'x') && ~strcmp(tp,'micro'),
+-   if nargout == 1,
+-      if nargin == 1,
+-         out1 = trmginput(arg1);
+-      else
+-         out1 = trmginput;
+-      end
+-   elseif nargout == 2 || nargout == 0,
+-      if nargin == 1,
+-         [out1,out2] = trmginput(arg1);
+-      else
+-         [out1,out2] = trmginput;
+-      end
+-      if  nargout == 0
+-         out1 = [ out1 out2 ];
+-      end
+-   elseif nargout == 3,
+-      if nargin == 1,
+-         [out1,out2,out3] = trmginput(arg1);
+-      else
+-         [out1,out2,out3] = trmginput;
+-      end
+-   end
+-else
+-   
+-   fig = gcf;
+-   figure(gcf);
+-   
+-   if nargin == 0
+-      how_many = -1;
+-      b = [];
+-   else
+-      how_many = arg1;
+-      b = [];
+-      if  ischar(how_many) ...
+-            || size(how_many,1) ~= 1 || size(how_many,2) ~= 1 ...
+-            || ~(fix(how_many) == how_many) ...
+-            || how_many < 0
+-         error('MATLAB:ginput:NeedPositiveInt', 'Requires a positive integer.')
+-      end
+-      if how_many == 0
+-         ptr_fig = 0;
+-         while(ptr_fig ~= fig)
+-            ptr_fig = get(0,'PointerWindow');
+-         end
+-         scrn_pt = get(0,'PointerLocation');
+-         loc = get(fig,'Position');
+-         pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+-         out1 = pt(1); y = pt(2);
+-      elseif how_many < 0
+-         error('MATLAB:ginput:InvalidArgument', 'Argument must be a positive integer.')
+-      end
+-   end
+-   
+-   % Suspend figure functions
+-   state = uisuspend(fig);
+-   
+-   toolbar = findobj(allchild(fig),'flat','Type','uitoolbar');
+-   if ~isempty(toolbar)
+-        ptButtons = [uigettool(toolbar,'Plottools.PlottoolsOff'), ...
+-                     uigettool(toolbar,'Plottools.PlottoolsOn')];
+-        ptState = get (ptButtons,'Enable');
+-        set (ptButtons,'Enable','off');
+-   end
+-
+-   set(fig,'pointer','fullcrosshair');
+-   fig_units = get(fig,'units');
+-   char = 0;
+-
+-   % We need to pump the event queue on unix
+-   % before calling WAITFORBUTTONPRESS 
+-   drawnow
+-   
+-   while how_many ~= 0
+-      % Use no-side effect WAITFORBUTTONPRESS
+-      waserr = 0;
+-      try
+-	keydown = wfbp;
+-      catch
+-	waserr = 1;
+-      end
+-      if(waserr == 1)
+-         if(ishandle(fig))
+-            set(fig,'units',fig_units);
+-	    uirestore(state);
+-            error('MATLAB:ginput:Interrupted', 'Interrupted');
+-         else
+-            error('MATLAB:ginput:FigureDeletionPause', 'Interrupted by figure deletion');
+-         end
+-      end
+-      
+-      ptr_fig = get(0,'CurrentFigure');
+-      if(ptr_fig == fig)
+-         if keydown
+-            char = get(fig, 'CurrentCharacter');
+-            button = abs(get(fig, 'CurrentCharacter'));
+-            scrn_pt = get(0, 'PointerLocation');
+-            set(fig,'units','pixels')
+-            loc = get(fig, 'Position');
+-            pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+-            set(fig,'CurrentPoint',pt);
+-         else
+-            button = get(fig, 'SelectionType');
+-            if strcmp(button,'open') 
+-               button = 1;
+-            elseif strcmp(button,'normal') 
+-               button = 1;
+-            elseif strcmp(button,'extend')
+-               button = 2;
+-            elseif strcmp(button,'alt') 
+-               button = 3;
+-            else
+-               error('MATLAB:ginput:InvalidSelection', 'Invalid mouse selection.')
+-            end
+-         end
+-         pt = get(gca, 'CurrentPoint');
+-         
+-         how_many = how_many - 1;
+-         
+-         if(char == 13) % & how_many ~= 0)
+-            % if the return key was pressed, char will == 13,
+-            % and that's our signal to break out of here whether
+-            % or not we have collected all the requested data
+-            % points.  
+-            % If this was an early breakout, don't include
+-            % the <Return> key info in the return arrays.
+-            % We will no longer count it if it's the last input.
+-            break;
+-         end
+-
+-         out1 = [out1;pt(1,1)];
+-         y = [y;pt(1,2)];
+-         b = [b;button];
+-      end
+-   end
+-   
+-   uirestore(state);
+-   if ~isempty(toolbar) && ~isempty(ptButtons)
+-        set (ptButtons(1),'Enable',ptState{1});
+-        set (ptButtons(2),'Enable',ptState{2});
+-   end
+-   set(fig,'units',fig_units);
+-   
+-   if nargout > 1
+-      out2 = y;
+-      if nargout > 2
+-         out3 = b;
+-      end
+-   else
+-      out1 = [out1 y];
+-   end
+-
+-   line(out1,y);
+-   line([out1(length(out1)) out1(1)],[y(length(y)) y(1)]);
+-   
+-end
+-
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-function key = wfbp
+-%WFBP   Replacement for WAITFORBUTTONPRESS that has no side effects.
+-
+-fig = gcf;
+-current_char = [];
+-
+-% Now wait for that buttonpress, and check for error conditions
+-waserr = 0;
+-try
+-  h=findall(fig,'type','uimenu','accel','C');   % Disabling ^C for edit menu so the only ^C is for
+-  set(h,'accel','');                            % interrupting the function.
+-  keydown = waitforbuttonpress;
+-  current_char = double(get(fig,'CurrentCharacter')); % Capturing the character.
+-  if~isempty(current_char) && (keydown == 1)           % If the character was generated by the 
+-	  if(current_char == 3)                       % current keypress AND is ^C, set 'waserr'to 1
+-		  waserr = 1;                             % so that it errors out. 
+-	  end
+-  end
+-  
+-  set(h,'accel','C');                                 % Set back the accelerator for edit menu.
+-catch
+-  waserr = 1;
+-end
+-drawnow;
+-if(waserr == 1)
+-   set(h,'accel','C');                                % Set back the accelerator if it errored out.
+-   error('MATLAB:ginput:Interrupted', 'Interrupted');
+-end
+-
+-if nargout>0, key = keydown; end
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expmaster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expmaster.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expmaster.m	(revision 13010)
+@@ -1,2 +0,0 @@
+-function expmaster(newfile,varargin)
+-	disp('expmaster has been renamed exptool due to the unpopularity of its name')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exporientation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exporientation.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exporientation.m	(revision 13010)
+@@ -1,12 +0,0 @@
+-function exporientation(filename)
+-
+-a=expread(filename);
+-
+-dx=diff(a.x);
+-dx=[dx;dx(end)];
+-
+-dy=diff(a.y);
+-dy=[dy;dy(end)];
+-
+-quiver(a.x,a.y,dx,dy);
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsplit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsplit.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsplit.m	(revision 13010)
+@@ -1,31 +0,0 @@
+-function expsplit(domainoutline)
+-%EXPSPLIT - split exp file into sub-contours
+-%
+-%   This routine reads in a domain outline file (Argus format) and plots all the contours 
+-%   This will create as many files there are contours in the domain, each file will be postfix with _i
+-%   where i is the contour name. 
+-%
+-%   Usage:
+-%      expsplit(domainoutline)
+-%
+-%   Example:
+-%      expsplit('Domain.exp');
+-%
+-%   See also EXPMASTER, EXPDOC
+-
+-%check nargin
+-if ~nargin | nargin>1
+-	help expsplit
+-	error('expsplit error message: bad usage');
+-end
+-
+-[path,root,ext]=fileparts(domainoutline);
+-
+-%Read file: 
+-domains=expread(domainoutline,1);
+-
+-%split and write contours: 
+-for i=1:length(domains),
+-	subdomain=domains(i);
+-	expwrite(subdomain,[root '_' num2str(i)  ext]);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expdoc.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expdoc.m	(revision 13010)
+@@ -1,36 +0,0 @@
+-function expdoc()
+-%EXPDOC - create a doc for EXP routines
+-%
+-%   Usage:
+-%      expdoc()
+-
+-disp(' ');
+-disp('   Utilities dedicated to ARGUS Files (''.exp'' extension)'); 
+-disp('     expboxgen: creates a domain outline box for a .tif image for the mosaic tiff');
+-disp('            usage: expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)');
+-disp('            x0,y0 and nx,ny are the cropping coordinates (upper left and lower right corners in the larger tiff image)');
+-disp('            paramter_filename is the parameter file name for the mosaic tiff image. box_filename is self explanatory.');
+-disp('     expconcatenate: display all the profiles present in an Argus file and merge them accordingly to the tips selected by the user')
+-disp('            usage:  expconcatenate(newfile,oldfile)')
+-disp('     expcreatecircle: creates a closed Argus contour centered on (x,y), of radius radius_length. The contour is made of N points');
+-disp('            usage: expcreatecircle(filename,x0,y0,radius_length,N)');
+-disp('     expcreatecontour: creates a closed Argus contour delimited by the ''clicks'' of the user');
+-disp('            usage: expcreatecontour(filename)');
+-disp('     expcreateprofile: creates an Argus profile delimited by the ''clicks'' of the user');
+-disp('            usage: expcreateprofile(filename)');
+-disp('     expcut: display the contents of an Argus file and allow the user cut the profiles');
+-disp('            usage: expcut(newfilename,oldfilename)');
+-disp('     expdisp: display the contents of an Argus file');
+-disp('            usage:  expdisp(filename,[figure number],[line style])');
+-disp('     expgen: creates an Argus file from a contour (x,y) and a flag indicating if the contour must be closed or open');
+-disp('            usage:  expgen(filename,contours,close_flag)');
+-disp('     explink: takes a domain outline made of various segments, and links them together in one domain outline. Use expview to see end result');
+-disp('            usage: explink(domainoutline,minthreshold,step)');
+-disp('     exptool: allows the user to create, close, merge, remove,... Argus files and save the result in newfile');
+-disp('            usage: exptool(newfile,[oldfile1],[oldfile2],[oldfile3],[...]');
+-disp('     expread: reads an Argus file and build a structure that holds all the information of the file');
+-disp('            usage: expread(file,close_flag)');
+-disp('     expselect: display all the profiles of oldfile, the user clicks on the contour he/she wants to remove. Results saved in newfile');
+-disp('            usage: expselect(newfile,oldfile)');
+-disp('     expwrite: writes an Argus file from a structure given in input???');
+-disp('            usage: expwrite(structure,filename)');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.m	(revision 13010)
+@@ -0,0 +1,81 @@
++function Struct=expread(filename);
++%EXPREAD - read a file exp and build a Structure
++%
++%   This routine reads a file .exp and build a Structure containing the 
++%   fields x and y corresponding to the coordinates, one for the filename of
++%   the exp file, for the density, for the nodes, and a field closed to 
++%   indicate if the domain is closed. 
++%   The first argument is the .exp file to be read and the second one (optional) 
++%   indicate if the last point shall be read (1 to read it, 0 not to).
++%
++%   Usage:
++%      Struct=expread(filename)
++%  
++%   Example:
++%      Struct=expread('domainoutline.exp')
++%      Struct=expread('domainoutline.exp')
++%
++%   See also EXPDOC, EXPWRITEASVERTICES
++
++%some checks
++if ~exist(filename),
++	error(['expread error message: file ' filename ' not found!']);
++end
++
++%initialize number of profile
++count=0;
++
++%open file
++fid=fopen(filename,'r');
++
++%loop over the number of profiles
++while (~feof(fid)),
++
++	%update number of profiles
++   count=count+1;
++
++   %Get file name
++	A=fscanf(fid,'%s %s',2);
++	if ~strncmp(A,'##Name:',7), break; end
++	if length(A)>7, 
++		Struct(count).name=A(8:end);
++	else
++		Struct(count).name='';
++	end
++
++	%Get Icon
++	A=fscanf(fid,'%s %s',2);
++	if ~strncmp(A,'##Icon:',6), break; end
++
++	%Get Info
++	A=fscanf(fid,'%s %s %s %s',4);
++	if ~strncmp(A,'#Points',7), break; end
++
++	%Get number of nods and density
++   A=fscanf(fid,'%f %f',[1 2]);
++   Struct(count).nods=A(1);
++   Struct(count).density=A(2);
++
++	%Get Info
++	A=fscanf(fid,'%s %s %s %s',5);
++	if ~strncmp(A,'#XposYpos',9), break; end
++
++	%Get Coordinates
++	A=fscanf(fid,'%f %f',[2 Struct(count).nods]);
++	Struct(count).x=A(1,:)';
++	Struct(count).y=A(2,:)';
++
++	if(Struct(count).nods~=length(Struct(count).x))error(['Profile ' num2str(count) ' reports incorrect length']); end;
++
++	%Check if closed
++	if (Struct(count).nods > 1) && ...
++	   (Struct(count).x(end) == Struct(count).x(1)) && ...
++	   (Struct(count).y(end) == Struct(count).y(1))
++		Struct(count).closed=true;
++	else
++		Struct(count).closed=false;
++	end
++end
++
++%close file
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecontour.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecontour.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreatecontour.m	(revision 13010)
+@@ -15,7 +15,7 @@
+ 
+ %Get contour
+ disp('Click on contour points you desire. Type RETURN to end input of points');
+-[x,y]=ginputquick;
++[x,y]=ginput();
+ 
+ %close contour
+ x=[x;x(1)];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expexcludeoutliers.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expexcludeoutliers.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expexcludeoutliers.m	(revision 13010)
+@@ -1,5 +1,6 @@
+ function excludeoutliers(newcontourname,contourname,domainname)
+-%EXCLUDEOUTLIERS exclude points of contour that are not within the domain  contour. return new contours in a different file.
++%EXCLUDEOUTLIERS - exclude points of contour that are not within the domain
++%contour. return new contours in a different file.
+ %
+ %        Usage: excludeoutliers('NewContour.exp','Contour.exp','DomainOutline.exp');
+ %
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreateprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreateprofile.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcreateprofile.m	(revision 13010)
+@@ -15,7 +15,7 @@
+ 
+ %Get profile
+ disp('Click on profile points you desire. Type RETURN to end input of points');
+-[x,y]=ginputquick;
++[x,y]=ginput();
+ 
+ %plot contour
+ hold on;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expbox.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expbox.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expbox.m	(revision 13010)
+@@ -1,5 +1,5 @@
+ function expbox(filename)
+-%EXPBOX - Create a ARGUS file using to clicks
++%EXPBOX - Create an ARGUS file using two clicks
+ %
+ %   Two clicks on a plot are used to generate a rectangular box
+ %   This box is written in EXP format on filename
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.m	(revision 13010)
+@@ -0,0 +1,41 @@
++function expwrite(a,filename);
++%EXPWRITE - write an Argus file from a structure given in input
++%
++%   This routine write an Argus file form a structure containing the fields:
++%   x and y of the coordinates of the points.
++%   The first argument is the structure containing the points coordinates 
++%   and the second one the file to be write.
++%
++%   Usage:
++%      expwrite(a,filename)
++% 
++%   Example:
++%      expwrite(coordstruct,'domainoutline.exp')
++%
++%   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
++
++fid=fopen(filename,'w');
++for n=1:length(a),
++	if(length(contours(n).x)~=length(contours(n).y)),
++		error('contours x and y coordinates must be of identical size');
++	end
++   
++   if isfield(a,'name'),
++	   if ~isempty(a(n).name),
++		   fprintf(fid,'%s%s\n','## Name:',a(n).name);
++	   else
++		   fprintf(fid,'%s\n','## Name:');
++	   end
++   else
++	   fprintf(fid,'%s\n','## Name:');
++   end
++   
++   fprintf(fid,'%s\n','## Icon:0');
++   fprintf(fid,'%s\n','# Points Count Value');
++   fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
++   fprintf(fid,'%s\n','# X pos Y pos');
++	fprintf(fid,'%10.10f %10.10f\n',[a(n).x a(n).y]');
++	fprintf(fid,'\n','');
++   
++end
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/explink.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/explink.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/explink.m	(revision 13010)
+@@ -26,4 +26,3 @@
+ 		end
+ 	end
+ end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsquare.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsquare.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expsquare.m	(revision 13010)
+@@ -1,7 +1,7 @@
+-function expbox(filename)
++function expsquare(filename)
+ %EXPBOX - Create a ARGUS file using to clicks
+ %
+-%   Two clicks on a plot are used to generate a rectangular box
++%   Two clicks on a plot are used to generate a square box
+ %   This box is written in EXP format on filename
+ %
+ %   Usage:
+@@ -17,7 +17,7 @@
+ end
+ 
+ %Get points
+-disp('Click twice to define a rectangular domain. First click for upper left corner, second for lower right corner');
++disp('Click twice to define a square domain. First click for upper left corner, second for lower right corner');
+ [x,y]=ginput(2);
+ 
+ xmiddle=mean(x);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcircle.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcircle.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcircle.m	(revision 13010)
+@@ -0,0 +1,31 @@
++function expcircle(filename,x0,y0,radius,numberofnodes)
++%EXPCIRCLE - create a circular contour corresponding to given parameters
++%
++%   Creates a closed argus contour centered on x,y of radius size.
++%   The contour is made of numberofnodes
++%
++%   Usage:
++%      expcircle(filename,x0,y0,radius,numberofnodes)
++%
++%   See also EXPMASTER, EXPDOC
++
++%Calculate the cartesians coordinates of the points
++x_list=ones(numberofnodes+1,1);
++y_list=ones(numberofnodes+1,1);
++
++theta=(0:2*pi/numberofnodes:2*pi*(1-1/numberofnodes))';
++theta=[theta;0];
++
++x_list=radius*x_list.*cos(theta);
++y_list=radius*y_list.*sin(theta);
++
++%offset x_list and y_list by x0 and y0:
++x_list=x_list+x0;
++y_list=y_list+y0;
++
++contour.x=x_list;
++contour.y=y_list;
++contour.density=1;
++contour.name='circle';
++
++expwrite(contour,filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/MisfitDeinterlace.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/MisfitDeinterlace.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/inversions/MisfitDeinterlace.m	(revision 13010)
+@@ -0,0 +1,21 @@
++function Jstruct=MisfitDeinterlace(misfit,type)
++%MISFITDEINTERLACE - deinterlace misfits that are mixed together, using type.
++%
++%   Usage:
++%      Jstruct=MisfitDeinterlace(misfit,type)
++%
++%   Example:
++%      Jstruct=MisfitDeinterlace(md.results.diagnostic.J,md.fit)
++%
++%
++Jstruct=struct();
++
++count=1;
++for i=0:max(type),
++	pos=find(type==i);
++	if length(pos),
++		Jstruct(count).type=i;
++		Jstruct(count).J=misfit(pos);
++		count=count+1;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/isbasin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/isbasin.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/isbasin.m	(revision 13010)
+@@ -0,0 +1,17 @@
++function isbasin(name)
++%ISBASIN: figure out if a basin name exists.
++%
++%
++%        Usage:  index=isbasin('jks');
++%
++%
++
++%First, load basin names:
++load([jplsvn '/projects/ModelData/Names/Names.mat']);
++
++%go through names: 
++for i=1:length(names),
++	if ~isempty(strfind(names{i,1},name)),
++		disp(['''' names{i,1} ''' Long:' num2str(names{i,2}) ' Lat:' num2str(names{i,3}) ]);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/plotbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/plotbasins.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/plotbasins.m	(revision 13010)
+@@ -0,0 +1,18 @@
++%display all the domain outlines in a directory
++
++basins=listfiles;
++
++hold on
++for i=1:length(basins), 
++	%check whether this is a .exp file
++	basin=basins{i};
++	if strcmpi(basin(end-3:end),'.exp'),
++
++		contour=expread(basin,0);
++		x=contour(1).x;
++		y=contour(1).y;
++		x0=mean(x); y0=mean(y);
++		text(x0,y0,basin(1:end-4),'Fontsize',14);
++		expdisp(basin);
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/showbasins.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/showbasins.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/showbasins.m	(revision 13010)
+@@ -0,0 +1,69 @@
++function showbasins(varargin)
++%SHOWBASINS - return basins that are within the xlim and ylim
++%
++%   Usage:
++%      names=showbasins(options);
++%   Options: 
++%      'unit' default 1
++%      'hemisphere': default +1;
++%      'central_meridian: 45 for Greenland and 0 for Antarctica
++%      'standard_parallel: 70 for Greenland and 71 for Antarctica
++%
++
++%is varargin an options database already?
++if nargin==0,
++	options=pairoptions(varargin{:});
++elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
++	%do nothing to the varargin: 
++	options=varargin{1};
++else
++	%process varargin for options: 
++	options=pairoptions(varargin{:});
++end
++
++
++%recover some options, and set defaults
++unitmultiplier=getfieldvalue(options,'unit',1);
++fontsize=getfieldvalue(options,'fontsize',12);
++hemisphere=getfieldvalue(options,'hemisphere');
++
++if strcmpi(hemisphere,'s'),
++	hemisphere=-1;
++elseif strcmpi(hemisphere,'n'),
++	hemisphere=+1;
++else
++	error('showbasins error message: hemispehre should be either ''n'' or ''s''');
++	end
++
++if hemisphere==+1,
++	central_meridian=getfieldvalue(options,'central_meridian',45);
++	standard_parallel=getfieldvalue(options,'standard_parallel',70);
++else
++	central_meridian=getfieldvalue(options,'central_meridian',0);
++	standard_parallel=getfieldvalue(options,'standard_parallel',71);
++end
++
++%Ok, find basin we are talking about: 
++load([jplsvn '/projects/ModelData/Names/Names.mat']);
++
++%Get xlim and ylim, and convert into lat,long: 
++xlimits=xlim; x0=xlimits(1); x1=xlimits(2);
++ylimits=ylim; y0=ylimits(1); y1=ylimits(2);
++
++%Convert names lat and long into x,y:
++lat=cell2mat(names(:,3));
++long=cell2mat(names(:,2));
++
++%Now, convert lat,long into x,y:
++[x,y]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
++
++%Find  x,y within xlimits and ylimits: 
++locations=find(x>x0 & x<x1 & y>y0 & y<y1);
++
++%Go through locations, and display the names: 
++for i=1:size(locations,1),
++	hold on,
++	plot(x(locations(i)),y(locations(i)),'r.');
++	t=text(x(locations(i)),y(locations(i)),names{locations(i),1}); 
++	set(t,'FontSize',fontsize);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/basinzoom.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/basinzoom.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/regional/basinzoom.m	(revision 13010)
+@@ -0,0 +1,94 @@
++function varargout=basinzoom(varargin)
++%ANTZOOM - zoom on a basin in Antarctica or Greenland.
++%
++%   This function zooms on an existing figure describing Antarctica or Greenland 
++%   The zooming depends on the region name provided as input. 
++%
++%   Usage:
++%      varargout=basinzoom(options)
++
++%recover some options, and set defaults
++
++%is varargin an options database already?
++if nargin==0,
++	options=pairoptions(varargin{:});
++elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
++	%do nothing to the varargin: 
++	options=varargin{1};
++else
++	%process varargin for options: 
++	options=pairoptions(varargin{:});
++end
++
++unitmultiplier=getfieldvalue(options,'unit',NaN);
++basin=getfieldvalue(options,'basin');
++
++if exist(options,'basindelta'),
++
++	basindeltax=getfieldvalue(options,'basindelta',300); 
++	basindeltay=getfieldvalue(options,'basindelta',300); 
++else
++	basindeltax=getfieldvalue(options,'basindeltax',300); 
++	basindeltay=getfieldvalue(options,'basindeltay',300);
++end
++
++%multiply by 1000 to get kms
++basindeltax=basindeltax*1000;
++basindeltay=basindeltay*1000;
++
++%Ok, find basin we are talking about: 
++load([jplsvn() '/projects/ModelData/Names/Names.mat']);
++		
++%Go through names: 
++found=0;
++for i=1:size(names,1),
++	if strcmpi(names{i,1},basin),
++		%ok, we've got the region. Get lat and long: 
++		long=names{i,2};
++		lat=names{i,3};
++		hemisphere=names{i,4};
++		found=1;
++		break;
++	end
++end
++
++if ~found,
++	error(['basinzoom error message: cannot find basin ' basin '. Use isbasin to determine a basin name.']);
++end
++
++if hemisphere==+1,
++	central_meridian=getfieldvalue(options,'central_meridian',45);
++	standard_parallel=getfieldvalue(options,'standard_parallel',70);
++else
++	central_meridian=getfieldvalue(options,'central_meridian',0);
++	standard_parallel=getfieldvalue(options,'standard_parallel',71);
++end
++
++%Transform lat long into x,y: 
++[xc,yc]=ll2xy(lat,long,hemisphere,central_meridian,standard_parallel);
++
++%compute x0,x1 and y0,y1 using basindeltax and basindeltay
++x0=xc-basindeltax/2;
++x1=xc+basindeltax/2;
++y0=yc-basindeltay/2;
++y1=yc+basindeltay/2;
++
++if ~isnan(unitmultiplier)
++	x0=x0*unitmultiplier;
++	x1=x1*unitmultiplier;
++	y0=y0*unitmultiplier;
++	y1=y1*unitmultiplier;
++end
++
++%if output arguments are present, return the limits, 
++%otherwise, set them on the current graphic. 
++if nargout==2,
++	found=1;
++	varargout{1}=[x0 x1];
++	varargout{2}=[y0 y1];
++else
++	xlim([x0 x1]);
++	ylim([y0 y1]);
++	found=1;
++	daspect([1;1;1]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/varmap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/varmap.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/varmap.m	(revision 13010)
+@@ -0,0 +1,55 @@
++function output = varmap(x,y,data,varargin);
++%VARMAP - use gslib for Kriging
++%
++%   Usage:
++%      output = varmap(x,y,data,varargin)
++
++options=pairoptions(varargin{:});
++
++nxlag = getfieldvalue(options,'nxlag', 20);
++nylag = getfieldvalue(options,'nylag', 20);
++dxlag = getfieldvalue(options,'dxlag', 1000);
++dylag = getfieldvalue(options,'dylag', 1000);
++
++%Write data file
++fid=fopen('cluster.dat','w');
++fprintf(fid,'%s\n','Data file');
++fprintf(fid,'%i\n',3);
++fprintf(fid,'%s\n','Xlocation');
++fprintf(fid,'%s\n','Ylocation');
++fprintf(fid,'%s\n','Data');
++fprintf(fid,'%g %g %g\n',[x y data]');
++fclose(fid);
++
++%Write parameter file
++fid=fopen('varmap.par','w');
++fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
++fprintf(fid,'\t\t\t\t%s\n','*******************');
++fprintf(fid,'\n');
++fprintf(fid,'%s\n','START OF PARAMETERS:');
++fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
++fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
++fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
++fprintf(fid,'%-30s %s\n','0    '                      ,'\1=regular grid, 0=scattered values');
++fprintf(fid,'%-30s %s\n','50 50 1'                    ,'\if =1: nx, ny, nz');
++fprintf(fid,'%-30s %s\n','1.0 1.0 1.0'                ,'\       xsiz, ysiz, zsiz if igrid=1');
++fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\if =0: columns for x, y and z coordinates');
++fprintf(fid,'%-30s %s\n','varmap.out'                 ,'\file for variogram output');
++fprintf(fid,'%-30s %s\n',num2str([nxlag nylag 0],'%i '),'\nxlag, nylag, nzlag');
++fprintf(fid,'%-30s %s\n',num2str([dxlag dylag 1],'%g %g %i'),'\dxlag, dylag, dzlag');
++fprintf(fid,'%-30s %s\n','5'                          ,'\minimum number of pairs');
++fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
++fprintf(fid,'%-30s %s\n','1'                          ,'\number of variograms');
++fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail, head, variogram type');
++fclose(fid);
++
++%Call varmap
++system([issmdir() '/externalpackages/gslib/install/varmap varmap.par']);
++delete('varmap.par');
++
++%Read output
++fid=fopen('varmap.out','r');
++A = textscan(fid,'%f %f %f %f %f %f','headerlines',8);
++fclose(fid);
++delete('varmap.out')
++output = reshape(A{1},[2*nxlag+1 2*nylag+1]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/gamv.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/gamv.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/gamv.m	(revision 13010)
+@@ -0,0 +1,70 @@
++function output = gamv(x,y,data,varargin);
++%GAMV - use gslib for Kriging
++%
++%   Usage:
++%      output = gamv(x,y,data,varargin)
++
++options=pairoptions(varargin{:});
++
++nlag = getfieldvalue(options,'nlag', 20);
++dlag = getfieldvalue(options,'dlag', 1000);
++
++%Write data file
++fid=fopen('cluster.dat','w');
++fprintf(fid,'%s\n','Data file');
++fprintf(fid,'%i\n',3);
++fprintf(fid,'%s\n','Xlocation');
++fprintf(fid,'%s\n','Ylocation');
++fprintf(fid,'%s\n','Data');
++fprintf(fid,'%g %g %g\n',[x y data]');
++fclose(fid);
++
++%Write parameter file
++fid=fopen('gamv.par','w');
++fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
++fprintf(fid,'\t\t\t\t%s\n','*******************');
++fprintf(fid,'\n');
++fprintf(fid,'%s\n','START OF PARAMETERS:');
++fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
++fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
++fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
++fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
++fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
++fprintf(fid,'%-30s %s\n',num2str(nlag,'%i')           ,'\number of lags');
++fprintf(fid,'%-30s %s\n',num2str(dlag,'%g')           ,'\lag separation distance');
++fprintf(fid,'%-30s %s\n',num2str(dlag/2,'%g')         ,'\lag tolerance');
++fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
++fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
++fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
++fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
++fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
++fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
++fclose(fid);
++
++%Call gamv
++system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
++delete('gamv.par');
++
++%Read output
++output   = struct('Semivariogram',[],'Covariance',[]);
++counter1 = 1;
++counter2 = 1;
++fid=fopen('gamv.out','r');
++while (~feof(fid)),
++	A=fscanf(fid,'%s',1);
++	if strcmp(A,'Covariance');
++		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
++		output(counter1).Covariance=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
++		counter1=counter1+1;
++	elseif strcmp(A,'Semivariogram'),
++		A=fscanf(fid,'%s',4); %Read tail:Data head:Data direction  2
++		output(counter2).Semivariogram=fscanf(fid,'%i %g %g %i %g %g',[6 nlag+2])';
++		counter2=counter2+1;
++	else
++		%do nothing
++	end
++end
++fclose(fid);
++delete('gamv.out')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/pkriging.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/pkriging.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/pkriging.m	(revision 13010)
+@@ -0,0 +1,55 @@
++function [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
++%PKRIGING - parallel Kriging
++%
++%   Usage:
++%      [B E]=pkriging(x,y,observations,x_interp,y_interp,varargin);
++
++options=pairoptions(varargin{:});
++cluster=getfieldvalue(options,'cluster',generic('np',10));
++options=removefield(options,'cluster',0);
++name   = ['krig' num2str(feature('GetPid'))];
++
++% =========================================   MARSHALL.m =================================================
++disp(['marshalling file ' name '.bin']);
++fid=fopen([name '.bin'],'wb');
++if fid==-1,
++	error(['marshall error message: could not open ' name '.bin file for binary writing']);
++end
++
++%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
++WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
++
++%Write all data
++WriteData(fid,'enum',0,'data',x,'format','DoubleMat');
++WriteData(fid,'enum',1,'data',y,'format','DoubleMat');
++WriteData(fid,'enum',2,'data',observations,'format','DoubleMat');
++WriteData(fid,'enum',3,'data',x_interp,'format','DoubleMat');
++WriteData(fid,'enum',4,'data',y_interp,'format','DoubleMat');
++options.marshall(fid,5);
++st=fclose(fid);
++if st==-1,
++	error(['marshall error message: could not close file ' name '.bin']);
++end
++% =========================================   MARSHALL.m =================================================
++
++%Launch job on remote cluster
++BuildKrigingQueueScript(cluster,name,'',1,0,0); %gather, valgrind, gprof
++tic
++LaunchQueueJob(cluster,name,name,{[name '.bin'] [name '.queue']});
++toc
++choice=input('Is the job successfully completed? (y/n)','s');
++Download(cluster,name,{[name '.outbin']});
++structure=parseresultsfromdisk([name '.outbin'],0);
++delete([name '.outlog']);
++delete([name '.errlog']);
++delete([name '.outbin']);
++delete([name '.bin']);
++if ~ispc,
++	delete([name '.tar.gz']);
++end
++
++%Process results
++B=structure.AutodiffForward;
++B=reshape(B,size(x_interp,2),size(x_interp,1))';
++E=structure.AutodiffIsautodiff;
++E=reshape(E,size(x_interp,2),size(x_interp,1))';
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/gslib.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/gslib.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/gslib.m	(revision 13010)
+@@ -0,0 +1,112 @@
++function output = gslib(x,y,data,varargin);
++%GSLIB - use gslib for Kriging
++%
++%   Usage:
++%      output = gslib(x,y,data,varargin)
++
++%Output Matrix
++xmin   = xl(1);
++ymin   = yl(1);
++nx     = 101;
++ny     = 101;
++deltax = 5000;
++deltay = 5000;
++
++%Variogram
++nugget=10;
++sill  =164;
++range =25763;
++
++%Kriging options
++mindata = 1;
++maxdata = 50;
++maxsearchradius = 50000;
++
++%Some intermediaries (Convert to gslib's parameters);
++c = (sill-nugget);
++a = sqrt(3)*range;
++
++%Write data file
++fid=fopen('cluster.dat','w');
++fprintf(fid,'%s\n','Data file');
++fprintf(fid,'%i\n',3);
++fprintf(fid,'%s\n','Xlocation');
++fprintf(fid,'%s\n','Ylocation');
++fprintf(fid,'%s\n','Data');
++fprintf(fid,'%g %g %g\n',[x y data]');
++fclose(fid);
++
++if 0, %GAMV
++	%Write parameter file
++	fid=fopen('gamv.par','w');
++	fprintf(fid,'\t\t\t\t%s\n','Parameters for GAMV');
++	fprintf(fid,'\t\t\t\t%s\n','*******************');
++	fprintf(fid,'\n');
++	fprintf(fid,'%s\n','START OF PARAMETERS:');
++	fprintf(fid,'%-30s %s\n','./cluster.dat'              ,'\file with data');
++	fprintf(fid,'%-30s %s\n','1 2 0'                      ,'\columns for X, Y, Z coordinates');
++	fprintf(fid,'%-30s %s\n','1 3  '                      ,'\number of variables, column number');
++	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'             ,'\trimming limits');
++	fprintf(fid,'%-30s %s\n','gamv.out'                   ,'\file for variogram output');
++	fprintf(fid,'%-30s %s\n','20'                         ,'\number of lags');
++	fprintf(fid,'%-30s %s\n','5.0'                        ,'\lag separation distance');
++	fprintf(fid,'%-30s %s\n','3.0'                        ,'\lag tolerance');
++	fprintf(fid,'%-30s %s\n','3'                          ,'\number of directions');
++	fprintf(fid,'%-30s %s\n','0.0 90.0 50.0 0.0 90.0 50.0','\azm, atol, bandh, dip, dtol, bandv');
++	fprintf(fid,'%-30s %s\n','0.0 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++	fprintf(fid,'%-30s %s\n','90. 22.5 25.0 0.0 22.5 25.0','\azm, atol, bandh, dip, dtol, bandv');
++	fprintf(fid,'%-30s %s\n','0'                          ,'\standardize sill? (0=no, 1=yes)');
++	fprintf(fid,'%-30s %s\n','2'                          ,'\number of variograms');
++	fprintf(fid,'%-30s %s\n','1 1 1'                      ,'\tail var., head vars., variogram type');
++	fprintf(fid,'%-30s %s\n','1 1 3'                      ,'\tail var., head vars., variogram type');
++	fclose(fid);
++
++	%Call gamv
++	system([issmdir() '/externalpackages/gslib/install/gamv gamv.par']);
++
++else, %Kriging KB2D
++	%Write parameter file
++	fid=fopen('kb2d.par','w');
++	fprintf(fid,'\t\t\t\t%s\n','Parameters for KB2D');
++	fprintf(fid,'\t\t\t\t%s\n','*******************');
++	fprintf(fid,'\n');
++	fprintf(fid,'%s\n','START OF PARAMETERS:');
++	fprintf(fid,'%-30s %s\n','./cluster.dat'                  ,'\file with data');
++	fprintf(fid,'%-30s %s\n','1 2 3'                          ,'\columns for X, Y and variable');
++	fprintf(fid,'%-30s %s\n','-1.0e21 1.0e21'                 ,'\trimming limits');
++	fprintf(fid,'%-30s %s\n','0'                              ,'\debugging level: 0,1,2,3');
++	fprintf(fid,'%-30s %s\n','kb2d.dbg'                       ,'\file for debuggging output');
++	fprintf(fid,'%-30s %s\n','kb2d.out'                       ,'\file for kriged output');
++	fprintf(fid,'%-30s %s\n',num2str([nx xmin deltax],'%i %10g %6g')  ,'\nx, xmn, xsiz');
++	fprintf(fid,'%-30s %s\n',num2str([ny ymin deltay],'%i %10g %6g')  ,'\nx, xmn, xsiz');
++	fprintf(fid,'%-30s %s\n','1 1'                            ,'\x and y block discretization');
++	fprintf(fid,'%-30s %s\n',num2str([mindata maxdata],'%6g') ,'\min and max data for kriging');
++	fprintf(fid,'%-30s %s\n',num2str(maxsearchradius,'%6g')   ,'\max search radius');
++	fprintf(fid,'%-30s %s\n','1 2.302'                        ,'\0=SK, 1=OK, (mean if SK)');
++	fprintf(fid,'%-30s %s\n',['1 ' num2str(nugget)]           ,'\nst, nugget effect');
++	fprintf(fid,'%-30s %s\n',['3 ' num2str([c 0.0 a a],'%10g')],'\it, c, azm, a_max, a_min');
++	fclose(fid);
++
++	tic;system([issmdir() '/externalpackages/gslib/install/kb2d kb2d.par']);toc;
++	delete('kb2d.par');
++
++	%Read output
++	fid=fopen('kb2d.out','r');
++	while (~feof(fid)),
++		A=fscanf(fid,'%s',1);
++		if strcmp(A,'KB2D');
++			A=fscanf(fid,'%s',1); %Read output
++			params=fscanf(fid,'%i %i %i %i %g %g %g %g %g %g %1',[11 1]);
++		elseif strcmp(A,' Estimate'),
++			continue;
++		elseif strcmp(A,'Estimation'),
++			A=fscanf(fid,'%s',1); %Read Variance
++			A=fscanf(fid,'%g %g',[params(1) params(2)*params(3)]);
++			B=A(1,:); B=reshape(B,[params(3),params(2)])';
++			E=A(2,:); E=reshape(E,[params(3),params(2)])';
++		else
++			%do nothing
++		end
++	end
++	fclose(fid);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/uci/expremovestraightsegments.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/uci/expremovestraightsegments.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/uci/expremovestraightsegments.m	(revision 13010)
+@@ -0,0 +1,31 @@
++function expremovestraightsegments(newfilename,filename,cutoff)
++%EXPREMOVESTRAIGHTSEGMENTS:  remove straight segments connecting contours.
++%
++% Usage: expremovestraightsegments('argus.exp',100); 
++%
++%
++
++a=expread(filename,1);
++newcontours=a(1);
++
++for i=1:length(a),
++	contour=a(i);
++	
++	s=sqrt(contour.x.^2+contour.y.^2);
++	d=diff(s);
++	
++	pos=find(abs(d)>cutoff);
++	pos=[0;pos;length(contour.x)];
++
++	for j=1:length(pos)-1,
++
++		newcontour=contour;
++		newcontour.x=contour.x(pos(j)+1:pos(j+1));
++		newcontour.y=contour.y(pos(j)+1:pos(j+1));
++		newcontour.nods=length(newcontour.x);
++		newcontours(end+1)=newcontour;
++	end
++end
++newcontours=newcontours(2:end);
++
++expwrite(newcontours,newfilename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/uci/expsplit.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/uci/expsplit.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/uci/expsplit.m	(revision 13010)
+@@ -0,0 +1,31 @@
++function expsplit(domainoutline)
++%EXPSPLIT - split exp file into sub-contours
++%
++%   This routine reads in a domain outline file (Argus format) and plots all the contours 
++%   This will create as many files there are contours in the domain, each file will be postfix with _i
++%   where i is the contour name. 
++%
++%   Usage:
++%      expsplit(domainoutline)
++%
++%   Example:
++%      expsplit('Domain.exp');
++%
++%   See also EXPMASTER, EXPDOC
++
++%check nargin
++if ~nargin | nargin>1
++	help expsplit
++	error('expsplit error message: bad usage');
++end
++
++[path,root,ext]=fileparts(domainoutline);
++
++%Read file: 
++domains=expread(domainoutline,1);
++
++%split and write contours: 
++for i=1:length(domains),
++	subdomain=domains(i);
++	expwrite(subdomain,[root '_' num2str(i)  ext]);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/uci/pargenerate.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/uci/pargenerate.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/uci/pargenerate.m	(revision 13010)
+@@ -0,0 +1,45 @@
++function pargenerate(filename,xm,ym,data,varargin)
++%PARGENERATE - generate parameter file for images ala Rignot
++%
++%   Usage: 
++%      pargenerate(filename,data,xm,ym,options);
++%
++%   Supported options:
++%      - title: dataset title
++%      - latitude: standard latitude (degree)
++%      - meridian: meridian (degree)
++%      - format: binary format
++
++%process options
++options=pairoptions(varargin{:});
++Title=getfieldvalue(options,'title','N/A');
++latitude=getfieldvalue(options,'latitude','N/A');
++meridian=getfieldvalue(options,'meridian','N/A');
++format=getfieldvalue(options,'format','single');
++
++%Get data info
++[nlines ncols]=size(data);
++xmin=min(xm);
++ymax=max(ym);
++postx=abs(xm(2)-xm(1));
++posty=abs(ym(2)-ym(1));
++
++%Open header file and get machine type
++fid=fopen(filename,'wt');
++[filename, permission, machineformat, encoding] = fopen(fid);
++
++%write header file
++fprintf(fid,'%s\n','ISSM gridded dataset parameter file');
++fprintf(fid,'%s%s\n','title: ',Title);
++fprintf(fid,'%s  \n','DEM_projection: PS');
++fprintf(fid,'%s%s\n','data_format: ',format);
++fprintf(fid,'%s%s\n','endian:      ',machineformat);
++fprintf(fid,'%s%d\n','width:  ',ncols);
++fprintf(fid,'%s%d\n','nlines: ',nlines);
++fprintf(fid,'%s%g%s\n','PS_secant_lat:    ',latitude,'   decimal degrees');
++fprintf(fid,'%s%g%s\n','PS_meridian_long: ',meridian,'   decimal degrees');
++fprintf(fid,'%s%-15.10g\n','PS_corner_north:  ',ymax);
++fprintf(fid,'%s%-15.10g\n','PS_corner_east:   ',xmin);
++fprintf(fid,'%s%g%s\n','PS_post_north:    ',postx,' m');
++fprintf(fid,'%s%g%s\n','PS_post_east:     ',posty,' m');
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/ecco32issm.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/ecco32issm.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/ecco32issm.m	(revision 13010)
+@@ -0,0 +1,8 @@
++function nodefield=ecco32issm(field,transition,xecco3,yecco3)
++
++	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
++	nodefieldlinear=zeros(length(xecco3linear),1);
++	nodefieldlinear(transition(:,1))=field(transition(:,2));
++	nodefield=xecco3;
++	nodefield(:)=nodefieldlinear;
++	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/issm2ecco3.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/issm2ecco3.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/ecco/issm2ecco3.m	(revision 13010)
+@@ -0,0 +1,8 @@
++function nodefield=issm2ecco3(field,transition,xecco3,yecco3)
++
++	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
++	nodefieldlinear=zeros(length(xecco3linear),1);
++	nodefieldlinear(transition(:,1))=field(transition(:,2));
++	nodefield=xecco3;
++	nodefield(:)=nodefieldlinear;
++	%nodefield=nodefield'; %not sure we need that
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/pargenerate.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/pargenerate.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/latlong/pargenerate.m	(revision 13010)
+@@ -1,45 +0,0 @@
+-function pargenerate(filename,xm,ym,data,varargin)
+-%PARGENERATE - generate parameter file for images ala Rignot
+-%
+-%   Usage: 
+-%      pargenerate(filename,data,xm,ym,options);
+-%
+-%   Supported options:
+-%      - title: dataset title
+-%      - latitude: standard latitude (degree)
+-%      - meridian: meridian (degree)
+-%      - format: binary format
+-
+-%process options
+-options=pairoptions(varargin{:});
+-Title=getfieldvalue(options,'title','N/A');
+-latitude=getfieldvalue(options,'latitude','N/A');
+-meridian=getfieldvalue(options,'meridian','N/A');
+-format=getfieldvalue(options,'format','single');
+-
+-%Get data info
+-[nlines ncols]=size(data);
+-xmin=min(xm);
+-ymax=max(ym);
+-postx=abs(xm(2)-xm(1));
+-posty=abs(ym(2)-ym(1));
+-
+-%Open header file and get machine type
+-fid=fopen(filename,'wt');
+-[filename, permission, machineformat, encoding] = fopen(fid);
+-
+-%write header file
+-fprintf(fid,'%s\n','ISSM gridded dataset parameter file');
+-fprintf(fid,'%s%s\n','title: ',Title);
+-fprintf(fid,'%s  \n','DEM_projection: PS');
+-fprintf(fid,'%s%s\n','data_format: ',format);
+-fprintf(fid,'%s%s\n','endian:      ',machineformat);
+-fprintf(fid,'%s%d\n','width:  ',ncols);
+-fprintf(fid,'%s%d\n','nlines: ',nlines);
+-fprintf(fid,'%s%g%s\n','PS_secant_lat:    ',latitude,'   decimal degrees');
+-fprintf(fid,'%s%g%s\n','PS_meridian_long: ',meridian,'   decimal degrees');
+-fprintf(fid,'%s%-15.10g\n','PS_corner_north:  ',ymax);
+-fprintf(fid,'%s%-15.10g\n','PS_corner_east:   ',xmin);
+-fprintf(fid,'%s%g%s\n','PS_post_north:    ',postx,' m');
+-fprintf(fid,'%s%g%s\n','PS_post_east:     ',posty,' m');
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/VelFindVarNames.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/VelFindVarNames.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/VelFindVarNames.m	(revision 13010)
+@@ -1,122 +0,0 @@
+-function Names=VelFindVarNames(filename)
+-%VELFINDVARNAMES - find names of variables in a velocity data set file
+-%
+-%   This routines looks at the variables contained in a file and finds out
+-%   the names of the variables that are needed for an interpolation (x,y,vx,vy)
+-%   or (index,x,y,vx,vy)
+-%
+-%   Usage:
+-%      Names=VelFindVarNames(filename)
+-%
+-%   Example:
+-%      Names=VelFindVarNames('velocities.mat')
+-%
+-%   See also: INTERPFROMFILE, GRIDDATA
+-
+-%some checks
+-if nargin~=1 | nargout~=1
+-	help VelFindVarNames
+-	error('VelFindVarNames error message: bad usage');
+-end
+-if ~exist(filename)
+-	error(['VelFindVarNames error message: file ' filename  ' does not exist']);
+-end
+-
+-%Get variables
+-A=whos('-file',filename);
+-
+-%find x,y,vx and vy
+-xenum=NaN; yenum=NaN; vxenum=NaN; vyenum=NaN; indexenum=NaN;
+-if length(A)==4,
+-	isnode=1;
+-	for i=1:4
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		else
+-			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
+-				vxenum=i;
+-			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
+-				vyenum=i;
+-			end
+-		end
+-	end
+-elseif length(A)==5,
+-	isnode=0;
+-	for i=1:5
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		elseif (strcmpi(A(i).name(1),'index') | strcmpi(A(i).name(1),'elements'));
+-			indexenum=i;
+-		else
+-			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
+-				vxenum=i;
+-			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
+-				vyenum=i;
+-			end
+-		end
+-	end
+-else
+-	error(['VelFindVarNames error message: file ' filename  ' not supported yet (it should hold 4 variables x,y,vx and vy (for nodes) OR 5 variables  x,y,index,vx and vy (for mesh))']);
+-end
+-
+-%assum that we have found at least vxenum and vyenum
+-if ( isnan(vxenum) | isnan(vyenum))
+-	error(['VelFindVarNames error message: file ' filename  ' not supported yet (the velocities should be named vx and vy)']);
+-end
+-
+-%find index
+-if (~isnode & isnan(indexenum)),
+-	for i=1:5
+-		lengthi=min(A(i).size);
+-		if (lengthi==3),
+-			indexenum=i;
+-		end
+-	end
+-	if isnan(indexenum),
+-		error(['VelFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
+-	end
+-end
+-
+-%find x y
+-if (isnan(xenum) | isnan(yenum))
+-
+-	%check the size
+-	if A(vxenum).size(1)==A(vxenum).size(2),
+-		error(['VelFindVarNames error message: file ' filename  ' not supported (velocities is a square matrix, save x and y with another name)']);
+-	end
+-	if ~(A(vxenum).size(1)==A(vyenum).size(1) & A(vxenum).size(2)==A(vyenum).size(2)),
+-		error(['VelFindVarNames error message: file ' filename  ' not supported (vx and vy matrices do not have the same size)']);
+-	end
+-
+-	%find xenum and yenum
+-	for i=1:4
+-		lengthi=max(A(i).size);
+-		if ((i~=vxenum) & (lengthi==A(vxenum).size(1) | lengthi==A(vxenum).size(1)+1)),
+-			yenum=i;
+-		elseif ((i~=vxenum) & (lengthi==A(vxenum).size(2) | lengthi==A(vxenum).size(2)+1)),
+-			xenum=i;
+-		end
+-	end
+-
+-	%last check
+-	if (isnan(xenum) | isnan(yenum))
+-		error(['plugdata error message: file ' filename  ' not supported yet']);
+-	end
+-end
+-
+-%create output
+-Names=struct();
+-Names.xname=A(xenum).name;
+-Names.yname=A(yenum).name;
+-Names.vxname=A(vxenum).name;
+-Names.vyname=A(vyenum).name;
+-if ~isnode,
+-	Names.indexname=A(indexenum).name; 
+-	Names.interp='mesh';
+-else
+-	Names.interp='node';
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FillHole.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FillHole.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FillHole.m	(revision 13010)
+@@ -1,39 +0,0 @@
+-function field=FillHole(index,x,y,field)
+-%FILLHOLE - fill mesh data that has holes in it (hole is defined by field==NaN). Get the nearest neighboors to fill the holes.
+-%
+-%   Usage:
+-%      surface=FillHole(index,x,y,surface)
+-%
+-%   Example:
+-%      md.geometry.surface=FillHole(md.mesh.elements,x,md.mesh.y,md.geometry.surface)
+-%
+-
+-%some checks
+-if nargin~=4 | nargout~=1
+-	help FillHole
+-	error('FillHole error message: bad usage');
+-end
+-
+-if length(x)~=length(y),
+-	error('plugdata error message: x and y should have the same length');
+-end
+-
+-
+-pos_hole=find(isnan(field));
+-pos_full=find(~isnan(field));
+-
+-%reduce our field to not include any holes: 
+-field_noholes=field(pos_full);
+-x_noholes=x(pos_full);
+-y_noholes=y(pos_full);
+-
+-for i=1:length(pos_hole)
+-
+-	if (mod(i,100)==0),
+-		fprintf('\b\b\b\b\b\b\b%5.2f%s',i/length(pos_hole)*100,' %');
+-	end
+-
+-	%search the node on the closest to i, that is not in a hole either
+-	[d posd]=min(sqrt((x(pos_hole(i))-x_noholes).^2+(y(pos_hole(i))-y_noholes).^2));
+-	field(pos_hole(i))=field_noholes(posd);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FieldFindVarNames.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FieldFindVarNames.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/FieldFindVarNames.m	(revision 13010)
+@@ -1,153 +0,0 @@
+-function Names=FieldFindVarNames(filename)
+-%FIELDFINDVARNAMES - find names of variables in a data set file
+-%
+-%   This routines looks at the variables contained in a file and finds out
+-%   the names of the variables that are needed for an interpolation (x,y,data)
+-%   or (index,x,y,data)
+-%
+-%   Usage:
+-%      Names=FieldFindVarNames(filename)
+-%
+-%   Example:
+-%      Names=FieldFindVarNames('thickness.mat')
+-%
+-%   See also: INTERPFROMFILE, GRIDDATA
+-
+-%some checks
+-if nargin~=1 | nargout~=1
+-	help FieldFindVarNames
+-	error('FieldFindVarNames error message: bad usage');
+-end
+-if ~exist(filename)
+-	error(['FieldFindVarNames error message: file ' filename  ' does not exist']);
+-end
+-
+-%Get variables
+-A=whos('-file',filename);
+-
+-%find x,y,vx and vy
+-xenum=NaN; yenum=NaN; dataenum=NaN; indexenum=NaN;
+-if length(A)==3,
+-	isnode=1;
+-	for i=1:3
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
+-			dataenum=i;
+-		else
+-			%nothing
+-		end
+-	end
+-elseif length(A)==4,
+-	isnode=0;
+-	for i=1:4
+-		if strcmpi(A(i).name(1),'x');
+-			xenum=i;
+-		elseif strcmpi(A(i).name(1),'y');
+-			yenum=i;
+-		elseif (strncmpi(A(i).name,'index',5) | strncmpi(A(i).name,'elements',7));
+-			indexenum=i;
+-		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
+-			dataenum=i;
+-		else
+-			%nothing
+-		end
+-	end
+-else
+-	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (it should hold 3 variables x,y and data (for nodes) OR 4 variables  x,y,index and data (for mesh))']);
+-end
+-
+-%2: if only one item is missing, find it by elimination
+-if ~isnode,
+-	pos=find(isnan([xenum yenum indexenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:4,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:4,list);
+-		elseif pos==3,
+-			indexenum=setdiff(1:4,list);
+-		elseif pos==4,
+-			dataenum=setdiff(1:4,list);
+-		end
+-	end
+-else
+-	pos=find(isnan([xenum yenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:3,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:3,list);
+-		elseif pos==3,
+-			dataenum=setdiff(1:3,list);
+-		end
+-	end
+-end
+-
+-%assum that we have found at least xenum and yenum
+-if ( isnan(xenum) | isnan(yenum))
+-	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (the coordinates vectors should be named x and y)']);
+-end
+-
+-%find index
+-if (~isnode & isnan(indexenum)),
+-	for i=1:4
+-		lengthi=min(A(i).size);
+-		if (lengthi==3),
+-			indexenum=i;
+-		end
+-	end
+-	if isnan(indexenum),
+-		error(['FieldFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
+-	end
+-end
+-
+-%4: last chance
+-if ~isnode,
+-	pos=find(isnan([xenum yenum indexenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:4,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:4,list);
+-		elseif pos==3,
+-			indexenum=setdiff(1:4,list);
+-		elseif pos==4,
+-			dataenum=setdiff(1:4,list);
+-		end
+-	end
+-else
+-	pos=find(isnan([xenum yenum dataenum]));
+-	if length(pos)==1,
+-		list=[xenum yenum indexenum dataenum]; list(pos)=[];
+-		if pos==1,
+-			xenum=setdiff(1:3,list);
+-		elseif pos==2,
+-			yenum=setdiff(1:3,list);
+-		elseif pos==3,
+-			dataenum=setdiff(1:3,list);
+-		end
+-	end
+-end
+-
+-%last check
+-if isnan(dataenum)
+-	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (data not found)']);
+-end
+-
+-%create output
+-Names=struct();
+-Names.xname=A(xenum).name;
+-Names.yname=A(yenum).name;
+-Names.dataname=A(dataenum).name;
+-if ~isnode,
+-	Names.indexname=A(indexenum).name; 
+-	Names.interp='mesh';
+-else
+-	Names.interp='node';
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/InterpFromFile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/InterpFromFile.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/InterpFromFile.m	(revision 13010)
+@@ -42,3 +42,159 @@
+ else
+ 	data_out=InterpFromMeshToMesh2d(Data.(Names.indexname),Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y);
+ end
++
++end
++function Names=FieldFindVarNames(filename)
++%FIELDFINDVARNAMES - find names of variables in a data set file
++%
++%   This routines looks at the variables contained in a file and finds out
++%   the names of the variables that are needed for an interpolation (x,y,data)
++%   or (index,x,y,data)
++%
++%   Usage:
++%      Names=FieldFindVarNames(filename)
++%
++%   Example:
++%      Names=FieldFindVarNames('thickness.mat')
++%
++%   See also: INTERPFROMFILE, GRIDDATA
++
++%some checks
++if nargin~=1 | nargout~=1
++	help FieldFindVarNames
++	error('FieldFindVarNames error message: bad usage');
++end
++if ~exist(filename)
++	error(['FieldFindVarNames error message: file ' filename  ' does not exist']);
++end
++
++%Get variables
++A=whos('-file',filename);
++
++%find x,y,vx and vy
++xenum=NaN; yenum=NaN; dataenum=NaN; indexenum=NaN;
++if length(A)==3,
++	isnode=1;
++	for i=1:3
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
++			dataenum=i;
++		else
++			%nothing
++		end
++	end
++elseif length(A)==4,
++	isnode=0;
++	for i=1:4
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		elseif (strncmpi(A(i).name,'index',5) | strncmpi(A(i).name,'elements',7));
++			indexenum=i;
++		elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)),
++			dataenum=i;
++		else
++			%nothing
++		end
++	end
++else
++	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (it should hold 3 variables x,y and data (for nodes) OR 4 variables  x,y,index and data (for mesh))']);
++end
++
++%2: if only one item is missing, find it by elimination
++if ~isnode,
++	pos=find(isnan([xenum yenum indexenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:4,list);
++		elseif pos==2,
++			yenum=setdiff(1:4,list);
++		elseif pos==3,
++			indexenum=setdiff(1:4,list);
++		elseif pos==4,
++			dataenum=setdiff(1:4,list);
++		end
++	end
++else
++	pos=find(isnan([xenum yenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:3,list);
++		elseif pos==2,
++			yenum=setdiff(1:3,list);
++		elseif pos==3,
++			dataenum=setdiff(1:3,list);
++		end
++	end
++end
++
++%assum that we have found at least xenum and yenum
++if ( isnan(xenum) | isnan(yenum))
++	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (the coordinates vectors should be named x and y)']);
++end
++
++%find index
++if (~isnode & isnan(indexenum)),
++	for i=1:4
++		lengthi=min(A(i).size);
++		if (lengthi==3),
++			indexenum=i;
++		end
++	end
++	if isnan(indexenum),
++		error(['FieldFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
++	end
++end
++
++%4: last chance
++if ~isnode,
++	pos=find(isnan([xenum yenum indexenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:4,list);
++		elseif pos==2,
++			yenum=setdiff(1:4,list);
++		elseif pos==3,
++			indexenum=setdiff(1:4,list);
++		elseif pos==4,
++			dataenum=setdiff(1:4,list);
++		end
++	end
++else
++	pos=find(isnan([xenum yenum dataenum]));
++	if length(pos)==1,
++		list=[xenum yenum indexenum dataenum]; list(pos)=[];
++		if pos==1,
++			xenum=setdiff(1:3,list);
++		elseif pos==2,
++			yenum=setdiff(1:3,list);
++		elseif pos==3,
++			dataenum=setdiff(1:3,list);
++		end
++	end
++end
++
++%last check
++if isnan(dataenum)
++	error(['FieldFindVarNames error message: file ' filename  ' not supported yet (data not found)']);
++end
++
++%create output
++Names=struct();
++Names.xname=A(xenum).name;
++Names.yname=A(yenum).name;
++Names.dataname=A(dataenum).name;
++if ~isnode,
++	Names.indexname=A(indexenum).name; 
++	Names.interp='mesh';
++else
++	Names.interp='node';
++end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/plugvelocities.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/plugvelocities.m	(revision 13009)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/interp/plugvelocities.m	(revision 13010)
+@@ -13,6 +13,7 @@
+ %
+ %   See also: INTERPFROMFILE, GRIDDATA
+ 
++disp('WARNING: deprecated functions (plugvelocities)');
+ %some checks
+ if nargin~=3 | nargout~=1
+ 	help plugvelocities
+@@ -39,3 +40,127 @@
+ md.initialization.vx=md.inversion.vx_obs;
+ md.initialization.vy=md.inversion.vy_obs;
+ md.initialization.vel=md.inversion.vel_obs;
++end
++
++function Names=VelFindVarNames(filename)
++%VELFINDVARNAMES - find names of variables in a velocity data set file
++%
++%   This routines looks at the variables contained in a file and finds out
++%   the names of the variables that are needed for an interpolation (x,y,vx,vy)
++%   or (index,x,y,vx,vy)
++%
++%   Usage:
++%      Names=VelFindVarNames(filename)
++%
++%   Example:
++%      Names=VelFindVarNames('velocities.mat')
++%
++%   See also: INTERPFROMFILE, GRIDDATA
++
++%some checks
++if nargin~=1 | nargout~=1
++	help VelFindVarNames
++	error('VelFindVarNames error message: bad usage');
++end
++if ~exist(filename)
++	error(['VelFindVarNames error message: file ' filename  ' does not exist']);
++end
++
++%Get variables
++A=whos('-file',filename);
++
++%find x,y,vx and vy
++xenum=NaN; yenum=NaN; vxenum=NaN; vyenum=NaN; indexenum=NaN;
++if length(A)==4,
++	isnode=1;
++	for i=1:4
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		else
++			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
++				vxenum=i;
++			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
++				vyenum=i;
++			end
++		end
++	end
++elseif length(A)==5,
++	isnode=0;
++	for i=1:5
++		if strcmpi(A(i).name(1),'x');
++			xenum=i;
++		elseif strcmpi(A(i).name(1),'y');
++			yenum=i;
++		elseif (strcmpi(A(i).name(1),'index') | strcmpi(A(i).name(1),'elements'));
++			indexenum=i;
++		else
++			if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2));
++				vxenum=i;
++			elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2));
++				vyenum=i;
++			end
++		end
++	end
++else
++	error(['VelFindVarNames error message: file ' filename  ' not supported yet (it should hold 4 variables x,y,vx and vy (for nodes) OR 5 variables  x,y,index,vx and vy (for mesh))']);
++end
++
++%assum that we have found at least vxenum and vyenum
++if ( isnan(vxenum) | isnan(vyenum))
++	error(['VelFindVarNames error message: file ' filename  ' not supported yet (the velocities should be named vx and vy)']);
++end
++
++%find index
++if (~isnode & isnan(indexenum)),
++	for i=1:5
++		lengthi=min(A(i).size);
++		if (lengthi==3),
++			indexenum=i;
++		end
++	end
++	if isnan(indexenum),
++		error(['VelFindVarNames error message: file ' filename  ' not supported yet (index not found)']);
++	end
++end
++
++%find x y
++if (isnan(xenum) | isnan(yenum))
++
++	%check the size
++	if A(vxenum).size(1)==A(vxenum).size(2),
++		error(['VelFindVarNames error message: file ' filename  ' not supported (velocities is a square matrix, save x and y with another name)']);
++	end
++	if ~(A(vxenum).size(1)==A(vyenum).size(1) & A(vxenum).size(2)==A(vyenum).size(2)),
++		error(['VelFindVarNames error message: file ' filename  ' not supported (vx and vy matrices do not have the same size)']);
++	end
++
++	%find xenum and yenum
++	for i=1:4
++		lengthi=max(A(i).size);
++		if ((i~=vxenum) & (lengthi==A(vxenum).size(1) | lengthi==A(vxenum).size(1)+1)),
++			yenum=i;
++		elseif ((i~=vxenum) & (lengthi==A(vxenum).size(2) | lengthi==A(vxenum).size(2)+1)),
++			xenum=i;
++		end
++	end
++
++	%last check
++	if (isnan(xenum) | isnan(yenum))
++		error(['plugdata error message: file ' filename  ' not supported yet']);
++	end
++end
++
++%create output
++Names=struct();
++Names.xname=A(xenum).name;
++Names.yname=A(yenum).name;
++Names.vxname=A(vxenum).name;
++Names.vyname=A(vyenum).name;
++if ~isnode,
++	Names.indexname=A(indexenum).name; 
++	Names.interp='mesh';
++else
++	Names.interp='node';
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/QueueRequirements.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/QueueRequirements.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/QueueRequirements.m	(revision 13010)
+@@ -0,0 +1,35 @@
++function QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,queue,np,time)
++%QUEUEREQUIREMENTS - queue requirements in time, number of cpus, by name of queue.
++%
++%   Usage: 
++%      QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,np,time)
++
++%Ok, go through requirements for current queue:
++index=ismemberi(queue,available_queues);
++if  ~index,
++	%ok, either we a generic cluster, with 'none' queue, or we could not find the queue reqruirements
++	if strcmpi(available_queues{1},'none'),
++		%reset index to 1, so we can fish the requirements
++		index=1;
++	else
++		string=available_queues{1};
++		for i=2:length(available_queues),
++			string=[string ' ' available_queues{i}];
++		end
++		error(['QueueRequirements error message: availables queues are ' string]);
++	end
++end
++
++%check on time requirements
++rtime=queue_requirements_time(index);
++if time<=0,
++	error('QueueRequirements: time should be a positive number');
++end
++if time>rtime,
++	error(['QueueRequirements: time should be < ' num2str(rtime) ' for queue: ' queue]);
++end
++
++%check on np requirements
++if np<=0,
++	error('QueueRequirements: np should be a positive number');
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 13010)
+@@ -0,0 +1,95 @@
++from AnalysisConfiguration import *
++from EnumDefinitions import *
++
++def AnalysisConfiguration(solutiontype): #{{{
++	"""
++	ANALYSISCONFIGURATION - return type of analyses, number of analyses 
++
++		Usage:
++			[analyses, numanalyses]=AnalysisConfiguration(solutiontype);
++	"""
++
++	if   solutiontype == DiagnosticSolutionEnum:
++		numanalyses=5
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum]
++
++	elif solutiontype == SteadystateSolutionEnum:
++		numanalyses=7 
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum]
++
++	elif solutiontype == ThermalSolutionEnum:
++		numanalyses=2 
++		analyses=[ThermalAnalysisEnum,MeltingAnalysisEnum]
++
++	elif solutiontype == EnthalpySolutionEnum:
++		numanalyses=1 
++		analyses=[EnthalpyAnalysisEnum]
++
++	elif solutiontype == PrognosticSolutionEnum:
++		numanalyses=1 
++		analyses=[PrognosticAnalysisEnum]
++
++	elif solutiontype == BalancethicknessSolutionEnum:
++		numanalyses=1 
++		analyses=[BalancethicknessAnalysisEnum]
++
++	elif solutiontype == SurfaceSlopeSolutionEnum:
++		numanalyses=1 
++		analyses=[SurfaceSlopeAnalysisEnum]
++
++	elif solutiontype == BedSlopeSolutionEnum:
++		numanalyses=1 
++		analyses=[BedSlopeAnalysisEnum]
++
++	elif solutiontype == TransientSolutionEnum:
++		numanalyses=9 
++		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum,EnthalpyAnalysisEnum,PrognosticAnalysisEnum]
++
++	elif solutiontype == FlaimSolutionEnum:
++		numanalyses=1 
++		analyses=[FlaimAnalysisEnum]
++
++	elif solutiontype == HydrologySolutionEnum:
++		numanalyses=3 
++		analyses=[BedSlopeAnalysisEnum,SurfaceSlopeAnalysisEnum,HydrologyAnalysisEnum]
++
++	else:
++		raise TypeError("solution type: '%s' not supported yet!" % EnumToString(solutiontype))
++
++	return analyses,numanalyses
++#}}}
++
++def ismodelselfconsistent(md):
++	"""
++	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
++
++	   Usage:
++	      ismodelselfconsistent(md),
++	"""
++
++	#initialize consistency as true
++	md.private.isconsistent=True
++
++	#Get solution and associated analyses
++	solution=md.private.solution
++	analyses,numanalyses=AnalysisConfiguration(solution)
++
++	#Go through a model fields, check that it is a class, and call checkconsistency
++	fields=vars(md)
++	for field in fields.iterkeys():
++
++		#Some properties do not need to be checked
++		if field in ['results','debug','radaroverlay']:
++			continue
++
++		#Check that current field is an object
++		if not hasattr(getattr(md,field),'checkconsistency'):
++			md.checkmessage("field '%s' is not an object." % field)
++
++		#Check consistency of the object
++		exec("md.%s.checkconsistency(md,solution,analyses)" % field)
++
++	#error message if mode is not consistent
++	if not md.private.isconsistent:
++		raise RuntimeError('Model not consistent, see messages above.')
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 13010)
+@@ -0,0 +1,100 @@
++function ismodelselfconsistent(md),
++%ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
++%
++%   Usage:
++%      ismodelselfconsistent(md),
++
++%initialize consistency as true
++md.private.isconsistent=true;
++
++%Get solution and associated analyses
++solution=md.private.solution;
++[analyses,numanalyses]=AnalysisConfiguration(solution);
++
++%Go through a model field, check that it is a class, and call checkconsistency
++fields=properties('model');
++for i=1:length(fields),
++	field=fields{i};
++
++	%Some properties do not need to be checked
++	if ismember(field,{'results' 'debug' 'radaroverlay'}),
++		continue;
++	end
++
++	%Check that current field is an object
++	if ~isobject(md.(field))
++		md=checkmessage(md,['field ''' char(field) ''' is not an object']);
++	end
++
++	%Check consistency of the object
++	if verLessThan('matlab', '7.6')
++		md=checkconsistency(md.(field),md,solution,analyses);
++	else
++		md=md.(field).checkconsistency(md,solution,analyses);
++	end
++end
++
++%error message if mode is not consistent
++if md.private.isconsistent==false,
++	error('Model not consistent, see messages above');
++end
++end
++
++function [analyses,numanalyses]=AnalysisConfiguration(solutiontype), % {{{
++%ANALYSISCONFIGURATION - return type of analyses, number of analyses 
++%
++%   Usage:
++%      [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
++
++
++
++switch solutiontype,
++
++	case DiagnosticSolutionEnum,
++		numanalyses=5;
++		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum];
++
++	case SteadystateSolutionEnum,
++		numanalyses=7; 
++		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum];
++
++	case ThermalSolutionEnum,
++		numanalyses=2; 
++		analyses=[ThermalAnalysisEnum;MeltingAnalysisEnum];
++
++	case EnthalpySolutionEnum,
++		numanalyses=1; 
++		analyses=[EnthalpyAnalysisEnum];
++
++	case PrognosticSolutionEnum,
++		numanalyses=1; 
++		analyses=[PrognosticAnalysisEnum];
++
++	case BalancethicknessSolutionEnum,
++		numanalyses=1; 
++		analyses=[BalancethicknessAnalysisEnum];
++
++	case SurfaceSlopeSolutionEnum,
++		numanalyses=1; 
++		analyses=[SurfaceSlopeAnalysisEnum];
++
++	case BedSlopeSolutionEnum,
++		numanalyses=1; 
++		analyses=[BedSlopeAnalysisEnum];
++
++	case TransientSolutionEnum,
++		numanalyses=9; 
++		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;EnthalpyAnalysisEnum;PrognosticAnalysisEnum];
++
++	case FlaimSolutionEnum,
++		numanalyses=1; 
++		analyses=[FlaimAnalysisEnum];
++
++	case HydrologySolutionEnum,
++		numanalyses=3; 
++		analyses=[BedSlopeAnalysisEnum;SurfaceSlopeAnalysisEnum;HydrologyAnalysisEnum];
++
++	otherwise
++		error('%s%s%s',' solution type: ',EnumToString(solutiontype),' not supported yet!');
++
++end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/parallelrange.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/parallelrange.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/parallelrange.py	(revision 13010)
+@@ -0,0 +1,25 @@
++#! /usr/bin/env python
++def parallelrange(rank,numprocs,globalsize):
++	"""
++	PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
++ 
++	   Usage: 
++	      i1,i2=parallelrange(rank,numprocs,globalsize)
++	"""
++
++	#We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
++	num_local_rows=[int(globalsize/numprocs) for i in xrange(numprocs)]
++
++	#There may be some rows left. Distribute evenly.
++	row_rest=globalsize - numprocs*int(globalsize/numprocs)
++
++	for i in xrange(row_rest):
++		num_local_rows[i]=num_local_rows[i]+1
++
++	i1=0
++	for i in xrange(rank-1):
++		i1+=num_local_rows[i]
++	i2=i1+num_local_rows[rank-1]-1
++
++	return i1,i2
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.m	(revision 13010)
+@@ -0,0 +1,154 @@
++function fielddisplay(md,name,comment)
++%FIELDDISPLAY - display model field
++%
++%   Usage:
++%      fielddisplay(md,offset,name,comment)
++
++	%get field
++	field=md.(name);
++
++	%disp corresponding line as a function of field type (offset set as 9 spaces)
++	parsedisplay('         ',name,field,comment);
++
++end %function
++
++function parsedisplay(offset,name,field,comment); %{{{
++
++	%string
++	if ischar(field),
++
++		if length(field)>30;
++			displayunit(offset,name,'not displayed',comment),
++		else
++			displayunit(offset,name,['''' field ''''],comment),
++		end
++
++	%numeric
++	elseif isnumeric(field)
++
++		%get size
++		fieldsize=size(field);
++
++		%double
++		if max(fieldsize)==1,
++			displayunit(offset,name,num2str(field),comment),
++		%matrix
++		else
++			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
++		end
++
++	%logical
++	elseif islogical(field)
++
++		%get size
++		fieldsize=size(field);
++
++		%single value
++		if max(fieldsize)==1,
++			if (field)
++				displayunit(offset,name,'true',comment),
++			else
++				displayunit(offset,name,'false',comment),
++			end
++		%matrix
++		else
++			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
++		end
++
++		%structure
++	elseif isstruct(field),
++		if ~isempty(fields(field))
++			displayunit(offset,name,'(structure)',comment),
++			struct_display(field,[offset '   ']),
++		else
++			displayunit(offset,name,'N/A',comment),
++		end
++
++	%cell
++	elseif iscell(field),
++		cell_display(offset,name,field,comment),
++
++	else
++		displayunit(offset,name,'not displayed',comment),
++
++	end
++end%}}}
++
++function struct_display(structure,offset) % {{{
++
++	structure_fields=fields(structure);
++
++	for i=1:length(structure_fields),
++
++		%get current field
++		field=structure.(structure_fields{i});
++
++		%recursive call if necessary
++		if isstruct(field),
++			displayunit(offset,structure_fields{i},'(structure)',''),
++			struct_display(field,[offset '   ']);
++
++		%display value
++		else
++			parsedisplay(offset,structure_fields{i},field,'');
++		end
++	end
++end% }}}
++function cell_display(offset,name,field,comment) % {{{
++
++	%initialization
++	string='{';
++
++	%go through the cell and fill string
++	if length(field)<5;
++		for i=1:length(field),
++			if ischar(field{i}),
++				string=[string ''''  field{i} ''','];
++			elseif (isnumeric(field{i}) & length(field{i})==1)
++				string=[string num2str(field{i}) ',' ];
++			else
++				string='{';
++				break
++			end
++		end
++	end
++	if strcmp(string,'{'),
++		string=['(' num2str(size(field,1)) 'x' num2str(size(field,2)) ')'];
++	else
++		string=[string(1:end-1) '}'];
++	end
++
++	%call displayunit
++	displayunit(offset,name,string,comment);
++end% }}}
++function displayunit(offset,name,characterization,comment),% {{{
++
++	%take care of name
++	if length(name)>23,
++		name=[name(1:20) '...'];
++	end
++
++	%take care of characterization
++	if (strcmp(characterization,['''' '''']) | strcmp(characterization,'NaN')),
++		characterization='N/A';
++	end
++	if length(characterization)>15,
++		characterization=[characterization(1:12) '...'];
++	end
++
++	%print
++	if isempty(comment)
++		disp(sprintf('%s%-23s: %-15s',offset,name,characterization));
++	else
++		if ischar(comment),
++			disp(sprintf('%s%-23s: %-15s -- %s',offset,name,characterization,comment));
++		elseif iscell(comment),
++			disp(sprintf('%s%-23s: %-15s -- %s',offset,name,characterization,comment{1}));
++			for i=2:length(comment),
++				disp(sprintf('%s%-23s  %-15s    %s',offset,'','',comment{i}));
++			end
++		else
++			error('fielddisplay error message: format for comment not supportet yet');
++		end
++	end
++end% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/parallelrange.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/parallelrange.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/parallelrange.m	(revision 13010)
+@@ -0,0 +1,23 @@
++function [i1,i2]=parallelrange(rank,numprocs,globalsize)
++%PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
++%
++%   Usage: 
++%      [i1,i1]=parallelrange(rank,numprocs,globalsize)
++
++num_local_rows=zeros(numprocs,1);
++
++for i=1:numprocs,
++	%we use floor. we under distribute rows. The rows left  are then redistributed, therefore resulting in a more even distribution.
++	num_local_rows(i)=floor(globalsize/numprocs);
++end
++
++
++%There may be some rows left. Distribute evenly.
++row_rest=globalsize - numprocs*floor(globalsize/numprocs);
++
++for i=1:row_rest,
++	num_local_rows(i)=num_local_rows(i)+1;
++end
++
++i1=sum(num_local_rows(1:rank-1))+1;
++i2=i1+num_local_rows(rank)-1;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13010-13011.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13010-13011.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13010-13011.diff	(revision 13394)
@@ -0,0 +1,570 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.py	(revision 13010)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.py	(revision 13011)
+@@ -1,18 +0,0 @@
+-import numpy
+-
+-def isnans(array):
+-	"""
+-	ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
+-
+-	   Usage:    isnans(array)
+-
+-	      See also : ISNAN 
+-	"""
+-
+-	if   isinstance(array,(tuple,list,dict)): 
+-		returnvalue=0
+-	else:
+-		returnvalue=numpy.isnan(array)
+-
+-	return returnvalue
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/round_ice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/round_ice.m	(revision 13010)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/round_ice.m	(revision 13011)
+@@ -1,38 +0,0 @@
+-function new_x=round_ice(x,numnonzeros)
+-%ROUND_ICE - rounds up x so that it has only numnonzeros non zero digits
+-%
+-%   numnonzeros must be an integer larger or equal to 1
+-%
+-%   Usage:
+-%      new_x=round_ice(x,numnonzeros)
+-
+-%some checks
+-if (nargin ~=2 | nargout>1),
+-	error('round_ice usage: new_x=round_ice(x,numonzeros)');
+-end
+-if ~isnumeric(x)
+-	error('round_ice error message: x must be a number and numzeros an integer');
+-end
+-if round(numnonzeros)~=numnonzeros
+-	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
+-end
+-if any(numnonzeros<1)
+-	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
+-end
+-if (length(numnonzeros)~=1 & size(numnonzeros)~=size(x))
+-	error('round_ice error message: numnonzeros must be an integer larger or equal to 1 or a list of integers of length length(x)')
+-end
+-
+-%figure out how long x is
+-lengthx=ceil(log10(abs(x)));
+-
+-%if x contains 0, lengthx=-Inf
+-lengthx(isinf(lengthx))=1;
+-
+-%get its sign
+-si=sign(x);
+-
+-%rule out zeros
+-new_x=si.*round(abs(x).*10.^(-lengthx+numnonzeros)).*10.^(lengthx-numnonzeros);
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.m	(revision 13010)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/isnans.m	(revision 13011)
+@@ -1,15 +0,0 @@
+-function returnvalue=isnans(array)
+-%ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
+-%
+-%  Usage:    isnans(array)
+-%
+-%  See also : ISNAN 
+-
+-
+-if isstruct(array), 
+-	returnvalue=0;
+-elseif iscell(array)
+-	returnvalue=0;
+-else
+-	returnvalue=isnan(array);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/cfl_step.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/cfl_step.m	(revision 13010)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/cfl_step.m	(revision 13011)
+@@ -1,23 +0,0 @@
+-function maxtime=cfl_step(md,vx,vy);
+-%CFL_STEP - return the maximum time step for the model in years
+-%
+-%   Dt < 0.5 / ( u/Dx +v/Dy )
+-%
+-%   Usage:
+-%      maxtime=cfl_step(md,vx,vy);
+-%
+-%   Example:
+-%      dt=cfl_step(md,md.results.DiagnosticSolution.Vx,md.results.DiagnosticSolution.Vy)
+-
+-%Check length of velocities 
+-if size(vx,1)~=md.mesh.numberofvertices & size(vy,1)~=md.mesh.numberofvertices,
+-	error('timestpes error message: size of velocity components must be the same as md.mesh.numberofvertices');
+-end
+-
+-index=md.mesh.elements;
+-edgex=max(md.mesh.x(index),[],2)-min(md.mesh.x(index),[],2);
+-edgey=max(md.mesh.y(index),[],2)-min(md.mesh.y(index),[],2);
+-vx=max(abs(vx(index)),[],2);
+-vy=max(abs(vy(index)),[],2);
+-
+-maxtime=1/2*min(1./(vx./edgex+vy./edgey));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/fixdec.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/fixdec.m	(revision 13010)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/math/fixdec.m	(revision 13011)
+@@ -1,41 +0,0 @@
+-function y = fixdec(x, n)
+-%FIXDEC -  Round towards zero with a specified number of decimals.
+-%
+-%   This routine rounds the elements of X to N decimals.
+-%
+-%   Usage:
+-%      y = fixdec(x, n)
+-%
+-%   Example:
+-%      fixdec(10*sqrt(2) + i*pi/10, 4) returns 14.1421 + 0.3141i
+-%
+-%   See also: FIX, FLOOR, CEIL, ROUND, FIXDIG, ROUNDDEC, ROUNDDIG.
+-
+-%   Author:      Peter J. Acklam
+-%   Time-stamp:  2004-09-22 20:08:10 +0200
+-%   E-mail:      pjacklam@online.no
+-%   URL:         http://home.online.no/~pjacklam
+-
+-   % Check number of input arguments.
+-   error(nargchk(2, 2, nargin));
+-
+-   % Quick exit if either argument is empty.
+-   if (isempty(x) |isempty(n))
+-      y = [];
+-      return
+-   end
+-
+-   % Get size of input arguments.
+-   size_x   = size(x);
+-   size_n   = size(n);
+-   scalar_x = all(size_x == 1);           % True if x is a scalar.
+-   scalar_n = all(size_n == 1);           % True if n is a scalar.
+-
+-   % Check size of input arguments.
+-   if ~scalar_x & ~scalar_n & ~isequal(size_x, size_n)
+-      error(['When both arguments are non-scalars they must have' ...
+-             ' the same size']);
+-   end
+-
+-   f = 10.^n;
+-   y = fix(x .* f) ./ f;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/materials/paterson.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/materials/paterson.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/materials/paterson.py	(revision 13011)
+@@ -0,0 +1,50 @@
++from numpy import *
++
++def paterson(temperature):
++
++    # Local Variables: pos11, pos5, pos10, temperature, pos, T, pos8, pos9, pos6, pos7, pos4, rigidity, pos2, pos3, pos1
++    # Function calls: length, zeros, argwhere, paterson, error
++    #PATERSON - figure out the rigidity of ice for a given temperature
++    #
++    #   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
++    #   temperature is in Kelvin degrees
++    #
++    #   Usage:
++    #      rigidity=paterson(temperature)
++    
++	pos=argwhere(temperature<0.)
++	if len(pos):
++		print 'input temperature should be in Kelvin (positive)'
++		return []
++    
++	T = temperature-273.15
++	#The routine below is equivalent to:
++	# n=3; T=temperature-273;
++	# %From paterson,
++	# Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
++	# A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
++	# 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
++	# %Convert into rigidity B
++	# B=A.^(-1/n)*10^3; %s^(1/3)Pa
++	# %Now, do a cubic fit between Temp and B: 
++	# fittedmodel=fit(Temp,B,'cubicspline');
++	# rigidity=fittedmodel(temperature);
++
++	rigidity=zeros(len(T))
++	pos1=argwhere(T<=-45);           rigidity[pos1]=10**8*(-0.000292866376675*(T[pos1]+50)**3+ 0.011672640664130*(T[pos1]+50)**2  -0.325004442485481*(T[pos1]+50)+  6.524779401948101)
++	pos2=argwhere(logical_and(-45<=T,T<-40));   rigidity[pos2]=10**8*(-0.000292866376675*(T[pos2]+45)**3+ 0.007279645014004*(T[pos2]+45)**2  -0.230243014094813*(T[pos2]+45)+  5.154964909039554)
++	pos3=argwhere(logical_and(-40<=T,T<-35));   rigidity[pos3]=10**8*(0.000072737147457*(T[pos3]+40)**3+  0.002886649363879*(T[pos3]+40)**2  -0.179411542205399*(T[pos3]+40)+  4.149132666831214)
++	pos4=argwhere(logical_and(-35<=T,T<-30));   rigidity[pos4]=10**8*(-0.000086144770023*(T[pos4]+35)**3+ 0.003977706575736*(T[pos4]+35)**2  -0.145089762507325*(T[pos4]+35)+  3.333333333333331)
++	pos5=argwhere(logical_and(-30<=T,T<-25));   rigidity[pos5]=10**8*(-0.000043984685769*(T[pos5]+30)**3+ 0.002685535025386*(T[pos5]+30)**2  -0.111773554501713*(T[pos5]+30)+  2.696559088937191)
++	pos6=argwhere(logical_and(-25<=T,T<-20));   rigidity[pos6]=10**8*(-0.000029799523463*(T[pos6]+25)**3+ 0.002025764738854*(T[pos6]+25)**2  -0.088217055680511*(T[pos6]+25)+  2.199331606342181)
++	pos7=argwhere(logical_and(-20<=T,T<-15));   rigidity[pos7]=10**8*(0.000136920904777*(T[pos7]+20)**3+  0.001578771886910*(T[pos7]+20)**2  -0.070194372551690*(T[pos7]+20)+  1.805165505978111)
++	pos8=argwhere(logical_and(-15<=T,T<-10));   rigidity[pos8]=10**8*(-0.000899763781026*(T[pos8]+15)**3+ 0.003632585458564*(T[pos8]+15)**2  -0.044137585824322*(T[pos8]+15)+  1.510778053489523)
++	pos9=argwhere(logical_and(-10<=T,T<-5));    rigidity[pos9]=10**8*(0.001676964325070*(T[pos9]+10)**3-  0.009863871256831*(T[pos9]+10)**2  -0.075294014815659*(T[pos9]+10)+  1.268434288203714)
++	pos10=argwhere(logical_and(-5<=T,T<-2));    rigidity[pos10]=10**8*(-0.003748937622487*(T[pos10]+5)**3+0.015290593619213*(T[pos10]+5)**2  -0.048160403003748*(T[pos10]+5)+  0.854987973338348)
++	pos11=argwhere(-2<=T);           rigidity[pos11]=10**8*(-0.003748937622488*(T[pos11]+2)**3-0.018449844983174*(T[pos11]+2)**2  -0.057638157095631*(T[pos11]+2)+  0.746900791092860)
++
++	#Now make sure that rigidity is positive
++	pos=argwhere(rigidity<0);        rigidity[pos]=1**6 
++
++	return rigidity
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/materials/paterson.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/materials/paterson.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/materials/paterson.m	(revision 13011)
+@@ -0,0 +1,42 @@
++function rigidity=paterson(temperature)
++%PATERSON - figure out the rigidity of ice for a given temperature
++%
++%   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
++%   temperature is in Kelvin degrees
++%
++%   Usage:
++%      rigidity=paterson(temperature)
++
++if(temperature<0)
++	error('input temperature should be in Kelvin (positive)');
++end
++T=temperature-273.15;
++
++%The routine below is equivalent to:
++
++% n=3; T=temperature-273;
++% %From paterson,
++% Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
++% A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
++% 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
++% %Convert into rigidity B
++% B=A.^(-1/n)*10^3; %s^(1/3)Pa
++% %Now, do a cubic fit between Temp and B: 
++% fittedmodel=fit(Temp,B,'cubicspline');
++% rigidity=fittedmodel(temperature);
++
++rigidity=zeros(length(T),1);
++pos1=find(T<=-45);           rigidity(pos1)=10^8*(-0.000292866376675*(T(pos1)+50).^3+ 0.011672640664130*(T(pos1)+50).^2  -0.325004442485481*(T(pos1)+50)+  6.524779401948101);
++pos2=find(-45<=T & T<-40);   rigidity(pos2)=10^8*(-0.000292866376675*(T(pos2)+45).^3+ 0.007279645014004*(T(pos2)+45).^2  -0.230243014094813*(T(pos2)+45)+  5.154964909039554);
++pos3=find(-40<=T & T<-35);   rigidity(pos3)=10^8*(0.000072737147457*(T(pos3)+40).^3+  0.002886649363879*(T(pos3)+40).^2  -0.179411542205399*(T(pos3)+40)+  4.149132666831214);
++pos4=find(-35<=T & T<-30);   rigidity(pos4)=10^8*(-0.000086144770023*(T(pos4)+35).^3+ 0.003977706575736*(T(pos4)+35).^2  -0.145089762507325*(T(pos4)+35)+  3.333333333333331);
++pos5=find(-30<=T & T<-25);   rigidity(pos5)=10^8*(-0.000043984685769*(T(pos5)+30).^3+ 0.002685535025386*(T(pos5)+30).^2  -0.111773554501713*(T(pos5)+30)+  2.696559088937191);
++pos6=find(-25<=T & T<-20);   rigidity(pos6)=10^8*(-0.000029799523463*(T(pos6)+25).^3+ 0.002025764738854*(T(pos6)+25).^2  -0.088217055680511*(T(pos6)+25)+  2.199331606342181);
++pos7=find(-20<=T & T<-15);   rigidity(pos7)=10^8*(0.000136920904777*(T(pos7)+20).^3+  0.001578771886910*(T(pos7)+20).^2  -0.070194372551690*(T(pos7)+20)+  1.805165505978111);
++pos8=find(-15<=T & T<-10);   rigidity(pos8)=10^8*(-0.000899763781026*(T(pos8)+15).^3+ 0.003632585458564*(T(pos8)+15).^2  -0.044137585824322*(T(pos8)+15)+  1.510778053489523);
++pos9=find(-10<=T & T<-5);    rigidity(pos9)=10^8*(0.001676964325070*(T(pos9)+10).^3-  0.009863871256831*(T(pos9)+10).^2  -0.075294014815659*(T(pos9)+10)+  1.268434288203714);
++pos10=find(-5<=T & T<-2);    rigidity(pos10)=10^8*(-0.003748937622487*(T(pos10)+5).^3+0.015290593619213*(T(pos10)+5).^2  -0.048160403003748*(T(pos10)+5)+  0.854987973338348);
++pos11=find(-2<=T);           rigidity(pos11)=10^8*(-0.003748937622488*(T(pos11)+2).^3-0.018449844983174*(T(pos11)+2).^2  -0.057638157095631*(T(pos11)+2)+  0.746900791092860);
++
++%Now make sure that rigidity is positive
++pos=find(rigidity<0);        rigidity(pos)=10^6;
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/materials/paterson.m
+___________________________________________________________________
+Added: svn:executable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/oasis/carter.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/oasis/carter.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/oasis/carter.m	(revision 13011)
+@@ -0,0 +1,28 @@
++function attenuation=carter(temperature)
++%CARTER - attenuation as a function of temperature
++%
++%   TWO WAY - Attenuation (in dB/m) as a function of temperature (K)
++%   From Carter at al. 2007 (Radar-based subglacial lake classification in Antarctica)
++%   Figure 4
++%
++%   Usage:
++%      attenuation=carter(temperature)
++
++if(temperature<0)
++	error('input temperature should be in Kelvin (positive)');
++end
++T=temperature-273.15;
++
++Temp=[-50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0]';
++A=[0.0015 0.002 0.003 0.0042 0.0055 0.0083 0.012 0.0175 0.026 0.038 0.055]';
++
++%Now, do a cubic fit between Temp and B: 
++[cfun,gof,output]=fit(Temp,A,'cubicspline');
++%breaks=cfun.p.breaks;
++%coeff=cfun.p.coefs;
++
++%Calculate attenuation
++attenuation=cfun(T);
++
++%Make it a 2 way attenuation
++attenuation=2*attenuation;
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/oasis/carter.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/isnans.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/isnans.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/isnans.py	(revision 13011)
+@@ -0,0 +1,18 @@
++import numpy
++
++def isnans(array):
++	"""
++	ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
++
++	   Usage:    isnans(array)
++
++	      See also : ISNAN 
++	"""
++
++	if   isinstance(array,(tuple,list,dict)): 
++		returnvalue=0
++	else:
++		returnvalue=numpy.isnan(array)
++
++	return returnvalue
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/round_ice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/round_ice.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/round_ice.m	(revision 13011)
+@@ -0,0 +1,36 @@
++function new_x=round_ice(x,numnonzeros)
++%ROUND_ICE - rounds up x so that it has only numnonzeros non zero digits
++%
++%   numnonzeros must be an integer larger or equal to 1
++%
++%   Usage:
++%      new_x=round_ice(x,numnonzeros)
++
++%some checks
++if (nargin ~=2 | nargout>1),
++	error('round_ice usage: new_x=round_ice(x,numonzeros)');
++end
++if ~isnumeric(x)
++	error('round_ice error message: x must be a number and numzeros an integer');
++end
++if round(numnonzeros)~=numnonzeros
++	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
++end
++if any(numnonzeros<1)
++	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
++end
++if (length(numnonzeros)~=1 & size(numnonzeros)~=size(x))
++	error('round_ice error message: numnonzeros must be an integer larger or equal to 1 or a list of integers of length length(x)')
++end
++
++%figure out how long x is
++lengthx=ceil(log10(abs(x)));
++
++%if x contains 0, lengthx=-Inf
++lengthx(isinf(lengthx))=1;
++
++%get its sign
++si=sign(x);
++
++%rule out zeros
++new_x=si.*round(abs(x).*10.^(-lengthx+numnonzeros)).*10.^(lengthx-numnonzeros);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/isnans.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/isnans.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/isnans.m	(revision 13011)
+@@ -0,0 +1,15 @@
++function returnvalue=isnans(array)
++%ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
++%
++%  Usage:    isnans(array)
++%
++%  See also : ISNAN 
++
++
++if isstruct(array), 
++	returnvalue=0;
++elseif iscell(array)
++	returnvalue=0;
++else
++	returnvalue=isnan(array);
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.py	(revision 13010)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.py	(revision 13011)
+@@ -1,50 +0,0 @@
+-from numpy import *
+-
+-def paterson(temperature):
+-
+-    # Local Variables: pos11, pos5, pos10, temperature, pos, T, pos8, pos9, pos6, pos7, pos4, rigidity, pos2, pos3, pos1
+-    # Function calls: length, zeros, argwhere, paterson, error
+-    #PATERSON - figure out the rigidity of ice for a given temperature
+-    #
+-    #   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
+-    #   temperature is in Kelvin degrees
+-    #
+-    #   Usage:
+-    #      rigidity=paterson(temperature)
+-    
+-	pos=argwhere(temperature<0.)
+-	if len(pos):
+-		print 'input temperature should be in Kelvin (positive)'
+-		return []
+-    
+-	T = temperature-273.15
+-	#The routine below is equivalent to:
+-	# n=3; T=temperature-273;
+-	# %From paterson,
+-	# Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
+-	# A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
+-	# 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
+-	# %Convert into rigidity B
+-	# B=A.^(-1/n)*10^3; %s^(1/3)Pa
+-	# %Now, do a cubic fit between Temp and B: 
+-	# fittedmodel=fit(Temp,B,'cubicspline');
+-	# rigidity=fittedmodel(temperature);
+-
+-	rigidity=zeros(len(T))
+-	pos1=argwhere(T<=-45);           rigidity[pos1]=10**8*(-0.000292866376675*(T[pos1]+50)**3+ 0.011672640664130*(T[pos1]+50)**2  -0.325004442485481*(T[pos1]+50)+  6.524779401948101)
+-	pos2=argwhere(logical_and(-45<=T,T<-40));   rigidity[pos2]=10**8*(-0.000292866376675*(T[pos2]+45)**3+ 0.007279645014004*(T[pos2]+45)**2  -0.230243014094813*(T[pos2]+45)+  5.154964909039554)
+-	pos3=argwhere(logical_and(-40<=T,T<-35));   rigidity[pos3]=10**8*(0.000072737147457*(T[pos3]+40)**3+  0.002886649363879*(T[pos3]+40)**2  -0.179411542205399*(T[pos3]+40)+  4.149132666831214)
+-	pos4=argwhere(logical_and(-35<=T,T<-30));   rigidity[pos4]=10**8*(-0.000086144770023*(T[pos4]+35)**3+ 0.003977706575736*(T[pos4]+35)**2  -0.145089762507325*(T[pos4]+35)+  3.333333333333331)
+-	pos5=argwhere(logical_and(-30<=T,T<-25));   rigidity[pos5]=10**8*(-0.000043984685769*(T[pos5]+30)**3+ 0.002685535025386*(T[pos5]+30)**2  -0.111773554501713*(T[pos5]+30)+  2.696559088937191)
+-	pos6=argwhere(logical_and(-25<=T,T<-20));   rigidity[pos6]=10**8*(-0.000029799523463*(T[pos6]+25)**3+ 0.002025764738854*(T[pos6]+25)**2  -0.088217055680511*(T[pos6]+25)+  2.199331606342181)
+-	pos7=argwhere(logical_and(-20<=T,T<-15));   rigidity[pos7]=10**8*(0.000136920904777*(T[pos7]+20)**3+  0.001578771886910*(T[pos7]+20)**2  -0.070194372551690*(T[pos7]+20)+  1.805165505978111)
+-	pos8=argwhere(logical_and(-15<=T,T<-10));   rigidity[pos8]=10**8*(-0.000899763781026*(T[pos8]+15)**3+ 0.003632585458564*(T[pos8]+15)**2  -0.044137585824322*(T[pos8]+15)+  1.510778053489523)
+-	pos9=argwhere(logical_and(-10<=T,T<-5));    rigidity[pos9]=10**8*(0.001676964325070*(T[pos9]+10)**3-  0.009863871256831*(T[pos9]+10)**2  -0.075294014815659*(T[pos9]+10)+  1.268434288203714)
+-	pos10=argwhere(logical_and(-5<=T,T<-2));    rigidity[pos10]=10**8*(-0.003748937622487*(T[pos10]+5)**3+0.015290593619213*(T[pos10]+5)**2  -0.048160403003748*(T[pos10]+5)+  0.854987973338348)
+-	pos11=argwhere(-2<=T);           rigidity[pos11]=10**8*(-0.003748937622488*(T[pos11]+2)**3-0.018449844983174*(T[pos11]+2)**2  -0.057638157095631*(T[pos11]+2)+  0.746900791092860)
+-
+-	#Now make sure that rigidity is positive
+-	pos=argwhere(rigidity<0);        rigidity[pos]=1**6 
+-
+-	return rigidity
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.m	(revision 13010)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/paterson.m	(revision 13011)
+@@ -1,42 +0,0 @@
+-function rigidity=paterson(temperature)
+-%PATERSON - figure out the rigidity of ice for a given temperature
+-%
+-%   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
+-%   temperature is in Kelvin degrees
+-%
+-%   Usage:
+-%      rigidity=paterson(temperature)
+-
+-if(temperature<0)
+-	error('input temperature should be in Kelvin (positive)');
+-end
+-T=temperature-273.15;
+-
+-%The routine below is equivalent to:
+-
+-% n=3; T=temperature-273;
+-% %From paterson,
+-% Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
+-% A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
+-% 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
+-% %Convert into rigidity B
+-% B=A.^(-1/n)*10^3; %s^(1/3)Pa
+-% %Now, do a cubic fit between Temp and B: 
+-% fittedmodel=fit(Temp,B,'cubicspline');
+-% rigidity=fittedmodel(temperature);
+-
+-rigidity=zeros(length(T),1);
+-pos1=find(T<=-45);           rigidity(pos1)=10^8*(-0.000292866376675*(T(pos1)+50).^3+ 0.011672640664130*(T(pos1)+50).^2  -0.325004442485481*(T(pos1)+50)+  6.524779401948101);
+-pos2=find(-45<=T & T<-40);   rigidity(pos2)=10^8*(-0.000292866376675*(T(pos2)+45).^3+ 0.007279645014004*(T(pos2)+45).^2  -0.230243014094813*(T(pos2)+45)+  5.154964909039554);
+-pos3=find(-40<=T & T<-35);   rigidity(pos3)=10^8*(0.000072737147457*(T(pos3)+40).^3+  0.002886649363879*(T(pos3)+40).^2  -0.179411542205399*(T(pos3)+40)+  4.149132666831214);
+-pos4=find(-35<=T & T<-30);   rigidity(pos4)=10^8*(-0.000086144770023*(T(pos4)+35).^3+ 0.003977706575736*(T(pos4)+35).^2  -0.145089762507325*(T(pos4)+35)+  3.333333333333331);
+-pos5=find(-30<=T & T<-25);   rigidity(pos5)=10^8*(-0.000043984685769*(T(pos5)+30).^3+ 0.002685535025386*(T(pos5)+30).^2  -0.111773554501713*(T(pos5)+30)+  2.696559088937191);
+-pos6=find(-25<=T & T<-20);   rigidity(pos6)=10^8*(-0.000029799523463*(T(pos6)+25).^3+ 0.002025764738854*(T(pos6)+25).^2  -0.088217055680511*(T(pos6)+25)+  2.199331606342181);
+-pos7=find(-20<=T & T<-15);   rigidity(pos7)=10^8*(0.000136920904777*(T(pos7)+20).^3+  0.001578771886910*(T(pos7)+20).^2  -0.070194372551690*(T(pos7)+20)+  1.805165505978111);
+-pos8=find(-15<=T & T<-10);   rigidity(pos8)=10^8*(-0.000899763781026*(T(pos8)+15).^3+ 0.003632585458564*(T(pos8)+15).^2  -0.044137585824322*(T(pos8)+15)+  1.510778053489523);
+-pos9=find(-10<=T & T<-5);    rigidity(pos9)=10^8*(0.001676964325070*(T(pos9)+10).^3-  0.009863871256831*(T(pos9)+10).^2  -0.075294014815659*(T(pos9)+10)+  1.268434288203714);
+-pos10=find(-5<=T & T<-2);    rigidity(pos10)=10^8*(-0.003748937622487*(T(pos10)+5).^3+0.015290593619213*(T(pos10)+5).^2  -0.048160403003748*(T(pos10)+5)+  0.854987973338348);
+-pos11=find(-2<=T);           rigidity(pos11)=10^8*(-0.003748937622488*(T(pos11)+2).^3-0.018449844983174*(T(pos11)+2).^2  -0.057638157095631*(T(pos11)+2)+  0.746900791092860);
+-
+-%Now make sure that rigidity is positive
+-pos=find(rigidity<0);        rigidity(pos)=10^6;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/carter.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/carter.m	(revision 13010)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/carter.m	(revision 13011)
+@@ -1,28 +0,0 @@
+-function attenuation=carter(temperature)
+-%CARTER - attenuation as a function of temperature
+-%
+-%   TWO WAY - Attenuation (in dB/m) as a function of temperature (K)
+-%   From Carter at al. 2007 (Radar-based subglacial lake classification in Antarctica)
+-%   Figure 4
+-%
+-%   Usage:
+-%      attenuation=carter(temperature)
+-
+-if(temperature<0)
+-	error('input temperature should be in Kelvin (positive)');
+-end
+-T=temperature-273.15;
+-
+-Temp=[-50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0]';
+-A=[0.0015 0.002 0.003 0.0042 0.0055 0.0083 0.012 0.0175 0.026 0.038 0.055]';
+-
+-%Now, do a cubic fit between Temp and B: 
+-[cfun,gof,output]=fit(Temp,A,'cubicspline');
+-%breaks=cfun.p.breaks;
+-%coeff=cfun.p.coefs;
+-
+-%Calculate attenuation
+-attenuation=cfun(T);
+-
+-%Make it a 2 way attenuation
+-attenuation=2*attenuation;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/lithostaticpressure.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/lithostaticpressure.m	(revision 13010)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/lithostaticpressure.m	(revision 13011)
+@@ -1,7 +0,0 @@
+-function pressure=lithostaticpressure(rho_ice,g,s,z);
+-%LITHOSTATICPRESSURE - compute the lithostatic pressure
+-%
+-%   Usage:
+-%      pressure=lithostacticpressure(rho_ice,g,surface,z)
+-
+-pressure=rho_ice*g*(s-z);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/cfl_step.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/cfl_step.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/cfl_step.m	(revision 13011)
+@@ -0,0 +1,23 @@
++function maxtime=cfl_step(md,vx,vy);
++%CFL_STEP - return the maximum time step for the model in years
++%
++%   Dt < 0.5 / ( u/Dx +v/Dy )
++%
++%   Usage:
++%      maxtime=cfl_step(md,vx,vy);
++%
++%   Example:
++%      dt=cfl_step(md,md.results.DiagnosticSolution.Vx,md.results.DiagnosticSolution.Vy)
++
++%Check length of velocities 
++if size(vx,1)~=md.mesh.numberofvertices & size(vy,1)~=md.mesh.numberofvertices,
++	error('timestpes error message: size of velocity components must be the same as md.mesh.numberofvertices');
++end
++
++index=md.mesh.elements;
++edgex=max(md.mesh.x(index),[],2)-min(md.mesh.x(index),[],2);
++edgey=max(md.mesh.y(index),[],2)-min(md.mesh.y(index),[],2);
++vx=max(abs(vx(index)),[],2);
++vy=max(abs(vy(index)),[],2);
++
++maxtime=1/2*min(1./(vx./edgex+vy./edgey));
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/cfl_step.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13011-13012.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13011-13012.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13011-13012.diff	(revision 13394)
@@ -0,0 +1,1893 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJob.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJob.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJob.m	(revision 13012)
+@@ -1,21 +0,0 @@
+-function LaunchMultipleQueueJob(cluster,name,executionpath)
+-%LAUNCHMULTIPLEQUEUEJOB - ...
+-%
+-%   Usage:
+-%      LaunchMultipleQueueJob(executionpath)
+-
+-%First try and figure out if there is a special script for thie particular cluster
+-function_name=['LaunchMultipleQueueJob' cluster];
+-
+-%some specific treatment of identical cluster, gemini, castor and pollux
+-if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
+-	function_name='LaunchMultipleQueueJobgemini';
+-end
+-
+-if exist(function_name,'file'),
+-	%Call this function:
+-	eval([function_name '(cluster,name,executionpath);']);
+-else
+-	%Call the generic LaunchMultipleQueueJob:
+-	LaunchMultipleQueueJobGeneric(cluster,name,executionpath);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptgemini.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptgemini.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptgemini.m	(revision 13012)
+@@ -1,23 +0,0 @@
+-function BuildQueueingScriptgemini(name,executionpath,codepath)
+-%BUILDQUEUEINGSCRIPTGEMINI - ...
+-%
+-%   Usage:
+-%      BuildQueueingScriptgemini(md,executionpath,codepath)
+-
+-scriptname=[name '.queue'];
+-
+-fid=fopen(scriptname,'w');
+-if fid==-1,
+-	error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']);
+-end
+-
+-fprintf(fid,'#!/bin/sh\n');
+-fprintf(fid,'cd %s\n',executionpath);
+-fprintf(fid,'mkdir %s\n',name);
+-fprintf(fid,'cd %s\n',name);
+-fprintf(fid,'mv ../ModelList.tar.gz ./\n');
+-fprintf(fid,'tar -zxvf ModelList.tar.gz\n');
+-fprintf(fid,'foreach i (%s-*vs*.queue)\n',name);
+-fprintf(fid,'qsub $i\n');
+-fprintf(fid,'end\n');
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobgemini.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobgemini.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobgemini.m	(revision 13012)
+@@ -1,22 +0,0 @@
+-function md=LaunchMultipleQueueJobgemini(cluster,name,executionpath)
+-%LAUNCHMULTIPLEQUEUEJOBGEMINI - Launch multiple queueing script on Gemini cluster
+-%
+-%   Usage:
+-%      LaunchMultipleQueueJobgemini(cluster,name,executionpath)
+-
+-
+-%first, check we have the binary file and the queueing script
+-if ~exist([ name '.queue'],'file'),
+-	error('LaunchMultipleQueueJobgemini error message: queueing script issing, cannot go forward');
+-end
+-
+-if ~exist('ModelList.tar.gz','file'),
+-	error('LaunchMultipleQueueJobgemini error message: inputs models file missing, cannot go forward');
+-end
+-
+-%upload both files to cluster
+-disp('uploading input file,  queueing script and variables script');
+-eval(['!scp ModelList.tar.gz ' name '.queue '  cluster ':' executionpath]);
+-
+-disp('launching solution sequence on remote cluster');
+-issmssh(cluster,login,['"cd ' executionpath ' && source ' name '.queue "']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptGeneric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptGeneric.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScriptGeneric.m	(revision 13012)
+@@ -1,9 +0,0 @@
+-function BuildMultipleQueueingScriptGeneric(name,executionpath,codepath)
+-%BUILDMULTIPLEQUEUEINGSCRIPTGENERIC - ...
+-%
+-%   Usage:
+-%      BuildMultipleQueueingScriptGeneric(executionpath,codepath)
+-
+-%not done yet
+-error('BuildMultipleQueueingScriptGenericerror message: not supported yet!');
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScript.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScript.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/BuildMultipleQueueingScript.m	(revision 13012)
+@@ -1,23 +0,0 @@
+-function BuildMultipleQueueingScript(cluster,name,executionpath,codepath)
+-%BUILDMULTIPLEQUEUEINGSCRIPT - 
+-%
+-%   Usage:
+-%      BuildMultipleQueueingScript(executionpath,codepath)
+-
+-disp('building queueing script');
+-
+-%First try and figure out if there is a special script for this particular cluster
+-function_name=['BuildMultipleQueueingScript' cluster];
+-
+-%some specific treatment of identical cluster, gemini, castor and pollux
+-if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
+-	function_name='BuildMultipleQueueingScriptgemini';
+-end
+-
+-if exist(function_name,'file'),
+-	%Call this function:
+-	eval([function_name '(name,executionpath,codepath);']);
+-else
+-	%Call the generic BuildQueueingScript:
+-	BuildMultipleQueueingScriptGeneric(name,executionpath,codepath);
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobGeneric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobGeneric.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/multiplequeue/LaunchMultipleQueueJobGeneric.m	(revision 13012)
+@@ -1,7 +0,0 @@
+-function LaunchMultipleQueueJobGeneric(cluster,name,executionpath)
+-%LAUNCHMULTIPLEQUEUEJOBGENERIC - Generic routine to launch multiple queueing job
+-%
+-%   Usage:
+-%      LaunchMultipleQueueJobGeneric(cluster,name,executionpath)
+-
+-error('LaunchMultipleQueueJobGeneric error message: not supported yet!');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/GetAreas.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/GetAreas.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/GetAreas.m	(revision 13012)
+@@ -0,0 +1,51 @@
++function areas=GetAreas(index,x,y,varargin)
++%GETAREAS - compute areas or volumes of elements
++%
++%   compute areas of triangular elements or volumes 
++%   of pentahedrons
++%
++%   Usage:
++%      areas  =GetAreas(index,x,y);
++%      volumes=GetAreas(index,x,y,z);
++%
++%   Examples:
++%      areas  =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
++%      volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
++
++%get number of elements and number of nodes
++nels=size(index,1);
++nods=length(x);
++if nargin==4, z=varargin{1}; end
++
++%some checks
++if nargout~=1 | (nargin~=3 & nargin~=4),
++	help GetAreas
++	error('GetAreas error message: bad usage')
++end
++if ((length(y)~=nods) | (nargin==4 & length(z)~=nods)),
++	error('GetAreas error message: x,y and z do not have the same length')
++end
++if max(index(:))>nods,
++	error(['GetAreas error message: index should not have values above ' num2str(nods) ])
++end
++if (nargin==3 & size(index,2)~=3),
++	error('GetAreas error message: index should have 3 columns for 2d meshes.')
++end
++if (nargin==4 & size(index,2)~=6),
++	error('GetAreas error message: index should have 6 columns for 3d meshes.')
++end
++
++%initialization
++areas=zeros(nels,1);
++x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
++y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
++
++%compute the volume of each element
++if nargin==3,
++	%compute the surface of the triangle
++	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
++else
++	%V=area(triangle)*1/3(z1+z2+z3)
++	thickness=mean(z(index(:,4:6)),2)-mean(z(index(:,1:3)),2);
++	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1))).*thickness;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshread.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshread.m	(revision 13012)
+@@ -1,41 +0,0 @@
+-function Struct=meshread(filename);
+-
+-%some checks
+-if ~exist(filename),
+-	error(['meshread error message: file ' filename ' not found!']);
+-end
+-
+-fid=fopen(filename,'r');
+-
+-while (~feof(fid)),
+-
+-	A=fscanf(fid,'%s',1);
+-
+-	if strcmp(A,'MeshVersionFormatted');
+-		Struct.Version=fscanf(fid,'%s',1);
+-
+-	elseif strcmp(A,'Dimension'),
+-		Struct.Dimension=fscanf(fid,'%i',1);
+-
+-	elseif strcmp(A,'Vertices'),
+-		Struct.nods=fscanf(fid,'%i',1);
+-		A=fscanf(fid,'%f %f %f',[3 Struct.nods]);
+-		Struct.x=A(1,:)';
+-		Struct.y=A(2,:)';
+-
+-	elseif strcmp(A,'Triangles'),
+-		Struct.nels=fscanf(fid,'%i',1);
+-		A=fscanf(fid,'%i %i %i',[4 Struct.nels]);
+-		Struct.index=A(1:3,:)';
+-
+-	elseif strcmp(A,'Quadrilaterals'),
+-		Struct.nels=fscanf(fid,'%i',1);
+-		A=fscanf(fid,'%i %i %i %i',[5 Struct.nels]);
+-		Struct.index=A(1:4,:)';
+-	else
+-		%do nothing
+-
+-	end
+-end
+-
+-fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCallFromMetric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCallFromMetric.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCallFromMetric.m	(revision 13012)
+@@ -1,65 +0,0 @@
+-function md=BamgCallFromMetric(md,metric,gradation),
+-%BAMGCALL - call bam
+-%
+-%   call Bamg and the output mesh is plugged onto the model
+-%   -gradation = maximum edge length gradation between 2 elements
+-%
+-%   Usage:
+-%      md=BamgCallFromMetric(md,metric,gradation);
+-%
+-%   Example:
+-%      md=BamgCall(md,metric,1500,10^8,1.3,0.9);
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%write files
+-t1=clock; fprintf('%s','      writing initial mesh files...');
+-fid=fopen('carre0.met','w');
+-fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
+-fprintf(fid,'%i %i %i\n',metric');
+-fclose(fid);
+-
+-fid=fopen('carre0.mesh','w');
+-
+-%initialiation
+-fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
+-
+-%dimension
+-fprintf(fid,'\n%s\n%i\n','Dimension',2);
+-
+-%Vertices
+-fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
+-fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
+-
+-%Triangles
+-fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
+-fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
+-numberofelements1=md.mesh.numberofelements;
+-
+-%close
+-fclose(fid);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%call bamg
+-fprintf('%s\n','      call Bamg...');
+-system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
+-
+-%plug new mesh
+-t1=clock; fprintf('\n%s','      reading final mesh files...');
+-A=meshread('carre1.mesh');
+-md.mesh.x=A.x;
+-md.mesh.y=A.y;
+-md.z=zeros(A.nods,1);
+-md.mesh.elements=A.index;
+-md.mesh.numberofvertices=A.nods;
+-md.mesh.numberofelements=A.nels;
+-numberofelements2=md.mesh.numberofelements;
+-t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%display number of elements
+-fprintf('\n%s %i','      inital number of elements:',numberofelements1);
+-fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
+-
+-%clean up:
+-system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetCharacteristicLength.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetCharacteristicLength.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetCharacteristicLength.m	(revision 13012)
+@@ -1,45 +0,0 @@
+-function length=GetCharacteristicLength(index,x,y,varargin)
+-%GETCHARACTERISTICLENGTH - compute characteristic length for a mesh
+-%
+-%   compute characteristic lengths of every element of a mesh.
+-%
+-%   Usage:
+-%      length  =GetCharacteristicLength(index,x,y);
+-%      length  =GetCharacteristicLength(index,x,y,z);
+-%
+-%   Examples:
+-%      length  =GetCharacteristicLength(md.mesh.elements,md.mesh.x,md.mesh.y);
+-%      length  =GetCharacteristicLength(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
+-
+-
+-%get number of elements and number of nodes
+-nels=size(index,1);
+-nods=numel(x);
+-
+-%some checks
+-if nargout~=1 | (nargin~=3 & nargin~=4),
+-	help GetCharacteristicLength
+-	error('GetCharacteristicLength error message: bad usage')
+-end
+-if ((numel(y)~=nods) | (nargin==4 & numel(z)~=nods)),
+-	error('GetCharacteristicLength error message: x,y and z do not have the same length')
+-end
+-if max(index(:))>nods,
+-	error(['GetCharacteristicLength error message: index should not have values above ' num2str(nods) ])
+-end
+-if (nargin==3 & size(index,2)~=3),
+-	error('GetCharacteristicLength error message: index should have 3 columns for 2d meshes.')
+-end
+-if (nargin==4 & size(index,2)~=6),
+-	error('GetCharacteristicLength error message: index should have 6 columns for 3d meshes.')
+-end
+-
+-%get areas or volumes.
+-areas=GetAreas(index,x,y,varargin{:});
+-
+-%for a 2d mesh: 
+-if nargin==3,
+-	length=sqrt(2*areas);
+-else
+-	error('not supported yet');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetAreas.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetAreas.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/GetAreas.m	(revision 13012)
+@@ -1,51 +0,0 @@
+-function areas=GetAreas(index,x,y,varargin)
+-%GETAREAS - compute areas or volumes of elements
+-%
+-%   compute areas of triangular elements or volumes 
+-%   of pentahedrons
+-%
+-%   Usage:
+-%      areas  =GetAreas(index,x,y);
+-%      volumes=GetAreas(index,x,y,z);
+-%
+-%   Examples:
+-%      areas  =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
+-%      volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
+-
+-%get number of elements and number of nodes
+-nels=size(index,1);
+-nods=length(x);
+-if nargin==4, z=varargin{1}; end
+-
+-%some checks
+-if nargout~=1 | (nargin~=3 & nargin~=4),
+-	help GetAreas
+-	error('GetAreas error message: bad usage')
+-end
+-if ((length(y)~=nods) | (nargin==4 & length(z)~=nods)),
+-	error('GetAreas error message: x,y and z do not have the same length')
+-end
+-if max(index(:))>nods,
+-	error(['GetAreas error message: index should not have values above ' num2str(nods) ])
+-end
+-if (nargin==3 & size(index,2)~=3),
+-	error('GetAreas error message: index should have 3 columns for 2d meshes.')
+-end
+-if (nargin==4 & size(index,2)~=6),
+-	error('GetAreas error message: index should have 6 columns for 3d meshes.')
+-end
+-
+-%initialization
+-areas=zeros(nels,1);
+-x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
+-y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
+-
+-%compute the volume of each element
+-if nargin==3,
+-	%compute the surface of the triangle
+-	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
+-else
+-	%V=area(triangle)*1/3(z1+z2+z3)
+-	thickness=mean(z(index(:,4:6)),2)-mean(z(index(:,1:3)),2);
+-	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1))).*thickness;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/isconnected.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/isconnected.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/isconnected.m	(revision 13012)
+@@ -1,13 +0,0 @@
+-function flag=isconnected(elements,A,B)
+-%ISCONNECTED: are two nodes connected by a triangulation?
+-%
+-%   Usage: flag=isconnected(elements,A,B)
+-%
+-%
+-
+-elements=ElementsFromEdge(elements,A,B);
+-if isempty(elements),
+-	flag=0;
+-else
+-	flag=1;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCall.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/BamgCall.m	(revision 13012)
+@@ -1,84 +0,0 @@
+-function md=BamgCall(md,field,hmin,hmax,gradation,epsilon),
+-%BAMGCALL - call bam
+-%
+-%   build a metric using the Hessian of the given field
+-%   call Bamg and the output mesh is plugged onto the model
+-%   -hmin = minimum edge length (m)
+-%   -hmax = maximum edge length (m)
+-%   -gradation = maximum edge length gradation between 2 elements
+-%   -epsilon = average error on each element (m/yr)
+-%
+-%   Usage:
+-%      md=BamgCall(md,field,hmin,hmax,gradation,epsilon);
+-%
+-%   Example:
+-%      md=BamgCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%Compute Hessian
+-t1=clock; fprintf('%s','      computing Hessian...');
+-hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%Compute metric
+-t1=clock; fprintf('%s','      computing metric...');
+-if length(md.nodeonwater)==md.mesh.numberofvertices,
+-	pos=find(md.nodeonwater);
+-else
+-	pos=[];
+-end
+-metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%write files
+-t1=clock; fprintf('%s','      writing initial mesh files...');
+-fid=fopen('carre0.met','w');
+-fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
+-fprintf(fid,'%i %i %i\n',metric');
+-fclose(fid);
+-
+-fid=fopen('carre0.mesh','w');
+-
+-%initialiation
+-fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
+-
+-%dimension
+-fprintf(fid,'\n%s\n%i\n','Dimension',2);
+-
+-%Vertices
+-fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
+-fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
+-
+-%Triangles
+-fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
+-fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
+-numberofelements1=md.mesh.numberofelements;
+-
+-%close
+-fclose(fid);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%call bamg
+-fprintf('%s\n','      call Bamg...');
+-system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
+-
+-%plug new mesh
+-t1=clock; fprintf('\n%s','      reading final mesh files...');
+-A=meshread('carre1.mesh');
+-md.mesh.x=A.x;
+-md.mesh.y=A.y;
+-md.z=zeros(A.nods,1);
+-md.mesh.elements=A.index;
+-md.mesh.numberofvertices=A.nods;
+-md.mesh.numberofelements=A.nels;
+-numberofelements2=md.mesh.numberofelements;
+-t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%display number of elements
+-fprintf('\n%s %i','      inital number of elements:',numberofelements1);
+-fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
+-
+-%clean up:
+-system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/YamsCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/YamsCall.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/YamsCall.m	(revision 13012)
+@@ -1,104 +0,0 @@
+-function md=YamsCall(md,field,hmin,hmax,gradation,epsilon),
+-%YAMSCALL - call yams
+-%
+-%   build a metric using the Hessian of the given field
+-%   call Yams and the output mesh is plugged onto the model
+-%   -hmin = minimum edge length (m)
+-%   -hmax = maximum edge length (m)
+-%   -gradation = maximum edge length gradation between 2 elements
+-%   -epsilon = average error on each element (m/yr)
+-%
+-%   Usage:
+-%      md=YamsCall(md,field,hmin,hmax,gradation,epsilon);
+-%
+-%   Example:
+-%      md=YamsCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
+-
+-%2d geometric parameter (do not change)
+-scale=2/9; 
+-
+-%Compute Hessian
+-t1=clock; fprintf('%s','      computing Hessian...');
+-hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%Compute metric
+-t1=clock; fprintf('%s','      computing metric...');
+-if length(md.mask.vertexonwater)==md.mesh.numberofvertices,
+-	pos=find(md.mask.vertexonwater);
+-else
+-	pos=[];
+-end
+-metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%write files
+-t1=clock; fprintf('%s','      writing initial mesh files...');
+-save -ascii carre0.met  metric
+-
+-fid=fopen('carre0.mesh','w');
+-
+-%initialiation
+-fprintf(fid,'\n%s\n%i\n','MeshVersionFormatted',1);
+-
+-%dimension
+-fprintf(fid,'\n%s\n%i\n','Dimension',2);
+-
+-%Vertices
+-fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
+-fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y zeros(md.mesh.numberofvertices,1)]');
+-
+-%Triangles
+-fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
+-fprintf(fid,'%i %i %i %i\n',[md.mesh.elements zeros(md.mesh.numberofelements,1)]');
+-numberofelements1=md.mesh.numberofelements;
+-	
+-%Deal with rifts
+-if ~isnan(md.rifts.riftstruct),
+-	
+-	%we have the list of triangles that make up the rift. keep those triangles around during refinement.
+-	triangles=[];
+-	for i=1:size(md.rifts.riftstruct,1),
+-		triangles=[triangles md.rifts(i).segments(:,3)'];
+-	end
+-
+-	fprintf(fid,'\n\n%s\n%i\n\n','RequiredTriangles',length(triangles));
+-	fprintf(fid,'%i\n',triangles);
+-end
+-
+-%close
+-fclose(fid);
+-t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%call yams
+-fprintf('%s\n','      call Yams...');
+-if ispc
+-	%windows
+-	system(['yams2-win -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
+-elseif ismac
+-	%Macosx
+-	system(['yams2-osx -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
+-else
+-	%Linux
+-	system(['yams2-linux -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
+-end
+-
+-%plug new mesh
+-t1=clock; fprintf('\n%s','      reading final mesh files...');
+-Tria=load('carre1.tria');
+-Coor=load('carre1.coor');
+-md.mesh.x=Coor(:,1);
+-md.mesh.y=Coor(:,2);
+-md.mesh.z=zeros(size(Coor,1),1);
+-md.mesh.elements=Tria;
+-md.mesh.numberofvertices=size(Coor,1);
+-md.mesh.numberofelements=size(Tria,1);
+-numberofelements2=md.mesh.numberofelements;
+-t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
+-
+-%display number of elements
+-fprintf('\n%s %i','      inital number of elements:',numberofelements1);
+-fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
+-
+-%clean up:
+-system('rm carre0.mesh carre0.met carre1.tria carre1.coor carre1.meshb');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/yams.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/yams.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/yams.m	(revision 13012)
+@@ -1,171 +0,0 @@
+-function md=yams(md,varargin);
+-%MESHYAMS - Build model of Antarctica by refining according to observed velocity error estimator
+-%
+-%   Usage:
+-%      md=yams(md,varargin);
+-%      where varargin is a lit of paired arguments. 
+-%      arguments can be: 'domainoutline': Argus file containing the outline of the domain to be meshed
+-%      arguments can be: 'velocities': matlab file containing the velocities [m/yr]
+-%      optional arguments: 'groundeddomain': Argus file containing the outline of the grounded ice
+-%                          this option is used to minimize the metric on water (no refinement)
+-%      optional arguments: 'resolution': initial mesh resolution [m]
+-%      optional arguments: 'nsteps': number of steps of mesh adaptation
+-%      optional arguments: 'epsilon': average interpolation error wished [m/yr]
+-%      optional arguments: 'hmin': minimum edge length
+-%      optional arguments: 'hmanx': maximum edge
+-%      optional arguments: 'riftoutline': if rifts are present, specifies rift outline file.
+-%      
+-%
+-%   Examples:
+-%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat');
+-%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat','groundeddomain','ground.exp');
+-%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat','groundeddomain','ground.exp','nsteps',6,'epsilon',2,'hmin',500,'hmax',30000);
+-
+-%recover options
+-options=pairoptions(varargin{:});
+-options=deleteduplicates(options,1);
+-
+-%recover some fields
+-disp('MeshYams Options:')
+-domainoutline=getfieldvalue(options,'domainoutline');
+-disp(sprintf('   %-15s: ''%s''','DomainOutline',domainoutline));
+-riftoutline=getfieldvalue(options,'riftoutline','N/A');
+-disp(sprintf('   %-15s: ''%s''','riftoutline',riftoutline));
+-groundeddomain=getfieldvalue(options,'groundeddomain','N/A');
+-disp(sprintf('   %-15s: ''%s''','GroundedDomain',groundeddomain));
+-velocities=getfieldvalue(options,'velocities');
+-disp(sprintf('   %-15s: ''%s''','Velocities',velocities));
+-resolution=getfieldvalue(options,'resolution',5000);
+-disp(sprintf('   %-15s: %f','Resolution',resolution));
+-nsteps=getfieldvalue(options,'nsteps',6);
+-disp(sprintf('   %-15s: %i','nsteps',nsteps));
+-gradation=getfieldvalue(options,'gradation',2*ones(nsteps,1));
+-disp(sprintf('   %-15s: %g','gradation',gradation(1)));
+-epsilon=getfieldvalue(options,'epsilon',3);
+-disp(sprintf('   %-15s: %f','epsilon',epsilon));
+-hmin=getfieldvalue(options,'hmin',500);
+-disp(sprintf('   %-15s: %f','hmin',hmin));
+-hmax=getfieldvalue(options,'hmax',150*10^3);
+-disp(sprintf('   %-15s: %f\n','hmax',hmax));
+-
+-%mesh with initial resolution
+-disp('Initial mesh generation...');
+-if strcmpi(riftoutline,'N/A');
+-	md=setmesh(md,domainoutline,resolution);
+-else
+-	md=setmesh(md,domainoutline,riftoutline,resolution);
+-	md=meshprocessrifts(md,domainoutline);
+-end
+-disp(['Initial mesh, number of elements: ' num2str(md.mesh.numberofelements)]);
+-
+-%load velocities 
+-disp('loading velocities...');
+-Names=VelFindVarNames(velocities);
+-Vel=load(velocities);
+-
+-%start mesh adaptation
+-for i=1:nsteps,
+-	disp(['Iteration #' num2str(i) '/' num2str(nsteps)]);
+-
+-	%interpolate velocities onto mesh
+-	disp('   interpolating velocities...');
+-	if strcmpi(Names.interp,'node'),
+-		vx_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
+-		vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
+-	else
+-		vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
+-		vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
+-	end
+-	field=sqrt(vx_obs.^2+vy_obs.^2);
+-
+-	%set mask.vertexonwater  field
+-	if ~strcmp(groundeddomain,'N/A'),
+-		nodeground=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,groundeddomain,'node',2);
+-		md.mask.vertexonwater=ones(md.mesh.numberofvertices,1);
+-		md.mask.vertexonwater(find(nodeground))=0;
+-	else
+-		md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
+-	end
+-
+-	%adapt according to velocities
+-	disp('   adapting...');
+-	md=YamsCall(md,field,hmin,hmax,gradation(i),epsilon);
+-
+-	%if we have rifts, we just messed them up, we need to recreate the segments that constitute those 
+-	%rifts, because the segments are used in YamsCall to freeze the rifts elements during refinement.
+-	if md.rifts.numrifts, 
+-		md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-		md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-		md.mesh.segments=findsegments(md);
+-		md=yamsrecreateriftsegments(md);
+-	end
+-
+-end
+-	
+-disp(['Final mesh, number of elements: ' num2str(md.mesh.numberofelements)]);
+-
+-%Now, build the connectivity tables for this mesh.
+-md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-
+-%recreate segments
+-md.mesh.segments=findsegments(md);
+-md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+-
+-%Fill in rest of fields:
+-md.mesh.z=zeros(md.mesh.numberofvertices,1);
+-md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
+-md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+-if ~strcmp(groundeddomain,'N/A'),
+-	nodeground=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,groundeddomain,'node',2);
+-	md.mask.vertexonwater=ones(md.mesh.numberofvertices,1);
+-	md.mask.vertexonwater(find(nodeground))=0;
+-else
+-	md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
+-end
+-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);
+-else
+-	md.inversion.vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
+-	md.inversion.vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
+-end
+-md.inversion.vel_obs=sqrt(md.inversion.vx_obs.^2+md.inversion.vy_obs.^2);
+-
+-%deal with rifts 
+-if md.rifts.numrifts,
+-	%first, recreate rift segments
+-	md=meshyamsrecreateriftsegments(md);
+-
+-	%using the segments, recreate the penaltypairs
+-	for j=1:md.rifts.numrifts,
+-		rift=md.rifts.riftstruct(j);
+-
+-		%build normals and lengths of segments:
+-		lengths=sqrt((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))).^2 + (md.mesh.y(rift.segments(:,1))-md.mesh.y(rift.segments(:,2))).^2 );
+-		normalsx=cos(atan2((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))) , (md.mesh.y(rift.segments(:,2))-md.mesh.y(rift.segments(:,1)))));
+-		normalsy=sin(atan2((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))) , (md.mesh.y(rift.segments(:,2))-md.mesh.y(rift.segments(:,1)))));
+-
+-		%ok, build penaltypairs: 
+-		numpenaltypairs=length(rift.segments)/2-1;
+-		rift.penaltypairs=zeros(numpenaltypairs,7);
+-
+-		for i=1:numpenaltypairs,
+-			rift.penaltypairs(i,1)=rift.segments(i,2);
+-			rift.penaltypairs(i,2)=rift.segments(end-i,2);
+-			rift.penaltypairs(i,3)=rift.segments(i,3);
+-			rift.penaltypairs(i,4)=rift.segments(end-i,3);
+-			rift.penaltypairs(i,5)=normalsx(i)+normalsx(i+1);
+-			rift.penaltypairs(i,6)=normalsy(i)+normalsy(i+1);
+-			rift.penaltypairs(i,7)=(lengths(i)+lengths(i+1))/2;
+-		end
+-		%renormalize norms: 
+-		norms=sqrt(rift.penaltypairs(:,5).^2+rift.penaltypairs(:,6).^2);
+-		rift.penaltypairs(:,5)=rift.penaltypairs(:,5)./norms;
+-		rift.penaltypairs(:,6)=rift.penaltypairs(:,6)./norms;
+-
+-		md.rifts.riftstruct(j)=rift;
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifttipsonmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifttipsonmesh.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifttipsonmesh.m	(revision 13012)
+@@ -1,26 +0,0 @@
+-function tips=rifttipsonmesh(md,riftoutline)
+-%RIFTTIPSONMESH: identify, using a rift outline, the nodes that are tips of 
+-%                rifts.
+-
+-%read rifts from outline file
+-rifts=expread(riftoutline,1);
+-
+-tips=[];
+-
+-for i=1:length(rifts),
+-	rift=rifts(i);
+-
+-	x_tip=rift.x(1);
+-	y_tip=rift.y(1);
+-	
+-	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
+-	tips(end+1)=index;
+-
+-	x_tip=rift.x(end);
+-	y_tip=rift.y(end);
+-	
+-	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
+-	tips(end+1)=index;
+-
+-end
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/NodeInElement.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/NodeInElement.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/NodeInElement.m	(revision 13012)
+@@ -1,7 +1,8 @@
+ function node_in_element=NodeInElement(newx,newy,elements,x,y,nodeconnectivity);
+-%NODEINELEMENT: find for a list of nodes (in newx,newy), which elements in the mesh (elements,x,y) they belong to.
++% NODEINELEMENT - find for a list of nodes (in newx,newy), which elements in the mesh (elements,x,y) they belong to.
+ %
+-%  Usage: node_in_element=NodeInElement(newx,newy,elements,x,y,md.mesh.vertexconnectivity);
++%    Usage:
++%      node_in_element=NodeInElement(newx,newy,elements,x,y,md.mesh.vertexconnectivity);
+ %
+ %  See also Nodeconnectivity
+ %
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/rifttipsonmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/rifttipsonmesh.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/rifttipsonmesh.m	(revision 13012)
+@@ -0,0 +1,26 @@
++function tips=rifttipsonmesh(md,riftoutline)
++%RIFTTIPSONMESH: identify, using a rift outline, the nodes that are tips of 
++%                rifts.
++
++%read rifts from outline file
++rifts=expread(riftoutline,1);
++
++tips=[];
++
++for i=1:length(rifts),
++	rift=rifts(i);
++
++	x_tip=rift.x(1);
++	y_tip=rift.y(1);
++	
++	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
++	tips(end+1)=index;
++
++	x_tip=rift.x(end);
++	y_tip=rift.y(end);
++	
++	index=find_point(md.mesh.x,md.mesh.y,x_tip,y_tip);
++	tips(end+1)=index;
++
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshprocessoutsiderifts.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshprocessoutsiderifts.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/rifts/meshprocessoutsiderifts.m	(revision 13012)
+@@ -92,3 +92,19 @@
+ md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+ md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
+ md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
++end
++
++function flag=isconnected(elements,A,B)% {{{
++	%ISCONNECTED: are two nodes connected by a triangulation?
++	%
++	%   Usage: flag=isconnected(elements,A,B)
++	%
++	%
++
++	elements=ElementsFromEdge(elements,A,B);
++	if isempty(elements),
++		flag=0;
++	else
++		flag=1;
++	end
++end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/FixMesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/FixMesh.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/FixMesh.m	(revision 13012)
+@@ -1,11 +1,11 @@
+ function  [index2 x2 y2 value2]=FixMesh(index,x,y,value)
+-%FixMesh fix mesh with broken triangles, orphan vertices, etc ...
++% FIXMESH - FixMesh fix mesh with broken triangles, orphan vertices, etc ...
+ %
+-% Usage: 
+-%            [index2 x2 y2 value2]=FixMesh(index,x,y,value)
+-%            where index,x,y is a delaunay triangulation, 
+-%                  value is a field on the input triangulation, with values at the vertices
+-%                  index2,x2,y2,value2 is the repaired triangulation, with new values on new vertices
++%   Usage: 
++%      [index2 x2 y2 value2]=FixMesh(index,x,y,value)
++%      where index,x,y is a delaunay triangulation, 
++%      value is a field on the input triangulation, with values at the vertices
++%      index2,x2,y2,value2 is the repaired triangulation, with new values on new vertices
+ %
+ %
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/modellist.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/modellist.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/modellist.m	(revision 13012)
+@@ -291,3 +291,97 @@
+ 		end % }}}
+ 	end
+ end
++
++function BuildMultipleQueueingScript(cluster,name,executionpath,codepath)% {{{
++%BUILDMULTIPLEQUEUEINGSCRIPT - 
++%
++%   Usage:
++%      BuildMultipleQueueingScript(executionpath,codepath)
++
++disp('building queueing script');
++
++%First try and figure out if there is a special script for this particular cluster
++function_name=['BuildMultipleQueueingScript' cluster];
++
++%some specific treatment of identical cluster, gemini, castor and pollux
++if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
++	function_name='BuildMultipleQueueingScriptgemini';
++end
++
++if exist(function_name,'file'),
++	%Call this function:
++	eval([function_name '(name,executionpath,codepath);']);
++else
++	%Call the generic BuildQueueingScript:
++	BuildMultipleQueueingScriptGeneric(name,executionpath,codepath);
++end
++end % }}}
++function BuildQueueingScriptgemini(name,executionpath,codepath)% {{{
++%BUILDQUEUEINGSCRIPTGEMINI - ...
++%
++%   Usage:
++%      BuildQueueingScriptgemini(md,executionpath,codepath)
++
++scriptname=[name '.queue'];
++
++fid=fopen(scriptname,'w');
++if fid==-1,
++	error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']);
++end
++
++fprintf(fid,'#!/bin/sh\n');
++fprintf(fid,'cd %s\n',executionpath);
++fprintf(fid,'mkdir %s\n',name);
++fprintf(fid,'cd %s\n',name);
++fprintf(fid,'mv ../ModelList.tar.gz ./\n');
++fprintf(fid,'tar -zxvf ModelList.tar.gz\n');
++fprintf(fid,'foreach i (%s-*vs*.queue)\n',name);
++fprintf(fid,'qsub $i\n');
++fprintf(fid,'end\n');
++fclose(fid);
++end% }}}
++function LaunchMultipleQueueJob(cluster,name,executionpath)% {{{
++%LAUNCHMULTIPLEQUEUEJOB - ...
++%
++%   Usage:
++%      LaunchMultipleQueueJob(executionpath)
++
++%First try and figure out if there is a special script for thie particular cluster
++function_name=['LaunchMultipleQueueJob' cluster];
++
++%some specific treatment of identical cluster, gemini, castor and pollux
++if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
++	function_name='LaunchMultipleQueueJobgemini';
++end
++
++if exist(function_name,'file'),
++	%Call this function:
++	eval([function_name '(cluster,name,executionpath);']);
++else
++	%Call the generic LaunchMultipleQueueJob:
++	LaunchMultipleQueueJobGeneric(cluster,name,executionpath);
++end
++end% }}}
++function md=LaunchMultipleQueueJobgemini(cluster,name,executionpath)% {{{
++%LAUNCHMULTIPLEQUEUEJOBGEMINI - Launch multiple queueing script on Gemini cluster
++%
++%   Usage:
++%      LaunchMultipleQueueJobgemini(cluster,name,executionpath)
++
++
++%first, check we have the binary file and the queueing script
++if ~exist([ name '.queue'],'file'),
++	error('LaunchMultipleQueueJobgemini error message: queueing script issing, cannot go forward');
++end
++
++if ~exist('ModelList.tar.gz','file'),
++	error('LaunchMultipleQueueJobgemini error message: inputs models file missing, cannot go forward');
++end
++
++%upload both files to cluster
++disp('uploading input file,  queueing script and variables script');
++eval(['!scp ModelList.tar.gz ' name '.queue '  cluster ':' executionpath]);
++
++disp('launching solution sequence on remote cluster');
++issmssh(cluster,login,['"cd ' executionpath ' && source ' name '.queue "']);
++end% }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/YamsCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/YamsCall.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/YamsCall.m	(revision 13012)
+@@ -0,0 +1,104 @@
++function md=YamsCall(md,field,hmin,hmax,gradation,epsilon),
++%YAMSCALL - call yams
++%
++%   build a metric using the Hessian of the given field
++%   call Yams and the output mesh is plugged onto the model
++%   -hmin = minimum edge length (m)
++%   -hmax = maximum edge length (m)
++%   -gradation = maximum edge length gradation between 2 elements
++%   -epsilon = average error on each element (m/yr)
++%
++%   Usage:
++%      md=YamsCall(md,field,hmin,hmax,gradation,epsilon);
++%
++%   Example:
++%      md=YamsCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%Compute Hessian
++t1=clock; fprintf('%s','      computing Hessian...');
++hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%Compute metric
++t1=clock; fprintf('%s','      computing metric...');
++if length(md.mask.vertexonwater)==md.mesh.numberofvertices,
++	pos=find(md.mask.vertexonwater);
++else
++	pos=[];
++end
++metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%write files
++t1=clock; fprintf('%s','      writing initial mesh files...');
++save -ascii carre0.met  metric
++
++fid=fopen('carre0.mesh','w');
++
++%initialiation
++fprintf(fid,'\n%s\n%i\n','MeshVersionFormatted',1);
++
++%dimension
++fprintf(fid,'\n%s\n%i\n','Dimension',2);
++
++%Vertices
++fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
++fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y zeros(md.mesh.numberofvertices,1)]');
++
++%Triangles
++fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
++fprintf(fid,'%i %i %i %i\n',[md.mesh.elements zeros(md.mesh.numberofelements,1)]');
++numberofelements1=md.mesh.numberofelements;
++	
++%Deal with rifts
++if ~isnan(md.rifts.riftstruct),
++	
++	%we have the list of triangles that make up the rift. keep those triangles around during refinement.
++	triangles=[];
++	for i=1:size(md.rifts.riftstruct,1),
++		triangles=[triangles md.rifts(i).segments(:,3)'];
++	end
++
++	fprintf(fid,'\n\n%s\n%i\n\n','RequiredTriangles',length(triangles));
++	fprintf(fid,'%i\n',triangles);
++end
++
++%close
++fclose(fid);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%call yams
++fprintf('%s\n','      call Yams...');
++if ispc
++	%windows
++	system(['yams2-win -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
++elseif ismac
++	%Macosx
++	system(['yams2-osx -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
++else
++	%Linux
++	system(['yams2-linux -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
++end
++
++%plug new mesh
++t1=clock; fprintf('\n%s','      reading final mesh files...');
++Tria=load('carre1.tria');
++Coor=load('carre1.coor');
++md.mesh.x=Coor(:,1);
++md.mesh.y=Coor(:,2);
++md.mesh.z=zeros(size(Coor,1),1);
++md.mesh.elements=Tria;
++md.mesh.numberofvertices=size(Coor,1);
++md.mesh.numberofelements=size(Tria,1);
++numberofelements2=md.mesh.numberofelements;
++t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%display number of elements
++fprintf('\n%s %i','      inital number of elements:',numberofelements1);
++fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
++
++%clean up:
++system('rm carre0.mesh carre0.met carre1.tria carre1.coor carre1.meshb');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/meshread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/meshread.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/meshread.m	(revision 13012)
+@@ -0,0 +1,41 @@
++function Struct=meshread(filename);
++
++%some checks
++if ~exist(filename),
++	error(['meshread error message: file ' filename ' not found!']);
++end
++
++fid=fopen(filename,'r');
++
++while (~feof(fid)),
++
++	A=fscanf(fid,'%s',1);
++
++	if strcmp(A,'MeshVersionFormatted');
++		Struct.Version=fscanf(fid,'%s',1);
++
++	elseif strcmp(A,'Dimension'),
++		Struct.Dimension=fscanf(fid,'%i',1);
++
++	elseif strcmp(A,'Vertices'),
++		Struct.nods=fscanf(fid,'%i',1);
++		A=fscanf(fid,'%f %f %f',[3 Struct.nods]);
++		Struct.x=A(1,:)';
++		Struct.y=A(2,:)';
++
++	elseif strcmp(A,'Triangles'),
++		Struct.nels=fscanf(fid,'%i',1);
++		A=fscanf(fid,'%i %i %i',[4 Struct.nels]);
++		Struct.index=A(1:3,:)';
++
++	elseif strcmp(A,'Quadrilaterals'),
++		Struct.nels=fscanf(fid,'%i',1);
++		A=fscanf(fid,'%i %i %i %i',[5 Struct.nels]);
++		Struct.index=A(1:4,:)';
++	else
++		%do nothing
++
++	end
++end
++
++fclose(fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/yams.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/yams.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/yams.m	(revision 13012)
+@@ -0,0 +1,171 @@
++function md=yams(md,varargin);
++%MESHYAMS - Build model of Antarctica by refining according to observed velocity error estimator
++%
++%   Usage:
++%      md=yams(md,varargin);
++%      where varargin is a lit of paired arguments. 
++%      arguments can be: 'domainoutline': Argus file containing the outline of the domain to be meshed
++%      arguments can be: 'velocities': matlab file containing the velocities [m/yr]
++%      optional arguments: 'groundeddomain': Argus file containing the outline of the grounded ice
++%                          this option is used to minimize the metric on water (no refinement)
++%      optional arguments: 'resolution': initial mesh resolution [m]
++%      optional arguments: 'nsteps': number of steps of mesh adaptation
++%      optional arguments: 'epsilon': average interpolation error wished [m/yr]
++%      optional arguments: 'hmin': minimum edge length
++%      optional arguments: 'hmanx': maximum edge
++%      optional arguments: 'riftoutline': if rifts are present, specifies rift outline file.
++%      
++%
++%   Examples:
++%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat');
++%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat','groundeddomain','ground.exp');
++%      md=yams(md,'domainoutline','Domain.exp','velocities','vel.mat','groundeddomain','ground.exp','nsteps',6,'epsilon',2,'hmin',500,'hmax',30000);
++
++%recover options
++options=pairoptions(varargin{:});
++options=deleteduplicates(options,1);
++
++%recover some fields
++disp('MeshYams Options:')
++domainoutline=getfieldvalue(options,'domainoutline');
++disp(sprintf('   %-15s: ''%s''','DomainOutline',domainoutline));
++riftoutline=getfieldvalue(options,'riftoutline','N/A');
++disp(sprintf('   %-15s: ''%s''','riftoutline',riftoutline));
++groundeddomain=getfieldvalue(options,'groundeddomain','N/A');
++disp(sprintf('   %-15s: ''%s''','GroundedDomain',groundeddomain));
++velocities=getfieldvalue(options,'velocities');
++disp(sprintf('   %-15s: ''%s''','Velocities',velocities));
++resolution=getfieldvalue(options,'resolution',5000);
++disp(sprintf('   %-15s: %f','Resolution',resolution));
++nsteps=getfieldvalue(options,'nsteps',6);
++disp(sprintf('   %-15s: %i','nsteps',nsteps));
++gradation=getfieldvalue(options,'gradation',2*ones(nsteps,1));
++disp(sprintf('   %-15s: %g','gradation',gradation(1)));
++epsilon=getfieldvalue(options,'epsilon',3);
++disp(sprintf('   %-15s: %f','epsilon',epsilon));
++hmin=getfieldvalue(options,'hmin',500);
++disp(sprintf('   %-15s: %f','hmin',hmin));
++hmax=getfieldvalue(options,'hmax',150*10^3);
++disp(sprintf('   %-15s: %f\n','hmax',hmax));
++
++%mesh with initial resolution
++disp('Initial mesh generation...');
++if strcmpi(riftoutline,'N/A');
++	md=setmesh(md,domainoutline,resolution);
++else
++	md=setmesh(md,domainoutline,riftoutline,resolution);
++	md=meshprocessrifts(md,domainoutline);
++end
++disp(['Initial mesh, number of elements: ' num2str(md.mesh.numberofelements)]);
++
++%load velocities 
++disp('loading velocities...');
++Names=VelFindVarNames(velocities);
++Vel=load(velocities);
++
++%start mesh adaptation
++for i=1:nsteps,
++	disp(['Iteration #' num2str(i) '/' num2str(nsteps)]);
++
++	%interpolate velocities onto mesh
++	disp('   interpolating velocities...');
++	if strcmpi(Names.interp,'node'),
++		vx_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
++		vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
++	else
++		vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
++		vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
++	end
++	field=sqrt(vx_obs.^2+vy_obs.^2);
++
++	%set mask.vertexonwater  field
++	if ~strcmp(groundeddomain,'N/A'),
++		nodeground=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,groundeddomain,'node',2);
++		md.mask.vertexonwater=ones(md.mesh.numberofvertices,1);
++		md.mask.vertexonwater(find(nodeground))=0;
++	else
++		md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
++	end
++
++	%adapt according to velocities
++	disp('   adapting...');
++	md=YamsCall(md,field,hmin,hmax,gradation(i),epsilon);
++
++	%if we have rifts, we just messed them up, we need to recreate the segments that constitute those 
++	%rifts, because the segments are used in YamsCall to freeze the rifts elements during refinement.
++	if md.rifts.numrifts, 
++		md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++		md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++		md.mesh.segments=findsegments(md);
++		md=yamsrecreateriftsegments(md);
++	end
++
++end
++	
++disp(['Final mesh, number of elements: ' num2str(md.mesh.numberofelements)]);
++
++%Now, build the connectivity tables for this mesh.
++md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++
++%recreate segments
++md.mesh.segments=findsegments(md);
++md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
++
++%Fill in rest of fields:
++md.mesh.z=zeros(md.mesh.numberofvertices,1);
++md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
++md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
++md.mesh.elementonbed=ones(md.mesh.numberofelements,1);
++md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
++if ~strcmp(groundeddomain,'N/A'),
++	nodeground=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,groundeddomain,'node',2);
++	md.mask.vertexonwater=ones(md.mesh.numberofvertices,1);
++	md.mask.vertexonwater(find(nodeground))=0;
++else
++	md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
++end
++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);
++else
++	md.inversion.vx_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
++	md.inversion.vy_obs=InterpFromMeshToMesh2d(Vel.(Names.indexname),Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
++end
++md.inversion.vel_obs=sqrt(md.inversion.vx_obs.^2+md.inversion.vy_obs.^2);
++
++%deal with rifts 
++if md.rifts.numrifts,
++	%first, recreate rift segments
++	md=meshyamsrecreateriftsegments(md);
++
++	%using the segments, recreate the penaltypairs
++	for j=1:md.rifts.numrifts,
++		rift=md.rifts.riftstruct(j);
++
++		%build normals and lengths of segments:
++		lengths=sqrt((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))).^2 + (md.mesh.y(rift.segments(:,1))-md.mesh.y(rift.segments(:,2))).^2 );
++		normalsx=cos(atan2((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))) , (md.mesh.y(rift.segments(:,2))-md.mesh.y(rift.segments(:,1)))));
++		normalsy=sin(atan2((md.mesh.x(rift.segments(:,1))-md.mesh.x(rift.segments(:,2))) , (md.mesh.y(rift.segments(:,2))-md.mesh.y(rift.segments(:,1)))));
++
++		%ok, build penaltypairs: 
++		numpenaltypairs=length(rift.segments)/2-1;
++		rift.penaltypairs=zeros(numpenaltypairs,7);
++
++		for i=1:numpenaltypairs,
++			rift.penaltypairs(i,1)=rift.segments(i,2);
++			rift.penaltypairs(i,2)=rift.segments(end-i,2);
++			rift.penaltypairs(i,3)=rift.segments(i,3);
++			rift.penaltypairs(i,4)=rift.segments(end-i,3);
++			rift.penaltypairs(i,5)=normalsx(i)+normalsx(i+1);
++			rift.penaltypairs(i,6)=normalsy(i)+normalsy(i+1);
++			rift.penaltypairs(i,7)=(lengths(i)+lengths(i+1))/2;
++		end
++		%renormalize norms: 
++		norms=sqrt(rift.penaltypairs(:,5).^2+rift.penaltypairs(:,6).^2);
++		rift.penaltypairs(:,5)=rift.penaltypairs(:,5)./norms;
++		rift.penaltypairs(:,6)=rift.penaltypairs(:,6)./norms;
++
++		md.rifts.riftstruct(j)=rift;
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/BamgCallFromMetric.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/BamgCallFromMetric.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/BamgCallFromMetric.m	(revision 13012)
+@@ -0,0 +1,65 @@
++function md=BamgCallFromMetric(md,metric,gradation),
++%BAMGCALL - call bam
++%
++%   call Bamg and the output mesh is plugged onto the model
++%   -gradation = maximum edge length gradation between 2 elements
++%
++%   Usage:
++%      md=BamgCallFromMetric(md,metric,gradation);
++%
++%   Example:
++%      md=BamgCall(md,metric,1500,10^8,1.3,0.9);
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%write files
++t1=clock; fprintf('%s','      writing initial mesh files...');
++fid=fopen('carre0.met','w');
++fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
++fprintf(fid,'%i %i %i\n',metric');
++fclose(fid);
++
++fid=fopen('carre0.mesh','w');
++
++%initialiation
++fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
++
++%dimension
++fprintf(fid,'\n%s\n%i\n','Dimension',2);
++
++%Vertices
++fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
++fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
++
++%Triangles
++fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
++fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
++numberofelements1=md.mesh.numberofelements;
++
++%close
++fclose(fid);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%call bamg
++fprintf('%s\n','      call Bamg...');
++system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
++
++%plug new mesh
++t1=clock; fprintf('\n%s','      reading final mesh files...');
++A=meshread('carre1.mesh');
++md.mesh.x=A.x;
++md.mesh.y=A.y;
++md.z=zeros(A.nods,1);
++md.mesh.elements=A.index;
++md.mesh.numberofvertices=A.nods;
++md.mesh.numberofelements=A.nels;
++numberofelements2=md.mesh.numberofelements;
++t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%display number of elements
++fprintf('\n%s %i','      inital number of elements:',numberofelements1);
++fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
++
++%clean up:
++system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/BamgCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/BamgCall.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/BamgCall.m	(revision 13012)
+@@ -0,0 +1,84 @@
++function md=BamgCall(md,field,hmin,hmax,gradation,epsilon),
++%BAMGCALL - call bam
++%
++%   build a metric using the Hessian of the given field
++%   call Bamg and the output mesh is plugged onto the model
++%   -hmin = minimum edge length (m)
++%   -hmax = maximum edge length (m)
++%   -gradation = maximum edge length gradation between 2 elements
++%   -epsilon = average error on each element (m/yr)
++%
++%   Usage:
++%      md=BamgCall(md,field,hmin,hmax,gradation,epsilon);
++%
++%   Example:
++%      md=BamgCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
++
++%2d geometric parameter (do not change)
++scale=2/9; 
++
++%Compute Hessian
++t1=clock; fprintf('%s','      computing Hessian...');
++hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node');
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%Compute metric
++t1=clock; fprintf('%s','      computing metric...');
++if length(md.nodeonwater)==md.mesh.numberofvertices,
++	pos=find(md.nodeonwater);
++else
++	pos=[];
++end
++metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%write files
++t1=clock; fprintf('%s','      writing initial mesh files...');
++fid=fopen('carre0.met','w');
++fprintf(fid,'%i %i\n',md.mesh.numberofvertices,3);
++fprintf(fid,'%i %i %i\n',metric');
++fclose(fid);
++
++fid=fopen('carre0.mesh','w');
++
++%initialiation
++fprintf(fid,'%s %i\n','MeshVersionFormatted',0);
++
++%dimension
++fprintf(fid,'\n%s\n%i\n','Dimension',2);
++
++%Vertices
++fprintf(fid,'\n%s\n%i\n\n','Vertices',md.mesh.numberofvertices);
++fprintf(fid,'%8g %8g %i\n',[md.mesh.x md.mesh.y ones(md.mesh.numberofvertices,1)]');
++
++%Triangles
++fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
++fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
++numberofelements1=md.mesh.numberofelements;
++
++%close
++fclose(fid);
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%call bamg
++fprintf('%s\n','      call Bamg...');
++system(['bamg -ratio ' num2str(gradation) ' -splitpbedge -nbv 1000000 -M carre0.met -b carre0.mesh -o carre1.mesh']);
++
++%plug new mesh
++t1=clock; fprintf('\n%s','      reading final mesh files...');
++A=meshread('carre1.mesh');
++md.mesh.x=A.x;
++md.mesh.y=A.y;
++md.z=zeros(A.nods,1);
++md.mesh.elements=A.index;
++md.mesh.numberofvertices=A.nods;
++md.mesh.numberofelements=A.nels;
++numberofelements2=md.mesh.numberofelements;
++t2=clock;fprintf('%s\n\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%display number of elements
++fprintf('\n%s %i','      inital number of elements:',numberofelements1);
++fprintf('\n%s %i\n\n','      new    number of elements:',numberofelements2);
++
++%clean up:
++system('rm carre0.mesh carre0.met carre1.mesh carre1.mesh.gmsh');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/create_region.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/create_region.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/create_region.m	(revision 13012)
+@@ -1,15 +0,0 @@
+-function create_region(name)
+-%CREATE_REGION - create region  ????
+-%
+-%   very temporary function.
+-%   
+-%   Usage: 
+-%      create_region(name)
+-
+-eval(['mkdir ' name]);
+-eval(['cd ' name ]);
+-!mkdir Delivery Exp_Par Results
+-cd Exp_Par
+-!cp ../../RonneShelf/Exp_Par/* ./
+-!rm -rf Hole*
+-eval(['!mv Ronne.par ' name '.par']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/findarg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/findarg.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/findarg.m	(revision 13012)
+@@ -1,51 +0,0 @@
+-function  vals=findarg(arglist,field)
+-%FINDARG - find argument associated to a field in a list
+-%
+-%   This function parses through an argument list (typically varargin in a routine)
+-%   looking for a character array equal to field. Once this is found, we return the 
+-%   next value in the varargin (if possible). 
+-%   Because field might appear several times in the argument list, we return a structure 
+-%   holding all these values. 
+-%   Note that all comparisons to field value are case independent.
+-%
+-%   Usage:
+-%      vals=findarg(arglist,field)
+-%
+-%   Example:
+-%      routine foobar calls vals=findarg('Data',varargin)
+-%      with varargin='Data',1,'Data','foo','Plot','velocity','Arrow',4
+-%      findarg would return the following structure: vals(1).value=1, vals(2).value='foo'; 
+-
+-%some argument checking: 
+-if ((nargin==0) | (nargout==0)),
+-	help findarg;
+-	error('findarg error message');
+-end
+-
+-if ~ischar(field),
+-	error('findarg error message: field should be a string');
+-end
+-
+-if ~iscell(arglist),
+-	error('findarg error message: argument list should be a cell array.');
+-end
+-
+-%Recover data to plot
+-founddata=0;
+-
+-for i=1:(length(arglist)-1), %data in arglist comes in pairs, hence the -1.
+-	if ischar(arglist{i}),
+-		if (strcmpi(arglist{i},field)),
+-			founddata=founddata+1;
+-			if founddata==1,
+-				vals.value=arglist{i+1};
+-			else
+-				vals(end+1).value=arglist{i+1};
+-			end
+-		end
+-	end
+-end
+-
+-if founddata==0,
+-	vals=[];
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf.m	(revision 13012)
+@@ -1,136 +0,0 @@
+-function S = netcdf(File,varargin)
+-% Function to read NetCDF files
+-%   S = netcdf(File)
+-% Input Arguments
+-%   File = NetCDF file to read
+-% Optional Input Arguments:
+-%   'Var',Var - Read data for VarArray(Var), default [1:length(S.VarArray)]
+-%   'Rec',Rec - Read data for Record(Rec), default [1:S.NumRecs]
+-% Output Arguments:
+-%   S    = Structure of NetCDF data organised as per NetCDF definition
+-% Notes:
+-%   Only version 1, classic 32bit, NetCDF files are supported. By default
+-% data are extracted into the S.VarArray().Data field for all variables.
+-% To read the header only call S = netcdf(File,'Var',[]);
+-%
+-% SEE ALSO
+-% ---------------------------------------------------------------------------
+-S = [];
+-
+-try
+-   if exist(File,'file') fp = fopen(File,'r','b');
+-   else fp = []; error('File not found'); end
+-   if fp == -1   error('Unable to open file'); end
+-
+-% Read header
+-   Magic = fread(fp,4,'uint8=>char');
+-   if strcmp(Magic(1:3),'CDF') error('Not a NetCDF file'); end
+-   if uint8(Magic(4))~=1       error('Version not supported'); end
+-   S.NumRecs  = fread(fp,1,'uint32=>uint32');
+-   S.DimArray = DimArray(fp);
+-   S.AttArray = AttArray(fp);
+-   S.VarArray = VarArray(fp);
+-
+-% Setup indexing to arrays and records
+-   Var = ones(1,length(S.VarArray));
+-   Rec = ones(1,S.NumRecs);
+-   for i = 1:2:length(varargin)
+-      if     strcmp(upper(varargin{i}),'VAR') Var=Var*0; Var(varargin{i+1})=1;
+-      elseif strcmp(upper(varargin{i}),'REC') Rec=Rec*0; Rec(varargin{i+1})=1;
+-      else error('Optional input argument not recognised'); end
+-   end
+-   if sum(Var)==0 fclose(fp); return; end
+-
+-% Read non-record variables
+-   Dim = double(cat(2,S.DimArray.Dim));
+-   ID  = double(cat(2,S.VarArray.Type));
+-
+-   for i = 1:length(S.VarArray)
+-      D = Dim(S.VarArray(i).DimID+1); N = prod(D); RecID{i}=find(D==0);
+-      if isempty(RecID{i})
+-         if length(D)==0 D = [1,1]; N = 1; elseif length(D)==1 D=[D,1]; end
+-         if Var(i)
+-            S.VarArray(i).Data = ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D);
+-            fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8');
+-         else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
+-      else S.VarArray(i).Data = []; end
+-   end
+-
+-% Read record variables
+-   for k = 1:S.NumRecs
+-      for i = 1:length(S.VarArray)
+-         if ~isempty(RecID{i})
+-            D = Dim(S.VarArray(i).DimID+1); D(RecID{i}) = 1; N = prod(D);
+-            if length(D)==1 D=[D,1]; end
+-            if Var(i) & Rec(k)
+-               S.VarArray(i).Data = cat(RecID{i},S.VarArray(i).Data,...
+-                  ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D));
+-               if N > 1 fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8'); end
+-            else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
+-         end
+-      end
+-   end
+-
+-   fclose(fp);
+-catch
+-   Err = lasterror; fprintf('%s\n',Err.message);
+-   if ~isempty(fp) && fp ~= -1 fclose(fp); end
+-end
+-
+-% ---------------------------------------------------------------------------------------
+-% Utility functions
+-
+-function S = Size(ID)
+-% Size of NetCDF data type, ID, in bytes
+-   S = subsref([1,1,2,4,4,8],struct('type','()','subs',{{ID}}));
+-
+-function T = Type(ID)
+-% Matlab string for CDF data type, ID
+-   T = subsref({'int8','char','int16','int32','single','double'},...
+-               struct('type','{}','subs',{{ID}}));
+-
+-function N = Pad(Num,ID)
+-% Number of elements to read after padding to 4 bytes for type ID
+-   N = (double(Num) + mod(4-double(Num)*Size(ID),4)/Size(ID)).*(Num~=0);
+-
+-function S = String(fp)
+-% Read a CDF string; Size,[String,[Padding]]
+-   S = fread(fp,Pad(fread(fp,1,'uint32=>uint32'),1),'uint8=>char').';
+-
+-function A = ReOrder(A,S)
+-% Rearrange CDF array A to size S with matlab ordering
+-   A = permute(reshape(A,fliplr(S)),fliplr(1:length(S)));
+-
+-function S = DimArray(fp)
+-% Read DimArray into structure
+-   if fread(fp,1,'uint32=>uint32') == 10 % NC_DIMENSION
+-      for i = 1:fread(fp,1,'uint32=>uint32')
+-         S(i).Str = String(fp);
+-         S(i).Dim = fread(fp,1,'uint32=>uint32');
+-      end
+-   else fread(fp,1,'uint32=>uint32'); S = []; end
+-
+-function S = AttArray(fp)
+-% Read AttArray into structure
+-   if fread(fp,1,'uint32=>uint32') == 12 % NC_ATTRIBUTE
+-      for i = 1:fread(fp,1,'uint32=>uint32')
+-         S(i).Str = String(fp);
+-         ID       = fread(fp,1,'uint32=>uint32');
+-         Num      = fread(fp,1,'uint32=>uint32');
+-         S(i).Val = fread(fp,Pad(Num,ID),[Type(ID),'=>',Type(ID)]).';
+-      end
+-   else fread(fp,1,'uint32=>uint32'); S = []; end
+-
+-function S = VarArray(fp)
+-% Read VarArray into structure
+-   if fread(fp,1,'uint32=>uint32') == 11 % NC_VARIABLE
+-      for i = 1:fread(fp,1,'uint32=>uint32')
+-         S(i).Str      = String(fp);
+-         Num           = double(fread(fp,1,'uint32=>uint32'));
+-         S(i).DimID    = double(fread(fp,Num,'uint32=>uint32'));
+-         S(i).AttArray = AttArray(fp);
+-         S(i).Type     = fread(fp,1,'uint32=>uint32');
+-         S(i).VSize    = fread(fp,1,'uint32=>uint32');
+-         S(i).Begin    = fread(fp,1,'uint32=>uint32'); % Classic 32 bit format only
+-      end
+-   else fread(fp,1,'uint32=>uint32'); S = []; end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf2struct.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf2struct.m	(revision 13011)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/netcdf2struct.m	(revision 13012)
+@@ -5,7 +5,7 @@
+ %      S=netcdf2struct(File);
+ 
+ %Read netcdf file
+-data=netcdf(File);
++data=readnetcdf(File);
+ 
+ %initialize output
+ S=struct();
+@@ -25,3 +25,142 @@
+ 	fieldvalue=double(variables(i).Val);
+ 	S.(fieldname)=fieldvalue;
+ end
++end
++
++function S = readnetcdf(File,varargin)
++% Function to read NetCDF files
++%   S = netcdf(File)
++% Input Arguments
++%   File = NetCDF file to read
++% Optional Input Arguments:
++%   'Var',Var - Read data for VarArray(Var), default [1:length(S.VarArray)]
++%   'Rec',Rec - Read data for Record(Rec), default [1:S.NumRecs]
++% Output Arguments:
++%   S    = Structure of NetCDF data organised as per NetCDF definition
++% Notes:
++%   Only version 1, classic 32bit, NetCDF files are supported. By default
++% data are extracted into the S.VarArray().Data field for all variables.
++% To read the header only call S = netcdf(File,'Var',[]);
++%
++% SEE ALSO
++% ---------------------------------------------------------------------------
++S = [];
++
++try
++   if exist(File,'file') fp = fopen(File,'r','b');
++   else fp = []; error('File not found'); end
++   if fp == -1   error('Unable to open file'); end
++
++% Read header
++   Magic = fread(fp,4,'uint8=>char');
++   if strcmp(Magic(1:3),'CDF') error('Not a NetCDF file'); end
++   if uint8(Magic(4))~=1       error('Version not supported'); end
++   S.NumRecs  = fread(fp,1,'uint32=>uint32');
++   S.DimArray = DimArray(fp);
++   S.AttArray = AttArray(fp);
++   S.VarArray = VarArray(fp);
++
++% Setup indexing to arrays and records
++   Var = ones(1,length(S.VarArray));
++   Rec = ones(1,S.NumRecs);
++   for i = 1:2:length(varargin)
++      if     strcmp(upper(varargin{i}),'VAR') Var=Var*0; Var(varargin{i+1})=1;
++      elseif strcmp(upper(varargin{i}),'REC') Rec=Rec*0; Rec(varargin{i+1})=1;
++      else error('Optional input argument not recognised'); end
++   end
++   if sum(Var)==0 fclose(fp); return; end
++
++% Read non-record variables
++   Dim = double(cat(2,S.DimArray.Dim));
++   ID  = double(cat(2,S.VarArray.Type));
++
++   for i = 1:length(S.VarArray)
++      D = Dim(S.VarArray(i).DimID+1); N = prod(D); RecID{i}=find(D==0);
++      if isempty(RecID{i})
++         if length(D)==0 D = [1,1]; N = 1; elseif length(D)==1 D=[D,1]; end
++         if Var(i)
++            S.VarArray(i).Data = ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D);
++            fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8');
++         else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
++      else S.VarArray(i).Data = []; end
++   end
++
++% Read record variables
++   for k = 1:S.NumRecs
++      for i = 1:length(S.VarArray)
++         if ~isempty(RecID{i})
++            D = Dim(S.VarArray(i).DimID+1); D(RecID{i}) = 1; N = prod(D);
++            if length(D)==1 D=[D,1]; end
++            if Var(i) & Rec(k)
++               S.VarArray(i).Data = cat(RecID{i},S.VarArray(i).Data,...
++                  ReOrder(fread(fp,N,[Type(ID(i)),'=>',Type(ID(i))]),D));
++               if N > 1 fread(fp,(Pad(N,ID(i))-N)*Size(ID(i)),'uint8=>uint8'); end
++            else fseek(fp,Pad(N,ID(i))*Size(ID(i)),'cof'); end
++         end
++      end
++   end
++
++   fclose(fp);
++catch
++   Err = lasterror; fprintf('%s\n',Err.message);
++   if ~isempty(fp) && fp ~= -1 fclose(fp); end
++end
++
++% ---------------------------------------------------------------------------------------
++% Utility functions
++
++function S = Size(ID)
++% Size of NetCDF data type, ID, in bytes
++   S = subsref([1,1,2,4,4,8],struct('type','()','subs',{{ID}}));
++
++function T = Type(ID)
++% Matlab string for CDF data type, ID
++   T = subsref({'int8','char','int16','int32','single','double'},...
++               struct('type','{}','subs',{{ID}}));
++
++function N = Pad(Num,ID)
++% Number of elements to read after padding to 4 bytes for type ID
++   N = (double(Num) + mod(4-double(Num)*Size(ID),4)/Size(ID)).*(Num~=0);
++
++function S = String(fp)
++% Read a CDF string; Size,[String,[Padding]]
++   S = fread(fp,Pad(fread(fp,1,'uint32=>uint32'),1),'uint8=>char').';
++
++function A = ReOrder(A,S)
++% Rearrange CDF array A to size S with matlab ordering
++   A = permute(reshape(A,fliplr(S)),fliplr(1:length(S)));
++
++function S = DimArray(fp)
++% Read DimArray into structure
++   if fread(fp,1,'uint32=>uint32') == 10 % NC_DIMENSION
++      for i = 1:fread(fp,1,'uint32=>uint32')
++         S(i).Str = String(fp);
++         S(i).Dim = fread(fp,1,'uint32=>uint32');
++      end
++   else fread(fp,1,'uint32=>uint32'); S = []; end
++
++function S = AttArray(fp)
++% Read AttArray into structure
++   if fread(fp,1,'uint32=>uint32') == 12 % NC_ATTRIBUTE
++      for i = 1:fread(fp,1,'uint32=>uint32')
++         S(i).Str = String(fp);
++         ID       = fread(fp,1,'uint32=>uint32');
++         Num      = fread(fp,1,'uint32=>uint32');
++         S(i).Val = fread(fp,Pad(Num,ID),[Type(ID),'=>',Type(ID)]).';
++      end
++   else fread(fp,1,'uint32=>uint32'); S = []; end
++
++function S = VarArray(fp)
++% Read VarArray into structure
++   if fread(fp,1,'uint32=>uint32') == 11 % NC_VARIABLE
++      for i = 1:fread(fp,1,'uint32=>uint32')
++         S(i).Str      = String(fp);
++         Num           = double(fread(fp,1,'uint32=>uint32'));
++         S(i).DimID    = double(fread(fp,Num,'uint32=>uint32'));
++         S(i).AttArray = AttArray(fp);
++         S(i).Type     = fread(fp,1,'uint32=>uint32');
++         S(i).VSize    = fread(fp,1,'uint32=>uint32');
++         S(i).Begin    = fread(fp,1,'uint32=>uint32'); % Classic 32 bit format only
++      end
++   else fread(fp,1,'uint32=>uint32'); S = []; end
++end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13012-13013.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13012-13013.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13012-13013.diff	(revision 13394)
@@ -0,0 +1,492 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ucisvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ucisvn.m	(revision 13012)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ucisvn.m	(revision 13013)
+@@ -1,15 +0,0 @@
+-function UCI_SVN=ucisvn()
+-%ISSMDIR - Get UCI_SVN environment variable
+-%
+-%   Usage:
+-%      UCI_SVN=ucisvn()
+-
+-if ~ispc,
+-	UCI_SVN =getenv('UCI_SVN');
+-else
+-	UCI_SVN =getenv('UCI_SVN_WIN');
+-end
+-
+-if (isempty(UCI_SVN)),
+-	error('ucisvn error message: ''UCI_SVN'' environment variable is empty! You should define UCI_SVN in your .cshrc or .bashrc');
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddeblank.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddeblank.m	(revision 13012)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/ddeblank.m	(revision 13013)
+@@ -1,29 +0,0 @@
+-function sout = ddeblank(s)
+-%DDEBLANK Double deblank. Strip both leading and trailing blanks.
+-%
+-%   DDEBLANK(S) removes leading and trailing blanks and null characters from
+-%   the string S.  A null character is one that has a value of 0.
+-%
+-%   See also DEBLANK, DEWHITE, DDEWHITE.
+-
+-%   Author:      Peter J. Acklam
+-%   Time-stamp:  2003-10-13 11:13:07 +0200
+-%   E-mail:      pjacklam@online.no
+-%   URL:         http://home.online.no/~pjacklam
+-
+-   error(nargchk(1, 1, nargin));
+-   if ~ischar(s)
+-      warning('Input must be a string (char array).');
+-   end
+-
+-   if isempty(s)
+-      sout = s;
+-      return;
+-   end
+-
+-   [r, c] = find( (s ~= ' ') & (s ~= 0) );
+-   if size(s, 1) == 1
+-      sout = s(min(c) : max(c));
+-   else
+-      sout = s(:, min(c) : max(c));
+-   end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/logoutput.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/logoutput.m	(revision 13012)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/string/logoutput.m	(revision 13013)
+@@ -1,7 +0,0 @@
+-function logoutput(logstring,message)
+-%LOGOUTPUT - embed a log string into an error message, used in the nightly runs.
+-%
+-%   Usage:
+-%      logoutput(logstring,message)
+-
+-disp(sprintf('%s%s',logstring,message));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am	(revision 13012)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am	(revision 13013)
+@@ -1,40 +1,51 @@
+-bin_SCRIPTS=./classes/*.m \
+-				./classes/model/*.m \
+-				./classes/clusters/*.m \
+-				./enum/*.m \
+-				./kml/*.m \
+-				./model/*.m \
+-				./model/plot/*.m \
+-				./model/mesh/*.m \
+-				./model/display/*.m \
+-				./model/parameterization/*.m \
+-				./model/partition/*.m \
+-				./model/solvers/*.m \
+-				./qmu/*.m \
+-				./utils/*.m \
+-				./utils/Array/*.m \
+-				./utils/BC/*.m \
+-				./utils/Basins/*.m \
+-				./utils/Cluster/*.m \
+-				./utils/DataProcessing/*.m \
+-				./utils/Ecco3/*.m \
+-				./utils/Exp/*.m \
+-				./utils/Exp/manipulation/*.m \
+-				./utils/Exp/readwrite/*.m \
+-				./utils/Geometry/*.m \
+-				./utils/ImageProcessing/*.m \
+-				./utils/Interp/*.m \
+-				./utils/Kml/*.m \
+-				./utils/LatLong/*.m \
+-				./utils/Math/*.m \
+-				./utils/Meca/*.m \
+-				./utils/Mesh/*.m \
+-				./utils/Miscellaneous/*.m \
+-				./utils/Model/*.m \
+-				./utils/Numerics/*.m \
+-				./utils/OS/*.m \
+-				./utils/Plot/*.m \
+-				./utils/Shell/*.m \
+-				./utils/String/*.m \
+-				./utils/consistency/*.m \
+-				./utils/qmu/*.m 
++#To generate list of directories
++#
++#find . -type d -exec ls -d {} \;
++
++bin_SCRIPTS= ./qmu/*.m \
++				 ./qmu/setupdesign/*.m \
++				 ./qmu/plot/*.m \
++				 ./qmu/examples/*.m \
++				 ./kml/*.m \
++				 ./enum/*.m \
++				 ./classes/*.m \
++				 ./classes/qmu/*.m \
++				 ./classes/qmu/@dakota_method/*.m \
++				 ./classes/clusters/*.m \
++				 ./classes/model/*.m \
++				 ./consistency/*.m \
++				 ./array/*.m \
++				 ./boundaryconditions/*.m \
++				 ./exp/*.m \
++				 ./exp/manipulation/*.m \
++				 ./geometry/*.m \
++				 ./interp/*.m \
++				 ./latlong/*.m \
++				 ./meca/*.m \
++				 ./mesh/*.m \
++				 ./mesh/planet/*.m \
++				 ./mesh/rifts/*.m \
++				 ./miscellaneous/*.m \
++				 ./os/*.m \
++				 ./plot/*.m \
++				 ./plot/colormaps/*.m \
++				 ./string/*.m \
++				 ./contrib/*.m \
++				 ./contrib/massbalance/*.m \
++				 ./contrib/ecco/*.m \
++				 ./contrib/hydrology/*.m \
++				 ./contrib/hack/*.m \
++				 ./contrib/gslib/*.m \
++				 ./contrib/uci/*.m \
++				 ./contrib/oasis/*.m \
++				 ./contrib/bamg/*.m \
++				 ./extrusion/*.m \
++				 ./inversions/*.m \
++				 ./io/*.m \
++				 ./parameterization/*.m \
++				 ./partition/*.m \
++				 ./print/*.m \
++				 ./regional/*.m \
++				 ./solve/*.m \
++				 ./solvers/*.m \
++				 ./materials/*.m
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/imagescnan.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/imagescnan.m	(revision 13012)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/imagescnan.m	(revision 13013)
+@@ -1,303 +0,0 @@
+-function [h,hcb] = imagescnan(x,y,U,varargin)
+-%IMAGESCNAN Scale data and display as image with uncolored NaNs.
+-%
+-%   Syntax
+-%               imagescnan(x,y,U)
+-%               imagescnan(x,y,U,...,colormask)
+-%               imagescnan(x,y,U,...,color)
+-%               imagescnan(x,y,U,...,cbfit_opt)
+-%           h = imagescnan(...);
+-%     [h,hcb] = imagescnan(...,cbfit_opt);
+-%
+-%   Input:
+-%     x          - X-axis vector data. Optional, i.e., can be empty.
+-%                  Default: 1:n (rows index).
+-%     y          - Y-axis vector data. Optional, i.e., can be empty.
+-%                  Default: 1:m (column index).
+-%     U          - Matrix [m x n] data or an RGB image [m x n x 3] (with/
+-%                  without NaNs). 
+-%     colormask  - Logical matrix indicating the U elements to be
+-%                  uncolored, if is empty then ISNAN(U) is used. Or it can
+-%                  be a single value which will be uncolored.
+-%                  Default: ~isfinite(U) (NaNs and Infs elements uncolored)
+-%     color      - A vector with 3 elements specifying the [R G B] color
+-%                  for the NaNs color. It can be specified by the known
+-%                  char colors: 'k', etcerera. Optional.  
+-%                  Default: get(gca,'color') (axes background color)
+-%     cbfit_opt  - Cell array with the options to call COLORBARFIT.
+-%                  Default: COLORBARFIT function is not used by default.
+-%
+-%   Output:
+-%     h   - Image handle. Optional
+-%     hcb - Colorbar handle. Optional
+-%
+-%   Description:
+-%      This function draws a matrix data as an image with uncolored NaN's
+-%      elements using IMAGESC. The difference between IMAGESC and the
+-%      PCOLOR, MESH or SURF function is that EVERY element is colored and
+-%      no one is interpolated, besides, the pixels are centered with the
+-%      axis value, although it is a flat image.
+-%
+-%      The color mask is added because IMAGESC do not work with NaN's, in
+-%      fact it colors them with the lower value of the current colormap.
+-%      
+-%      The cbfit_opt is include in order to be able to define a diferent
+-%      color map with the COLORBARFIT function which can be found at:
+-%           http://www.mathworks.com/matlabcentral/fileexchange/.
+-%      If this function is not found, a normal COLORBAR is generated.
+-%
+-%      The data and the colorbar are scaled with the current colormap, so,
+-%      the use of COLORMAP after this function doesn't affects the
+-%      generated image and colorbar! Therefore, COLORMAP and CAXIS should
+-%      be used before this function.
+-%
+-%      Notes: * The inputs arguments for the COLORBARFIT function are 3
+-%               plus the normal COLORBAR function options, for this reason,
+-%               if the former is not found, the latter is used ignoring
+-%               these first 3 options. Anyway, to generate a colorbar, at
+-%               least an empty cell is needed for cbfit_opt = {[]}.
+-%   
+-%   Examples:
+-%
+-%      % Compares with normal IMAGESC:
+-%       N = 100;
+-%       PNaNs = 0.10;
+-%       X = peaks(N);
+-%       X(round(1 + (N^2-1).*rand(N^2*PNaNs,1))) = NaN;
+-%       subplot(221), imagesc(X)
+-%        title('With IMAGESC: ugly NaNs')
+-%       subplot(222), imagescnan([],[],X) 
+-%        title('With IMAGESCNAN: uncolored NaNs')
+-%
+-%      % Compares with SPY:
+-%       subplot(223), spy(isnan(X))
+-%        title('SPY NaNs')
+-%       subplot(224), imagescnan([],[],isnan(X),0), axis equal tight
+-%        title('No-NaNs with IMAGESCNAN')
+-%
+-%   See also IMAGE, IMAGESC, COLORBAR, IMREAD, IMWRITE and COLORBARFIT by
+-%   Carlos Vargas. 
+-
+-%   Copyright 2008 Carlos Adrian Vargas Aguilera
+-%   $Revision: 1.1 $  $Date: 2009/04/03 22:56:05 $
+-
+-%   Written by
+-%   M.S. Carlos Adrian Vargas Aguilera
+-%   Physical Oceanography PhD candidate
+-%   CICESE 
+-%   Mexico, 2008
+-%   nubeobscura@hotmail.com
+-%
+-%   Download from:
+-%   http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objec
+-%   tType=author&objectId=1093874
+-
+-%   1.0     Released (30/06/2008)
+-%   1.1     Fixed bug when CAXIS used.
+-%   1.2     Colorbar freezed colormap.
+-%   1.3     Fixed bug in color vector input (Found by Greg King) and now
+-%           accets RGB image as input.
+-
+-%% INPUTS:
+-
+-% Error checking:
+-% Note: At least 3 inputs and no more than 6:
+-if nargin<3 || nargin>6
+- error('Imagescnan:IncorrectInputNumber',...
+-       'Input arguments must be at least 3 and less than 7.')
+-end
+-
+-% Check the x,y,U:
+-% Note: x,y should be the axes data.
+-m = size(U);
+-if numel(m)>3
+- error('Imagescnan:IncorrectInputSize',...
+-       'Input image must be a matrix or an RGB image.')
+-else
+- if isempty(x) || numel(x)~=m(2)
+-  %warning('Imagescnan:IncorrectInputSize',...
+-  %        'Index column axis has been used.')
+-  x = 1:m(2); 
+- end
+- if isempty(y) || numel(y)~=m(1)
+-  %warning('Imagescnan:IncorrectInputSize',...
+-  %        'Index row axis has been used.')
+-  y = 1:m(1); 
+- end
+-end
+-
+-% Get color limits:
+-% Note: If you would like to use specific color limits, use CAXIS before
+-%       this function.
+-switch get(gca,'CLimMode')
+- case 'manual'
+-  clim = caxis;
+- otherwise
+-  clim = [min(U(:)) max(U(:))];
+-end
+-
+-% Parse inputs and defaults:
+-% Note: * Mask color will be the not-finite elements plus the elements
+-%         indicated by the user.
+-%       * Default colormask is the current axes background.
+-%       * Default currentmap is current figure colormap (probably JET).
+-colormask = ~isfinite(U);
+-color_nan = get(gca,'color');
+-color_map = get(gcf,'colormap'); 
+-cbfit_opt = [];
+-ycolorbarfit = (exist('colorbarfit','file')==2);
+-if nargin>3
+- while ~isempty(varargin)
+-  if     iscell(varargin{1})
+-   if length(varargin{1})<3
+-    error('Imagescnan:IncorrectInputType',...
+-     'Options for COLORBARFIT must be at least 3, although empty.')
+-   end
+-   caxis(clim)
+-   cbfit_opt = varargin{1};
+-   if ycolorbarfit
+-    colorbarfit(cbfit_opt{:})
+-    color_map = get(gcf,'colormap');
+-   else
+-    % warning('Imagescnan:ColorBarFitNotFound',...
+-    %  'COLORBARFIT function not found, used default COLORBAR.') 
+-   end
+-   varargin(1) = [];
+-  elseif ischar(varargin{1})
+-   switch varargin{1}
+-    case 'y', color_nan = [1 1 0];
+-    case 'm', color_nan = [1 0 0];
+-    case 'c', color_nan = [0 1 1];
+-    case 'r', color_nan = [1 0 0];
+-    case 'g', color_nan = [0 1 0];
+-    case 'b', color_nan = [0 0 1];
+-    case 'w', color_nan = [1 1 1];
+-    case 'k', color_nan = [0 0 0];
+-   otherwise
+-   error('Imagescnan:InvalidColor',...
+-    'Color char must be one of: ''ymcrgbwk''.')
+-   end
+-   varargin(1) = [];
+-  elseif islogical(varargin{1})
+-   if numel(varargin{1})~=numel(U)
+-    error('Imagescnan:InvalidMask',...
+-     'The logical mask must have the same elements as the matrix.')
+-   end
+-   colormask = varargin{1} | colormask;
+-   varargin(1) = [];
+-  elseif length(varargin{1})==3
+-   if (max(varargin{1})>1) || (min(varargin{1})<0) % Fixed BUG 2008/07/11
+-    error('Imagescnan:InvalidColor',...
+-     'The color must be on the range of [0 1].')
+-   end
+-   color_nan = varargin{1};
+-   varargin(1) = [];
+-  elseif length(varargin{1})==1
+-   colormask = (U==varargin{1}) | colormask;
+-   varargin(1) = [];
+-  else
+-   error('Imagescnan:IncorrectInputType',...
+-    'Incorrect optional(s) argument(s).')
+-  end
+- end
+-end
+-
+-
+-%% MAIN:
+-
+-% Matrix data to RGB:
+-if numel(m)==2
+-
+- % Sets to double data:
+- if ~isfloat(U)
+-  U = double(U);
+- end
+-
+- % Normalizes and rounds data to range [0 N]:
+- N = size(color_map,1);
+- U = (U - clim(1))/diff(clim);          % Fixed bug when CAXIS used
+- U = U*N;
+- if N<=256
+-  U = uint8(U);
+- else
+-  U = uint16(U);
+- end
+-
+- % Scales data with colormap:
+- U = ind2rgb(U,color_map);              % 2D to 3D RGB values [0 1]
+-else
+- % Already is an RGB image, so do nothing.
+-end
+-
+- % Set mask color to color_nan:
+- mn = prod(m(1:2));
+- ind = find(colormask);
+- U(ind)      = color_nan(1); % Red color
+- U(ind+mn)   = color_nan(2); % Green color
+- U(ind+mn*2) = color_nan(3); % Blue color
+-
+- % Draws the RGB image:
+- h = imagesc(x,y,U,clim);
+-
+-%% OUTPUTS:
+-
+-% Calls to colorbarfit and freezes his colormap:
+-if ~isempty(cbfit_opt)
+- % Creates a temporary colorbar:
+- if ycolorbarfit
+-  hcb   = colorbarfit(cbfit_opt{:});
+- else
+-  Nopt = min([3 length(cbfit_opt)]);
+-  cbfit_opt(1:Nopt) = [];
+-  hcb   = colorbar(cbfit_opt{:});
+- end
+- % Save image position:
+- ha    = gca; position = get(ha,'Position'); 
+- % Gets colorbar axes properties:
+- ghcb  = get(hcb);
+- CData = ind2rgb(get(ghcb.Children,'CData'),color_map);
+- XData = get(ghcb.Children,'XData');
+- YData = get(ghcb.Children,'YData');
+- % Move ticks because IMAGESC draws them like centered pixels:
+- XTick = ghcb.XTick;
+- YTick = ghcb.YTick;
+- if ~isempty(XTick)
+-  XTick = XTick(1:end-1) + diff(XTick(1:2))/2;
+- end
+- if ~isempty(YTick)
+-  YTick = YTick(1:end-1) + diff(YTick(1:2))/2;
+- end
+- % Deletes the colorbar:
+- delete(hcb)            
+- % Generates other colorbar:
+- hcb = axes('Position',ghcb.Position);
+- hcbim = imagesc(XTick,YTick,CData,'Parent',hcb); axis tight
+- set(hcbim,...
+-  'HitTest','off',...
+-  'Interruptible','off',...
+-  'SelectionHighlight','off',...
+-  'Tag','TMW_COLORBAR',...
+-  'XData',XData,...
+-  'YData',YData)
+- set(hcb,...
+-  'XAxisLocation',ghcb.XAxisLocation,...
+-  'YAxisLocation',ghcb.YAxisLocation,...
+-  'XLim',ghcb.XLim,...
+-  'YLim',ghcb.YLim,...
+-  'XDir',ghcb.XDir,...
+-  'YDir',ghcb.YDir,...
+-  'XTick',ghcb.XTick,...
+-  'YTick',ghcb.YTick,...
+-  'XTickLabel',ghcb.XTickLabel,...
+-  'YTickLabel',ghcb.YTickLabel,...
+-  'ButtonDownFcn',@resetCurrentAxes,...
+-  'Interruptible','off',...
+-  'Tag','Colorbar')
+- % Returns the image position:
+- axes(ha), set(ha,'Position',position)
+-end
+-
+-% Sets output:
+-if ~nargout
+- clear h
+-end
+\ No newline at end of file
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot2patch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot2patch.m	(revision 13012)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot2patch.m	(revision 13013)
+@@ -1,16 +0,0 @@
+-function [px py]=plot2patch(x,y,miny)
+-%PLOT2PATCH: build patch out of x,y plot.
+-%
+-% Usage: [px,py]=plot2patch(x,y,miny)
+-%
+-%        where px and py are a list of point defining a closed polygon.
+-%              x,y are the values of the plot
+-%              miny is the y-value used to close the plot into a closed polygon.
+-% 
+-%      See also patch, plot
+-
+-px=x;
+-py=y;
+-
+-px=[px; flipud(x)];
+-py=[py; ; miny*ones(length(x),1)];
Index: /issm/oecreview/Archive/12678-13393/ISSM-13013-13014.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13013-13014.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13013-13014.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13013)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13014)
+@@ -72,7 +72,7 @@
+ #fi
+ 
+ #AUTOMAKE
+-#AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install"
++AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install"
+ #if [ -d "$AUTOMAKE_DIR" ]; then
+ 	export PATH="$AUTOMAKE_DIR/bin:$PATH"
+ #fi
Index: /issm/oecreview/Archive/12678-13393/ISSM-13014-13015.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13014-13015.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13014-13015.diff	(revision 13394)
@@ -0,0 +1,107 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/display/fielddisplay.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/display/fielddisplay.py	(revision 13014)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/display/fielddisplay.py	(revision 13015)
+@@ -1,102 +0,0 @@
+-#Module import 
+-from math import isnan
+-
+-
+-def fielddisplay(md,name,comment):
+-#FIELDDISPLAY - display model field
+-#
+-#   Usage:
+-#      fielddisplay(md,name,comment)
+-
+-	#get field
+-	field=getattr(md,name)
+-
+-	#disp corresponding line as a function of field type (offset set as 9 spaces)
+-	return parsedisplay("         ",name,field,comment);
+-
+-#parsedisplay{{{ 
+-def  parsedisplay(offset,name,field,comment):
+-
+-	#string
+-	if isinstance(field,str):
+-		if len(field)>30:
+-			string=displayunit(offset,name,"not displayed",comment)
+-		else:
+-			string=displayunit(offset,name,field,comment)
+-
+-	#numeric
+-	elif isinstance(field, int):
+-		string=displayunit(offset,name,"%i" % (field),comment) 
+-
+-	elif isinstance(field, complex):
+-		raise RuntimeError("fielddisplay cannot handle complex numbers")
+-
+-	elif isinstance(field, float):
+-		string=displayunit(offset,name,"%g"%(field),comment)
+-
+-	#logical
+-	elif isinstance(field,bool):
+-		if field:
+-			string=displayunit(offset,name,"true",comment)
+-		else:
+-			string=displayunit(offset,name,"false",comment)
+-	
+-	elif isinstance(field,dict):
+-		if not field:
+-			string=displayunit(offset,name,'N/A',comment)
+-		else:
+-			string=displayunit(offset,name,'(dictionary)',comment)
+-			for key in field.keys():
+-				string="%s\n%s"%(string,parsedisplay(offset + '   ',key,field[key],''))
+-
+-	elif isinstance(field,list):
+-		if not field:
+-			string=displayunit(offset,name,'N/A',comment),
+-		else:
+-			string=displayunit(offset,name,'(structure)',comment)
+-			for i in range(len(field)):
+-				string="%s\n%s"%(string,displayunit(offset + '   ',name,field[i],comment))
+-	#cell
+-	#elif  iscell(field):
+-	#	cell_display(offset,name,field,comment),
+-
+-	else:
+-		string=displayunit(offset,name,"not displayed",comment)
+-		
+-	return string
+-
+-#}}}
+-#displayunit {{{
+-def  displayunit(offset,name,characterization,comment):
+-
+-	#take care of name
+-	if len(name)>23:
+-		name="%s..." % (name[:19])
+-	
+-	#take care of characterization
+-	if characterization=="":
+-		characterization="N/A"
+-	
+-	if characterization=="nan":
+-		characterization="N/A"
+-	
+-	if len(characterization)>15:
+-		characterization="%s%s" % (characterization[:11],"...")
+-	
+-	#print
+-	if not comment:
+-		string="%s%-23s: %-15s" % (offset,name,characterization)
+-	else:
+-		if isinstance(comment,str):
+-			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment)
+-		elif isinstance(comment,list):
+-			print(comment)
+-			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment[0])
+-			for i in range(1,len(comment)):
+-				string2="%s%-23s  %-15s    %s" %(offset,"","",comment[i])
+-				string="%s\n%s"%(string,string2)
+-		else:
+-			raise RuntimeError("fielddisplay error message: format for comment not supportet yet")
+-
+-	return string
+-#}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13015-13016.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13015-13016.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13015-13016.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/Makefile.am	(revision 13015)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/model/Makefile.am	(revision 13016)
+@@ -1,11 +0,0 @@
+-bin_SCRIPTS = petscversion.py
+-CLEANFILES = $(bin_SCRIPTS)
+-
+-if PYTHON3
+-%.py : %.2.py
+-	cp -f $< $@
+-	2to3 -n -w  $@
+-else
+-%.py : %.2.py
+-	ln -s -f $< $@
+-endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-13016-13017.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13016-13017.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13016-13017.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am	(revision 13016)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am	(revision 13017)
+@@ -30,7 +30,6 @@
+ 				 ./plot/*.m \
+ 				 ./plot/colormaps/*.m \
+ 				 ./string/*.m \
+-				 ./contrib/*.m \
+ 				 ./contrib/massbalance/*.m \
+ 				 ./contrib/ecco/*.m \
+ 				 ./contrib/hydrology/*.m \
Index: /issm/oecreview/Archive/12678-13393/ISSM-13017-13018.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13017-13018.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13017-13018.diff	(revision 13394)
@@ -0,0 +1,20 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 13017)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 13018)
+@@ -97,4 +97,5 @@
+ 	otherwise
+ 		error('%s%s%s',' solution type: ',EnumToString(solutiontype),' not supported yet!');
+ 
++	end
+ end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.m	(revision 13017)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.m	(revision 13018)
+@@ -54,4 +54,4 @@
+ 	[path,root,ext]=fileparts(parametername);
+ 	md.miscellaneous.name=root; 
+ end
+-md=addnote(md,['Model created by using parameter file: ' parametername ' on: ' datestr(now)]);
++md.miscellaneous.notes=['Model created by using parameter file: ' parametername ' on: ' datestr(now)];
Index: /issm/oecreview/Archive/12678-13393/ISSM-13018-13019.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13018-13019.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13018-13019.diff	(revision 13394)
@@ -0,0 +1,107 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py	(revision 13019)
+@@ -0,0 +1,102 @@
++#Module import 
++from math import isnan
++
++
++def fielddisplay(md,name,comment):
++#FIELDDISPLAY - display model field
++#
++#   Usage:
++#      fielddisplay(md,name,comment)
++
++	#get field
++	field=getattr(md,name)
++
++	#disp corresponding line as a function of field type (offset set as 9 spaces)
++	return parsedisplay("         ",name,field,comment);
++
++#parsedisplay{{{ 
++def  parsedisplay(offset,name,field,comment):
++
++	#string
++	if isinstance(field,str):
++		if len(field)>30:
++			string=displayunit(offset,name,"not displayed",comment)
++		else:
++			string=displayunit(offset,name,field,comment)
++
++	#numeric
++	elif isinstance(field, int):
++		string=displayunit(offset,name,"%i" % (field),comment) 
++
++	elif isinstance(field, complex):
++		raise RuntimeError("fielddisplay cannot handle complex numbers")
++
++	elif isinstance(field, float):
++		string=displayunit(offset,name,"%g"%(field),comment)
++
++	#logical
++	elif isinstance(field,bool):
++		if field:
++			string=displayunit(offset,name,"true",comment)
++		else:
++			string=displayunit(offset,name,"false",comment)
++	
++	elif isinstance(field,dict):
++		if not field:
++			string=displayunit(offset,name,'N/A',comment)
++		else:
++			string=displayunit(offset,name,'(dictionary)',comment)
++			for key in field.keys():
++				string="%s\n%s"%(string,parsedisplay(offset + '   ',key,field[key],''))
++
++	elif isinstance(field,list):
++		if not field:
++			string=displayunit(offset,name,'N/A',comment),
++		else:
++			string=displayunit(offset,name,'(structure)',comment)
++			for i in range(len(field)):
++				string="%s\n%s"%(string,displayunit(offset + '   ',name,field[i],comment))
++	#cell
++	#elif  iscell(field):
++	#	cell_display(offset,name,field,comment),
++
++	else:
++		string=displayunit(offset,name,"not displayed",comment)
++		
++	return string
++
++#}}}
++#displayunit {{{
++def  displayunit(offset,name,characterization,comment):
++
++	#take care of name
++	if len(name)>23:
++		name="%s..." % (name[:19])
++	
++	#take care of characterization
++	if characterization=="":
++		characterization="N/A"
++	
++	if characterization=="nan":
++		characterization="N/A"
++	
++	if len(characterization)>15:
++		characterization="%s%s" % (characterization[:11],"...")
++	
++	#print
++	if not comment:
++		string="%s%-23s: %-15s" % (offset,name,characterization)
++	else:
++		if isinstance(comment,str):
++			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment)
++		elif isinstance(comment,list):
++			print(comment)
++			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment[0])
++			for i in range(1,len(comment)):
++				string2="%s%-23s  %-15s    %s" %(offset,"","",comment[i])
++				string="%s\n%s"%(string,string2)
++		else:
++			raise RuntimeError("fielddisplay error message: format for comment not supportet yet")
++
++	return string
++#}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13019-13020.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13019-13020.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13019-13020.diff	(revision 13394)
@@ -0,0 +1,1427 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.m	(revision 13020)
+@@ -27,20 +27,20 @@
+ 
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+-			if ismember(DiagnosticHorizAnalysisEnum,analyses)
++			if ismember(DiagnosticHorizAnalysisEnum(),analyses)
+ 				if ~(isnan(md.initialization.vx) | isnan(md.initialization.vy)),
+ 					md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 					md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 				end
+ 			end
+-			if ismember(PrognosticAnalysisEnum,analyses),
++			if ismember(PrognosticAnalysisEnum(),analyses),
+ 				md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 				md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 			end
+-			if ismember(HydrologyAnalysisEnum,analyses),
++			if ismember(HydrologyAnalysisEnum(),analyses),
+ 				md = checkfield(md,'initialization.watercolumn','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 			end
+-			if ismember(BalancethicknessAnalysisEnum,analyses),
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
+ 				md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 				md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 				%Triangle with zero velocity
+@@ -48,13 +48,13 @@
+ 					md = checkmessage(md,'at least one triangle has all its vertices with a zero velocity');
+ 				end
+ 			end
+-			if ismember(ThermalAnalysisEnum,analyses),
++			if ismember(ThermalAnalysisEnum(),analyses),
+ 				md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 				md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 				md = checkfield(md,'initialization.vz','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 				md = checkfield(md,'initialization.pressure','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 			end
+-			if (ismember(EnthalpyAnalysisEnum,analyses) & md.thermal.isenthalpy) | solution==EnthalpySolutionEnum,
++			if (ismember(EnthalpyAnalysisEnum(),analyses) & md.thermal.isenthalpy) | solution==EnthalpySolutionEnum(),
+ 				md = checkfield(md,'initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices 1]);
+ 			end
+ 		end % }}}
+@@ -72,13 +72,13 @@
+ 
+ 		end % }}}
+ 		function marshall(obj,fid) % {{{
+-			WriteData(fid,'data',obj.vx,'format','DoubleMat','mattype',1,'enum',VxEnum);
+-			WriteData(fid,'data',obj.vy,'format','DoubleMat','mattype',1,'enum',VyEnum);
+-			WriteData(fid,'data',obj.vz,'format','DoubleMat','mattype',1,'enum',VzEnum);
+-			WriteData(fid,'data',obj.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum);
+-			WriteData(fid,'data',obj.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum);
+-			WriteData(fid,'data',obj.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum);
+-			WriteData(fid,'data',obj.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum);
++			WriteData(fid,'data',obj.vx,'format','DoubleMat','mattype',1,'enum',VxEnum());
++			WriteData(fid,'data',obj.vy,'format','DoubleMat','mattype',1,'enum',VyEnum());
++			WriteData(fid,'data',obj.vz,'format','DoubleMat','mattype',1,'enum',VzEnum());
++			WriteData(fid,'data',obj.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum());
++			WriteData(fid,'data',obj.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum());
++			WriteData(fid,'data',obj.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum());
++			WriteData(fid,'data',obj.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum());
+ 		end % }}}
+ 	end
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.m	(revision 13020)
+@@ -37,8 +37,8 @@
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+-			%Early return,
+-			if ~ismember(PrognosticAnalysisEnum,analyses) |  (solution==TransientSolutionEnum & md.transient.isprognostic==0), return; end
++			%Early return
++			if ~ismember(PrognosticAnalysisEnum(),analyses) |  (solution==TransientSolutionEnum() & md.transient.isprognostic==0), return; end
+ 
+ 			md = checkfield(md,'prognostic.spcthickness','forcing',1);
+ 			md = checkfield(md,'prognostic.hydrostatic_adjustment','values',{'Absolute' 'Incremental'});
+@@ -61,7 +61,7 @@
+ 		function marshall(obj,fid) % {{{
+ 			WriteData(fid,'object',obj,'fieldname','spcthickness','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','min_thickness','format','Double');
+-			WriteData(fid,'data',StringToEnum(obj.hydrostatic_adjustment),'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum);
++			WriteData(fid,'data',StringToEnum(obj.hydrostatic_adjustment),'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum());
+ 			WriteData(fid,'object',obj,'fieldname','stabilization','format','Integer');
+ 			WriteData(fid,'object',obj,'fieldname','vertex_pairing','format','DoubleMat','mattype',3);
+ 			WriteData(fid,'object',obj,'fieldname','penalty_factor','format','Double');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.m	(revision 13020)
+@@ -34,7 +34,7 @@
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if solution~=FlaimSolutionEnum, return; end
++			if solution~=FlaimSolutionEnum(), return; end
+ 
+ 			md = checkfield(md,'flaim.tracks','file',1);
+ 			if any(isnan(md.flaim.criterion)) || isempty(md.flaim.criterion)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/balancethickness.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/balancethickness.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/balancethickness.py	(revision 13020)
+@@ -1,33 +1,62 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
++
+ class balancethickness(object):
++	"""
++	BALANCETHICKNESS class definition
++
++	   Usage:
++	      balancethickness=balancethickness();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+-		self.spcthickness = float('NaN')
+-		self.thickening_rate           = float('NaN')
+-		self.stabilization           = 0
++		self.spcthickness      = float('NaN')
++		self.thickening_rate   = float('NaN')
++		self.stabilization     = 0
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		
+ 		string='   balance thickness solution parameters:' 
+ 		
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'spcthickness','thickness constraints (NaN means no constraint)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'thickening_rate','ice thickening rate used in the mass conservation (dh/dt)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'stabilization','0: None, 1: SU, 2: MacAyeal''s artificial diffusivity, 3:DG'))
++		string="%s\n\n%s"%(string,fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint)'))
++		string="%s\n%s"%(string,fielddisplay(self,'thickening_rate','ice thickening rate used in the mass conservation (dh/dt)'))
++		string="%s\n%s"%(string,fielddisplay(self,'stabilization',"0: None, 1: SU, 2: MacAyeal's artificial diffusivity, 3:DG"))
+ 		return string
+ 		#}}}
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#Type of stabilization used
+-		obj.stabilization=1
++		self.stabilization=1
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		#Early return
++		if not solution==BalancethicknessSolutionEnum():
++			return md
++
++		md = checkfield(md,'balancethickness.spcthickness','forcing',1)
++		md = checkfield(md,'balancethickness.thickening_rate','size',[md.mesh.numberofvertices],'NaN',1)
++		md = checkfield(md,'balancethickness.stabilization','size',[1],'values',[0,1,2,3])
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','thickening_rate','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','stabilization','format','Integer')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py	(revision 13020)
+@@ -1,7 +1,19 @@
+ #module imports
++import numpy
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
++from MatlabFuncs import *
+ 
+ class groundingline(object):
++	"""
++	CONSTANTS class definition
++
++	   Usage:
++	      groundingline=groundingline();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -12,23 +24,45 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   grounding line solution parameters:'
+ 
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'migration','type of grounding line migration: ''SoftMigration'',''AgressiveMigration'' or ''None'''))
+-		string="%s\n%s"%(string,fielddisplay(obj,'melting_rate','melting rate applied when previously grounded parts start floating'))
++		string="%s\n\n%s"%(string,fielddisplay(self,'migration','type of grounding line migration: ''SoftMigration'',''AgressiveMigration'' or ''None'''))
++		string="%s\n%s"%(string,fielddisplay(self,'melting_rate','melting rate applied when previously grounded parts start floating'))
+ 		return string
+ 		#}}}	
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 
+ 		#Type of migration
+-		obj.migration='None'
++		self.migration='None'
+ 
+ 		#basal melting rate correction: 
+-		obj.melting_rate=0;
++		self.melting_rate=0;
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		md = checkfield(md,'groundingline.migration','values',['None','AgressiveMigration','SoftMigration'])
++
++		if not strcmp(self.migration,'None'):
++			if any(numpy.isnan(md.geometry.bathymetry)):
++				md.checkmessage("requesting grounding line migration, but bathymetry is absent!")
++			pos=numpy.nonzero(md.mask.vertexongroundedice)
++			if any(numpy.abs(md.geometry.bed[pos]-md.geometry.bathymetry[pos])>10**-10):
++				md.checkmessage("bathymetry not equal to bed on grounded ice!")
++			pos=numpy.nonzero(md.mask.vertexonfloatingice)
++			if any(md.geometry.bathymetry[pos]-md.geometry.bed[pos]>10**-9):
++				md.checkmessage("bathymetry superior to bed on floating ice!")
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'data',StringToEnum(self.migration),'enum',GroundinglineMigrationEnum(),'format','Integer')
++		WriteData(fid,'object',self,'fieldname','melting_rate','format','Double')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/balancethickness.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/balancethickness.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/balancethickness.m	(revision 13020)
+@@ -26,7 +26,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 			%Early return
+-			if solution~=BalancethicknessSolutionEnum, return; end
++			if solution~=BalancethicknessSolutionEnum(), return; end
+ 
+ 			md = checkfield(md,'balancethickness.spcthickness','forcing',1);
+ 			md = checkfield(md,'balancethickness.thickening_rate','size',[md.mesh.numberofvertices 1],'NaN',1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13020)
+@@ -96,7 +96,7 @@
+ 			md = checkfield(md,'inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
+ 			md = checkfield(md,'inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
+ 
+-			if solution==BalancethicknessSolutionEnum
++			if solution==BalancethicknessSolutionEnum()
+ 				md = checkfield(md,'inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
+ 			else
+ 				md = checkfield(md,'inversion.vx_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
+@@ -158,23 +158,23 @@
+ 			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');
++			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(data==101); data(pos)=SurfaceAbsVelMisfitEnum;
+-			pos=find(data==102); data(pos)=SurfaceRelVelMisfitEnum;
+-			pos=find(data==103); data(pos)=SurfaceLogVelMisfitEnum;
+-			pos=find(data==104); data(pos)=SurfaceLogVxVyMisfitEnum;
+-			pos=find(data==105); data(pos)=SurfaceAverageVelMisfitEnum;
+-			pos=find(data==201); data(pos)=ThicknessAbsMisfitEnum;
+-			pos=find(data==501); data(pos)=DragCoefficientAbsGradientEnum;
+-			pos=find(data==502); data(pos)=RheologyBbarAbsGradientEnum;
+-			pos=find(data==503); data(pos)=ThicknessAbsGradientEnum;
+-			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum,'format','DoubleMat','mattype',3);
+-			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum,'format','Integer');
++			pos=find(data==101); data(pos)=SurfaceAbsVelMisfitEnum();
++			pos=find(data==102); data(pos)=SurfaceRelVelMisfitEnum();
++			pos=find(data==103); data(pos)=SurfaceLogVelMisfitEnum();
++			pos=find(data==104); data(pos)=SurfaceLogVxVyMisfitEnum();
++			pos=find(data==105); data(pos)=SurfaceAverageVelMisfitEnum();
++			pos=find(data==201); data(pos)=ThicknessAbsMisfitEnum();
++			pos=find(data==501); data(pos)=DragCoefficientAbsGradientEnum();
++			pos=find(data==502); data(pos)=RheologyBbarAbsGradientEnum();
++			pos=find(data==503); data(pos)=ThicknessAbsGradientEnum();
++			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);
++			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');
+ 		end % }}}
+ 	end
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.py	(revision 13020)
+@@ -1,7 +1,17 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class hydrology(object):
++	"""
++	HYDROLOGY class definition
++
++	   Usage:
++	      hydrology=hydrology();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -16,35 +26,56 @@
+ 		#set defaults
+ 		self.setdefaultparameters()
+ 
+-	
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		
+ 		string='   hydrology solution parameters:'
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'spcwatercolumn','water thickness constraints (NaN means no constraint)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'n','Manning roughness coefficient'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'CR','tortuosity parameter'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'p','dimensionless exponent in Manning velocity formula'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'q','dimensionless exponent in Manning velocity formula'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'kn','parameter in effective pressure formula'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'stabilization','artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.'))
++		string="%s\n\n%s"%(string,fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint)'))
++		string="%s\n%s"%(string,fielddisplay(self,'n','Manning roughness coefficient'))
++		string="%s\n%s"%(string,fielddisplay(self,'CR','tortuosity parameter'))
++		string="%s\n%s"%(string,fielddisplay(self,'p','dimensionless exponent in Manning velocity formula'))
++		string="%s\n%s"%(string,fielddisplay(self,'q','dimensionless exponent in Manning velocity formula'))
++		string="%s\n%s"%(string,fielddisplay(self,'kn','parameter in effective pressure formula'))
++		string="%s\n%s"%(string,fielddisplay(self,'stabilization','artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.'))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#Parameters from Johnson's 2002 thesis, section 3.5.4			 
+-		obj.n=.02			
+-		obj.CR=.01
+-		obj.p=2
+-		obj.q=1
+-		obj.kn=0
++		self.n=.02			
++		self.CR=.01
++		self.p=2
++		self.q=1
++		self.kn=0
+ 
+ 		#Type of stabilization to use 0:nothing 1:artificial_diffusivity
+-		obj.stabilization=1
++		self.stabilization=1
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		#Early return
++		if not HydrologyAnalysisEnum() in analyses:
++			return md
++
++		md = checkfield(md,'hydrology.spcwatercolumn','forcing',1)
++		md = checkfield(md,'hydrology.stabilization','>=',0)
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','n','format','Double')
++		WriteData(fid,'object',self,'fieldname','CR','format','Double')
++		WriteData(fid,'object',self,'fieldname','p','format','Double')
++		WriteData(fid,'object',self,'fieldname','q','format','Double')
++		WriteData(fid,'object',self,'fieldname','kn','format','Double')
++		WriteData(fid,'object',self,'fieldname','stabilization','format','Double')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py	(revision 13020)
+@@ -78,7 +78,7 @@
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+-		if PrognosticAnalysisEnum in analyses:
++		if PrognosticAnalysisEnum() in analyses:
+ 			md = checkfield(md,'surfaceforcings.ispdd','numel',1,'values',[0,1])
+ 			md = checkfield(md,'surfaceforcings.issmbgradients','numel',1,'values',[0,1])
+ 			if   self.ispdd:
+@@ -102,7 +102,7 @@
+ 			else:
+ 				md = checkfield(md,'surfaceforcings.mass_balance','forcing',1,'NaN',1)
+ 
+-		if BalancethicknessAnalysisEnum in analyses:
++		if BalancethicknessAnalysisEnum() in analyses:
+ 			md = checkfield(md,'surfaceforcings.mass_balance','size',[md.mesh.numberofvertices],'NaN',1)
+ 
+ 		return md
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py	(revision 13020)
+@@ -85,7 +85,7 @@
+ 			data[count:count+numpairsforthisrift-1,11]=self.riftstruct[i]['state']
+ 			count+=numpairsforthisrift
+ 
+-		WriteData(fid,'data',numrifts,'enum',RiftsNumriftsEnum,'format','Integer')
+-		WriteData(fid,'data',data,'enum',RiftsRiftstructEnum,'format','DoubleMat','mattype',3)
++		WriteData(fid,'data',numrifts,'enum',RiftsNumriftsEnum(),'format','Integer')
++		WriteData(fid,'data',data,'enum',RiftsRiftstructEnum(),'format','DoubleMat','mattype',3)
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py	(revision 13020)
+@@ -109,7 +109,7 @@
+ 		string="%s%s"%(string,"\n      Projection:")
+ 		string="%s\n%s"%(string,fielddisplay(self,"lat","vertices latitude"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"long","vertices longitude"))
+-		string="%s\n%s"%(string,fielddisplay(self,"hemisphere","Indicate hemisphere ""n"" or ""s"" "))
++		string="%s\n%s"%(string,fielddisplay(self,"hemisphere","Indicate hemisphere 'n' or 's'"))
+ 		return string
+ 		#}}}
+ 		
+@@ -154,22 +154,22 @@
+ 		md = checkfield(md,'mesh.elementconnectivity','size',[md.mesh.numberofelements,3],'NaN',1)
+ 
+ 		#Solution specific checks
+-		if   solution==PrognosticSolutionEnum:
++		if   solution==PrognosticSolutionEnum():
+ 			if md.prognostic.stabilization==3:
+ 				md = checkfield(md,'mesh.dimension','values',2,'message',"Discontinuous Galerkin only supported for 2d meshes")
+ 				md = checkfield(md,'mesh.edges','size',[float('NaN'),4])
+ 				md = checkfield(md,'mesh.edges[:,1:3]','>',0)
+-		elif solution==BalancethicknessSolutionEnum:
++		elif solution==BalancethicknessSolutionEnum():
+ 			if md.balancethickness.stabilization==3:
+ 				md = checkfield(md,'mesh.dimension','values',2,'message',"Discontinuous Galerkin only supported for 2d meshes")
+ 				md = checkfield(md,'mesh.edges','size',[float('NaN'),4])
+ 				md = checkfield(md,'mesh.edges[:,1:3]','>',0)
+-		elif solution==TransientSolutionEnum:
++		elif solution==TransientSolutionEnum():
+ 			if md.transient.isprognostic and md.prognostic.stabilization==3:
+ 				md = checkfield(md,'mesh.dimension','values',2,'message',"Discontinuous Galerkin only supported for 2d meshes")
+ 				md = checkfield(md,'mesh.edges','size',[float('NaN'),4])
+ 				md = checkfield(md,'mesh.edges[:,1:3]','>',0)
+-		elif solution==ThermalSolutionEnum:
++		elif solution==ThermalSolutionEnum():
+ 			md = checkfield(md,'mesh.dimension','values',3,'message','thermal solution only supported on 3d meshes')
+ 
+ 		return md
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.m	(revision 13020)
+@@ -31,7 +31,7 @@
+ 			if any((obj.thickness-obj.surface+obj.bed)>10^-9),
+ 				md = checkmessage(md,['equality thickness=surface-bed violated']);
+ 			end 
+-			if solution==TransientSolutionEnum & md.transient.isgroundingline,
++			if solution==TransientSolutionEnum() & md.transient.isgroundingline,
+ 				md = checkfield(md,'geometry.bathymetry','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 			end
+ 		end % }}}
+@@ -46,10 +46,10 @@
+ 
+ 		end % }}}
+ 		function marshall(obj,fid) % {{{
+-			WriteData(fid,'data',obj.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum);
+-			WriteData(fid,'data',obj.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum);
+-			WriteData(fid,'data',obj.bed,'format','DoubleMat','mattype',1,'enum',BedEnum);
+-			WriteData(fid,'data',obj.bathymetry,'format','DoubleMat','mattype',1,'enum',BathymetryEnum);
++			WriteData(fid,'data',obj.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum());
++			WriteData(fid,'data',obj.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum());
++			WriteData(fid,'data',obj.bed,'format','DoubleMat','mattype',1,'enum',BedEnum());
++			WriteData(fid,'data',obj.bathymetry,'format','DoubleMat','mattype',1,'enum',BathymetryEnum());
+ 			WriteData(fid,'object',obj,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1);
+ 		end % }}}
+ 	end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.m	(revision 13020)
+@@ -42,11 +42,11 @@
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if (~ismember(ThermalAnalysisEnum,analyses) & ~ismember(EnthalpyAnalysisEnum,analyses)) | (solution==TransientSolutionEnum & md.transient.isthermal==0), return; end
++			if (~ismember(ThermalAnalysisEnum(),analyses) & ~ismember(EnthalpyAnalysisEnum(),analyses)) | (solution==TransientSolutionEnum() & md.transient.isthermal==0), return; end
+ 
+ 			md = checkfield(md,'thermal.stabilization','numel',1,'values',[0 1 2]);
+ 			md = checkfield(md,'thermal.spctemperature','forcing',1);
+-			if (ismember(EnthalpyAnalysisEnum,analyses) & md.thermal.isenthalpy & md.mesh.dimension==3),
++			if (ismember(EnthalpyAnalysisEnum(),analyses) & md.thermal.isenthalpy & md.mesh.dimension==3),
+ 			md = checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message','spctemperature should be below the adjusted melting point');
+ 			md = checkfield(md,'thermal.isenthalpy','numel',1,'values',[0 1]);
+ 			end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.m	(revision 13020)
+@@ -35,13 +35,13 @@
+ 				if isnan(md.geometry.bathymetry),
+ 					md = checkmessage(md,['requesting grounding line migration, but bathymetry is absent!']);
+ 				end
+-				pos=find(md.mask.vertexongroundedice); 
++				pos=find(md.mask.vertexongroundedice);
+ 				if any(abs(md.geometry.bed(pos)-md.geometry.bathymetry(pos))>10^-10),
+-					md = checkmessage(md,['bathymetry not equal to bed on grounded ice !']);
++					md = checkmessage(md,['bathymetry not equal to bed on grounded ice!']);
+ 				end
+-				pos=find(md.mask.vertexonfloatingice); 
++				pos=find(md.mask.vertexonfloatingice);
+ 				if any(md.geometry.bathymetry(pos)-md.geometry.bed(pos)>10^-9),
+-					md = checkmessage(md,['bathymetry superior to bed on floating ice !']);
++					md = checkmessage(md,['bathymetry superior to bed on floating ice!']);
+ 				end
+ 			end
+ 
+@@ -54,7 +54,7 @@
+ 
+ 		end % }}}
+ 		function marshall(obj,fid) % {{{
+-			WriteData(fid,'data',StringToEnum(obj.migration),'enum',GroundinglineMigrationEnum,'format','Integer');
++			WriteData(fid,'data',StringToEnum(obj.migration),'enum',GroundinglineMigrationEnum(),'format','Integer');
+ 			WriteData(fid,'object',obj,'fieldname','melting_rate','format','Double');
+ 		end % }}}
+ 	end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py	(revision 13020)
+@@ -40,7 +40,7 @@
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		#Early return
+-		if not DiagnosticHorizAnalysisEnum in analyses and not ThermalAnalysisEnum in analyses:
++		if not DiagnosticHorizAnalysisEnum() in analyses and not ThermalAnalysisEnum() in analyses:
+ 			return md
+ 
+ 		md = checkfield(md,'friction.coefficient','NaN',1,'size',[md.mesh.numberofvertices])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.m	(revision 13020)
+@@ -19,8 +19,8 @@
+ 			 end % }}}
+ 		 function obj = addoptions(obj,analysis,varargin) % {{{
+ 		 % Usage example:
+-		 %    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum,stokesoptions());
+-		 %    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum);
++		 %    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum(),stokesoptions());
++		 %    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum());
+ 
+ 			 %Convert analysis from enum to string
+ 			 analysis=EnumToString(analysis);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.m	(revision 13020)
+@@ -24,7 +24,7 @@
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if ~ismember(DiagnosticHorizAnalysisEnum,analyses) & ~ismember(ThermalAnalysisEnum,analyses), return; end
++			if ~ismember(DiagnosticHorizAnalysisEnum(),analyses) & ~ismember(ThermalAnalysisEnum(),analyses), return; end
+ 
+ 			md = checkfield(md,'friction.coefficient','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 			md = checkfield(md,'friction.q','NaN',1,'size',[md.mesh.numberofelements 1]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 13020)
+@@ -27,7 +27,7 @@
+ 		self.thermal_exchange_velocity  = 0
+ 		self.rheology_B   = float('NaN')
+ 		self.rheology_n   = float('NaN')
+-		self.rheology_law = ""
++		self.rheology_law = ''
+ 
+ 		self.setdefaultparameters()
+ 		#}}}
+@@ -46,8 +46,8 @@
+ 		string="%s\n%s"%(string,fielddisplay(self,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa/s^(1/n)]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen""s flow law exponent"))
+-		string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: ""None"", ""Paterson"" or ""Arrhenius"""))
++		string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent"))
++		string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'Paterson' or 'Arrhenius'"))
+ 
+ 		return string
+ 		#}}}
+@@ -114,6 +114,6 @@
+ 		WriteData(fid,'object',self,'fieldname','thermal_exchange_velocity','format','Double')
+ 		WriteData(fid,'object',self,'fieldname','rheology_B','format','DoubleMat','mattype',1)
+ 		WriteData(fid,'object',self,'fieldname','rheology_n','format','DoubleMat','mattype',2)
+-		WriteData(fid,'data',StringToEnum(self.rheology_law),'enum',MaterialsRheologyLawEnum,'format','Integer')
++		WriteData(fid,'data',StringToEnum(self.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer')
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.m	(revision 13020)
+@@ -37,7 +37,7 @@
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if ~ismember(HydrologyAnalysisEnum,analyses), return; end
++			if ~ismember(HydrologyAnalysisEnum(),analyses), return; end
+ 
+ 			md = checkfield(md,'hydrology.spcwatercolumn','forcing',1);
+ 			md = checkfield(md,'hydrology.stabilization','>=',0);
+@@ -56,7 +56,7 @@
+ 		end % }}}
+ 		function marshall(obj,fid) % {{{
+ 			WriteData(fid,'object',obj,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1);
+-			WriteData(fid,'object',obj,'fieldname','n','format','Double'); 
++			WriteData(fid,'object',obj,'fieldname','n','format','Double');
+ 			WriteData(fid,'object',obj,'fieldname','CR','format','Double');
+ 			WriteData(fid,'object',obj,'fieldname','p','format','Double');
+ 			WriteData(fid,'object',obj,'fieldname','q','format','Double');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13020)
+@@ -1,7 +1,19 @@
+ #module imports
++import numpy
++import sys
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class diagnostic(object):
++	"""
++	DIAGNOSTIC class definition
++
++	   Usage:
++	      diagnostic=diagnostic();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -28,72 +40,152 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		
+-		
+ 		string='\n   Diagnostic solution parameters:'
+ 		string="%s\n\n%s"%(string,'      Convergence criteria:')
+ 			
+-		string="%s\n%s"%(string,fielddisplay(obj,'restol','mechanical equilibrium residual convergence criterion'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'reltol','velocity relative convergence criterion, NaN -> not applied'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'abstol','velocity absolute convergence criterion, NaN -> not applied'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'isnewton','Apply Newton''s method instead of a Picard fixed point method'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'maxiter','maximum number of nonlinear iterations'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'viscosity_overshoot','over-shooting constant new=new+C*(new-old)'))
++		string="%s\n%s"%(string,fielddisplay(self,'restol','mechanical equilibrium residual convergence criterion'))
++		string="%s\n%s"%(string,fielddisplay(self,'reltol','velocity relative convergence criterion, NaN -> not applied'))
++		string="%s\n%s"%(string,fielddisplay(self,'abstol','velocity absolute convergence criterion, NaN -> not applied'))
++		string="%s\n%s"%(string,fielddisplay(self,'isnewton',"Apply Newton's method instead of a Picard fixed point method"))
++		string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of nonlinear iterations'))
++		string="%s\n%s"%(string,fielddisplay(self,'viscosity_overshoot','over-shooting constant new=new+C*(new-old)'))
+ 
+ 		string="%s\n%s"%(string,'      boundary conditions:')
+ 
+-		string="%s\n%s"%(string,fielddisplay(obj,'spcvx','x-axis velocity constraint (NaN means no constraint)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'spcvy','y-axis velocity constraint (NaN means no constraint)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'spcvz','z-axis velocity constraint (NaN means no constraint)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'icefront','segments on ice front list (last column 0-> Air, 1-> Water, 2->Ice'))
++		string="%s\n%s"%(string,fielddisplay(self,'spcvx','x-axis velocity constraint (NaN means no constraint)'))
++		string="%s\n%s"%(string,fielddisplay(self,'spcvy','y-axis velocity constraint (NaN means no constraint)'))
++		string="%s\n%s"%(string,fielddisplay(self,'spcvz','z-axis velocity constraint (NaN means no constraint)'))
++		string="%s\n%s"%(string,fielddisplay(self,'icefront','segments on ice front list (last column 0-> Air, 1-> Water, 2->Ice'))
+ 
+ 		string="%s\n%s"%(string,'      Rift options:')
+-		string="%s\n%s"%(string,fielddisplay(obj,'rift_penalty_threshold','threshold for instability of mechanical constraints'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'rift_penalty_lock','number of iterations before rift penalties are locked'))
++		string="%s\n%s"%(string,fielddisplay(self,'rift_penalty_threshold','threshold for instability of mechanical constraints'))
++		string="%s\n%s"%(string,fielddisplay(self,'rift_penalty_lock','number of iterations before rift penalties are locked'))
+ 
+ 		string="%s\n%s"%(string,'      Penalty options:')
+-		string="%s\n%s"%(string,fielddisplay(obj,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'vertex_pairing','pairs of vertices that are penalized'))
++		string="%s\n%s"%(string,fielddisplay(self,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset'))
++		string="%s\n%s"%(string,fielddisplay(self,'vertex_pairing','pairs of vertices that are penalized'))
+ 
+ 		string="%s\n%s"%(string,'      Other:')
+-		string="%s\n%s"%(string,fielddisplay(obj,'shelf_dampening','use dampening for floating ice ? Only for Stokes model'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'stokesreconditioning','multiplier for incompressibility equation. Only for Stokes model'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'referential','local referential'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'requested_outputs','additional outputs requested'))
++		string="%s\n%s"%(string,fielddisplay(self,'shelf_dampening','use dampening for floating ice ? Only for Stokes model'))
++		string="%s\n%s"%(string,fielddisplay(self,'stokesreconditioning','multiplier for incompressibility equation. Only for Stokes model'))
++		string="%s\n%s"%(string,fielddisplay(self,'referential','local referential'))
++		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
+ 
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		#maximum of non-linear iterations.
+-		obj.maxiter=100
++		self.maxiter=100
+ 
+ 		#Convergence criterion: absolute, relative and residual
+-		obj.restol=10**-4;
+-		obj.reltol=0.01
+-		obj.abstol=10
++		self.restol=10**-4
++		self.reltol=0.01
++		self.abstol=10
+ 
+-		obj.stokesreconditioning=10**13
+-		obj.shelf_dampening=0
++		self.stokesreconditioning=10**13
++		self.shelf_dampening=0
+ 
+ 		#Penalty factor applied kappa=max(stiffness matrix)*10^penalty_factor
+-		obj.penalty_factor=3
++		self.penalty_factor=3
+ 
+ 		#coefficient to update the viscosity between each iteration of
+ 		#a diagnostic according to the following formula
+ 		#viscosity(n)=viscosity(n)+viscosity_overshoot(viscosity(n)-viscosity(n-1))
+-		obj.viscosity_overshoot=0
++		self.viscosity_overshoot=0
+ 
+ 		#Stop the iterations of rift if below a threshold
+-		obj.rift_penalty_threshold=0
++		self.rift_penalty_threshold=0
+ 
+ 		#in some solutions, it might be needed to stop a run when only
+ 		#a few constraints remain unstable. For thermal computation, this
+ 		#parameter is often used.
+-		obj.rift_penalty_lock=10
++		self.rift_penalty_lock=10
+ 
+-		return obj
++		return self
+ 	#}}}
++
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		#Early return
++		if not DiagnosticHorizAnalysisEnum() in analyses:
++			return md
++		#if (not DiagnosticHorizAnalysisEnum() in analyses) | (solution==TransientSolutionEnum() and not md.transient.isdiagnostic):
++		#	return md
++
++		md = checkfield(md,'diagnostic.spcvx','forcing',1)
++		md = checkfield(md,'diagnostic.spcvy','forcing',1)
++		if md.mesh.dimension==3:
++			md = checkfield(md,'diagnostic.spcvz','forcing',1)
++		md = checkfield(md,'diagnostic.restol','size',[1],'>',0)
++		md = checkfield(md,'diagnostic.reltol','size',[1])
++		md = checkfield(md,'diagnostic.abstol','size',[1])
++		md = checkfield(md,'diagnostic.isnewton','numel',1,'values',[0,1])
++		md = checkfield(md,'diagnostic.stokesreconditioning','size',[1,1],'NaN',1)
++		md = checkfield(md,'diagnostic.viscosity_overshoot','size',[1,1],'NaN',1)
++		if md.mesh.dimension==2:
++			md = checkfield(md,'diagnostic.icefront','size',[float('NaN'),4],'NaN',1)
++		else:
++			md = checkfield(md,'diagnostic.icefront','size',[float('NaN'),6],'NaN',1)
++		md = checkfield(md,'diagnostic.icefront[:,-1]','values',[0,1,2])
++		md = checkfield(md,'diagnostic.maxiter','size',[1],'>=',1)
++		md = checkfield(md,'diagnostic.referential','size',[md.mesh.numberofvertices,6])
++		if not md.diagnostic.requested_outputs:
++			md = checkfield(md,'diagnostic.requested_outputs','size',[float('NaN'),1])
++
++		#singular solution
++		#if ~any((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy))==2),
++		if not any((numpy.logical_not(numpy.isnan(md.diagnostic.spcvx))+numpy.logical_not(numpy.isnan(md.diagnostic.spcvy)))==2):
++			md.checkmessage("model is not well posed (singular). You need at least one node with fixed velocity!")
++		#CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
++		if any(not numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==0 and not numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==6):
++			md.checkmessage("Each line of diagnostic.referential should contain either only NaN values or no NaN values")
++		#CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
++		if any(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==0):
++			pos=[i for i,item in enumerate(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)) if item==0]
++#			numpy.inner (and numpy.dot) calculate all the dot product permutations, resulting in a full matrix multiply
++#			if any(numpy.abs(numpy.inner(md.diagnostic.referential[pos,0:2],md.diagnostic.referential[pos,3:5]).diagonal())>sys.float_info.epsilon):
++#				md.checkmessage("Vectors in diagnostic.referential (columns 1 to 3 and 4 to 6) must be orthogonal")
++			for item in md.diagnostic.referential[pos,:]:
++				if numpy.abs(numpy.inner(item[0:2],item[3:5]))>sys.float_info.epsilon:
++					md.checkmessage("Vectors in diagnostic.referential (columns 1 to 3 and 4 to 6) must be orthogonal")
++		#CHECK THAT NO rotation specified for FS Grounded ice at base
++		if md.mesh.dimension==3 and md.flowequation.isstokes:
++			pos=numpy.nonzero(numpy.logical_and(md.mask.vertexongroundedice,md.mesh.vertexonbed))
++			if any(not numpy.isnan(md.diagnostic.referential[pos,:])):
++				md.checkmessage("no referential should be specified for basal vertices of grounded ice")
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','spcvx','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','spcvy','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','spcvz','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','restol','format','Double')
++		WriteData(fid,'object',self,'fieldname','reltol','format','Double')
++		WriteData(fid,'object',self,'fieldname','abstol','format','Double')
++		WriteData(fid,'object',self,'fieldname','isnewton','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','stokesreconditioning','format','Double')
++		WriteData(fid,'object',self,'fieldname','viscosity_overshoot','format','Double')
++		WriteData(fid,'object',self,'fieldname','maxiter','format','Integer')
++		WriteData(fid,'object',self,'fieldname','shelf_dampening','format','Integer')
++		WriteData(fid,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3)
++		WriteData(fid,'object',self,'fieldname','penalty_factor','format','Double')
++		WriteData(fid,'object',self,'fieldname','rift_penalty_lock','format','Integer')
++		WriteData(fid,'object',self,'fieldname','rift_penalty_threshold','format','Integer')
++		WriteData(fid,'object',self,'fieldname','referential','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','requested_outputs','format','DoubleMat','mattype',3)
++
++		#marshall ice front
++		data=self.icefront
++		data[[i for i,item in enumerate(data[:,-1]) if item==0],-1]=AirEnum()
++		data[[i for i,item in enumerate(data[:,-1]) if item==1],-1]=WaterEnum()
++		data[[i for i,item in enumerate(data[:,-1]) if item==2],-1]=IceEnum()
++		WriteData(fid,'data',data,'enum',DiagnosticIcefrontEnum(),'format','DoubleMat','mattype',3)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.m	(revision 13020)
+@@ -109,7 +109,7 @@
+ 			WriteData(fid,'object',obj,'fieldname','thermal_exchange_velocity','format','Double');
+ 			WriteData(fid,'object',obj,'fieldname','rheology_B','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','rheology_n','format','DoubleMat','mattype',2);
+-			WriteData(fid,'data',StringToEnum(obj.rheology_law),'enum',MaterialsRheologyLawEnum,'format','Integer');
++			WriteData(fid,'data',StringToEnum(obj.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer');
+ 		end % }}}
+ 	end
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py	(revision 13020)
+@@ -52,40 +52,40 @@
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+-		if DiagnosticHorizAnalysisEnum in analyses:
++		if DiagnosticHorizAnalysisEnum() in analyses:
+ 			if not any(numpy.isnan(md.initialization.vx) or numpy.isnan(md.initialization.vy)):
+ 				md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
+ 				md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices])
+-		if PrognosticAnalysisEnum in analyses:
++		if PrognosticAnalysisEnum() in analyses:
+ 			md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
+ 			md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices])
+-		if HydrologyAnalysisEnum in analyses:
++		if HydrologyAnalysisEnum() in analyses:
+ 			md = checkfield(md,'initialization.watercolumn','NaN',1,'size',[md.mesh.numberofvertices])
+-		if BalancethicknessAnalysisEnum in analyses:
++		if BalancethicknessAnalysisEnum() in analyses:
+ 			md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
+ 			md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices])
+ 			#Triangle with zero velocity
+ 			if any(numpy.logical_and(numpy.sum(numpy.abs(md.initialization.vx[md.mesh.elements.astype(int)-1]),axis=1)==0,\
+ 			                         numpy.sum(numpy.abs(md.initialization.vy[md.mesh.elements.astype(int)-1]),axis=1)==0)):
+ 				md.checkmessage("at least one triangle has all its vertices with a zero velocity")
+-		if ThermalAnalysisEnum in analyses:
++		if ThermalAnalysisEnum() in analyses:
+ 			md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
+ 			md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices])
+ 			md = checkfield(md,'initialization.vz','NaN',1,'size',[md.mesh.numberofvertices])
+ 			md = checkfield(md,'initialization.pressure','NaN',1,'size',[md.mesh.numberofvertices])
+-		if (EnthalpyAnalysisEnum in analyses and md.thermal.isenthalpy) or solution==EnthalpySolutionEnum:
++		if (EnthalpyAnalysisEnum() in analyses and md.thermal.isenthalpy) or solution==EnthalpySolutionEnum():
+ 			md = checkfield(md,'initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices])
+ 
+ 		return md
+ 	# }}}
+ 
+ 	def marshall(self,fid):    # {{{
+-		WriteData(fid,'data',self.vx,'format','DoubleMat','mattype',1,'enum',VxEnum)
+-		WriteData(fid,'data',self.vy,'format','DoubleMat','mattype',1,'enum',VyEnum)
+-		WriteData(fid,'data',self.vz,'format','DoubleMat','mattype',1,'enum',VzEnum)
+-		WriteData(fid,'data',self.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum)
+-		WriteData(fid,'data',self.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum)
+-		WriteData(fid,'data',self.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum)
+-		WriteData(fid,'data',self.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum)
++		WriteData(fid,'data',self.vx,'format','DoubleMat','mattype',1,'enum',VxEnum())
++		WriteData(fid,'data',self.vy,'format','DoubleMat','mattype',1,'enum',VyEnum())
++		WriteData(fid,'data',self.vz,'format','DoubleMat','mattype',1,'enum',VzEnum())
++		WriteData(fid,'data',self.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum())
++		WriteData(fid,'data',self.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum())
++		WriteData(fid,'data',self.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum())
++		WriteData(fid,'data',self.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum())
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py	(revision 13020)
+@@ -1,7 +1,17 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class prognostic(object):
++	"""
++	PROGNOSTIC class definition
++
++	   Usage:
++	      prognostic=prognostic();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -16,32 +26,55 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   Prognostic solution parameters:'
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'spcthickness','thickness constraints (NaN means no constraint)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'min_thickness','minimum ice thickness allowed'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'hydrostatic_adjustment','adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' '))
+-		string="%s\n%s"%(string,fielddisplay(obj,'stabilization','0->no, 1->artificial_diffusivity, 2->streamline upwinding, 3->discontinuous Galerkin'))
++		string="%s\n\n%s"%(string,fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint)'))
++		string="%s\n%s"%(string,fielddisplay(self,'min_thickness','minimum ice thickness allowed'))
++		string="%s\n%s"%(string,fielddisplay(self,'hydrostatic_adjustment','adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' '))
++		string="%s\n%s"%(string,fielddisplay(self,'stabilization','0->no, 1->artificial_diffusivity, 2->streamline upwinding, 3->discontinuous Galerkin'))
+ 
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
+-		obj.stabilization=1
++		self.stabilization=1
+ 
+ 		#Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor
+-		obj.penalty_factor=3
++		self.penalty_factor=3
+ 
+ 		#Minimum ice thickness that can be used
+-		obj.min_thickness=1
++		self.min_thickness=1
+ 
+ 		#Hydrostatic adjustment
+-		obj.hydrostatic_adjustment='Absolute'
++		self.hydrostatic_adjustment='Absolute'
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		#Early return
++		if (not PrognosticAnalysisEnum() in analyses) or (solution==TransientSolutionEnum() and not md.transient.isprognostic):
++			return md
++
++		md = checkfield(md,'prognostic.spcthickness','forcing',1)
++		md = checkfield(md,'prognostic.hydrostatic_adjustment','values',['Absolute','Incremental'])
++		md = checkfield(md,'prognostic.stabilization','values',[0,1,2,3])
++		md = checkfield(md,'prognostic.min_thickness','>',0)
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','min_thickness','format','Double')
++		WriteData(fid,'data',StringToEnum(self.hydrostatic_adjustment),'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum())
++		WriteData(fid,'object',self,'fieldname','stabilization','format','Integer')
++		WriteData(fid,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3)
++		WriteData(fid,'object',self,'fieldname','penalty_factor','format','Double')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/steadystate.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/steadystate.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/steadystate.m	(revision 13020)
+@@ -28,7 +28,7 @@
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if solution~=SteadystateSolutionEnum, return; end;
++			if solution~=SteadystateSolutionEnum(), return; end;
+ 
+ 			if md.timestepping.time_step~=0,
+ 				md = checkmessage(md,['for a steadystate computation, timestepping.time_step must be zero.']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m	(revision 13020)
+@@ -99,25 +99,25 @@
+ 
+ 			%Solution specific checks
+ 			switch(solution),
+-				case PrognosticSolutionEnum,
++				case PrognosticSolutionEnum(),
+ 					if md.prognostic.stabilization==3,
+ 						md = checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes');
+ 						md = checkfield(md,'mesh.edges','size',[NaN 4]);
+ 						md = checkfield(md,'mesh.edges(:,1:3)','>',0);
+ 					end
+-				case BalancethicknessSolutionEnum,
++				case BalancethicknessSolutionEnum(),
+ 					if md.balancethickness.stabilization==3,
+ 						md = checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes');
+ 						md = checkfield(md,'mesh.edges','size',[NaN 4]);
+ 						md = checkfield(md,'mesh.edges(:,1:3)','>',0);
+ 					end
+-				case TransientSolutionEnum,
++				case TransientSolutionEnum(),
+ 					if md.transient.isprognostic & md.prognostic.stabilization==3,
+ 						md = checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes');
+ 						md = checkfield(md,'mesh.edges','size',[NaN 4]);
+ 						md = checkfield(md,'mesh.edges(:,1:3)','>',0);
+ 					end
+-				case ThermalSolutionEnum,
++				case ThermalSolutionEnum(),
+ 					md = checkfield(md,'mesh.dimension','values',3,'message','thermal solution only supported on 3d meshes');
+ 			end
+ 		end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py	(revision 13020)
+@@ -124,6 +124,6 @@
+ 	# }}}
+ 
+ 	def marshall(self,fid):    # {{{
+-			WriteData(fid,'data',VerboseToBinary(self),'enum',VerboseEnum,'format','Integer')
++			WriteData(fid,'data',VerboseToBinary(self),'enum',VerboseEnum(),'format','Integer')
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.m	(revision 13020)
+@@ -119,7 +119,7 @@
+ 		end
+ 		%}}}
+ 		function marshall(obj,fid) % {{{
+-			WriteData(fid,'data',VerboseToBinary(obj),'enum',VerboseEnum,'format','Integer');
++			WriteData(fid,'data',VerboseToBinary(obj),'enum',VerboseEnum(),'format','Integer');
+ 		end % }}}
+ 	end
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13020)
+@@ -1046,9 +1046,9 @@
+ 			 md.settings         = settings();
+ 			 md.solver           = solver();
+ 			 if ismumps,
+-				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,mumpsoptions);
++				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum(),mumpsoptions);
+ 			 else
+-				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,iluasmoptions);
++				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum(),iluasmoptions);
+ 			 end
+ 			 md.cluster          = generic();
+ 			 md.balancethickness = balancethickness();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py	(revision 13020)
+@@ -25,8 +25,8 @@
+ 
+ 	def addoptions(self,analysis,*args):    # {{{
+ 		# Usage example:
+-		#    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum,stokesoptions());
+-		#    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum);
++		#    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum(),stokesoptions());
++		#    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum());
+ 
+ 		#Convert analysis from enum to string
+ #		need EnumToString
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.m	(revision 13020)
+@@ -32,7 +32,7 @@
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if solution~=TransientSolutionEnum, return; end
++			if solution~=TransientSolutionEnum(), return; end
+ 
+ 			md = checkfield(md,'transient.isprognostic','numel',1,'values',[0 1]);
+ 			md = checkfield(md,'transient.isdiagnostic','numel',1,'values',[0 1]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m	(revision 13020)
+@@ -43,7 +43,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+-			if ismember(PrognosticAnalysisEnum,analyses),
++			if ismember(PrognosticAnalysisEnum(),analyses),
+ 				md = checkfield(md,'surfaceforcings.ispdd','numel',1,'values',[0 1]);
+ 				md = checkfield(md,'surfaceforcings.issmbgradients','numel',1,'values',[0 1]);
+ 				if(obj.ispdd)
+@@ -69,7 +69,7 @@
+ 					md = checkfield(md,'surfaceforcings.mass_balance','forcing',1,'NaN',1);
+ 				end
+ 			end
+-			if ismember(BalancethicknessAnalysisEnum,analyses),
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
+ 				md = checkfield(md,'surfaceforcings.mass_balance','size',[md.mesh.numberofvertices 1],'NaN',1);
+ 			end
+ 		end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.m	(revision 13020)
+@@ -66,8 +66,8 @@
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if ~ismember(DiagnosticHorizAnalysisEnum,analyses), return; end
+-			%if ~ismember(DiagnosticHorizAnalysisEnum,analyses) |  (solution==TransientSolutionEnum & md.transient.isdiagnostic==0), return; end
++			if ~ismember(DiagnosticHorizAnalysisEnum(),analyses), return; end
++			%if ~ismember(DiagnosticHorizAnalysisEnum(),analyses) |  (solution==TransientSolutionEnum() & md.transient.isdiagnostic==0), return; end
+ 
+ 			md = checkfield(md,'diagnostic.spcvx','forcing',1);
+ 			md = checkfield(md,'diagnostic.spcvy','forcing',1);
+@@ -101,8 +101,8 @@
+ 			%CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
+ 			if any(sum(isnan(md.diagnostic.referential),2)==0),
+ 				pos=find(sum(isnan(md.diagnostic.referential),2)==0);
+-				if any(abs(dot(md.diagnostic.referential(pos,1:3)',md.diagnostic.referential(pos,4:6)'))>eps),
+-					md = checkmessage(md,['Vectors in diagnostic.referential (colums 1 to 3 and 4 to 6) must be orthogonal']);
++				if any(abs(dot(md.diagnostic.referential(pos,1:3),md.diagnostic.referential(pos,4:6),2))>eps),
++					md = checkmessage(md,['Vectors in diagnostic.referential (columns 1 to 3 and 4 to 6) must be orthogonal']);
+ 				end
+ 			end
+ 			%CHECK THAT NO rotation specified for FS Grounded ice at base
+@@ -167,10 +167,10 @@
+ 
+ 			%marshall ice front
+ 			data=obj.icefront;
+-			pos=find(data(:,end)==0); data(pos,end)=AirEnum;
+-			pos=find(data(:,end)==1); data(pos,end)=WaterEnum;
+-			pos=find(data(:,end)==2); data(pos,end)=IceEnum;
+-			WriteData(fid,'data',data,'enum',DiagnosticIcefrontEnum,'format','DoubleMat','mattype',3);
++			pos=find(data(:,end)==0); data(pos,end)=AirEnum();
++			pos=find(data(:,end)==1); data(pos,end)=WaterEnum();
++			pos=find(data(:,end)==2); data(pos,end)=IceEnum();
++			WriteData(fid,'data',data,'enum',DiagnosticIcefrontEnum(),'format','DoubleMat','mattype',3);
+ 		end % }}}
+ 	end
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.m	(revision 13020)
+@@ -78,8 +78,8 @@
+ 				count=count+numpairsforthisrift;
+ 			end
+ 
+-			WriteData(fid,'data',numrifts,'enum',RiftsNumriftsEnum,'format','Integer');
+-			WriteData(fid,'data',data,'enum',RiftsRiftstructEnum,'format','DoubleMat','mattype',3);
++			WriteData(fid,'data',numrifts,'enum',RiftsNumriftsEnum(),'format','Integer');
++			WriteData(fid,'data',data,'enum',RiftsRiftstructEnum(),'format','DoubleMat','mattype',3);
+ 		end % }}}
+ 	end
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py	(revision 13020)
+@@ -51,17 +51,17 @@
+ 		if any((self.thickness-self.surface+self.bed)>10**-9):
+ 			md.checkmessage("equality thickness=surface-bed violated")
+ 		end 
+-		if solution==TransientSolutionEnum and md.transient.isgroundingline:
++		if solution==TransientSolutionEnum() and md.transient.isgroundingline:
+ 			md = checkfield(md,'geometry.bathymetry','NaN',1,'size',[md.mesh.numberofvertices])
+ 
+ 		return md
+ 	# }}}
+ 
+ 	def marshall(self,fid):    # {{{
+-		WriteData(fid,'data',self.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum)
+-		WriteData(fid,'data',self.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum)
+-		WriteData(fid,'data',self.bed,'format','DoubleMat','mattype',1,'enum',BedEnum)
+-		WriteData(fid,'data',self.bathymetry,'format','DoubleMat','mattype',1,'enum',BathymetryEnum)
++		WriteData(fid,'data',self.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum())
++		WriteData(fid,'data',self.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum())
++		WriteData(fid,'data',self.bed,'format','DoubleMat','mattype',1,'enum',BedEnum())
++		WriteData(fid,'data',self.bathymetry,'format','DoubleMat','mattype',1,'enum',BathymetryEnum())
+ 		WriteData(fid,'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1)
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.py	(revision 13020)
+@@ -39,13 +39,13 @@
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+-		if PrognosticAnalysisEnum in analyses and not (solution==TransientSolutionEnum and not md.transient.isprognostic):
++		if PrognosticAnalysisEnum() in analyses and not (solution==TransientSolutionEnum() and not md.transient.isprognostic):
+ 			md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1)
+ 
+-		if BalancethicknessAnalysisEnum in analyses:
++		if BalancethicknessAnalysisEnum() in analyses:
+ 			md = checkfield(md,'basalforcings.melting_rate','NaN',1,'size',[md.mesh.numberofvertices])
+ 
+-		if ThermalAnalysisEnum in analyses and not (solution==TransientSolutionEnum and not md.transient.isthermal):
++		if ThermalAnalysisEnum() in analyses and not (solution==TransientSolutionEnum() and not md.transient.isthermal):
+ 			md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1)
+ 			md = checkfield(md,'basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0)
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 13020)
+@@ -52,7 +52,7 @@
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+-		if DiagnosticHorizAnalysisEnum in analyses:
++		if DiagnosticHorizAnalysisEnum() in analyses:
+ 			md = checkfield(md,'flowequation.ismacayealpattyn','numel',1,'values',[0,1])
+ 			md = checkfield(md,'flowequation.ishutter','numel',1,'values',[0,1])
+ 			md = checkfield(md,'flowequation.isstokes','numel',1,'values',[0,1])
+@@ -68,7 +68,7 @@
+ 			if not (md.flowequation.ismacayealpattyn or md.flowequation.ishutter or md.flowequation.isstokes):
+ 				md.checkmessage("no element types set for this model. At least one of ismacayealpattyn, ishutter or isstokes need to be =1")
+ 
+-		if DiagnosticHutterAnalysisEnum in analyses:
++		if DiagnosticHutterAnalysisEnum() in analyses:
+ 			if any(md.flowequation.element_equation==1):
+ 				if any(numpy.logical_and(md.flowequation.element_equation,md.mask.elementonfloatingice)):
+ 					print "\n !!! Warning: Hutter's model is not consistent on ice shelves !!!\n"
+@@ -85,24 +85,24 @@
+ 		WriteData(fid,'object',self,'fieldname','borderstokes','format','DoubleMat','mattype',1)
+ 		#convert approximations to enums
+ 		data=self.vertex_equation
+-		data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==1]]=HutterApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==2]]=MacAyealApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==3]]=PattynApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==4]]=StokesApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum
+-		WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum,'format','DoubleMat','mattype',1)
++		data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==1]]=HutterApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==2]]=MacAyealApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==3]]=PattynApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==4]]=StokesApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum()
++		WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1)
+ 		data=self.element_equation
+-		data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==1]]=HutterApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==2]]=MacAyealApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==3]]=PattynApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==4]]=StokesApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum
+-		data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum
+-		WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum,'format','DoubleMat','mattype',2)
++		data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==1]]=HutterApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==2]]=MacAyealApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==3]]=PattynApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==4]]=StokesApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum()
++		WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2)
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/basalforcings.m	(revision 13020)
+@@ -23,13 +23,13 @@
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+-			if ismember(PrognosticAnalysisEnum,analyses) & ~(solution==TransientSolutionEnum & md.transient.isprognostic==0),
++			if ismember(PrognosticAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.isprognostic==0),
+ 				md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1);
+ 			end
+-			if ismember(BalancethicknessAnalysisEnum,analyses),
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
+ 				md = checkfield(md,'basalforcings.melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 			end
+-			if ismember(ThermalAnalysisEnum,analyses) & ~(solution==TransientSolutionEnum & md.transient.isthermal==0),
++			if ismember(ThermalAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.isthermal==0),
+ 				md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1);
+ 				md = checkfield(md,'basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0);
+ 			end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m	(revision 13019)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m	(revision 13020)
+@@ -28,7 +28,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+-			if ismember(DiagnosticHorizAnalysisEnum,analyses),
++			if ismember(DiagnosticHorizAnalysisEnum(),analyses),
+ 
+ 				md = checkfield(md,'flowequation.ismacayealpattyn','numel',1,'values',[0 1]);
+ 				md = checkfield(md,'flowequation.ishutter','numel',1,'values',[0 1]);
+@@ -47,7 +47,7 @@
+ 					md = checkmessage(md,['no element types set for this model. At least one of ismacayealpattyn, ishutter or isstokes need to be =1']);
+ 				end
+ 			end
+-			if ismember(DiagnosticHutterAnalysisEnum,analyses),
++			if ismember(DiagnosticHutterAnalysisEnum(),analyses),
+ 				if any(md.flowequation.element_equation==1),
+ 					if(md.flowequation.element_equation & md.mask.elementonfloatingice),
+ 						disp(sprintf('\n !!! Warning: Hutter''s model is not consistent on ice shelves !!!\n'));
+@@ -78,25 +78,25 @@
+ 			WriteData(fid,'object',obj,'fieldname','borderstokes','format','DoubleMat','mattype',1);
+ 			%convert approximations to enums
+ 			data=obj.vertex_equation;
+-			pos=find(data==0); data(pos,end)=NoneApproximationEnum;
+-			pos=find(data==1); data(pos,end)=HutterApproximationEnum;
+-			pos=find(data==2); data(pos,end)=MacAyealApproximationEnum;
+-			pos=find(data==3); data(pos,end)=PattynApproximationEnum;
+-			pos=find(data==4); data(pos,end)=StokesApproximationEnum;
+-			pos=find(data==5); data(pos,end)=MacAyealPattynApproximationEnum;
+-			pos=find(data==6); data(pos,end)=MacAyealStokesApproximationEnum;
+-			pos=find(data==7); data(pos,end)=PattynStokesApproximationEnum;
+-			WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum,'format','DoubleMat','mattype',1);
++			pos=find(data==0); data(pos,end)=NoneApproximationEnum();
++			pos=find(data==1); data(pos,end)=HutterApproximationEnum();
++			pos=find(data==2); data(pos,end)=MacAyealApproximationEnum();
++			pos=find(data==3); data(pos,end)=PattynApproximationEnum();
++			pos=find(data==4); data(pos,end)=StokesApproximationEnum();
++			pos=find(data==5); data(pos,end)=MacAyealPattynApproximationEnum();
++			pos=find(data==6); data(pos,end)=MacAyealStokesApproximationEnum();
++			pos=find(data==7); data(pos,end)=PattynStokesApproximationEnum();
++			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)=HutterApproximationEnum;
+-			pos=find(data==2); data(pos,end)=MacAyealApproximationEnum;
+-			pos=find(data==3); data(pos,end)=PattynApproximationEnum;
+-			pos=find(data==4); data(pos,end)=StokesApproximationEnum;
+-			pos=find(data==5); data(pos,end)=MacAyealPattynApproximationEnum;
+-			pos=find(data==6); data(pos,end)=MacAyealStokesApproximationEnum;
+-			pos=find(data==7); data(pos,end)=PattynStokesApproximationEnum;
+-			WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum,'format','DoubleMat','mattype',2);
++			pos=find(data==0); data(pos,end)=NoneApproximationEnum();
++			pos=find(data==1); data(pos,end)=HutterApproximationEnum();
++			pos=find(data==2); data(pos,end)=MacAyealApproximationEnum();
++			pos=find(data==3); data(pos,end)=PattynApproximationEnum();
++			pos=find(data==4); data(pos,end)=StokesApproximationEnum();
++			pos=find(data==5); data(pos,end)=MacAyealPattynApproximationEnum();
++			pos=find(data==6); data(pos,end)=MacAyealStokesApproximationEnum();
++			pos=find(data==7); data(pos,end)=PattynStokesApproximationEnum();
++			WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2);
+ 		end % }}}
+ 	end
+ end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13020-13021.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13020-13021.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13020-13021.diff	(revision 13394)
@@ -0,0 +1,169 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test414.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test414.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test414.m	(revision 13021)
+@@ -48,7 +48,7 @@
+ 
+ %solve
+ md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+-md=tres(md,'dakota');
++md.qmu.results=md.results.dakota;
+ 
+ %Fields and tolerances to track changes
+ %ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test235.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test235.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test235.m	(revision 13021)
+@@ -55,7 +55,7 @@
+ 
+ %solve
+ md=solve(md,TransientSolutionEnum,'overwrite','y');
+-md=tres(md,'dakota');
++md.qmu.results=md.results.dakota;
+ 
+ %Fields and tolerances to track changes
+ md.results.dakota.importancefactors=[];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test218.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test218.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test218.m	(revision 13021)
+@@ -83,7 +83,7 @@
+ md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+ 
+ %Fields and tolerances to track changes
+-md=tres(md,'dakota');
++md.qmu.results=md.results.dakota;
+ md.results.dakota.importancefactors=importancefactors(md,'scaled_MaterialsRheologyB','MaxVel')';
+ field_names     ={'importancefactors'};
+ field_tolerances={1e-10};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test420.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test420.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test420.m	(revision 13021)
+@@ -32,7 +32,7 @@
+ 
+ %solve
+ md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+-md=tres(md,'dakota');
++md.qmu.results=md.results.dakota;
+ 
+ %test on thickness
+ h=zeros(md.qmu.numberofpartitions,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test412.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test412.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test412.m	(revision 13021)
+@@ -35,7 +35,7 @@
+ md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+ 
+ %Fields and tolerances to track changes
+-md=tres(md,'dakota');
++md.qmu.results=md.results.dakota;
+ md.results.dakota.importancefactors=importancefactors(md,'scaled_FrictionCoefficient','MaxVel')';
+ field_names     ={'importancefactors'};
+ field_tolerances={1e-10};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test511.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test511.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test511.m	(revision 13021)
+@@ -7,7 +7,7 @@
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ md=extrude(md,3,1);
+ md=setflowequation(md,'stokes','all');
+-md=modelextract(md,md.mask.elementonfloatingice);
++md=extract(md,md.mask.elementonfloatingice);
+ 
+ %control parameters
+ md.inversion.iscontrol=1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test413.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test413.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test413.m	(revision 13021)
+@@ -36,7 +36,7 @@
+ md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+ 
+ %Fields and tolerances to track changes
+-md=tres(md,'dakota');
++md.qmu.results=md.results.dakota;
+ md.results.dakota.importancefactors=importancefactors(md,'scaled_FrictionCoefficient','MaxVel')';
+ field_names     ={'importancefactors'};
+ field_tolerances={1e-10};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test234.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test234.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test234.m	(revision 13021)
+@@ -55,7 +55,7 @@
+ 
+ %solve
+ md=solve(md,TransientSolutionEnum,'overwrite','y');
+-md=tres(md,'dakota');
++md.qmu.results=md.results.dakota;
+ 
+ %Fields and tolerances to track changes
+ md.results.dakota.importancefactors=[];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test613.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test613.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test613.m	(revision 13021)
+@@ -5,7 +5,7 @@
+ md=setflowequation(md,'macayeal','all');
+ 
+ %Ice sheet only
+-md=modelextract(md,md.mask.elementongroundedice);
++md=extract(md,md.mask.elementongroundedice);
+ pos=find(md.mesh.vertexonboundary);
+ md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test417.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test417.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test417.m	(revision 13021)
+@@ -52,7 +52,7 @@
+ md=solve(md,DiagnosticSolutionEnum,'overwrite','y');
+ 
+ %Fields and tolerances to track changes
+-md=tres(md,'dakota');
++md.qmu.results=md.results.dakota;
+ 
+ %ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
+ %we recover those mass fluxes through the mean of the response.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/roundmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/roundmesh.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/roundmesh.m	(revision 13021)
+@@ -19,7 +19,7 @@
+ x_list=radius*x_list.*cos(theta);
+ y_list=radius*y_list.*sin(theta);
+ A=struct('x',x_list,'y',y_list,'density',1);
+-expwrite('RoundDomainOutline.exp',A);
++expwrite(A,'RoundDomainOutline.exp');
+ 
+ %Call Bamg
+ md=triangle(md,'RoundDomainOutline.exp',resolution);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.m	(revision 13021)
+@@ -16,7 +16,7 @@
+ 
+ fid=fopen(filename,'w');
+ for n=1:length(a),
+-	if(length(contours(n).x)~=length(contours(n).y)),
++	if(length(a(n).x)~=length(a(n).y)),
+ 		error('contours x and y coordinates must be of identical size');
+ 	end
+    
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/tres.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/tres.m	(revision 13020)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/hack/tres.m	(revision 13021)
+@@ -104,7 +104,7 @@
+ 		case FrictionCoefficientEnum(), string='drag_coefficient'; return
+ 		case MaterialsRheologyBEnum(), string='rheology_B'; return
+ 		case MaterialsRheologyBbarEnum(), string='rheology_B'; return
+-		case BalancethicknessThickeningRateEnum: string='dhdt'; return
++		case BalancethicknessThickeningRateEnum(), string='dhdt'; return
+ 		case VxEnum(), string='vx'; return
+ 		case InversionVxObsEnum(), string='vx_obs'; return
+ 		case VyEnum(), string='vy'; return
Index: /issm/oecreview/Archive/12678-13393/ISSM-13021-13022.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13021-13022.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13021-13022.diff	(revision 13394)
@@ -0,0 +1,4 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive423.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-13022-13023.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13022-13023.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13022-13023.diff	(revision 13394)
@@ -0,0 +1,835 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.py	(revision 13023)
+@@ -10,7 +10,7 @@
+ 	      ISSM_DIR=issmdir()
+ 	"""
+ 
+-	if not 'Windows' in platform.system():
++	if 'Windows' not in platform.system():
+ 		ISSM_DIR =os.environ['ISSM_DIR']
+ 	else:
+ 		ISSM_DIR =os.environ['ISSM_DIR_WIN']
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 13023)
+@@ -41,7 +41,7 @@
+ 	result=ReadData(fid)
+ 	while result:
+ 		#Get time and step
+-		if not result['step'] in results:
++		if result['step'] not in results:
+ 			results[result['step']]={}
+ 			results[result['step']]['step']=result['step']
+ 			results[result['step']]['time']=result['time'] 
+@@ -84,7 +84,7 @@
+ 	while result:
+ 
+ 		#Get time and step
+-		if not result['step'] in results:
++		if result['step'] not in results:
+ 			results[result['step']]={}
+ 			results[result['step']]['step']=result['step']
+ 			results[result['step']]['time']=result['time'] 
+@@ -123,7 +123,7 @@
+ 	while result:
+ 
+ 		#Get time and step
+-		if not result['step'] in results:
++		if result['step'] not in results:
+ 			results[result['step']]={}
+ 			results[result['step']]['step']=result['step']
+ 			results[result['step']]['time']=result['time'] 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py	(revision 13023)
+@@ -15,7 +15,7 @@
+ 
+ 	#solution_type: check on this option, error out otherwise
+ 	solution_type=options.getfieldvalue('solution_type')
+-	if not solution_type in (DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,\
++	if solution_type not in (DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,\
+ 			SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,\
+ 			BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum):
+ 		raise ValueError("process_solve_options error message: solution_type '%s' not supported yet!" % EnumToString(solution_type))
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.py	(revision 13023)
+@@ -10,7 +10,7 @@
+ 	for structurei in structure.itervalues():
+ 
+ 		#return if there is no field Patch
+-		if not 'Patch' in structurei:
++		if 'Patch' not in structurei:
+ 			continue
+ 
+ 		raise SystemError("MatlabProcessPatch not implemented in Python.")
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13023)
+@@ -40,7 +40,7 @@
+ 		os.remove(md.miscellaneous.name+'.outlog')
+ 		os.remove(md.miscellaneous.name+'.errlog')
+ 		os.remove(md.miscellaneous.name+'.outbin')
+-		if not 'Windows' in platform.system():
++		if 'Windows' not in platform.system():
+ 			os.remove(md.private.runtimename+'.tar.gz')
+ 
+ 	#erase input file if run was carried out on same platform.
+@@ -52,7 +52,7 @@
+ 		else:
+ 			os.remove(md.miscellaneous.name+'.bin')
+ 			os.remove(md.miscellaneous.name+'.petsc')
+-			if not 'Windows' in platform.system():
++			if 'Windows' not in platform.system():
+ 				os.remove(md.miscellaneous.name+'.queue')
+ 			else:
+ 				os.remove(md.miscellaneous.name+'.bat')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.py	(revision 13023)
+@@ -1,7 +1,17 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class thermal(object):
++	"""
++	THERMAL class definition
++
++	   Usage:
++	      thermal=thermal();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -17,36 +27,61 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   Thermal solution parameters:'
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'spctemperature','temperature constraints (NaN means no constraint)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'stabilization','0->no, 1->artificial_diffusivity, 2->SUPG'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'maxiter','maximum number of non linear iterations'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'penalty_lock','stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'penalty_threshold','threshold to declare convergence of thermal solution (default is 0)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)'))
++		string="%s\n\n%s"%(string,fielddisplay(self,'spctemperature','temperature constraints (NaN means no constraint)'))
++		string="%s\n%s"%(string,fielddisplay(self,'stabilization','0->no, 1->artificial_diffusivity, 2->SUPG'))
++		string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of non linear iterations'))
++		string="%s\n%s"%(string,fielddisplay(self,'penalty_lock','stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)'))
++		string="%s\n%s"%(string,fielddisplay(self,'penalty_threshold','threshold to declare convergence of thermal solution (default is 0)'))
++		string="%s\n%s"%(string,fielddisplay(self,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)'))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#Number of unstable constraints acceptable
+-		obj.penalty_threshold=0
++		self.penalty_threshold=0
+ 
+ 		#Type of stabilization used
+-		obj.stabilization=1
++		self.stabilization=1
+ 
+ 		#Maximum number of iterations
+-		obj.maxiter=100
++		self.maxiter=100
+ 
+ 		#factor used to compute the values of the penalties: kappa=max(stiffness matrix)*10^penalty_factor
+-		obj.penalty_factor=3
++		self.penalty_factor=3
+ 
+ 		#Should we use cold ice (default) or enthalpy formulation
+-		obj.isenthalpy=0
++		self.isenthalpy=0
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		#Early return
++		if (ThermalAnalysisEnum() not in analyses and EnthalpyAnalysisEnum() not in analyses) or (solution==TransientSolutionEnum() and not md.transient.isthermal):
++			return md
++
++		md = checkfield(md,'thermal.stabilization','numel',1,'values',[0,1,2])
++		md = checkfield(md,'thermal.spctemperature','forcing',1)
++		if EnthalpyAnalysisEnum() in analyses and md.thermal.isenthalpy and md.mesh.dimension==3:
++			md = checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message',"spctemperature should be below the adjusted melting point")
++			md = checkfield(md,'thermal.isenthalpy','numel',1,'values',[0,1])
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','spctemperature','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','penalty_threshold','format','Integer')
++		WriteData(fid,'object',self,'fieldname','stabilization','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')
++		WriteData(fid,'object',self,'fieldname','isenthalpy','format','Boolean')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.py	(revision 13023)
+@@ -1,7 +1,17 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class transient(object):
++	"""
++	TRANSIENT class definition
++
++	   Usage:
++	      transient=transient();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -15,26 +25,50 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   transient solution parameters:'
+-		string="%s\n%s"%(string,fielddisplay(obj,'isprognostic','indicates if a prognostic solution is used in the transient'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'isthermal','indicates if a thermal solution is used in the transient'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'isdiagnostic','indicates if a diagnostic solution is used in the transient'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'isgroundingline','indicates if a groundingline migration is used in the transient'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'requested_outputs','list of additional outputs requested'))
++		string="%s\n%s"%(string,fielddisplay(self,'isprognostic','indicates if a prognostic solution is used in the transient'))
++		string="%s\n%s"%(string,fielddisplay(self,'isthermal','indicates if a thermal solution is used in the transient'))
++		string="%s\n%s"%(string,fielddisplay(self,'isdiagnostic','indicates if a diagnostic solution is used in the transient'))
++		string="%s\n%s"%(string,fielddisplay(self,'isgroundingline','indicates if a groundingline migration is used in the transient'))
++		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','list of additional outputs requested'))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#full analysis: Diagnostic, Prognostic and Thermal but no groundingline migration for now
+-		obj.isprognostic=1
+-		obj.isdiagnostic=1
+-		obj.isthermal=1
+-		obj.isgroundingline=0
++		self.isprognostic=1
++		self.isdiagnostic=1
++		self.isthermal=1
++		self.isgroundingline=0
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		#Early return
++		if not solution==TransientSolutionEnum():
++			return md
++
++		md = checkfield(md,'transient.isprognostic','numel',1,'values',[0,1])
++		md = checkfield(md,'transient.isdiagnostic','numel',1,'values',[0,1])
++		md = checkfield(md,'transient.isthermal','numel',1,'values',[0,1])
++		md = checkfield(md,'transient.isgroundingline','numel',1,'values',[0,1])
++		md = checkfield(md,'transient.requested_outputs','size',[float('NaN')])
++
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','isprognostic','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','isdiagnostic','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','isthermal','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','isgroundingline','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','requested_outputs','format','DoubleMat','mattype',3)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13023)
+@@ -1,4 +1,4 @@
+-%CONSTANTS class definition
++%INVERSION class definition
+ %
+ %   Usage:
+ %      inversion=inversion();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/hydrology.py	(revision 13023)
+@@ -60,7 +60,7 @@
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		#Early return
+-		if not HydrologyAnalysisEnum() in analyses:
++		if HydrologyAnalysisEnum() not in analyses:
+ 			return md
+ 
+ 		md = checkfield(md,'hydrology.spcwatercolumn','forcing',1)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.m	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.m	(revision 13023)
+@@ -47,8 +47,8 @@
+ 			md = checkfield(md,'thermal.stabilization','numel',1,'values',[0 1 2]);
+ 			md = checkfield(md,'thermal.spctemperature','forcing',1);
+ 			if (ismember(EnthalpyAnalysisEnum(),analyses) & md.thermal.isenthalpy & md.mesh.dimension==3),
+-			md = checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message','spctemperature should be below the adjusted melting point');
+-			md = checkfield(md,'thermal.isenthalpy','numel',1,'values',[0 1]);
++				md = checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message','spctemperature should be below the adjusted melting point');
++				md = checkfield(md,'thermal.isenthalpy','numel',1,'values',[0 1]);
+ 			end
+ 		end % }}}
+ 		function disp(obj) % {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13023)
+@@ -72,7 +72,7 @@
+ 	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
+ 
+ 		#write queuing script 
+-		if not 'Windows' in platform.system():
++		if 'Windows' not in platform.system():
+ 
+ 			fid=open(modelname+'.queue','w')
+ 			fid.write('#!/bin/sh\n')
+@@ -114,7 +114,7 @@
+ 	def BuildKrigingQueueScript(self,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
+ 
+ 		#write queuing script 
+-		if not 'Windows' in platform.system():
++		if 'Windows' not in platform.system():
+ 
+ 			fid=open(modelname+'.queue','w')
+ 			fid.write('#!/bin/sh\n')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/friction.py	(revision 13023)
+@@ -40,7 +40,7 @@
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		#Early return
+-		if not DiagnosticHorizAnalysisEnum() in analyses and not ThermalAnalysisEnum() in analyses:
++		if DiagnosticHorizAnalysisEnum() not in analyses and ThermalAnalysisEnum() not in analyses:
+ 			return md
+ 
+ 		md = checkfield(md,'friction.coefficient','NaN',1,'size',[md.mesh.numberofvertices])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13023)
+@@ -112,9 +112,9 @@
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		#Early return
+-		if not DiagnosticHorizAnalysisEnum() in analyses:
++		if DiagnosticHorizAnalysisEnum() not in analyses:
+ 			return md
+-		#if (not DiagnosticHorizAnalysisEnum() in analyses) | (solution==TransientSolutionEnum() and not md.transient.isdiagnostic):
++		#if (DiagnosticHorizAnalysisEnum() not in analyses) | (solution==TransientSolutionEnum() and not md.transient.isdiagnostic):
+ 		#	return md
+ 
+ 		md = checkfield(md,'diagnostic.spcvx','forcing',1)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py	(revision 13023)
+@@ -58,7 +58,7 @@
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		#Early return
+-		if (not PrognosticAnalysisEnum() in analyses) or (solution==TransientSolutionEnum() and not md.transient.isprognostic):
++		if (PrognosticAnalysisEnum() not in analyses) or (solution==TransientSolutionEnum() and not md.transient.isprognostic):
+ 			return md
+ 
+ 		md = checkfield(md,'prognostic.spcthickness','forcing',1)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.py	(revision 13023)
+@@ -1,7 +1,17 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class autodiff(object):
++	"""
++	AUTODIFF class definition
++
++	   Usage:
++	      autodiff=autodiff();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -13,16 +23,26 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   automatic differentiation parameters:'
+-		string="%s\n%s"%(string,fielddisplay(obj,'isautodiff','indicates if the automatic differentiation is activated'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'forward','forward differentiation'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'reverse','backward differentiation'))
++		string="%s\n%s"%(string,fielddisplay(self,'isautodiff','indicates if the automatic differentiation is activated'))
++		string="%s\n%s"%(string,fielddisplay(self,'forward','forward differentiation'))
++		string="%s\n%s"%(string,fielddisplay(self,'reverse','backward differentiation'))
+ 		return string
+ 		#}}}
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','isautodiff','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','forward','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','reverse','format','Boolean')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py	(revision 13023)
+@@ -53,7 +53,7 @@
+ 	def addfielddefault(self,field,value):    # {{{
+ 		"""ADDFIELDDEFAULT - add a field to an options list if it does not exist"""
+ 		if isinstance(field,str):
+-			if not field in self.list:
++			if field not in self.list:
+ 				self.list[field] = value
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py	(revision 13023)
+@@ -1,7 +1,18 @@
+ #module imports
++import numpy
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class flaim(object):
++	"""
++	FLAIM class definition
++
++	   Usage:
++	      flaim=flaim();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -19,32 +30,48 @@
+ 		self.opt_dist           = 25
+ 		self.opt_niter          = 30000
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Displa
+ 		string='   FLAIM - Flight Line Adaptation using Ice sheet Modeling:'
+ 
+ 		string="%s\n\n%s"%(string,'      Input:')
+-		string="%s\n%s"%(string,fielddisplay(obj,'targets'            ,'name of kml output targets file '))
+-		string="%s\n%s"%(string,fielddisplay(obj,'tracks'             ,'name of kml input tracks file '))
+-		string="%s\n%s"%(string,fielddisplay(obj,'flightreqs'         ,'structure of kml flight requirements (not used yet)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'criterion'          ,'element or nodal criterion for flight path evaluation (metric)'))
++		string="%s\n%s"%(string,fielddisplay(self,'targets'            ,'name of kml output targets file '))
++		string="%s\n%s"%(string,fielddisplay(self,'tracks'             ,'name of kml input tracks file '))
++		string="%s\n%s"%(string,fielddisplay(self,'flightreqs'         ,'structure of kml flight requirements (not used yet)'))
++		string="%s\n%s"%(string,fielddisplay(self,'criterion'          ,'element or nodal criterion for flight path evaluation (metric)'))
+ 
+ 		string="%s\n\n%s"%(string,'      Arguments:')
+-		string="%s\n%s"%(string,fielddisplay(obj,'gridsatequator'     ,'number of grids at equator (determines resolution)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'usevalueordering'   ,'flag to consider target values for flight path evaluation'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'split_antimeridian' ,'flag to split polygons on the antimeridian'))
++		string="%s\n%s"%(string,fielddisplay(self,'gridsatequator'     ,'number of grids at equator (determines resolution)'))
++		string="%s\n%s"%(string,fielddisplay(self,'usevalueordering'   ,'flag to consider target values for flight path evaluation'))
++		string="%s\n%s"%(string,fielddisplay(self,'split_antimeridian' ,'flag to split polygons on the antimeridian'))
+ 		
+ 		string="%s\n\n%s"%(string,'      Optimization:')
+-		string="%s\n%s"%(string,fielddisplay(obj,'path_optimize'     ,'optimize? (default false)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'opt_ndir'     ,['number of directions to test when moving a point.  If this value = 1, a random direction is tested.',\
++		string="%s\n%s"%(string,fielddisplay(self,'path_optimize'     ,'optimize? (default false)'))
++		string="%s\n%s"%(string,fielddisplay(self,'opt_ndir'     ,['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].']))
+-		string="%s\n%s"%(string,fielddisplay(obj,'opt_dist'     ,'specifies the distance in km (default 25) to move a randomly selected path point on each iteration'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'opt_niter'     ,['number of iterations (default 30,000) to run for flightplan optimization',\
++		string="%s\n%s"%(string,fielddisplay(self,'opt_dist'     ,'specifies the distance in km (default 25) to move a randomly selected path point on each iteration'))
++		string="%s\n%s"%(string,fielddisplay(self,'opt_niter'     ,['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.']))
+ 
+ 		string="%s\n\n%s"%(string,'      Output:')
+-		string="%s\n%s"%(string,fielddisplay(obj,'solution'           ,'name of kml solution file'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'quality'            ,'quality of kml solution'))
++		string="%s\n%s"%(string,fielddisplay(self,'solution'           ,'name of kml solution file'))
++		string="%s\n%s"%(string,fielddisplay(self,'quality'            ,'quality of kml solution'))
+ 		return string
+ 		#}}}
++
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		#Early return
++		if not solution==FlaimSolutionEnum():
++			return md
++
++		md = checkfield(md,'flaim.tracks','file',1)
++		if any(numpy.isnan(md.flaim.criterion)) or not md.flaim.criterion:
++			md = checkfield(md,'flaim.targets','file',1)
++		else:
++			md = checkfield(md,'flaim.criterion','numel',[md.mesh.numberofvertices,md.mesh.numberofelements])
++
++		return md
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/steadystate.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/steadystate.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/steadystate.py	(revision 13023)
+@@ -1,7 +1,18 @@
+ #module imports
++import numpy
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class steadystate(object):
++	"""
++	STEADYSTATE class definition
++
++	   Usage:
++	      steadystate=steadystate();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -13,24 +24,45 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   steadystate solution parameters:'
+-		string="%s\n%s"%(string,fielddisplay(obj,'reltol','relative tolerance criterion'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'maxiter','maximum number of iterations'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'requested_outputs','additional requested outputs'))
++		string="%s\n%s"%(string,fielddisplay(self,'reltol','relative tolerance criterion'))
++		string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of iterations'))
++		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional requested outputs'))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#maximum of steady state iterations
+-		obj.maxiter=100
++		self.maxiter=100
+ 
+ 		#Relative tolerance for the steadystate convertgence
+-		obj.reltol=0.01
++		self.reltol=0.01
+ 
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		#Early return
++		if not solution==SteadystateSolutionEnum():
++			return md
++
++		if not md.timestepping.time_step==0:
++			md.checkmessage("for a steadystate computation, timestepping.time_step must be zero.")
++
++		if numpy.isnan(md.diagnostic.reltol):
++			md.checkmessage("for a steadystate computation, diagnostic.reltol (relative convergence criterion) must be defined!")
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','reltol','format','Double')
++		WriteData(fid,'object',self,'fieldname','maxiter','format','Integer')
++		WriteData(fid,'object',self,'fieldname','requested_outputs','format','DoubleMat','mattype',3)
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13023)
+@@ -1,7 +1,18 @@
+ #module imports
++import numpy
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class inversion(object):
++	"""
++	INVERSION class definition
++
++	   Usage:
++	      inversion=inversion();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -25,26 +36,26 @@
+ 		self.vel_obs                     = float('NaN')
+ 		self.thickness_obs               = float('NaN')
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='\n   Inversion parameters:'
+-		string="%s\n%s"%(string,fielddisplay(obj,'iscontrol','is inversion activated?'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'incomplete_adjoint','do we assume linear viscosity?'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'control_parameters','parameter where inverse control is carried out; ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'nsteps','number of optimization searches'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'cost_functions','indicate the type of response for each optimization step'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'cost_function_threshold','misfit convergence criterion. Default is 1%, NaN if not applied'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'maxiter_per_step','maximum iterations during each optimization step'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'gradient_scaling','scaling factor on gradient direction during optimization, for each optimization step'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'step_threshold','decrease threshold for misfit, default is 30%'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'gradient_only','stop control method solution at gradient'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'vx_obs','observed velocity x component [m/a]'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'vy_obs','observed velocity y component [m/a]'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'vel_obs','observed velocity magnitude [m/a]'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'thickness_obs','observed thickness [m]'))
++		string="%s\n%s"%(string,fielddisplay(self,'iscontrol','is inversion activated?'))
++		string="%s\n%s"%(string,fielddisplay(self,'incomplete_adjoint','do we assume linear viscosity?'))
++		string="%s\n%s"%(string,fielddisplay(self,'control_parameters','parameter where inverse control is carried out; ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'))
++		string="%s\n%s"%(string,fielddisplay(self,'nsteps','number of optimization searches'))
++		string="%s\n%s"%(string,fielddisplay(self,'cost_functions','indicate the type of response for each optimization step'))
++		string="%s\n%s"%(string,fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
++		string="%s\n%s"%(string,fielddisplay(self,'cost_function_threshold','misfit convergence criterion. Default is 1%, NaN if not applied'))
++		string="%s\n%s"%(string,fielddisplay(self,'maxiter_per_step','maximum iterations during each optimization step'))
++		string="%s\n%s"%(string,fielddisplay(self,'gradient_scaling','scaling factor on gradient direction during optimization, for each optimization step'))
++		string="%s\n%s"%(string,fielddisplay(self,'step_threshold','decrease threshold for misfit, default is 30%'))
++		string="%s\n%s"%(string,fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex'))
++		string="%s\n%s"%(string,fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex'))
++		string="%s\n%s"%(string,fielddisplay(self,'gradient_only','stop control method solution at gradient'))
++		string="%s\n%s"%(string,fielddisplay(self,'vx_obs','observed velocity x component [m/a]'))
++		string="%s\n%s"%(string,fielddisplay(self,'vy_obs','observed velocity y component [m/a]'))
++		string="%s\n%s"%(string,fielddisplay(self,'vel_obs','observed velocity magnitude [m/a]'))
++		string="%s\n%s"%(string,fielddisplay(self,'thickness_obs','observed thickness [m]'))
+ 		string="%s\n%s"%(string,'Available cost functions:')
+ 		string="%s\n%s"%(string,'   101: SurfaceAbsVelMisfit')
+ 		string="%s\n%s"%(string,'   102: SurfaceRelVelMisfit')
+@@ -58,47 +69,121 @@
+ 		return string
+ 		#}}}
+ 
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		
+ 		#default is incomplete adjoint for now
+-		obj.incomplete_adjoint=1
++		self.incomplete_adjoint=1
+ 
+ 		#parameter to be inferred by control methods (only
+ 		#drag and B are supported yet)
+-		obj.control_parameters=['FrictionCoefficient']
++		self.control_parameters=['FrictionCoefficient']
+ 
+ 		#number of steps in the control methods
+-		obj.nsteps=20
++		self.nsteps=20
+ 
+ 		#maximum number of iteration in the optimization algorithm for
+ 		#each step
+-		obj.maxiter_per_step=20*ones(obj.nsteps)
++		self.maxiter_per_step=20*ones(self.nsteps)
+ 
+ 		#the inversed parameter is updated as follows:
+ 		#new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1];
+ 		#usually the gradient_scaling must be of the order of magnitude of the 
+ 		#inversed parameter (10^8 for B, 50 for drag) and can be decreased
+ 		#after the first iterations
+-		obj.gradient_scaling=50*ones(obj.nsteps)
++		self.gradient_scaling=50*ones(self.nsteps)
+ 
+ 		#several responses can be used:
+-		obj.cost_functions=101*ones(obj.nsteps)
++		self.cost_functions=101*ones(self.nsteps)
+ 
+ 		#step_threshold is used to speed up control method. When
+-		#misfit(1)/misfit(0) < obj.step_threshold, we go directly to
++		#misfit(1)/misfit(0) < self.step_threshold, we go directly to
+ 		#the next step
+-		obj.step_threshold=.7*ones(obj.nsteps) #30 per cent decrement
++		self.step_threshold=.7*ones(self.nsteps) #30 per cent decrement
+ 
+ 		#stop control solution at the gradient computation and return it? 
+-		obj.gradient_only=0
++		self.gradient_only=0
+ 
+ 		#cost_function_threshold is a criteria to stop the control methods.
+ 		#if J[n]-J[n-1]/J[n] < criteria, the control run stops
+ 		#NaN if not applied
+-		obj.cost_function_threshold=NaN #not activated 
++		self.cost_function_threshold=NaN #not activated 
+ 
+-		return obj
+-		#}}}
++		return self
++	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
++		#Early return
++		if not self.iscontrol:
++			return md
++
++		num_controls=numpy.size(md.inversion.control_parameters)
++		num_costfunc=numpy.size(md.inversion.cost_functions,1)
++
++		md = checkfield(md,'inversion.iscontrol','values',[0,1])
++		md = checkfield(md,'inversion.tao','values',[0,1])
++		md = checkfield(md,'inversion.incomplete_adjoint','values',[0,1])
++		md = checkfield(md,'inversion.control_parameters','cell',1,'values',['BalancethicknessThickeningRate','FrictionCoefficient','MaterialsRheologyBbar','Vx','Vy'])
++		md = checkfield(md,'inversion.nsteps','numel',1,'>=',1)
++		md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps],'>=',0)
++		md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps])
++		md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps,num_costfunc],'values',[101,102,103,104,105,201,501,502,503])
++		md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices,num_costfunc],'>=',0)
++		md = checkfield(md,'inversion.gradient_only','values',[0,1])
++		md = checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps,num_controls])
++		md = checkfield(md,'inversion.min_parameters','size',[md.mesh.numberofvertices,num_controls])
++		md = checkfield(md,'inversion.max_parameters','size',[md.mesh.numberofvertices,num_controls])
++
++		if solution==BalancethicknessSolutionEnum():
++			md = checkfield(md,'inversion.thickness_obs','size',[md.mesh.numberofvertices],'NaN',1)
++		else:
++			md = checkfield(md,'inversion.vx_obs','size',[md.mesh.numberofvertices],'NaN',1)
++			md = checkfield(md,'inversion.vy_obs','size',[md.mesh.numberofvertices],'NaN',1)
++
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++
++		WriteData(fid,'object',self,'fieldname','iscontrol','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','tao','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','incomplete_adjoint','format','Boolean')
++		if not self.iscontrol:
++			return
++		WriteData(fid,'object',self,'fieldname','nsteps','format','Integer')
++		WriteData(fid,'object',self,'fieldname','maxiter_per_step','format','DoubleMat','mattype',3)
++		WriteData(fid,'object',self,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','gradient_scaling','format','DoubleMat','mattype',3)
++		WriteData(fid,'object',self,'fieldname','cost_function_threshold','format','Double')
++		WriteData(fid,'object',self,'fieldname','min_parameters','format','DoubleMat','mattype',3)
++		WriteData(fid,'object',self,'fieldname','max_parameters','format','DoubleMat','mattype',3)
++		WriteData(fid,'object',self,'fieldname','step_threshold','format','DoubleMat','mattype',3)
++		WriteData(fid,'object',self,'fieldname','gradient_only','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','vx_obs','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','vy_obs','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','vz_obs','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'fieldname','thickness_obs','format','DoubleMat','mattype',1)
++
++		#process control parameters
++		num_control_parameters=numpy.size(self.control_parameters)
++		data=[StringToEnum(self.control_parameters[i]) for i in xrange(0,num_control_parameters)]
++		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(self.cost_functions,1)
++		data=self.cost_functions
++		data[[i for i,item in enumerate(data) if item==101]]=SurfaceAbsVelMisfitEnum()
++		data[[i for i,item in enumerate(data) if item==102]]=SurfaceRelVelMisfitEnum()
++		data[[i for i,item in enumerate(data) if item==103]]=SurfaceLogVelMisfitEnum()
++		data[[i for i,item in enumerate(data) if item==104]]=SurfaceLogVxVyMisfitEnum()
++		data[[i for i,item in enumerate(data) if item==105]]=SurfaceAverageVelMisfitEnum()
++		data[[i for i,item in enumerate(data) if item==201]]=ThicknessAbsMisfitEnum()
++		data[[i for i,item in enumerate(data) if item==501]]=DragCoefficientAbsGradientEnum()
++		data[[i for i,item in enumerate(data) if item==502]]=RheologyBbarAbsGradientEnum()
++		data[[i for i,item in enumerate(data) if item==503]]=ThicknessAbsGradientEnum()
++		WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3)
++		WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py	(revision 13022)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py	(revision 13023)
+@@ -49,7 +49,9 @@
+ 	if options.exist('size'):
+ 		fieldsize=options.getfieldvalue('size')
+ 		if   len(fieldsize) == 1:
+-			if (not numpy.size(field,0)==fieldsize[0]):
++			if   numpy.isnan(fieldsize[0]):
++				pass
++			elif not numpy.size(field,0)==fieldsize[0]:
+ 				md = md.checkmessage(options.getfieldvalue('message',\
+ 					"field '%s' size should be %d" % (fieldname,fieldsize[0])))
+ 		elif len(fieldsize) == 2:
+@@ -69,7 +71,7 @@
+ 	#Check numel
+ 	if options.exist('numel'):
+ 		fieldnumel=options.getfieldvalue('numel')
+-		if not numpy.size(field) in fieldnumel:
++		if numpy.size(field) not in fieldnumel:
+ 			if   len(fieldnumel)==1:
+ 				md = md.checkmessage(options.getfieldvalue('message',\
+ 					"field '%s' size should be %d" % (fieldname,fieldnumel)))
Index: /issm/oecreview/Archive/12678-13393/ISSM-13023-13024.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13023-13024.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13023-13024.diff	(revision 13394)
@@ -0,0 +1,27 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/Makefile.am	(revision 13023)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/py/Makefile.am	(revision 13024)
+@@ -1 +0,0 @@
+-SUBDIRS = model
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/Makefile.am	(revision 13023)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/Makefile.am	(revision 13024)
+@@ -1,2 +1,2 @@
+-EXTRA_DIST =  perl  pro  py
++EXTRA_DIST =  perl pro py
+ SUBDIRS = c modules m
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13023)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13024)
+@@ -35,8 +35,6 @@
+ AC_CONFIG_FILES([Makefile
+ 			src/Makefile
+ 			src/c/Makefile 
+-			src/py/Makefile
+-			src/py/model/Makefile
+ 			src/modules/Makefile
+ 			src/modules/python/Makefile
+ 			src/modules/matlab/Makefile
Index: /issm/oecreview/Archive/12678-13393/ISSM-13024-13025.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13024-13025.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13024-13025.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13024)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13025)
+@@ -89,7 +89,7 @@
+ 			md = checkfield(md,'inversion.nsteps','numel',1,'>=',1);
+ 			md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
+ 			md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps 1]);
+-			md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps num_costfunc],'values',[101:105 201 501:503]);
++			md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps num_costfunc],'values',[101:105 201 501:503 377:378]);
+ 			md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
+ 			md = checkfield(md,'inversion.gradient_only','values',[0 1]);
+ 			md = checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13025-13026.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13025-13026.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13025-13026.diff	(revision 13394)
@@ -0,0 +1,154 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exptool.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exptool.m	(revision 13025)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/exptool.m	(revision 13026)
+@@ -161,25 +161,29 @@
+ 
+ 	%display menu
+ 	title('Main Menu','FontSize',14);
+-	button=menu('Menu','add a profile (open)',...%1
+-		'add a contour (closed)',...              %2
+-		'remove a profile',...                    %3
+-		'modify the position of a point',...      %4
+-		'add points inside a profile',...         %5
+-		'add points at the end of a profile',...  %6
+-		'remove points',...                       %7
+-		'remove several points',...               %8
+-		'cut a segment',...                       %9
+-		'cut a large area',...                    %10
+-		'merge profiles',...                      %11
+-		'close profile',...                       %12
+-		'undo',...                                %13
+-		'redo',...                                %14
+-		'quit');                                  %15
++   UIControl_FontSize_bak = get(0, 'DefaultUIControlFontSize');
++   set(0, 'DefaultUIControlFontSize',10);
++   button=menu('exptool menu',...
++      'add a profile (open)',...                %1
++      'add a contour (closed)',...              %2
++      'remove a profile',...                    %3
++      'modify the position of a point',...      %4
++      'add points inside a profile',...         %5
++      'add points at the end of a profile',...  %6
++      'remove points',...                       %7
++      'remove several points',...               %8
++      'cut a segment',...                       %9
++      'cut a large area',...                    %10
++      'merge profiles',...                      %11
++      'close profile',...                       %12
++		'change orientation',...                  %13
++      'undo',...                                %14
++      'redo',...                                %15
++      'quit');                                  %16
++   set(0, 'DefaultUIControlFontSize', UIControl_FontSize_bak);
+ 
+-
+ 	%UNDO??
+-	if button==13;
++	if button==14;
+ 		if counter==1
+ 			disp('Already at oldest change');
+ 		else
+@@ -189,10 +193,8 @@
+ 			numpoints=backup{counter,3};
+ 			closed=backup{counter,4};
+ 		end
+-	end
+-
+ 	%REDO??
+-	if button==14
++	elseif button==15
+ 		if counter==size(backup,1)
+ 			disp('Already at newest change');
+ 		else
+@@ -315,15 +317,22 @@
+ 			backup{counter,3}=numpoints;
+ 			backup{counter,4}=closed;
+ 
++		case 13
++
++			[A,numprofiles,numpoints,closed]=orientprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++			counter=counter+1;
++			backup{counter,1}=A;
++			backup{counter,2}=numprofiles;
++			backup{counter,3}=numpoints;
++			backup{counter,4}=closed;
++
+ 			%QUIT
+-		case 15
++		case 16
+ 
+ 			loop=0;
+ 
+ 		otherwise
+-
+ 			%do nothing
+-
+ 	end
+ 
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/orientprofile.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/orientprofile.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/orientprofile.m	(revision 13026)
+@@ -0,0 +1,54 @@
++function [A,numprofiles,numpoints,closed]=orientprofile(A,numprofiles,numpoints,closed,prevplot,root,options);
++%ORIENTPROFILE - cahnge profile orientation
++%
++%   this script is used by exptool as an elementary operation
++%   on an ARGUS profile
++%
++%   Usage:
++%      [A,numprofiles,numpoints,closed]=orientprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
++
++	title('click on the profiles to be reoriented, RETURN to exit','FontSize',14)
++	hold on
++
++	loop=1;
++	selection=[];
++
++	while loop
++
++		%some checks
++		if numprofiles==0
++			disp('no profile to be reoriented, exiting...')
++			return
++		end
++		   
++		[xi,yi] = ginput(1);
++					  
++		if ~isempty(xi)
++
++			%get closest profile
++			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
++
++			if ismember(profsel,selection)
++				%profile was in selection, remove it from list
++				selection(find(selection==profsel))=[];
++				%back to regular color
++				plot(A(profsel).x,A(profsel).y,...
++					'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			else
++				%add the profile to the list to be removed
++				selection(end+1)=profsel;
++				%in selectioncolor
++				plot(A(profsel).x,A(profsel).y,...
++					'color',getfieldvalue(options,'selectioncolor'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'));
++			end
++		else
++			%reorient profiles
++			selection=sort(selection);
++			for i=1:length(selection),
++				A(selection(i)).x=flipud(A(selection(i)).x);
++				A(selection(i)).y=flipud(A(selection(i)).y);
++			end
++			loop=0;
++		end
++	end
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/manipulation/orientprofile.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13026-13027.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13026-13027.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13026-13027.diff	(revision 13394)
@@ -0,0 +1,133 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.py	(revision 13026)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.py	(revision 13027)
+@@ -1,26 +0,0 @@
+-from pairoptions import *
+-from FlagElements import *
+-
+-def recover_areas(md,*args):
+-	"""
+-	RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
+-
+-	   This routine is called by setelementstype, do not use
+-
+-	   Usage:
+-	      [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+-	"""
+-
+-	#go through varargin, extract options and plug them into subtype options, by order of appearance
+-	options=pairoptions(*args)
+-#	options=deleteduplicates(options,1);
+-
+-	#recover elements distribution
+-	hutterflag  =FlagElements(md,options.getfieldvalue('hutter',''))
+-	macayealflag=FlagElements(md,options.getfieldvalue('macayeal',''))
+-	pattynflag  =FlagElements(md,options.getfieldvalue('pattyn',''))
+-	stokesflag  =FlagElements(md,options.getfieldvalue('stokes',''))
+-	filltype    =options.getfieldvalue('fill','none')
+-
+-	return hutterflag,macayealflag,pattynflag,stokesflag,filltype
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.m	(revision 13026)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/recover_areas.m	(revision 13027)
+@@ -1,22 +0,0 @@
+-function [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+-%RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
+-%
+-%   This routine is called by setelementstype, do not use
+-%
+-%   Usage:
+-%      [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+-
+-	%go through varargin, extract options and plug them into subtype options, by order of appearance
+-	options=pairoptions(varargin{:});
+-	options=deleteduplicates(options,1);
+-
+-	%recover elements distribution
+-	hutterflag  =FlagElements(md,getfieldvalue(options,'hutter',''));
+-	macayealflag=FlagElements(md,getfieldvalue(options,'macayeal',''));
+-	pattynflag  =FlagElements(md,getfieldvalue(options,'pattyn',''));
+-	stokesflag  =FlagElements(md,getfieldvalue(options,'stokes',''));
+-	filltype    =getfieldvalue(options,'fill','none');
+-
+-end %end function
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13026)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13027)
+@@ -3,7 +3,31 @@
+ from pairoptions import *
+ from recover_areas import *
+ from MatlabFuncs import *
++from FlagElements import *
+ 
++def recover_areas(md,*args): # {{{
++	"""
++	RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
++
++		This routine is called by setelementstype, do not use
++
++		Usage:
++			[hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
++	"""
++
++	#go through varargin, extract options and plug them into subtype options, by order of appearance
++	options=pairoptions(*args)
++#	options=deleteduplicates(options,1);
++
++	#recover elements distribution
++	hutterflag  =FlagElements(md,options.getfieldvalue('hutter',''))
++	macayealflag=FlagElements(md,options.getfieldvalue('macayeal',''))
++	pattynflag  =FlagElements(md,options.getfieldvalue('pattyn',''))
++	stokesflag  =FlagElements(md,options.getfieldvalue('stokes',''))
++	filltype    =options.getfieldvalue('fill','none')
++
++	return hutterflag,macayealflag,pattynflag,stokesflag,filltype
++#}}}
+ def setflowequation(md,*args):
+ 	"""
+ 	SETELEMENTSTYPE - associate a solution type to each element
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 13026)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 13027)
+@@ -2,7 +2,7 @@
+ %SETELEMENTSTYPE - associate a solution type to each element
+ %
+ %   This routine works like plotmodel: it works with an even number of inputs
+-%   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
++%   'hutter','macayeal','l1l2','pattyn','stokes' and 'fill' are the possible options
+ %   that must be followed by the corresponding exp file or flags list
+ %   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+ %   If user wants every element outside the domain to be 
+@@ -279,3 +279,25 @@
+ if any(md.flowequation.borderstokes) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.borderstokes~=1),
+ 	error('error coupling domain too irregular');
+ end
++end 
++
++function [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin); % {{{
++%RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
++%
++%   This routine is called by setelementstype, do not use
++%
++%   Usage:
++%      [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
++
++	%go through varargin, extract options and plug them into subtype options, by order of appearance
++	options=pairoptions(varargin{:});
++	options=deleteduplicates(options,1);
++
++	%recover elements distribution
++	hutterflag  =FlagElements(md,getfieldvalue(options,'hutter',''));
++	macayealflag=FlagElements(md,getfieldvalue(options,'macayeal',''));
++	pattynflag  =FlagElements(md,getfieldvalue(options,'pattyn',''));
++	stokesflag  =FlagElements(md,getfieldvalue(options,'stokes',''));
++	filltype    =getfieldvalue(options,'fill','none');
++
++end %end function }}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13027-13028.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13027-13028.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13027-13028.diff	(revision 13394)
@@ -0,0 +1,127 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13027)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13028)
+@@ -1,31 +1,13 @@
+ import numpy
+ from model import *
+ from pairoptions import *
+-from recover_areas import *
+ from MatlabFuncs import *
+ from FlagElements import *
+ 
+-def recover_areas(md,*args): # {{{
+-	"""
+-	RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
+ 
+-		This routine is called by setelementstype, do not use
++	#recover elements distribution
+ 
+-		Usage:
+-			[hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+-	"""
+ 
+-	#go through varargin, extract options and plug them into subtype options, by order of appearance
+-	options=pairoptions(*args)
+-#	options=deleteduplicates(options,1);
+-
+-	#recover elements distribution
+-	hutterflag  =FlagElements(md,options.getfieldvalue('hutter',''))
+-	macayealflag=FlagElements(md,options.getfieldvalue('macayeal',''))
+-	pattynflag  =FlagElements(md,options.getfieldvalue('pattyn',''))
+-	stokesflag  =FlagElements(md,options.getfieldvalue('stokes',''))
+-	filltype    =options.getfieldvalue('fill','none')
+-
+ 	return hutterflag,macayealflag,pattynflag,stokesflag,filltype
+ #}}}
+ def setflowequation(md,*args):
+@@ -33,7 +15,7 @@
+ 	SETELEMENTSTYPE - associate a solution type to each element
+ 
+ 	   This routine works like plotmodel: it works with an even number of inputs
+-	   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
++	   'hutter','macayeal','pattyn','l1l2','stokes' and 'fill' are the possible options
+ 	   that must be followed by the corresponding exp file or flags list
+ 	   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+ 	   If user wants every element outside the domain to be 
+@@ -54,13 +36,22 @@
+ 	if not isinstance(md,model) or not len(args):
+ 		raise TypeError("setflowequation error message")
+ 
++	#process options
++	options=pairoptions(*args)
++#	options=deleteduplicates(options,1);
++
+ 	#Find_out what kind of coupling to use
+-	options=pairoptions(*args)
+ 	coupling_method=options.getfieldvalue('coupling','tiling')
+ 	if not strcmpi(coupling_method,'tiling') and not strcmpi(coupling_method,'penalties'):
+ 		raise TypeError("coupling type can only be: tiling or penalties")
+ 
+-	hutterflag,macayealflag,pattynflag,stokesflag,filltype=recover_areas(md,*args)
++	#recover elements distribution
++	hutterflag   = FlagElements(md,options.getfieldvalue('hutter',''))
++	macayealflag = FlagElements(md,options.getfieldvalue('macayeal',''))
++	pattynflag   = FlagElements(md,options.getfieldvalue('pattyn',''))
++	l1l2flag     = FlagElements(md,options.getfieldvalue('l1l2',''))
++	stokesflag   = FlagElements(md,options.getfieldvalue('stokes',''))
++	filltype     = options.getfieldvalue('fill','none')
+ 
+ 	#Flag the elements that have not been flagged as filltype
+ 	if   strcmpi(filltype,'hutter'):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 13027)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 13028)
+@@ -23,14 +23,23 @@
+ 	error('setflowequation error message');
+ end
+ 
++%Process options
++options=pairoptions(varargin{:});
++options=deleteduplicates(options,1);
++
+ %Find_out what kind of coupling to use
+-options=pairoptions(varargin{:});
+ coupling_method=getfieldvalue(options,'coupling','tiling');
+ if (~strcmpi(coupling_method,'tiling') & ~strcmpi(coupling_method,'penalties')),
+ 	error('coupling type can only be: tiling or penalties');
+ end
+ 
+-[hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin{:});
++%recover elements distribution
++hutterflag   = FlagElements(md,getfieldvalue(options,'hutter',''));
++macayealflag = FlagElements(md,getfieldvalue(options,'macayeal',''));
++pattynflag   = FlagElements(md,getfieldvalue(options,'pattyn',''));
++l1l2flag     = FlagElements(md,getfieldvalue(options,'l1l2',''));
++stokesflag   = FlagElements(md,getfieldvalue(options,'stokes',''));
++filltype     = getfieldvalue(options,'fill','none');
+ 
+ %Flag the elements that have not been flagged as filltype
+ if strcmpi(filltype,'hutter'),
+@@ -279,25 +288,3 @@
+ if any(md.flowequation.borderstokes) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.borderstokes~=1),
+ 	error('error coupling domain too irregular');
+ end
+-end 
+-
+-function [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin); % {{{
+-%RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
+-%
+-%   This routine is called by setelementstype, do not use
+-%
+-%   Usage:
+-%      [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+-
+-	%go through varargin, extract options and plug them into subtype options, by order of appearance
+-	options=pairoptions(varargin{:});
+-	options=deleteduplicates(options,1);
+-
+-	%recover elements distribution
+-	hutterflag  =FlagElements(md,getfieldvalue(options,'hutter',''));
+-	macayealflag=FlagElements(md,getfieldvalue(options,'macayeal',''));
+-	pattynflag  =FlagElements(md,getfieldvalue(options,'pattyn',''));
+-	stokesflag  =FlagElements(md,getfieldvalue(options,'stokes',''));
+-	filltype    =getfieldvalue(options,'fill','none');
+-
+-end %end function }}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13028-13029.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13028-13029.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13028-13029.diff	(revision 13394)
@@ -0,0 +1,44 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13028)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13029)
+@@ -69,8 +69,7 @@
+ 		return string
+ 		#}}}
+ 
+-	def setdefaultparameters(self):
+-		# {{{setdefaultparameters
++	def setdefaultparameters(self): # {{{
+ 		
+ 		#default is incomplete adjoint for now
+ 		self.incomplete_adjoint=1
+@@ -111,7 +110,6 @@
+ 
+ 		return self
+ 	#}}}
+-
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		#Early return
+@@ -128,7 +126,7 @@
+ 		md = checkfield(md,'inversion.nsteps','numel',1,'>=',1)
+ 		md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps],'>=',0)
+ 		md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps])
+-		md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps,num_costfunc],'values',[101,102,103,104,105,201,501,502,503])
++		md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps,num_costfunc],'values',[101,102,103,104,105,201,501,502,503,377,378])
+ 		md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices,num_costfunc],'>=',0)
+ 		md = checkfield(md,'inversion.gradient_only','values',[0,1])
+ 		md = checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps,num_controls])
+@@ -143,7 +141,6 @@
+ 
+ 		return md
+ 	# }}}
+-
+ 	def marshall(self,fid):    # {{{
+ 
+ 		WriteData(fid,'object',self,'fieldname','iscontrol','format','Boolean')
+@@ -186,4 +183,3 @@
+ 		WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3)
+ 		WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer')
+ 	# }}}
+-
Index: /issm/oecreview/Archive/12678-13393/ISSM-13029-13030.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13029-13030.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13029-13030.diff	(revision 13394)
@@ -0,0 +1,645 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.m	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.m	(revision 13030)
+@@ -1,4 +1,4 @@
+-%MISCELANEOUS class definition
++%MISCELLANEOUS class definition
+ %
+ %   Usage:
+ %      miscellaneous=miscellaneous();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13030)
+@@ -138,8 +138,7 @@
+ 			md = checkfield(md,'diagnostic.requested_outputs','size',[float('NaN'),1])
+ 
+ 		#singular solution
+-		#if ~any((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy))==2),
+-		if not any((numpy.logical_not(numpy.isnan(md.diagnostic.spcvx))+numpy.logical_not(numpy.isnan(md.diagnostic.spcvy)))==2):
++		if not any(numpy.logical_and(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx)),numpy.logical_not(numpy.isnan(md.diagnostic.spcvy)))):
+ 			md.checkmessage("model is not well posed (singular). You need at least one node with fixed velocity!")
+ 		#CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
+ 		if any(not numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==0 and not numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==6):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/radaroverlay.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/radaroverlay.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/radaroverlay.py	(revision 13030)
+@@ -2,6 +2,13 @@
+ from fielddisplay import fielddisplay
+ 
+ class radaroverlay(object):
++	"""
++	RADAROVERLAY class definition
++
++	   Usage:
++	      radaroverlay=radaroverlay();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -13,17 +20,17 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   radaroverlay parameters:'
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'pwr','radar power image (matrix)'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'x','corresponding x coordinates'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'y','corresponding y coordinates'))
++		string="%s\n\n%s"%(string,fielddisplay(self,'pwr','radar power image (matrix)'))
++		string="%s\n%s"%(string,fielddisplay(self,'x','corresponding x coordinates'))
++		string="%s\n%s"%(string,fielddisplay(self,'y','corresponding y coordinates'))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.m	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.m	(revision 13030)
+@@ -46,21 +46,9 @@
+ 				if numel(md.qmu.partition)~=md.mesh.numberofvertices,
+ 					md = checkmessage(md,['user supplied partition for qmu analysis should have size md.mesh.numberofvertices x 1 ']);
+ 				end
+-				if find(md.qmu.partition)>=md.mesh.numberofvertices,
+-					md = checkmessage(md,['user supplied partition should be indexed from 0 (c-convention)']);
+-				end
+ 				if min(md.qmu.partition)~=0,
+ 					md = checkmessage(md,['partition vector not indexed from 0 on']);
+ 				end
+-				if max(md.qmu.partition)>=md.mesh.numberofvertices,
+-					md = checkmessage(md,['partition vector cannot have maximum index larger than number of nodes']);
+-				end
+-				if ~isempty(find(md.qmu.partition<0)),
+-					md = checkmessage(md,['partition vector cannot have values less than 0']);
+-				end
+-				if ~isempty(find(md.qmu.partition>=md.qmu.numberofpartitions)),
+-					md = checkmessage(md,['partition vector cannot have values more than md.qmu.numberofpartitions-1']);
+-				end
+ 				if max(md.qmu.partition)>=md.qmu.numberofpartitions,
+ 					md = checkmessage(md,['for qmu analysis, partitioning vector cannot go over npart, number of partition areas']);
+ 				end
+@@ -139,8 +127,8 @@
+ 						fnames{j},size(obj.results.(fnames{j})),class(obj.results.(fnames{j}))));
+ 				end
+ 			end
+-			fielddisplay(obj,'partition','user provided mesh partitionition, defaults to metis if not specified') 
+-			fielddisplay(obj,'numberofpartitions','number of partitions for semi-descrete qmu') 
++			fielddisplay(obj,'partition','user provided mesh partitioning, defaults to metis if not specified') 
++			fielddisplay(obj,'numberofpartitions','number of partitions for semi-discrete qmu') 
+ 			fielddisplay(obj,'variabledescriptors','');
+ 			fielddisplay(obj,'responsedescriptors','');
+ 			fielddisplay(obj,'method','array of dakota_method class');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13030)
+@@ -115,7 +115,7 @@
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flaim","[%s,%s]" % ("1x1",obj.flaim.__class__.__name__),"flaim parameters"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("inversion","[%s,%s]" % ("1x1",obj.inversion.__class__.__name__),"parameters for inverse methods"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("qmu","[%s,%s]" % ("1x1",obj.qmu.__class__.__name__),"dakota properties"))
+-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results'"))
++		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("radaroverlay","[%s,%s]" % ("1x1",obj.radaroverlay.__class__.__name__),"radar image for plot overlay"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("miscellaneous","[%s,%s]" % ("1x1",obj.miscellaneous.__class__.__name__),"miscellaneous fields"))
+ 		return string
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.py	(revision 13030)
+@@ -1,7 +1,19 @@
+ #module imports
++import numpy
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
++from MatlabFuncs import *
+ 
+ class qmu(object):
++	"""
++	QMU class definition
++
++	   Usage:
++	      qmu=qmu();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -26,14 +38,117 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
+-		# {{{ Display
+-		string="   qmu parameters: not implemented yet!"
+-		return string
+-		#}}}
+-		
+-	def setdefaultparameters(obj):
++
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		#Early return
++		if not md.qmu.isdakota:
++			return
++
++		if not md.qmu.params.evaluation_concurrency==1:
++			md.checkmessage("concurrency should be set to 1 when running dakota in library mode")
++		if md.qmu.partition:
++			if not numpy.size(md.qmu.partition)==md.mesh.numberofvertices:
++				md.checkmessage("user supplied partition for qmu analysis should have size md.mesh.numberofvertices x 1")
++			if not min(md.qmu.partition)==0:
++				md.checkmessage("partition vector not indexed from 0 on")
++			if max(md.qmu.partition)>=md.qmu.numberofpartitions:
++				md.checkmessage("for qmu analysis, partitioning vector cannot go over npart, number of partition areas")
++
++		if not strcmpi(md.cluster.name,'none'):
++			if not md.settings.waitonlock:
++				md.checkmessage("waitonlock should be activated when running qmu in parallel mode!")
++
++		return md
++	# }}}
++
++	def __repr__(self):    # {{{
++		s ='   qmu parameters:\n'
++
++		s+="%s\n" % fielddisplay(self,'isdakota','is qmu analysis activated?')
++		for i,variable in enumerate(self.variables):
++			s+="         variables%s:  (arrays of each variable class)\n" % \
++				string_dim(self.variables,i)
++			fnames=vars(variable)
++			maxlen=0
++			for fname in fnames:
++				maxlen=max(maxlen,len(fname))
++
++			for fname in fnames:
++				s+="'            %-*s:    [%ix%i]    '%s'\n" % \
++					(maxlen+1,fname,size(getattr(variable,fname)),type(getattr(variable,fname)))
++
++		for i,response in enumerate(self.responses):
++			s+="         responses%s:  (arrays of each response class)\n" % \
++				string_dim(self.responses,i)
++			fnames=vars(response)
++			maxlen=0
++			for fname in fnames:
++				maxlen=max(maxlen,len(fname))
++
++			for fname in fnames:
++				s+="            %-*s:    [%ix%i]    '%s'\n" % \
++					(maxlen+1,fname,size(getattr(response,fname)),type(getattr(response,fname)))
++
++		s+="%s\n" % fielddisplay(self,'numberofresponses','number of responses') 
++
++		for i,method in enumerate(self.method):
++			if isinstance(method,'dakota_method'):
++				s+="            method%s :    '%s'\n" % \
++					(string_dim(method,i),method.method)
++
++		for i,param in enumerate(self.params):
++			s+="         params%s:  (array of method-independent parameters)\n" % \
++				string_dim(self.params,i)
++			fnames=vars(param)
++			maxlen=0
++			for fname in fnames:
++				maxlen=max(maxlen,len(fname))
++
++			for fname in fnames:
++				s+="            %-*s: %s\n" % \
++					(maxlen+1,fname,any2str(getattr(param,fname)))
++
++		for i,result in enumerate(self.results):
++			s+="         results%s:  (information from dakota files)\n" % \
++				string_dim(self.results,i)
++			fnames=vars(result)
++			maxlen=0
++			for fname in fnames:
++				maxlen=max(maxlen,len(fname))
++
++			for fname in fnames:
++				s+="            %-*s:    [%ix%i]    '%s'\n" % \
++					(maxlen+1,fname,size(getattr(result,fname)),type(getattr(result,fname)))
++
++		s+="%s\n" % fielddisplay(self,'partition','user provided mesh partitioning, defaults to metis if not specified') 
++		s+="%s\n" % fielddisplay(self,'numberofpartitions','number of partitions for semi-discrete qmu') 
++		s+="%s\n" % fielddisplay(self,'variabledescriptors','')
++		s+="%s\n" % fielddisplay(self,'responsedescriptors','')
++		s+="%s\n" % fielddisplay(self,'method','array of dakota_method class')
++		s+="%s\n" % fielddisplay(self,'mass_flux_profile_directory','directory for mass flux profiles')
++		s+="%s\n" % fielddisplay(self,'mass_flux_profiles','list of mass_flux profiles')
++		s+="%s\n" % fielddisplay(self,'mass_flux_segments','')
++		s+="%s\n" % fielddisplay(self,'adjacency','')
++		s+="%s\n" % fielddisplay(self,'vertex_weight','weight applied to each mesh vertex')
++
++		return s
++	# }}}
++		
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'object',self,'fieldname','isdakota','format','Boolean')
++		if not self.isdakota:
++			return
++		WriteData(fid,'object',self,'fieldname','partition','format','DoubleMat','mattype',2)
++		WriteData(fid,'object',self,'fieldname','numberofpartitions','format','Integer')
++		WriteData(fid,'object',self,'fieldname','numberofresponses','format','Integer')
++		WriteData(fid,'object',self,'fieldname','variabledescriptors','format','StringArray')
++		WriteData(fid,'object',self,'fieldname','responsedescriptors','format','StringArray')
++		WriteData(fid,'object',self,'fieldname','mass_flux_segments','format','MatArray')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.py	(revision 13030)
+@@ -1,7 +1,17 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from WriteData import *
+ 
+ class miscellaneous(object):
++	"""
++	MISCELLANEOUS class definition
++
++	   Usage:
++	      miscellaneous=miscellaneous();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -13,18 +23,27 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   miscellaneous parameters:'
+ 
+-		string="%s\n\n%s"%(string,fielddisplay(obj,'notes','notes in a cell of strings'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'name','model name'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'dummy','empty field to store some data'))
++		string="%s\n\n%s"%(string,fielddisplay(self,'notes','notes in a cell of strings'))
++		string="%s\n%s"%(string,fielddisplay(self,'name','model name'))
++		string="%s\n%s"%(string,fielddisplay(self,'dummy','empty field to store some data'))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		md = checkfield(md,'miscellaneous.name','empty',1)
++		return md
++	# }}}
++
++	def marshall(self,fid):    #  {{{
++		WriteData(fid,'object',self,'fieldname','name','format','String')
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py	(revision 13030)
+@@ -1,7 +1,16 @@
+ #module imports
+ from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
+ 
+ class private(object):
++	"""
++	PRIVATE class definition
++
++	   Usage:
++	      private=private();
++	"""
++
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+@@ -14,19 +23,23 @@
+ 		self.setdefaultparameters()
+ 
+ 		#}}}
+-	def __repr__(obj):
++	def __repr__(self):
+ 		# {{{ Display
+ 		string='   private parameters: do not change'
+ 
+-		string="%s\n%s"%(string,fielddisplay(obj,'isconsistent','is model self consistent'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'runtimename','name of the run launched'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'bamg','structure with mesh properties constructed if bamg is used to mesh the domain'))
+-		string="%s\n%s"%(string,fielddisplay(obj,'solution','type of solution launched'))
++		string="%s\n%s"%(string,fielddisplay(self,'isconsistent','is model self consistent'))
++		string="%s\n%s"%(string,fielddisplay(self,'runtimename','name of the run launched'))
++		string="%s\n%s"%(string,fielddisplay(self,'bamg','structure with mesh properties constructed if bamg is used to mesh the domain'))
++		string="%s\n%s"%(string,fielddisplay(self,'solution','type of solution launched'))
+ 		return string
+ 		#}}}
+ 		
+-	def setdefaultparameters(obj):
++	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+-		return obj
++		return self
+ 	#}}}
+ 
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		return md
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13030)
+@@ -110,6 +110,7 @@
+ 
+ 		return self
+ 	#}}}
++
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		#Early return
+@@ -141,6 +142,7 @@
+ 
+ 		return md
+ 	# }}}
++
+ 	def marshall(self,fid):    # {{{
+ 
+ 		WriteData(fid,'object',self,'fieldname','iscontrol','format','Boolean')
+@@ -183,3 +185,4 @@
+ 		WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3)
+ 		WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer')
+ 	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 13030)
+@@ -1,4 +1,3 @@
+-from AnalysisConfiguration import *
+ from EnumDefinitions import *
+ 
+ def AnalysisConfiguration(solutiontype): #{{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py	(revision 13030)
+@@ -111,24 +111,24 @@
+ 	#check greater
+ 	if options.exist('>='):
+ 		lowerbound=options.getfieldvalue('>=')
+-		if numpy.any(field<lowerbound):
++		if any(field<lowerbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values above %d" % (fieldname,lowerbound)))
+ 	if options.exist('>'):
+ 		lowerbound=options.getfieldvalue('>')
+-		if numpy.any(field<=lowerbound):
++		if any(field<=lowerbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values above %d" % (fieldname,lowerbound)))
+ 
+ 	#check smaller
+ 	if options.exist('<='):
+ 		upperbound=options.getfieldvalue('<=')
+-		if numpy.any(field>upperbound):
++		if any(field>upperbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values below %d" % (fieldname,upperbound)))
+ 	if options.exist('<'):
+ 		upperbound=options.getfieldvalue('<')
+-		if numpy.any(field>=upperbound):
++		if any(field>=upperbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values below %d" % (fieldname,upperbound)))
+ 
+@@ -144,10 +144,10 @@
+ 				md = md.checkmessage(options.getfieldvalue('message',\
+ 					"field '%s' should have only one column as there are md.mesh.numberofvertices lines" % fieldname))
+ 		elif numpy.size(field,0)==md.mesh.numberofvertices+1:
+-			if not numpy.all(field[-1,:]==numpy.sort(field[-1,:])):
++			if not all(field[-1,:]==numpy.sort(field[-1,:])):
+ 				md = md.checkmessage(options.getfieldvalue('message',\
+ 					"field '%s' columns should be sorted chronologically" % fieldname))
+-			if nump.any(field[-1,0:-1]==field[-1,1:]):
++			if any(field[-1,0:-1]==field[-1,1:]):
+ 				md = md.checkmessage(options.getfieldvalue('message',\
+ 					"field '%s' columns must not contain duplicate timesteps" % fieldname))
+ 		else:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 13030)
+@@ -68,16 +68,16 @@
+ 	md.diagnostic.icefront=pressureload
+ 
+ 	#Create zeros basalforcings and surfaceforcings
+-	if numpy.isnan(md.surfaceforcings.precipitation).all():
++	if all(numpy.isnan(md.surfaceforcings.precipitation)):
+ 		md.surfaceforcings.precipitation=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no surfaceforcings.precipitation specified: values set as zero'
+-	if numpy.isnan(md.surfaceforcings.mass_balance).all():
++	if all(numpy.isnan(md.surfaceforcings.mass_balance)):
+ 		md.surfaceforcings.mass_balance=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no surfaceforcings.mass_balance specified: values set as zero'
+-	if numpy.isnan(md.basalforcings.melting_rate).all():
++	if all(numpy.isnan(md.basalforcings.melting_rate)):
+ 		md.basalforcings.melting_rate=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no basalforcings.melting_rate specified: values set as zero'
+-	if numpy.isnan(md.balancethickness.thickening_rate).all():
++	if all(numpy.isnan(md.balancethickness.thickening_rate)):
+ 		md.balancethickness.thickening_rate=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no balancethickness.thickening_rate specified: values set as zero'
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.py	(revision 13030)
+@@ -1,6 +1,5 @@
+ import os
+ import datetime
+-from addnote import *
+ 
+ def parameterize(md,parametername):
+ 	"""
+@@ -28,7 +27,7 @@
+ 	if not md.miscellaneous.name:
+ 		md.miscellaneous.name=os.path.basename(parametername).split('.')[0]
+ 
+-	md=addnote(md,"Model created by using parameter file: '%s' on: %s." % (parametername,datetime.datetime.strftime(datetime.datetime.now(),'%c') ))
++	md.miscellaneous.notes="Model created by using parameter file: '%s' on: %s." % (parametername,datetime.datetime.strftime(datetime.datetime.now(),'%c'))
+ 
+ 	return md
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13029)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13030)
+@@ -62,11 +62,11 @@
+ 		pattynflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(macayealflag,stokesflag))))]=1
+ 
+ 	#check that each element has at least one flag
+-	if not numpy.any(hutterflag+macayealflag+pattynflag+stokesflag):
++	if not any(hutterflag+macayealflag+pattynflag+stokesflag):
+ 		raise TypeError("setflowequation error message: elements type not assigned, must be specified")
+ 
+ 	#check that each element has only one flag
+-	if numpy.any(hutterflag+macayealflag+pattynflag+stokesflag>1):
++	if any(hutterflag+macayealflag+pattynflag+stokesflag>1):
+ 		print "setflowequation warning message: some elements have several types, higher order type is used for them"
+ 		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,macayealflag))]=0
+ 		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,pattynflag))]=0
+@@ -74,11 +74,11 @@
+ 
+ 	#Check that no pattyn or stokes for 2d mesh
+ 	if md.mesh.dimension==2:
+-		if numpy.any(numpy.logical_or(stokesflag,pattynflag)):
++		if any(numpy.logical_or(stokesflag,pattynflag)):
+ 			raise TypeError("setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first")
+ 
+ 	#Stokes can only be used alone for now:
+-	if numpy.any(stokesflag) and numpy.any(hutterflag):
++	if any(stokesflag) and any(hutterflag):
+ 		raise TypeError("setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere")
+ 
+ 	#Initialize node fields
+@@ -129,14 +129,14 @@
+ 		bordernodes2d=numpy.nonzero(numpy.logical_and(nodeonpattyn[1:numnodes2d],nodeonmacayeal[1:numnodes2d]))    #Nodes connected to two different types of elements
+ 
+ 		#initialize and fill in penalties structure
+-		if numpy.all(numpy.logical_not(numpy.isnan(bordernodes2d))):
++		if all(numpy.logical_not(numpy.isnan(bordernodes2d))):
+ 			penalties=numpy.zeros((0,2))
+ 			for	i in xrange(1,numlayers):
+ 				penalties=numpy.concatenate((penalties,numpy.concatenate((bordernodes2d,bordernodes2d+md.mesh.numberofvertices2d*(i)),axis=1)),axis=0)
+ 			md.diagnostic.vertex_pairing=penalties
+ 
+ 	elif strcmpi(coupling_method,'tiling'):
+-		if   numpy.any(macayealflag) and numpy.any(pattynflag):    #coupling macayeal pattyn
++		if   any(macayealflag) and any(pattynflag):    #coupling macayeal pattyn
+ 			#Find node at the border
+ 			nodeonmacayealpattyn[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonpattyn))]=1
+ 			#Macayeal elements in contact with this layer become MacAyealPattyn elements
+@@ -151,8 +151,8 @@
+ 			#rule out elements that don't touch the 2 boundaries
+ 			pos=numpy.nonzero(macayealpattynflag)
+ 			elist=numpy.zeros(len(pos))
+-			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
++			elist = elist + any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
+ 			pos1=[i for i,item in enumerate(elist) if item==1]
+ 			macayealflag[pos[pos1]]=1
+ 			macayealpattynflag[pos[pos1]]=0
+@@ -168,7 +168,7 @@
+ 			nodeonmacayealpattyn[:]=0
+ 			nodeonmacayealpattyn[md.mesh.elements[numpy.nonzero(macayealpattynflag),:].astype(int)-1]=1
+ 
+-		elif numpy.any(pattynflag) and numpy.any(stokesflag):    #coupling pattyn stokes
++		elif any(pattynflag) and any(stokesflag):    #coupling pattyn stokes
+ 			#Find node at the border
+ 			nodeonpattynstokes[numpy.nonzero(numpy.logical_and(nodeonpattyn,nodeonstokes))]=1
+ 			#Stokes elements in contact with this layer become PattynStokes elements
+@@ -183,8 +183,8 @@
+ 			#rule out elements that don't touch the 2 boundaries
+ 			pos=numpy.nonzero(pattynstokesflag)
+ 			elist=numpy.zeros(len(pos))
+-			elist = elist + numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist + any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+ 			pos1=[i for i,item in enumerate(elist) if item==1]
+ 			stokesflag[pos[pos1]]=1
+ 			pattynstokesflag[pos[pos1]]=0
+@@ -200,7 +200,7 @@
+ 			nodeonpattynstokes[:]=0
+ 			nodeonpattynstokes[md.mesh.elements[numpy.nonzero(pattynstokesflag),:].astype(int)-1]=1
+ 
+-		elif numpy.any(stokesflag) and numpy.any(macayealflag):
++		elif any(stokesflag) and any(macayealflag):
+ 			#Find node at the border
+ 			nodeonmacayealstokes[numpy.nonzero(numpy.logical_and(nodeonmacayeal,nodeonstokes))]=1
+ 			#Stokes elements in contact with this layer become MacAyealStokes elements
+@@ -215,8 +215,8 @@
+ 			#rule out elements that don't touch the 2 boundaries
+ 			pos=numpy.nonzero(macayealstokesflag)
+ 			elist=numpy.zeros(len(pos))
+-			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
++			elist = elist + any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
+ 			pos1=[i for i,item in enumerate(elist) if item==1]
+ 			macayealflag[pos[pos1]]=1
+ 			macayealstokesflag[pos[pos1]]=0
+@@ -232,7 +232,7 @@
+ 			nodeonmacayealstokes[:]=0
+ 			nodeonmacayealstokes[md.mesh.elements[numpy.nonzero(macayealstokesflag),:].astype(int)-1]=1
+ 
+-		elif numpy.any(stokesflag) and numpy.any(hutterflag):
++		elif any(stokesflag) and any(hutterflag):
+ 			raise TypeError("type of coupling not supported yet")
+ 
+ 	#Create MacaAyealPattynApproximation where needed
+@@ -265,9 +265,9 @@
+ 	md.flowequation.vertex_equation[pos]=5
+ 	pos=numpy.nonzero(nodeonstokes)
+ 	md.flowequation.vertex_equation[pos]=4
+-	if numpy.any(stokesflag):
++	if any(stokesflag):
+ 		pos=numpy.nonzero(numpy.logical_not(nodeonstokes))
+-		if not (numpy.any(pattynflag) or numpy.any(macayealflag)):
++		if not (any(pattynflag) or any(macayealflag)):
+ 			md.flowequation.vertex_equation[pos]=0
+ 	pos=numpy.nonzero(nodeonpattynstokes)
+ 	md.flowequation.vertex_equation[pos]=7
+@@ -275,18 +275,18 @@
+ 	md.flowequation.vertex_equation[pos]=6
+ 
+ 	#figure out solution types
+-	md.flowequation.ishutter=float(numpy.any(md.flowequation.element_equation==1))
+-	md.flowequation.ismacayealpattyn=float(numpy.any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
+-	md.flowequation.isstokes=float(numpy.any(md.flowequation.element_equation==4))
++	md.flowequation.ishutter=float(any(md.flowequation.element_equation==1))
++	md.flowequation.ismacayealpattyn=float(any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
++	md.flowequation.isstokes=float(any(md.flowequation.element_equation==4))
+ 
+ 	return md
+ 
+ 	#Check that tiling can work:
+-	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal !=1):
++	if any(md.flowequation.bordermacayeal) and any(md.flowequation.borderpattyn) and any(md.flowequation.borderpattyn + md.flowequation.bordermacayeal !=1):
+ 		raise TypeError("error coupling domain too irregular")
+-	if numpy.any(md.flowequation.bordermacayeal) and numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderstokes + md.flowequation.bordermacayeal !=1):
++	if any(md.flowequation.bordermacayeal) and any(md.flowequation.borderstokes) and any(md.flowequation.borderstokes + md.flowequation.bordermacayeal !=1):
+ 		raise TypeError("error coupling domain too irregular")
+-	if numpy.any(md.flowequation.borderstokes) and numpy.any(md.flowequation.borderpattyn) and numpy.any(md.flowequation.borderpattyn + md.flowequation.borderstokes !=1):
++	if any(md.flowequation.borderstokes) and any(md.flowequation.borderpattyn) and any(md.flowequation.borderpattyn + md.flowequation.borderstokes !=1):
+ 		raise TypeError("error coupling domain too irregular")
+ 
+ 	return md
Index: /issm/oecreview/Archive/12678-13393/ISSM-13030-13031.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13030-13031.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13030-13031.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13030)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13031)
+@@ -4,12 +4,6 @@
+ from MatlabFuncs import *
+ from FlagElements import *
+ 
+-
+-	#recover elements distribution
+-
+-
+-	return hutterflag,macayealflag,pattynflag,stokesflag,filltype
+-#}}}
+ def setflowequation(md,*args):
+ 	"""
+ 	SETELEMENTSTYPE - associate a solution type to each element
Index: /issm/oecreview/Archive/12678-13393/ISSM-13031-13032.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13031-13032.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13031-13032.diff	(revision 13394)
@@ -0,0 +1,196 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py	(revision 13031)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py	(revision 13032)
+@@ -49,7 +49,7 @@
+ 		md = checkfield(md,'groundingline.migration','values',['None','AgressiveMigration','SoftMigration'])
+ 
+ 		if not strcmp(self.migration,'None'):
+-			if any(numpy.isnan(md.geometry.bathymetry)):
++			if numpy.any(numpy.isnan(md.geometry.bathymetry)):
+ 				md.checkmessage("requesting grounding line migration, but bathymetry is absent!")
+ 			pos=numpy.nonzero(md.mask.vertexongroundedice)
+ 			if any(numpy.abs(md.geometry.bed[pos]-md.geometry.bathymetry[pos])>10**-10):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py	(revision 13031)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.py	(revision 13032)
+@@ -136,7 +136,7 @@
+ 			md = checkfield(md,'mesh.elements','size',[md.mesh.numberofelements,3])
+ 		else:
+ 			md = checkfield(md,'mesh.elements','size',[md.mesh.numberofelements,6])
+-		if any(numpy.logical_not(ismember(range(1,md.mesh.numberofvertices+1),md.mesh.elements))):
++		if numpy.any(numpy.logical_not(ismember(range(1,md.mesh.numberofvertices+1),md.mesh.elements))):
+ 			md.checkmessage("orphan nodes have been found. Check the mesh outline")
+ 		md = checkfield(md,'mesh.dimension','values',[2,3])
+ 		md = checkfield(md,'mesh.numberoflayers','>=',0)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13031)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13032)
+@@ -138,7 +138,7 @@
+ 			md = checkfield(md,'diagnostic.requested_outputs','size',[float('NaN'),1])
+ 
+ 		#singular solution
+-		if not any(numpy.logical_and(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx)),numpy.logical_not(numpy.isnan(md.diagnostic.spcvy)))):
++		if not numpy.any(numpy.logical_and(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx)),numpy.logical_not(numpy.isnan(md.diagnostic.spcvy)))):
+ 			md.checkmessage("model is not well posed (singular). You need at least one node with fixed velocity!")
+ 		#CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
+ 		if any(not numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==0 and not numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==6):
+@@ -147,7 +147,7 @@
+ 		if any(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==0):
+ 			pos=[i for i,item in enumerate(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)) if item==0]
+ #			numpy.inner (and numpy.dot) calculate all the dot product permutations, resulting in a full matrix multiply
+-#			if any(numpy.abs(numpy.inner(md.diagnostic.referential[pos,0:2],md.diagnostic.referential[pos,3:5]).diagonal())>sys.float_info.epsilon):
++#			if numpy.any(numpy.abs(numpy.inner(md.diagnostic.referential[pos,0:2],md.diagnostic.referential[pos,3:5]).diagonal())>sys.float_info.epsilon):
+ #				md.checkmessage("Vectors in diagnostic.referential (columns 1 to 3 and 4 to 6) must be orthogonal")
+ 			for item in md.diagnostic.referential[pos,:]:
+ 				if numpy.abs(numpy.inner(item[0:2],item[3:5]))>sys.float_info.epsilon:
+@@ -155,7 +155,7 @@
+ 		#CHECK THAT NO rotation specified for FS Grounded ice at base
+ 		if md.mesh.dimension==3 and md.flowequation.isstokes:
+ 			pos=numpy.nonzero(numpy.logical_and(md.mask.vertexongroundedice,md.mesh.vertexonbed))
+-			if any(not numpy.isnan(md.diagnostic.referential[pos,:])):
++			if numpy.any(numpy.logical_not(numpy.isnan(md.diagnostic.referential[pos,:]))):
+ 				md.checkmessage("no referential should be specified for basal vertices of grounded ice")
+ 
+ 		return md
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py	(revision 13031)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.py	(revision 13032)
+@@ -53,7 +53,7 @@
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 		if DiagnosticHorizAnalysisEnum() in analyses:
+-			if not any(numpy.isnan(md.initialization.vx) or numpy.isnan(md.initialization.vy)):
++			if not numpy.any(numpy.logical_or(numpy.isnan(md.initialization.vx),numpy.isnan(md.initialization.vy))):
+ 				md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
+ 				md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices])
+ 		if PrognosticAnalysisEnum() in analyses:
+@@ -65,8 +65,8 @@
+ 			md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
+ 			md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices])
+ 			#Triangle with zero velocity
+-			if any(numpy.logical_and(numpy.sum(numpy.abs(md.initialization.vx[md.mesh.elements.astype(int)-1]),axis=1)==0,\
+-			                         numpy.sum(numpy.abs(md.initialization.vy[md.mesh.elements.astype(int)-1]),axis=1)==0)):
++			if numpy.any(numpy.logical_and(numpy.sum(numpy.abs(md.initialization.vx[md.mesh.elements.astype(int)-1]),axis=1)==0,\
++			                               numpy.sum(numpy.abs(md.initialization.vy[md.mesh.elements.astype(int)-1]),axis=1)==0)):
+ 				md.checkmessage("at least one triangle has all its vertices with a zero velocity")
+ 		if ThermalAnalysisEnum() in analyses:
+ 			md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py	(revision 13031)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py	(revision 13032)
+@@ -67,7 +67,7 @@
+ 			return md
+ 
+ 		md = checkfield(md,'flaim.tracks','file',1)
+-		if any(numpy.isnan(md.flaim.criterion)) or not md.flaim.criterion:
++		if numpy.any(numpy.isnan(md.flaim.criterion)) or not md.flaim.criterion:
+ 			md = checkfield(md,'flaim.targets','file',1)
+ 		else:
+ 			md = checkfield(md,'flaim.criterion','numel',[md.mesh.numberofvertices,md.mesh.numberofelements])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 13031)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 13032)
+@@ -70,7 +70,7 @@
+ 
+ 		if DiagnosticHutterAnalysisEnum() in analyses:
+ 			if any(md.flowequation.element_equation==1):
+-				if any(numpy.logical_and(md.flowequation.element_equation,md.mask.elementonfloatingice)):
++				if numpy.any(numpy.logical_and(md.flowequation.element_equation,md.mask.elementonfloatingice)):
+ 					print "\n !!! Warning: Hutter's model is not consistent on ice shelves !!!\n"
+ 
+ 		return md
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 13031)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 13032)
+@@ -68,16 +68,16 @@
+ 	md.diagnostic.icefront=pressureload
+ 
+ 	#Create zeros basalforcings and surfaceforcings
+-	if all(numpy.isnan(md.surfaceforcings.precipitation)):
++	if numpy.all(numpy.isnan(md.surfaceforcings.precipitation)):
+ 		md.surfaceforcings.precipitation=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no surfaceforcings.precipitation specified: values set as zero'
+-	if all(numpy.isnan(md.surfaceforcings.mass_balance)):
++	if numpy.all(numpy.isnan(md.surfaceforcings.mass_balance)):
+ 		md.surfaceforcings.mass_balance=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no surfaceforcings.mass_balance specified: values set as zero'
+-	if all(numpy.isnan(md.basalforcings.melting_rate)):
++	if numpy.all(numpy.isnan(md.basalforcings.melting_rate)):
+ 		md.basalforcings.melting_rate=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no basalforcings.melting_rate specified: values set as zero'
+-	if all(numpy.isnan(md.balancethickness.thickening_rate)):
++	if numpy.all(numpy.isnan(md.balancethickness.thickening_rate)):
+ 		md.balancethickness.thickening_rate=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no balancethickness.thickening_rate specified: values set as zero'
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13031)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13032)
+@@ -68,7 +68,7 @@
+ 
+ 	#Check that no pattyn or stokes for 2d mesh
+ 	if md.mesh.dimension==2:
+-		if any(numpy.logical_or(stokesflag,pattynflag)):
++		if numpy.any(numpy.logical_or(stokesflag,pattynflag)):
+ 			raise TypeError("setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first")
+ 
+ 	#Stokes can only be used alone for now:
+@@ -123,7 +123,7 @@
+ 		bordernodes2d=numpy.nonzero(numpy.logical_and(nodeonpattyn[1:numnodes2d],nodeonmacayeal[1:numnodes2d]))    #Nodes connected to two different types of elements
+ 
+ 		#initialize and fill in penalties structure
+-		if all(numpy.logical_not(numpy.isnan(bordernodes2d))):
++		if numpy.all(numpy.logical_not(numpy.isnan(bordernodes2d))):
+ 			penalties=numpy.zeros((0,2))
+ 			for	i in xrange(1,numlayers):
+ 				penalties=numpy.concatenate((penalties,numpy.concatenate((bordernodes2d,bordernodes2d+md.mesh.numberofvertices2d*(i)),axis=1)),axis=0)
+@@ -145,8 +145,8 @@
+ 			#rule out elements that don't touch the 2 boundaries
+ 			pos=numpy.nonzero(macayealpattynflag)
+ 			elist=numpy.zeros(len(pos))
+-			elist = elist + any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
++			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
+ 			pos1=[i for i,item in enumerate(elist) if item==1]
+ 			macayealflag[pos[pos1]]=1
+ 			macayealpattynflag[pos[pos1]]=0
+@@ -177,8 +177,8 @@
+ 			#rule out elements that don't touch the 2 boundaries
+ 			pos=numpy.nonzero(pattynstokesflag)
+ 			elist=numpy.zeros(len(pos))
+-			elist = elist + any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist + numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+ 			pos1=[i for i,item in enumerate(elist) if item==1]
+ 			stokesflag[pos[pos1]]=1
+ 			pattynstokesflag[pos[pos1]]=0
+@@ -209,8 +209,8 @@
+ 			#rule out elements that don't touch the 2 boundaries
+ 			pos=numpy.nonzero(macayealstokesflag)
+ 			elist=numpy.zeros(len(pos))
+-			elist = elist + any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			elist = elist - any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
++			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
++			elist = elist - numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
+ 			pos1=[i for i,item in enumerate(elist) if item==1]
+ 			macayealflag[pos[pos1]]=1
+ 			macayealstokesflag[pos[pos1]]=0
+@@ -270,7 +270,7 @@
+ 
+ 	#figure out solution types
+ 	md.flowequation.ishutter=float(any(md.flowequation.element_equation==1))
+-	md.flowequation.ismacayealpattyn=float(any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
++	md.flowequation.ismacayealpattyn=float(numpy.any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
+ 	md.flowequation.isstokes=float(any(md.flowequation.element_equation==4))
+ 
+ 	return md
Index: /issm/oecreview/Archive/12678-13393/ISSM-13032-13033.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13032-13033.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13032-13033.diff	(revision 13394)
@@ -0,0 +1,65 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13032)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13033)
+@@ -27,6 +27,7 @@
+ //void WriteData(PyObject* py_tuple,double scalar);
+ //void WriteData(DataHandle* py_tuple,Parameters* parameters);
+ void WriteData(PyObject* py_tuple, int index, double* matrix, int M,int N);
++void WriteData(PyObject* py_tuple, int index, int integer);
+ void WriteData(PyObject* py_tuple, int index, char* string);
+ void WriteData(PyObject* py_tuple, int index, Matrix* matrix);
+ void WriteData(PyObject* py_tuple, int index, Vector* vector);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13032)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13033)
+@@ -20,6 +20,12 @@
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+ 
++/*FUNCTION WriteData(PyObject* py_tuple,int index,int integer){{{*/
++void WriteData(PyObject* py_tuple, int index, int integer){
++	
++	PyTuple_SetItem(py_tuple, index, PyInt_FromSsize_t(integer));
++
++}/*}}}*/
+ /*FUNCTION WriteData(PyObject* py_tuple,int index,char* string){{{*/
+ void WriteData(PyObject* py_tuple, int index, char* string){
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13032)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13033)
+@@ -3,9 +3,11 @@
+ #Bin programs {{{1
+ if MODULES
+ bin_PROGRAMS = ElementConnectivity\
++			   EnumToString\
+ 			   InterpFromMeshToMesh2d \
+ 			   NodeConnectivity\
+-			   TriMesh 
++			   StringToEnum\
++			   TriMesh
+ endif 
+ #}}}
+ #Flags and libraries {{{1
+@@ -31,12 +33,18 @@
+ ElementConnectivity_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+ 			  ../ElementConnectivity/ElementConnectivity.h
+ 
++EnumToString_SOURCES = ../EnumToString/EnumToString.cpp\
++			  ../EnumToString/EnumToString.h
++
+ InterpFromMeshToMesh2d_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
+ 							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+ 
+ NodeConnectivity_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
+ 										../NodeConnectivity/NodeConnectivity.h
+ 
++StringToEnum_SOURCES = ../StringToEnum/StringToEnum.cpp\
++			  ../StringToEnum/StringToEnum.h
++
+ TriMesh_SOURCES = ../TriMesh/TriMesh.cpp\
+ 			  ../TriMesh/TriMesh.h
+ #}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13033-13034.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13033-13034.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13033-13034.diff	(revision 13394)
@@ -0,0 +1,182 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.cpp	(revision 13033)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.cpp	(revision 13034)
+@@ -4,16 +4,17 @@
+ 
+ #include "./EnumToString.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++WRAPPER(EnumToString){
+ 
+ 	char    *name    = NULL;
+ 	int      enum_in;
+ 
+-	/*checks on arguments on the matlab side: */
+-	if(nrhs!=NRHS){
+-		EnumToStringUsage(); _error2_("usage. See above");
+-	}
++	/*Boot module: */
++	MODULEBOOT();
+ 
++	/*checks on arguments: */
++	CHECKARGUMENTS(NLHS,NRHS,&EnumToStringUsage);
++
+ 	/*Fetch inputs: */
+ 	FetchData(&enum_in,ENUMIN);
+ 
+@@ -22,6 +23,9 @@
+ 
+ 	/* output: */
+ 	WriteData(NAME,name);
++
++	/*end module: */
++	MODULEEND();
+ }
+ 
+ void EnumToStringUsage(void)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h	(revision 13033)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h	(revision 13034)
+@@ -5,21 +5,38 @@
+ #ifndef _ENUMTOSTRING_H
+ #define _ENUMTOSTRING_H
+ 
+-/* local prototypes: */
+-void EnumToStringUsage(void);
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
+ 
++/*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
++#ifdef _HAVE_PYTHON_
++#define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
++#endif
++
++/*Header files: */
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+ #include "../../c/shared/shared.h"
+ #include "../../c/issm-binding.h"
+     
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define ENUMIN (mxArray*)prhs[0]
+-
+ /* serial output macros: */
+ #define NAME (mxArray**)&plhs[0]
++#endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define ENUMIN PyTuple_GetItem(args,0)
++/* serial output macros: */
++#define NAME output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+@@ -29,4 +46,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "EnumToString"
+ 
++/* local prototypes: */
++void EnumToStringUsage(void);
++
+ #endif  /* _TEST_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.cpp	(revision 13033)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.cpp	(revision 13034)
+@@ -4,16 +4,17 @@
+ 
+ #include "./StringToEnum.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++WRAPPER(StringToEnum){
+ 
+ 	char    *name    = NULL;
+ 	int      enum_out;
+ 
+-	/*checks on arguments on the matlab side: */
+-	if(nrhs!=NRHS){
+-		StringToEnumUsage(); _error2_("usage. See above");
+-	}
++	/*Boot module: */
++	MODULEBOOT();
+ 
++	/*checks on arguments: */
++	CHECKARGUMENTS(NLHS,NRHS,&StringToEnumUsage);
++
+ 	/*Fetch inputs: */
+ 	FetchData(&name,NAME);
+ 
+@@ -22,6 +23,9 @@
+ 
+ 	/* output: */
+ 	WriteData(ENUMOUT,enum_out);
++
++	/*end module: */
++	MODULEEND();
+ }
+ 
+ void StringToEnumUsage(void)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h	(revision 13033)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h	(revision 13034)
+@@ -5,21 +5,38 @@
+ #ifndef _STRINGTOENUM_H
+ #define _STRINGTOENUM_H
+ 
+-/* local prototypes: */
+-void StringToEnumUsage(void);
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
+ 
++/*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
++#ifdef _HAVE_PYTHON_
++#define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
++#endif
++
++/*Header files: */
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+ #include "../../c/shared/shared.h"
+ #include "../../c/issm-binding.h"
+     
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define NAME (mxArray*)prhs[0]
+-
+ /* serial output macros: */
+ #define ENUMOUT (mxArray**)&plhs[0]
++#endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define NAME PyTuple_GetItem(args,0)
++/* serial output macros: */
++#define ENUMOUT output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+@@ -29,4 +46,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "StringToEnum"
+ 
++/* local prototypes: */
++void StringToEnumUsage(void);
++
+ #endif  /* _TEST_H */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13034-13035.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13034-13035.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13034-13035.diff	(revision 13394)
@@ -0,0 +1,56 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h	(revision 13034)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h	(revision 13035)
+@@ -22,16 +22,6 @@
+ /*Printing macro: only cpu number 0 */
+ #define _printf_(flag,...) do{if(flag) PrintfFunction(__VA_ARGS__);}while(0)
+ /*}}}*/
+-/* _error_ {{{*/
+-/*Error exception macro*/
+-#ifdef _INTEL_WIN_
+-#define _error_(...)\
+-  throw ErrorException(exprintf(__VA_ARGS__))
+-#else
+-#define _error_(...)\
+-  throw ErrorException(__FILE__,__func__,__LINE__,exprintf(__VA_ARGS__))
+-#endif
+-/*}}}*/
+ /* _error2_ {{{*/
+ /*new Error exception macro*/
+ #ifdef _INTEL_WIN_
+@@ -74,7 +64,7 @@
+ /*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/
+ #ifdef _ISSM_DEBUG_ 
+ #define _assert_(statement)\
+-  if (!(statement)) _error_("Assertion \"%s\" failed, please report bug to %s",#statement,PACKAGE_BUGREPORT)
++  if (!(statement)) _error2_("Assertion \""<<#statement<<"\" failed, please report bug to "<<PACKAGE_BUGREPORT)
+ #else
+ #define _assert_(ignore)\
+   ((void) 0)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp	(revision 13034)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp	(revision 13035)
+@@ -29,7 +29,7 @@
+ 	_pprintLine_("PETSc elapsed flops : " << Current_flops << "  Flops");
+ 	_pprintLine_("PETSc memory used   : " << memUse << "  Bytes");
+ 	#else
+-		_error_("Profiling not supported under this numerical toolkit");
++		_error2_("Profiling not supported under this numerical toolkit");
+ 	#endif
+ 
+ 	/*Assign pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp	(revision 13034)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp	(revision 13035)
+@@ -22,7 +22,7 @@
+ 		PetscGetTime(&Time_start);
+ 		PetscGetFlops(&Flops_start );
+ 	#else
+-		_error_("Profiling not supported under this numerical toolkit");
++		_error2_("Profiling not supported under this numerical toolkit");
+ 	#endif
+ 
+ 	/*Assign pointers: */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13035-13036.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13035-13036.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13035-13036.diff	(revision 13394)
@@ -0,0 +1,11782 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 13036)
+@@ -71,7 +71,7 @@
+ 	res=nKUoldF/nF;
+ 	if (xIsNan<IssmDouble>(res)){
+ 		_pprintLine_("norm nf = " << nF << "f and norm kuold = " << nKUoldF << "f");
+-		_error2_("mechanical equilibrium convergence criterion is NaN!");
++		_error_("mechanical equilibrium convergence criterion is NaN!");
+ 	}
+ 
+ 	//clean up
+@@ -95,7 +95,7 @@
+ 		duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
+ 		ndu=duf->Norm(NORM_TWO); nu=old_uf->Norm(NORM_TWO);
+ 
+-		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error2_("convergence criterion is NaN!");
++		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!");
+ 
+ 		//clean up
+ 		xdelete(&duf);
+@@ -120,7 +120,7 @@
+ 		//compute max(du)
+ 		duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
+ 		ndu=duf->Norm(NORM_TWO); nduinf=duf->Norm(NORM_INF);
+-		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error2_("convergence criterion is NaN!");
++		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!");
+ 
+ 		//clean up
+ 		xdelete(&duf);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 13036)
+@@ -28,74 +28,74 @@
+ 			#ifdef _HAVE_DIAGNOSTIC_
+ 			solutioncore=&diagnostic_core;
+ 			#else
+-			_error2_("ISSM was not compiled with diagnostic capabilities. Exiting");
++			_error_("ISSM was not compiled with diagnostic capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case SteadystateSolutionEnum:
+ 			#ifdef _HAVE_STEADYSTATE_
+ 			solutioncore=&steadystate_core;
+ 			#else
+-			_error2_("ISSM was not compiled with steady state capabilities. Exiting");
++			_error_("ISSM was not compiled with steady state capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case ThermalSolutionEnum:
+ 			#ifdef _HAVE_THERMAL_
+ 			solutioncore=&thermal_core;
+ 			#else
+-			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
++			_error_("ISSM was not compiled with thermal capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case EnthalpySolutionEnum:
+ 			#ifdef _HAVE_THERMAL_
+ 			solutioncore=&enthalpy_core;
+ 			#else
+-			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
++			_error_("ISSM was not compiled with thermal capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case BalancethicknessSolutionEnum:
+ 			#ifdef _HAVE_BALANCED_
+ 			solutioncore=&balancethickness_core;
+ 			#else
+-			_error2_("ISSM was not compiled with balanced capabilities. Exiting");
++			_error_("ISSM was not compiled with balanced capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case HydrologySolutionEnum:
+ 			#ifdef _HAVE_HYDROLOGY_
+ 			solutioncore=&hydrology_core;
+ 			#else
+-			_error2_("ISSM was not compiled with hydrology capabilities. Exiting");
++			_error_("ISSM was not compiled with hydrology capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case SurfaceSlopeSolutionEnum:
+ 			#ifdef _HAVE_SLOPE_
+ 			solutioncore=&surfaceslope_core;
+ 			#else
+-			_error2_("ISSM was not compiled with slope capabilities. Exiting");
++			_error_("ISSM was not compiled with slope capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case BedSlopeSolutionEnum:
+ 			#ifdef _HAVE_SLOPE_
+ 			solutioncore=&bedslope_core;
+ 			#else
+-			_error2_("ISSM was not compiled with slope capabilities. Exiting");
++			_error_("ISSM was not compiled with slope capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case TransientSolutionEnum:
+ 			#ifdef _HAVE_TRANSIENT_
+ 			solutioncore=&transient_core;
+ 			#else
+-			_error2_("ISSM was not compiled with transient capabilities. Exiting");
++			_error_("ISSM was not compiled with transient capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case PrognosticSolutionEnum:
+ 			#ifdef _HAVE_PROGNOSTIC_
+ 			solutioncore=&prognostic_core;
+ 			#else
+-			_error2_("ISSM was not compiled with prognostic capabilities. Exiting");
++			_error_("ISSM was not compiled with prognostic capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		default:
+-			_error2_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
++			_error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
+ 			break;
+ 	}
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp	(revision 13036)
+@@ -51,7 +51,7 @@
+ 			enthalpy_core(femmodel);
+ 		}
+ 		#else
+-		_error2_("ISSM was not compiled with thermal capabilities. Exiting");
++		_error_("ISSM was not compiled with thermal capabilities. Exiting");
+ 		#endif
+ 
+ 		if(VerboseSolution()) _pprintLine_("   computing new velocity");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/WriteLockFile.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/WriteLockFile.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/WriteLockFile.cpp	(revision 13036)
+@@ -16,10 +16,10 @@
+ 	/* Open lock file and write 1 into it: */
+ 	if(my_rank==0){
+ 		fid=fopen(filename,"w");
+-		if(fid==NULL) _error2_("error message: could not open lock file " << filename);
++		if(fid==NULL) _error_("error message: could not open lock file " << filename);
+ 
+ 		/*Close file: */
+-		if(fclose(fid)!=0) _error2_("could not close lock file " << filename);
++		if(fclose(fid)!=0) _error_("could not close lock file " << filename);
+ 	}
+ 
+ }	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 13036)
+@@ -16,9 +16,9 @@
+ 	char *petscfilename  = NULL;
+ 	char *lockfilename   = NULL;
+ 
+-	if(argc<2)_error2_("Usage error: no solution requested");
++	if(argc<2)_error_("Usage error: no solution requested");
+ 	*solution_type=StringToEnumx(argv[1]);
+-	if(argc<3)_error2_("Usage error: missing model name");
++	if(argc<3)_error_("Usage error: missing model name");
+ 	modelname=argv[3];
+ 	binfilename    = xNew<char>(strlen(modelname)+strlen(".bin")   +1); sprintf(binfilename,   "%s%s",modelname,".bin");
+ 	outbinfilename = xNew<char>(strlen(modelname)+strlen(".outbin")+1); sprintf(outbinfilename,"%s%s",modelname,".outbin");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 13036)
+@@ -36,8 +36,8 @@
+ 
+ 	/*Check that gradient is clean*/
+ 	norm_inf=new_gradient->Norm(NORM_INF);
+-	if(norm_inf<=0)    _error2_("||∂J/∂α||∞ = 0    gradient norm is zero");
+-	if(xIsNan<IssmDouble>(norm_inf))_error2_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
++	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);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 13036)
+@@ -34,7 +34,7 @@
+ 			adjointcore=&adjointbalancethickness_core;
+ 			break;
+ 		default:
+-			_error2_("No adjoint has been implemented for solution " << EnumToStringx(solutiontype) << " yet");
++			_error_("No adjoint has been implemented for solution " << EnumToStringx(solutiontype) << " yet");
+ 			break;
+ 	}
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 13036)
+@@ -109,7 +109,7 @@
+ 			break;
+ 		
+ 		default:
+-			_error2_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
++			_error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
+ 			break;
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13036)
+@@ -52,7 +52,7 @@
+ 	/*Initialize environments: Petsc, MPI, etc...: */
+ 	#ifdef _HAVE_PETSC_
+ 	ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
+-	if(ierr) _error2_("Could not initialize Petsc");
++	if(ierr) _error_("Could not initialize Petsc");
+ 	#else
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Init(&argc,&argv);
+@@ -127,7 +127,7 @@
+ 		#ifdef _HAVE_DAKOTA_
+ 		Dakotax(femmodel);
+ 		#else
+-		_error2_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!");
++		_error_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!");
+ 		#endif
+ 	}
+ 	else if(control_analysis){
+@@ -137,7 +137,7 @@
+ 		else
+ 		 control_core(femmodel);
+ 		#else
+-		_error2_("ISSM was not compiled with control support, cannot carry out dakota analysis!");
++		_error_("ISSM was not compiled with control support, cannot carry out dakota analysis!");
+ 		#endif
+ 	}
+ 	else{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 13036)
+@@ -103,7 +103,7 @@
+ 				enthalpy_core(femmodel);
+ 			}
+ 			#else
+-			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
++			_error_("ISSM was not compiled with thermal capabilities. Exiting");
+ 			#endif
+ 		}
+ 		
+@@ -112,7 +112,7 @@
+ 			#ifdef _HAVE_DIAGNOSTIC_
+ 			diagnostic_core(femmodel);
+ 			#else
+-			_error2_("ISSM was not compiled with diagnostic capabilities. Exiting");
++			_error_("ISSM was not compiled with diagnostic capabilities. Exiting");
+ 			#endif
+ 		}
+ 
+@@ -128,7 +128,7 @@
+ 			#ifdef _HAVE_GROUNDINGLINE_
+ 			GroundinglineMigrationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+ 			#else
+-			_error2_("ISSM was not compiled with grounding line migration capabilities. Exiting");
++			_error_("ISSM was not compiled with grounding line migration capabilities. Exiting");
+ 			#endif
+ 		}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 13036)
+@@ -48,7 +48,7 @@
+ 		femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
+ 	}
+ 	else{
+-		_error2_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
++		_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+ 	}
+ 
+ 	/*update parameter according to scalar: */ //false means: do not save control
+@@ -65,7 +65,7 @@
+ 		solver_linear(femmodel); 
+ 	}
+ 	else{
+-		_error2_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
++		_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+ 	}
+ 
+ 	/*Compute misfit for this velocity field.*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13036)
+@@ -39,7 +39,7 @@
+ 	/*Initialize environments: Petsc, MPI, etc...: */
+ #ifdef _HAVE_PETSC_
+ 	int ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
+-	if(ierr) _error2_("Could not initialize Petsc");
++	if(ierr) _error_("Could not initialize Petsc");
+ #else
+ #ifdef _HAVE_MPI_
+ 	MPI_Init(&argc,&argv);
+@@ -121,7 +121,7 @@
+ 	char *outbinfilename = NULL;
+ 	char *lockfilename   = NULL;
+ 
+-	if(argc<2)_error2_("Usage error: missing model name");
++	if(argc<2)_error_("Usage error: missing model name");
+ 	modelname=argv[2];
+ 	binfilename    = xNew<char>((strlen(modelname)+strlen(".bin")   +1)); sprintf(binfilename,   "%s%s",modelname,".bin");
+ 	outbinfilename = xNew<char>((strlen(modelname)+strlen(".outbin")+1)); sprintf(outbinfilename,"%s%s",modelname,".outbin");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13036)
+@@ -41,7 +41,7 @@
+ 	int argc; char **args=NULL;
+ 	PetscGetArgs(&argc,&args);
+ 	ierr = TaoInitialize(&argc,&args,(char*)0,"");
+-	if(ierr) _error2_("Could not initialize Tao");
++	if(ierr) _error_("Could not initialize Tao");
+ 
+ 	/*Recover some parameters*/
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+@@ -184,6 +184,6 @@
+ 
+ #else
+ void controltao_core(FemModel* femmodel){
+-	_error2_("TAO not installed or PETSc version not supported");
++	_error_("TAO not installed or PETSc version not supported");
+ }
+ #endif //_HAVE_TAO_ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 13036)
+@@ -26,7 +26,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"double")){
+-		_error2_("Value of option \"" << odouble->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error_("Value of option \"" << odouble->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	FetchData(&odouble->values,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]);
+ 
+@@ -44,7 +44,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"logical")){
+-		_error2_("Value of option \"" << ological->name  << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error_("Value of option \"" << ological->name  << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	FetchData(&ological->values,&ological->numel,&ological->ndims,&ological->size,prhs[0]);
+ 
+@@ -62,7 +62,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"char")){
+-		_error2_("Value of option \"" << ochar->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error_("Value of option \"" << ochar->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	FetchData(&ochar->values,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]);
+ 
+@@ -86,7 +86,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"struct")){
+-		_error2_("Value of option \"" << ostruct->name  << "\" must be class \"struct\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error_("Value of option \"" << ostruct->name  << "\" must be class \"struct\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	ostruct->numel=mxGetNumberOfElements(prhs[0]);
+ 	ostruct->ndims=mxGetNumberOfDimensions(prhs[0]);
+@@ -132,7 +132,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"cell")){
+-		_error2_("Value of option \"" << ocell->name  << "\" must be class \"cell\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error_("Value of option \"" << ocell->name  << "\" must be class \"cell\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 
+ 	ocell->numel=mxGetNumberOfElements(prhs[0]);
+@@ -180,7 +180,7 @@
+ 			option=(Option*)OptionStructParse(name,(const mxArray**)lhs);
+ 			mxDestroyArray(lhs[0]);
+ 		}
+-		else _error2_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\".");
++		else _error_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 
+ 	return(option);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp	(revision 13036)
+@@ -21,11 +21,11 @@
+ 		if (NRHS==0 && NLHS==0)return 1;
+ 		/* special case: */
+ 		function();
+-		_error2_("usage: see above");
++		_error_("usage: see above");
+ 	}
+ 	else if (nlhs!=NLHS || nrhs!=NRHS ) {
+ 		function(); 
+-		_error2_("usage error.");
++		_error_("usage error.");
+ 	}
+ 	return 1;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13036)
+@@ -47,7 +47,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -88,7 +88,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -133,7 +133,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -175,7 +175,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -237,7 +237,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -268,7 +268,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -300,7 +300,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -332,7 +332,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -364,7 +364,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -380,7 +380,7 @@
+ 
+ 	/*Ok, the string should be coming directly from the matlab workspace: */
+ 	if (!mxIsClass(dataref,"char")){
+-		_error2_("input data_type is not a string!");
++		_error_("input data_type is not a string!");
+ 	}
+ 	else{
+ 		/*Recover the string:*/
+@@ -415,7 +415,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -433,7 +433,7 @@
+ 	double scalar;
+ 
+ 	if (!mxIsClass(dataref,"double")){
+-		_error2_("input data_type is not a double!");
++		_error_("input data_type is not a double!");
+ 	}
+ 	else{
+ 		/*Recover the double: */
+@@ -450,7 +450,7 @@
+ 	int integer;
+ 
+ 	if (!mxIsClass(dataref,"double")){
+-		_error2_("input data_type is not a scalar!");
++		_error_("input data_type is not a scalar!");
+ 	}
+ 	else{
+ 		/*Recover the double: */
+@@ -467,12 +467,12 @@
+ 	bool* mxbool_ptr=NULL;
+ 
+ 	if (mxIsClass(dataref,"logical")){
+-		if(mxGetM(dataref)!=1) _error2_("input data is not of size 1x1");
+-		if(mxGetN(dataref)!=1) _error2_("input data is not of size 1x1");
++		if(mxGetM(dataref)!=1) _error_("input data is not of size 1x1");
++		if(mxGetN(dataref)!=1) _error_("input data is not of size 1x1");
+ 		mxbool_ptr=mxGetLogicals(dataref);
+ 	}
+ 	else{
+-		_error2_("input data_type is not a bool!");
++		_error_("input data_type is not a bool!");
+ 	}
+ 
+ 	*pboolean=*mxbool_ptr;
+@@ -494,7 +494,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -518,7 +518,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -619,10 +619,10 @@
+ 
+ 	/*Fetch all options*/
+ 	for (int i=istart; i<nrhs; i=i+2){
+-		if (!mxIsClass(pdataref[i],"char")) _error2_("Argument " << i+1 << " must be name of option");
++		if (!mxIsClass(pdataref[i],"char")) _error_("Argument " << i+1 << " must be name of option");
+ 
+ 		FetchData(&name,pdataref[i]);
+-		if(i+1 == nrhs) _error2_("Argument " << i+2 << " must exist and be value of option \"" << name << "\".");
++		if(i+1 == nrhs) _error_("Argument " << i+2 << " must exist and be value of option \"" << name << "\".");
+ 
+ 		option=(Option*)OptionParse(name,&pdataref[i+1]);
+ 		options->AddOption(option);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp	(revision 13036)
+@@ -45,7 +45,7 @@
+ 		nnz=mxGetNzmax(mxvector);
+ 		
+ 		/*Check that input is actualy a vector*/
+-		if (cols!=1) _error2_("input vector of size " << rows << "x" << cols << " should have only one column");
++		if (cols!=1) _error_("input vector of size " << rows << "x" << cols << " should have only one column");
+ 
+ 		nz=(int)((double)nnz/(double)rows);
+ 
+@@ -76,7 +76,7 @@
+ 		cols=mxGetN(mxvector);
+ 
+ 		/*Check that input is actualy a vector*/
+-		if (cols!=1) _error2_("input vector of size " << rows << "x" << cols << " should have only one column");
++		if (cols!=1) _error_("input vector of size " << rows << "x" << cols << " should have only one column");
+ 
+ 		/*allocate and memcpy*/
+ 		if(rows){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp	(revision 13036)
+@@ -118,7 +118,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("Matlab matrix type Not implemented yet");
++		_error_("Matlab matrix type Not implemented yet");
+ 	}
+ 
+ 	/*Assign output pointer: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp	(revision 13036)
+@@ -26,11 +26,11 @@
+ 	/*check on requested size: */
+ 	if (size==0){
+ 		function();
+-		_error2_("usage: see above");
++		_error_("usage: see above");
+ 	}
+ 	else if (size!=NRHS ) {
+ 		function(); 
+-		_error2_("usage error.");
++		_error_("usage error.");
+ 	}
+ 	return 1;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13036)
+@@ -47,7 +47,7 @@
+ 	bool boolean;
+ 	
+ 	/*check this is indeed a subtype of long type: */
+-	if(!PyBool_Check(py_boolean))_error2_("expecting a boolean in input!");
++	if(!PyBool_Check(py_boolean))_error_("expecting a boolean in input!");
+ 
+ 	/*extract boolean: */
+ 	boolean=(bool)PyLong_AsLong(py_boolean);
+@@ -68,7 +68,7 @@
+ 
+ 	/*retrive dimensions: */
+ 	ndim=PyArray_NDIM((const PyArrayObject*)py_matrix);
+-	if(ndim!=2)_error2_("expecting an MxN matrix in input!");
++	if(ndim!=2)_error_("expecting an MxN matrix in input!");
+ 	dims=PyArray_DIMS((PyArrayObject*)py_matrix);
+ 	M=dims[0]; N=dims[1];
+ 	
+@@ -96,7 +96,7 @@
+ 
+ 	/*retrive dimensions: */
+ 	ndim=PyArray_NDIM((const PyArrayObject*)py_matrix);
+-	if(ndim!=2)_error2_("expecting an MxN matrix in input!");
++	if(ndim!=2)_error_("expecting an MxN matrix in input!");
+ 	dims=PyArray_DIMS((PyArrayObject*)py_matrix);
+ 	M=dims[0]; N=dims[1];
+ 	
+@@ -124,7 +124,7 @@
+ 
+ 	/*retrive dimensions: */
+ 	ndim=PyArray_NDIM((const PyArrayObject*)py_vector);
+-	if(ndim!=1)_error2_("expecting an Mx1 vector in input!");
++	if(ndim!=1)_error_("expecting an Mx1 vector in input!");
+ 	dims=PyArray_DIMS((PyArrayObject*)py_vector);
+ 	M=dims[0]; 
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp	(revision 13036)
+@@ -64,7 +64,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{*/
+@@ -81,7 +81,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(IssmDouble* pscalar, int enum_type){{{*/
+@@ -98,7 +98,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(IssmDouble* pscalar, int enum_type,IssmDouble time){{{*/
+@@ -115,7 +115,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{*/
+@@ -132,7 +132,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -150,7 +150,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -168,7 +168,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -186,7 +186,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -204,7 +204,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -222,7 +222,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -240,7 +240,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(Vector** pvec,int enum_type){{{*/
+@@ -257,7 +257,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -275,7 +275,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -293,7 +293,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13036)
+@@ -202,7 +202,7 @@
+ 
+ 		/*see what the first element of this partition has in stock (this is common to all partitions)*/
+ 		if(my_rank==minrank){
+-			if(this->Size()==0) _error2_("Cannot write results because there is no element??");
++			if(this->Size()==0) _error_("Cannot write results because there is no element??");
+ 			Element* element=(Element*)this->GetObjectByOffset(0);
+ 			element->ListResultsInfo(&resultsenums,&resultssizes,&resultstimes,&resultssteps,&numberofresults);
+ 		}
+@@ -231,7 +231,7 @@
+ 			/*Get vector for result number i*/
+ 			if(resultssizes[i]==P1Enum)      vectorsize=numberofvertices;
+ 			else if(resultssizes[i]==P0Enum) vectorsize=numberofelements;
+-			else _error2_("Unkown result size: " << EnumToStringx(resultssizes[i]));
++			else _error_("Unkown result size: " << EnumToStringx(resultssizes[i]));
+ 			vector=new Vector(vectorsize);
+ 
+ 			for(int j=0;j<this->Size();j++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13036)
+@@ -57,12 +57,12 @@
+ 	options->Get(&mintrimming,"mintrimming",-1.e+21);
+ 	options->Get(&maxtrimming,"maxtrimming",+1.e+21);
+ 	options->Get(&minspacing,"minspacing",0.01);
+-	if(minspacing<=0) _error2_("minspacing must > 0");
++	if(minspacing<=0) _error_("minspacing must > 0");
+ 
+ 	/*Get Minimum box size*/
+ 	if(options->GetOption("boxlength")){
+ 		options->Get(&minlength,"boxlength");
+-		if(minlength<=0)_error2_("boxlength should be a positive number");
++		if(minlength<=0)_error_("boxlength should be a positive number");
+ 		maxdepth=int(log(max(xmax-xmin,ymax-ymin)/minlength +1)/log(2.0));
+ 	}
+ 	else{
+@@ -382,7 +382,7 @@
+ 	SolverxSeq(&Ginv1, Gamma,ones,n_obs);   // Gamma^-1 ones
+ 	SolverxSeq(&GinvZ, Gamma,obs,n_obs);    // Gamma^-1 Z
+ #else
+-	_error2_("GSL is required");
++	_error_("GSL is required");
+ #endif
+ 
+ 	/*Prepare predictor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Inputs.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Inputs.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Inputs.cpp	(revision 13036)
+@@ -56,7 +56,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -84,7 +84,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -112,7 +112,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -140,7 +140,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -212,7 +212,7 @@
+ 	constrain_input=(Input*)this->GetInput(constrain_enum);
+ 
+ 	/*some checks: */
+-	if(!constrain_input) _error2_("input " << EnumToStringx(constrain_enum) << " could not be found!");
++	if(!constrain_input) _error_("input " << EnumToStringx(constrain_enum) << " could not be found!");
+ 
+ 	/*Apply ContrainMin: */
+ 	constrain_input->ConstrainMin(minimum);
+@@ -253,7 +253,7 @@
+ 		max=input->Max();
+ 	}
+ 	else{
+-		_error2_("Input " << EnumToStringx(enumtype) << " not found");
++		_error_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -274,7 +274,7 @@
+ 		max=input->MaxAbs();
+ 	}
+ 	else{
+-		_error2_("Input " << EnumToStringx(enumtype) << " not found");
++		_error_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -295,7 +295,7 @@
+ 		min=input->Min();
+ 	}
+ 	else{
+-		_error2_("Input " << EnumToStringx(enumtype) << " not found");
++		_error_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -316,7 +316,7 @@
+ 		min=input->MinAbs();
+ 	}
+ 	else{
+-		_error2_("Input " << EnumToStringx(enumtype) << " not found");
++		_error_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -368,7 +368,7 @@
+ 
+ 	/*Make a copy of the original input: */
+ 	original=(Input*)this->GetInput(original_enum);
+-	if(!original)_error2_("could not find input with enum: " << EnumToStringx(original_enum)); 
++	if(!original)_error_("could not find input with enum: " << EnumToStringx(original_enum)); 
+ 	copy=(Input*)original->copy();
+ 
+ 	/*Change copy enum to reinitialized_enum: */
+@@ -415,8 +415,8 @@
+ 	yinput=(Input*)this->GetInput(MeshYEnum);
+ 
+ 	/*some checks: */
+-	if(!xinput) _error2_("input " << EnumToStringx(MeshXEnum) << " could not be found!");
+-	if(!yinput) _error2_("input " << EnumToStringx(MeshYEnum) << " could not be found!");
++	if(!xinput) _error_("input " << EnumToStringx(MeshXEnum) << " could not be found!");
++	if(!yinput) _error_("input " << EnumToStringx(MeshYEnum) << " could not be found!");
+ 
+ 	/*Apply AXPY: */
+ 	yinput->AXPY(xinput,scalar);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp	(revision 13036)
+@@ -132,7 +132,7 @@
+ 
+ 	vector<Object*>::iterator object;
+ 
+-	if(this==NULL)_error2_("trying to echo a NULL dataset");
++	if(this==NULL)_error_("trying to echo a NULL dataset");
+ 
+ 	_pprintLine_("DataSet echo: " << objects.size() << " objects");
+ 
+@@ -149,7 +149,7 @@
+ 
+ 	vector<Object*>::iterator object;
+ 
+-	if(this==NULL)_error2_("trying to echo a NULL dataset");
++	if(this==NULL)_error_("trying to echo a NULL dataset");
+ 
+ 	_pprintLine_("DataSet echo: " << objects.size() << " objects");
+ 
+@@ -193,11 +193,11 @@
+ 	int i;
+ 
+ 	_assert_(this);
+-	if(!sorted)_error2_("trying to binary search on a non-sorted dataset!");
++	if(!sorted)_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())){
+-		_error2_("could not find object with id " << eid << " in DataSet " << EnumToStringx(enum_type));
++		_error_("could not find object with id " << eid << " in DataSet " << EnumToStringx(enum_type));
+ 	}
+ 
+ 	/*Convert  the id offset into sorted offset: */
+@@ -258,7 +258,7 @@
+ 
+ 	/*Only sort if we are not already sorted: */
+ 	if(!sorted){
+-		_error2_("not implemented yet!");
++		_error_("not implemented yet!");
+ 	}
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp	(revision 13036)
+@@ -46,17 +46,17 @@
+ 	_assert_(in_option);
+ 
+ 	/*Also, check the option name*/
+-	if(!in_option->name) _error2_("input option has an empty name");
+-	if(strchr(in_option->name,'.')) _error2_("Option \"" << in_option->name << "\" has a protected character \".\"");
+-	if(strchr(in_option->name,'[')) _error2_("Option \"" << in_option->name << "\" has a protected character \"[\"");
+-	if(strchr(in_option->name,']')) _error2_("Option \"" << in_option->name << "\" has a protected character \"]\"");
++	if(!in_option->name) _error_("input option has an empty name");
++	if(strchr(in_option->name,'.')) _error_("Option \"" << in_option->name << "\" has a protected character \".\"");
++	if(strchr(in_option->name,'[')) _error_("Option \"" << in_option->name << "\" has a protected character \"[\"");
++	if(strchr(in_option->name,']')) _error_("Option \"" << in_option->name << "\" has a protected character \"]\"");
+ 
+ 	/*Finally, check that no option of the same name already exists in the dataset*/
+ 	for(object=objects.begin();object<objects.end();object++){
+ 
+ 		option=(Option*)(*object); 
+ 		if (!strcmp(option->name,in_option->name)){
+-			_error2_("Options \"" << in_option->name << "\" found multiple times");
++			_error_("Options \"" << in_option->name << "\" found multiple times");
+ 			break;
+ 		}
+ 	}
+@@ -82,7 +82,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -120,7 +120,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -158,7 +158,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -198,7 +198,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ 
+ }
+@@ -263,7 +263,7 @@
+ 		}
+ 		/*Else: not supported*/
+ 		else{
+-			_error2_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
++			_error_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
+ 		}
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+@@ -289,7 +289,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -323,7 +323,7 @@
+ 				}
+ 				/*Else: not supported*/
+ 				else{
+-					_error2_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
++					_error_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
+ 				}
+ 			}
+ 		}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h	(revision 13036)
+@@ -25,12 +25,12 @@
+ /* _error2_ {{{*/
+ /*new Error exception macro*/
+ #ifdef _INTEL_WIN_
+-#define _error2_(StreamArgs)\
++#define _error_(StreamArgs)\
+    do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+    aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
+    throw ErrorException(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+ #else
+-#define _error2_(StreamArgs)\
++#define _error_(StreamArgs)\
+ 	do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+    aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
+    throw ErrorException(__FILE__,__func__,__LINE__,aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+@@ -64,7 +64,7 @@
+ /*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/
+ #ifdef _ISSM_DEBUG_ 
+ #define _assert_(statement)\
+-  if (!(statement)) _error2_("Assertion \""<<#statement<<"\" failed, please report bug to "<<PACKAGE_BUGREPORT)
++  if (!(statement)) _error_("Assertion \""<<#statement<<"\" failed, please report bug to "<<PACKAGE_BUGREPORT)
+ #else
+ #define _assert_(ignore)\
+   ((void) 0)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 13036)
+@@ -35,26 +35,26 @@
+ 
+ 	if (!itrnb) {
+ 		if (nrowb != idimb) {
+-			_error2_("Matrix A and B inner vectors not equal size.");
++			_error_("Matrix A and B inner vectors not equal size.");
+ 		}
+ 		idimc=ncolb;
+ 	}
+ 	else {
+ 		if (ncolb != idimb) {
+-			_error2_("Matrix A and B inner vectors not equal size.");
++			_error_("Matrix A and B inner vectors not equal size.");
+ 		}
+ 		idimc=nrowb;
+ 	}
+ 
+ 	if (!itrnc) {
+ 		if (nrowc != idimc) {
+-			_error2_("Matrix B and C inner vectors not equal size.");
++			_error_("Matrix B and C inner vectors not equal size.");
+ 		}
+ 		idimd=ncolc;
+ 	}
+ 	else {
+ 		if (ncolc != idimc) {
+-			_error2_("Matrix B and C inner vectors not equal size.");
++			_error_("Matrix B and C inner vectors not equal size.");
+ 		}
+ 		idimd=nrowc;
+ 	}
+@@ -123,7 +123,7 @@
+ 	}
+ 
+ 	if (ntrma != ntrmb) {
+-		_error2_("Matrix A and B inner vectors not equal size");
++		_error_("Matrix A and B inner vectors not equal size");
+ 	    noerr=0;	
+ 		return noerr;
+ 	}
+@@ -174,7 +174,7 @@
+ 	IssmDouble pivot,det,dtemp;
+ 
+ 	if (!b && nvec) {
+-		_error2_("No right-hand side for nvec=" << nvec << ".");
++		_error_("No right-hand side for nvec=" << nvec << ".");
+ 		noerr=0;
+ 		return noerr;
+ 	}
+@@ -213,7 +213,7 @@
+ 			xDelete<int>(pivrc1);
+ 			xDelete<int>(pivrc2);
+ 			xDelete<int>(pindx);
+-			_error2_("Pivot " << pivot << " less than machine epsilon");
++			_error_("Pivot " << pivot << " less than machine epsilon");
+ 			noerr=0;
+ 			return noerr;
+ 		}
+@@ -348,7 +348,7 @@
+ 
+ 	/*Compute determinant*/
+ 	Matrix2x2Determinant(&det,A);
+-	if (fabs(det) < DBL_EPSILON) _error2_("Determinant smaller that machine epsilon");
++	if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller that machine epsilon");
+ 
+ 	/*Compute invert*/
+ 	Ainv[0]=   A[3]/det; /* =  d/det */
+@@ -373,7 +373,7 @@
+ 
+ 	/*Compute determinant*/
+ 	Matrix3x3Determinant(&det,A);
+-	if (fabs(det) < DBL_EPSILON) _error2_("Determinant smaller that machine epsilon");
++	if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller that machine epsilon");
+ 
+ 	/*Compute invert*/
+ 	Ainv[0]=(A[4]*A[8]-A[5]*A[7])/det; /* = (e*i-f*h)/det */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 13036)
+@@ -43,14 +43,14 @@
+ 	/*initialize counter and get response at the boundaries*/
+ 	iter=0;
+ 	fxmin = (*f)(xmin,optargs);
+-	if (xIsNan<IssmDouble>(fxmin)) _error2_("Function evaluation returned NaN");
++	if (xIsNan<IssmDouble>(fxmin)) _error_("Function evaluation returned NaN");
+ 	cout<<setprecision(5);
+ 	if(VerboseControl()) _pprintLine_("");
+ 	if(VerboseControl()) _pprintLine_("       Iteration         x           f(x)       Tolerance         Procedure");
+ 	if(VerboseControl()) _pprintLine_("");
+ 	if(VerboseControl()) _pprintLine_("           N/A    "<<setw(12)<<xmin<<"  "<<setw(12)<<fxmin<<"           N/A         boundary");
+ 	fxmax = (*f)(xmax,optargs);
+-	if (xIsNan<IssmDouble>(fxmax)) _error2_("Function evaluation returned NaN");
++	if (xIsNan<IssmDouble>(fxmax)) _error_("Function evaluation returned NaN");
+ 	if(VerboseControl()) _pprintLine_("           N/A    "<<setw(12)<<xmax<<"  "<<setw(12)<<fxmax<<"           N/A         boundary");
+ 
+ 	/*test if jump option activated and xmin==0*/
+@@ -74,7 +74,7 @@
+ 
+ 	/*2: call the function to be evaluated*/
+ 	fxbest = (*f)(x,optargs);
+-	if(xIsNan<IssmDouble>(fxbest)) _error2_("Function evaluation returned NaN");
++	if(xIsNan<IssmDouble>(fxbest)) _error_("Function evaluation returned NaN");
+ 	iter=iter+1;
+ 
+ 	/*3: update the other variables*/
+@@ -158,7 +158,7 @@
+ 
+ 		//evaluate function on x
+ 		fx = (*f)(x,optargs);
+-		if(xIsNan<IssmDouble>(fx)) _error2_("Function evaluation returned NaN");
++		if(xIsNan<IssmDouble>(fx)) _error_("Function evaluation returned NaN");
+ 		iter=iter+1;
+ 
+ 		// Update a, b, xm, x1, x2, tol1, tol2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 13036)
+@@ -1669,7 +1669,7 @@
+ 		} while (iter < MAX_GAUS_ITER);
+ 		if (iter >= MAX_GAUS_ITER) {
+ 			xDelete<IssmPDouble>(work);
+-			_error2_("Max iterations exceeded for l=" << MAX_GAUS_ITER);
++			_error_("Max iterations exceeded for l=" << MAX_GAUS_ITER);
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp	(revision 13036)
+@@ -56,7 +56,7 @@
+ 	}
+ 	if (found==-1){
+ 		/*ok, we did not find anything, this is not good! error out: */
+-		_error2_("could find neither a default analysis  nor analysis " << EnumToStringx(analysis_type));
++		_error_("could find neither a default analysis  nor analysis " << EnumToStringx(analysis_type));
+ 	}
+ 
+ 	/*ok, grab the option string: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 13036)
+@@ -28,7 +28,7 @@
+ 	/*Now, which direction are we going? once determined, use scale factor: */
+ 	if(direction_enum==IuToExtEnum) for(i=0;i<numvalues;i++)values[i]=values[i]*scale; 
+ 	else if(direction_enum==ExtToIuEnum) for(i=0;i<numvalues;i++)values[i]=values[i]/scale; 
+-	else _error2_("wrong direction for unit conversion, either IuToExtEnum or ExtToIuEnum. ");
++	else _error_("wrong direction for unit conversion, either IuToExtEnum or ExtToIuEnum. ");
+ 
+ }
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp	(revision 13036)
+@@ -33,7 +33,7 @@
+ /*FUNCTION SetVerbosityLevel {{{*/
+ void SetVerbosityLevel(int level){
+ 
+-	if(level<0) _error2_("vebosity level should be a positive integer (user provided " << level << ")");
++	if(level<0) _error_("vebosity level should be a positive integer (user provided " << level << ")");
+ 
+ 	verbositylevel = level;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp	(revision 13036)
+@@ -52,7 +52,7 @@
+ 		if(reCast<bool>(nu))eps=ndu/nu;
+ 		else eps=0;
+ 	}
+-	else _error2_("convergence criterion " << EnumToStringx(criterion_enum) << " not supported yet!");
++	else _error_("convergence criterion " << EnumToStringx(criterion_enum) << " not supported yet!");
+ 
+ 	/*Assign output pointers:*/
+ 	*peps=eps;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 13036)
+@@ -40,7 +40,7 @@
+ 	
+ 	//get the value of the function at the first boundary
+ 	fx1= (*f)(x1,optargs);
+-	if (xIsNan<IssmDouble>(fx1)) _error2_("Function evaluation returned NaN");
++	if (xIsNan<IssmDouble>(fx1)) _error_("Function evaluation returned NaN");
+ 	cout<<setprecision(5);
+ 	if(VerboseControl()) _pprintLine_("");
+ 	if(VerboseControl()) _pprintLine_("       Iteration         x           f(x)       Tolerance");
+@@ -56,7 +56,7 @@
+ 		/*get f(x2)*/
+ 		iter++;
+ 		fx2 = (*f)(x2,optargs);
+-		if (xIsNan<IssmDouble>(fx2)) _error2_("Function evaluation returned NaN");
++		if (xIsNan<IssmDouble>(fx2)) _error_("Function evaluation returned NaN");
+ 		if(VerboseControl())
+ 		 _pprintLine_("         "<<setw(5)<<iter<<"    "<<setw(12)<<x2<<"  "<<setw(12)<<fx2<<"  "<<(fabs(x2-x1)>fabs(fx2-fx1)?fabs(fx2-fx1):fabs(x2-x1)));
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/String/DescriptorIndex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/String/DescriptorIndex.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/String/DescriptorIndex.cpp	(revision 13036)
+@@ -22,12 +22,12 @@
+ 
+ 	/*retrieve first token, separated by underscore: */
+ 	pch = strtok (descriptor,"_");
+-	if(!pch)_error2_("descriptor " << descriptor << " is not correctly formatted!");
++	if(!pch)_error_("descriptor " << descriptor << " is not correctly formatted!");
+ 
+ 	if (strncmp(pch,"scaled",6)==0){
+ 		/*we have a scaled variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("scaled descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("scaled descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 
+ 		/*now recover  the index if it exists: */
+@@ -43,22 +43,22 @@
+ 	else if (strncmp(pch,"indexed",7)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return IndexedEnum;
+ 	}
+ 	else if (strncmp(pch,"nodal",5)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return NodalEnum;
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13036)
+@@ -30,11 +30,11 @@
+ 
+ 	void* memptr=NULL;
+ 
+-	if(!size)_error2_("attempting to 0 size allocation!");
++	if(!size)_error_("attempting to 0 size allocation!");
+ 
+ 	/* Use the c library to do the allocation: */
+ 	memptr=malloc(size);
+-	if(!memptr) _error2_("memory allocation failed!");
++	if(!memptr) _error_("memory allocation failed!");
+ 
+ 	return memptr;
+ }
+@@ -43,11 +43,11 @@
+ 
+ 	void* memptr=NULL;
+ 	
+-	if(!size)_error2_("attempting to 0 size allocation!");
++	if(!size)_error_("attempting to 0 size allocation!");
+ 
+ 	/* Use the c library to do the allocation: */
+ 	memptr=calloc(n,size);
+-	if(!memptr) _error2_("memory allocation failed!");
++	if(!memptr) _error_("memory allocation failed!");
+ 
+ 	return memptr;
+ }
+@@ -87,11 +87,11 @@
+ 	
+ 	register void* value=NULL;
+ 	
+-	if(!size)_error2_("attempting to realloc to zero");
++	if(!size)_error_("attempting to realloc to zero");
+ 	value = (void*)realloc(pv,size);
+ 
+ 	if (value == NULL) {
+-		_error2_("virtual memory exhausted");
++		_error_("virtual memory exhausted");
+ 	}
+ 	return value;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Threads/LaunchThread.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Threads/LaunchThread.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Threads/LaunchThread.cpp	(revision 13036)
+@@ -43,12 +43,12 @@
+ 	for(i=0;i<num_threads;i++){
+ 
+ 		if(pthread_create(threads+i,NULL,function,(void*)(handles+i))){
+-			_error2_("pthread_create error");
++			_error_("pthread_create error");
+ 		}
+ 	}
+ 	for(i=0;i<num_threads;i++){
+ 		if(pthread_join(threads[i],(void**)&status)){
+-			_error2_("pthread_join error");
++			_error_("pthread_join error");
+ 		}
+ 	}
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp	(revision 13036)
+@@ -30,7 +30,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp	(revision 13036)
+@@ -29,7 +29,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp	(revision 13036)
+@@ -21,7 +21,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+@@ -66,7 +66,7 @@
+ 				counter+=4;
+ 				break;
+ 			default:
+-				_error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++				_error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp	(revision 13036)
+@@ -30,7 +30,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp	(revision 13036)
+@@ -30,7 +30,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 13036)
+@@ -22,7 +22,7 @@
+ 
+ 	/*open domain outline file for writing: */
+ 	if ((fid=fopen(domainname,"w"))==NULL){
+-		_error2_("could not open domain file " << domainname); 
++		_error_("could not open domain file " << domainname); 
+ 		noerr=0; goto cleanupandreturn;
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 13036)
+@@ -38,7 +38,7 @@
+ 
+ 	/*open domain outline file for reading: */
+ 	if ((fid=fopen(domainname,"r"))==NULL){
+-		_error2_("could not find domain file " << domainname); 
++		_error_("could not find domain file " << domainname); 
+ 	}
+ 
+ 	/*Do a first pass through the domainname file, to figure out how many profiles 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp	(revision 13036)
+@@ -29,7 +29,7 @@
+ 	_pprintLine_("PETSc elapsed flops : " << Current_flops << "  Flops");
+ 	_pprintLine_("PETSc memory used   : " << memUse << "  Bytes");
+ 	#else
+-		_error2_("Profiling not supported under this numerical toolkit");
++		_error_("Profiling not supported under this numerical toolkit");
+ 	#endif
+ 
+ 	/*Assign pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp	(revision 13036)
+@@ -22,7 +22,7 @@
+ 		PetscGetTime(&Time_start);
+ 		PetscGetFlops(&Flops_start );
+ 	#else
+-		_error2_("Profiling not supported under this numerical toolkit");
++		_error_("Profiling not supported under this numerical toolkit");
+ 	#endif
+ 
+ 	/*Assign pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfopen.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfopen.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfopen.cpp	(revision 13036)
+@@ -19,7 +19,7 @@
+ 	
+ 	/*Open handle to data on disk: */
+ 	fid=fopen(filename,format);
+-	if(fid==NULL) _error2_("could not open file " << filename << " for binary reading or writing"); 
++	if(fid==NULL) _error_("could not open file " << filename << " for binary reading or writing"); 
+ 
+ 	return fid;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfclose.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfclose.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfclose.cpp	(revision 13036)
+@@ -17,5 +17,5 @@
+ 	/*Close file handle: */
+ 	extern int my_rank;
+ 	_assert_(fid);
+-	if(fclose(fid)!=0)_error2_("could not close file " << filename);
++	if(fclose(fid)!=0)_error_("could not close file " << filename);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13036)
+@@ -39,7 +39,7 @@
+ 
+ 	/*some checks*/
+ 	if (nels_data<1 || nods_data<3 || nods_prime==0){
+-		_error2_("nothing to be done according to the mesh given in input");
++		_error_("nothing to be done according to the mesh given in input");
+ 	}
+ 
+ 	/*Set debug to 1 if there are lots of elements*/
+@@ -53,11 +53,11 @@
+ 		interpolation_type=2;
+ 	}
+ 	else{
+-		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
++		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+ 	}
+ 
+ 	if((numcontours) && (interpolation_type==2)){
+-		_error2_("element interpolation_type with contours not supported yet!");
++		_error_("element interpolation_type with contours not supported yet!");
+ 	}
+ 
+ 	/*Get prime mesh extrema coordinates*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13036)
+@@ -487,5 +487,5 @@
+          else stage=5;
+    }
+ 	/*If we reach this point, the string provided has not been found*/
+-	_error2_("Enum " << name << " not found");
++	_error_("Enum " << name << " not found");
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 13036)
+@@ -48,9 +48,9 @@
+ 		case MaterialsRheologyBbarEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,MaterialsRheologyBbarEnum,process_units); break;
+ 		case VelEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,VelEnum,process_units); break;
+ 		case FrictionCoefficientEnum:NodalValuex(responses, FrictionCoefficientEnum,elements,nodes, vertices, loads, materials, parameters,process_units); break;
+-		default: _error2_("response descriptor \"" << response_descriptor << "\" not supported yet!"); break;
++		default: _error_("response descriptor \"" << response_descriptor << "\" not supported yet!"); break;
+ 		#else
+-		default: _error2_("ISSM was not compiled with responses capabilities, exiting!");
++		default: _error_("ISSM was not compiled with responses capabilities, exiting!");
+ 		#endif
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 13036)
+@@ -34,7 +34,7 @@
+ 
+ 	/*Checks*/
+ 	if (M_data!=nods_data && M_data!=nels_data){
+-		_error2_("data provided should have either " << nods_data << " or " << nels_data << " lines (not " << M_data << ")");
++		_error_("data provided should have either " << nods_data << " or " << nels_data << " lines (not " << M_data << ")");
+ 	}
+ 
+ 	/*Get default*/
+@@ -137,7 +137,7 @@
+ 		else{
+ 			for (j=0;j<N_data;j++){
+ 				if (it<0 || it>=nels_data){
+-					_error2_("Triangle number " << it << " not in [0 " << nels_data << "], report bug to developers");
++					_error_("Triangle number " << it << " not in [0 " << nels_data << "], report bug to developers");
+ 				}
+ 				data_interp[i*N_data+j]=data[N_data*it+j];
+ 			}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 13036)
+@@ -52,7 +52,7 @@
+ 	double  cde,re,ex2,ex;
+ 	double  sl,rho,cm,T,chi;
+ 
+-	if((sgn!=1) && (sgn!=-1)) _error2_("Sign should be either +1 or -1.\n");
++	if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n");
+ 
+ 	delta = central_meridian;
+ 	slat  = standard_parallel;
+@@ -130,7 +130,7 @@
+ 		*pslat = 71;
+ 		if(flag) _pprintLine_("Warning: expecting coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).");
+ 	}
+-	else _error2_("Sign should be either +1 or -1.\n");
++	else _error_("Sign should be either +1 or -1.\n");
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp	(revision 13036)
+@@ -29,7 +29,7 @@
+ 
+ 	/*some checks*/
+ 	if (nels<1 || nods<3 || nlines<1 || ncols<1 || xposting==0 || yposting==0){
+-		_error2_("nothing to be done according to the mesh given in input");
++		_error_("nothing to be done according to the mesh given in input");
+ 	}
+ 
+ 	/*figure out what kind of interpolation is needed*/
+@@ -40,7 +40,7 @@
+ 		interpolation_type=2;
+ 	}
+ 	else{
+-		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
++		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+ 	}
+ 
+ 	/*First, allocate pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 13036)
+@@ -26,7 +26,7 @@
+ 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 
+ 	if(migration_style==NoneEnum) return;
+-	if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error2_(EnumToStringx(migration_style) << " not supported yet!");
++	if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error_(EnumToStringx(migration_style) << " not supported yet!");
+ 
+ 	if(migration_style==SoftMigrationEnum){
+ 		/*Create flag for grounded vertices above the hydrostatic equilibrium: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp	(revision 13036)
+@@ -71,7 +71,7 @@
+ 	#ifdef _HAVE_CONTROL_
+ 	if(control_analysis)solutioncore=&control_core;
+ 	#else
+-	_error2_("ISSM was not compiled with control capabilities, exiting!");
++	_error_("ISSM was not compiled with control capabilities, exiting!");
+ 	#endif
+ 
+ 	/*Run the core solution sequence: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp	(revision 13036)
+@@ -22,12 +22,12 @@
+ 
+ 	/*retrieve first token, separated by underscore: */
+ 	pch = strtok (descriptor,"_");
+-	if(!pch)_error2_("descriptor " << descriptor << " is not correctly formatted!");
++	if(!pch)_error_("descriptor " << descriptor << " is not correctly formatted!");
+ 
+ 	if (strncmp(pch,"scaled",6)==0){
+ 		/*we have a scaled variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("scaled descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("scaled descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 
+ 		/*now recover  the index if it exists: */
+@@ -43,22 +43,22 @@
+ 	else if (strncmp(pch,"indexed",7)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return IndexedEnum;
+ 	}
+ 	else if (strncmp(pch,"nodal",5)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return NodalEnum;
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 13036)
+@@ -25,7 +25,7 @@
+ 
+ 	/*Get size of vector: */
+ 	gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
+-	if (gsize==0) _error2_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));
++	if (gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));
+ 	
+ 	/*Initialize solution: */
+ 	solution=new Vector(gsize);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp	(revision 13036)
+@@ -37,7 +37,7 @@
+ 
+ 	if(    (edge1==IntersectEnum) && (edge2==IntersectEnum) && (edge3==IntersectEnum)   ){
+ 		/*This case is impossible: */
+-		_error2_("error: a line cannot go through 3 different vertices!");
++		_error_("error: a line cannot go through 3 different vertices!");
+ 	}
+ 	else if(    ((edge1==IntersectEnum) && (edge2==IntersectEnum)) || ((edge2==IntersectEnum) && (edge3==IntersectEnum)) || ((edge3==IntersectEnum) && (edge1==IntersectEnum))   ){
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 13036)
+@@ -38,7 +38,7 @@
+ 	/*Broadcast whether we found the element: */
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+-	if(!sumfound)_error2_("could not find material with id" << index << " to compute ElementResponse");
++	if(!sumfound)_error_("could not find material with id" << index << " to compute ElementResponse");
+ 	#endif
+ 
+ 	/*Ok, we found the element, compute responseocity: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 13036)
+@@ -29,7 +29,7 @@
+ 	/*Do we have penalties linked to rifts? In this case, run our special rifts penalty 
+ 	 * management routine, otherwise, skip : */
+ 	if (RiftIsPresent(loads,analysis_type)){
+-		_error2_("rift constraints reset not supported yet!");
++		_error_("rift constraints reset not supported yet!");
+ 	}
+ 	else if(ThermalIsPresent(loads,analysis_type)){
+ 		ThermalConstraintsReset(loads,analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 13036)
+@@ -94,10 +94,10 @@
+ 			xDelete<double>(distributed_values);
+ 		}
+ 		else if (strncmp(descriptor,"indexed_",8)==0){
+-			_error2_("indexed variables not supported yet!");
++			_error_("indexed variables not supported yet!");
+ 		}
+ 		else if (strncmp(descriptor,"nodal_",8)==0){
+-			_error2_("nodal variables not supported yet!");
++			_error_("nodal variables not supported yet!");
+ 		}
+ 		else{
+ 			/*Ok, standard variable, just update inputs using the variable: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 13036)
+@@ -51,7 +51,7 @@
+ 	double  latitude,longitude;
+ 	double  T,rho,sl,tc,mc;
+ 
+-	if((sgn!=1) && (sgn!=-1)) _error2_("Sign should be either +1 or -1.\n");
++	if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n");
+ 
+ 	delta = central_meridian;
+ 	slat  = standard_parallel;
+@@ -122,7 +122,7 @@
+ 		*pslat = 71;
+ 		if(flag) _pprintLine_("Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).");
+ 	}
+-	else _error2_("Sign should be either +1 or -1.\n");
++	else _error_("Sign should be either +1 or -1.\n");
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 13036)
+@@ -54,7 +54,7 @@
+ 	/*read exp file  */
+ 
+ 	if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp))
+-		_error2_("Error reading exp file.");
++		_error_("Error reading exp file.");
+ 	_pprintLine_("Exp2Kmlx -- Reading " << nprof << " exp profiles from file \"" << filexp << "\".");
+ //	for (i=0; i<nprof; i++)
+ //		_printLine_("i=" << i << "; nvert=" << pnvert[i] << ", closed=" << closed[i]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp	(revision 13036)
+@@ -43,7 +43,7 @@
+ 
+ 	fidi=fopen(filkml,"r");
+ 	if (!(kobj=KMLFileReadx(fidi)))
+-		_error2_("Error reading kml file.");
++		_error_("Error reading kml file.");
+ 	fclose(fidi);
+ 
+ /*  open exp file  */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 13036)
+@@ -50,7 +50,7 @@
+ 			for (i=0;i<numberofelements;i++) epart[i]=0;
+ 			for (i=0;i<numberofnodes;i++)    npart[i]=0;
+ 		}
+-		else _error2_("At least one processor is required");
++		else _error_("At least one processor is required");
+ 	}
+ 	else{
+ 		/*We have a 3d mesh, made of a regularly extruded 2d mesh. We first partition the 2d mesh, then we extrude the partition: */
+@@ -77,7 +77,7 @@
+ 			for (i=0;i<numberofelements2d;i++) epart2d[i]=0;
+ 			for (i=0;i<numberofnodes2d;i++)    npart2d[i]=0;
+ 		}
+-		else _error2_("At least one processor is required");
++		else _error_("At least one processor is required");
+ 
+ 		/*Extrude epart2d to epart, using numlayers: */
+ 		epart=xNew<int>(numberofelements);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 13036)
+@@ -31,7 +31,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("vector type: " << EnumToStringx(type) << " not supported yet!");
++		_error_("vector type: " << EnumToStringx(type) << " not supported yet!");
+ 	}
+ 
+ 	vector->Assemble();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 13036)
+@@ -137,7 +137,7 @@
+ 		xDelete<double>(gate.percent);
+ 	}
+ 	else{
+-		_error2_("output '" << output << "' not supported yet");
++		_error_("output '" << output << "' not supported yet");
+ 	}
+ 
+ 	/*clean-up and Assign output pointer*/
+@@ -304,7 +304,7 @@
+ 		else if(strcmp(model,"exponential")==0) variogram = new ExponentialVariogram(options);
+ 		else if(strcmp(model,"spherical")==0)   variogram = new SphericalVariogram(options);
+ 		else if(strcmp(model,"power")==0)       variogram = new PowerVariogram(options);
+-		else _error2_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
++		else _error_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
+ 	}
+ 	else variogram = new GaussianVariogram(options);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13036)
+@@ -102,7 +102,7 @@
+ #endif
+ 	}
+ 	else{
+-		_error2_("output '" << output << "' not supported yet");
++		_error_("output '" << output << "' not supported yet");
+ 	}
+ 
+ 	/*clean-up and Assign output pointer*/
+@@ -125,7 +125,7 @@
+ 		else if(strcmp(model,"exponential")==0) variogram = new ExponentialVariogram(options);
+ 		else if(strcmp(model,"spherical")==0)   variogram = new SphericalVariogram(options);
+ 		else if(strcmp(model,"power")==0)       variogram = new PowerVariogram(options);
+-		else _error2_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
++		else _error_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
+ 	}
+ 	else variogram = new GaussianVariogram(options);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 13036)
+@@ -37,7 +37,7 @@
+ 	/*Broadcast whether we found the element: */
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+-	if(!sumfound)_error2_("could not find element with vertex with id" << index << " to compute nodal value " << EnumToStringx(natureofdataenum));
++	if(!sumfound)_error_("could not find element with vertex with id" << index << " to compute nodal value " << EnumToStringx(natureofdataenum));
+ 	#endif
+ 
+ 	/*Broadcast and plug into response: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 13036)
+@@ -47,7 +47,7 @@
+ 			case VyEnum:   iomodel->FetchData(1,VyEnum); break;
+ 			case FrictionCoefficientEnum: iomodel->FetchData(1,FrictionCoefficientEnum); break;
+ 			case MaterialsRheologyBbarEnum:    iomodel->FetchData(1,MaterialsRheologyBEnum); break;
+-			default: _error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
++			default: _error_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 13036)
+@@ -102,7 +102,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("not implemented yet");
++		_error_("not implemented yet");
+ 	}
+ 
+ 	/*Second: add all missing nodes*/
+@@ -110,7 +110,7 @@
+ 	/*Get edges and elements*/
+ 	iomodel->FetchData(&edges,&numberofedges,&cols,MeshEdgesEnum);
+ 	iomodel->FetchData(&elements,NULL,NULL,MeshElementsEnum);
+-	if (cols!=4) _error2_("field edges should have 4 columns");
++	if (cols!=4) _error_("field edges should have 4 columns");
+ 
+ 	/*!All elements have been partitioned above, only create elements for this CPU: */
+ 	for (i=0;i<numberofedges;i++){
+@@ -151,7 +151,7 @@
+ 				my_nodes[e2*3+1]=true;
+ 			}
+ 			else{
+-				_error2_("Problem in edges creation");
++				_error_("Problem in edges creation");
+ 			}
+ 		}
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 13036)
+@@ -105,7 +105,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("Size of field " << EnumToStringx(ThermalSpctemperatureEnum) << " not supported");
++		_error_("Size of field " << EnumToStringx(ThermalSpctemperatureEnum) << " not supported");
+ 	}
+ 
+ 	/*Free ressources:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 13036)
+@@ -45,7 +45,7 @@
+ 	NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
+ 
+ 	/*Check in 3d*/
+-	if(stabilization==3 && dim==3) _error2_("DG 3d not implemented yet");
++	if(stabilization==3 && dim==3) _error_("DG 3d not implemented yet");
+ 
+ 	/*First fetch data: */
+ 	iomodel->FetchData(7,MeshElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 13036)
+@@ -60,7 +60,7 @@
+ 			doftype[4]=StokesApproximationEnum;
+ 			doftype[5]=StokesApproximationEnum;
+ 		}
+-		else _error2_("Approximationtype " << reCast<int>(*vertices_type) << " (" << EnumToStringx(reCast<int>(*vertices_type)) << ") not implemented yet for DiagnosticHoriz");
++		else _error_("Approximationtype " << reCast<int>(*vertices_type) << " (" << EnumToStringx(reCast<int>(*vertices_type)) << ") not implemented yet for DiagnosticHoriz");
+ 	}
+ 	else if (analysis_type==DiagnosticVertAnalysisEnum){
+ 		numdofs=1;
+@@ -89,7 +89,7 @@
+ 	else if (analysis_type==BalancethicknessAnalysisEnum){
+ 		numdofs=1;
+ 	}
+-	else _error2_("analysis type: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not implemented yet");
++	else _error_("analysis type: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not implemented yet");
+ 
+ 	/*Now initialize the index*/
+ 	index->Init(numdofs,doftype);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 13036)
+@@ -32,7 +32,7 @@
+ 	if(!loads) loads = new Loads();
+ 
+ 	/*return if 2d mesh*/
+-	if (dim==2) _error2_("2d meshes not supported yet");
++	if (dim==2) _error_("2d meshes not supported yet");
+ 
+ 	//create penalties for nodes: no node can have a temperature over the melting point
+ 	iomodel->FetchData(2,ThermalSpctemperatureEnum,MeshElementsEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 13036)
+@@ -25,7 +25,7 @@
+ 	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
+ 
+ 	/*if 2d: Error*/
+-	if (dim==2) _error2_("2d meshes not supported yet");
++	if (dim==2) _error_("2d meshes not supported yet");
+ 
+ 	/*Recover pointer: */
+ 	loads=*ploads;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13036)
+@@ -144,7 +144,7 @@
+ 						}
+ 
+ 					}
+-					else _error2_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal");
++					else _error_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal");
+ 			}
+ 			/*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/
+ 			else if ((int)vertices_type[i]==PattynStokesApproximationEnum){
+@@ -184,7 +184,7 @@
+ 							count++;
+ 						}
+ 					}
+-					else _error2_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes");
++					else _error_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes");
+ 			}
+ 			/*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/
+ 			else if ((int)vertices_type[i]==MacAyealStokesApproximationEnum){
+@@ -224,7 +224,7 @@
+ 							count++;
+ 						}
+ 					}
+-					else _error2_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes");
++					else _error_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes");
+ 			}
+ 			/*Now add the regular spcs*/
+ 			else{
+@@ -317,7 +317,7 @@
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0.,DiagnosticHorizAnalysisEnum));
+ 						count++;
+ 						break;
+-					default: _error2_("Vertex approximation " << EnumToStringx((int)vertices_type[i]) << " not supported");
++					default: _error_("Vertex approximation " << EnumToStringx((int)vertices_type[i]) << " not supported");
+ 				}
+ 			}
+ 		}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 13036)
+@@ -45,7 +45,7 @@
+ 	NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
+ 
+ 	/*Check in 3d*/
+-	if(stabilization==3 && dim==3) _error2_("DG 3d not implemented yet");
++	if(stabilization==3 && dim==3) _error_("DG 3d not implemented yet");
+ 
+ 	/*First fetch data: */
+ 	iomodel->FetchData(7,MeshElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 13036)
+@@ -152,7 +152,7 @@
+ 			
+ 			/*Fetch the mass flux segments necessary to compute the mass fluxes.  Build a DoubleMatArrayParam object out of them: */ 
+ 			iomodel->FetchData(&array,&mdims_array,&ndims_array,&qmu_mass_flux_num_profiles,QmuMassFluxSegmentsEnum);
+-			if(qmu_mass_flux_num_profiles==0)_error2_("qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!");
++			if(qmu_mass_flux_num_profiles==0)_error_("qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!");
+ 
+ 			/*Go through segments, and extract those that belong to this cpu: */
+ 			for(i=0;i<qmu_mass_flux_num_profiles;i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 13036)
+@@ -123,7 +123,7 @@
+ 
+ 
+ 		default:
+-			_error2_("analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!");
++			_error_("analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!");
+ 	}
+ 
+ 	/*Update Elements and Materials For Control methods*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13036)
+@@ -26,7 +26,7 @@
+ 
+ 	/*some checks*/
+ 	if (nels_data<1 || nods_data<6 || nods_prime==0){
+-		_error2_("nothing to be done according to the mesh given in input");
++		_error_("nothing to be done according to the mesh given in input");
+ 	}
+ 
+ 	/*Set debug to 1 if there are lots of elements*/
+@@ -40,7 +40,7 @@
+ 		interpolation_type=2;
+ 	}
+ 	else{
+-		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
++		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+ 	}
+ 
+ 	/*Get prime mesh extrema coordinates*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 13036)
+@@ -95,7 +95,7 @@
+ 	if(solver_type==MUMPSPACKAGE_LU || solver_type==MUMPSPACKAGE_CHOL){
+ 		#if _PETSC_MAJOR_ >=3
+ 			#ifndef _HAVE_MUMPS_
+-			_error2_("requested MUMPS solver, which was not compiled into ISSM!\n");
++			_error_("requested MUMPS solver, which was not compiled into ISSM!\n");
+ 			#endif
+ 		#endif
+ 	}
+@@ -119,7 +119,7 @@
+ 	/*Stokes: */
+ 	if (solver_type==StokesSolverEnum){
+ 		/*Make indices out of doftypes: */
+-		if(!df)_error2_("need doftypes for Stokes solver!\n");
++		if(!df)_error_("need doftypes for Stokes solver!\n");
+ 		DofTypesToIndexSet(&isv,&isp,df,StokesSolverEnum);
+ 
+ 		/*Set field splits: */
+@@ -150,7 +150,7 @@
+ 	
+ 	/*Check convergence*/
+ 	KSPGetIterationNumber(ksp,&iteration_number);
+-	if (iteration_number<0) _error2_("Solver diverged at iteration number: " << -iteration_number);
++	if (iteration_number<0) _error_("Solver diverged at iteration number: " << -iteration_number);
+ 
+ 	/*Free resources:*/
+ 	KSPFree(&ksp);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 13036)
+@@ -43,7 +43,7 @@
+ 			SolverxSeq(&uf->svector,Kff->smatrix,pf->svector);
+ 			break;}
+ 		default:
+-			  _error2_("Matrix type: " << Kff->type << " not supported yet!");
++			  _error_("Matrix type: " << Kff->type << " not supported yet!");
+ 	}
+ 
+ 	/*Assign output pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13036)
+@@ -29,8 +29,8 @@
+ 	Kff->GetSize(&M,&N);
+ 	pf->GetSize(&N2);
+ 
+-	if(N!=N2)_error2_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
+-	if(M!=N)_error2_("Stiffness matrix should be square!");
++	if(N!=N2)_error_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
++	if(M!=N)_error_("Stiffness matrix should be square!");
+ 
+ 	SolverxSeq(&x,Kff->matrix,pf->vector,N);
+ 	uf=new SeqVec(x,N);
+@@ -39,7 +39,7 @@
+ 	*puf=uf;
+ 
+ 	#else
+-		_error2_("GSL support not compiled in!");
++		_error_("GSL support not compiled in!");
+ 	#endif
+ 
+ }/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13036)
+@@ -36,13 +36,13 @@
+ 
+ 	/*Some checks on arguments: */
+ 	if ((M<2) || (N<2) || (nods<=0)){
+-		_error2_("nothing to be done according to the dimensions of input matrices and vectors.");
++		_error_("nothing to be done according to the dimensions of input matrices and vectors.");
+ 	}
+ 	if (x_in[1]-x_in[0]<0){
+-		_error2_("x coordinate vector should be increasing.\n   use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)");
++		_error_("x coordinate vector should be increasing.\n   use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)");
+ 	}
+ 	if (y_in[1]-y_in[0]<0){
+-		_error2_("y coordinate vector should be increasing.\n   use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)");
++		_error_("y coordinate vector should be increasing.\n   use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)");
+ 	}
+ 
+ 	/*Allocate output vector: */
+@@ -68,7 +68,7 @@
+ 		for (i=0;i<M;i++) y[i]=y_in[i];
+ 	}
+ 	else{
+-		_error2_("x and y vectors length should be 1 or 0 more than data number of rows.");
++		_error_("x and y vectors length should be 1 or 0 more than data number of rows.");
+ 	}
+ 
+ 	/*initialize thread parameters: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp	(revision 13036)
+@@ -70,7 +70,7 @@
+ 	/*Last check: is the number of elements on last column of the connectivity superior to maxels? If so, then error out and 
+ 	 * warn the user to increase the connectivity width: */
+ 	for(i=0;i<nods;i++){
+-		if (*(connectivity+width*i+maxels)>maxels)_error2_("max connectivity width reached (" << *(connectivity+width*i+maxels) << ")! increase width of connectivity table");
++		if (*(connectivity+width*i+maxels)>maxels)_error_("max connectivity width reached (" << *(connectivity+width*i+maxels) << ")! increase width of connectivity table");
+ 	}
+ 
+ 	/*Assign output pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 13036)
+@@ -105,7 +105,7 @@
+ 	for(i=0;i<numanalyses;i++){
+ 		char* string=strings[i];
+ 		if(my_rank==0){
+-			if(string==NULL) _error2_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");
++			if(string==NULL) _error_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");
+ 		}
+ 		if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
+ 		#ifdef _HAVE_MPI_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 13036)
+@@ -53,8 +53,8 @@
+ 
+ 	/*Check that gradient is clean*/
+ 	norm_inf=gradient->Norm(NORM_INF);
+-	if(norm_inf<=0)    _error2_("||∂J/∂α||∞ = 0    gradient norm is zero");
+-	if(xIsNan<IssmDouble>(norm_inf))_error2_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
++	if(norm_inf<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm is zero");
++	if(xIsNan<IssmDouble>(norm_inf))_error_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
+ 
+ 	/*Clean-up and assign output pointer*/
+ 	if(pnorm_list){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 13036)
+@@ -85,7 +85,7 @@
+ 			}
+ 		}
+ 		else if (flag==NodalEnum){
+-			_error2_("nodal response functions not supported yet!");
++			_error_("nodal response functions not supported yet!");
+ 
+ 			/*increment response_pointer :*/
+ 			responses_pointer++;
+@@ -103,7 +103,7 @@
+ 				responses_pointer++;
+ 			}
+ 		}
+-		else _error2_("flag type " << flag << " not supported yet for response analysis");
++		else _error_("flag type " << flag << " not supported yet for response analysis");
+ 	}
+ 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp	(revision 13036)
+@@ -132,7 +132,7 @@
+ 						nodecon[ipt+(nncon-1)]++;
+ 					}
+ 					else
+-						_error2_("Nodal connectivity table needs more than specified " << mxepg << " columns.\n");
++						_error_("Nodal connectivity table needs more than specified " << mxepg << " columns.\n");
+ 				}
+ 				jpt++;
+ 			}
+@@ -172,7 +172,7 @@
+ 		}
+ 
+ 		else
+-			_error2_("Data matrix has incorrect number of " << mdata << " rows.\n");
++			_error_("Data matrix has incorrect number of " << mdata << " rows.\n");
+ 	}
+ 
+ /*  write folder for mesh  */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp	(revision 13036)
+@@ -74,7 +74,7 @@
+ /*  open shp/shx files  */
+ 
+ 	hSHP = SHPOpen( filshp, "rb" );
+-	if (!hSHP) _error2_("Error opening shp/shx files.");
++	if (!hSHP) _error_("Error opening shp/shx files.");
+ 
+ /*  read header and print out file bounds  */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 13036)
+@@ -37,8 +37,8 @@
+ 	/*First of, find the record for the enum, and get code  of data type: */
+ 	fid=iomodel->SetFilePointerToData(&code, &vector_layout,vector_enum);
+ 
+-	if(code!=7)_error2_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));
+-	if(vector_layout!=1)_error2_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));
++	if(code!=7)_error_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));
++	if(vector_layout!=1)_error_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));
+ 
+ 	/*Fetch vector:*/
+ 	iomodel->FetchData(&IssmDoublevector,&M,&N,vector_enum);
+@@ -98,7 +98,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("Size of field " << EnumToStringx(vector_enum) << " not supported");
++		_error_("Size of field " << EnumToStringx(vector_enum) << " not supported");
+ 	}
+ 
+ 	/*Free ressources:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 13036)
+@@ -59,6 +59,6 @@
+ 	xDelete<real_t>(tpwgts);
+ 
+ 	#else
+-	_error2_("METIS version not supported yet");
++	_error_("METIS version not supported yet");
+ 	#endif
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 13036)
+@@ -84,7 +84,7 @@
+ 			for(i=0;i<ssize;i++) this->vector[list[i]]=values[i];
+ 			break;
+ 		default:
+-			_error2_("unknown insert mode!");
++			_error_("unknown insert mode!");
+ 			break;
+ 	}
+ 
+@@ -101,7 +101,7 @@
+ 			this->vector[dof]=value;
+ 			break;
+ 		default:
+-			_error2_("unknown insert mode!");
++			_error_("unknown insert mode!");
+ 			break;
+ 	}
+ }
+@@ -203,7 +203,7 @@
+ 			return sqrt(norm);
+ 			break;
+ 		default:
+-			_error2_("unknown norm !");
++			_error_("unknown norm !");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 13036)
+@@ -118,7 +118,7 @@
+ 			return norm;
+ 			break;
+ 		default:
+-			_error2_("unknown norm !");
++			_error_("unknown norm !");
+ 			break;
+ 	}
+ }
+@@ -149,8 +149,8 @@
+ 	X->GetSize(&XM);
+ 	AX->GetSize(&AXM);
+ 
+-	if(M!=AXM)_error2_("A and AX should have the same number of rows!");
+-	if(N!=XM)_error2_("A and X should have the same number of columns!");
++	if(M!=AXM)_error_("A and AX should have the same number of rows!");
++	if(N!=XM)_error_("A and X should have the same number of columns!");
+ 
+ 	for(i=0;i<M;i++){
+ 		dummy=0;
+@@ -196,7 +196,7 @@
+ 			for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]=values[n*i+j];
+ 			break;
+ 		default:
+-			_error2_("unknown insert mode!");
++			_error_("unknown insert mode!");
+ 			break;
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp	(revision 13036)
+@@ -50,7 +50,7 @@
+ 	MatGetLocalSize(*A,&local_mA,&local_nA);
+ 
+ 	/*Some dimensions checks: */
+-	if (mA!=nA) _error2_("trying to take the invert of a non-square matrix!");
++	if (mA!=nA) _error_("trying to take the invert of a non-square matrix!");
+ 
+ 	/* Set default Plapack parameters */
+ 	//First find nprows*npcols=num_procs;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp	(revision 13036)
+@@ -29,7 +29,7 @@
+ 			return MATSEQAIJ;
+ 			break;
+ 		default: 
+-			_error2_("unknown matrix type !");
++			_error_("unknown matrix type !");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp	(revision 13036)
+@@ -29,7 +29,7 @@
+ 			return INSERT_VALUES;
+ 			break;
+ 		default: 
+-			_error2_("unknown insert mode!");
++			_error_("unknown insert mode!");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp	(revision 13036)
+@@ -28,7 +28,7 @@
+ 
+ 	/*Some checks: */
+ 	MatGetSize(matrix,&M,&N);
+-	if(M!=N) _error2_("trying to invert a non square matrix!");
++	if(M!=N) _error_("trying to invert a non square matrix!");
+ 
+ 	/*Create identitiy matrix: */
+ 	identity=NewMat(M,N,sparsity);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 13036)
+@@ -61,7 +61,7 @@
+ 			#endif
+ 		}
+ 		else{
+-			_error2_("MatType " << type << " not supported yet");
++			_error_("MatType " << type << " not supported yet");
+ 		}
+ 		/*Assemble*/
+ 		MatAssemblyBegin(outmatrix,MAT_FINAL_ASSEMBLY);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp	(revision 13036)
+@@ -29,7 +29,7 @@
+ 			return NORM_2;
+ 			break;
+ 		default: 
+-			_error2_("unknown norm !");
++			_error_("unknown norm !");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 13036)
+@@ -54,7 +54,7 @@
+ 			 * and set the option, then end the token analysis.*/
+ 			if(first[0]!='-'){
+ 				/*This is not good, the option does not have '-'! Get out*/
+-				_error2_("Option " << first << " should be preceded by '-'!");
++				_error_("Option " << first << " should be preceded by '-'!");
+ 			}
+ 			/*Reduce first to bare option value*/
+ 			PetscStrlen(first,&len);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 13036)
+@@ -34,7 +34,7 @@
+ 
+ 	/*If the dimension of the partitioning vector is not the same as that of vector B, we have a problem: */
+ 	if ( (row_partition_size !=MB) ){
+-		_error2_("Dimensions of partitioning vector incompatible with dimensions of input vector\n");
++		_error_("Dimensions of partitioning vector incompatible with dimensions of input vector\n");
+ 	}
+ 
+ 	/*Get values from vector B and plug them into vector A, using the partitioning vector*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 13036)
+@@ -142,7 +142,7 @@
+ 		if(this->ssize)this->sdoflist=xNew<int>(size);
+ 		else this->sdoflist=NULL;
+ 	}
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ }
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp	(revision 13036)
+@@ -184,7 +184,7 @@
+ 		if(this->objects[i]==NULL){
+ 			this->objects[i]=(Object*)dataset->GetObjectById(this->offsets+i,this->ids[i]); //remember the offset for later on.
+ 			/*check the id is correct!: */
+-			if (this->objects[i]->Id()!=this->ids[i]) _error2_("wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << "  in resolved pointer!");
++			if (this->objects[i]->Id()!=this->ids[i]) _error_("wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << "  in resolved pointer!");
+ 		}
+ 	}
+ }
+@@ -193,10 +193,10 @@
+ Object* Hook::delivers(void){
+ 	
+ 	/*first, check that we only have one T object in our object list: */
+-	if (this->num!=1) _error2_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");
++	if (this->num!=1) _error_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");
+ 
+ 	/*check NULL: */
+-	if (this->objects==NULL) _error2_("hook is not pointing to any object, objects pointer is NULL");
++	if (this->objects==NULL) _error_("hook is not pointing to any object, objects pointer is NULL");
+ 
+ 	return *objects;
+ }
+@@ -245,11 +245,11 @@
+ 	}
+ 
+ 	/*Else, check that we are requesting a half of num*/
+-	if (numindices>this->num) _error2_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects");
++	if (numindices>this->num) _error_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects");
+ 
+ 	/*go pickup the correct objects, ids and offsets :*/
+ 	output->num=numindices;
+-	if(output->num<1) _error2_("Trying to spawn an empty ElementProperties!");
++	if(output->num<1) _error_("Trying to spawn an empty ElementProperties!");
+ 
+ 	output->objects=xNew<Object*>(output->num);
+ 	output->ids=xNew<int>(output->num);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 13036)
+@@ -79,7 +79,7 @@
+ 		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+ 	}
+ 	else
+-	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
++	 _error_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
+ 
+ 	/*Initialize static fields as undefined*/
+ 	weight=UNDEF;
+@@ -177,7 +177,7 @@
+ 		coord3=0.5;
+ 	}
+ 	else
+-	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
++	 _error_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
+ 
+ }
+ /*}}}*/
+@@ -240,7 +240,7 @@
+ 			coord1=0; coord2=0; coord3=1;
+ 			break;
+ 		default:
+-			_error2_("vertex index should be in [0 2]");
++			_error_("vertex index should be in [0 2]");
+ 
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 13036)
+@@ -118,7 +118,7 @@
+ 		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+ 	}
+ 	else{
+-		_error2_("Penta not supported yet");
++		_error_("Penta not supported yet");
+ 	}
+ 
+ 	/*Initialize static fields as undefined*/
+@@ -158,7 +158,7 @@
+ 		for(int i=0;i<numgauss;i++) coords4[i]=1.0;
+ 	}
+ 	else{
+-		_error2_("Tria not supported yet");
++		_error_("Tria not supported yet");
+ 	}
+ 
+ }
+@@ -220,7 +220,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")");
++		_error_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")");
+ 	}
+ 
+ 	/*clean-up*/
+@@ -339,7 +339,7 @@
+ 			coord1=0; coord2=0; coord3=1; coord4= +1;
+ 			break;
+ 		default:
+-			_error2_("vertex index should be in [0 5]");
++			_error_("vertex index should be in [0 5]");
+ 
+ 	}
+ 
+@@ -358,7 +358,7 @@
+ 		for(int i=0;i<numgauss;i++) coords4[i]=-1.0;
+ 	}
+ 	else{
+-		_error2_("Tria not supported yet");
++		_error_("Tria not supported yet");
+ 	}
+ 
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13036)
+@@ -179,13 +179,13 @@
+ 
+ 			/*Get input (either in element or material)*/
+ 			Input* input=inputs->GetInput(input_enum);
+-			if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in material");
++			if(!input) _error_("Input " << EnumToStringx(input_enum) << " not found in material");
+ 
+ 			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
+ 			input->GetVectorFromInputs(vector,&doflist1[0]);}
+ 			break;
+ 
+-		default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++		default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+ 	}
+ }
+ /*}}}*/
+@@ -245,7 +245,7 @@
+ 	}
+ 
+ 	/*Checks in debugging mode*/
+-	if(viscosity<=0) _error2_("Negative viscosity");
++	if(viscosity<=0) _error_("Negative viscosity");
+ 	_assert_(B>0);
+ 	_assert_(n>0);
+ 
+@@ -316,7 +316,7 @@
+ 	}
+ 
+ 	/*Checks in debugging mode*/
+-	if(viscosity3d<=0) _error2_("Negative viscosity");
++	if(viscosity3d<=0) _error_("Negative viscosity");
+ 	_assert_(B>0);
+ 	_assert_(n>0);
+ 
+@@ -388,7 +388,7 @@
+ 	}
+ 
+ 	/*Checks in debugging mode*/
+-	if(viscosity3d<=0) _error2_("Negative viscosity");
++	if(viscosity3d<=0) _error_("Negative viscosity");
+ 	_assert_(B>0);
+ 	_assert_(n>0);
+ 
+@@ -549,9 +549,9 @@
+ 					this->inputs->AddInput(new TriaP1Input(name,values));
+ 					return;
+ 				}
+-				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++				default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+ 			}
+-		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++		default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ }
+ /*}}}*/
+@@ -607,9 +607,9 @@
+ 					/*}}}*/
+ 					return;
+ 				}
+-				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++				default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+ 			}
+-		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++		default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ 
+ 
+@@ -749,7 +749,7 @@
+ 	}
+ 	#endif
+ 	else{
+-		_error2_("Mesh type not supported yet!");
++		_error_("Mesh type not supported yet!");
+ 	}
+ 
+ 	return;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 13036)
+@@ -61,10 +61,10 @@
+ 		void   InputUpdateFromConstant(int constant, int name);
+ 		void   InputUpdateFromConstant(bool constant, int name);
+ 		void   InputUpdateFromSolution(IssmDouble* solution);
+-		void   InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		void   InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
+ 		/*}}}*/
+ 		/*Material virtual functions resolution: {{{*/
+-		void   InputDuplicate(int original_enum,int new_enum){_error2_("not implemented yet");};
++		void   InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");};
+ 		void   Configure(Elements* elements);
+ 		void   GetVectorFromInputs(Vector* vector,int input_enum){return;}
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 13036)
+@@ -39,7 +39,7 @@
+ 		Input* PointwiseMin(Input* inputB);
+ 		Input* PointwiseMax(Input* inputB);
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+@@ -48,10 +48,10 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetInputAverage(IssmDouble* pvalue);
+@@ -66,15 +66,15 @@
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+ 		void ConstrainMin(IssmDouble minimum);
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+ 		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+-		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
++		IssmDouble InfinityNorm(void){_error_("not implemented yet");};
+ 		IssmDouble Max(void);
+ 		IssmDouble MaxAbs(void);
+ 		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void);
+-		void Extrude(void){_error2_("not supported yet");};
++		void Extrude(void){_error_("not supported yet");};
+ 		void VerticallyIntegrate(Input* thickness_input);
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 13036)
+@@ -47,7 +47,7 @@
+ 			maxvalues  =new PentaP1Input(enum_type,pmax);
+ 			break;
+ 		default:
+-			_error2_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput");
++			_error_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput");
+ 	}
+ 	gradient   =NULL;
+ }
+@@ -151,7 +151,7 @@
+ }/*}}}*/
+ /*FUNCTION ControlInput::ScaleGradient{{{*/
+ void ControlInput::ScaleGradient(IssmDouble scaling_factor){
+-	if(!gradient) _error2_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");
++	if(!gradient) _error_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");
+ 	gradient->Scale(scaling_factor);
+ }/*}}}*/
+ /*FUNCTION ControlInput::SetGradient{{{*/
+@@ -169,7 +169,7 @@
+ 			gradient_in->ChangeEnum(Gradient3Enum);
+ 			break;
+ 		default:
+-			_error2_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated.");
++			_error_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated.");
+ 	}
+ 
+ 	/*Delete old gradient and assign new gradient*/
+@@ -220,7 +220,7 @@
+ 		 gradient->GetVectorFromInputs(vector,doflist);
+ 	 }
+ 	 else{
+-		 _error2_("Data " << data << " not supported yet");
++		 _error_("Data " << data << " not supported yet");
+ 	 }
+ }/*}}}*/
+ /*FUNCTION ControlInput::GetInputAverage(IssmDouble* pvalue){{{*/
+@@ -257,15 +257,15 @@
+ }/*}}}*/
+ /*FUNCTION ControlInput::SaveValue{{{*/
+ void ControlInput::SaveValue(void){
+-	if(!values) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
++	if(!values) _error_("Values of " << EnumToStringx(this->enum_type) << " not found");
+ 
+ 	if(savedvalues) delete this->savedvalues;
+ 	this->savedvalues=(Input*)this->values->copy();
+ }/*}}}*/
+ /*FUNCTION ControlInput::UpdateValue{{{*/
+ void ControlInput::UpdateValue(IssmDouble scalar){
+-	if(!gradient)    _error2_("Gradient of " << EnumToStringx(this->enum_type) << " not found");
+-	if(!savedvalues) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
++	if(!gradient)    _error_("Gradient of " << EnumToStringx(this->enum_type) << " not found");
++	if(!savedvalues) _error_("Values of " << EnumToStringx(this->enum_type) << " not found");
+ 
+ 	if(values) delete this->values;
+ 	this->values=(Input*)this->savedvalues->copy();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 13036)
+@@ -40,11 +40,11 @@
+ 		/*ControlInput management: {{{*/
+ 		int    InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+@@ -54,38 +54,38 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void ChangeEnum(int newenumtype){_error2_("not implemented yet");};
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error2_("not implemented yet");};
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void ChangeEnum(int newenumtype){_error_("not implemented yet");};
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar){_error_("not implemented yet");};
+ 		void Constrain(void);
+ 		void Constrain(IssmDouble min,IssmDouble max);
+-		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
+-		IssmDouble Max(void){_error2_("not implemented yet");};
+-		IssmDouble MaxAbs(void){_error2_("not implemented yet");};
+-		IssmDouble Min(void){_error2_("not implemented yet");};
+-		IssmDouble MinAbs(void){_error2_("not implemented yet");};
++		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 MinAbs(void){_error_("not implemented yet");};
+ 		void Extrude(void);
+ 		void VerticallyIntegrate(Input* thickness_input);
+ 		void GetVectorFromInputs(Vector* vector,int* doflist,const char* data);
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not implemented yet");};
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");};
+ 		ElementResult* SpawnGradient(int step, IssmDouble time);
+ 		void GetGradient(Vector* gradient_vec,int* doflist);
+ 		void ScaleGradient(IssmDouble scale);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp	(revision 13036)
+@@ -114,7 +114,7 @@
+ void DatasetInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int index){
+ 
+ 	/*Get requested input within dataset*/
+-	if(index<0 || index > inputs->Size()-1) _error2_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");
++	if(index<0 || index > inputs->Size()-1) _error_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");
+ 	Input* input=(Input*)this->inputs->GetObjectByOffset(index);
+ 	
+ 	input->GetInputValue(pvalue,gauss);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 13036)
+@@ -36,56 +36,56 @@
+ 		/*DatasetInput management: {{{*/
+ 		int    InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
+-		ElementResult* SpawnResult(int step, IssmDouble time){_error2_("not implemented yet");};
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
++		ElementResult* SpawnResult(int step, IssmDouble time){_error_("not implemented yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void ChangeEnum(int newenumtype){_error2_("not implemented yet");};
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error2_("not implemented yet");};
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar){_error2_("not implemented yet");};
+-		void Constrain(void){_error2_("not implemented yet");};
+-		void Constrain(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
+-		IssmDouble Max(void){_error2_("not implemented yet");};
+-		IssmDouble MaxAbs(void){_error2_("not implemented yet");};
+-		IssmDouble Min(void){_error2_("not implemented yet");};
+-		IssmDouble MinAbs(void){_error2_("not implemented yet");};
+-		void Extrude(void){_error2_("not implemented yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not implemented yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist){_error2_("not implemented yet");};
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not implemented yet");};
+-		ElementResult* SpawnGradient(int step, IssmDouble time){_error2_("not implemented yet");};
+-		void GetGradient(Vector* gradient_vec,int* doflist){_error2_("not implemented yet");};
+-		void ScaleGradient(IssmDouble scale){_error2_("not implemented yet");};
+-		void SetGradient(Input* gradient_in){_error2_("not implemented yet");};
+-		void UpdateValue(IssmDouble scalar){_error2_("not implemented yet");};
+-		void SaveValue(void){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void ChangeEnum(int newenumtype){_error_("not implemented yet");};
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar){_error_("not implemented yet");};
++		void Constrain(void){_error_("not implemented yet");};
++		void Constrain(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		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 MinAbs(void){_error_("not implemented yet");};
++		void Extrude(void){_error_("not implemented yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error_("not implemented yet");};
++		void GetVectorFromInputs(Vector* vector,int* doflist){_error_("not implemented yet");};
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");};
++		ElementResult* SpawnGradient(int step, IssmDouble time){_error_("not implemented yet");};
++		void GetGradient(Vector* gradient_vec,int* doflist){_error_("not implemented yet");};
++		void ScaleGradient(IssmDouble scale){_error_("not implemented yet");};
++		void SetGradient(Input* gradient_in){_error_("not implemented yet");};
++		void UpdateValue(IssmDouble scalar){_error_("not implemented yet");};
++		void SaveValue(void){_error_("not implemented yet");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 13036)
+@@ -98,14 +98,14 @@
+ /*FUNCTION IntInput::SpawnResult{{{*/
+ ElementResult* IntInput::SpawnResult(int step, IssmDouble time){
+ 	
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ 
+ }
+ /*}}}*/
+ 
+ /*Object functions*/
+ /*FUNCTION IntInput::GetInputValue(bool* pvalue) {{{*/
+-void IntInput::GetInputValue(bool* pvalue){_error2_("not supported yet!");}
++void IntInput::GetInputValue(bool* pvalue){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(int* pvalue){{{*/
+ void IntInput::GetInputValue(int* pvalue){
+@@ -114,20 +114,20 @@
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue){{{*/
+ void IntInput::GetInputValue(IssmDouble* pvalue){
+-	_error2_("IntInput cannot return a IssmDouble in parallel");
++	_error_("IntInput cannot return a IssmDouble in parallel");
+ }
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not supported yet!");}
++void IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not supported yet!");}
++void IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
++void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
++void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::ChangeEnum{{{*/
+ void IntInput::ChangeEnum(int newenumtype){
+@@ -165,7 +165,7 @@
+ 			return;
+ 
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ 
+ }
+@@ -181,14 +181,14 @@
+ /*FUNCTION IntInput::GetVectorFromInputs{{{*/
+ void IntInput::GetVectorFromInputs(Vector* vector,int* doflist){
+ 
+-	_error2_("not supporte yet!");
++	_error_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION IntInput::GetValuesPtr{{{*/
+ void IntInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+ 
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 13036)
+@@ -111,22 +111,22 @@
+ }
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(int* pvalue){{{*/
+-void BoolInput::GetInputValue(int* pvalue){_error2_("not supported yet!");}
++void BoolInput::GetInputValue(int* pvalue){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue){_error2_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
++void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
++void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::ChangeEnum{{{*/
+ void BoolInput::ChangeEnum(int newenumtype){
+@@ -160,7 +160,7 @@
+ 			return;
+ 
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ 
+ }
+@@ -175,14 +175,14 @@
+ /*FUNCTION BoolInput::GetVectorFromInputs{{{*/
+ void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){
+ 
+-	_error2_("not supporte yet!");
++	_error_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION BoolInput::GetValuesPtr{{{*/
+ void BoolInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+ 
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 13036)
+@@ -36,11 +36,11 @@
+ 		/*IntInput management: {{{*/
+ 		int   InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+@@ -49,34 +49,34 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+ 		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+-		IssmDouble InfinityNorm(void){_error2_("InfinityNorm not implemented for integers");};
+-		IssmDouble Max(void){_error2_("Max not implemented for integers");};
+-		IssmDouble MaxAbs(void){_error2_("Max not implemented for integers");};
+-		IssmDouble Min(void){_error2_("Min not implemented for integers");};
+-		IssmDouble MinAbs(void){_error2_("Min not implemented for integers");};
+-		void Extrude(void){_error2_("not supported yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
++		IssmDouble InfinityNorm(void){_error_("InfinityNorm not implemented for integers");};
++		IssmDouble Max(void){_error_("Max not implemented for integers");};
++		IssmDouble MaxAbs(void){_error_("Max not implemented for integers");};
++		IssmDouble Min(void){_error_("Min not implemented for integers");};
++		IssmDouble MinAbs(void){_error_("Min not implemented for integers");};
++		void Extrude(void){_error_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 13036)
+@@ -36,12 +36,12 @@
+ 		/*BoolInput management: {{{*/
+ 		int   InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+ 		void Configure(Parameters* parameters);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+ 		void GetInputValue(bool* pvalue);
+@@ -49,34 +49,34 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		IssmDouble InfinityNorm(void){_error2_("InfinityNorm not implemented for booleans");};
+-		IssmDouble Max(void){_error2_("Max not implemented for booleans");};
+-		IssmDouble MaxAbs(void){_error2_("Max not implemented for booleans");};
+-		IssmDouble Min(void){_error2_("Min not implemented for booleans");};
+-		IssmDouble MinAbs(void){_error2_("Min not implemented for booleans");};
++		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
++		IssmDouble InfinityNorm(void){_error_("InfinityNorm not implemented for booleans");};
++		IssmDouble Max(void){_error_("Max not implemented for booleans");};
++		IssmDouble MaxAbs(void){_error_("Max not implemented for booleans");};
++		IssmDouble Min(void){_error_("Min not implemented for booleans");};
++		IssmDouble MinAbs(void){_error_("Min not implemented for booleans");};
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error2_("Constrain not implemented for booleans");};
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error_("Constrain not implemented for booleans");};
+ 		void Extrude(void);
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 13036)
+@@ -322,7 +322,7 @@
+ 			return;
+ 
+ 		default :
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ 
+ }
+@@ -367,7 +367,7 @@
+ 	IssmDouble            minvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TriaP1Input*)inputB;
+ 
+ 	/*Create point wise min*/
+@@ -398,7 +398,7 @@
+ 	IssmDouble            maxvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TriaP1Input*)inputB;
+ 
+ 	/*Create point wise max*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 13036)
+@@ -36,33 +36,33 @@
+ 		/*TriaP1Input management: {{{*/
+ 		int   InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
+ 		Input* PointwiseMin(Input* inputB);
+ 		Input* PointwiseMax(Input* inputB);
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");}
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");}
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");}
++		void GetInputValue(bool* pvalue){_error_("not implemented yet");}
++		void GetInputValue(int* pvalue){_error_("not implemented yet");}
++		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");}
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void GetInputAverage(IssmDouble* pvalue);
+ 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+@@ -76,8 +76,8 @@
+ 		IssmDouble MaxAbs(void);
+ 		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void);
+-		void Extrude(void){_error2_("not supported yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
++		void Extrude(void){_error_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 13036)
+@@ -481,7 +481,7 @@
+ 			}
+ 		}
+ 	}
+-	if(!found)_error2_("did not find time interval on which to interpolate forcing values!");
++	if(!found)_error_("did not find time interval on which to interpolate forcing values!");
+ 
+ 	/*Assign output pointer*/
+ 	return input;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 13036)
+@@ -454,12 +454,12 @@
+ 			return;
+ 		case ControlInputEnum:{
+ 			ControlInput* cont_input=(ControlInput*)xinput;
+-			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error2_("not supported yet");
++			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error_("not supported yet");
+ 			PentaP1Input* cast_input=(PentaP1Input*)cont_input->values;
+ 			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
+ 			return;
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ 
+ }
+@@ -494,7 +494,7 @@
+ 	IssmDouble    *thickness_values = NULL;
+ 
+ 	/*Check that input provided is a thickness*/
+-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
++	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
+ 
+ 	/*Get Thickness value pointer*/
+ 	thickness_input->GetValuesPtr(&thickness_values,&num_thickness_values);
+@@ -510,7 +510,7 @@
+ 			return;
+ 
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ }
+ /*}}}*/
+@@ -528,7 +528,7 @@
+ 	IssmDouble            AdotBvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaP1Input*)inputB;
+ 
+ 	/*Create point wise sum*/
+@@ -559,7 +559,7 @@
+ 	IssmDouble            minvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaP1Input*)inputB;
+ 
+ 	/*Create point wise min*/
+@@ -590,7 +590,7 @@
+ 	IssmDouble            maxvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaP1Input*)inputB;
+ 
+ 	/*Create point wise max*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 13036)
+@@ -107,13 +107,13 @@
+ /*Object functions*/
+ /*FUNCTION DoubleInput::GetInputValue(bool* pvalue) {{{*/
+ void DoubleInput::GetInputValue(bool* pvalue){
+-	_error2_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");
++	_error_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetInputValue(int* pvalue){{{*/
+ void DoubleInput::GetInputValue(int* pvalue){
+-	_error2_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
++	_error_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
+ 
+ }
+ /*}}}*/
+@@ -131,10 +131,10 @@
+ void DoubleInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){*pvalue=this->value;}
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
++void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
++void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){{{*/
+ void DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){
+@@ -216,7 +216,7 @@
+ 			return;
+ 
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ 
+ }
+@@ -252,14 +252,14 @@
+ /*FUNCTION DoubleInput::GetVectorFromInputs{{{*/
+ void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){
+ 
+-	_error2_("not supporte yet!");
++	_error_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetValuesPtr{{{*/
+ void DoubleInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+ 
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -275,7 +275,7 @@
+ 	IssmDouble thickness_value;
+ 
+ 	/*Check that input provided is a thickness*/
+-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
++	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
+ 
+ 	/*vertically integrate depending on type:*/
+ 	switch(thickness_input->ObjectEnum()){
+@@ -286,7 +286,7 @@
+ 			return;
+ 
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 13036)
+@@ -39,50 +39,50 @@
+ 		/*TransientInput management: {{{*/
+ 		int    InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* forcingB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* forcingB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* forcingB){_error2_("not implemented yet");};
++		Input* PointwiseDivide(Input* forcingB){_error_("not implemented yet");};
++		Input* PointwiseMin(Input* forcingB){_error_("not implemented yet");};
++		Input* PointwiseMax(Input* forcingB){_error_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xforcing,IssmDouble scalar){_error2_("not implemented yet");};
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error2_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		void AXPY(Input* xforcing,IssmDouble scalar){_error_("not implemented yet");};
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error_("not implemented yet");};
+ 		IssmDouble InfinityNorm(void);
+ 		IssmDouble Max(void);
+ 		IssmDouble MaxAbs(void);
+ 		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void);
+ 		void Extrude(void);
+-		void VerticallyIntegrate(Input* thickness_forcing){_error2_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_forcing){_error_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not supported yet");};
+-      void GetTimeValues(IssmDouble* values,IssmDouble time){_error2_("not implemented yet");};
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not supported yet");};
++      void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");};
+ 		Input* GetTimeInput(IssmDouble time);
+ 		/*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 13036)
+@@ -40,24 +40,24 @@
+ 		Input* PointwiseMin(Input* inputB);
+ 		Input* PointwiseMax(Input* inputB);
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+ 		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss);
+@@ -68,7 +68,7 @@
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+ 		void ConstrainMin(IssmDouble minimum);
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+ 		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+ 		IssmDouble InfinityNorm(void);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp	(revision 13036)
+@@ -78,9 +78,9 @@
+ 	if      (!strncmp(kstr,"</Geometry",10))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");}
++	  {_error_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");}
++	  {_error_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");}
+ 
+ 	else if (!strncmp(kstr,"<",1))
+ 		KML_Object::Read(fid,kstr);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h	(revision 13036)
+@@ -43,13 +43,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h	(revision 13036)
+@@ -35,13 +35,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h	(revision 13036)
+@@ -37,13 +37,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp	(revision 13036)
+@@ -92,9 +92,9 @@
+ 	if      (!strncmp(kstr,"</ColorStyle",12))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);}
++	  {_error_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");}
++	  {_error_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");}
+ 
+ 	else if (!strcmp(kstr,"<color>"))
+ 		KMLFileTokenParse( color     ,NULL,KML_COLORSTYLE_COLOR_LENGTH, kstr, fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 13036)
+@@ -139,9 +139,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<Point", 6)) {
+ 			kobj=(KML_Object*)new KML_Point();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 13036)
+@@ -159,7 +159,7 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 
+ 		else if (strncmp(kstri,"<",1)) {
+ 			if (value) {
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 13036)
+@@ -130,9 +130,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<altitude>"))
+ 			KMLFileTokenParse(&altitude  ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h	(revision 13036)
+@@ -43,13 +43,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 13036)
+@@ -188,9 +188,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ //		else if (!strncmp(kstri,"<IconStyle",10)) {
+ //			icon      =new KML_IconStyle();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 13036)
+@@ -139,9 +139,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<Point", 6)) {
+ 			kobj=(KML_Object*)new KML_Point();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h	(revision 13036)
+@@ -28,13 +28,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h	(revision 13036)
+@@ -34,13 +34,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h	(revision 13036)
+@@ -29,13 +29,13 @@
+ 		virtual void  Echo();
+ 		virtual void  DeepEcho();
+ 		virtual void  DeepEcho(const char* indent);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 13036)
+@@ -112,9 +112,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<width>"))
+ 			KMLFileTokenParse(&width     ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h	(revision 13036)
+@@ -31,13 +31,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h	(revision 13036)
+@@ -30,13 +30,13 @@
+ 		virtual void  Echo();
+ 		virtual void  DeepEcho();
+ 		virtual void  DeepEcho(const char* indent);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 13036)
+@@ -105,9 +105,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Container::Read(fid,kstri);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 13036)
+@@ -105,9 +105,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Container::Read(fid,kstri);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h	(revision 13036)
+@@ -28,13 +28,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 13036)
+@@ -106,9 +106,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}
++		  {_error_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}
++		  {_error_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}
+ 
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Object::Read(fid,kstri);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h	(revision 13036)
+@@ -37,13 +37,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h	(revision 13036)
+@@ -35,13 +35,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h	(revision 13036)
+@@ -32,13 +32,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 13036)
+@@ -144,9 +144,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<href>"))
+ 			KMLFileTokenParse( href      ,NULL,KML_ICON_HREF_LENGTH, kstri, fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 13036)
+@@ -125,9 +125,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<extrude>"))
+ 			KMLFileTokenParse(&extrude   , kstri, fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 13036)
+@@ -138,9 +138,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<extrude>"))
+ 			KMLFileTokenParse(&extrude,kstri,fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp	(revision 13036)
+@@ -148,9 +148,9 @@
+ 	if      (!strncmp(kstr,"</Feature", 9))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Feature::Read -- Unexpected closing tag " << kstr);}
++	  {_error_("KML_Feature::Read -- Unexpected closing tag " << kstr);}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");}
++	  {_error_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");}
+ 
+ 	else if (!strncmp(kstr,"<Style", 6)) {
+ 		kobj=(KML_Object*)new KML_Style();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h	(revision 13036)
+@@ -39,13 +39,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 13036)
+@@ -258,7 +258,7 @@
+ 	char*   ktokn;
+ 
+ 	if (strncmp(&ktag[0],"<"        ,1) || strncmp(&ktag[strlen(ktag)-1],">",1))
+-		_error2_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n");
++		_error_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n");
+ 
+ /*  strtok modifies ktag, so work on copy  */
+ 
+@@ -354,7 +354,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
++		_error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
+ 
+ 	sscanf(kstr,"%d",pival);
+ 	xDelete<char>(kstr);
+@@ -367,7 +367,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -387,7 +387,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-	  {_error2_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");}
++	  {_error_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");}
+ 
+ 	sscanf(kstr,"%d",&ival);
+ 	*pbval=(bool)ival;
+@@ -401,7 +401,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -432,7 +432,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n");
++		_error_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n");
+ 
+ 	if (!pstr) {
+ 		if (maxlen)
+@@ -462,7 +462,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -483,7 +483,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-	  {_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}
++	  {_error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}
+ 
+ 	sscanf(kstr,"%g",pfval);
+ 	xDelete<char>(kstr);
+@@ -496,7 +496,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -517,7 +517,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
++		_error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
+ 
+ 	sscanf(kstr,"%lg",pdval);
+ 	xDelete<char>(kstr);
+@@ -530,7 +530,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -555,7 +555,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");
++		_error_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");
+ 
+ 	if (!*pdval)
+ 		if (maxlen)
+@@ -569,7 +569,7 @@
+ 	while (ktok) {
+ 		i++;
+ 		if (maxlen && (maxlen < i+1))
+-			_error2_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n");
++			_error_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n");
+ 		sscanf(ktok,"%lg",&((*pdval)[i]));
+ 		ktok=strtok(NULL,delim);
+ 	}
+@@ -594,7 +594,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -621,7 +621,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n");
++		_error_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n");
+ 
+ 	if (!*pdval)
+ 		if (maxlen)
+@@ -635,7 +635,7 @@
+ 	while (ktok) {
+ 		i++;
+ 		if (maxlen && (maxlen*n < i+1))
+-			_error2_("KMLFileTokenParse -- Double [m x n] field too short for " << ktag << ".\n");
++			_error_("KMLFileTokenParse -- Double [m x n] field too short for " << ktag << ".\n");
+ 		j=(j+1) % n;
+ 		sscanf(ktok,"%lg",&((*pdval)[i]));
+ 		ktok=strtok(NULL,delim);
+@@ -664,7 +664,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -711,13 +711,13 @@
+ 
+ 		else if ((kstr[0] == '<') &&
+ 				 (kstr[1] == '/')) {
+-			_error2_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");
++			_error_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");
+ 		}
+ 
+ 		xDelete<char>(kstr);
+ 	}
+ 
+-	_error2_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");
++	_error_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");
+ 
+ 	return(0);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h	(revision 13036)
+@@ -28,13 +28,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp	(revision 13036)
+@@ -82,9 +82,9 @@
+ 	if      (!strncmp(kstr,"</StyleSelector",15))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");}
++	  {_error_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");}
++	  {_error_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");}
+ 
+ 	else if (!strncmp(kstr,"<",1))
+ 		KML_Object::Read(fid,kstr);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 13036)
+@@ -120,9 +120,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<north>"))
+ 			KMLFileTokenParse(&north     ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h	(revision 13036)
+@@ -34,13 +34,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h	(revision 13036)
+@@ -33,13 +33,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 13036)
+@@ -116,9 +116,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<fill>"))
+ 			KMLFileTokenParse(&fill      ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.h	(revision 13036)
+@@ -31,13 +31,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.h	(revision 13036)
+@@ -35,13 +35,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.h	(revision 13036)
+@@ -37,13 +37,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.cpp	(revision 13036)
+@@ -145,9 +145,9 @@
+ 	if      (!strncmp(kstr,"</Object", 8))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Object::Read -- Unexpected closing tag " << kstr << ".\n");}
++	  {_error_("KML_Object::Read -- Unexpected closing tag " << kstr << ".\n");}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Object::Read -- Unexpected field \"" << kstr << "\".\n");}
++	  {_error_("KML_Object::Read -- Unexpected field \"" << kstr << "\".\n");}
+ 
+ 	else if (!strncmp(kstr,"<Placemark",10)) {
+ 		kobj=(KML_Object*)new KML_Placemark();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Comment.h	(revision 13036)
+@@ -29,13 +29,13 @@
+ 		virtual void  Echo();
+ 		virtual void  DeepEcho();
+ 		virtual void  DeepEcho(const char* indent);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.cpp	(revision 13036)
+@@ -82,9 +82,9 @@
+ 	if      (!strncmp(kstr,"</SubStyle",10))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_SubStyle::Read -- Unexpected closing tag " << kstr << ".\n");}
++	  {_error_("KML_SubStyle::Read -- Unexpected closing tag " << kstr << ".\n");}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_SubStyle::Read -- Unexpected field \"" << kstr << "\".\n");}
++	  {_error_("KML_SubStyle::Read -- Unexpected field \"" << kstr << "\".\n");}
+ 
+ 	else if (!strncmp(kstr,"<",1))
+ 		KML_Object::Read(fid,kstr);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.h	(revision 13036)
+@@ -33,13 +33,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.h	(revision 13036)
+@@ -30,13 +30,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.cpp	(revision 13036)
+@@ -140,9 +140,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LineString::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_LineString::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LineString::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_LineString::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<extrude>"))
+ 			KMLFileTokenParse(&extrude   ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.h	(revision 13036)
+@@ -29,13 +29,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.cpp	(revision 13036)
+@@ -109,9 +109,9 @@
+ 		return;
+ 	}
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Overlay::Read -- Unexpected closing tag " << kstr << ".\n");}
++	  {_error_("KML_Overlay::Read -- Unexpected closing tag " << kstr << ".\n");}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Overlay::Read -- Unexpected field \"" << kstr << "\".\n");}
++	  {_error_("KML_Overlay::Read -- Unexpected field \"" << kstr << "\".\n");}
+ 
+ 	else if (!strcmp(kstr,"<color>"))
+ 		KMLFileTokenParse( color     ,NULL,KML_OVERLAY_COLOR_LENGTH,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.cpp	(revision 13036)
+@@ -119,9 +119,9 @@
+ 		return;
+ 	}
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Container::Read -- Unexpected closing tag " << kstr );}
++	  {_error_("KML_Container::Read -- Unexpected closing tag " << kstr );}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Container::Read -- Unexpected field \"" << kstr << "\"");}
++	  {_error_("KML_Container::Read -- Unexpected field \"" << kstr << "\"");}
+ 
+ 	else if (!strncmp(kstr,"<Placemark",10)) {
+ 		kobj=(KML_Object*)new KML_Placemark();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.h	(revision 13036)
+@@ -29,13 +29,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.h	(revision 13036)
+@@ -30,13 +30,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp	(revision 13036)
+@@ -178,9 +178,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Polygon::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Polygon::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<extrude>"))
+ 			KMLFileTokenParse(&extrude   ,
+@@ -206,9 +206,9 @@
+ 					break;
+ 				}
+ 				else if (!strncmp(kstrj,"</",2))
+-				  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}
++				  {_error_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}
+ 				else if (strncmp(kstrj,"<",1))
+-				  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}
++				  {_error_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}
+ 
+ 				else if (!strncmp(kstrj,"<LinearRing",11)) {
+ 					kobj=(KML_Object*)new KML_LinearRing();
+@@ -233,9 +233,9 @@
+ 					break;
+ 				}
+ 				else if (!strncmp(kstrj,"</",2))
+-				  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}
++				  {_error_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}
+ 				else if (strncmp(kstrj,"<",1))
+-				  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}
++				  {_error_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}
+ 
+ 				else if (!strncmp(kstrj,"<LinearRing",11)) {
+ 					kobj=(KML_Object*)new KML_LinearRing();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h	(revision 13036)
+@@ -42,34 +42,34 @@
+ 		/*}}}*/
+ 		/*Param virtual functions definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+ 		void  GetParameterValue(int** pintarray,int* pM);
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");};
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");};
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+ 		void  SetValue(IssmDouble* IssmDoublearray,int M);
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
++		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 		
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h	(revision 13036)
+@@ -47,29 +47,29 @@
+ 		void  GetParameterValue(int** pintarray,int* pM);
+ 		void  GetParameterValue(int** pintarray,int* pM,int* pN);
+ 		void  GetParameterValue(IssmDouble* pIssmDouble){*pIssmDouble=value;}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){this->value=(IssmDouble)boolean;}
+ 		void  SetValue(int integer){this->value=(IssmDouble)integer;}
+ 		void  SetValue(IssmDouble scalar){this->value=(IssmDouble)scalar;}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h	(revision 13036)
+@@ -44,33 +44,33 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
++		void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << "cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims);
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble vec array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble mat array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
++		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a boolean");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a scalar");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble vec array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble mat array");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");}
++		void  SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int mat array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array);
+ 		void  UnitConversion(int direction_enum);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h	(revision 13036)
+@@ -43,34 +43,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+ 		void  GetParameterValue(int** pintarray,int* pM,int* pN);
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN);
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
++		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
+ 		void  SetValue(IssmDouble* IssmDoublearray,int M,int N);
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}
++		void  SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h	(revision 13036)
+@@ -41,34 +41,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){  _error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(bool* pbool){  _error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){*pfid=value;};
+ 
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h	(revision 13036)
+@@ -43,34 +43,34 @@
+ 		/*}}}*/
+ 		/*Param virtual functions definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+ 		void  GetParameterValue(int** pintarray,int* pM);
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array (maybe in serial?)");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array (maybe in serial?)");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
++		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
+ 		void  SetValue(int* intarray,int M);
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 		
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h	(revision 13036)
+@@ -42,34 +42,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+ 		void  GetParameterValue(int* pinteger){*pinteger=value;}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a bool");}
++		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a bool");}
+ 		void  SetValue(int integer){this->value=integer;}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an IssmDouble");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}
++		void  SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an IssmDouble");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h	(revision 13036)
+@@ -42,33 +42,33 @@
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+ 		void  GetParameterValue(bool* pbool){*pbool=value;}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){this->value=boolean;}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an int");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an IssmPDouble");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold an int");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold an IssmPDouble");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 		
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h	(revision 13036)
+@@ -43,34 +43,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+ 		void  GetParameterValue(int** pintarray,int* pM,int* pN);
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");};
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");};
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");};
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");};
++		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");};
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");};
+ 		void  SetValue(int* intarray,int M,int N);
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp	(revision 13036)
+@@ -135,7 +135,7 @@
+ 			}
+ 		}
+ 	}
+-	if(!found)_error2_("did not find time interval on which to interpolate values");
++	if(!found)_error_("did not find time interval on which to interpolate values");
+ 	*pdouble=output;
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h	(revision 13036)
+@@ -42,34 +42,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(Vector** poutput);
+-		void  GetParameterValue(FILE** pfid){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(FILE** pfid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
++		void  SetValue(bool boolean){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
++		void  SetValue(int integer){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}
++		void  SetValue(char* string){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+ 		void  SetValue(Vector* vec);
+-		void  SetValue(Matrix* mat){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(Matrix* mat){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp	(revision 13036)
+@@ -123,7 +123,7 @@
+ /*}}}*/
+ /*FUNCTION DoubleVecParam::GetParameterValue(int** pintarray,int* pM){{{*/
+ void  DoubleVecParam::GetParameterValue(int** pintarray,int* pM){
+-	_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
++	_error_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
+ }
+ /*}}}*/
+ /*FUNCTION DoubleVecParam::GetParameterName{{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h	(revision 13036)
+@@ -42,34 +42,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");}
++		void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");}
+ 		void  GetParameterValue(Matrix** poutput);
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+ 		void  SetValue(Matrix* mat);
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp	(revision 13036)
+@@ -81,32 +81,32 @@
+ /*}}}*/
+ /*FUNCTION DoubleParam::GetParameterValue(int* pinteger){{{*/
+ void DoubleParam::GetParameterValue(int* pinteger){
+-	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
++	_error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
+ }
+ /*}}}*/
+ /*FUNCTION DoubleParam::GetParameterValue(bool* pbool){{{*/
+ void DoubleParam::GetParameterValue(bool* pbool){
+-	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an bool");
++	_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){
+-	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");
++	_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){
+-	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");
++	_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){
+-	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");
++	_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){
+-	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");
++	_error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");
+ }
+ /*}}}*/
+ /*FUNCTION DoubleParam::UnitConversion{{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h	(revision 13036)
+@@ -44,34 +44,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
+ 		void  GetParameterValue(char*** pstringarray,int* pM);
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Vec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Vec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+ 		void  SetValue(char** stringarray,int M);
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h	(revision 13036)
+@@ -42,34 +42,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+-		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
++		void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+ 		void  GetParameterValue(char** pstring);
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}
+ 		void  SetValue(char* string);
+-		void  SetValue(char** stringarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp	(revision 13036)
+@@ -108,7 +108,7 @@
+ /*}}}*/
+ /*FUNCTION DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{*/
+ void  DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){
+-	_error2_("DoubleMat of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
++	_error_("DoubleMat of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
+ }
+ /*}}}*/
+ /*FUNCTION DoubleMatParam::GetParameterName{{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h	(revision 13036)
+@@ -43,34 +43,34 @@
+ 		/*}}}*/
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+-		void  GetParameterValue(bool* pbool){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a bool");}
+-		void  GetParameterValue(int* pinteger){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble");}
++		void  GetParameterValue(bool* pbool){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a bool");}
++		void  GetParameterValue(int* pinteger){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+ 		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time);
+-		void  GetParameterValue(char** pstring){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a FILE");}
++		void  GetParameterValue(char** pstring){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+-		void  SetValue(bool boolean){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a boolean");}
+-		void  SetValue(int integer){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an integer");}
+-		void  SetValue(IssmDouble scalar){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a scalar");}
+-		void  SetValue(char* string){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");}
+-		void  SetValue(int* intarray,int M,int N){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int mat array");};
+-		void  SetValue(Vector* vec){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");}
++		void  SetValue(bool boolean){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a boolean");}
++		void  SetValue(int integer){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an integer");}
++		void  SetValue(IssmDouble scalar){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a scalar");}
++		void  SetValue(char* string){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");}
++		void  SetValue(int* intarray,int M,int N){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int mat array");};
++		void  SetValue(Vector* vec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h	(revision 13036)
+@@ -27,10 +27,10 @@
+ 		void  Echo();
+ 		void  DeepEcho();
+ 		void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
++		int   Id(){_error_("Not implemented yet");};
++		int   MyRank(){_error_("Not implemented yet");};
+ 		int   ObjectEnum(){return OptionStructEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
++		Object* copy(){_error_("Not implemented yet");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+@@ -38,12 +38,12 @@
+ 		int   NumEl();
+ 		int   NDims();
+ 		int*  Size();
+-		void  Get(int* pvalue){_error2_("An OptionStruct object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error2_("An OptionStruct object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue){  _error2_("An OptionStruct object cannot return a bool");};
+-		void  Get(char** pvalue){ _error2_("An OptionStruct object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionStruct object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionStruct object cannot return a IssmDouble vec");};
++		void  Get(int* pvalue){_error_("An OptionStruct object cannot return a int");};
++		void  Get(IssmDouble* pvalue){_error_("An OptionStruct object cannot return a IssmDouble");};
++		void  Get(bool* pvalue){  _error_("An OptionStruct object cannot return a bool");};
++		void  Get(char** pvalue){ _error_("An OptionStruct object cannot return a string");};
++		void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionStruct object cannot return a string vec");};
++		void  Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionStruct object cannot return a IssmDouble vec");};
+ 		void  Get(Options** pvalue);
+ 		void  Get(Options*** ppvalue,int *pnumel);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp	(revision 13036)
+@@ -124,7 +124,7 @@
+ 
+ 	/*We should first check that the size is one*/
+ 	if(this->NumEl()!=1){
+-		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single int");
++		_error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single int");
+ 	}
+ 
+ 	/*Assign output pointer*/
+@@ -136,7 +136,7 @@
+ 
+ 	/*We should first check that the size is one*/
+ 	if(this->NumEl()!=1){
+-		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single IssmDouble");
++		_error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single IssmDouble");
+ 	}
+ 
+ 	/*Assign output pointer*/
+@@ -148,7 +148,7 @@
+ 
+ 	/*We should first check that the size is at least one*/
+ 	if(this->NumEl()<=0){
+-		_error2_("option \"" << this->name << "\" is empty and cannot return a IssmDouble vector");
++		_error_("option \"" << this->name << "\" is empty and cannot return a IssmDouble vector");
+ 	}
+ 
+ 	/*Copy vector*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp	(revision 13036)
+@@ -124,7 +124,7 @@
+ 
+ 	/*We should first check that the size is one*/
+ 	if(this->NumEl()!=1){
+-		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single bool");
++		_error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single bool");
+ 	}
+ 
+ 	/*Assign output pointer*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp	(revision 13036)
+@@ -26,7 +26,7 @@
+ 
+ 	/*check for index too large  */
+ 	for (i=0;i<ndims;i++) aprod*=size[i];
+-	if (index >= aprod) _error2_("Index " << index << " exceeds number of elements " << aprod << ".");
++	if (index >= aprod) _error_("Index " << index << " exceeds number of elements " << aprod << ".");
+ 
+ 	/*calculate the dimensions (being careful of integer division)  */
+ 	for (i=ndims-1; i>=0; i--) {
+@@ -45,7 +45,7 @@
+ 
+ 	/*check for any dimension too large  */
+ 	for (i=0;i<ndims;i++){
+-		if (dims[i] >= size[i]) _error2_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");
++		if (dims[i] >= size[i]) _error_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");
+ 	}
+ 
+ 	/*calculate the index  */
+@@ -64,7 +64,7 @@
+ 
+ 	/*check for index too large  */
+ 	for (i=0; i<ndims; i++) aprod*=size[i];
+-	if (index >= aprod) _error2_("Index " << index << " exceeds number of elements " << aprod << ".");
++	if (index >= aprod) _error_("Index " << index << " exceeds number of elements " << aprod << ".");
+ 
+ 	/*calculate the dimensions (being careful of integer division)  */
+ 	for (i=0; i<ndims; i++) {
+@@ -83,7 +83,7 @@
+ 
+ 	/*check for any dimension too large  */
+ 	for (i=0; i<ndims; i++){
+-		if (dims[i] >= size[i]) _error2_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");
++		if (dims[i] >= size[i]) _error_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");
+ 	}
+ 
+ 	/*calculate the index  */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp	(revision 13036)
+@@ -152,7 +152,7 @@
+ 
+ 	/*We should first check that the size is at least one*/
+ 	if(this->NumEl()<=0){
+-		_error2_("option \"" << this->name << "\" is empty and cannot return a string vector");
++		_error_("option \"" << this->name << "\" is empty and cannot return a string vector");
+ 	}
+ 
+ 	/*Calculate the size and number of strings*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h	(revision 13036)
+@@ -27,10 +27,10 @@
+ 		void  Echo();
+ 		void  DeepEcho();
+ 		void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
++		int   Id(){_error_("Not implemented yet");};
++		int   MyRank(){_error_("Not implemented yet");};
+ 		int   ObjectEnum(){return OptionDoubleEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
++		Object* copy(){_error_("Not implemented yet");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+@@ -40,12 +40,12 @@
+ 		int*  Size();
+ 		void  Get(int* pvalue);
+ 		void  Get(IssmDouble* pvalue);
+-		void  Get(bool* pvalue){  _error2_("An OptionDouble object cannot return a bool");};
+-		void  Get(char** pvalue){ _error2_("An OptionDouble object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionDouble object cannot return a string vec");};
++		void  Get(bool* pvalue){  _error_("An OptionDouble object cannot return a bool");};
++		void  Get(char** pvalue){ _error_("An OptionDouble object cannot return a string");};
++		void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionDouble object cannot return a string vec");};
+ 		void  Get(IssmDouble** pvalue,int* pnumel);
+-		void  Get(Options** pvalue){ _error2_("An OptionDouble object cannot return an Options DataSet");};
+-		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionDouble object cannot return an Options DataSet vec");};
++		void  Get(Options** pvalue){ _error_("An OptionDouble object cannot return an Options DataSet");};
++		void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionDouble object cannot return an Options DataSet vec");};
+ 
+ };
+ #endif  /* _OPTIONDOUBLE_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h	(revision 13036)
+@@ -27,10 +27,10 @@
+ 		void  Echo();
+ 		void  DeepEcho();
+ 		void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
++		int   Id(){_error_("Not implemented yet");};
++		int   MyRank(){_error_("Not implemented yet");};
+ 		int   ObjectEnum(){return OptionLogicalEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
++		Object* copy(){_error_("Not implemented yet");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+@@ -38,14 +38,14 @@
+ 		int   NumEl();
+ 		int   NDims();
+ 		int*  Size();
+-		void  Get(int* pvalue){_error2_("An OptionLogical object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error2_("An OptionLogical object cannot return a IssmDouble");};
++		void  Get(int* pvalue){_error_("An OptionLogical object cannot return a int");};
++		void  Get(IssmDouble* pvalue){_error_("An OptionLogical object cannot return a IssmDouble");};
+ 		void  Get(bool* pvalue);
+-		void  Get(char** pvalue){ _error2_("An OptionLogical object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionLogical object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionLogical object cannot return a IssmDouble vec");};
+-		void  Get(Options** pvalue){ _error2_("An OptionLogical object cannot return an Options DataSet");};
+-		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionLogical object cannot return an Options DataSet vec");};
++		void  Get(char** pvalue){ _error_("An OptionLogical object cannot return a string");};
++		void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionLogical object cannot return a string vec");};
++		void  Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionLogical object cannot return a IssmDouble vec");};
++		void  Get(Options** pvalue){ _error_("An OptionLogical object cannot return an Options DataSet");};
++		void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionLogical object cannot return an Options DataSet vec");};
+ 
+ };
+ #endif  /* _OPTIONLOGICAL_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h	(revision 13036)
+@@ -27,10 +27,10 @@
+ 		void  Echo();
+ 		void  DeepEcho();
+ 		void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
++		int   Id(){_error_("Not implemented yet");};
++		int   MyRank(){_error_("Not implemented yet");};
+ 		int   ObjectEnum(){return OptionCharEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
++		Object* copy(){_error_("Not implemented yet");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+@@ -38,14 +38,14 @@
+ 		int   NumEl();
+ 		int   NDims();
+ 		int*  Size();
+-		void  Get(int* pvalue){_error2_("An OptionChar object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error2_("An OptionChar object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue){  _error2_("An OptionChar object cannot return a bool");};
++		void  Get(int* pvalue){_error_("An OptionChar object cannot return a int");};
++		void  Get(IssmDouble* pvalue){_error_("An OptionChar object cannot return a IssmDouble");};
++		void  Get(bool* pvalue){  _error_("An OptionChar object cannot return a bool");};
+ 		void  Get(char** pvalue);
+ 		void  Get(char*** ppvalue,int *pnumel);
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionChar object cannot return a IssmDouble vec");};
+-		void  Get(Options** pvalue){ _error2_("An OptionChar object cannot return an Options DataSet");};
+-		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionChar object cannot return an Options DataSet vec");};
++		void  Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionChar object cannot return a IssmDouble vec");};
++		void  Get(Options** pvalue){ _error_("An OptionChar object cannot return an Options DataSet");};
++		void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionChar object cannot return an Options DataSet vec");};
+ 
+ };
+ #endif  /* _OPTIONCHAR_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h	(revision 13036)
+@@ -30,10 +30,10 @@
+ 		virtual void  Echo();
+ 		virtual void  DeepEcho();
+ 		virtual void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
++		int   Id(){_error_("Not implemented yet");};
++		int   MyRank(){_error_("Not implemented yet");};
+ 		int   ObjectEnum(){return OptionEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
++		Object* copy(){_error_("Not implemented yet");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h	(revision 13036)
+@@ -27,10 +27,10 @@
+ 		void  Echo();
+ 		void  DeepEcho();
+ 		void  DeepEcho(char* indent);
+-		int   Id(){_error2_("Not implemented yet");};
+-		int   MyRank(){_error2_("Not implemented yet");};
++		int   Id(){_error_("Not implemented yet");};
++		int   MyRank(){_error_("Not implemented yet");};
+ 		int   ObjectEnum(){return OptionCellEnum;};
+-		Object* copy(){_error2_("Not implemented yet");};
++		Object* copy(){_error_("Not implemented yet");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+@@ -38,14 +38,14 @@
+ 		int   NumEl();
+ 		int   NDims();
+ 		int*  Size();
+-		void  Get(int* pvalue){_error2_("An OptionCell object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error2_("An OptionCell object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue){  _error2_("An OptionCell object cannot return a bool");};
+-		void  Get(char** pvalue){ _error2_("An OptionCell object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error2_("An OptionCell object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionCell object cannot return a IssmDouble vec");};
++		void  Get(int* pvalue){_error_("An OptionCell object cannot return a int");};
++		void  Get(IssmDouble* pvalue){_error_("An OptionCell object cannot return a IssmDouble");};
++		void  Get(bool* pvalue){  _error_("An OptionCell object cannot return a bool");};
++		void  Get(char** pvalue){ _error_("An OptionCell object cannot return a string");};
++		void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionCell object cannot return a string vec");};
++		void  Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionCell object cannot return a IssmDouble vec");};
+ 		void  Get(Options** pvalue);
+-		void  Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionCell object cannot return an Options DataSet vec");};
++		void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionCell object cannot return an Options DataSet vec");};
+ 
+ };
+ #endif  /* _OPTIONCELL_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp	(revision 13036)
+@@ -131,7 +131,7 @@
+ 
+ 	/*We should first check that the size is one*/
+ 	if(this->NumEl()!=1){
+-		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single options dataset");
++		_error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single options dataset");
+ 	}
+ 
+ 	/*Assign output pointer*/
+@@ -143,7 +143,7 @@
+ 
+ 	/*We should first check that the size is at least one*/
+ 	if(this->NumEl()<=0){
+-		_error2_("option \"" << this->name << "\" is empty and cannot return an options dataset vector");
++		_error_("option \"" << this->name << "\" is empty and cannot return an options dataset vector");
+ 	}
+ 
+ 	/*Assign output pointer*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.h	(revision 13036)
+@@ -63,7 +63,7 @@
+ 		void  InputUpdateFromConstant(int constant, int name);
+ 		void  InputUpdateFromConstant(bool constant, int name);
+ 		void  InputUpdateFromSolution(IssmDouble* solution);
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
+ 		/*}}}*/
+ 		/*Load virtual functions definitions: {{{*/
+ 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp	(revision 13036)
+@@ -269,7 +269,7 @@
+ 			Ke=CreateKMatrixAdjointBalancethickness();
+ 			break;
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global matrix*/
+@@ -299,7 +299,7 @@
+ 			pe=CreatePVectorAdjointBalancethickness();
+ 			break;
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global matrix*/
+@@ -346,7 +346,7 @@
+ 		case BoundaryEnum:
+ 			return CreateKMatrixPrognosticBoundary();
+ 		default:
+-			_error2_("type not supported yet");
++			_error_("type not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -499,7 +499,7 @@
+ 		case BoundaryEnum:
+ 			return CreateKMatrixBalancethicknessBoundary();
+ 		default:
+-			_error2_("type not supported yet");
++			_error_("type not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -650,7 +650,7 @@
+ 		case BoundaryEnum:
+ 			return CreateKMatrixAdjointBalancethicknessBoundary();
+ 		default:
+-			_error2_("type not supported yet");
++			_error_("type not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -682,7 +682,7 @@
+ 		case BoundaryEnum:
+ 			return CreatePVectorPrognosticBoundary();
+ 		default:
+-			_error2_("type not supported yet");
++			_error_("type not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -750,7 +750,7 @@
+ 		vxaverage_input->GetInputValue(&vx,gauss);
+ 		vyaverage_input->GetInputValue(&vy,gauss);
+ 		spcthickness_input->GetInputValue(&thickness,gauss);
+-		if(xIsNan<IssmDouble>(thickness)) _error2_("Cannot weakly apply constraint because NaN was provided");
++		if(xIsNan<IssmDouble>(thickness)) _error_("Cannot weakly apply constraint because NaN was provided");
+ 
+ 		UdotN=vx*normal[0]+vy*normal[1];
+ 		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+@@ -776,7 +776,7 @@
+ 		case BoundaryEnum:
+ 			return CreatePVectorBalancethicknessBoundary();
+ 		default:
+-			_error2_("type not supported yet");
++			_error_("type not supported yet");
+ 	}
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp	(revision 13036)
+@@ -171,7 +171,7 @@
+ 			Ke=PenaltyCreateKMatrixPrognostic(kmax);
+ 			break;
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global Vector*/
+@@ -243,27 +243,27 @@
+ 			switch(approximation1){
+ 				case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
+ 				case PattynApproximationEnum:   return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
+-				default: _error2_("not supported yet");
++				default: _error_("not supported yet");
+ 			}
+ 		case PattynApproximationEnum:
+ 			switch(approximation1){
+ 				case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
+ 				case PattynApproximationEnum:   return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
+-				default: _error2_("not supported yet");
++				default: _error_("not supported yet");
+ 			}
+ 		case StokesApproximationEnum:
+ 			switch(approximation1){
+ 				case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 
+ 				case NoneApproximationEnum: return   PenaltyCreateKMatrixDiagnosticStokes(kmax); 
+-				default: _error2_("not supported yet");
++				default: _error_("not supported yet");
+ 			}
+ 		case NoneApproximationEnum:
+ 			switch(approximation1){
+ 				case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 
+ 				case NoneApproximationEnum: return   PenaltyCreateKMatrixDiagnosticStokes(kmax); 
+-				default: _error2_("not supported yet");
++				default: _error_("not supported yet");
+ 			}
+-		default: _error2_("not supported yet");
++		default: _error_("not supported yet");
+ 	}
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.h	(revision 13036)
+@@ -61,25 +61,25 @@
+ 		/*}}}*/
+ 		/*Update virtual functions resolution: {{{*/
+ 		void    InputUpdateFromVector(IssmDouble* vector, int name, int type);
+-		void    InputUpdateFromVector(int* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVector(bool* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows,int ncols, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVectorDakota(int* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVectorDakota(bool* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");}
++		void    InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");}
++		void    InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows,int ncols, int name, int type){_error_("Not implemented yet!");}
++		void    InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error_("Not implemented yet!");}
++		void    InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");}
++		void    InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");}
+ 		void    InputUpdateFromConstant(IssmDouble constant, int name);
+-		void    InputUpdateFromConstant(int constant, int name){_error2_("Not implemented yet!");}
++		void    InputUpdateFromConstant(int constant, int name){_error_("Not implemented yet!");}
+ 		void    InputUpdateFromConstant(bool constant, int name);
+-		void    InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		void    InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");}
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
+ 		/*}}}*/
+ 		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+ 		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff){_error2_("Not implemented yet");};
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error2_("Not implemented yet");};
++		void  CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");};
++		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");};
+ 		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+ 		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
+ 		bool  InAnalysis(int analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h	(revision 13036)
+@@ -49,25 +49,25 @@
+ 		/*}}}*/
+ 		/*Update virtual functions resolution: {{{*/
+ 		void    InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/}
+-		void    InputUpdateFromVector(int* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVector(bool* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");}
++		void    InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");}
+ 		void    InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/}
+ 		void    InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/}
+-		void    InputUpdateFromVectorDakota(int* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromVectorDakota(bool* vector, int name, int type){_error2_("Not implemented yet!");}
++		void    InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");}
++		void    InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");}
+ 		void    InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/};
+ 		void    InputUpdateFromConstant(int constant, int name){/*Do nothing*/};
+-		void    InputUpdateFromConstant(bool constant, int name){_error2_("Not implemented yet!");}
+-		void    InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		void    InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");}
++		void    InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");}
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
+ 		/*}}}*/
+ 		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+ 		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff){_error2_("Not implemented yet");};
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error2_("Not implemented yet");};
++		void  CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");};
++		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");};
+ 		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+ 		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
+ 		bool  InAnalysis(int analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.h	(revision 13036)
+@@ -43,15 +43,15 @@
+ 		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
+ 		void  InputUpdateFromVector(int* vector, int name, int type);
+ 		void  InputUpdateFromVector(bool* vector, int name, int type);
+-		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrow, int ncols,int name, int type){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromVectorDakota(int* vector, int name, int type){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromVectorDakota(bool* vector, int name, int type){_error2_("Not implemented yet!");}
++		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrow, int ncols,int name, int type){_error_("Not implemented yet!");}
++		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error_("Not implemented yet!");}
++		void  InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");}
++		void  InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");}
+ 		void  InputUpdateFromConstant(IssmDouble constant, int name);
+ 		void  InputUpdateFromConstant(int constant, int name);
+ 		void  InputUpdateFromConstant(bool constant, int name);
+-		void  InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		void  InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");}
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
+ 		/*}}}*/
+ 			/*Load virtual functions definitions: {{{*/
+ 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp	(revision 13036)
+@@ -238,7 +238,7 @@
+ 			break;
+ 		#endif
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global matrix*/
+@@ -270,7 +270,7 @@
+ 			break;
+ 		#endif
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global Vector*/
+@@ -378,7 +378,7 @@
+ 		return;
+ 	}
+ 	else{
+-		_error2_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");
++		_error_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");
+ 	}
+ 
+ }
+@@ -615,6 +615,6 @@
+ /*}}}*/
+ /*FUNCTION Pengrid::UpdateInputs {{{*/
+ void  Pengrid::UpdateInputs(IssmDouble* solution){
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp	(revision 13036)
+@@ -80,7 +80,7 @@
+ 		icefront_node_ids[2]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2));
+ 		icefront_node_ids[3]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3));
+ 	}
+-	else _error2_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!");
++	else _error_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!");
+ 
+ 	if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum)
+ 	 num_nodes=4;
+@@ -262,7 +262,7 @@
+ 			break;
+ 		#endif
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global Vector*/
+@@ -378,7 +378,7 @@
+ 			return CreatePVectorDiagnosticStokes();
+ 	    #endif
+ 		default:
+-			_error2_("Icefront type " << EnumToStringx(type) << " not supported yet");
++			_error_("Icefront type " << EnumToStringx(type) << " not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -440,7 +440,7 @@
+ 				water_pressure=-1.0/2.0*gravity*rho_ice*pow(thickness,2); // we are facing a wall of ice. use water_pressure to cancel the lithostatic pressure.
+ 				break;
+ 			default:
+-				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
++				_error_("fill type " << EnumToStringx(fill) << " not supported yet");
+ 		}
+ 		ice_pressure=1.0/2.0*gravity*rho_ice*pow(thickness,2);
+ 		air_pressure=0;
+@@ -563,7 +563,7 @@
+ 				water_pressure=0;
+ 				break;
+ 			default:
+-				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
++				_error_("fill type " << EnumToStringx(fill) << " not supported yet");
+ 		}
+ 		ice_pressure=rho_ice*gravity*(surface-z_g);
+ 		air_pressure=0;
+@@ -637,7 +637,7 @@
+ 				water_pressure=0;
+ 				break;
+ 			default:
+-				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
++				_error_("fill type " << EnumToStringx(fill) << " not supported yet");
+ 		}
+ 		air_pressure=0;
+ 		pressure = water_pressure + air_pressure; //no ice pressure fore Stokes
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Friction.cpp	(revision 13036)
+@@ -106,10 +106,10 @@
+ 		this->GetInputValue(&vz, gauss,vzenum);
+ 		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
+ 	}
+-	else _error2_("element_type "<< element_type << " not supported yet");
++	else _error_("element_type "<< element_type << " not supported yet");
+ 
+ 	/*Checks that s-1>0 if v=0*/
+-        if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
++        if(vmag==0 && (s-1)<0) _error_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
+ 
+ 	alpha2=pow(drag_coefficient,2)*pow(Neff,r)*pow(vmag,(s-1));
+ 	_assert_(!xIsNan<IssmDouble>(alpha2));
+@@ -170,10 +170,10 @@
+ 		this->GetInputValue(&vz, gauss,vzenum);
+ 		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
+ 	}
+-	else _error2_("element_type "<< element_type << " not supported yet");
++	else _error_("element_type "<< element_type << " not supported yet");
+ 
+ 	/*Checks that s-1>0 if v=0*/
+-	if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
++	if(vmag==0 && (s-1)<0) _error_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
+ 
+ 	alpha2=pow(drag_coefficient,2)*pow(Neff,r)*pow(vmag,(s-1));
+ 	_assert_(!xIsNan<IssmDouble>(alpha2));
+@@ -237,10 +237,10 @@
+ 		this->GetInputValue(&vz, gauss,vzenum);
+ 		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
+ 	}
+-	else _error2_("element_type "<< element_type << " not supported yet");
++	else _error_("element_type "<< element_type << " not supported yet");
+ 
+ 	/*Checks that s-1>0 if v=0*/
+-	if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
++	if(vmag==0 && (s-1)<0) _error_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
+ 
+ 	alpha_complement=pow(Neff,r)*pow(vmag,(s-1));            _assert_(!xIsNan<IssmDouble>(alpha_complement));
+ 
+@@ -303,10 +303,10 @@
+ 		this->GetInputValue(&vz, gauss,vzenum);
+ 		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
+ 	}
+-	else _error2_("element_type "<< element_type << " not supported yet");
++	else _error_("element_type "<< element_type << " not supported yet");
+ 
+ 	/*Checks that s-1>0 if v=0*/
+-	if(vmag==0 && (s-1)<0) _error2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
++	if(vmag==0 && (s-1)<0) _error_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");
+ 
+ 	alpha_complement=pow(Neff,r)*pow(vmag,(s-1));            _assert_(!xIsNan<IssmDouble>(alpha_complement));
+ 
+@@ -318,7 +318,7 @@
+ void Friction::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int enum_type){
+ 
+ 	Input* input=inputs->GetInput(enum_type);
+-	if(!input) _error2_("input " << EnumToStringx(enum_type) << " not found");
++	if(!input) _error_("input " << EnumToStringx(enum_type) << " not found");
+ 	input->GetInputValue(pvalue,gauss);
+ 
+ }
+@@ -327,7 +327,7 @@
+ void Friction::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int enum_type){
+ 
+ 	Input* input=inputs->GetInput(enum_type);
+-	if(!input) _error2_("input " << EnumToStringx(enum_type) << " not found");
++	if(!input) _error_("input " << EnumToStringx(enum_type) << " not found");
+ 	input->GetInputValue(pvalue,gauss);
+ 
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.h	(revision 13036)
+@@ -64,15 +64,15 @@
+ 		void  InputUpdateFromConstant(int constant, int name);
+ 		void  InputUpdateFromConstant(bool constant, int name);
+ 		void  InputUpdateFromSolution(IssmDouble* solution);
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
+ 		/*}}}*/
+ 		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+ 		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff){_error2_("Not implemented yet");};
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error2_("Not implemented yet");};
++		void  CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");};
++		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");};
+ 		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+ 		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
+ 		bool  InAnalysis(int analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp	(revision 13036)
+@@ -275,7 +275,7 @@
+ 	if (!IsInput(name)) return;
+ 
+ 	/*update input*/
+-	_error2_("not implemented yet");
++	_error_("not implemented yet");
+ 	//this->inputs->AddInput(new DoubleInput(name,constant));
+ 
+ }
+@@ -323,7 +323,7 @@
+ 			Ke=PenaltyCreateKMatrixDiagnosticHoriz(kmax);
+ 			break;
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global Vector*/
+@@ -349,7 +349,7 @@
+ 			/*No penalty applied on load vector*/
+ 			break;
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global Vector*/
+@@ -396,7 +396,7 @@
+ 	Tria       *tria2               = NULL;
+ 
+ 	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");
+ 	tria1=(Tria*)elements[0];
+ 	tria2=(Tria*)elements[1];
+ 
+@@ -409,7 +409,7 @@
+ 	this->inputs->GetInputValue(&friction,FrictionEnum);
+ 	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
+ 	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
+-	if (h[0]!=h[1])_error2_("different thicknesses not supported for rift fronts");
++	if (h[0]!=h[1])_error_("different thicknesses not supported for rift fronts");
+ 	thickness=h[0];
+ 
+ 	/*There is contact, we need to constrain the normal velocities (zero penetration), and the 
+@@ -487,7 +487,7 @@
+ 	Tria       *tria2               = NULL;
+ 
+ 	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");
+ 	tria1=(Tria*)elements[0];
+ 	tria2=(Tria*)elements[1];
+ 
+@@ -503,11 +503,11 @@
+ 	gravity=matpar->GetG();
+ 	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
+ 	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
+-	if (h[0]!=h[1])_error2_("different thicknesses not supported for rift fronts");
++	if (h[0]!=h[1])_error_("different thicknesses not supported for rift fronts");
+ 	thickness=h[0];
+ 	tria1->GetInputValue(&b[0],nodes[0],BedEnum);
+ 	tria2->GetInputValue(&b[1],nodes[1],BedEnum);
+-	if (b[0]!=b[1])_error2_("different beds not supported for rift fronts");
++	if (b[0]!=b[1])_error_("different beds not supported for rift fronts");
+ 	bed=b[0];
+ 
+ 	/*Ok, this rift is opening. We should put loads on both sides of the rift flanks. Because we are dealing with contact mechanics, 
+@@ -535,7 +535,7 @@
+ 	}
+ 	else if(fill==MelangeEnum){ //icefront finding itself against another icefront (pressure imbalance is fully compensated, ice vs ice)
+ 
+-		if(!shelf) _error2_("fill type " << fill << " not supported on ice sheets yet.");
++		if(!shelf) _error_("fill type " << fill << " not supported on ice sheets yet.");
+ 
+ 		pressure_litho=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2;
+ 		pressure_air=0;
+@@ -545,7 +545,7 @@
+ 		pressure=pressure_litho-pressure_air-pressure_melange-pressure_water;
+ 	}
+ 	else{
+-		_error2_("fill type " << fill << " not supported yet.");
++		_error_("fill type " << fill << " not supported yet.");
+ 	}
+ 
+ 	/*Ok, add contribution to first node, along the normal i==0: */
+@@ -584,7 +584,7 @@
+ 	Tria       *tria2           = NULL;
+ 
+ 	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");
+ 
+ 	/*recover elements on both side of rift: */
+ 	tria1=(Tria*)elements[0];
+@@ -705,7 +705,7 @@
+ 	Tria       *tria2           = NULL;
+ 
+ 	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");
+ 
+ 	/*recover elements on both side of rift: */
+ 	tria1=(Tria*)elements[0];
+@@ -750,7 +750,7 @@
+ 	Tria     *tria2       = NULL;
+ 
+ 	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");
+ 
+ 	/*recover elements on both side of rift: */
+ 	tria1=(Tria*)elements[0];
+@@ -793,7 +793,7 @@
+ 	Tria       *tria2           = NULL;
+ 
+ 	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");
+ 
+ 	/*recover elements on both side of rift: */
+ 	tria1=(Tria*)elements[0];
+@@ -843,7 +843,7 @@
+ 	Tria       *tria2       = NULL;
+ 
+ 	/*enum of element? */
+-	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_("only Tria element allowed for Riftfront load!");
++	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");
+ 
+ 	/*recover elements on both side of rift: */
+ 	tria1=(Tria*)elements[0];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 13036)
+@@ -69,7 +69,7 @@
+ 	/*set single point constraints: */
+ 
+ 	/*spc all nodes on water*/
+-	if (!iomodel->Data(MaskVertexonwaterEnum)) _error2_("iomodel->nodeonwater is NULL");
++	if (!iomodel->Data(MaskVertexonwaterEnum)) _error_("iomodel->nodeonwater is NULL");
+ 	if (reCast<IssmBool>(iomodel->Data(MaskVertexonwaterEnum)[io_index])){
+ 		for(k=1;k<=gsize;k++){
+ 			this->FreezeDof(k);
+@@ -113,7 +113,7 @@
+ 
+ 	/*Diagnostic Hutter*/
+ 	if (analysis_type==DiagnosticHutterAnalysisEnum){
+-		if (!iomodel->Data(FlowequationVertexEquationEnum)) _error2_("iomodel->vertices_type is NULL");
++		if (!iomodel->Data(FlowequationVertexEquationEnum)) _error_("iomodel->vertices_type is NULL");
+ 		/*Constrain all nodes that are not Hutter*/
+ 		if (reCast<int>(iomodel->Data(FlowequationVertexEquationEnum)[io_index])!=HutterApproximationEnum){
+ 			for(k=1;k<=gsize;k++){
+@@ -229,7 +229,7 @@
+ 		_assert_(dofindex>=0 && dofindex<indexing.ssize);
+ 		return indexing.sdoflist[dofindex];
+ 	}
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -301,7 +301,7 @@
+ 			}
+ 			else for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i];
+ 		}
+-		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 	}
+ }
+ /*}}}*/
+@@ -341,7 +341,7 @@
+ 				}
+ 			}
+ 		}
+-		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 	}
+ 	else{
+ 
+@@ -410,7 +410,7 @@
+ 				}
+ 			}
+ 		}
+-		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 	}
+ }
+ /*}}}*/
+@@ -596,7 +596,7 @@
+ 		if (setenum==GsetEnum) numdofs=this->indexing.gsize;
+ 		else if (setenum==FsetEnum) numdofs=this->indexing.fsize;
+ 		else if (setenum==SsetEnum) numdofs=this->indexing.ssize;
+-		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 	}
+ 	else{
+ 		if(setenum==GsetEnum){
+@@ -626,7 +626,7 @@
+ 			}
+ 			else numdofs=this->indexing.ssize;
+ 		}
+-		else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 	}
+ 	return numdofs;
+ }
+@@ -833,7 +833,7 @@
+ 			ug->SetValues(this->indexing.ssize,indices,values,INS_VAL);
+ 		}
+ 	}
+-	else _error2_("VecMerge can only merge from the s or f-set onto the g-set!");
++	else _error_("VecMerge can only merge from the s or f-set onto the g-set!");
+ 
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(values);
+@@ -879,7 +879,7 @@
+ 			vector->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
+ 		}
+ 	}
+-	else _error2_("VecReduce can only merge from the s or f-set onto the g-set!");
++	else _error_("VecReduce can only merge from the s or f-set onto the g-set!");
+ 
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(values);
+@@ -926,7 +926,7 @@
+ 		}
+ 		dofcount+=this->indexing.ssize;
+ 	}
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 
+ 
+ 	/*Assign output pointers: */
+@@ -955,7 +955,7 @@
+ 	else if(setenum==SsetEnum){
+ 		for(i=0;i<this->indexing.ssize;i++) indexing.sdoflist[i]+=dofcount;
+ 	}
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Node::ShowTrueDofs{{{*/
+@@ -971,7 +971,7 @@
+ 	if(setenum==GsetEnum)for(j=0;j<this->indexing.gsize;j++)  *(truedofs+ncols*sid+j)=indexing.gdoflist[j];
+ 	else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++)  *(truedofs+ncols*sid+j)=indexing.fdoflist[j];
+ 	else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++)  *(truedofs+ncols*sid+j)=indexing.sdoflist[j];
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -990,7 +990,7 @@
+ 	if(setenum==GsetEnum)for(j=0;j<this->indexing.gsize;j++) indexing.gdoflist[j]=*(alltruedofs+ncols*sid+j);
+ 	else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++) indexing.fdoflist[j]=*(alltruedofs+ncols*sid+j);
+ 	else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++) indexing.sdoflist[j]=*(alltruedofs+ncols*sid+j);
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp	(revision 13036)
+@@ -145,7 +145,7 @@
+ 			}
+ 		}
+ 
+-		if(!found)_error2_("could not find time segment for constraint");
++		if(!found)_error_("could not find time segment for constraint");
+ 
+ 		/*Apply or relax constraint: */
+ 		if(xIsNan<IssmDouble>(value)){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h	(revision 13036)
+@@ -44,7 +44,7 @@
+ 		int   Id(); 
+ 		int   MyRank();
+ 		int   ObjectEnum();
+-		Object* copy(){_error2_("Not implemented yet (similar to Elements)");};
++		Object* copy(){_error_("Not implemented yet (similar to Elements)");};
+ 		/*}}}*/
+ 		/*Update virtual functions definitions: {{{*/
+ 		
+@@ -58,8 +58,8 @@
+ 		void  InputUpdateFromConstant(IssmDouble constant, int name);
+ 		void  InputUpdateFromConstant(int constant, int name);
+ 		void  InputUpdateFromConstant(bool constant, int name);
+-		void  InputUpdateFromSolution(IssmDouble* solution){_error2_("Not implemented yet!");}
+-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("Not implemented yet!");}
++		void  InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");}
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("Not implemented yet!");}
+ 		/*}}}*/
+ 		/*Node numerical routines {{{*/
+ 		void   Configure(DataSet* nodes,Vertices* vertices);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp	(revision 13036)
+@@ -141,7 +141,7 @@
+ 
+ 	IssmDouble data[6];
+ 
+-	if(numdofs!=6)_error2_("Result " << EnumToStringx(this->enum_type) << " is a PentaP1ElementResult and cannot write vector of " << numdofs << " dofs");
++	if(numdofs!=6)_error_("Result " << EnumToStringx(this->enum_type) << " is a PentaP1ElementResult and cannot write vector of " << numdofs << " dofs");
+ 	for(int i=0;i<6;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i];
+ 	vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
+ 
+@@ -149,5 +149,5 @@
+ /*FUNCTION PentaP1ElementResult::GetElementVectorFromResults{{{*/
+ void PentaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
+ 
+-	_error2_("Result " << EnumToStringx(enum_type) << " is a PentaP1ElementResult and should not write vector of size numberofelemenrs");
++	_error_("Result " << EnumToStringx(enum_type) << " is a PentaP1ElementResult and should not write vector of size numberofelemenrs");
+ } /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp	(revision 13036)
+@@ -128,7 +128,7 @@
+ /*FUNCTION DoubleElementResult::GetVectorFromResults{{{1*/
+ void DoubleElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
+ 
+-	_error2_("cannot return vector on vertices");
++	_error_("cannot return vector on vertices");
+ } /*}}}*/
+ /*FUNCTION DoubleElementResult::GetElementVectorFromResults{{{1*/
+ void DoubleElementResult::GetElementVectorFromResults(Vector* vector,int dof){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp	(revision 13036)
+@@ -127,7 +127,7 @@
+ /*FUNCTION BoolElementResult::GetVectorFromResults{{{*/
+ void BoolElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
+ 
+-	_error2_("cannot return vector on vertices");
++	_error_("cannot return vector on vertices");
+ } /*}}}*/
+ /*FUNCTION BoolElementResult::GetElementVectorFromResults{{{*/
+ void BoolElementResult::GetElementVectorFromResults(Vector* vector,int dof){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp	(revision 13036)
+@@ -129,12 +129,12 @@
+ 
+ 	IssmDouble data[3];
+ 
+-	if(numdofs!=3)_error2_("Result " << EnumToStringx(this->enum_type) << " is a TriaP1ElementResult and cannot write vector of " << numdofs << " dofs");
++	if(numdofs!=3)_error_("Result " << EnumToStringx(this->enum_type) << " is a TriaP1ElementResult and cannot write vector of " << numdofs << " dofs");
+ 	for(int i=0;i<3;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i];
+ 	vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
+ 
+ } /*}}}*/
+ /*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{*/
+ void TriaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
+-	_error2_("Result " << EnumToStringx(enum_type) << " is a TriaP1ElementResult and should not write vector of size numberofelemenrs");
++	_error_("Result " << EnumToStringx(enum_type) << " is a TriaP1ElementResult and should not write vector of size numberofelemenrs");
+ } /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13036)
+@@ -213,7 +213,7 @@
+ 			break;
+ 		#endif
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global matrix*/
+@@ -276,7 +276,7 @@
+ 		case P1DGEnum:
+ 			return CreateKMatrixPrognostic_DG();
+ 		default:
+-			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
++			_error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
+ 	}
+ 
+ }
+@@ -567,7 +567,7 @@
+ 			break;
+ 		#endif
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global Vector*/
+@@ -586,7 +586,7 @@
+ 		case P1DGEnum:
+ 			return CreatePVectorPrognostic_DG();
+ 		default:
+-			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
++			_error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -762,7 +762,7 @@
+ 			break;
+ #endif
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global matrix*/
+@@ -774,12 +774,12 @@
+ /*}}}*/
+ /*FUNCTION Tria::ComputeBasalStress {{{*/
+ void  Tria::ComputeBasalStress(Vector* eps){
+-	_error2_("Not Implemented yet");
++	_error_("Not Implemented yet");
+ }
+ /*}}}*/
+ /*FUNCTION Tria::ComputeStrainRate {{{*/
+ void  Tria::ComputeStrainRate(Vector* eps){
+-	_error2_("Not Implemented yet");
++	_error_("Not Implemented yet");
+ }
+ /*}}}*/
+ /*FUNCTION Tria::ComputeStressTensor {{{*/
+@@ -1087,7 +1087,7 @@
+ 		if(node==nodes[i])
+ 		 return i;
+ 	}
+-	_error2_("Node provided not found among element nodes");
++	_error_("Node provided not found among element nodes");
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GetInputListOnVertices(IssmDouble* pvalue,int enumtype) {{{*/
+@@ -1099,7 +1099,7 @@
+ 
+ 	/*Recover input*/
+ 	Input* input=inputs->GetInput(enumtype);
+-	if (!input) _error2_("Input " << EnumToStringx(enumtype) << " not found in element");
++	if (!input) _error_("Input " << EnumToStringx(enumtype) << " not found in element");
+ 
+ 	/*Checks in debugging mode*/
+ 	_assert_(pvalue);
+@@ -1171,7 +1171,7 @@
+ void Tria::GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){
+ 
+ 	Input* input=inputs->GetInput(enumtype);
+-	if(!input) _error2_("No input of type " << EnumToStringx(enumtype) << " found in tria");
++	if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria");
+ 
+ 	GaussTria* gauss=new GaussTria();
+ 	gauss->GaussVertex(this->GetNodeIndex(node));
+@@ -1213,7 +1213,7 @@
+ 		break;
+ 	#endif
+ 	default:
+-		_error2_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");
++		_error_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");
+ 	}
+ 
+ }
+@@ -1229,7 +1229,7 @@
+ 
+ 	/*Check that both inputs have been found*/
+ 	if (!vx_input || !vy_input){
+-		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");
++		_error_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");
+ 	}
+ 
+ 	/*Get strain rate assuming that epsilon has been allocated*/
+@@ -1253,7 +1253,7 @@
+ 
+ 	/*Get input (either in element or material)*/
+ 	Input* input=inputs->GetInput(input_enum);
+-	if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in element");
++	if(!input) _error_("Input " << EnumToStringx(input_enum) << " not found in element");
+ 
+ 	/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
+ 	input->GetVectorFromInputs(vector,&doflist1[0]);
+@@ -1265,7 +1265,7 @@
+ 	/*Get result*/
+ 	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
+ 	if(elementresult->InstanceEnum()!=enum_in){
+-		_error2_("Results of offset "<<offset<<" is "<<EnumToStringx(elementresult->InstanceEnum())<<" when "<<EnumToStringx(enum_in)<<" was expected");
++		_error_("Results of offset "<<offset<<" is "<<EnumToStringx(elementresult->InstanceEnum())<<" when "<<EnumToStringx(enum_in)<<" was expected");
+ 	}
+ 	if(interp==P1Enum){
+ 		int doflist1[NUMVERTICES];
+@@ -1303,7 +1303,7 @@
+ 
+ 	/*Make a copy of the original input: */
+ 	input=(Input*)this->inputs->GetInput(enum_type);
+-	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
++	if(!input)_error_("could not find old input with enum: " << EnumToStringx(enum_type));
+ 
+ 	/*ArtificialNoise: */
+ 	input->ArtificialNoise(min,max);
+@@ -1323,8 +1323,8 @@
+ 	for(i=0;i<num_enums/2;i++){
+ 		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
+ 		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
+-		if(!new_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
+-		if(!old_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
++		if(!new_inputs[i])_error_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
++		if(!old_inputs[i])_error_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
+ 	}
+ 
+ 	/*ok, we've got the inputs (new and old), now loop throught the number of criterions and fill the eps array:*/
+@@ -1352,8 +1352,8 @@
+ 	else if (object_enum==MaterialsEnum)
+ 	 oldinput=(Input*)this->matice->inputs->GetInput(enum_type);
+ 	else
+-	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
+-	if(!oldinput)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
++	 _error_("object " << EnumToStringx(object_enum) << " not supported yet");
++	if(!oldinput)_error_("could not find old input with enum: " << EnumToStringx(enum_type));
+ 	newinput=(Input*)oldinput->copy();
+ 
+ 	/*Assign new name (average)*/
+@@ -1365,7 +1365,7 @@
+ 	else if (object_enum==MaterialsEnum)
+ 	 this->matice->inputs->AddInput((Input*)newinput);
+ 	else
+-	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
++	 _error_("object " << EnumToStringx(object_enum) << " not supported yet");
+ }
+ /*}}}*/
+ /*FUNCTION Tria::InputDuplicate{{{*/
+@@ -1383,7 +1383,7 @@
+ 
+ 	/*Make a copy of the original input: */
+ 	input=(Input*)this->inputs->GetInput(enum_type);
+-	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
++	if(!input)_error_("could not find old input with enum: " << EnumToStringx(enum_type));
+ 
+ 	/*Scale: */
+ 	input->Scale(scale_factor);
+@@ -1398,7 +1398,7 @@
+ 	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
+ 	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(enum_type);
+ 	else input=this->inputs->GetInput(enum_type);
+-	//if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found in tria->inputs");
++	//if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found in tria->inputs");
+ 	if(!input)return;
+ 
+ 	/*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result 
+@@ -1504,7 +1504,7 @@
+ 				case MaterialsRheologyBbarEnum:
+ 					/*Matice will take care of it*/ break;
+ 				default:
+-					_error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
++					_error_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
+ 			}
+ 		}
+ 	}
+@@ -1576,7 +1576,7 @@
+ 			InputUpdateFromSolutionPrognostic(solution);
+ 			break;
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -1594,7 +1594,7 @@
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(int i=0;i<numdof;i++){
+ 		values[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Add input to the element: */
+@@ -1627,7 +1627,7 @@
+ 	this->parameters->FindParam(&minthickness,PrognosticMinThicknessEnum);
+ 	for(i=0;i<numdof;i++){
+ 		newthickness[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(newthickness[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(newthickness[i])) _error_("NaN found in solution vector");
+ 		/*Constrain thickness to be at least 1m*/
+ 		if(newthickness[i]<minthickness) newthickness[i]=minthickness;
+ 	}
+@@ -1658,7 +1658,7 @@
+ 				newsurface[i]=oldsurface[i]+(1.0-rho_ice/rho_water)*(newthickness[i]-oldthickness[i]); //surface = oldsurface + (1-di) * dH 
+ 				newbed[i]=oldbed[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i]); //bed = oldbed + di * dH
+ 			}
+-			else _error2_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
++			else _error_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
+ 		}
+ 	}
+ 
+@@ -1699,18 +1699,18 @@
+ 			return;
+ 		}
+ 		default:
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ }
+ /*}}}*/
+ /*FUNCTION Tria::InputUpdateFromVector(int* vector, int name, int type);{{{*/
+ void  Tria::InputUpdateFromVector(int* vector, int name, int type){
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Tria::InputUpdateFromVector(bool* vector, int name, int type);{{{*/
+ void  Tria::InputUpdateFromVector(bool* vector, int name, int type){
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Tria::InputCreate(IssmDouble scalar,int enum,int code);{{{*/
+@@ -1728,7 +1728,7 @@
+ 	else if ((code==7) || (code==3)){ //IssmDouble
+ 		this->inputs->AddInput(new DoubleInput(name,reCast<int>(scalar)));
+ 	}
+-	else _error2_("could not recognize nature of vector from code " << code);
++	else _error_("could not recognize nature of vector from code " << code);
+ 
+ }
+ /*}}}*/
+@@ -1794,7 +1794,7 @@
+ 			}
+ 			this->inputs->AddInput(transientinput);
+ 		}
+-		else _error2_("nodal vector is either numberofnodes or numberofnodes+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
++		else _error_("nodal vector is either numberofnodes or numberofnodes+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
+ 	}
+ 	else if(vector_type==2){ //element vector
+ 		/*Are we in transient or static? */
+@@ -1811,14 +1811,14 @@
+ 			else if (code==7){ //IssmDouble
+ 				this->inputs->AddInput(new DoubleInput(vector_enum,vector[index]));
+ 			}
+-			else _error2_("could not recognize nature of vector from code " << code);
++			else _error_("could not recognize nature of vector from code " << code);
+ 		}
+ 		else {
+-			_error2_("transient elementary inputs not supported yet!");
++			_error_("transient elementary inputs not supported yet!");
+ 		}
+ 	}
+ 	else{
+-		_error2_("Cannot add input for vector type " << vector_type << " (not supported)");
++		_error_("Cannot add input for vector type " << vector_type << " (not supported)");
+ 	}
+ 
+ }
+@@ -2245,12 +2245,12 @@
+ /*FUNCTION Tria::SetClone {{{*/
+ void  Tria::SetClone(int* minranks){
+ 
+-	_error2_("not implemented yet");
++	_error_("not implemented yet");
+ }
+ /*}}}*/
+ /*FUNCTION Tria::SmearFunction {{{*/
+ void  Tria::SmearFunction(Vector*  smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
+-	_error2_("not implemented yet");
++	_error_("not implemented yet");
+ 
+ }
+ /*}}}*/
+@@ -2397,7 +2397,7 @@
+ 	this->MaxAbsVx(&maxabsvx,false);
+ 	this->MaxAbsVy(&maxabsvy,false);
+ 	#else
+-		_error2_("ISSM was not compiled with responses compiled in, exiting!");
++		_error_("ISSM was not compiled with responses compiled in, exiting!");
+ 	#endif
+ 
+ 	/* Get node coordinates and dof list: */
+@@ -2590,7 +2590,7 @@
+ 	rho_ice=matpar->GetRhoIce();
+ 
+ 	/*First off, check that this segment belongs to this element: */
+-	if ((int)*(segment+4)!=this->id)_error2_("error message: segment with id " << (int)*(segment+4) << " does not belong to element with id:" << this->id);
++	if ((int)*(segment+4)!=this->id)_error_("error message: segment with id " << (int)*(segment+4) << " does not belong to element with id:" << this->id);
+ 
+ 	/*Recover segment node locations: */
+ 	x1=*(segment+0); y1=*(segment+1); x2=*(segment+2); y2=*(segment+3);
+@@ -2809,7 +2809,7 @@
+ 			/*Assign output pointers:*/
+ 			*presponse=vel;
+ 		default:  
+-			_error2_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
++			_error_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
+ 	}
+ 
+ }
+@@ -3296,8 +3296,8 @@
+ 		vy[i]=values[i*NDOF2+1];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Get Vz and compute vel*/
+@@ -3356,8 +3356,8 @@
+ 		vy[i]=values[i*NDOF2+1];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Now Compute vel*/
+@@ -3412,7 +3412,7 @@
+ 		}
+ 
+ 		if (input->ObjectEnum()!=ControlInputEnum){
+-			_error2_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");
++			_error_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");
+ 		}
+ 
+ 		((ControlInput*)input)->UpdateValue(scalar);
+@@ -3437,8 +3437,8 @@
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+ 	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++	if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found");
++	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+ 
+ 	GradientIndexing(&doflist1[0],control_index);
+ 	((ControlInput*)input)->GetGradient(gradient,&doflist1[0]);
+@@ -3455,8 +3455,8 @@
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+ 	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++	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);
+ }/*}}}*/
+@@ -3474,8 +3474,8 @@
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+ 	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++	if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found");
++	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+ 
+ 	GradientIndexing(&doflist1[0],control_index);
+ 	for(int i=0;i<NUMVERTICES;i++) grad_list[i]=gradient[doflist1[i]];
+@@ -3509,7 +3509,7 @@
+ 			GradjVyBalancedthickness(gradient,control_index);
+ 			break;
+ 		default:
+-			_error2_("control type not supported yet: " << control_type);
++			_error_("control type not supported yet: " << control_type);
+ 	}
+ 
+ 	/*Now deal with ∂J/∂alpha*/
+@@ -3539,7 +3539,7 @@
+ 			GradjBGradient(gradient,resp,control_index);
+ 			break;
+ 		default:
+-			_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++			_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+ 	}
+ 
+ 	xDelete<int>(responses);
+@@ -4520,7 +4520,7 @@
+ 				for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*(-vy)+dH[1]*vx)*(dbasis[0][i]*(-vy)+dbasis[1][i]*vx)*Jdet*gauss->weight;
+ 				break;
+ 			default:
+-				_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++				_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+ 		}
+ 	}
+ 
+@@ -4704,7 +4704,7 @@
+ 					/*Nothing in P vector*/
+ 					break;
+ 				default:
+-					_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+ 			}
+ 		}
+ 	}
+@@ -4887,7 +4887,7 @@
+ 					/*Nothing in P vector*/
+ 					break;
+ 				default:
+-					_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+ 			}
+ 		}
+ 	}
+@@ -4956,7 +4956,7 @@
+ 			Ke=CreateKMatrixBalancethickness_DG();
+ 			break;
+ 		default:
+-			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
++			_error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
+ 	}
+ 
+ 	/*Transpose and return Ke*/
+@@ -5057,8 +5057,8 @@
+ 		lambday[i]=values[i*NDOF2+1];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(lambdax[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(lambday[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambdax[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambday[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Add vx and vy as inputs to the tria element: */
+@@ -5088,7 +5088,7 @@
+ 	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+ 	for(i=0;i<numdof;i++){
+ 		lambda[i]=values[i];
+-		if(xIsNan<IssmDouble>(lambda[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambda[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Add vx and vy as inputs to the tria element: */
+@@ -5120,7 +5120,7 @@
+ 
+ 	/*Check that it is a ControlInput*/
+ 	if (input->ObjectEnum()!=ControlInputEnum){
+-		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
++		_error_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
+ 	}
+ 
+ 	((ControlInput*)input)->GetVectorFromInputs(vector,&doflist1[0],data);
+@@ -5154,7 +5154,7 @@
+ 	}
+ 
+ 	if (input->ObjectEnum()!=ControlInputEnum){
+-		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
++		_error_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
+ 	}
+ 
+ 	((ControlInput*)input)->SetInput(new_input);
+@@ -5424,7 +5424,7 @@
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(i=0;i<numdof;i++){
+ 		values[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+ 		if (values[i]<pow((IssmDouble)10,(IssmDouble)-10))values[i]=pow((IssmDouble)10,(IssmDouble)-10); //correcting the water column to positive values
+  
+ 	}
+@@ -5523,19 +5523,19 @@
+ 			break;
+ 
+ 		default:
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ 
+ }
+ /*}}}*/
+ /*FUNCTION Tria::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/
+ void  Tria::InputUpdateFromVectorDakota(int* vector, int name, int type){
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/
+ void  Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type){
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Tria::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type);{{{*/
+@@ -5577,7 +5577,7 @@
+ 			break;
+ 
+ 		default:
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ 
+ }
+@@ -5594,7 +5594,7 @@
+ 		case P1DGEnum:
+ 			return CreateKMatrixBalancethickness_DG();
+ 		default:
+-			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
++			_error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
+ 	}
+ 
+ }
+@@ -5773,7 +5773,7 @@
+ 		case P1DGEnum:
+ 			return CreatePVectorBalancethickness_DG();
+ 		default:
+-			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
++			_error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
+ 	}
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp	(revision 13036)
+@@ -948,7 +948,7 @@
+ 
+ 	/*Get Determinant*/
+ 	Matrix3x3Determinant(Jdet,&J[0][0]);
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
++	if(*Jdet<0) _error_("negative jacobian determinant!");
+ 
+ }
+ /*}}}*/
+@@ -971,7 +971,7 @@
+ 
+ 	/*Jdet = norm( AB ^ AC ) / (2 * area of the reference triangle), with areaRef=sqrt(3) */
+ 	*Jdet=SQRT3/6.0*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2.0)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2.0)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2.0),0.5);
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
++	if(*Jdet<0) _error_("negative jacobian determinant!");
+ }
+ /*}}}*/
+ /*FUNCTION PentaRef::GetSegmentJacobianDeterminant{{{*/
+@@ -989,7 +989,7 @@
+ 	z2=*(xyz_list+3*1+2);
+ 
+ 	*Jdet=1.0/2.0*sqrt(pow(x2-x1,2.) + pow(y2-y1,2.) + pow(z2-z1,2.));
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
++	if(*Jdet<0) _error_("negative jacobian determinant!");
+ 
+ }
+ /*}}}*/
+@@ -1225,7 +1225,7 @@
+ 	/*Jdet = (Area of the trapezoid)/(Area trapezoid ref) with AreaRef = 4*/
+ 	/*Area of a trabezoid = altitude * (base1 + base2)/2 */
+ 	*Jdet= pow(pow(x2-x1,2.) + pow(y2-y1,2.),0.5) * (z4-z1 + z3-z2)/8;
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
++	if(*Jdet<0) _error_("negative jacobian determinant!");
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 13036)
+@@ -99,7 +99,7 @@
+ 		void   InputScale(int enum_type,IssmDouble scale_factor);
+ 		void   InputToResult(int enum_type,int step,IssmDouble time);
+ 		void   DeleteResults(void);
+-		void   MaterialUpdateFromTemperature(void){_error2_("not implemented yet");};
++		void   MaterialUpdateFromTemperature(void){_error_("not implemented yet");};
+ 		void   MigrateGroundingLine(IssmDouble* oldfloating,IssmDouble* sheet_ungrounding);
+ 		int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
+ 		void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
+@@ -109,7 +109,7 @@
+ 		void   PatchFill(int* pcount, Patch* patch);
+ 		void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
+ 		void   ProcessResultsUnits(void);
+-		void   ResetCoordinateSystem(void){_error2_("not implemented yet");};
++		void   ResetCoordinateSystem(void){_error_("not implemented yet");};
+ 		void	 SmbGradients();
+ 		IssmDouble SurfaceArea(void);
+ 		void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13036)
+@@ -145,7 +145,7 @@
+ /*Other*/
+ /*FUNCTION Penta::AverageOntoPartition {{{*/
+ void  Penta::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
+-	_error2_("Not supported yet!");
++	_error_("Not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Penta::BedNormal {{{*/
+@@ -251,8 +251,8 @@
+ 	inputs->GetInputValue(&approximation,ApproximationEnum);
+ 
+ 	/*Check analysis_types*/
+-	if (analysis_type!=DiagnosticHorizAnalysisEnum) _error2_("Not supported yet!");
+-	if (approximation!=StokesApproximationEnum) _error2_("Not supported yet!");
++	if (analysis_type!=DiagnosticHorizAnalysisEnum) _error_("Not supported yet!");
++	if (approximation!=StokesApproximationEnum) _error_("Not supported yet!");
+ 
+ 	/*retrieve some parameters: */
+ 	this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+@@ -317,7 +317,7 @@
+ /*FUNCTION Penta::ComputeStrainRate {{{*/
+ void  Penta::ComputeStrainRate(Vector* eps){
+ 
+-	_error2_("Not implemented yet");
++	_error_("Not implemented yet");
+ 
+ }
+ /*}}}*/
+@@ -463,7 +463,7 @@
+ 			break;
+ 		#endif
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global matrix*/
+@@ -568,7 +568,7 @@
+ 			break;
+ 		#endif
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global Vector*/
+@@ -637,7 +637,7 @@
+ 			break;
+ #endif
+ 		default:
+-			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ 
+ 	/*Add to global matrix*/
+@@ -887,7 +887,7 @@
+ 		if(node==nodes[i])
+ 		 return i;
+ 	}
+-	_error2_("Node provided not found among element nodes");
++	_error_("Node provided not found among element nodes");
+ 
+ }
+ /*}}}*/
+@@ -900,7 +900,7 @@
+ 
+ 	/*Recover input*/
+ 	Input* input=inputs->GetInput(enumtype);
+-	if (!input) _error2_("Input " << EnumToStringx(enumtype) << " not found in element");
++	if (!input) _error_("Input " << EnumToStringx(enumtype) << " not found in element");
+ 
+ 	/*Checks in debugging mode*/
+ 	_assert_(pvalue);
+@@ -949,7 +949,7 @@
+ void Penta::GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){
+ 
+ 	Input* input=inputs->GetInput(enumtype);
+-	if(!input) _error2_("No input of type " << EnumToStringx(enumtype) << " found in tria");
++	if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria");
+ 
+ 	GaussPenta* gauss=new GaussPenta();
+ 	gauss->GaussVertex(this->GetNodeIndex(node));
+@@ -1044,7 +1044,7 @@
+ 		break;
+ 	#endif
+ 	default:
+-		_error2_("analysis: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++		_error_("analysis: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -1084,7 +1084,7 @@
+ 
+ 	/*Check that both inputs have been found*/
+ 	if (!vx_input || !vy_input){
+-		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");
++		_error_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");
+ 	}
+ 
+ 	/*Get strain rate assuming that epsilon has been allocated*/
+@@ -1109,7 +1109,7 @@
+ 
+ 	/*Check that both inputs have been found*/
+ 	if (!vx_input || !vy_input || !vz_input){
+-		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << ", vz: " << vz_input << "\n");
++		_error_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << ", vz: " << vz_input << "\n");
+ 	}
+ 
+ 	/*Get strain rate assuming that epsilon has been allocated*/
+@@ -1144,7 +1144,7 @@
+ 
+ 	/*Get input (either in element or material)*/
+ 	Input* input=inputs->GetInput(input_enum);
+-	if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in element");
++	if(!input) _error_("Input " << EnumToStringx(input_enum) << " not found in element");
+ 
+ 	/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
+ 	input->GetVectorFromInputs(vector,&doflist1[0]);
+@@ -1156,7 +1156,7 @@
+ 	/*Get result*/
+ 	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
+ 	if(elementresult->InstanceEnum()!=enum_in){
+-		_error2_("Results of offset "<<offset<<" is "<<EnumToStringx(elementresult->InstanceEnum())<<" when "<<EnumToStringx(enum_in)<<" was expected");
++		_error_("Results of offset "<<offset<<" is "<<EnumToStringx(elementresult->InstanceEnum())<<" when "<<EnumToStringx(enum_in)<<" was expected");
+ 	}  
+ 	if(interp==P1Enum){
+ 		int doflist1[NUMVERTICES];
+@@ -1207,7 +1207,7 @@
+ 
+ 	/*Make a copy of the original input: */
+ 	input=(Input*)this->inputs->GetInput(enum_type);
+-	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
++	if(!input)_error_("could not find old input with enum: " << EnumToStringx(enum_type));
+ 
+ 	/*ArtificialNoise: */
+ 	input->ArtificialNoise(min,max);
+@@ -1227,8 +1227,8 @@
+ 	for(i=0;i<num_enums/2;i++){
+ 		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
+ 		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
+-		if(!new_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
+-		if(!old_inputs[i])_error2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
++		if(!new_inputs[i])_error_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
++		if(!old_inputs[i])_error_("could not find input with enum " << EnumToStringx(enums[2*i+0]));
+ 	}
+ 
+ 	/*ok, we've got the inputs (new and old), now loop throught the number of criterions and fill the eps array:*/
+@@ -1260,7 +1260,7 @@
+ 	else if ((code==7) || (code==3)){ //IssmDouble
+ 		this->inputs->AddInput(new DoubleInput(name,(IssmDouble)scalar));
+ 	}
+-	else _error2_("could not recognize nature of vector from code " << code);
++	else _error_("could not recognize nature of vector from code " << code);
+ 
+ }
+ /*}}}*/
+@@ -1326,7 +1326,7 @@
+ 			}
+ 			this->inputs->AddInput(transientinput);
+ 		}
+-		else _error2_("nodal vector is either numberofnodes (" << numberofvertices << "), or numberofnodes+1 long. Field provided is " << M << " long. Enum " << EnumToStringx(vector_enum));
++		else _error_("nodal vector is either numberofnodes (" << numberofvertices << "), or numberofnodes+1 long. Field provided is " << M << " long. Enum " << EnumToStringx(vector_enum));
+ 	}
+ 	else if(vector_type==2){ //element vector
+ 		/*Are we in transient or static? */
+@@ -1343,14 +1343,14 @@
+ 			else if (code==7){ //IssmDouble
+ 				this->inputs->AddInput(new DoubleInput(vector_enum,(IssmDouble)vector[index]));
+ 			}
+-			else _error2_("could not recognize nature of vector from code " << code);
++			else _error_("could not recognize nature of vector from code " << code);
+ 		}
+ 		else {
+-			_error2_("transient elementary inputs not supported yet!");
++			_error_("transient elementary inputs not supported yet!");
+ 		}
+ 	}
+ 	else{
+-		_error2_("Cannot add input for vector type " << vector_type << " (not supported)");
++		_error_("Cannot add input for vector type " << vector_type << " (not supported)");
+ 	}
+ 
+ }
+@@ -1389,8 +1389,8 @@
+ 		else if (object_enum==MaterialsEnum)
+ 		 original_input=(Input*)penta->matice->inputs->GetInput(enum_type);
+ 		else
+-		 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
+-		if(!original_input) _error2_("could not find input with enum " << EnumToStringx(enum_type));
++		 _error_("object " << EnumToStringx(object_enum) << " not supported yet");
++		if(!original_input) _error_("could not find input with enum " << EnumToStringx(enum_type));
+ 
+ 		/*If first time, initialize total_integrated_input*/
+ 		if (step==0){
+@@ -1401,7 +1401,7 @@
+ 			else if (original_input->ObjectEnum()==DoubleInputEnum)
+ 			 total_integrated_input=new DoubleInput(average_enum_type,0.0);
+ 			else
+-			 _error2_("object " << EnumToStringx(original_input->ObjectEnum()) << " not supported yet");
++			 _error_("object " << EnumToStringx(original_input->ObjectEnum()) << " not supported yet");
+ 		}
+ 
+ 		/*Step2: Create element thickness input*/
+@@ -1449,7 +1449,7 @@
+ 	else if (object_enum==MaterialsEnum)
+ 	 this->matice->inputs->AddInput((Input*)depth_averaged_input);
+ 	else
+-	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
++	 _error_("object " << EnumToStringx(object_enum) << " not supported yet");
+ }
+ /*}}}*/
+ /*FUNCTION Penta::InputDuplicate{{{*/
+@@ -1490,10 +1490,10 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("object of type " << EnumToStringx(object_type) << " not supported yet");
++		_error_("object of type " << EnumToStringx(object_type) << " not supported yet");
+ 	}
+ 	for(i=0;i<num_inputs;i++){
+-		if(!base_inputs[i]) _error2_("could not find input with enum " << EnumToStringx(enum_type) << " in object " << EnumToStringx(object_type));
++		if(!base_inputs[i]) _error_("could not find input with enum " << EnumToStringx(enum_type) << " in object " << EnumToStringx(object_type));
+ 		base_inputs[i]->Extrude();
+ 	}
+ 
+@@ -1520,7 +1520,7 @@
+ 				penta->nodes[i+3]->inputs->AddInput((Input*)copy); //change only the three upper nodes
+ 			}
+ 			else{
+-				_error2_("object of type " << EnumToStringx(object_type) << " not supported yet");
++				_error_("object of type " << EnumToStringx(object_type) << " not supported yet");
+ 			}
+ 		}
+ 
+@@ -1539,7 +1539,7 @@
+ 
+ 	/*Make a copy of the original input: */
+ 	input=(Input*)this->inputs->GetInput(enum_type);
+-	if(!input)_error2_("could not find old input with enum: " << EnumToStringx(enum_type));
++	if(!input)_error_("could not find old input with enum: " << EnumToStringx(enum_type));
+ 
+ 	/*Scale: */
+ 	input->Scale(scale_factor);
+@@ -1555,7 +1555,7 @@
+ 	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
+ 	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyBEnum);
+ 	else input=this->inputs->GetInput(enum_type);
+-	//if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found in penta->inputs"); why error out? if the requested input does not exist, we should still 
++	//if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found in penta->inputs"); why error out? if the requested input does not exist, we should still 
+ 	//try and output whatever we can instead of just failing.
+ 	if(!input)return;
+ 
+@@ -1668,7 +1668,7 @@
+ 				case MaterialsRheologyBbarEnum:
+ 					/*Matice will take care of it*/ break;
+ 				default:
+-					_error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
++					_error_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
+ 			}
+ 		}
+ 	}
+@@ -1701,7 +1701,7 @@
+ 			this->inputs->AddInput(new IntInput(ApproximationEnum,NoneApproximationEnum));
+ 		}
+ 		else{
+-			_error2_("Approximation type " << EnumToStringx((int)*(iomodel->Data(FlowequationElementEquationEnum)+index)) << " not supported yet");
++			_error_("Approximation type " << EnumToStringx((int)*(iomodel->Data(FlowequationElementEquationEnum)+index)) << " not supported yet");
+ 		}
+ 	}
+ 
+@@ -1785,7 +1785,7 @@
+ 		break;
+ 	#endif
+ 	default: 
+-		_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
++		_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -1816,7 +1816,7 @@
+ 	this->parameters->FindParam(&minthickness,PrognosticMinThicknessEnum);
+ 	for(i=0;i<numdof2d;i++){
+ 		newthickness[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(newthickness[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(newthickness[i])) _error_("NaN found in solution vector");
+ 		/*Constrain thickness to be at least 1m*/
+ 		if(newthickness[i]<minthickness) newthickness[i]=minthickness;
+ 		newthickness[i+numdof2d]=newthickness[i];
+@@ -1849,7 +1849,7 @@
+ 				newsurface[i]=oldsurface[i]+(1.0-rho_ice/rho_water)*(newthickness[i]-oldthickness[i]); //surface = oldsurface + (1-di) * dH 
+ 				newbed[i]=oldbed[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i]); //bed = oldbed + di * dH
+ 			}
+-			else _error2_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
++			else _error_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
+ 		}
+ 	}
+ 
+@@ -1886,7 +1886,7 @@
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(int i=0;i<numdof;i++){
+ 		values[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Add input to the element: */
+@@ -1916,7 +1916,7 @@
+ 	for(int i=0;i<numdof2d;i++){
+ 		values[i]         =solution[doflist[i]];
+ 		values[i+numdof2d]=values[i];
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Start looping over all elements above current element and update all inputs*/
+@@ -1962,18 +1962,18 @@
+ 
+ 		default:
+ 
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ }
+ /*}}}*/
+ /*FUNCTION Penta::InputUpdateFromVector(int* vector, int name, int type);{{{*/
+ void  Penta::InputUpdateFromVector(int* vector, int name, int type){
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Penta::InputUpdateFromVector(bool* vector, int name, int type);{{{*/
+ void  Penta::InputUpdateFromVector(bool* vector, int name, int type){
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Penta::IsOnBed{{{*/
+@@ -2574,7 +2574,7 @@
+ /*FUNCTION Penta::SetClone {{{*/
+ void  Penta::SetClone(int* minranks){
+ 
+-	_error2_("not implemented yet");
++	_error_("not implemented yet");
+ }
+ /*}}}*/
+ /*FUNCTION Penta::SetCurrentConfiguration {{{*/
+@@ -2941,7 +2941,7 @@
+ 				}
+ 				this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,nodeinputs));
+ 			}
+-			else _error2_("temperature and waterfraction required for the enthalpy solution");
++			else _error_("temperature and waterfraction required for the enthalpy solution");
+ 			break;
+ 
+ 		default:
+@@ -3020,7 +3020,7 @@
+ /*}}}*/
+ /*FUNCTION Penta::SmearFunction {{{*/
+ void  Penta::SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
+-	_error2_("not implemented yet");
++	_error_("not implemented yet");
+ }
+ /*}}}*/
+ 
+@@ -3238,7 +3238,7 @@
+ 			/*Assign output pointers:*/
+ 			*presponse=vel;
+ 		default:  
+-			_error2_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
++			_error_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
+ 	}
+ 
+ }
+@@ -4313,7 +4313,7 @@
+ 		//if(values[i]<matpar->TMeltingPoint(pressure[i])-50) values[i]=matpar->TMeltingPoint(pressure[i])-50;
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+ 		//if(values[i]<0)      _printLine_("temperature < 0°K found in solution vector");
+ 		//if(values[i]>275)    _printLine_("temperature > 275°K found in solution vector (Paterson's rheology associated is negative)");
+ 	}
+@@ -4347,7 +4347,7 @@
+ 				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
+ 				break;
+ 			default:
+-				_error2_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
++				_error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
+ 
+ 		}
+ 	}
+@@ -4383,7 +4383,7 @@
+ 		values[i]=solution[doflist[i]];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Get all inputs and parameters*/
+@@ -4396,8 +4396,8 @@
+ 		/*Convert enthalpy into temperature and water fraction*/
+ 		for(i=0;i<numdof;i++){
+ 			matpar->EnthalpyToThermal(&temperatures[i],&waterfraction[i],values[i],pressure[i]);
+-			if(waterfraction[i]<0) _error2_("Negative water fraction found in solution vector");
+-			//if(waterfraction[i]>1) _error2_("Water fraction >1 found in solution vector");
++			if(waterfraction[i]<0) _error_("Negative water fraction found in solution vector");
++			//if(waterfraction[i]>1) _error_("Water fraction >1 found in solution vector");
+ 		}
+ 			
+ 		this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,values));
+@@ -4425,7 +4425,7 @@
+ 				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
+ 				break;
+ 			default:
+-				_error2_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
++				_error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
+ 
+ 		}
+ 	}
+@@ -4453,8 +4453,8 @@
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+ 	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++	if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found");
++	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+ 
+ 	GradientIndexing(&doflist1[0],control_index);
+ 	((ControlInput*)input)->GetGradient(gradient,&doflist1[0]);
+@@ -4471,8 +4471,8 @@
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+ 	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++	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);
+ }/*}}}*/
+@@ -4490,8 +4490,8 @@
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+ 	}
+-	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
++	if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found");
++	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+ 
+ 	GradientIndexing(&doflist1[0],control_index);
+ 	for(int i=0;i<NUMVERTICES;i++) grad_list[i]=gradient[doflist1[i]];
+@@ -4515,7 +4515,7 @@
+ 		case NoneApproximationEnum:
+ 			return NULL;
+ 		default:
+-			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
++			_error_("Approximation " << EnumToStringx(approximation) << " not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -4705,7 +4705,7 @@
+ 		case StokesApproximationEnum:
+ 			return CreatePVectorAdjointStokes();
+ 		default:
+-			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
++			_error_("Approximation " << EnumToStringx(approximation) << " not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -4794,7 +4794,7 @@
+ 					/*Gradient is 0*/
+ 					break;
+ 				default:
+-					_error2_("approximation " << EnumToStringx(approximation) << " not supported yet");
++					_error_("approximation " << EnumToStringx(approximation) << " not supported yet");
+ 			}
+ 			break;
+ 
+@@ -4814,12 +4814,12 @@
+ 					/*Gradient is 0*/
+ 					break;
+ 				default:
+-					_error2_("approximation " << EnumToStringx(approximation) << " not supported yet");
++					_error_("approximation " << EnumToStringx(approximation) << " not supported yet");
+ 			}
+ 			break;
+ 
+ 		default:
+-			_error2_("control type " << EnumToStringx(control_type) << " not supported yet: ");
++			_error_("control type " << EnumToStringx(control_type) << " not supported yet: ");
+ 	}
+ 
+ 	/*Now deal with ∂J/∂alpha*/
+@@ -4851,7 +4851,7 @@
+ 			delete tria->matice; delete tria;
+ 			break;
+ 		default:
+-			_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++			_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+ 	}
+ 	xDelete<int>(responses);
+ }
+@@ -5105,7 +5105,7 @@
+ 			input=(Input*)this->inputs->GetInput(control_type[i]); _assert_(input);
+ 		}
+ 
+-		if (input->ObjectEnum()!=ControlInputEnum) _error2_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");
++		if (input->ObjectEnum()!=ControlInputEnum) _error_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");
+ 
+ 		((ControlInput*)input)->UpdateValue(scalar);
+ 		((ControlInput*)input)->Constrain();
+@@ -5148,10 +5148,10 @@
+ 		lambdap[i]=values[i*NDOF4+3];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(lambdax[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(lambday[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(lambdaz[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(lambdap[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambdax[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambday[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambdaz[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambdap[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Add vx and vy as inputs to the tria element: */
+@@ -5187,8 +5187,8 @@
+ 		lambday[i]=values[i*NDOF2+1];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(lambdax[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(lambday[i]))       _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambdax[i]))       _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(lambday[i]))       _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Add vx and vy as inputs to the tria element: */
+@@ -5389,7 +5389,7 @@
+ /*FUNCTION Penta::ThicknessAbsGradient{{{*/
+ IssmDouble Penta::ThicknessAbsGradient(bool process_units,int weight_index){
+ 
+-	_error2_("Not implemented yet");
++	_error_("Not implemented yet");
+ }
+ /*}}}*/
+ /*FUNCTION Penta::ThicknessAbsMisfit {{{*/
+@@ -5404,7 +5404,7 @@
+ 
+ 	/*If on water, return 0: */
+ 	if(IsOnWater())return 0;
+-	_error2_("Not implemented yet");
++	_error_("Not implemented yet");
+ 
+ 	tria=(Tria*)SpawnTria(0,1,2);
+ 	J=tria->ThicknessAbsMisfit(process_units,weight_index);
+@@ -5455,11 +5455,11 @@
+ 
+ 	/*Get input (either in element or material)*/
+ 	Input* input=inputs->GetInput(control_enum);
+-	if(!input) _error2_("Input " << EnumToStringx(control_enum) << " not found in element");
++	if(!input) _error_("Input " << EnumToStringx(control_enum) << " not found in element");
+ 
+ 	/*Check that it is a ControlInput*/
+ 	if (input->ObjectEnum()!=ControlInputEnum){
+-		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
++		_error_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
+ 	}
+ 
+ 	((ControlInput*)input)->GetVectorFromInputs(vector,&doflist1[0],data);
+@@ -5494,7 +5494,7 @@
+ 	}
+ 
+ 	if (input->ObjectEnum()!=ControlInputEnum){
+-		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
++		_error_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
+ 	}
+ 
+ 	((ControlInput*)input)->SetInput(new_input);
+@@ -5600,19 +5600,19 @@
+ 			break;
+ 
+ 		default:
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ 
+ }
+ /*}}}*/
+ /*FUNCTION Penta::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/
+ void  Penta::InputUpdateFromVectorDakota(int* vector, int name, int type){
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Penta::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/
+ void  Penta::InputUpdateFromVectorDakota(bool* vector, int name, int type){
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Penta::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type);{{{*/
+@@ -5655,7 +5655,7 @@
+ 			break;
+ 
+ 		default:
+-			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ 
+ }
+@@ -6214,7 +6214,7 @@
+ 		case PattynStokesApproximationEnum:
+ 			return CreateKMatrixDiagnosticPattynStokes();
+ 		default:
+-			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
++			_error_("Approximation " << EnumToStringx(approximation) << " not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -6382,7 +6382,7 @@
+ 			this->GetStrainRate3d(&epsilons[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+ 			matice->GetViscosity3dStokes(&newviscosity,&epsilons[0]);
+ 		}
+-		else _error2_("approximation " << approximation << " (" << EnumToStringx(approximation) << ") not supported yet");
++		else _error_("approximation " << approximation << " (" << EnumToStringx(approximation) << ") not supported yet");
+ 
+ 		D_scalar=2*newviscosity*gauss->weight*Jdet;
+ 		for (i=0;i<3;i++) D[i][i]=D_scalar;
+@@ -7205,7 +7205,7 @@
+ 		case PattynStokesApproximationEnum:
+ 			return CreatePVectorDiagnosticPattynStokes();
+ 		default:
+-			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
++			_error_("Approximation " << EnumToStringx(approximation) << " not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -7718,7 +7718,7 @@
+ 		case NoneApproximationEnum:
+ 			return NULL;
+ 		default:
+-			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
++			_error_("Approximation " << EnumToStringx(approximation) << " not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -8113,8 +8113,8 @@
+ 		vy[i+3]=vy[i];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Get parameters fro pressure computation*/
+@@ -8211,8 +8211,8 @@
+ 		vy[i]=macayeal_values[i*NDOF2+1]+pattyn_values[i*NDOF2+1];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Now Compute vel*/
+@@ -8299,22 +8299,22 @@
+ 		pressure[i]=stokes_values[i*NDOF4+3]*stokesreconditioning;
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vzstokes[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(pressure[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vx[i]))       _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i]))       _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vzstokes[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(pressure[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Get Vz*/
+ 	Input* vzmacayeal_input=inputs->GetInput(VzMacAyealEnum);
+ 	if (vzmacayeal_input){
+ 		if (vzmacayeal_input->ObjectEnum()!=PentaP1InputEnum){
+-			_error2_("Cannot compute Vel as VzMacAyeal is of type " << EnumToStringx(vzmacayeal_input->ObjectEnum()));
++			_error_("Cannot compute Vel as VzMacAyeal is of type " << EnumToStringx(vzmacayeal_input->ObjectEnum()));
+ 		}
+ 		GetInputListOnVertices(&vzmacayeal[0],VzMacAyealEnum);
+ 	}
+ 	else{
+-		_error2_("Cannot update solution as VzMacAyeal is not present");
++		_error_("Cannot update solution as VzMacAyeal is not present");
+ 	}
+ 
+ 	/*Now Compute vel*/
+@@ -8378,8 +8378,8 @@
+ 		vy[i]=values[i*NDOF2+1];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Get Vz*/
+@@ -8467,22 +8467,22 @@
+ 		pressure[i]=stokes_values[i*NDOF4+3]*stokesreconditioning;
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vzstokes[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(pressure[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vx[i]))       _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i]))       _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vzstokes[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(pressure[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Get Vz*/
+ 	Input* vzpattyn_input=inputs->GetInput(VzPattynEnum);
+ 	if (vzpattyn_input){
+ 		if (vzpattyn_input->ObjectEnum()!=PentaP1InputEnum){
+-			_error2_("Cannot compute Vel as VzPattyn is of type " << EnumToStringx(vzpattyn_input->ObjectEnum()));
++			_error_("Cannot compute Vel as VzPattyn is of type " << EnumToStringx(vzpattyn_input->ObjectEnum()));
+ 		}
+ 		GetInputListOnVertices(&vzpattyn[0],VzPattynEnum);
+ 	}
+ 	else{
+-		_error2_("Cannot update solution as VzPattyn is not present");
++		_error_("Cannot update solution as VzPattyn is not present");
+ 	}
+ 
+ 	/*Now Compute vel*/
+@@ -8543,8 +8543,8 @@
+ 		vy[i]=values[i*NDOF2+1];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Now Compute vel*/
+@@ -8612,7 +8612,7 @@
+ 		vz[i]=values[i*NDOF1+0];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vz[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vz[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Get Vx and Vy*/
+@@ -8623,10 +8623,10 @@
+ 	if(approximation==PattynStokesApproximationEnum){
+ 		Input* vzstokes_input=inputs->GetInput(VzStokesEnum);
+ 		if (vzstokes_input){
+-			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error2_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));
++			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));
+ 			GetInputListOnVertices(&vzstokes[0],VzStokesEnum);
+ 		}
+-		else _error2_("Cannot compute Vz as VzStokes in not present in PattynStokes element");
++		else _error_("Cannot compute Vz as VzStokes in not present in PattynStokes element");
+ 		for(i=0;i<NUMVERTICES;i++){
+ 			vzpattyn[i]=vz[i];
+ 			vz[i]=vzpattyn[i]+vzstokes[i];
+@@ -8635,10 +8635,10 @@
+ 	else if(approximation==MacAyealStokesApproximationEnum){
+ 		Input* vzstokes_input=inputs->GetInput(VzStokesEnum);
+ 		if (vzstokes_input){
+-			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error2_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));
++			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));
+ 			GetInputListOnVertices(&vzstokes[0],VzStokesEnum);
+ 		}
+-		else _error2_("Cannot compute Vz as VzStokes in not present in MacAyealStokes element");
++		else _error_("Cannot compute Vz as VzStokes in not present in MacAyealStokes element");
+ 		for(i=0;i<NUMVERTICES;i++){
+ 			vzmacayeal[i]=vz[i];
+ 			vz[i]=vzmacayeal[i]+vzstokes[i];
+@@ -8710,10 +8710,10 @@
+ 		pressure[i]=values[i*NDOF4+3];
+ 
+ 		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(vz[i]))       _error2_("NaN found in solution vector");
+-		if(xIsNan<IssmDouble>(pressure[i])) _error2_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vx[i]))       _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i]))       _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vz[i]))       _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(pressure[i])) _error_("NaN found in solution vector");
+ 	}
+ 
+ 	/*Recondition pressure and compute vel: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaRef.h	(revision 13036)
+@@ -55,9 +55,9 @@
+ 		void GetLStokesMacAyeal(IssmDouble* LStokesMacAyeal, GaussPenta* gauss);
+ 		void GetLprimeStokesMacAyeal(IssmDouble* LprimeStokesMacAyeal, IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,IssmDouble* plist, GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,IssmDouble* plist,GaussTria* gauss){_error2_("only PentaGauss are supported");};
++		void GetInputValue(IssmDouble* pvalue,IssmDouble* plist,GaussTria* gauss){_error_("only PentaGauss are supported");};
+ 		void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss){_error2_("only PentaGauss are supported");};
++		void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss){_error_("only PentaGauss are supported");};
+ 
+ };
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 13036)
+@@ -161,8 +161,8 @@
+ 		IssmDouble SurfaceLogVxVyMisfit(   bool process_units,int weight_index);
+ 		IssmDouble SurfaceAverageVelMisfit(bool process_units,int weight_index);
+ 		IssmDouble ThicknessAbsGradient(bool process_units,int weight_index);
+-		IssmDouble ThicknessAlongGradient( bool process_units,int weight_index){_error2_("not supported");};
+-		IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index){_error2_("not supported");};
++		IssmDouble ThicknessAlongGradient( bool process_units,int weight_index){_error_("not supported");};
++		IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index){_error_("not supported");};
+ 		void   InputControlUpdate(IssmDouble scalar,bool save_parameter);
+ 		#endif
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp	(revision 13036)
+@@ -337,7 +337,7 @@
+ 	y2=*(xyz_list+3*1+1);
+ 
+ 	*Jdet=1.0/2.0*sqrt(pow(x2-x1,2.) + pow(y2-y1,2.));
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
++	if(*Jdet<0) _error_("negative jacobian determinant!");
+ 
+ }
+ /*}}}*/
+@@ -352,7 +352,7 @@
+ 
+ 	/*Get Determinant*/
+ 	Matrix2x2Determinant(Jdet,&J[0][0]);
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
++	if(*Jdet<0) _error_("negative jacobian determinant!");
+ 
+ }
+ /*}}}*/
+@@ -374,7 +374,7 @@
+ 	z3=*(xyz_list+3*2+2);
+ 
+ 	*Jdet=SQRT3/6.0*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2.0)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2.0)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2.0),0.5);
+-	if(*Jdet<0) _error2_("negative jacobian determinant!");
++	if(*Jdet<0) _error_("negative jacobian determinant!");
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp	(revision 13036)
+@@ -38,7 +38,7 @@
+ 	if(options->GetOption("range"))  options->Get(&this->range,"range");
+ 
+ 	/*Checks*/
+-	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
++	if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+ }
+ /*}}}*/
+ /*FUNCTION ExponentialVariogram::~ExponentialVariogram(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.h	(revision 13036)
+@@ -26,11 +26,11 @@
+ 
+ 				/*Object functions (Needed because the Quadtree uses a Container*/
+ 				void    Echo();
+-				void    DeepEcho()  {_error2_("not implemented yet"); };
+-				int     Id()        {_error2_("not implemented yet"); };
+-				int     MyRank()    {_error2_("not implemented yet"); };
+-				int     ObjectEnum(){_error2_("not implemented yet"); };
+-				Object *copy()      {_error2_("not implemented yet"); };
++				void    DeepEcho()  {_error_("not implemented yet"); };
++				int     Id()        {_error_("not implemented yet"); };
++				int     MyRank()    {_error_("not implemented yet"); };
++				int     ObjectEnum(){_error_("not implemented yet"); };
++				Object *copy()      {_error_("not implemented yet"); };
+ 
+ 				/*Methods*/
+ 				int          IsWithinRange(double  x,double y,double range);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Observation.h	(revision 13036)
+@@ -23,11 +23,11 @@
+ 
+ 		/*Object virtual functions definitions*/
+ 		void    Echo();
+-		void    DeepEcho()  {_error2_("Not implemented yet"); };
+-		int     Id()        {_error2_("Not implemented yet"); };
+-		int     MyRank()    {_error2_("Not implemented yet"); };
+-		int     ObjectEnum(){_error2_("Not implemented yet"); };
+-		Object *copy()      {_error2_("Not implemented yet"); };
++		void    DeepEcho()  {_error_("Not implemented yet"); };
++		int     Id()        {_error_("Not implemented yet"); };
++		int     MyRank()    {_error_("Not implemented yet"); };
++		int     ObjectEnum(){_error_("Not implemented yet"); };
++		Object *copy()      {_error_("Not implemented yet"); };
+ 
+ 		/*Management*/
+ 		void WriteXYObs(double* px,double* py,double* pobs);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp	(revision 13036)
+@@ -38,7 +38,7 @@
+ 	if(options->GetOption("range"))  options->Get(&this->range,"range");
+ 
+ 	/*Checks*/
+-	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
++	if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+ }
+ /*}}}*/
+ /*FUNCTION GaussianVariogram::~GaussianVariogram(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp	(revision 13036)
+@@ -38,7 +38,7 @@
+ 	if(options->GetOption("range"))  options->Get(&this->range,"range");
+ 
+ 	/*Checks*/
+-	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
++	if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+ }
+ /*}}}*/
+ /*FUNCTION SphericalVariogram::~SphericalVariogram(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h	(revision 13036)
+@@ -22,11 +22,11 @@
+ 
+ 		/*Object virtual functions definitions*/
+ 		void  Echo();
+-		void  DeepEcho(){_error2_("Not implemented yet");};
+-		int   Id(){_error2_("Not implemented yet");}; 
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){_error2_("Not implemented yet");};
+-		Object* copy(){_error2_("Not implemented yet");};
++		void  DeepEcho(){_error_("Not implemented yet");};
++		int   Id(){_error_("Not implemented yet");}; 
++		int   MyRank(){_error_("Not implemented yet");};
++		int   ObjectEnum(){_error_("Not implemented yet");};
++		Object* copy(){_error_("Not implemented yet");};
+ 
+ 		/*Variogram functions*/
+ 		double SemiVariogram(double deltax,double deltay);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp	(revision 13036)
+@@ -38,8 +38,8 @@
+ 	if(options->GetOption("power"))  options->Get(&this->power,"power");
+ 
+ 	/*Checks*/
+-	if(power<=0 || power>=2) _error2_("power must be betwwen 0 and 2 (0 < power < 2)");
+-	if(slope<=0) _error2_("slope must be positive");
++	if(power<=0 || power>=2) _error_("power must be betwwen 0 and 2 (0 < power < 2)");
++	if(slope<=0) _error_("slope must be positive");
+ }
+ /*}}}*/
+ /*FUNCTION PowerVariogram::~PowerVariogram(){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h	(revision 13036)
+@@ -23,11 +23,11 @@
+ 
+ 		/*Object virtual functions definitions*/
+ 		void  Echo();
+-		void  DeepEcho(){_error2_("Not implemented yet");};
+-		int   Id(){_error2_("Not implemented yet");}; 
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){_error2_("Not implemented yet");};
+-		Object* copy(){_error2_("Not implemented yet");};
++		void  DeepEcho(){_error_("Not implemented yet");};
++		int   Id(){_error_("Not implemented yet");}; 
++		int   MyRank(){_error_("Not implemented yet");};
++		int   ObjectEnum(){_error_("Not implemented yet");};
++		Object* copy(){_error_("Not implemented yet");};
+ 
+ 		/*Variogram functions*/
+ 		double SemiVariogram(double deltax,double deltay);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h	(revision 13036)
+@@ -22,11 +22,11 @@
+ 
+ 		/*Object virtual functions definitions*/
+ 		void  Echo();
+-		void  DeepEcho(){_error2_("Not implemented yet");};
+-		int   Id(){_error2_("Not implemented yet");}; 
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){_error2_("Not implemented yet");};
+-		Object* copy(){_error2_("Not implemented yet");};
++		void  DeepEcho(){_error_("Not implemented yet");};
++		int   Id(){_error_("Not implemented yet");}; 
++		int   MyRank(){_error_("Not implemented yet");};
++		int   ObjectEnum(){_error_("Not implemented yet");};
++		Object* copy(){_error_("Not implemented yet");};
+ 
+ 		/*Variogram functions*/
+ 		double SemiVariogram(double deltax,double deltay);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/PowerVariogram.h	(revision 13036)
+@@ -22,11 +22,11 @@
+ 
+ 		/*Object virtual functions definitions*/
+ 		void  Echo();
+-		void  DeepEcho(){_error2_("Not implemented yet");};
+-		int   Id(){_error2_("Not implemented yet");}; 
+-		int   MyRank(){_error2_("Not implemented yet");};
+-		int   ObjectEnum(){_error2_("Not implemented yet");};
+-		Object* copy(){_error2_("Not implemented yet");};
++		void  DeepEcho(){_error_("Not implemented yet");};
++		int   Id(){_error_("Not implemented yet");}; 
++		int   MyRank(){_error_("Not implemented yet");};
++		int   ObjectEnum(){_error_("Not implemented yet");};
++		Object* copy(){_error_("Not implemented yet");};
+ 
+ 		/*Variogram functions*/
+ 		double SemiVariogram(double deltax,double deltay);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/kriging/Quadtree.cpp	(revision 13036)
+@@ -82,7 +82,7 @@
+ 	/*Constructors/Destructors*/
+ /*FUNCTION Quadtree::Quadtree(){{{*/
+ Quadtree::Quadtree(){
+-	_error2_("Constructor not supported");
++	_error_("Constructor not supported");
+ 
+ }
+ /*}}}*/
+@@ -247,7 +247,7 @@
+ 		box->obs[index]->weight += 1;
+ 	}
+ 	else{
+-		_error2_("Box is not full");
++		_error_("Box is not full");
+ 	}
+ }/*}}}*/
+ /*FUNCTION Quadtree::ClosestObs{{{*/
+@@ -396,7 +396,7 @@
+ 			newbox->ycenter=master->ycenter + master->length/4;
+ 			break;
+ 		default:
+-			_error2_("Case " << index << " not supported");
++			_error_("Case " << index << " not supported");
+ 	}
+ 	newbox->length=master->length/2;
+ 
+@@ -573,7 +573,7 @@
+ 			}
+ 			break;
+ 		default:
+-			_error2_("Case " << this->IsWithinRange(x,y,range) << " not supported");
++			_error_("Case " << this->IsWithinRange(x,y,range) << " not supported");
+ 	}
+ 
+ 	/*Assign output pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 13036)
+@@ -46,7 +46,7 @@
+ /*FUNCTION ElementMatrix::ElementMatrix(ElementMatrix* Ke){{{*/
+ ElementMatrix::ElementMatrix(ElementMatrix* Ke){
+ 
+-	if(!Ke) _error2_("Input Element Matrix is a NULL pointer");
++	if(!Ke) _error_("Input Element Matrix is a NULL pointer");
+ 	this->Init(Ke);
+ 	return;
+ }
+@@ -62,7 +62,7 @@
+ 
+ 	/*If one of the two matrix is NULL, we copy the other one*/
+ 	if(!Ke1 && !Ke2){
+-		_error2_("Two input element matrices are NULL");
++		_error_("Two input element matrices are NULL");
+ 	}
+ 	else if(!Ke1){
+ 		this->Init(Ke2);
+@@ -74,7 +74,7 @@
+ 	}
+ 
+ 	/*General Case: Ke1 and Ke2 are not empty*/
+-	if(!Ke1->dofsymmetrical || !Ke2->dofsymmetrical) _error2_("merging 2 non dofsymmetrical matrices not implemented yet");
++	if(!Ke1->dofsymmetrical || !Ke2->dofsymmetrical) _error_("merging 2 non dofsymmetrical matrices not implemented yet");
+ 
+ 	/*Initialize itransformation matrix Ke[P[i]] = Ke2[i]*/
+ 	P=xNew<int>(Ke2->nrows);
+@@ -294,7 +294,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
++		_error_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
+ 	}
+ 
+ }
+@@ -331,7 +331,7 @@
+ 
+ 	}
+ 	else{
+-		_error2_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
++		_error_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
+ 	}
+ 
+ }
+@@ -342,8 +342,8 @@
+ 	#ifdef _ISSM_DEBUG_ 
+ 	for (int i=0;i<this->nrows;i++){
+ 		for(int j=0;j<this->ncols;j++){
+-			if (xIsNan<IssmDouble>(this->values[i*this->ncols+j])) _error2_("NaN found in Element Matrix");
+-			if (fabs(this->values[i*this->ncols+j])>1.e+50) _error2_("Element Matrix values exceeds 1.e+50");
++			if (xIsNan<IssmDouble>(this->values[i*this->ncols+j])) _error_("NaN found in Element Matrix");
++			if (fabs(this->values[i*this->ncols+j])>1.e+50) _error_("Element Matrix values exceeds 1.e+50");
+ 		}
+ 	}
+ 	#endif
+@@ -364,7 +364,7 @@
+ 
+ 	/*Transpose indices*/
+ 	if(!dofsymmetrical){
+-		_error2_("not supported yet");
++		_error_("not supported yet");
+ 	}
+ 
+ 	/*Clean up and return*/
+@@ -487,7 +487,7 @@
+ 
+ 	int i;
+ 
+-	if(this->nrows!=this->ncols)_error2_("need square matrix in input!");
++	if(this->nrows!=this->ncols)_error_("need square matrix in input!");
+ 
+ 	for(i=0;i<this->nrows;i++){
+ 		this->values[this->ncols*i+i]=scalar;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 13036)
+@@ -50,13 +50,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector=new PetscVec(M,fromlocalsize);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector=new SeqVec(M,fromlocalsize);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -85,13 +85,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector=new PetscVec(serial_vec,M);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector=new SeqVec(serial_vec,M);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -102,13 +102,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		delete this->pvector;
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		delete this->svector;
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ }
+ /*}}}*/
+ 
+@@ -120,13 +120,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->Echo();
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->Echo();
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -137,13 +137,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->Assemble();
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->Assemble();
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -155,13 +155,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->SetValues(ssize,list,values,mode);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->SetValues(ssize,list,values,mode);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ 		
+ 
+@@ -174,13 +174,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->SetValue(dof,value,mode);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->SetValue(dof,value,mode);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -192,13 +192,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->GetValue(pvalue,dof);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->GetValue(pvalue,dof);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -209,13 +209,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->GetSize(pM);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->GetSize(pM);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -240,13 +240,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->GetLocalSize(pM);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->GetLocalSize(pM);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -261,14 +261,14 @@
+ 		output=new Vector();
+ 		output->pvector=this->pvector->Duplicate();
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		output=new Vector();
+ 		output->svector=this->svector->Duplicate();
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ 	return output;
+ 
+@@ -282,13 +282,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->Set(value);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->Set(value);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -300,13 +300,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->AXPY(X->pvector,a);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->AXPY(X->svector,a);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -318,13 +318,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->AYPX(X->pvector,a);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->AYPX(X->svector,a);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ 
+ }
+@@ -338,13 +338,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		vec_serial=this->pvector->ToMPISerial();
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		vec_serial=this->svector->ToMPISerial();
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ 	return vec_serial;
+ 
+@@ -358,13 +358,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->Copy(to->pvector);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->Copy(to->svector);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ 
+ }
+@@ -378,13 +378,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		norm=this->pvector->Norm(norm_type);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		norm=this->svector->Norm(norm_type);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ 	return norm;
+ }
+@@ -397,13 +397,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->Scale(scale_factor);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->Scale(scale_factor);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -416,13 +416,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		dot=this->pvector->Dot(vector->pvector);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		dot=this->svector->Dot(vector->svector);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ 	return dot;
+ }
+@@ -435,13 +435,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pvector->PointwiseDivide(x->pvector,y->pvector);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqVecType){
+ 		this->svector->PointwiseDivide(x->svector,y->svector);
+ 	}
+-	else _error2_("Vector type: " << type << " not supported yet!");
++	else _error_("Vector type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 13036)
+@@ -50,13 +50,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix=new PetscMat(M,N);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+ 		this->smatrix=new SeqMat(M,N);
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -73,13 +73,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix=new PetscMat(M,N,sparsity);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+ 		this->smatrix=new SeqMat(M,N,sparsity);
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int type){{{*/
+@@ -95,13 +95,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix=new PetscMat(serial_mat,M,N,sparsity);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+ 		this->smatrix=new SeqMat(serial_mat,M,N,sparsity);
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 	
+ }
+ /*}}}*/
+@@ -118,13 +118,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		this->pmatrix=new PetscMat(M,N,connectivity,numberofdofspernode);
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+ 		this->smatrix=new SeqMat(M,N,connectivity,numberofdofspernode);
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 	
+ }
+ /*}}}*/
+@@ -135,13 +135,13 @@
+ 		#ifdef _HAVE_PETSC_
+ 		delete this->pmatrix;
+ 		#else
+-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
++		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+ 		#endif
+ 	}
+ 	else if(type==SeqMatType){
+ 		delete this->smatrix;
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -158,7 +158,7 @@
+ 	else if(type==SeqMatType){
+ 		this->smatrix->Echo();
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -174,7 +174,7 @@
+ 		this->smatrix->Assemble();
+ 	}
+ 	else{
+-		_error2_("Matrix type: " << type << " not supported yet!");
++		_error_("Matrix type: " << type << " not supported yet!");
+ 	}
+ }
+ /*}}}*/
+@@ -191,7 +191,7 @@
+ 	else if(type==SeqMatType){
+ 		norm=this->smatrix->Norm(norm_type);
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 
+ 	return norm;
+ }
+@@ -207,7 +207,7 @@
+ 	else if(type==SeqMatType){
+ 		this->smatrix->GetSize(pM,pN);
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 	
+ }
+ /*}}}*/
+@@ -222,7 +222,7 @@
+ 	else if(type==SeqMatType){
+ 		this->smatrix->GetLocalSize(pM,pN);
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -237,7 +237,7 @@
+ 	else if(type==SeqMatType){
+ 		this->smatrix->MatMult(X->svector,AX->svector);
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -256,7 +256,7 @@
+ 	else if(type==SeqMatType){
+ 		output->smatrix=this->smatrix->Duplicate();
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 	
+ 	return output;
+ }
+@@ -274,7 +274,7 @@
+ 	else if(type==SeqMatType){
+ 		output=this->smatrix->ToSerial();
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ 
+ 
+ 	return output;
+@@ -291,7 +291,7 @@
+ 	else if(type==SeqMatType){
+ 		this->smatrix->SetValues(m,idxm,n,idxn,values,mode);
+ 	}
+-	else _error2_("Matrix type: " << type << " not supported yet!");
++	else _error_("Matrix type: " << type << " not supported yet!");
+ }
+ /*}}}*/
+ /*FUNCTION Matrix::Convert{{{*/
+@@ -306,7 +306,7 @@
+ 		this->smatrix->Convert(newtype);
+ 	}
+ 	else{
+-		_error2_("Matrix type: " << type << " not supported yet!");
++		_error_("Matrix type: " << type << " not supported yet!");
+ 	}
+ 
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 13036)
+@@ -41,7 +41,7 @@
+ 
+ 	/*If one of the two matrix is NULL, we copy the other one*/
+ 	if(!pe1 && !pe2){
+-		_error2_("Two input element matrices are NULL");
++		_error_("Two input element matrices are NULL");
+ 	}
+ 	else if(!pe1){
+ 		this->Init(pe2);
+@@ -209,8 +209,8 @@
+ 	/*Check element matrix values, only in debugging mode*/
+ #ifdef _ISSM_DEBUG_ 
+ 	for (int i=0;i<this->nrows;i++){
+-		if (xIsNan<IssmDouble>(this->values[i])) _error2_("NaN found in Element Vector");
+-		if (fabs( this->values[i])>1.e+50) _error2_("Element Vector values exceeds 1.e+50");
++		if (xIsNan<IssmDouble>(this->values[i])) _error_("NaN found in Element Vector");
++		if (fabs( this->values[i])>1.e+50) _error_("Element Vector values exceeds 1.e+50");
+ 	}
+ #endif
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.cpp	(revision 13036)
+@@ -37,7 +37,7 @@
+ 
+ 		// check Size
+ 		if (Size<=0){
+-			_error2_("Size<=0");
++			_error_("Size<=0");
+ 		}
+ 
+ 		Metric Mx,My;
+@@ -267,7 +267,7 @@
+ 			while (t->det <0) { // intersection boundary edge and a,b,
+ 				k=(*t)(0) ?  ((  (*t)(1) ? ( (*t)(2) ? -1 : 2) : 1  )) : 0;
+ 				if (k<0){
+-					_error2_("k<0");
++					_error_("k<0");
+ 				}
+ 				ocut = OppositeEdge[k];
+ 				i=VerticesOfTriangularEdge[ocut][0];
+@@ -311,7 +311,7 @@
+ 				j=VerticesOfTriangularEdge[iedge][1];
+ 				double dij = detj-deti;
+ 				if (i+j+k != 0 + 1 +2){
+-					_error2_("i+j+k != 0 + 1 +2");
++					_error_("i+j+k != 0 + 1 +2");
+ 				}
+ 				ba[j] =  detj/dij;
+ 				ba[i] = -deti/dij;
+@@ -383,7 +383,7 @@
+ 						j= VerticesOfTriangularEdge[ocut][1];
+ 					}
+ 					else {
+-						_error2_("Bug Split Edge");
++						_error_("Bug Split Edge");
+ 					}
+ 				}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Triangle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Triangle.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Triangle.cpp	(revision 13036)
+@@ -18,10 +18,10 @@
+ 		BamgVertex *v=Th->vertices;
+ 		long nbv = Th->nbv;
+ 		if (i<0 || j<0 || k<0){
+-			_error2_("i<0 || j<0 || k<0");
++			_error_("i<0 || j<0 || k<0");
+ 		}
+ 		if (i>=nbv || j>=nbv || k>=nbv){
+-			_error2_("i>=nbv || j>=nbv || k>=nbv");
++			_error_("i>=nbv || j>=nbv || k>=nbv");
+ 		}
+ 		vertices[0]=v+i;
+ 		vertices[1]=v+j;
+@@ -172,7 +172,7 @@
+ 
+ 			//check number of iterations
+ 			if (k>=2000){
+-				_error2_("too many iteration in Triangle::FindBoundaryEdge (k>=2000)");
++				_error_("too many iteration in Triangle::FindBoundaryEdge (k>=2000)");
+ 			}
+ 		} while (this!= t);
+ 		//not found, return empty triangle
+@@ -212,7 +212,7 @@
+ 		jp = AdjEdgeIndex[jp]&3;
+ 		do {
+ 			while (t->swap(j,koption)){
+-				if (k>=20000) _error2_("k>=20000");
++				if (k>=20000) _error_("k>=20000");
+ 				NbSwap++;
+ 				k++;
+ 				t=  tp->adj[jp];      // set unchange t qnd j for previous triangles
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgQuadtree.h	(revision 13036)
+@@ -30,12 +30,12 @@
+ 						BamgVertex*  v[4];
+ 					};
+ 					/*Object functions*/
+-					void    Echo()       {_error2_("not implemented yet"); };
+-					void    DeepEcho()   {_error2_("not implemented yet"); };
+-					int     Id()         {_error2_("not implemented yet"); };
+-					int     MyRank()     {_error2_("not implemented yet"); };
+-					int     ObjectEnum() {_error2_("not implemented yet"); };
+-					Object *copy()       {_error2_("not implemented yet"); };
++					void    Echo()       {_error_("not implemented yet"); };
++					void    DeepEcho()   {_error_("not implemented yet"); };
++					int     Id()         {_error_("not implemented yet"); };
++					int     MyRank()     {_error_("not implemented yet"); };
++					int     ObjectEnum() {_error_("not implemented yet"); };
++					Object *copy()       {_error_("not implemented yet"); };
+ 			};
+ 
+ 			/*BamgQuadtree private Fields*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgOpts.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgOpts.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgOpts.cpp	(revision 13036)
+@@ -59,30 +59,30 @@
+ 
+ 	int i;
+ 
+-	if (this->anisomax<1) _error2_("'anisomax' option should be >=1");
+-	if (this->coeff==0) _error2_("'coeff' should be positive");
+-	if (this->errg<0) _error2_("'errg' option should be >0");
+-	if (this->gradation<1) _error2_("'gradation' option should be >=1");
+-	if (this->Hessiantype!=0  && this->Hessiantype!=1) _error2_("'Hessiantype' supported options are 0 and 1");
+-	if (this->maxnbv<3) _error2_("'maxnbv' option should be >3");
+-	if (this->maxsubdiv<=1) _error2_("'maxsubdiv' should be >1");
+-	if (this->Metrictype!=0   && this->Metrictype!=1 && this->Metrictype!=2) _error2_("'Metrictype' supported options are 0, 1 and 2");
+-	if (this->nbjacobi<=0) _error2_("'nbjacobi' option should be >0");
+-	if (this->nbsmooth<=0) _error2_("'nbsmooth' option should be >0");
++	if (this->anisomax<1) _error_("'anisomax' option should be >=1");
++	if (this->coeff==0) _error_("'coeff' should be positive");
++	if (this->errg<0) _error_("'errg' option should be >0");
++	if (this->gradation<1) _error_("'gradation' option should be >=1");
++	if (this->Hessiantype!=0  && this->Hessiantype!=1) _error_("'Hessiantype' supported options are 0 and 1");
++	if (this->maxnbv<3) _error_("'maxnbv' option should be >3");
++	if (this->maxsubdiv<=1) _error_("'maxsubdiv' should be >1");
++	if (this->Metrictype!=0   && this->Metrictype!=1 && this->Metrictype!=2) _error_("'Metrictype' supported options are 0, 1 and 2");
++	if (this->nbjacobi<=0) _error_("'nbjacobi' option should be >0");
++	if (this->nbsmooth<=0) _error_("'nbsmooth' option should be >0");
+ 
+-	if (this->Crack!=0  && this->Crack!=1) _error2_("'Crack' supported options are 0 and 1");
+-	if (this->KeepVertices!=0 && this->KeepVertices!=1) _error2_("'KeepVertices' supported options are 0 and 1");
+-	if (this->geometricalmetric!=0  && this->geometricalmetric!=1) _error2_("'geometricalmetric' supported options are 0 and 1");
++	if (this->Crack!=0  && this->Crack!=1) _error_("'Crack' supported options are 0 and 1");
++	if (this->KeepVertices!=0 && this->KeepVertices!=1) _error_("'KeepVertices' supported options are 0 and 1");
++	if (this->geometricalmetric!=0  && this->geometricalmetric!=1) _error_("'geometricalmetric' supported options are 0 and 1");
+ 
+-	if (this->hmin<=0) _error2_("'hmin' option should be >0");
+-	if (this->hmax<=0 || this->hmax<this->hmin) _error2_("'hmax' option should be between 0 and hmin=" << this->hmin);
+-	if (this->hminVertices && this->hminVerticesSize[1]!=1) _error2_("'hminVertices' should be a column");
+-	if (this->hmaxVertices && this->hmaxVerticesSize[1]!=1) _error2_("'hmaxVertices' should be a column");
+-	if (this->hVertices && this->hVerticesSize[1]!=1) _error2_("'hVertices' should be a column");
+-	if (this->metric && (this->metricSize[1]!=1 && this->metricSize[1]!=3)) _error2_("'metric' should have either 1 (iso) or 3 (aniso) columns.");
++	if (this->hmin<=0) _error_("'hmin' option should be >0");
++	if (this->hmax<=0 || this->hmax<this->hmin) _error_("'hmax' option should be between 0 and hmin=" << this->hmin);
++	if (this->hminVertices && this->hminVerticesSize[1]!=1) _error_("'hminVertices' should be a column");
++	if (this->hmaxVertices && this->hmaxVerticesSize[1]!=1) _error_("'hmaxVertices' should be a column");
++	if (this->hVertices && this->hVerticesSize[1]!=1) _error_("'hVertices' should be a column");
++	if (this->metric && (this->metricSize[1]!=1 && this->metricSize[1]!=3)) _error_("'metric' should have either 1 (iso) or 3 (aniso) columns.");
+ 	if (this->field){
+-		if (this->errSize[0]!=1 || this->errSize[1]!=this->fieldSize[1]) _error2_("'err' should be of size " << 1 << " x " << this->fieldSize[1]);
+-		for (i=0;i<this->fieldSize[1];i++) {if (this->err[i]<=0) _error2_("'err' option should be >0");};
++		if (this->errSize[0]!=1 || this->errSize[1]!=this->fieldSize[1]) _error_("'err' should be of size " << 1 << " x " << this->fieldSize[1]);
++		for (i=0;i<this->fieldSize[1];i++) {if (this->err[i]<=0) _error_("'err' option should be >0");};
+ 	}
+ 
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SubDomain.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SubDomain.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SubDomain.cpp	(revision 13036)
+@@ -15,11 +15,11 @@
+ 	void SubDomain::Set(const Mesh & Th ,long i,Mesh & ThNew){
+ 		*this = Th.subdomains[i];
+ 		if ( head-Th.triangles<0 || head-Th.triangles>=Th.nbt){
+-			_error2_("head-Th.triangles<0 || head-Th.triangles>=Th.nbt");
++			_error_("head-Th.triangles<0 || head-Th.triangles>=Th.nbt");
+ 		}
+ 		head = ThNew.triangles + Th.GetId(head) ; 
+ 		if (edge-Th.edges<0 || edge-Th.edges>=Th.nbe);{
+-			_error2_("edge-Th.edges<0 || edge-Th.edges>=Th.nbe");
++			_error_("edge-Th.edges<0 || edge-Th.edges>=Th.nbe");
+ 		}
+ 		edge = ThNew.edges+ Th.GetId(edge);
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Metric.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Metric.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Metric.cpp	(revision 13036)
+@@ -196,7 +196,7 @@
+ 		}
+ 		// warning for optimisation S is in [0:0.5] not in [0:1]
+ 		if (i>=512){
+-			_error2_("i>=512");
++			_error_("i>=512");
+ 		}
+ 		LastMetricInterpole.lab=l;
+ 		LastMetricInterpole.opt=i;
+@@ -344,7 +344,7 @@
+ 			}
+ 		}
+ 		if (r>1 || r<0){
+-			_error2_("r>1 || r<0");
++			_error_("r>1 || r<0");
+ 		}
+ 		return r ;
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp	(revision 13036)
+@@ -75,13 +75,13 @@
+ 		nbe    = bamggeom->EdgesSize[0];
+ 
+ 		//some checks
+-		if (bamggeom->Vertices==NULL) _error2_("the domain provided does not contain any vertex");
+-		if (bamggeom->Edges==NULL) _error2_("the domain provided does not contain any edge");
++		if (bamggeom->Vertices==NULL) _error_("the domain provided does not contain any vertex");
++		if (bamggeom->Edges==NULL) _error_("the domain provided does not contain any edge");
+ 
+ 		//Vertices
+ 		if (bamggeom->Vertices){
+ 			if(verbose>5) _printLine_("      processing Vertices");
+-			if (bamggeom->VerticesSize[1]!=3) _error2_("Vertices should have 3 columns");
++			if (bamggeom->VerticesSize[1]!=3) _error_("Vertices should have 3 columns");
+ 			vertices = new GeomVertex[nbv];
+ 			for (i=0;i<nbv;i++) {
+ 				vertices[i].r.x=(double)bamggeom->Vertices[i*3+0];
+@@ -114,10 +114,10 @@
+ 			 * coefIcoor = (2^30 -1)/D
+ 			 */
+ 			coefIcoor=(MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
+-			if(coefIcoor<=0) _error2_("coefIcoor should be positive");
++			if(coefIcoor<=0) _error_("coefIcoor should be positive");
+ 		}
+ 		else{
+-			_error2_("No BamgVertex provided");
++			_error_("No BamgVertex provided");
+ 		}
+ 
+ 		//Edges
+@@ -126,7 +126,7 @@
+ 			double* verticeslength=NULL;
+ 
+ 			if(verbose>5) _printLine_("      processing Edges");
+-			if (bamggeom->EdgesSize[1]!=3) _error2_("Edges should have 3 columns");
++			if (bamggeom->EdgesSize[1]!=3) _error_("Edges should have 3 columns");
+ 			edges = new GeomEdge[nbe];
+ 
+ 			//initialize verticeslength (sum of the lengths of the edges holding vertex)
+@@ -175,7 +175,7 @@
+ 			
+ 		}
+ 		else{
+-			_error2_("No edges provided");
++			_error_("No edges provided");
+ 		}
+ 
+ 		//hVertices
+@@ -205,7 +205,7 @@
+ 		//TangentAtEdges
+ 		if (bamggeom->TangentAtEdges){
+ 			if(verbose>5) _printString_("      processing TangentAtEdges");
+-			if (bamggeom->TangentAtEdgesSize[1]!=4) _error2_("TangentAtEdges should have 4 columns");
++			if (bamggeom->TangentAtEdgesSize[1]!=4) _error_("TangentAtEdges should have 4 columns");
+ 			int n,i,j,k;
+ 			R2 tg;
+ 
+@@ -215,8 +215,8 @@
+ 				j=(int)bamggeom->TangentAtEdges[k*4+1]-1; //for C indexing
+ 				tg.x=bamggeom->TangentAtEdges[k*4+2];
+ 				tg.y=bamggeom->TangentAtEdges[k*4+3];
+-				if (i<0 || i>=nbe) _error2_("TangentAtEdges first index exceeds matrix dimension");
+-				if (j!=0 && j!=1)  _error2_("TangentAtEdges second index should be 1 or 2 only");
++				if (i<0 || i>=nbe) _error_("TangentAtEdges first index exceeds matrix dimension");
++				if (j!=0 && j!=1)  _error_("TangentAtEdges second index should be 1 or 2 only");
+ 				edges[i].tg[j] = tg;
+ 			}
+ 		}
+@@ -224,11 +224,11 @@
+ 		//Corners
+ 		if(bamggeom->Corners){
+ 			if(verbose>5) _printString_("      processing Corners");
+-			if (bamggeom->CornersSize[1]!=1) _error2_("Corners should have 1 column");
++			if (bamggeom->CornersSize[1]!=1) _error_("Corners should have 1 column");
+ 			n=bamggeom->CornersSize[0];
+ 			for (i=0;i<n;i++) {     
+ 				j=(int)bamggeom->Corners[i]-1; //for C indexing
+-				if (j>nbv-1 || j<0) _error2_("Bad corner definition: should in [0 " << nbv << "]");
++				if (j>nbv-1 || j<0) _error_("Bad corner definition: should in [0 " << nbv << "]");
+ 				/*Required => at the same time SetRequired and SetCorner*/
+ 				vertices[j].SetCorner();
+ 				vertices[j].SetRequired();
+@@ -238,11 +238,11 @@
+ 		//RequiredVertices
+ 		if(bamggeom->RequiredVertices){
+ 			if(verbose>5) _printLine_("      processing RequiredVertices");
+-			if (bamggeom->RequiredVerticesSize[1]!=1) _error2_("RequiredVertices should have 1 column");
++			if (bamggeom->RequiredVerticesSize[1]!=1) _error_("RequiredVertices should have 1 column");
+ 			n=bamggeom->RequiredVerticesSize[0];
+ 			for (i=0;i<n;i++) {     
+ 				j=(int)bamggeom->RequiredVertices[i]-1; //for C indexing
+-				if (j>nbv-1 || j<0) _error2_("Bad RequiredVerticess  definition: should in [0 " << nbv << "]");
++				if (j>nbv-1 || j<0) _error_("Bad RequiredVerticess  definition: should in [0 " << nbv << "]");
+ 				vertices[j].SetRequired();
+ 			}
+ 		}
+@@ -250,11 +250,11 @@
+ 		//RequiredEdges
+ 		if(bamggeom->RequiredEdges){
+ 			if(verbose>5) _printLine_("      processing RequiredEdges");
+-			if (bamggeom->RequiredEdgesSize[1]!=1) _error2_("RequiredEdges should have 1 column");
++			if (bamggeom->RequiredEdgesSize[1]!=1) _error_("RequiredEdges should have 1 column");
+ 			n=bamggeom->RequiredEdgesSize[0];
+ 			for (i=0;i<n;i++) {     
+ 				j=(int)bamggeom->RequiredEdges[i]-1; //for C indexing
+-				if (j>nbe-1 || j<0) _error2_("Bad RequiredEdges definition: should in [0 " << nbe << "]");
++				if (j>nbe-1 || j<0) _error_("Bad RequiredEdges definition: should in [0 " << nbe << "]");
+ 				edges[j].SetRequired();  
+ 			}
+ 		}
+@@ -262,7 +262,7 @@
+ 		//SubDomain
+ 		if(bamggeom->SubDomains){
+ 			if(verbose>5) _printLine_("      processing SubDomains");
+-			if (bamggeom->SubDomainsSize[1]!=4) _error2_("SubDomains should have 4 columns");
++			if (bamggeom->SubDomainsSize[1]!=4) _error_("SubDomains should have 4 columns");
+ 			nbsubdomains=bamggeom->SubDomainsSize[0];
+ 			subdomains = new GeomSubDomain[nbsubdomains];
+ 			for (i=0;i<nbsubdomains;i++){
+@@ -270,8 +270,8 @@
+ 				i1=(int)bamggeom->SubDomains[i*4+1];
+ 				i2=(int)bamggeom->SubDomains[i*4+2];
+ 				i3=(int)bamggeom->SubDomains[i*4+3];
+-				if (i0!=2) _error2_("Bad Subdomain definition: first number should be 2 (for Edges)");
+-				if (i1>nbe || i1<=0) _error2_("Bad Subdomain definition: second number should in [1 " << nbe << "] (edge number)");
++				if (i0!=2) _error_("Bad Subdomain definition: first number should be 2 (for Edges)");
++				if (i1>nbe || i1<=0) _error_("Bad Subdomain definition: second number should in [1 " << nbe << "] (edge number)");
+ 				subdomains[i].edge=edges + (i1-1);
+ 				subdomains[i].direction = (int) i2;
+ 				subdomains[i].ReferenceNumber = i3;
+@@ -531,7 +531,7 @@
+ 				delete [] next_p;
+ 				delete [] head_v;
+ 				delete [] eangle;
+-				_error2_("two points of the geometry are very closed to each other (see reference numbers above)");
++				_error_("two points of the geometry are very closed to each other (see reference numbers above)");
+ 			}
+ 
+ 			/*Add vertices[i] to the quadtree*/
+@@ -609,7 +609,7 @@
+ 				delete [] next_p;
+ 				delete [] head_v;
+ 				delete [] eangle;
+-				_error2_("Length of edge " << i << " is 0");
++				_error_("Length of edge " << i << " is 0");
+ 			}
+ 			//compute angle in [-Pi Pi]
+ 			eangle[i] = atan2(v10.y,v10.x);
+@@ -703,7 +703,7 @@
+ 				long n1 = next_p[k++]; 
+ 				long i1 = n1/2 ,j1=n1%2;
+ 
+-				if( edges[i1].v[j1] != edges[i].v[j]) _error2_("Problem while processing edges: check the edge list");
++				if( edges[i1].v[j1] != edges[i].v[j]) _error_("Problem while processing edges: check the edge list");
+ 
+ 				edges[i1].Adj[j1] = edges + i;
+ 				edges[i1].AdjVertexIndex[j1] = j;
+@@ -830,10 +830,10 @@
+ 		s=save_s;
+ 		GeomEdge* on=e.GeomEdgeHook;
+ 		if (!on){
+-			_error2_("ProjectOnCurve error message: edge provided should be on geometry");
++			_error_("ProjectOnCurve error message: edge provided should be on geometry");
+ 		}
+ 		if (!e[0].GeomEdgeHook ||  !e[1].GeomEdgeHook){
+-			_error2_("ProjectOnCurve error message: at least one of the vertex of the edge provided is not on geometry");
++			_error_("ProjectOnCurve error message: at least one of the vertex of the edge provided is not on geometry");
+ 		}
+ 
+ 		//Get the two vertices of the edge
+@@ -874,7 +874,7 @@
+ 					_printLine_(" 1)  a mesh edge  containing more than " << mxe/2 << " geometrical edges");
+ 					_printLine_(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before");
+ 					_printLine_("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)");
+-					_error2_("see above");
++					_error_("see above");
+ 				}
+ 				NbTry++;
+ 				goto retry;
+@@ -894,7 +894,7 @@
+ 				_printLine_(" 1)  a mesh edge  contening more than " << mxe/2 << " geometrical edges");
+ 				_printLine_(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before");
+ 				_printLine_("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)");
+-				_error2_("see above");
++				_error_("see above");
+ 			}
+ 			GeomEdge* tmpge = eg1;
+ 			ge[++tge] =eg1 = eg1->Adj[direction1];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgVertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgVertex.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/BamgVertex.cpp	(revision 13036)
+@@ -75,7 +75,7 @@
+ 			ci= 2.0/9.0 * 1/(err*coef*coef) * 1/(smax-smin);
+ 		}
+ 		else{
+-			_error2_("Metrictype " << Metrictype << " not supported yet (use 0,1 or 2(default))");
++			_error_("Metrictype " << Metrictype << " not supported yet (use 0,1 or 2(default))");
+ 		}
+ 
+ 		//initialize metric Miv with ci*H
+@@ -145,7 +145,7 @@
+ 			tria = ttc;
+ 			j = NextEdge[jc];
+ 			if (k>=2000){
+-				_error2_("k>=2000 (Maximum number of iterations reached)");
++				_error_("k>=2000 (Maximum number of iterations reached)");
+ 			}
+ 		} while ( tbegin != tria); 
+ 		if (kk<4) return 0;
+@@ -212,7 +212,7 @@
+ 				tria = ttc;
+ 				j = NextEdge[jc];
+ 				if (k>=2000){
+-					_error2_("k>=2000");
++					_error_("k>=2000");
+ 				}
+ 			}while ( tbegin != tria); 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Edge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Edge.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Edge.cpp	(revision 13036)
+@@ -44,7 +44,7 @@
+ 	int Edge::Intersection(const  Edge & e){ 
+ 
+ 		/*some shecks*/
+-		if (!(adj[0]==&e || adj[1]==&e)){ _error2_("Intersection bug"); }
++		if (!(adj[0]==&e || adj[1]==&e)){ _error_("Intersection bug"); }
+ 		_assert_(adj[0]==&e || adj[1]==&e);
+ 
+ 		return adj[0]==&e?0:1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.h	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.h	(revision 13036)
+@@ -33,7 +33,7 @@
+ 				R2 F(double s){ 
+ 					double c01=lEnd-lBegin, c0=(lEnd-s)/c01, c1=(s-lBegin)/c01;
+ 					if (lBegin>s || s>lEnd){
+-						_error2_("lBegin>s || s>lEnd");
++						_error_("lBegin>s || s>lEnd");
+ 					}
+ 					return e->F(sBegin*c0+sEnd*c1);
+ 				}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SetOfE4.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SetOfE4.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/SetOfE4.cpp	(revision 13036)
+@@ -49,7 +49,7 @@
+ 
+ 		//check that nbax <=NbOfEdges
+ 		if (nbax <=NbOfEdges ) {
+-			_error2_("SetOfEdges4::add overflow: NbOfEdges=" << NbOfEdges << " > nbax=" << nbax);
++			_error_("SetOfEdges4::add overflow: NbOfEdges=" << NbOfEdges << " > nbax=" << nbax);
+ 		}
+ 
+ 		//update chain
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Mesh.cpp	(revision 13036)
+@@ -116,7 +116,7 @@
+ 		  if (imaxnbv != nbv){
+ 			  delete [] kk;
+ 			  delete [] refv;
+-			  _error2_("imaxnbv != nbv");
++			  _error_("imaxnbv != nbv");
+ 		  }
+ 		  for (i=0;i<Tho.nbt;i++)
+ 			if(  reft[i] >=0 && flag[i]) 
+@@ -127,20 +127,20 @@
+ 				int i2 = Tho.GetId(t[2]);
+ 				if (i0<0 || i1<0 || i2<0){
+ 					delete [] refv;
+-					_error2_("i0<0 || i1<0 || i2< 0");
++					_error_("i0<0 || i1<0 || i2< 0");
+ 				}
+ 				if (i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv){
+-					_error2_("i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv");
++					_error_("i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv");
+ 				}
+ 				triangles[nbt] = Triangle(this,kk[i0],kk[i1],kk[i2]);
+ 				triangles[nbt].color = Tho.subdomains[reft[i]].ReferenceNumber; 
+ 				nbt++;           
+ 			  }
+ 		  if (kt!=nbt){
+-			  _error2_("kt!=nbt");
++			  _error_("kt!=nbt");
+ 		  }
+ 		  if (nbt==0 && nbv==0) {
+-			  _error2_("All triangles have been removed");
++			  _error_("All triangles have been removed");
+ 		  }
+ 		  delete [] kk;
+ 		  delete [] reft;
+@@ -152,10 +152,10 @@
+ 		  ReconstructExistingMesh();
+ 
+ 		  if (!nbsubdomains){
+-			  _error2_("nbsubdomains==0");
++			  _error_("nbsubdomains==0");
+ 		  }
+ 		  if (!subdomains[0].head || !subdomains[0].head->link){
+-			  _error2_("!subdomains[0].head || !subdomains[0].head->link");
++			  _error_("!subdomains[0].head || !subdomains[0].head->link");
+ 		  }
+ 
+ 	  }
+@@ -322,7 +322,7 @@
+ 				isorphan=true;
+ 			}
+ 		}
+-		if(isorphan) _error2_("Orphan found in mesh, see ids above");
++		if(isorphan) _error_("Orphan found in mesh, see ids above");
+ 
+ 		/*Clean up*/
+ 		xDelete<bool>(nodeflags);
+@@ -361,7 +361,7 @@
+ 			maxnbt=2*maxnbv-2; // for filling The Holes and quadrilaterals 
+ 		}
+ 		else{
+-			if(verbose>5) _error2_("no Vertices found in the initial mesh");
++			if(verbose>5) _error_("no Vertices found in the initial mesh");
+ 		}
+ 
+ 		//Triangles
+@@ -379,7 +379,7 @@
+ 			}
+ 		}
+ 		else{
+-			if(verbose>5) _error2_("no Triangles found in the initial mesh");
++			if(verbose>5) _error_("no Triangles found in the initial mesh");
+ 		}
+ 
+ 		//Quadrilaterals
+@@ -505,7 +505,7 @@
+ 				j=(int)bamgmesh->EdgesOnGeomEdge[i1*2+1]-1; //C indexing
+ 				//Check value
+ 				if(!(i>=0 && j>=0 && i<nbe && j<Gh.nbe)) {
+-					_error2_("ReadMesh error: EdgesOnGeomEdge edge provided (line " << i1+1 << ": [" << i+1 << " " << j+1 << "]) is incorrect (must be positive, [0<i<nbe=" << nbe << " 0<j<Gh.nbe=" << Gh.nbe << "]");
++					_error_("ReadMesh error: EdgesOnGeomEdge edge provided (line " << i1+1 << ": [" << i+1 << " " << j+1 << "]) is incorrect (must be positive, [0<i<nbe=" << nbe << " 0<j<Gh.nbe=" << Gh.nbe << "]");
+ 				}
+ 				edges[i].GeomEdgeHook=Gh.edges+j;
+ 			}
+@@ -521,8 +521,8 @@
+ 				i3  =(int)bamgmesh->SubDomains[i*3+0];
+ 				head=(int)bamgmesh->SubDomains[i*3+1]-1;//C indexing
+ 				direction=(int)bamgmesh->SubDomains[i*3+2];
+-				if (i3!=23) _error2_("Bad Subdomain definition: first number should be 3");
+-				if (head<0 || head>=nbt) _error2_("Bad Subdomain definition: head should in [1 " << nbt << "] (triangle number)");
++				if (i3!=23) _error_("Bad Subdomain definition: first number should be 3");
++				if (head<0 || head>=nbt) _error_("Bad Subdomain definition: head should in [1 " << nbt << "] (triangle number)");
+ 				subdomains[i].head = triangles+head;
+ 			}
+ 		}
+@@ -566,9 +566,9 @@
+ 			if (reft[i]>=0){
+ 				for (j=0;j<3;j++){
+ 					int v=GetId(triangles[i][j]); //jth vertex of the ith triangle
+-					if (k>3*nbt-1 || k<0) _error2_("k = " << k << ", nbt = " << nbt);
++					if (k>3*nbt-1 || k<0) _error_("k = " << k << ", nbt = " << nbt);
+ 					next_1[k]=head_1[v];
+-					if (v>nbv-1 || v<0)   _error2_("v = " << v << ", nbv = " << nbv);
++					if (v>nbv-1 || v<0)   _error_("v = " << v << ", nbv = " << nbv);
+ 					head_1[v]=k++;
+ 					connectivitysize_1[v]+=1;
+ 				}
+@@ -706,7 +706,7 @@
+ 					if(stop) break;
+ 				}
+ 				if (!stop){
+-					_error2_("Element holding segment [" << i1+1 << " " << i2+1 << "] not found...");
++					_error_("Element holding segment [" << i1+1 << " " << i2+1 << "] not found...");
+ 				}
+ 			}
+ 		}
+@@ -804,7 +804,7 @@
+ 			for (i=0;i<NbVerticesOnGeomEdge;i++){
+ 				const VertexOnGeom &v=VerticesOnGeomEdge[i];
+ 				if (!v.OnGeomEdge()){
+-					_error2_("A vertices supposed to be OnGeomEdge is actually not");
++					_error_("A vertices supposed to be OnGeomEdge is actually not");
+ 				}
+ 				bamgmesh->VerticesOnGeomEdge[i*3+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing
+ 				bamgmesh->VerticesOnGeomEdge[i*3+1]=Gh.GetId((const GeomEdge*)v)+1; //back to Matlab indexing
+@@ -887,9 +887,9 @@
+ 		for (i=0;i<i1;i++) {
+ 			for (j=0;j<2;j++){
+ 				int v=(int)bamgmesh->IssmEdges[i*i2+j]-1; //back to C indexing
+-				if (k>2*i1-1 || k<0) _error2_("Index exceed matrix dimensions (k=" << k << " not in [0 " << 2*i1-1 << "]");
++				if (k>2*i1-1 || k<0) _error_("Index exceed matrix dimensions (k=" << k << " not in [0 " << 2*i1-1 << "]");
+ 				next_2[k]=head_2[v];
+-				if (v>nbv-1 || v<0)   _error2_("Index exceed matrix dimensions (v=" << v << " not in [0 " << nbv-1 << "])");
++				if (v>nbv-1 || v<0)   _error_("Index exceed matrix dimensions (v=" << v << " not in [0 " << nbv-1 << "])");
+ 				head_2[v]=k++;
+ 				connectivitysize_2[v]+=1;
+ 			}
+@@ -1060,7 +1060,7 @@
+ 
+ 		//check that hmax is positive
+ 		if (hmax<=0){
+-			_error2_("hmax<=0");
++			_error_("hmax<=0");
+ 		}
+ 
+ 		//errC cannot be higher than 1
+@@ -1089,7 +1089,7 @@
+ 				double hn=Min(hmax,ht*anisomax);
+ 
+ 				if (ht<=0 || hn<=0){
+-					_error2_("ht<=0 || hn<=0");
++					_error_("ht<=0 || hn<=0");
+ 				}
+ 				EigenMetric Vp(1/(ht*ht),1/(hn*hn),tg);
+ 				Metric MVp(Vp);
+@@ -1114,7 +1114,7 @@
+ 			BuildMetric1(bamgopts);
+ 		}
+ 		else{
+-			_error2_("Hessiantype " << Hessiantype << " not supported yet (1->use Green formula, 0-> double P2 projection)");
++			_error_("Hessiantype " << Hessiantype << " not supported yet (1->use Green formula, 0-> double P2 projection)");
+ 		}
+ 	}
+ 	/*}}}*/
+@@ -1158,7 +1158,7 @@
+ 
+ 		//some checks
+ 		if (( infvertexindex <0 ) && (detOld <0) ||  ( infvertexindex >=0  ) && (detOld >0) ){
+-			_error2_("inconsistent configuration (Contact ISSM developers)");
++			_error_("inconsistent configuration (Contact ISSM developers)");
+ 		}
+ 
+ 		// if det3 does not exist, build it 
+@@ -1200,7 +1200,7 @@
+ 				}
+ 			}
+ 			else{
+-				_error2_("Cannot add a vertex more than once. Check duplicates");
++				_error_("Cannot add a vertex more than once. Check duplicates");
+ 			}
+ 		}
+ 
+@@ -1213,7 +1213,7 @@
+ 		tt[1]= &triangles[nbt++];
+ 		tt[2]= &triangles[nbt++];
+ 
+-		if (nbt>maxnbt) _error2_("Not enough triangles");
++		if (nbt>maxnbt) _error_("Not enough triangles");
+ 
+ 		*tt[1]=*tt[2]=*t;
+ 		tt[0]->link=tt[1];
+@@ -1250,7 +1250,7 @@
+ 			int rswap=tt[izerodet]->swap(iedge);
+ 
+ 			if (!rswap) {
+-				_error2_("swap the point s is on a edge");
++				_error_("swap the point s is on a edge");
+ 			}
+ 		}
+ 	}
+@@ -1317,7 +1317,7 @@
+ 
+ 		//check that the mesh is not empty
+ 		if (nbt<=0 || nbv <=0 ) {
+-			_error2_("nbt or nbv is negative (Mesh empty?)");
++			_error_("nbt or nbv is negative (Mesh empty?)");
+ 		}
+ 
+ 		//Gh is the geometry of the mesh (this), initialize MaxCornerAngle
+@@ -1339,7 +1339,7 @@
+ 		//check that there is no double edge
+ 		if (nbe !=  edge4->nb()){ 
+ 			delete [] st;
+-			_error2_("Some Double edge in the mesh, the number is " << nbe << ", nbe4=" << edge4->nb()); 
++			_error_("Some Double edge in the mesh, the number is " << nbe << ", nbe4=" << edge4->nb()); 
+ 		}
+ 		//keep nbe in nbeold
+ 		long nbeold = nbe;
+@@ -1359,7 +1359,7 @@
+ 				else if(st[k]>=0) {
+ 					//check that it is not an edge on boundary (should not already exist)
+ 					if (triangles[i].TriangleAdj(j) || triangles[st[k]/3].TriangleAdj((int) (st[k]%3))){
+-						_error2_("problem in Geometry reconstruction: an edge on boundary is duplicated (double element?)");
++						_error_("problem in Geometry reconstruction: an edge on boundary is duplicated (double element?)");
+ 					}
+ 					//OK, the element is not on boundary, is belongs to 2 triangles -> build Adjacent triangles list
+ 					triangles[i].SetAdj2(j,triangles + st[k] / 3,(int) (st[k]%3));
+@@ -1377,7 +1377,7 @@
+ 					_printLine_("Edge " << j << " of triangle " << i);
+ 					_printLine_("Edge " << (-st[k]+2)%3 << " of triangle " << (-st[k]+2)/3);
+ 					_printLine_("Edge " << triangles[(-st[k]+2)/3].NuEdgeTriangleAdj((int)((-st[k]+2)%3)) << " of triangle " << GetId(triangles[(-st[k]+2)/3].TriangleAdj((int)((-st[k]+2)%3))));
+-					_error2_("An edge belongs to more than 2 triangles");
++					_error_("An edge belongs to more than 2 triangles");
+ 				}	
+ 			}
+ 		}
+@@ -1459,7 +1459,7 @@
+ 
+ 			//check that we have been through all edges
+ 			if (k!=nbe){
+-				_error2_("problem in edge construction process: k!=nbe (should not happen)");
++				_error_("problem in edge construction process: k!=nbe (should not happen)");
+ 			}
+ 			//delete edgessave
+ 			if (edgessave) delete [] edgessave;
+@@ -1504,7 +1504,7 @@
+ 
+ 					//check that we have the correct vertex
+ 					if (v!=edges[i0 ].v[j0]){
+-						_error2_("v!=edges[i0 ].v[j0]: this should not happen as the vertex belongs to this edge");
++						_error_("v!=edges[i0 ].v[j0]: this should not happen as the vertex belongs to this edge");
+ 					}
+ 
+ 					//Add adjacence
+@@ -1521,7 +1521,7 @@
+ 
+ 		//check that nbsubdomains is empty
+ 		if (nbsubdomains){
+-			_error2_("nbsubdomains should be 0");
++			_error_("nbsubdomains should be 0");
+ 		}
+ 		nbsubdomains=0;
+ 
+@@ -1590,7 +1590,7 @@
+ 		//check that we have been through all subdomains
+ 		if (k!= nbsubdomains){
+ 			delete [] colorT;
+-			_error2_("k!= nbsubdomains");
++			_error_("k!= nbsubdomains");
+ 		}
+ 		//delete colorT and st
+ 		delete [] colorT;
+@@ -1651,7 +1651,7 @@
+ 		Gh.coefIcoor= (MaxICoor)/(Max(Gh.pmax.x-Gh.pmin.x,Gh.pmax.y-Gh.pmin.y));
+ 		if (Gh.coefIcoor<=0){
+ 			delete [] colorV;
+-			_error2_("Gh.coefIcoor<=0 in infered Geometry (this should not happen)");
++			_error_("Gh.coefIcoor<=0 in infered Geometry (this should not happen)");
+ 		}
+ 
+ 		/*Build Gh.edges*/
+@@ -1704,7 +1704,7 @@
+ 			if (k != i){
+ 				delete [] len;
+ 				delete [] colorV;
+-				_error2_("problem in Edge4 construction: k != i");
++				_error_("problem in Edge4 construction: k != i");
+ 			}
+ 		}
+ 
+@@ -1733,7 +1733,7 @@
+ 				Gh.subdomains[i].ReferenceNumber =  subdomains[i].ReferenceNumber;
+ 			}
+ 			else
+-			 _error2_("%i should be >=0");
++			 _error_("%i should be >=0");
+ 		  }
+ 
+ 		delete edge4;
+@@ -1767,7 +1767,7 @@
+ 		nbsol=bamgopts->fieldSize[1];
+ 
+ 		/*Check size*/
+-		if (bamgopts->fieldSize[0] != nbv) _error2_("'field' should have " << nbv << " rows");
++		if (bamgopts->fieldSize[0] != nbv) _error_("'field' should have " << nbv << " rows");
+ 
+ 		//initialization of some variables
+ 		double* ss=(double*)s;
+@@ -1972,7 +1972,7 @@
+ 		nbsol=bamgopts->fieldSize[1];
+ 
+ 		/*Check size*/
+-		if (bamgopts->fieldSize[0] != nbv) _error2_("'field' should have " << nbv << " rows");
++		if (bamgopts->fieldSize[0] != nbv) _error_("'field' should have " << nbv << " rows");
+ 
+ 		//initialization of some variables
+ 		long    i,k,iA,iB,iC,iv;
+@@ -2297,7 +2297,7 @@
+ 				//The vertex cannot be marked more than twice
+ 				if (splitvertex[i1]==3 || splitvertex[i2]==3){
+ 					delete [] splitvertex;
+-					_error2_("Crossing rifts not supported yet");
++					_error_("Crossing rifts not supported yet");
+ 				}
+ 			}
+ 		}
+@@ -2375,14 +2375,14 @@
+ 				}
+ 				//_printLine_(element_renu[GetId(ta.t)] << " -> " << GetId((*ta.t)[0])+1 << " " << GetId((*ta.t)[1])+1 << " " << GetId((*ta.t)[2])+1 << ", edge [" << i1 << "->" << j1 << " " << i2 << "->" << j2 << "]");
+ 				ta = Next(ta).Adj(); 
+-				if (count++>50) _error2_("Maximum number of iteration exceeded");
++				if (count++>50) _error_("Maximum number of iteration exceeded");
+ 			}while ((tbegin != ta)); 
+ 		}
+ 
+ 		//Check EdgeFlag
+ 		for(i=0;i<NbCrackedEdges;i++){
+ 			if (Edgeflags[i]!=2){
+-				_error2_("A problem occured: at least one crack edge (number " << i+1 << ") does not belong to 2 elements");
++				_error_("A problem occured: at least one crack edge (number " << i+1 << ") does not belong to 2 elements");
+ 			}
+ 		}
+ 		delete [] Edgeflags;
+@@ -2432,7 +2432,7 @@
+ 				if (!triangles[t].det) k++;
+ 			}
+ 			if (k!=0) {
+-				_error2_("there is " << k << " triangles of mes = 0");
++				_error_("there is " << k << " triangles of mes = 0");
+ 			}
+ 
+ 			//Force Edges
+@@ -2446,12 +2446,12 @@
+ 
+ 				if (nbswp) nbfe++;
+ 				if ( nbswp < 0 && k < 5){
+-					_error2_("Missing Edge " << i << ", v0=" << GetId(edges[i][0]) << ",v1=" << GetId(edges[i][1]));
++					_error_("Missing Edge " << i << ", v0=" << GetId(edges[i][0]) << ",v1=" << GetId(edges[i][1]));
+ 				}
+ 			}
+ 
+ 			if (k!=0) {
+-				_error2_("There are " << k << " lost edges, the boundary might be crossing");
++				_error_("There are " << k << " lost edges, the boundary might be crossing");
+ 			}
+ 			for (int j=0;j<nbv;j++){
+ 				Nbswap +=  vertices[j].Optim(1,0);
+@@ -2533,7 +2533,7 @@
+ 			it++;} // end while (it<nbt)
+ 			if (nbt == nbtout ||  !NbSubDomTot) {
+ 				delete [] HeapArete;
+-				_error2_("The boundary is not close: all triangles are outside");
++				_error_("The boundary is not close: all triangles are outside");
+ 			}
+ 
+ 			delete [] HeapArete;
+@@ -2571,7 +2571,7 @@
+ 						it++;} // end white (it<nbt)
+ 						if (k!=nbsubdomains){
+ 							delete [] mark;
+-							_error2_("k!=nbsubdomains");
++							_error_("k!=nbsubdomains");
+ 						}
+ 						if(OutSide) 
+ 						  {
+@@ -2661,7 +2661,7 @@
+ 							else 
+ 							 subdomains[i].head=t=ta;
+ 							if(t<triangles || t >= triangles+nbt || t->det < 0 || t->link == 0) {
+-								_error2_("bad definition of SubSomain " << i);
++								_error_("bad definition of SubSomain " << i);
+ 							}
+ 							long it = GetId(t);
+ 							if (mark[it] >=0) {
+@@ -2676,7 +2676,7 @@
+ 							  {
+ 								kkk++;
+ 								if (mark[GetId(tt)]>=0){
+-									_error2_("mark[GetId(tt)]>=0");
++									_error_("mark[GetId(tt)]>=0");
+ 								}
+ 								mark[GetId(tt)]=i;
+ 								tt=tt->link;
+@@ -2685,7 +2685,7 @@
+ 						}
+ 						ta = Previous(Adj(ta));         
+ 						if(t == (Triangle *) ta) {
+-							_error2_("bad definition of SubSomain " << i);
++							_error_("bad definition of SubSomain " << i);
+ 						}
+ 					}
+ 				}
+@@ -2847,7 +2847,7 @@
+ 		for (i=2; det(orderedvertices[0]->i,orderedvertices[1]->i,orderedvertices[i]->i)==0;){
+ 			//if i is higher than nbv, it means that all the determinants are 0,
+ 			//all vertices are aligned!
+-			if  (++i>=nbv) _error2_("all the vertices are aligned");
++			if  (++i>=nbv) _error_("all the vertices are aligned");
+ 		}
+ 		// exchange i et 2 in "orderedvertices" so that
+ 		// the first 3 vertices are not aligned (real triangle)
+@@ -2983,7 +2983,7 @@
+ 				BamgVertex &vj = vertices[iv];
+ 				long  j=vj.ReferenceNumber; 
+ 				if (&vj!=orderedvertices[j]){
+-					_error2_("&vj!= orderedvertices[j]");
++					_error_("&vj!= orderedvertices[j]");
+ 				}
+ 				if(i!=j){ 
+ 					Exchange(vi,vj);
+@@ -2993,7 +2993,7 @@
+ 				Triangle *tcvj=TriangleFindFromCoord(vj.i,det3);
+ 				if (tcvj && !tcvj->link){
+ 					tcvj->Echo();
+-					_error2_("problem inserting point in InsertNewPoints (tcvj=" << tcvj << " and tcvj->link=" << tcvj->link << ")");
++					_error_("problem inserting point in InsertNewPoints (tcvj=" << tcvj << " and tcvj->link=" << tcvj->link << ")");
+ 				}
+ 				quadtree->Add(vj);
+ 				AddVertex(vj,tcvj,det3);
+@@ -3025,7 +3025,7 @@
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeGeomEdgeToEdge)*/
+ 
+ 		if (!Gh.nbe){
+-			_error2_("!Gh.nbe");
++			_error_("!Gh.nbe");
+ 		}
+ 		Edge **e= new (Edge* [Gh.nbe]);
+ 
+@@ -3058,7 +3058,7 @@
+ 				if(kk<10) _printLine_("BUG: the geometrical edge " << i << " is on no edge curve");
+ 			}
+ 		}
+-		if(kk) _error2_("See above");
++		if(kk) _error_("See above");
+ 
+ 		return e;
+ 	}
+@@ -3257,7 +3257,7 @@
+ 
+ 				//check i
+ 				if (i<0 || i>=nbt ){
+-					_error2_("Index problem in NewPoints (i=" << i << " not in [0 " << nbt-1 << "])");
++					_error_("Index problem in NewPoints (i=" << i << " not in [0 " << nbt-1 << "])");
+ 				}
+ 				//change first_np_or_next_t[i]
+ 				first_np_or_next_t[i] = iter; 
+@@ -3308,7 +3308,7 @@
+ 						Headt=kt;
+ 					}
+ 					if (ta.EdgeVertex(0)!=s){
+-						_error2_("ta.EdgeVertex(0)!=s");
++						_error_("ta.EdgeVertex(0)!=s");
+ 					}
+ 					ta = Next(Adj(ta));
+ 				} while ( (tbegin != (Triangle*) ta)); 
+@@ -3343,7 +3343,7 @@
+ 			tA=vA.BackgroundEdgeHook->abcisse;
+ 		}
+ 		else {
+-			_error2_("ProjectOnCurve On BamgVertex " << BTh.GetId(vA) << " forget call to SetVertexFieldOnBTh");
++			_error_("ProjectOnCurve On BamgVertex " << BTh.GetId(vA) << " forget call to SetVertexFieldOnBTh");
+ 		} 
+ 
+ 		if (vB.IndexInTriangle == IsVertexOnVertex){
+@@ -3354,17 +3354,17 @@
+ 			tB=vB.BackgroundEdgeHook->abcisse;
+ 		}
+ 		else {
+-			_error2_("ProjectOnCurve On BamgVertex " << BTh.GetId(vB) << " forget call to SetVertexFieldOnBTh");
++			_error_("ProjectOnCurve On BamgVertex " << BTh.GetId(vB) << " forget call to SetVertexFieldOnBTh");
+ 		} 
+ 		Edge * e = &BhAB;
+ 		if (!pA || !pB || !e){
+-			_error2_("!pA || !pB || !e");
++			_error_("!pA || !pB || !e");
+ 		}
+ 		// be carefull the back ground edge e is on same geom edge 
+ 		// of the initiale edge def by the 2 vertex A B;
+ 		//check Is a background Mesh;   
+ 		if (e<BTh.edges || e>=BTh.edges+BTh.nbe){
+-			_error2_("e<BTh.edges || e>=BTh.edges+BTh.nbe");
++			_error_("e<BTh.edges || e>=BTh.edges+BTh.nbe");
+ 		}
+ 		// walk on BTh edge 
+ 		//not finish ProjectOnCurve with BackGround Mesh);
+@@ -3387,7 +3387,7 @@
+ 
+ 		  } 
+ 		else{ // do the search by walking 
+-			_error2_("case not supported yet");
++			_error_("case not supported yet");
+ 		  }
+ 
+ 		// find the direction of walking with direction of edge and pA,PB;
+@@ -3451,7 +3451,7 @@
+ 			abscisse = lg*theta;
+ 
+ 		  }
+-		_error2_("Big bug...");
++		_error_("Big bug...");
+ 		return 0; // just for the compiler 
+ 	}                  
+ 	/*}}}*/
+@@ -3492,7 +3492,7 @@
+ 		kk=kk+(i==edge4->SortAndAdd(GetId(edges[i][0]),GetId(edges[i][1])));
+ 	}
+ 	if (kk != nbe){ 
+-		_error2_("There are " << kk-nbe << " double edges in the mesh");
++		_error_("There are " << kk-nbe << " double edges in the mesh");
+ 	}
+ 
+ 	//Add edges of all triangles in existing mesh
+@@ -3524,7 +3524,7 @@
+ 
+ 			//An edge belongs to 2 triangles
+ 			else {
+-				_error2_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << " , " << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles");
++				_error_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << " , " << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles");
+ 			}
+ 		}
+ 	}
+@@ -3562,7 +3562,7 @@
+ 		}
+ 	}
+ 	if(k) {
+-		_error2_(k << " boundary edges (from the geometry) are not defined as mesh edges");
++		_error_(k << " boundary edges (from the geometry) are not defined as mesh edges");
+ 	}
+ 
+ 	/* mesh generation with boundary points*/
+@@ -3589,7 +3589,7 @@
+ 	//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) {
+-		 _error2_("ReconstructExistingMesh: All the vertices are aligned");
++		 _error_("ReconstructExistingMesh: All the vertices are aligned");
+ 	 }
+ 	//Move this vertex (i) to the 2d position in orderedvertices
+ 	Exchange(orderedvertices[2], orderedvertices[i]);
+@@ -3649,7 +3649,7 @@
+ 		}
+ 	}
+ 	if(nbloss) {
+-		_error2_("we lost " << nbloss << " existing edges other " << knbe);
++		_error_("we lost " << nbloss << " existing edges other " << knbe);
+ 	}
+ 
+ 	FindSubDomain(1);
+@@ -3724,7 +3724,7 @@
+ 	triangles = savetriangles;
+ 	subdomains = savesubdomains;
+ 	if (k) {
+-		_error2_("number of triangles edges alone = " << k);
++		_error_("number of triangles edges alone = " << k);
+ 	}
+ 	FindSubDomain();
+ 
+@@ -3754,7 +3754,7 @@
+ 						 _printLine_("Its pointer is " << edges[i][j].GeomEdgeHook);
+ 
+ 						_printLine_("This edge is on geometry and has no adjacent edge (open curve) and one of the tip is not required");
+-						_error2_("See above (might be cryptic...)");
++						_error_("See above (might be cryptic...)");
+ 					}
+ 				}
+ 			}
+@@ -3777,15 +3777,15 @@
+ 		  { 
+ 			t=t0=subdomains[i].head;
+ 			if (!t0){ // not empty sub domain
+-				_error2_("!t0");
++				_error_("!t0");
+ 			}
+ 			do { 
+ 				long kt = GetId(t);
+ 				if (kt<0 || kt >= nbt ){
+-					_error2_("kt<0 || kt >= nbt");
++					_error_("kt<0 || kt >= nbt");
+ 				}
+ 				if (renu[kt]!=-1){
+-					_error2_("renu[kt]!=-1");
++					_error_("renu[kt]!=-1");
+ 				}
+ 				renu[kt]=k++;
+ 			}
+@@ -3802,7 +3802,7 @@
+ 			if (renu[it]==-1) renu[it]=k++;
+ 		}
+ 		if (k != nbt){
+-			_error2_("k != nbt");
++			_error_("k != nbt");
+ 		}
+ 		// do the change on all the pointeur 
+ 		for ( it=0;it<nbt;it++)
+@@ -3928,7 +3928,7 @@
+ 	//Compute coefIcoor
+ 	coefIcoor= (MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
+ 	if (coefIcoor<=0){
+-		_error2_("coefIcoor should be positive, a problem in the geometry is likely");
++		_error_("coefIcoor should be positive, a problem in the geometry is likely");
+ 	}
+ 
+ 	// generation of integer coord  
+@@ -3964,7 +3964,7 @@
+ 		else triangles[i].det=-1;
+ 	}
+ 
+-	if (number_of_errors) _error2_("Fatal error: some triangles have negative areas, see above");
++	if (number_of_errors) _error_("Fatal error: some triangles have negative areas, see above");
+ }
+ /*}}}*/
+ /*FUNCTION Mesh::ShowRegulaty{{{*/
+@@ -4145,7 +4145,7 @@
+ 			//  pour tous les triangles autour du sommet s
+ 			register Triangle* t= vertices[i].t;
+ 			if (!t){
+-				_error2_("!t");
++				_error_("!t");
+ 			}
+ 			BamgVertex & vi = vertices[i];
+ 			AdjacentTriangle ta(t,EdgesVertexTriangle[vertices[i].IndexInTriangle][0]);
+@@ -4153,13 +4153,13 @@
+ 			while (1) {
+ 				ta=Previous(Adj(ta));
+ 				if (vertices+i != ta.EdgeVertex(1)){
+-					_error2_("vertices+i != ta.EdgeVertex(1)");
++					_error_("vertices+i != ta.EdgeVertex(1)");
+ 				}
+ 				BamgVertex & vj = *(ta.EdgeVertex(0));
+ 				if ( &vj ) {
+ 					j= &vj-vertices;
+ 					if (j<0 || j >= nbv){
+-						_error2_("j<0 || j >= nbv");
++						_error_("j<0 || j >= nbv");
+ 					}
+ 					R2 Aij = (R2) vj - (R2) vi;
+ 					double ll =  Norme2(Aij);
+@@ -4283,7 +4283,7 @@
+ 					// a faire -- difficile 
+ 					// the first PB is to now a background edge between the 2 vertices
+ 					if (!edgesGtoB){
+-						_error2_("!edgesGtoB");
++						_error_("!edgesGtoB");
+ 					}
+ 					ong= ProjectOnCurve(*edgesGtoB[Gh.GetId(edges[i].GeomEdgeHook)],
+ 								edges[i][0],edges[i][1],0.5,vertices[k],
+@@ -4355,7 +4355,7 @@
+ 		for (i=0;i<nbt;i++) {
+ 			Triangle & t = triangles[i];
+ 			if (!t.link){
+-				_error2_("!t.link");
++				_error_("!t.link");
+ 			}
+ 			for(int j=0;j<3;j++)
+ 			  {
+@@ -4382,7 +4382,7 @@
+ 										||   (bb=Area2( t[0].r , A.r    , t[2].r )) < 0.0  
+ 										||   (cc=Area2( t[0].r , t[1].r , A.r    )) < 0.0)){
+ 							_printLine_(ke + nbvold << " not in triangle " << i << " In= " << !!t.link << " " << aa << " " << bb << " " << cc << " " << dd);
+-							_error2_("Number of triangles with P2 interpolation Problem");
++							_error_("Number of triangles with P2 interpolation Problem");
+ 						}
+ 					}
+ 					else {
+@@ -4390,7 +4390,7 @@
+ 										||   (bb=Area2( tt[0].r , A.r     , tt[2].r )) < 0 
+ 										||   (cc=Area2( tt[0].r , tt[1].r , A.r     )) < 0)){
+ 							_printLine_(ke + nbvold << " not in triangle " << ii << " In= " << !!tt.link << " " << aa << " " << bb << " " << cc << " " << dd);
+-							_error2_("Number of triangles with P2 interpolation Problem");
++							_error_("Number of triangles with P2 interpolation Problem");
+ 						}
+ 					} 
+ 				  }
+@@ -4438,7 +4438,7 @@
+ 							kkk[nbsplitedge++]=j;		      
+ 						  } // tt 
+ 						else
+-						 _error2_("Bug...");
++						 _error_("Bug...");
+ 					  } // ke<0	       
+ 					else
+ 					  { // ke >=0
+@@ -4451,7 +4451,7 @@
+ 
+ 			  } 
+ 			if (nbinvisible>=2){
+-				_error2_("nbinvisible>=2");
++				_error_("nbinvisible>=2");
+ 			}
+ 			switch (nbsplitedge) {
+ 				case 0: ksplit[i]=10; newnbt++; break;   // nosplit
+@@ -4463,7 +4463,7 @@
+ 						  break;
+ 			} 
+ 			if (ksplit[i]<40){
+-				_error2_("ksplit[i]<40");
++				_error_("ksplit[i]<40");
+ 			}
+ 		  }
+ 		//  now do the element split
+@@ -4480,7 +4480,7 @@
+ 			long kk=ksplit[i]/10;
+ 			int  ke=(int) (ksplit[i]%10);
+ 			if (kk>=7 || kk<=0){
+-				_error2_("kk>=7 || kk<=0");
++				_error_("kk>=7 || kk<=0");
+ 			}
+ 
+ 			// def the numbering   k (edge) i vertex 
+@@ -4497,7 +4497,7 @@
+ 			BamgVertex * v2=t0(i2);
+ 
+ 			if (nbmkadj>=10){
+-				_error2_("nbmkadj>=10");
++				_error_("nbmkadj>=10");
+ 			}
+ 			// --------------------------
+ 			AdjacentTriangle ta0(t0.Adj(i0)),ta1(t0.Adj(i1)),ta2(t0.Adj(i2));
+@@ -4515,7 +4515,7 @@
+ 							Triangle &t1=triangles[kkk++];
+ 							t1=t0;
+ 							if (kedge[3*i+i0]<0){
+-								_error2_("kedge[3*i+i0]<0");
++								_error_("kedge[3*i+i0]<0");
+ 							}
+ 							BamgVertex * v3 = vertices + kedge[3*i+k0];
+ 
+@@ -4531,10 +4531,10 @@
+ 							Triangle &t2=triangles[kkk++];
+ 							t2=t1=t0;
+ 							if (kedge[3*i+k1]<0){
+-								_error2_("kedge[3*i+k1]<0");
++								_error_("kedge[3*i+k1]<0");
+ 							}
+ 							if (kedge[3*i+k2]<0){
+-								_error2_("kedge[3*i+k2]<0");
++								_error_("kedge[3*i+k2]<0");
+ 							}
+ 
+ 							BamgVertex * v01 = vertices + kedge[3*i+k2];
+@@ -4558,7 +4558,7 @@
+ 							Triangle &t3=triangles[kkk++];
+ 							t3=t2=t1=t0;
+ 							if (kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0){
+-								_error2_("kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0");
++								_error_("kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0");
+ 							}
+ 							BamgVertex * v12 = vertices + kedge[3*i+k0];
+ 							BamgVertex * v02 = vertices + kedge[3*i+k1]; 
+@@ -4632,7 +4632,7 @@
+ 				 mkadj[nbmkadj++]=jj;
+ 				}
+ 			if (nbmkadj>13){// 13 = 6 + 4 +
+-				_error2_("nbmkadj>13");
++				_error_("nbmkadj>13");
+ 			}
+ 
+ 			if (kk==6)  newnbq+=3;
+@@ -4758,7 +4758,7 @@
+ 
+ 			quadtree->Add(vi);
+ 			if (!tcvi || tcvi->det<0){// internal
+-				_error2_("!tcvi || tcvi->det < 0");
++				_error_("!tcvi || tcvi->det < 0");
+ 			}
+ 			AddVertex(vi,tcvi,det3);
+ 			NbSwap += vi.Optim(1);          
+@@ -4801,14 +4801,14 @@
+ 	else {
+ 
+ 		/*Check that the quadtree does exist*/
+-		if (!quadtree) _error2_("no starting triangle provided and no quadtree available");
++		if (!quadtree) _error_("no starting triangle provided and no quadtree available");
+ 
+ 		/*Call NearestVertex*/
+ 		BamgVertex *a = quadtree->NearestVertex(B.x,B.y) ;
+ 
+ 		/*Check output (Vertex a)*/
+-		if (!a)    _error2_("problem while trying to find nearest vertex from a given point. No output found");
+-		if (!a->t) _error2_("no triangle is associated to vertex number " << GetId(a)+1 << " (orphan?)");
++		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*/
+@@ -4843,7 +4843,7 @@
+ 	while(t->det>0) { 
+ 
+ 		/*Increase counter*/
+-		if (++counter>=10000) _error2_("Maximum number of iteration reached (threshold = " << counter << ").");
++		if (++counter>=10000) _error_("Maximum number of iteration reached (threshold = " << counter << ").");
+ 
+ 		j= OppositeVertex[jj];
+ 		det3[j] = detop;  //det(*b,*s1,*s2);
+@@ -4907,7 +4907,7 @@
+ 		t=t0=subdomains[i].head;
+ 
+ 		//check that the subdomain is not empty
+-		if (!t0){ _error2_("At least one subdomain is empty");}
++		if (!t0){ _error_("At least one subdomain is empty");}
+ 
+ 		//loop
+ 		do{
+@@ -4990,7 +4990,7 @@
+ 		}
+ 		//allocate
+ 		VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex];  
+-		if(NbVerticesOnGeomVertex >= maxnbv) _error2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
++		if(NbVerticesOnGeomVertex >= maxnbv) _error_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
+ 		_assert_(nbv==0);
+ 		//Build VerticesOnGeomVertex
+ 		for (i=0;i<Gh.nbv;i++){
+@@ -5079,7 +5079,7 @@
+ 								PreviousNewEdge=0;
+ 								NbNewPoints=0;
+ 								NbEdgeCurve=0;
+-								if (nbvend>=maxnbv) _error2_("maximum number of vertices too low! Check the domain outline or increase maxnbv");
++								if (nbvend>=maxnbv) _error_("maximum number of vertices too low! Check the domain outline or increase maxnbv");
+ 								lcurve =0;
+ 								s = lstep; //-1 initially, then length of each sub edge
+ 
+@@ -5321,7 +5321,7 @@
+ 		for (i=0;i<Gh.nbv;i++) if (Gh[i].Required()) NbVerticesOnGeomVertex++;
+ 		printf("\n");
+ 		if(NbVerticesOnGeomVertex >= maxnbv){
+-			_error2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
++			_error_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
+ 		}
+ 
+ 		VerticesOnGeomVertex = new VertexOnGeom[  NbVerticesOnGeomVertex];
+@@ -5392,7 +5392,7 @@
+ 		} 
+ 		if (bfind!=Gh.nbcurves){
+ 			delete [] bcurve;
+-			_error2_("problem generating number of curves (" << Gh.nbcurves << " found in the geometry but " << bfind << " curve found in the mesh)");
++			_error_("problem generating number of curves (" << Gh.nbcurves << " found in the geometry but " << bfind << " curve found in the mesh)");
+ 		}
+ 
+ 		// method in 2 + 1 step 
+@@ -5491,11 +5491,11 @@
+ 									Edge* e = edges + nbe++;
+ 									double se= (sNew-L0)/LAB;
+ 									if (se<0 || se>=1.000000001){
+-										_error2_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");
++										_error_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");
+ 									}
+ 									se = abscisseInterpole(v0.m,v1.m,AB,se,1);
+ 									if (se<0 || se>1){
+-										_error2_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");
++										_error_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");
+ 									}
+ 									se = k1         ? se : 1. - se;
+ 									se = k1==k1equi ? se : 1. - se;
+@@ -5527,7 +5527,7 @@
+ 								break;
+ 							}
+ 							if (!ee.adj[k1]) {
+-								_error2_("adj edge " << BTh.GetId(ee) << ", nbe=" << nbe << ", Gh.vertices=" << Gh.vertices);
++								_error_("adj edge " << BTh.GetId(ee) << ", nbe=" << nbe << ", Gh.vertices=" << Gh.vertices);
+ 							}
+ 							pe = ee.adj[k1]; // next edge
+ 							k0 = pe->Intersection(ee); 
+@@ -5565,7 +5565,7 @@
+ 			//Allocate memory
+ 			if(step==0){
+ 				if(nbv+NbOfNewPoints > maxnbv) {
+-					_error2_("too many vertices on geometry: " << nbv+NbOfNewPoints << " >= " << maxnbv);
++					_error_("too many vertices on geometry: " << nbv+NbOfNewPoints << " >= " << maxnbv);
+ 				}
+ 				edges = new Edge[NbOfNewEdge];
+ 				nbex = NbOfNewEdge;
+@@ -5610,7 +5610,7 @@
+ 		int k=(*t)(0) ?  ((  (*t)(1) ? ( (*t)(2) ? -1 : 2) : 1  )) : 0;
+ 		int dir=0;
+ 		if (k<0){
+-			_error2_("k<0");
++			_error_("k<0");
+ 		}
+ 		int kkk=0;  
+ 		Icoor2 IJ_IA,IJ_AJ;
+@@ -5618,7 +5618,7 @@
+ 		for (;;edge = dir >0 ? Next(Adj(Next(edge))) : Previous(Adj(Previous(edge)))) {  
+ 			kkk++;
+ 			if (kkk>=1000){
+-				_error2_("kkk>=1000");
++				_error_("kkk>=1000");
+ 			}
+ 			BamgVertex  &vI =  *edge.EdgeVertex(0);
+ 			BamgVertex  &vJ =  *edge.EdgeVertex(1);
+@@ -5635,7 +5635,7 @@
+ 							continue;}}// go in direction j
+ 							double IJ2 = IJ_IA + IJ_AJ;
+ 							if (IJ2==0){
+-								_error2_("IJ2==0");
++								_error_("IJ2==0");
+ 							}
+ 							a= IJ_AJ/IJ2;
+ 							b= IJ_IA/IJ2;
+@@ -5649,7 +5649,7 @@
+ 
+ 	int NbSwap =0;
+ 	if (!a.t || !b.t){ // the 2 vertex is in a mesh
+-		_error2_("!a.t || !b.t");
++		_error_("!a.t || !b.t");
+ 	}
+ 	int k=0;
+ 	taret=AdjacentTriangle(0,0); // erreur 
+@@ -5666,7 +5666,7 @@
+ 		v2 = tta.EdgeVertex(0);
+ 		vbegin =v2;
+ 		if (!v2){
+-			_error2_("!v2");
++			_error_("!v2");
+ 		}
+ 		det2 = det(*v2,a,b);
+ 	}
+@@ -5683,12 +5683,12 @@
+ 			BamgVertex * va = &a, *vb = &b;
+ 			tc = Previous(tc);
+ 			if (!v1 || !v2){
+-				_error2_("!v1 || !v2");
++				_error_("!v1 || !v2");
+ 			}
+ 			Icoor2 detss = 0,l=0,ks;
+ 			while ((ks=SwapForForcingEdge(  va,  vb, tc, detss, det1,det2,NbSwap)))
+ 			 if(l++ > 10000000) {
+-				 _error2_("Loop in forcing Egde, nb de swap=" << NbSwap << ", nb of try swap (" << l << ") too big");
++				 _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)) {
+@@ -5707,7 +5707,7 @@
+ 		tta = tc;
+ 		k++;
+ 		if (k>=2000){
+-			_error2_("k>=2000");
++			_error_("k>=2000");
+ 		}
+ 		if ( vbegin == v2 ) return -1;// error 
+ 	}
+@@ -5779,7 +5779,7 @@
+ 		Triangle *t1=tt1,*t2=tt2;// les 2 triangles adjacent
+ 		short a1=tt1,a2=tt2;// les 2 numero de l arete dans les 2 triangles
+ 		if ( a1<0 || a1>=3 ){
+-			_error2_("a1<0 || a1>=3");
++			_error_("a1<0 || a1>=3");
+ 		}
+ 
+ 		BamgVertex & sa= (* t1)[VerticesOfTriangularEdge[a1][0]];
+@@ -5791,10 +5791,10 @@
+ 		Icoor2 det1=t1->det , det2=t2->det ;
+ 		Icoor2 detT = det1+det2;
+ 		if ((det1<=0 ) || (det2<=0)){
+-			_error2_("(det1<=0 ) || (det2<=0)");
++			_error_("(det1<=0 ) || (det2<=0)");
+ 		}
+ 		if ( (detsa>=0) || (detsb<=0) ){ // [a,b] cut infinite line va,bb
+-			_error2_("(detsa>=0) || (detsb<=0)");
++			_error_("(detsa>=0) || (detsb<=0)");
+ 		}
+ 		Icoor2 ndet1 = bamg::det(s1,sa,s2);
+ 		Icoor2 ndet2 = detT - ndet1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13036)
+@@ -109,7 +109,7 @@
+ 
+ 		/*Get first Enum*/
+ 		if(fread(&record_enum,sizeof(int),1,this->fid)==0){
+-			_error2_("Marshalled file is empty");
++			_error_("Marshalled file is empty");
+ 		}
+ 		else{
+ 			if(record_enum!=MaximumNumberOfEnums){
+@@ -127,7 +127,7 @@
+ 				_printLine_("     and recompile                                                       ");
+ 				_printLine_("=========================================================================");
+ 				_printLine_("");
+-				_error2_("Enums not consistent (See error message above)");
++				_error_("Enums not consistent (See error message above)");
+ 			}
+ 		}
+ 	}
+@@ -176,7 +176,7 @@
+ 
+ 	/*Find constant*/
+ 	Param* param=(Param*)this->constants->FindParamObject(constant_enum);
+-	if(!param) _error2_("Constant " << EnumToStringx(constant_enum) << " not found in iomodel");
++	if(!param) _error_("Constant " << EnumToStringx(constant_enum) << " not found in iomodel");
+ 
+ 	return (Param*)param->copy();
+ }
+@@ -265,7 +265,7 @@
+ 				switch(record_code){
+ 					case 1: 
+ 						/*Read the boolean and broadcast it to other cpus:*/
+-						if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error2_("could not read boolean ");
++						if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error_("could not read boolean ");
+ 						#ifdef _HAVE_MPI_
+ 						MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+ 						#endif
+@@ -276,7 +276,7 @@
+ 						break;
+ 					case 2:
+ 						/*Read the integer and broadcast it to other cpus:*/
+-						if(fread(&integer,sizeof(int),1,this->fid)!=1) _error2_("could not read integer ");
++						if(fread(&integer,sizeof(int),1,this->fid)!=1) _error_("could not read integer ");
+ 						#ifdef _HAVE_MPI_
+ 						MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+ 						#endif
+@@ -287,7 +287,7 @@
+ 						break;
+ 					case 3:
+ 						/*Read the scalar and broadcast it to other cpus:*/
+-						if(fread(&scalar,sizeof(IssmPDouble),1,this->fid)!=1) _error2_("could not read scalar ");
++						if(fread(&scalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_("could not read scalar ");
+ 						#ifdef _HAVE_MPI_
+ 						MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+ 						#endif
+@@ -298,7 +298,7 @@
+ 						break;
+ 					case 4: 
+ 						/*We have to read a string from disk. First read the dimensions of the string, then the string: */
+-						if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error2_("could not read length of string ");
++						if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_("could not read length of string ");
+ 						#ifdef _HAVE_MPI_
+ 						MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+ 						#endif
+@@ -308,7 +308,7 @@
+ 							string[string_size]='\0';
+ 
+ 							/*Read string, then broadcast: */
+-							if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error2_(" could not read string ");
++							if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_(" could not read string ");
+ 							#ifdef _HAVE_MPI_
+ 							MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+ 							#endif
+@@ -359,7 +359,7 @@
+ 							break;
+ 
+ 					default: 
+-						_error2_("unknown record type:" << record_code); 
++						_error_("unknown record type:" << record_code); 
+ 						break;;
+ 				}
+ 			}
+@@ -427,7 +427,7 @@
+ 				case 9: break; //do nothing. not interested in this type of data, which is memory intensive.
+ 
+ 				default: 
+-					_error2_("unknown record type:" << record_code); 
++					_error_("unknown record type:" << record_code); 
+ 					break;;
+ 				}
+ 
+@@ -452,11 +452,11 @@
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+ 
+-	if(code!=1)_error2_("expecting a boolean for enum " << EnumToStringx(data_enum));
++	if(code!=1)_error_("expecting a boolean for enum " << EnumToStringx(data_enum));
+ 	
+ 	/*We have to read a boolean from disk. */
+ 	if(my_rank==0){  
+-		if(fread(&booleanint,sizeof(int),1,fid)!=1) _error2_("could not read boolean ");
++		if(fread(&booleanint,sizeof(int),1,fid)!=1) _error_("could not read boolean ");
+ 	}
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+@@ -481,11 +481,11 @@
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+ 	
+-	if(code!=2)_error2_("expecting an integer for enum " << EnumToStringx(data_enum));
++	if(code!=2)_error_("expecting an integer for enum " << EnumToStringx(data_enum));
+ 	
+ 	/*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
+ 	if(my_rank==0){  
+-		if(fread(&integer,sizeof(int),1,fid)!=1) _error2_("could not read integer ");
++		if(fread(&integer,sizeof(int),1,fid)!=1) _error_("could not read integer ");
+ 	}
+ 
+ 	#ifdef _HAVE_MPI_
+@@ -511,11 +511,11 @@
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+ 	
+-	if(code!=3)_error2_("expecting a IssmDouble for enum " << EnumToStringx(data_enum));
++	if(code!=3)_error_("expecting a IssmDouble for enum " << EnumToStringx(data_enum));
+ 	
+ 	/*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */
+ 	if(my_rank==0){
+-		if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1)_error2_("could not read scalar ");
++		if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1)_error_("could not read scalar ");
+ 	}
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+@@ -541,13 +541,13 @@
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+ 	
+-	if(code!=4)_error2_("expecting a string for enum " << EnumToStringx(data_enum));
++	if(code!=4)_error_("expecting a string for enum " << EnumToStringx(data_enum));
+ 	
+ 	/*Now fetch: */
+ 	
+ 	/*We have to read a string from disk. First read the dimensions of the string, then the string: */
+ 	if(my_rank==0){  
+-		if(fread(&string_size,sizeof(int),1,fid)!=1) _error2_("could not read length of string ");
++		if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string ");
+ 	}
+ 
+ 	#ifdef _HAVE_MPI_
+@@ -561,7 +561,7 @@
+ 
+ 		/*Read string on node 0, then broadcast: */
+ 		if(my_rank==0){  
+-			if(fread(string,string_size*sizeof(char),1,fid)!=1)_error2_(" could not read string ");
++			if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
+ 		}
+ 		#ifdef _HAVE_MPI_
+ 		MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+@@ -595,14 +595,14 @@
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
+ 
+-	if((code!=5) && (code!=6) && (code!=7))_error2_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
++	if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
+ 	
+ 	/*Now fetch: */
+ 
+ 	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
+ 	/*numberofelements: */
+ 	if(my_rank==0){  
+-		if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows for matrix ");
++		if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
+ 	}
+ 
+ 	#ifdef _HAVE_MPI_
+@@ -610,7 +610,7 @@
+ 	#endif
+ 
+ 	if(my_rank==0){  
+-		if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns for matrix ");
++		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
+ 	}
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
+@@ -622,7 +622,7 @@
+ 
+ 		/*Read matrix on node 0, then broadcast: */
+ 		if(my_rank==0){  
+-			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
++			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
+ 		}
+ 		
+ 		#ifdef _HAVE_MPI_
+@@ -666,21 +666,21 @@
+ 	
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
+-	if((code!=5) && (code!=6) && (code!=7))_error2_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
++	if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
+ 	
+ 	/*Now fetch: */
+ 
+ 	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
+ 	/*numberofelements: */
+ 	if(my_rank==0){  
+-		if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows for matrix ");
++		if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
+ 	}
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+ 	#endif
+ 
+ 	if(my_rank==0){  
+-		if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns for matrix ");
++		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
+ 	}
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
+@@ -692,7 +692,7 @@
+ 
+ 		/*Read matrix on node 0, then broadcast: */
+ 		if(my_rank==0){  
+-			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
++			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
+ 		}
+ 		#ifdef _HAVE_MPI_
+ 		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+@@ -728,11 +728,11 @@
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+ 	
+-	if(code!=9)_error2_("expecting a string array for enum " << EnumToStringx(data_enum));
++	if(code!=9)_error_("expecting a string array for enum " << EnumToStringx(data_enum));
+ 	
+ 	/*We have to read a bunch of strings from disk. First read the number of strings, and allocate: */
+ 	if(my_rank==0){  
+-		if(fread(&numstrings,sizeof(int),1,fid)!=1) _error2_("could not read length of string array");
++		if(fread(&numstrings,sizeof(int),1,fid)!=1) _error_("could not read length of string array");
+ 	}
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Bcast(&numstrings,1,MPI_INT,0,MPI_COMM_WORLD); 
+@@ -747,7 +747,7 @@
+ 		for(i=0;i<numstrings;i++){
+ 			
+ 			if(my_rank==0){  
+-				if(fread(&string_size,sizeof(int),1,fid)!=1) _error2_("could not read length of string ");
++				if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string ");
+ 			}
+ 			#ifdef _HAVE_MPI_
+ 			MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+@@ -758,7 +758,7 @@
+ 
+ 				/*Read string on node 0, then broadcast: */
+ 				if(my_rank==0){  
+-					if(fread(string,string_size*sizeof(char),1,fid)!=1)_error2_(" could not read string ");
++					if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
+ 				}
+ 				#ifdef _HAVE_MPI_
+ 				MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+@@ -799,11 +799,11 @@
+ 	
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+-	if(code!=8)_error2_("expecting a IssmDouble mat array for enum " << EnumToStringx(data_enum));
++	if(code!=8)_error_("expecting a IssmDouble mat array for enum " << EnumToStringx(data_enum));
+ 	
+ 	/*Now fetch: */
+ 	if(my_rank==0){  
+-		if(fread(&numrecords,sizeof(int),1,fid)!=1) _error2_("could not read number of records in matrix array ");
++		if(fread(&numrecords,sizeof(int),1,fid)!=1) _error_("could not read number of records in matrix array ");
+ 	}
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Bcast(&numrecords,1,MPI_INT,0,MPI_COMM_WORLD); 
+@@ -826,14 +826,14 @@
+ 		for(i=0;i<numrecords;i++){
+ 
+ 			if(my_rank==0){  
+-				if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows in " << i << "th matrix of matrix array");
++				if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows in " << i << "th matrix of matrix array");
+ 			}
+ 			#ifdef _HAVE_MPI_
+ 			MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+ 			#endif
+ 
+ 			if(my_rank==0){  
+-				if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns in " << i << "th matrix of matrix array");
++				if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns in " << i << "th matrix of matrix array");
+ 			}
+ 			#ifdef _HAVE_MPI_
+ 			MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
+@@ -845,7 +845,7 @@
+ 
+ 				/*Read matrix on node 0, then broadcast: */
+ 				if(my_rank==0){  
+-					if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
++					if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
+ 				}
+ 
+ 				#ifdef _HAVE_MPI_
+@@ -911,7 +911,7 @@
+ 			  break;
+ 			  }
+ 		default:
+-			  _error2_("Option of format " << code << " not supported yet");
++			  _error_("Option of format " << code << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers: */
+@@ -940,7 +940,7 @@
+ 		#ifdef _ISSM_DEBUG_
+ 		_assert_(dataenum<MaximumNumberOfEnums);
+ 		if(this->data[dataenum]){
+-			_error2_("Info: trying to fetch " << EnumToStringx(dataenum) << " but previous pointer has not been freed (DeleteData has not been called)");
++			_error_("Info: trying to fetch " << EnumToStringx(dataenum) << " but previous pointer has not been freed (DeleteData has not been called)");
+ 		}
+ 		#endif
+ 		/*}}}*/
+@@ -1140,7 +1140,7 @@
+ 
+ 			break; /*}}}*/
+ 		default: /*{{{*/
+-			_error2_("data code " << code << " not supported yet!");
++			_error_("data code " << code << " not supported yet!");
+ 			break;
+ 			/*}}}*/
+ 	}
+@@ -1231,7 +1231,7 @@
+ 	}
+ #ifdef _HAVE_MPI_
+ 	MPI_Bcast(&found,1,MPI_INT,0,MPI_COMM_WORLD); 
+-	if(!found)_error2_("could not find data with name" << " " << EnumToStringx(data_enum) << " ");
++	if(!found)_error_("could not find data with name" << " " << EnumToStringx(data_enum) << " ");
+ #endif
+ 
+ 	/*Broadcast code and vector type: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp	(revision 13036)
+@@ -128,7 +128,7 @@
+ 		}
+ 	}
+ 	if(found!=-1) analysis_counter=found;
+-	else _error2_("Could not find alias for analysis_type " << EnumToStringx(configuration_type) << " in list of FemModel analyses");
++	else _error_("Could not find alias for analysis_type " << EnumToStringx(configuration_type) << " in list of FemModel analyses");
+ 
+ 	/*Now, plug analysis_counter and analysis_type inside the parameters: */
+ 	this->parameters->SetParam(analysis_counter,AnalysisCounterEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.cpp	(revision 13036)
+@@ -24,7 +24,7 @@
+ {
+ 
+ #ifndef _HAVE_SCOTCH_ //only works if scotch library has been compiled in.
+-	_error2_("Scotch not available! Cannot carry out Scotch partitioning!");
++	_error_("Scotch not available! Cannot carry out Scotch partitioning!");
+ 	#else
+ 
+ 	int     argcm;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp	(revision 13036)
+@@ -33,10 +33,10 @@
+ 	FetchData(&y,&test2,YHANDLE);
+ 
+ 	/*Check inputs*/
+-	if(nels<0) _error2_("Number of elements must be positive, check index number of lines");
+-	if(nods<0) _error2_("Number of nods must be positive, check x and y sizes");
+-	if(test1!=3) _error2_("index should have 3 columns");
+-	if(test2!=nods) _error2_("x and y do not have the same length");
++	if(nels<0) _error_("Number of elements must be positive, check index number of lines");
++	if(nods<0) _error_("Number of nods must be positive, check x and y sizes");
++	if(test1!=3) _error_("index should have 3 columns");
++	if(test2!=nods) _error_("x and y do not have the same length");
+ 
+ 	/* Run core computations: */
+ 	BamgConvertMeshx(bamgmesh,bamggeom,index,x,y,nods,nels);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp	(revision 13036)
+@@ -30,10 +30,10 @@
+ 
+ 	/*checks on arguments on the matlab side: */
+ 	if(nlhs>NLHS){
+-		KMLOverlayUsage(); _error2_("KMLOverlay usage error");
++		KMLOverlayUsage(); _error_("KMLOverlay usage error");
+ 	}
+ 	if(nrhs<NRHS){
+-		KMLOverlayUsage(); _error2_("KMLOverlay usage error");
++		KMLOverlayUsage(); _error_("KMLOverlay usage error");
+ 	}
+ 
+ 	/*Input datasets: */
+@@ -50,9 +50,9 @@
+ 	if (verbose) _printLine_("  dzip=" << dzip);
+ 
+ 	/*some checks*/
+-	if (nlat !=2) _error2_("Latitudinal axes \"lataxis\" require two double values, not " << nlat << ".");
+-	if (nlong!=2) _error2_("Longitudinal axes \"longaxis\" require two double values, not " << nlong << ".");
+-	if (!nimages) _error2_("No image files provided.");
++	if (nlat !=2) _error_("Latitudinal axes \"lataxis\" require two double values, not " << nlat << ".");
++	if (nlong!=2) _error_("Longitudinal axes \"longaxis\" require two double values, not " << nlong << ".");
++	if (!nimages) _error_("No image files provided.");
+ 
+ 	if ((int)dzip){
+ 		filkmz=filkml;
+@@ -89,7 +89,7 @@
+ 		if (verbose) _printLine_("Zipping file \"" << filkmz << "\".");
+ 		if (verbose) _printLine_(czip);
+ 
+-		if (mexEvalString(czip)) _error2_("Error zipping file \"" << filkmz << "\".");
++		if (mexEvalString(czip)) _error_("Error zipping file \"" << filkmz << "\".");
+ 		xfree((void**)&czip);
+ 		xfree((void**)&filkmz);
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp	(revision 13036)
+@@ -53,7 +53,7 @@
+ 	/*Fetch inputs: */
+ 	//index
+ 	FetchData(&double_index,&nel,&dummy,INDEX);
+-	if(dummy!=3 && dummy!=6)_error2_("element triangulation should be of 3 or 6 column width!");
++	if(dummy!=3 && dummy!=6)_error_("element triangulation should be of 3 or 6 column width!");
+ 	index=(int*)xmalloc(nel*3*sizeof(int));
+ 	for(i=0;i<nel;i++){
+ 		for(j=0;j<3;j++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 13036)
+@@ -75,10 +75,10 @@
+ 
+ 	/*some checks*/
+ 	if (x_data_rows!=y_data_rows || x_data_rows!=z_data_rows){
+-		_error2_("vectors x, y and z should have the same length!");
++		_error_("vectors x, y and z should have the same length!");
+ 	}
+ 	if (x_prime_rows!=y_prime_rows || x_prime_rows!=z_prime_rows){
+-		_error2_("vectors x_prime, y_prime and z_prime should have the same length!");
++		_error_("vectors x_prime, y_prime and z_prime should have the same length!");
+ 	}
+ 	/*get number of elements and number of nodes in the data*/
+ 	nels_data=index_data_rows;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp	(revision 13036)
+@@ -24,10 +24,10 @@
+ 
+ 	/*checks on arguments on the matlab side: */
+ 	if (nlhs > NLHS) {
+-		Ll2xyUsage(); _error2_("Ll2xy usage error");
++		Ll2xyUsage(); _error_("Ll2xy usage error");
+ 	}
+ 	if (nrhs < NRHS) {
+-		Ll2xyUsage(); _error2_("Ll2xy usage error");
++		Ll2xyUsage(); _error_("Ll2xy usage error");
+ 	}
+ 
+ 	/*Input datasets: */
+@@ -46,11 +46,11 @@
+ 
+ 	/*some checks*/
+ 	if (verbose) _printLine_("Checking inputs:");
+-	if (nlat != nlon){_error2_("Must have same number of lat[" << nlat << "] and lon[" << nlon << "] coordinates.");}
++	if (nlat != nlon){_error_("Must have same number of lat[" << nlat << "] and lon[" << nlon << "] coordinates.");}
+ 	else                ncoord=nlat;
+-	if (sgn != +1 && sgn != -1) _error2_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");
+-	if (fabs(cm)      > 180.) _error2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");
+-	if (sp < 0. || sp >  90.) _error2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");
++	if (sgn != +1 && sgn != -1) _error_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");
++	if (fabs(cm)      > 180.) _error_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");
++	if (sp < 0. || sp >  90.) _error_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");
+ 
+ 	x=(double*)mxMalloc(ncoord*sizeof(double));
+ 	y=(double*)mxMalloc(ncoord*sizeof(double));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 13036)
+@@ -45,7 +45,7 @@
+ 	//CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InterpFromGridToMeshUsage);
+ 	if((nlhs!=NLHS) || (nrhs!=6 && nrhs!=7)){
+ 		InterpFromGridToMeshUsage();
+-		_error2_("usage. See above");
++		_error_("usage. See above");
+ 	}
+ 
+ 	/*Input datasets: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp	(revision 13036)
+@@ -44,10 +44,10 @@
+ 
+ 	/*checks on arguments on the matlab side: */
+ 	if (nlhs > NLHS) {
+-		KMLFileReadUsage(); _error2_("KMLFileRead usage error");
++		KMLFileReadUsage(); _error_("KMLFileRead usage error");
+ 	}
+ 	if (nrhs < NRHS) {
+-		KMLFileReadUsage(); _error2_("KMLFileRead usage error");
++		KMLFileReadUsage(); _error_("KMLFileRead usage error");
+ 	}
+ 
+ 	/*Input datasets: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp	(revision 13036)
+@@ -24,7 +24,7 @@
+ 	int     iret=0;
+ 
+ 	#ifndef _HAVE_SHAPELIB_ //only works if shapelib library has been compiled in.
+-	_error2_("Shapelib not available! Cannot carry out shp file translation!");
++	_error_("Shapelib not available! Cannot carry out shp file translation!");
+ 	#endif
+ 
+ 	/*Boot module: */
+@@ -32,10 +32,10 @@
+ 
+ 	/*checks on arguments on the matlab side: */
+ 	if (nlhs > NLHS) {
+-		Shp2KmlUsage(); _error2_("Shp2Kml usage error");
++		Shp2KmlUsage(); _error_("Shp2Kml usage error");
+ 	}
+ 	if (nrhs < NRHS) {
+-		Shp2KmlUsage(); _error2_("Shp2Kml usage error");
++		Shp2KmlUsage(); _error_("Shp2Kml usage error");
+ 	}
+ 
+ 	/*Input datasets: */
+@@ -53,9 +53,9 @@
+ 	}
+ 
+ 	/*some checks*/
+-	if (sgn < -1 || sgn > +1) _error2_("Hemisphere sgn=" << sgn << " must be +1 (north), -1 (south), or 0 (no translation).");
+-	if (fabs(cm)      > 180.) _error2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");
+-	if (sp < 0. || sp >  90.) _error2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");
++	if (sgn < -1 || sgn > +1) _error_("Hemisphere sgn=" << sgn << " must be +1 (north), -1 (south), or 0 (no translation).");
++	if (fabs(cm)      > 180.) _error_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");
++	if (sp < 0. || sp >  90.) _error_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");
+ 
+ 	/* Run core computations: */
+ 	if (options->GetOption("central_meridian") && options->GetOption("standard_parallel"))
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 13036)
+@@ -65,7 +65,7 @@
+ 	if (!(  (nlhs==6) || (nrhs==5))){
+ 		mexPrintf("   %s format error.\n", __FUNCT__);
+ 		TriMeshProcessRiftsUsage();
+-		_error2_("bad usage");
++		_error_("bad usage");
+ 	}
+ 
+ 	/*Fetch index_in: */
+@@ -80,7 +80,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("first argument should be the element list");
++		_error_("first argument should be the element list");
+ 	}
+ 
+ 	/*Fetch x_in: */
+@@ -93,7 +93,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("second argument should be the x corrdinate list");
++		_error_("second argument should be the x corrdinate list");
+ 	}
+ 
+ 	/*Fetch y_in: */
+@@ -105,7 +105,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("third argument should be the y corrdinate list");
++		_error_("third argument should be the y corrdinate list");
+ 	}	
+ 
+ 	/*Fetch segments_in: */
+@@ -120,7 +120,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("fourth argument should be the segments list");
++		_error_("fourth argument should be the segments list");
+ 	}
+ 
+ 	/*Fetch segment markers: */
+@@ -132,7 +132,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("fourth argument should be the segmentmarkers list");
++		_error_("fourth argument should be the segmentmarkers list");
+ 	}
+ 
+ 	/*First, do some fixing on the existing mesh: we do not want any element belonging entirely to the segment list (ie: 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp	(revision 13036)
+@@ -24,10 +24,10 @@
+ 
+ 	/*checks on arguments on the matlab side: */
+ 	if (nlhs > NLHS) {
+-		Exp2KmlUsage(); _error2_("Exp2Kml usage error");
++		Exp2KmlUsage(); _error_("Exp2Kml usage error");
+ 	}
+ 	if (nrhs < NRHS) {
+-		Exp2KmlUsage(); _error2_("Exp2Kml usage error");
++		Exp2KmlUsage(); _error_("Exp2Kml usage error");
+ 	}
+ 
+ 	/*Input datasets: */
+@@ -48,9 +48,9 @@
+ 	}
+ 
+ 	/*some checks*/
+-	if (sgn !=+1 && sgn !=-1) _error2_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");
+-	if (fabs(cm)      > 180.) _error2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");
+-	if (sp < 0. || sp >  90.) _error2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");
++	if (sgn !=+1 && sgn !=-1) _error_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");
++	if (fabs(cm)      > 180.) _error_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");
++	if (sp < 0. || sp >  90.) _error_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");
+ 
+ 	/* Run core computations: */
+ 	if (options->GetOption("central_meridian") && options->GetOption("standard_parallel"))
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp	(revision 13036)
+@@ -21,10 +21,10 @@
+ 
+ 	/*checks on arguments on the matlab side: */
+ 	if (nlhs > NLHS) {
+-		Kml2ExpUsage(); _error2_("Kml2Exp usage error");
++		Kml2ExpUsage(); _error_("Kml2Exp usage error");
+ 	}
+ 	if (nrhs < NRHS) {
+-		Kml2ExpUsage(); _error2_("Kml2Exp usage error");
++		Kml2ExpUsage(); _error_("Kml2Exp usage error");
+ 	}
+ 
+ 	/*Input datasets: */
+@@ -42,9 +42,9 @@
+ 	}
+ 
+ 	/*some checks*/
+-	if (sgn !=+1 && sgn!= -1) _error2_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");
+-	if (fabs(cm)      > 180.) _error2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");
+-	if (sp < 0. || sp >  90.) _error2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");
++	if (sgn !=+1 && sgn!= -1) _error_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");
++	if (fabs(cm)      > 180.) _error_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");
++	if (sp < 0. || sp >  90.) _error_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");
+ 
+ 	/* Run core computations: */
+ 	if (options->GetOption("central_meridian") && options->GetOption("standard_parallel"))
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp	(revision 13036)
+@@ -25,13 +25,13 @@
+ 
+ 	/*Fetch required fields*/
+ 	FetchData(&numberofelements,mxGetAssignedField(MODEL,0,"numberofelements"));
+-	if(numberofelements<=0) _error2_("No elements found in the model");
++	if(numberofelements<=0) _error_("No elements found in the model");
+ 	FetchData(&elements,&M,&N,mxGetAssignedField(MODEL,0,"elements"));
+-	if(M!=numberofelements || N!=3) _error2_("Field 'elements' should be of size [md.numberofelements 3]");
++	if(M!=numberofelements || N!=3) _error_("Field 'elements' should be of size [md.numberofelements 3]");
+ 	FetchData(&elementonwater,&M,&N,mxGetAssignedField(MODEL,0,"elementonwater"));
+-	if(M!=numberofelements || N!=1) _error2_("Field 'elementonwater' should be of size [md.numberofelements 1]");
++	if(M!=numberofelements || N!=1) _error_("Field 'elementonwater' should be of size [md.numberofelements 1]");
+ 	FetchData(&elementconnectivity,&M,&N,mxGetAssignedField(MODEL,0,"elementconnectivity"));
+-	if(M!=numberofelements || N!=3) _error2_("Field 'elementconnectivity' should be of size [md.numberofelements 3]");
++	if(M!=numberofelements || N!=3) _error_("Field 'elementconnectivity' should be of size [md.numberofelements 3]");
+ 
+ 	/*Allocate and initialize all variables*/
+ 	numberofsegments=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13036)
+@@ -68,11 +68,11 @@
+ 	/*checks on arguments on the matlab side: */
+ 	if(nlhs!=NLHS){
+ 		InterpFromMesh2dUsage();
+-		_error2_("InterpFromMeshToMesh2dUsage usage error");
++		_error_("InterpFromMeshToMesh2dUsage usage error");
+ 	}
+ 	if((nrhs!=6) && (nrhs!=7) && (nrhs!=8)){
+ 		InterpFromMesh2dUsage();
+-		_error2_("InterpFromMeshToMesh2dUsage usage error");
++		_error_("InterpFromMeshToMesh2dUsage usage error");
+ 	}
+ 
+ 	/*Input datasets: */
+@@ -130,10 +130,10 @@
+ 
+ 	/*some checks*/
+ 	if (x_data_rows!=y_data_rows){
+-		_error2_("vectors x and y should have the same length!");
++		_error_("vectors x and y should have the same length!");
+ 	}
+ 	if (x_prime_rows!=y_prime_rows){
+-		_error2_("vectors x_prime and y_prime should have the same length!");
++		_error_("vectors x_prime and y_prime should have the same length!");
+ 	}
+ 	
+ 	/*get number of elements and number of nodes in the data*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.cpp	(revision 13036)
+@@ -21,15 +21,15 @@
+ 
+ 	/*checks on arguments on the matlab side: */
+ 	if (nrhs<NRHS || nlhs>NLHS){
+-		KrigingUsage(); _error2_("Kriging usage error");
++		KrigingUsage(); _error_("Kriging usage error");
+ 	}
+ 
+ 	/*Fetch inputs: */
+ 	FetchData(&x,&n_obs,X);
+-	FetchData(&y,&N,Y);                       if(n_obs!=N) _error2_("x and y should have the same size");
+-	FetchData(&observations,&N,OBSERVATIONS); if(n_obs!=N) _error2_("x and observations should have the same size");
++	FetchData(&y,&N,Y);                       if(n_obs!=N) _error_("x and y should have the same size");
++	FetchData(&observations,&N,OBSERVATIONS); if(n_obs!=N) _error_("x and observations should have the same size");
+ 	FetchData(&x_interp,&M_interp,&N_interp,XINTERP);
+-	FetchData(&y_interp,&M,&N,YINTERP);       if(N!=N_interp || M!=M_interp) _error2_("x_interp and y_interp should have the same size");
++	FetchData(&y_interp,&M,&N,YINTERP);       if(N!=N_interp || M!=M_interp) _error_("x_interp and y_interp should have the same size");
+ 	FetchData(&options,NRHS,nrhs,prhs);
+ 
+ 	/*Call x layer*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.cpp	(revision 13036)
+@@ -31,9 +31,9 @@
+ 	FetchData(&y,&y_rows,&y_cols,YHANDLE);
+ 
+ 	/*Check inputs*/
+-	if(y_rows!=nods)         _error2_("x and y do not have the same length");
+-	if(x_cols>1 || y_cols>1) _error2_("x and y should have only one column");
+-	if(nods<3)               _error2_("At least 3 points are required");
++	if(y_rows!=nods)         _error_("x and y do not have the same length");
++	if(x_cols>1 || y_cols>1) _error_("x and y should have only one column");
++	if(nods<3)               _error_("At least 3 points are required");
+ 
+ 	/* Run core computations: */
+ 	if (verbose) _printLine_("Call core");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp	(revision 13036)
+@@ -27,22 +27,22 @@
+ 	#ifdef _HAVE_MATLAB_MODULES_
+ 	if(nlhs!=NLHS){
+ 		InterpFromMeshToMesh2dUsage();
+-		_error2_("InterpFromMeshToMesh2dUsage usage error");
++		_error_("InterpFromMeshToMesh2dUsage usage error");
+ 	}
+ 	#endif
+ 	/*check on input arguments: */
+ 	if(nrhs<NRHS){
+ 		InterpFromMeshToMesh2dUsage();
+-		_error2_("InterpFromMeshToMesh2dUsage usage error");
++		_error_("InterpFromMeshToMesh2dUsage usage error");
+ 	}
+ 
+ 	/*Fetch inputs: */
+-	FetchData(&index,&nels_data,&test,INDEX); if(test!=3) _error2_("index should have 3 columns");
+-	FetchData(&x_data,&nods_data,X);          if(nods_data<3) _error2_("there should be at least three points");
+-	FetchData(&y_data,&test,Y);               if(test!=nods_data) _error2_("vectors x and y should have the same length");
+-	FetchData(&data,&M_data,&N_data,DATA);    if(M_data*N_data<1) _error2_("data is empty");
+-	FetchData(&x_interp,&N_interp,XINTERP);   if(N_interp<1) _error2_("no interpolation requested");
+-	FetchData(&y_interp,&test,YINTERP);       if(test!=N_interp) _error2_("vectors x_interp and y_interp should have the same length");
++	FetchData(&index,&nels_data,&test,INDEX); if(test!=3) _error_("index should have 3 columns");
++	FetchData(&x_data,&nods_data,X);          if(nods_data<3) _error_("there should be at least three points");
++	FetchData(&y_data,&test,Y);               if(test!=nods_data) _error_("vectors x and y should have the same length");
++	FetchData(&data,&M_data,&N_data,DATA);    if(M_data*N_data<1) _error_("data is empty");
++	FetchData(&x_interp,&N_interp,XINTERP);   if(N_interp<1) _error_("no interpolation requested");
++	FetchData(&y_interp,&test,YINTERP);       if(test!=N_interp) _error_("vectors x_interp and y_interp should have the same length");
+ 	FetchData(&options,NRHS,nrhs,ARGUMENTS);
+ 
+ 	/*Run core computations*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13036)
+@@ -46,13 +46,13 @@
+ 	#ifdef _HAVE_MATLAB_MODULES_
+ 	if(nlhs!=1 && nlhs!=2){
+ 		ContourToMeshUsage();
+-		_error2_("usage. See above");
++		_error_("usage. See above");
+ 	}
+ 	#endif
+ 	/*check on input arguments: */
+ 	if(nrhs!=NRHS){
+ 		ContourToMeshUsage();
+-		_error2_("usage. See above");
++		_error_("usage. See above");
+ 	}
+ 
+ 
+@@ -81,7 +81,7 @@
+ 		WriteData(PLHS0,in_nod);
+ 		WriteData(PLHS1,in_elem);
+ 	}
+-	else _error2_("wrong interpolation type");
++	else _error_("wrong interpolation type");
+ 
+ 	/*end module: */
+ 	MODULEEND();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp	(revision 13036)
+@@ -23,10 +23,10 @@
+ 
+ 	/*checks on arguments on the matlab side: */
+ 	if (nlhs > NLHS) {
+-		Xy2llUsage(); _error2_("Xy2ll usage error");
++		Xy2llUsage(); _error_("Xy2ll usage error");
+ 	}
+ 	if (nrhs < NRHS) {
+-		Xy2llUsage(); _error2_("Xy2ll usage error");
++		Xy2llUsage(); _error_("Xy2ll usage error");
+ 	}
+ 
+ 	/*Input datasets: */
+@@ -44,11 +44,11 @@
+ 	}
+ 
+ 	/*some checks*/
+-	if   (nx != ny){_error2_("Must have same number of x[" << nx << "] and y[" << ny << "] coordinates.");}
++	if   (nx != ny){_error_("Must have same number of x[" << nx << "] and y[" << ny << "] coordinates.");}
+ 	else            ncoord=nx;
+-	if (sgn != +1 && sgn != -1) _error2_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");
+-	if (fabs(cm)      > 180.) _error2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");
+-	if (sp < 0. || sp >  90.) _error2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");
++	if (sgn != +1 && sgn != -1) _error_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");
++	if (fabs(cm)      > 180.) _error_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");
++	if (sp < 0. || sp >  90.) _error_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");
+ 
+ 	lat=(double*)mxMalloc(ncoord*sizeof(double));
+ 	lon=(double*)mxMalloc(ncoord*sizeof(double));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 13036)
+@@ -39,10 +39,10 @@
+ 
+ 	/*checks on arguments on the matlab side: */
+ 	if (nlhs > NLHS) {
+-		KMLMeshWriteUsage(); _error2_("KMLMeshWrite usage error");
++		KMLMeshWriteUsage(); _error_("KMLMeshWrite usage error");
+ 	}
+ 	if (nrhs < NRHS) {
+-		KMLMeshWriteUsage(); _error2_("KMLMeshWrite usage error");
++		KMLMeshWriteUsage(); _error_("KMLMeshWrite usage error");
+ 	}
+ 
+ 	/*Input datasets: */
+@@ -86,17 +86,17 @@
+ 	if(part) for (i=0; i<lprt; i++) if (part[i]+1 > nparts) nparts=part[i]+1;
+ 
+ 	if (nodecon && (mncon != nnodes))
+-	  {_error2_("Nodal connectivity table, if supplied, must be supplied for all nodes.");}
++	  {_error_("Nodal connectivity table, if supplied, must be supplied for all nodes.");}
+ 	else if (!nodecon)
+ 		mncon=nnodes;
+ 	if ((llat != nnodes) || (llng != nnodes) || (llat != llng))
+-		_error2_("Latitude and longitude vectors must be supplied for all nodes.");
++		_error_("Latitude and longitude vectors must be supplied for all nodes.");
+ 	if (part && (lprt != nnodes))
+-		_error2_("Partitioning vector, if supplied, must be supplied for all nodes.");
++		_error_("Partitioning vector, if supplied, must be supplied for all nodes.");
+ 	if (data && !((mdata == nnodes) || (mdata == melem)))
+-		_error2_("Data matrix, if supplied, must be supplied for all nodes or all elements.");
++		_error_("Data matrix, if supplied, must be supplied for all nodes or all elements.");
+ 	if (cmap && (ncmap != 3))
+-		_error2_("Colormap matrix, if supplied, must have three columns for rgb.");
++		_error_("Colormap matrix, if supplied, must have three columns for rgb.");
+ 	if (!strlen(filnam))
+ 		strcpy(filnam,"stdout");
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp	(revision 13035)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp	(revision 13036)
+@@ -41,7 +41,7 @@
+    double *doubleassignment = NULL; /*holds assignment, in double format, to return to matlab */
+ 
+ 	#ifndef _HAVE_CHACO_ //only works if dakota library has been compiled in.
+-	_error2_("Chaco not available! Cannot carry out Chaco partitioning!");
++	_error_("Chaco not available! Cannot carry out Chaco partitioning!");
+ 	#endif
+ 
+ 	/*Boot module: */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13036-13037.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13036-13037.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13036-13037.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13036)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13037)
+@@ -74,7 +74,7 @@
+ 	xdelete(&XL);
+ 	xdelete(&XU);
+ 
+-	user.J=(double*)xcalloc((maxiter+5),sizeof(double));
++	user.J=xNewZeroInit<double>(maxiter+5);
+ 	user.femmodel=femmodel;
+ 	TaoSetObjectiveAndGradientRoutine(tao,FormFunctionGradient,(void*)&user); 
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13037-13038.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13037-13038.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13037-13038.diff	(revision 13394)
@@ -0,0 +1,212 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13037)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13038)
+@@ -67,10 +67,10 @@
+ 	}
+ 
+ 	numcontours=mxGetNumberOfElements(matlabstructure);
+-	contours=(Contour**)xmalloc(numcontours*sizeof(Contour*));
++	contours=xNew<Contour*>(numcontours);
+ 	for(i=0;i<numcontours;i++){
+ 		//allocate
+-		contouri=(Contour*)xmalloc(sizeof(Contour));
++		contouri=xNew<Contour>(1);
+ 		//retrieve dimension of this contour.
+ 		contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods"));
+ 		//set pointers.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp	(revision 13037)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp	(revision 13038)
+@@ -54,7 +54,7 @@
+ 	//index
+ 	FetchData(&double_index,&nel,&dummy,INDEX);
+ 	if(dummy!=3 && dummy!=6)_error_("element triangulation should be of 3 or 6 column width!");
+-	index=(int*)xmalloc(nel*3*sizeof(int));
++	index=xNew<int>(nel*3);
+ 	for(i=0;i<nel;i++){
+ 		for(j=0;j<3;j++){
+ 			*(index+3*i+j)=(int)*(double_index+dummy*i+j)-1; //"C" style indexing
+@@ -66,10 +66,10 @@
+ 
+ 	//contours
+ 	numcontours=mxGetNumberOfElements(matlabstructure);
+-	contours=(Contour**)xmalloc(numcontours*sizeof(Contour*));
++	contours=xNew<Contour*>(numcontours);
+ 	for(i=0;i<numcontours;i++){
+ 		//allocate
+-		contouri=(Contour*)xmalloc(sizeof(Contour));
++		contouri=xNew<Contour>(1);
+ 		//retrieve dimension of this contour.
+ 		contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods"));
+ 		//set pointers.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 13037)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 13038)
+@@ -72,7 +72,7 @@
+ 	if(mxIsDouble(prhs[0])){
+ 		nel=mxGetM(prhs[0]);
+ 		tindex_in=mxGetPr(prhs[0]);
+-		index_in=(double*)xmalloc(nel*3*sizeof(double));
++		index_in=xNew<double>(nel*3);
+ 		for (i=0;i<nel;i++){
+ 			for (j=0;j<3;j++){
+ 				*(index_in+3*i+j)=*(tindex_in+nel*j+i);
+@@ -87,7 +87,7 @@
+ 	if(mxIsDouble(prhs[1])){
+ 		nods=mxGetM(prhs[1]);
+ 		x_inm=mxGetPr(prhs[1]);
+-		x_in=(double*)xmalloc(nods*sizeof(double));
++		x_in=xNew<double>(nods);
+ 		for (i=0;i<nods;i++){
+ 			x_in[i]=x_inm[i];
+ 		}
+@@ -99,7 +99,7 @@
+ 	/*Fetch y_in: */
+ 	if(mxIsDouble(prhs[2])){
+ 		y_inm=mxGetPr(prhs[2]);
+-		y_in=(double*)xmalloc(nods*sizeof(double));
++		y_in=xNew<double>(nods);
+ 		for (i=0;i<nods;i++){
+ 			y_in[i]=y_inm[i];
+ 		}
+@@ -112,7 +112,7 @@
+ 	if(mxIsDouble(prhs[3])){
+ 		num_seg=mxGetM(prhs[3]);
+ 		tsegments_in=mxGetPr(prhs[3]);
+-		segments_in=(double*)xmalloc(num_seg*3*sizeof(double));
++		segments_in=xNew<double>(num_seg*3);
+ 		for (i=0;i<num_seg;i++){
+ 			for (j=0;j<3;j++){
+ 				*(segments_in+3*i+j)=*(tsegments_in+num_seg*j+i);
+@@ -126,7 +126,7 @@
+ 	/*Fetch segment markers: */
+ 	if(mxIsDouble(prhs[4])){
+ 		tsegmentmarkers_in=mxGetPr(prhs[4]);
+-		segmentmarkers_in=(double*)xmalloc(num_seg*sizeof(double));
++		segmentmarkers_in=xNew<double>(num_seg);
+ 		for (i=0;i<num_seg;i++){
+ 			segmentmarkers_in[i]=tsegmentmarkers_in[i];
+ 		}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp	(revision 13037)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp	(revision 13038)
+@@ -35,7 +35,7 @@
+ 
+ 	/*Allocate and initialize all variables*/
+ 	numberofsegments=0;
+-	front=(int*)xmalloc(3*numberofelements*4*sizeof(int));
++	front=xNew<int>(3*numberofelements*4);
+ 
+ 	/*Loop over all elements on water*/
+ 	for(i=0;i<numberofelements;i++){
+@@ -80,7 +80,7 @@
+ 
+ 	/*Now that we know how many segments there is we can allocate the final matrix*/
+ 	if(numberofsegments){
+-		front2=(double*)xmalloc(4*numberofsegments*sizeof(double));
++		front2=xNew<double>(4*numberofsegments);
+ 		for(i=0;i<4*numberofsegments;i++) front2[i]=(double)front[i];
+ 	}
+ 	xfree((void**)&front);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.cpp	(revision 13037)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.cpp	(revision 13038)
+@@ -73,12 +73,12 @@
+ 		numberofelements2d,numberofvertices2d,elements2d,numberoflayers,elements_width,dim,numareas);
+ 
+ 	/*Post process node_partitioning and element_partitioning to be in double format. Metis needed them in int* format: */
+-	element_partitioning=(double*)xmalloc(numberofelements*sizeof(double));
++	element_partitioning=xNew<double>(numberofelements);
+ 	for (i=0;i<numberofelements;i++){
+ 		element_partitioning[i]=(double)int_element_partitioning[i]+1; //Metis indexing from 0, matlab from 1.
+ 	}
+ 	
+-	node_partitioning=(double*)xmalloc(numberofvertices*sizeof(double));
++	node_partitioning=xNew<double>(numberofvertices);
+ 	for (i=0;i<numberofvertices;i++){
+ 		node_partitioning[i]=(double)int_node_partitioning[i]+1; //Metis indexing from 0, matlab from 1.
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13037)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13038)
+@@ -99,10 +99,10 @@
+ 
+ 		/*contours: */
+ 		numcontours=mxGetNumberOfElements(matlabstructure);
+-		contours=(Contour**)xmalloc(numcontours*sizeof(Contour*));
++		contours=xNew<Contour*>(numcontours);
+ 		for(i=0;i<numcontours;i++){
+ 			//allocate
+-			contouri=(Contour*)xmalloc(sizeof(Contour));
++			contouri=xNew<Contour>(1);
+ 			//retrieve dimension of this contour.
+ 			contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods"));
+ 			//set pointers.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 13037)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 13038)
+@@ -54,7 +54,7 @@
+ 			notesi=mxGetCell(NOTES,nindex);
+ 			if (notesi && mxIsChar(notesi) && mxGetNumberOfElements(notesi)) {
+ 				if (!notes) {
+-					notes=(char *) xmalloc((mxGetNumberOfElements(notesi)+1)*sizeof(char));
++					notes=xNew<char>(mxGetNumberOfElements(notesi)+1);
+ 					mxGetString(notesi,notes,mxGetNumberOfElements(notesi)+1);
+ 				}
+ 				else {
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp	(revision 13037)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp	(revision 13038)
+@@ -53,16 +53,16 @@
+ 	/*Fetch adjacency matrix: */
+ 	nvtxs = mxGetN(A_IN);
+ 	mwstart = mxGetJc(A_IN);
+-	start=(int*)xmalloc((nvtxs+1)*sizeof(int));
++	start=xNew<int>((nvtxs+1));
+ 	for (i=0; i<nvtxs+1;i++)start[i]=(int)mwstart[i];
+ 
+ 	mwadjacency = mxGetIr(A_IN);
+-	adjacency = (int*)xmalloc(mxGetNzmax(A_IN)*sizeof(int));
++	adjacency = xNew<int>(mxGetNzmax(A_IN));
+ 	for (i=0; i<mxGetNzmax(A_IN); i++) adjacency[i]= (int)mwadjacency[i];
+ 
+ 	nedges = start[nvtxs];
+ 	if(!mxIsEmpty(EWGTS_IN)){
+-		ewgts = (float*)xcalloc(nedges, sizeof(float));
++		ewgts = xNewZeroInit<float>(nedges);
+ 		doublepointer=mxGetPr(A_IN);
+ 		for (i = 0; i < nedges; i++)ewgts[i] = (float)doublepointer[i];
+ 	}
+@@ -76,7 +76,7 @@
+ 	FetchData(&in_options,&nterms,OPTNS_IN); 
+ 	for (i=0;i<(nterms<10?nterms:10);i++) options[i]=in_options[i]; //copy in_options into default options
+ 	FetchData(&npart,NPARTS_IN); 
+-	nparts=(int*)xmalloc(sizeof(int)); nparts[0]=npart; //weird Chacox interface ain't it?
++	nparts=xNew<int>(1); nparts[0]=npart; //weird Chacox interface ain't it?
+ 	FetchData(&goal,&nterms,GOAL_IN); 
+ 	
+ 	/*Some debugging print: {{{*/
+@@ -103,13 +103,13 @@
+ 	/*}}}*/
+ 	
+ 	/*Allocate output: */
+-	assignment = (short*)xcalloc(nvtxs, sizeof(short));
++	assignment = xNewZeroInit<short>(nvtxs);
+ 	
+     /*Call core: */
+ 	Chacox(nvtxs, start, adjacency, vwgts, ewgts, x, y, z, assignment, options, nparts, goal);
+ 
+     /*Output data: */
+-	doubleassignment=(double*)xmalloc(nvtxs*sizeof(double));
++	doubleassignment=xNew<double>(nvtxs);
+ 	for(i=0;i<nvtxs;i++) doubleassignment[i]=(double)assignment[i];
+ 	WriteData(ASSGN_OUT,doubleassignment,nvtxs);
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13038-13039.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13038-13039.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13038-13039.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 13038)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 13039)
+@@ -106,6 +106,8 @@
+ ENUM=0;
+ #Add header to pythonenum file{{{
+ cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.py
++from StringToEnum import StringToEnum
++
+ """
+ 
+    WARNING: DO NOT MODIFY THIS FILE
Index: /issm/oecreview/Archive/12678-13393/ISSM-13039-13040.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13039-13040.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13039-13040.diff	(revision 13394)
@@ -0,0 +1,311 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.py	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.py	(revision 13040)
+@@ -66,11 +66,11 @@
+ 		if (ThermalAnalysisEnum() not in analyses and EnthalpyAnalysisEnum() not in analyses) or (solution==TransientSolutionEnum() and not md.transient.isthermal):
+ 			return md
+ 
+-		md = checkfield(md,'thermal.stabilization','numel',1,'values',[0,1,2])
++		md = checkfield(md,'thermal.stabilization','numel',[1],'values',[0,1,2])
+ 		md = checkfield(md,'thermal.spctemperature','forcing',1)
+ 		if EnthalpyAnalysisEnum() in analyses and md.thermal.isenthalpy and md.mesh.dimension==3:
+ 			md = checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message',"spctemperature should be below the adjusted melting point")
+-			md = checkfield(md,'thermal.isenthalpy','numel',1,'values',[0,1])
++			md = checkfield(md,'thermal.isenthalpy','numel',[1],'values',[0,1])
+ 
+ 		return md
+ 	# }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/settings.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/settings.py	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/settings.py	(revision 13040)
+@@ -62,11 +62,11 @@
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+-		md = checkfield(md,'settings.io_gather','numel',1,'values',[0,1])
+-		md = checkfield(md,'settings.lowmem','numel',1,'values',[0,1])
+-		md = checkfield(md,'settings.results_as_patches','numel',1,'values',[0,1])
+-		md = checkfield(md,'settings.output_frequency','numel',1,'>=',1)
+-		md = checkfield(md,'settings.waitonlock','numel',1)
++		md = checkfield(md,'settings.io_gather','numel',[1],'values',[0,1])
++		md = checkfield(md,'settings.lowmem','numel',[1],'values',[0,1])
++		md = checkfield(md,'settings.results_as_patches','numel',[1],'values',[0,1])
++		md = checkfield(md,'settings.output_frequency','numel',[1],'>=',1)
++		md = checkfield(md,'settings.waitonlock','numel',[1])
+ 
+ 		return md
+ 	# }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.py	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.py	(revision 13040)
+@@ -54,10 +54,10 @@
+ 		if not solution==TransientSolutionEnum():
+ 			return md
+ 
+-		md = checkfield(md,'transient.isprognostic','numel',1,'values',[0,1])
+-		md = checkfield(md,'transient.isdiagnostic','numel',1,'values',[0,1])
+-		md = checkfield(md,'transient.isthermal','numel',1,'values',[0,1])
+-		md = checkfield(md,'transient.isgroundingline','numel',1,'values',[0,1])
++		md = checkfield(md,'transient.isprognostic','numel',[1],'values',[0,1])
++		md = checkfield(md,'transient.isdiagnostic','numel',[1],'values',[0,1])
++		md = checkfield(md,'transient.isthermal','numel',[1],'values',[0,1])
++		md = checkfield(md,'transient.isgroundingline','numel',[1],'values',[0,1])
+ 		md = checkfield(md,'transient.requested_outputs','size',[float('NaN')])
+ 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13040)
+@@ -86,7 +86,7 @@
+ 			md = checkfield(md,'inversion.tao','values',[0 1]);
+ 			md = checkfield(md,'inversion.incomplete_adjoint','values',[0 1]);
+ 			md = checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'Vx' 'Vy'});
+-			md = checkfield(md,'inversion.nsteps','numel',1,'>=',1);
++			md = checkfield(md,'inversion.nsteps','numel',[1],'>=',1);
+ 			md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
+ 			md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps 1]);
+ 			md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps num_costfunc],'values',[101:105 201 501:503 377:378]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.py	(revision 13040)
+@@ -79,8 +79,8 @@
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		if PrognosticAnalysisEnum() in analyses:
+-			md = checkfield(md,'surfaceforcings.ispdd','numel',1,'values',[0,1])
+-			md = checkfield(md,'surfaceforcings.issmbgradients','numel',1,'values',[0,1])
++			md = checkfield(md,'surfaceforcings.ispdd','numel',[1],'values',[0,1])
++			md = checkfield(md,'surfaceforcings.issmbgradients','numel',[1],'values',[0,1])
+ 			if   self.ispdd:
+ 				if not self.isdelta18o:
+ 					md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py	(revision 13040)
+@@ -39,7 +39,7 @@
+ 	#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+-		if (not self.riftstruct) or any(isnans(self.riftstruct)):
++		if (not self.riftstruct) or numpy.any(isnans(self.riftstruct)):
+ 			numrifts=0
+ 		else:
+ 			numrifts=len(self.riftstruct)
+@@ -49,12 +49,12 @@
+ 				md.checkmessage("models with rifts are only supported in 2d for now!")
+ 			if not isinstance(self.riftstruct,list):
+ 				md.checkmessage("rifts.riftstruct should be a structure!")
+-			if any(md.mesh.segmentmarkers>=2):
++			if numpy.any(md.mesh.segmentmarkers>=2):
+ 				#We have segments with rift markers, but no rift structure!
+ 				md.checkmessage("model should be processed for rifts (run meshprocessrifts)!")
+ 			md = checkfield(md,'rifts.riftstruct.fill','values',[WaterEnum(),AirEnum(),IceEnum(),MelangeEnum()])
+ 		else:
+-			if any(numpy.logical_not(isnans(self.riftstruct))):
++			if numpy.any(numpy.logical_not(isnans(self.riftstruct))):
+ 				md.checkmessage("riftstruct shoud be NaN since numrifts is 0!")
+ 
+ 		return md
+@@ -63,7 +63,7 @@
+ 	def marshall(self,fid):    # {{{
+ 
+ 		#Process rift info
+-		if (not self.riftstruct) or any(isnans(self.riftstruct)):
++		if (not self.riftstruct) or numpy.any(isnans(self.riftstruct)):
+ 			numrifts=0
+ 		else:
+ 			numrifts=len(self.riftstruct)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.m	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/thermal.m	(revision 13040)
+@@ -44,11 +44,11 @@
+ 			%Early return
+ 			if (~ismember(ThermalAnalysisEnum(),analyses) & ~ismember(EnthalpyAnalysisEnum(),analyses)) | (solution==TransientSolutionEnum() & md.transient.isthermal==0), return; end
+ 
+-			md = checkfield(md,'thermal.stabilization','numel',1,'values',[0 1 2]);
++			md = checkfield(md,'thermal.stabilization','numel',[1],'values',[0 1 2]);
+ 			md = checkfield(md,'thermal.spctemperature','forcing',1);
+ 			if (ismember(EnthalpyAnalysisEnum(),analyses) & md.thermal.isenthalpy & md.mesh.dimension==3),
+ 				md = checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message','spctemperature should be below the adjusted melting point');
+-				md = checkfield(md,'thermal.isenthalpy','numel',1,'values',[0 1]);
++				md = checkfield(md,'thermal.isenthalpy','numel',[1],'values',[0 1]);
+ 			end
+ 		end % }}}
+ 		function disp(obj) % {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/settings.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/settings.m	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/settings.m	(revision 13040)
+@@ -42,11 +42,11 @@
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+-			md = checkfield(md,'settings.io_gather','numel',1,'values',[0 1]);
+-			md = checkfield(md,'settings.lowmem','numel',1,'values',[0 1]);
+-			md = checkfield(md,'settings.results_as_patches','numel',1,'values',[0 1]);
+-			md = checkfield(md,'settings.output_frequency','numel',1,'>=',1);
+-			md = checkfield(md,'settings.waitonlock','numel',1);
++			md = checkfield(md,'settings.io_gather','numel',[1],'values',[0 1]);
++			md = checkfield(md,'settings.lowmem','numel',[1],'values',[0 1]);
++			md = checkfield(md,'settings.results_as_patches','numel',[1],'values',[0 1]);
++			md = checkfield(md,'settings.output_frequency','numel',[1],'>=',1);
++			md = checkfield(md,'settings.waitonlock','numel',[1]);
+ 
+ 		end % }}}
+ 		function disp(obj) % {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.py	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.py	(revision 13040)
+@@ -54,11 +54,11 @@
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+-		md = checkfield(md,'timestepping.start_time','numel',1,'NaN',1)
+-		md = checkfield(md,'timestepping.final_time','numel',1,'NaN',1)
+-		md = checkfield(md,'timestepping.time_step','numel',1,'>=',0,'NaN',1)
+-		md = checkfield(md,'timestepping.time_adapt','numel',1,'values',[0,1])
+-		md = checkfield(md,'timestepping.cfl_coefficient','numel',1,'>',0,'<=',1)
++		md = checkfield(md,'timestepping.start_time','numel',[1],'NaN',1)
++		md = checkfield(md,'timestepping.final_time','numel',[1],'NaN',1)
++		md = checkfield(md,'timestepping.time_step','numel',[1],'>=',0,'NaN',1)
++		md = checkfield(md,'timestepping.time_adapt','numel',[1],'values',[0,1])
++		md = checkfield(md,'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")
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13040)
+@@ -124,7 +124,7 @@
+ 		md = checkfield(md,'diagnostic.restol','size',[1],'>',0)
+ 		md = checkfield(md,'diagnostic.reltol','size',[1])
+ 		md = checkfield(md,'diagnostic.abstol','size',[1])
+-		md = checkfield(md,'diagnostic.isnewton','numel',1,'values',[0,1])
++		md = checkfield(md,'diagnostic.isnewton','numel',[1],'values',[0,1])
+ 		md = checkfield(md,'diagnostic.stokesreconditioning','size',[1,1],'NaN',1)
+ 		md = checkfield(md,'diagnostic.viscosity_overshoot','size',[1,1],'NaN',1)
+ 		if md.mesh.dimension==2:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.m	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/transient.m	(revision 13040)
+@@ -34,10 +34,10 @@
+ 			%Early return
+ 			if solution~=TransientSolutionEnum(), return; end
+ 
+-			md = checkfield(md,'transient.isprognostic','numel',1,'values',[0 1]);
+-			md = checkfield(md,'transient.isdiagnostic','numel',1,'values',[0 1]);
+-			md = checkfield(md,'transient.isthermal','numel',1,'values',[0 1]);
+-			md = checkfield(md,'transient.isgroundingline','numel',1,'values',[0 1]);
++			md = checkfield(md,'transient.isprognostic','numel',[1],'values',[0 1]);
++			md = checkfield(md,'transient.isdiagnostic','numel',[1],'values',[0 1]);
++			md = checkfield(md,'transient.isthermal','numel',[1],'values',[0 1]);
++			md = checkfield(md,'transient.isgroundingline','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'transient.requested_outputs','size',[NaN 1]);
+ 
+ 		end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.m	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/timestepping.m	(revision 13040)
+@@ -34,11 +34,11 @@
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+-			md = checkfield(md,'timestepping.start_time','numel',1,'NaN',1);
+-			md = checkfield(md,'timestepping.final_time','numel',1,'NaN',1);
+-			md = checkfield(md,'timestepping.time_step','numel',1,'>=',0,'NaN',1);
+-			md = checkfield(md,'timestepping.time_adapt','numel',1,'values',[0 1]);
+-			md = checkfield(md,'timestepping.cfl_coefficient','numel',1,'>',0,'<=',1);
++			md = checkfield(md,'timestepping.start_time','numel',[1],'NaN',1);
++			md = checkfield(md,'timestepping.final_time','numel',[1],'NaN',1);
++			md = checkfield(md,'timestepping.time_step','numel',[1],'>=',0,'NaN',1);
++			md = checkfield(md,'timestepping.time_adapt','numel',[1],'values',[0 1]);
++			md = checkfield(md,'timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1);
+ 			if obj.final_time-obj.start_time<0,
+ 				md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time');
+ 			end 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m	(revision 13040)
+@@ -44,8 +44,8 @@
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+ 			if ismember(PrognosticAnalysisEnum(),analyses),
+-				md = checkfield(md,'surfaceforcings.ispdd','numel',1,'values',[0 1]);
+-				md = checkfield(md,'surfaceforcings.issmbgradients','numel',1,'values',[0 1]);
++				md = checkfield(md,'surfaceforcings.ispdd','numel',[1],'values',[0 1]);
++				md = checkfield(md,'surfaceforcings.issmbgradients','numel',[1],'values',[0 1]);
+ 				if(obj.ispdd)
+ 					if(obj.isdelta18o==0)
+ 						md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.m	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.m	(revision 13040)
+@@ -75,7 +75,7 @@
+ 			md = checkfield(md,'diagnostic.restol','size',[1 1],'>',0,'NaN',1);
+ 			md = checkfield(md,'diagnostic.reltol','size',[1 1]);
+ 			md = checkfield(md,'diagnostic.abstol','size',[1 1]);
+-			md = checkfield(md,'diagnostic.isnewton','numel',1,'values',[0 1]);
++			md = checkfield(md,'diagnostic.isnewton','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'diagnostic.stokesreconditioning','size',[1 1],'NaN',1);
+ 			md = checkfield(md,'diagnostic.viscosity_overshoot','size',[1 1],'NaN',1);
+ 			if md.mesh.dimension==2,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13040)
+@@ -124,7 +124,7 @@
+ 		md = checkfield(md,'inversion.tao','values',[0,1])
+ 		md = checkfield(md,'inversion.incomplete_adjoint','values',[0,1])
+ 		md = checkfield(md,'inversion.control_parameters','cell',1,'values',['BalancethicknessThickeningRate','FrictionCoefficient','MaterialsRheologyBbar','Vx','Vy'])
+-		md = checkfield(md,'inversion.nsteps','numel',1,'>=',1)
++		md = checkfield(md,'inversion.nsteps','numel',[1],'>=',1)
+ 		md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps],'>=',0)
+ 		md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps])
+ 		md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps,num_costfunc],'values',[101,102,103,104,105,201,501,502,503,377,378])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 13040)
+@@ -53,9 +53,9 @@
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		if DiagnosticHorizAnalysisEnum() in analyses:
+-			md = checkfield(md,'flowequation.ismacayealpattyn','numel',1,'values',[0,1])
+-			md = checkfield(md,'flowequation.ishutter','numel',1,'values',[0,1])
+-			md = checkfield(md,'flowequation.isstokes','numel',1,'values',[0,1])
++			md = checkfield(md,'flowequation.ismacayealpattyn','numel',[1],'values',[0,1])
++			md = checkfield(md,'flowequation.ishutter','numel',[1],'values',[0,1])
++			md = checkfield(md,'flowequation.isstokes','numel',[1],'values',[0,1])
+ 			md = checkfield(md,'flowequation.bordermacayeal','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'flowequation.borderpattyn','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'flowequation.borderstokes','size',[md.mesh.numberofvertices],'values',[0,1])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m	(revision 13039)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m	(revision 13040)
+@@ -30,9 +30,9 @@
+ 
+ 			if ismember(DiagnosticHorizAnalysisEnum(),analyses),
+ 
+-				md = checkfield(md,'flowequation.ismacayealpattyn','numel',1,'values',[0 1]);
+-				md = checkfield(md,'flowequation.ishutter','numel',1,'values',[0 1]);
+-				md = checkfield(md,'flowequation.isstokes','numel',1,'values',[0 1]);
++				md = checkfield(md,'flowequation.ismacayealpattyn','numel',[1],'values',[0 1]);
++				md = checkfield(md,'flowequation.ishutter','numel',[1],'values',[0 1]);
++				md = checkfield(md,'flowequation.isstokes','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'flowequation.bordermacayeal','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 				md = checkfield(md,'flowequation.borderpattyn','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 				md = checkfield(md,'flowequation.borderstokes','size',[md.mesh.numberofvertices 1],'values',[0 1]);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13040-13041.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13040-13041.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13040-13041.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 13040)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 13041)
+@@ -167,7 +167,7 @@
+ 	      macro=$NAMEENUM()
+ 	"""
+ 
+-	return StringToEnum('$NAME')
++	return StringToEnum('$NAME')[0]
+ 
+ END
+ #}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13041-13042.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13041-13042.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13041-13042.diff	(revision 13394)
@@ -0,0 +1,39 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13041)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13042)
+@@ -6326,20 +6326,20 @@
+ 
+ 	/*Intermediaries */
+ 	int         i,j,ig,approximation;
+-	IssmDouble      Jdet;
+-	IssmDouble      viscosity, oldviscosity, newviscosity, viscosity_overshoot;
+-	IssmDouble      epsilon[5],oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+-	IssmDouble      epsilons[6]; //6 for stokes
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      B[3][numdof2d];
+-	IssmDouble      Bprime[3][numdof2d];
+-	IssmDouble      D[3][3]={0.0};            // material matrix, simple scalar matrix.
+-	IssmDouble      D_scalar;
+-	IssmDouble      Ke_gg_gaussian[numdof2d][numdof2d]; //stiffness matrix evaluated at the gaussian point.
+-	Tria*       tria=NULL;
+-	Penta*      pentabase=NULL;
+-	GaussPenta *gauss=NULL;
+-	GaussTria  *gauss_tria=NULL;
++	IssmDouble  Jdet;
++	IssmDouble  viscosity , oldviscosity, newviscosity, viscosity_overshoot;
++	IssmDouble  epsilon[5],oldepsilon[5];       /* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble  epsilons[6];                    //6 for stokes
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	IssmDouble  B[3][numdof2d];
++	IssmDouble  Bprime[3][numdof2d];
++	IssmDouble  D[3][3]= {0.0};                 // material matrix, simple scalar matrix.
++	IssmDouble  D_scalar;
++	IssmDouble  Ke_gg_gaussian[numdof2d][numdof2d];
++	Tria       *tria       = NULL;
++	Penta      *pentabase  = NULL;
++	GaussPenta *gauss      = NULL;
++	GaussTria  *gauss_tria = NULL;
+ 
+ 	/*Find penta on bed as this is a macayeal elements: */
+ 	pentabase=GetBasalElement();
Index: /issm/oecreview/Archive/12678-13393/ISSM-13042-13043.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13042-13043.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13042-13043.diff	(revision 13394)
@@ -0,0 +1,5135 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/flaimdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/flaimdir.m	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/flaimdir.m	(revision 13043)
+@@ -4,4 +4,4 @@
+ %   Usage:
+ %      FLAIM_DIR=flaimdir()
+ 
+-FLAIM_DIR=[issmdir '/externalpackages/flaim/install'];
++FLAIM_DIR=[issmdir() '/externalpackages/flaim/install'];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py	(revision 13043)
+@@ -12,6 +12,12 @@
+ 	   usage: scpout(host,path,packages)
+ 	"""
+ 
++	print "host=",host
++	print "path=",path
++	print "login=",login
++	print "port=",port
++	print "packages=",packages
++
+ 	#get hostname
+ 	hostname=socket.gethostname().lower().split('.')[0]
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.py	(revision 13043)
+@@ -4,7 +4,10 @@
+ from pairoptions import *
+ from process_solve_options import *
+ from EnumDefinitions import *
++from EnumToString import EnumToString
+ from ismodelselfconsistent import *
++from marshall import *
++from ispetsc import *
+ 
+ def solve(md,solutionenum,*args):
+ 	"""
+@@ -43,7 +46,7 @@
+ 
+ 	#check model consistency
+ 	print "checking model consistency"
+-	if solutionenum == FlaimSolutionEnum:
++	if solutionenum == FlaimSolutionEnum():
+ 		md.private.isconsistent=True
+ 		md.mesh.checkconsistency(md,solutionenum)
+ 		md.flaim.checkconsistency(md,solutionenum)
+@@ -62,9 +65,9 @@
+ 		md=preqmu(md,options)
+ 
+ 	#flaim analysis
+-	if options['solution_type'] == FlaimSolutionEnum:
++	if options['solution_type'] == FlaimSolutionEnum():
+ 		md=flaim_sol(md,options)
+-		md.private.solution=EnumToString(options['solution_type'])
++		[md.private.solution]=EnumToString(options['solution_type'])
+ 		return md
+ 
+ 	#Do we load results only?
+@@ -72,13 +75,13 @@
+ 		md=loadresultsfromcluster(md)
+ 		return md
+ 
+-	#Wite all input files
++	#Write all input files
+ 	marshall(md)                                           # bin file
+ 	md.solver.PetscFile(md.miscellaneous.name+'.petsc')    # petsc file
+ 	cluster.BuildQueueScript(md.miscellaneous.name,md.private.runtimename,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
+ 
+ 	#we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+-	if not ispetsc:
++	if not ispetsc():
+ 		print "PETSC support not included, running on 1 cpu only!"
+ 		cluster.np=1
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.m	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.m	(revision 13043)
+@@ -33,7 +33,7 @@
+ 
+ %check model consistency
+ disp('checking model consistency');
+-if (solutionenum == FlaimSolutionEnum)
++if (solutionenum == FlaimSolutionEnum())
+ 	md.private.isconsistent=true;
+ 	md=checkconsistency(md.mesh,md,solutionenum);
+ 	md=checkconsistency(md.flaim,md,solutionenum);
+@@ -55,7 +55,7 @@
+ end
+ 
+ %flaim analysis
+-if (options.solution_type == FlaimSolutionEnum)
++if (options.solution_type == FlaimSolutionEnum())
+ 	md=flaim_sol(md,options);
+ 	md.private.solution=EnumToString(options.solution_type);
+ 	return;
+@@ -68,13 +68,13 @@
+ end
+ 
+ %we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+-if ~ispetsc,
++if ~ispetsc(),
+ 	disp('PETSC support not included, running on 1 cpu only!');
+ 	cluster.np=1;
+ end
+ 
+ 
+-%Wite all input files
++%Write all input files
+ marshall(md);                                          % bin file
+ PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file
+ BuildQueueScript(cluster,md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); % queue file
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13043)
+@@ -1,4 +1,5 @@
+ import os
++from EnumToString import EnumToString
+ 
+ def loadresultsfromdisk(md,filename):
+ 	"""
+@@ -52,7 +53,7 @@
+ 	else:
+ 
+ 		if not isinstance(md.private.solution,str):
+-			md.private.solution=EnumToString(md.private.solution)
++			[md.private.solution]=EnumToString(md.private.solution)
+ 		md=postqmu(md)
+ 		os.chdir('..')
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py	(revision 13043)
+@@ -1,5 +1,6 @@
+ import os
+ from EnumDefinitions import *
++from EnumToString import EnumToString
+ 
+ def process_solve_options(options):
+ 	"""
+@@ -15,10 +16,10 @@
+ 
+ 	#solution_type: check on this option, error out otherwise
+ 	solution_type=options.getfieldvalue('solution_type')
+-	if solution_type not in (DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,\
+-			SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,\
+-			BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum):
+-		raise ValueError("process_solve_options error message: solution_type '%s' not supported yet!" % EnumToString(solution_type))
++	if solution_type not in (DiagnosticSolutionEnum(),PrognosticSolutionEnum(),ThermalSolutionEnum(),\
++			SteadystateSolutionEnum(),TransientSolutionEnum(),EnthalpySolutionEnum(),\
++			BalancethicknessSolutionEnum(),BedSlopeSolutionEnum(),SurfaceSlopeSolutionEnum(),HydrologySolutionEnum(),FlaimSolutionEnum()):
++		raise ValueError("process_solve_options error message: solution_type '%s' not supported yet!" % EnumToString(solution_type)[0])
+ 	outoptions['solution_type']=solution_type
+ 
+ 	outoptions['upload']=options.getfieldvalue('upload','off')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py	(revision 13043)
+@@ -1,4 +1,5 @@
+ from WriteData import *
++from EnumDefinitions import *
+ 
+ def marshall(md):
+ 	"""
+@@ -36,12 +37,12 @@
+ 			raise TypeError("field '%s' is not an object." % field)
+ 
+ 		#Marshall current object
+-		#print "marshalling %s ..." % field
++		print "marshalling %s ..." % field
+ 		exec("md.%s.marshall(fid)" % field)
+ 
+ 	#close file
+ 	try:
+-		f.close(fid)
++		fid.close()
+ 	except IOError as e:
+ 		raise IOError("marshall error message: could not close file '%s.bin'." % md.miscellaneous.name)
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.m	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.m	(revision 13043)
+@@ -8,9 +8,9 @@
+ 
+ %solution_type: check on this option, error out otherwise
+ solution_type=getfieldvalue(options,'solution_type');
+-if ~ismember(solution_type,[DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,...
+-		SteadystateSolutionEnum,TransientSolutionEnum,EnthalpySolutionEnum,...
+-		BalancethicknessSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum]),
++if ~ismember(solution_type,[DiagnosticSolutionEnum(),PrognosticSolutionEnum(),ThermalSolutionEnum(),...
++		SteadystateSolutionEnum(),TransientSolutionEnum(),EnthalpySolutionEnum(),...
++		BalancethicknessSolutionEnum(),BedSlopeSolutionEnum(),SurfaceSlopeSolutionEnum(),HydrologySolutionEnum(),FlaimSolutionEnum()]),
+ 	error(['process_solve_options error message: solution_type ' EnumToString(solution_type) ' not supported yet!']);
+ end
+ outoptions.solution_type=solution_type;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.m	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/MatlabProcessPatch.m	(revision 13043)
+@@ -48,10 +48,10 @@
+ 			structure(step).(fieldname).element=temporarypatch(pos,4);
+ 			structure(step).(fieldname).interpolation=temporarypatch(pos,5);
+ 			structure(step).(fieldname).index=temporarypatch(pos,6:5+numvertices);
+-			if structure(step).(fieldname).interpolation==P1Enum,
++			if structure(step).(fieldname).interpolation==P1Enum(),
+ 				structure(step).(fieldname).value=temporarypatch(pos,6+numvertices:end);
+ 			end
+-			if structure(step).(fieldname).interpolation==P0Enum,
++			if structure(step).(fieldname).interpolation==P0Enum(),
+ 				structure(step).(fieldname).value=temporarypatch(pos,6+numvertices);
+ 			end
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13043)
+@@ -1,7 +1,10 @@
+ import numpy
+ import math
+ import struct
++from pairoptions import *
+ from MatlabFuncs import *
++from EnumDefinitions import *
++from EnumToString import EnumToString
+ 
+ def WriteData(fid,*args):
+ 	"""
+@@ -12,6 +15,8 @@
+ 	"""
+ 
+ 	#process options
++	#  the import above the function level doesn't work?
++	from pairoptions import *
+ 	options=pairoptions(*args)
+ 
+ 	#Get data properties
+@@ -19,7 +24,7 @@
+ 		#This is an object field, construct enum and data
+ 		obj       = options.getfieldvalue('object')
+ 		fieldname = options.getfieldvalue('fieldname')
+-		classname = type(obj)
++		classname = str(type(obj)).rsplit('.')[-1].split("'")[0]
+ 
+ 		enum      = BuildEnum(classname+'_'+fieldname)
+ 		data      = getattr(obj,fieldname)
+@@ -40,8 +45,8 @@
+ 
+ 	#Step 2: write the data itself.
+ 	if   strcmpi(format,'Boolean'):    # {{{
+-		if len(data) !=1:
+-			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
++#		if len(data) !=1:
++#			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum)[0])
+ 
+ 		#first write length of record
+ 		fid.write(struct.pack('i',4+4))  #1 bool (disguised as an int)+code
+@@ -50,12 +55,12 @@
+ 		fid.write(struct.pack('i',FormatToCode(format))) 
+ 
+ 		#now write integer
+-		fid.write(struct.pack('i',data))  #send an int, not easy to send a bool
++		fid.write(struct.pack('i',int(data)))  #send an int, not easy to send a bool
+ 		# }}}
+ 
+ 	elif strcmpi(format,'Integer'):    # {{{
+-		if len(data) !=1:
+-			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
++#		if len(data) !=1:
++#			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum)[0])
+ 
+ 		#first write length of record
+ 		fid.write(struct.pack('i',4+4))  #1 integer + code
+@@ -68,8 +73,8 @@
+ 		# }}}
+ 
+ 	elif strcmpi(format,'Double'):    # {{{
+-		if len(data) !=1:
+-			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum))
++#		if len(data) !=1:
++#			raise ValueError('field %s cannot be marshalled as it has more than one element!' % EnumToString(enum)[0])
+ 
+ 		#first write length of record
+ 		fid.write(struct.pack('i',8+4))  #1 double+code
+@@ -95,12 +100,16 @@
+ 
+ 	elif strcmpi(format,'BooleanMat'):    # {{{
+ 
++		if isinstance(data,bool):
++			data=numpy.array([data])
++		if len(data.shape) == 1:
++			data=data.reshape(numpy.size(data,0),1)
++
+ 		#Get size
+ 		s=data.shape
+ 		#if matrix = NaN, then do not write anything
+ 		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
+-			s[0]=0
+-			s[1]=0
++			s=(0,0)
+ 
+ 		#first write length of record
+ 		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
+@@ -119,12 +128,16 @@
+ 
+ 	elif strcmpi(format,'IntMat'):    # {{{
+ 
++		if isinstance(data,int):
++			data=numpy.array([data])
++		if len(data.shape) == 1:
++			data=data.reshape(numpy.size(data,0),1)
++
+ 		#Get size
+ 		s=data.shape
+ 		#if matrix = NaN, then do not write anything
+ 		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
+-			s[0]=0
+-			s[1]=0
++			s=(0,0)
+ 
+ 		#first write length of record
+ 		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
+@@ -143,12 +156,16 @@
+ 
+ 	elif strcmpi(format,'DoubleMat'):    # {{{
+ 
++		if isinstance(data,(int,long,float)):
++			data=numpy.array([data])
++		if len(data.shape) == 1:
++			data=data.reshape(numpy.size(data,0),1)
++
+ 		#Get size
+ 		s=data.shape
+ 		#if matrix = NaN, then do not write anything
+ 		if s[0]==1 and s[1]==1 and math.isnan(data[0][0]):
+-			s[0]=0
+-			s[1]=0
++			s=(0,0)
+ 
+ 		#first write length of record
+ 		fid.write(struct.pack('i',4+4+8*s[0]*s[1]+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
+@@ -215,7 +232,7 @@
+ 		# }}}
+ 
+ 	else:    # {{{
+-		raise TypeError('WriteData error message: data type: %d not supported yet! (%s)' % (format,EnumToString(enum)))
++		raise TypeError('WriteData error message: data type: %d not supported yet! (%s)' % (format,EnumToString(enum)[0]))
+ 	# }}}
+ 
+ def BuildEnum(string): # {{{
+@@ -229,11 +246,11 @@
+ 	if '_' in string:
+ 		substrs=string.split('_')
+ 		string=''
+-		for str in substrs:
+-			string+=str[0].upper()+str[1:]
++		for substr in substrs:
++			string+=substr[0].upper()+substr[1:]
+ 	else:
+ 		#take first letter of string and make it uppercase: 
+-		string=str[0].upper()+str[1:]
++		string=string[0].upper()+string[1:]
+ 
+ 	#Get Enum
+ 	exec('enum='+string+'Enum()',globals())
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/groundingline.py	(revision 13043)
+@@ -2,6 +2,7 @@
+ import numpy
+ from fielddisplay import fielddisplay
+ from EnumDefinitions import *
++from StringToEnum import StringToEnum
+ from checkfield import *
+ from WriteData import *
+ from MatlabFuncs import *
+@@ -62,7 +63,7 @@
+ 	# }}}
+ 
+ 	def marshall(self,fid):    # {{{
+-		WriteData(fid,'data',StringToEnum(self.migration),'enum',GroundinglineMigrationEnum(),'format','Integer')
++		WriteData(fid,'data',StringToEnum(self.migration)[0],'enum',GroundinglineMigrationEnum(),'format','Integer')
+ 		WriteData(fid,'object',self,'fieldname','melting_rate','format','Double')
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/rifts.py	(revision 13043)
+@@ -73,7 +73,7 @@
+ 			numpairs+=numpy.size(self.riftstruct[i].penaltypairs,0)
+ 
+ 		# 2 for nodes + 2 for elements+ 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
+-		data=numpy.zeros(numpairs,12)
++		data=numpy.zeros((numpairs,12))
+ 		count=0
+ 		for i in xrange(0,numrifts):
+ 			numpairsforthisrift=numpy.size(self.riftstruct[i]['penaltypairs'],0)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13043)
+@@ -3,6 +3,7 @@
+ import math
+ import platform
+ import subprocess
++from EnumToString import EnumToString
+ from issmdir import *
+ from pairoptions import *
+ from issmssh import *
+@@ -78,16 +79,16 @@
+ 			fid.write('#!/bin/sh\n')
+ 			if not isvalgrind:
+ 				if self.interactive:
+-					fid.write('mpiexec -np %i %s/issm.exe %s %s %s ' % (self.np,self.codepath,EnumToString(solution),self.executionpath,modelname))
++					fid.write('mpiexec -np %i %s/issm.exe %s %s %s ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,modelname))
+ 				else:
+-					fid.write('mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
++					fid.write('mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname))
+ 			elif isgprof:
+ 				fid.write('\n gprof %s/issm.exe gmon.out > %s.performance' % (self.codepath,modelname))
+ 			else:
+ 				#Add --gen-suppressions=all to get suppression lines
+ 				fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
+ 				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % \
+-					(self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
++					(self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname))
+ 			if not io_gather:    #concatenate the output files:
+ 				fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname))
+ 			fid.close()
+@@ -97,10 +98,10 @@
+ 			fid=open(modelname+'.bat','w')
+ 			fid.write('@echo off\n')
+ 			if self.interactive:
+-				fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution),self.executionpath,modelname))
++				fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,modelname))
+ 			else:
+ 				fid.write('"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog' % \
+-					(self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
++					(self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname))
+ 			fid.close()
+ 
+ 		#in interactive mode, create a run file, and errlog and outlog file
+@@ -139,10 +140,10 @@
+ 			fid=open(modelname+'.bat','w')
+ 			fid.write('@echo off\n')
+ 			if self.interactive:
+-				fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution),self.executionpath,modelname))
++				fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,modelname))
+ 			else:
+ 				fid.write('"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog' % \
+-					(self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
++					(self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname))
+ 			fid.close()
+ 
+ 		#in interactive mode, create a run file, and errlog and outlog file
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.m	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.m	(revision 13043)
+@@ -37,10 +37,10 @@
+ 		 function obj = setdefaultparameters(obj) % {{{
+ 
+ 			 %MUMPS is the default solver
+-			 if ismumps,
+-				 obj.NoneAnalysis=mumpsoptions;
++			 if ismumps(),
++				 obj.NoneAnalysis=mumpsoptions();
+ 			 else
+-				 obj.NoneAnalysis=iluasmoptions;
++				 obj.NoneAnalysis=iluasmoptions();
+ 			 end
+ 
+ 		 end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 13043)
+@@ -1,6 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ from EnumDefinitions import *
++from StringToEnum import StringToEnum
+ from checkfield import *
+ from WriteData import *
+ 
+@@ -17,6 +18,7 @@
+ 		# {{{ Properties
+ 		self.rho_ice                    = 0
+ 		self.rho_water                  = 0
++		self.rho_freshwater             = 0
+ 		self.mu_water                   = 0
+ 		self.heatcapacity               = 0
+ 		self.latentheat                 = 0
+@@ -37,6 +39,7 @@
+ 
+ 		string="%s\n\n%s"%(string,fielddisplay(self,"rho_ice","ice density [kg/m^3]"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"rho_water","water density [kg/m^3]"))
++		string="%s\n%s"%(string,fielddisplay(self,"rho_freshwater","fresh water density [kg/m^3]"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"mu_water","water viscosity [N s/m^2]"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"heatcapacity","heat capacity [J/kg/K]"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]"))
+@@ -56,9 +59,12 @@
+ 		#ice density (kg/m^3)
+ 		self.rho_ice=917
+ 
+-		#water density (kg/m^3)
++		#ocean water density (kg/m^3)
+ 		self.rho_water=1023
+ 
++		#fresh water density (kg/m^3)
++		self.rho_freshwater=1000
++
+ 		#water viscosity (N.s/m^2)
+ 		self.mu_water=0.001787  
+ 
+@@ -114,6 +120,6 @@
+ 		WriteData(fid,'object',self,'fieldname','thermal_exchange_velocity','format','Double')
+ 		WriteData(fid,'object',self,'fieldname','rheology_B','format','DoubleMat','mattype',1)
+ 		WriteData(fid,'object',self,'fieldname','rheology_n','format','DoubleMat','mattype',2)
+-		WriteData(fid,'data',StringToEnum(self.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer')
++		WriteData(fid,'data',StringToEnum(self.rheology_law)[0],'enum',MaterialsRheologyLawEnum(),'format','Integer')
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13043)
+@@ -125,8 +125,8 @@
+ 		md = checkfield(md,'diagnostic.reltol','size',[1])
+ 		md = checkfield(md,'diagnostic.abstol','size',[1])
+ 		md = checkfield(md,'diagnostic.isnewton','numel',[1],'values',[0,1])
+-		md = checkfield(md,'diagnostic.stokesreconditioning','size',[1,1],'NaN',1)
+-		md = checkfield(md,'diagnostic.viscosity_overshoot','size',[1,1],'NaN',1)
++		md = checkfield(md,'diagnostic.stokesreconditioning','size',[1],'NaN',1)
++		md = checkfield(md,'diagnostic.viscosity_overshoot','size',[1],'NaN',1)
+ 		if md.mesh.dimension==2:
+ 			md = checkfield(md,'diagnostic.icefront','size',[float('NaN'),4],'NaN',1)
+ 		else:
+@@ -138,13 +138,16 @@
+ 			md = checkfield(md,'diagnostic.requested_outputs','size',[float('NaN'),1])
+ 
+ 		#singular solution
++#		if ~any((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy))==2),
+ 		if not numpy.any(numpy.logical_and(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx)),numpy.logical_not(numpy.isnan(md.diagnostic.spcvy)))):
+ 			md.checkmessage("model is not well posed (singular). You need at least one node with fixed velocity!")
+ 		#CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
+-		if any(not numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==0 and not numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==6):
++#		if any(sum(isnan(md.diagnostic.referential),2)~=0 & sum(isnan(md.diagnostic.referential),2)~=6),
++		if numpy.any(numpy.logical_and(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)!=0,numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)!=6)):
+ 			md.checkmessage("Each line of diagnostic.referential should contain either only NaN values or no NaN values")
+ 		#CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
+-		if any(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==0):
++#		if any(sum(isnan(md.diagnostic.referential),2)==0),
++		if numpy.any(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==0):
+ 			pos=[i for i,item in enumerate(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)) if item==0]
+ #			numpy.inner (and numpy.dot) calculate all the dot product permutations, resulting in a full matrix multiply
+ #			if numpy.any(numpy.abs(numpy.inner(md.diagnostic.referential[pos,0:2],md.diagnostic.referential[pos,3:5]).diagonal())>sys.float_info.epsilon):
+@@ -153,6 +156,7 @@
+ 				if numpy.abs(numpy.inner(item[0:2],item[3:5]))>sys.float_info.epsilon:
+ 					md.checkmessage("Vectors in diagnostic.referential (columns 1 to 3 and 4 to 6) must be orthogonal")
+ 		#CHECK THAT NO rotation specified for FS Grounded ice at base
++#		if md.mesh.dimension==3 & md.flowequation.isstokes,
+ 		if md.mesh.dimension==3 and md.flowequation.isstokes:
+ 			pos=numpy.nonzero(numpy.logical_and(md.mask.vertexongroundedice,md.mesh.vertexonbed))
+ 			if numpy.any(numpy.logical_not(numpy.isnan(md.diagnostic.referential[pos,:]))):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/prognostic.py	(revision 13043)
+@@ -1,6 +1,7 @@
+ #module imports
+ from fielddisplay import fielddisplay
+ from EnumDefinitions import *
++from StringToEnum import StringToEnum
+ from checkfield import *
+ from WriteData import *
+ 
+@@ -72,7 +73,7 @@
+ 	def marshall(self,fid):    # {{{
+ 		WriteData(fid,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1)
+ 		WriteData(fid,'object',self,'fieldname','min_thickness','format','Double')
+-		WriteData(fid,'data',StringToEnum(self.hydrostatic_adjustment),'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum())
++		WriteData(fid,'data',StringToEnum(self.hydrostatic_adjustment)[0],'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum())
+ 		WriteData(fid,'object',self,'fieldname','stabilization','format','Integer')
+ 		WriteData(fid,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3)
+ 		WriteData(fid,'object',self,'fieldname','penalty_factor','format','Double')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/planetmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/planetmesh.m	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/planetmesh.m	(revision 13043)
+@@ -73,15 +73,15 @@
+ 
+ 			%Solution specific checks
+ 			switch(solution),
+-				case PrognosticSolutionEnum,
++				case PrognosticSolutionEnum(),
+ 					if md.prognostic.stabilization==3,
+ 						md = checkfield(md,'planetmesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d planetmeshes');
+ 					end
+-				case TransientSolutionEnum,
++				case TransientSolutionEnum(),
+ 					if md.transient.isprognostic & md.prognostic.stabilization==3,
+ 						md = checkfield(md,'planetmesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d planetmeshes');
+ 					end
+-				case ThermalSolutionEnum,
++				case ThermalSolutionEnum(),
+ 					md = checkfield(md,'planetmesh.dimension','values',3,'message','thermal solution only supported on 3d planetmeshes');
+ 			end
+ 		end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py	(revision 13043)
+@@ -124,6 +124,6 @@
+ 	# }}}
+ 
+ 	def marshall(self,fid):    # {{{
+-			WriteData(fid,'data',VerboseToBinary(self),'enum',VerboseEnum(),'format','Integer')
++			WriteData(fid,'data',self.VerboseToBinary(),'enum',VerboseEnum(),'format','Integer')
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13043)
+@@ -32,6 +32,9 @@
+ from miscellaneous import miscellaneous
+ from private import private
+ from EnumDefinitions import *
++from ismumps import *
++from mumpsoptions import *
++from iluasmoptions import *
+ #}}}
+ 
+ class model(object):
+@@ -55,11 +58,10 @@
+ 		self.verbose          = verbose('solution',True,'qmu',True,'control',True)
+ 		self.settings         = settings()
+ 		self.solver           = solver()
+-#		need EnumToString for these to work
+-#		if ismumps:
+-#			md.solver.addoptions(DiagnosticVertAnalysisEnum(),mumpsoptions)
+-#		else:
+-#			md.solver.addoptions(DiagnosticVertAnalysisEnum(),iluasmoptions)
++		if ismumps():
++			self.solver.addoptions(DiagnosticVertAnalysisEnum(),mumpsoptions())
++		else:
++			self.solver.addoptions(DiagnosticVertAnalysisEnum(),iluasmoptions())
+ 		self.cluster          = generic()
+ 
+ 		self.balancethickness = balancethickness()
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13043)
+@@ -1045,10 +1045,10 @@
+ 			 md.verbose          = verbose('solution',true,'qmu',true,'control',true);
+ 			 md.settings         = settings();
+ 			 md.solver           = solver();
+-			 if ismumps,
+-				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum(),mumpsoptions);
++			 if ismumps(),
++				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum(),mumpsoptions());
+ 			 else
+-				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum(),iluasmoptions);
++				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum(),iluasmoptions());
+ 			 end
+ 			 md.cluster          = generic();
+ 			 md.balancethickness = balancethickness();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/planet.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/planet.m	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/planet.m	(revision 13043)
+@@ -37,10 +37,10 @@
+ 			 md.verbose          = verbose('solution',true,'qmu',true,'control',true);
+ 			 md.settings         = settings();
+ 			 md.solver           = solver();
+-			 if ismumps,
+-				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,mumpsoptions);
++			 if ismumps(),
++				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum(),mumpsoptions());
+ 			 else
+-				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,iluasmoptions);
++				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum(),iluasmoptions());
+ 			 end
+ 			 md.cluster          = generic();
+ 			 md.balancethickness = balancethickness();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py	(revision 13043)
+@@ -1,6 +1,7 @@
+ from ismumps import *
+ from mumpsoptions import *
+ from iluasmoptions import *
++from EnumToString import EnumToString
+ from MatlabFuncs import *
+ from EnumDefinitions import *
+ from checkfield import *
+@@ -15,7 +16,7 @@
+ 
+ 	def __init__(self):    # {{{
+ 		#MUMPS is the default solver
+-		if ismumps:
++		if ismumps():
+ 			self.NoneAnalysis=mumpsoptions()
+ 		else:
+ 			self.NoneAnalysis=iluasmoptions()
+@@ -29,8 +30,7 @@
+ 		#    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum());
+ 
+ 		#Convert analysis from enum to string
+-#		need EnumToString
+-#		analysis=EnumToString(analysis)
++		[analysis]=EnumToString(analysis)
+ 
+ 		#Create dynamic property if property does not exist yet
+ 		if not hasattr(self,analysis):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/geometry.py	(revision 13043)
+@@ -50,7 +50,6 @@
+ 		md = checkfield(md,'geometry.thickness','NaN',1,'size',[md.mesh.numberofvertices],'>',0)
+ 		if any((self.thickness-self.surface+self.bed)>10**-9):
+ 			md.checkmessage("equality thickness=surface-bed violated")
+-		end 
+ 		if solution==TransientSolutionEnum() and md.transient.isgroundingline:
+ 			md = checkfield(md,'geometry.bathymetry','NaN',1,'size',[md.mesh.numberofvertices])
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13043)
+@@ -2,6 +2,7 @@
+ import numpy
+ from fielddisplay import fielddisplay
+ from EnumDefinitions import *
++from StringToEnum import StringToEnum
+ from checkfield import *
+ from WriteData import *
+ 
+@@ -166,7 +167,7 @@
+ 
+ 		#process control parameters
+ 		num_control_parameters=numpy.size(self.control_parameters)
+-		data=[StringToEnum(self.control_parameters[i]) for i in xrange(0,num_control_parameters)]
++		data=[StringToEnum(self.control_parameters[i])[0] for i in xrange(0,num_control_parameters)]
+ 		WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3)
+ 		WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer')
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 13043)
+@@ -1,4 +1,5 @@
+ from EnumDefinitions import *
++from EnumToString import EnumToString
+ 
+ def AnalysisConfiguration(solutiontype): #{{{
+ 	"""
+@@ -8,52 +9,52 @@
+ 			[analyses, numanalyses]=AnalysisConfiguration(solutiontype);
+ 	"""
+ 
+-	if   solutiontype == DiagnosticSolutionEnum:
++	if   solutiontype == DiagnosticSolutionEnum():
+ 		numanalyses=5
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum]
++		analyses=[DiagnosticHorizAnalysisEnum(),DiagnosticVertAnalysisEnum(),DiagnosticHutterAnalysisEnum(),SurfaceSlopeAnalysisEnum(),BedSlopeAnalysisEnum()]
+ 
+-	elif solutiontype == SteadystateSolutionEnum:
++	elif solutiontype == SteadystateSolutionEnum():
+ 		numanalyses=7 
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum]
++		analyses=[DiagnosticHorizAnalysisEnum(),DiagnosticVertAnalysisEnum(),DiagnosticHutterAnalysisEnum(),SurfaceSlopeAnalysisEnum(),BedSlopeAnalysisEnum(),ThermalAnalysisEnum(),MeltingAnalysisEnum()]
+ 
+-	elif solutiontype == ThermalSolutionEnum:
++	elif solutiontype == ThermalSolutionEnum():
+ 		numanalyses=2 
+-		analyses=[ThermalAnalysisEnum,MeltingAnalysisEnum]
++		analyses=[ThermalAnalysisEnum(),MeltingAnalysisEnum()]
+ 
+-	elif solutiontype == EnthalpySolutionEnum:
++	elif solutiontype == EnthalpySolutionEnum():
+ 		numanalyses=1 
+-		analyses=[EnthalpyAnalysisEnum]
++		analyses=[EnthalpyAnalysisEnum()]
+ 
+-	elif solutiontype == PrognosticSolutionEnum:
++	elif solutiontype == PrognosticSolutionEnum():
+ 		numanalyses=1 
+-		analyses=[PrognosticAnalysisEnum]
++		analyses=[PrognosticAnalysisEnum()]
+ 
+-	elif solutiontype == BalancethicknessSolutionEnum:
++	elif solutiontype == BalancethicknessSolutionEnum():
+ 		numanalyses=1 
+-		analyses=[BalancethicknessAnalysisEnum]
++		analyses=[BalancethicknessAnalysisEnum()]
+ 
+-	elif solutiontype == SurfaceSlopeSolutionEnum:
++	elif solutiontype == SurfaceSlopeSolutionEnum():
+ 		numanalyses=1 
+-		analyses=[SurfaceSlopeAnalysisEnum]
++		analyses=[SurfaceSlopeAnalysisEnum()]
+ 
+-	elif solutiontype == BedSlopeSolutionEnum:
++	elif solutiontype == BedSlopeSolutionEnum():
+ 		numanalyses=1 
+-		analyses=[BedSlopeAnalysisEnum]
++		analyses=[BedSlopeAnalysisEnum()]
+ 
+-	elif solutiontype == TransientSolutionEnum:
++	elif solutiontype == TransientSolutionEnum():
+ 		numanalyses=9 
+-		analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticHutterAnalysisEnum,SurfaceSlopeAnalysisEnum,BedSlopeAnalysisEnum,ThermalAnalysisEnum,MeltingAnalysisEnum,EnthalpyAnalysisEnum,PrognosticAnalysisEnum]
++		analyses=[DiagnosticHorizAnalysisEnum(),DiagnosticVertAnalysisEnum(),DiagnosticHutterAnalysisEnum(),SurfaceSlopeAnalysisEnum(),BedSlopeAnalysisEnum(),ThermalAnalysisEnum(),MeltingAnalysisEnum(),EnthalpyAnalysisEnum(),PrognosticAnalysisEnum()]
+ 
+-	elif solutiontype == FlaimSolutionEnum:
++	elif solutiontype == FlaimSolutionEnum():
+ 		numanalyses=1 
+-		analyses=[FlaimAnalysisEnum]
++		analyses=[FlaimAnalysisEnum()]
+ 
+-	elif solutiontype == HydrologySolutionEnum:
++	elif solutiontype == HydrologySolutionEnum():
+ 		numanalyses=3 
+-		analyses=[BedSlopeAnalysisEnum,SurfaceSlopeAnalysisEnum,HydrologyAnalysisEnum]
++		analyses=[BedSlopeAnalysisEnum(),SurfaceSlopeAnalysisEnum(),HydrologyAnalysisEnum()]
+ 
+ 	else:
+-		raise TypeError("solution type: '%s' not supported yet!" % EnumToString(solutiontype))
++		raise TypeError("solution type: '%s' not supported yet!" % EnumToString(solutiontype)[0])
+ 
+ 	return analyses,numanalyses
+ #}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/checkfield.py	(revision 13043)
+@@ -38,6 +38,8 @@
+ 	#get field from model
+ #	field=getattr(md,fieldname)
+ 	exec("field=md.%s" % fieldname)
++	if isinstance(field,(bool,int,long,float)):
++		field=numpy.array([field])
+ 
+ 	#check empty
+ 	if options.exist('empty'):
+@@ -84,7 +86,7 @@
+ 
+ 	#check NaN
+ 	if options.getfieldvalue('NaN',0):
+-		if True in numpy.isnan(field):
++		if numpy.any(numpy.isnan(field)):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"NaN values found in field '%s'" % fieldname))
+ 
+@@ -111,24 +113,24 @@
+ 	#check greater
+ 	if options.exist('>='):
+ 		lowerbound=options.getfieldvalue('>=')
+-		if any(field<lowerbound):
++		if numpy.any(field<lowerbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values above %d" % (fieldname,lowerbound)))
+ 	if options.exist('>'):
+ 		lowerbound=options.getfieldvalue('>')
+-		if any(field<=lowerbound):
++		if numpy.any(field<=lowerbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values above %d" % (fieldname,lowerbound)))
+ 
+ 	#check smaller
+ 	if options.exist('<='):
+ 		upperbound=options.getfieldvalue('<=')
+-		if any(field>upperbound):
++		if numpy.any(field>upperbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values below %d" % (fieldname,upperbound)))
+ 	if options.exist('<'):
+ 		upperbound=options.getfieldvalue('<')
+-		if any(field>=upperbound):
++		if numpy.any(field>=upperbound):
+ 			md = md.checkmessage(options.getfieldvalue('message',\
+ 				"field '%s' should have values below %d" % (fieldname,upperbound)))
+ 
+@@ -140,7 +142,7 @@
+ 	#Check forcings (size and times)
+ 	if options.getfieldvalue('forcing',0):
+ 		if   numpy.size(field,0)==md.mesh.numberofvertices:
+-			if not numpy.size(field,1)==1:
++			if len(numpy.shape(field))>1 and not numpy.size(field,1)==1:
+ 				md = md.checkmessage(options.getfieldvalue('message',\
+ 					"field '%s' should have only one column as there are md.mesh.numberofvertices lines" % fieldname))
+ 		elif numpy.size(field,0)==md.mesh.numberofvertices+1:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 13043)
+@@ -50,49 +50,49 @@
+ 
+ switch solutiontype,
+ 
+-	case DiagnosticSolutionEnum,
++	case DiagnosticSolutionEnum(),
+ 		numanalyses=5;
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum];
++		analyses=[DiagnosticHorizAnalysisEnum();DiagnosticVertAnalysisEnum();DiagnosticHutterAnalysisEnum();SurfaceSlopeAnalysisEnum();BedSlopeAnalysisEnum()];
+ 
+-	case SteadystateSolutionEnum,
++	case SteadystateSolutionEnum(),
+ 		numanalyses=7; 
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum];
++		analyses=[DiagnosticHorizAnalysisEnum();DiagnosticVertAnalysisEnum();DiagnosticHutterAnalysisEnum();SurfaceSlopeAnalysisEnum();BedSlopeAnalysisEnum();ThermalAnalysisEnum();MeltingAnalysisEnum()];
+ 
+-	case ThermalSolutionEnum,
++	case ThermalSolutionEnum(),
+ 		numanalyses=2; 
+-		analyses=[ThermalAnalysisEnum;MeltingAnalysisEnum];
++		analyses=[ThermalAnalysisEnum();MeltingAnalysisEnum()];
+ 
+-	case EnthalpySolutionEnum,
++	case EnthalpySolutionEnum(),
+ 		numanalyses=1; 
+-		analyses=[EnthalpyAnalysisEnum];
++		analyses=[EnthalpyAnalysisEnum()];
+ 
+-	case PrognosticSolutionEnum,
++	case PrognosticSolutionEnum(),
+ 		numanalyses=1; 
+-		analyses=[PrognosticAnalysisEnum];
++		analyses=[PrognosticAnalysisEnum()];
+ 
+-	case BalancethicknessSolutionEnum,
++	case BalancethicknessSolutionEnum(),
+ 		numanalyses=1; 
+-		analyses=[BalancethicknessAnalysisEnum];
++		analyses=[BalancethicknessAnalysisEnum()];
+ 
+-	case SurfaceSlopeSolutionEnum,
++	case SurfaceSlopeSolutionEnum(),
+ 		numanalyses=1; 
+-		analyses=[SurfaceSlopeAnalysisEnum];
++		analyses=[SurfaceSlopeAnalysisEnum()];
+ 
+-	case BedSlopeSolutionEnum,
++	case BedSlopeSolutionEnum(),
+ 		numanalyses=1; 
+-		analyses=[BedSlopeAnalysisEnum];
++		analyses=[BedSlopeAnalysisEnum()];
+ 
+-	case TransientSolutionEnum,
++	case TransientSolutionEnum(),
+ 		numanalyses=9; 
+-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;EnthalpyAnalysisEnum;PrognosticAnalysisEnum];
++		analyses=[DiagnosticHorizAnalysisEnum();DiagnosticVertAnalysisEnum();DiagnosticHutterAnalysisEnum();SurfaceSlopeAnalysisEnum();BedSlopeAnalysisEnum();ThermalAnalysisEnum();MeltingAnalysisEnum();EnthalpyAnalysisEnum();PrognosticAnalysisEnum()];
+ 
+-	case FlaimSolutionEnum,
++	case FlaimSolutionEnum(),
+ 		numanalyses=1; 
+-		analyses=[FlaimAnalysisEnum];
++		analyses=[FlaimAnalysisEnum()];
+ 
+-	case HydrologySolutionEnum,
++	case HydrologySolutionEnum(),
+ 		numanalyses=3; 
+-		analyses=[BedSlopeAnalysisEnum;SurfaceSlopeAnalysisEnum;HydrologyAnalysisEnum];
++		analyses=[BedSlopeAnalysisEnum();SurfaceSlopeAnalysisEnum();HydrologyAnalysisEnum()];
+ 
+ 	otherwise
+ 		error('%s%s%s',' solution type: ',EnumToString(solutiontype),' not supported yet!');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/issmdoc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/issmdoc.m	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/issmdoc.m	(revision 13043)
+@@ -1,7 +1,7 @@
+ %Quick documentation for ISSM
+ 
+ %First get ISSM tier: 
+-ISSM_DIR=issmdir;
++ISSM_DIR=issmdir();
+ 
+ disp(sprintf('\n%s','  A comprehensive documentation is available on http://issm.jpl.nasa.gov'));
+ disp(sprintf('\n%s','  Example: how to create a square ice shelf'));
+@@ -11,5 +11,5 @@
+ disp(sprintf('%s','	   md=setmask(md,''all'','''');               %defines the glacier system as an ice shelf (no island)'));
+ disp(sprintf('%s','	   md=parameterize(md,''Square.par'');        %fills all the other fields of the model'));
+ disp(sprintf('%s','	   md=setflowequation(md,''macayeal'',''all''); %defines all elements as MacAyeal''s'));
+-disp(sprintf('%s','	   md=solve(md,DiagnosticSolutionEnum);   %generate the velocity field'));
++disp(sprintf('%s','	   md=solve(md,DiagnosticSolutionEnum());   %generate the velocity field'));
+ disp(sprintf('%s','	   plotmodel(md,''data'',md.results.DiagnosticSolution.Vel);    %displays the velocity (type plotdoc for plotmodel help)'));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13042)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13043)
+@@ -1,3 +1,5 @@
++from StringToEnum import StringToEnum
++
+ """
+ 
+    WARNING: DO NOT MODIFY THIS FILE
+@@ -14,7 +16,7 @@
+ 	      macro=AutodiffForwardEnum()
+ 	"""
+ 
+-	return StringToEnum('AutodiffForward')
++	return StringToEnum('AutodiffForward')[0]
+ 
+ def AutodiffIsautodiffEnum():
+ 	"""
+@@ -24,7 +26,7 @@
+ 	      macro=AutodiffIsautodiffEnum()
+ 	"""
+ 
+-	return StringToEnum('AutodiffIsautodiff')
++	return StringToEnum('AutodiffIsautodiff')[0]
+ 
+ def AutodiffReverseEnum():
+ 	"""
+@@ -34,7 +36,7 @@
+ 	      macro=AutodiffReverseEnum()
+ 	"""
+ 
+-	return StringToEnum('AutodiffReverse')
++	return StringToEnum('AutodiffReverse')[0]
+ 
+ def BalancethicknessSpcthicknessEnum():
+ 	"""
+@@ -44,7 +46,7 @@
+ 	      macro=BalancethicknessSpcthicknessEnum()
+ 	"""
+ 
+-	return StringToEnum('BalancethicknessSpcthickness')
++	return StringToEnum('BalancethicknessSpcthickness')[0]
+ 
+ def BalancethicknessStabilizationEnum():
+ 	"""
+@@ -54,7 +56,7 @@
+ 	      macro=BalancethicknessStabilizationEnum()
+ 	"""
+ 
+-	return StringToEnum('BalancethicknessStabilization')
++	return StringToEnum('BalancethicknessStabilization')[0]
+ 
+ def BalancethicknessThickeningRateEnum():
+ 	"""
+@@ -64,7 +66,7 @@
+ 	      macro=BalancethicknessThickeningRateEnum()
+ 	"""
+ 
+-	return StringToEnum('BalancethicknessThickeningRate')
++	return StringToEnum('BalancethicknessThickeningRate')[0]
+ 
+ def BasalforcingsGeothermalfluxEnum():
+ 	"""
+@@ -74,7 +76,7 @@
+ 	      macro=BasalforcingsGeothermalfluxEnum()
+ 	"""
+ 
+-	return StringToEnum('BasalforcingsGeothermalflux')
++	return StringToEnum('BasalforcingsGeothermalflux')[0]
+ 
+ def BasalforcingsMeltingRateCorrectionEnum():
+ 	"""
+@@ -84,7 +86,7 @@
+ 	      macro=BasalforcingsMeltingRateCorrectionEnum()
+ 	"""
+ 
+-	return StringToEnum('BasalforcingsMeltingRateCorrection')
++	return StringToEnum('BasalforcingsMeltingRateCorrection')[0]
+ 
+ def BasalforcingsMeltingRateEnum():
+ 	"""
+@@ -94,7 +96,7 @@
+ 	      macro=BasalforcingsMeltingRateEnum()
+ 	"""
+ 
+-	return StringToEnum('BasalforcingsMeltingRate')
++	return StringToEnum('BasalforcingsMeltingRate')[0]
+ 
+ def BathymetryEnum():
+ 	"""
+@@ -104,7 +106,7 @@
+ 	      macro=BathymetryEnum()
+ 	"""
+ 
+-	return StringToEnum('Bathymetry')
++	return StringToEnum('Bathymetry')[0]
+ 
+ def BedEnum():
+ 	"""
+@@ -114,7 +116,7 @@
+ 	      macro=BedEnum()
+ 	"""
+ 
+-	return StringToEnum('Bed')
++	return StringToEnum('Bed')[0]
+ 
+ def ConstantsGEnum():
+ 	"""
+@@ -124,7 +126,7 @@
+ 	      macro=ConstantsGEnum()
+ 	"""
+ 
+-	return StringToEnum('ConstantsG')
++	return StringToEnum('ConstantsG')[0]
+ 
+ def ConstantsReferencetemperatureEnum():
+ 	"""
+@@ -134,7 +136,7 @@
+ 	      macro=ConstantsReferencetemperatureEnum()
+ 	"""
+ 
+-	return StringToEnum('ConstantsReferencetemperature')
++	return StringToEnum('ConstantsReferencetemperature')[0]
+ 
+ def ConstantsYtsEnum():
+ 	"""
+@@ -144,7 +146,7 @@
+ 	      macro=ConstantsYtsEnum()
+ 	"""
+ 
+-	return StringToEnum('ConstantsYts')
++	return StringToEnum('ConstantsYts')[0]
+ 
+ def DiagnosticAbstolEnum():
+ 	"""
+@@ -154,7 +156,7 @@
+ 	      macro=DiagnosticAbstolEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticAbstol')
++	return StringToEnum('DiagnosticAbstol')[0]
+ 
+ def DiagnosticIcefrontEnum():
+ 	"""
+@@ -164,7 +166,7 @@
+ 	      macro=DiagnosticIcefrontEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticIcefront')
++	return StringToEnum('DiagnosticIcefront')[0]
+ 
+ def DiagnosticIsnewtonEnum():
+ 	"""
+@@ -174,7 +176,7 @@
+ 	      macro=DiagnosticIsnewtonEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticIsnewton')
++	return StringToEnum('DiagnosticIsnewton')[0]
+ 
+ def DiagnosticMaxiterEnum():
+ 	"""
+@@ -184,7 +186,7 @@
+ 	      macro=DiagnosticMaxiterEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticMaxiter')
++	return StringToEnum('DiagnosticMaxiter')[0]
+ 
+ def DiagnosticNumRequestedOutputsEnum():
+ 	"""
+@@ -194,7 +196,7 @@
+ 	      macro=DiagnosticNumRequestedOutputsEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticNumRequestedOutputs')
++	return StringToEnum('DiagnosticNumRequestedOutputs')[0]
+ 
+ def DiagnosticPenaltyFactorEnum():
+ 	"""
+@@ -204,7 +206,7 @@
+ 	      macro=DiagnosticPenaltyFactorEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticPenaltyFactor')
++	return StringToEnum('DiagnosticPenaltyFactor')[0]
+ 
+ def DiagnosticReferentialEnum():
+ 	"""
+@@ -214,7 +216,7 @@
+ 	      macro=DiagnosticReferentialEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticReferential')
++	return StringToEnum('DiagnosticReferential')[0]
+ 
+ def DiagnosticReltolEnum():
+ 	"""
+@@ -224,7 +226,7 @@
+ 	      macro=DiagnosticReltolEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticReltol')
++	return StringToEnum('DiagnosticReltol')[0]
+ 
+ def DiagnosticRequestedOutputsEnum():
+ 	"""
+@@ -234,7 +236,7 @@
+ 	      macro=DiagnosticRequestedOutputsEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticRequestedOutputs')
++	return StringToEnum('DiagnosticRequestedOutputs')[0]
+ 
+ def DiagnosticRestolEnum():
+ 	"""
+@@ -244,7 +246,7 @@
+ 	      macro=DiagnosticRestolEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticRestol')
++	return StringToEnum('DiagnosticRestol')[0]
+ 
+ def DiagnosticRiftPenaltyLockEnum():
+ 	"""
+@@ -254,7 +256,7 @@
+ 	      macro=DiagnosticRiftPenaltyLockEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticRiftPenaltyLock')
++	return StringToEnum('DiagnosticRiftPenaltyLock')[0]
+ 
+ def DiagnosticRiftPenaltyThresholdEnum():
+ 	"""
+@@ -264,7 +266,7 @@
+ 	      macro=DiagnosticRiftPenaltyThresholdEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticRiftPenaltyThreshold')
++	return StringToEnum('DiagnosticRiftPenaltyThreshold')[0]
+ 
+ def DiagnosticShelfDampeningEnum():
+ 	"""
+@@ -274,7 +276,7 @@
+ 	      macro=DiagnosticShelfDampeningEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticShelfDampening')
++	return StringToEnum('DiagnosticShelfDampening')[0]
+ 
+ def DiagnosticSpcvxEnum():
+ 	"""
+@@ -284,7 +286,7 @@
+ 	      macro=DiagnosticSpcvxEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticSpcvx')
++	return StringToEnum('DiagnosticSpcvx')[0]
+ 
+ def DiagnosticSpcvyEnum():
+ 	"""
+@@ -294,7 +296,7 @@
+ 	      macro=DiagnosticSpcvyEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticSpcvy')
++	return StringToEnum('DiagnosticSpcvy')[0]
+ 
+ def DiagnosticSpcvzEnum():
+ 	"""
+@@ -304,7 +306,7 @@
+ 	      macro=DiagnosticSpcvzEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticSpcvz')
++	return StringToEnum('DiagnosticSpcvz')[0]
+ 
+ def DiagnosticStokesreconditioningEnum():
+ 	"""
+@@ -314,7 +316,7 @@
+ 	      macro=DiagnosticStokesreconditioningEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticStokesreconditioning')
++	return StringToEnum('DiagnosticStokesreconditioning')[0]
+ 
+ def DiagnosticVertexPairingEnum():
+ 	"""
+@@ -324,7 +326,7 @@
+ 	      macro=DiagnosticVertexPairingEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticVertexPairing')
++	return StringToEnum('DiagnosticVertexPairing')[0]
+ 
+ def DiagnosticViscosityOvershootEnum():
+ 	"""
+@@ -334,7 +336,7 @@
+ 	      macro=DiagnosticViscosityOvershootEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticViscosityOvershoot')
++	return StringToEnum('DiagnosticViscosityOvershoot')[0]
+ 
+ def FlowequationBordermacayealEnum():
+ 	"""
+@@ -344,7 +346,7 @@
+ 	      macro=FlowequationBordermacayealEnum()
+ 	"""
+ 
+-	return StringToEnum('FlowequationBordermacayeal')
++	return StringToEnum('FlowequationBordermacayeal')[0]
+ 
+ def FlowequationBorderpattynEnum():
+ 	"""
+@@ -354,7 +356,7 @@
+ 	      macro=FlowequationBorderpattynEnum()
+ 	"""
+ 
+-	return StringToEnum('FlowequationBorderpattyn')
++	return StringToEnum('FlowequationBorderpattyn')[0]
+ 
+ def FlowequationBorderstokesEnum():
+ 	"""
+@@ -364,7 +366,7 @@
+ 	      macro=FlowequationBorderstokesEnum()
+ 	"""
+ 
+-	return StringToEnum('FlowequationBorderstokes')
++	return StringToEnum('FlowequationBorderstokes')[0]
+ 
+ def FlowequationElementEquationEnum():
+ 	"""
+@@ -374,7 +376,7 @@
+ 	      macro=FlowequationElementEquationEnum()
+ 	"""
+ 
+-	return StringToEnum('FlowequationElementEquation')
++	return StringToEnum('FlowequationElementEquation')[0]
+ 
+ def FlowequationIshutterEnum():
+ 	"""
+@@ -384,7 +386,7 @@
+ 	      macro=FlowequationIshutterEnum()
+ 	"""
+ 
+-	return StringToEnum('FlowequationIshutter')
++	return StringToEnum('FlowequationIshutter')[0]
+ 
+ def FlowequationIsmacayealpattynEnum():
+ 	"""
+@@ -394,7 +396,7 @@
+ 	      macro=FlowequationIsmacayealpattynEnum()
+ 	"""
+ 
+-	return StringToEnum('FlowequationIsmacayealpattyn')
++	return StringToEnum('FlowequationIsmacayealpattyn')[0]
+ 
+ def FlowequationIsstokesEnum():
+ 	"""
+@@ -404,7 +406,7 @@
+ 	      macro=FlowequationIsstokesEnum()
+ 	"""
+ 
+-	return StringToEnum('FlowequationIsstokes')
++	return StringToEnum('FlowequationIsstokes')[0]
+ 
+ def FlowequationVertexEquationEnum():
+ 	"""
+@@ -414,7 +416,7 @@
+ 	      macro=FlowequationVertexEquationEnum()
+ 	"""
+ 
+-	return StringToEnum('FlowequationVertexEquation')
++	return StringToEnum('FlowequationVertexEquation')[0]
+ 
+ def FrictionCoefficientEnum():
+ 	"""
+@@ -424,7 +426,7 @@
+ 	      macro=FrictionCoefficientEnum()
+ 	"""
+ 
+-	return StringToEnum('FrictionCoefficient')
++	return StringToEnum('FrictionCoefficient')[0]
+ 
+ def FrictionPEnum():
+ 	"""
+@@ -434,7 +436,7 @@
+ 	      macro=FrictionPEnum()
+ 	"""
+ 
+-	return StringToEnum('FrictionP')
++	return StringToEnum('FrictionP')[0]
+ 
+ def FrictionQEnum():
+ 	"""
+@@ -444,7 +446,7 @@
+ 	      macro=FrictionQEnum()
+ 	"""
+ 
+-	return StringToEnum('FrictionQ')
++	return StringToEnum('FrictionQ')[0]
+ 
+ def GeometryHydrostaticRatioEnum():
+ 	"""
+@@ -454,7 +456,7 @@
+ 	      macro=GeometryHydrostaticRatioEnum()
+ 	"""
+ 
+-	return StringToEnum('GeometryHydrostaticRatio')
++	return StringToEnum('GeometryHydrostaticRatio')[0]
+ 
+ def HydrologyCREnum():
+ 	"""
+@@ -464,7 +466,7 @@
+ 	      macro=HydrologyCREnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologyCR')
++	return StringToEnum('HydrologyCR')[0]
+ 
+ def HydrologyKnEnum():
+ 	"""
+@@ -474,7 +476,7 @@
+ 	      macro=HydrologyKnEnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologyKn')
++	return StringToEnum('HydrologyKn')[0]
+ 
+ def HydrologyNEnum():
+ 	"""
+@@ -484,7 +486,7 @@
+ 	      macro=HydrologyNEnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologyN')
++	return StringToEnum('HydrologyN')[0]
+ 
+ def HydrologyPEnum():
+ 	"""
+@@ -494,7 +496,7 @@
+ 	      macro=HydrologyPEnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologyP')
++	return StringToEnum('HydrologyP')[0]
+ 
+ def HydrologyQEnum():
+ 	"""
+@@ -504,7 +506,7 @@
+ 	      macro=HydrologyQEnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologyQ')
++	return StringToEnum('HydrologyQ')[0]
+ 
+ def HydrologySpcwatercolumnEnum():
+ 	"""
+@@ -514,7 +516,7 @@
+ 	      macro=HydrologySpcwatercolumnEnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologySpcwatercolumn')
++	return StringToEnum('HydrologySpcwatercolumn')[0]
+ 
+ def HydrologyStabilizationEnum():
+ 	"""
+@@ -524,7 +526,7 @@
+ 	      macro=HydrologyStabilizationEnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologyStabilization')
++	return StringToEnum('HydrologyStabilization')[0]
+ 
+ def InversionControlParametersEnum():
+ 	"""
+@@ -534,7 +536,7 @@
+ 	      macro=InversionControlParametersEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionControlParameters')
++	return StringToEnum('InversionControlParameters')[0]
+ 
+ def InversionCostFunctionEnum():
+ 	"""
+@@ -544,7 +546,7 @@
+ 	      macro=InversionCostFunctionEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionCostFunction')
++	return StringToEnum('InversionCostFunction')[0]
+ 
+ def InversionCostFunctionThresholdEnum():
+ 	"""
+@@ -554,7 +556,7 @@
+ 	      macro=InversionCostFunctionThresholdEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionCostFunctionThreshold')
++	return StringToEnum('InversionCostFunctionThreshold')[0]
+ 
+ def InversionCostFunctionsCoefficientsEnum():
+ 	"""
+@@ -564,7 +566,7 @@
+ 	      macro=InversionCostFunctionsCoefficientsEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionCostFunctionsCoefficients')
++	return StringToEnum('InversionCostFunctionsCoefficients')[0]
+ 
+ def InversionCostFunctionsEnum():
+ 	"""
+@@ -574,7 +576,7 @@
+ 	      macro=InversionCostFunctionsEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionCostFunctions')
++	return StringToEnum('InversionCostFunctions')[0]
+ 
+ def InversionGradientOnlyEnum():
+ 	"""
+@@ -584,7 +586,7 @@
+ 	      macro=InversionGradientOnlyEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionGradientOnly')
++	return StringToEnum('InversionGradientOnly')[0]
+ 
+ def InversionGradientScalingEnum():
+ 	"""
+@@ -594,7 +596,7 @@
+ 	      macro=InversionGradientScalingEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionGradientScaling')
++	return StringToEnum('InversionGradientScaling')[0]
+ 
+ def InversionIscontrolEnum():
+ 	"""
+@@ -604,7 +606,7 @@
+ 	      macro=InversionIscontrolEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionIscontrol')
++	return StringToEnum('InversionIscontrol')[0]
+ 
+ def InversionTaoEnum():
+ 	"""
+@@ -614,7 +616,7 @@
+ 	      macro=InversionTaoEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionTao')
++	return StringToEnum('InversionTao')[0]
+ 
+ def InversionIncompleteAdjointEnum():
+ 	"""
+@@ -624,7 +626,7 @@
+ 	      macro=InversionIncompleteAdjointEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionIncompleteAdjoint')
++	return StringToEnum('InversionIncompleteAdjoint')[0]
+ 
+ def InversionMaxParametersEnum():
+ 	"""
+@@ -634,7 +636,7 @@
+ 	      macro=InversionMaxParametersEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionMaxParameters')
++	return StringToEnum('InversionMaxParameters')[0]
+ 
+ def InversionMaxiterPerStepEnum():
+ 	"""
+@@ -644,7 +646,7 @@
+ 	      macro=InversionMaxiterPerStepEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionMaxiterPerStep')
++	return StringToEnum('InversionMaxiterPerStep')[0]
+ 
+ def InversionMinParametersEnum():
+ 	"""
+@@ -654,7 +656,7 @@
+ 	      macro=InversionMinParametersEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionMinParameters')
++	return StringToEnum('InversionMinParameters')[0]
+ 
+ def InversionNstepsEnum():
+ 	"""
+@@ -664,7 +666,7 @@
+ 	      macro=InversionNstepsEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionNsteps')
++	return StringToEnum('InversionNsteps')[0]
+ 
+ def InversionNumControlParametersEnum():
+ 	"""
+@@ -674,7 +676,7 @@
+ 	      macro=InversionNumControlParametersEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionNumControlParameters')
++	return StringToEnum('InversionNumControlParameters')[0]
+ 
+ def InversionNumCostFunctionsEnum():
+ 	"""
+@@ -684,7 +686,7 @@
+ 	      macro=InversionNumCostFunctionsEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionNumCostFunctions')
++	return StringToEnum('InversionNumCostFunctions')[0]
+ 
+ def InversionStepThresholdEnum():
+ 	"""
+@@ -694,7 +696,7 @@
+ 	      macro=InversionStepThresholdEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionStepThreshold')
++	return StringToEnum('InversionStepThreshold')[0]
+ 
+ def InversionThicknessObsEnum():
+ 	"""
+@@ -704,7 +706,7 @@
+ 	      macro=InversionThicknessObsEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionThicknessObs')
++	return StringToEnum('InversionThicknessObs')[0]
+ 
+ def InversionVelObsEnum():
+ 	"""
+@@ -714,7 +716,7 @@
+ 	      macro=InversionVelObsEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionVelObs')
++	return StringToEnum('InversionVelObs')[0]
+ 
+ def InversionVxObsEnum():
+ 	"""
+@@ -724,7 +726,7 @@
+ 	      macro=InversionVxObsEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionVxObs')
++	return StringToEnum('InversionVxObs')[0]
+ 
+ def InversionVyObsEnum():
+ 	"""
+@@ -734,7 +736,7 @@
+ 	      macro=InversionVyObsEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionVyObs')
++	return StringToEnum('InversionVyObs')[0]
+ 
+ def InversionVzObsEnum():
+ 	"""
+@@ -744,7 +746,7 @@
+ 	      macro=InversionVzObsEnum()
+ 	"""
+ 
+-	return StringToEnum('InversionVzObs')
++	return StringToEnum('InversionVzObs')[0]
+ 
+ def MaskElementonfloatingiceEnum():
+ 	"""
+@@ -754,7 +756,7 @@
+ 	      macro=MaskElementonfloatingiceEnum()
+ 	"""
+ 
+-	return StringToEnum('MaskElementonfloatingice')
++	return StringToEnum('MaskElementonfloatingice')[0]
+ 
+ def MaskElementongroundediceEnum():
+ 	"""
+@@ -764,7 +766,7 @@
+ 	      macro=MaskElementongroundediceEnum()
+ 	"""
+ 
+-	return StringToEnum('MaskElementongroundedice')
++	return StringToEnum('MaskElementongroundedice')[0]
+ 
+ def MaskElementonwaterEnum():
+ 	"""
+@@ -774,7 +776,7 @@
+ 	      macro=MaskElementonwaterEnum()
+ 	"""
+ 
+-	return StringToEnum('MaskElementonwater')
++	return StringToEnum('MaskElementonwater')[0]
+ 
+ def MaskVertexonfloatingiceEnum():
+ 	"""
+@@ -784,7 +786,7 @@
+ 	      macro=MaskVertexonfloatingiceEnum()
+ 	"""
+ 
+-	return StringToEnum('MaskVertexonfloatingice')
++	return StringToEnum('MaskVertexonfloatingice')[0]
+ 
+ def MaskVertexongroundediceEnum():
+ 	"""
+@@ -794,7 +796,7 @@
+ 	      macro=MaskVertexongroundediceEnum()
+ 	"""
+ 
+-	return StringToEnum('MaskVertexongroundedice')
++	return StringToEnum('MaskVertexongroundedice')[0]
+ 
+ def MaskVertexonwaterEnum():
+ 	"""
+@@ -804,7 +806,7 @@
+ 	      macro=MaskVertexonwaterEnum()
+ 	"""
+ 
+-	return StringToEnum('MaskVertexonwater')
++	return StringToEnum('MaskVertexonwater')[0]
+ 
+ def MaterialsBetaEnum():
+ 	"""
+@@ -814,7 +816,7 @@
+ 	      macro=MaterialsBetaEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsBeta')
++	return StringToEnum('MaterialsBeta')[0]
+ 
+ def MaterialsHeatcapacityEnum():
+ 	"""
+@@ -824,7 +826,7 @@
+ 	      macro=MaterialsHeatcapacityEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsHeatcapacity')
++	return StringToEnum('MaterialsHeatcapacity')[0]
+ 
+ def MaterialsLatentheatEnum():
+ 	"""
+@@ -834,7 +836,7 @@
+ 	      macro=MaterialsLatentheatEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsLatentheat')
++	return StringToEnum('MaterialsLatentheat')[0]
+ 
+ def MaterialsMeltingpointEnum():
+ 	"""
+@@ -844,7 +846,7 @@
+ 	      macro=MaterialsMeltingpointEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsMeltingpoint')
++	return StringToEnum('MaterialsMeltingpoint')[0]
+ 
+ def MaterialsMixedLayerCapacityEnum():
+ 	"""
+@@ -854,7 +856,7 @@
+ 	      macro=MaterialsMixedLayerCapacityEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsMixedLayerCapacity')
++	return StringToEnum('MaterialsMixedLayerCapacity')[0]
+ 
+ def MaterialsRheologyBEnum():
+ 	"""
+@@ -864,7 +866,7 @@
+ 	      macro=MaterialsRheologyBEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsRheologyB')
++	return StringToEnum('MaterialsRheologyB')[0]
+ 
+ def MaterialsRheologyBbarEnum():
+ 	"""
+@@ -874,7 +876,7 @@
+ 	      macro=MaterialsRheologyBbarEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsRheologyBbar')
++	return StringToEnum('MaterialsRheologyBbar')[0]
+ 
+ def MaterialsRheologyLawEnum():
+ 	"""
+@@ -884,7 +886,7 @@
+ 	      macro=MaterialsRheologyLawEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsRheologyLaw')
++	return StringToEnum('MaterialsRheologyLaw')[0]
+ 
+ def MaterialsRheologyNEnum():
+ 	"""
+@@ -894,7 +896,7 @@
+ 	      macro=MaterialsRheologyNEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsRheologyN')
++	return StringToEnum('MaterialsRheologyN')[0]
+ 
+ def MaterialsRhoIceEnum():
+ 	"""
+@@ -904,7 +906,7 @@
+ 	      macro=MaterialsRhoIceEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsRhoIce')
++	return StringToEnum('MaterialsRhoIce')[0]
+ 
+ def MaterialsRhoWaterEnum():
+ 	"""
+@@ -914,7 +916,7 @@
+ 	      macro=MaterialsRhoWaterEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsRhoWater')
++	return StringToEnum('MaterialsRhoWater')[0]
+ 
+ def MaterialsRhoFreshwaterEnum():
+ 	"""
+@@ -924,7 +926,7 @@
+ 	      macro=MaterialsRhoFreshwaterEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsRhoFreshwater')
++	return StringToEnum('MaterialsRhoFreshwater')[0]
+ 
+ def MaterialsMuWaterEnum():
+ 	"""
+@@ -934,7 +936,7 @@
+ 	      macro=MaterialsMuWaterEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsMuWater')
++	return StringToEnum('MaterialsMuWater')[0]
+ 
+ def MaterialsThermalExchangeVelocityEnum():
+ 	"""
+@@ -944,7 +946,7 @@
+ 	      macro=MaterialsThermalExchangeVelocityEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsThermalExchangeVelocity')
++	return StringToEnum('MaterialsThermalExchangeVelocity')[0]
+ 
+ def MaterialsThermalconductivityEnum():
+ 	"""
+@@ -954,7 +956,7 @@
+ 	      macro=MaterialsThermalconductivityEnum()
+ 	"""
+ 
+-	return StringToEnum('MaterialsThermalconductivity')
++	return StringToEnum('MaterialsThermalconductivity')[0]
+ 
+ def MeshAverageVertexConnectivityEnum():
+ 	"""
+@@ -964,7 +966,7 @@
+ 	      macro=MeshAverageVertexConnectivityEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshAverageVertexConnectivity')
++	return StringToEnum('MeshAverageVertexConnectivity')[0]
+ 
+ def MeshDimensionEnum():
+ 	"""
+@@ -974,7 +976,7 @@
+ 	      macro=MeshDimensionEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshDimension')
++	return StringToEnum('MeshDimension')[0]
+ 
+ def MeshEdgesEnum():
+ 	"""
+@@ -984,7 +986,7 @@
+ 	      macro=MeshEdgesEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshEdges')
++	return StringToEnum('MeshEdges')[0]
+ 
+ def MeshElementconnectivityEnum():
+ 	"""
+@@ -994,7 +996,7 @@
+ 	      macro=MeshElementconnectivityEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshElementconnectivity')
++	return StringToEnum('MeshElementconnectivity')[0]
+ 
+ def MeshElementonbedEnum():
+ 	"""
+@@ -1004,7 +1006,7 @@
+ 	      macro=MeshElementonbedEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshElementonbed')
++	return StringToEnum('MeshElementonbed')[0]
+ 
+ def MeshElementonsurfaceEnum():
+ 	"""
+@@ -1014,7 +1016,7 @@
+ 	      macro=MeshElementonsurfaceEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshElementonsurface')
++	return StringToEnum('MeshElementonsurface')[0]
+ 
+ def MeshElements2dEnum():
+ 	"""
+@@ -1024,7 +1026,7 @@
+ 	      macro=MeshElements2dEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshElements2d')
++	return StringToEnum('MeshElements2d')[0]
+ 
+ def MeshElementsEnum():
+ 	"""
+@@ -1034,7 +1036,7 @@
+ 	      macro=MeshElementsEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshElements')
++	return StringToEnum('MeshElements')[0]
+ 
+ def MeshLowerelementsEnum():
+ 	"""
+@@ -1044,7 +1046,7 @@
+ 	      macro=MeshLowerelementsEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshLowerelements')
++	return StringToEnum('MeshLowerelements')[0]
+ 
+ def MeshNumberofedgesEnum():
+ 	"""
+@@ -1054,7 +1056,7 @@
+ 	      macro=MeshNumberofedgesEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshNumberofedges')
++	return StringToEnum('MeshNumberofedges')[0]
+ 
+ def MeshNumberofelements2dEnum():
+ 	"""
+@@ -1064,7 +1066,7 @@
+ 	      macro=MeshNumberofelements2dEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshNumberofelements2d')
++	return StringToEnum('MeshNumberofelements2d')[0]
+ 
+ def MeshNumberofelementsEnum():
+ 	"""
+@@ -1074,7 +1076,7 @@
+ 	      macro=MeshNumberofelementsEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshNumberofelements')
++	return StringToEnum('MeshNumberofelements')[0]
+ 
+ def MeshNumberoflayersEnum():
+ 	"""
+@@ -1084,7 +1086,7 @@
+ 	      macro=MeshNumberoflayersEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshNumberoflayers')
++	return StringToEnum('MeshNumberoflayers')[0]
+ 
+ def MeshNumberofvertices2dEnum():
+ 	"""
+@@ -1094,7 +1096,7 @@
+ 	      macro=MeshNumberofvertices2dEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshNumberofvertices2d')
++	return StringToEnum('MeshNumberofvertices2d')[0]
+ 
+ def MeshNumberofverticesEnum():
+ 	"""
+@@ -1104,7 +1106,7 @@
+ 	      macro=MeshNumberofverticesEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshNumberofvertices')
++	return StringToEnum('MeshNumberofvertices')[0]
+ 
+ def MeshUpperelementsEnum():
+ 	"""
+@@ -1114,7 +1116,7 @@
+ 	      macro=MeshUpperelementsEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshUpperelements')
++	return StringToEnum('MeshUpperelements')[0]
+ 
+ def MeshVertexonbedEnum():
+ 	"""
+@@ -1124,7 +1126,7 @@
+ 	      macro=MeshVertexonbedEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshVertexonbed')
++	return StringToEnum('MeshVertexonbed')[0]
+ 
+ def MeshVertexonsurfaceEnum():
+ 	"""
+@@ -1134,7 +1136,7 @@
+ 	      macro=MeshVertexonsurfaceEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshVertexonsurface')
++	return StringToEnum('MeshVertexonsurface')[0]
+ 
+ def MeshXEnum():
+ 	"""
+@@ -1144,7 +1146,7 @@
+ 	      macro=MeshXEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshX')
++	return StringToEnum('MeshX')[0]
+ 
+ def MeshYEnum():
+ 	"""
+@@ -1154,7 +1156,7 @@
+ 	      macro=MeshYEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshY')
++	return StringToEnum('MeshY')[0]
+ 
+ def MeshZEnum():
+ 	"""
+@@ -1164,7 +1166,7 @@
+ 	      macro=MeshZEnum()
+ 	"""
+ 
+-	return StringToEnum('MeshZ')
++	return StringToEnum('MeshZ')[0]
+ 
+ def MiscellaneousNameEnum():
+ 	"""
+@@ -1174,7 +1176,7 @@
+ 	      macro=MiscellaneousNameEnum()
+ 	"""
+ 
+-	return StringToEnum('MiscellaneousName')
++	return StringToEnum('MiscellaneousName')[0]
+ 
+ def PrognosticHydrostaticAdjustmentEnum():
+ 	"""
+@@ -1184,7 +1186,7 @@
+ 	      macro=PrognosticHydrostaticAdjustmentEnum()
+ 	"""
+ 
+-	return StringToEnum('PrognosticHydrostaticAdjustment')
++	return StringToEnum('PrognosticHydrostaticAdjustment')[0]
+ 
+ def PrognosticMinThicknessEnum():
+ 	"""
+@@ -1194,7 +1196,7 @@
+ 	      macro=PrognosticMinThicknessEnum()
+ 	"""
+ 
+-	return StringToEnum('PrognosticMinThickness')
++	return StringToEnum('PrognosticMinThickness')[0]
+ 
+ def PrognosticPenaltyFactorEnum():
+ 	"""
+@@ -1204,7 +1206,7 @@
+ 	      macro=PrognosticPenaltyFactorEnum()
+ 	"""
+ 
+-	return StringToEnum('PrognosticPenaltyFactor')
++	return StringToEnum('PrognosticPenaltyFactor')[0]
+ 
+ def PrognosticSpcthicknessEnum():
+ 	"""
+@@ -1214,7 +1216,7 @@
+ 	      macro=PrognosticSpcthicknessEnum()
+ 	"""
+ 
+-	return StringToEnum('PrognosticSpcthickness')
++	return StringToEnum('PrognosticSpcthickness')[0]
+ 
+ def PrognosticStabilizationEnum():
+ 	"""
+@@ -1224,7 +1226,7 @@
+ 	      macro=PrognosticStabilizationEnum()
+ 	"""
+ 
+-	return StringToEnum('PrognosticStabilization')
++	return StringToEnum('PrognosticStabilization')[0]
+ 
+ def PrognosticVertexPairingEnum():
+ 	"""
+@@ -1234,7 +1236,7 @@
+ 	      macro=PrognosticVertexPairingEnum()
+ 	"""
+ 
+-	return StringToEnum('PrognosticVertexPairing')
++	return StringToEnum('PrognosticVertexPairing')[0]
+ 
+ def QmuIsdakotaEnum():
+ 	"""
+@@ -1244,7 +1246,7 @@
+ 	      macro=QmuIsdakotaEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuIsdakota')
++	return StringToEnum('QmuIsdakota')[0]
+ 
+ def QmuMassFluxSegmentsEnum():
+ 	"""
+@@ -1254,7 +1256,7 @@
+ 	      macro=QmuMassFluxSegmentsEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuMassFluxSegments')
++	return StringToEnum('QmuMassFluxSegments')[0]
+ 
+ def QmuNumberofpartitionsEnum():
+ 	"""
+@@ -1264,7 +1266,7 @@
+ 	      macro=QmuNumberofpartitionsEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuNumberofpartitions')
++	return StringToEnum('QmuNumberofpartitions')[0]
+ 
+ def QmuNumberofresponsesEnum():
+ 	"""
+@@ -1274,7 +1276,7 @@
+ 	      macro=QmuNumberofresponsesEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuNumberofresponses')
++	return StringToEnum('QmuNumberofresponses')[0]
+ 
+ def QmuPartitionEnum():
+ 	"""
+@@ -1284,7 +1286,7 @@
+ 	      macro=QmuPartitionEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuPartition')
++	return StringToEnum('QmuPartition')[0]
+ 
+ def QmuResponsedescriptorsEnum():
+ 	"""
+@@ -1294,7 +1296,7 @@
+ 	      macro=QmuResponsedescriptorsEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuResponsedescriptors')
++	return StringToEnum('QmuResponsedescriptors')[0]
+ 
+ def QmuVariabledescriptorsEnum():
+ 	"""
+@@ -1304,7 +1306,7 @@
+ 	      macro=QmuVariabledescriptorsEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuVariabledescriptors')
++	return StringToEnum('QmuVariabledescriptors')[0]
+ 
+ def RiftsNumriftsEnum():
+ 	"""
+@@ -1314,7 +1316,7 @@
+ 	      macro=RiftsNumriftsEnum()
+ 	"""
+ 
+-	return StringToEnum('RiftsNumrifts')
++	return StringToEnum('RiftsNumrifts')[0]
+ 
+ def RiftsRiftstructEnum():
+ 	"""
+@@ -1324,7 +1326,7 @@
+ 	      macro=RiftsRiftstructEnum()
+ 	"""
+ 
+-	return StringToEnum('RiftsRiftstruct')
++	return StringToEnum('RiftsRiftstruct')[0]
+ 
+ def SettingsIoGatherEnum():
+ 	"""
+@@ -1334,7 +1336,7 @@
+ 	      macro=SettingsIoGatherEnum()
+ 	"""
+ 
+-	return StringToEnum('SettingsIoGather')
++	return StringToEnum('SettingsIoGather')[0]
+ 
+ def SettingsLowmemEnum():
+ 	"""
+@@ -1344,7 +1346,7 @@
+ 	      macro=SettingsLowmemEnum()
+ 	"""
+ 
+-	return StringToEnum('SettingsLowmem')
++	return StringToEnum('SettingsLowmem')[0]
+ 
+ def SettingsOutputFrequencyEnum():
+ 	"""
+@@ -1354,7 +1356,7 @@
+ 	      macro=SettingsOutputFrequencyEnum()
+ 	"""
+ 
+-	return StringToEnum('SettingsOutputFrequency')
++	return StringToEnum('SettingsOutputFrequency')[0]
+ 
+ def SettingsResultsAsPatchesEnum():
+ 	"""
+@@ -1364,7 +1366,7 @@
+ 	      macro=SettingsResultsAsPatchesEnum()
+ 	"""
+ 
+-	return StringToEnum('SettingsResultsAsPatches')
++	return StringToEnum('SettingsResultsAsPatches')[0]
+ 
+ def SettingsWaitonlockEnum():
+ 	"""
+@@ -1374,7 +1376,7 @@
+ 	      macro=SettingsWaitonlockEnum()
+ 	"""
+ 
+-	return StringToEnum('SettingsWaitonlock')
++	return StringToEnum('SettingsWaitonlock')[0]
+ 
+ def SurfaceforcingsDelta18oEnum():
+ 	"""
+@@ -1384,7 +1386,7 @@
+ 	      macro=SurfaceforcingsDelta18oEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsDelta18o')
++	return StringToEnum('SurfaceforcingsDelta18o')[0]
+ 
+ def SurfaceforcingsDelta18oSurfaceEnum():
+ 	"""
+@@ -1394,7 +1396,7 @@
+ 	      macro=SurfaceforcingsDelta18oSurfaceEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsDelta18oSurface')
++	return StringToEnum('SurfaceforcingsDelta18oSurface')[0]
+ 
+ def SurfaceforcingsIsdelta18oEnum():
+ 	"""
+@@ -1404,7 +1406,7 @@
+ 	      macro=SurfaceforcingsIsdelta18oEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsIsdelta18o')
++	return StringToEnum('SurfaceforcingsIsdelta18o')[0]
+ 
+ def SurfaceforcingsPrecipitationsPresentdayEnum():
+ 	"""
+@@ -1414,7 +1416,7 @@
+ 	      macro=SurfaceforcingsPrecipitationsPresentdayEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsPrecipitationsPresentday')
++	return StringToEnum('SurfaceforcingsPrecipitationsPresentday')[0]
+ 
+ def SurfaceforcingsTemperaturesPresentdayEnum():
+ 	"""
+@@ -1424,7 +1426,7 @@
+ 	      macro=SurfaceforcingsTemperaturesPresentdayEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsTemperaturesPresentday')
++	return StringToEnum('SurfaceforcingsTemperaturesPresentday')[0]
+ 
+ def SurfaceforcingsTemperaturesLgmEnum():
+ 	"""
+@@ -1434,7 +1436,7 @@
+ 	      macro=SurfaceforcingsTemperaturesLgmEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsTemperaturesLgm')
++	return StringToEnum('SurfaceforcingsTemperaturesLgm')[0]
+ 
+ def DebugProfilingEnum():
+ 	"""
+@@ -1444,7 +1446,7 @@
+ 	      macro=DebugProfilingEnum()
+ 	"""
+ 
+-	return StringToEnum('DebugProfiling')
++	return StringToEnum('DebugProfiling')[0]
+ 
+ def ProfilingCurrentMemEnum():
+ 	"""
+@@ -1454,7 +1456,7 @@
+ 	      macro=ProfilingCurrentMemEnum()
+ 	"""
+ 
+-	return StringToEnum('ProfilingCurrentMem')
++	return StringToEnum('ProfilingCurrentMem')[0]
+ 
+ def ProfilingCurrentFlopsEnum():
+ 	"""
+@@ -1464,7 +1466,7 @@
+ 	      macro=ProfilingCurrentFlopsEnum()
+ 	"""
+ 
+-	return StringToEnum('ProfilingCurrentFlops')
++	return StringToEnum('ProfilingCurrentFlops')[0]
+ 
+ def ProfilingSolutionTimeEnum():
+ 	"""
+@@ -1474,7 +1476,7 @@
+ 	      macro=ProfilingSolutionTimeEnum()
+ 	"""
+ 
+-	return StringToEnum('ProfilingSolutionTime')
++	return StringToEnum('ProfilingSolutionTime')[0]
+ 
+ def MaxIterationConvergenceFlagEnum():
+ 	"""
+@@ -1484,7 +1486,7 @@
+ 	      macro=MaxIterationConvergenceFlagEnum()
+ 	"""
+ 
+-	return StringToEnum('MaxIterationConvergenceFlag')
++	return StringToEnum('MaxIterationConvergenceFlag')[0]
+ 
+ def SteadystateMaxiterEnum():
+ 	"""
+@@ -1494,7 +1496,7 @@
+ 	      macro=SteadystateMaxiterEnum()
+ 	"""
+ 
+-	return StringToEnum('SteadystateMaxiter')
++	return StringToEnum('SteadystateMaxiter')[0]
+ 
+ def SteadystateNumRequestedOutputsEnum():
+ 	"""
+@@ -1504,7 +1506,7 @@
+ 	      macro=SteadystateNumRequestedOutputsEnum()
+ 	"""
+ 
+-	return StringToEnum('SteadystateNumRequestedOutputs')
++	return StringToEnum('SteadystateNumRequestedOutputs')[0]
+ 
+ def SteadystateReltolEnum():
+ 	"""
+@@ -1514,7 +1516,7 @@
+ 	      macro=SteadystateReltolEnum()
+ 	"""
+ 
+-	return StringToEnum('SteadystateReltol')
++	return StringToEnum('SteadystateReltol')[0]
+ 
+ def SteadystateRequestedOutputsEnum():
+ 	"""
+@@ -1524,7 +1526,7 @@
+ 	      macro=SteadystateRequestedOutputsEnum()
+ 	"""
+ 
+-	return StringToEnum('SteadystateRequestedOutputs')
++	return StringToEnum('SteadystateRequestedOutputs')[0]
+ 
+ def SurfaceEnum():
+ 	"""
+@@ -1534,7 +1536,7 @@
+ 	      macro=SurfaceEnum()
+ 	"""
+ 
+-	return StringToEnum('Surface')
++	return StringToEnum('Surface')[0]
+ 
+ def SurfaceforcingsPrecipitationEnum():
+ 	"""
+@@ -1544,7 +1546,7 @@
+ 	      macro=SurfaceforcingsPrecipitationEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsPrecipitation')
++	return StringToEnum('SurfaceforcingsPrecipitation')[0]
+ 
+ def SurfaceforcingsMassBalanceEnum():
+ 	"""
+@@ -1554,7 +1556,7 @@
+ 	      macro=SurfaceforcingsMassBalanceEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsMassBalance')
++	return StringToEnum('SurfaceforcingsMassBalance')[0]
+ 
+ def SurfaceforcingsIspddEnum():
+ 	"""
+@@ -1564,7 +1566,7 @@
+ 	      macro=SurfaceforcingsIspddEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsIspdd')
++	return StringToEnum('SurfaceforcingsIspdd')[0]
+ 
+ def SurfaceforcingsIssmbgradientsEnum():
+ 	"""
+@@ -1574,7 +1576,7 @@
+ 	      macro=SurfaceforcingsIssmbgradientsEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsIssmbgradients')
++	return StringToEnum('SurfaceforcingsIssmbgradients')[0]
+ 
+ def SurfaceforcingsMonthlytemperaturesEnum():
+ 	"""
+@@ -1584,7 +1586,7 @@
+ 	      macro=SurfaceforcingsMonthlytemperaturesEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsMonthlytemperatures')
++	return StringToEnum('SurfaceforcingsMonthlytemperatures')[0]
+ 
+ def SurfaceforcingsHcEnum():
+ 	"""
+@@ -1594,7 +1596,7 @@
+ 	      macro=SurfaceforcingsHcEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsHc')
++	return StringToEnum('SurfaceforcingsHc')[0]
+ 
+ def SurfaceforcingsSmbPosMaxEnum():
+ 	"""
+@@ -1604,7 +1606,7 @@
+ 	      macro=SurfaceforcingsSmbPosMaxEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsSmbPosMax')
++	return StringToEnum('SurfaceforcingsSmbPosMax')[0]
+ 
+ def SurfaceforcingsSmbPosMinEnum():
+ 	"""
+@@ -1614,7 +1616,7 @@
+ 	      macro=SurfaceforcingsSmbPosMinEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsSmbPosMin')
++	return StringToEnum('SurfaceforcingsSmbPosMin')[0]
+ 
+ def SurfaceforcingsAPosEnum():
+ 	"""
+@@ -1624,7 +1626,7 @@
+ 	      macro=SurfaceforcingsAPosEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsAPos')
++	return StringToEnum('SurfaceforcingsAPos')[0]
+ 
+ def SurfaceforcingsBPosEnum():
+ 	"""
+@@ -1634,7 +1636,7 @@
+ 	      macro=SurfaceforcingsBPosEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsBPos')
++	return StringToEnum('SurfaceforcingsBPos')[0]
+ 
+ def SurfaceforcingsANegEnum():
+ 	"""
+@@ -1644,7 +1646,7 @@
+ 	      macro=SurfaceforcingsANegEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsANeg')
++	return StringToEnum('SurfaceforcingsANeg')[0]
+ 
+ def SurfaceforcingsBNegEnum():
+ 	"""
+@@ -1654,7 +1656,7 @@
+ 	      macro=SurfaceforcingsBNegEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceforcingsBNeg')
++	return StringToEnum('SurfaceforcingsBNeg')[0]
+ 
+ def ThermalMaxiterEnum():
+ 	"""
+@@ -1664,7 +1666,7 @@
+ 	      macro=ThermalMaxiterEnum()
+ 	"""
+ 
+-	return StringToEnum('ThermalMaxiter')
++	return StringToEnum('ThermalMaxiter')[0]
+ 
+ def ThermalPenaltyFactorEnum():
+ 	"""
+@@ -1674,7 +1676,7 @@
+ 	      macro=ThermalPenaltyFactorEnum()
+ 	"""
+ 
+-	return StringToEnum('ThermalPenaltyFactor')
++	return StringToEnum('ThermalPenaltyFactor')[0]
+ 
+ def ThermalPenaltyLockEnum():
+ 	"""
+@@ -1684,7 +1686,7 @@
+ 	      macro=ThermalPenaltyLockEnum()
+ 	"""
+ 
+-	return StringToEnum('ThermalPenaltyLock')
++	return StringToEnum('ThermalPenaltyLock')[0]
+ 
+ def ThermalPenaltyThresholdEnum():
+ 	"""
+@@ -1694,7 +1696,7 @@
+ 	      macro=ThermalPenaltyThresholdEnum()
+ 	"""
+ 
+-	return StringToEnum('ThermalPenaltyThreshold')
++	return StringToEnum('ThermalPenaltyThreshold')[0]
+ 
+ def ThermalSpctemperatureEnum():
+ 	"""
+@@ -1704,7 +1706,7 @@
+ 	      macro=ThermalSpctemperatureEnum()
+ 	"""
+ 
+-	return StringToEnum('ThermalSpctemperature')
++	return StringToEnum('ThermalSpctemperature')[0]
+ 
+ def ThermalStabilizationEnum():
+ 	"""
+@@ -1714,7 +1716,7 @@
+ 	      macro=ThermalStabilizationEnum()
+ 	"""
+ 
+-	return StringToEnum('ThermalStabilization')
++	return StringToEnum('ThermalStabilization')[0]
+ 
+ def ThermalIsenthalpyEnum():
+ 	"""
+@@ -1724,7 +1726,7 @@
+ 	      macro=ThermalIsenthalpyEnum()
+ 	"""
+ 
+-	return StringToEnum('ThermalIsenthalpy')
++	return StringToEnum('ThermalIsenthalpy')[0]
+ 
+ def ThicknessEnum():
+ 	"""
+@@ -1734,7 +1736,7 @@
+ 	      macro=ThicknessEnum()
+ 	"""
+ 
+-	return StringToEnum('Thickness')
++	return StringToEnum('Thickness')[0]
+ 
+ def TimesteppingStartTimeEnum():
+ 	"""
+@@ -1744,7 +1746,7 @@
+ 	      macro=TimesteppingStartTimeEnum()
+ 	"""
+ 
+-	return StringToEnum('TimesteppingStartTime')
++	return StringToEnum('TimesteppingStartTime')[0]
+ 
+ def TimesteppingFinalTimeEnum():
+ 	"""
+@@ -1754,7 +1756,7 @@
+ 	      macro=TimesteppingFinalTimeEnum()
+ 	"""
+ 
+-	return StringToEnum('TimesteppingFinalTime')
++	return StringToEnum('TimesteppingFinalTime')[0]
+ 
+ def TimesteppingCflCoefficientEnum():
+ 	"""
+@@ -1764,7 +1766,7 @@
+ 	      macro=TimesteppingCflCoefficientEnum()
+ 	"""
+ 
+-	return StringToEnum('TimesteppingCflCoefficient')
++	return StringToEnum('TimesteppingCflCoefficient')[0]
+ 
+ def TimesteppingTimeAdaptEnum():
+ 	"""
+@@ -1774,7 +1776,7 @@
+ 	      macro=TimesteppingTimeAdaptEnum()
+ 	"""
+ 
+-	return StringToEnum('TimesteppingTimeAdapt')
++	return StringToEnum('TimesteppingTimeAdapt')[0]
+ 
+ def TimesteppingTimeStepEnum():
+ 	"""
+@@ -1784,7 +1786,7 @@
+ 	      macro=TimesteppingTimeStepEnum()
+ 	"""
+ 
+-	return StringToEnum('TimesteppingTimeStep')
++	return StringToEnum('TimesteppingTimeStep')[0]
+ 
+ def TransientIsdiagnosticEnum():
+ 	"""
+@@ -1794,7 +1796,7 @@
+ 	      macro=TransientIsdiagnosticEnum()
+ 	"""
+ 
+-	return StringToEnum('TransientIsdiagnostic')
++	return StringToEnum('TransientIsdiagnostic')[0]
+ 
+ def TransientIsgroundinglineEnum():
+ 	"""
+@@ -1804,7 +1806,7 @@
+ 	      macro=TransientIsgroundinglineEnum()
+ 	"""
+ 
+-	return StringToEnum('TransientIsgroundingline')
++	return StringToEnum('TransientIsgroundingline')[0]
+ 
+ def TransientIsprognosticEnum():
+ 	"""
+@@ -1814,7 +1816,7 @@
+ 	      macro=TransientIsprognosticEnum()
+ 	"""
+ 
+-	return StringToEnum('TransientIsprognostic')
++	return StringToEnum('TransientIsprognostic')[0]
+ 
+ def TransientIsthermalEnum():
+ 	"""
+@@ -1824,7 +1826,7 @@
+ 	      macro=TransientIsthermalEnum()
+ 	"""
+ 
+-	return StringToEnum('TransientIsthermal')
++	return StringToEnum('TransientIsthermal')[0]
+ 
+ def TransientNumRequestedOutputsEnum():
+ 	"""
+@@ -1834,7 +1836,7 @@
+ 	      macro=TransientNumRequestedOutputsEnum()
+ 	"""
+ 
+-	return StringToEnum('TransientNumRequestedOutputs')
++	return StringToEnum('TransientNumRequestedOutputs')[0]
+ 
+ def TransientRequestedOutputsEnum():
+ 	"""
+@@ -1844,7 +1846,7 @@
+ 	      macro=TransientRequestedOutputsEnum()
+ 	"""
+ 
+-	return StringToEnum('TransientRequestedOutputs')
++	return StringToEnum('TransientRequestedOutputs')[0]
+ 
+ def SolutionTypeEnum():
+ 	"""
+@@ -1854,7 +1856,7 @@
+ 	      macro=SolutionTypeEnum()
+ 	"""
+ 
+-	return StringToEnum('SolutionType')
++	return StringToEnum('SolutionType')[0]
+ 
+ def AnalysisTypeEnum():
+ 	"""
+@@ -1864,7 +1866,7 @@
+ 	      macro=AnalysisTypeEnum()
+ 	"""
+ 
+-	return StringToEnum('AnalysisType')
++	return StringToEnum('AnalysisType')[0]
+ 
+ def ConfigurationTypeEnum():
+ 	"""
+@@ -1874,7 +1876,7 @@
+ 	      macro=ConfigurationTypeEnum()
+ 	"""
+ 
+-	return StringToEnum('ConfigurationType')
++	return StringToEnum('ConfigurationType')[0]
+ 
+ def AdjointBalancethicknessAnalysisEnum():
+ 	"""
+@@ -1884,7 +1886,7 @@
+ 	      macro=AdjointBalancethicknessAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('AdjointBalancethicknessAnalysis')
++	return StringToEnum('AdjointBalancethicknessAnalysis')[0]
+ 
+ def AdjointHorizAnalysisEnum():
+ 	"""
+@@ -1894,7 +1896,7 @@
+ 	      macro=AdjointHorizAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('AdjointHorizAnalysis')
++	return StringToEnum('AdjointHorizAnalysis')[0]
+ 
+ def AdjointSolutionEnum():
+ 	"""
+@@ -1904,7 +1906,7 @@
+ 	      macro=AdjointSolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('AdjointSolution')
++	return StringToEnum('AdjointSolution')[0]
+ 
+ def AnalysisCounterEnum():
+ 	"""
+@@ -1914,7 +1916,7 @@
+ 	      macro=AnalysisCounterEnum()
+ 	"""
+ 
+-	return StringToEnum('AnalysisCounter')
++	return StringToEnum('AnalysisCounter')[0]
+ 
+ def BalancethicknessAnalysisEnum():
+ 	"""
+@@ -1924,7 +1926,7 @@
+ 	      macro=BalancethicknessAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('BalancethicknessAnalysis')
++	return StringToEnum('BalancethicknessAnalysis')[0]
+ 
+ def BalancethicknessSolutionEnum():
+ 	"""
+@@ -1934,7 +1936,7 @@
+ 	      macro=BalancethicknessSolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('BalancethicknessSolution')
++	return StringToEnum('BalancethicknessSolution')[0]
+ 
+ def BedSlopeAnalysisEnum():
+ 	"""
+@@ -1944,7 +1946,7 @@
+ 	      macro=BedSlopeAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('BedSlopeAnalysis')
++	return StringToEnum('BedSlopeAnalysis')[0]
+ 
+ def BedSlopeSolutionEnum():
+ 	"""
+@@ -1954,7 +1956,7 @@
+ 	      macro=BedSlopeSolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('BedSlopeSolution')
++	return StringToEnum('BedSlopeSolution')[0]
+ 
+ def BedSlopeXAnalysisEnum():
+ 	"""
+@@ -1964,7 +1966,7 @@
+ 	      macro=BedSlopeXAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('BedSlopeXAnalysis')
++	return StringToEnum('BedSlopeXAnalysis')[0]
+ 
+ def BedSlopeYAnalysisEnum():
+ 	"""
+@@ -1974,7 +1976,7 @@
+ 	      macro=BedSlopeYAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('BedSlopeYAnalysis')
++	return StringToEnum('BedSlopeYAnalysis')[0]
+ 
+ def DiagnosticHorizAnalysisEnum():
+ 	"""
+@@ -1984,7 +1986,7 @@
+ 	      macro=DiagnosticHorizAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticHorizAnalysis')
++	return StringToEnum('DiagnosticHorizAnalysis')[0]
+ 
+ def DiagnosticHutterAnalysisEnum():
+ 	"""
+@@ -1994,7 +1996,7 @@
+ 	      macro=DiagnosticHutterAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticHutterAnalysis')
++	return StringToEnum('DiagnosticHutterAnalysis')[0]
+ 
+ def DiagnosticSolutionEnum():
+ 	"""
+@@ -2004,7 +2006,7 @@
+ 	      macro=DiagnosticSolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticSolution')
++	return StringToEnum('DiagnosticSolution')[0]
+ 
+ def DiagnosticVertAnalysisEnum():
+ 	"""
+@@ -2014,7 +2016,7 @@
+ 	      macro=DiagnosticVertAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('DiagnosticVertAnalysis')
++	return StringToEnum('DiagnosticVertAnalysis')[0]
+ 
+ def EnthalpyAnalysisEnum():
+ 	"""
+@@ -2024,7 +2026,7 @@
+ 	      macro=EnthalpyAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('EnthalpyAnalysis')
++	return StringToEnum('EnthalpyAnalysis')[0]
+ 
+ def EnthalpySolutionEnum():
+ 	"""
+@@ -2034,7 +2036,7 @@
+ 	      macro=EnthalpySolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('EnthalpySolution')
++	return StringToEnum('EnthalpySolution')[0]
+ 
+ def FlaimAnalysisEnum():
+ 	"""
+@@ -2044,7 +2046,7 @@
+ 	      macro=FlaimAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('FlaimAnalysis')
++	return StringToEnum('FlaimAnalysis')[0]
+ 
+ def FlaimSolutionEnum():
+ 	"""
+@@ -2054,7 +2056,7 @@
+ 	      macro=FlaimSolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('FlaimSolution')
++	return StringToEnum('FlaimSolution')[0]
+ 
+ def HydrologyAnalysisEnum():
+ 	"""
+@@ -2064,7 +2066,7 @@
+ 	      macro=HydrologyAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologyAnalysis')
++	return StringToEnum('HydrologyAnalysis')[0]
+ 
+ def HydrologySolutionEnum():
+ 	"""
+@@ -2074,7 +2076,7 @@
+ 	      macro=HydrologySolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologySolution')
++	return StringToEnum('HydrologySolution')[0]
+ 
+ def MeltingAnalysisEnum():
+ 	"""
+@@ -2084,7 +2086,7 @@
+ 	      macro=MeltingAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('MeltingAnalysis')
++	return StringToEnum('MeltingAnalysis')[0]
+ 
+ def NoneAnalysisEnum():
+ 	"""
+@@ -2094,7 +2096,7 @@
+ 	      macro=NoneAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('NoneAnalysis')
++	return StringToEnum('NoneAnalysis')[0]
+ 
+ def PrognosticAnalysisEnum():
+ 	"""
+@@ -2104,7 +2106,7 @@
+ 	      macro=PrognosticAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('PrognosticAnalysis')
++	return StringToEnum('PrognosticAnalysis')[0]
+ 
+ def PrognosticSolutionEnum():
+ 	"""
+@@ -2114,7 +2116,7 @@
+ 	      macro=PrognosticSolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('PrognosticSolution')
++	return StringToEnum('PrognosticSolution')[0]
+ 
+ def SteadystateSolutionEnum():
+ 	"""
+@@ -2124,7 +2126,7 @@
+ 	      macro=SteadystateSolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('SteadystateSolution')
++	return StringToEnum('SteadystateSolution')[0]
+ 
+ def SurfaceSlopeAnalysisEnum():
+ 	"""
+@@ -2134,7 +2136,7 @@
+ 	      macro=SurfaceSlopeAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceSlopeAnalysis')
++	return StringToEnum('SurfaceSlopeAnalysis')[0]
+ 
+ def SurfaceSlopeSolutionEnum():
+ 	"""
+@@ -2144,7 +2146,7 @@
+ 	      macro=SurfaceSlopeSolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceSlopeSolution')
++	return StringToEnum('SurfaceSlopeSolution')[0]
+ 
+ def SurfaceSlopeXAnalysisEnum():
+ 	"""
+@@ -2154,7 +2156,7 @@
+ 	      macro=SurfaceSlopeXAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceSlopeXAnalysis')
++	return StringToEnum('SurfaceSlopeXAnalysis')[0]
+ 
+ def SurfaceSlopeYAnalysisEnum():
+ 	"""
+@@ -2164,7 +2166,7 @@
+ 	      macro=SurfaceSlopeYAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceSlopeYAnalysis')
++	return StringToEnum('SurfaceSlopeYAnalysis')[0]
+ 
+ def ThermalAnalysisEnum():
+ 	"""
+@@ -2174,7 +2176,7 @@
+ 	      macro=ThermalAnalysisEnum()
+ 	"""
+ 
+-	return StringToEnum('ThermalAnalysis')
++	return StringToEnum('ThermalAnalysis')[0]
+ 
+ def ThermalSolutionEnum():
+ 	"""
+@@ -2184,7 +2186,7 @@
+ 	      macro=ThermalSolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('ThermalSolution')
++	return StringToEnum('ThermalSolution')[0]
+ 
+ def TransientSolutionEnum():
+ 	"""
+@@ -2194,7 +2196,7 @@
+ 	      macro=TransientSolutionEnum()
+ 	"""
+ 
+-	return StringToEnum('TransientSolution')
++	return StringToEnum('TransientSolution')[0]
+ 
+ def ApproximationEnum():
+ 	"""
+@@ -2204,7 +2206,7 @@
+ 	      macro=ApproximationEnum()
+ 	"""
+ 
+-	return StringToEnum('Approximation')
++	return StringToEnum('Approximation')[0]
+ 
+ def HutterApproximationEnum():
+ 	"""
+@@ -2214,7 +2216,7 @@
+ 	      macro=HutterApproximationEnum()
+ 	"""
+ 
+-	return StringToEnum('HutterApproximation')
++	return StringToEnum('HutterApproximation')[0]
+ 
+ def MacAyealApproximationEnum():
+ 	"""
+@@ -2224,7 +2226,7 @@
+ 	      macro=MacAyealApproximationEnum()
+ 	"""
+ 
+-	return StringToEnum('MacAyealApproximation')
++	return StringToEnum('MacAyealApproximation')[0]
+ 
+ def MacAyealPattynApproximationEnum():
+ 	"""
+@@ -2234,7 +2236,7 @@
+ 	      macro=MacAyealPattynApproximationEnum()
+ 	"""
+ 
+-	return StringToEnum('MacAyealPattynApproximation')
++	return StringToEnum('MacAyealPattynApproximation')[0]
+ 
+ def MacAyealStokesApproximationEnum():
+ 	"""
+@@ -2244,7 +2246,7 @@
+ 	      macro=MacAyealStokesApproximationEnum()
+ 	"""
+ 
+-	return StringToEnum('MacAyealStokesApproximation')
++	return StringToEnum('MacAyealStokesApproximation')[0]
+ 
+ def NoneApproximationEnum():
+ 	"""
+@@ -2254,7 +2256,7 @@
+ 	      macro=NoneApproximationEnum()
+ 	"""
+ 
+-	return StringToEnum('NoneApproximation')
++	return StringToEnum('NoneApproximation')[0]
+ 
+ def PattynApproximationEnum():
+ 	"""
+@@ -2264,7 +2266,7 @@
+ 	      macro=PattynApproximationEnum()
+ 	"""
+ 
+-	return StringToEnum('PattynApproximation')
++	return StringToEnum('PattynApproximation')[0]
+ 
+ def PattynStokesApproximationEnum():
+ 	"""
+@@ -2274,7 +2276,7 @@
+ 	      macro=PattynStokesApproximationEnum()
+ 	"""
+ 
+-	return StringToEnum('PattynStokesApproximation')
++	return StringToEnum('PattynStokesApproximation')[0]
+ 
+ def StokesApproximationEnum():
+ 	"""
+@@ -2284,7 +2286,7 @@
+ 	      macro=StokesApproximationEnum()
+ 	"""
+ 
+-	return StringToEnum('StokesApproximation')
++	return StringToEnum('StokesApproximation')[0]
+ 
+ def ConstraintsEnum():
+ 	"""
+@@ -2294,7 +2296,7 @@
+ 	      macro=ConstraintsEnum()
+ 	"""
+ 
+-	return StringToEnum('Constraints')
++	return StringToEnum('Constraints')[0]
+ 
+ def LoadsEnum():
+ 	"""
+@@ -2304,7 +2306,7 @@
+ 	      macro=LoadsEnum()
+ 	"""
+ 
+-	return StringToEnum('Loads')
++	return StringToEnum('Loads')[0]
+ 
+ def MaterialsEnum():
+ 	"""
+@@ -2314,7 +2316,7 @@
+ 	      macro=MaterialsEnum()
+ 	"""
+ 
+-	return StringToEnum('Materials')
++	return StringToEnum('Materials')[0]
+ 
+ def NodesEnum():
+ 	"""
+@@ -2324,7 +2326,7 @@
+ 	      macro=NodesEnum()
+ 	"""
+ 
+-	return StringToEnum('Nodes')
++	return StringToEnum('Nodes')[0]
+ 
+ def ParametersEnum():
+ 	"""
+@@ -2334,7 +2336,7 @@
+ 	      macro=ParametersEnum()
+ 	"""
+ 
+-	return StringToEnum('Parameters')
++	return StringToEnum('Parameters')[0]
+ 
+ def VerticesEnum():
+ 	"""
+@@ -2344,7 +2346,7 @@
+ 	      macro=VerticesEnum()
+ 	"""
+ 
+-	return StringToEnum('Vertices')
++	return StringToEnum('Vertices')[0]
+ 
+ def ResultsEnum():
+ 	"""
+@@ -2354,7 +2356,7 @@
+ 	      macro=ResultsEnum()
+ 	"""
+ 
+-	return StringToEnum('Results')
++	return StringToEnum('Results')[0]
+ 
+ def BoolInputEnum():
+ 	"""
+@@ -2364,7 +2366,7 @@
+ 	      macro=BoolInputEnum()
+ 	"""
+ 
+-	return StringToEnum('BoolInput')
++	return StringToEnum('BoolInput')[0]
+ 
+ def BoolParamEnum():
+ 	"""
+@@ -2374,7 +2376,7 @@
+ 	      macro=BoolParamEnum()
+ 	"""
+ 
+-	return StringToEnum('BoolParam')
++	return StringToEnum('BoolParam')[0]
+ 
+ def ContourEnum():
+ 	"""
+@@ -2384,7 +2386,7 @@
+ 	      macro=ContourEnum()
+ 	"""
+ 
+-	return StringToEnum('Contour')
++	return StringToEnum('Contour')[0]
+ 
+ def ControlInputEnum():
+ 	"""
+@@ -2394,7 +2396,7 @@
+ 	      macro=ControlInputEnum()
+ 	"""
+ 
+-	return StringToEnum('ControlInput')
++	return StringToEnum('ControlInput')[0]
+ 
+ def DatasetInputEnum():
+ 	"""
+@@ -2404,7 +2406,7 @@
+ 	      macro=DatasetInputEnum()
+ 	"""
+ 
+-	return StringToEnum('DatasetInput')
++	return StringToEnum('DatasetInput')[0]
+ 
+ def DofIndexingEnum():
+ 	"""
+@@ -2414,7 +2416,7 @@
+ 	      macro=DofIndexingEnum()
+ 	"""
+ 
+-	return StringToEnum('DofIndexing')
++	return StringToEnum('DofIndexing')[0]
+ 
+ def DoubleInputEnum():
+ 	"""
+@@ -2424,7 +2426,7 @@
+ 	      macro=DoubleInputEnum()
+ 	"""
+ 
+-	return StringToEnum('DoubleInput')
++	return StringToEnum('DoubleInput')[0]
+ 
+ def DoubleMatArrayParamEnum():
+ 	"""
+@@ -2434,7 +2436,7 @@
+ 	      macro=DoubleMatArrayParamEnum()
+ 	"""
+ 
+-	return StringToEnum('DoubleMatArrayParam')
++	return StringToEnum('DoubleMatArrayParam')[0]
+ 
+ def DoubleMatParamEnum():
+ 	"""
+@@ -2444,7 +2446,7 @@
+ 	      macro=DoubleMatParamEnum()
+ 	"""
+ 
+-	return StringToEnum('DoubleMatParam')
++	return StringToEnum('DoubleMatParam')[0]
+ 
+ def DoubleParamEnum():
+ 	"""
+@@ -2454,7 +2456,7 @@
+ 	      macro=DoubleParamEnum()
+ 	"""
+ 
+-	return StringToEnum('DoubleParam')
++	return StringToEnum('DoubleParam')[0]
+ 
+ def DoubleVecParamEnum():
+ 	"""
+@@ -2464,7 +2466,7 @@
+ 	      macro=DoubleVecParamEnum()
+ 	"""
+ 
+-	return StringToEnum('DoubleVecParam')
++	return StringToEnum('DoubleVecParam')[0]
+ 
+ def ElementEnum():
+ 	"""
+@@ -2474,7 +2476,7 @@
+ 	      macro=ElementEnum()
+ 	"""
+ 
+-	return StringToEnum('Element')
++	return StringToEnum('Element')[0]
+ 
+ def ElementResultEnum():
+ 	"""
+@@ -2484,7 +2486,7 @@
+ 	      macro=ElementResultEnum()
+ 	"""
+ 
+-	return StringToEnum('ElementResult')
++	return StringToEnum('ElementResult')[0]
+ 
+ def ExternalResultEnum():
+ 	"""
+@@ -2494,7 +2496,7 @@
+ 	      macro=ExternalResultEnum()
+ 	"""
+ 
+-	return StringToEnum('ExternalResult')
++	return StringToEnum('ExternalResult')[0]
+ 
+ def FileParamEnum():
+ 	"""
+@@ -2504,7 +2506,7 @@
+ 	      macro=FileParamEnum()
+ 	"""
+ 
+-	return StringToEnum('FileParam')
++	return StringToEnum('FileParam')[0]
+ 
+ def HookEnum():
+ 	"""
+@@ -2514,7 +2516,7 @@
+ 	      macro=HookEnum()
+ 	"""
+ 
+-	return StringToEnum('Hook')
++	return StringToEnum('Hook')[0]
+ 
+ def IcefrontEnum():
+ 	"""
+@@ -2524,7 +2526,7 @@
+ 	      macro=IcefrontEnum()
+ 	"""
+ 
+-	return StringToEnum('Icefront')
++	return StringToEnum('Icefront')[0]
+ 
+ def InputEnum():
+ 	"""
+@@ -2534,7 +2536,7 @@
+ 	      macro=InputEnum()
+ 	"""
+ 
+-	return StringToEnum('Input')
++	return StringToEnum('Input')[0]
+ 
+ def IntInputEnum():
+ 	"""
+@@ -2544,7 +2546,7 @@
+ 	      macro=IntInputEnum()
+ 	"""
+ 
+-	return StringToEnum('IntInput')
++	return StringToEnum('IntInput')[0]
+ 
+ def IntParamEnum():
+ 	"""
+@@ -2554,7 +2556,7 @@
+ 	      macro=IntParamEnum()
+ 	"""
+ 
+-	return StringToEnum('IntParam')
++	return StringToEnum('IntParam')[0]
+ 
+ def IntVecParamEnum():
+ 	"""
+@@ -2564,7 +2566,7 @@
+ 	      macro=IntVecParamEnum()
+ 	"""
+ 
+-	return StringToEnum('IntVecParam')
++	return StringToEnum('IntVecParam')[0]
+ 
+ def TransientParamEnum():
+ 	"""
+@@ -2574,7 +2576,7 @@
+ 	      macro=TransientParamEnum()
+ 	"""
+ 
+-	return StringToEnum('TransientParam')
++	return StringToEnum('TransientParam')[0]
+ 
+ def MacAyeal2dIceFrontEnum():
+ 	"""
+@@ -2584,7 +2586,7 @@
+ 	      macro=MacAyeal2dIceFrontEnum()
+ 	"""
+ 
+-	return StringToEnum('MacAyeal2dIceFront')
++	return StringToEnum('MacAyeal2dIceFront')[0]
+ 
+ def MacAyeal3dIceFrontEnum():
+ 	"""
+@@ -2594,7 +2596,7 @@
+ 	      macro=MacAyeal3dIceFrontEnum()
+ 	"""
+ 
+-	return StringToEnum('MacAyeal3dIceFront')
++	return StringToEnum('MacAyeal3dIceFront')[0]
+ 
+ def MaticeEnum():
+ 	"""
+@@ -2604,7 +2606,7 @@
+ 	      macro=MaticeEnum()
+ 	"""
+ 
+-	return StringToEnum('Matice')
++	return StringToEnum('Matice')[0]
+ 
+ def MatparEnum():
+ 	"""
+@@ -2614,7 +2616,7 @@
+ 	      macro=MatparEnum()
+ 	"""
+ 
+-	return StringToEnum('Matpar')
++	return StringToEnum('Matpar')[0]
+ 
+ def NodeEnum():
+ 	"""
+@@ -2624,7 +2626,7 @@
+ 	      macro=NodeEnum()
+ 	"""
+ 
+-	return StringToEnum('Node')
++	return StringToEnum('Node')[0]
+ 
+ def NumericalfluxEnum():
+ 	"""
+@@ -2634,7 +2636,7 @@
+ 	      macro=NumericalfluxEnum()
+ 	"""
+ 
+-	return StringToEnum('Numericalflux')
++	return StringToEnum('Numericalflux')[0]
+ 
+ def ParamEnum():
+ 	"""
+@@ -2644,7 +2646,7 @@
+ 	      macro=ParamEnum()
+ 	"""
+ 
+-	return StringToEnum('Param')
++	return StringToEnum('Param')[0]
+ 
+ def PattynIceFrontEnum():
+ 	"""
+@@ -2654,7 +2656,7 @@
+ 	      macro=PattynIceFrontEnum()
+ 	"""
+ 
+-	return StringToEnum('PattynIceFront')
++	return StringToEnum('PattynIceFront')[0]
+ 
+ def PengridEnum():
+ 	"""
+@@ -2664,7 +2666,7 @@
+ 	      macro=PengridEnum()
+ 	"""
+ 
+-	return StringToEnum('Pengrid')
++	return StringToEnum('Pengrid')[0]
+ 
+ def PenpairEnum():
+ 	"""
+@@ -2674,7 +2676,7 @@
+ 	      macro=PenpairEnum()
+ 	"""
+ 
+-	return StringToEnum('Penpair')
++	return StringToEnum('Penpair')[0]
+ 
+ def PentaEnum():
+ 	"""
+@@ -2684,7 +2686,7 @@
+ 	      macro=PentaEnum()
+ 	"""
+ 
+-	return StringToEnum('Penta')
++	return StringToEnum('Penta')[0]
+ 
+ def PentaP1InputEnum():
+ 	"""
+@@ -2694,7 +2696,7 @@
+ 	      macro=PentaP1InputEnum()
+ 	"""
+ 
+-	return StringToEnum('PentaP1Input')
++	return StringToEnum('PentaP1Input')[0]
+ 
+ def MatrixParamEnum():
+ 	"""
+@@ -2704,7 +2706,7 @@
+ 	      macro=MatrixParamEnum()
+ 	"""
+ 
+-	return StringToEnum('MatrixParam')
++	return StringToEnum('MatrixParam')[0]
+ 
+ def VectorParamEnum():
+ 	"""
+@@ -2714,7 +2716,7 @@
+ 	      macro=VectorParamEnum()
+ 	"""
+ 
+-	return StringToEnum('VectorParam')
++	return StringToEnum('VectorParam')[0]
+ 
+ def RiftfrontEnum():
+ 	"""
+@@ -2724,7 +2726,7 @@
+ 	      macro=RiftfrontEnum()
+ 	"""
+ 
+-	return StringToEnum('Riftfront')
++	return StringToEnum('Riftfront')[0]
+ 
+ def SegmentEnum():
+ 	"""
+@@ -2734,7 +2736,7 @@
+ 	      macro=SegmentEnum()
+ 	"""
+ 
+-	return StringToEnum('Segment')
++	return StringToEnum('Segment')[0]
+ 
+ def SegmentRiftfrontEnum():
+ 	"""
+@@ -2744,7 +2746,7 @@
+ 	      macro=SegmentRiftfrontEnum()
+ 	"""
+ 
+-	return StringToEnum('SegmentRiftfront')
++	return StringToEnum('SegmentRiftfront')[0]
+ 
+ def SpcDynamicEnum():
+ 	"""
+@@ -2754,7 +2756,7 @@
+ 	      macro=SpcDynamicEnum()
+ 	"""
+ 
+-	return StringToEnum('SpcDynamic')
++	return StringToEnum('SpcDynamic')[0]
+ 
+ def SpcStaticEnum():
+ 	"""
+@@ -2764,7 +2766,7 @@
+ 	      macro=SpcStaticEnum()
+ 	"""
+ 
+-	return StringToEnum('SpcStatic')
++	return StringToEnum('SpcStatic')[0]
+ 
+ def SpcTransientEnum():
+ 	"""
+@@ -2774,7 +2776,7 @@
+ 	      macro=SpcTransientEnum()
+ 	"""
+ 
+-	return StringToEnum('SpcTransient')
++	return StringToEnum('SpcTransient')[0]
+ 
+ def StokesIceFrontEnum():
+ 	"""
+@@ -2784,7 +2786,7 @@
+ 	      macro=StokesIceFrontEnum()
+ 	"""
+ 
+-	return StringToEnum('StokesIceFront')
++	return StringToEnum('StokesIceFront')[0]
+ 
+ def StringArrayParamEnum():
+ 	"""
+@@ -2794,7 +2796,7 @@
+ 	      macro=StringArrayParamEnum()
+ 	"""
+ 
+-	return StringToEnum('StringArrayParam')
++	return StringToEnum('StringArrayParam')[0]
+ 
+ def StringParamEnum():
+ 	"""
+@@ -2804,7 +2806,7 @@
+ 	      macro=StringParamEnum()
+ 	"""
+ 
+-	return StringToEnum('StringParam')
++	return StringToEnum('StringParam')[0]
+ 
+ def TriaEnum():
+ 	"""
+@@ -2814,7 +2816,7 @@
+ 	      macro=TriaEnum()
+ 	"""
+ 
+-	return StringToEnum('Tria')
++	return StringToEnum('Tria')[0]
+ 
+ def TriaP1InputEnum():
+ 	"""
+@@ -2824,7 +2826,7 @@
+ 	      macro=TriaP1InputEnum()
+ 	"""
+ 
+-	return StringToEnum('TriaP1Input')
++	return StringToEnum('TriaP1Input')[0]
+ 
+ def VertexEnum():
+ 	"""
+@@ -2834,7 +2836,7 @@
+ 	      macro=VertexEnum()
+ 	"""
+ 
+-	return StringToEnum('Vertex')
++	return StringToEnum('Vertex')[0]
+ 
+ def AirEnum():
+ 	"""
+@@ -2844,7 +2846,7 @@
+ 	      macro=AirEnum()
+ 	"""
+ 
+-	return StringToEnum('Air')
++	return StringToEnum('Air')[0]
+ 
+ def IceEnum():
+ 	"""
+@@ -2854,7 +2856,7 @@
+ 	      macro=IceEnum()
+ 	"""
+ 
+-	return StringToEnum('Ice')
++	return StringToEnum('Ice')[0]
+ 
+ def MelangeEnum():
+ 	"""
+@@ -2864,7 +2866,7 @@
+ 	      macro=MelangeEnum()
+ 	"""
+ 
+-	return StringToEnum('Melange')
++	return StringToEnum('Melange')[0]
+ 
+ def WaterEnum():
+ 	"""
+@@ -2874,7 +2876,7 @@
+ 	      macro=WaterEnum()
+ 	"""
+ 
+-	return StringToEnum('Water')
++	return StringToEnum('Water')[0]
+ 
+ def ClosedEnum():
+ 	"""
+@@ -2884,7 +2886,7 @@
+ 	      macro=ClosedEnum()
+ 	"""
+ 
+-	return StringToEnum('Closed')
++	return StringToEnum('Closed')[0]
+ 
+ def FreeEnum():
+ 	"""
+@@ -2894,7 +2896,7 @@
+ 	      macro=FreeEnum()
+ 	"""
+ 
+-	return StringToEnum('Free')
++	return StringToEnum('Free')[0]
+ 
+ def OpenEnum():
+ 	"""
+@@ -2904,7 +2906,7 @@
+ 	      macro=OpenEnum()
+ 	"""
+ 
+-	return StringToEnum('Open')
++	return StringToEnum('Open')[0]
+ 
+ def AdjointpEnum():
+ 	"""
+@@ -2914,7 +2916,7 @@
+ 	      macro=AdjointpEnum()
+ 	"""
+ 
+-	return StringToEnum('Adjointp')
++	return StringToEnum('Adjointp')[0]
+ 
+ def AdjointxEnum():
+ 	"""
+@@ -2924,7 +2926,7 @@
+ 	      macro=AdjointxEnum()
+ 	"""
+ 
+-	return StringToEnum('Adjointx')
++	return StringToEnum('Adjointx')[0]
+ 
+ def AdjointyEnum():
+ 	"""
+@@ -2934,7 +2936,7 @@
+ 	      macro=AdjointyEnum()
+ 	"""
+ 
+-	return StringToEnum('Adjointy')
++	return StringToEnum('Adjointy')[0]
+ 
+ def AdjointzEnum():
+ 	"""
+@@ -2944,7 +2946,7 @@
+ 	      macro=AdjointzEnum()
+ 	"""
+ 
+-	return StringToEnum('Adjointz')
++	return StringToEnum('Adjointz')[0]
+ 
+ def BedSlopeXEnum():
+ 	"""
+@@ -2954,7 +2956,7 @@
+ 	      macro=BedSlopeXEnum()
+ 	"""
+ 
+-	return StringToEnum('BedSlopeX')
++	return StringToEnum('BedSlopeX')[0]
+ 
+ def BedSlopeYEnum():
+ 	"""
+@@ -2964,7 +2966,7 @@
+ 	      macro=BedSlopeYEnum()
+ 	"""
+ 
+-	return StringToEnum('BedSlopeY')
++	return StringToEnum('BedSlopeY')[0]
+ 
+ def BoundaryEnum():
+ 	"""
+@@ -2974,7 +2976,7 @@
+ 	      macro=BoundaryEnum()
+ 	"""
+ 
+-	return StringToEnum('Boundary')
++	return StringToEnum('Boundary')[0]
+ 
+ def ConstantEnum():
+ 	"""
+@@ -2984,7 +2986,7 @@
+ 	      macro=ConstantEnum()
+ 	"""
+ 
+-	return StringToEnum('Constant')
++	return StringToEnum('Constant')[0]
+ 
+ def ConvergedEnum():
+ 	"""
+@@ -2994,7 +2996,7 @@
+ 	      macro=ConvergedEnum()
+ 	"""
+ 
+-	return StringToEnum('Converged')
++	return StringToEnum('Converged')[0]
+ 
+ def ExtToIuEnum():
+ 	"""
+@@ -3004,7 +3006,7 @@
+ 	      macro=ExtToIuEnum()
+ 	"""
+ 
+-	return StringToEnum('ExtToIu')
++	return StringToEnum('ExtToIu')[0]
+ 
+ def FillEnum():
+ 	"""
+@@ -3014,7 +3016,7 @@
+ 	      macro=FillEnum()
+ 	"""
+ 
+-	return StringToEnum('Fill')
++	return StringToEnum('Fill')[0]
+ 
+ def FractionIncrementEnum():
+ 	"""
+@@ -3024,7 +3026,7 @@
+ 	      macro=FractionIncrementEnum()
+ 	"""
+ 
+-	return StringToEnum('FractionIncrement')
++	return StringToEnum('FractionIncrement')[0]
+ 
+ def FrictionEnum():
+ 	"""
+@@ -3034,7 +3036,7 @@
+ 	      macro=FrictionEnum()
+ 	"""
+ 
+-	return StringToEnum('Friction')
++	return StringToEnum('Friction')[0]
+ 
+ def GroundinglineMeltingRateEnum():
+ 	"""
+@@ -3044,7 +3046,7 @@
+ 	      macro=GroundinglineMeltingRateEnum()
+ 	"""
+ 
+-	return StringToEnum('GroundinglineMeltingRate')
++	return StringToEnum('GroundinglineMeltingRate')[0]
+ 
+ def InternalEnum():
+ 	"""
+@@ -3054,7 +3056,7 @@
+ 	      macro=InternalEnum()
+ 	"""
+ 
+-	return StringToEnum('Internal')
++	return StringToEnum('Internal')[0]
+ 
+ def IuToExtEnum():
+ 	"""
+@@ -3064,7 +3066,7 @@
+ 	      macro=IuToExtEnum()
+ 	"""
+ 
+-	return StringToEnum('IuToExt')
++	return StringToEnum('IuToExt')[0]
+ 
+ def MassFluxEnum():
+ 	"""
+@@ -3074,7 +3076,7 @@
+ 	      macro=MassFluxEnum()
+ 	"""
+ 
+-	return StringToEnum('MassFlux')
++	return StringToEnum('MassFlux')[0]
+ 
+ def MaxPenetrationEnum():
+ 	"""
+@@ -3084,7 +3086,7 @@
+ 	      macro=MaxPenetrationEnum()
+ 	"""
+ 
+-	return StringToEnum('MaxPenetration')
++	return StringToEnum('MaxPenetration')[0]
+ 
+ def MeltingOffsetEnum():
+ 	"""
+@@ -3094,7 +3096,7 @@
+ 	      macro=MeltingOffsetEnum()
+ 	"""
+ 
+-	return StringToEnum('MeltingOffset')
++	return StringToEnum('MeltingOffset')[0]
+ 
+ def MisfitEnum():
+ 	"""
+@@ -3104,7 +3106,7 @@
+ 	      macro=MisfitEnum()
+ 	"""
+ 
+-	return StringToEnum('Misfit')
++	return StringToEnum('Misfit')[0]
+ 
+ def NumberNodeToElementConnectivityEnum():
+ 	"""
+@@ -3114,7 +3116,7 @@
+ 	      macro=NumberNodeToElementConnectivityEnum()
+ 	"""
+ 
+-	return StringToEnum('NumberNodeToElementConnectivity')
++	return StringToEnum('NumberNodeToElementConnectivity')[0]
+ 
+ def PressureEnum():
+ 	"""
+@@ -3124,7 +3126,7 @@
+ 	      macro=PressureEnum()
+ 	"""
+ 
+-	return StringToEnum('Pressure')
++	return StringToEnum('Pressure')[0]
+ 
+ def PressurePicardEnum():
+ 	"""
+@@ -3134,7 +3136,7 @@
+ 	      macro=PressurePicardEnum()
+ 	"""
+ 
+-	return StringToEnum('PressurePicard')
++	return StringToEnum('PressurePicard')[0]
+ 
+ def QmuPressureEnum():
+ 	"""
+@@ -3144,7 +3146,7 @@
+ 	      macro=QmuPressureEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuPressure')
++	return StringToEnum('QmuPressure')[0]
+ 
+ def QmuVxEnum():
+ 	"""
+@@ -3154,7 +3156,7 @@
+ 	      macro=QmuVxEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuVx')
++	return StringToEnum('QmuVx')[0]
+ 
+ def QmuVyEnum():
+ 	"""
+@@ -3164,7 +3166,7 @@
+ 	      macro=QmuVyEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuVy')
++	return StringToEnum('QmuVy')[0]
+ 
+ def QmuVzEnum():
+ 	"""
+@@ -3174,7 +3176,7 @@
+ 	      macro=QmuVzEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuVz')
++	return StringToEnum('QmuVz')[0]
+ 
+ def QmuThicknessEnum():
+ 	"""
+@@ -3184,7 +3186,7 @@
+ 	      macro=QmuThicknessEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuThickness')
++	return StringToEnum('QmuThickness')[0]
+ 
+ def QmuBedEnum():
+ 	"""
+@@ -3194,7 +3196,7 @@
+ 	      macro=QmuBedEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuBed')
++	return StringToEnum('QmuBed')[0]
+ 
+ def QmuSurfaceEnum():
+ 	"""
+@@ -3204,7 +3206,7 @@
+ 	      macro=QmuSurfaceEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuSurface')
++	return StringToEnum('QmuSurface')[0]
+ 
+ def QmuMeltingEnum():
+ 	"""
+@@ -3214,7 +3216,7 @@
+ 	      macro=QmuMeltingEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuMelting')
++	return StringToEnum('QmuMelting')[0]
+ 
+ def ResetPenaltiesEnum():
+ 	"""
+@@ -3224,7 +3226,7 @@
+ 	      macro=ResetPenaltiesEnum()
+ 	"""
+ 
+-	return StringToEnum('ResetPenalties')
++	return StringToEnum('ResetPenalties')[0]
+ 
+ def SegmentOnIceShelfEnum():
+ 	"""
+@@ -3234,7 +3236,7 @@
+ 	      macro=SegmentOnIceShelfEnum()
+ 	"""
+ 
+-	return StringToEnum('SegmentOnIceShelf')
++	return StringToEnum('SegmentOnIceShelf')[0]
+ 
+ def SurfaceAbsVelMisfitEnum():
+ 	"""
+@@ -3244,7 +3246,7 @@
+ 	      macro=SurfaceAbsVelMisfitEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceAbsVelMisfit')
++	return StringToEnum('SurfaceAbsVelMisfit')[0]
+ 
+ def SurfaceAreaEnum():
+ 	"""
+@@ -3254,7 +3256,7 @@
+ 	      macro=SurfaceAreaEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceArea')
++	return StringToEnum('SurfaceArea')[0]
+ 
+ def SurfaceAverageVelMisfitEnum():
+ 	"""
+@@ -3264,7 +3266,7 @@
+ 	      macro=SurfaceAverageVelMisfitEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceAverageVelMisfit')
++	return StringToEnum('SurfaceAverageVelMisfit')[0]
+ 
+ def SurfaceLogVelMisfitEnum():
+ 	"""
+@@ -3274,7 +3276,7 @@
+ 	      macro=SurfaceLogVelMisfitEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceLogVelMisfit')
++	return StringToEnum('SurfaceLogVelMisfit')[0]
+ 
+ def SurfaceLogVxVyMisfitEnum():
+ 	"""
+@@ -3284,7 +3286,7 @@
+ 	      macro=SurfaceLogVxVyMisfitEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceLogVxVyMisfit')
++	return StringToEnum('SurfaceLogVxVyMisfit')[0]
+ 
+ def SurfaceRelVelMisfitEnum():
+ 	"""
+@@ -3294,7 +3296,7 @@
+ 	      macro=SurfaceRelVelMisfitEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceRelVelMisfit')
++	return StringToEnum('SurfaceRelVelMisfit')[0]
+ 
+ def SurfaceSlopeXEnum():
+ 	"""
+@@ -3304,7 +3306,7 @@
+ 	      macro=SurfaceSlopeXEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceSlopeX')
++	return StringToEnum('SurfaceSlopeX')[0]
+ 
+ def SurfaceSlopeYEnum():
+ 	"""
+@@ -3314,7 +3316,7 @@
+ 	      macro=SurfaceSlopeYEnum()
+ 	"""
+ 
+-	return StringToEnum('SurfaceSlopeY')
++	return StringToEnum('SurfaceSlopeY')[0]
+ 
+ def TemperatureEnum():
+ 	"""
+@@ -3324,7 +3326,7 @@
+ 	      macro=TemperatureEnum()
+ 	"""
+ 
+-	return StringToEnum('Temperature')
++	return StringToEnum('Temperature')[0]
+ 
+ def TemperatureOldEnum():
+ 	"""
+@@ -3334,7 +3336,7 @@
+ 	      macro=TemperatureOldEnum()
+ 	"""
+ 
+-	return StringToEnum('TemperatureOld')
++	return StringToEnum('TemperatureOld')[0]
+ 
+ def TemperaturePicardEnum():
+ 	"""
+@@ -3344,7 +3346,7 @@
+ 	      macro=TemperaturePicardEnum()
+ 	"""
+ 
+-	return StringToEnum('TemperaturePicard')
++	return StringToEnum('TemperaturePicard')[0]
+ 
+ def ThicknessAbsMisfitEnum():
+ 	"""
+@@ -3354,7 +3356,7 @@
+ 	      macro=ThicknessAbsMisfitEnum()
+ 	"""
+ 
+-	return StringToEnum('ThicknessAbsMisfit')
++	return StringToEnum('ThicknessAbsMisfit')[0]
+ 
+ def TypeEnum():
+ 	"""
+@@ -3364,7 +3366,7 @@
+ 	      macro=TypeEnum()
+ 	"""
+ 
+-	return StringToEnum('Type')
++	return StringToEnum('Type')[0]
+ 
+ def VelEnum():
+ 	"""
+@@ -3374,7 +3376,7 @@
+ 	      macro=VelEnum()
+ 	"""
+ 
+-	return StringToEnum('Vel')
++	return StringToEnum('Vel')[0]
+ 
+ def VelocityEnum():
+ 	"""
+@@ -3384,7 +3386,7 @@
+ 	      macro=VelocityEnum()
+ 	"""
+ 
+-	return StringToEnum('Velocity')
++	return StringToEnum('Velocity')[0]
+ 
+ def VxAverageEnum():
+ 	"""
+@@ -3394,7 +3396,7 @@
+ 	      macro=VxAverageEnum()
+ 	"""
+ 
+-	return StringToEnum('VxAverage')
++	return StringToEnum('VxAverage')[0]
+ 
+ def VxEnum():
+ 	"""
+@@ -3404,7 +3406,7 @@
+ 	      macro=VxEnum()
+ 	"""
+ 
+-	return StringToEnum('Vx')
++	return StringToEnum('Vx')[0]
+ 
+ def VxPicardEnum():
+ 	"""
+@@ -3414,7 +3416,7 @@
+ 	      macro=VxPicardEnum()
+ 	"""
+ 
+-	return StringToEnum('VxPicard')
++	return StringToEnum('VxPicard')[0]
+ 
+ def VyAverageEnum():
+ 	"""
+@@ -3424,7 +3426,7 @@
+ 	      macro=VyAverageEnum()
+ 	"""
+ 
+-	return StringToEnum('VyAverage')
++	return StringToEnum('VyAverage')[0]
+ 
+ def VyEnum():
+ 	"""
+@@ -3434,7 +3436,7 @@
+ 	      macro=VyEnum()
+ 	"""
+ 
+-	return StringToEnum('Vy')
++	return StringToEnum('Vy')[0]
+ 
+ def VyPicardEnum():
+ 	"""
+@@ -3444,7 +3446,7 @@
+ 	      macro=VyPicardEnum()
+ 	"""
+ 
+-	return StringToEnum('VyPicard')
++	return StringToEnum('VyPicard')[0]
+ 
+ def VzEnum():
+ 	"""
+@@ -3454,7 +3456,7 @@
+ 	      macro=VzEnum()
+ 	"""
+ 
+-	return StringToEnum('Vz')
++	return StringToEnum('Vz')[0]
+ 
+ def VzMacAyealEnum():
+ 	"""
+@@ -3464,7 +3466,7 @@
+ 	      macro=VzMacAyealEnum()
+ 	"""
+ 
+-	return StringToEnum('VzMacAyeal')
++	return StringToEnum('VzMacAyeal')[0]
+ 
+ def VzPattynEnum():
+ 	"""
+@@ -3474,7 +3476,7 @@
+ 	      macro=VzPattynEnum()
+ 	"""
+ 
+-	return StringToEnum('VzPattyn')
++	return StringToEnum('VzPattyn')[0]
+ 
+ def VzPicardEnum():
+ 	"""
+@@ -3484,7 +3486,7 @@
+ 	      macro=VzPicardEnum()
+ 	"""
+ 
+-	return StringToEnum('VzPicard')
++	return StringToEnum('VzPicard')[0]
+ 
+ def VzStokesEnum():
+ 	"""
+@@ -3494,7 +3496,7 @@
+ 	      macro=VzStokesEnum()
+ 	"""
+ 
+-	return StringToEnum('VzStokes')
++	return StringToEnum('VzStokes')[0]
+ 
+ def VxMeshEnum():
+ 	"""
+@@ -3504,7 +3506,7 @@
+ 	      macro=VxMeshEnum()
+ 	"""
+ 
+-	return StringToEnum('VxMesh')
++	return StringToEnum('VxMesh')[0]
+ 
+ def VyMeshEnum():
+ 	"""
+@@ -3514,7 +3516,7 @@
+ 	      macro=VyMeshEnum()
+ 	"""
+ 
+-	return StringToEnum('VyMesh')
++	return StringToEnum('VyMesh')[0]
+ 
+ def VzMeshEnum():
+ 	"""
+@@ -3524,7 +3526,7 @@
+ 	      macro=VzMeshEnum()
+ 	"""
+ 
+-	return StringToEnum('VzMesh')
++	return StringToEnum('VzMesh')[0]
+ 
+ def EnthalpyEnum():
+ 	"""
+@@ -3534,7 +3536,7 @@
+ 	      macro=EnthalpyEnum()
+ 	"""
+ 
+-	return StringToEnum('Enthalpy')
++	return StringToEnum('Enthalpy')[0]
+ 
+ def EnthalpyPicardEnum():
+ 	"""
+@@ -3544,7 +3546,7 @@
+ 	      macro=EnthalpyPicardEnum()
+ 	"""
+ 
+-	return StringToEnum('EnthalpyPicard')
++	return StringToEnum('EnthalpyPicard')[0]
+ 
+ def ThicknessAbsGradientEnum():
+ 	"""
+@@ -3554,7 +3556,7 @@
+ 	      macro=ThicknessAbsGradientEnum()
+ 	"""
+ 
+-	return StringToEnum('ThicknessAbsGradient')
++	return StringToEnum('ThicknessAbsGradient')[0]
+ 
+ def StepResponsesEnum():
+ 	"""
+@@ -3564,7 +3566,7 @@
+ 	      macro=StepResponsesEnum()
+ 	"""
+ 
+-	return StringToEnum('StepResponses')
++	return StringToEnum('StepResponses')[0]
+ 
+ def IntMatParamEnum():
+ 	"""
+@@ -3574,7 +3576,7 @@
+ 	      macro=IntMatParamEnum()
+ 	"""
+ 
+-	return StringToEnum('IntMatParam')
++	return StringToEnum('IntMatParam')[0]
+ 
+ def RheologyBbarAbsGradientEnum():
+ 	"""
+@@ -3584,7 +3586,7 @@
+ 	      macro=RheologyBbarAbsGradientEnum()
+ 	"""
+ 
+-	return StringToEnum('RheologyBbarAbsGradient')
++	return StringToEnum('RheologyBbarAbsGradient')[0]
+ 
+ def DragCoefficientAbsGradientEnum():
+ 	"""
+@@ -3594,7 +3596,7 @@
+ 	      macro=DragCoefficientAbsGradientEnum()
+ 	"""
+ 
+-	return StringToEnum('DragCoefficientAbsGradient')
++	return StringToEnum('DragCoefficientAbsGradient')[0]
+ 
+ def TransientInputEnum():
+ 	"""
+@@ -3604,7 +3606,7 @@
+ 	      macro=TransientInputEnum()
+ 	"""
+ 
+-	return StringToEnum('TransientInput')
++	return StringToEnum('TransientInput')[0]
+ 
+ def OutputfilenameEnum():
+ 	"""
+@@ -3614,7 +3616,7 @@
+ 	      macro=OutputfilenameEnum()
+ 	"""
+ 
+-	return StringToEnum('Outputfilename')
++	return StringToEnum('Outputfilename')[0]
+ 
+ def WaterfractionEnum():
+ 	"""
+@@ -3624,7 +3626,7 @@
+ 	      macro=WaterfractionEnum()
+ 	"""
+ 
+-	return StringToEnum('Waterfraction')
++	return StringToEnum('Waterfraction')[0]
+ 
+ def WatercolumnEnum():
+ 	"""
+@@ -3634,7 +3636,7 @@
+ 	      macro=WatercolumnEnum()
+ 	"""
+ 
+-	return StringToEnum('Watercolumn')
++	return StringToEnum('Watercolumn')[0]
+ 
+ def BasalFrictionEnum():
+ 	"""
+@@ -3644,7 +3646,7 @@
+ 	      macro=BasalFrictionEnum()
+ 	"""
+ 
+-	return StringToEnum('BasalFriction')
++	return StringToEnum('BasalFriction')[0]
+ 
+ def ViscousHeatingEnum():
+ 	"""
+@@ -3654,7 +3656,7 @@
+ 	      macro=ViscousHeatingEnum()
+ 	"""
+ 
+-	return StringToEnum('ViscousHeating')
++	return StringToEnum('ViscousHeating')[0]
+ 
+ def QmuTemperatureEnum():
+ 	"""
+@@ -3664,7 +3666,7 @@
+ 	      macro=QmuTemperatureEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuTemperature')
++	return StringToEnum('QmuTemperature')[0]
+ 
+ def HydrologyWaterVxEnum():
+ 	"""
+@@ -3674,7 +3676,7 @@
+ 	      macro=HydrologyWaterVxEnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologyWaterVx')
++	return StringToEnum('HydrologyWaterVx')[0]
+ 
+ def HydrologyWaterVyEnum():
+ 	"""
+@@ -3684,7 +3686,7 @@
+ 	      macro=HydrologyWaterVyEnum()
+ 	"""
+ 
+-	return StringToEnum('HydrologyWaterVy')
++	return StringToEnum('HydrologyWaterVy')[0]
+ 
+ def StressTensorEnum():
+ 	"""
+@@ -3694,7 +3696,7 @@
+ 	      macro=StressTensorEnum()
+ 	"""
+ 
+-	return StringToEnum('StressTensor')
++	return StringToEnum('StressTensor')[0]
+ 
+ def StressTensorxxEnum():
+ 	"""
+@@ -3704,7 +3706,7 @@
+ 	      macro=StressTensorxxEnum()
+ 	"""
+ 
+-	return StringToEnum('StressTensorxx')
++	return StringToEnum('StressTensorxx')[0]
+ 
+ def StressTensorxyEnum():
+ 	"""
+@@ -3714,7 +3716,7 @@
+ 	      macro=StressTensorxyEnum()
+ 	"""
+ 
+-	return StringToEnum('StressTensorxy')
++	return StringToEnum('StressTensorxy')[0]
+ 
+ def StressTensorxzEnum():
+ 	"""
+@@ -3724,7 +3726,7 @@
+ 	      macro=StressTensorxzEnum()
+ 	"""
+ 
+-	return StringToEnum('StressTensorxz')
++	return StringToEnum('StressTensorxz')[0]
+ 
+ def StressTensoryyEnum():
+ 	"""
+@@ -3734,7 +3736,7 @@
+ 	      macro=StressTensoryyEnum()
+ 	"""
+ 
+-	return StringToEnum('StressTensoryy')
++	return StringToEnum('StressTensoryy')[0]
+ 
+ def StressTensoryzEnum():
+ 	"""
+@@ -3744,7 +3746,7 @@
+ 	      macro=StressTensoryzEnum()
+ 	"""
+ 
+-	return StringToEnum('StressTensoryz')
++	return StringToEnum('StressTensoryz')[0]
+ 
+ def StressTensorzzEnum():
+ 	"""
+@@ -3754,7 +3756,7 @@
+ 	      macro=StressTensorzzEnum()
+ 	"""
+ 
+-	return StringToEnum('StressTensorzz')
++	return StringToEnum('StressTensorzz')[0]
+ 
+ def IceVolumeEnum():
+ 	"""
+@@ -3764,7 +3766,7 @@
+ 	      macro=IceVolumeEnum()
+ 	"""
+ 
+-	return StringToEnum('IceVolume')
++	return StringToEnum('IceVolume')[0]
+ 
+ def TotalSmbEnum():
+ 	"""
+@@ -3774,7 +3776,7 @@
+ 	      macro=TotalSmbEnum()
+ 	"""
+ 
+-	return StringToEnum('TotalSmb')
++	return StringToEnum('TotalSmb')[0]
+ 
+ def ThicknessAlongGradientEnum():
+ 	"""
+@@ -3784,7 +3786,7 @@
+ 	      macro=ThicknessAlongGradientEnum()
+ 	"""
+ 
+-	return StringToEnum('ThicknessAlongGradient')
++	return StringToEnum('ThicknessAlongGradient')[0]
+ 
+ def ThicknessAcrossGradientEnum():
+ 	"""
+@@ -3794,7 +3796,7 @@
+ 	      macro=ThicknessAcrossGradientEnum()
+ 	"""
+ 
+-	return StringToEnum('ThicknessAcrossGradient')
++	return StringToEnum('ThicknessAcrossGradient')[0]
+ 
+ def P0Enum():
+ 	"""
+@@ -3804,7 +3806,7 @@
+ 	      macro=P0Enum()
+ 	"""
+ 
+-	return StringToEnum('P0')
++	return StringToEnum('P0')[0]
+ 
+ def P1Enum():
+ 	"""
+@@ -3814,7 +3816,7 @@
+ 	      macro=P1Enum()
+ 	"""
+ 
+-	return StringToEnum('P1')
++	return StringToEnum('P1')[0]
+ 
+ def P1DGEnum():
+ 	"""
+@@ -3824,7 +3826,7 @@
+ 	      macro=P1DGEnum()
+ 	"""
+ 
+-	return StringToEnum('P1DG')
++	return StringToEnum('P1DG')[0]
+ 
+ def SaveResultsEnum():
+ 	"""
+@@ -3834,7 +3836,7 @@
+ 	      macro=SaveResultsEnum()
+ 	"""
+ 
+-	return StringToEnum('SaveResults')
++	return StringToEnum('SaveResults')[0]
+ 
+ def BoolElementResultEnum():
+ 	"""
+@@ -3844,7 +3846,7 @@
+ 	      macro=BoolElementResultEnum()
+ 	"""
+ 
+-	return StringToEnum('BoolElementResult')
++	return StringToEnum('BoolElementResult')[0]
+ 
+ def BoolExternalResultEnum():
+ 	"""
+@@ -3854,7 +3856,7 @@
+ 	      macro=BoolExternalResultEnum()
+ 	"""
+ 
+-	return StringToEnum('BoolExternalResult')
++	return StringToEnum('BoolExternalResult')[0]
+ 
+ def DoubleElementResultEnum():
+ 	"""
+@@ -3864,7 +3866,7 @@
+ 	      macro=DoubleElementResultEnum()
+ 	"""
+ 
+-	return StringToEnum('DoubleElementResult')
++	return StringToEnum('DoubleElementResult')[0]
+ 
+ def DoubleExternalResultEnum():
+ 	"""
+@@ -3874,7 +3876,7 @@
+ 	      macro=DoubleExternalResultEnum()
+ 	"""
+ 
+-	return StringToEnum('DoubleExternalResult')
++	return StringToEnum('DoubleExternalResult')[0]
+ 
+ def DoubleMatExternalResultEnum():
+ 	"""
+@@ -3884,7 +3886,7 @@
+ 	      macro=DoubleMatExternalResultEnum()
+ 	"""
+ 
+-	return StringToEnum('DoubleMatExternalResult')
++	return StringToEnum('DoubleMatExternalResult')[0]
+ 
+ def DoubleVecExternalResultEnum():
+ 	"""
+@@ -3894,7 +3896,7 @@
+ 	      macro=DoubleVecExternalResultEnum()
+ 	"""
+ 
+-	return StringToEnum('DoubleVecExternalResult')
++	return StringToEnum('DoubleVecExternalResult')[0]
+ 
+ def IntExternalResultEnum():
+ 	"""
+@@ -3904,7 +3906,7 @@
+ 	      macro=IntExternalResultEnum()
+ 	"""
+ 
+-	return StringToEnum('IntExternalResult')
++	return StringToEnum('IntExternalResult')[0]
+ 
+ def JEnum():
+ 	"""
+@@ -3914,7 +3916,7 @@
+ 	      macro=JEnum()
+ 	"""
+ 
+-	return StringToEnum('J')
++	return StringToEnum('J')[0]
+ 
+ def PatchEnum():
+ 	"""
+@@ -3924,7 +3926,7 @@
+ 	      macro=PatchEnum()
+ 	"""
+ 
+-	return StringToEnum('Patch')
++	return StringToEnum('Patch')[0]
+ 
+ def PatchNodesEnum():
+ 	"""
+@@ -3934,7 +3936,7 @@
+ 	      macro=PatchNodesEnum()
+ 	"""
+ 
+-	return StringToEnum('PatchNodes')
++	return StringToEnum('PatchNodes')[0]
+ 
+ def PatchVerticesEnum():
+ 	"""
+@@ -3944,7 +3946,7 @@
+ 	      macro=PatchVerticesEnum()
+ 	"""
+ 
+-	return StringToEnum('PatchVertices')
++	return StringToEnum('PatchVertices')[0]
+ 
+ def PentaP1ElementResultEnum():
+ 	"""
+@@ -3954,7 +3956,7 @@
+ 	      macro=PentaP1ElementResultEnum()
+ 	"""
+ 
+-	return StringToEnum('PentaP1ElementResult')
++	return StringToEnum('PentaP1ElementResult')[0]
+ 
+ def PetscVecExternalResultEnum():
+ 	"""
+@@ -3964,7 +3966,7 @@
+ 	      macro=PetscVecExternalResultEnum()
+ 	"""
+ 
+-	return StringToEnum('PetscVecExternalResult')
++	return StringToEnum('PetscVecExternalResult')[0]
+ 
+ def StringExternalResultEnum():
+ 	"""
+@@ -3974,7 +3976,7 @@
+ 	      macro=StringExternalResultEnum()
+ 	"""
+ 
+-	return StringToEnum('StringExternalResult')
++	return StringToEnum('StringExternalResult')[0]
+ 
+ def StepEnum():
+ 	"""
+@@ -3984,7 +3986,7 @@
+ 	      macro=StepEnum()
+ 	"""
+ 
+-	return StringToEnum('Step')
++	return StringToEnum('Step')[0]
+ 
+ def TimeEnum():
+ 	"""
+@@ -3994,7 +3996,7 @@
+ 	      macro=TimeEnum()
+ 	"""
+ 
+-	return StringToEnum('Time')
++	return StringToEnum('Time')[0]
+ 
+ def TriaP1ElementResultEnum():
+ 	"""
+@@ -4004,7 +4006,7 @@
+ 	      macro=TriaP1ElementResultEnum()
+ 	"""
+ 
+-	return StringToEnum('TriaP1ElementResult')
++	return StringToEnum('TriaP1ElementResult')[0]
+ 
+ def WaterColumnOldEnum():
+ 	"""
+@@ -4014,7 +4016,7 @@
+ 	      macro=WaterColumnOldEnum()
+ 	"""
+ 
+-	return StringToEnum('WaterColumnOld')
++	return StringToEnum('WaterColumnOld')[0]
+ 
+ def MinVelEnum():
+ 	"""
+@@ -4024,7 +4026,7 @@
+ 	      macro=MinVelEnum()
+ 	"""
+ 
+-	return StringToEnum('MinVel')
++	return StringToEnum('MinVel')[0]
+ 
+ def MaxVelEnum():
+ 	"""
+@@ -4034,7 +4036,7 @@
+ 	      macro=MaxVelEnum()
+ 	"""
+ 
+-	return StringToEnum('MaxVel')
++	return StringToEnum('MaxVel')[0]
+ 
+ def MinVxEnum():
+ 	"""
+@@ -4044,7 +4046,7 @@
+ 	      macro=MinVxEnum()
+ 	"""
+ 
+-	return StringToEnum('MinVx')
++	return StringToEnum('MinVx')[0]
+ 
+ def MaxVxEnum():
+ 	"""
+@@ -4054,7 +4056,7 @@
+ 	      macro=MaxVxEnum()
+ 	"""
+ 
+-	return StringToEnum('MaxVx')
++	return StringToEnum('MaxVx')[0]
+ 
+ def MaxAbsVxEnum():
+ 	"""
+@@ -4064,7 +4066,7 @@
+ 	      macro=MaxAbsVxEnum()
+ 	"""
+ 
+-	return StringToEnum('MaxAbsVx')
++	return StringToEnum('MaxAbsVx')[0]
+ 
+ def MinVyEnum():
+ 	"""
+@@ -4074,7 +4076,7 @@
+ 	      macro=MinVyEnum()
+ 	"""
+ 
+-	return StringToEnum('MinVy')
++	return StringToEnum('MinVy')[0]
+ 
+ def MaxVyEnum():
+ 	"""
+@@ -4084,7 +4086,7 @@
+ 	      macro=MaxVyEnum()
+ 	"""
+ 
+-	return StringToEnum('MaxVy')
++	return StringToEnum('MaxVy')[0]
+ 
+ def MaxAbsVyEnum():
+ 	"""
+@@ -4094,7 +4096,7 @@
+ 	      macro=MaxAbsVyEnum()
+ 	"""
+ 
+-	return StringToEnum('MaxAbsVy')
++	return StringToEnum('MaxAbsVy')[0]
+ 
+ def MinVzEnum():
+ 	"""
+@@ -4104,7 +4106,7 @@
+ 	      macro=MinVzEnum()
+ 	"""
+ 
+-	return StringToEnum('MinVz')
++	return StringToEnum('MinVz')[0]
+ 
+ def MaxVzEnum():
+ 	"""
+@@ -4114,7 +4116,7 @@
+ 	      macro=MaxVzEnum()
+ 	"""
+ 
+-	return StringToEnum('MaxVz')
++	return StringToEnum('MaxVz')[0]
+ 
+ def MaxAbsVzEnum():
+ 	"""
+@@ -4124,7 +4126,7 @@
+ 	      macro=MaxAbsVzEnum()
+ 	"""
+ 
+-	return StringToEnum('MaxAbsVz')
++	return StringToEnum('MaxAbsVz')[0]
+ 
+ def RelativeEnum():
+ 	"""
+@@ -4134,7 +4136,7 @@
+ 	      macro=RelativeEnum()
+ 	"""
+ 
+-	return StringToEnum('Relative')
++	return StringToEnum('Relative')[0]
+ 
+ def AbsoluteEnum():
+ 	"""
+@@ -4144,7 +4146,7 @@
+ 	      macro=AbsoluteEnum()
+ 	"""
+ 
+-	return StringToEnum('Absolute')
++	return StringToEnum('Absolute')[0]
+ 
+ def IncrementalEnum():
+ 	"""
+@@ -4154,7 +4156,7 @@
+ 	      macro=IncrementalEnum()
+ 	"""
+ 
+-	return StringToEnum('Incremental')
++	return StringToEnum('Incremental')[0]
+ 
+ def AgressiveMigrationEnum():
+ 	"""
+@@ -4164,7 +4166,7 @@
+ 	      macro=AgressiveMigrationEnum()
+ 	"""
+ 
+-	return StringToEnum('AgressiveMigration')
++	return StringToEnum('AgressiveMigration')[0]
+ 
+ def NoneEnum():
+ 	"""
+@@ -4174,7 +4176,7 @@
+ 	      macro=NoneEnum()
+ 	"""
+ 
+-	return StringToEnum('None')
++	return StringToEnum('None')[0]
+ 
+ def SoftMigrationEnum():
+ 	"""
+@@ -4184,7 +4186,7 @@
+ 	      macro=SoftMigrationEnum()
+ 	"""
+ 
+-	return StringToEnum('SoftMigration')
++	return StringToEnum('SoftMigration')[0]
+ 
+ def StokesSolverEnum():
+ 	"""
+@@ -4194,7 +4196,7 @@
+ 	      macro=StokesSolverEnum()
+ 	"""
+ 
+-	return StringToEnum('StokesSolver')
++	return StringToEnum('StokesSolver')[0]
+ 
+ def AdjointEnum():
+ 	"""
+@@ -4204,7 +4206,7 @@
+ 	      macro=AdjointEnum()
+ 	"""
+ 
+-	return StringToEnum('Adjoint')
++	return StringToEnum('Adjoint')[0]
+ 
+ def ColinearEnum():
+ 	"""
+@@ -4214,7 +4216,7 @@
+ 	      macro=ColinearEnum()
+ 	"""
+ 
+-	return StringToEnum('Colinear')
++	return StringToEnum('Colinear')[0]
+ 
+ def ControlSteadyEnum():
+ 	"""
+@@ -4224,7 +4226,7 @@
+ 	      macro=ControlSteadyEnum()
+ 	"""
+ 
+-	return StringToEnum('ControlSteady')
++	return StringToEnum('ControlSteady')[0]
+ 
+ def FsetEnum():
+ 	"""
+@@ -4234,7 +4236,7 @@
+ 	      macro=FsetEnum()
+ 	"""
+ 
+-	return StringToEnum('Fset')
++	return StringToEnum('Fset')[0]
+ 
+ def Gradient1Enum():
+ 	"""
+@@ -4244,7 +4246,7 @@
+ 	      macro=Gradient1Enum()
+ 	"""
+ 
+-	return StringToEnum('Gradient1')
++	return StringToEnum('Gradient1')[0]
+ 
+ def Gradient2Enum():
+ 	"""
+@@ -4254,7 +4256,7 @@
+ 	      macro=Gradient2Enum()
+ 	"""
+ 
+-	return StringToEnum('Gradient2')
++	return StringToEnum('Gradient2')[0]
+ 
+ def Gradient3Enum():
+ 	"""
+@@ -4264,7 +4266,7 @@
+ 	      macro=Gradient3Enum()
+ 	"""
+ 
+-	return StringToEnum('Gradient3')
++	return StringToEnum('Gradient3')[0]
+ 
+ def GradientEnum():
+ 	"""
+@@ -4274,7 +4276,7 @@
+ 	      macro=GradientEnum()
+ 	"""
+ 
+-	return StringToEnum('Gradient')
++	return StringToEnum('Gradient')[0]
+ 
+ def GroundinglineMigrationEnum():
+ 	"""
+@@ -4284,7 +4286,7 @@
+ 	      macro=GroundinglineMigrationEnum()
+ 	"""
+ 
+-	return StringToEnum('GroundinglineMigration')
++	return StringToEnum('GroundinglineMigration')[0]
+ 
+ def GsetEnum():
+ 	"""
+@@ -4294,7 +4296,7 @@
+ 	      macro=GsetEnum()
+ 	"""
+ 
+-	return StringToEnum('Gset')
++	return StringToEnum('Gset')[0]
+ 
+ def IndexEnum():
+ 	"""
+@@ -4304,7 +4306,7 @@
+ 	      macro=IndexEnum()
+ 	"""
+ 
+-	return StringToEnum('Index')
++	return StringToEnum('Index')[0]
+ 
+ def IndexedEnum():
+ 	"""
+@@ -4314,7 +4316,7 @@
+ 	      macro=IndexedEnum()
+ 	"""
+ 
+-	return StringToEnum('Indexed')
++	return StringToEnum('Indexed')[0]
+ 
+ def IntersectEnum():
+ 	"""
+@@ -4324,7 +4326,7 @@
+ 	      macro=IntersectEnum()
+ 	"""
+ 
+-	return StringToEnum('Intersect')
++	return StringToEnum('Intersect')[0]
+ 
+ def NodalEnum():
+ 	"""
+@@ -4334,7 +4336,7 @@
+ 	      macro=NodalEnum()
+ 	"""
+ 
+-	return StringToEnum('Nodal')
++	return StringToEnum('Nodal')[0]
+ 
+ def OldGradientEnum():
+ 	"""
+@@ -4344,7 +4346,7 @@
+ 	      macro=OldGradientEnum()
+ 	"""
+ 
+-	return StringToEnum('OldGradient')
++	return StringToEnum('OldGradient')[0]
+ 
+ def OutputFilePointerEnum():
+ 	"""
+@@ -4354,7 +4356,7 @@
+ 	      macro=OutputFilePointerEnum()
+ 	"""
+ 
+-	return StringToEnum('OutputFilePointer')
++	return StringToEnum('OutputFilePointer')[0]
+ 
+ def PetscOptionsAnalysesEnum():
+ 	"""
+@@ -4364,7 +4366,7 @@
+ 	      macro=PetscOptionsAnalysesEnum()
+ 	"""
+ 
+-	return StringToEnum('PetscOptionsAnalyses')
++	return StringToEnum('PetscOptionsAnalyses')[0]
+ 
+ def PetscOptionsStringsEnum():
+ 	"""
+@@ -4374,7 +4376,7 @@
+ 	      macro=PetscOptionsStringsEnum()
+ 	"""
+ 
+-	return StringToEnum('PetscOptionsStrings')
++	return StringToEnum('PetscOptionsStrings')[0]
+ 
+ def QmuErrNameEnum():
+ 	"""
+@@ -4384,7 +4386,7 @@
+ 	      macro=QmuErrNameEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuErrName')
++	return StringToEnum('QmuErrName')[0]
+ 
+ def QmuInNameEnum():
+ 	"""
+@@ -4394,7 +4396,7 @@
+ 	      macro=QmuInNameEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuInName')
++	return StringToEnum('QmuInName')[0]
+ 
+ def QmuOutNameEnum():
+ 	"""
+@@ -4404,7 +4406,7 @@
+ 	      macro=QmuOutNameEnum()
+ 	"""
+ 
+-	return StringToEnum('QmuOutName')
++	return StringToEnum('QmuOutName')[0]
+ 
+ def RegularEnum():
+ 	"""
+@@ -4414,7 +4416,7 @@
+ 	      macro=RegularEnum()
+ 	"""
+ 
+-	return StringToEnum('Regular')
++	return StringToEnum('Regular')[0]
+ 
+ def ScaledEnum():
+ 	"""
+@@ -4424,7 +4426,7 @@
+ 	      macro=ScaledEnum()
+ 	"""
+ 
+-	return StringToEnum('Scaled')
++	return StringToEnum('Scaled')[0]
+ 
+ def SeparateEnum():
+ 	"""
+@@ -4434,7 +4436,7 @@
+ 	      macro=SeparateEnum()
+ 	"""
+ 
+-	return StringToEnum('Separate')
++	return StringToEnum('Separate')[0]
+ 
+ def SsetEnum():
+ 	"""
+@@ -4444,7 +4446,7 @@
+ 	      macro=SsetEnum()
+ 	"""
+ 
+-	return StringToEnum('Sset')
++	return StringToEnum('Sset')[0]
+ 
+ def VerboseEnum():
+ 	"""
+@@ -4454,7 +4456,7 @@
+ 	      macro=VerboseEnum()
+ 	"""
+ 
+-	return StringToEnum('Verbose')
++	return StringToEnum('Verbose')[0]
+ 
+ def TriangleInterpEnum():
+ 	"""
+@@ -4464,7 +4466,7 @@
+ 	      macro=TriangleInterpEnum()
+ 	"""
+ 
+-	return StringToEnum('TriangleInterp')
++	return StringToEnum('TriangleInterp')[0]
+ 
+ def BilinearInterpEnum():
+ 	"""
+@@ -4474,7 +4476,7 @@
+ 	      macro=BilinearInterpEnum()
+ 	"""
+ 
+-	return StringToEnum('BilinearInterp')
++	return StringToEnum('BilinearInterp')[0]
+ 
+ def NearestInterpEnum():
+ 	"""
+@@ -4484,7 +4486,7 @@
+ 	      macro=NearestInterpEnum()
+ 	"""
+ 
+-	return StringToEnum('NearestInterp')
++	return StringToEnum('NearestInterp')[0]
+ 
+ def XYEnum():
+ 	"""
+@@ -4494,7 +4496,7 @@
+ 	      macro=XYEnum()
+ 	"""
+ 
+-	return StringToEnum('XY')
++	return StringToEnum('XY')[0]
+ 
+ def XYZPEnum():
+ 	"""
+@@ -4504,7 +4506,7 @@
+ 	      macro=XYZPEnum()
+ 	"""
+ 
+-	return StringToEnum('XYZP')
++	return StringToEnum('XYZP')[0]
+ 
+ def OptionEnum():
+ 	"""
+@@ -4514,7 +4516,7 @@
+ 	      macro=OptionEnum()
+ 	"""
+ 
+-	return StringToEnum('Option')
++	return StringToEnum('Option')[0]
+ 
+ def OptionCellEnum():
+ 	"""
+@@ -4524,7 +4526,7 @@
+ 	      macro=OptionCellEnum()
+ 	"""
+ 
+-	return StringToEnum('OptionCell')
++	return StringToEnum('OptionCell')[0]
+ 
+ def OptionCharEnum():
+ 	"""
+@@ -4534,7 +4536,7 @@
+ 	      macro=OptionCharEnum()
+ 	"""
+ 
+-	return StringToEnum('OptionChar')
++	return StringToEnum('OptionChar')[0]
+ 
+ def OptionStructEnum():
+ 	"""
+@@ -4544,7 +4546,7 @@
+ 	      macro=OptionStructEnum()
+ 	"""
+ 
+-	return StringToEnum('OptionStruct')
++	return StringToEnum('OptionStruct')[0]
+ 
+ def OptionDoubleEnum():
+ 	"""
+@@ -4554,7 +4556,7 @@
+ 	      macro=OptionDoubleEnum()
+ 	"""
+ 
+-	return StringToEnum('OptionDouble')
++	return StringToEnum('OptionDouble')[0]
+ 
+ def OptionLogicalEnum():
+ 	"""
+@@ -4564,7 +4566,7 @@
+ 	      macro=OptionLogicalEnum()
+ 	"""
+ 
+-	return StringToEnum('OptionLogical')
++	return StringToEnum('OptionLogical')[0]
+ 
+ def PatersonEnum():
+ 	"""
+@@ -4574,7 +4576,7 @@
+ 	      macro=PatersonEnum()
+ 	"""
+ 
+-	return StringToEnum('Paterson')
++	return StringToEnum('Paterson')[0]
+ 
+ def ArrheniusEnum():
+ 	"""
+@@ -4584,7 +4586,7 @@
+ 	      macro=ArrheniusEnum()
+ 	"""
+ 
+-	return StringToEnum('Arrhenius')
++	return StringToEnum('Arrhenius')[0]
+ 
+ def MaximumNumberOfEnums():
+ 	"""
Index: /issm/oecreview/Archive/12678-13393/ISSM-13043-13044.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13043-13044.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13043-13044.diff	(revision 13394)
@@ -0,0 +1,35 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh	(revision 13043)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh	(revision 13044)
+@@ -33,6 +33,12 @@
+ 	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SLEPC_DIR/lib/{$ISSM_ARCH}
+ endif
+ 
++#PETSC
++set TAO_DIR="$ISSM_DIR/externalpackages/tao/install"
++if (-d $TAO_DIR) then
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$TAO_DIR/lib/{$ISSM_ARCH}
++endif
++
+ #Dakota
+ set DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"
+ if (-d $DAKOTA_DIR) then
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13043)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13044)
+@@ -51,6 +51,13 @@
+ 	export LD_RUN_PATH="$LD_RUN_PATH:$SLEPC_DIR/lib/$ISSM_ARCH"
+ fi
+ 
++#PETSC
++TAO_DIR="$ISSM_DIR/externalpackages/tao/install"
++if [ -d "$TAO_DIR" ]; then
++	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TAO_DIR/lib:$TAO_DIR/lib"
++	export LD_RUN_PATH="$LD_RUN_PATH:$TAO_DIR/lib"
++fi
++
+ #Dakota
+ DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"
+ if [ -d "$DAKOTA_DIR" ]; then
Index: /issm/oecreview/Archive/12678-13393/ISSM-13044-13045.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13044-13045.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13044-13045.diff	(revision 13394)
@@ -0,0 +1,27 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 13044)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 13045)
+@@ -377,8 +377,8 @@
+ 
+ 	int i,j;
+ 	_printLine_("Element Matrix echo:");
+-	_printLine_("   nrows: " << nrows);
+-	_printLine_("   ncols: " << nrows);
++	_printLine_("   nrows: " << this->nrows);
++	_printLine_("   ncols: " << this->ncols);
+ 	_printLine_("   dofsymmetrical: " << (dofsymmetrical?"true":"false"));
+ 
+ 	_printLine_("   values:");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 13044)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 13045)
+@@ -149,6 +149,7 @@
+ /*Matrix specific routines: */
+ /*FUNCTION Matrix::Echo{{{*/
+ void Matrix::Echo(void){
++	_assert_(this);
+ 
+ 	if(type==PetscMatType){
+ 		#ifdef _HAVE_PETSC_
Index: /issm/oecreview/Archive/12678-13393/ISSM-13045-13046.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13045-13046.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13045-13046.diff	(revision 13394)
@@ -0,0 +1,494 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13045)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13046)
+@@ -14,13 +14,21 @@
+ 
+ 	dnl }}}
+     dnl shared build {{{
+-    AC_ARG_ENABLE([shared],                                                dnl feature
+-        AS_HELP_STRING([--enable-shared], [produce libISSM.so.0]),         dnl help string
+-        [enable_shared=$enableval],                                        dnl action if given
+-        [enable_shared=no])                                                dnl action if not given
+-    AM_CONDITIONAL([SHARED], [test $enable_shared = yes])
++    AC_ARG_ENABLE([sharedlibs],                                                dnl feature
++        AS_HELP_STRING([--enable-sharedlibs], [produce libISSM.so.0]),         dnl help string
++        [enable_sharedlibs=$enableval],                                        dnl action if given
++        [enable_sharedlibs=no])                                                dnl action if not given
++    AM_CONDITIONAL([SHAREDLIBS], [test x$enable_sharedlibs = xyes])
+     dnl }}}
+ 
++    dnl shared build {{{
++    AC_ARG_ENABLE([version],                                                dnl feature
++        AS_HELP_STRING([--enable-version], [produce libISSM.so.0]),         dnl help string
++        [enable_version=$enableval],                                        dnl action if given
++        [enable_version=no])                                                dnl action if not given
++    AM_CONDITIONAL([VERSION], [test x$enable_VERSION = xyes])
++    dnl }}}
++
+ 	dnl Modules build {{{
+ 	AC_ARG_WITH([modules],
+ 		AS_HELP_STRING([--with-modules = value],[modules compilation. ]),
+@@ -588,7 +596,7 @@
+ 				METISLIB=-L"$METIS_ROOT/lib -lmetis"
+ 				;;
+ 			esac
+-	
++
+ 			METISINCL=-I"$METIS_ROOT/include" 
+ 			AC_DEFINE([_METIS_VERSION_],[5],[ Metis version number])
+ 		fi
+@@ -605,7 +613,7 @@
+ 	dnl mpi{{{
+ 	AC_MSG_CHECKING(for mpi)
+ 	AC_ARG_WITH([mpi-lib],
+-		AS_HELP_STRING([--with-mpi-lib = otions],[mpi options, for ex: "-L$MPIROOT -lmpich]),
++		AS_HELP_STRING([--with-mpi-lib = options],[mpi options, for ex: "-L$MPIROOT -lmpich]),
+ 		[MPILIB=$withval],[MPILIB=""])
+ 	
+ 	AC_ARG_WITH([mpi-include],
+@@ -619,7 +627,7 @@
+ 			HAVE_MPI=no
+ 		else
+ 			HAVE_MPI=yes
+-			MPIINCL=-I"$MPI_INCLUDE/"
++			MPIINCL=-I"$MPI_INCLUDE"
+ 			AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
+ 			AC_DEFINE([HAVE_MPI],[1],[Mpi Flag for Dakota (DO NOT REMOVE)])
+ 			AC_SUBST([MPIINCL])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13045)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13046)
+@@ -5,22 +5,22 @@
+ #Library declaration {{{
+ lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+-#if SHARED
+-#lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
+-#endif
++if SHAREDLIBS
++lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
++endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+ if MATLAB
+-#if SHARED
+-#lib_LTLIBRARIES += libISSMMatlab.la
+-#endif
++if SHAREDLIBS
++lib_LTLIBRARIES += libISSMMatlab.la
++endif
+ lib_LIBRARIES += libISSMMatlab.a 
+ endif
+ if MODULES
+-#if SHARED
+-#lib_LTLIBRARIES += libISSMModules.la
+-#endif
++if SHAREDLIBS
++lib_LTLIBRARIES += libISSMModules.la
++endif
+ lib_LIBRARIES += libISSMModules.a 
+ endif
+ #}}}
+@@ -1009,28 +1009,29 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
+-#if SHARED
+-#libISSM_la_SOURCES = solutions/issm.cpp
+-#libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
+-#
+-#libISSMCore_la_SOURCES  = $(issm_sources)
+-#libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
+-#
+-#libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
+-#endif
++if SHAREDLIBS
++libISSM_la_SOURCES = solutions/issm.cpp
++libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
+ 
++libISSMCore_la_SOURCES  = $(issm_sources)
++libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
++
++libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++endif
++
+ if MODULES
+-#if SHARED
+-#libISSMModules_la_SOURCES = $(module_sources)
+-#libISSMModules_la_SOURCES += $(bamg_sources)
+-#libISSMModules_la_SOURCES += $(kriging_sources)
+-#libISSMModules_la_SOURCES += $(kml_sources)
+-#endif
++if SHAREDLIBS
++libISSMModules_la_SOURCES = $(module_sources)
++libISSMModules_la_SOURCES += $(bamg_sources)
++libISSMModules_la_SOURCES += $(kriging_sources)
++libISSMModules_la_SOURCES += $(kml_sources)
++endif
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+ libISSMModules_a_SOURCES += $(kriging_sources)
+ libISSMModules_a_SOURCES += $(kml_sources)
+ libISSMModules_a_CXXFLAGS = $(ALLCXXFLAGS)
++libISSMModules_a_LIBADD = ./libISSMCore.a
+ endif
+ 
+ if PYTHON
+@@ -1039,13 +1040,18 @@
+ endif
+ 
+ if MATLAB
+-#if SHARED
+-#libISSMMatlab_la_SOURCES = $(matlab_sources)
+-#endif
++if SHAREDLIBS
++libISSMMatlab_la_SOURCES = $(matlab_sources)
++endif
+ libISSMMatlab_a_SOURCES = $(matlab_sources)
+ libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
+ endif
+ 
++if VERSION
++AM_LDFLAGS =
++else
++AM_LDFLAGS = -avoid-version
++endif
+ #}}}
+ #Overload library, to overload any non-standard symbols. {{{
+ libISSMOverload_a_SOURCES = ./shared/String/stricmp.c
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13045)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13046)
+@@ -1,166 +1,229 @@
+ AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++
+ EXEEXT=$(MATLABWRAPPEREXT)
+-#Bin programs {{{1
++
++#Modules {{{1
+ if MODULES
+-bin_PROGRAMS =  AverageFilter\
+-				BamgMesher\
+-				BamgConvertMesh\
+-				BamgTriangulate\
+-				Chaco\
+-				ContourToMesh \
+-				ContourToNodes \
+-				ElementConnectivity\
+-				EnumToString\
+-				Exp2Kml \
+-				HoleFiller \
+-				InternalFront\
+-				InterpFromGridToMesh \
+-				InterpFromMeshToMesh2d \
+-				InterpFromMeshToMesh3d \
+-				InterpFromMeshToGrid \
+-				InterpFromMesh2d \
+-				KMLFileRead \
+-				KMLMeshWrite \
+-				KMLOverlay \
+-				Kml2Exp \
+-				Kriging \
+-				Ll2xy \
+-				NodeConnectivity \
+-				MeshPartition\
+-				MeshProfileIntersection\
+-				PointCloudFindNeighbors\
+-				PropagateFlagsFromConnectivity\
+-				Scotch\
+-				Shp2Kml\
+-				StringToEnum\
+-				TriaSearch\
+-				TriMesh\
+-				TriMeshProcessRifts\
+-				Xy2ll
++lib_LTLIBRARIES =  AverageFilter.la\
++			       BamgMesher.la\
++				   BamgConvertMesh.la\
++				   BamgTriangulate.la\
++				   Chaco.la\
++				   ContourToMesh.la\
++				   ContourToNodes.la\
++				   ElementConnectivity.la\
++				   EnumToString.la\
++				   Exp2Kml.la\
++				   HoleFiller.la\
++				   InternalFront.la\
++				   InterpFromGridToMesh.la\
++				   InterpFromMeshToMesh2d.la\
++				   InterpFromMeshToMesh3d.la\
++				   InterpFromMeshToGrid.la\
++				   InterpFromMesh2d.la\
++				   KMLFileRead.la\
++				   KMLMeshWrite.la\
++				   KMLOverlay.la\
++				   Kml2Exp.la\
++				   Kriging.la\
++				   Ll2xy.la\
++				   NodeConnectivity.la\
++				   MeshPartition.la\
++				   MeshProfileIntersection.la\
++				   PointCloudFindNeighbors.la\
++				   PropagateFlagsFromConnectivity.la\
++				   Shp2Kml.la\
++				   StringToEnum.la\
++				   TriaSearch.la\
++				   TriMesh.la\
++				   TriMeshProcessRifts.la\
++				   Scotch.la\
++				   Xy2ll.la
+ endif 
+ #}}}
+ #Flags and libraries {{{1
+-LDADD = ../../c/libISSMCore.a ../../c/libISSMModules.a $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB)
++if SHAREDLIBS
++deps = ../../c/libISSMCore.la ../../c/libISSMModules.la
++else
++deps = ../../c/libISSMCore.a ../../c/libISSMModules.a
++endif
++deps += $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB) ${MEXLIB}
+ 
+ #Triangle library
+ AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
+ 
+ #Matlab part
+-AM_LDFLAGS   = $(MEXLINK)
++AM_LDFLAGS = $(MEXLINK) -shrext ${EXEEXT} -module
++if VERSION
++AM_LDFLAGS +=
++else
++AM_LDFLAGS += -avoid-version
++endif
++if SHAREDLIBS
++deps += ../../c/libISSMMatlab.la 
++else
++deps += ../../c/libISSMMatlab.a
++deps += ../../c/libISSMCore.a
++AM_LDFLAGS += --no-warnings 
++endif
++
+ AM_CXXFLAGS +=  -D_HAVE_MATLAB_MODULES_ -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread 
+-LDADD       += $(MEXLIB) ../../c/libISSMMatlab.a 
+-LDADD       += ../../c/libISSMCore.a 
++
++######################################################################################
++# Circular dependencies may not be necessary here.
++#deps += ../../c/libISSMCore.a 
+ if CIRCULAR_DEPENDENCIES
+-LDADD       += $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB)
++deps += $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB)
+ endif
+-LDADD       += ../../c/libISSMModules.a
++if SHAREDLIBS
++deps +=
++else
++deps += ../../c/libISSMModules.a ../../c/libISSMCore.a
++endif
++######################################################################################
+ 
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS) 
+ #}}}
++
+ #Bin sources {{{1
+-AverageFilter_SOURCES = ../AverageFilter/AverageFilter.cpp\
++AverageFilter_la_SOURCES = ../AverageFilter/AverageFilter.cpp\
+ 			  ../AverageFilter/AverageFilter.h
++AverageFilter_la_LIBADD = ${deps}
+ 
+-BamgMesher_SOURCES = ../BamgMesher/BamgMesher.cpp\
++BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\
+ 					../BamgMesher/BamgMesher.h
++BamgMesher_la_LIBADD = ${deps}
+ 
+-BamgConvertMesh_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
++BamgConvertMesh_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
+ 					../BamgConvertMesh/BamgConvertMesh.h
++BamgConvertMesh_la_LIBADD = ${deps}
+ 
+-BamgTriangulate_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
++BamgTriangulate_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
+ 								  ../BamgTriangulate/BamgTriangulate.h
++BamgTriangulate_la_LIBADD = ${deps}
+ 
+-Chaco_SOURCES = ../Chaco/Chaco.cpp\
++Chaco_la_SOURCES = ../Chaco/Chaco.cpp\
+ 					../Chaco/Chaco.h
++Chaco_la_LIBADD = ${deps}
+ 
+-ContourToMesh_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
++ContourToMesh_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
+ 			  ../ContourToMesh/ContourToMesh.h
++ContourToMesh_la_LIBADD = ${deps}
+ 
+-ContourToNodes_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
++ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
+ 			  ../ContourToNodes/ContourToNodes.h
++ContourToNodes_la_LIBADD = ${deps}
+ 
+-ElementConnectivity_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
++ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+ 			  ../ElementConnectivity/ElementConnectivity.h
++ElementConnectivity_la_LIBADD = ${deps}
+ 
+-EnumToString_SOURCES = ../EnumToString/EnumToString.cpp\
++EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\
+ 			  ../EnumToString/EnumToString.h
++EnumToString_la_LIBADD = ${deps}
+ 
+-StringToEnum_SOURCES = ../StringToEnum/StringToEnum.cpp\
++StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\
+ 			  ../StringToEnum/StringToEnum.h
++StringToEnum_la_LIBADD = ${deps}
+ 
+-HoleFiller_SOURCES = ../HoleFiller/HoleFiller.cpp\
++HoleFiller_la_SOURCES = ../HoleFiller/HoleFiller.cpp\
+ 			  ../HoleFiller/HoleFiller.h
++HoleFiller_la_LIBADD = ${deps}
+ 
+-InternalFront_SOURCES = ../InternalFront/InternalFront.cpp\
++InternalFront_la_SOURCES = ../InternalFront/InternalFront.cpp\
+ 										 ../InternalFront/InternalFront.h
++InternalFront_la_LIBADD = ${deps}
+ 
+-InterpFromGridToMesh_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
++InterpFromGridToMesh_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
+ 			  ../InterpFromGridToMesh/InterpFromGridToMesh.h
++InterpFromGridToMesh_la_LIBADD = ${deps}
+ 
+-InterpFromMeshToMesh2d_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
++InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
+ 							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
++InterpFromMeshToMesh2d_la_LIBADD = ${deps}
+ 
+-InterpFromMeshToMesh3d_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
++InterpFromMeshToMesh3d_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
+ 									../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
++InterpFromMeshToMesh3d_la_LIBADD = ${deps}
+ 
+-InterpFromMeshToGrid_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
++InterpFromMeshToGrid_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
+ 									../InterpFromMeshToGrid/InterpFromMeshToGrid.h
++InterpFromMeshToGrid_la_LIBADD = ${deps}
+ 
+-InterpFromMesh2d_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
++InterpFromMesh2d_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
+ 									../InterpFromMesh2d/InterpFromMesh2d.h
++InterpFromMesh2d_la_LIBADD = ${deps}
+ 
+-KMLFileRead_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
++KMLFileRead_la_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
+ 			  ../KMLFileRead/KMLFileRead.h
++KMLFileRead_la_LIBADD = ${deps}
+ 
+-KMLMeshWrite_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
++KMLMeshWrite_la_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
+ 			  ../KMLMeshWrite/KMLMeshWrite.h
++KMLMeshWrite_la_LIBADD = ${deps}
+ 
+-KMLOverlay_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
++KMLOverlay_la_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
+ 			  ../KMLOverlay/KMLOverlay.h
++KMLOverlay_la_LIBADD = ${deps}
+ 
+-Xy2ll_SOURCES = ../Xy2ll/Xy2ll.cpp\
++Xy2ll_la_SOURCES = ../Xy2ll/Xy2ll.cpp\
+ 			  ../Xy2ll/Xy2ll.h
++Xy2ll_la_LIBADD = ${deps}
+ 
+-Ll2xy_SOURCES = ../Ll2xy/Ll2xy.cpp\
++Ll2xy_la_SOURCES = ../Ll2xy/Ll2xy.cpp\
+ 			  ../Ll2xy/Ll2xy.h
++Ll2xy_la_LIBADD = ${deps}
+ 
+-Exp2Kml_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
++Exp2Kml_la_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
+ 			  ../Exp2Kml/Exp2Kml.h
++Exp2Kml_la_LIBADD = ${deps}
+ 
+-Kml2Exp_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
++Kml2Exp_la_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
+ 			  ../Kml2Exp/Kml2Exp.h
++Kml2Exp_la_LIBADD = ${deps}
+ 
+-Kriging_SOURCES = ../Kriging/Kriging.cpp\
++Kriging_la_SOURCES = ../Kriging/Kriging.cpp\
+ 						../Kriging/Kriging.h
++Kriging_la_LIBADD = ${deps}
+ 
+-MeshPartition_SOURCES = ../MeshPartition/MeshPartition.cpp\
++MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\
+ 			  ../MeshPartition/MeshPartition.h
++MeshPartition_la_LIBADD = ${deps}
+ 
+-MeshProfileIntersection_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
++MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
+ 			  ../MeshProfileIntersection/MeshProfileIntersection.h
++MeshProfileIntersection_la_LIBADD = ${deps}
+ 
+-NodeConnectivity_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
++NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
+ 										../NodeConnectivity/NodeConnectivity.h
++NodeConnectivity_la_LIBADD = ${deps}
+ 
+-PointCloudFindNeighbors_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
++PointCloudFindNeighbors_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
+ 			  ../PointCloudFindNeighbors/PointCloudFindNeighbors.h
++PointCloudFindNeighbors_la_LIBADD = ${deps}
+ 
+-PropagateFlagsFromConnectivity_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
++PropagateFlagsFromConnectivity_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
+ 			  ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
++PropagateFlagsFromConnectivity_la_LIBADD = ${deps}
+ 
+-Scotch_SOURCES = ../Scotch/Scotch.cpp\
+-			  ../Scotch/Scotch.h
++Scotch_la_SOURCES = ../Scotch/Scotch.cpp\
++                    ../Scotch/Scotch.h
++Scotch_la_LIBADD = ${deps} $(SCOTCHLIB)
+ 
+-Shp2Kml_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
+-			  ../Shp2Kml/Shp2Kml.h
++Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
++                     ../Shp2Kml/Shp2Kml.h
++Shp2Kml_la_LIBADD = ${deps}
+ 
+-TriaSearch_SOURCES = ../TriaSearch/TriaSearch.cpp\
++TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp\
+ 			  ../TriaSearch/TriaSearch.h
++TriaSearch_la_LIBADD = ${deps}
+ 
+-TriMesh_SOURCES = ../TriMesh/TriMesh.cpp\
+-			  ../TriMesh/TriMesh.h
++TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
++                     ../TriMesh/TriMesh.h
++TriMesh_la_LIBADD = ${deps} $(TRIANGLELIB)
+ 
+-TriMeshProcessRifts_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
++TriMeshProcessRifts_la_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
+ 			  ../TriMeshProcessRifts/TriMeshProcessRifts.h
++TriMeshProcessRifts_la_LIBADD = ${deps}
+ #}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13045)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13046)
+@@ -21,12 +21,9 @@
+ AM_SILENT_RULES([yes])           #Do not show compilation command by default
+ AM_PROG_CC_C_O
+ AM_PROG_AR
+-AC_PROG_RANLIB 
+ 
+-# To produce shared libraries uncomment LT_INIT. In theory, Libtool can be initialized
+-# even if all linking is static, since, if not shared libraries are to be produce, libtool
+-# will act simply as a wrapper around AR and Ranlib.
+-#LT_INIT
++#Libtool
++LT_INIT
+ 
+ #Run issm_options.m4
+ ISSM_OPTIONS
Index: /issm/oecreview/Archive/12678-13393/ISSM-13046-13047.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13046-13047.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13046-13047.diff	(revision 13394)
@@ -0,0 +1,481 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13046)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13047)
+@@ -49,6 +49,7 @@
+ 	FlowequationBorderstokesEnum,
+ 	FlowequationElementEquationEnum,
+ 	FlowequationIshutterEnum,
++	FlowequationIsl1l2Enum,
+ 	FlowequationIsmacayealpattynEnum,
+ 	FlowequationIsstokesEnum,
+ 	FlowequationVertexEquationEnum,
+@@ -235,11 +236,12 @@
+ 	/*}}}*/
+ 	/*Approximations {{{1*/
+ 	ApproximationEnum,
++	NoneApproximationEnum,
+ 	HutterApproximationEnum,
+ 	MacAyealApproximationEnum,
+ 	MacAyealPattynApproximationEnum,
+ 	MacAyealStokesApproximationEnum,
+-	NoneApproximationEnum,
++	L1L2ApproximationEnum,
+ 	PattynApproximationEnum,
+ 	PattynStokesApproximationEnum,
+ 	StokesApproximationEnum,
+@@ -283,6 +285,7 @@
+ 	NodeEnum,
+ 	NumericalfluxEnum,
+ 	ParamEnum,
++	L1L2IceFrontEnum,
+ 	PattynIceFrontEnum,
+ 	PengridEnum,
+ 	PenpairEnum,
+@@ -380,6 +383,8 @@
+ 	EnthalpyEnum,
+ 	EnthalpyPicardEnum,
+ 	ThicknessAbsGradientEnum,
++	ThicknessAlongGradientEnum,
++	ThicknessAcrossGradientEnum,
+ 	StepResponsesEnum,
+ 	IntMatParamEnum,
+ 	RheologyBbarAbsGradientEnum,
+@@ -400,10 +405,6 @@
+ 	StressTensoryyEnum,
+ 	StressTensoryzEnum,
+ 	StressTensorzzEnum,
+-	IceVolumeEnum, //FIXME reposition
+-	TotalSmbEnum,  //FIXME reposition
+-	ThicknessAlongGradientEnum,
+-	ThicknessAcrossGradientEnum,
+ 	/*}}}*/
+ 	/*Element Interpolations{{{1*/
+ 	P0Enum,
+@@ -443,6 +444,8 @@
+ 	MinVzEnum,
+ 	MaxVzEnum,
+ 	MaxAbsVzEnum,
++	IceVolumeEnum,
++	TotalSmbEnum,
+ 	/*}}}*/
+ 	/*Convergence{{{1*/
+ 	RelativeEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13046)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13047)
+@@ -55,6 +55,7 @@
+ 	      else if (strcmp(name,"FlowequationBorderstokes")==0) return FlowequationBorderstokesEnum;
+ 	      else if (strcmp(name,"FlowequationElementEquation")==0) return FlowequationElementEquationEnum;
+ 	      else if (strcmp(name,"FlowequationIshutter")==0) return FlowequationIshutterEnum;
++	      else if (strcmp(name,"FlowequationIsl1l2")==0) return FlowequationIsl1l2Enum;
+ 	      else if (strcmp(name,"FlowequationIsmacayealpattyn")==0) return FlowequationIsmacayealpattynEnum;
+ 	      else if (strcmp(name,"FlowequationIsstokes")==0) return FlowequationIsstokesEnum;
+ 	      else if (strcmp(name,"FlowequationVertexEquation")==0) return FlowequationVertexEquationEnum;
+@@ -136,11 +137,11 @@
+ 	      else if (strcmp(name,"MiscellaneousName")==0) return MiscellaneousNameEnum;
+ 	      else if (strcmp(name,"PrognosticHydrostaticAdjustment")==0) return PrognosticHydrostaticAdjustmentEnum;
+ 	      else if (strcmp(name,"PrognosticMinThickness")==0) return PrognosticMinThicknessEnum;
+-	      else if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum;
+          else stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"PrognosticSpcthickness")==0) return PrognosticSpcthicknessEnum;
++	      if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum;
++	      else if (strcmp(name,"PrognosticSpcthickness")==0) return PrognosticSpcthicknessEnum;
+ 	      else if (strcmp(name,"PrognosticStabilization")==0) return PrognosticStabilizationEnum;
+ 	      else if (strcmp(name,"PrognosticVertexPairing")==0) return PrognosticVertexPairingEnum;
+ 	      else if (strcmp(name,"QmuIsdakota")==0) return QmuIsdakotaEnum;
+@@ -240,11 +241,12 @@
+ 	      else if (strcmp(name,"ThermalSolution")==0) return ThermalSolutionEnum;
+ 	      else if (strcmp(name,"TransientSolution")==0) return TransientSolutionEnum;
+ 	      else if (strcmp(name,"Approximation")==0) return ApproximationEnum;
++	      else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum;
+ 	      else if (strcmp(name,"HutterApproximation")==0) return HutterApproximationEnum;
+ 	      else if (strcmp(name,"MacAyealApproximation")==0) return MacAyealApproximationEnum;
+ 	      else if (strcmp(name,"MacAyealPattynApproximation")==0) return MacAyealPattynApproximationEnum;
+ 	      else if (strcmp(name,"MacAyealStokesApproximation")==0) return MacAyealStokesApproximationEnum;
+-	      else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum;
++	      else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum;
+ 	      else if (strcmp(name,"PattynApproximation")==0) return PattynApproximationEnum;
+ 	      else if (strcmp(name,"PattynStokesApproximation")==0) return PattynStokesApproximationEnum;
+ 	      else if (strcmp(name,"StokesApproximation")==0) return StokesApproximationEnum;
+@@ -258,12 +260,12 @@
+ 	      else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
+ 	      else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
+ 	      else if (strcmp(name,"Contour")==0) return ContourEnum;
+-	      else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
+-	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
++	      if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
++	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
++	      else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
+ 	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
+ 	      else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
+ 	      else if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum;
+@@ -287,6 +289,7 @@
+ 	      else if (strcmp(name,"Node")==0) return NodeEnum;
+ 	      else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
+ 	      else if (strcmp(name,"Param")==0) return ParamEnum;
++	      else if (strcmp(name,"L1L2IceFront")==0) return L1L2IceFrontEnum;
+ 	      else if (strcmp(name,"PattynIceFront")==0) return PattynIceFrontEnum;
+ 	      else if (strcmp(name,"Pengrid")==0) return PengridEnum;
+ 	      else if (strcmp(name,"Penpair")==0) return PenpairEnum;
+@@ -378,15 +381,17 @@
+ 	      else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
+ 	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
+ 	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+-	      else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
++	      else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
++	      else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
++         else stage=4;
++   }
++   if(stage==4){
++	      if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
+ 	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+ 	      else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
+ 	      else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
+ 	      else if (strcmp(name,"TransientInput")==0) return TransientInputEnum;
+-         else stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum;
++	      else if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum;
+ 	      else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum;
+ 	      else if (strcmp(name,"Watercolumn")==0) return WatercolumnEnum;
+ 	      else if (strcmp(name,"BasalFriction")==0) return BasalFrictionEnum;
+@@ -401,10 +406,6 @@
+ 	      else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
+ 	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
+ 	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
+-	      else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
+-	      else if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum;
+-	      else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
+-	      else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
+ 	      else if (strcmp(name,"P0")==0) return P0Enum;
+ 	      else if (strcmp(name,"P1")==0) return P1Enum;
+ 	      else if (strcmp(name,"P1DG")==0) return P1DGEnum;
+@@ -438,6 +439,8 @@
+ 	      else if (strcmp(name,"MinVz")==0) return MinVzEnum;
+ 	      else if (strcmp(name,"MaxVz")==0) return MaxVzEnum;
+ 	      else if (strcmp(name,"MaxAbsVz")==0) return MaxAbsVzEnum;
++	      else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
++	      else if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum;
+ 	      else if (strcmp(name,"Relative")==0) return RelativeEnum;
+ 	      else if (strcmp(name,"Absolute")==0) return AbsoluteEnum;
+ 	      else if (strcmp(name,"Incremental")==0) return IncrementalEnum;
+@@ -487,5 +490,5 @@
+          else stage=5;
+    }
+ 	/*If we reach this point, the string provided has not been found*/
+-	_error_("Enum " << name << " not found");
++	_error2_("Enum " << name << " not found");
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13046)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13047)
+@@ -54,6 +54,7 @@
+ 		case FlowequationBorderstokesEnum : return "FlowequationBorderstokes";
+ 		case FlowequationElementEquationEnum : return "FlowequationElementEquation";
+ 		case FlowequationIshutterEnum : return "FlowequationIshutter";
++		case FlowequationIsl1l2Enum : return "FlowequationIsl1l2";
+ 		case FlowequationIsmacayealpattynEnum : return "FlowequationIsmacayealpattyn";
+ 		case FlowequationIsstokesEnum : return "FlowequationIsstokes";
+ 		case FlowequationVertexEquationEnum : return "FlowequationVertexEquation";
+@@ -236,11 +237,12 @@
+ 		case ThermalSolutionEnum : return "ThermalSolution";
+ 		case TransientSolutionEnum : return "TransientSolution";
+ 		case ApproximationEnum : return "Approximation";
++		case NoneApproximationEnum : return "NoneApproximation";
+ 		case HutterApproximationEnum : return "HutterApproximation";
+ 		case MacAyealApproximationEnum : return "MacAyealApproximation";
+ 		case MacAyealPattynApproximationEnum : return "MacAyealPattynApproximation";
+ 		case MacAyealStokesApproximationEnum : return "MacAyealStokesApproximation";
+-		case NoneApproximationEnum : return "NoneApproximation";
++		case L1L2ApproximationEnum : return "L1L2Approximation";
+ 		case PattynApproximationEnum : return "PattynApproximation";
+ 		case PattynStokesApproximationEnum : return "PattynStokesApproximation";
+ 		case StokesApproximationEnum : return "StokesApproximation";
+@@ -280,6 +282,7 @@
+ 		case NodeEnum : return "Node";
+ 		case NumericalfluxEnum : return "Numericalflux";
+ 		case ParamEnum : return "Param";
++		case L1L2IceFrontEnum : return "L1L2IceFront";
+ 		case PattynIceFrontEnum : return "PattynIceFront";
+ 		case PengridEnum : return "Pengrid";
+ 		case PenpairEnum : return "Penpair";
+@@ -371,6 +374,8 @@
+ 		case EnthalpyEnum : return "Enthalpy";
+ 		case EnthalpyPicardEnum : return "EnthalpyPicard";
+ 		case ThicknessAbsGradientEnum : return "ThicknessAbsGradient";
++		case ThicknessAlongGradientEnum : return "ThicknessAlongGradient";
++		case ThicknessAcrossGradientEnum : return "ThicknessAcrossGradient";
+ 		case StepResponsesEnum : return "StepResponses";
+ 		case IntMatParamEnum : return "IntMatParam";
+ 		case RheologyBbarAbsGradientEnum : return "RheologyBbarAbsGradient";
+@@ -391,10 +396,6 @@
+ 		case StressTensoryyEnum : return "StressTensoryy";
+ 		case StressTensoryzEnum : return "StressTensoryz";
+ 		case StressTensorzzEnum : return "StressTensorzz";
+-		case IceVolumeEnum : return "IceVolume";
+-		case TotalSmbEnum : return "TotalSmb";
+-		case ThicknessAlongGradientEnum : return "ThicknessAlongGradient";
+-		case ThicknessAcrossGradientEnum : return "ThicknessAcrossGradient";
+ 		case P0Enum : return "P0";
+ 		case P1Enum : return "P1";
+ 		case P1DGEnum : return "P1DG";
+@@ -428,6 +429,8 @@
+ 		case MinVzEnum : return "MinVz";
+ 		case MaxVzEnum : return "MaxVz";
+ 		case MaxAbsVzEnum : return "MaxAbsVz";
++		case IceVolumeEnum : return "IceVolume";
++		case TotalSmbEnum : return "TotalSmb";
+ 		case RelativeEnum : return "Relative";
+ 		case AbsoluteEnum : return "Absolute";
+ 		case IncrementalEnum : return "Incremental";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13046)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13047)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=458;
++macro=461;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/L1L2IceFrontEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/L1L2IceFrontEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/L1L2IceFrontEnum.m	(revision 13047)
+@@ -0,0 +1,11 @@
++function macro=L1L2IceFrontEnum()
++%L1L2ICEFRONTENUM - Enum of L1L2IceFront
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=L1L2IceFrontEnum()
++
++macro=StringToEnum('L1L2IceFront');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/L1L2ApproximationEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/L1L2ApproximationEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/L1L2ApproximationEnum.m	(revision 13047)
+@@ -0,0 +1,11 @@
++function macro=L1L2ApproximationEnum()
++%L1L2APPROXIMATIONENUM - Enum of L1L2Approximation
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=L1L2ApproximationEnum()
++
++macro=StringToEnum('L1L2Approximation');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/FlowequationIsl1l2Enum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/FlowequationIsl1l2Enum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/FlowequationIsl1l2Enum.m	(revision 13047)
+@@ -0,0 +1,11 @@
++function macro=FlowequationIsl1l2Enum()
++%FLOWEQUATIONISL1L2ENUM - Enum of FlowequationIsl1l2
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=FlowequationIsl1l2Enum()
++
++macro=StringToEnum('FlowequationIsl1l2');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13046)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13047)
+@@ -388,6 +388,16 @@
+ 
+ 	return StringToEnum('FlowequationIshutter')[0]
+ 
++def FlowequationIsl1l2Enum():
++	"""
++	FLOWEQUATIONISL1L2ENUM - Enum of FlowequationIsl1l2
++
++	   Usage:
++	      macro=FlowequationIsl1l2Enum()
++	"""
++
++	return StringToEnum('FlowequationIsl1l2')[0]
++
+ def FlowequationIsmacayealpattynEnum():
+ 	"""
+ 	FLOWEQUATIONISMACAYEALPATTYNENUM - Enum of FlowequationIsmacayealpattyn
+@@ -2208,6 +2218,16 @@
+ 
+ 	return StringToEnum('Approximation')[0]
+ 
++def NoneApproximationEnum():
++	"""
++	NONEAPPROXIMATIONENUM - Enum of NoneApproximation
++
++	   Usage:
++	      macro=NoneApproximationEnum()
++	"""
++
++	return StringToEnum('NoneApproximation')[0]
++
+ def HutterApproximationEnum():
+ 	"""
+ 	HUTTERAPPROXIMATIONENUM - Enum of HutterApproximation
+@@ -2248,15 +2268,15 @@
+ 
+ 	return StringToEnum('MacAyealStokesApproximation')[0]
+ 
+-def NoneApproximationEnum():
++def L1L2ApproximationEnum():
+ 	"""
+-	NONEAPPROXIMATIONENUM - Enum of NoneApproximation
++	L1L2APPROXIMATIONENUM - Enum of L1L2Approximation
+ 
+ 	   Usage:
+-	      macro=NoneApproximationEnum()
++	      macro=L1L2ApproximationEnum()
+ 	"""
+ 
+-	return StringToEnum('NoneApproximation')[0]
++	return StringToEnum('L1L2Approximation')[0]
+ 
+ def PattynApproximationEnum():
+ 	"""
+@@ -2648,6 +2668,16 @@
+ 
+ 	return StringToEnum('Param')[0]
+ 
++def L1L2IceFrontEnum():
++	"""
++	L1L2ICEFRONTENUM - Enum of L1L2IceFront
++
++	   Usage:
++	      macro=L1L2IceFrontEnum()
++	"""
++
++	return StringToEnum('L1L2IceFront')[0]
++
+ def PattynIceFrontEnum():
+ 	"""
+ 	PATTYNICEFRONTENUM - Enum of PattynIceFront
+@@ -3558,6 +3588,26 @@
+ 
+ 	return StringToEnum('ThicknessAbsGradient')[0]
+ 
++def ThicknessAlongGradientEnum():
++	"""
++	THICKNESSALONGGRADIENTENUM - Enum of ThicknessAlongGradient
++
++	   Usage:
++	      macro=ThicknessAlongGradientEnum()
++	"""
++
++	return StringToEnum('ThicknessAlongGradient')[0]
++
++def ThicknessAcrossGradientEnum():
++	"""
++	THICKNESSACROSSGRADIENTENUM - Enum of ThicknessAcrossGradient
++
++	   Usage:
++	      macro=ThicknessAcrossGradientEnum()
++	"""
++
++	return StringToEnum('ThicknessAcrossGradient')[0]
++
+ def StepResponsesEnum():
+ 	"""
+ 	STEPRESPONSESENUM - Enum of StepResponses
+@@ -3758,46 +3808,6 @@
+ 
+ 	return StringToEnum('StressTensorzz')[0]
+ 
+-def IceVolumeEnum():
+-	"""
+-	ICEVOLUMEENUM - Enum of IceVolume
+-
+-	   Usage:
+-	      macro=IceVolumeEnum()
+-	"""
+-
+-	return StringToEnum('IceVolume')[0]
+-
+-def TotalSmbEnum():
+-	"""
+-	TOTALSMBENUM - Enum of TotalSmb
+-
+-	   Usage:
+-	      macro=TotalSmbEnum()
+-	"""
+-
+-	return StringToEnum('TotalSmb')[0]
+-
+-def ThicknessAlongGradientEnum():
+-	"""
+-	THICKNESSALONGGRADIENTENUM - Enum of ThicknessAlongGradient
+-
+-	   Usage:
+-	      macro=ThicknessAlongGradientEnum()
+-	"""
+-
+-	return StringToEnum('ThicknessAlongGradient')[0]
+-
+-def ThicknessAcrossGradientEnum():
+-	"""
+-	THICKNESSACROSSGRADIENTENUM - Enum of ThicknessAcrossGradient
+-
+-	   Usage:
+-	      macro=ThicknessAcrossGradientEnum()
+-	"""
+-
+-	return StringToEnum('ThicknessAcrossGradient')[0]
+-
+ def P0Enum():
+ 	"""
+ 	P0ENUM - Enum of P0
+@@ -4128,6 +4138,26 @@
+ 
+ 	return StringToEnum('MaxAbsVz')[0]
+ 
++def IceVolumeEnum():
++	"""
++	ICEVOLUMEENUM - Enum of IceVolume
++
++	   Usage:
++	      macro=IceVolumeEnum()
++	"""
++
++	return StringToEnum('IceVolume')[0]
++
++def TotalSmbEnum():
++	"""
++	TOTALSMBENUM - Enum of TotalSmb
++
++	   Usage:
++	      macro=TotalSmbEnum()
++	"""
++
++	return StringToEnum('TotalSmb')[0]
++
+ def RelativeEnum():
+ 	"""
+ 	RELATIVEENUM - Enum of Relative
+@@ -4596,5 +4626,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 458
++	return 461
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13047-13048.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13047-13048.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13047-13048.diff	(revision 13394)
@@ -0,0 +1,91 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 13047)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 13048)
+@@ -10,6 +10,7 @@
+ %   an empty string '' will be considered as an empty domain
+ %   a string 'all' will be considered as the entire domain
+ %   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
++%   NB: l1l2 cannot currently be coupled to any other ice flow model
+ %
+ %   Usage:
+ %      md=setflowequation(md,varargin)
+@@ -51,28 +52,33 @@
+ end
+ 
+ %check that each element has at least one flag
+-if any(hutterflag+ macayealflag+pattynflag+stokesflag==0),
+-	error('setflowequation error message: elements type not assigned, must be specified')
++if any(hutterflag+macayealflag+pattynflag+l1l2flag+stokesflag==0),
++	error('elements type not assigned, must be specified')
+ end
+ 
+ %check that each element has only one flag
+-if any(hutterflag+ macayealflag+pattynflag+stokesflag>1),
++if any(hutterflag+macayealflag+pattynflag+l1l2flag+stokesflag>1),
+ 	disp('setflowequation warning message: some elements have several types, higher order type is used for them')
+ 	hutterflag(find(hutterflag & macayealflag))=0;
+ 	hutterflag(find(hutterflag & pattynflag))=0;
+ 	macayealflag(find(macayealflag & pattynflag))=0;
+ end
+ 
+-%Check that no pattyn or stokes for 2d mesh
++%check that l1l2 is not coupled to any other model for now
++if any(l1l2flag) & any(hutterflag | macayealflag | pattynflag | stokesflag)
++	error('l1l2 cannot be coupled to any other model');
++end
++
++%Check that no l1l2 or pattyn or stokes for 2d mesh
+ if (md.mesh.dimension==2),
+-	if any(stokesflag | pattynflag)
+-		error('setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first')
++	if any(l1l2flag | stokesflag | pattynflag)
++		error('stokes and pattyn elements not allowed in 2d mesh, extrude it first')
+ 	end
+ end
+ 
+ %Stokes can only be used alone for now:
+ if any(stokesflag) &any(hutterflag),
+-	error('setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere')
++	error('stokes cannot be used with any other model for now, put stokes everywhere')
+ end
+ 
+ %Initialize node fields
+@@ -82,6 +88,8 @@
+ nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
+ nodeonpattyn=zeros(md.mesh.numberofvertices,1);
+ nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
++nodeonl1l2=zeros(md.mesh.numberofvertices,1);
++nodeonl1l2(md.mesh.elements(find(l1l2flag),:))=1;
+ nodeonstokes=zeros(md.mesh.numberofvertices,1);
+ noneflag=zeros(md.mesh.numberofelements,1);
+ 
+@@ -235,6 +243,7 @@
+ md.flowequation.element_equation(find(noneflag))=0;
+ md.flowequation.element_equation(find(hutterflag))=1;
+ md.flowequation.element_equation(find(macayealflag))=2;
++md.flowequation.element_equation(find(l1l2flag))=8;
+ md.flowequation.element_equation(find(pattynflag))=3;
+ md.flowequation.element_equation(find(stokesflag))=4;
+ md.flowequation.element_equation(find(macayealpattynflag))=5;
+@@ -252,10 +261,10 @@
+ md.flowequation.vertex_equation(pos)=1;
+ pos=find(nodeonmacayeal);
+ md.flowequation.vertex_equation(pos)=2;
++pos=find(nodeonl1l2);
++md.flowequation.vertex_equation(pos)=8;
+ pos=find(nodeonpattyn);
+ md.flowequation.vertex_equation(pos)=3;
+-pos=find(nodeonhutter);
+-md.flowequation.vertex_equation(pos)=1;
+ pos=find(nodeonmacayealpattyn);
+ md.flowequation.vertex_equation(pos)=5;
+ pos=find(nodeonstokes);
+@@ -275,6 +284,7 @@
+ md.flowequation.ishutter=double(any(md.flowequation.element_equation==1));
+ md.flowequation.ismacayealpattyn=double(any(md.flowequation.element_equation==2 | md.flowequation.element_equation==3));
+ md.flowequation.isstokes=double(any(md.flowequation.element_equation==4));
++md.flowequation.isl1l2=double(any(md.flowequation.element_equation==8));
+ 
+ return
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13048-13049.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13048-13049.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13048-13049.diff	(revision 13394)
@@ -0,0 +1,142 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 13048)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 13049)
+@@ -19,6 +19,7 @@
+ 		
+ 		self.ismacayealpattyn     = 0;
+ 		self.ishutter             = 0;
++		self.isl1l2             = 0;
+ 		self.isstokes             = 0;
+ 		self.vertex_equation      = float('NaN')
+ 		self.element_equation     = float('NaN')
+@@ -36,6 +37,7 @@
+ 
+ 		string="%s\n\n%s"%(string,fielddisplay(self,'ismacayealpattyn','is the macayeal or pattyn approximation used ?'))
+ 		string="%s\n%s"%(string,fielddisplay(self,'ishutter','is the shallow ice approximation used ?'))
++		string="%s\n%s"%(string,fielddisplay(self,'isl1l2','are l1l2 equations used ?'))
+ 		string="%s\n%s"%(string,fielddisplay(self,'isstokes','are the Full-Stokes equations used ?'))
+ 		string="%s\n%s"%(string,fielddisplay(self,'vertex_equation','flow equation for each vertex'))
+ 		string="%s\n%s"%(string,fielddisplay(self,'element_equation','flow equation for each element'))
+@@ -55,6 +57,7 @@
+ 		if DiagnosticHorizAnalysisEnum() in analyses:
+ 			md = checkfield(md,'flowequation.ismacayealpattyn','numel',[1],'values',[0,1])
+ 			md = checkfield(md,'flowequation.ishutter','numel',[1],'values',[0,1])
++			md = checkfield(md,'flowequation.isl1l2','numel',[1],'values',[0,1])
+ 			md = checkfield(md,'flowequation.isstokes','numel',[1],'values',[0,1])
+ 			md = checkfield(md,'flowequation.bordermacayeal','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'flowequation.borderpattyn','size',[md.mesh.numberofvertices],'values',[0,1])
+@@ -65,12 +68,12 @@
+ 			else:
+ 				md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',range(0,7+1))
+ 				md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements],'values',range(0,7+1))
+-			if not (md.flowequation.ismacayealpattyn or md.flowequation.ishutter or md.flowequation.isstokes):
++			if not (self.ismacayealpattyn or self.ishutter or self.isstokes or self.isl1l2):
+ 				md.checkmessage("no element types set for this model. At least one of ismacayealpattyn, ishutter or isstokes need to be =1")
+ 
+ 		if DiagnosticHutterAnalysisEnum() in analyses:
+-			if any(md.flowequation.element_equation==1):
+-				if numpy.any(numpy.logical_and(md.flowequation.element_equation,md.mask.elementonfloatingice)):
++			if any(self.element_equation==1):
++				if numpy.any(numpy.logical_and(self.element_equation,md.mask.elementonfloatingice)):
+ 					print "\n !!! Warning: Hutter's model is not consistent on ice shelves !!!\n"
+ 
+ 		return md
+@@ -79,6 +82,7 @@
+ 	def marshall(self,fid):    # {{{
+ 		WriteData(fid,'object',self,'fieldname','ismacayealpattyn','format','Boolean')
+ 		WriteData(fid,'object',self,'fieldname','ishutter','format','Boolean')
++		WriteData(fid,'object',self,'fieldname','isl1l2','format','Boolean')
+ 		WriteData(fid,'object',self,'fieldname','isstokes','format','Boolean')
+ 		WriteData(fid,'object',self,'fieldname','bordermacayeal','format','DoubleMat','mattype',1)
+ 		WriteData(fid,'object',self,'fieldname','borderpattyn','format','DoubleMat','mattype',1)
+@@ -93,6 +97,7 @@
+ 		data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum()
+ 		data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum()
+ 		data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==8]]=L1L2ApproximationEnum()
+ 		WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1)
+ 		data=self.element_equation
+ 		data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum()
+@@ -103,6 +108,7 @@
+ 		data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum()
+ 		data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum()
+ 		data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum()
++		data[[i for i,item in enumerate(data) if item==8]]=L1L2ApproximationEnum()
+ 		WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2)
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m	(revision 13048)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.m	(revision 13049)
+@@ -7,6 +7,7 @@
+ 	properties (SetAccess=public) 
+ 		ismacayealpattyn     = 0;
+ 		ishutter             = 0;
++		isl1l2               = 0;
+ 		isstokes             = 0;
+ 		vertex_equation      = NaN;
+ 		element_equation     = NaN;
+@@ -32,6 +33,7 @@
+ 
+ 				md = checkfield(md,'flowequation.ismacayealpattyn','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'flowequation.ishutter','numel',[1],'values',[0 1]);
++				md = checkfield(md,'flowequation.isl1l2','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'flowequation.isstokes','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'flowequation.bordermacayeal','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 				md = checkfield(md,'flowequation.borderpattyn','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+@@ -40,16 +42,16 @@
+ 					md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]);
+ 					md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]);
+ 				else
+-					md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:7]);
+-					md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:7]);
++					md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:8]);
++					md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:8]);
+ 				end
+-				if ~(md.flowequation.ismacayealpattyn || md.flowequation.ishutter || md.flowequation.isstokes),
++				if ~(obj.ismacayealpattyn || obj.ishutter || obj.isstokes || obj.isl1l2),
+ 					md = checkmessage(md,['no element types set for this model. At least one of ismacayealpattyn, ishutter or isstokes need to be =1']);
+ 				end
+ 			end
+ 			if ismember(DiagnosticHutterAnalysisEnum(),analyses),
+-				if any(md.flowequation.element_equation==1),
+-					if(md.flowequation.element_equation & md.mask.elementonfloatingice),
++				if any(obj.element_equation==1),
++					if(obj.element_equation & md.mask.elementonfloatingice),
+ 						disp(sprintf('\n !!! Warning: Hutter''s model is not consistent on ice shelves !!!\n'));
+ 					end
+ 				end
+@@ -61,6 +63,7 @@
+ 
+ 			fielddisplay(obj,'ismacayealpattyn','is the macayeal or pattyn approximation used ?');
+ 			fielddisplay(obj,'ishutter','is the shallow ice approximation used ?');
++			fielddisplay(obj,'isl1l2','is the l1l2 approximation used ?');
+ 			fielddisplay(obj,'isstokes','are the Full-Stokes equations used ?');
+ 			fielddisplay(obj,'vertex_equation','flow equation for each vertex');
+ 			fielddisplay(obj,'element_equation','flow equation for each element');
+@@ -72,6 +75,7 @@
+ 		function marshall(obj,fid) % {{{
+ 			WriteData(fid,'object',obj,'fieldname','ismacayealpattyn','format','Boolean');
+ 			WriteData(fid,'object',obj,'fieldname','ishutter','format','Boolean');
++			WriteData(fid,'object',obj,'fieldname','isl1l2','format','Boolean');
+ 			WriteData(fid,'object',obj,'fieldname','isstokes','format','Boolean');
+ 			WriteData(fid,'object',obj,'fieldname','bordermacayeal','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','borderpattyn','format','DoubleMat','mattype',1);
+@@ -86,6 +90,7 @@
+ 			pos=find(data==5); data(pos,end)=MacAyealPattynApproximationEnum();
+ 			pos=find(data==6); data(pos,end)=MacAyealStokesApproximationEnum();
+ 			pos=find(data==7); data(pos,end)=PattynStokesApproximationEnum();
++			pos=find(data==8); data(pos,end)=L1L2ApproximationEnum();
+ 			WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1);
+ 			data=obj.element_equation;
+ 			pos=find(data==0); data(pos,end)=NoneApproximationEnum();
+@@ -96,6 +101,7 @@
+ 			pos=find(data==5); data(pos,end)=MacAyealPattynApproximationEnum();
+ 			pos=find(data==6); data(pos,end)=MacAyealStokesApproximationEnum();
+ 			pos=find(data==7); data(pos,end)=PattynStokesApproximationEnum();
++			pos=find(data==8); data(pos,end)=L1L2ApproximationEnum();
+ 			WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2);
+ 		end % }}}
+ 	end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13049-13050.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13049-13050.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13049-13050.diff	(revision 13394)
@@ -0,0 +1,113 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/cubic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/cubic.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/cubic.cpp	(revision 13050)
+@@ -0,0 +1,96 @@
++#include <math.h>
++#include "./numerics.h"
++
++int signR(double Z){
++	int ret;
++	if (Z > 0.0)	ret = 1;
++	if (Z < 0.0)	ret = -1;
++	if (Z == 0.0)	ret =0;
++
++	return ret;
++}
++
++double CBRT(double Z){
++	double ret;
++	const double THIRD = 1./3.;
++	//define cubic root as statement function
++	//SIGN has different meanings in both C and Fortran
++	// Was unable to use the sign command of C, so wrote my own
++	// that why a new variable needs to be introduced that keeps track of the sign of
++	// SIGN is supposed to return a 1, -1 or 0 depending on what the sign of the argument is
++	ret = fabs(pow(fabs(Z),THIRD)) * signR(Z);
++	return ret;
++}
++
++int cubic(double A[4], double X[3], int* num){
++	const double PI = 3.1415926535897932;
++	const double THIRD = 1./3.;
++	double U[3],W, P, Q, DIS, PHI;
++	int i;
++
++	//define cubic root as statement function
++	// In C, the function is defined outside of the cubic fct
++
++	// ====determine the degree of the polynomial ====
++
++	if (A[3] != 0.0){
++		//cubic problem
++		W = A[2]/A[3]*THIRD;
++		P = pow((A[1]/A[3]*THIRD - pow(W,2)),3);
++		Q = -.5*(2.0*pow(W,3)-(A[1]*W-A[0])/A[3] );
++		DIS = pow(Q,2)+P;
++		if ( DIS < 0.0 ){
++			//three real solutions!
++			//Confine the argument of ACOS to the interval [-1;1]!
++			PHI = acos(min(1.0,max(-1.0,Q/sqrt(-P))));
++			P=2.0*pow((-P),(5.e-1*THIRD));
++			for (i=0;i<3;i++)	U[i] = P*cos((PHI+2*((double)i)*PI)*THIRD)-W;
++			X[0] = min(U[0], min(U[1], U[2]));
++			X[1] = max(min(U[0], U[1]),max( min(U[0], U[2]), min(U[1], U[2])));
++			X[2] = max(U[0], max(U[1], U[2]));
++			*num = 3;
++		}
++		else{
++			// only one real solution!
++			DIS = sqrt(DIS);
++			X[0] = CBRT(Q+DIS)+CBRT(Q-DIS)-W;
++			*num=1;
++		}
++	}
++	else if (A[2] != 0.0){
++		// quadratic problem
++		P = 0.5*A[1]/A[2];
++		DIS = pow(P,2)-A[0]/A[2];
++		if (DIS > 0.0)
++		{
++			// 2 real solutions
++			X[0] = -P - sqrt(DIS);
++			X[1] = -P + sqrt(DIS);
++			*num=2;
++		}
++		else
++		{
++			// no real solution
++			*num=0;
++		}
++	}
++	else if (A[1] != 0.0)
++	{
++		//linear equation
++		X[0] =A[0]/A[1];
++		*num=1;
++	}
++	else
++	{
++		//no equation
++		*num=0;
++	}
++ /*
++  *     ==== perform one step of a newton iteration in order to minimize
++  *          round-off errors ====
++  */
++	for (i=0;i<*num;i++){
++		X[i] = X[i] - (A[0]+X[i]*(A[1]+X[i]*(A[2]+X[i]*A[3])))/(A[1]+X[i]*(2.0*A[2]+X[i]*3.0*A[3]));
++	}
++	return 0;
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/numerics.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/numerics.h	(revision 13049)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/numerics.h	(revision 13050)
+@@ -29,6 +29,7 @@
+ IssmDouble UnitConversion(IssmDouble value, int direction_enum, int type_enum);
+ char*  OptionsFromAnalysis(Parameters* parameters,int analysis_type);
+ void   XZvectorsToCoordinateSystem(IssmDouble* T,IssmDouble* xzvectors);
++int cubic(double A[4], double X[3], int* num);
+ #ifdef _HAVE_PETSC_
+ void   PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type);
+ #endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-13050-13051.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13050-13051.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13050-13051.diff	(revision 13394)
@@ -0,0 +1,815 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 13051)
+@@ -80,11 +80,11 @@
+ 
+ 	//print
+ 	if(res<eps_res){
+-		if(VerboseConvergence()) _pprintLine_(setw(50) << left << "   mechanical equilibrium convergence criterion" << res*100 << " < " << eps_res*100 << " %");
++		if(VerboseConvergence()) _pprintLine_(setw(50)<<left<<"   mechanical equilibrium convergence criterion"<<res*100<< " < "<<eps_res*100<<" %");
+ 		converged=true;
+ 	}
+ 	else{ 
+-		if(VerboseConvergence()) _pprintLine_(setw(50) << left << "   mechanical equilibrium convergence criterion" << res*100 << " > " << eps_res*100 << " %");
++		if(VerboseConvergence()) _pprintLine_(setw(50)<<left<<"   mechanical equilibrium convergence criterion"<<res*100<<" > "<<eps_res*100<<" %");
+ 		converged=false;
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/diagnostic_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/diagnostic_core.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/diagnostic_core.cpp	(revision 13051)
+@@ -19,6 +19,7 @@
+ 	int   dim               = -1;
+ 	bool  ishutter          = false;
+ 	bool  ismacayealpattyn  = false;
++	bool  isl1l2            = false;
+ 	bool  isstokes          = false;
+ 	bool  isnewton          = false;
+ 	bool  conserve_loads    = true;
+@@ -32,6 +33,7 @@
+ 	femmodel->parameters->FindParam(&dim,MeshDimensionEnum);
+ 	femmodel->parameters->FindParam(&ishutter,FlowequationIshutterEnum);
+ 	femmodel->parameters->FindParam(&ismacayealpattyn,FlowequationIsmacayealpattynEnum);
++	femmodel->parameters->FindParam(&isl1l2,FlowequationIsl1l2Enum);
+ 	femmodel->parameters->FindParam(&isstokes,FlowequationIsstokesEnum);
+ 	femmodel->parameters->FindParam(&isnewton,DiagnosticIsnewtonEnum);
+ 	femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
+@@ -69,7 +71,7 @@
+ 		if (ismacayealpattyn) ResetBoundaryConditions(femmodel,DiagnosticHorizAnalysisEnum);
+ 	}
+ 
+-	if (ismacayealpattyn ^ isstokes){ // ^ = xor
++	if ((ismacayealpattyn || isl1l2) ^ isstokes){ // ^ = xor
+ 		
+ 		if(VerboseSolution()) _pprintLine_("   computing velocities");
+ 		femmodel->SetCurrentConfiguration(DiagnosticHorizAnalysisEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 13051)
+@@ -20,6 +20,9 @@
+ 		if (vertices_type[0]==MacAyealApproximationEnum){
+ 			numdofs=2;
+ 		}
++		else if (vertices_type[0]==L1L2ApproximationEnum){
++			numdofs=2;
++		}
+ 		else if (vertices_type[0]==PattynApproximationEnum){
+ 			numdofs=2;
+ 		}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 13051)
+@@ -18,12 +18,14 @@
+ 	int    dim;
+ 	int    numberofelements;
+ 	bool   ismacayealpattyn;
++	bool   isl1l2;
+ 	bool   isstokes;
+ 	bool   control_analysis;
+ 	bool   dakota_analysis;
+ 
+ 	/*Fetch constants needed: */
+ 	iomodel->Constant(&isstokes,FlowequationIsstokesEnum);
++	iomodel->Constant(&isl1l2,FlowequationIsl1l2Enum);
+ 	iomodel->Constant(&ismacayealpattyn,FlowequationIsmacayealpattynEnum);
+ 	iomodel->Constant(&dim,MeshDimensionEnum);
+ 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
+@@ -31,7 +33,7 @@
+ 	iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum);
+ 
+ 	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
+-	if(!ismacayealpattyn & !isstokes) return;
++	if(!ismacayealpattyn & !isstokes &!isl1l2) return;
+ 
+ 	/*Fetch data needed: */
+ 	iomodel->FetchData(2,MeshElementsEnum,FlowequationElementEquationEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 13051)
+@@ -93,6 +93,10 @@
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,PattynIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 		}
++		else if ((int)*(elements_type+element)==(L1L2ApproximationEnum)){
++			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,L1L2IceFrontEnum,DiagnosticHorizAnalysisEnum));
++			count++;
++		}
+ 		else if ((int)*(elements_type+element)==(StokesApproximationEnum)){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,StokesIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13051)
+@@ -19,7 +19,7 @@
+ 	double  g;
+ 	double  rho_ice;
+ 	double  stokesreconditioning;
+-	bool    isstokes,ismacayealpattyn;
++	bool    isstokes,isl1l2,ismacayealpattyn;
+    bool    spcpresent=false;
+ 	int Mx,Nx;
+ 	int My,Ny;
+@@ -55,6 +55,7 @@
+ 	iomodel->Constant(&rho_ice,MaterialsRhoIceEnum);
+ 	iomodel->Constant(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
+ 	iomodel->Constant(&isstokes,FlowequationIsstokesEnum);
++	iomodel->Constant(&isl1l2,FlowequationIsl1l2Enum);
+ 	iomodel->Constant(&ismacayealpattyn,FlowequationIsmacayealpattynEnum);
+ 
+ 	/*Recover pointer: */
+@@ -64,7 +65,7 @@
+ 	if(!constraints) constraints = new Constraints();
+ 	
+ 	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
+-	if (!ismacayealpattyn & !isstokes){
++	if(!ismacayealpattyn & !isstokes & !isl1l2){
+ 		*pconstraints=constraints;
+ 		return;
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp	(revision 13051)
+@@ -18,7 +18,7 @@
+ 	int i;
+ 	bool   continuous_galerkin=true;
+ 	int    numberofvertices;
+-	bool   isstokes,ismacayealpattyn;
++	bool   isstokes,isl1l2,ismacayealpattyn;
+ 
+ 	/*DataSets: */
+ 	Nodes*    nodes = NULL;
+@@ -26,6 +26,7 @@
+ 	/*Fetch parameters: */
+ 	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
+ 	iomodel->Constant(&isstokes,FlowequationIsstokesEnum);
++	iomodel->Constant(&isl1l2,FlowequationIsl1l2Enum);
+ 	iomodel->Constant(&ismacayealpattyn,FlowequationIsmacayealpattynEnum);
+ 
+ 	/*Recover pointer: */
+@@ -35,7 +36,7 @@
+ 	if(!nodes) nodes = new Nodes();
+ 	
+ 	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
+-	if(!ismacayealpattyn & !isstokes){
++	if(!ismacayealpattyn & !isstokes & !isl1l2){
+ 		*pnodes=nodes;
+ 		return;
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 13051)
+@@ -35,6 +35,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject(MeshDimensionEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(FlowequationIshutterEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(FlowequationIsmacayealpattynEnum));
++	parameters->AddObject(iomodel->CopyConstantObject(FlowequationIsl1l2Enum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(FlowequationIsstokesEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(SettingsOutputFrequencyEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(DiagnosticRestolEnum));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13051)
+@@ -202,6 +202,7 @@
+ 					./shared/Numerics/cross.cpp\
+ 					./shared/Numerics/isnan.h\
+ 					./shared/Numerics/isnan.cpp\
++					./shared/Numerics/cubic.cpp\
+ 					./shared/Numerics/extrema.cpp\
+ 					./shared/Numerics/XZvectorsToCoordinateSystem.cpp\
+ 					./shared/Numerics/UnitConversion.cpp\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13051)
+@@ -127,6 +127,20 @@
+ 
+ }
+ /*}}}*/
++/*FUNCTION Matice::GetA {{{*/
++IssmDouble Matice::GetA(){
++	/*
++	 * A = 1/B^n
++	 */
++
++	IssmDouble B,n;
++
++	inputs->GetInputAverage(&B,MaterialsRheologyBEnum);
++	n=this->GetN();
++
++	return pow(B,-n);
++}
++/*}}}*/
+ /*FUNCTION Matice::GetB {{{*/
+ IssmDouble Matice::GetB(){
+ 
+@@ -235,7 +249,7 @@
+ 			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
+ 			if(A==0){
+ 				/*Maxiviscositym viscosity for 0 shear areas: */
+-				viscosity=2.5*pow((IssmDouble)10,(IssmDouble)17);
++				viscosity=2.5*pow(10.,17.);
+ 			}
+ 			else{
+ 				e=(n-1)/(2*n);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h	(revision 13051)
+@@ -57,17 +57,18 @@
+ 		void   GetVectorFromInputs(Vector* vector,int input_enum);
+ 		/*}}}*/
+ 		/*Matice Numerics: {{{*/
+-		void   SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
+-		void   GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
+-		void   GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon);
+-		void   GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon);
+-		void   GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
+-		void   GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
+-		void   GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
++		void       SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
++		void       GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
++		void       GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon);
++		void       GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon);
++		void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
++		void       GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
++		void       GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
++		IssmDouble GetA();
+ 		IssmDouble GetB();
+ 		IssmDouble GetBbar();
+ 		IssmDouble GetN();
+-		bool   IsInput(int name);
++		bool       IsInput(int name);
+ 		/*}}}*/
+ };
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 13051)
+@@ -91,6 +91,9 @@
+ 			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealApproximationEnum && !iomodel->Data(MeshVertexonbedEnum)[io_index]){
+ 				for(k=1;k<=gsize;k++) this->FreezeDof(k);
+ 			}
++			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==L1L2ApproximationEnum && !iomodel->Data(MeshVertexonbedEnum)[io_index]){
++				for(k=1;k<=gsize;k++) this->FreezeDof(k);
++			}
+ 			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealPattynApproximationEnum && iomodel->Data(FlowequationBordermacayealEnum)[io_index]){
+ 				if(!iomodel->Data(MeshVertexonbedEnum)[io_index]){
+ 					for(k=1;k<=gsize;k++) this->FreezeDof(k);
+@@ -113,7 +116,7 @@
+ 
+ 	/*Diagnostic Hutter*/
+ 	if (analysis_type==DiagnosticHutterAnalysisEnum){
+-		if (!iomodel->Data(FlowequationVertexEquationEnum)) _error_("iomodel->vertices_type is NULL");
++		_assert_(iomodel->Data(FlowequationVertexEquationEnum));
+ 		/*Constrain all nodes that are not Hutter*/
+ 		if (reCast<int>(iomodel->Data(FlowequationVertexEquationEnum)[io_index])!=HutterApproximationEnum){
+ 			for(k=1;k<=gsize;k++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13051)
+@@ -231,10 +231,10 @@
+ 
+ 	/*Intermediaries */
+ 	int        i,j,ig;
+-	IssmDouble     heatcapacity,latentheat;
+-	IssmDouble     Jdet,D_scalar;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     L[3];
++	IssmDouble heatcapacity,latentheat;
++	IssmDouble Jdet,D_scalar;
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble L[3];
+ 	GaussTria *gauss=NULL;
+ 
+ 	/*Initialize Element matrix*/
+@@ -1443,15 +1443,15 @@
+ void Tria::InputUpdateFromIoModel(int index, IoModel* iomodel){ //i is the element index
+ 
+ 	/*Intermediaries*/
+-	int    i,j;
+-	int    tria_vertex_ids[3];
++	int        i,j;
++	int        tria_vertex_ids[3];
+ 	IssmDouble nodeinputs[3];
+ 	IssmDouble cmmininputs[3];
+ 	IssmDouble cmmaxinputs[3];
+-	bool   control_analysis=false;
+-	int    num_control_type;
++	bool       control_analysis   = false;
++	int        num_control_type;
+ 	IssmDouble yts;
+-	int    num_cm_responses;
++	int        num_cm_responses;
+    
+ 	/*Get parameters: */
+ 	iomodel->Constant(&yts,ConstantsYtsEnum); 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13051)
+@@ -1676,32 +1676,35 @@
+ 
+ 	//Need to know the type of approximation for this element
+ 	if(iomodel->Data(FlowequationElementEquationEnum)){
+-		if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealApproximationEnum){
++		if (iomodel->Data(FlowequationElementEquationEnum)[index]==MacAyealApproximationEnum){
+ 			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealApproximationEnum));
+ 		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynApproximationEnum){
++		else if (iomodel->Data(FlowequationElementEquationEnum)[index]==PattynApproximationEnum){
+ 			this->inputs->AddInput(new IntInput(ApproximationEnum,PattynApproximationEnum));
+ 		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealPattynApproximationEnum){
++		else if (iomodel->Data(FlowequationElementEquationEnum)[index]==MacAyealPattynApproximationEnum){
+ 			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealPattynApproximationEnum));
+ 		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==HutterApproximationEnum){
++		else if (iomodel->Data(FlowequationElementEquationEnum)[index]==HutterApproximationEnum){
+ 			this->inputs->AddInput(new IntInput(ApproximationEnum,HutterApproximationEnum));
+ 		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==StokesApproximationEnum){
++		else if (iomodel->Data(FlowequationElementEquationEnum)[index]==L1L2ApproximationEnum){
++			this->inputs->AddInput(new IntInput(ApproximationEnum,L1L2ApproximationEnum));
++		}
++		else if (iomodel->Data(FlowequationElementEquationEnum)[index]==StokesApproximationEnum){
+ 			this->inputs->AddInput(new IntInput(ApproximationEnum,StokesApproximationEnum));
+ 		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealStokesApproximationEnum){
++		else if (iomodel->Data(FlowequationElementEquationEnum)[index]==MacAyealStokesApproximationEnum){
+ 			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealStokesApproximationEnum));
+ 		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynStokesApproximationEnum){
++		else if (iomodel->Data(FlowequationElementEquationEnum)[index]==PattynStokesApproximationEnum){
+ 			this->inputs->AddInput(new IntInput(ApproximationEnum,PattynStokesApproximationEnum));
+ 		}
+-		else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==NoneApproximationEnum){
++		else if (iomodel->Data(FlowequationElementEquationEnum)[index]==NoneApproximationEnum){
+ 			this->inputs->AddInput(new IntInput(ApproximationEnum,NoneApproximationEnum));
+ 		}
+ 		else{
+-			_error_("Approximation type " << EnumToStringx((int)*(iomodel->Data(FlowequationElementEquationEnum)+index)) << " not supported yet");
++			_error_("Approximation type " << EnumToStringx((int)iomodel->Data(FlowequationElementEquationEnum)[index]) << " not supported yet");
+ 		}
+ 	}
+ 
+@@ -2800,16 +2803,16 @@
+ void Penta::Update(int index,IoModel* iomodel,int analysis_counter,int analysis_type){ 
+ 
+ 	/*Intermediaries*/
+-	IssmInt i,j;
+-	int     penta_type;
+-	int     penta_node_ids[6];
+-	int     penta_vertex_ids[6];
+-	IssmDouble  nodeinputs[6];
+-	IssmDouble  yts;
+-	int     stabilization;
+-	bool    dakota_analysis;
+-	bool    isstokes;
+-	IssmDouble  beta,heatcapacity,referencetemperature,meltingpoint,latentheat;
++	IssmInt    i,j;
++	int        penta_type;
++	int        penta_node_ids[6];
++	int        penta_vertex_ids[6];
++	IssmDouble nodeinputs[6];
++	IssmDouble yts;
++	int        stabilization;
++	bool       dakota_analysis;
++	bool       isstokes;
++	IssmDouble beta,heatcapacity,referencetemperature,meltingpoint,latentheat;
+ 
+ 	/*Fetch parameters: */
+ 	iomodel->Constant(&yts,ConstantsYtsEnum);
+@@ -4231,11 +4234,11 @@
+ 
+ 	const int    numdof=NDOF1*NUMVERTICES;
+ 
+-	int          i;
+-	int*         doflist=NULL;
+-	IssmDouble       values[numdof];
+-	IssmDouble       temp;
+-	GaussPenta   *gauss=NULL;
++	int         i;
++	int        *doflist = NULL;
++	IssmDouble  values[numdof];
++	IssmDouble  temp;
++	GaussPenta *gauss = NULL;
+ 
+ 	/*Get dof list: */
+ 	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+@@ -6199,6 +6202,8 @@
+ 	switch(approximation){
+ 		case MacAyealApproximationEnum:
+ 			return CreateKMatrixDiagnosticMacAyeal2d();
++		case L1L2ApproximationEnum:
++			return CreateKMatrixDiagnosticL1L2();
+ 		case PattynApproximationEnum:
+ 			return CreateKMatrixDiagnosticPattyn();
+ 		case StokesApproximationEnum:
+@@ -6225,9 +6230,9 @@
+ 	const int numdof=NDOF2*NUMVERTICES;
+ 
+ 	/*Intermediaries*/
+-	int       connectivity[2];
+-	int       i,i0,i1,j0,j1;
+-	IssmDouble    one0,one1;
++	int         connectivity[2];
++	int         i,i0,i1,j0,j1;
++	IssmDouble  one0,one1;
+ 
+ 	/*Initialize Element matrix*/
+ 	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+@@ -6455,6 +6460,105 @@
+ 	return Ke;
+ }
+ /*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticL1L2{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticL1L2(void){
++
++	/*compute all stiffness matrices for this element*/
++	ElementMatrix* Ke1=CreateKMatrixDiagnosticL1L2Viscous();
++	ElementMatrix* Ke2=CreateKMatrixDiagnosticL1L2Friction();
++	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
++
++	/*clean-up and return*/
++	delete Ke1;
++	delete Ke2;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticL1L2Viscous{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticL1L2Viscous(void){
++
++	/*Constants*/
++	const int    numdof2d=2*NUMVERTICES2D;
++
++	/*Intermediaries */
++	int         i,j;
++	IssmDouble  Jdet,viscosity;
++	IssmDouble  epsilon[5];       /* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	IssmDouble  B[3][numdof2d];
++	IssmDouble  Bprime[3][numdof2d];
++	IssmDouble  Ke_gg_gaussian[numdof2d][numdof2d];
++	IssmDouble  D[3][3]= {0.0};                 // material matrix, simple scalar matrix.
++	Tria       *tria       = NULL;
++	Penta      *pentabase  = NULL;
++	GaussPenta *gauss      = NULL;
++	GaussTria  *gauss_tria = NULL;
++
++	/*Find penta on bed as this is a macayeal elements: */
++	pentabase=GetBasalElement();
++	tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++
++	/*Initialize Element matrix*/
++	ElementMatrix* Ke=new ElementMatrix(tria->nodes,NUMVERTICES2D,this->parameters,L1L2ApproximationEnum);
++
++	/*Retrieve all inputs and parameters*/
++	GetVerticesCoordinates(&xyz_list[0][0], nodes,NUMVERTICES);
++	Input* vx_input=inputs->GetInput(VxEnum);        _assert_(vx_input);
++	Input* vy_input=inputs->GetInput(VyEnum);        _assert_(vy_input);
++	Input* surf_input=inputs->GetInput(SurfaceEnum); _assert_(surf_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=new GaussPenta(5,5);
++	gauss_tria=new GaussTria();
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++		gauss->SynchronizeGaussTria(gauss_tria);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		tria->GetBMacAyeal(&B[0][0], &xyz_list[0][0], gauss_tria);
++		tria->GetBprimeMacAyeal(&Bprime[0][0], &xyz_list[0][0], gauss_tria);
++
++		/*Get viscosity for L1L2 model*/
++		GetL1L2Viscosity(&viscosity,&xyz_list[0][0],gauss,vx_input,vy_input,surf_input);
++
++		for(i=0;i<3;i++) D[i][i]=2*viscosity*gauss->weight*Jdet;
++
++		TripleMultiply( &B[0][0],3,numdof2d,1,
++					&D[0][0],3,3,0,
++					&Bprime[0][0],3,numdof2d,0,
++					&Ke_gg_gaussian[0][0],0);
++		for(i=0;i<numdof2d;i++) for(j=0;j<numdof2d;j++) Ke->values[i*numdof2d+j]+=Ke_gg_gaussian[i][j];
++	}
++
++	/*Transform Coordinate System*/
++	TransformStiffnessMatrixCoord(Ke,tria->nodes,NUMVERTICES2D,XYEnum);
++
++	/*Clean up and return*/
++	delete tria->matice;
++	delete tria;
++	delete gauss_tria;
++	delete gauss;
++	return Ke;
++}
++/*}}}*/
++/*FUNCTION Penta::CreateKMatrixDiagnosticL1L2Friction{{{*/
++ElementMatrix* Penta::CreateKMatrixDiagnosticL1L2Friction(void){
++
++	/*Initialize Element matrix and return if necessary*/
++	if(IsFloating() || !IsOnBed()) return NULL;
++
++	/*Build a tria element using the 3 nodes of the base of the penta. Then use 
++	 * the tria functionality to build a friction stiffness matrix on these 3
++	 * nodes: */
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyealFriction();
++	delete tria->matice; delete tria;
++
++	/*clean-up and return*/
++	return Ke;
++}
++/*}}}*/
+ /*FUNCTION Penta::CreateKMatrixDiagnosticPattyn{{{*/
+ ElementMatrix* Penta::CreateKMatrixDiagnosticPattyn(void){
+ 
+@@ -7192,6 +7296,8 @@
+ 			return CreatePVectorDiagnosticMacAyeal();
+ 		case PattynApproximationEnum:
+ 			return CreatePVectorDiagnosticPattyn();
++		case L1L2ApproximationEnum:
++			return CreatePVectorDiagnosticL1L2();
+ 		case HutterApproximationEnum:
+ 			return NULL;
+ 		case NoneApproximationEnum:
+@@ -7357,6 +7463,20 @@
+ 	return pe;
+ }
+ /*}}}*/
++/*FUNCTION Penta::CreatePVectorDiagnosticL1L2{{{*/
++ElementVector* Penta::CreatePVectorDiagnosticL1L2(void){
++
++	if (!IsOnBed()) return NULL;
++
++	/*Call Tria function*/
++	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
++	ElementVector* pe=tria->CreatePVectorDiagnosticMacAyeal();
++	delete tria->matice; delete tria;
++
++	/*Clean up and return*/
++	return pe;
++}
++/*}}}*/
+ /*FUNCTION Penta::CreatePVectorDiagnosticPattyn{{{*/
+ ElementVector* Penta::CreatePVectorDiagnosticPattyn(void){
+ 
+@@ -7891,12 +8011,12 @@
+ 
+ 	const int    numdof=NDOF2*NUMVERTICES;
+ 
+-	int          i;
+-	int          approximation;
+-	int*         doflist=NULL;
+-	IssmDouble       vx,vy;
+-	IssmDouble       values[numdof];
+-	GaussPenta*  gauss;
++	int         i;
++	int         approximation;
++	int        *doflist        = NULL;
++	IssmDouble  vx,vy;
++	IssmDouble  values[numdof];
++	GaussPenta *gauss;
+ 
+ 	/*Get approximation enum and dof list: */
+ 	inputs->GetInputValue(&approximation,ApproximationEnum);
+@@ -8042,6 +8162,90 @@
+ 	xDelete<int>(doflist);
+ }
+ /*}}}*/
++/*FUNCTION Penta::GetL1L2Viscosity{{{*/
++void Penta::GetL1L2Viscosity(IssmDouble* pviscosity,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input,Input* surface_input){
++	/*Compute the L1L2 viscosity
++	 *
++	 *      1
++	 * mu = - A^-1 (sigma'_e)^(1-n)
++	 *      2
++	 *
++	 * sigma'_e^2 = |sigma'_//|^2 + |sigma'_perp|^2 (see Perego 2012 eq. 17,18)
++	 *
++	 * L1L2 assumptions:
++	 *
++	 * (1) |eps_b|_// = A (|sigma'_//|^2 + |sigma'_perp|^2)^((n-1)/2) |sigma'_//|
++	 * (2) |sigma'_perp|^2 = |rho g (s-z) grad(s)|^2
++	 *
++	 * Assuming that n = 3, we have a polynom of degree 3 to solve (the only unkown is X=|sigma'_//|)
++	 *
++	 * A X^3 + A |rho g (s-z) grad(s)|^2 X - |eps_b|_// = 0     */
++
++	_error_("Not supported yet");
++	int        i;
++	IssmDouble a,c,d,z,s,viscosity;
++	IssmDouble tau_perp,tau_par,eps_b,A;
++	IssmDouble epsilonvx[5]; /*exx eyy exy exz eyz*/
++	IssmDouble epsilonvy[5]; /*exx eyy exy exz eyz*/
++	IssmDouble epsilon[5];   /*exx eyy exy exz eyz*/
++	IssmDouble z_list[NUMVERTICES];
++	IssmDouble slope[3];
++
++	/*Check that both inputs have been found*/
++	if (!vx_input || !vy_input || !surface_input) _error_("Input missing");
++
++	/*Get tau_perp*/
++	for(i=0;i<NUMVERTICES;i++) z_list[i]=xyz_list[3*i+2];
++	surface_input->GetInputValue(&s,gauss);
++	surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
++	PentaRef::GetInputValue(&z,&z_list[0],gauss);
++	tau_perp = matpar->GetRhoIce() * matpar->GetG() * (s-z)*sqrt(slope[0]*slope[0]+slope[1]*slope[1]);
++
++	/* Get eps_b*/
++	vx_input->GetVxStrainRate3dPattyn(epsilonvx,xyz_list,gauss);
++	vy_input->GetVyStrainRate3dPattyn(epsilonvy,xyz_list,gauss);
++	for(i=0;i<5;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i];
++	eps_b = sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[0]*epsilon[1] + epsilon[2]*epsilon[2]);
++	if(eps_b==0.){
++		*pviscosity=2.5*pow(10.,17.);
++		return;
++	}
++
++	/*Get A*/
++	_assert_(matice->GetN()==3.0);
++	A=matice->GetA();
++
++	/*Solve for tau_par (http://en.wikipedia.org/wiki/Cubic_function)*/
++	a=A;
++	c=A*tau_perp*tau_perp;
++	d=-eps_b;
++	tau_par = -1./(3.*a) * pow(0.5*(27.*a*a*d + sqrt(27.*a*a*d*27.*a*a*d -4.*pow(-3.*a*c,3.))),1./3.);
++
++	//printf("=======================================\n");
++	//printf("tau_par = %g (%g=0?)\n",tau_par,a*tau_par*tau_par*tau_par+c*tau_par+d);
++	//printf("a=%g c=%g d=%g\n",a,c,d);
++	//IssmDouble coeff[4];
++	//coeff[0]=d;
++	//coeff[1]=c;
++	//coeff[2]=0.;
++	//coeff[3]=a;
++	//int numroots;
++	//IssmDouble roots[3];
++	//cubic(coeff,roots,&numroots);
++	//tau_par=roots[0];
++	//for(i=0;i<numroots;i++) printf(" %g ",roots[i]);
++	//printf(" (%g =0?)\n",a*roots[0]*roots[0]*roots[0]+c*roots[0]+d);
++	
++
++	/*Viscosity*/
++	viscosity = 1./(2.*A)*pow(tau_par*tau_par + tau_perp*tau_perp ,-2.);
++	_assert_(!isnan(viscosity));
++
++	/*Assign output pointer*/
++	*pviscosity = viscosity;
++	return; 
++}
++/*}}}*/
+ /*FUNCTION Penta::InputUpdateFromSolutionDiagnosticHoriz {{{*/
+ void  Penta::InputUpdateFromSolutionDiagnosticHoriz(IssmDouble* solution){
+ 
+@@ -8061,6 +8265,11 @@
+ 			return;
+ 		}
+ 	}
++	if (approximation==L1L2ApproximationEnum){
++		if (!IsOnBed()) return;
++		InputUpdateFromSolutionDiagnosticL1L2(solution);
++		return;
++	}
+ 	else if (approximation==PattynApproximationEnum){
+ 		InputUpdateFromSolutionDiagnosticPattyn(solution);
+ 	}
+@@ -8343,6 +8552,87 @@
+ 	xDelete<int>(doflists);
+ }
+ /*}}}*/
++/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticL1L2 {{{*/
++void  Penta::InputUpdateFromSolutionDiagnosticL1L2(IssmDouble* solution){
++
++	const int    numdof=NDOF2*NUMVERTICES;
++
++	int     i;
++	IssmDouble  rho_ice,g;
++	IssmDouble  values[numdof];
++	IssmDouble  vx[NUMVERTICES];
++	IssmDouble  vy[NUMVERTICES];
++	IssmDouble  vz[NUMVERTICES];
++	IssmDouble  vel[NUMVERTICES];
++	IssmDouble  pressure[NUMVERTICES];
++	IssmDouble  surface[NUMVERTICES];
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	int    *doflist = NULL;
++	Penta  *penta   = NULL;
++
++	/*Get dof list: */
++	GetDofList(&doflist,L1L2ApproximationEnum,GsetEnum);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Transform solution in Cartesian Space*/
++	TransformSolutionCoord(&values[0],nodes,NUMVERTICES2D,XYEnum); /*2D: only the first 3 nodes are taken*/
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays and extrude */
++	for(i=0;i<3;i++){
++		vx[i]  =values[i*NDOF2+0];
++		vy[i]  =values[i*NDOF2+1];
++		vx[i+3]=vx[i];
++		vy[i+3]=vy[i];
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector");
++		if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector");
++	}
++
++	/*Get parameters fro pressure computation*/
++	rho_ice=matpar->GetRhoIce();
++	g=matpar->GetG();
++
++	/*Start looping over all elements above current element and update all inputs*/
++	penta=this;
++	for(;;){
++
++		/*Get node data: */
++		GetVerticesCoordinates(&xyz_list[0][0],penta->nodes,NUMVERTICES);
++
++		/*Now Compute vel*/
++		GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0
++		for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++
++		/*Now compute pressure*/
++		GetInputListOnVertices(&surface[0],SurfaceEnum);
++		for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
++
++		/*Now, we have to move the previous Vx and Vy inputs  to old 
++		 * status, otherwise, we'll wipe them off: */
++		penta->inputs->ChangeEnum(VxEnum,VxPicardEnum);
++		penta->inputs->ChangeEnum(VyEnum,VyPicardEnum);
++		penta->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
++
++		/*Add vx and vy as inputs to the tria element: */
++		penta->inputs->AddInput(new PentaP1Input(VxEnum,vx));
++		penta->inputs->AddInput(new PentaP1Input(VyEnum,vy));
++		penta->inputs->AddInput(new PentaP1Input(VelEnum,vel));
++		penta->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
++
++		/*Stop if we have reached the surface*/
++		if (penta->IsOnSurface()) break;
++
++		/* get upper Penta*/
++		penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id);
++	}
++
++	/*Free ressources:*/
++	xDelete<int>(doflist);
++}
++/*}}}*/
+ /*FUNCTION Penta::InputUpdateFromSolutionDiagnosticPattyn {{{*/
+ void  Penta::InputUpdateFromSolutionDiagnosticPattyn(IssmDouble* solution){
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 13050)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 13051)
+@@ -226,6 +226,9 @@
+ 		ElementMatrix* CreateKMatrixDiagnosticMacAyeal3dFriction(void);
+ 		ElementMatrix* CreateKMatrixDiagnosticMacAyealPattyn(void);
+ 		ElementMatrix* CreateKMatrixDiagnosticMacAyealStokes(void);
++		ElementMatrix* CreateKMatrixDiagnosticL1L2(void);
++		ElementMatrix* CreateKMatrixDiagnosticL1L2Viscous(void);
++		ElementMatrix* CreateKMatrixDiagnosticL1L2Friction(void);
+ 		ElementMatrix* CreateKMatrixDiagnosticPattyn(void);
+ 		ElementMatrix* CreateKMatrixDiagnosticPattynViscous(void);
+ 		ElementMatrix* CreateKMatrixDiagnosticPattynFriction(void);
+@@ -244,6 +247,7 @@
+ 		void           InputUpdateFromSolutionDiagnosticMacAyeal( IssmDouble* solutiong);
+ 		void           InputUpdateFromSolutionDiagnosticMacAyealPattyn( IssmDouble* solutiong);
+ 		void           InputUpdateFromSolutionDiagnosticMacAyealStokes( IssmDouble* solutiong);
++		void           InputUpdateFromSolutionDiagnosticL1L2( IssmDouble* solutiong);
+ 		void           InputUpdateFromSolutionDiagnosticPattyn( IssmDouble* solutiong);
+ 		void           InputUpdateFromSolutionDiagnosticPattynStokes( IssmDouble* solutiong);
+ 		void           InputUpdateFromSolutionDiagnosticHutter( IssmDouble* solutiong);
+@@ -264,6 +268,7 @@
+ 		ElementVector* CreatePVectorDiagnosticMacAyeal(void);
+ 		ElementVector* CreatePVectorDiagnosticMacAyealPattyn(void);
+ 		ElementVector* CreatePVectorDiagnosticMacAyealStokes(void);
++		ElementVector* CreatePVectorDiagnosticL1L2(void);
+ 		ElementVector* CreatePVectorDiagnosticPattyn(void);
+ 		ElementVector* CreatePVectorDiagnosticPattynStokes(void);
+ 		ElementVector* CreatePVectorDiagnosticStokes(void);
+@@ -272,6 +277,7 @@
+ 		ElementVector* CreatePVectorDiagnosticVert(void);
+ 		ElementVector* CreatePVectorDiagnosticVertVolume(void);
+ 		ElementVector* CreatePVectorDiagnosticVertBase(void);
++		void GetL1L2Viscosity(IssmDouble*, IssmDouble*, GaussPenta*, Input*, Input*, Input*);
+ 		#endif
+ 
+ 		#ifdef _HAVE_CONTROL_
Index: /issm/oecreview/Archive/12678-13393/ISSM-13051-13052.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13051-13052.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13051-13052.diff	(revision 13394)
@@ -0,0 +1,72 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13051)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13052)
+@@ -56,11 +56,11 @@
+ 		pattynflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(macayealflag,stokesflag))))]=1
+ 
+ 	#check that each element has at least one flag
+-	if not any(hutterflag+macayealflag+pattynflag+stokesflag):
+-		raise TypeError("setflowequation error message: elements type not assigned, must be specified")
++	if not any(hutterflag+macayealflag+l1l2flag+pattynflag+stokesflag):
++		raise TypeError("elements type not assigned, must be specified")
+ 
+ 	#check that each element has only one flag
+-	if any(hutterflag+macayealflag+pattynflag+stokesflag>1):
++	if any(hutterflag+macayealflag+l1l2flag+pattynflag+stokesflag>1):
+ 		print "setflowequation warning message: some elements have several types, higher order type is used for them"
+ 		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,macayealflag))]=0
+ 		hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,pattynflag))]=0
+@@ -68,18 +68,20 @@
+ 
+ 	#Check that no pattyn or stokes for 2d mesh
+ 	if md.mesh.dimension==2:
+-		if numpy.any(numpy.logical_or(stokesflag,pattynflag)):
+-			raise TypeError("setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first")
++		if numpy.any(numpy.logical_or(l1l2flag,stokesflag,pattynflag)):
++			raise TypeError("stokes and pattyn elements not allowed in 2d mesh, extrude it first")
+ 
+ 	#Stokes can only be used alone for now:
+ 	if any(stokesflag) and any(hutterflag):
+-		raise TypeError("setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere")
++		raise TypeError("stokes cannot be used with any other model for now, put stokes everywhere")
+ 
+ 	#Initialize node fields
+ 	nodeonhutter=numpy.zeros(md.mesh.numberofvertices)
+ 	nodeonhutter[md.mesh.elements[numpy.nonzero(hutterflag),:].astype(int)-1]=1
+ 	nodeonmacayeal=numpy.zeros(md.mesh.numberofvertices)
+ 	nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
++	nodeonl1l2=numpy.zeros(md.mesh.numberofvertices)
++	nodeonl1l2[md.mesh.elements[numpy.nonzero(l1l2flag),:].astype(int)-1]=1
+ 	nodeonpattyn=numpy.zeros(md.mesh.numberofvertices)
+ 	nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
+ 	nodeonstokes=numpy.zeros(md.mesh.numberofvertices)
+@@ -234,6 +236,7 @@
+ 	md.flowequation.element_equation[numpy.nonzero(noneflag)]=0
+ 	md.flowequation.element_equation[numpy.nonzero(hutterflag)]=1
+ 	md.flowequation.element_equation[numpy.nonzero(macayealflag)]=2
++	md.flowequation.element_equation[numpy.nonzero(l1l2flag)]=8
+ 	md.flowequation.element_equation[numpy.nonzero(pattynflag)]=3
+ 	md.flowequation.element_equation[numpy.nonzero(stokesflag)]=4
+ 	md.flowequation.element_equation[numpy.nonzero(macayealpattynflag)]=5
+@@ -251,10 +254,10 @@
+ 	md.flowequation.vertex_equation[pos]=1
+ 	pos=numpy.nonzero(nodeonmacayeal)
+ 	md.flowequation.vertex_equation[pos]=2
++	pos=numpy.nonzero(nodeonl1l2)
++	md.flowequation.vertex_equation[pos]=8
+ 	pos=numpy.nonzero(nodeonpattyn)
+ 	md.flowequation.vertex_equation[pos]=3
+-	pos=numpy.nonzero(nodeonhutter)
+-	md.flowequation.vertex_equation[pos]=1
+ 	pos=numpy.nonzero(nodeonmacayealpattyn)
+ 	md.flowequation.vertex_equation[pos]=5
+ 	pos=numpy.nonzero(nodeonstokes)
+@@ -271,6 +274,7 @@
+ 	#figure out solution types
+ 	md.flowequation.ishutter=float(any(md.flowequation.element_equation==1))
+ 	md.flowequation.ismacayealpattyn=float(numpy.any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
++	md.flowequation.isl1l2=float(any(md.flowequation.element_equation==8))
+ 	md.flowequation.isstokes=float(any(md.flowequation.element_equation==4))
+ 
+ 	return md
Index: /issm/oecreview/Archive/12678-13393/ISSM-13052-13053.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13052-13053.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13052-13053.diff	(revision 13394)
@@ -0,0 +1,11 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13052)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13053)
+@@ -490,5 +490,5 @@
+          else stage=5;
+    }
+ 	/*If we reach this point, the string provided has not been found*/
+-	_error2_("Enum " << name << " not found");
++	_error_("Enum " << name << " not found");
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-13053-13054.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13053-13054.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13053-13054.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 13053)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 13054)
+@@ -97,7 +97,7 @@
+ #footer
+ cat <<END >> $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp
+ 	/*If we reach this point, the string provided has not been found*/
+-	_error2_("Enum " << name << " not found");
++	_error_("Enum " << name << " not found");
+ }
+ END
+ #}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13054-13055.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13054-13055.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13054-13055.diff	(revision 13394)
@@ -0,0 +1,5233 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13055)
+@@ -14,21 +14,13 @@
+ 
+ 	dnl }}}
+     dnl shared build {{{
+-    AC_ARG_ENABLE([sharedlibs],                                                dnl feature
+-        AS_HELP_STRING([--enable-sharedlibs], [produce libISSM.so.0]),         dnl help string
+-        [enable_sharedlibs=$enableval],                                        dnl action if given
+-        [enable_sharedlibs=no])                                                dnl action if not given
+-    AM_CONDITIONAL([SHAREDLIBS], [test x$enable_sharedlibs = xyes])
++    AC_ARG_ENABLE([shared],                                                dnl feature
++        AS_HELP_STRING([--enable-shared], [produce libISSM.so.0]),         dnl help string
++        [enable_shared=$enableval],                                        dnl action if given
++        [enable_shared=no])                                                dnl action if not given
++    AM_CONDITIONAL([SHARED], [test $enable_shared = yes])
+     dnl }}}
+ 
+-    dnl shared build {{{
+-    AC_ARG_ENABLE([version],                                                dnl feature
+-        AS_HELP_STRING([--enable-version], [produce libISSM.so.0]),         dnl help string
+-        [enable_version=$enableval],                                        dnl action if given
+-        [enable_version=no])                                                dnl action if not given
+-    AM_CONDITIONAL([VERSION], [test x$enable_VERSION = xyes])
+-    dnl }}}
+-
+ 	dnl Modules build {{{
+ 	AC_ARG_WITH([modules],
+ 		AS_HELP_STRING([--with-modules = value],[modules compilation. ]),
+@@ -596,7 +588,7 @@
+ 				METISLIB=-L"$METIS_ROOT/lib -lmetis"
+ 				;;
+ 			esac
+-
++	
+ 			METISINCL=-I"$METIS_ROOT/include" 
+ 			AC_DEFINE([_METIS_VERSION_],[5],[ Metis version number])
+ 		fi
+@@ -613,7 +605,7 @@
+ 	dnl mpi{{{
+ 	AC_MSG_CHECKING(for mpi)
+ 	AC_ARG_WITH([mpi-lib],
+-		AS_HELP_STRING([--with-mpi-lib = options],[mpi options, for ex: "-L$MPIROOT -lmpich]),
++		AS_HELP_STRING([--with-mpi-lib = otions],[mpi options, for ex: "-L$MPIROOT -lmpich]),
+ 		[MPILIB=$withval],[MPILIB=""])
+ 	
+ 	AC_ARG_WITH([mpi-include],
+@@ -627,7 +619,7 @@
+ 			HAVE_MPI=no
+ 		else
+ 			HAVE_MPI=yes
+-			MPIINCL=-I"$MPI_INCLUDE"
++			MPIINCL=-I"$MPI_INCLUDE/"
+ 			AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
+ 			AC_DEFINE([HAVE_MPI],[1],[Mpi Flag for Dakota (DO NOT REMOVE)])
+ 			AC_SUBST([MPIINCL])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 13055)
+@@ -71,7 +71,7 @@
+ 	res=nKUoldF/nF;
+ 	if (xIsNan<IssmDouble>(res)){
+ 		_pprintLine_("norm nf = " << nF << "f and norm kuold = " << nKUoldF << "f");
+-		_error_("mechanical equilibrium convergence criterion is NaN!");
++		_error2_("mechanical equilibrium convergence criterion is NaN!");
+ 	}
+ 
+ 	//clean up
+@@ -95,7 +95,7 @@
+ 		duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
+ 		ndu=duf->Norm(NORM_TWO); nu=old_uf->Norm(NORM_TWO);
+ 
+-		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!");
++		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error2_("convergence criterion is NaN!");
+ 
+ 		//clean up
+ 		xdelete(&duf);
+@@ -120,7 +120,7 @@
+ 		//compute max(du)
+ 		duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
+ 		ndu=duf->Norm(NORM_TWO); nduinf=duf->Norm(NORM_INF);
+-		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!");
++		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error2_("convergence criterion is NaN!");
+ 
+ 		//clean up
+ 		xdelete(&duf);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 13055)
+@@ -28,74 +28,74 @@
+ 			#ifdef _HAVE_DIAGNOSTIC_
+ 			solutioncore=&diagnostic_core;
+ 			#else
+-			_error_("ISSM was not compiled with diagnostic capabilities. Exiting");
++			_error2_("ISSM was not compiled with diagnostic capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case SteadystateSolutionEnum:
+ 			#ifdef _HAVE_STEADYSTATE_
+ 			solutioncore=&steadystate_core;
+ 			#else
+-			_error_("ISSM was not compiled with steady state capabilities. Exiting");
++			_error2_("ISSM was not compiled with steady state capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case ThermalSolutionEnum:
+ 			#ifdef _HAVE_THERMAL_
+ 			solutioncore=&thermal_core;
+ 			#else
+-			_error_("ISSM was not compiled with thermal capabilities. Exiting");
++			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case EnthalpySolutionEnum:
+ 			#ifdef _HAVE_THERMAL_
+ 			solutioncore=&enthalpy_core;
+ 			#else
+-			_error_("ISSM was not compiled with thermal capabilities. Exiting");
++			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case BalancethicknessSolutionEnum:
+ 			#ifdef _HAVE_BALANCED_
+ 			solutioncore=&balancethickness_core;
+ 			#else
+-			_error_("ISSM was not compiled with balanced capabilities. Exiting");
++			_error2_("ISSM was not compiled with balanced capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case HydrologySolutionEnum:
+ 			#ifdef _HAVE_HYDROLOGY_
+ 			solutioncore=&hydrology_core;
+ 			#else
+-			_error_("ISSM was not compiled with hydrology capabilities. Exiting");
++			_error2_("ISSM was not compiled with hydrology capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case SurfaceSlopeSolutionEnum:
+ 			#ifdef _HAVE_SLOPE_
+ 			solutioncore=&surfaceslope_core;
+ 			#else
+-			_error_("ISSM was not compiled with slope capabilities. Exiting");
++			_error2_("ISSM was not compiled with slope capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case BedSlopeSolutionEnum:
+ 			#ifdef _HAVE_SLOPE_
+ 			solutioncore=&bedslope_core;
+ 			#else
+-			_error_("ISSM was not compiled with slope capabilities. Exiting");
++			_error2_("ISSM was not compiled with slope capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case TransientSolutionEnum:
+ 			#ifdef _HAVE_TRANSIENT_
+ 			solutioncore=&transient_core;
+ 			#else
+-			_error_("ISSM was not compiled with transient capabilities. Exiting");
++			_error2_("ISSM was not compiled with transient capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case PrognosticSolutionEnum:
+ 			#ifdef _HAVE_PROGNOSTIC_
+ 			solutioncore=&prognostic_core;
+ 			#else
+-			_error_("ISSM was not compiled with prognostic capabilities. Exiting");
++			_error2_("ISSM was not compiled with prognostic capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		default:
+-			_error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
++			_error2_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
+ 			break;
+ 	}
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp	(revision 13055)
+@@ -51,7 +51,7 @@
+ 			enthalpy_core(femmodel);
+ 		}
+ 		#else
+-		_error_("ISSM was not compiled with thermal capabilities. Exiting");
++		_error2_("ISSM was not compiled with thermal capabilities. Exiting");
+ 		#endif
+ 
+ 		if(VerboseSolution()) _pprintLine_("   computing new velocity");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/WriteLockFile.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/WriteLockFile.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/WriteLockFile.cpp	(revision 13055)
+@@ -16,10 +16,10 @@
+ 	/* Open lock file and write 1 into it: */
+ 	if(my_rank==0){
+ 		fid=fopen(filename,"w");
+-		if(fid==NULL) _error_("error message: could not open lock file " << filename);
++		if(fid==NULL) _error2_("error message: could not open lock file " << filename);
+ 
+ 		/*Close file: */
+-		if(fclose(fid)!=0) _error_("could not close lock file " << filename);
++		if(fclose(fid)!=0) _error2_("could not close lock file " << filename);
+ 	}
+ 
+ }	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 13055)
+@@ -16,9 +16,9 @@
+ 	char *petscfilename  = NULL;
+ 	char *lockfilename   = NULL;
+ 
+-	if(argc<2)_error_("Usage error: no solution requested");
++	if(argc<2)_error2_("Usage error: no solution requested");
+ 	*solution_type=StringToEnumx(argv[1]);
+-	if(argc<3)_error_("Usage error: missing model name");
++	if(argc<3)_error2_("Usage error: missing model name");
+ 	modelname=argv[3];
+ 	binfilename    = xNew<char>(strlen(modelname)+strlen(".bin")   +1); sprintf(binfilename,   "%s%s",modelname,".bin");
+ 	outbinfilename = xNew<char>(strlen(modelname)+strlen(".outbin")+1); sprintf(outbinfilename,"%s%s",modelname,".outbin");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 13055)
+@@ -36,8 +36,8 @@
+ 
+ 	/*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");
++	if(norm_inf<=0)    _error2_("||∂J/∂α||∞ = 0    gradient norm is zero");
++	if(xIsNan<IssmDouble>(norm_inf))_error2_("||∂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);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 13055)
+@@ -34,7 +34,7 @@
+ 			adjointcore=&adjointbalancethickness_core;
+ 			break;
+ 		default:
+-			_error_("No adjoint has been implemented for solution " << EnumToStringx(solutiontype) << " yet");
++			_error2_("No adjoint has been implemented for solution " << EnumToStringx(solutiontype) << " yet");
+ 			break;
+ 	}
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 13055)
+@@ -109,7 +109,7 @@
+ 			break;
+ 		
+ 		default:
+-			_error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
++			_error2_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
+ 			break;
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13055)
+@@ -52,7 +52,7 @@
+ 	/*Initialize environments: Petsc, MPI, etc...: */
+ 	#ifdef _HAVE_PETSC_
+ 	ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
+-	if(ierr) _error_("Could not initialize Petsc");
++	if(ierr) _error2_("Could not initialize Petsc");
+ 	#else
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Init(&argc,&argv);
+@@ -127,7 +127,7 @@
+ 		#ifdef _HAVE_DAKOTA_
+ 		Dakotax(femmodel);
+ 		#else
+-		_error_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!");
++		_error2_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!");
+ 		#endif
+ 	}
+ 	else if(control_analysis){
+@@ -137,7 +137,7 @@
+ 		else
+ 		 control_core(femmodel);
+ 		#else
+-		_error_("ISSM was not compiled with control support, cannot carry out dakota analysis!");
++		_error2_("ISSM was not compiled with control support, cannot carry out dakota analysis!");
+ 		#endif
+ 	}
+ 	else{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 13055)
+@@ -103,7 +103,7 @@
+ 				enthalpy_core(femmodel);
+ 			}
+ 			#else
+-			_error_("ISSM was not compiled with thermal capabilities. Exiting");
++			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
+ 			#endif
+ 		}
+ 		
+@@ -112,7 +112,7 @@
+ 			#ifdef _HAVE_DIAGNOSTIC_
+ 			diagnostic_core(femmodel);
+ 			#else
+-			_error_("ISSM was not compiled with diagnostic capabilities. Exiting");
++			_error2_("ISSM was not compiled with diagnostic capabilities. Exiting");
+ 			#endif
+ 		}
+ 
+@@ -128,7 +128,7 @@
+ 			#ifdef _HAVE_GROUNDINGLINE_
+ 			GroundinglineMigrationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+ 			#else
+-			_error_("ISSM was not compiled with grounding line migration capabilities. Exiting");
++			_error2_("ISSM was not compiled with grounding line migration capabilities. Exiting");
+ 			#endif
+ 		}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 13055)
+@@ -48,7 +48,7 @@
+ 		femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
+ 	}
+ 	else{
+-		_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
++		_error2_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+ 	}
+ 
+ 	/*update parameter according to scalar: */ //false means: do not save control
+@@ -65,7 +65,7 @@
+ 		solver_linear(femmodel); 
+ 	}
+ 	else{
+-		_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
++		_error2_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+ 	}
+ 
+ 	/*Compute misfit for this velocity field.*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13055)
+@@ -39,7 +39,7 @@
+ 	/*Initialize environments: Petsc, MPI, etc...: */
+ #ifdef _HAVE_PETSC_
+ 	int ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
+-	if(ierr) _error_("Could not initialize Petsc");
++	if(ierr) _error2_("Could not initialize Petsc");
+ #else
+ #ifdef _HAVE_MPI_
+ 	MPI_Init(&argc,&argv);
+@@ -121,7 +121,7 @@
+ 	char *outbinfilename = NULL;
+ 	char *lockfilename   = NULL;
+ 
+-	if(argc<2)_error_("Usage error: missing model name");
++	if(argc<2)_error2_("Usage error: missing model name");
+ 	modelname=argv[2];
+ 	binfilename    = xNew<char>((strlen(modelname)+strlen(".bin")   +1)); sprintf(binfilename,   "%s%s",modelname,".bin");
+ 	outbinfilename = xNew<char>((strlen(modelname)+strlen(".outbin")+1)); sprintf(outbinfilename,"%s%s",modelname,".outbin");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13055)
+@@ -41,7 +41,7 @@
+ 	int argc; char **args=NULL;
+ 	PetscGetArgs(&argc,&args);
+ 	ierr = TaoInitialize(&argc,&args,(char*)0,"");
+-	if(ierr) _error_("Could not initialize Tao");
++	if(ierr) _error2_("Could not initialize Tao");
+ 
+ 	/*Recover some parameters*/
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+@@ -74,7 +74,7 @@
+ 	xdelete(&XL);
+ 	xdelete(&XU);
+ 
+-	user.J=xNewZeroInit<double>(maxiter+5);
++	user.J=(double*)xcalloc((maxiter+5),sizeof(double));
+ 	user.femmodel=femmodel;
+ 	TaoSetObjectiveAndGradientRoutine(tao,FormFunctionGradient,(void*)&user); 
+ 
+@@ -184,6 +184,6 @@
+ 
+ #else
+ void controltao_core(FemModel* femmodel){
+-	_error_("TAO not installed or PETSc version not supported");
++	_error2_("TAO not installed or PETSc version not supported");
+ }
+ #endif //_HAVE_TAO_ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 13055)
+@@ -106,8 +106,6 @@
+ ENUM=0;
+ #Add header to pythonenum file{{{
+ cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.py
+-from StringToEnum import StringToEnum
+-
+ """
+ 
+    WARNING: DO NOT MODIFY THIS FILE
+@@ -167,7 +165,7 @@
+ 	      macro=$NAMEENUM()
+ 	"""
+ 
+-	return StringToEnum('$NAME')[0]
++	return StringToEnum('$NAME')
+ 
+ END
+ #}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 13055)
+@@ -26,7 +26,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"double")){
+-		_error_("Value of option \"" << odouble->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error2_("Value of option \"" << odouble->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	FetchData(&odouble->values,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]);
+ 
+@@ -44,7 +44,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"logical")){
+-		_error_("Value of option \"" << ological->name  << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error2_("Value of option \"" << ological->name  << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	FetchData(&ological->values,&ological->numel,&ological->ndims,&ological->size,prhs[0]);
+ 
+@@ -62,7 +62,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"char")){
+-		_error_("Value of option \"" << ochar->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error2_("Value of option \"" << ochar->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	FetchData(&ochar->values,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]);
+ 
+@@ -86,7 +86,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"struct")){
+-		_error_("Value of option \"" << ostruct->name  << "\" must be class \"struct\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error2_("Value of option \"" << ostruct->name  << "\" must be class \"struct\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	ostruct->numel=mxGetNumberOfElements(prhs[0]);
+ 	ostruct->ndims=mxGetNumberOfDimensions(prhs[0]);
+@@ -132,7 +132,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"cell")){
+-		_error_("Value of option \"" << ocell->name  << "\" must be class \"cell\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error2_("Value of option \"" << ocell->name  << "\" must be class \"cell\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 
+ 	ocell->numel=mxGetNumberOfElements(prhs[0]);
+@@ -180,7 +180,7 @@
+ 			option=(Option*)OptionStructParse(name,(const mxArray**)lhs);
+ 			mxDestroyArray(lhs[0]);
+ 		}
+-		else _error_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\".");
++		else _error2_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 
+ 	return(option);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp	(revision 13055)
+@@ -21,11 +21,11 @@
+ 		if (NRHS==0 && NLHS==0)return 1;
+ 		/* special case: */
+ 		function();
+-		_error_("usage: see above");
++		_error2_("usage: see above");
+ 	}
+ 	else if (nlhs!=NLHS || nrhs!=NRHS ) {
+ 		function(); 
+-		_error_("usage error.");
++		_error2_("usage error.");
+ 	}
+ 	return 1;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13055)
+@@ -47,7 +47,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -88,7 +88,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -133,7 +133,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -175,7 +175,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -237,7 +237,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -268,7 +268,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -300,7 +300,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -332,7 +332,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -364,7 +364,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -380,7 +380,7 @@
+ 
+ 	/*Ok, the string should be coming directly from the matlab workspace: */
+ 	if (!mxIsClass(dataref,"char")){
+-		_error_("input data_type is not a string!");
++		_error2_("input data_type is not a string!");
+ 	}
+ 	else{
+ 		/*Recover the string:*/
+@@ -415,7 +415,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -433,7 +433,7 @@
+ 	double scalar;
+ 
+ 	if (!mxIsClass(dataref,"double")){
+-		_error_("input data_type is not a double!");
++		_error2_("input data_type is not a double!");
+ 	}
+ 	else{
+ 		/*Recover the double: */
+@@ -450,7 +450,7 @@
+ 	int integer;
+ 
+ 	if (!mxIsClass(dataref,"double")){
+-		_error_("input data_type is not a scalar!");
++		_error2_("input data_type is not a scalar!");
+ 	}
+ 	else{
+ 		/*Recover the double: */
+@@ -467,12 +467,12 @@
+ 	bool* mxbool_ptr=NULL;
+ 
+ 	if (mxIsClass(dataref,"logical")){
+-		if(mxGetM(dataref)!=1) _error_("input data is not of size 1x1");
+-		if(mxGetN(dataref)!=1) _error_("input data is not of size 1x1");
++		if(mxGetM(dataref)!=1) _error2_("input data is not of size 1x1");
++		if(mxGetN(dataref)!=1) _error2_("input data is not of size 1x1");
+ 		mxbool_ptr=mxGetLogicals(dataref);
+ 	}
+ 	else{
+-		_error_("input data_type is not a bool!");
++		_error2_("input data_type is not a bool!");
+ 	}
+ 
+ 	*pboolean=*mxbool_ptr;
+@@ -494,7 +494,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -518,7 +518,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -619,10 +619,10 @@
+ 
+ 	/*Fetch all options*/
+ 	for (int i=istart; i<nrhs; i=i+2){
+-		if (!mxIsClass(pdataref[i],"char")) _error_("Argument " << i+1 << " must be name of option");
++		if (!mxIsClass(pdataref[i],"char")) _error2_("Argument " << i+1 << " must be name of option");
+ 
+ 		FetchData(&name,pdataref[i]);
+-		if(i+1 == nrhs) _error_("Argument " << i+2 << " must exist and be value of option \"" << name << "\".");
++		if(i+1 == nrhs) _error2_("Argument " << i+2 << " must exist and be value of option \"" << name << "\".");
+ 
+ 		option=(Option*)OptionParse(name,&pdataref[i+1]);
+ 		options->AddOption(option);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp	(revision 13055)
+@@ -45,7 +45,7 @@
+ 		nnz=mxGetNzmax(mxvector);
+ 		
+ 		/*Check that input is actualy a vector*/
+-		if (cols!=1) _error_("input vector of size " << rows << "x" << cols << " should have only one column");
++		if (cols!=1) _error2_("input vector of size " << rows << "x" << cols << " should have only one column");
+ 
+ 		nz=(int)((double)nnz/(double)rows);
+ 
+@@ -76,7 +76,7 @@
+ 		cols=mxGetN(mxvector);
+ 
+ 		/*Check that input is actualy a vector*/
+-		if (cols!=1) _error_("input vector of size " << rows << "x" << cols << " should have only one column");
++		if (cols!=1) _error2_("input vector of size " << rows << "x" << cols << " should have only one column");
+ 
+ 		/*allocate and memcpy*/
+ 		if(rows){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp	(revision 13055)
+@@ -118,7 +118,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("Matlab matrix type Not implemented yet");
++		_error2_("Matlab matrix type Not implemented yet");
+ 	}
+ 
+ 	/*Assign output pointer: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13055)
+@@ -27,7 +27,6 @@
+ //void WriteData(PyObject* py_tuple,double scalar);
+ //void WriteData(DataHandle* py_tuple,Parameters* parameters);
+ void WriteData(PyObject* py_tuple, int index, double* matrix, int M,int N);
+-void WriteData(PyObject* py_tuple, int index, int integer);
+ void WriteData(PyObject* py_tuple, int index, char* string);
+ void WriteData(PyObject* py_tuple, int index, Matrix* matrix);
+ void WriteData(PyObject* py_tuple, int index, Vector* vector);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp	(revision 13055)
+@@ -26,11 +26,11 @@
+ 	/*check on requested size: */
+ 	if (size==0){
+ 		function();
+-		_error_("usage: see above");
++		_error2_("usage: see above");
+ 	}
+ 	else if (size!=NRHS ) {
+ 		function(); 
+-		_error_("usage error.");
++		_error2_("usage error.");
+ 	}
+ 	return 1;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13055)
+@@ -47,7 +47,7 @@
+ 	bool boolean;
+ 	
+ 	/*check this is indeed a subtype of long type: */
+-	if(!PyBool_Check(py_boolean))_error_("expecting a boolean in input!");
++	if(!PyBool_Check(py_boolean))_error2_("expecting a boolean in input!");
+ 
+ 	/*extract boolean: */
+ 	boolean=(bool)PyLong_AsLong(py_boolean);
+@@ -68,7 +68,7 @@
+ 
+ 	/*retrive dimensions: */
+ 	ndim=PyArray_NDIM((const PyArrayObject*)py_matrix);
+-	if(ndim!=2)_error_("expecting an MxN matrix in input!");
++	if(ndim!=2)_error2_("expecting an MxN matrix in input!");
+ 	dims=PyArray_DIMS((PyArrayObject*)py_matrix);
+ 	M=dims[0]; N=dims[1];
+ 	
+@@ -96,7 +96,7 @@
+ 
+ 	/*retrive dimensions: */
+ 	ndim=PyArray_NDIM((const PyArrayObject*)py_matrix);
+-	if(ndim!=2)_error_("expecting an MxN matrix in input!");
++	if(ndim!=2)_error2_("expecting an MxN matrix in input!");
+ 	dims=PyArray_DIMS((PyArrayObject*)py_matrix);
+ 	M=dims[0]; N=dims[1];
+ 	
+@@ -124,7 +124,7 @@
+ 
+ 	/*retrive dimensions: */
+ 	ndim=PyArray_NDIM((const PyArrayObject*)py_vector);
+-	if(ndim!=1)_error_("expecting an Mx1 vector in input!");
++	if(ndim!=1)_error2_("expecting an Mx1 vector in input!");
+ 	dims=PyArray_DIMS((PyArrayObject*)py_vector);
+ 	M=dims[0]; 
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13055)
+@@ -20,12 +20,6 @@
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+ 
+-/*FUNCTION WriteData(PyObject* py_tuple,int index,int integer){{{*/
+-void WriteData(PyObject* py_tuple, int index, int integer){
+-	
+-	PyTuple_SetItem(py_tuple, index, PyInt_FromSsize_t(integer));
+-
+-}/*}}}*/
+ /*FUNCTION WriteData(PyObject* py_tuple,int index,char* string){{{*/
+ void WriteData(PyObject* py_tuple, int index, char* string){
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp	(revision 13055)
+@@ -64,7 +64,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{*/
+@@ -81,7 +81,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(IssmDouble* pscalar, int enum_type){{{*/
+@@ -98,7 +98,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(IssmDouble* pscalar, int enum_type,IssmDouble time){{{*/
+@@ -115,7 +115,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{*/
+@@ -132,7 +132,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -150,7 +150,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -168,7 +168,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -186,7 +186,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -204,7 +204,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -222,7 +222,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -240,7 +240,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(Vector** pvec,int enum_type){{{*/
+@@ -257,7 +257,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -275,7 +275,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -293,7 +293,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error2_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13055)
+@@ -202,7 +202,7 @@
+ 
+ 		/*see what the first element of this partition has in stock (this is common to all partitions)*/
+ 		if(my_rank==minrank){
+-			if(this->Size()==0) _error_("Cannot write results because there is no element??");
++			if(this->Size()==0) _error2_("Cannot write results because there is no element??");
+ 			Element* element=(Element*)this->GetObjectByOffset(0);
+ 			element->ListResultsInfo(&resultsenums,&resultssizes,&resultstimes,&resultssteps,&numberofresults);
+ 		}
+@@ -231,7 +231,7 @@
+ 			/*Get vector for result number i*/
+ 			if(resultssizes[i]==P1Enum)      vectorsize=numberofvertices;
+ 			else if(resultssizes[i]==P0Enum) vectorsize=numberofelements;
+-			else _error_("Unkown result size: " << EnumToStringx(resultssizes[i]));
++			else _error2_("Unkown result size: " << EnumToStringx(resultssizes[i]));
+ 			vector=new Vector(vectorsize);
+ 
+ 			for(int j=0;j<this->Size();j++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13055)
+@@ -57,12 +57,12 @@
+ 	options->Get(&mintrimming,"mintrimming",-1.e+21);
+ 	options->Get(&maxtrimming,"maxtrimming",+1.e+21);
+ 	options->Get(&minspacing,"minspacing",0.01);
+-	if(minspacing<=0) _error_("minspacing must > 0");
++	if(minspacing<=0) _error2_("minspacing must > 0");
+ 
+ 	/*Get Minimum box size*/
+ 	if(options->GetOption("boxlength")){
+ 		options->Get(&minlength,"boxlength");
+-		if(minlength<=0)_error_("boxlength should be a positive number");
++		if(minlength<=0)_error2_("boxlength should be a positive number");
+ 		maxdepth=int(log(max(xmax-xmin,ymax-ymin)/minlength +1)/log(2.0));
+ 	}
+ 	else{
+@@ -382,7 +382,7 @@
+ 	SolverxSeq(&Ginv1, Gamma,ones,n_obs);   // Gamma^-1 ones
+ 	SolverxSeq(&GinvZ, Gamma,obs,n_obs);    // Gamma^-1 Z
+ #else
+-	_error_("GSL is required");
++	_error2_("GSL is required");
+ #endif
+ 
+ 	/*Prepare predictor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Inputs.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Inputs.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Inputs.cpp	(revision 13055)
+@@ -56,7 +56,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -84,7 +84,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -112,7 +112,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -140,7 +140,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -212,7 +212,7 @@
+ 	constrain_input=(Input*)this->GetInput(constrain_enum);
+ 
+ 	/*some checks: */
+-	if(!constrain_input) _error_("input " << EnumToStringx(constrain_enum) << " could not be found!");
++	if(!constrain_input) _error2_("input " << EnumToStringx(constrain_enum) << " could not be found!");
+ 
+ 	/*Apply ContrainMin: */
+ 	constrain_input->ConstrainMin(minimum);
+@@ -253,7 +253,7 @@
+ 		max=input->Max();
+ 	}
+ 	else{
+-		_error_("Input " << EnumToStringx(enumtype) << " not found");
++		_error2_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -274,7 +274,7 @@
+ 		max=input->MaxAbs();
+ 	}
+ 	else{
+-		_error_("Input " << EnumToStringx(enumtype) << " not found");
++		_error2_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -295,7 +295,7 @@
+ 		min=input->Min();
+ 	}
+ 	else{
+-		_error_("Input " << EnumToStringx(enumtype) << " not found");
++		_error2_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -316,7 +316,7 @@
+ 		min=input->MinAbs();
+ 	}
+ 	else{
+-		_error_("Input " << EnumToStringx(enumtype) << " not found");
++		_error2_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -368,7 +368,7 @@
+ 
+ 	/*Make a copy of the original input: */
+ 	original=(Input*)this->GetInput(original_enum);
+-	if(!original)_error_("could not find input with enum: " << EnumToStringx(original_enum)); 
++	if(!original)_error2_("could not find input with enum: " << EnumToStringx(original_enum)); 
+ 	copy=(Input*)original->copy();
+ 
+ 	/*Change copy enum to reinitialized_enum: */
+@@ -415,8 +415,8 @@
+ 	yinput=(Input*)this->GetInput(MeshYEnum);
+ 
+ 	/*some checks: */
+-	if(!xinput) _error_("input " << EnumToStringx(MeshXEnum) << " could not be found!");
+-	if(!yinput) _error_("input " << EnumToStringx(MeshYEnum) << " could not be found!");
++	if(!xinput) _error2_("input " << EnumToStringx(MeshXEnum) << " could not be found!");
++	if(!yinput) _error2_("input " << EnumToStringx(MeshYEnum) << " could not be found!");
+ 
+ 	/*Apply AXPY: */
+ 	yinput->AXPY(xinput,scalar);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp	(revision 13055)
+@@ -132,7 +132,7 @@
+ 
+ 	vector<Object*>::iterator object;
+ 
+-	if(this==NULL)_error_("trying to echo a NULL dataset");
++	if(this==NULL)_error2_("trying to echo a NULL dataset");
+ 
+ 	_pprintLine_("DataSet echo: " << objects.size() << " objects");
+ 
+@@ -149,7 +149,7 @@
+ 
+ 	vector<Object*>::iterator object;
+ 
+-	if(this==NULL)_error_("trying to echo a NULL dataset");
++	if(this==NULL)_error2_("trying to echo a NULL dataset");
+ 
+ 	_pprintLine_("DataSet echo: " << objects.size() << " objects");
+ 
+@@ -193,11 +193,11 @@
+ 	int i;
+ 
+ 	_assert_(this);
+-	if(!sorted)_error_("trying to binary search on a non-sorted dataset!");
++	if(!sorted)_error2_("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())){
+-		_error_("could not find object with id " << eid << " in DataSet " << EnumToStringx(enum_type));
++		_error2_("could not find object with id " << eid << " in DataSet " << EnumToStringx(enum_type));
+ 	}
+ 
+ 	/*Convert  the id offset into sorted offset: */
+@@ -258,7 +258,7 @@
+ 
+ 	/*Only sort if we are not already sorted: */
+ 	if(!sorted){
+-		_error_("not implemented yet!");
++		_error2_("not implemented yet!");
+ 	}
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp	(revision 13055)
+@@ -46,17 +46,17 @@
+ 	_assert_(in_option);
+ 
+ 	/*Also, check the option name*/
+-	if(!in_option->name) _error_("input option has an empty name");
+-	if(strchr(in_option->name,'.')) _error_("Option \"" << in_option->name << "\" has a protected character \".\"");
+-	if(strchr(in_option->name,'[')) _error_("Option \"" << in_option->name << "\" has a protected character \"[\"");
+-	if(strchr(in_option->name,']')) _error_("Option \"" << in_option->name << "\" has a protected character \"]\"");
++	if(!in_option->name) _error2_("input option has an empty name");
++	if(strchr(in_option->name,'.')) _error2_("Option \"" << in_option->name << "\" has a protected character \".\"");
++	if(strchr(in_option->name,'[')) _error2_("Option \"" << in_option->name << "\" has a protected character \"[\"");
++	if(strchr(in_option->name,']')) _error2_("Option \"" << in_option->name << "\" has a protected character \"]\"");
+ 
+ 	/*Finally, check that no option of the same name already exists in the dataset*/
+ 	for(object=objects.begin();object<objects.end();object++){
+ 
+ 		option=(Option*)(*object); 
+ 		if (!strcmp(option->name,in_option->name)){
+-			_error_("Options \"" << in_option->name << "\" found multiple times");
++			_error2_("Options \"" << in_option->name << "\" found multiple times");
+ 			break;
+ 		}
+ 	}
+@@ -82,7 +82,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -120,7 +120,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -158,7 +158,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -198,7 +198,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ 
+ }
+@@ -263,7 +263,7 @@
+ 		}
+ 		/*Else: not supported*/
+ 		else{
+-			_error_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
++			_error2_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
+ 		}
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+@@ -289,7 +289,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -323,7 +323,7 @@
+ 				}
+ 				/*Else: not supported*/
+ 				else{
+-					_error_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
++					_error2_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
+ 				}
+ 			}
+ 		}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h	(revision 13055)
+@@ -22,15 +22,25 @@
+ /*Printing macro: only cpu number 0 */
+ #define _printf_(flag,...) do{if(flag) PrintfFunction(__VA_ARGS__);}while(0)
+ /*}}}*/
++/* _error_ {{{*/
++/*Error exception macro*/
++#ifdef _INTEL_WIN_
++#define _error_(...)\
++  throw ErrorException(exprintf(__VA_ARGS__))
++#else
++#define _error_(...)\
++  throw ErrorException(__FILE__,__func__,__LINE__,exprintf(__VA_ARGS__))
++#endif
++/*}}}*/
+ /* _error2_ {{{*/
+ /*new Error exception macro*/
+ #ifdef _INTEL_WIN_
+-#define _error_(StreamArgs)\
++#define _error2_(StreamArgs)\
+    do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+    aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
+    throw ErrorException(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+ #else
+-#define _error_(StreamArgs)\
++#define _error2_(StreamArgs)\
+ 	do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+    aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
+    throw ErrorException(__FILE__,__func__,__LINE__,aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+@@ -64,7 +74,7 @@
+ /*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/
+ #ifdef _ISSM_DEBUG_ 
+ #define _assert_(statement)\
+-  if (!(statement)) _error_("Assertion \""<<#statement<<"\" failed, please report bug to "<<PACKAGE_BUGREPORT)
++  if (!(statement)) _error_("Assertion \"%s\" failed, please report bug to %s",#statement,PACKAGE_BUGREPORT)
+ #else
+ #define _assert_(ignore)\
+   ((void) 0)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 13055)
+@@ -35,26 +35,26 @@
+ 
+ 	if (!itrnb) {
+ 		if (nrowb != idimb) {
+-			_error_("Matrix A and B inner vectors not equal size.");
++			_error2_("Matrix A and B inner vectors not equal size.");
+ 		}
+ 		idimc=ncolb;
+ 	}
+ 	else {
+ 		if (ncolb != idimb) {
+-			_error_("Matrix A and B inner vectors not equal size.");
++			_error2_("Matrix A and B inner vectors not equal size.");
+ 		}
+ 		idimc=nrowb;
+ 	}
+ 
+ 	if (!itrnc) {
+ 		if (nrowc != idimc) {
+-			_error_("Matrix B and C inner vectors not equal size.");
++			_error2_("Matrix B and C inner vectors not equal size.");
+ 		}
+ 		idimd=ncolc;
+ 	}
+ 	else {
+ 		if (ncolc != idimc) {
+-			_error_("Matrix B and C inner vectors not equal size.");
++			_error2_("Matrix B and C inner vectors not equal size.");
+ 		}
+ 		idimd=nrowc;
+ 	}
+@@ -123,7 +123,7 @@
+ 	}
+ 
+ 	if (ntrma != ntrmb) {
+-		_error_("Matrix A and B inner vectors not equal size");
++		_error2_("Matrix A and B inner vectors not equal size");
+ 	    noerr=0;	
+ 		return noerr;
+ 	}
+@@ -174,7 +174,7 @@
+ 	IssmDouble pivot,det,dtemp;
+ 
+ 	if (!b && nvec) {
+-		_error_("No right-hand side for nvec=" << nvec << ".");
++		_error2_("No right-hand side for nvec=" << nvec << ".");
+ 		noerr=0;
+ 		return noerr;
+ 	}
+@@ -213,7 +213,7 @@
+ 			xDelete<int>(pivrc1);
+ 			xDelete<int>(pivrc2);
+ 			xDelete<int>(pindx);
+-			_error_("Pivot " << pivot << " less than machine epsilon");
++			_error2_("Pivot " << pivot << " less than machine epsilon");
+ 			noerr=0;
+ 			return noerr;
+ 		}
+@@ -348,7 +348,7 @@
+ 
+ 	/*Compute determinant*/
+ 	Matrix2x2Determinant(&det,A);
+-	if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller that machine epsilon");
++	if (fabs(det) < DBL_EPSILON) _error2_("Determinant smaller that machine epsilon");
+ 
+ 	/*Compute invert*/
+ 	Ainv[0]=   A[3]/det; /* =  d/det */
+@@ -373,7 +373,7 @@
+ 
+ 	/*Compute determinant*/
+ 	Matrix3x3Determinant(&det,A);
+-	if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller that machine epsilon");
++	if (fabs(det) < DBL_EPSILON) _error2_("Determinant smaller that machine epsilon");
+ 
+ 	/*Compute invert*/
+ 	Ainv[0]=(A[4]*A[8]-A[5]*A[7])/det; /* = (e*i-f*h)/det */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 13055)
+@@ -43,14 +43,14 @@
+ 	/*initialize counter and get response at the boundaries*/
+ 	iter=0;
+ 	fxmin = (*f)(xmin,optargs);
+-	if (xIsNan<IssmDouble>(fxmin)) _error_("Function evaluation returned NaN");
++	if (xIsNan<IssmDouble>(fxmin)) _error2_("Function evaluation returned NaN");
+ 	cout<<setprecision(5);
+ 	if(VerboseControl()) _pprintLine_("");
+ 	if(VerboseControl()) _pprintLine_("       Iteration         x           f(x)       Tolerance         Procedure");
+ 	if(VerboseControl()) _pprintLine_("");
+ 	if(VerboseControl()) _pprintLine_("           N/A    "<<setw(12)<<xmin<<"  "<<setw(12)<<fxmin<<"           N/A         boundary");
+ 	fxmax = (*f)(xmax,optargs);
+-	if (xIsNan<IssmDouble>(fxmax)) _error_("Function evaluation returned NaN");
++	if (xIsNan<IssmDouble>(fxmax)) _error2_("Function evaluation returned NaN");
+ 	if(VerboseControl()) _pprintLine_("           N/A    "<<setw(12)<<xmax<<"  "<<setw(12)<<fxmax<<"           N/A         boundary");
+ 
+ 	/*test if jump option activated and xmin==0*/
+@@ -74,7 +74,7 @@
+ 
+ 	/*2: call the function to be evaluated*/
+ 	fxbest = (*f)(x,optargs);
+-	if(xIsNan<IssmDouble>(fxbest)) _error_("Function evaluation returned NaN");
++	if(xIsNan<IssmDouble>(fxbest)) _error2_("Function evaluation returned NaN");
+ 	iter=iter+1;
+ 
+ 	/*3: update the other variables*/
+@@ -158,7 +158,7 @@
+ 
+ 		//evaluate function on x
+ 		fx = (*f)(x,optargs);
+-		if(xIsNan<IssmDouble>(fx)) _error_("Function evaluation returned NaN");
++		if(xIsNan<IssmDouble>(fx)) _error2_("Function evaluation returned NaN");
+ 		iter=iter+1;
+ 
+ 		// Update a, b, xm, x1, x2, tol1, tol2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 13055)
+@@ -1669,7 +1669,7 @@
+ 		} while (iter < MAX_GAUS_ITER);
+ 		if (iter >= MAX_GAUS_ITER) {
+ 			xDelete<IssmPDouble>(work);
+-			_error_("Max iterations exceeded for l=" << MAX_GAUS_ITER);
++			_error2_("Max iterations exceeded for l=" << MAX_GAUS_ITER);
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp	(revision 13055)
+@@ -56,7 +56,7 @@
+ 	}
+ 	if (found==-1){
+ 		/*ok, we did not find anything, this is not good! error out: */
+-		_error_("could find neither a default analysis  nor analysis " << EnumToStringx(analysis_type));
++		_error2_("could find neither a default analysis  nor analysis " << EnumToStringx(analysis_type));
+ 	}
+ 
+ 	/*ok, grab the option string: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 13055)
+@@ -28,7 +28,7 @@
+ 	/*Now, which direction are we going? once determined, use scale factor: */
+ 	if(direction_enum==IuToExtEnum) for(i=0;i<numvalues;i++)values[i]=values[i]*scale; 
+ 	else if(direction_enum==ExtToIuEnum) for(i=0;i<numvalues;i++)values[i]=values[i]/scale; 
+-	else _error_("wrong direction for unit conversion, either IuToExtEnum or ExtToIuEnum. ");
++	else _error2_("wrong direction for unit conversion, either IuToExtEnum or ExtToIuEnum. ");
+ 
+ }
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp	(revision 13055)
+@@ -33,7 +33,7 @@
+ /*FUNCTION SetVerbosityLevel {{{*/
+ void SetVerbosityLevel(int level){
+ 
+-	if(level<0) _error_("vebosity level should be a positive integer (user provided " << level << ")");
++	if(level<0) _error2_("vebosity level should be a positive integer (user provided " << level << ")");
+ 
+ 	verbositylevel = level;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp	(revision 13055)
+@@ -52,7 +52,7 @@
+ 		if(reCast<bool>(nu))eps=ndu/nu;
+ 		else eps=0;
+ 	}
+-	else _error_("convergence criterion " << EnumToStringx(criterion_enum) << " not supported yet!");
++	else _error2_("convergence criterion " << EnumToStringx(criterion_enum) << " not supported yet!");
+ 
+ 	/*Assign output pointers:*/
+ 	*peps=eps;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 13055)
+@@ -40,7 +40,7 @@
+ 	
+ 	//get the value of the function at the first boundary
+ 	fx1= (*f)(x1,optargs);
+-	if (xIsNan<IssmDouble>(fx1)) _error_("Function evaluation returned NaN");
++	if (xIsNan<IssmDouble>(fx1)) _error2_("Function evaluation returned NaN");
+ 	cout<<setprecision(5);
+ 	if(VerboseControl()) _pprintLine_("");
+ 	if(VerboseControl()) _pprintLine_("       Iteration         x           f(x)       Tolerance");
+@@ -56,7 +56,7 @@
+ 		/*get f(x2)*/
+ 		iter++;
+ 		fx2 = (*f)(x2,optargs);
+-		if (xIsNan<IssmDouble>(fx2)) _error_("Function evaluation returned NaN");
++		if (xIsNan<IssmDouble>(fx2)) _error2_("Function evaluation returned NaN");
+ 		if(VerboseControl())
+ 		 _pprintLine_("         "<<setw(5)<<iter<<"    "<<setw(12)<<x2<<"  "<<setw(12)<<fx2<<"  "<<(fabs(x2-x1)>fabs(fx2-fx1)?fabs(fx2-fx1):fabs(x2-x1)));
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/String/DescriptorIndex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/String/DescriptorIndex.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/String/DescriptorIndex.cpp	(revision 13055)
+@@ -22,12 +22,12 @@
+ 
+ 	/*retrieve first token, separated by underscore: */
+ 	pch = strtok (descriptor,"_");
+-	if(!pch)_error_("descriptor " << descriptor << " is not correctly formatted!");
++	if(!pch)_error2_("descriptor " << descriptor << " is not correctly formatted!");
+ 
+ 	if (strncmp(pch,"scaled",6)==0){
+ 		/*we have a scaled variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error_("scaled descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error2_("scaled descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 
+ 		/*now recover  the index if it exists: */
+@@ -43,22 +43,22 @@
+ 	else if (strncmp(pch,"indexed",7)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return IndexedEnum;
+ 	}
+ 	else if (strncmp(pch,"nodal",5)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return NodalEnum;
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13055)
+@@ -30,11 +30,11 @@
+ 
+ 	void* memptr=NULL;
+ 
+-	if(!size)_error_("attempting to 0 size allocation!");
++	if(!size)_error2_("attempting to 0 size allocation!");
+ 
+ 	/* Use the c library to do the allocation: */
+ 	memptr=malloc(size);
+-	if(!memptr) _error_("memory allocation failed!");
++	if(!memptr) _error2_("memory allocation failed!");
+ 
+ 	return memptr;
+ }
+@@ -43,11 +43,11 @@
+ 
+ 	void* memptr=NULL;
+ 	
+-	if(!size)_error_("attempting to 0 size allocation!");
++	if(!size)_error2_("attempting to 0 size allocation!");
+ 
+ 	/* Use the c library to do the allocation: */
+ 	memptr=calloc(n,size);
+-	if(!memptr) _error_("memory allocation failed!");
++	if(!memptr) _error2_("memory allocation failed!");
+ 
+ 	return memptr;
+ }
+@@ -87,11 +87,11 @@
+ 	
+ 	register void* value=NULL;
+ 	
+-	if(!size)_error_("attempting to realloc to zero");
++	if(!size)_error2_("attempting to realloc to zero");
+ 	value = (void*)realloc(pv,size);
+ 
+ 	if (value == NULL) {
+-		_error_("virtual memory exhausted");
++		_error2_("virtual memory exhausted");
+ 	}
+ 	return value;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Threads/LaunchThread.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Threads/LaunchThread.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Threads/LaunchThread.cpp	(revision 13055)
+@@ -43,12 +43,12 @@
+ 	for(i=0;i<num_threads;i++){
+ 
+ 		if(pthread_create(threads+i,NULL,function,(void*)(handles+i))){
+-			_error_("pthread_create error");
++			_error2_("pthread_create error");
+ 		}
+ 	}
+ 	for(i=0;i<num_threads;i++){
+ 		if(pthread_join(threads[i],(void**)&status)){
+-			_error_("pthread_join error");
++			_error2_("pthread_join error");
+ 		}
+ 	}
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp	(revision 13055)
+@@ -30,7 +30,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp	(revision 13055)
+@@ -29,7 +29,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp	(revision 13055)
+@@ -21,7 +21,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+@@ -66,7 +66,7 @@
+ 				counter+=4;
+ 				break;
+ 			default:
+-				_error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++				_error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp	(revision 13055)
+@@ -30,7 +30,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp	(revision 13055)
+@@ -30,7 +30,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 13055)
+@@ -22,7 +22,7 @@
+ 
+ 	/*open domain outline file for writing: */
+ 	if ((fid=fopen(domainname,"w"))==NULL){
+-		_error_("could not open domain file " << domainname); 
++		_error2_("could not open domain file " << domainname); 
+ 		noerr=0; goto cleanupandreturn;
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 13055)
+@@ -38,7 +38,7 @@
+ 
+ 	/*open domain outline file for reading: */
+ 	if ((fid=fopen(domainname,"r"))==NULL){
+-		_error_("could not find domain file " << domainname); 
++		_error2_("could not find domain file " << domainname); 
+ 	}
+ 
+ 	/*Do a first pass through the domainname file, to figure out how many profiles 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfopen.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfopen.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfopen.cpp	(revision 13055)
+@@ -19,7 +19,7 @@
+ 	
+ 	/*Open handle to data on disk: */
+ 	fid=fopen(filename,format);
+-	if(fid==NULL) _error_("could not open file " << filename << " for binary reading or writing"); 
++	if(fid==NULL) _error2_("could not open file " << filename << " for binary reading or writing"); 
+ 
+ 	return fid;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfclose.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfclose.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfclose.cpp	(revision 13055)
+@@ -17,5 +17,5 @@
+ 	/*Close file handle: */
+ 	extern int my_rank;
+ 	_assert_(fid);
+-	if(fclose(fid)!=0)_error_("could not close file " << filename);
++	if(fclose(fid)!=0)_error2_("could not close file " << filename);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13055)
+@@ -39,7 +39,7 @@
+ 
+ 	/*some checks*/
+ 	if (nels_data<1 || nods_data<3 || nods_prime==0){
+-		_error_("nothing to be done according to the mesh given in input");
++		_error2_("nothing to be done according to the mesh given in input");
+ 	}
+ 
+ 	/*Set debug to 1 if there are lots of elements*/
+@@ -53,11 +53,11 @@
+ 		interpolation_type=2;
+ 	}
+ 	else{
+-		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
++		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+ 	}
+ 
+ 	if((numcontours) && (interpolation_type==2)){
+-		_error_("element interpolation_type with contours not supported yet!");
++		_error2_("element interpolation_type with contours not supported yet!");
+ 	}
+ 
+ 	/*Get prime mesh extrema coordinates*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13055)
+@@ -490,5 +490,5 @@
+          else stage=5;
+    }
+ 	/*If we reach this point, the string provided has not been found*/
+-	_error_("Enum " << name << " not found");
++	_error2_("Enum " << name << " not found");
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 13055)
+@@ -48,9 +48,9 @@
+ 		case MaterialsRheologyBbarEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,MaterialsRheologyBbarEnum,process_units); break;
+ 		case VelEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,VelEnum,process_units); break;
+ 		case FrictionCoefficientEnum:NodalValuex(responses, FrictionCoefficientEnum,elements,nodes, vertices, loads, materials, parameters,process_units); break;
+-		default: _error_("response descriptor \"" << response_descriptor << "\" not supported yet!"); break;
++		default: _error2_("response descriptor \"" << response_descriptor << "\" not supported yet!"); break;
+ 		#else
+-		default: _error_("ISSM was not compiled with responses capabilities, exiting!");
++		default: _error2_("ISSM was not compiled with responses capabilities, exiting!");
+ 		#endif
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 13055)
+@@ -34,7 +34,7 @@
+ 
+ 	/*Checks*/
+ 	if (M_data!=nods_data && M_data!=nels_data){
+-		_error_("data provided should have either " << nods_data << " or " << nels_data << " lines (not " << M_data << ")");
++		_error2_("data provided should have either " << nods_data << " or " << nels_data << " lines (not " << M_data << ")");
+ 	}
+ 
+ 	/*Get default*/
+@@ -137,7 +137,7 @@
+ 		else{
+ 			for (j=0;j<N_data;j++){
+ 				if (it<0 || it>=nels_data){
+-					_error_("Triangle number " << it << " not in [0 " << nels_data << "], report bug to developers");
++					_error2_("Triangle number " << it << " not in [0 " << nels_data << "], report bug to developers");
+ 				}
+ 				data_interp[i*N_data+j]=data[N_data*it+j];
+ 			}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 13055)
+@@ -52,7 +52,7 @@
+ 	double  cde,re,ex2,ex;
+ 	double  sl,rho,cm,T,chi;
+ 
+-	if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n");
++	if((sgn!=1) && (sgn!=-1)) _error2_("Sign should be either +1 or -1.\n");
+ 
+ 	delta = central_meridian;
+ 	slat  = standard_parallel;
+@@ -130,7 +130,7 @@
+ 		*pslat = 71;
+ 		if(flag) _pprintLine_("Warning: expecting coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).");
+ 	}
+-	else _error_("Sign should be either +1 or -1.\n");
++	else _error2_("Sign should be either +1 or -1.\n");
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp	(revision 13055)
+@@ -29,7 +29,7 @@
+ 
+ 	/*some checks*/
+ 	if (nels<1 || nods<3 || nlines<1 || ncols<1 || xposting==0 || yposting==0){
+-		_error_("nothing to be done according to the mesh given in input");
++		_error2_("nothing to be done according to the mesh given in input");
+ 	}
+ 
+ 	/*figure out what kind of interpolation is needed*/
+@@ -40,7 +40,7 @@
+ 		interpolation_type=2;
+ 	}
+ 	else{
+-		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
++		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+ 	}
+ 
+ 	/*First, allocate pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 13055)
+@@ -26,7 +26,7 @@
+ 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 
+ 	if(migration_style==NoneEnum) return;
+-	if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error_(EnumToStringx(migration_style) << " not supported yet!");
++	if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error2_(EnumToStringx(migration_style) << " not supported yet!");
+ 
+ 	if(migration_style==SoftMigrationEnum){
+ 		/*Create flag for grounded vertices above the hydrostatic equilibrium: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp	(revision 13055)
+@@ -71,7 +71,7 @@
+ 	#ifdef _HAVE_CONTROL_
+ 	if(control_analysis)solutioncore=&control_core;
+ 	#else
+-	_error_("ISSM was not compiled with control capabilities, exiting!");
++	_error2_("ISSM was not compiled with control capabilities, exiting!");
+ 	#endif
+ 
+ 	/*Run the core solution sequence: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp	(revision 13055)
+@@ -22,12 +22,12 @@
+ 
+ 	/*retrieve first token, separated by underscore: */
+ 	pch = strtok (descriptor,"_");
+-	if(!pch)_error_("descriptor " << descriptor << " is not correctly formatted!");
++	if(!pch)_error2_("descriptor " << descriptor << " is not correctly formatted!");
+ 
+ 	if (strncmp(pch,"scaled",6)==0){
+ 		/*we have a scaled variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error_("scaled descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error2_("scaled descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 
+ 		/*now recover  the index if it exists: */
+@@ -43,22 +43,22 @@
+ 	else if (strncmp(pch,"indexed",7)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return IndexedEnum;
+ 	}
+ 	else if (strncmp(pch,"nodal",5)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return NodalEnum;
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 13055)
+@@ -25,7 +25,7 @@
+ 
+ 	/*Get size of vector: */
+ 	gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
+-	if (gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));
++	if (gsize==0) _error2_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));
+ 	
+ 	/*Initialize solution: */
+ 	solution=new Vector(gsize);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp	(revision 13055)
+@@ -37,7 +37,7 @@
+ 
+ 	if(    (edge1==IntersectEnum) && (edge2==IntersectEnum) && (edge3==IntersectEnum)   ){
+ 		/*This case is impossible: */
+-		_error_("error: a line cannot go through 3 different vertices!");
++		_error2_("error: a line cannot go through 3 different vertices!");
+ 	}
+ 	else if(    ((edge1==IntersectEnum) && (edge2==IntersectEnum)) || ((edge2==IntersectEnum) && (edge3==IntersectEnum)) || ((edge3==IntersectEnum) && (edge1==IntersectEnum))   ){
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 13055)
+@@ -38,7 +38,7 @@
+ 	/*Broadcast whether we found the element: */
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+-	if(!sumfound)_error_("could not find material with id" << index << " to compute ElementResponse");
++	if(!sumfound)_error2_("could not find material with id" << index << " to compute ElementResponse");
+ 	#endif
+ 
+ 	/*Ok, we found the element, compute responseocity: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 13055)
+@@ -29,7 +29,7 @@
+ 	/*Do we have penalties linked to rifts? In this case, run our special rifts penalty 
+ 	 * management routine, otherwise, skip : */
+ 	if (RiftIsPresent(loads,analysis_type)){
+-		_error_("rift constraints reset not supported yet!");
++		_error2_("rift constraints reset not supported yet!");
+ 	}
+ 	else if(ThermalIsPresent(loads,analysis_type)){
+ 		ThermalConstraintsReset(loads,analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 13055)
+@@ -94,10 +94,10 @@
+ 			xDelete<double>(distributed_values);
+ 		}
+ 		else if (strncmp(descriptor,"indexed_",8)==0){
+-			_error_("indexed variables not supported yet!");
++			_error2_("indexed variables not supported yet!");
+ 		}
+ 		else if (strncmp(descriptor,"nodal_",8)==0){
+-			_error_("nodal variables not supported yet!");
++			_error2_("nodal variables not supported yet!");
+ 		}
+ 		else{
+ 			/*Ok, standard variable, just update inputs using the variable: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 13055)
+@@ -51,7 +51,7 @@
+ 	double  latitude,longitude;
+ 	double  T,rho,sl,tc,mc;
+ 
+-	if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n");
++	if((sgn!=1) && (sgn!=-1)) _error2_("Sign should be either +1 or -1.\n");
+ 
+ 	delta = central_meridian;
+ 	slat  = standard_parallel;
+@@ -122,7 +122,7 @@
+ 		*pslat = 71;
+ 		if(flag) _pprintLine_("Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).");
+ 	}
+-	else _error_("Sign should be either +1 or -1.\n");
++	else _error2_("Sign should be either +1 or -1.\n");
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 13055)
+@@ -54,7 +54,7 @@
+ 	/*read exp file  */
+ 
+ 	if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp))
+-		_error_("Error reading exp file.");
++		_error2_("Error reading exp file.");
+ 	_pprintLine_("Exp2Kmlx -- Reading " << nprof << " exp profiles from file \"" << filexp << "\".");
+ //	for (i=0; i<nprof; i++)
+ //		_printLine_("i=" << i << "; nvert=" << pnvert[i] << ", closed=" << closed[i]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp	(revision 13055)
+@@ -43,7 +43,7 @@
+ 
+ 	fidi=fopen(filkml,"r");
+ 	if (!(kobj=KMLFileReadx(fidi)))
+-		_error_("Error reading kml file.");
++		_error2_("Error reading kml file.");
+ 	fclose(fidi);
+ 
+ /*  open exp file  */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 13055)
+@@ -50,7 +50,7 @@
+ 			for (i=0;i<numberofelements;i++) epart[i]=0;
+ 			for (i=0;i<numberofnodes;i++)    npart[i]=0;
+ 		}
+-		else _error_("At least one processor is required");
++		else _error2_("At least one processor is required");
+ 	}
+ 	else{
+ 		/*We have a 3d mesh, made of a regularly extruded 2d mesh. We first partition the 2d mesh, then we extrude the partition: */
+@@ -77,7 +77,7 @@
+ 			for (i=0;i<numberofelements2d;i++) epart2d[i]=0;
+ 			for (i=0;i<numberofnodes2d;i++)    npart2d[i]=0;
+ 		}
+-		else _error_("At least one processor is required");
++		else _error2_("At least one processor is required");
+ 
+ 		/*Extrude epart2d to epart, using numlayers: */
+ 		epart=xNew<int>(numberofelements);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 13055)
+@@ -31,7 +31,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("vector type: " << EnumToStringx(type) << " not supported yet!");
++		_error2_("vector type: " << EnumToStringx(type) << " not supported yet!");
+ 	}
+ 
+ 	vector->Assemble();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 13055)
+@@ -137,7 +137,7 @@
+ 		xDelete<double>(gate.percent);
+ 	}
+ 	else{
+-		_error_("output '" << output << "' not supported yet");
++		_error2_("output '" << output << "' not supported yet");
+ 	}
+ 
+ 	/*clean-up and Assign output pointer*/
+@@ -304,7 +304,7 @@
+ 		else if(strcmp(model,"exponential")==0) variogram = new ExponentialVariogram(options);
+ 		else if(strcmp(model,"spherical")==0)   variogram = new SphericalVariogram(options);
+ 		else if(strcmp(model,"power")==0)       variogram = new PowerVariogram(options);
+-		else _error_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
++		else _error2_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
+ 	}
+ 	else variogram = new GaussianVariogram(options);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13055)
+@@ -102,7 +102,7 @@
+ #endif
+ 	}
+ 	else{
+-		_error_("output '" << output << "' not supported yet");
++		_error2_("output '" << output << "' not supported yet");
+ 	}
+ 
+ 	/*clean-up and Assign output pointer*/
+@@ -125,7 +125,7 @@
+ 		else if(strcmp(model,"exponential")==0) variogram = new ExponentialVariogram(options);
+ 		else if(strcmp(model,"spherical")==0)   variogram = new SphericalVariogram(options);
+ 		else if(strcmp(model,"power")==0)       variogram = new PowerVariogram(options);
+-		else _error_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
++		else _error2_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
+ 	}
+ 	else variogram = new GaussianVariogram(options);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 13055)
+@@ -37,7 +37,7 @@
+ 	/*Broadcast whether we found the element: */
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+-	if(!sumfound)_error_("could not find element with vertex with id" << index << " to compute nodal value " << EnumToStringx(natureofdataenum));
++	if(!sumfound)_error2_("could not find element with vertex with id" << index << " to compute nodal value " << EnumToStringx(natureofdataenum));
+ 	#endif
+ 
+ 	/*Broadcast and plug into response: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 13055)
+@@ -47,7 +47,7 @@
+ 			case VyEnum:   iomodel->FetchData(1,VyEnum); break;
+ 			case FrictionCoefficientEnum: iomodel->FetchData(1,FrictionCoefficientEnum); break;
+ 			case MaterialsRheologyBbarEnum:    iomodel->FetchData(1,MaterialsRheologyBEnum); break;
+-			default: _error_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
++			default: _error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 13055)
+@@ -102,7 +102,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("not implemented yet");
++		_error2_("not implemented yet");
+ 	}
+ 
+ 	/*Second: add all missing nodes*/
+@@ -110,7 +110,7 @@
+ 	/*Get edges and elements*/
+ 	iomodel->FetchData(&edges,&numberofedges,&cols,MeshEdgesEnum);
+ 	iomodel->FetchData(&elements,NULL,NULL,MeshElementsEnum);
+-	if (cols!=4) _error_("field edges should have 4 columns");
++	if (cols!=4) _error2_("field edges should have 4 columns");
+ 
+ 	/*!All elements have been partitioned above, only create elements for this CPU: */
+ 	for (i=0;i<numberofedges;i++){
+@@ -151,7 +151,7 @@
+ 				my_nodes[e2*3+1]=true;
+ 			}
+ 			else{
+-				_error_("Problem in edges creation");
++				_error2_("Problem in edges creation");
+ 			}
+ 		}
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 13055)
+@@ -105,7 +105,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("Size of field " << EnumToStringx(ThermalSpctemperatureEnum) << " not supported");
++		_error2_("Size of field " << EnumToStringx(ThermalSpctemperatureEnum) << " not supported");
+ 	}
+ 
+ 	/*Free ressources:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 13055)
+@@ -45,7 +45,7 @@
+ 	NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
+ 
+ 	/*Check in 3d*/
+-	if(stabilization==3 && dim==3) _error_("DG 3d not implemented yet");
++	if(stabilization==3 && dim==3) _error2_("DG 3d not implemented yet");
+ 
+ 	/*First fetch data: */
+ 	iomodel->FetchData(7,MeshElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 13055)
+@@ -63,7 +63,7 @@
+ 			doftype[4]=StokesApproximationEnum;
+ 			doftype[5]=StokesApproximationEnum;
+ 		}
+-		else _error_("Approximationtype " << reCast<int>(*vertices_type) << " (" << EnumToStringx(reCast<int>(*vertices_type)) << ") not implemented yet for DiagnosticHoriz");
++		else _error2_("Approximationtype " << reCast<int>(*vertices_type) << " (" << EnumToStringx(reCast<int>(*vertices_type)) << ") not implemented yet for DiagnosticHoriz");
+ 	}
+ 	else if (analysis_type==DiagnosticVertAnalysisEnum){
+ 		numdofs=1;
+@@ -92,7 +92,7 @@
+ 	else if (analysis_type==BalancethicknessAnalysisEnum){
+ 		numdofs=1;
+ 	}
+-	else _error_("analysis type: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not implemented yet");
++	else _error2_("analysis type: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not implemented yet");
+ 
+ 	/*Now initialize the index*/
+ 	index->Init(numdofs,doftype);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 13055)
+@@ -32,7 +32,7 @@
+ 	if(!loads) loads = new Loads();
+ 
+ 	/*return if 2d mesh*/
+-	if (dim==2) _error_("2d meshes not supported yet");
++	if (dim==2) _error2_("2d meshes not supported yet");
+ 
+ 	//create penalties for nodes: no node can have a temperature over the melting point
+ 	iomodel->FetchData(2,ThermalSpctemperatureEnum,MeshElementsEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 13055)
+@@ -25,7 +25,7 @@
+ 	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
+ 
+ 	/*if 2d: Error*/
+-	if (dim==2) _error_("2d meshes not supported yet");
++	if (dim==2) _error2_("2d meshes not supported yet");
+ 
+ 	/*Recover pointer: */
+ 	loads=*ploads;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13055)
+@@ -145,7 +145,7 @@
+ 						}
+ 
+ 					}
+-					else _error_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal");
++					else _error2_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal");
+ 			}
+ 			/*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/
+ 			else if ((int)vertices_type[i]==PattynStokesApproximationEnum){
+@@ -185,7 +185,7 @@
+ 							count++;
+ 						}
+ 					}
+-					else _error_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes");
++					else _error2_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes");
+ 			}
+ 			/*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/
+ 			else if ((int)vertices_type[i]==MacAyealStokesApproximationEnum){
+@@ -225,7 +225,7 @@
+ 							count++;
+ 						}
+ 					}
+-					else _error_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes");
++					else _error2_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes");
+ 			}
+ 			/*Now add the regular spcs*/
+ 			else{
+@@ -318,7 +318,7 @@
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0.,DiagnosticHorizAnalysisEnum));
+ 						count++;
+ 						break;
+-					default: _error_("Vertex approximation " << EnumToStringx((int)vertices_type[i]) << " not supported");
++					default: _error2_("Vertex approximation " << EnumToStringx((int)vertices_type[i]) << " not supported");
+ 				}
+ 			}
+ 		}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 13055)
+@@ -45,7 +45,7 @@
+ 	NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
+ 
+ 	/*Check in 3d*/
+-	if(stabilization==3 && dim==3) _error_("DG 3d not implemented yet");
++	if(stabilization==3 && dim==3) _error2_("DG 3d not implemented yet");
+ 
+ 	/*First fetch data: */
+ 	iomodel->FetchData(7,MeshElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 13055)
+@@ -152,7 +152,7 @@
+ 			
+ 			/*Fetch the mass flux segments necessary to compute the mass fluxes.  Build a DoubleMatArrayParam object out of them: */ 
+ 			iomodel->FetchData(&array,&mdims_array,&ndims_array,&qmu_mass_flux_num_profiles,QmuMassFluxSegmentsEnum);
+-			if(qmu_mass_flux_num_profiles==0)_error_("qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!");
++			if(qmu_mass_flux_num_profiles==0)_error2_("qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!");
+ 
+ 			/*Go through segments, and extract those that belong to this cpu: */
+ 			for(i=0;i<qmu_mass_flux_num_profiles;i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 13055)
+@@ -123,7 +123,7 @@
+ 
+ 
+ 		default:
+-			_error_("analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!");
++			_error2_("analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!");
+ 	}
+ 
+ 	/*Update Elements and Materials For Control methods*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13055)
+@@ -26,7 +26,7 @@
+ 
+ 	/*some checks*/
+ 	if (nels_data<1 || nods_data<6 || nods_prime==0){
+-		_error_("nothing to be done according to the mesh given in input");
++		_error2_("nothing to be done according to the mesh given in input");
+ 	}
+ 
+ 	/*Set debug to 1 if there are lots of elements*/
+@@ -40,7 +40,7 @@
+ 		interpolation_type=2;
+ 	}
+ 	else{
+-		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
++		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+ 	}
+ 
+ 	/*Get prime mesh extrema coordinates*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 13055)
+@@ -95,7 +95,7 @@
+ 	if(solver_type==MUMPSPACKAGE_LU || solver_type==MUMPSPACKAGE_CHOL){
+ 		#if _PETSC_MAJOR_ >=3
+ 			#ifndef _HAVE_MUMPS_
+-			_error_("requested MUMPS solver, which was not compiled into ISSM!\n");
++			_error2_("requested MUMPS solver, which was not compiled into ISSM!\n");
+ 			#endif
+ 		#endif
+ 	}
+@@ -119,7 +119,7 @@
+ 	/*Stokes: */
+ 	if (solver_type==StokesSolverEnum){
+ 		/*Make indices out of doftypes: */
+-		if(!df)_error_("need doftypes for Stokes solver!\n");
++		if(!df)_error2_("need doftypes for Stokes solver!\n");
+ 		DofTypesToIndexSet(&isv,&isp,df,StokesSolverEnum);
+ 
+ 		/*Set field splits: */
+@@ -150,7 +150,7 @@
+ 	
+ 	/*Check convergence*/
+ 	KSPGetIterationNumber(ksp,&iteration_number);
+-	if (iteration_number<0) _error_("Solver diverged at iteration number: " << -iteration_number);
++	if (iteration_number<0) _error2_("Solver diverged at iteration number: " << -iteration_number);
+ 
+ 	/*Free resources:*/
+ 	KSPFree(&ksp);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 13055)
+@@ -43,7 +43,7 @@
+ 			SolverxSeq(&uf->svector,Kff->smatrix,pf->svector);
+ 			break;}
+ 		default:
+-			  _error_("Matrix type: " << Kff->type << " not supported yet!");
++			  _error2_("Matrix type: " << Kff->type << " not supported yet!");
+ 	}
+ 
+ 	/*Assign output pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13055)
+@@ -29,8 +29,8 @@
+ 	Kff->GetSize(&M,&N);
+ 	pf->GetSize(&N2);
+ 
+-	if(N!=N2)_error_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
+-	if(M!=N)_error_("Stiffness matrix should be square!");
++	if(N!=N2)_error2_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
++	if(M!=N)_error2_("Stiffness matrix should be square!");
+ 
+ 	SolverxSeq(&x,Kff->matrix,pf->vector,N);
+ 	uf=new SeqVec(x,N);
+@@ -39,7 +39,7 @@
+ 	*puf=uf;
+ 
+ 	#else
+-		_error_("GSL support not compiled in!");
++		_error2_("GSL support not compiled in!");
+ 	#endif
+ 
+ }/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13055)
+@@ -36,13 +36,13 @@
+ 
+ 	/*Some checks on arguments: */
+ 	if ((M<2) || (N<2) || (nods<=0)){
+-		_error_("nothing to be done according to the dimensions of input matrices and vectors.");
++		_error2_("nothing to be done according to the dimensions of input matrices and vectors.");
+ 	}
+ 	if (x_in[1]-x_in[0]<0){
+-		_error_("x coordinate vector should be increasing.\n   use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)");
++		_error2_("x coordinate vector should be increasing.\n   use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)");
+ 	}
+ 	if (y_in[1]-y_in[0]<0){
+-		_error_("y coordinate vector should be increasing.\n   use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)");
++		_error2_("y coordinate vector should be increasing.\n   use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)");
+ 	}
+ 
+ 	/*Allocate output vector: */
+@@ -68,7 +68,7 @@
+ 		for (i=0;i<M;i++) y[i]=y_in[i];
+ 	}
+ 	else{
+-		_error_("x and y vectors length should be 1 or 0 more than data number of rows.");
++		_error2_("x and y vectors length should be 1 or 0 more than data number of rows.");
+ 	}
+ 
+ 	/*initialize thread parameters: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp	(revision 13055)
+@@ -70,7 +70,7 @@
+ 	/*Last check: is the number of elements on last column of the connectivity superior to maxels? If so, then error out and 
+ 	 * warn the user to increase the connectivity width: */
+ 	for(i=0;i<nods;i++){
+-		if (*(connectivity+width*i+maxels)>maxels)_error_("max connectivity width reached (" << *(connectivity+width*i+maxels) << ")! increase width of connectivity table");
++		if (*(connectivity+width*i+maxels)>maxels)_error2_("max connectivity width reached (" << *(connectivity+width*i+maxels) << ")! increase width of connectivity table");
+ 	}
+ 
+ 	/*Assign output pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 13055)
+@@ -105,7 +105,7 @@
+ 	for(i=0;i<numanalyses;i++){
+ 		char* string=strings[i];
+ 		if(my_rank==0){
+-			if(string==NULL) _error_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");
++			if(string==NULL) _error2_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");
+ 		}
+ 		if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
+ 		#ifdef _HAVE_MPI_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 13055)
+@@ -53,8 +53,8 @@
+ 
+ 	/*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)    _error2_("||∂J/∂α||∞ = 0    gradient norm is zero");
++	if(xIsNan<IssmDouble>(norm_inf))_error2_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
+ 
+ 	/*Clean-up and assign output pointer*/
+ 	if(pnorm_list){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 13055)
+@@ -85,7 +85,7 @@
+ 			}
+ 		}
+ 		else if (flag==NodalEnum){
+-			_error_("nodal response functions not supported yet!");
++			_error2_("nodal response functions not supported yet!");
+ 
+ 			/*increment response_pointer :*/
+ 			responses_pointer++;
+@@ -103,7 +103,7 @@
+ 				responses_pointer++;
+ 			}
+ 		}
+-		else _error_("flag type " << flag << " not supported yet for response analysis");
++		else _error2_("flag type " << flag << " not supported yet for response analysis");
+ 	}
+ 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp	(revision 13055)
+@@ -132,7 +132,7 @@
+ 						nodecon[ipt+(nncon-1)]++;
+ 					}
+ 					else
+-						_error_("Nodal connectivity table needs more than specified " << mxepg << " columns.\n");
++						_error2_("Nodal connectivity table needs more than specified " << mxepg << " columns.\n");
+ 				}
+ 				jpt++;
+ 			}
+@@ -172,7 +172,7 @@
+ 		}
+ 
+ 		else
+-			_error_("Data matrix has incorrect number of " << mdata << " rows.\n");
++			_error2_("Data matrix has incorrect number of " << mdata << " rows.\n");
+ 	}
+ 
+ /*  write folder for mesh  */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp	(revision 13055)
+@@ -74,7 +74,7 @@
+ /*  open shp/shx files  */
+ 
+ 	hSHP = SHPOpen( filshp, "rb" );
+-	if (!hSHP) _error_("Error opening shp/shx files.");
++	if (!hSHP) _error2_("Error opening shp/shx files.");
+ 
+ /*  read header and print out file bounds  */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 13055)
+@@ -37,8 +37,8 @@
+ 	/*First of, find the record for the enum, and get code  of data type: */
+ 	fid=iomodel->SetFilePointerToData(&code, &vector_layout,vector_enum);
+ 
+-	if(code!=7)_error_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));
+-	if(vector_layout!=1)_error_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));
++	if(code!=7)_error2_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));
++	if(vector_layout!=1)_error2_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));
+ 
+ 	/*Fetch vector:*/
+ 	iomodel->FetchData(&IssmDoublevector,&M,&N,vector_enum);
+@@ -98,7 +98,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("Size of field " << EnumToStringx(vector_enum) << " not supported");
++		_error2_("Size of field " << EnumToStringx(vector_enum) << " not supported");
+ 	}
+ 
+ 	/*Free ressources:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 13055)
+@@ -59,6 +59,6 @@
+ 	xDelete<real_t>(tpwgts);
+ 
+ 	#else
+-	_error_("METIS version not supported yet");
++	_error2_("METIS version not supported yet");
+ 	#endif
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 13055)
+@@ -84,7 +84,7 @@
+ 			for(i=0;i<ssize;i++) this->vector[list[i]]=values[i];
+ 			break;
+ 		default:
+-			_error_("unknown insert mode!");
++			_error2_("unknown insert mode!");
+ 			break;
+ 	}
+ 
+@@ -101,7 +101,7 @@
+ 			this->vector[dof]=value;
+ 			break;
+ 		default:
+-			_error_("unknown insert mode!");
++			_error2_("unknown insert mode!");
+ 			break;
+ 	}
+ }
+@@ -203,7 +203,7 @@
+ 			return sqrt(norm);
+ 			break;
+ 		default:
+-			_error_("unknown norm !");
++			_error2_("unknown norm !");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 13055)
+@@ -118,7 +118,7 @@
+ 			return norm;
+ 			break;
+ 		default:
+-			_error_("unknown norm !");
++			_error2_("unknown norm !");
+ 			break;
+ 	}
+ }
+@@ -149,8 +149,8 @@
+ 	X->GetSize(&XM);
+ 	AX->GetSize(&AXM);
+ 
+-	if(M!=AXM)_error_("A and AX should have the same number of rows!");
+-	if(N!=XM)_error_("A and X should have the same number of columns!");
++	if(M!=AXM)_error2_("A and AX should have the same number of rows!");
++	if(N!=XM)_error2_("A and X should have the same number of columns!");
+ 
+ 	for(i=0;i<M;i++){
+ 		dummy=0;
+@@ -196,7 +196,7 @@
+ 			for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]=values[n*i+j];
+ 			break;
+ 		default:
+-			_error_("unknown insert mode!");
++			_error2_("unknown insert mode!");
+ 			break;
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp	(revision 13055)
+@@ -50,7 +50,7 @@
+ 	MatGetLocalSize(*A,&local_mA,&local_nA);
+ 
+ 	/*Some dimensions checks: */
+-	if (mA!=nA) _error_("trying to take the invert of a non-square matrix!");
++	if (mA!=nA) _error2_("trying to take the invert of a non-square matrix!");
+ 
+ 	/* Set default Plapack parameters */
+ 	//First find nprows*npcols=num_procs;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp	(revision 13055)
+@@ -29,7 +29,7 @@
+ 			return MATSEQAIJ;
+ 			break;
+ 		default: 
+-			_error_("unknown matrix type !");
++			_error2_("unknown matrix type !");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp	(revision 13055)
+@@ -29,7 +29,7 @@
+ 			return INSERT_VALUES;
+ 			break;
+ 		default: 
+-			_error_("unknown insert mode!");
++			_error2_("unknown insert mode!");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp	(revision 13055)
+@@ -28,7 +28,7 @@
+ 
+ 	/*Some checks: */
+ 	MatGetSize(matrix,&M,&N);
+-	if(M!=N) _error_("trying to invert a non square matrix!");
++	if(M!=N) _error2_("trying to invert a non square matrix!");
+ 
+ 	/*Create identitiy matrix: */
+ 	identity=NewMat(M,N,sparsity);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 13055)
+@@ -61,7 +61,7 @@
+ 			#endif
+ 		}
+ 		else{
+-			_error_("MatType " << type << " not supported yet");
++			_error2_("MatType " << type << " not supported yet");
+ 		}
+ 		/*Assemble*/
+ 		MatAssemblyBegin(outmatrix,MAT_FINAL_ASSEMBLY);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp	(revision 13055)
+@@ -29,7 +29,7 @@
+ 			return NORM_2;
+ 			break;
+ 		default: 
+-			_error_("unknown norm !");
++			_error2_("unknown norm !");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 13055)
+@@ -54,7 +54,7 @@
+ 			 * and set the option, then end the token analysis.*/
+ 			if(first[0]!='-'){
+ 				/*This is not good, the option does not have '-'! Get out*/
+-				_error_("Option " << first << " should be preceded by '-'!");
++				_error2_("Option " << first << " should be preceded by '-'!");
+ 			}
+ 			/*Reduce first to bare option value*/
+ 			PetscStrlen(first,&len);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 13055)
+@@ -34,7 +34,7 @@
+ 
+ 	/*If the dimension of the partitioning vector is not the same as that of vector B, we have a problem: */
+ 	if ( (row_partition_size !=MB) ){
+-		_error_("Dimensions of partitioning vector incompatible with dimensions of input vector\n");
++		_error2_("Dimensions of partitioning vector incompatible with dimensions of input vector\n");
+ 	}
+ 
+ 	/*Get values from vector B and plug them into vector A, using the partitioning vector*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13055)
+@@ -5,22 +5,22 @@
+ #Library declaration {{{
+ lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+-if SHAREDLIBS
+-lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
+-endif
++#if SHARED
++#lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
++#endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+ if MATLAB
+-if SHAREDLIBS
+-lib_LTLIBRARIES += libISSMMatlab.la
+-endif
++#if SHARED
++#lib_LTLIBRARIES += libISSMMatlab.la
++#endif
+ lib_LIBRARIES += libISSMMatlab.a 
+ endif
+ if MODULES
+-if SHAREDLIBS
+-lib_LTLIBRARIES += libISSMModules.la
+-endif
++#if SHARED
++#lib_LTLIBRARIES += libISSMModules.la
++#endif
+ lib_LIBRARIES += libISSMModules.a 
+ endif
+ #}}}
+@@ -1010,29 +1010,28 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
+-if SHAREDLIBS
+-libISSM_la_SOURCES = solutions/issm.cpp
+-libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
++#if SHARED
++#libISSM_la_SOURCES = solutions/issm.cpp
++#libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
++#
++#libISSMCore_la_SOURCES  = $(issm_sources)
++#libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
++#
++#libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++#endif
+ 
+-libISSMCore_la_SOURCES  = $(issm_sources)
+-libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
+-
+-libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
+-endif
+-
+ if MODULES
+-if SHAREDLIBS
+-libISSMModules_la_SOURCES = $(module_sources)
+-libISSMModules_la_SOURCES += $(bamg_sources)
+-libISSMModules_la_SOURCES += $(kriging_sources)
+-libISSMModules_la_SOURCES += $(kml_sources)
+-endif
++#if SHARED
++#libISSMModules_la_SOURCES = $(module_sources)
++#libISSMModules_la_SOURCES += $(bamg_sources)
++#libISSMModules_la_SOURCES += $(kriging_sources)
++#libISSMModules_la_SOURCES += $(kml_sources)
++#endif
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+ libISSMModules_a_SOURCES += $(kriging_sources)
+ libISSMModules_a_SOURCES += $(kml_sources)
+ libISSMModules_a_CXXFLAGS = $(ALLCXXFLAGS)
+-libISSMModules_a_LIBADD = ./libISSMCore.a
+ endif
+ 
+ if PYTHON
+@@ -1041,18 +1040,13 @@
+ endif
+ 
+ if MATLAB
+-if SHAREDLIBS
+-libISSMMatlab_la_SOURCES = $(matlab_sources)
+-endif
++#if SHARED
++#libISSMMatlab_la_SOURCES = $(matlab_sources)
++#endif
+ libISSMMatlab_a_SOURCES = $(matlab_sources)
+ libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
+ endif
+ 
+-if VERSION
+-AM_LDFLAGS =
+-else
+-AM_LDFLAGS = -avoid-version
+-endif
+ #}}}
+ #Overload library, to overload any non-standard symbols. {{{
+ libISSMOverload_a_SOURCES = ./shared/String/stricmp.c
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 13055)
+@@ -142,7 +142,7 @@
+ 		if(this->ssize)this->sdoflist=xNew<int>(size);
+ 		else this->sdoflist=NULL;
+ 	}
+-	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ }
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp	(revision 13055)
+@@ -184,7 +184,7 @@
+ 		if(this->objects[i]==NULL){
+ 			this->objects[i]=(Object*)dataset->GetObjectById(this->offsets+i,this->ids[i]); //remember the offset for later on.
+ 			/*check the id is correct!: */
+-			if (this->objects[i]->Id()!=this->ids[i]) _error_("wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << "  in resolved pointer!");
++			if (this->objects[i]->Id()!=this->ids[i]) _error2_("wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << "  in resolved pointer!");
+ 		}
+ 	}
+ }
+@@ -193,10 +193,10 @@
+ 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) _error2_("trying to delivery 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");
++	if (this->objects==NULL) _error2_("hook is not pointing to any object, objects pointer is NULL");
+ 
+ 	return *objects;
+ }
+@@ -245,11 +245,11 @@
+ 	}
+ 
+ 	/*Else, check that we are requesting a half of num*/
+-	if (numindices>this->num) _error_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects");
++	if (numindices>this->num) _error2_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects");
+ 
+ 	/*go pickup the correct objects, ids and offsets :*/
+ 	output->num=numindices;
+-	if(output->num<1) _error_("Trying to spawn an empty ElementProperties!");
++	if(output->num<1) _error2_("Trying to spawn an empty ElementProperties!");
+ 
+ 	output->objects=xNew<Object*>(output->num);
+ 	output->ids=xNew<int>(output->num);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 13055)
+@@ -79,7 +79,7 @@
+ 		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+ 	}
+ 	else
+-	 _error_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
++	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
+ 
+ 	/*Initialize static fields as undefined*/
+ 	weight=UNDEF;
+@@ -177,7 +177,7 @@
+ 		coord3=0.5;
+ 	}
+ 	else
+-	 _error_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
++	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
+ 
+ }
+ /*}}}*/
+@@ -240,7 +240,7 @@
+ 			coord1=0; coord2=0; coord3=1;
+ 			break;
+ 		default:
+-			_error_("vertex index should be in [0 2]");
++			_error2_("vertex index should be in [0 2]");
+ 
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 13055)
+@@ -118,7 +118,7 @@
+ 		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+ 	}
+ 	else{
+-		_error_("Penta not supported yet");
++		_error2_("Penta not supported yet");
+ 	}
+ 
+ 	/*Initialize static fields as undefined*/
+@@ -158,7 +158,7 @@
+ 		for(int i=0;i<numgauss;i++) coords4[i]=1.0;
+ 	}
+ 	else{
+-		_error_("Tria not supported yet");
++		_error2_("Tria not supported yet");
+ 	}
+ 
+ }
+@@ -220,7 +220,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")");
++		_error2_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")");
+ 	}
+ 
+ 	/*clean-up*/
+@@ -339,7 +339,7 @@
+ 			coord1=0; coord2=0; coord3=1; coord4= +1;
+ 			break;
+ 		default:
+-			_error_("vertex index should be in [0 5]");
++			_error2_("vertex index should be in [0 5]");
+ 
+ 	}
+ 
+@@ -358,7 +358,7 @@
+ 		for(int i=0;i<numgauss;i++) coords4[i]=-1.0;
+ 	}
+ 	else{
+-		_error_("Tria not supported yet");
++		_error2_("Tria not supported yet");
+ 	}
+ 
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13055)
+@@ -193,13 +193,13 @@
+ 
+ 			/*Get input (either in element or material)*/
+ 			Input* input=inputs->GetInput(input_enum);
+-			if(!input) _error_("Input " << EnumToStringx(input_enum) << " not found in material");
++			if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in material");
+ 
+ 			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
+ 			input->GetVectorFromInputs(vector,&doflist1[0]);}
+ 			break;
+ 
+-		default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++		default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+ 	}
+ }
+ /*}}}*/
+@@ -259,7 +259,7 @@
+ 	}
+ 
+ 	/*Checks in debugging mode*/
+-	if(viscosity<=0) _error_("Negative viscosity");
++	if(viscosity<=0) _error2_("Negative viscosity");
+ 	_assert_(B>0);
+ 	_assert_(n>0);
+ 
+@@ -330,7 +330,7 @@
+ 	}
+ 
+ 	/*Checks in debugging mode*/
+-	if(viscosity3d<=0) _error_("Negative viscosity");
++	if(viscosity3d<=0) _error2_("Negative viscosity");
+ 	_assert_(B>0);
+ 	_assert_(n>0);
+ 
+@@ -402,7 +402,7 @@
+ 	}
+ 
+ 	/*Checks in debugging mode*/
+-	if(viscosity3d<=0) _error_("Negative viscosity");
++	if(viscosity3d<=0) _error2_("Negative viscosity");
+ 	_assert_(B>0);
+ 	_assert_(n>0);
+ 
+@@ -563,9 +563,9 @@
+ 					this->inputs->AddInput(new TriaP1Input(name,values));
+ 					return;
+ 				}
+-				default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+ 			}
+-		default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ }
+ /*}}}*/
+@@ -621,9 +621,9 @@
+ 					/*}}}*/
+ 					return;
+ 				}
+-				default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+ 			}
+-		default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ 
+ 
+@@ -763,7 +763,7 @@
+ 	}
+ 	#endif
+ 	else{
+-		_error_("Mesh type not supported yet!");
++		_error2_("Mesh type not supported yet!");
+ 	}
+ 
+ 	return;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 13055)
+@@ -61,10 +61,10 @@
+ 		void   InputUpdateFromConstant(int constant, int name);
+ 		void   InputUpdateFromConstant(bool constant, int name);
+ 		void   InputUpdateFromSolution(IssmDouble* solution);
+-		void   InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
++		void   InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
+ 		/*}}}*/
+ 		/*Material virtual functions resolution: {{{*/
+-		void   InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");};
++		void   InputDuplicate(int original_enum,int new_enum){_error2_("not implemented yet");};
+ 		void   Configure(Elements* elements);
+ 		void   GetVectorFromInputs(Vector* vector,int input_enum){return;}
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 13055)
+@@ -39,7 +39,7 @@
+ 		Input* PointwiseMin(Input* inputB);
+ 		Input* PointwiseMax(Input* inputB);
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+@@ -48,10 +48,10 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetInputAverage(IssmDouble* pvalue);
+@@ -66,15 +66,15 @@
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+ 		void ConstrainMin(IssmDouble minimum);
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+ 		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+-		IssmDouble InfinityNorm(void){_error_("not implemented yet");};
++		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
+ 		IssmDouble Max(void);
+ 		IssmDouble MaxAbs(void);
+ 		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void);
+-		void Extrude(void){_error_("not supported yet");};
++		void Extrude(void){_error2_("not supported yet");};
+ 		void VerticallyIntegrate(Input* thickness_input);
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 13055)
+@@ -47,7 +47,7 @@
+ 			maxvalues  =new PentaP1Input(enum_type,pmax);
+ 			break;
+ 		default:
+-			_error_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput");
++			_error2_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput");
+ 	}
+ 	gradient   =NULL;
+ }
+@@ -151,7 +151,7 @@
+ }/*}}}*/
+ /*FUNCTION ControlInput::ScaleGradient{{{*/
+ void ControlInput::ScaleGradient(IssmDouble scaling_factor){
+-	if(!gradient) _error_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");
++	if(!gradient) _error2_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");
+ 	gradient->Scale(scaling_factor);
+ }/*}}}*/
+ /*FUNCTION ControlInput::SetGradient{{{*/
+@@ -169,7 +169,7 @@
+ 			gradient_in->ChangeEnum(Gradient3Enum);
+ 			break;
+ 		default:
+-			_error_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated.");
++			_error2_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated.");
+ 	}
+ 
+ 	/*Delete old gradient and assign new gradient*/
+@@ -220,7 +220,7 @@
+ 		 gradient->GetVectorFromInputs(vector,doflist);
+ 	 }
+ 	 else{
+-		 _error_("Data " << data << " not supported yet");
++		 _error2_("Data " << data << " not supported yet");
+ 	 }
+ }/*}}}*/
+ /*FUNCTION ControlInput::GetInputAverage(IssmDouble* pvalue){{{*/
+@@ -257,15 +257,15 @@
+ }/*}}}*/
+ /*FUNCTION ControlInput::SaveValue{{{*/
+ void ControlInput::SaveValue(void){
+-	if(!values) _error_("Values of " << EnumToStringx(this->enum_type) << " not found");
++	if(!values) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
+ 
+ 	if(savedvalues) delete this->savedvalues;
+ 	this->savedvalues=(Input*)this->values->copy();
+ }/*}}}*/
+ /*FUNCTION ControlInput::UpdateValue{{{*/
+ 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");
++	if(!gradient)    _error2_("Gradient of " << EnumToStringx(this->enum_type) << " not found");
++	if(!savedvalues) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
+ 
+ 	if(values) delete this->values;
+ 	this->values=(Input*)this->savedvalues->copy();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 13055)
+@@ -40,11 +40,11 @@
+ 		/*ControlInput management: {{{*/
+ 		int    InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+@@ -54,38 +54,38 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void ChangeEnum(int newenumtype){_error_("not implemented yet");};
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error_("not implemented yet");};
+-		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar){_error_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void ChangeEnum(int newenumtype){_error2_("not implemented yet");};
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error2_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar){_error2_("not implemented yet");};
+ 		void Constrain(void);
+ 		void Constrain(IssmDouble min,IssmDouble max);
+-		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 MinAbs(void){_error_("not implemented yet");};
++		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
++		IssmDouble Max(void){_error2_("not implemented yet");};
++		IssmDouble MaxAbs(void){_error2_("not implemented yet");};
++		IssmDouble Min(void){_error2_("not implemented yet");};
++		IssmDouble MinAbs(void){_error2_("not implemented yet");};
+ 		void Extrude(void);
+ 		void VerticallyIntegrate(Input* thickness_input);
+ 		void GetVectorFromInputs(Vector* vector,int* doflist,const char* data);
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");};
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not implemented yet");};
+ 		ElementResult* SpawnGradient(int step, IssmDouble time);
+ 		void GetGradient(Vector* gradient_vec,int* doflist);
+ 		void ScaleGradient(IssmDouble scale);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp	(revision 13055)
+@@ -114,7 +114,7 @@
+ void DatasetInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int index){
+ 
+ 	/*Get requested input within dataset*/
+-	if(index<0 || index > inputs->Size()-1) _error_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");
++	if(index<0 || index > inputs->Size()-1) _error2_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");
+ 	Input* input=(Input*)this->inputs->GetObjectByOffset(index);
+ 	
+ 	input->GetInputValue(pvalue,gauss);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 13055)
+@@ -36,56 +36,56 @@
+ 		/*DatasetInput management: {{{*/
+ 		int    InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+-		ElementResult* SpawnResult(int step, IssmDouble time){_error_("not implemented yet");};
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
++		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		ElementResult* SpawnResult(int step, IssmDouble time){_error2_("not implemented yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void ChangeEnum(int newenumtype){_error_("not implemented yet");};
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error_("not implemented yet");};
+-		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar){_error_("not implemented yet");};
+-		void Constrain(void){_error_("not implemented yet");};
+-		void Constrain(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+-		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 MinAbs(void){_error_("not implemented yet");};
+-		void Extrude(void){_error_("not implemented yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error_("not implemented yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist){_error_("not implemented yet");};
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");};
+-		ElementResult* SpawnGradient(int step, IssmDouble time){_error_("not implemented yet");};
+-		void GetGradient(Vector* gradient_vec,int* doflist){_error_("not implemented yet");};
+-		void ScaleGradient(IssmDouble scale){_error_("not implemented yet");};
+-		void SetGradient(Input* gradient_in){_error_("not implemented yet");};
+-		void UpdateValue(IssmDouble scalar){_error_("not implemented yet");};
+-		void SaveValue(void){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void ChangeEnum(int newenumtype){_error2_("not implemented yet");};
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error2_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar){_error2_("not implemented yet");};
++		void Constrain(void){_error2_("not implemented yet");};
++		void Constrain(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
++		IssmDouble Max(void){_error2_("not implemented yet");};
++		IssmDouble MaxAbs(void){_error2_("not implemented yet");};
++		IssmDouble Min(void){_error2_("not implemented yet");};
++		IssmDouble MinAbs(void){_error2_("not implemented yet");};
++		void Extrude(void){_error2_("not implemented yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error2_("not implemented yet");};
++		void GetVectorFromInputs(Vector* vector,int* doflist){_error2_("not implemented yet");};
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not implemented yet");};
++		ElementResult* SpawnGradient(int step, IssmDouble time){_error2_("not implemented yet");};
++		void GetGradient(Vector* gradient_vec,int* doflist){_error2_("not implemented yet");};
++		void ScaleGradient(IssmDouble scale){_error2_("not implemented yet");};
++		void SetGradient(Input* gradient_in){_error2_("not implemented yet");};
++		void UpdateValue(IssmDouble scalar){_error2_("not implemented yet");};
++		void SaveValue(void){_error2_("not implemented yet");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 13055)
+@@ -98,14 +98,14 @@
+ /*FUNCTION IntInput::SpawnResult{{{*/
+ ElementResult* IntInput::SpawnResult(int step, IssmDouble time){
+ 	
+-	_error_("not supported yet!");
++	_error2_("not supported yet!");
+ 
+ }
+ /*}}}*/
+ 
+ /*Object functions*/
+ /*FUNCTION IntInput::GetInputValue(bool* pvalue) {{{*/
+-void IntInput::GetInputValue(bool* pvalue){_error_("not supported yet!");}
++void IntInput::GetInputValue(bool* pvalue){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(int* pvalue){{{*/
+ void IntInput::GetInputValue(int* pvalue){
+@@ -114,20 +114,20 @@
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue){{{*/
+ void IntInput::GetInputValue(IssmDouble* pvalue){
+-	_error_("IntInput cannot return a IssmDouble in parallel");
++	_error2_("IntInput cannot return a IssmDouble in parallel");
+ }
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not supported yet!");}
++void IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not supported yet!");}
++void IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");}
++void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");}
++void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::ChangeEnum{{{*/
+ void IntInput::ChangeEnum(int newenumtype){
+@@ -165,7 +165,7 @@
+ 			return;
+ 
+ 		default:
+-			_error_("not implemented yet");
++			_error2_("not implemented yet");
+ 	}
+ 
+ }
+@@ -181,14 +181,14 @@
+ /*FUNCTION IntInput::GetVectorFromInputs{{{*/
+ void IntInput::GetVectorFromInputs(Vector* vector,int* doflist){
+ 
+-	_error_("not supporte yet!");
++	_error2_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION IntInput::GetValuesPtr{{{*/
+ void IntInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+ 
+-	_error_("not supported yet!");
++	_error2_("not supported yet!");
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 13055)
+@@ -111,22 +111,22 @@
+ }
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(int* pvalue){{{*/
+-void BoolInput::GetInputValue(int* pvalue){_error_("not supported yet!");}
++void BoolInput::GetInputValue(int* pvalue){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue){_error_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");}
++void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");}
++void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::ChangeEnum{{{*/
+ void BoolInput::ChangeEnum(int newenumtype){
+@@ -160,7 +160,7 @@
+ 			return;
+ 
+ 		default:
+-			_error_("not implemented yet");
++			_error2_("not implemented yet");
+ 	}
+ 
+ }
+@@ -175,14 +175,14 @@
+ /*FUNCTION BoolInput::GetVectorFromInputs{{{*/
+ void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){
+ 
+-	_error_("not supporte yet!");
++	_error2_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION BoolInput::GetValuesPtr{{{*/
+ void BoolInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+ 
+-	_error_("not supported yet!");
++	_error2_("not supported yet!");
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 13055)
+@@ -36,11 +36,11 @@
+ 		/*IntInput management: {{{*/
+ 		int   InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+@@ -49,34 +49,34 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+ 		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+-		IssmDouble InfinityNorm(void){_error_("InfinityNorm not implemented for integers");};
+-		IssmDouble Max(void){_error_("Max not implemented for integers");};
+-		IssmDouble MaxAbs(void){_error_("Max not implemented for integers");};
+-		IssmDouble Min(void){_error_("Min not implemented for integers");};
+-		IssmDouble MinAbs(void){_error_("Min not implemented for integers");};
+-		void Extrude(void){_error_("not supported yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
++		IssmDouble InfinityNorm(void){_error2_("InfinityNorm not implemented for integers");};
++		IssmDouble Max(void){_error2_("Max not implemented for integers");};
++		IssmDouble MaxAbs(void){_error2_("Max not implemented for integers");};
++		IssmDouble Min(void){_error2_("Min not implemented for integers");};
++		IssmDouble MinAbs(void){_error2_("Min not implemented for integers");};
++		void Extrude(void){_error2_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 13055)
+@@ -36,12 +36,12 @@
+ 		/*BoolInput management: {{{*/
+ 		int   InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+ 		void Configure(Parameters* parameters);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+ 		void GetInputValue(bool* pvalue);
+@@ -49,34 +49,34 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
+-		IssmDouble InfinityNorm(void){_error_("InfinityNorm not implemented for booleans");};
+-		IssmDouble Max(void){_error_("Max not implemented for booleans");};
+-		IssmDouble MaxAbs(void){_error_("Max not implemented for booleans");};
+-		IssmDouble Min(void){_error_("Min not implemented for booleans");};
+-		IssmDouble MinAbs(void){_error_("Min not implemented for booleans");};
++		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		IssmDouble InfinityNorm(void){_error2_("InfinityNorm not implemented for booleans");};
++		IssmDouble Max(void){_error2_("Max not implemented for booleans");};
++		IssmDouble MaxAbs(void){_error2_("Max not implemented for booleans");};
++		IssmDouble Min(void){_error2_("Min not implemented for booleans");};
++		IssmDouble MinAbs(void){_error2_("Min not implemented for booleans");};
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error_("Constrain not implemented for booleans");};
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error2_("Constrain not implemented for booleans");};
+ 		void Extrude(void);
+-		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 13055)
+@@ -322,7 +322,7 @@
+ 			return;
+ 
+ 		default :
+-			_error_("not implemented yet");
++			_error2_("not implemented yet");
+ 	}
+ 
+ }
+@@ -367,7 +367,7 @@
+ 	IssmDouble            minvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TriaP1Input*)inputB;
+ 
+ 	/*Create point wise min*/
+@@ -398,7 +398,7 @@
+ 	IssmDouble            maxvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TriaP1Input*)inputB;
+ 
+ 	/*Create point wise max*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 13055)
+@@ -36,33 +36,33 @@
+ 		/*TriaP1Input management: {{{*/
+ 		int   InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+ 		Input* PointwiseMin(Input* inputB);
+ 		Input* PointwiseMax(Input* inputB);
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error_("not implemented yet");}
+-		void GetInputValue(int* pvalue){_error_("not implemented yet");}
+-		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");}
++		void GetInputValue(bool* pvalue){_error2_("not implemented yet");}
++		void GetInputValue(int* pvalue){_error2_("not implemented yet");}
++		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");}
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+ 		void GetInputAverage(IssmDouble* pvalue);
+ 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+@@ -76,8 +76,8 @@
+ 		IssmDouble MaxAbs(void);
+ 		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void);
+-		void Extrude(void){_error_("not supported yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
++		void Extrude(void){_error2_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 13055)
+@@ -481,7 +481,7 @@
+ 			}
+ 		}
+ 	}
+-	if(!found)_error_("did not find time interval on which to interpolate forcing values!");
++	if(!found)_error2_("did not find time interval on which to interpolate forcing values!");
+ 
+ 	/*Assign output pointer*/
+ 	return input;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 13055)
+@@ -454,12 +454,12 @@
+ 			return;
+ 		case ControlInputEnum:{
+ 			ControlInput* cont_input=(ControlInput*)xinput;
+-			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error_("not supported yet");
++			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error2_("not supported yet");
+ 			PentaP1Input* cast_input=(PentaP1Input*)cont_input->values;
+ 			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
+ 			return;
+ 		default:
+-			_error_("not implemented yet");
++			_error2_("not implemented yet");
+ 	}
+ 
+ }
+@@ -494,7 +494,7 @@
+ 	IssmDouble    *thickness_values = NULL;
+ 
+ 	/*Check that input provided is a thickness*/
+-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
++	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
+ 
+ 	/*Get Thickness value pointer*/
+ 	thickness_input->GetValuesPtr(&thickness_values,&num_thickness_values);
+@@ -510,7 +510,7 @@
+ 			return;
+ 
+ 		default:
+-			_error_("not implemented yet");
++			_error2_("not implemented yet");
+ 	}
+ }
+ /*}}}*/
+@@ -528,7 +528,7 @@
+ 	IssmDouble            AdotBvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaP1Input*)inputB;
+ 
+ 	/*Create point wise sum*/
+@@ -559,7 +559,7 @@
+ 	IssmDouble            minvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaP1Input*)inputB;
+ 
+ 	/*Create point wise min*/
+@@ -590,7 +590,7 @@
+ 	IssmDouble            maxvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaP1Input*)inputB;
+ 
+ 	/*Create point wise max*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 13055)
+@@ -107,13 +107,13 @@
+ /*Object functions*/
+ /*FUNCTION DoubleInput::GetInputValue(bool* pvalue) {{{*/
+ void DoubleInput::GetInputValue(bool* pvalue){
+-	_error_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");
++	_error2_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetInputValue(int* pvalue){{{*/
+ void DoubleInput::GetInputValue(int* pvalue){
+-	_error_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
++	_error2_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
+ 
+ }
+ /*}}}*/
+@@ -131,10 +131,10 @@
+ void DoubleInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){*pvalue=this->value;}
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");}
++void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");}
++void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){{{*/
+ void DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){
+@@ -216,7 +216,7 @@
+ 			return;
+ 
+ 		default:
+-			_error_("not implemented yet");
++			_error2_("not implemented yet");
+ 	}
+ 
+ }
+@@ -252,14 +252,14 @@
+ /*FUNCTION DoubleInput::GetVectorFromInputs{{{*/
+ void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){
+ 
+-	_error_("not supporte yet!");
++	_error2_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetValuesPtr{{{*/
+ void DoubleInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+ 
+-	_error_("not supported yet!");
++	_error2_("not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -275,7 +275,7 @@
+ 	IssmDouble thickness_value;
+ 
+ 	/*Check that input provided is a thickness*/
+-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
++	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
+ 
+ 	/*vertically integrate depending on type:*/
+ 	switch(thickness_input->ObjectEnum()){
+@@ -286,7 +286,7 @@
+ 			return;
+ 
+ 		default:
+-			_error_("not implemented yet");
++			_error2_("not implemented yet");
+ 	}
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 13055)
+@@ -39,50 +39,50 @@
+ 		/*TransientInput management: {{{*/
+ 		int    InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* forcingB){_error_("not implemented yet");};
+-		Input* PointwiseMin(Input* forcingB){_error_("not implemented yet");};
+-		Input* PointwiseMax(Input* forcingB){_error_("not implemented yet");};
++		Input* PointwiseDivide(Input* forcingB){_error2_("not implemented yet");};
++		Input* PointwiseMin(Input* forcingB){_error2_("not implemented yet");};
++		Input* PointwiseMax(Input* forcingB){_error2_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+ 		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+-		void AXPY(Input* xforcing,IssmDouble scalar){_error_("not implemented yet");};
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void AXPY(Input* xforcing,IssmDouble scalar){_error2_("not implemented yet");};
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error2_("not implemented yet");};
+ 		IssmDouble InfinityNorm(void);
+ 		IssmDouble Max(void);
+ 		IssmDouble MaxAbs(void);
+ 		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void);
+ 		void Extrude(void);
+-		void VerticallyIntegrate(Input* thickness_forcing){_error_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_forcing){_error2_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not supported yet");};
+-      void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");};
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not supported yet");};
++      void GetTimeValues(IssmDouble* values,IssmDouble time){_error2_("not implemented yet");};
+ 		Input* GetTimeInput(IssmDouble time);
+ 		/*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 13055)
+@@ -40,24 +40,24 @@
+ 		Input* PointwiseMin(Input* inputB);
+ 		Input* PointwiseMax(Input* inputB);
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not implemented yet");};
++		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+ 		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss);
+@@ -68,7 +68,7 @@
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+ 		void ConstrainMin(IssmDouble minimum);
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+ 		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+ 		IssmDouble InfinityNorm(void);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp	(revision 13055)
+@@ -78,9 +78,9 @@
+ 	if      (!strncmp(kstr,"</Geometry",10))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");}
++	  {_error2_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");}
++	  {_error2_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");}
+ 
+ 	else if (!strncmp(kstr,"<",1))
+ 		KML_Object::Read(fid,kstr);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h	(revision 13055)
+@@ -43,13 +43,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h	(revision 13055)
+@@ -35,13 +35,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h	(revision 13055)
+@@ -37,13 +37,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp	(revision 13055)
+@@ -92,9 +92,9 @@
+ 	if      (!strncmp(kstr,"</ColorStyle",12))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);}
++	  {_error2_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");}
++	  {_error2_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");}
+ 
+ 	else if (!strcmp(kstr,"<color>"))
+ 		KMLFileTokenParse( color     ,NULL,KML_COLORSTYLE_COLOR_LENGTH, kstr, fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 13055)
+@@ -139,9 +139,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<Point", 6)) {
+ 			kobj=(KML_Object*)new KML_Point();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 13055)
+@@ -159,7 +159,7 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 
+ 		else if (strncmp(kstri,"<",1)) {
+ 			if (value) {
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 13055)
+@@ -130,9 +130,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<altitude>"))
+ 			KMLFileTokenParse(&altitude  ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h	(revision 13055)
+@@ -43,13 +43,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 13055)
+@@ -188,9 +188,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ //		else if (!strncmp(kstri,"<IconStyle",10)) {
+ //			icon      =new KML_IconStyle();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 13055)
+@@ -139,9 +139,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<Point", 6)) {
+ 			kobj=(KML_Object*)new KML_Point();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h	(revision 13055)
+@@ -28,13 +28,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h	(revision 13055)
+@@ -34,13 +34,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h	(revision 13055)
+@@ -29,13 +29,13 @@
+ 		virtual void  Echo();
+ 		virtual void  DeepEcho();
+ 		virtual void  DeepEcho(const char* indent);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 13055)
+@@ -112,9 +112,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<width>"))
+ 			KMLFileTokenParse(&width     ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h	(revision 13055)
+@@ -31,13 +31,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h	(revision 13055)
+@@ -30,13 +30,13 @@
+ 		virtual void  Echo();
+ 		virtual void  DeepEcho();
+ 		virtual void  DeepEcho(const char* indent);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 13055)
+@@ -105,9 +105,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Container::Read(fid,kstri);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 13055)
+@@ -105,9 +105,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Container::Read(fid,kstri);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h	(revision 13055)
+@@ -28,13 +28,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 13055)
+@@ -106,9 +106,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}
++		  {_error2_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}
++		  {_error2_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}
+ 
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Object::Read(fid,kstri);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h	(revision 13055)
+@@ -37,13 +37,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h	(revision 13055)
+@@ -35,13 +35,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h	(revision 13055)
+@@ -32,13 +32,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 13055)
+@@ -144,9 +144,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<href>"))
+ 			KMLFileTokenParse( href      ,NULL,KML_ICON_HREF_LENGTH, kstri, fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 13055)
+@@ -125,9 +125,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<extrude>"))
+ 			KMLFileTokenParse(&extrude   , kstri, fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 13055)
+@@ -138,9 +138,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<extrude>"))
+ 			KMLFileTokenParse(&extrude,kstri,fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp	(revision 13055)
+@@ -148,9 +148,9 @@
+ 	if      (!strncmp(kstr,"</Feature", 9))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error_("KML_Feature::Read -- Unexpected closing tag " << kstr);}
++	  {_error2_("KML_Feature::Read -- Unexpected closing tag " << kstr);}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");}
++	  {_error2_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");}
+ 
+ 	else if (!strncmp(kstr,"<Style", 6)) {
+ 		kobj=(KML_Object*)new KML_Style();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h	(revision 13055)
+@@ -39,13 +39,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 13055)
+@@ -258,7 +258,7 @@
+ 	char*   ktokn;
+ 
+ 	if (strncmp(&ktag[0],"<"        ,1) || strncmp(&ktag[strlen(ktag)-1],">",1))
+-		_error_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n");
++		_error2_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n");
+ 
+ /*  strtok modifies ktag, so work on copy  */
+ 
+@@ -354,7 +354,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
++		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
+ 
+ 	sscanf(kstr,"%d",pival);
+ 	xDelete<char>(kstr);
+@@ -367,7 +367,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -387,7 +387,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-	  {_error_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");}
++	  {_error2_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");}
+ 
+ 	sscanf(kstr,"%d",&ival);
+ 	*pbval=(bool)ival;
+@@ -401,7 +401,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -432,7 +432,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n");
++		_error2_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n");
+ 
+ 	if (!pstr) {
+ 		if (maxlen)
+@@ -462,7 +462,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -483,7 +483,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-	  {_error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}
++	  {_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}
+ 
+ 	sscanf(kstr,"%g",pfval);
+ 	xDelete<char>(kstr);
+@@ -496,7 +496,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -517,7 +517,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
++		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
+ 
+ 	sscanf(kstr,"%lg",pdval);
+ 	xDelete<char>(kstr);
+@@ -530,7 +530,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -555,7 +555,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");
++		_error2_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");
+ 
+ 	if (!*pdval)
+ 		if (maxlen)
+@@ -569,7 +569,7 @@
+ 	while (ktok) {
+ 		i++;
+ 		if (maxlen && (maxlen < i+1))
+-			_error_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n");
++			_error2_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n");
+ 		sscanf(ktok,"%lg",&((*pdval)[i]));
+ 		ktok=strtok(NULL,delim);
+ 	}
+@@ -594,7 +594,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -621,7 +621,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n");
++		_error2_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n");
+ 
+ 	if (!*pdval)
+ 		if (maxlen)
+@@ -635,7 +635,7 @@
+ 	while (ktok) {
+ 		i++;
+ 		if (maxlen && (maxlen*n < i+1))
+-			_error_("KMLFileTokenParse -- Double [m x n] field too short for " << ktag << ".\n");
++			_error2_("KMLFileTokenParse -- Double [m x n] field too short for " << ktag << ".\n");
+ 		j=(j+1) % n;
+ 		sscanf(ktok,"%lg",&((*pdval)[i]));
+ 		ktok=strtok(NULL,delim);
+@@ -664,7 +664,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -711,13 +711,13 @@
+ 
+ 		else if ((kstr[0] == '<') &&
+ 				 (kstr[1] == '/')) {
+-			_error_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");
++			_error2_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");
+ 		}
+ 
+ 		xDelete<char>(kstr);
+ 	}
+ 
+-	_error_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");
++	_error2_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");
+ 
+ 	return(0);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h	(revision 13055)
+@@ -28,13 +28,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp	(revision 13055)
+@@ -82,9 +82,9 @@
+ 	if      (!strncmp(kstr,"</StyleSelector",15))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");}
++	  {_error2_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");}
++	  {_error2_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");}
+ 
+ 	else if (!strncmp(kstr,"<",1))
+ 		KML_Object::Read(fid,kstr);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 13055)
+@@ -120,9 +120,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<north>"))
+ 			KMLFileTokenParse(&north     ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h	(revision 13055)
+@@ -34,13 +34,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h	(revision 13055)
+@@ -33,13 +33,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error_("Not implemented yet.");};
+-		int   MyRank(){_error_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   MarshallSize(){_error_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+-		int   ObjectEnum(){_error_("Not implemented yet.");};
+-		Object* copy(){_error_("Not implemented yet.");};
++		int   Id(){_error2_("Not implemented yet.");};
++		int   MyRank(){_error2_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   MarshallSize(){_error2_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
++		int   ObjectEnum(){_error2_("Not implemented yet.");};
++		Object* copy(){_error2_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 13055)
+@@ -116,9 +116,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error2_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error2_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<fill>"))
+ 			KMLFileTokenParse(&fill      ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13055)
+@@ -1,229 +1,166 @@
+ AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
+-
+ EXEEXT=$(MATLABWRAPPEREXT)
+-
+-#Modules {{{1
++#Bin programs {{{1
+ if MODULES
+-lib_LTLIBRARIES =  AverageFilter.la\
+-			       BamgMesher.la\
+-				   BamgConvertMesh.la\
+-				   BamgTriangulate.la\
+-				   Chaco.la\
+-				   ContourToMesh.la\
+-				   ContourToNodes.la\
+-				   ElementConnectivity.la\
+-				   EnumToString.la\
+-				   Exp2Kml.la\
+-				   HoleFiller.la\
+-				   InternalFront.la\
+-				   InterpFromGridToMesh.la\
+-				   InterpFromMeshToMesh2d.la\
+-				   InterpFromMeshToMesh3d.la\
+-				   InterpFromMeshToGrid.la\
+-				   InterpFromMesh2d.la\
+-				   KMLFileRead.la\
+-				   KMLMeshWrite.la\
+-				   KMLOverlay.la\
+-				   Kml2Exp.la\
+-				   Kriging.la\
+-				   Ll2xy.la\
+-				   NodeConnectivity.la\
+-				   MeshPartition.la\
+-				   MeshProfileIntersection.la\
+-				   PointCloudFindNeighbors.la\
+-				   PropagateFlagsFromConnectivity.la\
+-				   Shp2Kml.la\
+-				   StringToEnum.la\
+-				   TriaSearch.la\
+-				   TriMesh.la\
+-				   TriMeshProcessRifts.la\
+-				   Scotch.la\
+-				   Xy2ll.la
++bin_PROGRAMS =  AverageFilter\
++				BamgMesher\
++				BamgConvertMesh\
++				BamgTriangulate\
++				Chaco\
++				ContourToMesh \
++				ContourToNodes \
++				ElementConnectivity\
++				EnumToString\
++				Exp2Kml \
++				HoleFiller \
++				InternalFront\
++				InterpFromGridToMesh \
++				InterpFromMeshToMesh2d \
++				InterpFromMeshToMesh3d \
++				InterpFromMeshToGrid \
++				InterpFromMesh2d \
++				KMLFileRead \
++				KMLMeshWrite \
++				KMLOverlay \
++				Kml2Exp \
++				Kriging \
++				Ll2xy \
++				NodeConnectivity \
++				MeshPartition\
++				MeshProfileIntersection\
++				PointCloudFindNeighbors\
++				PropagateFlagsFromConnectivity\
++				Scotch\
++				Shp2Kml\
++				StringToEnum\
++				TriaSearch\
++				TriMesh\
++				TriMeshProcessRifts\
++				Xy2ll
+ endif 
+ #}}}
+ #Flags and libraries {{{1
+-if SHAREDLIBS
+-deps = ../../c/libISSMCore.la ../../c/libISSMModules.la
+-else
+-deps = ../../c/libISSMCore.a ../../c/libISSMModules.a
+-endif
+-deps += $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB) ${MEXLIB}
++LDADD = ../../c/libISSMCore.a ../../c/libISSMModules.a $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB)
+ 
+ #Triangle library
+ AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
+ 
+ #Matlab part
+-AM_LDFLAGS = $(MEXLINK) -shrext ${EXEEXT} -module
+-if VERSION
+-AM_LDFLAGS +=
+-else
+-AM_LDFLAGS += -avoid-version
+-endif
+-if SHAREDLIBS
+-deps += ../../c/libISSMMatlab.la 
+-else
+-deps += ../../c/libISSMMatlab.a
+-deps += ../../c/libISSMCore.a
+-AM_LDFLAGS += --no-warnings 
+-endif
+-
++AM_LDFLAGS   = $(MEXLINK)
+ AM_CXXFLAGS +=  -D_HAVE_MATLAB_MODULES_ -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread 
+-
+-######################################################################################
+-# Circular dependencies may not be necessary here.
+-#deps += ../../c/libISSMCore.a 
++LDADD       += $(MEXLIB) ../../c/libISSMMatlab.a 
++LDADD       += ../../c/libISSMCore.a 
+ if CIRCULAR_DEPENDENCIES
+-deps += $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB)
++LDADD       += $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB)
+ endif
+-if SHAREDLIBS
+-deps +=
+-else
+-deps += ../../c/libISSMModules.a ../../c/libISSMCore.a
+-endif
+-######################################################################################
++LDADD       += ../../c/libISSMModules.a
+ 
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS) 
+ #}}}
+-
+ #Bin sources {{{1
+-AverageFilter_la_SOURCES = ../AverageFilter/AverageFilter.cpp\
++AverageFilter_SOURCES = ../AverageFilter/AverageFilter.cpp\
+ 			  ../AverageFilter/AverageFilter.h
+-AverageFilter_la_LIBADD = ${deps}
+ 
+-BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\
++BamgMesher_SOURCES = ../BamgMesher/BamgMesher.cpp\
+ 					../BamgMesher/BamgMesher.h
+-BamgMesher_la_LIBADD = ${deps}
+ 
+-BamgConvertMesh_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
++BamgConvertMesh_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
+ 					../BamgConvertMesh/BamgConvertMesh.h
+-BamgConvertMesh_la_LIBADD = ${deps}
+ 
+-BamgTriangulate_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
++BamgTriangulate_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
+ 								  ../BamgTriangulate/BamgTriangulate.h
+-BamgTriangulate_la_LIBADD = ${deps}
+ 
+-Chaco_la_SOURCES = ../Chaco/Chaco.cpp\
++Chaco_SOURCES = ../Chaco/Chaco.cpp\
+ 					../Chaco/Chaco.h
+-Chaco_la_LIBADD = ${deps}
+ 
+-ContourToMesh_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
++ContourToMesh_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
+ 			  ../ContourToMesh/ContourToMesh.h
+-ContourToMesh_la_LIBADD = ${deps}
+ 
+-ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
++ContourToNodes_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
+ 			  ../ContourToNodes/ContourToNodes.h
+-ContourToNodes_la_LIBADD = ${deps}
+ 
+-ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
++ElementConnectivity_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+ 			  ../ElementConnectivity/ElementConnectivity.h
+-ElementConnectivity_la_LIBADD = ${deps}
+ 
+-EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\
++EnumToString_SOURCES = ../EnumToString/EnumToString.cpp\
+ 			  ../EnumToString/EnumToString.h
+-EnumToString_la_LIBADD = ${deps}
+ 
+-StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\
++StringToEnum_SOURCES = ../StringToEnum/StringToEnum.cpp\
+ 			  ../StringToEnum/StringToEnum.h
+-StringToEnum_la_LIBADD = ${deps}
+ 
+-HoleFiller_la_SOURCES = ../HoleFiller/HoleFiller.cpp\
++HoleFiller_SOURCES = ../HoleFiller/HoleFiller.cpp\
+ 			  ../HoleFiller/HoleFiller.h
+-HoleFiller_la_LIBADD = ${deps}
+ 
+-InternalFront_la_SOURCES = ../InternalFront/InternalFront.cpp\
++InternalFront_SOURCES = ../InternalFront/InternalFront.cpp\
+ 										 ../InternalFront/InternalFront.h
+-InternalFront_la_LIBADD = ${deps}
+ 
+-InterpFromGridToMesh_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
++InterpFromGridToMesh_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
+ 			  ../InterpFromGridToMesh/InterpFromGridToMesh.h
+-InterpFromGridToMesh_la_LIBADD = ${deps}
+ 
+-InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
++InterpFromMeshToMesh2d_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
+ 							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+-InterpFromMeshToMesh2d_la_LIBADD = ${deps}
+ 
+-InterpFromMeshToMesh3d_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
++InterpFromMeshToMesh3d_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
+ 									../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
+-InterpFromMeshToMesh3d_la_LIBADD = ${deps}
+ 
+-InterpFromMeshToGrid_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
++InterpFromMeshToGrid_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
+ 									../InterpFromMeshToGrid/InterpFromMeshToGrid.h
+-InterpFromMeshToGrid_la_LIBADD = ${deps}
+ 
+-InterpFromMesh2d_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
++InterpFromMesh2d_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
+ 									../InterpFromMesh2d/InterpFromMesh2d.h
+-InterpFromMesh2d_la_LIBADD = ${deps}
+ 
+-KMLFileRead_la_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
++KMLFileRead_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
+ 			  ../KMLFileRead/KMLFileRead.h
+-KMLFileRead_la_LIBADD = ${deps}
+ 
+-KMLMeshWrite_la_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
++KMLMeshWrite_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
+ 			  ../KMLMeshWrite/KMLMeshWrite.h
+-KMLMeshWrite_la_LIBADD = ${deps}
+ 
+-KMLOverlay_la_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
++KMLOverlay_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
+ 			  ../KMLOverlay/KMLOverlay.h
+-KMLOverlay_la_LIBADD = ${deps}
+ 
+-Xy2ll_la_SOURCES = ../Xy2ll/Xy2ll.cpp\
++Xy2ll_SOURCES = ../Xy2ll/Xy2ll.cpp\
+ 			  ../Xy2ll/Xy2ll.h
+-Xy2ll_la_LIBADD = ${deps}
+ 
+-Ll2xy_la_SOURCES = ../Ll2xy/Ll2xy.cpp\
++Ll2xy_SOURCES = ../Ll2xy/Ll2xy.cpp\
+ 			  ../Ll2xy/Ll2xy.h
+-Ll2xy_la_LIBADD = ${deps}
+ 
+-Exp2Kml_la_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
++Exp2Kml_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
+ 			  ../Exp2Kml/Exp2Kml.h
+-Exp2Kml_la_LIBADD = ${deps}
+ 
+-Kml2Exp_la_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
++Kml2Exp_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
+ 			  ../Kml2Exp/Kml2Exp.h
+-Kml2Exp_la_LIBADD = ${deps}
+ 
+-Kriging_la_SOURCES = ../Kriging/Kriging.cpp\
++Kriging_SOURCES = ../Kriging/Kriging.cpp\
+ 						../Kriging/Kriging.h
+-Kriging_la_LIBADD = ${deps}
+ 
+-MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\
++MeshPartition_SOURCES = ../MeshPartition/MeshPartition.cpp\
+ 			  ../MeshPartition/MeshPartition.h
+-MeshPartition_la_LIBADD = ${deps}
+ 
+-MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
++MeshProfileIntersection_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
+ 			  ../MeshProfileIntersection/MeshProfileIntersection.h
+-MeshProfileIntersection_la_LIBADD = ${deps}
+ 
+-NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
++NodeConnectivity_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
+ 										../NodeConnectivity/NodeConnectivity.h
+-NodeConnectivity_la_LIBADD = ${deps}
+ 
+-PointCloudFindNeighbors_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
++PointCloudFindNeighbors_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
+ 			  ../PointCloudFindNeighbors/PointCloudFindNeighbors.h
+-PointCloudFindNeighbors_la_LIBADD = ${deps}
+ 
+-PropagateFlagsFromConnectivity_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
++PropagateFlagsFromConnectivity_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
+ 			  ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
+-PropagateFlagsFromConnectivity_la_LIBADD = ${deps}
+ 
+-Scotch_la_SOURCES = ../Scotch/Scotch.cpp\
+-                    ../Scotch/Scotch.h
+-Scotch_la_LIBADD = ${deps} $(SCOTCHLIB)
++Scotch_SOURCES = ../Scotch/Scotch.cpp\
++			  ../Scotch/Scotch.h
+ 
+-Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
+-                     ../Shp2Kml/Shp2Kml.h
+-Shp2Kml_la_LIBADD = ${deps}
++Shp2Kml_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
++			  ../Shp2Kml/Shp2Kml.h
+ 
+-TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp\
++TriaSearch_SOURCES = ../TriaSearch/TriaSearch.cpp\
+ 			  ../TriaSearch/TriaSearch.h
+-TriaSearch_la_LIBADD = ${deps}
+ 
+-TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
+-                     ../TriMesh/TriMesh.h
+-TriMesh_la_LIBADD = ${deps} $(TRIANGLELIB)
++TriMesh_SOURCES = ../TriMesh/TriMesh.cpp\
++			  ../TriMesh/TriMesh.h
+ 
+-TriMeshProcessRifts_la_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
++TriMeshProcessRifts_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
+ 			  ../TriMeshProcessRifts/TriMeshProcessRifts.h
+-TriMeshProcessRifts_la_LIBADD = ${deps}
+ #}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13054)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13055)
+@@ -21,9 +21,12 @@
+ AM_SILENT_RULES([yes])           #Do not show compilation command by default
+ AM_PROG_CC_C_O
+ AM_PROG_AR
++AC_PROG_RANLIB 
+ 
+-#Libtool
+-LT_INIT
++# To produce shared libraries uncomment LT_INIT. In theory, Libtool can be initialized
++# even if all linking is static, since, if not shared libraries are to be produce, libtool
++# will act simply as a wrapper around AR and Ranlib.
++#LT_INIT
+ 
+ #Run issm_options.m4
+ ISSM_OPTIONS
Index: /issm/oecreview/Archive/12678-13393/ISSM-13055-13056.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13055-13056.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13055-13056.diff	(revision 13394)
@@ -0,0 +1,4918 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13056)
+@@ -14,13 +14,21 @@
+ 
+ 	dnl }}}
+     dnl shared build {{{
+-    AC_ARG_ENABLE([shared],                                                dnl feature
+-        AS_HELP_STRING([--enable-shared], [produce libISSM.so.0]),         dnl help string
+-        [enable_shared=$enableval],                                        dnl action if given
+-        [enable_shared=no])                                                dnl action if not given
+-    AM_CONDITIONAL([SHARED], [test $enable_shared = yes])
++    AC_ARG_ENABLE([sharedlibs],                                                dnl feature
++        AS_HELP_STRING([--enable-sharedlibs], [produce libISSM.so.0]),         dnl help string
++        [enable_sharedlibs=$enableval],                                        dnl action if given
++        [enable_sharedlibs=no])                                                dnl action if not given
++    AM_CONDITIONAL([SHAREDLIBS], [test x$enable_sharedlibs = xyes])
+     dnl }}}
+ 
++    dnl shared build {{{
++    AC_ARG_ENABLE([version],                                                dnl feature
++        AS_HELP_STRING([--enable-version], [produce libISSM.so.0]),         dnl help string
++        [enable_version=$enableval],                                        dnl action if given
++        [enable_version=no])                                                dnl action if not given
++    AM_CONDITIONAL([VERSION], [test x$enable_VERSION = xyes])
++    dnl }}}
++
+ 	dnl Modules build {{{
+ 	AC_ARG_WITH([modules],
+ 		AS_HELP_STRING([--with-modules = value],[modules compilation. ]),
+@@ -588,7 +596,7 @@
+ 				METISLIB=-L"$METIS_ROOT/lib -lmetis"
+ 				;;
+ 			esac
+-	
++
+ 			METISINCL=-I"$METIS_ROOT/include" 
+ 			AC_DEFINE([_METIS_VERSION_],[5],[ Metis version number])
+ 		fi
+@@ -605,7 +613,7 @@
+ 	dnl mpi{{{
+ 	AC_MSG_CHECKING(for mpi)
+ 	AC_ARG_WITH([mpi-lib],
+-		AS_HELP_STRING([--with-mpi-lib = otions],[mpi options, for ex: "-L$MPIROOT -lmpich]),
++		AS_HELP_STRING([--with-mpi-lib = options],[mpi options, for ex: "-L$MPIROOT -lmpich]),
+ 		[MPILIB=$withval],[MPILIB=""])
+ 	
+ 	AC_ARG_WITH([mpi-include],
+@@ -619,7 +627,7 @@
+ 			HAVE_MPI=no
+ 		else
+ 			HAVE_MPI=yes
+-			MPIINCL=-I"$MPI_INCLUDE/"
++			MPIINCL=-I"$MPI_INCLUDE"
+ 			AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
+ 			AC_DEFINE([HAVE_MPI],[1],[Mpi Flag for Dakota (DO NOT REMOVE)])
+ 			AC_SUBST([MPIINCL])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 13056)
+@@ -71,7 +71,7 @@
+ 	res=nKUoldF/nF;
+ 	if (xIsNan<IssmDouble>(res)){
+ 		_pprintLine_("norm nf = " << nF << "f and norm kuold = " << nKUoldF << "f");
+-		_error2_("mechanical equilibrium convergence criterion is NaN!");
++		_error_("mechanical equilibrium convergence criterion is NaN!");
+ 	}
+ 
+ 	//clean up
+@@ -95,7 +95,7 @@
+ 		duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
+ 		ndu=duf->Norm(NORM_TWO); nu=old_uf->Norm(NORM_TWO);
+ 
+-		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error2_("convergence criterion is NaN!");
++		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!");
+ 
+ 		//clean up
+ 		xdelete(&duf);
+@@ -120,7 +120,7 @@
+ 		//compute max(du)
+ 		duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
+ 		ndu=duf->Norm(NORM_TWO); nduinf=duf->Norm(NORM_INF);
+-		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error2_("convergence criterion is NaN!");
++		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!");
+ 
+ 		//clean up
+ 		xdelete(&duf);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 13056)
+@@ -28,74 +28,74 @@
+ 			#ifdef _HAVE_DIAGNOSTIC_
+ 			solutioncore=&diagnostic_core;
+ 			#else
+-			_error2_("ISSM was not compiled with diagnostic capabilities. Exiting");
++			_error_("ISSM was not compiled with diagnostic capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case SteadystateSolutionEnum:
+ 			#ifdef _HAVE_STEADYSTATE_
+ 			solutioncore=&steadystate_core;
+ 			#else
+-			_error2_("ISSM was not compiled with steady state capabilities. Exiting");
++			_error_("ISSM was not compiled with steady state capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case ThermalSolutionEnum:
+ 			#ifdef _HAVE_THERMAL_
+ 			solutioncore=&thermal_core;
+ 			#else
+-			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
++			_error_("ISSM was not compiled with thermal capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case EnthalpySolutionEnum:
+ 			#ifdef _HAVE_THERMAL_
+ 			solutioncore=&enthalpy_core;
+ 			#else
+-			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
++			_error_("ISSM was not compiled with thermal capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case BalancethicknessSolutionEnum:
+ 			#ifdef _HAVE_BALANCED_
+ 			solutioncore=&balancethickness_core;
+ 			#else
+-			_error2_("ISSM was not compiled with balanced capabilities. Exiting");
++			_error_("ISSM was not compiled with balanced capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case HydrologySolutionEnum:
+ 			#ifdef _HAVE_HYDROLOGY_
+ 			solutioncore=&hydrology_core;
+ 			#else
+-			_error2_("ISSM was not compiled with hydrology capabilities. Exiting");
++			_error_("ISSM was not compiled with hydrology capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case SurfaceSlopeSolutionEnum:
+ 			#ifdef _HAVE_SLOPE_
+ 			solutioncore=&surfaceslope_core;
+ 			#else
+-			_error2_("ISSM was not compiled with slope capabilities. Exiting");
++			_error_("ISSM was not compiled with slope capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case BedSlopeSolutionEnum:
+ 			#ifdef _HAVE_SLOPE_
+ 			solutioncore=&bedslope_core;
+ 			#else
+-			_error2_("ISSM was not compiled with slope capabilities. Exiting");
++			_error_("ISSM was not compiled with slope capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case TransientSolutionEnum:
+ 			#ifdef _HAVE_TRANSIENT_
+ 			solutioncore=&transient_core;
+ 			#else
+-			_error2_("ISSM was not compiled with transient capabilities. Exiting");
++			_error_("ISSM was not compiled with transient capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		case PrognosticSolutionEnum:
+ 			#ifdef _HAVE_PROGNOSTIC_
+ 			solutioncore=&prognostic_core;
+ 			#else
+-			_error2_("ISSM was not compiled with prognostic capabilities. Exiting");
++			_error_("ISSM was not compiled with prognostic capabilities. Exiting");
+ 			#endif
+ 			break;
+ 		default:
+-			_error2_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
++			_error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
+ 			break;
+ 	}
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/steadystate_core.cpp	(revision 13056)
+@@ -51,7 +51,7 @@
+ 			enthalpy_core(femmodel);
+ 		}
+ 		#else
+-		_error2_("ISSM was not compiled with thermal capabilities. Exiting");
++		_error_("ISSM was not compiled with thermal capabilities. Exiting");
+ 		#endif
+ 
+ 		if(VerboseSolution()) _pprintLine_("   computing new velocity");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/WriteLockFile.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/WriteLockFile.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/WriteLockFile.cpp	(revision 13056)
+@@ -16,10 +16,10 @@
+ 	/* Open lock file and write 1 into it: */
+ 	if(my_rank==0){
+ 		fid=fopen(filename,"w");
+-		if(fid==NULL) _error2_("error message: could not open lock file " << filename);
++		if(fid==NULL) _error_("error message: could not open lock file " << filename);
+ 
+ 		/*Close file: */
+-		if(fclose(fid)!=0) _error2_("could not close lock file " << filename);
++		if(fclose(fid)!=0) _error_("could not close lock file " << filename);
+ 	}
+ 
+ }	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 13056)
+@@ -16,9 +16,9 @@
+ 	char *petscfilename  = NULL;
+ 	char *lockfilename   = NULL;
+ 
+-	if(argc<2)_error2_("Usage error: no solution requested");
++	if(argc<2)_error_("Usage error: no solution requested");
+ 	*solution_type=StringToEnumx(argv[1]);
+-	if(argc<3)_error2_("Usage error: missing model name");
++	if(argc<3)_error_("Usage error: missing model name");
+ 	modelname=argv[3];
+ 	binfilename    = xNew<char>(strlen(modelname)+strlen(".bin")   +1); sprintf(binfilename,   "%s%s",modelname,".bin");
+ 	outbinfilename = xNew<char>(strlen(modelname)+strlen(".outbin")+1); sprintf(outbinfilename,"%s%s",modelname,".outbin");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 13056)
+@@ -36,8 +36,8 @@
+ 
+ 	/*Check that gradient is clean*/
+ 	norm_inf=new_gradient->Norm(NORM_INF);
+-	if(norm_inf<=0)    _error2_("||∂J/∂α||∞ = 0    gradient norm is zero");
+-	if(xIsNan<IssmDouble>(norm_inf))_error2_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
++	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);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 13056)
+@@ -34,7 +34,7 @@
+ 			adjointcore=&adjointbalancethickness_core;
+ 			break;
+ 		default:
+-			_error2_("No adjoint has been implemented for solution " << EnumToStringx(solutiontype) << " yet");
++			_error_("No adjoint has been implemented for solution " << EnumToStringx(solutiontype) << " yet");
+ 			break;
+ 	}
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 13056)
+@@ -109,7 +109,7 @@
+ 			break;
+ 		
+ 		default:
+-			_error2_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
++			_error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
+ 			break;
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13056)
+@@ -52,7 +52,7 @@
+ 	/*Initialize environments: Petsc, MPI, etc...: */
+ 	#ifdef _HAVE_PETSC_
+ 	ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
+-	if(ierr) _error2_("Could not initialize Petsc");
++	if(ierr) _error_("Could not initialize Petsc");
+ 	#else
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Init(&argc,&argv);
+@@ -127,7 +127,7 @@
+ 		#ifdef _HAVE_DAKOTA_
+ 		Dakotax(femmodel);
+ 		#else
+-		_error2_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!");
++		_error_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!");
+ 		#endif
+ 	}
+ 	else if(control_analysis){
+@@ -137,7 +137,7 @@
+ 		else
+ 		 control_core(femmodel);
+ 		#else
+-		_error2_("ISSM was not compiled with control support, cannot carry out dakota analysis!");
++		_error_("ISSM was not compiled with control support, cannot carry out dakota analysis!");
+ 		#endif
+ 	}
+ 	else{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 13056)
+@@ -103,7 +103,7 @@
+ 				enthalpy_core(femmodel);
+ 			}
+ 			#else
+-			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
++			_error_("ISSM was not compiled with thermal capabilities. Exiting");
+ 			#endif
+ 		}
+ 		
+@@ -112,7 +112,7 @@
+ 			#ifdef _HAVE_DIAGNOSTIC_
+ 			diagnostic_core(femmodel);
+ 			#else
+-			_error2_("ISSM was not compiled with diagnostic capabilities. Exiting");
++			_error_("ISSM was not compiled with diagnostic capabilities. Exiting");
+ 			#endif
+ 		}
+ 
+@@ -128,7 +128,7 @@
+ 			#ifdef _HAVE_GROUNDINGLINE_
+ 			GroundinglineMigrationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+ 			#else
+-			_error2_("ISSM was not compiled with grounding line migration capabilities. Exiting");
++			_error_("ISSM was not compiled with grounding line migration capabilities. Exiting");
+ 			#endif
+ 		}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 13056)
+@@ -48,7 +48,7 @@
+ 		femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
+ 	}
+ 	else{
+-		_error2_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
++		_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+ 	}
+ 
+ 	/*update parameter according to scalar: */ //false means: do not save control
+@@ -65,7 +65,7 @@
+ 		solver_linear(femmodel); 
+ 	}
+ 	else{
+-		_error2_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
++		_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+ 	}
+ 
+ 	/*Compute misfit for this velocity field.*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13056)
+@@ -39,7 +39,7 @@
+ 	/*Initialize environments: Petsc, MPI, etc...: */
+ #ifdef _HAVE_PETSC_
+ 	int ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
+-	if(ierr) _error2_("Could not initialize Petsc");
++	if(ierr) _error_("Could not initialize Petsc");
+ #else
+ #ifdef _HAVE_MPI_
+ 	MPI_Init(&argc,&argv);
+@@ -121,7 +121,7 @@
+ 	char *outbinfilename = NULL;
+ 	char *lockfilename   = NULL;
+ 
+-	if(argc<2)_error2_("Usage error: missing model name");
++	if(argc<2)_error_("Usage error: missing model name");
+ 	modelname=argv[2];
+ 	binfilename    = xNew<char>((strlen(modelname)+strlen(".bin")   +1)); sprintf(binfilename,   "%s%s",modelname,".bin");
+ 	outbinfilename = xNew<char>((strlen(modelname)+strlen(".outbin")+1)); sprintf(outbinfilename,"%s%s",modelname,".outbin");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13056)
+@@ -41,7 +41,7 @@
+ 	int argc; char **args=NULL;
+ 	PetscGetArgs(&argc,&args);
+ 	ierr = TaoInitialize(&argc,&args,(char*)0,"");
+-	if(ierr) _error2_("Could not initialize Tao");
++	if(ierr) _error_("Could not initialize Tao");
+ 
+ 	/*Recover some parameters*/
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+@@ -74,7 +74,7 @@
+ 	xdelete(&XL);
+ 	xdelete(&XU);
+ 
+-	user.J=(double*)xcalloc((maxiter+5),sizeof(double));
++	user.J=xNewZeroInit<double>(maxiter+5);
+ 	user.femmodel=femmodel;
+ 	TaoSetObjectiveAndGradientRoutine(tao,FormFunctionGradient,(void*)&user); 
+ 
+@@ -184,6 +184,6 @@
+ 
+ #else
+ void controltao_core(FemModel* femmodel){
+-	_error2_("TAO not installed or PETSc version not supported");
++	_error_("TAO not installed or PETSc version not supported");
+ }
+ #endif //_HAVE_TAO_ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 13056)
+@@ -106,6 +106,8 @@
+ ENUM=0;
+ #Add header to pythonenum file{{{
+ cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.py
++from StringToEnum import StringToEnum
++
+ """
+ 
+    WARNING: DO NOT MODIFY THIS FILE
+@@ -165,7 +167,7 @@
+ 	      macro=$NAMEENUM()
+ 	"""
+ 
+-	return StringToEnum('$NAME')
++	return StringToEnum('$NAME')[0]
+ 
+ END
+ #}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 13056)
+@@ -26,7 +26,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"double")){
+-		_error2_("Value of option \"" << odouble->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error_("Value of option \"" << odouble->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	FetchData(&odouble->values,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]);
+ 
+@@ -44,7 +44,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"logical")){
+-		_error2_("Value of option \"" << ological->name  << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error_("Value of option \"" << ological->name  << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	FetchData(&ological->values,&ological->numel,&ological->ndims,&ological->size,prhs[0]);
+ 
+@@ -62,7 +62,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"char")){
+-		_error2_("Value of option \"" << ochar->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error_("Value of option \"" << ochar->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	FetchData(&ochar->values,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]);
+ 
+@@ -86,7 +86,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"struct")){
+-		_error2_("Value of option \"" << ostruct->name  << "\" must be class \"struct\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error_("Value of option \"" << ostruct->name  << "\" must be class \"struct\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 	ostruct->numel=mxGetNumberOfElements(prhs[0]);
+ 	ostruct->ndims=mxGetNumberOfDimensions(prhs[0]);
+@@ -132,7 +132,7 @@
+ 
+ 	/*check and parse the value  */
+ 	if (!mxIsClass(prhs[0],"cell")){
+-		_error2_("Value of option \"" << ocell->name  << "\" must be class \"cell\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
++		_error_("Value of option \"" << ocell->name  << "\" must be class \"cell\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 
+ 	ocell->numel=mxGetNumberOfElements(prhs[0]);
+@@ -180,7 +180,7 @@
+ 			option=(Option*)OptionStructParse(name,(const mxArray**)lhs);
+ 			mxDestroyArray(lhs[0]);
+ 		}
+-		else _error2_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\".");
++		else _error_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\".");
+ 	}
+ 
+ 	return(option);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp	(revision 13056)
+@@ -21,11 +21,11 @@
+ 		if (NRHS==0 && NLHS==0)return 1;
+ 		/* special case: */
+ 		function();
+-		_error2_("usage: see above");
++		_error_("usage: see above");
+ 	}
+ 	else if (nlhs!=NLHS || nrhs!=NRHS ) {
+ 		function(); 
+-		_error2_("usage error.");
++		_error_("usage error.");
+ 	}
+ 	return 1;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13056)
+@@ -47,7 +47,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -88,7 +88,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -133,7 +133,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -175,7 +175,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -237,7 +237,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -268,7 +268,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -300,7 +300,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -332,7 +332,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -364,7 +364,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -380,7 +380,7 @@
+ 
+ 	/*Ok, the string should be coming directly from the matlab workspace: */
+ 	if (!mxIsClass(dataref,"char")){
+-		_error2_("input data_type is not a string!");
++		_error_("input data_type is not a string!");
+ 	}
+ 	else{
+ 		/*Recover the string:*/
+@@ -415,7 +415,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 			
+ 	/*Assign output pointers:*/
+@@ -433,7 +433,7 @@
+ 	double scalar;
+ 
+ 	if (!mxIsClass(dataref,"double")){
+-		_error2_("input data_type is not a double!");
++		_error_("input data_type is not a double!");
+ 	}
+ 	else{
+ 		/*Recover the double: */
+@@ -450,7 +450,7 @@
+ 	int integer;
+ 
+ 	if (!mxIsClass(dataref,"double")){
+-		_error2_("input data_type is not a scalar!");
++		_error_("input data_type is not a scalar!");
+ 	}
+ 	else{
+ 		/*Recover the double: */
+@@ -467,12 +467,12 @@
+ 	bool* mxbool_ptr=NULL;
+ 
+ 	if (mxIsClass(dataref,"logical")){
+-		if(mxGetM(dataref)!=1) _error2_("input data is not of size 1x1");
+-		if(mxGetN(dataref)!=1) _error2_("input data is not of size 1x1");
++		if(mxGetM(dataref)!=1) _error_("input data is not of size 1x1");
++		if(mxGetN(dataref)!=1) _error_("input data is not of size 1x1");
+ 		mxbool_ptr=mxGetLogicals(dataref);
+ 	}
+ 	else{
+-		_error2_("input data_type is not a bool!");
++		_error_("input data_type is not a bool!");
+ 	}
+ 
+ 	*pboolean=*mxbool_ptr;
+@@ -494,7 +494,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -518,7 +518,7 @@
+ 	}
+ 	else{
+ 		/*This is an error: we don't have the correct input!: */
+-		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
++		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -619,10 +619,10 @@
+ 
+ 	/*Fetch all options*/
+ 	for (int i=istart; i<nrhs; i=i+2){
+-		if (!mxIsClass(pdataref[i],"char")) _error2_("Argument " << i+1 << " must be name of option");
++		if (!mxIsClass(pdataref[i],"char")) _error_("Argument " << i+1 << " must be name of option");
+ 
+ 		FetchData(&name,pdataref[i]);
+-		if(i+1 == nrhs) _error2_("Argument " << i+2 << " must exist and be value of option \"" << name << "\".");
++		if(i+1 == nrhs) _error_("Argument " << i+2 << " must exist and be value of option \"" << name << "\".");
+ 
+ 		option=(Option*)OptionParse(name,&pdataref[i+1]);
+ 		options->AddOption(option);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp	(revision 13056)
+@@ -45,7 +45,7 @@
+ 		nnz=mxGetNzmax(mxvector);
+ 		
+ 		/*Check that input is actualy a vector*/
+-		if (cols!=1) _error2_("input vector of size " << rows << "x" << cols << " should have only one column");
++		if (cols!=1) _error_("input vector of size " << rows << "x" << cols << " should have only one column");
+ 
+ 		nz=(int)((double)nnz/(double)rows);
+ 
+@@ -76,7 +76,7 @@
+ 		cols=mxGetN(mxvector);
+ 
+ 		/*Check that input is actualy a vector*/
+-		if (cols!=1) _error2_("input vector of size " << rows << "x" << cols << " should have only one column");
++		if (cols!=1) _error_("input vector of size " << rows << "x" << cols << " should have only one column");
+ 
+ 		/*allocate and memcpy*/
+ 		if(rows){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp	(revision 13056)
+@@ -118,7 +118,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("Matlab matrix type Not implemented yet");
++		_error_("Matlab matrix type Not implemented yet");
+ 	}
+ 
+ 	/*Assign output pointer: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13056)
+@@ -27,6 +27,7 @@
+ //void WriteData(PyObject* py_tuple,double scalar);
+ //void WriteData(DataHandle* py_tuple,Parameters* parameters);
+ void WriteData(PyObject* py_tuple, int index, double* matrix, int M,int N);
++void WriteData(PyObject* py_tuple, int index, int integer);
+ void WriteData(PyObject* py_tuple, int index, char* string);
+ void WriteData(PyObject* py_tuple, int index, Matrix* matrix);
+ void WriteData(PyObject* py_tuple, int index, Vector* vector);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp	(revision 13056)
+@@ -26,11 +26,11 @@
+ 	/*check on requested size: */
+ 	if (size==0){
+ 		function();
+-		_error2_("usage: see above");
++		_error_("usage: see above");
+ 	}
+ 	else if (size!=NRHS ) {
+ 		function(); 
+-		_error2_("usage error.");
++		_error_("usage error.");
+ 	}
+ 	return 1;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13056)
+@@ -47,7 +47,7 @@
+ 	bool boolean;
+ 	
+ 	/*check this is indeed a subtype of long type: */
+-	if(!PyBool_Check(py_boolean))_error2_("expecting a boolean in input!");
++	if(!PyBool_Check(py_boolean))_error_("expecting a boolean in input!");
+ 
+ 	/*extract boolean: */
+ 	boolean=(bool)PyLong_AsLong(py_boolean);
+@@ -68,7 +68,7 @@
+ 
+ 	/*retrive dimensions: */
+ 	ndim=PyArray_NDIM((const PyArrayObject*)py_matrix);
+-	if(ndim!=2)_error2_("expecting an MxN matrix in input!");
++	if(ndim!=2)_error_("expecting an MxN matrix in input!");
+ 	dims=PyArray_DIMS((PyArrayObject*)py_matrix);
+ 	M=dims[0]; N=dims[1];
+ 	
+@@ -96,7 +96,7 @@
+ 
+ 	/*retrive dimensions: */
+ 	ndim=PyArray_NDIM((const PyArrayObject*)py_matrix);
+-	if(ndim!=2)_error2_("expecting an MxN matrix in input!");
++	if(ndim!=2)_error_("expecting an MxN matrix in input!");
+ 	dims=PyArray_DIMS((PyArrayObject*)py_matrix);
+ 	M=dims[0]; N=dims[1];
+ 	
+@@ -124,7 +124,7 @@
+ 
+ 	/*retrive dimensions: */
+ 	ndim=PyArray_NDIM((const PyArrayObject*)py_vector);
+-	if(ndim!=1)_error2_("expecting an Mx1 vector in input!");
++	if(ndim!=1)_error_("expecting an Mx1 vector in input!");
+ 	dims=PyArray_DIMS((PyArrayObject*)py_vector);
+ 	M=dims[0]; 
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13056)
+@@ -20,6 +20,12 @@
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+ 
++/*FUNCTION WriteData(PyObject* py_tuple,int index,int integer){{{*/
++void WriteData(PyObject* py_tuple, int index, int integer){
++	
++	PyTuple_SetItem(py_tuple, index, PyInt_FromSsize_t(integer));
++
++}/*}}}*/
+ /*FUNCTION WriteData(PyObject* py_tuple,int index,char* string){{{*/
+ void WriteData(PyObject* py_tuple, int index, char* string){
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp	(revision 13056)
+@@ -64,7 +64,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{*/
+@@ -81,7 +81,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(IssmDouble* pscalar, int enum_type){{{*/
+@@ -98,7 +98,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(IssmDouble* pscalar, int enum_type,IssmDouble time){{{*/
+@@ -115,7 +115,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{*/
+@@ -132,7 +132,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -150,7 +150,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -168,7 +168,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -186,7 +186,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -204,7 +204,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -222,7 +222,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -240,7 +240,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ /*FUNCTION Parameters::FindParam(Vector** pvec,int enum_type){{{*/
+@@ -257,7 +257,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -275,7 +275,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ 
+ }
+ /*}}}*/
+@@ -293,7 +293,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error2_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13056)
+@@ -202,7 +202,7 @@
+ 
+ 		/*see what the first element of this partition has in stock (this is common to all partitions)*/
+ 		if(my_rank==minrank){
+-			if(this->Size()==0) _error2_("Cannot write results because there is no element??");
++			if(this->Size()==0) _error_("Cannot write results because there is no element??");
+ 			Element* element=(Element*)this->GetObjectByOffset(0);
+ 			element->ListResultsInfo(&resultsenums,&resultssizes,&resultstimes,&resultssteps,&numberofresults);
+ 		}
+@@ -231,7 +231,7 @@
+ 			/*Get vector for result number i*/
+ 			if(resultssizes[i]==P1Enum)      vectorsize=numberofvertices;
+ 			else if(resultssizes[i]==P0Enum) vectorsize=numberofelements;
+-			else _error2_("Unkown result size: " << EnumToStringx(resultssizes[i]));
++			else _error_("Unkown result size: " << EnumToStringx(resultssizes[i]));
+ 			vector=new Vector(vectorsize);
+ 
+ 			for(int j=0;j<this->Size();j++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13056)
+@@ -57,12 +57,12 @@
+ 	options->Get(&mintrimming,"mintrimming",-1.e+21);
+ 	options->Get(&maxtrimming,"maxtrimming",+1.e+21);
+ 	options->Get(&minspacing,"minspacing",0.01);
+-	if(minspacing<=0) _error2_("minspacing must > 0");
++	if(minspacing<=0) _error_("minspacing must > 0");
+ 
+ 	/*Get Minimum box size*/
+ 	if(options->GetOption("boxlength")){
+ 		options->Get(&minlength,"boxlength");
+-		if(minlength<=0)_error2_("boxlength should be a positive number");
++		if(minlength<=0)_error_("boxlength should be a positive number");
+ 		maxdepth=int(log(max(xmax-xmin,ymax-ymin)/minlength +1)/log(2.0));
+ 	}
+ 	else{
+@@ -382,7 +382,7 @@
+ 	SolverxSeq(&Ginv1, Gamma,ones,n_obs);   // Gamma^-1 ones
+ 	SolverxSeq(&GinvZ, Gamma,obs,n_obs);    // Gamma^-1 Z
+ #else
+-	_error2_("GSL is required");
++	_error_("GSL is required");
+ #endif
+ 
+ 	/*Prepare predictor*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Inputs.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Inputs.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Inputs.cpp	(revision 13056)
+@@ -56,7 +56,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -84,7 +84,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -112,7 +112,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -140,7 +140,7 @@
+ 	if (!found){
+ 		/*we could not find an input with the correct enum type. No defaults values were provided, 
+ 		 * error out: */
+-		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
++		_error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
+ 	}
+ 
+ 	/*Ok, we have an input if we made it here, request the input to return the value: */
+@@ -212,7 +212,7 @@
+ 	constrain_input=(Input*)this->GetInput(constrain_enum);
+ 
+ 	/*some checks: */
+-	if(!constrain_input) _error2_("input " << EnumToStringx(constrain_enum) << " could not be found!");
++	if(!constrain_input) _error_("input " << EnumToStringx(constrain_enum) << " could not be found!");
+ 
+ 	/*Apply ContrainMin: */
+ 	constrain_input->ConstrainMin(minimum);
+@@ -253,7 +253,7 @@
+ 		max=input->Max();
+ 	}
+ 	else{
+-		_error2_("Input " << EnumToStringx(enumtype) << " not found");
++		_error_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -274,7 +274,7 @@
+ 		max=input->MaxAbs();
+ 	}
+ 	else{
+-		_error2_("Input " << EnumToStringx(enumtype) << " not found");
++		_error_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -295,7 +295,7 @@
+ 		min=input->Min();
+ 	}
+ 	else{
+-		_error2_("Input " << EnumToStringx(enumtype) << " not found");
++		_error_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -316,7 +316,7 @@
+ 		min=input->MinAbs();
+ 	}
+ 	else{
+-		_error2_("Input " << EnumToStringx(enumtype) << " not found");
++		_error_("Input " << EnumToStringx(enumtype) << " not found");
+ 	}
+ 
+ 	/*Return output*/
+@@ -368,7 +368,7 @@
+ 
+ 	/*Make a copy of the original input: */
+ 	original=(Input*)this->GetInput(original_enum);
+-	if(!original)_error2_("could not find input with enum: " << EnumToStringx(original_enum)); 
++	if(!original)_error_("could not find input with enum: " << EnumToStringx(original_enum)); 
+ 	copy=(Input*)original->copy();
+ 
+ 	/*Change copy enum to reinitialized_enum: */
+@@ -415,8 +415,8 @@
+ 	yinput=(Input*)this->GetInput(MeshYEnum);
+ 
+ 	/*some checks: */
+-	if(!xinput) _error2_("input " << EnumToStringx(MeshXEnum) << " could not be found!");
+-	if(!yinput) _error2_("input " << EnumToStringx(MeshYEnum) << " could not be found!");
++	if(!xinput) _error_("input " << EnumToStringx(MeshXEnum) << " could not be found!");
++	if(!yinput) _error_("input " << EnumToStringx(MeshYEnum) << " could not be found!");
+ 
+ 	/*Apply AXPY: */
+ 	yinput->AXPY(xinput,scalar);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/DataSet.cpp	(revision 13056)
+@@ -132,7 +132,7 @@
+ 
+ 	vector<Object*>::iterator object;
+ 
+-	if(this==NULL)_error2_("trying to echo a NULL dataset");
++	if(this==NULL)_error_("trying to echo a NULL dataset");
+ 
+ 	_pprintLine_("DataSet echo: " << objects.size() << " objects");
+ 
+@@ -149,7 +149,7 @@
+ 
+ 	vector<Object*>::iterator object;
+ 
+-	if(this==NULL)_error2_("trying to echo a NULL dataset");
++	if(this==NULL)_error_("trying to echo a NULL dataset");
+ 
+ 	_pprintLine_("DataSet echo: " << objects.size() << " objects");
+ 
+@@ -193,11 +193,11 @@
+ 	int i;
+ 
+ 	_assert_(this);
+-	if(!sorted)_error2_("trying to binary search on a non-sorted dataset!");
++	if(!sorted)_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())){
+-		_error2_("could not find object with id " << eid << " in DataSet " << EnumToStringx(enum_type));
++		_error_("could not find object with id " << eid << " in DataSet " << EnumToStringx(enum_type));
+ 	}
+ 
+ 	/*Convert  the id offset into sorted offset: */
+@@ -258,7 +258,7 @@
+ 
+ 	/*Only sort if we are not already sorted: */
+ 	if(!sorted){
+-		_error2_("not implemented yet!");
++		_error_("not implemented yet!");
+ 	}
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp	(revision 13056)
+@@ -46,17 +46,17 @@
+ 	_assert_(in_option);
+ 
+ 	/*Also, check the option name*/
+-	if(!in_option->name) _error2_("input option has an empty name");
+-	if(strchr(in_option->name,'.')) _error2_("Option \"" << in_option->name << "\" has a protected character \".\"");
+-	if(strchr(in_option->name,'[')) _error2_("Option \"" << in_option->name << "\" has a protected character \"[\"");
+-	if(strchr(in_option->name,']')) _error2_("Option \"" << in_option->name << "\" has a protected character \"]\"");
++	if(!in_option->name) _error_("input option has an empty name");
++	if(strchr(in_option->name,'.')) _error_("Option \"" << in_option->name << "\" has a protected character \".\"");
++	if(strchr(in_option->name,'[')) _error_("Option \"" << in_option->name << "\" has a protected character \"[\"");
++	if(strchr(in_option->name,']')) _error_("Option \"" << in_option->name << "\" has a protected character \"]\"");
+ 
+ 	/*Finally, check that no option of the same name already exists in the dataset*/
+ 	for(object=objects.begin();object<objects.end();object++){
+ 
+ 		option=(Option*)(*object); 
+ 		if (!strcmp(option->name,in_option->name)){
+-			_error2_("Options \"" << in_option->name << "\" found multiple times");
++			_error_("Options \"" << in_option->name << "\" found multiple times");
+ 			break;
+ 		}
+ 	}
+@@ -82,7 +82,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -120,7 +120,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -158,7 +158,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -198,7 +198,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ 
+ }
+@@ -263,7 +263,7 @@
+ 		}
+ 		/*Else: not supported*/
+ 		else{
+-			_error2_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
++			_error_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
+ 		}
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+@@ -289,7 +289,7 @@
+ 	}
+ 	/*Else, the Option does not exist, no default provided*/
+ 	else{
+-		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
++		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+ 	}
+ }
+ /*}}}*/
+@@ -323,7 +323,7 @@
+ 				}
+ 				/*Else: not supported*/
+ 				else{
+-					_error2_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
++					_error_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
+ 				}
+ 			}
+ 		}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h	(revision 13056)
+@@ -22,25 +22,15 @@
+ /*Printing macro: only cpu number 0 */
+ #define _printf_(flag,...) do{if(flag) PrintfFunction(__VA_ARGS__);}while(0)
+ /*}}}*/
+-/* _error_ {{{*/
+-/*Error exception macro*/
+-#ifdef _INTEL_WIN_
+-#define _error_(...)\
+-  throw ErrorException(exprintf(__VA_ARGS__))
+-#else
+-#define _error_(...)\
+-  throw ErrorException(__FILE__,__func__,__LINE__,exprintf(__VA_ARGS__))
+-#endif
+-/*}}}*/
+ /* _error2_ {{{*/
+ /*new Error exception macro*/
+ #ifdef _INTEL_WIN_
+-#define _error2_(StreamArgs)\
++#define _error_(StreamArgs)\
+    do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+    aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
+    throw ErrorException(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+ #else
+-#define _error2_(StreamArgs)\
++#define _error_(StreamArgs)\
+ 	do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+    aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
+    throw ErrorException(__FILE__,__func__,__LINE__,aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+@@ -74,7 +64,7 @@
+ /*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/
+ #ifdef _ISSM_DEBUG_ 
+ #define _assert_(statement)\
+-  if (!(statement)) _error_("Assertion \"%s\" failed, please report bug to %s",#statement,PACKAGE_BUGREPORT)
++  if (!(statement)) _error_("Assertion \""<<#statement<<"\" failed, please report bug to "<<PACKAGE_BUGREPORT)
+ #else
+ #define _assert_(ignore)\
+   ((void) 0)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 13056)
+@@ -35,26 +35,26 @@
+ 
+ 	if (!itrnb) {
+ 		if (nrowb != idimb) {
+-			_error2_("Matrix A and B inner vectors not equal size.");
++			_error_("Matrix A and B inner vectors not equal size.");
+ 		}
+ 		idimc=ncolb;
+ 	}
+ 	else {
+ 		if (ncolb != idimb) {
+-			_error2_("Matrix A and B inner vectors not equal size.");
++			_error_("Matrix A and B inner vectors not equal size.");
+ 		}
+ 		idimc=nrowb;
+ 	}
+ 
+ 	if (!itrnc) {
+ 		if (nrowc != idimc) {
+-			_error2_("Matrix B and C inner vectors not equal size.");
++			_error_("Matrix B and C inner vectors not equal size.");
+ 		}
+ 		idimd=ncolc;
+ 	}
+ 	else {
+ 		if (ncolc != idimc) {
+-			_error2_("Matrix B and C inner vectors not equal size.");
++			_error_("Matrix B and C inner vectors not equal size.");
+ 		}
+ 		idimd=nrowc;
+ 	}
+@@ -123,7 +123,7 @@
+ 	}
+ 
+ 	if (ntrma != ntrmb) {
+-		_error2_("Matrix A and B inner vectors not equal size");
++		_error_("Matrix A and B inner vectors not equal size");
+ 	    noerr=0;	
+ 		return noerr;
+ 	}
+@@ -174,7 +174,7 @@
+ 	IssmDouble pivot,det,dtemp;
+ 
+ 	if (!b && nvec) {
+-		_error2_("No right-hand side for nvec=" << nvec << ".");
++		_error_("No right-hand side for nvec=" << nvec << ".");
+ 		noerr=0;
+ 		return noerr;
+ 	}
+@@ -213,7 +213,7 @@
+ 			xDelete<int>(pivrc1);
+ 			xDelete<int>(pivrc2);
+ 			xDelete<int>(pindx);
+-			_error2_("Pivot " << pivot << " less than machine epsilon");
++			_error_("Pivot " << pivot << " less than machine epsilon");
+ 			noerr=0;
+ 			return noerr;
+ 		}
+@@ -348,7 +348,7 @@
+ 
+ 	/*Compute determinant*/
+ 	Matrix2x2Determinant(&det,A);
+-	if (fabs(det) < DBL_EPSILON) _error2_("Determinant smaller that machine epsilon");
++	if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller that machine epsilon");
+ 
+ 	/*Compute invert*/
+ 	Ainv[0]=   A[3]/det; /* =  d/det */
+@@ -373,7 +373,7 @@
+ 
+ 	/*Compute determinant*/
+ 	Matrix3x3Determinant(&det,A);
+-	if (fabs(det) < DBL_EPSILON) _error2_("Determinant smaller that machine epsilon");
++	if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller that machine epsilon");
+ 
+ 	/*Compute invert*/
+ 	Ainv[0]=(A[4]*A[8]-A[5]*A[7])/det; /* = (e*i-f*h)/det */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 13056)
+@@ -43,14 +43,14 @@
+ 	/*initialize counter and get response at the boundaries*/
+ 	iter=0;
+ 	fxmin = (*f)(xmin,optargs);
+-	if (xIsNan<IssmDouble>(fxmin)) _error2_("Function evaluation returned NaN");
++	if (xIsNan<IssmDouble>(fxmin)) _error_("Function evaluation returned NaN");
+ 	cout<<setprecision(5);
+ 	if(VerboseControl()) _pprintLine_("");
+ 	if(VerboseControl()) _pprintLine_("       Iteration         x           f(x)       Tolerance         Procedure");
+ 	if(VerboseControl()) _pprintLine_("");
+ 	if(VerboseControl()) _pprintLine_("           N/A    "<<setw(12)<<xmin<<"  "<<setw(12)<<fxmin<<"           N/A         boundary");
+ 	fxmax = (*f)(xmax,optargs);
+-	if (xIsNan<IssmDouble>(fxmax)) _error2_("Function evaluation returned NaN");
++	if (xIsNan<IssmDouble>(fxmax)) _error_("Function evaluation returned NaN");
+ 	if(VerboseControl()) _pprintLine_("           N/A    "<<setw(12)<<xmax<<"  "<<setw(12)<<fxmax<<"           N/A         boundary");
+ 
+ 	/*test if jump option activated and xmin==0*/
+@@ -74,7 +74,7 @@
+ 
+ 	/*2: call the function to be evaluated*/
+ 	fxbest = (*f)(x,optargs);
+-	if(xIsNan<IssmDouble>(fxbest)) _error2_("Function evaluation returned NaN");
++	if(xIsNan<IssmDouble>(fxbest)) _error_("Function evaluation returned NaN");
+ 	iter=iter+1;
+ 
+ 	/*3: update the other variables*/
+@@ -158,7 +158,7 @@
+ 
+ 		//evaluate function on x
+ 		fx = (*f)(x,optargs);
+-		if(xIsNan<IssmDouble>(fx)) _error2_("Function evaluation returned NaN");
++		if(xIsNan<IssmDouble>(fx)) _error_("Function evaluation returned NaN");
+ 		iter=iter+1;
+ 
+ 		// Update a, b, xm, x1, x2, tol1, tol2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 13056)
+@@ -1669,7 +1669,7 @@
+ 		} while (iter < MAX_GAUS_ITER);
+ 		if (iter >= MAX_GAUS_ITER) {
+ 			xDelete<IssmPDouble>(work);
+-			_error2_("Max iterations exceeded for l=" << MAX_GAUS_ITER);
++			_error_("Max iterations exceeded for l=" << MAX_GAUS_ITER);
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp	(revision 13056)
+@@ -56,7 +56,7 @@
+ 	}
+ 	if (found==-1){
+ 		/*ok, we did not find anything, this is not good! error out: */
+-		_error2_("could find neither a default analysis  nor analysis " << EnumToStringx(analysis_type));
++		_error_("could find neither a default analysis  nor analysis " << EnumToStringx(analysis_type));
+ 	}
+ 
+ 	/*ok, grab the option string: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 13056)
+@@ -28,7 +28,7 @@
+ 	/*Now, which direction are we going? once determined, use scale factor: */
+ 	if(direction_enum==IuToExtEnum) for(i=0;i<numvalues;i++)values[i]=values[i]*scale; 
+ 	else if(direction_enum==ExtToIuEnum) for(i=0;i<numvalues;i++)values[i]=values[i]/scale; 
+-	else _error2_("wrong direction for unit conversion, either IuToExtEnum or ExtToIuEnum. ");
++	else _error_("wrong direction for unit conversion, either IuToExtEnum or ExtToIuEnum. ");
+ 
+ }
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp	(revision 13056)
+@@ -33,7 +33,7 @@
+ /*FUNCTION SetVerbosityLevel {{{*/
+ void SetVerbosityLevel(int level){
+ 
+-	if(level<0) _error2_("vebosity level should be a positive integer (user provided " << level << ")");
++	if(level<0) _error_("vebosity level should be a positive integer (user provided " << level << ")");
+ 
+ 	verbositylevel = level;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp	(revision 13056)
+@@ -52,7 +52,7 @@
+ 		if(reCast<bool>(nu))eps=ndu/nu;
+ 		else eps=0;
+ 	}
+-	else _error2_("convergence criterion " << EnumToStringx(criterion_enum) << " not supported yet!");
++	else _error_("convergence criterion " << EnumToStringx(criterion_enum) << " not supported yet!");
+ 
+ 	/*Assign output pointers:*/
+ 	*peps=eps;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 13056)
+@@ -40,7 +40,7 @@
+ 	
+ 	//get the value of the function at the first boundary
+ 	fx1= (*f)(x1,optargs);
+-	if (xIsNan<IssmDouble>(fx1)) _error2_("Function evaluation returned NaN");
++	if (xIsNan<IssmDouble>(fx1)) _error_("Function evaluation returned NaN");
+ 	cout<<setprecision(5);
+ 	if(VerboseControl()) _pprintLine_("");
+ 	if(VerboseControl()) _pprintLine_("       Iteration         x           f(x)       Tolerance");
+@@ -56,7 +56,7 @@
+ 		/*get f(x2)*/
+ 		iter++;
+ 		fx2 = (*f)(x2,optargs);
+-		if (xIsNan<IssmDouble>(fx2)) _error2_("Function evaluation returned NaN");
++		if (xIsNan<IssmDouble>(fx2)) _error_("Function evaluation returned NaN");
+ 		if(VerboseControl())
+ 		 _pprintLine_("         "<<setw(5)<<iter<<"    "<<setw(12)<<x2<<"  "<<setw(12)<<fx2<<"  "<<(fabs(x2-x1)>fabs(fx2-fx1)?fabs(fx2-fx1):fabs(x2-x1)));
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/String/DescriptorIndex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/String/DescriptorIndex.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/String/DescriptorIndex.cpp	(revision 13056)
+@@ -22,12 +22,12 @@
+ 
+ 	/*retrieve first token, separated by underscore: */
+ 	pch = strtok (descriptor,"_");
+-	if(!pch)_error2_("descriptor " << descriptor << " is not correctly formatted!");
++	if(!pch)_error_("descriptor " << descriptor << " is not correctly formatted!");
+ 
+ 	if (strncmp(pch,"scaled",6)==0){
+ 		/*we have a scaled variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("scaled descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("scaled descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 
+ 		/*now recover  the index if it exists: */
+@@ -43,22 +43,22 @@
+ 	else if (strncmp(pch,"indexed",7)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return IndexedEnum;
+ 	}
+ 	else if (strncmp(pch,"nodal",5)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return NodalEnum;
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13056)
+@@ -30,11 +30,11 @@
+ 
+ 	void* memptr=NULL;
+ 
+-	if(!size)_error2_("attempting to 0 size allocation!");
++	if(!size)_error_("attempting to 0 size allocation!");
+ 
+ 	/* Use the c library to do the allocation: */
+ 	memptr=malloc(size);
+-	if(!memptr) _error2_("memory allocation failed!");
++	if(!memptr) _error_("memory allocation failed!");
+ 
+ 	return memptr;
+ }
+@@ -43,11 +43,11 @@
+ 
+ 	void* memptr=NULL;
+ 	
+-	if(!size)_error2_("attempting to 0 size allocation!");
++	if(!size)_error_("attempting to 0 size allocation!");
+ 
+ 	/* Use the c library to do the allocation: */
+ 	memptr=calloc(n,size);
+-	if(!memptr) _error2_("memory allocation failed!");
++	if(!memptr) _error_("memory allocation failed!");
+ 
+ 	return memptr;
+ }
+@@ -87,11 +87,11 @@
+ 	
+ 	register void* value=NULL;
+ 	
+-	if(!size)_error2_("attempting to realloc to zero");
++	if(!size)_error_("attempting to realloc to zero");
+ 	value = (void*)realloc(pv,size);
+ 
+ 	if (value == NULL) {
+-		_error2_("virtual memory exhausted");
++		_error_("virtual memory exhausted");
+ 	}
+ 	return value;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Threads/LaunchThread.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Threads/LaunchThread.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Threads/LaunchThread.cpp	(revision 13056)
+@@ -43,12 +43,12 @@
+ 	for(i=0;i<num_threads;i++){
+ 
+ 		if(pthread_create(threads+i,NULL,function,(void*)(handles+i))){
+-			_error2_("pthread_create error");
++			_error_("pthread_create error");
+ 		}
+ 	}
+ 	for(i=0;i<num_threads;i++){
+ 		if(pthread_join(threads[i],(void**)&status)){
+-			_error2_("pthread_join error");
++			_error_("pthread_join error");
+ 		}
+ 	}
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp	(revision 13056)
+@@ -30,7 +30,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp	(revision 13056)
+@@ -29,7 +29,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp	(revision 13056)
+@@ -21,7 +21,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+@@ -66,7 +66,7 @@
+ 				counter+=4;
+ 				break;
+ 			default:
+-				_error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++				_error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp	(revision 13056)
+@@ -30,7 +30,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp	(revision 13056)
+@@ -30,7 +30,7 @@
+ 		switch(cs_array[i]){
+ 			case XYEnum:   numdofs+=2; break;
+ 			case XYZPEnum: numdofs+=4; break;
+-			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 13056)
+@@ -22,7 +22,7 @@
+ 
+ 	/*open domain outline file for writing: */
+ 	if ((fid=fopen(domainname,"w"))==NULL){
+-		_error2_("could not open domain file " << domainname); 
++		_error_("could not open domain file " << domainname); 
+ 		noerr=0; goto cleanupandreturn;
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 13056)
+@@ -38,7 +38,7 @@
+ 
+ 	/*open domain outline file for reading: */
+ 	if ((fid=fopen(domainname,"r"))==NULL){
+-		_error2_("could not find domain file " << domainname); 
++		_error_("could not find domain file " << domainname); 
+ 	}
+ 
+ 	/*Do a first pass through the domainname file, to figure out how many profiles 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfopen.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfopen.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfopen.cpp	(revision 13056)
+@@ -19,7 +19,7 @@
+ 	
+ 	/*Open handle to data on disk: */
+ 	fid=fopen(filename,format);
+-	if(fid==NULL) _error2_("could not open file " << filename << " for binary reading or writing"); 
++	if(fid==NULL) _error_("could not open file " << filename << " for binary reading or writing"); 
+ 
+ 	return fid;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfclose.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfclose.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/pfclose.cpp	(revision 13056)
+@@ -17,5 +17,5 @@
+ 	/*Close file handle: */
+ 	extern int my_rank;
+ 	_assert_(fid);
+-	if(fclose(fid)!=0)_error2_("could not close file " << filename);
++	if(fclose(fid)!=0)_error_("could not close file " << filename);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13056)
+@@ -39,7 +39,7 @@
+ 
+ 	/*some checks*/
+ 	if (nels_data<1 || nods_data<3 || nods_prime==0){
+-		_error2_("nothing to be done according to the mesh given in input");
++		_error_("nothing to be done according to the mesh given in input");
+ 	}
+ 
+ 	/*Set debug to 1 if there are lots of elements*/
+@@ -53,11 +53,11 @@
+ 		interpolation_type=2;
+ 	}
+ 	else{
+-		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
++		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+ 	}
+ 
+ 	if((numcontours) && (interpolation_type==2)){
+-		_error2_("element interpolation_type with contours not supported yet!");
++		_error_("element interpolation_type with contours not supported yet!");
+ 	}
+ 
+ 	/*Get prime mesh extrema coordinates*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13056)
+@@ -490,5 +490,5 @@
+          else stage=5;
+    }
+ 	/*If we reach this point, the string provided has not been found*/
+-	_error2_("Enum " << name << " not found");
++	_error_("Enum " << name << " not found");
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 13056)
+@@ -48,9 +48,9 @@
+ 		case MaterialsRheologyBbarEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,MaterialsRheologyBbarEnum,process_units); break;
+ 		case VelEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,VelEnum,process_units); break;
+ 		case FrictionCoefficientEnum:NodalValuex(responses, FrictionCoefficientEnum,elements,nodes, vertices, loads, materials, parameters,process_units); break;
+-		default: _error2_("response descriptor \"" << response_descriptor << "\" not supported yet!"); break;
++		default: _error_("response descriptor \"" << response_descriptor << "\" not supported yet!"); break;
+ 		#else
+-		default: _error2_("ISSM was not compiled with responses capabilities, exiting!");
++		default: _error_("ISSM was not compiled with responses capabilities, exiting!");
+ 		#endif
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 13056)
+@@ -34,7 +34,7 @@
+ 
+ 	/*Checks*/
+ 	if (M_data!=nods_data && M_data!=nels_data){
+-		_error2_("data provided should have either " << nods_data << " or " << nels_data << " lines (not " << M_data << ")");
++		_error_("data provided should have either " << nods_data << " or " << nels_data << " lines (not " << M_data << ")");
+ 	}
+ 
+ 	/*Get default*/
+@@ -137,7 +137,7 @@
+ 		else{
+ 			for (j=0;j<N_data;j++){
+ 				if (it<0 || it>=nels_data){
+-					_error2_("Triangle number " << it << " not in [0 " << nels_data << "], report bug to developers");
++					_error_("Triangle number " << it << " not in [0 " << nels_data << "], report bug to developers");
+ 				}
+ 				data_interp[i*N_data+j]=data[N_data*it+j];
+ 			}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 13056)
+@@ -52,7 +52,7 @@
+ 	double  cde,re,ex2,ex;
+ 	double  sl,rho,cm,T,chi;
+ 
+-	if((sgn!=1) && (sgn!=-1)) _error2_("Sign should be either +1 or -1.\n");
++	if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n");
+ 
+ 	delta = central_meridian;
+ 	slat  = standard_parallel;
+@@ -130,7 +130,7 @@
+ 		*pslat = 71;
+ 		if(flag) _pprintLine_("Warning: expecting coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).");
+ 	}
+-	else _error2_("Sign should be either +1 or -1.\n");
++	else _error_("Sign should be either +1 or -1.\n");
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp	(revision 13056)
+@@ -29,7 +29,7 @@
+ 
+ 	/*some checks*/
+ 	if (nels<1 || nods<3 || nlines<1 || ncols<1 || xposting==0 || yposting==0){
+-		_error2_("nothing to be done according to the mesh given in input");
++		_error_("nothing to be done according to the mesh given in input");
+ 	}
+ 
+ 	/*figure out what kind of interpolation is needed*/
+@@ -40,7 +40,7 @@
+ 		interpolation_type=2;
+ 	}
+ 	else{
+-		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
++		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+ 	}
+ 
+ 	/*First, allocate pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 13056)
+@@ -26,7 +26,7 @@
+ 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 
+ 	if(migration_style==NoneEnum) return;
+-	if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error2_(EnumToStringx(migration_style) << " not supported yet!");
++	if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error_(EnumToStringx(migration_style) << " not supported yet!");
+ 
+ 	if(migration_style==SoftMigrationEnum){
+ 		/*Create flag for grounded vertices above the hydrostatic equilibrium: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp	(revision 13056)
+@@ -71,7 +71,7 @@
+ 	#ifdef _HAVE_CONTROL_
+ 	if(control_analysis)solutioncore=&control_core;
+ 	#else
+-	_error2_("ISSM was not compiled with control capabilities, exiting!");
++	_error_("ISSM was not compiled with control capabilities, exiting!");
+ 	#endif
+ 
+ 	/*Run the core solution sequence: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp	(revision 13056)
+@@ -22,12 +22,12 @@
+ 
+ 	/*retrieve first token, separated by underscore: */
+ 	pch = strtok (descriptor,"_");
+-	if(!pch)_error2_("descriptor " << descriptor << " is not correctly formatted!");
++	if(!pch)_error_("descriptor " << descriptor << " is not correctly formatted!");
+ 
+ 	if (strncmp(pch,"scaled",6)==0){
+ 		/*we have a scaled variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("scaled descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("scaled descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 
+ 		/*now recover  the index if it exists: */
+@@ -43,22 +43,22 @@
+ 	else if (strncmp(pch,"indexed",7)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("indexed descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return IndexedEnum;
+ 	}
+ 	else if (strncmp(pch,"nodal",5)==0){
+ 		/*we have an indexed variable. recover the root: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
+ 		/*now recover  the index: */
+ 		pch = strtok (NULL, "_");
+-		if(!pch)_error2_("nodal descriptor " << descriptor << " is not correctly formatted!");
++		if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!");
+ 		sscanf(pch,"%i",pindex);
+ 		return NodalEnum;
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 13056)
+@@ -25,7 +25,7 @@
+ 
+ 	/*Get size of vector: */
+ 	gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
+-	if (gsize==0) _error2_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));
++	if (gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));
+ 	
+ 	/*Initialize solution: */
+ 	solution=new Vector(gsize);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp	(revision 13056)
+@@ -37,7 +37,7 @@
+ 
+ 	if(    (edge1==IntersectEnum) && (edge2==IntersectEnum) && (edge3==IntersectEnum)   ){
+ 		/*This case is impossible: */
+-		_error2_("error: a line cannot go through 3 different vertices!");
++		_error_("error: a line cannot go through 3 different vertices!");
+ 	}
+ 	else if(    ((edge1==IntersectEnum) && (edge2==IntersectEnum)) || ((edge2==IntersectEnum) && (edge3==IntersectEnum)) || ((edge3==IntersectEnum) && (edge1==IntersectEnum))   ){
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 13056)
+@@ -38,7 +38,7 @@
+ 	/*Broadcast whether we found the element: */
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+-	if(!sumfound)_error2_("could not find material with id" << index << " to compute ElementResponse");
++	if(!sumfound)_error_("could not find material with id" << index << " to compute ElementResponse");
+ 	#endif
+ 
+ 	/*Ok, we found the element, compute responseocity: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 13056)
+@@ -29,7 +29,7 @@
+ 	/*Do we have penalties linked to rifts? In this case, run our special rifts penalty 
+ 	 * management routine, otherwise, skip : */
+ 	if (RiftIsPresent(loads,analysis_type)){
+-		_error2_("rift constraints reset not supported yet!");
++		_error_("rift constraints reset not supported yet!");
+ 	}
+ 	else if(ThermalIsPresent(loads,analysis_type)){
+ 		ThermalConstraintsReset(loads,analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 13056)
+@@ -94,10 +94,10 @@
+ 			xDelete<double>(distributed_values);
+ 		}
+ 		else if (strncmp(descriptor,"indexed_",8)==0){
+-			_error2_("indexed variables not supported yet!");
++			_error_("indexed variables not supported yet!");
+ 		}
+ 		else if (strncmp(descriptor,"nodal_",8)==0){
+-			_error2_("nodal variables not supported yet!");
++			_error_("nodal variables not supported yet!");
+ 		}
+ 		else{
+ 			/*Ok, standard variable, just update inputs using the variable: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 13056)
+@@ -51,7 +51,7 @@
+ 	double  latitude,longitude;
+ 	double  T,rho,sl,tc,mc;
+ 
+-	if((sgn!=1) && (sgn!=-1)) _error2_("Sign should be either +1 or -1.\n");
++	if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n");
+ 
+ 	delta = central_meridian;
+ 	slat  = standard_parallel;
+@@ -122,7 +122,7 @@
+ 		*pslat = 71;
+ 		if(flag) _pprintLine_("Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).");
+ 	}
+-	else _error2_("Sign should be either +1 or -1.\n");
++	else _error_("Sign should be either +1 or -1.\n");
+ 
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 13056)
+@@ -54,7 +54,7 @@
+ 	/*read exp file  */
+ 
+ 	if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp))
+-		_error2_("Error reading exp file.");
++		_error_("Error reading exp file.");
+ 	_pprintLine_("Exp2Kmlx -- Reading " << nprof << " exp profiles from file \"" << filexp << "\".");
+ //	for (i=0; i<nprof; i++)
+ //		_printLine_("i=" << i << "; nvert=" << pnvert[i] << ", closed=" << closed[i]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp	(revision 13056)
+@@ -43,7 +43,7 @@
+ 
+ 	fidi=fopen(filkml,"r");
+ 	if (!(kobj=KMLFileReadx(fidi)))
+-		_error2_("Error reading kml file.");
++		_error_("Error reading kml file.");
+ 	fclose(fidi);
+ 
+ /*  open exp file  */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 13056)
+@@ -50,7 +50,7 @@
+ 			for (i=0;i<numberofelements;i++) epart[i]=0;
+ 			for (i=0;i<numberofnodes;i++)    npart[i]=0;
+ 		}
+-		else _error2_("At least one processor is required");
++		else _error_("At least one processor is required");
+ 	}
+ 	else{
+ 		/*We have a 3d mesh, made of a regularly extruded 2d mesh. We first partition the 2d mesh, then we extrude the partition: */
+@@ -77,7 +77,7 @@
+ 			for (i=0;i<numberofelements2d;i++) epart2d[i]=0;
+ 			for (i=0;i<numberofnodes2d;i++)    npart2d[i]=0;
+ 		}
+-		else _error2_("At least one processor is required");
++		else _error_("At least one processor is required");
+ 
+ 		/*Extrude epart2d to epart, using numlayers: */
+ 		epart=xNew<int>(numberofelements);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 13056)
+@@ -31,7 +31,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("vector type: " << EnumToStringx(type) << " not supported yet!");
++		_error_("vector type: " << EnumToStringx(type) << " not supported yet!");
+ 	}
+ 
+ 	vector->Assemble();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 13056)
+@@ -137,7 +137,7 @@
+ 		xDelete<double>(gate.percent);
+ 	}
+ 	else{
+-		_error2_("output '" << output << "' not supported yet");
++		_error_("output '" << output << "' not supported yet");
+ 	}
+ 
+ 	/*clean-up and Assign output pointer*/
+@@ -304,7 +304,7 @@
+ 		else if(strcmp(model,"exponential")==0) variogram = new ExponentialVariogram(options);
+ 		else if(strcmp(model,"spherical")==0)   variogram = new SphericalVariogram(options);
+ 		else if(strcmp(model,"power")==0)       variogram = new PowerVariogram(options);
+-		else _error2_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
++		else _error_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
+ 	}
+ 	else variogram = new GaussianVariogram(options);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13056)
+@@ -102,7 +102,7 @@
+ #endif
+ 	}
+ 	else{
+-		_error2_("output '" << output << "' not supported yet");
++		_error_("output '" << output << "' not supported yet");
+ 	}
+ 
+ 	/*clean-up and Assign output pointer*/
+@@ -125,7 +125,7 @@
+ 		else if(strcmp(model,"exponential")==0) variogram = new ExponentialVariogram(options);
+ 		else if(strcmp(model,"spherical")==0)   variogram = new SphericalVariogram(options);
+ 		else if(strcmp(model,"power")==0)       variogram = new PowerVariogram(options);
+-		else _error2_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
++		else _error_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
+ 	}
+ 	else variogram = new GaussianVariogram(options);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 13056)
+@@ -37,7 +37,7 @@
+ 	/*Broadcast whether we found the element: */
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+-	if(!sumfound)_error2_("could not find element with vertex with id" << index << " to compute nodal value " << EnumToStringx(natureofdataenum));
++	if(!sumfound)_error_("could not find element with vertex with id" << index << " to compute nodal value " << EnumToStringx(natureofdataenum));
+ 	#endif
+ 
+ 	/*Broadcast and plug into response: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 13056)
+@@ -47,7 +47,7 @@
+ 			case VyEnum:   iomodel->FetchData(1,VyEnum); break;
+ 			case FrictionCoefficientEnum: iomodel->FetchData(1,FrictionCoefficientEnum); break;
+ 			case MaterialsRheologyBbarEnum:    iomodel->FetchData(1,MaterialsRheologyBEnum); break;
+-			default: _error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
++			default: _error_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 13056)
+@@ -102,7 +102,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("not implemented yet");
++		_error_("not implemented yet");
+ 	}
+ 
+ 	/*Second: add all missing nodes*/
+@@ -110,7 +110,7 @@
+ 	/*Get edges and elements*/
+ 	iomodel->FetchData(&edges,&numberofedges,&cols,MeshEdgesEnum);
+ 	iomodel->FetchData(&elements,NULL,NULL,MeshElementsEnum);
+-	if (cols!=4) _error2_("field edges should have 4 columns");
++	if (cols!=4) _error_("field edges should have 4 columns");
+ 
+ 	/*!All elements have been partitioned above, only create elements for this CPU: */
+ 	for (i=0;i<numberofedges;i++){
+@@ -151,7 +151,7 @@
+ 				my_nodes[e2*3+1]=true;
+ 			}
+ 			else{
+-				_error2_("Problem in edges creation");
++				_error_("Problem in edges creation");
+ 			}
+ 		}
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 13056)
+@@ -105,7 +105,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("Size of field " << EnumToStringx(ThermalSpctemperatureEnum) << " not supported");
++		_error_("Size of field " << EnumToStringx(ThermalSpctemperatureEnum) << " not supported");
+ 	}
+ 
+ 	/*Free ressources:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 13056)
+@@ -45,7 +45,7 @@
+ 	NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
+ 
+ 	/*Check in 3d*/
+-	if(stabilization==3 && dim==3) _error2_("DG 3d not implemented yet");
++	if(stabilization==3 && dim==3) _error_("DG 3d not implemented yet");
+ 
+ 	/*First fetch data: */
+ 	iomodel->FetchData(7,MeshElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 13056)
+@@ -63,7 +63,7 @@
+ 			doftype[4]=StokesApproximationEnum;
+ 			doftype[5]=StokesApproximationEnum;
+ 		}
+-		else _error2_("Approximationtype " << reCast<int>(*vertices_type) << " (" << EnumToStringx(reCast<int>(*vertices_type)) << ") not implemented yet for DiagnosticHoriz");
++		else _error_("Approximationtype " << reCast<int>(*vertices_type) << " (" << EnumToStringx(reCast<int>(*vertices_type)) << ") not implemented yet for DiagnosticHoriz");
+ 	}
+ 	else if (analysis_type==DiagnosticVertAnalysisEnum){
+ 		numdofs=1;
+@@ -92,7 +92,7 @@
+ 	else if (analysis_type==BalancethicknessAnalysisEnum){
+ 		numdofs=1;
+ 	}
+-	else _error2_("analysis type: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not implemented yet");
++	else _error_("analysis type: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not implemented yet");
+ 
+ 	/*Now initialize the index*/
+ 	index->Init(numdofs,doftype);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 13056)
+@@ -32,7 +32,7 @@
+ 	if(!loads) loads = new Loads();
+ 
+ 	/*return if 2d mesh*/
+-	if (dim==2) _error2_("2d meshes not supported yet");
++	if (dim==2) _error_("2d meshes not supported yet");
+ 
+ 	//create penalties for nodes: no node can have a temperature over the melting point
+ 	iomodel->FetchData(2,ThermalSpctemperatureEnum,MeshElementsEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 13056)
+@@ -25,7 +25,7 @@
+ 	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
+ 
+ 	/*if 2d: Error*/
+-	if (dim==2) _error2_("2d meshes not supported yet");
++	if (dim==2) _error_("2d meshes not supported yet");
+ 
+ 	/*Recover pointer: */
+ 	loads=*ploads;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13056)
+@@ -145,7 +145,7 @@
+ 						}
+ 
+ 					}
+-					else _error2_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal");
++					else _error_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal");
+ 			}
+ 			/*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/
+ 			else if ((int)vertices_type[i]==PattynStokesApproximationEnum){
+@@ -185,7 +185,7 @@
+ 							count++;
+ 						}
+ 					}
+-					else _error2_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes");
++					else _error_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes");
+ 			}
+ 			/*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/
+ 			else if ((int)vertices_type[i]==MacAyealStokesApproximationEnum){
+@@ -225,7 +225,7 @@
+ 							count++;
+ 						}
+ 					}
+-					else _error2_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes");
++					else _error_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes");
+ 			}
+ 			/*Now add the regular spcs*/
+ 			else{
+@@ -318,7 +318,7 @@
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0.,DiagnosticHorizAnalysisEnum));
+ 						count++;
+ 						break;
+-					default: _error2_("Vertex approximation " << EnumToStringx((int)vertices_type[i]) << " not supported");
++					default: _error_("Vertex approximation " << EnumToStringx((int)vertices_type[i]) << " not supported");
+ 				}
+ 			}
+ 		}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 13056)
+@@ -45,7 +45,7 @@
+ 	NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
+ 
+ 	/*Check in 3d*/
+-	if(stabilization==3 && dim==3) _error2_("DG 3d not implemented yet");
++	if(stabilization==3 && dim==3) _error_("DG 3d not implemented yet");
+ 
+ 	/*First fetch data: */
+ 	iomodel->FetchData(7,MeshElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 13056)
+@@ -152,7 +152,7 @@
+ 			
+ 			/*Fetch the mass flux segments necessary to compute the mass fluxes.  Build a DoubleMatArrayParam object out of them: */ 
+ 			iomodel->FetchData(&array,&mdims_array,&ndims_array,&qmu_mass_flux_num_profiles,QmuMassFluxSegmentsEnum);
+-			if(qmu_mass_flux_num_profiles==0)_error2_("qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!");
++			if(qmu_mass_flux_num_profiles==0)_error_("qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!");
+ 
+ 			/*Go through segments, and extract those that belong to this cpu: */
+ 			for(i=0;i<qmu_mass_flux_num_profiles;i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 13056)
+@@ -123,7 +123,7 @@
+ 
+ 
+ 		default:
+-			_error2_("analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!");
++			_error_("analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!");
+ 	}
+ 
+ 	/*Update Elements and Materials For Control methods*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13056)
+@@ -26,7 +26,7 @@
+ 
+ 	/*some checks*/
+ 	if (nels_data<1 || nods_data<6 || nods_prime==0){
+-		_error2_("nothing to be done according to the mesh given in input");
++		_error_("nothing to be done according to the mesh given in input");
+ 	}
+ 
+ 	/*Set debug to 1 if there are lots of elements*/
+@@ -40,7 +40,7 @@
+ 		interpolation_type=2;
+ 	}
+ 	else{
+-		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
++		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+ 	}
+ 
+ 	/*Get prime mesh extrema coordinates*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 13056)
+@@ -95,7 +95,7 @@
+ 	if(solver_type==MUMPSPACKAGE_LU || solver_type==MUMPSPACKAGE_CHOL){
+ 		#if _PETSC_MAJOR_ >=3
+ 			#ifndef _HAVE_MUMPS_
+-			_error2_("requested MUMPS solver, which was not compiled into ISSM!\n");
++			_error_("requested MUMPS solver, which was not compiled into ISSM!\n");
+ 			#endif
+ 		#endif
+ 	}
+@@ -119,7 +119,7 @@
+ 	/*Stokes: */
+ 	if (solver_type==StokesSolverEnum){
+ 		/*Make indices out of doftypes: */
+-		if(!df)_error2_("need doftypes for Stokes solver!\n");
++		if(!df)_error_("need doftypes for Stokes solver!\n");
+ 		DofTypesToIndexSet(&isv,&isp,df,StokesSolverEnum);
+ 
+ 		/*Set field splits: */
+@@ -150,7 +150,7 @@
+ 	
+ 	/*Check convergence*/
+ 	KSPGetIterationNumber(ksp,&iteration_number);
+-	if (iteration_number<0) _error2_("Solver diverged at iteration number: " << -iteration_number);
++	if (iteration_number<0) _error_("Solver diverged at iteration number: " << -iteration_number);
+ 
+ 	/*Free resources:*/
+ 	KSPFree(&ksp);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 13056)
+@@ -43,7 +43,7 @@
+ 			SolverxSeq(&uf->svector,Kff->smatrix,pf->svector);
+ 			break;}
+ 		default:
+-			  _error2_("Matrix type: " << Kff->type << " not supported yet!");
++			  _error_("Matrix type: " << Kff->type << " not supported yet!");
+ 	}
+ 
+ 	/*Assign output pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13056)
+@@ -29,8 +29,8 @@
+ 	Kff->GetSize(&M,&N);
+ 	pf->GetSize(&N2);
+ 
+-	if(N!=N2)_error2_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
+-	if(M!=N)_error2_("Stiffness matrix should be square!");
++	if(N!=N2)_error_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
++	if(M!=N)_error_("Stiffness matrix should be square!");
+ 
+ 	SolverxSeq(&x,Kff->matrix,pf->vector,N);
+ 	uf=new SeqVec(x,N);
+@@ -39,7 +39,7 @@
+ 	*puf=uf;
+ 
+ 	#else
+-		_error2_("GSL support not compiled in!");
++		_error_("GSL support not compiled in!");
+ 	#endif
+ 
+ }/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13056)
+@@ -36,13 +36,13 @@
+ 
+ 	/*Some checks on arguments: */
+ 	if ((M<2) || (N<2) || (nods<=0)){
+-		_error2_("nothing to be done according to the dimensions of input matrices and vectors.");
++		_error_("nothing to be done according to the dimensions of input matrices and vectors.");
+ 	}
+ 	if (x_in[1]-x_in[0]<0){
+-		_error2_("x coordinate vector should be increasing.\n   use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)");
++		_error_("x coordinate vector should be increasing.\n   use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)");
+ 	}
+ 	if (y_in[1]-y_in[0]<0){
+-		_error2_("y coordinate vector should be increasing.\n   use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)");
++		_error_("y coordinate vector should be increasing.\n   use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)");
+ 	}
+ 
+ 	/*Allocate output vector: */
+@@ -68,7 +68,7 @@
+ 		for (i=0;i<M;i++) y[i]=y_in[i];
+ 	}
+ 	else{
+-		_error2_("x and y vectors length should be 1 or 0 more than data number of rows.");
++		_error_("x and y vectors length should be 1 or 0 more than data number of rows.");
+ 	}
+ 
+ 	/*initialize thread parameters: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp	(revision 13056)
+@@ -70,7 +70,7 @@
+ 	/*Last check: is the number of elements on last column of the connectivity superior to maxels? If so, then error out and 
+ 	 * warn the user to increase the connectivity width: */
+ 	for(i=0;i<nods;i++){
+-		if (*(connectivity+width*i+maxels)>maxels)_error2_("max connectivity width reached (" << *(connectivity+width*i+maxels) << ")! increase width of connectivity table");
++		if (*(connectivity+width*i+maxels)>maxels)_error_("max connectivity width reached (" << *(connectivity+width*i+maxels) << ")! increase width of connectivity table");
+ 	}
+ 
+ 	/*Assign output pointers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 13056)
+@@ -105,7 +105,7 @@
+ 	for(i=0;i<numanalyses;i++){
+ 		char* string=strings[i];
+ 		if(my_rank==0){
+-			if(string==NULL) _error2_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");
++			if(string==NULL) _error_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");
+ 		}
+ 		if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
+ 		#ifdef _HAVE_MPI_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 13056)
+@@ -53,8 +53,8 @@
+ 
+ 	/*Check that gradient is clean*/
+ 	norm_inf=gradient->Norm(NORM_INF);
+-	if(norm_inf<=0)    _error2_("||∂J/∂α||∞ = 0    gradient norm is zero");
+-	if(xIsNan<IssmDouble>(norm_inf))_error2_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
++	if(norm_inf<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm is zero");
++	if(xIsNan<IssmDouble>(norm_inf))_error_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
+ 
+ 	/*Clean-up and assign output pointer*/
+ 	if(pnorm_list){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 13056)
+@@ -85,7 +85,7 @@
+ 			}
+ 		}
+ 		else if (flag==NodalEnum){
+-			_error2_("nodal response functions not supported yet!");
++			_error_("nodal response functions not supported yet!");
+ 
+ 			/*increment response_pointer :*/
+ 			responses_pointer++;
+@@ -103,7 +103,7 @@
+ 				responses_pointer++;
+ 			}
+ 		}
+-		else _error2_("flag type " << flag << " not supported yet for response analysis");
++		else _error_("flag type " << flag << " not supported yet for response analysis");
+ 	}
+ 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp	(revision 13056)
+@@ -132,7 +132,7 @@
+ 						nodecon[ipt+(nncon-1)]++;
+ 					}
+ 					else
+-						_error2_("Nodal connectivity table needs more than specified " << mxepg << " columns.\n");
++						_error_("Nodal connectivity table needs more than specified " << mxepg << " columns.\n");
+ 				}
+ 				jpt++;
+ 			}
+@@ -172,7 +172,7 @@
+ 		}
+ 
+ 		else
+-			_error2_("Data matrix has incorrect number of " << mdata << " rows.\n");
++			_error_("Data matrix has incorrect number of " << mdata << " rows.\n");
+ 	}
+ 
+ /*  write folder for mesh  */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp	(revision 13056)
+@@ -74,7 +74,7 @@
+ /*  open shp/shx files  */
+ 
+ 	hSHP = SHPOpen( filshp, "rb" );
+-	if (!hSHP) _error2_("Error opening shp/shx files.");
++	if (!hSHP) _error_("Error opening shp/shx files.");
+ 
+ /*  read header and print out file bounds  */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 13056)
+@@ -37,8 +37,8 @@
+ 	/*First of, find the record for the enum, and get code  of data type: */
+ 	fid=iomodel->SetFilePointerToData(&code, &vector_layout,vector_enum);
+ 
+-	if(code!=7)_error2_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));
+-	if(vector_layout!=1)_error2_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));
++	if(code!=7)_error_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));
++	if(vector_layout!=1)_error_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));
+ 
+ 	/*Fetch vector:*/
+ 	iomodel->FetchData(&IssmDoublevector,&M,&N,vector_enum);
+@@ -98,7 +98,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("Size of field " << EnumToStringx(vector_enum) << " not supported");
++		_error_("Size of field " << EnumToStringx(vector_enum) << " not supported");
+ 	}
+ 
+ 	/*Free ressources:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 13056)
+@@ -59,6 +59,6 @@
+ 	xDelete<real_t>(tpwgts);
+ 
+ 	#else
+-	_error2_("METIS version not supported yet");
++	_error_("METIS version not supported yet");
+ 	#endif
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 13056)
+@@ -84,7 +84,7 @@
+ 			for(i=0;i<ssize;i++) this->vector[list[i]]=values[i];
+ 			break;
+ 		default:
+-			_error2_("unknown insert mode!");
++			_error_("unknown insert mode!");
+ 			break;
+ 	}
+ 
+@@ -101,7 +101,7 @@
+ 			this->vector[dof]=value;
+ 			break;
+ 		default:
+-			_error2_("unknown insert mode!");
++			_error_("unknown insert mode!");
+ 			break;
+ 	}
+ }
+@@ -203,7 +203,7 @@
+ 			return sqrt(norm);
+ 			break;
+ 		default:
+-			_error2_("unknown norm !");
++			_error_("unknown norm !");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 13056)
+@@ -118,7 +118,7 @@
+ 			return norm;
+ 			break;
+ 		default:
+-			_error2_("unknown norm !");
++			_error_("unknown norm !");
+ 			break;
+ 	}
+ }
+@@ -149,8 +149,8 @@
+ 	X->GetSize(&XM);
+ 	AX->GetSize(&AXM);
+ 
+-	if(M!=AXM)_error2_("A and AX should have the same number of rows!");
+-	if(N!=XM)_error2_("A and X should have the same number of columns!");
++	if(M!=AXM)_error_("A and AX should have the same number of rows!");
++	if(N!=XM)_error_("A and X should have the same number of columns!");
+ 
+ 	for(i=0;i<M;i++){
+ 		dummy=0;
+@@ -196,7 +196,7 @@
+ 			for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]=values[n*i+j];
+ 			break;
+ 		default:
+-			_error2_("unknown insert mode!");
++			_error_("unknown insert mode!");
+ 			break;
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp	(revision 13056)
+@@ -50,7 +50,7 @@
+ 	MatGetLocalSize(*A,&local_mA,&local_nA);
+ 
+ 	/*Some dimensions checks: */
+-	if (mA!=nA) _error2_("trying to take the invert of a non-square matrix!");
++	if (mA!=nA) _error_("trying to take the invert of a non-square matrix!");
+ 
+ 	/* Set default Plapack parameters */
+ 	//First find nprows*npcols=num_procs;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp	(revision 13056)
+@@ -29,7 +29,7 @@
+ 			return MATSEQAIJ;
+ 			break;
+ 		default: 
+-			_error2_("unknown matrix type !");
++			_error_("unknown matrix type !");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp	(revision 13056)
+@@ -29,7 +29,7 @@
+ 			return INSERT_VALUES;
+ 			break;
+ 		default: 
+-			_error2_("unknown insert mode!");
++			_error_("unknown insert mode!");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp	(revision 13056)
+@@ -28,7 +28,7 @@
+ 
+ 	/*Some checks: */
+ 	MatGetSize(matrix,&M,&N);
+-	if(M!=N) _error2_("trying to invert a non square matrix!");
++	if(M!=N) _error_("trying to invert a non square matrix!");
+ 
+ 	/*Create identitiy matrix: */
+ 	identity=NewMat(M,N,sparsity);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 13056)
+@@ -61,7 +61,7 @@
+ 			#endif
+ 		}
+ 		else{
+-			_error2_("MatType " << type << " not supported yet");
++			_error_("MatType " << type << " not supported yet");
+ 		}
+ 		/*Assemble*/
+ 		MatAssemblyBegin(outmatrix,MAT_FINAL_ASSEMBLY);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp	(revision 13056)
+@@ -29,7 +29,7 @@
+ 			return NORM_2;
+ 			break;
+ 		default: 
+-			_error2_("unknown norm !");
++			_error_("unknown norm !");
+ 			break;
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 13056)
+@@ -54,7 +54,7 @@
+ 			 * and set the option, then end the token analysis.*/
+ 			if(first[0]!='-'){
+ 				/*This is not good, the option does not have '-'! Get out*/
+-				_error2_("Option " << first << " should be preceded by '-'!");
++				_error_("Option " << first << " should be preceded by '-'!");
+ 			}
+ 			/*Reduce first to bare option value*/
+ 			PetscStrlen(first,&len);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 13056)
+@@ -34,7 +34,7 @@
+ 
+ 	/*If the dimension of the partitioning vector is not the same as that of vector B, we have a problem: */
+ 	if ( (row_partition_size !=MB) ){
+-		_error2_("Dimensions of partitioning vector incompatible with dimensions of input vector\n");
++		_error_("Dimensions of partitioning vector incompatible with dimensions of input vector\n");
+ 	}
+ 
+ 	/*Get values from vector B and plug them into vector A, using the partitioning vector*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13056)
+@@ -5,22 +5,22 @@
+ #Library declaration {{{
+ lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+-#if SHARED
+-#lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
+-#endif
++if SHAREDLIBS
++lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
++endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+ if MATLAB
+-#if SHARED
+-#lib_LTLIBRARIES += libISSMMatlab.la
+-#endif
++if SHAREDLIBS
++lib_LTLIBRARIES += libISSMMatlab.la
++endif
+ lib_LIBRARIES += libISSMMatlab.a 
+ endif
+ if MODULES
+-#if SHARED
+-#lib_LTLIBRARIES += libISSMModules.la
+-#endif
++if SHAREDLIBS
++lib_LTLIBRARIES += libISSMModules.la
++endif
+ lib_LIBRARIES += libISSMModules.a 
+ endif
+ #}}}
+@@ -1010,28 +1010,29 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
+-#if SHARED
+-#libISSM_la_SOURCES = solutions/issm.cpp
+-#libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
+-#
+-#libISSMCore_la_SOURCES  = $(issm_sources)
+-#libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
+-#
+-#libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
+-#endif
++if SHAREDLIBS
++libISSM_la_SOURCES = solutions/issm.cpp
++libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
+ 
++libISSMCore_la_SOURCES  = $(issm_sources)
++libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
++
++libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++endif
++
+ if MODULES
+-#if SHARED
+-#libISSMModules_la_SOURCES = $(module_sources)
+-#libISSMModules_la_SOURCES += $(bamg_sources)
+-#libISSMModules_la_SOURCES += $(kriging_sources)
+-#libISSMModules_la_SOURCES += $(kml_sources)
+-#endif
++if SHAREDLIBS
++libISSMModules_la_SOURCES = $(module_sources)
++libISSMModules_la_SOURCES += $(bamg_sources)
++libISSMModules_la_SOURCES += $(kriging_sources)
++libISSMModules_la_SOURCES += $(kml_sources)
++endif
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+ libISSMModules_a_SOURCES += $(kriging_sources)
+ libISSMModules_a_SOURCES += $(kml_sources)
+ libISSMModules_a_CXXFLAGS = $(ALLCXXFLAGS)
++libISSMModules_a_LIBADD = ./libISSMCore.a
+ endif
+ 
+ if PYTHON
+@@ -1040,13 +1041,18 @@
+ endif
+ 
+ if MATLAB
+-#if SHARED
+-#libISSMMatlab_la_SOURCES = $(matlab_sources)
+-#endif
++if SHAREDLIBS
++libISSMMatlab_la_SOURCES = $(matlab_sources)
++endif
+ libISSMMatlab_a_SOURCES = $(matlab_sources)
+ libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
+ endif
+ 
++if VERSION
++AM_LDFLAGS =
++else
++AM_LDFLAGS = -avoid-version
++endif
+ #}}}
+ #Overload library, to overload any non-standard symbols. {{{
+ libISSMOverload_a_SOURCES = ./shared/String/stricmp.c
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 13056)
+@@ -142,7 +142,7 @@
+ 		if(this->ssize)this->sdoflist=xNew<int>(size);
+ 		else this->sdoflist=NULL;
+ 	}
+-	else _error2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ }
+ /*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/Hook.cpp	(revision 13056)
+@@ -184,7 +184,7 @@
+ 		if(this->objects[i]==NULL){
+ 			this->objects[i]=(Object*)dataset->GetObjectById(this->offsets+i,this->ids[i]); //remember the offset for later on.
+ 			/*check the id is correct!: */
+-			if (this->objects[i]->Id()!=this->ids[i]) _error2_("wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << "  in resolved pointer!");
++			if (this->objects[i]->Id()!=this->ids[i]) _error_("wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << "  in resolved pointer!");
+ 		}
+ 	}
+ }
+@@ -193,10 +193,10 @@
+ Object* Hook::delivers(void){
+ 	
+ 	/*first, check that we only have one T object in our object list: */
+-	if (this->num!=1) _error2_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");
++	if (this->num!=1) _error_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");
+ 
+ 	/*check NULL: */
+-	if (this->objects==NULL) _error2_("hook is not pointing to any object, objects pointer is NULL");
++	if (this->objects==NULL) _error_("hook is not pointing to any object, objects pointer is NULL");
+ 
+ 	return *objects;
+ }
+@@ -245,11 +245,11 @@
+ 	}
+ 
+ 	/*Else, check that we are requesting a half of num*/
+-	if (numindices>this->num) _error2_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects");
++	if (numindices>this->num) _error_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects");
+ 
+ 	/*go pickup the correct objects, ids and offsets :*/
+ 	output->num=numindices;
+-	if(output->num<1) _error2_("Trying to spawn an empty ElementProperties!");
++	if(output->num<1) _error_("Trying to spawn an empty ElementProperties!");
+ 
+ 	output->objects=xNew<Object*>(output->num);
+ 	output->ids=xNew<int>(output->num);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 13056)
+@@ -79,7 +79,7 @@
+ 		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+ 	}
+ 	else
+-	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
++	 _error_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
+ 
+ 	/*Initialize static fields as undefined*/
+ 	weight=UNDEF;
+@@ -177,7 +177,7 @@
+ 		coord3=0.5;
+ 	}
+ 	else
+-	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
++	 _error_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
+ 
+ }
+ /*}}}*/
+@@ -240,7 +240,7 @@
+ 			coord1=0; coord2=0; coord3=1;
+ 			break;
+ 		default:
+-			_error2_("vertex index should be in [0 2]");
++			_error_("vertex index should be in [0 2]");
+ 
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 13056)
+@@ -118,7 +118,7 @@
+ 		for(i=0;i<numgauss;i++) weights[i]=seg_weights[i];
+ 	}
+ 	else{
+-		_error2_("Penta not supported yet");
++		_error_("Penta not supported yet");
+ 	}
+ 
+ 	/*Initialize static fields as undefined*/
+@@ -158,7 +158,7 @@
+ 		for(int i=0;i<numgauss;i++) coords4[i]=1.0;
+ 	}
+ 	else{
+-		_error2_("Tria not supported yet");
++		_error_("Tria not supported yet");
+ 	}
+ 
+ }
+@@ -220,7 +220,7 @@
+ 		}
+ 	}
+ 	else{
+-		_error2_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")");
++		_error_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")");
+ 	}
+ 
+ 	/*clean-up*/
+@@ -339,7 +339,7 @@
+ 			coord1=0; coord2=0; coord3=1; coord4= +1;
+ 			break;
+ 		default:
+-			_error2_("vertex index should be in [0 5]");
++			_error_("vertex index should be in [0 5]");
+ 
+ 	}
+ 
+@@ -358,7 +358,7 @@
+ 		for(int i=0;i<numgauss;i++) coords4[i]=-1.0;
+ 	}
+ 	else{
+-		_error2_("Tria not supported yet");
++		_error_("Tria not supported yet");
+ 	}
+ 
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13056)
+@@ -193,13 +193,13 @@
+ 
+ 			/*Get input (either in element or material)*/
+ 			Input* input=inputs->GetInput(input_enum);
+-			if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in material");
++			if(!input) _error_("Input " << EnumToStringx(input_enum) << " not found in material");
+ 
+ 			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
+ 			input->GetVectorFromInputs(vector,&doflist1[0]);}
+ 			break;
+ 
+-		default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++		default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+ 	}
+ }
+ /*}}}*/
+@@ -259,7 +259,7 @@
+ 	}
+ 
+ 	/*Checks in debugging mode*/
+-	if(viscosity<=0) _error2_("Negative viscosity");
++	if(viscosity<=0) _error_("Negative viscosity");
+ 	_assert_(B>0);
+ 	_assert_(n>0);
+ 
+@@ -330,7 +330,7 @@
+ 	}
+ 
+ 	/*Checks in debugging mode*/
+-	if(viscosity3d<=0) _error2_("Negative viscosity");
++	if(viscosity3d<=0) _error_("Negative viscosity");
+ 	_assert_(B>0);
+ 	_assert_(n>0);
+ 
+@@ -402,7 +402,7 @@
+ 	}
+ 
+ 	/*Checks in debugging mode*/
+-	if(viscosity3d<=0) _error2_("Negative viscosity");
++	if(viscosity3d<=0) _error_("Negative viscosity");
+ 	_assert_(B>0);
+ 	_assert_(n>0);
+ 
+@@ -563,9 +563,9 @@
+ 					this->inputs->AddInput(new TriaP1Input(name,values));
+ 					return;
+ 				}
+-				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++				default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+ 			}
+-		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++		default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ }
+ /*}}}*/
+@@ -621,9 +621,9 @@
+ 					/*}}}*/
+ 					return;
+ 				}
+-				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++				default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+ 			}
+-		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++		default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ 
+ 
+@@ -763,7 +763,7 @@
+ 	}
+ 	#endif
+ 	else{
+-		_error2_("Mesh type not supported yet!");
++		_error_("Mesh type not supported yet!");
+ 	}
+ 
+ 	return;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 13056)
+@@ -61,10 +61,10 @@
+ 		void   InputUpdateFromConstant(int constant, int name);
+ 		void   InputUpdateFromConstant(bool constant, int name);
+ 		void   InputUpdateFromSolution(IssmDouble* solution);
+-		void   InputUpdateFromIoModel(int index, IoModel* iomodel){_error2_("not implemented yet");};
++		void   InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
+ 		/*}}}*/
+ 		/*Material virtual functions resolution: {{{*/
+-		void   InputDuplicate(int original_enum,int new_enum){_error2_("not implemented yet");};
++		void   InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");};
+ 		void   Configure(Elements* elements);
+ 		void   GetVectorFromInputs(Vector* vector,int input_enum){return;}
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 13056)
+@@ -39,7 +39,7 @@
+ 		Input* PointwiseMin(Input* inputB);
+ 		Input* PointwiseMax(Input* inputB);
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+@@ -48,10 +48,10 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetInputAverage(IssmDouble* pvalue);
+@@ -66,15 +66,15 @@
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+ 		void ConstrainMin(IssmDouble minimum);
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+ 		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+-		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
++		IssmDouble InfinityNorm(void){_error_("not implemented yet");};
+ 		IssmDouble Max(void);
+ 		IssmDouble MaxAbs(void);
+ 		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void);
+-		void Extrude(void){_error2_("not supported yet");};
++		void Extrude(void){_error_("not supported yet");};
+ 		void VerticallyIntegrate(Input* thickness_input);
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 13056)
+@@ -47,7 +47,7 @@
+ 			maxvalues  =new PentaP1Input(enum_type,pmax);
+ 			break;
+ 		default:
+-			_error2_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput");
++			_error_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput");
+ 	}
+ 	gradient   =NULL;
+ }
+@@ -151,7 +151,7 @@
+ }/*}}}*/
+ /*FUNCTION ControlInput::ScaleGradient{{{*/
+ void ControlInput::ScaleGradient(IssmDouble scaling_factor){
+-	if(!gradient) _error2_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");
++	if(!gradient) _error_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");
+ 	gradient->Scale(scaling_factor);
+ }/*}}}*/
+ /*FUNCTION ControlInput::SetGradient{{{*/
+@@ -169,7 +169,7 @@
+ 			gradient_in->ChangeEnum(Gradient3Enum);
+ 			break;
+ 		default:
+-			_error2_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated.");
++			_error_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated.");
+ 	}
+ 
+ 	/*Delete old gradient and assign new gradient*/
+@@ -220,7 +220,7 @@
+ 		 gradient->GetVectorFromInputs(vector,doflist);
+ 	 }
+ 	 else{
+-		 _error2_("Data " << data << " not supported yet");
++		 _error_("Data " << data << " not supported yet");
+ 	 }
+ }/*}}}*/
+ /*FUNCTION ControlInput::GetInputAverage(IssmDouble* pvalue){{{*/
+@@ -257,15 +257,15 @@
+ }/*}}}*/
+ /*FUNCTION ControlInput::SaveValue{{{*/
+ void ControlInput::SaveValue(void){
+-	if(!values) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
++	if(!values) _error_("Values of " << EnumToStringx(this->enum_type) << " not found");
+ 
+ 	if(savedvalues) delete this->savedvalues;
+ 	this->savedvalues=(Input*)this->values->copy();
+ }/*}}}*/
+ /*FUNCTION ControlInput::UpdateValue{{{*/
+ void ControlInput::UpdateValue(IssmDouble scalar){
+-	if(!gradient)    _error2_("Gradient of " << EnumToStringx(this->enum_type) << " not found");
+-	if(!savedvalues) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
++	if(!gradient)    _error_("Gradient of " << EnumToStringx(this->enum_type) << " not found");
++	if(!savedvalues) _error_("Values of " << EnumToStringx(this->enum_type) << " not found");
+ 
+ 	if(values) delete this->values;
+ 	this->values=(Input*)this->savedvalues->copy();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 13056)
+@@ -40,11 +40,11 @@
+ 		/*ControlInput management: {{{*/
+ 		int    InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+@@ -54,38 +54,38 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void ChangeEnum(int newenumtype){_error2_("not implemented yet");};
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error2_("not implemented yet");};
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void ChangeEnum(int newenumtype){_error_("not implemented yet");};
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar){_error_("not implemented yet");};
+ 		void Constrain(void);
+ 		void Constrain(IssmDouble min,IssmDouble max);
+-		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
+-		IssmDouble Max(void){_error2_("not implemented yet");};
+-		IssmDouble MaxAbs(void){_error2_("not implemented yet");};
+-		IssmDouble Min(void){_error2_("not implemented yet");};
+-		IssmDouble MinAbs(void){_error2_("not implemented yet");};
++		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 MinAbs(void){_error_("not implemented yet");};
+ 		void Extrude(void);
+ 		void VerticallyIntegrate(Input* thickness_input);
+ 		void GetVectorFromInputs(Vector* vector,int* doflist,const char* data);
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not implemented yet");};
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");};
+ 		ElementResult* SpawnGradient(int step, IssmDouble time);
+ 		void GetGradient(Vector* gradient_vec,int* doflist);
+ 		void ScaleGradient(IssmDouble scale);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp	(revision 13056)
+@@ -114,7 +114,7 @@
+ void DatasetInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss,int index){
+ 
+ 	/*Get requested input within dataset*/
+-	if(index<0 || index > inputs->Size()-1) _error2_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");
++	if(index<0 || index > inputs->Size()-1) _error_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");
+ 	Input* input=(Input*)this->inputs->GetObjectByOffset(index);
+ 	
+ 	input->GetInputValue(pvalue,gauss);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 13056)
+@@ -36,56 +36,56 @@
+ 		/*DatasetInput management: {{{*/
+ 		int    InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
+-		ElementResult* SpawnResult(int step, IssmDouble time){_error2_("not implemented yet");};
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
++		ElementResult* SpawnResult(int step, IssmDouble time){_error_("not implemented yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
++		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void ChangeEnum(int newenumtype){_error2_("not implemented yet");};
+-		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error2_("not implemented yet");};
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xinput,IssmDouble scalar){_error2_("not implemented yet");};
+-		void Constrain(void){_error2_("not implemented yet");};
+-		void Constrain(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		IssmDouble InfinityNorm(void){_error2_("not implemented yet");};
+-		IssmDouble Max(void){_error2_("not implemented yet");};
+-		IssmDouble MaxAbs(void){_error2_("not implemented yet");};
+-		IssmDouble Min(void){_error2_("not implemented yet");};
+-		IssmDouble MinAbs(void){_error2_("not implemented yet");};
+-		void Extrude(void){_error2_("not implemented yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not implemented yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist){_error2_("not implemented yet");};
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not implemented yet");};
+-		ElementResult* SpawnGradient(int step, IssmDouble time){_error2_("not implemented yet");};
+-		void GetGradient(Vector* gradient_vec,int* doflist){_error2_("not implemented yet");};
+-		void ScaleGradient(IssmDouble scale){_error2_("not implemented yet");};
+-		void SetGradient(Input* gradient_in){_error2_("not implemented yet");};
+-		void UpdateValue(IssmDouble scalar){_error2_("not implemented yet");};
+-		void SaveValue(void){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void ChangeEnum(int newenumtype){_error_("not implemented yet");};
++		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		void AXPY(Input* xinput,IssmDouble scalar){_error_("not implemented yet");};
++		void Constrain(void){_error_("not implemented yet");};
++		void Constrain(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		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 MinAbs(void){_error_("not implemented yet");};
++		void Extrude(void){_error_("not implemented yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error_("not implemented yet");};
++		void GetVectorFromInputs(Vector* vector,int* doflist){_error_("not implemented yet");};
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");};
++		ElementResult* SpawnGradient(int step, IssmDouble time){_error_("not implemented yet");};
++		void GetGradient(Vector* gradient_vec,int* doflist){_error_("not implemented yet");};
++		void ScaleGradient(IssmDouble scale){_error_("not implemented yet");};
++		void SetGradient(Input* gradient_in){_error_("not implemented yet");};
++		void UpdateValue(IssmDouble scalar){_error_("not implemented yet");};
++		void SaveValue(void){_error_("not implemented yet");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 13056)
+@@ -98,14 +98,14 @@
+ /*FUNCTION IntInput::SpawnResult{{{*/
+ ElementResult* IntInput::SpawnResult(int step, IssmDouble time){
+ 	
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ 
+ }
+ /*}}}*/
+ 
+ /*Object functions*/
+ /*FUNCTION IntInput::GetInputValue(bool* pvalue) {{{*/
+-void IntInput::GetInputValue(bool* pvalue){_error2_("not supported yet!");}
++void IntInput::GetInputValue(bool* pvalue){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(int* pvalue){{{*/
+ void IntInput::GetInputValue(int* pvalue){
+@@ -114,20 +114,20 @@
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue){{{*/
+ void IntInput::GetInputValue(IssmDouble* pvalue){
+-	_error2_("IntInput cannot return a IssmDouble in parallel");
++	_error_("IntInput cannot return a IssmDouble in parallel");
+ }
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not supported yet!");}
++void IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not supported yet!");}
++void IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
++void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
++void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION IntInput::ChangeEnum{{{*/
+ void IntInput::ChangeEnum(int newenumtype){
+@@ -165,7 +165,7 @@
+ 			return;
+ 
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ 
+ }
+@@ -181,14 +181,14 @@
+ /*FUNCTION IntInput::GetVectorFromInputs{{{*/
+ void IntInput::GetVectorFromInputs(Vector* vector,int* doflist){
+ 
+-	_error2_("not supporte yet!");
++	_error_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION IntInput::GetValuesPtr{{{*/
+ void IntInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+ 
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 13056)
+@@ -111,22 +111,22 @@
+ }
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(int* pvalue){{{*/
+-void BoolInput::GetInputValue(int* pvalue){_error2_("not supported yet!");}
++void BoolInput::GetInputValue(int* pvalue){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue){_error2_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
++void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
++void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION BoolInput::ChangeEnum{{{*/
+ void BoolInput::ChangeEnum(int newenumtype){
+@@ -160,7 +160,7 @@
+ 			return;
+ 
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ 
+ }
+@@ -175,14 +175,14 @@
+ /*FUNCTION BoolInput::GetVectorFromInputs{{{*/
+ void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){
+ 
+-	_error2_("not supporte yet!");
++	_error_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION BoolInput::GetValuesPtr{{{*/
+ void BoolInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+ 
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ 
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 13056)
+@@ -36,11 +36,11 @@
+ 		/*IntInput management: {{{*/
+ 		int   InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+@@ -49,34 +49,34 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+ 		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+-		IssmDouble InfinityNorm(void){_error2_("InfinityNorm not implemented for integers");};
+-		IssmDouble Max(void){_error2_("Max not implemented for integers");};
+-		IssmDouble MaxAbs(void){_error2_("Max not implemented for integers");};
+-		IssmDouble Min(void){_error2_("Min not implemented for integers");};
+-		IssmDouble MinAbs(void){_error2_("Min not implemented for integers");};
+-		void Extrude(void){_error2_("not supported yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
++		IssmDouble InfinityNorm(void){_error_("InfinityNorm not implemented for integers");};
++		IssmDouble Max(void){_error_("Max not implemented for integers");};
++		IssmDouble MaxAbs(void){_error_("Max not implemented for integers");};
++		IssmDouble Min(void){_error_("Min not implemented for integers");};
++		IssmDouble MinAbs(void){_error_("Min not implemented for integers");};
++		void Extrude(void){_error_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 13056)
+@@ -36,12 +36,12 @@
+ 		/*BoolInput management: {{{*/
+ 		int   InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* inputB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
++		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+ 		void Configure(Parameters* parameters);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+ 		void GetInputValue(bool* pvalue);
+@@ -49,34 +49,34 @@
+ 		void GetInputValue(IssmDouble* pvalue);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+-		void GetInputAverage(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		IssmDouble InfinityNorm(void){_error2_("InfinityNorm not implemented for booleans");};
+-		IssmDouble Max(void){_error2_("Max not implemented for booleans");};
+-		IssmDouble MaxAbs(void){_error2_("Max not implemented for booleans");};
+-		IssmDouble Min(void){_error2_("Min not implemented for booleans");};
+-		IssmDouble MinAbs(void){_error2_("Min not implemented for booleans");};
++		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
++		IssmDouble InfinityNorm(void){_error_("InfinityNorm not implemented for booleans");};
++		IssmDouble Max(void){_error_("Max not implemented for booleans");};
++		IssmDouble MaxAbs(void){_error_("Max not implemented for booleans");};
++		IssmDouble Min(void){_error_("Min not implemented for booleans");};
++		IssmDouble MinAbs(void){_error_("Min not implemented for booleans");};
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error2_("Constrain not implemented for booleans");};
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error_("Constrain not implemented for booleans");};
+ 		void Extrude(void);
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 13056)
+@@ -322,7 +322,7 @@
+ 			return;
+ 
+ 		default :
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ 
+ }
+@@ -367,7 +367,7 @@
+ 	IssmDouble            minvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TriaP1Input*)inputB;
+ 
+ 	/*Create point wise min*/
+@@ -398,7 +398,7 @@
+ 	IssmDouble            maxvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TriaP1Input*)inputB;
+ 
+ 	/*Create point wise max*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 13056)
+@@ -36,33 +36,33 @@
+ 		/*TriaP1Input management: {{{*/
+ 		int   InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* inputB){_error2_("not implemented yet");};
++		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
+ 		Input* PointwiseMin(Input* inputB);
+ 		Input* PointwiseMax(Input* inputB);
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");}
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");}
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");}
++		void GetInputValue(bool* pvalue){_error_("not implemented yet");}
++		void GetInputValue(int* pvalue){_error_("not implemented yet");}
++		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");}
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void GetInputAverage(IssmDouble* pvalue);
+ 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss);
+ 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+@@ -76,8 +76,8 @@
+ 		IssmDouble MaxAbs(void);
+ 		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void);
+-		void Extrude(void){_error2_("not supported yet");};
+-		void VerticallyIntegrate(Input* thickness_input){_error2_("not supported yet");};
++		void Extrude(void){_error_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 13056)
+@@ -481,7 +481,7 @@
+ 			}
+ 		}
+ 	}
+-	if(!found)_error2_("did not find time interval on which to interpolate forcing values!");
++	if(!found)_error_("did not find time interval on which to interpolate forcing values!");
+ 
+ 	/*Assign output pointer*/
+ 	return input;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 13056)
+@@ -454,12 +454,12 @@
+ 			return;
+ 		case ControlInputEnum:{
+ 			ControlInput* cont_input=(ControlInput*)xinput;
+-			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error2_("not supported yet");
++			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error_("not supported yet");
+ 			PentaP1Input* cast_input=(PentaP1Input*)cont_input->values;
+ 			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
+ 			return;
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ 
+ }
+@@ -494,7 +494,7 @@
+ 	IssmDouble    *thickness_values = NULL;
+ 
+ 	/*Check that input provided is a thickness*/
+-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
++	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
+ 
+ 	/*Get Thickness value pointer*/
+ 	thickness_input->GetValuesPtr(&thickness_values,&num_thickness_values);
+@@ -510,7 +510,7 @@
+ 			return;
+ 
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ }
+ /*}}}*/
+@@ -528,7 +528,7 @@
+ 	IssmDouble            AdotBvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaP1Input*)inputB;
+ 
+ 	/*Create point wise sum*/
+@@ -559,7 +559,7 @@
+ 	IssmDouble            minvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaP1Input*)inputB;
+ 
+ 	/*Create point wise min*/
+@@ -590,7 +590,7 @@
+ 	IssmDouble            maxvalues[numnodes];
+ 
+ 	/*Check that inputB is of the same type*/
+-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
++	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaP1Input*)inputB;
+ 
+ 	/*Create point wise max*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 13056)
+@@ -107,13 +107,13 @@
+ /*Object functions*/
+ /*FUNCTION DoubleInput::GetInputValue(bool* pvalue) {{{*/
+ void DoubleInput::GetInputValue(bool* pvalue){
+-	_error2_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");
++	_error_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetInputValue(int* pvalue){{{*/
+ void DoubleInput::GetInputValue(int* pvalue){
+-	_error2_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
++	_error_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
+ 
+ }
+ /*}}}*/
+@@ -131,10 +131,10 @@
+ void DoubleInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){*pvalue=this->value;}
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/
+-void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not supported yet!");}
++void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/
+-void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not supported yet!");}
++void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");}
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){{{*/
+ void DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){
+@@ -216,7 +216,7 @@
+ 			return;
+ 
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ 
+ }
+@@ -252,14 +252,14 @@
+ /*FUNCTION DoubleInput::GetVectorFromInputs{{{*/
+ void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){
+ 
+-	_error2_("not supporte yet!");
++	_error_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetValuesPtr{{{*/
+ void DoubleInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){
+ 
+-	_error2_("not supported yet!");
++	_error_("not supported yet!");
+ 
+ }
+ /*}}}*/
+@@ -275,7 +275,7 @@
+ 	IssmDouble thickness_value;
+ 
+ 	/*Check that input provided is a thickness*/
+-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
++	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
+ 
+ 	/*vertically integrate depending on type:*/
+ 	switch(thickness_input->ObjectEnum()){
+@@ -286,7 +286,7 @@
+ 			return;
+ 
+ 		default:
+-			_error2_("not implemented yet");
++			_error_("not implemented yet");
+ 	}
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 13056)
+@@ -39,50 +39,50 @@
+ 		/*TransientInput management: {{{*/
+ 		int    InstanceEnum();
+ 		Input* SpawnTriaInput(int* indices);
+-		Input* PointwiseDivide(Input* forcingB){_error2_("not implemented yet");};
+-		Input* PointwiseMin(Input* forcingB){_error2_("not implemented yet");};
+-		Input* PointwiseMax(Input* forcingB){_error2_("not implemented yet");};
++		Input* PointwiseDivide(Input* forcingB){_error_("not implemented yet");};
++		Input* PointwiseMin(Input* forcingB){_error_("not implemented yet");};
++		Input* PointwiseMax(Input* forcingB){_error_("not implemented yet");};
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
++		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time);
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss);
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+ 		void ChangeEnum(int newenumtype);
+ 
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+-		void ConstrainMin(IssmDouble minimum){_error2_("not implemented yet");};
+-		void Scale(IssmDouble scale_factor){_error2_("not implemented yet");};
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
+-		void AXPY(Input* xforcing,IssmDouble scalar){_error2_("not implemented yet");};
+-		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error2_("not implemented yet");};
++		void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");};
++		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
++		void AXPY(Input* xforcing,IssmDouble scalar){_error_("not implemented yet");};
++		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error_("not implemented yet");};
+ 		IssmDouble InfinityNorm(void);
+ 		IssmDouble Max(void);
+ 		IssmDouble MaxAbs(void);
+ 		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void);
+ 		void Extrude(void);
+-		void VerticallyIntegrate(Input* thickness_forcing){_error2_("not supported yet");};
++		void VerticallyIntegrate(Input* thickness_forcing){_error_("not supported yet");};
+ 		void GetVectorFromInputs(Vector* vector,int* doflist);
+-		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error2_("not supported yet");};
+-      void GetTimeValues(IssmDouble* values,IssmDouble time){_error2_("not implemented yet");};
++		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not supported yet");};
++      void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");};
+ 		Input* GetTimeInput(IssmDouble time);
+ 		/*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 13056)
+@@ -40,24 +40,24 @@
+ 		Input* PointwiseMin(Input* inputB);
+ 		Input* PointwiseMax(Input* inputB);
+ 		ElementResult* SpawnResult(int step, IssmDouble time);
+-		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error2_("not supported yet");};
++		void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");};
+ 		void Configure(Parameters* parameters);
+ 		/*}}}*/
+ 		/*numerics: {{{*/
+-		void GetInputValue(bool* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(int* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
++		void GetInputValue(int* pvalue){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not implemented yet");};
+ 		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
+-		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
++		void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
++		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+ 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetInputAverage(IssmDouble* pvalue);
+-		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
+-		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error2_("not implemented yet");};
++		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
++		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+ 		void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss);
+ 		void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss);
+@@ -68,7 +68,7 @@
+ 		void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters);
+ 		void ConstrainMin(IssmDouble minimum);
+ 		void Scale(IssmDouble scale_factor);
+-		void ArtificialNoise(IssmDouble min,IssmDouble max){_error2_("not implemented yet");};
++		void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");};
+ 		void AXPY(Input* xinput,IssmDouble scalar);
+ 		void Constrain(IssmDouble cm_min, IssmDouble cm_max);
+ 		IssmDouble InfinityNorm(void);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.cpp	(revision 13056)
+@@ -78,9 +78,9 @@
+ 	if      (!strncmp(kstr,"</Geometry",10))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");}
++	  {_error_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");}
++	  {_error_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");}
+ 
+ 	else if (!strncmp(kstr,"<",1))
+ 		KML_Object::Read(fid,kstr);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.h	(revision 13056)
+@@ -43,13 +43,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.h	(revision 13056)
+@@ -35,13 +35,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.h	(revision 13056)
+@@ -37,13 +37,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.cpp	(revision 13056)
+@@ -92,9 +92,9 @@
+ 	if      (!strncmp(kstr,"</ColorStyle",12))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);}
++	  {_error_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");}
++	  {_error_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");}
+ 
+ 	else if (!strcmp(kstr,"<color>"))
+ 		KMLFileTokenParse( color     ,NULL,KML_COLORSTYLE_COLOR_LENGTH, kstr, fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.cpp	(revision 13056)
+@@ -139,9 +139,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<Point", 6)) {
+ 			kobj=(KML_Object*)new KML_Point();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp	(revision 13056)
+@@ -159,7 +159,7 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 
+ 		else if (strncmp(kstri,"<",1)) {
+ 			if (value) {
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_GroundOverlay.cpp	(revision 13056)
+@@ -130,9 +130,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<altitude>"))
+ 			KMLFileTokenParse(&altitude  ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.h	(revision 13056)
+@@ -43,13 +43,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Style.cpp	(revision 13056)
+@@ -188,9 +188,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ //		else if (!strncmp(kstri,"<IconStyle",10)) {
+ //			icon      =new KML_IconStyle();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_MultiGeometry.cpp	(revision 13056)
+@@ -139,9 +139,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<Point", 6)) {
+ 			kobj=(KML_Object*)new KML_Point();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.h	(revision 13056)
+@@ -28,13 +28,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.h	(revision 13056)
+@@ -34,13 +34,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Attribute.h	(revision 13056)
+@@ -29,13 +29,13 @@
+ 		virtual void  Echo();
+ 		virtual void  DeepEcho();
+ 		virtual void  DeepEcho(const char* indent);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineStyle.cpp	(revision 13056)
+@@ -112,9 +112,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<width>"))
+ 			KMLFileTokenParse(&width     ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.h	(revision 13056)
+@@ -31,13 +31,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Object.h	(revision 13056)
+@@ -30,13 +30,13 @@
+ 		virtual void  Echo();
+ 		virtual void  DeepEcho();
+ 		virtual void  DeepEcho(const char* indent);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Folder.cpp	(revision 13056)
+@@ -105,9 +105,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Container::Read(fid,kstri);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp	(revision 13056)
+@@ -105,9 +105,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Container::Read(fid,kstri);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.h	(revision 13056)
+@@ -28,13 +28,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_File.cpp	(revision 13056)
+@@ -106,9 +106,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}
++		  {_error_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}
++		  {_error_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}
+ 
+ 		else if (!strncmp(kstri,"<",1))
+ 			KML_Object::Read(fid,kstri);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LineString.h	(revision 13056)
+@@ -37,13 +37,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Overlay.h	(revision 13056)
+@@ -35,13 +35,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Container.h	(revision 13056)
+@@ -32,13 +32,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Icon.cpp	(revision 13056)
+@@ -144,9 +144,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<href>"))
+ 			KMLFileTokenParse( href      ,NULL,KML_ICON_HREF_LENGTH, kstri, fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Point.cpp	(revision 13056)
+@@ -125,9 +125,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<extrude>"))
+ 			KMLFileTokenParse(&extrude   , kstri, fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LinearRing.cpp	(revision 13056)
+@@ -138,9 +138,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<extrude>"))
+ 			KMLFileTokenParse(&extrude,kstri,fid);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Feature.cpp	(revision 13056)
+@@ -148,9 +148,9 @@
+ 	if      (!strncmp(kstr,"</Feature", 9))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_Feature::Read -- Unexpected closing tag " << kstr);}
++	  {_error_("KML_Feature::Read -- Unexpected closing tag " << kstr);}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");}
++	  {_error_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");}
+ 
+ 	else if (!strncmp(kstr,"<Style", 6)) {
+ 		kobj=(KML_Object*)new KML_Style();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Polygon.h	(revision 13056)
+@@ -39,13 +39,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp	(revision 13056)
+@@ -258,7 +258,7 @@
+ 	char*   ktokn;
+ 
+ 	if (strncmp(&ktag[0],"<"        ,1) || strncmp(&ktag[strlen(ktag)-1],">",1))
+-		_error2_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n");
++		_error_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n");
+ 
+ /*  strtok modifies ktag, so work on copy  */
+ 
+@@ -354,7 +354,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
++		_error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
+ 
+ 	sscanf(kstr,"%d",pival);
+ 	xDelete<char>(kstr);
+@@ -367,7 +367,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -387,7 +387,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-	  {_error2_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");}
++	  {_error_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");}
+ 
+ 	sscanf(kstr,"%d",&ival);
+ 	*pbval=(bool)ival;
+@@ -401,7 +401,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -432,7 +432,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n");
++		_error_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n");
+ 
+ 	if (!pstr) {
+ 		if (maxlen)
+@@ -462,7 +462,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -483,7 +483,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-	  {_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}
++	  {_error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}
+ 
+ 	sscanf(kstr,"%g",pfval);
+ 	xDelete<char>(kstr);
+@@ -496,7 +496,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -517,7 +517,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
++		_error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
+ 
+ 	sscanf(kstr,"%lg",pdval);
+ 	xDelete<char>(kstr);
+@@ -530,7 +530,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -555,7 +555,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");
++		_error_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");
+ 
+ 	if (!*pdval)
+ 		if (maxlen)
+@@ -569,7 +569,7 @@
+ 	while (ktok) {
+ 		i++;
+ 		if (maxlen && (maxlen < i+1))
+-			_error2_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n");
++			_error_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n");
+ 		sscanf(ktok,"%lg",&((*pdval)[i]));
+ 		ktok=strtok(NULL,delim);
+ 	}
+@@ -594,7 +594,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -621,7 +621,7 @@
+ 	if (!(kstr=KMLFileToken(fid,
+ 							NULL,NULL)) ||
+ 		(kstr[0] == '<'))
+-		_error2_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n");
++		_error_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n");
+ 
+ 	if (!*pdval)
+ 		if (maxlen)
+@@ -635,7 +635,7 @@
+ 	while (ktok) {
+ 		i++;
+ 		if (maxlen && (maxlen*n < i+1))
+-			_error2_("KMLFileTokenParse -- Double [m x n] field too short for " << ktag << ".\n");
++			_error_("KMLFileTokenParse -- Double [m x n] field too short for " << ktag << ".\n");
+ 		j=(j+1) % n;
+ 		sscanf(ktok,"%lg",&((*pdval)[i]));
+ 		ktok=strtok(NULL,delim);
+@@ -664,7 +664,7 @@
+ 			(kstr[0] != '<') ||
+ 			(kstr[1] != '/') ||
+ 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
+-		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
++		  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
+ 		else
+ 			xDelete<char>(kstr);
+ 
+@@ -711,13 +711,13 @@
+ 
+ 		else if ((kstr[0] == '<') &&
+ 				 (kstr[1] == '/')) {
+-			_error2_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");
++			_error_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");
+ 		}
+ 
+ 		xDelete<char>(kstr);
+ 	}
+ 
+-	_error2_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");
++	_error_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");
+ 
+ 	return(0);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Geometry.h	(revision 13056)
+@@ -28,13 +28,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp	(revision 13056)
+@@ -82,9 +82,9 @@
+ 	if      (!strncmp(kstr,"</StyleSelector",15))
+ 		return;
+ 	else if (!strncmp(kstr,"</",2))
+-	  {_error2_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");}
++	  {_error_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");}
+ 	else if (strncmp(kstr,"<",1))
+-	  {_error2_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");}
++	  {_error_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");}
+ 
+ 	else if (!strncmp(kstr,"<",1))
+ 		KML_Object::Read(fid,kstr);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp	(revision 13056)
+@@ -120,9 +120,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<north>"))
+ 			KMLFileTokenParse(&north     ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_ColorStyle.h	(revision 13056)
+@@ -34,13 +34,13 @@
+ 		void  DeepEcho(const char* indent);
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_Placemark.h	(revision 13056)
+@@ -33,13 +33,13 @@
+ 		void  Write(FILE* fid,const char* indent);
+ 		void  Read(FILE* fid,char* kstr);
+ 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
+-		int   Id(){_error2_("Not implemented yet.");};
+-		int   MyRank(){_error2_("Not implemented yet.");};
+-		void  Marshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   MarshallSize(){_error2_("Not implemented yet.");};
+-		void  Demarshall(char** pmarshalled_dataset){_error2_("Not implemented yet.");};
+-		int   ObjectEnum(){_error2_("Not implemented yet.");};
+-		Object* copy(){_error2_("Not implemented yet.");};
++		int   Id(){_error_("Not implemented yet.");};
++		int   MyRank(){_error_("Not implemented yet.");};
++		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   MarshallSize(){_error_("Not implemented yet.");};
++		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
++		int   ObjectEnum(){_error_("Not implemented yet.");};
++		Object* copy(){_error_("Not implemented yet.");};
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/KML/KML_PolyStyle.cpp	(revision 13056)
+@@ -116,9 +116,9 @@
+ 			break;
+ 		}
+ 		else if (!strncmp(kstri,"</",2))
+-		  {_error2_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
++		  {_error_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
+ 		else if (strncmp(kstri,"<",1))
+-		  {_error2_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
++		  {_error_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
+ 
+ 		else if (!strcmp(kstri,"<fill>"))
+ 			KMLFileTokenParse(&fill      ,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13055)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13056)
+@@ -21,11 +21,9 @@
+ AM_SILENT_RULES([yes])           #Do not show compilation command by default
+ AM_PROG_CC_C_O
+ AM_PROG_AR
+-AC_PROG_RANLIB 
++AC_PROG_RANLIB
+ 
+-# To produce shared libraries uncomment LT_INIT. In theory, Libtool can be initialized
+-# even if all linking is static, since, if not shared libraries are to be produce, libtool
+-# will act simply as a wrapper around AR and Ranlib.
++#Libtool
+ #LT_INIT
+ 
+ #Run issm_options.m4
Index: /issm/oecreview/Archive/12678-13393/ISSM-13056-13057.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13056-13057.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13056-13057.diff	(revision 13394)
@@ -0,0 +1,86 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13056)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13057)
+@@ -5,22 +5,22 @@
+ #Library declaration {{{
+ lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+-if SHAREDLIBS
+-lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
+-endif
++#if SHAREDLIBS
++#lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
++#endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+ if MATLAB
+-if SHAREDLIBS
+-lib_LTLIBRARIES += libISSMMatlab.la
+-endif
++#if SHAREDLIBS
++#lib_LTLIBRARIES += libISSMMatlab.la
++#endif
+ lib_LIBRARIES += libISSMMatlab.a 
+ endif
+ if MODULES
+-if SHAREDLIBS
+-lib_LTLIBRARIES += libISSMModules.la
+-endif
++#if SHAREDLIBS
++#lib_LTLIBRARIES += libISSMModules.la
++#endif
+ lib_LIBRARIES += libISSMModules.a 
+ endif
+ #}}}
+@@ -1010,23 +1010,23 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
+-if SHAREDLIBS
+-libISSM_la_SOURCES = solutions/issm.cpp
+-libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
++#if SHAREDLIBS
++#libISSM_la_SOURCES = solutions/issm.cpp
++#libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
+ 
+-libISSMCore_la_SOURCES  = $(issm_sources)
+-libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
++#libISSMCore_la_SOURCES  = $(issm_sources)
++#libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
+ 
+-libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
+-endif
++#libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++#endif
+ 
+ if MODULES
+-if SHAREDLIBS
+-libISSMModules_la_SOURCES = $(module_sources)
+-libISSMModules_la_SOURCES += $(bamg_sources)
+-libISSMModules_la_SOURCES += $(kriging_sources)
+-libISSMModules_la_SOURCES += $(kml_sources)
+-endif
++#if SHAREDLIBS
++#libISSMModules_la_SOURCES = $(module_sources)
++#libISSMModules_la_SOURCES += $(bamg_sources)
++#libISSMModules_la_SOURCES += $(kriging_sources)
++#libISSMModules_la_SOURCES += $(kml_sources)
++#endif
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+ libISSMModules_a_SOURCES += $(kriging_sources)
+@@ -1041,9 +1041,9 @@
+ endif
+ 
+ if MATLAB
+-if SHAREDLIBS
+-libISSMMatlab_la_SOURCES = $(matlab_sources)
+-endif
++#if SHAREDLIBS
++#libISSMMatlab_la_SOURCES = $(matlab_sources)
++#endif
+ libISSMMatlab_a_SOURCES = $(matlab_sources)
+ libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
+ endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-13057-13058.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13057-13058.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13057-13058.diff	(revision 13394)
@@ -0,0 +1,42 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13057)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13058)
+@@ -250,14 +250,14 @@
+ 
+ 	#Create vertices_type
+ 	md.flowequation.vertex_equation=numpy.zeros(md.mesh.numberofvertices)
+-	pos=numpy.nonzero(nodeonhutter)
+-	md.flowequation.vertex_equation[pos]=1
+ 	pos=numpy.nonzero(nodeonmacayeal)
+ 	md.flowequation.vertex_equation[pos]=2
+ 	pos=numpy.nonzero(nodeonl1l2)
+ 	md.flowequation.vertex_equation[pos]=8
+ 	pos=numpy.nonzero(nodeonpattyn)
+ 	md.flowequation.vertex_equation[pos]=3
++	pos=numpy.nonzero(nodeonhutter)
++	md.flowequation.vertex_equation[pos]=1
+ 	pos=numpy.nonzero(nodeonmacayealpattyn)
+ 	md.flowequation.vertex_equation[pos]=5
+ 	pos=numpy.nonzero(nodeonstokes)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 13057)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 13058)
+@@ -257,14 +257,14 @@
+ 
+ %Create vertices_type
+ md.flowequation.vertex_equation=zeros(md.mesh.numberofvertices,1);
+-pos=find(nodeonhutter);
+-md.flowequation.vertex_equation(pos)=1;
+ pos=find(nodeonmacayeal);
+ md.flowequation.vertex_equation(pos)=2;
+ pos=find(nodeonl1l2);
+ md.flowequation.vertex_equation(pos)=8;
+ pos=find(nodeonpattyn);
+ md.flowequation.vertex_equation(pos)=3;
++pos=find(nodeonhutter);
++md.flowequation.vertex_equation(pos)=1;
+ pos=find(nodeonmacayealpattyn);
+ md.flowequation.vertex_equation(pos)=5;
+ pos=find(nodeonstokes);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13058-13059.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13058-13059.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13058-13059.diff	(revision 13394)
@@ -0,0 +1,44 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13058)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13059)
+@@ -89,7 +89,7 @@
+ 			md = checkfield(md,'inversion.nsteps','numel',[1],'>=',1);
+ 			md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
+ 			md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps 1]);
+-			md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps num_costfunc],'values',[101:105 201 501:503 377:378]);
++			md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps num_costfunc],'values',[101:105 201 501:505]);
+ 			md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
+ 			md = checkfield(md,'inversion.gradient_only','values',[0 1]);
+ 			md = checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
+@@ -173,6 +173,8 @@
+ 			pos=find(data==501); data(pos)=DragCoefficientAbsGradientEnum();
+ 			pos=find(data==502); data(pos)=RheologyBbarAbsGradientEnum();
+ 			pos=find(data==503); data(pos)=ThicknessAbsGradientEnum();
++			pos=find(data==504); data(pos)=ThicknessAlongGradientEnum();
++			pos=find(data==505); data(pos)=ThicknessAcrossGradientEnum();
+ 			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);
+ 			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');
+ 		end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13058)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13059)
+@@ -128,7 +128,7 @@
+ 		md = checkfield(md,'inversion.nsteps','numel',[1],'>=',1)
+ 		md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps],'>=',0)
+ 		md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps])
+-		md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps,num_costfunc],'values',[101,102,103,104,105,201,501,502,503,377,378])
++		md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps,num_costfunc],'values',[101,102,103,104,105,201,501,502,503,504,505])
+ 		md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices,num_costfunc],'>=',0)
+ 		md = checkfield(md,'inversion.gradient_only','values',[0,1])
+ 		md = checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps,num_controls])
+@@ -183,6 +183,8 @@
+ 		data[[i for i,item in enumerate(data) if item==501]]=DragCoefficientAbsGradientEnum()
+ 		data[[i for i,item in enumerate(data) if item==502]]=RheologyBbarAbsGradientEnum()
+ 		data[[i for i,item in enumerate(data) if item==503]]=ThicknessAbsGradientEnum()
++		data[[i for i,item in enumerate(data) if item==504]]=ThicknessAlongGradientEnum()
++		data[[i for i,item in enumerate(data) if item==505]]=ThicknessAcrossGradientEnum()
+ 		WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3)
+ 		WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer')
+ 	# }}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13059-13060.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13059-13060.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13059-13060.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/historyISSM.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/historyISSM.m	(revision 13059)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/historyISSM.m	(revision 13060)
+@@ -2,11 +2,8 @@
+ runme('id',[101]);
+ md.mesh.numberofelements
+ md=mesh(md,'DomainOutline.exp',5000);
+-md=setmask(md,'','');
+ md=setflowequation(md,'macayeal','all');
+-md=setflowequation(md,'pattyn','all','stokes','all');
+ md=solve(md,TransientSolutionEnum);
+-md=solve(md,BalancedthicknessSolutionEnum);
+ md=solve(md,DiagnosticSolutionEnum);
+ md=loadresultsfromcluster(md);
+ plotmodel(md,'data',md.results.DiagnosticSolution.Vel)
Index: /issm/oecreview/Archive/12678-13393/ISSM-13060-13061.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13060-13061.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13060-13061.diff	(revision 13394)
@@ -0,0 +1,187 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/cubic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/cubic.cpp	(revision 13060)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/cubic.cpp	(revision 13061)
+@@ -1,96 +1,75 @@
+ #include <math.h>
+ #include "./numerics.h"
+ 
+-int signR(double Z){
+-	int ret;
+-	if (Z > 0.0)	ret = 1;
+-	if (Z < 0.0)	ret = -1;
+-	if (Z == 0.0)	ret =0;
++int cubic(IssmDouble a,IssmDouble b,IssmDouble c,IssmDouble d, IssmDouble x[3], int* num){
++	/* Find the real roots of linear/quadratic and cubic equations:
++	 *
++	 *   a x^3 + bx^2 + cx + d = 0
++	 *
++	 *   returns the roots in x
++	 *   num is the number of roots */
+ 
+-	return ret;
+-}
++	/*Some useful constants*/
++	const IssmDouble pi    = 3.1415926535897932;
++	const IssmDouble third = 1./3.;
+ 
+-double CBRT(double Z){
+-	double ret;
+-	const double THIRD = 1./3.;
+-	//define cubic root as statement function
+-	//SIGN has different meanings in both C and Fortran
+-	// Was unable to use the sign command of C, so wrote my own
+-	// that why a new variable needs to be introduced that keeps track of the sign of
+-	// SIGN is supposed to return a 1, -1 or 0 depending on what the sign of the argument is
+-	ret = fabs(pow(fabs(Z),THIRD)) * signR(Z);
+-	return ret;
+-}
++	/*Intermediaries*/
++	IssmDouble U[3],W,P,Q,delta,phi;
+ 
+-int cubic(double A[4], double X[3], int* num){
+-	const double PI = 3.1415926535897932;
+-	const double THIRD = 1./3.;
+-	double U[3],W, P, Q, DIS, PHI;
+-	int i;
+-
+-	//define cubic root as statement function
+-	// In C, the function is defined outside of the cubic fct
+-
+-	// ====determine the degree of the polynomial ====
+-
+-	if (A[3] != 0.0){
++	/* determine the degree of the polynomial */
++	if (a != 0.0){
+ 		//cubic problem
+-		W = A[2]/A[3]*THIRD;
+-		P = pow((A[1]/A[3]*THIRD - pow(W,2)),3);
+-		Q = -.5*(2.0*pow(W,3)-(A[1]*W-A[0])/A[3] );
+-		DIS = pow(Q,2)+P;
+-		if ( DIS < 0.0 ){
++		W     = b/a *third;
++		P     = pow((c/a *third - pow(W,2)),3);
++		Q     = -.5 *(2.0*pow(W,3)-(c*W-d)/a );
++		delta = pow(Q,2)+P;
++		if ( delta < 0.0 ){
+ 			//three real solutions!
+-			//Confine the argument of ACOS to the interval [-1;1]!
+-			PHI = acos(min(1.0,max(-1.0,Q/sqrt(-P))));
+-			P=2.0*pow((-P),(5.e-1*THIRD));
+-			for (i=0;i<3;i++)	U[i] = P*cos((PHI+2*((double)i)*PI)*THIRD)-W;
+-			X[0] = min(U[0], min(U[1], U[2]));
+-			X[1] = max(min(U[0], U[1]),max( min(U[0], U[2]), min(U[1], U[2])));
+-			X[2] = max(U[0], max(U[1], U[2]));
++			//Confine the argument of coeffCOS to the interval [-1;1]!
++			phi = acos(min(1.0,max(-1.0,Q/sqrt(-P))));
++			P   = 2.0*pow((-P),(5.e-1*third));
++			for(int i=0;i<3;i++)	U[i] = P*cos((phi+2*((IssmDouble)i)*pi)*third)-W;
++			x[0] = min(U[0], min(U[1], U[2]));
++			x[1] = max(min(U[0], U[1]),max( min(U[0], U[2]), min(U[1], U[2])));
++			x[2] = max(U[0], max(U[1], U[2]));
+ 			*num = 3;
+ 		}
+ 		else{
+ 			// only one real solution!
+-			DIS = sqrt(DIS);
+-			X[0] = CBRT(Q+DIS)+CBRT(Q-DIS)-W;
++			delta = sqrt(delta);
++			x[0] = pow(Q+delta,third)+pow(Q-delta,third)-W;
+ 			*num=1;
+ 		}
+ 	}
+-	else if (A[2] != 0.0){
++	else if (b != 0.0){
+ 		// quadratic problem
+-		P = 0.5*A[1]/A[2];
+-		DIS = pow(P,2)-A[0]/A[2];
+-		if (DIS > 0.0)
+-		{
++		P     = 0.5*c/b;
++		delta = pow(P,2)-d/b;
++		if (delta > 0.0){
+ 			// 2 real solutions
+-			X[0] = -P - sqrt(DIS);
+-			X[1] = -P + sqrt(DIS);
+-			*num=2;
++			x[0] = -P - sqrt(delta);
++			x[1] = -P + sqrt(delta);
++			*num = 2;
+ 		}
+-		else
+-		{
++		else{
+ 			// no real solution
+-			*num=0;
++			*num = 0;
+ 		}
+ 	}
+-	else if (A[1] != 0.0)
+-	{
++	else if (c != 0.0){
+ 		//linear equation
+-		X[0] =A[0]/A[1];
+-		*num=1;
++		x[0] = d/c;
++		*num = 1;
+ 	}
+-	else
+-	{
++	else{
+ 		//no equation
+-		*num=0;
++		*num = 0;
+ 	}
+- /*
+-  *     ==== perform one step of a newton iteration in order to minimize
+-  *          round-off errors ====
+-  */
+-	for (i=0;i<*num;i++){
+-		X[i] = X[i] - (A[0]+X[i]*(A[1]+X[i]*(A[2]+X[i]*A[3])))/(A[1]+X[i]*(2.0*A[2]+X[i]*3.0*A[3]));
++
++	/* perform one step of a newton iteration in order to minimize round-off errors */
++	for(int i=0;i<*num;i++){
++		x[i] = x[i] - (d+x[i]*(c+x[i]*(b+x[i]*a)))/(c+x[i]*(2.0*b+x[i]*3.0*a));
+ 	}
++
+ 	return 0;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/numerics.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/numerics.h	(revision 13060)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/numerics.h	(revision 13061)
+@@ -16,20 +16,20 @@
+ struct OptArgs;
+ struct OptPars;
+ 
+-IssmDouble min(IssmDouble a,IssmDouble b);
+-IssmDouble max(IssmDouble a,IssmDouble b);
+-int    min(int a,int b);
+-int    max(int a,int b);
+-IssmDouble OptFunc(IssmDouble scalar, OptArgs* optargs);
+-void   BrentSearch(IssmDouble* psearch_scalar,IssmDouble* pJ,OptPars* optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs* optargs);
+-void   OptimalSearch(IssmDouble* psearch_scalar,IssmDouble* pJ,OptPars* optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs* optargs);
+-void   cross(IssmDouble* result,IssmDouble* vector1,IssmDouble* vector2);
+-void   IsInputConverged(IssmDouble* peps, Input** new_inputs,Input** old_inputs,int num_inputs,int criterion_enum);
+-void   UnitConversion(IssmDouble* values, int numvalues,int direction_enum, int type_enum);
+-IssmDouble UnitConversion(IssmDouble value, int direction_enum, int type_enum);
+-char*  OptionsFromAnalysis(Parameters* parameters,int analysis_type);
+-void   XZvectorsToCoordinateSystem(IssmDouble* T,IssmDouble* xzvectors);
+-int cubic(double A[4], double X[3], int* num);
++IssmDouble  min(IssmDouble a,IssmDouble b);
++IssmDouble  max(IssmDouble a,IssmDouble b);
++int         min(int a,int b);
++int         max(int a,int b);
++IssmDouble  OptFunc(IssmDouble scalar, OptArgs *optargs);
++void        BrentSearch(IssmDouble *psearch_scalar,IssmDouble*pJ,OptPars*optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs*optargs);
++void        OptimalSearch(IssmDouble *psearch_scalar,IssmDouble*pJ,OptPars*optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs*optargs);
++void        cross(IssmDouble *result,IssmDouble*vector1,IssmDouble*vector2);
++void        IsInputConverged(IssmDouble *peps, Input**new_inputs,Input**old_inputs,int num_inputs,int criterion_enum);
++void        UnitConversion(IssmDouble *values, int numvalues,int direction_enum, int type_enum);
++IssmDouble  UnitConversion(IssmDouble value, int direction_enum, int type_enum);
++char       *OptionsFromAnalysis(Parameters *parameters,int analysis_type);
++void        XZvectorsToCoordinateSystem(IssmDouble *T,IssmDouble*xzvectors);
++int         cubic(IssmDouble a, IssmDouble b, IssmDouble c, IssmDouble d, double X[3], int *num);
+ #ifdef _HAVE_PETSC_
+ void   PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type);
+ #endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-13061-13062.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13061-13062.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13061-13062.diff	(revision 13394)
@@ -0,0 +1,69 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13061)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13062)
+@@ -55,38 +55,33 @@
+ 
+ 	/*Intermediary: */
+ 	int     i;
+-	double* doubleA=NULL;
+-	double* doubleB=NULL;
+-	double* doubleX=NULL;
++	IssmPDouble* pdoubleA=NULL;
++	IssmPDouble* pdoubleB=NULL;
++	IssmPDouble* pdoubleX=NULL;
+ 
+ 	/*First, transfer from IssmDouble to double all our matrices and vectors: */
+-	doubleA=xNew<double>(n*n);
+-	doubleB=xNew<double>(n);
+-	for(i=0;i<n*n;i++)A[i]>>=doubleA[i];
+-	for(i=0;i<n;i++)B[i]>>=doubleB[i];
++	pdoubleA=xNew<double>(n*n);
++	pdoubleB=xNew<double>(n);
++	for(i=0;i<n*n;i++)pdoubleA[i]=reCast<IssmPDouble>(A[i]);
++	for(i=0;i<n;i++)pdoubleB[i]=reCast<IssmPDouble>(B[i]);
+ 	
+ 	/*Call wrapped solver: */
+-	SolverxSeq(&doubleX,doubleA, doubleB, n);
++	SolverxSeq(&pdoubleX,pdoubleA, pdoubleB, n);
+ 
+ 	/*Transfer solution vector from double to IssmDouble: */
+ 	X = xNew<IssmDouble>(n);
+-	for(i=0;i<n;i++)X[i]<<=doubleX[i];
++	for(i=0;i<n;i++)X[i]=reCast<IssmDouble>(pdoubleX[i]);
+ 
+ 	/*Free ressources:*/
+-	xDelete<double>(doubleA);
+-	xDelete<double>(doubleB);
++	xDelete<IssmPDouble>(pdoubleA);
++	xDelete<IssmPDouble>(pdoubleB);
+ 
+ 	/*Assign output pointers: */
+ 	*pX=X;
+ }
+ /*}}}*/
+ #endif
+-//void SolverxSeq(double** pX,double* A,double* B,int n){ //{{{
+-#ifdef _HAVE_ADOLC_
+-void SolverxSeq(double** pX,double* A,double* B,int n){ 
+-#else
+-void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){
+-#endif
++void SolverxSeq(IssmPDouble** pX,IssmPDouble* A,IssmPDouble* B,int n){ //{{{
+ 	#ifdef _HAVE_GSL_
+ 	/*GSL Matrices and vectors: */
+ 	int              s;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/ad/todo
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/ad/todo	(revision 13061)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/ad/todo	(revision 13062)
+@@ -42,3 +42,9 @@
+ Check that the new code  is modular --without-kml, options are up to date.
+ 
+ Replace memcpy, realloc with x layers.  Replace all calls to malloc and free in the code.
++
++
++
++Questions: 
++set of active IssmDouble variables different from set of independent variables activated with <<=? 
++same thing dependent variables? 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13062-13063.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13062-13063.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13062-13063.diff	(revision 13394)
@@ -0,0 +1,36 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/cubic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/cubic.cpp	(revision 13062)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/cubic.cpp	(revision 13063)
+@@ -1,6 +1,22 @@
+ #include <math.h>
+ #include "./numerics.h"
+ 
++IssmDouble CBRT(IssmDouble Z){
++
++	IssmDouble ret;
++
++	if (Z> 0.0){
++		ret = fabs(pow(fabs(Z),1./3.));
++	}
++	else if(Z< 0.0){
++		ret = - fabs(pow(fabs(Z),1./3.));
++	}
++	else{
++		ret = 0.;
++	}
++	return ret;
++}
++
+ int cubic(IssmDouble a,IssmDouble b,IssmDouble c,IssmDouble d, IssmDouble x[3], int* num){
+ 	/* Find the real roots of linear/quadratic and cubic equations:
+ 	 *
+@@ -37,7 +53,7 @@
+ 		else{
+ 			// only one real solution!
+ 			delta = sqrt(delta);
+-			x[0] = pow(Q+delta,third)+pow(Q-delta,third)-W;
++			x[0] = CBRT(Q+delta)+CBRT(Q-delta)-W;
+ 			*num=1;
+ 		}
+ 	}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13063-13064.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13063-13064.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13063-13064.diff	(revision 13394)
@@ -0,0 +1,71 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13063)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13064)
+@@ -8181,7 +8181,6 @@
+ 	 *
+ 	 * A X^3 + A |rho g (s-z) grad(s)|^2 X - |eps_b|_// = 0     */
+ 
+-	_error_("Not supported yet");
+ 	int        i;
+ 	IssmDouble a,c,d,z,s,viscosity;
+ 	IssmDouble tau_perp,tau_par,eps_b,A;
+@@ -8199,7 +8198,7 @@
+ 	surface_input->GetInputValue(&s,gauss);
+ 	surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
+ 	PentaRef::GetInputValue(&z,&z_list[0],gauss);
+-	tau_perp = matpar->GetRhoIce() * matpar->GetG() * (s-z)*sqrt(slope[0]*slope[0]+slope[1]*slope[1]);
++	tau_perp = matpar->GetRhoIce() * matpar->GetG() * fabs(s-z)*sqrt(slope[0]*slope[0]+slope[1]*slope[1]);
+ 
+ 	/* Get eps_b*/
+ 	vx_input->GetVxStrainRate3dPattyn(epsilonvx,xyz_list,gauss);
+@@ -8207,7 +8206,7 @@
+ 	for(i=0;i<5;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i];
+ 	eps_b = sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[0]*epsilon[1] + epsilon[2]*epsilon[2]);
+ 	if(eps_b==0.){
+-		*pviscosity=2.5*pow(10.,17.);
++		*pviscosity = 2.5e+17;
+ 		return;
+ 	}
+ 
+@@ -8215,30 +8214,19 @@
+ 	_assert_(matice->GetN()==3.0);
+ 	A=matice->GetA();
+ 
+-	/*Solve for tau_par (http://en.wikipedia.org/wiki/Cubic_function)*/
+-	a=A;
+-	c=A*tau_perp*tau_perp;
+-	d=-eps_b;
+-	tau_par = -1./(3.*a) * pow(0.5*(27.*a*a*d + sqrt(27.*a*a*d*27.*a*a*d -4.*pow(-3.*a*c,3.))),1./3.);
+-
+-	//printf("=======================================\n");
+-	//printf("tau_par = %g (%g=0?)\n",tau_par,a*tau_par*tau_par*tau_par+c*tau_par+d);
+-	//printf("a=%g c=%g d=%g\n",a,c,d);
+-	//IssmDouble coeff[4];
+-	//coeff[0]=d;
+-	//coeff[1]=c;
+-	//coeff[2]=0.;
+-	//coeff[3]=a;
+-	//int numroots;
+-	//IssmDouble roots[3];
+-	//cubic(coeff,roots,&numroots);
+-	//tau_par=roots[0];
+-	//for(i=0;i<numroots;i++) printf(" %g ",roots[i]);
++	/*Solve for tau_perp*/
++	int        numroots;
++	IssmDouble roots[3];
++	a = A;
++	c = A *tau_perp*tau_perp;
++	d = - eps_b;
++	cubic(a,0.,c,d,roots,&numroots);
++	tau_par=roots[0];
+ 	//printf(" (%g =0?)\n",a*roots[0]*roots[0]*roots[0]+c*roots[0]+d);
+-	
+ 
+ 	/*Viscosity*/
+-	viscosity = 1./(2.*A)*pow(tau_par*tau_par + tau_perp*tau_perp ,-2.);
++	viscosity = 1./(2.*A*(tau_par*tau_par + tau_perp*tau_perp));
++	//printf("denom = %g (%g,%g)\n",tau_par*tau_par + tau_perp*tau_perp,tau_par,tau_perp);
+ 	_assert_(!isnan(viscosity));
+ 
+ 	/*Assign output pointer*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-13064-13065.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13064-13065.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13064-13065.diff	(revision 13394)
@@ -0,0 +1,41 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13064)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13065)
+@@ -8182,7 +8182,7 @@
+ 	 * A X^3 + A |rho g (s-z) grad(s)|^2 X - |eps_b|_// = 0     */
+ 
+ 	int        i;
+-	IssmDouble a,c,d,z,s,viscosity;
++	IssmDouble z,s,viscosity,p,q,delta;
+ 	IssmDouble tau_perp,tau_par,eps_b,A;
+ 	IssmDouble epsilonvx[5]; /*exx eyy exy exz eyz*/
+ 	IssmDouble epsilonvy[5]; /*exx eyy exy exz eyz*/
+@@ -8214,20 +8214,17 @@
+ 	_assert_(matice->GetN()==3.0);
+ 	A=matice->GetA();
+ 
+-	/*Solve for tau_perp*/
+-	int        numroots;
+-	IssmDouble roots[3];
+-	a = A;
+-	c = A *tau_perp*tau_perp;
+-	d = - eps_b;
+-	cubic(a,0.,c,d,roots,&numroots);
+-	tau_par=roots[0];
+-	//printf(" (%g =0?)\n",a*roots[0]*roots[0]*roots[0]+c*roots[0]+d);
++	/*Solve for tau_perp (http://fr.wikipedia.org/wiki/Méthode_de_Cardan)*/
++	p     = tau_perp *tau_perp;
++	q     = - eps_b/A;
++	delta = q *q + p*p*p*4./27.;
++	_assert_(delta>0);
++	tau_par = pow(0.5*(-q+sqrt(delta)),1./3.) - pow(0.5*(q+sqrt(delta)),1./3.);
+ 
+ 	/*Viscosity*/
+ 	viscosity = 1./(2.*A*(tau_par*tau_par + tau_perp*tau_perp));
+-	//printf("denom = %g (%g,%g)\n",tau_par*tau_par + tau_perp*tau_perp,tau_par,tau_perp);
+ 	_assert_(!isnan(viscosity));
++	_assert_(viscosity > 0.);
+ 
+ 	/*Assign output pointer*/
+ 	*pviscosity = viscosity;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13065-13066.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13065-13066.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13065-13066.diff	(revision 13394)
@@ -0,0 +1,41 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 13065)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 13066)
+@@ -26,7 +26,7 @@
+ 	int penpair_ids[2];
+ 	int dim;
+ 	int numberofvertices;
+-	bool ismacayealpattyn,isstokes;
++	bool ismacayealpattyn,isstokes,isl1l2;
+ 	int  numpenalties,numberofpressureloads,numrifts,numriftsegments;
+ 	double *pressureload   = NULL;
+ 	double *elements_type  = NULL;
+@@ -41,6 +41,7 @@
+ 	/*Fetch parameters: */
+ 	iomodel->Constant(&dim,MeshDimensionEnum);
+ 	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
++	iomodel->Constant(&isl1l2,FlowequationIsl1l2Enum);
+ 	iomodel->Constant(&isstokes,FlowequationIsstokesEnum);
+ 	iomodel->Constant(&ismacayealpattyn,FlowequationIsmacayealpattynEnum);
+ 	iomodel->Constant(&numrifts,RiftsNumriftsEnum);
+@@ -52,7 +53,7 @@
+ 	if(!loads) loads = new Loads();
+ 
+ 	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
+-	if (!ismacayealpattyn & !isstokes){
++	if(!ismacayealpattyn & !isstokes & !isl1l2){
+ 		*ploads=loads;
+ 		return;
+ 	}
+@@ -89,6 +90,10 @@
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 		}
++		else if ((int)*(elements_type+element)==(L1L2ApproximationEnum)){
++			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum));
++			count++;
++		}
+ 		else if ((int)*(elements_type+element)==(PattynApproximationEnum)){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,PattynIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13066-13067.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13066-13067.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13066-13067.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13066)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13067)
+@@ -14,7 +14,7 @@
+ 	bool  dakota_analysis,control_analysis,tao_analysis;
+ 
+ 	/*AD: */
+-	int   tape_stats[11];
++	size_t   tape_stats[11];
+ 
+ 	/*FemModel: */
+ 	FemModel *femmodel = NULL;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13067-13068.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13067-13068.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13067-13068.diff	(revision 13394)
@@ -0,0 +1,21 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13067)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13068)
+@@ -1048,11 +1048,11 @@
+ libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
+ endif
+ 
+-if VERSION
+-AM_LDFLAGS =
+-else
+-AM_LDFLAGS = -avoid-version
+-endif
++#if VERSION
++#AM_LDFLAGS =
++#else
++#AM_LDFLAGS = -avoid-version
++#endif
+ #}}}
+ #Overload library, to overload any non-standard symbols. {{{
+ libISSMOverload_a_SOURCES = ./shared/String/stricmp.c
Index: /issm/oecreview/Archive/12678-13393/ISSM-13068-13069.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13068-13069.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13068-13069.diff	(revision 13394)
@@ -0,0 +1,59 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-macosx64.sh	(revision 13068)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-macosx64.sh	(revision 13069)
+@@ -2,22 +2,32 @@
+ 
+ #some issues on macosx64 with ISSM's autoconf. you might want to run native to mac on this.
+ 
++#choose dev or not? 
++devpmt=1;
++
+ #Some cleanup
+-rm -rf install ADOL-C-2.2.0 src
++rm -rf install ADOL-C-2.2.0 src trunk
+ 
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C-2.2.0.tar.gz' 'ADOL-C-2.2.0.tar.gz'
+-
+ #Create install directories
+ mkdir install src
+ 
+-#Untar 
+-tar -zxvf  ADOL-C-2.2.0.tar.gz
++if [[ $devpmt == "0" ]]; then
++	#Download from ISSM server
++	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C-2.2.0.tar.gz' 'ADOL-C-2.2.0.tar.gz'
++	
++	#Untar 
++	tar -zxvf  ADOL-C-2.2.0.tar.gz
+ 
+-#Move ADOL-C into install directory
+-mv ADOL-C-2.2.0/* src
+-rm -rf ADOL-C-2.2.0
++	#Move ADOL-C into install directory
++	mv ADOL-C-2.2.0/* src
++	rm -rf ADOL-C-2.2.0
+ 
++else
++	svn co https://projects.coin-or.org/svn/ADOL-C/trunk
++	mv trunk/* src
++fi
++
++
+ #Compile ADOL-C
+ cd src 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc	(revision 13068)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc	(revision 13069)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++trunk
+ *.gz
+ install*
+ src
Index: /issm/oecreview/Archive/12678-13393/ISSM-13069-13070.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13069-13070.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13069-13070.diff	(revision 13394)
@@ -0,0 +1,51 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py	(revision 13069)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py	(revision 13070)
+@@ -1,10 +1,11 @@
+ from numpy import *
+ from verbose import *
+ import scipy.io as matio
+-import InterpFromMeshToMesh2d as im
+-from   paterson import  *
++from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
++from paterson import  *
+ from SetIceShelfBC import *
+ import inspect
++import os.path
+ 
+ #Start defining model parameters here
+ #Geometry
+@@ -28,8 +29,8 @@
+ index=mat['index'].astype(float)
+ index=reshape(index.T,(len(index),3),order='F')
+ 
+-md.initialization.vx = im.InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
+-md.initialization.vy = im.InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
++[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)
+ md.initialization.vz = zeros(md.mesh.numberofvertices)
+ md.initialization.pressure = zeros(md.mesh.numberofvertices)
+ #Materials
+@@ -61,5 +62,5 @@
+ md = SetIceShelfBC(md)
+ #Change name so that no tests have the same name
+ if len(inspect.stack()) > 2:
+-    md.miscellaneous.name = inspect.stack()[2][1].split('.')[0]
++	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py	(revision 13069)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py	(revision 13070)
+@@ -13,8 +13,8 @@
+ md=parameterize(md,'../Par/SquareShelfConstrained.py')
+ md=setflowequation(md,'macayeal','all')
+ md.cluster=generic('name',oshostname(),'np',3)
+-md.diagnostic.requested_outputs=StressTensorEnum
+-md=solve(md,DiagnosticSolutionEnum)
++md.diagnostic.requested_outputs=StressTensorEnum()
++md=solve(md,DiagnosticSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+ field_names     =['Vx','Vy','Vel','Pressure',\
Index: /issm/oecreview/Archive/12678-13393/ISSM-13070-13071.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13070-13071.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13070-13071.diff	(revision 13394)
@@ -0,0 +1,385 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py	(revision 13071)
+@@ -5,11 +5,11 @@
+ import shutil
+ from MatlabFuncs import *
+ 
+-def scpin(host, login,port,path, packages):
++def issmscpin(host, login,port,path, packages):
+ 	"""
+-	SCPIN get packages from host, using scp on unix, and pscp on windows
++	ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
+  
+-	   usage: scpin(host,packages,path)
++	   usage: issmscpin(host,packages,path)
+ 	"""
+ 
+ 	#first get hostname
+@@ -41,7 +41,7 @@
+ 			if 'ISSM_DIR_WIN' in os.environ:
+ 				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
+ 			else:
+-				raise OSError("scpin error message: could not find ISSM_DIR_WIN environment variable.")
++				raise OSError("issmscpin error message: could not find ISSM_DIR_WIN environment variable.")
+ 
+ 			username=raw_input('Username: (quoted string) ')
+ 			key=raw_input('Key: (quoted string) ')
+@@ -50,7 +50,7 @@
+ 				try:
+ 					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s:%s %s' % (ISSM_DIR,username,key,host,os.path.join(path,package),os.getcwd()),shell=True)
+ 				except CalledProcessError as e:
+-					raise CalledProcessError("scpin error message: could not call putty pscp.")
++					raise CalledProcessError("issmscpin error message: could not call putty pscp.")
+ 
+ 		else:
+ 			#just use standard unix scp
+@@ -72,5 +72,5 @@
+ 			#check scp worked
+ 			for package in packages:
+ 				if not os.path.exists(os.path.join('.',package)):
+-					raise OSError("scpin error message: could not call scp on *nix system.")
++					raise OSError("issmscpin error message: could not call scp on *nix system.")
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py	(revision 13071)
+@@ -2,22 +2,15 @@
+ import platform
+ import subprocess
+ import os
+-import shutil
+ from MatlabFuncs import *
+ 
+ def issmscpout(host,path,login,port,packages):
+ 	"""
+-	SCPOUT send packages to a host, using scp on unix, and pscp on windows
++	ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
+  
+-	   usage: scpout(host,path,packages)
++	   usage: issmscpout(host,path,packages)
+ 	"""
+ 
+-	print "host=",host
+-	print "path=",path
+-	print "login=",login
+-	print "port=",port
+-	print "packages=",packages
+-
+ 	#get hostname
+ 	hostname=socket.gethostname().lower().split('.')[0]
+ 
+@@ -27,7 +20,10 @@
+ 		for package in packages:
+ 			here=os.getcwd()
+ 			os.chdir(path)
+-			shutil.rmtree(package)
++			try:
++				os.remove(package)
++			except OSError as e:
++				pass
+ 			subprocess.call('ln -s %s %s' % (os.path.join(here,package),path),shell=True)
+ 			os.chdir(here)
+ 	else:
+@@ -38,7 +34,7 @@
+ 			if 'ISSM_DIR_WIN' in os.environ:
+ 				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
+ 			else:
+-				raise OSError("scpout error message: could not find ISSM_DIR_WIN environment variable.")
++				raise OSError("issmscpout error message: could not find ISSM_DIR_WIN environment variable.")
+ 
+ 			username=raw_input('Username: (quoted string) ')
+ 			key=raw_input('Key: (quoted string) ')
+@@ -47,7 +43,7 @@
+ 				try:
+ 					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s %s:%s' % (ISSM_DIR,username,key,package,host,path),shell=True)
+ 				except CalledProcessError as e:
+-					raise CalledProcessError("scpout error message: could not call putty pscp.")
++					raise CalledProcessError("issmscpout error message: could not call putty pscp.")
+ 
+ 		else:
+ 			#just use standard unix scp
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.m	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.m	(revision 13071)
+@@ -1,7 +1,7 @@
+-function scpin(host, login,port,path, packages)
+-%SCPIN get packages from host, using scp on unix, and pscp on windows
++function issmscpin(host, login,port,path, packages)
++%ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
+ %
+-%   usage: scpin(host,packages,path)
++%   usage: issmscpin(host,packages,path)
+ %
+ %
+ 
+@@ -34,7 +34,7 @@
+ 		%get ISSM_DIR variable
+ 		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+ 		if status, 
+-			error('scpin error message: could not find ISSM_DIR_WIN environment variable');
++			error('issmscpin error message: could not find ISSM_DIR_WIN environment variable');
+ 		end
+ 		ISSM_DIR=ISSM_DIR(2:end-2);
+ 
+@@ -44,7 +44,7 @@
+ 		for i=1:numel(packages),
+ 			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' host ':' path '/' packages{i} ' ./']);
+ 			if status, 
+-				error('scpin error message: could not call putty pscp');
++				error('issmscpin error message: could not call putty pscp');
+ 			end
+ 		end
+ 
+@@ -71,7 +71,7 @@
+ 		%check scp worked
+ 		for i=1:numel(packages),
+ 			if ~exist(['./' packages{i}]),
+-				error('scpin error message: could not call scp on *nix system');
++				error('issmscpin error message: could not call scp on *nix system');
+ 			end
+ 		end
+ 	end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.m	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.m	(revision 13071)
+@@ -1,7 +1,7 @@
+ function issmscpout(host,path,login,port,packages)
+-%SCPOUT send packages to a host, using scp on unix, and pscp on windows
++%ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
+ %
+-%   usage: scpout(host,path,packages)
++%   usage: issmscpout(host,path,packages)
+ %
+ %
+ 
+@@ -25,7 +25,7 @@
+ 		%get ISSM_DIR variable
+ 		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+ 		if status, 
+-			error('scpout error message: could not find ISSM_DIR_WIN environment variable');
++			error('issmscpout error message: could not find ISSM_DIR_WIN environment variable');
+ 		end
+ 		ISSM_DIR=ISSM_DIR(2:end-2);
+ 
+@@ -35,7 +35,7 @@
+ 		for i=1:numel(packages),
+ 			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' packages{i} ' ' host ':' path]);
+ 			if status, 
+-				error('scpout error message: could not call putty pscp');
++				error('issmscpout error message: could not call putty pscp');
+ 			end
+ 		end
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.py	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.py	(revision 13071)
+@@ -8,6 +8,8 @@
+ from ismodelselfconsistent import *
+ from marshall import *
+ from ispetsc import *
++from waitonlock import *
++from loadresultsfromcluster import *
+ 
+ def solve(md,solutionenum,*args):
+ 	"""
+@@ -78,7 +80,7 @@
+ 	#Write all input files
+ 	marshall(md)                                           # bin file
+ 	md.solver.PetscFile(md.miscellaneous.name+'.petsc')    # petsc file
+-	cluster.BuildQueueScript(md.miscellaneous.name,md.private.runtimename,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
++	cluster.BuildQueueScript(md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
+ 
+ 	#we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+ 	if not ispetsc():
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13071)
+@@ -1,4 +1,5 @@
+ import os
++from parseresultsfromdisk import *
+ from EnumToString import EnumToString
+ 
+ def loadresultsfromdisk(md,filename):
+@@ -27,7 +28,6 @@
+ 		structure=parseresultsfromdisk(filename,~md.settings.io_gather)
+ 		if not len(structure):
+ 			raise RuntimeError("No result found in binary file '%s'. Check for solution crash." % filename)
+-		end
+ 		md.results[structure[1]['SolutionType']]=structure;
+ 
+ 		#recover solution_type from results
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.py	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.py	(revision 13071)
+@@ -3,7 +3,7 @@
+ import time
+ from MatlabFuncs import *
+ 
+-def waitonlock(md,executionpath,login,port):
++def waitonlock(md):
+ 	"""
+ 	WAITONLOCK - wait for a file
+  
+@@ -11,7 +11,7 @@
+ 	   If the time limit given in input is exceeded, return 0
+  
+ 	   Usage:
+-	      flag=waitonlock(md,executionpath)
++	      flag=waitonlock(md)
+ 	"""
+ 
+ 	#Get filename (lock file) and options
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.m	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/waitonlock.m	(revision 13071)
+@@ -1,11 +1,11 @@
+-function flag=waitonlock(md,executionpath,login,port)
++function flag=waitonlock(md)
+ %WAITONLOCK - wait for a file
+ %
+ %   This routine will return when a file named 'filename' is written to disk.
+ %   If the time limit given in input is exceeded, return 0
+ %
+ %   Usage:
+-%      flag=waitonlock(md,executionpath)
++%      flag=waitonlock(md)
+ 
+ %Get filename (lock file) and options
+ executionpath=md.cluster.executionpath;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13071)
+@@ -103,7 +103,7 @@
+ 		if isinstance(data,bool):
+ 			data=numpy.array([data])
+ 		if len(data.shape) == 1:
+-			data=data.reshape(numpy.size(data,0),1)
++			data=data.reshape(1,numpy.size(data,0))
+ 
+ 		#Get size
+ 		s=data.shape
+@@ -123,7 +123,7 @@
+ 		fid.write(struct.pack('i',s[1])) 
+ 		for i in xrange(s[0]):
+ 			for j in xrange(s[1]):
+-				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
++				fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
+ 		# }}}
+ 
+ 	elif strcmpi(format,'IntMat'):    # {{{
+@@ -131,7 +131,7 @@
+ 		if isinstance(data,int):
+ 			data=numpy.array([data])
+ 		if len(data.shape) == 1:
+-			data=data.reshape(numpy.size(data,0),1)
++			data=data.reshape(1,numpy.size(data,0))
+ 
+ 		#Get size
+ 		s=data.shape
+@@ -151,15 +151,15 @@
+ 		fid.write(struct.pack('i',s[1])) 
+ 		for i in xrange(s[0]):
+ 			for j in xrange(s[1]):
+-				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
++				fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
+ 		# }}}
+ 
+ 	elif strcmpi(format,'DoubleMat'):    # {{{
+ 
+-		if isinstance(data,(int,long,float)):
++		if isinstance(data,(bool,int,long,float)):
+ 			data=numpy.array([data])
+ 		if len(data.shape) == 1:
+-			data=data.reshape(numpy.size(data,0),1)
++			data=data.reshape(1,numpy.size(data,0))
+ 
+ 		#Get size
+ 		s=data.shape
+@@ -179,7 +179,7 @@
+ 		fid.write(struct.pack('i',s[1])) 
+ 		for i in xrange(s[0]):
+ 			for j in xrange(s[1]):
+-				fid.write(struct.pack('d',data[i][j]))    #get to the "c" convention, hence the transpose
++				fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
+ 		# }}}
+ 
+ 	elif strcmpi(format,'MatArray'):    # {{{
+@@ -187,6 +187,11 @@
+ 		#first get length of record
+ 		recordlength=4+4    #number of records + code
+ 		for matrix in data:
++			if isinstance(matrix,(bool,int,long,float)):
++				matrix=numpy.array([matrix])
++			if len(matrix.shape) == 1:
++				matrix=matrix.reshape(1,numpy.size(matrix,0))
++
+ 			s=matrix.shape
+ 			recordlength+=4*2+s[0]*s[1]*8    #row and col of matrix + matrix of doubles
+ 
+@@ -201,12 +206,17 @@
+ 
+ 		#write each matrix: 
+ 		for matrix in data:
++			if isinstance(matrix,(bool,int,long,float)):
++				matrix=numpy.array([matrix])
++			if len(matrix.shape) == 1:
++				matrix=matrix.reshape(1,numpy.size(matrix,0))
++
+ 			s=matrix.shape
+ 			fid.write(struct.pack('i',s[0])) 
+ 			fid.write(struct.pack('i',s[1])) 
+ 			for i in xrange(s[0]):
+ 				for j in xrange(s[1]):
+-					fid.write(struct.pack('d',matrix[i][j]))
++					fid.write(struct.pack('d',float(matrix[i][j])))
+ 		# }}}
+ 
+ 	elif strcmpi(format,'StringArray'):    # {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13071)
+@@ -2,6 +2,7 @@
+ import platform
+ import socket
+ from MatlabFuncs import *
++from loadresultsfromdisk import *
+ 
+ def loadresultsfromcluster(md,runtimename=False):
+ 	"""
+@@ -16,7 +17,6 @@
+ 
+ 	if runtimename:
+ 		md.private.runtimename=runtimename
+-	end
+ 
+ 	#Download outputs from the cluster
+ 	filelist=[md.miscellaneous.name+'.outlog',md.miscellaneous.name+'.errlog']
+@@ -27,7 +27,7 @@
+ 			if md.qmu.params['tabular_graphics_data']:
+ 				filelist.append('dakota_tabular.dat')
+ 		filelist.append(md.miscellaneous.name+'.outbin')
+-	Download(cluster,md.private.runtimename,filelist)
++	cluster.Download(md.private.runtimename,filelist)
+ 
+ 	#If we are here, no errors in the solution sequence, call loadresultsfromdisk.
+ 	md=loadresultsfromdisk(md,md.miscellaneous.name+'.outbin')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.m	(revision 13070)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/parameterize.m	(revision 13071)
+@@ -55,3 +55,4 @@
+ 	md.miscellaneous.name=root; 
+ end
+ md.miscellaneous.notes=['Model created by using parameter file: ' parametername ' on: ' datestr(now)];
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-13071-13072.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13071-13072.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13071-13072.diff	(revision 13394)
@@ -0,0 +1,454 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13071)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13072)
+@@ -5,22 +5,22 @@
+ #Library declaration {{{
+ lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+ 
+-#if SHAREDLIBS
+-#lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
+-#endif
++if SHAREDLIBS
++lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la
++endif
+ if PYTHON
+ lib_LIBRARIES += libISSMPython.a 
+ endif
+ if MATLAB
+-#if SHAREDLIBS
+-#lib_LTLIBRARIES += libISSMMatlab.la
+-#endif
++if SHAREDLIBS
++lib_LTLIBRARIES += libISSMMatlab.la
++endif
+ lib_LIBRARIES += libISSMMatlab.a 
+ endif
+ if MODULES
+-#if SHAREDLIBS
+-#lib_LTLIBRARIES += libISSMModules.la
+-#endif
++if SHAREDLIBS
++lib_LTLIBRARIES += libISSMModules.la
++endif
+ lib_LIBRARIES += libISSMModules.a 
+ endif
+ #}}}
+@@ -1010,23 +1010,23 @@
+ libISSMCore_a_SOURCES  = $(issm_sources)
+ libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+ 
+-#if SHAREDLIBS
+-#libISSM_la_SOURCES = solutions/issm.cpp
+-#libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
++if SHAREDLIBS
++libISSM_la_SOURCES = solutions/issm.cpp
++libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la
+ 
+-#libISSMCore_la_SOURCES  = $(issm_sources)
+-#libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
++libISSMCore_la_SOURCES  = $(issm_sources)
++libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)
+ 
+-#libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
+-#endif
++libISSMOverload_la_SOURCES = ./shared/String/stricmp.c
++endif
+ 
+ if MODULES
+-#if SHAREDLIBS
+-#libISSMModules_la_SOURCES = $(module_sources)
+-#libISSMModules_la_SOURCES += $(bamg_sources)
+-#libISSMModules_la_SOURCES += $(kriging_sources)
+-#libISSMModules_la_SOURCES += $(kml_sources)
+-#endif
++if SHAREDLIBS
++libISSMModules_la_SOURCES = $(module_sources)
++libISSMModules_la_SOURCES += $(bamg_sources)
++libISSMModules_la_SOURCES += $(kriging_sources)
++libISSMModules_la_SOURCES += $(kml_sources)
++endif
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+ libISSMModules_a_SOURCES += $(kriging_sources)
+@@ -1041,9 +1041,9 @@
+ endif
+ 
+ if MATLAB
+-#if SHAREDLIBS
+-#libISSMMatlab_la_SOURCES = $(matlab_sources)
+-#endif
++if SHAREDLIBS
++libISSMMatlab_la_SOURCES = $(matlab_sources)
++endif
+ libISSMMatlab_a_SOURCES = $(matlab_sources)
+ libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
+ endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13071)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13072)
+@@ -1,166 +1,232 @@
+ AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++
+ EXEEXT=$(MATLABWRAPPEREXT)
+-#Bin programs {{{1
++
++#Modules {{{1
+ if MODULES
+-bin_PROGRAMS =  AverageFilter\
+-				BamgMesher\
+-				BamgConvertMesh\
+-				BamgTriangulate\
+-				Chaco\
+-				ContourToMesh \
+-				ContourToNodes \
+-				ElementConnectivity\
+-				EnumToString\
+-				Exp2Kml \
+-				HoleFiller \
+-				InternalFront\
+-				InterpFromGridToMesh \
+-				InterpFromMeshToMesh2d \
+-				InterpFromMeshToMesh3d \
+-				InterpFromMeshToGrid \
+-				InterpFromMesh2d \
+-				KMLFileRead \
+-				KMLMeshWrite \
+-				KMLOverlay \
+-				Kml2Exp \
+-				Kriging \
+-				Ll2xy \
+-				NodeConnectivity \
+-				MeshPartition\
+-				MeshProfileIntersection\
+-				PointCloudFindNeighbors\
+-				PropagateFlagsFromConnectivity\
+-				Scotch\
+-				Shp2Kml\
+-				StringToEnum\
+-				TriaSearch\
+-				TriMesh\
+-				TriMeshProcessRifts\
+-				Xy2ll
++lib_LTLIBRARIES =  AverageFilter.la\
++			       BamgMesher.la\
++				   BamgConvertMesh.la\
++				   BamgTriangulate.la\
++				   ContourToMesh.la\
++				   ContourToNodes.la\
++				   ElementConnectivity.la\
++				   EnumToString.la\
++				   Exp2Kml.la\
++				   HoleFiller.la\
++				   InternalFront.la\
++				   InterpFromGridToMesh.la\
++				   InterpFromMeshToMesh2d.la\
++				   InterpFromMeshToMesh3d.la\
++				   InterpFromMeshToGrid.la\
++				   InterpFromMesh2d.la\
++				   KMLFileRead.la\
++				   KMLMeshWrite.la\
++				   KMLOverlay.la\
++				   Kml2Exp.la\
++				   Kriging.la\
++				   Ll2xy.la\
++				   NodeConnectivity.la\
++				   MeshPartition.la\
++				   MeshProfileIntersection.la\
++				   PointCloudFindNeighbors.la\
++				   PropagateFlagsFromConnectivity.la\
++				   Shp2Kml.la\
++				   StringToEnum.la\
++				   TriaSearch.la\
++				   TriMesh.la\
++				   TriMeshProcessRifts.la\
++				   Scotch.la\
++				   Xy2ll.la\
++                   Chaco.la
+ endif 
+ #}}}
+ #Flags and libraries {{{1
+-LDADD = ../../c/libISSMCore.a ../../c/libISSMModules.a $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB)
++if SHAREDLIBS
++deps = ../../c/libISSMCore.la ../../c/libISSMModules.la
++else
++deps = ../../c/libISSMCore.a ../../c/libISSMModules.a
++endif
+ 
++deps +=  $(MATHLIB) ${MEXLIB}
++
++#$(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB) 
++
+ #Triangle library
+ AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
+ 
+ #Matlab part
+-AM_LDFLAGS   = $(MEXLINK)
++AM_LDFLAGS = $(MEXLINK) -shrext ${EXEEXT} -module
++if VERSION
++AM_LDFLAGS +=
++else
++AM_LDFLAGS += -avoid-version
++endif
++if SHAREDLIBS
++deps += ../../c/libISSMMatlab.la 
++else
++deps += ../../c/libISSMMatlab.a
++AM_LDFLAGS += --no-warnings 
++endif
++
+ AM_CXXFLAGS +=  -D_HAVE_MATLAB_MODULES_ -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread 
+-LDADD       += $(MEXLIB) ../../c/libISSMMatlab.a 
+-LDADD       += ../../c/libISSMCore.a 
+-if CIRCULAR_DEPENDENCIES
+-LDADD       += $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB)
++
++######################################################################################
++# Circular dependencies may not be necessary here.
++#deps += ../../c/libISSMCore.a 
++#if CIRCULAR_DEPENDENCIES
++#deps += $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB)
++#endif
++######################################################################################
++
++if SHAREDLIBS
++deps +=
++else
++deps += ../../c/libISSMModules.a ../../c/libISSMCore.a
+ endif
+-LDADD       += ../../c/libISSMModules.a
+ 
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS) 
+ #}}}
++
+ #Bin sources {{{1
+-AverageFilter_SOURCES = ../AverageFilter/AverageFilter.cpp\
++AverageFilter_la_SOURCES = ../AverageFilter/AverageFilter.cpp\
+ 			  ../AverageFilter/AverageFilter.h
++AverageFilter_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-BamgMesher_SOURCES = ../BamgMesher/BamgMesher.cpp\
++BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\
+ 					../BamgMesher/BamgMesher.h
++BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-BamgConvertMesh_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
++BamgConvertMesh_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
+ 					../BamgConvertMesh/BamgConvertMesh.h
++BamgConvertMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-BamgTriangulate_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
++BamgTriangulate_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
+ 								  ../BamgTriangulate/BamgTriangulate.h
++BamgTriangulate_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Chaco_SOURCES = ../Chaco/Chaco.cpp\
++Chaco_la_SOURCES = ../Chaco/Chaco.cpp\
+ 					../Chaco/Chaco.h
++Chaco_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(CHACOLIB)
+ 
+-ContourToMesh_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
+-			  ../ContourToMesh/ContourToMesh.h
++ContourToMesh_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
++			               ../ContourToMesh/ContourToMesh.h
++ContourToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-ContourToNodes_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
++ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
+ 			  ../ContourToNodes/ContourToNodes.h
++ContourToNodes_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-ElementConnectivity_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
++ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+ 			  ../ElementConnectivity/ElementConnectivity.h
++ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-EnumToString_SOURCES = ../EnumToString/EnumToString.cpp\
++EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\
+ 			  ../EnumToString/EnumToString.h
++EnumToString_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-StringToEnum_SOURCES = ../StringToEnum/StringToEnum.cpp\
++StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\
+ 			  ../StringToEnum/StringToEnum.h
++StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-HoleFiller_SOURCES = ../HoleFiller/HoleFiller.cpp\
++HoleFiller_la_SOURCES = ../HoleFiller/HoleFiller.cpp\
+ 			  ../HoleFiller/HoleFiller.h
++HoleFiller_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 
+ 
+-InternalFront_SOURCES = ../InternalFront/InternalFront.cpp\
++InternalFront_la_SOURCES = ../InternalFront/InternalFront.cpp\
+ 										 ../InternalFront/InternalFront.h
++InternalFront_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-InterpFromGridToMesh_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
++InterpFromGridToMesh_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
+ 			  ../InterpFromGridToMesh/InterpFromGridToMesh.h
++InterpFromGridToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-InterpFromMeshToMesh2d_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
++InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
+ 							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
++InterpFromMeshToMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-InterpFromMeshToMesh3d_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
++InterpFromMeshToMesh3d_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
+ 									../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
++InterpFromMeshToMesh3d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-InterpFromMeshToGrid_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
++InterpFromMeshToGrid_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
+ 									../InterpFromMeshToGrid/InterpFromMeshToGrid.h
++InterpFromMeshToGrid_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-InterpFromMesh2d_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
++InterpFromMesh2d_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
+ 									../InterpFromMesh2d/InterpFromMesh2d.h
++InterpFromMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-KMLFileRead_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
++KMLFileRead_la_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
+ 			  ../KMLFileRead/KMLFileRead.h
++KMLFileRead_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-KMLMeshWrite_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
++KMLMeshWrite_la_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
+ 			  ../KMLMeshWrite/KMLMeshWrite.h
++KMLMeshWrite_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-KMLOverlay_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
++KMLOverlay_la_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
+ 			  ../KMLOverlay/KMLOverlay.h
++KMLOverlay_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Xy2ll_SOURCES = ../Xy2ll/Xy2ll.cpp\
++Xy2ll_la_SOURCES = ../Xy2ll/Xy2ll.cpp\
+ 			  ../Xy2ll/Xy2ll.h
++Xy2ll_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Ll2xy_SOURCES = ../Ll2xy/Ll2xy.cpp\
++Ll2xy_la_SOURCES = ../Ll2xy/Ll2xy.cpp\
+ 			  ../Ll2xy/Ll2xy.h
++Ll2xy_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Exp2Kml_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
++Exp2Kml_la_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
+ 			  ../Exp2Kml/Exp2Kml.h
++Exp2Kml_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Kml2Exp_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
++Kml2Exp_la_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
+ 			  ../Kml2Exp/Kml2Exp.h
++Kml2Exp_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Kriging_SOURCES = ../Kriging/Kriging.cpp\
++Kriging_la_SOURCES = ../Kriging/Kriging.cpp\
+ 						../Kriging/Kriging.h
++Kriging_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-MeshPartition_SOURCES = ../MeshPartition/MeshPartition.cpp\
++MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\
+ 			  ../MeshPartition/MeshPartition.h
++MeshPartition_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-MeshProfileIntersection_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
++MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
+ 			  ../MeshProfileIntersection/MeshProfileIntersection.h
++MeshProfileIntersection_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-NodeConnectivity_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
++NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
+ 										../NodeConnectivity/NodeConnectivity.h
++NodeConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-PointCloudFindNeighbors_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
++PointCloudFindNeighbors_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
+ 			  ../PointCloudFindNeighbors/PointCloudFindNeighbors.h
++PointCloudFindNeighbors_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-PropagateFlagsFromConnectivity_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
++PropagateFlagsFromConnectivity_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
+ 			  ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
++PropagateFlagsFromConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Scotch_SOURCES = ../Scotch/Scotch.cpp\
+-			  ../Scotch/Scotch.h
++Scotch_la_SOURCES = ../Scotch/Scotch.cpp\
++                    ../Scotch/Scotch.h
++Scotch_la_LIBADD = ${deps} $(SCOTCHLIB)
+ 
+-Shp2Kml_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
+-			  ../Shp2Kml/Shp2Kml.h
++Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
++                     ../Shp2Kml/Shp2Kml.h
++Shp2Kml_la_LIBADD = ${deps}
+ 
+-TriaSearch_SOURCES = ../TriaSearch/TriaSearch.cpp\
++TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp\
+ 			  ../TriaSearch/TriaSearch.h
++TriaSearch_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-TriMesh_SOURCES = ../TriMesh/TriMesh.cpp\
+-			  ../TriMesh/TriMesh.h
++TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
++                     ../TriMesh/TriMesh.h
++TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB)
+ 
+-TriMeshProcessRifts_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
++TriMeshProcessRifts_la_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
+ 			  ../TriMeshProcessRifts/TriMeshProcessRifts.h
++TriMeshProcessRifts_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ #}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13071)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13072)
+@@ -5,11 +5,13 @@
+ AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
+ AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
+ AC_CANONICAL_TARGET                       #Determine the system type
++
+ #Compilers
+ AC_PROG_CC([cccl cl icl gcc])
+ AC_PROG_CPP
+ AC_PROG_CXX([cccl cl icl g++])
+ AC_PROG_F77([ifort g77 gfortran])
++
+ #Libraries and linking
+ AC_F77_LIBRARY_LDFLAGS
+ AC_PATH_XTRA      #figure out X library and include paths
+@@ -21,10 +23,9 @@
+ AM_SILENT_RULES([yes])           #Do not show compilation command by default
+ AM_PROG_CC_C_O
+ AM_PROG_AR
+-AC_PROG_RANLIB
+ 
+ #Libtool
+-#LT_INIT
++LT_INIT
+ 
+ #Run issm_options.m4
+ ISSM_OPTIONS
+@@ -36,8 +37,7 @@
+ 			src/modules/Makefile
+ 			src/modules/python/Makefile
+ 			src/modules/matlab/Makefile
+-			src/m/Makefile
+-			bin/Makefile])
++			src/m/Makefile])
+ 
+ #End of configure.ac
+ AC_OUTPUT
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am	(revision 13071)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am	(revision 13072)
+@@ -1,3 +1,3 @@
+ EXTRA_DIST = reconf scripts test m4 examples cron etc doc packages contributors.txt 
+-SUBDIRS = src bin
++SUBDIRS = src
+ bin_SCRIPTS=config.h startup.m README.rtf
Index: /issm/oecreview/Archive/12678-13393/ISSM-13072-13073.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13072-13073.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13072-13073.diff	(revision 13394)
@@ -0,0 +1,2616 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13073)
+@@ -14,7 +14,7 @@
+ 	bool  dakota_analysis,control_analysis,tao_analysis;
+ 
+ 	/*AD: */
+-	size_t   tape_stats[11];
++	int   tape_stats[11];
+ 
+ 	/*FemModel: */
+ 	FemModel *femmodel = NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/control_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/control_core.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/control_core.cpp	(revision 13073)
+@@ -81,7 +81,7 @@
+ 
+ 		/*Display info*/
+ 		if(VerboseControl()) _pprintLine_("\n" << "   control method step " << n+1 << "/" << nsteps);
+-		for(i=0;i<num_responses;i++) step_responses[i]=(int)responses[n*num_responses+i];
++		for(i=0;i<num_responses;i++) step_responses[i]=reCast<int,IssmDouble>(responses[n*num_responses+i]);
+ 		femmodel->parameters->SetParam(step_responses,1,num_responses,StepResponsesEnum);
+ 		
+ 		/*In steady state inversion, compute new temperature field now*/
+@@ -98,7 +98,7 @@
+ 		}
+ 
+ 		if(VerboseControl()) _pprintLine_("   optimizing along gradient direction");
+-		optpars.maxiter=(int)maxiter[n]; optpars.cm_jump=cm_jump[n];
++		optpars.maxiter=reCast<int,IssmDouble>(maxiter[n]); optpars.cm_jump=cm_jump[n];
+ 		BrentSearch(&search_scalar,J+n,&optpars,&objectivefunction,&optargs);
+ 
+ 		if(VerboseControl()) _pprintLine_("   updating parameter using optimized search scalar"); //true means update save controls
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/hydrology_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/hydrology_core.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/hydrology_core.cpp	(revision 13073)
+@@ -38,7 +38,7 @@
+ 		dt=0;
+ 		nsteps=1;
+ 	}
+-	else nsteps=(int)((final_time-starttime)/dt);
++	else nsteps=reCast<int,IssmDouble>((final_time-starttime)/dt);
+ 	time=starttime;
+ 
+ 	/*Loop through time: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13073)
+@@ -63,7 +63,7 @@
+ 	if(options->GetOption("boxlength")){
+ 		options->Get(&minlength,"boxlength");
+ 		if(minlength<=0)_error_("boxlength should be a positive number");
+-		maxdepth=int(log(max(xmax-xmin,ymax-ymin)/minlength +1)/log(2.0));
++		maxdepth=reCast<int,IssmDouble>(log(max(xmax-xmin,ymax-ymin)/minlength +1)/log(2.0));
+ 	}
+ 	else{
+ 		maxdepth = 30;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp	(revision 13073)
+@@ -8,7 +8,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.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){
+ 
+ 	/*Intermediaries*/
+ 	int  num_controls;
+@@ -32,11 +32,11 @@
+ void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* gradient){
+ 
+ 	/*Serialize gradient*/
+-	double* serial_gradient=NULL;
++	IssmDouble* serial_gradient=NULL;
+ 	serial_gradient=gradient->ToMPISerial();
+ 
+ 	ControlInputSetGradientx(elements,nodes,vertices, loads, materials, parameters,serial_gradient);
+ 
+ 	/*Clean up and return*/
+-	xDelete<double>(serial_gradient);
++	xDelete<IssmDouble>(serial_gradient);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp	(revision 13073)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void ThicknessAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
++void ThicknessAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute Misfit: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void ThicknessAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void ThicknessAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVzx/MinVzx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVzx/MinVzx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVzx/MinVzx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MinVzx( double* pminvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MinVzx( IssmDouble* pminvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MINVZX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVzx/MinVzx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVzx/MinVzx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVzx/MinVzx.cpp	(revision 13073)
+@@ -8,12 +8,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MinVzx( double* pminvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MinVzx( IssmDouble* pminvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 	
+ 	int i;
+-	double minvz;
+-	double node_minvz;
+-	double element_minvz;
++	IssmDouble minvz;
++	IssmDouble node_minvz;
++	IssmDouble element_minvz;
+ 
+ 	/*Go through elements, and request velocity: */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVxx/MaxVxx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVxx/MaxVxx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVxx/MaxVxx.h	(revision 13073)
+@@ -8,7 +8,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MaxVxx( double* pmaxvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MaxVxx( IssmDouble* pmaxvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MAXVXX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVxx/MaxVxx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVxx/MaxVxx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVxx/MaxVxx.cpp	(revision 13073)
+@@ -8,12 +8,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MaxVxx( double* pmaxvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MaxVxx( IssmDouble* pmaxvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 	
+ 	int i;
+-	double maxvx;
+-	double node_maxvx;
+-	double element_maxvx;
++	IssmDouble maxvx;
++	IssmDouble node_maxvx;
++	IssmDouble element_maxvx;
+ 
+ 	/*Go through elements, and request velocity: */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 13073)
+@@ -13,9 +13,9 @@
+ void GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){
+ 
+ 	int      i, migration_style,analysis_type;
+-	double*  vertices_potentially_ungrounding = NULL;
+-	double*  vertices_ungrounding             = NULL;
+-	double*  old_floatingice                  = NULL;
++	IssmDouble*  vertices_potentially_ungrounding = NULL;
++	IssmDouble*  vertices_ungrounding             = NULL;
++	IssmDouble*  old_floatingice                  = NULL;
+ 	Vector*      vec_old_floatingice              = NULL;
+ 	Element* element                          = NULL;
+ 	
+@@ -48,9 +48,9 @@
+ 
+ 	/*free ressouces: */
+ 	xdelete(&vec_old_floatingice);
+-	xDelete<double>(vertices_potentially_ungrounding);
+-	xDelete<double>(vertices_ungrounding);
+-	xDelete<double>(old_floatingice);
++	xDelete<IssmDouble>(vertices_potentially_ungrounding);
++	xDelete<IssmDouble>(vertices_ungrounding);
++	xDelete<IssmDouble>(old_floatingice);
+ }
+ 
+ /*FUNCTION CreateNodesOnFloatingIce {{{*/
+@@ -81,10 +81,10 @@
+ }
+ /*%}}}*/
+ /*FUNCTION PotentialSheetUngrounding {{{*/
+-double*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){ 
++IssmDouble*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){ 
+ 
+ 	int      i,numberofvertices;
+-	double*  vertices_potentially_ungrounding      = NULL;
++	IssmDouble*  vertices_potentially_ungrounding      = NULL;
+ 	Vector*      vec_vertices_potentially_ungrounding  = NULL;
+ 	Element* element                               = NULL;
+ 
+@@ -108,13 +108,13 @@
+ }
+ /*}}}*/
+ /*FUNCTION PropagateFloatingiceToGroundedNeighbors {{{*/
+-double*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){ 
++IssmDouble*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding){ 
+ 
+ 	int      i,analysis_type;
+ 	int      numberofvertices;
+ 	int      nflipped,local_nflipped;
+-	double*  nodes_on_floatingice                  = NULL;
+-	double*  elements_neighboring_floatingce      = NULL;
++	IssmDouble*  nodes_on_floatingice                  = NULL;
++	IssmDouble*  elements_neighboring_floatingce      = NULL;
+ 	Vector*      vec_elements_neighboring_floatingice = NULL;
+ 	Vector*      vec_nodes_on_floatingice              = NULL;
+ 	Node*    node                                  = NULL;
+@@ -149,7 +149,7 @@
+ 		local_nflipped=0;
+ 		for(i=0;i<elements->Size();i++){
+ 			element=(Element*)elements->GetObjectByOffset(i);
+-			if(elements_neighboring_floatingce[element->Sid()]){
++			if(reCast<int,IssmDouble>(elements_neighboring_floatingce[element->Sid()])){
+ 				local_nflipped+=element->UpdatePotentialSheetUngrounding(vertices_potentially_ungrounding,vec_nodes_on_floatingice,nodes_on_floatingice);
+ 			}
+ 		}
+@@ -163,8 +163,8 @@
+ 		#endif
+ 
+ 		/*Avoid leaks: */
+-		xDelete<double>(elements_neighboring_floatingce);
+-		xDelete<double>(nodes_on_floatingice);
++		xDelete<IssmDouble>(elements_neighboring_floatingce);
++		xDelete<IssmDouble>(nodes_on_floatingice);
+ 
+ 		/*Assemble and serialize:*/
+ 		xdelete(&vec_elements_neighboring_floatingice);
+@@ -173,7 +173,7 @@
+ 
+ 	/*Free ressources:*/
+ 	xdelete(&vec_nodes_on_floatingice);
+-	xDelete<double>(elements_neighboring_floatingce);
++	xDelete<IssmDouble>(elements_neighboring_floatingce);
+ 
+ 	return nodes_on_floatingice;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h	(revision 13073)
+@@ -14,6 +14,6 @@
+ void       GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
+ 
+ Vector*        CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);
+-double*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);
+-double*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding);
++IssmDouble*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);
++IssmDouble*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding);
+ #endif  /* _GROUNDINGLINEMIGRATIONX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IceVolumex/IceVolumex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IceVolumex/IceVolumex.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IceVolumex/IceVolumex.cpp	(revision 13073)
+@@ -9,10 +9,10 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void IceVolumex(double* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void IceVolumex(IssmDouble* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 
+-	double local_ice_volume = 0;
+-	double total_ice_volume;
++	IssmDouble local_ice_volume = 0;
++	IssmDouble total_ice_volume;
+ 
+ 	for(int i=0;i<elements->Size();i++){
+ 		Element* element=(Element*)elements->GetObjectByOffset(i);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IceVolumex/IceVolumex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IceVolumex/IceVolumex.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/IceVolumex/IceVolumex.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void IceVolumex(double* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void IceVolumex(IssmDouble* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp	(revision 13073)
+@@ -8,12 +8,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MaxAbsVxx( double* pmaxabsvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MaxAbsVxx( IssmDouble* pmaxabsvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 	
+ 	int i;
+-	double maxabsvx;
+-	double node_maxabsvx;
+-	double element_maxabsvx;
++	IssmDouble maxabsvx;
++	IssmDouble node_maxabsvx;
++	IssmDouble element_maxabsvx;
+ 
+ 	/*Go through elements, and request velocity: */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MaxAbsVxx( double* pmaxabsvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MaxAbsVxx( IssmDouble* pmaxabsvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MAXABSVXX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	(revision 13073)
+@@ -35,10 +35,10 @@
+ 	*pvector=vector;
+ }
+ 
+-void GetVectorFromControlInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){
++void GetVectorFromControlInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){
+ 	
+ 	/*output: */
+-	double* vector=NULL;
++	IssmDouble* vector=NULL;
+ 	
+ 	/*intermediary: */
+ 	Vector* vec_vector=NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ 
+ /* local prototypes: */
+ void	GetVectorFromControlInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
+-void	GetVectorFromControlInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
++void	GetVectorFromControlInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
+ 
+ #endif  /* _GETVECTORFROMCONTROLINPUTSXX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVelx/MinVelx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVelx/MinVelx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVelx/MinVelx.cpp	(revision 13073)
+@@ -9,12 +9,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MinVelx( double* pminvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MinVelx( IssmDouble* pminvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 	
+ 	int i;
+-	double minvel;
+-	double node_minvel;
+-	double element_minvel;
++	IssmDouble minvel;
++	IssmDouble node_minvel;
++	IssmDouble element_minvel;
+ 
+ 	/*Go through elements, and request velocity: */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVelx/MinVelx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVelx/MinVelx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVelx/MinVelx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MinVelx( double* pminvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MinVelx( IssmDouble* pminvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MINVELX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVelx/MaxVelx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVelx/MaxVelx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVelx/MaxVelx.cpp	(revision 13073)
+@@ -9,12 +9,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MaxVelx( double* pmaxvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MaxVelx( IssmDouble* pmaxvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 	
+ 	int i;
+-	double maxvel;
+-	double node_maxvel;
+-	double element_maxvel;
++	IssmDouble maxvel;
++	IssmDouble node_maxvel;
++	IssmDouble element_maxvel;
+ 
+ 	/*Go through elements, and request velocity: */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVelx/MaxVelx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVelx/MaxVelx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVelx/MaxVelx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MaxVelx( double* pmaxvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MaxVelx( IssmDouble* pmaxvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MAXVELX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVyx/MaxVyx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVyx/MaxVyx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVyx/MaxVyx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MaxVyx( double* pmaxvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MaxVyx( IssmDouble* pmaxvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MAXVYX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVyx/MaxVyx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVyx/MaxVyx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVyx/MaxVyx.cpp	(revision 13073)
+@@ -8,12 +8,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MaxVyx( double* pmaxvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MaxVyx( IssmDouble* pmaxvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 
+ 	int i;
+-	double maxvy;
+-	double node_maxvy;
+-	double element_maxvy;
++	IssmDouble maxvy;
++	IssmDouble node_maxvy;
++	IssmDouble element_maxvy;
+ 
+ 	/*Go through elements, and request velocity: */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp	(revision 13073)
+@@ -10,15 +10,15 @@
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ #include "../SurfaceAreax/SurfaceAreax.h"
+ 
+-void SurfaceAverageVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){
++void SurfaceAverageVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute surface area and add to elements inputs */
+ 	SurfaceAreax(NULL,elements,nodes,vertices, loads,materials,parameters);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void SurfaceAverageVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void SurfaceAverageVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void ElementResponsex( double* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,int response_enum,bool process_units){
++void ElementResponsex( IssmDouble* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,int response_enum,bool process_units){
+ 	
+ 
+ 	extern int my_rank;
+@@ -19,7 +19,7 @@
+ 	int sumfound=0;
+ 	int cpu_found=-1;
+ 	int index;
+-	double response;
++	IssmDouble response;
+ 	Element* element=NULL;
+ 
+ 	/*retrieve element we are interested in: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void ElementResponsex( double* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int response_enum,bool process_units);
++void ElementResponsex( IssmDouble* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int response_enum,bool process_units);
+ 
+ #endif  /* _ELEMENTRESPONSEX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp	(revision 13073)
+@@ -8,12 +8,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MaxAbsVyx( double* pmaxabsvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MaxAbsVyx( IssmDouble* pmaxabsvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 	
+ 	int i;
+-	double maxabsvy;
+-	double node_maxabsvy;
+-	double element_maxabsvy;
++	IssmDouble maxabsvy;
++	IssmDouble node_maxabsvy;
++	IssmDouble element_maxabsvy;
+ 
+ 
+ 	/*Go through elements, and request velocity: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MaxAbsVyx( double* pmaxabsvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MaxAbsVyx( IssmDouble* pmaxabsvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MAXABSVYX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp	(revision 13073)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void ThicknessAlongGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
++void ThicknessAlongGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute Misfit: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void ThicknessAlongGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void ThicknessAlongGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp	(revision 13073)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void ThicknessAbsMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
++void ThicknessAbsMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute Misfit: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void ThicknessAbsMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void ThicknessAbsMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 13073)
+@@ -41,13 +41,13 @@
+ 
+ 	iomodel->FetchData(4,InversionControlParametersEnum,InversionCostFunctionsCoefficientsEnum,InversionMinParametersEnum,InversionMaxParametersEnum);
+ 	for(i=0;i<num_control_type;i++){
+-		switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
++		switch(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])){
+ 			case BalancethicknessThickeningRateEnum: iomodel->FetchData(1,BalancethicknessThickeningRateEnum); break;
+ 			case VxEnum:   iomodel->FetchData(1,VxEnum); break;
+ 			case VyEnum:   iomodel->FetchData(1,VyEnum); break;
+ 			case FrictionCoefficientEnum: iomodel->FetchData(1,FrictionCoefficientEnum); break;
+ 			case MaterialsRheologyBbarEnum:    iomodel->FetchData(1,MaterialsRheologyBEnum); break;
+-			default: _error_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
++			default: _error_("Control " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])) << " not implemented yet");
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 13073)
+@@ -20,10 +20,10 @@
+ 	int         num_control_type;
+ 	int         num_cm_responses;
+ 	int        *control_type     = NULL;
+-	double     *cm_responses     = NULL;
+-	double     *cm_jump          = NULL;
+-	double     *optscal          = NULL;
+-	double     *maxiter          = NULL;
++	IssmDouble     *cm_responses     = NULL;
++	IssmDouble     *cm_jump          = NULL;
++	IssmDouble     *optscal          = NULL;
++	IssmDouble     *maxiter          = NULL;
+ 
+ 	/*Get parameters: */
+ 	parameters=*pparameters;
+@@ -63,10 +63,10 @@
+ 		parameters->AddObject(new DoubleVecParam(InversionMaxiterPerStepEnum,maxiter,nsteps));
+ 
+ 		xDelete<int>(control_type);
+-		xDelete<double>(cm_responses);
+-		xDelete<double>(cm_jump);
+-		xDelete<double>(optscal);
+-		xDelete<double>(maxiter);
++		xDelete<IssmDouble>(cm_responses);
++		xDelete<IssmDouble>(cm_jump);
++		xDelete<IssmDouble>(optscal);
++		xDelete<IssmDouble>(maxiter);
+ 	}
+ 
+ 	/*Assign output pointer: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp	(revision 13073)
+@@ -15,7 +15,7 @@
+ 	/*Intermediary*/
+ 	int i;
+ 	int count;
+-	double yts;
++	IssmDouble yts;
+ 	int    numberofvertices;
+ 	bool   ishutter;
+ 
+@@ -50,7 +50,7 @@
+ 	for (i=0;i<numberofvertices;i++){
+ 		/*keep only this partition's nodes:*/
+ 		if((iomodel->my_vertices[i])){
+-			if (!(int)iomodel->Data(FlowequationVertexEquationEnum)[i]==HutterApproximationEnum){
++			if (!reCast<int,IssmDouble>(iomodel->Data(FlowequationVertexEquationEnum)[i])==HutterApproximationEnum){
+ 
+ 				constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHutterAnalysisEnum));
+ 				count++;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 13073)
+@@ -20,8 +20,8 @@
+ 	int    M,N;
+ 	int    numberofvertices;
+ 	bool   spcpresent=false;
+-	double heatcapacity;
+-	double referencetemperature;
++	IssmDouble heatcapacity;
++	IssmDouble referencetemperature;
+ 	
+ 	/*Output*/
+ 	IssmDouble *spcvector  = NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 13073)
+@@ -16,7 +16,7 @@
+ 	int i;
+ 	int dim;
+ 	int count;
+-	double yts;
++	IssmDouble yts;
+ 	int    numberofvertices;
+ 
+ 	/*Output*/
+@@ -51,7 +51,7 @@
+ 		/*keep only this partition's nodes:*/
+ 		if(iomodel->my_vertices[i]){
+ 
+-			if ((int)iomodel->Data(FlowequationBorderstokesEnum)[i]){
++			if (reCast<int,IssmDouble>(iomodel->Data(FlowequationBorderstokesEnum)[i])){
+ 				constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticVertAnalysisEnum)); //spc to zero as vertical velocity is done in Horiz for Stokes
+ 				count++;
+ 			}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 13073)
+@@ -22,7 +22,6 @@
+ 	bool   issmbgradients;
+ 	bool   ispdd;
+ 	bool   isdelta18o;
+-	IssmDouble *size, Delta18oTimeSerie,Delta18oSurfaceTimeSerie ;
+ 
+ 	/*Fetch data needed: */
+ 	iomodel->Constant(&dim,MeshDimensionEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 13073)
+@@ -39,7 +39,7 @@
+ 
+ 	for (i=0;i<numberofvertices;i++){
+ 		if((iomodel->my_vertices[i]==1)){
+-			if (iomodel->Data(MeshVertexonbedEnum)[i]){ 
++			if (reCast<int>(iomodel->Data(MeshVertexonbedEnum)[i])){
+ 				loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,MeltingAnalysisEnum));
+ 			}
+ 		}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 13073)
+@@ -28,15 +28,15 @@
+ 	int numberofvertices;
+ 	bool ismacayealpattyn,isstokes,isl1l2;
+ 	int  numpenalties,numberofpressureloads,numrifts,numriftsegments;
+-	double *pressureload   = NULL;
+-	double *elements_type  = NULL;
+-	double *nodeoniceshelf = NULL;
+-	double *riftinfo       = NULL;
+-	double *nodeonbed      = NULL;
+-	double *nodeonstokes   = NULL;
+-	double *nodeonicesheet = NULL;
+-	double *vertices_type  = NULL;
+-	double *penalties      = NULL;
++	IssmDouble *pressureload   = NULL;
++	IssmDouble *elements_type  = NULL;
++	IssmDouble *nodeoniceshelf = NULL;
++	IssmDouble *riftinfo       = NULL;
++	IssmDouble *nodeonbed      = NULL;
++	IssmDouble *nodeonstokes   = NULL;
++	IssmDouble *nodeonicesheet = NULL;
++	IssmDouble *vertices_type  = NULL;
++	IssmDouble *penalties      = NULL;
+ 
+ 	/*Fetch parameters: */
+ 	iomodel->Constant(&dim,MeshDimensionEnum);
+@@ -73,52 +73,52 @@
+ 		/*Retrieve element to which this icefront belongs: */
+ 		if (dim==2) segment_width=4; 
+ 		else segment_width=6;
+-		element=(int)(*(pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)
++		element=reCast<int,IssmDouble>(*(pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)
+ 
+ 		/*Now, if this element is not in the partition, pass: */
+ 		if(!iomodel->my_elements[element]) continue;
+ 		
+ 		/*Do not create ice front if Hutter or Stokes elements*/
+-		if ((int)*(elements_type+element)==HutterApproximationEnum) continue;
++		if (reCast<int,IssmDouble>(*(elements_type+element))==HutterApproximationEnum) continue;
+ 
+ 		/*Create and  add load: */
+-		if ((int)*(elements_type+element)==(MacAyealApproximationEnum) && dim==2){
++		if (reCast<int,IssmDouble>(*(elements_type+element))==(MacAyealApproximationEnum) && dim==2){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal2dIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 		}
+-		else if ((int)*(elements_type+element)==(MacAyealApproximationEnum) && dim==3){
++		else if (reCast<int,IssmDouble>(*(elements_type+element))==(MacAyealApproximationEnum) && dim==3){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 		}
+-		else if ((int)*(elements_type+element)==(L1L2ApproximationEnum)){
++		else if (reCast<int,IssmDouble>(*(elements_type+element))==(L1L2ApproximationEnum)){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 		}
+-		else if ((int)*(elements_type+element)==(PattynApproximationEnum)){
++		else if (reCast<int,IssmDouble>(*(elements_type+element))==(PattynApproximationEnum)){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,PattynIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 		}
+-		else if ((int)*(elements_type+element)==(L1L2ApproximationEnum)){
++		else if (reCast<int,IssmDouble>(*(elements_type+element))==(L1L2ApproximationEnum)){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,L1L2IceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 		}
+-		else if ((int)*(elements_type+element)==(StokesApproximationEnum)){
++		else if (reCast<int,IssmDouble>(*(elements_type+element))==(StokesApproximationEnum)){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,StokesIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 		}
+-		else if ((int)*(elements_type+element)==(MacAyealPattynApproximationEnum)){
++		else if (reCast<int,IssmDouble>(*(elements_type+element))==(MacAyealPattynApproximationEnum)){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,PattynIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 		}
+-		else if ((int)*(elements_type+element)==(PattynStokesApproximationEnum)){
++		else if (reCast<int,IssmDouble>(*(elements_type+element))==(PattynStokesApproximationEnum)){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,PattynIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,StokesIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 		}
+-		else if ((int)*(elements_type+element)==(MacAyealStokesApproximationEnum)){
++		else if (reCast<int,IssmDouble>(*(elements_type+element))==(MacAyealStokesApproximationEnum)){
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum));
+ 			count++;
+ 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,StokesIceFrontEnum,DiagnosticHorizAnalysisEnum));
+@@ -128,22 +128,22 @@
+ 
+ 	/*Free data: */
+ 	iomodel->DeleteData(3,DiagnosticIcefrontEnum,ThicknessEnum,BedEnum);
+-	xDelete<double>(elements_type);
+-	xDelete<double>(pressureload);
++	xDelete<IssmDouble>(elements_type);
++	xDelete<IssmDouble>(pressureload);
+ 
+ 	/*Create Penpair for penalties: */
+ 	iomodel->FetchData(&penalties,&numpenalties,NULL,DiagnosticVertexPairingEnum);
+ 	
+ 	for(i=0;i<numpenalties;i++){
+ 
+-		if(iomodel->my_vertices[(int)penalties[2*i+0]-1]){
++		if(iomodel->my_vertices[reCast<int,IssmDouble>(penalties[2*i+0]-1)]){
+ 
+ 			/*In debugging mode, check that the second node is in the same cpu*/
+ 			_assert_(iomodel->my_vertices[(int)penalties[2*i+1]-1]);
+ 
+ 			/*Get node ids*/
+-			penpair_ids[0]=iomodel->nodecounter+(int)penalties[2*i+0];
+-			penpair_ids[1]=iomodel->nodecounter+(int)penalties[2*i+1];
++			penpair_ids[0]=iomodel->nodecounter+reCast<int,IssmDouble>(penalties[2*i+0]);
++			penpair_ids[1]=iomodel->nodecounter+reCast<int,IssmDouble>(penalties[2*i+1]);
+ 
+ 			/*Create Load*/
+ 			loads->AddObject(new Penpair(iomodel->loadcounter+count+1,&penpair_ids[0],DiagnosticHorizAnalysisEnum));
+@@ -152,14 +152,14 @@
+ 	}
+ 
+ 	/*free ressources: */
+-	xDelete<double>(penalties);
++	xDelete<IssmDouble>(penalties);
+ 
+ 	/*Create Riffront loads for rifts: */
+ 	if(numrifts){
+ 		iomodel->FetchData(&riftinfo,&numriftsegments,NULL,RiftsRiftstructEnum);
+ 		iomodel->FetchData(5,RiftsRiftstructEnum,ThicknessEnum,BedEnum,SurfaceEnum,MaskVertexonfloatingiceEnum);
+ 		for(i=0;i<numriftsegments;i++){
+-			if(iomodel->my_elements[(int)*(riftinfo+RIFTINFOSIZE*i+2)-1]){
++			if(iomodel->my_elements[reCast<int,IssmDouble>(*(riftinfo+RIFTINFOSIZE*i+2))-1]){
+ 				loads->AddObject(new Riftfront(iomodel->loadcounter+count+1,i,iomodel,DiagnosticHorizAnalysisEnum));
+ 				count++;
+ 			}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13073)
+@@ -15,30 +15,30 @@
+ 	/*Intermediary*/
+ 	int     i,j;
+ 	int     count;
+-	double  yts;
+-	double  g;
+-	double  rho_ice;
+-	double  stokesreconditioning;
++	IssmDouble  yts;
++	IssmDouble  g;
++	IssmDouble  rho_ice;
++	IssmDouble  stokesreconditioning;
+ 	bool    isstokes,isl1l2,ismacayealpattyn;
+    bool    spcpresent=false;
+ 	int Mx,Nx;
+ 	int My,Ny;
+ 	int Mz,Nz;
+-	double *spcvx          = NULL;
+-	double *spcvy          = NULL;
+-	double *spcvz          = NULL;
+-	double *nodeonmacayeal = NULL;
+-	double *nodeonpattyn   = NULL;
+-	double *nodeonstokes   = NULL;
+-	double *nodeonbed      = NULL;
+-	double *nodeonicesheet = NULL;
+-	double *vertices_type  = NULL;
+-	double *surface        = NULL;
+-	double *z              = NULL;
+-	double *timesx=NULL;
+-	double *timesy=NULL;
+-	double *timesz=NULL;
+-   double* values=NULL;
++	IssmDouble *spcvx          = NULL;
++	IssmDouble *spcvy          = NULL;
++	IssmDouble *spcvz          = NULL;
++	IssmDouble *nodeonmacayeal = NULL;
++	IssmDouble *nodeonpattyn   = NULL;
++	IssmDouble *nodeonstokes   = NULL;
++	IssmDouble *nodeonbed      = NULL;
++	IssmDouble *nodeonicesheet = NULL;
++	IssmDouble *vertices_type  = NULL;
++	IssmDouble *surface        = NULL;
++	IssmDouble *z              = NULL;
++	IssmDouble *timesx=NULL;
++	IssmDouble *timesy=NULL;
++	IssmDouble *timesz=NULL;
++   IssmDouble* values=NULL;
+ 
+ 	/*Output*/
+ 	Constraints *constraints      = NULL;
+@@ -87,21 +87,21 @@
+ 	count=0;
+ 
+ 	/*figure out times: */
+-	timesx=xNew<double>(Nx);
++	timesx=xNew<IssmDouble>(Nx);
+ 	for(j=0;j<Nx;j++){
+ 		timesx[j]=spcvx[(Mx-1)*Nx+j];
+ 	}
+ 	/*unit conversion: */
+ 	UnitConversion(timesx,Nx,ExtToIuEnum,TimeEnum);
+ 	/*figure out times: */
+-	timesy=xNew<double>(Ny);
++	timesy=xNew<IssmDouble>(Ny);
+ 	for(j=0;j<Ny;j++){
+ 		timesy[j]=spcvy[(My-1)*Ny+j];
+ 	}
+ 	/*unit conversion: */
+ 	UnitConversion(timesy,Ny,ExtToIuEnum,TimeEnum);
+ 	/*figure out times: */
+-	timesz=xNew<double>(Nz);
++	timesz=xNew<IssmDouble>(Nz);
+ 	for(j=0;j<Nz;j++){
+ 		timesz[j]=spcvz[(Mz-1)*Nz+j];
+ 	}
+@@ -113,9 +113,9 @@
+ 		if(iomodel->my_vertices[i]){
+ 
+ 			/*Start with adding spcs of coupling: zero at the border macayeal/pattyn for the appropriate dofs*/
+-			if ((int)vertices_type[i]==MacAyealPattynApproximationEnum){
++			if (reCast<int,IssmDouble>(vertices_type[i]==MacAyealPattynApproximationEnum)){
+ 				/*If grionmacayeal, spc pattyn dofs: 3 & 4*/
+-					if ((int)nodeonpattyn[i]){
++					if (reCast<int,IssmDouble>(nodeonpattyn[i])){
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+ 						count++;
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+@@ -130,7 +130,7 @@
+ 						}
+ 
+ 					}
+-					else if ((int)nodeonmacayeal[i]){
++					else if (reCast<int,IssmDouble>(nodeonmacayeal[i])){
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+ 						count++;
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+@@ -148,9 +148,9 @@
+ 					else _error_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal");
+ 			}
+ 			/*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/
+-			else if ((int)vertices_type[i]==PattynStokesApproximationEnum){
++			else if (reCast<int,IssmDouble>(vertices_type[i])==PattynStokesApproximationEnum){
+ 				/*If grion,pattyn spc stokes dofs: 3 4 & 5*/
+-					if ((int)nodeonpattyn[i]){
++					if (reCast<int,IssmDouble>(nodeonpattyn[i])){
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+ 						count++;
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+@@ -167,7 +167,7 @@
+ 						}
+ 
+ 					}
+-					else if ((int)nodeonstokes[i]){ //spc pattyn nodes: 1 & 2
++					else if (reCast<int,IssmDouble>(nodeonstokes[i])){ //spc pattyn nodes: 1 & 2
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+ 						count++;
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+@@ -188,9 +188,9 @@
+ 					else _error_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes");
+ 			}
+ 			/*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/
+-			else if ((int)vertices_type[i]==MacAyealStokesApproximationEnum){
++			else if (reCast<int,IssmDouble>(vertices_type[i])==MacAyealStokesApproximationEnum){
+ 				/*If grion,pattyn spc stokes dofs: 3 4 & 5*/
+-					if ((int)nodeonmacayeal[i]){
++					if (reCast<int,IssmDouble>(nodeonmacayeal[i])){
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+ 						count++;
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+@@ -207,7 +207,7 @@
+ 						}
+ 
+ 					}
+-					else if ((int)nodeonstokes[i]){ //spc macayeal nodes: 1 & 2
++					else if (reCast<int,IssmDouble>(nodeonstokes[i])){ //spc macayeal nodes: 1 & 2
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+ 						count++;
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+@@ -235,7 +235,7 @@
+ 				}
+ 				else if (Mx==numberofvertices+1) {
+ 					/*figure out times and values: */
+-					values=xNew<double>(Nx);
++					values=xNew<IssmDouble>(Nx);
+ 					spcpresent=false;
+ 					for(j=0;j<Nx;j++){
+ 						values[j]=spcvx[i*Nx+j]/yts;
+@@ -246,7 +246,7 @@
+ 						constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,Nx,timesx,values,DiagnosticHorizAnalysisEnum));
+ 						count++;
+ 					}
+-					xDelete<double>(values);
++					xDelete<IssmDouble>(values);
+ 				}
+ 				else if (vertices_type[i]==HutterApproximationEnum){
+ 					constraints->AddObject(new SpcDynamic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,DiagnosticHorizAnalysisEnum));
+@@ -259,7 +259,7 @@
+ 				}
+ 				else if (My==numberofvertices+1){
+ 					/*figure out times and values: */
+-					values=xNew<double>(Ny);
++					values=xNew<IssmDouble>(Ny);
+ 					spcpresent=false;
+ 					for(j=0;j<Ny;j++){
+ 						values[j]=spcvy[i*Ny+j]/yts;
+@@ -269,21 +269,21 @@
+ 						constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,Ny,timesy,values,DiagnosticHorizAnalysisEnum));
+ 						count++;
+ 					}
+-					xDelete<double>(values);
++					xDelete<IssmDouble>(values);
+ 				}
+ 				else if (vertices_type[i]==HutterApproximationEnum){
+ 					constraints->AddObject(new SpcDynamic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,DiagnosticHorizAnalysisEnum));
+ 					count++;
+ 				}
+ 
+-				if ((int)vertices_type[i]==StokesApproximationEnum ||  ((int)vertices_type[i]==NoneApproximationEnum)){
++				if (reCast<int,IssmDouble>(vertices_type[i])==StokesApproximationEnum ||  (reCast<int,IssmDouble>(vertices_type[i])==NoneApproximationEnum)){
+ 					if (Mz==numberofvertices && !xIsNan<IssmDouble>(spcvz[i])){
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,spcvz[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
+ 						count++;
+ 					}
+ 					else if (Mz==numberofvertices+1){
+ 						/*figure out times and values: */
+-						values=xNew<double>(Nz);
++						values=xNew<IssmDouble>(Nz);
+ 						spcpresent=false;
+ 						for(j=0;j<Nz;j++){
+ 							values[j]=spcvz[i*Nz+j]/yts;
+@@ -293,19 +293,19 @@
+ 							constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,Nz,timesz,values,DiagnosticHorizAnalysisEnum));
+ 							count++;
+ 						}
+-						xDelete<double>(values);
++						xDelete<IssmDouble>(values);
+ 					}
+ 
+ 				}
+-				if ((int)vertices_type[i]==NoneApproximationEnum){
++				if (reCast<int,IssmDouble>(vertices_type[i])==NoneApproximationEnum){
+ 					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,g*rho_ice*(surface[i]-z[i])/stokesreconditioning,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
+ 					count++;
+ 				}
+ 			}
+ 
+ 			/*Constraint at the bedrock interface (v.n = vz = 0) (Coordinates will be updated according to the bed slope)*/
+-			if (dim==3) if(nodeonbed[i] && nodeonicesheet[i] && nodeonstokes[i]){
+-				 switch((int)vertices_type[i]){
++			if (dim==3) if(reCast<int,IssmDouble>(nodeonbed[i]) && reCast<int,IssmDouble>(nodeonicesheet[i]) && reCast<int,IssmDouble>(nodeonstokes[i])){
++				 switch(reCast<int,IssmDouble>(vertices_type[i])){
+ 					case MacAyealStokesApproximationEnum:
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,5,0.,DiagnosticHorizAnalysisEnum));
+ 						count++;
+@@ -318,30 +318,30 @@
+ 						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0.,DiagnosticHorizAnalysisEnum));
+ 						count++;
+ 						break;
+-					default: _error_("Vertex approximation " << EnumToStringx((int)vertices_type[i]) << " not supported");
++					default: _error_("Vertex approximation " << EnumToStringx(reCast<int,IssmDouble>(vertices_type[i])) << " not supported");
+ 				}
+ 			}
+ 		}
+ 	}
+ 	  
+ 	/*Free data: */
+-	xDelete<double>(spcvx);
+-	xDelete<double>(spcvy);
+-	xDelete<double>(spcvz);
+-	xDelete<double>(nodeonmacayeal);
+-	xDelete<double>(nodeonpattyn);
+-	xDelete<double>(nodeonstokes);
+-	xDelete<double>(nodeonicesheet);
+-	xDelete<double>(nodeonbed);
+-	xDelete<double>(vertices_type);
+-	xDelete<double>(surface);
+-	xDelete<double>(z);
++	xDelete<IssmDouble>(spcvx);
++	xDelete<IssmDouble>(spcvy);
++	xDelete<IssmDouble>(spcvz);
++	xDelete<IssmDouble>(nodeonmacayeal);
++	xDelete<IssmDouble>(nodeonpattyn);
++	xDelete<IssmDouble>(nodeonstokes);
++	xDelete<IssmDouble>(nodeonicesheet);
++	xDelete<IssmDouble>(nodeonbed);
++	xDelete<IssmDouble>(vertices_type);
++	xDelete<IssmDouble>(surface);
++	xDelete<IssmDouble>(z);
+ 
+ 	/*Free resources:*/
+-	xDelete<double>(timesx);
+-	xDelete<double>(timesy);
+-	xDelete<double>(timesz);
+-	xDelete<double>(values);
++	xDelete<IssmDouble>(timesx);
++	xDelete<IssmDouble>(timesy);
++	xDelete<IssmDouble>(timesz);
++	xDelete<IssmDouble>(values);
+ 
+ 	/*Assign output pointer: */
+ 	*pconstraints=constraints;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 13073)
+@@ -71,7 +71,7 @@
+ 				if(iomodel->my_nodes[3*i+j]){ 
+ 
+ 					//Get index of the vertex on which the current node is located
+-					vertex_id=(int)*(iomodel->Data(MeshElementsEnum)+3*i+j); //(Matlab indexing)
++					vertex_id=reCast<int,IssmDouble>(*(iomodel->Data(MeshElementsEnum)+3*i+j)); //(Matlab indexing)
+ 					io_index=vertex_id-1;                      //(C indexing)
+ 					_assert_(vertex_id>0 && vertex_id<=numberofvertices);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp	(revision 13073)
+@@ -41,7 +41,7 @@
+ 		for (i=0;i<numberofedges;i++){
+ 
+ 			/*Get left and right elements*/
+-			element=(int)iomodel->Data(MeshEdgesEnum)[4*i+2]-1; //edges are [node1 node2 elem1 elem2]
++			element=reCast<int,IssmDouble>(iomodel->Data(MeshEdgesEnum)[4*i+2])-1; //edges are [node1 node2 elem1 elem2]
+ 
+ 			/*Now, if this element is not in the partition, pass: */
+ 			if(!iomodel->my_elements[element]) continue;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVxx/MinVxx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVxx/MinVxx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVxx/MinVxx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MinVxx( double* pminvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MinVxx( IssmDouble* pminvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MINVX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVxx/MinVxx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVxx/MinVxx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVxx/MinVxx.cpp	(revision 13073)
+@@ -8,12 +8,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MinVxx( double* pminvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MinVxx( IssmDouble* pminvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 	
+ 	int i;
+-	double minvx;
+-	double node_minvx;
+-	double element_minvx;
++	IssmDouble minvx;
++	IssmDouble node_minvx;
++	IssmDouble element_minvx;
+ 
+ 	/*Go through elements, and request velocity: */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputControlUpdatex/InputControlUpdatex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputControlUpdatex/InputControlUpdatex.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputControlUpdatex/InputControlUpdatex.h	(revision 13073)
+@@ -8,6 +8,6 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void InputControlUpdatex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters, double scalar,bool save_parameter);
++void InputControlUpdatex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters, IssmDouble scalar,bool save_parameter);
+ 
+ #endif 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputControlUpdatex/InputControlUpdatex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputControlUpdatex/InputControlUpdatex.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputControlUpdatex/InputControlUpdatex.cpp	(revision 13073)
+@@ -8,7 +8,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void InputControlUpdatex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,double scalar,bool save_parameter){
++void InputControlUpdatex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,IssmDouble scalar,bool save_parameter){
+ 
+ 	/*Go through elemnets, and ask to carry out the operation on inputs: */
+ 	for(int i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void SurfaceLogVxVyMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void SurfaceLogVxVyMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp	(revision 13073)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void SurfaceLogVxVyMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){
++void SurfaceLogVxVyMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute Misfit: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVzx/MaxVzx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVzx/MaxVzx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVzx/MaxVzx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MaxVzx( double* pmaxvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MaxVzx( IssmDouble* pmaxvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MAXVZX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVzx/MaxVzx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVzx/MaxVzx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxVzx/MaxVzx.cpp	(revision 13073)
+@@ -9,12 +9,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MaxVzx( double* pmaxvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MaxVzx( IssmDouble* pmaxvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 	
+ 	int i;
+-	double maxvz;
+-	double node_maxvz;
+-	double element_maxvz;
++	IssmDouble maxvz;
++	IssmDouble node_maxvz;
++	IssmDouble element_maxvz;
+ 
+ 	/*Go through elements, and request velocity: */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	(revision 13073)
+@@ -8,7 +8,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* vector){
++void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* vector){
+ 
+ 	int  num_controls;
+ 	int *control_type = NULL;
+@@ -29,12 +29,12 @@
+ 
+ void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector){
+ 	
+-	double* serial_vector=NULL;
++	IssmDouble* serial_vector=NULL;
+ 
+ 	serial_vector=vector->ToMPISerial();
+ 
+ 	SetControlInputsFromVectorx(elements,nodes, vertices, loads, materials, parameters,serial_vector);
+ 
+ 	/*Free ressources:*/
+-	xDelete<double>(serial_vector);
++	xDelete<IssmDouble>(serial_vector);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ 
+ /* local prototypes: */
+ void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* vector);
+-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* vector);
++void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,IssmDouble* vector);
+ 
+ #endif 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.cpp	(revision 13073)
+@@ -10,7 +10,7 @@
+ 	Vector* newgradj=NULL;
+ 
+ 	/*intermediary:*/
+-	double norm_new,norm_old,dot_product;;
++	IssmDouble norm_new,norm_old,dot_product;;
+ 
+ 	/*Initialize output*/
+ 	newgradj=gradj->Duplicate();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp	(revision 13073)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void SurfaceLogVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){
++void SurfaceLogVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute Misfit: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void SurfaceLogVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void SurfaceLogVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.cpp	(revision 13073)
+@@ -10,17 +10,16 @@
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ #include "../Responsex/Responsex.h"
+ 
+-void CostFunctionx(double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters){
++void CostFunctionx(IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters){
+ 
+ 	/*Intermediary*/
+ 	int      i;
+ 	int      num_responses;
+-	double   S;
+ 	Element *element       = NULL;
+ 	int     *responses     = NULL;
+ 
+ 	/*output: */
+-	double J,Jplus;
++	IssmDouble J,Jplus;
+ 	
+ 	/*Recover parameters*/
+ 	parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void CostFunctionx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters);
++void CostFunctionx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp	(revision 13073)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void SurfaceRelVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){
++void SurfaceRelVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute Misfit: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void SurfaceRelVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void SurfaceRelVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 13073)
+@@ -9,12 +9,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void Gradjx(Vector** pgradient,double** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
++void Gradjx(Vector** pgradient,IssmDouble** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
+ 
+ 	int     i,j,numberofvertices;
+ 	int     num_controls;
+-	double   norm_inf;
+-	double  *norm_list     = NULL;
++	IssmDouble   norm_inf;
++	IssmDouble  *norm_list     = NULL;
+ 	int     *control_type  = NULL;
+ 	Vector  *gradient      = NULL;
+ 	Vector **gradient_list = NULL;
+@@ -26,7 +26,7 @@
+ 
+ 	/*Allocate gradient_list */
+ 	gradient_list = xNew<Vector*>(num_controls);
+-	norm_list = xNew<double>(num_controls);
++	norm_list = xNew<IssmDouble>(num_controls);
+ 	for(i=0;i<num_controls;i++){
+ 		gradient_list[i]=new Vector(num_controls*numberofvertices);
+ 	}
+@@ -61,7 +61,7 @@
+ 		*pnorm_list=norm_list;
+ 	}
+ 	else{
+-		xDelete<double>(norm_list);
++		xDelete<IssmDouble>(norm_list);
+ 	}
+ 	if(pgradient)  *pgradient=gradient;
+ 	xDelete<Vector*>(gradient_list);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void Gradjx(Vector** pgrad_g,double** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
++void Gradjx(Vector** pgrad_g,IssmDouble** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
+ 
+ #endif  /* _GRADJX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp	(revision 13073)
+@@ -8,12 +8,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MaxAbsVzx( double* pmaxabsvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MaxAbsVzx( IssmDouble* pmaxabsvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 	
+ 	int i;
+-	double maxabsvz;
+-	double node_maxabsvz;
+-	double element_maxabsvz;
++	IssmDouble maxabsvz;
++	IssmDouble node_maxabsvz;
++	IssmDouble element_maxabsvz;
+ 
+ 	/*Go through elements, and request velocity: */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MaxAbsVzx( double* pmaxabsvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MaxAbsVzx( IssmDouble* pmaxabsvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MAXABSVZX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void SurfaceAbsVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void SurfaceAbsVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp	(revision 13073)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void SurfaceAbsVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){
++void SurfaceAbsVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute Misfit: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MassFluxx/MassFluxx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MassFluxx/MassFluxx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MassFluxx/MassFluxx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MassFluxx(double* pmass_flux, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool process_units);
++void MassFluxx(IssmDouble* pmass_flux, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool process_units);
+ 
+ 
+ #endif  /* _MASSFLUXX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MassFluxx/MassFluxx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MassFluxx/MassFluxx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MassFluxx/MassFluxx.cpp	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MassFluxx(double* pmass_flux, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool process_units){
++void MassFluxx(IssmDouble* pmass_flux, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool process_units){
+ 
+ 	int i,j;
+ 	extern int num_procs;
+@@ -19,19 +19,19 @@
+ 	int element_id;
+ 	
+ 	/*output: */
+-	double mass_flux=0;
+-	double all_mass_flux=0;
++	IssmDouble mass_flux=0;
++	IssmDouble all_mass_flux=0;
+ 
+ 	int  counter;
+ 
+ 	/*all segments: */
+-	double** array=NULL;
++	IssmDouble** array=NULL;
+ 	int      M;
+ 	int*     mdims_array=NULL;
+ 	int*     ndims_array=NULL;
+ 
+ 	/*our segments of interest: */
+-	double*  segments=NULL;
++	IssmDouble*  segments=NULL;
+ 	int      num_segments;
+ 
+ 	/*First, figure out which segment to compute our mass flux on. Start with retrieving qmu_mass_flux_segments: */
+@@ -47,7 +47,7 @@
+ 	/*Go through segments, and then elements, and figure out which elements belong to a segment. 
+ 	 * When we find one, use the element to compute the mass flux on the segment: */
+ 	for(i=0;i<num_segments;i++){
+-		element_id=(int)*(segments+5*i+4);
++		element_id=reCast<int,IssmDouble>(*(segments+5*i+4));
+ 		for(j=0;j<elements->Size();j++){
+ 			element=(Element*)elements->GetObjectByOffset(j);
+ 			if (element->Id()==element_id){
+@@ -65,12 +65,12 @@
+ 
+ 	/*Free ressources:*/
+ 	for(j=0;j<M;j++){
+-		double* matrix=array[j];
+-		xDelete<double>(matrix);
++		IssmDouble* matrix=array[j];
++		xDelete<IssmDouble>(matrix);
+ 	}
+ 	xDelete<int>(mdims_array);
+ 	xDelete<int>(ndims_array);
+-	xDelete<double*>(array);
++	xDelete<IssmDouble*>(array);
+ 	
+ 	/*Assign output pointers: */
+ 	*pmass_flux=mass_flux;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVyx/MinVyx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVyx/MinVyx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVyx/MinVyx.h	(revision 13073)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MinVyx( double* pminvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void MinVyx( IssmDouble* pminvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif  /* _MINVYX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVyx/MinVyx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVyx/MinVyx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MinVyx/MinVyx.cpp	(revision 13073)
+@@ -8,12 +8,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void MinVyx( double* pminvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void MinVyx( IssmDouble* pminvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 	
+ 	int i;
+-	double minvy;
+-	double node_minvy;
+-	double element_minvy;
++	IssmDouble minvy;
++	IssmDouble node_minvy;
++	IssmDouble element_minvy;
+ 
+ 	/*Go through elements, and request velocity: */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp	(revision 13073)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void DragCoefficientAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
++void DragCoefficientAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute Misfit: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void DragCoefficientAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void DragCoefficientAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void RheologyBbarAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void RheologyBbarAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp	(revision 13073)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void RheologyBbarAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
++void RheologyBbarAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute Misfit: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void ThicknessAcrossGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
++void ThicknessAcrossGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp	(revision 13073)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void ThicknessAcrossGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
++void ThicknessAcrossGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
+ 
+ 	/*Intermediary*/
+ 	int i;
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	double J=0;
+-	double J_sum;
++	IssmDouble J=0;
++	IssmDouble J_sum;
+ 
+ 	/*Compute Misfit: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h	(revision 13073)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void TotalSmbx(double* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
++void TotalSmbx(IssmDouble* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.cpp	(revision 13073)
+@@ -9,10 +9,10 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void TotalSmbx(double* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
++void TotalSmbx(IssmDouble* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+ 
+-	double local_smb = 0;
+-	double total_smb;
++	IssmDouble local_smb = 0;
++	IssmDouble total_smb;
+ 
+ 	for(int i=0;i<elements->Size();i++){
+ 		Element* element=(Element*)elements->GetObjectByOffset(i);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp	(revision 13073)
+@@ -8,13 +8,13 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* norm_list,int step){
++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;
+-	double *scalar_list = NULL;
+-	double  scalar;
++	IssmDouble *scalar_list = NULL;
++	IssmDouble  scalar;
+ 
+ 
+ 	/*Retrieve some parameters*/
+@@ -37,5 +37,5 @@
+ 
+ 	/*Clean up and return*/
+ 	xDelete<int>(control_type);
+-	xDelete<double>(scalar_list);
++	xDelete<IssmDouble>(scalar_list);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h	(revision 13073)
+@@ -7,6 +7,6 @@
+ #include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+-void	ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* norm_list,int step);
++void	ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,IssmDouble* norm_list,int step);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 13073)
+@@ -196,11 +196,11 @@
+ }
+ /*}}}*/
+ /*FUNCTION GaussTria::GaussFromCoords{{{*/
+-void GaussTria::GaussFromCoords(IssmPDouble x,IssmPDouble y,IssmPDouble* xyz_list){
++void GaussTria::GaussFromCoords(IssmDouble x,IssmDouble y,IssmDouble* xyz_list){
+ 
+ 	/*Intermediaries*/
+-	IssmPDouble    area = 0;
+-	IssmPDouble    x1,y1,x2,y2,x3,y3;
++	IssmDouble    area = 0;
++	IssmDouble    x1,y1,x2,y2,x3,y3;
+ 
+ 	/*in debugging mode: check that the default constructor has been called*/
+ 	_assert_(numgauss==-1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.h	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/gauss/GaussTria.h	(revision 13073)
+@@ -21,9 +21,9 @@
+ 
+ 	public:
+ 		IssmPDouble weight;
+-		IssmPDouble coord1;
+-		IssmPDouble coord2;
+-		IssmPDouble coord3;
++		IssmDouble coord1;
++		IssmDouble coord2;
++		IssmDouble coord3;
+ 		
+ 	public:
+ 
+@@ -37,7 +37,7 @@
+ 		int  begin(void);
+ 		int  end(void);
+ 		void Echo(void);
+-		void GaussFromCoords(IssmPDouble x1,IssmPDouble y1,IssmPDouble* xyz_list);
++		void GaussFromCoords(IssmDouble x1,IssmDouble y1,IssmDouble* xyz_list);
+ 		void GaussPoint(int ig);
+ 		void GaussVertex(int iv);
+ 		void GaussCenter(void);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13073)
+@@ -704,13 +704,13 @@
+ 		#ifdef _HAVE_CONTROL_
+ 		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+ 			for(i=0;i<num_control_type;i++){
+-				switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
++				switch(reCast<int>(iomodel->Data(InversionControlParametersEnum)[i])){
+ 					case MaterialsRheologyBbarEnum:
+ 						if (iomodel->Data(MaterialsRheologyBEnum)){
+ 							_assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
+-							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
+-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
++							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+ 							this->inputs->AddInput(new ControlInput(MaterialsRheologyBbarEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+ 						}
+ 						break;
+@@ -732,7 +732,7 @@
+ 
+ 		/*Get B*/
+ 		if (iomodel->Data(MaterialsRheologyBEnum)) {
+-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
+ 			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,nodeinputs));
+ 		}
+ 
+@@ -746,13 +746,13 @@
+ 		#ifdef _HAVE_CONTROL_
+ 		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+ 			for(i=0;i<num_control_type;i++){
+-				switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
++				switch(reCast<int>(iomodel->Data(InversionControlParametersEnum)[i])){
+ 					case MaterialsRheologyBbarEnum:
+ 						if (iomodel->Data(MaterialsRheologyBEnum)){
+ 							_assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
+-							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
+-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
++							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+ 							this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+ 						}
+ 						break;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp	(revision 13073)
+@@ -571,7 +571,7 @@
+ 		pe->values[0]=0;
+ 	}
+ 	else{
+-		if (dt) pe->values[0]=melting_offset*pow((IssmDouble)10,penalty_factor)*(temperature-t_pmp)/dt;
++		if (reCast<bool>(dt)) pe->values[0]=melting_offset*pow((IssmDouble)10,penalty_factor)*(temperature-t_pmp)/dt;
+ 		else    pe->values[0]=melting_offset*pow((IssmDouble)10,penalty_factor)*(temperature-t_pmp);
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp	(revision 13073)
+@@ -59,11 +59,11 @@
+ 	iomodel->Constant(&penalty_lock,DiagnosticRiftPenaltyLockEnum);
+ 
+ 	/*Ok, retrieve all the data needed to add a penalty between the two nodes: */
+-	el1=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+2);
+-	el2=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+3); 
++	el1=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+2));
++	el2=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+3)) ;
+ 
+-	node1=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+0); 
+-	node2=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+1);
++	node1=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+0));
++	node2=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+1));
+ 
+ 	/*id: */
+ 	this->id=riftfront_id;
+@@ -92,16 +92,16 @@
+ 	this->normal[1]=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+5);
+ 	this->length=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+6);
+ 	this->fraction=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+9);
+-	this->state=(int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+11);
++	this->state=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+11));
+ 
+ 	//intialize inputs, and add as many inputs per element as requested: 
+ 	this->inputs=new Inputs();
+ 		
+ 	riftfront_type=SegmentRiftfrontEnum;
+-	riftfront_fill = (int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+7);
++	riftfront_fill = reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+7));
+ 	riftfront_friction=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+8);
+ 	riftfront_fractionincrement=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+10);
+-	riftfront_shelf=(bool)iomodel->Data(MaskVertexonfloatingiceEnum)[node1-1];
++	riftfront_shelf=reCast<bool,IssmDouble>(iomodel->Data(MaskVertexonfloatingiceEnum)[node1-1]);
+ 
+ 	this->inputs->AddInput(new IntInput(TypeEnum,riftfront_type));
+ 	this->inputs->AddInput(new IntInput(FillEnum,riftfront_fill));
+@@ -678,7 +678,7 @@
+ 
+ 	this->inputs->GetInputValue(&converged,ConvergedEnum);
+ 
+-	if(converged){
++	if(reCast<int,IssmDouble>(converged)){
+ 		/*ok, material non-linearity has converged. If that was already the case, we keep 
+ 		 * constraining the rift front. If it was not, and this is the first time the material 
+ 		 * has converged, we start constraining now!: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 13073)
+@@ -88,19 +88,19 @@
+ 			/*We have a  3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
+ 			_assert_(iomodel->Data(MeshVertexonbedEnum)); 
+ 			_assert_(iomodel->Data(FlowequationVertexEquationEnum));
+-			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealApproximationEnum && !iomodel->Data(MeshVertexonbedEnum)[io_index]){
++			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){
+ 				for(k=1;k<=gsize;k++) this->FreezeDof(k);
+ 			}
+-			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==L1L2ApproximationEnum && !iomodel->Data(MeshVertexonbedEnum)[io_index]){
++			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==L1L2ApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){
+ 				for(k=1;k<=gsize;k++) this->FreezeDof(k);
+ 			}
+-			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealPattynApproximationEnum && iomodel->Data(FlowequationBordermacayealEnum)[io_index]){
+-				if(!iomodel->Data(MeshVertexonbedEnum)[io_index]){
++			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealPattynApproximationEnum && reCast<int>(iomodel->Data(FlowequationBordermacayealEnum)[io_index])){
++				if(!reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){
+ 					for(k=1;k<=gsize;k++) this->FreezeDof(k);
+ 				}
+ 			}
+-			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealStokesApproximationEnum && iomodel->Data(FlowequationBordermacayealEnum)[io_index]){
+-				if(!iomodel->Data(MeshVertexonbedEnum)[io_index]){
++			if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealStokesApproximationEnum && reCast<int>(iomodel->Data(FlowequationBordermacayealEnum)[io_index])){
++				if(!reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){
+ 					for(k=1;k<=2;k++) this->FreezeDof(k);
+ 				}
+ 			}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13073)
+@@ -1468,7 +1468,7 @@
+ 	#ifdef _HAVE_CONTROL_
+ 	if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+ 		for(i=0;i<num_control_type;i++){
+-			switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
++			switch(reCast<int>(iomodel->Data(InversionControlParametersEnum)[i])){
+ 				case BalancethicknessThickeningRateEnum:
+ 					if (iomodel->Data(BalancethicknessThickeningRateEnum)){
+ 						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(BalancethicknessThickeningRateEnum)[tria_vertex_ids[j]-1]/yts;
+@@ -1504,7 +1504,7 @@
+ 				case MaterialsRheologyBbarEnum:
+ 					/*Matice will take care of it*/ break;
+ 				default:
+-					_error_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
++					_error_("Control " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])) << " not implemented yet");
+ 			}
+ 		}
+ 	}
+@@ -2590,7 +2590,7 @@
+ 	rho_ice=matpar->GetRhoIce();
+ 
+ 	/*First off, check that this segment belongs to this element: */
+-	if ((int)*(segment+4)!=this->id)_error_("error message: segment with id " << (int)*(segment+4) << " does not belong to element with id:" << this->id);
++	if (reCast<int>(*(segment+4))!=this->id)_error_("error message: segment with id " << reCast<int>(*(segment+4)) << " does not belong to element with id:" << this->id);
+ 
+ 	/*Recover segment node locations: */
+ 	x1=*(segment+0); y1=*(segment+1); x2=*(segment+2); y2=*(segment+3);
+@@ -2794,7 +2794,7 @@
+ 		case MaterialsRheologyBbarEnum:
+ 			*presponse=this->matice->GetBbar();
+ 			break;
+-		case VelEnum:
++		case VelEnum:{
+ 
+ 			/*Get input:*/
+ 			IssmDouble vel;
+@@ -2807,7 +2807,8 @@
+ 			if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum);
+ 
+ 			/*Assign output pointers:*/
+-			*presponse=vel;
++			*presponse=vel;}
++			break;
+ 		default:  
+ 			_error_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
+ 	}
+@@ -5363,7 +5364,7 @@
+ 		basal_melting_input->GetInputValue(&basal_melting_g,gauss);
+ 		old_watercolumn_input->GetInputValue(&old_watercolumn_g,gauss);
+ 
+-		if(dt)for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(old_watercolumn_g+dt*basal_melting_g)*basis[i];
++		if(reCast<int,IssmDouble>(dt))for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(old_watercolumn_g+dt*basal_melting_g)*basis[i];
+ 		else  for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*basal_melting_g*basis[i];
+ 	}
+ 		
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13073)
+@@ -66,14 +66,14 @@
+ 
+ 	/*Build neighbors list*/
+ 	if (xIsNan<IssmDouble>(iomodel->Data(MeshUpperelementsEnum)[index])) penta_elements_ids[1]=this->id; //upper penta is the same penta
+-	else                                    penta_elements_ids[1]=(int)(iomodel->Data(MeshUpperelementsEnum)[index]);
++	else                                    penta_elements_ids[1]=reCast<int,IssmDouble>((iomodel->Data(MeshUpperelementsEnum)[index]));
+ 	if (xIsNan<IssmDouble>(iomodel->Data(MeshLowerelementsEnum)[index])) penta_elements_ids[0]=this->id; //lower penta is the same penta
+-	else                                    penta_elements_ids[0]=(int)(iomodel->Data(MeshLowerelementsEnum)[index]);
++	else                                    penta_elements_ids[0]=reCast<int,IssmDouble>((iomodel->Data(MeshLowerelementsEnum)[index]));
+ 	this->InitHookNeighbors(penta_elements_ids);
+ 
+ 	/*Build horizontalneighborsids list: */
+ 	_assert_(iomodel->Data(MeshElementconnectivityEnum));
+-	for(i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->Data(MeshElementconnectivityEnum)[3*index+i]-1;
++	for(i=0;i<3;i++) this->horizontalneighborsids[i]=reCast<int,IssmDouble>(iomodel->Data(MeshElementconnectivityEnum)[3*index+i])-1;
+ 
+ 	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
+ 	this->parameters=NULL;
+@@ -1252,13 +1252,13 @@
+ 	if (!IsInput(name)) return;
+ 	
+ 	if ((code==5) || (code==1)){ //boolean
+-		this->inputs->AddInput(new BoolInput(name,(bool)scalar));
++		this->inputs->AddInput(new BoolInput(name,reCast<bool,IssmDouble>(scalar)));
+ 	}
+ 	else if ((code==6) || (code==2)){ //integer
+-		this->inputs->AddInput(new IntInput(name,(int)scalar));
++		this->inputs->AddInput(new IntInput(name,reCast<int,IssmDouble>(scalar)));
+ 	}
+ 	else if ((code==7) || (code==3)){ //IssmDouble
+-		this->inputs->AddInput(new DoubleInput(name,(IssmDouble)scalar));
++		this->inputs->AddInput(new DoubleInput(name,scalar));
+ 	}
+ 	else _error_("could not recognize nature of vector from code " << code);
+ 
+@@ -1290,7 +1290,7 @@
+ 		/*Recover vertices ids needed to initialize inputs*/
+ 		for(i=0;i<6;i++){ 
+ 			_assert_(iomodel->Data(MeshElementsEnum));
+-			penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
++			penta_vertex_ids[i]=reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[6*index+i]); //ids for vertices are in the elements array from Matlab
+ 		}
+ 
+ 		/*Are we in transient or static? */
+@@ -1335,13 +1335,13 @@
+ 			/*static mode: create an input out of the element value: */
+ 
+ 			if (code==5){ //boolean
+-				this->inputs->AddInput(new BoolInput(vector_enum,(bool)vector[index]));
++				this->inputs->AddInput(new BoolInput(vector_enum,reCast<bool,IssmDouble>(vector[index])));
+ 			}
+ 			else if (code==6){ //integer
+-				this->inputs->AddInput(new IntInput(vector_enum,(int)vector[index]));
++				this->inputs->AddInput(new IntInput(vector_enum,reCast<int,IssmDouble>(vector[index])));
+ 			}
+ 			else if (code==7){ //IssmDouble
+-				this->inputs->AddInput(new DoubleInput(vector_enum,(IssmDouble)vector[index]));
++				this->inputs->AddInput(new DoubleInput(vector_enum,vector[index]));
+ 			}
+ 			else _error_("could not recognize nature of vector from code " << code);
+ 		}
+@@ -1625,14 +1625,14 @@
+ 
+ 	/*Recover vertices ids needed to initialize inputs*/
+ 	for(i=0;i<6;i++){ 
+-		penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
++		penta_vertex_ids[i]=reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[6*index+i]); //ids for vertices are in the elements array from Matlab
+ 	}
+ 
+ 	/*Control Inputs*/
+ 	#ifdef _HAVE_CONTROL_
+ 	if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+ 		for(i=0;i<num_control_type;i++){
+-			switch((int)iomodel->Data(InversionControlParametersEnum)[i]){
++			switch(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])){
+ 				case BalancethicknessThickeningRateEnum:
+ 					if (iomodel->Data(BalancethicknessThickeningRateEnum)){
+ 						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(BalancethicknessThickeningRateEnum)[penta_vertex_ids[j]-1]/yts;
+@@ -1668,7 +1668,7 @@
+ 				case MaterialsRheologyBbarEnum:
+ 					/*Matice will take care of it*/ break;
+ 				default:
+-					_error_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
++					_error_("Control " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])) << " not implemented yet");
+ 			}
+ 		}
+ 	}
+@@ -1704,7 +1704,7 @@
+ 			this->inputs->AddInput(new IntInput(ApproximationEnum,NoneApproximationEnum));
+ 		}
+ 		else{
+-			_error_("Approximation type " << EnumToStringx((int)iomodel->Data(FlowequationElementEquationEnum)[index]) << " not supported yet");
++			_error_("Approximation type " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(FlowequationElementEquationEnum)[index])) << " not supported yet");
+ 		}
+ 	}
+ 
+@@ -1950,19 +1950,22 @@
+ 	switch(type){
+ 
+ 		case VertexEnum:
++			{
+ 
+-			/*New PentaVertexInpu*/
+-			IssmDouble values[6];
++				/*New PentaVertexInpu*/
++				IssmDouble values[6];
+ 
+-			/*Get values on the 6 vertices*/
+-			for (int i=0;i<6;i++){
+-				values[i]=vector[this->nodes[i]->GetVertexDof()];
++				/*Get values on the 6 vertices*/
++				for (int i=0;i<6;i++){
++					values[i]=vector[this->nodes[i]->GetVertexDof()];
++				}
++
++				/*update input*/
++				this->inputs->AddInput(new PentaP1Input(name,values));
++				return;
++				break;
+ 			}
+ 
+-			/*update input*/
+-			this->inputs->AddInput(new PentaP1Input(name,values));
+-			return;
+-
+ 		default:
+ 
+ 			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+@@ -2062,7 +2065,7 @@
+ 	bool shelf=false;
+ 
+ 	for(i=0;i<NUMVERTICES;i++){
+-		if (flags[nodes[i]->Sid()]){
++		if (reCast<bool,IssmDouble>(flags[nodes[i]->Sid()])){
+ 			shelf=true;
+ 			break;
+ 		}
+@@ -2163,7 +2166,7 @@
+ 	/*go through vertices, and update inputs, considering them to be PentaVertex type: */
+ 	for(i=0;i<NUMVERTICES;i++){
+ 		/*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
+-		if(old_floating_ice[nodes[i]->Sid()]){
++		if(reCast<bool,IssmDouble>(old_floating_ice[nodes[i]->Sid()])){
+ 			if(b[i]<=ba[i]){ 
+ 				b[i]=ba[i];
+ 				s[i]=b[i]+h[i];
+@@ -2183,7 +2186,7 @@
+ 					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
+ 					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
+ 				}
+-				else if(migration_style==SoftMigrationEnum && sheet_ungrounding[nodes[i]->Sid()]){
++				else if(migration_style==SoftMigrationEnum && reCast<int,IssmDouble>(sheet_ungrounding[nodes[i]->Sid()])){
+ 					s[i]=(1-density)*h[i];
+ 					b[i]=-density*h[i];
+ 					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
+@@ -2842,13 +2845,13 @@
+ 	this->SetElementType(penta_type,analysis_counter);
+ 
+ 	/*Recover vertices ids needed to initialize inputs*/
+-	for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
++	for(i=0;i<6;i++) penta_vertex_ids[i]=reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[6*index+i]); //ids for vertices are in the elements array from Matlab
+ 
+ 	/*Recover nodes ids needed to initialize the node hook.*/
+ 	for(i=0;i<6;i++){ 
+ 		//go recover node ids, needed to initialize the node hook.
+ 		//WARNING: We assume P1 elements here!!!!!
+-		penta_node_ids[i]=iomodel->nodecounter+(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
++		penta_node_ids[i]=iomodel->nodecounter+reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[6*index+i]); //ids for vertices are in the elements array from Matlab
+ 	}
+ 
+ 	/*hooks: */
+@@ -2961,7 +2964,7 @@
+ 
+ 	/*Go through nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */
+ 	for(i=0;i<NUMVERTICES;i++){
+-		if (vertices_potentially_ungrounding[nodes[i]->Sid()]){
++		if (reCast<bool,IssmDouble>(vertices_potentially_ungrounding[nodes[i]->Sid()])){
+ 			vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
+ 		
+ 			/*If node was not on ice shelf, we flipped*/
+@@ -3227,19 +3230,22 @@
+ 			*presponse=this->matice->GetBbar();
+ 			break;
+ 		case VelEnum:
++			{
+ 
+-			/*Get input:*/
+-			IssmDouble vel;
+-			Input* vel_input;
++				/*Get input:*/
++				IssmDouble vel;
++				Input* vel_input;
+ 
+-			vel_input=this->inputs->GetInput(VelEnum); _assert_(vel_input);
+-			vel_input->GetInputAverage(&vel);
++				vel_input=this->inputs->GetInput(VelEnum); _assert_(vel_input);
++				vel_input->GetInputAverage(&vel);
+ 
+-			/*process units if requested: */
+-			if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum);
++				/*process units if requested: */
++				if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum);
+ 
+-			/*Assign output pointers:*/
+-			*presponse=vel;
++				/*Assign output pointers:*/
++				*presponse=vel;
++			}
++			break;
+ 		default:  
+ 			_error_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
+ 	}
+@@ -3364,7 +3370,7 @@
+ 		pressure_input->GetInputValue(&pressure, gauss);
+ 		kappa=matpar->GetEnthalpyDiffusionParameter(enthalpy,pressure);
+ 		D_scalar_conduct=gauss->weight*Jdet*kappa;
+-		if(dt) D_scalar_conduct=D_scalar_conduct*dt;
++		if(reCast<bool,IssmDouble>(dt)) D_scalar_conduct=D_scalar_conduct*dt;
+ 
+ 		D[0][0]=D_scalar_conduct; D[0][1]=0; D[0][2]=0;
+ 		D[1][0]=0; D[1][1]=D_scalar_conduct; D[1][2]=0;
+@@ -3384,7 +3390,7 @@
+ 		vz_input->GetInputValue(&w, gauss); vzm_input->GetInputValue(&wm,gauss); vz=w-wm;
+ 
+ 		D_scalar_advec=gauss->weight*Jdet;
+-		if(dt) D_scalar_advec=D_scalar_advec*dt;
++		if(reCast<bool,IssmDouble>(dt)) D_scalar_advec=D_scalar_advec*dt;
+ 
+ 		D[0][0]=D_scalar_advec*vx;D[0][1]=0;                D[0][2]=0;
+ 		D[1][0]=0;                D[1][1]=D_scalar_advec*vy;D[1][2]=0;
+@@ -3396,7 +3402,7 @@
+ 					&Ke->values[0],1);
+ 
+ 		/*Transient: */
+-		if(dt){
++		if(reCast<bool,IssmDouble>(dt)){
+ 			GetNodalFunctionsP1(&L[0], gauss);
+ 			D_scalar_trans=gauss->weight*Jdet;
+ 			D_scalar_trans=D_scalar_trans;
+@@ -3417,7 +3423,7 @@
+ 			K[1][0]=h/(2*vel)*vy*vx;  K[1][1]=h/(2*vel)*vy*vy; K[1][2]=h/(2*vel)*vy*vz;
+ 			K[2][0]=h/(2*vel)*vz*vx;  K[2][1]=h/(2*vel)*vz*vy; K[2][2]=h/(2*vel)*vz*vz;
+ 			D_scalar_stab=gauss->weight*Jdet;
+-			if(dt) D_scalar_stab=D_scalar_stab*dt;
++			if(reCast<bool,IssmDouble>(dt)) D_scalar_stab=D_scalar_stab*dt;
+ 			for(i=0;i<3;i++) for(j=0;j<3;j++) K[i][j] = D_scalar_stab*K[i][j];
+ 
+ 			GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
+@@ -3437,7 +3443,7 @@
+ 					  ((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i])*((u-um)*dbasis[0][j]+(v-vm)*dbasis[1][j]+(w-wm)*dbasis[2][j]);
+ 				}
+ 			}
+-			if(dt){
++			if(reCast<bool,IssmDouble>(dt)){
+ 				for(i=0;i<numdof;i++){
+ 					for(j=0;j<numdof;j++){
+ 						Ke->values[i*numdof+j]+=tau_parameter*D_scalar_trans*L[j]*((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i]);
+@@ -3493,7 +3499,7 @@
+ 		GetNodalFunctionsP1(&basis[0], gauss);
+ 				
+ 		D_scalar=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(rho_ice*heatcapacity);
+-		if(dt) D_scalar=dt*D_scalar;
++		if(reCast<bool,IssmDouble>(dt)) D_scalar=dt*D_scalar;
+ 
+ 		TripleMultiply(&basis[0],numdof,1,0,
+ 					&D_scalar,1,1,0,
+@@ -3593,7 +3599,7 @@
+ 		GetBConduct(&B_conduct[0][0],&xyz_list[0][0],gauss); 
+ 
+ 		D_scalar_conduct=gauss->weight*Jdet*kappa;
+-		if(dt) D_scalar_conduct=D_scalar_conduct*dt;
++		if(reCast<bool,IssmDouble>(dt)) D_scalar_conduct=D_scalar_conduct*dt;
+ 
+ 		D[0][0]=D_scalar_conduct; D[0][1]=0; D[0][2]=0;
+ 		D[1][0]=0; D[1][1]=D_scalar_conduct; D[1][2]=0;
+@@ -3614,7 +3620,7 @@
+ 		vz_input->GetInputValue(&w, gauss); vzm_input->GetInputValue(&wm,gauss); vz=w-wm;
+ 
+ 		D_scalar_advec=gauss->weight*Jdet;
+-		if(dt) D_scalar_advec=D_scalar_advec*dt;
++		if(reCast<bool,IssmDouble>(dt)) D_scalar_advec=D_scalar_advec*dt;
+ 
+ 		D[0][0]=D_scalar_advec*vx;    D[0][1]=0;                    D[0][2]=0;
+ 		D[1][0]=0;                    D[1][1]=D_scalar_advec*vy;    D[1][2]=0;
+@@ -3626,7 +3632,7 @@
+ 					&Ke->values[0],1);
+ 
+ 		/*Transient: */
+-		if(dt){
++		if(reCast<bool,IssmDouble>(dt)){
+ 			GetNodalFunctionsP1(&L[0], gauss);
+ 			D_scalar_trans=gauss->weight*Jdet;
+ 			D_scalar_trans=D_scalar_trans;
+@@ -3649,7 +3655,7 @@
+ 			K[2][0]=h/(2*vel)*fabs(vz*vx);  K[2][1]=h/(2*vel)*fabs(vz*vy); K[2][2]=h/(2*vel)*fabs(vz*vz);
+ 
+ 			D_scalar_stab=gauss->weight*Jdet;
+-			if(dt) D_scalar_stab=D_scalar_stab*dt;
++			if(reCast<bool,IssmDouble>(dt)) D_scalar_stab=D_scalar_stab*dt;
+ 			for(i=0;i<3;i++) for(j=0;j<3;j++) K[i][j] = D_scalar_stab*K[i][j];
+ 
+ 			GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
+@@ -3669,7 +3675,7 @@
+ 					  ((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i])*((u-um)*dbasis[0][j]+(v-vm)*dbasis[1][j]+(w-wm)*dbasis[2][j]);
+ 				}
+ 			}
+-			if(dt){
++			if(reCast<bool,IssmDouble>(dt)){
+ 				for(i=0;i<numdof;i++){
+ 					for(j=0;j<numdof;j++){
+ 						Ke->values[i*numdof+j]+=tau_parameter*D_scalar_trans*L[j]*((u-um)*dbasis[0][i]+(v-vm)*dbasis[1][i]+(w-wm)*dbasis[2][i]);
+@@ -3726,7 +3732,7 @@
+ 		GetNodalFunctionsP1(&basis[0], gauss);
+ 				
+ 		D_scalar=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(heatcapacity*rho_ice);
+-		if(dt) D_scalar=dt*D_scalar;
++		if(reCast<bool,IssmDouble>(dt)) D_scalar=dt*D_scalar;
+ 
+ 		TripleMultiply(&basis[0],numdof,1,0,
+ 					&D_scalar,1,1,0,
+@@ -3795,7 +3801,7 @@
+ 	Input* pressure_input=inputs->GetInput(PressureEnum);                      _assert_(pressure_input);
+ 	Input* enthalpy_input=NULL; 
+ 	Input* enthalpypicard_input=NULL; 
+-	if(dt){
++	if(reCast<bool,IssmDouble>(dt)){
+ 		enthalpy_input=inputs->GetInput(EnthalpyEnum); _assert_(enthalpy_input);
+ 	}
+ 	if (stabilization==2){
+@@ -3817,12 +3823,12 @@
+ 		GetPhi(&phi, &epsilon[0], viscosity);
+ 
+ 		scalar_def=phi/rho_ice*Jdet*gauss->weight;
+-		if(dt) scalar_def=scalar_def*dt;
++		if(reCast<bool,IssmDouble>(dt)) scalar_def=scalar_def*dt;
+ 
+ 		for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_def*L[i];
+ 
+ 		/* Build transient now */
+-		if(dt){
++		if(reCast<bool,IssmDouble>(dt)){
+ 			enthalpy_input->GetInputValue(&enthalpy, gauss);
+ 			scalar_transient=enthalpy*Jdet*gauss->weight;
+ 			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_transient*L[i];
+@@ -3840,7 +3846,7 @@
+ 			tau_parameter=GetStabilizationParameter(u,v,w,diameter,kappa);
+ 
+ 			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
+-			if(dt){
++			if(reCast<bool,IssmDouble>(dt)){
+ 				for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
+ 			}
+ 		}
+@@ -3898,7 +3904,7 @@
+ 		h_pmp=matpar->PureIceEnthalpy(pressure);
+ 
+ 		scalar_ocean=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity*(h_pmp)/(rho_ice*heatcapacity);
+-		if(dt) scalar_ocean=dt*scalar_ocean;
++		if(reCast<bool,IssmDouble>(dt)) scalar_ocean=dt*scalar_ocean;
+ 
+ 		for(i=0;i<numdof;i++) pe->values[i]+=scalar_ocean*basis[i];
+ 	}
+@@ -3984,7 +3990,7 @@
+ 			basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
+ 
+ 			scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(rho_ice);
+-			if(dt) scalar=dt*scalar;
++			if(reCast<bool,IssmDouble>(dt)) scalar=dt*scalar;
+ 
+ 			for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
+ //		}
+@@ -4056,7 +4062,7 @@
+ 	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+ 	Input* vz_input=inputs->GetInput(VzEnum); _assert_(vz_input);
+ 	Input* temperature_input=NULL;
+-	if (dt) temperature_input=inputs->GetInput(TemperatureEnum); _assert_(inputs);
++	if (reCast<bool,IssmDouble>(dt)) temperature_input=inputs->GetInput(TemperatureEnum); _assert_(inputs);
+ 	if (stabilization==2) diameter=MinEdgeLength(xyz_list);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+@@ -4073,12 +4079,12 @@
+ 		GetPhi(&phi, &epsilon[0], viscosity);
+ 
+ 		scalar_def=phi/(rho_ice*heatcapacity)*Jdet*gauss->weight;
+-		if(dt) scalar_def=scalar_def*dt;
++		if(reCast<bool,IssmDouble>(dt)) scalar_def=scalar_def*dt;
+ 
+ 		for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_def*L[i];
+ 
+ 		/* Build transient now */
+-		if(dt){
++		if(reCast<bool,IssmDouble>(dt)){
+ 			temperature_input->GetInputValue(&temperature, gauss);
+ 			scalar_transient=temperature*Jdet*gauss->weight;
+ 			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_transient*L[i];
+@@ -4094,7 +4100,7 @@
+ 			tau_parameter=GetStabilizationParameter(u,v,w,diameter,kappa);
+ 
+ 			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
+-			if(dt){
++			if(reCast<bool,IssmDouble>(dt)){
+ 				for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
+ 			}
+ 		}
+@@ -4152,7 +4158,7 @@
+ 		t_pmp=matpar->TMeltingPoint(pressure);
+ 
+ 		scalar_ocean=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity*(t_pmp)/(heatcapacity*rho_ice);
+-		if(dt) scalar_ocean=dt*scalar_ocean;
++		if(reCast<bool,IssmDouble>(dt)) scalar_ocean=dt*scalar_ocean;
+ 
+ 		for(i=0;i<numdof;i++) pe->values[i]+=scalar_ocean*basis[i];
+ 	}
+@@ -4218,7 +4224,7 @@
+ 			basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
+ 
+ 			scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(heatcapacity*rho_ice);
+-			if(dt) scalar=dt*scalar;
++			if(reCast<bool,IssmDouble>(dt)) scalar=dt*scalar;
+ 
+ 			for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh	(revision 13072)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh	(revision 13073)
+@@ -2,19 +2,7 @@
+ 
+ ./configure \
+ 	--prefix=$ISSM_DIR \
+-	--without-modules\
+-	--without-thermal \
+-	--without-control \
+-	--without-hydrology \
+-	--without-diagnostic \
+-	--without-balanced \
+-	--without-responses \
+-	--without-slope \
+-	--without-rifts \
+-	--without-steadystate \
+-	--without-transient \
+-	--without-3d \
+-	--without-groundingline \
++	--without-modules \
+ 	--without-kriging  \
+ 	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
+ 	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install
Index: /issm/oecreview/Archive/12678-13393/ISSM-13073-13074.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13073-13074.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13073-13074.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.m	(revision 13073)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.m	(revision 13074)
+@@ -28,6 +28,7 @@
+ %ISSM path
+ addpath([ISSM_DIR '/src/m/os/']); %loads recursivepath
+ addpath([ISSM_DIR '/bin']);
++addpath([ISSM_DIR '/lib']);
+ addpath(recursivepath([ISSM_DIR '/src/m']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/scotch']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/canos']));
Index: /issm/oecreview/Archive/12678-13393/ISSM-13074-13075.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13074-13075.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13074-13075.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind	(revision 13074)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind	(revision 13075)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind
+___________________________________________________________________
+Modified: svn:ignore
+## -2,3 +2,4 ##
+ configure.sh
+ src
+ .ignore.txt
++*.bz2
Index: /issm/oecreview/Archive/12678-13393/ISSM-13075-13076.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13075-13076.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13075-13076.diff	(revision 13394)
@@ -0,0 +1,71 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 13075)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 13076)
+@@ -75,11 +75,11 @@
+ 
+ 
+ %Create zeros basalforcings and surfaceforcings
+-if (isnan(md.surfaceforcings.precipitation)& (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
++if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1)),
+ 	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+ 	disp('      no surfaceforcings.precipitation specified: values set as zero');
+ end
+-if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
++if (isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0)),
+ 	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 	disp('      no surfaceforcings.mass_balance specified: values set as zero');
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m	(revision 13075)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m	(revision 13076)
+@@ -33,11 +33,11 @@
+ end
+ 
+ %Create zeros basal melting rate and surface mass balance if not specified
+-if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
++if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1)),
+ 	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+ 	disp('      no surfaceforcings.precipitation specified: values set as zero');
+ end
+-if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
++if (isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0)),
+ 	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 	disp('      no surfaceforcings.mass_balance specified: values set as zero');
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 13075)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 13076)
+@@ -68,10 +68,10 @@
+ 	md.diagnostic.icefront=pressureload
+ 
+ 	#Create zeros basalforcings and surfaceforcings
+-	if numpy.all(numpy.isnan(md.surfaceforcings.precipitation)):
++	if numpy.all(numpy.isnan(md.surfaceforcings.precipitation)) and (md.surfaceforcings.ispdd==1):
+ 		md.surfaceforcings.precipitation=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no surfaceforcings.precipitation specified: values set as zero'
+-	if numpy.all(numpy.isnan(md.surfaceforcings.mass_balance)):
++	if numpy.all(numpy.isnan(md.surfaceforcings.mass_balance)) and (md.surfaceforcings.ispdd==0):
+ 		md.surfaceforcings.mass_balance=numpy.zeros(md.mesh.numberofvertices)
+ 		print '      no surfaceforcings.mass_balance specified: values set as zero'
+ 	if numpy.all(numpy.isnan(md.basalforcings.melting_rate)):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m	(revision 13075)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m	(revision 13076)
+@@ -64,11 +64,11 @@
+ md.diagnostic.icefront=pressureload;
+ 
+ %Create zeros basalforcings and surfaceforcings
+-if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1) & (md.surfaceforcings.ispdd==0)),
++if (isnan(md.surfaceforcings.precipitation) & (md.surfaceforcings.ispdd==1)),
+ 	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+ 	disp('      no surfaceforcings.precipitation specified: values set as zero');
+ end
+-if isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0),
++if (isnan(md.surfaceforcings.mass_balance) & (md.surfaceforcings.ispdd==0)),
+ 	        md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 		disp('      no surfaceforcings.mass_balance specified: values set as zero');
+ end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13076-13077.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13076-13077.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13076-13077.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh	(revision 13076)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh	(revision 13077)
+@@ -8,4 +8,4 @@
+ # If all goes well, then the script will be shortened in the future.
+ 
+ cd $ISSM_DIR
+-autoreconf -iv -I m4
++autoreconf -iv --force -I m4
Index: /issm/oecreview/Archive/12678-13393/ISSM-13077-13078.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13077-13078.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13077-13078.diff	(revision 13394)
@@ -0,0 +1,45 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13078)
+@@ -0,0 +1,34 @@
++#!/bin/bash
++
++#some issues on macosx64 with ISSM's autoconf. you might want to run native to mac on this.
++
++#Some cleanup
++rm -rf install ADOL-C-2.2.0 src trunk
++
++#Create install directories
++mkdir install src
++
++svn co https://projects.coin-or.org/svn/ADOL-C/trunk
++mv trunk/* src
++
++#Compile ADOL-C
++cd src 
++
++#export CC=gcc
++#export CXX=g++
++#export CFLAGS="-arch x86_64"
++#export CXXFLAGS="-arch x86_64"
++
++./configure \
++	--prefix=$ISSM_DIR/externalpackages/adolc/install \
++	--enable-sparse \
++	--enable-docexa \
++	--enable-addexa \
++	--disable-shave
++
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13078-13079.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13078-13079.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13078-13079.diff	(revision 13394)
@@ -0,0 +1,200 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-macosx64.sh	(revision 13078)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-macosx64.sh	(revision 13079)
+@@ -1,71 +0,0 @@
+-#!/bin/bash
+-
+-#some issues on macosx64 with ISSM's autoconf. you might want to run native to mac on this.
+-
+-#choose dev or not? 
+-devpmt=1;
+-
+-#Some cleanup
+-rm -rf install ADOL-C-2.2.0 src trunk
+-
+-#Create install directories
+-mkdir install src
+-
+-if [[ $devpmt == "0" ]]; then
+-	#Download from ISSM server
+-	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C-2.2.0.tar.gz' 'ADOL-C-2.2.0.tar.gz'
+-	
+-	#Untar 
+-	tar -zxvf  ADOL-C-2.2.0.tar.gz
+-
+-	#Move ADOL-C into install directory
+-	mv ADOL-C-2.2.0/* src
+-	rm -rf ADOL-C-2.2.0
+-
+-else
+-	svn co https://projects.coin-or.org/svn/ADOL-C/trunk
+-	mv trunk/* src
+-fi
+-
+-
+-#Compile ADOL-C
+-cd src 
+-
+-#export CC=gcc
+-#export CXX=g++
+-#export CFLAGS="-arch x86_64"
+-#export CXXFLAGS="-arch x86_64"
+-
+-./configure \
+-	--prefix=$ISSM_DIR/externalpackages/adolc/install \
+-	--enable-sparse \
+-	--enable-docexa \
+-	--enable-addexa \
+-	--disable-shave
+-
+-if [ -z $1 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make install
+-
+-
+-#Ok, bug with libtool: replace all LIBTOOL= by LIBTOOL=libtool 
+-#in all Makefiles
+-for i in `find ./ -name Makefile `
+-do
+-	echo $i
+-	cat $i | sed 's/LIBTOOL =/LIBTOOL = libtool/g' > $i.bak 
+-	mv $i.bak $i
+-done
+-
+-#remake: 
+-if [ -z $1 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make install
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install.sh	(revision 13078)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install.sh	(revision 13079)
+@@ -3,14 +3,14 @@
+ #some issues on macosx64 with ISSM's autoconf. you might want to run native to mac on this.
+ 
+ #Some cleanup
+-rm -rf install ADOL-C-2.2.0 src
++rm -rf install ADOL-C-2.2.0 src trunk
+ 
++#Create install directories
++mkdir install src
++
+ #Download from ISSM server
+ $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C-2.2.0.tar.gz' 'ADOL-C-2.2.0.tar.gz'
+ 
+-#Create install directories
+-mkdir install src
+-
+ #Untar 
+ tar -zxvf  ADOL-C-2.2.0.tar.gz
+ 
+@@ -18,13 +18,14 @@
+ mv ADOL-C-2.2.0/* src
+ rm -rf ADOL-C-2.2.0
+ 
++
+ #Compile ADOL-C
+ cd src 
+ 
+-export CC=gcc
+-export CXX=g++
+-export CFLAGS="-arch x86_64"
+-export CXXFLAGS="-arch x86_64"
++#export CC=gcc
++#export CXX=g++
++#export CFLAGS="-arch x86_64"
++#export CXXFLAGS="-arch x86_64"
+ 
+ ./configure \
+ 	--prefix=$ISSM_DIR/externalpackages/adolc/install \
+@@ -39,3 +40,23 @@
+ 	make -j $1
+ fi
+ make install
++
++
++#Ok, bug with libtool: replace all LIBTOOL= by LIBTOOL=libtool 
++#in all Makefiles
++for i in `find ./ -name Makefile `
++do
++	echo $i
++	cat $i | sed 's/LIBTOOL =/LIBTOOL = libtool/g' > $i.bak 
++	mv $i.bak $i
++done
++
++#remake: 
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
++
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13078)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13079)
+@@ -3,29 +3,23 @@
+ #some issues on macosx64 with ISSM's autoconf. you might want to run native to mac on this.
+ 
+ #Some cleanup
+-rm -rf install ADOL-C-2.2.0 src trunk
++rm -rf install ADOL-C-2.2.0 trunk
+ 
+ #Create install directories
+-mkdir install src
++mkdir install
+ 
+ svn co https://projects.coin-or.org/svn/ADOL-C/trunk
+-mv trunk/* src
+ 
+ #Compile ADOL-C
+-cd src 
++cd trunk 
+ 
+-#export CC=gcc
+-#export CXX=g++
+-#export CFLAGS="-arch x86_64"
+-#export CXXFLAGS="-arch x86_64"
++autoconf
++./configure --prefix=$ISSM_DIR/externalpackages/adolc/install \
++#	--enable-sparse \
++#	--enable-docexa \
++#	--enable-addexa \
++#	--disable-shave
+ 
+-./configure \
+-	--prefix=$ISSM_DIR/externalpackages/adolc/install \
+-	--enable-sparse \
+-	--enable-docexa \
+-	--enable-addexa \
+-	--disable-shave
+-
+ if [ -z $1 ]; then
+ 	make
+ else
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc	(revision 13078)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc	(revision 13079)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc
+___________________________________________________________________
+Modified: svn:ignore
+## -2,5 +2,6 ##
+ *.gz
+ install*
+ src
++src-*
+ configure.sh
+ .ignore.txt
Index: /issm/oecreview/Archive/12678-13393/ISSM-13079-13080.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13079-13080.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13079-13080.diff	(revision 13394)
@@ -0,0 +1,37 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13079)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13080)
+@@ -473,6 +473,15 @@
+ 	AM_CONDITIONAL([ADOLC], [test x$HAVE_ADOLC = xyes])
+ 	AC_MSG_RESULT($HAVE_ADOLC)
+ 	dnl }}}
++	dnl adolc-version{{{
++	AC_ARG_WITH([adolc-version],
++		AS_HELP_STRING([--with-adolc-version=number], [adolc version.]),
++		[ADOLC_VERSION=$withval],[ADOLC_VERSION=2]) 
++	AC_MSG_CHECKING(for adolc-version) 
++
++	AC_DEFINE_UNQUOTED([_ADOLC_VERSION_],$ADOLC_VERSION,[ADOLC version])
++	AC_MSG_RESULT($ADOLC_VERSION)
++	dnl }}}
+ 	dnl adic2{{{
+ 	AC_ARG_WITH([adic2-dir],
+ 	  AS_HELP_STRING([--with-adic2-dir=DIR], [adic2 root directory.]),
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13079)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13080)
+@@ -14,7 +14,11 @@
+ 	bool  dakota_analysis,control_analysis,tao_analysis;
+ 
+ 	/*AD: */
+-	int   tape_stats[11];
++	#if _ADOLC_VERSION_ == 2
++	int      tape_stats[11];
++	#else
++	size_t   tape_stats[11];
++	#endif
+ 
+ 	/*FemModel: */
+ 	FemModel *femmodel = NULL;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13080-13081.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13080-13081.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13080-13081.diff	(revision 13394)
@@ -0,0 +1,347 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13080)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13081)
+@@ -369,7 +369,7 @@
+ 
+ 		if(stabilization==2){
+ 			/*Streamline upwinding*/
+-			vel=sqrt(pow(vx,2.)+pow(vy,2.))+1.e-8;
++			vel=sqrt(vx*vx+vy*vy)+1.e-8;
+ 			K[0][0]=h/(2*vel)*vx*vx;
+ 			K[1][0]=h/(2*vel)*vy*vx;
+ 			K[0][1]=h/(2*vel)*vx*vy;
+@@ -2327,7 +2327,6 @@
+ /*FUNCTION Tria::SurfaceArea {{{*/
+ IssmDouble Tria::SurfaceArea(void){
+ 
+-	int    i;
+ 	IssmDouble S;
+ 	IssmDouble normal[3];
+ 	IssmDouble v13[3],v23[3];
+@@ -2338,7 +2337,7 @@
+ 
+ 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+ 
+-	for (i=0;i<3;i++){
++	for(int i=0;i<3;i++){
+ 		v13[i]=xyz_list[0][i]-xyz_list[2][i];
+ 		v23[i]=xyz_list[1][i]-xyz_list[2][i];
+ 	}
+@@ -2347,7 +2346,7 @@
+ 	normal[1]=v13[2]*v23[0]-v13[0]*v23[2];
+ 	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
+ 
+-	S = 0.5 * sqrt(pow(normal[0],(IssmDouble)2)+pow(normal[1],(IssmDouble)2)+pow(normal[2],(IssmDouble)2));
++	S = 0.5 * sqrt(normal[0]*normal[0] + normal[1]*normal[1] + normal[2]*normal[2]);
+ 
+ 	/*Return: */
+ 	return S;
+@@ -2356,12 +2355,11 @@
+ /*FUNCTION Tria::SurfaceNormal{{{*/
+ void Tria::SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]){
+ 
+-	int i;
+ 	IssmDouble v13[3],v23[3];
+ 	IssmDouble normal[3];
+ 	IssmDouble normal_norm;
+ 
+-	for (i=0;i<3;i++){
++	for(int i=0;i<3;i++){
+ 		v13[i]=xyz_list[0][i]-xyz_list[2][i];
+ 		v23[i]=xyz_list[1][i]-xyz_list[2][i];
+ 	}
+@@ -2370,11 +2368,11 @@
+ 	normal[1]=v13[2]*v23[0]-v13[0]*v23[2];
+ 	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
+ 
+-	normal_norm=sqrt( pow(normal[0],(IssmDouble)2)+pow(normal[1],(IssmDouble)2)+pow(normal[2],(IssmDouble)2) );
++	normal_norm=sqrt( normal[0]*normal[0] + normal[1]*normal[1] + normal[2]*normal[2]);
+ 
+-	*(surface_normal)=normal[0]/normal_norm;
+-	*(surface_normal+1)=normal[1]/normal_norm;
+-	*(surface_normal+2)=normal[2]/normal_norm;
++	*(surface_normal+0) = normal[0]/normal_norm;
++	*(surface_normal+1) = normal[1]/normal_norm;
++	*(surface_normal+2) = normal[2]/normal_norm;
+ }
+ /*}}}*/
+ /*FUNCTION Tria::TimeAdapt{{{*/
+@@ -2607,7 +2605,7 @@
+ 	normal[0]=cos(atan2(x1-x2,y2-y1));
+ 	normal[1]=sin(atan2(x1-x2,y2-y1));
+ 
+-	length=sqrt(pow(x2-x1,2.0)+pow(y2-y1,2));
++	length=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
+ 
+ 	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+ 	this->parameters->FindParam(&dim,MeshDimensionEnum);
+@@ -2973,7 +2971,7 @@
+ 		// If we have a slope > 6% for this element,  it means  we are on a mountain. In this particular case, 
+ 		//velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */
+ 		surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
+-		slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2));
++		slope_magnitude=sqrt(slope[0]*slope[0]+slope[1]*slope[1]);
+ 		if(slope_magnitude>MAXSLOPE) alpha2=pow((IssmDouble)10,MOUNTAINKEXPONENT);
+ 		else friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum);
+ 
+@@ -3303,7 +3301,7 @@
+ 
+ 	/*Get Vz and compute vel*/
+ 	GetInputListOnVertices(&vz[0],VzEnum,0);
+-	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++	for(i=0;i<NUMVERTICES;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]);
+ 
+ 	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D, 
+ 	 *so the pressure is just the pressure at the bedrock: */
+@@ -3363,7 +3361,7 @@
+ 
+ 	/*Now Compute vel*/
+ 	GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0
+-	for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
++	for(i=0;i<NUMVERTICES;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]);
+ 
+ 	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D, 
+ 	 *so the pressure is just the pressure at the bedrock: */
+@@ -3982,7 +3980,7 @@
+ 		 * J = ---  sqrt(  (u - u   )  +  (v - v   )  )
+ 		 *      S                obs            obs
+ 		 */
+-		misfit=1/S*pow( pow(vx-vxobs,2.) + pow(vy-vyobs,2.) ,0.5);
++		misfit=1/S*sqrt( pow(vx-vxobs,2) + pow(vy-vyobs,2));
+ 
+ 		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceAverageVelMisfitEnum);
+ 
+@@ -4045,9 +4043,9 @@
+ 		 *                 [       vel   + eps    ]
+ 		 *                            obs
+ 		 */
+-		velocity_mag    =sqrt(pow(vx,   2.)+pow(vy,   2.))+epsvel;
+-		obs_velocity_mag=sqrt(pow(vxobs,2.)+pow(vyobs,2.))+epsvel;
+-		misfit=4*pow(meanvel,2.)*pow(log(velocity_mag/obs_velocity_mag),2.);
++		velocity_mag    =sqrt(pow(vx,   2)+pow(vy,   2))+epsvel;
++		obs_velocity_mag=sqrt(pow(vxobs,2)+pow(vyobs,2))+epsvel;
++		misfit=4*pow(meanvel,2)*pow(log(velocity_mag/obs_velocity_mag),2);
+ 
+ 		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceLogVelMisfitEnum);
+ 
+@@ -4111,9 +4109,9 @@
+ 		 *      2            [       |u    |+ eps              |v    |+ eps     ]
+ 		 *                              obs                       obs
+ 		 */
+-		misfit=0.5*pow(meanvel,2.)*(
+-					pow(log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)),2.) +
+-					pow(log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)),2.) );
++		misfit=0.5*pow(meanvel,2)*(
++					pow(log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)),2) +
++					pow(log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)),2) );
+ 
+ 		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceLogVxVyMisfitEnum);
+ 
+@@ -4174,7 +4172,7 @@
+ 		 *      2  [       obs            obs   ]
+ 		 *
+ 		 */
+-		misfit=0.5*( pow(vx-vxobs,2.) + pow(vy-vyobs,2.) );
++		misfit=0.5*( pow(vx-vxobs,2) + pow(vy-vyobs,2) );
+ 
+ 		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceAverageVelMisfitEnum);
+ 
+@@ -4237,9 +4235,9 @@
+ 		 *      2  [  (u   + eps)^2       obs    (v   + eps)^2       obs    ]
+ 		 *              obs                        obs                      
+ 		 */
+-		scalex=pow(meanvel/(vxobs+epsvel),2.); if(vxobs==0)scalex=0;
+-		scaley=pow(meanvel/(vyobs+epsvel),2.); if(vyobs==0)scaley=0;
+-		misfit=0.5*(scalex*pow((vx-vxobs),2.)+scaley*pow((vy-vyobs),2.));
++		scalex=pow(meanvel/(vxobs+epsvel),2); if(vxobs==0)scalex=0;
++		scaley=pow(meanvel/(vyobs+epsvel),2); if(vyobs==0)scaley=0;
++		misfit=0.5*(scalex*pow((vx-vxobs),2)+scaley*pow((vy-vyobs),2));
+ 		if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceRelVelMisfitEnum);
+ 
+ 		/*Add to cost function*/
+@@ -4287,7 +4285,7 @@
+ 		thickness_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
+ 
+ 		/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
+-		Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
++		Jelem+=weight*1/2*(dp[0]*dp[0]+dp[1]*dp[1])*Jdet*gauss->weight;
+ 	}
+ 
+ 	/*Clean up and return*/
+@@ -4436,7 +4434,7 @@
+ 		weights_input->GetInputValue(&weight,gauss,weight_index);
+ 
+ 		/*compute ThicknessAbsMisfit*/
+-		Jelem+=0.5*pow(thickness-thicknessobs,2.0)*weight*Jdet*gauss->weight;
++		Jelem+=0.5*(thickness-thicknessobs)*(thickness-thicknessobs)*weight*Jdet*gauss->weight;
+ 	}
+ 
+ 	/* clean up and Return: */
+@@ -4624,8 +4622,8 @@
+ 					 *               obs
+ 					 */
+ 					for (i=0;i<NUMVERTICES;i++){
+-						scalex=pow(meanvel/(vxobs+epsvel),2.); if(vxobs==0)scalex=0;
+-						scaley=pow(meanvel/(vyobs+epsvel),2.); if(vyobs==0)scaley=0;
++						scalex=pow(meanvel/(vxobs+epsvel),2); if(vxobs==0)scalex=0;
++						scaley=pow(meanvel/(vyobs+epsvel),2); if(vyobs==0)scaley=0;
+ 						dux=scalex*(vxobs-vx);
+ 						duy=scaley*(vyobs-vy);
+ 						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+@@ -4645,9 +4643,9 @@
+ 					 *            
+ 					 */
+ 					for (i=0;i<NUMVERTICES;i++){
+-						velocity_mag    =sqrt(pow(vx,   2.)+pow(vy,   2.))+epsvel;
+-						obs_velocity_mag=sqrt(pow(vxobs,2.)+pow(vyobs,2.))+epsvel;
+-						scale=-8*pow(meanvel,2.)/pow(velocity_mag,2.)*log(velocity_mag/obs_velocity_mag);
++						velocity_mag    =sqrt(pow(vx,   2)+pow(vy,   2))+epsvel;
++						obs_velocity_mag=sqrt(pow(vxobs,2)+pow(vyobs,2))+epsvel;
++						scale=-8*pow(meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag);
+ 						dux=scale*vx;
+ 						duy=scale*vy;
+ 						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+@@ -4665,7 +4663,7 @@
+ 					 *        du      S  2 sqrt(...)           obs
+ 					 */
+ 					for (i=0;i<NUMVERTICES;i++){
+-						scale=1./(S*2*sqrt(pow(vx-vxobs,2.)+pow(vy-vyobs,2.))+epsvel);
++						scale=1./(S*2*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
+ 						dux=scale*(vxobs-vx);
+ 						duy=scale*(vyobs-vy);
+ 						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+@@ -4683,8 +4681,8 @@
+ 					 *        du                         |u| + eps  |u|                           u + eps
+ 					 */
+ 					for (i=0;i<NUMVERTICES;i++){
+-						dux = - pow(meanvel,2.) * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);
+-						duy = - pow(meanvel,2.) * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);
++						dux = - meanvel*meanvel * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);
++						duy = - meanvel*meanvel * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);
+ 						pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+ 						pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+ 					}
+@@ -4807,8 +4805,8 @@
+ 					 *               obs
+ 					 */
+ 					for (i=0;i<NUMVERTICES;i++){
+-						scalex=pow(meanvel/(vxobs+epsvel),2.); if(vxobs==0)scalex=0;
+-						scaley=pow(meanvel/(vyobs+epsvel),2.); if(vyobs==0)scaley=0;
++						scalex=pow(meanvel/(vxobs+epsvel),2); if(vxobs==0)scalex=0;
++						scaley=pow(meanvel/(vyobs+epsvel),2); if(vyobs==0)scaley=0;
+ 						dux=scalex*(vxobs-vx);
+ 						duy=scaley*(vyobs-vy);
+ 						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+@@ -4828,9 +4826,9 @@
+ 					 *            
+ 					 */
+ 					for (i=0;i<NUMVERTICES;i++){
+-						velocity_mag    =sqrt(pow(vx,   2.)+pow(vy,   2.))+epsvel;
+-						obs_velocity_mag=sqrt(pow(vxobs,2.)+pow(vyobs,2.))+epsvel;
+-						scale=-8*pow(meanvel,2.)/pow(velocity_mag,2.)*log(velocity_mag/obs_velocity_mag);
++						velocity_mag    =sqrt(pow(vx,   2)+pow(vy,   2))+epsvel;
++						obs_velocity_mag=sqrt(pow(vxobs,2)+pow(vyobs,2))+epsvel;
++						scale=-8*pow(meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag);
+ 						dux=scale*vx;
+ 						duy=scale*vy;
+ 						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+@@ -4848,7 +4846,7 @@
+ 					 *        du      S  2 sqrt(...)           obs
+ 					 */
+ 					for (i=0;i<NUMVERTICES;i++){
+-						scale=1./(S*2*sqrt(pow(vx-vxobs,2.)+pow(vy-vyobs,2.))+epsvel);
++						scale=1./(S*2*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
+ 						dux=scale*(vxobs-vx);
+ 						duy=scale*(vyobs-vy);
+ 						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+@@ -4866,8 +4864,8 @@
+ 					 *        du                         |u| + eps  |u|                           u + eps
+ 					 */
+ 					for (i=0;i<NUMVERTICES;i++){
+-						dux = - pow(meanvel,2.) * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);
+-						duy = - pow(meanvel,2.) * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);
++						dux = - meanvel*meanvel * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);
++						duy = - meanvel*meanvel * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);
+ 						pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+ 						pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+ 					}
+@@ -4935,7 +4933,7 @@
+ 		drag_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
+ 
+ 		/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
+-		Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
++		Jelem+=weight*1/2*(dp[0]*dp[0]+dp[1]*dp[1])*Jdet*gauss->weight;
+ 	}
+ 
+ 	/*Clean up and return*/
+@@ -5192,7 +5190,7 @@
+ 	Input* watercolumn_input=inputs->GetInput(WatercolumnEnum);     _assert_(watercolumn_input);
+ 
+ 	/* compute VelocityFactor */
+-	VelocityFactor= n_man*pow(CR,2)*rho_water*g/mu_water;
++	VelocityFactor= n_man*CR*CR*rho_water*g/mu_water;
+ 	
+ 	gauss=new GaussTria();
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+@@ -5204,11 +5202,10 @@
+ 		watercolumn_input->GetInputValue(&w,gauss);
+ 
+ 		/* Water velocity x and y components */
+-	//	vx[iv]= - pow(w,2)/(12 * mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx);
+-	//	vy[iv]= - pow(w,2)/(12 * mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy);
+-	
+-		vx[iv]= - pow(w,2)/(VelocityFactor* mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx);
+-		vy[iv]= - pow(w,2)/(VelocityFactor* mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy);
++	//	vx[iv]= - w*w/(12 * mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx);
++	//	vy[iv]= - w*w/(12 * mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy);
++		vx[iv]= - w*w/(VelocityFactor* mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx);
++		vy[iv]= - w*w/(VelocityFactor* mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy);
+ 	}
+ 
+ 	/*clean-up*/
+@@ -5303,7 +5300,7 @@
+ 					&Ke->values[0],1);
+ 
+ 		/*Artificial diffusivity*/
+-		vel=sqrt(pow(vx,2.)+pow(vy,2.));
++		vel=sqrt(vx*vx+vy*vy);
+ 		K[0][0]=diffusivity*h/(2*vel)*vx*vx;
+ 		K[1][0]=diffusivity*h/(2*vel)*vy*vx;
+ 		K[0][1]=diffusivity*h/(2*vel)*vx*vy;
+@@ -5413,21 +5410,18 @@
+ void  Tria::InputUpdateFromSolutionHydrology(IssmDouble* solution){
+ 
+ 	/*Intermediaries*/
+-	const int numdof = NDOF1*NUMVERTICES;
++	const int   numdof         = NDOF1 *NUMVERTICES;
++	int        *doflist        = NULL;
++	IssmDouble  values[numdof];
+ 
+-	int       i;
+-	int*      doflist=NULL;
+-	IssmDouble    values[numdof];
+-
+ 	/*Get dof list: */
+ 	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+ 
+ 	/*Use the dof list to index into the solution vector: */
+-	for(i=0;i<numdof;i++){
++	for(int i=0;i<numdof;i++){
+ 		values[i]=solution[doflist[i]];
+ 		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+-		if (values[i]<pow((IssmDouble)10,(IssmDouble)-10))values[i]=pow((IssmDouble)10,(IssmDouble)-10); //correcting the water column to positive values
+- 
++		if (values[i]<10e-10) values[i]=10e-10; //correcting the water column to positive values
+ 	}
+ 
+ 	/*Add input to the element: */
+@@ -5678,7 +5672,7 @@
+ 
+ 		if(stabilization==1){
+ 			/*Streamline upwinding*/
+-			vel=sqrt(pow(vx,2.)+pow(vy,2.));
++			vel=sqrt(vx*vx+vy*vy);
+ 			K[0][0]=h/(2*vel)*vx*vx;
+ 			K[1][0]=h/(2*vel)*vy*vx;
+ 			K[0][1]=h/(2*vel)*vx*vy;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13081-13082.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13081-13082.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13081-13082.diff	(revision 13394)
@@ -0,0 +1,8648 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltsugar.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltsugar.m4	(revision 13081)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltsugar.m4	(revision 13082)
+@@ -1,123 +0,0 @@
+-# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+-#
+-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+-# Written by Gary V. Vaughan, 2004
+-#
+-# This file is free software; the Free Software Foundation gives
+-# unlimited permission to copy and/or distribute it, with or without
+-# modifications, as long as this notice is preserved.
+-
+-# serial 6 ltsugar.m4
+-
+-# This is to help aclocal find these macros, as it can't see m4_define.
+-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+-
+-
+-# lt_join(SEP, ARG1, [ARG2...])
+-# -----------------------------
+-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+-# associated separator.
+-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+-# versions in m4sugar had bugs.
+-m4_define([lt_join],
+-[m4_if([$#], [1], [],
+-       [$#], [2], [[$2]],
+-       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+-m4_define([_lt_join],
+-[m4_if([$#$2], [2], [],
+-       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+-
+-
+-# lt_car(LIST)
+-# lt_cdr(LIST)
+-# ------------
+-# Manipulate m4 lists.
+-# These macros are necessary as long as will still need to support
+-# Autoconf-2.59 which quotes differently.
+-m4_define([lt_car], [[$1]])
+-m4_define([lt_cdr],
+-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+-       [$#], 1, [],
+-       [m4_dquote(m4_shift($@))])])
+-m4_define([lt_unquote], $1)
+-
+-
+-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+-# ------------------------------------------
+-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+-# Note that neither SEPARATOR nor STRING are expanded; they are appended
+-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+-# than defined and empty).
+-#
+-# This macro is needed until we can rely on Autoconf 2.62, since earlier
+-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+-m4_define([lt_append],
+-[m4_define([$1],
+-	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+-
+-
+-
+-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+-# ----------------------------------------------------------
+-# Produce a SEP delimited list of all paired combinations of elements of
+-# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+-# has the form PREFIXmINFIXSUFFIXn.
+-# Needed until we can rely on m4_combine added in Autoconf 2.62.
+-m4_define([lt_combine],
+-[m4_if(m4_eval([$# > 3]), [1],
+-       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+-[[m4_foreach([_Lt_prefix], [$2],
+-	     [m4_foreach([_Lt_suffix],
+-		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+-	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+-
+-
+-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+-# -----------------------------------------------------------------------
+-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+-m4_define([lt_if_append_uniq],
+-[m4_ifdef([$1],
+-	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+-		 [lt_append([$1], [$2], [$3])$4],
+-		 [$5])],
+-	  [lt_append([$1], [$2], [$3])$4])])
+-
+-
+-# lt_dict_add(DICT, KEY, VALUE)
+-# -----------------------------
+-m4_define([lt_dict_add],
+-[m4_define([$1($2)], [$3])])
+-
+-
+-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+-# --------------------------------------------
+-m4_define([lt_dict_add_subkey],
+-[m4_define([$1($2:$3)], [$4])])
+-
+-
+-# lt_dict_fetch(DICT, KEY, [SUBKEY])
+-# ----------------------------------
+-m4_define([lt_dict_fetch],
+-[m4_ifval([$3],
+-	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+-    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+-
+-
+-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+-# -----------------------------------------------------------------
+-m4_define([lt_if_dict_fetch],
+-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+-	[$5],
+-    [$6])])
+-
+-
+-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+-# --------------------------------------------------------------
+-m4_define([lt_dict_filter],
+-[m4_if([$5], [], [],
+-  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+-           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+-		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+-])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/libtool.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/libtool.m4	(revision 13081)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/libtool.m4	(revision 13082)
+@@ -1,7982 +0,0 @@
+-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+-#
+-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+-#                 Foundation, Inc.
+-#   Written by Gordon Matzigkeit, 1996
+-#
+-# This file is free software; the Free Software Foundation gives
+-# unlimited permission to copy and/or distribute it, with or without
+-# modifications, as long as this notice is preserved.
+-
+-m4_define([_LT_COPYING], [dnl
+-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+-#                 Foundation, Inc.
+-#   Written by Gordon Matzigkeit, 1996
+-#
+-#   This file is part of GNU Libtool.
+-#
+-# GNU Libtool 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 2 of
+-# the License, or (at your option) any later version.
+-#
+-# As a special exception to the GNU General Public License,
+-# if you distribute this file as part of a program or library that
+-# is built using GNU Libtool, you may include this file under the
+-# same distribution terms that you use for the rest of that program.
+-#
+-# GNU Libtool 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 GNU Libtool; see the file COPYING.  If not, a copy
+-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+-# obtained by writing to the Free Software Foundation, Inc.,
+-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+-])
+-
+-# serial 57 LT_INIT
+-
+-
+-# LT_PREREQ(VERSION)
+-# ------------------
+-# Complain and exit if this libtool version is less that VERSION.
+-m4_defun([LT_PREREQ],
+-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+-       [m4_default([$3],
+-		   [m4_fatal([Libtool version $1 or higher is required],
+-		             63)])],
+-       [$2])])
+-
+-
+-# _LT_CHECK_BUILDDIR
+-# ------------------
+-# Complain if the absolute build directory name contains unusual characters
+-m4_defun([_LT_CHECK_BUILDDIR],
+-[case `pwd` in
+-  *\ * | *\	*)
+-    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+-esac
+-])
+-
+-
+-# LT_INIT([OPTIONS])
+-# ------------------
+-AC_DEFUN([LT_INIT],
+-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+-AC_BEFORE([$0], [LT_LANG])dnl
+-AC_BEFORE([$0], [LT_OUTPUT])dnl
+-AC_BEFORE([$0], [LTDL_INIT])dnl
+-m4_require([_LT_CHECK_BUILDDIR])dnl
+-
+-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+-dnl unless we require an AC_DEFUNed macro:
+-AC_REQUIRE([LTOPTIONS_VERSION])dnl
+-AC_REQUIRE([LTSUGAR_VERSION])dnl
+-AC_REQUIRE([LTVERSION_VERSION])dnl
+-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+-m4_require([_LT_PROG_LTMAIN])dnl
+-
+-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+-
+-dnl Parse OPTIONS
+-_LT_SET_OPTIONS([$0], [$1])
+-
+-# This can be used to rebuild libtool when needed
+-LIBTOOL_DEPS="$ltmain"
+-
+-# Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+-AC_SUBST(LIBTOOL)dnl
+-
+-_LT_SETUP
+-
+-# Only expand once:
+-m4_define([LT_INIT])
+-])# LT_INIT
+-
+-# Old names:
+-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+-
+-
+-# _LT_CC_BASENAME(CC)
+-# -------------------
+-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+-m4_defun([_LT_CC_BASENAME],
+-[for cc_temp in $1""; do
+-  case $cc_temp in
+-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+-    \-*) ;;
+-    *) break;;
+-  esac
+-done
+-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+-])
+-
+-
+-# _LT_FILEUTILS_DEFAULTS
+-# ----------------------
+-# It is okay to use these file commands and assume they have been set
+-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+-m4_defun([_LT_FILEUTILS_DEFAULTS],
+-[: ${CP="cp -f"}
+-: ${MV="mv -f"}
+-: ${RM="rm -f"}
+-])# _LT_FILEUTILS_DEFAULTS
+-
+-
+-# _LT_SETUP
+-# ---------
+-m4_defun([_LT_SETUP],
+-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+-
+-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+-dnl
+-_LT_DECL([], [host_alias], [0], [The host system])dnl
+-_LT_DECL([], [host], [0])dnl
+-_LT_DECL([], [host_os], [0])dnl
+-dnl
+-_LT_DECL([], [build_alias], [0], [The build system])dnl
+-_LT_DECL([], [build], [0])dnl
+-_LT_DECL([], [build_os], [0])dnl
+-dnl
+-AC_REQUIRE([AC_PROG_CC])dnl
+-AC_REQUIRE([LT_PATH_LD])dnl
+-AC_REQUIRE([LT_PATH_NM])dnl
+-dnl
+-AC_REQUIRE([AC_PROG_LN_S])dnl
+-test -z "$LN_S" && LN_S="ln -s"
+-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+-dnl
+-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+-dnl
+-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+-m4_require([_LT_CMD_RELOAD])dnl
+-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+-m4_require([_LT_WITH_SYSROOT])dnl
+-
+-_LT_CONFIG_LIBTOOL_INIT([
+-# See if we are running on zsh, and set the options which allow our
+-# commands through without removal of \ escapes INIT.
+-if test -n "\${ZSH_VERSION+set}" ; then
+-   setopt NO_GLOB_SUBST
+-fi
+-])
+-if test -n "${ZSH_VERSION+set}" ; then
+-   setopt NO_GLOB_SUBST
+-fi
+-
+-_LT_CHECK_OBJDIR
+-
+-m4_require([_LT_TAG_COMPILER])dnl
+-
+-case $host_os in
+-aix3*)
+-  # AIX sometimes has problems with the GCC collect2 program.  For some
+-  # reason, if we set the COLLECT_NAMES environment variable, the problems
+-  # vanish in a puff of smoke.
+-  if test "X${COLLECT_NAMES+set}" != Xset; then
+-    COLLECT_NAMES=
+-    export COLLECT_NAMES
+-  fi
+-  ;;
+-esac
+-
+-# Global variables:
+-ofile=libtool
+-can_build_shared=yes
+-
+-# All known linkers require a `.a' archive for static linking (except MSVC,
+-# which needs '.lib').
+-libext=a
+-
+-with_gnu_ld="$lt_cv_prog_gnu_ld"
+-
+-old_CC="$CC"
+-old_CFLAGS="$CFLAGS"
+-
+-# Set sane defaults for various variables
+-test -z "$CC" && CC=cc
+-test -z "$LTCC" && LTCC=$CC
+-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+-test -z "$LD" && LD=ld
+-test -z "$ac_objext" && ac_objext=o
+-
+-_LT_CC_BASENAME([$compiler])
+-
+-# Only perform the check for file, if the check method requires it
+-test -z "$MAGIC_CMD" && MAGIC_CMD=file
+-case $deplibs_check_method in
+-file_magic*)
+-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+-    _LT_PATH_MAGIC
+-  fi
+-  ;;
+-esac
+-
+-# Use C for the default configuration in the libtool script
+-LT_SUPPORTED_TAG([CC])
+-_LT_LANG_C_CONFIG
+-_LT_LANG_DEFAULT_CONFIG
+-_LT_CONFIG_COMMANDS
+-])# _LT_SETUP
+-
+-
+-# _LT_PREPARE_SED_QUOTE_VARS
+-# --------------------------
+-# Define a few sed substitution that help us do robust quoting.
+-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+-[# Backslashify metacharacters that are still active within
+-# double-quoted strings.
+-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+-
+-# Same as above, but do not quote variable references.
+-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+-
+-# Sed substitution to delay expansion of an escaped shell variable in a
+-# double_quote_subst'ed string.
+-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+-
+-# Sed substitution to delay expansion of an escaped single quote.
+-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+-
+-# Sed substitution to avoid accidental globbing in evaled expressions
+-no_glob_subst='s/\*/\\\*/g'
+-])
+-
+-# _LT_PROG_LTMAIN
+-# ---------------
+-# Note that this code is called both from `configure', and `config.status'
+-# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+-# `config.status' has no value for ac_aux_dir unless we are using Automake,
+-# so we pass a copy along to make sure it has a sensible value anyway.
+-m4_defun([_LT_PROG_LTMAIN],
+-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+-ltmain="$ac_aux_dir/ltmain.sh"
+-])# _LT_PROG_LTMAIN
+-
+-
+-## ------------------------------------- ##
+-## Accumulate code for creating libtool. ##
+-## ------------------------------------- ##
+-
+-# So that we can recreate a full libtool script including additional
+-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+-# in macros and then make a single call at the end using the `libtool'
+-# label.
+-
+-
+-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+-# ----------------------------------------
+-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+-m4_define([_LT_CONFIG_LIBTOOL_INIT],
+-[m4_ifval([$1],
+-          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+-                     [$1
+-])])])
+-
+-# Initialize.
+-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+-
+-
+-# _LT_CONFIG_LIBTOOL([COMMANDS])
+-# ------------------------------
+-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+-m4_define([_LT_CONFIG_LIBTOOL],
+-[m4_ifval([$1],
+-          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+-                     [$1
+-])])])
+-
+-# Initialize.
+-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+-
+-
+-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+-# -----------------------------------------------------
+-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+-[_LT_CONFIG_LIBTOOL([$1])
+-_LT_CONFIG_LIBTOOL_INIT([$2])
+-])
+-
+-
+-# _LT_FORMAT_COMMENT([COMMENT])
+-# -----------------------------
+-# Add leading comment marks to the start of each line, and a trailing
+-# full-stop to the whole comment if one is not present already.
+-m4_define([_LT_FORMAT_COMMENT],
+-[m4_ifval([$1], [
+-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+-              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+-)])
+-
+-
+-
+-## ------------------------ ##
+-## FIXME: Eliminate VARNAME ##
+-## ------------------------ ##
+-
+-
+-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+-# -------------------------------------------------------------------
+-# CONFIGNAME is the name given to the value in the libtool script.
+-# VARNAME is the (base) name used in the configure script.
+-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+-# VARNAME.  Any other value will be used directly.
+-m4_define([_LT_DECL],
+-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+-    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+-	[m4_ifval([$1], [$1], [$2])])
+-    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+-    m4_ifval([$4],
+-	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+-    lt_dict_add_subkey([lt_decl_dict], [$2],
+-	[tagged?], [m4_ifval([$5], [yes], [no])])])
+-])
+-
+-
+-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+-# --------------------------------------------------------
+-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+-
+-
+-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+-# ------------------------------------------------
+-m4_define([lt_decl_tag_varnames],
+-[_lt_decl_filter([tagged?], [yes], $@)])
+-
+-
+-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+-# ---------------------------------------------------------
+-m4_define([_lt_decl_filter],
+-[m4_case([$#],
+-  [0], [m4_fatal([$0: too few arguments: $#])],
+-  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+-  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+-  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+-  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+-])
+-
+-
+-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+-# --------------------------------------------------
+-m4_define([lt_decl_quote_varnames],
+-[_lt_decl_filter([value], [1], $@)])
+-
+-
+-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+-# ---------------------------------------------------
+-m4_define([lt_decl_dquote_varnames],
+-[_lt_decl_filter([value], [2], $@)])
+-
+-
+-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+-# ---------------------------------------------------
+-m4_define([lt_decl_varnames_tagged],
+-[m4_assert([$# <= 2])dnl
+-_$0(m4_quote(m4_default([$1], [[, ]])),
+-    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+-    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+-m4_define([_lt_decl_varnames_tagged],
+-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+-
+-
+-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+-# ------------------------------------------------
+-m4_define([lt_decl_all_varnames],
+-[_$0(m4_quote(m4_default([$1], [[, ]])),
+-     m4_if([$2], [],
+-	   m4_quote(lt_decl_varnames),
+-	m4_quote(m4_shift($@))))[]dnl
+-])
+-m4_define([_lt_decl_all_varnames],
+-[lt_join($@, lt_decl_varnames_tagged([$1],
+-			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+-])
+-
+-
+-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+-# ------------------------------------
+-# Quote a variable value, and forward it to `config.status' so that its
+-# declaration there will have the same value as in `configure'.  VARNAME
+-# must have a single quote delimited value for this to work.
+-m4_define([_LT_CONFIG_STATUS_DECLARE],
+-[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+-
+-
+-# _LT_CONFIG_STATUS_DECLARATIONS
+-# ------------------------------
+-# We delimit libtool config variables with single quotes, so when
+-# we write them to config.status, we have to be sure to quote all
+-# embedded single quotes properly.  In configure, this macro expands
+-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+-#
+-#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+-    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+-
+-
+-# _LT_LIBTOOL_TAGS
+-# ----------------
+-# Output comment and list of tags supported by the script
+-m4_defun([_LT_LIBTOOL_TAGS],
+-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+-available_tags="_LT_TAGS"dnl
+-])
+-
+-
+-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+-# -----------------------------------
+-# Extract the dictionary values for VARNAME (optionally with TAG) and
+-# expand to a commented shell variable setting:
+-#
+-#    # Some comment about what VAR is for.
+-#    visible_name=$lt_internal_name
+-m4_define([_LT_LIBTOOL_DECLARE],
+-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+-					   [description])))[]dnl
+-m4_pushdef([_libtool_name],
+-    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+-    [0], [_libtool_name=[$]$1],
+-    [1], [_libtool_name=$lt_[]$1],
+-    [2], [_libtool_name=$lt_[]$1],
+-    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+-])
+-
+-
+-# _LT_LIBTOOL_CONFIG_VARS
+-# -----------------------
+-# Produce commented declarations of non-tagged libtool config variables
+-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+-# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+-# section) are produced by _LT_LIBTOOL_TAG_VARS.
+-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+-[m4_foreach([_lt_var],
+-    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+-
+-
+-# _LT_LIBTOOL_TAG_VARS(TAG)
+-# -------------------------
+-m4_define([_LT_LIBTOOL_TAG_VARS],
+-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+-
+-
+-# _LT_TAGVAR(VARNAME, [TAGNAME])
+-# ------------------------------
+-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+-
+-
+-# _LT_CONFIG_COMMANDS
+-# -------------------
+-# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+-# variables for single and double quote escaping we saved from calls
+-# to _LT_DECL, we can put quote escaped variables declarations
+-# into `config.status', and then the shell code to quote escape them in
+-# for loops in `config.status'.  Finally, any additional code accumulated
+-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+-m4_defun([_LT_CONFIG_COMMANDS],
+-[AC_PROVIDE_IFELSE([LT_OUTPUT],
+-	dnl If the libtool generation code has been placed in $CONFIG_LT,
+-	dnl instead of duplicating it all over again into config.status,
+-	dnl then we will have config.status run $CONFIG_LT later, so it
+-	dnl needs to know what name is stored there:
+-        [AC_CONFIG_COMMANDS([libtool],
+-            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+-    dnl If the libtool generation code is destined for config.status,
+-    dnl expand the accumulated commands and init code now:
+-    [AC_CONFIG_COMMANDS([libtool],
+-        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+-])#_LT_CONFIG_COMMANDS
+-
+-
+-# Initialize.
+-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+-[
+-
+-# The HP-UX ksh and POSIX shell print the target directory to stdout
+-# if CDPATH is set.
+-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+-
+-sed_quote_subst='$sed_quote_subst'
+-double_quote_subst='$double_quote_subst'
+-delay_variable_subst='$delay_variable_subst'
+-_LT_CONFIG_STATUS_DECLARATIONS
+-LTCC='$LTCC'
+-LTCFLAGS='$LTCFLAGS'
+-compiler='$compiler_DEFAULT'
+-
+-# A function that is used when there is no print builtin or printf.
+-func_fallback_echo ()
+-{
+-  eval 'cat <<_LTECHO_EOF
+-\$[]1
+-_LTECHO_EOF'
+-}
+-
+-# Quote evaled strings.
+-for var in lt_decl_all_varnames([[ \
+-]], lt_decl_quote_varnames); do
+-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+-    *[[\\\\\\\`\\"\\\$]]*)
+-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+-      ;;
+-    *)
+-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+-      ;;
+-    esac
+-done
+-
+-# Double-quote double-evaled strings.
+-for var in lt_decl_all_varnames([[ \
+-]], lt_decl_dquote_varnames); do
+-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+-    *[[\\\\\\\`\\"\\\$]]*)
+-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+-      ;;
+-    *)
+-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+-      ;;
+-    esac
+-done
+-
+-_LT_OUTPUT_LIBTOOL_INIT
+-])
+-
+-# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+-# ------------------------------------
+-# Generate a child script FILE with all initialization necessary to
+-# reuse the environment learned by the parent script, and make the
+-# file executable.  If COMMENT is supplied, it is inserted after the
+-# `#!' sequence but before initialization text begins.  After this
+-# macro, additional text can be appended to FILE to form the body of
+-# the child script.  The macro ends with non-zero status if the
+-# file could not be fully written (such as if the disk is full).
+-m4_ifdef([AS_INIT_GENERATED],
+-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+-[m4_defun([_LT_GENERATED_FILE_INIT],
+-[m4_require([AS_PREPARE])]dnl
+-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+-[lt_write_fail=0
+-cat >$1 <<_ASEOF || lt_write_fail=1
+-#! $SHELL
+-# Generated by $as_me.
+-$2
+-SHELL=\${CONFIG_SHELL-$SHELL}
+-export SHELL
+-_ASEOF
+-cat >>$1 <<\_ASEOF || lt_write_fail=1
+-AS_SHELL_SANITIZE
+-_AS_PREPARE
+-exec AS_MESSAGE_FD>&1
+-_ASEOF
+-test $lt_write_fail = 0 && chmod +x $1[]dnl
+-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+-
+-# LT_OUTPUT
+-# ---------
+-# This macro allows early generation of the libtool script (before
+-# AC_OUTPUT is called), incase it is used in configure for compilation
+-# tests.
+-AC_DEFUN([LT_OUTPUT],
+-[: ${CONFIG_LT=./config.lt}
+-AC_MSG_NOTICE([creating $CONFIG_LT])
+-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+-[# Run this file to recreate a libtool stub with the current configuration.])
+-
+-cat >>"$CONFIG_LT" <<\_LTEOF
+-lt_cl_silent=false
+-exec AS_MESSAGE_LOG_FD>>config.log
+-{
+-  echo
+-  AS_BOX([Running $as_me.])
+-} >&AS_MESSAGE_LOG_FD
+-
+-lt_cl_help="\
+-\`$as_me' creates a local libtool stub from the current configuration,
+-for use in further configure time tests before the real libtool is
+-generated.
+-
+-Usage: $[0] [[OPTIONS]]
+-
+-  -h, --help      print this help, then exit
+-  -V, --version   print version number, then exit
+-  -q, --quiet     do not print progress messages
+-  -d, --debug     don't remove temporary files
+-
+-Report bugs to <bug-libtool@gnu.org>."
+-
+-lt_cl_version="\
+-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+-configured by $[0], generated by m4_PACKAGE_STRING.
+-
+-Copyright (C) 2011 Free Software Foundation, Inc.
+-This config.lt script is free software; the Free Software Foundation
+-gives unlimited permision to copy, distribute and modify it."
+-
+-while test $[#] != 0
+-do
+-  case $[1] in
+-    --version | --v* | -V )
+-      echo "$lt_cl_version"; exit 0 ;;
+-    --help | --h* | -h )
+-      echo "$lt_cl_help"; exit 0 ;;
+-    --debug | --d* | -d )
+-      debug=: ;;
+-    --quiet | --q* | --silent | --s* | -q )
+-      lt_cl_silent=: ;;
+-
+-    -*) AC_MSG_ERROR([unrecognized option: $[1]
+-Try \`$[0] --help' for more information.]) ;;
+-
+-    *) AC_MSG_ERROR([unrecognized argument: $[1]
+-Try \`$[0] --help' for more information.]) ;;
+-  esac
+-  shift
+-done
+-
+-if $lt_cl_silent; then
+-  exec AS_MESSAGE_FD>/dev/null
+-fi
+-_LTEOF
+-
+-cat >>"$CONFIG_LT" <<_LTEOF
+-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+-_LTEOF
+-
+-cat >>"$CONFIG_LT" <<\_LTEOF
+-AC_MSG_NOTICE([creating $ofile])
+-_LT_OUTPUT_LIBTOOL_COMMANDS
+-AS_EXIT(0)
+-_LTEOF
+-chmod +x "$CONFIG_LT"
+-
+-# configure is writing to config.log, but config.lt does its own redirection,
+-# appending to config.log, which fails on DOS, as config.log is still kept
+-# open by configure.  Here we exec the FD to /dev/null, effectively closing
+-# config.log, so it can be properly (re)opened and appended to by config.lt.
+-lt_cl_success=:
+-test "$silent" = yes &&
+-  lt_config_lt_args="$lt_config_lt_args --quiet"
+-exec AS_MESSAGE_LOG_FD>/dev/null
+-$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+-exec AS_MESSAGE_LOG_FD>>config.log
+-$lt_cl_success || AS_EXIT(1)
+-])# LT_OUTPUT
+-
+-
+-# _LT_CONFIG(TAG)
+-# ---------------
+-# If TAG is the built-in tag, create an initial libtool script with a
+-# default configuration from the untagged config vars.  Otherwise add code
+-# to config.status for appending the configuration named by TAG from the
+-# matching tagged config vars.
+-m4_defun([_LT_CONFIG],
+-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-_LT_CONFIG_SAVE_COMMANDS([
+-  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+-  m4_if(_LT_TAG, [C], [
+-    # See if we are running on zsh, and set the options which allow our
+-    # commands through without removal of \ escapes.
+-    if test -n "${ZSH_VERSION+set}" ; then
+-      setopt NO_GLOB_SUBST
+-    fi
+-
+-    cfgfile="${ofile}T"
+-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+-    $RM "$cfgfile"
+-
+-    cat <<_LT_EOF >> "$cfgfile"
+-#! $SHELL
+-
+-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+-#
+-_LT_COPYING
+-_LT_LIBTOOL_TAGS
+-
+-# ### BEGIN LIBTOOL CONFIG
+-_LT_LIBTOOL_CONFIG_VARS
+-_LT_LIBTOOL_TAG_VARS
+-# ### END LIBTOOL CONFIG
+-
+-_LT_EOF
+-
+-  case $host_os in
+-  aix3*)
+-    cat <<\_LT_EOF >> "$cfgfile"
+-# AIX sometimes has problems with the GCC collect2 program.  For some
+-# reason, if we set the COLLECT_NAMES environment variable, the problems
+-# vanish in a puff of smoke.
+-if test "X${COLLECT_NAMES+set}" != Xset; then
+-  COLLECT_NAMES=
+-  export COLLECT_NAMES
+-fi
+-_LT_EOF
+-    ;;
+-  esac
+-
+-  _LT_PROG_LTMAIN
+-
+-  # We use sed instead of cat because bash on DJGPP gets confused if
+-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+-  # text mode, it properly converts lines to CR/LF.  This bash problem
+-  # is reportedly fixed, but why not run on old versions too?
+-  sed '$q' "$ltmain" >> "$cfgfile" \
+-     || (rm -f "$cfgfile"; exit 1)
+-
+-  _LT_PROG_REPLACE_SHELLFNS
+-
+-   mv -f "$cfgfile" "$ofile" ||
+-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+-  chmod +x "$ofile"
+-],
+-[cat <<_LT_EOF >> "$ofile"
+-
+-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+-dnl in a comment (ie after a #).
+-# ### BEGIN LIBTOOL TAG CONFIG: $1
+-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+-# ### END LIBTOOL TAG CONFIG: $1
+-_LT_EOF
+-])dnl /m4_if
+-],
+-[m4_if([$1], [], [
+-    PACKAGE='$PACKAGE'
+-    VERSION='$VERSION'
+-    TIMESTAMP='$TIMESTAMP'
+-    RM='$RM'
+-    ofile='$ofile'], [])
+-])dnl /_LT_CONFIG_SAVE_COMMANDS
+-])# _LT_CONFIG
+-
+-
+-# LT_SUPPORTED_TAG(TAG)
+-# ---------------------
+-# Trace this macro to discover what tags are supported by the libtool
+-# --tag option, using:
+-#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+-AC_DEFUN([LT_SUPPORTED_TAG], [])
+-
+-
+-# C support is built-in for now
+-m4_define([_LT_LANG_C_enabled], [])
+-m4_define([_LT_TAGS], [])
+-
+-
+-# LT_LANG(LANG)
+-# -------------
+-# Enable libtool support for the given language if not already enabled.
+-AC_DEFUN([LT_LANG],
+-[AC_BEFORE([$0], [LT_OUTPUT])dnl
+-m4_case([$1],
+-  [C],			[_LT_LANG(C)],
+-  [C++],		[_LT_LANG(CXX)],
+-  [Go],			[_LT_LANG(GO)],
+-  [Java],		[_LT_LANG(GCJ)],
+-  [Fortran 77],		[_LT_LANG(F77)],
+-  [Fortran],		[_LT_LANG(FC)],
+-  [Windows Resource],	[_LT_LANG(RC)],
+-  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+-    [_LT_LANG($1)],
+-    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+-])# LT_LANG
+-
+-
+-# _LT_LANG(LANGNAME)
+-# ------------------
+-m4_defun([_LT_LANG],
+-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+-  [LT_SUPPORTED_TAG([$1])dnl
+-  m4_append([_LT_TAGS], [$1 ])dnl
+-  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+-  _LT_LANG_$1_CONFIG($1)])dnl
+-])# _LT_LANG
+-
+-
+-m4_ifndef([AC_PROG_GO], [
+-############################################################
+-# NOTE: This macro has been submitted for inclusion into   #
+-#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
+-#  a released version of Autoconf we should remove this    #
+-#  macro and use it instead.                               #
+-############################################################
+-m4_defun([AC_PROG_GO],
+-[AC_LANG_PUSH(Go)dnl
+-AC_ARG_VAR([GOC],     [Go compiler command])dnl
+-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+-_AC_ARG_VAR_LDFLAGS()dnl
+-AC_CHECK_TOOL(GOC, gccgo)
+-if test -z "$GOC"; then
+-  if test -n "$ac_tool_prefix"; then
+-    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+-  fi
+-fi
+-if test -z "$GOC"; then
+-  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+-fi
+-])#m4_defun
+-])#m4_ifndef
+-
+-
+-# _LT_LANG_DEFAULT_CONFIG
+-# -----------------------
+-m4_defun([_LT_LANG_DEFAULT_CONFIG],
+-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+-  [LT_LANG(CXX)],
+-  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+-
+-AC_PROVIDE_IFELSE([AC_PROG_F77],
+-  [LT_LANG(F77)],
+-  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+-
+-AC_PROVIDE_IFELSE([AC_PROG_FC],
+-  [LT_LANG(FC)],
+-  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+-
+-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+-dnl pulling things in needlessly.
+-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+-  [LT_LANG(GCJ)],
+-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+-    [LT_LANG(GCJ)],
+-    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+-      [LT_LANG(GCJ)],
+-      [m4_ifdef([AC_PROG_GCJ],
+-	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+-       m4_ifdef([A][M_PROG_GCJ],
+-	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+-       m4_ifdef([LT_PROG_GCJ],
+-	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+-
+-AC_PROVIDE_IFELSE([AC_PROG_GO],
+-  [LT_LANG(GO)],
+-  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+-
+-AC_PROVIDE_IFELSE([LT_PROG_RC],
+-  [LT_LANG(RC)],
+-  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+-])# _LT_LANG_DEFAULT_CONFIG
+-
+-# Obsolete macros:
+-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+-
+-
+-# _LT_TAG_COMPILER
+-# ----------------
+-m4_defun([_LT_TAG_COMPILER],
+-[AC_REQUIRE([AC_PROG_CC])dnl
+-
+-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+-
+-# If no C compiler was specified, use CC.
+-LTCC=${LTCC-"$CC"}
+-
+-# If no C compiler flags were specified, use CFLAGS.
+-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+-
+-# Allow CC to be a program name with arguments.
+-compiler=$CC
+-])# _LT_TAG_COMPILER
+-
+-
+-# _LT_COMPILER_BOILERPLATE
+-# ------------------------
+-# Check for compiler boilerplate output or warnings with
+-# the simple compiler test code.
+-m4_defun([_LT_COMPILER_BOILERPLATE],
+-[m4_require([_LT_DECL_SED])dnl
+-ac_outfile=conftest.$ac_objext
+-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+-_lt_compiler_boilerplate=`cat conftest.err`
+-$RM conftest*
+-])# _LT_COMPILER_BOILERPLATE
+-
+-
+-# _LT_LINKER_BOILERPLATE
+-# ----------------------
+-# Check for linker boilerplate output or warnings with
+-# the simple link test code.
+-m4_defun([_LT_LINKER_BOILERPLATE],
+-[m4_require([_LT_DECL_SED])dnl
+-ac_outfile=conftest.$ac_objext
+-echo "$lt_simple_link_test_code" >conftest.$ac_ext
+-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+-_lt_linker_boilerplate=`cat conftest.err`
+-$RM -r conftest*
+-])# _LT_LINKER_BOILERPLATE
+-
+-# _LT_REQUIRED_DARWIN_CHECKS
+-# -------------------------
+-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+-  case $host_os in
+-    rhapsody* | darwin*)
+-    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+-    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+-    AC_CHECK_TOOL([LIPO], [lipo], [:])
+-    AC_CHECK_TOOL([OTOOL], [otool], [:])
+-    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+-    _LT_DECL([], [DSYMUTIL], [1],
+-      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+-    _LT_DECL([], [NMEDIT], [1],
+-      [Tool to change global to local symbols on Mac OS X])
+-    _LT_DECL([], [LIPO], [1],
+-      [Tool to manipulate fat objects and archives on Mac OS X])
+-    _LT_DECL([], [OTOOL], [1],
+-      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+-    _LT_DECL([], [OTOOL64], [1],
+-      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+-
+-    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+-      [lt_cv_apple_cc_single_mod=no
+-      if test -z "${LT_MULTI_MODULE}"; then
+-	# By default we will add the -single_module flag. You can override
+-	# by either setting the environment variable LT_MULTI_MODULE
+-	# non-empty at configure time, or by adding -multi_module to the
+-	# link flags.
+-	rm -rf libconftest.dylib*
+-	echo "int foo(void){return 1;}" > conftest.c
+-	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+-	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+-        _lt_result=$?
+-	# If there is a non-empty error log, and "single_module"
+-	# appears in it, assume the flag caused a linker warning
+-        if test -s conftest.err && $GREP single_module conftest.err; then
+-	  cat conftest.err >&AS_MESSAGE_LOG_FD
+-	# Otherwise, if the output was created with a 0 exit code from
+-	# the compiler, it worked.
+-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+-	  lt_cv_apple_cc_single_mod=yes
+-	else
+-	  cat conftest.err >&AS_MESSAGE_LOG_FD
+-	fi
+-	rm -rf libconftest.dylib*
+-	rm -f conftest.*
+-      fi])
+-
+-    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+-      [lt_cv_ld_exported_symbols_list],
+-      [lt_cv_ld_exported_symbols_list=no
+-      save_LDFLAGS=$LDFLAGS
+-      echo "_main" > conftest.sym
+-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+-      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+-	[lt_cv_ld_exported_symbols_list=yes],
+-	[lt_cv_ld_exported_symbols_list=no])
+-	LDFLAGS="$save_LDFLAGS"
+-    ])
+-
+-    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+-      [lt_cv_ld_force_load=no
+-      cat > conftest.c << _LT_EOF
+-int forced_loaded() { return 2;}
+-_LT_EOF
+-      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+-      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+-      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+-      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+-      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+-      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+-      cat > conftest.c << _LT_EOF
+-int main() { return 0;}
+-_LT_EOF
+-      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+-      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+-      _lt_result=$?
+-      if test -s conftest.err && $GREP force_load conftest.err; then
+-	cat conftest.err >&AS_MESSAGE_LOG_FD
+-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+-	lt_cv_ld_force_load=yes
+-      else
+-	cat conftest.err >&AS_MESSAGE_LOG_FD
+-      fi
+-        rm -f conftest.err libconftest.a conftest conftest.c
+-        rm -rf conftest.dSYM
+-    ])
+-    case $host_os in
+-    rhapsody* | darwin1.[[012]])
+-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+-    darwin1.*)
+-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+-    darwin*) # darwin 5.x on
+-      # if running on 10.5 or later, the deployment target defaults
+-      # to the OS version, if on x86, and 10.4, the deployment
+-      # target defaults to 10.4. Don't you love it?
+-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+-	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+-	10.[[012]]*)
+-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+-	10.*)
+-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+-      esac
+-    ;;
+-  esac
+-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+-      _lt_dar_single_mod='$single_module'
+-    fi
+-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+-    else
+-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+-    fi
+-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+-      _lt_dsymutil='~$DSYMUTIL $lib || :'
+-    else
+-      _lt_dsymutil=
+-    fi
+-    ;;
+-  esac
+-])
+-
+-
+-# _LT_DARWIN_LINKER_FEATURES([TAG])
+-# ---------------------------------
+-# Checks for linker and compiler features on darwin
+-m4_defun([_LT_DARWIN_LINKER_FEATURES],
+-[
+-  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+-  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-  _LT_TAGVAR(hardcode_direct, $1)=no
+-  _LT_TAGVAR(hardcode_automatic, $1)=yes
+-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+-  if test "$lt_cv_ld_force_load" = "yes"; then
+-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+-    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+-                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+-  else
+-    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+-  fi
+-  _LT_TAGVAR(link_all_deplibs, $1)=yes
+-  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+-  case $cc_basename in
+-     ifort*) _lt_dar_can_shared=yes ;;
+-     *) _lt_dar_can_shared=$GCC ;;
+-  esac
+-  if test "$_lt_dar_can_shared" = "yes"; then
+-    output_verbose_link_cmd=func_echo_all
+-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+-    m4_if([$1], [CXX],
+-[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+-    fi
+-],[])
+-  else
+-  _LT_TAGVAR(ld_shlibs, $1)=no
+-  fi
+-])
+-
+-# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+-# ----------------------------------
+-# Links a minimal program and checks the executable
+-# for the system default hardcoded library path. In most cases,
+-# this is /usr/lib:/lib, but when the MPI compilers are used
+-# the location of the communication and MPI libs are included too.
+-# If we don't find anything, use the default library path according
+-# to the aix ld manual.
+-# Store the results from the different compilers for each TAGNAME.
+-# Allow to override them for all tags through lt_cv_aix_libpath.
+-m4_defun([_LT_SYS_MODULE_PATH_AIX],
+-[m4_require([_LT_DECL_SED])dnl
+-if test "${lt_cv_aix_libpath+set}" = set; then
+-  aix_libpath=$lt_cv_aix_libpath
+-else
+-  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+-  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+-  lt_aix_libpath_sed='[
+-      /Import File Strings/,/^$/ {
+-	  /^0/ {
+-	      s/^0  *\([^ ]*\) *$/\1/
+-	      p
+-	  }
+-      }]'
+-  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-  # Check for a 64-bit object if we didn't find anything.
+-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-  fi],[])
+-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+-  fi
+-  ])
+-  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+-fi
+-])# _LT_SYS_MODULE_PATH_AIX
+-
+-
+-# _LT_SHELL_INIT(ARG)
+-# -------------------
+-m4_define([_LT_SHELL_INIT],
+-[m4_divert_text([M4SH-INIT], [$1
+-])])# _LT_SHELL_INIT
+-
+-
+-
+-# _LT_PROG_ECHO_BACKSLASH
+-# -----------------------
+-# Find how we can fake an echo command that does not interpret backslash.
+-# In particular, with Autoconf 2.60 or later we add some code to the start
+-# of the generated configure script which will find a shell with a builtin
+-# printf (which we can use as an echo command).
+-m4_defun([_LT_PROG_ECHO_BACKSLASH],
+-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+-
+-AC_MSG_CHECKING([how to print strings])
+-# Test print first, because it will be a builtin if present.
+-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+-   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+-  ECHO='print -r --'
+-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+-  ECHO='printf %s\n'
+-else
+-  # Use this function as a fallback that always works.
+-  func_fallback_echo ()
+-  {
+-    eval 'cat <<_LTECHO_EOF
+-$[]1
+-_LTECHO_EOF'
+-  }
+-  ECHO='func_fallback_echo'
+-fi
+-
+-# func_echo_all arg...
+-# Invoke $ECHO with all args, space-separated.
+-func_echo_all ()
+-{
+-    $ECHO "$*" 
+-}
+-
+-case "$ECHO" in
+-  printf*) AC_MSG_RESULT([printf]) ;;
+-  print*) AC_MSG_RESULT([print -r]) ;;
+-  *) AC_MSG_RESULT([cat]) ;;
+-esac
+-
+-m4_ifdef([_AS_DETECT_SUGGESTED],
+-[_AS_DETECT_SUGGESTED([
+-  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+-    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+-    PATH=/empty FPATH=/empty; export PATH FPATH
+-    test "X`printf %s $ECHO`" = "X$ECHO" \
+-      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+-
+-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+-])# _LT_PROG_ECHO_BACKSLASH
+-
+-
+-# _LT_WITH_SYSROOT
+-# ----------------
+-AC_DEFUN([_LT_WITH_SYSROOT],
+-[AC_MSG_CHECKING([for sysroot])
+-AC_ARG_WITH([sysroot],
+-[  --with-sysroot[=DIR] Search for dependent libraries within DIR
+-                        (or the compiler's sysroot if not specified).],
+-[], [with_sysroot=no])
+-
+-dnl lt_sysroot will always be passed unquoted.  We quote it here
+-dnl in case the user passed a directory name.
+-lt_sysroot=
+-case ${with_sysroot} in #(
+- yes)
+-   if test "$GCC" = yes; then
+-     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+-   fi
+-   ;; #(
+- /*)
+-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+-   ;; #(
+- no|'')
+-   ;; #(
+- *)
+-   AC_MSG_RESULT([${with_sysroot}])
+-   AC_MSG_ERROR([The sysroot must be an absolute path.])
+-   ;;
+-esac
+-
+- AC_MSG_RESULT([${lt_sysroot:-no}])
+-_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+-[dependent libraries, and in which our libraries should be installed.])])
+-
+-# _LT_ENABLE_LOCK
+-# ---------------
+-m4_defun([_LT_ENABLE_LOCK],
+-[AC_ARG_ENABLE([libtool-lock],
+-  [AS_HELP_STRING([--disable-libtool-lock],
+-    [avoid locking (might break parallel builds)])])
+-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+-
+-# Some flags need to be propagated to the compiler or linker for good
+-# libtool support.
+-case $host in
+-ia64-*-hpux*)
+-  # Find out which ABI we are using.
+-  echo 'int i;' > conftest.$ac_ext
+-  if AC_TRY_EVAL(ac_compile); then
+-    case `/usr/bin/file conftest.$ac_objext` in
+-      *ELF-32*)
+-	HPUX_IA64_MODE="32"
+-	;;
+-      *ELF-64*)
+-	HPUX_IA64_MODE="64"
+-	;;
+-    esac
+-  fi
+-  rm -rf conftest*
+-  ;;
+-*-*-irix6*)
+-  # Find out which ABI we are using.
+-  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+-  if AC_TRY_EVAL(ac_compile); then
+-    if test "$lt_cv_prog_gnu_ld" = yes; then
+-      case `/usr/bin/file conftest.$ac_objext` in
+-	*32-bit*)
+-	  LD="${LD-ld} -melf32bsmip"
+-	  ;;
+-	*N32*)
+-	  LD="${LD-ld} -melf32bmipn32"
+-	  ;;
+-	*64-bit*)
+-	  LD="${LD-ld} -melf64bmip"
+-	;;
+-      esac
+-    else
+-      case `/usr/bin/file conftest.$ac_objext` in
+-	*32-bit*)
+-	  LD="${LD-ld} -32"
+-	  ;;
+-	*N32*)
+-	  LD="${LD-ld} -n32"
+-	  ;;
+-	*64-bit*)
+-	  LD="${LD-ld} -64"
+-	  ;;
+-      esac
+-    fi
+-  fi
+-  rm -rf conftest*
+-  ;;
+-
+-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+-  # Find out which ABI we are using.
+-  echo 'int i;' > conftest.$ac_ext
+-  if AC_TRY_EVAL(ac_compile); then
+-    case `/usr/bin/file conftest.o` in
+-      *32-bit*)
+-	case $host in
+-	  x86_64-*kfreebsd*-gnu)
+-	    LD="${LD-ld} -m elf_i386_fbsd"
+-	    ;;
+-	  x86_64-*linux*)
+-	    LD="${LD-ld} -m elf_i386"
+-	    ;;
+-	  ppc64-*linux*|powerpc64-*linux*)
+-	    LD="${LD-ld} -m elf32ppclinux"
+-	    ;;
+-	  s390x-*linux*)
+-	    LD="${LD-ld} -m elf_s390"
+-	    ;;
+-	  sparc64-*linux*)
+-	    LD="${LD-ld} -m elf32_sparc"
+-	    ;;
+-	esac
+-	;;
+-      *64-bit*)
+-	case $host in
+-	  x86_64-*kfreebsd*-gnu)
+-	    LD="${LD-ld} -m elf_x86_64_fbsd"
+-	    ;;
+-	  x86_64-*linux*)
+-	    LD="${LD-ld} -m elf_x86_64"
+-	    ;;
+-	  ppc*-*linux*|powerpc*-*linux*)
+-	    LD="${LD-ld} -m elf64ppc"
+-	    ;;
+-	  s390*-*linux*|s390*-*tpf*)
+-	    LD="${LD-ld} -m elf64_s390"
+-	    ;;
+-	  sparc*-*linux*)
+-	    LD="${LD-ld} -m elf64_sparc"
+-	    ;;
+-	esac
+-	;;
+-    esac
+-  fi
+-  rm -rf conftest*
+-  ;;
+-
+-*-*-sco3.2v5*)
+-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+-  SAVE_CFLAGS="$CFLAGS"
+-  CFLAGS="$CFLAGS -belf"
+-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+-    [AC_LANG_PUSH(C)
+-     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+-     AC_LANG_POP])
+-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+-    CFLAGS="$SAVE_CFLAGS"
+-  fi
+-  ;;
+-*-*solaris*)
+-  # Find out which ABI we are using.
+-  echo 'int i;' > conftest.$ac_ext
+-  if AC_TRY_EVAL(ac_compile); then
+-    case `/usr/bin/file conftest.o` in
+-    *64-bit*)
+-      case $lt_cv_prog_gnu_ld in
+-      yes*)
+-        case $host in
+-        i?86-*-solaris*)
+-          LD="${LD-ld} -m elf_x86_64"
+-          ;;
+-        sparc*-*-solaris*)
+-          LD="${LD-ld} -m elf64_sparc"
+-          ;;
+-        esac
+-        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+-        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+-          LD="${LD-ld}_sol2"
+-        fi
+-        ;;
+-      *)
+-	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+-	  LD="${LD-ld} -64"
+-	fi
+-	;;
+-      esac
+-      ;;
+-    esac
+-  fi
+-  rm -rf conftest*
+-  ;;
+-esac
+-
+-need_locks="$enable_libtool_lock"
+-])# _LT_ENABLE_LOCK
+-
+-
+-# _LT_PROG_AR
+-# -----------
+-m4_defun([_LT_PROG_AR],
+-[AC_CHECK_TOOLS(AR, [ar], false)
+-: ${AR=ar}
+-: ${AR_FLAGS=cru}
+-_LT_DECL([], [AR], [1], [The archiver])
+-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+-
+-AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+-  [lt_cv_ar_at_file=no
+-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+-     [echo conftest.$ac_objext > conftest.lst
+-      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+-      AC_TRY_EVAL([lt_ar_try])
+-      if test "$ac_status" -eq 0; then
+-	# Ensure the archiver fails upon bogus file names.
+-	rm -f conftest.$ac_objext libconftest.a
+-	AC_TRY_EVAL([lt_ar_try])
+-	if test "$ac_status" -ne 0; then
+-          lt_cv_ar_at_file=@
+-        fi
+-      fi
+-      rm -f conftest.* libconftest.a
+-     ])
+-  ])
+-
+-if test "x$lt_cv_ar_at_file" = xno; then
+-  archiver_list_spec=
+-else
+-  archiver_list_spec=$lt_cv_ar_at_file
+-fi
+-_LT_DECL([], [archiver_list_spec], [1],
+-  [How to feed a file listing to the archiver])
+-])# _LT_PROG_AR
+-
+-
+-# _LT_CMD_OLD_ARCHIVE
+-# -------------------
+-m4_defun([_LT_CMD_OLD_ARCHIVE],
+-[_LT_PROG_AR
+-
+-AC_CHECK_TOOL(STRIP, strip, :)
+-test -z "$STRIP" && STRIP=:
+-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+-
+-AC_CHECK_TOOL(RANLIB, ranlib, :)
+-test -z "$RANLIB" && RANLIB=:
+-_LT_DECL([], [RANLIB], [1],
+-    [Commands used to install an old-style archive])
+-
+-# Determine commands to create old-style static archives.
+-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+-old_postinstall_cmds='chmod 644 $oldlib'
+-old_postuninstall_cmds=
+-
+-if test -n "$RANLIB"; then
+-  case $host_os in
+-  openbsd*)
+-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+-    ;;
+-  *)
+-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+-    ;;
+-  esac
+-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+-fi
+-
+-case $host_os in
+-  darwin*)
+-    lock_old_archive_extraction=yes ;;
+-  *)
+-    lock_old_archive_extraction=no ;;
+-esac
+-_LT_DECL([], [old_postinstall_cmds], [2])
+-_LT_DECL([], [old_postuninstall_cmds], [2])
+-_LT_TAGDECL([], [old_archive_cmds], [2],
+-    [Commands used to build an old-style archive])
+-_LT_DECL([], [lock_old_archive_extraction], [0],
+-    [Whether to use a lock for old archive extraction])
+-])# _LT_CMD_OLD_ARCHIVE
+-
+-
+-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+-#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+-# ----------------------------------------------------------------
+-# Check whether the given compiler option works
+-AC_DEFUN([_LT_COMPILER_OPTION],
+-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-m4_require([_LT_DECL_SED])dnl
+-AC_CACHE_CHECK([$1], [$2],
+-  [$2=no
+-   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+-   lt_compiler_flag="$3"
+-   # Insert the option either (1) after the last *FLAGS variable, or
+-   # (2) before a word containing "conftest.", or (3) at the end.
+-   # Note that $ac_compile itself does not contain backslashes and begins
+-   # with a dollar sign (not a hyphen), so the echo should work correctly.
+-   # The option is referenced via a variable to avoid confusing sed.
+-   lt_compile=`echo "$ac_compile" | $SED \
+-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+-   -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+-   (eval "$lt_compile" 2>conftest.err)
+-   ac_status=$?
+-   cat conftest.err >&AS_MESSAGE_LOG_FD
+-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+-   if (exit $ac_status) && test -s "$ac_outfile"; then
+-     # The compiler can only warn and ignore the option if not recognized
+-     # So say no if there are warnings other than the usual output.
+-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+-       $2=yes
+-     fi
+-   fi
+-   $RM conftest*
+-])
+-
+-if test x"[$]$2" = xyes; then
+-    m4_if([$5], , :, [$5])
+-else
+-    m4_if([$6], , :, [$6])
+-fi
+-])# _LT_COMPILER_OPTION
+-
+-# Old name:
+-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+-
+-
+-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+-#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+-# ----------------------------------------------------
+-# Check whether the given linker option works
+-AC_DEFUN([_LT_LINKER_OPTION],
+-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-m4_require([_LT_DECL_SED])dnl
+-AC_CACHE_CHECK([$1], [$2],
+-  [$2=no
+-   save_LDFLAGS="$LDFLAGS"
+-   LDFLAGS="$LDFLAGS $3"
+-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+-     # The linker can only warn and ignore the option if not recognized
+-     # So say no if there are warnings
+-     if test -s conftest.err; then
+-       # Append any errors to the config.log.
+-       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+-       if diff conftest.exp conftest.er2 >/dev/null; then
+-         $2=yes
+-       fi
+-     else
+-       $2=yes
+-     fi
+-   fi
+-   $RM -r conftest*
+-   LDFLAGS="$save_LDFLAGS"
+-])
+-
+-if test x"[$]$2" = xyes; then
+-    m4_if([$4], , :, [$4])
+-else
+-    m4_if([$5], , :, [$5])
+-fi
+-])# _LT_LINKER_OPTION
+-
+-# Old name:
+-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+-
+-
+-# LT_CMD_MAX_LEN
+-#---------------
+-AC_DEFUN([LT_CMD_MAX_LEN],
+-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-# find the maximum length of command line arguments
+-AC_MSG_CHECKING([the maximum length of command line arguments])
+-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+-  i=0
+-  teststring="ABCD"
+-
+-  case $build_os in
+-  msdosdjgpp*)
+-    # On DJGPP, this test can blow up pretty badly due to problems in libc
+-    # (any single argument exceeding 2000 bytes causes a buffer overrun
+-    # during glob expansion).  Even if it were fixed, the result of this
+-    # check would be larger than it should be.
+-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+-    ;;
+-
+-  gnu*)
+-    # Under GNU Hurd, this test is not required because there is
+-    # no limit to the length of command line arguments.
+-    # Libtool will interpret -1 as no limit whatsoever
+-    lt_cv_sys_max_cmd_len=-1;
+-    ;;
+-
+-  cygwin* | mingw* | cegcc*)
+-    # On Win9x/ME, this test blows up -- it succeeds, but takes
+-    # about 5 minutes as the teststring grows exponentially.
+-    # Worse, since 9x/ME are not pre-emptively multitasking,
+-    # you end up with a "frozen" computer, even though with patience
+-    # the test eventually succeeds (with a max line length of 256k).
+-    # Instead, let's just punt: use the minimum linelength reported by
+-    # all of the supported platforms: 8192 (on NT/2K/XP).
+-    lt_cv_sys_max_cmd_len=8192;
+-    ;;
+-
+-  mint*)
+-    # On MiNT this can take a long time and run out of memory.
+-    lt_cv_sys_max_cmd_len=8192;
+-    ;;
+-
+-  amigaos*)
+-    # On AmigaOS with pdksh, this test takes hours, literally.
+-    # So we just punt and use a minimum line length of 8192.
+-    lt_cv_sys_max_cmd_len=8192;
+-    ;;
+-
+-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+-    # This has been around since 386BSD, at least.  Likely further.
+-    if test -x /sbin/sysctl; then
+-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+-    elif test -x /usr/sbin/sysctl; then
+-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+-    else
+-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+-    fi
+-    # And add a safety zone
+-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+-    ;;
+-
+-  interix*)
+-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+-    lt_cv_sys_max_cmd_len=196608
+-    ;;
+-
+-  os2*)
+-    # The test takes a long time on OS/2.
+-    lt_cv_sys_max_cmd_len=8192
+-    ;;
+-
+-  osf*)
+-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+-    # nice to cause kernel panics so lets avoid the loop below.
+-    # First set a reasonable default.
+-    lt_cv_sys_max_cmd_len=16384
+-    #
+-    if test -x /sbin/sysconfig; then
+-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+-      esac
+-    fi
+-    ;;
+-  sco3.2v5*)
+-    lt_cv_sys_max_cmd_len=102400
+-    ;;
+-  sysv5* | sco5v6* | sysv4.2uw2*)
+-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+-    if test -n "$kargmax"; then
+-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
+-    else
+-      lt_cv_sys_max_cmd_len=32768
+-    fi
+-    ;;
+-  *)
+-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+-    if test -n "$lt_cv_sys_max_cmd_len"; then
+-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+-    else
+-      # Make teststring a little bigger before we do anything with it.
+-      # a 1K string should be a reasonable start.
+-      for i in 1 2 3 4 5 6 7 8 ; do
+-        teststring=$teststring$teststring
+-      done
+-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+-      # If test is not a shell built-in, we'll probably end up computing a
+-      # maximum length that is only half of the actual maximum length, but
+-      # we can't tell.
+-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+-	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+-	      test $i != 17 # 1/2 MB should be enough
+-      do
+-        i=`expr $i + 1`
+-        teststring=$teststring$teststring
+-      done
+-      # Only check the string length outside the loop.
+-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+-      teststring=
+-      # Add a significant safety factor because C++ compilers can tack on
+-      # massive amounts of additional arguments before passing them to the
+-      # linker.  It appears as though 1/2 is a usable value.
+-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+-    fi
+-    ;;
+-  esac
+-])
+-if test -n $lt_cv_sys_max_cmd_len ; then
+-  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+-else
+-  AC_MSG_RESULT(none)
+-fi
+-max_cmd_len=$lt_cv_sys_max_cmd_len
+-_LT_DECL([], [max_cmd_len], [0],
+-    [What is the maximum length of a command?])
+-])# LT_CMD_MAX_LEN
+-
+-# Old name:
+-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+-
+-
+-# _LT_HEADER_DLFCN
+-# ----------------
+-m4_defun([_LT_HEADER_DLFCN],
+-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+-])# _LT_HEADER_DLFCN
+-
+-
+-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+-#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+-# ----------------------------------------------------------------
+-m4_defun([_LT_TRY_DLOPEN_SELF],
+-[m4_require([_LT_HEADER_DLFCN])dnl
+-if test "$cross_compiling" = yes; then :
+-  [$4]
+-else
+-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+-  lt_status=$lt_dlunknown
+-  cat > conftest.$ac_ext <<_LT_EOF
+-[#line $LINENO "configure"
+-#include "confdefs.h"
+-
+-#if HAVE_DLFCN_H
+-#include <dlfcn.h>
+-#endif
+-
+-#include <stdio.h>
+-
+-#ifdef RTLD_GLOBAL
+-#  define LT_DLGLOBAL		RTLD_GLOBAL
+-#else
+-#  ifdef DL_GLOBAL
+-#    define LT_DLGLOBAL		DL_GLOBAL
+-#  else
+-#    define LT_DLGLOBAL		0
+-#  endif
+-#endif
+-
+-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+-   find out it does not work in some platform. */
+-#ifndef LT_DLLAZY_OR_NOW
+-#  ifdef RTLD_LAZY
+-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+-#  else
+-#    ifdef DL_LAZY
+-#      define LT_DLLAZY_OR_NOW		DL_LAZY
+-#    else
+-#      ifdef RTLD_NOW
+-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+-#      else
+-#        ifdef DL_NOW
+-#          define LT_DLLAZY_OR_NOW	DL_NOW
+-#        else
+-#          define LT_DLLAZY_OR_NOW	0
+-#        endif
+-#      endif
+-#    endif
+-#  endif
+-#endif
+-
+-/* When -fvisbility=hidden is used, assume the code has been annotated
+-   correspondingly for the symbols needed.  */
+-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-int fnord () __attribute__((visibility("default")));
+-#endif
+-
+-int fnord () { return 42; }
+-int main ()
+-{
+-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+-  int status = $lt_dlunknown;
+-
+-  if (self)
+-    {
+-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+-      else
+-        {
+-	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+-          else puts (dlerror ());
+-	}
+-      /* dlclose (self); */
+-    }
+-  else
+-    puts (dlerror ());
+-
+-  return status;
+-}]
+-_LT_EOF
+-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+-    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+-    lt_status=$?
+-    case x$lt_status in
+-      x$lt_dlno_uscore) $1 ;;
+-      x$lt_dlneed_uscore) $2 ;;
+-      x$lt_dlunknown|x*) $3 ;;
+-    esac
+-  else :
+-    # compilation failed
+-    $3
+-  fi
+-fi
+-rm -fr conftest*
+-])# _LT_TRY_DLOPEN_SELF
+-
+-
+-# LT_SYS_DLOPEN_SELF
+-# ------------------
+-AC_DEFUN([LT_SYS_DLOPEN_SELF],
+-[m4_require([_LT_HEADER_DLFCN])dnl
+-if test "x$enable_dlopen" != xyes; then
+-  enable_dlopen=unknown
+-  enable_dlopen_self=unknown
+-  enable_dlopen_self_static=unknown
+-else
+-  lt_cv_dlopen=no
+-  lt_cv_dlopen_libs=
+-
+-  case $host_os in
+-  beos*)
+-    lt_cv_dlopen="load_add_on"
+-    lt_cv_dlopen_libs=
+-    lt_cv_dlopen_self=yes
+-    ;;
+-
+-  mingw* | pw32* | cegcc*)
+-    lt_cv_dlopen="LoadLibrary"
+-    lt_cv_dlopen_libs=
+-    ;;
+-
+-  cygwin*)
+-    lt_cv_dlopen="dlopen"
+-    lt_cv_dlopen_libs=
+-    ;;
+-
+-  darwin*)
+-  # if libdl is installed we need to link against it
+-    AC_CHECK_LIB([dl], [dlopen],
+-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+-    lt_cv_dlopen="dyld"
+-    lt_cv_dlopen_libs=
+-    lt_cv_dlopen_self=yes
+-    ])
+-    ;;
+-
+-  *)
+-    AC_CHECK_FUNC([shl_load],
+-	  [lt_cv_dlopen="shl_load"],
+-      [AC_CHECK_LIB([dld], [shl_load],
+-	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+-	[AC_CHECK_FUNC([dlopen],
+-	      [lt_cv_dlopen="dlopen"],
+-	  [AC_CHECK_LIB([dl], [dlopen],
+-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+-	    [AC_CHECK_LIB([svld], [dlopen],
+-		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+-	      [AC_CHECK_LIB([dld], [dld_link],
+-		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+-	      ])
+-	    ])
+-	  ])
+-	])
+-      ])
+-    ;;
+-  esac
+-
+-  if test "x$lt_cv_dlopen" != xno; then
+-    enable_dlopen=yes
+-  else
+-    enable_dlopen=no
+-  fi
+-
+-  case $lt_cv_dlopen in
+-  dlopen)
+-    save_CPPFLAGS="$CPPFLAGS"
+-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+-
+-    save_LDFLAGS="$LDFLAGS"
+-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+-
+-    save_LIBS="$LIBS"
+-    LIBS="$lt_cv_dlopen_libs $LIBS"
+-
+-    AC_CACHE_CHECK([whether a program can dlopen itself],
+-	  lt_cv_dlopen_self, [dnl
+-	  _LT_TRY_DLOPEN_SELF(
+-	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+-	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+-    ])
+-
+-    if test "x$lt_cv_dlopen_self" = xyes; then
+-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+-	  lt_cv_dlopen_self_static, [dnl
+-	  _LT_TRY_DLOPEN_SELF(
+-	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+-	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+-      ])
+-    fi
+-
+-    CPPFLAGS="$save_CPPFLAGS"
+-    LDFLAGS="$save_LDFLAGS"
+-    LIBS="$save_LIBS"
+-    ;;
+-  esac
+-
+-  case $lt_cv_dlopen_self in
+-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+-  *) enable_dlopen_self=unknown ;;
+-  esac
+-
+-  case $lt_cv_dlopen_self_static in
+-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+-  *) enable_dlopen_self_static=unknown ;;
+-  esac
+-fi
+-_LT_DECL([dlopen_support], [enable_dlopen], [0],
+-	 [Whether dlopen is supported])
+-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+-	 [Whether dlopen of programs is supported])
+-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+-	 [Whether dlopen of statically linked programs is supported])
+-])# LT_SYS_DLOPEN_SELF
+-
+-# Old name:
+-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+-
+-
+-# _LT_COMPILER_C_O([TAGNAME])
+-# ---------------------------
+-# Check to see if options -c and -o are simultaneously supported by compiler.
+-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+-m4_defun([_LT_COMPILER_C_O],
+-[m4_require([_LT_DECL_SED])dnl
+-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-m4_require([_LT_TAG_COMPILER])dnl
+-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+-   $RM -r conftest 2>/dev/null
+-   mkdir conftest
+-   cd conftest
+-   mkdir out
+-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+-
+-   lt_compiler_flag="-o out/conftest2.$ac_objext"
+-   # Insert the option either (1) after the last *FLAGS variable, or
+-   # (2) before a word containing "conftest.", or (3) at the end.
+-   # Note that $ac_compile itself does not contain backslashes and begins
+-   # with a dollar sign (not a hyphen), so the echo should work correctly.
+-   lt_compile=`echo "$ac_compile" | $SED \
+-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+-   -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+-   (eval "$lt_compile" 2>out/conftest.err)
+-   ac_status=$?
+-   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+-   then
+-     # The compiler can only warn and ignore the option if not recognized
+-     # So say no if there are warnings
+-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+-       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+-     fi
+-   fi
+-   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+-   $RM conftest*
+-   # SGI C++ compiler will create directory out/ii_files/ for
+-   # template instantiation
+-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+-   $RM out/* && rmdir out
+-   cd ..
+-   $RM -r conftest
+-   $RM conftest*
+-])
+-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+-	[Does compiler simultaneously support -c and -o options?])
+-])# _LT_COMPILER_C_O
+-
+-
+-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+-# ----------------------------------
+-# Check to see if we can do hard links to lock some files if needed
+-m4_defun([_LT_COMPILER_FILE_LOCKS],
+-[m4_require([_LT_ENABLE_LOCK])dnl
+-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-_LT_COMPILER_C_O([$1])
+-
+-hard_links="nottested"
+-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+-  # do not overwrite the value of need_locks provided by the user
+-  AC_MSG_CHECKING([if we can lock with hard links])
+-  hard_links=yes
+-  $RM conftest*
+-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+-  touch conftest.a
+-  ln conftest.a conftest.b 2>&5 || hard_links=no
+-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+-  AC_MSG_RESULT([$hard_links])
+-  if test "$hard_links" = no; then
+-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+-    need_locks=warn
+-  fi
+-else
+-  need_locks=no
+-fi
+-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+-])# _LT_COMPILER_FILE_LOCKS
+-
+-
+-# _LT_CHECK_OBJDIR
+-# ----------------
+-m4_defun([_LT_CHECK_OBJDIR],
+-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+-[rm -f .libs 2>/dev/null
+-mkdir .libs 2>/dev/null
+-if test -d .libs; then
+-  lt_cv_objdir=.libs
+-else
+-  # MS-DOS does not allow filenames that begin with a dot.
+-  lt_cv_objdir=_libs
+-fi
+-rmdir .libs 2>/dev/null])
+-objdir=$lt_cv_objdir
+-_LT_DECL([], [objdir], [0],
+-         [The name of the directory that contains temporary libtool files])dnl
+-m4_pattern_allow([LT_OBJDIR])dnl
+-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+-  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+-])# _LT_CHECK_OBJDIR
+-
+-
+-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+-# --------------------------------------
+-# Check hardcoding attributes.
+-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+-[AC_MSG_CHECKING([how to hardcode library paths into programs])
+-_LT_TAGVAR(hardcode_action, $1)=
+-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+-   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+-   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+-
+-  # We can hardcode non-existent directories.
+-  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+-     # have to relink, otherwise we might link with an installed library
+-     # when we should be linking with a yet-to-be-installed one
+-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+-     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+-    # Linking always hardcodes the temporary library directory.
+-    _LT_TAGVAR(hardcode_action, $1)=relink
+-  else
+-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+-    _LT_TAGVAR(hardcode_action, $1)=immediate
+-  fi
+-else
+-  # We cannot hardcode anything, or else we can only hardcode existing
+-  # directories.
+-  _LT_TAGVAR(hardcode_action, $1)=unsupported
+-fi
+-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+-
+-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+-   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+-  # Fast installation is not supported
+-  enable_fast_install=no
+-elif test "$shlibpath_overrides_runpath" = yes ||
+-     test "$enable_shared" = no; then
+-  # Fast installation is not necessary
+-  enable_fast_install=needless
+-fi
+-_LT_TAGDECL([], [hardcode_action], [0],
+-    [How to hardcode a shared library path into an executable])
+-])# _LT_LINKER_HARDCODE_LIBPATH
+-
+-
+-# _LT_CMD_STRIPLIB
+-# ----------------
+-m4_defun([_LT_CMD_STRIPLIB],
+-[m4_require([_LT_DECL_EGREP])
+-striplib=
+-old_striplib=
+-AC_MSG_CHECKING([whether stripping libraries is possible])
+-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+-  AC_MSG_RESULT([yes])
+-else
+-# FIXME - insert some real tests, host_os isn't really good enough
+-  case $host_os in
+-  darwin*)
+-    if test -n "$STRIP" ; then
+-      striplib="$STRIP -x"
+-      old_striplib="$STRIP -S"
+-      AC_MSG_RESULT([yes])
+-    else
+-      AC_MSG_RESULT([no])
+-    fi
+-    ;;
+-  *)
+-    AC_MSG_RESULT([no])
+-    ;;
+-  esac
+-fi
+-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+-_LT_DECL([], [striplib], [1])
+-])# _LT_CMD_STRIPLIB
+-
+-
+-# _LT_SYS_DYNAMIC_LINKER([TAG])
+-# -----------------------------
+-# PORTME Fill in your ld.so characteristics
+-m4_defun([_LT_SYS_DYNAMIC_LINKER],
+-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-m4_require([_LT_DECL_EGREP])dnl
+-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-m4_require([_LT_DECL_OBJDUMP])dnl
+-m4_require([_LT_DECL_SED])dnl
+-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+-AC_MSG_CHECKING([dynamic linker characteristics])
+-m4_if([$1],
+-	[], [
+-if test "$GCC" = yes; then
+-  case $host_os in
+-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+-    *) lt_awk_arg="/^libraries:/" ;;
+-  esac
+-  case $host_os in
+-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+-    *) lt_sed_strip_eq="s,=/,/,g" ;;
+-  esac
+-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+-  case $lt_search_path_spec in
+-  *\;*)
+-    # if the path contains ";" then we assume it to be the separator
+-    # otherwise default to the standard path separator (i.e. ":") - it is
+-    # assumed that no part of a normal pathname contains ";" but that should
+-    # okay in the real world where ";" in dirpaths is itself problematic.
+-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+-    ;;
+-  *)
+-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+-    ;;
+-  esac
+-  # Ok, now we have the path, separated by spaces, we can step through it
+-  # and add multilib dir if necessary.
+-  lt_tmp_lt_search_path_spec=
+-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+-  for lt_sys_path in $lt_search_path_spec; do
+-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+-    else
+-      test -d "$lt_sys_path" && \
+-	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+-    fi
+-  done
+-  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+-BEGIN {RS=" "; FS="/|\n";} {
+-  lt_foo="";
+-  lt_count=0;
+-  for (lt_i = NF; lt_i > 0; lt_i--) {
+-    if ($lt_i != "" && $lt_i != ".") {
+-      if ($lt_i == "..") {
+-        lt_count++;
+-      } else {
+-        if (lt_count == 0) {
+-          lt_foo="/" $lt_i lt_foo;
+-        } else {
+-          lt_count--;
+-        }
+-      }
+-    }
+-  }
+-  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+-  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+-}'`
+-  # AWK program above erroneously prepends '/' to C:/dos/paths
+-  # for these hosts.
+-  case $host_os in
+-    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+-      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+-  esac
+-  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+-else
+-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+-fi])
+-library_names_spec=
+-libname_spec='lib$name'
+-soname_spec=
+-shrext_cmds=".so"
+-postinstall_cmds=
+-postuninstall_cmds=
+-finish_cmds=
+-finish_eval=
+-shlibpath_var=
+-shlibpath_overrides_runpath=unknown
+-version_type=none
+-dynamic_linker="$host_os ld.so"
+-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+-need_lib_prefix=unknown
+-hardcode_into_libs=no
+-
+-# when you set need_version to no, make sure it does not cause -set_version
+-# flags to be left without arguments
+-need_version=unknown
+-
+-case $host_os in
+-aix3*)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+-  shlibpath_var=LIBPATH
+-
+-  # AIX 3 has no versioning support, so we append a major version to the name.
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  ;;
+-
+-aix[[4-9]]*)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  need_lib_prefix=no
+-  need_version=no
+-  hardcode_into_libs=yes
+-  if test "$host_cpu" = ia64; then
+-    # AIX 5 supports IA64
+-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+-    shlibpath_var=LD_LIBRARY_PATH
+-  else
+-    # With GCC up to 2.95.x, collect2 would create an import file
+-    # for dependence libraries.  The import file would start with
+-    # the line `#! .'.  This would cause the generated library to
+-    # depend on `.', always an invalid library.  This was fixed in
+-    # development snapshots of GCC prior to 3.0.
+-    case $host_os in
+-      aix4 | aix4.[[01]] | aix4.[[01]].*)
+-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+-	   echo ' yes '
+-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+-	:
+-      else
+-	can_build_shared=no
+-      fi
+-      ;;
+-    esac
+-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+-    # soname into executable. Probably we can add versioning support to
+-    # collect2, so additional links can be useful in future.
+-    if test "$aix_use_runtimelinking" = yes; then
+-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+-      # instead of lib<name>.a to let people know that these are not
+-      # typical AIX shared libraries.
+-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-    else
+-      # We preserve .a as extension for shared libraries through AIX4.2
+-      # and later when we are not doing run time linking.
+-      library_names_spec='${libname}${release}.a $libname.a'
+-      soname_spec='${libname}${release}${shared_ext}$major'
+-    fi
+-    shlibpath_var=LIBPATH
+-  fi
+-  ;;
+-
+-amigaos*)
+-  case $host_cpu in
+-  powerpc)
+-    # Since July 2007 AmigaOS4 officially supports .so libraries.
+-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-    ;;
+-  m68k)
+-    library_names_spec='$libname.ixlibrary $libname.a'
+-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+-    ;;
+-  esac
+-  ;;
+-
+-beos*)
+-  library_names_spec='${libname}${shared_ext}'
+-  dynamic_linker="$host_os ld.so"
+-  shlibpath_var=LIBRARY_PATH
+-  ;;
+-
+-bsdi[[45]]*)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+-  # the default ld.so.conf also contains /usr/contrib/lib and
+-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+-  # libtool to hard-code these into programs
+-  ;;
+-
+-cygwin* | mingw* | pw32* | cegcc*)
+-  version_type=windows
+-  shrext_cmds=".dll"
+-  need_version=no
+-  need_lib_prefix=no
+-
+-  case $GCC,$cc_basename in
+-  yes,*)
+-    # gcc
+-    library_names_spec='$libname.dll.a'
+-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+-    postinstall_cmds='base_file=`basename \${file}`~
+-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+-      dldir=$destdir/`dirname \$dlpath`~
+-      test -d \$dldir || mkdir -p \$dldir~
+-      $install_prog $dir/$dlname \$dldir/$dlname~
+-      chmod a+x \$dldir/$dlname~
+-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+-      fi'
+-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+-      dlpath=$dir/\$dldll~
+-       $RM \$dlpath'
+-    shlibpath_overrides_runpath=yes
+-
+-    case $host_os in
+-    cygwin*)
+-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+-m4_if([$1], [],[
+-      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+-      ;;
+-    mingw* | cegcc*)
+-      # MinGW DLLs use traditional 'lib' prefix
+-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+-      ;;
+-    pw32*)
+-      # pw32 DLLs use 'pw' prefix rather than 'lib'
+-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+-      ;;
+-    esac
+-    dynamic_linker='Win32 ld.exe'
+-    ;;
+-
+-  *,cl*)
+-    # Native MSVC
+-    libname_spec='$name'
+-    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+-    library_names_spec='${libname}.dll.lib'
+-
+-    case $build_os in
+-    mingw*)
+-      sys_lib_search_path_spec=
+-      lt_save_ifs=$IFS
+-      IFS=';'
+-      for lt_path in $LIB
+-      do
+-        IFS=$lt_save_ifs
+-        # Let DOS variable expansion print the short 8.3 style file name.
+-        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+-        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+-      done
+-      IFS=$lt_save_ifs
+-      # Convert to MSYS style.
+-      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+-      ;;
+-    cygwin*)
+-      # Convert to unix form, then to dos form, then back to unix form
+-      # but this time dos style (no spaces!) so that the unix form looks
+-      # like /cygdrive/c/PROGRA~1:/cygdr...
+-      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+-      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+-      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+-      ;;
+-    *)
+-      sys_lib_search_path_spec="$LIB"
+-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+-        # It is most probably a Windows format PATH.
+-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+-      else
+-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+-      fi
+-      # FIXME: find the short name or the path components, as spaces are
+-      # common. (e.g. "Program Files" -> "PROGRA~1")
+-      ;;
+-    esac
+-
+-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+-    postinstall_cmds='base_file=`basename \${file}`~
+-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+-      dldir=$destdir/`dirname \$dlpath`~
+-      test -d \$dldir || mkdir -p \$dldir~
+-      $install_prog $dir/$dlname \$dldir/$dlname'
+-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+-      dlpath=$dir/\$dldll~
+-       $RM \$dlpath'
+-    shlibpath_overrides_runpath=yes
+-    dynamic_linker='Win32 link.exe'
+-    ;;
+-
+-  *)
+-    # Assume MSVC wrapper
+-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+-    dynamic_linker='Win32 ld.exe'
+-    ;;
+-  esac
+-  # FIXME: first we should search . and the directory the executable is in
+-  shlibpath_var=PATH
+-  ;;
+-
+-darwin* | rhapsody*)
+-  dynamic_linker="$host_os dyld"
+-  version_type=darwin
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+-  soname_spec='${libname}${release}${major}$shared_ext'
+-  shlibpath_overrides_runpath=yes
+-  shlibpath_var=DYLD_LIBRARY_PATH
+-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+-m4_if([$1], [],[
+-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+-  ;;
+-
+-dgux*)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  ;;
+-
+-freebsd* | dragonfly*)
+-  # DragonFly does not have aout.  When/if they implement a new
+-  # versioning mechanism, adjust this.
+-  if test -x /usr/bin/objformat; then
+-    objformat=`/usr/bin/objformat`
+-  else
+-    case $host_os in
+-    freebsd[[23]].*) objformat=aout ;;
+-    *) objformat=elf ;;
+-    esac
+-  fi
+-  version_type=freebsd-$objformat
+-  case $version_type in
+-    freebsd-elf*)
+-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+-      need_version=no
+-      need_lib_prefix=no
+-      ;;
+-    freebsd-*)
+-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+-      need_version=yes
+-      ;;
+-  esac
+-  shlibpath_var=LD_LIBRARY_PATH
+-  case $host_os in
+-  freebsd2.*)
+-    shlibpath_overrides_runpath=yes
+-    ;;
+-  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+-    shlibpath_overrides_runpath=yes
+-    hardcode_into_libs=yes
+-    ;;
+-  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+-  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+-    shlibpath_overrides_runpath=no
+-    hardcode_into_libs=yes
+-    ;;
+-  *) # from 4.6 on, and DragonFly
+-    shlibpath_overrides_runpath=yes
+-    hardcode_into_libs=yes
+-    ;;
+-  esac
+-  ;;
+-
+-gnu*)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=no
+-  hardcode_into_libs=yes
+-  ;;
+-
+-haiku*)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  need_lib_prefix=no
+-  need_version=no
+-  dynamic_linker="$host_os runtime_loader"
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  shlibpath_var=LIBRARY_PATH
+-  shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+-  hardcode_into_libs=yes
+-  ;;
+-
+-hpux9* | hpux10* | hpux11*)
+-  # Give a soname corresponding to the major version so that dld.sl refuses to
+-  # link against other versions.
+-  version_type=sunos
+-  need_lib_prefix=no
+-  need_version=no
+-  case $host_cpu in
+-  ia64*)
+-    shrext_cmds='.so'
+-    hardcode_into_libs=yes
+-    dynamic_linker="$host_os dld.so"
+-    shlibpath_var=LD_LIBRARY_PATH
+-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-    soname_spec='${libname}${release}${shared_ext}$major'
+-    if test "X$HPUX_IA64_MODE" = X32; then
+-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+-    else
+-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+-    fi
+-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+-    ;;
+-  hppa*64*)
+-    shrext_cmds='.sl'
+-    hardcode_into_libs=yes
+-    dynamic_linker="$host_os dld.sl"
+-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-    soname_spec='${libname}${release}${shared_ext}$major'
+-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+-    ;;
+-  *)
+-    shrext_cmds='.sl'
+-    dynamic_linker="$host_os dld.sl"
+-    shlibpath_var=SHLIB_PATH
+-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-    soname_spec='${libname}${release}${shared_ext}$major'
+-    ;;
+-  esac
+-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+-  postinstall_cmds='chmod 555 $lib'
+-  # or fails outright, so override atomically:
+-  install_override_mode=555
+-  ;;
+-
+-interix[[3-9]]*)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=no
+-  hardcode_into_libs=yes
+-  ;;
+-
+-irix5* | irix6* | nonstopux*)
+-  case $host_os in
+-    nonstopux*) version_type=nonstopux ;;
+-    *)
+-	if test "$lt_cv_prog_gnu_ld" = yes; then
+-		version_type=linux # correct to gnu/linux during the next big refactor
+-	else
+-		version_type=irix
+-	fi ;;
+-  esac
+-  need_lib_prefix=no
+-  need_version=no
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+-  case $host_os in
+-  irix5* | nonstopux*)
+-    libsuff= shlibsuff=
+-    ;;
+-  *)
+-    case $LD in # libtool.m4 will add one of these switches to LD
+-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+-      libsuff= shlibsuff= libmagic=32-bit;;
+-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+-      libsuff=32 shlibsuff=N32 libmagic=N32;;
+-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+-    *) libsuff= shlibsuff= libmagic=never-match;;
+-    esac
+-    ;;
+-  esac
+-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+-  shlibpath_overrides_runpath=no
+-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+-  hardcode_into_libs=yes
+-  ;;
+-
+-# No shared lib support for Linux oldld, aout, or coff.
+-linux*oldld* | linux*aout* | linux*coff*)
+-  dynamic_linker=no
+-  ;;
+-
+-# This must be glibc/ELF.
+-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=no
+-
+-  # Some binutils ld are patched to set DT_RUNPATH
+-  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+-    [lt_cv_shlibpath_overrides_runpath=no
+-    save_LDFLAGS=$LDFLAGS
+-    save_libdir=$libdir
+-    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+-	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+-    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+-      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+-	 [lt_cv_shlibpath_overrides_runpath=yes])])
+-    LDFLAGS=$save_LDFLAGS
+-    libdir=$save_libdir
+-    ])
+-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+-
+-  # This implies no fast_install, which is unacceptable.
+-  # Some rework will be needed to allow for fast_install
+-  # before this can be enabled.
+-  hardcode_into_libs=yes
+-
+-  # Append ld.so.conf contents to the search path
+-  if test -f /etc/ld.so.conf; then
+-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+-  fi
+-
+-  # We used to test for /lib/ld.so.1 and disable shared libraries on
+-  # powerpc, because MkLinux only supported shared libraries with the
+-  # GNU dynamic linker.  Since this was broken with cross compilers,
+-  # most powerpc-linux boxes support dynamic linking these days and
+-  # people can always --disable-shared, the test was removed, and we
+-  # assume the GNU/Linux dynamic linker is in use.
+-  dynamic_linker='GNU/Linux ld.so'
+-  ;;
+-
+-netbsd*)
+-  version_type=sunos
+-  need_lib_prefix=no
+-  need_version=no
+-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+-    dynamic_linker='NetBSD (a.out) ld.so'
+-  else
+-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+-    soname_spec='${libname}${release}${shared_ext}$major'
+-    dynamic_linker='NetBSD ld.elf_so'
+-  fi
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=yes
+-  hardcode_into_libs=yes
+-  ;;
+-
+-newsos6)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=yes
+-  ;;
+-
+-*nto* | *qnx*)
+-  version_type=qnx
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=no
+-  hardcode_into_libs=yes
+-  dynamic_linker='ldqnx.so'
+-  ;;
+-
+-openbsd*)
+-  version_type=sunos
+-  sys_lib_dlsearch_path_spec="/usr/lib"
+-  need_lib_prefix=no
+-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+-  case $host_os in
+-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+-    *)				need_version=no  ;;
+-  esac
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+-    case $host_os in
+-      openbsd2.[[89]] | openbsd2.[[89]].*)
+-	shlibpath_overrides_runpath=no
+-	;;
+-      *)
+-	shlibpath_overrides_runpath=yes
+-	;;
+-      esac
+-  else
+-    shlibpath_overrides_runpath=yes
+-  fi
+-  ;;
+-
+-os2*)
+-  libname_spec='$name'
+-  shrext_cmds=".dll"
+-  need_lib_prefix=no
+-  library_names_spec='$libname${shared_ext} $libname.a'
+-  dynamic_linker='OS/2 ld.exe'
+-  shlibpath_var=LIBPATH
+-  ;;
+-
+-osf3* | osf4* | osf5*)
+-  version_type=osf
+-  need_lib_prefix=no
+-  need_version=no
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+-  ;;
+-
+-rdos*)
+-  dynamic_linker=no
+-  ;;
+-
+-solaris*)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=yes
+-  hardcode_into_libs=yes
+-  # ldd complains unless libraries are executable
+-  postinstall_cmds='chmod +x $lib'
+-  ;;
+-
+-sunos4*)
+-  version_type=sunos
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=yes
+-  if test "$with_gnu_ld" = yes; then
+-    need_lib_prefix=no
+-  fi
+-  need_version=yes
+-  ;;
+-
+-sysv4 | sysv4.3*)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  case $host_vendor in
+-    sni)
+-      shlibpath_overrides_runpath=no
+-      need_lib_prefix=no
+-      runpath_var=LD_RUN_PATH
+-      ;;
+-    siemens)
+-      need_lib_prefix=no
+-      ;;
+-    motorola)
+-      need_lib_prefix=no
+-      need_version=no
+-      shlibpath_overrides_runpath=no
+-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+-      ;;
+-  esac
+-  ;;
+-
+-sysv4*MP*)
+-  if test -d /usr/nec ;then
+-    version_type=linux # correct to gnu/linux during the next big refactor
+-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+-    soname_spec='$libname${shared_ext}.$major'
+-    shlibpath_var=LD_LIBRARY_PATH
+-  fi
+-  ;;
+-
+-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+-  version_type=freebsd-elf
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=yes
+-  hardcode_into_libs=yes
+-  if test "$with_gnu_ld" = yes; then
+-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+-  else
+-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+-    case $host_os in
+-      sco3.2v5*)
+-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+-	;;
+-    esac
+-  fi
+-  sys_lib_dlsearch_path_spec='/usr/lib'
+-  ;;
+-
+-tpf*)
+-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=no
+-  hardcode_into_libs=yes
+-  ;;
+-
+-uts4*)
+-  version_type=linux # correct to gnu/linux during the next big refactor
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  ;;
+-
+-*)
+-  dynamic_linker=no
+-  ;;
+-esac
+-AC_MSG_RESULT([$dynamic_linker])
+-test "$dynamic_linker" = no && can_build_shared=no
+-
+-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+-if test "$GCC" = yes; then
+-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+-fi
+-
+-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+-fi
+-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+-fi
+-
+-_LT_DECL([], [variables_saved_for_relink], [1],
+-    [Variables whose values should be saved in libtool wrapper scripts and
+-    restored at link time])
+-_LT_DECL([], [need_lib_prefix], [0],
+-    [Do we need the "lib" prefix for modules?])
+-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+-_LT_DECL([], [version_type], [0], [Library versioning type])
+-_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+-_LT_DECL([], [shlibpath_overrides_runpath], [0],
+-    [Is shlibpath searched before the hard-coded library search path?])
+-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+-_LT_DECL([], [library_names_spec], [1],
+-    [[List of archive names.  First name is the real one, the rest are links.
+-    The last name is the one that the linker finds with -lNAME]])
+-_LT_DECL([], [soname_spec], [1],
+-    [[The coded name of the library, if different from the real name]])
+-_LT_DECL([], [install_override_mode], [1],
+-    [Permission mode override for installation of shared libraries])
+-_LT_DECL([], [postinstall_cmds], [2],
+-    [Command to use after installation of a shared archive])
+-_LT_DECL([], [postuninstall_cmds], [2],
+-    [Command to use after uninstallation of a shared archive])
+-_LT_DECL([], [finish_cmds], [2],
+-    [Commands used to finish a libtool library installation in a directory])
+-_LT_DECL([], [finish_eval], [1],
+-    [[As "finish_cmds", except a single script fragment to be evaled but
+-    not shown]])
+-_LT_DECL([], [hardcode_into_libs], [0],
+-    [Whether we should hardcode library paths into libraries])
+-_LT_DECL([], [sys_lib_search_path_spec], [2],
+-    [Compile-time system search path for libraries])
+-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+-    [Run-time system search path for libraries])
+-])# _LT_SYS_DYNAMIC_LINKER
+-
+-
+-# _LT_PATH_TOOL_PREFIX(TOOL)
+-# --------------------------
+-# find a file program which can recognize shared library
+-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+-[m4_require([_LT_DECL_EGREP])dnl
+-AC_MSG_CHECKING([for $1])
+-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+-[case $MAGIC_CMD in
+-[[\\/*] |  ?:[\\/]*])
+-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+-  ;;
+-*)
+-  lt_save_MAGIC_CMD="$MAGIC_CMD"
+-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+-dnl $ac_dummy forces splitting on constant user-supplied paths.
+-dnl POSIX.2 word splitting is done only on the output of word expansions,
+-dnl not every word.  This closes a longstanding sh security hole.
+-  ac_dummy="m4_if([$2], , $PATH, [$2])"
+-  for ac_dir in $ac_dummy; do
+-    IFS="$lt_save_ifs"
+-    test -z "$ac_dir" && ac_dir=.
+-    if test -f $ac_dir/$1; then
+-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+-      if test -n "$file_magic_test_file"; then
+-	case $deplibs_check_method in
+-	"file_magic "*)
+-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+-	    $EGREP "$file_magic_regex" > /dev/null; then
+-	    :
+-	  else
+-	    cat <<_LT_EOF 1>&2
+-
+-*** Warning: the command libtool uses to detect shared libraries,
+-*** $file_magic_cmd, produces output that libtool cannot recognize.
+-*** The result is that libtool may fail to recognize shared libraries
+-*** as such.  This will affect the creation of libtool libraries that
+-*** depend on shared libraries, but programs linked with such libtool
+-*** libraries will work regardless of this problem.  Nevertheless, you
+-*** may want to report the problem to your system manager and/or to
+-*** bug-libtool@gnu.org
+-
+-_LT_EOF
+-	  fi ;;
+-	esac
+-      fi
+-      break
+-    fi
+-  done
+-  IFS="$lt_save_ifs"
+-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+-  ;;
+-esac])
+-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+-if test -n "$MAGIC_CMD"; then
+-  AC_MSG_RESULT($MAGIC_CMD)
+-else
+-  AC_MSG_RESULT(no)
+-fi
+-_LT_DECL([], [MAGIC_CMD], [0],
+-	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+-])# _LT_PATH_TOOL_PREFIX
+-
+-# Old name:
+-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+-
+-
+-# _LT_PATH_MAGIC
+-# --------------
+-# find a file program which can recognize a shared library
+-m4_defun([_LT_PATH_MAGIC],
+-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+-if test -z "$lt_cv_path_MAGIC_CMD"; then
+-  if test -n "$ac_tool_prefix"; then
+-    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+-  else
+-    MAGIC_CMD=:
+-  fi
+-fi
+-])# _LT_PATH_MAGIC
+-
+-
+-# LT_PATH_LD
+-# ----------
+-# find the pathname to the GNU or non-GNU linker
+-AC_DEFUN([LT_PATH_LD],
+-[AC_REQUIRE([AC_PROG_CC])dnl
+-AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+-m4_require([_LT_DECL_SED])dnl
+-m4_require([_LT_DECL_EGREP])dnl
+-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+-
+-AC_ARG_WITH([gnu-ld],
+-    [AS_HELP_STRING([--with-gnu-ld],
+-	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+-    [test "$withval" = no || with_gnu_ld=yes],
+-    [with_gnu_ld=no])dnl
+-
+-ac_prog=ld
+-if test "$GCC" = yes; then
+-  # Check if gcc -print-prog-name=ld gives a path.
+-  AC_MSG_CHECKING([for ld used by $CC])
+-  case $host in
+-  *-*-mingw*)
+-    # gcc leaves a trailing carriage return which upsets mingw
+-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+-  *)
+-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+-  esac
+-  case $ac_prog in
+-    # Accept absolute paths.
+-    [[\\/]]* | ?:[[\\/]]*)
+-      re_direlt='/[[^/]][[^/]]*/\.\./'
+-      # Canonicalize the pathname of ld
+-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+-	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+-      done
+-      test -z "$LD" && LD="$ac_prog"
+-      ;;
+-  "")
+-    # If it fails, then pretend we aren't using GCC.
+-    ac_prog=ld
+-    ;;
+-  *)
+-    # If it is relative, then search for the first ld in PATH.
+-    with_gnu_ld=unknown
+-    ;;
+-  esac
+-elif test "$with_gnu_ld" = yes; then
+-  AC_MSG_CHECKING([for GNU ld])
+-else
+-  AC_MSG_CHECKING([for non-GNU ld])
+-fi
+-AC_CACHE_VAL(lt_cv_path_LD,
+-[if test -z "$LD"; then
+-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+-  for ac_dir in $PATH; do
+-    IFS="$lt_save_ifs"
+-    test -z "$ac_dir" && ac_dir=.
+-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+-      lt_cv_path_LD="$ac_dir/$ac_prog"
+-      # Check to see if the program is GNU ld.  I'd rather use --version,
+-      # but apparently some variants of GNU ld only accept -v.
+-      # Break only if it was the GNU/non-GNU ld that we prefer.
+-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+-      *GNU* | *'with BFD'*)
+-	test "$with_gnu_ld" != no && break
+-	;;
+-      *)
+-	test "$with_gnu_ld" != yes && break
+-	;;
+-      esac
+-    fi
+-  done
+-  IFS="$lt_save_ifs"
+-else
+-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+-fi])
+-LD="$lt_cv_path_LD"
+-if test -n "$LD"; then
+-  AC_MSG_RESULT($LD)
+-else
+-  AC_MSG_RESULT(no)
+-fi
+-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+-_LT_PATH_LD_GNU
+-AC_SUBST([LD])
+-
+-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+-])# LT_PATH_LD
+-
+-# Old names:
+-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AM_PROG_LD], [])
+-dnl AC_DEFUN([AC_PROG_LD], [])
+-
+-
+-# _LT_PATH_LD_GNU
+-#- --------------
+-m4_defun([_LT_PATH_LD_GNU],
+-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
+-*GNU* | *'with BFD'*)
+-  lt_cv_prog_gnu_ld=yes
+-  ;;
+-*)
+-  lt_cv_prog_gnu_ld=no
+-  ;;
+-esac])
+-with_gnu_ld=$lt_cv_prog_gnu_ld
+-])# _LT_PATH_LD_GNU
+-
+-
+-# _LT_CMD_RELOAD
+-# --------------
+-# find reload flag for linker
+-#   -- PORTME Some linkers may need a different reload flag.
+-m4_defun([_LT_CMD_RELOAD],
+-[AC_CACHE_CHECK([for $LD option to reload object files],
+-  lt_cv_ld_reload_flag,
+-  [lt_cv_ld_reload_flag='-r'])
+-reload_flag=$lt_cv_ld_reload_flag
+-case $reload_flag in
+-"" | " "*) ;;
+-*) reload_flag=" $reload_flag" ;;
+-esac
+-reload_cmds='$LD$reload_flag -o $output$reload_objs'
+-case $host_os in
+-  cygwin* | mingw* | pw32* | cegcc*)
+-    if test "$GCC" != yes; then
+-      reload_cmds=false
+-    fi
+-    ;;
+-  darwin*)
+-    if test "$GCC" = yes; then
+-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+-    else
+-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+-    fi
+-    ;;
+-esac
+-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+-_LT_TAGDECL([], [reload_cmds], [2])dnl
+-])# _LT_CMD_RELOAD
+-
+-
+-# _LT_CHECK_MAGIC_METHOD
+-# ----------------------
+-# how to check for library dependencies
+-#  -- PORTME fill in with the dynamic library characteristics
+-m4_defun([_LT_CHECK_MAGIC_METHOD],
+-[m4_require([_LT_DECL_EGREP])
+-m4_require([_LT_DECL_OBJDUMP])
+-AC_CACHE_CHECK([how to recognize dependent libraries],
+-lt_cv_deplibs_check_method,
+-[lt_cv_file_magic_cmd='$MAGIC_CMD'
+-lt_cv_file_magic_test_file=
+-lt_cv_deplibs_check_method='unknown'
+-# Need to set the preceding variable on all platforms that support
+-# interlibrary dependencies.
+-# 'none' -- dependencies not supported.
+-# `unknown' -- same as none, but documents that we really don't know.
+-# 'pass_all' -- all dependencies passed with no checks.
+-# 'test_compile' -- check by making test program.
+-# 'file_magic [[regex]]' -- check by looking for files in library path
+-# which responds to the $file_magic_cmd with a given extended regex.
+-# If you have `file' or equivalent on your system and you're not sure
+-# whether `pass_all' will *always* work, you probably want this one.
+-
+-case $host_os in
+-aix[[4-9]]*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-beos*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-bsdi[[45]]*)
+-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+-  lt_cv_file_magic_cmd='/usr/bin/file -L'
+-  lt_cv_file_magic_test_file=/shlib/libc.so
+-  ;;
+-
+-cygwin*)
+-  # func_win32_libid is a shell function defined in ltmain.sh
+-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+-  lt_cv_file_magic_cmd='func_win32_libid'
+-  ;;
+-
+-mingw* | pw32*)
+-  # Base MSYS/MinGW do not provide the 'file' command needed by
+-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+-  # unless we find 'file', for example because we are cross-compiling.
+-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+-    lt_cv_file_magic_cmd='func_win32_libid'
+-  else
+-    # Keep this pattern in sync with the one in func_win32_libid.
+-    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+-    lt_cv_file_magic_cmd='$OBJDUMP -f'
+-  fi
+-  ;;
+-
+-cegcc*)
+-  # use the weaker test based on 'objdump'. See mingw*.
+-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+-  lt_cv_file_magic_cmd='$OBJDUMP -f'
+-  ;;
+-
+-darwin* | rhapsody*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-freebsd* | dragonfly*)
+-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+-    case $host_cpu in
+-    i*86 )
+-      # Not sure whether the presence of OpenBSD here was a mistake.
+-      # Let's accept both of them until this is cleared up.
+-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+-      lt_cv_file_magic_cmd=/usr/bin/file
+-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+-      ;;
+-    esac
+-  else
+-    lt_cv_deplibs_check_method=pass_all
+-  fi
+-  ;;
+-
+-gnu*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-haiku*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-hpux10.20* | hpux11*)
+-  lt_cv_file_magic_cmd=/usr/bin/file
+-  case $host_cpu in
+-  ia64*)
+-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+-    ;;
+-  hppa*64*)
+-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+-    ;;
+-  *)
+-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+-    ;;
+-  esac
+-  ;;
+-
+-interix[[3-9]]*)
+-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+-  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+-  ;;
+-
+-irix5* | irix6* | nonstopux*)
+-  case $LD in
+-  *-32|*"-32 ") libmagic=32-bit;;
+-  *-n32|*"-n32 ") libmagic=N32;;
+-  *-64|*"-64 ") libmagic=64-bit;;
+-  *) libmagic=never-match;;
+-  esac
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-# This must be glibc/ELF.
+-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-netbsd*)
+-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+-  else
+-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+-  fi
+-  ;;
+-
+-newos6*)
+-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+-  lt_cv_file_magic_cmd=/usr/bin/file
+-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+-  ;;
+-
+-*nto* | *qnx*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-openbsd*)
+-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+-  else
+-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+-  fi
+-  ;;
+-
+-osf3* | osf4* | osf5*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-rdos*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-solaris*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-
+-sysv4 | sysv4.3*)
+-  case $host_vendor in
+-  motorola)
+-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+-    ;;
+-  ncr)
+-    lt_cv_deplibs_check_method=pass_all
+-    ;;
+-  sequent)
+-    lt_cv_file_magic_cmd='/bin/file'
+-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+-    ;;
+-  sni)
+-    lt_cv_file_magic_cmd='/bin/file'
+-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+-    lt_cv_file_magic_test_file=/lib/libc.so
+-    ;;
+-  siemens)
+-    lt_cv_deplibs_check_method=pass_all
+-    ;;
+-  pc)
+-    lt_cv_deplibs_check_method=pass_all
+-    ;;
+-  esac
+-  ;;
+-
+-tpf*)
+-  lt_cv_deplibs_check_method=pass_all
+-  ;;
+-esac
+-])
+-
+-file_magic_glob=
+-want_nocaseglob=no
+-if test "$build" = "$host"; then
+-  case $host_os in
+-  mingw* | pw32*)
+-    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+-      want_nocaseglob=yes
+-    else
+-      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+-    fi
+-    ;;
+-  esac
+-fi
+-
+-file_magic_cmd=$lt_cv_file_magic_cmd
+-deplibs_check_method=$lt_cv_deplibs_check_method
+-test -z "$deplibs_check_method" && deplibs_check_method=unknown
+-
+-_LT_DECL([], [deplibs_check_method], [1],
+-    [Method to check whether dependent libraries are shared objects])
+-_LT_DECL([], [file_magic_cmd], [1],
+-    [Command to use when deplibs_check_method = "file_magic"])
+-_LT_DECL([], [file_magic_glob], [1],
+-    [How to find potential files when deplibs_check_method = "file_magic"])
+-_LT_DECL([], [want_nocaseglob], [1],
+-    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+-])# _LT_CHECK_MAGIC_METHOD
+-
+-
+-# LT_PATH_NM
+-# ----------
+-# find the pathname to a BSD- or MS-compatible name lister
+-AC_DEFUN([LT_PATH_NM],
+-[AC_REQUIRE([AC_PROG_CC])dnl
+-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+-[if test -n "$NM"; then
+-  # Let the user override the test.
+-  lt_cv_path_NM="$NM"
+-else
+-  lt_nm_to_check="${ac_tool_prefix}nm"
+-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+-    lt_nm_to_check="$lt_nm_to_check nm"
+-  fi
+-  for lt_tmp_nm in $lt_nm_to_check; do
+-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+-      IFS="$lt_save_ifs"
+-      test -z "$ac_dir" && ac_dir=.
+-      tmp_nm="$ac_dir/$lt_tmp_nm"
+-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+-	# Check to see if the nm accepts a BSD-compat flag.
+-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+-	#   nm: unknown option "B" ignored
+-	# Tru64's nm complains that /dev/null is an invalid object file
+-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+-	*/dev/null* | *'Invalid file or object type'*)
+-	  lt_cv_path_NM="$tmp_nm -B"
+-	  break
+-	  ;;
+-	*)
+-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+-	  */dev/null*)
+-	    lt_cv_path_NM="$tmp_nm -p"
+-	    break
+-	    ;;
+-	  *)
+-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+-	    continue # so that we can try to find one that supports BSD flags
+-	    ;;
+-	  esac
+-	  ;;
+-	esac
+-      fi
+-    done
+-    IFS="$lt_save_ifs"
+-  done
+-  : ${lt_cv_path_NM=no}
+-fi])
+-if test "$lt_cv_path_NM" != "no"; then
+-  NM="$lt_cv_path_NM"
+-else
+-  # Didn't find any BSD compatible name lister, look for dumpbin.
+-  if test -n "$DUMPBIN"; then :
+-    # Let the user override the test.
+-  else
+-    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+-    *COFF*)
+-      DUMPBIN="$DUMPBIN -symbols"
+-      ;;
+-    *)
+-      DUMPBIN=:
+-      ;;
+-    esac
+-  fi
+-  AC_SUBST([DUMPBIN])
+-  if test "$DUMPBIN" != ":"; then
+-    NM="$DUMPBIN"
+-  fi
+-fi
+-test -z "$NM" && NM=nm
+-AC_SUBST([NM])
+-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+-
+-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+-  [lt_cv_nm_interface="BSD nm"
+-  echo "int some_variable = 0;" > conftest.$ac_ext
+-  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+-  (eval "$ac_compile" 2>conftest.err)
+-  cat conftest.err >&AS_MESSAGE_LOG_FD
+-  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+-  cat conftest.err >&AS_MESSAGE_LOG_FD
+-  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+-  cat conftest.out >&AS_MESSAGE_LOG_FD
+-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+-    lt_cv_nm_interface="MS dumpbin"
+-  fi
+-  rm -f conftest*])
+-])# LT_PATH_NM
+-
+-# Old names:
+-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AM_PROG_NM], [])
+-dnl AC_DEFUN([AC_PROG_NM], [])
+-
+-# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+-# --------------------------------
+-# how to determine the name of the shared library
+-# associated with a specific link library.
+-#  -- PORTME fill in with the dynamic library characteristics
+-m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+-[m4_require([_LT_DECL_EGREP])
+-m4_require([_LT_DECL_OBJDUMP])
+-m4_require([_LT_DECL_DLLTOOL])
+-AC_CACHE_CHECK([how to associate runtime and link libraries],
+-lt_cv_sharedlib_from_linklib_cmd,
+-[lt_cv_sharedlib_from_linklib_cmd='unknown'
+-
+-case $host_os in
+-cygwin* | mingw* | pw32* | cegcc*)
+-  # two different shell functions defined in ltmain.sh
+-  # decide which to use based on capabilities of $DLLTOOL
+-  case `$DLLTOOL --help 2>&1` in
+-  *--identify-strict*)
+-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+-    ;;
+-  *)
+-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+-    ;;
+-  esac
+-  ;;
+-*)
+-  # fallback: assume linklib IS sharedlib
+-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+-  ;;
+-esac
+-])
+-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+-
+-_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+-    [Command to associate shared and link libraries])
+-])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+-
+-
+-# _LT_PATH_MANIFEST_TOOL
+-# ----------------------
+-# locate the manifest tool
+-m4_defun([_LT_PATH_MANIFEST_TOOL],
+-[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+-  [lt_cv_path_mainfest_tool=no
+-  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+-  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+-  cat conftest.err >&AS_MESSAGE_LOG_FD
+-  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+-    lt_cv_path_mainfest_tool=yes
+-  fi
+-  rm -f conftest*])
+-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+-  MANIFEST_TOOL=:
+-fi
+-_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+-])# _LT_PATH_MANIFEST_TOOL
+-
+-
+-# LT_LIB_M
+-# --------
+-# check for math library
+-AC_DEFUN([LT_LIB_M],
+-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-LIBM=
+-case $host in
+-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+-  # These system don't have libm, or don't need it
+-  ;;
+-*-ncr-sysv4.3*)
+-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+-  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+-  ;;
+-*)
+-  AC_CHECK_LIB(m, cos, LIBM="-lm")
+-  ;;
+-esac
+-AC_SUBST([LIBM])
+-])# LT_LIB_M
+-
+-# Old name:
+-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_CHECK_LIBM], [])
+-
+-
+-# _LT_COMPILER_NO_RTTI([TAGNAME])
+-# -------------------------------
+-m4_defun([_LT_COMPILER_NO_RTTI],
+-[m4_require([_LT_TAG_COMPILER])dnl
+-
+-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+-
+-if test "$GCC" = yes; then
+-  case $cc_basename in
+-  nvcc*)
+-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+-  *)
+-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+-  esac
+-
+-  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+-    lt_cv_prog_compiler_rtti_exceptions,
+-    [-fno-rtti -fno-exceptions], [],
+-    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+-fi
+-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+-	[Compiler flag to turn off builtin functions])
+-])# _LT_COMPILER_NO_RTTI
+-
+-
+-# _LT_CMD_GLOBAL_SYMBOLS
+-# ----------------------
+-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-AC_REQUIRE([AC_PROG_CC])dnl
+-AC_REQUIRE([AC_PROG_AWK])dnl
+-AC_REQUIRE([LT_PATH_NM])dnl
+-AC_REQUIRE([LT_PATH_LD])dnl
+-m4_require([_LT_DECL_SED])dnl
+-m4_require([_LT_DECL_EGREP])dnl
+-m4_require([_LT_TAG_COMPILER])dnl
+-
+-# Check for command to grab the raw symbol name followed by C symbol from nm.
+-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+-[
+-# These are sane defaults that work on at least a few old systems.
+-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+-
+-# Character class describing NM global symbol codes.
+-symcode='[[BCDEGRST]]'
+-
+-# Regexp to match symbols that can be accessed directly from C.
+-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+-
+-# Define system-specific variables.
+-case $host_os in
+-aix*)
+-  symcode='[[BCDT]]'
+-  ;;
+-cygwin* | mingw* | pw32* | cegcc*)
+-  symcode='[[ABCDGISTW]]'
+-  ;;
+-hpux*)
+-  if test "$host_cpu" = ia64; then
+-    symcode='[[ABCDEGRST]]'
+-  fi
+-  ;;
+-irix* | nonstopux*)
+-  symcode='[[BCDEGRST]]'
+-  ;;
+-osf*)
+-  symcode='[[BCDEGQRST]]'
+-  ;;
+-solaris*)
+-  symcode='[[BDRT]]'
+-  ;;
+-sco3.2v5*)
+-  symcode='[[DT]]'
+-  ;;
+-sysv4.2uw2*)
+-  symcode='[[DT]]'
+-  ;;
+-sysv5* | sco5v6* | unixware* | OpenUNIX*)
+-  symcode='[[ABDT]]'
+-  ;;
+-sysv4)
+-  symcode='[[DFNSTU]]'
+-  ;;
+-esac
+-
+-# If we're using GNU nm, then use its standard symbol codes.
+-case `$NM -V 2>&1` in
+-*GNU* | *'with BFD'*)
+-  symcode='[[ABCDGIRSTW]]' ;;
+-esac
+-
+-# Transform an extracted symbol line into a proper C declaration.
+-# Some systems (esp. on ia64) link data and code symbols differently,
+-# so use this general approach.
+-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+-
+-# Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+-
+-# Handle CRLF in mingw tool chain
+-opt_cr=
+-case $build_os in
+-mingw*)
+-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+-  ;;
+-esac
+-
+-# Try without a prefix underscore, then with it.
+-for ac_symprfx in "" "_"; do
+-
+-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+-  symxfrm="\\1 $ac_symprfx\\2 \\2"
+-
+-  # Write the raw and C identifiers.
+-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+-    # Fake it for dumpbin and say T for any non-static function
+-    # and D for any global variable.
+-    # Also find C++ and __fastcall symbols from MSVC++,
+-    # which start with @ or ?.
+-    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+-"     {last_section=section; section=\$ 3};"\
+-"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+-"     \$ 0!~/External *\|/{next};"\
+-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+-"     {if(hide[section]) next};"\
+-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+-"     ' prfx=^$ac_symprfx]"
+-  else
+-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+-  fi
+-  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+-
+-  # Check to see that the pipe works correctly.
+-  pipe_works=no
+-
+-  rm -f conftest*
+-  cat > conftest.$ac_ext <<_LT_EOF
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-char nm_test_var;
+-void nm_test_func(void);
+-void nm_test_func(void){}
+-#ifdef __cplusplus
+-}
+-#endif
+-int main(){nm_test_var='a';nm_test_func();return(0);}
+-_LT_EOF
+-
+-  if AC_TRY_EVAL(ac_compile); then
+-    # Now try to grab the symbols.
+-    nlist=conftest.nm
+-    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+-      # Try sorting and uniquifying the output.
+-      if sort "$nlist" | uniq > "$nlist"T; then
+-	mv -f "$nlist"T "$nlist"
+-      else
+-	rm -f "$nlist"T
+-      fi
+-
+-      # Make sure that we snagged all the symbols we need.
+-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+-	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+-	  cat <<_LT_EOF > conftest.$ac_ext
+-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+-# define LT@&t@_DLSYM_CONST
+-#elif defined(__osf__)
+-/* This system does not cope well with relocations in const data.  */
+-# define LT@&t@_DLSYM_CONST
+-#else
+-# define LT@&t@_DLSYM_CONST const
+-#endif
+-
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-
+-_LT_EOF
+-	  # Now generate the symbol file.
+-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+-
+-	  cat <<_LT_EOF >> conftest.$ac_ext
+-
+-/* The mapping between symbol names and symbols.  */
+-LT@&t@_DLSYM_CONST struct {
+-  const char *name;
+-  void       *address;
+-}
+-lt__PROGRAM__LTX_preloaded_symbols[[]] =
+-{
+-  { "@PROGRAM@", (void *) 0 },
+-_LT_EOF
+-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+-	  cat <<\_LT_EOF >> conftest.$ac_ext
+-  {0, (void *) 0}
+-};
+-
+-/* This works around a problem in FreeBSD linker */
+-#ifdef FREEBSD_WORKAROUND
+-static const void *lt_preloaded_setup() {
+-  return lt__PROGRAM__LTX_preloaded_symbols;
+-}
+-#endif
+-
+-#ifdef __cplusplus
+-}
+-#endif
+-_LT_EOF
+-	  # Now try linking the two files.
+-	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_globsym_save_LIBS=$LIBS
+-	  lt_globsym_save_CFLAGS=$CFLAGS
+-	  LIBS="conftstm.$ac_objext"
+-	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+-	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+-	    pipe_works=yes
+-	  fi
+-	  LIBS=$lt_globsym_save_LIBS
+-	  CFLAGS=$lt_globsym_save_CFLAGS
+-	else
+-	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+-	fi
+-      else
+-	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+-      fi
+-    else
+-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+-    fi
+-  else
+-    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+-    cat conftest.$ac_ext >&5
+-  fi
+-  rm -rf conftest* conftst*
+-
+-  # Do not use the global_symbol_pipe unless it works.
+-  if test "$pipe_works" = yes; then
+-    break
+-  else
+-    lt_cv_sys_global_symbol_pipe=
+-  fi
+-done
+-])
+-if test -z "$lt_cv_sys_global_symbol_pipe"; then
+-  lt_cv_sys_global_symbol_to_cdecl=
+-fi
+-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+-  AC_MSG_RESULT(failed)
+-else
+-  AC_MSG_RESULT(ok)
+-fi
+-
+-# Response file support.
+-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+-  nm_file_list_spec='@'
+-elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+-  nm_file_list_spec='@'
+-fi
+-
+-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+-    [Take the output of nm and produce a listing of raw symbols and C names])
+-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+-    [Transform the output of nm in a proper C declaration])
+-_LT_DECL([global_symbol_to_c_name_address],
+-    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+-    [Transform the output of nm in a C name address pair])
+-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+-    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+-    [Transform the output of nm in a C name address pair when lib prefix is needed])
+-_LT_DECL([], [nm_file_list_spec], [1],
+-    [Specify filename containing input files for $NM])
+-]) # _LT_CMD_GLOBAL_SYMBOLS
+-
+-
+-# _LT_COMPILER_PIC([TAGNAME])
+-# ---------------------------
+-m4_defun([_LT_COMPILER_PIC],
+-[m4_require([_LT_TAG_COMPILER])dnl
+-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+-_LT_TAGVAR(lt_prog_compiler_static, $1)=
+-
+-m4_if([$1], [CXX], [
+-  # C++ specific cases for pic, static, wl, etc.
+-  if test "$GXX" = yes; then
+-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+-
+-    case $host_os in
+-    aix*)
+-      # All AIX code is PIC.
+-      if test "$host_cpu" = ia64; then
+-	# AIX 5 now supports IA64 processor
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-      fi
+-      ;;
+-
+-    amigaos*)
+-      case $host_cpu in
+-      powerpc)
+-            # see comment about AmigaOS4 .so support
+-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+-        ;;
+-      m68k)
+-            # FIXME: we need at least 68020 code to build shared libraries, but
+-            # adding the `-m68020' flag to GCC prevents building anything better,
+-            # like `-m68040'.
+-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+-        ;;
+-      esac
+-      ;;
+-
+-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+-      # PIC is the default for these OSes.
+-      ;;
+-    mingw* | cygwin* | os2* | pw32* | cegcc*)
+-      # This hack is so that the source file can tell whether it is being
+-      # built for inclusion in a dll (and should export symbols for example).
+-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+-      # (--disable-auto-import) libraries
+-      m4_if([$1], [GCJ], [],
+-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+-      ;;
+-    darwin* | rhapsody*)
+-      # PIC is the default on this platform
+-      # Common symbols not allowed in MH_DYLIB files
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+-      ;;
+-    *djgpp*)
+-      # DJGPP does not support shared libraries at all
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+-      ;;
+-    haiku*)
+-      # PIC is the default for Haiku.
+-      # The "-static" flag exists, but is broken.
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+-      ;;
+-    interix[[3-9]]*)
+-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+-      # Instead, we relocate shared libraries at runtime.
+-      ;;
+-    sysv4*MP*)
+-      if test -d /usr/nec; then
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+-      fi
+-      ;;
+-    hpux*)
+-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+-      # sets the default TLS model and affects inlining.
+-      case $host_cpu in
+-      hppa*64*)
+-	;;
+-      *)
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+-	;;
+-      esac
+-      ;;
+-    *qnx* | *nto*)
+-      # QNX uses GNU C++, but need to define -shared option too, otherwise
+-      # it will coredump.
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+-      ;;
+-    *)
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+-      ;;
+-    esac
+-  else
+-    case $host_os in
+-      aix[[4-9]]*)
+-	# All AIX code is PIC.
+-	if test "$host_cpu" = ia64; then
+-	  # AIX 5 now supports IA64 processor
+-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	else
+-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+-	fi
+-	;;
+-      chorus*)
+-	case $cc_basename in
+-	cxch68*)
+-	  # Green Hills C++ Compiler
+-	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+-	  ;;
+-	esac
+-	;;
+-      mingw* | cygwin* | os2* | pw32* | cegcc*)
+-	# This hack is so that the source file can tell whether it is being
+-	# built for inclusion in a dll (and should export symbols for example).
+-	m4_if([$1], [GCJ], [],
+-	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+-	;;
+-      dgux*)
+-	case $cc_basename in
+-	  ec++*)
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-	    ;;
+-	  ghcx*)
+-	    # Green Hills C++ Compiler
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+-	    ;;
+-	  *)
+-	    ;;
+-	esac
+-	;;
+-      freebsd* | dragonfly*)
+-	# FreeBSD uses GNU C++
+-	;;
+-      hpux9* | hpux10* | hpux11*)
+-	case $cc_basename in
+-	  CC*)
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+-	    if test "$host_cpu" != ia64; then
+-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+-	    fi
+-	    ;;
+-	  aCC*)
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+-	    case $host_cpu in
+-	    hppa*64*|ia64*)
+-	      # +Z the default
+-	      ;;
+-	    *)
+-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+-	      ;;
+-	    esac
+-	    ;;
+-	  *)
+-	    ;;
+-	esac
+-	;;
+-      interix*)
+-	# This is c89, which is MS Visual C++ (no shared libs)
+-	# Anyone wants to do a port?
+-	;;
+-      irix5* | irix6* | nonstopux*)
+-	case $cc_basename in
+-	  CC*)
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+-	    # CC pic flag -KPIC is the default.
+-	    ;;
+-	  *)
+-	    ;;
+-	esac
+-	;;
+-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+-	case $cc_basename in
+-	  KCC*)
+-	    # KAI C++ Compiler
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+-	    ;;
+-	  ecpc* )
+-	    # old Intel C++ for x86_64 which still supported -KPIC.
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+-	    ;;
+-	  icpc* )
+-	    # Intel C++, used to be incompatible with GCC.
+-	    # ICC 10 doesn't accept -KPIC any more.
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+-	    ;;
+-	  pgCC* | pgcpp*)
+-	    # Portland Group C++ compiler
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	    ;;
+-	  cxx*)
+-	    # Compaq C++
+-	    # Make sure the PIC flag is empty.  It appears that all Alpha
+-	    # Linux and Compaq Tru64 Unix objects are PIC.
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+-	    ;;
+-	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+-	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+-	    ;;
+-	  *)
+-	    case `$CC -V 2>&1 | sed 5q` in
+-	    *Sun\ C*)
+-	      # Sun C++ 5.9
+-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+-	      ;;
+-	    esac
+-	    ;;
+-	esac
+-	;;
+-      lynxos*)
+-	;;
+-      m88k*)
+-	;;
+-      mvs*)
+-	case $cc_basename in
+-	  cxx*)
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+-	    ;;
+-	  *)
+-	    ;;
+-	esac
+-	;;
+-      netbsd*)
+-	;;
+-      *qnx* | *nto*)
+-        # QNX uses GNU C++, but need to define -shared option too, otherwise
+-        # it will coredump.
+-        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+-        ;;
+-      osf3* | osf4* | osf5*)
+-	case $cc_basename in
+-	  KCC*)
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+-	    ;;
+-	  RCC*)
+-	    # Rational C++ 2.4.1
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+-	    ;;
+-	  cxx*)
+-	    # Digital/Compaq C++
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	    # Make sure the PIC flag is empty.  It appears that all Alpha
+-	    # Linux and Compaq Tru64 Unix objects are PIC.
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+-	    ;;
+-	  *)
+-	    ;;
+-	esac
+-	;;
+-      psos*)
+-	;;
+-      solaris*)
+-	case $cc_basename in
+-	  CC* | sunCC*)
+-	    # Sun C++ 4.2, 5.x and Centerline C++
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+-	    ;;
+-	  gcx*)
+-	    # Green Hills C++ Compiler
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+-	    ;;
+-	  *)
+-	    ;;
+-	esac
+-	;;
+-      sunos4*)
+-	case $cc_basename in
+-	  CC*)
+-	    # Sun C++ 4.x
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	    ;;
+-	  lcc*)
+-	    # Lucid
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+-	    ;;
+-	  *)
+-	    ;;
+-	esac
+-	;;
+-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+-	case $cc_basename in
+-	  CC*)
+-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	    ;;
+-	esac
+-	;;
+-      tandem*)
+-	case $cc_basename in
+-	  NCC*)
+-	    # NonStop-UX NCC 3.20
+-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-	    ;;
+-	  *)
+-	    ;;
+-	esac
+-	;;
+-      vxworks*)
+-	;;
+-      *)
+-	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+-	;;
+-    esac
+-  fi
+-],
+-[
+-  if test "$GCC" = yes; then
+-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+-
+-    case $host_os in
+-      aix*)
+-      # All AIX code is PIC.
+-      if test "$host_cpu" = ia64; then
+-	# AIX 5 now supports IA64 processor
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-      fi
+-      ;;
+-
+-    amigaos*)
+-      case $host_cpu in
+-      powerpc)
+-            # see comment about AmigaOS4 .so support
+-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+-        ;;
+-      m68k)
+-            # FIXME: we need at least 68020 code to build shared libraries, but
+-            # adding the `-m68020' flag to GCC prevents building anything better,
+-            # like `-m68040'.
+-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+-        ;;
+-      esac
+-      ;;
+-
+-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+-      # PIC is the default for these OSes.
+-      ;;
+-
+-    mingw* | cygwin* | pw32* | os2* | cegcc*)
+-      # This hack is so that the source file can tell whether it is being
+-      # built for inclusion in a dll (and should export symbols for example).
+-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+-      # (--disable-auto-import) libraries
+-      m4_if([$1], [GCJ], [],
+-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+-      ;;
+-
+-    darwin* | rhapsody*)
+-      # PIC is the default on this platform
+-      # Common symbols not allowed in MH_DYLIB files
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+-      ;;
+-
+-    haiku*)
+-      # PIC is the default for Haiku.
+-      # The "-static" flag exists, but is broken.
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+-      ;;
+-
+-    hpux*)
+-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+-      # sets the default TLS model and affects inlining.
+-      case $host_cpu in
+-      hppa*64*)
+-	# +Z the default
+-	;;
+-      *)
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+-	;;
+-      esac
+-      ;;
+-
+-    interix[[3-9]]*)
+-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+-      # Instead, we relocate shared libraries at runtime.
+-      ;;
+-
+-    msdosdjgpp*)
+-      # Just because we use GCC doesn't mean we suddenly get shared libraries
+-      # on systems that don't support them.
+-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+-      enable_shared=no
+-      ;;
+-
+-    *nto* | *qnx*)
+-      # QNX uses GNU C++, but need to define -shared option too, otherwise
+-      # it will coredump.
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+-      ;;
+-
+-    sysv4*MP*)
+-      if test -d /usr/nec; then
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+-      fi
+-      ;;
+-
+-    *)
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+-      ;;
+-    esac
+-
+-    case $cc_basename in
+-    nvcc*) # Cuda Compiler Driver 2.2
+-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+-      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+-        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+-      fi
+-      ;;
+-    esac
+-  else
+-    # PORTME Check for flag to pass linker flags through the system compiler.
+-    case $host_os in
+-    aix*)
+-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-      if test "$host_cpu" = ia64; then
+-	# AIX 5 now supports IA64 processor
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-      else
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+-      fi
+-      ;;
+-
+-    mingw* | cygwin* | pw32* | os2* | cegcc*)
+-      # This hack is so that the source file can tell whether it is being
+-      # built for inclusion in a dll (and should export symbols for example).
+-      m4_if([$1], [GCJ], [],
+-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+-      ;;
+-
+-    hpux9* | hpux10* | hpux11*)
+-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+-      # not for PA HP-UX.
+-      case $host_cpu in
+-      hppa*64*|ia64*)
+-	# +Z the default
+-	;;
+-      *)
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+-	;;
+-      esac
+-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+-      ;;
+-
+-    irix5* | irix6* | nonstopux*)
+-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-      # PIC (with -KPIC) is the default.
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+-      ;;
+-
+-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+-      case $cc_basename in
+-      # old Intel for x86_64 which still supported -KPIC.
+-      ecc*)
+-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+-        ;;
+-      # icc used to be incompatible with GCC.
+-      # ICC 10 doesn't accept -KPIC any more.
+-      icc* | ifort*)
+-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+-        ;;
+-      # Lahey Fortran 8.1.
+-      lf95*)
+-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+-	;;
+-      nagfor*)
+-	# NAG Fortran compiler
+-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	;;
+-      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+-        # Portland Group compilers (*not* the Pentium gcc compiler,
+-	# which looks to be a dead project)
+-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-        ;;
+-      ccc*)
+-        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-        # All Alpha code is PIC.
+-        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+-        ;;
+-      xl* | bgxl* | bgf* | mpixl*)
+-	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+-	;;
+-      *)
+-	case `$CC -V 2>&1 | sed 5q` in
+-	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+-	  ;;
+-	*Sun\ F* | *Sun*Fortran*)
+-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+-	  ;;
+-	*Sun\ C*)
+-	  # Sun C 5.9
+-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	  ;;
+-        *Intel*\ [[CF]]*Compiler*)
+-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+-	  ;;
+-	*Portland\ Group*)
+-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-	  ;;
+-	esac
+-	;;
+-      esac
+-      ;;
+-
+-    newsos6)
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-      ;;
+-
+-    *nto* | *qnx*)
+-      # QNX uses GNU C++, but need to define -shared option too, otherwise
+-      # it will coredump.
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+-      ;;
+-
+-    osf3* | osf4* | osf5*)
+-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-      # All OSF/1 code is PIC.
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+-      ;;
+-
+-    rdos*)
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+-      ;;
+-
+-    solaris*)
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-      case $cc_basename in
+-      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+-      *)
+-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+-      esac
+-      ;;
+-
+-    sunos4*)
+-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-      ;;
+-
+-    sysv4 | sysv4.2uw2* | sysv4.3*)
+-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-      ;;
+-
+-    sysv4*MP*)
+-      if test -d /usr/nec ;then
+-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-      fi
+-      ;;
+-
+-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-      ;;
+-
+-    unicos*)
+-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+-      ;;
+-
+-    uts4*)
+-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-      ;;
+-
+-    *)
+-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+-      ;;
+-    esac
+-  fi
+-])
+-case $host_os in
+-  # For platforms which do not support PIC, -DPIC is meaningless:
+-  *djgpp*)
+-    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+-    ;;
+-  *)
+-    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+-    ;;
+-esac
+-
+-AC_CACHE_CHECK([for $compiler option to produce PIC],
+-  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+-  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+-_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+-
+-#
+-# Check to make sure the PIC flag actually works.
+-#
+-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+-  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+-    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+-    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+-    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+-     "" | " "*) ;;
+-     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+-     esac],
+-    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+-     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+-fi
+-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+-	[Additional compiler flags for building library objects])
+-
+-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+-	[How to pass a linker flag through the compiler])
+-#
+-# Check to make sure the static flag actually works.
+-#
+-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+-  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+-  $lt_tmp_static_flag,
+-  [],
+-  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+-	[Compiler flag to prevent dynamic linking])
+-])# _LT_COMPILER_PIC
+-
+-
+-# _LT_LINKER_SHLIBS([TAGNAME])
+-# ----------------------------
+-# See if the linker supports building shared libraries.
+-m4_defun([_LT_LINKER_SHLIBS],
+-[AC_REQUIRE([LT_PATH_LD])dnl
+-AC_REQUIRE([LT_PATH_NM])dnl
+-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-m4_require([_LT_DECL_EGREP])dnl
+-m4_require([_LT_DECL_SED])dnl
+-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+-m4_require([_LT_TAG_COMPILER])dnl
+-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+-m4_if([$1], [CXX], [
+-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+-  case $host_os in
+-  aix[[4-9]]*)
+-    # If we're using GNU nm, then we don't want the "-C" option.
+-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+-    # Also, AIX nm treats weak defined symbols like other global defined
+-    # symbols, whereas GNU nm marks them as "W".
+-    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+-    else
+-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+-    fi
+-    ;;
+-  pw32*)
+-    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+-    ;;
+-  cygwin* | mingw* | cegcc*)
+-    case $cc_basename in
+-    cl*)
+-      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+-      ;;
+-    *)
+-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+-      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+-      ;;
+-    esac
+-    ;;
+-  *)
+-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+-    ;;
+-  esac
+-], [
+-  runpath_var=
+-  _LT_TAGVAR(allow_undefined_flag, $1)=
+-  _LT_TAGVAR(always_export_symbols, $1)=no
+-  _LT_TAGVAR(archive_cmds, $1)=
+-  _LT_TAGVAR(archive_expsym_cmds, $1)=
+-  _LT_TAGVAR(compiler_needs_object, $1)=no
+-  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+-  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+-  _LT_TAGVAR(hardcode_automatic, $1)=no
+-  _LT_TAGVAR(hardcode_direct, $1)=no
+-  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+-  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+-  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+-  _LT_TAGVAR(hardcode_minus_L, $1)=no
+-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+-  _LT_TAGVAR(inherit_rpath, $1)=no
+-  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+-  _LT_TAGVAR(module_cmds, $1)=
+-  _LT_TAGVAR(module_expsym_cmds, $1)=
+-  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+-  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+-  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+-  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+-  # include_expsyms should be a list of space-separated symbols to be *always*
+-  # included in the symbol list
+-  _LT_TAGVAR(include_expsyms, $1)=
+-  # exclude_expsyms can be an extended regexp of symbols to exclude
+-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+-  # as well as any symbol that contains `d'.
+-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+-  # platforms (ab)use it in PIC code, but their linkers get confused if
+-  # the symbol is explicitly referenced.  Since portable code cannot
+-  # rely on this symbol name, it's probably fine to never include it in
+-  # preloaded symbol tables.
+-  # Exclude shared library initialization/finalization symbols.
+-dnl Note also adjust exclude_expsyms for C++ above.
+-  extract_expsyms_cmds=
+-
+-  case $host_os in
+-  cygwin* | mingw* | pw32* | cegcc*)
+-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+-    # When not using gcc, we currently assume that we are using
+-    # Microsoft Visual C++.
+-    if test "$GCC" != yes; then
+-      with_gnu_ld=no
+-    fi
+-    ;;
+-  interix*)
+-    # we just hope/assume this is gcc and not c89 (= MSVC++)
+-    with_gnu_ld=yes
+-    ;;
+-  openbsd*)
+-    with_gnu_ld=no
+-    ;;
+-  esac
+-
+-  _LT_TAGVAR(ld_shlibs, $1)=yes
+-
+-  # On some targets, GNU ld is compatible enough with the native linker
+-  # that we're better off using the native interface for both.
+-  lt_use_gnu_ld_interface=no
+-  if test "$with_gnu_ld" = yes; then
+-    case $host_os in
+-      aix*)
+-	# The AIX port of GNU ld has always aspired to compatibility
+-	# with the native linker.  However, as the warning in the GNU ld
+-	# block says, versions before 2.19.5* couldn't really create working
+-	# shared libraries, regardless of the interface used.
+-	case `$LD -v 2>&1` in
+-	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+-	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+-	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+-	  *)
+-	    lt_use_gnu_ld_interface=yes
+-	    ;;
+-	esac
+-	;;
+-      *)
+-	lt_use_gnu_ld_interface=yes
+-	;;
+-    esac
+-  fi
+-
+-  if test "$lt_use_gnu_ld_interface" = yes; then
+-    # If archive_cmds runs LD, not CC, wlarc should be empty
+-    wlarc='${wl}'
+-
+-    # Set some defaults for GNU ld with shared library support. These
+-    # are reset later if shared libraries are not supported. Putting them
+-    # here allows them to be overridden if necessary.
+-    runpath_var=LD_RUN_PATH
+-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+-    # ancient GNU ld didn't support --whole-archive et. al.
+-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+-      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+-    else
+-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+-    fi
+-    supports_anon_versioning=no
+-    case `$LD -v 2>&1` in
+-      *GNU\ gold*) supports_anon_versioning=yes ;;
+-      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+-      *\ 2.11.*) ;; # other 2.11 versions
+-      *) supports_anon_versioning=yes ;;
+-    esac
+-
+-    # See if GNU ld supports shared libraries.
+-    case $host_os in
+-    aix[[3-9]]*)
+-      # On AIX/PPC, the GNU linker is very broken
+-      if test "$host_cpu" != ia64; then
+-	_LT_TAGVAR(ld_shlibs, $1)=no
+-	cat <<_LT_EOF 1>&2
+-
+-*** Warning: the GNU linker, at least up to release 2.19, is reported
+-*** to be unable to reliably create shared libraries on AIX.
+-*** Therefore, libtool is disabling shared libraries support.  If you
+-*** really care for shared libraries, you may want to install binutils
+-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+-*** You will then need to restart the configuration process.
+-
+-_LT_EOF
+-      fi
+-      ;;
+-
+-    amigaos*)
+-      case $host_cpu in
+-      powerpc)
+-            # see comment about AmigaOS4 .so support
+-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+-        ;;
+-      m68k)
+-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+-        ;;
+-      esac
+-      ;;
+-
+-    beos*)
+-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+-	# support --undefined.  This deserves some investigation.  FIXME
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-      else
+-	_LT_TAGVAR(ld_shlibs, $1)=no
+-      fi
+-      ;;
+-
+-    cygwin* | mingw* | pw32* | cegcc*)
+-      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+-      # as there is no search path for DLLs.
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-      _LT_TAGVAR(always_export_symbols, $1)=no
+-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+-      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+-
+-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-	# If the export-symbols file already is a .def file (1st line
+-	# is EXPORTS), use it as is; otherwise, prepend...
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+-	  cp $export_symbols $output_objdir/$soname.def;
+-	else
+-	  echo EXPORTS > $output_objdir/$soname.def;
+-	  cat $export_symbols >> $output_objdir/$soname.def;
+-	fi~
+-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-      else
+-	_LT_TAGVAR(ld_shlibs, $1)=no
+-      fi
+-      ;;
+-
+-    haiku*)
+-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-      _LT_TAGVAR(link_all_deplibs, $1)=yes
+-      ;;
+-
+-    interix[[3-9]]*)
+-      _LT_TAGVAR(hardcode_direct, $1)=no
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+-      # Instead, shared libraries are loaded at an image base (0x10000000 by
+-      # default) and relocated if they conflict, which is a slow very memory
+-      # consuming and fragmenting process.  To avoid this, we pick a random,
+-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+-      ;;
+-
+-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+-      tmp_diet=no
+-      if test "$host_os" = linux-dietlibc; then
+-	case $cc_basename in
+-	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+-	esac
+-      fi
+-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+-	 && test "$tmp_diet" = no
+-      then
+-	tmp_addflag=' $pic_flag'
+-	tmp_sharedflag='-shared'
+-	case $cc_basename,$host_cpu in
+-        pgcc*)				# Portland Group C compiler
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+-	  tmp_addflag=' $pic_flag'
+-	  ;;
+-	pgf77* | pgf90* | pgf95* | pgfortran*)
+-					# Portland Group f77 and f90 compilers
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+-	  tmp_addflag=' $pic_flag -Mnomain' ;;
+-	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+-	  tmp_addflag=' -i_dynamic' ;;
+-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+-	ifc* | ifort*)			# Intel Fortran compiler
+-	  tmp_addflag=' -nofor_main' ;;
+-	lf95*)				# Lahey Fortran 8.1
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+-	  tmp_sharedflag='--shared' ;;
+-	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+-	  tmp_sharedflag='-qmkshrobj'
+-	  tmp_addflag= ;;
+-	nvcc*)	# Cuda Compiler Driver 2.2
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+-	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+-	  ;;
+-	esac
+-	case `$CC -V 2>&1 | sed 5q` in
+-	*Sun\ C*)			# Sun C 5.9
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+-	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+-	  tmp_sharedflag='-G' ;;
+-	*Sun\ F*)			# Sun Fortran 8.3
+-	  tmp_sharedflag='-G' ;;
+-	esac
+-	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-
+-        if test "x$supports_anon_versioning" = xyes; then
+-          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+-	    echo "local: *; };" >> $output_objdir/$libname.ver~
+-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+-        fi
+-
+-	case $cc_basename in
+-	xlf* | bgf* | bgxlf* | mpixlf*)
+-	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+-	  if test "x$supports_anon_versioning" = xyes; then
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+-	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+-	  fi
+-	  ;;
+-	esac
+-      else
+-        _LT_TAGVAR(ld_shlibs, $1)=no
+-      fi
+-      ;;
+-
+-    netbsd*)
+-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+-	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+-	wlarc=
+-      else
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+-      fi
+-      ;;
+-
+-    solaris*)
+-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+-	_LT_TAGVAR(ld_shlibs, $1)=no
+-	cat <<_LT_EOF 1>&2
+-
+-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+-*** create shared libraries on Solaris systems.  Therefore, libtool
+-*** is disabling shared libraries support.  We urge you to upgrade GNU
+-*** binutils to release 2.9.1 or newer.  Another option is to modify
+-*** your PATH or compiler configuration so that the native linker is
+-*** used, and then restart.
+-
+-_LT_EOF
+-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+-      else
+-	_LT_TAGVAR(ld_shlibs, $1)=no
+-      fi
+-      ;;
+-
+-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+-      case `$LD -v 2>&1` in
+-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+-	_LT_TAGVAR(ld_shlibs, $1)=no
+-	cat <<_LT_EOF 1>&2
+-
+-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+-*** reliably create shared libraries on SCO systems.  Therefore, libtool
+-*** is disabling shared libraries support.  We urge you to upgrade GNU
+-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+-*** your PATH or compiler configuration so that the native linker is
+-*** used, and then restart.
+-
+-_LT_EOF
+-	;;
+-	*)
+-	  # For security reasons, it is highly recommended that you always
+-	  # use absolute paths for naming shared libraries, and exclude the
+-	  # DT_RUNPATH tag from executables and libraries.  But doing so
+-	  # requires that you compile everything twice, which is a pain.
+-	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+-	  else
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	  fi
+-	;;
+-      esac
+-      ;;
+-
+-    sunos4*)
+-      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+-      wlarc=
+-      _LT_TAGVAR(hardcode_direct, $1)=yes
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      ;;
+-
+-    *)
+-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+-      else
+-	_LT_TAGVAR(ld_shlibs, $1)=no
+-      fi
+-      ;;
+-    esac
+-
+-    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+-      runpath_var=
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+-    fi
+-  else
+-    # PORTME fill in a description of your system's linker (not GNU ld)
+-    case $host_os in
+-    aix3*)
+-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-      _LT_TAGVAR(always_export_symbols, $1)=yes
+-      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+-      # Note: this linker hardcodes the directories in LIBPATH if there
+-      # are no directories specified by -L.
+-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+-	# Neither direct hardcoding nor static linking is supported with a
+-	# broken collect2.
+-	_LT_TAGVAR(hardcode_direct, $1)=unsupported
+-      fi
+-      ;;
+-
+-    aix[[4-9]]*)
+-      if test "$host_cpu" = ia64; then
+-	# On IA64, the linker does run time linking by default, so we don't
+-	# have to do anything special.
+-	aix_use_runtimelinking=no
+-	exp_sym_flag='-Bexport'
+-	no_entry_flag=""
+-      else
+-	# If we're using GNU nm, then we don't want the "-C" option.
+-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+-	# Also, AIX nm treats weak defined symbols like other global
+-	# defined symbols, whereas GNU nm marks them as "W".
+-	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+-	else
+-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+-	fi
+-	aix_use_runtimelinking=no
+-
+-	# Test if we are trying to use run time linking or normal
+-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+-	# need to do runtime linking.
+-	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+-	  for ld_flag in $LDFLAGS; do
+-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+-	    aix_use_runtimelinking=yes
+-	    break
+-	  fi
+-	  done
+-	  ;;
+-	esac
+-
+-	exp_sym_flag='-bexport'
+-	no_entry_flag='-bnoentry'
+-      fi
+-
+-      # When large executables or shared objects are built, AIX ld can
+-      # have problems creating the table of contents.  If linking a library
+-      # or program results in "error TOC overflow" add -mminimal-toc to
+-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+-
+-      _LT_TAGVAR(archive_cmds, $1)=''
+-      _LT_TAGVAR(hardcode_direct, $1)=yes
+-      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+-      _LT_TAGVAR(link_all_deplibs, $1)=yes
+-      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+-
+-      if test "$GCC" = yes; then
+-	case $host_os in aix4.[[012]]|aix4.[[012]].*)
+-	# We only want to do this on AIX 4.2 and lower, the check
+-	# below for broken collect2 doesn't work under 4.3+
+-	  collect2name=`${CC} -print-prog-name=collect2`
+-	  if test -f "$collect2name" &&
+-	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+-	  then
+-	  # We have reworked collect2
+-	  :
+-	  else
+-	  # We have old collect2
+-	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
+-	  # It fails to find uninstalled libraries when the uninstalled
+-	  # path is not listed in the libpath.  Setting hardcode_minus_L
+-	  # to unsupported forces relinking
+-	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+-	  fi
+-	  ;;
+-	esac
+-	shared_flag='-shared'
+-	if test "$aix_use_runtimelinking" = yes; then
+-	  shared_flag="$shared_flag "'${wl}-G'
+-	fi
+-      else
+-	# not using gcc
+-	if test "$host_cpu" = ia64; then
+-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+-	# chokes on -Wl,-G. The following line is correct:
+-	  shared_flag='-G'
+-	else
+-	  if test "$aix_use_runtimelinking" = yes; then
+-	    shared_flag='${wl}-G'
+-	  else
+-	    shared_flag='${wl}-bM:SRE'
+-	  fi
+-	fi
+-      fi
+-
+-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+-      # It seems that -bexpall does not export symbols beginning with
+-      # underscore (_), so it is better to generate a list of symbols to export.
+-      _LT_TAGVAR(always_export_symbols, $1)=yes
+-      if test "$aix_use_runtimelinking" = yes; then
+-	# Warning - without using the other runtime loading flags (-brtl),
+-	# -berok will link without error, but may produce a broken library.
+-	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+-        # Determine the default libpath from the value encoded in an
+-        # empty executable.
+-        _LT_SYS_MODULE_PATH_AIX([$1])
+-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+-      else
+-	if test "$host_cpu" = ia64; then
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+-	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+-	else
+-	 # Determine the default libpath from the value encoded in an
+-	 # empty executable.
+-	 _LT_SYS_MODULE_PATH_AIX([$1])
+-	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+-	  # Warning - without using the other run time loading flags,
+-	  # -berok will link without error, but may produce a broken library.
+-	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+-	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+-	  if test "$with_gnu_ld" = yes; then
+-	    # We only use this code for GNU lds that support --whole-archive.
+-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+-	  else
+-	    # Exported symbols can be pulled into shared objects from archives
+-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+-	  fi
+-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+-	  # This is similar to how AIX traditionally builds its shared libraries.
+-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+-	fi
+-      fi
+-      ;;
+-
+-    amigaos*)
+-      case $host_cpu in
+-      powerpc)
+-            # see comment about AmigaOS4 .so support
+-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+-        ;;
+-      m68k)
+-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+-        ;;
+-      esac
+-      ;;
+-
+-    bsdi[[45]]*)
+-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+-      ;;
+-
+-    cygwin* | mingw* | pw32* | cegcc*)
+-      # When not using gcc, we currently assume that we are using
+-      # Microsoft Visual C++.
+-      # hardcode_libdir_flag_spec is actually meaningless, as there is
+-      # no search path for DLLs.
+-      case $cc_basename in
+-      cl*)
+-	# Native MSVC
+-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-	_LT_TAGVAR(always_export_symbols, $1)=yes
+-	_LT_TAGVAR(file_list_spec, $1)='@'
+-	# Tell ltmain to make .lib files, not .a files.
+-	libext=lib
+-	# Tell ltmain to make .dll files, not .so files.
+-	shrext_cmds=".dll"
+-	# FIXME: Setting linknames here is a bad hack.
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+-	  else
+-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+-	  fi~
+-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+-	  linknames='
+-	# The linker will not automatically build a static lib if we build a DLL.
+-	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+-	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+-	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+-	# Don't use ranlib
+-	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+-	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+-	  case $lt_outputfile in
+-	    *.exe|*.EXE) ;;
+-	    *)
+-	      lt_outputfile="$lt_outputfile.exe"
+-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+-	      ;;
+-	  esac~
+-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+-	    $RM "$lt_outputfile.manifest";
+-	  fi'
+-	;;
+-      *)
+-	# Assume MSVC wrapper
+-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-	# Tell ltmain to make .lib files, not .a files.
+-	libext=lib
+-	# Tell ltmain to make .dll files, not .so files.
+-	shrext_cmds=".dll"
+-	# FIXME: Setting linknames here is a bad hack.
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-	# The linker will automatically build a .lib file if we build a DLL.
+-	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+-	# FIXME: Should let the user specify the lib program.
+-	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-	;;
+-      esac
+-      ;;
+-
+-    darwin* | rhapsody*)
+-      _LT_DARWIN_LINKER_FEATURES($1)
+-      ;;
+-
+-    dgux*)
+-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      ;;
+-
+-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+-    # support.  Future versions do this automatically, but an explicit c++rt0.o
+-    # does not break anything, and helps significantly (at the cost of a little
+-    # extra space).
+-    freebsd2.2*)
+-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+-      _LT_TAGVAR(hardcode_direct, $1)=yes
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      ;;
+-
+-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+-    freebsd2.*)
+-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+-      _LT_TAGVAR(hardcode_direct, $1)=yes
+-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      ;;
+-
+-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+-    freebsd* | dragonfly*)
+-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+-      _LT_TAGVAR(hardcode_direct, $1)=yes
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      ;;
+-
+-    hpux9*)
+-      if test "$GCC" = yes; then
+-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+-      else
+-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+-      fi
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-      _LT_TAGVAR(hardcode_direct, $1)=yes
+-
+-      # hardcode_minus_L: Not really in the search PATH,
+-      # but as the default location of the library.
+-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+-      ;;
+-
+-    hpux10*)
+-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+-      else
+-	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+-      fi
+-      if test "$with_gnu_ld" = no; then
+-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+-	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-	_LT_TAGVAR(hardcode_direct, $1)=yes
+-	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+-	# hardcode_minus_L: Not really in the search PATH,
+-	# but as the default location of the library.
+-	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+-      fi
+-      ;;
+-
+-    hpux11*)
+-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	case $host_cpu in
+-	hppa*64*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	  ;;
+-	ia64*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+-	  ;;
+-	*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+-	  ;;
+-	esac
+-      else
+-	case $host_cpu in
+-	hppa*64*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	  ;;
+-	ia64*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+-	  ;;
+-	*)
+-	m4_if($1, [], [
+-	  # Older versions of the 11.00 compiler do not understand -b yet
+-	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+-	  _LT_LINKER_OPTION([if $CC understands -b],
+-	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+-	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+-	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+-	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+-	  ;;
+-	esac
+-      fi
+-      if test "$with_gnu_ld" = no; then
+-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+-	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-
+-	case $host_cpu in
+-	hppa*64*|ia64*)
+-	  _LT_TAGVAR(hardcode_direct, $1)=no
+-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-	  ;;
+-	*)
+-	  _LT_TAGVAR(hardcode_direct, $1)=yes
+-	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+-
+-	  # hardcode_minus_L: Not really in the search PATH,
+-	  # but as the default location of the library.
+-	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+-	  ;;
+-	esac
+-      fi
+-      ;;
+-
+-    irix5* | irix6* | nonstopux*)
+-      if test "$GCC" = yes; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+-	# Try to use the -exported_symbol ld option, if it does not
+-	# work, assume that -exports_file does not work either and
+-	# implicitly export all symbols.
+-	# This should be the same for all languages, so no per-tag cache variable.
+-	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+-	  [lt_cv_irix_exported_symbol],
+-	  [save_LDFLAGS="$LDFLAGS"
+-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-	   AC_LINK_IFELSE(
+-	     [AC_LANG_SOURCE(
+-	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+-			      [C++], [[int foo (void) { return 0; }]],
+-			      [Fortran 77], [[
+-      subroutine foo
+-      end]],
+-			      [Fortran], [[
+-      subroutine foo
+-      end]])])],
+-	      [lt_cv_irix_exported_symbol=yes],
+-	      [lt_cv_irix_exported_symbol=no])
+-           LDFLAGS="$save_LDFLAGS"])
+-	if test "$lt_cv_irix_exported_symbol" = yes; then
+-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-	fi
+-      else
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+-      fi
+-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-      _LT_TAGVAR(inherit_rpath, $1)=yes
+-      _LT_TAGVAR(link_all_deplibs, $1)=yes
+-      ;;
+-
+-    netbsd*)
+-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+-	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+-      else
+-	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+-      fi
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+-      _LT_TAGVAR(hardcode_direct, $1)=yes
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      ;;
+-
+-    newsos6)
+-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+-      _LT_TAGVAR(hardcode_direct, $1)=yes
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      ;;
+-
+-    *nto* | *qnx*)
+-      ;;
+-
+-    openbsd*)
+-      if test -f /usr/libexec/ld.so; then
+-	_LT_TAGVAR(hardcode_direct, $1)=yes
+-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+-	else
+-	  case $host_os in
+-	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+-	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+-	     ;;
+-	   *)
+-	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+-	     ;;
+-	  esac
+-	fi
+-      else
+-	_LT_TAGVAR(ld_shlibs, $1)=no
+-      fi
+-      ;;
+-
+-    os2*)
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+-      ;;
+-
+-    osf3*)
+-      if test "$GCC" = yes; then
+-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+-      else
+-	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+-      fi
+-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-      ;;
+-
+-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+-      if test "$GCC" = yes; then
+-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-      else
+-	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+-
+-	# Both c and cxx compiler support -rpath directly
+-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+-      fi
+-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-      ;;
+-
+-    solaris*)
+-      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+-      if test "$GCC" = yes; then
+-	wlarc='${wl}'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+-      else
+-	case `$CC -V 2>&1` in
+-	*"Compilers 5.0"*)
+-	  wlarc=''
+-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+-	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+-	  ;;
+-	*)
+-	  wlarc='${wl}'
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+-	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+-	  ;;
+-	esac
+-      fi
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      case $host_os in
+-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+-      *)
+-	# The compiler driver will combine and reorder linker options,
+-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+-	# but is careful enough not to reorder.
+-	# Supported since Solaris 2.6 (maybe 2.5.1?)
+-	if test "$GCC" = yes; then
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+-	else
+-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+-	fi
+-	;;
+-      esac
+-      _LT_TAGVAR(link_all_deplibs, $1)=yes
+-      ;;
+-
+-    sunos4*)
+-      if test "x$host_vendor" = xsequent; then
+-	# Use $CC to link under sequent, because it throws in some extra .o
+-	# files that make .init and .fini sections work.
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+-      else
+-	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+-      fi
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-      _LT_TAGVAR(hardcode_direct, $1)=yes
+-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      ;;
+-
+-    sysv4)
+-      case $host_vendor in
+-	sni)
+-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+-	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+-	;;
+-	siemens)
+-	  ## LD is ld it makes a PLAMLIB
+-	  ## CC just makes a GrossModule.
+-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+-	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+-	  _LT_TAGVAR(hardcode_direct, $1)=no
+-        ;;
+-	motorola)
+-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+-	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+-	;;
+-      esac
+-      runpath_var='LD_RUN_PATH'
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      ;;
+-
+-    sysv4.3*)
+-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+-      ;;
+-
+-    sysv4*MP*)
+-      if test -d /usr/nec; then
+-	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-	runpath_var=LD_RUN_PATH
+-	hardcode_runpath_var=yes
+-	_LT_TAGVAR(ld_shlibs, $1)=yes
+-      fi
+-      ;;
+-
+-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      runpath_var='LD_RUN_PATH'
+-
+-      if test "$GCC" = yes; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-      else
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-      fi
+-      ;;
+-
+-    sysv5* | sco3.2v5* | sco5v6*)
+-      # Note: We can NOT use -z defs as we might desire, because we do not
+-      # link with -lc, and that would cause any symbols used from libc to
+-      # always be unresolved, which means just about no library would
+-      # ever link correctly.  If we're not using GNU ld we use -z text
+-      # though, which does catch some bad symbols but isn't as heavy-handed
+-      # as -z defs.
+-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+-      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+-      _LT_TAGVAR(link_all_deplibs, $1)=yes
+-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+-      runpath_var='LD_RUN_PATH'
+-
+-      if test "$GCC" = yes; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-      else
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-      fi
+-      ;;
+-
+-    uts4*)
+-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      ;;
+-
+-    *)
+-      _LT_TAGVAR(ld_shlibs, $1)=no
+-      ;;
+-    esac
+-
+-    if test x$host_vendor = xsni; then
+-      case $host in
+-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+-	;;
+-      esac
+-    fi
+-  fi
+-])
+-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+-
+-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+-
+-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+-_LT_DECL([], [extract_expsyms_cmds], [2],
+-    [The commands to extract the exported symbol list from a shared archive])
+-
+-#
+-# Do we need to explicitly link libc?
+-#
+-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+-x|xyes)
+-  # Assume -lc should be added
+-  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+-
+-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+-    case $_LT_TAGVAR(archive_cmds, $1) in
+-    *'~'*)
+-      # FIXME: we may have to deal with multi-command sequences.
+-      ;;
+-    '$CC '*)
+-      # Test whether the compiler implicitly links with -lc since on some
+-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+-      # to ld, don't add -lc before -lgcc.
+-      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+-	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+-	[$RM conftest*
+-	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+-
+-	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+-	  soname=conftest
+-	  lib=conftest
+-	  libobjs=conftest.$ac_objext
+-	  deplibs=
+-	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+-	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+-	  compiler_flags=-v
+-	  linker_flags=-v
+-	  verstring=
+-	  output_objdir=.
+-	  libname=conftest
+-	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+-	  _LT_TAGVAR(allow_undefined_flag, $1)=
+-	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+-	  then
+-	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-	  else
+-	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+-	  fi
+-	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+-	else
+-	  cat conftest.err 1>&5
+-	fi
+-	$RM conftest*
+-	])
+-      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+-      ;;
+-    esac
+-  fi
+-  ;;
+-esac
+-
+-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+-    [Whether or not to add -lc for building shared libraries])
+-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+-    [enable_shared_with_static_runtimes], [0],
+-    [Whether or not to disallow shared libs when runtime libs are static])
+-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+-    [Compiler flag to allow reflexive dlopens])
+-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+-    [Compiler flag to generate shared objects directly from archives])
+-_LT_TAGDECL([], [compiler_needs_object], [1],
+-    [Whether the compiler copes with passing no objects directly])
+-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+-    [Create an old-style archive from a shared archive])
+-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+-    [Create a temporary old-style archive to link instead of a shared archive])
+-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+-_LT_TAGDECL([], [archive_expsym_cmds], [2])
+-_LT_TAGDECL([], [module_cmds], [2],
+-    [Commands used to build a loadable module if different from building
+-    a shared archive.])
+-_LT_TAGDECL([], [module_expsym_cmds], [2])
+-_LT_TAGDECL([], [with_gnu_ld], [1],
+-    [Whether we are building with GNU ld or not])
+-_LT_TAGDECL([], [allow_undefined_flag], [1],
+-    [Flag that allows shared libraries with undefined symbols to be built])
+-_LT_TAGDECL([], [no_undefined_flag], [1],
+-    [Flag that enforces no undefined symbols])
+-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+-    [Flag to hardcode $libdir into a binary during linking.
+-    This must work even if $libdir does not exist])
+-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+-    [Whether we need a single "-rpath" flag with a separated argument])
+-_LT_TAGDECL([], [hardcode_direct], [0],
+-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+-    DIR into the resulting binary])
+-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+-    DIR into the resulting binary and the resulting library dependency is
+-    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+-    library is relocated])
+-_LT_TAGDECL([], [hardcode_minus_L], [0],
+-    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+-    into the resulting binary])
+-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+-    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+-    into the resulting binary])
+-_LT_TAGDECL([], [hardcode_automatic], [0],
+-    [Set to "yes" if building a shared library automatically hardcodes DIR
+-    into the library and all subsequent libraries and executables linked
+-    against it])
+-_LT_TAGDECL([], [inherit_rpath], [0],
+-    [Set to yes if linker adds runtime paths of dependent libraries
+-    to runtime path list])
+-_LT_TAGDECL([], [link_all_deplibs], [0],
+-    [Whether libtool must link a program against all its dependency libraries])
+-_LT_TAGDECL([], [always_export_symbols], [0],
+-    [Set to "yes" if exported symbols are required])
+-_LT_TAGDECL([], [export_symbols_cmds], [2],
+-    [The commands to list exported symbols])
+-_LT_TAGDECL([], [exclude_expsyms], [1],
+-    [Symbols that should not be listed in the preloaded symbols])
+-_LT_TAGDECL([], [include_expsyms], [1],
+-    [Symbols that must always be exported])
+-_LT_TAGDECL([], [prelink_cmds], [2],
+-    [Commands necessary for linking programs (against libraries) with templates])
+-_LT_TAGDECL([], [postlink_cmds], [2],
+-    [Commands necessary for finishing linking programs])
+-_LT_TAGDECL([], [file_list_spec], [1],
+-    [Specify filename containing input files])
+-dnl FIXME: Not yet implemented
+-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+-dnl    [Compiler flag to generate thread safe objects])
+-])# _LT_LINKER_SHLIBS
+-
+-
+-# _LT_LANG_C_CONFIG([TAG])
+-# ------------------------
+-# Ensure that the configuration variables for a C compiler are suitably
+-# defined.  These variables are subsequently used by _LT_CONFIG to write
+-# the compiler configuration to `libtool'.
+-m4_defun([_LT_LANG_C_CONFIG],
+-[m4_require([_LT_DECL_EGREP])dnl
+-lt_save_CC="$CC"
+-AC_LANG_PUSH(C)
+-
+-# Source file extension for C test sources.
+-ac_ext=c
+-
+-# Object file extension for compiled C test sources.
+-objext=o
+-_LT_TAGVAR(objext, $1)=$objext
+-
+-# Code to be used in simple compile tests
+-lt_simple_compile_test_code="int some_variable = 0;"
+-
+-# Code to be used in simple link tests
+-lt_simple_link_test_code='int main(){return(0);}'
+-
+-_LT_TAG_COMPILER
+-# Save the default compiler, since it gets overwritten when the other
+-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+-compiler_DEFAULT=$CC
+-
+-# save warnings/boilerplate of simple test code
+-_LT_COMPILER_BOILERPLATE
+-_LT_LINKER_BOILERPLATE
+-
+-## CAVEAT EMPTOR:
+-## There is no encapsulation within the following macros, do not change
+-## the running order or otherwise move them around unless you know exactly
+-## what you are doing...
+-if test -n "$compiler"; then
+-  _LT_COMPILER_NO_RTTI($1)
+-  _LT_COMPILER_PIC($1)
+-  _LT_COMPILER_C_O($1)
+-  _LT_COMPILER_FILE_LOCKS($1)
+-  _LT_LINKER_SHLIBS($1)
+-  _LT_SYS_DYNAMIC_LINKER($1)
+-  _LT_LINKER_HARDCODE_LIBPATH($1)
+-  LT_SYS_DLOPEN_SELF
+-  _LT_CMD_STRIPLIB
+-
+-  # Report which library types will actually be built
+-  AC_MSG_CHECKING([if libtool supports shared libraries])
+-  AC_MSG_RESULT([$can_build_shared])
+-
+-  AC_MSG_CHECKING([whether to build shared libraries])
+-  test "$can_build_shared" = "no" && enable_shared=no
+-
+-  # On AIX, shared libraries and static libraries use the same namespace, and
+-  # are all built from PIC.
+-  case $host_os in
+-  aix3*)
+-    test "$enable_shared" = yes && enable_static=no
+-    if test -n "$RANLIB"; then
+-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+-      postinstall_cmds='$RANLIB $lib'
+-    fi
+-    ;;
+-
+-  aix[[4-9]]*)
+-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+-      test "$enable_shared" = yes && enable_static=no
+-    fi
+-    ;;
+-  esac
+-  AC_MSG_RESULT([$enable_shared])
+-
+-  AC_MSG_CHECKING([whether to build static libraries])
+-  # Make sure either enable_shared or enable_static is yes.
+-  test "$enable_shared" = yes || enable_static=yes
+-  AC_MSG_RESULT([$enable_static])
+-
+-  _LT_CONFIG($1)
+-fi
+-AC_LANG_POP
+-CC="$lt_save_CC"
+-])# _LT_LANG_C_CONFIG
+-
+-
+-# _LT_LANG_CXX_CONFIG([TAG])
+-# --------------------------
+-# Ensure that the configuration variables for a C++ compiler are suitably
+-# defined.  These variables are subsequently used by _LT_CONFIG to write
+-# the compiler configuration to `libtool'.
+-m4_defun([_LT_LANG_CXX_CONFIG],
+-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-m4_require([_LT_DECL_EGREP])dnl
+-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+-    (test "X$CXX" != "Xg++"))) ; then
+-  AC_PROG_CXXCPP
+-else
+-  _lt_caught_CXX_error=yes
+-fi
+-
+-AC_LANG_PUSH(C++)
+-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-_LT_TAGVAR(allow_undefined_flag, $1)=
+-_LT_TAGVAR(always_export_symbols, $1)=no
+-_LT_TAGVAR(archive_expsym_cmds, $1)=
+-_LT_TAGVAR(compiler_needs_object, $1)=no
+-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+-_LT_TAGVAR(hardcode_direct, $1)=no
+-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+-_LT_TAGVAR(hardcode_libdir_separator, $1)=
+-_LT_TAGVAR(hardcode_minus_L, $1)=no
+-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+-_LT_TAGVAR(hardcode_automatic, $1)=no
+-_LT_TAGVAR(inherit_rpath, $1)=no
+-_LT_TAGVAR(module_cmds, $1)=
+-_LT_TAGVAR(module_expsym_cmds, $1)=
+-_LT_TAGVAR(link_all_deplibs, $1)=unknown
+-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+-_LT_TAGVAR(reload_flag, $1)=$reload_flag
+-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+-_LT_TAGVAR(no_undefined_flag, $1)=
+-_LT_TAGVAR(whole_archive_flag_spec, $1)=
+-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+-
+-# Source file extension for C++ test sources.
+-ac_ext=cpp
+-
+-# Object file extension for compiled C++ test sources.
+-objext=o
+-_LT_TAGVAR(objext, $1)=$objext
+-
+-# No sense in running all these tests if we already determined that
+-# the CXX compiler isn't working.  Some variables (like enable_shared)
+-# are currently assumed to apply to all compilers on this platform,
+-# and will be corrupted by setting them based on a non-working compiler.
+-if test "$_lt_caught_CXX_error" != yes; then
+-  # Code to be used in simple compile tests
+-  lt_simple_compile_test_code="int some_variable = 0;"
+-
+-  # Code to be used in simple link tests
+-  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+-
+-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+-  _LT_TAG_COMPILER
+-
+-  # save warnings/boilerplate of simple test code
+-  _LT_COMPILER_BOILERPLATE
+-  _LT_LINKER_BOILERPLATE
+-
+-  # Allow CC to be a program name with arguments.
+-  lt_save_CC=$CC
+-  lt_save_CFLAGS=$CFLAGS
+-  lt_save_LD=$LD
+-  lt_save_GCC=$GCC
+-  GCC=$GXX
+-  lt_save_with_gnu_ld=$with_gnu_ld
+-  lt_save_path_LD=$lt_cv_path_LD
+-  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+-    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+-  else
+-    $as_unset lt_cv_prog_gnu_ld
+-  fi
+-  if test -n "${lt_cv_path_LDCXX+set}"; then
+-    lt_cv_path_LD=$lt_cv_path_LDCXX
+-  else
+-    $as_unset lt_cv_path_LD
+-  fi
+-  test -z "${LDCXX+set}" || LD=$LDCXX
+-  CC=${CXX-"c++"}
+-  CFLAGS=$CXXFLAGS
+-  compiler=$CC
+-  _LT_TAGVAR(compiler, $1)=$CC
+-  _LT_CC_BASENAME([$compiler])
+-
+-  if test -n "$compiler"; then
+-    # We don't want -fno-exception when compiling C++ code, so set the
+-    # no_builtin_flag separately
+-    if test "$GXX" = yes; then
+-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+-    else
+-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+-    fi
+-
+-    if test "$GXX" = yes; then
+-      # Set up default GNU C++ configuration
+-
+-      LT_PATH_LD
+-
+-      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+-      # archiving commands below assume that GNU ld is being used.
+-      if test "$with_gnu_ld" = yes; then
+-        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+-
+-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+-
+-        # If archive_cmds runs LD, not CC, wlarc should be empty
+-        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+-        #     investigate it a little bit more. (MM)
+-        wlarc='${wl}'
+-
+-        # ancient GNU ld didn't support --whole-archive et. al.
+-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+-	  $GREP 'no-whole-archive' > /dev/null; then
+-          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+-        else
+-          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+-        fi
+-      else
+-        with_gnu_ld=no
+-        wlarc=
+-
+-        # A generic and very simple default shared library creation
+-        # command for GNU C++ for the case where it uses the native
+-        # linker, instead of GNU ld.  If possible, this setting should
+-        # overridden to take advantage of the native linker features on
+-        # the platform it is being used on.
+-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+-      fi
+-
+-      # Commands to make compiler produce verbose output that lists
+-      # what "hidden" libraries, object files and flags are used when
+-      # linking a shared library.
+-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+-
+-    else
+-      GXX=no
+-      with_gnu_ld=no
+-      wlarc=
+-    fi
+-
+-    # PORTME: fill in a description of your system's C++ link characteristics
+-    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+-    _LT_TAGVAR(ld_shlibs, $1)=yes
+-    case $host_os in
+-      aix3*)
+-        # FIXME: insert proper C++ library support
+-        _LT_TAGVAR(ld_shlibs, $1)=no
+-        ;;
+-      aix[[4-9]]*)
+-        if test "$host_cpu" = ia64; then
+-          # On IA64, the linker does run time linking by default, so we don't
+-          # have to do anything special.
+-          aix_use_runtimelinking=no
+-          exp_sym_flag='-Bexport'
+-          no_entry_flag=""
+-        else
+-          aix_use_runtimelinking=no
+-
+-          # Test if we are trying to use run time linking or normal
+-          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+-          # need to do runtime linking.
+-          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+-	    for ld_flag in $LDFLAGS; do
+-	      case $ld_flag in
+-	      *-brtl*)
+-	        aix_use_runtimelinking=yes
+-	        break
+-	        ;;
+-	      esac
+-	    done
+-	    ;;
+-          esac
+-
+-          exp_sym_flag='-bexport'
+-          no_entry_flag='-bnoentry'
+-        fi
+-
+-        # When large executables or shared objects are built, AIX ld can
+-        # have problems creating the table of contents.  If linking a library
+-        # or program results in "error TOC overflow" add -mminimal-toc to
+-        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+-        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+-
+-        _LT_TAGVAR(archive_cmds, $1)=''
+-        _LT_TAGVAR(hardcode_direct, $1)=yes
+-        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+-        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+-        _LT_TAGVAR(link_all_deplibs, $1)=yes
+-        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+-
+-        if test "$GXX" = yes; then
+-          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+-          # We only want to do this on AIX 4.2 and lower, the check
+-          # below for broken collect2 doesn't work under 4.3+
+-	  collect2name=`${CC} -print-prog-name=collect2`
+-	  if test -f "$collect2name" &&
+-	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+-	  then
+-	    # We have reworked collect2
+-	    :
+-	  else
+-	    # We have old collect2
+-	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
+-	    # It fails to find uninstalled libraries when the uninstalled
+-	    # path is not listed in the libpath.  Setting hardcode_minus_L
+-	    # to unsupported forces relinking
+-	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
+-	  fi
+-          esac
+-          shared_flag='-shared'
+-	  if test "$aix_use_runtimelinking" = yes; then
+-	    shared_flag="$shared_flag "'${wl}-G'
+-	  fi
+-        else
+-          # not using gcc
+-          if test "$host_cpu" = ia64; then
+-	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+-	  # chokes on -Wl,-G. The following line is correct:
+-	  shared_flag='-G'
+-          else
+-	    if test "$aix_use_runtimelinking" = yes; then
+-	      shared_flag='${wl}-G'
+-	    else
+-	      shared_flag='${wl}-bM:SRE'
+-	    fi
+-          fi
+-        fi
+-
+-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+-        # It seems that -bexpall does not export symbols beginning with
+-        # underscore (_), so it is better to generate a list of symbols to
+-	# export.
+-        _LT_TAGVAR(always_export_symbols, $1)=yes
+-        if test "$aix_use_runtimelinking" = yes; then
+-          # Warning - without using the other runtime loading flags (-brtl),
+-          # -berok will link without error, but may produce a broken library.
+-          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+-          # Determine the default libpath from the value encoded in an empty
+-          # executable.
+-          _LT_SYS_MODULE_PATH_AIX([$1])
+-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+-
+-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+-        else
+-          if test "$host_cpu" = ia64; then
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+-	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+-          else
+-	    # Determine the default libpath from the value encoded in an
+-	    # empty executable.
+-	    _LT_SYS_MODULE_PATH_AIX([$1])
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+-	    # Warning - without using the other run time loading flags,
+-	    # -berok will link without error, but may produce a broken library.
+-	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+-	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+-	    if test "$with_gnu_ld" = yes; then
+-	      # We only use this code for GNU lds that support --whole-archive.
+-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+-	    else
+-	      # Exported symbols can be pulled into shared objects from archives
+-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+-	    fi
+-	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+-	    # This is similar to how AIX traditionally builds its shared
+-	    # libraries.
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+-          fi
+-        fi
+-        ;;
+-
+-      beos*)
+-	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+-	  # support --undefined.  This deserves some investigation.  FIXME
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	else
+-	  _LT_TAGVAR(ld_shlibs, $1)=no
+-	fi
+-	;;
+-
+-      chorus*)
+-        case $cc_basename in
+-          *)
+-	  # FIXME: insert proper C++ library support
+-	  _LT_TAGVAR(ld_shlibs, $1)=no
+-	  ;;
+-        esac
+-        ;;
+-
+-      cygwin* | mingw* | pw32* | cegcc*)
+-	case $GXX,$cc_basename in
+-	,cl* | no,cl*)
+-	  # Native MSVC
+-	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+-	  # no search path for DLLs.
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+-	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-	  _LT_TAGVAR(always_export_symbols, $1)=yes
+-	  _LT_TAGVAR(file_list_spec, $1)='@'
+-	  # Tell ltmain to make .lib files, not .a files.
+-	  libext=lib
+-	  # Tell ltmain to make .dll files, not .so files.
+-	  shrext_cmds=".dll"
+-	  # FIXME: Setting linknames here is a bad hack.
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+-	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+-	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+-	    else
+-	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+-	    fi~
+-	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+-	    linknames='
+-	  # The linker will not automatically build a static lib if we build a DLL.
+-	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+-	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-	  # Don't use ranlib
+-	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+-	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+-	    lt_tool_outputfile="@TOOL_OUTPUT@"~
+-	    case $lt_outputfile in
+-	      *.exe|*.EXE) ;;
+-	      *)
+-		lt_outputfile="$lt_outputfile.exe"
+-		lt_tool_outputfile="$lt_tool_outputfile.exe"
+-		;;
+-	    esac~
+-	    func_to_tool_file "$lt_outputfile"~
+-	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+-	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+-	      $RM "$lt_outputfile.manifest";
+-	    fi'
+-	  ;;
+-	*)
+-	  # g++
+-	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+-	  # as there is no search path for DLLs.
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+-	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-	  _LT_TAGVAR(always_export_symbols, $1)=no
+-	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-
+-	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-	    # If the export-symbols file already is a .def file (1st line
+-	    # is EXPORTS), use it as is; otherwise, prepend...
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+-	      cp $export_symbols $output_objdir/$soname.def;
+-	    else
+-	      echo EXPORTS > $output_objdir/$soname.def;
+-	      cat $export_symbols >> $output_objdir/$soname.def;
+-	    fi~
+-	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-	  else
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	  fi
+-	  ;;
+-	esac
+-	;;
+-      darwin* | rhapsody*)
+-        _LT_DARWIN_LINKER_FEATURES($1)
+-	;;
+-
+-      dgux*)
+-        case $cc_basename in
+-          ec++*)
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-          ghcx*)
+-	    # Green Hills C++ Compiler
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-          *)
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-        esac
+-        ;;
+-
+-      freebsd2.*)
+-        # C++ shared libraries reported to be fairly broken before
+-	# switch to ELF
+-        _LT_TAGVAR(ld_shlibs, $1)=no
+-        ;;
+-
+-      freebsd-elf*)
+-        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-        ;;
+-
+-      freebsd* | dragonfly*)
+-        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+-        # conventions
+-        _LT_TAGVAR(ld_shlibs, $1)=yes
+-        ;;
+-
+-      gnu*)
+-        ;;
+-
+-      haiku*)
+-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-        _LT_TAGVAR(link_all_deplibs, $1)=yes
+-        ;;
+-
+-      hpux9*)
+-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+-        _LT_TAGVAR(hardcode_direct, $1)=yes
+-        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+-				             # but as the default
+-				             # location of the library.
+-
+-        case $cc_basename in
+-          CC*)
+-            # FIXME: insert proper C++ library support
+-            _LT_TAGVAR(ld_shlibs, $1)=no
+-            ;;
+-          aCC*)
+-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+-            # Commands to make compiler produce verbose output that lists
+-            # what "hidden" libraries, object files and flags are used when
+-            # linking a shared library.
+-            #
+-            # There doesn't appear to be a way to prevent this compiler from
+-            # explicitly linking system object files so we need to strip them
+-            # from the output so that they don't get included in the library
+-            # dependencies.
+-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+-            ;;
+-          *)
+-            if test "$GXX" = yes; then
+-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+-            else
+-              # FIXME: insert proper C++ library support
+-              _LT_TAGVAR(ld_shlibs, $1)=no
+-            fi
+-            ;;
+-        esac
+-        ;;
+-
+-      hpux10*|hpux11*)
+-        if test $with_gnu_ld = no; then
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+-	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-
+-          case $host_cpu in
+-            hppa*64*|ia64*)
+-              ;;
+-            *)
+-	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+-              ;;
+-          esac
+-        fi
+-        case $host_cpu in
+-          hppa*64*|ia64*)
+-            _LT_TAGVAR(hardcode_direct, $1)=no
+-            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-            ;;
+-          *)
+-            _LT_TAGVAR(hardcode_direct, $1)=yes
+-            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+-            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+-					         # but as the default
+-					         # location of the library.
+-            ;;
+-        esac
+-
+-        case $cc_basename in
+-          CC*)
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-          aCC*)
+-	    case $host_cpu in
+-	      hppa*64*)
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+-	        ;;
+-	      ia64*)
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+-	        ;;
+-	      *)
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+-	        ;;
+-	    esac
+-	    # Commands to make compiler produce verbose output that lists
+-	    # what "hidden" libraries, object files and flags are used when
+-	    # linking a shared library.
+-	    #
+-	    # There doesn't appear to be a way to prevent this compiler from
+-	    # explicitly linking system object files so we need to strip them
+-	    # from the output so that they don't get included in the library
+-	    # dependencies.
+-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+-	    ;;
+-          *)
+-	    if test "$GXX" = yes; then
+-	      if test $with_gnu_ld = no; then
+-	        case $host_cpu in
+-	          hppa*64*)
+-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+-	            ;;
+-	          ia64*)
+-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+-	            ;;
+-	          *)
+-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+-	            ;;
+-	        esac
+-	      fi
+-	    else
+-	      # FIXME: insert proper C++ library support
+-	      _LT_TAGVAR(ld_shlibs, $1)=no
+-	    fi
+-	    ;;
+-        esac
+-        ;;
+-
+-      interix[[3-9]]*)
+-	_LT_TAGVAR(hardcode_direct, $1)=no
+-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+-	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+-	# Instead, shared libraries are loaded at an image base (0x10000000 by
+-	# default) and relocated if they conflict, which is a slow very memory
+-	# consuming and fragmenting process.  To avoid this, we pick a random,
+-	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+-	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+-	;;
+-      irix5* | irix6*)
+-        case $cc_basename in
+-          CC*)
+-	    # SGI C++
+-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+-
+-	    # Archives containing C++ object files must be created using
+-	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+-	    # necessary to make sure instantiated templates are included
+-	    # in the archive.
+-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+-	    ;;
+-          *)
+-	    if test "$GXX" = yes; then
+-	      if test "$with_gnu_ld" = no; then
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+-	      else
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+-	      fi
+-	    fi
+-	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+-	    ;;
+-        esac
+-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-        _LT_TAGVAR(inherit_rpath, $1)=yes
+-        ;;
+-
+-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+-        case $cc_basename in
+-          KCC*)
+-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+-
+-	    # KCC will only create a shared library if the output file
+-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+-	    # to its proper name (with version) after linking.
+-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+-	    # Commands to make compiler produce verbose output that lists
+-	    # what "hidden" libraries, object files and flags are used when
+-	    # linking a shared library.
+-	    #
+-	    # There doesn't appear to be a way to prevent this compiler from
+-	    # explicitly linking system object files so we need to strip them
+-	    # from the output so that they don't get included in the library
+-	    # dependencies.
+-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+-
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+-
+-	    # Archives containing C++ object files must be created using
+-	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+-	    ;;
+-	  icpc* | ecpc* )
+-	    # Intel C++
+-	    with_gnu_ld=yes
+-	    # version 8.0 and above of icpc choke on multiply defined symbols
+-	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+-	    # earlier do not add the objects themselves.
+-	    case `$CC -V 2>&1` in
+-	      *"Version 7."*)
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+-		;;
+-	      *)  # Version 8.0 or newer
+-	        tmp_idyn=
+-	        case $host_cpu in
+-		  ia64*) tmp_idyn=' -i_dynamic';;
+-		esac
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+-		;;
+-	    esac
+-	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+-	    ;;
+-          pgCC* | pgcpp*)
+-            # Portland Group C++ compiler
+-	    case `$CC -V` in
+-	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+-	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+-		rm -rf $tpldir~
+-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+-		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+-	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+-		rm -rf $tpldir~
+-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+-		$RANLIB $oldlib'
+-	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+-		rm -rf $tpldir~
+-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+-	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+-		rm -rf $tpldir~
+-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+-	      ;;
+-	    *) # Version 6 and above use weak symbols
+-	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+-	      ;;
+-	    esac
+-
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+-            ;;
+-	  cxx*)
+-	    # Compaq C++
+-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+-
+-	    runpath_var=LD_RUN_PATH
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-
+-	    # Commands to make compiler produce verbose output that lists
+-	    # what "hidden" libraries, object files and flags are used when
+-	    # linking a shared library.
+-	    #
+-	    # There doesn't appear to be a way to prevent this compiler from
+-	    # explicitly linking system object files so we need to strip them
+-	    # from the output so that they don't get included in the library
+-	    # dependencies.
+-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+-	    ;;
+-	  xl* | mpixl* | bgxl*)
+-	    # IBM XL 8.0 on PPC, with GNU ld
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+-	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	    if test "x$supports_anon_versioning" = xyes; then
+-	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+-		echo "local: *; };" >> $output_objdir/$libname.ver~
+-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+-	    fi
+-	    ;;
+-	  *)
+-	    case `$CC -V 2>&1 | sed 5q` in
+-	    *Sun\ C*)
+-	      # Sun C++ 5.9
+-	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+-	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+-	      _LT_TAGVAR(compiler_needs_object, $1)=yes
+-
+-	      # Not sure whether something based on
+-	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+-	      # would be better.
+-	      output_verbose_link_cmd='func_echo_all'
+-
+-	      # Archives containing C++ object files must be created using
+-	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+-	      # necessary to make sure instantiated templates are included
+-	      # in the archive.
+-	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+-	      ;;
+-	    esac
+-	    ;;
+-	esac
+-	;;
+-
+-      lynxos*)
+-        # FIXME: insert proper C++ library support
+-	_LT_TAGVAR(ld_shlibs, $1)=no
+-	;;
+-
+-      m88k*)
+-        # FIXME: insert proper C++ library support
+-        _LT_TAGVAR(ld_shlibs, $1)=no
+-	;;
+-
+-      mvs*)
+-        case $cc_basename in
+-          cxx*)
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-	  *)
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-	esac
+-	;;
+-
+-      netbsd*)
+-        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+-	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+-	  wlarc=
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+-	  _LT_TAGVAR(hardcode_direct, $1)=yes
+-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-	fi
+-	# Workaround some broken pre-1.5 toolchains
+-	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+-	;;
+-
+-      *nto* | *qnx*)
+-        _LT_TAGVAR(ld_shlibs, $1)=yes
+-	;;
+-
+-      openbsd2*)
+-        # C++ shared libraries are fairly broken
+-	_LT_TAGVAR(ld_shlibs, $1)=no
+-	;;
+-
+-      openbsd*)
+-	if test -f /usr/libexec/ld.so; then
+-	  _LT_TAGVAR(hardcode_direct, $1)=yes
+-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+-	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+-	  fi
+-	  output_verbose_link_cmd=func_echo_all
+-	else
+-	  _LT_TAGVAR(ld_shlibs, $1)=no
+-	fi
+-	;;
+-
+-      osf3* | osf4* | osf5*)
+-        case $cc_basename in
+-          KCC*)
+-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+-
+-	    # KCC will only create a shared library if the output file
+-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+-	    # to its proper name (with version) after linking.
+-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+-
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-
+-	    # Archives containing C++ object files must be created using
+-	    # the KAI C++ compiler.
+-	    case $host in
+-	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+-	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+-	    esac
+-	    ;;
+-          RCC*)
+-	    # Rational C++ 2.4.1
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-          cxx*)
+-	    case $host in
+-	      osf3*)
+-	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-		;;
+-	      *)
+-	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+-	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+-	          echo "-hidden">> $lib.exp~
+-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+-	          $RM $lib.exp'
+-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+-		;;
+-	    esac
+-
+-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-
+-	    # Commands to make compiler produce verbose output that lists
+-	    # what "hidden" libraries, object files and flags are used when
+-	    # linking a shared library.
+-	    #
+-	    # There doesn't appear to be a way to prevent this compiler from
+-	    # explicitly linking system object files so we need to strip them
+-	    # from the output so that they don't get included in the library
+-	    # dependencies.
+-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+-	    ;;
+-	  *)
+-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+-	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+-	      case $host in
+-	        osf3*)
+-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+-		  ;;
+-	        *)
+-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+-		  ;;
+-	      esac
+-
+-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+-	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+-
+-	      # Commands to make compiler produce verbose output that lists
+-	      # what "hidden" libraries, object files and flags are used when
+-	      # linking a shared library.
+-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+-
+-	    else
+-	      # FIXME: insert proper C++ library support
+-	      _LT_TAGVAR(ld_shlibs, $1)=no
+-	    fi
+-	    ;;
+-        esac
+-        ;;
+-
+-      psos*)
+-        # FIXME: insert proper C++ library support
+-        _LT_TAGVAR(ld_shlibs, $1)=no
+-        ;;
+-
+-      sunos4*)
+-        case $cc_basename in
+-          CC*)
+-	    # Sun C++ 4.x
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-          lcc*)
+-	    # Lucid
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-          *)
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-        esac
+-        ;;
+-
+-      solaris*)
+-        case $cc_basename in
+-          CC* | sunCC*)
+-	    # Sun C++ 4.2, 5.x and Centerline C++
+-            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+-	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+-
+-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+-	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-	    case $host_os in
+-	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+-	      *)
+-		# The compiler driver will combine and reorder linker options,
+-		# but understands `-z linker_flag'.
+-	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+-		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+-	        ;;
+-	    esac
+-	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+-
+-	    output_verbose_link_cmd='func_echo_all'
+-
+-	    # Archives containing C++ object files must be created using
+-	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+-	    # necessary to make sure instantiated templates are included
+-	    # in the archive.
+-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+-	    ;;
+-          gcx*)
+-	    # Green Hills C++ Compiler
+-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+-
+-	    # The C++ compiler must be used to create the archive.
+-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+-	    ;;
+-          *)
+-	    # GNU C++ compiler with Solaris linker
+-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+-	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+-	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+-	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+-
+-	        # Commands to make compiler produce verbose output that lists
+-	        # what "hidden" libraries, object files and flags are used when
+-	        # linking a shared library.
+-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+-	      else
+-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+-	        # platform.
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+-	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+-
+-	        # Commands to make compiler produce verbose output that lists
+-	        # what "hidden" libraries, object files and flags are used when
+-	        # linking a shared library.
+-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+-	      fi
+-
+-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+-	      case $host_os in
+-		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+-		*)
+-		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+-		  ;;
+-	      esac
+-	    fi
+-	    ;;
+-        esac
+-        ;;
+-
+-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-      runpath_var='LD_RUN_PATH'
+-
+-      case $cc_basename in
+-        CC*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	  ;;
+-	*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	  ;;
+-      esac
+-      ;;
+-
+-      sysv5* | sco3.2v5* | sco5v6*)
+-	# Note: We can NOT use -z defs as we might desire, because we do not
+-	# link with -lc, and that would cause any symbols used from libc to
+-	# always be unresolved, which means just about no library would
+-	# ever link correctly.  If we're not using GNU ld we use -z text
+-	# though, which does catch some bad symbols but isn't as heavy-handed
+-	# as -z defs.
+-	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+-	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+-	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+-	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+-	_LT_TAGVAR(link_all_deplibs, $1)=yes
+-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+-	runpath_var='LD_RUN_PATH'
+-
+-	case $cc_basename in
+-          CC*)
+-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+-	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
+-	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+-	      '"$_LT_TAGVAR(reload_cmds, $1)"
+-	    ;;
+-	  *)
+-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+-	    ;;
+-	esac
+-      ;;
+-
+-      tandem*)
+-        case $cc_basename in
+-          NCC*)
+-	    # NonStop-UX NCC 3.20
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-          *)
+-	    # FIXME: insert proper C++ library support
+-	    _LT_TAGVAR(ld_shlibs, $1)=no
+-	    ;;
+-        esac
+-        ;;
+-
+-      vxworks*)
+-        # FIXME: insert proper C++ library support
+-        _LT_TAGVAR(ld_shlibs, $1)=no
+-        ;;
+-
+-      *)
+-        # FIXME: insert proper C++ library support
+-        _LT_TAGVAR(ld_shlibs, $1)=no
+-        ;;
+-    esac
+-
+-    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+-    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+-
+-    _LT_TAGVAR(GCC, $1)="$GXX"
+-    _LT_TAGVAR(LD, $1)="$LD"
+-
+-    ## CAVEAT EMPTOR:
+-    ## There is no encapsulation within the following macros, do not change
+-    ## the running order or otherwise move them around unless you know exactly
+-    ## what you are doing...
+-    _LT_SYS_HIDDEN_LIBDEPS($1)
+-    _LT_COMPILER_PIC($1)
+-    _LT_COMPILER_C_O($1)
+-    _LT_COMPILER_FILE_LOCKS($1)
+-    _LT_LINKER_SHLIBS($1)
+-    _LT_SYS_DYNAMIC_LINKER($1)
+-    _LT_LINKER_HARDCODE_LIBPATH($1)
+-
+-    _LT_CONFIG($1)
+-  fi # test -n "$compiler"
+-
+-  CC=$lt_save_CC
+-  CFLAGS=$lt_save_CFLAGS
+-  LDCXX=$LD
+-  LD=$lt_save_LD
+-  GCC=$lt_save_GCC
+-  with_gnu_ld=$lt_save_with_gnu_ld
+-  lt_cv_path_LDCXX=$lt_cv_path_LD
+-  lt_cv_path_LD=$lt_save_path_LD
+-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+-fi # test "$_lt_caught_CXX_error" != yes
+-
+-AC_LANG_POP
+-])# _LT_LANG_CXX_CONFIG
+-
+-
+-# _LT_FUNC_STRIPNAME_CNF
+-# ----------------------
+-# func_stripname_cnf prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-#
+-# This function is identical to the (non-XSI) version of func_stripname,
+-# except this one can be used by m4 code that may be executed by configure,
+-# rather than the libtool script.
+-m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+-AC_REQUIRE([_LT_DECL_SED])
+-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+-func_stripname_cnf ()
+-{
+-  case ${2} in
+-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-} # func_stripname_cnf
+-])# _LT_FUNC_STRIPNAME_CNF
+-
+-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+-# ---------------------------------
+-# Figure out "hidden" library dependencies from verbose
+-# compiler output when linking a shared library.
+-# Parse the compiler output and extract the necessary
+-# objects, libraries and library flags.
+-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+-AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+-# Dependencies to place before and after the object being linked:
+-_LT_TAGVAR(predep_objects, $1)=
+-_LT_TAGVAR(postdep_objects, $1)=
+-_LT_TAGVAR(predeps, $1)=
+-_LT_TAGVAR(postdeps, $1)=
+-_LT_TAGVAR(compiler_lib_search_path, $1)=
+-
+-dnl we can't use the lt_simple_compile_test_code here,
+-dnl because it contains code intended for an executable,
+-dnl not a library.  It's possible we should let each
+-dnl tag define a new lt_????_link_test_code variable,
+-dnl but it's only used here...
+-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+-int a;
+-void foo (void) { a = 0; }
+-_LT_EOF
+-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+-class Foo
+-{
+-public:
+-  Foo (void) { a = 0; }
+-private:
+-  int a;
+-};
+-_LT_EOF
+-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+-      subroutine foo
+-      implicit none
+-      integer*4 a
+-      a=0
+-      return
+-      end
+-_LT_EOF
+-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+-      subroutine foo
+-      implicit none
+-      integer a
+-      a=0
+-      return
+-      end
+-_LT_EOF
+-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+-public class foo {
+-  private int a;
+-  public void bar (void) {
+-    a = 0;
+-  }
+-};
+-_LT_EOF
+-], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+-package foo
+-func foo() {
+-}
+-_LT_EOF
+-])
+-
+-_lt_libdeps_save_CFLAGS=$CFLAGS
+-case "$CC $CFLAGS " in #(
+-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+-esac
+-
+-dnl Parse the compiler output and extract the necessary
+-dnl objects, libraries and library flags.
+-if AC_TRY_EVAL(ac_compile); then
+-  # Parse the compiler output and extract the necessary
+-  # objects, libraries and library flags.
+-
+-  # Sentinel used to keep track of whether or not we are before
+-  # the conftest object file.
+-  pre_test_object_deps_done=no
+-
+-  for p in `eval "$output_verbose_link_cmd"`; do
+-    case ${prev}${p} in
+-
+-    -L* | -R* | -l*)
+-       # Some compilers place space between "-{L,R}" and the path.
+-       # Remove the space.
+-       if test $p = "-L" ||
+-          test $p = "-R"; then
+-	 prev=$p
+-	 continue
+-       fi
+-
+-       # Expand the sysroot to ease extracting the directories later.
+-       if test -z "$prev"; then
+-         case $p in
+-         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+-         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+-         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+-         esac
+-       fi
+-       case $p in
+-       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+-       esac
+-       if test "$pre_test_object_deps_done" = no; then
+-	 case ${prev} in
+-	 -L | -R)
+-	   # Internal compiler library paths should come after those
+-	   # provided the user.  The postdeps already come after the
+-	   # user supplied libs so there is no need to process them.
+-	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+-	   else
+-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+-	   fi
+-	   ;;
+-	 # The "-l" case would never come before the object being
+-	 # linked, so don't bother handling this case.
+-	 esac
+-       else
+-	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+-	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+-	 else
+-	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+-	 fi
+-       fi
+-       prev=
+-       ;;
+-
+-    *.lto.$objext) ;; # Ignore GCC LTO objects
+-    *.$objext)
+-       # This assumes that the test object file only shows up
+-       # once in the compiler output.
+-       if test "$p" = "conftest.$objext"; then
+-	 pre_test_object_deps_done=yes
+-	 continue
+-       fi
+-
+-       if test "$pre_test_object_deps_done" = no; then
+-	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+-	   _LT_TAGVAR(predep_objects, $1)="$p"
+-	 else
+-	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+-	 fi
+-       else
+-	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+-	   _LT_TAGVAR(postdep_objects, $1)="$p"
+-	 else
+-	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+-	 fi
+-       fi
+-       ;;
+-
+-    *) ;; # Ignore the rest.
+-
+-    esac
+-  done
+-
+-  # Clean up.
+-  rm -f a.out a.exe
+-else
+-  echo "libtool.m4: error: problem compiling $1 test program"
+-fi
+-
+-$RM -f confest.$objext
+-CFLAGS=$_lt_libdeps_save_CFLAGS
+-
+-# PORTME: override above test on systems where it is broken
+-m4_if([$1], [CXX],
+-[case $host_os in
+-interix[[3-9]]*)
+-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+-  # hack all around it, let's just trust "g++" to DTRT.
+-  _LT_TAGVAR(predep_objects,$1)=
+-  _LT_TAGVAR(postdep_objects,$1)=
+-  _LT_TAGVAR(postdeps,$1)=
+-  ;;
+-
+-linux*)
+-  case `$CC -V 2>&1 | sed 5q` in
+-  *Sun\ C*)
+-    # Sun C++ 5.9
+-
+-    # The more standards-conforming stlport4 library is
+-    # incompatible with the Cstd library. Avoid specifying
+-    # it if it's in CXXFLAGS. Ignore libCrun as
+-    # -library=stlport4 depends on it.
+-    case " $CXX $CXXFLAGS " in
+-    *" -library=stlport4 "*)
+-      solaris_use_stlport4=yes
+-      ;;
+-    esac
+-
+-    if test "$solaris_use_stlport4" != yes; then
+-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+-    fi
+-    ;;
+-  esac
+-  ;;
+-
+-solaris*)
+-  case $cc_basename in
+-  CC* | sunCC*)
+-    # The more standards-conforming stlport4 library is
+-    # incompatible with the Cstd library. Avoid specifying
+-    # it if it's in CXXFLAGS. Ignore libCrun as
+-    # -library=stlport4 depends on it.
+-    case " $CXX $CXXFLAGS " in
+-    *" -library=stlport4 "*)
+-      solaris_use_stlport4=yes
+-      ;;
+-    esac
+-
+-    # Adding this requires a known-good setup of shared libraries for
+-    # Sun compiler versions before 5.6, else PIC objects from an old
+-    # archive will be linked into the output, leading to subtle bugs.
+-    if test "$solaris_use_stlport4" != yes; then
+-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+-    fi
+-    ;;
+-  esac
+-  ;;
+-esac
+-])
+-
+-case " $_LT_TAGVAR(postdeps, $1) " in
+-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+-esac
+- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+-fi
+-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+-    [The directories searched by this compiler when creating a shared library])
+-_LT_TAGDECL([], [predep_objects], [1],
+-    [Dependencies to place before and after the objects being linked to
+-    create a shared library])
+-_LT_TAGDECL([], [postdep_objects], [1])
+-_LT_TAGDECL([], [predeps], [1])
+-_LT_TAGDECL([], [postdeps], [1])
+-_LT_TAGDECL([], [compiler_lib_search_path], [1],
+-    [The library search path used internally by the compiler when linking
+-    a shared library])
+-])# _LT_SYS_HIDDEN_LIBDEPS
+-
+-
+-# _LT_LANG_F77_CONFIG([TAG])
+-# --------------------------
+-# Ensure that the configuration variables for a Fortran 77 compiler are
+-# suitably defined.  These variables are subsequently used by _LT_CONFIG
+-# to write the compiler configuration to `libtool'.
+-m4_defun([_LT_LANG_F77_CONFIG],
+-[AC_LANG_PUSH(Fortran 77)
+-if test -z "$F77" || test "X$F77" = "Xno"; then
+-  _lt_disable_F77=yes
+-fi
+-
+-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-_LT_TAGVAR(allow_undefined_flag, $1)=
+-_LT_TAGVAR(always_export_symbols, $1)=no
+-_LT_TAGVAR(archive_expsym_cmds, $1)=
+-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+-_LT_TAGVAR(hardcode_direct, $1)=no
+-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+-_LT_TAGVAR(hardcode_libdir_separator, $1)=
+-_LT_TAGVAR(hardcode_minus_L, $1)=no
+-_LT_TAGVAR(hardcode_automatic, $1)=no
+-_LT_TAGVAR(inherit_rpath, $1)=no
+-_LT_TAGVAR(module_cmds, $1)=
+-_LT_TAGVAR(module_expsym_cmds, $1)=
+-_LT_TAGVAR(link_all_deplibs, $1)=unknown
+-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+-_LT_TAGVAR(reload_flag, $1)=$reload_flag
+-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+-_LT_TAGVAR(no_undefined_flag, $1)=
+-_LT_TAGVAR(whole_archive_flag_spec, $1)=
+-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+-
+-# Source file extension for f77 test sources.
+-ac_ext=f
+-
+-# Object file extension for compiled f77 test sources.
+-objext=o
+-_LT_TAGVAR(objext, $1)=$objext
+-
+-# No sense in running all these tests if we already determined that
+-# the F77 compiler isn't working.  Some variables (like enable_shared)
+-# are currently assumed to apply to all compilers on this platform,
+-# and will be corrupted by setting them based on a non-working compiler.
+-if test "$_lt_disable_F77" != yes; then
+-  # Code to be used in simple compile tests
+-  lt_simple_compile_test_code="\
+-      subroutine t
+-      return
+-      end
+-"
+-
+-  # Code to be used in simple link tests
+-  lt_simple_link_test_code="\
+-      program t
+-      end
+-"
+-
+-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+-  _LT_TAG_COMPILER
+-
+-  # save warnings/boilerplate of simple test code
+-  _LT_COMPILER_BOILERPLATE
+-  _LT_LINKER_BOILERPLATE
+-
+-  # Allow CC to be a program name with arguments.
+-  lt_save_CC="$CC"
+-  lt_save_GCC=$GCC
+-  lt_save_CFLAGS=$CFLAGS
+-  CC=${F77-"f77"}
+-  CFLAGS=$FFLAGS
+-  compiler=$CC
+-  _LT_TAGVAR(compiler, $1)=$CC
+-  _LT_CC_BASENAME([$compiler])
+-  GCC=$G77
+-  if test -n "$compiler"; then
+-    AC_MSG_CHECKING([if libtool supports shared libraries])
+-    AC_MSG_RESULT([$can_build_shared])
+-
+-    AC_MSG_CHECKING([whether to build shared libraries])
+-    test "$can_build_shared" = "no" && enable_shared=no
+-
+-    # On AIX, shared libraries and static libraries use the same namespace, and
+-    # are all built from PIC.
+-    case $host_os in
+-      aix3*)
+-        test "$enable_shared" = yes && enable_static=no
+-        if test -n "$RANLIB"; then
+-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+-          postinstall_cmds='$RANLIB $lib'
+-        fi
+-        ;;
+-      aix[[4-9]]*)
+-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+-	  test "$enable_shared" = yes && enable_static=no
+-	fi
+-        ;;
+-    esac
+-    AC_MSG_RESULT([$enable_shared])
+-
+-    AC_MSG_CHECKING([whether to build static libraries])
+-    # Make sure either enable_shared or enable_static is yes.
+-    test "$enable_shared" = yes || enable_static=yes
+-    AC_MSG_RESULT([$enable_static])
+-
+-    _LT_TAGVAR(GCC, $1)="$G77"
+-    _LT_TAGVAR(LD, $1)="$LD"
+-
+-    ## CAVEAT EMPTOR:
+-    ## There is no encapsulation within the following macros, do not change
+-    ## the running order or otherwise move them around unless you know exactly
+-    ## what you are doing...
+-    _LT_COMPILER_PIC($1)
+-    _LT_COMPILER_C_O($1)
+-    _LT_COMPILER_FILE_LOCKS($1)
+-    _LT_LINKER_SHLIBS($1)
+-    _LT_SYS_DYNAMIC_LINKER($1)
+-    _LT_LINKER_HARDCODE_LIBPATH($1)
+-
+-    _LT_CONFIG($1)
+-  fi # test -n "$compiler"
+-
+-  GCC=$lt_save_GCC
+-  CC="$lt_save_CC"
+-  CFLAGS="$lt_save_CFLAGS"
+-fi # test "$_lt_disable_F77" != yes
+-
+-AC_LANG_POP
+-])# _LT_LANG_F77_CONFIG
+-
+-
+-# _LT_LANG_FC_CONFIG([TAG])
+-# -------------------------
+-# Ensure that the configuration variables for a Fortran compiler are
+-# suitably defined.  These variables are subsequently used by _LT_CONFIG
+-# to write the compiler configuration to `libtool'.
+-m4_defun([_LT_LANG_FC_CONFIG],
+-[AC_LANG_PUSH(Fortran)
+-
+-if test -z "$FC" || test "X$FC" = "Xno"; then
+-  _lt_disable_FC=yes
+-fi
+-
+-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-_LT_TAGVAR(allow_undefined_flag, $1)=
+-_LT_TAGVAR(always_export_symbols, $1)=no
+-_LT_TAGVAR(archive_expsym_cmds, $1)=
+-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+-_LT_TAGVAR(hardcode_direct, $1)=no
+-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+-_LT_TAGVAR(hardcode_libdir_separator, $1)=
+-_LT_TAGVAR(hardcode_minus_L, $1)=no
+-_LT_TAGVAR(hardcode_automatic, $1)=no
+-_LT_TAGVAR(inherit_rpath, $1)=no
+-_LT_TAGVAR(module_cmds, $1)=
+-_LT_TAGVAR(module_expsym_cmds, $1)=
+-_LT_TAGVAR(link_all_deplibs, $1)=unknown
+-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+-_LT_TAGVAR(reload_flag, $1)=$reload_flag
+-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+-_LT_TAGVAR(no_undefined_flag, $1)=
+-_LT_TAGVAR(whole_archive_flag_spec, $1)=
+-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+-
+-# Source file extension for fc test sources.
+-ac_ext=${ac_fc_srcext-f}
+-
+-# Object file extension for compiled fc test sources.
+-objext=o
+-_LT_TAGVAR(objext, $1)=$objext
+-
+-# No sense in running all these tests if we already determined that
+-# the FC compiler isn't working.  Some variables (like enable_shared)
+-# are currently assumed to apply to all compilers on this platform,
+-# and will be corrupted by setting them based on a non-working compiler.
+-if test "$_lt_disable_FC" != yes; then
+-  # Code to be used in simple compile tests
+-  lt_simple_compile_test_code="\
+-      subroutine t
+-      return
+-      end
+-"
+-
+-  # Code to be used in simple link tests
+-  lt_simple_link_test_code="\
+-      program t
+-      end
+-"
+-
+-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+-  _LT_TAG_COMPILER
+-
+-  # save warnings/boilerplate of simple test code
+-  _LT_COMPILER_BOILERPLATE
+-  _LT_LINKER_BOILERPLATE
+-
+-  # Allow CC to be a program name with arguments.
+-  lt_save_CC="$CC"
+-  lt_save_GCC=$GCC
+-  lt_save_CFLAGS=$CFLAGS
+-  CC=${FC-"f95"}
+-  CFLAGS=$FCFLAGS
+-  compiler=$CC
+-  GCC=$ac_cv_fc_compiler_gnu
+-
+-  _LT_TAGVAR(compiler, $1)=$CC
+-  _LT_CC_BASENAME([$compiler])
+-
+-  if test -n "$compiler"; then
+-    AC_MSG_CHECKING([if libtool supports shared libraries])
+-    AC_MSG_RESULT([$can_build_shared])
+-
+-    AC_MSG_CHECKING([whether to build shared libraries])
+-    test "$can_build_shared" = "no" && enable_shared=no
+-
+-    # On AIX, shared libraries and static libraries use the same namespace, and
+-    # are all built from PIC.
+-    case $host_os in
+-      aix3*)
+-        test "$enable_shared" = yes && enable_static=no
+-        if test -n "$RANLIB"; then
+-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+-          postinstall_cmds='$RANLIB $lib'
+-        fi
+-        ;;
+-      aix[[4-9]]*)
+-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+-	  test "$enable_shared" = yes && enable_static=no
+-	fi
+-        ;;
+-    esac
+-    AC_MSG_RESULT([$enable_shared])
+-
+-    AC_MSG_CHECKING([whether to build static libraries])
+-    # Make sure either enable_shared or enable_static is yes.
+-    test "$enable_shared" = yes || enable_static=yes
+-    AC_MSG_RESULT([$enable_static])
+-
+-    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+-    _LT_TAGVAR(LD, $1)="$LD"
+-
+-    ## CAVEAT EMPTOR:
+-    ## There is no encapsulation within the following macros, do not change
+-    ## the running order or otherwise move them around unless you know exactly
+-    ## what you are doing...
+-    _LT_SYS_HIDDEN_LIBDEPS($1)
+-    _LT_COMPILER_PIC($1)
+-    _LT_COMPILER_C_O($1)
+-    _LT_COMPILER_FILE_LOCKS($1)
+-    _LT_LINKER_SHLIBS($1)
+-    _LT_SYS_DYNAMIC_LINKER($1)
+-    _LT_LINKER_HARDCODE_LIBPATH($1)
+-
+-    _LT_CONFIG($1)
+-  fi # test -n "$compiler"
+-
+-  GCC=$lt_save_GCC
+-  CC=$lt_save_CC
+-  CFLAGS=$lt_save_CFLAGS
+-fi # test "$_lt_disable_FC" != yes
+-
+-AC_LANG_POP
+-])# _LT_LANG_FC_CONFIG
+-
+-
+-# _LT_LANG_GCJ_CONFIG([TAG])
+-# --------------------------
+-# Ensure that the configuration variables for the GNU Java Compiler compiler
+-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+-# to write the compiler configuration to `libtool'.
+-m4_defun([_LT_LANG_GCJ_CONFIG],
+-[AC_REQUIRE([LT_PROG_GCJ])dnl
+-AC_LANG_SAVE
+-
+-# Source file extension for Java test sources.
+-ac_ext=java
+-
+-# Object file extension for compiled Java test sources.
+-objext=o
+-_LT_TAGVAR(objext, $1)=$objext
+-
+-# Code to be used in simple compile tests
+-lt_simple_compile_test_code="class foo {}"
+-
+-# Code to be used in simple link tests
+-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+-
+-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+-_LT_TAG_COMPILER
+-
+-# save warnings/boilerplate of simple test code
+-_LT_COMPILER_BOILERPLATE
+-_LT_LINKER_BOILERPLATE
+-
+-# Allow CC to be a program name with arguments.
+-lt_save_CC=$CC
+-lt_save_CFLAGS=$CFLAGS
+-lt_save_GCC=$GCC
+-GCC=yes
+-CC=${GCJ-"gcj"}
+-CFLAGS=$GCJFLAGS
+-compiler=$CC
+-_LT_TAGVAR(compiler, $1)=$CC
+-_LT_TAGVAR(LD, $1)="$LD"
+-_LT_CC_BASENAME([$compiler])
+-
+-# GCJ did not exist at the time GCC didn't implicitly link libc in.
+-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-
+-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+-_LT_TAGVAR(reload_flag, $1)=$reload_flag
+-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+-
+-## CAVEAT EMPTOR:
+-## There is no encapsulation within the following macros, do not change
+-## the running order or otherwise move them around unless you know exactly
+-## what you are doing...
+-if test -n "$compiler"; then
+-  _LT_COMPILER_NO_RTTI($1)
+-  _LT_COMPILER_PIC($1)
+-  _LT_COMPILER_C_O($1)
+-  _LT_COMPILER_FILE_LOCKS($1)
+-  _LT_LINKER_SHLIBS($1)
+-  _LT_LINKER_HARDCODE_LIBPATH($1)
+-
+-  _LT_CONFIG($1)
+-fi
+-
+-AC_LANG_RESTORE
+-
+-GCC=$lt_save_GCC
+-CC=$lt_save_CC
+-CFLAGS=$lt_save_CFLAGS
+-])# _LT_LANG_GCJ_CONFIG
+-
+-
+-# _LT_LANG_GO_CONFIG([TAG])
+-# --------------------------
+-# Ensure that the configuration variables for the GNU Go compiler
+-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+-# to write the compiler configuration to `libtool'.
+-m4_defun([_LT_LANG_GO_CONFIG],
+-[AC_REQUIRE([LT_PROG_GO])dnl
+-AC_LANG_SAVE
+-
+-# Source file extension for Go test sources.
+-ac_ext=go
+-
+-# Object file extension for compiled Go test sources.
+-objext=o
+-_LT_TAGVAR(objext, $1)=$objext
+-
+-# Code to be used in simple compile tests
+-lt_simple_compile_test_code="package main; func main() { }"
+-
+-# Code to be used in simple link tests
+-lt_simple_link_test_code='package main; func main() { }'
+-
+-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+-_LT_TAG_COMPILER
+-
+-# save warnings/boilerplate of simple test code
+-_LT_COMPILER_BOILERPLATE
+-_LT_LINKER_BOILERPLATE
+-
+-# Allow CC to be a program name with arguments.
+-lt_save_CC=$CC
+-lt_save_CFLAGS=$CFLAGS
+-lt_save_GCC=$GCC
+-GCC=yes
+-CC=${GOC-"gccgo"}
+-CFLAGS=$GOFLAGS
+-compiler=$CC
+-_LT_TAGVAR(compiler, $1)=$CC
+-_LT_TAGVAR(LD, $1)="$LD"
+-_LT_CC_BASENAME([$compiler])
+-
+-# Go did not exist at the time GCC didn't implicitly link libc in.
+-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+-
+-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+-_LT_TAGVAR(reload_flag, $1)=$reload_flag
+-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+-
+-## CAVEAT EMPTOR:
+-## There is no encapsulation within the following macros, do not change
+-## the running order or otherwise move them around unless you know exactly
+-## what you are doing...
+-if test -n "$compiler"; then
+-  _LT_COMPILER_NO_RTTI($1)
+-  _LT_COMPILER_PIC($1)
+-  _LT_COMPILER_C_O($1)
+-  _LT_COMPILER_FILE_LOCKS($1)
+-  _LT_LINKER_SHLIBS($1)
+-  _LT_LINKER_HARDCODE_LIBPATH($1)
+-
+-  _LT_CONFIG($1)
+-fi
+-
+-AC_LANG_RESTORE
+-
+-GCC=$lt_save_GCC
+-CC=$lt_save_CC
+-CFLAGS=$lt_save_CFLAGS
+-])# _LT_LANG_GO_CONFIG
+-
+-
+-# _LT_LANG_RC_CONFIG([TAG])
+-# -------------------------
+-# Ensure that the configuration variables for the Windows resource compiler
+-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+-# to write the compiler configuration to `libtool'.
+-m4_defun([_LT_LANG_RC_CONFIG],
+-[AC_REQUIRE([LT_PROG_RC])dnl
+-AC_LANG_SAVE
+-
+-# Source file extension for RC test sources.
+-ac_ext=rc
+-
+-# Object file extension for compiled RC test sources.
+-objext=o
+-_LT_TAGVAR(objext, $1)=$objext
+-
+-# Code to be used in simple compile tests
+-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+-
+-# Code to be used in simple link tests
+-lt_simple_link_test_code="$lt_simple_compile_test_code"
+-
+-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+-_LT_TAG_COMPILER
+-
+-# save warnings/boilerplate of simple test code
+-_LT_COMPILER_BOILERPLATE
+-_LT_LINKER_BOILERPLATE
+-
+-# Allow CC to be a program name with arguments.
+-lt_save_CC="$CC"
+-lt_save_CFLAGS=$CFLAGS
+-lt_save_GCC=$GCC
+-GCC=
+-CC=${RC-"windres"}
+-CFLAGS=
+-compiler=$CC
+-_LT_TAGVAR(compiler, $1)=$CC
+-_LT_CC_BASENAME([$compiler])
+-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+-
+-if test -n "$compiler"; then
+-  :
+-  _LT_CONFIG($1)
+-fi
+-
+-GCC=$lt_save_GCC
+-AC_LANG_RESTORE
+-CC=$lt_save_CC
+-CFLAGS=$lt_save_CFLAGS
+-])# _LT_LANG_RC_CONFIG
+-
+-
+-# LT_PROG_GCJ
+-# -----------
+-AC_DEFUN([LT_PROG_GCJ],
+-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+-  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+-    [AC_CHECK_TOOL(GCJ, gcj,)
+-      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+-      AC_SUBST(GCJFLAGS)])])[]dnl
+-])
+-
+-# Old name:
+-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+-
+-
+-# LT_PROG_GO
+-# ----------
+-AC_DEFUN([LT_PROG_GO],
+-[AC_CHECK_TOOL(GOC, gccgo,)
+-])
+-
+-
+-# LT_PROG_RC
+-# ----------
+-AC_DEFUN([LT_PROG_RC],
+-[AC_CHECK_TOOL(RC, windres,)
+-])
+-
+-# Old name:
+-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([LT_AC_PROG_RC], [])
+-
+-
+-# _LT_DECL_EGREP
+-# --------------
+-# If we don't have a new enough Autoconf to choose the best grep
+-# available, choose the one first in the user's PATH.
+-m4_defun([_LT_DECL_EGREP],
+-[AC_REQUIRE([AC_PROG_EGREP])dnl
+-AC_REQUIRE([AC_PROG_FGREP])dnl
+-test -z "$GREP" && GREP=grep
+-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+-_LT_DECL([], [EGREP], [1], [An ERE matcher])
+-_LT_DECL([], [FGREP], [1], [A literal string matcher])
+-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+-AC_SUBST([GREP])
+-])
+-
+-
+-# _LT_DECL_OBJDUMP
+-# --------------
+-# If we don't have a new enough Autoconf to choose the best objdump
+-# available, choose the one first in the user's PATH.
+-m4_defun([_LT_DECL_OBJDUMP],
+-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+-test -z "$OBJDUMP" && OBJDUMP=objdump
+-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+-AC_SUBST([OBJDUMP])
+-])
+-
+-# _LT_DECL_DLLTOOL
+-# ----------------
+-# Ensure DLLTOOL variable is set.
+-m4_defun([_LT_DECL_DLLTOOL],
+-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+-test -z "$DLLTOOL" && DLLTOOL=dlltool
+-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+-AC_SUBST([DLLTOOL])
+-])
+-
+-# _LT_DECL_SED
+-# ------------
+-# Check for a fully-functional sed program, that truncates
+-# as few characters as possible.  Prefer GNU sed if found.
+-m4_defun([_LT_DECL_SED],
+-[AC_PROG_SED
+-test -z "$SED" && SED=sed
+-Xsed="$SED -e 1s/^X//"
+-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+-    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+-])# _LT_DECL_SED
+-
+-m4_ifndef([AC_PROG_SED], [
+-############################################################
+-# NOTE: This macro has been submitted for inclusion into   #
+-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+-#  a released version of Autoconf we should remove this    #
+-#  macro and use it instead.                               #
+-############################################################
+-
+-m4_defun([AC_PROG_SED],
+-[AC_MSG_CHECKING([for a sed that does not truncate output])
+-AC_CACHE_VAL(lt_cv_path_SED,
+-[# Loop through the user's path and test for sed and gsed.
+-# Then use that list of sed's as ones to test for truncation.
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+-  IFS=$as_save_IFS
+-  test -z "$as_dir" && as_dir=.
+-  for lt_ac_prog in sed gsed; do
+-    for ac_exec_ext in '' $ac_executable_extensions; do
+-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+-      fi
+-    done
+-  done
+-done
+-IFS=$as_save_IFS
+-lt_ac_max=0
+-lt_ac_count=0
+-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+-# along with /bin/sed that truncates output.
+-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+-  test ! -f $lt_ac_sed && continue
+-  cat /dev/null > conftest.in
+-  lt_ac_count=0
+-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+-  # Check for GNU sed and select it if it is found.
+-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+-    lt_cv_path_SED=$lt_ac_sed
+-    break
+-  fi
+-  while true; do
+-    cat conftest.in conftest.in >conftest.tmp
+-    mv conftest.tmp conftest.in
+-    cp conftest.in conftest.nl
+-    echo >>conftest.nl
+-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+-    cmp -s conftest.out conftest.nl || break
+-    # 10000 chars as input seems more than enough
+-    test $lt_ac_count -gt 10 && break
+-    lt_ac_count=`expr $lt_ac_count + 1`
+-    if test $lt_ac_count -gt $lt_ac_max; then
+-      lt_ac_max=$lt_ac_count
+-      lt_cv_path_SED=$lt_ac_sed
+-    fi
+-  done
+-done
+-])
+-SED=$lt_cv_path_SED
+-AC_SUBST([SED])
+-AC_MSG_RESULT([$SED])
+-])#AC_PROG_SED
+-])#m4_ifndef
+-
+-# Old name:
+-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([LT_AC_PROG_SED], [])
+-
+-
+-# _LT_CHECK_SHELL_FEATURES
+-# ------------------------
+-# Find out whether the shell is Bourne or XSI compatible,
+-# or has some other useful features.
+-m4_defun([_LT_CHECK_SHELL_FEATURES],
+-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+-# Try some XSI features
+-xsi_shell=no
+-( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,b/c, \
+-    && eval 'test $(( 1 + 1 )) -eq 2 \
+-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+-  && xsi_shell=yes
+-AC_MSG_RESULT([$xsi_shell])
+-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+-
+-AC_MSG_CHECKING([whether the shell understands "+="])
+-lt_shell_append=no
+-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+-    >/dev/null 2>&1 \
+-  && lt_shell_append=yes
+-AC_MSG_RESULT([$lt_shell_append])
+-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+-
+-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+-  lt_unset=unset
+-else
+-  lt_unset=false
+-fi
+-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+-
+-# test EBCDIC or ASCII
+-case `echo X|tr X '\101'` in
+- A) # ASCII based system
+-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+-  lt_SP2NL='tr \040 \012'
+-  lt_NL2SP='tr \015\012 \040\040'
+-  ;;
+- *) # EBCDIC based system
+-  lt_SP2NL='tr \100 \n'
+-  lt_NL2SP='tr \r\n \100\100'
+-  ;;
+-esac
+-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+-])# _LT_CHECK_SHELL_FEATURES
+-
+-
+-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+-# ------------------------------------------------------
+-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+-m4_defun([_LT_PROG_FUNCTION_REPLACE],
+-[dnl {
+-sed -e '/^$1 ()$/,/^} # $1 /c\
+-$1 ()\
+-{\
+-m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
+-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+-  && mv -f "$cfgfile.tmp" "$cfgfile" \
+-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+-test 0 -eq $? || _lt_function_replace_fail=:
+-])
+-
+-
+-# _LT_PROG_REPLACE_SHELLFNS
+-# -------------------------
+-# Replace existing portable implementations of several shell functions with
+-# equivalent extended shell implementations where those features are available..
+-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+-[if test x"$xsi_shell" = xyes; then
+-  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+-    case ${1} in
+-      */*) func_dirname_result="${1%/*}${2}" ;;
+-      *  ) func_dirname_result="${3}" ;;
+-    esac])
+-
+-  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+-    func_basename_result="${1##*/}"])
+-
+-  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+-    case ${1} in
+-      */*) func_dirname_result="${1%/*}${2}" ;;
+-      *  ) func_dirname_result="${3}" ;;
+-    esac
+-    func_basename_result="${1##*/}"])
+-
+-  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-    # positional parameters, so assign one to ordinary parameter first.
+-    func_stripname_result=${3}
+-    func_stripname_result=${func_stripname_result#"${1}"}
+-    func_stripname_result=${func_stripname_result%"${2}"}])
+-
+-  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+-    func_split_long_opt_name=${1%%=*}
+-    func_split_long_opt_arg=${1#*=}])
+-
+-  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+-    func_split_short_opt_arg=${1#??}
+-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+-
+-  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+-    case ${1} in
+-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-      *)    func_lo2o_result=${1} ;;
+-    esac])
+-
+-  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+-
+-  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+-
+-  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
+-fi
+-
+-if test x"$lt_shell_append" = xyes; then
+-  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+-
+-  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+-    func_quote_for_eval "${2}"
+-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+-    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+-
+-  # Save a `func_append' function call where possible by direct use of '+='
+-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+-    && mv -f "$cfgfile.tmp" "$cfgfile" \
+-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+-  test 0 -eq $? || _lt_function_replace_fail=:
+-else
+-  # Save a `func_append' function call even when '+=' is not available
+-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+-    && mv -f "$cfgfile.tmp" "$cfgfile" \
+-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+-  test 0 -eq $? || _lt_function_replace_fail=:
+-fi
+-
+-if test x"$_lt_function_replace_fail" = x":"; then
+-  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+-fi
+-])
+-
+-# _LT_PATH_CONVERSION_FUNCTIONS
+-# -----------------------------
+-# Determine which file name conversion functions should be used by
+-# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
+-# for certain cross-compile configurations and native mingw.
+-m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+-AC_MSG_CHECKING([how to convert $build file names to $host format])
+-AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+-[case $host in
+-  *-*-mingw* )
+-    case $build in
+-      *-*-mingw* ) # actually msys
+-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+-        ;;
+-      *-*-cygwin* )
+-        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+-        ;;
+-      * ) # otherwise, assume *nix
+-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+-        ;;
+-    esac
+-    ;;
+-  *-*-cygwin* )
+-    case $build in
+-      *-*-mingw* ) # actually msys
+-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+-        ;;
+-      *-*-cygwin* )
+-        lt_cv_to_host_file_cmd=func_convert_file_noop
+-        ;;
+-      * ) # otherwise, assume *nix
+-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+-        ;;
+-    esac
+-    ;;
+-  * ) # unhandled hosts (and "normal" native builds)
+-    lt_cv_to_host_file_cmd=func_convert_file_noop
+-    ;;
+-esac
+-])
+-to_host_file_cmd=$lt_cv_to_host_file_cmd
+-AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+-_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+-         [0], [convert $build file names to $host format])dnl
+-
+-AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+-AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+-[#assume ordinary cross tools, or native build.
+-lt_cv_to_tool_file_cmd=func_convert_file_noop
+-case $host in
+-  *-*-mingw* )
+-    case $build in
+-      *-*-mingw* ) # actually msys
+-        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+-        ;;
+-    esac
+-    ;;
+-esac
+-])
+-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+-AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+-_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+-         [0], [convert $build files to toolchain format])dnl
+-])# _LT_PATH_CONVERSION_FUNCTIONS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltversion.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltversion.m4	(revision 13081)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltversion.m4	(revision 13082)
+@@ -1,23 +0,0 @@
+-# ltversion.m4 -- version numbers			-*- Autoconf -*-
+-#
+-#   Copyright (C) 2004 Free Software Foundation, Inc.
+-#   Written by Scott James Remnant, 2004
+-#
+-# This file is free software; the Free Software Foundation gives
+-# unlimited permission to copy and/or distribute it, with or without
+-# modifications, as long as this notice is preserved.
+-
+-# @configure_input@
+-
+-# serial 3337 ltversion.m4
+-# This file is part of GNU Libtool
+-
+-m4_define([LT_PACKAGE_VERSION], [2.4.2])
+-m4_define([LT_PACKAGE_REVISION], [1.3337])
+-
+-AC_DEFUN([LTVERSION_VERSION],
+-[macro_version='2.4.2'
+-macro_revision='1.3337'
+-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+-_LT_DECL(, macro_revision, 0)
+-])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/lt~obsolete.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/lt~obsolete.m4	(revision 13081)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/lt~obsolete.m4	(revision 13082)
+@@ -1,98 +0,0 @@
+-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+-#
+-#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+-#   Written by Scott James Remnant, 2004.
+-#
+-# This file is free software; the Free Software Foundation gives
+-# unlimited permission to copy and/or distribute it, with or without
+-# modifications, as long as this notice is preserved.
+-
+-# serial 5 lt~obsolete.m4
+-
+-# These exist entirely to fool aclocal when bootstrapping libtool.
+-#
+-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+-# which have later been changed to m4_define as they aren't part of the
+-# exported API, or moved to Autoconf or Automake where they belong.
+-#
+-# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+-# using a macro with the same name in our local m4/libtool.m4 it'll
+-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+-# and doesn't know about Autoconf macros at all.)
+-#
+-# So we provide this file, which has a silly filename so it's always
+-# included after everything else.  This provides aclocal with the
+-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+-# because those macros already exist, or will be overwritten later.
+-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+-#
+-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+-# Yes, that means every name once taken will need to remain here until
+-# we give up compatibility with versions before 1.7, at which point
+-# we need to keep only those names which we still refer to.
+-
+-# This is to help aclocal find these macros, as it can't see m4_define.
+-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+-
+-m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+-m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
+-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+-m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
+-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+-m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
+-m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
+-m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+-m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
+-m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
+-m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
+-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+-m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+-m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
+-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+-m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
+-m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
+-m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+-m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+-m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
+-m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
+-m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
+-m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+-m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+-m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
+-m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
+-m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+-m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
+-m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+-m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+-m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+-m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+-m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+-m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+-m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+-m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+-m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+-m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+-m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+-m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+-m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
+-m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
+-m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltoptions.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltoptions.m4	(revision 13081)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ltoptions.m4	(revision 13082)
+@@ -1,384 +0,0 @@
+-# Helper functions for option handling.                    -*- Autoconf -*-
+-#
+-#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+-#   Inc.
+-#   Written by Gary V. Vaughan, 2004
+-#
+-# This file is free software; the Free Software Foundation gives
+-# unlimited permission to copy and/or distribute it, with or without
+-# modifications, as long as this notice is preserved.
+-
+-# serial 7 ltoptions.m4
+-
+-# This is to help aclocal find these macros, as it can't see m4_define.
+-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+-
+-
+-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+-# ------------------------------------------
+-m4_define([_LT_MANGLE_OPTION],
+-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+-
+-
+-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+-# ---------------------------------------
+-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+-# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+-# saved as a flag.
+-m4_define([_LT_SET_OPTION],
+-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+-        _LT_MANGLE_DEFUN([$1], [$2]),
+-    [m4_warning([Unknown $1 option `$2'])])[]dnl
+-])
+-
+-
+-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+-# ------------------------------------------------------------
+-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+-m4_define([_LT_IF_OPTION],
+-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+-
+-
+-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+-# -------------------------------------------------------
+-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+-# are set.
+-m4_define([_LT_UNLESS_OPTIONS],
+-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+-	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+-		      [m4_define([$0_found])])])[]dnl
+-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+-])[]dnl
+-])
+-
+-
+-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+-# ----------------------------------------
+-# OPTION-LIST is a space-separated list of Libtool options associated
+-# with MACRO-NAME.  If any OPTION has a matching handler declared with
+-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+-# the unknown option and exit.
+-m4_defun([_LT_SET_OPTIONS],
+-[# Set options
+-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+-    [_LT_SET_OPTION([$1], _LT_Option)])
+-
+-m4_if([$1],[LT_INIT],[
+-  dnl
+-  dnl Simply set some default values (i.e off) if boolean options were not
+-  dnl specified:
+-  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+-  ])
+-  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+-  ])
+-  dnl
+-  dnl If no reference was made to various pairs of opposing options, then
+-  dnl we run the default mode handler for the pair.  For example, if neither
+-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+-  dnl archives by default:
+-  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+-  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+-  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+-  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+-  		   [_LT_ENABLE_FAST_INSTALL])
+-  ])
+-])# _LT_SET_OPTIONS
+-
+-
+-## --------------------------------- ##
+-## Macros to handle LT_INIT options. ##
+-## --------------------------------- ##
+-
+-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+-# -----------------------------------------
+-m4_define([_LT_MANGLE_DEFUN],
+-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+-
+-
+-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+-# -----------------------------------------------
+-m4_define([LT_OPTION_DEFINE],
+-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+-])# LT_OPTION_DEFINE
+-
+-
+-# dlopen
+-# ------
+-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+-])
+-
+-AU_DEFUN([AC_LIBTOOL_DLOPEN],
+-[_LT_SET_OPTION([LT_INIT], [dlopen])
+-AC_DIAGNOSE([obsolete],
+-[$0: Remove this warning and the call to _LT_SET_OPTION when you
+-put the `dlopen' option into LT_INIT's first parameter.])
+-])
+-
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+-
+-
+-# win32-dll
+-# ---------
+-# Declare package support for building win32 dll's.
+-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+-[enable_win32_dll=yes
+-
+-case $host in
+-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+-  AC_CHECK_TOOL(AS, as, false)
+-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+-  ;;
+-esac
+-
+-test -z "$AS" && AS=as
+-_LT_DECL([], [AS],      [1], [Assembler program])dnl
+-
+-test -z "$DLLTOOL" && DLLTOOL=dlltool
+-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+-
+-test -z "$OBJDUMP" && OBJDUMP=objdump
+-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+-])# win32-dll
+-
+-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-_LT_SET_OPTION([LT_INIT], [win32-dll])
+-AC_DIAGNOSE([obsolete],
+-[$0: Remove this warning and the call to _LT_SET_OPTION when you
+-put the `win32-dll' option into LT_INIT's first parameter.])
+-])
+-
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+-
+-
+-# _LT_ENABLE_SHARED([DEFAULT])
+-# ----------------------------
+-# implement the --enable-shared flag, and supports the `shared' and
+-# `disable-shared' LT_INIT options.
+-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+-m4_define([_LT_ENABLE_SHARED],
+-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+-AC_ARG_ENABLE([shared],
+-    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+-	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+-    [p=${PACKAGE-default}
+-    case $enableval in
+-    yes) enable_shared=yes ;;
+-    no) enable_shared=no ;;
+-    *)
+-      enable_shared=no
+-      # Look at the argument we got.  We use all the common list separators.
+-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+-      for pkg in $enableval; do
+-	IFS="$lt_save_ifs"
+-	if test "X$pkg" = "X$p"; then
+-	  enable_shared=yes
+-	fi
+-      done
+-      IFS="$lt_save_ifs"
+-      ;;
+-    esac],
+-    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+-
+-    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+-	[Whether or not to build shared libraries])
+-])# _LT_ENABLE_SHARED
+-
+-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+-
+-# Old names:
+-AC_DEFUN([AC_ENABLE_SHARED],
+-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+-])
+-
+-AC_DEFUN([AC_DISABLE_SHARED],
+-[_LT_SET_OPTION([LT_INIT], [disable-shared])
+-])
+-
+-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+-
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+-
+-
+-
+-# _LT_ENABLE_STATIC([DEFAULT])
+-# ----------------------------
+-# implement the --enable-static flag, and support the `static' and
+-# `disable-static' LT_INIT options.
+-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+-m4_define([_LT_ENABLE_STATIC],
+-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+-AC_ARG_ENABLE([static],
+-    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+-	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+-    [p=${PACKAGE-default}
+-    case $enableval in
+-    yes) enable_static=yes ;;
+-    no) enable_static=no ;;
+-    *)
+-     enable_static=no
+-      # Look at the argument we got.  We use all the common list separators.
+-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+-      for pkg in $enableval; do
+-	IFS="$lt_save_ifs"
+-	if test "X$pkg" = "X$p"; then
+-	  enable_static=yes
+-	fi
+-      done
+-      IFS="$lt_save_ifs"
+-      ;;
+-    esac],
+-    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+-
+-    _LT_DECL([build_old_libs], [enable_static], [0],
+-	[Whether or not to build static libraries])
+-])# _LT_ENABLE_STATIC
+-
+-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+-
+-# Old names:
+-AC_DEFUN([AC_ENABLE_STATIC],
+-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+-])
+-
+-AC_DEFUN([AC_DISABLE_STATIC],
+-[_LT_SET_OPTION([LT_INIT], [disable-static])
+-])
+-
+-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+-
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+-
+-
+-
+-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+-# ----------------------------------
+-# implement the --enable-fast-install flag, and support the `fast-install'
+-# and `disable-fast-install' LT_INIT options.
+-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+-m4_define([_LT_ENABLE_FAST_INSTALL],
+-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+-AC_ARG_ENABLE([fast-install],
+-    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+-    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+-    [p=${PACKAGE-default}
+-    case $enableval in
+-    yes) enable_fast_install=yes ;;
+-    no) enable_fast_install=no ;;
+-    *)
+-      enable_fast_install=no
+-      # Look at the argument we got.  We use all the common list separators.
+-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+-      for pkg in $enableval; do
+-	IFS="$lt_save_ifs"
+-	if test "X$pkg" = "X$p"; then
+-	  enable_fast_install=yes
+-	fi
+-      done
+-      IFS="$lt_save_ifs"
+-      ;;
+-    esac],
+-    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+-
+-_LT_DECL([fast_install], [enable_fast_install], [0],
+-	 [Whether or not to optimize for fast installation])dnl
+-])# _LT_ENABLE_FAST_INSTALL
+-
+-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+-
+-# Old names:
+-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+-AC_DIAGNOSE([obsolete],
+-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+-the `fast-install' option into LT_INIT's first parameter.])
+-])
+-
+-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+-AC_DIAGNOSE([obsolete],
+-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+-the `disable-fast-install' option into LT_INIT's first parameter.])
+-])
+-
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+-
+-
+-# _LT_WITH_PIC([MODE])
+-# --------------------
+-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+-# LT_INIT options.
+-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+-m4_define([_LT_WITH_PIC],
+-[AC_ARG_WITH([pic],
+-    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+-	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+-    [lt_p=${PACKAGE-default}
+-    case $withval in
+-    yes|no) pic_mode=$withval ;;
+-    *)
+-      pic_mode=default
+-      # Look at the argument we got.  We use all the common list separators.
+-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+-      for lt_pkg in $withval; do
+-	IFS="$lt_save_ifs"
+-	if test "X$lt_pkg" = "X$lt_p"; then
+-	  pic_mode=yes
+-	fi
+-      done
+-      IFS="$lt_save_ifs"
+-      ;;
+-    esac],
+-    [pic_mode=default])
+-
+-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+-
+-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+-])# _LT_WITH_PIC
+-
+-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+-
+-# Old name:
+-AU_DEFUN([AC_LIBTOOL_PICMODE],
+-[_LT_SET_OPTION([LT_INIT], [pic-only])
+-AC_DIAGNOSE([obsolete],
+-[$0: Remove this warning and the call to _LT_SET_OPTION when you
+-put the `pic-only' option into LT_INIT's first parameter.])
+-])
+-
+-dnl aclocal-1.4 backwards compatibility:
+-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+-
+-## ----------------- ##
+-## LTDL_INIT Options ##
+-## ----------------- ##
+-
+-m4_define([_LTDL_MODE], [])
+-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+-		 [m4_define([_LTDL_MODE], [nonrecursive])])
+-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+-		 [m4_define([_LTDL_MODE], [recursive])])
+-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+-		 [m4_define([_LTDL_MODE], [subproject])])
+-
+-m4_define([_LTDL_TYPE], [])
+-LT_OPTION_DEFINE([LTDL_INIT], [installable],
+-		 [m4_define([_LTDL_TYPE], [installable])])
+-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+-		 [m4_define([_LTDL_TYPE], [convenience])])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh	(revision 13081)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh	(revision 13082)
+@@ -19,3 +19,8 @@
+ ./configure --prefix="$ISSM_DIR/externalpackages/libtool/install" 
+ make  
+ make install
++
++cd ../install/share/aclocal
++cp libtool.m4 $ISSM_DIR/m4/
++cp lt* $ISSM_DIR/m4/
++ls $ISSM_DIR/m4
Index: /issm/oecreview/Archive/12678-13393/ISSM-13082-13083.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13082-13083.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13082-13083.diff	(revision 13394)
@@ -0,0 +1,334 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13083)
+@@ -14,6 +14,7 @@
+ 	bool  dakota_analysis,control_analysis,tao_analysis;
+ 
+ 	/*AD: */
++	bool autodiff=false;
+ 	#if _ADOLC_VERSION_ == 2
+ 	int      tape_stats[11];
+ 	#else
+@@ -48,11 +49,7 @@
+ 
+ 	ISSMBOOT();
+ 
+-	/*If running AD, then initialize the tape: */
+-	#ifdef _HAVE_ADOLC_
+-	trace_on(1);
+-	#endif
+-
++	
+ 	/*Initialize environments: Petsc, MPI, etc...: */
+ 	#ifdef _HAVE_PETSC_
+ 	ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
+@@ -111,12 +108,18 @@
+ 	femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
+ 	femmodel->parameters->FindParam(&tao_analysis,InversionTaoEnum);
+ 	femmodel->parameters->FindParam(&profiling,DebugProfilingEnum); 
++	femmodel->parameters->FindParam(&autodiff,AutodiffIsautodiffEnum);
+ 
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime();
+ 	#else
+ 	finish_init=(IssmPDouble)clock();
+ 	#endif
++	
++	/*If running AD, then initialize the tape: */
++	#ifdef _HAVE_ADOLC_
++	if(autodiff) trace_on(1);
++	#endif
+ 
+ 	_pprintLine_("call computational core:");
+ 	#ifdef _HAVE_MPI_
+@@ -164,6 +167,21 @@
+ 
+ 	_pprintLine_("write results to disk:");
+ 	OutputResultsx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results);
++	
++	/*If running AD, close our tape, print statistics: {{{*/
++	#ifdef _HAVE_ADOLC_
++	if(autodiff){
++		trace_off();
++		tapestats(1,tape_stats); //reading of tape statistics
++		_pprintLine_("   ADOLC statistics: ");
++		_pprintLine_("   "<<setw(45)<<left<<"Number of independents: " <<tape_stats[0]);
++		_pprintLine_("   "<<setw(45)<<left<<"Number of dependents: " <<tape_stats[1]);
++		_pprintLine_("   "<<setw(45)<<left<<"Maximal number of live active variables: " <<tape_stats[2]);
++		_pprintLine_("   "<<setw(45)<<left<<"Size of value stack (number of overwrites): " <<tape_stats[3]);
++		_pprintLine_("   "<<setw(45)<<left<<"Buffer size (a multiple of eight): " <<tape_stats[4]);
++		_pprintLine_("   "<<setw(45)<<left<<"Total number of operations recorded: " <<tape_stats[5]);
++	}
++	#endif  /*}}}*/
+ 
+ 	/*Close output and petsc options file and write lock file if requested*/
+ 	pfclose(output_fid,lockfilename);
+@@ -212,18 +230,6 @@
+ 	#endif
+ 	#endif
+ 
+-	/*If running AD, close our tape, print statistics: */
+-	#ifdef _HAVE_ADOLC_
+-	trace_off();
+-	tapestats(1,tape_stats); //reading of tape statistics
+-	_pprintLine_("   ADOLC statistics: ");
+-	_pprintLine_("   "<<setw(45)<<left<<"Number of independents: " <<tape_stats[0]);
+-	_pprintLine_("   "<<setw(45)<<left<<"Number of dependents: " <<tape_stats[1]);
+-	_pprintLine_("   "<<setw(45)<<left<<"Maximal number of live active variables: " <<tape_stats[2]);
+-	_pprintLine_("   "<<setw(45)<<left<<"Size of value stack (number of overwrites): " <<tape_stats[3]);
+-	_pprintLine_("   "<<setw(45)<<left<<"Buffer size (a multiple of eight): " <<tape_stats[4]);
+-	_pprintLine_("   "<<setw(45)<<left<<"Total number of operations recorded: " <<tape_stats[5]);
+-	#endif
+ 	
+ 	/*end module: */
+ 	ISSMEND();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13083)
+@@ -11,9 +11,7 @@
+ 
+ enum definitions{
+ 	/*Model fields {{{1*/
+-	AutodiffForwardEnum,
+ 	AutodiffIsautodiffEnum, 
+-	AutodiffReverseEnum,
+ 	BalancethicknessSpcthicknessEnum,
+ 	BalancethicknessStabilizationEnum,
+ 	BalancethicknessThickeningRateEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13083)
+@@ -17,9 +17,7 @@
+    int  stage=1;
+ 
+    if(stage==1){
+-	      if (strcmp(name,"AutodiffForward")==0) return AutodiffForwardEnum;
+-	      else if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum;
+-	      else if (strcmp(name,"AutodiffReverse")==0) return AutodiffReverseEnum;
++	      if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum;
+ 	      else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum;
+ 	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
+ 	      else if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
+@@ -137,12 +135,12 @@
+ 	      else if (strcmp(name,"MiscellaneousName")==0) return MiscellaneousNameEnum;
+ 	      else if (strcmp(name,"PrognosticHydrostaticAdjustment")==0) return PrognosticHydrostaticAdjustmentEnum;
+ 	      else if (strcmp(name,"PrognosticMinThickness")==0) return PrognosticMinThicknessEnum;
++	      else if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum;
++	      else if (strcmp(name,"PrognosticSpcthickness")==0) return PrognosticSpcthicknessEnum;
+          else stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum;
+-	      else if (strcmp(name,"PrognosticSpcthickness")==0) return PrognosticSpcthicknessEnum;
+-	      else if (strcmp(name,"PrognosticStabilization")==0) return PrognosticStabilizationEnum;
++	      if (strcmp(name,"PrognosticStabilization")==0) return PrognosticStabilizationEnum;
+ 	      else if (strcmp(name,"PrognosticVertexPairing")==0) return PrognosticVertexPairingEnum;
+ 	      else if (strcmp(name,"QmuIsdakota")==0) return QmuIsdakotaEnum;
+ 	      else if (strcmp(name,"QmuMassFluxSegments")==0) return QmuMassFluxSegmentsEnum;
+@@ -260,12 +258,12 @@
+ 	      else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
+ 	      else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
+ 	      else if (strcmp(name,"Contour")==0) return ContourEnum;
++	      else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
++	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
+-	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
+-	      else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
++	      if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
+ 	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
+ 	      else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
+ 	      else if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum;
+@@ -383,12 +381,12 @@
+ 	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+ 	      else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
+ 	      else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
++	      else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
++	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
+-	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+-	      else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
++	      if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
+ 	      else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
+ 	      else if (strcmp(name,"TransientInput")==0) return TransientInputEnum;
+ 	      else if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13083)
+@@ -16,9 +16,7 @@
+ 
+ 	switch(en){
+ 
+-		case AutodiffForwardEnum : return "AutodiffForward";
+ 		case AutodiffIsautodiffEnum : return "AutodiffIsautodiff";
+-		case AutodiffReverseEnum : return "AutodiffReverse";
+ 		case BalancethicknessSpcthicknessEnum : return "BalancethicknessSpcthickness";
+ 		case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization";
+ 		case BalancethicknessThickeningRateEnum : return "BalancethicknessThickeningRate";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 13083)
+@@ -85,8 +85,6 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject(ThermalIsenthalpyEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(MaterialsRheologyLawEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(AutodiffIsautodiffEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject(AutodiffForwardEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject(AutodiffReverseEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(QmuIsdakotaEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(InversionIscontrolEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(InversionTaoEnum));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.py	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.py	(revision 13083)
+@@ -16,8 +16,6 @@
+ 	def __init__(self):
+ 		# {{{ Properties
+ 		self.isautodiff = False
+-		self.forward    = True
+-		self.reverse    = False
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+@@ -27,8 +25,6 @@
+ 		# {{{ Display
+ 		string='   automatic differentiation parameters:'
+ 		string="%s\n%s"%(string,fielddisplay(self,'isautodiff','indicates if the automatic differentiation is activated'))
+-		string="%s\n%s"%(string,fielddisplay(self,'forward','forward differentiation'))
+-		string="%s\n%s"%(string,fielddisplay(self,'reverse','backward differentiation'))
+ 		return string
+ 		#}}}
+ 	def setdefaultparameters(self):
+@@ -42,7 +38,5 @@
+ 
+ 	def marshall(self,fid):    # {{{
+ 		WriteData(fid,'object',self,'fieldname','isautodiff','format','Boolean')
+-		WriteData(fid,'object',self,'fieldname','forward','format','Boolean')
+-		WriteData(fid,'object',self,'fieldname','reverse','format','Boolean')
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m	(revision 13083)
+@@ -6,8 +6,6 @@
+ classdef autodiff
+ 	properties (SetAccess=public) 
+ 		isautodiff = false;
+-		forward    = true;
+-		reverse    = false;
+ 	end
+ 	methods
+ 		function obj = autodiff(varargin) % {{{
+@@ -28,14 +26,10 @@
+ 			disp(sprintf('   automatic differentiation parameters:'));
+ 
+ 			fielddisplay(obj,'isautodiff','indicates if the automatic differentiation is activated');
+-			fielddisplay(obj,'forward','forward differentiation');
+-			fielddisplay(obj,'reverse','backward differentiation');
+ 
+ 		end % }}}
+ 		function marshall(obj,fid) % {{{
+ 			WriteData(fid,'object',obj,'fieldname','isautodiff','format','Boolean');
+-			WriteData(fid,'object',obj,'fieldname','forward','format','Boolean');
+-			WriteData(fid,'object',obj,'fieldname','reverse','format','Boolean');
+ 		end % }}}
+ 	end
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffReverseEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffReverseEnum.m	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffReverseEnum.m	(revision 13083)
+@@ -1,11 +0,0 @@
+-function macro=AutodiffReverseEnum()
+-%AUTODIFFREVERSEENUM - Enum of AutodiffReverse
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+-%            Please read src/c/EnumDefinitions/README for more information
+-%
+-%   Usage:
+-%      macro=AutodiffReverseEnum()
+-
+-macro=StringToEnum('AutodiffReverse');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffForwardEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffForwardEnum.m	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffForwardEnum.m	(revision 13083)
+@@ -1,11 +0,0 @@
+-function macro=AutodiffForwardEnum()
+-%AUTODIFFFORWARDENUM - Enum of AutodiffForward
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+-%            Please read src/c/EnumDefinitions/README for more information
+-%
+-%   Usage:
+-%      macro=AutodiffForwardEnum()
+-
+-macro=StringToEnum('AutodiffForward');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13083)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=461;
++macro=459;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13082)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13083)
+@@ -8,16 +8,6 @@
+ 
+ """
+ 
+-def AutodiffForwardEnum():
+-	"""
+-	AUTODIFFFORWARDENUM - Enum of AutodiffForward
+-
+-	   Usage:
+-	      macro=AutodiffForwardEnum()
+-	"""
+-
+-	return StringToEnum('AutodiffForward')[0]
+-
+ def AutodiffIsautodiffEnum():
+ 	"""
+ 	AUTODIFFISAUTODIFFENUM - Enum of AutodiffIsautodiff
+@@ -28,16 +18,6 @@
+ 
+ 	return StringToEnum('AutodiffIsautodiff')[0]
+ 
+-def AutodiffReverseEnum():
+-	"""
+-	AUTODIFFREVERSEENUM - Enum of AutodiffReverse
+-
+-	   Usage:
+-	      macro=AutodiffReverseEnum()
+-	"""
+-
+-	return StringToEnum('AutodiffReverse')[0]
+-
+ def BalancethicknessSpcthicknessEnum():
+ 	"""
+ 	BALANCETHICKNESSSPCTHICKNESSENUM - Enum of BalancethicknessSpcthickness
+@@ -4626,5 +4606,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 461
++	return 459
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13083-13084.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13083-13084.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13083-13084.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4	(revision 13083)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4	(revision 13084)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4
+___________________________________________________________________
+Modified: svn:ignore
+## -1 +1,7 ##
+ svn-commit.tmp
++ltsugar.m4
++libtool.m4
++ltversion.m4
++lt~obsolete.m4
++ltoptions.m4
++ltdl.m4
Index: /issm/oecreview/Archive/12678-13393/ISSM-13084-13085.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13084-13085.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13084-13085.diff	(revision 13394)
@@ -0,0 +1,30 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processmesh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processmesh.m	(revision 13084)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processmesh.m	(revision 13085)
+@@ -19,14 +19,12 @@
+ 
+ 	if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
+ 		x=md.mesh.x;
+-		if isfield(md.mesh,'x2d'), x2d=md.mesh.x2d; end
++		if isprop(md.mesh,'x2d'), x2d=md.mesh.x2d; end
+ 		y=md.mesh.y;
+-		if isfield(md.mesh,'y2d'), y2d=md.mesh.y2d; end
++		if isprop(md.mesh,'y2d'), y2d=md.mesh.y2d; end
+ 	else
+ 		x=md.mesh.long;
+-		%x2d=md.mesh.x2d; this sounds like something that was forgotten
+ 		y=md.mesh.lat;
+-		%y2d=md.mesh.y2d;
+ 	end
+ 
+ 	z_field=getfieldvalue(options,'z',md.mesh.z);
+@@ -39,7 +37,7 @@
+ 	end
+ 
+ 
+-	if isfield(md.mesh,'elements2d'), elements2d=md.mesh.elements2d; end
++	if isprop(md.mesh,'elements2d'), elements2d=md.mesh.elements2d; end
+ 	elements=md.mesh.elements;
+ 
+ 	%is it a 2d plot?
Index: /issm/oecreview/Archive/12678-13393/ISSM-13085-13086.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13085-13086.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13085-13086.diff	(revision 13394)
@@ -0,0 +1,7124 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13085)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13086)
+@@ -1021,19 +1021,16 @@
+ endif
+ 
+ if MODULES
+-if SHAREDLIBS
+-libISSMModules_la_SOURCES = $(module_sources)
+-libISSMModules_la_SOURCES += $(bamg_sources)
+-libISSMModules_la_SOURCES += $(kriging_sources)
+-libISSMModules_la_SOURCES += $(kml_sources)
+-endif
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
+ libISSMModules_a_SOURCES += $(kriging_sources)
+ libISSMModules_a_SOURCES += $(kml_sources)
+ libISSMModules_a_CXXFLAGS = $(ALLCXXFLAGS)
+ libISSMModules_a_LIBADD = ./libISSMCore.a
++if SHAREDLIBS
++libISSMModules_la_SOURCES = $(libISSMModules_a_SOURCES)
+ endif
++endif
+ 
+ if PYTHON
+ libISSMPython_a_SOURCES = $(python_sources)
+@@ -1041,18 +1038,18 @@
+ endif
+ 
+ if MATLAB
+-if SHAREDLIBS
+-libISSMMatlab_la_SOURCES = $(matlab_sources)
+-endif
+ libISSMMatlab_a_SOURCES = $(matlab_sources)
+ libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
++if SHAREDLIBS
++libISSMMatlab_la_SOURCES = $(libISSMMatlab_a_SOURCES)
+ endif
++endif
+ 
+-#if VERSION
+-#AM_LDFLAGS =
+-#else
+-#AM_LDFLAGS = -avoid-version
+-#endif
++if VERSION
++AM_LDFLAGS =
++else
++AM_LDFLAGS = -avoid-version
++endif
+ #}}}
+ #Overload library, to overload any non-standard symbols. {{{
+ libISSMOverload_a_SOURCES = ./shared/String/stricmp.c
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13085)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13086)
+@@ -4,41 +4,41 @@
+ 
+ #Modules {{{1
+ if MODULES
+-lib_LTLIBRARIES =  AverageFilter.la\
+-			       BamgMesher.la\
+-				   BamgConvertMesh.la\
+-				   BamgTriangulate.la\
+-				   ContourToMesh.la\
+-				   ContourToNodes.la\
+-				   ElementConnectivity.la\
+-				   EnumToString.la\
+-				   Exp2Kml.la\
+-				   HoleFiller.la\
+-				   InternalFront.la\
+-				   InterpFromGridToMesh.la\
+-				   InterpFromMeshToMesh2d.la\
+-				   InterpFromMeshToMesh3d.la\
+-				   InterpFromMeshToGrid.la\
+-				   InterpFromMesh2d.la\
+-				   KMLFileRead.la\
+-				   KMLMeshWrite.la\
+-				   KMLOverlay.la\
+-				   Kml2Exp.la\
+-				   Kriging.la\
+-				   Ll2xy.la\
+-				   NodeConnectivity.la\
+-				   MeshPartition.la\
+-				   MeshProfileIntersection.la\
+-				   PointCloudFindNeighbors.la\
+-				   PropagateFlagsFromConnectivity.la\
+-				   Shp2Kml.la\
+-				   StringToEnum.la\
+-				   TriaSearch.la\
+-				   TriMesh.la\
+-				   TriMeshProcessRifts.la\
+-				   Scotch.la\
+-				   Xy2ll.la\
+-                   Chaco.la
++lib_LTLIBRARIES =  AverageFilter.la
++#			       BamgMesher.la\
++#				   BamgConvertMesh.la\
++#				   BamgTriangulate.la\
++#				   ContourToMesh.la\
++#				   ContourToNodes.la\
++#				   ElementConnectivity.la\
++#				   EnumToString.la\
++#				   Exp2Kml.la\
++#				   HoleFiller.la\
++#				   InternalFront.la\
++#				   InterpFromGridToMesh.la\
++#				   InterpFromMeshToMesh2d.la\
++#				   InterpFromMeshToMesh3d.la\
++#				   InterpFromMeshToGrid.la\
++#				   InterpFromMesh2d.la\
++#				   KMLFileRead.la\
++#				   KMLMeshWrite.la\
++#				   KMLOverlay.la\
++#				   Kml2Exp.la\
++#				   Kriging.la\
++#				   Ll2xy.la\
++#				   NodeConnectivity.la\
++#				   MeshPartition.la\
++#				   MeshProfileIntersection.la\
++#				   PointCloudFindNeighbors.la\
++#				   PropagateFlagsFromConnectivity.la\
++#				   Shp2Kml.la\
++#				   StringToEnum.la\
++#				   TriaSearch.la\
++#				   TriMesh.la\
++#				   TriMeshProcessRifts.la\
++#				   Scotch.la\
++#				   Xy2ll.la\
++#                  Chaco.la
+ endif 
+ #}}}
+ #Flags and libraries {{{1
+@@ -90,143 +90,145 @@
+ #}}}
+ 
+ #Bin sources {{{1
++echo "WHAT IS MUMPS: " $(MUMPSLIB)
++echo "WHAT IS MPI  : " $(MPILIB)
+ AverageFilter_la_SOURCES = ../AverageFilter/AverageFilter.cpp\
+ 			  ../AverageFilter/AverageFilter.h
+-AverageFilter_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++AverageFilter_la_LIBADD = ${deps} $(PETSCLIB) $(MUMPSLIB) $(MPILIB) $(FLIBS) $(FORTRANLIB) $(METISLIB) $(MULTITHREADINGLIB)
+ 
+-BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\
+-					../BamgMesher/BamgMesher.h
+-BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\
++#					../BamgMesher/BamgMesher.h
++#BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-BamgConvertMesh_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
+-					../BamgConvertMesh/BamgConvertMesh.h
+-BamgConvertMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#BamgConvertMesh_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
++#					../BamgConvertMesh/BamgConvertMesh.h
++#BamgConvertMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-BamgTriangulate_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
+-								  ../BamgTriangulate/BamgTriangulate.h
+-BamgTriangulate_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#BamgTriangulate_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
++#								  ../BamgTriangulate/BamgTriangulate.h
++#BamgTriangulate_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Chaco_la_SOURCES = ../Chaco/Chaco.cpp\
+-					../Chaco/Chaco.h
+-Chaco_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(CHACOLIB)
++#Chaco_la_SOURCES = ../Chaco/Chaco.cpp\
++#					../Chaco/Chaco.h
++#Chaco_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(CHACOLIB)
+ 
+-ContourToMesh_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
+-			               ../ContourToMesh/ContourToMesh.h
+-ContourToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++#ContourToMesh_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
++#			               ../ContourToMesh/ContourToMesh.h
++#ContourToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
+-			  ../ContourToNodes/ContourToNodes.h
+-ContourToNodes_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
++#			  ../ContourToNodes/ContourToNodes.h
++#ContourToNodes_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+-			  ../ElementConnectivity/ElementConnectivity.h
+-ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
++#			  ../ElementConnectivity/ElementConnectivity.h
++#ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\
+-			  ../EnumToString/EnumToString.h
+-EnumToString_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\
++#			  ../EnumToString/EnumToString.h
++#EnumToString_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\
+-			  ../StringToEnum/StringToEnum.h
+-StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\
++#			  ../StringToEnum/StringToEnum.h
++#StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-HoleFiller_la_SOURCES = ../HoleFiller/HoleFiller.cpp\
+-			  ../HoleFiller/HoleFiller.h
+-HoleFiller_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 
++#HoleFiller_la_SOURCES = ../HoleFiller/HoleFiller.cpp\
++#			  ../HoleFiller/HoleFiller.h
++#HoleFiller_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 
+ 
+-InternalFront_la_SOURCES = ../InternalFront/InternalFront.cpp\
+-										 ../InternalFront/InternalFront.h
+-InternalFront_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#InternalFront_la_SOURCES = ../InternalFront/InternalFront.cpp\
++#										 ../InternalFront/InternalFront.h
++#InternalFront_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-InterpFromGridToMesh_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
+-			  ../InterpFromGridToMesh/InterpFromGridToMesh.h
+-InterpFromGridToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++#InterpFromGridToMesh_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
++#			  ../InterpFromGridToMesh/InterpFromGridToMesh.h
++#InterpFromGridToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
+-							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+-InterpFromMeshToMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++#InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
++#							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
++#InterpFromMeshToMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-InterpFromMeshToMesh3d_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
+-									../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
+-InterpFromMeshToMesh3d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#InterpFromMeshToMesh3d_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
++#									../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
++#InterpFromMeshToMesh3d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-InterpFromMeshToGrid_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
+-									../InterpFromMeshToGrid/InterpFromMeshToGrid.h
+-InterpFromMeshToGrid_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#InterpFromMeshToGrid_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
++#									../InterpFromMeshToGrid/InterpFromMeshToGrid.h
++#InterpFromMeshToGrid_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-InterpFromMesh2d_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
+-									../InterpFromMesh2d/InterpFromMesh2d.h
+-InterpFromMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++#InterpFromMesh2d_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
++#									../InterpFromMesh2d/InterpFromMesh2d.h
++#InterpFromMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-KMLFileRead_la_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
+-			  ../KMLFileRead/KMLFileRead.h
+-KMLFileRead_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#KMLFileRead_la_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
++#			  ../KMLFileRead/KMLFileRead.h
++#KMLFileRead_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-KMLMeshWrite_la_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
+-			  ../KMLMeshWrite/KMLMeshWrite.h
+-KMLMeshWrite_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#KMLMeshWrite_la_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
++#			  ../KMLMeshWrite/KMLMeshWrite.h
++#KMLMeshWrite_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-KMLOverlay_la_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
+-			  ../KMLOverlay/KMLOverlay.h
+-KMLOverlay_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#KMLOverlay_la_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
++#			  ../KMLOverlay/KMLOverlay.h
++#KMLOverlay_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Xy2ll_la_SOURCES = ../Xy2ll/Xy2ll.cpp\
+-			  ../Xy2ll/Xy2ll.h
+-Xy2ll_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#Xy2ll_la_SOURCES = ../Xy2ll/Xy2ll.cpp\
++#			  ../Xy2ll/Xy2ll.h
++#Xy2ll_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Ll2xy_la_SOURCES = ../Ll2xy/Ll2xy.cpp\
+-			  ../Ll2xy/Ll2xy.h
+-Ll2xy_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#Ll2xy_la_SOURCES = ../Ll2xy/Ll2xy.cpp\
++#			  ../Ll2xy/Ll2xy.h
++#Ll2xy_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Exp2Kml_la_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
+-			  ../Exp2Kml/Exp2Kml.h
+-Exp2Kml_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#Exp2Kml_la_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
++#			  ../Exp2Kml/Exp2Kml.h
++#Exp2Kml_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Kml2Exp_la_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
+-			  ../Kml2Exp/Kml2Exp.h
+-Kml2Exp_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#Kml2Exp_la_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
++#			  ../Kml2Exp/Kml2Exp.h
++#Kml2Exp_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Kriging_la_SOURCES = ../Kriging/Kriging.cpp\
+-						../Kriging/Kriging.h
+-Kriging_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++#Kriging_la_SOURCES = ../Kriging/Kriging.cpp\
++#						../Kriging/Kriging.h
++#Kriging_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\
+-			  ../MeshPartition/MeshPartition.h
+-MeshPartition_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\
++#			  ../MeshPartition/MeshPartition.h
++#MeshPartition_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
+-			  ../MeshProfileIntersection/MeshProfileIntersection.h
+-MeshProfileIntersection_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
++#			  ../MeshProfileIntersection/MeshProfileIntersection.h
++#MeshProfileIntersection_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
+-										../NodeConnectivity/NodeConnectivity.h
+-NodeConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
++#										../NodeConnectivity/NodeConnectivity.h
++#NodeConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-PointCloudFindNeighbors_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
+-			  ../PointCloudFindNeighbors/PointCloudFindNeighbors.h
+-PointCloudFindNeighbors_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++#PointCloudFindNeighbors_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
++#			  ../PointCloudFindNeighbors/PointCloudFindNeighbors.h
++#PointCloudFindNeighbors_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-PropagateFlagsFromConnectivity_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
+-			  ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
+-PropagateFlagsFromConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#PropagateFlagsFromConnectivity_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
++#			  ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
++#PropagateFlagsFromConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-Scotch_la_SOURCES = ../Scotch/Scotch.cpp\
+-                    ../Scotch/Scotch.h
+-Scotch_la_LIBADD = ${deps} $(SCOTCHLIB)
++#Scotch_la_SOURCES = ../Scotch/Scotch.cpp\
++#                    ../Scotch/Scotch.h
++#Scotch_la_LIBADD = ${deps} $(SCOTCHLIB)
+ 
+-Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
+-                     ../Shp2Kml/Shp2Kml.h
+-Shp2Kml_la_LIBADD = ${deps}
++#Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
++#                     ../Shp2Kml/Shp2Kml.h
++#Shp2Kml_la_LIBADD = ${deps}
+ 
+-TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp\
+-			  ../TriaSearch/TriaSearch.h
+-TriaSearch_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp\
++#			  ../TriaSearch/TriaSearch.h
++#TriaSearch_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
+-                     ../TriMesh/TriMesh.h
+-TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB)
++#TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
++#                     ../TriMesh/TriMesh.h
++#TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB)
+ 
+-TriMeshProcessRifts_la_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
+-			  ../TriMeshProcessRifts/TriMeshProcessRifts.h
+-TriMeshProcessRifts_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++#TriMeshProcessRifts_la_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
++#			  ../TriMeshProcessRifts/TriMeshProcessRifts.h
++#TriMeshProcessRifts_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ #}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/ltmain.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/ltmain.sh	(revision 13085)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/ltmain.sh	(revision 13086)
+@@ -1,9 +1,9 @@
+-# Generated from ltmain.m4sh.
+ 
+-# ltmain.sh (GNU libtool) 2.2.6b
++# libtool (GNU libtool) 2.4.2
+ # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+ 
+-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
++# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ # This is free software; see the source for copying conditions.  There is NO
+ # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ 
+@@ -32,50 +32,57 @@
+ #
+ # Provide generalized library-building support services.
+ #
+-#     --config             show all configuration variables
+-#     --debug              enable verbose shell tracing
+-# -n, --dry-run            display commands without modifying any files
+-#     --features           display basic configuration information and exit
+-#     --mode=MODE          use operation mode MODE
+-#     --preserve-dup-deps  don't remove duplicate dependency libraries
+-#     --quiet, --silent    don't print informational messages
+-#     --tag=TAG            use configuration variables from tag TAG
+-# -v, --verbose            print informational messages (default)
+-#     --version            print version information
+-# -h, --help               print short or long help message
++#       --config             show all configuration variables
++#       --debug              enable verbose shell tracing
++#   -n, --dry-run            display commands without modifying any files
++#       --features           display basic configuration information and exit
++#       --mode=MODE          use operation mode MODE
++#       --preserve-dup-deps  don't remove duplicate dependency libraries
++#       --quiet, --silent    don't print informational messages
++#       --no-quiet, --no-silent
++#                            print informational messages (default)
++#       --no-warn            don't display warning messages
++#       --tag=TAG            use configuration variables from tag TAG
++#   -v, --verbose            print more informational messages than default
++#       --no-verbose         don't print the extra informational messages
++#       --version            print version information
++#   -h, --help, --help-all   print short, long, or detailed help message
+ #
+ # MODE must be one of the following:
+ #
+-#       clean              remove files from the build directory
+-#       compile            compile a source file into a libtool object
+-#       execute            automatically set library path, then run a program
+-#       finish             complete the installation of libtool libraries
+-#       install            install libraries or executables
+-#       link               create a library or an executable
+-#       uninstall          remove libraries from an installed directory
++#         clean              remove files from the build directory
++#         compile            compile a source file into a libtool object
++#         execute            automatically set library path, then run a program
++#         finish             complete the installation of libtool libraries
++#         install            install libraries or executables
++#         link               create a library or an executable
++#         uninstall          remove libraries from an installed directory
+ #
+-# MODE-ARGS vary depending on the MODE.
++# MODE-ARGS vary depending on the MODE.  When passed as first option,
++# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+ # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+ #
+ # When reporting a bug, please describe a test case to reproduce it and
+ # include the following information:
+ #
+-#       host-triplet:	$host
+-#       shell:		$SHELL
+-#       compiler:		$LTCC
+-#       compiler flags:		$LTCFLAGS
+-#       linker:		$LD (gnu? $with_gnu_ld)
+-#       $progname:		(GNU libtool) 2.2.6b
+-#       automake:		$automake_version
+-#       autoconf:		$autoconf_version
++#         host-triplet:	$host
++#         shell:		$SHELL
++#         compiler:		$LTCC
++#         compiler flags:		$LTCFLAGS
++#         linker:		$LD (gnu? $with_gnu_ld)
++#         $progname:	(GNU libtool) 2.4.2
++#         automake:	$automake_version
++#         autoconf:	$autoconf_version
+ #
+ # Report bugs to <bug-libtool@gnu.org>.
++# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
++# General help using GNU software: <http://www.gnu.org/gethelp/>.
+ 
+-PROGRAM=ltmain.sh
++PROGRAM=libtool
+ PACKAGE=libtool
+-VERSION=2.2.6b
++VERSION=2.4.2
+ TIMESTAMP=""
+-package_revision=1.3017
++package_revision=1.3337
+ 
+ # Be Bourne compatible
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+@@ -91,10 +98,15 @@
+ BIN_SH=xpg4; export BIN_SH # for Tru64
+ DUALCASE=1; export DUALCASE # for MKS sh
+ 
++# A function that is used when there is no print builtin or printf.
++func_fallback_echo ()
++{
++  eval 'cat <<_LTECHO_EOF
++$1
++_LTECHO_EOF'
++}
++
+ # NLS nuisances: We save the old values to restore during execute mode.
+-# Only set LANG and LC_ALL to C if already set.
+-# These must not be set unconditionally because not all systems understand
+-# e.g. LANG=C (notably SCO).
+ lt_user_locale=
+ lt_safe_locale=
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+@@ -107,24 +119,28 @@
+ 	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ 	fi"
+ done
++LC_ALL=C
++LANGUAGE=C
++export LANGUAGE LC_ALL
+ 
+ $lt_unset CDPATH
+ 
+ 
++# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
++# is ksh but when the shell is invoked as "sh" and the current value of
++# the _XPG environment variable is not equal to 1 (one), the special
++# positional parameter $0, within a function call, is the name of the
++# function.
++progpath="$0"
+ 
+ 
+ 
+ : ${CP="cp -f"}
+-: ${ECHO="echo"}
+-: ${EGREP="/bin/grep -E"}
+-: ${FGREP="/bin/grep -F"}
+-: ${GREP="/bin/grep"}
+-: ${LN_S="ln -s"}
++test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+ : ${MAKE="make"}
+ : ${MKDIR="mkdir"}
+ : ${MV="mv -f"}
+ : ${RM="rm -f"}
+-: ${SED="/bin/sed"}
+ : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+ : ${Xsed="$SED -e 1s/^X//"}
+ 
+@@ -144,6 +160,27 @@
+ dirname="s,/[^/]*$,,"
+ basename="s,^.*/,,"
+ 
++# func_dirname file append nondir_replacement
++# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
++# otherwise set result to NONDIR_REPLACEMENT.
++func_dirname ()
++{
++    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
++    if test "X$func_dirname_result" = "X${1}"; then
++      func_dirname_result="${3}"
++    else
++      func_dirname_result="$func_dirname_result${2}"
++    fi
++} # func_dirname may be replaced by extended shell implementation
++
++
++# func_basename file
++func_basename ()
++{
++    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
++} # func_basename may be replaced by extended shell implementation
++
++
+ # func_dirname_and_basename file append nondir_replacement
+ # perform func_basename and func_dirname in a single function
+ # call:
+@@ -158,33 +195,183 @@
+ # those functions but instead duplicate the functionality here.
+ func_dirname_and_basename ()
+ {
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
++    # Extract subdirectory from the argument.
++    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
++    if test "X$func_dirname_result" = "X${1}"; then
++      func_dirname_result="${3}"
++    else
++      func_dirname_result="$func_dirname_result${2}"
++    fi
++    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
++} # func_dirname_and_basename may be replaced by extended shell implementation
++
++
++# func_stripname prefix suffix name
++# strip PREFIX and SUFFIX off of NAME.
++# PREFIX and SUFFIX must not contain globbing or regex special
++# characters, hashes, percent signs, but SUFFIX may contain a leading
++# dot (in which case that matches only a dot).
++# func_strip_suffix prefix name
++func_stripname ()
++{
++    case ${2} in
++      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++    esac
++} # func_stripname may be replaced by extended shell implementation
++
++
++# These SED scripts presuppose an absolute path with a trailing slash.
++pathcar='s,^/\([^/]*\).*$,\1,'
++pathcdr='s,^/[^/]*,,'
++removedotparts=':dotsl
++		s@/\./@/@g
++		t dotsl
++		s,/\.$,/,'
++collapseslashes='s@/\{1,\}@/@g'
++finalslash='s,/*$,/,'
++
++# func_normal_abspath PATH
++# Remove doubled-up and trailing slashes, "." path components,
++# and cancel out any ".." path components in PATH after making
++# it an absolute path.
++#             value returned in "$func_normal_abspath_result"
++func_normal_abspath ()
++{
++  # Start from root dir and reassemble the path.
++  func_normal_abspath_result=
++  func_normal_abspath_tpath=$1
++  func_normal_abspath_altnamespace=
++  case $func_normal_abspath_tpath in
++    "")
++      # Empty path, that just means $cwd.
++      func_stripname '' '/' "`pwd`"
++      func_normal_abspath_result=$func_stripname_result
++      return
++    ;;
++    # The next three entries are used to spot a run of precisely
++    # two leading slashes without using negated character classes;
++    # we take advantage of case's first-match behaviour.
++    ///*)
++      # Unusual form of absolute path, do nothing.
++    ;;
++    //*)
++      # Not necessarily an ordinary path; POSIX reserves leading '//'
++      # and for example Cygwin uses it to access remote file shares
++      # over CIFS/SMB, so we conserve a leading double slash if found.
++      func_normal_abspath_altnamespace=/
++    ;;
++    /*)
++      # Absolute path, do nothing.
++    ;;
++    *)
++      # Relative path, prepend $cwd.
++      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
++    ;;
++  esac
++  # Cancel out all the simple stuff to save iterations.  We also want
++  # the path to end with a slash for ease of parsing, so make sure
++  # there is one (and only one) here.
++  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
++        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
++  while :; do
++    # Processed it all yet?
++    if test "$func_normal_abspath_tpath" = / ; then
++      # If we ascended to the root using ".." the result may be empty now.
++      if test -z "$func_normal_abspath_result" ; then
++        func_normal_abspath_result=/
++      fi
++      break
++    fi
++    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
++        -e "$pathcar"`
++    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
++        -e "$pathcdr"`
++    # Figure out what to do with it
++    case $func_normal_abspath_tcomponent in
++      "")
++        # Trailing empty path component, ignore it.
++      ;;
++      ..)
++        # Parent dir; strip last assembled component from result.
++        func_dirname "$func_normal_abspath_result"
++        func_normal_abspath_result=$func_dirname_result
++      ;;
++      *)
++        # Actual path component, append it.
++        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
++      ;;
++    esac
++  done
++  # Restore leading double-slash if one was found on entry.
++  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+ }
+ 
+-# Generated shell functions inserted here.
++# func_relative_path SRCDIR DSTDIR
++# generates a relative path from SRCDIR to DSTDIR, with a trailing
++# slash if non-empty, suitable for immediately appending a filename
++# without needing to append a separator.
++#             value returned in "$func_relative_path_result"
++func_relative_path ()
++{
++  func_relative_path_result=
++  func_normal_abspath "$1"
++  func_relative_path_tlibdir=$func_normal_abspath_result
++  func_normal_abspath "$2"
++  func_relative_path_tbindir=$func_normal_abspath_result
+ 
+-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+-# is ksh but when the shell is invoked as "sh" and the current value of
+-# the _XPG environment variable is not equal to 1 (one), the special
+-# positional parameter $0, within a function call, is the name of the
+-# function.
+-progpath="$0"
++  # Ascend the tree starting from libdir
++  while :; do
++    # check if we have found a prefix of bindir
++    case $func_relative_path_tbindir in
++      $func_relative_path_tlibdir)
++        # found an exact match
++        func_relative_path_tcancelled=
++        break
++        ;;
++      $func_relative_path_tlibdir*)
++        # found a matching prefix
++        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
++        func_relative_path_tcancelled=$func_stripname_result
++        if test -z "$func_relative_path_result"; then
++          func_relative_path_result=.
++        fi
++        break
++        ;;
++      *)
++        func_dirname $func_relative_path_tlibdir
++        func_relative_path_tlibdir=${func_dirname_result}
++        if test "x$func_relative_path_tlibdir" = x ; then
++          # Have to descend all the way to the root!
++          func_relative_path_result=../$func_relative_path_result
++          func_relative_path_tcancelled=$func_relative_path_tbindir
++          break
++        fi
++        func_relative_path_result=../$func_relative_path_result
++        ;;
++    esac
++  done
+ 
++  # Now calculate path; take care to avoid doubling-up slashes.
++  func_stripname '' '/' "$func_relative_path_result"
++  func_relative_path_result=$func_stripname_result
++  func_stripname '/' '/' "$func_relative_path_tcancelled"
++  if test "x$func_stripname_result" != x ; then
++    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
++  fi
++
++  # Normalisation. If bindir is libdir, return empty string,
++  # else relative path ending with a slash; either way, target
++  # file name can be directly appended.
++  if test ! -z "$func_relative_path_result"; then
++    func_stripname './' '' "$func_relative_path_result/"
++    func_relative_path_result=$func_stripname_result
++  fi
++}
++
+ # The name of this program:
+-# In the unlikely event $progname began with a '-', it would play havoc with
+-# func_echo (imagine progname=-n), so we prepend ./ in that case:
+ func_dirname_and_basename "$progpath"
+ progname=$func_basename_result
+-case $progname in
+-  -*) progname=./$progname ;;
+-esac
+ 
+ # Make sure we have an absolute path for reexecution:
+ case $progpath in
+@@ -196,7 +383,7 @@
+      ;;
+   *)
+      save_IFS="$IFS"
+-     IFS=:
++     IFS=${PATH_SEPARATOR-:}
+      for progdir in $PATH; do
+        IFS="$save_IFS"
+        test -x "$progdir/$progname" && break
+@@ -215,6 +402,15 @@
+ # Same as above, but do not quote variable references.
+ double_quote_subst='s/\(["`\\]\)/\\\1/g'
+ 
++# Sed substitution that turns a string into a regex matching for the
++# string literally.
++sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
++
++# Sed substitution that converts a w32 file name or path
++# which contains forward slashes, into one that contains
++# (escaped) backslashes.  A very naive implementation.
++lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
++
+ # Re-`\' parameter expansions in output of double_quote_subst that were
+ # `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+ # in input to double_quote_subst, that '$' was protected from expansion.
+@@ -243,7 +439,7 @@
+ # name if it has been set yet.
+ func_echo ()
+ {
+-    $ECHO "$progname${mode+: }$mode: $*"
++    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+ }
+ 
+ # func_verbose arg...
+@@ -258,18 +454,25 @@
+     :
+ }
+ 
++# func_echo_all arg...
++# Invoke $ECHO with all args, space-separated.
++func_echo_all ()
++{
++    $ECHO "$*"
++}
++
+ # func_error arg...
+ # Echo program name prefixed message to standard error.
+ func_error ()
+ {
+-    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
++    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+ }
+ 
+ # func_warning arg...
+ # Echo program name prefixed warning message to standard error.
+ func_warning ()
+ {
+-    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
++    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+ 
+     # bash bug again:
+     :
+@@ -326,9 +529,9 @@
+         case $my_directory_path in */*) ;; *) break ;; esac
+ 
+         # ...otherwise throw away the child directory and loop
+-        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
++        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+       done
+-      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
++      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+ 
+       save_mkdir_p_IFS="$IFS"; IFS=':'
+       for my_dir in $my_dir_list; do
+@@ -378,7 +581,7 @@
+         func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+     fi
+ 
+-    $ECHO "X$my_tmpdir" | $Xsed
++    $ECHO "$my_tmpdir"
+ }
+ 
+ 
+@@ -392,7 +595,7 @@
+ {
+     case $1 in
+       *[\\\`\"\$]*)
+-	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
++	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+       *)
+         func_quote_for_eval_unquoted_result="$1" ;;
+     esac
+@@ -419,7 +622,7 @@
+ {
+     case $1 in
+       *[\\\`\"]*)
+-	my_arg=`$ECHO "X$1" | $Xsed \
++	my_arg=`$ECHO "$1" | $SED \
+ 	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+       *)
+         my_arg="$1" ;;
+@@ -488,15 +691,39 @@
+     fi
+ }
+ 
++# func_tr_sh
++# Turn $1 into a string suitable for a shell variable name.
++# Result is stored in $func_tr_sh_result.  All characters
++# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
++# if $1 begins with a digit, a '_' is prepended as well.
++func_tr_sh ()
++{
++  case $1 in
++  [0-9]* | *[!a-zA-Z0-9_]*)
++    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
++    ;;
++  * )
++    func_tr_sh_result=$1
++    ;;
++  esac
++}
+ 
+ 
+-
+-
+ # func_version
+ # Echo version message to standard output and exit.
+ func_version ()
+ {
+-    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
++    $opt_debug
++
++    $SED -n '/(C)/!b go
++	:more
++	/\./!{
++	  N
++	  s/\n# / /
++	  b more
++	}
++	:go
++	/^# '$PROGRAM' (GNU /,/# warranty; / {
+         s/^# //
+ 	s/^# *$//
+         s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+@@ -509,22 +736,28 @@
+ # Echo short help message to standard output and exit.
+ func_usage ()
+ {
+-    $SED -n '/^# Usage:/,/# -h/ {
++    $opt_debug
++
++    $SED -n '/^# Usage:/,/^#  *.*--help/ {
+         s/^# //
+ 	s/^# *$//
+ 	s/\$progname/'$progname'/
+ 	p
+     }' < "$progpath"
+-    $ECHO
++    echo
+     $ECHO "run \`$progname --help | more' for full usage"
+     exit $?
+ }
+ 
+-# func_help
+-# Echo long help message to standard output and exit.
++# func_help [NOEXIT]
++# Echo long help message to standard output and exit,
++# unless 'noexit' is passed as argument.
+ func_help ()
+ {
++    $opt_debug
++
+     $SED -n '/^# Usage:/,/# Report bugs to/ {
++	:print
+         s/^# //
+ 	s/^# *$//
+ 	s*\$progname*'$progname'*
+@@ -534,11 +767,18 @@
+ 	s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ 	s*\$LD*'"$LD"'*
+ 	s/\$with_gnu_ld/'"$with_gnu_ld"'/
+-	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+-	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
++	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
++	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+ 	p
+-     }' < "$progpath"
+-    exit $?
++	d
++     }
++     /^# .* home page:/b print
++     /^# General help using/b print
++     ' < "$progpath"
++    ret=$?
++    if test -z "$1"; then
++      exit $ret
++    fi
+ }
+ 
+ # func_missing_arg argname
+@@ -546,63 +786,106 @@
+ # exit_cmd.
+ func_missing_arg ()
+ {
+-    func_error "missing argument for $1"
++    $opt_debug
++
++    func_error "missing argument for $1."
+     exit_cmd=exit
+ }
+ 
+-exit_cmd=:
+ 
++# func_split_short_opt shortopt
++# Set func_split_short_opt_name and func_split_short_opt_arg shell
++# variables after splitting SHORTOPT after the 2nd character.
++func_split_short_opt ()
++{
++    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
++    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+ 
++    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
++    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
++} # func_split_short_opt may be replaced by extended shell implementation
+ 
+ 
++# func_split_long_opt longopt
++# Set func_split_long_opt_name and func_split_long_opt_arg shell
++# variables after splitting LONGOPT at the `=' sign.
++func_split_long_opt ()
++{
++    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
++    my_sed_long_arg='1s/^--[^=]*=//'
+ 
+-# Check that we have a working $ECHO.
+-if test "X$1" = X--no-reexec; then
+-  # Discard the --no-reexec flag, and continue.
+-  shift
+-elif test "X$1" = X--fallback-echo; then
+-  # Avoid inline document here, it may be left over
+-  :
+-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+-  # Yippee, $ECHO works!
+-  :
+-else
+-  # Restart under the correct shell, and then maybe $ECHO will work.
+-  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+-fi
++    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
++    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
++} # func_split_long_opt may be replaced by extended shell implementation
+ 
+-if test "X$1" = X--fallback-echo; then
+-  # used as fallback echo
+-  shift
+-  cat <<EOF
+-$*
+-EOF
+-  exit $EXIT_SUCCESS
+-fi
++exit_cmd=:
+ 
++
++
++
++
+ magic="%%%MAGIC variable%%%"
+ magic_exe="%%%MAGIC EXE variable%%%"
+ 
+ # Global variables.
+-# $mode is unset
+ nonopt=
+-execute_dlfiles=
+ preserve_args=
+ lo2o="s/\\.lo\$/.${objext}/"
+ o2lo="s/\\.${objext}\$/.lo/"
+ extracted_archives=
+ extracted_serial=0
+ 
+-opt_dry_run=false
+-opt_duplicate_deps=false
+-opt_silent=false
+-opt_debug=:
+-
+ # If this variable is set in any of the actions, the command in it
+ # will be execed at the end.  This prevents here-documents from being
+ # left over by shells.
+ exec_cmd=
+ 
++# func_append var value
++# Append VALUE to the end of shell variable VAR.
++func_append ()
++{
++    eval "${1}=\$${1}\${2}"
++} # func_append may be replaced by extended shell implementation
++
++# func_append_quoted var value
++# Quote VALUE and append to the end of shell variable VAR, separated
++# by a space.
++func_append_quoted ()
++{
++    func_quote_for_eval "${2}"
++    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
++} # func_append_quoted may be replaced by extended shell implementation
++
++
++# func_arith arithmetic-term...
++func_arith ()
++{
++    func_arith_result=`expr "${@}"`
++} # func_arith may be replaced by extended shell implementation
++
++
++# func_len string
++# STRING may not start with a hyphen.
++func_len ()
++{
++    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
++} # func_len may be replaced by extended shell implementation
++
++
++# func_lo2o object
++func_lo2o ()
++{
++    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
++} # func_lo2o may be replaced by extended shell implementation
++
++
++# func_xform libobj-or-source
++func_xform ()
++{
++    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
++} # func_xform may be replaced by extended shell implementation
++
++
+ # func_fatal_configuration arg...
+ # Echo program name prefixed message to standard error, followed by
+ # a configuration failure hint, and exit.
+@@ -636,16 +919,16 @@
+ # Display the features supported by this script.
+ func_features ()
+ {
+-    $ECHO "host: $host"
++    echo "host: $host"
+     if test "$build_libtool_libs" = yes; then
+-      $ECHO "enable shared libraries"
++      echo "enable shared libraries"
+     else
+-      $ECHO "disable shared libraries"
++      echo "disable shared libraries"
+     fi
+     if test "$build_old_libs" = yes; then
+-      $ECHO "enable static libraries"
++      echo "enable static libraries"
+     else
+-      $ECHO "disable static libraries"
++      echo "disable static libraries"
+     fi
+ 
+     exit $?
+@@ -692,201 +975,255 @@
+   esac
+ }
+ 
+-# Parse options once, thoroughly.  This comes as soon as possible in
+-# the script to make things like `libtool --version' happen quickly.
++# func_check_version_match
++# Ensure that we are using m4 macros, and libtool script from the same
++# release of libtool.
++func_check_version_match ()
+ {
++  if test "$package_revision" != "$macro_revision"; then
++    if test "$VERSION" != "$macro_version"; then
++      if test -z "$macro_version"; then
++        cat >&2 <<_LT_EOF
++$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
++$progname: definition of this LT_INIT comes from an older release.
++$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
++$progname: and run autoconf again.
++_LT_EOF
++      else
++        cat >&2 <<_LT_EOF
++$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
++$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
++$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
++$progname: and run autoconf again.
++_LT_EOF
++      fi
++    else
++      cat >&2 <<_LT_EOF
++$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
++$progname: but the definition of this LT_INIT comes from revision $macro_revision.
++$progname: You should recreate aclocal.m4 with macros from revision $package_revision
++$progname: of $PACKAGE $VERSION and run autoconf again.
++_LT_EOF
++    fi
+ 
+-  # Shorthand for --mode=foo, only valid as the first argument
+-  case $1 in
+-  clean|clea|cle|cl)
+-    shift; set dummy --mode clean ${1+"$@"}; shift
+-    ;;
+-  compile|compil|compi|comp|com|co|c)
+-    shift; set dummy --mode compile ${1+"$@"}; shift
+-    ;;
+-  execute|execut|execu|exec|exe|ex|e)
+-    shift; set dummy --mode execute ${1+"$@"}; shift
+-    ;;
+-  finish|finis|fini|fin|fi|f)
+-    shift; set dummy --mode finish ${1+"$@"}; shift
+-    ;;
+-  install|instal|insta|inst|ins|in|i)
+-    shift; set dummy --mode install ${1+"$@"}; shift
+-    ;;
+-  link|lin|li|l)
+-    shift; set dummy --mode link ${1+"$@"}; shift
+-    ;;
+-  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+-    shift; set dummy --mode uninstall ${1+"$@"}; shift
+-    ;;
+-  esac
++    exit $EXIT_MISMATCH
++  fi
++}
+ 
+-  # Parse non-mode specific arguments:
+-  while test "$#" -gt 0; do
++
++# Shorthand for --mode=foo, only valid as the first argument
++case $1 in
++clean|clea|cle|cl)
++  shift; set dummy --mode clean ${1+"$@"}; shift
++  ;;
++compile|compil|compi|comp|com|co|c)
++  shift; set dummy --mode compile ${1+"$@"}; shift
++  ;;
++execute|execut|execu|exec|exe|ex|e)
++  shift; set dummy --mode execute ${1+"$@"}; shift
++  ;;
++finish|finis|fini|fin|fi|f)
++  shift; set dummy --mode finish ${1+"$@"}; shift
++  ;;
++install|instal|insta|inst|ins|in|i)
++  shift; set dummy --mode install ${1+"$@"}; shift
++  ;;
++link|lin|li|l)
++  shift; set dummy --mode link ${1+"$@"}; shift
++  ;;
++uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
++  shift; set dummy --mode uninstall ${1+"$@"}; shift
++  ;;
++esac
++
++
++
++# Option defaults:
++opt_debug=:
++opt_dry_run=false
++opt_config=false
++opt_preserve_dup_deps=false
++opt_features=false
++opt_finish=false
++opt_help=false
++opt_help_all=false
++opt_silent=:
++opt_warning=:
++opt_verbose=:
++opt_silent=false
++opt_verbose=false
++
++
++# Parse options once, thoroughly.  This comes as soon as possible in the
++# script to make things like `--version' happen as quickly as we can.
++{
++  # this just eases exit handling
++  while test $# -gt 0; do
+     opt="$1"
+     shift
+-
+     case $opt in
+-      --config)		func_config					;;
+-
+-      --debug)		preserve_args="$preserve_args $opt"
++      --debug|-x)	opt_debug='set -x'
+ 			func_echo "enabling shell trace mode"
+-			opt_debug='set -x'
+ 			$opt_debug
+ 			;;
+-
+-      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+-			execute_dlfiles="$execute_dlfiles $1"
+-			shift
++      --dry-run|--dryrun|-n)
++			opt_dry_run=:
+ 			;;
+-
+-      --dry-run | -n)	opt_dry_run=:					;;
+-      --features)       func_features					;;
+-      --finish)		mode="finish"					;;
+-
+-      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+-			case $1 in
+-			  # Valid mode arguments:
+-			  clean)	;;
+-			  compile)	;;
+-			  execute)	;;
+-			  finish)	;;
+-			  install)	;;
+-			  link)		;;
+-			  relink)	;;
+-			  uninstall)	;;
+-
+-			  # Catch anything else as an error
+-			  *) func_error "invalid argument for $opt"
+-			     exit_cmd=exit
+-			     break
+-			     ;;
+-		        esac
+-
+-			mode="$1"
++      --config)
++			opt_config=:
++func_config
++			;;
++      --dlopen|-dlopen)
++			optarg="$1"
++			opt_dlopen="${opt_dlopen+$opt_dlopen
++}$optarg"
+ 			shift
+ 			;;
+-
+       --preserve-dup-deps)
+-			opt_duplicate_deps=:				;;
++			opt_preserve_dup_deps=:
++			;;
++      --features)
++			opt_features=:
++func_features
++			;;
++      --finish)
++			opt_finish=:
++set dummy --mode finish ${1+"$@"}; shift
++			;;
++      --help)
++			opt_help=:
++			;;
++      --help-all)
++			opt_help_all=:
++opt_help=': help-all'
++			;;
++      --mode)
++			test $# = 0 && func_missing_arg $opt && break
++			optarg="$1"
++			opt_mode="$optarg"
++case $optarg in
++  # Valid mode arguments:
++  clean|compile|execute|finish|install|link|relink|uninstall) ;;
+ 
+-      --quiet|--silent)	preserve_args="$preserve_args $opt"
+-			opt_silent=:
++  # Catch anything else as an error
++  *) func_error "invalid argument for $opt"
++     exit_cmd=exit
++     break
++     ;;
++esac
++			shift
+ 			;;
+-
+-      --verbose| -v)	preserve_args="$preserve_args $opt"
++      --no-silent|--no-quiet)
+ 			opt_silent=false
++func_append preserve_args " $opt"
+ 			;;
+-
+-      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+-			preserve_args="$preserve_args $opt $1"
+-			func_enable_tag "$1"	# tagname is set here
++      --no-warning|--no-warn)
++			opt_warning=false
++func_append preserve_args " $opt"
++			;;
++      --no-verbose)
++			opt_verbose=false
++func_append preserve_args " $opt"
++			;;
++      --silent|--quiet)
++			opt_silent=:
++func_append preserve_args " $opt"
++        opt_verbose=false
++			;;
++      --verbose|-v)
++			opt_verbose=:
++func_append preserve_args " $opt"
++opt_silent=false
++			;;
++      --tag)
++			test $# = 0 && func_missing_arg $opt && break
++			optarg="$1"
++			opt_tag="$optarg"
++func_append preserve_args " $opt $optarg"
++func_enable_tag "$optarg"
+ 			shift
+ 			;;
+ 
++      -\?|-h)		func_usage				;;
++      --help)		func_help				;;
++      --version)	func_version				;;
++
+       # Separate optargs to long options:
+-      -dlopen=*|--mode=*|--tag=*)
+-			func_opt_split "$opt"
+-			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
++      --*=*)
++			func_split_long_opt "$opt"
++			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ 			shift
+ 			;;
+ 
+-      -\?|-h)		func_usage					;;
+-      --help)		opt_help=:					;;
+-      --version)	func_version					;;
++      # Separate non-argument short options:
++      -\?*|-h*|-n*|-v*)
++			func_split_short_opt "$opt"
++			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
++			shift
++			;;
+ 
+-      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
+-
+-      *)		nonopt="$opt"
+-			break
+-			;;
++      --)		break					;;
++      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
++      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
+     esac
+   done
+ 
++  # Validate options:
+ 
++  # save first non-option argument
++  if test "$#" -gt 0; then
++    nonopt="$opt"
++    shift
++  fi
++
++  # preserve --debug
++  test "$opt_debug" = : || func_append preserve_args " --debug"
++
+   case $host in
+     *cygwin* | *mingw* | *pw32* | *cegcc*)
+       # don't eliminate duplications in $postdeps and $predeps
+       opt_duplicate_compiler_generated_deps=:
+       ;;
+     *)
+-      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
++      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+       ;;
+   esac
+ 
+-  # Having warned about all mis-specified options, bail out if
+-  # anything was wrong.
+-  $exit_cmd $EXIT_FAILURE
+-}
++  $opt_help || {
++    # Sanity checks first:
++    func_check_version_match
+ 
+-# func_check_version_match
+-# Ensure that we are using m4 macros, and libtool script from the same
+-# release of libtool.
+-func_check_version_match ()
+-{
+-  if test "$package_revision" != "$macro_revision"; then
+-    if test "$VERSION" != "$macro_version"; then
+-      if test -z "$macro_version"; then
+-        cat >&2 <<_LT_EOF
+-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+-$progname: definition of this LT_INIT comes from an older release.
+-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+-$progname: and run autoconf again.
+-_LT_EOF
+-      else
+-        cat >&2 <<_LT_EOF
+-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+-$progname: and run autoconf again.
+-_LT_EOF
+-      fi
+-    else
+-      cat >&2 <<_LT_EOF
+-$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+-$progname: of $PACKAGE $VERSION and run autoconf again.
+-_LT_EOF
++    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
++      func_fatal_configuration "not configured to build any kind of library"
+     fi
+ 
+-    exit $EXIT_MISMATCH
+-  fi
+-}
++    # Darwin sucks
++    eval std_shrext=\"$shrext_cmds\"
+ 
++    # Only execute mode is allowed to have -dlopen flags.
++    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
++      func_error "unrecognized option \`-dlopen'"
++      $ECHO "$help" 1>&2
++      exit $EXIT_FAILURE
++    fi
+ 
+-## ----------- ##
+-##    Main.    ##
+-## ----------- ##
++    # Change the help message to a mode-specific one.
++    generic_help="$help"
++    help="Try \`$progname --help --mode=$opt_mode' for more information."
++  }
+ 
+-$opt_help || {
+-  # Sanity checks first:
+-  func_check_version_match
+ 
+-  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+-    func_fatal_configuration "not configured to build any kind of library"
+-  fi
++  # Bail if the options were screwed
++  $exit_cmd $EXIT_FAILURE
++}
+ 
+-  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+ 
+ 
+-  # Darwin sucks
+-  eval std_shrext=\"$shrext_cmds\"
+ 
++## ----------- ##
++##    Main.    ##
++## ----------- ##
+ 
+-  # Only execute mode is allowed to have -dlopen flags.
+-  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+-    func_error "unrecognized option \`-dlopen'"
+-    $ECHO "$help" 1>&2
+-    exit $EXIT_FAILURE
+-  fi
+-
+-  # Change the help message to a mode-specific one.
+-  generic_help="$help"
+-  help="Try \`$progname --help --mode=$mode' for more information."
+-}
+-
+-
+ # func_lalib_p file
+ # True iff FILE is a libtool `.la' library or `.lo' object file.
+ # This function is only a basic sanity check; it will hardly flush out
+@@ -950,12 +1287,9 @@
+ # temporary ltwrapper_script.
+ func_ltwrapper_scriptname ()
+ {
+-    func_ltwrapper_scriptname_result=""
+-    if func_ltwrapper_executable_p "$1"; then
+-	func_dirname_and_basename "$1" "" "."
+-	func_stripname '' '.exe' "$func_basename_result"
+-	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+-    fi
++    func_dirname_and_basename "$1" "" "."
++    func_stripname '' '.exe' "$func_basename_result"
++    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+ }
+ 
+ # func_ltwrapper_p file
+@@ -1001,6 +1335,37 @@
+ }
+ 
+ 
++# func_resolve_sysroot PATH
++# Replace a leading = in PATH with a sysroot.  Store the result into
++# func_resolve_sysroot_result
++func_resolve_sysroot ()
++{
++  func_resolve_sysroot_result=$1
++  case $func_resolve_sysroot_result in
++  =*)
++    func_stripname '=' '' "$func_resolve_sysroot_result"
++    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
++    ;;
++  esac
++}
++
++# func_replace_sysroot PATH
++# If PATH begins with the sysroot, replace it with = and
++# store the result into func_replace_sysroot_result.
++func_replace_sysroot ()
++{
++  case "$lt_sysroot:$1" in
++  ?*:"$lt_sysroot"*)
++    func_stripname "$lt_sysroot" '' "$1"
++    func_replace_sysroot_result="=$func_stripname_result"
++    ;;
++  *)
++    # Including no sysroot.
++    func_replace_sysroot_result=$1
++    ;;
++  esac
++}
++
+ # func_infer_tag arg
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+@@ -1013,13 +1378,15 @@
+     if test -n "$available_tags" && test -z "$tagname"; then
+       CC_quoted=
+       for arg in $CC; do
+-        func_quote_for_eval "$arg"
+-	CC_quoted="$CC_quoted $func_quote_for_eval_result"
++	func_append_quoted CC_quoted "$arg"
+       done
++      CC_expanded=`func_echo_all $CC`
++      CC_quoted_expanded=`func_echo_all $CC_quoted`
+       case $@ in
+       # Blanks in the command may have been stripped by the calling shell,
+       # but not from the CC environment variable when configure was run.
+-      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
++      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
++      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+       # Blanks at the start of $base_compile will cause this to fail
+       # if we don't check for them as well.
+       *)
+@@ -1030,11 +1397,13 @@
+ 	    CC_quoted=
+ 	    for arg in $CC; do
+ 	      # Double-quote args containing other shell metacharacters.
+-	      func_quote_for_eval "$arg"
+-	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
++	      func_append_quoted CC_quoted "$arg"
+ 	    done
++	    CC_expanded=`func_echo_all $CC`
++	    CC_quoted_expanded=`func_echo_all $CC_quoted`
+ 	    case "$@ " in
+-	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
++	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
++	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ 	      # The compiler in the base compile command matches
+ 	      # the one in the tagged configuration.
+ 	      # Assume this is the tagged configuration we want.
+@@ -1097,6 +1466,486 @@
+     }
+ }
+ 
++
++##################################################
++# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
++##################################################
++
++# func_convert_core_file_wine_to_w32 ARG
++# Helper function used by file name conversion functions when $build is *nix,
++# and $host is mingw, cygwin, or some other w32 environment. Relies on a
++# correctly configured wine environment available, with the winepath program
++# in $build's $PATH.
++#
++# ARG is the $build file name to be converted to w32 format.
++# Result is available in $func_convert_core_file_wine_to_w32_result, and will
++# be empty on error (or when ARG is empty)
++func_convert_core_file_wine_to_w32 ()
++{
++  $opt_debug
++  func_convert_core_file_wine_to_w32_result="$1"
++  if test -n "$1"; then
++    # Unfortunately, winepath does not exit with a non-zero error code, so we
++    # are forced to check the contents of stdout. On the other hand, if the
++    # command is not found, the shell will set an exit code of 127 and print
++    # *an error message* to stdout. So we must check for both error code of
++    # zero AND non-empty stdout, which explains the odd construction:
++    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
++    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
++      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
++        $SED -e "$lt_sed_naive_backslashify"`
++    else
++      func_convert_core_file_wine_to_w32_result=
++    fi
++  fi
++}
++# end: func_convert_core_file_wine_to_w32
++
++
++# func_convert_core_path_wine_to_w32 ARG
++# Helper function used by path conversion functions when $build is *nix, and
++# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
++# configured wine environment available, with the winepath program in $build's
++# $PATH. Assumes ARG has no leading or trailing path separator characters.
++#
++# ARG is path to be converted from $build format to win32.
++# Result is available in $func_convert_core_path_wine_to_w32_result.
++# Unconvertible file (directory) names in ARG are skipped; if no directory names
++# are convertible, then the result may be empty.
++func_convert_core_path_wine_to_w32 ()
++{
++  $opt_debug
++  # unfortunately, winepath doesn't convert paths, only file names
++  func_convert_core_path_wine_to_w32_result=""
++  if test -n "$1"; then
++    oldIFS=$IFS
++    IFS=:
++    for func_convert_core_path_wine_to_w32_f in $1; do
++      IFS=$oldIFS
++      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
++      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
++        if test -z "$func_convert_core_path_wine_to_w32_result"; then
++          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
++        else
++          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
++        fi
++      fi
++    done
++    IFS=$oldIFS
++  fi
++}
++# end: func_convert_core_path_wine_to_w32
++
++
++# func_cygpath ARGS...
++# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
++# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
++# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
++# (2), returns the Cygwin file name or path in func_cygpath_result (input
++# file name or path is assumed to be in w32 format, as previously converted
++# from $build's *nix or MSYS format). In case (3), returns the w32 file name
++# or path in func_cygpath_result (input file name or path is assumed to be in
++# Cygwin format). Returns an empty string on error.
++#
++# ARGS are passed to cygpath, with the last one being the file name or path to
++# be converted.
++#
++# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
++# environment variable; do not put it in $PATH.
++func_cygpath ()
++{
++  $opt_debug
++  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
++    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
++    if test "$?" -ne 0; then
++      # on failure, ensure result is empty
++      func_cygpath_result=
++    fi
++  else
++    func_cygpath_result=
++    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
++  fi
++}
++#end: func_cygpath
++
++
++# func_convert_core_msys_to_w32 ARG
++# Convert file name or path ARG from MSYS format to w32 format.  Return
++# result in func_convert_core_msys_to_w32_result.
++func_convert_core_msys_to_w32 ()
++{
++  $opt_debug
++  # awkward: cmd appends spaces to result
++  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
++    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
++}
++#end: func_convert_core_msys_to_w32
++
++
++# func_convert_file_check ARG1 ARG2
++# Verify that ARG1 (a file name in $build format) was converted to $host
++# format in ARG2. Otherwise, emit an error message, but continue (resetting
++# func_to_host_file_result to ARG1).
++func_convert_file_check ()
++{
++  $opt_debug
++  if test -z "$2" && test -n "$1" ; then
++    func_error "Could not determine host file name corresponding to"
++    func_error "  \`$1'"
++    func_error "Continuing, but uninstalled executables may not work."
++    # Fallback:
++    func_to_host_file_result="$1"
++  fi
++}
++# end func_convert_file_check
++
++
++# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
++# Verify that FROM_PATH (a path in $build format) was converted to $host
++# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
++# func_to_host_file_result to a simplistic fallback value (see below).
++func_convert_path_check ()
++{
++  $opt_debug
++  if test -z "$4" && test -n "$3"; then
++    func_error "Could not determine the host path corresponding to"
++    func_error "  \`$3'"
++    func_error "Continuing, but uninstalled executables may not work."
++    # Fallback.  This is a deliberately simplistic "conversion" and
++    # should not be "improved".  See libtool.info.
++    if test "x$1" != "x$2"; then
++      lt_replace_pathsep_chars="s|$1|$2|g"
++      func_to_host_path_result=`echo "$3" |
++        $SED -e "$lt_replace_pathsep_chars"`
++    else
++      func_to_host_path_result="$3"
++    fi
++  fi
++}
++# end func_convert_path_check
++
++
++# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
++# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
++# and appending REPL if ORIG matches BACKPAT.
++func_convert_path_front_back_pathsep ()
++{
++  $opt_debug
++  case $4 in
++  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
++    ;;
++  esac
++  case $4 in
++  $2 ) func_append func_to_host_path_result "$3"
++    ;;
++  esac
++}
++# end func_convert_path_front_back_pathsep
++
++
++##################################################
++# $build to $host FILE NAME CONVERSION FUNCTIONS #
++##################################################
++# invoked via `$to_host_file_cmd ARG'
++#
++# In each case, ARG is the path to be converted from $build to $host format.
++# Result will be available in $func_to_host_file_result.
++
++
++# func_to_host_file ARG
++# Converts the file name ARG from $build format to $host format. Return result
++# in func_to_host_file_result.
++func_to_host_file ()
++{
++  $opt_debug
++  $to_host_file_cmd "$1"
++}
++# end func_to_host_file
++
++
++# func_to_tool_file ARG LAZY
++# converts the file name ARG from $build format to toolchain format. Return
++# result in func_to_tool_file_result.  If the conversion in use is listed
++# in (the comma separated) LAZY, no conversion takes place.
++func_to_tool_file ()
++{
++  $opt_debug
++  case ,$2, in
++    *,"$to_tool_file_cmd",*)
++      func_to_tool_file_result=$1
++      ;;
++    *)
++      $to_tool_file_cmd "$1"
++      func_to_tool_file_result=$func_to_host_file_result
++      ;;
++  esac
++}
++# end func_to_tool_file
++
++
++# func_convert_file_noop ARG
++# Copy ARG to func_to_host_file_result.
++func_convert_file_noop ()
++{
++  func_to_host_file_result="$1"
++}
++# end func_convert_file_noop
++
++
++# func_convert_file_msys_to_w32 ARG
++# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
++# conversion to w32 is not available inside the cwrapper.  Returns result in
++# func_to_host_file_result.
++func_convert_file_msys_to_w32 ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    func_convert_core_msys_to_w32 "$1"
++    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_msys_to_w32
++
++
++# func_convert_file_cygwin_to_w32 ARG
++# Convert file name ARG from Cygwin to w32 format.  Returns result in
++# func_to_host_file_result.
++func_convert_file_cygwin_to_w32 ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
++    # LT_CYGPATH in this case.
++    func_to_host_file_result=`cygpath -m "$1"`
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_cygwin_to_w32
++
++
++# func_convert_file_nix_to_w32 ARG
++# Convert file name ARG from *nix to w32 format.  Requires a wine environment
++# and a working winepath. Returns result in func_to_host_file_result.
++func_convert_file_nix_to_w32 ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    func_convert_core_file_wine_to_w32 "$1"
++    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_nix_to_w32
++
++
++# func_convert_file_msys_to_cygwin ARG
++# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
++# Returns result in func_to_host_file_result.
++func_convert_file_msys_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    func_convert_core_msys_to_w32 "$1"
++    func_cygpath -u "$func_convert_core_msys_to_w32_result"
++    func_to_host_file_result="$func_cygpath_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_msys_to_cygwin
++
++
++# func_convert_file_nix_to_cygwin ARG
++# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
++# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
++# in func_to_host_file_result.
++func_convert_file_nix_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
++    func_convert_core_file_wine_to_w32 "$1"
++    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
++    func_to_host_file_result="$func_cygpath_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_nix_to_cygwin
++
++
++#############################################
++# $build to $host PATH CONVERSION FUNCTIONS #
++#############################################
++# invoked via `$to_host_path_cmd ARG'
++#
++# In each case, ARG is the path to be converted from $build to $host format.
++# The result will be available in $func_to_host_path_result.
++#
++# Path separators are also converted from $build format to $host format.  If
++# ARG begins or ends with a path separator character, it is preserved (but
++# converted to $host format) on output.
++#
++# All path conversion functions are named using the following convention:
++#   file name conversion function    : func_convert_file_X_to_Y ()
++#   path conversion function         : func_convert_path_X_to_Y ()
++# where, for any given $build/$host combination the 'X_to_Y' value is the
++# same.  If conversion functions are added for new $build/$host combinations,
++# the two new functions must follow this pattern, or func_init_to_host_path_cmd
++# will break.
++
++
++# func_init_to_host_path_cmd
++# Ensures that function "pointer" variable $to_host_path_cmd is set to the
++# appropriate value, based on the value of $to_host_file_cmd.
++to_host_path_cmd=
++func_init_to_host_path_cmd ()
++{
++  $opt_debug
++  if test -z "$to_host_path_cmd"; then
++    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
++    to_host_path_cmd="func_convert_path_${func_stripname_result}"
++  fi
++}
++
++
++# func_to_host_path ARG
++# Converts the path ARG from $build format to $host format. Return result
++# in func_to_host_path_result.
++func_to_host_path ()
++{
++  $opt_debug
++  func_init_to_host_path_cmd
++  $to_host_path_cmd "$1"
++}
++# end func_to_host_path
++
++
++# func_convert_path_noop ARG
++# Copy ARG to func_to_host_path_result.
++func_convert_path_noop ()
++{
++  func_to_host_path_result="$1"
++}
++# end func_convert_path_noop
++
++
++# func_convert_path_msys_to_w32 ARG
++# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
++# conversion to w32 is not available inside the cwrapper.  Returns result in
++# func_to_host_path_result.
++func_convert_path_msys_to_w32 ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # Remove leading and trailing path separator characters from ARG.  MSYS
++    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
++    # and winepath ignores them completely.
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
++    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
++    func_convert_path_check : ";" \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++  fi
++}
++# end func_convert_path_msys_to_w32
++
++
++# func_convert_path_cygwin_to_w32 ARG
++# Convert path ARG from Cygwin to w32 format.  Returns result in
++# func_to_host_file_result.
++func_convert_path_cygwin_to_w32 ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # See func_convert_path_msys_to_w32:
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
++    func_convert_path_check : ";" \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++  fi
++}
++# end func_convert_path_cygwin_to_w32
++
++
++# func_convert_path_nix_to_w32 ARG
++# Convert path ARG from *nix to w32 format.  Requires a wine environment and
++# a working winepath.  Returns result in func_to_host_file_result.
++func_convert_path_nix_to_w32 ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # See func_convert_path_msys_to_w32:
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
++    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
++    func_convert_path_check : ";" \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++  fi
++}
++# end func_convert_path_nix_to_w32
++
++
++# func_convert_path_msys_to_cygwin ARG
++# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
++# Returns result in func_to_host_file_result.
++func_convert_path_msys_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # See func_convert_path_msys_to_w32:
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
++    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
++    func_to_host_path_result="$func_cygpath_result"
++    func_convert_path_check : : \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
++  fi
++}
++# end func_convert_path_msys_to_cygwin
++
++
++# func_convert_path_nix_to_cygwin ARG
++# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
++# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
++# func_to_host_file_result.
++func_convert_path_nix_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # Remove leading and trailing path separator characters from
++    # ARG. msys behavior is inconsistent here, cygpath turns them
++    # into '.;' and ';.', and winepath ignores them completely.
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
++    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
++    func_to_host_path_result="$func_cygpath_result"
++    func_convert_path_check : : \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
++  fi
++}
++# end func_convert_path_nix_to_cygwin
++
++
+ # func_mode_compile arg...
+ func_mode_compile ()
+ {
+@@ -1137,12 +1986,12 @@
+ 	  ;;
+ 
+ 	-pie | -fpie | -fPIE)
+-          pie_flag="$pie_flag $arg"
++          func_append pie_flag " $arg"
+ 	  continue
+ 	  ;;
+ 
+ 	-shared | -static | -prefer-pic | -prefer-non-pic)
+-	  later="$later $arg"
++	  func_append later " $arg"
+ 	  continue
+ 	  ;;
+ 
+@@ -1163,15 +2012,14 @@
+ 	  save_ifs="$IFS"; IFS=','
+ 	  for arg in $args; do
+ 	    IFS="$save_ifs"
+-	    func_quote_for_eval "$arg"
+-	    lastarg="$lastarg $func_quote_for_eval_result"
++	    func_append_quoted lastarg "$arg"
+ 	  done
+ 	  IFS="$save_ifs"
+ 	  func_stripname ' ' '' "$lastarg"
+ 	  lastarg=$func_stripname_result
+ 
+ 	  # Add the arguments to base_compile.
+-	  base_compile="$base_compile $lastarg"
++	  func_append base_compile " $lastarg"
+ 	  continue
+ 	  ;;
+ 
+@@ -1187,8 +2035,7 @@
+       esac    #  case $arg_mode
+ 
+       # Aesthetically quote the previous argument.
+-      func_quote_for_eval "$lastarg"
+-      base_compile="$base_compile $func_quote_for_eval_result"
++      func_append_quoted base_compile "$lastarg"
+     done # for arg
+ 
+     case $arg_mode in
+@@ -1213,7 +2060,7 @@
+     *.[cCFSifmso] | \
+     *.ada | *.adb | *.ads | *.asm | \
+     *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+-    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
++    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+       func_xform "$libobj"
+       libobj=$func_xform_result
+       ;;
+@@ -1288,7 +2135,7 @@
+     # Calculate the filename of the output object if compiler does
+     # not support -o with -c
+     if test "$compiler_c_o" = no; then
+-      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
++      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+       lockfile="$output_obj.lock"
+     else
+       output_obj=
+@@ -1319,17 +2166,16 @@
+ 	$opt_dry_run || $RM $removelist
+ 	exit $EXIT_FAILURE
+       fi
+-      removelist="$removelist $output_obj"
++      func_append removelist " $output_obj"
+       $ECHO "$srcfile" > "$lockfile"
+     fi
+ 
+     $opt_dry_run || $RM $removelist
+-    removelist="$removelist $lockfile"
++    func_append removelist " $lockfile"
+     trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+ 
+-    if test -n "$fix_srcfile_path"; then
+-      eval srcfile=\"$fix_srcfile_path\"
+-    fi
++    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
++    srcfile=$func_to_tool_file_result
+     func_quote_for_eval "$srcfile"
+     qsrcfile=$func_quote_for_eval_result
+ 
+@@ -1349,7 +2195,7 @@
+ 
+       if test -z "$output_obj"; then
+ 	# Place PIC objects in $objdir
+-	command="$command -o $lobj"
++	func_append command " -o $lobj"
+       fi
+ 
+       func_show_eval_locale "$command"	\
+@@ -1396,11 +2242,11 @@
+ 	command="$base_compile $qsrcfile $pic_flag"
+       fi
+       if test "$compiler_c_o" = yes; then
+-	command="$command -o $obj"
++	func_append command " -o $obj"
+       fi
+ 
+       # Suppress compiler output if we already did a PIC compilation.
+-      command="$command$suppress_output"
++      func_append command "$suppress_output"
+       func_show_eval_locale "$command" \
+         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+ 
+@@ -1445,13 +2291,13 @@
+ }
+ 
+ $opt_help || {
+-test "$mode" = compile && func_mode_compile ${1+"$@"}
++  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+ }
+ 
+ func_mode_help ()
+ {
+     # We need to display help for each of the modes.
+-    case $mode in
++    case $opt_mode in
+       "")
+         # Generic help is extracted from the usage comments
+         # at the start of this file.
+@@ -1482,10 +2328,11 @@
+ 
+   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+   -no-suppress      do not suppress compiler output for multiple passes
+-  -prefer-pic       try to building PIC objects only
+-  -prefer-non-pic   try to building non-PIC objects only
++  -prefer-pic       try to build PIC objects only
++  -prefer-non-pic   try to build non-PIC objects only
+   -shared           do not build a \`.o' file suitable for static linking
+   -static           only build a \`.o' file suitable for static linking
++  -Wc,FLAG          pass FLAG directly to the compiler
+ 
+ COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+ from the given SOURCEFILE.
+@@ -1538,7 +2385,7 @@
+ 
+ The following components of INSTALL-COMMAND are treated specially:
+ 
+-  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
++  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+ 
+ The rest of the components are interpreted as arguments to that command (only
+ BSD-compatible install options are recognized)."
+@@ -1558,6 +2405,8 @@
+ 
+   -all-static       do not do any dynamic linking at all
+   -avoid-version    do not add a version suffix if possible
++  -bindir BINDIR    specify path to binaries directory (for systems where
++                    libraries must be found in the PATH setting at runtime)
+   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+@@ -1586,6 +2435,11 @@
+   -version-info CURRENT[:REVISION[:AGE]]
+                     specify library version info [each variable defaults to 0]
+   -weak LIBNAME     declare that the target provides the LIBNAME interface
++  -Wc,FLAG
++  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
++  -Wl,FLAG
++  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
++  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
+ 
+ All other options (arguments beginning with \`-') are ignored.
+ 
+@@ -1619,18 +2473,44 @@
+         ;;
+ 
+       *)
+-        func_fatal_help "invalid operation mode \`$mode'"
++        func_fatal_help "invalid operation mode \`$opt_mode'"
+         ;;
+     esac
+ 
+-    $ECHO
++    echo
+     $ECHO "Try \`$progname --help' for more information about other modes."
+-
+-    exit $?
+ }
+ 
+-  # Now that we've collected a possible --mode arg, show help if necessary
+-  $opt_help && func_mode_help
++# Now that we've collected a possible --mode arg, show help if necessary
++if $opt_help; then
++  if test "$opt_help" = :; then
++    func_mode_help
++  else
++    {
++      func_help noexit
++      for opt_mode in compile link execute install finish uninstall clean; do
++	func_mode_help
++      done
++    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
++    {
++      func_help noexit
++      for opt_mode in compile link execute install finish uninstall clean; do
++	echo
++	func_mode_help
++      done
++    } |
++    sed '1d
++      /^When reporting/,/^Report/{
++	H
++	d
++      }
++      $x
++      /information about other modes/d
++      /more detailed .*MODE/d
++      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
++  fi
++  exit $?
++fi
+ 
+ 
+ # func_mode_execute arg...
+@@ -1643,13 +2523,16 @@
+       func_fatal_help "you must specify a COMMAND"
+ 
+     # Handle -dlopen flags immediately.
+-    for file in $execute_dlfiles; do
++    for file in $opt_dlopen; do
+       test -f "$file" \
+ 	|| func_fatal_help "\`$file' is not a file"
+ 
+       dir=
+       case $file in
+       *.la)
++	func_resolve_sysroot "$file"
++	file=$func_resolve_sysroot_result
++
+ 	# Check to see that this really is a libtool archive.
+ 	func_lalib_unsafe_p "$file" \
+ 	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+@@ -1671,7 +2554,7 @@
+ 	dir="$func_dirname_result"
+ 
+ 	if test -f "$dir/$objdir/$dlname"; then
+-	  dir="$dir/$objdir"
++	  func_append dir "/$objdir"
+ 	else
+ 	  if test ! -f "$dir/$dlname"; then
+ 	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+@@ -1712,7 +2595,7 @@
+     for file
+     do
+       case $file in
+-      -*) ;;
++      -* | *.la | *.lo ) ;;
+       *)
+ 	# Do a test to see if this is really a libtool program.
+ 	if func_ltwrapper_script_p "$file"; then
+@@ -1728,8 +2611,7 @@
+ 	;;
+       esac
+       # Quote arguments (to preserve shell metacharacters).
+-      func_quote_for_eval "$file"
+-      args="$args $func_quote_for_eval_result"
++      func_append_quoted args "$file"
+     done
+ 
+     if test "X$opt_dry_run" = Xfalse; then
+@@ -1754,29 +2636,66 @@
+       # Display what would be done.
+       if test -n "$shlibpath_var"; then
+ 	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+-	$ECHO "export $shlibpath_var"
++	echo "export $shlibpath_var"
+       fi
+       $ECHO "$cmd$args"
+       exit $EXIT_SUCCESS
+     fi
+ }
+ 
+-test "$mode" = execute && func_mode_execute ${1+"$@"}
++test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+ 
+ 
+ # func_mode_finish arg...
+ func_mode_finish ()
+ {
+     $opt_debug
+-    libdirs="$nonopt"
++    libs=
++    libdirs=
+     admincmds=
+ 
++    for opt in "$nonopt" ${1+"$@"}
++    do
++      if test -d "$opt"; then
++	func_append libdirs " $opt"
++
++      elif test -f "$opt"; then
++	if func_lalib_unsafe_p "$opt"; then
++	  func_append libs " $opt"
++	else
++	  func_warning "\`$opt' is not a valid libtool archive"
++	fi
++
++      else
++	func_fatal_error "invalid argument \`$opt'"
++      fi
++    done
++
++    if test -n "$libs"; then
++      if test -n "$lt_sysroot"; then
++        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
++        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
++      else
++        sysroot_cmd=
++      fi
++
++      # Remove sysroot references
++      if $opt_dry_run; then
++        for lib in $libs; do
++          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
++        done
++      else
++        tmpdir=`func_mktempdir`
++        for lib in $libs; do
++	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
++	    > $tmpdir/tmp-la
++	  mv -f $tmpdir/tmp-la $lib
++	done
++        ${RM}r "$tmpdir"
++      fi
++    fi
++
+     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+-      for dir
+-      do
+-	libdirs="$libdirs $dir"
+-      done
+-
+       for libdir in $libdirs; do
+ 	if test -n "$finish_cmds"; then
+ 	  # Do each command in the finish commands.
+@@ -1786,7 +2705,7 @@
+ 	if test -n "$finish_eval"; then
+ 	  # Do the single finish_eval.
+ 	  eval cmds=\"$finish_eval\"
+-	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
++	  $opt_dry_run || eval "$cmds" || func_append admincmds "
+        $cmds"
+ 	fi
+       done
+@@ -1795,53 +2714,55 @@
+     # Exit here if they wanted silent mode.
+     $opt_silent && exit $EXIT_SUCCESS
+ 
+-    $ECHO "X----------------------------------------------------------------------" | $Xsed
+-    $ECHO "Libraries have been installed in:"
+-    for libdir in $libdirs; do
+-      $ECHO "   $libdir"
+-    done
+-    $ECHO
+-    $ECHO "If you ever happen to want to link against installed libraries"
+-    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
+-    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
+-    $ECHO "flag during linking and do at least one of the following:"
+-    if test -n "$shlibpath_var"; then
+-      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+-      $ECHO "     during execution"
+-    fi
+-    if test -n "$runpath_var"; then
+-      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
+-      $ECHO "     during linking"
+-    fi
+-    if test -n "$hardcode_libdir_flag_spec"; then
+-      libdir=LIBDIR
+-      eval flag=\"$hardcode_libdir_flag_spec\"
++    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
++      echo "----------------------------------------------------------------------"
++      echo "Libraries have been installed in:"
++      for libdir in $libdirs; do
++	$ECHO "   $libdir"
++      done
++      echo
++      echo "If you ever happen to want to link against installed libraries"
++      echo "in a given directory, LIBDIR, you must either use libtool, and"
++      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
++      echo "flag during linking and do at least one of the following:"
++      if test -n "$shlibpath_var"; then
++	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
++	echo "     during execution"
++      fi
++      if test -n "$runpath_var"; then
++	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
++	echo "     during linking"
++      fi
++      if test -n "$hardcode_libdir_flag_spec"; then
++	libdir=LIBDIR
++	eval flag=\"$hardcode_libdir_flag_spec\"
+ 
+-      $ECHO "   - use the \`$flag' linker flag"
++	$ECHO "   - use the \`$flag' linker flag"
++      fi
++      if test -n "$admincmds"; then
++	$ECHO "   - have your system administrator run these commands:$admincmds"
++      fi
++      if test -f /etc/ld.so.conf; then
++	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
++      fi
++      echo
++
++      echo "See any operating system documentation about shared libraries for"
++      case $host in
++	solaris2.[6789]|solaris2.1[0-9])
++	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
++	  echo "pages."
++	  ;;
++	*)
++	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
++	  ;;
++      esac
++      echo "----------------------------------------------------------------------"
+     fi
+-    if test -n "$admincmds"; then
+-      $ECHO "   - have your system administrator run these commands:$admincmds"
+-    fi
+-    if test -f /etc/ld.so.conf; then
+-      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+-    fi
+-    $ECHO
+-
+-    $ECHO "See any operating system documentation about shared libraries for"
+-    case $host in
+-      solaris2.[6789]|solaris2.1[0-9])
+-        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+-	$ECHO "pages."
+-	;;
+-      *)
+-        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
+-        ;;
+-    esac
+-    $ECHO "X----------------------------------------------------------------------" | $Xsed
+     exit $EXIT_SUCCESS
+ }
+ 
+-test "$mode" = finish && func_mode_finish ${1+"$@"}
++test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+ 
+ 
+ # func_mode_install arg...
+@@ -1852,7 +2773,7 @@
+     # install_prog (especially on Windows NT).
+     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+        # Allow the use of GNU shtool's install command.
+-       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
++       case $nonopt in *shtool*) :;; *) false;; esac; then
+       # Aesthetically quote it.
+       func_quote_for_eval "$nonopt"
+       install_prog="$func_quote_for_eval_result "
+@@ -1866,7 +2787,12 @@
+     # The real first argument should be the name of the installation program.
+     # Aesthetically quote it.
+     func_quote_for_eval "$arg"
+-    install_prog="$install_prog$func_quote_for_eval_result"
++    func_append install_prog "$func_quote_for_eval_result"
++    install_shared_prog=$install_prog
++    case " $install_prog " in
++      *[\\\ /]cp\ *) install_cp=: ;;
++      *) install_cp=false ;;
++    esac
+ 
+     # We need to accept at least all the BSD install flags.
+     dest=
+@@ -1876,10 +2802,12 @@
+     install_type=
+     isdir=no
+     stripme=
++    no_mode=:
+     for arg
+     do
++      arg2=
+       if test -n "$dest"; then
+-	files="$files $dest"
++	func_append files " $dest"
+ 	dest=$arg
+ 	continue
+       fi
+@@ -1887,10 +2815,9 @@
+       case $arg in
+       -d) isdir=yes ;;
+       -f)
+-	case " $install_prog " in
+-	*[\\\ /]cp\ *) ;;
+-	*) prev=$arg ;;
+-	esac
++	if $install_cp; then :; else
++	  prev=$arg
++	fi
+ 	;;
+       -g | -m | -o)
+ 	prev=$arg
+@@ -1904,6 +2831,10 @@
+       *)
+ 	# If the previous option needed an argument, then skip it.
+ 	if test -n "$prev"; then
++	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
++	    arg2=$install_override_mode
++	    no_mode=false
++	  fi
+ 	  prev=
+ 	else
+ 	  dest=$arg
+@@ -1914,7 +2845,11 @@
+ 
+       # Aesthetically quote the argument.
+       func_quote_for_eval "$arg"
+-      install_prog="$install_prog $func_quote_for_eval_result"
++      func_append install_prog " $func_quote_for_eval_result"
++      if test -n "$arg2"; then
++	func_quote_for_eval "$arg2"
++      fi
++      func_append install_shared_prog " $func_quote_for_eval_result"
+     done
+ 
+     test -z "$install_prog" && \
+@@ -1923,6 +2858,13 @@
+     test -n "$prev" && \
+       func_fatal_help "the \`$prev' option requires an argument"
+ 
++    if test -n "$install_override_mode" && $no_mode; then
++      if $install_cp; then :; else
++	func_quote_for_eval "$install_override_mode"
++	func_append install_shared_prog " -m $func_quote_for_eval_result"
++      fi
++    fi
++
+     if test -z "$files"; then
+       if test -z "$dest"; then
+ 	func_fatal_help "no file or destination specified"
+@@ -1977,10 +2919,13 @@
+       case $file in
+       *.$libext)
+ 	# Do the static libraries later.
+-	staticlibs="$staticlibs $file"
++	func_append staticlibs " $file"
+ 	;;
+ 
+       *.la)
++	func_resolve_sysroot "$file"
++	file=$func_resolve_sysroot_result
++
+ 	# Check to see that this really is a libtool archive.
+ 	func_lalib_unsafe_p "$file" \
+ 	  || func_fatal_help "\`$file' is not a valid libtool archive"
+@@ -1994,23 +2939,23 @@
+ 	if test "X$destdir" = "X$libdir"; then
+ 	  case "$current_libdirs " in
+ 	  *" $libdir "*) ;;
+-	  *) current_libdirs="$current_libdirs $libdir" ;;
++	  *) func_append current_libdirs " $libdir" ;;
+ 	  esac
+ 	else
+ 	  # Note the libdir as a future libdir.
+ 	  case "$future_libdirs " in
+ 	  *" $libdir "*) ;;
+-	  *) future_libdirs="$future_libdirs $libdir" ;;
++	  *) func_append future_libdirs " $libdir" ;;
+ 	  esac
+ 	fi
+ 
+ 	func_dirname "$file" "/" ""
+ 	dir="$func_dirname_result"
+-	dir="$dir$objdir"
++	func_append dir "$objdir"
+ 
+ 	if test -n "$relink_command"; then
+ 	  # Determine the prefix the user has applied to our future dir.
+-	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
++	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+ 
+ 	  # Don't allow the user to place us outside of our expected
+ 	  # location b/c this prevents finding dependent libraries that
+@@ -2023,9 +2968,9 @@
+ 
+ 	  if test -n "$inst_prefix_dir"; then
+ 	    # Stick the inst_prefix_dir data into the link command.
+-	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
++	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ 	  else
+-	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
++	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ 	  fi
+ 
+ 	  func_warning "relinking \`$file'"
+@@ -2043,7 +2988,7 @@
+ 	  test -n "$relink_command" && srcname="$realname"T
+ 
+ 	  # Install the shared library and build the symlinks.
+-	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
++	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 	      'exit $?'
+ 	  tstripme="$stripme"
+ 	  case $host_os in
+@@ -2083,7 +3028,7 @@
+ 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+ 
+ 	# Maybe install the static library, too.
+-	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
++	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ 	;;
+ 
+       *.lo)
+@@ -2183,7 +3128,7 @@
+ 	    if test -f "$lib"; then
+ 	      func_source "$lib"
+ 	    fi
+-	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
++	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ 	    if test -n "$libdir" && test ! -f "$libfile"; then
+ 	      func_warning "\`$lib' has not been installed in \`$libdir'"
+ 	      finalize=no
+@@ -2202,7 +3147,7 @@
+ 		file="$func_basename_result"
+ 	        outputname="$tmpdir/$file"
+ 	        # Replace the output file specification.
+-	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
++	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+ 
+ 	        $opt_silent || {
+ 	          func_quote_for_expand "$relink_command"
+@@ -2221,7 +3166,7 @@
+ 	    }
+ 	  else
+ 	    # Install the binary that we compiled earlier.
+-	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
++	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ 	  fi
+ 	fi
+ 
+@@ -2257,11 +3202,13 @@
+ 
+       # Set up the ranlib parameters.
+       oldlib="$destdir/$name"
++      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
++      tool_oldlib=$func_to_tool_file_result
+ 
+       func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+ 
+       if test -n "$stripme" && test -n "$old_striplib"; then
+-	func_show_eval "$old_striplib $oldlib" 'exit $?'
++	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+       fi
+ 
+       # Do each command in the postinstall commands.
+@@ -2280,7 +3227,7 @@
+     fi
+ }
+ 
+-test "$mode" = install && func_mode_install ${1+"$@"}
++test "$opt_mode" = install && func_mode_install ${1+"$@"}
+ 
+ 
+ # func_generate_dlsyms outputname originator pic_p
+@@ -2323,6 +3270,22 @@
+ extern \"C\" {
+ #endif
+ 
++#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
++#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
++#endif
++
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ /* External symbol declarations for the compiler. */\
+ "
+ 
+@@ -2332,10 +3295,11 @@
+ 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+ 
+ 	  # Add our own program objects to the symbol list.
+-	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
++	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ 	  for progfile in $progfiles; do
+-	    func_verbose "extracting global C symbols from \`$progfile'"
+-	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
++	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
++	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
++	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ 	  done
+ 
+ 	  if test -n "$exclude_expsyms"; then
+@@ -2371,7 +3335,7 @@
+ 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ 	      eval '$MV "$nlist"T "$nlist"'
+ 	      case $host in
+-	        *cygwin | *mingw* | *cegcc* )
++	        *cygwin* | *mingw* | *cegcc* )
+ 	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ 	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ 	          ;;
+@@ -2384,10 +3348,52 @@
+ 	  func_verbose "extracting global C symbols from \`$dlprefile'"
+ 	  func_basename "$dlprefile"
+ 	  name="$func_basename_result"
+-	  $opt_dry_run || {
+-	    eval '$ECHO ": $name " >> "$nlist"'
+-	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+-	  }
++          case $host in
++	    *cygwin* | *mingw* | *cegcc* )
++	      # if an import library, we need to obtain dlname
++	      if func_win32_import_lib_p "$dlprefile"; then
++	        func_tr_sh "$dlprefile"
++	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
++	        dlprefile_dlbasename=""
++	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
++	          # Use subshell, to avoid clobbering current variable values
++	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
++	          if test -n "$dlprefile_dlname" ; then
++	            func_basename "$dlprefile_dlname"
++	            dlprefile_dlbasename="$func_basename_result"
++	          else
++	            # no lafile. user explicitly requested -dlpreopen <import library>.
++	            $sharedlib_from_linklib_cmd "$dlprefile"
++	            dlprefile_dlbasename=$sharedlib_from_linklib_result
++	          fi
++	        fi
++	        $opt_dry_run || {
++	          if test -n "$dlprefile_dlbasename" ; then
++	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
++	          else
++	            func_warning "Could not compute DLL name from $name"
++	            eval '$ECHO ": $name " >> "$nlist"'
++	          fi
++	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
++	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
++	        }
++	      else # not an import lib
++	        $opt_dry_run || {
++	          eval '$ECHO ": $name " >> "$nlist"'
++	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
++	        }
++	      fi
++	    ;;
++	    *)
++	      $opt_dry_run || {
++	        eval '$ECHO ": $name " >> "$nlist"'
++	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
++	      }
++	    ;;
++          esac
+ 	done
+ 
+ 	$opt_dry_run || {
+@@ -2415,36 +3421,19 @@
+ 	  if test -f "$nlist"S; then
+ 	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ 	  else
+-	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
++	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ 	  fi
+ 
+-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
++	  echo >> "$output_objdir/$my_dlsyms" "\
+ 
+ /* The mapping between symbol names and symbols.  */
+ typedef struct {
+   const char *name;
+   void *address;
+ } lt_dlsymlist;
+-"
+-	  case $host in
+-	  *cygwin* | *mingw* | *cegcc* )
+-	    $ECHO >> "$output_objdir/$my_dlsyms" "\
+-/* DATA imports from DLLs on WIN32 con't be const, because
+-   runtime relocations are performed -- see ld's documentation
+-   on pseudo-relocs.  */"
+-	    lt_dlsym_const= ;;
+-	  *osf5*)
+-	    echo >> "$output_objdir/$my_dlsyms" "\
+-/* This system does not cope well with relocations in const data */"
+-	    lt_dlsym_const= ;;
+-	  *)
+-	    lt_dlsym_const=const ;;
+-	  esac
+-
+-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+-extern $lt_dlsym_const lt_dlsymlist
++extern LT_DLSYM_CONST lt_dlsymlist
+ lt_${my_prefix}_LTX_preloaded_symbols[];
+-$lt_dlsym_const lt_dlsymlist
++LT_DLSYM_CONST lt_dlsymlist
+ lt_${my_prefix}_LTX_preloaded_symbols[] =
+ {\
+   { \"$my_originator\", (void *) 0 },"
+@@ -2457,7 +3446,7 @@
+ 	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ 	    ;;
+ 	  esac
+-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
++	  echo >> "$output_objdir/$my_dlsyms" "\
+   {0, (void *) 0}
+ };
+ 
+@@ -2484,7 +3473,7 @@
+ 	  # linked before any other PIC object.  But we must not use
+ 	  # pic_flag when linking with -static.  The problem exists in
+ 	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+-	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
++	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ 	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ 	  *-*-hpux*)
+ 	    pic_flag_for_symtable=" $pic_flag"  ;;
+@@ -2500,7 +3489,7 @@
+ 	for arg in $LTCFLAGS; do
+ 	  case $arg in
+ 	  -pie | -fpie | -fPIE) ;;
+-	  *) symtab_cflags="$symtab_cflags $arg" ;;
++	  *) func_append symtab_cflags " $arg" ;;
+ 	  esac
+ 	done
+ 
+@@ -2515,16 +3504,16 @@
+ 	case $host in
+ 	*cygwin* | *mingw* | *cegcc* )
+ 	  if test -f "$output_objdir/$my_outputname.def"; then
+-	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+-	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
++	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
++	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ 	  else
+-	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+-	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
++	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
++	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ 	  fi
+ 	  ;;
+ 	*)
+-	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+-	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
++	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
++	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ 	  ;;
+ 	esac
+ 	;;
+@@ -2538,8 +3527,8 @@
+       # really was required.
+ 
+       # Nullify the symbol file.
+-      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+-      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
++      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
++      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+     fi
+ }
+ 
+@@ -2549,6 +3538,7 @@
+ # Need a lot of goo to handle *both* DLLs and import libs
+ # Has to be a shell function in order to 'eat' the argument
+ # that is supplied when $file_magic_command is called.
++# Despite the name, also deal with 64 bit binaries.
+ func_win32_libid ()
+ {
+   $opt_debug
+@@ -2559,9 +3549,11 @@
+     win32_libid_type="x86 archive import"
+     ;;
+   *ar\ archive*) # could be an import, or static
++    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+-       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+-      win32_nmres=`eval $NM -f posix -A $1 |
++       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
++      func_to_tool_file "$1" func_convert_file_msys_to_w32
++      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ 	$SED -n -e '
+ 	    1,100{
+ 		/ I /{
+@@ -2590,15 +3582,151 @@
+   $ECHO "$win32_libid_type"
+ }
+ 
++# func_cygming_dll_for_implib ARG
++#
++# Platform-specific function to extract the
++# name of the DLL associated with the specified
++# import library ARG.
++# Invoked by eval'ing the libtool variable
++#    $sharedlib_from_linklib_cmd
++# Result is available in the variable
++#    $sharedlib_from_linklib_result
++func_cygming_dll_for_implib ()
++{
++  $opt_debug
++  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
++}
+ 
++# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
++#
++# The is the core of a fallback implementation of a
++# platform-specific function to extract the name of the
++# DLL associated with the specified import library LIBNAME.
++#
++# SECTION_NAME is either .idata$6 or .idata$7, depending
++# on the platform and compiler that created the implib.
++#
++# Echos the name of the DLL associated with the
++# specified import library.
++func_cygming_dll_for_implib_fallback_core ()
++{
++  $opt_debug
++  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
++  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
++    $SED '/^Contents of section '"$match_literal"':/{
++      # Place marker at beginning of archive member dllname section
++      s/.*/====MARK====/
++      p
++      d
++    }
++    # These lines can sometimes be longer than 43 characters, but
++    # are always uninteresting
++    /:[	 ]*file format pe[i]\{,1\}-/d
++    /^In archive [^:]*:/d
++    # Ensure marker is printed
++    /^====MARK====/p
++    # Remove all lines with less than 43 characters
++    /^.\{43\}/!d
++    # From remaining lines, remove first 43 characters
++    s/^.\{43\}//' |
++    $SED -n '
++      # Join marker and all lines until next marker into a single line
++      /^====MARK====/ b para
++      H
++      $ b para
++      b
++      :para
++      x
++      s/\n//g
++      # Remove the marker
++      s/^====MARK====//
++      # Remove trailing dots and whitespace
++      s/[\. \t]*$//
++      # Print
++      /./p' |
++    # we now have a list, one entry per line, of the stringified
++    # contents of the appropriate section of all members of the
++    # archive which possess that section. Heuristic: eliminate
++    # all those which have a first or second character that is
++    # a '.' (that is, objdump's representation of an unprintable
++    # character.) This should work for all archives with less than
++    # 0x302f exports -- but will fail for DLLs whose name actually
++    # begins with a literal '.' or a single character followed by
++    # a '.'.
++    #
++    # Of those that remain, print the first one.
++    $SED -e '/^\./d;/^.\./d;q'
++}
+ 
++# func_cygming_gnu_implib_p ARG
++# This predicate returns with zero status (TRUE) if
++# ARG is a GNU/binutils-style import library. Returns
++# with nonzero status (FALSE) otherwise.
++func_cygming_gnu_implib_p ()
++{
++  $opt_debug
++  func_to_tool_file "$1" func_convert_file_msys_to_w32
++  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
++  test -n "$func_cygming_gnu_implib_tmp"
++}
++
++# func_cygming_ms_implib_p ARG
++# This predicate returns with zero status (TRUE) if
++# ARG is an MS-style import library. Returns
++# with nonzero status (FALSE) otherwise.
++func_cygming_ms_implib_p ()
++{
++  $opt_debug
++  func_to_tool_file "$1" func_convert_file_msys_to_w32
++  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
++  test -n "$func_cygming_ms_implib_tmp"
++}
++
++# func_cygming_dll_for_implib_fallback ARG
++# Platform-specific function to extract the
++# name of the DLL associated with the specified
++# import library ARG.
++#
++# This fallback implementation is for use when $DLLTOOL
++# does not support the --identify-strict option.
++# Invoked by eval'ing the libtool variable
++#    $sharedlib_from_linklib_cmd
++# Result is available in the variable
++#    $sharedlib_from_linklib_result
++func_cygming_dll_for_implib_fallback ()
++{
++  $opt_debug
++  if func_cygming_gnu_implib_p "$1" ; then
++    # binutils import library
++    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
++  elif func_cygming_ms_implib_p "$1" ; then
++    # ms-generated import library
++    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
++  else
++    # unknown
++    sharedlib_from_linklib_result=""
++  fi
++}
++
++
+ # func_extract_an_archive dir oldlib
+ func_extract_an_archive ()
+ {
+     $opt_debug
+     f_ex_an_ar_dir="$1"; shift
+     f_ex_an_ar_oldlib="$1"
+-    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
++    if test "$lock_old_archive_extraction" = yes; then
++      lockfile=$f_ex_an_ar_oldlib.lock
++      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
++	func_echo "Waiting for $lockfile to be removed"
++	sleep 2
++      done
++    fi
++    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
++		   'stat=$?; rm -f "$lockfile"; exit $stat'
++    if test "$lock_old_archive_extraction" = yes; then
++      $opt_dry_run || rm -f "$lockfile"
++    fi
+     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+      :
+     else
+@@ -2669,7 +3797,7 @@
+ 	    darwin_file=
+ 	    darwin_files=
+ 	    for darwin_file in $darwin_filelist; do
+-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
++	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ 	      $LIPO -create -output "$darwin_file" $darwin_files
+ 	    done # $darwin_filelist
+ 	    $RM -rf unfat-$$
+@@ -2684,25 +3812,30 @@
+         func_extract_an_archive "$my_xdir" "$my_xabs"
+ 	;;
+       esac
+-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
++      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+     done
+ 
+     func_extract_archives_result="$my_oldobjs"
+ }
+ 
+ 
+-
+-# func_emit_wrapper_part1 [arg=no]
++# func_emit_wrapper [arg=no]
+ #
+-# Emit the first part of a libtool wrapper script on stdout.
+-# For more information, see the description associated with
+-# func_emit_wrapper(), below.
+-func_emit_wrapper_part1 ()
++# Emit a libtool wrapper script on stdout.
++# Don't directly open a file because we may want to
++# incorporate the script contents within a cygwin/mingw
++# wrapper executable.  Must ONLY be called from within
++# func_mode_link because it depends on a number of variables
++# set therein.
++#
++# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
++# variable will take.  If 'yes', then the emitted script
++# will assume that the directory in which it is stored is
++# the $objdir directory.  This is a cygwin/mingw-specific
++# behavior.
++func_emit_wrapper ()
+ {
+-	func_emit_wrapper_part1_arg1=no
+-	if test -n "$1" ; then
+-	  func_emit_wrapper_part1_arg1=$1
+-	fi
++	func_emit_wrapper_arg1=${1-no}
+ 
+ 	$ECHO "\
+ #! $SHELL
+@@ -2718,7 +3851,6 @@
+ 
+ # Sed substitution that helps us do robust quoting.  It backslashifies
+ # metacharacters that are still active within double-quoted strings.
+-Xsed='${SED} -e 1s/^X//'
+ sed_quote_subst='$sed_quote_subst'
+ 
+ # Be Bourne compatible
+@@ -2749,31 +3881,135 @@
+ else
+   # When we are sourced in execute mode, \$file and \$ECHO are already set.
+   if test \"\$libtool_execute_magic\" != \"$magic\"; then
+-    ECHO=\"$qecho\"
+-    file=\"\$0\"
+-    # Make sure echo works.
+-    if test \"X\$1\" = X--no-reexec; then
+-      # Discard the --no-reexec flag, and continue.
+-      shift
+-    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
+-      # Yippee, \$ECHO works!
+-      :
+-    else
+-      # Restart under the correct shell, and then maybe \$ECHO will work.
+-      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+-    fi
+-  fi\
++    file=\"\$0\""
++
++    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
++    $ECHO "\
++
++# A function that is used when there is no print builtin or printf.
++func_fallback_echo ()
++{
++  eval 'cat <<_LTECHO_EOF
++\$1
++_LTECHO_EOF'
++}
++    ECHO=\"$qECHO\"
++  fi
++
++# Very basic option parsing. These options are (a) specific to
++# the libtool wrapper, (b) are identical between the wrapper
++# /script/ and the wrapper /executable/ which is used only on
++# windows platforms, and (c) all begin with the string "--lt-"
++# (application programs are unlikely to have options which match
++# this pattern).
++#
++# There are only two supported options: --lt-debug and
++# --lt-dump-script. There is, deliberately, no --lt-help.
++#
++# The first argument to this parsing function should be the
++# script's $0 value, followed by "$@".
++lt_option_debug=
++func_parse_lt_options ()
++{
++  lt_script_arg0=\$0
++  shift
++  for lt_opt
++  do
++    case \"\$lt_opt\" in
++    --lt-debug) lt_option_debug=1 ;;
++    --lt-dump-script)
++        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
++        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
++        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
++        cat \"\$lt_dump_D/\$lt_dump_F\"
++        exit 0
++      ;;
++    --lt-*)
++        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
++        exit 1
++      ;;
++    esac
++  done
++
++  # Print the debug banner immediately:
++  if test -n \"\$lt_option_debug\"; then
++    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
++  fi
++}
++
++# Used when --lt-debug. Prints its arguments to stdout
++# (redirection is the responsibility of the caller)
++func_lt_dump_args ()
++{
++  lt_dump_args_N=1;
++  for lt_arg
++  do
++    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
++    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
++  done
++}
++
++# Core function for launching the target application
++func_exec_program_core ()
++{
+ "
+-	$ECHO "\
++  case $host in
++  # Backslashes separate directories on plain windows
++  *-*-mingw | *-*-os2* | *-cegcc*)
++    $ECHO "\
++      if test -n \"\$lt_option_debug\"; then
++        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
++        func_lt_dump_args \${1+\"\$@\"} 1>&2
++      fi
++      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
++"
++    ;;
+ 
++  *)
++    $ECHO "\
++      if test -n \"\$lt_option_debug\"; then
++        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
++        func_lt_dump_args \${1+\"\$@\"} 1>&2
++      fi
++      exec \"\$progdir/\$program\" \${1+\"\$@\"}
++"
++    ;;
++  esac
++  $ECHO "\
++      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
++      exit 1
++}
++
++# A function to encapsulate launching the target application
++# Strips options in the --lt-* namespace from \$@ and
++# launches target application with the remaining arguments.
++func_exec_program ()
++{
++  case \" \$* \" in
++  *\\ --lt-*)
++    for lt_wr_arg
++    do
++      case \$lt_wr_arg in
++      --lt-*) ;;
++      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
++      esac
++      shift
++    done ;;
++  esac
++  func_exec_program_core \${1+\"\$@\"}
++}
++
++  # Parse options
++  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
++
+   # Find the directory that this script lives in.
+-  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
++  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+ 
+   # Follow symbolic links until we get to the real thisdir.
+-  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
++  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+   while test -n \"\$file\"; do
+-    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
++    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+ 
+     # If there was a directory component, then change thisdir.
+     if test \"x\$destdir\" != \"x\$file\"; then
+@@ -2783,30 +4019,13 @@
+       esac
+     fi
+ 
+-    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+-    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
++    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
++    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+   done
+-"
+-}
+-# end: func_emit_wrapper_part1
+ 
+-# func_emit_wrapper_part2 [arg=no]
+-#
+-# Emit the second part of a libtool wrapper script on stdout.
+-# For more information, see the description associated with
+-# func_emit_wrapper(), below.
+-func_emit_wrapper_part2 ()
+-{
+-	func_emit_wrapper_part2_arg1=no
+-	if test -n "$1" ; then
+-	  func_emit_wrapper_part2_arg1=$1
+-	fi
+-
+-	$ECHO "\
+-
+   # Usually 'no', except on cygwin/mingw when embedded into
+   # the cwrapper.
+-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
++  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+   if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+     # special case for '.'
+     if test \"\$thisdir\" = \".\"; then
+@@ -2814,7 +4033,7 @@
+     fi
+     # remove .libs from thisdir
+     case \"\$thisdir\" in
+-    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
++    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+     $objdir )   thisdir=. ;;
+     esac
+   fi
+@@ -2869,6 +4088,18 @@
+ 
+   if test -f \"\$progdir/\$program\"; then"
+ 
++	# fixup the dll searchpath if we need to.
++	#
++	# Fix the DLL searchpath if we need to.  Do this before prepending
++	# to shlibpath, because on Windows, both are PATH and uninstalled
++	# libraries must come first.
++	if test -n "$dllsearchpath"; then
++	  $ECHO "\
++    # Add the dll search path components to the executable PATH
++    PATH=$dllsearchpath:\$PATH
++"
++	fi
++
+ 	# Export our shlibpath_var if we have one.
+ 	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ 	  $ECHO "\
+@@ -2877,254 +4108,29 @@
+ 
+     # Some systems cannot cope with colon-terminated $shlibpath_var
+     # The second colon is a workaround for a bug in BeOS R4 sed
+-    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
++    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+ 
+     export $shlibpath_var
+ "
+ 	fi
+ 
+-	# fixup the dll searchpath if we need to.
+-	if test -n "$dllsearchpath"; then
+-	  $ECHO "\
+-    # Add the dll search path components to the executable PATH
+-    PATH=$dllsearchpath:\$PATH
+-"
+-	fi
+-
+ 	$ECHO "\
+     if test \"\$libtool_execute_magic\" != \"$magic\"; then
+       # Run the actual program with our arguments.
+-"
+-	case $host in
+-	# Backslashes separate directories on plain windows
+-	*-*-mingw | *-*-os2* | *-cegcc*)
+-	  $ECHO "\
+-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+-"
+-	  ;;
+-
+-	*)
+-	  $ECHO "\
+-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+-"
+-	  ;;
+-	esac
+-	$ECHO "\
+-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+-      exit 1
++      func_exec_program \${1+\"\$@\"}
+     fi
+   else
+     # The program doesn't exist.
+     \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+-    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
++    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+     exit 1
+   fi
+ fi\
+ "
+ }
+-# end: func_emit_wrapper_part2
+ 
+ 
+-# func_emit_wrapper [arg=no]
+-#
+-# Emit a libtool wrapper script on stdout.
+-# Don't directly open a file because we may want to
+-# incorporate the script contents within a cygwin/mingw
+-# wrapper executable.  Must ONLY be called from within
+-# func_mode_link because it depends on a number of variables
+-# set therein.
+-#
+-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+-# variable will take.  If 'yes', then the emitted script
+-# will assume that the directory in which it is stored is
+-# the $objdir directory.  This is a cygwin/mingw-specific
+-# behavior.
+-func_emit_wrapper ()
+-{
+-	func_emit_wrapper_arg1=no
+-	if test -n "$1" ; then
+-	  func_emit_wrapper_arg1=$1
+-	fi
+-
+-	# split this up so that func_emit_cwrapperexe_src
+-	# can call each part independently.
+-	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+-	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
+-}
+-
+-
+-# func_to_host_path arg
+-#
+-# Convert paths to host format when used with build tools.
+-# Intended for use with "native" mingw (where libtool itself
+-# is running under the msys shell), or in the following cross-
+-# build environments:
+-#    $build          $host
+-#    mingw (msys)    mingw  [e.g. native]
+-#    cygwin          mingw
+-#    *nix + wine     mingw
+-# where wine is equipped with the `winepath' executable.
+-# In the native mingw case, the (msys) shell automatically
+-# converts paths for any non-msys applications it launches,
+-# but that facility isn't available from inside the cwrapper.
+-# Similar accommodations are necessary for $host mingw and
+-# $build cygwin.  Calling this function does no harm for other
+-# $host/$build combinations not listed above.
+-#
+-# ARG is the path (on $build) that should be converted to
+-# the proper representation for $host. The result is stored
+-# in $func_to_host_path_result.
+-func_to_host_path ()
+-{
+-  func_to_host_path_result="$1"
+-  if test -n "$1" ; then
+-    case $host in
+-      *mingw* )
+-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+-        case $build in
+-          *mingw* ) # actually, msys
+-            # awkward: cmd appends spaces to result
+-            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+-            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
+-              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+-            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+-              $SED -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          *cygwin* )
+-            func_to_host_path_tmp1=`cygpath -w "$1"`
+-            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+-              $SED -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          * )
+-            # Unfortunately, winepath does not exit with a non-zero
+-            # error code, so we are forced to check the contents of
+-            # stdout. On the other hand, if the command is not
+-            # found, the shell will set an exit code of 127 and print
+-            # *an error message* to stdout. So we must check for both
+-            # error code of zero AND non-empty stdout, which explains
+-            # the odd construction:
+-            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+-            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+-              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+-                $SED -e "$lt_sed_naive_backslashify"`
+-            else
+-              # Allow warning below.
+-              func_to_host_path_result=""
+-            fi
+-            ;;
+-        esac
+-        if test -z "$func_to_host_path_result" ; then
+-          func_error "Could not determine host path corresponding to"
+-          func_error "  '$1'"
+-          func_error "Continuing, but uninstalled executables may not work."
+-          # Fallback:
+-          func_to_host_path_result="$1"
+-        fi
+-        ;;
+-    esac
+-  fi
+-}
+-# end: func_to_host_path
+-
+-# func_to_host_pathlist arg
+-#
+-# Convert pathlists to host format when used with build tools.
+-# See func_to_host_path(), above. This function supports the
+-# following $build/$host combinations (but does no harm for
+-# combinations not listed here):
+-#    $build          $host
+-#    mingw (msys)    mingw  [e.g. native]
+-#    cygwin          mingw
+-#    *nix + wine     mingw
+-#
+-# Path separators are also converted from $build format to
+-# $host format. If ARG begins or ends with a path separator
+-# character, it is preserved (but converted to $host format)
+-# on output.
+-#
+-# ARG is a pathlist (on $build) that should be converted to
+-# the proper representation on $host. The result is stored
+-# in $func_to_host_pathlist_result.
+-func_to_host_pathlist ()
+-{
+-  func_to_host_pathlist_result="$1"
+-  if test -n "$1" ; then
+-    case $host in
+-      *mingw* )
+-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+-        # Remove leading and trailing path separator characters from
+-        # ARG. msys behavior is inconsistent here, cygpath turns them
+-        # into '.;' and ';.', and winepath ignores them completely.
+-        func_to_host_pathlist_tmp2="$1"
+-        # Once set for this call, this variable should not be
+-        # reassigned. It is used in tha fallback case.
+-        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
+-          $SED -e 's|^:*||' -e 's|:*$||'`
+-        case $build in
+-          *mingw* ) # Actually, msys.
+-            # Awkward: cmd appends spaces to result.
+-            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+-            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
+-              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+-            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+-              $SED -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          *cygwin* )
+-            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
+-            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+-              $SED -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          * )
+-            # unfortunately, winepath doesn't convert pathlists
+-            func_to_host_pathlist_result=""
+-            func_to_host_pathlist_oldIFS=$IFS
+-            IFS=:
+-            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+-              IFS=$func_to_host_pathlist_oldIFS
+-              if test -n "$func_to_host_pathlist_f" ; then
+-                func_to_host_path "$func_to_host_pathlist_f"
+-                if test -n "$func_to_host_path_result" ; then
+-                  if test -z "$func_to_host_pathlist_result" ; then
+-                    func_to_host_pathlist_result="$func_to_host_path_result"
+-                  else
+-                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
+-                  fi
+-                fi
+-              fi
+-              IFS=:
+-            done
+-            IFS=$func_to_host_pathlist_oldIFS
+-            ;;
+-        esac
+-        if test -z "$func_to_host_pathlist_result" ; then
+-          func_error "Could not determine the host path(s) corresponding to"
+-          func_error "  '$1'"
+-          func_error "Continuing, but uninstalled executables may not work."
+-          # Fallback. This may break if $1 contains DOS-style drive
+-          # specifications. The fix is not to complicate the expression
+-          # below, but for the user to provide a working wine installation
+-          # with winepath so that path translation in the cross-to-mingw
+-          # case works properly.
+-          lt_replace_pathsep_nix_to_dos="s|:|;|g"
+-          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+-            $SED -e "$lt_replace_pathsep_nix_to_dos"`
+-        fi
+-        # Now, add the leading and trailing path separators back
+-        case "$1" in
+-          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+-            ;;
+-        esac
+-        case "$1" in
+-          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
+-            ;;
+-        esac
+-        ;;
+-    esac
+-  fi
+-}
+-# end: func_to_host_pathlist
+-
+ # func_emit_cwrapperexe_src
+ # emit the source code for a wrapper executable on stdout
+ # Must ONLY be called from within func_mode_link because
+@@ -3141,31 +4147,23 @@
+ 
+    This wrapper executable should never be moved out of the build directory.
+    If it is, it will not operate correctly.
+-
+-   Currently, it simply execs the wrapper *script* "$SHELL $output",
+-   but could eventually absorb all of the scripts functionality and
+-   exec $objdir/$outputname directly.
+ */
+ EOF
+ 	    cat <<"EOF"
++#ifdef _MSC_VER
++# define _CRT_SECURE_NO_DEPRECATE 1
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #ifdef _MSC_VER
+ # include <direct.h>
+ # include <process.h>
+ # include <io.h>
+-# define setmode _setmode
+ #else
+ # include <unistd.h>
+ # include <stdint.h>
+ # ifdef __CYGWIN__
+ #  include <io.h>
+-#  define HAVE_SETENV
+-#  ifdef __STRICT_ANSI__
+-char *realpath (const char *, char *);
+-int putenv (char *);
+-int setenv (const char *, const char *, int);
+-#  endif
+ # endif
+ #endif
+ #include <malloc.h>
+@@ -3177,6 +4175,44 @@
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ 
++/* declarations of non-ANSI functions */
++#if defined(__MINGW32__)
++# ifdef __STRICT_ANSI__
++int _putenv (const char *);
++# endif
++#elif defined(__CYGWIN__)
++# ifdef __STRICT_ANSI__
++char *realpath (const char *, char *);
++int putenv (char *);
++int setenv (const char *, const char *, int);
++# endif
++/* #elif defined (other platforms) ... */
++#endif
++
++/* portability defines, excluding path handling macros */
++#if defined(_MSC_VER)
++# define setmode _setmode
++# define stat    _stat
++# define chmod   _chmod
++# define getcwd  _getcwd
++# define putenv  _putenv
++# define S_IXUSR _S_IEXEC
++# ifndef _INTPTR_T_DEFINED
++#  define _INTPTR_T_DEFINED
++#  define intptr_t int
++# endif
++#elif defined(__MINGW32__)
++# define setmode _setmode
++# define stat    _stat
++# define chmod   _chmod
++# define getcwd  _getcwd
++# define putenv  _putenv
++#elif defined(__CYGWIN__)
++# define HAVE_SETENV
++# define FOPEN_WB "wb"
++/* #elif defined (other platforms) ... */
++#endif
++
+ #if defined(PATH_MAX)
+ # define LT_PATHMAX PATH_MAX
+ #elif defined(MAXPATHLEN)
+@@ -3192,14 +4228,7 @@
+ # define S_IXGRP 0
+ #endif
+ 
+-#ifdef _MSC_VER
+-# define S_IXUSR _S_IEXEC
+-# define stat _stat
+-# ifndef _INTPTR_T_DEFINED
+-#  define intptr_t int
+-# endif
+-#endif
+-
++/* path handling portability macros */
+ #ifndef DIR_SEPARATOR
+ # define DIR_SEPARATOR '/'
+ # define PATH_SEPARATOR ':'
+@@ -3230,10 +4259,6 @@
+ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+ #endif /* PATH_SEPARATOR_2 */
+ 
+-#ifdef __CYGWIN__
+-# define FOPEN_WB "wb"
+-#endif
+-
+ #ifndef FOPEN_WB
+ # define FOPEN_WB "w"
+ #endif
+@@ -3246,22 +4271,13 @@
+   if (stale) { free ((void *) stale); stale = 0; } \
+ } while (0)
+ 
+-#undef LTWRAPPER_DEBUGPRINTF
+-#if defined DEBUGWRAPPER
+-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+-static void
+-ltwrapper_debugprintf (const char *fmt, ...)
+-{
+-    va_list args;
+-    va_start (args, fmt);
+-    (void) vfprintf (stderr, fmt, args);
+-    va_end (args);
+-}
++#if defined(LT_DEBUGWRAPPER)
++static int lt_debug = 1;
+ #else
+-# define LTWRAPPER_DEBUGPRINTF(args)
++static int lt_debug = 0;
+ #endif
+ 
+-const char *program_name = NULL;
++const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+ 
+ void *xmalloc (size_t num);
+ char *xstrdup (const char *string);
+@@ -3271,41 +4287,27 @@
+ int make_executable (const char *path);
+ int check_executable (const char *path);
+ char *strendzap (char *str, const char *pat);
+-void lt_fatal (const char *message, ...);
++void lt_debugprintf (const char *file, int line, const char *fmt, ...);
++void lt_fatal (const char *file, int line, const char *message, ...);
++static const char *nonnull (const char *s);
++static const char *nonempty (const char *s);
+ void lt_setenv (const char *name, const char *value);
+ char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+-void lt_opt_process_env_set (const char *arg);
+-void lt_opt_process_env_prepend (const char *arg);
+-void lt_opt_process_env_append (const char *arg);
+-int lt_split_name_value (const char *arg, char** name, char** value);
+ void lt_update_exe_path (const char *name, const char *value);
+ void lt_update_lib_path (const char *name, const char *value);
+-
+-static const char *script_text_part1 =
++char **prepare_spawn (char **argv);
++void lt_dump_script (FILE *f);
+ EOF
+ 
+-	    func_emit_wrapper_part1 yes |
+-	        $SED -e 's/\([\\"]\)/\\\1/g' \
+-	             -e 's/^/  "/' -e 's/$/\\n"/'
+-	    echo ";"
+ 	    cat <<EOF
+-
+-static const char *script_text_part2 =
+-EOF
+-	    func_emit_wrapper_part2 yes |
+-	        $SED -e 's/\([\\"]\)/\\\1/g' \
+-	             -e 's/^/  "/' -e 's/$/\\n"/'
+-	    echo ";"
+-
+-	    cat <<EOF
+-const char * MAGIC_EXE = "$magic_exe";
++volatile const char * MAGIC_EXE = "$magic_exe";
+ const char * LIB_PATH_VARNAME = "$shlibpath_var";
+ EOF
+ 
+ 	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+-              func_to_host_pathlist "$temp_rpath"
++              func_to_host_path "$temp_rpath"
+ 	      cat <<EOF
+-const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
++const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
+ EOF
+ 	    else
+ 	      cat <<"EOF"
+@@ -3314,10 +4316,10 @@
+ 	    fi
+ 
+ 	    if test -n "$dllsearchpath"; then
+-              func_to_host_pathlist "$dllsearchpath:"
++              func_to_host_path "$dllsearchpath:"
+ 	      cat <<EOF
+ const char * EXE_PATH_VARNAME = "PATH";
+-const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
++const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
+ EOF
+ 	    else
+ 	      cat <<"EOF"
+@@ -3340,25 +4342,11 @@
+ 	    cat <<"EOF"
+ 
+ #define LTWRAPPER_OPTION_PREFIX         "--lt-"
+-#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
+ 
+-static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
+ static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+-
+ static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
++static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+ 
+-static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
+-static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
+-  /* argument is putenv-style "foo=bar", value of foo is set to bar */
+-
+-static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
+-static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
+-  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
+-
+-static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
+-static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
+-  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+-
+ int
+ main (int argc, char *argv[])
+ {
+@@ -3374,10 +4362,13 @@
+   int i;
+ 
+   program_name = (char *) xstrdup (base_name (argv[0]));
+-  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
+-  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
++  newargz = XMALLOC (char *, argc + 1);
+ 
+-  /* very simple arg parsing; don't want to rely on getopt */
++  /* very simple arg parsing; don't want to rely on getopt
++   * also, copy all non cwrapper options to newargz, except
++   * argz[0], which is handled differently
++   */
++  newargc=0;
+   for (i = 1; i < argc; i++)
+     {
+       if (strcmp (argv[i], dumpscript_opt) == 0)
+@@ -3391,25 +4382,57 @@
+ 	      esac
+ 
+ 	    cat <<"EOF"
+-	  printf ("%s", script_text_part1);
+-	  printf ("%s", script_text_part2);
++	  lt_dump_script (stdout);
+ 	  return 0;
+ 	}
++      if (strcmp (argv[i], debug_opt) == 0)
++	{
++          lt_debug = 1;
++          continue;
++	}
++      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
++        {
++          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
++             namespace, but it is not one of the ones we know about and
++             have already dealt with, above (inluding dump-script), then
++             report an error. Otherwise, targets might begin to believe
++             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
++             namespace. The first time any user complains about this, we'll
++             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
++             or a configure.ac-settable value.
++           */
++          lt_fatal (__FILE__, __LINE__,
++		    "unrecognized %s option: '%s'",
++                    ltwrapper_option_prefix, argv[i]);
++        }
++      /* otherwise ... */
++      newargz[++newargc] = xstrdup (argv[i]);
+     }
++  newargz[++newargc] = NULL;
+ 
+-  newargz = XMALLOC (char *, argc + 1);
++EOF
++	    cat <<EOF
++  /* The GNU banner must be the first non-error debug message */
++  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
++EOF
++	    cat <<"EOF"
++  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
++  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
++
+   tmp_pathspec = find_executable (argv[0]);
+   if (tmp_pathspec == NULL)
+-    lt_fatal ("Couldn't find %s", argv[0]);
+-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+-			  tmp_pathspec));
++    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
++  lt_debugprintf (__FILE__, __LINE__,
++                  "(main) found exe (before symlink chase) at: %s\n",
++		  tmp_pathspec);
+ 
+   actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+-			  actual_cwrapper_path));
++  lt_debugprintf (__FILE__, __LINE__,
++                  "(main) found exe (after symlink chase) at: %s\n",
++		  actual_cwrapper_path);
+   XFREE (tmp_pathspec);
+ 
+-  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
++  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+   strendzap (actual_cwrapper_path, actual_cwrapper_name);
+ 
+   /* wrapper name transforms */
+@@ -3427,8 +4450,9 @@
+   target_name = tmp_pathspec;
+   tmp_pathspec = 0;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+-			  target_name));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(main) libtool target name: %s\n",
++		  target_name);
+ EOF
+ 
+ 	    cat <<EOF
+@@ -3478,80 +4502,19 @@
+ 
+   lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+   lt_setenv ("DUALCASE", "1");  /* for MSK sh */
++  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
++     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
++     because on Windows, both *_VARNAMEs are PATH but uninstalled
++     libraries must come first. */
++  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+   lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+-  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ 
+-  newargc=0;
+-  for (i = 1; i < argc; i++)
+-    {
+-      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
+-        {
+-          if (argv[i][env_set_opt_len] == '=')
+-            {
+-              const char *p = argv[i] + env_set_opt_len + 1;
+-              lt_opt_process_env_set (p);
+-            }
+-          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
+-            {
+-              lt_opt_process_env_set (argv[++i]); /* don't copy */
+-            }
+-          else
+-            lt_fatal ("%s missing required argument", env_set_opt);
+-          continue;
+-        }
+-      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
+-        {
+-          if (argv[i][env_prepend_opt_len] == '=')
+-            {
+-              const char *p = argv[i] + env_prepend_opt_len + 1;
+-              lt_opt_process_env_prepend (p);
+-            }
+-          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
+-            {
+-              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
+-            }
+-          else
+-            lt_fatal ("%s missing required argument", env_prepend_opt);
+-          continue;
+-        }
+-      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
+-        {
+-          if (argv[i][env_append_opt_len] == '=')
+-            {
+-              const char *p = argv[i] + env_append_opt_len + 1;
+-              lt_opt_process_env_append (p);
+-            }
+-          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
+-            {
+-              lt_opt_process_env_append (argv[++i]); /* don't copy */
+-            }
+-          else
+-            lt_fatal ("%s missing required argument", env_append_opt);
+-          continue;
+-        }
+-      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+-        {
+-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+-             namespace, but it is not one of the ones we know about and
+-             have already dealt with, above (inluding dump-script), then
+-             report an error. Otherwise, targets might begin to believe
+-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+-             namespace. The first time any user complains about this, we'll
+-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+-             or a configure.ac-settable value.
+-           */
+-          lt_fatal ("Unrecognized option in %s namespace: '%s'",
+-                    ltwrapper_option_prefix, argv[i]);
+-        }
+-      /* otherwise ... */
+-      newargz[++newargc] = xstrdup (argv[i]);
+-    }
+-  newargz[++newargc] = NULL;
+-
+-  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
++		  nonnull (lt_argv_zero));
+   for (i = 0; i < newargc; i++)
+     {
+-      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
++      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
++		      i, nonnull (newargz[i]));
+     }
+ 
+ EOF
+@@ -3560,11 +4523,14 @@
+ 	      mingw*)
+ 		cat <<"EOF"
+   /* execv doesn't actually work on mingw as expected on unix */
++  newargz = prepare_spawn (newargz);
+   rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+   if (rval == -1)
+     {
+       /* failed to start process */
+-      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
++      lt_debugprintf (__FILE__, __LINE__,
++		      "(main) failed to launch target \"%s\": %s\n",
++		      lt_argv_zero, nonnull (strerror (errno)));
+       return 127;
+     }
+   return rval;
+@@ -3586,7 +4552,7 @@
+ {
+   void *p = (void *) malloc (num);
+   if (!p)
+-    lt_fatal ("Memory exhausted");
++    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+ 
+   return p;
+ }
+@@ -3620,8 +4586,8 @@
+ {
+   struct stat st;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
+-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
++  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
++                  nonempty (path));
+   if ((!path) || (!*path))
+     return 0;
+ 
+@@ -3638,8 +4604,8 @@
+   int rval = 0;
+   struct stat st;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
+-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
++  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
++                  nonempty (path));
+   if ((!path) || (!*path))
+     return 0;
+ 
+@@ -3665,8 +4631,8 @@
+   int tmp_len;
+   char *concat_name;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
+-			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
++  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
++                  nonempty (wrapper));
+ 
+   if ((wrapper == NULL) || (*wrapper == '\0'))
+     return NULL;
+@@ -3719,7 +4685,8 @@
+ 		{
+ 		  /* empty path: current directory */
+ 		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+-		    lt_fatal ("getcwd failed");
++		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
++                              nonnull (strerror (errno)));
+ 		  tmp_len = strlen (tmp);
+ 		  concat_name =
+ 		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+@@ -3744,7 +4711,8 @@
+     }
+   /* Relative path | not found in path: prepend cwd */
+   if (getcwd (tmp, LT_PATHMAX) == NULL)
+-    lt_fatal ("getcwd failed");
++    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
++              nonnull (strerror (errno)));
+   tmp_len = strlen (tmp);
+   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+   memcpy (concat_name, tmp, tmp_len);
+@@ -3770,8 +4738,9 @@
+   int has_symlinks = 0;
+   while (strlen (tmp_pathspec) && !has_symlinks)
+     {
+-      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+-			      tmp_pathspec));
++      lt_debugprintf (__FILE__, __LINE__,
++		      "checking path component for symlinks: %s\n",
++		      tmp_pathspec);
+       if (lstat (tmp_pathspec, &s) == 0)
+ 	{
+ 	  if (S_ISLNK (s.st_mode) != 0)
+@@ -3793,8 +4762,9 @@
+ 	}
+       else
+ 	{
+-	  char *errstr = strerror (errno);
+-	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
++	  lt_fatal (__FILE__, __LINE__,
++		    "error accessing file \"%s\": %s",
++		    tmp_pathspec, nonnull (strerror (errno)));
+ 	}
+     }
+   XFREE (tmp_pathspec);
+@@ -3807,7 +4777,8 @@
+   tmp_pathspec = realpath (pathspec, buf);
+   if (tmp_pathspec == 0)
+     {
+-      lt_fatal ("Could not follow symlinks for %s", pathspec);
++      lt_fatal (__FILE__, __LINE__,
++		"could not follow symlinks for %s", pathspec);
+     }
+   return xstrdup (tmp_pathspec);
+ #endif
+@@ -3833,11 +4804,25 @@
+   return str;
+ }
+ 
++void
++lt_debugprintf (const char *file, int line, const char *fmt, ...)
++{
++  va_list args;
++  if (lt_debug)
++    {
++      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
++      va_start (args, fmt);
++      (void) vfprintf (stderr, fmt, args);
++      va_end (args);
++    }
++}
++
+ static void
+-lt_error_core (int exit_status, const char *mode,
++lt_error_core (int exit_status, const char *file,
++	       int line, const char *mode,
+ 	       const char *message, va_list ap)
+ {
+-  fprintf (stderr, "%s: %s: ", program_name, mode);
++  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+   vfprintf (stderr, message, ap);
+   fprintf (stderr, ".\n");
+ 
+@@ -3846,20 +4831,32 @@
+ }
+ 
+ void
+-lt_fatal (const char *message, ...)
++lt_fatal (const char *file, int line, const char *message, ...)
+ {
+   va_list ap;
+   va_start (ap, message);
+-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
++  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+   va_end (ap);
+ }
+ 
++static const char *
++nonnull (const char *s)
++{
++  return s ? s : "(null)";
++}
++
++static const char *
++nonempty (const char *s)
++{
++  return (s && !*s) ? "(empty)" : nonnull (s);
++}
++
+ void
+ lt_setenv (const char *name, const char *value)
+ {
+-  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+-                          (name ? name : "<NULL>"),
+-                          (value ? value : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(lt_setenv) setting '%s' to '%s'\n",
++                  nonnull (name), nonnull (value));
+   {
+ #ifdef HAVE_SETENV
+     /* always make a copy, for consistency with !HAVE_SETENV */
+@@ -3904,95 +4901,12 @@
+   return new_value;
+ }
+ 
+-int
+-lt_split_name_value (const char *arg, char** name, char** value)
+-{
+-  const char *p;
+-  int len;
+-  if (!arg || !*arg)
+-    return 1;
+-
+-  p = strchr (arg, (int)'=');
+-
+-  if (!p)
+-    return 1;
+-
+-  *value = xstrdup (++p);
+-
+-  len = strlen (arg) - strlen (*value);
+-  *name = XMALLOC (char, len);
+-  strncpy (*name, arg, len-1);
+-  (*name)[len - 1] = '\0';
+-
+-  return 0;
+-}
+-
+ void
+-lt_opt_process_env_set (const char *arg)
+-{
+-  char *name = NULL;
+-  char *value = NULL;
+-
+-  if (lt_split_name_value (arg, &name, &value) != 0)
+-    {
+-      XFREE (name);
+-      XFREE (value);
+-      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
+-    }
+-
+-  lt_setenv (name, value);
+-  XFREE (name);
+-  XFREE (value);
+-}
+-
+-void
+-lt_opt_process_env_prepend (const char *arg)
+-{
+-  char *name = NULL;
+-  char *value = NULL;
+-  char *new_value = NULL;
+-
+-  if (lt_split_name_value (arg, &name, &value) != 0)
+-    {
+-      XFREE (name);
+-      XFREE (value);
+-      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
+-    }
+-
+-  new_value = lt_extend_str (getenv (name), value, 0);
+-  lt_setenv (name, new_value);
+-  XFREE (new_value);
+-  XFREE (name);
+-  XFREE (value);
+-}
+-
+-void
+-lt_opt_process_env_append (const char *arg)
+-{
+-  char *name = NULL;
+-  char *value = NULL;
+-  char *new_value = NULL;
+-
+-  if (lt_split_name_value (arg, &name, &value) != 0)
+-    {
+-      XFREE (name);
+-      XFREE (value);
+-      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
+-    }
+-
+-  new_value = lt_extend_str (getenv (name), value, 1);
+-  lt_setenv (name, new_value);
+-  XFREE (new_value);
+-  XFREE (name);
+-  XFREE (value);
+-}
+-
+-void
+ lt_update_exe_path (const char *name, const char *value)
+ {
+-  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+-                          (name ? name : "<NULL>"),
+-                          (value ? value : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
++                  nonnull (name), nonnull (value));
+ 
+   if (name && *name && value && *value)
+     {
+@@ -4011,9 +4925,9 @@
+ void
+ lt_update_lib_path (const char *name, const char *value)
+ {
+-  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+-                          (name ? name : "<NULL>"),
+-                          (value ? value : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
++                  nonnull (name), nonnull (value));
+ 
+   if (name && *name && value && *value)
+     {
+@@ -4023,11 +4937,158 @@
+     }
+ }
+ 
++EOF
++	    case $host_os in
++	      mingw*)
++		cat <<"EOF"
+ 
++/* Prepares an argument vector before calling spawn().
++   Note that spawn() does not by itself call the command interpreter
++     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
++      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
++         GetVersionEx(&v);
++         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
++      }) ? "cmd.exe" : "command.com").
++   Instead it simply concatenates the arguments, separated by ' ', and calls
++   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
++   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
++   special way:
++   - Space and tab are interpreted as delimiters. They are not treated as
++     delimiters if they are surrounded by double quotes: "...".
++   - Unescaped double quotes are removed from the input. Their only effect is
++     that within double quotes, space and tab are treated like normal
++     characters.
++   - Backslashes not followed by double quotes are not special.
++   - But 2*n+1 backslashes followed by a double quote become
++     n backslashes followed by a double quote (n >= 0):
++       \" -> "
++       \\\" -> \"
++       \\\\\" -> \\"
++ */
++#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
++#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
++char **
++prepare_spawn (char **argv)
++{
++  size_t argc;
++  char **new_argv;
++  size_t i;
++
++  /* Count number of arguments.  */
++  for (argc = 0; argv[argc] != NULL; argc++)
++    ;
++
++  /* Allocate new argument vector.  */
++  new_argv = XMALLOC (char *, argc + 1);
++
++  /* Put quoted arguments into the new argument vector.  */
++  for (i = 0; i < argc; i++)
++    {
++      const char *string = argv[i];
++
++      if (string[0] == '\0')
++	new_argv[i] = xstrdup ("\"\"");
++      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
++	{
++	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
++	  size_t length;
++	  unsigned int backslashes;
++	  const char *s;
++	  char *quoted_string;
++	  char *p;
++
++	  length = 0;
++	  backslashes = 0;
++	  if (quote_around)
++	    length++;
++	  for (s = string; *s != '\0'; s++)
++	    {
++	      char c = *s;
++	      if (c == '"')
++		length += backslashes + 1;
++	      length++;
++	      if (c == '\\')
++		backslashes++;
++	      else
++		backslashes = 0;
++	    }
++	  if (quote_around)
++	    length += backslashes + 1;
++
++	  quoted_string = XMALLOC (char, length + 1);
++
++	  p = quoted_string;
++	  backslashes = 0;
++	  if (quote_around)
++	    *p++ = '"';
++	  for (s = string; *s != '\0'; s++)
++	    {
++	      char c = *s;
++	      if (c == '"')
++		{
++		  unsigned int j;
++		  for (j = backslashes + 1; j > 0; j--)
++		    *p++ = '\\';
++		}
++	      *p++ = c;
++	      if (c == '\\')
++		backslashes++;
++	      else
++		backslashes = 0;
++	    }
++	  if (quote_around)
++	    {
++	      unsigned int j;
++	      for (j = backslashes; j > 0; j--)
++		*p++ = '\\';
++	      *p++ = '"';
++	    }
++	  *p = '\0';
++
++	  new_argv[i] = quoted_string;
++	}
++      else
++	new_argv[i] = (char *) string;
++    }
++  new_argv[argc] = NULL;
++
++  return new_argv;
++}
+ EOF
++		;;
++	    esac
++
++            cat <<"EOF"
++void lt_dump_script (FILE* f)
++{
++EOF
++	    func_emit_wrapper yes |
++	      $SED -n -e '
++s/^\(.\{79\}\)\(..*\)/\1\
++\2/
++h
++s/\([\\"]\)/\\\1/g
++s/$/\\n/
++s/\([^\n]*\).*/  fputs ("\1", f);/p
++g
++D'
++            cat <<"EOF"
+ }
++EOF
++}
+ # end: func_emit_cwrapperexe_src
+ 
++# func_win32_import_lib_p ARG
++# True if ARG is an import lib, as indicated by $file_magic_cmd
++func_win32_import_lib_p ()
++{
++    $opt_debug
++    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
++    *import*) : ;;
++    *) false ;;
++    esac
++}
++
+ # func_mode_link arg...
+ func_mode_link ()
+ {
+@@ -4072,6 +5133,7 @@
+     new_inherited_linker_flags=
+ 
+     avoid_version=no
++    bindir=
+     dlfiles=
+     dlprefiles=
+     dlself=no
+@@ -4164,6 +5226,11 @@
+ 	esac
+ 
+ 	case $prev in
++	bindir)
++	  bindir="$arg"
++	  prev=
++	  continue
++	  ;;
+ 	dlfiles|dlprefiles)
+ 	  if test "$preload" = no; then
+ 	    # Add the symbol object into the linking commands.
+@@ -4195,9 +5262,9 @@
+ 	    ;;
+ 	  *)
+ 	    if test "$prev" = dlfiles; then
+-	      dlfiles="$dlfiles $arg"
++	      func_append dlfiles " $arg"
+ 	    else
+-	      dlprefiles="$dlprefiles $arg"
++	      func_append dlprefiles " $arg"
+ 	    fi
+ 	    prev=
+ 	    continue
+@@ -4221,7 +5288,7 @@
+ 	    *-*-darwin*)
+ 	      case "$deplibs " in
+ 		*" $qarg.ltframework "*) ;;
+-		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
++		*) func_append deplibs " $qarg.ltframework" # this is fixed later
+ 		   ;;
+ 	      esac
+ 	      ;;
+@@ -4240,7 +5307,7 @@
+ 	    moreargs=
+ 	    for fil in `cat "$save_arg"`
+ 	    do
+-#	      moreargs="$moreargs $fil"
++#	      func_append moreargs " $fil"
+ 	      arg=$fil
+ 	      # A libtool-controlled object.
+ 
+@@ -4269,7 +5336,7 @@
+ 
+ 		  if test "$prev" = dlfiles; then
+ 		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+-		      dlfiles="$dlfiles $pic_object"
++		      func_append dlfiles " $pic_object"
+ 		      prev=
+ 		      continue
+ 		    else
+@@ -4281,7 +5348,7 @@
+ 		  # CHECK ME:  I think I busted this.  -Ossama
+ 		  if test "$prev" = dlprefiles; then
+ 		    # Preload the old-style object.
+-		    dlprefiles="$dlprefiles $pic_object"
++		    func_append dlprefiles " $pic_object"
+ 		    prev=
+ 		  fi
+ 
+@@ -4351,12 +5418,12 @@
+ 	  if test "$prev" = rpath; then
+ 	    case "$rpath " in
+ 	    *" $arg "*) ;;
+-	    *) rpath="$rpath $arg" ;;
++	    *) func_append rpath " $arg" ;;
+ 	    esac
+ 	  else
+ 	    case "$xrpath " in
+ 	    *" $arg "*) ;;
+-	    *) xrpath="$xrpath $arg" ;;
++	    *) func_append xrpath " $arg" ;;
+ 	    esac
+ 	  fi
+ 	  prev=
+@@ -4368,28 +5435,28 @@
+ 	  continue
+ 	  ;;
+ 	weak)
+-	  weak_libs="$weak_libs $arg"
++	  func_append weak_libs " $arg"
+ 	  prev=
+ 	  continue
+ 	  ;;
+ 	xcclinker)
+-	  linker_flags="$linker_flags $qarg"
+-	  compiler_flags="$compiler_flags $qarg"
++	  func_append linker_flags " $qarg"
++	  func_append compiler_flags " $qarg"
+ 	  prev=
+ 	  func_append compile_command " $qarg"
+ 	  func_append finalize_command " $qarg"
+ 	  continue
+ 	  ;;
+ 	xcompiler)
+-	  compiler_flags="$compiler_flags $qarg"
++	  func_append compiler_flags " $qarg"
+ 	  prev=
+ 	  func_append compile_command " $qarg"
+ 	  func_append finalize_command " $qarg"
+ 	  continue
+ 	  ;;
+ 	xlinker)
+-	  linker_flags="$linker_flags $qarg"
+-	  compiler_flags="$compiler_flags $wl$qarg"
++	  func_append linker_flags " $qarg"
++	  func_append compiler_flags " $wl$qarg"
+ 	  prev=
+ 	  func_append compile_command " $wl$qarg"
+ 	  func_append finalize_command " $wl$qarg"
+@@ -4425,6 +5492,11 @@
+ 	continue
+ 	;;
+ 
++      -bindir)
++	prev=bindir
++	continue
++	;;
++
+       -dlopen)
+ 	prev=dlfiles
+ 	continue
+@@ -4475,15 +5547,16 @@
+ 	;;
+ 
+       -L*)
+-	func_stripname '-L' '' "$arg"
+-	dir=$func_stripname_result
+-	if test -z "$dir"; then
++	func_stripname "-L" '' "$arg"
++	if test -z "$func_stripname_result"; then
+ 	  if test "$#" -gt 0; then
+ 	    func_fatal_error "require no space between \`-L' and \`$1'"
+ 	  else
+ 	    func_fatal_error "need path for \`-L' option"
+ 	  fi
+ 	fi
++	func_resolve_sysroot "$func_stripname_result"
++	dir=$func_resolve_sysroot_result
+ 	# We need an absolute path.
+ 	case $dir in
+ 	[\\/]* | [A-Za-z]:[\\/]*) ;;
+@@ -4495,24 +5568,30 @@
+ 	  ;;
+ 	esac
+ 	case "$deplibs " in
+-	*" -L$dir "*) ;;
++	*" -L$dir "* | *" $arg "*)
++	  # Will only happen for absolute or sysroot arguments
++	  ;;
+ 	*)
+-	  deplibs="$deplibs -L$dir"
+-	  lib_search_path="$lib_search_path $dir"
++	  # Preserve sysroot, but never include relative directories
++	  case $dir in
++	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
++	    *) func_append deplibs " -L$dir" ;;
++	  esac
++	  func_append lib_search_path " $dir"
+ 	  ;;
+ 	esac
+ 	case $host in
+ 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+-	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
++	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ 	  case :$dllsearchpath: in
+ 	  *":$dir:"*) ;;
+ 	  ::) dllsearchpath=$dir;;
+-	  *) dllsearchpath="$dllsearchpath:$dir";;
++	  *) func_append dllsearchpath ":$dir";;
+ 	  esac
+ 	  case :$dllsearchpath: in
+ 	  *":$testbindir:"*) ;;
+ 	  ::) dllsearchpath=$testbindir;;
+-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
++	  *) func_append dllsearchpath ":$testbindir";;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -4522,7 +5601,7 @@
+       -l*)
+ 	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ 	  case $host in
+-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
++	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ 	    # These systems don't actually have a C or math library (as such)
+ 	    continue
+ 	    ;;
+@@ -4536,7 +5615,7 @@
+ 	    ;;
+ 	  *-*-rhapsody* | *-*-darwin1.[012])
+ 	    # Rhapsody C and math libraries are in the System framework
+-	    deplibs="$deplibs System.ltframework"
++	    func_append deplibs " System.ltframework"
+ 	    continue
+ 	    ;;
+ 	  *-*-sco3.2v5* | *-*-sco5v6*)
+@@ -4556,7 +5635,7 @@
+ 	   ;;
+ 	 esac
+ 	fi
+-	deplibs="$deplibs $arg"
++	func_append deplibs " $arg"
+ 	continue
+ 	;;
+ 
+@@ -4568,21 +5647,22 @@
+       # Tru64 UNIX uses -model [arg] to determine the layout of C++
+       # classes, name mangling, and exception handling.
+       # Darwin uses the -arch flag to determine output architecture.
+-      -model|-arch|-isysroot)
+-	compiler_flags="$compiler_flags $arg"
++      -model|-arch|-isysroot|--sysroot)
++	func_append compiler_flags " $arg"
+ 	func_append compile_command " $arg"
+ 	func_append finalize_command " $arg"
+ 	prev=xcompiler
+ 	continue
+ 	;;
+ 
+-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+-	compiler_flags="$compiler_flags $arg"
++      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
++      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
++	func_append compiler_flags " $arg"
+ 	func_append compile_command " $arg"
+ 	func_append finalize_command " $arg"
+ 	case "$new_inherited_linker_flags " in
+ 	    *" $arg "*) ;;
+-	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
++	    * ) func_append new_inherited_linker_flags " $arg" ;;
+ 	esac
+ 	continue
+ 	;;
+@@ -4649,13 +5729,17 @@
+ 	# We need an absolute path.
+ 	case $dir in
+ 	[\\/]* | [A-Za-z]:[\\/]*) ;;
++	=*)
++	  func_stripname '=' '' "$dir"
++	  dir=$lt_sysroot$func_stripname_result
++	  ;;
+ 	*)
+ 	  func_fatal_error "only absolute run-paths are allowed"
+ 	  ;;
+ 	esac
+ 	case "$xrpath " in
+ 	*" $dir "*) ;;
+-	*) xrpath="$xrpath $dir" ;;
++	*) func_append xrpath " $dir" ;;
+ 	esac
+ 	continue
+ 	;;
+@@ -4708,8 +5792,8 @@
+ 	for flag in $args; do
+ 	  IFS="$save_ifs"
+           func_quote_for_eval "$flag"
+-	  arg="$arg $wl$func_quote_for_eval_result"
+-	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
++	  func_append arg " $func_quote_for_eval_result"
++	  func_append compiler_flags " $func_quote_for_eval_result"
+ 	done
+ 	IFS="$save_ifs"
+ 	func_stripname ' ' '' "$arg"
+@@ -4724,9 +5808,9 @@
+ 	for flag in $args; do
+ 	  IFS="$save_ifs"
+           func_quote_for_eval "$flag"
+-	  arg="$arg $wl$func_quote_for_eval_result"
+-	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+-	  linker_flags="$linker_flags $func_quote_for_eval_result"
++	  func_append arg " $wl$func_quote_for_eval_result"
++	  func_append compiler_flags " $wl$func_quote_for_eval_result"
++	  func_append linker_flags " $func_quote_for_eval_result"
+ 	done
+ 	IFS="$save_ifs"
+ 	func_stripname ' ' '' "$arg"
+@@ -4754,23 +5838,27 @@
+ 	arg="$func_quote_for_eval_result"
+ 	;;
+ 
+-      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+-      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+-      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+-      # +DA*, +DD* enable 64-bit mode on the HP compiler
+-      # -q* pass through compiler args for the IBM compiler
+-      # -m*, -t[45]*, -txscale* pass through architecture-specific
+-      # compiler args for GCC
+-      # -F/path gives path to uninstalled frameworks, gcc on darwin
+-      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+-      # @file GCC response files
++      # Flags to be passed through unchanged, with rationale:
++      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
++      # -r[0-9][0-9]*        specify processor for the SGI compiler
++      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
++      # +DA*, +DD*           enable 64-bit mode for the HP compiler
++      # -q*                  compiler args for the IBM compiler
++      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
++      # -F/path              path to uninstalled frameworks, gcc on darwin
++      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
++      # @file                GCC response files
++      # -tp=*                Portland pgcc target processor selection
++      # --sysroot=*          for sysroot support
++      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
++      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
++      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+         func_quote_for_eval "$arg"
+ 	arg="$func_quote_for_eval_result"
+         func_append compile_command " $arg"
+         func_append finalize_command " $arg"
+-        compiler_flags="$compiler_flags $arg"
++        func_append compiler_flags " $arg"
+         continue
+         ;;
+ 
+@@ -4782,7 +5870,7 @@
+ 
+       *.$objext)
+ 	# A standard object.
+-	objs="$objs $arg"
++	func_append objs " $arg"
+ 	;;
+ 
+       *.lo)
+@@ -4813,7 +5901,7 @@
+ 
+ 	    if test "$prev" = dlfiles; then
+ 	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+-		dlfiles="$dlfiles $pic_object"
++		func_append dlfiles " $pic_object"
+ 		prev=
+ 		continue
+ 	      else
+@@ -4825,7 +5913,7 @@
+ 	    # CHECK ME:  I think I busted this.  -Ossama
+ 	    if test "$prev" = dlprefiles; then
+ 	      # Preload the old-style object.
+-	      dlprefiles="$dlprefiles $pic_object"
++	      func_append dlprefiles " $pic_object"
+ 	      prev=
+ 	    fi
+ 
+@@ -4870,24 +5958,25 @@
+ 
+       *.$libext)
+ 	# An archive.
+-	deplibs="$deplibs $arg"
+-	old_deplibs="$old_deplibs $arg"
++	func_append deplibs " $arg"
++	func_append old_deplibs " $arg"
+ 	continue
+ 	;;
+ 
+       *.la)
+ 	# A libtool-controlled library.
+ 
++	func_resolve_sysroot "$arg"
+ 	if test "$prev" = dlfiles; then
+ 	  # This library was specified with -dlopen.
+-	  dlfiles="$dlfiles $arg"
++	  func_append dlfiles " $func_resolve_sysroot_result"
+ 	  prev=
+ 	elif test "$prev" = dlprefiles; then
+ 	  # The library was specified with -dlpreopen.
+-	  dlprefiles="$dlprefiles $arg"
++	  func_append dlprefiles " $func_resolve_sysroot_result"
+ 	  prev=
+ 	else
+-	  deplibs="$deplibs $arg"
++	  func_append deplibs " $func_resolve_sysroot_result"
+ 	fi
+ 	continue
+ 	;;
+@@ -4925,7 +6014,7 @@
+ 
+     if test -n "$shlibpath_var"; then
+       # get the directories listed in $shlibpath_var
+-      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
++      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+     else
+       shlib_search_path=
+     fi
+@@ -4934,6 +6023,8 @@
+ 
+     func_dirname "$output" "/" ""
+     output_objdir="$func_dirname_result$objdir"
++    func_to_tool_file "$output_objdir/"
++    tool_output_objdir=$func_to_tool_file_result
+     # Create the object directory.
+     func_mkdir_p "$output_objdir"
+ 
+@@ -4954,12 +6045,12 @@
+     # Find all interdependent deplibs by searching for libraries
+     # that are linked more than once (e.g. -la -lb -la)
+     for deplib in $deplibs; do
+-      if $opt_duplicate_deps ; then
++      if $opt_preserve_dup_deps ; then
+ 	case "$libs " in
+-	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ 	esac
+       fi
+-      libs="$libs $deplib"
++      func_append libs " $deplib"
+     done
+ 
+     if test "$linkmode" = lib; then
+@@ -4972,9 +6063,9 @@
+       if $opt_duplicate_compiler_generated_deps; then
+ 	for pre_post_dep in $predeps $postdeps; do
+ 	  case "$pre_post_deps " in
+-	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
++	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ 	  esac
+-	  pre_post_deps="$pre_post_deps $pre_post_dep"
++	  func_append pre_post_deps " $pre_post_dep"
+ 	done
+       fi
+       pre_post_deps=
+@@ -5041,17 +6132,19 @@
+ 	for lib in $dlprefiles; do
+ 	  # Ignore non-libtool-libs
+ 	  dependency_libs=
++	  func_resolve_sysroot "$lib"
+ 	  case $lib in
+-	  *.la)	func_source "$lib" ;;
++	  *.la)	func_source "$func_resolve_sysroot_result" ;;
+ 	  esac
+ 
+ 	  # Collect preopened libtool deplibs, except any this library
+ 	  # has declared as weak libs
+ 	  for deplib in $dependency_libs; do
+-            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
++	    func_basename "$deplib"
++            deplib_base=$func_basename_result
+ 	    case " $weak_libs " in
+ 	    *" $deplib_base "*) ;;
+-	    *) deplibs="$deplibs $deplib" ;;
++	    *) func_append deplibs " $deplib" ;;
+ 	    esac
+ 	  done
+ 	done
+@@ -5067,16 +6160,17 @@
+ 	lib=
+ 	found=no
+ 	case $deplib in
+-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
++	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
++        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ 	  if test "$linkmode,$pass" = "prog,link"; then
+ 	    compile_deplibs="$deplib $compile_deplibs"
+ 	    finalize_deplibs="$deplib $finalize_deplibs"
+ 	  else
+-	    compiler_flags="$compiler_flags $deplib"
++	    func_append compiler_flags " $deplib"
+ 	    if test "$linkmode" = lib ; then
+ 		case "$new_inherited_linker_flags " in
+ 		    *" $deplib "*) ;;
+-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
++		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+ 		esac
+ 	    fi
+ 	  fi
+@@ -5161,7 +6255,7 @@
+ 	    if test "$linkmode" = lib ; then
+ 		case "$new_inherited_linker_flags " in
+ 		    *" $deplib "*) ;;
+-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
++		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+ 		esac
+ 	    fi
+ 	  fi
+@@ -5174,7 +6268,8 @@
+ 	    test "$pass" = conv && continue
+ 	    newdependency_libs="$deplib $newdependency_libs"
+ 	    func_stripname '-L' '' "$deplib"
+-	    newlib_search_path="$newlib_search_path $func_stripname_result"
++	    func_resolve_sysroot "$func_stripname_result"
++	    func_append newlib_search_path " $func_resolve_sysroot_result"
+ 	    ;;
+ 	  prog)
+ 	    if test "$pass" = conv; then
+@@ -5188,7 +6283,8 @@
+ 	      finalize_deplibs="$deplib $finalize_deplibs"
+ 	    fi
+ 	    func_stripname '-L' '' "$deplib"
+-	    newlib_search_path="$newlib_search_path $func_stripname_result"
++	    func_resolve_sysroot "$func_stripname_result"
++	    func_append newlib_search_path " $func_resolve_sysroot_result"
+ 	    ;;
+ 	  *)
+ 	    func_warning "\`-L' is ignored for archives/objects"
+@@ -5199,17 +6295,21 @@
+ 	-R*)
+ 	  if test "$pass" = link; then
+ 	    func_stripname '-R' '' "$deplib"
+-	    dir=$func_stripname_result
++	    func_resolve_sysroot "$func_stripname_result"
++	    dir=$func_resolve_sysroot_result
+ 	    # Make sure the xrpath contains only unique directories.
+ 	    case "$xrpath " in
+ 	    *" $dir "*) ;;
+-	    *) xrpath="$xrpath $dir" ;;
++	    *) func_append xrpath " $dir" ;;
+ 	    esac
+ 	  fi
+ 	  deplibs="$deplib $deplibs"
+ 	  continue
+ 	  ;;
+-	*.la) lib="$deplib" ;;
++	*.la)
++	  func_resolve_sysroot "$deplib"
++	  lib=$func_resolve_sysroot_result
++	  ;;
+ 	*.$libext)
+ 	  if test "$pass" = conv; then
+ 	    deplibs="$deplib $deplibs"
+@@ -5227,7 +6327,7 @@
+ 		match_pattern*)
+ 		  set dummy $deplibs_check_method; shift
+ 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+-		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
++		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ 		    | $EGREP "$match_pattern_regex" > /dev/null; then
+ 		    valid_a_lib=yes
+ 		  fi
+@@ -5237,15 +6337,15 @@
+ 		;;
+ 	      esac
+ 	      if test "$valid_a_lib" != yes; then
+-		$ECHO
++		echo
+ 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
+-		$ECHO "*** I have the capability to make that library automatically link in when"
+-		$ECHO "*** you link to this library.  But I can only do this if you have a"
+-		$ECHO "*** shared version of the library, which you do not appear to have"
+-		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
+-		$ECHO "*** that it is just a static archive that I should not use here."
++		echo "*** I have the capability to make that library automatically link in when"
++		echo "*** you link to this library.  But I can only do this if you have a"
++		echo "*** shared version of the library, which you do not appear to have"
++		echo "*** because the file extensions .$libext of this argument makes me believe"
++		echo "*** that it is just a static archive that I should not use here."
+ 	      else
+-		$ECHO
++		echo
+ 		$ECHO "*** Warning: Linking the shared library $output against the"
+ 		$ECHO "*** static library $deplib is not portable!"
+ 		deplibs="$deplib $deplibs"
+@@ -5272,11 +6372,11 @@
+ 	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ 	      # If there is no dlopen support or we're linking statically,
+ 	      # we need to preload.
+-	      newdlprefiles="$newdlprefiles $deplib"
++	      func_append newdlprefiles " $deplib"
+ 	      compile_deplibs="$deplib $compile_deplibs"
+ 	      finalize_deplibs="$deplib $finalize_deplibs"
+ 	    else
+-	      newdlfiles="$newdlfiles $deplib"
++	      func_append newdlfiles " $deplib"
+ 	    fi
+ 	  fi
+ 	  continue
+@@ -5318,20 +6418,20 @@
+ 
+ 	# Convert "-framework foo" to "foo.ltframework"
+ 	if test -n "$inherited_linker_flags"; then
+-	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
++	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ 	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ 	    case " $new_inherited_linker_flags " in
+ 	      *" $tmp_inherited_linker_flag "*) ;;
+-	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
++	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ 	    esac
+ 	  done
+ 	fi
+-	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
++	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ 	if test "$linkmode,$pass" = "lib,link" ||
+ 	   test "$linkmode,$pass" = "prog,scan" ||
+ 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+-	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+-	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
++	  test -n "$dlopen" && func_append dlfiles " $dlopen"
++	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ 	fi
+ 
+ 	if test "$pass" = conv; then
+@@ -5342,20 +6442,20 @@
+ 	      func_fatal_error "cannot find name of link library for \`$lib'"
+ 	    fi
+ 	    # It is a libtool convenience library, so add in its objects.
+-	    convenience="$convenience $ladir/$objdir/$old_library"
+-	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
++	    func_append convenience " $ladir/$objdir/$old_library"
++	    func_append old_convenience " $ladir/$objdir/$old_library"
+ 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ 	    func_fatal_error "\`$lib' is not a convenience library"
+ 	  fi
+ 	  tmp_libs=
+ 	  for deplib in $dependency_libs; do
+ 	    deplibs="$deplib $deplibs"
+-	    if $opt_duplicate_deps ; then
++	    if $opt_preserve_dup_deps ; then
+ 	      case "$tmp_libs " in
+-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ 	      esac
+ 	    fi
+-	    tmp_libs="$tmp_libs $deplib"
++	    func_append tmp_libs " $deplib"
+ 	  done
+ 	  continue
+ 	fi # $pass = conv
+@@ -5363,9 +6463,15 @@
+ 
+ 	# Get the name of the library we link against.
+ 	linklib=
+-	for l in $old_library $library_names; do
+-	  linklib="$l"
+-	done
++	if test -n "$old_library" &&
++	   { test "$prefer_static_libs" = yes ||
++	     test "$prefer_static_libs,$installed" = "built,no"; }; then
++	  linklib=$old_library
++	else
++	  for l in $old_library $library_names; do
++	    linklib="$l"
++	  done
++	fi
+ 	if test -z "$linklib"; then
+ 	  func_fatal_error "cannot find name of link library for \`$lib'"
+ 	fi
+@@ -5382,9 +6488,9 @@
+ 	    # statically, we need to preload.  We also need to preload any
+ 	    # dependent libraries so libltdl's deplib preloader doesn't
+ 	    # bomb out in the load deplibs phase.
+-	    dlprefiles="$dlprefiles $lib $dependency_libs"
++	    func_append dlprefiles " $lib $dependency_libs"
+ 	  else
+-	    newdlfiles="$newdlfiles $lib"
++	    func_append newdlfiles " $lib"
+ 	  fi
+ 	  continue
+ 	fi # $pass = dlopen
+@@ -5406,14 +6512,14 @@
+ 
+ 	# Find the relevant object directory and library name.
+ 	if test "X$installed" = Xyes; then
+-	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
++	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ 	    func_warning "library \`$lib' was moved."
+ 	    dir="$ladir"
+ 	    absdir="$abs_ladir"
+ 	    libdir="$abs_ladir"
+ 	  else
+-	    dir="$libdir"
+-	    absdir="$libdir"
++	    dir="$lt_sysroot$libdir"
++	    absdir="$lt_sysroot$libdir"
+ 	  fi
+ 	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ 	else
+@@ -5421,12 +6527,12 @@
+ 	    dir="$ladir"
+ 	    absdir="$abs_ladir"
+ 	    # Remove this search path later
+-	    notinst_path="$notinst_path $abs_ladir"
++	    func_append notinst_path " $abs_ladir"
+ 	  else
+ 	    dir="$ladir/$objdir"
+ 	    absdir="$abs_ladir/$objdir"
+ 	    # Remove this search path later
+-	    notinst_path="$notinst_path $abs_ladir"
++	    func_append notinst_path " $abs_ladir"
+ 	  fi
+ 	fi # $installed = yes
+ 	func_stripname 'lib' '.la' "$laname"
+@@ -5437,20 +6543,46 @@
+ 	  if test -z "$libdir" && test "$linkmode" = prog; then
+ 	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ 	  fi
+-	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+-	  # are required to link).
+-	  if test -n "$old_library"; then
+-	    newdlprefiles="$newdlprefiles $dir/$old_library"
+-	    # Keep a list of preopened convenience libraries to check
+-	    # that they are being used correctly in the link pass.
+-	    test -z "$libdir" && \
+-		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+-	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+-	  elif test -n "$dlname"; then
+-	    newdlprefiles="$newdlprefiles $dir/$dlname"
+-	  else
+-	    newdlprefiles="$newdlprefiles $dir/$linklib"
+-	  fi
++	  case "$host" in
++	    # special handling for platforms with PE-DLLs.
++	    *cygwin* | *mingw* | *cegcc* )
++	      # Linker will automatically link against shared library if both
++	      # static and shared are present.  Therefore, ensure we extract
++	      # symbols from the import library if a shared library is present
++	      # (otherwise, the dlopen module name will be incorrect).  We do
++	      # this by putting the import library name into $newdlprefiles.
++	      # We recover the dlopen module name by 'saving' the la file
++	      # name in a special purpose variable, and (later) extracting the
++	      # dlname from the la file.
++	      if test -n "$dlname"; then
++	        func_tr_sh "$dir/$linklib"
++	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
++	        func_append newdlprefiles " $dir/$linklib"
++	      else
++	        func_append newdlprefiles " $dir/$old_library"
++	        # Keep a list of preopened convenience libraries to check
++	        # that they are being used correctly in the link pass.
++	        test -z "$libdir" && \
++	          func_append dlpreconveniencelibs " $dir/$old_library"
++	      fi
++	    ;;
++	    * )
++	      # Prefer using a static library (so that no silly _DYNAMIC symbols
++	      # are required to link).
++	      if test -n "$old_library"; then
++	        func_append newdlprefiles " $dir/$old_library"
++	        # Keep a list of preopened convenience libraries to check
++	        # that they are being used correctly in the link pass.
++	        test -z "$libdir" && \
++	          func_append dlpreconveniencelibs " $dir/$old_library"
++	      # Otherwise, use the dlname, so that lt_dlopen finds it.
++	      elif test -n "$dlname"; then
++	        func_append newdlprefiles " $dir/$dlname"
++	      else
++	        func_append newdlprefiles " $dir/$linklib"
++	      fi
++	    ;;
++	  esac
+ 	fi # $pass = dlpreopen
+ 
+ 	if test -z "$libdir"; then
+@@ -5468,7 +6600,7 @@
+ 
+ 
+ 	if test "$linkmode" = prog && test "$pass" != link; then
+-	  newlib_search_path="$newlib_search_path $ladir"
++	  func_append newlib_search_path " $ladir"
+ 	  deplibs="$lib $deplibs"
+ 
+ 	  linkalldeplibs=no
+@@ -5481,7 +6613,8 @@
+ 	  for deplib in $dependency_libs; do
+ 	    case $deplib in
+ 	    -L*) func_stripname '-L' '' "$deplib"
+-	         newlib_search_path="$newlib_search_path $func_stripname_result"
++	         func_resolve_sysroot "$func_stripname_result"
++	         func_append newlib_search_path " $func_resolve_sysroot_result"
+ 		 ;;
+ 	    esac
+ 	    # Need to link against all dependency_libs?
+@@ -5492,12 +6625,12 @@
+ 	      # or/and link against static libraries
+ 	      newdependency_libs="$deplib $newdependency_libs"
+ 	    fi
+-	    if $opt_duplicate_deps ; then
++	    if $opt_preserve_dup_deps ; then
+ 	      case "$tmp_libs " in
+-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ 	      esac
+ 	    fi
+-	    tmp_libs="$tmp_libs $deplib"
++	    func_append tmp_libs " $deplib"
+ 	  done # for deplib
+ 	  continue
+ 	fi # $linkmode = prog...
+@@ -5512,7 +6645,7 @@
+ 	      # Make sure the rpath contains only unique directories.
+ 	      case "$temp_rpath:" in
+ 	      *"$absdir:"*) ;;
+-	      *) temp_rpath="$temp_rpath$absdir:" ;;
++	      *) func_append temp_rpath "$absdir:" ;;
+ 	      esac
+ 	    fi
+ 
+@@ -5524,7 +6657,7 @@
+ 	    *)
+ 	      case "$compile_rpath " in
+ 	      *" $absdir "*) ;;
+-	      *) compile_rpath="$compile_rpath $absdir"
++	      *) func_append compile_rpath " $absdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5533,7 +6666,7 @@
+ 	    *)
+ 	      case "$finalize_rpath " in
+ 	      *" $libdir "*) ;;
+-	      *) finalize_rpath="$finalize_rpath $libdir"
++	      *) func_append finalize_rpath " $libdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5558,12 +6691,12 @@
+ 	  case $host in
+ 	  *cygwin* | *mingw* | *cegcc*)
+ 	      # No point in relinking DLLs because paths are not encoded
+-	      notinst_deplibs="$notinst_deplibs $lib"
++	      func_append notinst_deplibs " $lib"
+ 	      need_relink=no
+ 	    ;;
+ 	  *)
+ 	    if test "$installed" = no; then
+-	      notinst_deplibs="$notinst_deplibs $lib"
++	      func_append notinst_deplibs " $lib"
+ 	      need_relink=yes
+ 	    fi
+ 	    ;;
+@@ -5580,7 +6713,7 @@
+ 	    fi
+ 	  done
+ 	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+-	    $ECHO
++	    echo
+ 	    if test "$linkmode" = prog; then
+ 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ 	    else
+@@ -5598,7 +6731,7 @@
+ 	    *)
+ 	      case "$compile_rpath " in
+ 	      *" $absdir "*) ;;
+-	      *) compile_rpath="$compile_rpath $absdir"
++	      *) func_append compile_rpath " $absdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5607,7 +6740,7 @@
+ 	    *)
+ 	      case "$finalize_rpath " in
+ 	      *" $libdir "*) ;;
+-	      *) finalize_rpath="$finalize_rpath $libdir"
++	      *) func_append finalize_rpath " $libdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5661,7 +6794,7 @@
+ 	    linklib=$newlib
+ 	  fi # test -n "$old_archive_from_expsyms_cmds"
+ 
+-	  if test "$linkmode" = prog || test "$mode" != relink; then
++	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ 	    add_shlibpath=
+ 	    add_dir=
+ 	    add=
+@@ -5683,9 +6816,9 @@
+ 		      if test "X$dlopenmodule" != "X$lib"; then
+ 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ 			if test -z "$old_library" ; then
+-			  $ECHO
+-			  $ECHO "*** And there doesn't seem to be a static archive available"
+-			  $ECHO "*** The link will probably fail, sorry"
++			  echo
++			  echo "*** And there doesn't seem to be a static archive available"
++			  echo "*** The link will probably fail, sorry"
+ 			else
+ 			  add="$dir/$old_library"
+ 			fi
+@@ -5712,12 +6845,12 @@
+ 	         test "$hardcode_direct_absolute" = no; then
+ 		add="$dir/$linklib"
+ 	      elif test "$hardcode_minus_L" = yes; then
+-		add_dir="-L$dir"
++		add_dir="-L$absdir"
+ 		# Try looking first in the location we're being installed to.
+ 		if test -n "$inst_prefix_dir"; then
+ 		  case $libdir in
+ 		    [\\/]*)
+-		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
++		      func_append add_dir " -L$inst_prefix_dir$libdir"
+ 		      ;;
+ 		  esac
+ 		fi
+@@ -5739,7 +6872,7 @@
+ 	    if test -n "$add_shlibpath"; then
+ 	      case :$compile_shlibpath: in
+ 	      *":$add_shlibpath:"*) ;;
+-	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
++	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ 	      esac
+ 	    fi
+ 	    if test "$linkmode" = prog; then
+@@ -5753,13 +6886,13 @@
+ 		 test "$hardcode_shlibpath_var" = yes; then
+ 		case :$finalize_shlibpath: in
+ 		*":$libdir:"*) ;;
+-		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++		*) func_append finalize_shlibpath "$libdir:" ;;
+ 		esac
+ 	      fi
+ 	    fi
+ 	  fi
+ 
+-	  if test "$linkmode" = prog || test "$mode" = relink; then
++	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ 	    add_shlibpath=
+ 	    add_dir=
+ 	    add=
+@@ -5773,7 +6906,7 @@
+ 	    elif test "$hardcode_shlibpath_var" = yes; then
+ 	      case :$finalize_shlibpath: in
+ 	      *":$libdir:"*) ;;
+-	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++	      *) func_append finalize_shlibpath "$libdir:" ;;
+ 	      esac
+ 	      add="-l$name"
+ 	    elif test "$hardcode_automatic" = yes; then
+@@ -5790,7 +6923,7 @@
+ 	      if test -n "$inst_prefix_dir"; then
+ 		case $libdir in
+ 		  [\\/]*)
+-		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
++		    func_append add_dir " -L$inst_prefix_dir$libdir"
+ 		    ;;
+ 		esac
+ 	      fi
+@@ -5825,21 +6958,21 @@
+ 
+ 	    # Just print a warning and add the library to dependency_libs so
+ 	    # that the program can be linked against the static library.
+-	    $ECHO
++	    echo
+ 	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+-	    $ECHO "*** I have the capability to make that library automatically link in when"
+-	    $ECHO "*** you link to this library.  But I can only do this if you have a"
+-	    $ECHO "*** shared version of the library, which you do not appear to have."
++	    echo "*** I have the capability to make that library automatically link in when"
++	    echo "*** you link to this library.  But I can only do this if you have a"
++	    echo "*** shared version of the library, which you do not appear to have."
+ 	    if test "$module" = yes; then
+-	      $ECHO "*** But as you try to build a module library, libtool will still create "
+-	      $ECHO "*** a static module, that should work as long as the dlopening application"
+-	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
++	      echo "*** But as you try to build a module library, libtool will still create "
++	      echo "*** a static module, that should work as long as the dlopening application"
++	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ 	      if test -z "$global_symbol_pipe"; then
+-		$ECHO
+-		$ECHO "*** However, this would only work if libtool was able to extract symbol"
+-		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+-		$ECHO "*** not find such a program.  So, this module is probably useless."
+-		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
++		echo
++		echo "*** However, this would only work if libtool was able to extract symbol"
++		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
++		echo "*** not find such a program.  So, this module is probably useless."
++		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ 	      fi
+ 	      if test "$build_old_libs" = no; then
+ 		build_libtool_libs=module
+@@ -5867,37 +7000,46 @@
+ 	           temp_xrpath=$func_stripname_result
+ 		   case " $xrpath " in
+ 		   *" $temp_xrpath "*) ;;
+-		   *) xrpath="$xrpath $temp_xrpath";;
++		   *) func_append xrpath " $temp_xrpath";;
+ 		   esac;;
+-	      *) temp_deplibs="$temp_deplibs $libdir";;
++	      *) func_append temp_deplibs " $libdir";;
+ 	      esac
+ 	    done
+ 	    dependency_libs="$temp_deplibs"
+ 	  fi
+ 
+-	  newlib_search_path="$newlib_search_path $absdir"
++	  func_append newlib_search_path " $absdir"
+ 	  # Link against this library
+ 	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ 	  # ... and its dependency_libs
+ 	  tmp_libs=
+ 	  for deplib in $dependency_libs; do
+ 	    newdependency_libs="$deplib $newdependency_libs"
+-	    if $opt_duplicate_deps ; then
++	    case $deplib in
++              -L*) func_stripname '-L' '' "$deplib"
++                   func_resolve_sysroot "$func_stripname_result";;
++              *) func_resolve_sysroot "$deplib" ;;
++            esac
++	    if $opt_preserve_dup_deps ; then
+ 	      case "$tmp_libs " in
+-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	      *" $func_resolve_sysroot_result "*)
++                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ 	      esac
+ 	    fi
+-	    tmp_libs="$tmp_libs $deplib"
++	    func_append tmp_libs " $func_resolve_sysroot_result"
+ 	  done
+ 
+ 	  if test "$link_all_deplibs" != no; then
+ 	    # Add the search paths of all dependency libraries
+ 	    for deplib in $dependency_libs; do
++	      path=
+ 	      case $deplib in
+ 	      -L*) path="$deplib" ;;
+ 	      *.la)
++	        func_resolve_sysroot "$deplib"
++	        deplib=$func_resolve_sysroot_result
+ 	        func_dirname "$deplib" "" "."
+-		dir="$func_dirname_result"
++		dir=$func_dirname_result
+ 		# We need an absolute path.
+ 		case $dir in
+ 		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+@@ -5924,8 +7066,8 @@
+                       if test -z "$darwin_install_name"; then
+                           darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                       fi
+-		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+-		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
++		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
++		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ 		      path=
+ 		    fi
+ 		  fi
+@@ -5958,7 +7100,7 @@
+ 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ 	else
+-	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
++	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ 	fi
+       fi
+       dependency_libs="$newdependency_libs"
+@@ -5975,7 +7117,7 @@
+ 	  for dir in $newlib_search_path; do
+ 	    case "$lib_search_path " in
+ 	    *" $dir "*) ;;
+-	    *) lib_search_path="$lib_search_path $dir" ;;
++	    *) func_append lib_search_path " $dir" ;;
+ 	    esac
+ 	  done
+ 	  newlib_search_path=
+@@ -6033,10 +7175,10 @@
+ 	    -L*)
+ 	      case " $tmp_libs " in
+ 	      *" $deplib "*) ;;
+-	      *) tmp_libs="$tmp_libs $deplib" ;;
++	      *) func_append tmp_libs " $deplib" ;;
+ 	      esac
+ 	      ;;
+-	    *) tmp_libs="$tmp_libs $deplib" ;;
++	    *) func_append tmp_libs " $deplib" ;;
+ 	    esac
+ 	  done
+ 	  eval $var=\"$tmp_libs\"
+@@ -6052,7 +7194,7 @@
+ 	  ;;
+ 	esac
+ 	if test -n "$i" ; then
+-	  tmp_libs="$tmp_libs $i"
++	  func_append tmp_libs " $i"
+ 	fi
+       done
+       dependency_libs=$tmp_libs
+@@ -6093,7 +7235,7 @@
+       # Now set the variables for building old libraries.
+       build_libtool_libs=no
+       oldlibs="$output"
+-      objs="$objs$old_deplibs"
++      func_append objs "$old_deplibs"
+       ;;
+ 
+     lib)
+@@ -6126,10 +7268,10 @@
+ 	if test "$deplibs_check_method" != pass_all; then
+ 	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ 	else
+-	  $ECHO
++	  echo
+ 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ 	  $ECHO "*** objects $objs is not portable!"
+-	  libobjs="$libobjs $objs"
++	  func_append libobjs " $objs"
+ 	fi
+       fi
+ 
+@@ -6188,13 +7330,14 @@
+ 	  # which has an extra 1 added just for fun
+ 	  #
+ 	  case $version_type in
++	  # correct linux to gnu/linux during the next big refactor
+ 	  darwin|linux|osf|windows|none)
+ 	    func_arith $number_major + $number_minor
+ 	    current=$func_arith_result
+ 	    age="$number_minor"
+ 	    revision="$number_revision"
+ 	    ;;
+-	  freebsd-aout|freebsd-elf|sunos)
++	  freebsd-aout|freebsd-elf|qnx|sunos)
+ 	    current="$number_major"
+ 	    revision="$number_minor"
+ 	    age="0"
+@@ -6304,7 +7447,7 @@
+ 	  versuffix="$major.$revision"
+ 	  ;;
+ 
+-	linux)
++	linux) # correct to gnu/linux during the next big refactor
+ 	  func_arith $current - $age
+ 	  major=.$func_arith_result
+ 	  versuffix="$major.$age.$revision"
+@@ -6327,7 +7470,7 @@
+ 	  done
+ 
+ 	  # Make executables depend on our current version.
+-	  verstring="$verstring:${current}.0"
++	  func_append verstring ":${current}.0"
+ 	  ;;
+ 
+ 	qnx)
+@@ -6395,10 +7538,10 @@
+       fi
+ 
+       func_generate_dlsyms "$libname" "$libname" "yes"
+-      libobjs="$libobjs $symfileobj"
++      func_append libobjs " $symfileobj"
+       test "X$libobjs" = "X " && libobjs=
+ 
+-      if test "$mode" != relink; then
++      if test "$opt_mode" != relink; then
+ 	# Remove our outputs, but don't remove object files since they
+ 	# may have been created when compiling PIC objects.
+ 	removelist=
+@@ -6414,7 +7557,7 @@
+ 		   continue
+ 		 fi
+ 	       fi
+-	       removelist="$removelist $p"
++	       func_append removelist " $p"
+ 	       ;;
+ 	    *) ;;
+ 	  esac
+@@ -6425,27 +7568,28 @@
+ 
+       # Now set the variables for building old libraries.
+       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+-	oldlibs="$oldlibs $output_objdir/$libname.$libext"
++	func_append oldlibs " $output_objdir/$libname.$libext"
+ 
+ 	# Transform .lo files to .o files.
+-	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
++	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+       fi
+ 
+       # Eliminate all temporary directories.
+       #for path in $notinst_path; do
+-      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
+-      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
+-      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
++      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
++      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
++      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+       #done
+ 
+       if test -n "$xrpath"; then
+ 	# If the user specified any rpath flags, then add them.
+ 	temp_xrpath=
+ 	for libdir in $xrpath; do
+-	  temp_xrpath="$temp_xrpath -R$libdir"
++	  func_replace_sysroot "$libdir"
++	  func_append temp_xrpath " -R$func_replace_sysroot_result"
+ 	  case "$finalize_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
++	  *) func_append finalize_rpath " $libdir" ;;
+ 	  esac
+ 	done
+ 	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+@@ -6459,7 +7603,7 @@
+       for lib in $old_dlfiles; do
+ 	case " $dlprefiles $dlfiles " in
+ 	*" $lib "*) ;;
+-	*) dlfiles="$dlfiles $lib" ;;
++	*) func_append dlfiles " $lib" ;;
+ 	esac
+       done
+ 
+@@ -6469,19 +7613,19 @@
+       for lib in $old_dlprefiles; do
+ 	case "$dlprefiles " in
+ 	*" $lib "*) ;;
+-	*) dlprefiles="$dlprefiles $lib" ;;
++	*) func_append dlprefiles " $lib" ;;
+ 	esac
+       done
+ 
+       if test "$build_libtool_libs" = yes; then
+ 	if test -n "$rpath"; then
+ 	  case $host in
+-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
++	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ 	    # these systems don't actually have a c library (as such)!
+ 	    ;;
+ 	  *-*-rhapsody* | *-*-darwin1.[012])
+ 	    # Rhapsody C library is in the System framework
+-	    deplibs="$deplibs System.ltframework"
++	    func_append deplibs " System.ltframework"
+ 	    ;;
+ 	  *-*-netbsd*)
+ 	    # Don't link with libc until the a.out ld.so is fixed.
+@@ -6498,7 +7642,7 @@
+ 	  *)
+ 	    # Add libc to deplibs on all other systems if necessary.
+ 	    if test "$build_libtool_need_lc" = "yes"; then
+-	      deplibs="$deplibs -lc"
++	      func_append deplibs " -lc"
+ 	    fi
+ 	    ;;
+ 	  esac
+@@ -6547,7 +7691,7 @@
+ 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		  case " $predeps $postdeps " in
+ 		  *" $i "*)
+-		    newdeplibs="$newdeplibs $i"
++		    func_append newdeplibs " $i"
+ 		    i=""
+ 		    ;;
+ 		  esac
+@@ -6558,21 +7702,21 @@
+ 		  set dummy $deplib_matches; shift
+ 		  deplib_match=$1
+ 		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+-		    newdeplibs="$newdeplibs $i"
++		    func_append newdeplibs " $i"
+ 		  else
+ 		    droppeddeps=yes
+-		    $ECHO
++		    echo
+ 		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+-		    $ECHO "*** I have the capability to make that library automatically link in when"
+-		    $ECHO "*** you link to this library.  But I can only do this if you have a"
+-		    $ECHO "*** shared version of the library, which I believe you do not have"
+-		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
+-		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
++		    echo "*** I have the capability to make that library automatically link in when"
++		    echo "*** you link to this library.  But I can only do this if you have a"
++		    echo "*** shared version of the library, which I believe you do not have"
++		    echo "*** because a test_compile did reveal that the linker did not use it for"
++		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ 		  fi
+ 		fi
+ 		;;
+ 	      *)
+-		newdeplibs="$newdeplibs $i"
++		func_append newdeplibs " $i"
+ 		;;
+ 	      esac
+ 	    done
+@@ -6590,7 +7734,7 @@
+ 		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		    case " $predeps $postdeps " in
+ 		    *" $i "*)
+-		      newdeplibs="$newdeplibs $i"
++		      func_append newdeplibs " $i"
+ 		      i=""
+ 		      ;;
+ 		    esac
+@@ -6601,29 +7745,29 @@
+ 		    set dummy $deplib_matches; shift
+ 		    deplib_match=$1
+ 		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+-		      newdeplibs="$newdeplibs $i"
++		      func_append newdeplibs " $i"
+ 		    else
+ 		      droppeddeps=yes
+-		      $ECHO
++		      echo
+ 		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+-		      $ECHO "*** I have the capability to make that library automatically link in when"
+-		      $ECHO "*** you link to this library.  But I can only do this if you have a"
+-		      $ECHO "*** shared version of the library, which you do not appear to have"
+-		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
+-		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
++		      echo "*** I have the capability to make that library automatically link in when"
++		      echo "*** you link to this library.  But I can only do this if you have a"
++		      echo "*** shared version of the library, which you do not appear to have"
++		      echo "*** because a test_compile did reveal that the linker did not use this one"
++		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ 		    fi
+ 		  fi
+ 		else
+ 		  droppeddeps=yes
+-		  $ECHO
++		  echo
+ 		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+-		  $ECHO "*** make it link in!  You will probably need to install it or some"
+-		  $ECHO "*** library that it depends on before this library will be fully"
+-		  $ECHO "*** functional.  Installing it before continuing would be even better."
++		  echo "*** make it link in!  You will probably need to install it or some"
++		  echo "*** library that it depends on before this library will be fully"
++		  echo "*** functional.  Installing it before continuing would be even better."
+ 		fi
+ 		;;
+ 	      *)
+-		newdeplibs="$newdeplibs $i"
++		func_append newdeplibs " $i"
+ 		;;
+ 	      esac
+ 	    done
+@@ -6640,15 +7784,27 @@
+ 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		case " $predeps $postdeps " in
+ 		*" $a_deplib "*)
+-		  newdeplibs="$newdeplibs $a_deplib"
++		  func_append newdeplibs " $a_deplib"
+ 		  a_deplib=""
+ 		  ;;
+ 		esac
+ 	      fi
+ 	      if test -n "$a_deplib" ; then
+ 		libname=`eval "\\$ECHO \"$libname_spec\""`
++		if test -n "$file_magic_glob"; then
++		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
++		else
++		  libnameglob=$libname
++		fi
++		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
++		  if test "$want_nocaseglob" = yes; then
++		    shopt -s nocaseglob
++		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
++		    $nocaseglob
++		  else
++		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
++		  fi
+ 		  for potent_lib in $potential_libs; do
+ 		      # Follow soft links.
+ 		      if ls -lLd "$potent_lib" 2>/dev/null |
+@@ -6665,13 +7821,13 @@
+ 			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ 			case $potliblink in
+ 			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+-			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
++			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ 			esac
+ 		      done
+ 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ 			 $SED -e 10q |
+ 			 $EGREP "$file_magic_regex" > /dev/null; then
+-			newdeplibs="$newdeplibs $a_deplib"
++			func_append newdeplibs " $a_deplib"
+ 			a_deplib=""
+ 			break 2
+ 		      fi
+@@ -6680,12 +7836,12 @@
+ 	      fi
+ 	      if test -n "$a_deplib" ; then
+ 		droppeddeps=yes
+-		$ECHO
++		echo
+ 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+-		$ECHO "*** I have the capability to make that library automatically link in when"
+-		$ECHO "*** you link to this library.  But I can only do this if you have a"
+-		$ECHO "*** shared version of the library, which you do not appear to have"
+-		$ECHO "*** because I did check the linker path looking for a file starting"
++		echo "*** I have the capability to make that library automatically link in when"
++		echo "*** you link to this library.  But I can only do this if you have a"
++		echo "*** shared version of the library, which you do not appear to have"
++		echo "*** because I did check the linker path looking for a file starting"
+ 		if test -z "$potlib" ; then
+ 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ 		else
+@@ -6696,7 +7852,7 @@
+ 	      ;;
+ 	    *)
+ 	      # Add a -L argument.
+-	      newdeplibs="$newdeplibs $a_deplib"
++	      func_append newdeplibs " $a_deplib"
+ 	      ;;
+ 	    esac
+ 	  done # Gone through all deplibs.
+@@ -6712,7 +7868,7 @@
+ 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		case " $predeps $postdeps " in
+ 		*" $a_deplib "*)
+-		  newdeplibs="$newdeplibs $a_deplib"
++		  func_append newdeplibs " $a_deplib"
+ 		  a_deplib=""
+ 		  ;;
+ 		esac
+@@ -6723,9 +7879,9 @@
+ 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ 		  for potent_lib in $potential_libs; do
+ 		    potlib="$potent_lib" # see symlink-check above in file_magic test
+-		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
++		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ 		       $EGREP "$match_pattern_regex" > /dev/null; then
+-		      newdeplibs="$newdeplibs $a_deplib"
++		      func_append newdeplibs " $a_deplib"
+ 		      a_deplib=""
+ 		      break 2
+ 		    fi
+@@ -6734,12 +7890,12 @@
+ 	      fi
+ 	      if test -n "$a_deplib" ; then
+ 		droppeddeps=yes
+-		$ECHO
++		echo
+ 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+-		$ECHO "*** I have the capability to make that library automatically link in when"
+-		$ECHO "*** you link to this library.  But I can only do this if you have a"
+-		$ECHO "*** shared version of the library, which you do not appear to have"
+-		$ECHO "*** because I did check the linker path looking for a file starting"
++		echo "*** I have the capability to make that library automatically link in when"
++		echo "*** you link to this library.  But I can only do this if you have a"
++		echo "*** shared version of the library, which you do not appear to have"
++		echo "*** because I did check the linker path looking for a file starting"
+ 		if test -z "$potlib" ; then
+ 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ 		else
+@@ -6750,32 +7906,32 @@
+ 	      ;;
+ 	    *)
+ 	      # Add a -L argument.
+-	      newdeplibs="$newdeplibs $a_deplib"
++	      func_append newdeplibs " $a_deplib"
+ 	      ;;
+ 	    esac
+ 	  done # Gone through all deplibs.
+ 	  ;;
+ 	none | unknown | *)
+ 	  newdeplibs=""
+-	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
+-	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
++	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ 	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 	    for i in $predeps $postdeps ; do
+ 	      # can't use Xsed below, because $i might contain '/'
+-	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
++	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ 	    done
+ 	  fi
+-	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
+-	     $GREP . >/dev/null; then
+-	    $ECHO
++	  case $tmp_deplibs in
++	  *[!\	\ ]*)
++	    echo
+ 	    if test "X$deplibs_check_method" = "Xnone"; then
+-	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
++	      echo "*** Warning: inter-library dependencies are not supported in this platform."
+ 	    else
+-	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
++	      echo "*** Warning: inter-library dependencies are not known to be supported."
+ 	    fi
+-	    $ECHO "*** All declared inter-library dependencies are being dropped."
++	    echo "*** All declared inter-library dependencies are being dropped."
+ 	    droppeddeps=yes
+-	  fi
++	    ;;
++	  esac
+ 	  ;;
+ 	esac
+ 	versuffix=$versuffix_save
+@@ -6787,23 +7943,23 @@
+ 	case $host in
+ 	*-*-rhapsody* | *-*-darwin1.[012])
+ 	  # On Rhapsody replace the C library with the System framework
+-	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
++	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ 	  ;;
+ 	esac
+ 
+ 	if test "$droppeddeps" = yes; then
+ 	  if test "$module" = yes; then
+-	    $ECHO
+-	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
++	    echo
++	    echo "*** Warning: libtool could not satisfy all declared inter-library"
+ 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+-	    $ECHO "*** a static module, that should work as long as the dlopening"
+-	    $ECHO "*** application is linked with the -dlopen flag."
++	    echo "*** a static module, that should work as long as the dlopening"
++	    echo "*** application is linked with the -dlopen flag."
+ 	    if test -z "$global_symbol_pipe"; then
+-	      $ECHO
+-	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
+-	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+-	      $ECHO "*** not find such a program.  So, this module is probably useless."
+-	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
++	      echo
++	      echo "*** However, this would only work if libtool was able to extract symbol"
++	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
++	      echo "*** not find such a program.  So, this module is probably useless."
++	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ 	    fi
+ 	    if test "$build_old_libs" = no; then
+ 	      oldlibs="$output_objdir/$libname.$libext"
+@@ -6813,16 +7969,16 @@
+ 	      build_libtool_libs=no
+ 	    fi
+ 	  else
+-	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
+-	    $ECHO "*** automatically added whenever a program is linked with this library"
+-	    $ECHO "*** or is declared to -dlopen it."
++	    echo "*** The inter-library dependencies that have been dropped here will be"
++	    echo "*** automatically added whenever a program is linked with this library"
++	    echo "*** or is declared to -dlopen it."
+ 
+ 	    if test "$allow_undefined" = no; then
+-	      $ECHO
+-	      $ECHO "*** Since this library must not contain undefined symbols,"
+-	      $ECHO "*** because either the platform does not support them or"
+-	      $ECHO "*** it was explicitly requested with -no-undefined,"
+-	      $ECHO "*** libtool will only create a static version of it."
++	      echo
++	      echo "*** Since this library must not contain undefined symbols,"
++	      echo "*** because either the platform does not support them or"
++	      echo "*** it was explicitly requested with -no-undefined,"
++	      echo "*** libtool will only create a static version of it."
+ 	      if test "$build_old_libs" = no; then
+ 		oldlibs="$output_objdir/$libname.$libext"
+ 		build_libtool_libs=module
+@@ -6839,9 +7995,9 @@
+       # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+       case $host in
+ 	*-*-darwin*)
+-	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+-	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+-	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
++	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
++	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
++	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ 	  ;;
+       esac
+ 
+@@ -6854,7 +8010,7 @@
+ 	*)
+ 	  case " $deplibs " in
+ 	  *" -L$path/$objdir "*)
+-	    new_libs="$new_libs -L$path/$objdir" ;;
++	    func_append new_libs " -L$path/$objdir" ;;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -6864,10 +8020,10 @@
+ 	-L*)
+ 	  case " $new_libs " in
+ 	  *" $deplib "*) ;;
+-	  *) new_libs="$new_libs $deplib" ;;
++	  *) func_append new_libs " $deplib" ;;
+ 	  esac
+ 	  ;;
+-	*) new_libs="$new_libs $deplib" ;;
++	*) func_append new_libs " $deplib" ;;
+ 	esac
+       done
+       deplibs="$new_libs"
+@@ -6879,15 +8035,22 @@
+ 
+       # Test again, we may have decided not to build it any more
+       if test "$build_libtool_libs" = yes; then
++	# Remove ${wl} instances when linking with ld.
++	# FIXME: should test the right _cmds variable.
++	case $archive_cmds in
++	  *\$LD\ *) wl= ;;
++        esac
+ 	if test "$hardcode_into_libs" = yes; then
+ 	  # Hardcode the library paths
+ 	  hardcode_libdirs=
+ 	  dep_rpath=
+ 	  rpath="$finalize_rpath"
+-	  test "$mode" != relink && rpath="$compile_rpath$rpath"
++	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ 	  for libdir in $rpath; do
+ 	    if test -n "$hardcode_libdir_flag_spec"; then
+ 	      if test -n "$hardcode_libdir_separator"; then
++		func_replace_sysroot "$libdir"
++		libdir=$func_replace_sysroot_result
+ 		if test -z "$hardcode_libdirs"; then
+ 		  hardcode_libdirs="$libdir"
+ 		else
+@@ -6896,18 +8059,18 @@
+ 		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ 		    ;;
+ 		  *)
+-		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ 		    ;;
+ 		  esac
+ 		fi
+ 	      else
+ 		eval flag=\"$hardcode_libdir_flag_spec\"
+-		dep_rpath="$dep_rpath $flag"
++		func_append dep_rpath " $flag"
+ 	      fi
+ 	    elif test -n "$runpath_var"; then
+ 	      case "$perm_rpath " in
+ 	      *" $libdir "*) ;;
+-	      *) perm_rpath="$perm_rpath $libdir" ;;
++	      *) func_append perm_rpath " $libdir" ;;
+ 	      esac
+ 	    fi
+ 	  done
+@@ -6915,17 +8078,13 @@
+ 	  if test -n "$hardcode_libdir_separator" &&
+ 	     test -n "$hardcode_libdirs"; then
+ 	    libdir="$hardcode_libdirs"
+-	    if test -n "$hardcode_libdir_flag_spec_ld"; then
+-	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+-	    else
+-	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+-	    fi
++	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+ 	  fi
+ 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ 	    # We should set the runpath_var.
+ 	    rpath=
+ 	    for dir in $perm_rpath; do
+-	      rpath="$rpath$dir:"
++	      func_append rpath "$dir:"
+ 	    done
+ 	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ 	  fi
+@@ -6933,7 +8092,7 @@
+ 	fi
+ 
+ 	shlibpath="$finalize_shlibpath"
+-	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
++	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ 	if test -n "$shlibpath"; then
+ 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ 	fi
+@@ -6959,18 +8118,18 @@
+ 	linknames=
+ 	for link
+ 	do
+-	  linknames="$linknames $link"
++	  func_append linknames " $link"
+ 	done
+ 
+ 	# Use standard objects if they are pic
+-	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
++	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ 	test "X$libobjs" = "X " && libobjs=
+ 
+ 	delfiles=
+ 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ 	  export_symbols="$output_objdir/$libname.uexp"
+-	  delfiles="$delfiles $export_symbols"
++	  func_append delfiles " $export_symbols"
+ 	fi
+ 
+ 	orig_export_symbols=
+@@ -7001,14 +8160,46 @@
+ 	    $opt_dry_run || $RM $export_symbols
+ 	    cmds=$export_symbols_cmds
+ 	    save_ifs="$IFS"; IFS='~'
+-	    for cmd in $cmds; do
++	    for cmd1 in $cmds; do
+ 	      IFS="$save_ifs"
+-	      eval cmd=\"$cmd\"
+-	      func_len " $cmd"
+-	      len=$func_len_result
+-	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
++	      # Take the normal branch if the nm_file_list_spec branch
++	      # doesn't work or if tool conversion is not needed.
++	      case $nm_file_list_spec~$to_tool_file_cmd in
++		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
++		  try_normal_branch=yes
++		  eval cmd=\"$cmd1\"
++		  func_len " $cmd"
++		  len=$func_len_result
++		  ;;
++		*)
++		  try_normal_branch=no
++		  ;;
++	      esac
++	      if test "$try_normal_branch" = yes \
++		 && { test "$len" -lt "$max_cmd_len" \
++		      || test "$max_cmd_len" -le -1; }
++	      then
+ 		func_show_eval "$cmd" 'exit $?'
+ 		skipped_export=false
++	      elif test -n "$nm_file_list_spec"; then
++		func_basename "$output"
++		output_la=$func_basename_result
++		save_libobjs=$libobjs
++		save_output=$output
++		output=${output_objdir}/${output_la}.nm
++		func_to_tool_file "$output"
++		libobjs=$nm_file_list_spec$func_to_tool_file_result
++		func_append delfiles " $output"
++		func_verbose "creating $NM input file list: $output"
++		for obj in $save_libobjs; do
++		  func_to_tool_file "$obj"
++		  $ECHO "$func_to_tool_file_result"
++		done > "$output"
++		eval cmd=\"$cmd1\"
++		func_show_eval "$cmd" 'exit $?'
++		output=$save_output
++		libobjs=$save_libobjs
++		skipped_export=false
+ 	      else
+ 		# The command line is too long to execute in one step.
+ 		func_verbose "using reloadable object file for export list..."
+@@ -7029,7 +8220,7 @@
+ 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ 	  tmp_export_symbols="$export_symbols"
+ 	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+-	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
++	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ 	fi
+ 
+ 	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+@@ -7041,7 +8232,7 @@
+ 	  # global variables. join(1) would be nice here, but unfortunately
+ 	  # isn't a blessed tool.
+ 	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+-	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
++	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ 	  export_symbols=$output_objdir/$libname.def
+ 	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ 	fi
+@@ -7051,7 +8242,7 @@
+ 	  case " $convenience " in
+ 	  *" $test_deplib "*) ;;
+ 	  *)
+-	    tmp_deplibs="$tmp_deplibs $test_deplib"
++	    func_append tmp_deplibs " $test_deplib"
+ 	    ;;
+ 	  esac
+ 	done
+@@ -7071,21 +8262,21 @@
+ 	    test "X$libobjs" = "X " && libobjs=
+ 	  else
+ 	    gentop="$output_objdir/${outputname}x"
+-	    generated="$generated $gentop"
++	    func_append generated " $gentop"
+ 
+ 	    func_extract_archives $gentop $convenience
+-	    libobjs="$libobjs $func_extract_archives_result"
++	    func_append libobjs " $func_extract_archives_result"
+ 	    test "X$libobjs" = "X " && libobjs=
+ 	  fi
+ 	fi
+ 
+ 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ 	  eval flag=\"$thread_safe_flag_spec\"
+-	  linker_flags="$linker_flags $flag"
++	  func_append linker_flags " $flag"
+ 	fi
+ 
+ 	# Make a backup of the uninstalled library when relinking
+-	if test "$mode" = relink; then
++	if test "$opt_mode" = relink; then
+ 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ 	fi
+ 
+@@ -7130,7 +8321,8 @@
+ 	    save_libobjs=$libobjs
+ 	  fi
+ 	  save_output=$output
+-	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
++	  func_basename "$output"
++	  output_la=$func_basename_result
+ 
+ 	  # Clear the reloadable object creation command queue and
+ 	  # initialize k to one.
+@@ -7143,13 +8335,16 @@
+ 	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ 	    output=${output_objdir}/${output_la}.lnkscript
+ 	    func_verbose "creating GNU ld script: $output"
+-	    $ECHO 'INPUT (' > $output
++	    echo 'INPUT (' > $output
+ 	    for obj in $save_libobjs
+ 	    do
+-	      $ECHO "$obj" >> $output
++	      func_to_tool_file "$obj"
++	      $ECHO "$func_to_tool_file_result" >> $output
+ 	    done
+-	    $ECHO ')' >> $output
+-	    delfiles="$delfiles $output"
++	    echo ')' >> $output
++	    func_append delfiles " $output"
++	    func_to_tool_file "$output"
++	    output=$func_to_tool_file_result
+ 	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ 	    output=${output_objdir}/${output_la}.lnk
+ 	    func_verbose "creating linker input file list: $output"
+@@ -7163,10 +8358,12 @@
+ 	    fi
+ 	    for obj
+ 	    do
+-	      $ECHO "$obj" >> $output
++	      func_to_tool_file "$obj"
++	      $ECHO "$func_to_tool_file_result" >> $output
+ 	    done
+-	    delfiles="$delfiles $output"
+-	    output=$firstobj\"$file_list_spec$output\"
++	    func_append delfiles " $output"
++	    func_to_tool_file "$output"
++	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ 	  else
+ 	    if test -n "$save_libobjs"; then
+ 	      func_verbose "creating reloadable object files..."
+@@ -7190,17 +8387,19 @@
+ 		  # command to the queue.
+ 		  if test "$k" -eq 1 ; then
+ 		    # The first file doesn't have a previous command to add.
+-		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
++		    reload_objs=$objlist
++		    eval concat_cmds=\"$reload_cmds\"
+ 		  else
+ 		    # All subsequent reloadable object files will link in
+ 		    # the last one created.
+-		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
++		    reload_objs="$objlist $last_robj"
++		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ 		  fi
+ 		  last_robj=$output_objdir/$output_la-${k}.$objext
+ 		  func_arith $k + 1
+ 		  k=$func_arith_result
+ 		  output=$output_objdir/$output_la-${k}.$objext
+-		  objlist=$obj
++		  objlist=" $obj"
+ 		  func_len " $last_robj"
+ 		  func_arith $len0 + $func_len_result
+ 		  len=$func_arith_result
+@@ -7210,11 +8409,12 @@
+ 	      # reloadable object file.  All subsequent reloadable object
+ 	      # files will link in the last one created.
+ 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
++	      reload_objs="$objlist $last_robj"
++	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ 	      if test -n "$last_robj"; then
+ 	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ 	      fi
+-	      delfiles="$delfiles $output"
++	      func_append delfiles " $output"
+ 
+ 	    else
+ 	      output=
+@@ -7248,7 +8448,7 @@
+ 		lt_exit=$?
+ 
+ 		# Restore the uninstalled library and exit
+-		if test "$mode" = relink; then
++		if test "$opt_mode" = relink; then
+ 		  ( cd "$output_objdir" && \
+ 		    $RM "${realname}T" && \
+ 		    $MV "${realname}U" "$realname" )
+@@ -7269,7 +8469,7 @@
+ 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ 	      tmp_export_symbols="$export_symbols"
+ 	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+-	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
++	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ 	    fi
+ 
+ 	    if test -n "$orig_export_symbols"; then
+@@ -7281,7 +8481,7 @@
+ 	      # global variables. join(1) would be nice here, but unfortunately
+ 	      # isn't a blessed tool.
+ 	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+-	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
++	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ 	      export_symbols=$output_objdir/$libname.def
+ 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ 	    fi
+@@ -7322,10 +8522,10 @@
+ 	# Add any objects from preloaded convenience libraries
+ 	if test -n "$dlprefiles"; then
+ 	  gentop="$output_objdir/${outputname}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 
+ 	  func_extract_archives $gentop $dlprefiles
+-	  libobjs="$libobjs $func_extract_archives_result"
++	  func_append libobjs " $func_extract_archives_result"
+ 	  test "X$libobjs" = "X " && libobjs=
+ 	fi
+ 
+@@ -7341,7 +8541,7 @@
+ 	    lt_exit=$?
+ 
+ 	    # Restore the uninstalled library and exit
+-	    if test "$mode" = relink; then
++	    if test "$opt_mode" = relink; then
+ 	      ( cd "$output_objdir" && \
+ 	        $RM "${realname}T" && \
+ 		$MV "${realname}U" "$realname" )
+@@ -7353,7 +8553,7 @@
+ 	IFS="$save_ifs"
+ 
+ 	# Restore the uninstalled library and exit
+-	if test "$mode" = relink; then
++	if test "$opt_mode" = relink; then
+ 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+ 
+ 	  if test -n "$convenience"; then
+@@ -7434,18 +8634,21 @@
+       if test -n "$convenience"; then
+ 	if test -n "$whole_archive_flag_spec"; then
+ 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+-	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
++	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ 	else
+ 	  gentop="$output_objdir/${obj}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 
+ 	  func_extract_archives $gentop $convenience
+ 	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+ 	fi
+       fi
+ 
++      # If we're not building shared, we need to use non_pic_objs
++      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
++
+       # Create the old-style object.
+-      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
++      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+ 
+       output="$obj"
+       func_execute_cmds "$reload_cmds" 'exit $?'
+@@ -7505,8 +8708,8 @@
+       case $host in
+       *-*-rhapsody* | *-*-darwin1.[012])
+ 	# On Rhapsody replace the C library is the System framework
+-	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+-	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
++	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
++	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ 	;;
+       esac
+ 
+@@ -7517,14 +8720,14 @@
+ 	if test "$tagname" = CXX ; then
+ 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 	    10.[0123])
+-	      compile_command="$compile_command ${wl}-bind_at_load"
+-	      finalize_command="$finalize_command ${wl}-bind_at_load"
++	      func_append compile_command " ${wl}-bind_at_load"
++	      func_append finalize_command " ${wl}-bind_at_load"
+ 	    ;;
+ 	  esac
+ 	fi
+ 	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+-	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+-	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
++	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
++	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ 	;;
+       esac
+ 
+@@ -7538,7 +8741,7 @@
+ 	*)
+ 	  case " $compile_deplibs " in
+ 	  *" -L$path/$objdir "*)
+-	    new_libs="$new_libs -L$path/$objdir" ;;
++	    func_append new_libs " -L$path/$objdir" ;;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -7548,17 +8751,17 @@
+ 	-L*)
+ 	  case " $new_libs " in
+ 	  *" $deplib "*) ;;
+-	  *) new_libs="$new_libs $deplib" ;;
++	  *) func_append new_libs " $deplib" ;;
+ 	  esac
+ 	  ;;
+-	*) new_libs="$new_libs $deplib" ;;
++	*) func_append new_libs " $deplib" ;;
+ 	esac
+       done
+       compile_deplibs="$new_libs"
+ 
+ 
+-      compile_command="$compile_command $compile_deplibs"
+-      finalize_command="$finalize_command $finalize_deplibs"
++      func_append compile_command " $compile_deplibs"
++      func_append finalize_command " $finalize_deplibs"
+ 
+       if test -n "$rpath$xrpath"; then
+ 	# If the user specified any rpath flags, then add them.
+@@ -7566,7 +8769,7 @@
+ 	  # This is the magic to use -rpath.
+ 	  case "$finalize_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
++	  *) func_append finalize_rpath " $libdir" ;;
+ 	  esac
+ 	done
+       fi
+@@ -7585,18 +8788,18 @@
+ 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ 		;;
+ 	      *)
+-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ 		;;
+ 	      esac
+ 	    fi
+ 	  else
+ 	    eval flag=\"$hardcode_libdir_flag_spec\"
+-	    rpath="$rpath $flag"
++	    func_append rpath " $flag"
+ 	  fi
+ 	elif test -n "$runpath_var"; then
+ 	  case "$perm_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) perm_rpath="$perm_rpath $libdir" ;;
++	  *) func_append perm_rpath " $libdir" ;;
+ 	  esac
+ 	fi
+ 	case $host in
+@@ -7605,12 +8808,12 @@
+ 	  case :$dllsearchpath: in
+ 	  *":$libdir:"*) ;;
+ 	  ::) dllsearchpath=$libdir;;
+-	  *) dllsearchpath="$dllsearchpath:$libdir";;
++	  *) func_append dllsearchpath ":$libdir";;
+ 	  esac
+ 	  case :$dllsearchpath: in
+ 	  *":$testbindir:"*) ;;
+ 	  ::) dllsearchpath=$testbindir;;
+-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
++	  *) func_append dllsearchpath ":$testbindir";;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -7636,18 +8839,18 @@
+ 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ 		;;
+ 	      *)
+-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ 		;;
+ 	      esac
+ 	    fi
+ 	  else
+ 	    eval flag=\"$hardcode_libdir_flag_spec\"
+-	    rpath="$rpath $flag"
++	    func_append rpath " $flag"
+ 	  fi
+ 	elif test -n "$runpath_var"; then
+ 	  case "$finalize_perm_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
++	  *) func_append finalize_perm_rpath " $libdir" ;;
+ 	  esac
+ 	fi
+       done
+@@ -7661,8 +8864,8 @@
+ 
+       if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ 	# Transform all the library objects into standard objects.
+-	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+-	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
++	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
++	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+       fi
+ 
+       func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+@@ -7674,15 +8877,15 @@
+ 
+       wrappers_required=yes
+       case $host in
++      *cegcc* | *mingw32ce*)
++        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
++        wrappers_required=no
++        ;;
+       *cygwin* | *mingw* )
+         if test "$build_libtool_libs" != yes; then
+           wrappers_required=no
+         fi
+         ;;
+-      *cegcc)
+-        # Disable wrappers for cegcc, we are cross compiling anyway.
+-        wrappers_required=no
+-        ;;
+       *)
+         if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+           wrappers_required=no
+@@ -7691,13 +8894,19 @@
+       esac
+       if test "$wrappers_required" = no; then
+ 	# Replace the output file specification.
+-	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
++	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ 	link_command="$compile_command$compile_rpath"
+ 
+ 	# We have no uninstalled library dependencies, so finalize right now.
+ 	exit_status=0
+ 	func_show_eval "$link_command" 'exit_status=$?'
+ 
++	if test -n "$postlink_cmds"; then
++	  func_to_tool_file "$output"
++	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++	  func_execute_cmds "$postlink_cmds" 'exit $?'
++	fi
++
+ 	# Delete the generated files.
+ 	if test -f "$output_objdir/${outputname}S.${objext}"; then
+ 	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+@@ -7720,7 +8929,7 @@
+ 	  # We should set the runpath_var.
+ 	  rpath=
+ 	  for dir in $perm_rpath; do
+-	    rpath="$rpath$dir:"
++	    func_append rpath "$dir:"
+ 	  done
+ 	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ 	fi
+@@ -7728,7 +8937,7 @@
+ 	  # We should set the runpath_var.
+ 	  rpath=
+ 	  for dir in $finalize_perm_rpath; do
+-	    rpath="$rpath$dir:"
++	    func_append rpath "$dir:"
+ 	  done
+ 	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ 	fi
+@@ -7738,11 +8947,18 @@
+ 	# We don't need to create a wrapper script.
+ 	link_command="$compile_var$compile_command$compile_rpath"
+ 	# Replace the output file specification.
+-	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
++	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ 	# Delete the old output file.
+ 	$opt_dry_run || $RM $output
+ 	# Link the executable and exit
+ 	func_show_eval "$link_command" 'exit $?'
++
++	if test -n "$postlink_cmds"; then
++	  func_to_tool_file "$output"
++	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++	  func_execute_cmds "$postlink_cmds" 'exit $?'
++	fi
++
+ 	exit $EXIT_SUCCESS
+       fi
+ 
+@@ -7757,7 +8973,7 @@
+ 	if test "$fast_install" != no; then
+ 	  link_command="$finalize_var$compile_command$finalize_rpath"
+ 	  if test "$fast_install" = yes; then
+-	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
++	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ 	  else
+ 	    # fast_install is set to needless
+ 	    relink_command=
+@@ -7769,13 +8985,19 @@
+       fi
+ 
+       # Replace the output file specification.
+-      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
++      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+ 
+       # Delete the old output files.
+       $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+ 
+       func_show_eval "$link_command" 'exit $?'
+ 
++      if test -n "$postlink_cmds"; then
++	func_to_tool_file "$output_objdir/$outputname"
++	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++	func_execute_cmds "$postlink_cmds" 'exit $?'
++      fi
++
+       # Now create the wrapper script.
+       func_verbose "creating $output"
+ 
+@@ -7793,20 +9015,9 @@
+ 	  fi
+ 	done
+ 	relink_command="(cd `pwd`; $relink_command)"
+-	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
++	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+       fi
+ 
+-      # Quote $ECHO for shipping.
+-      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
+-	case $progpath in
+-	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+-	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+-	esac
+-	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
+-      else
+-	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
+-      fi
+-
+       # Only actually do things if not in dry run mode.
+       $opt_dry_run || {
+ 	# win32 will think the script is a binary if it has
+@@ -7884,7 +9095,7 @@
+ 	else
+ 	  oldobjs="$old_deplibs $non_pic_objects"
+ 	  if test "$preload" = yes && test -f "$symfileobj"; then
+-	    oldobjs="$oldobjs $symfileobj"
++	    func_append oldobjs " $symfileobj"
+ 	  fi
+ 	fi
+ 	addlibs="$old_convenience"
+@@ -7892,10 +9103,10 @@
+ 
+       if test -n "$addlibs"; then
+ 	gentop="$output_objdir/${outputname}x"
+-	generated="$generated $gentop"
++	func_append generated " $gentop"
+ 
+ 	func_extract_archives $gentop $addlibs
+-	oldobjs="$oldobjs $func_extract_archives_result"
++	func_append oldobjs " $func_extract_archives_result"
+       fi
+ 
+       # Do each command in the archive commands.
+@@ -7906,10 +9117,10 @@
+ 	# Add any objects from preloaded convenience libraries
+ 	if test -n "$dlprefiles"; then
+ 	  gentop="$output_objdir/${outputname}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 
+ 	  func_extract_archives $gentop $dlprefiles
+-	  oldobjs="$oldobjs $func_extract_archives_result"
++	  func_append oldobjs " $func_extract_archives_result"
+ 	fi
+ 
+ 	# POSIX demands no paths to be encoded in archives.  We have
+@@ -7925,9 +9136,9 @@
+ 	    done | sort | sort -uc >/dev/null 2>&1); then
+ 	  :
+ 	else
+-	  $ECHO "copying selected object files to avoid basename conflicts..."
++	  echo "copying selected object files to avoid basename conflicts..."
+ 	  gentop="$output_objdir/${outputname}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 	  func_mkdir_p "$gentop"
+ 	  save_oldobjs=$oldobjs
+ 	  oldobjs=
+@@ -7951,18 +9162,30 @@
+ 		esac
+ 	      done
+ 	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+-	      oldobjs="$oldobjs $gentop/$newobj"
++	      func_append oldobjs " $gentop/$newobj"
+ 	      ;;
+-	    *) oldobjs="$oldobjs $obj" ;;
++	    *) func_append oldobjs " $obj" ;;
+ 	    esac
+ 	  done
+ 	fi
++	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
++	tool_oldlib=$func_to_tool_file_result
+ 	eval cmds=\"$old_archive_cmds\"
+ 
+ 	func_len " $cmds"
+ 	len=$func_len_result
+ 	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ 	  cmds=$old_archive_cmds
++	elif test -n "$archiver_list_spec"; then
++	  func_verbose "using command file archive linking..."
++	  for obj in $oldobjs
++	  do
++	    func_to_tool_file "$obj"
++	    $ECHO "$func_to_tool_file_result"
++	  done > $output_objdir/$libname.libcmd
++	  func_to_tool_file "$output_objdir/$libname.libcmd"
++	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
++	  cmds=$old_archive_cmds
+ 	else
+ 	  # the command line is too long to link in one step, link in parts
+ 	  func_verbose "using piecewise archive linking..."
+@@ -8036,7 +9259,7 @@
+       done
+       # Quote the link command for shipping.
+       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+-      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
++      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+       if test "$hardcode_automatic" = yes ; then
+ 	relink_command=
+       fi
+@@ -8056,12 +9279,23 @@
+ 	      *.la)
+ 		func_basename "$deplib"
+ 		name="$func_basename_result"
+-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++		func_resolve_sysroot "$deplib"
++		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ 		test -z "$libdir" && \
+ 		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+-		newdependency_libs="$newdependency_libs $libdir/$name"
++		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ 		;;
+-	      *) newdependency_libs="$newdependency_libs $deplib" ;;
++	      -L*)
++		func_stripname -L '' "$deplib"
++		func_replace_sysroot "$func_stripname_result"
++		func_append newdependency_libs " -L$func_replace_sysroot_result"
++		;;
++	      -R*)
++		func_stripname -R '' "$deplib"
++		func_replace_sysroot "$func_stripname_result"
++		func_append newdependency_libs " -R$func_replace_sysroot_result"
++		;;
++	      *) func_append newdependency_libs " $deplib" ;;
+ 	      esac
+ 	    done
+ 	    dependency_libs="$newdependency_libs"
+@@ -8075,9 +9309,9 @@
+ 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ 		test -z "$libdir" && \
+ 		  func_fatal_error "\`$lib' is not a valid libtool archive"
+-		newdlfiles="$newdlfiles $libdir/$name"
++		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ 		;;
+-	      *) newdlfiles="$newdlfiles $lib" ;;
++	      *) func_append newdlfiles " $lib" ;;
+ 	      esac
+ 	    done
+ 	    dlfiles="$newdlfiles"
+@@ -8094,7 +9328,7 @@
+ 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ 		test -z "$libdir" && \
+ 		  func_fatal_error "\`$lib' is not a valid libtool archive"
+-		newdlprefiles="$newdlprefiles $libdir/$name"
++		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ 		;;
+ 	      esac
+ 	    done
+@@ -8106,7 +9340,7 @@
+ 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ 		*) abs=`pwd`"/$lib" ;;
+ 	      esac
+-	      newdlfiles="$newdlfiles $abs"
++	      func_append newdlfiles " $abs"
+ 	    done
+ 	    dlfiles="$newdlfiles"
+ 	    newdlprefiles=
+@@ -8115,15 +9349,33 @@
+ 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ 		*) abs=`pwd`"/$lib" ;;
+ 	      esac
+-	      newdlprefiles="$newdlprefiles $abs"
++	      func_append newdlprefiles " $abs"
+ 	    done
+ 	    dlprefiles="$newdlprefiles"
+ 	  fi
+ 	  $RM $output
+ 	  # place dlname in correct position for cygwin
++	  # In fact, it would be nice if we could use this code for all target
++	  # systems that can't hard-code library paths into their executables
++	  # and that have no shared library path variable independent of PATH,
++	  # but it turns out we can't easily determine that from inspecting
++	  # libtool variables, so we have to hard-code the OSs to which it
++	  # applies here; at the moment, that means platforms that use the PE
++	  # object format with DLL files.  See the long comment at the top of
++	  # tests/bindir.at for full details.
+ 	  tdlname=$dlname
+ 	  case $host,$output,$installed,$module,$dlname in
+-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
++	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
++	      # If a -bindir argument was supplied, place the dll there.
++	      if test "x$bindir" != x ;
++	      then
++		func_relative_path "$install_libdir" "$bindir"
++		tdlname=$func_relative_path_result$dlname
++	      else
++		# Otherwise fall back on heuristic.
++		tdlname=../bin/$dlname
++	      fi
++	      ;;
+ 	  esac
+ 	  $ECHO > $output "\
+ # $outputname - a libtool library file
+@@ -8182,7 +9434,7 @@
+     exit $EXIT_SUCCESS
+ }
+ 
+-{ test "$mode" = link || test "$mode" = relink; } &&
++{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+     func_mode_link ${1+"$@"}
+ 
+ 
+@@ -8202,9 +9454,9 @@
+     for arg
+     do
+       case $arg in
+-      -f) RM="$RM $arg"; rmforce=yes ;;
+-      -*) RM="$RM $arg" ;;
+-      *) files="$files $arg" ;;
++      -f) func_append RM " $arg"; rmforce=yes ;;
++      -*) func_append RM " $arg" ;;
++      *) func_append files " $arg" ;;
+       esac
+     done
+ 
+@@ -8213,24 +9465,23 @@
+ 
+     rmdirs=
+ 
+-    origobjdir="$objdir"
+     for file in $files; do
+       func_dirname "$file" "" "."
+       dir="$func_dirname_result"
+       if test "X$dir" = X.; then
+-	objdir="$origobjdir"
++	odir="$objdir"
+       else
+-	objdir="$dir/$origobjdir"
++	odir="$dir/$objdir"
+       fi
+       func_basename "$file"
+       name="$func_basename_result"
+-      test "$mode" = uninstall && objdir="$dir"
++      test "$opt_mode" = uninstall && odir="$dir"
+ 
+-      # Remember objdir for removal later, being careful to avoid duplicates
+-      if test "$mode" = clean; then
++      # Remember odir for removal later, being careful to avoid duplicates
++      if test "$opt_mode" = clean; then
+ 	case " $rmdirs " in
+-	  *" $objdir "*) ;;
+-	  *) rmdirs="$rmdirs $objdir" ;;
++	  *" $odir "*) ;;
++	  *) func_append rmdirs " $odir" ;;
+ 	esac
+       fi
+ 
+@@ -8256,18 +9507,17 @@
+ 
+ 	  # Delete the libtool libraries and symlinks.
+ 	  for n in $library_names; do
+-	    rmfiles="$rmfiles $objdir/$n"
++	    func_append rmfiles " $odir/$n"
+ 	  done
+-	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
++	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+ 
+-	  case "$mode" in
++	  case "$opt_mode" in
+ 	  clean)
+-	    case "  $library_names " in
+-	    # "  " in the beginning catches empty $dlname
++	    case " $library_names " in
+ 	    *" $dlname "*) ;;
+-	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
++	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ 	    esac
+-	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
++	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ 	    ;;
+ 	  uninstall)
+ 	    if test -n "$library_names"; then
+@@ -8295,19 +9545,19 @@
+ 	  # Add PIC object to the list of files to remove.
+ 	  if test -n "$pic_object" &&
+ 	     test "$pic_object" != none; then
+-	    rmfiles="$rmfiles $dir/$pic_object"
++	    func_append rmfiles " $dir/$pic_object"
+ 	  fi
+ 
+ 	  # Add non-PIC object to the list of files to remove.
+ 	  if test -n "$non_pic_object" &&
+ 	     test "$non_pic_object" != none; then
+-	    rmfiles="$rmfiles $dir/$non_pic_object"
++	    func_append rmfiles " $dir/$non_pic_object"
+ 	  fi
+ 	fi
+ 	;;
+ 
+       *)
+-	if test "$mode" = clean ; then
++	if test "$opt_mode" = clean ; then
+ 	  noexename=$name
+ 	  case $file in
+ 	  *.exe)
+@@ -8317,7 +9567,7 @@
+ 	    noexename=$func_stripname_result
+ 	    # $file with .exe has already been added to rmfiles,
+ 	    # add $file without .exe
+-	    rmfiles="$rmfiles $file"
++	    func_append rmfiles " $file"
+ 	    ;;
+ 	  esac
+ 	  # Do a test to see if this is a libtool program.
+@@ -8326,7 +9576,7 @@
+ 	      func_ltwrapper_scriptname "$file"
+ 	      relink_command=
+ 	      func_source $func_ltwrapper_scriptname_result
+-	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
++	      func_append rmfiles " $func_ltwrapper_scriptname_result"
+ 	    else
+ 	      relink_command=
+ 	      func_source $dir/$noexename
+@@ -8334,12 +9584,12 @@
+ 
+ 	    # note $name still contains .exe if it was in $file originally
+ 	    # as does the version of $file that was added into $rmfiles
+-	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
++	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ 	    if test "$fast_install" = yes && test -n "$relink_command"; then
+-	      rmfiles="$rmfiles $objdir/lt-$name"
++	      func_append rmfiles " $odir/lt-$name"
+ 	    fi
+ 	    if test "X$noexename" != "X$name" ; then
+-	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
++	      func_append rmfiles " $odir/lt-${noexename}.c"
+ 	    fi
+ 	  fi
+ 	fi
+@@ -8347,7 +9597,6 @@
+       esac
+       func_show_eval "$RM $rmfiles" 'exit_status=1'
+     done
+-    objdir="$origobjdir"
+ 
+     # Try to remove the ${objdir}s in the directories where we deleted files
+     for dir in $rmdirs; do
+@@ -8359,16 +9608,16 @@
+     exit $exit_status
+ }
+ 
+-{ test "$mode" = uninstall || test "$mode" = clean; } &&
++{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+     func_mode_uninstall ${1+"$@"}
+ 
+-test -z "$mode" && {
++test -z "$opt_mode" && {
+   help="$generic_help"
+   func_fatal_help "you must specify a MODE"
+ }
+ 
+ test -z "$exec_cmd" && \
+-  func_fatal_help "invalid operation mode \`$mode'"
++  func_fatal_help "invalid operation mode \`$opt_mode'"
+ 
+ if test -n "$exec_cmd"; then
+   eval exec "$exec_cmd"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13085)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13086)
+@@ -3,7 +3,8 @@
+ #AUTOCONF
+ AC_INIT([ISSM],[4.2.1],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
+ AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
+-AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
++AC_CONFIG_MACRO_DIR([externalpackages/libtool/install/share/aclocal])                 #m4 macros are located in m4
++m4_include([m4/issm_options.m4])
+ AC_CANONICAL_TARGET                       #Determine the system type
+ 
+ #Compilers
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am	(revision 13085)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am	(revision 13086)
+@@ -1,3 +1,5 @@
+ EXTRA_DIST = reconf scripts test m4 examples cron etc doc packages contributors.txt 
+ SUBDIRS = src
+ bin_SCRIPTS=config.h startup.m README.rtf
++
++ACLOCAL_AMFLAGS = -I externalpackages/libtool/install/share/aclocal
Index: /issm/oecreview/Archive/12678-13393/ISSM-13086-13087.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13086-13087.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13086-13087.diff	(revision 13394)
@@ -0,0 +1,83 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ar-lib.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ar-lib.m4	(revision 13086)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/ar-lib.m4	(revision 13087)
+@@ -1,61 +0,0 @@
+-##                                                          -*- Autoconf -*-
+-# Copyright (C) 2011 Free Software Foundation, Inc.
+-#
+-# This file is free software; the Free Software Foundation
+-# gives unlimited permission to copy and/or distribute it,
+-# with or without modifications, as long as this notice is preserved.
+-
+-# serial 1
+-
+-# AM_PROG_AR([ACT-IF-FAIL])
+-# -------------------------
+-# Try to determine the archiver interface, and trigger the ar-lib wrapper
+-# if it is needed.  If the detection of archiver interface fails, run
+-# ACT-IF-FAIL (default is to abort configure with a proper error message).
+-AC_DEFUN([AM_PROG_AR],
+-[AC_BEFORE([$0], [LT_INIT])dnl
+-AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
+-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+-AC_REQUIRE_AUX_FILE([ar-lib])dnl
+-AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
+-: ${AR=ar}
+-
+-AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
+-  [am_cv_ar_interface=ar
+-   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
+-     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+-      AC_TRY_EVAL([am_ar_try])
+-      if test "$ac_status" -eq 0; then
+-        am_cv_ar_interface=ar
+-      else
+-        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+-        AC_TRY_EVAL([am_ar_try])
+-        if test "$ac_status" -eq 0; then
+-          am_cv_ar_interface=lib
+-        else
+-          am_cv_ar_interface=unknown
+-        fi
+-      fi
+-      rm -f conftest.lib libconftest.a
+-     ])
+-   ])
+-
+-case $am_cv_ar_interface in
+-ar)
+-  ;;
+-lib)
+-  # Microsoft lib, so override with the ar-lib wrapper script.
+-  # FIXME: It is wrong to rewrite AR.
+-  # But if we don't then we get into trouble of one sort or another.
+-  # A longer-term fix would be to have automake use am__AR in this case,
+-  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+-  # similar.
+-  AR="$am_aux_dir/ar-lib $AR"
+-  ;;
+-unknown)
+-  m4_default([$1],
+-             [AC_MSG_ERROR([could not determine $AR interface])])
+-  ;;
+-esac
+-AC_SUBST([AR])dnl
+-])
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4	(revision 13086)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4	(revision 13087)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4
+___________________________________________________________________
+Modified: svn:ignore
+## -1,7 +1 ##
+-svn-commit.tmp
+-ltsugar.m4
+-libtool.m4
+-ltversion.m4
+-lt~obsolete.m4
+-ltoptions.m4
+-ltdl.m4
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-13087-13088.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13087-13088.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13087-13088.diff	(revision 13394)
@@ -0,0 +1,330 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13087)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13088)
+@@ -4,41 +4,41 @@
+ 
+ #Modules {{{1
+ if MODULES
+-lib_LTLIBRARIES =  AverageFilter.la
+-#			       BamgMesher.la\
+-#				   BamgConvertMesh.la\
+-#				   BamgTriangulate.la\
+-#				   ContourToMesh.la\
+-#				   ContourToNodes.la\
+-#				   ElementConnectivity.la\
+-#				   EnumToString.la\
+-#				   Exp2Kml.la\
+-#				   HoleFiller.la\
+-#				   InternalFront.la\
+-#				   InterpFromGridToMesh.la\
+-#				   InterpFromMeshToMesh2d.la\
+-#				   InterpFromMeshToMesh3d.la\
+-#				   InterpFromMeshToGrid.la\
+-#				   InterpFromMesh2d.la\
+-#				   KMLFileRead.la\
+-#				   KMLMeshWrite.la\
+-#				   KMLOverlay.la\
+-#				   Kml2Exp.la\
+-#				   Kriging.la\
+-#				   Ll2xy.la\
+-#				   NodeConnectivity.la\
+-#				   MeshPartition.la\
+-#				   MeshProfileIntersection.la\
+-#				   PointCloudFindNeighbors.la\
+-#				   PropagateFlagsFromConnectivity.la\
+-#				   Shp2Kml.la\
+-#				   StringToEnum.la\
+-#				   TriaSearch.la\
+-#				   TriMesh.la\
+-#				   TriMeshProcessRifts.la\
+-#				   Scotch.la\
+-#				   Xy2ll.la\
+-#                  Chaco.la
++lib_LTLIBRARIES =  AverageFilter.la\
++			       BamgMesher.la\
++				   BamgConvertMesh.la\
++				   BamgTriangulate.la\
++				   ContourToMesh.la\
++				   ContourToNodes.la\
++				   ElementConnectivity.la\
++				   EnumToString.la\
++				   Exp2Kml.la\
++				   HoleFiller.la\
++				   InternalFront.la\
++				   InterpFromGridToMesh.la\
++				   InterpFromMeshToMesh2d.la\
++				   InterpFromMeshToMesh3d.la\
++				   InterpFromMeshToGrid.la\
++				   InterpFromMesh2d.la\
++				   KMLFileRead.la\
++				   KMLMeshWrite.la\
++				   KMLOverlay.la\
++				   Kml2Exp.la\
++				   Kriging.la\
++				   Ll2xy.la\
++				   NodeConnectivity.la\
++				   MeshPartition.la\
++				   MeshProfileIntersection.la\
++				   PointCloudFindNeighbors.la\
++				   PropagateFlagsFromConnectivity.la\
++				   Shp2Kml.la\
++				   StringToEnum.la\
++				   TriaSearch.la\
++				   TriMesh.la\
++				   TriMeshProcessRifts.la\
++				   Scotch.la\
++				   Xy2ll.la\
++                   Chaco.la
+ endif 
+ #}}}
+ #Flags and libraries {{{1
+@@ -90,145 +90,143 @@
+ #}}}
+ 
+ #Bin sources {{{1
+-echo "WHAT IS MUMPS: " $(MUMPSLIB)
+-echo "WHAT IS MPI  : " $(MPILIB)
+ AverageFilter_la_SOURCES = ../AverageFilter/AverageFilter.cpp\
+ 			  ../AverageFilter/AverageFilter.h
+-AverageFilter_la_LIBADD = ${deps} $(PETSCLIB) $(MUMPSLIB) $(MPILIB) $(FLIBS) $(FORTRANLIB) $(METISLIB) $(MULTITHREADINGLIB)
++AverageFilter_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\
+-#					../BamgMesher/BamgMesher.h
+-#BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\
++					../BamgMesher/BamgMesher.h
++BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#BamgConvertMesh_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
+-#					../BamgConvertMesh/BamgConvertMesh.h
+-#BamgConvertMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++BamgConvertMesh_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
++					../BamgConvertMesh/BamgConvertMesh.h
++BamgConvertMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#BamgTriangulate_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
+-#								  ../BamgTriangulate/BamgTriangulate.h
+-#BamgTriangulate_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++BamgTriangulate_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
++								  ../BamgTriangulate/BamgTriangulate.h
++BamgTriangulate_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#Chaco_la_SOURCES = ../Chaco/Chaco.cpp\
+-#					../Chaco/Chaco.h
+-#Chaco_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(CHACOLIB)
++Chaco_la_SOURCES = ../Chaco/Chaco.cpp\
++					../Chaco/Chaco.h
++Chaco_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(CHACOLIB)
+ 
+-#ContourToMesh_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
+-#			               ../ContourToMesh/ContourToMesh.h
+-#ContourToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++ContourToMesh_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
++			               ../ContourToMesh/ContourToMesh.h
++ContourToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-#ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
+-#			  ../ContourToNodes/ContourToNodes.h
+-#ContourToNodes_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
++			  ../ContourToNodes/ContourToNodes.h
++ContourToNodes_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+-#			  ../ElementConnectivity/ElementConnectivity.h
+-#ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
++			  ../ElementConnectivity/ElementConnectivity.h
++ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\
+-#			  ../EnumToString/EnumToString.h
+-#EnumToString_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\
++			  ../EnumToString/EnumToString.h
++EnumToString_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\
+-#			  ../StringToEnum/StringToEnum.h
+-#StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\
++			  ../StringToEnum/StringToEnum.h
++StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#HoleFiller_la_SOURCES = ../HoleFiller/HoleFiller.cpp\
+-#			  ../HoleFiller/HoleFiller.h
+-#HoleFiller_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 
++HoleFiller_la_SOURCES = ../HoleFiller/HoleFiller.cpp\
++			  ../HoleFiller/HoleFiller.h
++HoleFiller_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 
+ 
+-#InternalFront_la_SOURCES = ../InternalFront/InternalFront.cpp\
+-#										 ../InternalFront/InternalFront.h
+-#InternalFront_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++InternalFront_la_SOURCES = ../InternalFront/InternalFront.cpp\
++										 ../InternalFront/InternalFront.h
++InternalFront_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#InterpFromGridToMesh_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
+-#			  ../InterpFromGridToMesh/InterpFromGridToMesh.h
+-#InterpFromGridToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++InterpFromGridToMesh_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
++			  ../InterpFromGridToMesh/InterpFromGridToMesh.h
++InterpFromGridToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-#InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
+-#							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+-#InterpFromMeshToMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
++							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
++InterpFromMeshToMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-#InterpFromMeshToMesh3d_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
+-#									../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
+-#InterpFromMeshToMesh3d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++InterpFromMeshToMesh3d_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
++									../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
++InterpFromMeshToMesh3d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#InterpFromMeshToGrid_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
+-#									../InterpFromMeshToGrid/InterpFromMeshToGrid.h
+-#InterpFromMeshToGrid_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++InterpFromMeshToGrid_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
++									../InterpFromMeshToGrid/InterpFromMeshToGrid.h
++InterpFromMeshToGrid_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#InterpFromMesh2d_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
+-#									../InterpFromMesh2d/InterpFromMesh2d.h
+-#InterpFromMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++InterpFromMesh2d_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
++									../InterpFromMesh2d/InterpFromMesh2d.h
++InterpFromMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-#KMLFileRead_la_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
+-#			  ../KMLFileRead/KMLFileRead.h
+-#KMLFileRead_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++KMLFileRead_la_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
++			  ../KMLFileRead/KMLFileRead.h
++KMLFileRead_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#KMLMeshWrite_la_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
+-#			  ../KMLMeshWrite/KMLMeshWrite.h
+-#KMLMeshWrite_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++KMLMeshWrite_la_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
++			  ../KMLMeshWrite/KMLMeshWrite.h
++KMLMeshWrite_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#KMLOverlay_la_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
+-#			  ../KMLOverlay/KMLOverlay.h
+-#KMLOverlay_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++KMLOverlay_la_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
++			  ../KMLOverlay/KMLOverlay.h
++KMLOverlay_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#Xy2ll_la_SOURCES = ../Xy2ll/Xy2ll.cpp\
+-#			  ../Xy2ll/Xy2ll.h
+-#Xy2ll_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++Xy2ll_la_SOURCES = ../Xy2ll/Xy2ll.cpp\
++			  ../Xy2ll/Xy2ll.h
++Xy2ll_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#Ll2xy_la_SOURCES = ../Ll2xy/Ll2xy.cpp\
+-#			  ../Ll2xy/Ll2xy.h
+-#Ll2xy_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++Ll2xy_la_SOURCES = ../Ll2xy/Ll2xy.cpp\
++			  ../Ll2xy/Ll2xy.h
++Ll2xy_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#Exp2Kml_la_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
+-#			  ../Exp2Kml/Exp2Kml.h
+-#Exp2Kml_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++Exp2Kml_la_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
++			  ../Exp2Kml/Exp2Kml.h
++Exp2Kml_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#Kml2Exp_la_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
+-#			  ../Kml2Exp/Kml2Exp.h
+-#Kml2Exp_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++Kml2Exp_la_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
++			  ../Kml2Exp/Kml2Exp.h
++Kml2Exp_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#Kriging_la_SOURCES = ../Kriging/Kriging.cpp\
+-#						../Kriging/Kriging.h
+-#Kriging_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++Kriging_la_SOURCES = ../Kriging/Kriging.cpp\
++						../Kriging/Kriging.h
++Kriging_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-#MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\
+-#			  ../MeshPartition/MeshPartition.h
+-#MeshPartition_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\
++			  ../MeshPartition/MeshPartition.h
++MeshPartition_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
+-#			  ../MeshProfileIntersection/MeshProfileIntersection.h
+-#MeshProfileIntersection_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
++			  ../MeshProfileIntersection/MeshProfileIntersection.h
++MeshProfileIntersection_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
+-#										../NodeConnectivity/NodeConnectivity.h
+-#NodeConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
++										../NodeConnectivity/NodeConnectivity.h
++NodeConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#PointCloudFindNeighbors_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
+-#			  ../PointCloudFindNeighbors/PointCloudFindNeighbors.h
+-#PointCloudFindNeighbors_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++PointCloudFindNeighbors_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
++			  ../PointCloudFindNeighbors/PointCloudFindNeighbors.h
++PointCloudFindNeighbors_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-#PropagateFlagsFromConnectivity_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
+-#			  ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
+-#PropagateFlagsFromConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++PropagateFlagsFromConnectivity_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
++			  ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
++PropagateFlagsFromConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#Scotch_la_SOURCES = ../Scotch/Scotch.cpp\
+-#                    ../Scotch/Scotch.h
+-#Scotch_la_LIBADD = ${deps} $(SCOTCHLIB)
++Scotch_la_SOURCES = ../Scotch/Scotch.cpp\
++                    ../Scotch/Scotch.h
++Scotch_la_LIBADD = ${deps} $(SCOTCHLIB)
+ 
+-#Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
+-#                     ../Shp2Kml/Shp2Kml.h
+-#Shp2Kml_la_LIBADD = ${deps}
++Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
++                     ../Shp2Kml/Shp2Kml.h
++Shp2Kml_la_LIBADD = ${deps}
+ 
+-#TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp\
+-#			  ../TriaSearch/TriaSearch.h
+-#TriaSearch_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp\
++			  ../TriaSearch/TriaSearch.h
++TriaSearch_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-#TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
+-#                     ../TriMesh/TriMesh.h
+-#TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB)
++TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
++                     ../TriMesh/TriMesh.h
++TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB)
+ 
+-#TriMeshProcessRifts_la_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
+-#			  ../TriMeshProcessRifts/TriMeshProcessRifts.h
+-#TriMeshProcessRifts_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++TriMeshProcessRifts_la_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
++			  ../TriMeshProcessRifts/TriMeshProcessRifts.h
++TriMeshProcessRifts_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ #}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13088-13089.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13088-13089.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13088-13089.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh	(revision 13088)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh	(revision 13089)
+@@ -8,4 +8,4 @@
+ # If all goes well, then the script will be shortened in the future.
+ 
+ cd $ISSM_DIR
+-autoreconf -iv --force -I m4
++autoreconf -iv --force -I externalpackages/libtool/install/share/aclocal
Index: /issm/oecreview/Archive/12678-13393/ISSM-13089-13090.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13089-13090.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13089-13090.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh	(revision 13089)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh	(revision 13090)
+@@ -8,4 +8,4 @@
+ # If all goes well, then the script will be shortened in the future.
+ 
+ cd $ISSM_DIR
+-autoreconf -iv --force -I externalpackages/libtool/install/share/aclocal
++autoreconf -iv -I externalpackages/libtool/install/share/aclocal
Index: /issm/oecreview/Archive/12678-13393/ISSM-13090-13091.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13090-13091.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13090-13091.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh	(revision 13090)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh	(revision 13091)
+@@ -19,8 +19,3 @@
+ ./configure --prefix="$ISSM_DIR/externalpackages/libtool/install" 
+ make  
+ make install
+-
+-cd ../install/share/aclocal
+-cp libtool.m4 $ISSM_DIR/m4/
+-cp lt* $ISSM_DIR/m4/
+-ls $ISSM_DIR/m4
Index: /issm/oecreview/Archive/12678-13393/ISSM-13091-13092.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13091-13092.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13091-13092.diff	(revision 13394)
@@ -0,0 +1,117 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13091)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13092)
+@@ -192,7 +192,7 @@
+ 			break;
+ 		 #endif
+ 		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
+-			Ke=CreateKMatrixSlope();
++			Ke=CreateMassMatrix();
+ 			break;
+ 		case PrognosticAnalysisEnum:
+ 			Ke=CreateKMatrixPrognostic();
+@@ -476,37 +476,35 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Tria::CreateKMatrixSlope {{{*/
+-ElementMatrix* Tria::CreateKMatrixSlope(void){
++/*FUNCTION Tria::CreateMassMatrix {{{*/
++ElementMatrix* Tria::CreateMassMatrix(void){
+ 
+ 	/*constants: */
+ 	const int    numdof=NDOF1*NUMVERTICES;
+ 
+ 	/* Intermediaries */
+-	int        i,j,ig;
+-	IssmDouble     DL_scalar,Jdet;
+-	IssmDouble     xyz_list[NUMVERTICES][3];
+-	IssmDouble     L[1][3];
+-	GaussTria *gauss = NULL;
++	IssmDouble  D,Jdet;
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	IssmDouble  L[1][3];
++	GaussTria  *gauss = NULL;
+ 
+ 	/*Initialize Element matrix*/
+ 	ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
+-
+ 	GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES);
+ 
+ 	/* Start looping on the number of gaussian points: */
+ 	gauss=new GaussTria(2);
+-	for (ig=gauss->begin();ig<gauss->end();ig++){
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 
+ 		gauss->GaussPoint(ig);
+ 		
+ 		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+-		DL_scalar=gauss->weight*Jdet;
++		D=gauss->weight*Jdet;
+ 
+ 		GetL(&L[0][0], &xyz_list[0][0], gauss,NDOF1);
+ 
+ 		TripleMultiply(&L[0][0],1,3,1,
+-					&DL_scalar,1,1,0,
++					&D,1,1,0,
+ 					&L[0][0],1,3,0,
+ 					&Ke->values[0],1);
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 13091)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 13092)
+@@ -176,7 +176,7 @@
+ 		ElementMatrix* CreateKMatrixPrognostic(void);
+ 		ElementMatrix* CreateKMatrixPrognostic_CG(void);
+ 		ElementMatrix* CreateKMatrixPrognostic_DG(void);
+-		ElementMatrix* CreateKMatrixSlope(void);
++		ElementMatrix* CreateMassMatrix(void);
+ 		ElementVector* CreatePVectorBalancethickness(void);
+ 		ElementVector* CreatePVectorBalancethickness_DG(void);
+ 		ElementVector* CreatePVectorBalancethickness_CG(void);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13091)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13092)
+@@ -441,7 +441,7 @@
+ 			break;
+ 		#endif
+ 		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
+-			Ke=CreateKMatrixSlope();
++			Ke=CreateBasalMassMatrix();
+ 			break;
+ 		case PrognosticAnalysisEnum:
+ 			Ke=CreateKMatrixPrognostic();
+@@ -499,13 +499,13 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Penta::CreateKMatrixSlope {{{*/
+-ElementMatrix* Penta::CreateKMatrixSlope(void){
++/*FUNCTION Penta::CreateBasalMassMatrix{{{*/
++ElementMatrix* Penta::CreateBasalMassMatrix(void){
+ 
+ 	if (!IsOnBed()) return NULL;
+ 
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+-	ElementMatrix* Ke=tria->CreateKMatrixSlope();
++	ElementMatrix* Ke=tria->CreateMassMatrix();
+ 	delete tria->matice; delete tria;
+ 
+ 	/*clean up and return*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 13091)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 13092)
+@@ -168,8 +168,8 @@
+ 		/*}}}*/
+ 		/*Penta specific routines:{{{*/
+ 		void	  BedNormal(IssmDouble* bed_normal, IssmDouble xyz_list[3][3]);
++		ElementMatrix* CreateBasalMassMatrix(void);
+ 		ElementMatrix* CreateKMatrixPrognostic(void);
+-		ElementMatrix* CreateKMatrixSlope(void);
+ 		ElementVector* CreatePVectorPrognostic(void);
+ 		ElementVector* CreatePVectorSlope(void);
+ 		void	  GetDofList(int** pdoflist,int approximation_enum,int setenum);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13092-13093.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13092-13093.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13092-13093.diff	(revision 13394)
@@ -0,0 +1,59 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13092)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13093)
+@@ -36,6 +36,10 @@
+ 		self.vz_obs                      = float('NaN')
+ 		self.vel_obs                     = float('NaN')
+ 		self.thickness_obs               = float('NaN')
++
++		#set defaults
++		self.setdefaultparameters()
++
+ 		#}}}
+ 	def __repr__(self):
+ 		# {{{ Display
+@@ -77,29 +81,29 @@
+ 
+ 		#parameter to be inferred by control methods (only
+ 		#drag and B are supported yet)
+-		self.control_parameters=['FrictionCoefficient']
++		self.control_parameters='FrictionCoefficient'
+ 
+ 		#number of steps in the control methods
+ 		self.nsteps=20
+ 
+ 		#maximum number of iteration in the optimization algorithm for
+ 		#each step
+-		self.maxiter_per_step=20*ones(self.nsteps)
++		self.maxiter_per_step=20*numpy.ones(self.nsteps)
+ 
+ 		#the inversed parameter is updated as follows:
+ 		#new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1];
+ 		#usually the gradient_scaling must be of the order of magnitude of the 
+ 		#inversed parameter (10^8 for B, 50 for drag) and can be decreased
+ 		#after the first iterations
+-		self.gradient_scaling=50*ones(self.nsteps)
++		self.gradient_scaling=50*numpy.ones(self.nsteps)
+ 
+ 		#several responses can be used:
+-		self.cost_functions=101*ones(self.nsteps)
++		self.cost_functions=101*numpy.ones(self.nsteps)
+ 
+ 		#step_threshold is used to speed up control method. When
+ 		#misfit(1)/misfit(0) < self.step_threshold, we go directly to
+ 		#the next step
+-		self.step_threshold=.7*ones(self.nsteps) #30 per cent decrement
++		self.step_threshold=.7*numpy.ones(self.nsteps) #30 per cent decrement
+ 
+ 		#stop control solution at the gradient computation and return it? 
+ 		self.gradient_only=0
+@@ -107,7 +111,7 @@
+ 		#cost_function_threshold is a criteria to stop the control methods.
+ 		#if J[n]-J[n-1]/J[n] < criteria, the control run stops
+ 		#NaN if not applied
+-		self.cost_function_threshold=NaN #not activated 
++		self.cost_function_threshold=float('NaN')    #not activated 
+ 
+ 		return self
+ 	#}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13093-13094.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13093-13094.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13093-13094.diff	(revision 13394)
@@ -0,0 +1,132 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 13093)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 13094)
+@@ -16,17 +16,17 @@
+ 	#properties
+ 	def __init__(self):
+ 		# {{{ Properties
+-		self.rho_ice                    = 0
+-		self.rho_water                  = 0
+-		self.rho_freshwater             = 0
+-		self.mu_water                   = 0
+-		self.heatcapacity               = 0
+-		self.latentheat                 = 0
+-		self.thermalconductivity        = 0
+-		self.meltingpoint               = 0
+-		self.beta                       = 0
+-		self.mixed_layer_capacity       = 0
+-		self.thermal_exchange_velocity  = 0
++		self.rho_ice                    = 0.
++		self.rho_water                  = 0.
++		self.rho_freshwater             = 0.
++		self.mu_water                   = 0.
++		self.heatcapacity               = 0.
++		self.latentheat                 = 0.
++		self.thermalconductivity        = 0.
++		self.meltingpoint               = 0.
++		self.beta                       = 0.
++		self.mixed_layer_capacity       = 0.
++		self.thermal_exchange_velocity  = 0.
+ 		self.rheology_B   = float('NaN')
+ 		self.rheology_n   = float('NaN')
+ 		self.rheology_law = ''
+@@ -57,19 +57,19 @@
+ 	def setdefaultparameters(self):
+ 		# {{{setdefaultparameters
+ 		#ice density (kg/m^3)
+-		self.rho_ice=917
++		self.rho_ice=917.
+ 
+ 		#ocean water density (kg/m^3)
+-		self.rho_water=1023
++		self.rho_water=1023.
+ 
+ 		#fresh water density (kg/m^3)
+-		self.rho_freshwater=1000
++		self.rho_freshwater=1000.
+ 
+ 		#water viscosity (N.s/m^2)
+ 		self.mu_water=0.001787  
+ 
+ 		#ice heat capacity cp (J/kg/K)
+-		self.heatcapacity=2093
++		self.heatcapacity=2093.
+ 
+ 		#ice latent heat of fusion L (J/kg)
+ 		self.latentheat=3.34*10**5
+@@ -84,7 +84,7 @@
+ 		self.beta=9.8*10**-8
+ 
+ 		#mixed layer (ice-water interface) heat capacity (J/kg/K)
+-		self.mixed_layer_capacity=3974
++		self.mixed_layer_capacity=3974.
+ 
+ 		#thermal exchange velocity (ice-water interface) (m/s)
+ 		self.thermal_exchange_velocity=1.00*10**-4
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.m	(revision 13093)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.m	(revision 13094)
+@@ -5,17 +5,17 @@
+ 
+ classdef materials
+ 	properties (SetAccess=public) 
+-		rho_ice                    = 0;
+-		rho_water                  = 0;
+-		rho_freshwater             = 0;
+-		mu_water                   = 0;
+-		heatcapacity               = 0;
+-		latentheat                 = 0;
+-		thermalconductivity        = 0;
+-		meltingpoint               = 0;
+-		beta                       = 0;
+-		mixed_layer_capacity       = 0;
+-		thermal_exchange_velocity  = 0;
++		rho_ice                    = 0.;
++		rho_water                  = 0.;
++		rho_freshwater             = 0.;
++		mu_water                   = 0.;
++		heatcapacity               = 0.;
++		latentheat                 = 0.;
++		thermalconductivity        = 0.;
++		meltingpoint               = 0.;
++		beta                       = 0.;
++		mixed_layer_capacity       = 0.;
++		thermal_exchange_velocity  = 0.;
+ 		rheology_B   = NaN;
+ 		rheology_n   = NaN;
+ 		rheology_law = '';
+@@ -32,19 +32,19 @@
+ 		function obj = setdefaultparameters(obj) % {{{
+ 
+ 			%ice density (kg/m^3)
+-			obj.rho_ice=917;
++			obj.rho_ice=917.;
+ 
+ 			%ocean water density (kg/m^3)
+-			obj.rho_water=1023;
++			obj.rho_water=1023.;
+ 
+ 			%fresh water density (kg/m^3)
+-			obj.rho_freshwater=1000;
++			obj.rho_freshwater=1000.;
+ 
+ 			%water viscosity (N.s/m^2)
+ 			obj.mu_water=0.001787;  
+ 
+ 			%ice heat capacity cp (J/kg/K)
+-			obj.heatcapacity=2093;
++			obj.heatcapacity=2093.;
+ 
+ 			%ice latent heat of fusion L (J/kg)
+ 			obj.latentheat=3.34*10^5;
+@@ -59,7 +59,7 @@
+ 			obj.beta=9.8*10^-8;
+ 
+ 			%mixed layer (ice-water interface) heat capacity (J/kg/K)
+-			obj.mixed_layer_capacity=3974;
++			obj.mixed_layer_capacity=3974.;
+ 
+ 			%thermal exchange velocity (ice-water interface) (m/s)
+ 			obj.thermal_exchange_velocity=1.00*10^-4;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13094-13095.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13094-13095.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13094-13095.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 13094)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 13095)
+@@ -66,8 +66,8 @@
+ 		233 : 'SquareShelfTranP3dForcTemp',
+ 		234 : 'SquareShelfTranForceNeg2dDakotaSamp',
+ 		235 : 'SquareShelfTranForceNeg2dDakotaLocal',
+-		236 : 'SquareShelfTranIspddIsdeltaM2d';
+-		237 : 'SquareShelfTranIspddIsdeltaM3d';
++		236 : 'SquareShelfTranIspddIsdeltaM2d',
++		237 : 'SquareShelfTranIspddIsdeltaM3d',
+ 		301 : 'SquareSheetConstrainedDiagM2d',
+ 		302 : 'SquareSheetConstrainedDiagH2d',
+ 		303 : 'SquareSheetConstrainedDiagHM2d',
Index: /issm/oecreview/Archive/12678-13393/ISSM-13095-13096.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13095-13096.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13095-13096.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1206.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1205.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1207.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-13096-13097.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13096-13097.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13096-13097.diff	(revision 13394)
@@ -0,0 +1,112 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py	(revision 13096)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py	(revision 13097)
+@@ -63,7 +63,6 @@
+ 					string+=packages[i]+','
+ 				string=string[:-1]+'}'
+ 
+-
+ 			if port:
+ 				subprocess.call('scp -P %d %s@localhost:%s %s' % (port,login,os.path.join(path,string),os.getcwd),shell=True)
+ 			else:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13096)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13097)
+@@ -18,7 +18,7 @@
+ 
+ 		#Check that file exists
+ 		if not os.path.exists(filename):
+-			raise ValueError("binary file '%s' not found." % filename)
++			raise OSError("binary file '%s' not found." % filename)
+ 
+ 		#initialize md.results if not a structure yet
+ 		if not isinstance(md.results,dict):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py	(revision 13096)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py	(revision 13097)
+@@ -26,7 +26,8 @@
+ 	#Go through all model fields: check that it is a class and call checkconsistency
+ 	fields=vars(md)
+ 
+-	for field in fields.iterkeys():
++#	for field in fields.iterkeys():
++	for field in ['mesh','mask','geometry','constants','surfaceforcings','basalforcings','materials','friction','flowequation','timestepping','initialization','rifts','debug','verbose','settings','solver','cluster','balancethickness','diagnostic','groundingline','hydrology','prognostic','thermal','steadystate','transient','autodiff','flaim','inversion','qmu','results','radaroverlay','miscellaneous','private']:
+ 
+ 		#Some properties do not need to be marshalled
+ 		if field in ['results','radaroverlay','solver','cluster','flaim','private']:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13096)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13097)
+@@ -103,7 +103,10 @@
+ 		if isinstance(data,bool):
+ 			data=numpy.array([data])
+ 		if len(data.shape) == 1:
+-			data=data.reshape(1,numpy.size(data,0))
++			if numpy.size(data):
++				data=data.reshape(numpy.size(data),1)
++			else:
++				data=data.reshape(0,0)
+ 
+ 		#Get size
+ 		s=data.shape
+@@ -131,7 +134,10 @@
+ 		if isinstance(data,int):
+ 			data=numpy.array([data])
+ 		if len(data.shape) == 1:
+-			data=data.reshape(1,numpy.size(data,0))
++			if numpy.size(data):
++				data=data.reshape(numpy.size(data),1)
++			else:
++				data=data.reshape(0,0)
+ 
+ 		#Get size
+ 		s=data.shape
+@@ -159,7 +165,10 @@
+ 		if isinstance(data,(bool,int,long,float)):
+ 			data=numpy.array([data])
+ 		if len(data.shape) == 1:
+-			data=data.reshape(1,numpy.size(data,0))
++			if numpy.size(data):
++				data=data.reshape(numpy.size(data),1)
++			else:
++				data=data.reshape(0,0)
+ 
+ 		#Get size
+ 		s=data.shape
+@@ -190,7 +199,10 @@
+ 			if isinstance(matrix,(bool,int,long,float)):
+ 				matrix=numpy.array([matrix])
+ 			if len(matrix.shape) == 1:
+-				matrix=matrix.reshape(1,numpy.size(matrix,0))
++				if numpy.size(matrix):
++					matrix=matrix.reshape(numpy.size(matrix),1)
++				else:
++					matrix=matrix.reshape(0,0)
+ 
+ 			s=matrix.shape
+ 			recordlength+=4*2+s[0]*s[1]*8    #row and col of matrix + matrix of doubles
+@@ -209,7 +221,7 @@
+ 			if isinstance(matrix,(bool,int,long,float)):
+ 				matrix=numpy.array([matrix])
+ 			if len(matrix.shape) == 1:
+-				matrix=matrix.reshape(1,numpy.size(matrix,0))
++				matrix=matrix.reshape(numpy.size(matrix),1)
+ 
+ 			s=matrix.shape
+ 			fid.write(struct.pack('i',s[0])) 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13096)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13097)
+@@ -26,6 +26,7 @@
+ 		if 'tabular_graphics_data' in md.qmu.params:
+ 			if md.qmu.params['tabular_graphics_data']:
+ 				filelist.append('dakota_tabular.dat')
++	else:
+ 		filelist.append(md.miscellaneous.name+'.outbin')
+ 	cluster.Download(md.private.runtimename,filelist)
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13097-13098.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13097-13098.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13097-13098.diff	(revision 13394)
@@ -0,0 +1,183 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13097)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13098)
+@@ -52,7 +52,7 @@
+ 	#post processes qmu results if necessary
+ 	else:
+ 
+-		if not isinstance(md.private.solution,str):
++		if not isinstance(md.private.solution,(str,unicode)):
+ 			[md.private.solution]=EnumToString(md.private.solution)
+ 		md=postqmu(md)
+ 		os.chdir('..')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13097)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13098)
+@@ -131,7 +131,7 @@
+ 
+ 	elif strcmpi(format,'IntMat'):    # {{{
+ 
+-		if isinstance(data,int):
++		if isinstance(data,(int,long)):
+ 			data=numpy.array([data])
+ 		if len(data.shape) == 1:
+ 			if numpy.size(data):
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/FlagElements.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/FlagElements.py	(revision 13097)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/FlagElements.py	(revision 13098)
+@@ -21,7 +21,7 @@
+ 	      flag=FlagElements(md,md.mask.elementongroundedice);
+ 	"""
+ 
+-	if   isinstance(region,str):
++	if   isinstance(region,(str,unicode)):
+ 		if   not region:
+ 			flag=numpy.zeros(md.mesh.numberofelements,'bool')
+ 			invert=0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py	(revision 13097)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/verbose.py	(revision 13098)
+@@ -43,7 +43,7 @@
+ 
+ 		elif len(args) == 1:
+ 			binary=args[0]
+-			if   isinstance(binary,str):
++			if   isinstance(binary,(str,unicode)):
+ 				if strcmpi(binary,'all'):
+ 					binary=2**11-1    #all ones
+ 					self.BinaryToVerbose(binary)
+@@ -51,7 +51,7 @@
+ 				else:
+ 					binary=int(binary,2)
+ 					self.BinaryToVerbose(binary)
+-			elif isinstance(binary,(int,float)):
++			elif isinstance(binary,(int,long,float)):
+ 				self.BinaryToVerbose(int(binary))
+ 
+ 		else:
+@@ -61,7 +61,7 @@
+ 			#Cast to logicals
+ 			listproperties=vars(self)
+ 			for [fieldname,fieldvalue] in listproperties.iteritems():
+-				if isinstance(fieldvalue,bool) or isinstance(fieldvalue,(int,float)):
++				if isinstance(fieldvalue,bool) or isinstance(fieldvalue,(int,long,float)):
+ 					setattr(self,fieldname,bool(fieldvalue))
+ 				else:
+ 					raise TypeError("verbose supported field values are logicals only (True or False)")
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py	(revision 13097)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py	(revision 13098)
+@@ -35,7 +35,7 @@
+ 
+ 		#go through arg and build list of objects
+ 		for i in xrange(numoptions):
+-			if isinstance(arg[2*i],str):
++			if isinstance(arg[2*i],(str,unicode)):
+ 				self.list[arg[2*i]] = arg[2*i+1];
+ 			else:
+ 				#option is not a string, ignore it
+@@ -44,7 +44,7 @@
+ 
+ 	def addfield(self,field,value):    # {{{
+ 		"""ADDFIELD - add a field to an options list"""
+-		if isinstance(field,str):
++		if isinstance(field,(str,unicode)):
+ 			if field in self.list:
+ 				print "WARNING: field '%s' with value=%s exists and will be overwritten with value=%s." % (field,str(self.list[field]),str(value))
+ 			self.list[field] = value
+@@ -52,7 +52,7 @@
+ 
+ 	def addfielddefault(self,field,value):    # {{{
+ 		"""ADDFIELDDEFAULT - add a field to an options list if it does not exist"""
+-		if isinstance(field,str):
++		if isinstance(field,(str,unicode)):
+ 			if field not in self.list:
+ 				self.list[field] = value
+ 	# }}}
+@@ -99,7 +99,7 @@
+ 		if self.list:
+ 			s+="   list: (%ix%i)\n\n" % (len(self.list),2)
+ 			for item in self.list.iteritems():
+-				if   isinstance(item[1],str):
++				if   isinstance(item[1],(str,unicode)):
+ 					s+="     field: %-10s value: '%s'\n" % (item[0],item[1])
+ 				elif isinstance(item[1],(bool,int,long,float)):
+ 					s+="     field: %-10s value: %g\n" % (item[0],item[1])
+@@ -116,7 +116,7 @@
+ 		#some argument checking: 
+ 		if field == None or field == '':
+ 			raise ValueError('exist error message: bad usage');
+-		if not isinstance(field,str):
++		if not isinstance(field,(str,unicode)):
+ 			raise TypeError("exist error message: field '%s' should be a string." % str(field));
+ 
+ 		#Recover option
+@@ -156,7 +156,7 @@
+ 		#some argument checking: 
+ 		if field == None or field == '':
+ 			raise ValueError('getfieldvalue error message: bad usage');
+-		if not isinstance(field,str):
++		if not isinstance(field,(str,unicode)):
+ 			raise TypeError("getfieldvalue error message: field '%s' should be a string." % str(field));
+ 
+ 		#Recover option
+@@ -203,7 +203,7 @@
+ 			WriteData(fid,'enum',(firstindex-1)+2*i+1,'data',name,'format','String')
+ 
+ 			#Write option value
+-			if   isinstance(value,str):
++			if   isinstance(value,(str,unicode)):
+ 				WriteData(fid,'enum',(firstindex-1)+2*i+2,'data',value,'format','String')
+ 			elif isinstance(value,(bool,int,long,float)):
+ 				WriteData(fid,'enum',(firstindex-1)+2*i+2,'data',value,'format','Double')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py	(revision 13097)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/solver.py	(revision 13098)
+@@ -94,9 +94,9 @@
+ 					fid.write("-%s\n" % optionname)
+ 				else:
+ 					#option with value. value can be string or scalar
+-					if   isinstance(optionvalue,(bool,int,float)):
++					if   isinstance(optionvalue,(bool,int,long,float)):
+ 						fid.write("-%s %g\n" % (optionname,optionvalue))
+-					elif isinstance(optionvalue,str):
++					elif isinstance(optionvalue,(str,unicode)):
+ 						fid.write("-%s %s\n" % (optionname,optionvalue))
+ 					else:
+ 						raise TypeError("PetscFile error: option '%s' is not well formatted." % optionname)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py	(revision 13097)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py	(revision 13098)
+@@ -18,14 +18,14 @@
+ def  parsedisplay(offset,name,field,comment):
+ 
+ 	#string
+-	if isinstance(field,str):
++	if isinstance(field,(str,unicode)):
+ 		if len(field)>30:
+ 			string=displayunit(offset,name,"not displayed",comment)
+ 		else:
+ 			string=displayunit(offset,name,field,comment)
+ 
+ 	#numeric
+-	elif isinstance(field, int):
++	elif isinstance(field, (int,long)):
+ 		string=displayunit(offset,name,"%i" % (field),comment) 
+ 
+ 	elif isinstance(field, complex):
+@@ -87,7 +87,7 @@
+ 	if not comment:
+ 		string="%s%-23s: %-15s" % (offset,name,characterization)
+ 	else:
+-		if isinstance(comment,str):
++		if isinstance(comment,(str,unicode)):
+ 			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment)
+ 		elif isinstance(comment,list):
+ 			print(comment)
Index: /issm/oecreview/Archive/12678-13393/ISSM-13098-13099.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13098-13099.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13098-13099.diff	(revision 13394)
@@ -0,0 +1,18 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 13098)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 13099)
+@@ -4,11 +4,11 @@
+ rm -rf install
+ 
+ #Select or create a new simlink
+-ln -s /usr/local/pkgs/matlab-7.6/ install
++#ln -s /usr/local/pkgs/matlab-7.6/ install
+ #ln -s /discover/vis/mathworks/matlab_r2011b/ install
+ #ln -s /usr/local/matlab704/ install
+ #ln -s /usr/local/matlab711/ install
+-#ln -s /usr/local/matlab712/ install
++ln -s /usr/local/matlab712/ install
+ 
+ # Macintosh (OSX) simlink 
+ #ln -s /Applications/MATLAB_R2008a/ install
Index: /issm/oecreview/Archive/12678-13393/ISSM-13099-13100.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13099-13100.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13099-13100.diff	(revision 13394)
@@ -0,0 +1,83 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-dev-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-dev-pleiades.sh	(revision 13099)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-dev-pleiades.sh	(revision 13100)
+@@ -1,7 +1,6 @@
+ #!/bin/bash
+ #Step 0: download
+-#Step 1: install before plapack crasehs
+-#Step 2: After Plapack implodes
++#Step 1: install and write script
+ STEP=0
+ 
+ if [ $STEP -eq 0 ]; then
+@@ -19,7 +18,6 @@
+ #      cd config/BuildSystem
+ #      hg pull -u
+ 
+-
+ # configure script
+ # Note: using metis from externalpackages did not work...
+ # for now downloading new metis
+@@ -55,56 +53,18 @@
+ 		--download-ptscotch=yes \
+ 		--download-spooles=yes \
+ 		--download-spai=yes \
+-		--download-superlu=http://crd.lbl.gov/~xiaoye/SuperLU/superlu_4.3.tar.gz \
++		--download-superlu=yes \
++		--download-hypre=yes \
++		--download-prometheus=yes \
+ 		--FFLAGS=-I/usr/include \
++		--with-cxx=icpc \
+ 		--with-cc=icc \
+ 		--with-fc=ifort \
+ 		--COPTFLAGS=" -O3 -xS" \
+ 		--FOPTFLAGS=" -O3 -xS" \
+ 		--CXXOPTFLAGS=" -O3 -xS" \
+ 		--with-pic=1
+-	echo "== Fix Plapack compilation manually (http://issm.jpl.nasa.gov/documentation/faq/petsc32/) =="
+-	echo "== Then run STEP=2 =="
+-fi
+-if [ $STEP -eq 2 ]; then
+-	cd src
+-	./config/configure.py \
+-	 --prefix="$ISSM_DIR/externalpackages/petsc/install" \
+-	 --with-batch=1  \
+-	 --PETSC_ARCH="$ISSM_ARCH" \
+-	 --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+-	 --with-debugging=0 \
+-	 --with-shared-libraries=0 \
+-	 --with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+-	 --with-mpi-lib=/nasa/sgi/mpt/2.04/lib/libmpi.so \
+-	 --with-mpi-include=/nasa/sgi/mpt/2.04/include  \
+-	 --known-mpi-shared-libraries=1 \
+-	 --download-mumps=yes \
+-	 --download-scalapack=yes \
+-	 --download-blacs=yes  \
+-	 --download-blas=yes \
+-	 --with-f-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/src/$ISSM_ARCH \
+-	 --download-parmetis=yes \
+-	 --download-metis=yes \
+-	 --with-cxx=icpc \
+-	 --download-hypre=yes \
+-	 --download-trilinos=yes \
+-	 --download-prometheus=yes \
+-	 --download-euclid=yes \
+-	 --download-pastix=yes \
+-	 --download-ptscotch=yes \
+-	 --download-spooles=yes \
+-	 --download-superlu=http://crd.lbl.gov/~xiaoye/SuperLU/superlu_4.3.tar.gz \
+-	 --with-spai-dir=$ISSM_DIR/externalpackages/petsc/src/$ISSM_ARCH \
+-	 --with-plapack-dir=$ISSM_DIR/externalpackages/petsc/src/$ISSM_ARCH \
+-	 --FFLAGS=-I/usr/include \
+-	 --with-cc=icc \
+-	 --with-fc=ifort \
+-	 --COPTFLAGS=" -O3 -xS" \
+-	 --FOPTFLAGS=" -O3 -xS" \
+-	 --CXXOPTFLAGS=" -O3 -xS" \
+-	 --with-pic=1
+-	 cat > script.queue << EOF
++		cat > script.queue << EOF
+ #PBS -S /bin/bash
+ #PBS -q debug 
+ #PBS -l select=1:ncpus=1:model=har 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13107-13108.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13107-13108.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13107-13108.diff	(revision 13394)
@@ -0,0 +1,359 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py	(revision 13107)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py	(revision 13108)
+@@ -22,11 +22,11 @@
+ field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
+ 	1e-13,1e-13,1e-13]
+ field_values=[\
+-	[md.results.DiagnosticSolution.Vx],\
+-	[md.results.DiagnosticSolution.Vy],\
+-	[md.results.DiagnosticSolution.Vel],\
+-	[md.results.DiagnosticSolution.Pressure],\
+-	[md.results.DiagnosticSolution.StressTensorxx],\
+-	[md.results.DiagnosticSolution.StressTensoryy],\
+-	[md.results.DiagnosticSolution.StressTensorxy],\
++	md.results['DiagnosticSolution'][1]['Vx'],\
++	md.results['DiagnosticSolution'][1]['Vy'],\
++	md.results['DiagnosticSolution'][1]['Vel'],\
++	md.results['DiagnosticSolution'][1]['Pressure'],\
++	md.results['DiagnosticSolution'][1]['StressTensorxx'],\
++	md.results['DiagnosticSolution'][1]['StressTensoryy'],\
++	md.results['DiagnosticSolution'][1]['StressTensorxy'],\
+ 	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py	(revision 13107)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py	(revision 13108)
+@@ -141,17 +141,19 @@
+ 			archive_name='Archive'+str(id)
+ 			if strcmpi(procedure,'update'):
+ 
+-				if not strcmp(socket.gethostname().lower().split('.')[0],'larsen'):
+-#					raise RuntimeError("Nightly run archives must be saved on 'larsen' (hostname is '"+socket.gethostname()+"').")
+-					print "Nightly run archives must be saved on 'larsen' (hostname is '"+socket.gethostname()+"')."
+-#				f = h5py.File(os.path.join('..','Archives',archive_name+'.hdf5'),'w')
+-				f = netCDF4.Dataset(os.path.join('..','Archives',archive_name+'.nc'),'w')
++				os.remove(os.path.join('..','Archives',archive_name+'.nc'))
++				f = netCDF4.Dataset(os.path.join('..','Archives',archive_name+'.nc'),'w',format='NETCDF3_CLASSIC')
+ 				for k,fieldname in enumerate(field_names):
+ 					field=numpy.array(field_values[k],dtype=float)
+-#					f.create_dataset(archive_name+'_field'+str(k),data=field)
+-					f.createDimension(archive_name+'_field'+str(k)+'_0',numpy.size(field,0))
+-					f.createDimension(archive_name+'_field'+str(k)+'_1',numpy.size(field,1))
+-					v = f.createVariable(archive_name+'_field'+str(k),'f8',(archive_name+'_field'+str(k)+'_0',archive_name+'_field'+str(k)+'_1'))
++					if len(field.shape) == 1:
++						if numpy.size(field):
++							field=field.reshape(numpy.size(field),1)
++						else:
++							field=field.reshape(0,0)
++					# Matlab uses base 1, so use base 1 in labels
++					f.createDimension(archive_name+'_field'+str(k+1)+'_1',numpy.size(field,0))
++					f.createDimension(archive_name+'_field'+str(k+1)+'_2',numpy.size(field,1))
++					v = f.createVariable(archive_name+'_field'+str(k+1),field.dtype,(archive_name+'_field'+str(k+1)+'_1',archive_name+'_field'+str(k+1)+'_2'))
+ 					v[:] = field
+ 				f.close()
+ 				print "File '%s' saved.\n" % os.path.join('..','Archives',archive_name+'.nc')
+@@ -161,7 +163,6 @@
+ 
+ 				#load archive
+ 				if os.path.exists(os.path.join('..','Archives',archive_name+'.nc')):
+-#					f = h5py.File(os.path.join('..','Archives',archive_name+'.hdf5'),'r')
+ 					f = netCDF4.Dataset(os.path.join('..','Archives',archive_name+'.nc'),'r')
+ 				else:
+ 					raise IOError("Archive file '"+os.path.join('..','Archives',archive_name+'.nc')+"' does not exist.")
+@@ -170,25 +171,25 @@
+ 
+ 					try:
+ 						#Get field and tolerance
+-						field=numpy.array(field_values[k],dtype=float)
+-#						print 'field =',field
++						field=numpy.array(field_values[k])
++						if len(field.shape) == 1:
++							if numpy.size(field):
++								field=field.reshape(numpy.size(field),1)
++							else:
++								field=field.reshape(0,0)
+ 						tolerance=field_tolerances[k]
+-#						print 'tolerance =',tolerance
+ 
+ 						#compare to archive
+-#						if archive_name+'_field'+str(k) in f:
+-#							archive=f[archive_name+'_field'+str(k)][...]
+-						if archive_name+'_field'+str(k) in f.variables:
+-							archive=f.variables[archive_name+'_field'+str(k)][:]
++						# Matlab uses base 1, so use base 1 in labels
++						if archive_name+'_field'+str(k+1) in f.variables:
++							archive=f.variables[archive_name+'_field'+str(k+1)][:]
+ 						else:
+-							raise NameError("Field name '"+archive_name+'_field'+str(k)+"' does not exist in archive file.")
+-#						print 'archive =',archive
+-						error_diff=numpy.amax(numpy.abs(archive-field),axis=1)/ \
+-								   (numpy.amax(numpy.abs(archive),axis=1)+sys.float_info.epsilon)
+-#						print 'error_diff =',error_diff
++							raise NameError("Field name '"+archive_name+'_field'+str(k+1)+"' does not exist in archive file.")
++						error_diff=numpy.amax(numpy.abs(archive-field),axis=0)/ \
++								   (numpy.amax(numpy.abs(archive),axis=0)+sys.float_info.epsilon)
+ 
+ 						#disp test result
+-						if (error_diff>tolerance):
++						if (numpy.any(error_diff>tolerance)):
+ 							print 'ERROR   difference: %-7.2g > %7.2g test id: %i test name: %s field: %s' % \
+ 								(error_diff,tolerance,id,id_string,fieldname)
+ 						else:
+@@ -201,13 +202,13 @@
+ 						directory=os.getcwd().split('/')    #  not used?
+ 						message=me2
+ 						if   strcmpi(output,'nightly'):
+-							fid=open(os.path.join(ISSM_DIR,'nightlylog','matlaberror.log'), 'a')
++							fid=open(os.path.join(ISSM_DIR,'nightlylog','pythonerror.log'), 'a')
+ 							fid.write('%s' % message)
+ 							fid.write('\n------------------------------------------------------------------\n')
+ 							fid.close()
+ 							print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,fieldname)
+ 						elif strcmpi(output,'daily'):
+-							fid=open(os.path.join(ISSM_DIR,'dailylog','matlaberror.log'), 'a')
++							fid=open(os.path.join(ISSM_DIR,'dailylog','pythonerror.log'), 'a')
+ 							fid.write('%s' % message)
+ 							fid.write('\n------------------------------------------------------------------\n')
+ 							fid.close()
+@@ -224,13 +225,13 @@
+ 			directory=os.getcwd().split('/')    #  not used?
+ 			message=me
+ 			if   strcmpi(output,'nightly'):
+-				fid=open(os.path.join(ISSM_DIR+'nightlylog','matlaberror.log'), 'a')
++				fid=open(os.path.join(ISSM_DIR+'nightlylog','pythonerror.log'), 'a')
+ 				fid.write('%s' % message)
+ 				fid.write('\n------------------------------------------------------------------\n')
+ 				fid.close()
+ 				print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,'N/A')
+ 			elif strcmpi(output,'daily'):
+-				fid=open(os.path.join(ISSM_DIR+'dailylog','matlaberror.log'), 'a')
++				fid=open(os.path.join(ISSM_DIR+'dailylog','pythonerror.log'), 'a')
+ 				fid.write('%s' % message)
+ 				fid.write('\n------------------------------------------------------------------\n')
+ 				fid.close()
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme2.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme2.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme2.m	(revision 13108)
+@@ -0,0 +1,213 @@
++function varargout=runme(varargin)
++%RUNME - test deck for ISSM nightly runs
++%
++%   In a test deck directory (tests/Vertification/NightlyRun for example)
++%   The following command will launch all the existing tests:
++%   >> runme
++%   To run the tests 101 and 102:
++%   >> runme('id',[101 102])
++%   etc...
++%
++%   Available options:
++%      'id'            followed by the list of ids requested
++%      'exclude'       ids to be excluded from the test
++%      'benchmark'     'nightly' (nightly run/ daily run)
++%                      'ismip'  : validation of ismip-hom tests
++%                      'eismint': validation of eismint tests
++%                      'thermal': validation of thermal tests
++%                      'mesh'   : validation of mesh tests
++%                      ...
++%      'procedure'     'check' : run the test (default)
++%                      'update': update the archive
++%                      'model' : prepare the model but no test is run
++%
++%   Usage:
++%      md=runme(varargin);
++%
++%   Examples:
++%      runme;
++%      runme('exclude',101);
++%      md=runme('id',102,'procedure','model');
++
++%Get ISSM_DIR variable
++ISSM_DIR=issmdir();
++
++%Check inputs
++% {{{1
++if nargout>1
++	help runme
++	error('runme error message: bad usage');
++end
++
++%recover options
++options=pairoptions(varargin{:});
++% }}}
++
++%Process options
++%GET benchmark {{{1
++benchmark=getfieldvalue(options,'benchmark','nightly');
++if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing'})
++	disp('runme warning: benchmark not supported, defaulting to test ''nightly''')
++	benchmark='nightly';
++end
++% }}}
++%GET procedure {{{1
++procedure=getfieldvalue(options,'procedure','check');
++if ~ismember(procedure,{'check','update'})
++	disp('runme warning: procedure not supported, defaulting to test ''check''')
++	procedure='check';
++end
++% }}}
++%GET output {{{1
++output=getfieldvalue(options,'output','none');
++if ~ismember(output,{'nightly','daily','none'})
++	disp('runme warning: output not supported, defaulting to test ''none''')
++	output='none';
++end
++% }}}
++%GET RANK and NUMPROCS for mutlithreaded runs  {{{1
++rank=getfieldvalue(options,'rank',1);
++numprocs=getfieldvalue(options,'numprocs',1);
++if (numprocs<rank), numprocs=1; end
++% }}}
++%GET ids  {{{1
++flist=dir;%use dir, as it seems to act OS independent
++list_ids=[];
++for i=1:numel(flist),
++	if ( strncmp(flist(i).name,'test',4) &...                         %File name must start with 'test'
++			strncmp(fliplr(flist(i).name),fliplr('.m'),2)&...           %File name must end by '.m'
++			~strcmp(flist(i).name,'test.m'))                            %File name must be different than 'test.m'
++		list_ids(end+1)=eval(flist(i).name(5:end-2));                  %Keep test id only (skip 'test' and '.m')
++	end
++end
++[i1,i2]=parallelrange(rank,numprocs,length(list_ids));               %Get tests for this cpu only
++list_ids=list_ids(i1:i2);
++
++test_ids=getfieldvalue(options,'id',list_ids);
++test_ids=intersect(test_ids,list_ids);
++% }}}
++%GET exclude {{{1
++exclude_ids=getfieldvalue(options,'exclude',[]);
++exclude_ids=[exclude_ids];
++pos=find(ismember(test_ids,exclude_ids));
++test_ids(pos)=[];
++% }}}
++%Process Ids according to benchmarks{{{1
++if strcmpi(benchmark,'nightly'),
++	test_ids=intersect(test_ids,[1:999]);
++elseif strcmpi(benchmark,'ismip'),
++	test_ids=intersect(test_ids,[1101:1199]);
++elseif strcmpi(benchmark,'eismint'),
++	test_ids=intersect(test_ids,[1201:1299]);
++elseif strcmpi(benchmark,'thermal'),
++	test_ids=intersect(test_ids,[1301:1399]);
++elseif strcmpi(benchmark,'mesh'),
++	test_ids=intersect(test_ids,[1401:1499]);
++elseif strcmpi(benchmark,'validation'),
++	test_ids=intersect(test_ids,[1001:1999]);
++elseif strcmpi(benchmark,'tranforcing'),
++	test_ids=intersect(test_ids,[1501:1502]);
++end
++% }}}
++
++%Loop over tests and launch sequence
++root=pwd;
++for id=test_ids,
++	try,
++
++		%Execute test
++		eval(['cd ' root ]);
++		id_string=IdToName(id);
++		eval(['test' num2str(id)]);
++
++		%UPDATE ARCHIVE?
++		archive_name=['Archive' num2str(id) ];
++		if strcmpi(procedure,'update'),
++			delete(['../Archives/' archive_name '.nc'])
++			for k=1:length(field_names),
++				field=field_values{k};
++				% matlab writes the dimensions reversed and matrices transposed into netcdf, so compensate for that
++				nccreate(['../Archives/' archive_name '.nc'],[archive_name '_field' num2str(k)],...
++				         'Dimensions',{[archive_name '_field' num2str(k) '_2'] size(field,2) [archive_name '_field' num2str(k) '_1'] size(field,1)},...
++				         'Format','classic');
++				ncwrite(['../Archives/' archive_name '.nc'],[archive_name '_field' num2str(k)],transpose(field));
++			end
++			disp(sprintf(['File ./../Archives/' archive_name '.nc saved\n']));
++
++		%ELSE: CHECK TEST
++		else,
++			for k=1:length(field_names),
++
++				try,
++					%Get field and tolerance
++					field=field_values{k};
++					fieldname=field_names{k};
++					tolerance=field_tolerances{k};
++
++					%compare to archive
++					% matlab reads the dimensions reversed and matrices transposed from netcdf, so compensate for that
++					archive=transpose(ncread(['../Archives/' archive_name '.nc'],[archive_name '_field' num2str(k)]));
++					error_diff=full(max(abs(archive(:)-field(:)))/(max(abs(archive))+eps));
++
++					%disp test result
++					if (error_diff>tolerance);
++						disp(sprintf(['ERROR   difference: %-7.2g > %7.2g test id: %i test name: %s field: %s'],...
++							error_diff,tolerance,id,id_string,fieldname));
++					else
++						disp(sprintf(['SUCCESS difference: %-7.2g < %7.2g test id: %i test name: %s field: %s'],...
++							error_diff,tolerance,id,id_string,fieldname));
++					end
++
++				catch me2
++
++					%something went wrong, print failure message:
++					directory=strsplit(pwd,'/');
++					message=getReport(me2);
++					if strcmpi(output,'nightly')
++						fid=fopen([ISSM_DIR '/nightlylog/matlaberror.log'], 'at');
++						fprintf(fid,'%s',message);
++						fprintf(fid,'\n------------------------------------------------------------------\n');
++						fclose(fid);
++						disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname));
++					elseif strcmpi(output,'daily');
++						fid=fopen([ISSM_DIR '/dailylog/matlaberror.log'], 'at');
++						fprintf(fid,'%s',message);
++						fprintf(fid,'\n------------------------------------------------------------------\n');
++						fclose(fid);
++						disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname));
++					else
++						disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname));
++						rethrow(me2);
++					end
++				end
++			end
++		end
++
++	catch me,
++
++		%something went wrong, print failure message:
++		directory=strsplit(pwd,'/');
++		message=getReport(me);
++		if strcmpi(output,'nightly')
++			fid=fopen([ISSM_DIR '/nightlylog/matlaberror.log'], 'at');
++			fprintf(fid,'%s',message);
++			fprintf(fid,'\n------------------------------------------------------------------\n');
++			fclose(fid);
++			disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A'));
++		elseif strcmpi(output,'daily');
++			fid=fopen([ISSM_DIR '/dailylog/matlaberror.log'], 'at');
++			fprintf(fid,'%s',message);
++			fprintf(fid,'\n------------------------------------------------------------------\n');
++			fclose(fid);
++			disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A'));
++		else
++			disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A'));
++			rethrow(me);
++		end
++	end
++end
++
++%output md if requested
++if nargout==1
++	varargout{1}=md;
++end
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme2.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13108-13109.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13108-13109.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13108-13109.diff	(revision 13394)
@@ -0,0 +1,263 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme2.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme2.m	(revision 13108)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme2.m	(revision 13109)
+@@ -1,213 +0,0 @@
+-function varargout=runme(varargin)
+-%RUNME - test deck for ISSM nightly runs
+-%
+-%   In a test deck directory (tests/Vertification/NightlyRun for example)
+-%   The following command will launch all the existing tests:
+-%   >> runme
+-%   To run the tests 101 and 102:
+-%   >> runme('id',[101 102])
+-%   etc...
+-%
+-%   Available options:
+-%      'id'            followed by the list of ids requested
+-%      'exclude'       ids to be excluded from the test
+-%      'benchmark'     'nightly' (nightly run/ daily run)
+-%                      'ismip'  : validation of ismip-hom tests
+-%                      'eismint': validation of eismint tests
+-%                      'thermal': validation of thermal tests
+-%                      'mesh'   : validation of mesh tests
+-%                      ...
+-%      'procedure'     'check' : run the test (default)
+-%                      'update': update the archive
+-%                      'model' : prepare the model but no test is run
+-%
+-%   Usage:
+-%      md=runme(varargin);
+-%
+-%   Examples:
+-%      runme;
+-%      runme('exclude',101);
+-%      md=runme('id',102,'procedure','model');
+-
+-%Get ISSM_DIR variable
+-ISSM_DIR=issmdir();
+-
+-%Check inputs
+-% {{{1
+-if nargout>1
+-	help runme
+-	error('runme error message: bad usage');
+-end
+-
+-%recover options
+-options=pairoptions(varargin{:});
+-% }}}
+-
+-%Process options
+-%GET benchmark {{{1
+-benchmark=getfieldvalue(options,'benchmark','nightly');
+-if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing'})
+-	disp('runme warning: benchmark not supported, defaulting to test ''nightly''')
+-	benchmark='nightly';
+-end
+-% }}}
+-%GET procedure {{{1
+-procedure=getfieldvalue(options,'procedure','check');
+-if ~ismember(procedure,{'check','update'})
+-	disp('runme warning: procedure not supported, defaulting to test ''check''')
+-	procedure='check';
+-end
+-% }}}
+-%GET output {{{1
+-output=getfieldvalue(options,'output','none');
+-if ~ismember(output,{'nightly','daily','none'})
+-	disp('runme warning: output not supported, defaulting to test ''none''')
+-	output='none';
+-end
+-% }}}
+-%GET RANK and NUMPROCS for mutlithreaded runs  {{{1
+-rank=getfieldvalue(options,'rank',1);
+-numprocs=getfieldvalue(options,'numprocs',1);
+-if (numprocs<rank), numprocs=1; end
+-% }}}
+-%GET ids  {{{1
+-flist=dir;%use dir, as it seems to act OS independent
+-list_ids=[];
+-for i=1:numel(flist),
+-	if ( strncmp(flist(i).name,'test',4) &...                         %File name must start with 'test'
+-			strncmp(fliplr(flist(i).name),fliplr('.m'),2)&...           %File name must end by '.m'
+-			~strcmp(flist(i).name,'test.m'))                            %File name must be different than 'test.m'
+-		list_ids(end+1)=eval(flist(i).name(5:end-2));                  %Keep test id only (skip 'test' and '.m')
+-	end
+-end
+-[i1,i2]=parallelrange(rank,numprocs,length(list_ids));               %Get tests for this cpu only
+-list_ids=list_ids(i1:i2);
+-
+-test_ids=getfieldvalue(options,'id',list_ids);
+-test_ids=intersect(test_ids,list_ids);
+-% }}}
+-%GET exclude {{{1
+-exclude_ids=getfieldvalue(options,'exclude',[]);
+-exclude_ids=[exclude_ids];
+-pos=find(ismember(test_ids,exclude_ids));
+-test_ids(pos)=[];
+-% }}}
+-%Process Ids according to benchmarks{{{1
+-if strcmpi(benchmark,'nightly'),
+-	test_ids=intersect(test_ids,[1:999]);
+-elseif strcmpi(benchmark,'ismip'),
+-	test_ids=intersect(test_ids,[1101:1199]);
+-elseif strcmpi(benchmark,'eismint'),
+-	test_ids=intersect(test_ids,[1201:1299]);
+-elseif strcmpi(benchmark,'thermal'),
+-	test_ids=intersect(test_ids,[1301:1399]);
+-elseif strcmpi(benchmark,'mesh'),
+-	test_ids=intersect(test_ids,[1401:1499]);
+-elseif strcmpi(benchmark,'validation'),
+-	test_ids=intersect(test_ids,[1001:1999]);
+-elseif strcmpi(benchmark,'tranforcing'),
+-	test_ids=intersect(test_ids,[1501:1502]);
+-end
+-% }}}
+-
+-%Loop over tests and launch sequence
+-root=pwd;
+-for id=test_ids,
+-	try,
+-
+-		%Execute test
+-		eval(['cd ' root ]);
+-		id_string=IdToName(id);
+-		eval(['test' num2str(id)]);
+-
+-		%UPDATE ARCHIVE?
+-		archive_name=['Archive' num2str(id) ];
+-		if strcmpi(procedure,'update'),
+-			delete(['../Archives/' archive_name '.nc'])
+-			for k=1:length(field_names),
+-				field=field_values{k};
+-				% matlab writes the dimensions reversed and matrices transposed into netcdf, so compensate for that
+-				nccreate(['../Archives/' archive_name '.nc'],[archive_name '_field' num2str(k)],...
+-				         'Dimensions',{[archive_name '_field' num2str(k) '_2'] size(field,2) [archive_name '_field' num2str(k) '_1'] size(field,1)},...
+-				         'Format','classic');
+-				ncwrite(['../Archives/' archive_name '.nc'],[archive_name '_field' num2str(k)],transpose(field));
+-			end
+-			disp(sprintf(['File ./../Archives/' archive_name '.nc saved\n']));
+-
+-		%ELSE: CHECK TEST
+-		else,
+-			for k=1:length(field_names),
+-
+-				try,
+-					%Get field and tolerance
+-					field=field_values{k};
+-					fieldname=field_names{k};
+-					tolerance=field_tolerances{k};
+-
+-					%compare to archive
+-					% matlab reads the dimensions reversed and matrices transposed from netcdf, so compensate for that
+-					archive=transpose(ncread(['../Archives/' archive_name '.nc'],[archive_name '_field' num2str(k)]));
+-					error_diff=full(max(abs(archive(:)-field(:)))/(max(abs(archive))+eps));
+-
+-					%disp test result
+-					if (error_diff>tolerance);
+-						disp(sprintf(['ERROR   difference: %-7.2g > %7.2g test id: %i test name: %s field: %s'],...
+-							error_diff,tolerance,id,id_string,fieldname));
+-					else
+-						disp(sprintf(['SUCCESS difference: %-7.2g < %7.2g test id: %i test name: %s field: %s'],...
+-							error_diff,tolerance,id,id_string,fieldname));
+-					end
+-
+-				catch me2
+-
+-					%something went wrong, print failure message:
+-					directory=strsplit(pwd,'/');
+-					message=getReport(me2);
+-					if strcmpi(output,'nightly')
+-						fid=fopen([ISSM_DIR '/nightlylog/matlaberror.log'], 'at');
+-						fprintf(fid,'%s',message);
+-						fprintf(fid,'\n------------------------------------------------------------------\n');
+-						fclose(fid);
+-						disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname));
+-					elseif strcmpi(output,'daily');
+-						fid=fopen([ISSM_DIR '/dailylog/matlaberror.log'], 'at');
+-						fprintf(fid,'%s',message);
+-						fprintf(fid,'\n------------------------------------------------------------------\n');
+-						fclose(fid);
+-						disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname));
+-					else
+-						disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname));
+-						rethrow(me2);
+-					end
+-				end
+-			end
+-		end
+-
+-	catch me,
+-
+-		%something went wrong, print failure message:
+-		directory=strsplit(pwd,'/');
+-		message=getReport(me);
+-		if strcmpi(output,'nightly')
+-			fid=fopen([ISSM_DIR '/nightlylog/matlaberror.log'], 'at');
+-			fprintf(fid,'%s',message);
+-			fprintf(fid,'\n------------------------------------------------------------------\n');
+-			fclose(fid);
+-			disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A'));
+-		elseif strcmpi(output,'daily');
+-			fid=fopen([ISSM_DIR '/dailylog/matlaberror.log'], 'at');
+-			fprintf(fid,'%s',message);
+-			fprintf(fid,'\n------------------------------------------------------------------\n');
+-			fclose(fid);
+-			disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A'));
+-		else
+-			disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A'));
+-			rethrow(me);
+-		end
+-	end
+-end
+-
+-%output md if requested
+-if nargout==1
+-	varargout{1}=md;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m	(revision 13108)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m	(revision 13109)
+@@ -123,23 +123,19 @@
+ 		%UPDATE ARCHIVE?
+ 		archive_name=['Archive' num2str(id) ];
+ 		if strcmpi(procedure,'update'),
+-
+-			if ~strcmp(oshostname(),'larsen');
+-				error(['Nightly run archives must be saved on "larsen" (hostname is "' oshostname() '")']);
+-			end
++			delete(['../Archives/' archive_name '.nc'])
+ 			for k=1:length(field_names),
+ 				field=field_values{k};
+-				eval([ archive_name '_field' num2str(k) ' =  field ;']);
++				% matlab writes the dimensions reversed and matrices transposed into netcdf, so compensate for that
++				nccreate(['../Archives/' archive_name '.nc'],[archive_name '_field' num2str(k)],...
++				         'Dimensions',{[archive_name '_field' num2str(k) '_2'] size(field,2) [archive_name '_field' num2str(k) '_1'] size(field,1)},...
++				         'Format','classic');
++				ncwrite(['../Archives/' archive_name '.nc'],[archive_name '_field' num2str(k)],transpose(field));
+ 			end
+-			eval(['save ../Archives/' archive_name ' ' archive_name '_field*']);
+-			disp(sprintf(['File ./../Archives/' archive_name ' saved\n']));
++			disp(sprintf(['File ./../Archives/' archive_name '.nc saved\n']));
+ 
+ 		%ELSE: CHECK TEST
+ 		else,
+-
+-			%load archive
+-			load(['../Archives/' archive_name ]);
+-
+ 			for k=1:length(field_names),
+ 
+ 				try,
+@@ -149,7 +145,8 @@
+ 					tolerance=field_tolerances{k};
+ 
+ 					%compare to archive
+-					eval(['archive=' archive_name '_field' num2str(k) ';']);
++					% matlab reads the dimensions reversed and matrices transposed from netcdf, so compensate for that
++					archive=transpose(ncread(['../Archives/' archive_name '.nc'],[archive_name '_field' num2str(k)]));
+ 					error_diff=full(max(abs(archive(:)-field(:)))/(max(abs(archive))+eps));
+ 
+ 					%disp test result
Index: /issm/oecreview/Archive/12678-13393/ISSM-13109-13110.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13109-13110.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13109-13110.diff	(revision 13394)
@@ -0,0 +1,2086 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive111.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive111.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive111.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive111.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive111.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive501.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive501.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive501.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive501.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive501.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive420.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive420.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive420.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive420.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive420.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive232.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive232.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive232.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive232.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive232.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive313.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive313.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive313.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive313.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive313.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive206.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive206.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive206.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive206.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive206.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive515.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive515.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive515.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive515.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive515.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive408.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive408.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive408.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive408.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive408.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive327.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive327.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive327.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive327.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive327.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive201.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive201.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive201.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive201.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive201.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive120.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive120.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive120.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive120.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive120.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive510.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive510.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive510.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive510.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive510.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive322.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive322.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive322.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive322.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive322.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive403.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive403.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive403.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive403.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive403.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive215.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive215.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive215.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive215.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive215.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive108.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive108.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive108.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive108.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive108.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive605.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive605.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive605.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive605.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive605.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive417.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive417.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive417.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive417.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive417.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive229.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive229.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive229.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive229.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive229.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive210.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive210.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive210.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive210.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive210.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive103.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive103.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive103.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive103.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive103.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive412.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive412.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive412.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive412.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive412.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive224.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive224.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive224.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive224.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive224.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive305.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive305.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive305.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive305.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive305.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive117.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive117.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive117.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive117.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive117.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive507.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive507.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive507.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive507.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive507.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive426.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive426.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive426.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive426.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive426.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive319.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive319.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive319.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive319.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive319.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive112.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive112.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive112.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive112.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive112.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive421.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive421.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive421.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive421.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive421.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive502.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive502.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive502.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive502.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive502.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive314.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive314.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive314.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive314.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive314.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive233.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive233.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive233.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive233.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive233.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive207.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive207.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive207.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive207.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive207.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive516.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive516.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive516.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive516.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive516.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive409.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive409.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive409.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive409.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive409.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive328.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive328.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive328.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive328.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive328.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive121.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive121.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive121.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive121.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive121.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive202.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive202.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive202.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive202.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive202.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive430.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive430.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive430.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive430.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive430.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive511.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive511.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive511.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive511.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive511.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive404.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive404.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive404.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive404.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive404.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive323.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive323.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive323.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive323.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive323.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive216.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive216.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive216.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive216.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive216.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive109.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive109.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive109.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive109.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive109.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive606.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive606.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive606.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive606.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive606.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive418.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive418.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive418.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive418.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive418.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive211.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive211.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive211.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive211.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive211.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive104.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive104.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive104.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive104.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive104.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive601.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive601.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive601.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive601.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive601.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive413.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive413.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive413.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive413.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive413.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive306.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive306.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive306.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive306.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive306.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive225.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive225.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive225.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive225.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive225.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive118.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive118.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive118.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive118.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive118.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive427.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive427.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive427.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive427.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive427.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive508.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive508.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive508.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive508.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive508.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive220.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive220.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive220.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive220.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive220.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive301.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive301.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive301.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive301.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive301.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive113.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive113.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive113.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive113.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive113.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive610.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive610.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive610.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive610.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive610.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive503.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive503.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive503.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive503.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive503.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive422.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive422.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive422.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive422.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive422.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive234.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive234.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive234.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive234.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive234.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive315.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive315.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive315.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive315.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive315.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive208.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive208.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive208.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive208.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive208.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive329.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive329.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive329.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive329.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive329.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive310.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive310.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive310.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive310.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive310.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive203.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive203.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive203.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive203.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive203.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive122.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive122.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive122.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive122.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive122.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive512.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive512.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive512.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive512.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive512.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive431.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive431.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive431.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive431.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive431.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive324.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive324.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive324.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive324.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive324.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive405.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive405.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive405.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive405.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive405.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive217.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive217.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive217.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive217.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive217.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive607.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive607.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive607.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive607.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive607.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive419.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive419.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive419.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive419.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive419.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive212.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive212.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive212.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive212.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive212.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive105.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive105.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive105.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive105.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive105.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive602.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive602.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive602.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive602.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive602.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive414.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive414.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive414.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive414.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive414.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive226.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive226.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive226.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive226.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive226.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive307.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive307.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive307.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive307.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive307.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive119.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive119.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive119.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive119.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive119.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive509.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive509.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive509.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive509.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive509.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive428.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive428.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive428.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive428.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive428.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive221.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive221.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive221.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive221.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive221.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive302.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive302.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive302.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive302.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive302.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive114.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive114.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive114.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive114.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive114.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive611.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive611.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive611.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive611.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive611.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive504.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive504.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive504.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive504.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive504.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive423.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive423.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive423.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive423.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive423.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive235.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive235.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive235.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive235.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive235.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive316.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive316.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive316.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive316.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive316.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive209.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive209.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive209.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive209.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive209.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive230.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive230.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive230.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive230.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive230.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive311.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive311.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive311.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive311.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive311.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive204.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive204.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive204.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive204.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive204.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive513.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive513.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive513.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive513.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive513.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive432.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive432.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive432.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive432.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive432.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive325.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive325.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive325.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive325.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive325.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive406.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive406.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive406.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive406.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive406.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive218.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive218.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive218.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive218.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive218.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive608.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive608.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive608.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive608.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive608.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive320.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive320.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive320.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive320.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive320.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive401.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive401.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive401.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive401.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive401.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive213.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive213.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive213.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive213.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive213.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive106.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive106.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive106.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive106.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive106.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive603.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive603.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive603.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive603.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive603.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive415.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive415.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive415.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive415.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive415.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive227.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive227.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive227.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive227.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive227.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive308.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive308.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive308.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive308.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive308.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive429.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive429.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive429.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive429.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive429.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive101.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive101.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive101.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive101.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive101.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive410.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive410.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive410.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive410.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive410.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive303.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive303.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive303.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive303.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive303.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive222.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive222.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive222.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive222.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive222.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive115.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive115.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive115.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive115.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive115.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive612.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive612.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive612.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive612.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive612.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive424.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive424.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive424.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive424.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive424.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive505.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive505.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive505.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive505.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive505.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive317.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive317.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive317.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive317.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive317.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive110.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive110.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive110.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive110.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive110.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive312.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive312.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive312.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive312.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive312.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive205.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive205.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive205.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive205.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive205.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive514.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive514.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive514.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive514.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive514.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive407.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive407.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive407.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive407.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive407.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive326.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive326.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive326.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive326.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive326.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive219.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive219.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive219.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive219.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive219.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive609.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive609.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive609.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive609.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive609.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive402.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive402.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive402.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive402.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive402.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive321.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive321.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive321.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive321.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive321.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive214.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive214.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive214.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive214.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive214.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive107.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive107.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive107.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive107.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive107.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive604.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive604.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive604.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive604.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive604.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive416.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive416.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive416.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive416.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive416.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive309.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive309.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive309.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive309.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive309.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive228.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive228.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive228.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive228.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive228.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive102.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive102.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive102.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive102.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive102.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive411.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive411.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive411.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive411.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive411.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive304.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive304.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive304.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive304.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive304.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive223.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive223.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive223.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive223.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive223.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive116.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive116.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive116.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive116.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive116.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive613.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive613.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive613.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive613.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive613.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive425.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive425.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive425.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive425.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive425.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive506.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive506.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive506.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive506.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive506.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive318.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive318.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive318.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive318.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive318.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.nc	(revision 13109)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.nc	(revision 13110)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-13112-13113.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13112-13113.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13112-13113.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13112)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13113)
+@@ -188,7 +188,7 @@
+ 
+ Kriging_la_SOURCES = ../Kriging/Kriging.cpp\
+ 						../Kriging/Kriging.h
+-Kriging_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
++Kriging_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB) $(MULTITHREADINGLIB)
+ 
+ MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\
+ 			  ../MeshPartition/MeshPartition.h
Index: /issm/oecreview/Archive/12678-13393/ISSM-13113-13114.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13113-13114.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13113-13114.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-helene.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-helene.sh	(revision 13113)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-helene.sh	(revision 13114)
+@@ -20,6 +20,7 @@
+ 	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ 	--with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
++	--with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
+ 	--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 "\
Index: /issm/oecreview/Archive/12678-13393/ISSM-13114-13115.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13114-13115.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13114-13115.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13114)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13115)
+@@ -192,7 +192,7 @@
+ 
+ MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\
+ 			  ../MeshPartition/MeshPartition.h
+-MeshPartition_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++MeshPartition_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(METISLIB)
+ 
+ MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
+ 			  ../MeshProfileIntersection/MeshProfileIntersection.h
Index: /issm/oecreview/Archive/12678-13393/ISSM-13115-13116.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13115-13116.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13115-13116.diff	(revision 13394)
@@ -0,0 +1,363 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 13116)
+@@ -1,5 +1,6 @@
+ import struct
+ import numpy
++from collections import OrderedDict
+ from MatlabFuncs import *
+ from MatlabProcessPatch import *
+ 
+@@ -35,14 +36,14 @@
+ 	except IOError as e:
+ 		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
+ 
+-	results={}
++	results=OrderedDict()
+ 
+ 	#Read fields until the end of the file.
+ 	result=ReadData(fid)
+ 	while result:
+ 		#Get time and step
+ 		if result['step'] not in results:
+-			results[result['step']]={}
++			results[result['step']]=OrderedDict()
+ 			results[result['step']]['step']=result['step']
+ 			results[result['step']]['time']=result['time'] 
+ 	
+@@ -76,7 +77,7 @@
+ 	except IOError as e:
+ 		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
+ 
+-	results={}
++	results=OrderedDict()
+ 
+ 	#if we have done split I/O, ie, we have results that are fragmented across patches, 
+ 	#do a first pass, and figure out the structure of results
+@@ -85,7 +86,7 @@
+ 
+ 		#Get time and step
+ 		if result['step'] not in results:
+-			results[result['step']]={}
++			results[result['step']]=OrderedDict()
+ 			results[result['step']]['step']=result['step']
+ 			results[result['step']]['time']=result['time'] 
+ 
+@@ -124,7 +125,7 @@
+ 
+ 		#Get time and step
+ 		if result['step'] not in results:
+-			results[result['step']]={}
++			results[result['step']]=OrderedDict()
+ 			results[result['step']]['step']=result['step']
+ 			results[result['step']]['time']=result['time'] 
+ 
+@@ -179,14 +180,14 @@
+ 		else:
+ 			raise TypeError("cannot read data of type %d" % type)
+ 
+-		result={}
++		result=OrderedDict()
+ 		result['fieldname']=fieldname
+ 		result['time']=time
+ 		result['step']=step
+ 		result['field']=field
+ 
+ 	except struct.error as e:
+-		result={}
++		result=OrderedDict()
+ 
+ 	return result
+ 	# }}}
+@@ -220,7 +221,7 @@
+ 		else:
+ 			raise TypeError("cannot read data of type %d" % type)
+ 
+-		result={}
++		result=OrderedDict()
+ 		result['fieldname']=fieldname
+ 		result['time']=time
+ 		result['step']=step
+@@ -228,7 +229,7 @@
+ 		result['N']=N
+ 
+ 	except struct.error as e:
+-		result={}
++		result=OrderedDict()
+ 
+ 	return result
+ 	# }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13116)
+@@ -1,4 +1,5 @@
+ import os
++from collections import OrderedDict
+ from parseresultsfromdisk import *
+ from EnumToString import EnumToString
+ 
+@@ -22,7 +23,7 @@
+ 
+ 		#initialize md.results if not a structure yet
+ 		if not isinstance(md.results,dict):
+-			md.results={}
++			md.results=OrderedDict()
+ 
+ 		#load results onto model
+ 		structure=parseresultsfromdisk(filename,~md.settings.io_gather)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/process_solve_options.py	(revision 13116)
+@@ -1,4 +1,5 @@
+ import os
++from collections import OrderedDict
+ from EnumDefinitions import *
+ from EnumToString import EnumToString
+ 
+@@ -12,7 +13,7 @@
+ 	   See also: SOLVE
+ 	"""
+ 
+-	outoptions={}
++	outoptions=OrderedDict()
+ 
+ 	#solution_type: check on this option, error out otherwise
+ 	solution_type=options.getfieldvalue('solution_type')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/marshall.py	(revision 13116)
+@@ -27,7 +27,7 @@
+ 	fields=vars(md)
+ 
+ #	for field in fields.iterkeys():
+-	for field in ['mesh','mask','geometry','constants','surfaceforcings','basalforcings','materials','friction','flowequation','timestepping','initialization','rifts','debug','verbose','settings','solver','cluster','balancethickness','diagnostic','groundingline','hydrology','prognostic','thermal','steadystate','transient','autodiff','flaim','inversion','qmu','results','radaroverlay','miscellaneous','private']:
++	for field in md.properties():
+ 
+ 		#Some properties do not need to be marshalled
+ 		if field in ['results','radaroverlay','solver','cluster','flaim','private']:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/pairoptions.py	(revision 13116)
+@@ -1,3 +1,4 @@
++from collections import OrderedDict
+ from WriteData import *
+ 
+ class pairoptions(object):
+@@ -11,7 +12,7 @@
+ 
+ 	def __init__(self,*arg):
+ 		self.functionname = ''
+-		self.list         = {}
++		self.list         = OrderedDict()
+ 
+ 		#get calling function name
+ 		import inspect
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13116)
+@@ -85,6 +85,43 @@
+ 		self.private          = private()
+ 		#}}}
+ 
++	def properties(self):    # {{{
++		# ordered list of properties since vars(self) is random
++		return ['mesh',\
++		        'mask',\
++		        'geometry',\
++		        'constants',\
++		        'surfaceforcings',\
++		        'basalforcings',\
++		        'materials',\
++		        'friction',\
++		        'flowequation',\
++		        'timestepping',\
++		        'initialization',\
++		        'rifts',\
++		        'debug',\
++		        'verbose',\
++		        'settings',\
++		        'solver',\
++		        'cluster',\
++		        'balancethickness',\
++		        'diagnostic',\
++		        'groundingline',\
++		        'hydrology',\
++		        'prognostic',\
++		        'thermal',\
++		        'steadystate',\
++		        'transient',\
++		        'autodiff',\
++		        'flaim',\
++		        'inversion',\
++		        'qmu',\
++		        'results',\
++		        'radaroverlay',\
++		        'miscellaneous',\
++		        'private']
++	# }}}
++
+ 	def __repr__(obj):
+ 		# {{{ Display
+ 
+@@ -100,11 +137,11 @@
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flowequation","[%s,%s]" % ("1x1",obj.flowequation.__class__.__name__),"flow equations"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("timestepping","[%s,%s]" % ("1x1",obj.timestepping.__class__.__name__),"time stepping for transient models"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("initialization","[%s,%s]" % ("1x1",obj.initialization.__class__.__name__),"initial guess/state"))
+-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("rifts","[%s,%s]" % ("1x1",obj.rifts.__class__.__name__),"rifts properties'"))
++		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("rifts","[%s,%s]" % ("1x1",obj.rifts.__class__.__name__),"rifts properties"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("debug","[%s,%s]" % ("1x1",obj.debug.__class__.__name__),"debugging tools (valgrind, gprof"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("verbose","[%s,%s]" % ("1x1",obj.verbose.__class__.__name__),"verbosity level in solve"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("settings","[%s,%s]" % ("1x1",obj.settings.__class__.__name__),"settings properties"))
+-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("solver","[%s,%s]" % ("1x1",obj.solver.__class__.__name__),"PETSc options for each solution'"))
++		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("solver","[%s,%s]" % ("1x1",obj.solver.__class__.__name__),"PETSc options for each solution"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("cluster","[%s,%s]" % ("1x1",obj.cluster.__class__.__name__),"cluster parameters (number of cpus...)"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("balancethickness","[%s,%s]" % ("1x1",obj.balancethickness.__class__.__name__),"parameters for balancethickness solution"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("diagnostic","[%s,%s]" % ("1x1",obj.diagnostic.__class__.__name__),"parameters for diagnostic solution"))
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flaim.py	(revision 13116)
+@@ -1,5 +1,6 @@
+ #module imports
+ import numpy
++from collections import OrderedDict
+ from fielddisplay import fielddisplay
+ from EnumDefinitions import *
+ from checkfield import *
+@@ -18,7 +19,7 @@
+ 		# {{{ Properties
+ 		self.targets            = ''
+ 		self.tracks             = ''
+-		self.flightreqs         = {}
++		self.flightreqs         = OrderedDict()
+ 		self.criterion          = float('NaN')
+ 		self.gridsatequator     = 200000
+ 		self.usevalueordering   = True
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/qmu.py	(revision 13116)
+@@ -1,5 +1,6 @@
+ #module imports
+ import numpy
++from collections import OrderedDict
+ from fielddisplay import fielddisplay
+ from EnumDefinitions import *
+ from checkfield import *
+@@ -18,11 +19,11 @@
+ 	def __init__(self):
+ 		# {{{ Properties
+ 		self.isdakota                    = 0
+-		self.variables                   = {}
+-		self.responses                   = {}
+-		self.method                      = {}
+-		self.params                      = {}
+-		self.results                     = {}
++		self.variables                   = OrderedDict()
++		self.responses                   = OrderedDict()
++		self.method                      = OrderedDict()
++		self.params                      = OrderedDict()
++		self.results                     = OrderedDict()
+ 		self.partition                   = float('NaN')
+ 		self.numberofpartitions          = 0
+ 		self.numberofresponses           = 0
+@@ -71,7 +72,7 @@
+ 		s ='   qmu parameters:\n'
+ 
+ 		s+="%s\n" % fielddisplay(self,'isdakota','is qmu analysis activated?')
+-		for i,variable in enumerate(self.variables):
++		for i,variable in enumerate(self.variables.iteritems()):
+ 			s+="         variables%s:  (arrays of each variable class)\n" % \
+ 				string_dim(self.variables,i)
+ 			fnames=vars(variable)
+@@ -83,7 +84,7 @@
+ 				s+="'            %-*s:    [%ix%i]    '%s'\n" % \
+ 					(maxlen+1,fname,size(getattr(variable,fname)),type(getattr(variable,fname)))
+ 
+-		for i,response in enumerate(self.responses):
++		for i,response in enumerate(self.responses.iteritems()):
+ 			s+="         responses%s:  (arrays of each response class)\n" % \
+ 				string_dim(self.responses,i)
+ 			fnames=vars(response)
+@@ -97,12 +98,12 @@
+ 
+ 		s+="%s\n" % fielddisplay(self,'numberofresponses','number of responses') 
+ 
+-		for i,method in enumerate(self.method):
++		for i,method in enumerate(self.method.iteritems()):
+ 			if isinstance(method,'dakota_method'):
+ 				s+="            method%s :    '%s'\n" % \
+ 					(string_dim(method,i),method.method)
+ 
+-		for i,param in enumerate(self.params):
++		for i,param in enumerate(self.params.iteritems()):
+ 			s+="         params%s:  (array of method-independent parameters)\n" % \
+ 				string_dim(self.params,i)
+ 			fnames=vars(param)
+@@ -114,7 +115,7 @@
+ 				s+="            %-*s: %s\n" % \
+ 					(maxlen+1,fname,any2str(getattr(param,fname)))
+ 
+-		for i,result in enumerate(self.results):
++		for i,result in enumerate(self.results.iteritems()):
+ 			s+="         results%s:  (information from dakota files)\n" % \
+ 				string_dim(self.results,i)
+ 			fnames=vars(result)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/miscellaneous.py	(revision 13116)
+@@ -1,4 +1,5 @@
+ #module imports
++from collections import OrderedDict
+ from fielddisplay import fielddisplay
+ from EnumDefinitions import *
+ from checkfield import *
+@@ -17,7 +18,7 @@
+ 		# {{{ Properties
+ 		self.notes = ''
+ 		self.name  = ''
+-		self.dummy = {}
++		self.dummy = OrderedDict()
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/private.py	(revision 13116)
+@@ -1,4 +1,5 @@
+ #module imports
++from collections import OrderedDict
+ from fielddisplay import fielddisplay
+ from EnumDefinitions import *
+ from checkfield import *
+@@ -16,7 +17,7 @@
+ 		# {{{ Properties
+ 		self.isconsistent = True
+ 		self.runtimename  = ''
+-		self.bamg         = {}
++		self.bamg         = OrderedDict()
+ 		self.solution     = ''
+ 
+ 		#set defaults
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 13115)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 13116)
+@@ -76,7 +76,8 @@
+ 
+ 	#Go through a model fields, check that it is a class, and call checkconsistency
+ 	fields=vars(md)
+-	for field in fields.iterkeys():
++#	for field in fields.iterkeys():
++	for field in md.properties():
+ 
+ 		#Some properties do not need to be checked
+ 		if field in ['results','debug','radaroverlay']:
Index: /issm/oecreview/Archive/12678-13393/ISSM-13119-13120.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13119-13120.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13119-13120.diff	(revision 13394)
@@ -0,0 +1,42 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive272.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive272.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive272.nc	(revision 13119)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive272.nc	(revision 13120)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive272.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive274.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive274.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive274.nc	(revision 13119)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive274.nc	(revision 13120)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive274.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive270.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive270.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive270.nc	(revision 13119)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive270.nc	(revision 13120)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive270.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-13120-13121.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13120-13121.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13120-13121.diff	(revision 13394)
@@ -0,0 +1,32 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaterialsRheologyZbarEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaterialsRheologyZbarEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaterialsRheologyZbarEnum.m	(revision 13121)
+@@ -0,0 +1,11 @@
++function macro=MaterialsRheologyZbarEnum()
++%MATERIALSRHEOLOGYZBARENUM - Enum of MaterialsRheologyZbar
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=MaterialsRheologyZbarEnum()
++
++macro=StringToEnum('MaterialsRheologyZbar');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaterialsRheologyZEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaterialsRheologyZEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaterialsRheologyZEnum.m	(revision 13121)
+@@ -0,0 +1,11 @@
++function macro=MaterialsRheologyZEnum()
++%MATERIALSRHEOLOGYZENUM - Enum of MaterialsRheologyZ
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=MaterialsRheologyZEnum()
++
++macro=StringToEnum('MaterialsRheologyZ');
Index: /issm/oecreview/Archive/12678-13393/ISSM-13121-13122.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13121-13122.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13121-13122.diff	(revision 13394)
@@ -0,0 +1,114 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/initialdamage.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/initialdamage.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/initialdamage.m	(revision 13122)
+@@ -0,0 +1,41 @@
++function damage=initialdamage(md)
++%INITIALDAMAGE - compute initial damage guess for ICE SHELF inverse control method 
++%
++%	 This routine computes the initial damage guess as a function of
++%	 material properties, ice thickness, strain rate, and ice 
++%	 rigidity.  The model must contain computed strain rates.
++%
++%   Usage:
++%      md=initialdamage(md)
++%
++%   Example:
++%      md=initialdamage(md);
++
++%some checks
++if isempty(fieldnames(md.results)),
++	error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)'])
++end
++if ~(md.mesh.dimension==2)
++	error('only 2d model supported currently');
++end
++if any(md.flowequation.element_equation~=2),
++	disp('Warning: the model has some non macayeal elements. These will be treated like MacAyeal''s elements');
++end
++
++%average results onto vertices
++eps1=averaging(md,md.results.strainrate.principalvalue1,0)/md.constants.yts; % s^-1 for strain rates
++epsxx=averaging(md,md.results.strainrate.xx,0)/md.constants.yts;
++epsyy=averaging(md,md.results.strainrate.yy,0)/md.constants.yts;
++epseff=averaging(md,md.results.strainrate.effectivevalue,0)/md.constants.yts;
++n=averaging(md,md.materials.rheology_n,0);
++
++%lump material constants together
++const=md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)/2;
++
++damage=1-0.5*const.*md.geometry.thickness./md.materials.rheology_B./eps1.^(1./n);
++%damage=1-const.*md.geometry.thickness.*epseff.^((n-1)./n)./md.materials.rheology_B./(eps1+epsxx+epsyy);
++
++pos=find(damage>1);
++damage(pos)=1;
++pos=find(damage<0);
++damage(pos)=0;
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/initialdamage.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/steadystateiceshelftemp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/steadystateiceshelftemp.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/steadystateiceshelftemp.m	(revision 13122)
+@@ -0,0 +1,51 @@
++function temperature=steadystateiceshelftemp(md,surfacetemp,basaltemp)
++%STEADYSTATEICESHELFTEMP - compute depth-averaged steady-state temperature of an ice shelf 
++%
++%   This routine computes the depth-averaged temperature accounting for vertical advection 
++%   and diffusion of heat into the base of the ice shelf as a function of surface and 
++%   basal temperature and the basal melting rate.  Horizontal advection is ignored.
++%   The solution is a depth-averaged version of Equation 25 in Holland and Jenkins (1999).
++%
++%	 In addition to supplying md, the surface and basal temperatures of the ice shelf must
++%	 be supplied in degrees Kelvin.
++%
++%	 The model md must also contain the fields: 
++%	 md.geometry.thickness
++%	 md.basalforcings.melting_rate
++
++%   Usage:
++%      temperature=steadystateiceshelftemp(md,surfacetemp,basaltemp)
++
++if (length(md.geometry.thickness)~=md.mesh.numberofvertices)
++	error(['steadystateiceshelftemp error message: thickness should have a length of ' num2str(md.mesh.numberofvertices)])
++end
++
++%surface and basal temperatures in degrees C
++if (length(surfacetemp)~=md.mesh.numberofvertices)
++	error(['steadystateiceshelftemp error message: surfacetemp should have a length of ' num2str(md.mesh.numberofvertices)])
++end
++
++if (length(basaltemp)~=md.mesh.numberofvertices)
++	error(['steadystateiceshelftemp error message: basaltemp should have a length of ' num2str(md.mesh.numberofvertices)])
++end
++
++% Convert temps to Celsius for Holland and Jenkins equation
++Ts=-273+surfacetemp;
++Tb=-273+basaltemp;
++
++Hi=md.geometry.thickness;
++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; 
++
++%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
++
++pos=find(abs(wi)>=1e-4); % to avoid division by zero
++
++%calculate depth-averaged temperature (in Celsius)
++temperature(pos)=-( (Tb(pos)-Ts(pos))*ki./wi(pos) + Hi(pos).*Tb(pos) - (Hi(pos).*Ts(pos) + (Tb(pos)-Ts(pos))*ki./wi(pos)).*exp(Hi(pos).*wi(pos)/ki) )./( Hi(pos).*(exp(Hi(pos).*wi(pos)/ki)-1));
++
++%convert to Kelvin
++temperature=temperature+273;
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/steadystateiceshelftemp.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13122-13123.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13122-13123.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13122-13123.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 13122)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 13123)
+@@ -171,7 +171,7 @@
+ 			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+ 			disp('launching solution sequence on remote cluster');
+-			launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++			launchcommand=['source ' issmdir '/etc/environment.sh && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+ 				' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
+ 			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+ 		end %}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13123-13124.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13123-13124.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13123-13124.diff	(revision 13394)
@@ -0,0 +1,102 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/initialdamage.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/initialdamage.m	(revision 13123)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/initialdamage.m	(revision 13124)
+@@ -1,41 +0,0 @@
+-function damage=initialdamage(md)
+-%INITIALDAMAGE - compute initial damage guess for ICE SHELF inverse control method 
+-%
+-%	 This routine computes the initial damage guess as a function of
+-%	 material properties, ice thickness, strain rate, and ice 
+-%	 rigidity.  The model must contain computed strain rates.
+-%
+-%   Usage:
+-%      md=initialdamage(md)
+-%
+-%   Example:
+-%      md=initialdamage(md);
+-
+-%some checks
+-if isempty(fieldnames(md.results)),
+-	error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)'])
+-end
+-if ~(md.mesh.dimension==2)
+-	error('only 2d model supported currently');
+-end
+-if any(md.flowequation.element_equation~=2),
+-	disp('Warning: the model has some non macayeal elements. These will be treated like MacAyeal''s elements');
+-end
+-
+-%average results onto vertices
+-eps1=averaging(md,md.results.strainrate.principalvalue1,0)/md.constants.yts; % s^-1 for strain rates
+-epsxx=averaging(md,md.results.strainrate.xx,0)/md.constants.yts;
+-epsyy=averaging(md,md.results.strainrate.yy,0)/md.constants.yts;
+-epseff=averaging(md,md.results.strainrate.effectivevalue,0)/md.constants.yts;
+-n=averaging(md,md.materials.rheology_n,0);
+-
+-%lump material constants together
+-const=md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)/2;
+-
+-damage=1-0.5*const.*md.geometry.thickness./md.materials.rheology_B./eps1.^(1./n);
+-%damage=1-const.*md.geometry.thickness.*epseff.^((n-1)./n)./md.materials.rheology_B./(eps1+epsxx+epsyy);
+-
+-pos=find(damage>1);
+-damage(pos)=1;
+-pos=find(damage<0);
+-damage(pos)=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/steadystateiceshelftemp.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/steadystateiceshelftemp.m	(revision 13123)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/steadystateiceshelftemp.m	(revision 13124)
+@@ -1,51 +0,0 @@
+-function temperature=steadystateiceshelftemp(md,surfacetemp,basaltemp)
+-%STEADYSTATEICESHELFTEMP - compute depth-averaged steady-state temperature of an ice shelf 
+-%
+-%   This routine computes the depth-averaged temperature accounting for vertical advection 
+-%   and diffusion of heat into the base of the ice shelf as a function of surface and 
+-%   basal temperature and the basal melting rate.  Horizontal advection is ignored.
+-%   The solution is a depth-averaged version of Equation 25 in Holland and Jenkins (1999).
+-%
+-%	 In addition to supplying md, the surface and basal temperatures of the ice shelf must
+-%	 be supplied in degrees Kelvin.
+-%
+-%	 The model md must also contain the fields: 
+-%	 md.geometry.thickness
+-%	 md.basalforcings.melting_rate
+-
+-%   Usage:
+-%      temperature=steadystateiceshelftemp(md,surfacetemp,basaltemp)
+-
+-if (length(md.geometry.thickness)~=md.mesh.numberofvertices)
+-	error(['steadystateiceshelftemp error message: thickness should have a length of ' num2str(md.mesh.numberofvertices)])
+-end
+-
+-%surface and basal temperatures in degrees C
+-if (length(surfacetemp)~=md.mesh.numberofvertices)
+-	error(['steadystateiceshelftemp error message: surfacetemp should have a length of ' num2str(md.mesh.numberofvertices)])
+-end
+-
+-if (length(basaltemp)~=md.mesh.numberofvertices)
+-	error(['steadystateiceshelftemp error message: basaltemp should have a length of ' num2str(md.mesh.numberofvertices)])
+-end
+-
+-% Convert temps to Celsius for Holland and Jenkins equation
+-Ts=-273+surfacetemp;
+-Tb=-273+basaltemp;
+-
+-Hi=md.geometry.thickness;
+-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; 
+-
+-%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
+-
+-pos=find(abs(wi)>=1e-4); % to avoid division by zero
+-
+-%calculate depth-averaged temperature (in Celsius)
+-temperature(pos)=-( (Tb(pos)-Ts(pos))*ki./wi(pos) + Hi(pos).*Tb(pos) - (Hi(pos).*Ts(pos) + (Tb(pos)-Ts(pos))*ki./wi(pos)).*exp(Hi(pos).*wi(pos)/ki) )./( Hi(pos).*(exp(Hi(pos).*wi(pos)/ki)-1));
+-
+-%convert to Kelvin
+-temperature=temperature+273;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13124-13125.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13124-13125.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13124-13125.diff	(revision 13394)
@@ -0,0 +1,268 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py	(revision 13124)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py	(revision 13125)
+@@ -1,102 +1,136 @@
+ #Module import 
++import numpy
+ from math import isnan
++from MatlabFuncs import *
+ 
+-
+ def fielddisplay(md,name,comment):
+-#FIELDDISPLAY - display model field
+-#
+-#   Usage:
+-#      fielddisplay(md,name,comment)
++	"""
++	FIELDDISPLAY - display model field
+ 
++	   Usage:
++	      fielddisplay(md,name,comment)
++	"""
++
+ 	#get field
+ 	field=getattr(md,name)
+ 
+ 	#disp corresponding line as a function of field type (offset set as 9 spaces)
+ 	return parsedisplay("         ",name,field,comment);
+ 
+-#parsedisplay{{{ 
+-def  parsedisplay(offset,name,field,comment):
++def parsedisplay(offset,name,field,comment):    # {{{ 
+ 
+ 	#string
+ 	if isinstance(field,(str,unicode)):
++
+ 		if len(field)>30:
+ 			string=displayunit(offset,name,"not displayed",comment)
+ 		else:
+-			string=displayunit(offset,name,field,comment)
++			string=displayunit(offset,name,"'%s'" % field,comment)
+ 
+ 	#numeric
+-	elif isinstance(field, (int,long)):
+-		string=displayunit(offset,name,"%i" % (field),comment) 
++	elif isinstance(field,(int,long,float)):
++		string=displayunit(offset,name,str(field),comment) 
+ 
+-	elif isinstance(field, complex):
+-		raise RuntimeError("fielddisplay cannot handle complex numbers")
++	#matrix
++	elif isinstance(field,numpy.ndarray):
++		string=displayunit(offset,name,str(field.shape),comment)
+ 
+-	elif isinstance(field, float):
+-		string=displayunit(offset,name,"%g"%(field),comment)
+-
+ 	#logical
+ 	elif isinstance(field,bool):
+ 		if field:
+-			string=displayunit(offset,name,"true",comment)
++			string=displayunit(offset,name,"True",comment)
+ 		else:
+-			string=displayunit(offset,name,"false",comment)
++			string=displayunit(offset,name,"False",comment)
+ 	
++	#dictionary
+ 	elif isinstance(field,dict):
+-		if not field:
+-			string=displayunit(offset,name,'N/A',comment)
+-		else:
+-			string=displayunit(offset,name,'(dictionary)',comment)
+-			for key in field.keys():
+-				string="%s\n%s"%(string,parsedisplay(offset + '   ',key,field[key],''))
++		string=dict_display(offset,name,field,comment)
+ 
+-	elif isinstance(field,list):
+-		if not field:
+-			string=displayunit(offset,name,'N/A',comment),
+-		else:
+-			string=displayunit(offset,name,'(structure)',comment)
+-			for i in range(len(field)):
+-				string="%s\n%s"%(string,displayunit(offset + '   ',name,field[i],comment))
+-	#cell
+-	#elif  iscell(field):
+-	#	cell_display(offset,name,field,comment),
++	#list or tuple
++	elif isinstance(field,(list,tuple)):
++		string=list_display(offset,name,field,comment)
+ 
+ 	else:
+ 		string=displayunit(offset,name,"not displayed",comment)
+ 		
+ 	return string
++	# }}}
+ 
+-#}}}
+-#displayunit {{{
+-def  displayunit(offset,name,characterization,comment):
++def dict_display(offset,name,field,comment):    # {{{
+ 
++	if field:
++		string =displayunit(offset,name,'{dictionary}',comment)+'\n'
++		offset+='   '
++
++		for structure_field,sfield in field.iteritems():
++			string+=parsedisplay(offset,str(structure_field),sfield,'')+'\n'
++
++		if string and string[-1]=='\n':
++			string=string[:-1]
++
++	else:
++		string=displayunit(offset,name,'N/A',comment)
++
++	return string
++	# }}}
++
++def list_display(offset,name,field,comment):    # {{{
++
++	#initialization
++	if   isinstance(field,tuple):
++		sbeg='('
++		send=')'
++	elif isinstance(field,list):
++		sbeg='['
++		send=']'
++	string=sbeg
++
++	#go through the cell and fill string
++	if len(field)<5:
++		for fieldi in field:
++			if   isinstance(fieldi,(str,unicode)):
++				string+="'%s'," % fieldi
++			elif isinstance(fieldi,(bool,int,long,float)):
++				string+="%s," % str(fieldi)
++			else:
++				string=sbeg
++				break
++
++	if strcmp(string,sbeg):
++		string="%s%dx1%s" % (sbeg,len(field),send)
++	else:
++		string=string[:-1]+send
++
++	#call displayunit
++	return displayunit(offset,name,string,comment)
++	# }}}
++
++def displayunit(offset,name,characterization,comment):    # {{{
++
+ 	#take care of name
+ 	if len(name)>23:
+-		name="%s..." % (name[:19])
++		name="%s..." % name[:20]
+ 	
+ 	#take care of characterization
+-	if characterization=="":
++	if strcmp(characterization,"''") or strcmp(characterization,'""') or strcmpi(characterization,'nan'):
+ 		characterization="N/A"
+ 	
+-	if characterization=="nan":
+-		characterization="N/A"
+-	
+ 	if len(characterization)>15:
+-		characterization="%s%s" % (characterization[:11],"...")
++		characterization="%s..." % characterization[:12]
+ 	
+ 	#print
+ 	if not comment:
+ 		string="%s%-23s: %-15s" % (offset,name,characterization)
+ 	else:
+-		if isinstance(comment,(str,unicode)):
++		if   isinstance(comment,(str,unicode)):
+ 			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment)
+ 		elif isinstance(comment,list):
+-			print(comment)
+ 			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment[0])
+-			for i in range(1,len(comment)):
+-				string2="%s%-23s  %-15s    %s" %(offset,"","",comment[i])
+-				string="%s\n%s"%(string,string2)
++			for commenti in comment:
++				string+="\n%s%-23s  %-15s    %s" % (offset,'','',comment[i])
+ 		else:
+-			raise RuntimeError("fielddisplay error message: format for comment not supportet yet")
++			raise RuntimeError("fielddisplay error message: format for comment not supported yet")
+ 
+ 	return string
+-#}}}
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.m	(revision 13124)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.m	(revision 13125)
+@@ -2,7 +2,7 @@
+ %FIELDDISPLAY - display model field
+ %
+ %   Usage:
+-%      fielddisplay(md,offset,name,comment)
++%      fielddisplay(md,name,comment)
+ 
+ 	%get field
+ 	field=md.(name);
+@@ -55,14 +55,9 @@
+ 			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
+ 		end
+ 
+-		%structure
++	%structure
+ 	elseif isstruct(field),
+-		if ~isempty(fields(field))
+-			displayunit(offset,name,'(structure)',comment),
+-			struct_display(field,[offset '   ']),
+-		else
+-			displayunit(offset,name,'N/A',comment),
+-		end
++		struct_display(offset,name,field,comment),
+ 
+ 	%cell
+ 	elseif iscell(field),
+@@ -74,24 +69,26 @@
+ 	end
+ end%}}}
+ 
+-function struct_display(structure,offset) % {{{
++function struct_display(offset,name,field,comment) % {{{
+ 
+-	structure_fields=fields(structure);
++	if ~isempty(fields(field))
++		displayunit(offset,name,'(structure)',comment),
++		offset=[offset '   '];
+ 
+-	for i=1:length(structure_fields),
++		structure_fields=fields(field);
+ 
+-		%get current field
+-		field=structure.(structure_fields{i});
++		for i=1:length(structure_fields),
+ 
+-		%recursive call if necessary
+-		if isstruct(field),
+-			displayunit(offset,structure_fields{i},'(structure)',''),
+-			struct_display(field,[offset '   ']);
++			%get current field
++			sfield=field.(structure_fields{i});
+ 
+-		%display value
+-		else
+-			parsedisplay(offset,structure_fields{i},field,'');
++			%display value
++			parsedisplay(offset,structure_fields{i},sfield,'');
+ 		end
++
++	else
++		displayunit(offset,name,'N/A',comment),
++
+ 	end
+ end% }}}
+ function cell_display(offset,name,field,comment) % {{{
+@@ -148,7 +145,7 @@
+ 				disp(sprintf('%s%-23s  %-15s    %s',offset,'','',comment{i}));
+ 			end
+ 		else
+-			error('fielddisplay error message: format for comment not supportet yet');
++			error('fielddisplay error message: format for comment not supported yet');
+ 		end
+ 	end
+ end% }}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13125-13126.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13125-13126.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13125-13126.diff	(revision 13394)
@@ -0,0 +1,135 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 13125)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 13126)
+@@ -8,20 +8,21 @@
+ classdef pfe
+     properties (SetAccess=public)  
+ 		 % {{{
+-		 name='pfe'
+-		 login='';
+-		 numnodes=20;
+-		 cpuspernode=8; 
+-		 port=1025;
+-		 queue='long';
+-		 time=12*60;
+-		 processor='neh';
+-		 codepath='';
+-		 executionpath='';
+-		 interactive=0;
+-		 bbftp=0;
+-		 numstreams=8;
+-		 hyperthreading=0;
++		 name           = 'pfe'
++		 login          = '';
++		 numnodes       = 20;
++		 cpuspernode    = 8;
++		 port           = 1025;
++		 queue          = 'long';
++		 time           = 12*60;
++		 processor      = 'neh';
++		 codepath       = '';
++		 executionpath  = '';
++		 grouplist     = 's1010';
++		 interactive    = 0;
++		 bbftp          = 0;
++		 numstreams     = 8;
++		 hyperthreading = 0;
+ 	 end
+ 	 properties (SetAccess=private) 
+ 		 np=20*8;
+@@ -51,6 +52,7 @@
+ 			 disp(sprintf('    processor: %s',cluster.processor));
+ 			 disp(sprintf('    codepath: %s',cluster.codepath));
+ 			 disp(sprintf('    executionpath: %s',cluster.executionpath));
++			 disp(sprintf('    grouplist: %s',cluster.grouplist));
+ 			 disp(sprintf('    interactive: %i',cluster.interactive));
+ 			 disp(sprintf('    hyperthreading: %i',cluster.hyperthreading));
+ 		 end
+@@ -92,6 +94,7 @@
+ 			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+ 			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+ 			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++			 if isempty(cluster.grouplist), md = checkmessage(md,'grouplist empty'); end
+ 
+ 		 end
+ 		 %}}}
+@@ -109,7 +112,7 @@
+ 			 fprintf(fid,'#PBS -l select=%i:ncpus=%i:model=%s\n',cluster.numnodes,cluster.cpuspernode,cluster.processor);
+ 			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+ 			 fprintf(fid,'#PBS -q %s \n',cluster.queue);
+-			 fprintf(fid,'#PBS -W group_list=s1010\n');
++			 fprintf(fid,'#PBS -W group_list=%s\n',cluster.grouplist);
+ 			 fprintf(fid,'#PBS -m e\n');
+ 			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+ 			 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+@@ -119,8 +122,10 @@
+ 			 fprintf(fid,'module load math/intel_mkl_64_10.0.011\n\n');
+ 			 fprintf(fid,'export PATH="$PATH:."\n\n');
+ 			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
++			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+ 			 fprintf(fid,'cd $PBS_O_WORKDIR\n\n');
+-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
++			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname '/' modelname]);
+ 			 if ~io_gather, %concatenate the output files:
+ 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+ 			 end
+@@ -144,6 +149,57 @@
+ 				 fclose(fid);
+ 			 end
+ 		 end %}}}
++		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++
++			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++
++			 %compute number of processors
++			 cluster.np=cluster.numnodes*cluster.cpuspernode;
++
++			 %write queuing script 
++			 fid=fopen([modelname '.queue'],'w');
++			 fprintf(fid,'#PBS -S /bin/bash\n');
++			 %			 fprintf(fid,'#PBS -N %s\n',modelname);
++			 fprintf(fid,'#PBS -l select=%i:ncpus=%i:model=%s\n',cluster.numnodes,cluster.cpuspernode,cluster.processor);
++			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
++			 fprintf(fid,'#PBS -q %s \n',cluster.queue);
++			 fprintf(fid,'#PBS -W group_list=s1010\n');
++			 fprintf(fid,'#PBS -m e\n');
++			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
++			 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
++			 fprintf(fid,'. /usr/share/modules/init/bash\n\n');
++			 fprintf(fid,'module load comp-intel/11.1.046\n');
++			 fprintf(fid,'module load mpi/mpt.1.25\n');
++			 fprintf(fid,'module load math/intel_mkl_64_10.0.011\n\n');
++			 fprintf(fid,'export PATH="$PATH:."\n');
++			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
++			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
++			 fprintf(fid,'mpiexec -np %i %s/kriging.exe $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname '/' modelname]); %FIXME
++			 if ~io_gather, %concatenate the output files:
++				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			 end
++			 fclose(fid);
++
++			 %in interactive mode, create a run file, and errlog and outlog file
++			 if cluster.interactive,
++				 fid=fopen([modelname '.run'],'w');
++				 if ~isvalgrind,
++					 fprintf(fid,'mpiexec -np %i %s/kriging.exe $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname '/' modelname]);
++				 else
++					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/kriging.exe $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,modelname);
++				 end
++				 if ~io_gather, %concatenate the output files:
++					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++				 end
++				 fclose(fid);
++				 fid=fopen([modelname '.errlog'],'w');
++				 fclose(fid);
++				 fid=fopen([modelname '.outlog'],'w');
++				 fclose(fid);
++			 end
++		 end %}}}
+ 		 function LaunchQueueJob(cluster,modelname,dirname,filelist)% {{{
+ 
+ 			 %compress the files into one zip.
Index: /issm/oecreview/Archive/12678-13393/ISSM-13126-13127.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13126-13127.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13126-13127.diff	(revision 13394)
@@ -0,0 +1,126 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/radarpower.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/radarpower.m	(revision 13126)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/radarpower.m	(revision 13127)
+@@ -9,8 +9,6 @@
+ %      md=radarpower(md,options);
+ %      md=radarpower(md)
+ 
+-%If gdal does not work, uncomment the following line
+-%setenv('LD_LIBRARY_PATH','/proj/ice/larour/issm/trunk/externalpackages/gdal/install/lib/');
+ %Parse inputs
+ if nargin==1,
+ 	options=pairoptions;
+@@ -21,10 +19,10 @@
+ 	end
+ end
+ 
+-highres=getfieldvalue(options,'highres',0);
+-xlim=getfieldvalue(options,'xlim',[min(md.mesh.x) max(md.mesh.x)]);
+-ylim=getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]);
+-posting=getfieldvalue(options,'posting',0); % 0 -> image posting default
++highres = getfieldvalue(options,'highres',0);
++xlim    = getfieldvalue(options,'xlim',[min(md.mesh.x) max(md.mesh.x)]);
++ylim    = getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]);
++posting = getfieldvalue(options,'posting',0); % 0 -> image posting default
+ 
+ %find gdal coordinates
+ x0=min(xlim); x1=max(xlim);
+@@ -33,35 +31,65 @@
+ %figure out if we should go look for Greenland or Antarctica geotiff, or if user provided one.
+ if ~exist(options,'overlay_image'),
+ 	if strcmpi(md.mesh.hemisphere,'n'),
+-		if ~exist([jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg']),
+-			error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg not found.']);
+-		end
+-		name = 'mog150_greenland_map';
++		%if ~exist([jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg']),
++		%	error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg not found.']);
++		%end
++		%name = 'mog150_greenland_map';
+ 		%name = 'mog100_hp1_v10';
+-		%name = 'mog500_hp1_v10';
+-		jpgim=[jplsvn() '/projects/ModelData/MOG/' name '.jpg'];
+-		geom=load([jplsvn() '/projects/ModelData/MOG/' name '.jpgw'],'ascii');
++		%%name = 'mog500_hp1_v10';
++		%jpgim=[jplsvn() '/projects/ModelData/MOG/' name '.jpg'];
++		%geom=load([jplsvn() '/projects/ModelData/MOG/' name '.jpgw'],'ascii');
++		%%jpgim='/u/astrid-r1b/morlighe/issmjpl/projects/MorlighemGRL2012/Data/Mosaic_amp_asar2010.jpg';
++		%%geom=load('/u/astrid-r1b/morlighe/issmjpl/projects/MorlighemGRL2012/Data/Mosaic_amp_asar2010.jpgw');
++		%jpgim='/u/astrid-r1b/morlighe/issmjpl/projects/MorlighemGRL2012/Data/Russel_asar2010.png';
++		%geom=load('/u/astrid-r1b/morlighe/issmjpl/projects/MorlighemGRL2012/Data/Russel_asar2010.pngw');
+ 
+-		%geom:   xposting nbcols nbrows yposting xmin ymax
+-		xmin=max(geom(5),x0);
+-		xmax=min(geom(5)+geom(1)*geom(2),x1);
+-		ymin=max(geom(6)-geom(3)*geom(4),y0);
+-		ymax=min(geom(6),y1);
++		%%geom:   xposting nbcols nbrows yposting xmin ymax
++		%xmin=max(geom(5),x0);
++		%xmax=min(geom(5)+geom(1)*geom(2),x1);
++		%ymin=max(geom(6)-geom(3)*geom(4),y0);
++		%ymax=min(geom(6),y1);
+ 
+-		firstcol=max(1,floor((xmin-geom(5))/geom(1))); %x min
+-		firstrow=max(1,floor((geom(6)-ymax)/geom(4))); %y max
+-		numcols=floor((xmax-xmin)/geom(1)); % x posting
+-		numrows=floor((ymax-ymin)/geom(4)); % y posting
+-		pixelskip=max(1,ceil(posting/geom(1)));
++		%firstcol=max(1,floor((xmin-geom(5))/geom(1))); %x min
++		%firstrow=max(1,floor((geom(6)-ymax)/geom(4))); %y max
++		%numcols=floor((xmax-xmin)/geom(1)); % x posting
++		%numrows=floor((ymax-ymin)/geom(4)); % y posting
++		%pixelskip=max(1,ceil(posting/geom(1)));
+ 
+-		%Read and crop file
+-		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
+-		im=imread(jpgim);
+-		im=im(firstrow:firstrow+numrows-1,firstcol:firstcol+numcols-1);
++		%%Read and crop file
++		%disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
++		%im=imread(jpgim);
++		%im=im(firstrow:firstrow+numrows-1,firstcol:firstcol+numcols-1);
++		%md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
++		%md.radaroverlay.x=(xmin:(xmax-xmin)/(size(md.radaroverlay.pwr,2)-1):xmax);
++		%md.radaroverlay.y=(ymin:(ymax-ymin)/(size(md.radaroverlay.pwr,1)-1):ymax);
++		if highres,
++			if ~exist([jplsvn() '/projects/ModelData/MOG/mog100g_r2_hp1.tif']),
++				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MOG/mog100g_r2_hp1.tif not found.']);
++			end
++			geotiff_name=[jplsvn() '/projects/ModelData/MOG/mog100_r2_hp1.tif'];
++		else
++			if ~exist([jplsvn() '/projects/ModelData/MOG/mog500g_r2_hp1.tif']),
++				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MOG/mog500g_r2_hp1.tif not found.']);
++			end
++			geotiff_name=[jplsvn() '/projects/ModelData/MOG/mog500_r2_hp1.tif'];
++		end
++
++		%Name of image
++		inputname='./temp.tif';
++		eval(['!gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ]);
++
++		%Read in temp.tif:
++		im=imread('temp.tif','TIFF');
++		pixelskip=max(1,ceil(posting/((x1-x0)/(size(im,2)))));
+ 		md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
+-		md.radaroverlay.x=(xmin:(xmax-xmin)/(size(md.radaroverlay.pwr,2)-1):xmax);
+-		md.radaroverlay.y=(ymin:(ymax-ymin)/(size(md.radaroverlay.pwr,1)-1):ymax);
++		md.radaroverlay.x=(x0:(x1-x0)/(size(md.radaroverlay.pwr,2)-1):x1);
++		md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
+ 
++		%Erase image
++		system('rm -rf ./temp.tif');
++
++
+ 	elseif strcmpi(md.mesh.hemisphere,'s'),
+ 		if highres,
+ 			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif']),
+@@ -93,7 +121,7 @@
+ 		error('field hemisphere should either be ''n'' or ''s''');
+ 	end
+ else
+-	%ok, user provided an image. check we also have overlay_xlim and overlay_ylim  options, to know what range of coordinates the image covers.
++	%user provided an image. check we also have overlay_xlim and overlay_ylim  options, to know what range of coordinates the image covers.
+ 	if (~exist(options,'overlay_xlim') | ~exist(options,'overlay_xlim')| ~exist(options,'overlay_xposting')| ~exist(options,'overlay_yposting')),
+ 		error('radarpower error message: please provide overlay_xlim, overlay_ylim, overlay_xposting and overlay_yposting options together with overlay_image option');
+ 	end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13127-13128.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13127-13128.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13127-13128.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13127)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13128)
+@@ -216,7 +216,7 @@
+ 
+ Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
+                      ../Shp2Kml/Shp2Kml.h
+-Shp2Kml_la_LIBADD = ${deps}
++Shp2Kml_la_LIBADD = ${deps} $(SHAPELIBLIB) $(MPILIB) $(PETSCLIB)
+ 
+ TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp\
+ 			  ../TriaSearch/TriaSearch.h
Index: /issm/oecreview/Archive/12678-13393/ISSM-13128-13129.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13128-13129.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13128-13129.diff	(revision 13394)
@@ -0,0 +1,2120 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13129)
+@@ -281,6 +281,7 @@
+ 	MacAyeal2dIceFrontEnum,
+ 	MacAyeal3dIceFrontEnum,
+ 	MaticeEnum,
++	MatdamageiceEnum,
+ 	MatparEnum,
+ 	NodeEnum,
+ 	NumericalfluxEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13129)
+@@ -285,6 +285,7 @@
+ 	      else if (strcmp(name,"MacAyeal2dIceFront")==0) return MacAyeal2dIceFrontEnum;
+ 	      else if (strcmp(name,"MacAyeal3dIceFront")==0) return MacAyeal3dIceFrontEnum;
+ 	      else if (strcmp(name,"Matice")==0) return MaticeEnum;
++	      else if (strcmp(name,"Matdamageice")==0) return MatdamageiceEnum;
+ 	      else if (strcmp(name,"Matpar")==0) return MatparEnum;
+ 	      else if (strcmp(name,"Node")==0) return NodeEnum;
+ 	      else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
+@@ -382,11 +383,11 @@
+ 	      else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
+ 	      else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
+ 	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
+-	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
++	      if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
++	      else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
+ 	      else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
+ 	      else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
+ 	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13129)
+@@ -278,6 +278,7 @@
+ 		case MacAyeal2dIceFrontEnum : return "MacAyeal2dIceFront";
+ 		case MacAyeal3dIceFrontEnum : return "MacAyeal3dIceFront";
+ 		case MaticeEnum : return "Matice";
++		case MatdamageiceEnum : return "Matdamageice";
+ 		case MatparEnum : return "Matpar";
+ 		case NodeEnum : return "Node";
+ 		case NumericalfluxEnum : return "Numericalflux";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 13129)
+@@ -15,7 +15,7 @@
+ 
+ void	UpdateElementsDiagnosticHoriz(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
+ 
+-	int    dim;
++	int    dim,materials_type;
+ 	int    numberofelements;
+ 	bool   ismacayealpattyn;
+ 	bool   isl1l2;
+@@ -31,6 +31,7 @@
+ 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
+ 	iomodel->Constant(&control_analysis,InversionIscontrolEnum);
+ 	iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum);
++	iomodel->Constant(&materials_type,MaterialsEnum);
+ 
+ 	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
+ 	if(!ismacayealpattyn & !isstokes &!isl1l2) return;
+@@ -60,10 +61,11 @@
+ 	iomodel->FetchDataToInput(elements,MaskElementonwaterEnum);
+ 	iomodel->FetchDataToInput(elements,MaterialsRheologyBEnum);
+ 	iomodel->FetchDataToInput(elements,MaterialsRheologyNEnum);
+-	iomodel->FetchDataToInput(elements,MaterialsRheologyZEnum);
+ 	iomodel->FetchDataToInput(elements,VxEnum);
+ 	iomodel->FetchDataToInput(elements,VyEnum);
+-
++	if(materials_type==MatdamageiceEnum){
++		iomodel->FetchDataToInput(elements,MaterialsRheologyZEnum);
++	}
+ 	if (dim==3){
+ 		iomodel->FetchDataToInput(elements,MeshElementonbedEnum);
+ 		iomodel->FetchDataToInput(elements,MeshElementonsurfaceEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 13129)
+@@ -16,21 +16,22 @@
+ 
+ 	/*Intermediary*/
+ 	int i,j,k,n;
+-	int dim;
++	int dim,materials_type;
+ 	int numberofelements;
+ 	int numberofvertices;
+ 	bool control_analysis;
+ 
+ 	/*DataSets: */
+-	Elements*     elements  = NULL;
+-	Vertices*     vertices = NULL;
+-	Materials*    materials = NULL;
++	Elements  *elements  = NULL;
++	Vertices  *vertices  = NULL;
++	Materials *materials = NULL;
+ 
+ 	/*Fetch parameters: */
+ 	iomodel->Constant(&dim,MeshDimensionEnum);
+ 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
+ 	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
+ 	iomodel->Constant(&control_analysis,InversionIscontrolEnum);
++	iomodel->Constant(&materials_type,MaterialsEnum);
+ 
+ 	/*Did we already create the elements? : */
+ 	if(*pelements)return;
+@@ -43,14 +44,13 @@
+ 	/*First, partition elements and vertices. Nodes will partitioned on a per analysis_type basis. If partitining already done, ignore: */
+ 	ElementsAndVerticesPartitioning(&iomodel->my_elements,&iomodel->my_vertices,iomodel);
+ 	
+-	/*Fetch data needed: */
+-	iomodel->FetchData(5,MeshElementsEnum,MeshElementconnectivityEnum,MaterialsRheologyBEnum,MaterialsRheologyNEnum,MaterialsRheologyZEnum);
++	iomodel->FetchData(2,MeshElementsEnum,MeshElementconnectivityEnum);
+ 	#ifdef _HAVE_3D_
+ 	if(dim==3)iomodel->FetchData(2,MeshUpperelementsEnum,MeshLowerelementsEnum);
+ 	#endif
+ 	if(control_analysis)iomodel->FetchData(3,InversionControlParametersEnum,InversionMinParametersEnum,InversionMaxParametersEnum);
+ 	
+-	/*Create elements and materials: */
++	/*Create elements*/
+ 	for (i=0;i<numberofelements;i++){
+ 		if(iomodel->my_elements[i]){
+ 
+@@ -59,12 +59,23 @@
+ 	        #ifdef _HAVE_3D_
+ 			else       elements->AddObject(new Penta(i+1,i,i,iomodel,nummodels));
+ 	        #endif
+-
+-			/*Create and add material property to materials dataset: */
+-			materials->AddObject(new Matice(i+1,i,iomodel));
+ 		}
+ 	}
+ 	
++	/*Create materials*/
++	switch(materials_type){
++		case MaticeEnum:
++			iomodel->FetchData(2,MaterialsRheologyBEnum,MaterialsRheologyNEnum);
++			for (i=0;i<numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,iomodel));
++			break;
++		case MatdamageiceEnum:
++			iomodel->FetchData(3,MaterialsRheologyBEnum,MaterialsRheologyNEnum,MaterialsRheologyZEnum);
++			for (i=0;i<numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matdamageice(i+1,i,iomodel));
++			break;
++		default:
++			_error_("Materials "<<EnumToStringx(materials_type)<<" not supported");
++	}
++
+ 	/*Free data: */
+ 	iomodel->DeleteData(10,MeshElementsEnum,MeshElementconnectivityEnum,MeshUpperelementsEnum,MeshLowerelementsEnum,
+ 				MaterialsRheologyBEnum,MaterialsRheologyNEnum,MaterialsRheologyZEnum,InversionControlParametersEnum,InversionMinParametersEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13129)
+@@ -108,6 +108,8 @@
+ 					./classes/objects/Inputs/DatasetInput.cpp\
+ 					./classes/objects/Materials/Matice.h\
+ 					./classes/objects/Materials/Matice.cpp\
++					./classes/objects/Materials/Matdamageice.h\
++					./classes/objects/Materials/Matdamageice.cpp\
+ 					./classes/objects/Materials/Matpar.h\
+ 					./classes/objects/Materials/Matpar.cpp\
+ 					./classes/objects/Constraints/Constraint.h\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 13129)
+@@ -107,6 +107,7 @@
+ /*Materials: */
+ #include "./Materials/Material.h"
+ #include "./Materials/Matice.h"
++#include "./Materials/Matdamageice.h"
+ #include "./Materials/Matpar.h"
+ 
+ /*Params: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13129)
+@@ -171,26 +171,6 @@
+ 	return n;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetZ {{{*/
+-IssmDouble Matice::GetZ(){
+-
+-	/*Output*/
+-	IssmDouble Z;
+-
+-	inputs->GetInputAverage(&Z,MaterialsRheologyZEnum);
+-	return Z;
+-}
+-/*}}}*/
+-/*FUNCTION Matice::GetZbar {{{*/
+-IssmDouble Matice::GetZbar(){
+-
+-	/*Output*/
+-	IssmDouble Zbar;
+-
+-	inputs->GetInputAverage(&Zbar,MaterialsRheologyZbarEnum);
+-	return Zbar;
+-}
+-/*}}}*/
+ /*FUNCTION Matice::GetVectorFromInputs{{{*/
+ void  Matice::GetVectorFromInputs(Vector* vector,int input_enum){
+ 
+@@ -226,7 +206,7 @@
+ /*FUNCTION Matice::GetViscosity2d {{{*/
+ void  Matice::GetViscosity2d(IssmDouble* pviscosity, IssmDouble* epsilon){
+ 	/*From a string tensor and a material object, return viscosity, using Glen's flow law.
+-												   Z * B
++												    B
+ 	  viscosity= -------------------------------------------------------------------
+ 						  2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
+ 
+@@ -245,13 +225,11 @@
+ 
+ 	/*Intermediary: */
+ 	IssmDouble A,e;
+-	IssmDouble Btmp,B,n,Z;
++	IssmDouble B,n;
+ 
+ 	/*Get B and n*/
+-	Btmp=GetBbar();
+-	Z=GetZbar();
++	B=GetBbar();
+ 	n=GetN();
+-	B=Z*Btmp;
+ 
+ 	if (n==1){
+ 		/*Viscous behaviour! viscosity=B: */
+@@ -313,12 +291,11 @@
+ 
+ 	/*Intermediaries: */
+ 	IssmDouble A,e;
+-	IssmDouble B,n,Z;
++	IssmDouble B,n;
+ 
+-	/*Get B, Z and n*/
++	/*Get B and n*/
++	B=GetB();
+ 	n=GetN();
+-	Z=GetZ();
+-	B=Z*GetB();
+ 
+ 	if (n==1){
+ 		/*Viscous behaviour! viscosity3d=B: */
+@@ -384,14 +361,13 @@
+ 
+ 	/*Intermediaries: */
+ 	IssmDouble A,e;
+-	IssmDouble B,n,Z;
++	IssmDouble B,n;
+ 	IssmDouble eps0;
+ 
+ 	/*Get B and n*/
+ 	eps0=pow((IssmDouble)10,(IssmDouble)-27);
++	B=GetB();
+ 	n=GetN();
+-	Z=GetZ();
+-	B=Z*GetB();
+ 	
+ 	if (n==1){
+ 		/*Viscous behaviour! viscosity3d=B: */
+@@ -490,62 +466,6 @@
+ 	*pviscosity_complement=viscosity_complement;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetViscosityZComplement {{{*/
+-void  Matice::GetViscosityZComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){
+-	/*Return viscosity derivative for control method d(mu)/dZ: 
+-	 *
+-	 *  										               B 
+-	 * dviscosity= -------------------------------------------------------------------
+-	 *  				  2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
+-	 *
+-	 * If epsilon is NULL, it means this is the first time Gradjb is being run, and we 
+-	 * return mu20, initial viscosity.
+-	 */
+-	
+-	/*output: */
+-	IssmDouble viscosity_complement;
+-
+-	/*input strain rate: */
+-	IssmDouble exx,eyy,exy;
+-
+-	/*Intermediary value A and exponent e: */
+-	IssmDouble A,e;
+-	IssmDouble B,n;
+-
+-	/*Get B and n*/
+-	B=GetBbar();
+-	n=GetN();
+-
+-	if(epsilon){
+-		exx=*(epsilon+0);
+-		eyy=*(epsilon+1);
+-		exy=*(epsilon+2);
+-
+-		/*Build viscosity: mu2=B/(2*A^e) */
+-		A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
+-		if(A==0){
+-			/*Maximum viscosity_complement for 0 shear areas: */
+-			viscosity_complement=2.25*pow((IssmDouble)10,(IssmDouble)17);
+-		}
+-		else{
+-			e=(n-1)/(2*n);
+-		
+-			viscosity_complement=B/(2*pow(A,e));
+-		}
+-	}
+-	else{
+-		viscosity_complement=4.5*pow((IssmDouble)10,(IssmDouble)17);
+-	}
+-
+-	/*Checks in debugging mode*/
+-	_assert_(B>0);
+-	_assert_(n>0);
+-	_assert_(viscosity_complement>0);
+-		
+-	/*Return: */
+-	*pviscosity_complement=viscosity_complement;
+-}
+-/*}}}*/
+ /*FUNCTION Matice::GetViscosityDerivativeEpsSquare{{{*/
+ void  Matice::GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){
+ 
+@@ -780,12 +700,6 @@
+ 			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyNEnum,nodeinputs));
+ 		}
+ 
+-		/*Get Z*/
+-		if (iomodel->Data(MaterialsRheologyZEnum)) {
+-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyZEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
+-			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyZbarEnum,nodeinputs));
+-		}
+-
+ 		/*Control Inputs*/
+ 		#ifdef _HAVE_CONTROL_
+ 		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+@@ -800,16 +714,6 @@
+ 							this->inputs->AddInput(new ControlInput(MaterialsRheologyBbarEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+ 						}
+ 						break;
+-					case MaterialsRheologyZbarEnum:
+-						if (iomodel->Data(MaterialsRheologyZEnum)){
+-							_assert_(iomodel->Data(MaterialsRheologyZEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
+-							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyZEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
+-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							this->inputs->AddInput(new ControlInput(MaterialsRheologyZbarEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-						}
+-						break;
+-
+ 				}
+ 			}
+ 		}
+@@ -838,12 +742,6 @@
+ 			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyNEnum,nodeinputs));
+ 		}
+ 
+-		/*Get Z*/
+-		if (iomodel->Data(MaterialsRheologyZEnum)) {
+-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyZEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
+-			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyZEnum,nodeinputs));
+-		}
+-
+ 		/*Control Inputs*/
+ 		#ifdef _HAVE_CONTROL_
+ 		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+@@ -858,15 +756,6 @@
+ 							this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+ 						}
+ 						break;
+-					case MaterialsRheologyZbarEnum:
+-						if (iomodel->Data(MaterialsRheologyZEnum)){
+-							_assert_(iomodel->Data(MaterialsRheologyZEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
+-							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyZEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
+-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							this->inputs->AddInput(new ControlInput(MaterialsRheologyZEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+-						}
+-						break;
+ 				}
+ 			}
+ 		}
+@@ -885,9 +774,7 @@
+ 	if (
+ 				name==MaterialsRheologyBEnum ||
+ 				name==MaterialsRheologyBbarEnum ||
+-				name==MaterialsRheologyNEnum ||
+-				name==MaterialsRheologyZEnum ||
+-				name==MaterialsRheologyZbarEnum
++				name==MaterialsRheologyNEnum
+ 		){
+ 		return true;
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h	(revision 13129)
+@@ -16,12 +16,27 @@
+ class Material: public Object,public Update{
+ 
+ 	public: 
++		Inputs*  inputs;
+ 		virtual       ~Material(){};
++		/*WARNING: input should not be public but it is an easy way to update B from T (using UpdateFromSolution) from Pentas*/
+ 
+ 		/*Numerics*/
+-		virtual void   InputDuplicate(int original_enum,int new_enum)=0;
+-		virtual void   Configure(Elements* elements)=0;
+-		virtual void   GetVectorFromInputs(Vector* vector,int input_enum)=0;
++		virtual void       InputDuplicate(int original_enum,int new_enum)=0;
++		virtual void       Configure(Elements* elements)=0;
++		virtual void       GetVectorFromInputs(Vector* vector,int input_enum)=0;
++		virtual void       GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon)=0;
++		virtual void       GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon)=0;
++		virtual void       GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon)=0;
++		virtual void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon)=0;
++		virtual void       GetViscosityZComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon)=0;
++		virtual void       GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon)=0;
++		virtual void       GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon)=0;
++		virtual IssmDouble GetA()=0;
++		virtual IssmDouble GetB()=0;
++		virtual IssmDouble GetBbar()=0;
++		virtual IssmDouble GetN()=0;
++		virtual IssmDouble GetZ()=0;
++		virtual IssmDouble GetZbar()=0;
+ 
+ };
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp	(revision 13129)
+@@ -44,6 +44,7 @@
+ 	iomodel->Constant(&this->hydro_n,HydrologyNEnum);
+ 	iomodel->Constant(&this->hydro_p,HydrologyPEnum);
+ 	iomodel->Constant(&this->hydro_q,HydrologyQEnum);
++	this->inputs=NULL; /*not used here*/
+ }
+ /*}}}*/
+ /*FUNCTION Matpar::~Matpar() {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h	(revision 13129)
+@@ -14,16 +14,10 @@
+ class Matice: public Material{
+ 
+ 	private: 
+-		/*Id*/
+ 		int	   mid;
+-
+-		/*hooks: */
+ 		Hook* helement;
+ 
+ 	public:
+-		/*WARNING: input should not be public but it is an easy way to update B from T (using UpdateFromSolution) from Pentas*/
+-		Inputs*  inputs;
+-
+ 		/*Matice constructors, destructors: {{{*/
+ 		Matice();
+ 		Matice(int mid,int i, IoModel* iomodel);
+@@ -55,23 +49,21 @@
+ 		void   InputDuplicate(int original_enum,int new_enum);
+ 		void   Configure(Elements* elements);
+ 		void   GetVectorFromInputs(Vector* vector,int input_enum);
+-		/*}}}*/
+-		/*Matice Numerics: {{{*/
+-		void   SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
+-		void   GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
+-		void   GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon);
+-		void   GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon);
+-		void   GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
+-		void   GetViscosityZComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
+-		void   GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
+-		void   GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
++		void       SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
++		void       GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
++		void       GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon);
++		void       GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon);
++		void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
++		void GetViscosityZComplement(IssmDouble*, IssmDouble*){_error_("not supported");};
++		void       GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
++		void       GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
+ 		IssmDouble GetA();
+ 		IssmDouble GetB();
+ 		IssmDouble GetBbar();
++		IssmDouble GetZ(){_error_("not supported");};
++		IssmDouble GetZbar(){_error_("not supported");};
+ 		IssmDouble GetN();
+-		IssmDouble GetZ();
+-		IssmDouble GetZbar();
+-		bool   IsInput(int name);
++		bool       IsInput(int name);
+ 		/*}}}*/
+ };
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 13129)
+@@ -67,6 +67,19 @@
+ 		void   InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");};
+ 		void   Configure(Elements* elements);
+ 		void   GetVectorFromInputs(Vector* vector,int input_enum){return;}
++		void       GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon){_error_("not supported");};
++		void       GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon){_error_("not supported");};
++		void       GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon){_error_("not supported");};
++		void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon){_error_("not supported");};
++		void       GetViscosityZComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon){_error_("not supported");};
++		void       GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon){_error_("not supported");};
++		void       GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon){_error_("not supported");};
++		IssmDouble GetA(){_error_("not supported");};
++		IssmDouble GetB(){_error_("not supported");};
++		IssmDouble GetBbar(){_error_("not supported");};
++		IssmDouble GetN(){_error_("not supported");};
++		IssmDouble GetZ(){_error_("not supported");};
++		IssmDouble GetZbar(){_error_("not supported");};
+ 		/*}}}*/
+ 		/*Numerics: {{{*/
+ 		IssmDouble GetG();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h	(revision 13129)
+@@ -42,33 +42,33 @@
+ 		/*Param vritual function definitions: {{{*/
+ 		int   InstanceEnum(){return enum_type;}
+ 		void  GetParameterValue(bool* pbool){*pbool=value;}
+-		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return an integer");}
+-		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}
+-		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble");}
++		void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
++		void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
++		void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
+ 		void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
+-		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a string");}
+-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a string array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}
+-		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a Mat");}
+-		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a FILE");}
++		void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
++		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
++		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
++		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){this->value=boolean;}
+-		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold an int");}
+-		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold an IssmPDouble");}
+-		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string");}
+-		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string array");}
+-		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+-		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Mat");}
+-		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a FILE");}
+-		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
++		void  SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an int");}
++		void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an IssmPDouble");}
++		void  SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
++		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
++		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
++		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
++		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
++		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+ 		
+ 		void GetParameterName(char**pname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp	(revision 13129)
+@@ -497,7 +497,7 @@
+ 	ElementVector* pe=icefront->CreatePVectorDiagnosticMacAyeal2d();
+ 
+ 	/*clean-up and return*/
+-	delete tria->matice;
++	delete tria->material;
+ 	delete tria;
+ 	delete icefront;
+ 	return pe;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13129)
+@@ -28,7 +28,7 @@
+ 	int i;
+ 
+ 	this->nodes=NULL;
+-	this->matice=NULL;
++	this->material=NULL;
+ 	this->matpar=NULL;
+ 	for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
+ 	this->inputs=NULL;
+@@ -60,7 +60,7 @@
+ 
+ 		/*initialize pointers:*/
+ 		this->nodes=NULL;
+-		this->matice=NULL;
++		this->material=NULL;
+ 		this->matpar=NULL;
+ 
+ }
+@@ -88,7 +88,7 @@
+ 	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();
+-	tria->hmatice=(Hook*)this->hmatice->copy();
++	tria->hmaterial=(Hook*)this->hmaterial->copy();
+ 	tria->hmatpar=(Hook*)this->hmatpar->copy();
+ 
+ 	/*deal with Tria fields: */
+@@ -112,7 +112,7 @@
+ 	/*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];
+-	tria->matice=(Matice*)tria->hmatice->delivers();
++	tria->material=(Material*)tria->hmaterial->delivers();
+ 	tria->matpar=(Matpar*)tria->hmatpar->delivers();
+ 
+ 	/*neighbors: */
+@@ -172,7 +172,7 @@
+ 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 
+ 	/*Checks in debugging mode{{{*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->parameters && this->inputs);
++	_assert_(this->nodes && this->material && this->matpar && this->parameters && this->inputs);
+ 	/*}}}*/
+ 	
+ 	/*Skip if water element*/
+@@ -525,7 +525,7 @@
+ 
+ 	/*asserts: {{{*/
+ 	/*if debugging mode, check that all pointers exist*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->parameters && this->inputs);
++	_assert_(this->nodes && this->material && this->matpar && this->parameters && this->inputs);
+ 	/*}}}*/
+ 	
+ 	/*Skip if water element*/
+@@ -747,7 +747,7 @@
+ 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 
+ 	/*Checks in debugging {{{*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->parameters && this->inputs);
++	_assert_(this->nodes && this->material && this->matpar && this->parameters && this->inputs);
+ 	/*}}}*/
+ 
+ 	/*Skip if water element*/
+@@ -811,7 +811,7 @@
+ 
+ 		/*Compute strain rate viscosity and pressure: */
+ 		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosity2d(&viscosity,&epsilon[0]);
++		material->GetViscosity2d(&viscosity,&epsilon[0]);
+ 		pressure_input->GetInputValue(&pressure,gauss);
+ 
+ 		/*Compute Stress*/
+@@ -845,13 +845,13 @@
+ 	/*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);
+-	this->hmatice->configure(materialsin);
++	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();
+ 	else this->nodes=NULL;
+-	this->matice=(Matice*)this->hmatice->delivers();
++	this->material=(Material*)this->hmaterial->delivers();
+ 	this->matpar=(Matpar*)this->hmatpar->delivers();
+ 
+ 	/*point parameters to real dataset: */
+@@ -874,8 +874,8 @@
+ 	}
+ 	else _printLine_("nodes = NULL");
+ 
+-	if (matice) matice->DeepEcho();
+-	else _printLine_("matice = NULL");
++	if (material) material->DeepEcho();
++	else _printLine_("material = NULL");
+ 
+ 	if (matpar) matpar->DeepEcho();
+ 	else _printLine_("matpar = NULL");
+@@ -986,8 +986,8 @@
+ 	}
+ 	else _printLine_("nodes = NULL");
+ 
+-	if (matice) matice->Echo();
+-	else _printLine_("matice = NULL");
++	if (material) material->Echo();
++	else _printLine_("material = NULL");
+ 
+ 	if (matpar) matpar->Echo();
+ 	else _printLine_("matpar = NULL");
+@@ -1349,7 +1349,7 @@
+ 	if (object_enum==MeshElementsEnum)
+ 	 oldinput=(Input*)this->inputs->GetInput(enum_type);
+ 	else if (object_enum==MaterialsEnum)
+-	 oldinput=(Input*)this->matice->inputs->GetInput(enum_type);
++	 oldinput=(Input*)this->material->inputs->GetInput(enum_type);
+ 	else
+ 	 _error_("object " << EnumToStringx(object_enum) << " not supported yet");
+ 	if(!oldinput)_error_("could not find old input with enum: " << EnumToStringx(enum_type));
+@@ -1362,7 +1362,7 @@
+ 	if (object_enum==MeshElementsEnum)
+ 	 this->inputs->AddInput((Input*)newinput);
+ 	else if (object_enum==MaterialsEnum)
+-	 this->matice->inputs->AddInput((Input*)newinput);
++	 this->material->inputs->AddInput((Input*)newinput);
+ 	else
+ 	 _error_("object " << EnumToStringx(object_enum) << " not supported yet");
+ }
+@@ -1395,7 +1395,7 @@
+ 	Input *input = NULL;	
+ 
+ 	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
+-	if (enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum) input=this->matice->inputs->GetInput(enum_type);
++	if (enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum) input=this->material->inputs->GetInput(enum_type);
+ 	else input=this->inputs->GetInput(enum_type);
+ 	//if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found in tria->inputs");
+ 	if(!input)return;
+@@ -1502,7 +1502,7 @@
+ 					break;
+ 				case MaterialsRheologyBbarEnum:
+ 				case MaterialsRheologyZbarEnum:
+-					/*Matice will take care of it*/ break;
++					/*Material will take care of it*/ break;
+ 				default:
+ 					_error_("Control " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])) << " not implemented yet");
+ 			}
+@@ -1691,7 +1691,7 @@
+ 
+ 			/*update input*/
+ 			if (name==MaterialsRheologyBbarEnum || name==MaterialsRheologyBEnum || name==MaterialsRheologyZEnum || name==MaterialsRheologyZbarEnum){
+-				matice->inputs->AddInput(new TriaP1Input(name,values));
++				material->inputs->AddInput(new TriaP1Input(name,values));
+ 			}
+ 			else{
+ 				this->inputs->AddInput(new TriaP1Input(name,values));
+@@ -2791,10 +2791,10 @@
+ 
+ 	switch(response_enum){
+ 		case MaterialsRheologyBbarEnum:
+-			*presponse=this->matice->GetBbar();
++			*presponse=this->material->GetBbar();
+ 			break;
+ 		case MaterialsRheologyZbarEnum:
+-			*presponse=this->matice->GetZbar();
++			*presponse=this->material->GetZbar();
+ 			break;
+ 		case VelEnum:{
+ 
+@@ -2908,8 +2908,8 @@
+ 
+ 		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+ 		this->GetStrainRate2d(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
+-		matice->GetViscosity2d(&viscosity, &epsilon[0]);
+-		matice->GetViscosity2d(&oldviscosity, &oldepsilon[0]);
++		material->GetViscosity2d(&viscosity, &epsilon[0]);
++		material->GetViscosity2d(&oldviscosity, &oldepsilon[0]);
+ 		thickness_input->GetInputValue(&thickness, gauss);
+ 
+ 		newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
+@@ -3091,8 +3091,8 @@
+ 	/*Retrieve all inputs and parameters*/
+ 	rho_ice=matpar->GetRhoIce();
+ 	gravity=matpar->GetG();
+-	n=matice->GetN();
+-	B=matice->GetBbar();
++	n=material->GetN();
++	B=material->GetBbar();
+ 	Input* slopex_input=inputs->GetInput(SurfaceSlopeXEnum); _assert_(slopex_input);
+ 	Input* slopey_input=inputs->GetInput(SurfaceSlopeYEnum); _assert_(slopey_input);
+ 	Input* thickness_input=inputs->GetInput(ThicknessEnum);  _assert_(thickness_input);
+@@ -3163,7 +3163,7 @@
+ 
+ 		thickness_input->GetInputValue(&thickness, gauss);
+ 		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosity2dDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		material->GetViscosity2dDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+ 		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+ 		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+ 
+@@ -3408,7 +3408,7 @@
+ 	for(int i=0;i<num_controls;i++){
+ 
+ 		if(control_type[i]==MaterialsRheologyBbarEnum || control_type[i]==MaterialsRheologyZbarEnum){
+-			input=(Input*)matice->inputs->GetInput(control_type[i]); _assert_(input);
++			input=(Input*)material->inputs->GetInput(control_type[i]); _assert_(input);
+ 		}
+ 		else{
+ 			input=(Input*)this->inputs->GetInput(control_type[i]);   _assert_(input);
+@@ -3435,7 +3435,7 @@
+ 	Input* input=NULL;
+ 
+ 	if(enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum){
+-		input=(Input*)matice->inputs->GetInput(enum_type);
++		input=(Input*)material->inputs->GetInput(enum_type);
+ 	}
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+@@ -3453,7 +3453,7 @@
+ 	Input* input=NULL;
+ 
+ 	if(enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum){
+-		input=(Input*)matice->inputs->GetInput(enum_type);
++		input=(Input*)material->inputs->GetInput(enum_type);
+ 	}
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+@@ -3472,7 +3472,7 @@
+ 	Input* input=NULL;
+ 
+ 	if(enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum){
+-		input=(Input*)matice->inputs->GetInput(enum_type);
++		input=(Input*)material->inputs->GetInput(enum_type);
+ 	}
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+@@ -3566,7 +3566,7 @@
+ 	/*Retrieve all inputs we will be needing: */
+ 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+ 	GradientIndexing(&doflist1[0],control_index);
+-	Input* rheologyb_input=matice->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
++	Input* rheologyb_input=material->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
+ 	Input* weights_input=inputs->GetInput(InversionCostFunctionsCoefficientsEnum);                _assert_(weights_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+@@ -3606,7 +3606,7 @@
+ 	/*Retrieve all inputs we will be needing: */
+ 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+ 	GradientIndexing(&doflist1[0],control_index);
+-	Input* rheologyz_input=matice->inputs->GetInput(MaterialsRheologyZbarEnum); _assert_(rheologyz_input);
++	Input* rheologyz_input=material->inputs->GetInput(MaterialsRheologyZbarEnum); _assert_(rheologyz_input);
+ 	Input* weights_input=inputs->GetInput(InversionCostFunctionsCoefficientsEnum);                _assert_(weights_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+@@ -3655,7 +3655,7 @@
+ 	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=matice->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
++	Input* rheologyb_input=material->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	gauss=new GaussTria(4);
+@@ -3671,7 +3671,7 @@
+ 		adjointy_input->GetInputDerivativeValue(&dadjy[0],&xyz_list[0][0],gauss);
+ 
+ 		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityComplement(&viscosity_complement,&epsilon[0]);
++		material->GetViscosityComplement(&viscosity_complement,&epsilon[0]);
+ 
+ 		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+ 		GetNodalFunctions(basis,gauss);
+@@ -3712,7 +3712,7 @@
+ 	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* rheologyz_input=matice->inputs->GetInput(MaterialsRheologyZbarEnum); _assert_(rheologyz_input);
++	Input* rheologyz_input=material->inputs->GetInput(MaterialsRheologyZbarEnum); _assert_(rheologyz_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	gauss=new GaussTria(4);
+@@ -3728,7 +3728,7 @@
+ 		adjointy_input->GetInputDerivativeValue(&dadjy[0],&xyz_list[0][0],gauss);
+ 
+ 		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityZComplement(&viscosity_complement,&epsilon[0]);
++		material->GetViscosityZComplement(&viscosity_complement,&epsilon[0]);
+ 
+ 		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+ 		GetNodalFunctions(basis,gauss);
+@@ -4012,7 +4012,7 @@
+ 	/*Retrieve all inputs we will be needing: */
+ 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+ 	Input* weights_input  =inputs->GetInput(InversionCostFunctionsCoefficientsEnum);              _assert_(weights_input);
+-	Input* rheologyb_input=matice->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
++	Input* rheologyb_input=material->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
+ 
+ 	/* Start looping on the number of gaussian points: */
+ 	gauss=new GaussTria(2);
+@@ -5109,7 +5109,7 @@
+ 
+ 		thickness_input->GetInputValue(&thickness, gauss);
+ 		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosity2dDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		material->GetViscosity2dDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+ 		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+ 		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+ 
+@@ -5215,7 +5215,7 @@
+ 
+ 	/*Get input (either in element or material)*/
+ 	if(control_enum==MaterialsRheologyBbarEnum || control_enum==MaterialsRheologyZbarEnum){
+-		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
++		input=(Input*)material->inputs->GetInput(control_enum); _assert_(input);
+ 	}
+ 	else{
+ 		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+@@ -5250,7 +5250,7 @@
+ 	new_input = new TriaP1Input(control_enum,values);
+ 
+ 	if(control_enum==MaterialsRheologyBbarEnum || control_enum==MaterialsRheologyZbarEnum){
+-		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
++		input=(Input*)material->inputs->GetInput(control_enum); _assert_(input);
+ 	}
+ 	else{
+ 		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp	(revision 13129)
+@@ -24,7 +24,7 @@
+ TriaHook::TriaHook(){
+ 	numanalyses=UNDEF;
+ 	this->hnodes=NULL;
+-	this->hmatice=NULL;
++	this->hmaterial=NULL;
+ 	this->hmatpar=NULL;
+ }
+ /*}}}*/
+@@ -36,13 +36,13 @@
+ 		if (this->hnodes[i]) delete this->hnodes[i];
+ 	}
+ 	delete [] this->hnodes;
+-	delete hmatice;
++	delete hmaterial;
+ 	delete hmatpar;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaHook::TriaHook(int in_numanalyses,int matice_id, int matpar_id){{{*/
+-TriaHook::TriaHook(int in_numanalyses,int matice_id, IoModel* iomodel){
++/*FUNCTION TriaHook::TriaHook(int in_numanalyses,int material_id, int matpar_id){{{*/
++TriaHook::TriaHook(int in_numanalyses,int material_id, IoModel* iomodel){
+ 
+ 	/*intermediary: */
+ 	int matpar_id;
+@@ -52,7 +52,7 @@
+ 	
+ 	this->numanalyses=in_numanalyses;
+ 	this->hnodes= new Hook*[in_numanalyses];
+-	this->hmatice=new Hook(&matice_id,1);
++	this->hmaterial=new Hook(&material_id,1);
+ 	this->hmatpar=new Hook(&matpar_id,1);
+ 
+ 	//Initialize hnodes as NULL
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 13129)
+@@ -14,7 +14,7 @@
+ class Inputs;
+ class IoModel;
+ class Node;
+-class Matice;
++class Material;
+ class Matpar;
+ class ElementMatrix;
+ class ElementVector;
+@@ -32,7 +32,7 @@
+ 		int  sid;
+ 
+ 		Node   **nodes;    // 3 nodes
+-		Matice  *matice;   // 1 material ice
++		Material  *material;   // 1 material ice
+ 		Matpar  *matpar;   // 1 material parameter
+ 		int      horizontalneighborsids[3];
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h	(revision 13129)
+@@ -13,13 +13,13 @@
+ 	public: 
+ 		int    numanalyses; //number of analysis types
+ 		Hook** hnodes; // 3 nodes for each analysis type
+-		Hook*  hmatice; // 1 ice material
++		Hook*  hmaterial; // 1 ice material
+ 		Hook*  hmatpar; // 1 material parameter
+ 
+ 
+ 		/*FUNCTION constructors, destructors {{{*/
+ 		TriaHook();
+-		TriaHook(int in_numanalyses,int matice_id, IoModel* iomodel);
++		TriaHook(int in_numanalyses,int material_id, IoModel* iomodel);
+ 		~TriaHook();
+ 		void SetHookNodes(int* node_ids,int analysis_counter);
+ 		/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13129)
+@@ -29,7 +29,7 @@
+ 	int i;
+ 
+ 	this->nodes=NULL;
+-	this->matice=NULL;
++	this->material=NULL;
+ 	this->matpar=NULL;
+ 	this->verticalneighbors=NULL;
+ 	this->inputs=NULL;
+@@ -48,7 +48,7 @@
+ /*FUNCTION Penta::Penta(int id, int index, IoModel* iomodel,int nummodels) {{{*/
+ Penta::Penta(int penta_id, int penta_sid, int index, IoModel* iomodel,int nummodels)
+ 	:PentaRef(nummodels)
+-	,PentaHook(nummodels,index+1,iomodel) //index+1: matice id, iomodel->numberofelements+1: matpar id
++	,PentaHook(nummodels,index+1,iomodel) //index+1: material id, iomodel->numberofelements+1: matpar id
+                                                                       { //i is the element index
+ 
+ 	int i;
+@@ -84,7 +84,7 @@
+ 	
+ 	/*initialize pointers:*/
+ 	this->nodes=NULL;
+-	this->matice=NULL;
++	this->material=NULL;
+ 	this->matpar=NULL;
+ 	this->verticalneighbors=NULL;
+ }
+@@ -106,7 +106,7 @@
+ 	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->hmatice=(Hook*)this->hmatice->copy();
++	penta->hmaterial=(Hook*)this->hmaterial->copy();
+ 	penta->hmatpar=(Hook*)this->hmatpar->copy();
+ 	penta->hneighbors=(Hook*)this->hneighbors->copy();
+ 
+@@ -131,7 +131,7 @@
+ 	/*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->matice=(Matice*)penta->hmatice->delivers();
++	penta->material=(Material*)penta->hmaterial->delivers();
+ 	penta->matpar=(Matpar*)penta->hmatpar->delivers();
+ 	penta->verticalneighbors=(Penta**)penta->hneighbors->deliverp();
+ 
+@@ -285,7 +285,7 @@
+ 
+ 		/*Compute strain rate viscosity and pressure: */
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 		pressure_input->GetInputValue(&pressure,gauss);
+ 
+ 		/*Compute Stress*/
+@@ -352,7 +352,7 @@
+ 
+ 		/*Compute strain rate viscosity and pressure: */
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3d(&viscosity,&epsilon[0]);
++		material->GetViscosity3d(&viscosity,&epsilon[0]);
+ 		pressure_input->GetInputValue(&pressure,gauss);
+ 
+ 		/*Compute Stress*/
+@@ -390,14 +390,14 @@
+ 	/*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);
+-	this->hmatice->configure(materialsin);
++	this->hmaterial->configure(materialsin);
+ 	this->hmatpar->configure(materialsin);
+ 	this->hneighbors->configure(elementsin);
+ 
+ 	/*Now, go pick up the objects inside the hooks: */
+ 	if (this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
+ 	else this->nodes=NULL;
+-	this->matice=(Matice*)this->hmatice->delivers();
++	this->material=(Material*)this->hmaterial->delivers();
+ 	this->matpar=(Matpar*)this->hmatpar->delivers();
+ 	this->verticalneighbors=(Penta**)this->hneighbors->deliverp();
+ 
+@@ -418,7 +418,7 @@
+ 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 
+ 	/*Checks in debugging {{{*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
++	_assert_(this->nodes && this->material && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
+ 	/*}}}*/
+ 	
+ 	/*Skip if water element*/
+@@ -489,7 +489,7 @@
+ 
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementMatrix* Ke=tria->CreateKMatrixPrognostic();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*Delete Vx and Vy averaged*/
+ 	this->inputs->DeleteInput(VxAverageEnum);
+@@ -506,7 +506,7 @@
+ 
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementMatrix* Ke=tria->CreateMassMatrix();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*clean up and return*/
+ 	return Ke;
+@@ -521,7 +521,7 @@
+ 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 
+ 	/*if debugging mode, check that all pointers exist {{{*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
++	_assert_(this->nodes && this->material && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
+ 	/*}}}*/
+ 
+ 	/*Skip if water element*/
+@@ -590,7 +590,7 @@
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementVector* pe=tria->CreatePVectorPrognostic();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*Delete Vx and Vy averaged*/
+ 	this->inputs->DeleteInput(VxAverageEnum);
+@@ -608,7 +608,7 @@
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementVector* pe=tria->CreatePVectorSlope();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*clean up and return*/
+ 	return pe;
+@@ -623,7 +623,7 @@
+ 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 
+ 	/*Checks in debugging {{{*/
+-	_assert_(this->nodes && this->matice && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
++	_assert_(this->nodes && this->material && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
+ 	/*}}}*/
+ 
+ 	/*Skip if water element*/
+@@ -660,7 +660,7 @@
+ 	nodes[3]->DeepEcho();
+ 	nodes[4]->DeepEcho();
+ 	nodes[5]->DeepEcho();
+-	matice->DeepEcho();
++	material->DeepEcho();
+ 	matpar->DeepEcho();
+ 	_printLine_("   neighbor ids: " << verticalneighbors[0]->Id() << "-" << verticalneighbors[1]->Id());
+ 	_printLine_("   parameters");
+@@ -1387,7 +1387,7 @@
+ 		if (object_enum==MeshElementsEnum)
+ 		 original_input=(Input*)penta->inputs->GetInput(enum_type);
+ 		else if (object_enum==MaterialsEnum)
+-		 original_input=(Input*)penta->matice->inputs->GetInput(enum_type);
++		 original_input=(Input*)penta->material->inputs->GetInput(enum_type);
+ 		else
+ 		 _error_("object " << EnumToStringx(object_enum) << " not supported yet");
+ 		if(!original_input) _error_("could not find input with enum " << EnumToStringx(enum_type));
+@@ -1447,7 +1447,7 @@
+ 	if (object_enum==MeshElementsEnum)
+ 	 this->inputs->AddInput((Input*)depth_averaged_input);
+ 	else if (object_enum==MaterialsEnum)
+-	 this->matice->inputs->AddInput((Input*)depth_averaged_input);
++	 this->material->inputs->AddInput((Input*)depth_averaged_input);
+ 	else
+ 	 _error_("object " << EnumToStringx(object_enum) << " not supported yet");
+ }
+@@ -1480,7 +1480,7 @@
+ 	else if (object_type==MaterialsEnum){
+ 		num_inputs=1;
+ 		base_inputs=xNew<Input*>(num_inputs);
+-		base_inputs[0]=(Input*)matice->inputs->GetInput(enum_type);
++		base_inputs[0]=(Input*)material->inputs->GetInput(enum_type);
+ 	}
+ 	else if (object_type==NodeEnum){
+ 		num_inputs=3; //only the three upper nodes
+@@ -1514,7 +1514,7 @@
+ 				penta->inputs->AddInput((Input*)copy);
+ 			}
+ 			else if(object_type==MaterialsEnum){
+-				penta->matice->inputs->AddInput((Input*)copy);
++				penta->material->inputs->AddInput((Input*)copy);
+ 			}
+ 			else if(object_type==NodeEnum){
+ 				penta->nodes[i+3]->inputs->AddInput((Input*)copy); //change only the three upper nodes
+@@ -1553,8 +1553,8 @@
+ 	Input *input = NULL;
+ 
+ 	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
+-	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyBEnum);
+-	else if (enum_type==MaterialsRheologyZbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyZEnum);
++	if (enum_type==MaterialsRheologyBbarEnum) input=this->material->inputs->GetInput(MaterialsRheologyBEnum);
++	else if (enum_type==MaterialsRheologyZbarEnum) input=this->material->inputs->GetInput(MaterialsRheologyZEnum);
+ 	else input=this->inputs->GetInput(enum_type);
+ 	//if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found in penta->inputs"); why error out? if the requested input does not exist, we should still 
+ 	//try and output whatever we can instead of just failing.
+@@ -1668,7 +1668,7 @@
+ 					break;
+ 				case MaterialsRheologyBbarEnum:
+ 				case MaterialsRheologyZbarEnum:
+-					/*Matice will take care of it*/ break;
++					/*Material will take care of it*/ break;
+ 				default:
+ 					_error_("Control " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])) << " not implemented yet");
+ 			}
+@@ -1964,7 +1964,7 @@
+ 
+ 				/*update input*/
+ 				if (name==MaterialsRheologyZEnum || name==MaterialsRheologyZbarEnum){
+-					matice->inputs->AddInput(new PentaP1Input(name,values));
++					material->inputs->AddInput(new PentaP1Input(name,values));
+ 				}
+ 				else{
+ 					this->inputs->AddInput(new PentaP1Input(name,values));
+@@ -2636,13 +2636,13 @@
+ 	tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED)
+ 	this->SpawnTriaHook(dynamic_cast<TriaHook*>(tria),&indices[0]);
+ 
+-	/*Spawn matice*/
+-	tria->matice=NULL;
+-	tria->matice=(Matice*)this->matice->copy();
+-	delete tria->matice->inputs;
+-	tria->matice->inputs=(Inputs*)this->matice->inputs->SpawnTriaInputs(indices);
++	/*Spawn material*/
++	tria->material=NULL;
++	tria->material=(Material*)this->material->copy();
++	delete tria->material->inputs;
++	tria->material->inputs=(Inputs*)this->material->inputs->SpawnTriaInputs(indices);
+ 
+-	/*recover nodes, matice and matpar: */
++	/*recover nodes, material and matpar: */
+ 	tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp();
+ 	tria->matpar=(Matpar*)tria->hmatpar->delivers();
+ 
+@@ -2729,14 +2729,14 @@
+ 		 * and compute SurfaceArea*/
+ 		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+ 		S=tria->SurfaceArea();
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return S;
+ 	}
+ 	else{
+ 
+ 		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+ 		S=tria->SurfaceArea();
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return S;
+ 	}
+ }
+@@ -3017,7 +3017,7 @@
+ 		thickness_input->GetInputValue(&thickness,gauss);
+ 
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 		GetPhi(&phi, &epsilon[0], viscosity);
+ 		
+ 
+@@ -3127,7 +3127,7 @@
+ 	/*Spawn Tria element from the base of the Penta: */
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	mass_flux=tria->MassFlux(segment,process_units);
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*Delete Vx and Vy averaged*/
+ 	this->inputs->DeleteInput(VxAverageEnum);
+@@ -3234,10 +3234,10 @@
+ 
+ 	switch(response_enum){
+ 		case MaterialsRheologyBbarEnum:
+-			*presponse=this->matice->GetBbar();
++			*presponse=this->material->GetBbar();
+ 			break;
+ 		case MaterialsRheologyZbarEnum:
+-			*presponse=this->matice->GetZbar();
++			*presponse=this->material->GetZbar();
+ 			break;
+ 		case VelEnum:
+ 			{
+@@ -3530,7 +3530,7 @@
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementMatrix* Ke=tria->CreateKMatrixMelting();
+ 
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 	return Ke;
+ }
+ /*}}}*/
+@@ -3829,7 +3829,7 @@
+ 		GetNodalFunctionsP1(&L[0], gauss);
+ 
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 		GetPhi(&phi, &epsilon[0], viscosity);
+ 
+ 		scalar_def=phi/rho_ice*Jdet*gauss->weight;
+@@ -4085,7 +4085,7 @@
+ 		GetNodalFunctionsP1(&L[0], gauss);
+ 
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 		GetPhi(&phi, &epsilon[0], viscosity);
+ 
+ 		scalar_def=phi/(rho_ice*heatcapacity)*Jdet*gauss->weight;
+@@ -4355,15 +4355,15 @@
+ 			case PatersonEnum:
+ 				B_average=Paterson((values[0]+values[1]+values[2]+values[3]+values[4]+values[5])/6.0);
+ 				for(i=0;i<numdof;i++) B[i]=B_average;
+-				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
++				this->material->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
+ 				break;
+ 			case ArrheniusEnum:
+ 				surface_input->GetInputAverage(&s_average);
+ 				B_average=Arrhenius((values[0]+values[1]+values[2]+values[3]+values[4]+values[5])/6.0,
+ 							s_average-((xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2]+xyz_list[3][2]+xyz_list[4][2]+xyz_list[5][2])/6.0),
+-							matice->GetN());
++							material->GetN());
+ 				for(i=0;i<numdof;i++) B[i]=B_average;
+-				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
++				this->material->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
+ 				break;
+ 			default:
+ 				_error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
+@@ -4433,15 +4433,15 @@
+ 			case PatersonEnum:
+ 				B_average=Paterson((temperatures[0]+temperatures[1]+temperatures[2]+temperatures[3]+temperatures[4]+temperatures[5])/6.0);
+ 				for(i=0;i<numdof;i++) B[i]=B_average;
+-				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
++				this->material->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
+ 				break;
+ 			case ArrheniusEnum:
+ 				surface_input->GetInputAverage(&s_average);
+ 				B_average=Arrhenius((temperatures[0]+temperatures[1]+temperatures[2]+temperatures[3]+temperatures[4]+temperatures[5])/6.0,
+ 							s_average-((xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2]+xyz_list[3][2]+xyz_list[4][2]+xyz_list[5][2])/6.0),
+-							matice->GetN());
++							material->GetN());
+ 				for(i=0;i<numdof;i++) B[i]=B_average;
+-				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
++				this->material->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
+ 				break;
+ 			default:
+ 				_error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
+@@ -4467,11 +4467,11 @@
+ 
+ 	if(enum_type==MaterialsRheologyBbarEnum){
+ 		if(!IsOnBed()) return;
+-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
++		input=(Input*)material->inputs->GetInput(MaterialsRheologyBEnum);
+ 	}
+ 	else if(enum_type==MaterialsRheologyZbarEnum){
+ 		if(!IsOnBed()) return;
+-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyZEnum);
++		input=(Input*)material->inputs->GetInput(MaterialsRheologyZEnum);
+ 	}
+ 		
+ 	else{
+@@ -4490,10 +4490,10 @@
+ 	Input* input=NULL;
+ 
+ 	if(enum_type==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
++		input=(Input*)material->inputs->GetInput(MaterialsRheologyBEnum);
+ 	}
+ 	else if(enum_type==MaterialsRheologyZbarEnum){
+-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyZEnum);
++		input=(Input*)material->inputs->GetInput(MaterialsRheologyZEnum);
+ 	}
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+@@ -4512,10 +4512,10 @@
+ 	Input* input=NULL;
+ 
+ 	if(enum_type==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
++		input=(Input*)material->inputs->GetInput(MaterialsRheologyBEnum);
+ 	}
+ 	else if(enum_type==MaterialsRheologyZbarEnum){
+-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyZEnum);
++		input=(Input*)material->inputs->GetInput(MaterialsRheologyZEnum);
+ 	}
+ 	else{
+ 		input=inputs->GetInput(enum_type);
+@@ -4557,23 +4557,28 @@
+ 	  the stiffness matrix. */
+ 	if (!IsOnBed()) return NULL;
+ 
+-	/*Depth Averaging B*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++	/*Depth average some fields*/
++	switch(this->material->ObjectEnum()){
++		case MaticeEnum:
++			this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++			break;
++		case MatdamageiceEnum:
++			this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++			this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
++			break;
++		default:
++			_error_("material "<<EnumToStringx(this->material->ObjectEnum())<<" not supported");
++	}
+ 
+-	/*Depth Averaging Z*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
+-
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementMatrix* Ke=tria->CreateKMatrixAdjointMacAyeal();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+-	/*Delete B averaged*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++	/*Delete averaged fields*/
++	this->material->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++	this->material->inputs->DeleteInput(MaterialsRheologyZbarEnum);
+ 
+-	/*Delete Z averaged*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyZbarEnum);
+-
+ 	/*clean up and return*/
+ 	return Ke;
+ }
+@@ -4618,7 +4623,7 @@
+ 		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+ 
+ 		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		material->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+ 		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+ 		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+ 		eps1[2]=epsilon[3];                eps2[2]=epsilon[4];
+@@ -4688,7 +4693,7 @@
+ 		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+ 
+ 		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		material->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+ 		eps1[0]=epsilon[0];   eps2[0]=epsilon[2];   eps3[0]=epsilon[3];
+ 		eps1[1]=epsilon[2];   eps2[1]=epsilon[1];   eps3[1]=epsilon[4];
+ 		eps1[2]=epsilon[3];   eps2[2]=epsilon[4];   eps3[2]= -epsilon[0] -epsilon[1];
+@@ -4753,7 +4758,7 @@
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementVector* pe=tria->CreatePVectorAdjointHoriz();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*clean up and return*/
+ 	return pe;
+@@ -4767,7 +4772,7 @@
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+ 	ElementVector* pe=tria->CreatePVectorAdjointHoriz();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*clean up and return*/
+ 	return pe;
+@@ -4781,7 +4786,7 @@
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+ 	ElementVector* pe=tria->CreatePVectorAdjointStokes();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*clean up and return*/
+ 	return pe;
+@@ -4878,13 +4883,13 @@
+ 			if (!IsOnBed()) return;
+ 			tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 			tria->GradjDragGradient(gradient,resp,control_index);
+-			delete tria->matice; delete tria;
++			delete tria->material; delete tria;
+ 			break;
+ 		case RheologyBbarAbsGradientEnum:
+ 			if (!IsOnBed()) return;
+ 			tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 			tria->GradjBGradient(gradient,resp,control_index);
+-			delete tria->matice; delete tria;
++			delete tria->material; delete tria;
+ 			break;
+ 		default:
+ 			_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+@@ -4901,7 +4906,7 @@
+ 	/*Spawn tria*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	tria->GradjDragMacAyeal(gradient,control_index);
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ } /*}}}*/
+ /*FUNCTION Penta::GradjDragPattyn {{{*/
+@@ -5079,10 +5084,10 @@
+ 	/*Collapse element to the base*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+ 	tria->GradjBMacAyeal(gradient,control_index);
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*delete Average B*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++	this->material->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+ 
+ } /*}}}*/
+ /*FUNCTION Penta::GradjBbarPattyn {{{*/
+@@ -5097,10 +5102,10 @@
+ 	/*Collapse element to the base*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2);
+ 	tria->GradjBMacAyeal(gradient,control_index);    //We use MacAyeal as an estimate for now
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*delete Average B*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++	this->material->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+ } /*}}}*/
+ /*FUNCTION Penta::GradjBbarStokes {{{*/
+ void  Penta::GradjBbarStokes(Vector* gradient,int control_index){
+@@ -5114,10 +5119,10 @@
+ 	/*Collapse element to the base*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2);
+ 	tria->GradjBMacAyeal(gradient,control_index);    //We use MacAyeal as an estimate for now
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*delete Average B*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++	this->material->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+ } /*}}}*/
+ /*FUNCTION Penta::InputControlUpdate{{{*/
+ void  Penta::InputControlUpdate(IssmDouble scalar,bool save_parameter){
+@@ -5135,11 +5140,11 @@
+ 
+ 		if(control_type[i]==MaterialsRheologyBbarEnum){
+ 			if (!IsOnBed()) goto cleanup_and_return;
+-			input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum); _assert_(input);
++			input=(Input*)material->inputs->GetInput(MaterialsRheologyBEnum); _assert_(input);
+ 		}
+ 		else if(control_type[i]==MaterialsRheologyZbarEnum){
+ 			if (!IsOnBed()) goto cleanup_and_return;
+-			input=(Input*)matice->inputs->GetInput(MaterialsRheologyZEnum); _assert_(input);
++			input=(Input*)material->inputs->GetInput(MaterialsRheologyZEnum); _assert_(input);
+ 		}
+ 		else{
+ 			input=(Input*)this->inputs->GetInput(control_type[i]); _assert_(input);
+@@ -5267,14 +5272,14 @@
+ 		 * and compute SurfaceAverageVelMisfit*/
+ 		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+ 		J=tria->SurfaceAverageVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return J;
+ 	}
+ 	else{
+ 
+ 		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+ 		J=tria->SurfaceAverageVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return J;
+ 	}
+ }
+@@ -5304,14 +5309,14 @@
+ 		 * and compute SurfaceAbsVelMisfit*/
+ 		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+ 		J=tria->SurfaceAbsVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return J;
+ 	}
+ 	else{
+ 
+ 		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+ 		J=tria->SurfaceAbsVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return J;
+ 	}
+ }
+@@ -5341,14 +5346,14 @@
+ 		 * and compute SurfaceLogVelMisfit*/
+ 		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+ 		J=tria->SurfaceLogVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return J;
+ 	}
+ 	else{
+ 
+ 		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+ 		J=tria->SurfaceLogVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return J;
+ 	}
+ }
+@@ -5380,14 +5385,14 @@
+ 		 * and compute SurfaceLogVxVyMisfit*/
+ 		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+ 		J=tria->SurfaceLogVxVyMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return J;
+ 	}
+ 	else{
+ 
+ 		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+ 		J=tria->SurfaceLogVxVyMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return J;
+ 	}
+ }
+@@ -5417,14 +5422,14 @@
+ 		 * and compute SurfaceRelVelMisfit*/
+ 		tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
+ 		J=tria->SurfaceRelVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return J;
+ 	}
+ 	else{
+ 
+ 		tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).
+ 		J=tria->SurfaceRelVelMisfit(process_units,weight_index);
+-		delete tria->matice; delete tria;
++		delete tria->material; delete tria;
+ 		return J;
+ 	}
+ }
+@@ -5451,7 +5456,7 @@
+ 
+ 	tria=(Tria*)SpawnTria(0,1,2);
+ 	J=tria->ThicknessAbsMisfit(process_units,weight_index);
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 	return J;
+ }
+ /*}}}*/
+@@ -5466,7 +5471,7 @@
+ 
+ 	tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria
+ 	J=tria->DragCoefficientAbsGradient(process_units,weight_index);
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 	return J;
+ }
+ /*}}}*/
+@@ -5481,7 +5486,7 @@
+ 
+ 	tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria
+ 	J=tria->RheologyBbarAbsGradient(process_units,weight_index);
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 	return J;
+ }
+ /*}}}*/
+@@ -5530,7 +5535,7 @@
+ 
+ 
+ 	if(control_enum==MaterialsRheologyBbarEnum){
+-		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
++		input=(Input*)material->inputs->GetInput(control_enum); _assert_(input);
+ 	}
+ 	else{
+ 		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+@@ -5825,8 +5830,8 @@
+ 
+ 		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+ 		this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
+-		matice->GetViscosity3d(&viscosity, &epsilon[0]);
+-		matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
++		material->GetViscosity3d(&viscosity, &epsilon[0]);
++		material->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
+ 
+ 		newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
+ 		D_scalar=2*newviscosity*gauss->weight*Jdet;
+@@ -5846,7 +5851,7 @@
+ 	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
+ 
+ 	/*Clean-up and return*/
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 	delete gauss;
+ 	delete gauss_tria;
+ 	return Ke;
+@@ -6035,7 +6040,7 @@
+ 		GetBprimeMacAyealStokes(&Bprime2[0][0], &xyz_list[0][0], gauss);
+ 
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity, &epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity, &epsilon[0]);
+ 
+ 		D_scalar=2*viscosity*gauss->weight*Jdet;
+ 		for (i=0;i<3;i++) D[i][i]=D_scalar;
+@@ -6062,7 +6067,7 @@
+ 	TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
+ 
+ 	/*Clean-up and return*/
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 	delete gauss;
+ 	delete gauss_tria;
+ 	return Ke;
+@@ -6142,7 +6147,7 @@
+ 		GetLprimeStokesMacAyeal(&LprimeStokesMacAyeal[0][0], &xyz_list[0][0], gauss);
+ 
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 
+ 		BedNormal(&bed_normal[0],xyz_list_tria);
+ 		friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum);
+@@ -6334,23 +6339,28 @@
+ 	  the stiffness matrix. */
+ 	if (!IsOnBed()) return NULL;
+ 
+-	/*Depth Averaging B*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++	/*Depth average some fields*/
++	switch(this->material->ObjectEnum()){
++		case MaticeEnum:
++			this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++			break;
++		case MatdamageiceEnum:
++			this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++			this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
++			break;
++		default:
++			_error_("material "<<EnumToStringx(this->material->ObjectEnum())<<" not supported");
++	}
+ 
+-	/*Depth Averaging Z*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
+-
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyeal();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+-	/*Delete B averaged*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++	/*Delete averaged fields*/
++	this->material->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++	this->material->inputs->DeleteInput(MaterialsRheologyZbarEnum);
+ 
+-	/*Delete Z averaged*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyZbarEnum);
+-
+ 	/*clean up and return*/
+ 	return Ke;
+ }
+@@ -6424,14 +6434,14 @@
+ 		if(approximation==MacAyealPattynApproximationEnum){
+ 			this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+ 			this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
+-			matice->GetViscosity3d(&viscosity, &epsilon[0]);
+-			matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
++			material->GetViscosity3d(&viscosity, &epsilon[0]);
++			material->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
+ 
+ 			newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
+ 		}
+ 		else if (approximation==MacAyealStokesApproximationEnum){
+ 			this->GetStrainRate3d(&epsilons[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-			matice->GetViscosity3dStokes(&newviscosity,&epsilons[0]);
++			material->GetViscosity3dStokes(&newviscosity,&epsilons[0]);
+ 		}
+ 		else _error_("approximation " << approximation << " (" << EnumToStringx(approximation) << ") not supported yet");
+ 
+@@ -6450,7 +6460,7 @@
+ 	TransformStiffnessMatrixCoord(Ke,tria->nodes,NUMVERTICES2D,XYEnum);
+ 
+ 	/*Clean up and return*/
+-	delete tria->matice;
++	delete tria->material;
+ 	delete tria;
+ 	delete gauss_tria;
+ 	delete gauss;
+@@ -6468,7 +6478,7 @@
+ 	 * nodes: */
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyealFriction();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*clean-up and return*/
+ 	return Ke;
+@@ -6581,7 +6591,7 @@
+ 	TransformStiffnessMatrixCoord(Ke,tria->nodes,NUMVERTICES2D,XYEnum);
+ 
+ 	/*Clean up and return*/
+-	delete tria->matice;
++	delete tria->material;
+ 	delete tria;
+ 	delete gauss_tria;
+ 	delete gauss;
+@@ -6599,7 +6609,7 @@
+ 	 * nodes: */
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyealFriction();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*clean-up and return*/
+ 	return Ke;
+@@ -6664,8 +6674,8 @@
+ 
+ 		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+ 		this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
+-		matice->GetViscosity3d(&viscosity, &epsilon[0]);
+-		matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
++		material->GetViscosity3d(&viscosity, &epsilon[0]);
++		material->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
+ 		newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
+ 
+ 		D_scalar=2*newviscosity*gauss->weight*Jdet;
+@@ -6828,7 +6838,7 @@
+ 		GetBprimeStokes(&B_prime[0][0],&xyz_list[0][0],gauss); 
+ 
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 
+ 		D_scalar=gauss->weight*Jdet;
+ 		for (i=0;i<6;i++) D[i][i]=D_scalar*2*viscosity;
+@@ -6899,7 +6909,7 @@
+ 		GetLStokes(&LStokes[0][0], gauss);
+ 
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 
+ 		friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum);
+ 
+@@ -7087,7 +7097,7 @@
+ 		vzmacayeal_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
+ 
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 
+ 		for(i=0;i<NUMVERTICES;i++){
+ 			pe->values[i*NDOF4+0]+=-Jdet*gauss->weight*viscosity*dw[0]*dbasis[2][i];
+@@ -7161,7 +7171,7 @@
+ 
+ 		BedNormal(&bed_normal[0],xyz_list_tria);
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 		friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum);
+ 
+ 		for(i=0;i<NUMVERTICES2D;i++){
+@@ -7238,7 +7248,7 @@
+ 		vzpattyn_input->GetInputDerivativeValue(&dw[0],&xyz_list[0][0],gauss);
+ 
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 
+ 		for(i=0;i<NUMVERTICES;i++){
+ 			pe->values[i*NDOF4+0]+=-Jdet*gauss->weight*viscosity*dw[0]*dbasis[2][i];
+@@ -7312,7 +7322,7 @@
+ 
+ 		BedNormal(&bed_normal[0],xyz_list_tria);
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 		friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum);
+ 
+ 		for(i=0;i<NUMVERTICES2D;i++){
+@@ -7434,8 +7444,8 @@
+ 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+ 	rho_ice=matpar->GetRhoIce();
+ 	gravity=matpar->GetG();
+-	n=matice->GetN();
+-	B=matice->GetB();
++	n=material->GetN();
++	B=material->GetB();
+ 	Input* thickness_input=inputs->GetInput(ThicknessEnum);  _assert_(thickness_input);
+ 	Input* surface_input=inputs->GetInput(SurfaceEnum);      _assert_(surface_input);
+ 	Input* slopex_input=inputs->GetInput(SurfaceSlopeXEnum); _assert_(slopex_input);
+@@ -7503,7 +7513,7 @@
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementVector* pe=tria->CreatePVectorDiagnosticMacAyeal();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*Clean up and return*/
+ 	return pe;
+@@ -7517,7 +7527,7 @@
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementVector* pe=tria->CreatePVectorDiagnosticMacAyeal();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*Clean up and return*/
+ 	return pe;
+@@ -7635,7 +7645,7 @@
+ 		GetNodalFunctionsMINI(&l1l7[0], gauss);
+ 
+ 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
++		material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
+ 
+ 		for(i=0;i<NUMVERTICES+1;i++){
+ 			Pe_gaussian[i*NDOF4+2]+=-rho_ice*gravity*Jdet*gauss->weight*l1l7[i];
+@@ -7896,23 +7906,28 @@
+ 	  the stiffness matrix. */
+ 	if (!IsOnBed()) return NULL;
+ 
+-	/*Depth Averaging B*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++	/*Depth average some fields*/
++	switch(this->material->ObjectEnum()){
++		case MaticeEnum:
++			this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++			break;
++		case MatdamageiceEnum:
++			this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
++			this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
++			break;
++		default:
++			_error_("material "<<EnumToStringx(this->material->ObjectEnum())<<" not supported");
++	}
+ 
+-	/*Depth Averaging Z*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
+-
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementMatrix* Ke=tria->CreateJacobianDiagnosticMacayeal();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+-	/*Delete B averaged*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++	/*Delete averaged inputs*/
++	this->material->inputs->DeleteInput(MaterialsRheologyBbarEnum);
++	this->material->inputs->DeleteInput(MaterialsRheologyZbarEnum);
+ 
+-	/*Delete Z averaged*/
+-	this->matice->inputs->DeleteInput(MaterialsRheologyZbarEnum);
+-
+ 	/*clean up and return*/
+ 	return Ke;
+ }
+@@ -7954,7 +7969,7 @@
+ 		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+ 
+ 		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		material->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+ 		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+ 		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+ 		eps1[2]=epsilon[3];                eps2[2]=epsilon[4];
+@@ -8021,7 +8036,7 @@
+ 		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+ 
+ 		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
++		material->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+ 		eps1[0]=epsilon[0];   eps2[0]=epsilon[2];   eps3[0]=epsilon[3];
+ 		eps1[1]=epsilon[2];   eps2[1]=epsilon[1];   eps3[1]=epsilon[4];
+ 		eps1[2]=epsilon[3];   eps2[2]=epsilon[4];   eps3[2]= -epsilon[0] -epsilon[1];
+@@ -8263,8 +8278,8 @@
+ 	}
+ 
+ 	/*Get A*/
+-	_assert_(matice->GetN()==3.0);
+-	A=matice->GetA();
++	_assert_(material->GetN()==3.0);
++	A=material->GetA();
+ 
+ 	/*Solve for tau_perp (http://fr.wikipedia.org/wiki/Méthode_de_Cardan)*/
+ 	p     = tau_perp *tau_perp;
+@@ -9084,7 +9099,7 @@
+ 	/*Spawn Tria element from the base of the Penta: */
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementMatrix* Ke=tria->CreateKMatrixBalancethickness();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*Delete Vx and Vy averaged*/
+ 	this->inputs->DeleteInput(VxAverageEnum);
+@@ -9106,7 +9121,7 @@
+ 	/*Call Tria function*/
+ 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+ 	ElementVector* pe=tria->CreatePVectorBalancethickness();
+-	delete tria->matice; delete tria;
++	delete tria->material; delete tria;
+ 
+ 	/*Delete Vx and Vy averaged*/
+ 	this->inputs->DeleteInput(VxAverageEnum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp	(revision 13129)
+@@ -24,7 +24,7 @@
+ PentaHook::PentaHook(){
+ 	numanalyses=UNDEF;
+ 	this->hnodes=NULL;
+-	this->hmatice=NULL;
++	this->hmaterial=NULL;
+ 	this->hmatpar=NULL;
+ 	this->hneighbors=NULL;
+ }
+@@ -38,13 +38,13 @@
+ 		if (this->hnodes[i]) delete this->hnodes[i];
+ 	}
+ 	delete [] this->hnodes;
+-	delete hmatice;
++	delete hmaterial;
+ 	delete hmatpar;
+ 	delete hneighbors;
+ }
+ /*}}}*/
+-/*FUNCTION PentaHook::PentaHook(int in_numanalyses,int matice_id, int matpar_id){{{*/
+-PentaHook::PentaHook(int in_numanalyses,int matice_id, IoModel* iomodel){
++/*FUNCTION PentaHook::PentaHook(int in_numanalyses,int material_id, int matpar_id){{{*/
++PentaHook::PentaHook(int in_numanalyses,int material_id, IoModel* iomodel){
+ 
+ 	/*intermediary: */
+ 	int matpar_id;
+@@ -54,7 +54,7 @@
+ 
+ 	this->numanalyses=in_numanalyses;
+ 	this->hnodes=new Hook*[in_numanalyses];
+-	this->hmatice=new Hook(&matice_id,1);
++	this->hmaterial=new Hook(&material_id,1);
+ 	this->hmatpar=new Hook(&matpar_id,1);
+ 	this->hneighbors=NULL; 
+ 
+@@ -97,8 +97,8 @@
+ 			triahook->hnodes[i]=this->hnodes[i]->Spawn(indices,3);
+ 		}
+ 	}
+-	// do not spawn hmatice. matice will be taken care of by Penta
+-	triahook->hmatice=NULL;
++	// do not spawn hmaterial. material will be taken care of by Penta
++	triahook->hmaterial=NULL;
+ 	triahook->hmatpar=(Hook*)this->hmatpar->copy();
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 13129)
+@@ -15,7 +15,7 @@
+ class Inputs;
+ class IoModel;
+ class Node;
+-class Matice;
++class Material;
+ class Matpar;
+ class Tria;
+ class ElementMatrix;
+@@ -34,7 +34,7 @@
+ 		int          sid;
+ 
+ 		Node       **nodes;        // 6 nodes
+-		Matice      *matice;       // 1 material ice
++		Material    *material;       // 1 material ice
+ 		Matpar      *matpar;       // 1 material parameter
+ 		Penta      **verticalneighbors;   // 2 neighbors: first one under, second one above
+ 		int          horizontalneighborsids[3];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h	(revision 13128)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h	(revision 13129)
+@@ -14,13 +14,13 @@
+ 	public: 
+ 		int   numanalyses; //number of analysis types
+ 		Hook** hnodes; // 6 nodes for each analysis type
+-		Hook*  hmatice; // 1 ice material
++		Hook*  hmaterial; // 1 ice material
+ 		Hook*  hmatpar; // 1 material parameter
+ 		Hook*  hneighbors; // 2 elements, first down, second up
+ 
+ 		/*FUNCTION constructors, destructors {{{*/
+ 		PentaHook();
+-		PentaHook(int in_numanalyses,int matice_id, IoModel* iomodel);
++		PentaHook(int in_numanalyses,int material_id, IoModel* iomodel);
+ 		~PentaHook();
+ 		void SetHookNodes(int* node_ids,int analysis_counter);
+ 		void SpawnTriaHook(TriaHook* triahook,int* indices);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13129-13130.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13129-13130.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13129-13130.diff	(revision 13394)
@@ -0,0 +1,976 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp	(revision 13130)
+@@ -0,0 +1,896 @@
++/*!\file Matdamageice.c
++ * \brief: implementation of the Matdamageice object
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include "../../classes.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++		
++/*Matdamageice constructors and destructor*/
++/*FUNCTION Matdamageice::Matdamageice(){{{*/
++Matdamageice::Matdamageice(){
++	this->inputs=NULL;
++	this->helement=NULL;
++	return;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::Matdamageice(int id, int index, IoModel* iomodel, int num_vertices){{{*/
++Matdamageice::Matdamageice(int matice_mid,int index, IoModel* iomodel){
++
++	/*Intermediaries:*/
++	int    i;
++	int    matice_eid;
++
++	/*Initialize id*/
++	this->mid=matice_mid;
++
++	/*Initialize inputs*/
++	this->inputs=new Inputs();
++
++	/*Initialize inputs from IoModel*/
++	this->InputUpdateFromIoModel(index,iomodel);
++
++	/*Hooks: */
++	matice_eid=index+1;
++	this->helement=new Hook(&matice_eid,1);
++
++	return;
++
++}
++/*}}}*/
++/*FUNCTION Matdamageice::~Matdamageice(){{{*/
++Matdamageice::~Matdamageice(){
++	delete helement;
++	delete inputs;
++	return;
++}
++/*}}}*/
++
++/*Object virtual functions definitions:*/
++/*FUNCTION Matdamageice::Echo {{{*/
++void Matdamageice::Echo(void){
++
++	_printLine_("Matdamageice:");
++	_printLine_("   mid: " << mid);
++	_printLine_("   inputs:");
++	inputs->Echo();
++	_printLine_("   element:");
++	helement->Echo();
++}
++/*}}}*/
++/*FUNCTION Matdamageice::DeepEcho {{{*/
++void Matdamageice::DeepEcho(void){
++
++	_printLine_("Matdamageice:");
++	_printLine_("   mid: " << mid);
++	_printLine_("   inputs:");
++	inputs->DeepEcho();
++	_printLine_("   element:");
++	helement->Echo();
++}		
++/*}}}*/
++/*FUNCTION Matdamageice::Id {{{*/
++int    Matdamageice::Id(void){ return mid; }
++/*}}}*/
++/*FUNCTION Matdamageice::MyRank {{{*/
++int    Matdamageice::MyRank(void){ 
++	extern int my_rank;
++	return my_rank; 
++}
++/*}}}*/
++/*FUNCTION Matdamageice::ObjectEnum{{{*/
++int Matdamageice::ObjectEnum(void){
++
++	return MatdamageiceEnum;
++
++}
++/*}}}*/
++/*FUNCTION Matdamageice::copy {{{*/
++Object* Matdamageice::copy() {
++
++	/*Output*/
++	Matdamageice* matice=NULL;
++
++	/*Initialize output*/
++	matice=new Matdamageice();
++
++	/*copy fields: */
++	matice->mid=this->mid;
++	matice->helement=(Hook*)this->helement->copy();
++	if(this->inputs) matice->inputs=(Inputs*)this->inputs->Copy();
++	else  matice->inputs=new Inputs();
++
++	return matice;
++}
++/*}}}*/
++
++/*Matdamageice management*/
++/*FUNCTION Matdamageice::Configure {{{*/
++void  Matdamageice::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: */
++	helement->configure(elementsin);
++}
++/*}}}*/
++/*FUNCTION Matdamageice::SetCurrentConfiguration {{{*/
++void  Matdamageice::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetA {{{*/
++IssmDouble Matdamageice::GetA(){
++	/*
++	 * A = 1/B^n
++	 */
++
++	IssmDouble B,n;
++
++	inputs->GetInputAverage(&B,MaterialsRheologyBEnum);
++	n=this->GetN();
++
++	return pow(B,-n);
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetB {{{*/
++IssmDouble Matdamageice::GetB(){
++
++	/*Output*/
++	IssmDouble B;
++
++	inputs->GetInputAverage(&B,MaterialsRheologyBEnum);
++	return B;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetBbar {{{*/
++IssmDouble Matdamageice::GetBbar(){
++
++	/*Output*/
++	IssmDouble Bbar;
++
++	inputs->GetInputAverage(&Bbar,MaterialsRheologyBbarEnum);
++	return Bbar;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetN {{{*/
++IssmDouble Matdamageice::GetN(){
++
++	/*Output*/
++	IssmDouble n;
++
++	inputs->GetInputAverage(&n,MaterialsRheologyNEnum);
++	return n;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetZ {{{*/
++IssmDouble Matdamageice::GetZ(){
++
++	/*Output*/
++	IssmDouble Z;
++
++	inputs->GetInputAverage(&Z,MaterialsRheologyZEnum);
++	return Z;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetZbar {{{*/
++IssmDouble Matdamageice::GetZbar(){
++
++	/*Output*/
++	IssmDouble Zbar;
++
++	inputs->GetInputAverage(&Zbar,MaterialsRheologyZbarEnum);
++	return Zbar;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetVectorFromInputs{{{*/
++void  Matdamageice::GetVectorFromInputs(Vector* vector,int input_enum){
++
++	/*Intermediaries*/
++	Element *element= NULL;
++
++	/*Recover element*/
++	element=(Element*)helement->delivers();
++
++	/*Check that input_enum is a material input*/
++	if (!IsInput(input_enum)) return;
++
++	switch(element->ObjectEnum()){
++
++		case TriaEnum:{
++
++			/*Prepare index list*/
++			int doflist1[3];
++			for(int i=0;i<3;i++) doflist1[i]=((Tria*)element)->nodes[i]->GetVertexDof();
++
++			/*Get input (either in element or material)*/
++			Input* input=inputs->GetInput(input_enum);
++			if(!input) _error_("Input " << EnumToStringx(input_enum) << " not found in material");
++
++			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
++			input->GetVectorFromInputs(vector,&doflist1[0]);}
++			break;
++
++		default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetViscosity2d {{{*/
++void  Matdamageice::GetViscosity2d(IssmDouble* pviscosity, IssmDouble* epsilon){
++	/*From a string tensor and a material object, return viscosity, using Glen's flow law.
++												   Z * B
++	  viscosity= -------------------------------------------------------------------
++						  2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
++
++	  where viscosity is the viscotiy, B the flow law parameter , (u,v) the velocity 
++	  vector, and n the flow law exponent.
++
++	  If epsilon is NULL, it means this is the first time SystemMatrices is being run, and we 
++	  return 10^14, initial viscosity.
++	  */
++
++	/*output: */
++	IssmDouble viscosity;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy;
++
++	/*Intermediary: */
++	IssmDouble A,e;
++	IssmDouble Btmp,B,n,Z;
++
++	/*Get B and n*/
++	Btmp=GetBbar();
++	Z=GetZbar();
++	n=GetN();
++	B=Z*Btmp;
++
++	if (n==1){
++		/*Viscous behaviour! viscosity=B: */
++		viscosity=B/2;
++	}
++	else{
++		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0)){
++			viscosity=0.5*pow((IssmDouble)10,(IssmDouble)14);
++		}
++		else{
++			/*Retrive strain rate components: */
++			exx=*(epsilon+0);
++			eyy=*(epsilon+1);
++			exy=*(epsilon+2);
++
++			/*Build viscosity: viscosity=B/(2*A^e) */
++			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
++			if(A==0){
++				/*Maxiviscositym viscosity for 0 shear areas: */
++				viscosity=2.5*pow(10.,17.);
++			}
++			else{
++				e=(n-1)/(2*n);
++				viscosity=B/(2*pow(A,e));
++			}
++		}
++	}
++
++	/*Checks in debugging mode*/
++	if(viscosity<=0) _error_("Negative viscosity");
++	_assert_(B>0);
++	_assert_(n>0);
++
++	/*Return: */
++	*pviscosity=viscosity;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetViscosity3d {{{*/
++void  Matdamageice::GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* epsilon){
++
++	/*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]: 
++	 *
++	 *                                               B
++	 * viscosity3d= -------------------------------------------------------------------
++	 *                      2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
++	 *
++	 *     where mu is the viscotiy, B the flow law parameter , (u,v) the velocity 
++	 *     vector, and n the flow law exponent.
++	 *
++	 * If epsilon is NULL, it means this is the first time Emg is being run, and we 
++	 * return g, initial viscosity.
++	 */
++	
++	/*output: */
++	IssmDouble viscosity3d;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy,exz,eyz;
++
++	/*Intermediaries: */
++	IssmDouble A,e;
++	IssmDouble B,n,Z;
++
++	/*Get B, Z and n*/
++	n=GetN();
++	Z=GetZ();
++	B=Z*GetB();
++
++	if (n==1){
++		/*Viscous behaviour! viscosity3d=B: */
++		viscosity3d=B/2;
++	}
++	else{
++		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
++				(epsilon[3]==0) && (epsilon[4]==0)){
++			viscosity3d=0.5*pow((IssmDouble)10,(IssmDouble)14);
++		}
++		else{
++
++			/*Retrive strain rate components: */
++			exx=*(epsilon+0);
++			eyy=*(epsilon+1);
++			exy=*(epsilon+2);
++			exz=*(epsilon+3);
++			eyz=*(epsilon+4);
++
++			/*Build viscosity: viscosity3d=2*B/(2*A^e) */
++			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+pow(exz,2)+pow(eyz,2)+exx*eyy;
++			if(A==0){
++				/*Maxiviscosity3dm viscosity for 0 shear areas: */
++				viscosity3d=2.25*pow((IssmDouble)10,(IssmDouble)17);
++			}
++			else{
++				e=(n-1)/2/n;
++			
++				viscosity3d=B/(2*pow(A,e));
++			}
++		}
++	}
++
++	/*Checks in debugging mode*/
++	if(viscosity3d<=0) _error_("Negative viscosity");
++	_assert_(B>0);
++	_assert_(n>0);
++
++	/*Assign output pointers:*/
++	*pviscosity3d=viscosity3d;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetViscosity3dStokes {{{*/
++void  Matdamageice::GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon){
++	/*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]: 
++	 *
++	 *                                          B
++	 * viscosity3d= -------------------------------------------------------------------
++	 *                   2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
++	 *
++	 *     where mu is the viscotiy, B the flow law parameter , (u,v) the velocity 
++	 *     vector, and n the flow law exponent.
++	 *
++	 * If epsilon is NULL, it means this is the first time Emg is being run, and we 
++	 * return g, initial viscosity.
++	 */
++	
++	/*output: */
++	IssmDouble viscosity3d;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy,exz,eyz,ezz;
++
++	/*Intermediaries: */
++	IssmDouble A,e;
++	IssmDouble B,n,Z;
++	IssmDouble eps0;
++
++	/*Get B and n*/
++	eps0=pow((IssmDouble)10,(IssmDouble)-27);
++	n=GetN();
++	Z=GetZ();
++	B=Z*GetB();
++	
++	if (n==1){
++		/*Viscous behaviour! viscosity3d=B: */
++		viscosity3d=B/2;
++	}
++	else{
++		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
++				(epsilon[3]==0) && (epsilon[4]==0) && (epsilon[5]==0)){
++			viscosity3d=0.5*pow((IssmDouble)10,(IssmDouble)14);
++		}
++		else{
++
++			/*Retrive strain rate components: */
++			exx=*(epsilon+0);
++			eyy=*(epsilon+1);
++			ezz=*(epsilon+2); //not used
++			exy=*(epsilon+3);
++			exz=*(epsilon+4);
++			eyz=*(epsilon+5);
++
++			/*Build viscosity: viscosity3d=B/(2*A^e) */
++			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+pow(exz,2)+pow(eyz,2)+exx*eyy+pow(eps0,2);
++			if(A==0){
++				/*Maxiviscosity3dm viscosity for 0 shear areas: */
++				viscosity3d=2.25*pow((IssmDouble)10,(IssmDouble)17);
++			}
++			else{
++				e=(n-1)/2/n;
++				viscosity3d=B/(2*pow(A,e));
++			}
++		}
++	}
++
++	/*Checks in debugging mode*/
++	if(viscosity3d<=0) _error_("Negative viscosity");
++	_assert_(B>0);
++	_assert_(n>0);
++
++	/*Assign output pointers:*/
++	*pviscosity3d=viscosity3d;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetViscosityComplement {{{*/
++void  Matdamageice::GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){
++	/*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]: 
++	 *
++	 *  										                1
++	 * viscosity= -------------------------------------------------------------------
++	 *  				  2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
++	 *
++	 * If epsilon is NULL, it means this is the first time Gradjb is being run, and we 
++	 * return mu20, initial viscosity.
++	 */
++	
++	/*output: */
++	IssmDouble viscosity_complement;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy;
++
++	/*Intermediary value A and exponent e: */
++	IssmDouble A,e;
++	IssmDouble B,n;
++
++	/*Get B and n*/
++	B=GetBbar();
++	n=GetN();
++
++	if(epsilon){
++		exx=*(epsilon+0);
++		eyy=*(epsilon+1);
++		exy=*(epsilon+2);
++
++		/*Build viscosity: mu2=B/(2*A^e) */
++		A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
++		if(A==0){
++			/*Maximum viscosity_complement for 0 shear areas: */
++			viscosity_complement=2.25*pow((IssmDouble)10,(IssmDouble)17);
++		}
++		else{
++			e=(n-1)/(2*n);
++		
++			viscosity_complement=1/(2*pow(A,e));
++		}
++	}
++	else{
++		viscosity_complement=4.5*pow((IssmDouble)10,(IssmDouble)17);
++	}
++
++	/*Checks in debugging mode*/
++	_assert_(B>0);
++	_assert_(n>0);
++	_assert_(viscosity_complement>0);
++		
++	/*Return: */
++	*pviscosity_complement=viscosity_complement;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetViscosityZComplement {{{*/
++void  Matdamageice::GetViscosityZComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){
++	/*Return viscosity derivative for control method d(mu)/dZ: 
++	 *
++	 *  										               B 
++	 * dviscosity= -------------------------------------------------------------------
++	 *  				  2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
++	 *
++	 * If epsilon is NULL, it means this is the first time Gradjb is being run, and we 
++	 * return mu20, initial viscosity.
++	 */
++	
++	/*output: */
++	IssmDouble viscosity_complement;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy;
++
++	/*Intermediary value A and exponent e: */
++	IssmDouble A,e;
++	IssmDouble B,n;
++
++	/*Get B and n*/
++	B=GetBbar();
++	n=GetN();
++
++	if(epsilon){
++		exx=*(epsilon+0);
++		eyy=*(epsilon+1);
++		exy=*(epsilon+2);
++
++		/*Build viscosity: mu2=B/(2*A^e) */
++		A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
++		if(A==0){
++			/*Maximum viscosity_complement for 0 shear areas: */
++			viscosity_complement=2.25*pow((IssmDouble)10,(IssmDouble)17);
++		}
++		else{
++			e=(n-1)/(2*n);
++		
++			viscosity_complement=B/(2*pow(A,e));
++		}
++	}
++	else{
++		viscosity_complement=4.5*pow((IssmDouble)10,(IssmDouble)17);
++	}
++
++	/*Checks in debugging mode*/
++	_assert_(B>0);
++	_assert_(n>0);
++	_assert_(viscosity_complement>0);
++		
++	/*Return: */
++	*pviscosity_complement=viscosity_complement;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetViscosityDerivativeEpsSquare{{{*/
++void  Matdamageice::GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){
++
++	/*output: */
++	IssmDouble mu_prime;
++	IssmDouble mu,n,eff2;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy,exz,eyz;
++
++	/*Get visocisty and n*/
++	GetViscosity3d(&mu,epsilon);
++	n=GetN();
++
++	if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
++				(epsilon[3]==0) && (epsilon[4]==0)){
++		mu_prime=0.5*pow((IssmDouble)10,(IssmDouble)14);
++	}
++	else{
++		/*Retrive strain rate components: */
++		exx=epsilon[0];
++		eyy=epsilon[1];
++		exy=epsilon[2];
++		exz=epsilon[3];
++		eyz=epsilon[4];
++		eff2 = exx*exx + eyy*eyy + exx*eyy + exy*exy + exz*exz + eyz*eyz;
++
++		mu_prime=(1-n)/(2*n) * mu/eff2;
++	}
++
++	/*Assign output pointers:*/
++	*pmu_prime=mu_prime;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::GetViscosity2dDerivativeEpsSquare{{{*/
++void  Matdamageice::GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){
++
++	/*output: */
++	IssmDouble mu_prime;
++	IssmDouble mu,n,eff2;
++
++	/*input strain rate: */
++	IssmDouble exx,eyy,exy,exz;
++
++	/*Get visocisty and n*/
++	GetViscosity2d(&mu,epsilon);
++	n=GetN();
++
++	if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0)){
++		mu_prime=0.5*pow((IssmDouble)10,(IssmDouble)14);
++	}
++	else{
++		/*Retrive strain rate components: */
++		exx=epsilon[0];
++		eyy=epsilon[1];
++		exy=epsilon[2];
++		eff2 = exx*exx + eyy*eyy + exx*eyy + exy*exy ;
++
++		mu_prime=(1-n)/(2*n) * mu/eff2;
++	}
++
++	/*Assign output pointers:*/
++	*pmu_prime=mu_prime;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputDuplicate{{{*/
++void  Matdamageice::InputDuplicate(int original_enum,int new_enum){
++
++	/*Call inputs method*/
++	if (IsInput(original_enum)) inputs->DuplicateInput(original_enum,new_enum);
++
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
++void  Matdamageice::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++
++	/*Intermediaries*/
++	Element *element      = NULL;
++
++	/*Recover element*/
++	element=(Element*)helement->delivers();
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	switch(type){
++
++		case VertexEnum:
++
++			switch(element->ObjectEnum()){
++
++				case TriaEnum: {
++					IssmDouble values[3];
++					for (int i=0;i<3;i++) values[i]=vector[((Tria*)element)->nodes[i]->GetVertexDof()];
++					this->inputs->AddInput(new TriaP1Input(name,values));
++					return;
++				}
++				default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++			}
++		default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++	}
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromVector(int* vector, int name, int type) {{{*/
++void  Matdamageice::InputUpdateFromVector(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromVector(bool* vector, int name, int type) {{{*/
++void  Matdamageice::InputUpdateFromVector(bool* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type) {{{*/
++void  Matdamageice::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
++
++	/*Intermediaries*/
++	Element *element      = NULL;
++	Parameters* parameters= NULL;
++	int         dim;
++
++	/*Recover element*/
++	element=(Element*)helement->delivers();
++
++	/*Check that name is an element input*/
++	if (!IsInput(name)) return;
++
++	switch(type){
++
++		case VertexEnum:
++
++			switch(element->ObjectEnum()){
++
++				case TriaEnum: {
++					IssmDouble values[3];
++					for (int i=0;i<3;i++) values[i]=vector[((Tria*)element)->nodes[i]->GetSidList()]; //use sid list, to index into serial oriented vector 
++					this->inputs->AddInput(new TriaP1Input(name,values));
++					/*Special case for rheology B in 2D: Pourave land for this solution{{{*/
++					if(name==MaterialsRheologyBEnum){
++						/*Are we in 2D?:*/
++						if(element->ObjectEnum()==TriaEnum){
++							parameters=((Tria*)(element))->parameters;
++						}
++						else{
++							parameters=((Penta*)(element))->parameters;
++						}
++						parameters->FindParam(&dim,MeshDimensionEnum);
++						if(dim==2){
++							/*Dupliacte rheology input: */
++							this->inputs->AddInput(new TriaP1Input(MaterialsRheologyBbarEnum,values));
++						}
++					}
++					/*}}}*/
++					return;
++				}
++				default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
++			}
++		default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
++	}
++
++
++
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromMatrixDakota(int* vector, int name, int type) {{{*/
++void  Matdamageice::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromVectorDakota(int* vector, int name, int type) {{{*/
++void  Matdamageice::InputUpdateFromVectorDakota(int* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromVectorDakota(bool* vector, int name, int type) {{{*/
++void  Matdamageice::InputUpdateFromVectorDakota(bool* vector, int name, int type){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromConstant(IssmDouble constant, int name) {{{*/
++void  Matdamageice::InputUpdateFromConstant(IssmDouble constant, int name){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromConstant(int constant, int name) {{{*/
++void  Matdamageice::InputUpdateFromConstant(int constant, int name){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromConstant(bool constant, int name) {{{*/
++void  Matdamageice::InputUpdateFromConstant(bool constant, int name){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromSolution{{{*/
++void  Matdamageice::InputUpdateFromSolution(IssmDouble* solution){
++	/*Nothing updated yet*/
++}
++/*}}}*/
++/*FUNCTION Matdamageice::InputUpdateFromIoModel{{{*/
++void Matdamageice::InputUpdateFromIoModel(int index, IoModel* iomodel){
++
++	int i,j;
++
++	int    dim;
++	bool   control_analysis;
++	int    num_control_type;
++
++	/*Fetch parameters: */
++	iomodel->Constant(&dim,MeshDimensionEnum);
++	iomodel->Constant(&control_analysis,InversionIscontrolEnum);
++	if(control_analysis) iomodel->Constant(&num_control_type,InversionNumControlParametersEnum);
++
++	/*if 2d*/
++	if(dim==2){
++
++		/*Intermediaries*/
++		const int num_vertices = 3; //Tria has 3 vertices
++		IssmDouble    nodeinputs[num_vertices];
++		IssmDouble    cmmininputs[num_vertices];
++		IssmDouble    cmmaxinputs[num_vertices];
++
++		/*Get B*/
++		if (iomodel->Data(MaterialsRheologyBEnum)) {
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
++			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyBbarEnum,nodeinputs));
++		}
++
++		/*Get n*/
++		if (iomodel->Data(MaterialsRheologyNEnum)) {
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyNEnum)[index];
++			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyNEnum,nodeinputs));
++		}
++
++		/*Get Z*/
++		if (iomodel->Data(MaterialsRheologyZEnum)) {
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyZEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
++			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyZbarEnum,nodeinputs));
++		}
++
++		/*Control Inputs*/
++		#ifdef _HAVE_CONTROL_
++		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
++			for(i=0;i<num_control_type;i++){
++				switch(reCast<int>(iomodel->Data(InversionControlParametersEnum)[i])){
++					case MaterialsRheologyBbarEnum:
++						if (iomodel->Data(MaterialsRheologyBEnum)){
++							_assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
++							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
++							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							this->inputs->AddInput(new ControlInput(MaterialsRheologyBbarEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++						}
++						break;
++					case MaterialsRheologyZbarEnum:
++						if (iomodel->Data(MaterialsRheologyZEnum)){
++							_assert_(iomodel->Data(MaterialsRheologyZEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
++							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyZEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
++							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							this->inputs->AddInput(new ControlInput(MaterialsRheologyZbarEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++						}
++						break;
++
++				}
++			}
++		}
++		#endif
++	}
++
++	/*if 3d*/
++	#ifdef _HAVE_3D_
++	else if(dim==3){
++
++		/*Intermediaries*/
++		const int num_vertices = 6; //Penta has 6 vertices
++		IssmDouble    nodeinputs[num_vertices];
++		IssmDouble    cmmininputs[num_vertices];
++		IssmDouble    cmmaxinputs[num_vertices];
++
++		/*Get B*/
++		if (iomodel->Data(MaterialsRheologyBEnum)) {
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
++			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,nodeinputs));
++		}
++
++		/*Get n*/
++		if (iomodel->Data(MaterialsRheologyNEnum)) {
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyNEnum)[index];
++			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyNEnum,nodeinputs));
++		}
++
++		/*Get Z*/
++		if (iomodel->Data(MaterialsRheologyZEnum)) {
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyZEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
++			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyZEnum,nodeinputs));
++		}
++
++		/*Control Inputs*/
++		#ifdef _HAVE_CONTROL_
++		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
++			for(i=0;i<num_control_type;i++){
++				switch(reCast<int>(iomodel->Data(InversionControlParametersEnum)[i])){
++					case MaterialsRheologyBbarEnum:
++						if (iomodel->Data(MaterialsRheologyBEnum)){
++							_assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
++							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
++							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++						}
++						break;
++					case MaterialsRheologyZbarEnum:
++						if (iomodel->Data(MaterialsRheologyZEnum)){
++							_assert_(iomodel->Data(MaterialsRheologyZEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
++							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyZEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
++							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							this->inputs->AddInput(new ControlInput(MaterialsRheologyZEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
++						}
++						break;
++				}
++			}
++		}
++		#endif
++	}
++	#endif
++	else{
++		_error_("Mesh type not supported yet!");
++	}
++
++	return;
++}
++/*}}}*/
++/*FUNCTION Matdamageice::IsInput{{{*/
++bool Matdamageice::IsInput(int name){
++	if (
++				name==MaterialsRheologyBEnum ||
++				name==MaterialsRheologyBbarEnum ||
++				name==MaterialsRheologyNEnum ||
++				name==MaterialsRheologyZEnum ||
++				name==MaterialsRheologyZbarEnum
++		){
++		return true;
++	}
++	else return false;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.h	(revision 13130)
+@@ -0,0 +1,70 @@
++/*!\file Matdamageice.h
++ * \brief: header file for matice object
++ */
++
++#ifndef MATDAMAGEICE_H_
++#define MATDAMAGEICE_H_
++
++/*Headers:*/
++/*{{{*/
++#include "./Material.h"
++class IoModel;
++/*}}}*/
++
++class Matdamageice: public Material{
++
++	private: 
++		int	   mid;
++		Hook* helement;
++
++	public:
++		/*Matdamageice constructors, destructors: {{{*/
++		Matdamageice();
++		Matdamageice(int mid,int i, IoModel* iomodel);
++		~Matdamageice();
++		/*}}}*/
++		/*Object virtual functions definitions:{{{ */
++		void  Echo();
++		void  DeepEcho();
++		int   Id(); 
++		int   MyRank();
++		int   ObjectEnum();
++		Object* copy();
++		/*}}}*/
++		/*Update virtual functions definitions: {{{*/
++		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
++		void  InputUpdateFromVector(int* vector, int name, int type);
++		void  InputUpdateFromVector(bool* 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);
++		void  InputUpdateFromVectorDakota(int* vector, int name, int type);
++		void  InputUpdateFromVectorDakota(bool* vector, int name, int type);
++		void  InputUpdateFromConstant(IssmDouble constant, int name);
++		void  InputUpdateFromConstant(int constant, int name);
++		void  InputUpdateFromConstant(bool constant, int name);
++		void  InputUpdateFromSolution(IssmDouble* solution);
++		void  InputUpdateFromIoModel(int index, IoModel* iomodel);
++		/*}}}*/
++		/*Material virtual functions resolution: {{{*/
++		void   InputDuplicate(int original_enum,int new_enum);
++		void   Configure(Elements* elements);
++		void   GetVectorFromInputs(Vector* vector,int input_enum);
++		void   SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
++		void   GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
++		void   GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon);
++		void   GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon);
++		void   GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
++		void   GetViscosityZComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
++		void   GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
++		void   GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon);
++		IssmDouble GetA();
++		IssmDouble GetB();
++		IssmDouble GetBbar();
++		IssmDouble GetN();
++		IssmDouble GetZ();
++		IssmDouble GetZbar();
++		bool   IsInput(int name);
++		/*}}}*/
++};
++
++#endif  /* _MATICE_H_ */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13130-13131.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13130-13131.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13130-13131.diff	(revision 13394)
@@ -0,0 +1,304 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.m	(revision 13130)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.m	(revision 13131)
+@@ -1,119 +0,0 @@
+-%MATERIALS class definition
+-%
+-%   Usage:
+-%      materials=materials();
+-
+-classdef materials
+-	properties (SetAccess=public) 
+-		rho_ice                    = 0.;
+-		rho_water                  = 0.;
+-		rho_freshwater             = 0.;
+-		mu_water                   = 0.;
+-		heatcapacity               = 0.;
+-		latentheat                 = 0.;
+-		thermalconductivity        = 0.;
+-		meltingpoint               = 0.;
+-		beta                       = 0.;
+-		mixed_layer_capacity       = 0.;
+-		thermal_exchange_velocity  = 0.;
+-		rheology_B   = NaN;
+-		rheology_n   = NaN;
+-		rheology_Z   = NaN;
+-		rheology_law = '';
+-	end
+-	methods
+-		function obj = materials(varargin) % {{{
+-			switch nargin
+-				case 0
+-					obj=setdefaultparameters(obj);
+-				otherwise
+-					error('constructor not supported');
+-			end
+-		end % }}}
+-		function obj = setdefaultparameters(obj) % {{{
+-
+-			%ice density (kg/m^3)
+-			obj.rho_ice=917.;
+-
+-			%ocean water density (kg/m^3)
+-			obj.rho_water=1023.;
+-
+-			%fresh water density (kg/m^3)
+-			obj.rho_freshwater=1000.;
+-
+-			%water viscosity (N.s/m^2)
+-			obj.mu_water=0.001787;  
+-
+-			%ice heat capacity cp (J/kg/K)
+-			obj.heatcapacity=2093.;
+-
+-			%ice latent heat of fusion L (J/kg)
+-			obj.latentheat=3.34*10^5;
+-
+-			%ice thermal conductivity (W/m/K)
+-			obj.thermalconductivity=2.4;
+-
+-			%the melting point of ice at 1 atmosphere of pressure in K
+-			obj.meltingpoint=273.15;
+-
+-			%rate of change of melting point with pressure (K/Pa)
+-			obj.beta=9.8*10^-8;
+-
+-			%mixed layer (ice-water interface) heat capacity (J/kg/K)
+-			obj.mixed_layer_capacity=3974.;
+-
+-			%thermal exchange velocity (ice-water interface) (m/s)
+-			obj.thermal_exchange_velocity=1.00*10^-4;
+-
+-			%Rheology law: what is the temperature dependence of B with T
+-			%available: none, paterson and arrhenius
+-			obj.rheology_law='Paterson';
+-		end % }}}
+-		function md = checkconsistency(obj,md,solution,analyses) % {{{
+-			md = checkfield(md,'materials.rho_ice','>',0);
+-			md = checkfield(md,'materials.rho_water','>',0);
+-			md = checkfield(md,'materials.rho_freshwater','>',0);
+-			md = checkfield(md,'materials.mu_water','>',0);
+-			md = checkfield(md,'materials.rheology_B','>',0,'size',[md.mesh.numberofvertices 1]);
+-			md = checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
+-			md = checkfield(md,'materials.rheology_Z','>',0,'size',[md.mesh.numberofvertices 1]);
+-			md = checkfield(md,'materials.rheology_law','values',{'None' 'Paterson' 'Arrhenius'});
+-		end % }}}
+-		function disp(obj) % {{{
+-			disp(sprintf('   Materials:\n'));
+-
+-			fielddisplay(obj,'rho_ice','ice density [kg/m^3]');
+-			fielddisplay(obj,'rho_water','ocean water density [kg/m^3]');
+-			fielddisplay(obj,'rho_freshwater','fresh water density [kg/m^3]');
+-			fielddisplay(obj,'mu_water','water viscosity [N s/m^2]');
+-			fielddisplay(obj,'heatcapacity','heat capacity [J/kg/K]');
+-			fielddisplay(obj,'thermalconductivity','ice thermal conductivity [W/m/K]');
+-			fielddisplay(obj,'meltingpoint','melting point of ice at 1atm in K');
+-			fielddisplay(obj,'latentheat','latent heat of fusion [J/m^3]');
+-			fielddisplay(obj,'beta','rate of change of melting point with pressure [K/Pa]');
+-			fielddisplay(obj,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
+-			fielddisplay(obj,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
+-			fielddisplay(obj,'rheology_B','flow law parameter [Pa/s^(1/n)]');
+-			fielddisplay(obj,'rheology_n','Glen''s flow law exponent');
+-			fielddisplay(obj,'rheology_Z','rheology multiplier');
+-			fielddisplay(obj,'rheology_law','law for the temperature dependance of the rheology: ''None'', ''Paterson'' or ''Arrhenius''');
+-		end % }}}
+-		function marshall(obj,fid) % {{{
+-			WriteData(fid,'object',obj,'fieldname','rho_ice','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','rho_water','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','rho_freshwater','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','mu_water','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','heatcapacity','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','latentheat','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','thermalconductivity','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','meltingpoint','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','beta','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','mixed_layer_capacity','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','thermal_exchange_velocity','format','Double');
+-			WriteData(fid,'object',obj,'fieldname','rheology_B','format','DoubleMat','mattype',1);
+-			WriteData(fid,'object',obj,'fieldname','rheology_n','format','DoubleMat','mattype',2);
+-			WriteData(fid,'object',obj,'fieldname','rheology_Z','format','DoubleMat','mattype',1);
+-			WriteData(fid,'data',StringToEnum(obj.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer');
+-		end % }}}
+-	end
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.m	(revision 13130)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/initialization.m	(revision 13131)
+@@ -81,8 +81,6 @@
+ 			WriteData(fid,'data',obj.vz,'format','DoubleMat','mattype',1,'enum',VzEnum);
+ 			WriteData(fid,'data',obj.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum);
+ 			WriteData(fid,'data',obj.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum);
+-			WriteData(fid,'data',obj.surfacetemp,'format','DoubleMat','mattype',1,'enum',TemperatureSurfaceEnum);
+-			WriteData(fid,'data',obj.basaltemp,'format','DoubleMat','mattype',1,'enum',TemperatureBasalEnum);
+ 			WriteData(fid,'data',obj.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum);
+ 			WriteData(fid,'data',obj.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum);
+ 		end % }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.m	(revision 13131)
+@@ -0,0 +1,116 @@
++%MATICE class definition
++%
++%   Usage:
++%      matice=matice();
++
++classdef matice
++	properties (SetAccess=public) 
++		rho_ice                    = 0.;
++		rho_water                  = 0.;
++		rho_freshwater             = 0.;
++		mu_water                   = 0.;
++		heatcapacity               = 0.;
++		latentheat                 = 0.;
++		thermalconductivity        = 0.;
++		meltingpoint               = 0.;
++		beta                       = 0.;
++		mixed_layer_capacity       = 0.;
++		thermal_exchange_velocity  = 0.;
++		rheology_B   = NaN;
++		rheology_n   = NaN;
++		rheology_law = '';
++	end
++	methods
++		function obj = matice(varargin) % {{{
++			switch nargin
++				case 0
++					obj=setdefaultparameters(obj);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function obj = setdefaultparameters(obj) % {{{
++
++			%ice density (kg/m^3)
++			obj.rho_ice=917.;
++
++			%ocean water density (kg/m^3)
++			obj.rho_water=1023.;
++
++			%fresh water density (kg/m^3)
++			obj.rho_freshwater=1000.;
++
++			%water viscosity (N.s/m^2)
++			obj.mu_water=0.001787;  
++
++			%ice heat capacity cp (J/kg/K)
++			obj.heatcapacity=2093.;
++
++			%ice latent heat of fusion L (J/kg)
++			obj.latentheat=3.34*10^5;
++
++			%ice thermal conductivity (W/m/K)
++			obj.thermalconductivity=2.4;
++
++			%the melting point of ice at 1 atmosphere of pressure in K
++			obj.meltingpoint=273.15;
++
++			%rate of change of melting point with pressure (K/Pa)
++			obj.beta=9.8*10^-8;
++
++			%mixed layer (ice-water interface) heat capacity (J/kg/K)
++			obj.mixed_layer_capacity=3974.;
++
++			%thermal exchange velocity (ice-water interface) (m/s)
++			obj.thermal_exchange_velocity=1.00*10^-4;
++
++			%Rheology law: what is the temperature dependence of B with T
++			%available: none, paterson and arrhenius
++			obj.rheology_law='Paterson';
++		end % }}}
++		function md = checkconsistency(obj,md,solution,analyses) % {{{
++			md = checkfield(md,'materials.rho_ice','>',0);
++			md = checkfield(md,'materials.rho_water','>',0);
++			md = checkfield(md,'materials.rho_freshwater','>',0);
++			md = checkfield(md,'materials.mu_water','>',0);
++			md = checkfield(md,'materials.rheology_B','>',0,'size',[md.mesh.numberofvertices 1]);
++			md = checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
++			md = checkfield(md,'materials.rheology_law','values',{'None' 'Paterson' 'Arrhenius'});
++		end % }}}
++		function disp(obj) % {{{
++			disp(sprintf('   Materials:\n'));
++
++			fielddisplay(obj,'rho_ice','ice density [kg/m^3]');
++			fielddisplay(obj,'rho_water','ocean water density [kg/m^3]');
++			fielddisplay(obj,'rho_freshwater','fresh water density [kg/m^3]');
++			fielddisplay(obj,'mu_water','water viscosity [N s/m^2]');
++			fielddisplay(obj,'heatcapacity','heat capacity [J/kg/K]');
++			fielddisplay(obj,'thermalconductivity','ice thermal conductivity [W/m/K]');
++			fielddisplay(obj,'meltingpoint','melting point of ice at 1atm in K');
++			fielddisplay(obj,'latentheat','latent heat of fusion [J/m^3]');
++			fielddisplay(obj,'beta','rate of change of melting point with pressure [K/Pa]');
++			fielddisplay(obj,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
++			fielddisplay(obj,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
++			fielddisplay(obj,'rheology_B','flow law parameter [Pa/s^(1/n)]');
++			fielddisplay(obj,'rheology_n','Glen''s flow law exponent');
++			fielddisplay(obj,'rheology_law','law for the temperature dependance of the rheology: ''None'', ''Paterson'' or ''Arrhenius''');
++		end % }}}
++		function marshall(obj,fid) % {{{
++			WriteData(fid,'enum',MaterialsEnum(),'data',MaticeEnum(),'format','Integer');
++			WriteData(fid,'object',obj,'class','materials','fieldname','rho_ice','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','rho_water','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','rho_freshwater','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','mu_water','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','heatcapacity','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','latentheat','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','thermalconductivity','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','meltingpoint','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','beta','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','mixed_layer_capacity','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1);
++			WriteData(fid,'object',obj,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
++			WriteData(fid,'data',StringToEnum(obj.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer');
++		end % }}}
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13130)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13131)
+@@ -167,7 +167,9 @@
+ 			 %materials
+ 			 md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
+ 			 md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
+-			 md.materials.rheology_Z=DepthAverage(md,md.materials.rheology_Z);
++			 if isa(md.materials,'matdamageice')
++				 md.materials.rheology_Z=DepthAverage(md,md.materials.rheology_Z);
++			 end
+ 
+ 			 %special for thermal modeling:
+ 			 md.basalforcings.melting_rate=project2d(md,md.basalforcings.melting_rate,1); 
+@@ -716,7 +718,9 @@
+ 			 %materials
+ 			 md.materials.rheology_B=project3d(md,'vector',md.materials.rheology_B,'type','node');
+ 			 md.materials.rheology_n=project3d(md,'vector',md.materials.rheology_n,'type','element');
+-			 md.materials.rheology_Z=project3d(md,'vector',md.materials.rheology_Z,'type','node');
++			 if isa(md.materials,'matdamageice')
++				 md.materials.rheology_Z=project3d(md,'vector',md.materials.rheology_Z,'type','node');
++			 end
+ 
+ 			 %parameters
+ 			 md.geometry.surface=project3d(md,'vector',md.geometry.surface,'type','node');
+@@ -830,10 +834,8 @@
+ 			 if isfield(structmd,'penalty_offset'), md.prognostic.penalty_factor=structmd.penalty_offset; end
+ 			 if isfield(structmd,'B'), md.materials.rheology_B=structmd.B; end
+ 			 if isfield(structmd,'n'), md.materials.rheology_n=structmd.n; end
+-			 if isfield(structmd,'Z'), md.materials.rheology_Z=structmd.Z; end
+ 			 if isfield(structmd,'rheology_B'), md.materials.rheology_B=structmd.rheology_B; end
+ 			 if isfield(structmd,'rheology_n'), md.materials.rheology_n=structmd.rheology_n; end
+-			 if isfield(structmd,'rheology_Z'), md.materials.rheology_Z=structmd.rheology_Z; end
+ 			 if isfield(structmd,'elementoniceshelf'), md.mask.elementonfloatingice=structmd.elementoniceshelf; end
+ 			 if isfield(structmd,'elementonicesheet'), md.mask.elementongroundedice=structmd.elementonicesheet; end
+ 			 if isfield(structmd,'elementonwater'), md.mask.elementonwater=structmd.elementonwater; end
+@@ -1043,7 +1045,7 @@
+ 			 md.rifts            = rifts();
+ 			 md.timestepping     = timestepping();
+ 			 md.groundingline    = groundingline();
+-			 md.materials        = materials();
++			 md.materials        = matice();
+ 			 md.flowequation     = flowequation();
+ 			 md.debug            = debug();
+ 			 md.verbose          = verbose('solution',true,'qmu',true,'control',true);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13131-13132.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13131-13132.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13131-13132.diff	(revision 13394)
@@ -0,0 +1,125 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matdamageice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matdamageice.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matdamageice.m	(revision 13132)
+@@ -0,0 +1,120 @@
++%MATDAMAGEICE class definition
++%
++%   Usage:
++%      matdamageice=matdamageice();
++
++classdef matdamageice
++	properties (SetAccess=public) 
++		rho_ice                    = 0.;
++		rho_water                  = 0.;
++		rho_freshwater             = 0.;
++		mu_water                   = 0.;
++		heatcapacity               = 0.;
++		latentheat                 = 0.;
++		thermalconductivity        = 0.;
++		meltingpoint               = 0.;
++		beta                       = 0.;
++		mixed_layer_capacity       = 0.;
++		thermal_exchange_velocity  = 0.;
++		rheology_B   = NaN;
++		rheology_n   = NaN;
++		rheology_Z   = NaN;
++		rheology_law = '';
++	end
++	methods
++		function obj = matdamageice(varargin) % {{{
++			switch nargin
++				case 0
++					obj=setdefaultparameters(obj);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function obj = setdefaultparameters(obj) % {{{
++
++			%ice density (kg/m^3)
++			obj.rho_ice=917.;
++
++			%ocean water density (kg/m^3)
++			obj.rho_water=1023.;
++
++			%fresh water density (kg/m^3)
++			obj.rho_freshwater=1000.;
++
++			%water viscosity (N.s/m^2)
++			obj.mu_water=0.001787;  
++
++			%ice heat capacity cp (J/kg/K)
++			obj.heatcapacity=2093.;
++
++			%ice latent heat of fusion L (J/kg)
++			obj.latentheat=3.34*10^5;
++
++			%ice thermal conductivity (W/m/K)
++			obj.thermalconductivity=2.4;
++
++			%the melting point of ice at 1 atmosphere of pressure in K
++			obj.meltingpoint=273.15;
++
++			%rate of change of melting point with pressure (K/Pa)
++			obj.beta=9.8*10^-8;
++
++			%mixed layer (ice-water interface) heat capacity (J/kg/K)
++			obj.mixed_layer_capacity=3974.;
++
++			%thermal exchange velocity (ice-water interface) (m/s)
++			obj.thermal_exchange_velocity=1.00*10^-4;
++
++			%Rheology law: what is the temperature dependence of B with T
++			%available: none, paterson and arrhenius
++			obj.rheology_law='Paterson';
++		end % }}}
++		function md = checkconsistency(obj,md,solution,analyses) % {{{
++			md = checkfield(md,'materials.rho_ice','>',0);
++			md = checkfield(md,'materials.rho_water','>',0);
++			md = checkfield(md,'materials.rho_freshwater','>',0);
++			md = checkfield(md,'materials.mu_water','>',0);
++			md = checkfield(md,'materials.rheology_B','>',0,'size',[md.mesh.numberofvertices 1]);
++			md = checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
++			md = checkfield(md,'materials.rheology_Z','>',0,'size',[md.mesh.numberofvertices 1]);
++			md = checkfield(md,'materials.rheology_law','values',{'None' 'Paterson' 'Arrhenius'});
++		end % }}}
++		function disp(obj) % {{{
++			disp(sprintf('   Materials:\n'));
++
++			fielddisplay(obj,'rho_ice','ice density [kg/m^3]');
++			fielddisplay(obj,'rho_water','ocean water density [kg/m^3]');
++			fielddisplay(obj,'rho_freshwater','fresh water density [kg/m^3]');
++			fielddisplay(obj,'mu_water','water viscosity [N s/m^2]');
++			fielddisplay(obj,'heatcapacity','heat capacity [J/kg/K]');
++			fielddisplay(obj,'thermalconductivity','ice thermal conductivity [W/m/K]');
++			fielddisplay(obj,'meltingpoint','melting point of ice at 1atm in K');
++			fielddisplay(obj,'latentheat','latent heat of fusion [J/m^3]');
++			fielddisplay(obj,'beta','rate of change of melting point with pressure [K/Pa]');
++			fielddisplay(obj,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
++			fielddisplay(obj,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
++			fielddisplay(obj,'rheology_B','flow law parameter [Pa/s^(1/n)]');
++			fielddisplay(obj,'rheology_n','Glen''s flow law exponent');
++			fielddisplay(obj,'rheology_Z','rheology multiplier');
++			fielddisplay(obj,'rheology_law','law for the temperature dependance of the rheology: ''None'', ''Paterson'' or ''Arrhenius''');
++		end % }}}
++		function marshall(obj,fid) % {{{
++			WriteData(fid,'enum',MaterialsEnum(),'data',MatdamageiceEnum(),'format','Integer');
++			WriteData(fid,'object',obj,'class','materials','fieldname','rho_ice','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','rho_water','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','rho_freshwater','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','mu_water','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','heatcapacity','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','latentheat','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','thermalconductivity','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','meltingpoint','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','beta','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','mixed_layer_capacity','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
++			WriteData(fid,'object',obj,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1);
++			WriteData(fid,'object',obj,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
++			WriteData(fid,'object',obj,'class','materials','fieldname','rheology_Z','format','DoubleMat','mattype',1);
++			WriteData(fid,'data',StringToEnum(obj.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer');
++		end % }}}
++	end
++end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13132-13133.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13132-13133.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13132-13133.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.m	(revision 13132)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.m	(revision 13133)
+@@ -12,7 +12,7 @@
+ 	%This is a object field, construct enum and data
+ 	obj       = getfieldvalue(options,'object');
+ 	fieldname = getfieldvalue(options,'fieldname');
+-	classname = class(obj);
++	classname = getfieldvalue(options,'class',class(obj));
+ 
+ 	enum      = BuildEnum([classname '_' fieldname]);
+ 	data      = obj.(fieldname);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13133-13134.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13133-13134.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13133-13134.diff	(revision 13394)
@@ -0,0 +1,54 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MatdamageiceEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MatdamageiceEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MatdamageiceEnum.m	(revision 13134)
+@@ -0,0 +1,11 @@
++function macro=MatdamageiceEnum()
++%MATDAMAGEICEENUM - Enum of Matdamageice
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=MatdamageiceEnum()
++
++macro=StringToEnum('Matdamageice');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13133)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13134)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=463;
++macro=464;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13133)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13134)
+@@ -2628,6 +2628,16 @@
+ 
+ 	return StringToEnum('Matice')[0]
+ 
++def MatdamageiceEnum():
++	"""
++	MATDAMAGEICEENUM - Enum of Matdamageice
++
++	   Usage:
++	      macro=MatdamageiceEnum()
++	"""
++
++	return StringToEnum('Matdamageice')[0]
++
+ def MatparEnum():
+ 	"""
+ 	MATPARENUM - Enum of Matpar
+@@ -4646,5 +4656,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 463
++	return 464
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13134-13135.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13134-13135.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13134-13135.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcoarsen.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcoarsen.m	(revision 13134)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expcoarsen.m	(revision 13135)
+@@ -14,7 +14,7 @@
+ if nargin~=3 | nargout
+ 	error('expcoarsen usage: expcoarsen(newfile,oldfile,resolution)')
+ elseif ~exist(oldfile)
+-	error(['expcut error message: the file ' oldfile  'does not exist'])
++	error(['expcut error message: the file ' oldfile ' does not exist'])
+ elseif exist(newfile),
+ 	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
+ 	if ~strcmpi(choice,'y'),
Index: /issm/oecreview/Archive/12678-13393/ISSM-13135-13136.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13135-13136.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13135-13136.diff	(revision 13394)
@@ -0,0 +1,42 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test270.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test270.m	(revision 13135)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test270.m	(revision 13136)
+@@ -1,6 +1,9 @@
+ md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
++md.materials=matdamageice();
++md.materials.rheology_B=paterson(md.initialization.temperature);
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+ md.materials.rheology_Z=0.5*ones(md.mesh.numberofvertices,1);
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test274.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test274.m	(revision 13135)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test274.m	(revision 13136)
+@@ -2,6 +2,9 @@
+ md=meshprocessrifts(md,'../Exp/Square.exp');
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
++md.materials=matdamageice();
++md.materials.rheology_B=paterson(md.initialization.temperature);
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+ md.materials.rheology_Z=0.5*ones(md.mesh.numberofvertices,1);
+ md=setflowequation(md,'macayeal','all');
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test272.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test272.m	(revision 13135)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test272.m	(revision 13136)
+@@ -1,6 +1,9 @@
+ md=triangle(model,'../Exp/Square.exp',150000);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
++md.materials=matdamageice();
++md.materials.rheology_B=paterson(md.initialization.temperature);
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+ md.materials.rheology_Z=0.5*ones(md.mesh.numberofvertices,1);
+ md=setflowequation(md,'macayeal','all');
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13136-13137.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13136-13137.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13136-13137.diff	(revision 13394)
@@ -0,0 +1,204 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/RoundSheetShelf.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/RoundSheetShelf.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/RoundSheetShelf.par	(revision 13137)
+@@ -59,7 +59,6 @@
+ 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);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ %Surface mass balance and basal melting
+ md.surfaceforcings.mass_balance=-10*ones(md.mesh.numberofvertices,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/RoundSheetEISMINT.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/RoundSheetEISMINT.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/RoundSheetEISMINT.par	(revision 13137)
+@@ -19,7 +19,6 @@
+ disp('      creating flow law paramter');
+ 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);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ disp('      creating surface mass balance');
+ smb_max=0.5; %m/yr
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/79North.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/79North.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/79North.par	(revision 13137)
+@@ -12,7 +12,6 @@
+ %Materials
+ md.initialization.temperature=(273-20)*ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_B=paterson(md.initialization.temperature);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+ 
+ %Friction
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetShelf.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetShelf.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetShelf.par	(revision 13137)
+@@ -24,7 +24,6 @@
+ 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);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ %Accumulation and melting
+ md.surfaceforcings.mass_balance=10*ones(md.mesh.numberofvertices,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par	(revision 13137)
+@@ -21,7 +21,6 @@
+ 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);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ %Surface mass balance and basal melting
+ md.surfaceforcings.mass_balance=10*ones(md.mesh.numberofvertices,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareThermal.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareThermal.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareThermal.par	(revision 13137)
+@@ -27,7 +27,6 @@
+ disp('      creating flow law paramter');
+ md.materials.rheology_B=paterson(md.initialization.temperature);
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ disp('      creating surface mass balance');
+ md.surfaceforcings.mass_balance=ones(md.mesh.numberofvertices,1)/md.constants.yts; %1m/a
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/Pig.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/Pig.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/Pig.par	(revision 13137)
+@@ -16,7 +16,6 @@
+ %Materials
+ md.initialization.temperature=(273-20)*ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_B=paterson(md.initialization.temperature);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+ md.initialization.temperature=md.initialization.temperature;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/RoundSheetStaticEISMINT.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/RoundSheetStaticEISMINT.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/RoundSheetStaticEISMINT.par	(revision 13137)
+@@ -24,7 +24,6 @@
+ disp('      creating flow law paramter');
+ 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);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ disp('      creating surface mass balance');
+ smb_max=0.5; %m/yr
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPA.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPA.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPA.par	(revision 13137)
+@@ -16,7 +16,6 @@
+ disp('      creating flow law paramter');
+ md.materials.rheology_B=6.8067*10^7*ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ disp('      boundary conditions for diagnostic model');
+ %Create node on boundary fist (because we cannot use mesh)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelf.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelf.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelf.par	(revision 13137)
+@@ -21,7 +21,6 @@
+ 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);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ %Friction
+ pos=find(md.mask.elementonfloatingice);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPB.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPB.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPB.par	(revision 13137)
+@@ -16,7 +16,6 @@
+ disp('      creating flow law paramter');
+ md.materials.rheology_B=6.8067*10^7*ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ disp('      boundary conditions for diagnostic model');
+ %Create node on boundary fist (because we cannot use mesh)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetConstrained.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetConstrained.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetConstrained.par	(revision 13137)
+@@ -21,7 +21,6 @@
+ 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);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ %Friction
+ pos=find(md.mask.elementonfloatingice);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPC.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPC.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPC.par	(revision 13137)
+@@ -17,7 +17,6 @@
+ disp('      creating flow law paramter');
+ md.materials.rheology_B=6.8067*10^7*ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ disp('      boundary conditions for diagnostic model: ');
+ %Create node on boundary fist (because wi can not use mesh)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPD.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPD.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPD.par	(revision 13137)
+@@ -16,7 +16,6 @@
+ disp('      creating flow law paramter');
+ md.materials.rheology_B=6.8067*10^7*ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ disp('      boundary conditions for diagnostic model: ');
+ %Create node on boundary fist (because wi can not use mesh)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPE.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPE.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPE.par	(revision 13137)
+@@ -25,7 +25,6 @@
+ disp('      creating flow law paramter');
+ md.materials.rheology_B=6.8067*10^7*ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ disp('      boundary conditions for diagnostic model: ');
+ %Create node on boundary fist (because wi can not use mesh)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPF.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPF.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPF.par	(revision 13137)
+@@ -15,7 +15,6 @@
+ disp('      creating flow law paramter');
+ md.materials.rheology_B=1.4734*10^14*ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_n=1*ones(md.mesh.numberofelements,1);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_law='None';
+ 
+ disp('      boundary conditions for diagnostic model');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareEISMINT.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareEISMINT.par	(revision 13136)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareEISMINT.par	(revision 13137)
+@@ -26,7 +26,6 @@
+ disp('      creating flow law paramter');
+ md.materials.rheology_B=1.7687*10^8*ones(md.mesh.numberofvertices,1);
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-md.materials.rheology_Z=ones(md.mesh.numberofvertices,1);
+ 
+ disp('      creating surface mass balance');
+ md.surfaceforcings.mass_balance=0.2*ones(md.mesh.numberofvertices,1); %0m/a
Index: /issm/oecreview/Archive/12678-13393/ISSM-13137-13138.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13137-13138.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13137-13138.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid.sh	(revision 13137)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid.sh	(revision 13138)
+@@ -28,6 +28,6 @@
+  --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" \
+  --with-graphics-lib=/usr/lib64/libX11.so \
+  --with-cxxoptflags="-march=opteron -O2" \
+- --with-numthreads=32 \
++ --with-numthreads=16 \
+  --enable-debugging
+  #--with-serial=no \
Index: /issm/oecreview/Archive/12678-13393/ISSM-13138-13139.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13138-13139.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13138-13139.diff	(revision 13394)
@@ -0,0 +1,283 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 13138)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/materials.py	(revision 13139)
+@@ -1,125 +0,0 @@
+-#module imports
+-from fielddisplay import fielddisplay
+-from EnumDefinitions import *
+-from StringToEnum import StringToEnum
+-from checkfield import *
+-from WriteData import *
+-
+-class materials(object):
+-	"""
+-	MATERIALS class definition
+-
+-	   Usage:
+-	      materials=materials();
+-	"""
+-
+-	#properties
+-	def __init__(self):
+-		# {{{ Properties
+-		self.rho_ice                    = 0.
+-		self.rho_water                  = 0.
+-		self.rho_freshwater             = 0.
+-		self.mu_water                   = 0.
+-		self.heatcapacity               = 0.
+-		self.latentheat                 = 0.
+-		self.thermalconductivity        = 0.
+-		self.meltingpoint               = 0.
+-		self.beta                       = 0.
+-		self.mixed_layer_capacity       = 0.
+-		self.thermal_exchange_velocity  = 0.
+-		self.rheology_B   = float('NaN')
+-		self.rheology_n   = float('NaN')
+-		self.rheology_law = ''
+-
+-		self.setdefaultparameters()
+-		#}}}
+-	def __repr__(self):
+-		# {{{ Display
+-		string="   Materials:"
+-
+-		string="%s\n\n%s"%(string,fielddisplay(self,"rho_ice","ice density [kg/m^3]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"rho_water","water density [kg/m^3]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"rho_freshwater","fresh water density [kg/m^3]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"mu_water","water viscosity [N s/m^2]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"heatcapacity","heat capacity [J/kg/K]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"meltingpoint","melting point of ice at 1atm in K"))
+-		string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"beta","rate of change of melting point with pressure [K/Pa]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa/s^(1/n)]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent"))
+-		string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'Paterson' or 'Arrhenius'"))
+-
+-		return string
+-		#}}}
+-	def setdefaultparameters(self):
+-		# {{{setdefaultparameters
+-		#ice density (kg/m^3)
+-		self.rho_ice=917.
+-
+-		#ocean water density (kg/m^3)
+-		self.rho_water=1023.
+-
+-		#fresh water density (kg/m^3)
+-		self.rho_freshwater=1000.
+-
+-		#water viscosity (N.s/m^2)
+-		self.mu_water=0.001787  
+-
+-		#ice heat capacity cp (J/kg/K)
+-		self.heatcapacity=2093.
+-
+-		#ice latent heat of fusion L (J/kg)
+-		self.latentheat=3.34*10**5
+-
+-		#ice thermal conductivity (W/m/K)
+-		self.thermalconductivity=2.4
+-
+-		#the melting point of ice at 1 atmosphere of pressure in K
+-		self.meltingpoint=273.15
+-
+-		#rate of change of melting point with pressure (K/Pa)
+-		self.beta=9.8*10**-8
+-
+-		#mixed layer (ice-water interface) heat capacity (J/kg/K)
+-		self.mixed_layer_capacity=3974.
+-
+-		#thermal exchange velocity (ice-water interface) (m/s)
+-		self.thermal_exchange_velocity=1.00*10**-4
+-
+-		#Rheology law: what is the temperature dependence of B with T
+-		#available: none, paterson and arrhenius
+-		self.rheology_law='Paterson'
+-		return self
+-		#}}}
+-
+-	def checkconsistency(self,md,solution,analyses):    # {{{
+-		md = checkfield(md,'materials.rho_ice','>',0)
+-		md = checkfield(md,'materials.rho_water','>',0)
+-		md = checkfield(md,'materials.rho_freshwater','>',0)
+-		md = checkfield(md,'materials.mu_water','>',0)
+-		md = checkfield(md,'materials.rheology_B','>',0,'size',[md.mesh.numberofvertices])
+-		md = checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
+-		md = checkfield(md,'materials.rheology_law','values',['None','Paterson','Arrhenius'])
+-		return md
+-	# }}}
+-
+-	def marshall(self,fid):    # {{{
+-		WriteData(fid,'object',self,'fieldname','rho_ice','format','Double')
+-		WriteData(fid,'object',self,'fieldname','rho_water','format','Double')
+-		WriteData(fid,'object',self,'fieldname','rho_freshwater','format','Double')
+-		WriteData(fid,'object',self,'fieldname','mu_water','format','Double')
+-		WriteData(fid,'object',self,'fieldname','heatcapacity','format','Double')
+-		WriteData(fid,'object',self,'fieldname','latentheat','format','Double')
+-		WriteData(fid,'object',self,'fieldname','thermalconductivity','format','Double')
+-		WriteData(fid,'object',self,'fieldname','meltingpoint','format','Double')
+-		WriteData(fid,'object',self,'fieldname','beta','format','Double')
+-		WriteData(fid,'object',self,'fieldname','mixed_layer_capacity','format','Double')
+-		WriteData(fid,'object',self,'fieldname','thermal_exchange_velocity','format','Double')
+-		WriteData(fid,'object',self,'fieldname','rheology_B','format','DoubleMat','mattype',1)
+-		WriteData(fid,'object',self,'fieldname','rheology_n','format','DoubleMat','mattype',2)
+-		WriteData(fid,'data',StringToEnum(self.rheology_law)[0],'enum',MaterialsRheologyLawEnum(),'format','Integer')
+-	# }}}
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13138)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13139)
+@@ -5,7 +5,7 @@
+ from constants import constants
+ from surfaceforcings import surfaceforcings
+ from basalforcings import basalforcings
+-from materials import materials
++from matice import matice
+ from friction import friction
+ from flowequation import flowequation
+ from timestepping import timestepping
+@@ -48,7 +48,7 @@
+ 		self.constants        = constants()
+ 		self.surfaceforcings  = surfaceforcings()
+ 		self.basalforcings    = basalforcings()
+-		self.materials        = materials()
++		self.materials        = matice()
+ 		self.friction         = friction()
+ 		self.flowequation     = flowequation()
+ 		self.timestepping     = timestepping()
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.py	(revision 13139)
+@@ -0,0 +1,126 @@
++#module imports
++from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from StringToEnum import StringToEnum
++from checkfield import *
++from WriteData import *
++
++class matice(object):
++	"""
++	MATERIALS class definition
++
++	   Usage:
++	      matice=matice();
++	"""
++
++	#properties
++	def __init__(self):
++		# {{{ Properties
++		self.rho_ice                    = 0.
++		self.rho_water                  = 0.
++		self.rho_freshwater             = 0.
++		self.mu_water                   = 0.
++		self.heatcapacity               = 0.
++		self.latentheat                 = 0.
++		self.thermalconductivity        = 0.
++		self.meltingpoint               = 0.
++		self.beta                       = 0.
++		self.mixed_layer_capacity       = 0.
++		self.thermal_exchange_velocity  = 0.
++		self.rheology_B   = float('NaN')
++		self.rheology_n   = float('NaN')
++		self.rheology_law = ''
++
++		self.setdefaultparameters()
++		#}}}
++	def __repr__(self):
++		# {{{ Display
++		string="   Materials:"
++
++		string="%s\n\n%s"%(string,fielddisplay(self,"rho_ice","ice density [kg/m^3]"))
++		string="%s\n%s"%(string,fielddisplay(self,"rho_water","water density [kg/m^3]"))
++		string="%s\n%s"%(string,fielddisplay(self,"rho_freshwater","fresh water density [kg/m^3]"))
++		string="%s\n%s"%(string,fielddisplay(self,"mu_water","water viscosity [N s/m^2]"))
++		string="%s\n%s"%(string,fielddisplay(self,"heatcapacity","heat capacity [J/kg/K]"))
++		string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]"))
++		string="%s\n%s"%(string,fielddisplay(self,"meltingpoint","melting point of ice at 1atm in K"))
++		string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
++		string="%s\n%s"%(string,fielddisplay(self,"beta","rate of change of melting point with pressure [K/Pa]"))
++		string="%s\n%s"%(string,fielddisplay(self,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
++		string="%s\n%s"%(string,fielddisplay(self,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
++		string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa/s^(1/n)]"))
++		string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent"))
++		string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'Paterson' or 'Arrhenius'"))
++
++		return string
++		#}}}
++	def setdefaultparameters(self):
++		# {{{setdefaultparameters
++		#ice density (kg/m^3)
++		self.rho_ice=917.
++
++		#ocean water density (kg/m^3)
++		self.rho_water=1023.
++
++		#fresh water density (kg/m^3)
++		self.rho_freshwater=1000.
++
++		#water viscosity (N.s/m^2)
++		self.mu_water=0.001787  
++
++		#ice heat capacity cp (J/kg/K)
++		self.heatcapacity=2093.
++
++		#ice latent heat of fusion L (J/kg)
++		self.latentheat=3.34*10**5
++
++		#ice thermal conductivity (W/m/K)
++		self.thermalconductivity=2.4
++
++		#the melting point of ice at 1 atmosphere of pressure in K
++		self.meltingpoint=273.15
++
++		#rate of change of melting point with pressure (K/Pa)
++		self.beta=9.8*10**-8
++
++		#mixed layer (ice-water interface) heat capacity (J/kg/K)
++		self.mixed_layer_capacity=3974.
++
++		#thermal exchange velocity (ice-water interface) (m/s)
++		self.thermal_exchange_velocity=1.00*10**-4
++
++		#Rheology law: what is the temperature dependence of B with T
++		#available: none, paterson and arrhenius
++		self.rheology_law='Paterson'
++		return self
++		#}}}
++
++	def checkconsistency(self,md,solution,analyses):    # {{{
++		md = checkfield(md,'matice.rho_ice','>',0)
++		md = checkfield(md,'matice.rho_water','>',0)
++		md = checkfield(md,'matice.rho_freshwater','>',0)
++		md = checkfield(md,'matice.mu_water','>',0)
++		md = checkfield(md,'matice.rheology_B','>',0,'size',[md.mesh.numberofvertices])
++		md = checkfield(md,'matice.rheology_n','>',0,'size',[md.mesh.numberofelements])
++		md = checkfield(md,'matice.rheology_law','values',['None','Paterson','Arrhenius'])
++		return md
++	# }}}
++
++	def marshall(self,fid):    # {{{
++		WriteData(fid,'enum',MaterialsEnum(),'data',MaticeEnum(),'format','Integer');
++		WriteData(fid,'object',self,'class','materials','fieldname','rho_ice','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','rho_water','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','rho_freshwater','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','mu_water','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','heatcapacity','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','latentheat','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','thermalconductivity','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','meltingpoint','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','beta','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double')
++		WriteData(fid,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1)
++		WriteData(fid,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)
++		WriteData(fid,'data',StringToEnum(self.rheology_law)[0],'enum',MaterialsRheologyLawEnum(),'format','Integer')
++	# }}}
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-13139-13140.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13139-13140.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13139-13140.diff	(revision 13394)
@@ -0,0 +1,475 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/basalstress.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/basalstress.m	(revision 13139)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/basalstress.m	(revision 13140)
+@@ -1,22 +0,0 @@
+-function [bx by b]=basalstress(md)
+-%BASALSTRESS - compute basal stress from basal drag and geometric information. 
+-%
+-%   Usage:
+-%      [bx by b]=basalstress(md);
+-%
+-%   See also: plot_basaldrag
+-
+-
+-%compute exponents
+-s=averaging(md,1./md.friction.p,0);
+-r=averaging(md,md.friction.q./md.friction.p,0);
+-
+-%compute horizontal velocity
+-ub=sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
+-ubx=md.initialization.vx/md.constants.yts;
+-uby=md.initialization.vy/md.constants.yts;
+-
+-%compute basal drag
+-bx=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*ubx.^s;
+-by=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*uby.^s;
+-b=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*ub.^s;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/drivingstress.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/drivingstress.m	(revision 13139)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/drivingstress.m	(revision 13140)
+@@ -1,18 +0,0 @@
+-function [px,py,pmag]=drivingstress(md)
+-%DRIVINGSTRESS -  evaluates the driving stress
+-%
+-%   The driving stress is computed according to the following formula: 
+-%   driving stress= rho_ice*g*H*slope
+-%
+-%   Usage:
+-%      [Fx,Fy,Fmag]=drivingstress(md)
+-
+-%Get slope
+-[sx,sy,s]=slope(md);
+-
+-%Average thickness over elements
+-thickness_bar=(md.geometry.thickness(md.mesh.elements(:,1))+md.geometry.thickness(md.mesh.elements(:,2))+md.geometry.thickness(md.mesh.elements(:,3)))/3;
+-
+-px=md.materials.rho_ice*md.constants.g*thickness_bar.*sx;
+-py=md.materials.rho_ice*md.constants.g*thickness_bar.*sy;
+-pmag=sqrt(px.^2+py.^2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/shear2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/shear2d.m	(revision 13139)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/shear2d.m	(revision 13140)
+@@ -1,23 +0,0 @@
+-function [sx,sy,sxy,s]=shear2d(md)
+-%SHEAR2D - computes 2d strain rate
+-%
+-%   This routine computes the strain rate of 2d models
+-%
+-%   Usage:
+-%      [sx,sy,sxy,s]=shear2d(md);
+-%      s=shear2d(md);
+-
+-[alpha beta]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y); 
+-
+-summation=[1;1;1];
+-sx=(md.initialization.vx(md.mesh.elements).*alpha)*summation;
+-uy=(md.initialization.vx(md.mesh.elements).*beta)*summation;
+-vx=(md.initialization.vy(md.mesh.elements).*alpha)*summation;
+-sy=(md.initialization.vy(md.mesh.elements).*beta)*summation;						
+-sxy=(uy+vx)/2;
+-s=sqrt(sx.^2+sy.^2+sxy.^2+sx.*sy);
+-
+-%if user requested only one output, it must be the norm
+-if nargout==1,
+-	sx=s;
+-end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/cfl_step.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/cfl_step.m	(revision 13139)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/cfl_step.m	(revision 13140)
+@@ -1,23 +0,0 @@
+-function maxtime=cfl_step(md,vx,vy);
+-%CFL_STEP - return the maximum time step for the model in years
+-%
+-%   Dt < 0.5 / ( u/Dx +v/Dy )
+-%
+-%   Usage:
+-%      maxtime=cfl_step(md,vx,vy);
+-%
+-%   Example:
+-%      dt=cfl_step(md,md.results.DiagnosticSolution.Vx,md.results.DiagnosticSolution.Vy)
+-
+-%Check length of velocities 
+-if size(vx,1)~=md.mesh.numberofvertices & size(vy,1)~=md.mesh.numberofvertices,
+-	error('timestpes error message: size of velocity components must be the same as md.mesh.numberofvertices');
+-end
+-
+-index=md.mesh.elements;
+-edgex=max(md.mesh.x(index),[],2)-min(md.mesh.x(index),[],2);
+-edgey=max(md.mesh.y(index),[],2)-min(md.mesh.y(index),[],2);
+-vx=max(abs(vx(index)),[],2);
+-vy=max(abs(vy(index)),[],2);
+-
+-maxtime=1/2*min(1./(vx./edgex+vy./edgey));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/mechanicalproperties.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/mechanicalproperties.m	(revision 13139)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/meca/mechanicalproperties.m	(revision 13140)
+@@ -1,118 +0,0 @@
+-function md=mechanicalproperties(md,vx,vy)
+-%MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
+-%
+-%   this routine computes the components of the stress tensor
+-%   strain rate tensor and their respective principal directions.
+-%   the results are in the model md: md.results
+-%
+-%   Usage:
+-%      md=mechanicalproperties(md,vx,vy)
+-%
+-%   Example:
+-%      md=mechanicalproperties(md,md.initialization.vx,md.initialization.vy);
+-%      md=mechanicalproperties(md,md.inversion.vx_obs,md.inversion.vy_obs);
+-
+-%some checks
+-if length(vx)~=md.mesh.numberofvertices | length(vy)~=md.mesh.numberofvertices,
+-	error(['the input velocity should be of size ' num2str(md.mesh.numberofvertices) '!'])
+-end
+-if ~(md.mesh.dimension==2)
+-	error('only 2d model supported yet');
+-end
+-if any(md.flowequation.element_equation~=2),
+-	disp('Warning: the model has some non macayeal elements. These will be treated like MacAyeal''s elements');
+-end
+-
+-%initialization
+-numberofelements=md.mesh.numberofelements;
+-index=md.mesh.elements;
+-summation=[1;1;1];
+-directionsstress=zeros(numberofelements,4);
+-directionsstrain=zeros(numberofelements,4);
+-valuesstress=zeros(numberofelements,2);
+-valuesstrain=zeros(numberofelements,2);
+-
+-%compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
+-[alpha beta]=GetNodalFunctionsCoeff(index,md.mesh.x,md.mesh.y);
+-
+-%compute shear
+-vxlist=vx(index)/md.constants.yts;
+-vylist=vy(index)/md.constants.yts;
+-ux=(vxlist.*alpha)*summation;
+-uy=(vxlist.*beta)*summation;
+-vx=(vylist.*alpha)*summation;
+-vy=(vylist.*beta)*summation;						
+-uyvx=(vx+uy)./2;
+-clear vxlist vylist
+-
+-%compute viscosity
+-nu=zeros(numberofelements,1);
+-B_bar=md.materials.rheology_B(index)*summation/3;
+-power=(md.materials.rheology_n-1)./(2*md.materials.rheology_n);
+-second_inv=(ux.^2+vy.^2+((uy+vx).^2)/4+ux.*vy);
+-%some corrections
+-location=find(second_inv~=0);
+-nu(location)=B_bar(location)./(second_inv(location).^power(location));
+-location=find(second_inv==0 & power~=0);
+-nu(location)=10^18; 	%arbitrary maximum viscosity to apply where there is no effective shear
+-location=find(second_inv==0 & power==0);
+-nu(location)=B_bar(location);
+-clear B_bar location second_inv power
+-
+-%compute stress
+-tau_xx=nu.*ux;
+-tau_yy=nu.*vy;
+-tau_xy=nu.*uyvx;
+-
+-%compute principal properties of stress
+-for i=1:numberofelements,
+-
+-	%compute stress and strainrate matrices
+-	stress=[tau_xx(i) tau_xy(i)
+-	tau_xy(i)  tau_yy(i)];
+-	strain=[ux(i) uyvx(i)
+-	uyvx(i)  vy(i)];
+-
+-	%eigen values and vectors
+-	[directions,value]=eig(stress);
+-	valuesstress(i,:)=[value(1,1) value(2,2)];
+-	directionsstress(i,:)=directions(:)';
+-	[directions,value]=eig(strain);
+-	valuesstrain(i,:)=[value(1,1) value(2,2)];
+-	directionsstrain(i,:)=directions(:)';
+-end
+-
+-%plug onto the model
+-%NB: Matlab sorts the eigen value in increasing order, we want the reverse
+-stress=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
+-stress.xx=tau_xx;
+-stress.yy=tau_yy;
+-stress.xy=tau_xy;
+-stress.principalvalue2=valuesstress(:,1);
+-stress.principalaxis2=directionsstress(:,1:2);
+-stress.principalvalue1=valuesstress(:,2);
+-stress.principalaxis1=directionsstress(:,3:4);
+-stress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+2*stress.xy.^2);
+-md.results.stress=stress;
+-
+-strainrate=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
+-strainrate.xx=ux;
+-strainrate.yy=vy;
+-strainrate.xy=uyvx;
+-strainrate.principalvalue2=valuesstrain(:,1)*(365.25*24*3600); %strain rate in 1/a instead of 1/s
+-strainrate.principalaxis2=directionsstrain(:,1:2);
+-strainrate.principalvalue1=valuesstrain(:,2)*(365.25*24*3600); %strain rate in 1/a instead of 1/s
+-strainrate.principalaxis1=directionsstrain(:,3:4);
+-strainrate.effectivevalue=1/sqrt(2)*sqrt(strainrate.xx.^2+strainrate.yy.^2+2*strainrate.xy.^2);
+-md.results.strainrate=strainrate;
+-
+-deviatoricstress=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
+-deviatoricstress.xx=tau_xx;
+-deviatoricstress.yy=tau_yy;
+-deviatoricstress.xy=tau_xy;
+-deviatoricstress.principalvalue2=valuesstress(:,1);
+-deviatoricstress.principalaxis2=directionsstress(:,1:2);
+-deviatoricstress.principalvalue1=valuesstress(:,2);
+-deviatoricstress.principalaxis1=directionsstress(:,3:4);
+-deviatoricstress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+2*stress.xy.^2);
+-md.results.deviatoricstress=deviatoricstress;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/basalstress.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/basalstress.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/basalstress.m	(revision 13140)
+@@ -0,0 +1,22 @@
++function [bx by b]=basalstress(md)
++%BASALSTRESS - compute basal stress from basal drag and geometric information. 
++%
++%   Usage:
++%      [bx by b]=basalstress(md);
++%
++%   See also: plot_basaldrag
++
++
++%compute exponents
++s=averaging(md,1./md.friction.p,0);
++r=averaging(md,md.friction.q./md.friction.p,0);
++
++%compute horizontal velocity
++ub=sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
++ubx=md.initialization.vx/md.constants.yts;
++uby=md.initialization.vy/md.constants.yts;
++
++%compute basal drag
++bx=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*ubx.^s;
++by=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*uby.^s;
++b=(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.bed)).^r.*(md.friction.coefficient).^2.*ub.^s;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/drivingstress.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/drivingstress.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/drivingstress.m	(revision 13140)
+@@ -0,0 +1,18 @@
++function [px,py,pmag]=drivingstress(md)
++%DRIVINGSTRESS -  evaluates the driving stress
++%
++%   The driving stress is computed according to the following formula: 
++%   driving stress= rho_ice*g*H*slope
++%
++%   Usage:
++%      [Fx,Fy,Fmag]=drivingstress(md)
++
++%Get slope
++[sx,sy,s]=slope(md);
++
++%Average thickness over elements
++thickness_bar=(md.geometry.thickness(md.mesh.elements(:,1))+md.geometry.thickness(md.mesh.elements(:,2))+md.geometry.thickness(md.mesh.elements(:,3)))/3;
++
++px=md.materials.rho_ice*md.constants.g*thickness_bar.*sx;
++py=md.materials.rho_ice*md.constants.g*thickness_bar.*sy;
++pmag=sqrt(px.^2+py.^2);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/shear2d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/shear2d.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/shear2d.m	(revision 13140)
+@@ -0,0 +1,23 @@
++function [sx,sy,sxy,s]=shear2d(md)
++%SHEAR2D - computes 2d strain rate
++%
++%   This routine computes the strain rate of 2d models
++%
++%   Usage:
++%      [sx,sy,sxy,s]=shear2d(md);
++%      s=shear2d(md);
++
++[alpha beta]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y); 
++
++summation=[1;1;1];
++sx=(md.initialization.vx(md.mesh.elements).*alpha)*summation;
++uy=(md.initialization.vx(md.mesh.elements).*beta)*summation;
++vx=(md.initialization.vy(md.mesh.elements).*alpha)*summation;
++sy=(md.initialization.vy(md.mesh.elements).*beta)*summation;						
++sxy=(uy+vx)/2;
++s=sqrt(sx.^2+sy.^2+sxy.^2+sx.*sy);
++
++%if user requested only one output, it must be the norm
++if nargout==1,
++	sx=s;
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/cfl_step.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/cfl_step.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/cfl_step.m	(revision 13140)
+@@ -0,0 +1,23 @@
++function maxtime=cfl_step(md,vx,vy);
++%CFL_STEP - return the maximum time step for the model in years
++%
++%   Dt < 0.5 / ( u/Dx +v/Dy )
++%
++%   Usage:
++%      maxtime=cfl_step(md,vx,vy);
++%
++%   Example:
++%      dt=cfl_step(md,md.results.DiagnosticSolution.Vx,md.results.DiagnosticSolution.Vy)
++
++%Check length of velocities 
++if size(vx,1)~=md.mesh.numberofvertices & size(vy,1)~=md.mesh.numberofvertices,
++	error('timestpes error message: size of velocity components must be the same as md.mesh.numberofvertices');
++end
++
++index=md.mesh.elements;
++edgex=max(md.mesh.x(index),[],2)-min(md.mesh.x(index),[],2);
++edgey=max(md.mesh.y(index),[],2)-min(md.mesh.y(index),[],2);
++vx=max(abs(vx(index)),[],2);
++vy=max(abs(vy(index)),[],2);
++
++maxtime=1/2*min(1./(vx./edgex+vy./edgey));
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/cfl_step.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/mechanicalproperties.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/mechanicalproperties.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech/mechanicalproperties.m	(revision 13140)
+@@ -0,0 +1,118 @@
++function md=mechanicalproperties(md,vx,vy)
++%MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
++%
++%   this routine computes the components of the stress tensor
++%   strain rate tensor and their respective principal directions.
++%   the results are in the model md: md.results
++%
++%   Usage:
++%      md=mechanicalproperties(md,vx,vy)
++%
++%   Example:
++%      md=mechanicalproperties(md,md.initialization.vx,md.initialization.vy);
++%      md=mechanicalproperties(md,md.inversion.vx_obs,md.inversion.vy_obs);
++
++%some checks
++if length(vx)~=md.mesh.numberofvertices | length(vy)~=md.mesh.numberofvertices,
++	error(['the input velocity should be of size ' num2str(md.mesh.numberofvertices) '!'])
++end
++if ~(md.mesh.dimension==2)
++	error('only 2d model supported yet');
++end
++if any(md.flowequation.element_equation~=2),
++	disp('Warning: the model has some non macayeal elements. These will be treated like MacAyeal''s elements');
++end
++
++%initialization
++numberofelements=md.mesh.numberofelements;
++index=md.mesh.elements;
++summation=[1;1;1];
++directionsstress=zeros(numberofelements,4);
++directionsstrain=zeros(numberofelements,4);
++valuesstress=zeros(numberofelements,2);
++valuesstrain=zeros(numberofelements,2);
++
++%compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
++[alpha beta]=GetNodalFunctionsCoeff(index,md.mesh.x,md.mesh.y);
++
++%compute shear
++vxlist=vx(index)/md.constants.yts;
++vylist=vy(index)/md.constants.yts;
++ux=(vxlist.*alpha)*summation;
++uy=(vxlist.*beta)*summation;
++vx=(vylist.*alpha)*summation;
++vy=(vylist.*beta)*summation;						
++uyvx=(vx+uy)./2;
++clear vxlist vylist
++
++%compute viscosity
++nu=zeros(numberofelements,1);
++B_bar=md.materials.rheology_B(index)*summation/3;
++power=(md.materials.rheology_n-1)./(2*md.materials.rheology_n);
++second_inv=(ux.^2+vy.^2+((uy+vx).^2)/4+ux.*vy);
++%some corrections
++location=find(second_inv~=0);
++nu(location)=B_bar(location)./(second_inv(location).^power(location));
++location=find(second_inv==0 & power~=0);
++nu(location)=10^18; 	%arbitrary maximum viscosity to apply where there is no effective shear
++location=find(second_inv==0 & power==0);
++nu(location)=B_bar(location);
++clear B_bar location second_inv power
++
++%compute stress
++tau_xx=nu.*ux;
++tau_yy=nu.*vy;
++tau_xy=nu.*uyvx;
++
++%compute principal properties of stress
++for i=1:numberofelements,
++
++	%compute stress and strainrate matrices
++	stress=[tau_xx(i) tau_xy(i)
++	tau_xy(i)  tau_yy(i)];
++	strain=[ux(i) uyvx(i)
++	uyvx(i)  vy(i)];
++
++	%eigen values and vectors
++	[directions,value]=eig(stress);
++	valuesstress(i,:)=[value(1,1) value(2,2)];
++	directionsstress(i,:)=directions(:)';
++	[directions,value]=eig(strain);
++	valuesstrain(i,:)=[value(1,1) value(2,2)];
++	directionsstrain(i,:)=directions(:)';
++end
++
++%plug onto the model
++%NB: Matlab sorts the eigen value in increasing order, we want the reverse
++stress=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
++stress.xx=tau_xx;
++stress.yy=tau_yy;
++stress.xy=tau_xy;
++stress.principalvalue2=valuesstress(:,1);
++stress.principalaxis2=directionsstress(:,1:2);
++stress.principalvalue1=valuesstress(:,2);
++stress.principalaxis1=directionsstress(:,3:4);
++stress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+2*stress.xy.^2);
++md.results.stress=stress;
++
++strainrate=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
++strainrate.xx=ux;
++strainrate.yy=vy;
++strainrate.xy=uyvx;
++strainrate.principalvalue2=valuesstrain(:,1)*(365.25*24*3600); %strain rate in 1/a instead of 1/s
++strainrate.principalaxis2=directionsstrain(:,1:2);
++strainrate.principalvalue1=valuesstrain(:,2)*(365.25*24*3600); %strain rate in 1/a instead of 1/s
++strainrate.principalaxis1=directionsstrain(:,3:4);
++strainrate.effectivevalue=1/sqrt(2)*sqrt(strainrate.xx.^2+strainrate.yy.^2+2*strainrate.xy.^2);
++md.results.strainrate=strainrate;
++
++deviatoricstress=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'effectivevalue',[]);
++deviatoricstress.xx=tau_xx;
++deviatoricstress.yy=tau_yy;
++deviatoricstress.xy=tau_xy;
++deviatoricstress.principalvalue2=valuesstress(:,1);
++deviatoricstress.principalaxis2=directionsstress(:,1:2);
++deviatoricstress.principalvalue1=valuesstress(:,2);
++deviatoricstress.principalaxis1=directionsstress(:,3:4);
++deviatoricstress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+2*stress.xy.^2);
++md.results.deviatoricstress=deviatoricstress;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech	(revision 13139)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech	(revision 13140)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mech
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++Makefile.in
++Makefile
Index: /issm/oecreview/Archive/12678-13393/ISSM-13140-13141.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13140-13141.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13140-13141.diff	(revision 13394)
@@ -0,0 +1,146 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-win32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-win32.sh	(revision 13140)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-win32.sh	(revision 13141)
+@@ -1,18 +1,18 @@
+ #!/bin/bash
+ 
+ #Some cleanup
+-rm -rf install valgrind-3.7.0
++rm -rf install valgrind-3.8.0
+ mkdir install
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.7.0.tar.bz2' 'valgrind-3.7.0.tar.bz2'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.8.0.tar.bz2' 'valgrind-3.8.0.tar.bz2'
+ 
+ #Untar 
+-tar -jxvf  valgrind-3.7.0.tar.bz2
++tar -jxvf  valgrind-3.8.0.tar.bz2
+ 
+ #Move valgrind into install directory
+-mv valgrind-3.7.0/* install
+-rm -rf valgrind-3.7.0
++mv valgrind-3.8.0/* install
++rm -rf valgrind-3.8.0
+ 
+ #configure
+ cd install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx64.sh	(revision 13140)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx64.sh	(revision 13141)
+@@ -1,18 +1,18 @@
+ #!/bin/bash
+ 
+ #Some cleanup
+-rm -rf install valgrind-3.7.0
++rm -rf install valgrind-3.8.0
+ mkdir install
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.7.0.tar.bz2' 'valgrind-3.7.0.tar.bz2'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.8.0.tar.bz2' 'valgrind-3.8.0.tar.bz2'
+ 
+ #Untar 
+-tar -jxvf  valgrind-3.7.0.tar.bz2
++tar -jxvf  valgrind-3.8.0.tar.bz2
+ 
+ #Move valgrind into install directory
+-mv valgrind-3.7.0/* install
+-rm -rf valgrind-3.7.0
++mv valgrind-3.8.0/* install
++rm -rf valgrind-3.8.0
+ 
+ #configure
+ cd install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-linux64.sh	(revision 13140)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-linux64.sh	(revision 13141)
+@@ -1,18 +1,18 @@
+ #!/bin/bash
+ 
+ #Some cleanup
+-rm -rf install valgrind-3.7.0
++rm -rf install valgrind-3.8.0
+ mkdir install
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.7.0.tar.bz2' 'valgrind-3.7.0.tar.bz2'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.8.0.tar.bz2' 'valgrind-3.8.0.tar.bz2'
+ 
+ #Untar 
+-tar -jxvf  valgrind-3.7.0.tar.bz2
++tar -jxvf  valgrind-3.8.0.tar.bz2
+ 
+ #Move valgrind into install directory
+-mv valgrind-3.7.0/* install
+-rm -rf valgrind-3.7.0
++mv valgrind-3.8.0/* install
++rm -rf valgrind-3.8.0
+ 
+ #configure
+ cd install
+@@ -24,4 +24,4 @@
+ 
+ #final thing: if mpi is compiled in, soft link its target to a simpler name
+ cd lib
+-ln -s valgrind/libmpi*  ./libmpidebug.so
++ln -s valgrind/libmpiwrap-*  ./libmpidebug.so
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-altix64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-altix64.sh	(revision 13140)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-altix64.sh	(revision 13141)
+@@ -1,18 +1,18 @@
+ #!/bin/bash
+ 
+ #Some cleanup
+-rm -rf install valgrind-3.7.0
++rm -rf install valgrind-3.8.0
+ mkdir install
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.7.0.tar.bz2' 'valgrind-3.7.0.tar.bz2'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.8.0.tar.bz2' 'valgrind-3.8.0.tar.bz2'
+ 
+ #Untar 
+-tar -jxvf  valgrind-3.7.0.tar.bz2
++tar -jxvf  valgrind-3.8.0.tar.bz2
+ 
+ #Move valgrind into install directory
+-mv valgrind-3.7.0/* install
+-rm -rf valgrind-3.7.0
++mv valgrind-3.8.0/* install
++rm -rf valgrind-3.8.0
+ 
+ #configure
+ cd install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx32.sh	(revision 13140)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx32.sh	(revision 13141)
+@@ -1,18 +1,18 @@
+ #!/bin/bash
+ 
+ #Some cleanup
+-rm -rf install valgrind-3.7.0
++rm -rf install valgrind-3.8.0
+ mkdir install
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.7.0.tar.bz2' 'valgrind-3.7.0.tar.bz2'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.8.0.tar.bz2' 'valgrind-3.8.0.tar.bz2'
+ 
+ #Untar 
+-tar -jxvf  valgrind-3.7.0.tar.bz2
++tar -jxvf  valgrind-3.8.0.tar.bz2
+ 
+ #Move valgrind into install directory
+-mv valgrind-3.7.0/* install
+-rm -rf valgrind-3.7.0
++mv valgrind-3.8.0/* install
++rm -rf valgrind-3.8.0
+ 
+ #configure
+ cd install
Index: /issm/oecreview/Archive/12678-13393/ISSM-13141-13142.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13141-13142.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13141-13142.diff	(revision 13394)
@@ -0,0 +1,350 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 13141)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 13142)
+@@ -16,57 +16,48 @@
+ /*}}}*/
+ 
+ /*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;
+-	IssmDouble* dtemp;
+ 
+-/*  set up dimensions for triple product  */
++	int         idima,idimb,idimc,idimd;
++	IssmDouble *dtemp;
+ 
+-	if (!itrna) {
++	/*  set up dimensions for triple product  */
++
++	if (!itrna){
+ 		idima=nrowa;
+ 		idimb=ncola;
+ 	}
+-	else {
++	else{
+ 		idima=ncola;
+ 		idimb=nrowa;
+ 	}
+ 
+-	if (!itrnb) {
+-		if (nrowb != idimb) {
+-			_error_("Matrix A and B inner vectors not equal size.");
+-		}
++	if (!itrnb){
++		if (nrowb != idimb) _error_("Matrix A and B inner vectors not equal size.");
+ 		idimc=ncolb;
+ 	}
+-	else {
+-		if (ncolb != idimb) {
+-			_error_("Matrix A and B inner vectors not equal size.");
+-		}
++	else{
++		if (ncolb != idimb) _error_("Matrix A and B inner vectors not equal size.");
+ 		idimc=nrowb;
+ 	}
+ 
+ 	if (!itrnc) {
+-		if (nrowc != idimc) {
+-			_error_("Matrix B and C inner vectors not equal size.");
+-		}
++		if (nrowc != idimc) _error_("Matrix B and C inner vectors not equal size.");
+ 		idimd=ncolc;
+ 	}
+-	else {
+-		if (ncolc != idimc) {
+-			_error_("Matrix B and C inner vectors not equal size.");
+-		}
++	else{
++		if (ncolc != idimc) _error_("Matrix B and C inner vectors not equal size.");
+ 		idimd=nrowc;
+ 	}
+ 
+-/*  perform the matrix triple product in the order that minimizes the
+-	number of multiplies and the temporary space used, noting that
+-	(a*b)*c requires ac(b+d) multiplies and ac IssmDoubles, and a*(b*c)
+-	requires bd(a+c) multiplies and bd IssmDoubles (both are the same for
+-	a symmetric triple product)  */
++	/*  perform the matrix triple product in the order that minimizes the
++		 number of multiplies and the temporary space used, noting that
++		 (a*b)*c requires ac(b+d) multiplies and ac IssmDoubles, and a*(b*c)
++		 requires bd(a+c) multiplies and bd IssmDoubles (both are the same for
++		 a symmetric triple product)  */
+ 
+-/*  multiply (a*b)*c+d  */
+-
++	/*  multiply (a*b)*c+d  */
+ 	if (idima*idimc*(idimb+idimd) <= idimb*idimd*(idima+idimc)) {
+ 		dtemp=xNew<IssmDouble>(idima*idimc);
+ 
+@@ -75,9 +66,8 @@
+ 		xDelete<IssmDouble>(dtemp);
+ 	}
+ 
+-/*  multiply a*(b*c)+d  */
+-
+-	else {
++	/*  multiply a*(b*c)+d  */
++	else{
+ 		dtemp=xNew<IssmDouble>(idimb*idimd);
+ 
+ 		MatrixMultiply(b,nrowb,ncolb,itrnb,c,nrowc,ncolc,itrnc,dtemp,0);
+@@ -88,13 +78,13 @@
+ 	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;
+ 	int nrowc,ncolc,iinca,jinca,iincb,jincb,ntrma,ntrmb,nterm;
+ 
+-/*  set up dimensions and increments for matrix a  */
++	/*  set up dimensions and increments for matrix a  */
+ 	if (!itrna) {
+ 		nrowc=nrowa;
+ 		ntrma=ncola;
+@@ -108,7 +98,7 @@
+ 		jinca=ncola;
+ 	}
+ 
+-/*  set up dimensions and increments for matrix b  */
++	/*  set up dimensions and increments for matrix b  */
+ 	if (!itrnb) {
+ 		ncolc=ncolb;
+ 		ntrmb=nrowb;
+@@ -122,34 +112,25 @@
+ 		jincb=ncolb;
+ 	}
+ 
+-	if (ntrma != ntrmb) {
+-		_error_("Matrix A and B inner vectors not equal size");
+-	    noerr=0;	
+-		return noerr;
+-	}
+-	else
+-		nterm=ntrma;
++	if (ntrma != ntrmb) _error_("Matrix A and B inner vectors not equal size");
+ 
+-/*  zero matrix c, if not being added to product  */
++	nterm=ntrma;
+ 
+-	if (!iaddc)
+-		for (i=0; i<nrowc*ncolc; i++)
+-			*(c+i)=0.;
++	/*  zero matrix c, if not being added to product  */
++	if (!iaddc) for (i=0;i<nrowc*ncolc;i++) c[i]=0.;
+ 
+-/*  perform the matrix multiplication  */
+-
++	/*  perform the matrix multiplication  */
+ 	iptc=0;
+-	for (i=0; i<nrowc; i++) {
+-		for (j=0; j<ncolc; j++) {
++	for (i=0; i<nrowc; i++){
++		for (j=0; j<ncolc; j++){
+ 			ipta=i*iinca;
+ 			iptb=j*jincb;
+ 
+-			for (k=0; k<nterm; k++) {
+-				*(c+iptc)+=*(a+ipta)**(b+iptb);
++			for (k=0; k<nterm; k++){
++				c[iptc]+=a[ipta]*b[iptb];
+ 				ipta+=jinca;
+ 				iptb+=iincb;
+ 			}
+-
+ 			iptc++;
+ 		}
+ 	}
+@@ -158,16 +139,16 @@
+ }/*}}}*/
+ /*FUNCTION MatrixInverse {{{*/
+ int MatrixInverse( IssmDouble* a, int ndim, int nrow, IssmDouble* b, int nvec, IssmDouble* pdet ){
+-/* MatrixInverse    Perform matrix inversion and linear equation solution.
++	/* MatrixInverse    Perform matrix inversion and linear equation solution.
+ 
+-	This function uses Gaussian elimination on the original matrix
+-	augmented by an identity matrix of the same size to calculate
+-	the inverse (see for example, "Modern Methods of Engineering
+-	Computation", Sec. 6.4).  By noting how the matrices are
+-	unpopulated and repopulated, the calculation may be done in place.
++		This function uses Gaussian elimination on the original matrix
++		augmented by an identity matrix of the same size to calculate
++		the inverse (see for example, "Modern Methods of Engineering
++		Computation", Sec. 6.4).  By noting how the matrices are
++		unpopulated and repopulated, the calculation may be done in place.
+ 
+-	Gaussian elimination is inherently inefficient, and so this is
+-	intended for small matrices.  */
++		Gaussian elimination is inherently inefficient, and so this is
++		intended for small matrices.  */
+ 	int noerr=1;
+ 	int i,j,k,ipt,jpt,irow,icol,ipiv,ncol;
+ 	int *pivrc1,*pivrc2,*pindx;
+@@ -183,7 +164,7 @@
+ 	_assert_(!(ndim==2 && nrow==2));
+ 	_assert_(!(ndim==3 && nrow==3));
+ 
+-/*  initialize local variables and arrays  */
++	/*  initialize local variables and arrays  */
+ 
+ 	ncol=nrow;
+ 	det=1.;
+@@ -191,23 +172,23 @@
+ 	pivrc2 =xNew<int>(nrow);
+ 	pindx =xNew<int>(nrow);
+ 
+-/*  loop over the rows/columns of the matrix  */
++	/*  loop over the rows/columns of the matrix  */
+ 
+ 	for (i=0; i<nrow; i++) {
+ 
+-/*  search for pivot, finding the term with the greatest magnitude
+-	in the rows/columns not yet used  */
++		/*  search for pivot, finding the term with the greatest magnitude
++			 in the rows/columns not yet used  */
+ 
+ 		pivot=0.;
+ 		for (j=0; j<nrow; j++)
+-			if (!pindx[j])
+-				for (k=0; k<ncol; k++)
+-					if (!pindx[k])
+-						if (fabs(a[j*ndim+k]) > fabs(pivot)) {
+-							irow=j;
+-							icol=k;
+-							pivot=a[j*ndim+k];
+-						}
++		 if (!pindx[j])
++		  for (k=0; k<ncol; k++)
++			if (!pindx[k])
++			 if (fabs(a[j*ndim+k]) > fabs(pivot)) {
++				 irow=j;
++				 icol=k;
++				 pivot=a[j*ndim+k];
++			 }
+ 
+ 		if (fabs(pivot) < DBL_EPSILON) {
+ 			xDelete<int>(pivrc1);
+@@ -224,15 +205,15 @@
+ 		ipiv=icol;
+ 		pindx[ipiv]++;
+ 
+-//		_printf_(true,"pivot for i=%d: irow=%d, icol=%d, pindx[%d]=%d\n",
+-//				 i,irow,icol,ipiv,pindx[ipiv]);
++		//		_printf_(true,"pivot for i=%d: irow=%d, icol=%d, pindx[%d]=%d\n",
++		//				 i,irow,icol,ipiv,pindx[ipiv]);
+ 
+-/*  switch rows to put pivot element on diagonal, noting that the
+-	column stays the same and the determinant changes sign  */
++		/*  switch rows to put pivot element on diagonal, noting that the
++			 column stays the same and the determinant changes sign  */
+ 
+ 		if (irow != icol) {
+-//			_printf_(true,"row switch for i=%d: irow=%d, icol=%d\n",
+-//					 i,irow,icol);
++			//			_printf_(true,"row switch for i=%d: irow=%d, icol=%d\n",
++			//					 i,irow,icol);
+ 
+ 			ipt=irow*ndim;
+ 			jpt=icol*ndim;
+@@ -253,28 +234,28 @@
+ 			det=-det;
+ 		}
+ 
+-/*  divide pivot row by pivot element, noting that the original
+-	matrix will have 1 on the diagonal, which will be discarded,
+-	and the augmented matrix will start with 1 from the identity
+-	matrix and then have 1/pivot, which is part of the inverse.  */
++		/*  divide pivot row by pivot element, noting that the original
++			 matrix will have 1 on the diagonal, which will be discarded,
++			 and the augmented matrix will start with 1 from the identity
++			 matrix and then have 1/pivot, which is part of the inverse.  */
+ 
+ 		a[ipiv*ndim+ipiv]=1.;
+ 
+ 		ipt=ipiv*ndim;
+ 		for (k=0; k<ncol; k++)
+-			a[ipt+k]/=pivot;
++		 a[ipt+k]/=pivot;
+ 
+ 		ipt=ipiv*nvec;
+ 		for (k=0; k<nvec; k++)
+-			b[ipt+k]/=pivot;
++		 b[ipt+k]/=pivot;
+ 
+-/*  reduce non-pivot rows such that they will have 0 in the pivot
+-	column, which will be discarded, and the augmented matrix will
+-	start with 0 from the identity matrix and then have non-zero
+-	in the corresponding column, which is part of the inverse.
+-	only one column of the augmented matrix is populated at a time,
+-	which corresponds to the only column of the original matrix
+-	being zeroed, so that the inverse may be done in place.  */
++		/*  reduce non-pivot rows such that they will have 0 in the pivot
++			 column, which will be discarded, and the augmented matrix will
++			 start with 0 from the identity matrix and then have non-zero
++			 in the corresponding column, which is part of the inverse.
++			 only one column of the augmented matrix is populated at a time,
++			 which corresponds to the only column of the original matrix
++			 being zeroed, so that the inverse may be done in place.  */
+ 
+ 		for (j=0; j<nrow; j++) {
+ 			if (j == ipiv) continue;
+@@ -286,25 +267,25 @@
+ 				ipt=j   *ndim;
+ 				jpt=ipiv*ndim;
+ 				for (k=0; k<ncol; k++)
+-					a[ipt+k]-=dtemp*a[jpt+k];
++				 a[ipt+k]-=dtemp*a[jpt+k];
+ 
+ 				ipt=j   *nvec;
+ 				jpt=ipiv*nvec;
+ 				for (k=0; k<nvec; k++)
+-					b[ipt+k]-=dtemp*b[jpt+k];
++				 b[ipt+k]-=dtemp*b[jpt+k];
+ 			}
+ 		}
+ 
+-/*  for a diagonal matrix, the determinant is the product of the
+-	diagonal terms, and so it may be accumulated from the pivots,
+-	noting that switching rows changes the sign as above  */
++		/*  for a diagonal matrix, the determinant is the product of the
++			 diagonal terms, and so it may be accumulated from the pivots,
++			 noting that switching rows changes the sign as above  */
+ 
+ 		det*=pivot;
+ 	}
+ 
+-/*  switch columns back in reverse order, noting that a row switch
+-	in the original matrix corresponds to a column switch in the
+-	inverse matrix  */
++	/*  switch columns back in reverse order, noting that a row switch
++		 in the original matrix corresponds to a column switch in the
++		 inverse matrix  */
+ 
+ 	for (i=0; i<nrow; i++) {
+ 		j=(nrow-1)-i;
+@@ -313,8 +294,8 @@
+ 			irow=pivrc1[j];
+ 			icol=pivrc2[j];
+ 
+-//			_printf_(true,"column switch back for j=%d: irow=%d, icol=%d\n",
+-//					 j,irow,icol);
++			//			_printf_(true,"column switch back for j=%d: irow=%d, icol=%d\n",
++			//					 j,irow,icol);
+ 
+ 			ipt=0;
+ 			for (k=0; k<nrow; k++) {
+@@ -362,7 +343,7 @@
+ 	/*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];
++	*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) {{{*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-13142-13143.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13142-13143.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13142-13143.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/README
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/README	(revision 13142)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/README	(revision 13143)
+@@ -32,6 +32,5 @@
+ Add the id and testname in IdToName.m (incresing order)
+ We try not to create too many .par and .exp files, so try to use the existing ones as much as possible.
+ To modify some characteristics, do it in the testxxx.m file.
+-The testxxx_nightly.m is used to define the parameters you want to check in the nightlyruns.
+-Specify the field_names the field_values and the tolerance in this file.
+-Don't forget to commit the archive (Archivexxx in ../Archives)
++Specify the field_names the field_values and the tolerance at the end of the test file.
++Don't forget to commit the archive (Archivexxx.nc in ../Archives)
Index: /issm/oecreview/Archive/12678-13393/ISSM-13143-13144.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13143-13144.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13143-13144.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am	(revision 13143)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/Makefile.am	(revision 13144)
+@@ -21,7 +21,7 @@
+ 				 ./geometry/*.m \
+ 				 ./interp/*.m \
+ 				 ./latlong/*.m \
+-				 ./meca/*.m \
++				 ./mech/*.m \
+ 				 ./mesh/*.m \
+ 				 ./mesh/planet/*.m \
+ 				 ./mesh/rifts/*.m \
Index: /issm/oecreview/Archive/12678-13393/ISSM-13144-13145.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13144-13145.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13144-13145.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh	(revision 13144)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh	(revision 13145)
+@@ -65,6 +65,12 @@
+ 	setenv PATH {$AUTOMAKE_DIR}/bin:{$PATH}
+ endif
+ 
++#LIBTOOL
++set LIBTOOL_DIR="$ISSM_DIR/externalpackages/libtool/install"
++if (-d $LIBTOOL_DIR) then
++	setenv PATH {$LIBTOOL_DIR}/bin:{$PATH}
++endif
++
+ #SSH
+ set SSH_DIR="$ISSM_DIR/externalpackages/ssh"
+ if (-d $SSH_DIR) then
Index: /issm/oecreview/Archive/12678-13393/ISSM-13145-13146.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13145-13146.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13145-13146.diff	(revision 13394)
@@ -0,0 +1,392 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1301.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1301.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1301.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1301.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1301.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1208.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1208.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1208.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1208.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1208.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1203.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1203.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1203.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1203.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1203.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1105.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1105.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1105.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1105.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1105.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1602.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1602.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1602.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1602.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1602.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1302.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1302.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1302.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1302.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1302.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1204.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1204.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1204.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1204.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1204.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1401.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1401.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1401.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1401.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1401.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1106.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1106.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1106.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1106.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1106.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1101.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1101.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1101.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1101.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1101.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1303.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1303.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1303.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1303.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1303.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1110.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1110.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1110.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1110.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1110.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1205.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1205.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1205.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1205.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1205.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1402.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1402.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1402.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1402.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1402.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1107.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1107.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1107.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1107.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1107.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1102.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1102.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1102.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1102.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1102.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1304.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1304.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1304.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1304.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1304.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1501.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1501.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1501.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1501.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1501.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1206.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1206.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1206.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1206.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1206.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1201.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1201.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1201.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1201.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1201.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1108.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1108.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1108.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1108.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1108.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1103.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1103.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1103.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1103.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1103.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1502.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1502.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1502.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1502.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1502.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1207.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1207.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1207.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1207.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1207.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1202.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1202.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1202.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1202.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1202.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1109.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1109.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1109.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1109.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1109.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1104.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1104.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1104.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1104.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1104.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1601.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1601.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1601.nc	(revision 13145)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1601.nc	(revision 13146)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1601.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-13146-13147.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13146-13147.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13146-13147.diff	(revision 13394)
@@ -0,0 +1,28 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh	(revision 13146)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh	(revision 13147)
+@@ -101,3 +101,9 @@
+ if (-d $CMAKE_DIR) then
+ 	setenv PATH {$PATH}:{$CMAKE_DIR}/bin
+ endif
++
++#YAMS
++set YAMS_DIR="$ISSM_DIR/externalpackages/yams/install"
++if (-d $YAMS_DIR) then
++	setenv PATH {$PATH}:{$YAMS_DIR}/bin
++endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13146)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13147)
+@@ -360,3 +360,9 @@
+ 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SQLITE_DIR/lib"
+ 	export LIBRARY_PATH="$LIBRARY_PATH:$SQLITE_DIR/lib"
+ fi
++
++#YAMS
++YAMS_DIR="$ISSM_DIR/externalpackages/yams/install"
++if [ -d "$YAMS_DIR" ]; then
++	export PATH="$PATH:$YAMS_DIR"
++fi
Index: /issm/oecreview/Archive/12678-13393/ISSM-13147-13148.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13147-13148.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13147-13148.diff	(revision 13394)
@@ -0,0 +1,37 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13147)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.m	(revision 13148)
+@@ -82,19 +82,19 @@
+ 			num_controls=numel(md.inversion.control_parameters);
+ 			num_costfunc=size(md.inversion.cost_functions,2);
+ 
+-			checkfield(md,'inversion.iscontrol','values',[0 1]);
+-			checkfield(md,'inversion.tao','values',[0 1]);
+-			checkfield(md,'inversion.incomplete_adjoint','values',[0 1]);
+-			checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'MaterialsRheologyZbar' 'Vx' 'Vy'});
+-			checkfield(md,'inversion.nsteps','numel',1,'>=',1);
+-			checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
+-			checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps 1]);
+-			checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps num_costfunc],'values',[101:105 201 501:503]);
+-			checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
+-			checkfield(md,'inversion.gradient_only','values',[0 1]);
+-			checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
+-			checkfield(md,'inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
+-			checkfield(md,'inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
++			md = checkfield(md,'inversion.iscontrol','values',[0 1]);
++			md = checkfield(md,'inversion.tao','values',[0 1]);
++			md = checkfield(md,'inversion.incomplete_adjoint','values',[0 1]);
++			md = checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'MaterialsRheologyZbar' 'Vx' 'Vy'});
++			md = checkfield(md,'inversion.nsteps','numel',1,'>=',1);
++			md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
++			md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps 1]);
++			md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps num_costfunc],'values',[101:105 201 501:505]);
++			md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
++			md = checkfield(md,'inversion.gradient_only','values',[0 1]);
++			md = checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
++			md = checkfield(md,'inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
++			md = checkfield(md,'inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
+ 
+ 			if solution==BalancethicknessSolutionEnum()
+ 				md = checkfield(md,'inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13148-13149.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13148-13149.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13148-13149.diff	(revision 13394)
@@ -0,0 +1,472 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13148)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13149)
+@@ -1,5 +1,48 @@
+ #ISSM_DIR and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...)
+ 
++pathprepend(){ #{{{
++	if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
++		PATH="$1:$PATH"
++	fi
++} #}}}
++pathappend(){ #{{{
++	if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
++		export PATH="$PATH:$1"
++	fi
++} #}}}
++libpathprepend(){ #{{{
++	if [ -d "$1" ] && [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
++		export LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH"
++	fi
++	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
++		export LD_RUN_PATH="$1:$LD_RUN_PATH"
++	fi
++} #}}}
++libpathappend(){ #{{{
++	if [ -d "$1" ] && [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
++		export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$1"
++	fi
++	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
++		export LD_RUN_PATH="$LD_RUN_PATH:$1"
++	fi
++} #}}}
++dylibpathprepend(){ #{{{
++	if [ -d "$1" ] && [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
++		export LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH"
++	fi
++	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
++		export LD_RUN_PATH="$1:$LD_RUN_PATH"
++	fi
++} #}}}
++dylibpathappend(){ #{{{
++	if [ -d "$1" ] && [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
++		export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$1"
++	fi
++	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
++		export LD_RUN_PATH="$LD_RUN_PATH:$1"
++	fi
++} #}}}
++
+ #FIXME: during installation packages are installed one by one but environment.sh was sourced
+ #before so new packages are NOT in the path.
+ #may resource environment.sh with:
+@@ -11,135 +54,78 @@
+ fi
+ 
+ #Some basic path, in case it is not included by default
+-export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
+-export LD_RUN_PATH="$LD_RUN_PATH:/usr/local/lib"
++libpathappend "/usr/local/lib"
+ 
+ #Load ISSM scripts
+-export PATH="$PATH:$ISSM_DIR/scripts"
++pathappend "$ISSM_DIR/scripts"
+ 
+-#MATLAB
+ MATLAB_DIR="$ISSM_DIR/externalpackages/matlab/install"
+-#if [ -d "$MATLAB_DIR" ]; then
+-	export MATLAB_DIR
+-	export PATH="$MATLAB_DIR/bin:$PATH" #take precedence over /usr/local/bin/matlab
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MATLAB_DIR/lib"
+-	export LD_RUN_PATH="$LD_RUN_PATH:$MATLAB_DIR/lib"
+-#fi
++export MATLAB_DIR
++pathprepend   "$MATLAB_DIR/bin" #take precedence over /usr/local/bin/matlab
++libpathappend "$MATLAB_DIR/lib"
+ 
+-#MPI
+ MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install"
+-#if [ -d "$MPI_DIR" ]; then
+-	export MPI_DIR
+-	export PATH="$MPI_DIR/bin:$PATH"
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MPI_DIR/lib"
+-	export LD_RUN_PATH="$LD_RUN_PATH:$MPI_DIR/lib"
+-	export MANPATH="$MANPATH:$MPI_DIR/man"
+-#fi
++export MPI_DIR
++pathprepend   "$MPI_DIR/bin"
++libpathappend "$MPI_DIR/lib"
+ 
+-#PETSC
+ PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"
+-#if [ -d "$PETSC_DIR" ]; then
+-	export PETSC_DIR
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PETSC_DIR/lib:$PETSC_DIR/lib"
+-	export LD_RUN_PATH="$LD_RUN_PATH:$PETSC_DIR/lib"
+-#fi
++export PETSC_DIR
++libpathappend "$PETSC_DIR/lib"
+ 
+-#SLEPC
+ SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install"
+-if [ -d "$SLEPC_DIR" ]; then
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SLEPC_DIR/lib/$ISSM_ARCH"
+-	export LD_RUN_PATH="$LD_RUN_PATH:$SLEPC_DIR/lib/$ISSM_ARCH"
+-fi
++libpathappend "$SLEPC_DIR/lib/$ISSM_ARCH"
+ 
+-#PETSC
+ TAO_DIR="$ISSM_DIR/externalpackages/tao/install"
+-if [ -d "$TAO_DIR" ]; then
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TAO_DIR/lib:$TAO_DIR/lib"
+-	export LD_RUN_PATH="$LD_RUN_PATH:$TAO_DIR/lib"
+-fi
++libpathappend "$TAO_DIR/lib"
+ 
+-#Dakota
+ DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"
+-if [ -d "$DAKOTA_DIR" ]; then
+-	export PATH="$PATH:$DAKOTA_DIR/bin"
+-	export MANPATH="$MANPATH:$MPI_DIR/man:$DAKOTA_DIR/docs/man:$DAKOTA_DIR/docs/man-ref"
+-fi
++pathappend "$DAKOTA_DIR/bin"
+ 
+-#Doxygen
+ DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install"
+-if [ -d "$DOXYGEN_DIR" ]; then
+-	export MANPATH="$MANPATH:$DOXYGEN_DIR/man"
+-	export PATH="$PATH:$DOXYGEN_DIR/bin"
+-fi
++pathappend "$DOXYGEN_DIR/bin"
+ 
+-#AUTOCONF
+ AUTOCONF_DIR="$ISSM_DIR/externalpackages/autoconf/install"
+-#if [ -d "$AUTOCONF_DIR" ]; then
+-	export PATH="$AUTOCONF_DIR/bin:$PATH"
+-#fi
++pathprepend "$AUTOCONF_DIR/bin"
+ 
+-#AUTOMAKE
+ AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install"
+-#if [ -d "$AUTOMAKE_DIR" ]; then
+-	export PATH="$AUTOMAKE_DIR/bin:$PATH"
+-#fi
++pathprepend "$AUTOMAKE_DIR/bin"
+ 
+-#LIBTOOL
+ LIBTOOL_DIR="$ISSM_DIR/externalpackages/libtool/install"
+-#if [ -d "$LIBTOOL_DIR" ]; then
+-	export PATH="$LIBTOOL_DIR/bin:$PATH"
+-#fi
++pathprepend "$LIBTOOL_DIR/bin"
+ 
+-#SDK
+ SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU"
+-if [ -d "$SDK_DIR" ]; then
+-	export PATH="$PATH:$SDK_DIR"
+-fi
++pathappend "$SDK_DIR"
+ 
+-#SSH
+ SSH_DIR="$ISSM_DIR/externalpackages/ssh"
+-if [ -d "$SSH_DIR" ]; then
+-	export PATH="$PATH:$SSH_DIR"
+-fi
++pathappend "$SSH_DIR"
+ 
+-#VALGRIND
+ VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install"
+-if [ -d "$VALGRIND_DIR" ]; then
+-	export PATH="$VALGRIND_DIR/bin:$PATH"
+-fi
++pathprepend "$VALGRIND_DIR/bin"
+ 
+-#CPPCHECK
+ CPPCHECK_DIR="$ISSM_DIR/externalpackages/cppcheck/install"
+-if [ -d "$CPPCHECK_DIR" ]; then
+-	export PATH="$PATH:$CPPCHECK_DIR/bin"
+-fi
++pathappend "$CPPCHECK_DIR/bin"
+ 
+-#GDAL
+ GDAL_DIR="$ISSM_DIR/externalpackages/gdal/install"
+-if [ -d "$GDAL_DIR" ]; then
+-	export PATH="$GDAL_DIR/bin:$PATH"
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GDAL_DIR/lib"
+-fi
++pathprepend "$GDAL_DIR/bin:$PATH"
++libpathappend "$GDAL_DIR/lib"
+ 
+-#MERCURIAL
+ MERCURIAL_DIR="$ISSM_DIR/externalpackages/mercurial/install"
+ if [ -d "$MERCURIAL_DIR" ]; then
+ 	export PYTHONPATH="$PYTHONPATH:$MERCURIAL_DIR/mercurial/pure/"
+-	export PATH="$PATH:$MERCURIAL_DIR/"
++	pathappend "$MERCURIAL_DIR"
+ fi
+ 
+-#BOOST
+ BOOST_DIR="$ISSM_DIR/externalpackages/boost/install"
+ BOOSTROOT="$ISSM_DIR/externalpackages/boost/install"
+ if [ -d "$BOOST_DIR" ]; then
+ 	export BOOSTROOT
+ 	export BOOST_DIR
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BOOST_DIR/lib"
+-	export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$BOOST_DIR/lib"
+-	export PATH="$PATH:$BOOST_DIR/bin"
++	libpathappend   "$BOOST_DIR/lib"
++	dylibpathappend "$BOOST_DIR/lib"
++	pathappend      "$BOOST_DIR/bin"
+ fi
+ 
+-#XERCES
+ XERCESROOT="$ISSM_DIR/externalpackages/xerces/install"
+ XERCESCROOT="$ISSM_DIR/externalpackages/xerces/src"
+ if [ -d "$XERCESROOT" ]; then
+@@ -147,7 +133,6 @@
+ 	export XERCESCROOT
+ fi
+ 
+-#xaifBooster
+ XAIF_DIR="$ISSM_DIR/externalpackages/xaifbooster/xaifBooster"
+ XAIFBOOSTERROOT="$ISSM_DIR/externalpackages/xaifbooster/"
+ XAIFBOOSTER_HOME="$ISSM_DIR/externalpackages/xaifbooster/xaifBooster"
+@@ -159,210 +144,117 @@
+ 	export PLATFORM
+ fi
+ 
+-#angel
+ ANGELROOT="$ISSM_DIR/externalpackages/angel/angel"
+ if [ -d "$ANGELROOT" ]; then
+ 	export ANGELROOT
+ fi
+ 
+-#openanalysis
+ OPENANALYSISROOT="$ISSM_DIR/externalpackages/openanalysis/install"
+ if [ -d "$OPENANALYSISROOT" ]; then
+ 	export OPENANALYSISROOT
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPENANALYSISROOT/lib"
++	libpathappend "$OPENANALYSISROOT/lib"
+ fi
+ 
+-#JAVA
+ JVM_DIR="/usr/local/gcc/4.3.2/lib64/gcj-4.3.2-9/"
+-if [ -d "$JVM_DIR" ]; then
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$JVM_DIR"
+-fi
++libpathappend "$JVM_DIR"
+ 
+-#BBFTP
+ BBFTP_DIR="$ISSM_DIR/externalpackages/bbftp/install"
+-if [ -d "$BBFTP_DIR" ]; then
+-	export PATH="$PATH:$BBFTP_DIR/bin"
+-fi
++pathappend "$BBFTP_DIR/bin"
+ 
+-#ADIC
+ ADIC_DIR="$ISSM_DIR/externalpackages/adic/install"
+-if [ -d "$ADIC_DIR" ]; then
+-	export PATH="$PATH:$ADIC_DIR/bin"
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ADIC_DIR/lib"
+-	export LD_RUN_PATH="$LD_RUN_PATH:$ADIC_DIR/lib"
+-fi
++pathappend "$ADIC_DIR/bin"
++libpathappend "$ADIC_DIR/lib"
+ 
+-#COLPACK
+ COLPACK_DIR="$ISSM_DIR/externalpackages/colpack/install"
+-if [ -d "$COLPACK_DIR" ]; then
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$COLPACK_DIR/lib"
+-	export LD_RUN_PATH="$LD_RUN_PATH:$COLPACK_DIR/lib"
+-fi
++libpathappend "$COLPACK_DIR/lib"
+ 
+-#ECLIPSE
+ ECLIPSE_DIR="$ISSM_DIR/externalpackages/eclipse/install"
+-if [ -d "$ECLIPSE_DIR" ]; then
+-	export PATH="$PATH:$ECLIPSE_DIR"
+-fi
++pathappend "$ECLIPSE_DIR"
+ 
+-#APPSCAN
+ APPSCAN_DIR="$ISSM_DIR/externalpackages/appscan/install"
+-if [ -d "$APPSCAN_DIR" ]; then
+-	export PATH="$PATH:$APPSCAN_DIR/bin"
+-fi
++pathappend "$APPSCAN_DIR/bin"
+ 
+-#RATS
+ RATS_DIR="$ISSM_DIR/externalpackages/rats/install"
+-if [ -d "$RATS_DIR" ]; then
+-	export PATH="$PATH:$RATS_DIR/bin"
+-fi
++pathappend "$RATS_DIR/bin"
+ 
+-#DYSON
+ DYSON_DIR="$ISSM_DIR/externalpackages/dyson/"
+-if [ -d "$DYSON_DIR" ]; then
+-	export PATH="$PATH:$DYSON_DIR"
+-fi
++pathappend "$DYSON_DIR"
+ 
+-#CMAKE
+ CMAKE_DIR="$ISSM_DIR/externalpackages/cmake/install"
+-if [ -d "$CMAKE_DIR" ]; then
+-	export PATH="$PATH:$CMAKE_DIR/bin"
+-fi
++pathappend "$CMAKE_DIR/bin"
+ 
+-#SHAPELIB
+ SHAPELIB_DIR="$ISSM_DIR/externalpackages/shapelib/install"
+-if [ -d "$SHAPELIB_DIR" ]; then
+-	export PATH="$PATH:$SHAPELIB_DIR/exec"
+-fi
++pathappend "$SHAPELIB_DIR/exec"
+ 
+-#CCCL
+ CCCL_DIR="$ISSM_DIR/externalpackages/cccl/install"
+-if [ -d "$CCCL_DIR" ]; then
+-	export PATH="$PATH:$CCCL_DIR/bin"
+-fi
++pathappend "$CCCL_DIR/bin"
+ 
+-#PACKAGEMAKER
+ PACKAGEMAKER_DIR="$ISSM_DIR/externalpackages/packagemaker/install"
+-if [ -d "$PACKAGEMAKER_DIR" ]; then
+-	export PATH="$PATH:$PACKAGEMAKER_DIR"
+-fi
++pathappend "$PACKAGEMAKER_DIR"
+ 
+-#ANDROID_NDK:
+ ANDROID_NDK_DIR="$ISSM_DIR/externalpackages/android-ndk/install"
+-if [ -d "$ANDROID_NDK_DIR" ]; then
+-	export PATH="$PATH:$ANDROID_NDK_DIR/"
+-fi
++pathappend "$ANDROID_NDK_DIR/"
+ 
+-#ANDROID_SDK
+ ANDROID_SDK_DIR="$ANDROID_DIR/android-sdk/install-sdk"
+-if [ -d "$ANDROID_SDK_DIR" ]; then
+-	export PATH="$PATH:$ANDROID_SDK_DIR/"
+-fi
++pathappend "$ANDROID_SDK_DIR/"
+ 
+-#GSL
+ GSL_DIR="$ISSM_DIR/externalpackages/gsl/install"
+-if [ -d "$GSL_DIR" ]; then
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GSL_DIR/lib"
+-	export LD_RUN_PATH="$LD_RUN_PATH:$GSL_DIR/lib"
+-fi
++libpathappend "$GSL_DIR/lib"
+ 
+-#GMAKE
+ GMAKE_DIR="$ISSM_DIR/externalpackages/gmake/install"
+-if [ -d "$GMAKE_DIR" ]; then
+-	export PATH="$GMAKE_DIR/bin:$PATH"
+-fi
++pathprepend "$GMAKE_DIR/bin"
+ 
+-#PYTHON
+ PYTHON_DIR="$ISSM_DIR/externalpackages/python/install"
+ if [ -d "$PYTHON_DIR" ]; then
+-	PYTHONSTARTUP="$ISSM_DIR/startup.py"
+-	export PATH="$PYTHON_DIR/bin:$PATH"
+ 	export PYTHONPATH="$PYTHONPATH:$ISSM_DIR/src/modules/python"
+-	export LD_LIBRARY_PATH=$ISSM_DIR/src/modules/python:$ISSM_DIR/externalpackages/python/install/lib:$LD_LIBRARY_PATH
+ 	export PYTHONSTARTUP="$ISSM_DIR/startup.py"
++	pathprepend    "$PYTHON_DIR/bin"
++	libpathprepend "$ISSM_DIR/src/modules/python"
++	libpathprepend "$PYTHON_DIR/lib"
+ fi
+ 
+-#MODELE
+ MODELE_DIR="$ISSM_DIR/externalpackages/modelE/install"
+-if [ -d "$MODELE_DIR" ]; then
+-	export PATH="$MODELE_DIR/src/exec:$PATH"
+-fi
++pathappend "$MODELE_DIR/src/exec"
+ 
+-#GIT
+ GIT_DIR="$ISSM_DIR/externalpackages/git/install"
+-if [ -d "$GIT_DIR" ]; then
+-	export PATH="$PATH:$GIT_DIR/bin"
+-fi
++pathappend "$GIT_DIR/bin"
+ 
+-#NCVIEW
+ NCVIEW_DIR="$ISSM_DIR/externalpackages/ncview/install"
+-if [ -d "$NCVIEW_DIR" ]; then
+-	export PATH="$PATH:$NCVIEW_DIR"
+-fi
++pathappend "$NCVIEW_DIR"
+ 
+-#TCLX
+ TCLX_DIR="$ISSM_DIR/externalpackages/tclx/install/lib/tclx8.4"
+-if [ -d "$TCLX_DIR" ]; then
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TCLX_DIR"
+-	export LD_RUN_PATH="$LD_RUN_PATH:$TCLX_DIR"
+-fi
++libpathappend "$TCLX_DIR"
+ 
+-#ASPELL
+ ASPELL_DIR="$ISSM_DIR/externalpackages/aspell/install"
+-if [ -d "$ASPELL_DIR" ]; then
+-	export PATH="$ASPELL_DIR/bin:$PATH"
+-fi
++pathappend "$ASPELL_DIR/bin:$PATH"
+ 
+-#ESMF
+-ESMF_DIR="$ISSM_DIR/externalpackages/esmf/esmf"
+-if [ -d "$ESMF_DIR" ]; then
+-	export ESMF_COMPILER=gfortran
+-	export ESMF_COMM=mpich2
+-fi
+-
+-#HDF5
+ HDF5_DIR="$ISSM_DIR/externalpackages/hdf5/install"
+ if [ -d "$HDF5_DIR" ]; then
+-	export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$HDF5_DIR/lib"
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HDF5_DIR/lib"
++	dylibpathappend "$HDF5_DIR/lib"
++	libpathappend "$HDF5_DIR/lib"
+ 	export LIBRARY_PATH="$LIBRARY_PATH:$HDF5_DIR/lib"
+ 	export C_INCLUDE_PATH="$C_INCLUDE_PATH:$HDF5_DIR/include"
+ fi
+ 
+-#SVN
+ SVN_DIR="$ISSM_DIR/externalpackages/svn/install"
+ if [ -d "$SVN_DIR" ]; then
+-	export PATH="$SVN_DIR/bin:$PATH"
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SVN_DIR/lib"
+-	export LIBRARY_PATH="$LIBRARY_PATH:$SVN_DIR/lib"
++	pathprepend   "$SVN_DIR/bin"
++	libpathappend "$SVN_DIR/lib"
+ fi
+ 
+-#APR
+ APR_DIR="$ISSM_DIR/externalpackages/apr/install"
+ if [ -d "$APR_DIR" ]; then
+-	export PATH="$APR_DIR/bin:$PATH"
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APR_DIR/lib"
+-	export LIBRARY_PATH="$LIBRARY_PATH:$APR_DIR/lib"
++	pathappend    "$APR_DIR/bin"
++	libpathappend "$APR_DIR/lib"
+ fi
+ 
+-#APR_UTIL
+ APR_UTIL_DIR="$ISSM_DIR/externalpackages/apr-util/install"
+-if [ -d "$APR_UTIL_DIR" ]; then
+-	export PATH="$APR_UTIL_DIR/bin:$PATH"
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APR_UTIL_DIR/lib"
+-	export LIBRARY_PATH="$LIBRARY_PATH:$APR_UTIL_DIR/lib"
+-fi
++pathappend   "$APR_UTIL_DIR/bin:$PATH"
++libpathappend "$APR_UTIL_DIR/lib"
+ 
+-#SQLITE
+ SQLITE_DIR="$ISSM_DIR/externalpackages/sqlite/install"
+-if [ -d "$SQLITE_DIR" ]; then
+-	export PATH="$SQLITE_DIR/bin:$PATH"
+-	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SQLITE_DIR/lib"
+-	export LIBRARY_PATH="$LIBRARY_PATH:$SQLITE_DIR/lib"
+-fi
++pathappend   "$SQLITE_DIR/bin"
++libpathappend "$SQLITE_DIR/lib"
+ 
+-#YAMS
+ YAMS_DIR="$ISSM_DIR/externalpackages/yams/install"
+-if [ -d "$YAMS_DIR" ]; then
+-	export PATH="$PATH:$YAMS_DIR"
+-fi
++pathappend   "$YAMS_DIR"
Index: /issm/oecreview/Archive/12678-13393/ISSM-13149-13150.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13149-13150.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13149-13150.diff	(revision 13394)
@@ -0,0 +1,346 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13149)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13150)
+@@ -1,4 +1,5 @@
+ #module imports {{{
++import numpy
+ from mesh import mesh
+ from mask import mask
+ from geometry import geometry
+@@ -36,6 +37,7 @@
+ from ismumps import *
+ from mumpsoptions import *
+ from iluasmoptions import *
++from project3d import *
+ #}}}
+ 
+ class model(object):
+@@ -166,3 +168,250 @@
+ 		self.private.isconsistent=False
+ 	# }}}
+ 
++	def extrude(md,*args):    # {{{
++		"""
++		EXTRUDE - vertically extrude a 2d mesh
++
++		   vertically extrude a 2d mesh and create corresponding 3d mesh.
++		   The vertical distribution can:
++		    - follow a polynomial law
++		    - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
++		    - be discribed by a list of coefficients (between 0 and 1)
++ 
++
++		   Usage:
++		      md=extrude(md,numlayers,extrusionexponent);
++		      md=extrude(md,numlayers,lowerexponent,upperexponent);
++		      md=extrude(md,listofcoefficients);
++
++		   Example:
++		      md=extrude(md,8,3);
++		      md=extrude(md,8,3,2);
++		      md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1]);
++
++		   See also: MODELEXTRACT, COLLAPSE
++		"""
++
++		#some checks on list of arguments
++		if len(args)>3 or len(args)<1:
++			raise RuntimeError("extrude error message")
++
++		#Extrude the mesh
++		if   len(args)==1:    #list of coefficients
++			clist=args[0]
++			if any(clist<0) or any(clist>1):
++				raise TypeError("extrusioncoefficients must be between 0 and 1")
++			clist.extend([0.,1.])
++			clist.sort()
++			extrusionlist=list(set(clist))
++			numlayers=len(extrusionlist)
++
++		elif len(args)==2:    #one polynomial law
++			if args[1]<=0:
++				raise TypeError("extrusionexponent must be >=0")
++			numlayers=args[0]
++			extrusionlist=(numpy.arange(0.,float(numlayers-1)+1.,1.)/float(numlayers-1))**args[1]
++
++		elif len(args)==3:    #two polynomial laws
++			numlayers=args[0]
++			lowerexp=args[1]
++			upperexp=args[2]
++
++			if args[1]<=0 or args[2]<=0:
++				raise TypeError("lower and upper extrusionexponents must be >=0")
++
++			lowerextrusionlist=(numpy.arange(0.,1.+2./float(numlayers-1),2./float(numlayers-1)))**lowerexp/2.
++			upperextrusionlist=(numpy.arange(0.,1.+2./float(numlayers-1),2./float(numlayers-1)))**upperexp/2.
++			extrusionlist=numpy.unique(numpy.concatenate((lowerextrusionlist,1.-upperextrusionlist)))
++
++		if numlayers<2:
++			raise TypeError("number of layers should be at least 2")
++		if md.mesh.dimension==3:
++			raise TypeError("Cannot extrude a 3d mesh (extrude cannot be called more than once)")
++
++		#Initialize with the 2d mesh
++		x3d=numpy.empty((0))
++		y3d=numpy.empty((0))
++		z3d=numpy.empty((0))    #the lower node is on the bed
++		thickness3d=md.geometry.thickness    #thickness and bed for these nodes
++		bed3d=md.geometry.bed
++
++		#Create the new layers
++		for i in xrange(numlayers):
++			x3d=numpy.concatenate((x3d,md.mesh.x))
++			y3d=numpy.concatenate((y3d,md.mesh.y))
++			#nodes are distributed between bed and surface accordingly to the given exponent
++			z3d=numpy.concatenate((z3d,bed3d+thickness3d*extrusionlist[i]))
++		number_nodes3d=numpy.size(x3d)    #number of 3d nodes for the non extruded part of the mesh
++
++		#Extrude elements 
++		elements3d=numpy.empty((0,6))
++		for i in xrange(numlayers-1):
++			elements3d=numpy.vstack((elements3d,numpy.hstack((md.mesh.elements+i*md.mesh.numberofvertices,md.mesh.elements+(i+1)*md.mesh.numberofvertices))))    #Create the elements of the 3d mesh for the non extruded part
++		number_el3d=numpy.size(elements3d,axis=0)    #number of 3d nodes for the non extruded part of the mesh
++
++		#Keep a trace of lower and upper nodes
++		mesh.lowervertex=float('NaN')*numpy.ones(number_nodes3d)
++		mesh.uppervertex=float('NaN')*numpy.ones(number_nodes3d)
++		mesh.lowervertex[md.mesh.numberofvertices:]=numpy.arange(1,(numlayers-1)*md.mesh.numberofvertices+1)
++		mesh.uppervertex[:(numlayers-1)*md.mesh.numberofvertices]=numpy.arange(md.mesh.numberofvertices+1,number_nodes3d+1)
++		md.mesh.lowervertex=mesh.lowervertex
++		md.mesh.uppervertex=mesh.uppervertex
++
++		#same for lower and upper elements
++		mesh.lowerelements=float('NaN')*numpy.ones(number_el3d)
++		mesh.upperelements=float('NaN')*numpy.ones(number_el3d)
++		mesh.lowerelements[md.mesh.numberofelements:]=numpy.arange(1,(numlayers-2)*md.mesh.numberofelements+1)
++		mesh.upperelements[:(numlayers-2)*md.mesh.numberofelements]=numpy.arange(md.mesh.numberofelements+1,(numlayers-1)*md.mesh.numberofelements+1)
++		md.mesh.lowerelements=mesh.lowerelements
++		md.mesh.upperelements=mesh.upperelements
++
++		#Save old mesh 
++		md.mesh.x2d=md.mesh.x
++		md.mesh.y2d=md.mesh.y
++		md.mesh.elements2d=md.mesh.elements
++		md.mesh.numberofelements2d=md.mesh.numberofelements
++		md.mesh.numberofvertices2d=md.mesh.numberofvertices
++
++		#Update mesh type
++		md.mesh.dimension=3
++
++		#Build global 3d mesh 
++		md.mesh.elements=elements3d
++		md.mesh.x=x3d
++		md.mesh.y=y3d
++		md.mesh.z=z3d
++		md.mesh.numberofelements=number_el3d
++		md.mesh.numberofvertices=number_nodes3d
++		md.mesh.numberoflayers=numlayers
++
++		#Ok, now deal with the other fields from the 2d mesh:
++
++		#lat long
++		md.mesh.lat=project3d(md,'vector',md.mesh.lat,'type','node')
++		md.mesh.long=project3d(md,'vector',md.mesh.long,'type','node')
++
++		#drag coefficient is limited to nodes that are on the bedrock.
++		md.friction.coefficient=project3d(md,'vector',md.friction.coefficient,'type','node','layer',1)
++
++		#p and q (same deal, except for element that are on the bedrock: )
++		md.friction.p=project3d(md,'vector',md.friction.p,'type','element')
++		md.friction.q=project3d(md,'vector',md.friction.q,'type','element')
++
++		#observations
++		md.inversion.vx_obs=project3d(md,'vector',md.inversion.vx_obs,'type','node')
++		md.inversion.vy_obs=project3d(md,'vector',md.inversion.vy_obs,'type','node')
++		md.inversion.vel_obs=project3d(md,'vector',md.inversion.vel_obs,'type','node')
++		md.surfaceforcings.mass_balance=project3d(md,'vector',md.surfaceforcings.mass_balance,'type','node')
++		md.surfaceforcings.precipitation=project3d(md,'vector',md.surfaceforcings.precipitation,'type','node')
++		md.balancethickness.thickening_rate=project3d(md,'vector',md.balancethickness.thickening_rate,'type','node')
++		md.surfaceforcings.monthlytemperatures=project3d(md,'vector',md.surfaceforcings.monthlytemperatures,'type','node')
++
++		#results
++		if not numpy.any(numpy.isnan(md.initialization.vx)):
++			md.initialization.vx=project3d(md,'vector',md.initialization.vx,'type','node')
++		if not numpy.any(numpy.isnan(md.initialization.vy)):
++			md.initialization.vy=project3d(md,'vector',md.initialization.vy,'type','node')
++		if not numpy.any(numpy.isnan(md.initialization.vz)):
++			md.initialization.vz=project3d(md,'vector',md.initialization.vz,'type','node')
++		if not numpy.any(numpy.isnan(md.initialization.vel)):
++			md.initialization.vel=project3d(md,'vector',md.initialization.vel,'type','node')
++		if not numpy.any(numpy.isnan(md.initialization.temperature)):
++			md.initialization.temperature=project3d(md,'vector',md.initialization.temperature,'type','node')
++		if not numpy.any(numpy.isnan(md.initialization.waterfraction)):
++			md.initialization.waterfraction=project3d(md,'vector',md.initialization.waterfraction,'type','node')
++
++		#bedinfo and surface info
++		md.mesh.elementonbed=project3d(md,'vector',numpy.ones(md.mesh.numberofelements2d),'type','element','layer',1)
++		md.mesh.elementonsurface=project3d(md,'vector',numpy.ones(md.mesh.numberofelements2d),'type','element','layer',md.mesh.numberoflayers-1)
++		md.mesh.vertexonbed=project3d(md,'vector',numpy.ones(md.mesh.numberofvertices2d),'type','node','layer',1)
++		md.mesh.vertexonsurface=project3d(md,'vector',numpy.ones(md.mesh.numberofvertices2d),'type','node','layer',md.mesh.numberoflayers)
++
++		#elementstype
++		if not numpy.any(numpy.isnan(md.flowequation.element_equation)):
++			oldelements_type=md.flowequation.element_equation
++			md.flowequation.element_equation=numpy.zeros(number_el3d)
++			md.flowequation.element_equation=project3d(md,'vector',oldelements_type,'type','element')
++
++		#verticestype
++		if not numpy.any(numpy.isnan(md.flowequation.vertex_equation)):
++			oldvertices_type=md.flowequation.vertex_equation
++			md.flowequation.vertex_equation=numpy.zeros(number_nodes3d)
++			md.flowequation.vertex_equation=project3d(md,'vector',oldvertices_type,'type','node')
++
++		md.flowequation.bordermacayeal=project3d(md,'vector',md.flowequation.bordermacayeal,'type','node')
++		md.flowequation.borderpattyn=project3d(md,'vector',md.flowequation.borderpattyn,'type','node')
++		md.flowequation.borderstokes=project3d(md,'vector',md.flowequation.borderstokes,'type','node')
++
++		#boundary conditions
++		md.diagnostic.spcvx=project3d(md,'vector',md.diagnostic.spcvx,'type','node')
++		md.diagnostic.spcvy=project3d(md,'vector',md.diagnostic.spcvy,'type','node')
++		md.diagnostic.spcvz=project3d(md,'vector',md.diagnostic.spcvz,'type','node')
++		md.thermal.spctemperature=project3d(md,'vector',md.thermal.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',float('NaN'))
++		md.prognostic.spcthickness=project3d(md,'vector',md.prognostic.spcthickness,'type','node')
++		md.balancethickness.spcthickness=project3d(md,'vector',md.balancethickness.spcthickness,'type','node')
++		md.diagnostic.referential=project3d(md,'vector',md.diagnostic.referential,'type','node')
++
++		#in 3d, pressureload: [node1 node2 node3 node4 element]
++		pressureload_layer1=numpy.hstack((md.diagnostic.icefront[:,0:2],md.diagnostic.icefront[:,1:2]+md.mesh.numberofvertices2d,md.diagnostic.icefront[:,0:1]+md.mesh.numberofvertices2d,md.diagnostic.icefront[:,2:4]))    #Add two columns on the first layer 
++		pressureload=numpy.empty((0,6))
++		for i in xrange(numlayers-1):
++			pressureload=numpy.vstack((pressureload,numpy.hstack((pressureload_layer1[:,0:4]+i*md.mesh.numberofvertices2d,pressureload_layer1[:,4:5]+i*md.mesh.numberofelements2d,pressureload_layer1[:,5:6]))))
++		md.diagnostic.icefront=pressureload
++
++		#connectivity
++		md.mesh.elementconnectivity=numpy.tile(md.mesh.elementconnectivity,(numlayers-1,1))
++		md.mesh.elementconnectivity[numpy.nonzero(md.mesh.elementconnectivity==0)]=float('NaN')
++		for i in xrange(1,numlayers):
++			md.mesh.elementconnectivity[i*md.mesh.numberofelements2d+1:(i+1)*md.mesh.numberofelements2d,:] \
++				=md.mesh.elementconnectivity[i*md.mesh.numberofelements2d+1:(i+1)*md.mesh.numberofelements2d,:]+md.mesh.numberofelements2d
++		md.mesh.elementconnectivity[numpy.nonzero(numpy.isnan(md.mesh.elementconnectivity))]=0
++
++		#materials
++		md.materials.rheology_B=project3d(md,'vector',md.materials.rheology_B,'type','node')
++		md.materials.rheology_n=project3d(md,'vector',md.materials.rheology_n,'type','element')
++
++		#parameters
++		md.geometry.surface=project3d(md,'vector',md.geometry.surface,'type','node')
++		md.geometry.thickness=project3d(md,'vector',md.geometry.thickness,'type','node')
++		md.geometry.hydrostatic_ratio=project3d(md,'vector',md.geometry.hydrostatic_ratio,'type','node')
++		md.geometry.bed=project3d(md,'vector',md.geometry.bed,'type','node')
++		md.geometry.bathymetry=project3d(md,'vector',md.geometry.bathymetry,'type','node')
++		md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node')
++		md.mask.elementonfloatingice=project3d(md,'vector',md.mask.elementonfloatingice,'type','element')
++		md.mask.vertexonfloatingice=project3d(md,'vector',md.mask.vertexonfloatingice,'type','node')
++		md.mask.elementongroundedice=project3d(md,'vector',md.mask.elementongroundedice,'type','element')
++		md.mask.vertexongroundedice=project3d(md,'vector',md.mask.vertexongroundedice,'type','node')
++		md.mask.elementonwater=project3d(md,'vector',md.mask.elementonwater,'type','element')
++		md.mask.vertexonwater=project3d(md,'vector',md.mask.vertexonwater,'type','node')
++		if not numpy.any(numpy.isnan(md.inversion.cost_functions_coefficients)):
++			md.inversion.cost_functions_coefficients=project3d(md,'vector',md.inversion.cost_functions_coefficients,'type','node');end;
++		if not numpy.any(numpy.isnan(md.inversion.min_parameters)):
++			md.inversion.min_parameters=project3d(md,'vector',md.inversion.min_parameters,'type','node')
++		if not numpy.any(numpy.isnan(md.inversion.max_parameters)):
++			md.inversion.max_parameters=project3d(md,'vector',md.inversion.max_parameters,'type','node')
++		if not numpy.any(numpy.isnan(md.qmu.partition)):
++			md.qmu.partition=project3d(md,'vector',numpy.transpose(md.qmu.partition),'type','node')
++		if(md.surfaceforcings.isdelta18o):
++			md.surfaceforcings.temperatures_lgm=project3d(md,'vector',md.surfaceforcings.temperatures_lgm,'type','node')
++		if(md.surfaceforcings.isdelta18o):
++			md.surfaceforcings.temperatures_presentday=project3d(md,'vector',md.surfaceforcings.temperatures_presentday,'type','node')
++		if(md.surfaceforcings.isdelta18o):
++			md.surfaceforcings.precipitations_presentday=project3d(md,'vector',md.surfaceforcings.precipitations_presentday,'type','node')
++
++		#Put lithostatic pressure if there is an existing pressure
++		if not numpy.any(numpy.isnan(md.initialization.pressure)):
++			md.initialization.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z)
++
++		#special for thermal modeling:
++		md.basalforcings.melting_rate=project3d(md,'vector',md.basalforcings.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
++
++		#increase connectivity if less than 25:
++		if md.mesh.average_vertex_connectivity<=25:
++			md.mesh.average_vertex_connectivity=100
++
++		return md
++		# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13149)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13150)
+@@ -542,11 +542,11 @@
+ 
+ 			 %Extrude the mesh
+ 			 if nargin==2, %list of coefficients
+-				 list=varargin{1};
+-				 if any(list<0) | any(list>1),
++				 clist=varargin{1};
++				 if any(clist<0) | any(clist>1),
+ 					 error('extrusioncoefficients must be between 0 and 1');
+ 				 end
+-				 extrusionlist=sort(unique([list(:);0;1]));
++				 extrusionlist=sort(unique([clist(:);0;1]));
+ 				 numlayers=length(extrusionlist);
+ 			 elseif nargin==3, %one polynomial law
+ 				 if varargin{2}<=0,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project3d.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project3d.m	(revision 13149)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project3d.m	(revision 13150)
+@@ -35,6 +35,7 @@
+ 
+ if length(vector2d)==1,
+ 	projected_vector=vector2d;
++
+ elseif strcmpi(type,'node'),
+ 
+ 	%Initialize 3d vector
+@@ -56,6 +57,7 @@
+ 	else
+ 		projected_vector(((layer-1)*md.mesh.numberofvertices2d+1):(layer*md.mesh.numberofvertices2d),:)=vector2d;
+ 	end
++
+ elseif strcmpi(type,'element'),
+ 
+ 	%Initialize 3d vector
+@@ -69,14 +71,15 @@
+ 		error('vector length not supported')
+ 	end
+ 
++	%Fill in
+ 	if layer==0,
+ 		for i=1:(md.mesh.numberoflayers-1),
+ 			projected_vector( ((i-1)*md.mesh.numberofelements2d+1):(i*md.mesh.numberofelements2d),:)=vector2d;
+ 		end
+-
+ 	else
+ 		projected_vector( ((layer-1)*md.mesh.numberofelements2d+1):(layer*md.mesh.numberofelements2d),:)=vector2d;
+ 	end
++
+ else
+ 	error('project3d error message: unknown projection type');
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py	(revision 13149)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/fielddisplay.py	(revision 13150)
+@@ -77,12 +77,12 @@
+ def list_display(offset,name,field,comment):    # {{{
+ 
+ 	#initialization
+-	if   isinstance(field,tuple):
++	if   isinstance(field,list):
++		sbeg='['
++		send=']'
++	elif isinstance(field,tuple):
+ 		sbeg='('
+ 		send=')'
+-	elif isinstance(field,list):
+-		sbeg='['
+-		send=']'
+ 	string=sbeg
+ 
+ 	#go through the cell and fill string
Index: /issm/oecreview/Archive/12678-13393/ISSM-13150-13151.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13150-13151.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13150-13151.diff	(revision 13394)
@@ -0,0 +1,97 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project3d.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project3d.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/extrusion/project3d.py	(revision 13151)
+@@ -0,0 +1,92 @@
++import numpy
++from pairoptions import *
++from MatlabFuncs import *
++
++def project3d(md,*args):
++	"""
++	PROJECT3D - vertically project a vector from 2d mesh
++
++	   vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh.
++	   This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an 
++	   element vector of size (md.mesh.numberofelements2d,N/A). 
++	   arguments: 
++	      'vector': 2d vector
++	      'type': 'element' or 'node'. 
++	   options: 
++	      'layer' a layer number where vector should keep its values. If not specified, all layers adopt the 
++	             value of the 2d vector.
++	      'padding': default to 0 (value adopted by other 3d layers not being projected0
++
++	   Egs:
++	      extruded_vector=project3d(md,'vector',vector2d,'type','node','layer',1,'padding',NaN);
++	      extruded_vector=project3d(md,'vector',vector2d,'type','element','padding',0);
++	      extruded_vector=project3d(md,'vector',vector2d,'type','node');
++	"""
++
++	#some regular checks
++	if not md:
++		raise TypeError("bad usage")
++	if not md.mesh.dimension==3:
++		raise TypeError("input model is not 3d")
++
++	#retrieve parameters from options.
++	options      = pairoptions(*args)
++	vector2d     = options.getfieldvalue('vector')       #mandatory
++	type         = options.getfieldvalue('type')         #mandatory
++	layer        = options.getfieldvalue('layer',0)      #optional (do all layers otherwise)
++	paddingvalue = options.getfieldvalue('padding',0)    #0 by default
++
++	vector1d=False
++	if isinstance(vector2d,numpy.ndarray) and len(vector2d.shape)==1:
++		vector1d=True
++		vector2d=vector2d.reshape(numpy.size(vector2d),1)
++
++	if   isinstance(vector2d,(bool,int,long,float)) or numpy.size(vector2d)==1:
++		projected_vector=vector2d
++
++	elif strcmpi(type,'node'):
++
++		#Initialize 3d vector
++		if   numpy.size(vector2d,axis=0)==md.mesh.numberofvertices2d:
++			projected_vector=paddingvalue*numpy.ones((md.mesh.numberofvertices,  numpy.size(vector2d,axis=1)))
++		elif numpy.size(vector2d,axis=0)==md.mesh.numberofvertices2d+1:
++			projected_vector=paddingvalue*numpy.ones((md.mesh.numberofvertices+1,numpy.size(vector2d,axis=1)))
++			projected_vector[-1,:]=vector2d[-1,:]
++			vector2d=vector2d[:-1,:]
++		else:
++			raise TypeError("vector length not supported")
++
++		#Fill in
++		if layer==0:
++			for i in xrange(md.mesh.numberoflayers):
++				projected_vector[(i*md.mesh.numberofvertices2d):((i+1)*md.mesh.numberofvertices2d),:]=vector2d
++		else:
++			projected_vector[((layer-1)*md.mesh.numberofvertices2d):(layer*md.mesh.numberofvertices2d),:]=vector2d
++
++	elif strcmpi(type,'element'):
++
++		#Initialize 3d vector
++		if   numpy.size(vector2d,axis=0)==md.mesh.numberofelements2d:
++			projected_vector=paddingvalue*numpy.ones((md.mesh.numberofelements,  numpy.size(vector2d,axis=1)))
++		elif numpy.size(vector2d,axis=0)==md.mesh.numberofelements2d+1:
++			projected_vector=paddingvalue*numpy.ones((md.mesh.numberofelements+1,numpy.size(vector2d,axis=1)))
++			projected_vector[-1,:]=vector2d[-1,:]
++			vector2d=vector2d[:-1,:]
++		else:
++			raise TypeError("vector length not supported")
++
++		#Fill in
++		if layer==0:
++			for i in xrange(md.mesh.numberoflayers-1):
++				projected_vector[(i*md.mesh.numberofelements2d):((i+1)*md.mesh.numberofelements2d),:]=vector2d
++		else:
++			projected_vector[((layer-1)*md.mesh.numberofelements2d):(layer*md.mesh.numberofelements2d),:]=vector2d
++
++	else:
++		raise TypeError("project3d error message: unknown projection type")
++
++	if vector1d:
++		projected_vector=projected_vector.reshape((numpy.size(projected_vector)))
++
++	return projected_vector
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-13151-13152.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13151-13152.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13151-13152.diff	(revision 13394)
@@ -0,0 +1,260 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py	(revision 13151)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test101.py	(revision 13152)
+@@ -7,8 +7,7 @@
+ from solve import *
+ from MatlabFuncs import *
+ 
+-md=model()
+-md=triangle(md,'../Exp/Square.exp',50000)
++md=triangle(model(),'../Exp/Square.exp',50000)
+ md=setmask(md,'all','')
+ md=parameterize(md,'../Par/SquareShelfConstrained.py')
+ md=setflowequation(md,'macayeal','all')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test109.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test109.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test109.py	(revision 13152)
+@@ -0,0 +1,28 @@
++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',180000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md.extrude(3,1)
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md.transient.isdiagnostic=0
++md.transient.isprognostic=0
++md.transient.isthermal=1
++md.transient.isgroundingline=0
++md=solve(md,TransientSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Temperature','BasalforcingsMeltingRate']
++field_tolerances=[1e-13,1e-13]
++field_values=[\
++	md.results['TransientSolution'][1]['Temperature'],\
++	md.results['TransientSolution'][1]['BasalforcingsMeltingRate'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test110.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test110.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test110.py	(revision 13152)
+@@ -0,0 +1,49 @@
++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/SquareShelfConstrained.py')
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md.transient.requested_outputs=IceVolumeEnum()
++
++md=solve(md,TransientSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Volume3']
++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]
++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]['Bed'],\
++	md.results['TransientSolution'][1]['Surface'],\
++	md.results['TransientSolution'][1]['Thickness'],\
++	md.results['TransientSolution'][1]['IceVolume'],\
++	md.results['TransientSolution'][2]['Vx'],\
++	md.results['TransientSolution'][2]['Vy'],\
++	md.results['TransientSolution'][2]['Vel'],\
++	md.results['TransientSolution'][2]['Pressure'],\
++	md.results['TransientSolution'][2]['Bed'],\
++	md.results['TransientSolution'][2]['Surface'],\
++	md.results['TransientSolution'][2]['Thickness'],\
++	md.results['TransientSolution'][2]['IceVolume'],\
++	md.results['TransientSolution'][3]['Vx'],\
++	md.results['TransientSolution'][3]['Vy'],\
++	md.results['TransientSolution'][3]['Vel'],\
++	md.results['TransientSolution'][3]['Pressure'],\
++	md.results['TransientSolution'][3]['Bed'],\
++	md.results['TransientSolution'][3]['Surface'],\
++	md.results['TransientSolution'][3]['Thickness'],\
++	md.results['TransientSolution'][3]['IceVolume'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test107.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test107.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test107.py	(revision 13152)
+@@ -0,0 +1,23 @@
++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/SquareShelfConstrained.py')
++md=setflowequation(md,'macayeal','all')
++md.extrude(5,3)
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,PrognosticSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Thickness']
++field_tolerances=[1e-13]
++field_values=[\
++	md.results['PrognosticSolution'][1]['Thickness'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test102.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test102.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test102.py	(revision 13152)
+@@ -0,0 +1,28 @@
++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',180000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md.extrude(3,2)
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,DiagnosticSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Vx','Vy','Vz','Vel','Pressure']
++field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
++field_values=[\
++	md.results['DiagnosticSolution'][1]['Vx'],\
++	md.results['DiagnosticSolution'][1]['Vy'],\
++	md.results['DiagnosticSolution'][1]['Vz'],\
++	md.results['DiagnosticSolution'][1]['Vel'],\
++	md.results['DiagnosticSolution'][1]['Pressure'],\
++	]
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test105.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test105.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test105.py	(revision 13152)
+@@ -0,0 +1,22 @@
++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/SquareShelfConstrained.py')
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,PrognosticSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Thickness']
++field_tolerances=[1e-13]
++field_values=[\
++	md.results['PrognosticSolution'][1]['Thickness'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test108.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test108.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test108.py	(revision 13152)
+@@ -0,0 +1,25 @@
++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',180000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md.extrude(3,1)
++md=setflowequation(md,'macayeal','all')
++md.timestepping.time_step=0
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,ThermalSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Temperature','BasalforcingsMeltingRate']
++field_tolerances=[1e-13,1e-13]
++field_values=[\
++	md.results['ThermalSolution'][1]['Temperature'],\
++	md.results['ThermalSolution'][1]['BasalforcingsMeltingRate'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test103.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test103.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test103.py	(revision 13152)
+@@ -0,0 +1,36 @@
++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',180000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md.extrude(3,2)
++md=setflowequation(md,'pattyn','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md.diagnostic.requested_outputs=StressTensorEnum()
++md=solve(md,DiagnosticSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Vx','Vy','Vz','Vel','Pressure',\
++	'StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
++field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09,\
++	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09]
++field_values=[\
++	md.results['DiagnosticSolution'][1]['Vx'],\
++	md.results['DiagnosticSolution'][1]['Vy'],\
++	md.results['DiagnosticSolution'][1]['Vz'],\
++	md.results['DiagnosticSolution'][1]['Vel'],\
++	md.results['DiagnosticSolution'][1]['Pressure'],\
++	md.results['DiagnosticSolution'][1]['StressTensorxx'],\
++	md.results['DiagnosticSolution'][1]['StressTensoryy'],\
++	md.results['DiagnosticSolution'][1]['StressTensorzz'],\
++	md.results['DiagnosticSolution'][1]['StressTensorxy'],\
++	md.results['DiagnosticSolution'][1]['StressTensorxz'],\
++	md.results['DiagnosticSolution'][1]['StressTensoryz'],\
++	]
Index: /issm/oecreview/Archive/12678-13393/ISSM-13152-13153.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13152-13153.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13152-13153.diff	(revision 13394)
@@ -0,0 +1,60 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_scatter.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_scatter.m	(revision 13152)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/plot_scatter.m	(revision 13153)
+@@ -1,5 +1,7 @@
+-function plot_scatter(x,y,mksize,level),
++function plot_scatter(x,y,level,options),
+ 
++if nargin==3, options=pairoptions(); end
++
+ %check input
+ if numel(x)~=numel(y) | numel(x)~=numel(level),
+ 	error('x, y and data should have the same size');
+@@ -27,9 +29,9 @@
+ 	numcolors=size(palette,1);
+ 	levels=round_ice(linspace(ylim(1),ylim(2),numcolors+1),2);
+ else
+-	numcolors=30;
++	palette=getcolormap(options);
++	numcolors=size(palette,1);
+ 	levels=round_ice(linspace(Min,Max,numcolors+1),2);
+-	palette=colormap(jet(numcolors));
+ end
+ 
+ colorind=ones(Siz,1);
+@@ -44,8 +46,8 @@
+ hp=[];
+ for i=1:numcolors
+ 	pos=find(colorind==i);
+-	hprime=plot(x(pos),y(pos),...
+-		'o','MarkerSize',mksize,'MarkerEdgeColor',palette(i,:),...
++	hprime=plot3(x(pos),y(pos),ones(size(x(pos))),...
++		'o','MarkerSize',getfieldvalue(options,'MarkerSize',3),'MarkerEdgeColor',palette(i,:),...
+ 		'MarkerFaceColor',palette(i,:));
+ 	hp=[hp;hprime];
+ end
+@@ -53,22 +55,5 @@
+ if ~alreadyplot,
+ 	% format the colorbar
+ 	h    = colorbar;
+-	nlab = abs(nlab);                       % number of labels must be positive
+-	set(h,'YLim',[1 numcolors]);                  % set colorbar limits
+-	set(h,'YTick',linspace(1,numcolors,nlab));    % set tick mark locations
+-
+-	labels = cell(1,nlab);
+-	tick_vals = linspace(Min,Max,nlab);
+-	warning off MATLAB:log:logOfZero;
+-	for i = 1:nlab
+-		if min(log10(abs(tick_vals))) <= 3, fm = '%-4.0f';   % fixed
+-		else                                fm = '%-4.0E';   % floating
+-		end
+-		labels{i} = sprintf(fm,tick_vals(i));
+-	end
+-	warning on MATLAB:log:logOfZero;
+-
+-	% set tick label strings
+-	set(h,'YTickLabel',labels);
+-	%colorbar %one last time required sometimes
++	caxis([min(levels) max(levels)]);
+ end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13153-13154.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13153-13154.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13153-13154.diff	(revision 13394)
@@ -0,0 +1,41 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/getcolormap.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/getcolormap.m	(revision 13153)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/colormaps/getcolormap.m	(revision 13154)
+@@ -20,10 +20,10 @@
+ if ~ischar(map), error('colormap format not supported'); end
+ 
+ if strcmpi(map,'Ala'),
+-	map = jet(256);
++	map = jet;
+ 	map = map(128:end,:);
+ elseif strcmpi(map,'redblue'),
+-	map = hsv(256);
++	map = hsv;
+ 	map = rgb2hsv(map);
+ 	map(:,2)       = max(min( abs(map(:,1)-0.5)/0.5 ,1),0);
+ 	map(1:128,1)   = 0.7;
+@@ -31,20 +31,20 @@
+ 	map = hsv2rgb(map);
+ elseif strcmpi(map,'Rignot'),
+ 	alpha=getfieldvalue(options,'alpha',1);
+-	map = hsv(256);
++	map = hsv;
+ 	map = rgb2hsv(map);
+ 	map(:,2) = max(min( (0.1+map(:,1)).^(1/alpha) ,1),0);
+ 	map = hsv2rgb(map);
+ elseif strcmpi(map,'Rignot2'),
+ 	alpha=getfieldvalue(options,'alpha',1);
+-	map = hsv(256);
++	map = hsv;
+ 	map = rgb2hsv(map);
+ 	map(:,2) = max(min( (0.1+map(:,1)).^(1/alpha) ,1),0);
+ 	map = hsv2rgb(map);
+ 	map=flipud(map);
+ elseif strcmpi(map,'Seroussi'),
+ 	alpha=getfieldvalue(options,'alpha',1);
+-	map = hsv(256);
++	map = hsv;
+ 	map = flipud(map);
+ 	map = map(1:floor(0.7*size(map,1)),:);
+ 	map = rgb2hsv(map);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13154-13155.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13154-13155.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13154-13155.diff	(revision 13394)
@@ -0,0 +1,43 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13154)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13155)
+@@ -1,28 +1,22 @@
+ #!/bin/bash
++set -eu
+ 
+-#some issues on macosx64 with ISSM's autoconf. you might want to run native to mac on this.
+-
+ #Some cleanup
+-rm -rf install ADOL-C-2.2.0 trunk
++rm -rf install adolc_v220_issm
+ 
+-#Create install directories
+-mkdir install
++git clone -b 2.2.0_ISSM  git://gitorious.org/~utke/adol-c/adolc_v220_issm.git 
+ 
+-svn co https://projects.coin-or.org/svn/ADOL-C/trunk
+-
+ #Compile ADOL-C
+-cd trunk 
++cd adolc_v220_issm
+ 
+-autoconf
++autoreconf -f -i 
+ ./configure --prefix=$ISSM_DIR/externalpackages/adolc/install \
+-#	--enable-sparse \
+-#	--enable-docexa \
+-#	--enable-addexa \
+-#	--disable-shave
++	--enable-docexa \
++	--enable-addexa \
+ 
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+ fi
+-make install
++make install
+\ No newline at end of file
Index: /issm/oecreview/Archive/12678-13393/ISSM-13155-13156.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13155-13156.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13155-13156.diff	(revision 13394)
@@ -0,0 +1,194 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autoconf/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autoconf/install.sh	(revision 13155)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autoconf/install.sh	(revision 13156)
+@@ -1,22 +0,0 @@
+-#!/bin/bash
+-
+-#Some cleanup
+-rm -rf install autoconf-2.68 src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/autoconf-2.68.tar.gz' 'autoconf-2.68.tar.gz'
+-
+-#Create install directories
+-mkdir install
+-
+-#Untar 
+-tar -zxvf autoconf-2.68.tar.gz
+-
+-#Move autoconf into src directory
+-mv autoconf-2.68 src
+-
+-#Compile autoconf
+-cd src 
+-./configure --prefix="$ISSM_DIR/externalpackages/autoconf/install" 
+-make  
+-make install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh	(revision 13155)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libtool/install.sh	(revision 13156)
+@@ -1,21 +0,0 @@
+-#!/bin/bash
+-
+-#Some cleanup
+-rm -rf install libtool[\w.- ]* src
+-mkdir install
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool-2.4.2.tar.gz' 'libtool-2.4.2.tar.gz'
+-
+-#Untar 
+-tar -zxvf  libtool-2.4.2.tar.gz
+-rm libtool-2.4.2.tar.gz
+-
+-#Move libtool into src directory
+-mv libtool-2.4.2 src
+-
+-#Compile libtool
+-cd src 
+-./configure --prefix="$ISSM_DIR/externalpackages/libtool/install" 
+-make  
+-make install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/automake/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/automake/install.sh	(revision 13155)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/automake/install.sh	(revision 13156)
+@@ -1,20 +0,0 @@
+-#!/bin/bash
+-
+-#Some cleanup
+-rm -rf install automake-1.11.3 src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/automake-1.11.3.tar.gz' 'automake-1.11.3.tar.gz'
+-
+-#Create install directories
+-mkdir install
+-
+-#Untar 
+-tar -zxvf  automake-1.11.3.tar.gz
+-mv automake-1.11.3 src
+-
+-#Compile automake
+-cd src 
+-./configure --prefix="$ISSM_DIR/externalpackages/automake/install" 
+-make  
+-make install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13156)
+@@ -0,0 +1,40 @@
++#!/bin/bash
++
++rm -rf install
++
++#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'
++mkdir install
++tar -zxvf autoconf-2.68.tar.gz
++mv autoconf-2.68 src
++cd src 
++./configure --prefix="$ISSM_DIR/externalpackages/autotools/install" 
++make  
++make install
++
++#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'
++mkdir install
++tar -zxvf  automake-1.11.3.tar.gz
++mv automake-1.11.3 src
++cd src 
++./configure --prefix="$ISSM_DIR/externalpackages/autotools/install" 
++make  
++make install
++
++#install libtool
++echo " === INSTALLING LIBTOOL =="
++rm -rf src
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool-2.4.2.tar.gz' 'libtool-2.4.2.tar.gz'
++mkdir install
++tar -zxvf  libtool-2.4.2.tar.gz
++rm libtool-2.4.2.tar.gz
++mv libtool-2.4.2 src
++cd src 
++./configure --prefix="$ISSM_DIR/externalpackages/autotools/install" 
++make  
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh	(revision 13155)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/automakererun.sh	(revision 13156)
+@@ -8,4 +8,4 @@
+ # If all goes well, then the script will be shortened in the future.
+ 
+ cd $ISSM_DIR
+-autoreconf -iv -I externalpackages/libtool/install/share/aclocal
++autoreconf -iv 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh	(revision 13155)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.csh	(revision 13156)
+@@ -53,24 +53,12 @@
+ 	setenv PATH {$PATH}:{$DOXYGEN_DIR}/bin
+ endif
+ 
+-#AUTOCONF
+-set AUTOCONF_DIR="$ISSM_DIR/externalpackages/autoconf/install"
+-if (-d $AUTOCONF_DIR) then
+-	setenv PATH {$AUTOCONF_DIR}/bin:{$PATH}
++#AUTOTOOLS
++set AUTOTOOLS_DIR="$ISSM_DIR/externalpackages/autotools/install"
++if (-d $AUTOTOOLS_DIR) then
++	setenv PATH {$AUTOTOOLS_DIR}/bin:{$PATH}
+ endif
+ 
+-#AUTOMAKE
+-set AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install"
+-if (-d $AUTOMAKE_DIR) then
+-	setenv PATH {$AUTOMAKE_DIR}/bin:{$PATH}
+-endif
+-
+-#LIBTOOL
+-set LIBTOOL_DIR="$ISSM_DIR/externalpackages/libtool/install"
+-if (-d $LIBTOOL_DIR) then
+-	setenv PATH {$LIBTOOL_DIR}/bin:{$PATH}
+-endif
+-
+ #SSH
+ set SSH_DIR="$ISSM_DIR/externalpackages/ssh"
+ if (-d $SSH_DIR) then
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13155)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13156)
+@@ -85,15 +85,9 @@
+ DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install"
+ pathappend "$DOXYGEN_DIR/bin"
+ 
+-AUTOCONF_DIR="$ISSM_DIR/externalpackages/autoconf/install"
+-pathprepend "$AUTOCONF_DIR/bin"
++AUTOTOOLS_DIR="$ISSM_DIR/externalpackages/autotools/install"
++pathprepend "$AUTOTOOLS_DIR/bin"
+ 
+-AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install"
+-pathprepend "$AUTOMAKE_DIR/bin"
+-
+-LIBTOOL_DIR="$ISSM_DIR/externalpackages/libtool/install"
+-pathprepend "$LIBTOOL_DIR/bin"
+-
+ SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU"
+ pathappend "$SDK_DIR"
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13156-13157.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13156-13157.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13156-13157.diff	(revision 13394)
@@ -0,0 +1,34 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13156)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13157)
+@@ -1,12 +1,12 @@
+ #!/bin/bash
+ 
+ rm -rf install
++mkdir install
+ 
+ #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'
+-mkdir install
+ tar -zxvf autoconf-2.68.tar.gz
+ mv autoconf-2.68 src
+ cd src 
+@@ -18,7 +18,6 @@
+ 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'
+-mkdir install
+ tar -zxvf  automake-1.11.3.tar.gz
+ mv automake-1.11.3 src
+ cd src 
+@@ -30,7 +29,6 @@
+ echo " === INSTALLING LIBTOOL =="
+ rm -rf src
+ $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool-2.4.2.tar.gz' 'libtool-2.4.2.tar.gz'
+-mkdir install
+ tar -zxvf  libtool-2.4.2.tar.gz
+ rm libtool-2.4.2.tar.gz
+ mv libtool-2.4.2 src
Index: /issm/oecreview/Archive/12678-13393/ISSM-13157-13158.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13157-13158.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13157-13158.diff	(revision 13394)
@@ -0,0 +1,25 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13157)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13158)
+@@ -13,6 +13,7 @@
+ ./configure --prefix="$ISSM_DIR/externalpackages/autotools/install" 
+ make  
+ make install
++cd ..
+ 
+ #install automake
+ echo " === INSTALLING AUTOMAKE =="
+@@ -24,6 +25,7 @@
+ ./configure --prefix="$ISSM_DIR/externalpackages/autotools/install" 
+ make  
+ make install
++cd ..
+ 
+ #install libtool
+ echo " === INSTALLING LIBTOOL =="
+@@ -36,3 +38,4 @@
+ ./configure --prefix="$ISSM_DIR/externalpackages/autotools/install" 
+ make  
+ make install
++cd ..
Index: /issm/oecreview/Archive/12678-13393/ISSM-13158-13159.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13158-13159.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13158-13159.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13158)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13159)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ rm -rf install
+ mkdir install
Index: /issm/oecreview/Archive/12678-13393/ISSM-13159-13160.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13159-13160.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13159-13160.diff	(revision 13394)
@@ -0,0 +1,9 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am	(revision 13159)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am	(revision 13160)
+@@ -2,4 +2,3 @@
+ SUBDIRS = src
+ bin_SCRIPTS=config.h startup.m README.rtf
+ 
+-ACLOCAL_AMFLAGS = -I externalpackages/libtool/install/share/aclocal
Index: /issm/oecreview/Archive/12678-13393/ISSM-13160-13161.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13160-13161.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13160-13161.diff	(revision 13394)
@@ -0,0 +1,21 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13160)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13161)
+@@ -230,6 +230,16 @@
+ 	export C_INCLUDE_PATH="$C_INCLUDE_PATH:$HDF5_DIR/include"
+ fi
+ 
++#NETCDF
++NETCDF_DIR="$ISSM_DIR/externalpackages/netcdf/install"
++if [ -d "$NETCDF_DIR" ]; then
++	export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$NETCDF_DIR/lib"
++	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$NETCDF_DIR/lib"
++	export LIBRARY_PATH="$LIBRARY_PATH:$NETCDF_DIR/lib"
++	export C_INCLUDE_PATH="$C_INCLUDE_PATH:$NETCDF_DIR/include"
++fi
++
++#SVN
+ SVN_DIR="$ISSM_DIR/externalpackages/svn/install"
+ if [ -d "$SVN_DIR" ]; then
+ 	pathprepend   "$SVN_DIR/bin"
Index: /issm/oecreview/Archive/12678-13393/ISSM-13161-13162.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13161-13162.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13161-13162.diff	(revision 13394)
@@ -0,0 +1,25 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13161)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13162)
+@@ -4,6 +4,8 @@
+ rm -rf install
+ mkdir install
+ 
++export PATH="$PATH:$ISSM_DIR/externalpackages/autotools/install/bin"
++
+ #install autoconf
+ echo " === INSTALLING AUTOCONF =="
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools	(revision 13161)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools	(revision 13162)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,3 ##
++install
++src
++*.gz
Index: /issm/oecreview/Archive/12678-13393/ISSM-13162-13163.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13162-13163.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13162-13163.diff	(revision 13394)
@@ -0,0 +1,53 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3001.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3001.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3001.m	(revision 13163)
+@@ -0,0 +1,23 @@
++md=triangle(model,'../Exp/Square.exp',50000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.diagnostic.requested_outputs=StressTensorEnum;
++md.autodiff.isautodiff=false;
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure',...
++	'StressTensorxx','StressTensoryy','StressTensorxy'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,...
++	1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.StressTensorxx),...
++	(md.results.DiagnosticSolution.StressTensoryy),...
++	(md.results.DiagnosticSolution.StressTensorxy),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 13162)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 13163)
+@@ -185,5 +185,6 @@
+ 	case 1502, name='SquareShelfTranSawTooth3d';
+ 	case 1601, name='SquareShelfM2dRotation';
+ 	case 1602, name='SquareSheetShelfP3dRotation';
++	case 3001, name='SquareShelfConstrainedDiagM2dAdolc';
+ 	otherwise, name='N/A';
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 13162)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 13163)
+@@ -185,7 +185,8 @@
+ 		1501 : 'SquareShelfTranSawTooth2d',
+ 		1502 : 'SquareShelfTranSawTooth3d',
+ 		1601 : 'SquareShelfM2dRotation',
+-		1602 : 'SquareSheetShelfP3dRotation',
++		1602 : 'SquareSheetShelfP3dRotation', 
++		3001 : 'SquareShelfConstrainedDiagM2dAdolc',
+ 	}
+ 
+ 	if not id == 0:
Index: /issm/oecreview/Archive/12678-13393/ISSM-13163-13164.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13163-13164.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13163-13164.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/ad/todo
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/ad/todo	(revision 13163)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/ad/todo	(revision 13164)
+@@ -48,3 +48,11 @@
+ Questions: 
+ set of active IssmDouble variables different from set of independent variables activated with <<=? 
+ same thing dependent variables? 
++
++
++
++Bullet points: 
++- nightly run on with adolc compiled, running from test2000 on.  once a day.
++- run valgrind on new adolc or old adolc. send a text on how to run it. 
++- make gdb wrapper.
++- think about ModelProcessor setup. need to keep track, before we partition, on cpu 0, of the independent declarations. 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13164-13165.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13164-13165.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13164-13165.diff	(revision 13394)
@@ -0,0 +1,720 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive110.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive230.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive311.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive114.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive512.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive431.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive234.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive315.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive118.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive516.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive319.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive401.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive320.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive204.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive602.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive405.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive324.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive208.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive606.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive328.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive409.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1103.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1501.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1304.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1107.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive410.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive213.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive611.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive414.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive217.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive418.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive102.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive303.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive222.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive106.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive423.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive504.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive307.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive226.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive427.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive508.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1202.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1206.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive111.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive312.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive231.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive115.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive270.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive432.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive513.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive316.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive235.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive119.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive274.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive120.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive201.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive402.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive321.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive205.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive603.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive406.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive325.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive209.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive607.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive329.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1301.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1104.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1502.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1108.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive210.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive411.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive214.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive612.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive415.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive218.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive419.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive103.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive501.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive420.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive223.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive304.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive107.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive505.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive424.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive227.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive308.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive509.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive428.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1203.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1601.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1207.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive112.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive510.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive232.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive313.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive116.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive514.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive236.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive317.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive202.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive121.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive322.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive403.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive206.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive604.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive326.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive407.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive608.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1101.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1302.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1105.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1109.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive211.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive412.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive215.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive613.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive416.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive219.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1110.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive220.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive301.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive104.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive502.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive421.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive224.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive305.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive108.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive425.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive506.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive309.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive228.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive429.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1401.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1204.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1602.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1208.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive310.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive113.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive430.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive511.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive314.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive233.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive117.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive272.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive515.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive318.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive237.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive122.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive203.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive601.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive404.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive323.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive207.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive605.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive408.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive327.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive609.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1102.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1303.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1106.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive212.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive610.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive413.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive216.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive417.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive101.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive302.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive221.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive105.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive422.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive503.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive306.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive225.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive109.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive426.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive507.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive229.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1201.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1402.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive1205.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-13165-13166.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13165-13166.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13165-13166.diff	(revision 13394)
@@ -0,0 +1,23 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin	(revision 13165)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin	(revision 13166)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin
+___________________________________________________________________
+Modified: svn:ignore
+## -1,4 +1,5 ##
+ *.exe
++*.mexmaci64
+ *.mexa64
+ *.mexw64
+ *.mexw32
+## -7,8 +8,6 ##
+ issm.exe
+ *.m
+ *.h
+-@pairoptions
+-@modellist
+ *.bat
+ *.rtf
+ *.py
Index: /issm/oecreview/Archive/12678-13393/ISSM-13166-13167.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13166-13167.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13166-13167.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab	(revision 13166)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab	(revision 13167)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab
+___________________________________________________________________
+Modified: svn:ignore
+## -1,6 +1,7 ##
+ *.obj
+ Makefile
+ *.lib
++*.mexmaci64
+ *.mexa64
+ *.mexw64
+ *.manifest
Index: /issm/oecreview/Archive/12678-13393/ISSM-13167-13168.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13167-13168.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13167-13168.diff	(revision 13394)
@@ -0,0 +1,39 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp	(revision 13167)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp	(revision 13168)
+@@ -803,9 +803,9 @@
+ 					case MaterialsRheologyZbarEnum:
+ 						if (iomodel->Data(MaterialsRheologyZEnum)){
+ 							_assert_(iomodel->Data(MaterialsRheologyZEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
+-							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyZEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
+-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyZEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
++							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+ 							this->inputs->AddInput(new ControlInput(MaterialsRheologyZbarEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+ 						}
+ 						break;
+@@ -840,7 +840,7 @@
+ 
+ 		/*Get Z*/
+ 		if (iomodel->Data(MaterialsRheologyZEnum)) {
+-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyZEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
++			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyZEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
+ 			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyZEnum,nodeinputs));
+ 		}
+ 
+@@ -861,9 +861,9 @@
+ 					case MaterialsRheologyZbarEnum:
+ 						if (iomodel->Data(MaterialsRheologyZEnum)){
+ 							_assert_(iomodel->Data(MaterialsRheologyZEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
+-							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyZEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
+-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyZEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
++							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
++							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+ 							this->inputs->AddInput(new ControlInput(MaterialsRheologyZEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+ 						}
+ 						break;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13168-13169.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13168-13169.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13168-13169.diff	(revision 13394)
@@ -0,0 +1,25 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.py	(revision 13168)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.py	(revision 13169)
+@@ -96,13 +96,13 @@
+ 		#}}}
+ 
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+-		md = checkfield(md,'matice.rho_ice','>',0)
+-		md = checkfield(md,'matice.rho_water','>',0)
+-		md = checkfield(md,'matice.rho_freshwater','>',0)
+-		md = checkfield(md,'matice.mu_water','>',0)
+-		md = checkfield(md,'matice.rheology_B','>',0,'size',[md.mesh.numberofvertices])
+-		md = checkfield(md,'matice.rheology_n','>',0,'size',[md.mesh.numberofelements])
+-		md = checkfield(md,'matice.rheology_law','values',['None','Paterson','Arrhenius'])
++		md = checkfield(md,'materials.rho_ice','>',0)
++		md = checkfield(md,'materials.rho_water','>',0)
++		md = checkfield(md,'materials.rho_freshwater','>',0)
++		md = checkfield(md,'materials.mu_water','>',0)
++		md = checkfield(md,'materials.rheology_B','>',0,'size',[md.mesh.numberofvertices])
++		md = checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
++		md = checkfield(md,'materials.rheology_law','values',['None','Paterson','Arrhenius'])
+ 		return md
+ 	# }}}
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13169-13170.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13169-13170.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13169-13170.diff	(revision 13394)
@@ -0,0 +1,326 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.py	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.py	(revision 13170)
+@@ -1,5 +1,4 @@
+ import socket
+-import platform
+ import subprocess
+ import os
+ from MatlabFuncs import *
+@@ -19,7 +18,7 @@
+ 	if strcmpi(host,hostname):
+ 		subprocess.call(command,shell=True)
+ 	else:
+-		if 'Windows' in platform.system():
++		if ispc():
+ 			#use the putty project plink.exe: it should be in the path.
+ 		
+ 			#get ISSM_DIR variable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.m	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmssh.m	(revision 13170)
+@@ -11,7 +11,7 @@
+ if strcmpi(host,hostname),
+ 	system(command);
+ else
+-	if ispc,
++	if ispc(),
+ 		%use the putty project plink.exe: it should be in the path.
+ 		
+ 		%get ISSM_DIR variable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.py	(revision 13170)
+@@ -1,5 +1,4 @@
+ import socket
+-import platform
+ import subprocess
+ import os
+ import shutil
+@@ -34,7 +33,7 @@
+ 
+ 	else:
+ 
+-		if 'Windows' in platform.system():
++		if ispc():
+ 			#use the putty project pscp.exe: it should be in the path.
+ 		
+ 			#get ISSM_DIR variable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.py	(revision 13170)
+@@ -1,5 +1,4 @@
+ import socket
+-import platform
+ import subprocess
+ import os
+ from MatlabFuncs import *
+@@ -27,7 +26,7 @@
+ 			subprocess.call('ln -s %s %s' % (os.path.join(here,package),path),shell=True)
+ 			os.chdir(here)
+ 	else:
+-		if 'Windows' in platform.system():
++		if ispc():
+ 			#use the putty project pscp.exe: it should be in the path.
+ 		
+ 			#get ISSM_DIR variable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.py	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.py	(revision 13170)
+@@ -1,4 +1,3 @@
+-import platform
+ import os
+ from MatlabFuncs import *
+ 
+@@ -10,7 +9,7 @@
+ 	      ISSM_DIR=issmdir()
+ 	"""
+ 
+-	if 'Windows' not in platform.system():
++	if not ispc():
+ 		ISSM_DIR =os.environ['ISSM_DIR']
+ 	else:
+ 		ISSM_DIR =os.environ['ISSM_DIR_WIN']
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.m	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpin.m	(revision 13170)
+@@ -28,7 +28,7 @@
+ 
+ else
+ 
+-	if ispc,
++	if ispc(),
+ 		%use the putty project pscp.exe: it should be in the path.
+ 		
+ 		%get ISSM_DIR variable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.m	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmscpout.m	(revision 13170)
+@@ -19,7 +19,7 @@
+ 		eval(['cd ' here]);
+ 	end
+ else 
+-	if ispc,
++	if ispc(),
+ 		%use the putty project pscp.exe: it should be in the path.
+ 		
+ 		%get ISSM_DIR variable
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.m	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/issmdir.m	(revision 13170)
+@@ -4,7 +4,7 @@
+ %   Usage:
+ %      ISSM_DIR=issmdir()
+ 
+-if ~ispc,
++if ~ispc(),
+ 	ISSM_DIR =getenv('ISSM_DIR');
+ else
+ 	ISSM_DIR =getenv('ISSM_DIR_WIN');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/jplsvn.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/jplsvn.m	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/jplsvn.m	(revision 13170)
+@@ -4,7 +4,7 @@
+ %   Usage:
+ %      JPL_SVN=jplsvn()
+ 
+-if ~ispc,
++if ~ispc(),
+ 	JPL_SVN =getenv('JPL_SVN');
+ else
+ 	JPL_SVN =getenv('JPL_SVN_WIN');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/oshostname.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/oshostname.m	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/oshostname.m	(revision 13170)
+@@ -5,7 +5,7 @@
+ %
+ %
+ 
+-if ispc,
++if ispc(),
+ 	[status,hostname]=system('hostname | sed ''s/-//g''');hostname=hostname(1:end-1);
+ 
+ 	if status, 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.m	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.m	(revision 13170)
+@@ -37,7 +37,7 @@
+ 	delete([md.miscellaneous.name '.outlog']);
+ 	delete([md.miscellaneous.name '.errlog']);
+ 	delete([md.miscellaneous.name '.outbin']);
+-	if ~ispc,
++	if ~ispc(),
+ 		delete([md.private.runtimename '.tar.gz']);
+ 	end
+ end
+@@ -51,7 +51,7 @@
+ 	else
+ 		delete([md.miscellaneous.name '.bin']);
+ 		delete([md.miscellaneous.name '.petsc']);
+-		if ~ispc,
++		if ~ispc(),
+ 			delete([md.miscellaneous.name '.queue']);
+ 		else
+ 			delete([md.miscellaneous.name '.bat']);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13170)
+@@ -1,5 +1,4 @@
+ import os
+-import platform
+ import socket
+ from MatlabFuncs import *
+ from loadresultsfromdisk import *
+@@ -41,7 +40,7 @@
+ 		os.remove(md.miscellaneous.name+'.outlog')
+ 		os.remove(md.miscellaneous.name+'.errlog')
+ 		os.remove(md.miscellaneous.name+'.outbin')
+-		if 'Windows' not in platform.system():
++		if not ispc():
+ 			os.remove(md.private.runtimename+'.tar.gz')
+ 
+ 	#erase input file if run was carried out on same platform.
+@@ -53,7 +52,7 @@
+ 		else:
+ 			os.remove(md.miscellaneous.name+'.bin')
+ 			os.remove(md.miscellaneous.name+'.petsc')
+-			if 'Windows' not in platform.system():
++			if not ispc():
+ 				os.remove(md.miscellaneous.name+'.queue')
+ 			else:
+ 				os.remove(md.miscellaneous.name+'.bat')
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13170)
+@@ -1,7 +1,6 @@
+ import socket
+ import os
+ import math
+-import platform
+ import subprocess
+ from EnumToString import EnumToString
+ from issmdir import *
+@@ -9,6 +8,7 @@
+ from issmssh import *
+ from issmscpin import *
+ from issmscpout import *
++from MatlabFuncs import *
+ 
+ class generic(object):
+ 	"""
+@@ -73,7 +73,7 @@
+ 	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
+ 
+ 		#write queuing script 
+-		if 'Windows' not in platform.system():
++		if not ispc():
+ 
+ 			fid=open(modelname+'.queue','w')
+ 			fid.write('#!/bin/sh\n')
+@@ -115,7 +115,7 @@
+ 	def BuildKrigingQueueScript(self,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
+ 
+ 		#write queuing script 
+-		if 'Windows' not in platform.system():
++		if not ispc():
+ 
+ 			fid=open(modelname+'.queue','w')
+ 			fid.write('#!/bin/sh\n')
+@@ -175,7 +175,7 @@
+ 
+ 	def Download(self,dirname,filelist):     # {{{
+ 
+-		if 'Windows' in platform.system():
++		if ispc():
+ 			#do nothing
+ 			return
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 13170)
+@@ -61,7 +61,7 @@
+ 		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			%write queuing script 
+-			if ~ispc,
++			if ~ispc(),
+ 
+ 				fid=fopen([modelname '.queue'],'w');
+ 				fprintf(fid,'#!/bin/sh\n');
+@@ -112,7 +112,7 @@
+ 		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			%write queuing script 
+-			if ~ispc,
++			if ~ispc(),
+ 
+ 				fid=fopen([modelname '.queue'],'w');
+ 				fprintf(fid,'#!/bin/sh\n');
+@@ -177,7 +177,7 @@
+ 		end %}}}
+ 		function Download(cluster,dirname,filelist)% {{{
+ 
+-			if ispc,
++			if ispc(),
+ 				%do nothing
+ 				return;
+ 			end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/pkriging.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/pkriging.m	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/gslib/pkriging.m	(revision 13170)
+@@ -44,7 +44,7 @@
+ delete([name '.errlog']);
+ delete([name '.outbin']);
+ delete([name '.bin']);
+-if ~ispc,
++if ~ispc(),
+ 	delete([name '.tar.gz']);
+ end
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/YamsCall.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/YamsCall.m	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/contrib/bamg/YamsCall.m	(revision 13170)
+@@ -72,7 +72,7 @@
+ 
+ %call yams
+ fprintf('%s\n','      call Yams...');
+-if ispc
++if ispc()
+ 	%windows
+ 	system(['yams2-win -O 1 -v -0 -ecp -hgrad ' num2str(gradation)  ' carre0 carre1']);
+ elseif ismac
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 13169)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 13170)
+@@ -3,6 +3,14 @@
+ 
+ 	return socket.gethostname().lower().split('.')[0]
+ 
++def ispc():
++	import platform
++
++	if 'Windows' in platform.system():
++		return True
++	else:
++		return False
++
+ def strcmp(s1,s2):
+ 
+ 	if s1 == s2:
Index: /issm/oecreview/Archive/12678-13393/ISSM-13170-13171.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13170-13171.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13170-13171.diff	(revision 13394)
@@ -0,0 +1,142 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13170)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/diagnostic.py	(revision 13171)
+@@ -186,9 +186,9 @@
+ 
+ 		#marshall ice front
+ 		data=self.icefront
+-		data[[i for i,item in enumerate(data[:,-1]) if item==0],-1]=AirEnum()
+-		data[[i for i,item in enumerate(data[:,-1]) if item==1],-1]=WaterEnum()
+-		data[[i for i,item in enumerate(data[:,-1]) if item==2],-1]=IceEnum()
++		data[numpy.nonzero(data[:,-1]==0),-1]=AirEnum()
++		data[numpy.nonzero(data[:,-1]==1),-1]=WaterEnum()
++		data[numpy.nonzero(data[:,-1]==2),-1]=IceEnum()
+ 		WriteData(fid,'data',data,'enum',DiagnosticIcefrontEnum(),'format','DoubleMat','mattype',3)
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13170)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/inversion.py	(revision 13171)
+@@ -178,17 +178,17 @@
+ 		#process cost functions
+ 		num_cost_functions=size(self.cost_functions,1)
+ 		data=self.cost_functions
+-		data[[i for i,item in enumerate(data) if item==101]]=SurfaceAbsVelMisfitEnum()
+-		data[[i for i,item in enumerate(data) if item==102]]=SurfaceRelVelMisfitEnum()
+-		data[[i for i,item in enumerate(data) if item==103]]=SurfaceLogVelMisfitEnum()
+-		data[[i for i,item in enumerate(data) if item==104]]=SurfaceLogVxVyMisfitEnum()
+-		data[[i for i,item in enumerate(data) if item==105]]=SurfaceAverageVelMisfitEnum()
+-		data[[i for i,item in enumerate(data) if item==201]]=ThicknessAbsMisfitEnum()
+-		data[[i for i,item in enumerate(data) if item==501]]=DragCoefficientAbsGradientEnum()
+-		data[[i for i,item in enumerate(data) if item==502]]=RheologyBbarAbsGradientEnum()
+-		data[[i for i,item in enumerate(data) if item==503]]=ThicknessAbsGradientEnum()
+-		data[[i for i,item in enumerate(data) if item==504]]=ThicknessAlongGradientEnum()
+-		data[[i for i,item in enumerate(data) if item==505]]=ThicknessAcrossGradientEnum()
++		data[numpy.nonzero(data==101)]=SurfaceAbsVelMisfitEnum()
++		data[numpy.nonzero(data==102)]=SurfaceRelVelMisfitEnum()
++		data[numpy.nonzero(data==103)]=SurfaceLogVelMisfitEnum()
++		data[numpy.nonzero(data==104)]=SurfaceLogVxVyMisfitEnum()
++		data[numpy.nonzero(data==105)]=SurfaceAverageVelMisfitEnum()
++		data[numpy.nonzero(data==201)]=ThicknessAbsMisfitEnum()
++		data[numpy.nonzero(data==501)]=DragCoefficientAbsGradientEnum()
++		data[numpy.nonzero(data==502)]=RheologyBbarAbsGradientEnum()
++		data[numpy.nonzero(data==503)]=ThicknessAbsGradientEnum()
++		data[numpy.nonzero(data==504)]=ThicknessAlongGradientEnum()
++		data[numpy.nonzero(data==505)]=ThicknessAcrossGradientEnum()
+ 		WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3)
+ 		WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer')
+ 	# }}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 13170)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/flowequation.py	(revision 13171)
+@@ -89,26 +89,26 @@
+ 		WriteData(fid,'object',self,'fieldname','borderstokes','format','DoubleMat','mattype',1)
+ 		#convert approximations to enums
+ 		data=self.vertex_equation
+-		data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==1]]=HutterApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==2]]=MacAyealApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==3]]=PattynApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==4]]=StokesApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==8]]=L1L2ApproximationEnum()
++		data[numpy.nonzero(data==0)]=NoneApproximationEnum()
++		data[numpy.nonzero(data==1)]=HutterApproximationEnum()
++		data[numpy.nonzero(data==2)]=MacAyealApproximationEnum()
++		data[numpy.nonzero(data==3)]=PattynApproximationEnum()
++		data[numpy.nonzero(data==4)]=StokesApproximationEnum()
++		data[numpy.nonzero(data==5)]=MacAyealPattynApproximationEnum()
++		data[numpy.nonzero(data==6)]=MacAyealStokesApproximationEnum()
++		data[numpy.nonzero(data==7)]=PattynStokesApproximationEnum()
++		data[numpy.nonzero(data==8)]=L1L2ApproximationEnum()
+ 		WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1)
+ 		data=self.element_equation
+-		data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==1]]=HutterApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==2]]=MacAyealApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==3]]=PattynApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==4]]=StokesApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum()
+-		data[[i for i,item in enumerate(data) if item==8]]=L1L2ApproximationEnum()
++		data[numpy.nonzero(data==0)]=NoneApproximationEnum()
++		data[numpy.nonzero(data==1)]=HutterApproximationEnum()
++		data[numpy.nonzero(data==2)]=MacAyealApproximationEnum()
++		data[numpy.nonzero(data==3)]=PattynApproximationEnum()
++		data[numpy.nonzero(data==4)]=StokesApproximationEnum()
++		data[numpy.nonzero(data==5)]=MacAyealPattynApproximationEnum()
++		data[numpy.nonzero(data==6)]=MacAyealStokesApproximationEnum()
++		data[numpy.nonzero(data==7)]=PattynStokesApproximationEnum()
++		data[numpy.nonzero(data==8)]=L1L2ApproximationEnum()
+ 		WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2)
+ 	# }}}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13170)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13171)
+@@ -149,10 +149,10 @@
+ 			elist=numpy.zeros(len(pos))
+ 			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+ 			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
+-			pos1=[i for i,item in enumerate(elist) if item==1]
++			pos1=numpy.nonzero(elist==1)
+ 			macayealflag[pos[pos1]]=1
+ 			macayealpattynflag[pos[pos1]]=0
+-			pos2=[i for i,item in enumerate(elist) if item==-1]
++			pos2=numpy.nonzero(elist==-1)
+ 			pattynflag[pos[pos2]]=1
+ 			macayealpattynflag[pos[pos2]]=0
+ 
+@@ -181,10 +181,10 @@
+ 			elist=numpy.zeros(len(pos))
+ 			elist = elist + numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+ 			elist = elist - numpy.any(numpy.sum(nodeonpattyn[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+-			pos1=[i for i,item in enumerate(elist) if item==1]
++			pos1=numpy.nonzero(elist==1)
+ 			stokesflag[pos[pos1]]=1
+ 			pattynstokesflag[pos[pos1]]=0
+-			pos2=[i for i,item in enumerate(elist) if item==-1]
++			pos2=numpy.nonzero(elist==-1)
+ 			pattynflag[pos[pos2]]=1
+ 			pattynstokesflag[pos[pos2]]=0
+ 
+@@ -213,10 +213,10 @@
+ 			elist=numpy.zeros(len(pos))
+ 			elist = elist + numpy.any(numpy.sum(nodeonmacayeal[md.mesh.elements[pos,:].astype(int)-1],axis=1),axis=1)
+ 			elist = elist - numpy.any(numpy.sum(nodeonstokes[md.mesh.elements[pos,:].astype(int)-1]  ,axis=1),axis=1)
+-			pos1=[i for i,item in enumerate(elist) if item==1]
++			pos1=numpy.nonzero(elist==1)
+ 			macayealflag[pos[pos1]]=1
+ 			macayealstokesflag[pos[pos1]]=0
+-			pos2=[i for i,item in enumerate(elist) if item==-1]
++			pos2=numpy.nonzero(elist==-1)
+ 			stokesflag[pos[pos2]]=1
+ 			macayealstokesflag[pos[pos2]]=0
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13171-13172.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13171-13172.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13171-13172.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13171)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/autotools/install.sh	(revision 13172)
+@@ -4,7 +4,7 @@
+ rm -rf install
+ mkdir install
+ 
+-export PATH="$PATH:$ISSM_DIR/externalpackages/autotools/install/bin"
++export PATH="$ISSM_DIR/externalpackages/autotools/install/bin:$PATH"
+ 
+ #install autoconf
+ echo " === INSTALLING AUTOCONF =="
Index: /issm/oecreview/Archive/12678-13393/ISSM-13172-13173.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13172-13173.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13172-13173.diff	(revision 13394)
@@ -0,0 +1,26 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 13172)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 13173)
+@@ -10,6 +10,7 @@
+ 	/*input: */
+ 	char*   name=NULL;
+ 	char*   notes=NULL;
++	char*   notes2=NULL;
+ 	const mxArray* notesi;
+ 	mwIndex        nindex;
+ 	int*    elem=NULL;
+@@ -59,7 +60,12 @@
+ 				}
+ 				else {
+ /*  note that strlen does not include trailing null  */
+-					notes=(char*)xrealloc(notes,(strlen(notes)+1+mxGetNumberOfElements(notesi)+1)*sizeof(char));
++					notes2=xNew<char>(strlen(notes)+1+mxGetNumberOfElements(notesi)+1);
++					memcpy(notes2,notes,(strlen(notes)+1)*sizeof(char));
++					xDelete<char>(notes);
++					notes=notes2;
++					notes2=NULL;
++//					notes=(char*)xrealloc(notes,(strlen(notes)+1+mxGetNumberOfElements(notesi)+1)*sizeof(char));
+ 					strcat(notes,"\n");
+ 					mxGetString(notesi,&notes[strlen(notes)],mxGetNumberOfElements(notesi)+1);
+ 				}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13173-13174.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13173-13174.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13173-13174.diff	(revision 13394)
@@ -0,0 +1,99 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13173)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13174)
+@@ -1,50 +1,75 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++
+ EXEEXT=$(PYTHONWRAPPEREXT)
+-#Bin programs {{{1
++
++#Modules {{{1
+ if MODULES
+-bin_PROGRAMS = ElementConnectivity\
+-			   EnumToString\
+-			   InterpFromMeshToMesh2d \
+-			   NodeConnectivity\
+-			   StringToEnum\
+-			   TriMesh
++lib_LTLIBRARIES = ElementConnectivity.la\
++			   EnumToString.la\
++			   InterpFromMeshToMesh2d.la\
++			   NodeConnectivity.la\
++			   StringToEnum.la\
++			   TriMesh.la
+ endif 
+ #}}}
+ #Flags and libraries {{{1
+-LDADD = ../../c/libISSMCore.a ../../c/libISSMModules.a $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB)
++if SHAREDLIBS
++deps = ../../c/libISSMCore.la ../../c/libISSMModules.la
++else
++deps = ../../c/libISSMCore.a ../../c/libISSMModules.a
++endif
+ 
++deps +=  $(MATHLIB) ${MEXLIB}
++
+ #Triangle library
+ AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
+ 
+ #Python part
+-AM_LDFLAGS   = $(PYTHONLINK)
++AM_LDFLAGS   = $(PYTHONLINK) -shrext ${EXEEXT} -module
++if VERSION
++AM_LDFLAGS +=
++else
++AM_LDFLAGS += -avoid-version
++endif
++if SHAREDLIBS
++deps += ../../c/libISSMPython.la 
++else
++deps += ../../c/libISSMPython.a
++AM_LDFLAGS += --no-warnings 
++endif
++
+ AM_CXXFLAGS +=  -D_HAVE_PYTHON_MODULES_  -fPIC
+ if PYTHON3
+ AM_CXXFLAGS +=  -DNPY_NO_DEPRECATED_API 
+ endif
+-LDADD       += $(BOOSTLIB) $(PYTHONLIB) ../../c/libISSMPython.a
++#LDADD       = $(BOOSTLIB) $(PYTHONLIB) ../../c/libISSMPython.a
++#LDADD       += ../../c/libISSMCore.a ../../c/libISSMModules.a 
+ 
+-LDADD       += ../../c/libISSMCore.a ../../c/libISSMModules.a 
+-
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS) 
+ #}}}
+ #Bin sources {{{1
+-ElementConnectivity_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
++ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+ 			  ../ElementConnectivity/ElementConnectivity.h
++ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-EnumToString_SOURCES = ../EnumToString/EnumToString.cpp\
++EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\
+ 			  ../EnumToString/EnumToString.h
++EnumToString_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-InterpFromMeshToMesh2d_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
++InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
+ 							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
++InterpFromMeshToMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+-NodeConnectivity_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
++NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
+ 										../NodeConnectivity/NodeConnectivity.h
++NodeConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-StringToEnum_SOURCES = ../StringToEnum/StringToEnum.cpp\
++StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\
+ 			  ../StringToEnum/StringToEnum.h
++StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+-TriMesh_SOURCES = ../TriMesh/TriMesh.cpp\
++TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
+ 			  ../TriMesh/TriMesh.h
++TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB)
+ #}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13174-13175.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13174-13175.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13174-13175.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/discover.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/discover.m	(revision 13174)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/discover.m	(revision 13175)
+@@ -106,7 +106,7 @@
+ 			 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+ 			 fprintf(fid,'. /usr/share/modules/init/bash\n\n');
+ 			 fprintf(fid,'module load comp/intel-10.1.023\n');
+-			 fprintf(fid,'module load mpi/impi-3.2.2.006\n');
++			 fprintf(fid,'module load mpi/impi-4.0.3.008\n');
+ 			 fprintf(fid,'module load lib/mkl-10.1.2.024\n\n');
+ 			 fprintf(fid,'export PATH="$PATH:."\n\n');
+ 			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
Index: /issm/oecreview/Archive/12678-13393/ISSM-13175-13176.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13175-13176.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13175-13176.diff	(revision 13394)
@@ -0,0 +1,22 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-discover.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-discover.sh	(revision 13175)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-discover.sh	(revision 13176)
+@@ -20,7 +20,7 @@
+ 	--PETSC_ARCH="$ISSM_ARCH" \
+ 	--with-batch=1 \
+ 	--with-debugging=0 \
+-	--with-shared-libraries=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/mkl/10.1.2.024/lib/64/ \
+@@ -31,7 +31,7 @@
+ 	--download-mumps=yes \
+ 	--download-scalapack=no \
+ 	--download-blacs=no \
+-	--download-plapack=yes \
++	--download-plapack=no \
+ 	--download-parmetis=yes \
+ 	--with-pic=1
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13176-13177.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13176-13177.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13176-13177.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-discover.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-discover.sh	(revision 13176)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-discover.sh	(revision 13177)
+@@ -17,10 +17,9 @@
+  --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+  --with-scalapack-dir="/usr/local/intel/mkl/10.1.2.024/lib/64/" \
+  --with-blacs-dir="/usr/local/intel/mkl/10.1.2.024/lib/64/" \
+- --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+- --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
+  --with-blas-lapack-dir="/usr/local/intel/mkl/10.1.2.024/lib/64/" \
+- --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++ --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
++ --with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
+  --with-graphics-lib=/usr/lib64/libX11.so \
+  --with-cxxoptflags="-O3 -xS" \
+  --with-vendor=intel-discover
Index: /issm/oecreview/Archive/12678-13393/ISSM-13177-13178.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13177-13178.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13177-13178.diff	(revision 13394)
@@ -0,0 +1,50 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13177)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13178)
+@@ -256,6 +256,7 @@
+ 	ResultsEnum,
+ 	/*}}}*/
+ 	/*Objects {{{1*/
++	AdolcParamEnum,
+ 	BoolInputEnum,
+ 	BoolParamEnum,
+ 	ContourEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13177)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13178)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=464;
++macro=465;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13177)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13178)
+@@ -2378,6 +2378,16 @@
+ 
+ 	return StringToEnum('Results')[0]
+ 
++def AdolcParamEnum():
++	"""
++	ADOLCPARAMENUM - Enum of AdolcParam
++
++	   Usage:
++	      macro=AdolcParamEnum()
++	"""
++
++	return StringToEnum('AdolcParam')[0]
++
+ def BoolInputEnum():
+ 	"""
+ 	BOOLINPUTENUM - Enum of BoolInput
+@@ -4656,5 +4666,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 464
++	return 465
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13178-13179.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13178-13179.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13178-13179.diff	(revision 13394)
@@ -0,0 +1,89 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh	(revision 13178)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh	(revision 13179)
+@@ -1,57 +1,42 @@
+ #!/bin/bash
++set -eu
+ PYVERSION=2.7
+ PYTHON=python${PYVERSION}
+ 
+-#1: install numpy
+-#2 install scipy
+-#3 erase
+-install=2
+-
+-
+ export CC="gcc -fPIC"
+ export CXX="g++ -fPIC"
+ export F77="gfortran -fPIC"
+ export FC="gfortran -fPIC"
+ export FFLAGS=-ff2c
+ 
++#clean up
++rm -rf numpy scipy
+ 
+-if [[ $install == "1" ]];then 
++#download numpy first
++export GIT_SSL_NO_VERIFY=true 
++git clone https://github.com/numpy/numpy.git
+ 
+-	#download numpy first
++#install numpy
++cd numpy
++python setup.py build
++python setup.py install
++cd ..
++${PYTHON} -c "import numpy; print 'Installed NumPy', numpy.__version__"
++${PYTHON} -c "import numpy; numpy.test()"
+ 
+-	export GIT_SSL_NO_VERIFY=true 
+-	git clone https://github.com/numpy/numpy.git
++#download scipy
++export GIT_SSL_NO_VERIFY=true 
++git clone https://github.com/scipy/scipy.git
+ 
+-	#install numpy
+-	cd numpy
+-	python setup.py build
+-	python setup.py install
+-	cd ..
+-	${PYTHON} -c "import numpy; print 'Installed NumPy', numpy.__version__"
+-	${PYTHON} -c "import numpy; numpy.test()"
++#install scipy
++cd scipy
++export  BLAS_SRC=$ISSM_DIR/externalpackages/blas/install/lib
++export  BLAS=$ISSM_DIR/externalpackages/blas/install/lib
++export  LAPACK_SRC=$ISSM_DIR/externalpackages/lapack/install/lib
++export  LAPACK=$ISSM_DIR/externalpackages/lapack/install/lib
+ 
+-	
+-elif [[ $install == "2" ]];then 
+-	
+-	#download scipy
+-	export GIT_SSL_NO_VERIFY=true 
+-	git clone https://github.com/scipy/scipy.git
+-
+-	#install scipy
+-	cd scipy
+-	export  BLAS_SRC=$ISSM_DIR/externalpackages/blas/install/lib
+-	export  BLAS=$ISSM_DIR/externalpackages/blas/install/lib
+-	export  LAPACK_SRC=$ISSM_DIR/externalpackages/lapack/install/lib
+-	export  LAPACK=$ISSM_DIR/externalpackages/lapack/install/lib
+-
+-	python setup.py build
+-	python setup.py install
+-	cd ..
+-	${PYTHON} -c "import scipy; print 'Installed SciPy', scipy.__version__"
+-	${PYTHON} -c "import scipy; scipy.test()"
+-
+-elif [[ $install == "3" ]];then 
+-	rm -rf numpy scipy
+-else 
+-	echo "Choice not covered"
+-fi
++python setup.py build
++python setup.py install
++cd ..
++${PYTHON} -c "import scipy; print 'Installed SciPy', scipy.__version__"
++##${PYTHON} -c "import scipy; scipy.test()"
Index: /issm/oecreview/Archive/12678-13393/ISSM-13179-13180.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13179-13180.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13179-13180.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AdolcParamEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AdolcParamEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AdolcParamEnum.m	(revision 13180)
+@@ -0,0 +1,11 @@
++function macro=AdolcParamEnum()
++%ADOLCPARAMENUM - Enum of AdolcParam
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=AdolcParamEnum()
++
++macro=StringToEnum('AdolcParam');
Index: /issm/oecreview/Archive/12678-13393/ISSM-13180-13181.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13180-13181.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13180-13181.diff	(revision 13394)
@@ -0,0 +1,190 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelf.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelf.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelf.nc	(revision 13180)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelf.nc	(revision 13181)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelf.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetConstrained.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetConstrained.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetConstrained.nc	(revision 13180)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetConstrained.nc	(revision 13181)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetConstrained.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/ISMIPE.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/ISMIPE.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/ISMIPE.nc	(revision 13180)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/ISMIPE.nc	(revision 13181)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/ISMIPE.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/loadnc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/loadnc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/loadnc.m	(revision 13181)
+@@ -0,0 +1,32 @@
++function [s]=loadnc(ncfile);
++%    loadnc -- function to read the variables from an nc-format file
++%
++%    usage:
++%        s=loadnc(ncfile);
++%    where:
++%        ncfile     name of nc-format file
++%
++
++	if ~exist('ncfile','var') || isempty(ncfile)
++		help loadnc
++		error('loadnc usage error.');
++	end
++
++	[pathstr,name,ext]=fileparts(ncfile);
++	if isempty(ext)
++		ext='.nc';
++	end
++	ncfile=fullfile(pathstr,[name ext]);
++
++	a=ncinfo(ncfile);
++	disp(sprintf('nc-format file ''%s'' read.',ncfile));
++
++	for i=1:length(a.Variables)
++		% matlab reads the dimensions reversed and matrices transposed from netcdf, so compensate for that
++		s.(a.Variables(i).Name)=transpose(ncread(ncfile,a.Variables(i).Name));
++		disp(sprintf('field ''%s'' of class ''%s'' and size [%dx%d] read.',...
++		             a.Variables(i).Name,class(s.(a.Variables(i).Name)),size(s.(a.Variables(i).Name),1),size(s.(a.Variables(i).Name),2)));
++	end
++
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/convertmattonc.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/convertmattonc.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/convertmattonc.m	(revision 13181)
+@@ -0,0 +1,50 @@
++function []=convertmattonc(matfile,ncfile);
++%    convertmattonc -- function to convert mat-format file to nc-format file
++%
++%    usage:
++%        convertmattonc(matfile,ncfile);
++%    where:
++%        matfile    name of mat-format file
++%        ncfile     name of nc-format file (optional)
++%
++
++	if ~exist('matfile','var') || isempty(matfile)
++		help convertmattonc
++		error('convertmattonc usage error.');
++	end
++
++	[pathstr,name,ext]=fileparts(matfile);
++	if isempty(ext)
++		ext='.mat';
++	end
++	matfile=fullfile(pathstr,[name ext]);
++
++	if ~exist('ncfile','var') || isempty(ncfile)
++		ncfile=fullfile(pathstr,[name '.nc']);
++	end
++
++	if exist(ncfile,'file')
++		delete(ncfile);
++	end
++
++	a=load(matfile,'-mat');
++	disp(sprintf('mat-format file ''%s'' read.',matfile));
++	fnames=fieldnames(a);
++
++	for i=1:length(fnames)
++		if isstruct(a.(fnames{i})) || iscell(a.(fnames{i}))
++			warning('field ''%s'' is of class ''%s'' and will not be written.',fnames{i},class(a.(fnames{i})));
++		else
++			% matlab writes the dimensions reversed and matrices transposed into netcdf, so compensate for that
++			nccreate(ncfile,fnames{i},...
++                     'Dimensions',{[fnames{i} '_2'] size(a.(fnames{i}),2) [fnames{i} '_1'] size(a.(fnames{i}),1)},...
++                     'Format','classic');
++			ncwrite(ncfile,fnames{i},transpose(a.(fnames{i})));
++			disp(sprintf('field ''%s'' of class ''%s'' and size [%dx%d] written.',...
++			             fnames{i},class(a.(fnames{i})),size(a.(fnames{i}),1),size(a.(fnames{i}),2)));
++		end
++	end
++	disp(sprintf('nc-format  file ''%s'' written.',ncfile));
++
++end
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/79North.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/79North.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/79North.nc	(revision 13180)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/79North.nc	(revision 13181)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/79North.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetShelf.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetShelf.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetShelf.nc	(revision 13180)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetShelf.nc	(revision 13181)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetShelf.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelfConstrained.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelfConstrained.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelfConstrained.nc	(revision 13180)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelfConstrained.nc	(revision 13181)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelfConstrained.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/Pig.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/Pig.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/Pig.nc	(revision 13180)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/Pig.nc	(revision 13181)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/Pig.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-13181-13182.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13181-13182.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13181-13182.diff	(revision 13394)
@@ -0,0 +1,19 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13181)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13182)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
+ 
+ EXEEXT=$(PYTHONWRAPPEREXT)
+ 
+@@ -19,7 +19,7 @@
+ deps = ../../c/libISSMCore.a ../../c/libISSMModules.a
+ endif
+ 
+-deps +=  $(MATHLIB) ${MEXLIB}
++deps +=  $(MATHLIB) ${PYTHONLIB}
+ 
+ #Triangle library
+ AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
Index: /issm/oecreview/Archive/12678-13393/ISSM-13182-13183.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13182-13183.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13182-13183.diff	(revision 13394)
@@ -0,0 +1,20 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13182)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13183)
+@@ -42,9 +42,13 @@
+ if PYTHON3
+ AM_CXXFLAGS +=  -DNPY_NO_DEPRECATED_API 
+ endif
+-#LDADD       = $(BOOSTLIB) $(PYTHONLIB) ../../c/libISSMPython.a
+-#LDADD       += ../../c/libISSMCore.a ../../c/libISSMModules.a 
+ 
++if SHAREDLIBS
++deps +=
++else
++deps += ../../c/libISSMModules.a ../../c/libISSMCore.a
++endif
++
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS) 
+ #}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13183-13184.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13183-13184.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13183-13184.diff	(revision 13394)
@@ -0,0 +1,20176 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/doc/adolc-manual.pdf
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/doc/adolc-manual.pdf	(revision 13183)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/doc/adolc-manual.pdf	(revision 13184)
+@@ -1,9361 +0,0 @@
+-%PDF-1.4
+-%ÐÔÅØ
+-1 0 obj
+-<< /S /GoTo /D (section.1) >>
+-endobj
+-4 0 obj
+-(Preparing a Section of C or C++ Code for Differentiation)
+-endobj
+-5 0 obj
+-<< /S /GoTo /D (subsection.1.1) >>
+-endobj
+-8 0 obj
+-(Introduction)
+-endobj
+-9 0 obj
+-<< /S /GoTo /D (subsection.1.2) >>
+-endobj
+-12 0 obj
+-(Declaring Active Variables)
+-endobj
+-13 0 obj
+-<< /S /GoTo /D (subsection.1.3) >>
+-endobj
+-16 0 obj
+-(Marking Active Sections)
+-endobj
+-17 0 obj
+-<< /S /GoTo /D (subsection.1.4) >>
+-endobj
+-20 0 obj
+-(Selecting Independent and Dependent Variables)
+-endobj
+-21 0 obj
+-<< /S /GoTo /D (subsection.1.5) >>
+-endobj
+-24 0 obj
+-(A Subprogram as an Active Section)
+-endobj
+-25 0 obj
+-<< /S /GoTo /D (subsection.1.6) >>
+-endobj
+-28 0 obj
+-(Overloaded Operators and Functions)
+-endobj
+-29 0 obj
+-<< /S /GoTo /D (subsection.1.7) >>
+-endobj
+-32 0 obj
+-(Reusing the Tape for Arbitrary Input Values)
+-endobj
+-33 0 obj
+-<< /S /GoTo /D (subsection.1.8) >>
+-endobj
+-36 0 obj
+-(Conditional Assignments)
+-endobj
+-37 0 obj
+-<< /S /GoTo /D (subsection.1.9) >>
+-endobj
+-40 0 obj
+-(Step-by-Step Modification Procedure)
+-endobj
+-41 0 obj
+-<< /S /GoTo /D (section.2) >>
+-endobj
+-44 0 obj
+-(Numbering the Tapes and Controlling the Buffer)
+-endobj
+-45 0 obj
+-<< /S /GoTo /D (subsection.2.1) >>
+-endobj
+-48 0 obj
+-(Examining the Tape and Predicting Storage Requirements )
+-endobj
+-49 0 obj
+-<< /S /GoTo /D (subsection.2.2) >>
+-endobj
+-52 0 obj
+-(Customizing ADOL-C)
+-endobj
+-53 0 obj
+-<< /S /GoTo /D (subsection.2.3) >>
+-endobj
+-56 0 obj
+-(Warnings and Suggestions for Improved Efficiency)
+-endobj
+-57 0 obj
+-<< /S /GoTo /D (section.3) >>
+-endobj
+-60 0 obj
+-(Easy-To-Use Drivers)
+-endobj
+-61 0 obj
+-<< /S /GoTo /D (subsection.3.1) >>
+-endobj
+-64 0 obj
+-(Drivers for Optimization and Nonlinear Equations)
+-endobj
+-65 0 obj
+-<< /S /GoTo /D (subsection.3.2) >>
+-endobj
+-68 0 obj
+-(Drivers for Ordinary Differential Equations)
+-endobj
+-69 0 obj
+-<< /S /GoTo /D (subsection.3.3) >>
+-endobj
+-72 0 obj
+-(Drivers for Sparse Jacobians and Sparse Hessians)
+-endobj
+-73 0 obj
+-<< /S /GoTo /D (subsection.3.4) >>
+-endobj
+-76 0 obj
+-(Higher Derivative Tensors)
+-endobj
+-77 0 obj
+-<< /S /GoTo /D (subsection.3.5) >>
+-endobj
+-80 0 obj
+-(Derivatives of Implicit and Inverse Functions)
+-endobj
+-81 0 obj
+-<< /S /GoTo /D (section.4) >>
+-endobj
+-84 0 obj
+-(Basic Drivers for the Forward and Reverse Mode)
+-endobj
+-85 0 obj
+-<< /S /GoTo /D (section.5) >>
+-endobj
+-88 0 obj
+-(Overloaded Forward and Reverse Calls)
+-endobj
+-89 0 obj
+-<< /S /GoTo /D (subsection.5.1) >>
+-endobj
+-92 0 obj
+-(The Scalar Case)
+-endobj
+-93 0 obj
+-<< /S /GoTo /D (subsection.5.2) >>
+-endobj
+-96 0 obj
+-(The Vector Case)
+-endobj
+-97 0 obj
+-<< /S /GoTo /D (subsection.5.3) >>
+-endobj
+-100 0 obj
+-(Dependence Analysis)
+-endobj
+-101 0 obj
+-<< /S /GoTo /D (section.6) >>
+-endobj
+-104 0 obj
+-(Advance algorithmic differentiation in ADOL-C)
+-endobj
+-105 0 obj
+-<< /S /GoTo /D (subsection.6.1) >>
+-endobj
+-108 0 obj
+-(External differentiated functions)
+-endobj
+-109 0 obj
+-<< /S /GoTo /D (subsection.6.2) >>
+-endobj
+-112 0 obj
+-(Advance algorithmic differentiation of time integration processes)
+-endobj
+-113 0 obj
+-<< /S /GoTo /D (subsection.6.3) >>
+-endobj
+-116 0 obj
+-(Advance algorithmic differentiation of fixed point iterations)
+-endobj
+-117 0 obj
+-<< /S /GoTo /D (subsection.6.4) >>
+-endobj
+-120 0 obj
+-(Advance algorithmic differentiation of OpenMP parallel programs)
+-endobj
+-121 0 obj
+-<< /S /GoTo /D (section.7) >>
+-endobj
+-124 0 obj
+-(Tapeless forward differentiation in ADOL-C)
+-endobj
+-125 0 obj
+-<< /S /GoTo /D (subsection.7.1) >>
+-endobj
+-128 0 obj
+-(Modifying the Source Code)
+-endobj
+-129 0 obj
+-<< /S /GoTo /D (subsection.7.2) >>
+-endobj
+-132 0 obj
+-(Compiling and Linking the Source Code)
+-endobj
+-133 0 obj
+-<< /S /GoTo /D (subsection.7.3) >>
+-endobj
+-136 0 obj
+-(Concluding Remarks for the Tapeless Forward Mode Variant)
+-endobj
+-137 0 obj
+-<< /S /GoTo /D (section.8) >>
+-endobj
+-140 0 obj
+-(Installing and Using ADOL-C)
+-endobj
+-141 0 obj
+-<< /S /GoTo /D (subsection.8.1) >>
+-endobj
+-144 0 obj
+-(Generating the ADOL-C Library)
+-endobj
+-145 0 obj
+-<< /S /GoTo /D (subsection.8.2) >>
+-endobj
+-148 0 obj
+-(Compiling and Linking the Example Programs)
+-endobj
+-149 0 obj
+-<< /S /GoTo /D (subsection.8.3) >>
+-endobj
+-152 0 obj
+-(Description of Important Header Files)
+-endobj
+-153 0 obj
+-<< /S /GoTo /D (subsection.8.4) >>
+-endobj
+-156 0 obj
+-(Compiling and Linking C/C++ Programs)
+-endobj
+-157 0 obj
+-<< /S /GoTo /D (subsection.8.5) >>
+-endobj
+-160 0 obj
+-(Adding Quadratures as Special Functions)
+-endobj
+-161 0 obj
+-<< /S /GoTo /D (section.9) >>
+-endobj
+-164 0 obj
+-(Example Codes)
+-endobj
+-165 0 obj
+-<< /S /GoTo /D (subsection.9.1) >>
+-endobj
+-168 0 obj
+-(Speelpenning's Example \(speelpenning.cpp\))
+-endobj
+-169 0 obj
+-<< /S /GoTo /D (subsection.9.2) >>
+-endobj
+-172 0 obj
+-(Power Example \(powexam.cpp\))
+-endobj
+-173 0 obj
+-<< /S /GoTo /D (subsection.9.3) >>
+-endobj
+-176 0 obj
+-(Determinant Example \(detexam.cpp\))
+-endobj
+-177 0 obj
+-<< /S /GoTo /D (subsection.9.4) >>
+-endobj
+-180 0 obj
+-(Ordinary Differential Equation Example \(odexam.cpp\))
+-endobj
+-181 0 obj
+-<< /S /GoTo /D [182 0 R  /Fit ] >>
+-endobj
+-187 0 obj <<
+-/Length 2141      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚXM{ã4¾÷Wøè<4^Ëò'·¥¥ËË.´À8(úÁYÙn¶\øë¼£·õ>Ë%F£Ñ|¼3%ôö^è½¹?óýæîâÕÈ<2N#ïnçEYIì¥qDôî¶Þþëë÷?®¯¾^ýu÷=øs/
+,Ä '±§`^á¸Ò¹ÔµHó@Ä±·"(ÂÜ]­eúVQæ«~ÿ^%±¯öváÁpo)ÿz
+ºð5T%S®«?C!µÑí*Êý¡ÂJ×
+-o
+
+AðÝå½®÷©û¦g!¿¯òÈaËPµ¼põêê«¯AptO6ÞÂáØYþÛª}mzR`-³ÄÖý 6µ¾dÚOÝJ
+-ÿ~tC¿Ð16nK(Bw^â	",¬iïEI±ó^»5ZadôU
+-?¥ ¥Aåó EKgäLsDèÌ¦Ú-Ëç³È[2ößJÉÛªý{á4A39Ø^ ïÕMzEP¤QÊi"Ç³rÓFÃg$À¹DyB1ã3Áî<q
+ûJ
+ÿ@`Ë	l)qæÜê¾4".½e\ë8w@ $¬
+_ÕÆ4Ízf
+¦óôÃ*I1ii@ú´±éHn&Ä®1%	Õ¿¯öÕuT$ÐËTVë_àS÷¼@béû@vérèÜÝØt¸cîÕÀ#EÆ°HR¥%+iº!<.»æ0ÓÙÓíj¤ã-4©8áÂ§_¢#ßæ0¾ð~°Z'©àÉè~¬ªÝóÔY8ë`Óç~»9»¤oºÑÎÛÉùÄÛ(g M\ yRªº&+i¼3]ã´º<iw¹dÄ
+-%Vg ÁöSÁÚ¯j§Í<K¯U»¹aÆ
+'RµL:kEÜrÈ¡æGT%æ¿
+-¬>K`DÃV
+±ß`
+Bò!æp`}
+« ÑÏé`awnUY`Ðlg´ÛÁC0 ×íJ!!/ºb2°«ú¡!Ê9Ap@8k/[«ñ
+Nh[fªÆ¸>ÑFSHUYê~n:ãÐ` ÜBåãQe&0lf9
+¶wNZDöU¨äEÍ%
+ 'Â¿^¶Lé3`[KtÏ[­ÿiõì"´ÄJÙÕcÓö<¯&ÇÞI0KÚóÝ9(Ók
+ã¦
+2¤n
+Nw\8j
+B9ÉÎº(b9iqg¶U«mßÖ5ÓõGöµ)Ð¤$lî·Öe¸sÙe\£HîCµµªñÅj¬§57¸³·§Uº¶vÛâ
+-2¶:§eåtæ-OÒø,µ2<ü^Ý¦Rm¿dËô\PÌ
+&ß	¹uº9BÏ1U¡úç³øQ:ÔUY
+-õ#Ï'zÕÌéÑbù|q,¨þò"õ¡n{ë(/Ü
+-êÇDf³®@·L­?UÃtóæî)0íÏ¦
+®­yÙjQEÜ.¶UÃF`®w:é½G#hdËÖÉåX«éú¥²°þîê)	hAñ£Øõ}µ±:Ôè_Ô
+íDÜÛWsE§>ºC(LUi[Æ%ß«¦O@I|·jPd,üÛª-5S@nGUÏ_.6Þ¡ÉÂ¡
+4ã:¼	uÕ}Z¬ÜÉ|¡a°2ÅEÞâ²`Àw£»ìºÑÝï èOh7Z[0#@Öº¸ÇD¯8ëU©ñ¦ç	
+
+Ä
+{¦ü +I-Ç¶_jp{b(d¹¿·òÐ¿²]
+-³=êõÒ*@òz²ïË¬W÷ÊÖZ°ý2ò Ô÷
+
+³æÒé´2H¦DÝ)Íý%5§ê;ØêJ³Ï©2Q¨NÕ©wÞxFûñ¦jä¦7$·3Gûú2[üoµcúEsJØbá­«#§PÃyï4»*åç½
+µ·hÎ9½kþ§%Ï^KÑ`ç
+-ÎplÛ¤qrôìóÐ´ÛEM\7k
+-O5CXf²Øü,?n¾½»øx!0
+=A"F)^åesñÇ_¡·Å¼
+È"÷³ñDY^`\{·?»·}á%xe)?Ì² `ô,0<×eç_¦11Æ
+RôÌÃbÖqz·M©»CC¶aÁÖ!/­L]Ù^Ä)=Ú©Çv)7éÇ«#Ìdzùñ½½¹
+£9ú·'èS8âÒ¥MjÎ!^õ×à6àk¶gpÉ'.L|Ãó[õlV³YQøß¶ÚìW \ÒÇUVZùéöæym
+@¤ÓÚµ
+Þ¾5'Ê
+-À
+ÉD:hl÷ý^7ºjXø÷jg1û×£±hÉt(E`®êéôyÓ0eçÌPãþ® TþP ñï¤§ûCÁ¬q1
+-üé¯ ¢þÐ¾ÄÌ?L;²\Í³ç&Ú8
+yÌ¯eA7½¬9+ÀcÙ«h-Xûþï¼\
+ýÏwÏÊÁàªÁ¼XfôHü}ò
+¤yÛö(2£íÓb÷ ¥ÿNAs[Gl·_Ûê)ó
+-qN;>ØA²q´5
+REÎ2>Ø,ð¼Ñhí[úÒ¶µSûlü_¶qÍJÀLÝwäÍ§6Jÿ»±!VÒm\½
+Öl5Cpøw`þgd£¾AÉ¬&CDÅýý³uõ?«"¡
+-endstream
+-endobj
+-182 0 obj <<
+-/Type /Page
+-/Contents 187 0 R
+-/Resources 186 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 200 0 R
+-/Annots [ 183 0 R 184 0 R 185 0 R ]
+->> endobj
+-183 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [341.489 646.276 348.214 658.112]
+-/A << /S /GoTo /D (Hfootnote.1) >>
+->> endobj
+-184 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [286.926 544.125 293.65 555.212]
+-/A << /S /GoTo /D (Hfootnote.2) >>
+->> endobj
+-185 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [404.885 544.125 411.61 555.212]
+-/A << /S /GoTo /D (Hfootnote.3) >>
+->> endobj
+-188 0 obj <<
+-/D [182 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-189 0 obj <<
+-/D [182 0 R /XYZ 94.914 658.232 null]
+->> endobj
+-196 0 obj <<
+-/D [182 0 R /XYZ 111.502 146.152 null]
+->> endobj
+-198 0 obj <<
+-/D [182 0 R /XYZ 111.502 102.316 null]
+->> endobj
+-199 0 obj <<
+-/D [182 0 R /XYZ 111.502 91.357 null]
+->> endobj
+-186 0 obj <<
+-/Font << /F17 190 0 R /F18 191 0 R /F16 192 0 R /F15 193 0 R /F46 194 0 R /F19 195 0 R /F35 197 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-229 0 obj <<
+-/Length 1235      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚåXËrÛ6Ýû+¸&C
+xQäÒÏÆÆÊØjºH»HXÆ"Lë~}/
+¤(ÅìÉKnVð"ppî¹E¿
+Ì^^`
+àhF)f·AÊÆ)fAÐ1¦I0Ë÷þ½~yÁaG:ÆilÓéÕìüjvcz
+E~z{`6¦,&fHèÇûU9¢5ÒµÿV<üVC`=»!x¦£·Z®VåbÒ"a
+-ndÖ(ÓÖU·®<umö_¼ð?*(	Ê¥k¿í:©?"L¥6"¨QÂM`Bs+Ü
+-Çc³ $°Áúea¡8"]# FÃ× ÌÛn
+QÆ£GÑ¡,M¿í4	Þl;`×µGuhæÌîÜ)EÇÔÃ0ú8"$]õ»áVb^Èªâô'Â¬g õ½ú¯bBåCPâV
+ÁÅ÷y°ndaqp1½$beW¹tÑìE;Ï
+ìð)'ä{Bû)
+1÷ÀÀ=
+Çn7°ûv¾ÒÕB¥ßtíö&ÊNÙaªØpéc)ö¸L?ãº¨D.sÈÔ
+>ì_¦Òõ5.
+ÚÒaQ}ÿù°ìáËÄãr-Ûº6z'Ýï
+-«rÖPGÏU£
+¾w/ËU»8Ek¢&ÅôÇ9£=h$
+
+-ð5¹2'.
+-¿ÓºVriÄab|òõÉ@á=ávjÛÈU87!uß o*KÜ1yÿeÞj×É¼ÕÀ&Æg
+-Ù2È>7ìläÐíçv¯Ú¥ñ¢skXåÚö6wÞ¼ÎFil£Ì´×Þ[	²F×9Y]
+±KÛÃ):iå
+VS0}¬Ï%½Ï=ÿG,UÙûf  Ì	@Ò¥/æ<e®úl
+¹T,|¯kù¡UZ.}F
+]aÌø×Ëp(1Â»'éçi[7ÕRýÛÜñÙdî×Ð 
+-Wø«d»Ã5QÂ|ZåüÝCzãÌáÛÅBÖÞsn¤Ë%
+-sÖ.Çz5ãLÉ2»7¹àGì:~Bà:$¨ÛsQß66«ð·ÚÇê¿dã  10ÇÆíãÍNc½È6ÓU£©½nÀ¿ªÊBRhíV¬IÂø·eäà&;)E×7¿ÏïWçªì]ÄàúndC¹ì÷
+-uÄK8=j
+à=8Ð½8Ü¬®½x¾Y5W¢Ü¶£Ã>¯$¸Û
+§Ç@èN¯@ûÙ+µ¸º»p8G¢ñh¸zë6eY[
+ÓôÝðXº)¼+ÙÉk±}³k×
+-¢PÚ¾Ôº«k>_lî¯3ÆLj¢øÉ"ÍHZeþéÏJ3ö±ý£`ï´.¬ë¿
+oY­kÙI»ïþfýÈID-Ý·_5¹[ÊÔîo¹@¦ü	<Ea¬ÒF JúØ¼Âû¼2ë¹ûÛç5Qv§Â|&M'ÿ¯ÉÇlwèñ>Yõ ¾3ñ"³¦ò×!Ðð×"È¢jÏ×inø¤yy?
+õ}­ßìË
++È1Û¼8nç³£ÿ ¦xc
+-endstream
+-endobj
+-228 0 obj <<
+-/Type /Page
+-/Contents 229 0 R
+-/Resources 227 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 200 0 R
+-/Annots [ 201 0 R 202 0 R 203 0 R 204 0 R 205 0 R 206 0 R 207 0 R 208 0 R 209 0 R 210 0 R 211 0 R 212 0 R 213 0 R 214 0 R 215 0 R 216 0 R 217 0 R 218 0 R 219 0 R 220 0 R 221 0 R 222 0 R 223 0 R 224 0 R 225 0 R ]
+->> endobj
+-201 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 611.035 432.999 622.724]
+-/A << /S /GoTo /D (section.1) >>
+->> endobj
+-202 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 593.093 197.092 602.661]
+-/A << /S /GoTo /D (subsection.1.1) >>
+->> endobj
+-203 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 570.908 264.304 582.597]
+-/A << /S /GoTo /D (subsection.1.2) >>
+->> endobj
+-204 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 550.844 254.123 562.534]
+-/A << /S /GoTo /D (subsection.1.3) >>
+->> endobj
+-205 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 530.78 366.092 542.47]
+-/A << /S /GoTo /D (subsection.1.4) >>
+->> endobj
+-206 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 510.717 308.395 522.406]
+-/A << /S /GoTo /D (subsection.1.5) >>
+->> endobj
+-207 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 490.653 313.789 502.343]
+-/A << /S /GoTo /D (subsection.1.6) >>
+->> endobj
+-208 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 470.589 351.699 482.279]
+-/A << /S /GoTo /D (subsection.1.7) >>
+->> endobj
+-209 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 450.526 256.335 462.215]
+-/A << /S /GoTo /D (subsection.1.8) >>
+->> endobj
+-210 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 430.462 314.244 442.152]
+-/A << /S /GoTo /D (subsection.1.9) >>
+->> endobj
+-211 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 397.342 382.349 409.031]
+-/A << /S /GoTo /D (section.2) >>
+->> endobj
+-212 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 377.278 420.699 388.968]
+-/A << /S /GoTo /D (subsection.2.1) >>
+->> endobj
+-213 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 357.215 243.789 368.783]
+-/A << /S /GoTo /D (subsection.2.2) >>
+->> endobj
+-214 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 337.151 377.183 348.84]
+-/A << /S /GoTo /D (subsection.2.3) >>
+->> endobj
+-215 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 304.031 225.444 315.72]
+-/A << /S /GoTo /D (section.3) >>
+->> endobj
+-216 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 283.967 377.911 295.657]
+-/A << /S /GoTo /D (subsection.3.1) >>
+->> endobj
+-217 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 263.903 343.88 275.593]
+-/A << /S /GoTo /D (subsection.3.2) >>
+->> endobj
+-218 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 243.84 373.092 255.529]
+-/A << /S /GoTo /D (subsection.3.3) >>
+->> endobj
+-219 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 223.776 261.365 235.466]
+-/A << /S /GoTo /D (subsection.3.4) >>
+->> endobj
+-220 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 203.712 351.85 215.402]
+-/A << /S /GoTo /D (subsection.3.5) >>
+->> endobj
+-221 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 172.713 383.428 182.282]
+-/A << /S /GoTo /D (section.4) >>
+->> endobj
+-222 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 139.593 326.556 149.161]
+-/A << /S /GoTo /D (section.5) >>
+->> endobj
+-223 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 119.53 215.032 129.098]
+-/A << /S /GoTo /D (subsection.5.1) >>
+->> endobj
+-224 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 99.466 216.85 109.034]
+-/A << /S /GoTo /D (subsection.5.2) >>
+->> endobj
+-225 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 77.281 238.244 88.971]
+-/A << /S /GoTo /D (subsection.5.3) >>
+->> endobj
+-230 0 obj <<
+-/D [228 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-232 0 obj <<
+-/D [228 0 R /XYZ 94.914 633.939 null]
+->> endobj
+-227 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F17 190 0 R /F46 194 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-254 0 obj <<
+-/Length 1032      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÕXMwÚ8ÝçWxWùôØÑ·¥e~´ÉLÙ´³Ð`C}jljÃ4ý÷ódÉ\
+-´¦Í
+-dÝûÞ½zó ÏÏ~_r
+k¬I0Çð@*¦I¼E£ë7ñÉmø÷äÕù%ÛñÊXP	Ëµ¡ÌÆa¿>,.·£.:b"VR¸924èYúo(92å4
+#¦à[1¯ê|õ~Oí CiþÕY2V¹YåUébóÒ
+<»¸¾FaD¨Rq¾oËDÆLò "öø=Ä&aJÑønÕ¥)`=¶óJ´¯ÌR÷d¶.§öýÝ=Gq	éíÌo#"ð
+mñêi±Ù¢ËàßÍÎ*µ
+ÆQ5s!«|ágç.~4¯C¶¢uFÀö´}Ú4P¬ú Åì>AB ¿ëªd	Hª<\
+
+-ÌøÒI¿ï&ûÁÊ,¿O°×`V¾¾ñMm"óòTÎk³hl>ïÅ$×m¥S4Ã1g
+hâ\ej
+ì
+#+²¦q>1«êOÖDLmk,=â/Ìû
+ßø
+OFê/Iï/¯«±4}ÎË¹×Å{Ûj]»tp4ò QXÉ×ú±£î«LzãUe^ôT2uô\ååC2dÓ¤0$ûäì«q!ÂzBÊi±N{ìd
+Sh
++P×F&!¯ñ2õáK;lE Ã¦önÕÕ¦úW;µÎMç^JûÉÿpO´r~Y6+ðGÝ¡ÍszsôgÓ?êäJä¨\»7õr}­[*mãvð*ÿ§6õg¨1Î~låü@A&ëO}§ Çwf±,üþ8P>$5{+P
+Ü	î"k¦u¾ì?æ?^.üñ^¯lãZDò"3iæ¥x¶
+I°z
+¾¬°Â¿¥
+Fç£§O¹âa\ö[
+BâEß9mÜ÷÷µIÁÖuæ
+Øx½õ;Í»»Dk¹[Âô'VãíNrfíy#v@jûh£RK
+
+;%CÚ.éÞ;³¢ë4KàþI³Ç]Þá®ãzç\ÅõWÔfisëÄÓårß4Ù
+Ãv8O~Bã°7Ctw8¢
+Ç4¡C;Ç¾±ÇweÝ©=î;_:<
+­§
+ËêSÓ¾Æd»IþßsÍ\·
+¸Þ
+p»[ä¥ÙÜøøL30W!:SXèÓ4ÖZï²­4'ÃêÅ:0Ý4×5¸mÛ]Yö.Èxs
+\Í	}ámWé!¾È T7§É¶Û
+-?Ç³ÿ z]P
+-endstream
+-endobj
+-253 0 obj <<
+-/Type /Page
+-/Contents 254 0 R
+-/Resources 252 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 200 0 R
+-/Annots [ 226 0 R 233 0 R 234 0 R 235 0 R 236 0 R 237 0 R 238 0 R 239 0 R 240 0 R 241 0 R 242 0 R 243 0 R 244 0 R 245 0 R 246 0 R 247 0 R 248 0 R 249 0 R 250 0 R 251 0 R ]
+->> endobj
+-226 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 644.155 374.818 655.845]
+-/A << /S /GoTo /D (section.6) >>
+->> endobj
+-233 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 626.75 292.183 636.318]
+-/A << /S /GoTo /D (subsection.6.1) >>
+->> endobj
+-234 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 605.102 445.85 616.791]
+-/A << /S /GoTo /D (subsection.6.2) >>
+->> endobj
+-235 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 585.575 421.759 597.264]
+-/A << /S /GoTo /D (subsection.6.3) >>
+->> endobj
+-236 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 566.048 451.971 577.738]
+-/A << /S /GoTo /D (subsection.6.4) >>
+->> endobj
+-237 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 535.612 354.101 547.302]
+-/A << /S /GoTo /D (section.7) >>
+->> endobj
+-238 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 516.085 268.002 527.775]
+-/A << /S /GoTo /D (subsection.7.1) >>
+->> endobj
+-239 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 496.559 329.668 508.248]
+-/A << /S /GoTo /D (subsection.7.2) >>
+->> endobj
+-240 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 477.032 428.305 488.721]
+-/A << /S /GoTo /D (subsection.7.3) >>
+->> endobj
+-241 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 446.596 276.852 458.285]
+-/A << /S /GoTo /D (section.8) >>
+->> endobj
+-242 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 427.069 295.259 438.759]
+-/A << /S /GoTo /D (subsection.8.1) >>
+->> endobj
+-243 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 407.542 360.971 419.232]
+-/A << /S /GoTo /D (subsection.8.2) >>
+->> endobj
+-244 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 388.016 320.002 399.705]
+-/A << /S /GoTo /D (subsection.8.3) >>
+->> endobj
+-245 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 367.883 338.699 380.784]
+-/A << /S /GoTo /D (subsection.8.4) >>
+->> endobj
+-246 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 348.962 335.941 360.652]
+-/A << /S /GoTo /D (subsection.8.5) >>
+->> endobj
+-247 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 318.526 197.426 330.216]
+-/A << /S /GoTo /D (section.9) >>
+->> endobj
+-248 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 298.393 356.788 311.295]
+-/A << /S /GoTo /D (subsection.9.1) >>
+->> endobj
+-249 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 278.867 286.758 291.768]
+-/A << /S /GoTo /D (subsection.9.2) >>
+->> endobj
+-250 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 259.34 317.971 272.241]
+-/A << /S /GoTo /D (subsection.9.3) >>
+->> endobj
+-251 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [110.281 239.813 399.425 252.715]
+-/A << /S /GoTo /D (subsection.9.4) >>
+->> endobj
+-255 0 obj <<
+-/D [253 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-252 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F46 194 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-268 0 obj <<
+-/Length 2828      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ
+YKsä6¾Ï¯ðQ]Ö4õÖÞ¼~¤¼
+OMºöÍh7kÔR%ÅãüúàEµdËÉ/Hà@í..v?ø÷þÃ§[^¨]XîJu±¼(°TÉEVÄ¡}}ñ[l~ßÿçÓmRÌ	c P°!µÙªÝn|ùzóeSÄÁå×»Ï?o¶q
+]n~½¹ÚßÝÆAÜßòä7÷_yúêãG¿¿¾áÞí&*¦õë»ÛÛ¯7÷w"	öa'ú2ù
+JÂ8É"q+Bnã4,²ô,ªÒà3'ílû¼hn~5Õ`»Ý#·W2t2$1±ÓAµáá£'¸¶ÿß©Ø8Ónb
+VK:DP
+e;M
+;8p-ôÂÝñ7PA=V3ûQiÎ
+ö%NºÚDyðmf~¢É"¸¼¾ÿe{Åã`û§éyÔ!ñxÖÆ5®åXòÀ¶ü)ê¬`ªàa
+xvðÛ½q<uÐÂrè¸ýÖógÙ¨m^¸wò(2(¨8L5ÑA ãfDeÐº­{ìtÒlÙÂxP%ÊÛäåÚyaR¤b
+º#ÜMµÆ+ÉÃ]YxÊëu^Y4ív¾rÏ_9	þ@Z¬íQ¨09ïqÿ¼Qâ)äÖXÕ§ùä¿¬±Êáp'Õý
+ãiÚvõ J0ÓØÓ_­
+·Ë¦øø.4}ïÀYW|ÓýÀ3`xÛàYì"¾tqÍ¾]
+¥ü¤íár±}:¹
+-ÌÌôhª@Ó-Þ.p¨Á ÁðÈÄaØvsy2­qz},
+hÜÑÔv=KÀ§ /×ìôØGqô¨õ Ý
+
+EbðBú²=
+5,9¯<<ÊñÀ¶3í[øÞð	´öûhz^×àE8¢ÆVÓWaQÌýµõõÂù&nèÏÀQÐ¦á%#ÇÇîå5·×ôÂéYTÅEg
+==ÒQ{µ>5þúÏýÿæ
+-"@?Ô±sFxë(Â[> Ò$OF,½|åê
+áô¯OC<±Ú>>{Z³~Q%É'çä`xLé
+p¢êGclíÀP@Óx»=Sjq/G	çí
+-<HA`ÿ
+Â
+«Á J¥-×³9«,,ã
+aIñq"þ¨+xFÏ¬_	lìcÀlº±çY0è4
+-t3zOH|XÓîÁ_;1 öéÀ½Ú:¼ºaÚÚ8Ë¬¶¢®t¦í`Ù}Ð
+xA!2Fy<9 ´êÝ¦È!¦7ÜÝcÊ¢éná8W	zcdèÚ5g/õg;
+¡3=-( ¬;½Il[¡
+óa?(@;«Ó¯ÌWÓh¯'¦GÖÈG_BYD×Ýåg¦[ 8ÒG/FÃ5/²aµø|
+þs!É
+-Èì=_ÝzÃBBÜ2Ã\'ón´Û²NÕÀ3ðOK½®Pý¹ç!¥@0 S
+ðöû¨áuÖ:õb§`<OÎáÊ¢·¬ù±¦Õ@ÇÊ¶=¤H
+-3>5f0ÍËÚ­_/:
+m-o),-
+sà
+.Ñn	.ù<¸
+×(Ô?hü+"DS_Í!3ÐdÀÐ{ä¥e¹Ä
+ýÁ¨àÈ7>¢·âç!
+¸'ÝBZYó´òÇ®iäFÅ)ëó¬zqãÀü85Ú¶ÂÍß7öì©pBåÌw´6 úo²Ñ)Õ
+x¼áM D ð8À9~6ã#I
+<ýñdÎ«SA	ì1¦L4«2Ò 6:'2ò¹î·kö6Á
+-@Ìu
+-¶
+A±£
+d¹Û¹.«
+-=hÿ
+J½	ù¡9½ð§
+-­a´B×ÎKD	AtÜvr«Éû_&þ
+KRdçê¥¶}5ö½
+e¨'+h5o
+Ú9©nr²0ã§ãÖ#ù - üTápl¨sÐ\îä³\Q£´vº0j%*	eÊ¸-èÀÝ)4°Ýò$WKØk©I{8°kCÈY9{¢$
+
+(bAktÿ²
+ºíHq
+&j7\.Q'
+Ô¸ª¹OºõQlßÞ
+Èeó[g?Í0bÉ¢øbAj^±B:Ù:bÐµf1pÓ±
+ö²7âIOÃ
+-r
+ ðüãÍüéÓ RJùRùì¤´ /îÜ&Çç55df³)£+Ù°E_Öx¾,w*ZôÌ}¡×Gé
+-öìBb´¸ò®­§gÉ2¢éÍâ\ë+¾-ìÐýü 	eMÞïÔZA0zm
+2=¿¥y¬(áºR
+ÆÏ
+§J|Æ¢ÍR¦®]ÍäµØH
+-Û¤ëåãqH§R©>ã{Á¾D#<É2¡=!ðO©¼(ËzrYÉ¶bð,S>«÷ãâM}sZZAh¸ÃÜ9EOHEKÍ·eÎgKþE,ìQxøT
+\B
+,
+²ôu)$ÞgÐa
+ÏràÑAÀôôÁ«.Ëjñ
+
+ï 'J
+å(c Ü/¹ðeó8Z¯¸â3Où\²u?ÈõJ$
+{ý÷
+O Æ42r
+
+^0b×@Æú>pâ_3W	Ùà
+µ>{I³\|V9dÀüû5
+F¾KØ9À!'D( &rµBI
+íÙba£Å¦Ùr²à¦6å!ß±é8	}&g?ÅìÐýÉGkÏ
++Q¾
+0L-O¢8¸µpñ@UõªeÄïJh u mm â
+-fûíÌÙ¶l2]8SA"Û$¯ðkÎþÔX«¼}JªòU+è
+ R	tVHsÛrC3ïd5 ûñµð'*×Xã~Åo9ÒÂÞ
+-`#æÒ[&¾\ÃÎ¾Á²?ÀùÙÖ6wl´¸À=¯
+º±ÎXÙÀx¿×Eåô^»u~Wñòøø¾ëf
+rìéPEcµL#:èðÃ\ÃðGÌpü;½bCÿÄ
+âCUVðuHkå»¯Æã9ÈË4¶ø.¸"v?bå_ñ£ßÚ»}f*óïö¼Û_ªñ? .+4ï
+ÆÿÛÉTíÿÝs~1ÎÏ!*PÐ}á°ZÇ?kð
+_1{æ£á»pYøgiþzõù·ê¹
+¼ ïUæôzS)+ÓEå	(ÆS]©ñ(Ø9·²²
+°r,k§cAW+ÔmÅÂ%=E&ùò	
+§¤ ÞQ£j/<dç¥çf©®pS
+Z¸½9DV¾Zæë÷ö;34±ùÑYCãÙ^ä3z<ËY©Æs¬ãE% ~ðÅÞ9
+b²Âc:xIçiºwÄòY²ßqÙ½NRzâVÍ2?óÎª¿Ïùc¦ÆA
+ñW'Rµx{Ø
+EOFRwã{6ÎßCïó¡£¸[9C¹àû{Q#~òKüó×ô/ã0Ù$q
+5!£]fédÊï
+a¡¹¡ïï½­8&&^ø®iñiþÓ·7ûW+Ù*
+-endstream
+-endobj
+-267 0 obj <<
+-/Type /Page
+-/Contents 268 0 R
+-/Resources 266 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 200 0 R
+-/Annots [ 257 0 R 258 0 R 259 0 R 260 0 R 261 0 R 262 0 R 263 0 R 264 0 R 265 0 R ]
+->> endobj
+-257 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [424.435 534.209 431.882 543.232]
+-/A << /S /GoTo /D (cite.GrWa08) >>
+->> endobj
+-258 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [432.322 398.19 478.082 409.879]
+-/A << /S /GoTo /D (section.2) >>
+->> endobj
+-259 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [283.95 346.114 331.027 355.682]
+-/A << /S /GoTo /D (section.3) >>
+->> endobj
+-260 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [341.26 346.114 388.338 355.682]
+-/A << /S /GoTo /D (section.4) >>
+->> endobj
+-261 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [452.951 303.345 499.468 315.035]
+-/A << /S /GoTo /D (section.5) >>
+->> endobj
+-262 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [412.331 262.698 458.407 274.387]
+-/A << /S /GoTo /D (section.6) >>
+->> endobj
+-263 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [239.801 249.148 286.201 260.838]
+-/A << /S /GoTo /D (section.7) >>
+->> endobj
+-264 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [294.399 249.148 340.799 260.838]
+-/A << /S /GoTo /D (section.8) >>
+->> endobj
+-265 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [223.494 235.599 268.427 247.289]
+-/A << /S /GoTo /D (section.9) >>
+->> endobj
+-269 0 obj <<
+-/D [267 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-2 0 obj <<
+-/D [267 0 R /XYZ 94.914 658.232 null]
+->> endobj
+-6 0 obj <<
+-/D [267 0 R /XYZ 94.914 633.395 null]
+->> endobj
+-10 0 obj <<
+-/D [267 0 R /XYZ 94.914 167.829 null]
+->> endobj
+-266 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F17 190 0 R /F46 194 0 R /F49 256 0 R /F20 270 0 R /F50 271 0 R /F51 272 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-277 0 obj <<
+-/Length 3470      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­Z[ã¶~_aôIFÖH¢^MÐ	Ð´E¦íC6
+¶
+ØWôÏ÷\H]¼Ìnx3yx®ß9dsÜ$¿Ý}u÷å7i¾I\$
+ØÜ6E"Ýd¹
+Ê7÷ûÍÕv'$þnÛ«ú¸Ý)¥¢·e_}ØÊ<rØO£
+
+4u·ýéþ»/¿z¾m*³XË
+N¥
+5®¹K<]Þ)
+çæE{WmIÔ¨!¢ªÞ»ëv'Mä Uo¡Ñó[E¶­ìÃÙu¼ØÖ{³ç37Þ¶Fûª¯Âªþdýûª
+K¹×´ãq& GüÂïwÙ	ë´`úä
+¬+td=Ot²àI§*pÄ"3Ýë¤G¾ÅÛ]ªdô-íZÞ
+î­ùÞ0LWÇQ¾¶ö
+-knÂØü
+-8 WoÊ|ÆÀç<ð9z^27
+'~k¿Öµo)»,Åñ=cAÜ½\Ïî
+-ö2ä^mk/6èüÄÅâÏ<Ûº­Øv<Ø
+øÔ¯pZ¦*N'^_·T£ë^`¸Êb,ïélÏ G±Ø=Áüò}3<7zÝVÑYñ¿
+ø²²¿(bTõê~BÆ"
+=QÑ=èc)¨"üd¡¡p<M¨nø[4ª²ê¹·¸9
+-	­¾í*Ô
+?´Íetcb§%gî¬2½
+=.ì=Al«ÏÜA!]'×yz®$Eôn
+æîÛ¶ö'\1toøà4['q§áä­ÎÃÄ4 ¿7fÝ°î	;¶Y:³	
+²ôdÙà>a	
+:
+{<¹WÁeÃ~@6.AÄb®B%S§=Éå}V}¬ÀÕ­x£ÖuÃ%kí¿?es¹Vg·ë«
+êxÔµ-Ú)6/®ëìqÝ;	ðØ¦)^fDô-
+äÑÞöxFR°) p
+¹æ}©êæÜ
+·¹BHÑ£÷ÁéÎõÜ ¡Ã×NÁDÎ]Üq
+ÂD5xüõÐõÜóÜ/Á"ªÞÿ Ê.Þ´¾Vr(Æ"Ï<xlíõDöWDoyOC
+¦¥à±8du|\o&+
+L|ïÜ£¬m[v
+GÙÙ5`ödq·)
+-+O
+4:¤IÛ ÿª>8Rïm?t1/²¸P((
+÷´Q.@sì[þ¹¿E
+'÷c¸]uv-²['@¿xZ
+àPÑ¶æµÁaÇ=õ-Ü¸'¯zæ"µa£§ø=î]¢ø/y¡d®Ì:7¤ÌxÄ¥¾*0zt×
+BA&¼³P*VF/$éC\zOM
+a³Ã:RjÊ
+%îx}íÜ
+/mØà 
+-
+-_½·­oþ:øs®mCÊVü÷Ãe¸Æ
+íTOqk!À
+V-=µY )XInÏïzPKàK;m¼nm?<³Ð4Îõ(¸wJWcd1Fu
+-fq²öÜXâ ÒôðÇÁ3¥mç;ì`
+Pì~ç×Õ\ÂMM®>-Öé	1Fõg×¸-»aAÌDÄíibyÄßÀ%=:NµX¨ûÖÃnF°ô  xÈNüÚ=ë 41òIy4ªÈ½*à/kÖqÿªñÎòE¡ËÔÄ¦ÈgR×«ÔêXÉbá
+ð¨Ñ;`gè4#gCÆ
+k&Èò
+X%»3-¹U²[Àà9ïç/èÖÆ>	öè8ÉÄÂ¨è{pÌ-Ä#×öÇ©ÏÞ¿cG<y`©pg5NáOPõñËvUËÃ*°ÕöèÊ*v8a~L X+ ¯ÌMºdíâÞø`åcÝ#FAt6zq½À):Ã,Å Jà[9Unù
+­ëÜZØ3ó°@êë/¾àýdM
+-&Î|¶Þð¶3 qs
+<
+5gÓ~5g²Jø.£fÄS	Gpî`ÖHq°ÑVýiç%éºñ)~¡0@¹¯äx$ »tQoV±j¨<ñ4Ãì¥!¼bdôöû¾å±¯ù3Þ»ï1ÇgÎïBøËÈäÝ&tãûpeþ$ä­1Æåõº&*ÈVçK¾ÙxP
+
+pº];´ANiãàsùe8íôµÃ ½Põçp=R@<êlû??¡>ì¾HM¯ËóÀ76ax7KÑ2Ø'a.
+-Ç;ø  öÂ
+f«7"!¡øôQLô
+%|g"g-Oá¤àö¾æÎ*Mìw8" ÔwÞÉ43´k0¢(æE,!õ¬Læ"b
+ý_*b%ÈR¸ä
+ßö°0¨1YM@¯9+fö¦bv[±¡
+¤Éå(¼-É¹,ï¼¼Ü{Î£°éjÿ3xW<¶òùC00O*yk 
+
+ã¼¾÷$.^¤¾
+Èdz÷×û»÷w(Äd#6¢ÊR@Yl@´ååîÇÍ
+&ÁXc¡ý^6*õþ¼ùáî_\¼Ñ#¬zq/y75ÂÞ
+ßüÌ¿¾hrðÌfaÅ+ºÂ¢©6ñÂ¥,H~K©
+ +ü`y)°0Å9	ZÚK7t)	vYp,C¡z$ZþtßcÎGõ2:âõücÐæ³Û¯ÑÀÌ
+-cêh«Æ
+-.Wªy® µþB³ì3{üúr
+=ÓU@Bº@S¸ÑÕ|`ãÙ
+- à²Ñ#¿ ä1î«¹I°/áð
+-ïî´d&z`èøÂ
+þ`ò½8^7¾±È3ìP°	(×Õµ;ÚÉàq°òµÑ£OÿhÐ¶Çáâ& z«6·ee{\e9BÂïW¡d[¡ZsÉB=Kf©¬°c»\ 
+F7<tîý0%ûFl
+-8AN"
+-!.VìÑf^Æ
+ÏCðÙ;-Óèß5ø¼. B¢}
+Î;çYKiæ½v¬ÁB_PrìgþH;ì!®ý*|<N'M^å¨Lb1%¡}
+%|ú¡ÃÁ
+af`kÛs¯?µÍp<AvÑ
+°=GwL¯È
+-¾
+a´KP 
+-¤Û¾Ê¦¬"R¸ÈFD¼äêå ü¦Ù+
+RÊXêYB6!¬ñ"7£
+-$%2c ³¯ºrè(1Ã.Õ U.Jàú_Ì|üï¦íZw <$9ý¢/±¶a5-ýo|Y
+-â}Yð
+-ÂÂØ¸S¢Ü+®&â¥8+Ø£bi?]·°ÕÚ
+©^5ZR|À÷Äøb
+-¤ ?¥qå!~®
+-ë:
+ÀK÷à"g
+ðÕè|&o÷ÈHý×.,À¤³äµ
+k@m9¬ú=.¬h4 Ïå1¸®Ó­;»)íSiäÔ/Ã_»*R
+°'X×s
+-mF×LqÏDÎ ª&uÛ;ô¯©áDg/Î48'§ç1£&'ñ)VµBø]õÈÕdð 
+ä$
+¹á
+¿³!,§8¬t¨{¢èaF®Fdî/\8NxÛøöX7 Ò
+"ß
+-â_;s÷¸þa¬\ëëx¶>iOÃÛ$UièÃ*ðWB½âþaQ6e÷\0 µÉ!ÏXDª¯ ß@ªà×Õ
+ðMý5d*Iñ\Ä©üM&!
+-0í\ÐVR¾â¤È_Il^5i	>Ì]ýäKÅÒKò_2h¸Á¬Í%t	»¾Y<
+-RM*£ð
+¸	>±§Á_¨%h.g/³|PÖ¡¯Îå¿ùX=ªP¢¦$rë«WOÓÀ`
+éôÜóraÑN~VaB$ÐJ±vè
+ ·2%ã ¾8IÄ²6ÿ·HÂø#dÕ42'SÌk
+-<P»®çRFñdÞÙ¸ÉÎÐvC|®æ	CU°"Wû°ùîùìB¨.ÿj
+-áÆµOü¶B
+çRù¾Br! ~¾²Ó¾pàÃ08ýÏ]øºçÞÉúê£Y·=ky<ÜaùÐMdøRµòò»|·Jµ×4EÁÕÊÑûrý"]<2¦jöðªðX¼çÞc
+Î[þúØôÑÊÜ9`È?û]Ö_ïd¼ø5µ$oa&Î¹Í
+éÁp$<¦ùhAÐNÉTÓkÉ' ¦*oÍï=ühñÿ;H¿©ªÿÂXZpûôÓJn§#&ØO"
+ÿWDç7ILføÜ×%a
+ý<¸@)0>¡¬ýO9qÃyJ¥qèØ»ò
+]
+º²S9>Á¾ü 
+ßàý
+p'nù7¶áIù?-¾¥ab@"!Ùã\Ñm¹û?^Ö0·ã¡½ëªÿï`±Âú
+­s»®oÖb%¾TË_÷ SPaöâkÉ}âñ¨äü¿RÓ~Tïàý/>
+-endstream
+-endobj
+-276 0 obj <<
+-/Type /Page
+-/Contents 277 0 R
+-/Resources 275 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 200 0 R
+-/Annots [ 274 0 R ]
+->> endobj
+-274 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [313.195 232.3 359.87 243.989]
+-/A << /S /GoTo /D (section.2) >>
+->> endobj
+-278 0 obj <<
+-/D [276 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-14 0 obj <<
+-/D [276 0 R /XYZ 94.914 387.886 null]
+->> endobj
+-275 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F50 271 0 R /F51 272 0 R /F46 194 0 R /F57 279 0 R /F49 256 0 R /F17 190 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-286 0 obj <<
+-/Length 2708      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­YYsÛÈ~×¯à#Y6ÇsáÊUåØR¢­-kc«ò²ÞDTH@
+µ¿>}Ì
+òæìîéþú\Ü-äâg¿>{w¡¢
+"Z\ß.2+2eqj2éâz»øu¯~»þéÝ
+M
+
+-,P1¡%jµVRÊå/ÏY¥fùþóå§¬ÖÆ@?_Î?\_^}Â]^]ðàþ\}æáoÞ¸ñ«çÜºXé4Ì¼¼¸8ÿ|þéúòý*µK¢W;)3kwÉµDG|Õ|ÓßjD£e[À@]ñ	7«u?³-öEWlG3·uãfËZv-·7õá
+Ö±Z[.¯wnÕ·U/óý±p+ë[&ï÷,ÕH¤í4õbÍ·õñf_ðÊ1oÀ_è¨w»¼cúÅ÷²íxÐu;"Ò°±6[¬|ãï®¬ª²ºNfyµåFÁ
+-K×ç÷ea&(2ìaââ¼q£ù±«yWnëG
+jMÝl
+GößãqV :Yx>»&ßgç×g¿!ÿr¡Ö&B%jÃgÚ,6³_-Lþ´Âdéâ
+FèÄ@k¿ørö/¶ñ6ÂZK´mù\`iæ
+-:Óá±@H3
+h)$~H¦°Êü"¥áyã	_¥2³<(ª poYC,J=bqfÓí=«H°xK0uá¨&H*"T%hY,
+((Ã° JGË/`S@ 5Ì$Ñò²Ú@Ö(T±¢ZA£ãÒ=l|<±àß+R±2iç8;èX¤2æ;\U VeÝð÷@¦l
+AÎÑF=ibËÂVÞ¸UMoyY)UÙù¾ü£ØºÝµ§âN
+Âí¼åñM]µ
+Ü¥kQ|96×û¼mÃµÑÓ;ãÐ§Ø
+Ð- <Â±lwd0»]%?	®%ãUÂq8N©å°Ô8)¸IqÀdmy(÷yãAb$G
+8ä5nrÀÃ+·EãW7ðí3S7pÂ~,Äx
+ª$Õ2çÑá
+ÝnzuºÍå¹Ï;Ö·étù
+-Þ¦Áks§=
+Zn1ôÓi4h7nGSÓ%·ÇMçÝv
+tÇ6ýTp µ
+¿
+-y¤ÈY°-w.àl3^9xþ9NòïÝ±?T9¨KË ußç2q
+Ð<oîÊ½e§õþãøÙ× >ZhßeS¸½á®-.iË»êÇYêÆ¿]?¢>z¸
+
+-	í#!ÇRdé«4Ö
+Kñf57ò«þ:'=xY¿ä
+y¡¶"_÷îÝ,-
+ÇÅ/ÓRá</'GÕep¶Bm8
+¦Ü8±Òj÷x|ãÔP>»ÅÚ ãx,ìë].&x
+²*
+A ½ 3È9âÀá¢j¤Øñ`óD6ãª>Æú.¾!#$ ñÌÝÏF]Ä/=^W
+yl{w»´d_Gluá]}Ü»±{mÁð:Ø©	{Éaë´5U3n'æ : ÀÌíc>ÒèYÃ
+pÓp
+ÿ5R~ `-iÞÎ¬°qô.")yÖA¸qC|.1EÐ}5G6ôÛãM
+Há¸÷±
+-ÝûKp3EH ÂsG8
+E£:¸èÿyhlgDÚaÀþx
+-
+õÞÛ§î0;õÞ
+þð;ç»y¿·ê!dýHNÃå
+-=Èë3løñ5ý8À|üùø# ³£åÞ½Þ
+>J)zñçy|ôÀfÙ>ì á¤
+${ìÃÎ)ìËIô
+-6!
+-éaj^úe¤q¯Ïh^/#©ñ0_¢Ëz´ÃvUwÜdâhËMQl­óCñ÷pã!
+ >`{`§pp­b9S4ÆÑÇSx8Ãr )ÁaBp¸¶2¥T6ÎÄ'Ý ð
+-­T¬AÙãgá#F§
+-ï¨ô2
+xRTÜ
+ jfa w?¼¤Ã×üÒ·²>¶¬.q7)iiÁro:K!X§÷Æ¦ó/èsÊÝà$KÇñ(ïiy?Â~ï Ê18~T-
+
+AÊ2tÑ|¿¡ß1ÀQùÉØ?ÑJ÷	%Å$ì÷Õ'ÜÓ½9ÉiycS [º¶c},u	Ü'ûpFl;H»("Â
+è¿Â!_¥²ÅT¤
+¸Åå¤¼c
+&>ôL qîOàä\ãËà8Óê3hz(»
+·¸»6n9åÇééº
+gHÌ],qÉòxuxÚP'y¨ñÅæ*zËæWåÖ*N|xOaË¯(,åï>×µlo¹ãÑÎï×hº6N-$Õ´§qdyóR-¢1ðùîìWl2
+-öúªäeÿN\ÕZhmZþÌ©Z	Ý×þ§à
+-o;°Sì¶ìyë:æ	Äþ1ä}]ãÑ
+ZdK
+-Ãª±EÜb8¤ìª!6zx¡bó4ZzºQ­´¬½åmÍ_vÐ`9tnIï2S"T½²ò·<Q2{µ_ÆÝòîXî/Ãe¾ºA¾¢Laþóúßqìe§»²òÄÐh
+-LÜ½°Lä¿'`
+aü4N-à>ÂhÈÒ6ü(<
+¸ví"÷ö¨'X¬Xì/1Ã×­Û$X
+Êj6å®È]ÕÅNcjhäîºÏÖNµ¯F®vú
+_7÷M}×äW)m}Å¿ï-£ØÅ`ÉÙz¹DúÞ×TøÞwEÕ'úÅ÷
+=wÀÃñ£ÛáËo£ý0|óbA¿=Vá_	¿BX¨2C-Éª±t/@K}¦U,2ùòöD¼ªm@BÕÙ\ðÐ¯¡òhy'ø
+
+;ø/Ê»Ð¾mÀØ¨åÍFü
+86ª.C$
+zç)ÌþFH!¼ë6*.HùâÿÕôÙ@èao6çS#R
+
+-¤¾=^Iü?¿µlºúHyúÇîs°a
+§)WþÃø¶Ñ? Øt(ü}A;b©×<ÀYU^ÝS» ×3¸o:Á¶ØìáR¨¦pë
+-Íû}(VÜ¸þßTÃ4¼ñN,%"î÷É²JxkRÓ9Bß
+×~æi wì3.Ì¤äRF½gWQíÑaN>Åf}²új¥ñEÞ'\ÿ±>K1ØÒ3!¼
+_±ßb°7 CÑ~é` D¸éiy7môLþþpèPN3ÏÀ_ÕýæcXìþ6o£öFZVýqëo{
+M¡S=UÏvÓÎ)o9Í#Íz_A¥Qf.?¹¸Ö0øgü³hþsnËî÷Ô
+Ð
+-gygTg{ÈÒ
+Ýv%[÷­Ks#ÒsÅ«óë³ÿfVÈ
+-endstream
+-endobj
+-285 0 obj <<
+-/Type /Page
+-/Contents 286 0 R
+-/Resources 284 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 200 0 R
+-/Annots [ 280 0 R 281 0 R ]
+->> endobj
+-280 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [462.736 150.399 504.608 163.3]
+-/A << /S /GoTo /D (figure.1) >>
+->> endobj
+-281 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [156.252 79.402 211.033 88.971]
+-/A << /S /GoTo /D (subsection.1.2) >>
+->> endobj
+-287 0 obj <<
+-/D [285 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-18 0 obj <<
+-/D [285 0 R /XYZ 94.914 601.617 null]
+->> endobj
+-22 0 obj <<
+-/D [285 0 R /XYZ 94.914 198.732 null]
+->> endobj
+-284 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F17 190 0 R /F57 279 0 R /F46 194 0 R /F20 270 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-292 0 obj <<
+-/Length 2433      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ¥YKsÜ6¾ëWðÈ±4A¯ìúàu­²IUÖ²n
+3b	zä×o? 9¢l){Ñ
+- ÑèþÐýòã;?_üëöâúF%ð½ÔO
+s»wRå¥B9Q"=!ç¶p¾¸Â6[áû¾ûé~$®îª6+t±ÙJ)ÝOÇÍÙÐv=Ê5áü}³I;6ùP¶M¿ùzûëõçKª òÂ hµÇ\øÆDûûïÛ?/|ú
+Ï×_¾úN}¿:¾'ÓÄy µ£¤ð é;óùâ÷¹ÐB:*
+-=ßS£ÓÀSqbt[vþKN
+-Å|B^
+'ÒS~Èû¼oKãA}Uø¡_6»¬¹â#n}µæ8¡¤¨À:îú7 vG@;Nìj Ûq»·Ú
+mb_
+-Fvè¹+kLðxD¼A,7¸Müv¶Bz¡JÙ¢
+wf
+ï
+Ww`¦m`Í06ç~FnÖÙ¤ô~hW¸bÖÓ&îL{«aèöWg6
+üÝ·7yl¡åÚÄùuY­ÝýÍý¯·¡ÓYÅÎ8_8
+-l+ïß ð
+àP6MÙ
+æ Vî
+ÏÉÿ¦O«ô$¬ü¢+LßsËÿÇª­FÉ­¯³oa¸J¡ó
+-
+FÿÐ:á}ñîØ,L
+°é){ïÁB
+Q¨æ
+-1ãEÊÚùÏµ5a%NC«íòò%D(¦Å/Çi£¼­ãð
+û °óxcqùuüõ¥üúîþ¬Ãh83(o)7|\F½Ï54üáûWO_Ñìÿé}&{=ÆÖ·õ?}©·â+k1
+®ë·à[ÛJa«Ê³à¾æôÞpú­¸7äxÃ' «ð¢4ü;UþÙ@
+"Þ@6àlkQ
+-Ìè<¼Áò0v&)6[¥B÷gÝè®ÌÍÎ³úhÓ=L7ûqwìÚ$^²ÚyúÓf,ø+Õ ìmf9ÛX1² ÅÄA=Ã
+èIÓ©ÐPA1
+ MLú'QwkËÉøËU³íûrW=ñ°}×Ö<5cÁd?6
+ºr@]Þ`µn»¡Ë86îÀ= ÛX´¼a*=°¥ÌÖd¬ª(>$á÷ÚBUñh¾¼TÆ $³[2&¢Ç¡­ëÞq[2
+-þ57
+-q8ü²]4¢»iä
+-± ùX¬Öq)
+Ó¹|Z;I
+áúó`¢îN÷fÑ|`³5Æ,ÜÿV*ß
+Ï³Æ
+üL¥?¶Vø10àë?®Y
+ÀÂÀ(ÅlJ>ÔÒW«³oV
+-v%|pÙ*>ÉÈßóASÒ uË
+Xý|\N+ô¦xp4ÓÀý$$BÊÌOæ¼2?m WgØx2äÞZîD×éû²
+{Ûï¹^=c¡ ë~¢ô;Ï(ÇåÖ*ïtÕÂs<;1s®ÌcTàGü5©ÚÆx¡"OGèûtk
+¹VÀÇ:~ä9|jrsµÁÎz/¸9ú¤%H«ên»ÒE&b bR^ë¿2´'H¡
+ÕõòÏ®4y5ÖýÞnÉµÒýÉ)hÛÝ]ñÐá®4
+bîê÷mWg}º(nE'.U0Odßd#
+îÀ°
+-Ñ¼ H39\A¬`;ºÉM'j*5¥î®
+ÃF&rKO{ôBÕ>|:?ØÂÝa7Êï1Þji
+ÕÅæjÍìvÿù
+ä­ðn¼$ÀñÄ
+-:]gzåÇxð¶ l
+t`ý²g9mGùXÑjlÛeÝË`\14ULjXO¼2xô]Vðªl­.xlMwâ?ðw57¤^"S²¤d¤Høá
+-DTä³
+-5)+Á¦Çªà&UH
+VKÊ]*
+òlìÌøñÏ@§Ò
+j«¡ãùÀª)>:Y84§
+²}k+3ÁØ_ÉL§[>åþÖvÚ>Z
+Ø^¬°¦i÷ö¡ªda¦Ue?ØI6~Ö§ïWöFz&±#ð
+a ó Vú"¿ Ä73)æofqHof$´ofqh#|ÜlÒï?ÁRAì
+öyîC@Rì`_ZP/9!(Ê>ûÁÊüàV1âog
+1=à³Ý=4u}z=BaàæG¼ ^^
+íõñ<Ì15Z8¦3
+-syäRþ`¡û8væ,÷fE0fâkÜ,J@¨]æþ=`%!*
+È}¨*3
+-Èè]­qÞZ;=bÄ±(®Å@&¸
+ &¢FjxO.õ=¸GaG.OÊÚÅS«]¨3ªÎY,f]Ñx)v8º[ÛKF[LÀ£ËÎ¦Õ¢ç^¢bØ·N>H­p^±=O¨àâØîÕ 
+½dzNÈìS
+êXe*õÓ²yqÉÇ®ã$&Ö$þyi®¤3^+a,N©Î©Äw5áfÚ
+èîô±ÊrB&
+²L
+&f&_PdËãzmQ.£'{÷8ÒKO02?Ê{ §¿µH^pµýP¨ÉEÒÐ
+SbâÁä P¹âEÆeÈBñüðßÏ¿ð×Gþ
+ÐYÀ">(&À»ã¯ªÜq}Å7WËòIÓçÑÌÙ
+-¶N¼µ5ÕÓ´õc®ÖÊ,¯Bk ~7m³g
+³¦ìYù,dÒ§ÿFì-­_-ÛixS¬*+E8±«nõ¡4X<ØáÙ÷	Ð==ñ8r+}(avóÑbnü¡|9#K¾+å/O4´Í¨çQ
+-¢cÚDÅ \H×õ¬9PR ¨RB£8Ãô¢ìèvÂv
+ ü°¹ã³ôµ Jpv #]ÙºEÁ·AQwã'Ðm~
+->¨«fãÜsºÍEÁìÁG~+æ*TØn;TÌnÐÑ,Õ­>_<Üµæ²fÎô AU¦
+g	-î£ýsEÃ'â¾u¿üwÐ³b¸++,-§ÿ
+IJQ^Âõþâ½ô?»ÿQ 9n
+-endstream
+-endobj
+-291 0 obj <<
+-/Type /Page
+-/Contents 292 0 R
+-/Resources 290 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 296 0 R
+-/Annots [ 282 0 R 283 0 R ]
+->> endobj
+-282 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [390.236 348.076 432.106 359.766]
+-/A << /S /GoTo /D (figure.2) >>
+->> endobj
+-283 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [356.251 266.781 401.88 278.47]
+-/A << /S /GoTo /D (section.9) >>
+->> endobj
+-293 0 obj <<
+-/D [291 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-288 0 obj <<
+-/D [291 0 R /XYZ 216.79 459.971 null]
+->> endobj
+-26 0 obj <<
+-/D [291 0 R /XYZ 94.914 247.683 null]
+->> endobj
+-290 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F23 294 0 R /F54 295 0 R /F17 190 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-300 0 obj <<
+-/Length 2127      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÝYKsÛ8¾ûWðHÅ
+-àkvsÈ&vÊSSñlÆUsp| EHbV$= ÙùõÛhQ¦
+ËãÃÖ^Dl4úùubÞÂcÞ§£]
+ñÈã,ÈXÆ½Ë¹É ãÒSpz
+wå§ëË_OÎdºM(ÇÀÆðÉ3Æüß¿þ>I
+ÿþËùçO©0¤Ç§.Ï/>ãô/Îhò=.¾Ðôãc;ññFg0í¿<?;;ýrúùòüý$¾á¢
+1«{^
+ýuÄaÈ<Þk¥¡7«®®WÀ·_=,õ6²ò¤à¼2oåýqôïmè*¼0ÍÌõ
+æ8
+-bZ
+»í>"¾mX
+&A,c°°dÙ÷{Sdõ=_}e#uGÓõÛê-¹ièO
+eA¦ÎO''|&þzÂý
+-7)ü*M<9Ñu¡náKê+Õè®¥Oy]-Q$
+-#ÅP§)ç<HÁ*S.Hf$LÑ¬oV8¾¹ÅÕwã:ØÅ;:ÉGRÝb9Êý¶üóvï(òs
+-_ËÜî,}"uþ¹äÑ>Áï1è~¯èy;*3
+b¿Dfgí>TÞüç0+éZsA!"@JWªSú¥Þþ!Ì¢ßp\ÿP
+÷·A?Ø~@zÜoe]õæ(-¤?Ç´©g]ÙÔ4AÙÓ%Åý¸Adp*µËÕÐKeàkÇ]n7}GöQá-×
+á»ÜÍU­sLòû>uO=Jùqé"¬µy=+qVé«es£ÓùLT
+ 0`§ô"Iü]"z
+È8dVQL»65b"
+-ãjÜX!
+â]Sµ]îÌr£¯í¾|Ð\ÍûC\U¨Ù*×Öä9ÄÔxæ»]È[KÉ}Ù7&íÝV<I¿V
+-¤ÄU}ýjbïå¡B~ÿ´èÕë¾AðøÏ)¿]rEÌB0äú;Èh²e'·ÙÅQ béDÿçØ°ÈzíjÇíøØ«7Y|wWåµå
+¸%AôÙñ	i[¾xB [ä¨Þí«j:ì9ê¡4
+-¢4|jÀî ±ï/°ü @Ç$[õÇ
+R×îõ¤]èÏòÕ¾¥pËM±øßùDÜìªí¬H¢ýÞgz]ÏÐ1Ëq5E$»jZ
+ÛÄþqòfo°8;rÌ
+-ÄµH:ivÛ1£e
+1qÒâ¹¿óõÑÜóíï«ýßhù¬qUMùõ nt'Õ!©­Ü	gk{*;í æV¯ÙßúÌþ¶'³³äÄ®
+³AA0ÀÃ¥¾í«imUèõ*î9^R8ªGOU'ZXwêÊFÊ­.Ý9W©aqp;Éz÷RY·jjý/n×~r !P¯r@^	Ò *sê°#À¬©n¬C'"ôä³ÏÎ=ª¸;ùÚ$Ù+
+-ã Î¢\:=ºûB
+ÇÜ}±ý7<Ð·Å^° þÍ(xV.ÖÚÆMøËd*eä¿7ñ¡Þ©Â
+¹gjíÙYôvèÖ³ÆØ¿°¯«²í»^ãa/éóÑû?:ì"o*Ó@f0ö+LS»Ïzµ
+m°ð¡íç7-ÖÝ¾.IDL¸#/±F ¦Nú~³TÚnþ[yÛR§TâyÿQÒö¥¯Y[7ëÕMG3·º±!ªW÷4Uà]Ài?
+-âsqîv¿ÀI²l.Yä7ºF°2þfYºrD:/[Èþá¿Öª¥ûFâ®36[v¡º©Û­ëÅÒb·!më»0ÌòºX©"Lãûgx½Öè©ÑíàÍº [Ù¸)¸Áojä"!òbQåmæÂÉVÙ¯ÝL1V² P
+-ù|ßÇAõäæj¹ç«
+-J¼55Ò ÔÐ	¾-ÑvzSvK+YEÆM8xhÉ!ãËä ,Ðaw%îÃ¢ÔÊ¬0F¤ÄHbc$@kÅ­z´Ð.Sº¤:àjCK&qQK}Sâk»M£
+sGçlç×ßa0ç
+<¤'ÁçÐ0é
+-ë&¬
+
+> !Ú®19/yMW±ôRáË
+-`EÙõ7´¨±Hüs»
+-ØÙH¤oñ
+ÇNÐJ:	Â-	F2Ý¡ýJeÒh5=ß¼ømúÆëNÙeÀùú^¬íã
+Û?ð)Ýåî¥wÑ@fÛßµÍb=ÃlàÒã?.©5Äö=@Ù"ÀR°`Ñ À¥Mmr
+FåH	2øÎÕÛÒ [Tx5z @#¢´;¬ÊZåQ¼yîÛ >½
+ÅãAï5 ÍxP³Èæ,© QLæÀÐ¶1'F(ªbô=Ø«
+ªa6, |ÆVý5jG3hdá W·³|EWÌ¤{I¢-¢8s°H_{2íÊNk'úÅÈH£øo­2ÿél¯
+w4ßÌÇÀR@éevH¥Ì²
+kÑ`sªEw"áÀzø×KÛTj³Ì]ËjÑÇ`»éßúðCé&0\x
+d"
+Y -1ùí¦Ð(Õ9ªèôÄBáwY¦!ØÑÃ×¾cã~;^< ±býµÖ¼*ë13bûZÆ/èWö`Ú*¿e½ëûÚùøB`þp
+s`cþI°?Aäz±v0Àf	¸ìdÊ§
+-ºØ?cÿ
+ýÓt·
+-endstream
+-endobj
+-299 0 obj <<
+-/Type /Page
+-/Contents 300 0 R
+-/Resources 298 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 296 0 R
+-/Annots [ 289 0 R ]
+->> endobj
+-289 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [406.347 267.165 448.219 278.854]
+-/A << /S /GoTo /D (figure.1) >>
+->> endobj
+-301 0 obj <<
+-/D [299 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-297 0 obj <<
+-/D [299 0 R /XYZ 222.343 283.831 null]
+->> endobj
+-298 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F23 294 0 R /F54 295 0 R /F57 279 0 R /F46 194 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-306 0 obj <<
+-/Length 3718      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÝ[Kã¶¾ûWÌSkÑDÖ*ÇY§6ò
+<ãG¢fhK¢BRÞÿúô A
+-(M6©Êã$ F??@ÙÍÃMvó§/þp÷ÅWß©òFd©Í¬¸¹ÛÞXZ¡nL§"/oî67?&"5·+eYòñ×[Y&u·k«M½¹]åy|<Þ®¨±Ú®Ç6T[løù»ÛR%§ÃzhÚCûÓÝ¿úNèpJ%Mª¥h6c¾È
+7+ß½ÊuZÍª}SwÍ¯·Z'ÕÐ0sÜÎm»SÝó{Õ¹ö~¨Cí[OM?ÔütàáÇ¶¯y`»eÖµY &èõ¬o«ûè
+-¥L³ÜªÖë¶Û47GË
+Áfã¸i¦&r7+©ËT)i¦,Ú7¿e:ã	ev6¡zñ-l)ûoB§ÒÂ¶³(wüóc¼HKQäcdËTÀñ&FýÇÌÃ!E*²µ,¤L~ËSÛ3æäf<¹ÏcK¥¦~ÄÏ±ÕçÁ~ÿ¬¼Ð©Ò£bIg¤ö÷r_=-m~!R)äë7¿øoÙü9Ùæ¿íÃÈÏKrþ_Ò«*¡'1jÒÜZó»U^¢7Î8÷X§6éê]Å¾ÜQ¬«Ã¡
+¸ë±Ýmø©Ùro
+-¾²î¢¬à¶K{QOlëqDÛ-u./êIÊbJÓ;þÀ5
+-uhúKf´9ðï§ÇfÞõÇ­+XvÄ±
+Q¤
+
+'Þ¯:ö<-ss¾3Rá
+-¶`·QBÛFB
+Ý=nÓqÈË¤UÜ¬ö!ÀE?ã¢_P¸åí+\ä3¿ôC³Ûñã=Çj~ùDñÒwmjY½IoWJÉäÃà¾~lO¼ígZÔ®}x¬ÿäz7MWSÌ¯<ýèçuç£)­-/*
+jaD6©Óâ( £B9Æ¢6x°¢¼º% ¿ÅHê¹©w®
+ì×juâãó¹ÎfÚ\Ñ|;9·wQÅ©ùÍ·åÈàxÓõA$'ÈÆvCÏ\o»vÏ½¼W³ Fr
+×
+\n
+íûæá°G$=òL´e.»+rùX{8KgëÚÆÖií,Zý{}ôY¢úhÒrÊNs4\â°~ªöÇ
+»p	C5Ô{/Ø0;õ¿/4¬ 
+-Óàb-¸ÚÜ¹¦-SÃ°]-$mf
+-Æ_G@¦B¢¸çD×Ìò;ì¾uëÙùôuÍ
+-®ÿþm42R9ÛâgÉ6îáTêñ}WVéû¥yyqÿlZeÙ¶å4PA6aÌEQ©r¶V»ØU'bd0ìëWs}6ÉÈtçÉâp:g¹È<×¿Îýjiã
+ä¸ Po0;mFÆ×ÆUZK×G9å3Æß}¾ÌgÈ	ÊNÌ@hÉ.ZBöQøh©*)/Ïº
+-ì²XìE>0Ì§½$j
+¹¦­òêt ]0¯p:poEV`^×Õ`¶nåÃ#&HJ)ï¹
+-Ü²
+-x~¯XØx
+-(Øæ$1&4úµ
+-AØxÏIíÍÀóHB÷¤rË<¨Ìm4l
+`EáW3$76YÔu386Oº2oã4Ju9ð°nUîÉywxÁO ª]ßrÃZzÎÅ±o!3R`¾*H÷ssÍ}Ê4/®fF`
+f
+Ñù
+0K Ò-àä\[¥%;Sª{8y%Ã8Iÿf"Ù7Oµ{ôÄ ÇýªZ®úF
+#!
+Þà6;&"½BRG¡¾Y7÷öÌ2Ç"çÇGÕ$«£¢-X
+³iÝ¢íàSÏ­ä$m6ò0o÷yIÛSâ%­³|Ø·Ôµ9íN=·0:
+w5Z*¶U`³Ï6ô,Dzhà	ÔçKì±,ÎÛ
+¨¿>
+8WóXC
+-@óLüº7zeô00Çª¿¾ÔOC}Ø° !_8Ö-V%Ç®=V#5òq:4?Õ<º=Ô«¾ÜaþÆÅÎ³¿çõë§cu rßÝ£Ëî»êÀµ 	ê§U¸&NFöÂì
+-²±¿/ù%
+T:Í³1aw
+±xU"¡øÍÏ)vn°ym·gæ¹OkAþë]z]&D-a	põÀ ¦rTô>ÆmÁ£ìÿÞ
+-Q´	
+w©'ncR`ÑpÉ-ª1zw*®
+kò
+ }»w¬73Ó®¹{è
+-«!Ðcxg«ÁÎi±Dàqnîë¿ôo×:y:ÐVää¢r¦X:ªÂºB8ûhÉd7U÷Ì­nåÍèñ
+-
+p  5mÚ=xÔì½o| æ	z7Å
+ÜcÃQ
+:¢¤GvÎ g
+n*VÄ[ô5úP£'ïjTòÍ?þeõ-·Ä
+-m3°häApA°ÎLL9ÊP}>
+¶Åù`]ñâ= )Q5
+-	©±/b`³¤
+óûöûÓ>âé°\u?Q
+
+x7åwY
+-û
+-èBkqKrÂhÉ!À@¾Õ­FÇÇdÄ
+Ïbò±êª}=µÀ
+-µ 
+- = %ÑÉµ
+yª0	x T?ÂG×òáýû÷<p_±
+àuàmR]¾V>2Í¦
+Î6e¡0!©"¶¢ÊÑ/+¶I
+ºQ¯6=Å8CøZ=
+0¸¢çR5vfEÓ\\ÆgC8'¤
+-|ýèà:W°A+ZRI
+½®e¸Õ°?KåÐ¤ÝÕ÷
+_0ÈI;û?6%&@¦`}2%ÕE"
+½r0cy!: éB ¾£wèú_^Ìq´\¤2×¯+ïíE4A;«cã%Ty*¬çhdHï®j¼DGàZl¯fõ^ãRG¹ZÐìÒ¦¥èV@%õ5´H¥òÄe1iÈ+À5Ã<læÛjøk:ãÆ>?ÂÀuKªéy¥HJ¡´6ºxÏW3Ûñ«)ð^FììE+#¡Ã~uÖ,Ð^oVeñòL([Pbk]@x°Ãut+g@½Fá
+6g@.÷?+ý¯_)ý^1
+±@çòÒA¦,%X"N
+-¡4^aÛ4$ËTÖAÝÊ3­Ü±£ûzáàN§ÖÊ+¸vxÒC¥òe=¦ôÔP¼rº½V%¸½"¿}«é:GÏ¼Wn2XÂP§>Ï8ë8pÞ¥°ÿ:ÚhRyégÞÒ\=Ôº«v;þåªL%Ì1G~èèO/Úýñ4ø;9wxa¨Â`óçV|8TÁA|2ë& Â÷·ºk¹&µ¹/f Uì
+wð1nVfRÈ.a"¡ýSªÝ³¸F>Å­lÊ®cÏq#J»ñ[eSá82ÙLa²ox^:§áB,ØxÜÔÛú×p
+£ßGLµ
+ïA
+Á¹¨ãù\Ï"ÇÅkµ£p7íé~W/!rºb1/1qËÊäCÔÑ°©z}Z84E\2¤É¡~kqñI
+Ûiõâr=
+¥ÁWPÀ
+-TéàKìÛ
+(éØ×Gþ·¢FÕ?TÈg^ï£_"ÔdK9¬½~rXæÁóÀ9KOíò]F í%»îk@èc?²ê#?]D§vá
+-év2ØnáôàTeR5Ý7[×M4)8^¤3}
+J0ôéÂÌa
+:{¶GËÀ~6!»ÍÒ4à¦C: òß"ÕÕÐûÆ-hA
+9sz  ¿Í¨÷Ò1ç¢m*¸h:¼&zb
+-ã¸@¥=í
+_áuO|'¬LWÿC«
+-6Ø
+ñßy×{¥L>ë¬Té/H º
+1
+zÁ	lÙUe!R
+Wgð8`gúù
+Ê*7Ù
+dèöáÐüæÆgtù
+NÃ8å>ªí4jç\Ã.Ùï¨z3êíðáÍ©/§V<ü,Ñ9,¹gçC
+äîB
+~úâ
+-vÆôÁ!Ñ³FHzºÛìëH(wyÞîJ«oñÇÐqÎxIÃ_`Ãþþt<îy5Ï !lóÄ0^j'_º>íª¸ó
+-
+-n·k»ù·Ñ¤}ä?8è¶<-Æ´
+5?/DÀúVð :6P P"Èm¡ã
+µæ°ÞXá­g6Ê	Ë¯.DBHJ³Ñ:3?:Z´º}ºäâÈ§ëã1Z­*DWü";|´Î~:ô7çgÌÎîH»5f{¯$$hjO?l9UIÿ
+Æµï]·ûg-hV­|ÊñÒÏÌËWäy:Ý¿ïj8jñÂÆ1ÃW1µòçíøY³«P·+ÍþÎ¯°Â è¦LtHNKÒ=}íüjô,t\Ç7Ñ ú_ÇÀb
+åTà
+-¯é×0hÌ,>v>­Æ©ÔéòÜÒ³Ó öäæ
++NP¥Yö*«e&4)õZ¥FîßìûæáÔÒén!«f|m»æñ
+ýeùnS¤£üÅwü[½y½é¥
+-8¢ñ#ââ
+¤jG ùou#Ö]ß
+²øù|³#KOþ¨WFUðºö·qfªÎ±JÌj9gÁÒËiP
+êùÿ£ÐÇh â
+ÝíÇ~¤q8*Hw#rN¼kÜ¾5î{ð³ûÞ
+CGüÜªðúÙ²HO±¼¸Uøþî 
+-
+-endstream
+-endobj
+-305 0 obj <<
+-/Type /Page
+-/Contents 306 0 R
+-/Resources 304 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 296 0 R
+-/Annots [ 302 0 R ]
+->> endobj
+-302 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [174.566 353.874 230.234 365.564]
+-/A << /S /GoTo /D (subsection.2.2) >>
+->> endobj
+-307 0 obj <<
+-/D [305 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-304 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F20 270 0 R /F23 294 0 R /F24 308 0 R /F26 309 0 R /F60 310 0 R /F49 256 0 R /F57 279 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-316 0 obj <<
+-/Length 2670      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚËrã¸ñ>_¡#Ukqø~
+
+½åTj¼å(¹$9À$$¡"
+Û~¤4ª4F¿
+6ÇM°ùýË_ö_¾>
+é&
+ü2(ÃÍþ°)¿
+MVÄ~}½ùÛÿìÿúõ))1`Ðaí.
+Àûãõñm{÷¯ÏßßîâüùûãÃþùå;NïåüyyeðÃo¿	üåÛ#¶Q1­{~zz|}ü¾¾ßGôµ/\èö6»0óÃ¼ÜìâÔ/²Y½ïXyïHYóø¤¶QîýX@L[J
+-ºæ©zÛî`±C
+F»
+0òTÓ0F?¾Ùn
+L«
+~Knû»NB¨Ìò
+eãY·dãyûg|°`;å^½ÃkÓõÊ8oì§IÉ×3ÿÂÎs¯³øEæÌ ÞOÎ·°M§j]ûÛ]¦Þþ¤ß/
+-^$ô\lGTº
+­f:¦çµ¡ãy­«F¹ÅÁÑjd£jxáÇ6ÅkàD
+
+
+æ=x±¯$
+-;-­k'=
+{ÒèZ ï;þ'50P3¬mK\ Ø©ÆF!]GÐ
+-%Õ8ZVW­Ià8àá@]H
+Ä±÷öÐÙÝòN)ÃØ-üÁ5Ðp¨øÄS®ªÃCx%öó'Ýp4|6{cÛêJ÷=ÔádÃsÚwVUÕh#A?ùì¬9ÕÊUf;GË>SÙäz)ü^a6+CB
+
+&a]4!¤F¶tz(gõ]3ÎûÉjæã.Êtº
+-A
+:«á´ª
+-+-2ËÑ¶ÁÏ¨Å$' ð¹#Ì
+-¼ÝÙAµècè%~36  óÊ»tÏ3ï¿£ªAöàE
+II1kÛùü¯Ä)0Qnì'Ckô÷X[Ñ4á¡Íp«<
+-½Ã (´DâÄmècY:ëá$1F=`
+!ì¸¨hÓ
+Wü´
+-Ge~£ý¨ÌfAðÄ
+ºqÑMòna¬&^CÃ²/FÅðÎþ	
+õLL¨ÂåºA ×4
+øId ü5ùÃq»(yá VÂHÞ+X¶n]&PÛcâ9-ÌhàÎ!¹Éð¡ã'
+¹¡
+ªÕep¸r
+ïPK!%Íøv»·Aë+Bç²hÓQap2G¾JZÃjvG÷T
+ÆD;ØîÌp
+-
+ÐÕf¯¢-ìÌ
+·¡_mº±8ñ×ø­SGºh¢pÈc¨ |
+-ª9Õr<a.z¢; RKÁ°1Ö»Èþq0öÚîúñ¾ÍXáÒåà~ïZ÷5rlÍu
+-EÚED¨o
+-?õ¹Ö
+-óMúeFXÇ ½¢ô(bËÏÁ¬Â(õ^õØQaá0	ý¶Ä¬Èß÷öÍ
+ÂNÛË8ðð´«u/,\RÀBûI)WzFÄ¨³FNqá/*B0
+ÔÁ'O¦Ä
+ cÉùh:tüuYó6»<#S0w°WGÌ6½6[X Cd¦5çkÊR³¢2ÅTzX¢ÍL°Ü
+Æ¢ÚÀ©6à)1Rpp ²37 ò(æ¯ÌÑ+?_gyBÕâBõjîø½RL¦$¿²|ÄÈ"Ki¨:
+Áª¬qÁYb)°£ µûo/Û=ð+! fPGïÙñÈe9´Â?º$C;¶Tí"Ä\° +-ãQ°s¦8Q!¿\òñ¨¡òø½m¿HÚREL®x²Lòxq§VS
+¸ãkH68uµ  âp"ÇAB2M¯
+
+-§xï+;¦¥
+¥óe
+&
+á~Ûµç¹.DÊR1§^Í©4
+-SJ¡8À¨'÷V?·mPo½¡QRËq²r5á	Bxà
+Njµ'ìè`Ñªsl\b!f5HJ(ËÀE
+uå~Æp¡NlÀüq'8Á0ÿV9@"Ef¯dFôÉ$q0æ	¶pÄ!Å$\Ð÷ªé£hËh
+©ÐÐu×kdAé¸
+Aê\Ð¹ EúfÒü÷2e2lØÒ^F]Ü-Ð
+-`ZqrÔ­Æ"®F7HbÖMît°­ìTnÐvüÅ
+Ë£E#Ó«<K[É#i¿Æ
+Pùg½s=o×üúõëS.%d~N¢ªîF©
+oE§~0=} 
+-D÷itCöç¢*Àzup>6vH¢Ö+tu×ÚÜAh¡,þ¹¸
+-ëNo» ®ãcÂ®ý4/n ÏPDs[ÌÞ2G¡Äãð«Ú£ÌoÂÖ/µ;Ñ
+NÉÓÖ`
+£ä>±¸ ^9»vîtjµo{Wä§kw+gr$û¡
+-
+~¾[<GÔµÂ¸IîEÍÚ¾¢/éÌ0?)4î`5 ü9]®ç´åk6îýI¦,Ä©
+Û	ÐM[}ºeé'hë ¨VË`"
+-YØBéz]Kó³Ú¦óOØ®Ü 7kL;òXÆÎú½c@¯5öH\
+¦!WöÓËUé§Q>×qzOæÈOLYâÅ
+®zÍÃéÔliU¼¦Ü6Ó4c?P$B{dò|p¸+Ã1Ç
+Q´©ûé0¦2z.5ÈÖNÈ©ö×/q¡ ÿO1°cà-`Òêã"µÌÞøêÂY
+sØKx ·ºO
+só«#¬óXy×¤uqØ£?t5ÞööSÔç·¡w7÷SGh=)}'å XÙñCºªëÚd	k(ÐGCÉôÌM>ìÌÚôr
+ÄÄåâ"/áßîúE;÷Ë[å¥×É^;½æ¥;$/¹èTâõÃõö 1eÏh¥+¹\Ç{¢')Ü}[c òÁ'æ.xBÛòì¸À*õç HJG§<¥=AÀ 
+Ã5CÜÊÑqA_É*¿Á`­(EøubÄ
+àEË3O§Ô%p Ï\ÍfMâý©7Xä
+-(ªßOzÞberêÓ/ivÓ¨/ÏwÞ3#ËîEuÕh5 ¸+pÖêw
+\Zp
+"I(üà¢
+¯0d¹¼5 è
+-_Î¼$OXë±·1»v­ÃÈüÿ¨`(ìà>¸,¼Tqùa]
+ [z°ÚÍ}I6=êëVï&ÑfSi
+Gq´.×"zÍÜÏì¶jÖ^C#5W=²ÏÈ·Ç÷)ó0;c¸¢ÉVHQá¹÷ÇS'¿yèô_e(¦BêbÁ;ª½yÊÑîk` 'Z¡÷a&ã^||Í@Ñf¥â
+m%
+B¥Ê>ä_ýårßÇýÿî}Ú
+-endstream
+-endobj
+-315 0 obj <<
+-/Type /Page
+-/Contents 316 0 R
+-/Resources 314 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 296 0 R
+-/Annots [ 303 0 R 311 0 R 313 0 R ]
+->> endobj
+-303 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [154.918 497.235 209.032 506.804]
+-/A << /S /GoTo /D (subsection.8.5) >>
+->> endobj
+-311 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [180.463 205.201 217.91 216.891]
+-/A << /S /GoTo /D (table.1) >>
+->> endobj
+-313 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [124.833 185.675 167.047 197.364]
+-/A << /S /GoTo /D (figure.3) >>
+->> endobj
+-317 0 obj <<
+-/D [315 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-30 0 obj <<
+-/D [315 0 R /XYZ 94.914 428.333 null]
+->> endobj
+-314 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F17 190 0 R /F20 270 0 R /F51 272 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-323 0 obj <<
+-/Length 2800      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­ZKsÜ6¾ëWLíSÖ ðTv+ë¬×N¥jkËºÅ9pHhÄ5
+óaIùõÛn¾ÆEº`h Ý_?Gþæ°ñ7ÿ¾øçÕÅwït¼¾HüDn®®7Ô0
+âÍU¾ùÍ"Þî¤ïûÞÛºÊ®¨«´Üî ð~jÛâP
+mµU±×µÛß¯~ùî4sZIáG6$f']ø|ÿººørüÜHiÉ&4±ðµÉ¿ýîorøøËÆAonÝÔã&H`g·[¹ùxñß5&W$1éÐa
+NLp©D$¡
+-ñNî$!ð
+-E¨
+ÝìMàn¶<9l&}ý:Âf~,^ÝXÒÄu_e¨|Ó^Ñµ¬·;ÐLå=QRÐÝ}WdâÛÃ?ý
+³®
+Y>ÎãiM$àùèA´Ú¨§5%C¡â5¥
+ÖÔ«l:hJÅBDgJÂ¹¦Cê¦2hæíûÈÝÀ§=¥M[thy¼¢í>ëú'|òÕGfsbÒÕç<n²;í¤	é°}J'Ô*ñÒn¤§¢:ÐøäN]ä `GIôcÊçÂ÷òÿ0l«" W_Å(ÏØî¢@y·7EiÏ¶í6þÌá9þp6ëczH/÷îth-¤
+ÿÔX`û3 Dd®°Bã[¾/ÚãÁv+
+)Ôä÷«
+u8íØ	öë\ô)ë	dðÚë[?lìÏûºú¥Æn}óÄAÀõÓnÙDHâ]>bì¯±)»H´¢Mbè|°M[
+ÖåÁ5=É¦bç¾·Ìb'½®Q]­a[ 43àáúf÷-f$&I+l"0Iz·ÂD!ÍÍºY==òI÷í)ÂÉ$ÐÙámí×­WA×¤E²`AR
+-=ÿ°Míî²Ù)¥fÞØ\ßJ
+ ÖS1¡òÞÛ*³àjX±ýD)r@ÝÈã)yñÉ
+ª ãç¸aÙ¯Å©ÍðãMÑý±Ë¬îÈ!öuÏ³Ð}¯øYvEí ]ÕÕî]÷¥}Äâuó
+çñ'lX)Èðñ¨Ïü°	'BÂ9M ¡SIÿ¿Âc H8çýX
+ ¥MÑÝ
+-bx§Z´Ð+Â
+äêò+©S¤&ÃMóº®K à6£¹´´Ã}aËÇ)=À<Ø Ã	ØÑ ìYAöâ"2gãÐ
+Ú9LhG/Ôr%ðaÒÚ1ºLÆ/yÑ:üÇsü?Ûçên
+-q }½
+¶:ÜPÅ/-|ñÁù
+vD×ØsÀ­Ôp
+-;ÕúB
+>
+->#Ôäó8WzB¡2ç^#bÚ¾ì`Ìs¯úH
+@¹ò¾@;9 
+-$Ñ\Â
+!#¤ðl¤lcæ¡
+Lqè[\r1t°mÇCòÙjYG¯^
+-é0Z¿"uX")|^aK¤5¨jVö¨D%«*.	r_èj³Ë- Kcþí¦|éÓ
+TæJsºÄq]A_f8êhGé`ff0CÚ²^Yd³Ì²'ÐÍî#ìb^ÇÀüyÃgÙQJXPA!àsÎ|
+&
+t-ù=ä`Z{?Ûí;kÓóÔ¡ÛÄyT;Ñx½mWû=phCbWxTÙì (
+-Í¢óP>ë<EfÖy
+-ä'P,D1? ì"é¥'V ÏDé« Ò^§YW7÷DënÒîçiïsP¤Ù»ôx*-S"¶ÒxÉ
+\Ï×û
+Ú!l]fÓ
+¤má¥
+¥©ùl
+-×õ@¨Ò¸ ÇÉ,cÝÑïÕMîêäÉº|².ÿ<ÓÄG¢ÉRÚÀ¡²¾t¦©|ï}S
+à-¥Ø
+-"I¦cìÓó$giPÆ×mÍ_
+-Í¡&Mþü_woq
+RR
+r£õ[Ù¦¬Ó¨SJO¤]èIá
+-qÝUK>aÒ÷½¥wû¡ID½Þ4ú_<µkà©cqÀÐâ~~ä}.*êÃàÚ¿á¥bgâäÓÜ¢º/ñ>~èå6»¦
+2+èÑÀd óøf¿ôcYP\¥aðfÇïÑÀº¢±k×á0½î[²jxsúgÛïÛ.]lIYpQ:ãY-Ý®ªËú0]:0èý
+µ
+O3°lÈPò>³Ã`o=lÊ¢]Õ|ã¬ÉU !=kR1Á fr
+5#-àY°
+v`A3Ñï¥
+-ßÇçhóÂòd{Þ0¿}V\":ë@\ÅÑÅ	LÐ Û$Â(vÁ°ûEmWC'-Âö`k[¥Cï ¦
+Ù~ZÝ@$»
+<§ÝñÄ
+É?¾4öT¦«ÇÝ§ÓB¢HH]
+@©Âý©¸/1SÉ(sé½ÛßtÞÔù®¢eßÔ7{²ìQÈËðg²¯EÎ=¥ÇXñ:`æTÐ»
+!-ËY#o
+ôâDÄQ0¥ºUN áNáev/º
+³µqG<,e×ø¡k§=¹PE"U
+g
+ZÁe7U9®\
+-Au(ÐÆÄ£½'a¦wË¨;NÈÎÔ4&^ë±x)
+Â±^èûÉÐît,¤½QNÜ¯³µF
+îß×Â¦¾O=cäýÌ2
+6Áðí{zËXSÂNA2
+Áòs/%ÞÛ7opö
+n¨àÎM2T$ðá-ÊGÐx=ºA&å¡£9\`7¡ÄX
+ú:z´sÌ-¦dÞbZz|§fÛ¹w;!@Çi:öZZþWGËãà©dÏ4ËÞàlìàñÃÙ%
+#æ~Ö¡C½9H°ª³ØàDR]­i\+PùÔbß¯iÔ¼Ç¼i¹Ùic§r!¹ñ..4]÷á¼(ÅÅH×Ì¤oûÁ@
+±-æG0^pC×µèÀg
+¼(
+ ¥µA¦;÷ýitxgF\7Å¡àóhoÆäÄíÇ> µ£D.8;Ç3ú@$QlPìb
+4wP,þ¹§tÐY?ÐÓíðëÆÌãùC9%Ï|Õ{ë
+-¶[W8ipï
+×ô¤ø	É.Z"àuë9
+
+Þ|à~|tÔeæ¹c"Ó÷ÃOz¨ÏíOò	z~¶vMVfìè£a¯Å4%L¬Iùb+`ÞÇë³©s
+ð!,­Î¹wI9·@
+úXQv/.C+º¾s©F!sÂCTWQárAS\ÕYÓz+Êq`uô28(»&3ç> Ôh*eýZ
+-åÞUi
+-Pg¿g[ûMYw6ë;Kó)¡ª^g©¶´Ð+kjUD:8?3»ÂÕ1k@	ÁØâà	 è	õ*©E>5â
+-YK{nzÚÜ?v,$ý²TÊh5¢ 
+³cZþ(°¢í º'ÂP®
+-u
+f.Ô­»héqÉè4ß]KÉ­çZñ~æä©mOEÓÚ¨üN°þ
+-endstream
+-endobj
+-322 0 obj <<
+-/Type /Page
+-/Contents 323 0 R
+-/Resources 321 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 296 0 R
+->> endobj
+-324 0 obj <<
+-/D [322 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-318 0 obj <<
+-/D [322 0 R /XYZ 266.177 461.056 null]
+->> endobj
+-34 0 obj <<
+-/D [322 0 R /XYZ 94.914 426.808 null]
+->> endobj
+-321 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F17 190 0 R /F54 295 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-327 0 obj <<
+-/Length 2139      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­X[oÛÈ~÷¯à#
+µ&sãe¶À6±^ Ij»OÙ}ScXôTÒô×÷93(NP¬¹9ç;wòdðä«<^½¹Y"83Üäñ91¡¼TL¨2yÜ$R!W¿?þúæVç'9Ð¡3«µà§ïo>®Jþ|÷þÕZ)ÒÏÃÍÛÇ»ïq¢Ó·´ø~>ÜÓòÛ~
+-ëÞÝÐèv%ËqÿÝÝííÍýÍûÇ»W¥N==`íâïÍãOD"rÃD!çL¤:\ýyÅ.
+-)ýó±ßÃÂ»HÞµWÿ¿H>
+YGâëõL
+Õ$ZKVÔÛz{ì
+É¨þ²Zk¥÷n8v
+-­}^eyj÷G×è¶kÍö]¸8ØºÙÒøeµ¤ÚºAÀYXÔã<KÖJ°²ÔÄÊ°³0 4ö$òÿµ´ðÔÙ¦ÂùÂMØiÚpygqÿóJi b=/_iÒ×°ì~ãB¹jèã£ñù
+-.øAÂuÏ®
+¾ÔÃ.\·ÄÍZà¹
+Ã¥I×B±Lî`G&xúäAr4©³n°5¿þÜz"íO½ûóèÎ7+»¯{;ÔmÓ³Õ:/20Q0øãJ¤
+òrheÑä Hn¿ØÎ
+
+F
+GPJa¢K=Ñ
+[âàu"
+ÙÙ>¼ÐzÑ×
+f
+E2AdÔÈÜÃe
+Dí¦=>íÝÜëªd¦
+"L*ç
+D¥a¼,¾¨Ý^:×÷ / I
+-êºwôÙ>B âRÕ62Ç0%S¹~T`°×=Qí\Õv·¡×Ú&>zv¶ÒY157pÉÑÆ8x0*©
+-¼ñówµaZW«LÀ;=ã0Ç¥ÖËQà@ºöouÇVú(ù(¦CÄÜ¡)Sd 0 M´ÞÖÝÓÂÆ)kª¯D¬}Õs©Y.³oY-?XØ´ÕP^y¬Ï²dpo'
+Á®¶`<¨¬L·n£}
+ð³kÔ&¿ÅõÚX¹0e[äÉÒ|Ë.´Ø³ôSµpæº÷óÝnzÞPWÇcåh×Â¤wÏ´æ
+9í	Q@ PS vVé²
+}gßÏz$§íX¬úµô3úZ_÷ðöõ¶9²4èèÄ\ý}»ÉIó
+
+Gm·=
+ÆP+¤û®_ð\
+È©#ÛÈí×ÁTLÁÖSÑßxÆíõÓu1ëEhc£)<²L·«cNK¿
+-ìk[£P_iRA
+Ò2ÊQ 
+xlXPdêä¯ÄþÅk»Ä¤áLñå5ô>%J|rîÎ'~\ÞÙè¬ïSYþªÅ,úÌâ)©HððË8×´Í:¤Ï¾~
+¦­¥(ã³ÌÎ8¤¯c "çAÐzL
+\±¯ÞÁv(I¥ÎÐõeëÝ÷-*4bá:ç
+-ÙÆN*wÈ]ã?Üvk	¼æå$ÁÎiv³¨ÙM[¨èæBª Í_±%ê¥d
+íâ!Àò×Oöò¹L1(câ­Wµð~æÏ=½+i(I¢­ÒÄÑî¡õæ²©kEA21	CX.b3^{
+hb½~¥'© 7µ
+-ñ¶|IõóWº£	Ö.Ó
+m;ÈùCCFÅ
+AP$jª
+b@À1ë3#óÐõ0gÁ±ÒÁ½¬VJ¤_×8Æ8¥ÿD@D¹lÁÆÇv*·Á.`lxIæ¾,ó/=b7\D1ÜÑÄÒOVm×/nÒ¾¥_ÝÂ)ßláBÄt[T#õãÐ
+ï¦
+@û=]Ý¸¾êêí¨á¢ÜRUÚx¼&Í 9µqm_SÿsÖó<·û}Êÿ2¶>=hÝøpý=D#Ù¤)°Ãà2À\0ndTèôÌ§uMí¿}ñ)óhË9¼hw²þ¹hË!¨ÂÿÐÙÊë{ÓS)aFÉD
+¯ë¡üô;O6°	ywûâ
+Ådñn<@+êÛÌ¨¡á×@+vSÄZ
+Æ`·K!C¬ÈË³~N |*ûDQ¢äýQT,Ô5ó¢\ÿá-Æ½,É
+ÈÅwÙS¬\J*¨PPê³\\ê
+
+-åZE*Vfß£õ-Q ¨à?H?Úàå¢(éøÈsqÑ6µäÊÛýbttøÐÀBwÒ
+oã§ó&×Îº
+¿"ä
+#êHéc<ñ"gÀÛ,B
+ÀAïÂ
+->/¡à
+-¯úØëþÅWÇMª9m³u#Ùº
+CÍÆV±ió½¶aòÔI¾Â¡@ß²&	ýÜX2³Ö
+¦©Ê±nX¨%ËÌw}È?ùì¥44:9¤âÔëz2¾±&Ké#ö¸èUe°ût¹¡1ÁóJS\¥ùkP&Ú}ý_GAiÚñ-9aPLë¦
+¼%;!ªt(óK¨ôxêo³U¯d&ÕLEá$
+ayR@À0SïzîÀnè+áY)èÝâ²ÁV:
+«¶ë¿Ãkô«ÚÞÞ·¥9Ó.z¿-ËtN¸N_0Nü!Cëã@Yo¢o¿¼vß
+-qAï×ôÕ0HtV×ûÀ·Âô96;}Uc¼xÒRMð\3ªXwq@Q
+co«gIfüü{SöÿózÁØÒwõÿLýÎ
+-endstream
+-endobj
+-326 0 obj <<
+-/Type /Page
+-/Contents 327 0 R
+-/Resources 325 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 296 0 R
+-/Annots [ 320 0 R ]
+->> endobj
+-312 0 obj <<
+-/Type /XObject
+-/Subtype /Form
+-/FormType 1
+-/PTEX.FileName (./tap_point.pdf)
+-/PTEX.PageNumber 1
+-/PTEX.InfoDict 333 0 R
+-/BBox [0 0 594 402]
+-/Resources <<
+-/ProcSet [ /PDF /Text ]
+-/ExtGState <<
+-/R7 334 0 R
+->>/Font << /R8 335 0 R>>
+->>
+-/Length 8991
+-/Filter /FlateDecode
+->>
+-stream
+-xíK¯$Ir÷÷WäÐI?¶­Éî
+¡
+P)TQ¤$@_öãU3ºäN
+-aéJ»
+
+þ07;vÌ<þåùøßùïoý·óñÇÿõ!éãþñ#Ï´i>jJëYßnAÙ»<Gä±Ç³®ø=÷sø½ÒsÖû÷<F¦÷½ø«ÿ>¯àKPêsÓÀ
+ÔTð+®ß<áAÜ-îQ
+¾Å¿ÿí9K+ýñb²ÿå÷:Ïøøõ£ô9÷£´ÔkÄÜnI]ûYò£ä¾BJãÙùÙÊ³õû÷x 
+?pµÈM\Ïûçyí $7?·ZåÕ¿ÒÜï¿þ|÷zúûñk÷~b«z
+-
+--þZçs®ÕKRÊ3×G¯¡3±Ó%ÇN7~GËzÿüj¼*è«ë·_Á¤W?qõ0Æ3×+ü®1\
+-®1^
+|?
+mØïujÿÛþÚû¶å*û5·½Â|¦}ÏmÏç{n×Ï×Ü^
+-<òWþ}½â5·òGî¹åTÃ\o8¿^3»ÿ|
+-ùzúû)xbµÔ-ßTÂ
+±ùö&sSãOÏ
+Rz~f~çü¬ûþýå£æÝýÄiWõ§û·ßÁ$Ô§æsõ×;ÎïxâÅÝâåéáyH#¿cëî"úÉyLþúíMè áAfüÇCÜZ
+-ÐÐïß_>Lø·ùzþúéÐþVuóëñÀzßõÿ®\
+-®~Â5±X ½p¯¼4¯KóÏ÷ÌgünÏQø
+¿2NÀO{5¨;?WyupÿÖôÀìô,óñê`7¬Àýÿdb×®×OßÏÁ0ò÷8/6l	5 pÀdô÷Û-©#M¯Ñê
+Q/Ü|	f
+ÏÝÔèï
+Ýøñ_#¨øÃÇk¬ZÅ%
+é /?òCÛ{uõ»¶y^j¯ë×ÿ´´X |¶Í
+®Õ~V
+Ê^â¹Øº¿{?j1µCo½Ç+¯ýáS}hú9ä1Ê
+Î-e¿è­¢«
+H0v1ÏË<d×â­Ø×hÏÓ×'æOq×üs­Æê Ouöf¸Ð¯VÐØ÷M«
+-æB7¾Ú0ÿ¼Y¬DÇµYÎï¯ì9^yöæ3Íbd±Ï¯ì3À·ZíáöD<²O4õØWQ×+
+-;^C3ñ²
+Ù'Eg3_ÍÑjågaeÃ*.6?Zí×|¢Yt¶[
+-,F¼H./4¡g
+È|
+-ëgmX-¶Ýæ¸ë4ÕÑCé¡ì5_«õófÑY ÆF~²¶o­âëÜÙ'EgË0Z.¼"áwÕî¦Yt¶ËæßypNµ¦¹g3³Â½Ï«³O4?ÞÚÛäÍ£U
+ã_sèc;ÓüL³WgV3ÆJ
+»°Àßuö©³ÄhËYÑ÷@»,Æ$Pmwg?mÆ'üLaíã_
+-§93ã>36>h¥6cE«]@ã´
+-
+J
+êá/ÜÙ'ýú±Ùò
+
+-´{´®ï­vÍDÜêì3Í~ýñ¦
+3O­>ëÛèkàiºúy£p
+Ý1
+]XnéÂº5!þÀ+Ç£	çÅþN
+>Ó,}æe}k÷D«m
+vyc°¼èhn
+¿V]6÷+KªÔ/Ýúy³·D«e QkÙÕÏ4Ã
+Ãn[Ø§<×Ö+ÖÂÎ³fiê³YáÆß+àbµágmb=ÅyÂ3E(K2&'
+ê/áòic6ÖP .Þ×JçUaJ÷m¤?Óì×+0ó¼ÁÜKQyyÌ@%ªÀ0öÇ
+-þüóK
+µ¸ùùûc²ëõôë§»ö··ô¸a{ò~õ~ù¸p$¯ñ©'ðÅ Î ñw8»ø³ÀvbÛJ(Ìn§÷IU°÷`û>Ð?~üKh)ÐùÏoÿôÛÇ_ÿmìú$l}üö÷Î
+W¶"Ö ¡ay¿}ûø«ò~ûïÿù·¿ùsS9
+-\!BÖ?ÇB{9°ý{%ÿWÛ
+-&
+	ctApqöÃ~Ç3u
+úfÑYé
+;Ä|F0.÷âÎ>Ñ
+ë
+!K4=«K^<ÌdF
+´>/ãþÓVÑUïø-XÜ5k;ÀgàÅMb÷Î¶¦Yt6l1rD6*
+_PáÓÂn\æø3Í¢³ÕQrnÀPh±9T/b¥uðÏ4
+Wîm¡+ 5³ùÛ;#¼hààØ÷ÿ{{YÚâ,ý
+-ý_DjÃÓÖð/4{Å«5y@Ç·èP·ý
+Ç³V¨aä[QÏø[KÑûë~¤¾Ýðîiµ.9ÌTæbÅ¿ÝÚÁH'
+-¿¼(+BÎZmx
+-ü³Æ'LË'ºl±Öà¨
+à§â§%t[ÈCöfÑÙ&~#¼UÛ:×lç:0Ãºõ' ¦Àkqöt/­	5Z@æ¯o7"áß÷ Ó·rF;bGö°Å$øé¸ûO4£³ø+0üZPxBÃ2¯Î~Þì­3¨" ßîÙ÷*ö}g¡ôoUóÒªëO
+Få¦?oôÒú\ -öMDácIa¿"IXý¼JTâ )4w21Hºv+$õÙ$­5Õ
+;»üTA·C&ÆM
+ðJ¤"B'
+ö&I
+
+ú
+ ´[ZÜyUÀAÂÄ
+:®DÏ~LIªóÃ=¦¤À-§I&`t¡_?vLiÇìj26îx{CDÇÁ%pbk¢o¿~¬ÉVikñ)]
+-§aáèue /ïI±¹!Íð'µn¿
+-l[ëòtf
+uÅ
+8õ°&¬'"ÌG/<A÷}Cz¹b¨QWGv k
+ÖÁ£ÅØj,Jcð)ÉNÁ
+IL°b¯Ø´FÇ½cd±
+KöU¨YáGè»Ç;[bú`-¨üîSÝbê&ÚÒK
+
+è^bTK-àà
+--÷E)ib§[@Ñtt]
+Í>Â6Þ
+-+ßÀW¹.«Y%â®o¤Â)r,| Æba'Ö0-fqx¡b¸QÆe¡T4âÆR%iXVÛ®NmÆ½"0r¹e[ÕC9w ¤8Wá
++H"$ìIïc0r(ZY«úÍaÑVÂJÕ&
+Úhëß
+{5	Â
+-)÷ÅÑn¶jÓ@Ý·$³¡
+-äsª
+°-»=%U3Äão¶#;w
+->°'!óÃê$yo"
+-_d:@1Ð¡6Ç¬·cßQòçìX}gÇ& &$ÿ"aþ°^ÅØ
+ÆWóUc¨
+.£ÍùÃÕm+¬VYÈ>§qEã
+ô±®6aYôTìªt!7Ö§X3¯GôShû,!°¥X½ÜµÏ¡9þ«ÊÐ¼ýfòcM7æ2lW?[nÆÖÚHFä5íÒ±ÍcèØËvÉÎÄÊlKØ®só4Z©µÐÒ¸(E%beÓ0Ij3ÎÐõ®eC«¦µü_°C*äKÈá©5å@µ1	a>fð+`ÑyÑð³(¸á§Å
+¥Ù7&««#n,SgÕ2ÏvåàSJ*[`.¤´ä
+.¤
+¡ ?% JÎ¯±÷GÈ*¶G¼
+-(E¬É~ÍÃpìaØ/éó×À<4ìÃI­¢%ê8VÌ÷6/ñòÃÊïKRD²ÇReo¦R¶ ùÄÆ[29µX°âðµp
+:°3\Ã©åoEÇrì
+¼ºøñ9ìØIÝ/]°Âzª*üDRÏSé¸_å)í²Üâ_2W1À¬ë±Ñ~íÐ¥G$äV¹Ìgo¬¤«>¦1¶	Iæl<ý 
+3N¢¦`3Xékäw¶-)#åùfìÎeHW8òN!Lÿeÿ$·Â
+ÌLü¤oÅ"+¢Ñ¬Êâ¼Öø
+1	AbùCRl5j¶$h0$&¸-$Câ8;Ö¢?xS;m'"$}<í
+:à<n¹ul8:ÅÖdRÛZìÍêÆ9Ë-4Ù¶°aÝu:§¢	 Úá­¿¾ì§´´ÍW
+ön®
+ëBOCìSJY äðì^¬ ¼liÆèV=Bå@ãk{¯B¹¡IL"û"vZ¹u[|
+d!5É ¼EK3â0¹%Ë
+&sXåI*ªñd¶2a<°!8Ü¦hT6Ó
+:À
+_2p%v>ÏN&Ç<OêÀæ´EåS8¤
+)È¬É ªÅS¡ÓFäW^Ô*;mgÅ;k-CÛ
+-i2)Fv K2åÆ2AÏp7¡[äõv_'
+ÙÄRÝc
+, 
+7J
+¥­$Fä~äÏ
+-¡Ù
+v?r2µÃ4EC>kÊ)Îô³ËvZÑØâùb÷ãÃØDû)À(Þp?'«cOÂ±
+T·(~ª ëq×Z½0Ð3ÄÇöé<ÃUR¸qÿó ÉÔ»âHN´í
+-V[uYý<E0Qváu4óêíwuÃ0à)§°¤´pg¤Ä\±¸a^
+=³GaËqu°tÑMãD
+?1	"®(ýå'
+-¨äHráAc¥áåÂ+ ´Á
+ø©0ùìUY¿!W'- Y@øxéÛ4
+
+¥åß
+Ì(Íªt{i]}÷$xkh
+óN0Ûsdt=Ë.J8dÈgöS{àpý©iJ5ÕÏM[´éÍù3½µÓFQ¦$ðk´Y×gRTR`1e
+-T ò8"ÃmÎSx¿(
+-®0 [
+ö3@< ËÑÆÁõÎ¬ÐVöjíd3YðL
+o<OÍF"|i¢;é**ñ*wSk¾ôÔEØÆD;NRøMÓ¼Ûþ
+¯ã_U»VÂä]©­ÕÊ$ÛøtüXÕúÐ.DÙ"¸HjyÌK²ï*ïwfäÍ{ËÃ{ÛØ¶.f­l¿"TNÖ+¶:#7áÈÉWH
+`þ\6°gÊÖ¦Gl#Vã
+-g$^[QBÊÞæ:ñb­ßÌÖ+
+%Ø
+-â_
+Ðèh#îðr5X#yZg«e(C«Ãþ«HBje
+-îR«b®¦RZ	}4¯ww9êÂMJQÛf~QTj
+;è·ÂÃîzhÏ0+E¸uL¬JL¿ÂaxÞãL2bå|Ý(@Òt<C§Ò	è+DÚó»ð´¾p)
+¥R³J
+¹ÙOT;_689å
+-Bàêè+ u íÔiiôÜM«^üôá½«£è¥Øóyz
+æ"
+óôDÉºP(; ¯@rR	»¦SYÀuxf¬ ºY×á	-ãç²û©húØÅLW]Tß#¸Öa5
+
+-]#¦§9Þ+~_¬
+-­p']¹cFe8!/
+W÷rèNt¥|¢Ç§¼Û 5Vdnÿèí-TMLï]FÒ`Há}4
+ÕATeVHï
+VqCÝþ±*²éH5Cü4H%ÊuBËYa+×!¯ròµáW}IeX²Ë
+-Ýr:±`yàÀª_±_ü
+-ý·n
+ý&¥¸î¢6[ Þ¾þdoËÂ
+ïm imÐFý]ò§	Ì/ÀùoìCVÜ8×3§1é±n"î%Zÿ:Ï
+-õÿý(º()6ù)Ò¯%iH?
+Gú@zeX$É+ÑÓáns{	ÒpHßpÆkÑns¨Q×Ü
+-N]rkÞf=Áî¸Ê½
+
+²`Ll¬¯Æìä
+-ZílBØ×zQ-a¶w{*º!üAõAiðZ]ÞèòÐ*C>ÓÉwµNÄE¾~^Ý
+ý	h´
+-Ö |0ùõ®õ¤Þb×§;N¢¬
+-	[sHÑw±µjçäÊ:ai¶:{È-Ü¹FÓêrÃg£8S°õd3Ð´ùJ¹!¡lIl û)¬.âØ| Ã.Q¦;àV×ÔídU¬
+-¨PL¡H3ðï9±CÎ´¬e»y`¢KaÝkõPêw$!ÝÇâù¡,sQ`­Ôã;"À·U-b, {¶ñlp0¾¿\6ÌÕÂÜhClp
+JCì#ÙÄß
+-ÒÓ
+-ì"KX(³ªørÜK
+#c­6­©¯ù\ÀÉçþDìhÚpRGH¥.¸QÐ´E fqÝ0©ù¨'KÒcë1¶'S
+-»¡Hý¸ãá¦ëa*p-&
+-U3÷yVö,)|÷
+ÿâ¾Ç,û¨'EDÈXÂt$JìäÉ»g]
+Ð´>=Ëâ8Ì5Üï,®ËÍd1µ0ÀM¨Å¾6~6­
+s9i]`[ö]S]p OZc+Ì¹oéT5CK{(ÀTòõu¨IDª¬öü9uèO¬CAþØ"í$XG";ö&©véy¿!v-¬
+7ÌÛIbÞ¢¾IÖ!ÈÐ×÷]M0<Ùbe,SpYÌ	ø4ð]É
+	±:Z0xÉð"Oûñò(¢LB
+-óÜj~£HÚdE~R¤
+'·O{öPV)É©w»°ýªm8Ä%Lih=iLÈ55éV,`ß8±ö1vqà}«N
+ÀÁñ(XFK:ÎÃÛ¼Yã¨h¦ÎA	IóA,$gÝ¦ 
+-«sÐ'ÞU»Ö sº	±fu|r
+-üú^î
+oõIçM 5WóûFìâïacêò
+Æ¬ÐVÅ_LÈë.O¼Þár^
+ÇGa2T"Ò÷áVI¤UçP-}À§0àÞ
+oXâµ¿ÒLÛ¶N¼¢­j£+ Ûù¦[
+-3vuÁñqªËjRÕ¤BªãR~!×s*fKÿaÈ¥Ç*ûÖæíÂÛLÑí¤ððaåÜ|Ý¯ä/EaÆæ	£+½÷²;	¸l ¹Ic	xvæ2£[²@B}\#@RB2Î[³±pÈõÑ UÏ|äî7µk`¤"Iò®ó1¸*ìÈ
+üÖ¶NTùÈ×øWÙæv/ã[)¹ô"Õ­C¬ï<Ô®=ÎVë
+-ØÛ6¾Òµ
+-gÁá ¼Á>(e 2<ÆUÄXV
+-
+øS'W¤Òc2H+ÙªO×ÖåÜï*&¹Có·]Á2Ä
+-¡Üj70ÿú#RW	Xd#éú
+½»ÔVÃ8:a!È
+yÆ ªÁã!øe±Ñd`C½_6!Å
+§§XhØ/P<þÌéøl³´jï;M.ªó
+M¼máx?xÆWºº³"ÂIÊ4áÀ­é[^Pviñ5ÀðW&\¸"º?ñÒyÜÕk«f¦¢ráÛjóå×m»1^ÎHð= zÓup
+ÍUø7íX-ÙìÌY"IH#$i#Ç%±ÚWãºY°÷rÈÙÅfËÆ8Ðønh*qÜpP±Ü99Ë9§
+ºÃÃn
+-Ä	(FÁ¤&â4Á>eãoX¦øM².»GÂ§i@
+cÜ]D ¸R¯
+-ÈÒ¶eöÈéVc½]A'Þ½»P¤jÙ&_ÔnÂDPY%ÈÕáà3U_O !'øteO*¨x¨°[Â
+-¢Øo-WÏI¤êqÔ1Ñ3!Â]ÙÁ«ì/¦´û)ò.uª!õÁÌ¡vÓ*
+-6T
+Q@·äÕX(IT¯RÇ\ÎÂ
+¢~Ú«^£°çÃÅ9M_Ixt±}ÄCa®B£:·ZÃ¢{*ÞULøÍ¢5ú9ÂxÊR}ë'X]ÁqV¢óÄêÛWUÈ/ëÁò1²OnËè&£1V
+çäËPð·òìûù¶Ó°Ç
+-µ]8¹<pÃ^v~ tgíÚÞÙ½Y\·nsÁc;È¶cµ}Ý)9j
+-]Ù*Êí»;éÄd
+1óÓj4·Uî«Ï
+ö®_È«¤à;n®%Ü_B
+-ªÕið¯ÜlHP¬<AD8NäöÂÆ('[
+
+;ÆP9Ù´ì¯:)MeÑ*ëàT®)×0ÙmXïì°'qÝÁ¯í`ÇI"âÀÐ¸,=©\Û±Â-
+Àøîe¨°Ãm¶r Ê{[)ÃA»U][EP}×¦a© §JÝôé§B/Ð§+ÎKX+=
+g=ÔIHp;îXÝ´Oï@ô­ 	CÃ)'7
+þ¹è#ò7Õ¡ð{ïHÓKº
+\áMyR>ç©
+_§¨SØ0tKüïw^çÏa0DsH²£ÌNóÀ]rïÙ
+T
+%§Ü7zµI":æw÷eÄåðÓg¾o×]dnüyâtóä×÷­æä·²®zeæmB¬ýÍ
+-X
+-ÇO¼Ã
+-"]'ÉF
+ß¾±ëÅÇÚU $OV/{BUätÁd	¾bÁU¦æ"ØNxQÛUÈDùÀ\O¤×eÌ >Ü¸ÆLÅÀJplíé¤­[ÊæN
+-0%¬ûòw!<ä¡6
+TßHjmmúæMóê¤è#9)[Q(Ê[_ÝI6]dW
+Dd
+ÉsÍòI¾$cÄSåôÃ+ÀQßNiæ}9
+-+äÀ,QÀ]'ðé$ýdÀ!Ü¨²YbïY>@92®Ú=*Ö6õfË@¹m gYÁ(ölÝþé®PM,ª
+-F Ü
+I7nIU@ t~­f,¯
+-Âf^
+åY¯JË¾Ûæ*³Ly&1G¸BºëãðgÓ¦UI|ªº^u2[Ûæ6(+ ei®Âà»®FdxeÄò³.2¥(ÒRZê
+ .­:J1uã1sUgÅ
+]K qVdÝL$rÛ×GM¨¤æRÄ.´P¥!FW×äCÝ]^Z}kféJ¢¼oÆbIÓÃf
+-Gàëa
+ÏíyWâ¿Âö
+Ùó;}RÆéUóÙâ{\¿!ÚöH.ú=µX]ùS}/5åÔ|P
+-¬V²ùþ?IyÜ×R^õ9ñdüÄExÖ/Pzîä´æ(Ñ)7$ÉtÌUÿ.a êçhµÊ¡óËn'zåë(ÙKqNº¿÷r/lêwT(Å³ÒZYU*ÔÀÇ·U¨¢óÎw[n¨µ+
+-~ôªob`Hr;ôÅú
+T=¥F\æçèÊJpJKtï²Þ×ÌL7©ã$
+-ÉÌµl
+-®rOf­q
+ ÆÎÑEÞ'ëY ú
+³S+A9hÆf¸>N`*ÓX¢?
+-Õ£¯¡U»­JÙ¿¶DhUUbóEÞÖÓÉ²Y¦PX·¼ýU§W`«±Ü0q__Ï·Iò
+§G¿û]
+-¯U@æ¯¯Á]Ôíõí¶ ì»§ü]ë£'__ßñ`¹
+³··>­
+÷¸1è,ÍåXz.VªËe5.qd}k®=nD;¾¼aîv© j,Ê[1Tcÿ5«~9(x¤a24
+ì4©ãØî  ¬cÊ]*|E=:uÍ7ràôso»½UÏ(]hú:ÑQ¼¦}eéxáóG$` H	.
+-Ìýí c
+JüirõIÉÇÑ+Á
+RP³µð§]ÑUD
+õáNO«sãt
+-uBÍãÁ¸DáÑ
+-L·ªâf	*nëU\þÄêÕJ/<
+¦uH"¬Std<N¾LïjÙ&áY
+éºÜp'>1E²^F÷ëVøÏ¥¦9ÊuÝ±è·[òJ¿Ý>ÜåÜ³
+*BüdÈK¾áb/ÃÓ
+A¤)À
+-uò7>nå+¾È&oiÔMÅ#?_A
+-Ñ,Q iÇY¨ù
+ =xÎCS8,]Ku*®åìÎ¡«T
+-ùaûÚ²²YeK!4³gµ>f
+ÛÌ	/V ¹Ë¨ÙÁâÊ*×%Íî¥XIÖ¨3¬V²®õA¡hg©¾û
+B>Ô¸h6CWÀ ¯Rw ¦ïê0ÊùyH°e
+IRg=¸äàÈfVÁ´¯^\
+HÈnjîc°oùtä:±­õnºVXàþÀS¥Ä©I®ËQßRdÏ§«©á6R&(u)µé
+Þ¹3H	|R¬Ñ¹°µøæU>ìbU
+zvï­Äó`øíÝørKZ1/ßpA&W/Nà
+-ÉE§	´Î».g
+CïV%5PX°uï
+«EûÃ+s¢hÀÙ¼ÎÝº*`üì'ö
+£«uHÏºíªñQ¸
+À×ý+^©:KÎ
+-¦Q·é´
+Ç ]0;Mò&½®¹s7%00R2qîSÝ\tî,ôwn'Ø·$iÎàÜ¼
+>½óv¿~ofüQ£åT ó:´X:µØô
+U½v¿rÀäÀIQÈi¶²>È!Õò¡Y
+¢p7êü°?+]¹{.Î.Ï¿½2{óT¹t_éí$_Út ¢ü"ÏõæiäÄåwÊ¦-%_úáé
+ñÃL^#êFDéÌ¢sFáàºÿ¢à:w
+0L¼|êQV6:öÉæÇssÅà±_Ì|aÏÊÑ¾ºçU:EÁô×\ºÃ©]b¯Ê©PÙZÐÇsIµqC^Òõêæo(à0¸ò -§øáæHývè¶ÆÁjáZ8 3ÏÈábÖ¹S«oË¯¹;9_{kÛÙßmÆòª¦Ìå±Pü~9]1ÊÉ`÷«¿#%w3×jpÂ0©;\«
+-P©Ü/«j5î0§aAbè§é¤U²J6DØNRBh4
+Dº50
+-G¶	áó%*«S7Tw£æöéºæE%óIA3g£v[Õ¿*oèÎeÝãt*R¶ÞDõU÷Å4GóWF³µ(Ü >R@xywéá©#é|d`QTS ¢ïdì}²_"á¨òð|ôqo¥
+`Ìú)`ÔÂ> ËµT`UAå8
+UãÊnPã|N
+¤¨E"£Î
+XWäÙ´tÜþÚ'÷¦o	5±ÙÍkÑÄ ÿM6ÁÖ@%ê
+áÿn	EÄ4 "cÝùÖÉoÿíÿñþøøçÿñÿô¿ùìÉ¿ò} $
+-
+-çÑJ{p67~ár.ã·?|üUâ/ä@a ~éç+ù%ó§_@ø)áþÃ\Nð§|uåo>þ/¬uV(
+-endstream
+-endobj
+-333 0 obj
+-<<
+-/Producer (GPL Ghostscript 8.70)
+-/CreationDate (D:20100707155247+02'00')
+-/ModDate (D:20100707155247+02'00')
+-/Title (tap_point.eps)
+-/Creator (fig2dev Version 3.2 Patchlevel 0-beta3)
+-/Author (eckstein@NBTF01 \(Sigrid Eckstein\))
+->>
+-endobj
+-334 0 obj
+-<<
+-/Type /ExtGState
+-/OPM 1
+->>
+-endobj
+-335 0 obj
+-<<
+-/BaseFont /DDPMMN+Times-Roman
+-/FontDescriptor 336 0 R
+-/Type /Font
+-/FirstChar 32
+-/LastChar 116
+-/Widths [ 250 0 0 0 0 0 0 0 0 0 0 0 0 333 0 0 500 500 500 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 611 0 0 0 0 0 0 0 0 0 0 0 0 444 0 0 0 0 0 500 0 278 0 0 0 0 500 500 500 0 0 0 278]
+-/Encoding /WinAnsiEncoding
+-/Subtype /Type1
+->>
+-endobj
+-336 0 obj
+-<<
+-/Type /FontDescriptor
+-/FontName /DDPMMN+Times-Roman
+-/FontBBox [ 0 -218 593 683]
+-/Flags 32
+-/Ascent 683
+-/CapHeight 662
+-/Descent -218
+-/ItalicAngle 0
+-/StemV 88
+-/MissingWidth 250
+-/XHeight 460
+-/CharSet (/T/a/g/hyphen/i/n/o/one/p/space/t/three/two/zero)
+-/FontFile3 337 0 R
+->>
+-endobj
+-337 0 obj
+-<<
+-/Filter /FlateDecode
+-/Subtype /Type1C
+-/Length 1676
+->>
+-stream
+-xeTkTSW¾×ÜÓÒ6é
+
+-¹·/W[EµL;*
+¢­y(£
+-isIy	y A!B
+ÁPgÊA^B)J¥ÊÔYµö¶²Z;
+N×LÌëºü¤kÍÌùsÖ9gïý}¾ýícaë0
+ÇÃ³j¦$.S«jBçMì8ûä:69
+-{ïÁN~,ÖÂ[Ãy0<¬ýIÁ­>n<.<ñp|äOß%kuæb¥\¡§ÏÎÌ}aãÆMÿ»ÙH¿kþ
+NaJr
+-½!¸12*­NÍhô¯ÒÉAoJù
+-WuZ*1²PXTÅÑ©JR§Óéç_ âã·ÆWét)Ön¢¥F©7ÓRÞ§fäRZ-1!µR_l¦¯Ôü7:]©~×PBÿúe:]H§ÑÜ ÿ¿Ã°V§ÊYqñ[^¢1l¶ËÀ²±×±=Ø[Ø6,{
+b"ìq
+Ç
+	
+aFì
+-þ:Þ¸nOÄ+àñæÂ
+-+
+»ÄßÃßÜl5lfc®àß,¡%Þiöiò¤»±ö=>k
+ÅÕ0³Âvð°"E3q°ÞêÃ %>êðB0P½Iq
+ÓÊ,BN²f"ÏSî3 ¿Jæ¨,{wïUuyfeEVitðE{Ð÷ÞCïßã!7Or¿ßÈ¹'V6 !Þÿ'£È-«ÜãT\ßÈÅrüwvïÆv¶ô&ü
+¬N_ÿ\
+ÄâÔg,-(cøDøÕ2,G¬>6ôÕz¡³^ûajMAf`nEÅ~°"+r¶vÕ
+ m%
+-ö	ÐÃAaè9ôè?¾x@R-¡	G]¶QQeF/î"ûæ?ürf'8^Þ®äÃÃ}âÔoeÃðK<ÔÀæ4ºÜqU¥£²ÊÎdåÿ±ôDE£
+-:aum»\â.
+¶÷åÏÏfÅe§Å»FX»(4ú"Ýo¿ÊFç~Hý=óm¤h
+M¿AZlåN+úª÷')KÀYg¯5`ÎoÝh1.)/Mßfê
+´·uÔ»<./Uãs5@/è
+èéÖdÓ	nóÛãù
+­L6eaLÚ¤äÚäxûì5±'·Å8ÏÂvÿÐà¶Ü%¡ÊYi,/±i+(´gÏSõFë'ArÍÇháT8êéöÜÔÜEo,vwG8¶"Gw&hu¼(]£Îs4Ú
+ÖÍÜ(¤Í³PSf&hôKÉÕÄäÜ¬~u»kbV<Òf Àë'Ü
+y2*§®ØOÃ¶Á¡îËërÃÖ&×Ix5÷wö4Á
+°×Ùi \ÕZ
+9XõcËä;e
+ÿ¥ÞÉNoÓÄJ<h
+ïú°¿Ë¢>-nQø@8 Q
+Ù'ýô~¨ ÁvXø_
+-49¤Ì-Y|+ÑPë¯kªõÁè¯TBqV&Û+RCz·7oz7Â[ !â 2:½^«íÐ÷ôvvôöè;5T`+ûó¼¿ð÷F®UðåWàj%ëmMð
+À6\& v;¹u  p 
+üµk·ÞÙÂ @Ë(gEdr-ÕRmëz ìÂ÷QÓýü+dZ
+-ÜCÃ¹¦\,¹
+-/Âóg®^A ¢õ IãÑS\¤¸ú(¹4Åñ9c$ô¶m!RL!Þ2õë|Àr&ØÜx¾ð{NÕ××µxÏÔ7BÐî³QkXx\_Zi­´UK]Abz×jKáGý[(Mø5Ûù%~Zæ±ZKy
+-2Ë*ßÑÜqz
+-¥ü¸2ú5¼
+ý÷ß/>kx¯@\¤´YRÚQc?|ÁÒÇÛÿpdóöKå2øålL]ûDnÝanE.¡8t5J j¿nÍLÙùVÎä
+-Õ-¯%Ø@VQqÞpsñN×ø45=Þuþ^,Öô:ù%­@té³éÎ]ùvïÜCK\¬ÖYö5ÿbjpO§$ir«¼¸R«µÖÝ%Á¢¸#LmlNÊjô=üýoúÂÃ¿o	_aÿÍd 
+-endstream
+-endobj
+-320 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [418.131 353.68 472.514 365.369]
+-/A << /S /GoTo /D (subsection.1.6) >>
+->> endobj
+-328 0 obj <<
+-/D [326 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-319 0 obj <<
+-/D [326 0 R /XYZ 242.677 456.428 null]
+->> endobj
+-38 0 obj <<
+-/D [326 0 R /XYZ 94.914 271.929 null]
+->> endobj
+-329 0 obj <<
+-/D [326 0 R /XYZ 94.914 202.542 null]
+->> endobj
+-330 0 obj <<
+-/D [326 0 R /XYZ 94.914 167.038 null]
+->> endobj
+-331 0 obj <<
+-/D [326 0 R /XYZ 94.914 145.083 null]
+->> endobj
+-332 0 obj <<
+-/D [326 0 R /XYZ 94.914 109.579 null]
+->> endobj
+-325 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F50 271 0 R /F49 256 0 R /F17 190 0 R /F57 279 0 R /F46 194 0 R >>
+-/XObject << /Im1 312 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-344 0 obj <<
+-/Length 3309      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­ZëÛ¸ÿ¾
+?zX%ê´»KâÐ´Í¶zw´ìU#K$ß^Ú¾¿yP[É¸~Ø
+ÃyqfhsÜø?Þ½~¸{ùÆDã{ÍÃaÈËÒh§¡gÂtóPl~Øðþ§?Ýù:Í}7;ë'^¬]yi
+	vä-°7?ì"ßß~ÓÎU]ÞïÂ0ÜOÜ°Û}{¿
+Òmqo¶è1Û^ÆóÃPvÒ¬}})ªæx5ó©Ì
+ó£o,Æ®/ßØl~Àf^j2Â¤ý./Úzÿÿ/ué=ýAæ,Y%^n
+-}/2
+-ãÙÔÈØÃ=hÿt®öy]ºOÃí
+Ð$Jd1a]?°§
+8kUçCÕ6Ôo«º¢
+Êý ½}ù3­^v¹²ó«}Û`äÅ^Pÿ+KaÂ7òtvC«4µÍèov&ô"¡nM¤DÁöÐµ'iåû¡1y|ÏyßÓ@â~¾°eWå`s/]mw5GNÒ
+@~Ûé==ySä]!o_¾Ó%ëd`·hÜÍ»g}{Å)çGbðÙrâ¶
+-³m?¸M¬
+~Jç¹k]~êÚç>X>
+²=
+p(
+7NÂI¹tÊ=u>å
+-éÏ5 =!Ñh5F÷g¾ìËâÒ­ÓÿÈ--.Lx!1<QûÐÖ5c<ÓCµDç0^©¡1GÉÊN"¶Söj¥mÃÊCK·j
+(
+\ú²ë=5£dc¬ZÌdÛÈóm,d¬Æýùrº
+-1ÿËNÈK"µ4
+î3
+F~nYwKÚ ßà 7t8ßíÔ×C¯°bÕ>n«K{`'>Ê÷Ú<
+-ÌMdÌdJX)÷_¢òÃ7Wx®L'àÏVö½(ô\
+-O[ÃVër÷¹µRLÀzðø²¸NöP3gC¥Ne¤ç®ä¹«à vQ|q±¨VÇ
+ºt£ëÊ^¦Qÿ¬
+OÐÚ`ûOråµëÊCÙÍ7`ö«Ú®\`=à¯»Ð1¢8·c§ó
+(.'T¬Ôa	d5QJLäN~}5²íóS%Æ,¸Ë.ëþ<öÌ wxjÅ{ ³)t«víØ¥ØY}:/VAK{¯þ$
+|¸4Î°¥Ä8ó
+=À®ÄA:ÕÔ|X¬LÆ_
++Ñ%t«lUÉ¤:×¬}£Î¯¹«îx9²¨E¸}K^:äLÙ
+O¾*HUÍy¸­§àKÎgW$Ïù¾¼Ãy2R¦ºnO÷<C¡ò§jÔ²°på ]¹Õ¢ OÂl o;í ¨)uG.ØlÄ lñ¾:!è(h°4lô ³ödNtú^`°ÝYdMz6².JÑfÍñ
+©7@N­J]¼F%­¡U¢åSTâJn
+-LìÅÖ.^äÎ³íc«Á
+-Áb¢«üË¯ÕÈðIÆÎ3ÁéBut>+
+3û=1ó«³ïuÝºo¯.^ÚDQ ñªÉ=
+¡;0N95FãÉ%ÿxÝsÕ³7	,xÛiðA"=BtkÈ
+Ö¸ÇÜÕ|
+=ù
+§ç®rMaÂÌzi:*Âè5V4fçpLøÑü÷Î.¡~[$è3P@Aßº	×#Õ*Ù¼ß`[å&¦ÞK¯
+-ºTéû
+[3õ±ã
+Ý4
+]ê¡_Nå {Ü
+{2§É®r  
+¾Æ¶àÄËÒ
+\JBn»uÆ&"Y«¬¨1» ²¦òx>¬Ò'
+5¿B~ÖG2äó[RCi
+ÚîÄ$!6Ñ*Ó
+­ýÐõ0ê
+wAz¡¹ö
+²"[
+-Ú3¢ð¡>ÊMòc/ ¹72QuÒÅ§E?
+sVhA\.{©t©KÓçêÄ	ÂE¸ÐVcâ¶*´«q1¬·F¹-,ï@ L!A tqõÀ
+-¯zºy¨p®ÀC£ªcI	x¶¢òfø
+Á'âø´@
+-Õ00ì6¯ÜÕkW.±c3^º¨e¿ï*uÈ¼YÙJ¦ÙÇD÷ßO)C¸5^*¹0.,L°eæEA"[¾g«6iw/ðû²) ó¨;ãøó P_Éý]#?)ÛK/ù6é ò¿Wó=Ç
+gÁ R"¡#hO.*>ë6üR	öéû¨iF¯Ý|sùÌí 'à-W>RÁ½9Ð
+iD7F]6Çái¹û¨ÑóÎqÆmå/ûå[¸}wEkNù/ÕÄòÓ
+Rô Õ\äÆ?ÔÂÐyw¯ÿþæýÛ}·æ"äaiê0_¬­y
+ð?¾´Vèùfôm·JZàþxó}ÿ
+ÕlæÉszrø6qÄuÊY
+°Õ)f^,y,å4¦*ÿ
+*VjAVxUÄºô
+H9õ©b±Z.oì8å.
+«¦bÿ¼ø7Âã²pCÚH.ÜÒøk'1³ ÛèêæÐ}ìq¬ù®$£·F
+hÔÿêÛwßï¾v]Áév®ÎfÃ-Ð9ÁFwWJ¸ôºdÌY5>J6c±Æï0½$F=`wûU¼Ô¤3á§ÔÂvÖ¼(
+¯)N?×
+6GT­ï^H`ú[º~
+-w£¹g36.íaª'ö ¦ÄÞh
+EÕÐíøÚºåJWGV
+Ö¹+÷)
+â\1J+ ýëH/Ç0êüê/lwß=Ü}¼#óö7føp
+~º	vÅ&ÙìOw?üäo
+-
+/¶?3êizABSoÞßýUêÜWùzIjx-èlýíÛ¿­É8ÑTzñNó©ýN½ 
+®l¸ø¹þ²
+-'^bFÎ,­&°
+«Q$O
+pÃ.ÕÎREW¦ú!H-MÒS§ 4è+â¿emâÅ¾ýuyÂxÖFào0ú·É
+-XÝ§¸"ßçäi<ÄsyÒ¡{7¾À÷â4þ*Wy~8ªhå8a°}=2î#qV½®
+-?ºº+´D;¯oÌJ±3×=¾Ëâ¾3ftpßvÆ2°$m§]ÊêVNUhþ
+-rs÷â~K¦óâZ×Ïà¾J£eøÔ
+væS4wf/ö¥Ïåj/
+FÖK¡öÖ)ÈÂxc``æý&§ ah­	à"E¼2ÍØ³°§è6ó'É@OC
+ofæH¯TÖ©%^$kLzvÆWiÊ¼,JB½,<¯¢ÀØ#ºébmd|º	®CàU¾S¼gpGâF
+ü&¾X¤µ	¯ØPùNìê1áýôõTV]ÔX
+ë©Ê:fR%8Â¯EZàñYó*\
+ýÈN½*é­[¨¢T¦<¯:#ëÁÛ}&¶ÆiÓ_1ÌÀÿ/ò GàÔ¯ä±^+²[+¢Ìî¤
+êç¥\åzD'd4æªa2Qê9Êõ
+êX<ýaàú¡p9|âÊÐXA7G¬´T\â\dÙ¹úàjé^NõynMÙ,²Ë@^7©{/Ñ7Ú¾+Z.ãñ¬ÚMèë(õ3h"'ªUt³>¸Â7
+-L8Õi°ZU0áÌ¯ÔÁlzñþ½ìadñ±fô|]KÄ/ò àJ[q²í÷Hm¥ï O1¿ÑXuBÐM5"~aåS%º]^TÓ5z/VCÒ£{úìEOb)gÏf
+ÑkáòUäÜ¹Ð;¢*V6úRFNúåI*ÕW´N1y[fÌ°º@SÜ
+Fô#]d
+6tjÅ«ê\ÈX;PÌÊúÖ7ò@éë%}§Ä@®ÊùN=}ºÿSJ¨ZNÝ:n¦*9Íb=W°Ð­×Ô2ÈÈM¹àðK©}äùc6îf-hÙ
+È£tÉ¯M©¾-Òe
+7q^igoLé²Uïb¹¸"Ú}~RÜgZdzýÍÆ2¹¤xZ¢å½Ü[¶,±h°è(]oþ¶Â"Èïú@¢¿ ìðÕòÑ®2j3Y­13YÁÙÛ
+l:U
+-¨
+
+bÔ!O7
+-A!ÒQ#aµÜ¾(+ÉÓÛìÚopEþDýp
+-endstream
+-endobj
+-343 0 obj <<
+-/Type /Page
+-/Contents 344 0 R
+-/Resources 342 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 347 0 R
+-/Annots [ 338 0 R 339 0 R 340 0 R 341 0 R ]
+->> endobj
+-338 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [98.16 386.712 151.67 399.614]
+-/A << /S /GoTo /D (subsection.3.1) >>
+->> endobj
+-339 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [248.16 333.122 302.274 344.811]
+-/A << /S /GoTo /D (subsection.1.8) >>
+->> endobj
+-340 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [341.865 117.929 387.734 129.618]
+-/A << /S /GoTo /D (section.4) >>
+->> endobj
+-341 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [411.069 117.929 456.938 129.618]
+-/A << /S /GoTo /D (section.5) >>
+->> endobj
+-345 0 obj <<
+-/D [343 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-346 0 obj <<
+-/D [343 0 R /XYZ 94.914 658.232 null]
+->> endobj
+-42 0 obj <<
+-/D [343 0 R /XYZ 94.914 551.888 null]
+->> endobj
+-342 0 obj <<
+-/Font << /F15 193 0 R /F49 256 0 R /F17 190 0 R /F51 272 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-350 0 obj <<
+-/Length 3561      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÍZ[sÛ¸~÷¯Ð#Ý¹Ä$Úng]g7N
+ïÎ´Ù<Ð-³D
+¤â¤¿¾çðÊrbg»/6 À¹~ç Ñl9f?
+=»<úî¹03
+6²bvy=³:´BÏâT
+B¥³ËÅìM ôñÛË|÷\§ýiÊT
+#ODEÁË_~~vzñâåOÇ'J©àòï§ØÐÁåqª§¯N_s÷éËyÂç///e}þÕ³_??½ÀÕ"·çñOÜ>N	ÓØðnÍ|µ[ä5PÒ Ã6ØVù6«²¦¬>ñøuYÝâÒYµà5uó|ÛþÎãÍMÎ#ó*Ï¢ÜðpyÍ£îg¯áSeñ"6ø-zÇ'ZÅÁ
+÷E¹.&_<Ðô=
+w"Th´åCdÕr·Î7¸¥`Dÿä:
+-Sz¼ó[§C
+Iíg-òël·jjæsS2£'Ü¯K7~5üËÆðÉÒöd8áVÄ%üºÉæÇpøwÜås»¨Ü2ßä |ÒO
+È,plðy
+ë Î¦Ø,±c`GÇ"È¹]nQÙ§Ì |W<Ð²-f0VÂsÄmsk"
+-Uøy ì	b ¯Ô´FÐTÙH
+^
+½?Â5¢©*V³XèPÙx6_½yÍð#
+ÒÙ-M]ÏT($·½>ú'ÛçpA¤¡Th	ëXVÂ!Ôäbào·½9$@ÜÚ&¬·ÈÑ
+0$
+v<\³h¹f0w3¢PFz¨®$Ýÿ^ªäUvJÐV
+Ô5V\¹.i!ÌºêæÈà¶B
+Ùp'ÿÒô½âÚQ½ñ2¶:×ÍªÊo§ýèj
+Ê+h
+
+]¼ZÍÝMÙðÇ%~ùl	f
+Cý[0_c%¯[¹g°æöjÃH¥÷Ð»$±Fc4{
+¶, &klPà¾ê6Ì&ÂhäfÕ®ï
+ÛhÇ<£²1zÀ<£Úå;qÀ`Ég,ÝtºãÍNâT5
+jK¹Y97BâTº5ql¯òÍúô;yYøIò1 á%ì
+MþqçzÒþ¥ñÌ}s~v,~½|
+æõNÉ#ÂXJÿM¾Ê½kçÅdqjnìéuÖ$m>"ØU>ßqüÀqúà>A¸M|`
+çá:ã7(Ê(!vÑdþ¶¯ûÐõNgÜ"¬æNëyL
+a
+(¶ÛôÜw{¤3'±*Ê°.×¸vÏ}ì)Ç|0þ)É0¾\QNI/+þ»æ&
+¬R(	¸AÞÃ,cðÔÂ xvw8Ð±
+#°£A±ù p N9T Z¦
+îÚ£2öq,hËÂ³fåØ%Cá¸«cWÍÛbµâÖ×IìÔó©0²À¡6ýÔÒYh9!3êæHxã§gÓ¬4[«JO<?ûa"ø¢÷1z
+-©
+|cj0p#Á TÑºl"Û¥mªGZZGè
+FKÿøâbî¡.ô Ä?çÒ·)ù®ªz 	ä
+tãIeÊê
+ã2ÜÀä*
+-J,>T	±øãn³ @aÓM¶F]Áß T¬Q¼ø£ß
+3&Áº©`iÁ§q$ÉÁkÀo:gèq_
+-0UK´Tââýù«Ó§(üËç/_Ol 
+p 
+g}
+N*RÃõ_>ýyÒ[*Fq+þ'S
+<Ñ2
+-­
+-wÐ%
+40s{È9¬$Ç©yÝ³óîb£°&¨ñ8ëÛø7Xÿ|4¡6ú
+Êøï1ö/!H!öÿ+9 ³_N'§aï÷+4(pA÷c
+-uydÅt*vÈ#@V°Ôcl_cp¶#Þ±óÆÚÄ¿ÎÎ/¦ØØ0y
+áéX
+-õüë¥í>
+oÖUìCª=°\í&ÏÈýâ`Õ¹÷¡·Ðê¯Ù¢\Í¿[|Xm³j]7AGqx³­Cþ%|°ÞmAè½¿ôg,.»Ãô½î>BXà
+-5ÙrOê
+ÖtxÎA(ÄÐñµðór2y£æd'@Y"N$é%úP¢2	ÑJ|RÃ4¬Ã=[£è¦»FÙRþ¹ºðäÆ mu/Äc:MMu«9.6ì1J
+Î ï¨ 9rµÁ¶*¯ È 5þxAàª\iCz«+\Ó)
+ã6e^VÙ¢È7Í¤YæÚ»}:VÕZZÿÉæåUmöÐ2I|Vk'×TKp%GJµØcùqWv:L¶Ê?@Úï`²Ãû^ÖÐ¤#_`m(]u¹%ç¥(Köi\¦YÕ
+-w²
+-æY8±¡åÑg
+-*
+Åö
+-Ò´_»Â9èÒÔéF6¦òcÃ·7Å
+·sãfÝäEÅÍÊSjÈÆ9"¯É"ç(ãëí®É|ýX¸~Ç­R)K[Å~[ÏÂÛ]Å¸ËÁÒR©U ¤Lrl(ô!Ç"Th í
+-ÜÛÃKB´wÝíx°éóIrúxEÁåÖ-m¥bâ]¿Ï«ë0V­eÔÚ¶{.nºÔÕ(5
+îi&ä¹«ð±M¿BPÌ¯¹ª`ÀB^UE¹«yàz·»*ÌZ®d«
+©
+û0-µ»ªó÷;ÇÕ'
+ík[­GÓ´6:ºx^ðnZ]ewÎÝ0Ñ-Ê6n×éu°.«ü³*Ú
+x[æé¹ïçèc)Á'dëí*ÇÒÄÓ¹Ø_ÖHRúÕ`âmQßPuUº
+-/ü=ïV$ì^{¢
+-
+sK
+ bôºä»8Ý±Èå 
+ûZ
+ºÃK®8#ÒYz9¬®4~Ð!½ÄA,ÕéÍÂüyjEÐ}ÝúÖS¤â¾u¸Ò³T
+
+Ò,5öËN ÷@Þ÷ê
+O0AæDEO¨50gx=#úô
+m[ (ið=þK5*Oæ>¼Ý×Ûÿ×S«RºêÑï)
+:þX'ÛOý{hÑ7³	Ñ
+È,÷IÆt' «ª)"S
+-ð:*Ghjt¤Ñõ¶T{¹Ðc|éaEY×ÅÝ§ Ô)7[AÝ&`¢á®¼ðR
+fåÜä¼B5þÞ¸äÎç2=7¼¢tcßt»­UðªâÛ³¢­ý|tV'`\i¨ ½ëÍÚçSU?
+îSqÁÁzÒ =¾
+-íÅcÊmÊé9Þ¹:s¨%äÜËæ½ÈN¿2ûñÆVøè
+-ãu¨áïuZêÉúgHfy¬\sß×_q
+EÍOÁ´
+ÙCú- 	T ØtòÀ4D¨Ag8÷hT%jF§ 5ì©Kn÷!MPÑ*ê÷x-&ÁÿöÔ²´U|²é¬tdw¡Ç·pÂ§Ëb³¡r;ùÃvR×NsoÞÜ¨ï
+¢èà5ÂRWZàûà½TqX[	éôOà½ó
+ÌÛàQ0{2DaÀÐº´ú÷u¼
+Lm+
+-.Ç<à{Eûä[ FA |ÊÁEabÕA¶Æ|¶Êÿ[ÉìLþ"½%Îè_ ó¯ àÅ
+Ê°@Ç½èå
+þ©Å{
+±Äâ©z¯PFHZÿQ±
+çÊ?È0ê®ÁKò>Õ9,²êxXO0.Ûn«rÜ+
+WõX>0Ý3~²Òp"ÁÉqag
+Yv!å{Î
+Ë¯«)òx'ÄËÓ2#²2tS|F`´Ý SÂ0ËÙJ{ðSHÇ
+ãËcÜB¸!Æ^a~TåbÞ´¾nJÒÉ¥|A÷»¢¢·@¥©§N @·I\èi¯m<¬Ã9Zt
+vÅhôðÄ
+
+-²~2*]¬³ÞÛ9Õ{õlíJÅD¦ÿV´{3:~@TB$(³Üe±ð=>j²¦F³ÙmêbIÏè¡ãMIåÛÆO_>ñ'jþÄ;ÜNCõ¤ý°ýpñAàÛÖ
+-qi(vÃ-lÀqÛÞyÉ7ügµkæ«Þó;è÷
+\ÐQpÉÎÓvEa^âî7Ò÷Ô÷°!Ú²Hv×j°Â¶ïñP½äÐ´^7ªtû5°î
+) ª¥Ý±Hþ]ïÆ¹ìºýxú
+Y?½SThÓm!
+ßÁ°ÂqPDªOþMôvÒ£~9ãÏøHÛÆÝ=P{)ø';®Fè+S·3µ×ö?²Hª¸URñtp
+Ó±(©í"ò/ËãaìéÎ=NiÅàjú¤
+9ËAxvÌßYY¥Éyu¯¯§x	z-ÙñÈ|K
+AJn¬ßrä×0i},ÖÙÊ½
+¼óíW]£³(Ç«"»Zåõw,¼©í«¯Ù~]ü7
+-Õ§òn¹§Ý#w
+ÔÞb
+-½`&·¾Q49»1F|ñõ×
+±{«Içqæ£dNx|¾jíjÄ¼XÞr·[þ,Þ^
+ý]IÀ
+-endstream
+-endobj
+-349 0 obj <<
+-/Type /Page
+-/Contents 350 0 R
+-/Resources 348 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 347 0 R
+->> endobj
+-351 0 obj <<
+-/D [349 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-46 0 obj <<
+-/D [349 0 R /XYZ 94.914 257.1 null]
+->> endobj
+-348 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F49 256 0 R /F20 270 0 R /F18 191 0 R /F23 294 0 R /F17 190 0 R /F57 279 0 R /F46 194 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-354 0 obj <<
+-/Length 3027      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ¥ZYsä¶~×¯ÇQe
+ WªØñ&vùHÊr
+²ÞhÈaÌ!e
+«}ú x¨c
+-Ð F£¯ãFnþvõåÍÕÛw&Ý()2©ÍÍa)³S-N77ùæý6ÑõNI)·_
+-]ßËßËúx½ÓZoÿò×¿Û}uýáæÛ·ï/d"%d¢`ZCYt%ýÎoßY5½ÓF	¥ØiøÑ¾ê¾{o?¬n ±&¬ÿÅõ.2Q¶íOrf¶}Ó»¬¯£t;ñï-LK·EËÍç6w@Nìú²©;&¶Å¾ió"Ã_ðëwß)-¬ÉìÆ «Um<ãVÉ,Þ6À®ç¥$.û¢­mÃµÚ6í¸b»%N¡÷§äãêmïîøhwF¾,0¦7»(Iêåy³M
+o?^[»uÕPtk³Hex=»OUù±X;ÎRã¡þ´¶Êg\Ê
+(Z¿ÏXL×éê|m58L
+GaÒÇ®+_gL8ù|ÆôËå\Ñ¹¬½ û Ñ¾8ó4­k¶ÒºcÁ%R¸
+Æ´ÅoCÙç/5Ï$Û|hÙÀ ½wUåÉ}ãéÎ¡Ñ '~¸<ßU¼L¿'ö
+7qmÎñÅzÅÇk²ÎÎ
+-
+)÷J%Ì¿»NÁP}Óxëøg_´½+kîäÅ±-UáK%4¸Q¨GéÅmK¡ìxÛ¿ÈÈ®]ÈÆ¥äØ;
+~ M¶
+HÐy&ÃñØ@ §ÙK)ÁÈ(î²Ò:MõEMâGÜ¹¶çæ¡mÎÁ
+-Piºw6Ù,wo_¤ÒÀ
+w]íÛÖá~Ü%á÷iåªhQböBhVd:
+þ `5µv*þgW õªÃ _h/ýq7Ãmµj¢q"âÉ ýKfð¼EB7jõ8æò¼DèÉ©
+X·¢
+(I^úÖËÃõð
+
+|ÑcC9Ù8zHîv½ÛãmÿÊ]¸5ÑÃà×ÜÓ
+boÎÔk¤:ú_Iu;f,µ-ø
+ìL®8¿<<>ê}Ùêq"Íª·À`£GÜðáäâp Òï?¯j
+9ºgéC°"LfÆò÷4!¼Ù`¬!Î
+-³ài'Ý~FT`2
+'
+/`¦F1a×­ÈXH>­åZ4µ
+åz$JÒdÒe×¯-µf,ÙÃ\.§Âå& G
+(g¤`ùñ¸È]ÞTû·C×û:wâ´~_Ré´ãu¥âò¶`hP©Êõ=ñJ÷ujÊ½;¹
+qÇý>|â%u.B#M{ùÍÒîÆ6Î£=ºÈnïO%ó¶bêY(ëµ ç½É~´¶ÛB4ª¢>¢ùÐàHë:ÖÜVÆyóåÏï~úæß_¯1Ààé®oÙ¾ð;qè
+·¶#ïËÎ³{ß þ;
++Æ`²óÝ%báxA0M²¥XÄõ´ÔCHÀ /î`h=¾Ã:&~ÕAÁÆjn¸úÌII×M*ØºOë:ÅÂôÿTöñØ¬õ\ì%Ë9Bßß:Ò±_12%
+©m Ð¢ìi¼Ñ¥rÄs?ðßÒ£½nÁ]'êu>e6qaªÖëE¹»)Ýp;39¦j=FÒJÚ9âÐ,a]æ	ÀÂÊc&YçCYT97­ËËZÊ
+d
+-.ÿOS,¹Ùñk6uõÀ-ò£ðÛf®Ý
+ä}¥G¸Ò~?´nÿXwßPHäbç Ó"02ÎÓ
+-îÀ"Å]ï0FÐLt'QÈÞ°±à	
+-=¿e£ÀXWÌç´
+-Nº÷¿¦ãoÝ¾¹-CòF®gV³C¶
+-ò©5/èªýPù
+4J8k Æü Ì«í}Ïô|jq×	Dvû§ÃÄ
+Çö
+¿A­°^^ê
+-fø»%dÄgÜö1°Ð¿+%AJ§X³r4ÞÖXI HgßëI¸FdÜÄOÀ¾ÌÉS?
+-¢L¤*3\÷$PsOGôÉgGGyXÝ×X×ø
+)¤¾ÜØoàE/3Úz&yIò"`îLdQ´
+
+¸1ÂòÉ¯ñ^Ó¯ÉtyM´§c
+-^
+-Xó_-:NBÇÁ.	ÞÌ<
+´Î<òVò7åK3-ïm8Y(>qÔÕÁ
+zKe¯Ý)*~:GIz_ÞU%áRxrÂi%³0L^)R Ù ¥¥CéLheç5>¦»¬ñ%öÄ²`í×øÒ±SÁìÐc°PÖ©
+#wè¾ .óðM8¶ÃUbÛ9VëAÚdÂ×cB
+-ð®ï^.÷QÉbË{N¾
+:®ê>;Ï¡©ªm¶>
+-O""}
+-É
+-Ýhà[
+- ³NÇ8¼Í/?áà¤ÓpÃéòõsÀÜ¹åg  Så7
+_zæN¥ç
+-î¯q`åV_bFD½e;ùX¶M
+jSâÙJ°¤pF¼Ð
+èr
+ »tºÌµTPÄñ¨
+ß=³¸-Ç¯_ë_ÏAZ)¬VS­w~ÜÍûX
+"\U_
+IÇ²h*1vÜgËôt pF«ÆH¸
+¬!ùúS&$
+ôÏ[7Tý×;©mlÁöA»­±1ÜÆrûÍá"Á¨0398¯£ou3
+Oþ»ÆÏÛïsp¿®÷33rÃncîöf-V³`e_¤ùÿayôÝ|Q®Ðñ
+7UêØÇ q¨)K[-ÞH¦ã­õ úÈ´®¾¾¹úí
+-ér£ ÆBGÙ&²ZÐ½ýùêý¹Éa8Wnîiêy£ hU®þÉO-Ë
+µÌÀH#Z+Jý1ñªuqªh'eSAÇ¤¡ CG§~Õhº²/9hzµÇ!Ä/Lo2Å Ös#T,kfEW¶^qYXÃ÷åÌ
+o¨¸àl¢ôÖß ÁMdc6Ô
+.
+ç
+õÞãÿÕL)>û!Ôª
+¡:ººÑS<oIÿµ9<=dÂÿhË³kKLð£{Ô¶ósC1p¤3Åû®ãKìÏínÖT'
+-
+cC
+-ýL¢dÂ
+0×5Þ§1DøGg
+jþi@b1C]{°
+-/$vH?MFåëGJ2ghä#È$û/J«£qö&Ò?º¥üèÆ,D×.ôãTÞúúv_¿x?¸Nÿpáyí
+»£`9½|>!¶AxO%ÕKRÄS±ü	¿OFã{¹}$äA»&ïo8Áñàý±Mz=,ëÌ1GØÞè¸ï
+_UãÇ¹²E
+¶ðk2[ÿ2^c
+ÇÿI?üüýªõüÉá)Î_MQnÇð: 
+x|vÀÒ_û*<Áô )¯gå¢£WÃo! p«&o!² >ÈmëjÒ~£üS
+Nj©s4B
+Ø¿~¯FE?]ÓK|é£§ÒwG·Ê%
+Þü
+Búj1c
+-Î=S_·BNÕÃ&çÃÏg2Ü-wºînÌí¼Ã
+Wæ´×E3tä
+-,T£Ã³ryëkCÛª¥Ðü¬òhí2hlôT°#f²*)øiñ©Ç\Ø»1wïO
+
+%0?áÐÎMhQ]#ÏC
+-¨6K¤\ÏM .õÐÑê??è
+Ò.?°}þ-3äésïÉõè°!FÔáß /zsaÍ/¾)ÂÚ×+ïT%a5éúk{X
+F5heùá¯Ug 1ª335À´¼©W_eãHÈ,ÞYF;¿ Gÿ
+@Y
+-endstream
+-endobj
+-353 0 obj <<
+-/Type /Page
+-/Contents 354 0 R
+-/Resources 352 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 347 0 R
+->> endobj
+-355 0 obj <<
+-/D [353 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-50 0 obj <<
+-/D [353 0 R /XYZ 94.914 387.668 null]
+->> endobj
+-352 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F23 294 0 R /F20 270 0 R /F49 256 0 R /F17 190 0 R /F46 194 0 R /F18 191 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-358 0 obj <<
+-/Length 3147      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ½ZKwÛ6ÞûWèÌ>§b	öY$©ÝñÔéÄÎtÑvÁÍILI*©ç×ÏwqA)ÉS{º@ pßß½`4»E³ïÏÞÜ½ºf&¢0R1»]ÎR
+¦BÏb«B¡ìì6ý
+øü×Û¿¿ºÔv8Ó&¡´
+-ë¸9ò|.¢(
+-®?þðæâÃÕõ÷çs¥Tpû·
+jèàöÜêàõ7üøúú;ðöýõísi÷ïÞ=~ëÍÇËË´ûYäÏÜý¿º4bx¹?Ï\ÐÆOU_ê"[ññÇª(úÓ;ÚböóÜÛûâ|.qï¾*þ¹Zò{_6Üú%¦ÊÚrs7ÿ
+Tå^jýDj?ð_£­³¼ðogÅ¶Îüôµlï¹Õ´UÝùç"¨jn¬sEÝøÁæ+íP"d6abÙ\¨ÐèIü%2Q^,³íªýù1æÖaö
+É«í§U1Å7VØn
+Váù\8øé¾\ÑqL,·8ìfÑÕ¦ál£¡Sð¬(knæE]~97q Æ1=
+-duá+GWF~°àWVÛ¬-r^¼¤Ý¸¹;÷lèÐÁ\ðúð¹.ecÑläÛ"£v
+,«7«s
+$&§ß #Á
+DV,×ç0Yx»]µïËÿ5>Æ¾8Ù, Ì;>L­>µY¹)üNðtòh,¹ôPéxxzzÌ¶¨×ü>=rZÆíþ±êMÈ]Ø(uÜ	ôÅn"IÝJ6ÚhU4
+-·²|A X $êL64uÚ§
+B
+62ÝÄ¿N/Jî4ÔæÔZseu(¥
+³{Sdõê
+Ñ}¶bé5ì­CÓ¤^"´ #½/ëbí:
+ ù¦©Îz­·^zg½áÈ=rqàLàâ¤
+£¤·k¡7ä	j©O»8:)l´Å
+i±;pÖfÜÚs^Ôµm
+9?õzöå¹
+¬áÝ6Ü±ÈV«LÒ=un
+ò¾þ[ï/N°ÀÅ,ðñiyØ[A]OãÁÎ³XädàÉ©ï[rö§²ÄÓ8bI¹Yº.nÏ~;#»fôR
+-­gzéÙb}öó¯Ñ,Ç|N¨R;ûêf®gÊéY4[ÍnÎþÁ0aÏÆÐÖ"ÁRqhµð³]Oêa¦§Ô©6`suW°+¥§Î#>Ú=2¡²½$Vê$LùÄJÄ8©ÍØ
+`*<PìÂcS´
+a¤eÔøE(íí¿-¡
+-¡î4hVëÛÿ(ÃTöË^mÿt±jÚE
+-Dè.RÁÝÊ£üÓFº@ÿüÓ&©¹¯,¯¦7NUó"§qZûW-C¨Ô §#Ñx£_àÿ\+á°Ù¶Ç;ÔãþYì*Gp°p»É³º,ü,²tô ºòj
+-HàÇOa66©8.G
+-·$sÌ}?µÆn-
+·z	<©ìN
+
+A"<bLT
+¼ßx&ÃTµ¯...È Ò`1x Òi¸Çq9ô`JmK1Ø¡:Lø\Wñùvñèå¦ÍHùgÁÐ$éÀà&=
+¢!é(rKoªÍü Ï­qË(æIÙÆÁÔà 
+®p@!ÕA}
+
+¡÷©äÿ5bÍ¤ÅHêPèyÑÏà 0íµ¨Ö
+²¥J®j¸×E6¥½
+¼®<? -Iù1BäÊg9Èù3%VJoUÔÃI5-mH1¢1/N¨ÀïêNP ð{ááÇÞ·'ßîÎÍ¾
+.ã¾Äcw4k
+	²Ýå´é2ç^RÄ¡âh0¿)i
+-íÎ ¦c¤"ÉËuÈ1M<z<Èhw>w®µ¢Îi
+]jCc÷PÜÀ¤ñLKÆ6~¦èàGâÔ­¥mr©ô)8L!æSÀX½:L7´±xre
+
+0±1¹âyäti
+Ä2ÑXghâ
+ò=êCx.\BÕyÞúuWª0¾Tá?ÍßùÂ	î WN ú¼Úuu=-}Î¡Ì6ÉQvT	ÞÂéÀªäyÚð!Ù :vÛ¦­`á/²¯ÔÀ	2Ú÷°U¬°
+-I}ºÑ¨Édê* p¶
+BjôÏ
+GH:»
+=R£fN¹5-¹írfOÞÌO!23 a h%UkC%[KY{Ê5&Z
+@Òvçç:
+äQ:õxÆÇxMé·êñõú°Ê#{@ºü[
+ÔæÌ]"ìU6b¸8Ôª¯h^g×ÜD`
+ÓDÿ;GO®èêq
+=ãàkbsCÿõdüÂAÄ¦XTÜûnd®ùtjÆ<6+<h³Þ 
+pc%v³Â[è±L;¦%
+¦¡cPvÏ
+¦¡5iv¦)¸vkÔI2ae ôBã|"¶Ëz
+ÛÔ ¶
+-Êy,
+*ÃãlbXÑ+fû¸Ðxöj×¾4Dè w.(ÆÄòEà­c­?éM 1Ç[/B m5&êÿ
+-õDS[3Æz¯¿{ÿîí¥Hb	UÏ£T!
+FÒ­e¬æ}/~¼9öÌ®ª?)>_ôYMÑ´}
+ÚÝ0¨.}t]ÎbÁTür,ê½|(£1g
+Uwf¿à]®ºê|GÓ[ÇÜ7.=A Ä©½"ðk¢æöÃÕ÷2@$H=eªÝÿ³d £±'­e¢ØËàÃå$Éñ;Æ7T$êbíó
+e@ÞÑgÿÔFj½.ú24¦7åÃ/ìÞûIUÏÿ¢^UYî\UÏòóäãjÐkº÷£
+
+ÞÃ;
+-
+-oÃrwí£1,ÝÄzu<zZ½"¶O7yçz=yhuÝ©a7ÝÏ®»*çÓ£w°½È =#×ëµç»«×Dà¤ò HcRÌ~&ûIS
+µà?ºß¼ôTÒ
+·_wßª`8eî
+_µ»ÂA¯¿ ¹{ú{ª¶íçmË3ÜØü­¿`,³»M¿°ðïïq>&hwº ÛÅ8æbÿU
+é¼)ü}¨±ËKxSZKzíýxs1±©1a¬äËl
+-Ñ§ä¾}ýîÝû·SJ@yP|*¯ g¨´G¾´Æî¤~à6\¸7[uÖ
+-ð9?°¢P«»·¢6kB8
+ávW
+?ì¶8p§uï¿oéöÊ¾{`þS¡öj©
+Ê%÷ð'Ôb¤Uþ&
+-=ÝÈÀÓ7ÞH£E¨ócGÁá?KæJëÐ¢I+%8¢iÀ÷Poñ{ÛT÷<¢h&T»ÚhÇÈ!æM÷¼Ç.K
+`ÂÍ
+î~
+4Ì¢Ðî§ftw£Ó¨ÛM¹)[dóåº0àu
+QßKY$ ¸ä5åÈ­w`	)â&øéªäõÆ×u®ÆÍöîÐ-t°sDãjMy¢´?
+.ÅÃÃo#
+æ£¸#Ü`$]$§?ÒH ð¸¿LÉÜw§¡Ø}Gqï
+b]}û'Ü
+
+#	aMÓÖ[ú<å®ÆáC3F×Eí[y±Xeµw!´Ã
+-@ïÝt
+`u¸«À
+94(ÞÝ²õS×Nw
+6ÆH¿{ý3Aý»Ëº0´ýÌ½D
+baÝùÔÛ
+-OiËuì>VÝ
+?½Ö¸PiÍ}µ]åÜ
+x øÌÖÛ änçÚî¦_hË÷ûîîþu$÷gÀ7.çÇ»ÿç­~ÔMV÷{Ï(;÷
+yA/´÷î#neÿÕ
+-båîs÷é
+-Oö«8I5-÷ú¯¦ì>Ú;û"cì'=B¤ª?\
+-¥O°X0Ã¸«³5Oð?×?ÌÀKKª Ê6üYÀ®üR³å:
+-?¹õè¢µ/´¸ÔþDjQ[º²sD{8ëxÔeÛt^ rÃo¿á%öa4òÁ`±ËÊMG~l;1­P®×¥Oh­,çq.ÅýÜËFäHe§>xD¤ø/Â¸*f
+-endstream
+-endobj
+-357 0 obj <<
+-/Type /Page
+-/Contents 358 0 R
+-/Resources 356 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 347 0 R
+->> endobj
+-359 0 obj <<
+-/D [357 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-54 0 obj <<
+-/D [357 0 R /XYZ 94.914 178.972 null]
+->> endobj
+-356 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F17 190 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-363 0 obj <<
+-/Length 3487      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚZÉä¶½ÏWô
+¢
+[ØáY
+òAsPGè`ùa¡«èae.êé¿WnàRÃ{úRÄD"JîNwÉÝ?ßýýáÝ·?ÚâN%qêîáñ®´q©ì]VXâîáx÷ïHÇæþ $~½/Läú¶nïUtîÆØÈµG,èétòÃXwíÀ
+-]ÏC~º\ûî^Ñïøãeü¿%*«jßVÏ÷ÿyø×·?ªtMÕ*Nr*ÇAï¡ýîú&,åQc}ñ°zGu[õÞ
+-
+iI
+-¡Ú«îru½k¦¥yææáâþ~fk&GÝ#·gYó±ñ®
+aÇvC¿º2ÑÇûÎ#_¹ið7ó\5N®ÁcÀÊÄ©-l$j
+òyD5±PQGãG&ÚÝ¥nÝÈ,T°AºxÓc?UËjtè!IÔ¸þäé©Z3Ý<¶6
+LwÇn£î])â,[ö½#Zøþ`­
+Î4
+n'Ïb¥4Wn	X·g|Î<
+~¯:4
+7V vQ¢æ± §ææãsë.uÅc¹GÝ9V*ÎÌkNÆÉ|(Yrf2ì=
+-u{*Pøþo¸³»ÂÝLt´í¡lgy
+ÖoýÓ
+
+-ZÇ¡z#­²±MìVpUZEGP<V±gn êP@µ&Q]w	JàºËy¯£GYÛ¥)s=£;N¢Ñ
+^ÁÙ<WüJµ©¡
+ºo¦·î
+^PëFé/*
+(SFÿõÕ8ð|×X)cc­o¸?ó"vÉnx³2?u+ö«ÆCÝ
+rÛC±F±bn8&Å´¯Êâîæ Ê8~Ð®¿}ëÙôl\»Çì,Kk^§Z6×a ±
+=ú
+-ÔÖÉÎñöYÝ;ÙMÒË/Ò¹+%Èµ_MúÔ
+-tÇ°­ãjÛ]bRºØÞ1²·%ìvìý0Ð¹lôtÛ:ÏÜùD|Å®$zªÒûGâ5Ip¿5
+-0Ù¼D1°éîS°øÃVwï¨Ü±ZË¼ÉÈ®Ñ>°²³
+-F·ØaÁðÈÿù¿ÀØ«ÈWÄÑÒu;îêbçå=¢®ÙÖ0e7©ny¢AlL±|öîH<2®®æ¬ö*ÀæÀî²×_A0êÛièÁ
+^øü·=úTbâ¤(×Kmô]\.ïÉeÚäÐÕtZÆÊG½kO2}YbãÆú4u,1ß*ò8ýÂd"@¢RÐíïpbfa"H¨$häëð÷'tCîÂ
+þ³¯&¹vè^+Fv% ®á{.]ïÃÒ¸ÌÏRpoY
+¥&Ö¬: ð}öÔd
+êyµ¢[
+-ZP¾^Ð¤/.Ü 
+ÑK³A¶~ÃÞÎE§Ù,IS#ÌÎdû]*ÀlfÅÆõ"ú Gî 2ÕÈIâËûÏ£ï ÀâÈfë#))
+Öh«Ë­àÈ1 ìq6íÆ¾üÎdeEwm^¬ß4	L²å3OûËg¹æ[~Àò&ý³åAE]8îv<U1Ç÷xÚdm»qú|Hjë]ß<s¸j§ÃÆUÐç%A®Ä$±)òí, £Ðàþ7ÁuÈîíjzQF¿tÁªb§Ii!´8Ù
+©Üä?WÞðz±PvU.«f {ØáÒ»Ô5å_6wnÏögJ¡ñö6@UeA©
+*Åì(±çU¹D:bX¸É¡!<ràà
+â®¡\oÔ@µYùV{A69ácjÙkj"¦ÐA°td`^ò
+}Ò©Ò5ß¸ýâWÏ2f_m4"fcßrnX4u(ªJC7ûn:¹â$ãx{»]ýP¥s»Xç&Ø
+ÔeÒá
+¢@Ô
+ bã>Âà£QåbïAÒ
+ncî
+ÜÈ2}SKñ&¡8
+b^èX
+ SMæzx!þM(Ó×²W­ù
+ëÖòQÔá-ËàêÒl+#¬d2Iû}Æ,·Á0%ßí9´¯¡4r
+-\Çåfü®`VñþýET':yÐÑd
+ü¾TÏ2^\÷×°Æ(ë&æ`¡À-Þpc Ëà?7èzÚ0WÇnärÕM-²
+
+Õ4MrØ0®Â¸8v¡Ö6
+-A~8ã	EÓ]l&qõ
+íÐo4
+8Ü¦f^O+ °çÄM^!E«x®^?
+»Ã~ ðôÓú*ëøÇd+4c(ÓÕõ=@iAÚ[Öi4A´wææægºò26K¬óèÊòèç\ÍI¦zË"±=F¯lÏÁbr®
+
+-³9ÁÊ÷üÍ	²æ£ÑÃ
+-
+3®>¥ÆÃó8aä°¢Áo6b=
+
+?{ïÀPõîzFúãÝÀf
+ügKð(]¿ô[@Jý
+
+]4öÄúÃ;y®¥Þd*(7Ö
+ûzþÖ2É¾6uU;:gw(
+àWéXºíÆº
+-Sbc)êRox[SZ¦°[u'³`ßÃ4dG¹òØ{r1t=éãÎÁ·á-%>eYæf³-½2~j¹ÿä[ÄxÚÕ¸Ö êRîj<C
+-b__.ÿ
+§_uQDñ
+¨gà/ðÔ±9Ì6N6<
+Io¹$
+
+gÆG¿u`Ü
+-<ºð`Ç
+-ó%¦õ\½aæ°ÙD*ìç½ª	ìÏ	ç9nÓgÐ
+_N
+}'© Ç¹
+ôut^D
+²á:n.QâA2ôgù"¼«µfBs!
+-`Ï
+e¯Mo}Ï<¢},ð­Á*¦±Jnü"_ÅÔXe·Y
+lØÁJæ¿C`|ò½
+ä,)NÏ|Â
+öá
+6ñ
+oêOÁ3
+-0½h}Bçëèg8"$÷x#M_(ð5]>®«È@Mç¸ÊhÒ°sèø+gÒ&aDó_Hõë8YRÕ_ábiÍ @­Í±ñ@JÃ­Í@RèXÙ<çVÐHÙ¼FMc2d~F|óî^j&*W¦*`ÛY1+Fé¸P¦
+ÀäÏÙÎsÍMcwª=cq&o%K83àô`¢nrGh%®<ïq
+^ÍBª:ÉÂÓ¿Í ªF.íH²Í#T¯n
+}/tÎ±0[âØt.è1Ê~¶¬ujÞbÓyM¬IúýNðuÛÈX%7%Îl<ï§3ç¹}
+ºÐé<p6LÏÊCÛÙ´p×Ô¶
+3
+ 
+@=t¿¢ÇÆÞà@òlÞ=Hs¦ïkÉ9 ß
+¦p&ûÑBi¥¸ÆPhKb ¾¹¤ÊRYuE)FâÝ°¼ø|Y¼Xg×Ä²FïûÎÝ}ëô	?L^õMä(È+MÈÅ¦z
+\l¡EBB½ ¨*°9ËÞ"©HÈpî¦ó>X±R#¨{j!Ñqõ6Á"²ð(¿á!É¢Î½p4 n
+j6ÆèqaAÞSÖ=§l<b²ÀúY¢K¶VÐ·~Lây ü½¬'ïè2@ú¢dS³#¥É%§ôâÄkÃQv^ÜaÔÅ}®/^xx+ø~÷<ò·f,(ÜÛ°#V*¬¶>0Q+À¶:dØÊØ&fc=AcÝ
+Á1>[¶2b5KòG#²¿ºJx¡:cØp
+ÁNgyùÀvÏO
+-zÁØÜ4®1bÛMí1ì Q'TÐÿ<vî/§ë+úL
+¬°«ô ':$vN?W`»Bwb°{ðò
++ÈØÌéúúÄ/¢Ø,ò
+-òC°OÏì ë§^sBðËD=ÞÃ)çWt8ê37¬aö>ÂS,z¡ß `¸þê/[]'XIEB#9
+gR¸+»
+-¡_L¨ã®.ßHî&X¸ô«ã¼¼±XôÄÊSAbæÿÍn
+J¯JìlÏ¹V?òW 
+-h
+ó7|Peæ
+-<¹Ø4ëg*hîC>
+-/}²á71¦íj#LX|×«
+÷Ö^þ®UK8Þò<7`ØßÅÐÌ-ºÄRÅ`r·Aäý­ÎT¦ó«LÁ¯2ØÄ:v
+½Ì/CÆ©DLÓÖ×©	ùGh!Ãi§VãSîAeÏáÊË¿ÂÞãÛqFrÁoo¦2ó¸9áÑpáqj¸nD
+Î2&´*!(2¥¹gºå,¢(i@ò@ÎÕ!ì%±^þæ¶þc]øþððî
+-vb
+-endstream
+-endobj
+-362 0 obj <<
+-/Type /Page
+-/Contents 363 0 R
+-/Resources 361 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 347 0 R
+->> endobj
+-364 0 obj <<
+-/D [362 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-361 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F50 271 0 R /F49 256 0 R /F46 194 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-369 0 obj <<
+-/Length 2735      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚYÛnäÆ}×Wß8°ËîæÕ8»ÚÀFEVãíCipÈ1/Ò*_S]Õ
+R¢ÖyÑÕÅ®KWªjM°ùëÕ_öWï>ªh£?
+2µÙßo²ÐÏT¸Sã+nöÍ/J·¿íz÷1Lç:ýT§ØÈ2íNAàÝüpûïÝþÓîçÛíÎã}øüã?o>ßÒW~)uç6ÛÈOã·|(²Ëò2í
+Æ®j
+èYyÃ±dbù¸b/¯Ç|¨Úií=ÿæüó¸Õ©WCÛñûýVycS\øûc;Ö"än»Ó'ç}_=4NþÐòï¹kºüÄ@|äå]µ#û`ÛN?
+-36 ¿«Ë~»
+Ã
+-ç?å
+äü\´M_õCÙl!t¨j¼²ypCO6ß[¡I7^¸%Q^Õ¼T×TV
+ïÍúÖ£Óë"Ë@³5r¼¥^ÓÒþQâ
+Ê3¼
+-Yz3_iÝ
+ªf5Üç<µåNówÕc×ÌòD|ö¼MCÏßîRzéÙú_òÓ¹¶¾I3hWýÚucmO;¦uüB§ª­]ÔzÏÔ_òÄ´]Þ=3mf-ñón±×EÔðÊé¼jùlìYF"
+0.ñD<#) û4MÙñ2Ï>Å°jKe]e¥´õ#'
+2ð×@
+]?Ð
+£±òA
+òæÀ<$½Ú,þì{×åôúÜû
++ûcÙðç$>É3þ$ÐêXý_H´¡jÙ×-#/ÂmG^5
+-£3'3ðù3ijÅ3°ç#sJíI>Í»¡"
+ÄW-üK³Qt!°DDZìYr:@Z	¥Tèuí8T
+-E=½
+Ê¾èª;ÖüÀ4w
+x|ª¬T$±ßÛðÀÂPä	ÊsxbìßóÙÊPôb¡ßÞF+Ò±_VÃ±¼[øé'\¶gà Ø¢¯c`²¸.¸:;8ÁñÆ±
+-
+;
+I
+$Þ°aÁb>q^`håL¨ZA"AOCQ/ä½R~yS¬);7
+bïD.sâè
+H<ä,SòÆ,Cy*ãÉòo
+ÏÐ
+-
+º­Ø3
+-ô ÏùþëÆ)÷ö A:ïÆz¨Î_We'È©¸b@¬S´Øòo_äµ,Öà¼crù;wMïw7Ìôtl{QÀUëRä
+dKrØ* ÁÑX²Ëµ=¬­®#á¢m;@?§
+àOUØrJ_6}	7'Jy·yçèå
+-ÉÕí5Ò­YSÝEqlb
+tp¨7ÅgâB<%o3¥½¿¬Øî+RóIÅÊÑ¨I÷õH>e¾eg¥?Î¦&í^ú
+*Êà`ª8²ì¢½Ô²c ~%Wk?·a~hG¸bM2:¹ v|ýTèVöÄq9Ö·wÔ:?mIab*@Öÿdz×ø^Õ%@´jG³)ç$¥¬§UfÁÅª°,}Ïå
+ëöèªÁ897°tFí¨
+[]@T>^0MÇµnlèàzmW
+-õüAªõÜ2,8
+-«qEeõäØõ1ÇöÑ¶ä7û«ß¯¨ÁFm´J}
+¨B?é£,oÓÕ/¿¡o,ëic|<ÕÛ«ð$ñòT±GØ½1ÒmÀõx	ý4¢àÜ½$¶u¨	½ÎoK×¾ÃæÐí
+-}ÆÚ!Fë
+- Ó×©¹L)JGÞMÞ?ïöÛ
+ºûÙ¦\yÈ§xÜõk
+-â,
+| ;ÅcJW@j*.6ÈHôîÖRïþ¶{Ïdêhê@øB¾äBÛ\¡$Ývg¡Nb ëBq«År{:Slå!ÆXKm½Ýws9 [cí©êè8ãu+ÀôÈê(Á¨3GÓ´?".¡Á­°~rCMlç¬ñ$ËøBÔ{Ûþ0qU÷òKY
+¡É¸ã7·ïbdÒ@q3)hÈ¡ÆØoèè:ÄTúß
+l¯DKC~vhN¯Od?FººvÄve·&ÆL
+áCþ°e*g©ÄÓWM/Æ	Ø¥Ú]
+
+J0Ö6_ìqÁ$ûlãb×JPPP
+¶^Û&0ÖÓxA63MëE­]³s³/[,Ê»5MË
+GFSíx^3?C¹¬¥õJÕgoDÊBµôÆZm@Î¢7ÞÚ;ò+¹Kg"¾=1ÝNÂóuT /'Ðú²nQè¹E$-
+-7FcbY´´4lêþEM |É#qâ»v(î2æîT_jµ(®þç2mue_TZ[lÂ¼í¨:Û®¼tïs´FÁI£?pN¨©àipp
+®ÿS¤BÍ	õf©/_Ùj§
+-eXÐð+¨¿²Ê¦
+¿£ù$õ~ÜjÏ²³Ú$~Ì
+ù²i#\f¾ié=cK¾YnüÌLø¶X!>mwZ³üi¶ú=ìQqâo©$z¼ÌLîþfõH ßÐ«îKýhÅ_(XÛ%ôuh¾I±¯M8ÛF­éHÓ"LZ­j¬¬«¦òàTWDR
+E«!²çàM\ÃØ5ü<Á¿Z`Ã¯\{`@ KA)£|Ç Ýl¸ìøÌ@+õ@é/
+--0Ü
+"kpúÕáÒuÎTØfÅÎª¸v
+-P~9×4Û	+È.m½(ê'Ô¤'B¬/ú:b\´/DàÆ 
+LPÞó»/Ç×|ºÂ,1ÛL/l úW¦~juh«9_'E$HrÛzï¿ýäÎ/½½ìàËéÊ`²&hâª°yÃÚÒ^V+z¸Là¢Ëèvdy\k
+oõ;ù®qºJÎÖxG
+§îv
+-±­S3¬ü,´k]#_i	Qô!ÒÏ[^Ûó
+-
+>1«Tÿuåö
+-
+þÞ6ÓÜ×7÷¿Ñ4£
+D^$Z
+:ÝÙÆ7±ï)¬
+-xûËe&öR/,ãK8ýÔÏoê@nfZ
+¿S!E-
+§8Þ íôjslå|¹
+ù:Áð¥:¦C Aþ]-Q%òC35Âä\ïÈ
+-pûõ^Åø'6
+-¾öz%^4d<]ú4E=
+²ù8´r×açÔ0<
+M2£ôCæCÝÞq§®DÚª±eki¤ýûi@Ð(ãvÐ"
+hÂý»ëORß°ûÒß$ü$¤FÇt2¯PE_1¦*yy%²¦
+úÕXOGf/X©5êY]
+*ÿ
+JóX%
+q20:Iâ7Ûn.¸ííâeÒ ¥jÜ
+ì ÿ3; í×ídÖ&"wó?5Rá.:Â"µÆ®òß
+ò»Åÿê.ÿ³{9ÎPôUè®êäNßIgçútÝ\¹~v%ùÕÍþÑ:µÏZ,Ïøúûõt@gvi*Þ½cç
+Ë¼ÉÜ
+ò+ÃnöWÿuÉ
+-endstream
+-endobj
+-368 0 obj <<
+-/Type /Page
+-/Contents 369 0 R
+-/Resources 367 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 347 0 R
+-/Annots [ 360 0 R 365 0 R 366 0 R ]
+->> endobj
+-360 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [316.845 468.016 362.474 479.705]
+-/A << /S /GoTo /D (section.4) >>
+->> endobj
+-365 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [157.075 267.939 212.009 279.628]
+-/A << /S /GoTo /D (subsection.1.7) >>
+->> endobj
+-366 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [309.008 151.44 363.122 164.342]
+-/A << /S /GoTo /D (subsection.8.3) >>
+->> endobj
+-370 0 obj <<
+-/D [368 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-58 0 obj <<
+-/D [368 0 R /XYZ 94.914 452.639 null]
+->> endobj
+-62 0 obj <<
+-/D [368 0 R /XYZ 94.914 226.638 null]
+->> endobj
+-367 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F17 190 0 R /F20 270 0 R /F21 371 0 R /F23 294 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-374 0 obj <<
+-/Length 1704      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚíYKsÛ6¾ûWèHM- >ÚigÚ¦©ëé4Ó©o0EIôð¡ðÛùõÝÅ¥ÀMl7iâéKZìóÛÅÊ­gþì×£ÎN^ÊxÆ}ø	¯fd	³0âÙùrvá9_pß÷½Mþv.b/kÚù"¤·s¯n~µíò2§»¼®p%ðtµ$âº*ò*Ó
+-½þò¦7»ÚùåùÙÉK®¦HÁqÐ
+ÎÜtä[O^*>Ý½be¶/ÅâPÑòª£Êï\Gp)JäpÄÉ	m®æ"òú¼/Î@mÏÊ\¯è¹Ì¶ð
+-LP-³
+-·ÚÞÎòtë«"³z	ïÐP²0CKÚs¨16<`J&ÚTÿº6yõx}¢E*
+­ÜúðJ>Ö9ËºtÊíEuù¥îWziÑèÖOb`wëV(Î"
+î*íÝEù i+«Ïü`L;×1ÆHúÞÉ3?±[^ºy¨`ØðÚW¾dBVÛç2¨	Ðñ I
+FX,¬-¨¡ðºMFDÝäë¼Ò½esEo!×¶M½ntI/yKOö£Íy¡{í°apÒ`,ÛMÝK¢¯È?ôÒ·Y¼®¦´.·}üý¸0: W}î oP!â<æ)½ÁGÒr³Îñ»ýºÙýc&k¶MÖMHËÐþUÛdzÉmI0%¢Á÷q@-¬åHuöÅÕ°`7º°{@^8S
+
+m×wáÛÒá<¥î<Íìr¿Å'XuCF¯b¨±|õ@ &F}&_ÕEa´¿É«5
+-Äø1Í}µßîUû*òç²oË<«:ÌN¯«ãÛãõÙa Á²46³Áe|ÈrøíCÀ¢ÓÛ!ó
+-dD^¿ö¹LÉS.ÔØ}µ%ã@4ñx
+#ËÁZÁRzÀG°Ðw	êÄ
+w©Ð"="µ~ ´0}ÑÙ\CôÐ$d°/¤Ö§"	CâóÔ
+yX{>ø	`Ea·ÅÂø°e¼Öi}ëjHÿÒ ÀÙ×
+- èAgÓX¡ÏÚ»²öËÅ Aü49³IæQ9ðCÈt?Â,QÖ¾KÁ¢³|·í F<¼Íý¨	&ãØB<åMÖ¶¤A9=Äõlûÿ +¿¬VãëÂ´§ íÓàRÀÖ*¼>Ü:»@²(º¸_î0I²
+w¦GA°	OêOÄ£îÆ241µ×ÚÚ=JXkê
+L¹ ¹Õ"K@ABòÚmKüëª¸Cj¸|Â½ckb£Ý¿r:I	&ÿNZ¹Í;q<ÈKSÈI
+ÎB¸Þ_LP&1ì2þ4ÖhëÁvº£]DãÖé;Î¤¡ÓüòâúÒuøBú!ãÁAKtw'd)1W®ç
+©¤÷D^î
+
+-É]#=8w_V8XøcÞ|gk×ts+×
+ÎU¤hñ)=M¯íÞÜùÍ§¦1ã;zm²Rãðé`­îS|nfp×7epM¯&rHõrkpª$2;»Ðe!EÌ°­zâ4«R
+&
+NQÐ #¯Ü
+Ï<
+Í÷
+-ØNwÎþ
+»Å|
+ÖÞ,[î ®¦½À¡Ëp­ít³kmëï8£¢ÚS·ù}}(15"¹3vBYû¦ß± ÷çYçf§ÇÂô-â$Js+|Xõ&c
+tmõU^ä
+-.\3ý<5þ¾«Kä ¼¤ôaÍP5CkDÍ¨,ÆYf©ñ¼aµì	5g ÑpÔû³´öþIì
+@ú¬é(à
+À8_olÇµ½Y
+.à¤OFPFr
+9"Ò-æ3å
+-Ùòx¾P~äýøâÕï-RÝî§¬ÂÝ"
+»Ù¤SVuß8ºÕåî¢'ãÞf©aðËùÑ#,-T,4\RW ¹Gþl	A27fk	¥FDZÅì¯£?é¯\
+
+âÈðRÿZ§Óë3´Xº½?~7­å
+ìðìGÿÿ)ö©£>`{àE GØ¦8#&2Ê¢y{R«Ë;qµY÷ådð÷^ÎB
+-þ
+-ï9[Ú
+-endstream
+-endobj
+-373 0 obj <<
+-/Type /Page
+-/Contents 374 0 R
+-/Resources 372 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 376 0 R
+->> endobj
+-375 0 obj <<
+-/D [373 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-372 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F20 270 0 R /F23 294 0 R /F24 308 0 R /F18 191 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-379 0 obj <<
+-/Length 1516      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚíYKsÛ6¾ëWð(ÍH0$ÐNíÔî$v«i
+Ø¤Ê¬ø×wA(CU;©ñI¸üöÅ·
+{s{¿
+~Î.ðF
+-+âMo<Å"Üó%CIo:ó®ÞO_]p¹+I¥$ Ô±Ñ`ç?^þ9þ6ùãò|4a
+-~óêêüÍ¥`«øìB]¬	¸0¤/
+ä,¯?,c²¹ÎÞoÌèL8EBñÖ³3#d³x5P9a`Pé'|¸Öã8ªòÂÀQÜÃ
+-J[¸¹g-Añ½	aHpußÚú:=ÉÚ"Ìæ±1ï¶1//:698b2!H~Y0#
+á½;1¼E\ÖËÊe
+-êÄï\	ÉZÜ
+!ïô
+¢Ä
+
+-p#á#Ê
+Ç6úS|, §¶bVï`=l
+-»¦(P}¨wX`g À4¶?},0u!¢
+`¨äz­Ô<~uI¬ä0Ô?jÈ0Ïî`ÕÈ°Ðc3½
+	.ëØç7fºZØUXi\Å
++7¯ ]þí¾	+ñ
+R_©V¶Y
+U\=Õ^²ªÁºØ¼®,vê¦
+aÒé^ÇQÃçÓÁ?³Y'ø<ð¸(êEéàú=öfððµSÒ»mDSXEèØ/½ËÁïÞúú8 ¦9eCüW93ItË´­LpR¿Q¸\Æ3³ÌÇî±gØ,gdXÂB©°×©¦¦`h
+4g	sùÑke°óoò"
+Ã[ÄpZ\dáÒ¼
+-R
+-yÅÌ¤yóúÌ¾·YVI¹Ûdiß¶~5à¾åßÉÊæFÆjfvg©0*bC¬E©ÕÜÓïiwnHfdÜAÀ-F[ÉÍ­Æ6XàsiÒ<7qTWvöL7<Õ ª`H6lYlVGÚ'ý'ÊÓU]5Öé¶SËxTz>9½·ôoc±ÆºD¯³¨ñÊá
+CÆã	N¢@T8Zpþ¸§ñ@6XãÞÑêUçUa0Ðßc¨$³UÊjéûF`O0	*ÄüÇm^â3äû
+-
+»j"®Âù8
+gãÍx=¾ÛR*Úæ{;²\ä:
+-Û$RíPN)Uhw
+M®ÝÌÉ;Lx
+ÊI
+·[»(¦§XÐè«Sí¥
+-SzêntW|I]@é,Ã>x­ÒÔé
+Ã
+éÇ¸ó&{ro5vñ'`(]Çê^
+¼Ï=ÜÛ}]èúDk+Ý¶5ÉöG]v¬ÝöÁ^íRÝeßÝ©òl<5¤éåÃºEùén~²[ûÝâQõÃØ2 Ó Ð'xç.â²tÑ¹1S
+Ô%IçX6X¬íªwøü>Ëû¹ôÌØü[#@ñÂÿþç7;ÌÖc"wøO!-ºs
+¦n:
+-u
+¼ïÄÈµ=;ú
+Â`H=2ôËOÂ iÃÂjË+àÈ«ñÛ|MbçÏêÉýòefewuÙMÉÎ9óÊÍFÐÐ
+Ì¿ÆÞÖQ®ÀØëÕãØ
+6SlÌ®P°ýº} p¾dôÈYáíé&>àß:!	¢"øb
+Ï
+Æð_àYo½
+BðbÒò»ÜÛÆËp^.Wú+
+-c÷"eR#1
+ûæ;£»¨(8à	*%Mö:>¢ÔãÅ¶¨ m{ß+{Myùòòå=F¯í¾ÑÐÅç9÷,\
+-±mÉ;üÝÇÿÔ
+#w]8²ãßøjfBÉ _R§Í=¤ôY¼©ÌhUäÍfâY]Ø§árÙÛÒü¯Ú×ê2.ìTn_ß%6¢¯¾Róà×ø¶Ò×Kz\VñÊB{*=ZZÅº¹ê)qÜ<í\(ÙM·W¬Âö(f³ï-ñ>àô«
+-endstream
+-endobj
+-378 0 obj <<
+-/Type /Page
+-/Contents 379 0 R
+-/Resources 377 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 376 0 R
+->> endobj
+-380 0 obj <<
+-/D [378 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-377 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F20 270 0 R /F21 371 0 R /F24 308 0 R /F23 294 0 R /F18 191 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-384 0 obj <<
+-/Length 2721      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÝZÝã¶ß¿Â}Ó"6"uE
+Z$×Þ!@Ðf¸ÜÖwÊÒFooû×wHeI¦½·¸ úd¢ó=¿®îWtõ«?ß^Ý¼fÅ(ÉhÆV·»U&IÆä*50aV·ÅêC"¿Þ0Jiò]W}ºæ&)»þz#Lv×,i;ýcWTMÞ=Û;|WýB(»²±/
+U^ûõï;äCÕ6ýõÇÛ÷7o.9#T3`Î
+ÌÝtEÝåïÍ[Å¦ooQîõPÄ¤Ê©Áük¾uä¾¿½úíÊAWðzJ0zJM¤æ«íþêÃGº*àáû<ÊÌêÉmÝ¯@
+-ZÀU½úéêo^wóóY*H:Rv§;½oëO¿PEü~Ý¬?¯ïÖûöz)JXvò»h®6L%3|ñ¡µë¯ÜªMã5ÐúcL{Lr¢2´wsãå
+òGwbéo«ÂDIÀ@rëá©-´È9¶Êl^Ã;ï°·òÜ+Ú²ÂÎ?lwÈWSÈhS ×ø'®Jò®ÊïêÝÓÙ±Z­L86.`)Ïµ\´ êùü¡ùø©Î1,#Û"#Æ-Íã<û
+;2#æy§(pÝ³Ý½Z 7×)UÒU÷NÍCÞþa~d×^Êö0¸ý2éÊþPç,cXNzrÃÀûÃðN$÷¼Q1D°Á\$\zO	jB#Ã_ßo£"ñØxÔ]ÜeM
+-IiÆ
+ÉklÜ>ºx÷y¤õk[këO­íÑÊÅ$ë6
+üï2ÓÆçnÜõ£¥¯Y1ÁÈÄ:aÉ#¤±¼Ë÷.
+p© ">£¾TÑ2NRÃ&¾ãÎ
+
+¬
+&
+¸hÕ1â*Ç7£¥g¤,])¯_Sxq`£¥3u¬
+-1¡ 
+-¦oÛÖ«1¯~&;Sã¨£ÄÒsÇ
+-çp¸ùÚÿo¤Í©hbä¸ÃØÞ*W5íÍèù'¨srû ü\
+-ë¸û*qñ\lLÖ<uï©:á¹s6Ë q
+-özxª§â©WxNp	êÝ.&	c Èv¢®k ñ£9Ü!Ôÿ´Mýx(JÆgÈÂ{)~oÛ»*oüsbëâþqæç¡Ùb
+{¤øÂ½y½df~ê
+m[
+_yªè
+2°¡£òjÙ~
+X«[Kó±sî$Rù\Zv
+- a:H¬ê¥HnJTø
+-å@üáçÍ.·¢úw¢+ê£=íWÍ±¸%<Ø¶ûÇÃà»]Í¸\Rmý¥Ö<XÚÒeVL:aÜÂè¾G~evQódMÞ*åÎu))¨y½=XÍå+
+TE½Vs¾P¥³©,@[YLþZ6ÛÒA
+0` ázäëËf_!îÒXWÓ s\|ðÅÎ^G¬	Û]|¸ç-H°ÀRHpézá
+i0·K3Ñ¤[Þæx1æ0»Çç0@ß
+¿·^àvõ%VuÛ¤Ù
+eaqÀ£è[PM2½P§³£³Ø`Ê
+Xµ6Þ{ÏÕ0´
+éa&ú$; 
+At*½aBOºT-ì»êé5
+-]@&,hÎâÚ}çZ~	ðú}Õø' 
+ï
+F
+lüÉ¿rÿ³;f(·wVÁa¥)AeçoÀrE@Ñø´Å'w]ÞxpVökôÀþD'y]û°+¦í¹[(ûmW¡~
+-sÏM×è
+B
+-cfW}xÏzµýh£
+§Øsm6àùx|>àoIÙÝt÷ý*íJ
+WGtVvïûÄÂaoï $û¡²òÛËüñ±®ÊÞßT;ÿk[ópÑ´
+-H×ùÛ3ÙXaííÌ&îÕäþ0é¢Ò
+Gë#L
+ag½;£$  =æ¨
+·Hü¨	cü8À)ò©	í
+-¢=jÇÖÌ­æøbqè\´Ù5¨pí´+\
+¸EÄ^é{lì°¾¤RÚteoöy!k ¹F½S¤
+ï´
+OK©BmùÊè² <ÌP;>íM¸¤õd÷æ]áöHL½{ªi°ÚªÀCWMÉàÐÈËùe_#vÝpL)mòº+ó^=Â­­Eè«ýïOåöØ|v#himaZ¦·¦nz¥ åOfo+?{
+Õ§Oßöb2x»Éà
+-vãà
+-Ö/Þ¨­¾$ÿa
+L,Õ[$h.öáÐª³t
+ì
+ÊgVùÂhÁ§QünÛü0´M»o½ëü¾Ù¨qÑª£ÆKýQRXK¢ØØ¨p	
+-A¦é¤OD
+-thA¸®n3Ùv©3òurlÛ½È
+-<:ÚÚ óFÿÒ\D¾Ì9ÑD6í\ãg4cCol¸D*g|º>:Ý¼ñÐãèb-#'¦3
+¿?ãÚ)Í^Ñk6qUª£É ý©n]¢s&40Pî&ð
+=æ¡IYNÇR7 xM»ý{3ÜÐåÖv4NÓÏu^ P@¦ÅWaìã~|¤
+ÊV'N	mÑ<2ít¤å¯ñ  
+îqW>³öÞj_"¾©&ÔyÎ/É=YGãOzYa`=mµIèúÔ?- ª~÷<KêU}>
+)Jà°
+-vbõ¤fzªS3ÙÅ9+¾añ"\6U¥;¯âJ­ðÁÓD@´rôN¿³H iÜZ>OÓ^qJtÊÃ¡ÎyòMTU "3=S6ÑKj#ºS ±énQAt>UÌxÊg°,|rÑæ±*½Ìcöeq03ÞèdgÖ`ÐVXYûÅÐqa
+¸Ô4{<ÇTO¿gµq÷íËq HKRe/  èÒ'Û¾ýyÅÑ ª÷3£h2Ú0©8ÊyEü*5¿¶x2b>%NÖ{H-ê8=
+dØ«|ãë
+-áë\, µ4þI¡Dñ»kîïQu¥D
+Õ®ÿUÖ´¨ÌiMóÕ<d¥	&ÝÇ³6$µA
+gØuûaÁì,
+âÿÙ_;pnG`nï#_#~éBcs¹èÇºr
+?pã 
+_6`aïºFV'?÷¾qdãlÔòµÔFS@VÎalÑµn÷eSvnÔá©áÅIÎd4tÊKGS¦/"xåVËê3C8Ñô òY	\ú^
+-©pÏ\¾p2>÷Úi`Ç)
+lxèz,5:Ó®k÷
+ÕÂ®nýú£ÓnCôs*Ujþæ"ffsÈBL5~ukÉ9¤ÜýQfæ4CÞÿ
+Kcøñ]
+VlxÇhB½ãx;åó/aÓïá;ÿOKnÁ½¢§Á=eìÚºv¤ú7Ñ?ÞþEDkç
+-³Ï¿ãê_Ç¿Á
+ùa]´õ¼gýÏño0ôüqÀþª$	d
+-endstream
+-endobj
+-383 0 obj <<
+-/Type /Page
+-/Contents 384 0 R
+-/Resources 382 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 376 0 R
+-/Annots [ 381 0 R ]
+->> endobj
+-381 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [215.282 379.109 269.395 390.799]
+-/A << /S /GoTo /D (subsection.1.7) >>
+->> endobj
+-385 0 obj <<
+-/D [383 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-66 0 obj <<
+-/D [383 0 R /XYZ 94.914 364.465 null]
+->> endobj
+-382 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F20 270 0 R /F17 190 0 R /F24 308 0 R /F21 371 0 R /F18 191 0 R /F23 294 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-395 0 obj <<
+-/Length 2911      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚíZKsÜ¸¾ëWÌq´«ñ&¸ÉV%ªØ)ïaS±äÔfµ:P3
+
+-×3¤Ìeù×§
+-¾F,o.9ä" ht7¾þº!¾¸]ðÅßOÎ/O^½f!8Ky*ÛEªY*ôÂ:ÅrËÍâj)åéõåO¯Þh7
+)eN:ÈR§+Á9_¾þëÅ¿WÿX½¿x}ºRJ-ÿöîí¿^¿»À)NxXøÕ#¦s­¤á~²2ÌYCSeKS"æ¢
+--Iu/À«Wað©LÝáTºåÍé
+-ÞslYSgµ¥gÓfm¯zùéÔØeVÙÍ>oh
+Égë(Ç¬MúuJs¼'´b±ÒÐMÕÁ¤´buß²fíòD¼Ëêì·y
+]ºÁ/}¬ºMµÿe7ùmÅT%µÝÕù§¢êú¹ö_£×À(G~ûßÊ±îê:/Ñ®-u|(ScürU^_ÁßëoêòÔ©e<ì«:QýÆ
+]Þ×Fx¼çë¶ªã®%v¦_ç,+%ãI
+->fQÁÀo·±Ãk2N¶n.aRôc
+-4«Ë;Ø
+[VMÑ$ò¶ëeÑR?.kîoè£ÝemT
+P_*Ò~m
+3Ö_bÇdR¥ãÛeaµÿ</é
+-Þ¯
+º¶ XG\I0M¶
+¦]Nï
+-ZNÏ¸ÍdYúU¿#ø)m
+-ôÍ%sNÌºÜ¾ 
+føG£G¾ÐïtwªðÜåQu:Ãd¢¾fVÅl:¨p;ñsfu8FÙ¾Î³ÍC´³´nmT8É¸Rð2#-ÍpÑÝ4ùÇ.¸=þK88
+ËC;{ 5©
+K¿ÿ²©#Õô]W][ÑýIa¶
+à&¯¸hfø *Lí7Ó.ÁBNèÚ{×»9I´IÔcÛqcçÆF;YµÌ?ßí3®gáLÔL{
+
+PeQ
+VC²réÔx¬G½¼Ø¤z@
+-ýÞ#,Úép×µùl=½ÜfÂÄÏæc¦Æ½ð9ð
+²¶.Ö}l«^+ÈÁi~EX$d¼©ßX¦å/èã´.uãÏB
+å¬e©ÍÊ©^¨_Ã@±HXp?.aZ' ;³*¡Q¿Qj:
+
+r1õ"®Ñ­Þ{Ý@·6Â/EÍ9]Aü?O´%yìD×'OAaµ
+L
+Â©v8Z/Ö«k¾Ø@iøå½y@ÜUµ·_\üÈ×\à~®W3ù>s¸©|S3}ñ¾
+K[¤
+Ft.ª+ÎÔx²ÞJcïbJqN.ð
+?Qz2J3>¢ùoËÈLÌÜ1©Ëd¼âWµ¢Á® Ò(}LyPÅ}ÍNG,ERðÝwäÂï£NùñIG3£ò
+oV³$µ3S±µRóQtäA´brÀ]hõGûóÚê¥8W@¯6GZ?Ú¯_=B"õÐ" ÛÄ+Ä`m
+	ªmJä(@N¶§>
+-°ûäB$lh Êëõ:2«¨aS ®¨¼çzM.!eþ÷¦EØq 0Leû¦¢æû¢ÙÑ )Å9¢d åºÛl ÇXPãOÙºº)²2H(ü +Ít
+±;çÄ<ã#¨¤ÉðöÓ¢¼ñð%GÎß@ñ>GT&µ3Q@ü½KÀ±ÕBsË=~ þ:usôoM¦q.T
+-NÚçOnïhw3¹'»³Ï #a-@F>g¼ÕË4W
+í³ÐÊòUh:dãr
+ø#è8háÇS-}§AS÷»bÇ	 
+û¹hZ|µz2õ	 h!Y9@ë'H*Oô4ùÀ=@ <xÒÅvúÊ
+ªvÇNW6ÕËË]ÞäÔ9
+/ñ:+©9dÔZÝ ú
+-Ûº:Ð¸ÀºÁ_À!®æø ¹w i)²Z°Ö³¶(<¤X
+Pöe
+#
+Ã"6ò1w2êÇgXØÔ%1Vð(ÔèY¨¹éAT y¥ýfw`ô»ºðð
+Ò7ÐââÐAø/0ð´ËÐ_wû
+-æ
+eLUÕóÚþ·d 
+tTÍ8x[µ'ì|ª}p¥¸Ùd Àó¨'BX7r
+ëÀN? q¼gIæ{ÐÏWÕ%7"bEí­Ó%ÉµÓ,©ôx¸¥þünãÞDâ
+L|P¿O{à9 æ*<éSB
+ÒvxñÙ
+<s²Ö¾Cÿ¸ª0´¸
+|"!Fc^
+ªU|Xó,ÁîÕ103¥SqX×<ù¢;"Øy}Ä7ÅÖØTdI>fGùJÒID
+Wxce@Üë(à*0APVë½qc}ý¥[·
+-£Sx¹C*%Ð%SüØxÓbØõ?Á°Åc ¾<ë+ÀØdpÈl½~¶,¤<½èo±:Y
+-ÖçþÄ$o©+§ÊîXc ²ZÙt®¾(üDùE1tW}zì¤¾àÅåBËáÀTñéT
+RÎÄIg	ôRIõõÔD
+ÜpÛ¾ÜÖ>J
+-¯¼Þfë|Hb),¯/4,>ú¦¯ÞN*Ê(Ð¼­ö¡
+Óü0»xúZ Kâ¨ô9Ô'²áé+ÏÚ¬;Ûä·g¿_¢Ãã¥ñÿß*¼øVá¼?­[}XÛ
+jloÅàT
+-î´ôÜ?$éù0®Û·Ñø¢Ù8<Ît$$
+@dñ3Z«ÌRÇûKSÈäì<5;*ï+_®°»ü
+-VwZéá$¾ûX^W½±ZðÕã"q¤è)0\=¬P¨²	ìj[ÕÂh°!ÎAÏçlâë»UÑ¢.pÐ
+-UXbà"ÇH^|ÀÆ®¡Àdm^°nV×Ù¤j:_+Ázþ §òË¬@1_Ê±.CkùÝuuÉÅLMù!|¹Ù=MÈ$!fY9÷{Ï
+UMÞö­d&|Ïèn\ T²
+-|yQ
+2IùÛã#ñôö`\#ÜøT4Üá
+¥ÍHGQÀ;ñæ¤Ïñ\4?RIHI[	mòð9Üà¦¿DxÔixkç¾D Gp.ØË®Ç ðT­ÂÖÆ{>ê
+-(W>5âä@%ÈøPç¦3Rç4#è9
+^
+ù1_µPÍ!+o{@ºyò`dzö2Ø¼.Ú²v¼ó¶¦Ï:o»:©/1$&°²ó«âúê÷ë«×1^¯ÕH=YÐÓà
+Ã©ãá¿(¸úõô¶øC¼Ø¯ÆbµO	CbÛ§Gt¶¤ÍDëxÑü!^Gôp2è'¸ûÛ.+°}MW´÷­T¢nüsC
+6¿¨zLô£@OÁöCLT8fåþgÁÀ;«_×W´ÑâGÙ=ì»
+}¹,2ü}Ff§°¥m~öàÐzïé	4AY\?NNS¥ñÍx[*
+Jü
+æÜQfôsÕâ?ÈT©¤3h/<ÓøZæ>f"VÔ2Ý|wEûªi¨7Oªÿd}ÌÇAßZ?±[zfa
+â¯6y@¼r33
+SÕºAÜÆî<ÿØù
+ÿ¢>
+©óûº £ZTî¬k«²:
+ÿ
+-ôEsÈÿGøý
+-endstream
+-endobj
+-394 0 obj <<
+-/Type /Page
+-/Contents 395 0 R
+-/Resources 393 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 376 0 R
+-/Annots [ 386 0 R 387 0 R 388 0 R 389 0 R 390 0 R 391 0 R ]
+->> endobj
+-386 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [188.923 516.798 234.879 528.487]
+-/A << /S /GoTo /D (section.5) >>
+->> endobj
+-387 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [258.39 516.798 304.346 528.487]
+-/A << /S /GoTo /D (section.4) >>
+->> endobj
+-388 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [301.341 350.203 308.788 363.104]
+-/A << /S /GoTo /D (equation.3.1) >>
+->> endobj
+-389 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [397.849 228.823 405.296 241.725]
+-/A << /S /GoTo /D (equation.3.1) >>
+->> endobj
+-390 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [140.254 162.246 187.233 173.936]
+-/A << /S /GoTo /D (section.4) >>
+->> endobj
+-391 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [212.788 162.246 259.767 173.936]
+-/A << /S /GoTo /D (section.5) >>
+->> endobj
+-396 0 obj <<
+-/D [394 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-397 0 obj <<
+-/D [394 0 R /XYZ 209.066 432.583 null]
+->> endobj
+-393 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F20 270 0 R /F21 371 0 R /F23 294 0 R /F18 191 0 R /F24 308 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-406 0 obj <<
+-/Length 2079      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÕXKã6¾÷¯ð©Ë®²iQÔ3¤*I6Ú­l*}ëô-±míÊ¢º{æ×/@@²ìÖ<:;äbQ À Ån,þqõ÷«íQ¶È\.n
+y$r-L	©²ÅM¹¸]*¡VÁò«
+Wa¶4®]m+¹´Æ¿
+µk
+-Õòg]ØûJ7-½ê¦|¹æ'Ó¶~ÉÝÍÏÛe<5#
+-¥R	Vz
+B
+®¶{±ì,iÕÍ
+4GI´<:ÛÙ
+-}w\mÐ^«¥} ùnXøË6åäLÞXN-i$bð[ò`q­³^miælWJÄàBþ >£6
+E¢âqQQ|Tc"ÂhtFÕñ
+mÐNW)IT5tÐñ{£Kãhü{ £õGùT?ì¬¼7l9¿Ï×º´u±Eÿo¶¶4<ûoç¬I TfÕ&IJ-wµ½×5óY ÿ°Y2±Ì
+lÿý	9Z0º¾jº/MKûtûÊ0JD|ZÆ[Ahí;{Ð]Uèº~·ÊÔrMòÖF±)º
+-¼ï¥PÂëÈU
+-Zs	©ý
+
+-Àõ¬GÔ/ ÏÓzéÛªÙÑÐGx4¦ì
+eÀQÓ× *Be dª>J¤éÎî
+
+ÀÑ	ªnO£u|ªÒ TkSrP(yªy°
+ï]¥K}ï··}ïì ìò®ÃBó'÷C¾£ôÁöx@^5$:
+^rJ£,%zEÖÇ5Ò¥mN´¶wÅ¸ÆO³ 
+-Î²B/ãqÎ
+	³ib#¢|b§cb£¨b°ÀÈË
+Ø÷=áà`Ö½Í£8cÏXç] SR¤
+)E
+Ç!E"E§{4ÖÆT#äÆGüa<-ðJâbÍÇ
+-DvÀê·ÿµ¯:ø*ä´i cãÝ
+ÂÉvñPP>náßº½îhÁ^cB=b
+I:KkFÅ>RcßV¦
+[>
+-Ï®ÚxÌ_@£0­ õ>gÀM&ËïÞüòÏÍ÷0*G.@S*Od(ÑeY!=;yIyV=ÿãAüâºöß?
+-æùXÛª#Ð7!ëÈÒnÖì¶¢ÊÄ(°/Lòq^¨E	ªÅ§÷Éð© ÜñùàÌÛÞP-«yî^·Þ«¨ a¦
+-Î
+-¨>>QÕÎ­b°ø¸GÊeo¶¶ów=PÓÓt¬ .&äOíy*ÈEèúÖÛ)w¤Ç£ÔWbxÞª;õóäÜÆCi¹/8}KôM
+L
+ Àñ8ÊI
+f
+ú2GZM1@M	æ
+úGé Üèßº@ãþ»!gw¼ä{[ÿ¥Ã²§¶D¦ÞNß£ôÝÅ&Pq÷Ömy '¹n /A×MNÄuãÅþ*ILáÙØD2Xé©9´N{/äì5½9%	ÚKyÊª)yd|ÊWÖvîÖ
+gã¡q,÷ðÙ{< Àû(<H +}zòÜ9VP`ÚÂUlDI2´ Ëp&P0_ñ·ó¸ªU­ïkÞàºGÚjÖ
+
+óé¸ïºãWÛíÓÓ(ÚBô¬ÛmX
+EÛ8û	ØSì»Ã\º¯yL:ËúQ dtÑ8ÈÉ@ÃÎpZ*Ïl}ÛFÆë§O'H`ôpÃå|!ÚqDiÝ~Ñ1²ß
+¿©H$)wc!ÌÎoSYÄxùtÍçËïIHÝX`n®`ø"7É%³±«|Í?»
+F¦BÙÔ*x%«.Ö
+V­)ÜZÀ
+ä¨S-Äð3î°¬
+c&ç)à
+ûòæòÒ¾eéØ3MÒå«³ûäð¼lU@Y
+-*ïGô
+-wëM»úáæêíöWP¢ü
+1Â
+
+- ãVá¢8\ÝÞ&áBåÙâÉ/=,}	«¿]ýJ·ñËËg
+-y
+º)ßtñ{Þ­ëfí
+»TwëçõuÓ¼__Cfk k$^`¼ö/uo<K,ÖûG^è6(Q* á»hötßèÈÁ5ÿµw¶Þýmör
+"ÎÇ»Ýr?«Ç
+ºO«Z
+÷±oæ²Ô5çðüýD¬aÐnó ÁÉMÉ¹AòG_]
+|É©çbÈéd¼¨
+fO£'§i¾øi ø<)Üúâñ0
+Wa·
+óË
+o1Áëk6Ã
+¼ã&%)*1ü×ÞÖùþ>d)Þ±å-ívýa8ìgcª´ýýð¿Àóms÷JgÝ
+-ðÂ6ëã 2
+ÿHyµ6á&a¦yÿÅQÓØæ½q¶ý|çõM[í&wX>½#Bº#_åO¼	¥þ&ÃÎ}þ¿MAn;À×íKhú{%SD=j¤âW;"±ÁP
+`ÂÍsú'¸LF{Dmo£Wí¯ÓÜÆO2ü!élMA# árÅÿ¬~²ÜL"æÑ(º2"â/RtQWq;¶Ff¨º©¹×
+ÿ¥¸®¯Ù½íjú¨?¦Bfñ¿:Ï!PdxQ/ô"9ý;÷
+-
+'[Êùÿ}Çé<øg)y/2rèøà¥0
+-endstream
+-endobj
+-405 0 obj <<
+-/Type /Page
+-/Contents 406 0 R
+-/Resources 404 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 376 0 R
+-/Annots [ 392 0 R 398 0 R 399 0 R 400 0 R 401 0 R 402 0 R 403 0 R ]
+->> endobj
+-392 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [200.039 617.057 254.153 628.746]
+-/A << /S /GoTo /D (subsection.8.3) >>
+->> endobj
+-398 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [317.319 583.981 371.589 595.67]
+-/A << /S /GoTo /D (subsection.9.4) >>
+->> endobj
+-399 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [207.612 470.259 215.059 479.281]
+-/A << /S /GoTo /D (cite.GeMaPo05) >>
+->> endobj
+-400 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [246.202 470.259 253.649 479.281]
+-/A << /S /GoTo /D (cite.GeTaMaPo07) >>
+->> endobj
+-401 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [474.927 456.709 482.374 465.732]
+-/A << /S /GoTo /D (cite.GeMaPo05) >>
+->> endobj
+-402 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [514.383 456.709 521.83 465.732]
+-/A << /S /GoTo /D (cite.GeTaMaPo07) >>
+->> endobj
+-403 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [292.1 400.391 337.729 412.081]
+-/A << /S /GoTo /D (section.8) >>
+->> endobj
+-407 0 obj <<
+-/D [405 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-70 0 obj <<
+-/D [405 0 R /XYZ 94.914 555.976 null]
+->> endobj
+-408 0 obj <<
+-/D [405 0 R /XYZ 94.914 359.666 null]
+->> endobj
+-404 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F49 256 0 R /F17 190 0 R /F50 271 0 R /F46 194 0 R /F20 270 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-414 0 obj <<
+-/Length 3679      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­ZYÜ6~_Ñû¦Ò2O
+ò°Aì
+,µgXLü w«g´é::<v~ýÖAê2{<ûI¼DU_
+¤ØÜmÄæW?ß\½x%íF8¹ÜÜ
+6¹si6I¦c©³ÍÍ~s)sýþæ×¯L6©²$ÎTÑ }½Bèåßßýw{ófûïw/¯·Zëè·¯ÿóòí;âJ¸
+_¼²r>×VYAmµ³Äòûføp,yO·õû%ÁÒ¨ØæÆñâ¯ê}y¾Þª,*¡T_C¡Ç
+}Är¹ë§Sb1Èc©îùZ§2Ùl¥­ÉyhU÷¼t]ÿù
+J¶4NHÕ 8`Ç2j¹³9¸AMýgÙ6]
+?1ãx7Ô]uW{Ï
+-·ùør-£[ ñYìl¤òaämµ+@gÍbv0Pô<]s
+N5ÏñlZæBõ±8e÷lfÀalñ4¼<Ù$¢NÄ(+Í¹¯º»UÏ" hÛÏãóRHv
+-ËyÛ
+´sÑ§²/["
+-HH3¦ÅX8AySï&Ñ©iË®·VåQmY»aV®à¸
+-à`Ç­Eëþæ_ Pyu«~Ò-·
+gÆñ¨²­#·´å¹-;÷w	qÔËvúâ.Ì¸8ÑävU
+
+-Fr­Õ·-ÿªdTY¦R«$"b&íähy1
+¾_ÂLPd*b=áÊ)Dt'I:£YÃõ³)
+-A_¦ÄÄFÒUh4ÌF>Ò!â×U]_Ö»ÏÌYmU|ÉÙ
+Rp_îPbá¨^]g:ZØTëÄN¥N6TD 9ÖìfÆbâcëwZô?ýÆÆ:·HhQô(¼¸L_ôX²ÓÊ¡ÞJrÄìã
+{÷åÏP»©¼Á¶ª¿w:©Ø°!ÿ`¿uùÀ
+4µ«zà³kéÛa×Ä
+-ºñ *
+ÇÄBèKd%IÈ|Þ
+-GZµªùËÂ
+¶Ü]qçj$ai6ut3A×¹èQ¥yïJ8ÀaÍ
+-Ó¡mN Â!Îó´þcÕ
+
+7#§AJc¢?b7´mI²ç#]ª#eãX+eÈ1wû5W?8ö/æa¨Åö)
+-ÞR¾rÜ¶±ÐÒ
+ ©,ÎíR$h¯Ff
+¹/¡gä
+¼ ¼"oX-TÁ¢
+hQ"¶é0
+¸@ãÒ(VÞ£
+v#Ù%á;
+¢ç
+!0ûåö@*
+ [%`ß¾F5,`ã<Yñ
+µ!ETIè.9TÑ±¬ï@©ÌÈ8ë
+
+-è¬
+-±#ÈO¼zysõÇ
+$¸EVºd /r³;]Ý¾=tþº Ï³Í
+-=mt¬RÔÍãæÝÕ¿Øã^ñ Íc¥
+Àbª YKan5?Àª¾[í
+-]µ\5¨8÷(È|	FÒ[
+é/¶2Éï²M#s`YþÝ¶é@6;à&®},·uP7Av4À
+y;Ú·37nIq®í/â¡BÏ
+Aª3&ÔLc ×aR
+êªbeôÕæT`ÈÄ3RÛÓ H©ÝcâL«o;0°´
+-B>+Ñÿ_±»x`À
+¬Vø	»°ÂÄ)÷=vaE
+,wq_vÝ¤Á°W­5Ú
+m³ÑÐ6
+-üz½HÏò§»' ¸{¶Þ;#¸àÌÁê
+]ùSULÂ8,ìZÆl
+9F<kãºÝ+÷½8àìÜr{ÓFÔ -èÝsLÛÑvbÙÙu3i®6AÙÖÄ¹InCQ¡%(ôñØÐfÑãó¹mÎmåìd¼Ã0odl
+}æÁ AÌn¤à(:P
+«h.
+s=:ÎÒ|ÚpHÎtùtkAõ]H×&Và\üÒù¬. BVE=	|3³TV_Ä*²&§Nß¤N¡°/;ÙA¥ªAþO
+]ºqxç~Ü
+W2ý28
+4¶.?õ\òzÊ5	.= ¢cÀ
+Æ
+-å±Éí
+÷­ÿa±c¦GÚ¥Fàn¥N%W¹¿êøÛCÇý6êÎ¸Æñúøg§7rð?ùõ'msu×ÁKõ]¹G~ê,ú\B:F±
+-aÈê»ÀçÒO±Òæ1ÓF§+ûò-²/ÁCUY
+-s%qßG­ 5*¥Ï/®A'N'Y~l
+-
+ô
+¿Ç.`
+|¹KVP¡
+-»àôPÂé!,É¶/±´öé¶1lô½ØKu@8[^[ Já©0Ý@É;låRÂ±å:¯³/çzÁJ:Ë±ôjóx '!råfBº·ÞèÖWôÛN
+ vã\Ú'áÿº©Hæ¤L
+2ò]H·ÐAèôdÒ³¹ï©Í
+¦"oóQS!'2tÚós¬@Þ!2÷Íá$c.bª¼/àzÝ¾®¨ã)÷ò7è.
+-b
+[åÔR^äzÉ
+bÂÝ<Ú·.áz]CÙL·r~%(NSüâ²ÉA28ÈÉa(j^Éù\ñfhø[ìs?6zªvÍé<ô^¤Ë
+#¤s(Kt¶ã¯³ð%n
+-J[§KÌan)Ïù¹Æçé¨;:Îµ»
+-sÆØRåÞF*(-w>+¯ëØ0Ô{ä,)c	5ê¥\¤þÙt.kwÀ$°
+ÌÀþÁyý0·QvnpS8Ã±çç=U
+*rRÉ9&Ú
+¶ÜH¼-É
+'Ó¹×áeK
+-à.Ðgßnüz 
+'héx"NÈ©¤GQLç`SùiÙú¡KÛ¼¼_çn¬!IWzÿáKÕF
+D}³ÝËÁiÀ¹dò6XìvM»àÃ]öÜ\gÆTKèIÀ°l¡ðÑÓB}qöËßD¬§ Ð_Í­
+b ¶VéN.,ìx9¶¤ræÛ(1õ&ßÕòè¾º»wll>±ÍÜ¯&}
+³"@S/ÅFçÛ7 öm×ct á®s, 
+µ³l×¸#óG[ }&
+º
+^÷Ü'8_
+Ç
+v¡vòÛ:K
+
+æ}ã4N£°Ãù»¡ån¯S¼ºóùÙä=s×izé¾zü³¥Ô/Æ#FO¶*å§ât>ÒE»_
+li¼m;{
+-Cè^æ¿¼¢Ê&sóSØ$4r|*>]ðó)aô°"^g*B·õFÖþÇ æÍSÂÉ
+Ú)0)GK	ÊÊrnl°­ëEHÐ¤ó@
+E
+
+&ÏzüÝª»X¥iQÞÊ`óÁ¦®/O¹¥
+áM?ÊÀÉK
+nÀ,Ö(~ÌÍ6¹8YG*7hJ Axè4§rá*4^,q*Ó¯¦
+7Bóu¥[iNÔ±¹áôý
+ø+£D¼y{A³é´fo¼×£q³¼úúrËSõ¡VÒÿÈÝìå¬«ùÓ æ«ò×5SG&oÝ °Ùgé¹BÃÔ·{ Æ²÷}:ÿ
+ërwîÎ4`¸Wsï8õP«ßÉ/>iI(£²_ú[<'¹à0$7¾ ;×ÕWá
+4ðféé
+ü"÷KØjõ,f'RGo(CT¶% ðmDÏtüvlb
+-4}ð}³t¬ð¢N¢
+wÆµ)é5j¸ùHgY!yÎ¾4^ÀA%µ^ç¢
+-rò
+^ ÎbiäW<»QeßãòQ¾2îÞ¤`þÈÂX5G5¾ÖÁj^òá¾¤Í_È
+-X©¾ÂG«ìãB®éóxÎ+a.ô{dµ
+òX9b¸dP S-£7t
+@wú>">
+-°$õÊ­
+A¹C¥ùÐ_8eÚY3°0óËp¼G"(Ù¬>)*ßË)c(ù[ÀCx¡[p° ;hÄûØXbZ(ù)¢7õj\ÃÚ¥rÝc@XïÑ
+-
+Àá$
+-%´ÄÒ¹cÅyÕ«
+ûÏE
+ÕèÏ~<6õ
+	;Ò¸
+iD¨ÁMâm>³·¤ ×cò;àÙ~(¼K;Ñ,X©,j)êâø¹¯v¼(?"2èp5*<VàýJ=¤ãløOð:î«13Ù½|¡ÆöG$±Ëk±À«5>4r
+ÓïÊ..¢wåUg]î,ÄL|ú@-þQté­ Ìá{=´½0Íú(÷¬ºjIeT7=ø
+
+p°äzQ»×=*ÅL,º ¥fh·øv
+T¼rÿªrèüÔûaWú
+W ×
+-VòqYøH=Î­°/»sÕ£1Eu`{¯¤å*´[ÚÂ&
+åSÜ8f¼ªÇæåU½1>%£ä"¬SòURxm#Öy[íÁD&Óey,wä(9ín_µå¨snLc¬L1ßýç/X3S¬´Í¡æÎèV¤Ñ/¥K¯93÷»+6.Í¸`0Ê	`g@ç¿>¢¿ÅRóKò»éi=|^ºXñeNèr
+{¨)ñ±ÕYÕ¤q	k|3
+	
+->k;0®û
+&MËÀÐºQ'Jß÷nLu¾LO³ØL¯.¼ÖLS3ÇRß^Ó[Ü]1>Q
+É?áÈâ
+V&Ö*yGè 
+¿þ÷ß7Wÿ¹k$µ
+-endstream
+-endobj
+-413 0 obj <<
+-/Type /Page
+-/Contents 414 0 R
+-/Resources 412 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 376 0 R
+-/Annots [ 411 0 R ]
+->> endobj
+-411 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [305.088 300.046 342.535 311.735]
+-/A << /S /GoTo /D (table.2) >>
+->> endobj
+-415 0 obj <<
+-/D [413 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-412 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F20 270 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-421 0 obj <<
+-/Length 2231      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ½[[£8~¯_ÁcJÚ¸}ÇV#íÎeW­vW]o=­EH
+Q²@¦ºÿý
+c2	"fö¡+@È¹}>W»qôáèzøð3WÁ(Á	¶QÂQBx$C©èi}^1Ä
+×c¼ú±*~¤jWõã1¾Ú>UYëO§´ªs}ÍVÓ¬|.ÒcmnÓãæúæuÝ¾òåéãðÅà 
+²
+-ýÒ¶r}þôôð¿ý#
+b
+-aF£ìððù
+6ðåÇ#¨èµ}õ1Bç®÷Ñ§ÿá
+QÅ§Àë
+	X­mûJIüb
+-1x±U-+§Ç5Ø´<æGmÛ¦Uµ§
+-%	¢r!(²¸/ÄïB®Òý9à
+-ïáýFK$A4| °h2øs
+-)HMR@#1dyjòXÆ_ÆQÍüûä¿X°cv!ÿ«^©þóÍ8l¹5ÎZkÇ-ïSÚ4yu4_ëU|nR­üµâ
+þwÐbßg=
+ÀlCÖ«ÅZ
+ÔX»Ï"<
+b>ÏSUÒcù
+-XqÜä_
+-Tò.ÿÞäÛô¼oàLÀ`ê.Ì Ú¨ ¸f
+ÇafLGÆáZ§Ëç9
+-×38WÏ¯Æq	°©
+fIX
+- J¢"*C~%ãQt6ï+ï~âôM^7ÓfL½ðîÍw/UzÚ¹àiUîÍë¿`"Jýèu| Ã/CpâóIL8§¤°¼KáéóyÖéÖÖ¦²­É6¹b&ºpKÚ÷vô
+1n¤$4 Ù$¦ Ý¨oEÏex:|Mñ²35²AIÃ¡5RãPñ
+-L¨¹)ç
+ELA!­$ýI'"ælæ×ÀÞ'ÿ°¾ü£u§MÌ/7!GVºïìé8ò:w ÁârÂÙ$¦)Å­ ¹KÇ2=7PM6Ef`ÙäM¹j¿¿¸
+±j
+
+~Ë dfBF·ÖÜ
+ðtÐø<·ee
+©Ú\¦±q Ø®H²ù$¦H,¥5
+-
+bg»1- ïÈRFô`Ó4ng)Å¬ä
+Õõ<QLx?K±ñ,5ù¬wÊ?
+kOþÑ,¥ëûJ3§Qj
+6
+-£ }.	/ã#"Å­L´GÏ1+÷çÃñÚþóòÐýí JB2Ä,1F[Yhge[×®ó½í&ôa`Ó4.Cö·A.§ä)Æ#ÎcPÌvO­Òç½íéwfç¢ø¸Dí¾E}j£
+N×8$Þ4,ÙÆ¬{ ÚÒÖ$ñ¸¿¥ÙÐÖ
+-³NÂSZ¥¨áª!] B'ºWmô
+Ü¹dÉ!ÔÖ°*ØJT6»¼z-ÜÐÙeG;'a#yS0H³Õ²' ûÜFPJûc¬Ls¾Ïv¥6OÛËëâ¨²!|@cågl@åK
+-´¥
+vÁÈáôØ¹ê
+,<;!Ø{
+ÇQE"¦ÇM-9°å--Bìtr:¤,¥Pdv"¦YVVâøb4lJ£ï
+ð¡É=»Á½:&µùëHªd½:¦£¥`³÷êÂíÕõ¸½W7÷uH¡áÁUà±øißp5Ê8yö½c¯n>ók0î8ÏöäÿÿÌCLÐaHyè
+s>Q
+¨¸9CY§Îç¹ä 9Ä¸
+@ °äa Í&1O|sÐ¼
+OÏó¾As}(8
+4ÓDÞ3ý	wÓ¿wìÌÍç}
+ëâàê?ÚÀWyÖB(?c(?¿c
+¢^>]6¸ObÂÝ¨¡¾»aiQñYÇM 4>ñÊvßfZ±m<	Ãg6)| êfãáp ç$>ãPÑbæDsª­'1J´½ NK6ØÕ³Ð®!
+úhJ²À®^"Fi_Ü+ñ§·õ"iÏ
+®@"^ÎÜXgUñÜV4ùÆ>ëûª<7Å1¯õÐ;æqãhø'ÉÚ:DëÏÚ
+
+54U!Vð¡nÒ¦*2G<­ÚJJÖÝäÀ,7w§)Í¶S'3
+-þm]
+-vyºÑ
+-èk(ù>7vJ~Âê\¾-¿¦r}0rÛm¼ªÑîûÁÑL
+å=À_¡ä«×]i!wV¸Ú	íÏ#rÜnË­ªLëÝz««
+¨Ý±K÷{¦àQ«giúáË¾|Ö]¾v
+-ëë	
+ÛõK
+Û¿#*
+ïV©êunÙrûúF!¦Ã< )[ýô5=´jy3WÕæ¾ØïÏµUÂO0
+ÌMÊëaåv.£/Îuúb/GÆ2ÿÞ¼dÒçõA9)>äCU7}âö`¦Åùô þÛbÑG¬´ r4yCF^H
+Èîºó÷µ
+-\	Ù-,=Pl17Ûò¬OSn|³äÄòÄ	ÂÔ¬â¿þf¦£ìtgÍ(TõQgÞ>
+zÁag¶1 
+£Ã¢¢=%_@Ü:±ÓþF;v¹q<nSÿ×î
+-C
+-²dß	 Bõ hËüØÌ=¼¨ì±þ¢yd´-¬áÿèë·2`=!FÛC¬ûñßÿZÿ 6
+ eí0 
+-HÖH&Ö
+=}us¦¿ëõ-
+­ù­>P
+£q~øÂ¬¸èfÖïÖMuÎsû$cïþ;y·Í2_Û{Qö\¡¨?Ùf¦ÈFãZ
+¿Lµà ù
+-©
+-endstream
+-endobj
+-420 0 obj <<
+-/Type /Page
+-/Contents 421 0 R
+-/Resources 419 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 425 0 R
+-/Annots [ 417 0 R 418 0 R ]
+->> endobj
+-417 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [487.684 389.995 524.86 401.685]
+-/A << /S /GoTo /D (table.3) >>
+->> endobj
+-418 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [366.139 184.266 419.553 197.167]
+-/A << /S /GoTo /D (subsection.8.3) >>
+->> endobj
+-422 0 obj <<
+-/D [420 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-416 0 obj <<
+-/D [420 0 R /XYZ 264.168 461.167 null]
+->> endobj
+-423 0 obj <<
+-/D [420 0 R /XYZ 261.243 264.212 null]
+->> endobj
+-424 0 obj <<
+-/D [420 0 R /XYZ 94.914 111.353 null]
+->> endobj
+-419 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F49 256 0 R /F46 194 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-429 0 obj <<
+-/Length 3381      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÍ[YsÛÈ~×¯à#¬ÆsÏ [yHjíÔúÅµªìTA$$a´ hÙùõé9 ¢R'\Ã>¿îiÒÅý.þvñ×ë7ïZ0J2±ÅõÝ"$cr¡­ LØÅõzq³äúòóõû7ï¤
+äVË-rÄå£.ßþåã¿®®?\ýããÛË+!ÄòüçÛ?"
+&Þ¿¾y§ØöWÔ¿X­üeÕy¿ä+GîíõÅo
+(Ðü\S"¬Yhi4|±Ú^Ü|¦5||¿O]<¹¡Û
+ Ü¸Û,>^üÝka:?ÓhíHáH7ûcÞ}¢vùýw­»ÊeuÉáökøôþ§K+á¡~ìÊºjáÇ
+¹81R/® JfzûP_r»l:O¨D¢á
+füÞ`j*¦4É2
+-ðæ®Ë/¯TáËuQ]r³ìÊOÉU¼xj{*ä
+[ûßÂolñæ¸1È
+-[6A!wþº.§ãÑ.Ãd_.ZæMßnÖÏËéÔ<Ìcâ¼Û¤<3Ä¦jîªþÕËE2ÕGSÚDBPÄ§"­ë
+õÓ|½©>"Ø
+ÃÖÇFõR
+)~
+-³Ú
+!¡n&\(`h¡ý([I¬É |B¸íª¶¼¯ud4ðõþ§Ï7'ÉØÔh´'ÿ°ª·MÑ¶nû7mÙáoáM×ìVÝ®)§
+-~ÃOb0o|Ä@t¦UííÑÔ/:°o®hZ#,ãÇÚ®À$Ód	KfÀàÇÿ³àµãßç«ú¶ÌÃç²õWÐúù#øþ®C¥!¡2
+Êû1½Nñ¹qHöäÇÞÕÍ6ïÈåÎÄòÝ¥Ëºñ_º ZzYèu
+wwÊº-¾KA*"h¯G Û²51¦wÏ
+B¬ñª];Äyòp
+-ùMË=ÙD÷CÖå¶ ¯­«|è:ËzÀ£Ó9Ì
++½}Ñµ¬L3"t
+CXàOÐólIà|j<$]¤ á¶®ä¨$ÒÀ¬eS?
+$c8÷ü
+Ääös&{ÖÁ	¤0ËvMYÝû_:ïÃU¾Ùø;PR!(K¬åR2ÿs£²l¡ E4¸Ò9ùgXÃ
+-©t_ ÌøMÖ0ç35æl¼ç
+-Ì/ÿt9Id¶8`ª1µL1
+Î/£QUºúOê
+â7%@|°©¿ÆNâ>%Rö¹79»!ðLû
+ZB@¬©G95²ú    á
+ ¼®áKµ'ÛÒ9Ï4Â¿q~Y`VL³*%Üö
+-ýD¹LÊÄ8.S@¡6;N12¢Ì4"8bv
+~C%B*
+-³-¶uó­°vj7÷2ª'$ïa6ê¦Ý­Ðz^ïfD[µ¯÷èË{~c¬õ¦¼bÉÈP­ÐÞ	¦¾Ä3´sÿx¥À1¿úOÎ)M
+L¦
+ÌÇ9â
+-Xõ±Fýa"zÌ
+ÜfÄJ}¶(Â
+ÚZ
+-¾á<G{D))Á1û?rLpXõÄ!yµNú ºf{þqC.IZé³
+^Ñ×Ïvi2Å I¸¢`nó
+-Ø(`ÈÆØa¨ )~ÜÝ¶Åo» oq	gLsA­³Ùm+Å3"Ö
+-ÑÉ¨
+
+-ßð	8à+½!~I#.¼£=\Ñ)\Ãleut6F-L:£
+£zïÌk@ª¾hiò&HßvuãÁIì+t)Y×c½íÁ¡*":$üÊXºlß¯ÒÐ#¤f;Î·0i3¹èe²väÙ¦ú%rCyGBÙm 4@ú(nÆe· ËbSl{IÝWõÁµCª0
+?ªz 
+-+$sÆ;aàdµ0nåÓFà%5'
+F
+¯®$¥PòTp$çí®HQ´
+Ð:Z]ioí|µªµ+µ¿^c¨æ·à¶ ´$q«Å{âÞXUùf
+ÓÚÑp¾g9ÈËCÝ
+-¾°r^@£9(r91¬
+-h>`¨Àk2î/ã`\\Æ1ts-õ Îa°
+Ýtî)E`
+lrÔ¼XKÞøÈ 
+;F.AFN²¿~ó¹Æ9ÔÑËN×à2\¿ñ¡l0á·FÐkç
+-Ì=
+-4Xvj®Î¢16±üLkZ@$@Á¹¿ÅbÐÌ¦)mÅ'?4ÆËøßsðF#öø2îÐÄ­iÐú½°÷â®ëwb÷6Úÿ
+É{ÓiK¤}¡öN&ÒàÀá
+-Óùðy9£ÅÆs>6õc~ÖQû;·_½©Öõ6/«Ö¿Ç
+ÿuqï6]Ü¿1×ªîÍ¥$äVu¹N&qÌ\*¨ÍêUæ¦RÏé¶ì¦ñ4o3t9¶EÂyð	+½
+ïuàUTñ)|²#ðyòä~ÿ3
+óßmØ7Ë9FÆ|ã¿Ý7ùãÃÌø'ÊÔ°S5ãg¨ ·!î°
+{V`LâX`
+-XÏSñ,¾ÊÑtã9Ûü.,ð¶~Wg]D ^Æ-»;ÜÏ{
+9ÏPno ønmvN&qÌ@
+VIJ>¯2g4ÐxÎ®¼
+?ºCÚí?¯#¦8CcSèì<ÌäYF2É^	3auK©b&ÇÌÓ'?°ë
+ù±ëÿÙ3dF1®4!Mº­>Îþ
+{£Ai,2~N
+NâH
+ò©Ìs ù:s[MæÌw
+]¹Ý]±%üýå9zímE°â,ÛLâmwö9||9£mÆsÞÕ¥f½Çæ
+-q{C(PfvÖìtÇ
+¡éËn>oW3b<gS|¹t'Xm¨ ¶Ï§©s86ÍÔ)yÎwÍq¨a
+U(6
+faÑïJÆÞ
+ù§d+8¥9~®m
+-±Ô8ÚJy¬ÍDÀË¹}WXÎª~ë»o=I 8ÈÎ;Ö;+MÃ$Ò°ÔBæ`SÕm
+"
+#þdf×æ÷Åøfô-«ø©	Fõ
+Î=F>©ÂÍTñaXâÉÌÜ¬?äö¼Nv±í®i;ì¼`3î0%³¸iÆo&v¥ÿÅëïý98^½,"ä
+ÜévM5Â,ìüÜß
+-'°0ÔEâ'w§éãn¯UÑÓÎ;ÿm¯QWN$ß®vxôÎ³p'
+U(HðaØ
+uP<
+GàëlLu
+-?]gx:Î(6
+-	g7$W|Í·ÉUháîd6´ÒluwÉÞ-Ü´?{[¥ê÷ïÿ>+önó¯3ÁÑ¡¬Jö½IÂåpà:ÀS0¢¬ïBÚ¸M~ã±÷À	ÝÆañ´-4}åXfå·ø®mwÛØáå,à:2cè*aèp®,4~Io{ßêLû
+CKZº9AÀ½5fOcû§ÆöçÓu®°gkè
+M*
+-nQä
+:«ö;ßÑUá¸IBvI
+
+J¦<àÍ¨O¡^C\¡ß®ýË§²{H²ÉkÔk´Jk@
+moÞ¢Êºã·¸ÚÔ÷å*ß${®,Q¬'õáçã9Mù¨×'P¯Ûâ%òqFÄpØ6ga=Ó¦ @z¡{@<zÔ£[þØk³a¿)wU6
+(lcþp^=bÃûåmüIî¢
+bßß×ÕæÿiYMHC"«6å¯ ç	öí¹6d(¸æ§¸¸<éÖU/é¸ÍbF¿ëãÈÇ
+-¿K«ñå°y*]1ïR+\Á5[ç5 7·ñÛv>ô$|9çI
+ÑÒãbÝásQÈ^`¤
+åôÉ°EoeÏxëHõô¯0e1fOuc×´¢=òVþÄ\hã ZhÐÛCáäMWeWÝ¨IjÎI¤}.¹|ª1ÃWáä6Í
+Ú<ún»
+-¶ Iç¾R.?Übø})ë];j
+-±È4û~zì¾¨ùÛ.wý¡wÛº¬e3ûÞ9¿!N'u*VSgà~Û7óªò2~õu&Àþ¡Ø÷Wý]ç?{¾âmètÛç÷54þâ1¾Rå*U*úôÆ>ª$É0÷¦É\ìã«§ÒÕ	®!Áß
+-Ùª/&ËµÌÃïú
+-ñcøá¦®î}ô=îU¸6QÐ<p ì
+¹<ÏðînW­ÉL+²=9ß%s"u4¾êÝÊ·roò*ß|óÛCîi
+¹i
+
+µ
+½Ü§©
+°yz(C¨{ÝÿÕ|éNéW°×«ÀÞý[â
+ö`zËÓÿ$µ,
+-endstream
+-endobj
+-428 0 obj <<
+-/Type /Page
+-/Contents 429 0 R
+-/Resources 427 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 425 0 R
+-/Annots [ 426 0 R ]
+->> endobj
+-426 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [486.359 434.615 524.86 446.305]
+-/A << /S /GoTo /D (table.4) >>
+->> endobj
+-430 0 obj <<
+-/D [428 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-431 0 obj <<
+-/D [428 0 R /XYZ 270.516 253.91 null]
+->> endobj
+-427 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F20 270 0 R /F18 191 0 R /F21 371 0 R /F23 294 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-437 0 obj <<
+-/Length 2858      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÕZ[oÝ¸~÷¯8è
+ä("©
+
+n
+¤ÝnMmüPÀ1ùHÇVª#Õeô×÷©['AZ}ñÈ93ùæB»»]°ûóÅ®.þêü4HÅîê¸KC?á.ÖÊJï®òÝµ§|u¹AxÏÛò·K©½¢í.÷J
+ÞñRxMËÏ¯ÏYÛô¬¼³Cs[fuÇ¯YLóSÑuäæêç§?hÎF(
+$\dBDå{·wó{ù:ê®¨6ëÜ¿ÜGIâ½.ëíh7UÖwüÞßÄë¡²'¡>ðT×·Ã¡ZûåÐÙ÷H²£}rÚ(iòærOC
+Ï×MÏãmñëPbMöBùQ2ÛYívèß.£ØËªì6õÖ^Ùóô)iCðs)oÀtîã|0ãÂ³Ï
+-}dYÍªÍé<ôf¬âMg÷Éî\ö
+ÛÇ®sÌ½Ê,%8ÉdOâÜ²
+â-Þ©1tRÿ« .ð}[
+ÞÕ½¥sz°¯Í
+-%sCBÃ FCiÎ$Ow-o6­Jû±
+i»¢*}Ç«³`(Ç)
+z>O¼bW3kN ç¬ï¶6Bïeø¡ËóðçìÎ("
+8¢çÅ­¢Î1I
+kþ5K
+-µ"ý½eêÖR
+ù·¬ói
+«7R
+ÄÊOqVÌzK)8
+-ãó6ö1,ò´ev[ÝÖÖB¦>¬Ý-|ÚÚZH?F¦fØ"òc/Uù@7CEè
+h¶8VT
+¸Þ±i
+-YÖZªÙ
+<ÑÎÇMN¡$!GG:\KRv¼^WÞÕå@ÌéøéNð,fN{ÔÛúI|¥ëò
+¹8Zÿ|Ý©"ðÈß>rè¬á>Nv¡EV·¶`bàuÓÂ7_ØO}ú1w
+ám3 ?-'¥/ÒÑ¯ÞeÖ?\]üzA£PÁNèÄÓxÅhÓÝátq}ìrL<|êÝ!=íPxªv¯/~áµÜN¤xSZËz\Öojb¨ÑFè
+!8éËHÕ;ñf^Ë$ä
+4Ïw>Ï_4ü;F
+ù¸Ð"¢30m
+ú$xI&
+ÓBÜÑñ¤Þ?K)ÃÒÞ¡B¨ò¼ÇÎÀßñ´±M¥Y,áåüFÒì¡±îÌÃ%b¨²ö®àÇSUß3A^BZçoÅ«F1¦ÿ¡ë?SÔÉÎ>:KÙðo;%Äz
+iìZ§ñáÃ%0£Ðà!¥cKÌ±áÅ¸Åö³81_r?@>ãåÒ¡ëÕ/Æ
+ê
+,*ßf¼ØKÂ¬¥°ÙôõÕß_¼zùâ¯?lìÐGÿ½ÈÞbïÏþ±å<@ªDjç<Ç¦ªLñÀÙ3xÊéÊS&2*-øÁbÀðÂïwYÞT§Æ]
+-ûóöØ¼Hù÷ÜôgRB]À·¦@-aQ+¡
+-È¸ü¢å1dæÅ¸Nÿ÷
+-{íÙÄÑ¨æ_Ô÷Ev9U±%±
+	ìÇ$&þÇ_&ñ*¥F_XíÃ}y ÞáØØÔe~k¸ã©(MÌÇ³¡oàñå1ëÝZt¤g;Òó]ÕÜR~HÏNj	ÀxDê!h2
++µùû	1µÆÉ)÷Á 
+-ºÂnÿÚ%c´§ö&
+;øHúI$àd^bgè4dÒfá©?XPîø­t¿U5ÀÂ©°à[HôÜ»ý÷Ùé<¦EK(d#
+´¶þÎÖHþx¹¡½ûlU-äJ¾²,
+-Y¥O-úNñ 
+3¸EþS¤\ØÉÃÍK.$Þc,å&´H¬"¹öã(ðã8^e(zhm
+_Ýuº*àhjÖ'
+-fückN+ëÅ\Ë Çs´Y
+bRM"8À÷ìùßþ²ÿÞv1-óSoyÑ­ rD£vQÏºß5^+hu6­{^ð
+m8ö%
+Æ&½ÿ¦PãmÖÞI
+9gÝ=a>jûûþ	Ë÷Ó+ÂiÐÖbä±öáæi¸TVwoÕö.À1í3¶ùý&(FP:Ö±æóô©Ur6Ër`¿¦tAÑnsuÑï[°5jºþjWèáv
+-#­ÕÈÑùÖV
+E3Èe¢Ç+¬DôôªnY¤T "¹y3`M{\×õÍ×Èõ)~Ã/©
+c{owÕ»ÄO1Åí
+tÊFï`S*©C_Já§B1éPS=6Vï
+ñúæú«d$§MÈûéeîýô>Á}32v¾Þ¦Ø1¾9Ï°å¶©x üd'pRÉûÍÑâ
+-§.oÁ
+-²ÅLÖÙ¹g°µ%S_cé
+-Oß®¸`4N·Ãv-
+Vu}® ×Sµ<%¦]Eë¶íØÃ«ñ.HÆé[S²r«ÃsK¬
+GûSÛ`
+g$¦`î»¤,ÄB«PðìØ|)¶KÆ©w$¨]VJÂ6Y
+/§ê3GY=¥N³8Þñâ=6s;/C%1eCåòmAÆ/<úfÑÃ_ô_×ïn®ÍEü/ân«ÿÅaCE~¢VM6sØ:5¤ª8Yxêx¤$]ó#
+À@)¤4jj^l
+ø¼Udgì<^¦	a÷P«¬IpÊoe¸
+-~ê#Ë
+Òá}Ù2~CzJ¿öqØ	öý£wºÜ°TùjbÆØ@¹i2ò©9Då} 
+Â¯{r¾NF»únkWízÄrS×òc
+­LÃ-?bÀ`6ôpUdt=7³£Ô"k¤)FÜìl»&26×YÂU£[Þ&·mÒ+\^Ï^ÝP`jòZG.
+5´÷núüã¾|VÝ5mÙß(¦.ÿ¡-­·æEÉè1x¼òx
+-yø
+-4µ?õäjSàp·	Ò´|
+¾»ZÇÜY
+- £ê2Ó¦Â+Ö]Å`À^Å`2ÓÍ³	®Ò¹¡ÃE
+
+­
+-¬?ÀBCí,t
+¶Ú×ò-'¤Åc6T½ÉsÍ§t¦aH©çÝ½Íhxl¶òì'ùt§ VüO,kb£àösÃ9ZfLÁêù½Ï0
++©ÂõMM%¦³Î%
+¸¼xÝþñëìjÖn^|÷¦ìÖÁ¼V2ïc×^
+ëÚ$c×&·5ÿÚëYï*Øòµi<Ò´¯7>ÛµÁÃðÅ]Lÿÿº6ÏL*º}Á£±|i.
+-Ç
+ÆC"	bE0ÝíY"oÖ¬R[Å,Q)Hvh­@ëÇo&è2d$ºH2RÝº^Í`îåây.þ§ZÕ«VÓ=·=
+é4ØV7ÿZô°Q¼¬ ±Uòq¹¶Uñ÷Yu*gJÛ*[0BÃ7F^ÒåÆ¡ØüOõÓP-N[Æ
+¡	¡ST´÷c£ÆÇû|slÓlØ»³¤6Î®#|²ðïBhk¶(æ¸ÉªýÖQ½î!ã2¿gºâB©î&:Ö»üz¼çW{¹ûøv~4ØºXs
+§(ù9öÎû
+ºNÚRY|<8³
+Wý7^nÒu
+-endstream
+-endobj
+-436 0 obj <<
+-/Type /Page
+-/Contents 437 0 R
+-/Resources 435 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 425 0 R
+-/Annots [ 432 0 R 433 0 R 434 0 R ]
+->> endobj
+-432 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [467.526 482.553 520.618 495.454]
+-/A << /S /GoTo /D (subsection.8.3) >>
+->> endobj
+-433 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [208.431 243.815 221.333 252.838]
+-/A << /S /GoTo /D (cite.Wa05a) >>
+->> endobj
+-434 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [467.526 180.913 520.618 193.815]
+-/A << /S /GoTo /D (subsection.8.3) >>
+->> endobj
+-438 0 obj <<
+-/D [436 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-439 0 obj <<
+-/D [436 0 R /XYZ 94.914 113.474 null]
+->> endobj
+-435 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F20 270 0 R /F49 256 0 R /F18 191 0 R /F23 294 0 R /F46 194 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-447 0 obj <<
+-/Length 3078      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚíZKsãÆ¾ëWðHUXÌ{à6ö:kWªìXJªR² 
+-»+ÿú|= @JÑTr!féé~|ÝÃtv?Kg¹øóõÅï±4ÉÒÍ®?Ì2dLÎ´	vv½ÝÌ¹½¼½þáÍwÒgr«Ë-rÄå¥i:÷öêë¿zw¹BÌ¿ýùû¼ûù¸HáCª¸ØB¨Äjå¼¾´b^c&çòe¹.»¼+¨¯æÝChÜUÑä]YW¾_ð´E±ò#¼kÊeÑúÞºñ<ÌÛæM[vÜÌýÈ6ïº¢	ËÝ/¹¡[gSÓè'ßYÖmS´-I0¸`"Q2ó\àæ+hæo¿ýñ¯o¨-æ[¿ÄÇråw&"K_¬×~ý²ºï<9üÔ~`Õ5mXüÓC¹$.
+¨ËçyV»Ë[/	È²: ôM½þVÉôû«\wMÞ<~=:±þäÐ8³4IðÜUç=KáVyw}ñÛÃé
+_[dÏt*«fËÍÅÍm:[á
+dÌÎ>¹H8ÖMgëÙÕÅß¼¶©3%<Un)Wn
+îäPåi£ÎA3hiÆTÿ/IUêìWî)ç?ütiå<t®ÂË-f2§+
+Ë#×u ÂÍ¼Ým
+)dv÷æM Hg¿»dó
+-5î.øÅ)³yãß;»ÀsUlñ4z¥F#ûx©`Mß­¡.OGtµL´6îÆÏKf!8Ã$6¶=CÕÁPYýç,µwaÕ4KPo£ø¥]Õ÷³+·
+.öÍíÍípI^À8GÎÀ¸þo¢®Ù-»³í
+~C2õ
+ÄUæÓ|Ä
+-øXÕ;Ç/ruSÝÞl¿h÷ÁÉsçd?¿ð^'¶N,ëõnSµñt&Ï
+v¤p5µ
+
+-è±»&ï)m
+·»Î7£ªak^Û2Kç]=%ÆëìòqGÉKRPW©NRÁ^ç³Äµ`á|OyJ#)õyÈÉÂUN¹MPQ,.~h»(ngÚ»áÉ7^Ìtê4Áûý÷£OûÌ$e®í %Êì=ü¸"?óPx/.S
+Q±ï÷kÝ~­Û/W
+¢à<x.1±ã
+R*1æÐswlÉöW+¿´'Qß;KÎ
+^EàsDgäq5Dµ©Íö{ò\ÂIÕwäÜ0ùº]W¬ü;BeN<S	|Ïùfë¼J!J·á=*/E$ì zh^ÊgÒX@ñ:ìaÈ'(·
+pG"<&¶LBj+æßMÛ}5Å 'ú%BóDèó°ÃµJ´8`ç ³©<Y ¸Ô1Ùc×kt°ð5yz9HYmWËbÁ}Ñ nØüÞ¸0§ÇÁøð®1teÌQs`Î÷M¾%l-
+Í/)´ 
+>¥éfÕÑ´SVf9¬ú9+ð-ÛÛu·Ô.rÃ¦\Â÷7âÔÎX¾hhÒ?Ñ
+'
+|ëäÖ¯ 	!¿Y°Ì÷'iÖA¨Ôb¿÷½U®7eåbãpÚ´[Á­ûu\0E5Óñí¤¼ÒD=l%yÈ{C-a %£Õüjw×¿íW^?z?oÈpÂåXYg?B&
+Z,ÉÈ_þÄ-kÜZ©Õ§l)jÎCV§HÖ³1Ùã6Ëù^ú9%¶¤jKÈÀ3
+âC<½ØÔÍ£
+êæÚÇ=>EÁ±	¢5ã(5ËªìÊ|Mxíw²é(«É¿Ùg×ûåËºY9wÕ±À¡.ÄÙàM
+âh1¤  
+h
+-3´$ôòõ=zÝÁ!
+wþ]Ù9ÛíºtMÕ´í B°ç¶
+
+-
+¤û¯Ñ
+$Í[KÁ(O(¬`¸Ög!+¡
+Jdc²ÇUïÏ<Ês×Faæë¶ö­èï©½GBdØÛ8¡ïk5ÁYîUñ¦6íëP¤3à%
+:ý*; ¤1k3aÝ;Ð>Ð¡§ymkU /DE¢Jµ_\6H)x=GÝÖYöºÑ9ÈÆÂÑì~ª
+U¡8ôþ'*{ÎU¨
+
+©ýïUXÞÿ¿Âò
+aõßY`8÷ Å
+5ÇæTWRð±Éd	òvXöÊ,FÂ3[æÖÒ w§üF.¨ØyÈ 0æYò'S²Æq;.¯8):aôH¹3\"ïNã©6zRÆ,Nd
+lÆÁ²ýfÐÙ¥¬PX®r²¹°éÂûéTjT¬i¼Iùü½Óú¶uõ
+-èë4Ïß"¡Ñ×&Ð9T|Q>ÑÒj CqV
+-_
+´4p
+©ÖJã
+Ú«p7'ª&a=
+8n`R>§ú,ìHÍf²1;G#häôç!
+Ì¡ù¶¨øayb*ýVeO¯É6wjFÏí¶©·ðsî¢=ö{=Å¨×S¿j+ªå£ïÆ"¡Há4Ý»ã_T'0rÂ¢$ô+ñIÁf{åø:0Ï¡	jÞ:~S¤LËu¹ô!¯©/]D§à^çmhy1¤Aj4uU6Å²ó=´üÝªÝãoöË½/¢y£ó¡©7a­®õt4 6s ®éÞ¦ L<b¸B{·&
+»j¦~Ûå&tÚ×$DÈiÀ3J-WéW\ÒçÒô\5ºÄ½¼x!é2+QaÃ«§ÓÀ
+YÍr@ª_µXbµ=YÑ dH%;Y¡@1Ù£vôEÃä&
+$ÆbIcIC:`ÛÓÚ
+-¼Hvº¤¦á|<iÑXÓø}ºaÀÚ­Û3
+Oµg)ðfÆÅ
+È[éãÅ
+ÎC1ë¡î£ÐÝ×-¸>V·@nÍ
+â 
+É2Êà,ìuPÊZnNè%ÅD"A;
+YªS
+=¡2Ó£Ê*NÔ®rÁu_¹à:§~¦J|\
+->:ãÕ
+-ì'µÐ_g¯³Oûø£µy6
+K+_Z® cQQ;QÜ
+KwdþÃeI±tÎ7
+0Æ3ËÜ÷¼À©åêxÆHì{y\%N&vc Í6¥õsF+Ù :³GèmØdå
+
+-
+uvÖ3ÃóÿÁÊ²ðUAZA
+iK
+àqÏ®MlÒ3Ùwp2ÄÖæþÑßRÏ?êª}Ül
+-ú§+uøl³}ÖìðÕèd*4OGÉ û<Êð¦P%Qø@Ú¾fíÓàÁ,y(''r¢|Ê½Èd^Sg Zè
+-Ä¿EÀ%ÖC½ì  !³EúM{<â-ú ?GÖçç.´ð³$Ì0¡kÈ©²¾O'ð	®»¦
+ÝÓþmWüF·qUÄ
+-øj×xáº7ÎãÝþ¬1V7Sä,iççpÞ³Û\
+w©Æ@»õY1k£âNû;¥æm½þè9·ÒntWýZùä¹^},óðÁn¹$½§îÇîÚ®ìv$úÖëæB¥vþ°äß+õ¬NLØßq©
+IåÿBhÜ_W~$rBÓÿí3ôß>à3mÃµ}òxeI¿NÆ_M¿¤`-2EN5½þê@¸ ¹g*ÖÊUc iÔÕ^ÀT 	xs6¤&uÀÆMo
+D2»¬Püµj7¡ð±¬w!­!åDÕ$­½óÆ^EûVî«¢ËËµó/4XåëÇ¶
+]NåHù»pj;ß1R{C/-6Ð-7ÿøq ñ~ï«?o×u³*ªÆäAîJEÉ<LÙ;Vê|¨wÕ¾ìauér»<fê­»·~V
+?»Q·ÓWÐT
+-¸
+-endstream
+-endobj
+-446 0 obj <<
+-/Type /Page
+-/Contents 447 0 R
+-/Resources 445 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 425 0 R
+-/Annots [ 441 0 R 442 0 R 443 0 R ]
+->> endobj
+-441 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [370.366 464.188 377.813 473.211]
+-/A << /S /GoTo /D (cite.GeMaPo05) >>
+->> endobj
+-442 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [361.13 79.402 368.577 88.425]
+-/A << /S /GoTo /D (cite.GePoTaWa06) >>
+->> endobj
+-443 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [397.494 79.402 404.941 88.425]
+-/A << /S /GoTo /D (cite.GePoWa08) >>
+->> endobj
+-448 0 obj <<
+-/D [446 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-445 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F20 270 0 R /F50 271 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-458 0 obj <<
+-/Length 3486      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÕZYsä¶~×¯à#UÖpqv_q%åJV©<Èª-jÈåc³}ºð®¬*©¼$j ï¯ ÉmBÎþxyöê{aJ2K,M.ß&VdDQnË"¹Jy&Î7þXÝÞÝùs~[vÕûs)Ó|'3iéÇ/Ï
+-OË¦o»þüúò§WßS¹\@0Ma}GYtFÂ VÉËÌ(ég]Þ=gL¦EVëð[¤]{ª¦ìý¯yWúá}×ípÎtúi#:-
+?£jü®]îà[óqW¿Ë¶Þ¾ê÷y×á
+]Ýý>ÆÕ43T.`1¡ÒwÕ÷pç7Uõã
+6HxÔ<ÓL%Ê3	;rÿ»­
+Û-gi~Ú
+x×õ'?tÜ»ww¥¼­Û¼öïwe^8éÀû/ºqÌ¨È³G
+»¿÷°hL&Ä¤¸_$}]nªmüÉ8üH³ó 4ý&óÝÈ5aÑé à}M·-<MZÏª®ýÐ[?âY,=ÓäIÓü6LnßúmKºÒe¨
+÷}[6%Ðs29ûîòì×3d$4aFgÓD1q-íîìê$üøSCÖ$ÜÔ]Â3æ¥N^ýÍ»ÑzQfñ;Zh¹¥A\Åé²¢CðYR¹Pëeÿo£+
+·A,ySÄt1Ëq#_	Ë2%ÍSd'(XÓ/²¬ *£ëE!êDc01	e7Þünå[|Û
+"Øp3[®·
+ª#¯¿ßS©Î¤"Fo@©op{oÐ¯²í~U± Ó2oÁCaCñ²À`
+-	(Ë(¬í!>zz^¿Æü¢r"$rªY£0y+%Ã9L[ÊÍ)B¬R!å(æS?~ynJ9$Ù0i´ú×¼C¨²i¾ß×^©Þ8})ãË¶*½Ð*TÐÖÏØ¶»ý!$Ø.\Ã}	2.6rFï
+
+¶óaF
+-;Õ;{
+§?¿
+ÊæÂÙ	YHÛ~JÑúÛëq¥
+-¤:÷[Wþz¨º0ñí¡õÖá¿"éÿupt1¶Ýy ÊÓC Ú6|ðm¸Ëû(ÿC"émÙ¡­
+Ù°­­²S#G*Zdq
+-M4deâfÈ.ÙPZÊÏªÂ,¾²Û
+N²Å¢±LvùçsLÊ,j!sÈbªØÄha
+d6MBE
+-¾>ì÷. ´} F¹w¹m[×cºÄá1k­B!a[º·ãå+l¦Í²þ¯äk]àå 
+-åvFn Þâ¾=Ö2µðómÛí¼Às? 0ª«>ÆfBP`ìu1yfã×ç	N|Uà:jbæAÓ¨ê2ÍÙRâ_*
+%i3«Ø${É/ñ¡üC¯ü`Ìf$}©VëE
+-ÖS+£¹Íð
+<dV }þ
+³D¬
+µø¹Ñ,aB*æØOD	¬mk}Û9Hi¯MìgÒ
+I}Òö}uS!oËmµ
+-ßUÔ¯!E.AyÜfa
+-Ó³ÍÆÈ@ìµlì©$O»ÖtsãKjªþPAÎ,	Xù`|Cbö	,"º%Ðá
+Ö V­±e[CÅÔû×¡Å§ÆÜY ,ÜpÀx.õã¥ÏâõPqyxÇ`q y½¿ùöç¿lþä#Ô¦¸øûª({¢\Qã¢Ö¡ñ©!ZÈXÉdn_H§2Z@öH {e P>¯Ñ`-Qò=q`ÌvØz¦ xÝ
+j¬ÖÌ
+¡ =v%[Ç) th0¸
+-
+-.ð_~ù.h
+-pC
+-u
+-]9ÍÚ°à	àt0@7ëûhIÍè
+âx`bô1´ÀßÂZä 
+-±o1
+l¢®Á
+p
+-Ë]?DãÚ0nB:²%¦3JÀ pbOI£Æ9Ï·vÖt´©ªÄqg`â·Èþ\ û£c]ð.Æ)pA¢._@Wì1]ÉÇuLJ½ÔÕÑàå^çØ½fÂI7zÙy:Ý<õ¹¦
+K	
+*>,4ûH5ÜÃ^Ð¸Àì·¼`Oz
+-ò_K»
+«=b/)ÕÒñÇ¼Í å[
+-Ìï
+±R¾2¬5ä4(`eÔÙÀÔ¤Êwq
+Kfü¾I£FHU6g½' ³bÕA=ö ÔÒòÙhAË¶+5 Ià0
+-¢¯v`õ7e{è¡
+-4Ü8`O¡}8g	Ó=)g)AnN¸¥¸äç%-¥¡Þ·bê¤g¦-Þå½gkø­Åôô¡Â2~K0©Õ¾`°îÿõP6Ûð¾ð}Þå»r(»þË¸g]­·½¨
+vZ@m¸
+½o«bq'ñQåA©÷y­0ì5#)iä,=4!¿½Ø]4ÅÅþâãÅ¬Ð×£U%
+-èg«þÎOBß	%ÞâWñî,o'4ñêUB¾mø	 ªAM~%nFr+XV5C¨³·àÁùÆÍÜé¦z> °Ï¦-$?î[&]Ôcz
+àm »(7 ÁÊ#ÊMóâÜTÍÎ
+rHsÒù¨Ç%»â9ü¸v[ë´Ó6ßve/)aNñ ÚÇà=øÉv÷Ï?¸Ã_
+°§<ä'Ìq=u¼k	aEÛcíÁÕ¸ÄÇ«æú9[÷ª¯eÿ4c©WÅÆ¯\þ~S+
+vbRÎ9æù%»s8½Ú]_õÕoå³¸ïÊ
+2cè1õ£Óc
+-íuß	Åç¬»æ®
+Tú±ïzVO]KV^æ®öÏÚ¾;QqËÞßsÇæÁîË8¤øUÎúGïr#'&{ä§
+$Ãîv¶Bìøó¢ÎÆÑ¥
+Î<9ã³,±ïGùL`WîZOÝ}ðÝl|[*xZØ$Ç$]Y
+¶þé¸í^6 %ö1Òzì#4[5s
+vGn|nÀÇaït½øö1)qzN`0°ÓXPÕO¾´*$Tãw¡ä'$ÖûgÉ¬=já
+áx5
+Ä/îééÕÆ ôÒ&S­8Zo[Ó
+k
+i§º
+Ð{x§ÂQ8*ª~¨ zÉõ¤ò>Û D¡©eFND¬æ£Fó:Ýø÷¢2½oÑÃç}ËêÇ¶Ç[ç 
+Cç°Úå(©¦òÁ
+xáÂá	Ö§ûø
+-F!åPªÓ5ÿëz­fð;È
+-x·D¤­óf0È×ZfyÄ
+-5¤+­¶ú^¥ÉØ
+ô
+*Ys3°7ûlÈ-¥ð$Ù#
+Rrû®Ýç·`3:­Æäö_v¿3Â­JM5Á4'+«ü=ÜÖÚÙEèªN^·Â#:t_Zgkú¶ÖÄÏ@¸y­
+µñìE/Úø$Dhd
+ûÛÙ¯»4ñ$ûµµ·a½8¡
+W``9|j
+¸
+Çavi8ôr¶Àj¨ìÂBí;Ó@TÑñð,ßÙäóyÕ`mW
+T¬ñÊ¹öQ[Øý¡6LOw´ÐpHo·xoÂ½»,O@ÕûªðQ
+¾C
+­ø%à@Bµõ3(X»¯à?Tw$Â´Ü?êjê°¥OµýU¬w0ä0ñ±ÐÂ?Ýýµs¼¥þûô^äà¦¡íÂÏ^50VøSqÄì°ÎÉ­8ºÒ|;~$ìVkÍ19áfºÎo$´ erÑz,Í=×­@úcÓ-ù¨
+-{
+k
+7/»	j1+ñ¿ô,6
+Aåá3wq-ÄwO`d°sM%J0G2ÓE:I©Ð¡AÎJýIJnN7·å¸ÇÞty0P`>DUþì¾YpÅ\]ÅÉ{¯S
+«âÇPVLêñ
+°vÔC;áØ
+þõÑÞ6âÞÙÅ=oRÒ#r«hIÆ®¬*ËaB
+¯a/Oïi2¡
+ßâÃK¶Ow±¦4ÇÒEÒÊ1
+%ó»ñÈéhÃ,í70G	¹»ÚûáÇ@]"!÷
+õs\ÁÀéXþÄÜÀ?ÑS¯¿ª®£gH4#óqé]>;_¨«u¼pêú¡;lCf Ý
+¨ôñp>ïªÛAv¾¶Ñ\§ßMÉ»2üHWb¥<b{?æ¼ÇíqJþ?£æÌ"ø
+îÒ>PYíjÛ
+-2Y©ÍGÇÆ
+wþý!'§D»§¹¥þ<·î\}I¨¹çp+óÈ$=_RZ5w@¯ygà(½~ñß+WT¤\/Y®à-%½*YvÕGÐãón¨<?9âß
+¢r
+-endstream
+-endobj
+-457 0 obj <<
+-/Type /Page
+-/Contents 458 0 R
+-/Resources 456 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 425 0 R
+-/Annots [ 444 0 R 451 0 R 452 0 R 453 0 R ]
+->> endobj
+-444 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [417.563 630 470.574 642.902]
+-/A << /S /GoTo /D (subsection.8.3) >>
+->> endobj
+-451 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [385.391 264.017 392.838 276.918]
+-/A << /S /GoTo /D (equation.3.2) >>
+->> endobj
+-452 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [317.655 221.426 325.102 234.328]
+-/A << /S /GoTo /D (equation.3.2) >>
+->> endobj
+-453 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [472.312 166.675 479.759 175.698]
+-/A << /S /GoTo /D (cite.Griewank97) >>
+->> endobj
+-459 0 obj <<
+-/D [457 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-74 0 obj <<
+-/D [457 0 R /XYZ 94.914 588.074 null]
+->> endobj
+-460 0 obj <<
+-/D [457 0 R /XYZ 160.093 421.571 null]
+->> endobj
+-456 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F49 256 0 R /F51 272 0 R /F17 190 0 R /F20 270 0 R /F21 371 0 R /F23 294 0 R /F18 191 0 R /F24 308 0 R /F26 309 0 R /F22 461 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-466 0 obj <<
+-/Length 3561      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÕZmÜ¶þî_±uö­Ì7QR M§I
+´@|mQï¼ÒíÊÑJ[½Øq~}g8¤Þ»wWúeW¢(r8yæ¡Øf¿a?½øãÍ×?òhÃY²onî7©
+-S®6:!Éæ&ßÜ]ÝÝüùõ*÷À@ÔéjËcÁÛïÞýk{ó·íßß½½ÚJ)~ùùoyC¼`vâõ¬[7ØVFa¢#2/ÚòÓU¤¬Ewµ±Êþlw%àw2hî©µ?$¯`ó98OCò
+©ÏR.ÂH]ú¢îÖÎµMSuµÕjnZ²ÈmÝîËzoi&Ì«}Ñ·Ù¡ÈÛ¬¢'
+É_
+Ä-"dRã:5t»¶ü o$Î$c|À÷¾Ðõ_®xP£zþ-2¸åü.¼ÚFZ?×ÔÉÈ÷Ù±¬Ê¬¥ÿ
+2¦/wôpu^Ý¬F.«Ü§;Ð®R®Ç·0±|µ£°
+jÿ\è*hîD+Ýõ¤pØ7R5
+P¬oeGãæýn»ðM
+¦13=¢ÅF
+-5¬Åôúè[I+Y¯¬Î½ZÁ.ñ&ãzýêW
+×:uø&B0£Õë¡4{d
+*üÿß³	øá´ùg¥u¨Ù¸×VCB.5Dã^¿gBy÷CB×Ë»p¸dÉ(niÅíú¦%Cêé½ÏßP¦já§hMímyw[ÝùfRi(õ8ÓÓ\ùCÁâÉÌºîµþ¦YÞ3&ýVÈ5:EÌ7
+-
+U
+SÔõx®¥ð­
+I®V·
+/
+-¸¡í!h¼W^5Æ#¹2£õXº
+ÉÝHÂ4Z"àw¸¹½w8dââ
+p)"1Ã%óáóo!¥m*Æ½A7Ú*×;/|F*d_4«|Ny¤a?[ Äë÷+7AU¼¸ê]_65Ý¾FAV
+-üq0N®ð£¶@©<ZàdieNf½ØÊ8Ì+îU
+¶i ¾+ª{4{°}åeQÏ·{á7[)D¨Õ*@¶¾e¦!^üO©B	¢ÌòÃ#>zÎ0<{å).ÿ;Á
+Ì(ùR0ö7ß´	@qüx¬<ô<XÔ7¢¶T#j¯Ü ù^7Ðat[JüÕ?ò)¸)
+ÁM¥â9n
+-q7g!óI¸*;¤
+S^5jM&8ê}ÓÁ5É.Ç
+-ð	±í ~ËÒ`7®ã`þ:¾Á?M±û{C'ßl"
+(ÈWð/AL%ÐÓ0±sßè}¼Pû¢.@û
+LCÌTY*0i£
+²$vÍï> »§bípAµ-³m)ë¼xÒÌ)'±
+ÙgýÁª/·Ð¹øÍk4¢­~þ6³i
+ÍùïGf¨P¥b,Üï
+±sØ°;ì¼Z(3â%ùè)ÄI-@Ê»Ë
+-øé¤Ðq¯A}©> aó	¹)ØEpñ1êñ1Z/*Î¡ìfõh22l¨p.A
+-xeFA
+ÙÌ~ghiø¿°K¯}EFáÖ | áYF¾`:^±6È
+iz)¦/.WùI :âQ-ÓµÝ?MÁK: x¥âªÁý.¢ã½
+­&Xó%çOã©Ð¸\Ø÷ÆLöÁ´oL=F5±óXA|ùf
+cÃÔ
+é« ú*ØÜèOº¡ÿ¹ñÇñã£ÎvéÀ#ÌYUQSeò¼Ï¦ÔÚ|U"|`*6æ¢2#Â8»\-Ïé!æÆøÈV`¹Êdx
+ítÙ± Fõ^ià;í°ëÖ>0¹64OÕª5ÐÑmÒex#µé@h×càë1°·*ávo¡­2
+Y´&¬|-9e-hÔÄH0yéä¡¶,{s Û¢ÇIWfòE
+ñHð£erCB=
+-½#c
+
+ôÐx±Õ¥4óªáT=\V¶	{X¹àk{6ËsÀÐ£f~mãqN9nÇò7~¦/Âhª;¼~MåþPt=	ï-qö}[ø2©çªÌ}
+ü!Â±_Ü·ùÝs$>r!±Pö0ÉÅ-Þ
+¤{1ËED©§ÿc~¡
+-È:º³uMºi{D]aß§ò(c>­ÏÎm··*BÒ3§ þÚÿNÖ¬wW¦)A{µ2<° £ÎÅ¢Zä«2FNk£Bà:JmAº³pé0ÖU.Ø
+ÄÐ8yéÊ)þ0ô4vÝô4öj²40È8	&9[+Ö½¦l
+ã?% j=
+OgbÖT]B:¦c&Û5CÓ| d°þ_lvÀ -W¡k´ 3Pfµ{ª
+2Ã@\º¹«B³ .ÜsC¥bÜMÃTëWUÿ¦-÷e5{ó9À
+Nþ
+klO]wnð¾¶Á­³ãÜ{¹1xÎ¬
+ãw3×i±p»ÜD\Jfª0[]{ï`m]YïÑ¸SÜTz
+n(²%Á÷ôÖ©mömv<mG
+-èÃø|ôa¼ÉN6^èulZ;NAP4Ê	íl²Ôù`T
+-=
+¬ÊZð±ÒeOQwÃnÃÀh1L`èuøa`°ÉT¾q<èjö®!ê
+}°" }¦Úî+EÝ·_[,pbnã½ ÿ;ojíß¬ø ÜtG!Ü¹ÒñàÉ
+-*%â>[½
+2\
+-FäG×ùK@5ÀÌ
+enì+AWÀíèèæH0hø)ØÊ²
+c)ÐÁ%/Î
+pÙ·åÎ%8Üë¢!Eç/Àuúµr[ñÜ?-¹_+¹
+On!ëaéo¢ªD·â]º¦
+s0Ê
+
+-w>]~,9·GªxºIÆñxN2eGï
+¬î\£	óW-3;ÍsÛ²°/
+-ézº ôíllø(¶µ>LehB?#¸ â¢W¶o ÄM×ÁÏ÷î¹YJ&
+-îÁ§²©2ÃXº:{a»Ñ1^TÇ¦³QvW´lØW
+tó¹mê½oUDÉOÛÌ ÜÒÛÍPç
+5
+>-èÆIÁqÄE §Âï¶§uG¸êÀzÂPh)í<:àE3ÁI[5¡Î=ô^t?øñ
+etm½ìX×|zþÙÌÂ­§4³±Ñ%sO¼
+R®Oô±± Ó»ñÂ´}Oó
+¡g`ë¢iI
+¼
+¡!ùCÆq(µ^ ®g4SFÒJ'òµKÅÜÆbNSMY ËÕh8BaSá4¥\UaWHY]¼Jºätô
+?Q'[2ùÒH;	d
+NHÄ×§k ãõ_ÜN?
+
+ÓÐ'#5¬ 
+=42æu
+å-u>m0´3S-í
+½U¡Öc\®½Iìw(4?³Ó×_ÍeFÎõüyeá$Nÿ/Ó`WÒhS_ßíñîñíYy±Ï%mÁ·µ§Äh\Lyù
+Î PM¥$gAÍ§Gf®¡^{ñùx>ù%Ýâë'l
+-bBxÛHØ!)ñç
+á+]þ$J±Q-d'¶ùNikyXSØ[Q"Ò}ÃÉ³"¿*
+-õ¤|åQ*9ÿþ$²½ôú;
+®ðÄÇ³÷1ßW:à¹@/õ2s]K1eh¯¼
+ô(¦»ÙFT6O¦ºHî3
+D^/ÏÒd;Ó8à¸ q ³OÃøTÔ<U
+-üfèt0X{k()ü0´6rù-\¿»Á2y4ÿNÆ:ÇMPðw>O|®½_&
+ZÄ+XXÃ¦I§í~ðùFÂ©oVUYÇ5¬¦£6³ð¿4oûØ2>|N.LÄTÁÆ
+ú ÎJHàõYØjA)mM 2Õî§P¸ÓY0rïø»°Ö»g
+½¨Ý9åè0qA78øóp)éíÊ
+-s´Ñ²£cZ<ÿ5)úiU6!ç
+1×ºádUù!:SvÀÙn
+-xßî[Äç
+ÕlªOe½÷
+'ij®Pli
+Ñ9FCg÷=>ª½Â ê¦O&¾°_GÒe`¯(Í!³>5Ýq\ª}fÓ.2p6K¢Ynº¢²_h>Ø¨®Ð
+Iòù7Y«@x]^¨ù`gòaÎÖÉÕÂÊºÄïDç¾Fç·Òoí?{Tröy
+Þ=äÀúùW©¶I¶Ñ=Ü
+3È:ýåwJ9¾üîÌøZ-¿j4ö¸S#S]S
+-G?ML`æÈ:OôÃÏô¤¯´ò0<ÅOûlkOLèýª`}»*¼ÑWÁ£²í>ðilÑ:ÅÓ¸Ê6õV;Ölã¡p:³Ù¡Ep¶<,öÇÙ÷jÏN»¾|ù0y¢4Ø4~KæHcìo?ã½pMA;¿ñ
+-øöæÅ I®Ð
+-endstream
+-endobj
+-465 0 obj <<
+-/Type /Page
+-/Contents 466 0 R
+-/Resources 464 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 425 0 R
+-/Annots [ 454 0 R 455 0 R ]
+->> endobj
+-454 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [195.939 632.727 208.84 641.75]
+-/A << /S /GoTo /D (cite.Knuth73) >>
+->> endobj
+-455 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [223.179 616.451 230.626 629.352]
+-/A << /S /GoTo /D (equation.3.2) >>
+->> endobj
+-467 0 obj <<
+-/D [465 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-464 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F20 270 0 R /F21 371 0 R /F23 294 0 R /F51 272 0 R /F18 191 0 R /F22 461 0 R /F26 309 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-472 0 obj <<
+-/Length 2719      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚµYÝsÛ¸÷_¡Gªh|ì5¶×øæîáfÚx¦N¦C°Ät()ó×ß.¤HvìÞ]&H`	ìv»`³õÍ~¸øçõÅår3Îò|v}7+T^p53Næ\ºÙu5»Éd®çKÎËþå»úÓ\¬<À¯°ßÏRÊ¬½£ßw÷ÛzUðMeeSÅáf.\ö	ÿóÝÞÓìÕÜ©ìØ¬uÛìç®º¼âzÌ<g«ÄG¢
+¿¼Ò|L½Nò¥Ô¹3>:øfßâ¾]øøíõÅÇ
+\Íàc]äLËQ6WVÌV»lVÁäO3ËÂÍ>ÒÝLæÂJxÚÎÞ]üô6ÝKaÂZH6÷Êí{¦Ù¡\/vfQ-î_'ï`}i'.fKarÉ­w½©QßÆfñû-ðZ\À¨54êÂ¶Çòà+*·[z
+ta)Uþ=ãªsüg¶÷PxÈ+
+ïã:-ýV~Ýù¸¯ß7ô{;_ía)ëÎ
+-.ØÄàåZ«Þà½S¸Í
+ËÎ9¸ççF¢â)õ¹ÜÂü
+-]1±ãRq++«â5ôÆÆñ,íÛ§§²[w>C§\ÏÙ^	_R»\HÝSäó¥
+_Ï
+Ã¸Åv<ì3½
+6ýÖ«ßïé9
+Y
+Î@Ï«®öèßè¹ò¿ÍªnÖ
+YmMßûpØ@YÀ²búL¹î¸:
+;OM2¹u®ìtR|sè
+RÐ
+-ì?Ø1
+Ý~¼oèuÕßÆ£ ÚRJe?~4Or@LêM|íÃZÙ®þâcL»/»C]n~¬rqe)ÀU<»Oø
+íÂBl)tÔL®¾
+È®kÙq=ñO©°ûg8ÝÉ]
+Ï:!¸:0)þZ
+¿ueê8§T0¢ú\YùíÐ`s®'¡á7°
+Y/aýÁ%e<þ8¯	ÅÀÿÜL0-Îó¯û¼ÆLc§m*°&ç
+-µv¹Ð®÷æ%
+(rpj«íHÙ6vÖrçÄ3Ö¹¬àCèì¤0Ý£>ìÔf¢5
+ãf
+ÖÇ Ìx+
+ieÒÃúEÔ°±%y¾
+7µxÒÖ¢*d¼sf§Î:Q¯B|<½ao[rØ
+-Qó©íÜd»¤AÐÃY¤40ÈtU6¨J/È1¦¶#d×Ær?AjO!6GÃ!ÿF}¸n8þM1ÌyK3Ó¶K%	ò8¥àÒeUu1V
+-8 _ðL¥÷tâì°×ÜZÂaE1âóÆwþ,µô¹qí»¨¥®+)½&xØÆë÷ú%
+-ÐC#Å®ì35lå?
+Ë-m¢ñ_ô¶ñ{G_âLÐTLÿhÊm»nûíBÅYJì1ÃÃl¾cHULqí¹ÑÉâ
+ÿ>itûMË¢HX]¼ÒêK¦ ­©k@´m I>Ï
+ÑS¼Uèh¶`dQ¨lÕ^Ë°r 
+-Ç)
+<Ýþ@£Õ´$
+ÇÇºL¾:lê®ê¿¹°Ü7UCÃ8­ÓÕåíÖ§³.|4ß!viÎp¡(	ÛB`ÈÝê¹v
+-#Cí1>_Vp´ªáU"X
+-âÕ%Ö
+n+w>bÔGiß"<ç¡ô	a§\m{NØ²
+ü~	>
+¨¦~n
+CD
+
+-+¢`ðð[Ñga4\­xñ:
+mÅF&Zú¥2.2´÷ÅPÂoÛlú§ÇzJï7e³¦J!Jää·ÅÔìÆmEÄÝBE
+>VÚt¬,8¸,lJN©ÒéS
+ÕMæóuNû
+õl^ÒÏÝ±6:_Q
+-M,&Ã6&¥Ò¼LQÔO¹
+ÒE:ô
+ùMÝi0[°-ì©û
+LmÏT 
+yßX
+5AZÑê°XC=2W¹ZFã:XÛEãFô'¡^½éÂñePiÛQ
+-¬¸Éþ»ÁwjZúÝµ
+fé@	Ø(ÑÔ(	}0Xvq¶òûºëÙ§X
+-$>{$@_qæ÷¯.pÓP¬ò¡àÇUl÷@@
+|±F¬É}aò,|JpsêÄ½,s¸äÄºÁ÷®ó>Jf³sÛnq¿¨À¿'QµGÌ2á?Á9}Ò×8¾Çº¶Û%h\\ÃI¼¼$â>îP5CLãY7íbR~tüãä)
+-,çpä»¤#Hf¡ áC2sÿ»
+S7ÿ¿8Ë¸!ßß§ÅRAjñqª×È³©×¿ÍãÔy¥ñÐlL±+!¸!TIv
+u9EvÉÁ
+
+x³ûð):1 IôäIê ,*Å>È³Çû4&5 SÔYåDÈuN¡ ïÍ7í Ñ&l1ôàùrÄLTû
+;à
+OÏ5mn3
+]¼Rii²ûjËº¢f³;*SLHLfU¼EÚ®Ûèx ,yUü°íªþ1ú>ù×èK*ÝÐ
+ê$
+ *ÊÅ±4ç
+)¨p¤OUÀ¶¾
+{á bÓ
+RÃSì¢Ô ×¿U»]]VÀ¨áòP>lÛ.ßü-é}Ô¬å(kY@åY¯ã
+-1÷È@Ý¬¶Ç G|ë3RD~]¶Þ¶·X5âsär:~WèI¸zZ
+°®(ø<áÿ'Ä(°;ÓÓÇC»{`
+-üñ+ö>ðÈ²wty@3bZ@êû¥ÜÝo=M­ÈË+¿§÷ã> Q|ò²¬¤:ê_ÖZó©uÑCzõäw\UYJÆJ¹S2ÆÑ»ö×^8
+|Bõ:V½ìsLÔ	ÅÓ{*ÿ>Y@ÉÜZ>ÃíÆtM!ÀCND¡ùÿÒ%Gõ§OC
+¹àçýý#©®zÚ
+ÕL93r\fy²Ý
+
+¥ªÑÀåöÃi"gùÄ$Ð ¥
+$LP¨D±6j îÛñ&:Þh	|
+%§@`©ÆßÑ¥&¼Ñ¥&7HL_Ð¥&
+^Íç/5YÚÚ¾v1>
+c,Ûö÷yÂ`5ð¦Êï«==V=LG¼þ8!I(ýóÉü.¸út!ÑRPNoÒ<#Òm±1@ýq.@«ÿI4)!ìÃ*4ËÆèèÑjFA©?¢£ÄET&ZDP
+-ÝaNWØ
+dwcCÞ!X8ã¦îÚÃ¤x?'_ ¶SnûÒD@£ÿ5HMï!äpjß3Æ
+Ã¹sTzÞSËÐ½OêgÊíÚßv%äRÚÃþàwÓ»2l>>yÃ»<çV_gcüôí>9Þ.©¾&Ë'år´
+ÔÌü1KÙOÊ\Åïb@
+-èÝcu¨ûîÔ_<ïÀåüÔêøúâ
+÷­{R\ñ}¸çÍ¾Ã¨I_ùq¬a§êL(ÐÆvÅ ¿&}gn\FdIV±o¯/~ä{
+-endstream
+-endobj
+-471 0 obj <<
+-/Type /Page
+-/Contents 472 0 R
+-/Resources 470 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 474 0 R
+-/Annots [ 463 0 R 469 0 R ]
+->> endobj
+-463 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [317.771 617.248 325.218 630.149]
+-/A << /S /GoTo /D (equation.3.2) >>
+->> endobj
+-469 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [298.567 200.55 354.396 213.451]
+-/A << /S /GoTo /D (subsection.8.3) >>
+->> endobj
+-473 0 obj <<
+-/D [471 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-78 0 obj <<
+-/D [471 0 R /XYZ 94.914 159.899 null]
+->> endobj
+-470 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F20 270 0 R /F18 191 0 R /F26 309 0 R /F21 371 0 R /F19 195 0 R /F49 256 0 R /F17 190 0 R /F23 294 0 R /F24 308 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-478 0 obj <<
+-/Length 3590      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚí[KsÜ6¾ëWÌÞ8
+-'A&C¶ÖNJe³v«¶d¨JCC*$G²ôë· 	$[IöøÂ îF÷× ²¸^Å÷'??yõÊ%aBº8¿Z$"L¨XD1)çÅEÀÙòýù¯ÞxØÅQ³:2+J	^wößÕù?Wÿ>{½\qÎüúö?¯=Ã.N
+x:êªëlÅeGÒtùsÚîë´(î1N+Ð ÝfFF
+DIHHÔÉR&
+¼°-Òúz¿ËÊ%¶cTWÞE(ê~ö½¯cJÃH~ì,ÛËª57x	2ópÖmÞæUÙ5ËKsm·¹¤Î®÷EZ«´ÙBk|`AZ.i°1÷wK×é]ÞlQ´ÅJFÁ
+-¥HLmµ\	7u
+?ºÍ7ð;AIðP}Ê/ó"oñË½iwUÕæ&5ÍÖÖÔ­
+±Ì­ÞÌ·&+²u«%Ä_õuÆN,â!ájb(ÆÇ¬7Ô;ð)_G t±®ÕÎ4ã&"$Î.m½GòEaäÜ8/7Ù±Üõ
+Ý.¥¿ÉÓË"kB£mÎ@ÛId´m½ö§¬õ
+-1ï=ôßÄ)Ýô3¯¯PÅ½°oÉàWÛ0^¨0Q¤Ó!üP¼Ó¢ì´H­xÈ1µ
+4:
+bØIÊ8b$
+-ßw"©g b3©G¸øbÕO»_x<"èËx!>ÍsJ§	7Ñ
+NI/%5ýíÒ¶Î?ûv¶æî&_£ë|lÌcµo»Ycåqþkº4°­jÚ]Þ]¶í¦³®ý®´k+¢µo¹Þ¡<û65K3.U¼âR
+á¦//ü«FÜòý¸á¡± Ú
+-0Fpú£þ|ìmãd1ê½ÏÆQèÄÜÚâÎ¼­­±v¤V¯[[!DE!ómVï±nÄ!ïE^fÀð±¹oÚlçó¦U6ýI(Á«æSl
+J¥Óô:§èçùà|¤­Qð-^dàí
+
+=þ¸òÄ?Äg³ogrtPäÓ7¾^VLÂb¹UEbÛW?õêçÊ!|÷cº®.ó´<ÅÇ$¸ÛfufR¶m`-ùî¦ÀP²Æ £c
+ôuµ/×]pÐm«Ì¦îó¬Ø4^õ ^äá{T¬_	£	Ä0(1
+×Â¶>P|ò
+÷:µéY°8Lä8
+þëìÔ¸&@(X¯Ý¥ ¡/§
+ÁØ¤Î[/¡
+Ö,<f¦ï73¾Ë×e*îý+HP
+*dïcþ
+
+-Lþõç
+-Û(D¥!¦¯·ñlÁ
+ð"c!Ô-Ýd¹_ L"ôB½*à1Ñ
+-'iCÁøC
+-zS>pÅc³¸H¤Ð³âÉLx¦e-p>ÄÄL ¢L
+±¡Ñyg2
+-ø
+·Q;ª8Þ(AÃ$ânX?¶"Bº°¹âÍQòT
+"FäÆ7´UD}ðaÎ!
+p&Öç^K@²à A;¿ËP/Ê?BOAì1qã_Û1¼pý.o·^µKwêhW	ø<úvãåô	åue7S
+¨Ä%HñIðs
+ÿÃ?VÍ¶æAfu®ySgû[
+-oµÉÞWu~ia^ëTºÎ[³,éy4^æ]bÕ?ÑI»H]Â³5.¿@YéÔÐ%Gs`&´w´ÜxÍHA¿É£	$ìÒHwT dÎZ×2Ã)ù'R"/#Ù³sd,g
+# ÊØ¯S
+øÀhcwS§`Z'çP ÄÊèy¨þÅØ-Ðs²]O1pÖAhÆ5Q³dúÁR+3ø#rB(Lc8ÕÞÖ
+-xoFºìÀCäSÌËkß 	ÔÅ
+]®5¢GWë(bïfÔLI/ª.MµB 
+fæÞÇÌ4æ
+k0Ã&
+-2¨£	^êjÜRZKü.®µâ$à}ê¨#ªï5ñµgóá
+²µÅ
+Ä÷n£hXs©¿Í¨ÎUÏM(ÓuÈx0 a P7kQiý®5-k¾
+¸ÁºÍ/Ê0ÚÜôj5×ú2ok0hZÛ6¦=t;ÞÑÞÔ5PL ÄaîñçøþÔ
+|à
+-.0ôQD³K&è¨æ &¤Å>m;N«(ÌÍ&«sC(µÖ§;æÉ[OQ¬¼pþ<L}Lîy,I
+!ï4éi$¢gQg]×ëH«¼ub©MrätZJ²G§õ9³AW¨h8«>ô"{ÄÐÛqææª*
+-TlXÆBBL2H]íÛ¼Ì¾
+m­¸-@QC
+µ*¸mlKªÛ*ß7/ou&Ç^^üvVµB
+-é'0
+
+ëÝÉÅ{²ØÀÇ°àÕnºCIáÊ*g'ÿ2ûJãái
+¤@ìKtª pÕè
+úppF¡¢Ó½Äà°Ä`Ðh<xv5Úôú´<ÝÞ>:NÏ\±¢ËxB«6[Ó®5A3ö
+:ôWTbÄ2¿zeé×ô¦§©Ñ:q© Íß*ÖX5Óªën
+*ÊÖpÏA¸×
+1ÂQÍÐ 
+ÓÄ¾ºñÃr
+°¹"ÏÉ½yÜÛüz5Ví6F.vï¯ëÌOáðÖC
+6~q 
+5Þâé¥½yq-oòÚ`¾ýBå$©
+(C÷kØT{qòýs7/ö:§
+dõï¡Î
+ì^Ù\Â$;N@p¨¦(]­P~\àò{ÑäZ§ÏÞi$Ùµ;¬ýàO_ÔåB¹ ÷IæÂðàÏ\rÈÌ|ò6ápÅ¼BÎÀ°7Ï½``
+-v»¤g35
+9î?
+-óÌ¹!#ÔÄ¾ÐË ºlÓ\oã§Ü)(
+ôãªq²8`ÝiH
+@Ok;hö	
+-4]ôÀ m'Jîì©nA+ÓÄ1Â2Ø¦V<ÌÒ7:P´Mü"óhòÄH}Q:
+0%v%ËfÞÝmò_zæÁ@Óª÷oH`~´T§¾ýÅÊT­3Dã3}Mí£NrFµúýÖ¾Éº õeG1¡fØnXmèðÙt]Â»
+
+_	C
+ç0ÍógìÜ¼ñÈdÐ!Q8ØLç:CK"¯<êê	Äû½QbL¬p·5ÛÕ[óXöçn|D6Ä0î231ñq
+BÙÈgñx±àç
+-+ Á¤­PàÙoÌÃLýÃ~
+pÖ¥+*ôo=n5uSíR<Êc×qZ~¼-7ùm¾Ù5
+ªq{u²S54zñBa~;»èJGè©>Ã
+¼Àt½ÎC-¶Ém
+ªjó®ø6¦ihyOÓÊ2úó:mìûMÖ¬ëÜ*HGIPÚh"©ùX¹kH 3	WcJæ-öHWhôs9ðÓ
+ÀFÝ `Ø/Zß¾0
+-æÝîÿlÁAÂOR¿¨æ3a_ªÒÇtþ"sä ´M,z+ì
+-¹×;ÄàoÛî
+-~0nõ v7æÃÌÊiH\Æ|¡E°Wc/êØLy6@>²kL±¬vùÛ
+¸áîÂ7Va¨ÀkW»Ã S± ûm?Ï*8þûÙ{ÄÅ3VDüûÈx2¢ì1 5Ú
+õåºA+ËÞ
+|5ÃÞÊ§û^Ë;
+· Ùiú
+ÌY×æVnU½±v·ÇM¶C':ö±$ó.µ×ARÅG½`ðfÄv
+¹ÃºIc®ä xVÛ0§­>4:hqm3ýáå,
+-¸
+ ÿC-
+=Éâ³xhbËy§*Kp<ûbL" @Fº°D¼Ø#- 6á=ÕjèSødàNÂô):]÷¤µ÷røúø*¡
+2K+ó¶É+3.-`´¦*n
+-,Ntô¤ ½i³]cÞk
+õÙ)Ï
+7]hñÑ
+$¤üsöÖ¸z£^	0±Q¬=÷úlÌè
+²
+Ï
+Z6
+nt
+-C.7Ç¦ñÛ}c£qj.ËÁÔ	ð	qªuúQ¯qüP¹
+U|om;uªçZYïb
+ÔÀ
+êAâtí)êÀ!ÊÈ³ÉUuÏ1RÝWiÐwfª:æ2Ûéyõ¦PH=Olq­Ý1P<ÝñÏþÖ°, ÏöÑ¤ÕìV¥ý´o²«}aîÍÓÓ"Û×6J6G`ßwZJíaB¤¸=jeïÏ7Y=9®jiòØÐäæµ¹Æ
+³a<4³ôQ!Uj|æî{O3ç¡A>5È½TT¥þ~&ÚÓ1Þc¬¦sÙËwÉ_¾Kñät²\%ûáL&Ñ8<J"ÚY¬ %Ä
+-6µ¼9&Íô?èV_Íì'$y)o¯Ki}
+¤8²AÿRpÿ>
+Ìî¡Ä=ge±¿VÖÿíÊÒS#6s X78C2gñ¹xOúGzÂG]þó<ã[_gðÿßö± Å³»®{`Èÿ ù_+
+-endstream
+-endobj
+-477 0 obj <<
+-/Type /Page
+-/Contents 478 0 R
+-/Resources 476 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 474 0 R
+-/Annots [ 475 0 R ]
+->> endobj
+-475 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 133.883 148.032 145.573]
+-/A << /S /GoTo /D (subsection.3.1) >>
+->> endobj
+-479 0 obj <<
+-/D [477 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-480 0 obj <<
+-/D [477 0 R /XYZ 219.854 565.55 null]
+->> endobj
+-476 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F20 270 0 R /F23 294 0 R /F50 271 0 R /F18 191 0 R /F21 371 0 R /F24 308 0 R /F26 309 0 R /F51 272 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-484 0 obj <<
+-/Length 3197      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ½ZÛÛ¸}¯Ð#'kÑÄì:UÙd½µ©JjÏÛ¬+Å9z)Q!©¹}}N£AR¤¡ñ¸Êµ/"6@£/§VÛU´úùâÇ«·ï
+Y(Ì¢L¬®nWF0KÍ*NU(Tºº*V×R¯þq¹a«µ"±Z+¦±aª«»òr-ã((ÿwÌûªÙw4êí{Ngahð±c~fùÒÐ$é@ñ[d"
+J-¢g£NØ¬.Iwüx­EÙmÚêú·ü÷!öRPjlífÏýº¿ÄïÃ¥L²ÜÏFÁßò¶/»*wýÏ4hÚ¢ÚçøÀ½ç¶&3
+¦"]n.]%aDnoQ¢VkÆ*a*áR¢Ôêê{l'N¼,³0bÆRú¤úK'Yì'ß4ê%¡ÌThtÆtN6:8°,ê¼åwpôYá(3óu²Qçd#¿B6rÆRôÉFÕN
+-&8ÔP§_á%YTð¯éá
+-+hw<8IuNp¬k<<oË1zû²-»¾,ÎLVmuiâ |o¹t|RBPG³ãæË$¦FWn
+-ÚêD±}g#Ò0£U>yGé%Ïw.É,¨c¢zçOI|Iôl:éNÈÓÙrÞîjÚÃÛ
+¡Ä|ÆÔ°~ÆlèlîtÊí5÷(
+M~IjÙk¶	ý:©½Ö»Ä/¨ûRjUç
+ ¨h²Bþr­	úÆ=IÊÔhÐj©½µúqDÐ_Rû*¿©Kod±ÂFí{ôl,¥2_Ö¾$L²øËrd2_%Fáw*ÍÚçÓÕ«¯ÛüC·§^v¼.ìÇ[±±öþ2uÃöNðË¦9Ö7k8~g¥ÐBé¹ÒuÕîP?½
+-êêwö §`fx¾}oÄ<Î@}% tÜrºµÞ¹eVä>½ßÓ>ùäg¢PQ`Å
+$ãÐ§ï¾c"TÁóõ§nl2ÃQq¨àr&ªãÅ
+F§øÎ»ªldÏÌ÷½
+Fq¬fÁa{->²ÞñÞÑñ'úùîùZRK~\?_+j)Ç(É$3¦#y>_ë¼qú¶æq~û+áÂ4pÌ7ÎöùèÌy¹SiÈ·[N8°v"çó²0½×¬'þE),bÌúe¹,ÎÐN(	ÐXÓU.0!ª>¶@?2íÈÇTP§#Ì½óÄÉd¶ÂWð"§¢$(»
+¹'~ÍÛíq÷Øwä/áí~!êÁ;Zvw=¨«½cÅÞ.&6¢£Ú%c-æÎ_Îbë|wk!ÏªÜbQeêK`8Úè¤A
+Vr./»¼°Á!"Oû<Ö}¾/cg=(x«é°ÕÔnUQfÉ;¦Úû²(Þoù=wLÁSuO Ö;n÷w¹c³a¼ZÇ"Tftnxfö`
+Ðï
+vç¬²·­b%ÌV»Æ
+("© (w7@^R6hÍÉ6;ÏÖ+ó¾à(Ê²0
+ûi¡-teé°Ëû¶zt[/FMç -¡,ÿ®*ð«ï¼Fò-lYÆKr  µ©
+<ô"5P:Ør6 ¨u&eïÐü 7Olfâr¹ q®$¢±ÊÆ©3êÀÅ­O®¥°ôÑ«}p$â@!I 4"í*(^Ha ººo/ÖóÂzY¬îM|µXXÔ\¬öúw¥ iíÐD8Ò_[Íî«ÂfÀÉù&ÊÙ
+ãÊ¦õù¡Ì©*I3Sñ~ª'AFØUp{¡ùlêm=½#?­	áÕ"Ìê!xß4;×µw¬
+©VÅe ÐÒ> @õsðûPq4¤¦Õè	ÑGKU&sÃQ©kïÞ¸ßá^à]Ù±PÿÑÒ~SÌY¼ÂDâ0	Ø{wnM
+öUw?g ¯UlòºvëmüXiíT4«ö÷eÛ1Ôÿéêâ¡s+hØ¥\©ÅÄ«Íîâúc´*ðº®
+,én¥B­zõáâß\,Ï©¤R@Æ*ÉÂÔ¸ô¡s©ÂgÊ
+ó-&7tâq2¼¼Ïk¯Ýh¸iæX~È×?ó\PS`ï=ÃË;k¥e ßx¹i,o!AN'çI<Ø:×¿jØä ~¾É0ç
+sU­
+-}xy¨¬V%"xªÊÚu²æ£A¹cµ©z¦pE4sRD{/©äEÀº e 'ÀS+ÉrÝ¥fô6wy7Ub
+¸ôB
+-J¥u0N7¹­Ú¾Öw ¸ëKGÔÅ%>ªKÉHì\Õ8mB`¼Úì>U§
+¶
+]ñ,r¥úè^·N|ÃyÍ`û±6lûDQ>æ8	û"ÈûrºOEùè
+
+AéCAÊä\ü¦ïF¦3ÆÛíq?`%
+µMínMà/ÍMy;¢òyY
+jI
+¤G»{²ÎídÜ½³[ûâìáXó%-§Á/NRÃÁÏÙ
+í½ûÀ'uuê
+oºÒuâè½5È8Ltòâ}J
+-
+2øcÔlv®P§\å£çtÉ°(°zß
+ë'wÀ:Jæbr%°W[`;ÎÃ(·ú
+®¿hÔ=ÏM4ÖÚî}ùè¸qiRûßËß"¡Ö}Í^×¡],L3S´Ô,429¹ÓaDP·Tkè*ZgmÇ
+VZLÜô;\Þ§BçKÏ~`{W"	j¹Õé!$CT§'xgÆsû!/zó¦ÇÔoûü©nÚðî/~ÐzºA
+®ÍV÷×}6§r^¥Ü66ÒäX+G9¬]il
+n³sÍý¦>ÓøÁ|Æ¶nnØ¬O¹È$ d4]ÀþÙy
+±
+kkùq=9àTÎ/KúÙ¡µyØl©½¤Á1óÂ WÀÀ&Ñàô·m¾ë¼'iR%ÂÁèpsðU
+Ûxãã	µõM3ÞÁc	QÇa,Ð:
+æÔxymµÝí9Î1
+PL£ScO1{ÿä(hã
+-8v8â¢"ñçõÇ>Öxj¤Fquw|ÇÓ»u 
+2(JåÂ;ûÏ§\Â,¹	¸18$Â
+-6@Å±¥ËN"!{ç¢¨fº
+&ÝazI
+è5
+îæ5R!MðcÞÙàïä\`çB
+°@n8dc÷öÈò¶àNöhü§ÄxX m;þI^ Op'cCyÿ{ù9c§«ßÓ½&ÀÒÃåpÕZÏH©ÙBÑÀ¼ªé¶½
+$D9sDe÷D¢"×
+aò
+Z®ÆLè<xiåÈÄ^1YPÇ§pß9GÃÈ!ÏWZÃ¢lÍMLãßpaíôÎËm "UöüÚöt1§}_ºþ#"]Ûõ¹­î8ÆÃ]0
+-À'Ðt¡lb5æoÃ_
+N=ñ¡ÀrOî6Æ
+îJçÝ\dÍ74íïÛ¶ÁÎG¾y>®"ÉaO
+I·+{«ªx/7å¸"8ÓØ Ú}fã@
+Ü
+-
+)()õuáñ§þv?©Å©é¯P©DªSåM$ä§¦\J%:·aç-2`÷,[Hº*ßxçÒ#·Ûü¦óÎ)ÂtrWÎ:a ¶CZæsÙ6$Uáôú8©FÃUËM»
+-;l¶6ã­d«.Ú
+ÆôdýáþgBe\öLRµÃ_E1r)S«=i6©Ã;ÐÇaA´@zoËÚùZ=¡¾ÅrndPíÇ_¼LÁÀÅÆËÛÖeÅâ´Ì=¯9ö¯A¸Ôòtf^#Gí
+-nWªtL¾ëH(ÕÏñÓeé6ZX#÷gþ¼¥^óß-õ¢hé&[Ïÿ»EÛ£¢UÆXï·ù¦çVµx[_MâÈ!êv( &ÿ -¬^Åfô ÄÏæDDnæØg{Sõ-3Ï®ººø?Ãc®æ
+-endstream
+-endobj
+-483 0 obj <<
+-/Type /Page
+-/Contents 484 0 R
+-/Resources 482 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 474 0 R
+-/Annots [ 481 0 R ]
+->> endobj
+-481 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [173.592 261.762 227.967 274.663]
+-/A << /S /GoTo /D (subsection.8.3) >>
+->> endobj
+-485 0 obj <<
+-/D [483 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-82 0 obj <<
+-/D [483 0 R /XYZ 94.914 219.796 null]
+->> endobj
+-482 0 obj <<
+-/Font << /F15 193 0 R /F20 270 0 R /F18 191 0 R /F51 272 0 R /F57 279 0 R /F46 194 0 R /F26 309 0 R /F21 371 0 R /F49 256 0 R /F17 190 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-488 0 obj <<
+-/Length 3203      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÝ[ÝÛ¶¿¿BÉ5±|LÆ3qj;u§­ÛóMÛ8´Ä;ÑÈ3Iå|ýë»
+©%Ê9{Ò¾H`Åîo¿pdv3#³.~¼ºøö%3Jâ$tvu=KDP1SÇÙÕjösÄÅü«?}ûR%¹0¥ó%D?>{óêóç<z~ùê/.ßà^Î^_º«?¾pÐª±Rýþ²èÙås÷Á³¿>w4/pÿÁ_^?¹ ~
+ë_øe-¸nqëüf=_B£UVå¿Î¥Ò~aIYí:Êk÷Û¬3÷àz°­¨Cå¯wÅ²ÉËÂqþÜÔ$±JLËf¸>Êb´ß
+FÑ13
+Å«92ºôt:MÜ@$æÏxÈÄÑ¶kâSM¢{2ýUpí2¦Ê|Ê´ÛmrÅó®²·"[9F¾CþÞ0=]¶ÇâÞëÌ2;/Ð !CL7[0kRÉlAy,
+ÂN ã Dy¿2ÚuãZpj0ô¯(sYgöÍ÷5¥£^eõ²ÊßÍHãÒvÄe¹½Ý5YK$ìÈ
+?bVm}Ê6í
+-ÿI§í8Ws#¢t¿Ã½·)/»ÙÇÛ´¨	õø&ÑÝ:_âk|ÅÁ2÷ÐT ¦ 0ôÊw]Ã"|çÚRI«
+-å´>ÜDÛ~SeYHL8£±R¼UèìÈxfúÉrX^Ý_çU»ÊVÜ2È0ç$ÖF
+OxWgH"úsÖYâ
+X)
+Á>Ö©bÆe»Î·DÐp"fu	
+-".z£Ð¢Ö¾§b4 ZÀ\04Wþ258kÔ,¦¹£úW`0KøjÁx,¼ ½÷7=*
+Ó-þi°
+ªþ£Ü
+Ìç¹ éàz0ß!;¹a³
+U
+8Ê D
+.x*-ztA<Mb|Ûð
+
+EIeAg*JöV·À5P¨Á
+PE+GÐCML
+óÏo¡´(¯ÐiÑélVSVîýÌDåæ¾(·yºq¡à·ÃznRû
+`KPï6A `BÅérÔ° ê0`ã3Fyñ¨øÜD¯üúKØßç
+î»¬VéÀÑ{MÅ1
+ø),àÉ 
+ìòöVÅÛ	<7rÅó!ÊÝ¦ÍÚù;yÐÑà&¦{¶|pØLmõmZ¥Û
+¬Gþ
+Ó°wÖFÙ« ðÙt¾xü¾²âÞ	´³-KÇ,°èjÙ3ÕÐåì7Êx
+vÂbC
+<¡&:2=²§öà¨¶x¨ãÖI¶úzñâêâÃ¢
+-¬iÆÀ&BÌ$ET³åöâç_Èl`åcMwt;¨3Ù¿;¿ü@ïÚ±·È>¾bpäh§~_¨ ¸¡<d(?9ÄÁíIÅû[ä
+
+Ì	[é4Mí±¬¿Çæ
+pPé3öIÒ#&GÆRk4<=3p. 
+¸<nCÍÞqm}?8 ÃÍjõk¢»ÐV|+zDCOà ´b
+t #ñ2aÝOftTçÛÛÍ=>gYl#X|öÎ¦
+xÌØîqÐÔêØp}µ?g
+~ë`3
+(úeWùM)xrÒ£sömäS
+7LDYâgÀ­êÆ½4{ÎÎ¹~ZVÖ¹¬ü Bt=ó1 Ù©9ëãá÷°¥CR
+- Éc²Ã èÇÌ,@u[j²óÅ&X=
+­Þ2EÏB¢­[ø`HG×»tã
+-!t¦µkoF7
+@g°¿ðË]åå}gc4ìkü·kßð.­ý4·6æ,s?TÈõJ$l
+jÄñ3
+j2áÀ¦ah)MTeµó³. ;öÎ
+-è$ÑCQú[UÚ¨:_YiåB¾Pb à±SÙµ÷Ãò°§Ö¬
+@õOM¾u±¹j3 
+-2YG»rçBR!p!Á*ãYå
+ë#o@Ý\>AE×åfcw|ç½®Êm»ñÌÏcãóÔ¥TTí6Ù5ÀB"l =à¥ Ý¾mzã½#ë
+Ä¹|)¸{Z|>³6-È=X·µXÇ¤ÀGLÏõ/i
+
+ ØÁp9{ûxñ¦xEÊcI9Ä=:d
+D`âUK×N(ÓM]:¬·Î=/Û0Åa
+<¬SO<Æo
+-[êIÉ*|þtgò
+-ÌÄXäÙÞL/ñ9/@@+L''÷ö¢$ÛàÃÄ­ ÜÆ¹±ïXìf)ÌÇ¤3c.¾ À³}'îäù(¶/¨ølÑt)õt®Ï&!Lxò	 qi5ýi5úØyµ1Ù3¡0u,¯¦æÕD$Þ
+À´)Ùj`Xá±Ýâë°+öI¶g$(Ñç7l½|CG
+£|Á\ÓwÁÁÆMs*³±ðAç3
+| DHu÷
+->I}ØeÅ2s
+-¶¥}zN
+½	lGo´RR
+M;ª´ðß¿«³ª+¢´Ný4K}å S-Ñ½{}
+z_R÷a0¯Ý:vEþaç
+
+<Ü{+ï^JÊ`>QÏÖX/
+-@h
+AØ6/RS
+ ²$qÊ"0¦ú0<Nä!Nh
+=ª»<ìÌ1Ññ>'Uµé	
+#¾±¤-;
+ò©8Qµ¾fÕäËKïÚôaeÆ&é¼h
+  tø¨ 6P×
+¨é#aµâ}ö==½çQò, :[é±ÕÀ
+C
+01
+ Ñ3,ÏÃ-úÈÜÞOgÕ+HwUlù nñ»àk008>aø|R ãÄ­LL:aúbì|Ôãv>òñÎGM:õxçsÔÛÕóS0
+ ±õÄ¼Nb
+-Î@[u$i-ÁÏÃõ£Û¡$ú ÉÇ_ÅJ¢
+-q¸$áSWO}éÓ=S¦¥ÏëÀ[Ósêå=ÌbQÉØè³ ÿ. YMfö¥¡ù¤p)ü¤CsB2§´íÿÕÖ=pÚXlúáLÂeP¦¦0±#ö[¹\««1`Ët(*#.+7Éÿ°ò}>Yùìc¦ýUB}Õï¶:eT8_P,Åb]£¶¸ÈDwUÞäÅ{Y¶ç»|¨i¢Mj/Ôñ$@>Å
+µÿ¸0ïO¶%ÝTYºº÷Cg|¹6ik
+-ýIvX
+r½Û´©òÞeÞµÁ6n.Ê&õw'Ao¢W¸Bb\2$~ikýw±ß1í¥=ÒNô6~Þmñ¯¯UÂ^nö¾ãàs/»ÊåÝ­{Áã[ÊE}¿ÅéÝµËr/¿väÙÇÛ*«¡íÕËG×6	¬]U-¤ßðÙþ¶ÌÄÆ±ÆbNÊxøþ®§ðw=Û<æ]7t3-É¾Ð1K¡ûËÀ×5ý
+-U¾¨1a_Fªé£NßöiíµÛ°'·xË´ùº½H²ëÐ
+wëÐ'næáÃ ,[ÁàGS+p®ýôHj
+Ç:,­:ÿí¦êª©NñiTùÌ>¦·ùjsïÆ¶
+-gåu4Ãëõ$²jvEÚøJîÌø¶®s¿0Ð1_+º¢çÆõ´;À"¾¯Êî¾ÀøRf¢mI¯_ì+>¼ÕüMwM	ð/Ýëz+"
+Þéf­Û|aå
+ð#w!#A
+,|æÏ6;%´³T¢.·ÙÚíÂ¯c{
+ð7ÿÑ²tf!é×=\í
+ðÖg{u¯Ò×Í«=üc
+-rgè
+Q-?ý
+KglÆÊJ°%Ý´­[ú	M»0ä*¾U´W(C`ÓRü
+´·©Î4´C2kz»[!ã¯ú.Ð$õîÝð\O7÷À¬'S Ëþj9¦0«î(öb,Ôëö>å@ÔÛY±¿{Þgtû/
+A
+Ó4´
+-$8Çª6Ç2åX1<7.ü
+-Ó	[Q
+ºìpï&Þ:å2òÀ·Ó®OÍ
+xBëiLó¯Ê¿X9$UúeýhcþG¡ä Öø~ð¯Qí/Xÿ¼¼L
+-endstream
+-endobj
+-487 0 obj <<
+-/Type /Page
+-/Contents 488 0 R
+-/Resources 486 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 474 0 R
+->> endobj
+-489 0 obj <<
+-/D [487 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-490 0 obj <<
+-/D [487 0 R /XYZ 141.823 620.174 null]
+->> endobj
+-491 0 obj <<
+-/D [487 0 R /XYZ 170.672 453.75 null]
+->> endobj
+-492 0 obj <<
+-/D [487 0 R /XYZ 491.846 420.595 null]
+->> endobj
+-493 0 obj <<
+-/D [487 0 R /XYZ 512.955 278.38 null]
+->> endobj
+-486 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F20 270 0 R /F21 371 0 R /F23 294 0 R /F26 309 0 R /F18 191 0 R /F24 308 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-497 0 obj <<
+-/Length 3095      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÝ[[oÛ8~Ï¯ð£ÞIM1ÀÎ^:bÅbóÖöA±DSÛreyÚÌ¯sHJÚS7{yDSÔ!ÏÇs'C':ùùê/·W7o0JR²ÉíýD1ER«&Ú
+-ÂÜ.&ï§BÍ>Þ¾»¢á³I"9#Ô°I"±ZùQÙz1KÓú1/*lÊébÆ¦ù,aÓ
+-Åo3¥¦Y
+-On§ùÖÞâkèÜÞ?µûF±È×8².êFÃnÞrÚ]-ã(\ç$Â¯ãÏ³DééSÏ&¤úá©'	#Zh?øWÇÙßo¯>_1`¨O8D",%É|uõþ#,àå»	%>ýâ®&LX4_ýËãÙ_!SO4Mdº»Â¯±rXè­°ðÃúÛdÖrÆR?êÇ8<Ä0$/%{)60Lv	b­ÝÒ)MÕÍ"°£ðå¨ô8¾ú¾Ì
+ÇÆðeä{À(Ö²úS
+KeCÕôP
+.Zsu¦ú@-[.EC*&\¨JC:Fðîo@µ#ÃögçÐüÚ?Lóxã;c$@ýNò<yk£"µn¬ë/ÁdRJæØ J`;1Ì·uv·,¶ùÂÐbí_¼çÉ,RNo­÷TäËEø°·ÉªºïYW0ÂÁ\'hãÞ3	Ã-3ÒxMG
+úÚÌ@I
+-ð­È:ØâcæÒ çê:·Ä$,ãbÚlIª,*3?¦ËàðÆH`tLb¦!6
+
+S¶WGI%"½0
+-±ÃF¦¯J"yXný"¸4´^ªHâåòNQ
+-bo:tü¹]y
+äí]=ÝÛQ0p,Ê#³A¬iì
+;æ>ùH÷y¿½«3
+¯0aJpv,;G
+-õiû±KÙ'êÒháq»}<{}Ò§íÓEi½vÔ<æ|û¤OÚ§KàÒÐ
+-gµí¸ }¬}:¶
+{û¤/dB&M£Ú M¹7PêrJ2Pú¸zABqÀÐ	sâV§Jya}¦ tQg2bå%
+-ÝP/K u,âðôâúÌ_GåH}ÿûú| Q¦twÂ?¹
+öÀí9\Ñ#S©²9ÈÎ©®pòÛh\´âøæö÷ö@ì*l:zsOb-Çm®»¹üÆú4}á7ð
+-Ógþ±ù4¤éeìÿdÏ±oæë/H§Äë¦S¯hÞ.OcÞ#Ú7Ó1oÏuÍ3=hTìåÊ«C*ÌbFEt'
+·x>~{FyÉ,@í´é8é}ZR
+Ó¡Ïð>Uï{Ü¹ßÁ!#¥ÿ7*xÂ	ÿ*Z	gâãJ6©
+-þÁYFÁY°Ààj,
+ÛøÞ>æ±Y8d´Ý·U"g^@~Àê
+ÍQë¨4Qbõ~®¬®yüTVJ"©:u*æ<1ÄO1B
+-=cgP8
+-ú]
+øÑrðã,ÅO­@Ûq#ÑbaJÒëY"f[§zÍëÝ
+~/O¾Ãh§jz;³báöÓ²¬üËy9Kð8üez^ï­_Þ¼Ëæå]­ýQ3Öã@ÚL
+¢²ÉêÇ¨¬hb©9å&Â¥¢'Ë¤agù Õ·xèèdêøé[*Ò¸)ÖØTvzû1Ç5v@4
+-<MÃ'bC
+¿yoÃMU¬²ªÀÝt¬¹ÿb^O¾Ö]Rð¬Å:«Âw¶X´·!\#ÜoÈ~CtY?óÏ»¬.Êu8è
+·,üÕÅ|OÊ[>äwUVÌÃÁbC
+x¨3m+
+´ëçp/Ù£<°G±lã%Ô÷;æ ;
+ã@ÚÃ¾ëÖ3ÇÉ@è18 ò1¡ÿKÓ¡
+-NgÆ¯qÏ$l/[qZîÙýÞ-ëbý[áÄ²Vác÷'°c'a5.:E­öå`WxF
+4f7¾
+-ïÞ¸`®±^ô4Ç
+OïqÀ¹¿Ô³ñrgÖî=8ßÎ6ª·¾cfEYi]ú.oÝ ñÓßþùä¯¾}_V_Ë¬
+-TW^hal±Ú,óÄãe(1|`WA¬Ý 2
+ëæö43b»Ê½WÛÜZ¡ ã¬ÆÍcÜ¬}Òd©vC¶ÀaVùvCp¿§=a¸vêW
+
+-ºi6}¦
+-"ÙÇÞþºC
+/Êuèª«Ýz
+¶~Ãèp
+ìzÝ[%wÿ
+-Ú÷U¹òDü>@×!S, 	æ}mìÄ]r>.í
+-#.qpyêúÌâ@6ÎºÑOÓ'àsCN{YLÄÅ0ÑG1ÄºªÊ»Dr¬]ô5Îi`:Hý¼vÒæ½`kX×@£/øÐÑ|øÙ|
+­¥`O-æ:RÈ»Ú(t!àaÀ«YT§ ÂüÛÝ
+ûØè(
+ü
+DyÞ¤che±F
+-¹öxð	1C^ù&
+- ×
+
+Ób7ÏCßchTù2Û;^ìh
+-
+ûÁàcôgfÊù®ªòEw|ÿQÇï÷>.ÚT¹7}¤kÁ~	0¨X^ûX¥5ìxC©ò«)Þµ×JçÍ[Åzêq
+-ÄÛÆ
+¶X×Òïå6vª
+-Òª5» vÏ2wÚ6s¢~æÞiåÎ´KYc¢qõAZQ°«Ú
+:{¸
+ë\ÆõZ×Ôçë¯×OÛ_r¡<zu{åË
+©Ø²o¢B)9Qi«ß77áêì~Ëöh!RÅ8QÎÝ¦yj}F\oY-Î«sà&Ü­¡;ç:CÀë^:½wÂÖ¹n®øú~K@´p·<páWK¢µd¼n¬YÏ³¶Ì¬/ÎL±~9;Þey÷
+Ö
+â6§³sØiPÙ°û2°Ó
+ðÍjúàOPûMV)Cr¼û	¾¾_<gp]­·bEÍ<Sw®uè6 Cn#C<æéýê,`^
+-
+íVHd'æ
+TÞÆi(qVNÿ=Ê 5wÕµã9¼¬3ÞDß7o¥îy°÷û,ï÷ø©2mÈWe£Ã0LnéJ¦EÀ¹ü
+`Áªvû·qRÙ0!ó@ÛTxXæ1
+]T!ÎËÕfWÇ
+-§à¿´x!bc¤,0©neÈsø¥¨=*4JH'»¥&v
+D=.>9óhÉÄ
+XühÙÚÈh¤ÍÅ>&{p!ãÞ²Gk±Å;¨ðqh¶;¸YúHvë'Èüc[@ 
+I«réÖ#Ý5ö°.÷¬
+bÖºÊ(,
+ßùªlGîHéîáßÜA®E
+Ø
+¤¥L°ÊåúÀÎ`¶5|ØÍé/µçâÜ¼ZkÇcôvãÏ2Â:%¸JBJuæd
+-C¸é3\£0LôEîKUÔ.ßÒ6dmÿ³ÉÊ àÇ³Ú¶¶B£Ý:B© `l´9Æ*_ô~ÞeÝÿkG¢kWåÅÇÝÎÕC]Jã¯¼§,+¬Â>¯· Ë
++ZO
+Ðôõ!I§¾à¶Ü
+Û:syß§æµïß´Ý
+-Cä^9#Eê*ÑHbw·Í?ïZÇ}ýÊttB/ü7ËiWb »íWÚ¯8"Ü¼1²sK|]öQ`ó¿{÷M¨ñLÚéþ4é>&í\Bÿ3Q	ãê¤KðÛà'S<	;
+:8cÇ,asÇ9 D
+{~#È2
+dà@ aì,ZÕþïÐ×ev(
+|eY¢|	Þ
+¡4í×ýâFðýmê;tè¡ñ¿8Cï+ðÕcOë¼? J,p%
+-endstream
+-endobj
+-496 0 obj <<
+-/Type /Page
+-/Contents 497 0 R
+-/Resources 495 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 474 0 R
+-/Annots [ 494 0 R ]
+->> endobj
+-494 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [178.948 585.366 186.395 594.389]
+-/A << /S /GoTo /D (cite.Chri91a) >>
+->> endobj
+-498 0 obj <<
+-/D [496 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-499 0 obj <<
+-/D [496 0 R /XYZ 296.429 660.822 null]
+->> endobj
+-495 0 obj <<
+-/Font << /F15 193 0 R /F20 270 0 R /F21 371 0 R /F24 308 0 R /F18 191 0 R /F23 294 0 R /F51 272 0 R /F46 194 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-505 0 obj <<
+-/Length 1923      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚíYÝsÚF÷_¡G1çû¾S:}pj»I§m¦Ó:ãäA±dP
+-üÕ¿¾{$
+±Ûq3~N{»·»¿ýí
+-GG?
+¼î
+¨%
+%GR3DúYt3ÙùÔÿéðëÆJâ Ç®á
+ÁÇ¯Þ¿ý¡ÓcÅÇgo?9{o~ðø´CuüîÌÝé¿9qð¯2ÿBâ?àÆGgÇî£_Ý³#Å?ðË»ã£Ìö&´¿OYÕ²'U³ÇÒR8eÉÜ»*gVÚIÿà¯pOKä
+-qE£ËñÁÅ'
+epó§n%:ºµKÇCT1¸Eï~sÇÙÜH$M¬,³ÔnUÃ¨nÍgjN Ê>bçiÄîN2îNàºûÅÜÌói÷wïH÷
+wï	¬$Fg°"ÎëOèÙÐÉ»C,=Oß9?6=N8E"Y8òðÐ
+Í<vz *w?,mæÅGLøe:/ÊÖ:ïZU«}Þã}4°û]=AeT!qånWî;Ë½« ýN7
+!â´*ÒÏ£|æ6¥¸é¤Tõ¦ã 1
+Û$iñÂÉ[SL¾Þ
+ÅºÞ6ì
+F$6Ý`O
+nûÑ Ò°«ÒSå7Fõ¼åîÎ¸´&gþç´Ê§iµc
+Õjfå5Øî6¸ÃOû¨¹é`yì4½î¡SÅ	"Öâîü:R(QØ.2
+H2åVá QTÀ3ÂÄ¥£ÈFÍÓÉÀge
+$ÛlÑj?3HØ
+¤hÎ
+¶nÆ=¾ïeÆ×z#ÌH-ì>` ?,klx¦©BJ²heÕ÷Áýðßî4$H#ÁêÐCb8¢íèmJs¤]Uº®
+ëKàGB6'Ó=ÙÓa¦T3ï¥,¯
+- 'C:;
+c«4ì&Ewsl9òí¬¯$d²å¡À&àeÛÜJÈ­,ìÖGo<O`
+-18
+Ha^3äó¡w'«Op½H«`4[záÒ
+	"Éª 2$HzeWTn!9­Æ×,|´	_ÇËtV54LLAq®­Ô+
+-±:=Îyü&¯ò®/Õ_ÄéÌýSkc
+ K8 <MTùbóà0 ,dËT\ÊkelC
+õ:ßAÿ08P§
+-ÓAD
+´heDC:÷d@	­i­-£Am¡É èíA2&uö ¨xÏ¼" ¼B¤'
+¤òØ+qÀHÇ0y'@FJèÂ1¿±$'ÿ
+i ´:²ýL²¥7
+SæØXÀvXîlAUÍÊA¿ÚCÃ°*8V ¯Gº(Aþ2²dÍ°ÔEÃ° `ÉÓ(Kw5òBu×&¯3¸F¦ünÜo;F¥A»[l§
+ÍâÐseê¿{ºÜßåHºXáXd
+î3ßÖXïÁòèøÝÏ=?ÂV¶¾îw
+;¬·.üÁ ".ÖÆ
+-7¡qAF£ä¸#n²	¢A×Ýw`Ü ÎM
+ÝqwÒµs3_ø°2^¤üYÖ:Øÿõ|A|ãã
+éÓ;§¨ ³!TfßÔAî>Fôßç`ÓÅôqq:¯»`# %XÁù
+né8ã@í4"PÏkD v¨}FbÝ_À]{ÔC3×fm
+3H$Ô¢ÿ°¡×QZ·{=²6 ÿö  MpXÛûó0óÓ
+-¦±ÆæìÅe9^Ï]Mµç^ãç°@gX§XÃG ¸Ý¬òÎ«v¢B cN5ÒªÃðK
+-Ü=,¼©ä,H £VÒ{¾sÉo]ÖH´ËæÌ_HÑËK¯bEmícÍ×@5ËU
+
+Â&Ñ
+XÉÂµ@AÓÈûòè¹r»ì
+Û½p»§åvÙ
+³È#È³-²¬·$ÙJç,òHP±1:OGùØÇE1áJ%68ªc^¸iæ_\
+ý,
+-ªÌ¸³'x3Á^Vo&Ö	?ªÒnTeì^}-0
+÷
+-53++7Ó¹_¦°ï¹»-·8Æ¤3_¦Qih¢54¸"dùÇõºU-.ËªÊg.«ËÑ]2¥ù^)¸¨ñVÕoÊ,m]ûªæÓ¥
+bÕåÜ,±V»%EU?UÌtTüí¹¯¹ýÙè¿ærF5ü.Zæ2ãá±(,[ýG+¦Í RÖ<Ò
+·²W*Î¼+-Y]'3÷£¼
+-×q
+pÁÕnX{°MÛ3Ýæ>q!Z`EÉV°ú3´·oVV
+-²Ìf¦ùÐ
+-Y
+-xdHëåë'ûêåà÷Õ«WYð¤­Å+»ß ]T sú}ÓM¥6^F·8÷8ß©Ecy
+-
+$6EË{0õß6-°FÁ&
+-z¢ hTE
+-endstream
+-endobj
+-504 0 obj <<
+-/Type /Page
+-/Contents 505 0 R
+-/Resources 503 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 474 0 R
+-/Annots [ 501 0 R ]
+->> endobj
+-501 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [513.171 76.675 520.618 89.577]
+-/A << /S /GoTo /D (equation.4.4) >>
+->> endobj
+-506 0 obj <<
+-/D [504 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-503 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F20 270 0 R /F18 191 0 R /F24 308 0 R /F46 194 0 R /F23 294 0 R /F26 309 0 R /F57 279 0 R /F21 371 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-510 0 obj <<
+-/Length 2776      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚíZIoãÈ¾ûWð(!RuíKCt¹Á8@wÜ>°MÚæDÕå^~}^-¤Hº¨ÍêÉ`%Ë¯ê-õÞ÷>N
+üýê/7WoÞ
+6$¹yHÈhHÍa:¹ÉÛ	SÓ»¯pø·dÎ)AXdÎÒRøY7OùtÎ(TS2)§TM¾l`IùàÔn
+,Óº*¾Z¡oÞQÜ]$6°ùÁÏéïPD9k¦,§TO¶Ú/q_VU¾YOç0X®2¿\]ÏfYîgä«,_Ùÿ¯ýç©´*ÒO<ì½X
+-ö^VY^ù1§[Tv§ÉP° ð
+!Áßâ&_ä÷uQ:QzòÉ®øÍ·bBuUTa°kPñ#fÂÏâr`#aÖuÔV
+1Ö
+-*ÚUZÎ9§Û4n±]®6þ¨óhÇÔï¤´l²ÁAÚ}GW
+ÞÌøfD!£pÀÀ¼s$S~Ö¯±¥8b&YQYv1¥îÉ"º3!­Û-]
+XWÃ@òöíÛ,j XÎ$Åª|
+-1»
+Dø¸j6I],ÊªñwÞGLä}ÑLwQÇ0C\¨
+ÇñÙ>°++p)gfºOí"Ú~~ÄKøCfð[Ir4
+ÁHúîÂHÚèõTn\:øÛÍÕç+«-8.¡ã¤"'÷Ë«Û;dððçN¾¸©K°#Uöô._®þésP=J9ÒX:Ydù()­>Õû7µÉ¥iÄy ÷år½­ó ¸;ÂÖpÌå$]lóM4ÈÁôEðõBÁöÁ'ý,
+ÛAdgÖut=ð
+m{¤Á¶»d pL
+ï&Å¯MKD?¼icÝMûf0Ã!3ÞäÂfÝrÎJ
+aö¨G2NÌnÚ>ÒCgôB
+±iwÁpÀ!á)ýj~Í|áX"g®W·¾<åU
+Û)#ö½)Òfç®kH]JOn£å°¢8Kï¡ýþÉk	%kÖIÇdÒÌ·Þzo;¿&õz¥aÄò5&T¢,î;-dÒug!d«UÛ
+UH`q¸
+ë£
+!OË{'9"&þõc
+Ã
+-Ô rè9ùâñnªùd[A1©eÏ\åÞQOéÆÁQä¥MHµËåÇ+. ¤Ö­ÿq
+ kD |gøKyCTÝÕW!EÛý'°ÖÒ${
+$¢~íÝPp(Ì¥<j ûÕ
+
+ÑCj
+-Þ¥#`H8´èM/Étn Z§Cîb¨bûÓ
+-j=ð3Z8e¡|ÊWF%RÖ­,*UøójG
+ÞÀÄU° ^²
+-Ï´r©.£¸TíQ ks¢°+d½hùóHjêeÄ|Ì
+-º,µ2èUÌ?Q¯t¢Aj¥þN|:Ñp!^D£\?Vè) ÞêÃ52¸ñ«ûÜ®&÷jÜhÎ^ºØþaêvÝö¿«oaÂcáVþyè»´CóùB3écº=«ÚÚL@ïàuj
+ÔV² 
+µ
+oTuú8[ÎV³l¶}Å³÷³oxö¡KQæàÉK«½U u#ð
+¤ý=TBzlKÂ7Þuzÿà(G|¨I]@;ÉïSÇND¢tÞëm«5ñò-¸·¯ùdó¶Ý
+Tþ¡ãRà3JÍ¸ êR3±'9»ÒºjÃ°$FF´Y]\bu¾>!%Zà÷ 
+-@âtDì}Ç§|+Ë«ÂwÉu8ÍøcçñöLº:ÞÇíB­,{<E»Ûõåc©¨<ï70Øë¶ü¬ã;ùÕ údå¼æ×øoWw§ì|,$x7GFi	=¯!}¡ü°§@]a/z:Ý®ïn³»ÓRÌê1d
+Fi^@'êA9Ü%Dé¸é¿áÛåI<×ðª09²/R{ ¨¼uÉÈëÃ`ýÇòAâð¦wÒCøaÈ¸Ã>¿N«D?í.ç1Iö¶Å.IHB=ìðàð`;^¾Ï¸C6¸­1O1Á
+ÜL°)µÇQÆZ÷qAtqÝK
+@¸õ
+#w¤tÁë<H©2?°,]&ÍòÆií¿µ4j´ìpº¸ [ª±h@ÞO9æx\Ý£ÇÑ¥ÅAÙ_âú0¿÷
+-C½àKÉï0¥Ç¦lÈBvÚÍôy)ªÇ¾$LâOv8ÎqÂTN
+Ð[
+àéz©=pj1Ä¾þR=ôûxº÷1Âº/}&_jÐQ¾T+ýCøÒú
+?|×fÿ?|×Â!ö3øRwP(5R+Á AU{WÀQCùq_ ¼/ ¹ÝX_ú'®õ
+-DÁ¢L³<óãÏbzî`ãGÖ[dÅê1õ Hó
+-$Gð
+-
+îÝÐÝkè#_0²n9¿O
+H
+Â¨É_ó:-aG®Ñ<\°Ú­ç¡Í'
+-ì0è(@5ôu6Vª×~8ä·`
+×äXàÞ5dKÃ¾<¶øÈÎ
+-Ýÿü¥½ ?w
+-ô?
+-
+c	
+ý¸
+[ç|RùÅ¡Êü@±ì°L@
+hÞX»öó ¹mw3çÎÈä¡=òçyó¶³£ÝÓt®Z4ÛïØ1]%CºìÅ6üô6Õ``Vé2¯ó8C'cÀ¢4ü HbÄd\gá¦HóN`67>`Éí&lâ¡\,ü}Çï<úÇÅr½È¡Oi
+ãÞ6 £²	ÆÐ-X£éýJÌz²áÝZ/Þ]áþÞA`îêó-KTmêysûeËaÛþTôª»HÞÖÓç³yQ¦H0<¨M}5 ^ÉæÁÑiûN#û
+i¾ÛÎ¾wH;GDü´ûÍH;ñÇäìºmòöDZã;yÐkö¶ºÒÐ¤û~bïæ)G³ñm~?øªòÍvQ²i<ûµ,Öõ·râwM¸2Aæ÷è-.Ñ¿ÿq3rÙõÛ#Hmd9hf ¿\®/oÌ{ËýÏ:±!¹À:÷
+ÛtçQèA
+-N7#¥aK|¬ôîPaËGTéÒ°¯ Bìûª¶ïßÄAªáíéÂÑ§Òôë"U¸K
+Øç¾;ÌÕ«Çö§Iì·Ým3?
+þÙSWd·÷u´'1)yÈæ¿md£"ûÂÍÎ	lr=q->ÔÌ@Vow$ÄÐ»Ûªß£0DaOíR@ïW¡eßùB`C8kòÖ$zS:d³ïî
+OÁP
+ZÖ»*ÈÈ{tjT¶ÿ* ¾]D'Âø< ïãm:
+»>CA¾9½å¸&¶
+%$\ç¶Ý¿	ß÷ ùH.ê`g³¸»$ÄÍ 
+-fsv±wÙüxbÛ!v9­V¡OwK
+½+Ì^APG^AÀVÍú¢oÞB BúÔ¼~¯k[ §)mE1cF»Ï³ÍþÝäÃ
+-Áæþ
+Ä¯Y
+-endstream
+-endobj
+-509 0 obj <<
+-/Type /Page
+-/Contents 510 0 R
+-/Resources 508 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 512 0 R
+-/Annots [ 502 0 R 507 0 R ]
+->> endobj
+-502 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [164.778 616.451 172.225 629.352]
+-/A << /S /GoTo /D (equation.4.6) >>
+->> endobj
+-507 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [284.736 305.338 330.365 317.028]
+-/A << /S /GoTo /D (section.5) >>
+->> endobj
+-511 0 obj <<
+-/D [509 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-508 0 obj <<
+-/Font << /F15 193 0 R /F20 270 0 R /F57 279 0 R /F46 194 0 R /F23 294 0 R /F21 371 0 R /F18 191 0 R /F51 272 0 R /F24 308 0 R /F26 309 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-515 0 obj <<
+-/Length 2564      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚíZYsÛ8~÷¯På®±ÜG¦f«2dg¦f'µ³[ÇEÛÌJ¤CQ9üë·qðA
+±2ÚÊ-l6ÐFãûÀ«	üãèçÓ£Ï
+6drz91
+Â'R3DÎ&g	ÓÇç§¿=|Æõ@ ¦8èq2üxJ0ÆÉÏ_þú÷ã)c,yòâ×?}ñÒÞðäÙ1ÕÉóþÉé/Oý´*ÛJIþÿiòøÅÿÂã?xO­ðÂ??yjs		ÒÕT7¬)HKá·¼.m÷UíUçÅ1IÂu^ýè­úpiÍ{øÐ÷_§7ÇSPùÛ|Ö:	¿Hë¼,¼¶µQ5ê¦!ÁWµW³Øg®ÃÕÂôÆ¢ìXHRùå¥ÿea
+¡NBO
+HÒ*OßÎ³¥ïâA§#)UÓé"j
+-Ã
+-QI¼5bÍâàÆäÅ£RB7ÝÆ' #óþàö|´³üêÚ
+Ncm»¨Ë*nÓaÖt÷>jÕi£vÌÊ8ÇwòêìýùÙâ|>Ú1ú±¶^_¤u
+-Ss$lt¼*D6
+òµ
+d±× «l¹×yqå×t:{Wæ!L"4qÚ ãu´h5?Eg ADg*¤?ùÌKòBFáH=aÈ`-uI2b±{õÌå´éøSLDµC5Ä
+-nªaÙBS	qz©¯SV®LrþâmâìÍjÍüUzYgU#:[wGæh?nKÎGOOÞhK&Ti½X
+ãÉ
+
+þ6Á=ùèD«ËFý|òòè_~¿vG%Ì¦qª$
+-ûÕ¥Ïön¥6~«YÌKõ3ÝIÌd)1[¥3y[Há{#;c¦È¤¬bFQ
+^èuÔ*£XÅ1EDó/³JC ¶Ëýc^_G
+-`­Aÿu6Ø"±Ë6þDÐñTk
+ka
+xr.ÊÅÍª	ê²aVMËjU>áÀE[L  øD¾<	(æÉsÀ¿Oí.`ÑMålÿ Øa92c¢k°bÛ):uD!
+B{M
+F.f®Ê>dÕ2³É	°ÓÉâ¤8¬N^÷Ò@¤üÀ¾#°/F`³}ìq«sY-Ì¦ýªÊ²8Ðêíö:C¥Rr
+Ã¬²:DEZiÞæ¼ÕÒâs¶	jçg³ÈÀÖÒ¯Þq+­´Ò
+\½0#íVÇ2F¶vúÌÓ ²ËT¤Z	¼cz Ñ6Z1=Ày+H(µ¨/dF7e
+}Ã¢tKfnóÅÍ<[tåkÿ
+¹0w«nW3ïYh¯¯ÃUpñz,P	Û¤nM»
+-2¤Bd	ÖÇ §Á2ÝbMaÖ`#U¸$ÐÛ$e;äUdP0!\D5Ô#­ð0¡l9¤¯
+²õpð±§IØÇ{äHÁÚrû¤Í q¯M9¤BJ×Rá!½÷8bv9Ï£¶Ã&=©xò¯d,áj`4ôÛcÔ`Lß>G:dÛ:ä£Ó£`ê÷7>9ä0#öõM#¿ã*èMHéTóãéä#ìNQT!
+zkÉ¶Ó®ä ;HÎ¢î|HéÚ¥X,Ö'¹YÎAêGoML¥Fb^ÛMå#ïµG½;åÉh 1âZ)5bë³¤ìßÔ¹ôÒ
+ÏÏô¦r
+T®Î½âs%!CøììºVip¬ÕÅ,º+ÓA¾8·r 0T¬a¾8Q×44¥Âú~
+@LÂè²ùZïmVÜF9>ïãÝ
+ïQ·2n××°)G;(í òßFu¯;[pà'§×ô@~úE
+
+Zæµô¿W¿þ½·öæóNå)aj¥GbE
+
+a*`{
+ù¼_ 8ãC´ÙPExòêäõIq;(%h©þÒ¥ñÿTI¸C½¿¾u)á@ßlþjûpsèÂNËoCR(n÷ÿ TÅmV^ÁMZ(Ú0}ôÀqºàY@01!ë-uÞÁ±º:XYn-Øã -Dÿ×#i+Ñnij­,
+-ý²ÜÎª°|]úß^Í]
+Z\ÜµZL¨"wf¢e±ÚNvºPÓ'»£p¢[ã»}Ô»U(ôá8á^¤>T(4±X;*0´8F´ kî©* ²
+Å`ÕoÝMôæ
+-­Ô`'Ö_ö÷/ÄùÙ®ÏîÚmq´±³5Æ.$
+eìBqÆ u¼0ÎØ9"é1v¡ñc\rWÙæ¨
+eì4B¯c*	A#¾e
+¡ì
+Th³ek]Þ
+/ ¶´¯+[éS[ø:À^[ ¶fîË×#´V4r?bk@ûáù:Å1.Â×­.Â÷.CîPÄ¾.Ín|A@Ðûrv&,z1ÊÙ±{sv<öñÉhóeärU\9ÐlÃÖV)
+-Ð6O
+«´ºZ-:Â-q,I©p5ïö|FsCÇæ ±À
+K±øyÇrzý·,Í¥0øeY-Âw.ÛúsEåªö÷ÎGöbyVË¼ö%
+-× 78ä(³s@M¥V*
+q°ìéØáíY~~öî<Âªº­î:
+-#NýgyóUÖ
+3
+-ö}§UzQ¸mé³@f¾å·Õ¨D0Qñ6PÒ¹PeóÆ37®üáÀ¬èD1&Ü}ÙçÊSX¥N¡EÕE¨vø!4±¸Æ
+amv<äÏ>äÆö<äæ
+L-õmô
+)ë2Ø»8L#DÝq^ªcåP«"×t±ã*º_øÿî±áßÅ
+öÀMO*]>Öí11x7ZLngU&5ð°
+âÓV rº}Ìô´Ô¢AÊ»§.ÊÅBD«4,
+-+C0øC
+uòvpi±¼è\
+W+4Ð÷é2ÐÌÒïOuk¤¸5
+¦_­ü.Ë°ä
+-a<øà§?,õÉµIÛª2ß/}SQúûAd\¡æ=ØBC1ó-¶CïÑþIÛoûcMäàV{H½æÑÀÖªS®ôÆ$ñåcøMíµYzY§í
+|GöÙ¬ô5»¥¿-Ê -×A»Ûõ@°´
+ñM¡gÏ3ø"Èr+\ÀËÖè?Óó ª°ßýº8_w
+-endstream
+-endobj
+-514 0 obj <<
+-/Type /Page
+-/Contents 515 0 R
+-/Resources 513 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 512 0 R
+->> endobj
+-516 0 obj <<
+-/D [514 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-513 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F20 270 0 R /F24 308 0 R /F46 194 0 R /F21 371 0 R /F18 191 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-525 0 obj <<
+-/Length 2743      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÍY[Û¸~Ï¯ð£sÄ«¤´[ Í6]X k 	<h,ÎYòJrfÒ_ßsxHYÒÐÌ"úbS$EËw®JV·«dõÓ¿m_\½ázÅ'9_moVkgze2É¸ÌVÛrõ~-óÛ_^$þµÕF	Î¯6R³ÌhÚµ·EÓ_ld¯»b QÛX?¸	K~âæØìª
+-¯´ÍbýP
+w4º¾Ølm
+ø½Çk$èêH¦´
+#
+5	Ñóà÷ðUÊò4q[
+R­6Ò®vÍ¥2#Ìj²«hÊèe<~\¨TùìÂÇ.Ì:>
+/ûùBëuQÁ4ä[xa9µU¯
+-xè
+¦9^."èÜ;ÛYÜ,×Õÿj]õôÜ´~¢¬>$\Â>:­*®kË.@éÙú¯uMý
+}5TJhº.¼²j(M
+-óQQID±Lea¢ÒÏ8C~3Ôw8C`
+-Rò´}_í«~¨v^9
+-­
+-p§lzðb.vÃ±¨IÍÂ xRAjö¦l
+öl¤ëÎÖ>ÓÓ¾¸) Õ=T~òÎÄræ¢Bñ¨:Ô¶»ôÚö¡ÀyÚS
+-Íí¸ÛÍÎÖt{Ï
+ÅÜ°
+`¾á9Ó zGð`©£àºî[ja³®n wø©¼î<t´·*«æÖG{omc;ÙÕÍç~#cR
+-êìg8ÓÆ)9\]Q×`Féõv(ªº§»Ð×áÕN_Ã&Ø¤a*MgÊ]¦MÂÃC
+ñø òµýý °8l`°ss=mpÒÂÁíh¸k¦Zr©N}uÝ¢îïÇ
+~³»04óL§+®ÀqL'àïÁÏezÄ/çB¯ý|!ùD!2Õë7¹Z·Ý=®Dßéÿ´þØÁ¹×Àm5Ü*?üHTÜ /¼ÜÓCOÄ84^ÚnÚá
+ÀÓ×î"
+<øª|2Ê¯+£èÈ ¯,BÆâhÁx
+Ö4K7¶Ç¡jlïy½¿GÔÜ;°VWÿ±3P~%.ÜMÀÒ	Â îÅ5
+3T[ÿ¯_¾Dû¾	m0UÚ~×UÞ×4çàÀ()`ÀPbý¯ÊEqX¶;{ðX
+NàÁ5èC!ö¶sA
+0¥®KÉÑO ãÉÚG?Û/³aÑQ
+°²¡u)ÄCpp|]oº"vßY uGc
+-h«½ïàLQ.Ê¶Þ]UM Ýý%¦\ö¥
+-¯¡xAs>8SàüH)dd©K¡o÷.MÒë}ÛùQï#É®*
+Qôq>Øé4¯:lÎÒT°_âX(/öáP0_tcðwì@?
+2òÊ!ùñ×l^û0`7=«î£Ö¯é\
+à\	kèÆysLuhe3£!PóµQ:¨¤5tJ
+-
+-	CpB_ìýhDM.Ò2Å°G³×ù0 äob°wæ #aéÄ)ZGô¦Uþ|¦Ó§=ú¦`i?%yÞ8A#Òò¸sA
+¨GÛS:KCÎBþL³h
+ñ ëp­ò2] Oº|áGu °H
+1ËÖñ<]v([ÿWv2ÎÄS,ÌÄÄÑSO
+7^_¡óÂaÌºð¡jv5Æ|éà*:.z Àn8ÏÇFÃ ËàÛ
+UÆxv
+-jÇ¡ÝC2¶òmg1pkí2Mx
+ ÍÒãiÆ}ê@°èÿSt!Ã(ÁÒ:ä'æ4> 5!
+¿]ÛuÖ%ð0Þ
+ºÐùB0ûÍÆW(xÀÄ³î==ÜCÔªü>@¥>
+|ÀLÑ»ÜvÅ>ßÑl¼î!aóµSý%fÌå±°Ê®;ëÓêîØ\RÞ¼ÌÙ²IÎvðF&tìì«Ym
+þF+
+-1Ü3Xã~!];ÁtåD'Cq{¹¿l.ËËOTp.ß^¾
+ã§¿£S|Î_aêÇpP´$â
+-Ó|
+WW>U
+-Zóli¬HÕjKÚã¦Þäqÿ
+
+-Ü}Ç=òs}Ê¼~\Òÿ¥õd6¥W4ÍSÞ¹¹ÕÜ(fÌèUöQfd2È+æ2
+¹i¾;7UóÇùI%Kõ
+-âÊÁ¢Gjqò9üÜU·w¶÷ØçÞ@¨Çâæo;k£äbLÊÆ.Þ@Jd2æ
+¹\øµçP
+-àÕÅ-7Ð]¨RúPjûÞÖái¤=RÂç½}ß||_¾äCÙ}89Ä½%¤ ÕfWù1G@¢ ÈÄÛèå@²
+;þê*2	ã`çSsÊâÝûýÿ,ÞE/Lî.úi©Ù¡NÌèfÁcC-¼ëÞ2Ûûª>ªhÇ*
+-bèª(3~]e
+-Êhwx
+³¾Úh1vUgëï¿ÀêÆqãî¹ÝTÕ,h;Ên¨\§tNJ&Ò
+À
+ªËåP¾bõº]
+-»Ç>C8å
+§t®Åä©Àù E³Ï¤ÌBuúTÿpéft­g
+²¶Ã8>÷\u×ºoÚ:=Md~¡2HPOY8åÛ<!çgY2rpód7óºu´çWD3¹ìºvÇvg¥é¢;MvIÈþFÖH"çÀ½íîÕ«WÑâkHF¦ñ¶Î
+ É'çòßb¥é¤Pô# *
+Ê$ÍæÈÛQ
+¼Ãx¾|ÜÞ{(ü¿³t#¥+´tW
+-ªP
+-ÊYãó&ôðüY
+¬X´xÊû¤<bÖxò#³v÷¶û'}jJ>:¹ºÉ=
+Ò£µ
+_©PõáÀ[» z6¬¡aã°·u¨
+-ñ1Cn9Y
+ !ÓfbÖú¬Yë¯5¼â¬YÚ>Ð¬÷çò1Ã2ýº¢ ¥Yö1ë½?mÌç>Oe±ÏSYL?O3fMÆýïy£DÂÄã"jÐ*5ÂºZóáâöáâDÑÓ;.>Áó¢AóYÊAódE´JÑ
+¶cÁÒõþPã:Ê¯cB²üv-]TÍänß2D¼.0|B7¯ÃÅhrx}ÔÀøK}JtP$±sJ,bÉü
+&¸
+y8ðü
+-Â&tæÆ>
+´
+ä³3÷´î½UrÒî|à¹f	
+UAD	´5®¸M<õYM¾ØkÊE¼.zßyt=çk£¾}^T4oúÌ¾elB?þ4Üñ$¤á;ûÛ@rh»ßZßñåN´G'iù4+xæD_¹åUÚÁv{×(&g	ËDº÷DÕ¾hÆ>Ï3]|úðí¡ÝÞþ[
+Ìþ~,ü7òÓWñÉ}W
+-mfï·
+uSd¬þ±
+"ðS¬Ëj
+±7>v[
+ÉSNIzýs´5ÌeÊ`×7©aôÕ¿¾Ý#[¥ïSU¡·7Å±
+úé`µNX´9õ÷íÿ´ý
+-endstream
+-endobj
+-524 0 obj <<
+-/Type /Page
+-/Contents 525 0 R
+-/Resources 523 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 512 0 R
+-/Annots [ 517 0 R 518 0 R 519 0 R 520 0 R 521 0 R 522 0 R ]
+->> endobj
+-517 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [349.585 583.981 395.214 595.67]
+-/A << /S /GoTo /D (section.5) >>
+->> endobj
+-518 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [361.624 443.713 417.004 455.402]
+-/A << /S /GoTo /D (subsection.5.3) >>
+->> endobj
+-519 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [419.3 214.539 426.747 227.44]
+-/A << /S /GoTo /D (equation.4.6) >>
+->> endobj
+-520 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [213.544 157.97 220.991 170.872]
+-/A << /S /GoTo /D (equation.4.4) >>
+->> endobj
+-521 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [302.926 130.872 310.373 143.773]
+-/A << /S /GoTo /D (equation.4.6) >>
+->> endobj
+-522 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [168.827 77.281 214.456 88.971]
+-/A << /S /GoTo /D (section.4) >>
+->> endobj
+-526 0 obj <<
+-/D [524 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-86 0 obj <<
+-/D [524 0 R /XYZ 94.914 567.002 null]
+->> endobj
+-90 0 obj <<
+-/D [524 0 R /XYZ 94.914 400.81 null]
+->> endobj
+-523 0 obj <<
+-/Font << /F15 193 0 R /F20 270 0 R /F21 371 0 R /F51 272 0 R /F17 190 0 R /F49 256 0 R /F57 279 0 R /F46 194 0 R /F23 294 0 R /F18 191 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-531 0 obj <<
+-/Length 2700      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚíZ[Û¶~÷¯Ð#5`ÄÉäaØv<Í½Nfvã®D­ØJä¯í_ßs ðºà®d;m3Ó	 ÁsÇù ÛE¸øë³¿\>{þ
+-I
+Ætq¹[ÄÄ/¤ôâr»¸x¸|wù÷ç/¹
+¤¦# dåaü²d:øõÅëW¦qñóë(âÁKìþòzI)
+-~3¿¯Í«(¸øk¼~¾ya;?]¼zõ'~:v§¼®i$HÄåb
+-ÿZ
+-ËÈå>*
+n³K¦4·Ü
+:üVP¢hÜ2_'·vÐxªTÝ K!äÐò4È*;MS¥[ûäEüäMDGªv,ïñ7AË­oöHö,vºmZ4(48b#Fîxª[Ùóäè
+;ûÄ½¢Áï!å7¬Èí³û}¶Anö- "O5
+A·J¡²àq«¯»åÆNEpB$ëY]§9Y®eL¿íìS3=§rúiË
+-¾Úh0ÊËÚ¾K?fU½òéñÈÞ§*Ww%UÕ
+ÓÊq¸Oê	ÓezH­ùs¤[OE±Òhª­¦3¢pU
+¶åøu
+l2µO|kelÝ»²8Ú3iß4 ¯(-+Ð®
+-yp±«Ó²
+æÆ¤ÓMSghZì;;]âúÉ¦Æ¸Ð-É*Ýôï3Í£ãplþïÓ;boú£cjÿÿØÄümÔ¶À±=3*IbÎÎ-÷ÆÎÏF&GÝ'cÁX4,"±ÖíÈßCÆÝ¨p2¡
+9/}Nù
+ôNWÑÂ2hëX§ºÚ»÷»&·fóD9LÑÍP¦À_R¯º8d%5R
+xOHÔcð¦¢Þü>Þ@=ì4uó^ÕaèÍÎ#ZèfJÛXÂËw:¨\*]¼ÝlÚhÎ0	A
+yuÙ»ÔÜ:Áì	±)üoûvå{§DÎ³/½@nØ
+FÈ¿6xi°©MP9©=S).+Z:W3JDg³ÄË1DvÖÈ}ÆÃ÷ÉìÅ¼SQÂ"Ñ¡W=õq?@éa 	P Gmæ0OÈ'îzLê2ûè³0¼×ÑÑÂõÈ(mÑ
+-$i»0oí
+Lóøß
+la¶:fáØºW7]°wã¹ú,¿u§ï4ß¤£z¨¯&
+¬ÂG¸"Îc8¯-)'"êÜyu\å«íªY]u$ûjoomÙ¹hàÚðýþx`DÄË<îDë~£!ÊÅß&ËgëÜhamÅ9Ã¯9¢<7}­Qºjgÿ·©c3o}2KnP*øâDB
+]
+8z
+BX¤$
+ë¸&ÿæÒdùË£"¢DþT
+*!°y¶çÈ³Ïn÷iå|k-¹úzÅ>¿-ÓÔËn$	ÕÓÜ1a)MÅ¬hnÎ+ëã»s6µo
+-Û¥¤
+-XË²ÉÐ
+VcÐYOªñs
+-%*
+³^]çï®·ßÑ³Ø-Óª9´lò Ùþ³È¬Sø] 
+.à]B@§±ua¾A¼ÂC,sw
+-fFìtµ,´A»OôÝºP$V¡q¢ÔeÂ©çÒñ§Ö!ÁÕ@
+-¾aF
+3«×rÁ`ÎhTÀ<¨ï4
+[nÄLxÓD¢§öÒ
+-ãZåórÎÇ¤
+[[»µþ£GWÀ{yÖ3ó3r¢`y2kX5ò+QÒ×ßRg
+ Øije'ÉàF­¼TâpAúçuA¯6 öí|Pf?6´_[¿<ZP6!õ
+-±1õ6Î¯³§Y «Â}H
+JiÿTûgÞ©à~Þe UñÂt5Wñ
+5ØÕ7¸öª)9	´¨àa-=©ijíVT7ê+d
+ÆF$é9$¿·Úû~ÐSöô¦
+-«$ÅÊ
+-õ¾Uî`Ô;â)Ôh,`©E;hN8Vù`hWaÀ e¢ÝÁ¯Ë»JÄôJüøÊ~&PÒ
+|À¦qOogÌ®ÆHiðÿæ gú4$16¥o÷½p/{¿ðßÀ)¦å° ³|ô
+»-|#]q8ðso
+-&|Ô¡2ìTXo2³E
+-
+-4x"N9¦½_½]]­òÏ¬ö |X3ÛÜÐøÀkâëáÚÓòü±=Ø:vßÿ0ûÌÓ©^÷mþðk
+ÐZv
+Í{¿(x«yH÷öúý»¯ÂíîqcÇlÂ!dï)Lª
+ÃÀä7xve\¼ó3Éqâ>£
+-¯¡a;Ë#üsZÔ]R×iw¾àÛ%áL<5+4v]ð°f<¬Ý~>×´Ãènxøå­,¡ì¢¦
+4Ê¬#OÂ7hr9Âo?ÎÔdòÞWÖP»"PðVSõ{ÀOìê$0Â©Ê#?N
+-k5ØWwCÕì
+æ÷bL
+-gV:kVvYÅ©fÕ#³>
+ýþ«výJ°ùG©vÎ0A<5ï gÆ#Ä&À
+-ß=Ü¡<eÓoÛp^yn#å#	Å^Äþfä¡ùp»ò 7<RÇ_ÜÖK­#Ö^ÐFRÞ6Çt´ý9Yi@µ´?(¾ÛýÙ·~b³x
+¯Asp¢t,G¼È±Å£ifÎ¥>ÙçÛtÀB°;½VCtÏ'õdÖÓCî;
+-s¼ÐS$ÑÙÖÝoëQ
+-WÛÔ»÷N!ø5òÑ¯XÑ³¶êÊWw7(:
+-åb ·ð-SíU¤²h 23;£v­Fqè)9ØÞÐ¼~ ÀygüóÌ´ê<SºD°¸ñSàµ ²¿?`®$ £sý>]Q
+w
+å¹1J*
+=[Éí
+-(¹&õ.)«9ïàÓ¾ã<3öøÁ6%º?µNª+V2³,¦£ZÄ)u
+¼§·À(,3BUöÁöÞ
+ãÎ´4G'0$¨¼n¬H¢¿KVÙþ\µBÍDO<î¥ÅM
+-GØX
+-
+ÚÁ;wIK«¶z `¹Ù@Ð¸ú\Ø
+gð¹ÔP¬»ê_¸«*@¯©m#Oo{Àg#A`­=9âl¥çkÒcß¤
+lØë^R:¤{È0û0
+ª
+¿Í+G0¸íb²È-ãø
+
+Ò^*·öÊb$ÕøÞ¼,{»7º+Q0 ª;wSdëÛeÁ2Ï=ß:¤Ö`ßÝÃA/´ªò{noô
+ÒöíÅ7¼ÇQë#ø´Ó´÷
+-±ëwAOjÝLw¿)ßtò c }éR°Äo²SPïKéö¢
+¶LÒÕÎ6Ø ¿Ú¤Æ$ÞL
+¸<ÿrÞC
+¸¸Êq¿IÊM^G×*\Æ.Mª¦l[_ºÁi«ðÄÆ
+÷ïÝÏ{qùìßâO
+-endstream
+-endobj
+-530 0 obj <<
+-/Type /Page
+-/Contents 531 0 R
+-/Resources 529 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 512 0 R
+-/Annots [ 527 0 R 528 0 R ]
+->> endobj
+-527 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [377.418 137.455 423.047 149.145]
+-/A << /S /GoTo /D (section.4) >>
+->> endobj
+-528 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [424.331 117.929 461.794 129.618]
+-/A << /S /GoTo /D (table.1) >>
+->> endobj
+-532 0 obj <<
+-/D [530 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-94 0 obj <<
+-/D [530 0 R /XYZ 94.914 409.805 null]
+->> endobj
+-529 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F23 294 0 R /F20 270 0 R /F21 371 0 R /F18 191 0 R /F24 308 0 R /F17 190 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-536 0 obj <<
+-/Length 2453      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚåYKÛ¸¾ûWÌª`à³R¹$'ÙK;IÙñú!
+-jùAÊãÙ_n4Rjfär¶âÊ  6úÝ_üfÃoþúæO·oÞ¾KÁYÉKqs»»)Vä&+$²¸¹­n>F)WÁ9nïõj#¥þµ*d¤·CgéýÏª×«O·?½}'Ò9¹$çNsÞpþÍf\ßÈYJ»¶Ö
+f«êÕ&Î²HÙý±Ñí*.¢fª£5íÆrgi´ëìÃ*Îa{E=ð
+=àgZh3½YMo»îØV4l»>:0ÍAm#à\G(´ç§?aD±6B²4)IaTÕ_;m{?Ñ¬1÷ÈX)sø¸diÓÇoakGwîÔn¸§×
+T£,J/7¼7û¨ÒëÕ&Ò3
+Þ[ímó¹­b.ÒÑVÕ=aÈ5<óØGEô`W÷u*æ_1Kðù¯£myÂKÂ²2wþ¾·ÈMÌ
+-»ñ±UDn:à¼YÌâ8;µÕÛà^	¨·ÆGoX"ËYYÄã©»?µÎ
+-Ml'%Ë²Àª3J
+!§xñ'O
+-ÅY2»¦%ýù¨&®Üó7m;Z4»%>E°<
+ötÞ·Ä\ÊÒ"ØÝBúÙuuí$|èé,§UÇ:¸(ÄÉnGúKÁÊ2!ýúhVèÅ9 
+y)½c ²Óµ+±Õ&MÓè@Þ>
+ÜvI¢$aI¿N¢ìë7>´(
+jõp´¡mGV·_tnK¼zÃ#pguW;¾ÁÖ:õF÷½ÚkÏ;«SÈK;Yg+íü2vö¥Do)(n;SÑæp¾7t
+L»cJBáÁ«c
+-X
+->¹ÌS§Ëçq
+-ÇÖ£¯Ñ£ßqçÎõ'
+¬îC@ IÓÒ
+½ã0^'È¬ «~>êvëtÑßÈw\ê#ãÛ5ê.
+>{D"Ló)Ã,E=]ø[,Ñ,OÍd%$@D
+-rR ¥±~hÍa'3Ì°`cUuO
+a;Á þuïËDpx&(^p ?:JÁ|xªÍÎ
+-][b
+a	VE?èé
+BÎ=É` ¬
+mº:e
+	(DÄû%ä,Îå¢¨äL!Q|ø4K4RÉüRYþ¹ÌG:K¶NavÃá_¨yE
+¨m]>z!=;â]­Ç@¡£5]Æ´j!de%ój,£ÚJM¯hg|3x ÄV%ý
+:+!°¬¿ªæP»j¤
+èÐJC^A/®¶-©!ÙYfý
+§|PûµX·k¾M­÷0%È@»ªÝ =gÞ\ñÂë*2ªQuGJ öÛO>`Â*.¥J'ÞöX«Á}¸44¬ªÌÑ$)u¶Õ&DxEÓ»cëõMà!wÖ"ÑÁ?w
+ 2æ¥+äøl
+x¤à(ørìõîXÓØMxúta¹44£èA¶ð&zÊ¤Òº¨ÆÔfä¥Ãç-:Y¿
+wöÚ}#L}f'FÈµWWg­ÏG0
+-ömz[ç@¼Ç2ÙÓÆ0
+-{Gè¥~ÔÿB0ë$.OÃSÊYx_ÔdÕªNíó¶d|>qÖ8×m Ü»iÎÈoNZ·Õ@
+-Pµ>¬¿òõûõ#_Ãè¼ö÷Dd¼ÈÎ#/¡
+b÷ö­O
+æ0®eø`7l]K9;a+ÈØ\Ã;ðèÐG "²ó
+MÕè3Ö ðêK|Ì!u³^8¤Lxv¦½^éù3ò@þf .ä_¶Xi|Á>Õ5"Ýý½î½{<´B¿=énþR¿(d6×jÝ8/XgØ=ü7,pö\£´·(g±ùãpA
+-è4y~*Å¼L}åP§®æM¾Â}0©¢q
+-¥S
+-ÿê¹) 
+9§ÖÅqXn¿àd)¡@?'â§ò¾q?
+>}¬®ú©eÀ»dHHKÙÖ8{ÍË<!
+±h£`Ïo
+-Ësëg
+0Jz£<òÍw1þ·>ÍY2aÔÇÓ£A
+2}ö¬é9ìÌrozùTÚ ìÿé?\¸ÓÙW¼ÀHÖâ¤Â?Üãá² uS¾~¡yq`Å%àÃY6YïÃËtî»Ú#Bº,ø"ØÛÒ%à¨àéÎö 1\#à¤kfqÖK¾0½ @.¡#ûÊ/0ì}
+2TôG~1ºCxñ·]ÓtíÔ¡æåI¼«'ùEõ$±ðm×$<Îql¼x·àVÓ²ñÛÛÞ»Vnnðsáfïý§ó$à>ÝÑù=Ù´oî¥Oî:´À]ûp:
+»£_tÑ Ï~ÛMÈç-=Ètþ
+-ÁûÅ{ÏD¤ ÎzüÖA=½wWë8>X}Pvñ	Û°4úã
+]1
+-ÛñÚÈÝã¦±·
+Æú·L<÷¿%`1\ï¥;#½w÷nø¥¶$KOïj|Ò¼ U{:ÕõFe¶ÔNÂÛç£ª¬F
+-t¥ðDz£±¿©MO÷6ÒêR¿µÆw)~³ò7ýábP¶,?ëQ·ð"X>ûuþ:øÙ´[²
+Ì¾9vp
+R@ý¤¶ÝQíØÄö4}°Ý
+8Ýãwî¦Lã¯©ì ÂÿLÒ®AOA_¸¥
+
+-	Ê¡ÝFm¶Á«IP)Nõ¿âÅHÂ½Nß«5Á
+0ì¦ ×©hFÑ#\ÈUßÔDÚÅ<g
+-ëâåHÂR^\ßòéËy÷ù[ÕûÑ¬¼V¼"eYùü-&ë±?YQLSÆW5	Êä
+¾qå
+*y±uÞohÑº®¤æ×5ÍÐ2cÇ¼*èÿªi~¹Ëù
+ûæ'ýøsú{4¢øú}àìåúëtê¯/ ùìíhY¼Ðþ0ÝhòÄu£ÉåÄw£×HÜëñ>ðéÅ¯ÔßÁ1chHxvÞ®å%KÓËÖ|ü±ÚËüõíe|±½¼FÞéOèkÌù²1!²kÏË6å¼Îþ=©¹}óËøÕµ
+-endstream
+-endobj
+-535 0 obj <<
+-/Type /Page
+-/Contents 536 0 R
+-/Resources 534 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 512 0 R
+-/Annots [ 533 0 R ]
+->> endobj
+-533 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [297.585 257.206 351.698 268.896]
+-/A << /S /GoTo /D (subsection.1.7) >>
+->> endobj
+-537 0 obj <<
+-/D [535 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-534 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F20 270 0 R /F51 272 0 R /F23 294 0 R /F18 191 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-541 0 obj <<
+-/Length 3966      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÍ[KÜ¶¾ï¯Ê[µ/¨²-'v9v"obÙÜî.m9"9ZÉÿötàs1Ã"UtÙ!Fãë¯»±ñên¯þvñùõÅ¯¨\ÑØÐÕõíÊb¨X%Êõêz»ú%ìò×ëo|%ô¸%0Í¡#ÛH^®i
+ÇÑ÷LGÿyöü[ûðôËg_^®9ÑWøúýóKJiô£ýûô¹­âÑÓïüÃógðáÏÜËO¿ýö
+ø"öÓÏuÝMaÍ%Ñtùñ>+¡j¢ö>oàÅQ]
+ÚüFeæÞm9´Ø¤Em]ÙCÞÞ»uJ:]gBdlºuî]Ôe]ÏPbÝ5)úHËm¨FItm^:G%û&í}æÖoA&LE-È oñé­«Ø¥m¿¹B	°¡y5¢ÍË»àR$1íÆøiy´|·/Þb{Ø1m6°
+HaFÓeÆDß¤ê&O½X<î:á$]Ï_ùb¥Q±m ä+NôÚ&È2	Ìbhö2qh<Aè÷åïKÆKãB®N(âl5jRr¹ ê_nÝwYÕiÛË¨*½8ª6ÍËÆ½ Ó¤Ñ+éÎ7á3
+d¢×ÁqÌ
+ÅJyRÛ5Q£¡¬
+zCIcuZO(QZÏNÎl>H*6µãòÿ¿ãASMOk@cÙCímUº`6®÷Uþt%f¸ãåq1/ó6Oü´Í+DÈFÕmh>*!IbNNo
+-A%ÿµï4Å=àªú÷¦
+
+-0¤£×y];÷ÜºÖ©«})(-Ù©ù±X¹Èõ-j=Ügµïôd¦£¬ÅÑ
+³ÌÏÆ~~A1hfS­â(Ýï]OiÝ¸¶r¿~÷ræ5 }®öm¾K
+<ö,eÖ<²{	UÍmQ
+^¯&Zê
+3)
+à>v;gõ¾ÎÚüõå0«
+-î
+-êû,Ýúö~!eÕök¬«}§mÖ!7£x&tWÕmþG¶ì±¶\
+Å®âCÖwáåQfg§÷
+9^^PLS~²IîZßV
+e^nê,m²îÍý6mU§w¾p
+°F{·{­@ð& ­¤ßºº}ÿÕm
+-´!NrN¥Òt*¹kTLRv
+GY;9¡ð­Ä«´Ú©3  d÷iëê7ié7ÊTlª
+lxÓd[Wù:OýUqØ]£¢ªÑÆÛ´éZ
+P(ØàÆ.Ðw¹Ek«§Ó·ûË)
+ý&ëî	Ä¡±
+c¹':ÚÖ¨Ða
+d\ÎGv¢<ëÆzñìúâÕB$løYÂW2IUjµÙ]üòk¼ÚB%Lp£W¶éS¨Åê9º;cT@'´Ð¦7
+¿ÜC:Øê~÷NR¸´^øøòrÑMÜ¯wymÿâX9¡¬l²®
+wtRº.+îØ:Ò ÂÖø
+Àþ2¦¢nÚuUo³zíZoZ»/²ûºn
+CA©sù
+=+~á)îZ½
+-7m µçÁ=«ð]Ödm±¥Ú¶Ú-Ãf}%qè)ÅÑ°ì
+cù<
+[¨«57è9=fÂ'|çN°¿Ô9Hû´¶>7P;e8!ÁCOãm»ÆC
+'aöÙ}_£:qR0ÐysÒg Ä·PÖ°¸t0xQH6Øo	È¢LF_âÆs´ø0é
+-.@Éèio¼	
+-cDuðÚq¡ ´·õð%û´Vº\.3²÷W7]uùem-"BkÞØyÖºÃÞýnÓ6õUm}Ø´DÝá>~éÉW»×]Sg(øh
+-!ç
+,É}qgú±
+-'c¡±
+-k|+³MUV»
+Î«Ê*I÷ÉaÔç6éÌ ÎÞ7`Ñ/ôW¤BD_@uZgÛ~é{@âýpýXÔkíôèöP®èfPÓäøpç3zþÑ½]°Ãwxz¤5 Üh×Æ½;[¾ÛìwæQ
+þ¼r_d©ïàY!îb9cmüÏ "1"ÅÕIåAg»ØpÄû6\¨!ê/Ø¤ÁeükXrzÀÐ¤x`t´GØ@Àß©©;V
+ ¦
+ l¶Ôê$úÁ£ p=
+ì
+%ï²ØÝ1GylPÄ3Âª
+¤°Ú2J(´»ÕóªCãj:KÛ_g¯9
+éÚ§®°ÈÛ¶ð]x²­r¿fx2=¸õ¡\¯á
+-G!m²c	ÅÛén,Ò>d:kU2`õoÑIqvã";¹Xæà)xÑÔÎKp0#-|Wm¥]ïÙãxnò#1ú:jlÏ¦::á
+ÓÃÃoa¿µ¶ä¦¡Gkè¿ÚÍÜ{
+-èÒÛà¹]ÿ¼ÿ­cßµ­#êýå:·Ê<¢´jäOàDã¤ÇgpF¢?r­õf£ClAÁÏaÓZE
+îÐ
+!±dÌzïL1gØ
+-à·×øÔ1Íp`áÌ××Î×Çcq4
+-³ÅÝ2Ý²+'3ð±
+-¬qA
+-p¢oðT¬fjY½JNÌ,!
+D6jeþårMdY÷Õ£ÕÖ:Dæ% !¥I¾ÞÁ6E á×TGi}shZDÍ$B¾ÿ~é
+[!<Ãg¹ñ	<ðCj\ÅâjÙcb_óæÞõ$Kt
+ZßÚðOfèâK¼£æÂê¯Zö¤va
+¤´qEéÓÎ?­[áZ!9'Ô8¡NàøU¼÷|Ã=É
+ òuØ©¿¥¾À¦}48ïUî>BZØEQÂÆÍañ"ebËB °¤Ã
+-¢MÇQ²o­`¢B½»kÍZNQÝ³¦:{ùÉ£Þ±
+Õl:¬Ì<}à -i¡
+-Ðª?ÍÑÈ¯CÎ3'G
+
+ÀÛ#ÍÄ"Ã
+Ó,2L±Ä0åØí8§3MÜì
+J
+-öHaCÇ oôlQñOODµ
+
+-íµ
+-ð8aqô÷ÌÆ;E¬àCä
+Eï
+pn½siÐy­ý:#SÛÆZW~êÎºÂÁ3Ô~ö\qEè 
+-= 
+*=I|-ÝnóÁÁîõ30°q¿Iß?n$øªÇË+×gS9î6$pÝÔ¦ÛøF\`¶F¸Ï<±ÏË	£o²]¾Æè®=k
+-Ç=uO:ÇÛ§c`^¹è`
+aSa,ëòÖæþ=m
+
+í\á:MôkÂGI
+-QýÏ\RD&râ×ñÜ'ZÛädUð
+19fCÌ`ÚÙ$fp(ü®tKFå³þJ¤læ2p
+eZ1HÍKÔ¹n&
+¿Cb	6NÓv
+°Ò7GàX!cwÄúõ
+K
+G,1G¬G
+²¤ý¤6µf(îMne
+%îÀRRQaÈ×R Kfàáì/Èìýú1}3,X!{<ûõê
+ñöÂ{
+÷L.O7ñdøîoa MÃÌ0SÜoX±=áuª\	1%jä
+ÂË$Éh÷
+
+-1Äª
+-UÛgi0þ¨eôªÎÆiÈ°4a­/ëÙ¤U}Q.¼:Fû#;
+Ônî
+-5=X°ë"7vÉ]Þ
+_&'ÂåO
+!Ï<$çê¯Á@Ò
+?j÷[[¶ø0ª±üvb·³ÂS
+-£î½ª%@Þ²Z&1ßó4ÔI{¿l9R,]¼Rú¬CiL¿úWÏIÌÇXý«Àêõ.«?Ê¯ÌhõWÎÌ<Üç½½(ÓöP§EóJèÇ
+úmaPÆ-Mç¡i¨«@5(4ÏEg[ÿiìg½8ÖCÀÙ°4GÙp2DÖ>6lÞYágyÑ²ãÁ8¸ÑCzèEÛCÏ/
+=Ò
+¼&Ý`Æmüdq;1v!'Ûyì`IùïæD|ÎO
+	æ¬xèIÙöh#&j½ðwÉXBÑ¤ñR»ø<³ñ#r°9P,¹É»É
+úôK=ºCÐ¸ð%#Æ"9?Ð¡d9Ð¡»§
+°{£{´Eáì§µ49ÄèðebG±à
+¥¶é¥ÆG
+-¯í(
+þezÇùßs^ÉÂ2¼;ê)
+-ºÈ?»o*õi9L<å³iîÇ³¨hâÙ+Ï
+ciÃ§ËÁÕgdÁÉI´Lä4ÈxîX4F&,k|s=;qtÌ,;#"(:¤gL¡ÚÚý|ì¼ÈÇR±9ÏLz4D¬Ìû	yÍã$lðZ¶
+b
+hILgð(ið:°7
+I°Ü¼ºá¯C6	{å|îÿV Hñå\àHóô)Ø¬Ço¶Ü
+]Á~B´ë:ÁºÔ¬Ö%ÅQÖ
+Þ×»Ù³.}uÑ±Uý »ù1¢ïh<vñEÚÅ?4í*Ã¹QdÊ3Ú%rwá
+ÿGèn;BqºG»
+¿ê'D¦Å«p	Àï,þrc#±||¹Ç3v&8=vÅ
+«!	t.=þá¦
+-_ÞFÀäyìl *6Óí&øò(
+iãi¶ô.õp bô÷Á+ãÙEë#W´¤§í5h
+Tû¯i½uî¾nRëZÿÞÕ^õÝ-n×£[QeåZw÷ñU?ÿÌ÷:áØ²ç¶ºÃxB¶úë Ç¸ÉÌ_ïîÚn1WàÂµØ»¨ëvt08R¬3³ìîrÚ'k·­ñ:Û¦Å[CøTÛÊ&Ìõøø2|bC
+Æ¦ënVßÝÝX§ï¡äª&²w÷9F¼Ó§C'ÿk8üÏát¸µI §ÐB
+ê.ùtÍ0¼r¹ê-¢XÞ]í®Ê«ýÕ«W`ÌEtõÓÕÎ'ô³Ì._6÷®»¶Oñ¸P*fÒ»#|4pÁ<ñl5Ý÷ÛÉ=b¼;îq(´úg×ÿÞ
+-
+-endstream
+-endobj
+-540 0 obj <<
+-/Type /Page
+-/Contents 541 0 R
+-/Resources 539 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 512 0 R
+-/Annots [ 538 0 R ]
+->> endobj
+-538 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [447.093 461.338 454.54 470.361]
+-/A << /S /GoTo /D (cite.BeKh96) >>
+->> endobj
+-542 0 obj <<
+-/D [540 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-98 0 obj <<
+-/D [540 0 R /XYZ 94.914 520.466 null]
+->> endobj
+-543 0 obj <<
+-/D [540 0 R /XYZ 231.874 247.142 null]
+->> endobj
+-539 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F20 270 0 R /F24 308 0 R /F18 191 0 R /F23 294 0 R /F17 190 0 R /F21 371 0 R /F50 271 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-552 0 obj <<
+-/Length 2457      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚíYKoÜÈ¾ûW
+râ ûE6³X ^ld/	°2°kÙjàc>,+üöTu5êI^/6¢Ø$Ýõê¯¾ª	WûU¸úÛ®ß\^)³â!KÂ¯®ïVb	W«ÈHÆ¥Y]ïV7fr½áa?fÇõF +wY¹ÍÖ)eð¶LÇ&oÖ¯º¼âzº
+1ÝìJJâ¤7¡ÛÿòJóéì4ÚNßHÍL¤é£¼li£Ãw¾-¸L'ªßâò&kÝa
+-ÒÞÌq Òò ¦Õ
+]wS}pªÛéóZë ­óô¶È^"m)Eq¿éæ,µ	c&"ÐK¦U²Ð¦üæÚäå×ëKkÓo[úõáZ>Kç
+u¬Ù>«|¢c]
+Ó}Úf»S>Á¡ÛëxÂ'ûdWu`ÚõËMùñ5ªi.k^æ
+
+_DÏWÄ4ú¾8iÌ*fI
+Ú)`hVxÂepxÎäp®%MíÊ&ß`D+hQ{lðå/`ã«Ì°ó!C^më5ºmÛÕWY0Ã~½_¼jH0âôÚãÍáxíë}¦c¦î÷yôø
+=aÈgñY
+0°
+|&^è³_ÁÏ~õî)
+·L·ÛªÞå$µ
+Ú¤ÿê0ÜïõX1Æ3¼ÙÞ§è¶²²Ë^£zHûÿy½QJMzÑC¿Ø(ß.»K»¢E)/ècNû±Ú|?Z»Á@=6vÿPP·iô~xÓ5è^
+µv
+-T·m»©í½F^G¯áÃ¦­O»K%Ï»CÂ
+¦ÜU5­ ûüóÚÊTóT­
+
+
+-Â,û\®Ñc
+¬
+[]ß;*8
+ s$x"O"F4tÖîE
+á¡;ÞÖä
+ÒaVmìÑÝ0xBS(Îd8¤Ëñpâ't8qÓ£	C"ÇÂl'QgãÞV¶û|¯îGE¬)$+#%¿ ½jPÒjðoµ*xãAÞÒø¶0«l¦3ÐµÍ¶ÎoÉý×t[áÂèWkÐYÓ¬ìKz8ely¼/a
+Ê%ÏXº?NHü
+u6¤=¬­p÷ð
+Ú ·èé!ë}ñí
+¢J.¸Øß=(­`w=Ciéõ!@t²Ìjî«®pðìÌçQÚ4Û*xÈÛ{ï¡
+-°`.Ë
+-õ¸hØô@º$FÖmÄBNB`¬©øÂvØÏê7°"î³Ú¦9ë)6fI$Î
+l°=,7*ARFs¼÷D+ìDL³$|´tç/>Qðc\3G½
+9 AôªCú
+-Ñßxîäx÷4hx
+Ì8R³°ñwÃ
+-·©sFÈ¼<`&äKÕøZó§´ò5ZxÕÀ!V
+-5Sã·i]<ZÌC
+-pD1
+-z"Þ2ÒÞz- ¹a 
+ZØ
+?îsµ	ÔæÖÂSëî!5 ïéfRßÐÀL@0ððìbÇ´N åµ7A¡,ãÍ¸ÇRdaX¨pÙá¼´¹f*ò¸}ns1OXM@"L,©´oL°IAv8Àezuî
+BÏ^Î<`ªJeL2»Ô	¸]£{dxKßmÓ¢ ÙÄ+$WU
+-¹ØAUô6wÄÞeAoäHjÀÂ:û
+
+¨×´ÓU×¦³NÇÉ :É?
+H½Ûihî/åÅ§wï//õäÙFíÄ
+,Onû2aÍûZVz
+-UnÓã4Qæ
+É?\mÓ]åM
+n9÷ãÿ½ÿâ^Î§×«áuÀÁW¶shÛÇÑ³åð»O_ÙøVåð»·0Uã=ªQþ!j¼¾Lüêª
+éÙÌÿÛe½Sâ1ÏÝ?)×ñáÙrk¨ADü¼Ô¬\·ië§#â¼¥áó^$ÑXÈ1WB)@ib¸}wm«DØUÇ#í [²
+
+î«Â
+- <ÍXÖéx£W"
+!zøJ Ä9ðooÁ§
+-kÉ¼hS)>°"US¹~J·Õm¾-âB`°Ñ¢&TÔØ:_²D'3¢¿ fTqN¦a|úv:-ÚÂ³µ¨/<Ôx
+áµ¤ëÅ=PÃÃsÕ³Söco£²V	¬Mõ£½±|Í
+-ù´eáÿÛ¯ë{ÅLÅhU^RË9ÍÂNªÖÅlÖÑWl@R1úAh?à236Êï½¿ 	
+-³Ôo±ÐL¿O~´Q¯èpR >Bb§F¢j3ºm âqmmá%rÚ-JàÙ
+-FÇ®vü¼éË
+-üñ±/+ô¤KQ:2úxdôY,gãºìÛöÓèÈK4ããq>Õ¿G+ôEÄã³È	gD.µD°kZRcl
+ÀHï¹"~¨TÑã±Ûôó<iE!°¹Xjî¼oTZàÃ«]CÕäieÂ»ük©JðjyòÇÎ½@éfKÜ¥Û¶ºQZ< ÔCÕ>£
+Ù¡hóc
+-BùZab0_ão!N0áJÝ`ÇÎpçæ %·mÕÓSÛ0¶
+¼O
+-ëX¤}Z¶ýÎÙ¯ê®ê¾Û\¸¦àØÞ¥jÖ¾¶!k§$Kÿ²]W§«ãkrÁF¼+«;È¢ð(q¿gÑï_xOþ7½ó
+ÈøælÌ§ÍÜ¶P
+°1-wÞ¾ùË;ÁÞ
+-é°(þI
+-SÔtÄjúÎ~SX4Â'
+-ËhÒáÇG~Úÿ(­=9yÕ*×æ¯
+-zàLÎª:Ý»}]¡	 Ùû[g³/ðùQH(àülC92È®±@~àRRæÇ
+-ð4xú'·"÷lwLã³`Ì^Çþ_N8
+^¡^2	
+CùL¤<sY§9~£Lv»Íf»$D/tÇÞÛ#×mUt²XÓÕÅ£{EtX Ä+]Z@Ó
+WRà²'¿æ0û[Ølslâ ô¢¯|4aItþ§5aÁÉ`Ø×ç3dJ¹2="BÖ9 ¤UZqK8Qêå)ÂwIð"	ÛêpìZj%Ù)ÖÖð¢§ß
+-=Î
+~~°È,âíg4}åN¨fyp½~óH
+-Û
+-endstream
+-endobj
+-551 0 obj <<
+-/Type /Page
+-/Contents 552 0 R
+-/Resources 550 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 554 0 R
+-/Annots [ 545 0 R 546 0 R 547 0 R 548 0 R 549 0 R ]
+->> endobj
+-545 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [471.421 562.254 478.869 575.156]
+-/A << /S /GoTo /D (equation.5.9) >>
+->> endobj
+-546 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [248.373 407.003 302.486 418.692]
+-/A << /S /GoTo /D (subsection.3.3) >>
+->> endobj
+-547 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [470.891 281.386 478.338 294.288]
+-/A << /S /GoTo /D (equation.5.9) >>
+->> endobj
+-548 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [154.918 139.577 192.365 149.145]
+-/A << /S /GoTo /D (table.1) >>
+->> endobj
+-549 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 79.402 148.032 88.849]
+-/A << /S /GoTo /D (subsection.5.2) >>
+->> endobj
+-553 0 obj <<
+-/D [551 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-550 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F20 270 0 R /F18 191 0 R /F23 294 0 R /F26 309 0 R /F24 308 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-557 0 obj <<
+-/Length 2332      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÅXYÛF~_¡GjaÑìn
+ÍYÀkÏÄdm$vM#R)óðxòë÷«®æ5æ8#`_¤fõQ×WG··:¬¼ÕWÿØ^½¼ÁJxnìÅbµÝ¯bß
+¿
+-µr
+Ò«mºúÍñýõÛ^ÞøzºRxÊ¤ÄAfQ¸ÞÏóWoÖR;ÿZ
+!Wï^_¯7J)çÕÏ?¾ÿõvûö·¯à;onon®½~·½}µÖ¾³½}ÿ'nßÙ
+oÞÿ¼yM¯<+.dVÂwJ`Ó°Q«Ã`DÈÀy~^ÒIÊ]£ÀICUçíñïæ¿{BeuV®tÚ<ióªä©ÜþR0sáÆA`{àê{l¹ºÂò½þÒfu_óGòÌ¾+wÄ°±§ÏÜÓeèäÓoÓ,)µVÎ
+ìÉ<ø×ÒÉúNr>¹9mÅ	
+òÏk9YÉ=c»±­½?VEæ®7Û§Îu
+-»Ì²>Väá{sägfµiªó1o°Ôh	µH¡ÜÀ·V:×,ÿfpäo_(§k:£ùà3«fZEÌ,/¦$üWTåGçõÆLç¤vãÿÛüDZ
+Ú¿r¯!s+
+ûvYÓ@_
+-,üY
+²2«ºfI©åH²ús4f:ûªfR{´s¬Hú·LI­	êløF>\ vä§>
+øÈ¼Ü]Ïi8ÔªfTµE1ÑöØ
+-$jSmÔ(:FÂ÷
+ )1Pì°É4©p¨Ó)gÃÇÎ9©4?ì:£3Öe½ÿcw²/âÇ'h§ .'x(òsýá0ÒÆöÌ$)üÉV|øátîÚ¤]
+- áÿÀø¼åaX F[:£(H$RR@Ú
+·YiÐï#þ&
+-LÆMË(¨END»ãóùRÓÔ]^Rôå
+ åìnXtÚö;°?J=³SFmÕÛ&9Ùñ
+þ§òk#?S,Acâ @G}V4	£é½"0h{ÊLs¤/Ïi²¶Å±6MÝY3,EBÒ`WÁ¼g»<Fÿ#fé+%§à§Aø>¤ånÙ×.i±+éJY"4iÎÈMÈÇ6êÙ`Ý$wb]Þ6Y±·ãWUûW
+F&
+Ö$^»¼s
+Ã,¨Qgº¼6 ;YDSD=/vN})áh Ç)¦<(5â>(5QÍÓÃ &m1¾Rº&«]#ÝXE1v±7T¡i26¹ÒèÜõÙ©¡0¡éx ü4Mw"Î¼3iûQÆó£¼l[Z7:Ö
+æÑ9M~(¶«3®ºV]»Qv0gò²e@Ó\o¯>]	8Ç[a³®õÊGµCµ;]ýö·J1	ÿ¹
+-S÷féi¥\)Õ«_¸õs:pE$ÌY~ßÍ>¿{7Q¾°þ¯º»Â:åoyO
+Ö^ðÜ¸Na)­]Å÷K}Ç&ö\À«Òðlÿw¥9\L!tJ¤»ÄÒFtÕ¸ìC`83r(pöL®òSÊ ÇsÒ
+Ùù§.3¯-
+x\¤-¸|^_¬±
+£$ü<4»¶ihh(kÑ?ãL÷x[YýT: 	dñÅ¥£LA
+Yxo*
+¥ëK¿ª^éý
+Ð
+eý'x/iäG®Û÷®1åx¦Ã,7ß(
+q/%¦AûXOÒõ
+-©,Ý3
+`ÖÙa!²bêéõJÒE=+°âØÅN´°2,E³V¡Pà)
+µçL÷;<o7üAwKð0G¼9,=2N
+n±Àù}#40ïië;
+¶Ü1#°FØÒW^æÀtÿÙiÛh§iën÷TÆ:B®LÈXnÑBâm¢@S¤¤Ý#/ªN<2adä¨øßÔ7mêÛ#ëì@|Ûúl¤'\ ñ¯ªêX
+ý¾8¢;¨/G&öîDñP.HïfÚñbûDÐàVé©Á4¶å "}YÛü}ÉÈÚEÜ¯ø³jM¢â­d
+ÕãgÆÂ7d:Ê
+öQê{úM¨Ë¨ÓIPË2É¬Å%d!<©Õ¢L
+|#ßà"|£ØôïrðÇ¾
+Ë]iL¥)XýÞFµOyUÌÊÞË¿cQ§K·õè(L=¥·Yl\· ÿÇtÕ5P^ñhR7vIÁNç
+Ç)-µ¹0oüÔ`ºØ
+7æÛäÂ1ô¼ÔõÅ.nê&Ñ¾|fÀ Iû¡9Ë÷m°ÕÇ/gë;_¸BÅÿ=U,©Ëè©Pc>Ìô|ø=,¦}/c¢æ»u3ÂÆb´_pÀÍ¢lí<®Ô}×ÑtEÛ,¼2\Ê¤ûåT+L/½ØéçÙÔ7¡³¢8è¯Ñf3Ë.J"ÀôdDÚ$ëG,eWT
+©/#¤2ßs}"¿R-	/Ã5¦jÏ¹Î¬@'HjÏÈ°7yÝ´6·Ò{Èp
+-íæQ5Áàë»:áÎ Ã5fÖ¯îKíÉî®ÉpëâÛÍøT-½ñ~BPðÈ¼@=NMß_¢'N¢Ùµ3âWz:®?f>m
+Ä¯~Etº¢.Øaö
+Ò@6o»vò=z
+-Q½FÊ<4~ëöãO[Év²y!ç*W¡YBcï3ód,:ËÃo^!õE¸JYÉs®ýÕ'Ý¿¾cPq³//æýÄÃÓ¯1èëGÏ[nìÜü¬ú's
+&Oâ*Ýeðìò"o­ÃÂw
+üEû
+ãwÃ³n8=;9ûg¸}úDn Ãá¾ó¥ýæûýG`QÃ~Ã´>í*Ä¾CÎ^?h,1ò35/4ÍIá¤ø8ÐþRé{°²ÞÃ¤rÞyßUÛ#I¬e8õfñ<þLf
+-endstream
+-endobj
+-556 0 obj <<
+-/Type /Page
+-/Contents 557 0 R
+-/Resources 555 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 554 0 R
+->> endobj
+-558 0 obj <<
+-/D [556 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-102 0 obj <<
+-/D [556 0 R /XYZ 94.914 658.232 null]
+->> endobj
+-106 0 obj <<
+-/D [556 0 R /XYZ 94.914 633.68 null]
+->> endobj
+-555 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F17 190 0 R /F51 272 0 R /F50 271 0 R /F20 270 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-566 0 obj <<
+-/Length 2594      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ½YKÜ¸¾Ï¯èä¤FÜ²HQ¢äÅ
+¼ë8
+Ãz§Zjëa{ö×§UTK=
+O{} ÏªâWO%Ã&Ùüåæ§Û×ïU±I\&¥ØÜÞoJBmò"EZlnëÍ/Q
+ËíN$I½­?o³<ªÚ½ÙîÒTEUsèz;>
+í
+Ò¨¶Þ´[YD£­FÛµ4ÕÝÓÑ
+
+-XZdý¼LE§­ún»½3l½ýûë÷"[©¤-
+G¡ÊpÑMÂ|mv~~fqg´êL©áü2î§vO7ã?;`SCG#5?S³ÇQ
+ÕæP¨èniÃø`hÅCÕÖm¼ÏI}¶F×ë¡×V
+-­y*¯KÚ>
+&ÁHãLÄTÅr7ûÞT?
+:%Âì·@øg¼ÂôUÓÐ`o>M¶ÇûÜÚêäÎ;$Õþfb¿ÞY&Qü@Cª@°å Bf ¹ô ÑÙ@``Áp* )G5´
+è@R±
+
+0ü<:<ÇN¼÷Û$Ðwªô#üËwÕ®6Ìy[ó3ÐÒêtjìÞÝ<ÀË\@áñ
+íÝw}oÚÚµ5=;lì¥=ÁÊ¦ò/ë«ÞÐ;÷N"ªé¯¶=Qõ¡WvÔitªzYC`ÇáYéÞx»S (Ç?Ó
+úc×EtÀÝÀXóH=SkPóEÿt§6ÙÑÁï«FêÁ£(ËàhAK¥@à05#RYº×Ç±yÒÉ±¦ß
+Ç@¿hõ¾â;Z
+%¹þ¡þá}Gê»ÎW[î¶Ça4GÎUtë ÃWuÇÓ4O@P	OJ¸ã«=Î¦,g5Ì½æKHírB3ÈrïH½ÂðÍ±_ñ!l6óÙlö`QÃhôTA&KUeËl6?À% ãÛÖë´ô+åË[¦Óåo¦3é3[µ
+AÉ °d\^õ3añví[¦Ö»Ô63ÐhÅ>Ã	öÔ£Y¤U¶jæÈL
+OßÂ/=Äì)
+áÌ
+.Ø¡;û'Zeój?ZÓÔãÀEÇ¢^_YÒÅFÇ¥NÜ0©ÅyªiUzP2V"X^ÁÆì
+`º6óRû[mè<d±ð+~DÐQòÌYç£1o°É©Ñ¾ù?ð!éòC.gÜ}è!9×õ«DÖ± e(+\k¾ÃRø2.
+-å/ü¥â.Z
+ôcPL"Î`câLà¤"ÎÒ³² ´U,Õ%\ð
+øZÆ)Àn±_n
+-
+	¤'ezÝ"pæ8³pð
+-?ûæ AbÏ
+LÕê¡fgD7gó¢À¼`xEQ;5 á_À
+- ¿Ö¦¿ï1Òµ®^r)iÊ/Ð¯Õþ®+cêxdíoC"-A\Àáy1ÝèLiV° 3dE¡V=èD³Á8
+ùWÿwþS<ùéA
+
+gC8/ÖÍ\¯¿ã}d¹ ?
+-P¨ÓÙü
+×¤åËHYÙR÷Î£#	Ô,Ý'&z| ¸DÓ¼ö­#· pía.MÈ,V]aìC¸<áîó*öáwÊÝ}³"BfZ2^¼Á%W¸P
+ë\.ÝÞ.ùsj `C^¼ u»IY,ù½ÂÜù(ÊÙbT¯dtëcwr$$vc86Ð*RÓQ!
+-ù|Ã²æqª¶!Ã ë
+Xi*Ï¬xáF°
+-ë
+¡+WßøÄ
+¥1²:ÇÈúÁc
+:~¤.­º@U_,«
+-dUªu]úðÛ¥adÉ°ÚÇ©kyÍýdG>rÎhV^ÔûÅ9VÎF
+M®®4úªp@/Ð­¢§
+K¤æËÖ'TTw43
+a|üÏ5©µ`rômjÌAæÅEà9%ßû6	KÇ¥óª,Ýôíõ@.,|Â
+Cpò\YÂgç\o®ýÈ»:Ú1³ðX#eB»)¢
+"ó4_?/,\¿'`hö3R/²¨íÀßiÍ?¦Áq»ÚòQ¤ê®ìþóó"Utñ_m§Ò0NÒj
+
+æÌoßýó»±¡IGí}
+'j%næÁåÕ_Zúk¹%2¡ÓøjfÌ#az.Rö½=Lt¢«äÑÛæ\%;s%WùJf©Bï³£ÜgE¼nQ­
+&¾ýóí
+-XÐ$Ð2N
+-½Y' ßûãÍ§ÐænÅ¢ë¦ü>
+xý·£Ü¼ënþ??qi¹ïûK/Û¥JÅ¹HoA¡+_Ö
+D,e±T)ã:ëO¹¨H¨ÁÂî\éÀ*
+âræê
+õåôyÉnÊHO ÀÞcó
+;Õ4#Yôn]"{zÅ
+e
+=ðól!y1Ä%
+ä «ÅJ
+-g.3, áÿ©Åm
+üWO:NÍ¥·8ÀT`É(V  ·Îìá¤Åâ£Réj+¹|OUã*Û2M®8Y0=Ö:Ø$/³I6m°ßÌJî®u*£KqtæÑ_Ñð¼¢d&Ðéì²Ü
+¤úxêí`<É|2XÛnòcÇnò@VzjëjùÂ¶EÃ¿¨U\¼±M3
+-cïkXsm=
+-£§±ÅiÞð
+¬vÕ
+_¦²|üz
+-í
+éLµ^û_ULµEÛ*NÚ_P{_fRanð®:ð<ÕÊaó0p×Y?Ò<¤©_ùóAËV wç³u
+ÉXA9Àg®b
+n¨fæhØ.ÊGC0ªZ;
+Ñúb []ªÙT<Þ#Í
+Ö¹ºÎÆ
+ðe:úçöýøÆ°Õ1>bÕû¼¹ã[¨ÐéýKï
+¸´
+.ÇÖ<Ælü*CÎqËßiZó
+¿U§êÎ6vôÜGÜ/?
+U§a.uã¾ðêãûVw¿0íF=4L¬³ÁÂ»¥P¥Ö!%IüùeÔTOr&¢«2´òºJÉËIRùIÒÿTl{±¾Lí¤Z¬Òq¦CµÍu7+òoV6çôÛ_u]Åî%Â® K_ÐuñqèKº\ÎáÁ³-§ïX%}n!h1x.½
+Y;ZLYâ«dÄ¸X"á*GvÎaPg
+-Mº¶ªA·kË
+-cÇÔ,
+nmÉüõd½
+-
+Óèþ°â²x¢jÁâ!`©x)ÏÎÏI­Sñ­>^BCa4.²t~(0xò¿þä
+-endstream
+-endobj
+-565 0 obj <<
+-/Type /Page
+-/Contents 566 0 R
+-/Resources 564 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 554 0 R
+-/Annots [ 559 0 R 562 0 R 563 0 R ]
+->> endobj
+-560 0 obj <<
+-/Type /XObject
+-/Subtype /Form
+-/FormType 1
+-/PTEX.FileName (./tapebasic.pdf)
+-/PTEX.PageNumber 1
+-/PTEX.InfoDict 569 0 R
+-/BBox [0 0 314 156]
+-/Resources <<
+-/ProcSet [ /PDF /Text ]
+-/ExtGState <<
+-/R7 570 0 R
+->>/Font << /R8 571 0 R>>
+->>
+-/Length 645
+-/Filter /FlateDecode
+->>
+-stream
+-xÝVKÚ0¾ûWø+1õø=×JU¥ÞvÔCÕÃ,]JÕ¿ß1±µÐK/àñ7ãïó<ÂTR¥O~®vâÝSÝ¡d'Ð
+(Éj ëän0ëI¢,IÒÐy^
+Jë;x
+-ÎVg@*B^ç#G¶8
+Vk9Dðè	9ýáà=Q°ëa!h«ü%ÎÊåÓÇ{ú"@¡ÖU,
+V@ïGÚAEÀX
+óä!àð1
+äå(+
+-¯âYøªB ìg~ÅýBÁ9÷(ë®LdeC!=©ª0ZÂZU4lU
+Q ®"äõ¨«X
+-³!/G
+Â
+-²ß3
+¼'
+-úlÝªs²dúðì "nÛ kÎit
+-RGÖylýÆ³©+FÎV´ÕóÖã
+L¨½$46q-íha0ÐÙR¼®Y5D¾¼ÄKM0CäñùAî
+¨TÈo$ðE¯ÄGóªãpAú/ø¥xü£Î¿ò«T :\ÕP³ù§¤
+-(ZúÔû
+:BÉ¯^Ú>ïÕUF èR
+ßÄpÝ¡ÅÄn	qn8·×	Ý%ÈóEuWRZaó6(Å4ÜWüúëÖÁ¥4\y´Ìeqì¸±ÿ«|ßðÿ
+N0"#µèÿñ° £s\<Ð¹Í_[Ùµûöø|Ú
+öóæ»à
+2L¼ù&¾ÌN]+·Ãë|¡]àú
+-ì{ìÚÓükó³D 
+Ê?£eÚì3[ÿÜ¯JÐ
+æju©Õ+Àf¿9¥Í
+-÷Ñ£ø
+-Þñk
+-endstream
+-endobj
+-569 0 obj
+-<<
+-/Producer (GPL Ghostscript 8.70)
+-/CreationDate (D:20100707155246+02'00')
+-/ModDate (D:20100707155246+02'00')
+-/Title (tapebasic.fig)
+-/Creator (fig2dev Version 3.2 Patchlevel 5)
+-/Author (awalther@localhost.localdomain \(Andrea Walther\))
+->>
+-endobj
+-570 0 obj
+-<<
+-/Type /ExtGState
+-/OPM 1
+->>
+-endobj
+-571 0 obj
+-<<
+-/BaseFont /JNVVEB+Times-Roman
+-/FontDescriptor 572 0 R
+-/Type /Font
+-/FirstChar 32
+-/LastChar 117
+-/Widths [ 250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 444 0 444 0 444 333 500 0 278 0 0 278 778 500 500 500 0 333 0 278 500]
+-/Encoding /WinAnsiEncoding
+-/Subtype /Type1
+->>
+-endobj
+-572 0 obj
+-<<
+-/Type /FontDescriptor
+-/FontName /JNVVEB+Times-Roman
+-/FontBBox [ 0 -218 775 683]
+-/Flags 32
+-/Ascent 683
+-/CapHeight 683
+-/Descent -218
+-/ItalicAngle 0
+-/StemV 116
+-/MissingWidth 250
+-/XHeight 460
+-/CharSet (/a/c/e/f/g/i/l/m/n/o/p/r/space/t/u)
+-/FontFile3 573 0 R
+->>
+-endobj
+-573 0 obj
+-<<
+-/Filter /FlateDecode
+-/Subtype /Type1C
+-/Length 1872
+->>
+-stream
+-xeT{PSW
+¾×@ÎÑ%"¶äÞéÎºmEEÛÊØ©ÛQ·RMÁ¼$@"!
+-'D
+!@xEÃ 
+-h
+²«¢Û:«î²¨m©ÓíÖê8ÛíìÎ¹Îí{ãÌîþ±3gÎÇï|çw¾óý>[C$!WJ+¶¦«bUh
+Ç¼L2¯¬abyU=ï|¾'<HññÖ¡
+ë}LDág?Ç·×ãù
+-$'ÿðe¢Zc(ËJ´ôkéÙ¯oÙ÷¿
+			tá?;t´B.SÑ¹^ªPkRv7ÈE+òiÂ )© ÅT:%VHOÒÉr
+\£Qëé×_§wÆÇïØÊu;wÓ©:¥´\
+GËUÅr\k Å*	}D)i¥X"
+-$)åÚrýV¼\õßÓ©re®~ñd:U@§ÐéRN!.ÿÿ
+ Ö«Ôr­Nü¡´X&W(i8B
+%ÒcD&Eì'dâ ñ
+ñ[â0JÄW"Ð×ÈýdùÏ5b
+ÉËå]
+-û!<1ÜÂç¿ÌYäe6]#®â¤U^'óª°ÙÙæp#8à2åQ¬ t9ç
+4á/È9gò  Äcàêå>Ï(s~Åû+(¥Ú
+-xA^SÍAl ß\ß¯0
+:(z ly¹%£*»Ñ:Àì
+ ¿Å
+ßò°)²/ÅoaEìË7ã(
+õô_X£·?aAU«
+«[ØX6ü{%ÅþzJ½PuÝ
+O>ºyWÄa±Ê.£§0F-¯bÝ£hÉÅÄ
+-]äBp¬Åzú©æP¶År´Àí>þ^GµÝx/õ[§Äk¿ÃaøWxÃ¿¾q¬ <³Zuúê
+c
+~c¯pèzðÊçö°ååíM<
+
+EâGÈÿþüË*¯
+Ù$ìpº
+
+Ï»ª
+-(Ö	P®Ív¨cÅæF/º±ÌÌ]v«[Ôiv×µ#è÷v
+-ê{äb6)úØ³t²ê£§b"ñ°u!ï¬òp+%Ü!¿­ÁY'²®;m³J3
+-W±ØêlÈÎ:êõðwìïùo.ÎMúFEÕn}¹ÑªC1Å¦À-
+-Oý BìÂ»Ì
+QwWqòj´à2S1/´óó-î+~
+-+ìN#ÿæYåB¶ µÝl¶ht%cÓà2~Àn6«g;L(²Mà«9ê
+D33á»À¹úù ûãî«rmôGM|ü
+-þåÑÇLêçB£¹ÆnBPkë¥p6@
+öA_,ì> `eë¾¼mOe¿¿·§ï\CSC
+UïjhE-00Òwq. Ê¥vÛacm¡
+-
+ë*ÍòÒM)³K³zDMÙ>ý%4z=ãÝþ)ì§õ5fõi=%ê±ê
+@xÝ,
+åw	$Ï¯ðWq¼ðøYE:ñ
+bðãµ»_Û-ÅmT³®Uí3ô¢
+}Ýý×|ôv^N¥¬Ê-PDï@ö¥Û0ïòÅÎá (àï
+-¾Àý#V`$8¼Kx|O¡êJG
+ªIÛhýÄKüÚÏ¬å#Ê`~o6ÊE'
+Rù"MJ¬èÞo0x²¼i{Ç	Ý÷Ç&Ðò«Ûß/TÇüzüÅMNìzNtOövXU>QgÇÚ
+`·¯?XpáÈá,M~UVP+kØ
+-N~ÉÞæ£ýÄP¹¶{AÓâFËßÆ!u°ªøÖy\:Õ45pGõ>°D
+X¦Ù(zT"³²E×ºQÓ¦i*ã>
+oÛ~^J2uöRUu%ªDzOÍ¥J(`²5¥Å²î<Y¾azA49Ü5&ÑÍÓû¬°ycVc¹
+u¢Ññ@««¡¥ÁºëÛÑºè
+xÇÑ<´÷G kûipÔö°nÁ¿VËÒöHØð7Ógû[Ú§ç)nÂ
+ãW/"_'Ià1UIþñgO¹j
+æx»õò	Ç[bÈv¶g@«ÃÓØîp¡ÿ²5hµ$Ø±zÁûMµmè
+Ää`½P£ÕªÕ}ÚÁþ¾Ám¿zI>[åu?ç	ùnÇÑàH322ÍÕ)vÈâ)çjÚÐ5È|Î4f¥ÖdcLäón.ØòÑ*N	5^7g¿íÎÖý^pU
+§ØæéXQîY&7x
+ ÆÖ¶óý3]ãÎö
+ X%@Ç,ôPÞZ/HwºÐMÀÐÌ¨ï
+-7|]+ãì¼¶6ÍÆ©½ ¬QÙXíCS1¸àµOßMË)KËnÈ¨ ©Í»Rà2çÜ9§8ç6qvä¬ìa²zpFhí×?jøÚ± þ
+-íó¡
+-endstream
+-endobj
+-561 0 obj <<
+-/Type /XObject
+-/Subtype /Form
+-/FormType 1
+-/PTEX.FileName (./tapeadv.pdf)
+-/PTEX.PageNumber 1
+-/PTEX.InfoDict 574 0 R
+-/BBox [0 0 314 156]
+-/Resources <<
+-/ProcSet [ /PDF /Text ]
+-/ExtGState <<
+-/R7 575 0 R
+->>/Font << /R8 576 0 R>>
+->>
+-/Length 525
+-/Filter /FlateDecode
+->>
+-stream
+-xµUAnÛ0¼ó{lsØr¹$¼(znb ç pì¶¸úý%Kk5öÅÐAôj8;³
+É¯äYÈ·ëpÜº/wF«ß®«ÒÝ·Ãb¿r¯Núõáö¸¥Ûà
+¤r­Uiñäz¡9H´rF­ûôöð²¤Õr·Ü?¼=ÿÚ}^üt_î»l!D°»]h
+-:NØ&±r0*É³f£Pc2Ú/Ý=ô QÊ¶ÆSE÷hãÖN½V¨
+9²TÀU4r±²y¯ 
+/­2ìú¨"¸dð@?ÂÌk÷ãvÎsñÞÐÊ,¨qWÓÇ)ÏÓÍû\¿Ç=¸ç¼þWãÄZóG>¦®×e
+-'_ÌRÔ
+½±?ûÉ8%HÉPèí .OhÀ
+c!;tþú(0
+GT¢°@vL\Ñ
+Õ8û4_¢¬¢b0µÇ
+÷Uq§4 ïõGv
+4$gÎÓ©S°§¢2+·
+-ÿZÜë.
+-©Ö<­þMÎðÕ8NÂyÐåARZ (§vì@P
+ñÝ2¯0ø
+-*ZÚ
+-öRmÉbÐ¬
+ìI¯¬l"ñ@:ãVc
+FþñÍnÓ
+\0ãéTË©Z®²áCÓÛT\ºâOÃæàØì|
+ÎÚ@þ#h
+-endstream
+-endobj
+-574 0 obj
+-<<
+-/Producer (GPL Ghostscript 8.70)
+-/CreationDate (D:20100707155246+02'00')
+-/ModDate (D:20100707155246+02'00')
+-/Title (tapeadv.fig)
+-/Creator (fig2dev Version 3.2 Patchlevel 5)
+-/Author (awalther@localhost.localdomain \(Andrea Walther\))
+->>
+-endobj
+-575 0 obj
+-<<
+-/Type /ExtGState
+-/OPM 1
+->>
+-endobj
+-576 0 obj
+-<<
+-/BaseFont /LRHNIS+Times-Roman
+-/FontDescriptor 577 0 R
+-/Type /Font
+-/FirstChar 32
+-/LastChar 116
+-/Widths [ 250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 444 0 0 0 444 0 500 0 278 0 0 0 0 500 500 500 0 333 0 278]
+-/Encoding /WinAnsiEncoding
+-/Subtype /Type1
+->>
+-endobj
+-577 0 obj
+-<<
+-/Type /FontDescriptor
+-/FontName /LRHNIS+Times-Roman
+-/FontBBox [ 0 -218 485 683]
+-/Flags 32
+-/Ascent 683
+-/CapHeight 683
+-/Descent -218
+-/ItalicAngle 0
+-/StemV 72
+-/MissingWidth 250
+-/XHeight 460
+-/CharSet (/a/e/g/i/n/o/p/r/space/t)
+-/FontFile3 578 0 R
+->>
+-endobj
+-578 0 obj
+-<<
+-/Filter /FlateDecode
+-/Subtype /Type1C
+-/Length 1378
+->>
+-stream
+-xeTkPWÞ%Àî(RKòP>¬
+-*Z;-ãLX+E@
+PMH&4äaB(Ü!AäM	 
+-R[Zµ©ÎZ©­èX+Åé´¶s·³þhp¦íþ9sÏ=ç|ç3ßwQ$4AQ4"
+-«6åÉ¤|jÙO¤× ôÚ:Öþdu±VíY¢àÝgáÕgàäj
+¢#_~.k¤H¬$ÖämHHHüïfkrr2qHûOÈV"X<¨
+\*¤;ô`¶DB¾O$Z¹¸à
+BÁrY!_"üÈ$%¤\.SëÓ7Û¶n
+-m;lT¨%$UAR¤RKð)±W*ñ	)_ \ÈJ
+ØDRÿVgÒCª*âéÈD¶,È"ò"¯øAL®Pò
+"@½HìC
+-·Lämä
+EV"jäúÚþâù5úRè+ÐI.:îzgf,°:é8-¶6k;À½}1±b ¯®fÿQ\Å.lÿq½
+ãpûä£^g ànÉn
+#Ä@Aw`9IàÂk`Zì§²Ëi¥Ý]Üo1SS±¬Ë¯
+-v4zém^Ô÷xÈ6ºÃ<Àp5ë`zü'äÂè-KÌs<³0ÀÄ3aïíJT¸Ï«y²©ê9p_úøê
+-nÔuÁ\?
+ùEÔ­¨ºÍÖ;èxÃjÚ%¼'b=êêrÌ¸cë¡¥+<Õjh³8Ü
+-Uºc +
+ÁPø2\½óûÊe¼Û¹©@-6äëbáÆTNÿåá_O¤08Ã*NM/ÉîçFÂûÀùýfe§ã8'l«à§
+Õe<Æ&ÓÚàVL.lMçWp¨Âü&=-±ÛYÓnî ¸ÛuÒPw|JQÌ{Y
+-U"CÎáØH8`¢#üèÜ
+¶Ò
+uok´¹¦zs½É(Ì/?X}´Îd6
+8fm°5à2
+¿Þ_>=1â
+-p
+-íj
+Î¨±zÏ,û¤sÓ1î¨³2À¿f/ÒÙ×9ºZ
+àJÓq
+,ÂÀÅ§w«ËOå }{SZq²[Óçîéî=ÞØÜhç58[
+÷ø{ÏOx¨n6Æl~Ww¤\³U²2.k¼lf|´gjÛ\Ô¥
+ Ç943[îrÄR¯®­ªÕ«.
+-^à
+ÇÀôè0\5/¿ï+Hù!6Òð
+-ÎÁrjÈå>êvÄhÁáLøkFÂ/
+.í)@VH
+gdáÞ|
+-bK·¦!2Æeæa"§}~ðì
+nYÇv|0Ô8{VköFyç¨»pçm'ÍÐt
+çÜèm»ª5FÞ&oþ08>Üå^¯ä
+ÖjufK%eÐ 
+-P;kG58É(WVÄÎ-Ý?36Å
+8é#àjÉXá´Ä6)
+ t<­F{£
+-jèhlgÁy×'àu
+-Ià³ôÕøqÆô$0Ý1O üÇA"`Â^Íõ÷Ù;Æ&ylØ
+9ÓÞ¡gtÒNnØY
+-ø>J\ºíqA1Ïþ.ù¾¬«-ùaz¬Õêlê°:@¬û)/õH7Öe.«ÕèÂv7i7q±ýPÍ+2Y¯Òëëëõy}/2øEhºéÂnß
+Þ¿âÞÊþÖ{]«äo:ó
+-endstream
+-endobj
+-559 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [306.19 347.019 347.782 358.708]
+-/A << /S /GoTo /D (figure.4) >>
+->> endobj
+-562 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [417.888 151.005 459.759 162.694]
+-/A << /S /GoTo /D (figure.4) >>
+->> endobj
+-563 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 104.379 135.381 116.069]
+-/A << /S /GoTo /D (figure.4) >>
+->> endobj
+-567 0 obj <<
+-/D [565 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-110 0 obj <<
+-/D [565 0 R /XYZ 94.914 616.659 null]
+->> endobj
+-568 0 obj <<
+-/D [565 0 R /XYZ 268.889 219.592 null]
+->> endobj
+-564 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F17 190 0 R /F20 270 0 R /F18 191 0 R /F23 294 0 R /F21 371 0 R /F46 194 0 R /F50 271 0 R /F24 308 0 R >>
+-/XObject << /Im2 560 0 R /Im3 561 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-581 0 obj <<
+-/Length 2601      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­YYsÛÈ~×¯`å	L03¸'­lmÚÈ{¨rÔz pDbM 4Vùõéc	yZ½swO_wÕn¬¾½øæîâíµV"ð³ «»U¦üL¨UJ_Ètu·]ýì©xýËÝßß^«tºRÒOÂ¢Eñz# ð.ß­ÃÔûçZá]Þ^½_o¤Þåwß~øñæîoÿ¸¹Âå½»¹¾~ÿãûÛ»Ëuª¼»·<qskw¼ûðÝæ
+-	_ÝS^7
+ü4¾.º²©×Þq½v²F®:Ýòè>7ÜèþÞÓ2Í
+Ó5­Þrû¡¡-ÂËÇó¯1°_xåZx÷g^PëB·Ï¼°Õ]~,ë
+÷¶};´»½¥³Õmù¸b/ïà
+Çj¼.\u#¤©ïSä¢?ä|%
+òÒ¿
+yY#§8l¯phð¦O>
+%b?	ùQðy7µétéæ¿t®Ó02
+O,êxÐíÁµÒì+¯©QEGd@·Ï|Ê¡¬ÊN[r¤
+¾Â_Ën;å#ô=Uz[æ¤é ièFáJå-JTÅÞ'â±ã^Yó·ÒUì¤Òó×>w{ZRgtËìòJ2
+.pl¯éóinB®­È3=/âÝ>ï\Kó­þÜlGÄ
+XReµhXm[ãåÝÌ*/ð.HÞnyÔµµkA]î@	¢3¼f§kÝæ$r
+>`O¥ÑÜÝÂ&g2
+éåÛ_Ý
+-yfbv(5y×è¨ä´±4KÖZ5$­mù1xOÙ¢úÎ1ÌG
+zÍìÊ*?pÿ
+àKÀfC¢Úëm{ÚðÎcKðXn
+÷Ø¶XODfÒpXÖêÇ5Ü±9ÐGóìq[
+1
+=à1
+-rõLÖµ¦ bÍÓù6?² Ã®ß
+ 3à
+
+-Ó<t¸È
+=æ,uyùÎr)aA;Ü
+î´xûi»
+dKD¢EË8FXÀ¦äL5úzJï»
+-
+
+ "½{gí¡â
+£
+-
+X
+-4x(ïÛ
+íÜyoeÞ7¹qAb
+·Øàõ·Àø 7¼$
+¦K_¤[Q,
+úI"ÇÎ^¶×dD¾êÅ¥¾Rr.¾miº¶¼ïI>a¢&8=ÆlM\}4ølZ» áfUÖÂÿ%Ø c%Ç5>QscW2ÖÜ
+ :!¨Nªq-xá¦	Þô
+ÙØ.â 5
+-8t42W¾Ðov
+
+-CÃHtÓñ¹h½H©¬,`´]îÐç1èã|ÝPAH¬4··C
+
+ì`ÁvÖÅ>^cH¦DÊðmÑäcL¶}º$§ÊðDá=!_Â©~÷v ß>k×Xâ
+-´ÁLÀvÏÊ.R®ÑI §Ç¼+Í 7a¦
+äíÐªµéH=½XËn-èÓM3Ê 4ÍeAB÷£
+-Æ¨[ËÄzÎ;`oÑXø­ûï³ê9]ç÷ðj2RÐìÁÎÛ$Y=b5¬
+¼|Ý²?©Ì{ÀXéI
+hõ±Õf*Jt0é
+.bRé Bl­@@}«y!Ø$»ãtÍ	#©áø,
+/pGZ
+%ÍåhàÈÁ&
+v±Kø~M6ðt­ìÑì±[Ö*¯±g%'þød/äM!äºO{Ýên5=ýë
+9(7]_«Wg;vÖÑ1Ü/m|o£
+¹â°1C
+¤¾Ì0?k
+ ÔÍuTwFNÑìPs, _eÒVðYµ|åÜu	ßF! ¶¤6ù¡·e×RCÎÜ×[Âf²c£#AØ¿êbbF!§ø¥@v
+J¯_ÛÀ
+ã	ªL©ñTg½á¶é¡ZÒ¦
+-ÁÇ3×d$®Ö¤ÞXFÉ4ö1
+0£ç©ÞPI-ª2zÓq²Á³AF
+sªFÞ±Ûï.8àbÛ`cÀ¹¹ÌcP¡¯Ò!¤]/RèxOe·?¡iÊ]wývf)=Úd	ÏlîèÑ~Î0<cÕýþîâó¦ÄÀæJ¤©/ÔJ&wC±*ª	V[A×¤«'ZY­$8Ì«.~à9y	_	IgañNäQNçTCØ'¯C6eeõÏÈ:
+|
+¢`@ý
+#<7ýýÁ
+-÷Ï=,e#C_Êì4|
+ãØ<ðudg	Xú52|²
+§d¿(Cô¶e?æ È 3³´ÑBF
+$DÆñë¼"
+fÛ±á5s$l0lÛIªiÎ©
+l@¼
+¦
+-ç
+wr3ãaB5âzÎ¨ËÏ½ö9
+UÞr}lQÓÒ
+-E¸ìF
+-çÇ®hÓì ã`Ñab}¬}Ü~N¨¥`
+ `e;<ih¡lè	¢ì,FÌiçí®¯&¡u^.Põ&¯&hÇ1DjEHÍÆFÒð·¢ßêv5\K
+iË³È%[{àø¸BþÖð4dgÇaÉÀP
+-|¡³'2b/ÝS
+
+¾c´¦£W1I
+f_ds
+Kõfæ§Ù à6ÂÙÂ_qi
+4íjñ
+ª{7Nèñk¦b9à9¶`[JrB 
+/ÏàÏ
+-OíºØ,°¯R?M©7\!¨!£%Mü 3Ë
+-ú³8bûq&çþõýú [ùqúÇp4Î|àG)ûÚ}ÕÔµ0Mö×ÁmÕ!{Ã	_0
+-ý$fÜ¼ êIèQü*DÒÓtFtéË`­ @ÕX~îÃPq¶:U ×%
+-Ìqú.)\	Iô
+-h;m_Å©°í®o
+M¤±ÆÃÓSÏrÞíÇ2<$a
+ì
+ ðÐ©#1æ(-û­ÊÃdúxÂo««
+ncKM~¨7ü_
+lr¨æ/Äü ï@qá=4®²Ê¢©*¨zÍ_f¼àe	øò\¾ÑÝ;Â®ë¢ûÅ¥qHùLýÁ¬,JýH*:+É¾
+&	yÇ«M
+ÍÈY=è0|O^8ß¾e¹OsÃÇ
+uÒyÝÙ³XÁÇjsòÂ°ô×ÏD1·}åþ2ùðð¾¡nGfçáØ1YÛ¦|²cãkg#²-¥Û2µ¶ú¿»C¼#>EpÆè©8_ä´pçqµ)ofF
+w«1¬þû?H¼þ]Ú[·Á¦ Vwe}ì»·PÂç÷hÞàZ¤ö<P;óE°çÿ+8
+-endstream
+-endobj
+-580 0 obj <<
+-/Type /Page
+-/Contents 581 0 R
+-/Resources 579 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 554 0 R
+->> endobj
+-582 0 obj <<
+-/D [580 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-579 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F46 194 0 R /F51 272 0 R /F20 270 0 R /F50 271 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-587 0 obj <<
+-/Length 2729      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÅZYsä¶~×¯¼q*'ÛIjsÈv*Ém½Ù®Eb$ÖrÈY
++)¿>Ý8x0:âMü²Â
+-}}ý5¸ts»¡¯/þt}qy%Ó
+-£$£Û\ï7$8ts]n~b"¶;F)Þ¶*ò¦ÐÛ2ÊëÛ¶«»CUàÊê'Êît³åi4TùPµ}Ôîíº´ÇíäÚÊÛ¹jÐY×o¾þÛåSËJÎM(`'º N¥Ë+ÅÒ;K"¤±²./ÝNÍq
+ì©>ébhñ
+¾Þµc(Ù
+=gAz=¼XõUôþa_.åOÞßÑ·np½MEo3þçx¸±£w
+ò[£ò_¯/>^ 
+èmxÌ@½tÓ¤\nÃÅ?ÓM	a/"²tsoDAx"`To~¸øÎÆÀÚf<Vc ^s§Qq§³º;b­W»oÜ
+ÞÎ4³
+-vb¦H"÷Ã¼|¡jn_2Ñ»ú
+Mã?ý÷¶Uh}^÷ú_NOãúÄ¯·s>9´óñ^Óºàüc(&w
+-L5xJ²ÄíõÃxÓë£Ëú½ú;xI"£á·cHÕ­ÕÿhVðû¢)\:ÁTT ÈÏsEîhì$rKA?áò~¨q0¹g@æÑsÿº¶#­æ °Pl¹ÝqAÖ!4Ù;Ï:w{G>õ;zprÞy+/Þz}§´ªL¢wyÿ÷Ýq,£¢=@æit­TQit +t0¨¬áøë|
+-òU³o»7%L=¡Ym} síü×n\
+- ÉcÓÊ~  Ó·8v&¼>U¥Bç5cJ¨ð×éOmýI
+ÇRîÝat×S§èCÔ#¸!©Ö®mßUe©
+^ï»ö`GÖ ðÈDîÅ$4Q YF'8pïtïÂß+YvÎì.õ«Þ¶¤¦£ËÁÒC4þåþ
+L~5ÚÂraJ'Þ_åe[6à\¬»?È#	¨âVíN·¯ïªÞj,)'©Xùr:RX
+Lõh}
+³7F3;v)D·u{»t[¾â­3ó­Ì¿g´I3
+úù8´ä
+ÐNvï»³~È1
+¬¢2"['=øé¶Ë¡ÃIA$
+-º(©ã1hkJIS>bëz´)F¤ÞT4]$[}Xsl ¼Ïª®J÷è3Gßn±AED7º£x;6¥
+VÍ¼­n¢gkÕËªÃÞ=äòÎ=¸¦¬Sòú_ÓÜÊ2!«pIaW1G I6àýL)n°§1É À×dJ,ãÊ0µ{¦¨¦
+¦é515xd°þÎL
+-~`aâÆê(nçgj x<\rYòÝâhh Òý`QQïc	`ÏÏíßéY[ Rvæ0(ûØú`Ç Xíà,AÓUSJd2!Â+öKûx	
+X"f,þvËÁÖß»W±MÕº7)XÔÓ
+-6ÁÜÇI /Tj}MÙ;;4NÝö ½²}uÛ¸e)ì"O4ôDïà
+"`²þp0°±¢uÆ3ÖIâÏj
+¹SBoù4EûLbØEïú°	¯rPÀí`@¬6#`Ìs(^Pã{/äA+Sïío[1tgwAøÀ'yÕ]¾<F$D¥ÙªÜ#Ömw±Ì¢o X!Â%ËìVBé¼	&æ8ï¸Yï§òÁÎ¡.8SjLÇ]Ó¾¢¬Ö»è0c[f°BþÎâ?ñf<ÂêP5º·ïÀR =I%_áÒª¾éó$¬.C'
+^í$=×	êIavÜuï<kø8æ}µÈËG×t	E>²Jâ\«ÝwÇSpJêÂ,¸kSÎë~E¥Ä²
+Ñ>&¾
+Ö!éõúÌà èÐ	C»W<yþä	Ib¾Yþ>
+&s­®Â&PbêÎÏM¸ä¯4ù¾*«	1\&
+ÒÐL.NÇ@XQHr<)3½jbTKçM16æÏ­#³ý	UÊQü3¶c¼<¹¹1¨OÖ]ÔIÉâQsN\ÑHÅ½¿À@JA^¦J¦5Ð'#°MB`úspDo-Ðè¶Üô7arN2}ò«LÎÖ(¢wÖ/S~ò,yrK
+À
+wÃTV±(C&©Öl¯¾«Lñª¦\w@yÝ·ö~8TÖm5x|Ú;äÍô
+ kòã±foèíÎPDÈ
+-Û¹ìx×÷ãAûãäîrªmÜåÊîmn	³&º(Dâ*a
+¾R;IÜ>8÷¤
+)	µgBß²`0ë
+Ï/ú%õÈ§uª
+éµ~ôè|yæ7ÃTÚS²±%beP×5ap!ÕÞ
+¹í¤¹ê©JyÞÙ)\®3¿µ-ÌÛû«B®&Æ¸ë*|ÉfÁXXïuj³`Û6sÏ[Ý`¬ÚRû9ýçüQKG£xïÚ:Ì¸¹îx%g/³ä¹W|K~
+ÆV,Y¦æfÌaRbjI4¦áP!×Lù)Î,÷=ý×[ØA&é²tó3á3Ë
+ùÊ^£õÖ
+Î0|.8{ZP`¢hFbfà4Ñ?LÐisÓíR
+:ÅiÔG÷¾Þíe 8`£
+ãÀ)Uñ!H±ÕÝñÎòêé7F¡L$âô0òßà Áú#ÁGPN$~: )|ûpÄ8aæÛ!öµDü
++_	³b³W¬NvÀl
+-Ô¯;q(k ¹ÈTt×Ö¦áÏ¤%87ü8æÕEîÉ9ã1
+-¸þZÖ;)RxÐ
+r£ß?ÚbºÍÙâÕ²%]¿ÁBc:fs'Ôi+§ª~pÖÉ]çA½Vâôv.Ä°ñþ9ÍhJd
+Ïq¸´$s»ò
+åÏrì$M^æ»
+/W_à»0Åþ7|×|5IìåªÿÖq_)
+þb¢ÞÔùgº|©Öáös;,lì3÷£ÿgí^Â·!óê½Ë ùó:â=â¯å[<Ùôm:X4O¯ÆË
+8Zo³sm&1ç#@ÍFÌ¢íJGcÇ ?
+!xGx|#¤`[òj3 ]S<ºÞ¦ÀÓ*ø¡±ú·vG¸séÖÆ¥î®ºY|+S6q¹È{
+:*²§kó¾pOÈIÆÕ³·r=³2ç:°dY!~Q·XÝWÃMN÷®m/ûÌxXf>OÒé'·Ay¼þDJ<û=º·f=vö%Í5üdo¯{æuO@!Ü|°êþá¼¡2}é~ÎwÚ'qB$ácÞ
+-U1Öy7}ÞÅt°ê²ú<þ/PØÿ 
+-
+ñÿ
+-endstream
+-endobj
+-586 0 obj <<
+-/Type /Page
+-/Contents 587 0 R
+-/Resources 585 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 554 0 R
+-/Annots [ 583 0 R 584 0 R ]
+->> endobj
+-583 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [382.313 144.421 395.215 157.323]
+-/A << /S /GoTo /D (equation.6.10) >>
+->> endobj
+-584 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [399.749 130.872 412.651 143.773]
+-/A << /S /GoTo /D (equation.6.10) >>
+->> endobj
+-588 0 obj <<
+-/D [586 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-114 0 obj <<
+-/D [586 0 R /XYZ 94.914 379.618 null]
+->> endobj
+-589 0 obj <<
+-/D [586 0 R /XYZ 507.5 286.289 null]
+->> endobj
+-590 0 obj <<
+-/D [586 0 R /XYZ 507.5 203.225 null]
+->> endobj
+-585 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F49 256 0 R /F17 190 0 R /F20 270 0 R /F23 294 0 R /F21 371 0 R /F24 308 0 R /F18 191 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-593 0 obj <<
+-/Length 3188      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚí[KsÇ¾óW |Z:ÄhÞ¸rPdÑË++ÛXñ`ð°¤¯gv»
+-+®ä a
+º{úùuÏî|ðÍÅ_o.^\
+3
+Äàæn4
+B¬WL(?¸~*´¿üåæ»×Ú·W
+-®â"{9óâå×Òÿ¼B/ß¾z}9TJ/¿ÿæßÜ|û·7¯è]|ýæúúõ¯ßÞ¼yyéuqóæ·é7o«_|ýÃ÷ÃWÄøWâöe
+zË7¡2Ì[ä¸¹ôªX\¥Eùáqº¬é*Öeút4þíÒb4¿-ÇÕ'ÓûÅr²~MnÓÚñäg.T¹,ç´õd´,æiíâ.-Ymné»ôËõÜ#^|±¤§u¹TViMÜ
+ín0åðªÑ!íâURÂãrq)]ñÛ¥(&ãr47Bß®£òv2¦Oî6óÛÄ$,t
+f
+
+®¶×ÝcÔíë_|Èb ­b\ÚU©·³~á1¾ünÀ
+-~ð>.
+-ÓÊâi:øÇÅß#u¹Ik¶2ÒrR'¦~æ3Æð"¨]ËzÎµ¨ìr¨5<cöÿ0Z¥Ý6¸[L§QQï¡sQÜ§uþËåÝè¶üsÇ¶
+eDÇ£¤06àÁ1.l%õ|]ñÉèLËÎ8ÌÈÝaÁº:ë²&0
+îDËqÑÙjó.c6áXºÎ!I£»"¬G§exkÁ¼óçá­
+-FtyÏ7³«ñbónc
+<3A
+¹âØµ]æ×W£}¼¶ÌË3ñF0ð°Ã{¾ ^Î])4Lyw)´¬¯q¹üvU>®è_½ãÌ3±wycÒ¤tã»yòm.xô`8ÓæÄ
+	h!8ÏÙèÃU¯V1ÎÂW»	}¾¹
+-uis
+®°&®Ë5 ÃYqØÞ³pVÀ¾²YÃ_m²|¥e6­
+,XÕeKùÕx6eE,{gámuôóï}|+u
+¾ a¹éòÝÔ
+af°´f«ÖMeEõ­HÂ& #
+ÌópZQ
+2¦8¢eÅÓ	rs!ÎÂZI¯;¬Q¾ÊA-Qt
+-Y^¼¨ J#h|
+7'²&|©¡DàMQ ºã &)ôn±¬à]N³*8æüÄíõDFÉãä
+-û4»
+(Cô£G_î«ÂÇÊb«LOr
+KÛ)^Ë|5Êp¶o.6/¤^¤oG]]ÃÌQåë·ÙãfÝÎeb+yÇgG¸Póý
+-¦s
+-º
+ÍÇY:Àa¢é®692C©$òLæ0=ÏKàX£y0
+Î¦ÌqAB3 ZqùÅâÌ5MÃ_r4DÆuQõ±92¡6jû
+-a]~ß»Jú=Ñ³H¿2³u­öÉ¢QÑ¦ÙÇhy¿Uýß*
+@þ¼'Fû£pÃ$|ø´ä(àåaå£'
+
+®JýïÄCmÿÄI@4]
+J^ÖC
+Äïþ
+.áÃ1_tôMyêä2qÎ²ÎësX
+ÞÎÃ}ïf*
+R{
+-¿5§eq
+h¹zÁ{¾:"æ¶áôUuM½ráH}ês
+Mæ£z?ØÅ.Íö4ÖLøvõTâ4§IHîSEÏùH vGkÍ8q¼äelwþI±LhóÉ
+-ÿÕVPG:jÐ%
+-ºzA3é:^}>\¨*G Ö,	 zCÚ-z­ûð¼¡[@Mï+
+Ë'³4 
+Û>63úÿ]ÂÙËnª1q·XêBâìHE§õê!E8MÍ+ÚKA>x®Ö 
+7]®ûý_§>yvýYFª½yÔÎ_æ´çáÓØ0§­
+t*= ¥]5pÉ§Ã¸ßIùd]k­åµÍ®Ís²|:ð!ÈWKÁ[&M»³/WL!)~Ù2ªqâ,v#ZÊÉíÈêöÆ£õóßÙz
+-
+ÊN¸Õ1©x%OL
+.&#eeÐ×ø9D.cCÂr¾j
+-\Þ[
+ ü¶:~Èbe~
+ÖKu
+=-Mnýyõ°§/CyzÐTF«³ÀoËe;¦¤ñ®jæÇ(] Fqt½ÜtNI¥FÏDËñÐLÁr;
+iópµÀßÞv¹Î7³úÐùZÛ(dÒ£
+@^«sòøÆ¾/Rí¢Oc¢¾éJMs>WõWâãwÍtßÕ³Kz³Yã
+Á84d³Þö6èLÑ-¸Ç²§Õt$ünÚ÷¢Iõhùe0LpÚµ&	!ÒªÏ~¯óó
+-ívÆ=Zp½¨ý§°?]]8øJH¦¸|¦øË2g¡r¹JÇÞO·n\Ñ{[·}Zµ@zïh(Õ¾x·gä¶kÿ,HÈÃ9dÂ
+¦XMæ÷±LKÛª`é«uù
+å ëílê³ÎÄ1!ù¡xB7ÈºïÈÄs^
+Ä­}*æúH:v^0/NóYOIY!:­Üª¹({ÅE=lSåÉcA¨üd+ºÇ¨
+Ò	`èÌ±-Açx´I{¨âVEZÛs¼èêi¨¼n]§êvÉ­¯ö+MÃÿ¶r:JwàÈ»·ÇÑr4+cÉ¥vlëR
+åê
+ººÎ³në±5©þ-8±g1vÈQCÄ3ëg@m;×ÆrI
+-«æ=KÀ®JÀ®}µ+¾MY	­Z5j®æ*0ïÒ\Í©Ö\eue,|3
+­Ó¨/q©O%cr
+ /hx_Iµìýdý³FoêW
+-´2ÙIø&]eQÖÄq~.VÀtIXy"Dæà x¥Ùa£¢»±Ê
+/~nö6Rrq
+á}_
+á«ÙËSÓÞÈBÆ1úÀ&¤JwÎ±	©S¯ÛDÿÂ
+OYõ
+\Ñm	ª>GÙyÛ$Ý.R .ÔG{S
+ oA
+JsDZ
++­zëîðKQ4ïÓ×ÓEÊÉç©H^ýQÈ²l7çå¸kVó
+ÑCpGW;²ê±/Ø¤§
+fÑàÖ;Êù5_oøö(ëøók
+þè-$ýö$e!²´±pØÙóH4¤*Ó{­ÜB#õÒVHÀ7ÉóÁ¬²ò$æ×^lbz
+ÛÝb±¤ËçûhâPAôõe¹:8Ð/ &Ú{êkQ7Ùbf©t·eG*zu[ÒfrYè52
+,´©w¶¯tµeJZÎï1Ìê[*y}Øþ}tyW> uV<ðn­Éz´M[oGgøAo2êWyRtªµð ë	`RÕu=J
+-Uâ®ö\RÇäû
+Á¯ôü¥4æuÃ-ob:á?Æ½ô®{ÅL¢FUQÝLòþaR÷(ê]ì¤}¿ôÆðíKsD<
+-¿ÞÚçC>>ö5­ºÛª%KÎä¯±Ô
+¿Ø%¥zÖ
+-_suJDÑOW¯·«úx íü{ð ¦3ßvþS-§39Vu¡q+ã
+g¼VzR½ë|_¢]ï
+s
+-¸CQ#¼Þ
+U<l­ßçÝ¢÷E7÷.Ïº«,Â
+ÒÐ3
+/ÑïäïçNæ(wj¶BGàq;y°Lä'C©Q­+ïªôM4{·<âû»ú¡BÇ>
+0¦¿kÂ§	RW¿%}Ä%ëZû8$§/V`GÐDcïrÚvòDÿÆ­G7§ñ#r]{Úô.Ã	iéàÂ\«}x.¶È,Ëæ/ÆÖ4~¤?}ÖI9]ûT_Ú9½u1§2PÒ+2Æ-Yó¡gÀíüîÌÿ³Fe7Êá(`Pê:íN
+£4É®
+]uKw#Úé¨EW\Oæ£é4;^EºUv{¤¿ê/ãê
+×»Ñ°¶7òaØc|M] Y{ 0Á»6Ø<)ú²|mkN¨
+-ª×Ð6«=÷ZWçYàÑUS÷³£N%·9¸>o.ËÝ.Uìºb1§YAç®Üe[Øç?î4Õ6
+-endstream
+-endobj
+-592 0 obj <<
+-/Type /Page
+-/Contents 593 0 R
+-/Resources 591 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 554 0 R
+->> endobj
+-594 0 obj <<
+-/D [592 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-591 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F49 256 0 R /F51 272 0 R /F20 270 0 R /F21 371 0 R /F24 308 0 R /F23 294 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-599 0 obj <<
+-/Length 2289      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­X[¯Û¸~?¿B@_d fxÕeQÈæRd±»IÑÓ§í¢`$Ú"K®$çäô×wCZãÛ @L
+-ûÇÃ}Â¿Þýx÷ü.ÁYÉKÜïR³Rè$+ªHîëä·4cz³óôEýic²ÔvÛlÒ©m÷ýÐLcS!A¥uóO.\·E:5vjú¶ú
+ywÚleºî÷D8ÙÁ¶­kí4ôûÁ
+ÇÍï÷?=#ÌR;-ã¹ å½bºD¦;
+ÌI¶kP['[eXâº?8hàf7½\M¤zh>!Á
+-ôÝµú	w
+Q[`ðtÚtÄ0ÅKÎÖñ4®[Gër©¸ÔÓ³â¶ußVÏwÍçSßt;üåµ+Æ2
+b­ÌJÑp
+Î@@'[¡Ùþ2jÒU{®Ñ­ô7v¼HÜ·ýÛ1ô§M
+`*Ï¯Lòÿ?aOÉYVD~{ú#dG¡Ü
+-ÍË!·^t$Ø}¶ÇSëH£ª÷A¨
++sÉ¸	Æ(O;!S
+-|@/9¤èØÓÅ¬À»C
+-Vx¨Ùwv:a®.äéîÜUÊH¦ÐQ2
+-A
+lW=mØ¦÷û¼)òYº@|?<Þò-_Ç1øbïÖ
+-jaÛ]h1<åÛ¥æpÓxòDV#g XQËÂtXø
+¹·.|¬¤¹ð\>lùÂ_,|Ø
+
+U6>ÕÜ
+ "Å^¼z÷óö%8Ò(Ð¤ãm@tOôª?Î£Èç k
+-?Ò
+ü6"½h]?Å¹=°R¤,Àª1
+-¸D¹éöD{Ð¢ûXß«ã½»|´-åu±¸sÞ£!J~äÆ
+Êq\Yt­_"ÿgà®ª	[·ÛÕ­Wí	\l«
+-dþ(Q
+-ìÚ+¡Ò´9!ãã	+c3)¬
+KVXSªKõuôÙß7ÍÞ®Í³ÍÖ Ò?
+\$K¾ßÎé;«ÂÅA
+zåÛàëm°¶A!½
+-w
+¦óiõj\ÿ¾¾¿CæH¤ðÈDåi%Õñîßw
+POKÏ±Xú­x.¿=êäU÷7ø·¶ñÎíâRÿ_mØ¯ÍsóbQºèxÅÊÂ|Vv9gá
+ßó:g
+ÿã
+-Ù
+-ü¡ó_ JB$F°­±YpPÔF¹Rè<Ö¹ëø «sË®Ú	\n[¡!EÈäªxÎü £Mú£
+cÓZÊ1(þ¼APðM
+u7*=61q¹TZ¥.}®{¥ú:ðt5Õ©R+#¢¡P¹¯rãx3}ÁiYz 2ØBv/î	Zètª÷
+:óôa:
+ä%äu&R,!\cC ïOó;vBÄ²#b£Ð	 k{
+é÷¶·ky²,ÉkðK>Å¢9\Ô?î
+nOØ
+q_\7a³ïÚGZYú>crÃRbâS
+-§<Ú.ð
+VèyUÐÃ$Ò=</Ã±éið¤|grÇÐuB¢Lï½¿û
+$Ø!ÜìSR iíÖEÉ6È	&ÂøîÞÄdô²ÑAcx¼`ëqaG_ú?O´Á
+-Új:ðö1Íôâ]ü«a¸Iÿ1~Ñûæ Yl?0`/}ÐÎ©¹d
+-úZ&
+-âo¿ó¤½fË"yðÇP'mòwÀUaVò4ÜQÊ_ÅM@wï_ÿ
+-1¹ÑZ(ÍT¦£zÏ¢ÇÈHµ´þYhµµñÐ|åjl±©¹
+~å*¥¦£=û'!GÇ§=ï¡d>%Q!
+rc·cEhÓ`»qç Ljºs7ôÇ+1T¡yHæÀðe_2W,y¨<Zç(¾jî
+
+Ý(1Ó	
+òÿÛfôvz~ê­Y)B2p`¢xúfS èÄ:! 9Z@u·ÏWvt´òm=ð4P¸ó
+A` ±^Gõ2w`³!ÊKÇ"ùÂE¸Àé¾Ê¬>útÀmô
+
+¢6£={j;Ù@s
+#H¼ÆÃîàä;
+Áö_ëöñVÙ~9°1ó*Z²
+PâmÔÿUBgLäîâ¬ Ç^á`&¥ÔßGp¡Yµà__Þ°54$XÏaàô
+-6,>\>Î#õÈ
+-§p×aiK­çW@	Xa{¤ß¿©bsÂsÊC®}$WíýÜ¥axzË÷ÔJÄá]^¥³'­úÏ}1¸®êÏq~%VÇêÞPÅáÆ9á'bîL¡?ïAÌènå¤Ç=mæÜ\£
+&¸pc° á?[D2
+øå$;&x®_d¯
+-QÄûcÄÜ@Í=}Öup¶ÞÁ#Aê´ìÞaô5
+öÌ±°
+o(5Ï0FÃh½Õ£;â¸ïûÉåD"
+#ÝÒIÆ¿À[ÿêìµ»N5
+tfþÙ@²O_\ûI5r­< ½HìÞ¼"áÛõqÊ¾t©¸úáf?
+-W.ñÑÐqæO'¼|y
+}&¾Zë?ÃRÓú)¬0(¯r&óìë!}r- c­4eðzá]<Ï¿Õ20©Ëóú!dôêJG2xá²µ¿ÉR±
+Úêïb2Üedñux%øàù{V3¸o-ø6<o%´rê*kÞvcSûi!¶âåò5F2×¡óQ¦x0¶¸#}mzJÿJwDÑÛÁ¿¹¢Ldéëù)°]Q{Q
+-è~L
+>O¶ç
+-»¿àGíê¦²ÔÂçW[ªØOÍÐw¾záyFaªøÇ0ZÌ#4R¶jZh¡\³WÙI
+^Ã/ðOAU9ën7¤Çÿ`52
+-endstream
+-endobj
+-598 0 obj <<
+-/Type /Page
+-/Contents 599 0 R
+-/Resources 597 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 602 0 R
+-/Annots [ 595 0 R ]
+->> endobj
+-596 0 obj <<
+-/Type /XObject
+-/Subtype /Form
+-/FormType 1
+-/PTEX.FileName (./multiplexed.pdf)
+-/PTEX.PageNumber 1
+-/PTEX.InfoDict 603 0 R
+-/BBox [0 0 524 303]
+-/Resources <<
+-/ProcSet [ /PDF ]
+-/ExtGState <<
+-/R7 604 0 R
+->>>>
+-/Length 974
+-/Filter /FlateDecode
+->>
+-stream
+-xµW»r1
+í÷+¶¦XlÙòã
+¨É-ø HqÃ
+PðûÈ¶üöffgIÈÏQä#ÉûkÜEøáß_ß¶/vÿñgÓî·¸·¿|ÚÀH»Kvã¿
+³ûs{l¿ÈI	%h#ø>7Ýü·ÛëZÃìà5
+.  Ùz&K	á|ÏmD±¬­»ëuûòaÿ¹y!9:
+ùÀcûL±þX´mÐêôûHx'äë
+ì¢¥o²­ÂÊ¾ç¶4MÌ=rÉ.SrÒu¹Y 6ô¨Îé(¯wÂ
+Øµ÷H¬céÄÎßß_þ¼õ 4½<±\DivæÈ´øk	eöÖ;H³tÖþë
+->°g½ÁÖÞ£«8¼TªÐe4Õ[®?î3¸¯Ö/ØCz¿X@PýVÞí U)"^@$I=7mìáx¿^ (ø´ú
+Yº^%Sè± Â
+-jÕöª9¾{f&
+Q×ìÜ´þ
+öîEB8
+¤TÀ%&O6\*ïêz¶¡âãÚnº6¤½CºçhÎQK÷.c(»1¯¤7ßFCº\ôÁ3ËÜºèSo2è>ì,W²@¼áS-ÇY¡L!¢	mÁÈSÞóJÏúöí 4,<ðK
+-)©õ¡kûPÂ%»
+Ú(5ÙR`ôçìñë
+¶9Ç©×¾14B!XüsMAÇ7C^É0x
+³¼ kA°ÅåS|OlCF;VW|Û¦ILÁ¬
+½SçtazÝwMµñ¾RÉdÆÆõ[ú_]­yÅP*®AG°¶êµ
+-fø£¶jñvtQ¬7â]j¸>´±	ê¸þg®°ÉÂòú¥#QðV65²àoM
+
+-vIª6_
+oü­J
+éáf:êdëåHºìprê¸"ò ÝA´â{bóW'©Gîs§×Ó)%`¦÷aÑ
+Þwñ«1ÞÍÀôî+ÚÌYeåZ~ñòíôK»¨Añs·ÃÔjW#êgÆ¤/P¸dL·B^YZ@-ýº6@©ÛF Ú@[:³m±-µ»v×øÑD
+ºçÀÌ7ÒiÙVnO¿Ïî»SÝ¨ª*¶ò Ì¾g¶6ííÏsÚ>¦`
+
+Õ9]Èép×tn+×HÕfÎ*+A¾½\3³ÍjàëñßQ«­b
+"GÆ¤¯\µ#cì½¯1Ðá%'à
+-endstream
+-endobj
+-603 0 obj
+-<<
+-/Producer (GPL Ghostscript 8.70)
+-/CreationDate (D:20100707155245+02'00')
+-/ModDate (D:20100707155245+02'00')
+-/Title (multiplexed1.fig)
+-/Creator (fig2dev Version 3.2 Patchlevel 5)
+-/Author (awalther@localhost.localdomain \(Andrea Walther\))
+->>
+-endobj
+-604 0 obj
+-<<
+-/Type /ExtGState
+-/OPM 1
+->>
+-endobj
+-595 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [155.933 512.597 199.546 524.286]
+-/A << /S /GoTo /D (figure.5) >>
+->> endobj
+-600 0 obj <<
+-/D [598 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-118 0 obj <<
+-/D [598 0 R /XYZ 94.914 587.228 null]
+->> endobj
+-601 0 obj <<
+-/D [598 0 R /XYZ 162.101 361.454 null]
+->> endobj
+-597 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F49 256 0 R /F17 190 0 R /F50 271 0 R /F51 272 0 R >>
+-/XObject << /Im4 596 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-608 0 obj <<
+-/Length 2788      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÍ]sÜ¶ñ]¿âúv7ÕÁÀÏfüàÚV¢§2m'Îx 
+ïÄ	<ó£þ}w±
+
+y>2ã>è.Å~/¨`±[ïÏþ~}öêBF
+,Èäâz»ÈBÉp§ZH.®7_Q°úíú¯.Ât)U"B
+!¬Ö2åõ*ÕË7?¿ÿðþêjµÖZ//V*]~ü´R.ÿeß|zGSï./.ÞzÿÓõå\v}ùñ'¸äçw?¬ßâög3}ÊñÚ1²ÖHãØºÁTbµ`é¶X­Ã ]îªæÆT4ÞmùßU-MOà°èh"75²åÍj­eA/y³?
+}±!¡+ë
+Mô·+ézs5RmaxM¶,kö8 n²¥©7xH8àZj
+â`ZSU éXá[ßáP/-,1l:ïË¦&pA'«°s în¶ ùö¦uÀ0Ü­,/y¶ø:-
+ ¡Û×ð¦
+-Ò¶EÞO9gñ³tc®#ê3oê
+DRÞLóQt8
+-Ç´´-¡ãI+Y Ó	»E¦Ø2iÏ
+4!äQeñ¡3;
+âNã[Â(a0ÞeE³[UÙEr
+bNöÍì?ËDigÿp²m¹ZÆÛh$A§C]1íQãv¿[Ó1[
+-q5Ú
+¾¦ï®	ü£Ö*N
+ÖÑLòÍÁÖÃ°Ö 392±FëæPÔûÃz[Ýëo¾÷q/µ	HW¢X´bsòí
+-qá1¢*
+iv=È£# ;ÓÎ¸Ò=t}±'à¦`«7Ù.á|d©ü
+£¡ÓdîP
+Ä
+P
+T"'no°4
+Èl«8e-Æ·îÐ6»Öìé]È>«jèúÂ nè{Ç@qoöªÓñö$<ò¾àj>1§ÙÔòÀHíLY[¯Ö6 x6j´f¯{e6¥aª/#lÂWÏ*A:Rq
+
+
+ceC¸NDÂÃ@¤¸Îe©"È(Y¸Dÿ× (rÕn
+Õ"´»ÌvCú <ª§J~
+³Ê)· `0BeáÜ5Óäð¤DÑvD RÀéÎ1'l® ÜW5=Qbm4ãP©#&3bÇ]³íqÙ
+þ1&G¿Û¸c ¡tôrcl°ô+ Ncr^2ç£
+-<»¾±{ÁlMoTyÑu¦} WrMÄ÷tÉ$(M:`ÜnLçpÙiw
+Ã¡*×¾T[¢61%.1áKìÒQ2K¿ö½!ð®-{H@ôÒ
+`Hý;¡¤Ö¥¦ÞØDTÀªÂ
+-óÏ
+jyÉLµoº0H~HTâx¸
+Hà9Î¾0ö0Ra0ÑÒ¦Æ®¹´qØ´ÆÄ³
+µF
+OÈÙûZ»P;¸¹r_ÐÔf`böxÒÙ
+Ì÷¨Ú£ö`n¾Uì«nä,GsONð
+Õ@*³q¬³9VM5½CªótçÌÝ®i¡!o%à
+ª¾¤`W× ÜCðçÑGØËÚsÊeO+JÞ¹np´aÏ)8ÙhV-5ºß»ii¢=µ¢«f¦Ö®9N MÃï·¦÷,
+]®z(èÈ¾ßq42i QBÇ5o¶qG+·PoB	ÒÑ¡Çè Öá©%J1qq3[îµ)Lb]
+r=aZ¡tPgÖCZt|iÚ
+-j5ÔÚKbxv¹@cÇ«0Ð-
+-Ã\ï
+nÌÒL0
+Ý·	D9×>*p²IKsÁ(á"YP>
+ªe
+TÄ½QàÍy"É * }\5ß0*
+KÈ{­X(=
+
+ÈHJòz95­­D§ê 
+å}s¢b¦
+kàx"PXBÏÑõò¶VÐ
+øHPþãUàAuð¤Ô´¦yRKÙË´}{-¡xT/&'öK
+!9Ì¿}{@»q,«±µXÂÚ^
+-ÂÂ©|=½4Ç2$ ¦}_v=£rðA:T õGC]ºýêl7z
+k`FàÊË0+4èf;h«(£"'9Ï)nÝeÛT
+~
+- ê®È]UaQÒåmyÌöQvÜ¢k6·ãÎÏ,FGóÆº1<03éawOºÂÅúâ¤Wµy
+-Ujk¸´ãÊ{*©ILñ}R'CEÊU§H´+
+äùGÜáÛÎ'ó+wt¿µUîé/~¡+S&ÿ¡Àèå`{5V(åæE9qBÀ/¡¯/xÖvÖu§Þ
+-¡mö´ê-ä>Oi1yYCÏî å!Näa*ZÃEÍ½
+Öm·&éºök¢±Éå/Ø:6'1
+Úû±ýah5A<¶SF:XHt²43£§dÄz²þâÛMb§=·]æÙn~®lm¾Ý¹OD`3qüdæMEòLH	ÊèI!cL|
+úlÀF@_tY(â$´aFóSNeAO_Äo¤¤ÒáË	$ö4©\?üÕ^¾¿>ûzr .¡ÙgÙBE £ Zäû³_
+GZ&^ÜYÔý"Â3Æ6¼Z\ý®~OtàA®³x.ÃéAIú®s¼X¤©zòì
+E
+	ÙÚbýÕïr"§J<e |õÉ²ç8xVÚo¡	8ëï Iè}&¥d4³)õB ¹&ïMí³¯PÓBr£uì~â²%ÐXOXRGò%)K=my#±ÿËûW)^O9xí£~§ÙLãÚ«?kF2û[
+å58(C$8Ñô49ýçMîÑø
+ðòõ¼OÓÝ_(LùXSSj®²øÎG
+-ï÷ ÙE6](÷ÍÞÕTæà/OíßC#Ø{õð±xµ8Çª1 ÛrKÕ1oPòó>IØqÌÛ½½5õ®àuôÑAºo"ã^¼>l
+òÕÑ³w\"|Ký£¶z|KÀUÎ÷X÷Í^u,Ãã'ÀùV³R©}
+-Oo?7=ó"VÆ»¤ ÂÞ¶Dã5eêÊÅT-Ý(ÃöÈóééE1 ¬RõÆqÎð\qßõqmRýØyÜ¥É¬à¶!O/µÁûÁaìB27<­£Â³¯·ßÙðÎ;ZtÏ_@C÷q3:mG4×, f÷
+-JÉóbûIÌRámÊ:¯
+-Ïh( Ù¦·
+¡K'óu­÷UÁ+
++V³iª\ÜzC(¢`¬\A×
+jÈº48×
+nÀÃ½d#G²lbô1é{:I®=Tã7éÔ}n>´Å¶h[÷¹)ñ
+Þ
+âsÓ±øj¯Dé[ô(ÏÉ¦¦ÞîezÛ½3ÃÓp0^Ì¢BëY Àù«_R¸âü5Ï)ÁÇ»ô0
+?Àø¹[¡zD­â
+"u2QÜ2¶-
+[{n²)é;ãÜe§}yoïNÏgÿmàPüüí¿Le
+-endstream
+-endobj
+-607 0 obj <<
+-/Type /Page
+-/Contents 608 0 R
+-/Resources 606 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 602 0 R
+-/Annots [ 605 0 R ]
+->> endobj
+-605 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [374.059 207.04 415.578 218.73]
+-/A << /S /GoTo /D (figure.6) >>
+->> endobj
+-609 0 obj <<
+-/D [607 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-122 0 obj <<
+-/D [607 0 R /XYZ 94.914 540.596 null]
+->> endobj
+-126 0 obj <<
+-/D [607 0 R /XYZ 94.914 329.275 null]
+->> endobj
+-611 0 obj <<
+-/D [607 0 R /XYZ 94.914 127.024 null]
+->> endobj
+-606 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F49 256 0 R /F17 190 0 R /F20 270 0 R /F24 308 0 R /F32 610 0 R /F18 191 0 R /F23 294 0 R /F26 309 0 R /F46 194 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-615 0 obj <<
+-/Length 2121      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­XYsÜÆ~ç¯@Ù/XÓ;§¥Ê%]'0Ë
+P8¼¤}º§g°À
+-TII
+Èí¹zúüº<¸xðóÅßn.®ÞDY 8Ëy.]G,Qd	7Up¦Ll¶s
+þ½ÝleVf÷dûÍV){MÄu;v¥¥£ðnLÃJoîn~½z#âù
+§D°ìc.¸Êÿ¾¾¹øxx &±âq%òpq{Ç
+-Ö~
+-8Sy
+íÎC)Á`È:¸¾øçEÌPÊSðüs,x Î¤
+sÉ¬Ùb1WIe`ÉD)ñûÖ4e=zH¾°AÄâ(ö&ø
+mYòÌXM;LÛ.k¼TÆ$õ;ÿºÆk
+äi°
+-îÍiçØONlî
+-ï¾~¨^ à	nd<w'L3ÐþCaßyÌáO8Ôü¾3¤H»UT
+>Í"Uíø¾vñôx«î¾'y\
+-äBs×n 
+;:9	£Ð¼ä/hÚ¬Ù,,éÛ_9fÆê¼MÓ<	¯®höÆ
+¦¨Í«¾)H
+ÑäX=º="HYrI)X¢RgêUI3£Ñ Ê!íVÆµÍVDL¤ji¡§[~GB¾t¾ýØ
+-h©GXøÿ]>Þ
+-¤Ròn#Âï
+!ßÃ[ ä
+j;~îª'8°`\
+
+	8Öãù
+PÏ]
+l¯ðºÏðÏòäwWÈwÁd
+°e;k.p8¥ßªÿ% HüoÄËoV³ï«YY¬	ÅY$¿N(2Ï¹.a¤X&²¯P</aô?H¨>#aþuÊÿº©j
+@$ÎD&	ÔéaìR¿X»)ïæá{oÚ¢Å2ÿôI%D
+øB¸(^Ëz,¹yD R($iBò¿1÷cç8ùa³¢8|ýX
+
+<<ïZ»Cñ`»]ë¾Ö¨ÿEW¹zá½ZêÁr
+LA}R$êT:<£ÎåÕ³ÉEÕÖ%Û¯6Ñ¢pWá¿Ç~ ª cÐiÑÑ¤U	*â¶RÚ35l­~beJ¢÷º¨tç®hwôk{#$~üéÝÛí+¤eemóa'aq¯)ôRp´D*
+-í
+
+\IÔ=Í4-ªÁM¿s¡4Âaç&° 
+Ú¶r0mÓ3,XqxmMj=0õ´=BµÄdyX_fäK\<ùÒ®ÿaõèLÑà®Á	8Åví®1z_ô#¤#(B¸È`Ñ ,>tíÐZ)Ü.wÊ4îôÞí´SCEµv§ýe{x0µßÓh]õcK¿
+-st÷íÖJU±¢Mý±±!Õ
+~
+­à£+pN
+§áÍÞ/
+ÛýÞvÑNÔªm´FK¸Y5ÔÉ¡A½Å4ÍS4­SðPS¬Ù ¡Ð\`Ì<ÓCâÕ§& e2v)Î>HI IGkM´lãÒò±»÷fA<þãõÛ×××k9
+yqc7"ü
+-ÅF7}a{B
+f¬q| µÝà¢×hiÝÙvâãÏy+*òxDÓ{Íb&)öÜå¶?²IMy
+hag÷fÀ À<züº£éµ« Ókë`>`rn°
+|B#}4uM«§ðÁØã¥(HX®ð­³XºvôÇÇ&Ü@zâC/
+
+àÀ¥t0a¥ßI:Ìy+
+y
+-®¡4ÄvE]uanÙ^]»u±WiþÖKm!MN	
+tiÄ¢|O7´´b¡Õ)Q·à]wºõ£Ú V@6ëÎ8.Jr¨fSÝ#Õ$Î½
+{áÚf~
+;iînõ0Ó
+teÁÝæ
+-
+?=çoFk¦Ãc¬§©.Så´ÛK	y©J
+)5ì5Q9ô}Y>«äöõ·åðVä8e¹uj$3ÇÊrCWÇ}[;ò
+qÊ×Ex²
+-ÞõÜëbC®åÒ®5!R²4Q_Ø
+$SB)áä8vf@?%©ÖÞ4µi&Ú
+³LRhÎÞÎTL@Õ(
+þû
+V£#0ðð·$p0·TôÎLåõW&Qwþà^ÓNCnØ©	;m|âæ3®Ìë¢ØÚÄBx¿&xÔMIÅè<Ä}Ê,	{0ÛAí16qÆöjH
+ÆÝF_Û1%#oÍQõÖÔ1bYê#njkN[æªÀÐ¸ëOêÂ`.i¥wÅXîúwc·¦~ôð®z(	ÉK	Ä2qjÖáp_Pf|àð§N!&-HxùíÒÝ¤Ðî{=Ì
+-}E!çü¥_ííùÓ¢5}AY<"~þí_î}IEô/½jÚóêòæ½c/W¶k@M °1V¬AZidösQek#KLi{Wët^£»®=Ep
+-µAIïÏVÎÁ&ÉÎ`
+&ö
+[1þFß´?[«NßçV (¡]ÊNH4Ôk0xä¬QJdDe=·/!ü!ÍÞµcGKô¾7ï
+- ¦Ñî-ßðë¿#æôàY{q
+èt"ñ%@3MR.+IÚyâ
+
+VújSDÑc^«øÌ¶OþÑÍýôÃâzþÞ©$SÂ
+¢ôìÐR1"½b?Í»vEößó
+çtí+ù ?è÷
+-endstream
+-endobj
+-614 0 obj <<
+-/Type /Page
+-/Contents 615 0 R
+-/Resources 613 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 602 0 R
+->> endobj
+-616 0 obj <<
+-/D [614 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-612 0 obj <<
+-/D [614 0 R /XYZ 250.359 392.225 null]
+->> endobj
+-613 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F20 270 0 R /F23 294 0 R /F21 371 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-619 0 obj <<
+-/Length 1794      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ½XÝoäÆ
+-¿¿b¾hïx¾ôuAÜ]8îË¶}HBf½´!ic;}É!¥6ò}ò²q8
+ù©«û\ýóÝß·ï.oT¸RR¤2U«ínZ*»#IVÛbõSêõ/Ûï/ol2ÕT:ÖX0äâõFI)í:1ÁÕ¿®¸þñÇõÆÜ¬u|ú¼VJÿõ¿W?ÐÔÛëÏ×··W¸l{ûé#MÜòóêÃ§6ÿÀíßIvúüyyª©_ÆHªÕÆXaPÎõèÂóÃzW¸
+Ï¾zÿ>+ã]åù<\m¡MÉ¦´æÛiÍ¬÷EË°Â8Ò«EÓÊí¾ì`YÃ³ß;<´nçÚÖôú§Ëü1b½	|vw@á
+
+»½ íTæK ¬YM/uÓ³Á¶ìy+K-=ÖK'6*Z
+-8¼pL
+-åä2¯²®ÃE¸0VÚy
+Ë~OA,Ê¥2®u5@
+-.«Ëú¸ë]ËÊ
+-K-G³p1×å6óÜø1¤F
+[ò<ÏVÍÊø¨
+
+¯
+ýÎb:;¸î!ËÙ3È+X¶Ox?»¤tä1#Ü~éA752ð1 uDáÂÁ¡éX´Ïêb­1Ó
+üt ÌÏ¢ëQ^bZâ §ÉG
+32½
+
+G-Xrh©ÃLÄËzæÏPáÃ»ã`4GVÏêy<wïQtv
+-£ÑìÎÐÐe;×õ»
+Ü"k-ÜBG
+Êð³¯
+ 	7A¿æ*$"JãAÑ_pô¥/«¶ó^üºáeq2m°kØÇnø
+Î
+]$×}ÔZ§"Q	£:ü&T{¦oàô ìC·M÷:ôã!j|Rs¡ùkáñ_ÏÉÂÈØ¼Õ71tøV
+ÝÌ¡uàá¡m²
+á³'I­
+-3Ó
+$ÎÇ» ²<k
+°³Na]Yçæ»î[Öò!:Ã¦-+öî©'Që
+*`Cµ{
+µ}þÝÙï«7Êõ
+ÓÇ½
+-6Rg¸8vQ&ÁâO¯ÖS#.	WÀ¡+K©VàQh¼rYKó#RD
+-N
+pÎEE9Ð¬Ç;Ð@È<×g÷¬DuÞWø"ïãó2ÉÄªöe
+æg;·ñq
+Ù#75À!,ó¾ã2;p¹¿mÙ¹¿PÍ^PÇÆ?#ËM×adQF.9g}q@GkKd¸DM]=³ï9ð§AAËÊâqßÑ«¿ ¨X¹]ÏKÞ°þã8¸)Û®
+³zí\Á&ý².û2«ÊßÜRDÙ©fB®è+¾ûjêBY©¸.N
+Ê¸t<)Ì§ËwÍ¾l°çJ¹<[f(CEZ­!,È};*¢ôRP¹ób¯
+3A(ï)#zpAÿÞOeµN%BI3ðÀJò¤7Fë«Q¾¾.X­Ð6:Ò%Ã0Lâ6£erºdç;×ó	zþæZ
+øìrucWEQbÈá
+AWm
+º6j	°¨Ï8ù»DdêÏÅQpà¾ñ
+ú&R¢ÏQÛËf3¶~
+¼!7-ºUÏ±1üÇûÑZ,h'ÉØ¨sÏ¡p¯õÔ¥ã"vZJqÐi0É¾
+-¾÷eõ=Qº¦ï%
+èÆ·aÀwoZvñ@øÂvI,âø·ëÈ²ONOqxÆ
+-× )aU4Ö	f3vDõÑ
+-Üë»²ìºîýË? Ù@õ"ÎþÝõí1ïö`
+-ßééùgÌ¤?©e(õ>Ôíò¤Qf/ Èøù¥îm²G:ïÞBËA¤v
+-ÊTÆ
+ê÷­ã!ûÔÑZÎ¡
+ßÀOìE²EK¯´+"2i©Å«'b£W­¥ýàqô¶ÝôÒn±e4Ý
+-;Î
+ý´Æi^2xd
+¼}*	>ùêókÙ
+»Êÿ3=n,¹Ö@H«¬÷-[wÈÊ3r¬¹ oÖµB
+g	@±.ü=Á- çÚ¿î"&
+	R7+§©ca£×7þB*øLV­}Saßá
+%s¦%?ýBÄS¿Í7ýoñÔ·EÀKÒÇ½[1üA£¨Y¬Ð¼BJm]_Ý0ÊIÆdéÛG8õ^3Z(à1Àº~5öëù¾/¹Öß	(øÇÆn`TÉ¼b>¯·ïþ£æg<
+-endstream
+-endobj
+-618 0 obj <<
+-/Type /Page
+-/Contents 619 0 R
+-/Resources 617 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 602 0 R
+->> endobj
+-620 0 obj <<
+-/D [618 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-617 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F23 294 0 R /F20 270 0 R /F18 191 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-624 0 obj <<
+-/Length 1991      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­XYoãF~÷¯ °/õôE²99Ç^LL²±v_<Ðb["B
+-ÈÎ¯OUW"e:1vòÂ¾«ëøêhò`ðàßW_o®ÞÜjÎR`ó¤¥B±QL(lòà§0abµóð»zµ&Ì§¢Ú­ÖJ©°Û[êÜÕ}³u}
+^ãÆ$ÌíêÍ7onE4½CKÁx"G>R¸é{¦öÍ­TÓSkÍ5Kx¬UÄL
+Ñá¹HfÇ//£îp×íºó£¦.ª4
+Íý¾¢0+{ÛÒ8/»íÊ§XÄì.0ct°)MWfyÝß^GâKù©èQ~©?£Ù§ÏÔÄµP,Ò)ÑaÑ®ù»
+km÷î=ô?ü ,?ó
+øwÏ³#ò
+#|<rÉÚz*iÂ=¡
+-"AG*l³ëéÐ>fcé§³&³{zßñB¿~ßw´¡Z	Z=ÑBß¢ÍÂ°HÅu§b$aT@%þ#@·
+¸>ØnïM>Ô
+-uªè¬,þp AÞî¨D@°8JæºÌmS â0ë &ì«`ÅÓL&
+-°ÌY
+Çý)T"OÔÒÂ6«¨sï¸õÛëû.+*Ó(ë|[áýO4èÃ@»oÈpv¸Ð°Ã",jwK
+rã­m[¹GnfÊrFêïÑ¹{³Eëh¦R½hWy!Wó°)Ò/üüÍm
+-u»$¶ u/Â_,LÏGì>­
+-ÙnÑ_öCÉ$ùs[ìú$©
+-jÚ=¹SKCgwì4¶íK
+-nà2Õ ÙÁÝ°¨¶us$¿m²óÀ mhìo=ÄÊ¦·Èþ>«vÖ_é<jr÷94,D¤G}Eò
+/LHNå-£ã
+Ë(Ã$d©7¡ï)BGÑá$åÜÄÉ5û~@$hÀáy)Ýy£¥¥º*h¡®ü%
+-r#·¥=Ø1ÉÀú
+#!vºvÝïN3Ã¥(Û,áGíS9h@øP È
+ûN{ÛØ®,ªm{
+m"ÑÇE4j3
+-ý1'Òã¥Ü
+o+ks'(ÎUÔRHâ7´·§ZÇ}5µÛNKS¸v8ö]ð7>
+ÔÆ=Ô À´³ ·JKÁÅþJpÃ
+í0õÊH¤f®ÍP5M\±>s
+W^Õ´Ðí!2ûêª
++-E~êõÃ¬ñ{rÛnÂ+§E§dW²zë'¬1K!§®E
+-¡Å;Ó]q(@æXÒ
+Èd
+¥Ë¸4ø	.²O.79M&²j@2#xIHÍÌ&fbz
+þ\ßZ¿Á§*gQ¤YªFÔW/TZB
+<ZýÝûï¿½vÉçfsõÛV @$è@Æ¨'¶«~áAÓ àä¶
+åÒ=Êàîê?Tx_d­**¨¼V"¥G	&
+w?Ü|{sw·)=à&
+-oñPßvDPve.'\vÁ;ÎÐzEøe¬0\çÂ"+i|l,Æuã5« (fÙ¶qî
+Tù~c²é¨ßÿýîë+XrÃt2m&ò,
+`P#)xý¾ÿðãÍõæÃ÷µ8cDò
+èMÄì²_Ç2uÛòX
+PN¸¥?à÷~ën®kÏÃëÖp¨n/9U®¼ÄÁú(<àÜÍzÿ¦1ç)â
+-¾]	Dc~Ó·
+íÌÚÅÂc´úçPiÄ4(Zªùi¶Í`»ÈÑáYø:çÔcï»Ç
+z'/½3#EêÃÃTÎî
+æ4¢~V;ÏÁð§U!TY¢©ìsí0
+kd =õ|0s
+v(![¶ã:Ûµ$ruö6Ë
+à
+dªô,ÂËi;pÓù¶õí®r
+½GRÖRsÑk!§¢µÄÌÃ_£
+²jx`*º~Ì».ÉA.FñyQÙÎÿ;f4}Ñ¥±/©©ìÉwýJ)ò+L
+g¿rãÂ·Y7É¹J$¸OÆIØWK&C[`âñëkZ­AÛÊ6XæÆ1ò}åë?
+½¥X¬åäùú±?¼/E4Kx²[Q)HÚåÄºùFYS³Ä	åx
+°
+-¬;',õ\ØcÖà+·¤7Èjm
+¯×N'¦t
+³FMà¦ìfýÎªîüa
+iü×Ì
+h6Gob6wuS¦¯
+hâØ*gG¾T3dÉôüà¥\#À4:EÒÊÓÁÃÃRÑ«2MÆ_¼î?Jä$v½QÈ¬Ùõ®NB¿i(×/xR<IÕ« lÊYÓ©	ßuxõAöðÊªÜWK*º\\ä¦ëRíÚù°J/¬ðñÿ;
+Áà¡.KWÖÆ_u EÛ¾}Ýó_Ioùóÿ_ç"É½ÒppHÁ!wO+èå
+3n
+ÁR&
+<þ?ÿÿ²¼+ß¾
+Í¢ñ÷Á3Ýðw}*
+-endstream
+-endobj
+-623 0 obj <<
+-/Type /Page
+-/Contents 624 0 R
+-/Resources 622 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 602 0 R
+-/Annots [ 621 0 R ]
+->> endobj
+-621 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 399.79 135.352 411.479]
+-/A << /S /GoTo /D (figure.7) >>
+->> endobj
+-625 0 obj <<
+-/D [623 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-626 0 obj <<
+-/D [623 0 R /XYZ 94.914 343.423 null]
+->> endobj
+-622 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F23 294 0 R /F51 272 0 R /F20 270 0 R /F46 194 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-630 0 obj <<
+-/Length 1621      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­XßSÛ8~Ï_ái_
+hý°%¡%ÜÐéÑ;ÈÝ=P
+L,ç
+ÚNIî¯¿]K	qPhiûDW»«o¿]­B½©G½ßzoÇ½á)
+=FILcæo½8 1
+<	ÂDäSïÊþõøýð46%W$(j
+TÀ(¥þ¸	ÿøÑÑåe ðOû<ò?^ôcþ?í÷ñÅyurvz:ºÏqÙøìã¹yqfO>~¼Có=j^ýÆ½Ï=Cê±µÛaD¨àÞdÖ»º¦^
+-ïÞ{8ò
+ZÉFàz¹wÙûsSEHà1¤xN!EbeUl;Ö¢².VD\xRÐÐ ö:+&ù<Õ\N7	p
+í/F¤«3"A´ÈÊº©t2séR­$uéÄHØÐ	°ÉyS"éú>h|
+üºIQ
+-è
+ 4¶+^§úeA¡gb×!HðÂ8Ï!-Wb
++°2"@êR¡2nt(nTLB!ºÛûð'i9¿É5¹s*Dñ¯á/[÷;67Ëûþ ~tªo
+-¨IÚäÖàjª}p$+#4K²â
+-)|õRlºR#ëå­ÓKBE]/;,®ÄõÃ%
+»
+Ùjr[â¾*³ =².~vDÍtæÂQ²M
+¿
+aíïgí¦JÅÒm
+)²&Kòì?'ùº¸-¬
+ó0ï©qpD
+-Ë»Ì	1á1¢
+q#J1Ìda@ñNÌWôÔº9>A¤þÆ¯$kÄáN·¶ê*û4Ù
+òÖàió5wfTA:M,+ÒY1xD¸ÚÝ=DÞ¹{i¤2SIÙÝ
+#º
+-ûG¶ |®Ü
+î|¿öW
+G
+GüºÏü½
+0þøµÁrkKXÐQ4IËz0 +wÙ@}C´óbîVËAópí
+í*Ùë¤7.¸9bÕÆÉlN¤r%ójÉ^9#÷bU
+2ÕMfE¢£^±Íû&O
+-j«¢ÀÝnCXü2·Y×mcój¡o0àa 
+u«dýÄ8¤K>L¬C
+-çeô=»sT]¡$ÝØ·ÑE¯`
+=B¦J7óª0[£®3c]½6Mø!Ð^ßÑ[=éðP
+Á
+:<º»Ùe"
+êÀ9[N³é¼²lRL£E2»_q·¥=»ÄÓ\×µª'X<©Ö²mðªÔÂe»Ät
+O:Gè8§ l°«Âz^6h: #`þ]ÒU{)¿¹Ëj3y;/&MVf>5Ötm
+Ò. OwI1ÕæÅL£Û³²ZçJgé«»±¦?I
+-3uúo½«Êùô._nOÛé¦ºÑÕ,+´Eá¦ílL¶ §]\UÀçxÍçó¿~;ºxÊ,Î	eìq	uüX/	é¼ÕÅAWkøäìbôï%öì$Õã9¹ßÎ{¸£¸ù
+¿oL
+ªõÙìê[ ù[Í¤Ë
+4`T®´ÍÙ>à5`ÐêrËwåì>©u.C<ëÍïÆ¶¦âä$©µAãÑ´ÌÂ¤°§³r¥!4G?>v¸Y«ÙÌAÅªß Cb?#
+3çka-WAÆ´BPuÓÒZ¶ÔÔfµÈ-å¹1æÏºÑ	RLrÓ|~eõ¯É0Ý0V0o1pä{&
+¢mÛ­\g×BF¾©¥ñ¹i) v1è"^ ¡ÛÜËSÕk×
+>1èÉ}Ý'¬±l-Wl(ªRmødUçæµÉLhkl!Ëò|7Ê¤q¥lBSÞò¼íæìM1ðµ)Îú¶½'¸Jõ \æwÞ!w&>\é
+-Û
+ÂÆ~(ñ#N$þ¹ºRO¿uQØ(&TÅ]\ms¿m>wqZ5HÎîsSrï¾©
+-ý`äñ
+-0'oItµ
+,BÝPÜc¤,ÂÝ îÆ¨Km¬®(1	m/ÉV;âNLlÇ	ðYwàÛÐï	¾Ä¿éÈwýEõ?Bw
+-endstream
+-endobj
+-629 0 obj <<
+-/Type /Page
+-/Contents 630 0 R
+-/Resources 628 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 602 0 R
+->> endobj
+-631 0 obj <<
+-/D [629 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-627 0 obj <<
+-/D [629 0 R /XYZ 234.859 324.479 null]
+->> endobj
+-628 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F20 270 0 R /F23 294 0 R /F21 371 0 R /F18 191 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-635 0 obj <<
+-/Length 2219      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­XYÛ¸~_ÁJ^¨Z
+C
+¼âÍ×öl9µGbOöe½¡H-9þ}ºÑ
+-èÔ¤ì	h4@__7¢`DÁW?Ü^]ß,È£\· 7"&H2-¤ÎÛuð{
+-µXÊ(Â·ÍþPVe½],µÖ¡­×4ø©¬ïjÂ~WõS3´+
+¿mK
+ëbñÇí?®od<ÝÔ()¢TÂÜ~qLW2Xúõ¥EÄÄõf½.û²©mU=/2¾Z,MÒî&=¸-ªè:$%áÃç«¾ie>.TÚvM<ûñ nÚlèÿÍ»_Z¾¥ÏÏÔEËB{ú?
+--×Å#*ú
+Kc^Ü®×ZJ-bÓUº¢ïA}×[úGE^
+¥-ðµíKºÑ¶Ntú.÷ee[þ¼9Ó­ì¸¸²]ñ,Ë©%t4RÞëf¸«fM¦µ02ó|t<<
+-É·-o:tÅFwCï®¾Ô&RØëÙMFÆÿ
+¦ÃùÄ:'|dê¦s
+¤ÔYîg]teëCÓ©`ð}Qãn=ïã¡ãÙ
+¹Mºáp¨J/©¬ûÌØÖ¶Ûa"â£+AQ2ìÿvâèþÿÂ(JK±'$ö¯ë¼ÐÔ
+^¿üûçÞtÒÞß^ýy
+±2Pp	
+gRd cµ¿úý(XÃ"Tè<
+
+
+ë>ÐB¥FUðéê_N¡dçNV¢øzï>||ÿööÃ¯¿|¢ÈhÎ[YjF1ççúctÒ^
+-_Ïíý?òÙõäßÕë9»=Iaùæ
+î7üA÷þ
+ÅQüJÂ|½XæÃëk:0ÓÎI¿#
+-;gY3Ç¢¡sRà}âoÖ¢¾úkÕPä]ß¨èÄÀâ9¿ÿ~ND%Ò¬ÅvV+u2·MC´Ëlz¢^W ]çk×
+-a¯vÔà1tl(Ib,¾¨ãçYÏiBtÅ"Òpëå·E7TýmÝÑVTä¦ã¶¬Gv&^Ä¥­· ñ³§JÜêÏóÌÊwA|©Ìÿ7åvhÙÏ2¾WH)ò8VìÚTN\ªøÁÓ
+G	©#§±Cp-¿à°JD*ÆæM_`b!ÓÕ«¦åh-«2V¼0Lî
+-ä¦0ÖkfÜÙ?m°jöEO]8UÎT°°BÂó-Sº;°:îô
+
+Þ@úügáD 
+-I¸r&¼!ìJÂ­K&õÀÅS±z
+Y
+J7üIÕ8m íÎ¾ñõw
+];uoI¾Ôºá=AÛÕ°@+­=aîBcüØ»®©=é`}ÊVÎ_x½Sµ pÍ¡bw=â#.
+ë3¦´Qâ¦©*òé1N'»?TÅËÐ0
+
+-ã5WÛï¾#áË×»f_\CÝÑÖ Õêu)6NPHLúU¸¨##4`+Ê2kæ;¨°®5|X®X!®.MÉ\mzq:¶Ðý3 Úy¦OçJAQÅêpMZ)%9©9¤EÇ
+~4MßJ(£}ú^~(±¯ð,ÍË4	
+_Tº³LØEÆN×ÒìqW´¼à	8»Â¶+¬àv4ß4Ì;ãVÇø:Ç¢ÎáB.ÏDj*d¬ÏPÔÂyU®§;ãá¤Ù}¡¦rçd
+w
+-$ÑÎ
+Q]´âÜÂ'ÿu±çøî`ÉÕ
+-.:NÑ¼x['hCsYGëü&^J04n6
+-<¨XrÐÏRmÕÜÙê/D_CzÆJÙµY®äÐ«4¦ÌE¬Ró©¤ÔyKFéÑÙ©	CØÊuK®ãBf*ÅÛ\"¢
+ÿGÂWÎN@+1QøzÚ%9\ëÕ¼áÀFqW@ï½
+b7Y$ÏjR<Lî Nã²gH@2é5%b P'ãnjäQÍÉðR8\Â1ÉÃdÝÐ?åx
+^fÏK£OâÄ¡îÅLv
+%IÇßçóO=æÌ
+-eEGñ7qê¼/åÎò·*ïZë=wI£-ÀèÐp ÆrKøéÓ®·-L,Ý©Áãú¦Î39>×ñ' ä:£²Ûùbbëämâ
+
+Ôí¡&x
+-A-©7fÏa¨9Ëõóy^å1tÑ9Ô¿0ÙWvgy&\9Y*ËÏ½?ÏBÓgK`L ÌdòM¤TÄYþ¥#f6âTªDâ5;E
+HkyèCÂòn6å¸<ºj7×gH
+jüÓ¢Kë$ Ã2S.É}uR	ð«,¬.`xö%I6&«ó½S¦õ
+¯¤¡xÒyþM®¤A=	ü'Wz@ ø_WÊ¦W*«jèzß -{og(àÒlàKs@kùì-
+- ,3O_ý\9êJvÿø5yµ<y\èpK)wt ÿ¢¸Ý4ÿpsT@9÷´&!Ø³±áæÔ×Í¾BqZsý
+¶Fpýä¬ÍÓcçj±£ûXìm{ßÑ5íón9t¢ 9­FÍùÉ×Ð÷\ñç±tÓßÜ§m	ÊjÿæÐu/ nëBùf
+-
+Æõ8ðNÞOq
+Û#saf£¹®à\$¼BsÓ:Ç|(¹7B»:,<|l¼°ríè½{ÝÜÎ¶Ôb
+-ÒóàØ¯Ã¼»¨·ý×,e\´¬[ûwÖU²÷TÆá?«Âv\>µPÄÔ5épá&àt\<Aí
+eæfÀ7qªÄ"³ÆÍ^cc¡e+}Lñ*GÃgïÚG	)x\¿½r­÷<B>ú/Ù%#
+-endstream
+-endobj
+-634 0 obj <<
+-/Type /Page
+-/Contents 635 0 R
+-/Resources 633 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 637 0 R
+-/Annots [ 632 0 R ]
+->> endobj
+-632 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [469.827 458.636 511.699 470.326]
+-/A << /S /GoTo /D (figure.8) >>
+->> endobj
+-636 0 obj <<
+-/D [634 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-130 0 obj <<
+-/D [634 0 R /XYZ 94.914 444.849 null]
+->> endobj
+-134 0 obj <<
+-/D [634 0 R /XYZ 94.914 151.873 null]
+->> endobj
+-633 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F20 270 0 R /F17 190 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-641 0 obj <<
+-/Length 1437      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÝX[SÛF~÷¯ÐÐ9DËÞW"¥334`ÒâÅ¨/Äiÿ|Ï^d$#LIèt¦ v÷\¿s3öÆ
+öÞµÞö[{ÇDx£GÄë¼£pO
+zýÄ»ô
+lúï÷yX=I¨Bq d©v@0Æ~¿
+2¿ó[÷¤{~Þcþqþ³6!ÄÿÝüï
+Ù­£Þñq÷¬{Úïuôµ~ïÃ©Ýè¹gçèÃIp¨Ù·°º|vû­¯-KìµØ"DQo8m]°ÀÞ{#
+Þ­99õ8#^±7ñÎ[«$"y+m¥=Î#`Ç
+MÁU©Û#
+Ed
+q,¬Å~ÊfÃÉ2I­q)®^à
+	.JÛþlÔiëÙ</i<m¢ÅB$¥*OþÒD+òÂodO.ól6¶nÅÓ4¿©~å~^$o4  
+-´fV£$ý	¥÷Î³¾«ùb°§<Q	¹ÍÔ
+QÅÖ¾j0,Å
+Ip¸¦¥²bÔ ¨Å
+Tcuõ6=½øõm÷¬IZð5¸L 
+-ÕI
+ü
+-
+--]t
+õÎºù.\9VÑÈ/8/¿LRtÕH!E4¯	XèP¿»iðHtd5b²¿ïÌK#
+
+-
+ã
+-DÉùHÇPRfÔlÀH$4h;%
+-5f«Ü/N{/º
+-|Akõ2lµÒÕÙöNûÝ³ÓÎÉ¹õ8Ð.¹sCh6+¬×¦q6û?â`Ãª,Fzå`3j
+-:Ã:ljÐX]²Ákgî`ÙÑ\ma/hÜÏðû9k¶$U`?
+%ÌÛÝÍ
+S,&Ü®4Ô	u¶¦4B¨
+(	oÏÊÞem1_/âIögc¨°3¹g¹rgKa«'¢Lóä(#B"`1í	ë^¯­{Ýh]`ï{¬{m¬k=8ª0>8Xïhdd§EçHË÷©MØh	JµÉôùkxyMô7M®
+-Bh"R÷Ã¸IÌ
+-¼Ý]âáÀUÀ¯B3\ÁÆ+ýowuIôè
+
+¯VZªKXÑÁZ"M¸Êü.ÔÇElB
+h,<ÂCÓÛÓ|¶¦Íõu ¼·×TÕ
+ÎE)0"÷µ¦ÑÑ#×Ý¹#;ÍÉ³Ii_ qZ|Ò  ÿ§©F^*Þþ¤Öje¢ÍbC
+Iô<±I]lËÇdÎ
+ï0
+ÊêF~|A?\ÇÃù,Yîûw£RwVê9ÄÓY2)ë
+-Óu¤ªÆÿ!kÿg¹Ñ²µäâ
+Á¡î!®óë}|]?`¡.GíHÐÙDâßüj4rÛKAU´EZ,.|p3eÂ¡<³*SoíoæÏ8Ì½ÚÞnÌ½øñ øR
+-Ïn¸ê8/.g
+.mtWñô¦lÛFsEìúÿIçöÓ7]ªÓaQ
+³·]Ä5ssÅN6êòùÀÐ
+-´çÜô¬`
+NÕ¨<PÏ,K|tom!}H bÓ|ã6õIÞôÙøN1×/ýµ_-y
+®55çÎViÒTÄ{³!
+õv
+§RBXLoE\dóþ ª×Íû­érû2×£­¾6ÙÅû ûx»
+-ãÜ~)wnYáWnZç*ã\Ý@äU±E¼NESÙt[käTÆC«ù0ÎÓÜn\eã«²sqz-4ª?Õ;pøC½JK
+-.
+¿ØÃö%]¹»Ã"M,ýBSÏ
+3
+<+
+|h«·ç¼ F6ÉéóÝÝï¥N§I6ûcýÊÍÂZi¨ä·þx
+-endstream
+-endobj
+-640 0 obj <<
+-/Type /Page
+-/Contents 641 0 R
+-/Resources 639 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 637 0 R
+->> endobj
+-642 0 obj <<
+-/D [640 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-638 0 obj <<
+-/D [640 0 R /XYZ 233.98 202.536 null]
+->> endobj
+-639 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F20 270 0 R /F23 294 0 R /F21 371 0 R /F46 194 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-645 0 obj <<
+-/Length 2335      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚµËÛ6ò>_¡ÊJ" øtUÉØN9å$»É^â
+(
+-Ò ÃLLöç· %Êô8Nm.R£ÑýîVU´úîêÛÛ«¯^d%¢°
+-±ºÝ¯E¬Ò\
+Bå«ÛÝê× ÉÖ¿Ý~¹ÏVaVä $a&Lõ]obeÛ
+-wºÇEôÚõÀû¾k
+ûªºõFæÁÎ-M[Ö´
+ªn»Þ$ið»®ÅÏv¼Ô¿ûßj½sGuÙ2!>²*LâÙï×¸	(¥òPÖ¸áMüæùO¯7×
+×fÛýã:WA8ÏW/ãô\¦!ÂLfðñUÿ½ «ÀQGL{ÓuÒÄ+»µÌwÄehF6ºé
+-{ýv4½nt=¨SÓ-2\
+AY kPpª^0É4cÆQÐ®E@bø¡7fªÁäÈ@NÀÜ#0¤¿L
+-ÖàÎfeÐLs¬¶áz¥2xÍJìKÊùllû®
+>[£õ²MZ
+×êFeÀr@2êÌ	ÈáÎX
+phæ6I¢ë®µ@Ý{útï /]¸çXî±÷
+ÙcY-Ú>\Õv?^gNMÒÎrÔaI^sÒÛs§YÓµ¨JlY¼Ðèj
+èI°2¤t
+ØÖo"VÆ1ÃÖÿÌææ+ÕÌÚUðj#DÁ§Â¡ÙÓFO 7úç=Ýö°-+ü¿·Ït0!C)w£ütûµ=ó¥ü»1C9í nIAÄ­©
+-¸Ç.ßfâ
+-îU]s
+ÍH°/ónO
+Uh©©·Ûòrgm5°¶aÜg¬ìnl#tÄ,xþÈ
+°`Ùi
+Ø|Ú
+­Ì)
+î´ó¶ÑRÆíKÛL}
+	yqMÏ/
+ëð§ Ü²lTÞnïº±Æ'AX8ùvª|(JuçFÊxËíË~`;kÍ¶Ö¼OªÜ
+fp¨<÷Á}´ãUË,\@³Q 
+ï
+:CêK;
+-ü<(Æ¨ËM¨×{² ÅîNGàØcØ=ôeÃköh&.Ñ^÷iKru\?$H&Éõ}×/¤´V
+(
+vt¾±Õû?nyKA-"V¢&áÂÅya­´]Ë¤eÓQRWD¸6 R
+;=e¤Hn}¢y
+ÉB!ÅäÙLsáüIbMåsûÉÒúê@b@4 ·\ÄAß»Ú±Efÿ{HPl$ÈÞ={:L
+-xf¤SUð&Ô'ÄÈ°¦ÒÕ¯-É$MCUÄO$óHy¯ßDID06øë$ã=Ù%pB61Wîºká*(£ÔÓY¸I8gâÉÁ&*/÷Õ0N¦wI`RÊàE«ÈÃ,Ï/$ V
+EyÙ&y
+ÊS2ÙñiýIxH,22×ÔWÊ¨Ãÿ`:
+ª¶CÑJñ1=æa$ÔÿGpÙõøoéñs¼néL¿'®~üåo_üLRzq{õö
+-Þ¹ÑïóU
+%¡ s­«_V;Ø¨ ¯
+²Y)J÷Ñª^Ý\ý»ù
+±HÃ<QpÔ"
+vÏ_ýüâúöÕO?Þ,='Ua&¤çñ
+A¹E¾lQ*¢6éc¥Ø¢²3º¼r4´\`ìKRôSûç:ìÂ5b]f4èãoÚ®]ÔB¿$EµySu´-­ï¸zéM¹¥ÆQÆúi«Þ8
+ÛùJÑC&Ñ_]úìâ0Ká'ª4bP
+Rª¿×a1cj¯Lí
+ù
+-`YHhÖÔV -ÉOjpÜåc¯ßntYMU¥r ðTò²ÌÂ¡jàB
+-ÔÉSW$h³Ë\{·ÀõÑÕÙ¤^²°,uefFmÚÔp¥rÒÃMìØýÄ×£Ùy££¿¸â1K§
+«Ícß1
+w¼ÇcÅºJu_%ÿÝÃ
+G4_7öTÆþlDKt/§Z°Ú1øÈßw®í}Å*Ie¾çîêwÌ<Þ>ð
+-UÎà¾Æ
+Y/y0=¥³'<oãIÏË4;íÛè¨@½#»:
+0³
+-Ï4nÁêzÏûÔG¾*Á«r~ïÏa§êz¾«Û
+Oc`G¯s%ÑEÃ'/µÃûÕ$ãÈ$ §q®Àèû
+-
+
+dÏ
+ä$÷_
+-*»Mí^Lgr©
+-­Éþ¦×])Niò±Àë¼¿VØBù¾â²NÌuéè¦bi
+Ä'xy\'ñýÓ¤ë3¯+o0,E1ØÊâX Â;SK÷-y[Ms>DÒsÿf@Ð°çIt3ìTN_(®¶«ì
+-$4?÷ÜµsI®½¨FÒ¾Ù °
+.©çSç®
+¼Á»ø
+XíKWÅ9ZÉc!<¨»8ðä,Ùä,Dà#¶»´ü~&ÏÍ
+ºq.¹3ÔñØ=g"
+-Þ<]ÌþñÜµ
+jYÏOJNá7;í¬
+-b2wMðô4Á¿ÐKR
+õ¥ü¡»´¸;uÛú]úÔ
+åm^ø*¡
+©DÃ
+®7P»oD!@óUJcKF*×s
+þÃ¶dTYðf¨5wåäbrKðä¥Ðä+­ËÁâAâüØùª>MhÔÅOÂwã§Â3±r
+`i<º­Õ=ïïB$2¬ìUJ àyW
+
+Qá:
+T)d¼j!]Ð¤3iâX`Ê¼ÉY!ÀG°H:$m&ý¡¡pÇ~§[Ê0þ7]JNq_»øBbe&<aÐÁØ2k07zÛ¦vÔ>ÚA7çµfìåk=ÉØ4àÖ^çqWãÖ¼
+Í@µ®Üñ
+æ>é
+-<Ã,ªãb>yTa} (0úÚMºvo#ZU¢Ûð_SÞá¯_jèr©s
+-.ê°Þ¹
+-endstream
+-endobj
+-644 0 obj <<
+-/Type /Page
+-/Contents 645 0 R
+-/Resources 643 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 637 0 R
+->> endobj
+-646 0 obj <<
+-/D [644 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-138 0 obj <<
+-/D [644 0 R /XYZ 94.914 186.645 null]
+->> endobj
+-142 0 obj <<
+-/D [644 0 R /XYZ 94.914 151.264 null]
+->> endobj
+-643 0 obj <<
+-/Font << /F15 193 0 R /F46 194 0 R /F23 294 0 R /F20 270 0 R /F51 272 0 R /F21 371 0 R /F17 190 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-652 0 obj <<
+-/Length 2770      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚÉrÜÆõÎ¯C`Þ°¸TÉm+%ÉJHlW
+-0$"Ì`
+`D3_·t7´º_ooßmî6Ñæïn.vß
+³QEØÜì73¡7qªB¡ÒÍM¹ù%0éåo7ß}¯ÓéN©t("Ñ¦ôr+¢(
+-Þ}¼¾¹LUðúýûw¸Ü*ãoyðóµ
+éàõÛÞoßàÅEgËÖ=±U&LcÃ]ýQç¡>Þ]n¥Áp_÷nÔUUÐÕÉB÷]{pëNyq)Óàó¥1A~g·yoGeÝUÅÐvêlFu"ÃL;¢_í®úpõéõÍ»¼lb+C
+-¹íü¶©þÆ,â¶B
+î¦{
+ê¦Ç
+-ÄV§KÔ
+-"d
+â°×uÁÀüX2Ð®ÞÇüÀËÂ±¼ì¶Ë"?ÔÃ=ï*«}~n·§¡í±_¼PáaF²DÊS&Yðkd¢
+®«A|g÷U^V][¯ÔG¼`hyð!í!D	í÷½(+%PÇ£°þò#Ezwusñû*p´0s±BèMq¸øå·hSÂ"ª,Ý<ÐÖÃF
+ZÅ0j6×ÿ`#?¬3JÒ]î¢çQÁV5B¦aL÷Ñ¶¸»Õ ÍÌ\KÞ
+ûº¾¨,f©ÌÂAèÈù¦þ|üúÕ`eYæ©Es.«5µu¸¬¼ø^Ñ²s&rT½fLì0®JÆ5©1p:çdÿ	Ý ©oÉ
+àã[
+fò* 3ò¥[
+w2pþÜÃ«:uí]¾Y¢Ç
+-_Å4%P¨-/@ÝWE
+^!
+ÅKÁöñ8PrË,Q*
+-5HeÆÛeè.Nµee4ÎÊqL
+-¡ñÙWjAdÂ,1b½F/¥dK
+ÈàyÅ ÖÛUÔ3b{
+Ö$Ð-´ámubYKVÐà)
+àbïîÜróèFvC»_£]¤Y(õgÂÂTx·ÝêM*T£çyÜ¶Q£CU8zº*ªrÂ5"
+LøìwÕ¾íHwÀ)¢gæÀ¬oùëå c§ûÑäMÖêÇþÑ©xÅ)Ù
+WuÇ¨0Þ1ûîw>¼_£=#)i
+<Ôvþ
+UjÚnDÈ
+ ÿÎuÃ=t+O"éJüz4ÁALëKu»*wWq÷Üäu§`
+x\º©»öxàñÀ
+¹½­¬ûâÜ÷ö iÿÀuUlW©
+-oqz
+dpC@`_(»sG ò^$µ¢*-,	
+îk¢þÞ!õéyÂ¡
+«a@vþ+ÈdÄ>2}È?WûºY:¼}©È-^	zîöPÿ,ß;8ª
+³Z)3
+ÊFK¾=Tv©
+ZõÈ(ÏK§n0ã]ØpV¹¬&#gQw
+;TùJ3Ö õ1
+î¸%FZCrä
+#OKW8Í©
+w Å}Í24ÒÛí}ÕÖ+¢8L¤g³3_7*zl
+½e³¸otö£_7·ô¯Ñë$B¥8ø7
+b¿8!îÑ6x¿ã¡ÍÜªîP5è:[$Á]u¬:t[+÷qà®ÖtÉ0b4ïbFãç; çfoE
+fj6 ¼Ìë¢i¯±Ú$Sgê¤MðóÑ¦+6ØèÑÉ
+
+ö
+- RL!Åèé
+6gwÿF)ºSë
+]>Y÷í
+Wòýà2))NeFÌNÁc8=þR·gö{/8+[A?g;úõûpOl>Ú¼?ÅDSBLäÍî!M.4`q&"üi
+@¯Sxàö<0ôIÃ$Ð]ª| ³EzeÃíÜ¨Ef`©6.{µ¹m# 
+-C
+éí¸ìjF¥ë Ü
+-ÇvO
+
+-À_·p£ÓC7H­/´èýìÄjuuOà¦.i-X
+óH¯lvª£§eÊ&â=Ù4*
+åòS»\
+ì¡W
+-ªåx4í¶"}ßZ~®
+-ä¯Q:1ãT+¾ô¦m>!ï6ÐçÍ8ÉQçAÀÃª¯8³LÏïáôín÷ðð} 8µÝ
+pòp'Ðß]ßî¼«Âûá°e&	$fjüR£Éÿ~
+D£ÐËeb¾
+
+æ	x<Â®_7Í3ú¡;H¼ÒG»_Ëß¾Ê;_íÊ
+31(NI%@ö ¦ì8iZ²"·!ØïwÐñb-ÉËeË"Â¾º¹¯»òäm;y^|Þ­ß²y9fm%Pi£À\rÔõ``àu'Ö­É 
+z
+Ø¾Ï;{hæË$HÇùslqùXæM
+R3N92(àÚ&«0$ðjR?;ª¢F7Iî
+ l}|Mµnq*Z3Z
+ØîþüWìu­òQ
+
+-¸i"¼øÁÚ¢÷ýùÀøHWÐø®¦àIÓ
+Mµm¬mm
+â;ÆEO°0sý±5¶]n?¶XÒ³
+-L½
+|»îA£P(¯;Ô|¡kB,
+}¨¯{²!ÝNålq
+±ØS@Ké7kØe"!÷LA«SxW¯"F/Ú§
+-6%¨|GàX¾ãÊh0Aé¬)ÐÃh½2Ñ¾Y®n"!bßfÀñ§#
+ocÈá¹`ã9&øÜVÀ£X
+á×ß;¶pu½Ýðdé1b¦+'"ÆÍïÖT>	¥~¡²wñJÂLÎuðsÙþ¤Ý©mË¨©gPÊb#rç¸òÛÏTßÜ
+­lb»Ö½ê
+ôÉr:
+-%°K@øHfû±¢§Á{ºÏBÙâ`põG~85vòÛnýà=
+:4JdÑFÈ²üEOú¢«mºVº
+ø
+¥÷xG
+-
+ä
+-uKìµT×ÄK<ç.ëIÕWÉé¤H¦kíÝÙ`2L"ñDÌÜ+«<³Ô5/{^âÎÂ¤ç7Í^Wmh×¾çûjí/Æµugí×q(ÇlÅz P­b½BþiÉË²F)ä
+-Ïý
+ô§^O¥	¥ÿÆ»ñ¡½D
+1¤ÄbÙ7àIãEâG
+¾Pµ	=&RIfíÖ@@Yáfl*lÏDàØ±ø¾çórOÜäÁ&ßp¹¯(Û§óèÊ©Ãwø¾N8±³ÿ8
+Kàjô\
+-dÉ¬ó X±
+öu©ïU(«äÎz¹K
+N*Tukjâ1ÿ¦Ö­C'¹Èþ×áø
+qÎJ¨é3)Ñ Â85¢l
+xw­Y2-^oÏucýeîü)	ö¾ÆÜî³jK(ÿ¦DHuå7+­?üeL¢Ìw~
+-.ÉèwÙZbÊÓ	ÚÿÓ95Qîræ³LºùëÊ"þ|X
+0`ÿè?¯^¿ýpµj »éï¨EßK´®nÏ±Ëßàò
+¿èÉÕÍÅg?
+-endstream
+-endobj
+-651 0 obj <<
+-/Type /Page
+-/Contents 652 0 R
+-/Resources 650 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 637 0 R
+-/Annots [ 647 0 R 654 0 R 648 0 R 649 0 R ]
+->> endobj
+-647 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [506.504 529.784 527.89 541.474]
+-/A << /S /GoTo /D (subsection.2.2) >>
+->> endobj
+-654 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 516.235 131.548 527.924]
+-/A << /S /GoTo /D (subsection.2.2) >>
+->> endobj
+-648 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [284.147 208.396 338.083 220.085]
+-/A << /S /GoTo /D (subsection.8.1) >>
+->> endobj
+-649 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [297.612 101.021 343.241 116.563]
+-/A << /S /GoTo /D (section.9) >>
+->> endobj
+-653 0 obj <<
+-/D [651 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-146 0 obj <<
+-/D [651 0 R /XYZ 94.914 258.778 null]
+->> endobj
+-650 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F49 256 0 R /F51 272 0 R /F17 190 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-674 0 obj <<
+-/Length 2730      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚµYÛã¶}¯PÞ8±
+!g+Uµ×JUìó`»R
+XK2/;;þút£i8Úó"Mh4ºOÂÕn®¾½úÛíÕÍ[®d(²0«Û»U¦E&õ*N*]ÝnW?©P×kaðµkó¦8vE]]¯RA}O
+|8^¯£$¨ÎV×Qt$ÿÎÙ­khìÛ¢tíõ¯·?Ü¼f¾¦¤	*ùåL®BVrµÖ¡eôj­HcC£~è[XCGQÛ²,ª
+Í¬³ùÌq(T¤ö½[Z?JãòwM} »½£ÆÑæ¸§÷×&ì6á¥ÛòûmÑ¸¼«êî\åÛ
+-ã@=lÈ +`9üJ½ë·¥î£=
+Ù8+°´IAC	ûñZÙ
+-ÆFYLJa£yMcqUìwô¬\îÚÅ©
+-, ¢àM}8`$ødG£hØjû
+-4ÒÙ&
+%`z
+6+üè43j3¬Z¥®XíÚ«i¢kÇõïê¼·&RÊo»±Jªàè5­Û¶ØD]Mçw¯çW¥³-7ýòØx_ !½è'Øó«×_ÿãïë7ü)Xåý_B¶í?nèÙî-"¼Ô?àòý°êÞb÷Ã5èÇkl¼²ÎU~¯áéoú¢ì(VûPÔ}[>P¿¨(º½å9xîY²*w_çØb4ø
+íMÑ~h30I;k©iË{TÑëùÐkðGè¥MËëµ;
+-¯µE¦P=&JHõ·èltÖéèmÞÕ²Ác³£b}z
+>XûÎû#q<bt8ßCôÁç¿ñ0!¤ÐÀ÷-MÑ·ãÂ?moKj¿ëú5× þÌòÛÆHGqÔnÜ
+BW±1",D
+¥aNöùWÿÔ;¸ÿüôæ/D÷±ûëRdHÒ1 ÐÔ´=XûÂj`IÇÅîÁõ}{³¸IDPÂc¿\Î8T¿ÝÍöGÛt7oêòG¿_¼@Ù<©%ð"£¯(În#]_±H¢Ñ>ç U¸VðgÉJJyµ$yk­b¡ÂlÀddÎXbàéÀ Ñ|L`Ð~2A
+G nÓr·>o$ààÇcYäVÓIêWÃÝ0âÎæ)]ásÅlÀEØnÜo=lGö-ê
+­¶î¥9Áá»[Ç¦Þ5ö@Ñä9PÜmûÒ1Ì;=>*/{;°¥¦>6¤7ìlòbìÜï]ÃcQ ±umá³ïØÎò{?îÃç
+
+°ÑÔ}WT£¸qK ¥ºúd­ 
+-ûÃP»Çödç&GÐØû/è½÷|=ldÓ ã*»;Ý0-
+Õ4Agß=Ê<ãü6ëQ·&ÁiR[ØÜ)DC<sÒjc®Ç¶daSìö±[06àk5À84Y¿1ÞOç¤ $­ÍÓñrõáÆyvØäÏõ8Ûí
+-Qû,-uðº]Ú#FÇ{°@°Þ-æë=
+-=º=-m8yd­cð1á	ÀûGve½¹6ÊE"4Ç°¡H£î¼²ÛºÌoü¯Ø/"[
+-ðÛV |s´m¹íðÍmb×U2"RÙ	Ub)AAê¡ »Þ=áÙöG°
+;]ÓÐsTÿ=ÚÍI(!ÎèÎIt¸«x=/x,Rä}iYCÿ½×
+.øBi«]<û´Äi	Á8)ÎßÜ^ýv
+
+|S-¤á¨Ì*?\ýük¸ÚÂ+XY¨,]Ýû(D@
+ï,åêÝÕ?O¡bí³ö
+9Â¯RbJ¬lB:óÍ0Õ+"Ò'ýætHB>{¡&iÛ1hE"J#ÒàO£¯Î*¡§Ä±t
+-Ï`I8
+-/gÂkÀQÒnàéîj.	[PÔõ¡<ô@ÄÿB
+-Ej¦Ð:
+-
+L ¤?r§dIyøâ#
+-¨Ê¸$S³<«¦L¦u8?¾ oOÉÛ©Â1>©+èÀ7ê0gó.=Ó£²»/3qQd°Mß0ÉBX<öE"	£xÄ¢[ËS|:4 j¡¾¨ê|Fh¨Háihômrh/GÇËXH
+¡L?7:wñÐ þ«Åïv¸&ÑgÍ%õd¸TJ.¨3Ý,&ÞÝ
+o[ \ý±aï:ÊrçýÃ_vì
+õ}É®Þ¢xÝR2¶K,2©æ
+æL¬ÁÒ1B]HÀ÷çe×Ãàí-GÏj`a¦ÔiÜ¬&NæDãN&M
+üãMZøã
+í1£`ÈäHÁøZÈLMäåáè§èötÅ@âiB3L¨é@
+ö<; ãâ`Îï#Ï(Æ
+É¨Ô©	GãâdÀ¾
+ÔÅó=Wn2ñ.á¸ÐtVÂ) ²-Ð\_@û
+ãuàÂ(ðð
+-ÏCZPÍ(9Õ
+-Ü¨nÙ-eÇ*w<ë	ÐÆÍ(
+ÞÕA
+!a £wÊsû
+SÂÃ\Uz/ÁUûkKT-
+--¶4bt/hSá	9¯Ãá³*ªDquC¡jåÔ	(ö's%OW9ÇýþMå¼ 3Ú×~^:+°Ûí¡FÜí¡N¤q\nà@l¹·%(fÂ,øæcÑvCÇ':
+-¶ìÜæÖ³Ü¿^ÒuWoúÁOõ
+^óù7Ð8)V¼dÄL5¯t±çwëÅÎÅïÃc1CzH4t)Ýã`Ï£öHk(ºpÈ:Øà§ð<XöKôÀÛà]ïo
+MÈ¢éÌÔüÌTP
+ÆJcúc`¶N7ÌÀùZ|Ìh{¼¬adçóTó¬ÙÎ!fVê#XùrR¯u<§ýML¥ÐúT)Ql¨Ïa¡Ô'  àÓL	¸ ¢q,ÒP=lñ	¢dD¦õ
+U8ãIH3P! jþl4
+9üÍ"¥Ç£dÂ#¡ÙØÝ
+evÄê·¹%L6Ý-ùæBô"c!;R$~Åwr¶
+-©'
+7¶eòÁ^Ø³AÛèévw\Ë`à9OËF8¦g×¢ÏIÈÿßáerY
+
+-;>ÃqU;KN
+·³G Àò²ã¾LeÏÕ©0qö2ÏUqÜõUÎDXÅ1aÛ2ä
+-G{]csº/¯	àíÜý×ç\ðÑÑô¼4Àø¤Pts
+ÛÒÊBTë*FÚx¸rfâzCXm81`ü?d qæ:«W4Ô+ÿ'rM
+-Ìø?Ó²ù¿^
+ RF"ËÔã[»p)¦]ãÝ ¸«ÏöÐ
+@ÃÅÒçë
+--³D$ðiùÇÅ<É
+úû¥l½Ì¦ù
+vi]þþÉt:K«ÿ/¯
+µ
+-endstream
+-endobj
+-673 0 obj <<
+-/Type /Page
+-/Contents 674 0 R
+-/Resources 672 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 637 0 R
+-/Annots [ 655 0 R 656 0 R 657 0 R 658 0 R 659 0 R 660 0 R 661 0 R 662 0 R ]
+->> endobj
+-655 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [151.985 439.581 188.466 451.271]
+-/A << /S /GoTo /D (table.5) >>
+->> endobj
+-656 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [443.606 351.436 493.198 364.487]
+-/A << /S /GoTo /D (subsection.2.2) >>
+->> endobj
+-657 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [343.094 327.525 392.686 340.576]
+-/A << /S /GoTo /D (subsection.8.1) >>
+->> endobj
+-658 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [93.918 193.078 131.365 202.647]
+-/A << /S /GoTo /D (table.6) >>
+->> endobj
+-659 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [154.221 193.078 191.668 202.647]
+-/A << /S /GoTo /D (table.7) >>
+->> endobj
+-660 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [373.851 156.34 415.695 169.391]
+-/A << /S /GoTo /D (section.1) >>
+->> endobj
+-661 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [271.283 133.127 321.862 145.082]
+-/A << /S /GoTo /D (subsection.1.3) >>
+->> endobj
+-662 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [270.295 120.076 319.887 133.127]
+-/A << /S /GoTo /D (subsection.2.1) >>
+->> endobj
+-675 0 obj <<
+-/D [673 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-150 0 obj <<
+-/D [673 0 R /XYZ 94.914 541.192 null]
+->> endobj
+-676 0 obj <<
+-/D [673 0 R /XYZ 288.245 299.227 null]
+->> endobj
+-677 0 obj <<
+-/D [673 0 R /XYZ 241.131 103.127 null]
+->> endobj
+-672 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F49 256 0 R /F17 190 0 R /F50 271 0 R /F57 279 0 R /F23 294 0 R /F51 272 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-681 0 obj <<
+-/Length 2556      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚíZ[sã¶~÷¯`óD7L\	ô6³õf3»³Ù6c÷¥ÙL&i
+-E*$åûë{J¤
+Ë¶ìÎô¡/"à¹~çB%ÑMDßüõòäì
+MI
+.¯##¡"RÊutYD?Æ*9ýéòÃÙ;¡§;&rôé&I¿ÿtqyªyüæãÇ÷¾;]pãOoqð
+?'â7oÿöqqn>I<9]¿½<ùõÄ¾(hda)Ô$á,ÊW'?þD¬}Â¾¸«H0C0®£î!
+-!ÓCg$°¤©òG8	bSV
+-4aÁb)QÊ¶ÎÏªf(»ë,/{²üãtÆ	£!%ØÁXJ´2!By2~jO6r"(¶îÚS¦ãÛª({P
+Kâª±#Ý87´þº,ñDI§ H!Ç#¯ÝÝû²4î ÃÅøLÖ¡A}Ü{ºò¶ìú2t%ÊlYêÚÍP5#é¿^e}Ûg£5) ®©ð¡[K-
+_µMæÙ^£ÅeWÝJgC
+»p½ÄÉzóm{?'2Çi\8qQæ»U	ËôH?ãú,!4"¯»Ï	MCêÃ­×¼]­»ªwÌÂÎ¿þú¤îü±uwÖ%Ûnè²fgu]ÕÆ)w§4väW0p ñëÒ[5y½)Fr­99jebö3u.Éùø´÷ª~
+øKÚ½yÿÚ{9
+-Àl|<ÌDÑô^<§Y¹²Ò¼ñÇæÏº1û
+zÎÚâö";¿#÷F&I®  T¾Hý2¸U¤ÀíA2¸$Z=·2M
+dHn±ö8X+50lZÈø3å¢Ìú;¼³ k¯¾üÊDlù± 
+-<áÄuÛá¾­o«æoÚõP­ª{
+²3ðª«
+»dnØu¹êgÀ â¦mjË¬ÃùòW´~h¥wÓAzðßÇ3|ïA
+ñû#<[ûA#F¼ÌXÔ¼JÞ!\
+-yP !Hp:WE9ðã
+-{ä$aê8waR#2i&~ã¦[¼¢ßØuägÑ4ú]
+llÃaùÛºn«avºÆ§a
+ï.äCýÐmòaÓyËÃ<AÄ²¼½ª²ãÌÒ Ã'3ÕÂ`ö¾g'q ÷8/v
+-©óÀÌ^ò¸äç~:Æ°%ÍçYãx,ÏK4Ýåy]V`Ùf.r@È$Nr@?ÈgÝ ¬YÄ´WVéVël !
+ÁìÄeEÓ
+n¦º9æ	(ÔÿV
+q¯üØÏÈ}ô)	Ä³q yâeåXvkôQÐ&Ñ'¦æÏ×íÏP
+Í£È
+B¦#S²#!Ó`1:
+ kÎrWø%&ñ¸M¶Uß9'±÷ç`î¡ÝF	)¦z%¶.3/D1×x
+AxÊT)j&Eò\mRú2ÿ
+-¶7s
+-¦Åà!cÁ²ä!¹W®<à
+ÇQv¥üÈ@iÄ$àcYL%ìÌ,}°K.·+.ÂnVeWàdå,O
+`¶í*7Yç¾¨ Rð²+1lWî@Ûc8â'ìÿ=Wé1¼^è|¾¹üZµ¿,vr²×ÁDÌ?	
+¼êì®n»Àp$a` àL
+Y³Ymw¾h°C_Ãh
+-vËs½A9é
+-Ú9
+vÓ²ºY~@ä>4ì5
+S×tTP¼Mß:(
+
+ÀÍ®ÄàÍâ Þ {Â äò¬Z­ë*wAV¯7M
+©
+¼Ü©]QóP¹c1é}Oõ"LÚëß ô	ýç`ÐÑTÊ_æ¬R©økdº\)¨ºç¾ 6?ìGôEÈÌMäñAÕkFõÚÁfÇø¸Í°Ø5óÑDØÆct| ? &h¯²°áCh/÷ÛeÃ²Í¼¨Vàp>kØÔu.½Û}B¤ª*%i²ÍAvc4 Ô¨ßvÐh«ª ½qõ¬VòðDðS"5ÐÅS¢|næ¾îÜ1ýH^øýj
+-zÒ6iÈTfÁÚg=TÔeïØÖ]
+fû©Fî>ÕôÁÏ@p¡¦Ã¡ÔË²håAJ=AÜbØT5©ô¦ UóËvöü
+­ïÚ.[õ[¥NdØ/D¦l"×÷UÓ*+ ­P¹?Õ×ð`¼ÇVp÷@ÂøÔ
+-­¾ØÞwÓñs«{U
+-þ³WT¶¥SdÐnÛÖG£s 
+ßïn«J¡â¥ûÂ&RLa|cvn
+-8
+.SM	NÕcêk5
+-K^Óþ<·³ïäô]lM8®f§fl¢à@ø
+-¼5@¼vrr
+-/=¾µL§m¶­l3 ä¶
+)ÃPn÷¡°íKö
+mç²~ ´ÜuÍö@bú*0SºýDºÌvÞ¿²Åë¾o¼¥Y3¶êö¥Y©qO<NXÁ3pnÜMåý²ý2ªld©÷KeÙ^ÖPWí¦¯ïðþ¦lÊ.°ã¥ C\o´·-^'ïWî'G=.äYã©%ÂpîHp
+´*©YÈ±p öß|ºxï<Æ6¯ù²D·4*ÞÉ·­Ð6í&gÛvÎjÔ^ÿs1»Á9-\ÇW¡Ì
+-§ñÛrí|·lÆsUÜú]®±Üºl{HÀV=2ç}FÅuÖÜl²ïX	Í\NÍ]ny÷
+é i
+ánG,ñ
+-íÜ²ó¹rP8
+-
+,toÛ]Ùoê±ÿê@õÿÇu×¿òWöc<ö×ÕUgQe,ð¦	R2I·!vº<ü>äQÊ
+-Ç½+Wå÷ÃØ]ø\»&Aîõ[2¬oq«ÆoeÄ¿o
+|°QÈ¹ Zo£ôÑçMQlÌ¬ xí},ò×
+=Qcë fÞÚ>Æ
+=
+.6kûrLyÆ¾4Ú²åêÆïYísùd
+õSÈ0´å©o­^%<U]è8Ùë¶(ÿ-|ýþ»;ZåèøÏþ4=iÿTÓ4IÂéìHÈµ&G.$¿Õ^.ÿô¯Öã×´Ù5>³ò ZÖ°Br%ü?©nBH÷Añ9±Ý¿e@
+;¦Dé8ÔÌ?SLñØÛÿ¬è>ÿá<¦[ô`hu5~æ3ø`Ùî 	q
+-endstream
+-endobj
+-680 0 obj <<
+-/Type /Page
+-/Contents 681 0 R
+-/Resources 679 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 637 0 R
+-/Annots [ 663 0 R 664 0 R 665 0 R 666 0 R 667 0 R 668 0 R 669 0 R 670 0 R 671 0 R ]
+->> endobj
+-663 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [412.983 632.927 454.826 645.978]
+-/A << /S /GoTo /D (section.5) >>
+->> endobj
+-664 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [400.778 572.752 450.37 585.803]
+-/A << /S /GoTo /D (subsection.3.1) >>
+->> endobj
+-665 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [369.949 536.488 419.541 549.539]
+-/A << /S /GoTo /D (subsection.3.3) >>
+->> endobj
+-666 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [442.815 512.578 492.407 525.629]
+-/A << /S /GoTo /D (subsection.5.3) >>
+->> endobj
+-667 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [387.744 452.005 437.336 465.056]
+-/A << /S /GoTo /D (subsection.3.2) >>
+->> endobj
+-668 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [350.951 404.882 400.898 416.837]
+-/A << /S /GoTo /D (subsection.3.4) >>
+->> endobj
+-669 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [355.005 391.831 404.597 404.882]
+-/A << /S /GoTo /D (subsection.3.5) >>
+->> endobj
+-670 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [388.948 262.676 443.205 274.365]
+-/A << /S /GoTo /D (subsection.8.3) >>
+->> endobj
+-671 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [424.008 194.324 478.122 207.225]
+-/A << /S /GoTo /D (subsection.8.1) >>
+->> endobj
+-682 0 obj <<
+-/D [680 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-678 0 obj <<
+-/D [680 0 R /XYZ 217.919 351.179 null]
+->> endobj
+-154 0 obj <<
+-/D [680 0 R /XYZ 94.914 316.873 null]
+->> endobj
+-158 0 obj <<
+-/D [680 0 R /XYZ 94.914 180.359 null]
+->> endobj
+-679 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F49 256 0 R /F57 279 0 R /F51 272 0 R /F23 294 0 R /F17 190 0 R /F50 271 0 R /F20 270 0 R /F21 371 0 R /F26 309 0 R /F18 191 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-686 0 obj <<
+-/Length 2492      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ­YYsÛ8~÷¯ÐÓ²âàÍÌVÍfÆ{Tjggã­ÊÌMA+©ðã¿Ýhð ÇNöÅ!hôñõ×Ípu¿
+-W»úëíÕë®xÈt¨ùêv·Òi®Vq*éêv»ú¤,ZoxÁOÛmQÝ¯7RÊà·>Û6Y×7¦¥ÌþWÁûãz#ÀäðRPd%ýz³NUÐWyWÔU»þãö¯ox4?Y	ÎÂ`öÐã¢«ÐzúÿõMÄçoÃ¥B®62bi
+Ñ&Ûº¿+
+-	px,ªÎÜ7Yù{
+ôËHâ/0ÃßøÚp3*ÚÉâÔ)ä}q(Ê¬)×©
+®a.Òt0ã G5IÐöGTDÔ­¡n¹5ÝÞMÕVX±ª­êZSîÜ¸¥õæó:¬ì³Îliên
+-:~¤qF«ûÖ4<¶,Ûì®¬­1r\ýV×nó·xaPæK9
+åµykHK
+
+Ð°9mØ^c²D¤ÃR«¢(xØ9^w!u8öõ
+xÊè\îÓÙ
+-f
+Î½@ZÁï!W_ìá¡Ê~i¥dBëAÏà
+A9w¼Ò®©/	ã©$=*M[M"ë]1Í»Ó3ÔMsïR1.ÆÐ`ëR*øGEÞ{È¬=ÒYyÖÖÐ058Djwí£ªxec&c5,}(Jßmq8tð
+ÀR
+-²
+
+vusðÆöëßyðéÈ"Â"öv¾
+h¥íA? æËÑjÖ´-`¿Ó4F=í¶< nî½~Øádë	¤^
+-fîMe |®1À"ÒN££T(1>d â}u0d0ëj¯ÉbÁtÄ¿æÝ
+j¼È!s~ÛÞÙ@wB
+-º«H$BË¸¬èÁu
+-Î´æA
+hþt0ÛVæY÷efñýôÁ%È@±-î!µÕågaTPådOd6£t(Áçõä`ó µ9S B¼ÉÑ]Õ"e|ÿÌå
+&!«1úyßÑyU=¸h¥ä­úßv |6%¯!ú ºZ²7á3pdßåV
+að÷'¬
+üÎ9S!n
+qæ2RðÉô¥ÖäA(ÝÂVðlïïÜõ
+¼FÓüÌV¸rç¹×V\°pù­$|¼,Hâ
+<«óI!Þð ìb2º5ÑÑ"k
+Ú:paCHjáJÓJk©@
+uGã­q.is>,ª«ñ5ò=¼dè§zç÷_H´Z~K
+-Án÷n÷¥]<%ñÉ:'e*
+!gô±SS2-Ô×À+M±Ù8ÕlXÿ"åð`ëòp¨+OòpÖwõÃ/+ËÇ7²h
+9Vwå&àüjB+jÝ¾ø/tü+
+-,ïùH?iÞÆÞ­Ìhbç(²?cÎ=_¬qi»¯ûÒ]yhkh¦ªcH|ÜÜlKâÊ ,*C¹x[o¸fHhå¿l<À
+5w	NO7ò](
+j#½wbè¾
+E0£æ¨7Ü~Êc°dD'ÓuF
+-e¸ ¡dz"3OÁÊON¾xßIº¥,}§{ãtï¦*/{
+	Lú-ª?´WÜ¡kgÍã@Ò
+¿ÊåA;p¯
+[îê²$ãåÛÁ1ý	HNiûÏ
+Z)1æl³åëBÇWlÎ
+x
+¡
+N ²gÐ3¨a¨&#¯úÁåÇã_|vÂ¥"µHËrPú8»~ ªSc·Ær0ÔÇG,úV^RXz±MÆsêï§Îv@¨Ù0ø.ðæSasa
+0^k@jBHqõËíÕ§+¤pÅW@Ý Ô!
+y²ÊWþW[øC¸yºz°K+H6XËÕû«ß¨ypëI
+,)hÑ,åÎc>õÙ3©i4¯'ªïH;¤ËÜî-È¦ØIÞÔ4´S tMa¶s¿S=ÚÚÆ¹W!õëð
+èÔ
+½³ÉàðÛYeqÊÇÛMea.0
+WC
+-
+ÄÒ×sÈ>h½p»ÀGÏËXb9{å*^2x§Ö¸ÞÜi
+-Î¦÷: p¶%Ú(dv6^°kÊsð3spÂù¼¢È
+Þd5²³~þõÝ[{k
+-µN¨X
+%î÷¸·
+Á)tb÷RÊÝôçwïÎO Èþ/§ÅÀÜ§þòßÿú[ÒÐi+
+Wå¬®÷B®»äÖQ^¸»÷¢®Nå)/9äm·'ØÅÐÇg
+¹^bÀ®)Æô1²Â{D1z1,ãÅ`Øe55°ób^	W¾ã ý·i;z8à¹ÔpçU?À}¢øÜGÏkõz;ñ@1õìÒð·ÒÏ)§0ÇN=² B
+-¨¬ñèTà'¡<¥;Ïn.Þs~YÞõC£çeO¬éíIÎZ5),ùë
+-¶s±pPf/ÙáXkêmjÛ]£î/
+-³&iUûy¢!®ZXHçnÃº
+´îNyXTVO,ýR5¬T¹Ñ3ýCncüG`^Zd ×Þ·æ¡mPîÀÎ= ÐWbþþFÈ3GGMÑAwT©õµðÒxÎ
+_Þ3l?5Ý¬SøÊýßðW9mªyÈ[/lë³îÛ
+q¿ ©TOa{2Y0bi¤¿ê) ÜnÇK¢g}çz©Q9×hr¦Ñ§ QXÏÝ"51ñr
+-}öÄû`Ê}gOV
+¢§Bù
+
+- õ=åýØm QÌ§¾ îJ9¶uq
+»b½uuoKlØc ½k¡Ój
+-¬L^à¯`éHÅÏoèËYÿâ©Ïn[õð¿°S¿ÈÜÀ
+-ÎcX¿À
+3ôR
+-î1jqâþy3ÿ´5,¿ãøÂ­å¼RóÆõÛp°åòþ¶¹&ât^oâãI¶ò5ÛB?Ïz<ïðÇ¶[Ò}EÄ:?áäi;çÆv}"dÂÑ
+¿íâ +!ÛoÝj}Æ-wd~hvpH­i*üÍËñ(CË¾«ÐÖ ´BT?Ìï¦èaå ÂîYã,ÕçnyÑÆ}s
+¿SPm7P pÿªrÉ¾
+-endstream
+-endobj
+-685 0 obj <<
+-/Type /Page
+-/Contents 686 0 R
+-/Resources 684 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 690 0 R
+-/Annots [ 683 0 R ]
+->> endobj
+-683 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[1 0 0]
+-/Rect [295.887 351.313 350.001 364.214]
+-/A << /S /GoTo /D (subsection.8.1) >>
+->> endobj
+-687 0 obj <<
+-/D [685 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-688 0 obj <<
+-/D [685 0 R /XYZ 94.914 439.55 null]
+->> endobj
+-689 0 obj <<
+-/D [685 0 R /XYZ 94.914 348.787 null]
+->> endobj
+-684 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F51 272 0 R /F23 294 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-693 0 obj <<
+-/Length 1423      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚWmoÛ6þ_ad&76MRï°¡KÜ®C×
+lH±i,	8ößw|³¥u}±Hñx/Ï=w'ãÞª{oO~Þ°G0JqJz³e/
+-PJ^øøIo¶èÝzíßÍ~
+½	¶¤Oä(RBiH0ÆÞô·×¿\¿ö¾ï{¯¦7òò	6&Á^Ü#Ü¨Ô2´j~(<(#4ô¦;¶)3ÊâÐ»,àI¼¯µ;]Ç1hÀÈ÷µÙZ^J}oYdYÑ§÷(ò~ºM­w¬2,Ëô¢`S|Æ$à
+ýæA*àU-ÜÜ*ú9h¬|RûfÍgzçE.¯7LäVÈ­´áçPF%Ã >
+-TÇ¡§!öêí=,o!*>oêÉ¤$mc'<ßfdÂE6RD¡Ãºa÷¿½¾úø~x9âY'òùÕ#c.èHoÞåúY²ªómÆª¼bïQa¥bÒTÒ	iÍ¤T²$ð2¾l4_­Y4b#S4Ðk1òk}¨¡õ%ól»P¨BÕ·¨úybc¬¨T%2UÈ
+-D$(
+-Cjù"-1
+¼)í8Ïäz<ÏÁµïkMÊC?ãkÝqÚÖM p¼´.¥2­ÍËÒåN À'ö(&®LA@
+8EÂ¸C~ @r¸ª
+?ß{
+-'ü¡F@ù-kuá|Ûªb
+Á5iõËÏ ý×µ`¹>VÅÐ>]nóyÅ¢]¦¸í2DkâÐ0âÉ`à= çNU°*´"K@
+-±KOh°¯[
+-õN2!àg½"½¥1ÖÅ DV¥¯JH]°8-±Pµ×½Fl
+#IKOö¤1ù§Q'ÿ°lÆT
+þîp
+-#B$I|D	AdÄ¹++bùÀIÜA¬cP{¿ôì4U½;I
+-·µîÕJË²ê¯(+ÁlE/*a;³V±uèAö2´n\~ #­¤¤»C%j
+Ö¦
+ÚÛþ.¨3ÿs°Ûº!7º¥¦6IúÎt8 t"ÝÐGð»
+VÖýa@Ûôù¶6² åA>wúRmdAËEÃJukòG,KÀlûT
+øÑ1N§¬~2¦
+-ýüTóSãV£¬S´;*¬Z:YÀÈ_;
+-Ã±>.Î¸4
+-*$o¯ó.«!äzýPããæ¿tðàþßØðS
+æ1øc öøÜM}KÈÝØea®f¦
+-fb0¿¹Nß_O?|x÷áí~wýëÇ«O3½nèa®÷WÅ|»x¹qÕÌ´§ä§ÿÕ|¾ÝÜóª
+È
+&ÞÛø
+òçúñü¯cå²)§¦û+-²+;VrþØ®Ûüî
+-ãÑSWFxìHëu[eÇÍ²®Ýâ¼±,*RqÇbÅÙÙ¾`aÐß·â®£VÝ>#Hs$wÐ9ÏÜûÃ ¦
+-¯
+-·)`øÙQf
+æÍùBâV×hØÊ¸Czñ'ç%Ìµ¾7,øm³æEXáQZ¦.
+Ï°ØC1[²À»±^Ó¯ìÑáäVÀÏt>Y~[O¥^\~Þó»ñ7\.mÿpQO¶
+-Õ)Î­Îa ãâ¯^47ZyOþI×_+ùÉätÃvÙ~ºN&­^EïàüH
+-Ëf9ÁV«EH½Kñ¶K0ÿ+wõ7k~õJ¾=hÈ ìÊÁÊà×
+ûo	µãêCÚTÁQ?ü
+:Uæ·
+-endstream
+-endobj
+-692 0 obj <<
+-/Type /Page
+-/Contents 693 0 R
+-/Resources 691 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 690 0 R
+->> endobj
+-694 0 obj <<
+-/D [692 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-162 0 obj <<
+-/D [692 0 R /XYZ 94.914 658.232 null]
+->> endobj
+-166 0 obj <<
+-/D [692 0 R /XYZ 94.914 572.644 null]
+->> endobj
+-691 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F17 190 0 R /F49 256 0 R /F79 695 0 R /F20 270 0 R /F21 371 0 R /F24 308 0 R /F18 191 0 R /F26 309 0 R /F51 272 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-698 0 obj <<
+-/Length 1380      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ¥VYoã6~Ï¯ðn_äÄ¢IÝDâzl»(èÍÛî>0m3U(UGbgÑÿÞ¡HêpddÑ°D3óÍÉ¼Ø-ðâ·n/Ö¿É`D1%Ûí`%>"~²¸Í
+¼¥K0ÆÎ§¥8
+z<-½ØáÕÒõ}ßy`eÎõÇ
+âå×ÛßA2
+K&8ÐN`Y<q`AiYÊ(¥äMEÂ1cÏE¾"ºÀÆ´St7ð9Y¸~(ÔLYÑÞåüòré^è|Ø(ÝíÂ}`y^¤jW^ÖâÛ
+"Pÿk
+ .ñQ¨ämQ)R±Á×âF^«+kÇ&7z|ø,¾nNDØ «ë
+S%Ü±l«Ê×µ`Rñ\
+ÊÕÍá&¬^¯õúÅÿnY^ëug¸ÛÉßéZÈë¥ÙõùZ9#±ª
+íF¿0@SÐûâ¡ØqÉÖ [ýÎø®âF
+(¾j
+-õ¿3èe¤nÙ]­ì lî±\JXzÑÈ§Lü¯¿dù±)öÎÇëvo/<áº®{àº?ÃN¹Äv´xw¯YGÁÉ¡X+'o§2¹uV«! §¾S)ÿùþ««|¨
+xo
+¨þ±¯ÎI~üÈÄ$-ÚFÓÜÜè÷±tÉºËq¯ä`»=ÛgHa¬ÒhÔÊ´
+ùúBü@¾M CjÜÜØU,\6ÿ
+-`²uÃez4{þõªlp)÷qå2Ó&¤¹`cDº2A@à£$Æ] Ã§¥O 
+Àãié{º
+@Â
+] G] ¦c¡ÄuíS¢Epg¿Ò	\B)Tj{	ò±1øvÏU5ÆNÍÁeZG·:ª!ðÝÑã2ÍÛ%qX£jVÑ4 ¥ôð¤ùà 
+~ßÐäZ8?±n³×0%¼N{¨ÚW¥ þ¬8Ëõ¨9¬LÝr3ª0:
+sªPDßRcp^ì
+m²±¶,B8¡àJãIo6Rµ8"ó¸AYÜes7¢Ì
+k*¦<©¦R«iÂsîÓQOOÛªjëc¸
+
+ÜéåBE§bÖmðñ¶äR15héAàü©»"ÚÊ,E­Ù
+@idÆµ(¨#Kè¤ÑÑYÍÕV&N
+-÷>S¥B)ôµJè¸69°ÂUÚßi0ýeÛðÌ
+ }[kã{Ò¬CH&éaà¾ê¶]úUOêÉTVÙ\ôüaÒXLf³¢¡Z½¾D+þÈ«ÏJ#È¤­ DµD¨¶LÓ{ªâ5¤ImRÆ<
+-Î
+ßþ¬2³fÝÞÕ0°¨@©æ&O¿$CðÜd»vÜÈÛÌ
+7,+òtÝ=ÑþÝÉÈÔÖ|ÚüøÑ,~ùã£û³m
+-¯¶,åý¤äÅSl<¿¨ë°kãÝÃªdF¡ÓÖ~sîçÍü:nýò
+
+:22ÓÔíÌ6»ÉtoÌëþÂv*kïZu<ßì!Ë
+-C^Ø
+-^ömªsV<OÆ½ÞÜÏ
+-¹Æ3v «¶BÕøqÂ	Ì¥Áy~Õ£Þ¥µùÍf
+´sØ	Àa<ÏV¼i+Ù+b&BÂ¹îJ4ynøÛ¹áw%
+-¶bñ(Ü©êZ#G-M4Å8W^±jj3&1v
+a?2Ù¬Ó¢äè¼û:£¿G
+²
+¥+§ãiàág÷²]ÏSÌ,
+åbÏÕÁÌÞUïo/þ6îv
+-endstream
+-endobj
+-697 0 obj <<
+-/Type /Page
+-/Contents 698 0 R
+-/Resources 696 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 690 0 R
+->> endobj
+-699 0 obj <<
+-/D [697 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-170 0 obj <<
+-/D [697 0 R /XYZ 94.914 419.177 null]
+->> endobj
+-696 0 obj <<
+-/Font << /F48 231 0 R /F49 256 0 R /F15 193 0 R /F17 190 0 R /F79 695 0 R /F20 270 0 R /F18 191 0 R /F51 272 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-702 0 obj <<
+-/Length 1408      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚµW[oâF~Ï¯@Û`gÆJHæ²mµ»ZªæªÊFkf/Zõ¿÷Ì
+-l3$[©Õfm=çþ}g¨5m¡ÖÇÇ78jaäõQ·V?ôú8lu{^k8n=9Ý°ý2üùø&ìUw¸çaä¦~ÛÅ!çúþâóÝ§ë¶sy{uý«>@ÚdÓkÔ¸AäõºR6¶ë÷gÒÆNÉr¦|pUºz(ô
+
+!ãð6\VâB2%S·è÷½¾G[¥Qf¥x
+ïðQSFÆÚ£ÏÕûÂ8É3:¥,NÕëé3ÂÉj
+-FXÙÈrÜ<jû'ÎZ=çt¾H×ÂåÛ¼>æâÀÂ¾r6Â³­)¤××
+Èñi­â¯°Ã'êS¦¶ÌaÜõP°©Þ£ìIW÷Ì¾\)¥,IË±öoýÈHQfL=/ÛQ×3
+ÅÊKnõ¤+7âý® BPo\ñÚnb
+á#+cyeÍ Ä^ÏÇ*bIÌF5X©ÅhBX$;Q9ñ¬Ê
+¡³¢ÅjÙXVx­ Ó¥Ð¥Ås"qÛÑ_s%nDUÎf¦
+-³*°g
+]O³xîÕ8´å@£Ôr} /êª¿SU39ùÂ>:ãcõJ¸$ï#¾	ª£¬P;CÏ(Bð«7½¹vX§§|ZÝf2ÏK½íììÃåíç»ßÃn¿¨w·7êþÅ
+þ¨în¿þE=
+-.®n?¹j}ÅrNäX_¿ÆÀ!"Ü|ÆAÈäåÃ©ÍWáØsÆçTpWÈÉ4#dð½¶¦¥¡GEh5ÊÆYC%ÓÌ8¡Xm²-ççêÎk>B^5è¾©À#L¹ØØxB¡¹¤ôOýUbÝªKqêP=<á[]Ô÷öMÐIÆ#
+ØÿbÍdMù½Tîb
+UR¦CÐÉZÄyNz±Ô
+BÇ&Èe³qxÿo¡°zT×"õ.
+- QMW,'<3Êè·$¹Íèýz¿eäE2<äoy41'(-ICFÝN&P ì^s¸n{h×
+Íò¢@CêMºÞÁ':@§ô
+ª{J$ÁÅVE¡ÅA
+-0X*3`C¶cW£Ò¦®GnÊÜpjS²dF¯²Q*CPÖ¼ ,Y[Qóø
+-®£fD![ ¬âlÜ ]Fp¸X	n/¹oÝy=m¶Ü1IÒ8Óä±ÃwÂÀÀ69}S>z,
+A×
+¨?¸lêX}ÇShßuL5²ðE
+å¶¼F?0íARj>Áä£énc² p1
+-¤Èfb]óbÁWDÂúµÃL\°ªô¢¤(M»¯7Ñ£Ò
+ççÓ?¿9FÙ¦iDd21ÇìNA`N÷iÊG&Þfæ<S Í¢:)ä¿ÃO¼¦»5wWNgÅ¥KÐÈ­õ+!nxR©ÓñnoÖho/ÓÃ{Ò«¥ÒEÅ,.öà
+aÄm[3Ó­B8Ìé`øG; ¢sßyÐå¬MD
+ñÖ
+-z·2Slzûnï¦í@DTïÛÑî¨cxX0}©¿ü nnme>®=y®ÕÀäÀ*©m¹M
+-*6ô­ùéØ4>Ýi6ó
+í\[Ô$Õ=úÿJÉão§ÂHîÖõ?ÍfN
+eçQã½G¯#yB¸¡ÃRCÛ~è(+:Uço C·ÂÇ
+¨EìM¡»Þ0^§<
+·¤0¿?åe
+VÁ4>éU7}Pþè²ýÌº
+
+ü
+-^Ï
+-endstream
+-endobj
+-701 0 obj <<
+-/Type /Page
+-/Contents 702 0 R
+-/Resources 700 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 690 0 R
+->> endobj
+-703 0 obj <<
+-/D [701 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-700 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-706 0 obj <<
+-/Length 1704      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚVKoÜ6¾çW,PÐÚ,zÂI¤éE{¨oI²Äõ²ÖJ)ÙNü÷ÎpH­dËqrYqÉá¼¾on®7áæï._ÿ
+çEX°ÍånSÄAÁâMóñ|sYo>xEÀ·>
+ÃÐ{/¡²-Ûm{ÃÖç{?Ý¾ø'ö>I¸ýtù;è-æzAY±Ì5(kAÕ÷VzáEÊ èc$Á¹DÄ O
+-'&(ô"´mü8bA±Ï Oú[¶øqð}/5®2O8÷q{_jZtmóÎ»ÖÉ¶=,sOÀÊe OÊ¶~ ûäí6I½RÉòªgWÂæqñ88âÚuxYÝáo¹2OÕkÙài¥îz³¢9
+-N¸J5e~
+Aæñ Í
+}>ÜâBb
+-íB³Ê¼ªÃTÞËÅ>Ó©I.ª²©Æ¦
+¬ìÊu
+-"¥¢ÝZ(IÙà
+
+}'l4WÌ
+Ý`
+èê
+öÖÕÕÈë½É< 	QBà&
+[
+-µü2.ÔO¹±/Ûë`ë'<òÞ "HUßìõ{»-óÆ¶d×®æA*TN¦P«@Bæ³©ø]PÜ£³uà¢ý±SI
+-Ö¯AèwÖ=Si?h/¸å,xZ\¤^
+¦öÂ|nhkØÃZEDqö½Å,Ì«VH
+K¿¡Zy
+¤É±RÙhÊ<oDi²v­z°È1/¼ßZ:$TáÂ®k ¶Cÿït8HÂÉ²<	Â/jÔü½"@¬rm_<LõöTÈIh+¡éQ2
+tíqíô(­[	ZL¶3Ïö¢{d;Zá%ÓUEìÝíe
+÷öÖtycªT-ÌÈÅ
+-¸P-kKÿÎ­íß^PHvÅ.Û@[I!v¡¡gÆæcEÉ|Ìpf3Kfcþ
+Ç
+ÔóL#ËÂ æÙcfi?Í45HÜP±Ð7Q$ o¤ÿ´­ìÇ	*h1jüÐC.ðó´a©	qEç
+Ê{Ë
+­
+C
+-
+1ò÷®D´tÜ÷
+æöã<ôZ`Q¸	XÛ
+-SÆ1D3qÚÃz0~¬QãÃ!ç1ñ®¨F5ólB
+%¸hÔDÙtØ9x¢¨4ô[^$Þ¥ñ
+-D®UYKq4A5'Yq'®¢¶¥]á¬-´°
+;hpãPJÞÓ¦hÄáØt¸cÞ ¥%ÙgwpÃuYÿÓIº-Æ
+ahf13pÍYÂ°ð¨êve5tJ;ÜûUÐc=]ï®ªSê¡Z/äa¿Ã¨ 3ÈÃØ
+tìx8PbHx¾dwÌWMaê~ÌOZ
+--5ì°E
+³`Ü8ä	aË¦õ `Ziâ
+-NFmæÊD`1asdúºWVGB
+¤ÅqÀ(e.5i§÷é,) -ùÒ}¾dõAb .ØËÈÆð°lFd½èëøÖTçÖÃ`ÿfëg9Öù9@qxâêBÞÚ=º¤íú¡ìq=nÖUË²
+p Ú6ÆSO÷'_AqT´Üuê®TõùlÜÂ³èr¨Sv4´Ôùöý_ø?ÚWÇ+5
+³
+½µ¦DÐ×~îÿl_¯T
+øgõµh"f376g¯ÊES&&UÓ[í¡rWp&MoÎ¦
+Y'Íx1Ëÿ ¢$.kI=^ù²K+æ´|mC6FeC§- I6Ë
+l°U×¶èZ#7®x DÑQyxáX­«EítÙà6¼q¯Éõ6Y6·n|öéâÙä/oý+Tæñ,Å¸·Ä&µØÉVÔ_-
+mqì­	¶êÍ
+Ñ½ð]Ø
+My\ûKí{V+SZ¯Ã
+ùª½§§óR<AÏ6¢þÙ/Ý¥7öV¿j2þeeößäòì¾~3+fÉ©UvÒiEüG"_ìS}f/y\ÍßãÒSá?öòÄ²TñÙÁ79@Jf-èÞRÖã
+-¨eA¼ÒÏøã?çeÉ|¾ß«(ÂÁ¸ÈëÖ_àôZ)Ç~¡¤g+8
+~G®[ýMeyr$á¦¬êÑà§ËÿáÞF
+-endstream
+-endobj
+-705 0 obj <<
+-/Type /Page
+-/Contents 706 0 R
+-/Resources 704 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 690 0 R
+->> endobj
+-707 0 obj <<
+-/D [705 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-174 0 obj <<
+-/D [705 0 R /XYZ 94.914 562.221 null]
+->> endobj
+-704 0 obj <<
+-/Font << /F48 231 0 R /F49 256 0 R /F15 193 0 R /F51 272 0 R /F17 190 0 R /F79 695 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-711 0 obj <<
+-/Length 1546      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ
+Wénã6þ§0R[u»SäÚbÝdÑuÙ  %ÚfbQ®
+-úîÑP
+y
+ØEçúfCk°
+X_.g'7`9±&l0[
+&®9aîÀ
+9á`î
+-ß>Ì~=ùà]J
+¦ãºÀ¨"
+ÇÌ²,ãæÏ_>Ý
+ÇãWw×7_qó¥EîÊ×lÆg¾GÌ.rØo9Fª
+-"ànpE¹#
+Mb¥×Ó¡
+ÏC;0D¶Ny,ÕáÒ+'4µâ»Jñí,±(D½ÈbE£Íp
+
+R©O!2½«ëôxåQ±~C«Áâ1sLÏYºöÄ7rT£À@]p¦YJ3¹¯é«T±üf1GdB¡u
+ä
+imQª¨©¢/ñM¡WÒ¸7\k',k)
+Móod¢^ZdiBx{¬kÙ&óíï8-çà±pÒ²²]#Z¤}<mÕ,ù~
+ßÃ±k{ÆG4"¨­
+üwÖÚÐ-hD3½õ*åVaX
++úôñÍ×~åí Æ¡ 
+-
+«¬Oá¤ñè¦W¸ÈÔ$+
+(4±Bäçx+`z!M6|;À	s2ñwSbLbÖ,C
+Ç5^_Z®cZYñ6Ïh&y¹DH\×¸Mqí
+Ö¢Tå2}qâ¥ìÑ
+R:Qq¯×à0fèoHÊeÆs«z´U´î8	òÌõMÇöÉ¤Öe
+*z&¦	Ê1Û
+-<ãä¦0ëª÷<}}*UA	êåYðg4óÏwéåèq¤wNÙ¨àKx>	±²Óî>QZê}ggô>¼ºûüå÷ÙÅìãÝ-ÍÜ} ÷õÍìæ·Ïo/ng_iõº¸¾û4¾ÒiT&BU¿o^y²Y
+Týs\U=OûôïQ$Í*èpIDÎ(2ùJã)½~ÖªhÖpxVãæ\¬ET¼ßË¿{½
+A TççôV½Ê^li ÄÊÇÑ½zèÝVd<¦ L
+ú´]«Õºm«ÆLr½
+®Su,
+-ðÝÔ2-{,ùrKAfZè¯+¨ç4ªÄØXY"b,õ:N± ÷XÓhZ§òLÊããn°#²aó\üU:b1ñ4IJïL<Ã1'Zë½m±	
+Mí~xîåÃwª »ÝjWÕ3¢q
+¿Õ1ÖÙôI«Q'ÊM±%UéË;í¸GpÜ#8îQ;nî®E÷uhæ'ÈÐ=:
+¿ãð?i7tÀüÌ·³ê¢=UPîÓ¤
+-®ãð3ùºu¥B÷ÚÞZÔ°§
+-P®u©¡oOà>T`·BGÿvtÞ	È­FÉµòÏÏ§ÝB6A·BGEÉµÛÚF§×÷n2È
+-:¬ÿ¨}<Þþ¶UÁÂmùÎ9\kä¬¦v
+HÏ" Çc
+»÷¦ÎbÑBÓãÜnA)ïYý*ï­÷
+e/7ý©XgâÑb©k@]+Ù(áY.ßÑs
+vN¡Ìr½<ç¹ÐÇÆOú¬9ÝSÝÚsnOÛ±¼ëÑ¼L¶`ý¿¸ÝÊ°sBÔµ´{¨é4Æ6*ß!ë¯öVÕFË­Ì~|8ºÇnz`;£wµ¤	½S,ù>;;¨ìíÒ@xØä÷vÁNÊÎºÊÑëgplI®°¥Öñz}õ¦J&2ÓÛúÓ`AØi0Û6­¯{Þi
+gÕ}Ñ]oðLòæ¾±Ó;fh{Í]«nwÛ6C+¨©êâxnÝ0ÄÒõFpcyÃe¬½8UÔÊAu .tÀ»®oU,¡íxk:½Á­Ã°Çqè¾cïöO}÷jXÛaÓ
+CD0Wrwzyhþ¹z¢Fúês°ºy¬ÚH¤3
+àb o´tk®ÑßìßÌþ=<û
+-endstream
+-endobj
+-710 0 obj <<
+-/Type /Page
+-/Contents 711 0 R
+-/Resources 709 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 690 0 R
+->> endobj
+-712 0 obj <<
+-/D [710 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-709 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F51 272 0 R /F49 256 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-715 0 obj <<
+-/Length 1792      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚX[oÛ6~ï¯0ºÉNÄ¢®KÒa]ÒµE»
+Ki«,¹ÔößwÈCÊ£\úPóòñÜyø)Þh1òF¿¼x=}qô&HFÔ#©ÒÑt>JÒ`%P¦³Ñ`ìRÏój&
+^mÇ.cÌ9=ÊD%±8ä¹Zó¯ÞÈ1uÊÂ,|ã«u.ðÔg/ôÆ×Ó÷ 9íjöý°4 Ã´Òr&àÉÖkîÆÄ}Q4ì¢Àx¡
+E±½ð÷G4
+}
+v/¦#
+$Â®óÔ»ÎÇa×yF­ó°ÎkÏÕ¬õ
+&;Ïã´«ØcÂè÷­(	t
+#×HÒè·`í¡JïÜ©	
+geQË¨pÆñ§(\Õ²xß
+-&ÞwÄÎw%op]Ö=Ùu.K}ç«rìÂLK
+-²Vh+çÀY24Kewä;å>'ª¦Ö'"æ4¢npw]7¹XáòBÞj
+ÜýËJû
+-k¼áàqÂ`VêûaJMì åDµ
+-­5ØÙ@Ñ¯`:ªÿLtp PùF»Öq	n ¦|wãâì¼Æ+sE½k2v p¦KssæeÊ;Y,V*3Û	c;]­76Ëv¹ªD½FgÄÛq­{ côÆ÷º
+Åb¨+¨^S[	F1Ic¯&z5¾÷YïþÄ¡Lw0ð{yÌj{7
+á\`ÒÑ!
+-É
+-HÌ\r
+ú¡×
+vM¡ßÜBGLC¼I9û,²|£"
+E'|VæÙü¿#ËWc7
+-BÏ9:ÂýMm*Íêg¼5kx¨6ªÕ ákRT=«@^UAë0Cm ë<hÅËs^oq8-[ÌK
+A%ûPÞ³Má3U=#
+-?]|p6«3æækp#sÙHÑêõcâ¥Fïm)m*jY«ÎZ/ËªÁeY46Ãn'8YoW×\	ÝSõÂ¿CN,ß"d«43uäîºy;¥4YmäÊ¸~g~s1·.ÍÒW|%B½§ÕÚªNÓN¦×¼®ÛújKª«òVdMYÅíZ
+jÖ!þ«,6'ê»ßM!Ú`ªêÂZ³d!ÕS!ÿÙ·lÅ«/2kÿÍ 1èøwp£Ë­¥6o{å_ï²w?T$µ1QêÒ£-
+¿çÅº§zm«Õf"î
+-ÞÂ¡§Äú{b÷Üq»ÙqBä«W§½ÒÝ/]`ÛX«Ú0µ?é°õùü¡´[sþ,§A'Ë¢Ø»C½Øë·S|áâÀyÏ³òFrM¾±}»`PÁª©Cì4î_lÀ)ö%¯qs
+]åB, ·ÜZÎ+B.¼À³â³§¼üwK)K½â_ÔLà¬µDµÇh|ÝÈF!ÂÄ©Mà
+-i¤Âì,9*6Ö)Ün0Z·9©XC¹2hmåf%*AÜâ"2M4
+-
+×!æEé´ê ñ¼6%þjwk	º&
+Bçö iIYê[«$Ò?8Î
+p5¢®Àö>]Qg¹4R- ááZ)ö>	ø^lßÿ¹Vµ4g °Ob/±´× "mrÞÃkáTS=%tC#T»
+>RÚ
+@
+-á×Ä(ö@±¢©
+ÎLoôq
+òððõTÍ»;ÆÈDaºFji"9Ä¸|°Øô
+ãê±ønC]J"÷8W?6	#à6;º@CQmIW%Ôó?
+ìøAË¹~Zä¹	À`bCÐÖ%e¦´Ð´RkØ­É|@EÁÀWðZÛRv´V/wø0~D@R£L/ÄâUodØ;Ù,qËPhH¤æøZf0b$ðÛÏ»oÏBÌ`ôHÂvPäy
+Öõ¦þc
+à¿½[^zSÞ¡ÎÐ2-u³Õ[ñ{jñòðïÃX
+?
+-*NÙ  É}ú®Øõ#éÖû(+++7å.¼8{÷æÝùN//^_N¿øÕPåóß§8ú
+-v>Äò½KhÏÊ
+vÑó?¨ð|¦,(^>×R%öóë~¥Ç¶5i^ñãc²eaY% '£;|í§Så¯aÏ ÑfðjµÔ@ñÊy¡½~AÌËJAå©w,Ocyp`ÿª¡þìAþéJ^îÉÞ)×bq ÕÝ3¤o;$Þúd¾	þ<-Ä]ï[arU\?¶öäëOÞ»°çÓÿ
+¡
+¡
+-endstream
+-endobj
+-714 0 obj <<
+-/Type /Page
+-/Contents 715 0 R
+-/Resources 713 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 717 0 R
+-/Annots [ 708 0 R ]
+->> endobj
+-708 0 obj <<
+-/Type /Annot
+-/Subtype /Link
+-/Border[0 0 1]/H/I/C[0 1 0]
+-/Rect [141.554 592.606 154.456 601.629]
+-/A << /S /GoTo /D (cite.HW) >>
+->> endobj
+-716 0 obj <<
+-/D [714 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-178 0 obj <<
+-/D [714 0 R /XYZ 94.914 658.232 null]
+->> endobj
+-713 0 obj <<
+-/Font << /F48 231 0 R /F49 256 0 R /F15 193 0 R /F17 190 0 R /F79 695 0 R /F20 270 0 R /F24 308 0 R /F23 294 0 R /F18 191 0 R /F51 272 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-721 0 obj <<
+-/Length 1336      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ¥VÛnÛ8}ÏWy¢ÛH!uWbÑ\Ú"m¢qw»Mû@KÍD&JJê,ößwxc§rE¤È3g.
+f#<z³s4ÙÙMâÁ~s2\òÈÏI4J²Ð'a6£+dão³ý×Q¶.Ì£P>öÆ~~uþáýéØ
+Ã
+_^jå
+ìLJ¾âõ0^ûY[°f.UûìÙØ;¾t¿ìÞN¬Ðøv - ºGB?xq-ÕW
+cþðCqÀ?_b5ÿ1
+-øQ
+Y-g÷Ëÿöre Ý´b[-
+ýaGçèÜ -tâM-Íçêæ+W%mç´]Á¬ü;öÆý}ûÏDi'@Ñ@zA Ó³P"iãíZ¿þ^«^ÿl·âð#Òv >¶NÂÇàl õ¸âËo9­ø³ÿíÜM¦´q³ZrÑùòYoò2LÁH¯
+öAY¡Oè² y!Ùõ5/8í`îÄÃSç7KÝVB
+kXk']íjªÞ.
+-¥èÒ¦v æ[E
+¦æ4Ù«ðÕ:ÂÚ¹h-FÎN?¾½´{ÞÎÝ.mP'[BÌ{P{{Këa,ä¢îZg
+¤~_3®Ø
+SÍ
+-Ýà{dïËxpF¢tÍÈ§
+þv Z/äüñÌé@¤Eá¼y´u´²6 PÈÎåéðÐ»B¦Õ¶-SâÅWFbw"þSµ¥÷lk:?Ò4	måðpWsk
+7ïWÚ»½'}Õæyú³Æ3D^±¶SÂÕPL¶·¦åÂÞ\w
+è\oèdëÛÊÅßªÄd]%!~
+ý]7Ò ,|
++x7+-ôt
+dh9
+çÆgüXSÐ¹2¨Ë!aäg$ï
+y³qµn½b³ÜãMC}[CÌ<(
+CR¢¡í7Õ8 >{öIF'H*>ãVöï'i *¤¿ÌC$y ìæ!×²gÉ`bçÙZ
+pk}IQCÎ+ö½`uÛoÓö `3Úò;M¨Wú§U_®
+-pêxEð+¼µØe~­ì÷¢ ñã ÙLÛ½¶E5û0Bºù.Õ
+£$pG%J|VéU1	ºR÷+gl¬Ã Ù<tÒ c©KøcSénF×zL]H`áÕÉÅ{ïØÎÙ©Yà"¦Ü_Éú TI¸ñôfiµ\~-(3
+Ò;©w
+U{:à½U¼Ñ-_K	â-»3[ºdð0*ùËBÍ+&n·sh^ î¢¢Î»?ÇYäU>Ü@YþÒÿÎaÚûD«Æñà¢dÓÖú¢Ý&ÕÌ)
+KUq`Ûè 4ÎðdEH.¬Äi]&ÂTµÔëNæHuòçx®Î6Rl#tBµ[w\óÈ	zCm`-XãMÎ:V²Æí
+)êßQU;ÄwÒ
+»­njHÊ:#9µÖ.ªG"çÊ ¢C´?Ê-4ä´ê´x`tÂf$As®t¨)W£3ÚWQð,¼ÃÑ£
+-íçZ¢3\o­ÜÄè¦Èº0;Ú[Sn	*íÖIG³Ó¿M	¸¾®ìÚwóU53{kpaG ¨_q\v]°Wó²_1/1=³§	uNà,\k±¶Hµ4§èÌ>T4$élÃ	£=þàMs:Ùù¢T
+-endstream
+-endobj
+-720 0 obj <<
+-/Type /Page
+-/Contents 721 0 R
+-/Resources 719 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 717 0 R
+->> endobj
+-722 0 obj <<
+-/D [720 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-723 0 obj <<
+-/D [720 0 R /XYZ 94.914 151.333 null]
+->> endobj
+-719 0 obj <<
+-/Font << /F15 193 0 R /F48 231 0 R /F49 256 0 R /F51 272 0 R /F23 294 0 R /F17 190 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-726 0 obj <<
+-/Length 2244      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚµXMwÚÈÝçW°çM©¥öæ
+lãÄ!É1~oY(ÐM@b$AâñU]-°b{ñÞµª¿ÔuoÝª
+-
+lðþÝÅý»_®U2à,4ÌðÁýr`Th¸èD\&ûÅàKp7¹ÜM>^NfÃ?ïo¹æQ{<d1Ý`mpÐ;æ·Ññ«P*-pô¨>QèÈï`¶´ùÜV§;[E¡"ÉB)iâþggÆàË(b,¸\YUgi>
+I­!=/²j>I°*g`yðy(âÀ>îÒ|AÃ¦~ø¯«ta7:^g~b-é0u¼nö¼LËµ
+-ÉakB&::i
+6ùq=Ïl^ã`86¡4f0â2¡AóaÄb³ÝÕi°
+ð¾Ä'
+
+JìM¸FE]î°ï6¥©_Á¾ïë#=yºÉ
+wïöÇv]d}T[·AYeµåÔîêbä¾u?xËÀº2JE'Ö}$|aFô0ÉÄ¡ºñ
+ 
+>mëlýã¿JJÇÖ+øêb8	)Y±¬ïøºã?XÄ8üðs>æÆrctØåÏY	F\{^]»9n ÍqU÷¢Îy
+eÓÝ9oìmYá<épï6»usV´ºc~è/ ­-YO]¾Èò`K²þ¾	 °½.ÁîHÆ|YÔ
+ì~ÇAú¸vs·Êä)Pÿ
+Pü<áOF
+§ ÅI%üÙÏ¸ªì2¥MFBËà½ýZÚ]¬²
+vpÞëa"ÁÅp!2ûF§i[?Ì}5Çkû[¤£¨W¶o$àaÙ8é÷UZÃ<#}(;/ã+`EÍÇbçí¨ý!&b
+Du!{O¿]b¥qQÇ0.<5}
+xíûqæ
+-T|ôìf<%°îì>³ß	*åBL¹ÓÂ<Å,ò 
+-Æ¢SÓ z]Õë(*8CEp
+-ö}Æq×³Ëì¯¬¦Î{;-Óå"-ÉB:	q¾(mJíßÝ°5,RþÏü²-Þ2ÖN[ñ9k´ÕÒû[U(#çð-Fã¡?eòcÑm`³tí¨wGjî*Bã«O¿.û@Ïk*#I®±Ô¼éÎnC"?¥s" ÕxHH»E
+-j§Û­{®FCæUáæã5îòén:£[ }îN/v\z¢I´6;¾ø½Î
+G
+-w`'
+- B8¤C!ì"É$Ø~$L@üDrBÉÕët
+vRÑâüÏÛtä#> â%y=j×_]e£éÒ
+-
+-û,mzPp;|#Cø<©
+ÑtÕ~A¦ñ¥HOly¶a3ó[¦}ù¹DfqQô^di±÷ÂcvÇgJY.Á¹¨úÕHAýÈ6qeÜäôì-­*
+¶¦gºÏ¼eQA³/KKhÏ>Ìÿ .&4
+-»¢S@,$Ô"ò*ìºgÙ¸Û¯Û§2dÇjÈkéo/gÝ$ÉíÖ15h2Û"¬D¹	En7¶"²gÕ~Cl1}¢ËóøJuÄ×wCòUAi.åâ
+-Ó!J²ËºØOÇÁÉºÁÙu:	Õ¡ÈúHÉI ëÂÇù8P´Hð.(´àDy¨pÁÛ1ðÍ	òú,õjSí;´}ïv{`hc¹þ8¨
+êõÚNF]8­^ÜSvY
+3CÉÛ´¼IÂÐBùôTó#;z¦¬3LUèÅã^Í©÷²U`Î6HI3Sâ³XÑ@øEInh÷ÓÆ(zCAVb!°ÀúF«£Ø±%¶ç½Å8G±Ý§ë]êO£Xpe]E´?z
+-
+<RãY>Ï¶kW"KÓQ9ì"~¾òþåp]HôI(çÙß;7ê)§8QÜ%Is:ê¬8êlH}3{Â} ØH"³Ý&e-:rHÅÙ§äYÝñ!%?ÉÉk@¨rÑ·ÖQ:ÿ]Ã.ë;<âBõR¾Äúë¨B	b=¬H¿L«j¥¾Ú
+´6R!ÔIUQâs_|BEü=--é<¥ä¦H'ÄØ.
+-
+èê%x÷¶C~[	53m `ê4W¸,ìªáöÂÚ¿ÒÏSÑ
+ÚisÎáNùÄ¹dÇB½©V2/ã·6ÞdñW #ªØ~­
+-Ì¸ä×½õë½ÅúVÄú=p³0t¥-!pôôNòÍTd¹£JÆRu@§KÿðeÔè^¸ÁàFÄrÃâ/\:¦.á/aKz¶`q
+-¦«·þ±!
+8Rí\WIÔ½Ë))Ë%Ôýé¼YôÜÏë O:.["
+W½7j`
+>çæIEGUxF ê$õ²dRæ8Jç>¤Y1mÇl¼wµuÿ´D8bòúOHÂ¡Tî=\Ük¸Ç|¢8Íò´|$Ë3¯¯É>ù{çâ³LGîj7`¸	û°ú0¤M=M¹4ú»ëôÁØ¼PuCÿNð·¹²ÿ_Ê+¤·,(¦Í»zÕÿ'(º9Hþ=r[tPÖôâ"Bø õ³K;ÙþïÂÍÎRï!ýJ?hk¥^Ç	(ÇÙ¡>
+/Y5¯[­í#bî
+2øVwy|gS¬¢¾å¾l
+-.^/
+-¬×D	½(U~»ôI¢î
+<9^È©×zÐrÊu¼I¡éÍwÎVJëséJàª©èb¨Çùç¼DtªºS5xþÿ©
+z×Ë:£üígJùókBóÜ¿û/-?&«
+-endstream
+-endobj
+-725 0 obj <<
+-/Type /Page
+-/Contents 726 0 R
+-/Resources 724 0 R
+-/MediaBox [0 0 612 792]
+-/Parent 717 0 R
+->> endobj
+-727 0 obj <<
+-/D [725 0 R /XYZ 93.914 696.093 null]
+->> endobj
+-728 0 obj <<
+-/D [725 0 R /XYZ 94.914 636.47 null]
+->> endobj
+-544 0 obj <<
+-/D [725 0 R /XYZ 94.914 634.975 null]
+->> endobj
+-500 0 obj <<
+-/D [725 0 R /XYZ 94.914 582.634 null]
+->> endobj
+-409 0 obj <<
+-/D [725 0 R /XYZ 94.914 547.175 null]
+->> endobj
+-449 0 obj <<
+-/D [725 0 R /XYZ 94.914 510.505 null]
+->> endobj
+-450 0 obj <<
+-/D [725 0 R /XYZ 94.914 460.891 null]
+->> endobj
+-410 0 obj <<
+-/D [725 0 R /XYZ 94.914 397.727 null]
+->> endobj
+-273 0 obj <<
+-/D [725 0 R /XYZ 94.914 348.113 null]
+->> endobj
+-462 0 obj <<
+-/D [725 0 R /XYZ 94.914 312.655 null]
+->> endobj
+-729 0 obj <<
+-/D [725 0 R /XYZ 94.914 263.041 null]
+->> endobj
+-718 0 obj <<
+-/D [725 0 R /XYZ 94.914 213.427 null]
+->> endobj
+-468 0 obj <<
+-/D [725 0 R /XYZ 94.914 177.362 null]
+->> endobj
+-440 0 obj <<
+-/D [725 0 R /XYZ 94.914 141.297 null]
+->> endobj
+-724 0 obj <<
+-/Font << /F48 231 0 R /F15 193 0 R /F17 190 0 R /F50 271 0 R >>
+-/ProcSet [ /PDF /Text ]
+->> endobj
+-730 0 obj
+-[514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6 514.6]
+-endobj
+-731 0 obj
+-[722.2]
+-endobj
+-732 0 obj
+-[660.9]
+-endobj
+-733 0 obj
+-[295.1 295.1 826.4 531.3 826.4 531.3 559.7 795.8 801.4 757.3 871.7 778.7 672.4 827.9 872.8 460.7 580.4 896 722.6 1020.4 843.3 806.2 673.6 835.7 800.2 646.2 618.6 718.8 618.8 1002.4 873.9 615.8 720 413.2 413.2 413.2 1062.5 1062.5 434 564.4 454.5 460.2 546.7 492.9 510.4 505.6 612.3 361.7 429.7 553.2 317.1 939.8 644.7 513.5 534.8 474.4 479.5 491.3 383.7 615.2 517.4 762.5 598.1 525.2 494.2]
+-endobj
+-734 0 obj
+-[489.6]
+-endobj
+-735 0 obj
+-[458.3 458.3 416.7 416.7 472.2 472.2 472.2 472.2 583.3 583.3 472.2 472.2 333.3 555.6 577.8 577.8 597.2 597.2 736.1 736.1 527.8 527.8 583.3 583.3 583.3 583.3 750 750 750 750 1044.4 1044.4 791.7 791.7 583.3 583.3 638.9 638.9 638.9 638.9 805.6 805.6 805.6 805.6 1277.8 1277.8 811.1 811.1 875 875 666.7 666.7 666.7 666.7 666.7 666.7 888.9 888.9 888.9 888.9 888.9 888.9 888.9 666.7 875 875 875 875 611.1 611.1 833.3 1111.1 472.2 555.6 1111.1 1511.1 1111.1 1511.1 1111.1 1511.1 1055.6 944.4 472.2 833.3 833.3 833.3 833.3 833.3 1444.4 1277.8 555.6 1111.1 1111.1 1111.1 1111.1 1111.1 944.4 1277.8 555.6 1000 1444.4 555.6 1000 1444.4 472.2 472.2 527.8 527.8 527.8 527.8 666.7 666.7 1000 1000]
+-endobj
+-736 0 obj
+-[826.4 295.1 826.4 531.3 826.4 531.3 826.4 826.4 826.4 826.4 826.4 826.4 826.4 1062.5 531.3 531.3 826.4 826.4 826.4 826.4 826.4 826.4 826.4 826.4 826.4 826.4 826.4 826.4 1062.5 1062.5 826.4 826.4 1062.5 1062.5 531.3 531.3 1062.5 1062.5 1062.5 826.4 1062.5 1062.5 649.3 649.3 1062.5 1062.5 1062.5 826.4 288.2]
+-endobj
+-737 0 obj
+-[894.4 575 894.4]
+-endobj
+-738 0 obj
+-[777.8 277.8 777.8 500 777.8 500 777.8 777.8 777.8 777.8 777.8 777.8 777.8 1000 500 500 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 1000 1000 777.8 777.8 1000 1000 500 500 1000 1000 1000 777.8 1000 1000 611.1 611.1 1000 1000 1000 777.8 275 1000 666.7 666.7 888.9 888.9 0 0 555.6 555.6 666.7 500 722.2 722.2 777.8 777.8 611.1 798.5 656.8 526.5 771.4 527.8 718.7 594.9 844.5 544.5 677.8 762 689.7 1200.9 820.5 796.1 695.6 816.7 847.5 605.6 544.6 625.8 612.8 987.8 713.3 668.3 724.7 666.7 666.7 666.7 666.7 666.7 611.1 611.1 444.4 444.4 444.4 444.4 500 500 388.9 388.9 277.8 500 500 611.1 500 277.8 833.3 750 833.3]
+-endobj
+-739 0 obj
+-[894.4 319.4 894.4 575 894.4 575 894.4 894.4 894.4 894.4 894.4 894.4 894.4 1150 575 575 894.4 894.4 894.4 894.4 894.4 894.4 894.4 894.4 894.4 894.4 894.4 894.4 1150 1150 894.4 894.4 1150 1150]
+-endobj
+-740 0 obj
+-[583.3 536.1 536.1 813.9 813.9 238.9 266.7 500 500 500 500 500 666.7 444.4 480.6 722.2 777.8 500 861.1 972.2 777.8 238.9 319.4 500 833.3 500 833.3 758.3 277.8 388.9 388.9 500 777.8 277.8 333.3 277.8 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 319.4 777.8 472.2 472.2 666.7 666.7 666.7 638.9 722.2 597.2 569.4 666.7 708.3 277.8 472.2 694.4 541.7 875 708.3 736.1 638.9 736.1 645.8 555.6 680.6 687.5 666.7 944.4 666.7 666.7 611.1 288.9 500 288.9 500 277.8 277.8 480.6 516.7 444.4 516.7 444.4 305.6 500 516.7 238.9 266.7 488.9 238.9 794.4 516.7 500 516.7 516.7 341.7 383.3 361.1 516.7 461.1 683.3 461.1 461.1 434.7]
+-endobj
+-741 0 obj
+-[613.3 562.2 587.8 881.7 894.4 306.7 332.2 511.1 511.1 511.1 511.1 511.1 831.3 460 536.7 715.6 715.6 511.1 882.8 985 766.7 255.6 306.7 514.4 817.8 769.1 817.8 766.7 306.7 408.9 408.9 511.1 766.7 306.7 357.8 306.7 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 306.7 306.7 306.7 766.7 511.1 511.1 766.7 743.3 703.9 715.6 755 678.3 652.8 773.6 743.3 385.6 525 768.9 627.2 896.7 743.3 766.7 678.3 766.7 729.4 562.2 715.6 743.3 743.3 998.9 743.3 743.3 613.3 306.7 514.4 306.7 511.1 306.7 306.7 511.1 460 460 511.1 460 306.7 460 511.1 306.7 306.7 460 255.6 817.8 562.2 511.1 511.1 460 421.7 408.9 332.2 536.7 460 664.4 463.9 485.6]
+-endobj
+-742 0 obj
+-[437.5 496.5 469.4 353.9 576.2 583.3 602.5 494 437.5 570 517 571.4 437.2 540.3 595.8 625.7 651.4 622.5 466.3 591.4 828.1 517 362.8 654.2 1000 1000 1000 1000 277.8 277.8 500 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 777.8 500 777.8 500 530.9 750 758.5 714.7 827.9 738.2 643.1 786.2 831.3 439.6 554.5 849.3 680.6 970.1 803.5 762.8 642 790.6 759.3 613.2 584.4 682.8 583.3 944.4 828.5 580.6 682.6 388.9 388.9 388.9 1000 1000 416.7 528.6 429.2 432.8 520.5 465.6 489.6 477 576.2 344.5 411.8 520.6 298.4 878 600.2 484.7 503.1 446.4 451.2 468.7 361.1 572.5 484.7 715.9 571.5 490.3 465]
+-endobj
+-743 0 obj
+-[525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525]
+-endobj
+-744 0 obj
+-[583.3 555.6 555.6 833.3 833.3 277.8 305.6 500 500 500 500 500 808.6 444.4 500 722.2 777.8 500 902.8 1013.9 777.8 277.8 277.8 500 833.3 500 833.3 777.8 277.8 388.9 388.9 500 777.8 277.8 333.3 277.8 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8 472.2 472.2 777.8 750 708.3 722.2 763.9 680.6 652.8 784.7 750 361.1 513.9 777.8 625 916.7 750 777.8 680.6 777.8 736.1 555.6 722.2 750 750 1027.8 750 750 611.1 277.8 500 277.8 500 277.8 277.8 500 555.6 444.4 555.6 444.4 305.6 500 555.6 277.8 305.6 527.8 277.8 833.3 555.6 500 555.6 527.8 391.7 394.4 388.9 555.6 527.8 722.2 527.8 527.8 444.4]
+-endobj
+-745 0 obj
+-[571 571 856.5 856.5 285.5 314 513.9 513.9 513.9 513.9 513.9 770.7 456.8 513.9 742.3 799.4 513.9 927.8 1042 799.4 285.5 285.5 513.9 856.5 513.9 856.5 799.4 285.5 399.7 399.7 513.9 799.4 285.5 342.6 285.5 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 285.5 285.5 285.5 799.4 485.3 485.3 799.4 770.7 727.9 742.3 785 699.4 670.8 806.5 770.7 371 528.1 799.2 642.3 942 770.7 799.4 699.4 799.4 756.5 571 742.3 770.7 770.7 1056.2 770.7 770.7 628.1 285.5 513.9 285.5 513.9 285.5 285.5 513.9 571 456.8 571 457.2 314 513.9 571 285.5 314 542.4 285.5 856.5 571 513.9 571 542.4 402 405.4 399.7 571 542.4 742.3 542.4 542.4 456.8 513.9 1027.8 513.9 513.9 513.9]
+-endobj
+-746 0 obj
+-[611.1 611.1 611.1]
+-endobj
+-747 0 obj
+-[670.8 638.9 638.9 958.3 958.3 319.4 351.4 575 575 575 575 575 869.4 511.1 597.2 830.6 894.4 575 1041.7 1169.4 894.4 319.4 350 602.8 958.3 575 958.3 894.4 319.4 447.2 447.2 575 894.4 319.4 383.3 319.4 575 575 575 575 575 575 575 575 575 575 575 319.4 319.4 350 894.4 543.1 543.1 894.4 869.4 818.1 830.6 881.9 755.6 723.6 904.2 900 436.1 594.4 901.4 691.7 1091.7 900 863.9 786.1 863.9 862.5 638.9 800 884.7 869.4 1188.9 869.4 869.4 702.8 319.4 602.8 319.4 575 319.4 319.4 559 638.9 511.1 638.9 527.1 351.4 575 638.9 319.4 351.4 606.9 319.4 958.3 638.9 575 638.9 606.9 473.6 453.6 447.2 638.9 606.9 830.6 606.9 606.9 511.1 575]
+-endobj
+-748 0 obj
+-[583.3 555.6 555.6 833.3 833.3 277.8 305.6 500 500 500 500 500 750 444.4 500 722.2 777.8 500 902.8 1013.9 777.8 277.8 277.8 500 833.3 500 833.3 777.8 277.8 388.9 388.9 500 777.8 277.8 333.3 277.8 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8 472.2 472.2 777.8 750 708.3 722.2 763.9 680.6 652.8 784.7 750 361.1 513.9 777.8 625 916.7 750 777.8 680.6 777.8 736.1 555.6 722.2 750 750 1027.8 750 750 611.1 277.8 500 277.8 500 277.8 277.8 500 555.6 444.4 555.6 444.4 305.6 500 555.6 277.8 305.6 527.8 277.8 833.3 555.6 500 555.6 527.8 391.7 394.4 388.9 555.6 527.8 722.2 527.8 527.8 444.4 500 1000 500 500]
+-endobj
+-749 0 obj
+-[571.2 544 544 816 816 272 299.2 489.6 489.6 489.6 489.6 489.6 734 435.2 489.6 707.2 761.6 489.6 883.8 992.6 761.6 272 272 489.6 816 489.6 816 761.6 272 380.8 380.8 489.6 761.6 272 326.4 272 489.6 489.6 489.6 489.6 489.6 489.6 489.6 489.6 489.6 489.6 489.6 272 272 272 761.6 462.4 462.4 761.6 734 693.4 707.2 747.8 666.2 639 768.3 734 353.2 503 761.2 611.8 897.2 734 761.6 666.2 761.6 720.6 544 707.2 734 734 1006 734 734 598.4 272 489.6 272 489.6 272 272 489.6 544 435.2 544 435.2 299.2 489.6 544 272 299.2 516.8 272 816 544 489.6 544 516.8 380.8 386.2 380.8 544]
+-endobj
+-750 0 obj
+-[413.2 413.2 531.3 826.4 295.1 354.2 295.1 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 295.1 295.1 295.1 826.4]
+-endobj
+-751 0 obj
+-[656.2 625 625 937.5 937.5 312.5 343.7 562.5 562.5 562.5 562.5 562.5 849.5 500 574.1 812.5 875 562.5 1018.5 1143.5 875 312.5 342.6 581 937.5 562.5 937.5 875 312.5 437.5 437.5 562.5 875 312.5 375 312.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 312.5 312.5 342.6 875 531.2 531.2 875 849.5 799.8 812.5 862.3 738.4 707.2 884.3 879.6 419 581 880.8 675.9 1067.1 879.6 844.9 768.5 844.9 839.1 625 782.4 864.6 849.5 1162 849.5 849.5 687.5 312.5 581 312.5 562.5 312.5 312.5 546.9 625 500 625 513.3 343.7 562.5 625 312.5 343.7 593.7 312.5 937.5 625 562.5 625 593.7 459.5 443.8 437.5 625 593.7 812.5 593.7 593.7 500]
+-endobj
+-752 0 obj <<
+-/Length1 1476
+-/Length2 7777
+-/Length3 0
+-/Length 8775      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚwT]Û.Ý)
+ÂÐ
+-CÒÝ!
+-
+0ÀÌÀ0tH7Òt"
+-ÒÝÝH+ 
+úã[ßÿ~ç¬uÎzÖçÙ÷}Ýµ÷uíµI×OÎ
+n
+VÃ|ü@)¼©  
+-óBxll¤+ø
+1áÃ¤þD!ïm ä=R
+¨{º
+bRâR@ @üGHA^{?@
+{à±)ÀÝ|G'ä}¡¿?v\ AIIqÞ?ÂrP0b´@H'0ô¾¢
+È` ·¾ÿJÁ)íDºI	x{{ó 
+üp£
+/Àtè=À/°=à÷Ð mü÷lüxl C'Ç
+¸Ò î
+-®;0Ìã>ÆfF îË
+Ô4:n`Ø`Í?¼¿v È/øOº¿¢'ÀþÙÙÁ¡n /æp¸:ÊüH$/ ³ÿ
+-¹zÀïãA^ +Èö
+ðGï ²
+ t?â_zØ! nH~ëï!~§¹ßg%½
+
+-Ã
+x¿ûS Àv÷ï+ð÷ùºÀàÞ0ÿ½ÃïAì=Ý`wO°â_ {Þl`$@()&&* »À>vN¿Kúºÿp
+-þ6ßOèïw8Ü8ï_xþ
+ /0 ðúÿoÇ¿Wx {
+`
+vÀðþýÞ
+vøs}OÄ`¼g   øûùçËòdöp«ïà²º¢¶¦>Ïß3ÿãû üùÄ |"À{Þ
+-
+$DÿNôÏü=þV]ä¯öþWF5
+ ùç÷Û÷÷$^ó/épþ]A~Ïi0ó?° íîÿ¿
+ðGÈÿÿ¿³ü¿%ðß-){ººþàü
+ñ @P«ï_{R{"ï¢¿	ì¿¡OÁÊZ
+îjÿß>5$è^&r0Ç{ªó	ð
+Eÿt@<!>`{]ÒÎéO6ý}÷%\!0°.Üòûò¹ÿËw/?;û
+ÆãþÌþpïÕõïÂJ0;¸ýo
+-@Èï÷+Q¿à½^íÁ>
+ À#ïC ÷#
+à¼ß'+,
+¸{ÿy^÷¾?ÌB Çß
+õ¼þÇ.p½ïç_F @ 
+-yzüaøWwvÄ½ÿàÑ}ë¯ÿ¸1À`°
+ÞÂ,ÜîQ¸sMxËå{9:o¾­ÑÇSl[O3¹øü­×DØé\ïrB×çré$ËJgOïü÷ë°£Rõon­õ'¶ñæÇ){Ç
+-÷åj{
+âÒó>ùpç
+`
+âÞÚ®Îçî)A¤OvéÝ­âSÛS¾4
+9»¥÷õþmù$_Q¼EHÉ4ÛÛW3ÔÌXH¾8Ü|§ÏÎ§
+¼
+ûÅ¨Ìx \äo¶.ôüjÆo¥ÒPÈ£Æú!úe=óGîr=í½àWrM}#SxÒ/*¾ËJì/Çï®Ø£êºûÎÌÂüR[¸é~dÖåÛÑ×­.léªÙË|È­uö9ÕÃ\"û6ÖÿyðÖZ"©ôº*æ§ÜeU(û²ì­ :¸7eaÅ
+LCîyz½FÅ¹ÏµqA¦ía¥ïÄ"
+¼©6¸Ü#²à±¥y.
+þù$êÄ±aÂ#´¸Õ}?ØÞÑ«^_´"
+-_¡¼ýÙL"wl¨ ö5àÇtÂ*
+éàÀ>¼lsNnSDt6Ä2³æ5iÏIgù5äÔpÜ
+sÅóys+þü'égIÉþC. 
+õEu©¨qEEòog¤SÐO×tvÝ4s¬©Ûûfñ?3´
+
+
+Lí¿Dí¦H"hdmËtèÀXôÒìÐÛt{?¿óroN²Å]òó×Â¯_~BRèçl`b ÔÈ
+øRGú¹S×½t)5ézzdd ïó¦üÚãñË°ðP
+-'¡ÈEêK°	tFÙ`W2¥4¾&¡½RÚ2A[Å­X¡7sGåñRÓÔb®¦§^
+-è£öd¾±IqÏ`0UÁ½QÂàÉû³`7CìYlmâ¡Åoy§ýv	KÖxsÙï
+-"øÂU·e¶ºcó"´sBw7
+E4ÊËíL'l-÷ç&+èÄ¢÷ÎzªHL
+Yt[!g,Ýqr0iãZÁõµwrïÞoµì3p;´,¦âø²*©³OÈÖ
+?ØÒHºD*Ð×k¦&4öryQºv
+QT<ÂþyôêÁ+ÇÜíÜ·Qk
+%
+H
+ª¥J
+-
+´9FJfRYÚs§¦B
+hÄÌÐÔF¹òø8E	ò>ONùèuûº\ÃfÖ¯ôÈ±]ÓÊòçªö_
+[ïndTCñ°Ð%¥Tf¡rc6áfÏùEC<EI5ñª6,¶G^¦
+T6ÝbNJáïF3W
+7G2·Mã&É
+ø4ÙÆáï5Ò 5^Hl
+©âç
+$zs-=P&{¢aêÆ=MlÝÈTµ!MM
+Ã:UþÉ_é
+£;Qac±²Ó÷y%+
+Èú%(ÄqïsÉÕ³
+[jµz¾l¤Kå[/tÙO)¯Ö£«²ymz³Â<
+-4$ÝRW`çIïo+np°G
+-QCÍõÓV'~Ì6ßÎ¤¹WYc²Î6W~4nùõRÊµ­F+ÂlÀ"³H¦/}E
+·&áýúªÜ>¿üFËñÑ-À×+³\»DÓU>gàè|sÿmÉ¦%ËÒ14åeóÁ{ôäwjEø&âC5oñs9¬dpçs{Ü^øÌÆrNÅñ7¡6Í{·Þìû
+îéÛ!ûAq=QÙ§ÞÞo¦pÒ¦¼+~)IÎòQöm'M*qìgudwÅÎ;r
+xWl­ëÌñ¯â)u7
++í1¼6úY ®RBl?¬Â®Lñ5GûÆ±Î»UuÈRÜN_W¢ñ®¬¶¯î7C%úõ¦Â@¼ý\ÅåÃÈA	=ô×ÃS)õÒf<ö¬P¿½©\}ÅÁ<Ú/3
+\ªËªë[wÒÜhO©çj<øO¤óf
+Ný¨ÒL¹?×õ4
+l+ðfùæ°g§D¢£%ÖëÎ¾	èä£	_Nßfhx¢zû¹6Â:î0þPÁÚæÌ2³ÑT¨ç Zß0NÑÈ@É¸
+å(5KîòhD#;u­²¶IªBäR74²G¬ùÇæÓÄ]ÄZîBx6}ª &Ú}ÐC¿I«µÞ$xêªoLH.Í:·ÙÞn|µÆÞúÂÂ!ê 
+±¹T)yâ
+Õ5²lðcùÙÝI
+¸LùâúÜ]¶³ä
+Pþszø¯._©3¼ÊMå°w£ÎBa
+
+-©ã[¹m¬ãiºÎãì<¤{C=´WÓ¯·ÐÆ}?ö?Oz³ Æ+=Àöø×èþW®¯"?$£×ó¨Zz¡Ê.ÍÝ1dCûHk ÛRo,)1ê É`(mÎ÷ÅÄ
+
+Hë·ÁÁR"¹\%CªÖ\z»dA®F
+ß­îLCre²Û8òC
+¨iÒxïD¦"Ö¿cºÌKçÊ)MU,n¾|í ¢k_4P(¥>Ænã5B·:8T¹ñ{ÿÇ¶ôädùO6;ÏÒÝ
+-=­S
+ûlµÐ
+-ç3¹Jrl(Ñ¤J%rN©8Î¦Åª°Ç
+oPù:<ZZÁJÜæ_Þe£;là«ets!¥-
+-ñÉjýH)1ûáXDxK5@a1rÛ
+ëLbìfý8y:5väýUÐê"
+× L_MÁûqu^ëb¢«ìè¨`jöú²ÍÅ,Ù²x6
+-±S§]×o
+-YÈhª¼*åXÅRPäå]ÌËþÐC"¢ÄYÝ/¹Þµ]ßÍoYIÐPU
+c
+®uØÊêéMkVeÀjÊlîbÒQrcÔÜåmjÅD?y[âãâ)-Û|¢Ò~:uKÚËdõÞbYCÔJº"¢¢åªÀáýsÎì±ûønZ{¬QiéÎ<[¦¨4øx0Pº3B«´IÎ®HýÐ<m¥B¦8ÄJÔ¹¨#~°üi¹0SÅ$êXµr³&3Ñ¢Á[9e¸{NLéÇ¤!A·óÙ(p.ºe²àøx"­
+-"Ëï
+Ê1«.¹a´Á¶Þ+çù¶T²NÓ
+-vs(ÛË_»ÒKëLSj³âz>2_í6ÊaGéí}®Ie´ýðÀOð(ðTÄ²/ñy}Ôô
+±®ÎòÂõ¤§^õ¨æÔJ
+IÄMK
+))ÁB%²[¶2uàîjrCyKó=±UÚ:¨J¢V[ïÍÜ\7°NST:ÔmÆÇÉ|R?éO<<TNV@4i6±*äÚ|û¥ÞOÕæëàA·a6LQeì¨Þ%ÚïEbºårGÚ5¢¨±8]Ú
+-p¾¦eh»ìZ¸3ÐRHGvÇ)­
+Á_cná|ó
+:µ%ÃZµáÅä_ë{ýnu2ÏNâÂÛ»ÜI­
+àvÍÿl¢:VîòÜÔÂ*¤­`ûéM
+)²0U9	6ÉÂþEÆE36¨0ÉÛ(¤w	ò/K
+yOÉZ%
+¯ÆQ
+-Ý¬e[]»iïzÙÃ(ß¸~[àúÓ`ÐD$íE"1ÿÓÒ¹,B¢ %ÅR
+y0´þxm>+cUÖÙ{­uzÑýÜ~Ø¶
+ûZ-Ù¬Aq¢±(Á|øba­F-Æ 'd_7cMæ~au©îrù$
+¸xl/0xj6Q®qærýâÂÿÈ3Î ¬Ejffõî\ä<ÄæàÁZF¯¹Gùç!.E Û$y¨år'MeÙYñX$'
+-ÀÃizÉÎüÐi@
+Þ[|ÁNùxlPµ2ß£4äqU¬4Y8Íq©ònf_ên¡²×èø)
+¾êPÁiämcrLLïÜKïoÌ¢m÷ýW½ÁiB±Oµ¹¨ß
+-§,nìe4×h¾à<dCÅ|é
+~û9zº	+þN@å'ëò¢>ºp^óÇ¼#éy3HÌço¹ÍÛÙõÈ	
+ÌPÖBÏÉuåýøÒ^>	#¾·6;Tî_ðA'Õ½º®äWîã>b©9NA'u
+EïPÚ-yqT9¼Ñ>Þ¦`Ú·|V7ÄgöZÇ_à<A`¥Æ$c`q?»hÞóÁxH5ô¦/åVZá6Õé-«»ýÜÀEP´»ý¿VCAÍ_¾©õ®po3{ñÀ§;¬Â}ÄrË!]tâÅûÔ6|yk®;¾M>[0*õJe8°+=Ð£ó«uÎBTz
+ÈL¡µi0ìÀ~Råèägú6øeàW
+-lÄE[±«WÀüpîceµYâ·ýÙ%yÌaSÎ//I×"¬
+ÎÕ¨èJ°?à43=ò§¥cäL¾¦
+I«-"9ÜÔËÖUæ¢YÅ¡¦|®ð9¯ 
+XÁN·¯4®:N_u¶h,6ù¾¯KUáÌb/Ê~Ò{ÕsÔ?Ñ+e²uc'É7â´Ì<É¨ÀÙ¢ð¾W<§ICN ù
+ìbMçNsÄçå4±åNývu±¬ñFLGÌø
+"¯«sÎx°kÉATAÈ¤øì
+çÉ;©}ãâx3Ûmç+eOÐC­Ëû´96D³¹Ðx×	Û
+ WA rÍÃzsýþ­Ù
+¨à«$Cnÿ­`½:z1ã	¹VÉaÁÙÁhW.aALïP
+}Gz
+-·
+-%v¼½ü
+ò3LXèÃl¹¾cÊ .;¡®r7ò¶vqÏåÆÃn9AswøËÈ"3qtúM«ït]kóô(E´/>;gC^pY! :=À%¯¾YOûxü
+A%­ð%@qÞTmpþÇ8aÅ·b¥Åúüý_Ð·ñçýü0ï¦Øl5À)®M^ÔZ<ñhÐ['¶F?±¾Ì°
+-¡ÂèN~0Áªß À&w"eÑhÒ2X
+±´¯hvuº³Pí57i{¼:A
+ýùÛË
+sóÕ
+-_·Wea»N3+ëFégMZI6£} uÜð¡ ÊÌ×·x´.ó¹I±Ö'Â32HWA'õö]ùÌçñj@Üe&
+KùFEPÙhw u/­ùöBåGø'ô_òß2N/ùäS¼Vv\0ðDCC5³äj3_îFÕ)
+-Þ¼úeT
+ÖûºÀwûíS'¼A!
+Ã§b«¡Üm
+µVtöÃKj<æ?-¤;$Ëº
+ázíÊ¶¦iwU¢Õ¯Î
+>cT×Ë«RÕc
+
+ÑºøÂwDZÁ#ÿKOõY¬7°Êw ñÚ-ÑÍX
+O]v¾`'
+N!ÀÛÐiØìÇÎ8Ê	ÔFOÉ:L©1ðxhÞÁ¥Y«}PÔYðKêI/×±Zö
+
+¤º)$rBfé´ZOG·sç6RåZ}8x wrìj¼ 
+
+TH8
+-Iì¨¯sÚ'ç²ÍàMí=Ê¢ø¹K
+©c^6;?Éô`&0N×h¥Ó:Ùjñ¦û óSÁÜ»)hÙ}2 Ðló¸<è?"°¦e'>wvò
+ìú±õÜå$Üç6ºÀÕu1iâÖ±DHñåýàÊiQöL¨!Ï¨ü´®ÜÊ·£B&"ñNé»Wû;øÁÑ¾À´þ¾¥jûRâúý¼IoYï£
+×\ ®¸WðÆ®+Eàª§öMñk:
+ñQ
+-êö,íö#1"©Ñê/ï^wÌ£,âÑ,9
+ 
+-ã­7±rÆ÷üÎÀYMµ|çW\S¦a?f-IChK8wa'.ß/3ÌÙD,O"È~|ÌìÒ¹e:ozñßâ×·n&¦²6)ghMPSÈÃä50;te1wwNuè¹_s¹½¥Þ«t\K»9¨1©9(ê×ö¢ê:sëÄ6æ=5.ôVÓEOùxØÊ-
+ü2>µjøQóS¹|ù2íqFéÛ%¹ûl?.«mó4j
+LfþB×WÀ`&
+e&Tbçª²!Úõo©i´[^I¿WÕ,þÅàGæÞÍvX«çQ£R`ÁãÂ¨ÆªV£©³1ÕZÛ
+-±ÉìÃ!óoÇß;^Ü4÷/!qX
+
+-G'Ð¼
+-oÜÐ­<ûöÂMEOu7gsPç6ÈÅùÕÜÄ]W $&'¬¥zHXâë§ðÓÖªA­ÕºÑÙ
+@(<T¸åtNG-%#X³d°n¿H
+-ÒYEÙ2!+{HÞNd»÷!n³tfªíe1=£¸ªTPÕm:ð¸Íîgª"Ã»h¿ynàokïÙíõ~ªW.
+b-±·[ÔµÓ"ËóùSyÃñ`kÅ+äþe«_^p¡®¦uK¸Ï«qÒ×õoQØô|u·¬hÏUMÌ Á¢ÖAÝ´YvéÝ>É£ø
+]k®0h7âÎù®âõ¬Q½åÃÖë­Õ­´NUrüòÒØ·sE©Lm~­þÇÁRÅÇ%1üº
+De=Ìhi¸òÓ¨xXÝo½+JBÞY·ÇÜ2¼÷Æü
+wÒþ*9DÞVx±::1­éîxÚ[,Iù½=óHzãhpö+Ùv6w1!eË<&ô!Ë2)g<m
+-Õb<Æ]z¡d¬5¶$¡î²ìuî¹×<¸µ}ëKÄüõ§ò§#.Ù
+ÄH*%Êä<¸
+:SX¤éo&d®Þ<\}ÑëegAt§9S½+&Fk82ip³/DØ@`¹ÿL«Çôîå\ô^>½
+RÝMT­L¥ò9LµxÍÓ\ÒÀüÝdÆâ>^Ä¸Í­
+:íTThrr½
+-öìuô«á	Qq?waãòÝþ;ÀõEËìHÜu&B¼ãÖ'ê'éVÓ¹Ä®èòP8ÁÉ}QZLÂbJ¹<ØâÔEêPI¿»vqã¶É§ý!wº±¤xÐõ\]Î­¶äÜÈ¾
+£túÕlßéLµÁ%
+-ëªmõÙCôCQS.çRî÷Pæöï*£û¤ZE
+TY£®û
+-æ?h]A½n<hJ§>23
+A p®m@<JhOèHDøÃKûÖÒnoâ¢¥³$qm²!ùT\s¡£zè!©yþ !Gßz"ù&H³7êGmÜZäzií¶.¯Ôrîié ÌàÇ\
+ìØd¸«øuËUHÎ
+òVÝéÜ
+ûº´ÚöeRÐëRã¯K(,d)mÑò´\nfÝÔä«
+-
+{±½q"â
+-¥FP¦Tã¹°ÀÄ,¡®çCKV¶¦èq¿¾Xè6À³31n?:ó>äì	â`ÔÔCoR¡I¤
+¨G2`MZ1+Å%ô9ðËt g'N
+ÕLzñS®/?qG©óúÁ´ÖÚ?_Ãn=?ÎxW¼}û*<ïlnºÖRµRô|Î	ÖÞgÛ|-ÇÊN[ByòëCÜEº¬
+
+â|7a¢·)­¸Î°Duª%ödP¾^ð]-cÀÓTº¸ôûËèÖ¼õ=¾$hÐà»9oÕÂ÷*^Þú¢³A
+-ù®"=§ øeoÍJ{éXLEz
+wë`"4ÜfÖ¨Ë@ö8 ¯Ôÿ¸áûÄàpr~°åq;_²o°óqøs¦lÝ¶wµ BÇ<Å8<T£p|
+:wzlõ
+Ì7¨jJG*K·
+7tÖ&f·¾ÖwµÖ48p%Á®Ý»_)ßZ;Qó~%½IãS,EzÆI®ãSoÙ
+Ý¿¿{^erë#æ~Y×·°«3F­XÂî ãâ").ÿ"!_þÆ¹þi
+-ïä´Þ{bµ"ì4çH|¶<âF`¹_ór©-E°t~Ùx
+e² >Aµà©^ìF`¶õîàÔôøk
+-ì
+-Ó
+w2º(ãó×q¶NyÕÑ¿0×û¡º>¬ï.x­¡pLù~ã<\o[bË~~=¬#øK«SÏ#]zé
+cun<ã`OÀ@E
+:
+Èï'DeÀÞ¥TU?÷qc<ÍÈúÜÌ;µ6J%º
+ðwt	C*/N6o³àE®Â½æIAúPW	#wûÏÝS
+Ôcÿæ&"f
+¨UÔÍ3ìîduÐ°*	Yu­2_'^QuuöÏ&ýò÷­Íë9¸ËúÛÜ½c/E'öîTÓQ°¹Ýè¢5Jøxý¹$ ¬ 
+\S¢ØdëÊV´UTÛøUæã¬ª²fÑÏ±
+kíºÖo FóKá74ÅÙ
+Ð8~
+3Êºfsà'ú^~Õ§ÛÚ{+ë?ñ-#
+âr
+löCÔ ë´E²{iJ7
+Ñ¹3§³c,*}tÒ
+vAÏÃ¾iò§
+6Ç6¤Y*{çÐE
+-1iìc¹}]"w7¯,ËÞI)ZçíÚ»F9Ð~½Rd
+/ÓÀwÄ+'x3x+ª«àÁp÷|]Ùióâ
+-³dÒo5_¾>
+ý2Eøëå<´?ôÎdûg¸Ëöà
+-?âÙÓuÝH§ÈÓÇå¤
+1
+-~ÒÎç9ïký:¼Ibr^°ÒEt)K=Ìa½²ÿÀxÒÍ¯÷=ÃG{ 
+-¦áå».ßußNWC
+-e¯¯O,¯i
+s
+r£An­Þ%à4Úö+
+4%/Ê¼3M#¨0Îa=°É-+¢¨´t±3#Gëì^F¥Ã :ì8èm=u#×'%Yý4\)¢Z)èy~>HÌ,RÂ)úÞ~§ûx éeKjÆ	ÇÛ
+Ãs´i7ç?òt¨UQ<
+)ë©_d´¬D¤úKû5#ÒÝ%TY¡t<[ä|ûù!ð]é@ìTÝ¦ùý6Æ²W)ê¸5xdñj$¯:EôÐÜÄV¯v|Ð1+÷*Þ°º1í}}|W,Z
+=¸åË;¤1UbÅÄöwdm¡ãVyøÑ!ÚqóVÞÅCÿH`Ó÷½ÒÎct;#ãY
+-¡H«I	­s{MNýÁÎ¿úbõ"dKolGY`V1¦.Æt$½ß·RW¿vÂðqü·ü/ßñ:>ãjkûïªÑ~/èà;gæ2{ÉWzþâIäþXñèE&2êêøaöGT«;	ÍÈäÜêÐSV)nE©gêUnóöè³J÷oþ;­)
+¥¢ªMÌ	åÉR©Î,+Gd¶6åòß?9(üJÙNøÔgrÇÉ¨yùÆþäH¶u¦ÒaUI¸ýþ×®jìk
+iÊlV£âKsêâ¢kæ÷³Xe$ÅØ&'ÍÊ5üR>ê<Prî^¿ô-Â,G	ÁTË ü êÀ±æUÈ³~ù§Iß(@Ç6
+ÒÏ¸4§äã¢
+Xkß¾T2z	ÌXIÉæÈ\P>FóÔÁ3½@~SKôÇWbLnqQë¾]Cÿt3AJs¡i2	bÖ£¸8
+äV$ßPebgUáÕÁYòÇDé³øæÖÃÏÈ¶¾»zEði{
+-j8Ç7£Ô|0ÿ¾}#IíÉå"Á;}Ôz_ÁE«bQ­t
+-Ãåh%xøõæQH]jdÉ%×.ß!/þ¡#	ªÕïO|òHoÔDö½ó@ëoùJ_GEü+J)hÛYBMÞGi®%+.
+-½xt OwÁòê¬zvá-X;d~iÄÁï}6ð"Å|àðE\¶Ì £MoþDõvDôKÿ·Áºì×`û©ì'Ç/³hzÙUGGXnGÝÛ¸ÿ^É{
+-endstream
+-endobj
+-753 0 obj <<
+-/Type /FontDescriptor
+-/FontName /JDNQLR+CMBSY10
+-/Flags 4
+-/FontBBox [-26 -940 1332 825]
+-/Ascent 750
+-/CapHeight 686
+-/Descent -194
+-/ItalicAngle -14
+-/StemV 61
+-/XHeight 444
+-/CharSet (/arrowright/greatermuch/lessmuch/minus)
+-/FontFile 752 0 R
+->> endobj
+-754 0 obj <<
+-/Length1 2341
+-/Length2 18700
+-/Length3 0
+-/Length 20050     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ¶tk6ÛhÔ$Û¶mÛØ6Û¶4N4il§QcÛvr²÷îï?ÿZç¬Ykæ½n]Ï­ç
+2"E:!S{c ¸½
+
+=#7@DNXÀÈÈBÏÈÈ
+GF¦jébü
+L
+èälioÇý
+' ËLÔÈåÃPÎÞ íj`b0±s3qp32¹þchïÄ
+-5r³4ÈÑ¤ííÎpd"öNæ.<ÿyPP¸¸8hÿvÙ,Mì rF.@ÛF#½%ÐÅóBPòZ¸¸8p30¸»»ÓÙ:ÓÛ;óSÑÜ-], Ê@g ÐðWÊ y#[à¿S£#¨ZX:ÿK¡boæânä|l,MvÎ.®v¦@'À;@EJ à ´û±ì¿
+hÿ.é¿áþíýW K»¿LLìm
+ì<-íÌf6@¸,½
+-ÀÈÎô/C#gû#7#K#ã¿nR}døïüM,
+\é-mþÊá¯0e³3±·µÚ¹8Ãýu>QK' ÉGÝ=þÝ\k;{w;ïÿ 3K;S³¿Ò0uu`P³³ttJþÛæC÷Gft°122r°s  Ã_ªÀ¿L?rðõv°w }¤ôµ4~üÀy;¹.N®@_ï*þÁ11L-M\ Æ@sK;¸?Ñ?Ä@³áþ;Yz t?Æ	Àø×ç¿OzfjogãùÇüï3¨)ÊªÉÑü;åÿ*
+
+í= Þtlì :f6F ;+ããÁ÷ãü·ÿÉþo©¢å¿O÷Rvfö ®%ñQ½ÿ$âöïÉ ü÷ÚPþAÞþc Ê?ã¯ËÈÆhòñÅôÿ{	þvù¿Íþ_Qþ?Çÿÿ<¸«ÍßzÊü¿ôF¶6ÿ¶øgWÝ³ÿØ»ÿÓTø¯
+¶·1ý?uR.F"dgnóß2Z:[z M-]L,þ5DÿéÂGpK; ¢½³å_ñÿÐ}ìõÇ¥âüÑ«¿UÀú_J1;{Ó¿vù£ïFNNFp­ÿ@l o¦%5zü=Û z;{ÀGr¾ 3{'¸¿:ÊÎ`úKô/Ä`þ8 
+"'Aôâ0ýq0Äÿ f äÄ`úX
+ÒÐ»ÌôÁ.û}°ËýAìòÐ»Âç»âôÁ®ü}°«üAìªÐ»Ú×ÑôÁgü}ðü±~Dù¸ôlÿXÿÕ9Ó@& ð¿ð£1
+ÿÿ0
+ë£FÎ*ú£ëÇü	óÙøa`öøÒò	Ë_Ðí¬éí]þîÃÄüð#?ô¬Å°ðt°øx
+-ü±øYþ~Ôä§û(í?N÷Q?¾lÕ´ûàè?oÿîÃÙþÔÇuø£þæðñÆ²³ý)+Ó¿¥NÿSMÖú:|\%ö:Àúª«ó?âdûZ0}¤öGËöºý#w¶sçùÃÉÊÁÅÂ	ørØÅÝþpýü(Û?àGþîÿèå÷?È?Â{þ~ÔÆëOn¼Nÿ¢úËÀÄÕé£8._×Óõü÷[ô À-ÎÛð[Õ·?Ô
+-á¹ÓíNðÍíj¤SÑy/:ýt}BN¡ªÉþ²ît'2Ü²²-Fy+¸Døê}ÜÚ
+ö#I©íÙçÅ Ayz·
+-î÷Ô§Éâc¡~|ØÏtª{>¯>êÖà­ Òdù®H
+èî}
+
+-ýËc¡ó»J{5ì2ð/¿èbÔ¢uËfÉ
+-sæ°¡\èða¨Ñ.<goïfÐò&ß	¥hà|ObXJ¼µ7cç¼V«T»pHq´±ñÁoÑÆ¦É½
+R¥±¼¿F¯ó-ärDÄ
+--÷%ÎÉ¨ãû)b;ÓñeÈv¢vå¹d9Ù¨LÊÈ)`¼CÈ¾J%U
+5ÈùléÿøJ¯¨	jJó³ ëäL­Ú'1)fÂà}«#Çýå¡ÒhZB2Å
+ddI^áÓ¯q_1åaçÆboþ÷úÒ{:+p«0R[Ý5î>xN,ÅgcÅÆ¤óÓ×Îxa¦Z[Ì )®ðí)æ7¤ï
+Á´RÌXÂH§9CÒéës¶ÎÕÀ4¦L5O>O÷
+ Í¼ætV,+¡°£$càõf"é3
+ü
+-¦Æ?
+dîpårÛr7«áº&iëØfè3
+5Í¬ìùÏ³¦Á4ÙÜ°%Î}Úuåõ#'ÔÈ
+©r5â2GSév´ØT
+-ÈÈÿÔeåV=Mr®ç\ç¨Lü:U3Bò<ëÂoNy|
+ÔñW¼HpÏâ½.¬ÎäÁÛ¦÷;.P©u¦1±iÜsyÓrY,$ü	Ôu
+É½PråUOÁ=zä2j6X£ ?mæ Qo+yt³
+vi¡ûìãUÙ©]hÅ+_  CÈÀùC|3R.)´ÄÑ1/ÀO\[år:ìÎC=½nÃß	/.(¬±óÄ¢B@ôÖVÌLÝt5;nÍÉ­ÿ#ðÊF­º%XªðF@Ç½
+wkÌ\{ß°
+gº<¯c­ÁÙT(^Fñ©
+Úyï ñ×T ª)×¬°ÑFqÊ%Ø1£ÒTóz¦¶3dhÝhÆCXS#åI}TÊÌY,+TQ"[÷5æ66»Q§MR¨÷iU´SYèä$½)ïJÍ2Ã÷'Ö~zwôïU;Ë>ÌÂGæ+î×ÆÖ]âµ¹ððòUefV<±¦$ñ6Ä4ì'ø=æ`{qÞ·¨Ôkg§i8Óðè´*J;HÌ¥m
+ÏUä_í¾áèÖë)Eq m­¶ö°ÛàØ1s
+Úêµ_\Ò
+3,}-ÑÕ"eÇÕ¡	T$h+P8¡D¬§}Ù­ÙªÀÖ½¥Þ|ðb¡(+%Ja/
+-¾`N[ì$¤¡L¹É´0¬Ç]c¨K±¦DN³NGq¨Ar1¼Ó?î}
+-ÃÞ«Ó
+ô;ÒB7¸+Ml|ÃyF7!ëBö£Ä Zv[pFBöMärwßÚðÞÎgE«pHB
+Î} W¢ëuø²OA
+!G^ÏÑÚê¢½þ
+¡ëïïÃ"WÖÂFÜð
+º£¹ÿdé·6z"E46º¶MöÚÌ&9ád¤ãgç(èÝqÞp±cÏ½	xåº«àïæÁ"ñ|Ü°©T5,-ÀªsOo¯ß¾ÛÅ£³
+ö<ÑZ¬[Ë¦°¦Ô×4(
+-¿ß0x+í_ÊGX.³ý©IÑÊ®FØC3
+aEô»Ïy{Axï­5ÿeN{Ïâ	
+-ºGmô±q«k ^ièt]â6ã\½Õ9Ç«+åeWÈÑ¿
+-Q`¡p×Ä¦|à|ò;d³)xlÌWvÔ1þ.B]°½)Íü!óYðÖzZTóN·ç?ø×78$óòÛ
+Aûb¡Ûý)ú¾S¡:ÁýØúþ+¶!Obx¾¬¤\Û/Kd?
+-.J
+Q,J¤m%ÒwþãUÚW¶%PEô(ò¢ã16îQm×#âHÒD¢jù
+åÆòAcáÒr:H@Æpi8· eñïÝ÷Ðg¢3¡
+¹*I°øg4ÿ¼dM@U÷ñóãyù²­
+×SÆ]Øýnþ3f¹J"hÕi?b/Â¾<
+K¿ÜªçWið
+í¦öE³àÞ2¢°%ÿõÎÔqÉùÉ²[¸ºø®
+u}ú÷jÈ
+-lNB(°
+ósj¨Îüy)\%·2.V0¯¶÷Ö
+{Û@d
+'¾hÎÑº±Þàb.ô;ïù¸¥ùîíïÇ5ÊbCæ´¨Ö×bìe/cHÆmøÑ[:lUõZïöØÉóø(ý0 ºðàÖbZ,þ
+k´üe`§ë)üS+?'0¯E)i.Ñszý´
+;/äVFÀ³¾Ç¡û
+ærÁV½ÃÌGÛ;ÑóûÖWäy
+åÌÍ:~¶@©ôà
+§æ[j
+O¢mkõQ¡j0)øU!#Õ¤[UûãáÀûàXÊj
+-Sg5©¾s½§
+9ÈÌSé]­
+-e¤J	Ï äfVSJuù¸íÏ-ÞÄl
+u#zÖCÕêp çBç||N· õ
+}ÿ;ê][[Jà}Õç+>ÝZ¢Ç·ü^áï¹ÆS­Óóråµ?£¿¡ý.ÛB³sÝH¢t:/GÈ÷ÛYeºÎïYËæåñ7¥­Ña/Ù5Ë¡UìrøêsQmÝ®Ìù£éß>
+*ü{
+ ßÜ#ÿ«ð³`[­ÚAa°xXÇ­,Ù¬­ÚçìöôFa`@;5i-¡½Ç&
+ å¶çZ´C§P§;ú5$ÝLõ-*¦>G	Êªõ:ñ)¸!!Ê¼-Ð<mÝ~m
+_
+-£«Ý"¢¤¼m
+r6À|{Ðº×ÐYTXF
+ØlÜÈø©­38a +«á2Ê;ÂÀÓÐD¼§üùíjOu^Uõ]9FX¬®ÓB÷Ìt¢}rÉ:çö|Ä"ðXä
+nàyàaô¤´-@ÌÑq19øU~zd
+¹sZ4ïûg£.íâ®)ïoÃeYhÚDtNK6qÔçm _²°sw>/þø
+Yà !+jþ
+ÛÎX6üIöGc
+nò Ó¾~x
+¼²z4òþ7 æÆU¼]=ÙÉæd-ºÖ@ëË¼*Á2D8ë@KÔ6¯#±°.OÐ×H½¢"Hú[<3ìawOOIï£P5¿O¼6cForøé 
+¨gÎË
+­¿7
+-¦Ûû'æøÅ'¢úÒ"ÝÂ­óÞPqÁªsØ1ÉrMÀIýâáÓ"Gö Á`¿"Â(U2¯&a½
+qxWDg}KbìÃ£ÏF÷xÚä¦ ?XD¿-åDÃvZ¼W+â Å¡*ëD%6¬ì© 
+-«Ñ±ÐKcUª3ää|âÐþ&÷ÃU·çMR,zÖ£$jÁge8ËðIFãþ-]'Ø.$¡ÊÞ
+-mÞG7¨Y¶	¯øË`q©=£è=D~-äéTûâ»¨+µîD3ò4%mÓµÉ½·,*[>H¦ÌºÂEí¦O=ÁgÑTF0dX~úùÕË°s9.j«oI
+M\öËÁÜýpU~¢ÑÑÊnÙ5ø¶,°°áu±/¬XÏ.rSn¸¤2âÀ8±xÆÑ©&JmÏçä¹«ß®ªE¥u§«:ôLq>(æ!Æ
+ÎË¯Éþ=,è± Ï¨sZ/ú¿èNå)}Óñ}áçè¯4,+1ãñº	|®ÄõËÖg­5Ë£ó{ð¬!
+-Ãù
+g0äK
+LVÒÄ	Û
+~§ãBø«É|þJ}Ù/<hïHÀÓ>×6É°ûýHç+,Êü}K7^³*ÂÕ
+-LyxDr=?_;ÊåoÎï¤ñ¹y¦»Qä$ÓöÉ.®:3JãcÏbjD±ûGu	×âÑÝÅÞ¯ªjOØTj,ÄÀ¢+qÂ"6ð"yØâÁÍß|C9ó¶ØâÛo,\'fÖmÕ£Ýñ©tR~E²ß§îÔâxYYúmX
+_ç "@Öbé3õèâ¢sÿÉ÷Cï1ûóð]î)ïÓîÌ¬k(
+!]¦
+Æg¢~:T5Ðæ¬e,¯«ä 
+òA=dÈ)ø<ßÚ]öAÓ¸A£±
+0
+{|Ýå21Q@¼aK&«éËÓ¶­´·cy£÷¿Ü½yyÎÛÌR½¿×/ne
+-Ð'·ºVÕlíeÁ,2¥ùRälï{%mpãð¢ÖÝß.?ÂæÛ÷\ô¡çî
+HÈ"{¨.q\ñ-o½u9Fhø4>Újá\óí·éMÉöùßKyÖÑ;ãIw.õ'Àòùiµ²éñÅWA3óÈ@%z±~`XuÐ}R#P©ª`D>ÊÀ®LWù6nÞ¡»ÝÒó
+q¼:
+-AcÁIA4\Ö(ðÎê
+IÓ?6|S~n*26_ÀswL Ñ×Q[P<Ð¯M"Ô]PÞpþ
+è(ÖÊ
+Ö©,[ûå-@æ· ©Ï¢¨Æ·¨Eù(ý©jFÛÀÃ¾×f*ßðjéC9sâ_¤lO
+æ"ÎÌ"M
+´29yÈs¹0mTù{)á¬kOH+L$ =ö?*S[±0¥5MrïûE43a®¾ìèô³¾b³ãÏ$SYá+.aúõí=_côó+s¡¯§EÜÂìVvòòºo}å³H _~³¬Rôùl}÷ÉµHüí$ÔÙZóµ÷·L©UYÆµ¿_'oàv|w:Ë÷"«Ö]æ°/d) \
+ò¤^~ñú=Ý`ü¶²½²òÛ\÷Ç
+-Ý8¡'0  £*¨IBµ*Qzñyy®ö3Vå;æóØiÍÖÖ1Dwde/<í1W*ÇÍ
+-oÀú
+Ò-
+Å¶ÊÉzÖ¾"æªèH¢'ÌÌILÙ|ZÏn¼
+ï¬}ßÙTß¼YcöÏf
+é¾Ê*Q"íå9Q¼á_&Ý÷G»¼
+ØñØô9S­,ÂABÊ¥ãn{À9
+SHF	âiZLÔ6+ñUU7A)s©¿¿Éè.5v_½©DÑËôWäûp8¹ÏI¼âüÎzÊ%ÝP/èøýfcûÝYW*Ô#-úÇ
+-ÈxçI1q¸ 
+U\><¨<Ç4G!Äì&Gùî¼L£µöúãÈ86ª¡=3ú°² 9Ù',Ïn¬ð
+-M49õÅZ_òñGÂñÑ
+óÎr3rÚ!Ýßóç×¼º
+}'Ë
+ßØí'Ïz7%
+ÞÖò_æm/ðïêÚNäm(gsRÏgEçÚsõèÂ@ïw¯Í¨(NÜ^X#'+»Å¤Õý't¸:mKxÀÂOâÀb'ã'<
+ú¿ÎVäÒÇ2«¬84JH²~%BÍ@'/4
+þV ôß°ÜÁÒÙ*Óâl9ØÎâ«e¿¨A?4A&ET
+(?F+dwe»]8L%¼v¤e77p{Ý³/«i(ô¢j!bÑ¼pÿ"«t¿æ}ßî2L¦Ç»3Ð¥)ÊJï¦ aC
+F÷Y­ß^;ÜÔ9c¢ësÊ0¥?{R3$÷}]â¨:R ðZbèX
+-%ô½j¸ÉÀâ
+-óÐÔ
+ ²áíº[AÛÿ*m²Å=L£BÐÔE	H;p0*[ >rÖ#O«YÞÒË¶¾>íQi=÷<Y3x³zMW^øÎ{¾
+-¸kqbh®ìÆÊ2î^ñÄß^)¢Åï±Ç`SD$ÉCÆÒ!GX¨ÂÞ»1éGÈÇ¼âáÍ2m%Dè­_ßZ¤8¤ùÌ)èé©¤rì:z<©éõk{¸Èâ±pa)CóÍÙ5j*Ñ4ªaÏ	[¤NSàÚ¦=(eLÝ_ÃÔsuM9¾aúÀzåñxú^åG
+ÊªLëN
+U
+&d AÀÂSnDJMñ¦ó^í7è1·w£!9@Åámn¡
+´0=¡ZkÍ¼
+«ü~j
+²â4nFÄ]´é¾aD¸ÄÜ8zÍ0íOp
+=J`©çD¡êS-í7éB[ý®¬Ò:)32Î}lÍZt±¢ê»ÈÃÂº|4ÒÄ{PQÓ³w¸Ai|7#f-Ü»4vÄ8Õû|×¡1O­®G ÷ÍeiVåÂÜ Æ@¯)1$²úNbDsîÁ«áFÂ'¦ÀÌ ÑIOL"ayÝÈq9;Ö<¾ÌvN¯IÎ®è=
+-Æ²V´¡ñfIÖ¸Õÿ0jÁtë|QùÏ²Dt¯º*òæ§þÁò·÷fó"[¿LÃzmæèÍ©p(È)ï
+!i4%åbG;SÊ5äålÏ«æ;{ÑqCÕ
+-i8kÉ0/e£Á|Åú×¢
+d
+£lÁ¶·è$9	^¸ÆI¯¯ÀA
+0mÕ£8reBëóþÉ²w
+Ì i¬d#ÈNâ
+-G$ý:ãùÚõÅ!Xêí·§ûÅKjnîfuHùxa
+n5/¤áIã
+#QI¤SRvRVÙö&icÐ&¸v©3y)lùlÇ&#z
+TÚoü"p6)0
+¹¶fIðäö#LýåÜ!{o¿BÊQw]ñëm»Wò y`L< aáçÌ3_mÊY,<Et.P~³
+Ã[÷gOðßUõzI¾²0öÒ
+§Åó
+-
+ÖUuaáÀrÙýgq&gò*
+J]æmímú8	ûÕ-¼À# nNt£ë÷ïÈ,©/¨¢´I
+ä«È:,r7ÎP}.ó
+èÝ-ª<ûgÏßEx0õDEë\WÁ æ^tø¼ÞFJ
+¨eDÔ
+­óA¶I&1ö­[ká©ä`/O%>+ÔjH!+kq\i¼µ­ü9¨=8ÏØf¤hS]W
+¸Á.^>
+4j®ôðôkåÄruh*ôAü!Àv^óNªCåü*oÊC[3µq¨V)7KÉ9
+Ha,Ö©t,¶
+
+âBßcÆ¾{2_Ð«1öa0z·ÀcÛ2OÁr!Þ°ÙA×Ä~2B
+{B4ðOPæNh9­¹t'÷á¹,¾¤­ÂbzeE¾1b|~.tË3¡}Ï`Ê4\ÊðRðåòÔ×>Î\e5¯¶iìbÈªoÖ®¢
+ã²È7Q5y
+g}ã^_]
+¢2:ã
+-ç8Jî@Kúé2Á"ÌäKéief.¹
+]9÷ìéSÇV"f¢My°¶Q×²±/.Q
+Åp¥Î§ÝUðz0:é *Ì
+Rýmx©QÆ¤¿à¶fwáÎQ8")øâýñëý¦GÓl$£hÁIëf*J\÷ÆÑße¼&ùIu#:Ý;Bel»@©°ae»?[ÍNMÍ7_­À¹X¾2ÊXÜÍV<hôI«©nÉàSÌKÊ4nÊU!Óy¹k($#Ã
+-êc
+krWFú3V
+_ó4 £v8ÿj8µT§Ð>
+J²@Ùµj_ãìßô£k|túðßdM¢'	P(Zfr>ù(¾¹*Hû«+7&s®<ëÎê¢¥Å
+\`xæBPîø¼u;Øt%£uü|_"FlòP wtÉA¯nì<£­}Á½^j8êícÑÏA.Ôý\ÐÙ£`Q­â¡ã7£\¹$j0&þ[ÇU=Éq£xçg.u7
+­ß)Ó­åú¿ßòV
+_A½VLb6ÄúPÛ=MÍû&T´áÇÐ¥lV³µ}2-ózº»k±Äú¥ ¹yñRIµÇ6ZgêPÞ§ËóÚþüÝáÉjßÑu£ºá¯ß"ÿ¦Ù² -Îõ
+ÓÑ;ìüîkÕ@ã\Å3Ê-óµ`&{ËY²U
+ü¬²OG1
+5¹naNÁöhp4Jh¥Ì­°Vàá°PÕòhôã½.¦éÄá[WÍpö§,Ï"¡ªï×ï?XÖ/úJCN´ñ]¥ 
+½nT|
+Ù¢?éWÎól
+#æû$Ó¤Jï±×µ·}
+ci3{
+-½¡=Ï/OâÞ-®²NPaç[ÐÐ¦ß	²EÁ±íR~çü
+5ÏBKp~PVºcõÿ¸@0`ò3GGúoæÇûôÄnºcÉMyc¬"³Ï°øÌtlÞ¢ÖèCáHWÆüßýDv¦ú;ÏVß"ýha8gö
+ò¦èI
+-1 Lö	ÕsãËNù2ÚÝÈÜfÂC_Ë|@Ûqô³Ý¾¤ÖtáDäçåe"ÝÛÌãö3¦>	+ÆKy»¹aXÚúM
+gïxA¹._
+ÏÊ®7ÖÃÏRegl
+bß~p¥ÖXõ4ü¬
+\
+Í¬É"þÁ¥Z>¦D\,AªKæ,ë8²vbGï%5Ú5ý\¶Ê{N«®p,v(¬×qîáù-©×¸È^ñiª;
+-\]þ;."96ZÑén§ @»61QM|Jâªà«ó´:ja7kÏ­§1ë$ÃN4¯%Q»â5e÷¼(Èò-b&aDõk8´?ìõNÿFê#ùì4Ë/Ú¹óËFCaÆjrz?ó-°°±,¦¹Õ÷Dßø[v:ý:ÄP hNUd,&|5ò^ë~ÚO ÓÏÚe
+aùrY)sàè«õÄgX7³UÀ7²Å!¦#]ËúT@G'è«l
+-\3æ¤[lSùzCbG9é
+-X
+6s8T®3uÿ²
+¯/Ý¤jB¨Ê¥ÆPTk[ÄKU.,"fÈ
+!3j~5ïÐY³?±>¿´ÂÂç>©Äç(R
+)q8_
+x$ÞÌ¨-¥nßÈ¶ ©sÃ¥O\GÚËe¾ZÐQ?Bñ
+-lY÷'!5áô c²¥_Ý{ÎÂáØ½»!GÕÉKwô
+Ìkw×>Õ¯°$}Ð¾üCÁ'ºh
+hàáÏKÚkìÎ¥±TXêð:RÝ
+-¿ÙfÔ9±Íø"Ìnþ()1Ðj¢°D
+,QèìcXöÑ ¸ñÐ·ª¾"­ÕäKÏRî
+[ Æ±(Óø§{lÑânØ¸#·%à=*¨§ î]3ÓwP1ÝPiröÚ»
+×
+û°yû´ªÝO/Ðuàp÷<s'æ{É,0× ~FDâ&:6oL[ò´þJÙâïî±Â)&+ÑFü¥ÞNf7ß#7mÝÞ`Ù\#@¨2Kcò(¦8nD´B^P¢núM+"rð
+
+q³¢yL/Ë>åEÊ¼ùÌN§
+ýV6%ïj&¨<Wç\Ïu
+çË¼Ý
+c2Xo®Cuýð¯üFÖ6+X«¨»fô
+³Ñ9
+xXä
+N{\f|7$hcD
+Í|ÖM*È{W]?­º_lÛÁù§|{Òk4iv+¨euÐNÉV#(Ù
+½¹]:äk]3W×m
+AÔYea©
+û»sST!Jû=¤®ãkE÷ï%9à'ð Û¿¤©g×DÎ }qaoÖÃmuQÜ\` ÀQ9gé!ån^8Õµ¦©jDuoÎKÜ¥wÆ;{¢4³xoqlI&õhÔfQò«^þâ.~µ[}wöî%U8n<
+-¬"l#Rír«7a¥´tO÷³{æûUC`+àjôeÀ/òS¿árê½ÖÏÎlCÕ¬uq[~ß¶J­¢Yü³ÆØÀukÃ É×ëÝA?xdÄ*;=¹W¨q<3~¥æ	z&F<|u¢3BÓÌy´Vt²o×ï^mïÔh¯Õm4¤×Ô@<ã/3Ë[æé
+·çQéô}
+`¡tæ~m
+4éûÚV°¦>W¶ÊòPh(Õ6ù-á´]¤ïP¯)ö§y"NÖN¡ÚôÁ
+=_×Ê§tÕ
+:kOÖÕÒÍá=bØH-w#$ð9åuÑ9¶û¿ÜØwèeUBéqRP
+/Õ<X°h.Xû~|T
+->Û¼>)ñ£ìµ_D=ÁD&z¾2Ànú¦â<ú\]Q?y?û=Q
+Òkd«w§:T*þ"°
+âÙïAy]ÉV´ªbauÞñoÓÁn)ÿ
+H¨"«Þå:ì(e¼4þùøÛ×ÀÀ¯åxÌwo
+-_ ËÀA®BUìkNÃUÂhU
+¯Nöü^¤^[;quÔ"2
+;méMÖÊ]õ¬ó»ýÝÊorÔÓÎÂîð½@ÞÀ<4 ­ß<ñßéÜÈHö*#Õ.Zð|¿ o0¹1´î(ýw§nE<åos
+Ý¨hÊ~ò2Lñ
+-l´ª§ß^¦,û¹ÅM'Åþ[;¬a¸RÓ²g]õcIó¸Ó
+'2+<C,ë#»ÁtU£í¡X
+^ïä©uÀ(exPà
+us®÷ìhõ
+A¦	(¨)
+_H¶!Ç\úÜµØù¤Â¯¸>ÙÜÉX=$hå^BaAäs|½¶yíräÂöl!è5î
+- ©JÃÃMë,~%>³lÓ@P!nõ¦ãÌñÓ±Ã
+¯e¡ö(%WÛà¡¬_ZÝÐÉ¸t3(xðaO\3u¾9ÝÕ\#R5¤èêEgõüíÚ¼AtöÍÈëÒ}~×r¬¥TRÆäø§#½¬§oÙ(]£
+-g_³MÒkÝ·Z+TJ´A&¢ßºÝWã#ÊÛÖËÀkó(ÔjcºèR ^ÜÄýfDç@­ý8cC(/ÈX¬uvX#SÓOºÆ3ø~
+
+¥ò
+-{"\yK£¾
+-1
+²ÆLGqÕ¢² ©ó
+Ù	ð¢yKdÏÎ&FmçÅ£©ùv
+f¢·
+Ë^ê3¿¿´k´9
+-ðÔÉ¦*îçÞoC·c.ËÄÕ°Þ4ß¬LÜÙh ÂHëà{âðùÆ3õ;¤J~W¥ôj6Ç!`rÔuc
+d{U¬{
+TðÇ/ÌíeG4<Aà²^9_|~RçAEL¦i·Údã#¶M tEí32ën²åÜ´kîGJº«ø
+-°3löóÙ$I;¡Ry¶àêÅRÇÃ(]?a4ÀÃÖgÄø
+`©yY·4,°ÉôpXÉé?S
+¤Uý`JiÌ
+-ÓW&ÜJ:¯!¬i/ªvóä|Ðu¸äÞ!mW
+ 
+TJ»2¡-×Ø5Æ!naY{
+-1û´ì=Ílq±âgÐ]ç/85r-ØÂÝ§w#_û¾||Î1ÊÌ-Ö*»óMKXBà·ß'êuB#T ¤«OÉr}`so6ôTòIÈø¤~»6CÞ`pÜÏMè6ÈÏ!E(	gw¨uéÆ_ådRY_ÆÉ¹¬u@ÊFq[¾Ï]·ÐY.
+-
+ï
+-ÿBù4A¿íó AJmÀîìµÄð'ú÷göá:tÒÒÞÖ­#yu§mÜP
+Pd;¬ ¹è¬q×ÿN'CòÀ[V££&sx@íMlÔ
+-jm×g
+(µ¯@_=ÆétQ¡ï mã#EßXqX5Ó¿(£9»KXù*ÞC}©½¦*ï;Ñ
+-¦D_"2½!P}ôôÚ­û*.'êË¬¤gK$5ÄhÙKy "
+3ÔªÞ#êA¸-øù\KFä°P&­§Ã<
+¢AÏUÛ« Çaß÷BMÚ9ÍË©õ%oô6)c¦çmí»É*)ûæ³
+'çNÍ0ÊÆ»Ü-ÁÂ8¼}4Ñ°ËâRJhaa [\	¤©OT$,RÜn
+Ã×]xÄI{åFHrxaå¥ÕùÎü/Ô
+µ%
+-Y·éìóûR!Û:Ò%J_ÉÙøÁÊ_r0ñè
+tà´!rù
+Ò©ôø×)Ô+­Tf¦V#´l¸¦cÛ¢7vä~Þ
+K°òyþY\üq·0hâ­nQï§AK
+ª«Ûj
+ZPJÂÏxZok:	µøÄ=¸-.xá³qÑ`Pº!»Á<7o©èKÆ
+¦oüõntx&ßbFYøõqTÖ!½j]ÓÉÆ$ÙWAzä<P( ¯évª­]Ì°bÍ$UøK	5C7§1oÔõ1
+k¢Omí	¡ð­`ÇgeU
+-m1¯SÎÈFfb
+-
+ÎÇ1ÏÛ&%/çùô¸LßÜMÕãOòéÐA¹Å`>³:ßûe:"ãã=õfÚ{Bå°{³åïàÏy×9îÐÜX
+'ZÒÝñ1©a:º=ñôôFk ä
+*aó³[¼E¼_²/z-L)v
+¤õæÒÀLÀQ¨
+-¢§lü¾åÇ9¡;¸Ar!nÿ¬µÛ¯u åz}wø}JQíóF1H"ák2]¶èzH£s
+--ðMGÇ¯ Âßq¨ø@ÚïÁÃb`éaÃ^lPjbF  Î¬ÿÌ§¯(ÊÔy
+i1ÃW%jõ<á/ºYËp"×¥PÛ=ßÉÔ¹à9J;Zk?©µ5+áöeë÷	E9Þ4Ïnäb­BÞZ6¿
+ôY­â¤ú¤øBÒÂ» FéOßÒµüq%*TiI£oQ|;b·³+ÍÕ$d¢Ãê$6c	ºÛ;u9¥f¥\'y%+ó~Cð*°Õ2U Ùª ?ý}ä`M¡=eF{`ø
+¿òµóÜÙ7ªø#ñ¨Ë59ðJu-ÒgÄ±k¥@¡1¦©-¢*"¨Õ/æÐÑ!s{Ú¨xhýÂ
+; Ä#Øã
+ÄÙ¾¯d:iãÏnNG·=Ä r¿î0"µ3»ÌHÙCºÉf§.UJÊa~`Qqj
+
+	bÊ;èDæZ1vì§¤ç÷«®èGÐVÚ'p=:øÖÃ^P
+-Êèæ°5´uíU¦âÑm½¤åäÃ3üv¯ñ
+±§£º¿£?}.©«(»¤«(þ%
+ð
+Å²suù0>u6ñÄ<2ë©zª§Äj,z´£JÀ!ùÇÏ<9M¦»ÒÉKï>õÕÅayxk&NtFHäÝÔ	Õâ4ÔÜ×m®%ö©ÇûKf,Æý-×è¢NJçvÒöÛo¿2tµ«yÌT×?R¹±BàKtÀ¼y
+ÊÚL¨ÜÑþÀ àsÍ·¦è 91[g`¾««ÈaM@*TIØÈHW8d)¯f8¯äÝàÊ?Zé¨¾Ü
+tÙn·^ÄRýÑ
+W$3Y0òjÆLõ%*µ±@°érmî
+JÏa×°Ø=$À8xp	+8)LÕV3ü!Çm¡YEJ|¼@i{ßÙlrÕ:j!lþA8§r@ððù¦	ÆÈU
+µ3°4	×~o×4dçgüÌ0t²k5J¹IñãL[È
+¡¹<í¨H]ÿìðN{/¿ýK^éD¤ÛRÈÕ)ÞÏé.ñìëiÕ
+ô&Þ
+-?{Ëv*MñqÑË\ûV²¼Ëkí~÷c·PâÕMö»-
+AÚÕúÚmû¸\uð®S+=¿)e'ParKË`Ê×Ûe}b
+\Fà2b;^s¥Sú³gî%Y·ÈÐÕfk;låZg¬¬ÜÜÝÐimxíµ<¤òR¿Òþ
+r«cÙ!¿Ú(ÍÉñàú¨Á±a&;?¯p
+Cf°	Ü'?A
+âð¼$Ä«¼ Ân¶§!-à¯v¾ê»ÞÓ^y1~´E:õ¬ý5;=Ó,UF¥º¢nOïÂì',]èU!Ö-²É
+-#m4}ê£çsË
+¡ò7üNV?ek
+oÕõ»(È¶áê:_ûø¸ÉÛÈwÕÌ½]f¯àêu¸£ò!¾ ®	-IßÃÆËTáÍø¹¨¾
+· T¸
+üJõIò¬1fï'úÁ¯8·n}³wÔÍUPq#`JIwÀ
+-ÅÀ-"§CX¼¤Á" 5*Ú êÙ¡~LÁ_­§@ÄB
+.Q-ìè×5<Eç^Ùmª1
+³cÞ´Ëp=Ùîj.]ÂC Ñ*þ©.î
+-¹<rªàÒE;Îþ2Ü¢Ò°»ý!óú-(Ö®¬ÛV+þU|-ðTáùüâX;VÆB
+ÂO§iG~6
+Æ6³è]]^¡9~+çê$~
+{
+Û3g
+I&há$sHõì°òò¹µ|
+5¶)&åpDá6$ìsm
+-£Q-Ïªá	H	ûsÌgzÃµþ]o¤
+-â|ÛÆ2²1ÝÒ¯#¿RÏ
+-P®ä(;i¾éx#ô³©`_f.Ä©{A® BáÙ£~>î.
+	+0²Ë·¸åU¿97,&Äg?$¨×¥Ö{×¾LOÊ~[Ù#Úá2¦V]*kRÈÅÆÈqEGBnà¿Øº{KbdÂkå(tw4|
+³u¢
+-_(?m:o	¦gÖ¤«¨ ib<xÚ:½Ð{ös	ëÅþ
+ÇÍæyL 
+Ù¤ÿá§6ïô¸sø¬ë' Üºúò@m
+»Æ?X~~ñ-<óP¿uÑ
+Kra3Ý)ëB m5Et(*©¤üåVEqáÙÚ Éh%>+e$§÷yUé
+-<$^ÿú]3sð§'ÒFÙ¹æn­Áã ;útÔX
+u)X>=µµ.ÅáõÊT[­IH«Á:úrA
+-IßÏ|x8vÃÎTKÆcî6q	<t
+UåWãçf¹u·^m+VÜ>Ôþ#¼
+ú8Xç4_q¶Aïà¸×ô_Ý
+-)¾`~¬xê>ÝeÙÐì5ô².´)åÌº5
+$>¶ãKqyæ#½-4ËbN
+'8]ãÔGµ¸KèEC#¦9
++ÑbúÚ¦+°è] ËZ¢¥FMGézÀ7èã(XÅT»å/ÊC,b²r¦
+òÂ]&`+k¹g
+-S]&îÊF]XzìHÌ¦
+k¯Ô<]8QÈ{o£
+-ÜKÜÑ¿ÜEÎ
+ºÆûm¸2hÕNÓÌ¡kîïI9.Ùfâ)÷9älUÀ¡ïmÝ[9­Íà°ï¸ö
+m-®¥ù
+Í Ú kWokË,,ù¸÷Aá¼
+/¿`/,-p
+d±~¯Ívòê0ºí:E¤1!pVXû»Ï6
+Ãe
+âârbûøñ·W,,ì/}¡.ãWß*T»ìBLv@/«rV<´O¸cò+a¢i.´$æ(¥8Þ?â¤q«GJcuÀkkj®áaøíT§y¡k
+Äìj×öR
+¹®Ø±-Þ|d3´á+EíÍ»vãOø½Lù§¾gÞ&@,xéG;È7ùÆ:Ït$ãÍªÛø++¬%è¸V8ò ðK?E1éI:Aê·òÂs¦Ê¹-d"x¡µ1#ë±pûp'»yfpXí»é-[8;æ_Ö?z{üówÆæp5º1~i¶£dgÇæ7ö
+-Ã Ãë
+I3ì°¨þzæm½<Å¯Ð°òá¥
+-øû|uØ
+ó09ì¬:a3>n<Ós#TZ½¸OT­
+=.$g §h#öl¤ A¶ î²waì<*TßnÉ<³åC'%nëÎòÆ:VâÿcÒ5µMq9tÆíµm¦kì
+14ÌS©êñô¸âKga²ðþ[
+ Buzà#_¢"ùo;WO­êd8=YDçZ¡W[1´l¶xÅÎæGñÈö°¡]êr]²
+ý¸±B
+Ð"wRÞ	_.
+ûñ 9´Â¡©cQªÿyPâ·fD
+ÞÝÆÉDF&òð¹
+-`IËû4vÛJ!ÒH4´Î³|¾4wxåvó{ëÂ
+
+ YÀa
+-0
+@o^îX ¯æ*	¼pÚEMn[P²êGNÚQuúEÞ×êgN­<ïQ&HþyáïçÇ?*¯Tã¯c,±
+-yFoä¢)ß×YíÜqõ3¦)/6'B°
+	4¾ö#)g
+ìÍEÔ¸)¯k³8X9ÐëQvßö[ÖÕAû©&ðy¢-ªû¬ïOÊ=ÛÊ="¬
+!ïáèúªá<HUù;ó¶æT
+/^îLÌ.ã/í-G¤þV/
+-»6©¥¨I
+-MÝ9ú¦»ÖÇAz@Äºí#ëiònö×{É¬,<ÿ7êwBÂâw¯ÏÃrge
+QZÞ^9X]v
+óé­-¡®ÅFÔ$EÈ;Âª¹ßózê´½aO%äú¦áqIj5®ÑGÑ#Ö¯ó³(cÚûHkAYÀ×!É©Áª65
+Q¹Ö¨7ÁûÛ=Ò ü³<ãÇEÂqÑ¶@X4æ«Ì2¯¹MYnÚÈÆ+ß m]
+-
+©4¤Ö:TÕ²¤õ×R-1qÍqtÅïA1RfoäøLÏWÓË%ÒÀé¤ã_éÝ{
+-!º¤~7cÆÒÐ¬#*8Ñ` [ãÔ­hï²¨Å-ä©2àvîu7}ëºB-"O­ê«T
+-ïÀ£oðý¼ÙÂê
+ìZÀ½¾1SÐ
+Û¢gÉtÇ
+X1,ÌÌU¶¢â¤5Vá¹mrEËZq¥×Ubvc)´;Á	ð\ß ~zyLÏ\oÜÏªÕ2óÈýøçâ|p¢[ÿØc3EÈ²_¦×¢ã{«½7'kÄcÕ%µ°ôyawÔë¹3.¬T©½ TÞÖ8³¬\W&M¸ò2ªÙÅ½$õw/¢äñ?ÍÎQlkôxâ
+	ÕºÍ}w7?¢JìÍe²M²±¾È\rêÐÕÀfrX¡s&hõËÂv·Î 38´üÇàÁÖ¶ÞO¯JFÂßÌØóÇH&n¡=â®x+òÜÃ5àtl [_×R5<äØÊ«4rÊ£ÕtöÜM
+-ó-¿ Ö¾øðN@`-R+,Ë¶îÔØqIyhfx8~^A°¡¾l>k³Ñ¡´L3JQpÎvgÐÖÛqò`KÍâ{a }[4S,ïÝÞ¹HNð¤hùy;¬FÇQF1Çé©ùÞMZq2){°ëëÊô³¨ùÐ¬4»PqíF¾Ä<Ë&Vîb<°;|ÎW½1Û Ê
+Q<
+-{ËA	[ÇþÁülÈkú,IÀá ¶]BÚQM;¸w»¯\ZÚ¬63Ð ^V´Ûõq'sTvÑ¦·V²SqgÙg;iT¬H/T@0h(wô'++c3Î
+È¨ñ©¶ãÙ<*¦®èu[««y¿û
+x÷²á«>>
+¡LkµASJåå3ð>\Í&~yJ!\YkKÔU
+-¹
+2y£ô×76
+	ÈNÐ0!³ß^ }Yë>ÖãmNKýxêyÝ¡eP§M	Û¼ÖXoÍÖwEäw¯RÅ
+-$F©lC(#û5çÅ¥bÖ,ÐÙ?Ú½½Æ ;
+IÙm4âB
+"5
+-UzÑÚ¬±b÷nz;PR5°¤uäÉó)Yf5eÎ¸Pé VäýªfÌ¨
+-Ñ¢î uZÙQ5òhº+ ªEãysCkö@¼O-¾xîØ	íù±íËÖ·´°ëù¾¾óµñOâà¶GÆ°-¢ëùÁ3_NÛd¿Vg\>
+G\ÚY¥-¾´dhÊ®Ê\¤ÕqA |¦v:
+
+lBYPviÜõµ3ªsF·âÍïv.Gy@ü%ðU9}ÙÆ ËÏýËäèYuÛBØégF?hrdllâÜ8ï¼D8E«¡Ð?é	l)Áx
+Sl|+ôf nçx½®v?Ü~:Ö´ [BÜN¿èUL&y©W5Wï¸ú®×aO®ö^«õ23GbWîù¥Ë0ÌâØ<»ü&yo
+4bBõ¥KÏKgéDGúM?iÊée#Ìfr°_¬*T·d~`i?ï%x¶L9ÙB"ÔòÔÛö³7ùÀ µ³_Ó@½w
+>ñ#n¹¸Z_øW×Ì}ÉtûvðþjÃXÕ1Å¢l×äIhK½×\Þ¬"À
+*2½±ºv¾MòÖ«ò¬PY-9jFómÃWº³¯¥w|ì¡«¹êK
+-k¡O$ÙLñów/á'¥s<W°våÍ yEsV¡@ð®-¥¡\h;â^³2ÔoÚÓï0uÜ}Jxâ@ÇF¨³¾éßøÌ°#OýmÛüé¢iu©ÂzÑxÜD¶àGàÌ½ò¾ Vb¼ ÍzÖ7
+-sÑï"ä½d×åñO$.^ÓdpÖñÊ×nFÏÄµ$kCúØ¥RtÍJï(ü½æÂýõÅäYáY
+AÊjhÓ»)BC6¸~½¼ÝÙ0ô
+"÷é8)[JÙËe |ÄAm¤Ê
+Å­'ä½»UãM(8C0õÈÃê]£í1¹Ò¸¢ÛØN«a
+-(ö'Øãöç-O©­_*psR-Pr¸ýÀ¬|¿¡.øÀêû¢åÑ
+Á.êê¡L×Ñ¹g=qf*¬ óDégk+¢þÔò +Ëãúø
+
+qÇ¥ÃZÛÙa;é×r¯~«òv=ªÎ9Hyq- ÆÙW¬¦wª\Âä5ÿ%Ì7þÓ£Ô¬b¢´õcÇàzùf3»¡ø{,¨·kô²SíJìFÂø
+-V1yH=Së*½IãÏ
+7E»p©7tuê
+E´kn
+bÍrvv@'µaF²i^ú ysíôA»;ÄSRHï
+ò¢¨¤
+·]¿áXklû}ÅïÒKI_»ðúq\½}¤² ¹
+êDôÛÌYÒD5,àÃ×«	cç
+©¹ÈÏù½$Ñó
+l:¾
+ÿ¬¶y#âìvàîæw4·ÍG
+-QÇ
+½*ÇBR[âøA¬ýZËzS7%¸Z½
+úîÜF0_Ç®xß
+-@CnÝpW¥£[,HåV>¯®j«_Ù
+$M®3mCÙfóÆ*LSÖ
+3P2~¡ÀOÚ½zæ| U
+%nØ&Sb
+->Ý}û­
+RóB	kñk1o/Dx ¸ç¡½&Ö>ýþÞÃ	ÄY<> ÂÇéúÑ
+èíÊ:ÚrÔ*éB`ÚÓO h
+-âß
+ªL¨p¾âyQ`|ldå'ÔÝè5¦é
+
+öÕÚF­­6pxÈ´1F-!FüÒD_0	Þ6ÙOsÖÚ?àV%äÓ¼Ï¤Ä.¤o
+æ
+¨õ@x\%V7<kCÑÇÇs.Ô+ý»
+KÙM"¾ø3Mè¿ìn
+J>}zGß JO¤:<R·îÅªqªÂècÏ·D×R^c­s26u
+ùQæü´ä<Ëç.Zmi¤V1y
+-zBÿ
+"
+)> þºÌÿs<ãÖKiçÜì×DêÊÞAz¡ÌUºÌ1EÎd=>u3Ô±V:¹Y
+-ÎëÜð[ áÂW±
+N~â	Ê0#7;ÁKrNr:é¦!Á£§BPö
+6½2½rÓG¸ÿjGë`#üO?Êeôq
+]väêñ!zeGïÚ½4«×êZ¿yËpdAók
+-<h³þkÙ¿êÛ0áÆ¯Û&D-gß¸åut³ê,êgs gT§ÙEÜ1  ³½À¶ú`'÷;úXiÜÙO¥ÝîsõÒf}Åu©sIÜ²º¸¼j}-´5S¢)Úb$	ô»Ðç:áAtGºÔåÕIÆDºO;ÒöÊy|ÒÙp×¼@DßþïÐÞ¼Ý¦
+íÇ[kÚIXË¯´£
+g¤äq:C+xJ§°21Ï¹Ô
+--QÀâ
+-ÎðÑµ~ù!ñP,â·
+
+D¾6û¹¾C¤è Á#[ìû
+ø¼
+-äp¤%9)¨
+-Lð´)¼
+ÁÂ
+G1åsU^Êó`~8¤Öùá:óVSTðqï
+TD°9¦*ÛóçÍ24~s5¥Ï=#õbJ{n ¶5Vmx£¤
+-¹ ëÎ%ËU½
+åz­öu¶n]±ì8Ì#þrXeá+ÒâÞJ¶pÈÞ.ª×s>¨ß@âBá÷æ¨c-¡iI]'ÈÌYôé5Á{hUZ6¡ÜõuM¶´O7×ßÙ\NRaú3*b»ÝåæEkw7°J8vä¯k!Í&)ûL5p×lF²k5àÑõ§8T<·ÇÑ±ÙOõAwçßDÓ- ×&_Ïja<|!
+òu÷ 
+ßtHÉÏÁ
+ßër/´]ä>*S8Âfbl4¯e»1
+uF$×NC6sLØªÑ6ÊuÙ4OC\¦â(vY*`
+N¯YóclÔÈ8r|YÃíÒøc<í06±¡E	o¡/;µÿ«òZÅª©µôF¼¶ç¸ÁkøGõmÇ`0¹¡1äg
+Ú+¡mÌk¥8YNðp,`UÝ
+-,;GÈÏ&×VÜÙÓ¸UÊþ/HS(fì¹
+-þë}Ì
+-BÆy42¢-ð¦údy¿
+|
+×KqÁ¶
+-Ùk%b´dQ'ãY¢^ªµ1CtèÙÊ¦_ç¡Q}f@b£Wxd
+¤ -¿-
+m
+-H NfªJSêÄJcâ¹ù­]:£ÜVZ3iXPsªÚ
+kCcD¸N_È}D9xß&ØºöcÀõ\£>ÜâºüIÑÖÊQ
+uXêc>SnKÌRJn¢Ä<ù8ºr×PwGX¢!Z%
+ì
+WÉ@ôzÚ
+-¶µK_
+¬waâ-ñ}ø´ikhñ+,Úò@gMÅýæ¾o~æ7üü%6oâÅÇ¥Ýçt+YÆøÏ6 çýIÝß­3}9c¼¡ÎMäj.¼^ZU²¾£Æ ]&þ
+°Yð¦ä´
+®Ìß ¤°³ÃFý£|F2Ñm_~,ÒîHÏÿÏN:ð3»?¿p6áÊ´-xæ¹imÎk«ì?ç&ðyÖØ0ÞD@/3Æ@%ñ­ÐÂ-®µ LÂÓÃÚTá{6ªT#]xnàÀ:É·9]Ç
+c	I.0]¯ù6
+½s¶æ
+0*ÆuÏÌî+Õg²òÛgûJ¹6´ï_Màç­k
+¯Ó>t[Nt2£¿ªö
+\Qõvõç!7ºGÝÚÝB'{VÞ^À¾d\2EÕµwÊzjÌîµ9á;M
+f
+éñTtjTQ-©ÒãÎÒ(Qfk
+ì´èñzÞêZ`þ6é¡ç
+-	y6j4ñº
+7Þ 
+poã
+O~03õ3¦TÅÜµHØ$!¤¹!³Ê;cìuì¬äÇÿro+mÁ´¯>÷Më­S©3éâ_+E 
+°¹»RÓ
+"z£ ÜÎñ££1r³ÇÍ¼sÈc1V5=K,
+-UÂ&t+âã4_+	µ
+AÐº¶²ó þroÇ@¦{UP·°gRÉË¬æ%+t¸ÉKù)ùH+¥m(7ÊA
+CP"ýFáLãàn*óQÝ¶ãÎãLà8&ñsq¬½>BCqÐb´Fop:ºUùÖ3TuÆ9í}Pf><X
+ Ö=åàÝÞ¾×¾bºznsý}¯ñî¬Ð@S:´¡Á
+o(^ÔàCµ3Sy3 D6d&¿Lá`ÖóÎÎg`e­Ì ×(>w}
+ç(7
+-âüº*w®îEûéõëÔ
+-}Û9j (³)mmp{ 1Ôs(IÓ8ÎW»=P¥Pk«ß!3¾úñt,BIqbxv´×¨¨0%m"z¢5£GS:¶Y6Äa=7ú
+4RÜ»Ã±WyÖ<ª|9.Á¶¹e6G°k¢;+Ö.åàÕ34P¹e||=©gÏ÷è2F;Õ£­P$§øÿlMn'@?ûóËUìÅÚí/u;áßD\O5"Æ:§þ¾)¾oS1ü¿Âz
+ÂTH`HV·CåÊâ³Jâ]A¿u£ÎábËôkPÉvÂùÀIiy­Ã	ÿ( rTÇbÀÿ
+µ¸?t
+4ÉP`}&l$Ð¦Àë×$cxÂ8¨~Ë · çñ2¸Æ³ÄhAF½oK3^*ØË¡0Ööáõ­VQ°ÇC 
+-Ëò+rºzkA	Y?Eã)ð	>(
+-['8#
+-+Z:ßÇTï ¿ÙG
+T?
+Rºâ->ÉzlWöàÜþÛâ²Q/ÅÛ{P^`íxì°¡ydè+
+8ÐK®ÀìcI±rBÜ.GÐo§E?7dò3ÎÍT²K¤j³äâ4ME¢:ióÛmÞDäçó»O
+áÛè
+-S­ÙG
+-RÑt\ûÖò÷¾ÄÊ©ç5x7½>T,b¢¶#æ~ò!6Ù^
+ûÔÀéÙnnÔó_P¯.	b¼ó
+ÒFzà êB]ºÂÅLÖ©.BÆl{(,|5Bûq·Úk:Óú0/nME\,«ådÊâÁ~
+ÈÓRá¸*Hc.²8¸4
+m©m-o&±dÃ
+GY6ÌHÄÞæÙçx}#TÓJ¢Ð¿pÄ3Øa!²'1Cï(Ê{¦`éy2ó.ªÅÿ?¸ùè;*¿·×cqþv°Jº¼NON|&VÞõ>&Ø*t¥ÐäÃoûßù\ÓËM&)T²ó+>=³A
+YKHq¼ÏøÏ,£æÚÔà,s¼Iî±>lJr
+í)%ùaç
+Õ¢	"Pô¯
+ÑÏ²v	ñË/æõ øÏÅ²à`Õê
+Bx{`Îñ»ãËáiÌÐE||ñH=|N0E!²2ÁHbêÑÆZ½Ã¢Kí¼9·oÍÈôNAå E;w¦Z!~kopNÀ*	¤¼Yq$¬÷fJ>þ-M­õN»G7à²õÛSh(LÚÉH`4¼§{Zã	 5¢µËRº$:0ÜþvQvòg®
+?z­ÚPc¾ÊsâôYó@7å~jåsbìØùå/ò
+-endstream
+-endobj
+-755 0 obj <<
+-/Type /FontDescriptor
+-/FontName /UPNDUM+CMBX10
+-/Flags 4
+-/FontBBox [-56 -250 1164 750]
+-/Ascent 694
+-/CapHeight 686
+-/Descent -194
+-/ItalicAngle 0
+-/StemV 114
+-/XHeight 444
+-/CharSet (/A/B/C/D/E/F/H/I/J/K/L/M/N/O/P/R/S/T/U/a/b/c/comma/d/e/eight/endash/equal/f/ff/fi/five/four/g/h/hyphen/i/l/m/n/nine/o/one/p/parenleft/parenright/period/plus/r/s/seven/six/t/three/two/u/v/w/x/y/z/zero)
+-/FontFile 754 0 R
+->> endobj
+-756 0 obj <<
+-/Length1 2450
+-/Length2 17980
+-/Length3 0
+-/Length 19392     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ÷T%l÷À
+-çlM8ÙvmÛ:Ù¶1aâd[mN®Éì&Nvï¹ïs?ÿï[ë}WkU¿í½¯}]§(HTÍ
+Lö®
+,Ì¼ Qy-V 33#33+<
+«-ð?rx
+-
+- ³=ï?,DÆ® ±+ÈPÞÁ
+ ãf
+`a°pò²pñ23XyþcèàÌ
+3v·2È3d
+ì.ð¢^ÎV® <ÿù@mJ`ááá¢ÿÛ
+ lt¶25¶È»Zí@Mmª¦V@W¯ÿ	AÍgéêêÈËÄäááÁhlçÂèàl!@Cð°rµ¨ ]Îî@3À_-íÿn fiåò/
+ª¹«±3 ØZí]@.nöf@g (;@UZ è´ÿ±Ü¿
+èÿ
+
+å¿áþíýW +û¿MM
+ì
+í½¬ì- æV¶@¢
+£«§+=ÀØÞì/Cc[¿±»±­±	ÈàïÒÂÊ cPÿîÏÅÔÙÊÑÕ
+ÑÅÊö¯
+þ
+-³¸½¨
+ÐÞÕþ¯úÄ¬¦ ¹{1ýûpmì
+<ì}þCæVöfæµaææÈ¤noåäû·
+-HÿGftp033sqò N  §©%Ó_	Ô¼
++YþzðóqtpÚ úYA?à}\Ý Wg7 Ï?ÿKð,, 3+SW	ÐÂÊ
+þOthþ/¿³'@´~, æ¿¾þû>hÃÌ
+ìm½þÿ}ÄLÚRª::tÿnù¿JOÀÂÂÆàâ`øýoÿNà?Ýÿ-U2¶úwuÌ"JÛ; xþÕhzÿiÄýßAýïkCøß
+
+- }¨ÿ¬¿
+3³)èËÿçKð·Ëÿ¿Ýÿ+Êÿëúÿß$ÜlmÿÖSÿËàÿGolgeëõo
+Ð>»¹î¼èØÿ_SMà¿.´­ÙÿÕI»n°½
+íÇhå"aå	4S²r5µü×ýç@Ám­ìJ.V=8 fæÿ£Ý9SÐ£â:«¿U@Ðúßâö¦fÝ=VN±³³±<3hÁX98 >, Kjôü{·Lö®  ¨9?¹3ü_'ÊÉ`þKô/â0ü!. èâ0ý!
+ øÀ$ñX LÀ$õØ LÒ
+À$ó@Ùåþ(»üeWøC ìÿ%nPv¥?Ê®ü@ÙUþ(»êeWûC I¨ÿ!P-TæDÆTÉUfú_â éL
+lAû	;û_;»?þ:Ù?T?ðOP
+ÿZ¸? Ìÿ ÈÜüÈþZýá¿ÿ èm ¡û?âÿ¥wpsþGxÅ?ÐòOù !Yz9Zíÿaý#!3h:6ÿ@Ðlÿ ùØý£xPïBq\íAkÿ=¨;?ÙAÎÿ£UïøG
+-æú³·ÿ;Ë¿¥Îÿ3FvÐ`
+AïÃÑ³:w´usùG|Äé¿zNÜ
+@OÃÿ
+È_3ÿÇ Y@óøã/ºÿc`
+ sÐÿß´ ®]l],ÿTÜ WÉÕÒøSuêêáðP
+· hèîÿ@Pá
+ÿX	·ç?Þë©÷â@¼ÎÿJõ?/©3h¨®6¥ÿðß @SøEÓO¡Öõ¡µÂ=ö§øç(ö5Óh|V»Üaij²7ïGûQ×vÅ©o
+V_}NÚa#Ú;}_
+Tfö;à§±~7|'ü@À &tàûêä«dÙÞ#CçäÆ¬Tñà1(éÙð½âçDøâ¾òA
+-§,ÂKÅ,Ãõ½ Òy|ì\RWB8ZôKOùÛ»9ôÜïÄ2	tð~§_Ø}t¶Xc¼×¿©±ºôâãéàBÞ¢OÌPú
+¥Èà,ùÄÉG,¶t¡;±×ô¬ðUÿØ
+Ç=6
+­@Ù	3UÞ¡=¶UÍíÆEÏkà*}e1,wQî>|Åö®Ïr
+²q=SbHH´%
+-½¥é>8JYâ\Æ+úÎã?KÕø
+ °ÌjïªÛçcìtÖ
+-ÁõðÛïÇI{¸
+Ý5í3µi0Q2ã1KÜO0Fg9#CÕèï6àË¿Ì@ÈZOÔmÊôx#¿(ä®ð
+<
+-!Bl-9©í»
+.Uègb3¬yeúì¡Æe£ÈXU
+ju¿|Ï1Aø&
+ìZÏUSfl\Y@
+ßaqSz¯DÈ;Õ8S>ûáØ¬FÄ,ÑwFºbú<LÊÀã³<Juå ØKv%fRao$ãÄôu
+#6çRõ<!_üè)i@¨3.5Þ7
+àa¬Ä²L
+ë¾;ËÑ&º4õ7÷ß»ð/äñ{Ó;zÛ
+-¢ÅÔ³z
+-y]ý­lhÈÐóÂW¶¨.}åòáJ-÷Ý±^æª^eÛ=&[hF<n±CwJ;#ñµ
+-nÎ4rünå±
+Á³#bS+ùí}JóÑ¥~¸-­ÄÐ½½óð{
+eSÞê´?Ø¾
+úßíJ{àxï+óB,Âv#/nO2~Á2õl¯À.tÇM­À§ÎFçÓáâ\Îàý9Ñ >Gçý&ÙÏ
+NÓà¬ý-)w©sÔ´ 
+[©<KZc!èzq?Oó½-SE©)gZG'ÐÎ×Ç!4¢.>h4XZÏ.\,Üß>ýë¯ý3Ä»<<f=¼Ws9ÄLg¨åE¨äÎ ÅÁw¸ÕõÉ³ØÌª^pÈOà¡ÔcT«ÄA©}æu!H/LÅ¦©!biÃ¯xeÜà!cO*CÔz(e¡íSP+³=/äI$Ó¤k×<
+-1* ~.+¿ò¬µx}ºo`®¬núØ|»&nÚÍÝÞ-öLò¯b:
+5)}Õéó«²)M5ç­Íùþjn÷Å'
+-,X	ßH
+ü3)¹ØB¡c×f{¾ÃÒó·ÓWhHà
+°}g«
+Çæ¶ù`yj}cÛu(l¿i±ßÜr§Ð;4ßÃ{_ªN>kÆ;meµný*ú,Ïºg4Áá\-wÍ[»×P4ò´UÕ=é¿õf¾$oô¡l+ÄÇP@éWDQù] ôòAFrsì>
+{R'!·7B
+N÷
+úÏ
+-O^Ê¿Ú r\] Æ
+-}Ã'E2Ó0îÇ|L*ëCg¼]ÕÁãT6
+s]rùéÍwÊó
+-Á±Ü;J:àvGñ0dv@1¥²Ïí¾>ò¸ó[÷jQyÅ+<¤ÁRóà
+âq,òlh±W@wp`Ä]"jfÂÔÉÜÅVv· ê-Ïëkåcâ¶§5Vg¾¬ØÒ¶ÎO|äÕ&hb p
+åºKnkn
+^ÖÉõo¶½}¼ý
+ÞaÎR4ÉËô° ¡Ç
+ïZóû¬<Ew	ËÃ¦áèNVþb»x"YÝÔ¼ÄFòÜËnû ò7Ò¬Lcrð	4Ì÷{k&çé
+Õ¬
+B%TöZóE:EG-ÃÏ®þ Ý8
+r>Ë<Ñ
+-´.âßÏìJÂ_=,Mz¤
+Ù¬ÄýBtQíN½ïU°
+È	ç^ uÅóØ}0Â
+½U4>tJC4%ÙY&U Í¯¨:[u2[Já³EÝÔ
+î	O»(+öÒ
+Ï|ð` ¥co ß(m+Jã'«
+-ÉÒjBtGÖ¸B2Èt}
+F0!*(¼Ö1»,·H¯ðT8+/ØpÜs,Én
+\Q,¶¸Îsør3wWß
+¶*óéRNÏ~@ïw¬ß#vÑ.F`$6Û§Ûu	8²äôðF1åãß¨v÷Ë@Q-Þ¥òu^J=5
+¢»©b!	ªúR¤jÿXô}×ìK!m¸>aNÕ%	Ö£Ì¤UÖÓx
+@¶`Þ÷ÙVõ
+Ùï.ÒJRÓÃ¸
+gÜ®>ÜÕ[Gù£ÜÂ!³Â/§;´\£nrSü&þç/ë2^E¥ù8~C#¨!z»6ù¹É¥È/VtråÈvÏ!@ßv\í
+¯s{)¢}®®â|óÜhúÅÂ	ØòWeÉñ0
+>¤wèÙê3Rf×]²Åp:¶æTÞ#ûÕ'Lë`+YOB(^¼ÄôäÑTy¤/¿t.d;ßH¼èqpD$í®¸céiÿh¤Á:ÄÝS-6 hô·oK¯Ç×z¦ç¦,ä2F2#K]OF0peÒDZöúÑÐ3[
+-wý½UYÖf
+,LS¬ÓL ÃøkU'Óq%ß*"¤(÷nçûíÌ³Gö
+²
+±Öø¦·	rI®N¸éì½ß{Ð
+-Ü²¬¹"+ÊzuÐÎZa¾Q=¾¡øÞå
+så¨RÙæ£fc-ÐNµU/u6¸Á3Ìðæ±çÙ­¾×Ó¶Ñìv½é¸Õ»ÜTÎ%"	ûAMFúûþKØA f¤ÂC´<m;R­´ÕÅ¹ùµ¹Ä<S© B!ØÄWÔ©	CãI¼5¤
+_®ú·ÞÁz]8Ðß6¾ª0¥;³
+`Ë?¥`/e.Ix\ 9¨bõ¯uz&
+GÀcKkGâCGQ¦ä¨ ?~ÿa
+V½vÏ&éW¬wH±gßK6b  7·HÇÙ
+-¸¸&ñÐí!¯¨_#æ"6®ü±½ñ©/ÄöÃsPÚFwË
+-kµ^BµËælìóJ@7
+HÈªeÌÕOr%úíkÜükcÙÔUR©ì5Èó(yÖJÖ)Ô2õI.*:êæÂáÌ«*S%éõøí{FÛ<åypëQ	
+-ëÜ2¥FxóoÖÑê:ÍÀ
+-y:;ÙÐ¶¡aszÒ5&6ÿÂÁOÏw)\L\}Uüã
+*Q[ö)2"ÍBöàïÂÌÇý½*<µ¹j>ñÔiäañ¼ã7=ø÷ï·qòïÖ½°e¹ËO)â% p4BßW?Kî¸·Ã©ònðÊ 
+U&GQ
+vx2+ÁbòÆ×ù´ïuíGR«n7 bOà0ç¶º·C¸?õá¦ùÑloæ§ÄÅä#T£7"*y|oâ)½ýA®ÐºÊWðZöþÔZ
+ºCËòUÞùxMãiöÜ
+éÉ)­9.]&	¸ºpdÂ1DzA6ôÞ]O®ßd{ÞI®£ø?ï`<¿"&ºãD´2%mJö4¬¤îõÊõL¶wÈïù»i&ãJðïybù2
+0DÔQ¬pU3æqïâ4ïªHÒyIq5H0v)	=ÑX,JO¾9¥Ù$ó§Æ0 tX:Ã¿Ôt®Ké^TgìIC¶«º
+ÍZ
+7{
+Îz½e¼Cô_£R¸múgêA#æô©c/Váy÷¯YÛg0ÖÖ|Âòöw%ssàêyòm¿=}w1>à>ZélÕ2ï¸AëÌ_ë>)ç3j;e<¿ÕÿÄp}
+-#é§JNdìx¿í¸ÔlãFuáúZê&ñ+-tÃq ³-iÐOv£GDô`¢á(8t'{*ú
+ïNrøa~(Kó¬Æå£	}i¬³I¼1~û)ÞûDî9»¤ÁÄ7DjÃIÞ5x¸ô¦·
+-} LË²	~ò¸iÐ V]îËåè½
+
+úTA@ÔÓaKfÎj=Nö!½±kxÝï	ç·6Æ+	6¼
+ÔâÜâhÊy¿åe#l¹b6#F_ôrÝÌ6º·jþhØ}
+ï a8njs«9ý@loTðä¾µ@Ãü3=qì
+óqÆçíî¥òp§ºYOÂýVýT¡'Ðö
+ÂZ×¢q
+õ,ÌÓ¿]a
+k41ÑÀÆV´þÂ
+¥}àfÂ¾YsA"K	
+S
+5Ý«*`sþÐÿZÇ©ë¬|ØJº ,¼$Wt\-Ö3¤â»þsÅa
+-Í
+-±U.8¸+»NfØ¼¾Ý~dÆ
+XÂªâsRP`õm'Õ[üúP®y­×<#~ivt:Ôgú{K®
+nùö¿>xñðîN4l[¿Ù9»ßf*ÝÄ!	$æÁz^uìÞwË
+-´æ"xUW$
+ÔÞüà@Qbò1?QýíWi6Ö
+7²tç¿¼ëÜpLRÉÞñ;Ûc®TèÐrØ#?Gg@E|ÎiÈôSÓÇryrôb)r&ã×õaªßìÛL7ÂKxÔBó^Ôö¢5Î²ïL9'a=0YKrh^oU¹u/kÁ¯ÃMàñCD4³jÓþÓ²:ÂXOJÌÐqÁ02JØþÔþ<;Åî};ï¤p!ÐÝ4]Z
+ù-!fPëË)¾°@ï,ºÃ°¬Y¸
+
+²s6pIÝ%`¼]7)Ü¼öYì(²ua®t¬¿ïµ}wÍ¸òº:hØ¿ýMyásí¡¬K§%XàÔ
+-O×¶-p±kgO¿i-o/n.hP¦"IX£UÕ¨\ÃÝñ SVø-ÅûQ°H¤â;` 
+VÔÅ!Õ0ãM¯ÒHªà>9IÁ.
+©JcPø¶}'	mÈîUF>&&wñ¡Zö¯
+fDbÊsZh`e©´ïíc(Ýû"sy)/x¼*ìeUe?gµºÇ­"©øÒs áôåÕ	¿DÜ ßq
+Ê.i'3&Úî+Bú­Oð
+-bÆP\Ä3îñaªf}ÆfHþ
+ñ&»G²ó'êyÞáWàwÑc
+-ÙáwôÒià¹ÕC[æÃªmÓÝÂð^h:&[¼LHï°{<nè,M,
+MÓç¸iã°HÁ~
+-z³@p=òO%ß\	ÔTz)0å¹ûÄNZ§år]´}"ÅÉØ
+BÄ|Ëõ¬?µÛ£åRMNÊ#¦P9&í#ÏÝ­¢á³,!#¿½#¯±öðéþýæÍÈE±Ü~hÃÄ*ÝlIUUêiÂ7!~ç;üI{'¡ºÇ¶WÂg¹
+ë.ë 
+^ Äö PÇÉI¨Ö;S4ºö
+oÕ÷J
+ï¨^u¸Üç¡ubÿÀçÆ° 
+-´Ü¶Ùº½Ô·ikâßvÃâ³(eI]i¾Ç£_Þ.Ì_s%ÃÄÚÎØgÈ{ìkñe!ø"õ<ä·^nxà²uñúOwrnä/±K=ÖÏÛ8ÿö-¶»ÿá^YcBß¯áY
+´=ª
+&Ô¶åL ÓÒKõDÌ6ÎkT,Ì%ç¯EgxÖ­B&¹'¬1èª%¶aÔÝHòa9p6Èmú§÷É
+NmpZíÇJgí³z
+¨ÚÜfë<
+8°«|u-JËÉÏñËÝ×O[óS¬u«¸ñàÈÞ5g/ +
+¼Ù©Ê×W/ó.CÕwÒgF
+£;|NÉCø×d¢3­óø&ÌÛØ6-q?°º¬³°° &záQ®­­r9ç+CYhP¢_C<>Û|úäÛúö2ÇîzHôO&¥xU
+o
+-? %òøãï
+²ºißâdø\ÿ
+ÕÌsÙr+Ïb@Ü¹w]S+ aíi¥ÁßîÌ^¥¡8 e×¹CªîÄ%e5rõE§tÿ[#þ[>NI3%Í`À7Ó\W
+-«Âv-ígÐîf÷òw& LéEökiG
+-ýÙLÞu§Ã´³ùåÞ£6|ñ~n0É]ÔY
+dóÆR/¡@.-Ý<DÔhpØc3tM*Îá²gÉ[¦
+rQÂXÆ
+¿<¤Ý@(yÙá
+Þ»<¼î>¤?Ìj	åü
+-ÞhÕì¤%KUXì©U÷¶×
+õB«pîJÜÕFN}û¯ÒßBÜPÂh3Tøú6¯vI/x!Oü§Òà(«ÃWÔ>|û¨ÀÓ éÏOg<ÕeÏô´ÞAÝÿß96÷îÌSaÙúcäp§Ð¾kAÖomÜ3mÇÍËXì·²)÷´ý#y®aIpUûGx¤ºn¼ÙáÙrwúÛyc$ìtïú:Ù82¥þ|û§LÚÎÛ
+ùþY¯gI³¶[9RNz
+-"Ù
+-Ç­ú]{Ç>l"9M1:_13MIÎêz/XJLX-vhYÉâz²Ás®C¶glTÔvR{¤)áëô0ÉÛÄXýÁãÄdÀÇ×
+uJ¦?zx^w`¼ök2Ù%÷õ
+}Lßêdq½ÀÆÅq×g_¸¤3à¼_þqoó½¤Q5@zKN­µ'øÕ+Á¶b¾±ê³¾Iµ»ó§®mÈºvï¸øíÇ{YMmv¨Ó'l¹NÔt¬e71¡éK74'úÏ.H)Ñ
+iPà(4r&¶Aòº¶X­aÆ{ØÝPÄ0
+~L?µp`G=
+mwHE"«ý ¨¿6«º»
+$_}7Ð¶«82Þ§¨¾Ð¯ic`ÐWÁ\¼hGÒäq´Ð·Ë£|ýÖxV<øË¨Ð K*[4Ò1B2ÈÿþÑ2å×øöÜ%¥/2)ä§¾÷ßâß¥nÄN¡°:UäÂ
+-A¥³ÞxÎbXñ'7+ï:úkÑÅÁùÄäZy)òÑæázL¸U´
+-*±anæíAØÒ¸Q¡Úgq~j9$E,Í4²KJH£òv'3iÎP¸¿wêîûB}(.OÝ
+ñÂQ
+ë t	Qá:±8
+-ýØNX
+7ÏOª¬Í
+Ô¦¥S.ëoõÀÉè¼Õ®ë
+
+-
+-÷PIp[í~0àÉlæKõÒå3Ú¶täeeºc\ìÃÆ³:néâ`_ãZ/Õ¤Õ¯þ ºØ¼±3Ã`T	£ÜT--9ä¢Ï$È, #ÓÑÂC¦Wk-!dva¯¥]tmon?{écæ´P6Vc'-iÅRL­ê`CéïT³vÕn=ÂB×´+¼ß$éYNBÀ³öZÙ7_¶Ï(¡nPqçdÌJ¾/üÕî`àz>£µí
+÷Y2-z|J¯AÉÊL,¢%¼DB3ô³#|ü¾'"|¿7t³|>ø7R×S¡À
+-/°¼¢*|ýx£pu!riG¶4áèrfG
+´î<¶eä+eÑÑ>o²ìépDÁ§n{ãªÆÄ#¾ú®?ÁNú$
+=Ý£üY^øëÛÍÃ­³´µ2ÎòvxËím(®Êf½ÖZõâÆO~èÅéP8£ª_³ä9Â/'¬ï2âØhÈØ~ÝN%Ý°lD§ïo;f1Õ/? äEmÀOÕN~Ã§
+-
+[ZUÆñ÷}ÕJú ^ëcìxtÓ«Jt;UI¸''þÀ:`6Òz=MÖ/|ì×ìÛ±¡z{ëqõW£óÕ¤³<VÔ5Ý_Ã0¾Rñ)`çvRÑ»O
+3À
+&P¾òìÙ¦%bZ7á­íçÃÇOdø:YË¬îü|Ï`-/Ì·&nrñê¨]Ì¡ùÖ<_¹eH|ú3ïVÿû7ç	ÎÈ÷ãR7Ô®qi!ÿëà{¬k0¯
+^0²ºÇ3ã
+-ÞPnòdýyüÑçkk®H¸æâÙö·øûé`èSìÊËÁS<ê*8
+-xîº7RáIkcçlú9A@òZ*)©kºèÇgAtrA%`¢ »§5¥¤Î]¦Ïåû#ðºþÎÝÔ)lñ}Nµ.$¥â ½z®ÑhÍùÌ~ÃÕñ
+2óÉÿøg%Ä¯þHôHôW"¬[$U!\
+-<&r	ÂØ7¥ðM+ðÐ?Ó
+-mßrâp&:ßÒÔ>©%ª¶ôÜ6Îq0|ùÉµÜ$
+ÏÁn_=æYsßi·¦cúQ¦ÆòZ¡
+V^ÝQñêË²;ø9ðfÕú¢¡©
+-ÕÜô-ÊÙ0Öù¶1,"su©#©_E#¯#X~/v~ôFg4£Ó®i\»yÒpüO»äR¼ãeQðQ¯¤TÏ
+-vR
+dèVÞúå5_x¦/
+{}bãÊýZfYò#ÆöGR·XçÓåvØDy¼1¾÷C:ÖÒúAYKOÚ¬:ÎTÉ&2&+9ÆÞp¢Í
+
+z¦,÷	
+
+@Ù>£ÑDÈ
+V 5¢
+ÉSR>§Þ¯KP¢MÒ¦£$%ËÀ³
+	"hS`ëíðçhE*¬T°IN'gÕ"<è
+ÜåÙ¤_UX\¡Od¥
+->Ñ¼±[ë¥ÜØ	¶w
+->Ñîþ&n(Év4ïT¨fï.+:¥êGÄx1
+öÚ1@Ã»óýØ¸@rAVVó]RZÜÂó!d&y?$TF\K+}z;¾vãlrçÖÔÕRÛã|Àà¿éôwú%4d¨"CËýÂ]MDá8éRÂõ×­"d2¦àÏ
+ÙT;_,ôhó÷OÃ± 0WYþÚ!Ö»ÌÄïÉWÇ×6 1×SíaÀÇy¨ï:-_<$ùewpmcáW¡ÜÕ/z§J¤ä
+þ Ý8ÔvM&Ö9ïdEØ¶oÞp\­¹IÑrGqÂôÕfzÊQØKs	|ÄÁ0js]ó:·\ºö~G<Æ;DSyN¨öþ¤b,¯ÌWç
+-ú6ÆHTp\F¡¯Q¡ß¬ö9PZ¯sR¬ÚWP£m?ËÌåÚ
+áUQól+Vþ{@ÊÉ7Ýßì
+ÔT-â³Ú°i­6_lºñàI?·æãîDB½óÏ@«'ä·fªÛá^û´h+
+ßO©{õRìý2Ó*3ò"<s«@¸?X®ù`÷¾8Côi~k°,>i«ÎÂHEZVµÇìûf¤ËnÃ¢eýµ¨Cfô=4Â¸5ÿëÛÐ$TT]
+_Ã{7vµ:·m«0ýB)&R»Ï¹¹­¶ÈWOz(ïÕÌV
+s×kr11àiËÎ	¿<G÷´][÷,hàsþÃC¦KõRÝR¤ê¨Zø
+!´ÖÐdQè
+.B Ì K5ë
+CÌ7cm
+Eæ
+-SÏ@1ÙÂ¸5èã¨{ä'±-~
+¦vët:ò
+8z>µØ¾­>veÉÛ§î¹QwôMâç
+etÖÄÝ¶z®þ©
+-×u«5
+iý'=_²jdûtåFÒÜïë¹
+
+-ùâBï
+ÞzJ¬ýpÛ	YZH:u§
+âUµ
+-i¥v89+rFpU¡¤:÷IeÂ
+*¨(?zq7?¡e»­Õv~^ªÝ)®`\ÉR>¬§<µÛöd^[
+¥·ÙýÜÀõ<åØÁk_øgÏê/gsbðoNæ¤Ìï¦ë+<ý*@Ï^LÌæ
+ì'
+-
+-¯b«u!QÍrrM`ÄTXDäQüÆGÚ¶­$ÆG5<¯Þ
+öO
+0Ò´üÊ§®ä
+úQº
+Æ
+á[n[Çrù(IhûM£ÅÓ\Á_[Òk~K¸	{-¾³§ÿkÇÕs¦¥HpRþ­í²þ¡-`åã>*×ö»¥Ý§u¸Ïpúº;±S÷,XÒsT¶LsûÓ/XÉ/?~%-Ã0)ª;c'vUj7±¹HL^
+TúVXµÚ¢"Ï?ã'fv6¡¥±ÙÚ=bÓgÓ"Ëlx
+ôV
+YÌÖN6ÇÓ-jQ§çÇ¼Ä.§xçKwqo\ñ³X9½=¿^}s	;¥cÈ¤²ÜR3DÑ4Ôî'Ë
+®x¥'8°sz`_×nª]øÉ®D¼Tdòµì´_÷IÐ
+{¯ª%
+Ã¥ùä3Ña[)¥Ñ¯Eïs­úJÕÅq<Ã_Á>¯î\
+-(*;êVÎóYú'·ÉPR÷ä`óÎk~äÝI?%]X¢oÍ·2a|§
+;(®X'ã¤
+³,>
+-ë°×*þÏKwN
+Î9þÙ\çn2ÅìdE¢"öðÊ,O÷1KMÈle3Æ5#¨Î?1ù=@þ
+&:
+-;ÇoüRÌ¾Ýú­;I®¢MHæn{y60T¦ö½Æ[7WÍ³þ4²Ð.b;ôTiDÜ	Si
+a
+-Ö"Ö
+C#È1ã
+-¥(*è#×¸Y0)ñ@lðõÔ>!úîA"o§Ù3z¤ÙBÑ¼
+ÁúÃðe
+À¾Oãõu*¼B#ðrµM])Q]á1¯ç3#ÆÅÅR0$Uüp¹Ñ
+úÞ&Y¹¨wâêW7Owÿ8pqïØn4â¨,ÍÚÂHOw¶¤P&¸n7ÁæzÏx0}í&óho®Òµ©c¥Gvs¸W=,x$ñb
+z*·KÉkY¸³â£°0¡_¦éÀÔ¶R1¹®4Ý¾u.bÏ&ZTL(Ì:=ç|CHÜÊ[v.8²6Õ{RµçøÂÍ¡^<ûçOù\#j¨ ½[ZgÛIòn©Mz¥ëNõ¢ì>B3áÊu
+&^$W`ãGØ$i¤W¯|FµK](è[·
+-w¸Mo±ßÈãäd>g¹ö=7ÂO
+üY ¶`rTáÓJË¨g±¦ÉÃDsUµËa{¸ffëïú©t ÒìnÖö|±UrZ¥©PÏo ËE¾òDéÛÇÉ·TÁ ½Qn´Sº¥²ÐA<H8CPxVZÃ¯9ª>*OKnÌRþ4ÔG;.Þ¤¥Ýô|uÖ.²
+
+M[Ã]u÷à©j)ÕîÔ×ß§1ÞèÜÆ.»¢(h¦
+ÑÆë¾1.
+Nró
+-÷$TGKõµ7óÎ_wøcV9fjØÒ«ê ¤pr
+Ì6,e}ÞÏ¾ýu8Á+zAÃÏÝ. eø44\Ñ¦
+³&e]9æ<rÚÏ%xw(æ;¶ÃøkLú<D+¤èc}·Øjçèp_ù3ïCàÜKXkÂqB(â=ÇU»V5ÇXW4¸]c7+ùpø¥<Ü
+å)=õÊ»twy;6C°Q»È?HDéO0?î è	¯'®ã)Þè/c[pÒd
+ÆcR¹¢^î8Ø¡Òj9Wx	ø
+ÍÇ$ðóîE-#<~æ}
+:|±-/ÚÍ¢*ÇÈ¡LjµXBVÃ¥yTÌ6NJ^?JJ#':9Tð&lÿ6ÌÏÍÂx«¸WY °6Í[2¶¡_°·#ïù£Í¬õtÈTÚÂ°
+Ùí
+æöé\}Æ%¹~
+Òi~C3KúJ¦<ðERuÙ®ÒÒcp!+ óªZA@0p´E«-·&D òSÐuQbWcdN@»ùi¶'×ÕéÉgÑNßð^Ü¼¨òMxV´#ü÷n÷äµ#Ö
+6ÃºÜû_è»ê?£Ìl
+J-Cx­ÞàÐjÈÚ)ôÍ~AIÅÙç eK$Ë.À98ö0=FÛ`+dÖÈÞTW£Ìv[ñ¥5Mk*åÿ<TÐUÛÓûRÇx.?|É?îÕ±ù:xEB47#Ø_õGä!CÂØ
+íRd¡n9ÎD0[©@$Üú
+1²¶ù;}²¥uø
+Ãi¢ò°÷Óù^du·2j.ÒFÄ¾ãMEÿ<Ö^ÅµûÏj[a£®²/·
+;:?;/ïÉ´WsÊprDÁv²­­}åonõ^>ti)Ï×Ç:±h×Å i|­dïöÖÜ3j\<7j°ß¡=¯¶EÔ<eÚªp;ÌGXr³¤Î½»ûºWi:~K¯¡±Í$t;ô	{öZËE·4{
+8Q­°@?# y#Â2Y·
+-gû
+ÃñáK·lÔ)uø(áuSø*£@Ì¡°»­eÓ×ä|v·¦¯BÅ{­
+-L2ÝÂê"MïM{D>)³àt·µzí¿CÕW>ö²e*¤Ó¹
+-³X'v§æ%¥mÍ
+L¹lÎÛÖÓø:ÆENÏq
+$Þ8.+|©ô®äºÊû#»åOú¼ÇTþ²õi8Cñyóùg·"Øù²]§v+J­Rk<Ëæ
+»Õá òÆ{o:²Üó¦RêV	'o¼b
+gqÎa`¦bÞ|ÿ:*÷Þl¬fÊ²|$T)d¿	gi*'*ÙÄ³
+G½À5	B÷ÂîÕXÚäþ/¬r±´JW´Î!°W¢:+óF
+IdôK<O
+¸7kËTëÅpû°ìò1|Ûð't)¥æÑ/ N¿íÖz¹ÏáEÍ@ Åº`¸öÜwöØ£¥¬1!gÛ»ûbe§ß)6õÚnZÓÆQázü*
+@Ciÿ1t:[ZÁ?t¨vSYºf¤N#fêd±q¶¡©LucjG(Eh6cYkäWÔäx¾ççøòoc=«¾|}ýÒË?0Á!f
+rª}5%8mÌÞ}ÜÙ®ÛÛ»ÈÃ¨ØSÙ¯\^p7ÎÑ±FT!óÁz|?R
+
+-,Óå1Ú<ÐÎFim}rÜÆOââB\eÛÙN5µ>Ù>
+`K*ë
+1<í¡B¦XvÆÐú-è(srBJ`a
+ìkcñtõÉ¸ôö6rÄ
+Ì½Zûdçw;À²­e%¾GÍ\'Wí5ÞF»¶+g_óüZÒë
+{>Z(Ë-3£Dw
+Ü·ç,Yæè -w}ùmÒÃfnWôó
+$´q
+-¬Å=ê¤;n@îq¸Ú6BÔ¸·¿rµ§Àóõ­×±siï:79Ò´Âêqw<ãX¸áÕï2oºÁ¦w²$
+éhùâË§ê7¦¬ 
+-Á½Ç7²éß/Èú±|ß?Xn"b+d!ëqÂA_Ux[ÖÑ¦èX÷l)ÁÏÝ5\°Uc)^qK×'W¿ncRÎgçû D¬Ê_æ§G
+û­e·\¹ç©|Ë(¡1
+v	! 
+¶
+0^É%
+¤}2Ïuü
+x}ÃN
+T1ïn]¯ºÑ¦ôt&NÁî¾;[¤àæ_¥þÔøFUüi1äàaÛaR#i6OáÂe ìçbuo§§![¦LßNùWvF5ãsÑÐÌn­ôÜà{]Æ@8ØÚL`ã'K ´v3 
+QHð%õªLôÍÓèÅïX"_L¸ÅS3ªU¢©c2¤HêZ©cJa%Ì>K§a­2yÖX[g	ÚeÚØPõEî'¥a2qõ^KJ1´Ü
+9¡ÌäT¸À6ArÞûô:®^« ÌÏ¶ÁcÂÔp¨·©
+
+çjFH¶¬STªÎùÕãA%/p¯Ô nqåÌRb|ïä¯¸àÎn èë*ÍÊa)ae É°Ø¸>kk¨{
+õçv»k]2;@Ò÷å´ð!	/yÉ
+- ­¥YÙ!ÉezjÈÁc{¼ÿ6
+Éº<y(bedO7ío³³$J=?z £BaüÌ\ñêîÐ
+sÖU.ÖßyM
+PbóIi¤ü|qVGà
+G½Òã£
+U´jtÂ¢}X^u
+-à[aëç«D)+×õ·%¹óÝ´5Js
+zc¤üvÊÌ\õ°þ<û
+<<d¬Ì ÆÜù³}>ýQÆª¡/W^M±¨þð©m®a-
+-Þº¤QzÔ5ûMj:u&Ê
+7=¥ß^ëI¶ÅzN!÷Lç¤¾þ_´=Ó'.NnÀ¥ìð¥&Â¹Êõõ]í
+l1=}
+!PjdõcÅ2t°aX_å®´­lRìÆ:T¯{YW¿MÞ<ð`(¦4
+ø59&³Lg!ÅÜÀ{±j |ÁúPîÅT°8Â­& úEaEAÏâ¢ÆOÉ¨
+[dF¬/`«tvSÅÇc0_yHz»Y¬y(ÛAî¾1uQñÛZ´Ãò\<4csþÖÆcÀÌév05§¸Ói»(¿úÏúJ«ÚoeÅûI\DbR,9
+I	ú9Áìh¯äì2>í(ËµdªfN{F¦¸Yÿp7lòù8Ó¥òkv×N¬÷%¹Õ¯6±4sÁVhLYuv@ké})óÙëåRþM!|NX»²í³yFA
+-øwfyBªà£ ûïÁ4üÔ{! ëõF55o3¡ÍÑW;2h¦Â8Í+¸%wàÙ/µ§Ô¶ÈêÁÒTÑ·XÌë¾´hFwð
+
+{ñÄqô[=lá§®NO?£ú¶Çg
+-(t3á`
+­[ìf¿æ
+²¾ú£­ 9lVÌp¬
+6/Y[´}ñDÚÊPS(Óâ%1ýL!ñ7Ôá·ñ
+0âVÆêg±ÃºTÞ¿|.óh¨*DZ
+-QK
+ÍUï¢=Îo&7ÖR¹ÝÛ6pLÖÄ!¥=-\
+-¥\Gát
+~fD,¯4È9¹ÁÈMY¾
+-@éjt Ð¿CY¯Äë°½âÑC³v
+³aµTÛtµ#¼iPò×*Gpßºxb*2¢¡ùm;ÙOÃgá>S${*35õ#ìSº¯­pûÏÕ=Z¬cß²òMzÏ¶Ü·ySø~AÓÐ8ÿÜ¯o³#Pê¶²¥í@cÍ¯ù4níï¡\5NCk »?A©ö
+%!ë×n&ïáýál²KU²R´_E
+¦íÚ4æî;÷FÈm
+O¿etóïjÇ¦9^®´tu#û!ÊR%¾7h«äâ"r^
+-ýÅ%óL½e¢XÕª+¯ÓO»XiXö-È·
+©w«	Ê[Lù¤V§O¸0å¼¡ æéù]7H	ÖhaA´Â.^TG\q"oÞ0f^åu»ú/
+9âñ¦FÏiSÏz@Ä05C¹@
+ªmÖaYê
+øØdQö
+¤×;\ÚFÇhúä¨vû²^¨Ø4Òá°	UC¢ï÷z´	Ñq:¢Ý~ñxürðýÓf#2ðÜúÒ
+-Ó(}uÁM÷|"7
+³gã)MêKÁ,}c
+ÉÁÉà`ª`utóçÌ¹Ñ©¹åÝ¯ë¢dbáø+,íÐwa&\în
+oìº¹%;bÉú¹Yõ¾P[Fs×Ó°yGóÑwázÆå"*plÁ}ßw,kbùí¦:pYÉÉ%¦Â¼éZ<$X¾´ßNþ"áPòó»ñ3~-ü7u%ÝÙ Å³LÍ­¨}®-ÿüjy¢+Æ°î 
+õyY¬B§ÃµèzCÌöÔÔôQ}+Åuqv³
+Ïû§LÛu[=ãN;
+¿Þ?fâYkïº!FÜ¢6Îa¬ô6g~M©7O×· ÑÝ*ÀñÅjH/k{°iûk*4PÒ»Þ÷=Ì`±n~TSÜ­cYA.Ó9Ö'áº(_Y£ÄÄãler8ª¹Øk£!è´XmÒ\ÖPàÜðû	¾³p®5å÷:ÊQGøwþðY¼­õDy(eÉ'mLÕ=mrÂ$¥/É3{
+-ØzXR®Ú²àæì<Mv¯Þa¬7
+*jÚßp²Éø'³rÓUM. ¾f®X$÷õ¾Æ2GÜ
+Ö6A>zØÀjÆH9"h
+-%ÿ^ë®jÍÂëÝF²m]ÿ^SGÈ:ãÏa/ä¬G!0HÞç]IÅÍB¸íågÎGq,×fÞèéÐÄÐì3NJ>]å>l48
+-¹
+-ÿ]Ù&T¯¨nZâstñÔnN+ã¾Ã·±[c¡-TÖÕ,OîH¡=ZæTé
+
+w
+-y))÷Þ<ù,x8FÁùgd¯U+ÆU[ë`±¹püõ¡jëå|#²UÚÂ¥ñ´©;üö"øó|Ây³²$ÉV¼È¼á
+cái±£	çön¦NÃsx¶Ñ®÷è¦#+vW¢a²Ñ
+/jÍcÑt(§=dµÚ6Ç¤Ñ P;íô=k[ÞÇ:Ð§¹xJÇ&$
+}Ê±¾pÓò¼I
+âfß
+µèW¨ðÍ^ÚtAPI7ÀI2{È>¼¦
+-@ÌÿbÕ­'eÚ¨¡Þ¡ä± Õifl·Ú%R2ìÈ¤¬AX³ ÐNÏHÚ¶ÚyûÑµÜsI;g!ºp=ÀùÛ«
+ÛÑ³pþ·é´{,·¤âêÅ:1OµÓRÛs
+-0zsò*ÚÍ»ODtOGJq|.XÐ
+eìlï
+Éóú
+Ei@µ °/§)Nm± õû{ÒU
+-8åÛèÚ¯
+½þ
+y2MÈOn¬ZvyØûò¡ÒÏAQßbJNeÍYo´Tt>Ø"·õÙÑSmva.½ìxú}Àsí[ÞTÏþ³«Áù|w®6ÁÝõQm	hrQìXÔ ºêTËj)uGìPÛÉ%:øªx/ÁéÈ_è½`2YÕË¨@±î=¥øñp;Ë{
+^ý
+ËÜ
+Ïúàï]ð¼jÖJ³ò=S$îÛ«çècuHkk×ZÉ«öf´'á©»ÙQ
+9þómB	î¬|Ä(Wò]Î`®,»Y~*½iùÄoÏí[7$2ÒDo¨U·¶.
+,BÝÄp¬ð Ë
+È"	á¼dRÊý²Ï;
+Â-_27¹¢ñ©À`¿Ó$#AlòðõUØj±Q)
+«ÌiyÂSh1äB[`L,¯F
+-.=Ã'PUîª¿àÈ¸£C¢gXKû5ó·¬Ý0Î*æ0
+|9>¬ìë)ß{_x­ÖÐz e
+Þn!)ý R\Ï
+D^üÊ½LSÇöó
+ýLÔ\´ièaVÌ
+ÛÆQ¾4Öý¦ñùvû©ËvÚ¡6ú)öØ!ÄÙ ó<üÎ(ß¯ÜW)@
+¬+Ûýô:®Ú1ZÿBÜ8¤g/E]¡A
+ÙÙÉË£u°¶
+^DNlÿ=ÛGW}ëR.ÂeÀ¯\¼¥/|ÞYÜ{ýPÉæXlJï-º?ËîØf-²SbÞê¼
+Þ¢ÃxrÀÚÙveßA ÍrCq@LeóÈÌÚçò
+î
+-VõþZvÞwçóU¼==
++ÉÍÚùá]¦q\I¹é
+dcÔOgã©
+[Dgf[ÍPÐúppôV&ROfþ]&a
+pé_®W}©-á
+	#WÏ:÷U YpTÌ^ÑVêU{©ûT3íQ¶]6øÅ«½Oº§Kî!Æaæ¢3{lTàzaêÖ
+-S7æÞþnV?3äÜB['/`*Xçj*õ§s
+âwN
+PÎ&qÊ2*H*"çªÎc»¢ÓýF¥11ÔÅ8iÿ-Få
+-÷8ä«[qõó5p`À@Ósy<ÿXTaTö÷wUt§ùT±
+ÞÂðÐãÚðl/(lg|Ý+4ãéÖve
+cA	7çJ>3jlHÝ}ÞÔcß8Sx¼W	¾Ãed}ì$Ø:í3¤fUq[,×Þª[HæãÑ±_¹ #¡ìh"í¿´¥Ä/G"ØÆüf9Úw­LÔ:>LÆ'[Ô 0Ôí´È7:Ñ
+-TÐ6±ý
+õãwÏF¢~ýô;µ&/©DgÉYê÷¦~äÞÚ£
+¥KUÆÕ:
+F'å¥¿rÒÚ²Ô!»ö©Lÿûa4fM¥kÂÁº]ppwÒÆi9¦cÜX	¿ÆÓußAw.N´Wc¤ÁÏE#?a8Ï
+->D_~í[
+-àFÔÛke`ó½9qö¾Å5m	¼¹kª
+-PnÌâÈLGü
+´à#
+-èû@$ÛÁV$.0T~Gâµxïbo}¤FÕFd½ZUS¶ó²°ÇÜf¥©ý
+u¬ûÁ(½#ÂÚ¿¶Ðä²×J=}'Üâ¬bd> çÝ0Üú&;9p
+-õ3¤vN¶òþ+!k
+ýG	£'Ö|UH
+-ä¡ßðÐÚìO uT°¤¾`û´¥CÌiä¦ÛÐê	Ù6U
+-}K|
+êKLQúò¸çºJ
+hEË¶+ô¬
+
+
+¿R=pØK4M×§¶¨öå«~Ä¹ÄãÀ·¡
+-Íó³¡
+Û:®Dk3ýÎ¦-ãøu¸Ì"ãD{¶IQêíó^+¢Þ½ï
+.+UÍ!ñaÊÅâ-h^w
+#|Dæì­$îär
+¥ºÓ´ïÏñ¢"£ð ;ë`éH"ôäáÇv
+ß®¸ÔwôU¢Ô@ôÅ]Á7e±Æâhß;hQTãø
+Sz&gp{l£0aC6ÈfS7â
+ï%'Ä{Ýî-E)k%oê9ÿX¤ÎE£»}0r'ÅØ+ýÎájué¨o4ð+C.j
+ü
+-%ö3)ßF³kÒÂÛ®ë9vªF-Ì÷HO8&ÌBÓñçþ«éÝs¸XTÁÖh²f<yäÆO¾{
+- ðR(¶ñen~&_¡a|¸ß^hü>bØ']Þ×Ô"Ï_X'ç
+N}	®Ã3ÁC
+FîÈ	"ñ2ã´SPá¿ªý8
+-fYE¶âC¬ÄÐì1ubÒNõkÕr®­êÒóUÍÑQ?~à<mù0¯a¤úí{ï»	
+rÿà7
+-­¨ºöÉ
+N$Ë®Ý=
+ÏJÝ>9óÈþyt!9nÌ1÷¯ëöËnßÝ¼ABy2ÛW:iÂÔ¯ÈÈTé3¸1i¹À·
+5>Y>
+-NVîéQá¥ãÜw.Á%ßâª2ü×+¼úÆLm0#^ÂA^rµ%ñÕjÂ¨Ö£¨'þmåÝ.
+9Ô5À­(4%®ðb!RsJFZYHl³°Uýd8ËÏ,\%'òª´
+¯(l¶ ?M^ï#³UÎU°wéq·¾üï¾n¡
+-Õ#»äÌÍ¹ÿ'
+-ðõ
+§Sàg¹;VÚÇ
+-ê
+br{Ì)ÑÀ%3,5 o3ðpOØ>r÷
+{ÍáC}ÙEð¼dÉ¦ «kWOQ82UtìÝ²-CJ2É3/½ùº/
+¨`
+-j|¿~× D1Q{*
+zT6ÒÂóÍ{êÀn5¢äÿ/ wäª^óVtK@@çbxR:ÔJ EÒ»¬¶âÀÝeD¡ß	ån4´pê¬k5;{9B´@ÀÅÕØAJ
+ xTÇäâ´7G8ñ\¥[ºQË
+wówiþ5s±2j
+[J`æ¬ Nüo}æYíØSë
+;·: ³B7MÓþ|B²ÁËqÝ':0qÈ¹_·LBâ¶¥
+·d}áxó)^¡¥àc
+-ÈÑq1¢Zg
+-Êâ¨e;HzrwDñª· h]îó×ÁPã(<
+n¿ÅùÕ62µ£o½ß,.UC°ÄC¹Â5ÿý~ùÿohIwÙ m,b'´¢ìx·¹Ä¡\¡\EÏz¦óø²LI$
+µ+ÙðRõ%9ü´íð8F)»¤s¯ »Åíó1eÏ£ÒÌû"%¸
+-ÖQ]ÀÎ¥êÏö¬#~âÛ>gfÀó!ÓÆá±>5@¸Ô¥°ý,.ÊfD	ùÇ
+`*LOeåÂÏûFúf~&¡dW» S)<Hx·ÕÃç$þÔwb8¬=«Ñù
+¬³PÚ¹%»ÅiBA
+
+FìQ`ºÌÜàuÐÑ·Û< ßÕ)Yv§«>¢(±ØC£LV#ùMzsy×5ßv¨
+Ê 	Ü{ûîàÈù8å¿þS+cu>¦;_ørùÌ FK2#Z`c
+-N#
+yÁf\¢ä£µ9aØ
+5#¹âÊê62-¹½/MÇÖñ#½c
+þ{¸cÉ+¿müÈ¡ Þb²ôgÍ) üLÀÞÌNüámòß+TêË#Ïkn#Üs¼ÙPP¿¼½^ 8#DI=\YÜyÉã
+á}ÕÝÌ®Û,,?ÂqrýÏe1,'sÁWR:¦ZAå°P]d%E
+$9éCÿ)Óf­³ÀWo³³ãõ$ÿ½kv`´:æ
+ÆvÀ&Ïê
+iü0 &Vÿ,âeori:
+ÏÀ(qí Y×
+-áþ~¢ñ»N [.dµfrÑAûÝ·zÄH*
+
+-"Öo":nÒêáéýTú_¹¬*Ï¬5Ã(³6Äk®TÄÀÍ¥xõCü<ï¿ M´tÉ°O6
+-²7øe+³a4Áfä²7©²EÀJØÂ©F [UmëlõÜ¢ßåx´oà?Úý7×¹'%
+-ìÁ2_°chëôI5(»Ù¶â÷Wku±4
+vÕ7ì#
+­Å vJmÂþªÁ6¢Ê4kÆr (@roþ¶=Âø?F?ìÖí£W=4`|È2Z¼>,ÜSóDU"©Vc·ñ
+Ü®
+f)Ò
+-s¦üªÜUui»­<ÊóeÿëÐC Wü·¶s(K4]-pøB³,í³kS,7Àè¡#Hø;ý-*í:ÔEn:g¿åý*¤¥ Æ°.W	WDÿyæ³iHu
+é3ì<ËyfåÃX&o¿öÜÊaëÿ-¿
+-­øTù¨±ìËÖª©R¨!-BZa2Î@ëdS<ÉSéi#¯B¦x{FÔ{ÿäð\þâû)cL­8ð¹`¢ÏFu?p
+þ>zpp¬LÈàHñ·þ9àMÍd&
+<÷ãûI÷¾.ÊÄ è([åó
+¼b7×äpì¡Þ±ªQ}% ð9$6­«½&Ny
+ïò+vc³À×ÒÆðìf`sôc_
+@
+Ñ·XÁ!Djï³SÎÇêwZ1°L½Ü &ç
+5ÛGá9kWá±qù£cîF
+-F [@ôæA¥ÝU°uÈàíaúUJÒ­ß¸çJk0Ï{ is
+-
+-«ÌoÏÊ³ÄàËÿ%µ¿)-»èÝ³þnMë(ºlüdºæëvP§îóq:ÿA~fÝsNÅd-xAñ"õ¬ 
+§âeô¬¸ã
+
+×ïLÔ`a{_CzÔ+²`¦ÜP4ç>slâæj{úÒÂÄK1hIÈ 1¤Ê>|þÎNÕîZÜIoàh¥$.©`lQ	{)óÌ$µ«ú½27MMaN8lrôM5§|X¬¤wÝ?!ÃtäÒâð%1íZCb[âc¨ÏÃÓ':hâ×U'±LaOê'
+éòº YÄ$³Y¯¨í3%;K0#õdô
+FÍ©Åä@ìûOt4i;x© liéxcj´3ü>§UÛ
+-xjá±
+K!ÓÂ&ùÂ
+!s¹Ë\h3
+-
+º×v¤£±ÖLü4Æn¼ßèn?!wµãGC¼pû¥+·É}¨°#R*ê°zeNöpÓîcãÐw
+u/úEaÁùZ4÷N9BÅT¸gÂªýãÕâï zÑDGzÈÝòAlÎä(ópmµpW¯}0ì\«lX_L5%SÝ~
+jÍz®¤åèsd&þÅÄÚÆY¬ª-»¸JnÏ¬&ú²-±úÞ#H#Î·UÝ
+¤×Zdo´ï4VNÔ(ØJÀ¤hèd
+-ÄæZ26îÞ
+êN_/Î,Ùl§©Í°2ÛµÙ]1ÁÅÄ¶¡`MqÈðø(ì©ÙvÙ¬ÜzÂ¡× .iÆ.u¯©aÍ8û~çg	üLÉ'§X3`7/±é®Fòüú«6Fmd
+-âìØ(NÔÖGù>t7Ç!~REbÁdÊo)°k
+es» SÏÒk7ÔD½zRoØûË3@¥ÌÅÕ®h&¨m4ê6¥Q/Ï.lZ/Îxm
+ ìÎø<«°\y 
+9B¼Ö§
+-Û£liÙ-ê6_6ø2	Õ?.£.¸F%4òDX]ÝQlø~¥epÖ
+-Ý@K9[Ë©C
+Æ|,àñ8ªÌf51°I@5§óq£ÿ¡%¤hõÌw1ç B{báé`èëÄið
+->²¨Câf"u·R{bM åR¹«[£¾÷ÞÖâ`
+t#U=¦-ýco]ÔÅ<ÄGã½A#¬×øÏ,
+-½ÊÚ M0ÝÜ©Ã[w\jïàl³J@>®N­¶ªíEãCÑ¦ ÚY
+-endstream
+-endobj
+-757 0 obj <<
+-/Type /FontDescriptor
+-/FontName /YHSZZF+CMBX12
+-/Flags 4
+-/FontBBox [-53 -251 1139 750]
+-/Ascent 694
+-/CapHeight 686
+-/Descent -194
+-/ItalicAngle 0
+-/StemV 109
+-/XHeight 444
+-/CharSet (/A/B/C/D/E/F/G/H/I/J/L/M/N/O/P/Q/R/S/T/U/V/W/a/b/c/colon/comma/d/e/eight/f/ff/ffi/fi/five/four/g/h/hyphen/i/k/l/m/n/nine/o/one/p/parenleft/parenright/period/plus/q/quoteright/r/s/seven/six/slash/t/three/two/u/v/w/x/y/z/zero)
+-/FontFile 756 0 R
+->> endobj
+-758 0 obj <<
+-/Length1 1813
+-/Length2 8269
+-/Length3 0
+-/Length 9388      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ¶Tß5L	t7CwwHww× 
+1ÃÐÝ
+"¥ %Hw	(
+-Ò¡¤tH×þúÿ~k½ïµf{ö»ïÙç>ÃH«­Ç)cµ)B!pN^.
+11/Q
+wýeÇ`4Á<ÀPØ¿<ä`  üÁ&?8j@! UO /?WHWXÀÇÃ#ú#&zí \ U(äÁ(uó
+
+
+áuþz°Ø²xEE
+9~d\A0°-Ð Â
+A®m. =¨-÷ýO
+-	G8ÜMÛÛÛ
+èêÁ
+9H²r ¼ÁpG.ÈóÙ~Qh]ARãÂ`è;=þ ô öpo 
+x0¸mAO
+x¨ÐSQh¹ 8«ÿáÀøóp ¼\¼§û3úW"0äw0ÐÖêêø! {°
+ ¥¨Î÷s »_@èC<Ð
+vÚ<8üÞ: (£ >0ü-
+ì÷àò »üâÈý+ÍÃ1+@ìä ®® Üã×þäÁ0íÃ¹ûrÿÙ\gÔâÿ×Ê
+
+±³ÿEÃÎÓÛ v÷©Èÿéó`ÂøÇæ yDù
+  w ÈÇÖûW}_7Ðo÷ùC ¿Ô
+-`ÿ@¶=ü`ø{ ½@ 8Ìèÿoà¿+
+^^
+Ø°9!ÿd0ìÿX?ôöñ<ÈÀóëó÷ÅÂì ßÜ·[IYÁ@KýOÊ²²P?' OTÀ+ ( æþ7ÑßGðýßVm øÏíý+¥
+-Ä
+
+-ýÅÃñýÅÄëOi°ü97¬ÿVÐ>`ùGÿæ<<¶_¼ÿÏSð;äÿOü¿²ü_õÿ¿;Rôtqù³üáðà@W°ï
+ö?
+ôaD ÿëjúc¢5@v`O×ÿEUàÀ!8¸ü}`E°ÈN
+·uüCGõá!½
+ÒzÝ9 N^
+ÿÁ
+ÆÎÖùá^ñxèÖoô0Uÿ-© ±
+Úý?>A! úb<4ÿa%ðç}S;Ïoy¸¹ PøCà^ À
+
+-ÃøÕS>! ·
+-
+h
+rÙÃmÀ¿àß È¿øßömýcw}¸üþøw*¸ÛßvÑu
+`@;°
+Ð÷oìr{¸ VÿÛÎ+ò_àDHàßÈ?ÛøwÄ¿ªóþiþ­Äÿýä_5ÿý«ÈbþUEä ÚyÚÂÿ"ïÃë´û%oÙÕyØ°§«ëïÎÿÄx3øC¿=À¿åô
+ùOçm=aÿÎ·¿Ö¿oaÈd17
+-µpzÑ~Q#CáÍ¹>òtqÝ(ÓÖáy
+Îú6'l	v&þ±w~UåTú+Í­ÿnK=Ztës¶ë«gºcëm³£Ä_weêú©Ð)9õ¥7nÝ
+C[»T_¹{`k\x¿Wò©ë/ÿö9jz]gã­ÚòqÎDóÐÒIÆÜ)R:T8'Õc6ü#ÉÓ³	üü/÷4ªÏØ1÷ùKüMù.§ü*õù<ºÉÈLI©Oñ?1ùËne¨Ìø,MÒ&Ù»Ý+IéÂ=sµ0µ¼?Í¸ªe?Ê¦ïÉByÒ±>B)ýðÎß¥8­Ó°SC£Db27Ñ÷§÷ªÄrýhGUnU
+-Z*Àdã7ë/|)ÀßK,Æä©Y`!»®
+-Â{R<rçuÝËÿ=IXA[Qû³)«
+ÒkçÐç~/ØK=½¼_¾ÇJ(ºp`¯4¸9 d¯2)é_^¬£Þ§ZÒÎõ/b´åâI/#¢Ý'åã(¡¥W/ì¯Ù_©
+-DìÌ^ú{¥)jü,¼¾øÞD
+T¹ù(uÇû¥Wå÷ÁÉè;"ÞÝ»÷»*®ªÆÎäèÎ(ISÛý¼Dòy1¤f n.«,ûâDãÞa+F·ZÆó¸èeÄn!&/¨ß½
+gV¤#Ûf¾aV!ÛO»êÂ/ôm
+-­íg]´öT)ÂICsî1¢B2ÖéoHYÕµßVóÇ4ÛZíZdB
+9&¯Î	(Ã;Ì&ßMÖFj¤:Ù
+kÏÁOMe×_²\lWJìs8ÛCÌ´ÑY{B.¢Xa
+&.ûéun0Ñ8ÉHb+¢Nÿü¤âw®
+ù¦Æ!³ö³b»ÖÇiX?íôÛÁd¸$ùFè¹æXç×^EË¬7úúEòlTm*êùî5ßË¾ÙøÌHQybv¤T3mì>u±¢Þ{1kjªÞ)Vx
+_þVºo,cñåö
++fÐ,g]AwXüÃ±îv¢x6ÝKÿ:5
+-)9ÚaIqGÖÎ)L%`Ë!º(Dç
+-ÍB·D4ÉÆQT.
+ÄWÄÄl ö(ÖÀ)íOÑ|Lojí¨3Ü]moèWU°
+ß5nõ­+T®9côêP¨òæ0#h küKlibì}½xª¯{w-¼´¢¥âMñ¿ÄiÒ«
+T3#Î{¼îÔ®FvK>¹{Ôj½Ó®ÚCaYãû¤ù
+ÑÏ¾¤ðÇÛö¡gfRÏ/î3'5¿±ösÂOY-+TX,çS5Ìp ã
+Í»úöef»]ü¶ý_Í?áÊMóUwØ~ë/
+|TÒ_I]
+ti¿~Kréõ	R¥à /ë0giß¡EXlTù$·_mÁa³ìy´5û
+$Iqv©Ù2~_ùæÜ½wVëÓt!{r;ÏØ`óRÆÏ^yÕÓ®h¦ç%¯>bf¿¥¹~ÚadèhÃ¤{ç_EËüm¾}yW&Dõ±6Ù&ñs±U8é×7c«·kîóIºß¯ì2wKÇñ­ð7øci¨-¤X][Í½W.èwÉ Û Å
+-óÉú¯`ÙM¯w ò©eT¯I^u'
+Ç¨U
+-'¬ dÍ$§<
+%éÑÇÿP³µWÅn&"{Â@ÞõØ] H\øUÝÃ%äH#)$½ó6¦þô²±Åc3õõýË³#KfÿmVÃÏõA²
+Ù¼<¦Tú×Sr| ñ§ÒÂ«·Bdù§SÔó
+
+-x¡¯®ÂØÚßXaËb´
+-³°>ºô!RzvãÞÛ§s{Dà² FRþú£µûþ¤ï!8ÿÄJ«¨Exð»m`
+-Ç©½ÄÏã6eïEÓ]IúÒ÷ÃÊ¨%Ä:¼4ñ¢´ëâ"O¤¿.½
+ùRÉ´ÃÌ"ÎÃÓtTvdï,G
+Fh_1ïC°ÀüÔ'ªÇ(XùÇ'à 
+ìÒ8|¢ÛJïèËÄÄ¢:­âÃêHpö¤jú2éÄcj:ÿïB"Ù
+-Fõ,¯Ùü]ßa.dÚ#·bÁ)¿Îñ#+ÇÎd!×Ï·«b!?5PQÎ\
+ñläðL^)Zõ½Ãx"EùTDÄýæEMÚüvÃT
+/á21t
+]ä¤:tErÞ$·#
+Ü8½úËèNMÕÙxdglg=I
+1FÏü
+vA
+~i
+5È'áýÖOÛ2örkeÛgk^t9ì£È´«IÈT.¸¤âÎ[#-Xôa	/½öèÐÃ¿i¼éEIÒôüÀØnH*ýÎZ|CRe·½n£h`Ý¡6§@N¼5Ûµ
+t s!õò¿òÍ 28Z(92æ?"î´Çü|9Ö¾Bz%û
+×ì÷Ê¸;ÓÛ·NO4eßY
+qù6Oøû®Ñýc>0Ð!SlÏÜXT$Y¿¢ó
+ûß¼«5¨à TFêqx½ïÿÎ5teXe$
+ÿ¾Ïª,×µ1éLWôpúNM×`#iZ(fM^ Wà±uüÀÑ{D¨Â4üµ¿F½XtfTõK
+ïÍÅ¼Ól9ò¼tf'§××j1~R
+(Èô=-®
+û¤¡5	
+g74þh¶úÚcÊ8ÇÖG:,$iWc1TÜÖ
+
+ðÖzè!q<ÜëXq«Ð{vÆÇ:0JEK=Í½Æ¹¬åU+Ü×#íü&>L`ÑJ?z83öáòÑ'(ÊáýSßG	SShÜfPÖ¾üH§q9(o¨·°q¼R7&À
+S¬Æ¦Éx´K
+]áo5Îd3g \!
+1P íuS¾¿z÷#µ ¯Kñ&©¹å'lÔÅh7¸½ÕìÑ­xHÍu^r¢&Iÿòàþ²#EþJæ<½
+¸þpË·î9ÉÜc{ÁD=,;lì{µÿ
+/_â¶.#4øíeXÈpl²ÊZäÖå¢u
+Tª¯¤5=
+È'çb5Ê³©Ó.&XÊzÁD`ÊÏÈãºÉÄÒMVÞF´þPªCôÛGõ72EÐã5[{ßnLW¡ÿu¨áJÌ®«¹Ô¢6³ÿvè­:þ×døé]æxk!)d¾ÜÛó';îÓP#?SÛïA´[/ô[[ê4Ð+¤'M=1t{²;âzòs
+-}åÓ«ôèD5
+èúÉ*Ñ)âZ
+Õ$jü@îBº´Z£ùQvÌâ||{]2Ü!2Ã)"}
+-sq«uõÌàþ½'NÐ¹HªÂ÷0Ô/ãlÅ]íNè/
+Ò0CÅóÁì,¾öË¦òGv¡-­<GtûmE¹v
+Ï<´¿Ù³:
+HG!)i©ù¦c¬mt· ëZ
+¥§rÐèNÙ§ì5Þ)ôgWßkè¼Þd~[?4Ó9ÖX¥tF°ëºôîN²Ø{L}¦äÕî¸­¥·ËÒ´ûÚð©[ªR8¬¨F6 óf'ãpòcw»§çIý~y
+áÖûÝGv+{þÏ/«
+­Á~k¸D½
+-e!(8g7ç Ár3µiêê+l©ò¶u±R ß½én
+	QB¢§¸¨íémÄß©zùÔÂD-'i®s 5Òõ9 .ÛiRwO@ÈÙÚ´ßê;)rãlø#*¶e[}Pp@¸gÒ¼ºZN."G^g
+-ËúÚzcgùçb
+9pA
+-
+-Ê3R)ýÛøõèééÝ¶?+Qâl­½&âªt
+Ty^½l+à 1½ÝF²öMv§õÒt×¼
+Iº"RÐ1,Ö
+C¦Pô*ÈÎ ß»¼7iÜÐä
+-(G;åÃ$¥êßÁ°°¶ª%~c
+- EÑ¦F4ß
+ùéÃJ.Ê(ú
+-ä$Û.BO(xÌ8Q*0*}5Oý£IêK_iÞË¡-lÀ.£¿Á;òQÐ;2×}En»µ,ª¸I*:ear©^'Ì
+ÃÀ°³
+>
+-
+­zEa%¼«¥Ú}®~,
+öcweµïR	m¤ý?,¡AäÒÁúh/ í>S/(Êä^ØìJëë'ÐR®É¬G£
+þ
+¡Çs:XÇ¨~RÒ-ÔCi²Ö=j©ëE«ßzTO¢y1m8®26çÇÛðÚÇ2W[f{dê~)¨rã"O-æ'<Uïþµiø²®5µ~ºÿrÀJî
+óHMËº|>Ô9½©bleÏ)`¥Ex
+ºÜ¦¬©ê§ê0*0
+¼¿½\äI°¤ùømAõðë,×öñÉ#äË£4JP³3_¯Úg\*¹zíì)¢¸DN#õêvì1
+-Ïí=ÓÚ?¼rÕ)¨µ§îóP:Ö±eÝÑ5á[y/YíËgû¥9|¬Í 'ý¥ ´¿;{ó£A$JMMªamö49
+kÏ7ßBÛ1Dsz´bà³{HßáÌÀáà]FR½îàwîxlü
+VÆgGÖÚ:waÌ2Kn öOäÖ&hîQ £ÆJíBv1ç¦¸©X]ÇÄØ ¬uèûÇai§ÇW9ú-
+÷­¢#{,ã97ÆÍ Å_"-Ó"1­µ»I)¤´òàÒN~?qEp¥
+¥40
+Û
+-+syT>úRkM9~¨V}äL:
+óÍ,­Ïè 
+®ÓS§#%òîµj¯Rò<E·¯QÝ³Gä%Ä 
+-oãñVÔm:¸øÛï#l×î
+1~õ±¨G©®êyyDÒ±ÜoÌÒõÊÇúfúUl*±ÏåYRçeè%dÆö7ìÆ á5ÒÔëÖ~G­¦T
+-4
+-»÷Ã¸-©ÁwÓ»¼§õÜÆ×±M
+ÀR
+ºÝÊÁSìÅJcªK²¬&NÜ+X¾HîØBÉfÌW4Þ1¾_jÇÖq./ö*ÆÐe3!R+·ãÛm1þé| ;N§à£üÌ
+óÆ«
+Vß)ZâäÛ×ßçvYÔKð
+-òÏ9yEûýt§ÚÝnJ«ÛÈ¤&0=39CE\O¬
+iù¬Õ³\.ÆAÛzk@)ÇÀöÕÑL)´Q qK+êg'={±ïó
+!ºQI]]N<1úÆê]&yD
+)åcí*ª8ÌQo*««£
+õw^Æ8|2¶
+-­íê+&F§ûDT
+Ý·;2z2ÃÑ
+¨e	KêKtúÓÂ¯ïÝú'K¾MrÅ¯ïf6í*¶|QÌÍzÞÍ©S¬`Ô>*¯ðÎoLÐ#KUW'b!®²Vìa!=
+Æ¶]e}ö(d±ÚÀ¦+ÇÜB¡ÌË- OJÝú®8I«ºxò<¨ç>Ì"ëÇ»rIdÞw%âÎK~dBSÃ¨öØ,Ù'Ú#pnA¥º¹D"Pàwêë{&õ!:-4~ã}ù¤
+-h+v@Jÿ}IH¤AeóC¡ç¸ª'i
+Í@ê­9`ÅÆ¤x¢c7ú\%¼Øu(ó
+ÐÚìû,AØs>wS1§ÕÚ×Ûp#
+-Òµrñ·¯er0=öÜoÌ¡îe­INt àj~çÐTÈéÉ))3aßÓz¶>
+#CCÌW*ËÚ:"»¤!?Wo%'ÁS¤6®è½xÅ®àëàõCc\ÚÖïxÇùN¢x6¦çF¼®½]¸,@ñ./FÃ÷©.¨úi«M23ý²§é>Ý+.9ë¿hYç¨zií¼Â¥âi¼ßé~ö$µ#[|5,jªÙ3y­tu]ÀmdìB¬µ]mÑã_æÑ]k
+cë¶¾óÔT+{å½üÖzW
+£U+èeÎu´°ããH]Óßxë§&#örø
+-ñFåYFÌú¸	áJF4¬=¿Wùj(o§·zðÊùMiã©$&©Æ/Í ±KÅ«Ã¼
+y×l»ê¶¨d2jÒæÃöçÕñlCÛâ«5°Y=Kì(o0æ§
+Öu)H±ïñ²¢DÍ÷{Ë	6²É'^µÄ?õ
+-
+áüÁ¼-¯ë`óÔ
+ìÃµåº÷x²ÚþkcKÑ ìïLÉ&ÊÜÔ´wqw_öÊW{OpÞÑ
+÷³>QIü"Ì$Ãdä/ëÑÍµýh~Ñ(º¯×_9wÑ/·}ê ´êKÏ<×ô¥[Jgã=âÙîçï{³ø¨ÀV¼rÇr={}
+-ñ^#
+-Ààg	MB
+-ñGvÎÐ·ê
+àëw¥Â®?Ïæ
+äã_¾
+yTü<hÈZ¬Z593
+åF·ù¦´³Ã£ÍÃ@È$#ºx\èÔ²¹º×¦ÊVsÔA8Oç^
+Ô[/7íÀ¬Î¼©Îê
+Ï°Ü±¹øÓ/o\P§mî	i¹¯÷.½ôXÐB>
+?êZ	$CÁ»üê´åEt}|~
+\xîòé	±í=çT-3>ö¶Ðö`kû/ 
+Æ¼ÍkÖ³£mýR\z:{ÇG4Ñei5¶/%
+¢vT§¾WÂ.ÇÆ-
+Ï¿®,Á<´ùÏ¡Ö¥·8BEüÉëå
+Xu4<
+³CÑÂíêwËd¼ll¡òJ
+-!Ê¸ÆãL
+ÍÏH½?°
+_d¤ö~Z§ØYó`©J¤×ë8BµàqªÉm}è}¤cgØ\b7Ç?3b¾
+cÝ3V×=¨=Þ*¬ó?§³½¸ÓÞÉöJc+q¶x,x -´(Ué³Á¿ìÿ±iô­ÂIYØð¾ûÕ½ÓÀDÙÛÒ4í¢pjM³gOGß@~ãiÏ|å¥¢7Bõ*ÉYì*°ó{Þ«¾
+W:°Ô¾ÉõæàÊíH¦whC­L¸Uë>@>¸ó$5<Rj­g&gÒÝ7¢§¼´UæÙÇeSDgouÏ]Ô
+-J
+W\¤ò84,Ë:Âq6ÝPv¼q:0YKÇLSÕ2 ¼kÏÚ¼¥OX¨_Àn´îÀ5-§!þ0­TðÅ¥%ËþÎödÂôÞï.°/ÄçÙ¨hõH¥6ºQG¬ºõer_ÏÒù³Ìd,B"ïM«¿Dê
+.bÊpìãÊ :ÆqG
+êb8^÷,AÔÜ
+-cü°tÊ XÜÇI8¯«ø],@< ìÚ%e;Tß¥ß Ýªµt2N8ÖQTöÂ£%jÄOýã,T
+©«;º{¡fCÜçâcî¯m¸	ì
+Ü½ëF©Õ3ïÜÙ^«¿>0»H¨]qÅ?ÞØàÈIKö%´éÞJVÙR°å§9ï2kéÜ¶ÄzÓ/ÄwÉ¥ëµ
+íiëü7QÙ/
+-ë?äjïWÕYN9TÖ²¬®â.d¾ôïsYF
+-ÙG§÷ðÙÆ¸©X^3f â}1  ø;Ë04ð
+
+ÁK0_|6¸ð
+³¬OêsS«Ô0b¨Wr½ºw[+#ïVÆ;°´X©
+è¿ÓDÝ"=ôù¼¬#`w T¸näOe/èt@û>a,Mb;ÚSiÆ´¿÷V`qÎdÖhfè,º´~þa,ôg?ww
+-UØ!cÕPj8k`G
+-ÚÎf×ê£¾ÏÖn×á&|Cð9*Y6|W
+®Yç"e}Â)=ôav79öâFHLLÏó¶Ý±Êõz¿)4DgßË¥î2}²²Ð¾q	AZC¬AMXj©e¸XÐÿCÃ2sÃÑtàKÕ¬ àå<P]=þ½_î¼
+Ç®É!A¯ÕaoSäÒV
+7ÈRÂÎ[·,lEðÿj's ø~ó¹"ðôj8ølgqbäKîNï5 °L s£,Âãß,~é$­r×wêÏÂ'k²sfÊ÷¶ç¾üàMHñ¥ß 1Ð¿µ dscÔtÔ?}þ³ùqäcð@pÃÒÙ(Ý&ihãCNxÅW
+u
+ãjï\zv
+-ÙÊt?îÜÇ\z0ÏêIS1
+B©û$Úx
+-I$×UÏ^YÄX±G1äRüº³¥u¢
+ËÒWþ
+rþubñGl0§§
+ÐëÖc½ø+ J¤äyn­ª»lT\×äü¶æË	w÷öYÅÀ
+û7/[@ÜB¿[eÆ:e
+qb'
+Æ
+3è60Ö%»Ü;ôQ¢ó<Ì©âàáJõ§]
+CÇ¨Î×z&ByÍfÄI;'aCÓ_ñÚÉàáv©é»Øã¯5
+-CfÝQ¤B&7@t¹¡|ý0S
+òÒ	ó§ò¡-opR²i>+·ß6¹£ª+{©s¦CCo½kD\·1i_"v¬Ë¿À$]GhÕI4nêY	¯!ëvc{&VÏåÚµX
+kv2z¦¬)Lµp	­MÏxD~gó·vàHW=ò~
+Ëqeê`³,]ärâgéF?QR¨þ:áDÎ÷<¥)	{øk 8døÅ£TQû
+MPÕ$îUÐÔçq¯S'ä*Ã5o
+-oQ±=©mqÑw±¾Ì¡¾´F®\BsÄÁc
+-¹y×ÀðªÆ$u?NÇ¶¸Üuëú9ª«DÕø²`ûe¾þä¶!ÑÀÑQÔYXU$~I <m%
+µ¼¤Ø\`ØF|ö¸
+ðÉõö^þ¢O×}ÓùS<W¸ëa7ÉaìÜå26}gécDôWL¯Üsbl|v/ùEãÅÂ»I$gíÖÕ~àpãï£î\
+£Ü<V°_à¨u-Ðsrýð¹,ÿó¶\QÙ7¥gÎß^öÐÃ<Ónøö°¿ÌÿrÌbÈï8·ÆÅñQ-`Lx6kB ªÎ[®
+ëeSmP ÜX2ù½$¢5JMZ¬¿)ü©Ë)S®SKFe[#EtßÉÙìjA8F`¹³É6H×ê!wÍJ>
+-w(Ku!JûÌ°P(tRÐ+%©è=/|FYçÀë¸g\Áõ&'Pß|ý3ðö(nÜ,¹CëÝÙN ÍFï
+-ÁeÌª÷b­;-PHT	mL<Ïo­>1jÆ©~]PÓQ®«a£Þ<Ñ}§>ÃØÞ[ g~WuØæ,ü)ÿ
+ok)zÒsyÿ¬Òðæ É2±ëí*/²xÓ3Ñ´mÔ	2--6¯¯$:²¡Y)(îq)D²>;3¥¹ïMòQ²Æ
+3"D4×®"A&BKÁÏÔUëým+bS??
+±»Ñï:»¾¦ÅlÏÇ>Xö.³¬;I+¦æÙªëâ6ï7ú±5àl+ÕúÓõ
+á^Ë4;¯¶áÏd»@Zô^6"°°ÇQ4¾è Ñ«9é¢è¾ÆCÏ
+ÂR¼ºì²½Þ$­¡÷ãBÜg4O©TÂ"m 
+©3ú*4b2ºI=¤KÁj~¤nq25:'ãê1ooºÖ)Ñ¾FÝûÑ½HNÄAd:~"°¢¨Äs«³ì3©â¦gOts¼
+ýQâ±¾ÈëÕ&%ârÃídcIïÈÄ`Üìý¥)E®f
+ 4ómSNôx²xØ
+äl>5OËêõcÊx(³2þºsªÈ
+zWH^[tLäÉ¹»m2ÎGj::ßÜ®wéqôÈ1¿*_d<?¯ë\~Êóàø"ûLs©ái´:¾Eæ9a¾úyåV
++î£í+águ|T
+Fþ
+-ô÷n}
+ÂÛr,&ÍªB¦Jê¹³oùÏêeBÐºâJ0¦b
+ ôçö.öÓ 3º6áÆêÈ§ÄZÂyÏ(G]Êõ-¨pwRxs5ßäiowõ²pî²¤ÃÆ²Ò#¶XÌiEÞzbrAap ãëæ°f	u4þï6k>64`Êé­~ê1ú½7s¢YÏ¿CáØWý=/mÌ~V»uø%Mh%H-îô¹Ç lÙNN Q»§f ÑZ1£úï=V'ÓK[×Zõv½òôñû5U
+ÓÁìíå½lð7LÅÄÒRB(¶|,
+->¶FVJ¬»|øPÑ'³É,çÐÆ@m=Û¼\jÌ8d4òz 5~âDíG¢5Z
+
+ý,¦°çÛæ/^¾ªÑ4zà,%Áî'Èd¬µÞ­ttçè¤°JÄÈø2ûGB¸wÌ·¶ú
+-Iþì¯ +µTÝ:ÍùGÔ¹òædÎÌ]­ù2¾Ó!JL÷l(Ð£gï*
+Z=y
+<rõ>-=¨B$ÇV:e
+B\{á
+Ekyò}ÌbÍo{f¢2³>0;çÜnÄ£¶ß÷Êòiëï.ã 4ÚHþ´UÑ
+-endstream
+-endobj
+-759 0 obj <<
+-/Type /FontDescriptor
+-/FontName /GHEUOG+CMEX10
+-/Flags 4
+-/FontBBox [-24 -2960 1454 772]
+-/Ascent 40
+-/CapHeight 0
+-/Descent -600
+-/ItalicAngle 0
+-/StemV 47
+-/XHeight 431
+-/CharSet (/braceleftbigg/braceleftbt/braceleftmid/bracelefttp/integraldisplay/parenleftbig/parenleftbigg/parenleftbt/parenlefttp/parenrightbig/parenrightbigg/parenrightbt/parenrighttp/productdisplay/radicalBig/summationdisplay/vextendsingle)
+-/FontFile 758 0 R
+->> endobj
+-760 0 obj <<
+-/Length1 2195
+-/Length2 17019
+-/Length3 0
+-/Length 18340     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚöP]Kó
+ãNp·[pwww
+-lÜÝÝÝ]w
+4hðw
+-ÁÝ.ç¼óþ¿¯êÞ¢j³îþÍtÏZ¤Êj
+"f& I{WFf^
+
+3RÝÊÕôqJM³=ï?,ÄA@×÷1q ë»¡=@ÖÍÀÂ`áäeáâef°23óüÇÐÁ t·2(0d
+ìA.b^ÎV®ïqþó 1¥°ððp}ü{9@Ääle
+-´( ]-AvïM¶ 5S+«×ÿ¸ á·tuuäebòðð`Ú¹0:8[Ò~xX¹ZTA. gwà/É E 
+èßÒ(êV.ÿPs0wõ : ï¶V¦ {÷%nöf gÀ{t<@Édÿ/cù|ü{s ,,ÿu÷ïÕ9²²ÿ{1ÐÔÔÁÎhïeeo0·²$å]=]?öfm]
+Þ×ÝV¶@w¿S$ET Àw
+ÿÖçbêlåèêÂèbeûF¦¿Ü¼o³½
+ÈÞÕá¯üÄ­A¦ïûîÅôïÃµ±wð°÷ù[Ùÿ%ÃÌÍIÃÞÊÉ
+-$#þo÷!?c W 377 ä yZ2ý@ÝËô÷$Ë_Ãïü|
+
+
+æï2@~Væ ÷>.@wÀÕÙ
+-äçóÏÿ%©+ÀdaeðÇûû0Èü_ü~þÎV =æ÷òc0ÿõ÷ß'÷
+-3s°·õúcþ÷3Éª(«Òÿ[ò'EE
+<>
+l¬ Vf 
+3;7ëýÁïýüwþ£þïQe Õ¿³ûG{sÀ_!þRñ¾}ÿQâþïÒ ùwßÐþ7¢Ã{A 4ê_Ùôýåÿsü½äÿ_ñÿååÿµþÿoFn¶¶ÏÓüËàÿg
+hgeëõo÷vs}o÷±ÿ¿¦Z u´ÈÌÊÍîÿÎÊ¸ßDÄÞâ½ÐXØÙÿ5nå"iå	2S¶r5µüW1ýç4ÞcØZÙ
+\¬þºxÞW13ÿ¹÷Þ3µy¿\\ÞÏì_S@÷FtýûxÿbÐ{«ýo
+ö¦fõ$+' èì
+ôBx/wâ ø°¼7¯Èóï01Ú;¸¾/¼kö;8#üuÐ
+ &¿þE &Ñÿ3Iò± ¤þIæqþ7Iññ þKÜï>ÿ+Iõ½ûTûCì &õ?ô§ÆzÏSó½ÇÓþCïñtþK<ïñtÿÐ{À?ô¾Îä½¯3ý/qüEï÷Ñë¿NÉìø¾ ÿ"Û{¶ Ç÷;íý`ÿ¼Ë3ÿ¾ë³ø³×ï½[Þ
+ðÉ»Ëà»j«à»lëà»à»
+Û?îß³µý«þÌ¿K²ûïíÎô\YÞÓqü³ú=G ³«ÐÖÌÊü÷ïÍìðg#ØÞý8Zþ#Ë÷w(Ó?ðÝÕ?²¼Kúçû&ºØ]þ¡å]¤ë?ð]¤Û?ð=÷à»&?Èúçõ=²ç?c}æõ|WìýßÃz\ÿuÞÿÓb¦nÎÎï=ø÷ÝøÞÿá¿ß 'Èáç¢)_¨uch×}½ÃÞ?ôYæ½6+ÃT!ëÄ¬ÑV²Z^î²\¥äÏAICë^EQ§ûüõ¥+Ý&f/ö[ÉC
+ÄÅ·[ðù;B²Ev°"­tQbÞrç!0e¢Ô>x!3!5J_êÆ)
+T\²a]=}õ¹òØ<¿¶U];LFÕ÷8®q©
+¶íBvbõ£2³Éäø{
+=êP7GÆFWÑúcdÝ÷Î)Â]Ñ$øF	ÅÙaë4W?}x.(w?ÉF÷1Â>1ªÚ M¿oT¼´Ü½<1 ¥Iíã²4N5eùåý@æ¸)é\X¼m¶AÙ6"rç¢9e%ýu½fÈF6"LÎky~`fóÙM.CFoz8æ£B²Àkõî/¿Êî8wópNêút´]	zì\Úc?óOÃ¶y«·4aóZ¬zÜ]êe«<¡ÚhllÈîVµZF`Kun}¼Ù_?]õôR-;ÕÅØÇ¡Çzo6­úf=±0}k6Íjóö°Ûºõ­óÜ2±s(õ«ñî²ã8Ý\Buàä>îÃeì"«YÙ¼!®H4«P,¬z¼Â
+vècCp¯}<ñ~9È("86{CW*cñiÎöZp|BüùñíB°3C)PÝNyâE­u±sÔ§þvç.:ÚVÛÞ´Bê®0¥Æ
+-M<r0¦ÊhÈQrBlÈæuGA
+í\Áü)RW
+@
+#ÏçÜk6
+ü«\$z=F$o&oFXç¢%ÃÁã°­Zd$§x»­y9_7Gº.JI´¡©%gf¬
+
+±_jæ¤oÄýnÎáVòtÒ>t67°XëÖXT|ée1ééÈ­ú÷XÆÐö{èêQ1[§7jqyÝ[ `dZâ©µ
+}¢ðCw|e=6_4 lÙ½5®íU¯6{â@ÂuMtÞ¾éIiZVm<´ñ#Y9¢ájñ.lÓ		6
+
+-cM³Ï½Ç;àãaìF¢0;ÇÐè«OÃS,gô3Ëhsà(¿´ZYÇ
+
+rÅr«¢ {<ÇÌ¤
+õH
+Ô%nû­³UG£ýèww±Ù¨k¶Ü»ÞÚ«É×9yÒ¤w«Af­¤­|fìÕKQ~rð~ÜytÇ$7K []ä£÷ÆÕ­C÷F¶à¨Ìmx
+	M8÷Xâd
+;¦äP©Â@ßî"Í;ZùÏ­åãç(lÚmo×)®í(
+P³xvC
+-÷plòãø«êÓÊ,>ß0ð1í
+£âò%}LÔ»'ºÌaÂ·O
+k|¢ägO¨"ûúÆ´óxvÆÊ6ï~·l
+-a,ï6«þuø­ê=·ÅAê8C`ºê<$"ìÇÅöz:mÿàZáº¿¬ý)¤+ðÒÉ5tÓüÑ¯}&¶>JMuN;Í
+?×¥Õ:MÉ°k+¤²)A#¯3lÓGp>©°ºî³ÃÆ
+óeµ_ã
+-Ù%6»`4z4¬¡xÙ¹0HåÚìÃ ä1ÐÊLgÆpS¸·EÎÉ°1Ht¨CôôD<r}9CV#gz´op-øüíYÝaF £ýÛø£WIàOrG
+,)B`Y`c`
+
+-«./n^Á(¿ÔËý©¦
+^=$'³Ù}kY``ÈZ¥âI8«©pëýêMàhÒ9ë»×J¥!]¿´ÜÏ_ýë:Q
+-ø
+-'ÅléZ£Ý9ü+KyÊpê
+È8]Íh@:GÙ~YýäBiÖcO}
+]`*çìób¾´M
+~µý-è¼®}Ì¿-­W?
+åéÞá¸+É@CcIJÓâm#®¢jâÊ×4òáÈº¤}0ÏqWï½fý!ëz£iõÍZ.ÇØb6B¥²¡¦ìo<¨^Y$TÌÑäpRï~@
+tD%©Gðé9ì!ñ¡Lh
+-7Î,ú4³«Óèº6
+mÖ\	Nký;ÄNEA
+ÛóÚ]R
+-Sr-U
+Ç
+-Ò·Ù
+ðA
+-
+ò:º&¿Øµóõ&Ý&¬±%æmIµúä{ZïF42êosv 
+-¶êÒ£ö³¯^9 áá·g0¨ÕÜh06)_@AÖî>wGÐb-U~ªÔpK8#ßÈ
+øñ´¤w*EYO Æ&9HÛ%sNO§ÍB"x/F¿`ii¦&:ÊÇ4ºg/Ïï­Öµ¿3<Õº3!õ½Zhíq:ó5e[ñ`èIF	la
+zØÞ«æ
+-èKæ2tkzæx
+-èØls´]kQS*k[h {õtIcñóOd¤i	Un[T8nÔqMäý§8lÐáÞ	¨x|RzåÂæx$'àM[úøIÃ[^Y(©ed
+GQ¬v_MávÁêlyY0íÚðô]ä
+ÒÞÝ5¹Ö@ø1÷a
+Ååïe>idôÆØDtû+þÑ²|
+-Q Jº¬
+EkgúÎ(Í\l;U§C»bY=ÜdóETHéUMÛ8F,Åsþ
+ Ä/'	Õ>B
+±$
+À!^-ÌmxÙÒïÈwL»~)$<ÓHDÿýë¾¯ÊNxû)Q
+'qE¢¢TKÉa9}±?¥^úÈq÷P
+Nß»äå+*Óì
+q¨µ&´O
+KÔËDzC¦üË,¯wàìÕNÆ¹ïr«+lµ¨ÙQ¦@­÷O¶å>õEYÿ®}½Æ×6ã÷ÂWG{ç
+-$M­Ê[Æ
+
+×Ã¬Ì£úFVï¼
+¤ÐR°~5NWÛÁ5ã/&ÙûÑ``2'Ø3DF´yºYWóF Tj®È¥¦
+¿&Å¶c
+8PG<åÅ'{E2£[^Ë¾«ÂäcNsÍ=÷YÅiÒ'ì
+sW¬Vã*§g>Çº üì
+Ù~dt^«$¾ÐûÌ YýÒöëæÃaHEwwú^s-4Êñæ,E©h%¢<Stâo»(ö
+-`q}*P vÅÙÀÅ8!ù:Í7»3
+¦½`£æè\´ñ
+Í¦ëKGþpºMéÖõÓ9âZ»5áu£êý¥>ÝÎ¹>t¸ª x»yq=È¸¾8GÿñóÚó(DíÕn;ï7¹Pf=|d»Yþ¸03É=]·XíxbReS¿ÔÇnøòä`s¢ölÜÍïöXó2!Bàé6%¾½jQÒ=rèÿ¸jÝßJYNâ;ÞS¥p´®	ì>òp
+-£·ªX·ª-­Ïo{tk»
+êtæYù}BÐÿê*-v
+{6ö@Å ¾µø2ïcÜAÊ¬æ/ª#è9~ñýÊèaZa{Ï
+_
+IS½
+ Iÿ{°ð§nû«#êXÒL!Q,)
+gF»³^Â]íº¡ºgcKÁLéiCú"ÅÈst`4ÅðÅÏÆ_~Føà´ú+ò¸À aåcZº+xn¹¤{aC{O©7Æ¤p8\¥»ðlÝßÖu;ê«]ß?R ÏBðUWê]ÌSK~èÛÚ°84ÐïÀELìo@öK
+GÅ|«uº 
+-ÑÆ8)ÎÏrîÖ_iýüímûIä`ì¼Õélã(ôkz¾¶.×|Al
+-
+¦áóbô­cøü
+-Ì§©QBT
+-»xKh(ð¨·«A53
+Ji
+-¶kÓß½¯+
+½9$bð¼)^ÇMO×ÇmÔ¢
+ºEÎ!,Ë]Ãº#¡e'S^mbº:&¤$,ç©
+°BÂ ÅµÆiy;Â<1¤úÂò)@õ
+UWÄ_(Þ½uÔøtýw|á
+3ø{a)_ÔM¶×z9vëÚz»YS{«~Éy:±
+-n~3r-'ªÉ9Jüî;£µDÉ\<!°/$\×ÊxÆj¸éÜTÊ[@C$-X
+-:\VXkç«»û1²Têg§{ÄpÑ¢°%2åíbìbâûóeÀ¥]Ó(Å¥	"#G2²7E)YâkUíïuK})cð[ 1wIvÍúå¨¡FSvóüÍÙÎ4YÕ{oLûõ+XPfÁãê¸Ñ\Û>c
+
+oÁ4kmXw£mos£)&úî+réÝ5)®xåÁ%þ>ÓH	xZÊêÍÓÏÌÑLªCÎT!FhÂä0äÎ¯Rn)J´(Ç©®o'Ãm
+-¼siö/_)LÕO8H+ó;Ó¢·
+ÃHÓ[ýwÅáçÈ¹ù.ß®\ 
+-
+ë,ÄÎ?%5­	=
+,yÃòÅ¤t9ûÌÒ)uQL®ÏWb¹¤,â;2¾ð¢<
+-ðPÜÀ^àRäÐµq&Ý<Z:£ÜÀªùÇ?Îj
+-1VùßI½2KdnMÁ¬
+³ì¶ÆyZÕGkV:!%M´×U¥Ö .:
+X({xl,êç®º°:Ùý~ÊgüQ*×úxËçss£ÞÁ
+ÞWð5¡\ñÓÙ<ê&LÍÉæ Ù¦g¿¥ÀHHyd©A²3@=¹Ï¹ó·LðÓië^-9riTÖëñ
+|}ÂB²©ÛWjÍ&dâûIËXAÕdPox¨o¶ò|¡f÷Í÷úÌ±{wü¢+]ÁÄE¶)*xVÃ~2¢«Íü:CNÞ1;eyy+´dÅÃY
+ÒýÚi#>8¤RMm¸Ë7óJÕ'Ç)ñi2V*èLÇhD¹3ÿú(k6R7+£Ô
+8q~¾&ëúÁ±¶Ç2{¬.DZ7D-Â¥R&ÕF¢MYç;ÑÃ×v¸Äâ
+-ÅD
+·bë1ÖgÓ/1smjhX
+-Öz³Ayr©ÌMD¿Êg
+YÒï.
+-ã2/?`b¡+û«½È­½	I<ìËääP5Ñ_E;ëS°ÂSè-Å2y.:²õlëhU;
+@·ÐA:>ß Ö¤hp
+9$Ò9º > KÞÚÚÛ«Ð_Mð©&ÅÚç'G±zM×aþlõ#þr(wôCNS=¼+6?ÍQ·Çc,/[Â
+1¥` z@@ææ(ª\vÄøü[ª6­ªçÙzòQ"ä '<Ç
+ã²e9\§¸4ÞqÁOæQÓÿþlÙR¤ðö³ R^'(ìáQK/¹µæWI>~·ïaÏþ¾Umðóh×êLÎ½/e$ug"&Ç]#ÅÍO»¶Õ¶Þ×ÌÙ@qe1Ev9ýÖµË}!	ò
+UûÙ»4²ã-òµëdaµÂG_YDÚ·ki}(L¿©³îBâü´ãég%9/%¿Ó¾'Wo¯I}AëOkËV§8Q¸ÝòËæÆfgR ò­oë%/0æÄNrEÆâ¶#¶útÃoò[Ð°SIOÌ'%µàÍÊ¥æìHÞHes³;)¼×RTüI>Öò}Ê¼6©Û&ÎBDrài`Îô;îQ"¦Ýpú¾*æ
+-®T Q,àÙXÚ9
+³ü£ÌhHà-õ
+>£nVg/\Äo·HqËËå£§Qlô¾"N%¸kÑå
+n¡0¡Ð=qè/q`Izñ×^â©?{aí´ÊÈMboé¾
+´h2Æ(5V@ /pØ¥Q6OÝmTDjßK¸û{{.	&
+¢/Ýé6ÁuÑ1íê~«õLzÚè^
+ÿÅÝE)°#D
+¼iÅf#ÃLÛå1]:¾!ÄÌFËkÏÉKuxËQà!×=êYjÓ¯^§ã··iÖüuÝ4­Ä
+æâMµ|vúEÌgðWç)¦^*Iu?	.¶¢r5JB*
+v¯¸b
+±Txö²8zx,¹b»n aMR.|±ç.­s?
+ûë½Â¾zd?u¦{
+ÑõfØ÷ü­Ô~ÄL_zSyT¨Ðëfu(´ßÞþ£hh¹oòøá\ó¥5Rôº}ã¢±
+-Ñ½ÇíptTAê\UÜþä³Ã½¶i_¹I°ZIºÛ-eÚÊú
+	?ÑXÇ½ìÑa
+øºÆ|4MaFb¶m;«otá×ìô «
+aM½+"¡#IÄ
+¹Ì`¨Xiz@
+ðvà-]­j2«DHy£À
+þ3\^r ßÁ(ÄÜ¼Æ°°³¬f,ÌåRÏ.Á.ç7)Etttml[­wU×R2'=ggTò¤ðLö<@»¿×nÇ+¬
+·àÂ4úÍÜD´èpí]¦r>1nÅ;£ÕE	!×ÔÕû¼¨åqðÙÅ)B½ºÇ2ÓyùøR>
+WK'z°++	°cQYÒ"o&!,üÄ¶ ÿ[M»¨Úê¨lNChvw^ÕræiÙ!¶-0óP0ygpÄ6^)¡êó¶Ç$Ùø¯MV
+-	w]¶ªG
+-±}3
+xä¦?YáÆÜÒqFýrðrAµF°nê~¶â×(+G¤e×áY§¯
+#[¿±rñÝb0­ñÅç
+Ö#gØ;öÜ´&ÃòõÐ`L
+:H"8):c¡IUI
+
+-äÍÀ×
+	øcÇ>óå
+-{ÈW°
+a³ê¤S¹Át=y¯v'øfÑ¾Vaj¼È1Î#R­M©ÄG	¬Öa3ÎûO2êýq¯S^9?#~§K§;Zuì¿iZæàÚR­lI¬ñv|EU*9¢ #ç­ A
+£¤
+Åâîä(x¦¼Ég<
+-~5C§{äXd>c5àò¤ùÕÉîX«ÌÝEGÈåÎAï2nÂßd ¯Î|Fwß*w¶Dß&,bdXv¨K8|Ã«ÅCJ/´
+C=Ñ÷ÇS¥Ç¢ppH/ÍZ¶ß{õ
+-z8.<b¬øÚ¤Ð
+-²¤Õ.5zðµtçh$ÃRv%§¾
+ßëébú$ñNMvZk<m¢_YJw{Æ9ìa{ôÃi;ö¯²íÉÙûKÚB(
+-C[
+-¾V	 ÕÏÃ"P
+ohJÇbö@noºjÖiÐ+gÉ*¬Á|0q®ã)UZ,¸¬½@7Ó'9o¬·)f¶Eê`ágÍ1U*
+m2ÀÊL¾Ýß¶íez¶`³³ú&}(<Í>|îní)ª{üiFt-u²xÃåh­qË]¤*6×+T" ¯Íó5îy­
+®ûKÊ{
+-Ì-ù¶ö-ÖëÇj!$,!é·
+À%<²Ï3a«fISDÚºb¸
+rôT^«|dÙé«~
+á1$'BUïU+e
+-cÁåPdì-yÇ++­Ópø(
+-ä&À'HBÎºD;ÙÝ?
+6poÚ?9×_öòÄóðfÎ­upªIÜx¿·À§¬6ßcËV3È·G,o)
+»ÿö^"é@uáÒLod¹7úcØC×¾²g[¼rF'­'¥6·6¨8ëÎgæa-{ð<¶Xæâ6x%l¤ØXºÑã®ïE¦î =ÎÎ¬o.1].u±£bØA`ÌÇ{¾Öx­w 8öÌ
+-~BúqÀSì*Òæ6öMPÑgf¸<Á=|vÂ+_/ÌGmÃ±
+õ3C»Éqì»Ð£P¡¼«øw¢_G£ÉC/
+ö6(
+÷
+ô
+é,w«8AöË]Æ&á·f¶ø~Ù
+Àóh]á~tÎ"µ[ê5|]È×Ð¤Ö,eãVO5'r½6êÐ
+-¾îì
+9=Ð>U¤
+8Ø5ÎHSòóå£¯½µ!ÉSàT|µ÷C:	¼ØQUO"I¨/)µ
+±+÷wR-?|-H
+öl
+]náKÆ\í¯K
+-¿Ôw¨IÕì30²lÃ9F¬j@èj¢Þ$I«Y­á.Ù4Tß¾pb¥c
+³3@RºnÞTÜ³N
+Åv	íP\â+1äüÒ'´ÍÇiAæ	ñå¢É-tb]Î9|YùA
+Jö
+x«Cæeþ6-×ÖmwÍk Ñ6&òð©áµ\a«FdMù\zLÌcBf;xÉâ =`©`ú ñy­¢;`à´n#W¿¼*?¢±ÅÂ
+ÝýÈ©L·hl
+%¼¾ÇÙÜÞ­tÿå¢ç4}m°ÏôóãHw35¤ÞËïàí#
+-4	¾véM¹eòÁ¯6
+-PÞa@·o&á´±^A.Zl t÷«4§_#²=üQÄ×ÀE°b×¬'ÇeÆÛ²Ã8ì"\
+~C¤BG}!ÐJfLø(
+¿DOÀ'ÿ´
+-ÕÍ_÷ ÄåP¿Ò°¤Ï±³Ù¢×ü¼¯Cò`It¾Æ0c½|ÍåÂGÁnÌ­ß5® m[ª)ê¦uPënÑwÀß§ÚÌ>iÇÌåA8öEÖ'Y_÷·Éd)ë~¤"wÝ_;ÂÄãÂë@%ß\èÓ¥Bw9-°RÅKüa¹áþeÎ!"Tø}Ðo¹*Ì[æp(#bê)¬Èî.$)IêÏv
+-íkÆ>éR+lIF
+x0¾X¶áe M òKúBãªÙÞ8ß´ðO£iYë¥4õ"b#CrlÓjtµÏ6lÈ{Qà±ÿ^+$(Ó%×hú`pzh^Í^Ía;ÝñYmBïl]¥çñÞ/>H!Ãc´yk£f6Åæw:ßøü@$«$ôeôbüõÈN$-µß$Æ'è¯Î?
+à
+-¶´÷ªi¤ )(³Ð°BÀ¨÷iÓZ²C#ç3çD*ôã+ý&ë{Ë©Bá¾#õX¸¢ÙB
+XÙæÉÌUzF £õ¬Îe2t9@íì¼4ê>Ä+ý,¥ódÝÄÖ4pv¤z±§ÖíMÈ§}¼áp.WÇY;FgîÏ5ëÃZª=iÁ}¤%:X9
+-
+-ÌQ¤}÷º'/0áôGZ"bà+ëô>^´®wgæêÂ/ÀFc &-ò4D¦rã_Û/ÕÈ³«Í
+&æO5Y¢ø¼à4óbä
+-¶X\
+QZlÖS|Û \%­±XnT!.¨fö£ÅìÊÞv¯½£¨Ä´ x5JßbNn *_öd)özzåÒx^&
+Á.@Ô57®fØnùÌc¤"Wts½¹;¥:«yÝá½Î¡(õÌ#s=7ìïOÒsº
+%Ô¾¶p«ïh§´ß.ä±®ª*°µf
+>ÌPqúàýº¹Föú9£
+-)tô«Ïw½õctªà÷°ãOëâºêûu2«,
+ü¯ÑJúdYìOÔ
+Ë
+|aÜ¢¬JòîôhÝNN(#i¬Ç¿ÆêxÇAÔF-ßÊÆÝnZJyá+
+ÃT¦_·HaÝ9²æ$ÌcáÍäÈYq#CÂF-éûÔ,toåZvÃÍf
+\b »c}!EÂ.YbBË·ï}¤<|3,G§ÖZ
+Æ±C1D_}0
+=ÒqÄî¬HÇ¨ÄG[«s¯Äâç"ÒµÇ
+(½V`\òJò~Í8¬
+\³GS}$?Eð!!q_£î<ö
+-Ç
+@´åÒ¢
+Åò7PF:=gÍ\Î2ÕC
+ôAU7Á) ç
+\ê©MP%u|å8
+-#wÝÌ
+-Áì2w¼+Ä1-Se7²GG*
+µ«
+cø8¾²}ÇTÍ*SÛzù
+èÆÎ¾^-
+V¥å÷Ðå~mNü{Qïó7üÑëC/bþ
+x2ìÝ-­lÂPáÇEÈÇ-äA	XuØ!ªP{­¥¢êµI+VÓÐ
+ç \ÿ©<ù4¥S®FXc6¼Úaç©X´þd­óìâßè?
+.ZcuÃnN9õ!p<óÄ¾ì»:y®Õ9MÏ]Ö ¹\ÀDÏ_¤¿HR±#>ºN{
+-Ù×@
+-
+-Nvòý$]/?Ô³ÑÝ¶|¶þmÊ
+*¹hÊK9oÝõ¹aû©lý4tª8³^ð³Ú@3ÛYÿT_ðÛÌâöQJó #½óMV?ºünPÆ[ÎÔ%ÎF±Êæ
+Å-Jôèä
+
+-ìýã52ï=-Îù=n
+²ÅUå¸	ëÈÃég%Ò	½Æ³âÕvrº
+p­È,ÙÖ.Eîé{Ü*g«: uZçØhSüæ=éHeWºÕÏø	åÙÃ¯ }JjÒiOZ-ò-
+£ÓôEÜ8m£Ç
+-»JåuL#íôht®áQJF¦Üzæ¨÷W!DÛók¥¯a=¯/»¹@òx_DªÌ'v*_ü+
+È !õ½þx6Öo3Ä hLK7xie&ÚU]r½y¼Åº
+-zYZ¾]ñ¡Ë¶aoè~ÄÌ+¤d®.tè³â÷ÕPS²Õ
+-qr
+Kã¾hÊ\Ynt 
+-(cdË»Õh9ôÄV|Iv
+)³j®é
+*
+-ê&ÂNnÅ¡S´Bé/úÍ oLÑ´ùù·Úà+Û&UZw
+-b·Í*Ö¯DùÓ&VS»UýHPs@
+wÔª_-³_¦»r5tt­ùSÈðZÇwÁ
+-¢´U¤PPâ³ý4¼
+oxFhWòÉDíÂJö|9:Qç¨-Ï¼ºékÜ;êóüñ+ú~]»áYÀ
+¢ÉuÝBNj/6îý2éE
+S&
+öb/"ÀÄ½ÏÒîÕÿ²ûÑTö»ô¥uFÐC°¸~{d
+-o³ÍææÐ·È|<Y
+-+^5Õh1$GÑ¼þµ º¶£äPî½&5méÄ
+¸lÇiÑ ÷ðèÎk[P^Ñ )­mFð/X<zéáÊ¯/q÷qL 
+Û¦)xïo
+-¡½@ÌÞóH49ºÙpÍ¾45lÔó7+é2>@ðª[_²x0}#h
+*5ÿâ&k[1¢Íû×VP.«ë®«ì*¾Ãs­Í«*×^õ\
+1¼+%X÷ä@·Pù+á.u,6?VÒ¢
+dwÆÇ!)ÓñiÍ}>Û
+7ÙÌ·­`K<¼GDQ25 =Ó
+Xk¯aÀ
+po®4îí>0Ç7ä'
+yÙ÷:3´ìñÄu
+Ù\­@Jç¶Òy~³0ü!mË	Üùpå©û%Ì=Ú§C4)¡/
+^/ÛÙ{¿·ÏX©F'ä é½8~Ò=ªã~@ÔV'ï!è,¬6Âãú
+W:èDG0Å	ïtY6MÊ
+
+-®¢òs{ÚJ6À-¡~Ã¡a¶p´RÏµ
+'¥@>x°×ì&ÓNJzÈ1¡³
+Wßáp¥#	7Ú4ð{²áøØã{@î$¿ìOgV<ªà¶ì¡ñµðç¡©lè
+jî7~ÆwNÒmÌ8ØÅàãS,
+î î/ZgCkAùZÜ£(P]Ã­v0¡5¾ú/ýF\È
+[&¦&Ú)é¸W£Ð
+÷÷gs{!ª^÷uU:e°{P8É14[Ï9ÙfÂÄÖîâ2
+»SkØ«õù³`ü¸²ÃÚIæ¥
+*\|¨ÇÕÇ8`zý$Ù^1C4 ëèÒYÕ¨¹ÕCú¸¹q!v1×pÀêF¡ó(z
+-u)
+2¡
+èûÍ/lJb
+U®£:sÏYw"|«L×æÚÒô/dlxÍ×ðc±¸c¹°gÌVÚ 1VàbðÅ÷*Èv¦&²EbÓìÎ¢oÆ
+-²Õ^v÷~ c&.Ï/ªjgA¿`<ÃUÁ¿Ûq©Æ%ÑL}Ð-QSrjû/ÃY¢`~ôwå[I|6ZíBJðÖ³¥WÝkÉ°â9±BÝµ³
+öN(¨ñ¼
+­Jé¥6ZÊ·¿¹BREwó&ù¦1BScçÂÁø;âés½YZþý¥µéúÿ·j¥9Ö¸pBy}kCû¹gïä(K©æI¿xÔÔ½
+tWàÊÂ¿¬*É:î0|¼´¯ica)4A'Â9·ñ÷m¿wú	²`Cu|ÞúÈÉ§Ë±àªÄçê£.Ðn!T«¸í¶ 5ì¹»Rác¿½ª3ôbPÊL>Õí·
+-ùI`óÀ¿n¶ñM\ãu}³BÚ´,KbUòÄ¿cîÿ©*
+ì`N.Y}°\åëd{lK_5ªþ<é¨³elC0÷lªUå2 ¨ÄóÔ æ±
+ïC°NºSHrù®[ô ýÀ£Ù½×Y×PGÜ©èâbx`GùMv´&¸)· uÖQi£
+nuÏôJ?Á-÷èt2¤p$L$ëX|4MQn'Þ¢&f»£àËÕ¶á@pú:{® £[;î)+¶CmÚgàû¨!ùzèç£^Ç_ÇÄ9zw
+¤å ¥ÉE	¸!~ïÜ
+-Së&)ß
+h 
+
+-F¹ËøK¶xôú
+Dæ­rÉ_¾À¸CÁb¿öß?r¿]¥#©àÑ±Å÷º2ÒQ*(±Úu³ø}þåpÔ)ÇÍîÕÑdØá¥­¦-Å¹CýÈ	ÀD¿a
+-ø¢Î$å?ó{Þ	tü6Ê4lÄfÇæ5©
+-×ËÓAÝtÉÙ:kGúÄ¾ÿÜÇþ!2Xòöþ¯Ê%^
+#@ã«cdï!èr$È¹?ö}ã~Âx%bÐ£èz2Ëäp÷«8
+þ@Vb³ þ2¼·]LG®K¹G\Px1d´­Âh ßèEô'ý¤f¨÷:Ì±ãBÔþ¥UÈ`àZhÜÅê.Å\oåéÎd¼fi ö26:Uñ,æç©Ìx;ß
+´p
+-ªVgÖQw°ÿ76Q	°È)üOåsÉ¹Ô
+-xRE¹æíÂo'¢É¶;ÝêÈmg2ùv
+1ï¤8ýóÒ+Íñ¤8«Jí7ì·Q©0Ü¹Hâúø~8ç¼½ÎÝü*¬³_FÚÕuï±«Îº¼O\/Ï¢`ïÙ¤$}ºi.yÄ·¡XF{VB­)
+ßo)Lì{	¦"/~Äì ýþl¹d´³³WL¦
+-Óóï, ó
+-ó×ffñJë'òèDZ.wg¯DÅ#T¡ûúCßÁ\Åñô×¿y¹Úánh'È¹
+×¤¶«¯Ë7x¤$L£ÉkïÛæu¡uã²P
+-1`B°´K73_<·×Ák -¾1­ß)ªøDiAUM¼¤WáÉ·¡!
+(>¦û^bÛzªâ'ß×V»q¸&ôúÁJ¾¡ç
+-µucBEY*ÖÒtñ¹ú<Ó(¯\õ}¸o§KJ,Ô y}m~½³ð.ÄRèÎ+'Q¦î¦yl¦#ð x#(ñ°öî©ãvÖäMUTR«ùàtüµRã±½á
+ß÷y ¼væQ¿ÆHø
+WW@<ÜUw=;m~ËryíÙBì¶x<=i
+,í£ÒãðL%ShÔ]
+^Vjü
+-kûõkùh¥Rü!Y>öôÎdEH(í
+Ç(ÎTC+ Ya¹îËc¾ñ5ÅÜöñ|ò Íó
+-dÿ[BÏÃ'S2ë«Å
+®aè^Ù3nä
+7ôËÜ`ElEÅø¿Iò<¼ªÈ%R^¾rZýÒÙÇÂ>r6?*`êÍË
+|ÂÝ÷8K}3KBÝïX½óu
+x#þp4ÎTS)
+-°g
+79ËÁ5ß£S¾Þ<^4çGo#ÛíM rµDó°§êÅ£83B>(Ä¹âqM L[TF¬ñþÈ»ªì´WÕÐü]
+DßºÀxÀöóZîãwHùQÐåYÖ~~úbò¯`âÁ>ÊßËõ°è5:ò
+Òr!úÖVêg?qù­>áwÍJ@<Â»VD=Óà=Ý='¯-ô¡ÉXlz¨0B'V'i:¶~	aÎ¤ïo#
+dPò^É£?÷]úJyÞÜ(rPÊ¢¶EvôË7ýNá£6êÐÉËÜôLW@=·¹Â#Æî:Þ°Dyv­>þE®@Fæ &Ü5·³!ìâPE¥¡h´Éó<Qß¢Év`ê£ b¼ôæ½²ãÈoúA¸4ÄùãØàPubýÃ1Â¸ÛkÆ¹ZG2ø=Û©c·:d~lIÔú¢íðÝÙ!â'aµ;Ä¤YáJ*_6
+ÞÄåýIÄm¶"5 E®cêº­ãÃO1
+-WÏ|É
+sÂÉQö	Æxê_ÆgÓ¨Ê3õÄWÒ|=hBkÒ
+"»m`¡­	?ìBYù­Û*¾ÕwPoÙ¸>ÇI»u+VçÖØ;g³,`ÏïÂCÝé
+/èBËÏq±_yfgÛÈ¬ô
+--îm¡8Bó¡£$yAqH¾Ô¯F}esaep
+¤(ê
+ð+ãsOãó
+°q°/jÃX
+t¦£Ut'
+-ºäNEÎ3RU#ü"<T+ø~hWðÔ7G.Í2à¶eÂs}ö+4úYä=XÀ·ª*hEìÓ	÷XAâ4@
+ÁCþÉQÍ>2¨»ûÓèÃë@¥m®¢UãZe|êGÕÇ·qa
+-
+-c¤6
+jçÓìïDèC<êb×Ì!GÑ¥#*­T«(ÉdhXlB)Q¯=EJX
+Òì?P ÚïÇ6¦ü ÅÖeuM:¤PÌ5ÓÍ[Ø
+xý¾N°+
+-Ìãéã N{ï%z¯ËmÏÃ4ûâ%¬!
+ã*Y"ýFà¬±_^Îz20Åäcf@µ
+$Ø¾ª¿íEã£$
+-ÞJÂP+J½åæØÌ]æXÇ
+Õ5%Ö¨ú"ëQÕíîBn!6Ø^
+'Ïýb¤äSEëØ'Ô/ý.Ì¢¾7Ü[Âè|}¿®î
+-¿Ü1õ¤{w+ÖUÌyÖJÛôAeÒ&²ÛQ	¯
+ÿuï<Üî´'üYð¾ð
+q+õÏµ¸yG£
+¡Ò!Óé0ÝÆ´{ôý<ñ8õ"Á¼HÖC¶¹Ô¾C
+á=®5X`EÄþáÔF3ûê´JZÄ²ý×¶/;âG
+-
+
+-ã#Ç!¬ú¡Dæ[oåìirÀj$ ÍP©ÖkìÁe
+5¬ª
+Ç(A
+B_ÏM,]3î9é4/]ïÄÌ6­
+-DE¼¬Ýf:	}Ç«´4¡m«TF¢ÉNU
+»ÿ¹æWz~ÑÔånn©-m
+3}&C£ô¶muïSq"f
+ïÕæÔ&i»(Ã5ïóëàU:×¡Q$2oÌáö³IDÚ<¥á'·Oìkó°5s:@DZ¾wøØ#^sWm~~ÔoºÝdÙBr0Ç5²ù!ÈL©Ò?¼
+-Ó¹é%ÐX¢¨	gð«%ëÊïëî"«Uz­!fýPØ®õXØ\lm}Næèã
+æ¹m°±O
+Uúa~§ÓÅXdÕT
+|zlÍ/]rjÃüÒ÷©
+-µ¼Äá
+Ü3·
+0æÌÅ<úÙ¶=}æ~Ø+,
+·Ñ$Þ¨&_&Ð]?*²â7L÷Há(OªmX®LÉ^ÏÐôcéêã~ù¦Î-õãõ-ïJÙ¸Ë$ì
+Q[XhB°Z
+-³`ÓùÊµíZªÂü<ÿr²dè&Ni
+ð¬8 0ðþMµ§
+vÈ¡kÝSTÖHâv;
+ÍrÅÕ
+wü,¯Ú;ü±¨[©TÑ
+ùõKã×k¢¸#×3-}?¥i¤]9}KÊ|*¯;²¿Ý»{
+ô®Í]@.ãA<G=käÓÅ2ÊZw¹ÈeÎ±µ$W!ë\FxÏxd88Ý9TSQAßùr3Xäà$bÏñÕô ã7ø¥«=ÿzãtµ}Ï
+-Ú3<*Ej«/G4þÅ«b\äÓv. 
+*¡vÇ=já^á
+T·6¸%ªÁ¶¨ÆmyÂõ';Ø5ó
+BÚoç:e«Ku±Î`('¡{´Sñpâ¦ýtuä+Õ9PÄÌV
+ÉtÇQ´øèRW­
+71¸¿ÑÕ*)äËiDjã²¦ãÙx¶+K
+ 
+-gTp
+-Ì Ò²Ý·± ðÀßÞvÐüt­*¹s
+x=®9·Úî3òÒ%òÕ¸[³º¢uQ;pÓ¦¤5¹V¤Ê²8=KÄï;	û/kÙª¿>|åW^Qñ¿x=¢ãöM2Í²3Ðøè|Ð@cÁr»	/æð2~-
+(êw¢³¤DoP
+[ªÉ2hà¶0îdÕèqµ¬X@déª*1LiÎà W·1
+º»8!µ
+ïtígn#ÐEI¿EK¢`êeWæP?µºð@«wöwOËÈD
+-==»[vÓ`Á
+gC^ÓiJïk¢¯ë«rßÒ(luØÂ
+NÌP)÷¿&¯ |Z7&|Páfj¥¥gµçÅr¹EãÁO¢°tùÐÁ
+tÔ0%WìpL/ÞÄ±Ý¤ÄÀÖe½å²&M\ùø@U~zÉ+_­÷u)#@Ý¹ßA»
+/]ëÏ
+-+È³øÒD~Þumrý«Y.
+-ììñËé¸
+ªdp;¤´MnÖ;`#Ð6np»0u"ÃÍÊíþ-¯Iégzø¨4µî< ËÞjòã
+-7ø*îÐº©Iã,vó(+_/M|7~µ krÖxßg_ôn n?È}^äïäNFÇwn??È£.i¤e&£æ0uX
+×àòn	óª#õ
+:ÆÒ¿rC&=c ñ ~µàwd¸oR¹ªTÑÿ62Ï6ª-c_vÿVcÄkf#²â_÷þQ'y­rìÈ
+]
+\
+,¢,a.±{¸ËÜ®qóÕbÈfýá-ÍIå9VÛ	Bþ~j]>önÂpÈTÌáÛÙ/
+Íaåè~sÃÌÄqÁ$òÐIê
+-áñArù¥ÑeõÉÓ	¿vºYÆmð
+Á÷8p{åT³@	izwBÜÅGoðûwÍ-'M©IfxpÛÄâ+êâ5Á_#âÁX
+-
+éÄ£+
+sñ
+$
+v$ÔCSy³1WÐ³ø¥f
+âãÊzkú~þ¹áÕã-¢,@¤¤¶°°ílnzIÛMßÓ^©×³}AÞ­o
+G}Ú«´Ö©» 
+jn©ùëÝ^¤%e¬~ææn7kecö¹p¯gÂú¤c
+0WÉ±³ÓMfÏ
+-=ÊpZ%~Å
+³Wî"rXyDSø§¨£öJÆã­
+(ïþ%´,|
+3s
+{JZââYH
+T²ÎZ¦¯çy¢IáÁ>+Ó®ªÔ&¹¨BÀÔx®±#âvlÃ[´U©M/£¦b=Há5ÐK|BÚ}µ5PðVÛQ±>² 
+ËE\ÀæôT®ë¦~A^÷ä¥&ßo3·
+ì3¢ÀÁO Þ8´qFí·
+H7=¡À_z
+yþ
+·ûr,NÃ^ö-^*UôæAîE¾0JÎÑÒ*÷Ðè©k¤óI@Mòø~bø FO8í¨Òó,t
+-§0!£~!¦Muw
+ëÞëUlÐ4R¶¤²®É§¦]àÊsv,ãÑ/÷:ö+Jc©$JÕÚ¤Æ¹3Õ0B¡ïÊJ­[B¶©v¼yB©7Å¨ÐµÖZ ÿj
+ÏÜË»é3xµÙ7ãùº(C/	¦=V&u]ª[iË>C>¢@o	irÎû°g<\sÉÅðvôÊ
+--Ê$D`ÜaLOOIËS0qø±,~õíûQï°yürHþ»X
+¼
+-{)ÓÄb ´o2ØÒ´Þóö°¡om;HûµV­ÎØ
+XAuèLf)h
+-VöáûÒiÌ¼ûsÙåôÚõMi½{QÝRÛ]ô#d¦I`<kÜµÇ´(#
+-%æ=L&29áfýFNNaµJ`ÌHÇ
+$÷ë[k
+ú¥?$£RÔ D»
+íCPÎó¯´aiÕ3Kû.kTe, xÅöè_KØOkqú¢dÊ!áÂp[o*ÌÒÕ:±r¥G
+p[ÃÏDWe5±Ëu
+óIx¥Ëlâ%J¿(¾þý
+ïÒÔÈ"Þ.ÂÃ¨
+Ê¦Bpa!g¤= EÃN(
+Üëãa£j¸uÞnÐåÞÀÚâ¨ò+5mòy¯GÎE) hµXÈ1ÜA±Æh°ÞMÈjAôä@¶+&N}ª>eÇeo*g¤Y5 LòA`BÌÚ¶:ân0.|iü\@¾
+ìä«;fÒOÖAý|\&¾Úø(sÒì©Êï¤`Åt·_òyÇñ9¾QoÖ=Míó
+!øDX PqöUI·¿j6R\w+QZ%£Ì³&{ÊàH¤Ø»Á(Ôô[ÍÕÇ«0/xØ¡âÉL½¯Â±z
+ñÁ
+V
+¬¶áówiabáUf~LChÞOËêÇÂ¨Û-î²ÄÛJôiã6fèB÷íÁP2¹7WÀë_~kãºZZ;b.»"GÕ¦p.&4Lt¿X¹B0?JÚqlÐâGVAÿò
+ªsÿrü¡®.¡
+/ÝèQ¹ÑLéÚçT1OÓêÇ|Û¬þÏq²9Êï}>)õÜ.ëâôßÂ£¾w":
+Yy iMGÊ¶¦ß´ø$ú÷ð"¨4
+-P Âªk_5ÔçKí/Aé.tÛ
+Zo.L¹)¹ ¯ÊG_0ÍM/Ójqv4jUÒò ´~0
+-~ó{9Ô¦Ír?G Ç¼õrÞ	{ÑÈäþ³åjzü6x`iMÞ¨º®OëîCADD
+äØµk4;3Ä;XTr^W®1æÑÌò}¾Xwh×mnm3Ñ7w×QÏè	ÜSÿmAÄoÆ(ÀîÿY*Î¸¿>ô«aPùI(	ùg¢G
+é'nÿ³gM¼)z(@£¿¸¿ôúA
+-#m8kôÎ¡2b	C³N(Wi[K&¦+U4ÔG2¤3¿8¾ê3±Æþä±åÄ±VdJë?éÜþË_ýkÛð;9¹RpµØ=/À3moÔ¸Ùø÷VéÙmÝÞ6ònÌ?6ÀKKp"J¬<Nle~¬6Oì¥Àc
+NVÿnpÝÄüÄ»Ut,1eò3ÏÑýæ!;y#¿¥ßôá×ÎAÑ£	®¬x×ÑüpÐ1FÙ=CbÍs:^ò±N	ÔæysäÑ¶OwB Füçú´Wi_½=HøL4,ºáñáUlò5õ,Ø@]ømP¿ûJÙàý(nðd­©ü#yá Qaoª%æËÒgJ®ÿ'ðùGï\À|Ó¢_:§²ÿ|X
+Í³a ïV
+x¿Íuû²[â9^ØºòÏcû7u|Mv/Öhö2!Enc±Íâ.p£Å¿ðxü&Ü{vÇ!ß»å·í& \@
+ksº~Ä}|b¼þoyÂºÇ05TÒß2ÌJ
+4=â(Oª{)ïbÉæàS
+ë1­¨%kymõnHc9`âðå%ÍKìõ¢,âÿJ©å#ùmd÷õ bL:¿o22:úóÃçPn|>.P²Ò
+-»YçÎÇI¬ÙqÜBìsneÖó§ñã¹«D{<¸"~î²&URÒ¶©^eæxØô9åR1Z's/Õwí«øª8F
+¤®å8Â©#ì
+.*üö¶ss¤S·Ã:L®dy1"LF*h~ô£¡ñ¼~¢Êºãº-×ßâ§Pÿ*æ¿3V¨{ªò´^!>v ­
+wòÉT|5}f@.á	oÙD²ð!
+¦úø@F´wz6swÜ{ñ1­3¨¯uJÌÄiãMv
+
+·Ò+Ú=	:déÊ0¿Þn/èrn£ãXãJÖLñx-hæäqÇØTI²LS³=5ùÁScô¢u¡	Û¶ª'Tðý]=fçAó=M
+¯
+äóÎîa½59ãÙJMÅXDBªÊ6!µId]Ú6¡ºg×í; ÊXt@Wj!
+GwlÐ|BÆPx_
+&¶LºV«¹òÍF´ð5ïNÕ
+ÇÈµ;Õ6z½ÉTÿm2|êLµéZ
+\Æ>ç$íBÖ%ÿ,Q¦úTnzb
+-§`Ð¹`¼îÙÓ9ÔýCÛPÆEÞè%öÙWÀi\ú;Ô1ê£i²»
+>µ:E?ÿ¾Öç#÷i¶|.8_Ù
+-ÿÄb¹»ÎÚ3Æ7Íy«xè<ÛÄÎ"®làüAF$·¾C»Q~KÖ­þûÊcÑ@êlÚàWö­«!½=¹(À¦:r½#XÛ¾0G(ÁòcS"aA¶½Ñø£Þµ
+úÚo¶JA@Û(qî¦ç;Ã+H¯
+R3¡çn¯Î	H¡8çyM°O3gÅga¹WØ
+-®e>´l¢°á¶©zÄ$^gcý
+ÐÄ¡¯wÄ-
+-Z-Êµ16(}YºÂ7×Ù¤Pª~' ÙºòÉ$¥¾ïI ÕÎí®ÒzVÙrÐèÞÇã[+CÄ8H¬h÷Ò*ÿ.¬±
+/1;'Íä¬¥óëüìaMJ²ÆïÌð|f!ï$zÛ6$
+ÀsßÅ$ãXÃ¥¾>wUj³=5yÉ
+6â@}U´øj©õ±)¡a
+-'2^&û/æÏQ2
+-¾¹©¢0&
+-g´´k9ïÎ
+NDcYþybc<^d.üjÉ
+ñû'Ò×³ÔEÑ
+H
+Â#Ó>HË8ê[¢2áHV²
+îÉi¿Îê}rÏØw97â
+´xàôjHµs¥Ï{o¡
+-Q~Áp%ek$ÕàÓ _EðHßµu@F²+1Êù@
+ohu»63&@-ÔÙ¹§gõÄ×`ÑKeåªY
+-©Ö«2ÈwÉ¨dtð¦EV÷öf£Y©:ÛRÒçÝRß¼µÑ~µLwCrdI"mÖÙ²l
+-,-ÂV¹IË;Ä./#IY·~AüßÀH=5i?v6uçÀ(wÀÀIÕ©IÊuýWØo]·9|s2KbáÌ«Ðü
+-4<±FÉ7Ç¯!Úc I®Ç·ÌØßqý}Ûª(q1BB{óíZD+<~ÚÂ½*»àvè3DæE§¤Èhù.
+½Ë0 B)¦ù´Oe=D¿:H6Å[ûü>Ý
+%ÛLÙÌ?E¡Ê=/"
+âWÆ×¹ÿ¬K«Vn;E££
+-endstream
+-endobj
+-761 0 obj <<
+-/Type /FontDescriptor
+-/FontName /JBQPQB+CMMI10
+-/Flags 4
+-/FontBBox [-32 -250 1048 750]
+-/Ascent 694
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle -14
+-/StemV 72
+-/XHeight 431
+-/CharSet (/A/B/F/G/I/M/N/O/P/R/S/T/U/V/X/Y/Z/a/b/c/comma/d/e/epsilon/f/g/greater/h/i/j/k/l/less/m/n/p/partialdiff/period/phi/q/r/s/slash/t/u/v/w/x/xi/y/z/zeta)
+-/FontFile 760 0 R
+->> endobj
+-762 0 obj <<
+-/Length1 1407
+-/Length2 6093
+-/Length3 0
+-/Length 7046      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚtP[×.Uª¢ôNP¥J
+-
+é   ¡$B¤*Hï½$4©4étA4iJGAþ¨ç|ç?ß½3÷NfÞìÕ×³×³6·¡
+-
+e£(P ¦¯¯-
+- %D@qJ>>SÆþÏ
+öD rÿËA
+-
+-`ð:uï§Bt¼\ 	 HZ$#Ä@Ù¿
+Qh9:ÄètPH¸'%ÊÝptÂàËü}@ YYáßá 78
+ úÜ
+-_
+-q  8Æï_)0w911Q§(
+-í¨$(
+ðA` ÆpO8Úü
+0¸Áÿ ¥ä:!<ÿèMPÀ+\P8Òá
+ÁÑ |q¶
+à;
+ùÇYï0à¯»DAÿI÷Wô¯Däï`rs ýHGÂ¸ÖÅøb$ì#ÄÕ
+xC®{¼ÃïÎ! ° ø<O(áñõD¸þ(ö+
+-þ505
+ñ¤üÕ:
+-â¯ÝOìÏd](dÀ_	søæå.fDxxÁµÕÿrÁ«(ÿÑ9Â1 )à-[  Ü ÷
+:ýJoêçÿmü­Æ#
+pG¹
+ð à8þ2Àâ
+-`Ð^ðÀÿmø·D	`(`wD )ÿÉWÃ
+þÈøá£¾ k {  ð×ï?§{xzÁPHW¿ÜÏWLÃâ¦®±ÐÄÿ±©ª¢|ø"âR@ H\Áÿå?øÿÆþ[kAüÕðÚH üyãðþ­ àß%
+Px.ÃÿPß(â? ÿïø
+òãý¯,ÿ/êÿwC`/W×ßfßöÿÃ
+qC¸úýå§²¿ú(ür ÿÛÕþgõá0Û[µ1üz¨ 
+ñI%ÿè`/
+fÀ@þéïYàk¸"pC'â×ÿËß:¨
+þUñÄOì	â_AÌïáþáø%ûwH(
+-ökÅ¥¤4âG'^Âó¿¶0¸ïo¾ÄD(
+>Ç
+p@¡)¹üÒQþ+/Ô
+ÆþM|Ñ¿åß+ûÂ¡Ó(¨|¸sMxËÉ
+6aÒÝKqág÷É1=ã¶I&¹93º8ðt7|ß¹Ý@Õã$ïÓýÏµ\u~G"\àuG.ûÉ#Â÷ÉÇì×'i	Z¤©rÊ {
+9¢¯¾¦¸
+-sì1á£yÀ_Ó5ìsþ9XF'¢Å íõç9zì²æ[KÆ&û~Ó©fþü%·ø°å¨t¬ëº
+-m§I>UWúúg¯ustDèx®|å}¹¦!ßÏ®.IVe>[xå,¿Ä{36À^NÑDÿ)·13e¿ZaJÓ.³Í¥sNS2å&3MkaÖÖ	~*!Õv+=ÿýõÇO`
+-s`ãà¶¦Æ§I>»R½
+mÈáyàTþ|ïaÐ[hçJ¨¨E|îi7íM(ê¸I®à×ól/£-BÎÌßæ"ÇÕDoààAÙS'LX
+lö|OÉZC2'$Ò1æ-opÛ&É!Øs+á^{.ÄÊLòÅ{¶ûiÔ¾3xäSY®ùXÓv>Go¶ª
+Æ
+-Ü$Ú0ÚiþH>Ë«ñy;}
+ürxÜ.U¡LËþÔ¡ÚÊî¼_6N2ZË"Ë¨
+ã°é¨Þ«»>Ày5L¥#¸I' ìB]øÈ{câ·I¨eJ-àFÚü×ò·ýá63Ñ7Ä(U´ÞT¨:ß»Â*'L/¡@¹!ÖÊV;õÓÏ±»|4+aÐþý{6E\GANU
+0JÁÓ;
+%
+-ÙRK7~©£âm*°¯æ¨+¨ iª
+´yæ¦¨ÁÏ{]ì=Á9À³o+ÎÆ?éóÃØf·äbE}¨x#î
+¾ I÷dzB
+O®=\GÍEja¤,þ&MPupFbÏÞuÏ§SçÝfßËóÜ\±ÖJâùk-±±íÎi¯~D$y
+Æ¦ ð·½ÙneL¡í
+-è;n`A®TO¨<î[ïîy
+l¿½ný~.Å%·³	,î¯¬ÞM×Rçaç¾
+@F[
+ûxbµR½#Wò(øPeg|×S]q&-©Â~Äo«o´1ÎJ>q÷ ¯x ¼,S÷{7)il¶OôÓAöQë+B ÚN^ÜÛ«jÍA¡íöìºòðô¢@ûè­O@¦¤Sü!Ñz2m»áÅþécOiúUY-L(t¦!ãL6ö¸ÇÛºÅº#äý#^§~÷|4ïì{£D£Æë·äclO¼Ûé³äC¹^#ÎÃì-½`x)¦²Aétékè£÷Ô=æQÇÏnÞá;_ÎïLÑUmx×
+0B}Âv
+-C	
+-­,oKíÆ\ÿuÞbÒ+vÞî´æ6Ê>")	G,°õ]nä	Â¿
+¢Ò\oÑg­Ü«v
+Óz[Å}Õ¡°¤]V0ds
+-úFÏ§DeJà
+Êú1»rÿ'k¥7ºZ8fcîÞ{Ì¤­$Ç>6OAÏ:ÕC
+®­MCn£òj­ÕGjxl ÑØÓ½cA±àÜ}lý@
+ù }²{X]_ohPÍçy¦=óqS»ðÓ"j¹ÿ~ë^qÄó:ñ]>?=¶çÚ2Ï>+5XLêu1­bW3
+]hQ
+¾_Îcu¢îÎbÜÜ~st0¼`ji<üa­¤'×±«Cy"Xk*<Zâa¾uuèÑZ­lÇÍâ4Òp<IQ·êãg£Ù.¶EMW
+-=I7X¹¯ôR$²·×VÄcö
+-ô3ÞqTîyêrH·Î¸`|ª6¾@re­F¢
+Ê¿ç$¹n
+-
+rú¹^"
+w¶a,×:^Ô«:JØfmö6ïN$- o¢b¾góå2FG*áJHÇ¹2õBÎY·Ø¼
+ÖAÅW½h§Ì~n²<uÑÝ ÎÕøF¦
+-^ælÏ¤÷ÆQ!>b&¤tP
+-©ô#Ù¼¶§Û¬ØÉLê=}«§|5Ê
+)zAbâor
+Â^9Jå±
+x!Ýò}tÜ,íÎÒ7
+-@M¶ßr¯ÞÏyßëòJökÍÄ
+ðå&^qå~
+Xú7Ú|}x¥ôGè,é{ÀNðÜVñxä
+-XÁ»Ýßé,óîJ§Y¥<ë¨ã¸Ñ3<s\Ø?v>¨'ÅÇöÝI#ÜI²w§ÅìfÑ9?ìMóÁ#[ÖQmD^MáùÂ+l	·yk¹+
+-Ò@îÜ·âeJA\Ö¡DßD¬§²Û¶b|\ÜÓ=e_>PÓ
+Ft¿Z9öè7é*¦éàI¨D_q$¹ÀÃéP`ß¸úå}Ieºv*_¹
+ÛB'Z_lJ{Áy¸ø
+-êu\oKtÊ@©ßw½=·1íÑz1Ë
+-­Á5ñÖw-
+7Î¹«¾Ö³v[ÃKDÌÇk_mðÞþ°Èêàa0ßVsünÂ'CóÀÉè
+ëDãê§2^ô;k^1ÔIê=
+["¾1
+-l&{ßMÝ¾®îIhïD	
+LuOÆ3<¢ÕZ0é
+½Á¼?¦b/2ô§
+
+9?Ö
+SÒ
+Ç0×Qe/u ª>Ýì®&ÎpiõNh1Þ§û\ÿyË^â{DÇjúQ~¢Y¥3à
+N4Sûàpøs©Eíõåª	û
+9¦2Ëkú
+½
+JgÉÓ¶!²béQ½Ü
+Uôéw*¯gêïP#ëuÒÓÆöåÙ
+-oÉ
+-[-æ]~R>ÓBÃpY¥8>T=áY:_;«­K	ª}6!\~<Þ?¶°ÃÚ²Âð,kéyx@(ýWìA©Ä-\'jçÉ
+*<ª¸qZPã¤ªMßS"³¦.	û+ßWû¨­'³,Þ&®]ÚË×9
+-%r¸3¬rùA«çúòÈÕø®Õ0Í°²¾{¿}É,v;v(r&ÙãïWÓÏ»¦7¨¹+Lª°+eöüù;ò)¾
+)·ào
+-îP¡Ï
+§rå	v_æom³¨®[Ø×{0OeÀhO}»:
+-«¤uß³8°ìjRðèoÁRKïSm¨w0¸Þ
+(§HqÉ¿íâó%=ÝÝM6Aÿ£¿Ò¹øº4Ó.
+-AÏw»zVw<!l§E¹è»
+-ß~²Ì7
+nÔ«ÔÊËç³µÖ©ôÄ¬nQI:?ä$3#w¡	ÀæÕ»Oi@øä;¥L
+-Ãe<l?]kqÑÑwü^Äv 6Ó%3>­gáj¡m¼Ï#+À¾i0ÛÎDÿH0dõuþ)Í·ßÅí×Fx¼3ÊîJLôxwZÞÞ¶éáßÈ=Å7<ÔÆÄ{ýôgAÊú]q¶Å Ð%
+ØQÖÅ3ZÌ 8ÍMÕ®<NÐôËø#Ù¤i(QRä
+-ûö8,«EaV@"Ö¯ðØÌýáj©Z6µý¹¦¨Âª¹ 3f)ô®b!É¾/¼>Tö8Ô·A
+-ÍÂE[£0ü¢ì-5¢aOÕsjGV7ãU[@`9·x®Z¾+8
+Ë{Â©Cdy-
+5/µ3út	1tï~r6¢ìê4à5Õ("2<Ô!}@Àù±4/6\¸Á6WÏ*þ={÷
+¡°E#¢{½]þðM3þõhÚ0ÃÉÙ%®6Ëõ¿²V{sw¨n±5-\Di×ãÈx.½®
+-ÀQ>¹
+ÉxÓhiöø0¦¶Ã:áÎ8.ME
+W4FóSc¢_'dF¬¨.ÊLnpaÕi2éüÿ"äØ[
+
+£
+¡7¶¹&¦=©±7`T~â(JìjVSvä.}¸?à=t¡£AïÙ\Í¹ÖÌÃX	ÝzWOóèÑ&.õMä&²ÊòPºäç¬r¨Ù¼Ð7ºðö½kÃþgâDñÖý,_ZqEô[¾&¥ëKìjræ	ëeÎM¦e7.6Dàíþ'Ä¢0\ý1kÙ+ó'd+
+Ü¥S¢n¶ý>tÕ2ÉÍu5¾H@H0Ñ%¥JÈEdðÎ_}ôAZ¶~×V,òÔÅx­
+Öyþe]«¿j ã}
+LÃ~Øc[yÜB¿â¹ØÒmreðwPïM}ôÈÍPA©°²°÷Z/è©Hº°j}efn^éëó«òr¹Ú7ëÝä­?""Egv«¤ùÉê"GÜZ.¹aX­î+#\ê
+Y¾HÄTÂ
+/aï
+Q³îÓ­V¤f}³ý.Þ¡aµ<OÀKxÒbÑ´¦Ïç¿F®­È|6üa(Ê0ïÎëê"î¦àï
+eïã[:Z¤__Oz^Ö¥
+ÞÊ>§Is0Ë.Rc´aºÔOÙ/êÝ×D¢|:xjÀf¦H¼æÌë{øIÀðÐibSùI]}VG!s¹k´%£-Ï(|ë´k9Ò
+Í[so?ÆY³5½ku	zºV}÷fèð¥
+-ª¯ÓãúPÕ´ùÅ!çH^ÿ¥B$ßÛ{/¾Z
+Æ*UÃüThNÞw<Ø äÂXPE7ÁÔæSMgù*D¦=á»gko'mÕP®Õ±©¾1¸IØn"qPÚ{&
+-
+ÜrzàÃÇ;Ó_Ü
+ó`_{Ï"ßåxÆÖä	l%YODÇ|q§U_®ÆÕdçPåU
+.®o¢t£%Ï'¨ªB3òTR¿æP%ÁJíö÷2À½B+üu¢IìÛ
+û4 fõ¸è ?ë^^êM\3ùQªM/ÃD*>Ï}!Ù"ØåWâÈxX-Ë)ºîÍÍ84,³X
+9yóÖïFÀú×d³öYý6SO
+-ô3	n
+]ðAx?^þ]f¶mK#:8mðåtÉEºKw³$_]é<ðÆ*=gPÈM5âù¶':~õëê
+-èàøÞøÓr0çÈ£³&Ucº²6©ËkÑ²ÈÓÚù:y¦X>ÁÌVB#
+­
+CÁ³3ñMåÏBT~AZ
+Y?2kt½®4Ä[x3@
+-y#ì	enD
+-Òì1ÔH,ãÜÞAÚ+°!sëca×²Y³}}!ý}dß^öW RcÛáYßfâk¢v6x1âÔK/Ñ,ä°e$cæýJÒï9÷ÛãVí
+-Íú2Âóã¤-=}
+zÍØ5¹Ð¥Lh@ëMs'öe
+Ý©düÐÓSäKp8ÎnkIÒ}S©¹uñÞ ûý¸£9¨¢çJ
+¾Íd¿ÿÞØç¦
+ÕÞ±±mî(íÿÈÂTë\"-Ü}[)µ^ïÁØØ'Ý7)- PªúâÑ
+-/7Æ®:~!ñ^)ÒÄk{Îüì¦Ì
+Å+úN}0êÈeÊ2£	ãÜ1
+ãÂ3í\á`Ë>þü"°<Õ=ÊNé/ß
+âj
+]ýäâ»b´o÷G1êGyÆbfD¡´B2%R©ÚþîES³©,áÓoeHCìÚ­©?p°{
+hù«ZîÞKNl¥5:4+ïJpmè8è8!ÌNë&µ7&~ùTóg`ú Ê&K
+å2htÂ
+Tx{si0Å;DWågAÉGN/£ÆîØÓbëR¤s ´mlîÅù¨´ñí£1+3òæâÅ¨Ì¡IÛóü ë½©òÃØi§¬rJúVÞsñÏRë¦TÀ[ÞR
+-ÕÈZ# |w1KtÔÛÖ:Ñ>~EîóOP[®JÙ­±8ÿT
+útcÔ<¤å wâàuT/mqCSïæ1<jb+.Ð;¶Íp¢CõÖfÀvæõÜBïÜ4­ÇrÙªFkf÷ô;îOaïð{ÚÅPEn¨Xé©¶ß£Û´®ÂnûÓgõï=4|Ð|ËIÐË.ûG15	BzÅ4VÕq5×ÈºÎ+èëík­³4o±Î:÷ÓÅ
+->Ú~²W3íïîÄÑ¦Ym(¼ã´¥ø¼»²¯²í
+
+AsÎ2¤.MJPº·"}-PÍ×ÊdÞælTMæÄV·ËMÝ
+Wê9Ö¼×ºtR&ê¶~öD\Åa2¾¸ªÙIsuÑ!ìó®ªókò
+-:\ÁSu&@¾÷
+8ÈÕOÜÊÐÃ!ÿç¾íMl×_è­'ÏmÎ ÈÄ¨¶XïÁÈh}In	<I,æ#~>;äO¬$¯J/,Å]õ±s.µF½h¸Rq&¶qKû$p1^N|¹oº/KçýøyÌþÅ.Wª½Bk&Yô±Ñ¡+¨µç¤O¡å¹ýàÅ:íÅ«ô¹þ!|P
+ÓF6ÏWÍª¥¶ØÉLÀjµN7óæÆUÖè÷çêøïOgµ
+¾Óþ,úõ29U'¸ÝØÚÖZ¯9c{Ê5¤NèÎç¤ìp.ørPB
+ÏäýÏ±ÙÖ8k¤¥¹ù0"ÅÄ2spW9©yòp5-QUì!±©`Éõ|ìÐãb#Nsrù["Ö5z={Ãý/ù®Nç¤zÄÔ®ídÖ
+jð ôé¶n=v½ÐP?æ»5XÑ¨"©6BSDÿyz.§°1÷ÒþQÄH=*ô©´dÆÃû®ì6Ñë#ïr8
+è[ee®´Û)=ï²|®eÛ»+ÞÌ]L[¯%Â&³òHcpÖMVÏs§
+wÛ¤k,Òv>Ñ×µÚ¼
+Â£[ÿFQC
+f_õNN}§w¨°mÐJ	ì] 9»8üÖÁ§[Á2¢Õá}&ÙF«¶gEob,Üf{éffYe
+-Ï¿hË»¬
+µ6¡¤ê8ó¬(oCE­ÀÀ@²%ôJÜISd d¸NÅö1Ö¿yÂ1(FºôS(t&q<íg¢Ý4·vQWöÛÁ­«È¦¥ßDß~(U7åWjÅ3ÓvÐ
+-[-§ìËKv!gw\ëSHèzÂØOþ§÷º¡zÆæcÛëØª>0ý2Ý=_K©m}f¹¦tI µØ&AeÙdÉÆB9aòR88LÒtçÑRcAò§S6ïl|ZðmÌ´X¢H
+ëXØ­·Çí!´ÖgrÅ×¶£PÒ;eq$_7Z+.(â.ô.æH|;<bùÕ ÿr¸³õMJuî&ºFE.·l¯¨­ò	m~k½} ¸÷V×~öÄÌ¸niòX`!W°ëøÀS_{ýÖH|æ³SWìh<tzÆÕø®ÛÏã	I%1`Ù
+-ÚG
+çL^ö0>*Åm¿L4Z5½F°<³FÄ$ö]ÎGÍiÐmxZPKäÿ*ï§N%#24XÚÐ}jêÚn|¼mí¿lGkíå;
+XÃÜ¼«¨lLÙ¥58&Ù8RÙ±Öúªäç9h´áfÁeÆýóðú}¹=RÏíx}®Âé
+vn¬sÈ9IäVR´U
+¨ómEg¯fYu©®Ì¼È{®ºÑ
+¸8Öl°²$4
+Óêõ¦øIèO
+-%ê-W¤mÑ½ªBbF<éBWð¢³i
+e¾P¿¸Ç÷fãz§VïAºx7
+UMâ[íÕ&.¹EÎ-æ^ÛRèÂk.êßc]tW
+ +rv45Tj¾©#Ö) ,¢G:
+s¸üxkÍãÊr
+
+ô¢>4µq»ï#+®ÏÐç{M!wkðóåB*©Ú7ºÿÓµ¯£
+-endstream
+-endobj
+-763 0 obj <<
+-/Type /FontDescriptor
+-/FontName /EWOGKR+CMMI6
+-/Flags 4
+-/FontBBox [11 -250 1241 750]
+-/Ascent 694
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle -14
+-/StemV 85
+-/XHeight 431
+-/CharSet (/k)
+-/FontFile 762 0 R
+->> endobj
+-764 0 obj <<
+-/Length1 1742
+-/Length2 10518
+-/Length3 0
+-/Length 11633     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ¶P
+Ø-J 
+î ±àîîîîÒ@ãÞ¸wwwNÐàî®Á<Hpç¹3sïÿUïUWuµ}½÷©&'VT¡2±3ÛÙ:Ñ1Ñ3rDää¤8,ôÌðääªNÖ ¿Äðäê G°
+-÷¿
+D
+A@§W(ÐéÕNÎÎ íl
+-`b0±s3qp32¹þchçÈ
+-ºX äèÒv¶ 0<¹½»£
+¹Ókÿ
+ÆT &..Ú?ÜB6 G
+c -@èd²yÍh
+´¨Ø[Üÿ+%¯¹=7««+=ÐLoçhÆOE
+pµp2(À G	à7a<Ðô'3zxrª¹øO¹©+ÐxX[lÁ¯
+Î¶& GÀkr,@Á
+dû§±ì´¿îÀDÏôw¸¿¼²°ýÃhllgc´u·°5ZX 
+-â²ôNnN´  ­ÉoC 5ØîÕè´°½üQ9 .¤ ¾ü
+ØØÑÂÞ	L¶°þMáw×[³5±³±Ù:á×'já2~½vw?;kekçjëù0µ°51ýMÂÄÙAÍÖÂÁ$%úÉ«þÈ	ÀÆÈÉÁÂÉ 9 @nÆæ
+¿Ã«ºÛþP2ý¿2ðö´·³¾ y[^à=Á@ÀÉÑäíùoÅ#x&&
+±Àdfa
+ÿOôW1ÈôOüÚ|G
+7ãëì1þ>é½­µû?æôAIFVBBæOÆë
+íÜ tÌ¬ :f6F #ãõàýßaþ¾ÿÿCª´ø«8Æ"JÙÚ^£üAâõöþCÄå¯¹ ükg¨ ÿBÞîuA Êf_ÑøõéÿyþpùÿüßQþo³ÿ¿;[[ÿ¡¦üCÿÿQm,¬Ýÿ2xeg§×½³{ÝÛÿ5Õ ý¹Ër 
+gÿÕJ9_÷CÈÖìuÆéXéYÿ[Å-Ü@&NÆæNÒzñÃÚÂ¤h¶øýä¼z12þîuí­^ðkÇþTÁ¯;èôGscÐëýw
+b¶Æv&¿×
+ ttºÃ¿Ä+bx2½î­	Èí0ÐÛÚ9½º ^9{Lí
+á·À þ[ô'â0Èÿ^AåÄ
+-`Pýqq #6. ÃëË`óä77A& è_
+-À`ñ/È`°ü|
+-nõ7ddýûNþÑ¿¦³ù¾-í¿ 3ÁþÒ^)Ù¿Ý¿y}ß
+þ_9þ
+¾Öö¯dL¯µ9ý
+¾Æsù2¿ævû|Ííñü¯.;;:¾¶ñåzmáð/(ä2_^°3æ	´¬
+üz[#ïJ·3Á
+}z«ÉL7Q¨ëÔ/6c°¯¹"S.¾ÜÇ$®oÙ)/ìp½¾xáù£¨ÁõH|ßÈ(váåúÍ\çÍäf<daBîÇ~E.8³~rd/ºÞ¥×¥â
+ÒA_å;ºjJ3e±>p©ÿÜVvj1RÝa»Ä¡ÈÙ¶	ø
+©"N"ÃÛqïZ²982´ÚGÐ
+á'íâ¿sFì*Æ3ôA¦Z}5é1§Äå(
+ÍÓH]KE.X~H$?±åG÷FÓ23Ì<þ¹=?}¯ÈÜîSÊ
+
+[O gJÎ
+IY¸§	ï¸ò§ÅìeèÍÖ]Sm¤^æKÏ}}F
+T",S«µéè5rA
+èy}hÔ®Æ7-L)¼nÙý
+ç©
+AÜjæN>¥vÙswCB×¥ïbéð¥¬vQ
+\rº££T"·Æ-óØK?ÀªG|Àü
+rYF¶ð
+û£Ø"ÅeIçJ©gµ|xOÿû9«JB
+."0d¶	§Ñ¶ Ñw4­O9c¤ Í1Ø["2jÛyºÏ½mKt(¶¤ÅüòAYûaàP¿Ðm¨8ß kê®YZóRS:;
+-kEPcY8.Õ­IF>­
+Ä^ßAÏcË	eÚ`Ô³9EÍ9¹Ê
+®òsí=¾ç¦ËfgùêÍÿHýúÕF_ëñ:oÿn¾A¯7ñpq
+npn®n¸(Åt,}ýãi|¹¼·Ï>ÇÓEàæ½î6Î½ÛL~Q 
+®Ó8Z1éó)ç8v mÕÊ¨=_@µÀ$òÂJºÏµ=ß(ìR¸/!eû|õÎ 6g5ÂvJþJJ.Ó2ÖàÑEÝb|Õ<¯dHÉâ
+- %Mw} ü³ucº,~@`Üè5jëúi<Æ64/0¾åA;£áÁH0ÒâûûÅªédCD%	èÇ1Õ¹z24wæ+Ê:Á}8$iw÷pÜ«ðÓeöô´ùròÄ
+ê®ê®uÒiÏYº°+5b_·ðOLÏQáHG
+ºùiÈFs¸çYIÇXiÌ}Þ¸¿aa«­zÚfe	,k
+h¸¶Ù9\Óð ÇÏ7Û!¶zç5;éÍB}ëp=º6à.®ãÐ³<Ðimp½S¹û!Êr&­
+Åo]R_Ì\Wn¶7
+-m¯ºÛ)+Çà©Óft"Ã$¯ýÔN¯¿èþI´`ìÛ9ÏV_$-íSPåa£°Kê;ï.%°2 mÔ Ø×ñ@X
+ÊÇ¹XÆ«uêß  8ç±^`!%°	ÃËÆ3±C0xv+,¬ZÝ<E}AqîS#\Á,õmc4¦RBÏyªÅÉ@£l^È®`êÅcSëg<x	ä?SÆ~ÿfyÊÄ!ûHË»èO¤4Ó#\¢å»lWÛÔ2wËÄ¯^6¬yO­§Y&ð(pK!£Ý
+
+a)¨ÄI ZosÚÖlûâ·ßÌ»
+´t×zdµây=
+¦ÓÌÉ³qprìB³YspbàæËcD¼33Ö>Å1­"õ².=Õºë¶¼1«¼ªÉ(ñ6¬>óÿYcN¾K
+£*ÙOFÁÛkf ®éÁmóãfìæ¡4F'
+»ÉO·TìúÇÕl
+Ñ 
+42ÌÑrù+îZC´ûEÞùT±§i¹¥+·Ü@ û#,º0Q#äJþñQÿzÍÇ|»Q¹aF1WìÏnÑ8ä
+M
+½ÆloÝÎ¥ï¡¦Ç¥¦Tx|y>¢êÞÇQÂÉ½óXµR¡
+}s×
+.]0Í¤¯fùÃhÀÎìO@SÍ-Ð|X=ÄòñåÝX»æ9Î×§î
+&A_
+¦¤mO¾0«4`ñX1oÆR¥j]ÎÕ|mL|â1}VòOß6^P>l£¼<HTN£È?2â©
+ûÅsùKÅÎ	ï}"`c?'ýþðyT{í#	EðõJµ7jP·Ùg½=$¿­ú¶mI(*ïcÙ
+ãã9|wêüY o·ÊðÔÐ/*ÃOýÖ[KwÃ?ê®Ïrè½»<ñô
+-c¬qªá°§KPI°È\ÄffÕÛ?lhå
+÷@îy !çº}RCe<Ç
+ØX3ëÝîk
+lgÒª~¿:gRñA
+Ç" á. ÷ñR
+5K
+E¡Wìm],ÅðZd7.Vé]°ÈÛþ¾5^®[õj³]¹
+ÊµôÂ9Þ¥o"ÙóüüG
+-TJûñýq~!êíÆ«Ë
+-ýø(57Æ¬Ìtñ°µ²&XÚ3*K²øS$ÞÀ?Û,wÍY$`P#^Ó\²?ü³,ýñ6¹ª±£ÏðHºòNSxÃÅæÉ{E²þ9dÜuòf³ú¢éy&¿»MDëBÆÇÍwWn­ïrN#¡c3	/aÝs­î;^æ¬Ü$g8X
+"Âæ¿è3æiûÇªL¯%¯Tð¥X¾scÓÔÐÍÌß!½jæ¥ô»-÷²G
+|1oÊm\n|ÁÄ
+-ÉÝeV8
+VÆ¤$>ÀÁ ®Y­&~JmNtê
+ÑßYBúuLÂCÌH?ÿÂI¢þ¾ãÛºSZ
+9Ö+~
+¾µM+"0àt
+mõ×¹M&ÖlÙà-@|èNªd¨ä]zâà»³ÔÅQ®sè£f·£+I¸Év²;ÝäZ>Úr£OÝ nÄ¢ìØæ±÷m{] É³ö¼Hìý¯ÄÄ
+ÖQLâÝN
+Ùqm{2}brP3[;NW
+£¡9J,DVÚ¥p©¡ëy¬u9S\XÝ
+BÁ#ÖBs#),Ô¡ÛnV´^n]?Vr§gG©x
+zpQ5/ÕçÕ#ßr[ëYö°Z+[¡Ý#»ù9Äfê
+<¡XÓ,(à½OÔêjHÚd
+æÕéZg/ÀqðQ?Ä½àLkrßH¸ ±£ëBL!u«q
+´÷eMÚ0]ù÷Ì¿bLEæi 3OócÙ6²ÁäÚ
+ôÊw$»¢ëGXe~åFß@|àUQ!tÍsa
+©km 0
+Àú!D~@øZ#
+÷?¢HõÅ=ÏU³wCãô>i,B"fwÉôbfþ°ª¸¿
+¸$
+-	úÿðÆénkìtwÓ°~ééð
+
+
+ÝXbJVÑcûÓÜøóèKi¾í
+[6k
+)Ì£7
+EWqSeÜÄ×bàóH³¹kã¬T¥ýÒ
+ú­XnzÜÏmõEnðÂ­´;.k7ÈÉ!Ð
+-Äí¥KùÊ¡Z¬+CVý6(VpMâPi6têJÊ¸y. úGZ=Øv1nP¦¨À8ï¦ì±vÞ=ëßô5ÙNÈÖCåàt{|àMd!ê^2æ8ëØ#GQÑ	ûµ\a+zw
+ñÀÌ±ôù3*e­ìhã=Þ½òJí$Nìz-}çvÂÁSP7Çê9bÌÉ)ÛëÊ§Ù§
+ó |Ryg&wn;ºÑ/upÓ¬©úU¼þ,^ñ`Å½ñ¢Ê1NùË,É¹[¡hCLJ!ìèS¡¥lÜ9I´
+lH^`7¦noðE§nÛäæ-¾¼
+àXÒG'ßg^
+f&Åy+=ÒØäqÍÎçUýC²ÎïÄ".[ÙÑR©
+-¶*úá¹»LÊäJFÏÞ å
+-5fDôi{Ttxi:°ïë!ÅÖñÏ`cØjU+_æ
+-§ÃP
+-¹¯¥d`!{
+h6mZ£ñ~ôâNm,ë>&37J©Xu¿Xê
+ãºn¼Z´O
+f8öË/Nâîk¨¾Â®Ê.gò
+ùO½CJû$
+Ä÷¦[×ÛE-¨`_Ñ.©Ü, i{QÒ/ÔòåYí|ð¼¼	æiËÛlÞºÜÔ÷ú ¦8«÷(îÕ
+;
+-}Èß\j¿3ÞiÏÓO(nÊ
+
+-ËÊ ýÉÔzÞI´H¯eËAuÝDí¾/D*ÁÞ,¹r¦h°)x³c©ÕðþÀy¸@Ï
+@;²øgéØGùÕ@ú[wHÁUÑ_ê>Y¸ävÕ
+'É¬Øàõ´Y¥äû)AÁ2{â¹JlN»û$òfàå,ÝÂ¤·ybZú
+Ó8z«ÌhÁGÑ=çOßæ¶a qUÂµ6Q6Í=³&É;ÏÝâô\â¨yAj"ý¾Ð?PØjà«óëb?0I!ð³C;ÃqO¼õÜ
+ý]M¨
+-P
+-À²û
+k"à¬(
+-A_Ò¾ý/y
+
+-É
+#%ËN=a>YÌä·µiÙªw;¼möËÝ$Ö
+ÀÑ±;
+[àúhp ©Üü1®7+Ír8ã¨"V;þ¢ö
+cò8×çâdQgñ:àqAÕ]¹8A¨cN¿D¼k7'ØìrúptSµz2D}·>OzÃàèð{"Ò}?ío;´ã¿
+ër+'Wß }
+-E®dûª
+3nµIäçïÒ¯Ìîò|ã»9I<¬á¼»u6R\hë¡¹Õ¸j/
+ZâK|ÉVæ/¦
+cÛ±Û½.Ûè¬íá±,&Ké
+-IùÂÖÓ%I
+A~Gÿ`døyëÈöÓô='#ZGÑ/òoJ-Qúö}Îþ`½ÄzÖ
+z|ìåçNú
+Vw*Ú
+Îì
+-§«p
+ÎüÂ­E«6gÒYé]WÉ¸Ð{0gI'=ÎºÃiq$dÇeaa]a
+gòÒeôä§¢_Ê~%QmvÆì+¥Ú%°Õ]~WóÍâðßýþ2J=)$QÊÚÃäk}ðx<Ég8õ-@÷
+Z½r3ÿæfÇã@ÀV`\Tè¸H¢r=%së
+-JÚr(SòèN-	Â°!¥Æ²ÞP¥1#Þ¬\ø<óAÒå«Ønï×}ª¤V{ÿ·31³g¥Td÷)õýØÚ.yâÂ­²H).Ì¤@6Mø½ÉAÖÀìK®[ùaA
+].
+-§ìôêUÙTß3rîãX38KSsP\W¨tz1
+-îvð8¼=>W²êâa
+ã±QÖXó½7ß%úN½æMî,OmBª2ûyGÂäeÊ¡°]0OA|*  9
+
+ø¡­NÇãÜÞÀ$¥~[eðóÎ°]1ÚÊè
+Ìï»²j%qºä#ÊÖùmÎRPOHªÃÆ`¦1á3ÜißÉêÂréÂ»áúoãm&	í":"xíOaü¤5[ªÆ ÈûSÖÖ²­ ì0U¬ÎF}Â¾
+-´X}_!Æ0ÔÞ¼sUÅji»ªÔéÔ×¾¤ þÈOÊª¨&ôDsù0£yì!tAXÿ®*&2IÉ4|ûT²{}m¿0ö{Ci÷#íÂÂ­¨ó±UÚÀ£Sö[Tð£ ma)Z»OäÐh<jªldõ9G¼È2 23âa;>:Ò½TDlôùôFþÒ[ÅLuº4ø&¸ä|ÿr i.{Å
+¬w3ÁI`Èön®K
+¯y-ÆÜª.(+!FFúöZS:sLÙãÈ
+V7
+$FU®ô¾8
+ým¿kã¯¼ í_Døs,É¨íì$àá )C>Fcr³)·û Ó3ì8fJ3¦cgè]¥Ø¤¨Ïéö¡
+-P.Z¹¸/sFq¾ó¡:7§dÓéº²l#ùÉ÷+ó¡ð¦E
+=Èì¨
+-××îqÓaªßÇ¸R½¢
+ô 
+--+ëPhBCÒ50(LåÓ¿/÷RFXoô3W	¯âèëm|õ=§ée­aJ	ÎGSJSCs$,¿ÂHOÆ!üú¸ .Dw¢rUòè0ôÞÒeç¶;*«
+õ¤æÒ,ÒTÄW\×üþN|kCgÔ ÝDh»6g~¥zUH*}èi:Â [Wï'ZPmùf1Ì)7Õ7ZQÊÐ /
+=s×g,_oÁö¦îûÉÞ<1+K
+-`ÓòìsH»iäQz°Sî×@üç8ß.¤ÈÝqîßBÙÒUÔUõm«°Ö.÷4Îy6M,Diéà`÷*mXDæ
+è¢âR£	»
+A,L¥QúÌò
+-tãMÆ!^%ôhê
+-¸o*M4²
+ü,7x²ÿ¨ÌÖ¦"½ Hø1×äx¤Ù¹ë¼½ÿ=+*m é3­p	Ç	²D`­Â¼è ²`gÂªcbT·~L!h¨ä\
+7RðÖÜ65úWÉnC¸ @zRÀE1
+ÑO*ºÕ÷eµ¥Ü9E5Õ"õ8÷AræJJ	93nr)i¢.Kzm¹×÷U3Å[ÒåÔ-ªÛù¤«$3æßðYh°¡¤%áá eÆUKËñ.ÈIC BZè¡O ~)gZP@h½O½|±¦çÛ¤}Xè1N=¬¤65q2üú77}ñüj¨ïOOÚ!)ø
+-
+{4		ÒQ¾¨S
+CíÊ¡${ ~uÁÎ(z¶ïs
+i³S
+Ø£AÜXlÖÏÓ'í=cH8Âî0«2qëÒ¯Â%¸Qke ÁÜ-íôô¯wmEÍæç
+g_ø2%²½
+ádêòcÏ^×î2MEéf
+-UZÁ
+ªX6Kn'/qÓ¨¼mâÖ£,RígÃÆè0ÅÓUáÖ
+1«¼b
+:­*Û$JÍÔ9yÃ÷6ØöZ!_øiæ±ûD8WïÙ6¼¬·"ýUhOóué»¯5s××¹&yÐBÓÇÖ½Iá<RxLøö
+5
+3òÓû6ñLîúËrw¶«ú
+-òU¿ÀöèBoW×]N¦¡:¢7)ÒUyPøLðÅÁ<ÃC%o¶PuØ¸UO
+··óµÁ¦
+Ý×ál¤í»»¡yñÄØ? ©³L¾ Hxs±ú[ÎIx5Ä×OvÚc¢d¨1;cÌGávR\eÖ ­ÁmQù³â>IY¥Ç	dmxáSÞtEñ"¢V_TuüF~C	}_¸Nàå$Áüýâq^úK÷-vR®zy=
+^º
+-½ÊQõUoLt
+0õ°^Zzõ½ªÑ
+·Æ¤¦Û`ó³´Qà\ÁÜmóQ(\*éK\½ï¼ÕÒWóþ¡Ë-*ÿeË+¢
+-ø
+-])
+7
+V
+Üë*}gsJ¸øæ÷P4s9}=9ø¢m¿Ð¹¿ìø
+-l!\¿°[´§0¶)ëk°¦ÐVhô(ºÃæ¶é^r6W
+æ3ØéÜé§°wú1¯¹ ¸öºe&£Ýg0´K)ujâ:N¦Ú¬°äåíià`	Ä7¬´ÁÈh2CvÒ´xËØ#Gff}Çcés4DR9
+Æ
+- ÀKtñÝ·îÞÛ±&)ãsa
+'Â"|LÀiÅ
+Q
+;­ùOö?Õ£tÚ2lîêÑÏ®~Û 5d?¿´Ì·3H~p
+#z¦1ÖûÛ#äÞ!KVÁ¯6·àÕNÂ¹¿hÿèõ()IÕ"Ôuh³Îî)V×ïÓ~¡æ^«
+§Ð¡³Üå?ú#qìg'B²|A}F"sRÐi~îqPnp8:`åQ.y&¿ÆJ#pòAT9íW.hØkA6cur/ÌS¨ÉÚÕ!Z½Ôiîkge«UìXÊ¶iGaØMT~f)äcíZP¨"2HE%[Áý´Ó9Ç©ÅÊ¥³;p§³é¡"íiÞF/ÕqÔdß('j¿)±
+¥Ó&r
+µÇò9yÉ&+só]3Æ§¶
+V5<:¸k[}
+AkGw¬c¼ø5`VâT¤ÿ¬
+ûF3A;æoDH'ÆÏúácöyê[kÔY°¯Ûd«Ó¾ 1?f	Ï-:ñK
+(Q-ÏQ³eà1=F 1¡%¶ëgv9Þ"0K¸Nµ×sî
+$O5ÿ©ý>ñ=-+/¤»Í3åW.ÔLö6½ÇÞ´Yö)Ùëùç©­îtöiìHw-:©ÔDûøÅ±©¼'¦©K[É§¥Aìñ;kÝÔUeiEM[â¬Ït^yO°µ	;¯ªè~ìle¡Tí*(¢¼N>.Ðµ[M¤ ßÜHmË÷y_¦P¼Åµ¤¹'X4>®§áglI(. 0x_R0²
+Aqé
+ÎÒ/¢"ùÓù5è²?RîO7ajãQ9wÚ»ï<8®¾ûJ'<)deµÛuN0¸7IjY¼ÒNoJP}ÏklØr3¤ê¸Q?c\ÿJ©|
+zÇ^
+U9ÝöÎ1/ u6Æ²Öº<dsÝ6 ¤¬ÖxÖIêD$áÜ
+þéK«7¬g/¾
+-û.R¢Ïÿ.:½
+-ÞÒý,\eÞJC#Ò[[µK;ó§ßìÂ¢æÔbÂÑ¯;²h ÖÂrÄäö#¡)Ô¸ûï
+--ØÅÞ¡dI@x­;m$wr4Ó¬£õXé?V~Ñ½;Îdr:Y*ìNþ¡BÝÚW´CÌCÌ®-Åg'LüTåýµîVÿåÖo!ÖS%M¶
+-IðÇ¾³$9ÑñàäoÒ±ñÏoôRãô×ì3&ÏgÏ
+-i*k
+¡0¼²O®ÃU+®=+Áö3jDq¥\"ÏOf%¼ÝMdìµ-¹¨r°¨
+ëÊ.oæX,;u|[»V­Di/Ó¶èºI¸OÓ
+Ý
+¥ª)*³õáåÎùG6TõFóºäBK«ÓsÒ
+8hñbté
+ÌzÛrØ;É´Í\YÀÛ8ÖÃ&áÆïÇhx¼-&òV9¹¬ó¦y´ú?úèÃJ¦ªÖÉí9Ç9òR/Bu
+-\ðoODN¸r}¦.æz'jÛ\SÄÏDä.çw¥¯ØÂ}C×J¨	þ¨ömcü½õ
+õO
+-1l~wÅA
+ø+mÜsà
+-
+/Ô&ùïiiÁ$±&Ú
++V¡°ÙÁûð!ó A¯trºb!;HÙ»e
+-2!ÝdE9òYÝ÷sÌÔ1ÉF4òFéEÜø®÷¸½?ìôyMJ
+ñow=}×
+-q9*öxü©ê²G*
+-»´Kñ$q¾mÐ °Y,å1òÀ5±atH
++/úÑ©Z±ýøD(àb>ðÏáS\©ôèÐ:á~ûO-7;º÷QkXùÄ7µE;oÐ	
+Ë
+¾X2ÈJð ûÊçÓóg*é=Å´Z±_	¸
+Â¦
+å¢3Wg9º×Kmpñ¶öiFÌ;¿àòÉÞ«³0(WÖn$D0¢]JV°Dr=§ëÈÞ±çjFEµWÅL~c<!
+¨sÈ0vðN¥>lÎõ½A²Ò¬î IÎÖ"_æÖ
+.ý©Fc=çPûÑÒýQás,Áö/ßn¨æRe¯ddØýbCÍ
+t°ÏÈ¨¦ÂÅÅ%ù¨ÐÔ?ayVxtg~>Vögì?tLÜ¨²Ç ¨]sw¸Ey¹Xu:ØãôÕÌÜB[xWëûpbY3»Ä@G@=± wm}!Wt2qÓÐe·9 P|$·Òwñm.):îÏÅ¡
+­çùX"Ý¡Õ£	G+ß+«öÔ¦hö<¹'¹±T
+-°¡·&|£2jõì
+ç
+O[
+-3}vëÃÌòßÚÚûêÅS
+ãósÝJ¦:xÚ5}{ë{mE ûPw
+-¢X:lº|^BÐ
+Z7ÃôEJ¾
+-ý#þ¶`Ò»ÈWñU=½Ú½g ³DÜR·
+-!F=d6ÈÁ>¯M¸½CÀÉèòU©²ø:5÷Eß¿g
+n´-å8	»N@ë²À÷íÚ^=®Ëo
+©ºÀm
+i8ØÛç
+-'gp>-ÍÉ÷²u¤~Ø öxÕ°3~,æÜ*pú¡jæÛðäs¡n8Í§èÏx%l¿~BÓ¬¶Ù}½yî}¹F}Ûð¼ë!BïSÂÒsRà.«%Yb(Í>,¹¾
+
+6çîo}¡
+vðñe¸ìF$Eo>wAÇÑ®!&kÔýÀ"
+ÃsÂQH¡¬)3¥ß%C)Z~KBIr1ÂÔs.ÏWïÙl!©5çz«åÀ­
+ÚèQ
+- 7.iÒq#À'ÚÔs±Ã^5»ZØ"pº"¯EÁÁSl
+-õæÂEõì,£.%óQcaîn
+1VÎ$K
+I!ØtÑ×¿}t
+5Öäqýõ?n
+guµ9ç·ìV¾§·I¥*,q
+j¼"<ùð ÃØK«ZLàÂdcBÈýY@
+ÙÑGç²kÈÖûÈÒ)@
+iU§L¬Ðew
+-Ý
+Í,Ä`Â:ì
+ÞwxrñojW¬YÂ²bÝ<`ß-a+
+Oq¦Þ§4fç?Iov7T©F§-Z3«§1:¿%>GS5H1$Ón?v\h¾EWËZuáôþ×¾Ö{ãeÖbü
+-ïÍàøR
+-ÃøSX{ÿYkkMÃ¢¢Ïí¾6ú
+ÄË.ªÑ½/G¼«~+C}FÕuñRº½©ôm²ÊãYxÔª3ÌÚx%¸ÄK&¡Ï|6ÊæzçCa.<Î#¼
+-äÇ[÷È2[;®¨8õ¤h©ü¯°}
+<`dE_çoÌÍRó4
+-å¬i
+-âæ^R£(µ^¶/OU®YïVì:Ã©¸'¾#Üät­Ô
+-º{Üy#àÔ6dï9Ãz[Àìm®GlâAÒì¿½h'IEóàè¢L
+°
+ê¯6®´úLæÝ±Ê®L¦×#»}O£$OÜIxªæS&Dv÷
+-Í°È6Üd´7aùm q[J
+GÁ
+µ>×ösÊ}në5ÌÆû¶á õ/&Ç»ÝÃÆ¦+¶¢þï
+w
+´ßCøãðafn|§Z°©hÎîglÆè0¼ÕX»Î¡)ý!êýª,7b\zÓz"¨Á|]iéß
+
+\ 9déi`£Ä±
+-¤vÙ§_ZºÜÂª4/§`Y°¢Î
+î¢¦ûÂË7m¨ÕÐÀCâCÑFå´î­#¶Å5;~7îNåI×8 uÔ0IíSÞóíÇÂ¹\bQ,lÖ4°Ïå	ÈQÙ«==ÅR{Þ
+KÞ
+ÿ\ør
+;sÁÕÀ´ÉVÑ½Õ
+Ø£ÑÈ·6ÚÈlÍ{|ÜóæèzRP(d=ø_wsÑÕn£
+riy
+G'.V5¥¬ÏÛê¦ÍÄ0ñúé<?>`ÕK'¼SÂaýuþ1D°§+³£W»¡ôPÙ<
+-(åM5Öe@t¥$f:<(Ê%
+-ÿÚ:R­½Èz »Å:I¨»Ñ÷°ÒcÙªábÀ
+NgÓô¹P¿ åWÜj
+ùû&kÈò?ëÈòÇsSû,b¦Íz
+3§>9á[ÔÄÏq~un@ÍËªRyu;¡ÆGï¶¥!
+L²ñøl®;¿Þ±MÛ'¤ÝïyK 
+kzâº
+N ÙY¯ËîÎ¶÷öÇ[Dö#Ip¯×®L(<U#s
+-
+¶®¾#n«NÄDÁ9À¦G¸ç
+-eõªºC0ÊÓTcL¦+¢âvÆLàá5Ï§ä¹»C¶ÐÝ/µL²À³l<ú«9,°
+-ÂÄ4ÞOiËB&ùú/ãBæ¶²RuºÒèµ*|sÖÇOo]~û¾s¥K4Ü2ºÿ!¤æßÓÉb:t»¤FÆrßW"Wé§~<r
+÷Ý¦*®Û
+ý
+QÔ3°¸4h8åáûÖÁYö¦(öóýÎÈ÷ôPÔ&^ë+@z4$Û­¹,Ø¼¸·a-è´UË
+A/?Þöøí!>Ò¹ä{£zsÛw²}JÙÈ^=­,r5tÛ»FR·ÅÎõ§Àù Å}IL]Ör¼>ð¢V[æfâ
+³SQ~Ü÷áã¥£ü²  0b­Ûy;^w8
+êóZÿ¾î3¢F,CÖ³¡jjÌ®
+l·ýâÑTä¾9éÌ*R:|6FÒ%ÿÄ·®r$ü«9_¨3u\´{g¥FB
+wÂ*ñ%2`
+ß
++r-N
+-DkzþË	bÆ%Ñ'¯4}Öw=ÖKieÓdvîðÐLÎýB:f½@
+-)ü
+OSV»îÉÉðcâð"¤S:®
+¸KßÞHÙ¦l>»èÚAûIãqÄzÆímfEÉ~Ê,Ù³çKhA$©l§RuÙ*»+
+->5*%
+
+(6¦oe_HLÖ
+´Ø·é£T÷Áz-u>/2¿EQ_ô¬¥Eã$v%`Âª
+N®~%AG»¾£4² Óñ^
+H?ç
+ -íÛ|Av
+Ü\
+cî/Ö®Èz*&ÛÓ°z_cYiÊÃ>Ò
+&ý¡	«1)mNýL
+ðÞ.5µãL¶=Æ<ç
+²[Ð!¿9G(¨QS
+É'I/{RD°ûí/LöõGUg¥ÁØerq ¦}èêTÀ¾nö6Q1{W³Cäaìne­é©'½¯L³VX
+¤I
+n^z®zÃú'M\RË}NQ7£j´îWfÛ½ü9è}¿Ô­ÔqÉB4waBÍ¥¼Üà/oåàº?}J[üÙR¯à
+-¹Òiä4jzÒä?
+-XCéóJ µ(
+zM-í
+N)»~
+-SºUäëîýaËÐ/. äh3ÞO¦­¨±íä80.cO
+}°ÕT-!knÕ_, b
+QW3â¥½(Ì<x
+
+-zM\_ÃÇó.L¡Zã´ø
+-¶LÙ÷1CM,HïÏÑÜÊ°2~I#ùóiIfØ¨\`
+-O~17:nGØ`
+åà.ZÌ0ðRù?_d
+-endstream
+-endobj
+-765 0 obj <<
+-/Type /FontDescriptor
+-/FontName /QKLGGW+CMMI8
+-/Flags 4
+-/FontBBox [-24 -250 1110 750]
+-/Ascent 694
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle -14
+-/StemV 78
+-/XHeight 431
+-/CharSet (/F/N/S/T/a/comma/d/e/i/j/k/less/m/n/p/period/q/r/s/t/v/x/z)
+-/FontFile 764 0 R
+->> endobj
+-766 0 obj <<
+-/Length1 1388
+-/Length2 5993
+-/Length3 0
+-/Length 6935      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚwPk×-
+D)" 
+-$¡ôô"½R ]¤A)ÒD¢t¤	H.EHÞAöG=ç|ßùï¹w2¼{ïµËz½2óòq¨À±M,ÆK"
+-ÔôõuT!` 
+Å(ùøÌP^hÄ?J>sÎ
+ÅÈýD
+-zá}êP/<Rnz£8 HËÁ,û7Ô¡>(8 /
+-ÜÄb|jXw
+ÊÉÙ
+ßèïG@&@de¥
+§*n
+
+-Å úP/g¾#
+L±0ÂËÿ_%å½¼Üå@ ___Q¨§(ç¤($
+ø¢¼'ç¿HP7ÄßÜD)ù 3gç)éå
+Å! ¼!0ø
+o
+
+ðíS
+=ÀÐ
+ùÖûþ:
+ "
+-ù§Ü_Ù¿
+-¡0¿¡0ÖÍ
+ñGa $
+- 
+5õD½ü¼(þ
+E{bñùP(
+-
+-uÄ~Ï4U(â_=a8»§¨'
+-ý$èWü9k`àjX77ÆËò×|ê(
+?xÐß÷ëÁúbþ1(
+
+ùÜÛ
+t
+òðFè¨ÿÂ»(ÿãsBx`iqY1 á ü`Î _-ÌüÝ¿_n<À w¬;ÄA¢üe'Ôxá¼ÿ
+ø·E	 pÌ
+pD8¡0ÿ©w#lü
+-àP~
+-¿ üëóÏ
+~ÉàX
+Úÿ?ðß·
+2Ò21ÕQ¿þ7ç¢ªªX? @"	ID
+-Æ?þ»Ð?Gð7ýß^#(ê¯ñþ«¢dþ°ÀßßL|þZÁ¿¤#ü»¿Ó@ð?°Kaø/Èÿ·~§üßöÿWÿ·þ÷HÞhôoà_ÿ uC¡ýÿàÚÛ
+/},^&ÿ
+-µ@üµ*
+-ÿß1
+/(^&*'üª@$DÁü(OMnò9ÿY¦?~¨'^S^¿¯éÀ«æß500,ü¼Ä$¥ (õ§Ä_-Þ x
+Â~¿ b°^ø ?z Äâ(Ý rúõo
+güñáéùÛñ¯n0o
+?ÎïûÆò·ý[ÙF9ù
+»îRÞøý
+-«¯ÈÒUç~ì
+Å¢³Ïq¨ü¯âÏïO¨¼
+]¾ÿcnC¬ð¼ÖÕìj?{7ý¾
+ãdU#)ÒñðÝ!:
+zÞbËº--Ö·Å1p'Æ:nßå¡«Â
+{KcYkZòüueG¥Î;ä5¢âï3ÉÈ_"
+-oRÉj*S}­22Ú¬Ãë¹¯<°õ]síGzG¯äBçT±0!j>u}Ê]÷ k]ññjîí!`o±Mé8Q0ô 1<DÐÑ³Ï(¥Tw5câ¸Ëq"]i
+-Nãª:8Ø¥Âê­ZsrÁ|Ê·
+(n¡Ú«{P³ 
+s\¬cõ}"hùnoßÖK¹0w_²êó/²Øàl¨{
+-ü7\æ	í	¨ãh3¡Ë©
+¬G£²&8Z¨¶OcÌÉCi±ÎÜÀq¢Â&©°$òYÔYªûes^¹4ÉÉ¥-êN­»Óc¢
+SÓ3õ¥[~ER3ÏïÉô|ýÞ¡\`R^¬Y@oK%ÊOðDÞPjÅ
+íêVOL"­ÖS¿ÅFm´ùd¸þÒÏ[ÊèD÷,ã
+-ÛÒÄZÜ,'Á³°ÆgÄýé*I«yg+ôöÈVëFÝ:Ov?Jqê0Ú
+µ»bçÞ{r¨Ú
+ÉçÏ\UÐ#ba-\èåsCH{ÉåLd¶Ë®µ?¼à1bV
+MsJ«)û%äN
+gd}N[ {eÆDa)UïÚË¢¸}d7ëÃ)·¡ü¡Ç!r{7)¯ê5õ(¹±èÎÝ
+ã'yaî'ó¾hgã¶à`öñUÂ)&]õe7û
+«
+>ÑÃ¹µHô'5jÖ§k¥h¶N÷
+`è¿ó¼;E­EÑ+½3ûÔ<ü^^~ª¬¿ÓÛp,Î`..¾º÷Øïùc¤Ù´^Ã\_yó;òÕì e{É	£.¤³zR×eíeN
+.çmÇÃ
+-
+-ï©¦|F
+#ØrØÑF-W
+úÌ)ì=F¿=éqôà@wM>Ô«Ò±ÓP=9jû²å_?¤L¯º!7µ­²Këqjj{Hzaì²ç©q½læ
+ÓmñUÿÓþè>YîþaÁ
+-
+å­£ý`¹Ùbÿ
+×ZôD3Y¯¿
+®»AÚõ½Þµì
+-(¾,®ÈÚÞ,3³Á]½ò½AJ`@mÌZo[oïnIËsCïIÛª¸+]Lë?>ªÜ[ZK^R`[i¢Y®
+úÖ·°;=Z»#!õª-_ømýtï>G|pfey)+Ç&Ï?¥?²_/ÍX¨zpÍ°+v¨ù+U×Ïq}LÐüÀð³y/oEÖ7%ñÅM£ÿ´ZíáÍVI4dz4µøÂz³çk·v_D²^
+ùF¤Og6Kª ×ä	&Âçg]Wx":2Ö®3Ökxnôx\Ø
+-Þ9:q(évÙÍ\çæ¢Ê­
+-ÖÉ á÷F\
+-xæcøG
+
+´/9t¼^¹@bgÚO
+¹2wÃ	÷eØ
+DÜrLºù¦ÀÈõ×¶É½ÑÔ×Ío
+F©¾Ú«L³'7¯X¥V÷¯¨ó¼Mf(øøB-AÔ$ZÑÑ×mTüÉ#Þ¥IÞak
+Ü.:éEe||IèÜ\Ðýä±VØ~uÍBhdë~iÑ'Hûâ·Ï#RÜÐyÇB§õÛ
+u²Û¤¢	9°Æ3VÚVBÈíX$mº§`x¡Ä`¯9y²
+nÎy«¡;ãªm>[ÞüK)ç@qÿF·¡$XçØ8#j#:o#qg>u4ÂÌyd!Iz²5ËyÆ
+ã«Å=°ó=Ð&¯â{
+ñà¶!À b?;ÿDTù+a_þ°dÚØ»ø[¯«Ò¿Ö3ü`d¨Óìeq:]ÁÇÄ
+¤¡
+M
+-,)tê.wD/ï«,cLéÌd&N³£ÏÊHIç(ëÓÇ{ ¥
+hzýSØ²Á?Þ¶¡CG­F§[A
+??av!µ\]þr.>G>÷·hg4wAä#(L[ú]¿SÕ¾æ¬»»tb÷Ë¥wôMZÃ'ÏnÌcì~ûZi2S~¾s)°ú[BMnÍví÷ý	°_t[å}&K8¾Oéøií?öZÑ¤6¨2¼"¾
+èNjð»~ÒÕ@ÿõ7üÍEÔúò=Ä§×hb¤lÄÝ²¸¡PýdFHîÜ×bÕ¯«ZèB]wånZÝñÀlyÜI+ðÌÜ ¼?_ó8oÏ1;î-lÒö@HI)Å¸¼Ø:Û2[½pmÏú¤H²­Sq
+æÇ
+Áä'Ûº	:QÐòÕÜ3ÁT^1ýÕä3]7I3;ÙÖÓ³Â¤h)£&ÙH³Ù¨©7úNïvØ
+-Î©³,ÎK¿Q
+7=SG£ÍH¾L1tHê4°7Æ|³7´wvSv
+ðoÑu|wùâ
+¦kn<º"8[¤n÷aY0à
+WnÈÅÂeÛh-z<9
+
+¤Ê|¥}5ÌÛBaâ°<±9[U®÷·för+>açàí
+¦¤<o
+äþ:®`Å´¶2µ
+-
+-ÙÃÕ°å¹ $³§<bEß®òÔoch®2Qm Ó\Î.M!Aùkå¬=ÐÚ»
+>ëãpøæ2jY@x¼sÞ¬d
+âÞ0ì×*\
+<ó^Þµiõ¸¯¢âòB«üÙ
+-Ê(3úÜÌ<éPIÙ«È'Öº¹$Ú,édöêÖ
+
+¼p©Sô}}Ã\ðgìå°öÉÚÐ[s®mÜ	ð2	d¥ó©Nö;p@ÿÏÎAq¢9
+ù³G-6W^|- Ü«r<Ôt±ðkÇ`fÁë²Ï§ü nîì3ÿÃiar$%¯?Ò«@,V¸eíT-=X&p×(féjÏTó­ò¿,ü DÔ¢<ªT
+ãK¹QõªÞÚ¾7ÒtAF³Û§É4¼QöÁÎ*'æUÃ@ÖÉ{	%í=!(¢äp»½ë^.ADÉX
+ÿ}û	U´.
+"¯Õ½æçgØtGéÛkO»øÌ±:CæçtqaA_:^Å¨Ìô¥9ÏÛH,ÔldÀØVÊùöÔè«.rF]ø^È+²MÌ?D$ooaN?ÛÌgã*·ú:²i¬ÑU|CÔ:N:
+ÎííûNë©
+-iFâþì²¬öuªlÖ_Ë}¾Û]¢£/êkÝ<
+-Ì¼ôÕóõð¯¾×¦°Á.çObzs
+ù,ÒÖczo]6ö×èOÜUÜZ
+ïÑíéaÿ)´Rt2-·¶þ¾d¯¬x x,¹Cúq¢Ý`ý]âÂ¹Ð§R7ý×ÝÁíç÷­²¨ÇBÖ©w¨Î/'5?óö©õFoôN±díT	LG<õs/se«¶ívò|eß¥êý<j}§SA«{÷4\."üÎXLþ&±ÿbïEÇÊwôäà<6.÷èÊ«/vÜ+Mõ¿ô»Ó
+-8È'Mx´|Ì¢2Ñ®¾x²ÞÎ¯oÜ¤`}Øø1M=­ÆyÒB8èzTO¸CwS8ËóS¢,rÙá÷¼ybgù=ë·ú>g»LcÒ½ð»6å
+òé·¬cÃÈ3´de/ÝÒnØãúç{
+M­jVbåîL\2+àVülÃÌ
+-ã4Hj?©Õ^
+úPnP3ÅRuÆ(V(,Íî.·µ9Ûç^³ð{Ã
+Ê/ö|ú´£dêõÂÏaL¸·Ô´PrC@áÛuDû=//U³
+PXLt,«}e|ps<9-GuHÆÑO ïÊ½}ï}6dåhLø^AÞ¹Wö'!'ßÆ¥¬|«ð±ôxþ4
+i**ã	Vc©~" §
+õd
+ÞBQòâ¤C
+-GsR4A=÷
+ä@Þ­ó²4L·&
+ÚªAÏøçgÈ
+-<&Uås
+bç9­rS\.­'JJ&Ëù<¬éýÐ¶¤Zñ¦<jÎsM2zA?BïQÈm[»P].Maù¥QÛ¨P!Æ¦EySjÂ²íd&õãÜ ÝÞz­ègKµËÇÃpöÕ¤%ÂUâªSÛÜ&ëßÕ¶¿!F¹ë¹Ò 
+që¨ÜY¾U¢bë(ÕÏAI%
+?J2Æèoµúm<qß?Tz+
+°; *ß¥[ìúx^a4v4t¦t
+;Pt`;Y¢ä'.×
+Gß
+-[Xu0/ÍSûõ j÷L	±{ÌKñR.J+²ïrÁ.sªê¬"¹7Wå;jÁÀyajN¤«ÏÚ;Rqï3	«ÄÝSVªjï
+}þP?ÈýC5ñ
+-©ù
+ÍIÀ]Mj¬
+AÆ>,&zo]W¢{Mvz¸'3®ëÆÊêÍKÏ6ÍI´"Ê84íH¾
+)î}wÒwVÞê¸0üÖ1ã$Uå­Ó´
+ìÖS
+¸v3ßÅµòÕO>j­0k#cçAWD[Ì×ßËÜ»"~6ºJ
+B`FyÁéär';;ï§;%K
+-ét§:äpX}©¯dürêÔßój`¶¶Þ@&äÇÉXî­XÄë²¾%»9´cm
+-¼)
+Ëò#ý=utEÝC´Ê¦ÇN¤ ¼}ü¸
+go_þ
+GÈ#=#_¿Ëü/ÝjÄº]f×.Pó¹²J%ÅûÂwÚôÄÂG!ºÀtáå@5³WÎvæCÈ
+oÿÑd í$sÂ
+-)Õo7ÅMÁwK_/<NÓÔyËdÝ!Jº)_Èyê@ÖÙ0k¯%|
+Þ$|Æþ³V¤º~?Kê
+{¡ÀXA-ól§¾¿Q>
+½Ü§\w/\Úx¤m¯-¼]±|Ø\ÎMÒ|t¶üÐÉHS÷Ü}e¼¸íkJ'$Î»9úäl¶SÈ.äª}ö5Lá[ê°Z¢A¼ÏñÉÒ=BC8'J+ÿ(Eî1ã
+X«î
+]çòO
+¢±0ë"±qn+ä1J-µÓU,,÷®Òùmö«8ðèSdÒ=;_(#i[©Óp.hj%ò­Ë*C
+-ysÒm¾¡6©3Íór½¼[6åEÀªø:ºÖ°Îð
+ÄÐ¥·~$!5hþ<¼£Ñs´;jY×.ÆÜ8òx8.ÐH_#¥RË¾@
+PüÄ®Þ»ªö¸ÓÌÅAtH¸'*þâ´Zë'8úÓ:1AXÂÈm½ãbL)µØYr±ì3¥4)Åú"<ßwþ\Þl«.RBíÐPÉ¥WÆ§Í%
+-ÑEPë]\»õÃ®hUSÒ¨
+pq«H³ ;
+²ïY6|ÝASÒêÀ
+H:=
+-A
+ªÌßÄÓ[Ë4n×
+-FÚ@âíäãO¹ÑÞö²5opG©I-Tyê&½Ú¦
+7kÕ`Jà5CZÄM¥ih÷§þ¡ã-©Ñs²ÏÑ6í¼ÁVA(»&ÁòN¢Yý¥"Ùõ:Ç
+-qâ=ÐjÐ°ùBüÊ¿x5Go'Ù¼¥L0AÁE¿ë«ã)Ps$ý>Òy¤°r_¾ºn@¿ ìPÛòläõv>Îny#°ÅÇI³Vn»Ò
+vcÍ´ëòTGo(Í4AÉ^VëRÑ£;êçÂ\÷Ûß}+0Ð
+¥A[Ô¼ûòËý¥µX+Ü¶bcÖ{QMP0Tmòì,é9éÆ	:LÁÿr¢_Ôyº4âçòÏrèc0$Wc×U5ïb	Á/.ßï
+é$å!BÞã+Ù-£	n]ýöAê-ËRõ9QDàsþ`£G>ñ²lWàg
+Í ÄÎ;ýÇ%>oúO²h®uùN1Ñ¤3ô
+5
+-ÜNé ²}ËÎ	6TÓ#×t=
+
+s
+
+-gÏpeï$å-TÏ5
+-RzIóÏ5
+ø¥×X)ÝÌpiªv¸4isÒÐ©ÙÓúí¢CõÙ±q
+
+-ÚÔÚ+æ]ÛâµÏ¶4±j=9¥ÛÛñ¾
+ùÅÔU>ÄÊ
+
+1×Z;´ôÅºXLÜFãß%pÉd\ÃÏ÷ãLÑà]Öðñ$ÍÁ½;ÓcÒ[9ßi@Ç¦ÅÝÝÒË¢öÉcJ°¼ý/ÚÊ
+/f[!®
+Ò6.&¶ºB1}¦ÒçG¢$xí"\bö`.Ë¯<Ý°@ine1Ø¬'{XÐÌ-1xoÉªí^û\ØÊý¥G/³àsã
+I{H°bÁYÁ+¶ê/H
+-nIåýÒE#C-àO¥5
+×ï:ZûènÏ_ñq©1¯¹MÉÀ*½=]
+pQ%½GÝ}0¨£·dßi¦ÿÀþ^òùLHÇeõÁþî7L,·µWivÞ'+.|,OYv´kEa?¼L
+N
+<bÐÙÑqZ§SX$~I=ô¬ÊÙûý~NûXÍ­u
+x7'ÛÔµ4%Ë¡þºÃå
+ïe³+
+l
+ûÉOiãCl÷óË#xò7Ì¤ot§%jk½öÔ×ì¿9»"[AÍ"6
+U ²PG.k
+-«ýßÖ)\cÈn¤®Åëíæ3 %J¾õÀâW?Gb¿QTU3¥&6Øò`Þï3àª%>±
+-Þ
+-víjê¥Í9ÞIÞêVùÓâ¿â
+-ºéº?Äco·UÌc##jý(_Ïa,
+©¤@Da¼u<$.lI0~ÅG»ÙE½ÏäÝuá.ù|*dÝùÀè~(NIIÃ{  &ÿÞ¶ÿí¶vbá{?öÚÛi»êâUÎ-ÏÜ¾¦¸E»#A×+7áüúTL
+!§Þ
+¶a2:ãWù¿dõ#;Ê2.=«îë 
+Í2¢ÙæH¯¤î®9'g¦Ok}%É'ê:>¸¹WÞ÷¤õ
+-«öR¨ç
+$1Sá¢½}_X@iç
+-ÇqjwyîQó±ìÔQÀ\T{W¬÷n¤à§uÓ+/×
+ÚÕª?¬a
+n~$µÔ½UtùÃC1Â.
+­RB
+-X~væ7 ä4ÅÅ£ÃÞÄk¸úzùl!GêÂTwH¢9|P'¹6ÀT!~ÞÚ jÃî W²ë#"Ã,ý(ýaæØAU\  Øsõx"^¹K¬iè£cÎÑ¢ñ&æª£ÄÈp.í¦ÂÝOk¿FÞ¦O:|2
+{{
+ÈÂ=³LÈÜZåzB9óÜ-ß*e4ç½
+-â
+±2
+-G
+å ûH4Éwzò½Ú^¥e§sÌNÚ¯
+'bHhga-ltóF.W:ìu:¡i63·p¹}äd\ÂëR¥d#Ê/&(_}6V¤r£þxn8Ê6cz2Â£¹ªpö]Ñ~òuøV»dLÌD:øü ûÿPË^±­W9XjwÉa'Z]ÒA=®ý]ùm
+KÂZäø.ÍøCãæÛý6u­¤EUm
+:©PïAõõ®
+Ã¬èK
+J)Ë`¹'-­
+û«LË*QøÊ	=Ûî¤²¢»¸h&xÈ5¬ø3VÛ¶ÑÌ`ë«´¿/g¦_ö6u½ÃÇ­fpk»:ëQÉÏÿËry]
+-endstream
+-endobj
+-767 0 obj <<
+-/Type /FontDescriptor
+-/FontName /PGRSID+CMMIB10
+-/Flags 4
+-/FontBBox [-15 -250 1216 750]
+-/Ascent 694
+-/CapHeight 686
+-/Descent -194
+-/ItalicAngle -14
+-/StemV 113
+-/XHeight 444
+-/CharSet (/greater/less)
+-/FontFile 766 0 R
+->> endobj
+-768 0 obj <<
+-/Length1 2803
+-/Length2 23565
+-/Length3 0
+-/Length 25144     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚöPiÓ
+-ãNp·Á!¸»»;×ÁÝÝÝ%A;Á Á%Á!¸»KpÉî¾ì÷ÿUçÔTÍ<WwßÝWÛý
+%©²	PÒÁÞ
+ ¦ ÊÂ
+`ffcdffE ¤T·rµþ#F Ô:»X9Øóþa æ
+4vÉÄ]Av
+-ö Y7[ 
+
+
+ÀÊÌÌó?Cg^¸±»@ ë`tA spôr¶²°t
+ùß#ÆÀÂÃÃEÿ×q
+ÐÙÊÔØ
+ `ìj	´E45¶¨9Z]½þãßÒÕÕÉÃÃÑØÎ
+ÑÁÙB
+àaåj	Pº Ýf_	ígÆ@	P·´rù[®æ`îêaì
+¶V¦@{Ð	7{3 3 
+ &#PrÚÿm,ÿ·=àÚ XYþu÷Ïé_¬ìÿ:lljê`çhlïeeo0·²$å]=]éÆöf¿
+m]
+@çÝ­lM@17H¨ A	þ©³£«
+£í¯~¹UYÂÞLÌÁÎhïêð¸3ÐTv/¦¿;kcïàaïó0·²73ÿ#½PFüá·Ìè
+-à`ffæâa  @OSK¦_îÕ½
+)Y~Aøù8:8ÌAI ý¬Ì cw ÀÕÙ
+-èçó§â¿
+`feê
+-0ZXÙ#üöÍÿÆ æ;[ytA³Ç`þõù÷I4^fö¶^¿Íÿê/¼¨:Ýßÿ«uðø0°3X9,¿
+ôà÷_7ÿàÉÿ%U6¶úÜ
+eìÍ
+ <ç *Þÿòpÿg,hþYZÀ#(:f ù=úzÌ
+Ì¦ /ÿÏ
+ð×ÿsÿËËÿÛèÿ_Bn¶¶©iþÒÿÿ¨í¬l½þ1 ²+h-
+@ËaÿMµ¯²ÐÌÊÍîÿje\Aë!boaûo­\$­<fÊV®¦ÏÐÿº rokeTvp±úuÙ @
+-û?:ÐÂÚ.P¯þRAûôßö¦f¿`ììlì
+ j=q |X@jôük´Lö® # Pz~ sg_
+åä 0üý8L¢¿Iì7â0ÿF< &3Iò7b0IýF¬ &éß
+-À$ó±d#¹ßÄEþ7qQø@\#¥7òoâ¢ò¸¨þF .j¿úoâ¢ñ¸hþF .Z¿(ºö¿¤3þ±tÆ¦ qúWÂb`ì/+ß@éüF Ê&ÎÆ¦6@ÐkÊÜõ·í_ùßKõ¯Åô7åajålêfgn
+êýÿÄ
+ ¦¶ 9ûÊ/CÐ½ú]Ð 2ýöª+èz]½øýN4uLÀÿÐaa
+-ª±åïqùuÆÉ
+-´Þÿ°ý2ò4µ5¶ûÃ3¨8æ¿!èùý´ú#
+ÿ
+l¿ ûob,¿¿ãqü2wpsþ#ÈÀâòÿ0;(wK/GK ý ÙñA[ÿA·ùêmûõèw¦¬ 2vÆ¦Îtt3ý
+ oö à=¨
+¿ùü9üG
+-réø[
+-ræzÝÛÿgØYþþw~ØA8&ÒáwëÙAµq´usùÃ?Hâô{4@ÑÜ
+\f&¶ÿ	ÁÆþ[ñß(l<ÿhþ+fùÕ×?ºÂ*òï°
+ C.@;«ÿN.Ç/ û½á 9q±ú=íì ò¹Øþ9,, ,½\-Tõ­Ù³
+-ª¢«Ã>@nÝþ 
+»ÿAd=þð:íùEôú*èý/È7ÐùïPÿ¹àMÝA
+-sýë
+Zªÿá¿þf@SÅ9S¾PëúÐûZÝqÊ]­tZEçN·Ç7°hk>¯;ß|éE]Ù ¹^"yö9nkø¢ÒþÓ÷É0Iuj·
+aa{p¢èX¤aA]xÏ÷ÙÉW3È²
+-ü,e÷å{~)ÏåÑð¹]½N9Ä§i8X½ ÒYÊ|ìï¸d0®
+DpoÑ/<QfongÐs'^IdèüNâØ}t6Xã¾{¯Vª³ºtãQàéàAÞ NQù
+¤ÊâÌû¯
+.x¶ñä"Ó§­0 2
+°fÕX©ÆØ·ôÕ¹.v±ìä} R
+bì¤Ô·`:)aÕ´Æ`¸Ö±Ù ºÌEW;n5{Ì­Óx¦^³ÈÚÇ­=>?VG¾2Ü
+§}¾iùºÝã§U*4 DháÁòVÂR7ze7(
+-ºÂu
+¢[
+(J¿äþû	Ú8ß'øRôe«Yº|ð#Ï÷2Þ¯ªéB±kcmÞÖ]?ä5SñÕäKÚÅE%ÑÇpü,¨üµj¾z`ÓlHÓÅF6£x¹|òÇÂåE1»Tßî|õH´^°õO!ãfF{"G¡
+-éÎI
+ÃØASÐ°hHX?Ï­ÙÁÖí§O¢XU
+¢#ñê\¡ùQ]ª¹Ý.JR"1%wÛßûàMÈOÕEÝIíZP´Ô
+·ÇºK<è+dÄ)©äù#|õÄûðj
+±£nZYë;îiÀ>¢®ÆS~Ü[$7ì
+iÑ¼|Á%PS¿/ ÷Þ ë
+Û&ý6µMác[¥WÊÞß
+-àãÍ´M¢"ßÌ¼Z ~1n]Óði\"¬Ë
+®
+BÃv²1c
+-HÊ©?®ÉÓa¾Î¥äXoyg
+?$´
+-T»èÕ¯aÞð}ÐëÖ§XÔ8Ü{âü;í)¯b?ô 3oÇªrî}éü<+NnN&Úõvq -i¬yØ»`8Ó´8°mþïÔÃõ	©ªÊlù¤¡
+¼uhÔh/"odQj¡ûëÅdÇÁd]+À¨ú|¸`9ëÈ4'û&»¿ÏI'H¹a*ÿúFrÞÂLã}Ç¥Z$
+oÍk
+-ÿøþx"â361
+s¹/\Æ+û¡ÝycËÃÂÇµËµ¼ÐõªÃ@¸¦¦ÚÚ,¡<#¡+®ÔclDÃÑ<hÝ]WÜÊüì,ß®\'î¥ÁPù83ÚZýåÜXÙ~fjA[eb7J»VÕOÍøÝzáÏ½øSê­;ê}þ¼Ç®ÄîNªex'ó¹ ö¼¡æ	kpÏ4yèÓÙ
+\mæÊÑwÎuÜ÷sz÷} ç\§L26<;È÷ÙêÓÚr+r¸G#´=ô8R_å|#ÅtD¥r:¼iÞDËQ÷±*1Ïh¦UsÊ(SPØþ<|¬leHÁÙÐíÆ=ÄÜáÃáÉÎS±RZ¼7©ñ¸
+ÅË wsðW¨díÇõ^sKÎÈå|Ùþ¶y ùÓÔ+Ïñ²u¡þB¹÷Ø¦´¸ß&î6õ.,r]«¨Ê·ã'ú¯ÚÃ¨{t¦ìuPä)êµf/)ÝÎMk±z
+p;ÊMWo8
+ûï°h2Å
+-×]?2'÷hç;x?P>LÞ
+-RöW}ÁòØ\ÛdÕw¨è[T>
+ÉX~Cq;Èµ;Áámby·jW>ìÅyÜ½´ D.
+Å·çPûáAUÎp<S[#å}_Æs+0L¼C3úÜ!ód©øØ8ç³£xÎ)ïnúÝ
+Úª©¤jLáäÈ®_¸Eë{xnQÝ	%ób:ôÛG£ÌcØþüõ&ó¾lÛNJe	Ö|^bMZ5Qy¦=þ
+-ì3
+-±
+Âõ»l[¾joÝ4äÞAÛKÂ$ÁÅ¥
+rû¨.8$£õô«ãÐìj]@¼Èù:( bÌÍ¤i¡­¿&u"{í(
+¼r~Ê«3è¼3vÍ!Vb9ÎgÊ¼$yßÌæEL±m¢ 0?)5 ó¼ª
+iWùúÙ{"V2 
+Ý¶âáY¯¬`5jAS4AKÐo_6jEmxÙ
+->ÿ<h­ô\
+»»¸³]2n²¢S9ñ S
+j*Ðó
+ª×Pwüf$ÎÐÕµJ^
+-²ºòë{HÞð+}²ãË~seÊcköebh¬­>Ü
+Pån.ÑPØ
+
+-_z]ÙØ}ÊOc
+Ë°6w
+sPç
+ñÛ¡8ôº!ÇÀp>ÕQø *6ìMM¾
+ü±È7ÈèÕJJ9Vô
+ÜÜæCNúÂÃ,rô6É$7
+å$ïÕóM~¦'uiÅÛÒØZT÷d/LWÅ­¶
+T|OýþMoóùÁ]
+§vÔðgËI³¸µt´ìb`sZàbeÿÆ;©¶ªp¿wP>ÇO?
+í¢Â1º¸ "Ä]Q¼+FABFÞê
+*EdÁ`ÓÞÓ
+<B>AR©é¿
+üî±òXR¼îW÷ðµiÛªý¦{íÝùFêÅq0­¥ÉÝªîæ 9À
+
+V&¼Õâ´¼I~¯÷P¿·tñ÷\6p/Æºym[«®,"nUÙH"ºì
+j
+¬&
+ïéL®åEg@|\KBñÑúUÄ²
+RbÿO|t\zE
+xèÚ[R«
+Õc+)Xè¹+m©RMw4Ä"H¶-Sg,F+ÜnWntgÛdW|ôÞ#Sí5ëyÃÌé.ÁhsÃxèZ,g³ië »¤¸&OM¯¦%´©l2}roÜ´RG÷=ÈÙDáI·
+eÎ¢<QXö­ÚbUb,ý®fÂäweÜ`6³1rµày3|
+ÝG³)¶A40
+±WÑ%à|Åf/½?OÁ«PÖßvDóäØ
+ÀÅ¨té.ááoJ@0
+-Ó<,°Üè
+é§ÄRI,vPîìßB
+	 ¨Hì$bcë¸Sæç9Ñsá §6Ú®"F>q^ÒzàU|_|2ì2s3ô¾
+DÆ<é£Öj+»z¹­7â
+Å,«Ö9F½ÇjØàÉká.RI.Æ×1­¾·èú«L%F^±*uð#ïõT>ôH¾­X±RÇ¾;0PÜ*
+
+«Qª7(~ãJ¨£SÍ;Ñu.ÎzÖ¾À8ÕvúuÔ-"ÇÜ-hG(?^#KkH\½Ä^ÌÈ
+tG¥®o×Q
+GYÜp¥,ÜyMýØ­[FËÕOÕõg9nTw¨M=»lÜÛ¬ÞwIýÎ9`v=ÉÞÐþ¤¬|>6"
+Mª0Bý~Þ·ÉLª&E"9É¦õå
+,µ^û#ìS#ùB}¸eã"|ð¶§Ht÷­sùõÏ{ì)×,éÎv"¯g.0{¯~Øë¬C¾Íh(¿ûêrsá
+i"ìä5G*&Fãc
+-Ç¨ Ó|rN¼Çc¸aâfá¢nFÁ0¥w[3>E%Ïïø
+-½ÅÉ·Í?«ûàq¤?µÎ||ÈÛ«Ì=dÓ°^Ô»úkDnø5«ûl
+
+ÄÑUÇÍ|Dß;pãBRn¼ïEv©Ë¸
+¤°p÷\»ðÚÂ^júþa¹U¶¢s)ð$©Ùî¤Ì-ÑïV×ÏÊ%Öu#Íï=Ù¥Ãò°|`µù¥ç0Qµ1ÈØD¯9¯öî7¥õÈf>éÂÜ³¤gr(ÞóT8
+-²rÉ¶>_5¹0AE7[Ð\{b©Ð¿qÔ­Þâ
+Krh
+-â%Q¥àÑçÄ¤|´óª¦µjÂv9´î½Õ*ïW5 R5¶ýrìÙ`7¯Í[Ï¡PZµ¾w¶y
+
+-ß^
+ÒDPöÉº(lc`1ÔoÍèýÙ±8aàpÅÎÊ»6
+-éõÒ}QW¢ªøáïÚÂ
+öXSQ
+-¯OìWzá»¶]E¡äíScÒ 
+-×°
+-
+Ã-0üs°øâk'OËäD#Ö.8ýÍ=+$5I­ïl¿¨8&
+ã*¡íoÎ~h*þÁÇ«GdÐvÃ»ã
+-%[g-|éù©!DYê+ßøg¬e'øò¡÷6êÔm9¨|9üNö
+;nA®¶òb,)ïú
+cøiNIóýNÓÅAB;1Þ,bjtÝ
+Ê,}þÄÀ5Ö1D¶O²©
+-K_C?ØÒ\Î4QÀ¨ì2Ù9*rÈqk=£}iûÖ£¥S«6tÚfjØÝâ4ü¾
+ôï÷]Á`j ¦H¿¥j89{ ÕÞ-ÉÅ£<0-¨i=!þ% º8*£O¨Ãr ¿ùfùfTW%\Þ²Ba7Ø_ÍùÅË  ¬-Uþ}*Pª|
+-G
+;&L#0yu}áþc bv_HË¸´uDê¶
+3V°çJ*Â
+c¯àÒä\MMþMZõm?Uj
+-9ÿþRfí`"­ùÔ¤wQËPPÁ¶)°4U*ÿ+tGòÐÝ
+#([2Po[³®màÊ¸JÔË«c÷r3Ç´Ðó:5ØdBáe.jÉÜm=5ëø[ÉÐ6Ty*ZÕ>µ¹Ëì,É;-g¿§Û¦Víþ¦8ÄÀÙyJë±!Ré®ó%éW¸±xÃæ¾úñI[²­îùoêôWÈ(a+P©Å,
+82øCÕpÚO¿Õö\
+-§TáfÃgW62`fFÚ:h7*ÐüHqk)%_6´×ö±^6bóµ
+p'ª6úL-c÷
+°QGºÛø3£ÜûõÄç}DMú¹À¸£ñbÐå±
+-¤QvËYÖ¶ãý#R·×
+-
+óÔÕ«næ~¦N}t
+=^þ¤Ï«úß³	î»OÞhÐWw¹æÑîYñJÿÈëR
+-ë_¦©6*
+Ijv½8MÂ`
+Vº
+lô3HñFn^ö{äeIëèQ&hº/t#Ozoàn|ó¢
+TTßjmfÀ­~w¼!Ôa)|Í0ÃzGdµ=/-¼d>òlÓªÊxuóìN
+8dÇN=¦¶Ý+Þ>ºhëõDË]¤}3'ÖP5`wØdÐ\#åÆa({ß´ÈRòÅ)vñe#ntëa=ª¥Ê>Òð§¸ #
+Ýy
+%ÑcÙ ¸¾ð¹ÂÑÁtÜ-Ç'"¡ãv¨
+g§s26sàum4+·ÊÀÞÕ¾Sç'ÓèÚÎ¨Dâ7·¼	qKfÄ°ªÅ«W4¤cDzLÚ­ÏÆE#-·&xtgKÝ^áÔöqyäñBÑúÕåÊßQìxX¤4+
+ènAxÆ8
+-
+zAÉÐ¤¾vX£rÈVÈt6ùùZwS$yoahLô&z´kÇÑu>Wêðï÷O
+-|dùò£É6`ØM0näv/
+ï
+UyB5·yÐ9h°ÄIpÆã5õÓÈø"½d9Z·f<ÕhºkT"§°×¿úÄ )ß{Ïê¼q(ºõ×Úýá
+Ñ»~({çZÍÐ°»ö.ñéÌöoßø¼©±Ò)÷¾ùð=F°uûÄA~j¸ð'ä¹ À¨±²×(µàlõËK
+Ðg÷oízOQo±æU¾n)Ñ-wt­
+æ8ÁÇ-jÀwxO]Y
+YïÄ'º5JæMeð÷a¼{ôZm­¨x|Û1lqûÊ.ôU¿7½L:s¬ kþG¦AÏ¤<Ð¡þcºÆé?Ò]qrò$à	í`ÑU´}bÄç²*.²CñpU~&V×g
+¡ëÝÀ6<2ï®Í
+Ë?NAn½N<ÿ¤ÃX,y'qR:Ìx´IÚ=ÙGöVvYëM÷6q
+-
+áô¹õ22Õô¢È,Ý§½È/mípèKè7©ù»îõjøêÚhQäË¸Õòi¯ìã¥gûBY`Ô·'w}8fRòsôtûØ.XR/EL­åN}P#·à±(:ÄÞ¡âå®ÂHlw@ôÌ¬Ü
+aAkZ~-K£
+
+HÁ×ùWÿMàÆ©¦¸ìwß´Ïß¡øM9Gã
+ª
+ ã>C¤&¿Wöã&é»!ORÏky#y÷¨·ÿ|g0IÈßí{¤
+-×ëFvå|UxL§ÎVa6áó$o'a»"Qå­°6A;]¦luMeü¯ôzöÈYs-¨ÏS¿¶
+-¦Cvë<·§I?Ð6ûÃ¡
+Uw?R^ªÃª<Z¯NQ¥GæôìØõ$I·:ï©ðä9Î¾â+"¬Ú»Uæ:þJÚvË
+-­9 Nvó6IñËeÆ
+uZ5è)â0{¿gzÄH
+ÅV	¬I1ðë;DmÄ8Uh`wïìí[Ç´
+BóëéËö&Q¤¿agO\¤Fo
+õ»ä¦¡P)a9TND=Ðý[Á'ÞMÃ#ßKxÞÊ0ûaÏ4éù,`Á³i,y^¸íH~4
+],
+-»Q^/ûJ+Éü¤QüñÑ¶úÂ#úÓ,ï5yq[Í
+-V¤%¬ÓbñÇd6ád9H)®m²*_É½Ç]Îoß°`¿Â~ùïjÑÅ¼æßí:J{EØÎæ.ÔYûðætÌZRd?ê­4`WþÀ6=YÂ
+-|z@ñ
+ùæÚeÍ25%²ïüUÝ=Uý7*ëÞK/Gâ
+ÿ£1lâæZbâGô§,ÐFÝ5~w¼PÁKËB¦t·uð§í+¢j
+<á÷!=
+-àq9d}sý,Ô;Vw
+LÊµà`iêßR b=`*ïh±¢cS¶Ã
+0I«ú´½ùÃ©pÓøDÌdÄ"ü¬àÞzßl >GcÇ;$Ç7¿ªU¬¶«
+3V-R!E
+ÒÝ¿òÓ09=*qÎº0)­ÌÕSC|ª½£5ÂP/9.¡4¯9,µK¦ÉJÉ¯Ò¶·å¿ii°I¼}8zRP8D¾4äcVâè1JfõhuDâ Çã2¦ácïýÍSMÿJ@Ùpû;(ªI
+Ð¡¢î¨R¬¨ª[}§äPô¬¥ÄYÁh6¸Y
+/Lº?v b_³/X½"ÖÂGéº2:ÖÎ½§F×ªÕ¬Û@>F²%7aF ñz@à¯ 
+ÎRLìÀê¾Þ1s¸°
+_ðkfS±ßÚE
+-Ü¡}c©-F
+
+ß<
+fëûòr<lt]"gg!¯Ü$®Üª3<û(Û$v@KA(m}^pqÖô}têef©& F}[ØºµÁÈV%V[ë
+È{lK:NÃÛÑÎÎ¦Ö´Ú3êÁ}1m ÔÔA¶NûË5Å¢VMpKplRÇ2ØÙ¯.a¹{ú/ÙyT+Þ³ ¹ÑÏ¹Èw·qåc;«¢¢.qÇm<äHQÈÔ'²¿¦6aé¹¥ÏÍ£aNo²ö¨iðA´û
+-y¦N¢"g&é¿M8òfe/7½»
+g§¸d]¬ùtìÁ¿`´U¶ÁEû¦òaß"s
+¦ÌäÕùNH»­y[zÍ*G×ùÞÁ©ë¿¦ ò×ªÂÌ­z6Í¬W¬9mmw=
+ÓC.Ïõ ¶çû^É¨ëH~9ý-ÀÎØÎþª}ª¹ûÇ&`'[+þì)ÅAç3Äèm/>¸HØíéÕ7<.³oYmS%wW`
+4º-/§ÛE!ðiv 5ê[±öOßð1B¿S):
+ÓuH¯fq9ºêz(DdÔUãóO 
+-1_!p¨ó
+k½/«¸ÙÀ$
+±Yn¹CO©Üßú²_«×¦øZ`d>4FMéZ·¥Ý%âà
+'tË#brD=
+Üe7>·nÜ6Ê2-x»®¥0¦
+¹0¥y-
+ýcT³Þ@$ûL%Oã'³v¶²îì¦x¹ûµÜ§ds¥¨ª{Å	³
+&#WSU%÷­Ý
+]ÊyªûÕY3üF÷?jûÚ¤xSÓ5êX·O&¶Pì \v
+}D
+-RÄçyO·aí¡JD¹,ôæ4âçòøÆº^
+-²¼N´çvõ%*
+gSræU?fºb_?Zj¶7ÿ±¢qÝâÎàvø¥ÞÍùè)FXí8®AúÂR
+-Áø
+{|fÑ-¬ ÿPCAß²¦F|
+[½LÆòQ	+Æ¥|oZ8b¬ ø$f¼¹î"w¼
+º5á»±3u®
+]¼`
+-HÑål°ËõýÜf3Y!øÇïm}Ó8£oß"V'sàSÍGf£ß½	
+TuW"ãáôì,~ÂLñ¹lÊòaf4|@v¤:mX$nVo[}Gjû,õÒd9&hg³Ä¢¿°;öpß}ÏÖNqfFà!Äð¬$=?ÇðcR¯éþ|
+¼4×ºØÁ¿äm¾¯þn
+Þ×ß\JÁKú¶ÔÑRï	²Z[ûRo¬éôö%Kùuü
+8ÓtîG/ÿ'³+WRFÛØ"V6(o^%r'Ý[(¶bq´ÅLË­ÔUALªÊÉ Ì»½Ó+ ËßpeÀZã)¤Ð!üë"úÊ·D¶­ aèÍiÂ*ÚÁÒßZ8ÂHpÍ5Ô2¿Mî¹~*þµØþâøkÿÁ/«.¥qÜ9!µe+ûÍ¯ÍOÐHfT*êâ×(ÓÚ¶½xøäTsÒ¡(ß¬à>=
+Ø~Ý
+mYAîIÏëÎÅ;ìf8í¦¯
+ÌQAtv¾§	Ç%º?òÉÇ3Ùþæ­{©èÌ84¯¶Ïátõ°ý*Ñîãë
+)_4s%½fóh[-"2­L¿øt0
+WvÓ¹²ÈÈ:ÂS,øæ#¥ \²Ø%qU}P®DvRQsÖsØeO/_Üt¿=
+-%ÌÉ_°\©çÏ#ÏQ°Dm*¯á /Q<ØÚ'	ç
+9ãdrQb©y·º
+
+CBsà÷²EL§ê6}Qc*ûõ
+ÉÎÓÒê£ÛêÜ¯6®YkîÎÖÛTõvºoäC./vs/Sn¤Óai=¯Î7­öÔ¡)8
+
+n}ð¾à#b÷Ö²
+ÿH=¾²µ
+-è½éq>ú$ 7ÎÀL"
+]Éûãäñ#´D
+gî1ýqË¤ëj{ål»¡Vq;q¾&òÐ¼UÓ
+-Ï;¹¡÷Ìø0Ö·hYYK84°Öµbñ5oB&: è¨ÄýöRjû\ïÂúÅ;_
+f«
+-??²]»ØÎ}hSÀyêï¡{¢Ó-ßÔ¢xº.(Y
+°FvðjAKQÎïqâÜ{ûG64,¤+¥Za
+¿ù±'Ì¸êq@Åê!eÊ}¦yIYl÷1Ý³Vñ]5õÐ
+
+vÎy#SiØÖ=è/ïilø{¢\{I,x{mHÁxrÉÀZ]ÆPl<¤rÌ]¿¼£f
+÷OÜ
+-¹
+-pßÈàÑQÇ	ó.8¯£nË$¸CÇû>o¨U~HAáZ
+-|+þ\L¼xy
+~qÙßö~
+©å²=ÂÑå¹	Qü+óè¨øfÍ7ÎËDÊ%ÔhµÈÇIMÈZ4/*Üâ iK_½3z¤ÆW]
+-KÕ)³½êkñÇÅdZ¿`ÆzËþVÔ¶áÛDGÅ.#yâ}ë¯
+%Ëø'þ-
+{dñÆüh£&}­BH
+ÀÑ5
+-ý¥\ØìüpÏ¦ÞÙ\¤ s¡xúf
+L:%Hs85f; #lÑmÄeîNYágÕæ '¨Òò=¥Èh©Ò+7¦Z?×hîLU»Jd¼ÔÊÙÙZò!ß
+9Lx}ÃwìÁïF:×,q­
+66K^ñn£VWÆ/*Ï
+>ë
+@äÙÜ`w¬5ùÓ>)íóø« BÇ?sïCv5ng`V	ìñ7¥ 
+-ðä;%~Á=G.
+¥ÇÜ¯<MË	¶3+E©N
+Ïg¨
+@°PL»ÂÏZ^ã{ ¸ã.Ss¢ohÊíZ:ãÿò}A2Gx
+-Ð_
+-ÏöàB§×i	ûÞ:3ÿþ´Òx¦yn9öL.G{ïÂàÌyïI|»ftp<XrJ`K
+ªÐÌÄú.V§¤¯ö±ÐÛÄWhwáÂÚE%g!0¼Q?¹^´òpgÂm
+M4ª°»¦à¶ueïàfîI¹«ÏÈ'a¯qäAb¶µÄÉò)0s³øCûÌ»î½Á¾>Ã
+@Bjná¬0^w{?5	BÁ;Ç×ª­î	\ãí´ØÃ
+-·!ÁôðCIQýpm>Vùo£ïÜ9µ
+üZØÐò`+GDæJvqÆio±p¿Ê@æQ^ÚQ®¡{*?*ê
+-Ù!¹e;ìhq¼øáþ!Thq"ÎÆÆØRæÃ3êí<a-Ç0Ñ-ðl®t	Qv
+à¼EodË*LJPiÅ¢Oóhê¹êÆÕ
+`Æ#ÈÃÔ¼Áq?c³gixì¦ù¤Gèrþ(:¸B®«"eï¦¤"0ZÌ¯7fIËgø+fÀê¡æÈaØsÊØ8ïsÌ¤.=»Ä7Þí $Bö!ÙÛÚ9öïóÃXyÈØ
+-W¢×)û^´¼IøÅßa÷Wc
+zóÞ@_PEçÇ¾¢ïîsÌ`À."z9aÃV¨#L!ã\ËcFåÔâÄP¬Ò¤xÕÒÚ,l>®.¹
+­ûè¶ëaí½"$ÞÂó<¦>²Yø@EµîÀ ádz¢8<D¬^õ7ÈÕ¤Û~{¢´d
+Ý¹
+-
+5
+ºh¬TW»¨,7Õ5ÍÞ×KÙcl9!
+â¨k ðÀS_7Ù:+yT
+IÝ8Ak8êÚ·IÀ-ëGöcÜká¥	p´ä©MnFÉ¬N¤ÔïS/.Àþq¶ 0ør¼ZsÓ
+«ÞN®
+Ó(ì}´Ö
+4>Ì¤èsªÓEWn·:¶IÃEñÝ1¥¤ì=|*bºä5màëÐlÖÖ:åïËÖAr¦G$M5ûWý:!Aofë©¶;IïýF-¾4ÒÕÖn=mßdÃN]o³æÉ7ØÒÐ ²~L¤ó.í7ÎÙ
+ÝmI]½µ2'á
+-A3<(¬ÉØ½vóóMÕ9åÓK§îõÁtIbËÔU+õ²´§B»ô®Ðx2)ê,MÜÓéÆd=øÇÙ%AÅ)¯LÄÖµé; å	Kªï¡#'CÓCzÒºv¢m[
+ò+Úzè¶"F[xyÏÔ·T7\Õë/L5ªû\ÍhÞÒáDpýìfµp¬_]ÑæÈçß9[Nðejm#­°£- y8ÃLCÍ
+-¿y§ü0DéØãm?¥;ÁôYzª0ðÓóæ¤ÅoGì
+ícÎÚ0
+pytý^*]à
+
+xB>"C(n¬¶¯±^T½cÑ`C2I´Lé÷^¡Ý&a¸88}Û¾pÓ·U<;<;k
+Wìk;ÐÙ
+kïWÅÏéÆ
+
+¸ÄQ¨T±Ïöð³²ÓÐ
+~ ô¦aAHcs¤º"&o4ÔÒlÁ#¡!öõ¹P}/æ
+-/k5bëiq6'ÌF1Ò´5 ¹_ËÉa"iÓc+ áÿjüÎ7¾d1
+-1½]ôó"Ùm­dí+èÅiìN§I]*PbçZj3¨;-C9¬Å2úÉTB¢»ßòV6½>õúár/üãFRË­Ûý"àZó$óÙØ[ù¸/$IÔ°#Ë¾|T¥ëÀ-l¦RC#°NcMmÌÍ«AüxºLpñ>[ª÷Ëïï#øÅ2Þ³fßP§âQoïnCçIÐ¸ôÄ'çÏ%5¦bvTÀ%ûY¢é`ôÆéÃ¢
+"«ÁËv}^?Ç?ÁHèn
+->¡¤!á .¨ø)
+õªË,*'¸¯F7õñy.Lú©|]
+·Y7ÀVëö³_Ôð´Åä*/³%y%*Ò öþsv¼=Í
+cþ ªl$k2¿J
+-BêZ@×åU,2¬ú©zß}íp|Åî
+Î_Æ
+&
+Øø¦K Vë7>¼£*¹²a.®ïÅ²Æ2$·
+-ì2£(¦áü~îìk¥mi¸#q²pÆçL
+-Ù
+$^Eç"PCkÓÐøß"¼èÖÝ
+4ôÁdFÇÐüùEuyØhÞþ`Þön¥`}áçú~¯õmGpé4\±6
+ûZÂZ"»Wgß³Iº n»à
+hÚ­õµFëÛy2zÅ Ql·(3 )'ÎYP¥:?:ÄÉ<)Ô³n¶cpºcÃ±ÍÝ$®z\ªÊi<²ksPÔ*¿<±:¸Û¢ËE `
+)°øÊ·TC½ÇHJ0bp2WI{æV{Ö@©^7x$äeÃ{Û
+ÀýóNCÖ7"¹ÓÒoÌc)ºóÞêõØë>n´ÃtãGO-ÀK¶Ö
+)ªÇîçAÙîaUzÝð¾öâsË]ÂÖK±Ö£&ü,ÁÒó	½ëÇRN6é8ùfB4kßvm¼g¶¼_2]
+nåT«XÝ}ÖºÀ.gN×
+-
+ä¶e':&Û(0Iy­·Áü1m­³)
+ú
+5uOµCÎyÆ?tO	õ"¾2Y¬]Èn&ÒSá^hÎ¡¶l´¯ÇÑZe=µ£I¼ûùFó"Ê
+¹Ùkx]}0U°|HÇ¿.V{ëe;i ¨ìCµ7\Æ§dq½¹/\
+²^dD%6ÁGX¨\\Ñùtîï7ï¿ùì	Ø#
+ù÷w½ÙôðæûLÅT¤}göÁ¬|ôrTa¦6]gJ:osÐúªg3gÐ¬Mä÷ÜûüÆÍ#ÁF»§×·A$Ò@ÓZêl®;És½ö
+-Ëp2 cfEPÒPWê«v+Î$s³ùá½vÕ:«f¯dpmÖP ®*âjÈýë¾è9ÕBæÉ¥*ÅöcUïÓU 
+-³Çª]Ü;¡tlÂ{>£\¯ÕæLE®©ÐP81>ÜÂO[_
+
+-#O³
+-ØÍ¼aYAE÷©Í=UBrÓ)Q|!id
+æóÃQµEK<Åcjùñ}L n&TbZ?T¶T3º¶éÓ;$·`í<AbR
+hLÂ
+-Ï=£f[NÐÍ{/|Õ÷ú_ç99Y#
+çb©ÊZºL§êµÐYÑ;!ÙzñVpBÎ5ÎÈ<tà5t­`möÜßS§xQJ7£4úËåd!¿^ÔÙ äQÊ«|»Kqòñ­Y
+
+6*.v
+c5sÿ¾C-ÎCF4W^ÿ»äâ-9@eRÍö>âwHzü
+NÒm°ÝþØTmlÏ}¯íC0Õöõ§®ñü´PþGãéÒóÕnÎ×òÉ #ëÛq)JFMÕäçÕ'_»zjÿ:Øö½cWÂn(éóð4³ó§j5­M.ÏrxåE}à`Hþ~ªh-V[
+dÖ^[%×S/´TÌlyñÏ¢-{,©nº>¬~ªÛ{
+VYuüñ	±r¦[ý<ï(è#AF¡¤^`ÑË:©'gNÍºûC ØÛå4î¦G9f±¹ý¦:lá-§
+J.þ0§9ª8'6ý³Ö)§
+´øRïO:S
+-væG%ØîLQ[po%³;¾jrÍ.ÛGª2a
+-±ç?û£¹\x¼cF4­ÕuìÁZ
+
+­¼!öiÝÃ#"[¬þÒ{²høFpo{ñ¨è!9Óès3Xc¾&æ93y¼p0ê¶Ü
+-îfJ|
+]|úq7
+-D
+DÜaXKè mäØ¢ª-VoøÈAÛé¯HÔ
+
+x÷ÅîÐh¬ªQ1[÷/}®ôæ*tu\¨-8zàÏ¸ìrdöÉ!C VûnÎØéxîËkû¶;ÞKEÂªÖGD#¬¸#Smm2È±4&+6^ÍêÓ·Óu»uåõIRÅ8ºET_ãc©TÊý©Æw"÷@l3µË¸µ­(%E+
+öY"cý³cþÂ¶4Ó[÷ØªÙòe\.¼ÀMF/
+Âúõ{©Ù,)6T!ó !­bÍý"B¢ox
+-&ó
+-2kÃkíò!^#4ß`Î¤3yµ(X%VÖ3K %eÁvî{RAÆ´J{4éVAmbß £rÊTê-Úà
+-Ø.
+îÂjó
+-ÅÃyöô=ÞlÍtÕ¥`A³ú°ÊTÍËÄlÊëó!~Xàôê
+-Ø0·+	öë¼±ÇÒNv·àÔzF'lüÑÐ1«6¢ÄlG
+
+W2àä
+-Ì6ëÔÊO$]ÛaRì>Ê!Øò2õ¡ã9
+¿NAî S	çÕÐ%ö¦Jÿ®PxHyMÆ¾o \^Ï3¼³ô0aøZÍºèfâËu,Ñ²Ê­ð.=ÈDk9	|p^­é÷dÙª´É,7S-UF÷ü©å+ÝvEØO³*cÏ6wïQhï×Fe4èå[£ÐÇÆgV1¿92ð?¦L
+-r(¾H¹9z;]{ U³DÄVwÉg=Ñº³²½í{íÄiëZ¤²Ë1"ÀõógN.½ûì]erLW«°Lí^òfYpýíóßW¥
+5Ohº
+ñÿl5ò*6W¥ëØ×´²[»ÇÀ÷¦½ñ]wì¶Ýí±!Ë¯zØè·GûIBWëI.¯
+-}Þá¹åDfÜ£«9fDÇR
+1S¹a¸mmb3Nêïúì0_|ÀX{
+-Ä2³=²Ý=6M;h`oBÊÄhò¨å
+ñTîªLä
+-,÷áÇ
+-¿QFPýÉ \%Ú[ÓXÊ¦¯ñ?¤_ù}"1ú¶Â\-Çò	¿³^¢Ïj³D®5èqÉ÷öú]ßnWïÝBØÊúÜóI+,ðfÄqnÈRý
+;Õíþe9Xg¢§Æ«Ñ N÷Õ
+-gÝ®
+-s)d}®=ö¥µ)®æoRl[cµìÄyµ qâÁß5@l.¿óa]dØb²¿[;R+ûÔùó
+g
+f0 {e6Aí
+MêÖåÝBÁwNð0|!z
+Y«È,»1+üÄ§çç]¯kÊ%ìÛÄºÇ)á,cLotï­
+¿hÖ§ÚiÅpz6ú¡ð°ËfÂtvl ;R	ò+b
+-}-Ön&Qý°Þ#¶·öû`nHZþÉðD¢ÃûÕ\%üOØ«ãZ¯N¬;@¨¸5Tªû(w
+-Y¦KÚdô	¡³÷Ü.ÉMã9È9+õBÎ ñLÁZBSüÅì,?ò«E»ÖïýPáÝOlWÆ¾UÉÖI×¤'t¿ÝÃjíÔ¡%$}¬¸N}¥
+/ZÓÌ²uKö@¯­Vï}H0Aí;ëNÚá#ùpò"D ªæøÁ/F2íÊ(­fµÅÄ¾©ÔMòZ]aOq$Á WîÇÒ¶An
+PDaÍvúÐîæni}
+£þBÍèUuÂUX!¤E¢¤"LÃ]Ë®×âý×ðNç³.LÕ¬J9G)óðí
+-|
+&ÏÍFï¯Öuëær6å×G(4-­z~«V[É9×FXïÉÞã¯¡FâN¥äéPð}4ÿT4aÍÉTôó0ÔÀö¦®
+öRgò£ [BNge±º·Àaõu ºU½`×÷ð¦]~=×+Ò:^	øQãà=oYånGôÜÍôöwû+«gpKå5;µkpôU}®µ<øËNè+2
+-æä<$ò@úa:5é!¢sQñ2Ý¶M¾D
+Ië=Á-©ç2;6ö1Òe}ôæ,Â&¿3,H@î
+-pOw¿ýª3kY£ÜÄ
+ì9¶\":fbÍ$äÍÜí?³fÌ0;ü@ê×Ê¨d#pº×/H!ýuc½÷ÈZDÊ½u
+èÿ$ùèÁ²LÐwÀzøùüfø´1YHê
+l¦R¤¡Ó
+-·½õ®ô&­ÝíÛçù%Gª's¹ÍlbâGã%
+BÙ/môküª0!/i¯&+CýÆCôf
+zçnß$UÈnÊ¡¢jR6É-«?@z¬ê«%)&Ö&<.pB$
+0jØ¾d¼¨ÔÄ
+-7ª&»'ªPúrHT8áèàCÃ¨2móª6íI4%ï
+-Hj»
+\,+-æß
+æZÈÁ\S½Nèß
+Ú¯<[H7jY=ê7¥Ì2¶»I¦¥Öíc® ¦u±él82Ötø
+ÛÆ7óí7j
+ðWD!
+}Î
+-;®è¿nºÿD4T
+åÖ¶ng¸}÷Û2÷CðB¯ÒàDJ»P­©âÔ
+-=|ÓÜxzÄ1ýÈDTÊJ1Ö±©Æ(ûÜ*Øãå
+óy lqµ6îzêG¥ÅCm3¢yeò'Ujùë¶HB~^3~|Ú2Å6DÒKàúæ£3hí jz	?*á¸
+^L¦c~YT1ÃÖ ãáB{W#È*	¯®ÀïÑ4AUvçìã$EÂçõ8h¾§nO¬Ô§« £lAøY#¦"ïÖÙNç:º%^ ¸'F¹ë§	f,¡/þ3d[ù»_;©}òÉHOÀÍý$B6¿À2ô
+ò¸$=ÊÜ|,¦	pIÕ	3¥ìhïkªþë6bo>XÉ
+Á§¸ø
+YÝ¸nYæ?~ÿnö0ÿòN§*áLSs¶½Ò²^PvÊßô§Û1â5=ïW
+-¶Æ.âh±ÓÀGÒÙ%>tØû0µÝhcâÆÃS\óèôÎã
+¾òcR¼Ú±æºÚB³N`åBê¿"Èªâ¼§5
+³,6/8
+Bê
+-iÖÙî.<Q)´¾×nYñyc-²)V/Ç¹BJ0b^]yð6}ÔtVÕüZN+
+d}ÍrTIÔ°èå
+C3¥ú:½V1Ô	ûælûý|`÷1rv×í.ø­£Ü~
+!2E
+³à
+-Ú3á#ñ¢4FÔ².|%^ÛÅÄFß¹i1Å×Ñw0i¹ÁqDÅ~	Zô_[c?h²tA}Äf¢¬
+-ï/Î
+-lØ÷¼§¥*ü~áºÝ¡Òdªì1F
+ê;BµZ²9TmáO,ÛåÎl/´Ô×_Ó2F|iÌq×qþ=á6IQ½ó²'g 8 zØ»{ç0Â¦Ôg"&8J­;
+Înç»#N¥Ôè&ðw
+óª2R~µb
+ôBþñ©]{Õ:·N"6d.ðM
+vq¨éû»Þ¨«sÚAØU'ÄZâÛyóÜ²W
++g~hsD­?,´ò#
+-xo4Êû7;
+-#h¾ËO¼,]xsHÏµM»¥:.öÃ`u
+OZÊFMobu÷µ7VÈûzÃè6H[
+-YT'äá©#ÙMG) jciN¢
+Oþönô=¥æ3Q¿y¨ã´_ÿû]Ï9àn=ÉBZÁ8°Ég{WÚ?ÛYÇº¤~Fì°
+"ÑUó<{
+cÅÃ¥3G«ÁÓöO=(¤íæ;)cÁYô$rÅÓ$êB§6B¾PÃ? ¹ÆytQ
+Ì|¡4»UßÆ;PïkÔ¢C\R1
+èb²^Uy¶ô``³·fóÕéj*_§>ð& ´hâå]«emaûüC+
+-¬5æ
+-e^5Y)ü:Sp
+3ßÖìÈ_$
+'k´ªD"+ý!¦¤)%Ë½«_mæaÞºJàñaÔ\:°t$½Õ
+¸'övÀ
+`ý¸Î,¬éfûËÈ÷´¦íx\X»/ÁVXêÐ¢&ªf=êl¢Vµ
+Ô|ÈôQÌ¸~²l7øB-`q¶_3*¬_-ô%?¯>%×Àm±T·&Ü_UÀ}Ûñf8Ê³e.­å(gÆWM[	?%Ôj0¯yo:IhQ±¦Ïimq*05Àê 
+@x?ê QnæV¤?YèH	k^£õù:ê<MA%
+N_¹ÛZÆò¸¸ÀV­.Ð·]qsWSf}ví["e8¦ÿñðöGÚÀëæYöî¸'îáµÑ;X»µÍáJ
+ñ*
+DÜªÒsº¦*{0]i¹Ûp§ë/%x÷ñåüËNE pë¡}ìn6'¬G³\#
+Áa½¾7<ëC½ü£ÛnÞÊy{DGÙ0¨/|5F1ìâ#E
+ rYä
+7­"eÏËü´_)Åoti
+OüUûYªm|ê ëä\zÔ(Wýpî&QKÞ[)¨ëx|&rhe]Ì#hæBÃ:"ñî}=CÈH³©>ìÑ±B¾Ò^7¦
+¨°x|	Ð·Zd¯ó¬e9¨yT:ÞyåmSR²ü/r¯ZB2NUíÓ
+";·¢m¸`èw¤Ó~Ró kÉ
+-&4ÐBTí_ß>÷ÔVû±ÛN&î¼¡ZË
+të8cD¨As|åX BM`÷ôyÐåT+5$¹6½¡¬*y¢!
+$ør>|q\4ºYÍ10Ý\Ô3óó**7¼&wÎ,{ÿ­gü²×²iæ6ÑpaÅ³éJ
+-ö{^0x©ZFôi@DË»ó¬¾¡îGÆKùòì²	*Áô¾OwØSIîëïJ5ªÈ0iq#ïm=ï¢¦VÖVz
+¸è¼ÒÙí&x
+wNXDõK*8ÖµK_MÙg_-òD=Îü
+Ø(ÛÕM¥áp¯àxYXÖn9Haa j#C²ï­¥k¿} àø Òr{íò³üÐ}F?îdB,å#5} ×ë¾ õÚ¥³<Â>(ÜøÓ}!Cn
+*æqGFÉjªISÈåiÇþO×rn_¿!Ûã#«G Ù¾üÊ;¨útsZõjÚÀR}7A´k¤²±ºe«ÛÝw@õOàèGÂ
+/L
+
+-¬Õ_9¼q"ºIWcþ
+Á²îPÎ:C
+oyQNOözÃ¦>wÌcþÿ	F ¹ßW½Z3Õ«ÐþÑ1öÊÃäs¦:çúßõLÃÐýb~DtûÎÄbzÂ<RQÇz¶ñ÷y·¤öBÒÓØhÎ°:/â©{¥2B{×:cN¯¬~;í­;Êüm)qÒ^üÃÈ
+p÷eM¹Júö
+qu:õíMJH:¯|æÍ
+- ò±{HãÕ boÂðT(ÅOk"Ø¦²[T¤£k¼Àº8)ùã)¼	+oélØ©ru=lvc
+MvkU¨êòV¥ck"¶ÕíÏ_Ý/HD	þ|¶aÃ;ÔuµG±à¬ß-T
+f>tÔ
+-~
+=)Å6åOÅãÃbz¯Ô÷ÚÞl£ó­ØÒúôE4zM_G#&÷}ªïÍ:¦ |JUèq¢¬¨)øBÅ2( sÜ2ËoÈ'ñ»ÓT3IÕ$·BèÍ¬ê×
+Ý_Û&I£Õ£T«=¾>d4èa-wÚã
+;O°nsßäû£rnñ;@e<%Üâ{³YjÕ)
+QçÛrx{<{B-¸UË
+ù¯íä^ràFBDÿÉµÄÑ*O×]È1àjWMíY|Öÿ8ø'õ`ºöeúÂsÀÌØdªäI×]?~þëEÑæ$ErbE
+lmCwªÀ±(G&Ô"kU
+,Mè#Jîã"úá1ÙöúO¾/pþV±:A¨HË·¯â¬U("~S(YL ÇlEh%CpÝÓU!©¾ÝûS%¨;Z¯g
+-¬VæÕoèÝyÃÏõÕ]Ñ`ûGRÿ¨Á#°»E~Ïúã¹YNhßdº®7}ëh~Õðy+÷#µÒ pÝÊvÔä
+ÁÄ
+p¦i¯HÌeÜÝí5ª´¢9iZ½mÑ
+6ÓãéÔ\C²é
+Öæ(õ"ûedâXP×g<!·¾'HñLß0(%éÓ$;Mà"w9$_ÝR°Çª³É¸EîY-ÄÍÒíë ÈåÿõyèYeRbÊú©fIÇCÞ](e×^è&'C[/BB
+È)Rd%ÜT5¨çù­¥Jn«5Mqi
+-@r
+Áï®vq#_vÒÕM
+vDqï¦ÞÕ»Ô1ÿ
+°+t±@Ûø®c
+á.u£QyÐ&HãJ¡yèôæÊ(øú¹g4
+(à'gÛß·PGóv­9gÏG¶¦ÞKö¦²ÐÐìPâÀvwó»9
+@zÍ^z¹¿º¸´êY¹ ëCü³
+-)dàLËO@3$FÖé¹KqjvdÝ\lZJÉâ
+àd~1Èö<:U$¿;>êBÃÏE6U^Ý¤ârkbô/è9jÒIÑJ4ð±é=ÏbiRx$ðýO'kÜ&W`5ù?à&ø 
+-Ô+ÀªK?æÜj
+--lîK¤E«µ¢aìÈÒÄúezã8/
+-°:à>üÐ¨µÓÒrg½Ißge.\Pa\~3C
+Åvyu9@&ó>Dÿ4-]þäË úÝQ¢;éCÒ×ïú[.BFtÓüøÐß6l°
+ÂE¸¢
+¤ý&¤ñ¡ÇQöýã;Ëû	,n³Y¸AµÃ\{mÐu
+-
+àÐuê_y!$Wo=ãçm7ºñ>
+Ãe%T°ä«zOv.íárØ§a©&äù»Íyg]=8°
+
+AØ C^ð8*Sï8íN+×XÉöÐåíRA$è¹Þ×ªçñ_û"&Âÿ?S
+r¥JÅy^ïç ?Ø³BÿàcJ 2¶
+-.*YubZHU
+z®ÂIìHrÝü6»=Ì¸
+n©÷s«vr/Ó±aìôKA{[nzu5äòõ¢oLÐ(¼B»ëÔ,eíÇÒtÝD*ÞI÷
+-WK0úr·i®
+1[Þ
+í<ª}²öåâ,Ú3âmí¯;iÈÉ4ÌÃóJI·#¸Æ¡ÖÕÜg<ÌÚíMdò¡/`Øù²|çØëòÌ?K¬)`E#Ùk±
+-ûYeÉÝFômâç:¢0ûÊvòvtÖY_E"{¶æ»bVµw°Ñ'ËÇÍ¾ÝAÈ%síà
+åÃ#
+ê¦© ¶¢Ïyï1+('=KI$Â4ª¯ý§zØz¡ÈÒq
+Þ:¦¨÷Ò(*b »ICÏó"Ð¸Ö9÷iN¹¯Ô|÷^I& D±©<CX¹LöCi82ú²RzaògÚÚ$å/â[ò`^µ¥WÄÛ<?s½uSÉI}ç¹¨ÂÛ*E;ºù,
+wþ­¶¤o)ù.qþäï·î²¨¹s
+-sÅTX\ö
+-5(Xõ LÎJw<Eml-?(3ïfÁ{©dÿÛ«¨¶WXùOì3>¢,÷'8Æõªñ¨«òÈáÈIÕöÚÊÜ6T¥[ÎR¡4ÕéÉ±æñðýÃK T:P4Àq~nw\ùØØO47R¹§(ÝJm/B'ù¡E;«`Rw,*~DÄ
+ð@RÝ>î±*nJWUBiy×
+-zni.ýn%j*ÿ
+Ü{´`J°&·#®Rúp³¨B$&i#¹³ AdÆS¸Ôì¢Mw+Z©ª\G
+|$Ðdbf³î®#6KábÃ²hB¿qÛj¡JèS/Mý;g[:}aq,Jr8V
+-`"ûú±ÁÖóý÷y0Ô	}/
+Ø^¸e¿¶
+-Çón¬BØ,´³
+iíKø®_<
+-3rðËÏBIÄ;Ê727ó®y¹!@ô(äk´Ù
+´y¯ëX§¬
+S®t3.lÙñ·Þ}Ï*;£+ ¡ª}·yç½£:Ft:ÌzH¤¬5é_íÉ³õÕ$é8RmÒi·Ú¥èa7uÇfK7d×þ{,³hÂÆ×dèáÝø. 4å
+ÌªX<ÉY	V¸
+DÿYÿ
+-LP-¶ºÁ2¶é§âZ¾0´ê9l~Rä]_Ü%
+-TÞÊ<yÔpËüÇ>Z\×*~[
+©ÞM®
+-ØåRu¡ðÔ»5ï$%éð+uÎLwupø!¾A
+-ºhCà©Æa}Uc­Ñ×Ù,óÊmlÕÉòÛv®×Å[>ö $YK´:!ÁF4:Ú¶eUjP]¼Y8¥²u,r/©Z`{ñN«&á*êKfG7µugªMÖJEp>H/ÀQ	¹ÁH¬¯ÍCaí­«aJRµ]l/ÇÖ
+\'W4§eýÿ.Â
+ãì=%Î¡ÚãDp¦¨mNý.öò4Y¡1&Í-Ñßÿj
+ÞúÉ^ÿ÷|¾óæèþS6Øþèy_z9ÊSúSE&ã,^wÈ#WòÝôÃ$¡ö,»
+-ÿ÷¦P'vv°TÊà¿çI©ã¢ó,>ù-½ëñá¯¸t¶¯Ùþ®4lxc³Ï&SK:xv¢7¨d´à`$¡»Þi]°ÄèBã¸(éò:tÏeÞî2H´éM!ÎRDãÔ&
+-ùçJZÁsÇ ÓõÝ¢4Aùä®OæìBÏ*dÈê¼oys};§==¿®Ü6$$¦É¿e£áÎÝrÛ!(ûÐË&¹SZçêûwEîáä
+¦¿ã
+JªyW3éæ &7§$ÓëãZ
+/Íõü
+-ÇÙ0½h¦hÞ(§UJ»ÅÄ}ÍPÇuo³iÆl0
+G²d*Ç@Xß!ü
+¾©kïÜUÆ\º/(øy]&Û1ûÔ
+®é£Ê áXfC êËOãxé%J( ¨VÇòzèì@uÒ²ßýÇãb«²Ï§±È¿«ýhgCu×Ã¤R<m WPÝJÕî\1Ú¹¼Þr¦Ù
+A¤p@5jþ®¨';m³ø ÔÊÆ#Ð.!ºù¢JÖD¡ôG»ç!6XÚT»¹ÊRB^ñgIi<­£?2ø-ø/¯d½¶Ê¿/gû^dÀrà+N=~çcÚÄù1K ~
+Mg×éQcä?b)ÒyN¼0öòTØï²Å8ã¡Å è	Â1_*94	Îõ
+qá·º
+Ñ
+ækp¦#IH:
+aErÈ 9¯ùU×jôH~¢×<«Smðé@wÍË¿?Ù
+-W[¸XxU¬Å°+ýRþtðÐx
+ÜívZaõåÜ.½à3Ãea?7¾
+-÷¸;Áµ'ûd¯È%*=3*&? Û'¹ÿ÷Ú+Õi+"ó5õ?$ÄÑÛ3@êÚ«T_áç]q¸~T%
+-NúÛ"rÎ_Ýßn¤-lX\HJÅ¾»Ê¡0
+(¥åÉ¹Å/pÂðTS6ÜÄS=,º!öôRt
+x+è6&KÒ¯¤çáJ³«M¦úª>´¾§*`cRU¹Á=ã
+ìJ6èaOþ^b1rÀ
+-´ó57
+lUòì
+
+
+4Ä'¶ÏM¤Wb§Wå ðìaÂ3u8	çç
+s9¦Aq$BlØßÂ­Vwç7érÛ+·L)ÀÃÊgZuuf6¤s
+-Ááv >B©ªvI¯ô«õ¼·
+Oß>Õ:kóÄyÈ&Éá`
+~0
+Iè³Æ§¹ñ<ogýàÎ
+-gaw¿Ê5$
+º±£¾m¸ëò]®ÖæÈ<÷ÅØ.f-»4dÆz
+Y¬Tw7rÁ
+Î
+&m¸³Ò[!Ð0çÔà
+"·¼ç$¬ý{³ñ&o
+Â¯oÝ¶.Iß{úfØINT·¼»)¦¶Òì-fùsT}-x=[´Rb
+-ßÞUÅh^æ;ÆÍ"bN=Y!Ù
+e!ÔÃ;AF!Ö£¾~óymþ­
+Ä1±ëÑÔþnÃº2¢ònä
+iå`F{ÿs_¬ nµ;8a@£d@~qìËônÑ[Ï/ºHÑÿ§|l}¤ª_¦)&d÷òvÛOõR´zªÅ4ÃlnÌXd7Â°Pä
+
+
+R'Q½v×ì ÓcrÞmäcÆ¡Gþ
+,vpQVÉù§]×ÜH\ÄÔ:ºy$ìúÿ¯
+-J¦U$¼Bf«°õ¯ zþ5BUâ,ºp¬N:­Óô{V¦
+Èk9MºÌô wÝõgàUà:öOwjÎÛà±X>ª?!8ªÃ/ðÔÓb 1Uk
+/iÈën§+IMçÈ?ÚBøøÁÜo3Ùr«Á
+-RYÁÀ¥ZË×@í
+äÑÊ×ü}½.ÕºhÿÛ{
+k
+-Ô¸Ïc³ìüYÐ!:o6`|kSU@¶tæ;;dEÄ9°Èàq­°ûþµ¤þñì8ÿ<éÄ¾º9ÏCyR·ÅíGçh*é×ÈjT¾ûvá~5 È3õQ" Rþ NÏ
+
+©ò÷¸´=áizuå{?ûrÌ²7ÎÅiRp*sxP³ËTúÓ4âôJ;þîÏZp/Õ÷ÇÕç
+é<ü¥ù[}íÙr&æBÑ(5Î~ù§j/è^%>}z[ºäÅ
+²Ïú®þ(.X2^eZóÁTíÙÙömÈ¶^r#
+7*}"-y½@¸Ì9Ì¹ÅÆð1V_
+	Â³Çòg(¦ÈÖ}hÕîÔ*<úV1òlG
+\êg¡aÜµX-0ÓvÂ[;®±±^½À²m¥ùùÌcµnøÑÕÅÐËÜÚÂÀÃIõå¹c­V^$
+o³å¦,FZÀêFÍ4õgJ\õ{¥ðëÁU6È_Á¤x¶	ëú±y¥Úø±.G Ê¾j°²©wòÛ0äQ <ðuuU³û-<OØe
+-BFÎa1í
+Pv?5®~ë( Ã
+rìçÁYã]±éo»ðZ
+-«ÞÉ+û
+KO5p¦è	³sY¤ï^¨.ØeÙ¡%¨á=Ý`¹¸nfªw¶R)Ô»[n±	Â2<:ð~ S/Bs+jà0j,-° ãî÷(±'kºKý£P
+* lÿ£kUgOøE&/p`~Z(eÝ üCºÚæ%I¾=¡BMz +'L² ÌÑîë)?<yÝ¼Ä!à	·a*35°ÈNKðo¥À/21~h^\â%D'ì%vDíJ¡çs³2ÿ)W]ÿvÅ³¢d¤ÁøÀýC'6T>gé
+õ±ÑèØ
+-þiÍÎ|ü¨¨/©tQ³·å<^ùªõR§B^ùð{Qì7(ÍÆúszÛJª±¯@}nñ*ÎJä¤©"Ïsg
+«`V¢ñ]ýJcå
+iï½÷Íëën¿<
+Þ7@¥¢;.{Ö·(êé:-c[ýÜúËRÿ3Âh
+,¿¢Â¡ ýwCoaYKßþ¾ì¡myLðCÛÏilÄ@^cï_Ô
+w!Mr¬(có¥£[çuµdÿ°O«Wfc|¢OD'|
+0=U×t=óüré¾¨÷ÚÉÌD{ÀÂú
+$zqÄ<jÁ
+W øµmaÊñMb"^
+°()Á¯E!ÉWÿ>n
+±
+à(*¾ó,O³¬¢êç·åîòÄï
+-Håiöäé;ö;³ÓJîºïÊì³Ü
+-
+çµÖhícÆ
+Î@Ç¹p²Ì
+ã-xãhoQt(º
+V!Èn\
+ÿ¿CÉSÔç.5vº]!èhÁïa¨æ
+-i}wô±pÊ3ÕRñÄ½ÄY$Z8\ÅÕÒò<M´0A
+ú#ºµèî/@:ÌuÝóïý5&òV
+çj"(»9=^(gùOñ
+
+þ¸$Ð
+&(®¿cä5ýåkþoËÈ
+?ó° ¨ét¡N+Th}(Tí0
+µ?Üe]rA¹ôüÚÂ:H)Ò
+!Ò
+FÃ>ÆjAÄoé`â
+P`>¢uâ_ª;nö9]ÿH'öäKLND]»©}ff·Ìir6Ý½TÓq®oÝ¥E¡×=òV -Óâ24¼%ÀÌY6ÊØÅÝ
+-¢Ó±Ðjÿ<+.
+-í¥ôV¬¸â©â'1WQ|ÔÐ«/õ}7Î/Whv eBÑ=GÚ3À¦ùcµÇÃVA¹ñVµ%Uh¤~×ÂØ±ö-Ê.ïyùß~7­Çi~
+-Kðó
+ADx
+»o
+ëáÐCøsÓRùlñ³b¯%¾ñæ
+-kü3ËnþÅl½Î
+zâGQ¨nùö`Ñ<]yýFûyÈ{¦d¸è6]kp§w{ØrÑIêq£Ô´
+_K'òu>d^2ºT0_JAQ
+Æ_ÒÙåxí{es_Ð£¿8Ü[6sÿù,ñ§ J.Û´¯
+¡²udçkå¢Í|ü`ýßã«æ@ËTÿ¶¨þ±X1PàrÀ1XO
+-ÍAÈ.Ä¥³F9ND¹¥ÑftJ=e´H,¿; Æ;í6]
+-PËÐøZåH¹æèqók­â7ø¶:F´
+DÑûN6¥Þ]Èp"U¾BÀÔi¯ám®²çÿlü½¶á8ì³
+}Ö
+n×Ä9þü¿
+éÃò§ - ïU
+-©gRo2Ä pÂI$7g¾
+*â×kìK9j@H î!+¡
+-¬¢º®ÎâZ; NR÷hKK0o¼*ä^ZÁ`]°Õ|FÂ@
+-ò*þôMSSú¸+K¿V½o|8{Fù±ÐXmmW|Þn9L°³dºw2ÿzíë	ß°¹VËä­Ûû³sÃa18½àtæõfMö6Zu,³Ø.±{,ÈÑþ6]VX
+-0ÀD
+-DL
+¸þÌC1ÎU¹TÀtDRÌsØ´%Ý/;)7[¤µ¦O»
+|?p³/ÉÄ¹A`Ò±z4ÇÅ%ÊåØÐÁTjx®-ï	lÊö=¦Ù#ùöÍ("nXq­WÇ{?Ûõa÷pÛRZ-wýÔÏÜþ0 Ø¤hº_äR¡r¤2ïþ\ìz³DGrN«tì§¿]õUÌ§Y¢ÑYÝf×Ù\:vö°òkE'×WÍs­9oæZY?U cÿQ·õ6§QQ²\÷uRÏå^óÕ3¸*ÔèJg5%%lj©+ý£&üS¼àÈ¼¦Oî±
+-
+-iCß¶KE1ÿr\í»­vòô^±.
+Á¬RipgßWì©
+êK8åmç
+í^´¬^m_
+Ô?ªÕéÏóaQrP[&n'ºâDí­ZÓþãÍ@qÓ´~òëôôX«X!yê¿¹p
+ýÈ\Ú2AQK{ 9à*ttÒåÍá¯y6EÐ5ÝÝÛåXä lð¡û ãJùßØ¾±?ò/³úV¯=ôÛ¹jÞâClnk&¸ñ©#7¹ÊÌ~I
+èëÆâ'À06{¦l\@ÊµÊÍÜp<à¼
+gw8ò	p3Þfúéæq¶²Èý¹¨}Õ¾¿ã
+	ðÙCflUÑæ0³DÂ}LFÿU¡¼·­7cqäÂéüú
+-Gy°
+-µçù
+·²vO
+é_n7ôÊ¼ÕÔÖjCI*ßN­Mß#¶Ð²wâÅ
+E&µ¡ï¤lÊÝ#0ô
+&«Ç+RÜ!J#:vùTIFså×-açÌÌX1ÊÍÛ3eb$ÍAÑN%#A¸c5¨jæ_íÙ@¨J;g°Á³T§PB·c2X(ä§Ä÷
+Äiÿ\Ï×4û­Æ
+>[6ùôÛm÷l%b~iûÓ´_5VA6h¿
+_¨/©
+YÚ8ÎÆet¥÷5sCvT½
+-£5ì¸3{fD
+'ó0ñ÷ïM4ðj_«Yó×ÌQ=úg
+Al¿Â/à7÷S
+4®
+jê´ÞÛ
+
+-Q
+-Þ¿4j"þ$½æ36S
+E)
+-º'=D5~bAo¸*ö¬/`dÙký96©óÅb·´ÇS¤X
+¾e±VvÎå
+Q¹*ê´
+ëNÑ¥J=¨Ý
+-©+}Þ7À"»B#Ã£o<õ6¶ðT ÄÊ%?þFÜZÍ|iìÜ·0ÅB»^0Á?+EjCQô	¹DVÉÚ?a
+ÀëÁ4+Q:ehþÉ¢Òc
+L¸3ôëd22§¹:8Ù
+rþ
+îÂ
+-H4|õ³|F
+-Ûg^ún^ÓEÛ.<fûÁ]
+ÇøÌ»ûýùsyE8KAdxö$}Pä,Ç®¦
+ÍWeüñÃô>%¯5¡~ÚNâÅq£z(N×kE£PzZÑp åxæÊ5ÙLARp#øa[_0b«Å+Klpæö<Cà®ór³Z0ÿDCÇpÕ%c+.9ºÓv0[Ä4ªèí?â¡ºó
+ÊJ=ÈÊ¹{èFö(ÍãÛþËmZòk
+--ÈÏ
+Ò©W
+-xªG³°A¢ýÏ5Ú+
+f&OÄ¦ËåM
+§tM>À[
+'Ú\ÁÜÜ½Û]¾kýÊm0iþX
+{ÿèÐÛà¡ÒÛC*µ¡<|Ç¯¸àÙ»¡ñ~cÑÁÅXAµ5¡òÌàê·wÙ¤«7»M<ªPÀR2,Q¿´¡kiuã«
+O²ÔÁ®ÀV[Ø3õËõÀä m>âK9§b¦ôâúHÙ%IÀ?êE[¸ÉPú»·,g	[Î!ÖRänð.Uf÷
+-ìäÌjqMá¢zUÖ ù
+¬¿(»+.tÎéìktd£®:(~»_	IMõglq*åõw
+	~fé¼×ä]I©öY-ðêj,ØÒýú8 äÕû..DÈÝ%³ôN[°¸@Ï»zÇ°Àxïú9Òö3ÂT£wçÅË?ÐjAÿb§ b
+m¢éÇtÇûxÎçþFÑLøðË7aÃñ§c7ø8ÿ>ÿhX²
+©
+jW÷F¡r¥¡ÒûòEë¥ØÆÎêKWE¹uú|´ÏÑH]Þ9ãBÍÑNt³
+kS#OÜ^T24Ñ5ùçé
+vP6Áù×cÌÊk]t~b)úý9¼
+-2ðJºT=ü]rd»ø¯%
+-uÝ¢XMV1÷ðä¬ÿcãâ±Ý{Ð_üJ#¦´§P{¡j¼£ñf<Ä½´/Éº²¶ãíUýepª)"Ý7£óÝ"úØàUp¢£Ë
+Xåm@ôÀ¼°VS%X-4Å¶²Bª¸µªI7ßé
+-endstream
+-endobj
+-769 0 obj <<
+-/Type /FontDescriptor
+-/FontName /LUAKBT+CMR10
+-/Flags 4
+-/FontBBox [-40 -250 1009 750]
+-/Ascent 694
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle 0
+-/StemV 69
+-/XHeight 431
+-/CharSet (/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/Y/a/acute/asterisk/b/bracketleft/bracketright/c/circumflex/colon/comma/d/dotaccent/e/eight/endash/equal/exclam/f/ff/ffi/fi/five/fl/four/g/h/hyphen/i/j/k/l/m/macron/n/nine/o/one/p/parenleft/parenright/period/plus/q/quotedblleft/quotedblright/quoteright/r/s/semicolon/seven/six/slash/t/three/tilde/two/u/v/w/x/y/z/zero)
+-/FontFile 768 0 R
+->> endobj
+-770 0 obj <<
+-/Length1 1728
+-/Length2 10154
+-/Length3 0
+-/Length 11252     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ´T
+Ø-wwhÜ4Nãî4$84NCw× ÁÝ!¸C 8Á	îî@p
+-GfæÎÌ½ÿ¯õÞêµº{WÕ©ª}j×¡§V×d0w0Ë:@Ù8Ù )
+-N. ÈÍr¡ÒÓkY;Ûÿ2£Òë¡NÖÁHAÁ&ÎÏ6içç8@ÑÅÀÉ
+-àäää\@ è?PA´«µ9@
+
+ è ;¡ÒK98z@­-­Ëüç/ÉÀ	ñ¿üã8@Â
+
+µ63 TL­ÀöÏÍLì fÖ`gÿJÁ$låìì(ÈÁáææÆnbïÄî µe~	p³v¶hÀPW°9à7aª=øOfì¨ô -+k§?íÎn&P0àÙ`gm8=p¡çâ Me#òg°ò/Ý
+-óïtþÈòÇa33{G5Ä`am¨É*³;»;¿@ÌØ99<7q5±¶31}ø£s¬Ä+É3Á¿è9A­
+Ø¬í~Säøæùe æRöö`³êïþ¤­¡`³çk÷àøs²¶7×_ÀÂbnñ¹#6Äú
+XAú¯gê?6K°3òx àw °»ÇïôZ
+à?¿ÍÏ
+|¼
+
+
+Ï$À>ÖàçT/'W0Àêöñú·ã¿*''ÀÜÚÌ`
+-¶´ þýÙ
+¶ø?jíx
+|Ö
+' øûó÷?gy;@ì<þ	ÿc¾
+:RÒj:J¬2þÛ')éàðbãæ°qñr@ ~^ Àç¿³üÍÿ?Üÿ°ªXÿÕð
+-
+ èO
+-Ïw÷®©é¯aüwUg)Lÿ(_È
+4{þâüÖÿGþÿdÿ;ËÿMùÿÛ¬Ýn¦?üÿ·½µÇ_ÏJvq~Þ
+-çÝüo¨.øÏMV[»Øÿ¯WÁÙäy;$ v_£µ¬µ;Ø\ÝÚÙÌêO	ýg
+-Ïéí¬!`u'ëßo
+-üßó¾Ù>¿'NÏ³úÃ~^§ÿ.)1s0ÿ½w\¼| (ÔÄø,/.^^çóÝÿP6
+âàü|ðLÏ`á Eý=Q>^ ÄoÓÀ!õ pHÿ õÐs¤îßôLþA  ÙßóYË
+àA. Å?ðÙiñ/äpXþ
+ò 8¬þ»µþ|.kû/øÜ¯Ý¿àsöÿ*ôÜ?ä_ð¹°Ãßç¹¬£Ó¿üÏ¡ÿÏÿñò<v²3qúWk| çÁç?àËÌ
+-}~ÆþX¨çYþÿñfÁî`3ÔÅ93¡`ºà¶Û	27¶Ý1iú]ÝTf6¯Eh»Ë=&Rsufà:ôZ"iè
+öÊ¶
+ÓøÕ/¯ïÂZ^µþô~0ÓÜmE] ì/ü.QßGBÎ¦%¾çýë·N-ügØNEúÜw.êùx·n½rîõ}eË#¡s»¯öªùÐ
+Ê¦Ø¢µ£ôgèóL³fiÙ(YpOÝ±f®®§qsÆ¨ãXQ}¢¹¼ÞlpÅÜÍz®Vhq9uÐ¼!¦¿Â
+dð<HV$÷*)Z¤Ì¶nÚ'rÚ
+0yîªjÜBÏ
+-èÇH9àñÞG­·ÈÇÛSÇ#òd®(®»+ó6uz©oý¤fÇ_Ï«Úí¾Ï©÷<@b"¨{Í¦aETOéá
+-£Í©gÀ
+/Øµ
+x&ZÓ0[
+^ÅolaËP|n÷ß²Ì¬s
+8\Õ¢
+ZqT9Sô
+-w=Üf±Ã?½4ËpèïÜu2·'1M¢ol
+9¨iIÊFc%{OXEár
+-úL@Mû»Q
+mÀÈ n÷;sFõAkêmxß·mü2í²'êÊ\LBy¤Ø»&¸°ÍQB¹MAé5Ü°MÅðG¦Ðü
+ÝÊ/£
+'l@aö2KMI,tU»D¼7ÙjO¦óbxÉ
+A
+-=øÅJ-,Þ?dQ¼z" Kaþes2/×I²¾k#m·¦¸O®{Õ÷ÈøºçðØï0$¢Í}HÄãÍúsóí|8BÑ§Ú
+Ç}JÎ MXØÁ]ke&æ@«Þy/??a{ÄY.·ãäûPKÞ~_øÀäÁÔ» r2\ ïøñÅ
+³0·æ$1Fyg9bÌ
+2å;÷Wôd!ÛÂn¹NªÒ®¢²±3Ùåz4!mîoN~ÆzNgüdÏÒ| rIÅ
+º,<ÔõÃõú´?­0§­Ñ®Ójakï ì¥KMÏö1¡éÍ2«3bèíSB|ÞéO
+{õrfwÆûíX.>/cG9+¬¢ñl¤hë¿,Ï(TÊÇõ[U*.0Ï(kÅtÒK¦Ü§2^9Z
+VBïNÃ:Lá_ù"ö*0®÷Mï
+sÊc!+iý«^F<ßæ?b¾À.£t&Ü$
+-Õk`ÁÙpsú
+ë·qóUÉÃdü)
+±xËbO'ë&
+-wÊc¯@é¼ìÖI¬AQ
+îÕèÝ{+ã'z>ûã» ßêCçC;í{Oê2Æ0¨ØO1
+ªõ[ï³×Lù2rÝýâ­è8Û
+_ÏðñRd_ÚµhÏÚ¶bvT½DsöXjyØÛ^ÄÖ
+-üt
+-í
+_
+'ÑÄ¼W§Í9Ú7Íçx
+À¶¼Él¥uxIÎ
+-Oî,#tÔ+TðÄòþ0äåBÝ:0ÇÚþGbÔv£U+&¹,ñÔÙñC´zùï?¹'ø1}/B^ÏMÖ1Åç7Ü²ÍÈ.½Rª0Ã@UíJd¹ÀX#ïúX¸±è?ÓC®]ød6Zµ9Tb7ã·À7eÎð
+kq½q"ç%Õ
+-WíËô-»6uozffLûÓùò,
+-\\6Ôý
+-ÂKÅ
+§Ô`#ºø4¿ERo/Àüh¾ÞìáÉX~
+R¤ ¢0ÿÁT®Ò_õ&øÅôèO©âü<hâO0ßxâÉÛØE` F©³§¬
++¦¶YÝ\G_ûÖ½ÁãÆ¦L	4üÛ7ó
+á3ÏãtË=úa
+Okh
+a+~¦i4³K%egh8â³ôí
+H¼er
+ü´"^Ûúø)·É;ÒM%`ZW'`ÚÉ¶hEªJ*ãçH(hâIÑX'nåí¨öGÛÕn$)Kî=Ê²
+WiBµëI
+¤ª>ñ¡ïùn÷ì==¨Vû¸mÍ&ò!Ô%¤FO\Ùä2¦kL/FõJâÒMÛÂÿQ¨
+-Í¼±yÅnØeô3×/ôíÍ+.¾­T©¹÷ô¤}zZWQ¤6S09s*eåÇXVÓAµÇFãñ ýéé]!ærETÌ`Iô÷#tåz&³5ò(q~@B
+W$ÂkB)?]½
+ùfäwÄ£ß½Ý
+uT ª¤¯a¢|}é4¼ÇïÃÙ µ+¨VZªò¥â+ÂANN6HèÆfM¿ß¨µ»4â#¸`L&ù>Á½blË¢
+þ©ªÔ »Wcím7Lå"5· E"ÿÛJÁ:ÂÇ²A§ÕÉ(û³²3vöå;Qô°/áÓç¢¯:Ã>%¸Wí~ùì	IÅì
+µ*©±x§Ë¶ô+ï]Kª#+ûµ¥Ý\(¥3Yì· WóâÙ¢lµðõ;ªÌãVYviL/âÒM¡t	 äÞ4¾JÌµOOuU1¥»¯!î(ãça4Üo´X7ã5ðÒ Kv­$4«0âr0Ý
+ÏÚ¾,9pP×È
+!Qå¿v!{÷jÃ>¬7yÚ©CMÖöOÑ<<d
+¦UªOG¤i×ðJË_¸wÛqÎÎkÊÕ¬Æ%ÒÒëÛD
+-qA®9Ó<XÈì§«ÍUiOR
+§ÉöL4Üs{¨C
+Ì©Û5Ð`3üÂÓYÎr:w@{¹DU}Òæx¶
+=¤ñ¦t5÷:g¡eÎÉ<>V¼à¸5yÕph¯|¥BÑKµ&$>Æ"Íq
+»üzªÐ
+Ôà§PUµoÄK´î&0(ÃjZÙÈ:»l­LMÔMo:<^¯£´PT{Î¯Ï³ò/½#@ç=gMVnà5.Êï
+V¾³
+,®æ îbXV«Ó'¼wTëLîrÏøeö½/u¸e</ÿAÏ|)E0ûÖ!ÚÜ8<?_Bå^Ý48*
+-RvXíü"Þ¶±(¢ßÎah\RulÊk7É¢&Âû£V[ËêdÕÎµÔJfÄ
+{7C2Bç(Þÿu©Y%e¶mIý§Îûx5Ç¼ág3)ãÙÜ-`FLo o
+Sãa|8§b:3:i5^â´È0DLÆ1&fÓä
+N~¤~õÝ7Fæ¯F<
+>JzyÕ¬æs¢fk:ïùúq2oú_þÂÇ#a®°¾ûÔ¨ê+§sx!8É¬$yYöúSÜ7 íâTÝ2?á¤ÕD[rÁtø
+-WËGÍÅ.4½2QÛ¼|[Ú*7±nÇÍ§Ñ_ÎYË]ÔF¶é^shWÑ9züöË)ñsÖ
+OqíRËX¯ 8^/GÚUJgQä/fÉ¨jôIû+?¬ìLäs*KÖãÒ*îÔÁ6v]<ö5S8	Fø0c¯Cqqâøß(KÓ$]Zì)pÍØ8÷0	r0E)dËåå,!!Â
+7òE¼ 	KÅbÍ«+
+^n3Ý³l¾7øU·:w={:¨_|ìÿÅË©v¾VuHæAÔv20²¥fSÜºá ¨XªqÄ3YHFÆÜàt¿H<Ü1CÔéJ:cË	ûdM9w.µ2ÆÏ_Çf<°H÷¢ºRÅu
+éÅ7Bïú§Þ¨1ô*¾×Ô½´óñ°·	n8;Á¦`óÅªb££D.ÌmáÕÖ2¸ðZòn,8Ê0w
+-¨íoéÌ¥µ¾½Ã¾Cê±émÚL°öVcß¹jÂµ8õI"y~ØKl nLç²<
++{Àç+ÁÞX
+5E2¦R}>_Ó%åÄô Y¼Î9ãlmå	Ä(Qt«I±ªJn,yEu
+-ÝGGÜz²eü(kº°}Ts.çb¤ãS#:ËÓ¨:©>Á­!øÓøÀ~Åïìë[ÑÂã´×°FùøÊmB
+øÞGMi±?pÐ©É Kà¥C6S
+¸lôQ¹Ñ[ÜÈ¦k±Ë°Àã'POÆÞ2¨Ó²]]|¹Xü¹ç< 0
+ÅPÖV
+]l/¦Ù
+-ñáÄ7Ô¾Ç×æ413
+YÖ\§@¡tºÀ¤Ï¨Ýsù&02/""|Î{ÄÙÞ¹fåÇÚüäÿªÍÒÄPæx
+»{Ìñ6®ømB ¿
+¸èAtW®w
+­Èæ¾ÚFýkõKÝýDB¥*þwG­·6öv¨¡éÜ9Ô+§$ h|ðwÒhkClc^ê:^:Òz³%wÚÚijÃB¾>Ë%XÍ8·æ¢Á¤ÈÃ#ÉwT-
+H°vÚ®E¿"sXqêi^Ñ{ôÒhÃÀº7(òiÈ¥\7¬¹Ú¯íÔÑ_Ýõ´æÔOáT¨Kù?¬q­
+ÌØþºÂÇcøÞv(®ãG(RH¾j¾²èæh»FüIE²~
+-¦ÖÜòæIû !ðç¼³ùvÃìk>²¨Â(ñ¾xYCT¼e]ÅÐçÞ Ô\YÒ¥É-u°0+§Èu2Ó¡
+-ôÆ?rïwè,²VòWWOúzcQÝ»³zÄµVSøÅzÇ?JOç
+99ÊSÄÿþXàkÓq°mØ`>¯­ï¬àc{´#M¹ÍYÄûJ1cM
+-ýOz/0kÙ§ÜT7~IÕÆÙîzàû®¹ÈÓ
+2	`«ò×\±Ö9(Ñ,
+*¤^
+ñ?e¹)P¢4Ýä!>ÒµÀc¤ûï
+W;&
+Aþ%Üb2×1ìØ9°ë»)fãÚÞjç%¬µ)è "aªÈ ~5ìó$¼ÜØä95
+-ñN±D_eªÎË½±F
+-ªX¿É³L	uñ
+-6ÂLÎÈ2}mpÑm.òôÎÐiØÖQPÙ®¶`Y/æûB4b¶_µd(©Á;êÊæVÅ²«µ~wÌ¨ÿÝ:Ll'?PQÒ"$$ë;
+ÆG8$k¯
+yÚ
++4¦Ø\2Ë>ß6T¶¹ùo!í£øâ·L>GÄ{ZZh*)ÁêµÆ'3áyÆQ^áîè'¬éñ¨_;ÏÇTÓ»GÖíä)rW²zDNÀX5#[#/®ý
+-9ÇÊJY¢çk:Kß¦5õF;±Y^/øÚÛZ¸H	¬àb`´
+ßÇâôÃçZó;6s}J
+-|¥\^Ï_WèØ
+ÑDh.¾Ï¬aÐýd%¶ôÖ>ÄQöÈ½ øò
+ÛgýyFÓ
+-²Âª¤<ãlýi
+QnAõk¾púëÖ
+?§[Ñ¬ôc¦egÄq;°kÇi15¼ñÆ!bïh¿Æi @Ã#\¿Hê\&9a½Ë^%ìÅvîH'Rºþ
+Îîs~G©ÜåbÜ"EÉÏÀ«k«
+
+-ß»û'>¡ JWõ-f<¹êí]ubz¬:
+úX5ç ¿ØÏ»ÛÄvm¶H[y¸¢Cs9!T>ÄÃÆê¶J/tñöKhïÆæýkÒ£æ~²æÑ
+-}àÚ³6J+Ìòt}qbLn u8``Æzà0ÕÜÀ4|×Xµ«BüÜz7¯?:øèÐOµ|saß¢Zú²HëmÛbÁâIð	c4f©c±iL5ýÐÙ¨qê%£ÿÇ/êÌKÅÙPiM
+ÝÇyº\4rm/
+-¶¨O%d¨PÒwK¹iù¨&Æj#Þï¶#ÌSòÖ6Ç¸Iá§{Zè6¿q\xO©hÜ7±GmT£
+-ñí©Ü{÷åôXúûßè\ÊÞÖÚ39´->!ÎX¦ÙÉ`
+¹%45wÏ³úGù9^/Õ¿¶Ã~íB
+-öÒK\±Á¿]·ÖX~í.ðYâ E¢¤¯Aë"3½ñ>íKÍøøD=¡ZýiñÒ@Ë»wÒæ¹¡«©¹/Ró!þB»J4eqñØ
+~yÝ;{K%Q0'µ`ÛÀaªµ}Pçª°z³7×÷
+-w
+-÷"
+VºvæÛÅOÛ[§ä|+ÑOéÆ!q9&Ñ¥ê5L¾6ôêU¡ÍC¢X¨rºvIÊbpiYa;§w¯_¬Æ2tGZ¹\Á0´SJÀÒaGFÏÐßÇÌôÕÑiähÖÐû¶Êî~]5n
+!
+uuã'MaÃx¼ ÊIa¥IØñ'kÆ_j*ÓÙL¿Z"iæ[Ê¹wÜÒÃj;Ôª*uúÀÖã¨
+XÞ-U_ûN5
+r!hL{yJÕÂµy¨µhÎ±ï±nhÑ?Ó, Púmã2m¹$2DwÈ
+ëVH4<'E,p"o-m$VÝÃL%ÕÍ
+«·
+§b^NScõä¹ÎîÚ/ )RÇÕ²WÕrhÖÁ
+-~Qù¼¦x»¬Á½y/ÁÅªdþfËFEæ*þí	;VÞØôUÕ@i2í/ûTVÄQÞT¸§Jû¢¼SïÙy6ï	¦EYBXyZ=fÅKÖ²b&$g¼Õ£jnK¼B© `3~ÀJH;£.*fó.½ÒÐQò¡ÓáØDß»UIsZ*£èÙÙ¯Ï1»PÏýÂ³®b!»V ,çä2X#kÃrg¿¿¦V÷¸JìöÅMÍ
+EuàÓÆÝ,2+íI§`¦T!ÿå@
+-×Pá8÷YþØùù¼ßlÆe~{f:"ë 8V{d~ï¤AW©îz
+u¾êZã"IÏ`¼El]ì*¤uUF:½Áé@
+-*xVsA³;sô
+-û
+HÁLÜþÖHn#<¡e½öBPÓ+çG²í¬·UoÖËpqlúÓ¼õà_ñP
+-îI	¼/ü rØÙ½ö§¤cÍ/IÇ@lílC-¹ªë¢¯eÚ@A?z¿íÕ÷(ð²H¸
+Q×«¯å
+-"üÃ¯æ¾ã
+ûÀC&zÂ&´£v?JòhmáÍ4´xÆ|
+&zõIh¹²ùê Rr»üæ4ÂÙ|L6ÛCüçÑ7¶Z¤ [d(ÂàÃ©âOI±Þ<jfn@bÙ¸û£0éù
+--%2¼ÛyÝ¯Þ
+-®0tÑÈ~SHt0Ö=
+Û[ðV]rzzFlû
+{Cë¾X²r
+diyb¬¦NeNåg
+V?üÜeVá»])ã@5Ã
+6³Mmq^øpÐãâWì7y´qQÒ«ÇîjÚÏÙ:¬uDÂÛãH5­
+IGì x£ïÀ÷(êáËfxÒ^&}´V¬Qe[²<mQò+³ÒÍy¡YN#n~¤pgWTÈVÂ¨_j9%õ![WÔLZ
+-Ñ¥«óås¡î£]qæË8f®§ÕQJéê6?z©ÊgÖ}õ|Ò,¬KÑÁì·ÿªõ´dOY£ÉZí3[ïS­"H±Ä0;Á
+(h;
+Júr®Âs0+ù2FgïR;åbbupìàLÉ ÔlóêNÔÑ­qÛÞÙÏ \D>×Û¡Ðî=Èohm<ôAUPZ^M_Eiçíâ(
+G§pÛRÁZr¹º)ÚåÛ¤vÕä£Öè\ýþ£ÆfkÎå²1¢þÑ4Fd°Ñ §}=!+ßò³Ý. ¬8·9Dª\ä®þ×.¬}cÄï«CV¾ÎÞ PÚ¨¦iXÜLØ´éüÓâà{ëD¤(².+dþà°ÚuÀá!ÑQ*Ìs4¸·¤K`ÜCvø¾	¹7´ùáeÈ£
+ûXrÒ¿µÊ¼LØMÎ
+{î'¯1Þÿ
+ÈWÛ]
+
+ µÉ3/AC?7ÁZCºÔSõ9¥BËÅ¯û:Ånîã¥ÕÛV«JØ'ZøÀÍô
+ÔöÃØ×ÇbïûH	Â,¿ï2ðÁèÙÑiJ¹
+:
+Ñö?!f*÷´ØzÑÉ
+Ò0OLø²~¶?²Ï^/M¹Ç;²ÕÙ$:ª¥@zfAò
+ç;Úu<M WkLûæÍÚé!Cí³ÂHK?iê+³C
+;a«[Ã
+Ë
+-q29?·
+Ï
+ØdºúNYr½ÂbùeDÙ0}×êÜÈk5Û[Ûrîùv©ÏÏ\ë¦(Ýg¹üxWv\1å±MËþóø8ÅªãUµRw²Û¨#Ô$
+¶UoìØ÷
+3Ê¦
+ÀÓÖäæ^rlÆ9^Å Fð&¡)úcKº¡Ì£E,jTèÐÓ÷FÙ«ËÎyW¯ÑË KÝ/ÜGþiÍTOX®
+ªI´À
+µìJî$r-ÀÐ®;Y!4
+¹Ë&~÷ÄËZÁ9mD~å	yRºv(ÉÃ¶´Äu^>	¸;AÝÏùÒAÞà´© *òýhºô.ÓÁ R5ÉuJËDáXÍ
+ÓËqÑé=Ð¿Ild!·ºSÆ
+-úÔ¤ù$ÒL.øÎÅzé¥7)
+(Uúº^wWb£»'+¸gïÓ%üÂÚfÞVHÉyW0}%Éµ½Gc±®¯o±ZÒÈI)hÆbN¼Zã/
+0d1ùB1Ý7$Üú;Öt±J;÷Ã
+-
+ýW½þiLk]G®~N)·H­+
+¯u[áýÝ×Bæ5¿â­Öaç°­Áõ®÷
+ï:¿®iÎÕ0R
+}øÆºxu]±D 1à+L®ª¡¹B¹R
+@)W :ÙK[à ,÷­
+/ì_ÊôHYõÌ	Ê¢èUvå¡E­àæ@ ü,­è¦&1;6
+-R©=mÈ|yVgÖÐ§
+\N«;×äl£&
+Ó¹xñU
+v{nêÆ²Ö3J²! Âj,âî·TÍ¤Is$3ÈÓ,ÖÀ}kÉÖ÷¯>Ýú¦	ÍùY±§<áw|
+aavÈ':¤lgÙsrn8÷¼¶ïÝ4ÀÔ
+
+ÝA]ð"pµfÕYbò~O+>Ï¹s#ã {î>XZãÏþ
+gàS61eígÔÒbÈ»x|8oócEÚ}:)v@7Þ
+ÊEýÛ¤Ä<Å.øû[¸½2£ÌQM_ëZEôæ'ÖöP-ÍOàN3ÑÖpÅ>`ÍÝ#¨&n~
+-ðÒp »ÃB ëY/ìvqÒûÔ^?ª²
+-×å+"cÌ_WæyÅ%÷êÂ­\F4\µTÐ7´v×ZJØù"Äá¹5Hyµ
+ÑÅ/q:Ánn}~gB·hÅ)
+¢\¼	´7| e{%q§ÑOüÑöý;/`C]²TL*wÕá#ÎqÊ©z!õñ× A,Þûlþ^£
+ûUërUOÏ~¼ #ö,;¶
+"ðv±fñ¥Â^Û
+uÜaÂEñÕÙ©¾-{ Öàú@ÃÞÄrçÏz$Ê(¯fÆm×Ôá?Àg°;#×½¯g¾õ$¡>EüÓîøx£8ëEGXqïwE·ñ.t&*±ZÎu}}lâ(mÛ©}±KÜ$dÏÖÉxWèöi¸È,Mf¹­Û\uûo=lA2wW¢H/yz¡-L¥®CaÕ
+q¬¥
+çÐ&ÐÐõÄèC9
+-6· 0^¾ d'XaªUÏ§=
+ÅÃþxÑ/óqñçuk¤ý¤õMÒ¡,ªã·ÊÅÍ
+
+=ÞeÁW«ÕÕD._$±©òTÙæiVÞÚ30G.m8Ê(/³ÇdGyÿr¢­ð'öyñ-íÁÈ#CM
+ãÌ¨©¡W2êÐ¦AæDöÎC·.¦ÅT!õ[}ððf7kf«
+`u" !åõ¿SüO<2øÙÐ"î=ûÏÐ´¨
+ ,_BÍ·³Xß;ÂwØºI¤Á
+í¤5×GE*RÈ¡¡
+¼µ5D@ØÁ&Ù¡ÄxÉ#¹v¾9ºïïíÑq±|õG)ùB`/h®yüöÀáíj?SÌ/jG_Å÷l²1×¨o.{÷¹SÇ/Éf­c¬©«oÒ³É÷wo²§Ð§æòêÀûI¨îÁ44¨=ÜÈ®ç¼Ì3TÆ¦+è§sä­¾<XÑÀg(
+¾
+§Ñöïcy¡³æ<¿
+
+»íZÌ@ÓÉFí¯"õaSc~¬³AÝå.Ó
+-êÅ\?\ø^ÜËy8Ò+Þo¤¦\¬'ÉÐ°ÿYòfv{ßyõ¡
+© P®7O´I}R!i¿éB¹É·Ì@aÔ¾½°ÈÔð³ËxyS²Ù<¾m_n5èµéGÑ«$óg[ü1ÛGs+mWá$
+-J%$UæîW,|é¯²õFÃTÂ· Î\:ÌËûÄ§q¿=£°`Éë³Â¶à÷][_÷mÙQÞ>PWùµwZ©åt»Õ
+-ä½ ]wvá9kèb}Q6]pÙÃ7m@{ß_eÄKæ0-m
+[2cZôIç/\<Æ2ÃàT>d#c®´mH<vÐ
+§Ù 
+-?%µÁ7V¼sòn'ïÎ[¤Â8Q	~û¤g¿¤ÙÉ»oñÖ nÃ{ÛYÊÑpÃåúLÄhuy±.ª^*%Üä%P.nj:óÏË5t¸ÆàcÃîêok¬)ÉÈ×Õ§íÇÀTW!Çqþé-sÌôW½@ªouÆ6a3Y¼S\Û´ê·õQC³øAðª©	\4xMxïÌwzdXñwG©ªÎxà¦ÄW
+:Úäc7P¶6PÖ1\Õ½¾MóÆÒJ¥Ç lüú²´O8øeZÛáþÒ°	EOÒò"ÁåÁS)
+¯vó©Û>ZQPÑî¡HÒå»w$[¨d
+ËÛ©âxg1Ì;6ðI¨þTÃ
+: áîÏ
+-U
+¹ÇW¨Ù(È½sT	Ê},Þ®dêiègÔR{
+
+¯äÈ0õ=ù:ôÕ7
+³Bù)v¡:ZÈÄ'}·ßã/ªpTÚCr$µ¯¼§q5x
+Ðë×Na#ìÖj6ûV&nGñåû¿iZùeùEÁ0°í¹Ôv¶©nù$ÒU8E:b*Q7
+pLüõÁtõ-
+ø^®ñ1§Qïe¯Q¢o´¸øXç[ñÆÛVÞÇWHïyK¢ìö)¨©HbÑãQý¬O_&Éùß·Í¼&¤e³
+
+-óÀF¼
+Jl]¿rÞ0eûj÷tØºóæêDÝÓ-tGvKìäS¡°´~H~úE'ZÖÌíàp¬âOÊ7zGzS"ØM^RF-ó%
+ jiøÊÓ¡¹â[¯Ê-
+Û©my9)M÷~¦º¨$ãË\§ u.Ál%|ÑË±f%SvõâàníÑÉ"4¯ÛÜôðd 
+
+òÈJ3ÇâÌº¯g#:±sÓÝV<Bk'9Puâ:ÉÈ;/ØnÉÚnYÌ`ÍèÕõ1aò&S:udªÖ
+få`¬ôè0gÆí$%YxWºðàÁ¬?~~ 
+-§
+eýÒáò\x8
+¿)ü(ÜFÑ)ÇU:à'ùU¼DîÙ?Íø[4e£ãõªA
+¼
+ÕÃëTÜÖékyÃÛÇ1yUnb|ýcEEÄo$¢×7?®i}88ð
+-V¾x/µàD=Ä²^,âÚcê¯ðõGºÁJ·îXE¸T.áQé­áÓ½{§?l¾O.4(¬
+Ðßü
+¤ÜVuÓ+IÎ0M¼¾3~´ua¤ k«X_¡ixL²éz(l1]>¡å;%½ì(ÆÖ·]!ë&£Yùkî­cvÂ£~¤.°k%[¼²ZR½< êýjå%x¿JyïYLö©6$>!ÒCâéûJÓk§ÖSøR	§¯¥Kj)óÚÂÓx
+haHe*-1áËkËÚO`åÌ45¾jë¢!MÓ±Ðy×/ª=UÓÐèQFN³f^ØTÿBl}CÄ<ò~4Ïda¼Òî1¥h%¼Nø
+"Î¢)òt±¶ª«|ÇAàû$üÀp/PjbiÉ(Ùt²}1rèw0õÝâíÏè<K/"n`¬H£[¶QÁtµ%ÚLä¡£é©iôÆÌÑ¬lÈ»®°Û2 »ØJfUGÝ¾af!r
+_æFj	I?+ÈddÈR¯þY®g90uÈ¤ýhôòG?má[ý8
+XAVxqJäáÜ}ªøx]ßÙ¡+·87]MW8Ä$ÞsfäàÇlª½aÕB´õt14÷lBª·N¬Âc@ßá?â®v½¡ ©i@Ó­SiAÝÌÖõYÛºpç{à­·H
+cë¯kXä
+?}Ub<,Q¥ñ]|V,
+ÞIÓsÃ·»}¼CîÁÿþñ³¾ô·
+j ã¬ ´=lÇÞ½¹ÿÝ26U'¸±¼Ä£ñTY±gÅ³ä5¶gi¤a½K
+÷
+¹î4?­T	Í£hÓÎn¿q¼ò»Ï
+Æ*ÖÛ¿ø·
+²Ó&ÊÔé f}vä/@6\*op~­|õë
+¢öÀÛ
+-},{"Ùä9wÝj~ÁS[´Òå &é´ký@/ÏÂÄPOÖ£ÍíÊË³ÇþyB­Ååö]WOòñ>¡/¤O¬¸ûêÙ/Ü*®{ÓÊæt,Å
+¥3~0S%ük®®
+-endstream
+-endobj
+-771 0 obj <<
+-/Type /FontDescriptor
+-/FontName /VCDOVK+CMR12
+-/Flags 4
+-/FontBBox [-34 -251 988 750]
+-/Ascent 694
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle 0
+-/StemV 65
+-/XHeight 431
+-/CharSet (/A/C/D/P/W/a/c/e/f/ff/g/h/i/k/l/m/n/o/plus/r/s/slash/t/u)
+-/FontFile 770 0 R
+->> endobj
+-772 0 obj <<
+-/Length1 1413
+-/Length2 6286
+-/Length3 0
+-/Length 7242      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚwTîÛ6"! ÂèîînÆ0
+-Æîii	é)I	FB@wú«ÿïÿ}ç¼ïÙ9Ûs÷}=÷u?çÕÈTPÙá Õ@ÀQ ! 
+@UßD 
+-"df0ô-§éCÀeþÃ®QX
+uÓGÀ:Þn ( $!"@ ô_¤
+@
+-ìsè
+tp¨§*Â9» °Uþ:x ¼ ´´¤Àïp²;	á }0Êê­»L
+ùW
+-
+9ÊCFXØ××Wìî%@:+ð
+- |a(	Ô
+ô:~ÁÝ¡¿	qÌ\`^¨MN(_0
+-À*Ü`(Ü
+à
+-w"ØÚ Sm=¡þ³Þ?¯ ýîÏè_`ðßÁ`áîc`pgÌ
+-0ÔÐB¡Q 0Üñ#ØÍ
+ûan`¬ÃïÆÁ 
+-ec ïOt^$Ìå%äsû
+PøWì%«Ã
+UîîP8ÊìWj0$½uðï±ºÂ¾pÿ?ÎN0¸£Ó/Þ
+Âæp§7T[íO¬ì3RÒ ¨' ¸ÿJnñþ6~©±ýú{ < NXÐ@ûCæïöPHoh ÿþ-@ Gp:ÃàdÿdÇª¡NÈØÉ#ah5K< øëó÷ÉË-GÜ
+-óûïá
+-ß32563åÿ
+-øo
+-
+-ðEÄ HZ =þ;ËßøÿÂþ[kýÙðÚp'@úØ»û
+Ïàùs]xÿ®`Àò
+-àùö6@q ûú?ÿwÈÿó¿²ü/´ÿï~4¼ÝÜ~[y~ÿ+Ø
+æùÓe±7
+-»úì^ÀÿÛÕúÇëC
+aÞîÿmÕF±¡
+wvûûa^04ÔÑ¸üA ¿fMïC^°_Ï
+@þ
+-»kWìSâ
+Ôo»Jÿ.© 
+í¸ D1dØÁc%q?»Pôo^
+à6
+pB É~ÍSL }¬~)ËØù£\ÐÿÐ ±_Äoù_¥!ÞH$v
+SÛ×_òïÝBÑPÙü
+"ñ 1¢ã¤^ù¯àê¨üçªe¯ ÿ<²Óû8·.7lù]9}ðåõÕyÞ³\øo·5G·?2~ñ3àÜ.ÅdbõÙÜ8}ßXÉ¶ò³7wHo
+)­\xXºâ·ávëpzzKQÓø¾ÖD?{S¹ð6jfÕx­NBü¼rR0Ñ<Á&´ü
+gCÞ4Jð	ß}4Õ»ãïS7
+-Æ®XtRøÉwEKý­VDN§ý«ÍD¼z9­îàßx;Áå¯²¡ssÖÿié2òmæ4}çÈG÷4ÛßªÉ	róÛ}.Î1
+Fa|Zíøåv­T÷rÖT"±¼ý:Ëhíom^©°+C7ÉFê©2Ö5ÚÛ»ô÷·×&F·Ô(EËQ²Ä	r«²n2¯HOJ
+-MÓ¯4å3T|%ÝQ8¶<ÿq%ó¨þFÁIËÄmÁËhÂD'¾ 3×=ÔL«z¹§V½°Da8²lCÀsek!®-Ê3¹>´ÚÚJÍVr¨½ÍÐUPÓnÑæé0M=F3÷X/ÿè"-'*ÙIêÌùñ1Q Ìæ«ëkgªÂW
+
+Mo~¾Lq»6ñèu¢êþ¢}OH·èÈ"ÕÊ
+zµQB>ªiÕþ
+-qæÎìU¯wzáæ®
+îZU×4<Ì¬86ök&²?¬µ¼E»½¯5öEw¥:knàÉìpÀ÷9tÕ×ö0çëKábWï*<0Ü_E³Â¯
+À
+Î§úËî
+KÅ}
+
+q {¯å9ÈjTJñiÜÃ
+¥U3åLÅÈ_F9ÃYC­2¢Ç³òë+
+-aOc¢¾¯Õ<MÖZKÚg$®ÙYÉ
+Ð8ç
+Xu_lÜhªÌ-Oy¦Ç=à¶V-ÞôuÐ­	I;¢D¸Ï(èK5ÉÖ#+ qªwiñï43'G[P»ÒÑ:Ï	
+-GTm(M²Ì¸
+8à¨
+-wù
+Õë1ÛTÖâÁ¸g@cÆÙ÷¶«·LUîíÇßæÀï±úF3í±uC1'!¯RË0ää
+)$ÐÐêp¾_uÚìò ¨>Ó
+©3û=´äaÓ7xÒ,ñ>oV]v¦ûj\µ±¸|ô#^¾ØÍíÒq"kð¢¾þ^H*t¬^¼¶£Öävîé¹]â{Ï*Í+Ø2^9}Ç³\X4~¨i±¶R
+-/¹
+4\ oK¸il@]¼û(o
+-/H|-ªäáûÈÚÜß;ÀÖ"¼ò¸
+sÿ{yp¡!;´v·QaMù½2c[&ûç)}ú¬ãDè{?ÞõÝÙ_{f"
+ªÉcÈ}ÄoëR¿Ecõv0òâáå[ùhÃØ<7·E*¾v 
+÷Iù>¸ßGÝøzX+¬Ã>4
+È¸Çrõ!8Þ3¤'Y}mR·A2F¤Ë)¯F5Ô¤sy+
+ßåÊ°Ý^Uç8r¥òÁÃ}¸ÕüF
+KkáTcA/#o©M#±i¡º|yÏÝØ+xË°E
+-çÔâdÝLæµXxÂ+µ1Þ
+¯R·Âåóîpz\%«qz"]'ß"îòp¥tõ7Câèåî¿k7
+ÕÐÆ/)j1QÍ^×=Äs:~Ðq¼ùÁoøEKÑÄ8ó@îöÎ¹Ëç/þ¾Gæ¹u,ËT6¯/xn÷Ê«Y;ò*/q B3xÙÎ§ÆêÏg*Ëp<e gºÖP¹T­½¾p».¸×j ²÷n¶#^>09}L¢ç>Þ[ßn¨÷;'B­:
+-V´ÐQ1ëééS¹F
+LTzÐwÎüèÈqzZ»¯îïÔ¤ú[cõÏ\â}-½íz?OK¼´¦oNo&K²è·½}¯ªUD³¬¦ýÍo°®IZ[p T~wa°¿(Ö×.âªhº1!Þ
+)
+-ëvD¯)d\Îj2Ì;£¦«ïa¾Ëjý9l~® ÉþtÐÀé[@àG³dR1¶xz¢ ^j"oº¯>×Õ9Ì«²»lâ[Ên'ä3Mêk®I¼à)-_O®1rU|3y¹l§#ü¾¸´?ê)¯ªÉØ¿Ñªä8ßÛ@Øt8¨
+2
+-S
+Xu ÙûÕ4<À4%g,[Ù\/êGîU\+
+úÒïÕÍöÜaë¦­	&;;
+9 ¼î¢c:Í»Uí'¡¿&ÿ)æ»ÍÐp#ã²{ÿ¤þ"üé
+×§ëåfW^¤~²´ÿÞxúîé ¨Q{?9W`fÑ¥âÕ·p×¾óÛªNê¹¡âg¶qãñ
+¸KÀí·$7Æ
+yº¸.×{êKU¤«^¡C¤ÉN¶Hr2|ü! ]@K=fH¢»3õU!ëÏmZ-Z
+É¤È£ÛMixlüj}­H=9[be~5:Ï¥×WºwéE~<cv©zùòËV·8S_zCónj?éÍU>RÚ¥\)í|Ý1ÍQî!Ëy^yÔTr` YÆÖºÅ4Òy·Õ&y6!xSÒ{EY^ÐYÆÈ<ß¯&ÑR¬£õ¯Ô6TÚµ b#Þ}­»Î#Äì*Ï8GéS¤N£JÒa
+-ÒÚÒvÎK(4ÓÒR$Ò$/¯2åLØf¹à5"¹fPÞþµ'Ê}¡¢r?î	ä§7ª9\øÖÆ
+D¯,v?Ìr6XÕæËßaª¾Ô
+ì/r=S=ÿº'U¦¤`
+Èì©QdM°EsXáwÈíQÈeÚÃgÞÄÁül.ù	NRØÞdB[~:ßñ«O
+Ë
+-óe^Åöã;Nñæò7pëìe®oæ[Íwa5ûR
+^ÔA¼G»û>7´3m-´.×FÙîî²i'Õ­ùPx¥zÞóÈ%3²½¸Â@¾Å
+-Á
+@6Utº³
+ÛQb?ªà
+Ê¶½¥û6^äe®S~
+Ùz~UtOLpgj[¯iuýÚ³º×ûx0ò½Å]
+-Î>4þ-uB»k5¹|öãz¯ÌwÉúÓt»k4ïxWºë<yÉ)Î¸X:¶Wæ¨ìC#Çø`¥¶+¬PÐ ÿ«Ì2<Ê½­êK÷¢Ê¬
+(R
+EYCU[
+2øõìMy#Áí
+ßy´¶
+àúÌ+¶
+úãÛyt	
+-§¸©ÔÛAè"{´fÊÕtº6Ëc_Äwz ü¹C»Ñßw_
+efûyõ:qÏ¦`¥Ó_ð¿èÌ¾Jjñ£ì+G«¢à¦f¼[K·ÐÜ
++ûÎÊ¸)+
+ø>=ãx4äéªÈFZ;ßòñÍò®ÿ¸ê6^ÜåKJ=¼bý
+÷d}ö
+2²ÈÍ{:r«&8Æ
+wjBö¢nõI´e°¬f'<Ô|H«ÙbÿÚÉÕó8P	ÕJhÅÇòRþ
+hiÄ;írçÛæùâ$áÐ¾
+-åÎ:Ü/
+7ÎË¿ñ®ÓËÀIú û.V2nÝua×ä4r$ßóK
+ÖuÛm÷Z=Ë}°q½[B
+Åí(|UKÀãIßo©J3Lµ×Ãð1yÃ
+-*¡ÞL´íH
+óÍü¤÷¬sèÑì;[ÑÖVA3aiå_"»²=O
+Z$¤CU~h<`ÐLïÞìµ º7ó!õç6ê6ÅKüïúÁ>zKö§¢ÕÀõm¤>G
+-ôBÞÝçñø·3Ã­.¶§d4á2<
+ªÛíK{ú°¥½ã<ë¢#²Ç±¨ôÉ:ùDsý¸µ
+ÝH
+~"¥Ü;KQoRNÍÒöíeÂ;t+£¼w`:»{sºÄ)´2Å
+ô}Bc«ü´¤·cùüoÅM· &Z¤Ö|÷0íÀUX
+-ì@xqËH²b3ÓëáÃìZnöþí¬	?çIÝsÆ¬±
+-ïN4¨ ÎK+8yF=ñ"¦4Íõ//2w
+¸P}2
+-
+êC÷ttöt¯JR­
+Un^©h	²âa:&=¦ßÆMVã~.Y©süJAí'¼Ur¶,Z²ò.¥¯ç®Ñã7
+Üu%5Ê_ÌN[n
+-W¢Ùß
+9dÙÞ¥n_Kíúq'KºVÚL®ó]ÁÐcÝ-ü'ÒôÖÚþYFg
+-áLáâ&Þ.ÝJúïSÀ>yÔ
+²ûþ¢hÀvB]PËÂ]êÊb¨)zG
+-7LùIÕ-ÄNöÆGÿ
+=-¹$DÝ¾pK£ýBÚZ¿Çx	¹²3ü&1¨H»åGÈm&½ËÚUÒß|=4çQõéÃ÷UÔ%}º
+-ÂQ+(a@£¾M
+·Å©¥Z ©pª¦#DZÂxk'øWZ²©
+-('ÑoÅ[~TP&Khk9×#Ôg¸£çàk·^Û¸Õ¼ÕKuàm;SVêºnYä\.©zRJ°ó/l2H#	«w_ÀÑßàqÆ»ÆD·þôïê'&·ê
+e1¥Hhæ=w<ö·tÔKv(-ðøñc³àGÄãlR.A²Ýëí©ÖM|~©y³L^Ú\d±|íc8ý³6Õú2æÃäi-òO½$$÷é{
+-ÓíA~
+-óÎÁá
+'Íý£í4äm.²ó¤ãÚ¸EAÄ¡£%a2ÌµóÎõªSV
+Bøþ2äÎ¾âÒÂä»Ñ¸Û0{zßY=m¸+ÓIðêÍSÓJåúkìR\3;eå§
+PøÙkéÇKG§&Å[ê5#Ì¦ß
+-FXÝ ûQùß§ÁÔÉpË].ÅÈÝ1vSº?Í4d¡÷¢üÀl§(Êõs|ÝDnäËbéG+0	×ä÷VúÐ9ùRÕw
+ß÷ê?RHÓK6³W6~
+-êÓ?>Îý`ÖÐ£Ø¤âG÷mÖdb¤­°Ø¶Ñ¯ªbÖöW|¥ÙöþÑQD6%i¤¦`ÿÀDZ¿;dÕ¯fõ0dW*9gW¿ã;q©VM>1úÖË+
+nâÔR!)¯ú3Ùáe;"C³é|â»ÛÒöÌ×Î9,çK ÷öÂ&äÔ9ß21&y8ª.ºù
+-VÌ¼¶ýØFÕø|¦Ð¯'Z7 ­MgáJæKÜ st¤ßN\è>1+6|^yÏ¢½èôS{kNþyñ¾mÙ	_ñìéÏÔ1¨Sqv¤ûûOÜê³PJÇhNqyúâ$¿\X^þ`âCþO
+-ñìëa
+ú2ÃP_òM9"
+-8¤ÄºªÜæwËbÜäÖÝkíì[süf®=ÒµY
+2TË6§1>ÉB×ñ0!Êâtik}/¿á8Ù*>à½êC?®Ä,°</wÉÏÙÕHì æ\÷V·ß­ý3¥²öýAÂ³X7ÃÕDy?çp$,/6Þ ìØbl£a!¿dLy@
+Â
+ï¥Ò ÷ØDV×Ëð¨ö(;ÙvâìêÚ8Ïc
+»Ö<¯
+Bó2¼»aôÌÖ¤L¨7BûeD=ïæÝû_öÇx×­°K*³W½âm0³µBokQ 
+»¯ÁÂ§>¡j¢®æéGÖ=³üLÛU3¯ñI
+É¿q.GsÒhq¿iP%¢¾ÑtÙ
+Bp-á¼¸w:@ ØG¾m/p3*E5¦27c/qÒ¯uíè!þ#äR1'­?B
+Zk74=PifuT&&Ø®±µätî¬~Ë]*h®p$¸RÐém»oð x²×Ú`Z)½Ïêù÷;k²ì..t%×ÙEdëTÃ~6PøªÞxXÂ6ÅÒgÝQ«Ò`q~kcÁ'	@S/gé~ÍOOÃ
+û¤KKhój³r°¦¼~zú\ªëÊcT1Ùêm¢77}bOI%ÇrJËêÏ§Y6Þ
+íà
+_ãQ
+-{æ­\ÿÒqÜmÃ
+âmA~þ`Fþ¡zÑÁt£ÈªçðaSpu=¿#Òx·}¾VX¶7¥0ù}Êi êï?¡JÁW\7Ý{ Úx·
+-ÛqÅ?îrQ±Ê!õí
+Õ¸©NÌ?^§
+-a$¤5 b/ëONz&F¦à#À¯¿t ÚZïñðµû\´SÜ
+\¤§ï%uTD'·:vYb
+ÊD­ÁxRÝâ>Ë»zÖëª÷
+z@T_rç¸edyglÅXö¶%nz£!ëzóÊ
+-àðùû¬Gz8±©l
+Þôù,?
+-æÉ©FXw@R¸
+hÎS_Ñ±ä§a>ðªÓñõüTè®æ^^¡`v¡°É\´Ø8öAÝI2ò_¾ê¥3ìZ¸ØË³kNLÛ
+RÛá'-¿Â]r¡[bme¦
+-£û¸
+-ÚÚ÷Õb©åè Qã	m¹(¯ªÙ­bÖETç¹rä
+-Ü(ïæ5y`·Ô ç"¢eªøÁ>ùóÙ5¾X"e`±ÒJqðæ û!;äà¸ðÆÁØcÀ*!xu-5ÁãGP¼{Î_Êó
+]FuègÓ¼éª¯ã©O@¦NW^èµ
+-hô#sCêË½s 1*Ã8ÆÀæüÚð±v-pC´\v£ºQ%Ëì2×ËÚª
+µE:¡äïCáF&µ~«OdmWV°ë£[
+-?½qÉùYh-ÇlÖm
+ D¼O4ã
+e
+%TÞêû²äÓ\	@[|µa¶-xÛUªø"Oÿö
+-8æú1ó÷ê[CïÈZéXÆ÷
+_67Ï«¾]nHMléq'>Xø¾P¼{ÙGðX¡ÄÃô"øºû£^o
+N'û1J6;<<Õ× +|
+#¬*þd
+é ø
+ç¡äÏQ¥'üâñÓÌcÛ·æjkÈT"%Ú¾EÜ{uàüú~x )ðA%õæýO2øoth{²J¯ÊcqËåÈéò@u±ÂA?å%JËÈ·_8íg´æ=¬ÚxÈú _	õø¯³sW
+?óÖ§ÞH2kXùö*ý
+-uó¡¶ÿ+G=eÔ¾`Ò@üÛÐ(a
+-E
+-åV[ï¼ÁÞÐªÏÅGÉÖ¢rcbú*f%t
+à¤A§u
+-0rùÜ0FÌf¡o£.JÑ×úösF5ùÃ§x8y
+û
+-©ÃÜo
+káèÌdvØõBW;å¥ÇÍÓÏÂë½Øe;Þû|IÁÅ)¹
+×sóiNjc¹m²þ§ÎÞ1ö@'jQêî´×n¶ÒZéÂô¶)ëËkLS-.N.»rªó·5mEð*ÁeÔQÄøª@ïn&c
+µ
+-_e!Ae=ñè§
+7>´Ú¬«$v²
+-Ï¸æò,!ÙÁ
+j÷GÎ¼ºñ$Dç
+"3.êÎÜ¯
+æB¥[Ç÷²îl<©ñYIrÈMzN'-rÎ;'`Îg}ÑU6p¹«wÀvÝu)#²>óuy^0»?®òØT¿©fzK^êÝ´Cx¥ÿLI[Â!KÁ6×Û®E9Üº^
+ø^'1cNÙ-ªúåO"
+Å®;
+%	vÂuH¼i]ß9
+»EÝyq±)nÐ Û¡»701
+-
+-µ¿)ÜP<ï
+-¯	çX:}¯XNh|ç2*¼´¦3Ô
+Þ²p¡ïiZV;ÇLpuVT³ú®õsõ2ÅÚtþØÝ9è	P^vú°}ê_R~9;CßÒÝ|ªÕlö¬½{¸VécäO!¡Êëßò72>¶
+jyê .»¾¾!$µIxi<	ø´Öå±³Æ¸VÓ}ßhcü¶Ë
+ó»ü¨µ\Vèdæ>þxWÉÛ§×$Ì(P,
+~&ÙP}$ïý`CfXmqDÏ2}HIªÏgQÁ¢
+?oÐÏ.y6Û¼êVºîÖ	ê(©>$§QÏ¯`Ýë/w·§
+¶Â!!"þ)
+-endstream
+-endobj
+-773 0 obj <<
+-/Type /FontDescriptor
+-/FontName /YPSQTS+CMR6
+-/Flags 4
+-/FontBBox [-20 -250 1193 750]
+-/Ascent 694
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle 0
+-/StemV 83
+-/XHeight 431
+-/CharSet (/one/three/two)
+-/FontFile 772 0 R
+->> endobj
+-774 0 obj <<
+-/Length1 1544
+-/Length2 7256
+-/Length3 0
+-/Length 8283      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚvTìÛ>- tH3:FéîF¥kÀ`lÄèîi¤SiA$Di©oúÖïýýÿç|ßÙ9Ûó\w=×]g,
+:úÜ²¶pk°
+àñðä5õD||<||ü¸,,üËbvsÀaâÿ!w[!©¦	Ô<    $,çãðóñý¥w(XyBl< 58
+ìË"wñqØ; Qþ:Øm8  11®ßæ Yg°ÄÆ
+-Ð´B8m¬  }¸
+-ðù
+öG8/¯³;ÜÍ^
+àA8 ôÀî`7O°-à]3ø71
+\ÄýXnð²r b¹#
+-<`¶`7 26@_U íý¡¬ñàÏÔ @< ¿ÝýiýËöÛØÊÆîìbóÀìv( ­¤ÁðFp¬`¶¿­ îp¤½§jeTøýp+¬.À
+-ÉïOvî6n;;ú!ï/7È$+ÂlåáÎÎ`Â
+÷×û n`dÖ}xÕ	÷ùýq¶Àlí~Q°õpá5A\=Àª
+-j !Ü0{0 ÄÇÇ'"]`oÞ_Î
+-|\À¿
+¿aäûü\à. ;$p ÄüÁõs·òn
+à ¿ÿüû
+l!65Ø
+ÃýÇ;ÛýqGVÞ
+-â
+-0áC6
+À÷ëó÷É
+Ù[¶pÔçõßÅåÕ6TÔRÑþ&ü·HNî
+-ðãpó
+ñ@|"| ä!àß^þæÿ÷ß¨äÏ·ñýãQfýA»¿hxþÙì
+àß´àÈ>Øÿi{S>!>äèÿÜü¿Mþ=ÿËËÿÒöÿý
+%(ô·ýøÿZ9C >Ê]ì@N&
+9°ÿV}
+þc5Á¶çÿª"¬!
+³þD»Äl«AØ8üÑ@Õ é
+
+-uàî_kÀ
+-âãû/rÖl«Ä
+Y©ß"0rþ
+Rf·ý5süBÂ +77+\dá7!9¶`ïß}
+-àåÁH ^ Àîû«Â  /ØÕu$ü ðÚA­ý7Àà
+nb ^äûçÎàuA®løýþQÿ¿a¤{¨û?îz7ðDúCxÁÿ1ðúÝþ þÅÞÆÃ
+- ñ»;©ùëþ{ýÁÞ`Ü
+9¸Dc}XÇE,µ÷Ö¸ä
+ËÖã
+Ü~
+n
+?ñï¥sÔæ<[u;Mî%üôYýTfþÆïkkã½È¶TÝö+ÿkd½©­vÜäÅ_ehqh¸
+-d¶ýo\ýBÐ[Qßª±¸zâë\xõ+{7
+T.FÌmén×
+-«ß¿®æ73
+-)ûÀòÒ:w
+ÁMÍI|äMðáôl8â^-°/Pâg¼Æp9ë»\mÀïÞMÉLiLA~J<:Åê'·ó\íá¼_yÉªÛhÆ,yçØºsºÃî»¥¥wá¶ûÃeBT56nµM%Å¹!K0÷èÚª·êVkw.íÈ6T¤
+ß¢ÿØ~ªáE§»°Ävz¯NFpnFcKM Ø»«[ÕS-F ÿ)JÞþû*3¬¸W+è3É¾äªl¸A%TpÄGÙ½uxu¯Òî42©¼×¿Pes·^¡n/
+Ê Æò×yîN®e£MÖòªFv¬ìôôµ\Ñàç>FäÒ	sy"o´çìz}Ò¹ºÝ9*«±Qz9JRÉéd
+eÑoe³>^ÄVÆ"7îKïNµ~g»gÙg®i9j;IPYÏÒÜ
+ûWÖC8 âtwµOp1ñh5=/ÐËYµºæ
+rMvòZNF3fï£«a&ió
+.&A° qÜfªÊÏl6;íD6?þà£J^,
+-0 àß~Ä«è9Æaõ&#¥%_m uÀ
+-#[ð³·j¢YÕ~7ëÅ!©Ýz¢Aac¡³ñzÏ3YìµÒH¶ïO2ÂgDa`ÿ(í
+ÞëÃÐZÊÈ®W{{F8U!êx)æ­-ý¢"ÛqhÖtÇE|~æ¼_.1úåy2M
+-AM¶-ÈÌXô
+³N¨Ý`Ý6ÚÑÙ:¥Ã;öüõP}üèÒéønþ·B¼
+#æq~MeLÈh jÚO+¥Æf
+ÐÄwÑ3ï­R¾ ®¶RÜÛ1ÎCA£©XL8(%(æ6
+WèrFoÜ¯cÃÞ¿¤ê*jÝ('1" ê-P)ß¸äù(<¤Qðôös	&¶Ñ Ç(<yuìôv-OSõEã´(íjjÙ³ë£Æl "¥?p`ì·IKtÈh
+Èi­V+w=9MTìÁñÐaðt^-èwôê?YRÀ4qúzhÿÎäÓÓwLòÚÐR:ùèýð
+LKÞÈwó³h¦`ïC¾Nç¶ÎSKÇa§Ffñ,½JÒ
+ðâÃ6ÂöÙãùö;6fyÌ²¾~±A_¡s*Æ»
+ékïJnÛÂ­uìò¥TYÚÏ`·Ï\W%diÃD©èÙ3=Pèx>B7IÈÌ®
+
+9ö_êÁVÎI-Û=ÈùJºæ$¶X?Jz
+ö)¤"º)ç
+rq[
+xµ=NºA
+Èß[à
+|õ]/j¥i)¹
+© 2ô¹1pùÙ¿jIþnqÎ/XþÅJxÚ½<%ò
+9Öíl Ó(d>y¥ÁtMöØÅ9ÉK(­Ü`ÄUõò(v±59
+9:õ`2@õö7=Ç
+-ÆYxwìXÐ1Sa|»ÂJU1¾É;W¯½r3õ:}ÙäÁrhQ¥g~¿
+-]²h%y4ýCîP|]ç
+îù¥æ·
+-zR
+1ºèhãwýZ#åÝ¯)Ö}¶7S¦Â_°j÷Ä)°'P¤Ã»NíÉH
+÷,îÐZñ1OÖ¹h£i`wáÊf_LUcM÷k¥j&¤Ã«èó½5Úºb£§=éÌBÛ-¦¦¿à¡Mò
+WÊÌ4ÓeQÇ¾ã
+_ æ©2S~zÊ¥C\Ò5 º(ÅµðãkÁu[Å«oK}c½ãß9§ß{r¦dv&¯¨í­ñ×QÉ¹4ÌòÉp'úKÙÉÈXÑ¦Ðw´±»Ïý>{ÜëÃ
+-·)âÜ(K/Zo­¾CUßúÉ÷OqÒ8~µÛ{Óetm}ò²XÍàjÉ¶ÞBa×¨£íÅ&¸þÔ-ÆØó1Ø¨t:C×mùàñr1Ö¥çÝ´$p÷pp!ªÎDÈM#2ÀÛàÈÓÙQ~n«ÊZ³XÜ>oý §/ò
+§ßHû+)d|ûKêb%]
+-ÿó9·à7×È÷ûváJgÞâÇwVu¾wqoyÂ/ìÊ¦IÀvHrór qqônë¸ÍÝ{øª~QFvÎ±Ñ
+£ù£È@â{O#¬ÌLvBóCõ3îB'é¸ïÃß²fRxÖ%lý8f×]°å
+
+b«w=
+qîsÖWí ­ÿtN-xDËâþì57nÉÆ°èì1 
+«àc&Ù&eÓ¶yèug¼B¸yFiÿ=ú¸¬%¼oæovÐMïdÊÛ"=µ }a)ê#7²Ô¾ ÁµU>³;¼¢±'áò¥+#èIözpø)0Û,Üï<ªÍ²I^Å¹q»_ìÜëùyZù ®ä!vçåLê®¢
+wï»3#6*ªÜ}vk7×§®
+¨fãU*´öïúQ(]D
+-R
+kÄ_k-èÊÙ¢v
+DÌÎ>Mÿ
+òM×Ýl²×â<H¿whä\Ô*Õèr
+
+-¾èÉhÈÀP½_æDë ¤+xü²c;&ÝUí%ó!})Qð®µwKúfd¬ïAûJ®£C{KÃO²8!ÐÈúvZi$~®Æ48µlè2ïÖl1.`PÚ¿Fõ~
+BÔ»,9AÄÁÓDbYwO
+Àº ="2iDÆ4ý]¼%²6m$(²=¦´Z3~Xôw/¯1N«7»5j{$xîwå¸¡ª¯_Ñ¸>ÛÔÏDçdÓû),Þ5PBµÑ6â¦8¤
+^ ¼ÉRJü¾@+Áiß
+¶ÒSC¨
+ã*&Ì+pÉ2ï&_|¸Ü; @¦or ·/
+?[5Xì8}A­ÒDt3/%3yU$op[mÃ
+¡)=
+[ÞN*úi¼1OµoPË­"s}ÙsOí$ïeÇO=°²®¤²¯aõÕú½F m+:3ë{èéÖàýÇÖôuf
+ºñDóv°{#.![LqÓ¤Oqg¢â{\~Qõõ7èj¡ü&_)´ù)
+|j§ë9£fS
+^É;ÜºbL
+3Ä§`ÀSLåB®ù	®t²- ¨û­@Çò3%Õ;µDpË³,Ï®ô¯[,3<VÛ>¨êÑ5>r0N}'OF¡×K
+-¾¸se¨Ù©ÏWÇQÂtýñXçÊÛºgÛô(lXg:Ô
+-
+-
+:ã
+|ì6I
+rð7£Í!Ú\
+ÅSko¥:Áå«Áýoÿc²ÇÆ
+¶þÖo·CW¶^VÑªlªªò<Îì"Þe
+þq2<hÀ(÷®y+¸CP={Äô³AñSú{îÞ6´¬=ïÓj^ÃÕÌzp·ËV÷Þ¢;ËÃYÞÔÓeö¢R¨©6ÓbRèÇCVkäao¢à«)ÌõNGVá¶åÓÕäCíïeïÖaEý®ëÕÝ¯G¿LpU;×£}V,ÛkJ¹.Q Í¥èOÔø}|U/m43¢UÄå¢sfº
+Ï¿og'¡zÛ¹Ú.]È¹$737£à3Yÿ@c_S
+-Wqk@Ð¦t®Ç* ?
+-sKòç:Ò¦1o2kõCþëC´+ó­CóÇç²F"¯¼uÁdLj£v¼B¨züe
+³WÞá7~É )|ÈRe%³õoK"µyÄpV9{®>`Ñè4kû#é£yÊ°P¼êà¶,@µë/&a3yÊô|â`VàÛ{s$$ÅÔîIu¹ýúAF9"À+üÇ!Ø¢ËNë*¾3
+½¥Èà
+-1þJü.§q7ÏÌæyéW9ÇÀÊxé VRBë'Å/Z\ç!±ÑI¼oÆ/¯
+gKOD
+-ä·âêÉö¢S_¯_.*ÙbhÙW°ÇÛ¶YÎÐSPÆæCÊÓÞì/M¬l,
+|6
+®laUFxuÊC1¶+«_çºztí
+-@kí±éb¦éßödz;²¿Ð£-n±DÑ4ÇeÑ(ÒbL6Ü°´¼f`§æ=úÙî~v#[zC=6ÚQ3
+ ,1Â*¬ü]hááSbü¹ã'7Æ4¡3Söá¶}8b3¼ý_ÌMtX/³R1[dWK2¯|IÆç×½ßí<àEf¬o*­U:?
+c7<ââL¯}øñ`iþéwø¼øªk£ü2EÈPí@ÇÅ©z§eeÝGoæâ ÷,Çã§"">¯ÀexvTuý&¯5î:ÜñcdDNy'XÏa Î´\"ÞK³>ø±Ú¦6`âlÀû';ý¤"Æë~
+Ù¥ÖhÇFúG¼3:ÃSì$ÉrÔ6asQæÛbæz¬¸#»¤Íñ¹ýç?eLÜçPÎÔÚdx_ékWNÀª2:Qm
+úú^6`RÇ§½¹ÅÌÙâDÇR»V?\HñÇ`ï*uyÉÌµ YÑ
+-º:«Vxj&Ô\[
+µªm¥S
+p2²2 çV_Ä³2÷S¾<,M¶væ÷UrÆI°ú{FhâS´Ý»èîË3=ËÃ××ÇV,Â×9íðÜDõOiåQÇ³ÊX¢NëgÅFN¯%ÏhJ·ÉÉZtæÝ{pÚ
+ÚÕyÈHËyz[îKÊ®Å7ÞwUiyÅNÕ^9íø\J>&Ä)?U¾ªJMj¸rtD³ÉxìÚu6Q
+Ð?rµ])zêuxFÕØø
+4
+-©Ü
+µ
+(ú[qögÔ³ñ&×îmî@ö+TÅô!0B3õ °e
+-^8Êã7¨Ç9Í¢PCÉ5ÞÐe¸·I¼ 3ØI]ê¦$>Ú°dG
+câôÍÏ2ôñÈõ|Û
+µ°ëDìCò];Ä­'£¹è7Ò ºo VH×PR.(ZèÜËîäÞ¹ÐÕúmd0íjUìbªZ,[¢·,´ÙAâ3Sn
+½­- °~NÞ&¤òÔx*ö?è­\¿Ä6AÓzA]]ÛT@WìrHÇÞ±çIR~Ã=móa¡]<ÒnáÕÁýª#ÉqÎÜÞ2Çh3KïÝ§MÞò£tDãÄiÑ$Ê/X?,lµgã.ªaD
+k¹ùq¯â
+¡
+¤ii
+-o$-Ðó°¢Z?qb¤7Ä*Ý¦jSéû¼1µ6
+6Aßèt
+-wëû&4ëL«|	ÙÄ®vóx¿òO28ë§aZ[Ð}OS+mðP+ý,ÿ£´EØùÈòb
+-øÄ4¡émÝyÇíInè
+¥6´:*j«ßºXU{¨drã£ØÑOV
+-úPÄw.ìþ$Mzê=XÎ'Gs}=ÐÂXFý3sþxu¯HÏ²ª+Ó
+Ma}Th`åòùþ%Ð
+}«iç¬ÄÒÉ¡#Ü79<X5/
+-=P;¼Ìu9æ\3Ì
+b·5&
+-5;BR¦ïK^G
+¡ÊÞÑD¯ò
+3~Sb*^QÏ©Ñ¸SäÛu® ùäu¿pÙk¸Î+ÿ]»7Ë-nUCH° Ýçj÷­
+
+-v<SBÆ±¾{KB8pòÞc%KçàÐúÜÕüNëV¾Z]nÈÛ¤úgu=!øïÏ)·î«ìg¼
+-±üE¤ï~ÊfEÆ br6gÌÌ#ç©.*è8VË¦öºyVºº|)'ö@Ø¾7¦OÀp0ª¤-ä
+-x²Û.-1¡ò®vVGSQÅbf
+#D×'u¢
+½X	97ÕUW©~Ïòk XñÃ½Íã#
+ãèêØ¶l²éíV(	>ò2GK
+-úæô=öK±úO×¶8
+ei|ÏyMPûc¥\á¶	f¹ÚRÝX¾Ü
+UwUM¶´¥ö¡þ°`lÙzïU¦³M¡lÔwøÓa)#¤­ëß¿o%y\}6¬ \
+*¿ë5'öªkFç^kÓ^ÅeO®1ógB¿öI;Àõ|Â¤3=
+ú[oeØÝÎ>/6eèÄ]ò¦Év±]Û
+--}Æpù×°_ÞR²Ê5j!$Bã
+-n/$ÑÇëî%.Â¿ö¼}
+-¬T\ÊIQê@ûöó6ûê9]ùråAûÄzYï'<¨"¿ó¹êgm©6Å}Ùè	,ò|²GÒöÕCÿ'ºê«ü}¬Àü*ûÐÌwÉ
+Fv-Ý²³F=ÝîÝ2}Wwôh)×]Ýpò³.3oVú±t¢ §ümB×ål®}3~fÕD}r6èóxæ	
+-ê7I~Á>HWK|ãÐî¦¢é4YHA-§<êÑ¹
+üPø jçu>Tb#ö|¹aùv4dÙpâ£*À`wÔ¬qR¦(\4Oô(t
+¸üÙ+§ ×"¤øDë8Âh\c·Û@UúéÐv¥0ý Û}yUZ$9ÂUòð¦dí­ôO/"VÊw^¨sÏ#Gf3ën¬E?úìöíìY¤÷£Êþx÷ß]JæÀí£S+3lëÃx$5¬fá­åiìD­º]x}íf0ß`° S;«pêi Øê«ÑÛÓ±5âÏO_iÞé×
+Uä±e±*Å1
+N¬ËÅtö¸a\µ8VeYïTä½Eñ£µ^?Ý5ÐæÎ
+®¥6/ÑûS®Ë³i[ßO¨
+¸0W6ßlGñÇÀÝÉÈÜv#Á7÷·ÈKúöB¢ÚrY¿Åc4dzî7ôFá
+
+-MÔ¶®Ws½U*¹×vxá5rxÝTû¸3Cñh¿
+
+ã:½ÞÎ¯QÐB3­.O
+¬é{ÿ<<"Ù1ßûRùè5,(Ë9a80úÀtÆ×"¦Ôgã£J@fóäÁmNJHÓõõàx¨\:ø¢4o¨ÿ#^;1Þ}p{Ó
+@d! ;}%Î¹¸ÏÒû*1ÖøÄþ
+?Ïû~ öXóÎhR8ºØ[þ½dåÂxÿd=	¿t1ùÕzÀbReAX@!ôg#¸-
+-THä¾³FDEG£à
+.6wYdlkõF»JûlÓÕÏËÖ­41\ßv$¼p±î#³E{nù8X wã2ð`èèûrf2Ï
+¥["~¹Î/?2G(ÊçÑU/aîÝ{
+µm
+-_Oø«ªToçØ8C-JiÊ¦Æä¾Øx¦ÜÉ,TTN»ó	]ß¢-éN&aò]Ì×OÓvÎÊâÖÓS,n$¯øE´H×¶6¬¿Õ^¤04^°?xF»³x\,AiÖIsqsºbÊ"&[dÑ*.ÉóÌÞg£vmôZôÍßª4yFùÇ){àsÅ5
+É6ÕQK3ïºn
+ÜxYu´ú¤½µ5Â¾=y£±$ññ1ÌtjFÕÃßÏ­¼ªºáTpÜò&ç1ó6Q
+-|xcpßñÝôjUPª( [ëT&ð¸·på
+Õ«^PóøÙùr7¼OzöâØGöpnyGYì»[È«	ý
+¦ÌcÖãW#aQvÌÜÏÆ?ÈK5 zÌå{Dh
+Ûª\±H.ä	·îýh¯)}é>¸ ¬%½©{µ/O$`¹
+rÿV+ªþ¬6î
+-÷ewþWÑ´µ§aZ%¸R'ML6(À8D#µüùÀÈl}g=7Ó] ägÍWÔÊ^!Ê7e//£ÆÂ°ÎÊÌ$éÀð
+¦à	EÄä`
+-åÍÞÌ¶Æ}1­÷)z¸»¹ßÊQA÷cíMÅw=ýÊ2Î±þP3..1üÖ¤¨¤K0VzÁUódVÇ¯Itû8µYÌådÚ!M6w±Ã
+-L(+vºQÞ½£w
+U:ðÜÛÊ°æ«£íwßvãRE-_,êÔ
+-õzæàÍ%N­§dÃË×ÜpÒÊåÍÞ®Ij9 ÍÄEÙ³ov±cTO2
+±Ô%"K¹Á7¶(L]oFAeÎ{=j;e>¾6^Ëjw××W!Æi
+³S×êÞ´¯=}S#*ÀïRÂAoVOqBo7ÚqlèùïT÷Ä
+b¿ûD´­L]1+v³5¢ùåû2}/z&ºn9Ì{Ô7%ó®øæeë	fNÐÝ;À/"Ç l>
+ìÎG³Á$oÚäzË	2©*ºYêEÌ/N}
+?0*ºÕì
+-H?ºS¶¡áyô±$·ÁFvÃz
+Sc{
+«JuÌßfØe55>àEpaÝÇ$Ý\q!F96æì+5°1[¼Ðåkøè<¡¼³
+#bÕÊqPø)¦ócô:_Üôs¥õ`i
+
+E»¾ÃIèê®Ò§*éL:ëùÉ	nÊ'&Qré-M[¯XKìÞ¸R?©k
+ÅëbJvé×/!4§Eó«_e®ÿn§Yh"Æ¨4JÌä^KÚ×äæL/åWÞ}rlM±&v
+¦`^×IÙÞwzõû`lE=ZD¯í7J}ÝÞ¢LÓ\¸è:·÷Òg&O§,¶¹N@/(©â¥Ov*ínêÚa¤Y½"ÿv g¸u}çî!ÙB
+Âóz¤°Û Øðù!Èúê§Óaýô·]úÇ
+ºËýàmÜz[JÜYZë§ü¸ÇËµÔk2bèTzéÙ¥
+©¼
+T uIûDæ1ª·Vgb°`ÌrÃÞÖë_-*íÌ¤HEÁ yÃÃ±ù­º¹­KÄÖ÷E
+9èQv+(8×2ú£6Ö®Æ¦Åòé¶DS	
+-
+ýfôrjÙp{5Z=õ¡
+KÇ7»³4Sú¥
+-ÏTä¬x«Ì-÷
+-¬?«6û&
+yÕèRc_íAAu
+çU¡R,ÓÝ
+Ëÿö
+9I
+-endstream
+-endobj
+-775 0 obj <<
+-/Type /FontDescriptor
+-/FontName /OUENHS+CMR8
+-/Flags 4
+-/FontBBox [-36 -250 1070 750]
+-/Ascent 694
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle 0
+-/StemV 76
+-/XHeight 431
+-/CharSet (/equal/five/four/one/parenleft/parenright/plus/three/two/zero)
+-/FontFile 774 0 R
+->> endobj
+-776 0 obj <<
+-/Length1 2205
+-/Length2 17171
+-/Length3 0
+-/Length 18484     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚöP\ÛÖ
+-cÁÝF»»ÜÝ¥ÆÝ5¸;w'¸w,Xpw÷àð8çJÎýþ¿ê½êªî=¦¹æ\»)ITDÌìMöv.
+,Ì¼ 1y
+ 33#33+<%¥ÈÅø/)<¥ÐÉdoÇû½ÐØå]&nìòn&ooqµ°°X8yY¸x¬ÌÌ<ÿ1´wâ»Ì ò {; 3<¥½§ÈÂÒå=Ë
+Ô¦4 
+
+.ú¿Ý"¶@'©±
+@ÞØÅhûÑÔØ jo
+-ºxþOj~K^&&wwwFc[gF{'
+Az;ÈÅ t:¹Í Ñ(Ûÿ&ÆO	P³9ÿK¬joîânì¼
+l@¦@;çwW;3 à=7@UZ è ´û±Ü¿
+èÿn
+-
+å¿áþíýW ÝßÎÆ¦¦ö¶Æv ;
+9ÈPctñp¡Ûýehlãlÿîoìf
+²16y7ø»pc¤2Àøß¿Ù9:
+\A61dú+Ì{%ìÌÄìmmv.ÎðÕ'r¾wÝéïcµ¶³w·óþ×³9ÈÎÌü/
+-f®Lêv GW ´ø¿-ÞEðd@ 333+ è zZ2ý\ÍÓø·å/ñ{ý¾Þö ów
+-@_9ðýÞÛÙØ
+-pqrúzÿSñ¿
+`2u -@vð¢¿æÿÂï'ïò è2¿
+
+ù¯ÏôßgËÌÞÎÆóùßË¤¤ª ¤$I÷7áÿªDEí= Þ
+l< Vf 
+3'ëýÁ÷£üÿ¸ÿ-U2ý»6æ?¥íÌí<ÿ¢ðÞ»ÿÐpû÷LPÿ{]h ÿAÁþ} ê?c¯ÇÌÁlúþÅòÿyøÿvùÿ7óEùûÿ[¤«ÍßZê¿Ôÿ?Zc[ç¿õïSìêò¾òöï{a÷M5ÿZby ÈÕöÿj¥]ß7CÄÎÂæ¿M9K<fJ SË
+-ÐÎà=¼
+-È¨dï
+úë0°03ÿÝû®Z¿_%Îï'õ·
+-ø¾JÿRÂÎÔÞì¯cåà;9{Â¿ü;â x³¼/§Ðãï¹01ÚÙ»¼» ÞéùÌíàÿ:ON È_¢!N èÄ`û¸LâIâ¿À$ù± ¤þ V Ó§?
+-À$ý½gýÞóÉÿAïùþ ÷|ÿEÜïùþ ÷ª;IízÏ þ½gÐü/âyGÆÐ{>?è=éû{Ì÷ëÍöõ_gÅdö²¾Ç2Îï7Ý£÷N ÿ
+ßé_ãóÇà½9æà{ssÐ?¢¾ã@æw¢ÿïæj|gjéé`ù~ÿ±xýÓÿ¢Í?à;GÛ?åÑ_wBvï#øý;û?éÞíÿGý^¬Ãõ;W÷å¶ÿGþ¢çôø^Ü^qü
+nÿ¨ãÝÜùý^üoÈ÷m-ÿâ=Ën¾ß-L.NÀtü»ý?
+Þc¸þ¾7Äíðû?ºÿ
+Ïóð ×jÞ]½Nÿý?+iêêäôþúûÊ|ß×ÿà¿ß@ Ð~ñ½)_°U}pÇ}­;ÃîÀ
+å®æïE§N×Gd¬ÏëN¿ER¾÷¡®lKPß
+-/¼x·5Â}KRnòy6LPÚm_ø=4Yt,Ò0HGÈ &¼çóâè£h
+-ÙÞ-CçèÊ¬Tqï> åÑ0X±<úkWy¯Sá¹b!F=Z/°t2ß${
+Ú
+ýÂeöö÷
+zîäL
+¼ïI
+[±·ÎkìÃ×j«s
+.ä-úØ·èAª
+Î¼wYñÊÐG1I.}Ú
+-*ãkf
+-H%Ê®¥¿Îml±e'/ü`c'©®¼ÓÐL«¦Ý0
+-Ã¥ÍHtÐe.ºÚñ[£×Ü*pgºá
+-0ÇETá>¾ªÅÛÈ[$ã~>^tðEZÛjóÉ
+OóçEÿÑÚMltLÓp£.¦ÔbYSç6Mó·â³ß>©,ÇHÿðBÄëÌlq´äøçñL6c dÑ¥¨Aá9òG~Ö®DBÕ¯Ð^ØÙPLmÖë{Æ[ß»¾Y]ö&®àºløê¢/c¥é:ì%ì¢"À^`jÃ.bþ&ýÞöäümÄÕoe
+)[
+H"ÆJçðË
+¶ñÄ§øi%Ô&»¥Vüñdø;"Øtdr¤zj'!´¸ûèÃÅaS|ÊTdbU!¤k²*ëÛ[ûêDà	¢_ø§ËïQY3²»æ¤:Ù!BGÍÃÃÅgc·j¶M¢/6{n²òF%Ôuu$?×)ßxÒ­Má¬Ü[ñ$¥ÓÔdüÞ¢<n-NÙCeµÎ¾"Åy÷.úW5Ü%e¤ ïq
+R¼6î^~Qª(ÒË
+
+¦&ÃÚ*Íõ¢Ì
+ÃUyN2¨,öý¥ÉÙZ0+£DÊ©pIÉeÔÞ±ä:§ _¨z¦%|E
+ õ^Î¢Ud"KíAhwaá£°ù<2öF4Íÿõä@/JWà;¿Ðþtõq¨®¾DEÕ ¯{Fi´)Ý8Lòö°ºË/»
+·ñ729r[Oypð*fÕrwpÅ(õ4!pZîÞöøoÃæ^ï]O0V[Þ{¨ÏøÌbXè
+½
+-|Üv~Ù¦X
+nz} ¥_iZeJv½h!d çivõM,&4I{~tiv¦ 5Û'WPfú9ÃSÅO<mtÞdhnË·Äîol
+åáô´{VNQ¬§#Þ
+9
+
+-WVü(V	Õ>uªÃôÁßZÍ¦;F/kSôi5}~Y°¥mmûu8f¡9Ø"8¹p&ÄJ@¥Î?YÚçÔèI*_=
+-KU;KyÔ
+¶;R7ß}È,U"x©Ëâ=a¼Ü+
+*
+-åë§buß«'rÔTVñNCÍ1¬Îzp¢$dãBY¬ S)o×êHë6ñk¦	5SôØûaØî(
+-O
+
+]OÄ §¹½®
+ííÜn
+-ô.a·Õ²c)
+¸êè4
+e£È©8(^uZÞWü°âÛ=6½ÑR¯4àíVÃ=A ¬â
+·ÃÒUÈ¿,ðQ-Ù¹Zhl­ÞC
+-8çÒÖqêÕû
+ÕäB_?­§§väõÚ~ßÀQÑsqTqø]{¹Kíz°æEÈQG92´ÔÖoñ®o&æ§8lH,Òb2£}15ÓzÏ®ÌÃ07½m>=[xa·ñ=ëó$[²­î!5$_*õ0¾sàPÐ}¥UñtNK¦8æ5a:mh§ü}Âð6/[\÷ûÂU=Cr÷ »)EÓ[N½ >©<ÑcÀIÔ&%:ÙL#k5dÑcÑ*ð³ð,ú¥aÀ¿ªøü°9D^Èqló·¸T{Jè5¥S¶ÏÊsLLÉUPÝqºÄ.Ó÷<ç0wkx»¢ðfÞõöÀêCþgÊ'Ï9ñBd1Ü"uý¡à±Ñ]k²¯èµ³+{ã}+ÔåG 
+ðV|öÜÎqk]ÙdULGßMè·§V°+ ·¼2rw÷º4>÷YÚ4Ýã-s¶}*³²ôT«(Ô$ë`q#Ì¦JKÒÀöåNÖ,--øöÝ%ï9¬
+Å3ôÝÚ6ó<Üª,-Q
+¯îí0)£ÅªHîÃrÉØ-ä
+-?Û$±8õ%Ï$=q½ìûÏ ¡n- æ¬
+6ñÄy`Dr3´-HywT0Gî­,+øù>âûuõ!d«à)mL` ÁGüHÊÈ|
+@D
+ä_\³hHWNÝ,0ßÁ¼åyéjû_¯é ûÇSSo[yÕcGÃÐ
+[^ò®º,-øA[± *çT3°ù¦§¬¨Ácªº2èãBÑ^ yÓ7ùSk4ÿlßÏ#Y/¡_rkìî&!¥ý¥£_rC}J¦eê£¬	J.Õ
+¾V÷lc3Ãq
+dÃo}^j¿Ü¯1]àåøü]
+-¸5wFEÝ0F­ÍÈs«Ó­áEÇ%2õÙ½¦9 þiý°
+-q£Ö³£
+-cyífacLQÝ!Ãç»mC¾Lý{ùÇ¦ÊÉbËfü<púMX/+ñ0k8kÜs¾ÓgGoPwEE­®Ê¹ÓÑNLVr
+Ñ
+"µk_
+'2
+'nkï5:©oÁÈ+¹=74ðùÙ?Ñ¨õK?&r7[7Æ
+-«<ÝúðÝLxAÓ}Ê
+ó/Ö%ÐÍîXEÇ¸|òè!
+-Ó¿äÖ&2?L10ÊGÛ-º%ÈÑÃf£ÿ"I
+S÷5Á¼Ã.Qx¯¸3®ê|ÝßB|Z/¹VÞl~z@wSbÖû¸ÖaíÆ|ëWÏþqozµGªµÇ
+
+¬ýÄSY¥ei_Ù?É®4Sï5«ÃòsQël{âÂ
+PÿÝ½v¸_!F¨btÖ¤÷Ó×A:z
+=Cäãô¾ÈçúºÏËÌjß×7¹@XJ7Wqá©ÖûN¯
+Y Ñ½Ì´Wy>ÈÊE#1ôqÐÙ­u¢g´[^®Âg{^§reT%®[¶ÏBú¬Á"?;2yaL~9Vó-æ¼Ø^õw»
+-hEîÄ½4m"a%ísXbÎÌ@åQh£.
+ªnJÍCUüðÅ1«ÈeZV¢å=²è©6	+ÌÔó,³b­¼ðWÝÚèòà'Rày`Üñ9Ò
+Ú·}>+¨¶Qi¿½ð·0g
+Uudú4kÄ=­TÛºOJ1cõrb«hg!
+~¢â±)|Xd×¬IëJ
+
+l)a%íK¹Ðæóùlaý°Xú­î©
+Â*´ßª_üUóI¹ºÏÓ°O6eÈPë·Gà>jÇu-¼¡E½
+Þ tKÄIf]lT8í e.ðÎù´ÉM
+-äå~´súÁÑ÷Gj±ÂíÞCéëFÃ+x¡´PêIàc¬Ä)ä	î²ècûh}¡¹gÿhà®{Z:µ-­ îÀ½ÏAcíY¯)£	ÄÅß¯]_1U¯¨%æÆeü~û#«xÀØù7Ñ^×¦4ÀµH¡
+¥ÙÒÔçb#sa&ª
+ÍL¼®Ù#
+-Áð<TGZzïKÆXó¢ÁË±Tß
+õ´§VÆJ `N¯ÕgûJ~A¯(SÂíã·yF}>yÖ67Ü¯XooA=Ðîq°%¶nqÜÍî«D
+D@¡²·éÀeNüq÷±©
+Ò_[ðqB£]Áþ$px!*øÆfhÖ*GÏã<úuàëMæ>6]èER©kúös}¼jØÛ¬Þ+4 'n¦T³,íÁm
+~õùä1ËCõWßm§ÖfHykºÈU0í?åwFäî:
+cTµNØ8á_4EýÄèy¤]¨fyàæê¹pôü¹ÞÈx%"Î¹ÃH¿Ö½	;¶}
+-ru®÷ÿÈÆ×7|8£²§àBm/BVø
+_åíºHZ=É÷s	¤éLEjØÕÖzï0R)ÁÃÆ¦&
+ ëcp÷FUÉfý
+j!òÎÇäãU÷`\ãË¡âsôôäYøà©­UßçO´¯p
+£M¢IªC&Ø
+
+w¢HOv¹2?©L"Öó:ëQ_;IiÔICýh²d*­AaI1
+ZÄÍ¿ë	¾Qp6qkw!êï ô<8fØòÙ¬ï&Yù$Zùúm¸e©ogu÷ó)Û_PBª8¨½v\3k'êë±êIGæ«ó
+È(?=^¾Ú·÷w
+.Í¦~(/R1>&¿_·Ãë ¸Øªq[OYg}I<>Ø¸-w9"ßÂìEÁv¬kùÄ¹ZÆ8&¾Ð¶x'¥]ºx´ `ýê¶H¢ÒøU
+ 
+T.9¾ôª¿Æ$¥I÷ÐÍ*\[å Úîy%Ò#F6.µ|¦@ç °	äûEb îQNã>¸«Râ`G«-9ò	£Ç!öó~×  }2û¯ã]dë`ë
+B7¡p5	/æu-C
+U²5µÕn®Ù¤qóUâçÆ/ÚiªØgF<Y¨iK
+-EÎ0QHo÷¦ü?ÊÄ§goôk
+~gìÂívcg¼K	a×s5ù¹LóHÜ«âÒ OîxðÚo
+
+ÀÖDS¥ð¿R#qÝ¾e*¤Ê}üF9cÈòÔ­¹YÍÉéé Ùz5 ¸z¡·þQÌÒON¡fzð\cïCÜZòmÃ9±"ó*ÙSm~ÆMÄ
+@/e°üÅdÀ=ãuüÐóÖK-)(!ÎXû\
+N7¢\½Ë]ªo>,zbs3§a¡÷
+Â_³
+-Ôè`ð!ãhéøìÃÐæX5V³b|sq#í´úQ±TFbyE©IgvÐCï7¼¥Qj×ç×q-2õ:Kszï#½ãUìßA _ÿ&BÁlg
+-kæe'ÐG©@& ½­Ðñ¥í{ÞBÉP
+[oºþ:röµXÐü°/¡K¢BãÎ7KSó¨&©½
+8ÔËìJ#£¶6{{GÔOjÃé 9I}¯"CÅ
+1]º;æ%N}Ç
+-Ô¼?LhU¤B¶Q|Rà9=*B¸auü.C.ípG°ÞÞë÷à9f¡F°
+-öö0P½?ÖZµP¥%<ý¤zgÒ¤,G*¾¶Ô1T,Û-ÒP&Ï9á¨Â«øÎêÈ¹ «¨l^þc
+îyT
+µ¿îñËó!R«ÙÏË=TPÂÎÏq Ð.
+-ÌÈ°¶½
+AX ow:wÊ¼)HÄsÒUD>y}HÈýÆNU#ÎÛb¦HÞ#É¯Ìbèf=Ø0Ä/6Dµ!¶ oñZÉÄ¼»[gÁgtcÛ 
+÷Ù¥cG&¼ÔþÀa"n£»¦ÙÚeu((³ëzI
+§²R¶ñ3m0¬_þé,/H]²öçézSùB;§©Ë õuÏ(qO´²í¡/­%\;Fã!Æ·NP3ÓÆ*¸]"	MrÎ¹ÚBcwOÃD×±;S²÷QûuQÂóF
+V¸4ß${¬Åæ3}ÝÏ½ÝÜìÞôÞåS3egÄ½ëp¢CUº Ï(ðÄÚKAï
+ñbLY6ÈAB/b!ñ§áô	&¤åÈÌµåD¦ü^
+öá0.3gÄ²ÚÝÚÓGU[¬rÔ8}'mýísl[ÃÌ±3º;m/sã0ð)úR¬±ÅÞÕá½èUÅû
+J
+-Éº·ôÂZØ1öÃÉüpÍ
+blëè¼`ÑF
+ÂºÑxñ@8Xªñ¹ÝÆ7­V"[N¼FjRFX;Flh>×ýö¾i:] sLÞË%6GYDF_.)
+ÚÉ?VÚ.µ&WÌ`_Tº½[Y#1«ö"=r7Z§þÝ4ui.^
+5´hoV4:­YÒäRr®&%ûÆÊN+·)M(JD`}@Û÷93Øñ0UïQõló7þî"T¶´ë'®óW!
+â1
+¢îëq¼ERªÍjö
+ÁËn(d,*><ÚÉ9ïx:jÿÐ·ÂKi2Õ]r:<
+-¾½uá^sÔ;¨FCWö5Ôç9òÂäáñ Bë«Ìx{ÕA}òTü¦úqnCÜèY¶ñ3mYµ¢Óø</
+C}1*¤I
+ëAEI:~À6Ræ°6µñg7Yxb°âºvÄ©ü±'áððÕ.EÞìú
+§:Ø=^ù
+ç
+-Ä×Ü)Gá`ZñÄGí/¨þ3ü`Ò&b@Ý³Ø6á¥úJFÈe¹¢H²g
+FT¬²¬YE2w©
+êWðT¼¦ÌÑ"Siî-¬DV>z*ñ×lLÇÒÏ¢ôç»ÍíÚ. È&ÔÑòW×1©ÖCôAÈñøjé.«°m>°Ò)
+m¹IrÂIÜ&ê3¢äOÌè((|' ÚîÛ'±ÄÅ.ô!A¿Ýäbä Ý|Ä¤	
+-¢co÷.ÃZû
+ûStîLW¤µ#ù®Áè-:%"9ár<´¸Á§üVECÞÎÍ*æ®Ò½ûíkÌ)5%£ãï+$$x#ÜËÿðßqv,» ;¯©e JöF ¹Ýíæb-Äëb(®{»¢+­Âð=²5idvúFál/OÕ§>GîZÖïEhlWWóþs7AªÐt#8ÂT(	zSú=Ù&ëù¤
+-kÅXÆýgÌæq
+6q«ví3ðâ10bN¼µ×Dh»³'Ê¨P
+;`	[cÙMØÜÞÄ	¶bê
+-|-Ê.¯ÛÙºÕ:ëèhVC>ÚÊì$#{büX:ÀÉ
+3
+ûÝGñ@^5¹ÃL]Â°ÊöôÐÅ¾t{#PÐâÏ¨e¡bôLa:*Ï-|chÌI;$Å¼fÞ7­º
+´ú©;þÍHÑßÄ¦¡#[Ë­Ø²I[ÇQi;z$ú?|Oû <aº£ïrß¢{kzHÓ1á$³ñã¢Ñ<(G¬X;î´,ÂnQç3/mPØQxq¼s#1Ê=XKq4_2þ¾:¹XÁ Á0U½Qkÿ!½ñ¦'$±À¨tÚü»OJ³º>aº®,ã½ØU¤/7\f}µd4Ìß¦ÔÚ¸>}-
+¾ëv^ÀTAý(]'¢+DkÊgZ©ðE¯uÉ]?>óCÞÓñÄÀÊ¯qÂ
+-ð¤Pãü¢é$°¹!ÞÄv!òt«b<Q{
+(mXÉ[À´Ñ1 WpAhÄw`$SßÐ~ºß9µÄÖßkB3C0+dËY
+V+óLÿå
+-5UÄàE
+WÏ
+ÝLhªá0>1¤}ßz0¨9½ÎêaC
+ÚT·¯;¿5=Z:&-±¾u{É÷õS·­¡eÀ
+'GÀã·£ê-±81s^ù|¹¼¹7\å¨!tòQ¥éN^­àG]ÐÎxö'_Ã7R¤ü|HõVi4¹ÛÂ@¿
+-?&÷ cpåÍ¯fs¯1>«´î«Á2ý¶æqneÎàÔrÞQ{VÈþ@§îüPzUþºãùºß½¹2÷í£ªn
+ny;Ó²ÔóöU@j¹nÆEwþ+
+¶aT¿	¿?dGÇkzc÷±gÇi¬í9ûZªü£¥Oû"ÑáçbÜI´j&ã~)òçbk½Ø>
+¢1õdøFx0¤»5Â­ÐHmn»°COá~¦¢,¯[à'Ç/T¥ZÙîé[`n$&àxÌ¿½ýfê2;\lw³4Þ<ØËèÃ©(ìµZqæ`×ÅnC¬ZðAË! yCrø-Ñ^ò9iN>Ù
+)vZDjyGëÙç-*IR%a¬ü¾ÀélàHÇñÙc­ÍÒrÂl7Óª´2e±SÎ´X
+9¶SñåÕÓ¨â¹ØJ~Î»ãË
+í7Ðñá99ÿ²­w"© æ\¾Rs2ª1aÝ6oóMÄÚ/ÐÁÊÕ2ap	¡\B­YÌþÁÍÐRÐòúõnk?ªºòÃë]Å¢%òh{Ä4ªßàmVvJÉ<Üê2Y1F8gø
+HÕÍ
+!éBíÎMú;,MgìË%Ü¬q' BèÂj}¤1Rú#Ü}v
+²_zUß¾¢¿_èVfÏÒî:ß÷ôW¾¨ç¼*{Ç©;Ñ£~§MÑgò·­¯ÇLÉÙC5Óo0J/òP%7í9¯æ w+pAM	¼
+ý²
+G£æX°Hr¹ôhøI, G­Ç·s¯óioÒWØ¾ê×SsßÖü(ºsj4aI4=ubqikò¨Ý?!áÁä²Æ°læ$i~5&ì	Ëí÷1ìSbÈünpº2dnW@é{fÃtêûæÜ¹­<QÍê=eW¨Häi«ÆêkR&K¨
+jéÎÏËé\§tYîØ©ÿ³#W(påX{4¦[PÝZU×8MA"VL¯¯Õ>ã¶µ<Iª2¨L
+d:ò·@mÜ¿ÚWxsÆ´Î?íNÛ
+­Úd*JmØÏÛ£ÿJ¤¦)ý±)Éæër@eýªwW0JÆ÷
+ô±&±è¥¥lÁØ£
+-×Ëæ¶ZÒ¥çèì`¿6d~¥%6û®ÏµmB,.ä	ÔwU
+
+è/}3²ÃÍÅa-ý¨º~ê®Áùâ-FZÏá!|\Þ¦K»
+-DÔ3[e)cò}]óÍb/¤Q½N3ÀïËúßÕ¤l
+L?û;ø7,tæ
+$Í@:A¤C<~¯sþÁ0ÙÑ¡ÏfÑÖÙþá`Ïµ\¥º(Z}JWAó<}ÓS
+CãHsy×ôú*u©¤ßr°Ã%
+Äî®yº
+.æÕ½gØÚJÜÄÙ¿7;ùÎ1±¶
+-i
+-Ä^\wHHÝç¶Ï
+ÇVæy0m%°Þ;;"Q·àÍÝp\¿!ÿÖêÿÕq×wØ oÂíO/\Øfrþ¥-Ýðx¸Lâw÷½ûg!`î
+f;Pá±aûí\¡®×fjÿh
+µP²¸DÇqË°R18E^ÏdC3¯ô@á²«¿¯Tècê 2È%Að(D{áÛõ¶Ý÷ÂÁÖ´ß|´lã,àßLn©F;Þ'Â
+ajÎn*49bñÜ
+êqâ}C[+©n¬-ìIoÖÍ R
+vÎ£Ú¹(rh)¼½¥
+sD	0Yñ
+?Ò¶ç9dÍRÃ,H|µ\{é¢®¥{ãÚ¬TÛô²
+-.°}¨Ñø)«=½¸ÏiÖFär÷3ÖðîipÜqí¤%ÿ
+÷V7~áìM-
+ôÇöÃÏÒ|º¯Ar6[­0é
+ØkVqá2Iyém¹~ÁIÙ;Â¥ã¸(Ðñ©¾AE
+³è?Tdl­9T]rpæ£×kXr ®¾>ËWù;M.Ø¤½e%û<ÝñÇ+içå	ÃJ<¢óÆuÎël´FWÚ	°^¯>Ñðã/ThRKF	În'AÒw(ä	xý8NHXó
+-!-;Ô;ëI#Él4ÌÕiø=?:¯.
+q°L.n_KVáûS´Æß1pFü ¸çq2gu©F»Ö²d<iñý¬?TÂ½1Â 7oç~u[ñn³;øj@-5ùó<Vz
+·}Çp©ÂõÙè²Ú²»mÅØ"_£«n-Aµâµ§¥zKuÏÊå¹3tê0|bÆ9³(úÔ6`
+-1Ooî+Ì¬¬v
+²b
+-ka
+}éÛrÂÑãZLM«vDç üù+ì
+
+-ëf[¾:.¸ªT
+)öñqu¦èuá°
+
+L/ 5~ay¸*)d-gá!é{my¸&6PÇhåÉdëc4í-¦Qß
+-Ãõ¦æ]Ex
+ò
+-þ&qúí¨ß^ÖFÏÜ
+OÅn1_g)êÙ$¯-
+-©:P'hí
+ØL
+c`$À"O°µ²UuíO7\ô¤ÏøAIõ=ãÜ'ÛgõY}¯ÎO
+ÎoAÄÜé^EB¼³ßUÚÀã
+°
+-YFe¼ðûl"ØCÊÃb
+7^2?¸Ì,ûáY´6ýhòË+mvôÉí7íQ*RS± ZÔ¹ðkÝÓS
+-íZ~t¾×ÖP®R¨Í±8 EiÙK^yÅ GV>qWí`SwêüyUX½,ñ´¯}E
+Õ.våîÊ{àN{Sc.Ð|¾2º¸ÁúÕÄÅì¦¿ö­IrHY
+÷S
+ADå¦¦6ãèC%~áã ¬ª
+/©"e>Êé«·a¨mû0àL;»×¸ÙàM2áóYÀzIu°ª0<xÿ 
+{«ð<à¬»J;þÍI¢M	«ZÓHsÖ¾
+-ñR³ÅÄÇToGyêxUØê®¯{'©ø,Mç.©_´¾}â$¦NWT
+U5ÿ´#
+K 9Z
+-»
+7»uBïkÇÓ0de<ïi|þ] vï;´èsÿ¬Ðf[2üñ$y
+÷
+ó$omÐð+¼vH«s	êà¥7£ªoí§Þ®+ê9×¦òÁã:¢ö§Òï;¶ÃZºØ¦/<¡ï¯JRKE¯ðü9GuÓò1x-q¯Ø
+-
+ø YÊ;4ÎÙQ;T$Ã¦:ñ;EÜ¯SPó
+-_iÙdÐÛQÛe¡sí:¡ü	t«æ)Û`ÿEÆ+A
+-¬Rc.ÂhØg¾àI.ÎÇ%S9âírâÏë¡íÜ½vBK.«´Ã·¦m¡v¶PÑ5«!5k.ÀÃT
+æ~­·X*0¡V`)Â{õû½WiYÂnÉÃ!*À|øpvìÍX{&³sB èÑ%ÜK/ÿZKPPûRÇm^(Ô½~\Æ7l%Ë¨=Ã¬W5ý`¢5éó0"SXì`Ó±Å
+-8'ü<ç> ½^²¦|^ý!¨2×%ÄÐP*z©Lc¿MLñ²ËÇ^ãÏ'¥®¥ùpÁ´À^ê÷Z0çÜê`
+¹"¡í
+Ñ
+jö«%0
+Ûs
+Á«ÑçG.¨o±ì¼¡ÕÄÜh=¿;+C9²i°<oIQ£;â¦´÷¡ó£bmxètÅv××o(§ìE}
+¾nD$§ÕQ§
+-úªþ¯7yÅõ±üã¸ÈænCéå¤t3_»cØ
+Ö
+Ú<m-}W]îpX3WÐëuô§è?û?$óû5Ò´´]/~ÇkÿñÕ`¹Ô'ùá3VË·ç9ÂAmW}[kL -]Ãelc;Âþé*WJÚlaùîÐ§ª3ÎR¿yn6sf¢ÙE²fJCSîc8ÉÜ~Â}çë"g¯
++:!ÊKü@u`òÓ!7H^Ãø»Ä"ö2yÆÉ×rG¼c[!ÓxÎüê­æââÌxö%Dg£o¿tF(¹y t'Èà
+j´01Àô
+-Ö&¨ÆjóT×Þ¨	£K /?ÈxtlÅÓ³2Êl
+-§Wí@øøSVpâiæ¨ª!Z§¬Â8¸ÕJWÃQ¿ø´ç^²b,nQ
+
+#
+-ÞUI¶ÌÖÓ/CÃWYëÂ
+ãYÞú±ØÇºüS?B5GÓFJ[P«º0w(1î.J2><âõ]~LÚ·¿óMLeóÉq#
+°äpfUrt}Ë´Ú­å¼}Æ
+©WÑAõÚz0Î\ã/"Ò
+e§§	ýÝ6¸e/mxWMÐÌÃo
+¡ÃdÀÇ³
+k¹cV÷+qcKCT¨AëñjpV^ø×ÚbdØ©TS7cËwrÏ
+È!Bbë
+ïiöU%õvkîª>
+-¨­×Rú¡Öîà(¥÷ÿ¢èr ÆÏbñ^J×ÊÚ`ÆÖÑ
+KaZ;wÜÝ1ÞrD¼®(Þ¾¸æá§Ãô!¸©ýB»rÎAuéßîáhõ}E(©^¦+JÂ&£Ù*dÅFn8Eü&äO
+-Ñ |Õe¾8{£aÐ<8¨
+b
+-RÇ¡z[Yµ¦¬bÀ
+¨rAI]h²\ÌðHÇÄÖFR,\ «=«¯¦2_¼Õ>Ñ®áã\!{´¡ JVªïñ©\bo) Ð
+TÉãe(è]«Øì?­o)¡è:.Ð/Z¯¡¬_N×æ¹è@4zÊrWÚÁ
+-ç?B>àò³
+þVê§àöF¨;w
+-×¡¶;7×Ïçµ¹ÒË,0kÏê
+Ld"|ÂYDgú8ôêTÉÈåQhl
+-«7EÖ_V}jÙñÀÞR;êx¨d,Tú<6i×¤3(Zñ6;Õäæ\;
+'GM±¨¥nk.o+¼º$×õÊªyÖc´½WSÆO
+v¦j01¡)!-Tø¥å$6É(_70#tãqTS3AN¹ÑÓ?*ÜÓíöbø¾¾?Ó»pk áØýÀ¯
+-V°ú¥R&Ñ&®cßìTM VA)ÚéâÿUò¨À
+-)	?RÚZÀÓÊ
+$
+^gòîÚ±Ë!aÛÞÒ^<Dé[­TKÀ¨Î,	 j×
+5®«[1¶30Áµ®Ç ëx*§w¨@wå\GâÆÏ§û(ëN2Q9
+öGT5þ¾#
+)Ù7rl¡H}S5Å|ó­]¶Ë
+%aÊ®lz2¸n`obx
+yïèºRðÁì×3é'3¥/Ü#ý0
+8õæ>ÖYVZOÇ£XËc
+¤Áyqõ}fÂ°p½·k£
+
+-qõ6¬Qpæ*Q»Rä®
+-ZB?TÙVw¾~à5õ
+ÈÆ0%
+ßÅ=ZéÝ²À´ûÙc?/yð	.7S\pG0á¼"L$Q
+ùqìì	mµ ¶SUDGÕ÷Ða^áíøürXwªõ'1L×(
+ÉÓD?;4Z':,ëk÷Ôô®^OÔÎ'·þâ!:¨ÙÎ|Ö¦ê:ïµïTSùñq_ÂõúM²z@FH°ìçªªÚö¶Ï}$ã²N[Vå2yF¹¤%dÝÁûJô:¢i¤4eÂÔÓñU'âú;yó2MÀyYÝÏXËø
+-©¨8L!á+¶nÀZï&@
+ü²ÝG§sOß_AÒ¤H{6úPÆ+
+á|	Æ·kb6wq´Êy&ßùo¤®6
+$éK.âeêS¢;{êìô
+-²J*d
+¾¿}ºK	iú°&¾@<9i¢ZE¬»k×Ýkµì\,)Ë@
+ØÜK?Í
+bÀÈ¨>s`Ç|¸   
+-Wº&Éñêù"¯<&|2¹î
+RCôÒªå
+ý]ÀÅ$×11Ê8Eçp;¿½
+>Àp+ïhSB`æbD®Áj·	µB'¼i?ÝîÒ&hs]C5ä¦y?¸Ç­}
+2URµ6
+Zýà?À5æàlí[ëfìIÙ¥aáxÖnä!#d GLoÖL \#âÇÛüá#Þ|_$Ð5Üùý«£4ÛHó·²>¸­_¿* ¸XL¶¯ö­äI
+I~ùrúD ¡J¹_½çËÒýIG5G»
+-º´»ô
+Õû9f¡c
+ÇInÜGÝzù
+ïYðtyb®ÙsKü
+Å&U(|²î	3°g­Ýáý¬åX ì»uz|ÚÄi'yÊyA÷jJ nó²!Ú8<Ðc»u7òr$ÄÚJv¬W%íåã3P¼òÂpãÖEG§O5Ñr.à6¤kãÿR×¹YID+~I¼ïhJÿéw´La}ïÝXÃ:I
+Ìº\jérp§ÒrÑbëds«
+}B±)
+-L"´Ø¥d
+-5ÿÔ!ÊÅ
+ñ¸GÔ¹'Ñx°&làkçH$ýÉ£sµ¤@1?FÑùáÅu~ëqYÜ ª÷­ ¯7­I{t&Ò ¢qÁ#
+ÿn= 
+}(ï¢o¼©$\ËN7Ù²´
+é,í9ÝYý4
+EÚ
+£02`£Åäì
+Þöc4wCÙ'^RÃ
+êP50UMàKí1ß,ëDÃÔ âôå
+-ý }ß[Zw`þ¸ÚQ?öq\ñA¹P`§§>£k5ø{rÀî®ÞGÀÅãwH¢;ý8Y¥Â­\å¢Ñ4qv¢WM4þbNäûd9aXÉìÜHb!ùÕ¥AP#ík'xÅnØ¼ï§ï~õ°ØþÅ
+
+-éH_¬¿ùÚC°ÖïÕ³T2º)CøîüöR
+`.=	áüÔ©³ÄÍõ9]ÝìÉ9øÏXéBH¢ÿü*By¥³
+ß¿Ì]Ãætàãè[úÊØ.<nèUI@	^*ó$Ö:
+ì1yhëãü8ô½+ªLÓ¢ÏMìkal
+&%õê5½¸dºùÁnìÌoEå7à3X9ÞC×d$E*n¿¼KVaVÜÃC¾³8Äyõ+fªq»³²o6D¡
+Yß$éºSµKeh¼Qglë¥ÔúK1
+-Åù½
+-÷Ü^7Á~6-ë2p×É
+äXÒÊ'Þg!ØåÒv
+r
+Hõ©ô­0ÿ
+RsgÈ
+â{´¨ ¡Y9½þ²Àµ+X?Û 	
+-IÅ
+-}\{6
+-gqHµî[Yô3Á
+-¤º«j}nXèîØÈã6¯wu«ëý»üN¨DF4½R{¤ó[ ~E¾ÏÆÊUÒ
+ìëÙ_×ðÇw9:$ïr6¯¼¸_
+)Ú<8=r>Xöå<qÈ"ßz?ÄºÂ6¤$hÆSÉmóÒÚQ
+©¤ª(-½|7KÆ¯ËàP³à°ã
+g¦n¤uYØW°:TÑÎMÕÖ+RcâQW|­$Ó÷ìÐ[±b±Áôùt#TZÑdjf§+áù9$7Õ¦-X¯n½¯u¡£XëDòzÿFöÜSÎ´ü}g*s¸&f×WÆqIÝO¸Al=S·;Kâ¯y¡wÎí*LuÆp%H×°
+
+åËA£AÄ¯ØDâ*ÓU-Â÷Ë½TS®»Æãß©O
+eµ#NÙÙo?'òízL½pßÑ{¥Ê½äZÛÎåðéî¾ÐuÓö,r*R%SPúÔ:éüJ§!@
+-Ã¼
+Õ:HÒö#jÜï¢e"1öXZçW²Êqñ¤¸Æk¥éDô_á²Á:p{÷¿©0±vCêõâÉê!³W-ºõ2AíFáñ-@ª¤há«éo×ÄÙ°gõgt¤Å­ùðx'î;}ñ1R¿oU|UTú 7
+-¾ô±S5KFRLå3'1Ùv
+-D_ùCnÅNì[~©[~HU¶
+ÓÃýÕ¯3ý	[<ÁY`Y¢Ôg·ú2_zr¥¶¶è¶ÐÇbPÄQËAø=~Hé¨¥ywtßr
+Eudaó6Âs
+8|U-=(MPh=A½[
+-²,WuF í_¡1¿í=|z'Tµç èýt?	s¬.ð½ù/¦7+§ÒIE4W¢Ë£xeÌS&iWÑ·ì
+-OÉ ÇV
+¶_Ó8*bäÚX¼ëÍC±¿«j¢Ô
++¬ÍuÒ)øÆãéíØ5Fæf.â=yâÖ-t®»Îpc;âÅV÷aa6ã
+-Äi,ÒdT5>Â«Úé÷Ï¦rë%GÏûòU(3¦Ûqçú5pz÷ÔoãG"TPûkÍ¯U
+Ïê]
+Éåq3OÕ²Û¯0ïú"ªîÜ¢ÑÂi-»È
+9éd¨Ýù
+-O]Xsd[I}pôÜ§yÎ8>õ­ï´¦'s«{$·RìqØü&äXzËQA- 'ºë`ÅúÝõñW·­
+ê¬7tì+¶®>³°tKÀÉýÖwðð±>ûa
+-Ã3§ho#ÀÞ½æ_:'Z	à »!
+Ö±è~w"VÍ,ªÌøë¸M¶¿°MV(þqqgj8LbÔ3Yr"É&X?Z®¨E403ÂEQÎ4v
+-¬â±A²à+¡»µV¹SÓâV¢·¤?²9çuêwÉùXIñxJ:69We<ö_NðZ_Ê#iS°;#?íÖ$Ã:ô/ÇÐ!Ú$ÎµcKHÊzwÀI2v­<ÖÎ|ySc½BnC¶híEb
+Oî?¬!GÄ@Om
+F=}c+U¦ð¨ÕÐ/àÝ:¶¢ö|t¥B«³´
+-Bâµü¶åDä¡ì
+ÈôY")ñ£xËì®B1Á$~ÕM¢íü¦ú
+×u×ºyø¾ =m?Ç
+
+×©ûºw¥øù5³b2a¸»sStQævWâtñ2°\·ù6±½6ïJ!$åntZûÁÕüæ¬¦Ï[Ê+âYF¦q>¥ÆÐ´ß»´J
+-ÔEÞó­ÚvM½ÐÞðvNß£Óß<~'QçBËÐÞÐcñ-¡ïºätp
+º]ù(éóÎãiç.m8·Us¬z
+-±¢/Z*Ûôbip]¼÷I¾mÊgKÉòfr72éÐX½ÓÍÐÁõX½¬_BÛg
+z¸°áôîòÃús>xõèÌEÍ1Í½B¬»é
+-6ýÖP%Cçh4XGîdáW(Ibã?}E/øJQñ´Å(µYUÜÉ7rõÌ
+ý±¼¢vØbþ43åÃF>
+ù=:\
+-
+-{:Ç}î "ªé<¢õ«°àzQÜ[N®{Â§Y!sgç¾L§ÁGqGÀN}SÚe÷ÑH©1µðµÜç~ÇTSLËy:k6ö¦ú#)vêýG>HÍ^A¨Ä¸Ö~vWÒá5õn]Æp{ð&iÓOc+AÄ£Ëá¡6­1íTQ\ÐP]#WXzû¡¹QÙáÀ:â-Hë¢ýqZ|óé	
+-7ò8M¡O
+/<½$ü~Eh°¿çBxÝ&üîØ
+-ÄÐç:´<Ê463ûC¬¸|ß­¬ãÚ:E¼%Cå_÷-{¼ä¿A­Û<Äi!ÞhÌ9ÒWÍá6ñùH(»sg°qeöä_e$
+-àxû¥tÔ	àÀJÏ.hzjãS§2°~ñéÕj­h]q¨öUHqóc³¶[ýÚý@¾ÂæÃ³åØ*F³?ÈàÊëÁ¸ò[/´úN8Æ»ôHnÉ|üùëÊÕO£»ÛÊüíäk8ñ.ª
+-N[oUXñëbY	rNù¢Lÿdò<Ç¨íúÅ´Éýt3æægtðL-j¯dÁ(¥dpÓÁh
+¥
+èÜQi±?@(Ó
+ø»ÍgõíBèC¡/
+E¶op
+F2áÉuïÍùìÆnLöãÛWßG!t¥¶î¶F~w>÷<É}Ñ=;5Ã×0ó:èªúh D:+¯µ¿YàqíÞ1%¾Ea'!"¥~T&Ðò¯g ýÞu|sdµ²¸¤º×:£ÚÛÊ«Ô
+-éû¿<U0A'1³ø]wÙøiÇè;ÆsQß	L~lçÔ À@°
+uy/ö¶Ï5=Öª°{àÓoa¯qZæ¨ê~ÜÍ©3Ê@Õ]»O,ÐJô<5
+@¹9?ÿçû{'¦mUX0g¾0ÅN¢ú³
+è×M1%|Äºþ¢^R±8Ì.+CZ!±ÒÖ¡´±YÜÅTv §õÍË$FJªÍMfùm[ÌóIèé'jø¯þìÌç}Xs'¨¸'ÜëÏFaò\sû¯=¿	¤Ê@ï
+-VÜGþ:U_Ek*æq%:þ
+RÓ°Å^	&¬¶ªNofÊªÙ
+-PòSjë§¢¹½Gz
+X
+ÎXÕ,D
+-ÑlûÆ-j:ü¼TXâêWñsnãÊò88>ÝGdR¦³KäÊÙ®¸'îsk¯ËåÑù
+Ò·ûALJ¶¾¤¬TøÍþ©{©ÑØ\ç*0 iFÑê
+,¤Äk>*Ïsáj´Ñ;
+©ZÙ+òlÓ~ÛÖìÌ
+-¬×ÓÇOÜY\¨µZÐúnÑÈIôåx<°Ú-eme¬AeßP@ÙmxBù	Ç0ÎÀQ´
+ {ëè°ë¶T{
+-»qå4
+øü_óbÜ
+-§¶aêikorÚêºHBß8Ùd¬©ÉlöºIeÀR~[\cà
+|(»ï
+mÝÃ2Æ°õ¹VÖÜÐtFçÃ*ÚZd
+1Ô3¢qëøL+ÜAYwtv_ñÄÊ=,+«ËofÕf%oEC÷Ùïj½b·»íÝ/ÞüX¼võ¦vHNpðá¡êZcârì
+-{úH
+-)r¸BüÜÝçÜQ¤l|«ãä¸È.Rçy4J£Õýkñò*$ÜNþtÞ|Æ2
+ì±³ã¤Ìe¨Ç>Ü¹s%¤©Þ¾Þd
+õ<-\ÞÎÔ&
+-¬2ôÚìLuv+rû« 0w¹ßIz°0­ôUÃûÀîá¢Õ¼Ý	
+-/b~»_>ÎÈ½ÃæìýòcI@OÂ:æôp6	Ô¾L"hkR`À¬iÜÌ8Dª?÷î4¢ßÑ©~.+,k$QýÍa¼fl?i´Þ#î·l¥,^ùÚýØÕ§¼©
+-
+ìjÍ+ßúºß¶Çõdn£B[±
+-µ
+d
+-$¤ëy[û£ä¨#Ä«õeÔÍO"Z4ñ×ó÷ïÅç}Ã#{ðc@×
+U6mvÆKÒêsà·ðNá DbÿT
+-ø&ìéäj¿XLRøBDÅANfLxéØ|®L,å¡
+-a"ºÐ£8;ãGÔä?ªaç
+-/3Ñdjäw~ô&vâ²Õ_LBöF@?Â2S-
+ê6¡BÖCÔ$òÕ
+fNâS"IµçvÆ&i
+ÏC}.
+-ÎvIÿºWBò¯ê±>ð{Ëu¦p×dµÞÿ`¬Üê¡é%Ûðìx¾êÂoÇ.ÍZÞpèL¾çÞX,±>§kqÊÞz&&»4Ä"À]F»à5üá·.+xÀCá@ïÆêX«0J¤W$l-2þAwùcäÚÃ
+-jÿKý³ãJ¢ÑËëÀ¼þÑK±´lÒM1ß=t
+NËøø&¾,âúÆ¨'Ü	ÝÊÂÃS
+-)*fÛÿ§Xù`0b:»óvp×ÆlvEDCLãn6½}¸¾"UQ~«P¤îþÔ§ yÿ2âÄTúãj3Q_çm²i_?»¦yRß]KY ïæ²u´òÅÀ¤ð­P
+z{§£yf¢§ÊÓz¶:÷WcemOX%	~
+ ÐgØ¨LçÿðêØ!å
+M®¿~uçp\òì7Áª½;×DërEhiñß
+½QØ¦R¬ÝXmG eXàÛÐËÝ8HOcVÐ&ù6,Â
+
+-B#
+û­K>¶éUaM";U)¯ï
+oNFÞ%QAÕ¨Í¹#ÿdF¼jfzO¤ø¶=×ÿf7Ñô4¹Ä{%~uÛg:SVÎ}`
+ì?|B+«¾¥ë]íêÿxÖ¥£`
+-¶ý
+PY¡Q÷ÒB¯Ë
+-ÜÑº6û§Í@úËzn­¼#÷eL#&´cÄ³}«&vq¯3$X{I`x´k¯ò³Ù}÷ÞN@¯jbS
+e¨d.ß^úeÏ3:ë¢üÑHá¯óv5-sWb%ÝG[cÁ[©GÝ
+û«HòôÃç+ _Ø6I×Ëö «X2Ñ(?
+->{ÕÖ~3\ÑÔË&=yÌÐ\Û Í¿Mûql¹Ç
+{«»Âô×ù¶Á©(ÅÌ<ûñbÄ¬=Ð­*~$ñdth¨q³^Ýö©&«ô×osÒ7îå¶Où[¦è.n­Gàú%j+¢åÈæÜ«61¯>m(?T ö¤	É¿õüÜù©dûaâÀn"S2'KTµì
+rjñSÛÒHî3j`´
+¤J±1q*ê0Âá¡à"	>ÊÁg )ñ«íÇµ¶$ #`^ÒøH|)21ãã±»bý1àUdz)»3!	áuNy'=3ïÃþºÇ	*&¥ÍD£aÑOnz29þ­°b¶¡RÙuõ§ØÛ³ò
+Lc`V
+û|ãìV î\ÊÉø¥KHdöº~!×
+
+N[Z­ô7ÈB3£4VÍ»,â?À\mXfÎ¸åw|,°ô@×H&Fü0ÌK[í àÐÌ´y
+&rØRThÏ¨
+-â[­|
+
+úHfÇ¶NôXâ5¿}6ÇÖ¡lÊaò'A
+ñeY¶O;x6nòGeÇn/C^ÌÍ ?ÛÎ9ÃAIÿØ
+-¢eèñ6ÂÀÑþOªÙYî«ª+'D} (ÅF=¬^~J(ßgY$4Ryl­XÌð
+-bðPÇ´úÀ½ñÿ®UKr­Í* To²ìO9´á/Êºò}bIH?¹Ü_Öx<@1jx,÷o§GÆ5ì·B­]øÑÅf¾îc°3'ÚJÛ§
+ê\åA
+Áô»¥nÙoN#WW¤d_,aeµ(ùQfÇô)7`*ö§AWµRãC~bæåPMUÙ´Y¤Ùëiaì.Wg´
+Ù?°A
+-KÛ®%;)áä¨ç	ãg%¡%&{¥ñË î´0F´ïØi¼ÜZËìYC:00MH0ÞsWôGô©üw{³¼ÝFÌá©÷oêÂ'tq44.,
+R¾â«×®èjÃÂ|¼EèSÏÀl
+%
+yó~Ç rXªÍ$÷|ð<Áúd/À:	¤;ÍªÍ::.9§W
+-Í.ÙHÆkÏ~Î@úÃä³
+ß÷GñdÞg¸Ê.õ'k!:¸I®à¾h»êÑÎ)vná
+-v.ÎÃÏâçÁ»¶ÂE¹Ýê«
+-£R
+UÊW`
+#3{sCª*¬¿",ÇÖÏ
+×Þ%{ë}Fá»]Oö·jóa×î¬ÏpÙµwS
+9»o:ð¾A`Gìo{qÙ6HâÂx<¯þ¸
+Í···'ó@ì~Ò/Æ¹wÌ@ûBÅp
+2j»[÷ùMº´tº7 Y¤kNÄ´¦²"õ/å*!Ê!(w IÐöéÕ(Æ
+ìNñqÏýÿ
+-MÿÅ%|Û;\ëÔ]
+=
+-c-ÿ8ÖCAe"l|ÓBÃàÉHÐp¢¨©
+ÊÎ=±}£G¡
+ÛJ	ô.
+-endstream
+-endobj
+-777 0 obj <<
+-/Type /FontDescriptor
+-/FontName /PSNPPF+CMR9
+-/Flags 4
+-/FontBBox [-39 -250 1036 750]
+-/Ascent 694
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle 0
+-/StemV 74
+-/XHeight 431
+-/CharSet (/A/B/C/D/E/F/G/H/I/K/M/N/O/P/S/T/U/W/a/b/c/comma/d/dieresis/e/eight/f/ffi/fi/g/h/hyphen/i/l/m/n/nine/o/one/p/period/r/s/seven/six/slash/t/three/two/u/v/w/y/z/zero)
+-/FontFile 776 0 R
+->> endobj
+-778 0 obj <<
+-/Length1 2390
+-/Length2 20158
+-/Length3 0
+-/Length 21539     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ÷PÛÒ
+ãÁ-¸»kpw
+
+gp·àî®AÁÝÝÝÝÝÝBßÙûHöùþ¿êÞ*æ}º{u¯îÕ½ÞLIAØÄÖ(a
+rb`adæÊ«Ê±0ÙY))Õ,¬ÿ#Rj 
+
+-lA¼ÿ°u :ebN`Cy[@ÆÙÀÂ`áäeáâef°23óüÇÐÖ fèbagÈØ¢¶vîfæNà8ÿyPÓ Xxx¸èÿ^¶:X òNæ@pDcCkª­±ÐÉý\Pó;9Ùñ21¹ºº2Ú82Ú:	ÒÐ\-Ì*@G 
+ÐðWÊ Cà¿ScD¤¨[8þK¡jkêäjè ÖÆ@#x3Èè  G¨JËí ËýË
+ðïâ XYþëîß«ÿrdú{±¡±±­!ÈÝd0µ°%äÜè ¿
+
+-­
+mÁë
+-]
+-¬
+-ÀoÝ !¬
+0gøïü
+
+,ì
+
+-¬ÿÊé/7à2LDmml 'GÄ¿ö'fá 4×Ýéßk²uyþL-@&¦¥aâlÇ¤²°wJýÛ,Bü#3:8¹x¸@{ ÐÍØé¯ jîvÀ¿,Á9x{ÚÙÚLÁi ½-Là/DOGC ÀÉÁèíùOÅÿ"
+
+ÀÄÂØ	`4³ !þñMÿÅàów°p|a·
+ù¯ÏtÁ
+fb
+²vÿcþ÷3I)KËJÓý;åÿ*EDlÝ 
+¬ Vf 
+
++
+üàý¿~þ[ÿdÿ·TÉÐâß»ûGi©-ç_I«÷D\þÝÔÿ
+ÀÿFP°÷3@ý§ýu9ÁXþ?ÁßKþÿõþ_^þ_ÛÿÿîHÂÙÚúo=õ¿
+þô6Öîÿ¶ ÷³³x6ämÁú¿¦ÿhy 
+³ÍÿÕJ;gDdîs
+FvÎ-
+%,Ü&JNÆæÿj¥ÿ8µ¨dëhñ×µ``afþ?:ðä[¯Gðý­ëÃmMþ@VN¡¡;"¸ÀÄðdª	Ðíï01lÀK à½¦¶+'Iø/Ñ¿À$ò¸ L¢À$öx Lâÿ%.f Äb0Iþ!VpÛþ!6 ôb0Éü!pt¹?.ÿÀÑþ8ºâ
+]é£+ÿ!pt?®úÀÑÕþ¸ê¼?ÞËç?ÞæïEë¿Ä¶4üC`K£?¶4þ/ýuÚL&ÿ@ð¾ÿEða2ý«ÝþS1ý`sÓ û_hñÿ2þ
+l¡Ë?üÿ¥·uvø{°Ù?ìÐü¿È.¹»9øUñÇ,ûG@fpæVÿ@pêÖÿ@pî6ÿØ<8÷?®8ÀKAàvÿ
+íèàÅ¶ÿ£ïÞîìÌüYMÿÔåßRÿ)#x.ìÀ·íÒ³3·³vvü°Äþ®Å?*ÅNü1Ç_tùGe8Àæà«ýÏpÌ?; _
+LNæÀ
+8'WÛ, Äù®¥Ë?\×4xõ?±Ý»ÿÁ¥òøÿçÞ0vv Æéïû
+|©üÿ~n@cÄå[c¾@ËÀ¶ßUÂ®
+û¬ì(7áwð÷Äñ]ýEùnÙò#»æ"
+¶0OYÞ­4q­ô6½Ò"xqëÚ`Mvé½¦0
+O
+åYd;;µ
+-Ø@&f8M*C®wB³4¸ôö×ûóÇü*~_¾£j8cDxÇÍÍ
+Ø.Ù^!R-<;×!Máx#4q@,qüÖ?ÊÊ±3°RBi±Fxrb'{y"zÔÃI k0¥ÜëÇ{¥ö¿k
+ô£6r
+SýDÎ%½7u#us¥Yþ6
+ò GTÇC¥ZhÕTÅêbÛï·¸ü
+=(ÅÞl£b0¯x¯®Õ)´Îky
+zë¤ÛíÅ6tÙÒ÷	W[= 
+ê³ÃÌjÒÄÌ°|yEJ8Ó4JÐ¥L-þòábÓfÐ mlÅ½; ½ûX_ø­Û:LÞÅ¢à;1JÚ
+¤`
+6(
+-ãH;S© ²îQµ/ÀùÅA÷ZÝNdÍofèÀiâºR¸¡n(}>­þúÓ
+Î¶öÖLÂ}5FU-y[«*o=h'E»ÀÏt:¼u®ZÎ>=÷ø*fnÑÎ¿/ÖhFìÞjÌ
+sM÷ÐDz2stpËÊq
+§«(áùµX³F(ù²
+Í´Ø¡pøqÙøñ²«ZY×;Îd{ûòò¿8Ï\ÐHþ)*·ªIOG@
+ÌÛÙ&kÌnZûIÿ(ik/n*é­öSp¿öìÝ[èüÈÚêò¡Ì
+-Kgùa?í»ÛOÄQ¼³
+ëçåo$/&µîý8³Ï:22ôÝnãÐ¶ùÆµ±¿¬ÓôÐWRfÄ e0Í¦
+E¿¨
+v+ ´©ÃÜ.£]#Cb/ÎªD4
+z ­c¶ë¢Ya¯ÞÖ[Ö	yb\©©-#bÅ¬¡ßÚ0ád:öü²÷UÞl|ð²<$°\êßôÓõWÚe"Bð¶ÃXÙõðÚµÜ9²dÕBõ8_Ts¸sü¢pbÔ"J§
+í">0$NÅrßf _:âß/~Äì×qUx±
+pldú"Ú
+3ÿô¸W ª5w3­­1+,Ì§µ¥
+y¸
+	-'ãKÃ¨ÿ4´®6hAæ0¯µd24&u¡ýý4´HbõÔ§+?Õm¨,uÜ¶3¼ÁñJ-þá$4´§±sw.2 Þ½ ¸X¢µLnÛ-
+r~_EÒ©È~øéÒF íÌbïäéWS>FÞÏ[þ²
+¯µ"Æi|ÅH%Óë×øÍÑ\;s3;^çlÎ~¿·®óFkßy3´RPÓú
+
+-ICzn|B;¸úÀúÜq)á¦xF5e{kD¾£&C¥8Ùzñz¯¬Ø~SüËBoFÁ,A­sU¢.ÃÉ£ÁQçã(.Rýw^­d|³è¤
+¤µÆW2ßØ³ÏéSP];	>Ø
+·Á+Ê/¨ßÃmëbÊ
+-UÞA|¸ ;;@Èé(
+§`}EòóÐXjÃhº<êü$Û"Âö®±
+éêêæW
+Å¦êÍOç#àp>A°[Ñ4³ø[?0w$Î06ÓçVKr	[Ü²lèÐÛ§ÀööÓâò÷ph92sö'³÷Ir'¦Aítq§Äù­D³µï¯+Þw?¸¨9üUBðÞËV£tÕÓ-JúZRãÍíHLÃº
+¶¨yÉèÖµÕ~åÀL¨wãª×Þu«
+-ä!l¦ôVîÇpäu­Kyr4ÃBxBºv£¶
+»|gÝªV»Ðu¤RÞðõ½Æ}Ô[g#h
+%]ÛñúúÅ%F+Ú@ô§g¤ÿ03©ÑñÂ@5í[àÁ3eÅþ4­ó4Ï¦w^D6
+"-ðõÅÉñÐÁ?Ü}c6¶MïÃ9®àUýÇ+híóuáiÞ¤ý
+v×åLóë
+-ÌEé
+Ïçú_t±¬F§H×øß }ªq J£H
+-«E-'
+-¢üÂ]Ë>µ0Ø^² ®USÿzH\¼puÕ¼º§½î÷ä[,1vÙev"+úÑå«c*@'
+-BÓÆkúBk	nGFüÌyÔ³¦ôÁy5.Èt"hoß>8MQ@fXûph&
+ÞÖT& Â"øî¼Búaßÿø]Áo
+Êõ5ð=½'ÃSô.	vºÅ	Ì	
+-b3¥6¬6²£ölýOk{
+-l¨TH,Â%þÅ:»ÉXõ(ùô0£ÝÇ4¯«É,ïø¼¥¯¬ÕQÅbmzÖtÇ=ûÅJñuè¢BÙì3¿\EfXÃ·îÑD§c
+ýèñêav;%]C²]¯ 
+oÞ¤îÇbFæÓÊ~Sâ«áÎ]lÊÚ§­bVêù¾<_¸í·Ït£¤B Ô*¤Fì¾#å·³l·1º?tSZ¸Ùs	èÞô]nTMø(êÙbUyÑô;æg­P+R¡2ax
+ðFôq+¢øñF/9§öÁ!éówqI°VS	³{@ÿËMþ¾!ONàglvøRFFóÒ&½w,4SýbfÒ¨H*º'ùGÚ	êØÃjîôëÞÅÖ$ ÆWeÂ-=Ïe­ªÑ7ªßr6ÓWº&®Ó.{öúá°LSÙÁèÍÇüÔ-B^<ùÓ©¡]h@cÍyü1Ð ñÌVÅ>~sV­ÁÙÆdgS
+-Åï¡)
+äÊeóÙùfÊf"rêN®1ó³ûì3Å@N:Ë¶%²E±âäñß×>5ÂÓÛDÑZ¾û°J¹ õX!éÇê¶¶ì¢®µ«¡ÙtÖº-/¥^Ðí  ê`0ñËZf8«Ý9
+;kî
+Çcî	híNï6_©yjR	÷'NªU\èÔð¿U«¸Ïz¦?x+gÎ+Ó»ì7Fñ~¬â²æwºèi<×*-û¸Ü~ßòÆ/ÅïäîSâýìÞRp½=/
+u
+Wn;
+v*MÁpÛ
+as/Yä<ä¸)B cÑÿqyvmXLzÚQÆ¯ô1ú<¸J:_¸ÆÑòqFÅB¶wÇØsölÓzwf¸hp$¸¢±2s4;®FÌB9§$6{b}=M'º¾ç¡ç¢"Èß·6UX&ºËÓÞw\ÔÕ)¸û³ààÿëþ@@.!Sø!Ñ&5ÿZÐÑ¾!´§ëM©ÉdªÏÙ¨h=åçÆ/µ#¾ÃO±«
+-AcÍïÉyù8Â@Ï<ð?¶
+-t°x[{øÝmÙLÏ&úÕ&ØaÛQ:`;×FU;QÍg9
+-ù³<ðÜ¬ :?UÁ¿3UðO3×ÏåÀ/`
+$ÍVÛJSÚüXÓå_!0þ¶¤eb?bM@2 Îµð$
+ìW¡
+<ÄÊ@H
+g,¨,nÖ¨N²(VtZhiØcø6ó¾¹Îºé<líþkeùWT)H>ÿÒçgù91!ö\jæ&
+S¹iÇûÛ6:¢ø¯søLÅä¹[æ./^?~Ä¤&0Öä¬Aö
+Ç
+yZkYV:kDyülùJÇ¬Îw8eáÅAÔêü£&ÕÉd[îÕÞLÒ¬Ñ¸wGýd"v£åRAZ2
+§ÛÐºI>­bñ
+²8bq
+-/;§
+-ê@Äp('Uzy-ÏáÅ97
+ú³Æ·]Ü¤Ïúj®øÁÑ½è¾ù{xídcªñ
+,,Í
+FI,%]­\5D9~ÑÎb¡Uø'ø^7²çB*ÓÁJØ"´8¤$Ü
+-èeHûZ)s{,poÈpä&`5
+È$Ke
+-ÌãXÌüÈ¸ <Z¢~O«Mî9o+©è	[&9S9 ÿ9*Ò(GVUrnvÁ'¢EÁ£ÒX©ÑÁ
+jLóM¤®h\$O~
+-5ú`°cÂ0Â#/rÝèpaYjÔ¯Ã¯
+-º½ç[³8Ð 4÷z ")éC\r/\B6%õÇ©aZómï\Öö¸ÛÝ AI;é%Õ£ýQpÛ¸\_ÈaØô]2æã@ÀÄ8²$i
+S¯¨þt¶~¦ºwç¨Ñª¢/Ð`¡uÖd
+-y\
+-vÚ¯7WGt(:O÷FECÊN·Ë©8üEÞÔÒûb(´%Mz¤PÅ_Ï
+xo§©T{
+ä6®FjèºyÝ
+-ò-q¼o+<m­V²·oÏø\¯]ºÑßñã§üËqc_2F2ê
+-Xf
+-¿VmÀÛÕäO,@ÜßHsÜïm¾''Óº¥
+`ûâ¨¸ìE
+ûbBÊwWÓ-I<
+
+-·d×§	Ä:
+úÓûésELÁr¥Q=©È4)«ë"b³SCàsl`
+r|øËÿh"îÉø(¯îô%aï´Öóx&JWw6Ùi=T³p I`ÜÅ
+Cæ£îÍL¾
+m]ìîù¹49î1ÀÌ]äÀMTå2°UöøÑDUXþ"­è
+-¨0¾g¾äÆ£áÍátej$õ»#öu\½ô»íÉ,k
+dXßQb:íi¾<Øk0Ûïd·»D6Ûê|ßw)¥ØVno«í[î
+FòWîØ»È£½w Ô,i=ÈÐô@"
+7,¤JáxsZ3úU®;,Ò,ì
+]:7
+ÝVúêÄp
+-ºßHlÚìC*Xs}¤É*
+{h0'ªÇñÒ{ÆÚæe£½
+-tY¤aTáº
+-Íi¿3ÑÍzsz>;m -X
+¼Þ^*
+-êÌ<ÆWÜxÙâZ`.\PCY!}YÂtTrñ¢¥ØËëÉ
+W®9%!"ÊÕ>¤ßïX_Òë ?[sÒÌÈ­·êû5Ã­ßö½{«1&¢IÙ_[Q7;®\tw7½{åâ×Æw>*Ì¬°bÞ¯ïH!Ý¹x8¼  5¥6áfë¿],w2ôm
+-üuçBðpT§óh="áÖ£dýÒ·vªm_Ì³ ¾lu.\üaxnxRfK`3ë©öð9jÏíø¤NÜ)×$ù^Ã{3×³ÁLÑGÓ³äø}ÑÏñ~]²¯3¿Í~½Ê'äÔù$|Í{dÃ~Â 1í­OhZQ`Î_v 
+ÙR»~y=½C+b§
+-a3|§={h´)Ê¥ùGy%¥©¸§tÕîj?	ü¼¹¼·Z=Æ2¢ò+á×÷²áS-1dùÁ1c]7A:È··Ä)¥/Ûq*ÎkZ°g )­
+ß)·`¼±¶t'Ï²&Qkò7
+-Æ¾ç+_¼Õû±·Þ}ú
+ùÒÏÓ)<Ì47/=
+-øÛ\±ýµmêÄ}o©WÁ(Uâ
+-iv]îÈoùÈ,SìÕæKÙÉìúw}³w²ªãÇ³`.±dVi
+-6¦qW1§÷Õ«44t=öÓØâ®ðomÒÊ
+-°<ny;ñÔnµÃÍrôö@*l\B-1ãûîdñy¦Ö·Ä
+Ù°èòÔheAO
+81\[;Ó\è$·ªD¼&:Nnü¡\+Ê¸ègú"¤º±9ß2ÉøÒZ±1ºTÌ÷É§'
+Éë¨î-saÄ9NY¿fé¸Á<ã9çM$oìÿìï³É¼f@+ª²h~
+ß¬9ü±¯1§ÒL¦[ÅG6%<EÀ\hó}B0*SõwßYoiÇ·Ç^jcïë ïcv»h÷¾zÀ{ßelNÙ(BøÆÓ «æÎ°ìq8%ý ± êêùNõÑ<=3ÑÅ(5LZ¢ÓZNdÅÜ4ÙÕy÷õÇ«kþÌÌ-~ü½uÙSað9s½.zUã°
+¼¡/©Ù:{Þ#jN­à´Ø¿\Ûh£ÃE¸ 
+Õ SµeÌuihMÆz?í=w¾VLð¾RZöÉ1â%röàfÉä.`×Æ±Öï}ç'ú[a7àÛþ¶i¯þÏÂ%|mn14(òQ×[¬h·cÍ~øÙa@w
+Qfg½	¨¬÷
+¤_P
+-0è»1÷áÏ)Ñ
+6&Ì¹VñRÒyÄm
+-)+UÈ4æ=ejÓ
+-n»8¥ô Ï$ç'¦å
+xßPìØ@ìÄ¤hL¦ÈI#­pqåz
+-Ò%tYå;(Ã
+9þqÓ¥þÆêÜ &[¾Ø¥çñÌÃyì°-3îñI÷ýYOû+	ÉòßfÚÃ¯UÝ0úÖÔvdG!»j~4Êó]0^R×º>¡7EpXþ>ðo9bØáXJx÷¡!Ð½ a¯ÏWp|Ò¢-Ë×n=Úãñ&
+-]z
+´¡ÅÙÃkb6î ìéÄ9¯Ë³
+kt®Ëªyç	×S¸[çwÄ¡KýátnõAZï\n®«õýRäÂÛù\àq=¼k\ÐS²]ßN2
+ER&¿ÇzøºÔ-7éÏW»Îò3¸IºPÙpK&Àß¸ÚæÌ(¡E+O,lü/Ê«P{õRmþÖÜûB»pªD¥u(p8>"NÎiµ=|ay>ÕNÙRþgÐªÁ»å?6Ül¯ó+ûSÍT
+Yük9:Äï<6ìû
+=ÀWr:IÞBIUÇÔBb
+¦bÕÌ'<
+'Vªýv£¡½
+B|z{?íÔÈ'¨B8Gµ$+Àïn
+¸3Æöû
+Ä§,
+î3
+-È£ÃìRe©'5ò4Ù 6EÏ¤ùÁ
+&;¥õøe]¬½}Ø¿òM
+-;JÖC¸¨õÂg+÷6·_mÆ	,lóGRuÛ¾wÜ·mzVIÌâ}5¶ ÿ²×ZëÆ\<Óò¸gàPn*\dK+ò\sì,ü
+-,¸rw©[æ¯1éøÉUk¼¡öJ´Ì&ëT7E¸åüW¬gL
+] Ôþd'Þ¾d£G®k>hÞ>ûÝKÌLâ¥Õà¯ÅßçßÝY°2¬ù{£O£±|'yÐ~@!ÚZò5½ò5Eë©¬ï,cãJÆùX~û¦ç9¦3
+3x{øvt³·²¯sØÂQ«Ð$;oPñ=ê
+-fÎÐ@Sì
+#^T *dÐ'd~büñuC#£
+O#Ñé3;ºn8ùÅc;X(æoÝo5_Í¤
+=e$*`-óud'°«Fïoº%òfò`ù<±øÙCw
+ßNIïEÉV
+Ðá~
+-3o
+-RùÁuóþdd.¯d=âÒÎ,QO¶µÆü.o¼§;ÍM° Ó%ÌW3ÖîE©Ç0ÌS38ç^2ªY¨:p
+Þ
+ùð:OÏª¼;Ëúù³9
+²®¨¿
+=ño¢#+Åàgö^
+QG³NkÝÊ\+¦Úüø!¼6£¸dWÆð
+-&Si4×¼¤çëÑ#þþÄõ¬?Ü2TÉd¶g=&Ä`¢¶WËÚðô}Ä$Ãe¥L\ÖNï"·×7éZÝõHvô:¥
+Úàîæ/îÒì«U
+åÇLÖ=¸#J9æ¯MYþ,²Á3úD¾~t
+î0|hwðÑB©·GF"T¨8Â-lEÇ)d0âÑÌï¯!^_ÂF#2
+ç¦ÒDìL®Û9ê&
+¾ÁmqJÿ¤1I×z¯
+B÷í.²aÕÿôJ!×Ðº§!ÉÕ7
+[¿ÿÓ4Ñ´XÕ³~«£×q{!sàj>Ì\îð+=mXN( ¼KÍÂeuÇÓ­&±kAì\»çæº)¾Ø
+¹´dë¨ñy»ÎE
+äÝ&,V»z²æ¼'l¾/×KGÙïËõ72´æÊy:§W/.ÝØÝÁt]
+î»_C2Ï²§nêØºíQÿÃ]j,EÊ
+Ðæ\È­ü.)bFW¤6O5Ä´B_4U_èK,6@ Wé´Mß¦ñ(Î~çOúÊÉGÅöøæË ó^
+²4.ÒÂ'aO3ß{ô?hnNp
+-XÄ
+æÊ
+ì6ñ­ëò{{Ô¹Îøb¡"3
+-ÿópÝrN¢»r,vNÜ\ëIÆ¾Î¨èàõ2¤ÖëçMþ¿!êzÅÐ·gá¾	Â{T¡ |AÌ>
+È=¯0S:&
+Ì>¹CWÊ}dô²o¶d\¨³Çá+YRÈÁ;\Åúbûo'
+s
+ßÉö?þÔ:OJkP
+L_¥S
+ÿê£0¤Oj\þyâwÎK!þÜþÑ±
+Ì²éÐly=Ák#¬<l3úçz(ërìêsë3¬ÎpûáÍOôîQD­DÄÑ¯´FÉâPo³SBm²¤Æ¶y}7ö*úxÄQÐVb!®§ò»äRÐ¥*
+lK5À¯HâsT
+Ý£ìÓÅ3S£½ÂösÀ4¢çW_=/×éPcR<HÊÞzB±ï¶¾U«ÜÁ'jísÙ bRæ¤!ô_
+Éo~%TxâÉØÅùøÁú¹/êá§Î^,\Ã¯TÌ>Ïç\-FØ¬1¿	øosï<0)Bª+rÂµAÍa^V&YÇ¾VUtïDoõa¶¾
+½{>uÇV£óT<
+-iùZ­ÝJõ>
+(8ùjlóÌÊmºKµzf:
+bR)grW
+ÎiÒ[2R²fµ½G­Lñ^çÛñFBI}m
+>	·ñ(¢á,ýºzÐ<ëÙ;Xi&dlqÃ¢h5Î
+-×ÒðY4îm¶ÔMß=fo©RLb
+hÔuì,¢V¢»ÀÆ2çë©<Cúr{f¬à-ý
+fà¯ä¸²gÝH3U%BÀsLöát*üã|Õ
+¯n/ÔBgâw¼*"ß
+w®¿nPÆõç¦¾F¯.¼¢«åçÅJePLSb0íÀvl®ÂÐ~G`%Çãtïy|ÎµJË}#¿`BæwýlÏnÜWY{EzÓÀ¶H²÷!M	î"pï{»ÀkÌ ,´
+ÍHëycòÄc ^lãÎ÷ØÛnÈq'Õ;<½ÔY$[Þ°%0¶ßP«
+Àü¿T¡¡miÊ×~<âçîþ¸mÌ¸gx²þûJ:´(­À2Ù¿ÞÂ$#~u]7×êæ'Q®Æ
+8Ò"ÇÔÞFölËøFS«±,ÉZfy&ÅªÎª	¦N"mL
+tÍª²ÙEß
+i§j§U"ñ]×5¦Ã"ÛB/aA
+rÂè|ûèÞoÓ¾EyYË!©Ùö.5,)¤S@LGh¦©øåóÏ0¥lLÝ>Ø´KHÙxÅE='gæÛ0ALTî²@V¯ÁJìÁÎÀz	|¶µl1ºÒ=±O[§¯:/±µËnÛ8¯O^3súî³}zõ¿9øëH`»Ð¨qEsø¾PÑQfå¯>ÀøF5yå>>ÃÙl:8T1
+à3ÖþÄbÁDË6U»D2Õ	Z²áµxzS-5ö8
+~FÐ
+]/ËÂ*nÛ Þ§Ø*¦ª×åmQzÊÚ£¨þþ£n.·w^K_M
+j»p³Àæä)H¼ 4Aî¬Ú;Ý#Ï³ ï ¬Úà£ú!·1½÷o÷ÑÒ?gf]¼]­xÑõ³$tÞÙúë½
+`aìî«
+-"Ô
+Í²fznÙvwóÉ_Ö
+4F\D,
+-¿æ
+å¸äÏû"®_½cç#oWÐ/°Õ?¾°,2
+£W;áv¼©½m¾;
+`7dtìÈóõâ
+-òº¼3Ð³G!t)ç¾õä´.
+@áu
+bDáxùw#,ñÁ"²Rw==3m=ótõI·¤OëÄ$:Þ3TáM]b)3Jë¾,ÍçYÒçt#»Ç)Ø¼$
+-#.´Ìð!ÕdE§Ä
+-s£À#)7[»´a|&{4¨|}a<Äû{
+-lëÄÃ9/lïi²á¬@.úgö+¡¤÷'x|"'èg
+Fúé£ÌÎ ×Pð
+1YÈg;2aÄ&ü&ìèAe
+-Âm?Äýò`	(I'*,1KÀ0e¶ÆBg»
+-ÍÐXK'Ã\ê-wáæ¶X*5?YÎWLíb#[g,Ê5ÿÖóS/GîoÉT¹ë¯nDÌJÈesòµH)µ¯m(x4ßçö#8yMùÎå9è|2²Ã÷Ù~Mú)rf5g}Ê&)°QïW=R¡KÛ-öÍ)B¸
+-Ë:W.{;rq=«ß5 _:x/õ¢éIêËzÂÍé´øjáRx)¥ÔC*~TØBÉïT [¿
+³¢ÌoèbÞ,½i9»¹üORO÷ÐjhÏ¤Ì4
+Ûxa$ùD´njâs0)qbÏèý2×â-G
+ñòfba ¸¦¿SÓ­º_ñ=+S.zßè¸Ò
+¬ÐéBIWAò{é0¯XêÃÑ#SËnèñ^ÅP´¥q°Eë]ª3áºÅ§
+Ç9·ÕHÏ0YyþÜ÷ë3=2
+-ºü6MnÓòÅÛY
+¸ÂßÌøtÆê8Åkûi¹c&Ñb-p6Ñ«Öê
+-V5³§©Í¼³µ·¶eHä$L¶-zìq1'yFâÇb±å=º «½|BèãµÌD­¸4i.Ê$Q*¾/>ó´í*Ì(yw°Nx?S*GHRÒhÖ¥q³ff4ôýHå! w_øÚ4ðýV<-Õ|§ØÊçµâÀïãÕÀÒþx¼¬/"CåÞÑ¤µ5>1ls;Ý×úòi¨uCÜ®_úMj
+½¬Ê¤ÉÖÐªKiJ¡ûì|í¥0±;?<$¾RÝá±9¯OÂËØÅZÌë¥mÖaZËDÐ(â
+5qE0®=IlzJk´(sj-ägÐÉ^[ÓXPÁ
+
+°8¿
+-¤G+£àÔÖÔÉF|ðü©§¦üV²ãH{0f?¸ÉQ/nÏû
+Æàá
+-©VÖµiµJõës®²m^üz¨f5nÒ\Ú·{Û­xL
+-ëH£ò!n%}KgZ+¹³tAd¼kc®äöÛäï0'ÛéOþIþç3LPuÑñ¿J?Ðþæ7¹%53´ÀÚ=LAéR
+­§xÊ ¸C
+-çíÑMcfø~67
+FE
+¥ðù*/ØÞÊó
+"iÒ%fðÚ
+¥ÖÙ9	
+-É=y
+ÿùÏááÀ­hÆ²ó·
+
+KD ^.%Ú&Ñ
+ûáJ{òë¯¦Iìò/¡,ñÄÚ7í´ÃggcDÖK¼¸b%Nj]bÒnáðé½âÂîKár&7ðå0qò¨"ÇÕw´6R­¹gÒ,7ÚíÖ
+-æ}sü$r®q.Ä¿ øÅ¨øc2ÕvÞ{I¹RjB3>ôgnø<vBz¸=êÛ{/­¶T.?òÿð8a³F%Cg.b°iÐ0âÈ¿ÊµÍîÓ;%Ò-ÁhbDÕ
+­ò÷TCY÷¨÷ÏOmÑiÐ	wã¢ ¼*YJãîÏ$T7W»°,ð\7]:U^äÚÌÉ9ýÖî4Ò¡¿/þº	cZ­ág"8ê:¿ eÊ#âÿHt¬CÕÜgîº¬vÑà=ÀTÏ`4vµ;pûØGÀÏÎ  Ù½5rA.«QbÚoQ>*úÊ©Y´v-MØië# WsÉ¹K¯æ
+*
+)8)MÆ¼Zxày-®¥¢þìÂÁ`ÆÍßE¡©%V¶Q;1mµ¹=D[Ðò.
+«s8kÍDå·ÚO(p%+
+Ï¹%úBø©øªZ9JCÿpYÓB&ÂôBt
+iIRkN\Î«¦ëkëpáó×Éñ"q&ÒSpßúf¦¢ô
+X(ÎÒ/~%
+W¢HïâÈLU[ðlâ³^
+Å~BøÄ
+&iÒbY×M& vé·ÑHÌñ­âEIõÌÄ#%ÂÐ'l¢Ío
+-Gs vÖxáO>jÐ Ô7)¼ä¾I'#~A\EÎPíé)9¶fQ2ñ|×)gM²3A´ó;@Iåç¥CAã ½
+-á-2¸»Ë>ª]³ãÑöúÓ¡Ô)kÌÊýSBS:v	:çÌeVoÍ>&!AÚ
+&b}cb	ÎsO¡L_~1ÂTß¶M?y¾|ñ­èÔÔ±²Óf·º
+ÞÂbwÅÕA!ß¡r/×&;Ð?Þ²ÅËÅºþêÏpB=ÖíB¸N7gúARúeÙ/pÌGåb<&kÁ§
+þ2«-ÚHÏÜqoý3ÆbÔö-"&;ÐR-W0¼÷âÜMQæôÇÊÅRÍ^ã{±h\©(s­÷ñð#¾x¼~BÓ¡ÒÃ
+äø:éØ%ÙPP:i=2
+
+	­ÐäÍGvé^öÖ®!JlnÕÙwÃH8·îÌÐåCún¤[ü¼M¨
+-Õ¼Ý¹Ô²
+#Sj| úÛ
+
+-M1-]×o
+-NMDIï6äÀÖ*À
+´ÛÐ
+-bõÉ
+- Î
+-)vìdXÅÔÐIª$ÂL#ü¦!{ÅÎ
+Ò¡ûsÑF
+O
+
+ly®à,ÃMÿ^»õàãÔf·xÚ×FeUóå¼pOCh"
+Ã×d=~©Ä¦×M;
+oAG<Ðõv¶"Ý74ñäu
+	dÈ(Z«^+1ýÃûQª00ÏålÚ}MmÀ÷
+ñ0Òe¹²××Ö8e´]
+×GTÄ¼$ãD&]Zc0ËP%¢ë
+©ëÄ7èX×WcTÚAÄÊÍ>Õ¢ÌQt¤}ª¤øòcCÉÙl,£Ã²¤õ
+-D_¬g]µØèØDÃ«Ffö ÞåA1
+i1	ÌÂÃµ¢\6¦ß^ØÛ
+ú
+ ø=Fö6Ê-]Æ[×RË¸ ÀÑS©äåq­
+IÛîo3SwìÁC\T°f
+«+Þ/|]ä' zÓµ	Ù¼áÀÒ#ÏÞî
+;k[Ö8WD¦k¦Ôþ
+-C?ñ¯F¯©/ä¿
+`»0O@4+
+'lºcO¨³ZÜ¾sÔÅ>g´¿#?v³ÐhÛ'Qàq2îQ9×²½9´ìC¢Ú´'gí`P
+Ä´5ø~ùH³Nµ>jc'MNî£ô®GJj!
+» 5?óîB
+)	Q
+vA@ß´ò'`¼âLcüÚ¨æx­¡6ÓTÌ
+µû}s
+£qd"ßöé!¿c#k òår ÛÖ¼ÓüpBgQ¥ÓH
+ì²Äá(Å3t
+ËB}ðÖ-Abxì
+¥»{ÏñnÚ¹ßrxéüUÿ'g'\þîUtW{BÄ¤Åº,.f?ã~ïkq¢ÜvKö/{·q|?D£Jõ¡î\
+$·6Ú¼7~°¡­Ù
+-@­ä[Å
+-J¸°¾§ììOFdë3UÄå¾Ý®±Þq
+-ðÃK³¹]
+Ê£_ä>ù»R?oäùæNtl°¶4	£Ì¸_¾k¾¨)mº¿Åè-$êÅ 
+}«i³2"2ÑYçëfrÝºsVøöÅq­çGá,òN»§ÑØmÈ+G;W
+'ºkå0HÎ¸gÖ¶QøuõÄü:ø¦¯A51Û@¤ È¥ln~Ò[ëWºÅ	FYE~f'ZÑîÝ ?m^CÇ<ÇÃ"èº}Á¾Z¥J
+i¦Y]]·[?ódË
+¦<´T­}ÊÜªº¡PáNæJøµT°Yý$'õûÃ	BHþèX÷¿fV(¾µýmXÔ<îB¶N5ç¢ÁI¿ý]·õ^FjÁxlÝÙ^µÁÇÅÛu£ñ([ª#
+vµ£J9íJÔ
+¹®©]x|#túMU<övÔ>êª~FÞÞý@óT%	Y2GÐd¤AÚë·ºn"àg'ýaÄHvÀý^Æ¡d±]j¿¤T¥XE÷ÞéÍÒÏWµÿa¼NwJçÇ
+e¢
+çI fjý¡ÛE D¾V°U
+ZìÂrã}
+s
+»=q/çN&5¾1[)MçO
+-¶©iXhº	
+
+u:Eø¾Ù¤ÒÙæ÷ô
+-5qhpèèÙ>ÇäÙ´.Ì=öàÀÇëÏÏçÈ¦¬^Ô÷Ê±XYS¯&
+@t
+-Ñ 2Áóp÷±!<R¸
+ò«3;
+-ãàM4Ô U29-gÁ{ÞÏ´%Ýü3gw{Qzk|(ð)ãk°BáKm8(Ó
+3èÚïÕó
+-?° h7²s«­ppqþÌ
+¶3$z»Ò
+¼Ò¿i"©FÞÎHépl'Ôðhíök7ß
+¶-RºÁ¯Y¼ã^éHgùUxÁÌ&wþPxf|È/.¦f,@
+-GÖ©}Zúxi.TÒÉKmz<j3þ]ßu<*cKÈýc÷ÖðNxhð# ÅÿXÑKúv2µ_@ò2ßëqÁ£ß/Ú×/{h	EÈ¯bd¹Ùè$ê5õ  ÆÝþ«xóY¢Ehëö"$û#
+_Å-¯ÑClÇâô&mÛ4Ã¼þYâô Obò{:Aþ_õð:*x@±ïî°¾g&ó¿Z&¶#NhßÖ~û¬;e/ÉM ú
+oCD ÅbkÊP~p ViD¡mÕpx |à¸xhñCÖîBÍ~æ¨Õ1p0ù¬*×ßvY¼q¶{Èªå;ë-Z')¹iJÃÓ´FìwÝ¸Ì
+~EÚÂÐbzÒËñOr$pqñy;A¢5ãÎÌÔe¿Ô¾PÞÂ?ázJÕ	Ó®¿qs¦-âøãJ_:üwÐúa{Ç
+^´
+Yµl½ähÞ8ð®OxìXUÇhÇ5Br
+-M°>Fü6À>
+¼ádí÷zó.a1ûèKiî_N?WIrAK¹
+ø>TÔÇaÍ¹pªÑDüp `[q4ËPºH3¾ma¶ËH­|ÞÂ»@Æã(Ðh¹¤³çBÚlÓ
+£Oh:$àKW K"åØ
+_iÀ¡_¤®×Ì!¸x®±ïØd{k{%¾¬í2¼VYjw©Çöîî'äWêhô+&(
+
+½JháÝ»Ý9/X
+-Wg^)×ß&ïcÒáòã¶éÚ"|N]<ö²¾®¿
+B%÷Ò5¹|Þ&excd5AgïåºO"áüø5¸
+-b U[JèÌvÁá&ÄG@NÜè&ûú¤¬IÐµå´e{ü»
+(ö·Û	dß"NnÝiqâÏëQ_xc!Å,ï«^pÖÏ²;ÂÏ·Ícù7ìoË1m
+Èì10°ÊÒÓ¹°c
+ûV/
+W)mÏ&äOYçØóuá3DçO@PL}¨N6Øµ¨ ´h(õÆH
+öïÿpHìÑÕ½â\«`lÙÝ\föö3YZ£m
+Eù±
+-ëó´ÑzÑéÔ³!
+Êvà³oRdIÉ6
+÷ßô¼ýB½CmÎbèúáÑcNÄ}y÷íMÜh` d^x¬ÐÙÁèT÷ß0DUdà
+	Ze¢ä$ÆVÝM
+-Ó'ÈNi-Ýøhjäáaj#<±µëi	¬ÙØò3I´ö&*¿7ÕØ«Rbhõá¸&Ú¼ØäPAS3$¸Lc?7r¯¼QsÑ#RÆr´É?£r§ùÔV6IÀ&hmAsvõ9mâ4U§$sh~ûµ3þkT
+còJhj	\fpî·P¸¯©
+-y*
+ò1P~J¥ØóðÁW+|%Tß\ f+E#ÿ WÜPÁ9bÞ}WÊ>l÷BÅHÂ»©@8£61²Í¤³$=jLÌBQ
+-©Ï=)ÂÏ?
+Õ¼s®g	Q¥ÅÃ%zæâpâ6~Fäx¥ÓjÖ`±ü5}°&ÏÍ#ô´¸):ÿmKD0ÄÛ [·s!ÚLiâ{É}¥>²þïÃ>ßT×ó¾ÑA}é'VZóV/%¦R$¼²ø'E
+zÞ=iq#T¥ ÇFE£w9uÕO7£ £C©Ë_¨íîÿÈ5Ì&¿VþøöÍO
+;ó'c0òÆ
+ÂSÜ#S2æ«.õÕ
+8£ã*YM±õü5½qÆÝIýMAñ¡ñ"§Ýbä}æí×~ÆÎ
+oüe£F
+½tü/^EåZªB54.ñ
+-%É½6!EOòç=°»b÷UjíDÞcÒN [»äÎ-XÒÎëtTyoöµTS©[µþ;O(÷')ç¡ÕÅýá]NO÷kDC¼x,·Ü÷AeÒpÅÅÖóµr4ÒFí¢Øq´kÏ\ÌJ¥	=8ÒÐñDMd]r®*hO\^m~VFC
+¢¼Ë!Ö³;Qæ»F¢²:tõN¦§5îúMÐ9
+]Ç½~ÕUÄïT¯öÐ¶.6Sûd{×òuZJ
+-ñãcQ4h{¦âôà7¿
+-¹VÞë\Ðqë2+¢%RmÂ1üÐ4F" ø8ÍÐ¤V¾ôñ¬æú·UÂù7Ì¹ÆXÅi±=>_¶;^UÖðæ¦?~¬Bf}åÝ«ìP¼IW
+ÅÎ,©þÖLáÍ_+Û«¹}?4Kd-äùY
+-=øÑôLùØ
+2!/'ÁÙ,Sw	Rè	Húfä^^ ØÏq)ºAÿîÇ.Ï²W2U³söD­Xç
+u¥©²JúJFëý²*½ÀI	Ùò»#þø¦»uÜGY§¥ÊOv;¨Ú©¾
+#ÝÃ­²zá\
+[2®¼jÅÎ¿î6úoq îuú×à ¡ñSø[-;|×^SÕFÆöW4]3þà­ïô©i|H9làã1JÅ²Q4#üå Ò	{Óa= )!ÈÅJ-E
+údÇg-!\k´¢DY#UVßx1êëÑð
+-h
+'Y.NQNìË0ZÂæ»W>ËH6òt-×¯mç)\~û
+äòyô®$Îâ&¤Heæë±¾ôèÕª2VIï·ÊüØöÅ®qî+¦gíÍi&ýÒ¾å[9ñ°,ìI©
+céÀnPb»<Ôp¾àäF7Âv=ÇÞå(_û$iLýzÍ´6rãhfIrb¦
+ÒprA5ZÉ%r_sÊE£ÓÈõ¶EM:'í¡Ù±è¥
+u.÷@
+úÚ0Îðyö)2*4J»å/räzBÎÂqñn¯_in ü6wyÕ4ÏÌÄ5>(¾
+-Y½Ýw\
+-·.'ÆîJvzúAq]¹ìI:20
+-éTª¸Ö
+-
+=­­ttùÆCÑÌÂ6¡á4Ý»$TèJwÆç"C~Oûö*#h/|SG=æEï¶²·O3ÖrI<o3Ú|\söJ¥RÈ		 åµ%çñ)BktýÊàª<Þüå*fë*áËëtJã#N9u<yºîRsfF{iÖ	Î[iÉkÅGâ_ÎAyÐF©»Cjÿµ§"Ã«¿d¬Ñà
++âàð×¬¾'JCßÛ5)1ò¸³~¢\ñPõ¶|B>þ:7·.uZ
+EÝ%ÄçBÏçí7{÷þâ!ÜÇoÈpúæk}Æ
+÷þK¡ç
+Ü-Kß8ûÎb,/áùOCõÛÅutG¿«{§©¤<Ö¦ÛÏÇjûvëû¡Î´(ÒG}<Tô|\º¢=¨Þn¼ìÛÓ-2Â®öùÍëµ.Æ&
+-§`ÖTéhVßOÔ|é*½n%ÀàÅ5BòøÀ]7sÎÊî¨µê<Å]nNZ=)éûM¨nÜ-$D¬º²®9ðàëàYX*æP®üþ41áåëP2Ý¤Qö%7ÏÚ@¼ô~ 
+T­n®Ãâiû DN´
+XÝºLyÁS1ÊEöÑ`°{Ý+
+­4PtÎémP,)ìö#ì
+$~ûjw2`cY(ð\â!e
+«^k'
+AýôºúË£ïaãñ£òI¸ª¥-é ãüa>â'ÁTï"2Ýiï9
+êkµ«RÞIhWæPÑI«
+Ï}µZG`§÷¯I®ëç^\Û{WóT%úaw)ñ¼ìv3Í¡ê7Ï)¥
+]£YÊ¾R3jÅFî#âàÖFá~Ûp~B¦hË*ý
+u
+-äÏ
+
+»_út­î?Âà ì8bw¯a&ÏÖt¤»Æ[ä ÁçEôj·ÇB=í29»¬zÉÑÈî¹%å
+§ÿÑ-ZðÅü¤ùÑL*:¼Ú'Uà-_ÿ+pNox:c¿|Ø
+h1Ð@â¨¸¦`
+ª5tZqükl)
+-
+-§æög
+-78®N]µ´(DJÄ©o¤«	kØÑ<ÈÊ¡q-YÐ6¾VÞä¿h®ú2ä5G6ÚA?®Ç-XGVèR eÊ»ffOq6ÂQ5~
+-{
+øë¢_m¢¸×÷:½s<\jéiÒu
+-áÐ½
+-FDl±
+-Ò±ÚÛ×ÚÁd@
+ïeÕ@§ô.&qÜpÖÑ
+M4i`+øÖa
+
+²½LwéÊßÜÞhúj/Ùz
+A«²7LÜ¿þÞPv?HºK*ØÞvóÈY,ý~Îz0[
+-Eç^¡NÍ\¹HdÞ©±¬IWo@Ø»½¢ë2ëç
+-yÀÛÚþVªÓÑæw*¼¥ÜP_óKsáÏæî
+aÒ#¸í¬è½±%N
+¼uÖ®¾¬x|¯ü½&Ëqæ©ì
+|ñ¶_·Ñ97ó|ì);d
+y£ÍÀ¢ßLÛ&ÈÀ0ëHá{
+U';%î^Y<PÜ¦äÆÄ£Å¤ô
+%ª$&ÃëÇ¢ÕqÌþÝãµtµ÷º²óºUî0o7ëÜ_Ë3§áUü×'GÍI,èÛLcúçhàý'ïw
+çs
+­%m÷ç]CêÂóP7Úéôè`³ò]ü{Ö2ò|yvò{n6Wã¢ÌÃ¿Q°J
+¢¿Þ!§TGcXÆ
+LT hÇv¾ÒÞH®lþ
+Ó5vJ ¢vtz>7ßZìRJ{BÜ¡yÙJØÑÈ¥ar%
+Õ45^5Íéáø5#\ø°
+vâüÓtÁiÝÐTT¨fD¤aû7ãäáÛEgtÐ
+7I2þcà*N­lOCÎgCHL%Éh
+-!.dEäl`ðîyâ ãÿwío$}Ëþõp­¸þ,Í?5WèÓbüßpû© /bB S½ÑhF!W­ÞB
+_Q~oëÂÌ¸,Ëz.u/Rt¹{÷HÅø±TN"øMÜÃ
+,wÍoÉÕ
+áßÅz'ÁY
+1ëlêAÞÕ7óµ#¶Z±ºâIvÌµøc2Òhw¼Ûí¸³Úûy`n-J»(6Çº<äÆ èeúJÀþÿ')NåS*ø
+`½=ÂUd«ú ó
+-Æf´¿µ£v05ãä+2ê	9ÒI]®éÃ7ëëû¡ JU¿©ëy®f©s~C
+«70-Ö5u:_çå½JÄ)!ZÃ
+Så
+-4ÎcöqoÏ7ÇÜ^Ò6½[s1ýßÉk¬j¤N«·`ÜÛÇ,üe¹v
+-ýõßYÜW¯l¥æã#	0¥ÉÃ+76n¥vøèAüÀë´xcÀÐõfî¡57Nøÿ½¢üp
+Ö÷Ì_á^ºñò½>N,^JSUn_þP[C{ycy:âP¾¦v¤S ëòiÝÃ÷ñào#Q­5x)ÛO
+ºJmùûÔÉÄØWì¸CÉ
+QÏUXºÎÒÌRë1zB	ÆWów>c¡ÃU·L;[À)UÖ£ÍRÂñqxÆAüÁF8¾|D`¶
+æ¨ô°³»E¤þ\õu×Ç sÀ<L3?Y»xqØ¿ë¹{bÑu7+úùÞhØn9ºä'}`··LéG
+-Åu°T/ß´ázY×¯íkFZ«m©ËÙãPSP((Lg$¬U­ZGLâ
+²Ü]Ùcä,/4Ë÷hù­
+
+-Á	ÏSçHAÜóÒêÐ/ÖúùmGÂIïDSÌ4s¯
+5OªB¥5 ÏÐ,	3ÔÑbo÷ûÿ}áÅf
+öê XÌÖÝé;n÷Cy\Õ,Æz
+"gµê! c`];,}ìRp
+³-h×kê
+ù7|ùà
+-IlguÈ²BÌjÒKÍË_f_vôËoHÖiù
+-ù¼
+îÏ²Ï8{+dtg^Éi\aõø0°k ~O>j¨²HîÓÖ*	ÍºöÏYH
+.(×j±ÔzZb¡z }bØ¥9# ·¾r¿`ßM)÷°¼ÎeÑþÑiX¨ûyqê¡Ãf#·æëç®ÿ1B%Ðjïî 8@
+!ÄÌÞ0ÿZ55aQQËaºÓwD
+RØU½¥KL¾z[©QxgÊ)c×)ô®r
+6Ë,zQñßúiWrðñNwj<£?Ve¾_'3ïX[º>aØ®U¤íä(1ZW([DìVl]ß,í
+ãx½
+Üº¥þ|$ãQLââ·àä\aq¡8(Yõn¼
+á¬æ}
+é8!íìU¢óe5jÑýßû'üÒ8¤Aomup,:{Ôô§§«2ÎemX.jîFªçÀÀÓ£°àïFËZ¶Ñ©\© ¾ì¿ä{¸b91,Íèjá Ø¶æ${£ùêóy¾ûeÄöý
+8zà®2$Êö$y#
+êÖläêBµÜ³¢.YÈ¶5îxÂKåKä¦¢JCBÈRIZÁyÛÜ²~	êâ%¡þñ¦³cZäÈ
+6YûU3´LvÊ3çuxzÃåÅàÔÏª]
+ Ìa
+-k|k5¨ÿ&ï<$xZC½©xK^rÑÎ\óÑni²%§6âUáyGNsÐDEKXJòÙßFáå³Îð½cCô
+-)õ
+-G]
+~Ô(TÎ§ËÏÇqµm¬ßg
+ É
+67i #e7lx¹½ZP$Àë§ç,¯CÜkÓ
+2÷tJö0ú
+£`Ú
+E\ÝügVK*:Ív
+¸ØÐàßWì^ÚÔC%½úëR/$énïÔ³
+ë±ðcS MÌ2v=é?ªý"*ì´òìOw 	ÍÐ¼½ÛÛõ(§kèû·
+-¡ÍD5!i+?Ý ßÀü³$EOö¹A×¥ÙºplÝ.;,a¤LäI8';Ær¡öéDCÝ$Ü\¥<x³
+Fü
+
+Òrzm©Lå} Úìlü/0ÔÍ¼VÌÝÌÏ¥q
+íÁÞw ËÍì7[^r`¼@³)¿^ §¡·ä¥C·PVeïkÉcXäc¼@Ôîê+åãFÿêE±®¤@ÉULõ>&¤Ì¥ä{á z1ñ_ºØ=3b
+-<
+-°ã*0L½£µF¿cÈÏÈé÷óñAÿijCÞØ©EÔ
+ïrt\´{þóo%úÿ $O÷9sàM÷BüB½$ÈõP|Î±{
+
+-«ðY#ø¡SÏÐ[Ñ(¯áG1´¥½x¸¤¥Êâ5ëªB,ZÕ
+-ew
+-'ôùáðÂ°"J"¬.}Àíñ-ûÓéóÍ[S­
+¾£h]âQ&½0$¾ 1m\l)`Ã¹q
+-'¤é;*ù~ìÑPøîÍÉP÷®>qS¶ôê·|Ü)M\
+¢oÛ[1Éss*K~ÔéØñ×¸{Ïqï±¼×Ú	fÒÉl¨¼x
+À¬,ô¯èµÞàVó$9Xª`j¢Ãf¡(6Àêä¼ìÁãL_A%ÜFÏ)`"ä³L°e=pÜM6
+-B'Ãp×æZ
+¿
+KpÀªd¶¹H
+-|ëz
+$8?÷Ï¹pxfâÌ]%[Ýd{v¿nÉ
+ð¿Qv´Sþær[TÖ«-nÝif±
+*Á]»{#^©9Ô/8¢(RIks½TÃ§æª'OD$kæsÛýØÑ	õzPë
+©É6åóa
+-<nÊÏg¸^
+À6lÐæþÊcÏ)RÿIsº$NáÈÕ
+¡ñmÆE8h²
+ÉºKm;­©·6À)ú|Î¾¨#ÇHÄ´
+-è3ã5ááÿ
+¥ÃØ<
+-Ë¿{9hÎÌ¡á|ö^¼©ël|Ø?èE]Á¥çç=`²³`'u
+-
+-5 ¬³_ÔÁÛäÕatËH`¾dvòBåAÊçÊmÛu®²3¬=}ÖP¡§
+-­L¡¯?¾ZS
+êÝÊ°åL»Ô²Ô:¨
+¿dê×+Y e ÜxN\	iE'¹­hàíÏmàG¿ç'çD&_¿ÜÄWye©PB)Ûè:O3Ûr!¦.XÊ
+:û
+-±±ÅÈys?P©æ2HÄáÍ²ÊüQíü+8ï Ý ¦~µ(z*Lö:5Ú3hH§Ë³Yvï.¢
+-¥@üZ îv=<å}Iò69SY
+-tþuÔgÑ&ýIÞðÅX¹×(Ï
+ã¾ÏÊÛSÍ-_®öö·½\±¸ÅùëF¹Cå069ÑL]yÆÅ
+6¨Þ.0E5Ö9~MjdáX3Ûa<¬ZCg
+ýwi
+-a¶TîüÕ_3¦:,Þ)Ó<ü±@
+O|R1ûyU]}ýc%Ò@ºÐêÕº&¸ªJ8òO«B`IëòGÓ;u:
+ÙÌmèOÆ!É]Õ6Õ=ÊÏÉHf6´l+õgî³
+-Ü»,9&/Ü-¿f¶x1g~á^ú:êmZZñ]
+i:U;î
+{¿Ç¡hø¾\dI8Ð¤öv±h¹
+1^ürIòÔG9ú­äLP
+¦ú_^ïêcÐâGSe_ÍWâCð-4õâºgu ë¾
+Øè²-H	.9d	5/àäGÛ±e*5«ãf)Ðÿ½Éû¦ç2 ß¹Íâ8á©¶êùíâÇ­(î3ø
+>ñIeEA³É
+ñ®Ð­A,e?q´<@Ý?Ù¦» ò_f_üoGQê..Y¢n#j
+téÀ[x)G¶­²pèÝ¬g£°É0cÝaÿ
+-*ÙAh²Ö1/Õ2Ö~_ý~·."ï·'ÑüÊÞØÅ4Ñ>u>G
+Ï
+ÇÁj;OwgÍÞ³bq7ië®y®ÉÊ7ºå^¾qÅ©¥|uÀô­¾¾}iÝ
+}Þ~Ð[W_UpHQe6sN9ç¬[Uyê[éíwâ4
+-üRõ¤ÛÀÂêÀîÌÞ¿ñeÂF²©`ÙF³«¢£®gÍÕ}ø^þ
+ÔÐ·Õ[/Ðl-Å¹BÄ|#ç?Ü¦#ºS[h /K
+¼_e¶SZøÊ+o0&òZMýAÿÚ¢È$2´ØÊTSìª¡Û¢ÊÞ&¦q?H6£LXÐ
+-6WwÖÐ©öÆ a)¦I=Q÷£ oWþåã,tosñï¡»ÖRfgø=®ØÊÿÌ°òkÒGr! /zÖ@ÌÒ®*u¡PL6XD×
+
+-ofBÀñö=Þ&ézG·èðÞ/¿¼QºímYñ{ßæ¥´7@úIÆTâl­äàO}ÐÚâÐBGno¹zIhké`æà0d8MOÌÔÛO0Xw!/¢
+´ð_õdsb¦G"¨hí£ ²¶rÚ©1÷v;ÄG`ß
+-I:é[ ·ØÑþ¤=4ðÇ8{¦cEÑwþiU<wÔÖíSËýh_+mïeBC>æèZ.ü$"\úì1$+eã,÷»ÈÊ#Ýõm®ÜVÁ¦{jr©KHµ©´·ØÄ
+ã
+
+ñëzþHÛ©y
+íN
+-Ø§»Mcøb)"ìn
+xòd15Þ.yÑXñ0ÔQ9Ò9íá/é
+"ûÄ¢âðýë®OÎ1òµqÀ¡ÝâòäÈ~9ÜTH`<îD}Èôs-³ûfT5:/é["Øý}¸EÄ©xm	RÝmfÀòv7TAö¸
+
+`Á/O[YÄSm¹2i2e+go5OÁ»-£_ó&?C];ÍÃøEÿÁ÷¿4ÄJ¨X
+£xCvºB8³fÛ3yÙ{õh
+Y\¸îu-{V`û<Åûi²üÀÈÚðô¢ab¼2øÊ¿gh¶;(9P
+/ð&¿ì}Ó.ÔæN¦=÷9±dÔH	K«(ØZ%Ùï1jÖ¸¦2ôòØõ
+!ìH
+âÜÇP®òz0ÑÎäSJáûÖìãh>ÓÔÅ­Äaç¯vúKe×4ÂR
+CÑ®)½dÓv
+Â3ªz¾±~vØ,äã».CÀ¨Ö
+-]Dí<->16Ba¶
+A(2Kãì¯=± ê>kÍÛßÛÊ"ÿ=\ùÜÀ¡Ì°T2´uHP°÷oø­¨ËÞ^aâØDBK¥È]¨ÒçVTHèºôu2àWÞº¹Ò*l¥]væk%qGåÂ2ËÃêÍØAÅÕ[ÛÄ
+À.?¥(ydä=¼aþg1f+ûaöCPî« d¶úÆ{0IæÙÞüx©ömÁÚý½øZ	1½À8:§ÔÐ_îMÈD	+®Æs¦%#ñoºùPo
+
+òcbZÈ<%}GÎ]\ÚPðÌÙÌ §â{ºá3Þ4ôB_r¥±Òg
+/¡ùÍk®H¼Cõþ¤ªvyï[l¸Z+ch1ZM#ë¢Øý§ÉBé=ß¡/ÜÖø²Û!ev9
+VÎÇÀ¡þs­V«2Úùè	p.§>lÈj|ýGzh
+Ùõò@&;Ö6®àa'^"-r©»¹?Òyh¤å®
+-Ó"Ó`ìÊe¢#`V9
+µr&¾Và­Pt¥¾)s)äáíÝaðªÇµ©ª3óK]+[-×5ÛF¥!lñPÛ¦È0
+-I?6÷#CJPÜÌb<\!Ð;8+gu·þö¬Ê+Ü´·¶åÅ+fÂ+
+'ûÌÜa
+ùâ@tRtÇ
+ØÂAÑúã[
+-endstream
+-endobj
+-779 0 obj <<
+-/Type /FontDescriptor
+-/FontName /HDQIKI+CMSL10
+-/Flags 4
+-/FontBBox [-62 -250 1123 750]
+-/Ascent 694
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle -9
+-/StemV 79
+-/XHeight 431
+-/CharSet (/A/B/C/D/E/F/G/H/I/J/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/a/b/c/d/e/eight/f/ff/ffi/fi/five/four/g/h/hyphen/i/k/l/m/n/nine/o/one/p/parenleft/parenright/period/plus/q/r/s/seven/six/t/three/two/u/v/w/x/y/z)
+-/FontFile 778 0 R
+->> endobj
+-780 0 obj <<
+-/Length1 2619
+-/Length2 14068
+-/Length3 0
+-/Length 15555     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ÷P
+XÓ
+-C°à:¸»{pww
+ÜÝÝÝ];Á%8A·`Á%¸ëìî»É~ÿ_uoQót÷é§õHANÐÄÎ(fgëLÇDÏÈ
+-UVfb02²Ð322Ã©X8[ÿ'#S::YØÙrÿa!ì4tÉD
+A²v¶ )k 
+ÀÌÈÈõ?C;Gn¡«
+	@
+ eg
+t#¶³÷p´03wñüï#Ò
+-ÀÄÅÅAû×q 
+-ÐÑÂØÐ kèl´1Zí-Î
+ÿqAÉkîìlÏÍÀàææFohãDoçhÆOE
+p³p6(®@À¯r6ÀR£#¨[8ý­P¶3uv3t@k
+c ­è­	Ð b(KÊ äí¶Ëüm@
+ø§8 &z¦Ýýsú#
+Û¿ÛÙØÚzXØL-¬ y1zgwgZ¡­É/CCk';ÐyCWC
+kC#Á_¡Ä 
+ÿÉÏÉØÑÂÞÙÞÉÂúW
+¿ÜÊ,jk"lgc´uvû
+#ÐTwkekçfëõ?djakbú+
+-{U[
+ ¤È?6 ÜoÐÀÆÈÈÈÉÈ : îÆæ
+¿T<ì)~A9øxÙÛÙLAi },L ?p^N®@³£
+ÐÇëOÅ
+ÀÄÂØ`4³°
+ûí
+$þAýw´ph3Æ	ÀøëçßOº 	3±³µöømþWÄEµÄ5äiþIù_¥;À	@ÇÌÆàââp°q|þëæßü/ù¿¤
+-ÿ÷CI[S; ×ß9÷¿<\ÿ
+Ê¶
+-ð_9;Ð8¿§_Ñôéÿóüuäÿßèÿòòÿ:ýÿ7"1kë¿ôüÿè
+-m,¬=þ± ³3h5dí@
+bûMÕï³,ÐÄÂÅæÿj%
+-A+"hkfýo!-Ä,Ü&
+-ÎÆæOÑÿú roma
+T°s²øuã èÿ´tÆV [Å	Ô­¿T@ÐNýRÔÖØÎä×ò1³±
+
+
+
+-=àAÆÌÆðbm©	Ðý¯á0ÐÛÚ9 @éù Lí
+á~õ
+-À øKô7b0ýF
+ áßÀ òqDÿE
+ ±ß	4£¿3Aâ7b0HþF¬ ©ßÄ.óØe#»ÜobÿqØ~#»âobWú@ìÊ¿]å7UBõ7Å¢öØ5~#»æ¿
+Ä®õ¢6ü±ÎÚØæ×eø?)+(&C'ÐY8Yý>25ú@I9[A©óo9Ë¿ò¿Wë_(&ãÈ±5h¨þådý%±±ù
+Û¯ic0ù(¿ûû
+9¸6ò·(lÓßd`úü¥´ø
+ Ë/èúÛÓ/Áogl¿Ìí\
+ÿð20ûâ5ÿ
+=¨7æ
+öæ@Û?,@2? ¨a@P¬þ ü
+-¨Z6¤ªÄoÏ, Ç¶.6F¿®9³?el÷;$
+Ðÿýo5È¥=èÍµýOûXþþ·y¬ ØACba÷ÇÊaoíâôÄáw~! Ó_7Ç¿³þÚ9M¬ÿËÀÄRýQm&P¿}^	' ÅG
+-tÄ	ô8ý¨¤NÖNæ¸þt¿38;tk18»Ùýq äÃåjëÛ#:íþ¹÷øêíù;8'O ãßTÿ¹!]
+Awþë]ÿÃ}WÝÆpKóvÆ<ÁõÁïêqÝèvÆ¡Ö7»"â5¿³9/ä{Ë@gO;Tc¦),NÍ{ãRÜM¸ëôf¬¥Jä9~Ù:£+¹¿ì5ØáMr¤El¡&(â#hChS$©Ï?
+pô±ìÕì=w9íiq
+l %7ÈD©¸Î1¹]GàQD¤Î_5ucQ
+µÓ]T$U'Á£,bo
+>Gcß{liÇf|]]
+Î
+üÆrñQº¿½:ô=6§Qîhâ6zB¶T¹ÛpyËél?XþèW¨éc#Åþ+Å4×·o¡Û5Þâ
+©5'Ê´FÃàprÛQ¹ñÑ¿ 1öv@
+-.µÇÖ§¢ñ°ö/Pt)¡zGFÏÞ2¯Ai¢2~ßK
+ Þa#®AÄxDò½KØ(XKóÞ
+#÷Döâ°|¿ÝÝüugJ¸(UxÜ¦§´$80íº&hiYØT}O|K}H4"HpÐ
+õíIñ|³ 8ã¥ú±F4ÀõÖoð&´
+=
+¿>So¿óä°¼ÀkÖO´àÊù­×7´=7>Sûqóg$Û5N^öÄ4s;F]ÓÈQáý­é°f!kKºkä´SFo¾VªùN	Øè4üì÷åöA¦»ê ¬®ìf@
+ÎÙñÞ6l
+Ub¼°¢q1
+g¬i*¬¶ê÷
+ôGÖ¶ÙaADKÀG3«<[+×Äs%cºÏfp5×Ý{YQÔügÃ!}ìO©È
+h<LnH0­{ÖG¦É
+ÆßeF¸d~Ê#BléãÁÿvÙ§áëË
+
+-[Ê/½Pí{@;Òä|v(X¥kµ@Ü­ãmû6z0o9)"Nso?¦¶H}ÚÐkÐ©
+Âï-b|¬qxäún
+<r¦ËíÇÒò¾Kúm" E[Ùóû¤¤ãx®Ï<`%M`
+A-áReûV?+¨M¸Y­¬¦s}üXaKz
+`qm/c^q]¿®¨}×äÄ·Ì@ôt¸þ\xÈèsÚç÷ýÌ3õ;JRpÀ
+Y&O=³¢ ºt°Ç
+-;Z£e)ö²H64u
+»g\°ùÊ&ó$'©&4}·HÆRòèF×´ºeÔ@¯,[±t7ü'2ÿr0n,&xdÃ´N®¸¦Z:íUa>§a)¾¿5ãw8Ë©çB¯·ÙÅafÚÎ|¸;ø¼F\ñêu
+ÁnÎpR¶?çÝ5a«çÊª)¯»^Úê=`ù!#ª	óÒE¬Uýè­9ý\î¬e/ò²f÷¸¤gÄko(jÊ
+½qØÿáí=Á¥éÓ4lï±ü²Ã^ñ·M
+-
+ÎÝ
+-ãÎco¢& ÜÃxaJcÜGpKzr¤Dm9*ÙÂß§#TþÍ'¦5jõEV0ïéÔ=TC¬qL¿]ªÈ/Ð§û 
+-5L
+-ríôivãµ*ÔôöV¹,¬émGÏ
+×ðUvïª´rKRqD}	NÃ
+-'§¼|
+-·@Iõj8bZK@kØ¨c¼üw³ÁödËT8Þ$D®ýAGEÑ2
+FÍïJùE*· ìñBÖ*×Á¬¤F1§}OSÑ·>¦`LL`T4&ë¢eÑ9$WXq3+<Áö>táRÀ Ûk§sÝ~Z8,X
+-k
+-Äé5íZà
+Dj&SC®:åRa[sá%.$çñäK;$¥_q¼²ÕÀð
+
+Ì¤N8ë]â`vÏp|'°eËÌËFÙr _«ëF/Õåú ØCqÿ
+§yÎÂ´3Wã;ã¥ E&<!ÖÑêJCzFq³-ö¤îJ¿BVz®Iwí4ve£Ð¨Uæís¯6É&¸ 
+ÚÝíÏ´»ë8yt¥!æå×ÛCnÃÙóð£ÝyNKÞÎ
+~lÆV13éëú1)Lof0kðÃ@Èã'
+3~ÂüÜY{¾ök
+-üWh%ÝýÂ
+o ­92G
+-<s¾È½¿Zº9õÕ½º÷
+
+¿Äô±.ú¡ßSGÔ$yª+zsä ·³
+4»ÂøH
+-<I(d½ÍÎ¨/¦¶l
+-þðÀf0XNiÎåª÷þb¬,)Ê÷©ï6V>
+=Õ|¦gºma¢ËUàªüâåòv-kÚ¤ª
+·¢ 
+Gkª ÿý ú¬Ho5ýòý>ªËrÜã,]ñS|ZGí×
+Ö,,umö¾0÷ÐÕÇgqNâ·ï_CÑ
+Gb
+ÔÆ6üÅ×¸jÊcþ^
+x>oÕéÆòaõnï\
+-
+'ñã
+H9cO°´=âÙ>¨
+
+-ú}Ô¶¡V:ÙØÊX7Ñ!xóãgF
+äé^Lx¼®fÅ»ÆÁºQÒ/õ_N£æßõ¬µpø¨û·îèB+©ôåö7ä),Eã»Mä²¡2Jt>þHòa«)
+-íWéM¨q
+Z20ù~íRïVåX«6£ÇD#HMù
+-jC
+ÞöÆÑ¢
+ÿå¢Ç ò=M­®hYÿç¤ZæÏPþX&0(«^j_øÂ
+-IÕìWî
+-×Á¨ö
+Sb«&/
+y!1f#æ£päßgve*/
+-IÎQ
+ÞPÓ²K#±7ãÍAmÉG®ÍÀ{$Ý¸hÄ³u(S c
+#ÙFL¬uxUëY§µ BH¸Â·hXbìÔ
+-.aN²Y
+_
+`w~ê8Óÿh
+Ù6vÛp\OV9ô
+aÇIfÑL¯uÅäy
+hÏº%éÅUÿ¬Ñv!X'9C[0ÏOyltËI>Ñ¨_µçó§CJ
+î#Oðõ­Ûr1æów#WcÎÅ
+
+9ÅbØ}óòÏ
+-Àl« ,Úª9=fke`>ýÈ@jïAéüÀyöðì®¦ÒøH«Ý
+-÷|Ûbº_iæåhµAí!4oo»5¤nÜJòyx 	$ßW°6Yô1ôºj¹É$öó>VA/]³+
+X.ª@´àüfçøFÚ®áQLo)%s
+²-11ò<Q.ËýVëÀÑZ÷ïüöO,ÖoWH¿çñ*Ó¤n
+T¸é¬Ð
+²
+uU:÷½ßÞ¾t¯»8û¯Ð6?	~Ìið?wôÉE>íë(7ö¯Èº}C)©fA|gÉ=3Ý«GÃ!wå¼ºpHî®y
+
+0X>î-åWØÞb.Üù­Iå
+-ÞY$'HEàyIÈW×¼}
+ªg¢Q)©Ècöç`wÈëQØÏC¦¹?57>èç=ëôß®©gÔèçm;ä³òLªý\ÎÂ­boÍ¨kû2ÂÓÆH2gÁµEW¹sÎõ¶:ùâvfØE¥bþ]ù]IN¬È¹òYÃ;±Ò¼þL#3c¬¢éé
+/äI1 
+n9ëøãóÞ¡òèÏòG|+`4Ð
+-n®HN÷¨®êuP«[P+Àüs¿
+v¯|kêÉQ ó¥£3¤
+í/uhDi ;JI[üË»¨
+
+.×¯ä³÷Ã§¤â]~MK?ÄrFÒµGcd B6í±ÖyX1Â
+5
+¤{ówS
+?r
+-ôß#h°ë½n2
+ Ï¥	àDóeÚ¥õ5èpdë+>ÛxV^TÛ?TÙª$ÝuÎÛ¾iÚSkç/OëJXA
+<)zõ1ùâqììoª¿Sã'¸ÍHèûôÂ³¹sÞ¬ç|#Ã;ÿÒÁþÌ»dº ¢¡3Jû[3· d¯n²ÔôP²¬Qº·ó¬ñs+Õb_.û
+áÛào7 ¢
+ÊºõÂj)CÉÃ¢»Ñ0A,jFï¿A¥Pïø£FRÙÏ-!ìpÈÑ¨¼öÑ!&Þ3·óÁÓ~^XHpî23Ìk
+Y¸Ò
+ãÀzJòáOÞ(­
+
+¦úb§%äZw·¿%â´*-üFj0LÙ|0M,>½è¡¸DOÄp!l#*¤ócIkñÒQ½!Q·ÆMoùÝùÏ+g°÷v~ØwÕ"UXÜñ;O]¦%üqb
+-t8?Áp¼å'
+6ÖI6´it æv¼¿ñ÷îÆHU
+Úy7gKf®²fìï
+¾çaÒN¨qÑ-!JzaÙîîû¿r6¥­²Ã¨\B
+-!A51MûÓ#4×"ªFêÂºfÕùmÉ_"YX
+-)('yö
+}ó¡Ó·{Qw6`Æùhb%Ãql^$&¦	®ÆòðVgË_ àm]¼
+Ì°
+3nøÍy§P}®c¸vo}á>Ý3õ¨u®LI.Ò&1£ßÑ<äzþt³G
+-ì4<|<_»>u<ãMÕMàÚE8SðÙ	;Ék hc½Éý2|nOhó%Ú×^ô}þ­®ìÄc¢ õ6ÑÏ°vhªäÉTEÀÉììµ»´®i¤Bl¤./x2Vä¬â­OÅ(*¥Ûâ
+Ü'É`¶/{b±eýBe,Ò£è®K×rx¾TÑÛ}ÊßaÎL8½
+-çGã£¹cü<")ïù
+-|ÐY3g!Ib^7_p³¨µ_²Ã%U:àÏ£ååGê¢J7UÊBS``	Úµ¾%zÝyEúÀf+æNú(¿È®ÀÈWV óYC~,êûwÖ¡#Øj1?ù	£d
+-blN4béOÏü#	¡ÙÇrø|"^ý¶M<Â($Écêüñ5¥
+íñú
+Æwá_ð$ìhV©»=ø :Ë2,³X°¾ÝP³p#õÌ
+7
+-<Uå,Ö%Ò}èbê\/ü¬|K¯^²òÜ2
+P[¢x1-~ê+\.ÝÖ2¼¡¤Â>ÚÍ¶'éCë¾t²8w´A¥³otbäÅ)M"î6w
+£PÜÀQ«Æ¾RÝçSd#
+0¡«rsí&ºØA`ÃÙPU7ã9í¼x¤]Ñ^£ïëà?J«Ê6Ë¤Mka V
+`^ ¾òXj­Ïío¹óÞHr/¢¹¾ÀÈ¦&7Ez¾XUèSº3õæH¹Èw¼;Ö
+8:øqanua]%
+-N]Cûéµðª/
+Q1
+-Ë7¯«æþ¼àE¼7y?qô
+ ÇzÔ¹j×@¿£
+[!Sk÷ÞC5ZÂÜ·üí².!a]2
+~¾§ÄÈ6áì1w6=LÐ²>:^4Rå=l$DÄ"¿l°=ì}êüÖ×=Û
+-Õ&a¶TZ*ø¼]xíÐjá°¾Nä(7Ü{º8ÀÓZÍ
+Z½àòÉwC©ATÞÉÁ®!
+e÷4
++ü
+S_¥rr=·Ðõåõå Ì0ÑÕjfvo4×«Â~¥©¤oÖ¹r»HcÔ»G`·;ß	Gx©°@
+-tùnæ­\ílG_¿iñ-Á#
+\
+-4aK9QÑ÷æ\¢ÔÍT6·N´DM+µËUD"bpªb'Éyû·O»»4ïLõª
+j	²bèñZÙãpíØÀÎ <F´Ý¦?é¦aÇ¶øõLT%¹Gî@S`XË¯_¤2d¤Íqi,o	F½^í7È}ì nªæzCq	»K§H5÷¸²±¾XÎdX¶ÒÎ/âXÆ°j#&Kr	Æø)0òaJä
+Ý>Ó7LÆnã£å½9èâW9	
+-)
+i8MLæ
+âv¹ZCn¡QDíoÛª¶wÕPË
+-á-^["f
+-'Ç¤h0eB´ôÕÁ9­Ô!ñúU	+¡2JÓë~kbïsDá
+N#2káîPtcv[ã
+-#ETwQ Î®üi?c]=÷´¾
+-±Ô9a!ßfõÇÝ¼euiNJ#K®Å­æ>É¨Ñ{´_/(|c!Õ|v¥>üÞwyZQ¹0KhyâÔO2ÒNV
+òÞe"¬
+ü
+ÆxTCú1vÀeef`¢óÝEB]ÅYdehÞð6£(vÆÑ	uëz
+Þ*îù2F¹&ÉYõGmb!!IÞ«Ö3-ÍÞÆñ>U1ßÅëBÜÁXa+Ó¸"
+-}ZH
+K<øFa 
+-
+¸½.,<Ñ¸:È*Tq½bD¼áàþOF¾6dYº®ÈÒu.6¨ÒþÓT¦Úov1Ã5»òê=áÊÒÇì}=nÜYõÝ&­eðONZ®,<ÊW#a|ä]¤¤}&ÙEÙ]$8õù'Ûvíue	TIRädX*ú¬ã#JÄÚSÍáóÊåìÏËz1Ï
+-
+}éH¬ÌbÆÊ r­Xê¸a9ÉÈñî
+-?ªþá<]=¢zeËWR:ÎÜ¹ý­©
+´dfíîÙ/]¿dt¼ÓT~(z3aÀRgöã6iµØ5<NoS÷§\§PHðZ©ÿR«/ûåyéSÂ<ÔÂaÕ9ô!æ`±®£)-¿07Ñ8QV9­ÜH°C,ÿÂ·Sd¬YÁigéz-BÂ×YËï°Èo¾ANZ»ø'ë¢ÅaÎQøSL)¿?ÐYQjvÆðÀìbÚáÑà*Û­sPÈÝH"XdÖÀ1xWçÔ}lÔ[ ¼üªPãq2ÊG;J²Îk»Øû£h«u¯ªè2öØKãçÕ·*Ë³,ïýPz]÷­ÁøñP­à
+]
+#Gá»ÍÍ)w²#þÛG:LA,¼×HÜça)ërp§²Â 1¦69t f¿´»7$Ù.òXð'Ö
+ýô
+~q^hæ:Y}¾ÛnsÍo¿¡TûôøöU=~ÑÇ;:ëP~Ñ­åÀÓê]ÜÐ$G_á  Ï [Yµ²^Fn8÷ Ë,[¹i"íi
+8KÚaò-:¼5:
+IþøÌ¬K<í @¦AÎ¹Tõ
+
+ï¦µ&¢2h{¡ h}­·}QÒOÙû¢«ÂãÀ¤â
+ëá9ÁÉaSW?ÜÙãÌë0!HÒ
+ ¥:q-;Tã44¿#Ä
+Ú¸8 ÒùrdAE²ÆZÚ£õ2#®£ï^§Ó¶ýõ¸À
+
+<~±î±dÍgUØ° EB=Ç(c
+àïV^A³J=Ìe} åt,Q8tuCý¥'*ÇDy.
+ú9ÅKÌ°$jêoQÐ+äeèãã)´Æ¤è+LÇáQ+ÄisSÃ^%=¬Ìé2ó{Í³·%å¤H
+<¡6h[j
+À}­ï<ïèöò
+¥w 1~²n	nBµ?©ÖiA +fQ
+-BQ@imò¡Î%¤«Ål¹õ6ÅÆ¬c¢ÔòkççýÀ£Þ^y¤ÈòMó
+-²òû#ËMì¿^V3ÕV>½~
+nBj[%:²Ùräs"¢±Þ3)
+³4áèÛöýîe'â´¨ÒãËÚM¡LläÄW¼S\8L²ÏÉu"}ª»àâmßÉ­
+-û[ÍÚÂÓy¿ã½ jáôÉGH?
+?[]½`º	¹-Sx23³WÉªßäÖR9ÑIÝ~@¨vrÙò&j1µ8ý*7í<ôaõ!@ÙMÕEÅ0d(f	}¹¥..¡4vvµ±6ÎÛµ¬<wùÔcbÇÅAJ¤¯¼ÎQÖÁ¯½àø¹Å¿­¿£feaÄÖ&(+Oë[ÍGzj6¹Lëh`!ØÃ7¹oiO¤7°±.°³Ó±®kvhc íhP[åïî½9pÅ×
+-nrö{)
+-+b]xx6IZÔÉ¸À¹OÜù9â%:ÍÞãÇ%·"mä"¼
+ÀY=ä©u´`Î©lMËÞ¼ü¾¬ðoDÅú2õï^ni+~¸·fÌ+Ô~÷<ÉJX
+*N¡+':~ª}ÌÍÚH8ãsÁ·díåç¾3Ó+A`
+(Ço(w¾Úù
+-7÷S¶<±RHø+v%õ¶§b¼:Â=»\
+-ðì«'_ùFQt~"ê È==´{	
+Ä·ïëQZC!×!æzWMTðèNÝ1
+Éhb<Â1¶ø§¸BåâªqÂ}¡Æ¶À#éÂA_Û¶ïâØvxÈpu}#K½7óðVú6qÀw §XÄAÚ6>=ß]ûãÂÑY6Ø2¥PVXÐÚ¯33G	e8cô Á¯õêýb%Y¶V¯àû3¾O=º
+æ=ÌYÙMbxôdÊþ8Kng§F¯A3ÓQÁ
+
+Kàd³$±
+A$Æ®
+ÕbÖíãIìW³¦1ýî£Þ´cCr±ê-6ãÅ~Ùß áN­w0Åwx?Dzu%Óu}^
+DD¡?e¹qâì*ÕÂ·ÇÉ¯Ð*«Åws?5÷¹M3ArA¼ÛL¹½³²ÁAW}3öð
+S[²ÂsTù]Ý)Æ:7dä\ãâY¡¯Zßþ[ýÚï¸Sø\bñ¦²ÑX£I
+
+
+-Ý·þ+ÛXUégåúÎ¸./4ð¡,pñÊW=í1_ÅÜ¢/Z
+¾¾Ïy¹³U´u?
+ÂRÄa0J&7ÀâkÃè
+¡°Ge
+-zwv26Ü¨úéü}~mÄûç
+éyÁ¬¨ä
+Ì
+À«Ë8¤ÚhØv}Ù+)
+pgO4V§ÜãCSZ
+^¬Ò^[b"¡îO|{øÈAB¦û99¾1¹]XßÓ¸+Ív²´"§ý$¶^sÒjÜoÚ]:$6vÉò
+-êh)zÓ«ØÁ×ïOWü­3g
+-\b^\XQEø1<ñ&ª6²V~eâY¹!«_òl,Ï§^YE#ÏÔ
+Æ*PKyág2LÞ'®±Åø¥%´hv?(sÏ7²]½Ô«ù
+Õa=Ëì
+Ò'{$5(O:]àóB£4ô¡ÕÖ}ã>
+ØëRbþB2`{+#èeyeÊ%º4b3·?²¬ÇNiQKìg¿¹üu]É%Húº7'ÍD}yk¿gX\æ8d
+-?;Îã[Ãù»°îøzÌ»Ýd|5
+
+AøÑU¦¢LmSëüÄÌùRr[zuNªºÉÔÊtÁIF¾ÐåaðzþÑ8æ5Ô^ê-ËÞu´½b!që©ÈIÎCL÷±O°O¨µßytûïhÓwc9qGùÜÖÁä[!Á%ÓÈ/!./[ø
+
+-Ñ2ÒÖvM"+ÒµÛòàÆûí¡X2óVñ%^Û	â
+$d9§sÑÒ5:3®¾aûÑÎjÇJÜe`;YÜÖqÞ!GuÙ}ÄÍ-
+ÑÒãÒjõ'Iw u\
+:}Y¢É%º{¦$
+-ÊWu(.=°¨9¤ääX3?ä3ñÀ¡Ó#<
+îä.Û³Ñ5ç3©@áÅy~º±ÏÝeIÅªP¡úÉ5¾M`ofÆK
+§-Ûjî£f&z®
+&c×z¯$Æ±¦OQ«ö&º7ºÑnR[ïòö*ìÝ8ÆdDÿG½\
+ÃHsah´æH|6L4Ó l²bÆÉ>à'<ûý·O/Ì½2¢ß÷ò5û10^3çÞÊg03f°Ý*×HKÔoõ
+¬*° 5&¬cN .<7DÆèÄôí¤¾CF!AYFIß¡ïÍ½<¦Ù+®2ÁoVò¢²ëæYä(@îøNÆØÝKÞc8~Îóà=®¸*
+-àÞpõª+¯Ý<f@Ï9Z
+-Æ}ÊÇ³)&¬ÒÔS9Û0xà^ô@x\·ÃÅ­á©
+çc(e[3Z_Uá·¯ì¶(ç£IfÅ¾êäúåøã¶%§ÁÆ!5¼ÑÀ`^(ã£=ÁíGÜÀ6<IL 3ÿHÄá÷Á®|ß¤~|`S=y5R¤5ØÀp-azFsvÒÒa sê½Ú+Cã¬ÄÎ9Ê<VÂ~^Þò³ÉwÝ¥G²`Ì±Z×M×Pc)õn°8ÅµÛ
+-vÊÊ#oôÃ²Â.¼ìL
+c¦d·qhÒ¦³BÚ
+ÍzìîzQðµE#°õýïÓÒr°§¥÷0ÔIW\4hú|ás
+º{oÞñ0¿$ìÞ	XY¾îD0'fVDÝÅi#É
+f´º~ÕjFhùàö£võÂû°úV7íUÔe7	}÷Úí'\Ú¾qÿ D&°Ê·~R$Ö£t¤hë* í~xÄõAß®Õ^
+ºÝ§Q
+äd)é*Â&®Rù]
+¢òR+£"°8£)<Ä¿ü/
+-ÃÌl163.oPêXÃj4ÃRs[Ã©YàP=F»SU#­Ö´S¥>µ/Ldð(Äf(­|D«óªm7¦aØW)¯Îj$Ò}ÝpØ
+1±¤ýÁ8íªb
+áË÷möFèdÓ©]×5%iÃ©º76<Þß4ûàÛ/jphÒÄewR]-$¡b¬M ßg+ßÅÍd
+<®"9 ¢.q_<ãPx	!Íî³_T+µIXÞÍ
+$,\N¼ñ7;ØçRº¾1Ù2ÇÉPMV´`W-iT{K<U7rÞÚ_ÝE·êÔo:ú¶Ì§ÿáð1
+ë
+i{ÝaÂÐc¾âjÄI{&µv÷³Æ UêÇãØ2
+-Lÿ´Ñt¶ÁB=è­U\a
+»Îò%}2±HM¬zÕÌ7·0Íñ)Ç]#¨ÌÂ­j!b¼ïxÕZ5øÚ}ÈÎ;1$¯E`L0$hi­?°á®w
+á¥T2ô ÃÜÌ°\Õµ+)J¥ï·àß×éëöé|¥Ì°gw0»'É ]ÆVPÌySúù·>V0#ù8î["úäàGÎpåºTwDãgã SNÉÉxÉÔ3Ô©LP²$ÜÝªæ-
+ø
+Ò æF
+#¢`w.Ñ0}ñÀÚße7Æy÷2ñªò¶
+&^âY0¦4@ Ê}²UÓ§Mö} 
+­uï]YF,Õó¡óÉE
+õ
+â¤Ïà3Û&t$J+>^D#ÅX´èlo¨
+#ÍCÿ<R$3$,îq|
+·ÿ÷QÄ\ÞFCVâGáv:
+-å
+h¯â!d:]U<6eÞ3®w]þÀ!Uø«@=¤Ël" g¶jf«_ø»
+->pWø>j}lÑÁ|tÑ)õ
+ßdÌ"FF!&6ëòñ¤LÚe\H|èÔ1vÈ¾úÖTÎ5¤ë	K3ôð\nQïc
+e«j¼Ì×@G;Ý¯V/ÏkãH®!%ÍZ¹kmPX5Þ28Wì¼Ó%2ö&§+{òâ>Xå¾È\t©ùöL~1ï5}ñk¤÷é0[Åiß*>ÆÀÖ²'ï£y²ÁL¡Âm=ÙÆÅK«O ÅÖ$-½2Ô
+X+þfsõü D+ÕòòpÑNãã©±Ò×mÊçÎÜ2ID÷×
+aìÏ
+vÅ*EvÖq¡èbyÝ]¢ÕbÇÌêßZÎ¹-®¼¢ ÆÄä ¡|æ,5BDSjIGß=íÃ
+àira¯ðíÌ:n VTIÍ§s0@ç½-Ü8jÖ0½q`|(rLìÏjmzÅØ@ÁÏN0eá¥úFQw¶
+#|S(fM}Gé
+éû`P¢³<.v¨­
+-a
+Eé^å¡~¿pSsyÝ{EøD!Çfi¾>/8^Î 
+-×O¤^¬«)Â¨(ác³
+³®ÏÛF
+M·$7
+LÞ«VéêfbÃÁ
+¥Ý[ÂM'PþÝu
+ÈÃ<ì¸gåÚx3_;
+¡.ÄúÊL·Ûåµ6(9§o¢¯/0üüeÀëqè.?ÛÊ¼ît1´¶RÝåòséWà\
+-AøUN5|ýLØÙèk!G*=åF>¹2	å÷­´b×s¥¾éLó@Aßrämì4*Ó/ w.?*0ÉóÕWE8^æP:µT¸æ+Ü4
+`>\·/¨T¥æÀf6le÷[4ÏæZ¯¬öä£ûJ¼ÈÛFè;cëEêòÂî¨A{ÛB:î£öÕ*=i´<iáoÞ(]~5òW|y¯áÈxTo=
+àdp¹øeè9²5]å3S?Äµzï7æIJ[¿¯l
+Ø½¬Ý-Aá÷c]Å|xzPàÃ¦)Æ/Ø	Î­2SÓ'XþFÞ=v
+|+}¶zÓa$k)­E%÷MÌ5{A.®âr¿	?¸ÖQ½8Ì
+É¯_#òºªLúvµ¦º;\,@:§ÎzíÐ­÷G*
+ÕÐÓé 8Û73|Â1úZ§L>,B¯#Ã33V¸óDg¾X/}Ê4&¯
+ ÊØõÇDøOG^ÊxfmÐGFÒxYÙ¶¶¬çâ5wA_ÙR<ÁU/8êm¥Ðº®½NK(HVÄvJß
+½uQ~7q-ÖÎ@E$èT½÷&àK³â¢Âü8)Wú
+
+¦mÅ7V9-/¨×ê¢ÈÚZ!s,81·ÊÂ¹<nãV
+-ÚK|/^5¯÷ßKÍKú^L`Î_ 7
+-Bóò)Ö{·ëoßëÔôÐ
+«(ûq2¬^eë¥G/õcQ)¡º
+Ü¢Ï
+-òï	ù¿ÈNõÛ
+Ñ¬
+c5§AþbGBÂNG¤1½h³óUmR§t(Sö§á.Bîd8jµaå]òu7ÞÛö0Ï².
+-Ay½×ðºÜBeÿ6Y
+#`ÜÙNÎ¾½ È1½èï6_Ì­ºPÎ2+þyà~¼\©N?¨÷!&\=Ækü¯å7½nT81ÖûËRÆÌi´"Ô©É¾púªGñ
+1õXËl>8e9É+5Æ
+ùd"gÙ./Ó·qÈ!7wÞñgËÊ	ÏwïmVßjÈÔ¶çÓ%ßW¾
+-9ÈawoÅr»Ùå²¢QpÍl¾YÆ»6ITV,Ù/[7-ó3'
+ðÎæ[È
+N±ÅdFøAK/AF¸2² ¾¯Êx==ùÉêP1XúÁâðÒjÍ¯_>¼@$¶¸"h
+ËcoÑ©!
+
+zÙ
+
+-Us-D]×Õ¹lMâ~ n.}Ù¡Â
+0îÖc|8VÅBgêjüæærc×?CÝ ãv:ü4í
+-3VÆ/-ºÚ¤ÒÊé©
+þ½ßIäåe·®.0m
+ìÛ.ÈæaÍÓ
+-o#1
+O3Õ²¹xÃÌá3»ÔÛ
+-¿Ï
+-:I¸Á#±_Üí½WH¢Ñöê 8Þ>µ*«µ£iÁu° v7#r,¶Z	»iqÀ¼+ºó¸@¹Õz!fÔ?QçÍ(½ä9>¿,ìãëYfÑ×`®%ù(º&Ñ0B%ºXJ,Ny¸iÛÃÂÍÑÍ
+F
+ìÇlYÕ¯©ÍÖr¸ó#¡@dv
+-¶·X/&déyÖX"
+C#£Ò´oõâØí£9¹«çjñTD½lZ1èÄrãÝê&T¹kra®)¼ýç£ÞõâþÑf1<3ÔHä2*y:ßB«û>è
+å´HË
+-ÀH§x~Ï="¼aäHy¸bè>=
+-ÐÃ ¥o$|#Ö¨rH
+ñ# hjVÿN	I<¹ýMä(Ãëp±B÷òVÿ}P©3wõ«ñÀ[ÔÚ:þ;Ì$¯íO,\v
+-ÞÃ¸öµ¸tWz->
+cÚ]'ÕqÄ0
+z×uÑX;ç-Þç !	éFÈxóaï? 1¢d)n¦µw¶åhh«×²ÙKÀ×t1¨ì*ä{+kz_LÕÄjÞâ1Î+÷(Böqà+¸ÔzêâHL_wÛÌ~Ê±=$Àúvðõq:ò^Ð1 _?]¡u
+ïÂÄ;ÉÂ|køØe.üI©Ì4ET?µìF¾,B·MÀã¢ÞÏxÒj¢Ý æuüdùÛl:ýl`1
+­
+ÆP{¸Õ«GFÂ<}²ø=Ö>¾`VæC«_¾ùà©`¶+õFL_+$·»øßã;£a2±Þ|Êãbï@Õ:
+ÇÞ¢úÝgDÖÔÐBUÅ}gA)ßËyíNÙâüÚ`ksýlÏký
+û6ñó.n½eñöÍgFÁ6åPÅÈjd¥¡¬­»7CæLgï.«-
+	üÜ¥FÕ7ô}´zéÄífcdNJ
+ÛhmL÷Ò(:à
+b&q¤Á_üsßO¯*ì³fö{ù¢r$¥d´n^Ck×¶Pi¶<
+-Ós.Z§ %8Ò
+m¥{Äù`·*=A§G?>iÊËØÒ/Ñû!
++Ôþëâ ­ëx×r¯³yóÑ2ãèª÷Z|uókNèGY£ØxK}DVµ_óAP´Á£ýÊw
+ßø
+W¤ðËMVõ®+óW
+þ°Ó¶¼Ümª1ýó;ª¶ö5z«0õ²[gnÝÒ
+F¬HÚU ÷Yøö¤>fühCsÙÄX¾)Geä@+>jl_¿V:þR±½)	©E+ßîætåXý{>:DoÊ`}÷R·åçt
+7Çû<æÞD³S©ÕÞÊN±Ë1ëO¢Ûjp|[y;Ùós¥}áàgB÷
+°BïnòÇ5)
+Ì _n*?	Zµx-[Ëd^Âxæ·pç&U>N#{¬xzß¤¾­Ûûn¡CL¤
+ùÈ7¹
+¹EÙ|8&
+ª·I?¦ùDT×)iùúµ«7!ß<àºæyY~ó1¦¥rù-lidXêâ+ªWÑ ûÆÞÄ#©³|Ë.QÔ62T.MG³Y`$µ¡Ö(2ëªÔ
+-ÝÃÚ
+ÕÜüÉKY°+ÛK®lþ,ÁMbÝ1ÁiÈæG²ï×"ïnÊpbL­g¾³ÃããÂa{øiÕ?W'Áã
+;·- ^Ý:¢F5Þ!ëuËú>ºÊõ[BÓy|ãî
+÷HpÐ7Â/
+-åp2B9K©í2XHû\à
+-\
+-ToâÃ<1À_5À
+Ð
+¦6£àPÜ/4ÿáeZ
+-~ù5­ Ý`´"ì W÷;³ZÏ	Uòur	\ÊR£È3öJSpÞàÒ¥"C­¶%ºÇLhçæåËËàS¬t":B'f?#ØN®4Ç95XJt<Ýø}N)õlu#Ad>)Zß«Æá
+]¬
+D
+Öúi7E)3)§çê¸Üd#
+-ºÛ¾íÛüÀ(È Q· ¥íSmÛ)Øw(Ó
+è8rKh5«ýÈKÙgó××|Ófh7	Øj;Åïû^Òæ>/°6x}
+
+-OÃè7'vêôYo|ÌJð;U¥#F{14Â}¯ål&iÀq@(Þ±uêÑo+²iÖ@NwKe
+.®\ÜÖ+ýÊÁö£
+²qä
+Ç ð!jåeú-ït@Ñ,®!dºÝÈÄ.­ºÌ eìt±3Á³xss3éE\[
+-dp§õÛ×)û¹
+¼ÅU«"F}Ù"[&Aúó[þpÖyøæF2[NtT}
+Ç´ã
+m ãY^¾Bó»Þá{í#fãg´IäÏ*X+:wpù¯£íÒ21zMòÐ{v{)0+ÚÝAÍì/
+b½îfqN¹ÝËóAôIsvLR7·ÅÄá|¦ÉJHgÚÜVüWW
+!A7[Å|¤x<QËÞs2ÔõöýØørACs
+zmì)E³çE[ó
+I]°ÔÇCMå¹Ïó?b8[È-ýÛMóÂø¬c¬G)%±±C]öÑÂûÚ·¨ª,\¦%Z$r¸ºÝ
+&é>Û§Þ4 Ó%²ÃDãÇÏ
+	|ø¨PP<^1ÉãÙïÚïSê¶ª«,°e¼S{=ìñ.È6l¡âôhíIÆ³B
+êXOS¡/þpRþÌä:âüiyXaåCÕ¬DÉ3ìð>QCÿ»S³XæTé\zÇÈ"ÛR24³Ôð]4!o1MÑ,[
+-t6ç
+¬
+·rwï<U&sOäökÇzüî
+;U»Z9
+¼÷¢JG¥|ÇV
+û* +íZð>Ü&*º¡¹ó¹­&*(ÖT`ajÞ/cüa±"èºèèNËiÕ;¡m,¤"öUZ½H='¥+*>òPbÚÃe[fo'*¿y{ñÐÞÇ|ÞÎüX/uâRZøWOçG e¶Y
+-×Ð
+L&ã"ÇM¦ý GÇ2×­ÞËf¸Ô¾É¦Ó'»Z§ NsBYª°ÀÒ×dyAYñûÆ;KÒ/Kr¤rkÂdÌô¼¬
+o\­¨z¯üYÞ²
+-°£¦É£n«áóFÇù1B
+Mêb`²ÊRrúÏ7FéðÆHÏ¶tP¡¶F·©ôl
+ÆêDÞô^Ñd]¥üìv¿¬k0Ð@=»EÒØ7/h6ÑZ.ýSÛän
+Ýy>î£ù{ü:9b²ÓLO¸¤à8^¢+7Å±²Î{']ÖÍJ$ÈXÄ®Íoæ;ítã5²
+-(èÂkcèNv4pÝg/,rÈhQÃ!E
+\´
+òÆìøOÇifyL
+^%Ìxu{[Ð~n¹¼ÂÓ[v¸
+-ËÝ¬:{ ¬7òzÌ;|µª6Ö
+-£vvË,:aãPÕG0¹Þæö:ìä
+-Â® ÷õ
+-É¶£½íÅ	
+ßËË?ºÏ¼ªÑ4&Å§ã
+-ÍÛèÍ4>øq
+à|z£²
+-ÍÕ]~@¬º|&$¹Q0~
+ç`$W(Ç>AâöË>zYr
+Î×õH¨yîÇö³äÔ¬°~B}h<ÁÞ_½+e:~ë÷T YCãù¸ÆûÜ<c¹}^³üA7ÊZz½Ql¦*ÁÕ)Ü0òÀ7ënaxª&ÍÒÔý'l
+;)nFÆ¯8èÕøz:úânZ{³ÉË®´.l¼¯É3Há«n*Ióï¾ZÅjTbÖ¿}ðæòÄÖ¢úîú[Ã[]©7§ÇøZ#
+ÌIB	r/Õ2Dá®ãå}|î
+³ªíº6YÏ[ª fHN:dJýP+îù`ÿv¶B³ÖmßKý£ìê®g¦«¯æî_/¨0è¨!¯xÙV
+ÒÏÝébÉòbß
+ÔïHëÑÚ^J¶l"XÁ|¸på¤Ö¢®<«ÀðÔ¯ó; Nw>qO{E ÓÒ42ÖÐô*î[æÄ³z ÞÜÏjm5LüÌ´uûb=½JFÎÛ0$²8X#©ä)§i.h´ÇgE5¼]:úÀ¤þôeRq°§â­Üðx
+³5ÿ(4ê<ì'G
+	
+Æ ápäý^
+)ü³¤bbÂ,ËÐÿ7¿
+-endstream
+-endobj
+-781 0 obj <<
+-/Type /FontDescriptor
+-/FontName /GEZGXO+CMSS10
+-/Flags 4
+-/FontBBox [-61 -250 999 759]
+-/Ascent 694
+-/CapHeight 694
+-/Descent -194
+-/ItalicAngle 0
+-/StemV 78
+-/XHeight 444
+-/CharSet (/A/B/C/D/E/F/G/H/I/J/L/M/N/O/P/Q/R/S/T/U/V/X/Y/Z/a/ampersand/asterisk/b/bracketleft/bracketright/c/colon/comma/d/e/equal/f/ff/fi/five/fl/four/g/h/hyphen/i/j/k/l/m/n/numbersign/o/one/p/parenleft/parenright/period/plus/q/question/quotedblright/r/s/semicolon/six/slash/t/three/two/u/v/w/x/y/z/zero)
+-/FontFile 780 0 R
+->> endobj
+-782 0 obj <<
+-/Length1 1386
+-/Length2 5966
+-/Length3 0
+-/Length 6906      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚWPk³¦:Òù@zÐA^¤w@%$ô&MPªôHG¤Ò4E¤(JGiJrc9çÜóß;sïd&ùÞÝgwßgwo&Ü
+&ÂÊPL
+Ä
+-Éªz&&²XDLLÄÍmÀºÁþAÜæ04BÊÿ7*Áâlj,§B:^n8$ÄÄäþ¢ÐòÄôD 
+q«¢<üÐ'g,®Ì_ #? .''#ô+
+Pv¡$ Á:ÃÜq
+!n	ÊÃúý+¢3ë!/*êãã#qÇ ÐNJüBë
+Ã00´7
+
+-ü$
+èCÜa¿¸Sgæ·ÝÇú@Ð0 gpC8Â\
+-C¸â¶.`àCþëþzÿîOôÏDä¯`£#ÊÝôC  8Â
+-hè`}±B 	ý	¸aP¸x7áqÀ~Ý
+h(
+Á?ô0h#A¸ý¤(ú3
+-®ËêH¨*ÊÝ
+Äb@?ï§@Ã
+qm÷ý=YW$Êðç G ¡ð$ ^
+¢fH§L[ígýcsa)111Y1q æ	À|
+E¦7õóýrþ2ãx < 8,á~@7
+À¢½`AÿÝñïH\
+"
+±Ì	ý
+gÁqÃG#|k1Üîb???ÝÆ­
+tóûþk¾¢ªÚ¦z*¿ÿíSQAùÂÒR° .&-ÈHAÿNówþ"ÿËjAü¹Ø?µp ÷®yñðþ³|$Ãü»>
+-·Ë0ïÕ·sÄ}ÿ¿ð+äÛûYþ¯ÕÿÏ
+ix¹¹ýróýòÿ7Ä
+áæ÷[e/,Nz(8ÿ	µý²
+
+ðrÿO¯62ÒÉíï6"0_Ôutþ½CMÞ
+-¢0/@X\Lì?|8Á9ºâ^(Ü¬~¹`8=ý»¤:Òý)<	)i FCü@¸ÑãNR@8N¡Pï¯ÕDE(,.ÀÑ
+à(4èçDÅ%ÄQ¿6Ð¿ò:z¡Ñ8Áý<®è_ç_êÁ|a ÷(G
+ÚÃefá¥×Ä?µÝK´êÂòL>
+pÖ½¥9ê©b­bJ7*»ûv"Y`ópØ×¦3'ôCV>O½wAe[¸`àè{§
+-brz#~ozë+¥½55o²ÅÄI¤Lx¥zùÑifåÜÀ
+x¼OÅÆSÎkûBcÅÁõ	;heCO¶Îð2Õ6{sJ?Pie<ò[°Ï
+ëÏyÙþVx³ûtÕÝË´þ:
+yCI}trt0x<*RûªeÑå
+1DèÛÆ·ÌqÅ6;Ë³#·#¼ZñØÚÃ9½KSîÏgwèí(kPõ­
+©÷wXr¾H8¿®Ö®*¶á¨°s1tT¦5îï_Íam³
+)Ö~PÄWvÓ¸6ÊÄC/W]ªGiª|A5NÞÎÑì©Hè¡Jù±Ïÿä`Ë
+-Ë
+5¶Õï¸
+_Ù
+íþÖÏþL±­½Ã+Ã$³ÑñýÖéØ±pj¤:>wqHÈÿ¶Ñc¸âÿÆ²Äeºß"_ï|õ¥6IÃÂ)ÎPó¤ÙÓ¥
+i³^Ü
+}497Ù)¤Kâ}?V|Â³gut3ö¸DZyáÛç'_Y´L9ò¤¾%oè?C£íX7ìo¬~¶0¾ÔhU¡Ê²Z-«]÷ý#tÕ{B"Ð£ï÷ Ëâ[H^Î$
+-S¥4¬ÁßþWg¥Ad}jÙ
+¶A.èÌä~
+ÕõlGÙÔ§Óy¥cëX'ç
+úÜIÇ«ú­4ZRåë¬B½n
+-
+Å%mÅæÌ4ÂVÃhç"/¨<²a­´à
+ôyzµA@]9É°Z´z5Ä|\ísë7|ïÁhÁ¼F¼~k>ÉºàÁ³QYÈ¾b!íÄ\iöÝ,þ´¾û*¼ò
+çUë*_ß*]áÚ
+-¦öm÷ÜJÍú¶_î²ÒòL+ð¯ywáT»ÓTê¢g²2ÊwxÄáWÎßj³@tÉ£>g÷y52µKe¦é|;ÓBáÀ­¯NMè­·
+À'ÿFdÈÔ¼eQnÑûæ±ÿtªi%ýÿÍ:úõ%[e'UL£;Ñ Üe/?V|ü Î¢Ð(Ér¯¯4Hcè^ºÖTVt"Øçâ­Ô¬¹µW,Uà4áCveb°»åsôµ,m(.Ö7UålðDM7Û0Ïf
+Ûü´=õ¸4Ö«bzfXÞ~*
+jj$n¢Þ}fÖ¬|á/ä²còPÖS	Ò
+A¦\óÆ²í[ Ñ	ú]¦×Þ>x£7%Z>3ù|U#w{Bb?f%y
+±Ó ºØ»¼¯ó^'ìùÄ~î-0LGäF=¦)ZÎ¤|k¾*r'oQ2Æ?o
+Ñ³þHªÑL%
+-
+-Eû¹¥5ÖïeT²î8ÔÕØHñ
+¨ÊWïúÚÐº!EÜ/
+ô?ûÎ*CåÿóGM¡%ÌÍ;_ùÇÙô¥ÖµôOy
+Óã´x(})î××½0|2?FozÎv»|æ2Ëgâ³e¯IÊÚ´l¸Y56£vpú:¡ýõóTjGýòúÕm½åû
+-°¹¯©=ÁZ´îpØJR,¶£
+-ÇõÚÖ.f>_-tV\oô´ oL6:{\=Ò0Õ.ÍuOµ4CnÜ¡>ÞÍYx½i·Ó×/|×`ÇÆhx'eÀ$Êz[±WEBÍ¶¡aKúìF´§p¢%±
+(³Db:Bþ!kÏUÓNÙ£í¨/Î
+M£#ªfïTI}<3ÛÃD)­V^²T&Ð
+²Ñ¬<,Õ!VÚ
+(_ÖzÃ*²ö 7Öº:ËlYKqÚgKbå)/®6bY=ºó¯:úÂîÝ£3ö¢{a§7tòØº
+Õ:üj&vt¤Hs,'ÓÙ,åÊ;Z;[òÎÊ$¦EçÀWAK$áWìï5·¹²FêËýÈès'Zz§mi·Y°3wYFlé%ï]"yoõfSõ 0ññ%ç-­i3Kì¼È9ëÍºèV¿ÎT°ªUÚÚ
+-(FL=úáQÙøÝìæ»Cöq¹5µj%Ë§©sru°b¯E%
+m@
+¾ÇÔT(Eôï8Uå
+ÇÞäÎ2¹n
+VfÊ\ñ­IÐ?Q"­z­ð2}¡e²5{÷þYì$/ßQø²HÜ`èD*õ¡;ÐÖõ¨S¦­_0ÞÃÛcWTwÜWå±À
+G'½AÕ,v)$`¡.ÓÃTX|ÍGÕ7Ñr{_°P±+s²Aòð©¿æd©¸JÅ¿â¨Zê¸üâÐ,\f)Êßgwv¢W¶Å?~õs¡¬Z×ôî|ñ¥ú¨Ëª/3
+¿P¶·1È¼sê{ÌC²£$i~Õ¡6Jâ=%K½
+öê^rüM`!etÕÆÖ!<zX)xZBoæâ>OBEYq¼`t90ö°=owªg"6h9c÷Äî¹«*L°ê
+-¦<	ðÏOE
+Ù¥x¸
+ÃR©J6¯p-$¿ê¸"YÙÕyâ,¹ÁäûÆã¬|°sà¬ûÛõö&&ZZO-¦'
+-uKgã²;cj­Y»ëöíi. 8¾NÖ@(},ÞdäPíÒsq¶£ÒÞesugúå·'ÎJ_l<5Ô\'íä®CÞ~2¡ãxF5ÕÄS\ÞUÊSäWÁRyüFêÀÎ@Ë´
+~Ð$|0óôcO×UA>n	º0»°Cöþ7z¨T»Rô 
+
+
+-öqÌäÆBc·Öï×ºTÌz¾ÎÝ¨1Ä³Ï['íJB*}Õ·ß<ß®[®A4X¨¼§s
+wGLBülõÞK>ûjXí}#?ËøÄ÷+$Ö}·b§{Ô¸vÒ'¦C92¹ØTçJ%½íúet6§A¯³+,X
+^»UÌ-¿ÊÝÝÅ$(,Î*ÉÊÓ_3)xB½w']M[$ÄÍÇ¡ÛØ;MjK/ W	Í
+p^³ëÍê
+ÝÇv
+q#¨Ûî0«Ênùd²Ì-JgÓÅAÈ¿é±qwô¹³nü`¤;hàÜwè1|'Ü®«
+
+ZÆ?1W|
+Ë7ü¦,¹ÿ¢vÉîõ<fSµÎ@²ÐÑx"XC1?ñyõ
+-ïÁÚjM/
+ûó:Ò£>¯pb½{Ý´
+º/ÉµTå«ÄMLvÅ\Áý"¯
+µ¦
+×ÓtkäF
+EÑ¥[Ze[Êr|ºüÌ¦é¼$Í­EÈõ^ªóÝ°ÛE÷c?vmRP)6Å¦O9dÂ7¢sYñÒ\ÒWkzBíé¢Ç»Ïø'H¤T<Á1÷Þ¶°ÉÝjÖ¥0Øv)´ÛÇ	n=:ý¼U¡
+
+%	Ò¡gþ@ºÄ%"?ßLÚúá)Ó¶5ÄÎ=ºê~­¨|tÛ{D¢ÍÚbÞ¢â
+§='ÿ«<è«qè
+-ïqÐ(¯Oò`¶ÿ5lJÃFÎ´ãr#ó¶¤¿5õ4³'#Y-¯Æ¸ÆÆTKÓìÕN9¼»ú{©ÿdnþ5IÐð+<ËapjÌYVù:ÍÕ¬ÖÀ¶£
+j|J­ÃÜÇ$
+-Ý ¾^Ju¸«V*ô¹ÃÉO/½6d5BÕVKdbPö¢K»«ñp§ÊË
+]Æ´UA²rJJ'°´U°ØÏ
+YßÖ®mäf¡ì¾Íï' Á
+Þê
+-äÑ§áÓ·³öÍ¬ØÙÓwÎÞBºS
+*/°6)[×Ç
+cÞ
+Ý,b
+-ãbcÈî2©.fëy[½åpöJÛA±-ÅRÈ
+>Pbg±ÏÕþXî7ô©B"8-àò&F»ÑÒ´Ä:W¹CãîÔOú!_ç	çí¼ÞqioSáå
+L¸S <¾}i_Õæ0w6¬eÉ.qÙ
+b6»{5³0Q
+æ°=Õ3§=Ðu)
+q«R¼ý<³£Ö®ä3È¤XmïÖªm
+ÞæðL^K
+ãh]¸§0»uº(ÅøÔ¹¡Õ´¡@?B©+ngs?*rLçv ªñ5È'³k¥z¦Gò¹)çöpÀé
+-³h"z Á:Q¸AÇ.ønÍS6Ã7·õ²ÆRàdqéUNí÷û2
+EûÞÔ#MX>7IáoÂÇñå?³_[awûÞýP(`lXeHeøÀî²EyS énh·f
+HzÖWí^åÀówÝËÃ*ÚÍ-òµ	ð Ø~QDÂh}½Z4­CÙ&ÐùM2£> É%ääJËÏ
+D±Ü³/`Nì­4Ô
+
+lfÆúI33µè¿j¹¼F2áèÜKä X>­ÉÞk¿
+|!tnHð6c¤|µ$aÌ¥/¹,Ò1ÂÎt|b]N@I5}kº ª]¢,i[øÖ®ÌtÃ¶°_³Þ¬nè)ÇÐ3^I{À¦pcü7¯ï¾o*u¿F7EÝ®6oëª:¹ÕÉøRf§
+½xÝ
+j_ò¤ëáóoëª<.kdnë§øUÛöy
+W¹û_?/pæ;½z¢ñP]yÔ}Ó_+jM½gx§và]ßã sEò¢ú®ÂûÑ0Zóõ£³×ç
+oHRN6öTkóJ/Ä<?Å?³%ù¢ÿ]©Dóf¾n_³	7+WdÉ´·1MhsIFztlmÝÈYL+ûÖMÈÈØ°øÎÏNjE´±.r©Yy+mî{ZKÌFÕJÐè0ë®oìqçåª³ëMh¼&¶þtcÎÖÐéºÁ·6ÙC²]_RVÜè&tÓ#U÷~w=­áÁ`ÁÒEzÿmÕk·fQ_õñÚ¡eÓ
+
+
+Ò\òÃÔg9uÞ»Ù
+Uä
+¹3Îç.Nö¾
+Ð5zç
+Zd
+YùB°j.xv/ÁF$´srD
+Æ¼&B8·uF¶ËÍË¥¤
+->èõ¿¬(õ#æ#¤Î¬D^"èj4ÌæÃX7¬¦sîÛõåpºY±s}âí<	cEV2Á>Ðîj©KÏ§"x'=©º£Å«þZòÄ+[lÍµÈWã´å3[7ð2l³Õ:aµEòãzæó
+Y
+-ð­OÑHbq³°¤#Y]eé±n2ç¡
+-v
+:mûL+`Lt¿s%à² k}? 
+-9I(¾	å¥è
+Î+:ÛËÞ½ëàÆA®ÿ
+<ûIú)jM×¹³ÆÃNWÓÖ'êçaÏÇW@y:Á·'ü m´¼]gmï°1	Lø9·Â}æDÏÕ;ç
+´õÞï
+Îm¥¤ëÍIïô÷®M2Dÿ &LvtðþA¢BL9ÑÌKR@µao×"LÓû<
+ý¦UËdqyA]çÉCÂÄt£i%ÀmvàË\Âê=¢l]Þ$ÃÈÕM{²°"Ç¾dÕùPLç\XªÁ}ë58<Òú
+-H³d<åóµæâÍ'¼K
+	ãÍâA|åÜUæõäõîÛjo>ÈeËÈ'Û]mÝê
+-Þ\º¶¶B
+SªHÇÁÛPÏ?6caõhÏk%À`¼VrÜúéKo¶iÅöpòò¯­1çGå¯5´bZ	³ènQ%ëe;Ù¯R^1H£ø6xUÆYË
+lºü°J´K±XE#I¹ÜÂäÕL2ÙÌ8eü*òeìQùñg´þ»ÇNãh|
+|0éc7M½æùä7]yyÒò"'ªíÍÈ0 íöiS}¼ÍLýCÛWù/Æ?=nÐ`¶ÝÍsîrô~~3]v¼ïÒíú7%Ô.!w
+-(§Fcó_P¸­t§ÓéÀëÞ¶©=è)Øz(eÇiáE¹÷$4Bá«ëkû´à¼ÄG3ÒÆm#-¾FL(Nô
+¤¡À
+Ñrÿ òspëÑN òi*©rãRRz|ßÈÐî
+þÌL3	øWÙ´
+U.äI
+à+ó»ï¯WS
+-ÌAUÕ¶Ç`îiÍO£Àkxø3ýÙ2ÂdE[/íËä7D¾l²=b!©Ì}ðá¯U°YÍà9MSËµ¥úÕ\«dÏqâ é>Æï×ªËy^ffÅ_)ÁLU®
+¨þÀ;k·_ñw)!^­Þé ôXÎ)-ùÁô0DµÐÊ;@píû,l.ÝÔj z?ÀxYø£rã	ÇöTjÀø²±ÐLA
+-)áÏï
+-ÏÓÆ¾ZÔÌZM¸«ú7÷(Uô´qª¿F¨Éö=Ón
+j¡jÅÉÇ áÏì¤þZ¡¦^YËÚ"ô§@-ÐÙc
+ìG¼£õ¨f"ïJ	æøP±ÍNæW°-ßÅeªØø9Q»àp"°ª¦\&Ù¶°Ö;)Ù	ËEWÝ#Fð©ÆâêÈ{¯5V¨é^£ÞIÀ<¿à»¿-HsÿZÿ³ø;-Q¾;ëÉSTÄë{`:*Æ	y^m®Ïì«2=Wn»se¿OdTr%T¬÷Wqôø´@ªRh+öÊ¾$»C¥f	)³[ ß
+-³FÅ[àiC¾èSfï¹6¦Ú£Û
+# îr"
+H%¶)ø[j¹ÐlSæq÷ªµõBw³[Ç/*wNÌÒ`×o ®z¬7â.$Å#WUJ$aÝÞVÝ¢þ·m
+-_¯;xÊ]¬TX²Ü{,N¯¢MùGd?/L¢¤0ê80k»|úºEk£.¨nÙüòT"
+ñv_×b 0ñl [îW¿ïuß#Ç3
+¿øàõI¶¼¥ùò
+õøX9ý³Ê@\bgÕ®Ü»
+`acÊr$6Ð¹úú¦öæwÌã×ËÅK6©¦Uäz?XXÙÊsïÈõu\Q&
+-­k8oÒizÓûsÉôÁùÅÌ,íÄ`ZãÀÇLÕÓóúª×.¼»¦ÞÓ/Ûé§*¹´ð¹]Û8£±î©zÚÏáÆõP´¥äþ$|ê«óÍ!}?þËª7´<ÿ¢é
+#jÏ­,±©­}YzÅ¼×½o
+Âê4oQn\¼øUßÏÓBF_¬9kO¯q¥nÁ^þ£|g
+Ó¾oxZÌisªÞ !oê´(²_j¾ªªk¢Îÿ&ýÔÄº`×¿õa¤3ºA±wKâ¢$¯d¶yhé!¯¸8©"Hlí'5ÿ¿k'|²×ü¬ò°<Cùùs=Ð{Ù¸T7äÂ`%Õ7
+Njá
+ÞäÕÓ÷°¡	¢2"JÁñ
+vqùô¦*Úfó[Lòàtç`Õ¯¦5iîÁüÈrAlê¤ï©°õÄ²%µÛ±pÂ"t}iÔgÀï¹¾Ç
+-,jæÅmQd¹v°Nx13ZÉ¾âÛó4´]d>ÉãWlßÄ³ÒOá®L÷aç.
+Ì[Jcåp´
+Dô'.`$iað®Q²yo¦øí£ÿBB7
+-endstream
+-endobj
+-783 0 obj <<
+-/Type /FontDescriptor
+-/FontName /GCITMB+CMSS8
+-/Flags 4
+-/FontBBox [-65 -250 1062 761]
+-/Ascent 694
+-/CapHeight 694
+-/Descent -194
+-/ItalicAngle 0
+-/StemV 87
+-/XHeight 444
+-/CharSet (/y)
+-/FontFile 782 0 R
+->> endobj
+-784 0 obj <<
+-/Length1 1747
+-/Length2 8092
+-/Length3 0
+-/Length 9224      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ¸TÓï6t
+-
+¤;¤¤;%$ÇÁØIiéNéîFIé	éPÂgúëÿûó<gçlßûúÔ}}j;c¢×ÖãµYaP7¯@^CÏÀË+ÀÍËËÃÄ¤F@@á8L W8û¼+È
+-ÄZ!0(@Õ
+-à ð	ñ	ñòøyyEÿR¹Z¹m Ü UÇa9{¹íìÈ8=Xl >QQaÎßæ Y'+hhX!ìANÈ@+@^ÿqÁ*a@8ñðxxxp[9Á¹a®vRl 0Â
+ 
+\ÝA6_VN ?©qã0ôíÁð?z0[+ ` 
+-G¸Am@® dt:@ËýCYýNÀÉðqóýíîOë_ÀÐßÆV@ ÌÉÙ
+-êÚlÁ@KQáàXAm~)ZAà0¤½»beTø}u+¢¬À
+-ÉðO~p +Øç!¿8òürL³ÔF
+æä"à8¿î÷ì
+-"óîÅógq
+¡0¨Ï_'[0ÔÆö
+-7g
+(ØÅ
+-¤òôO
+$ófB yE
+ù   ÈhÏó+¾3è·ð7äàçã
+sØ"iüÀ¶ äÜÊ
+@¸ºü|þ-øï	`" Ö ;0çïHdûÇYW°'ÀÙ~| Þ_¯¿Ì
+fB¼þQÿ]b
+#%
+-=eC?)ÿ-y|¸øE\¢B¼ >>>!°° Àï¿~þÎÀ_ì£ÚVà?o÷/*P[@ôÈìýEÄýÏÎ`ýslØ ÿ 	Cö3ÀúOû?çä"ßøþà·Éÿ_ïÿòòmÿÿ½¢ò[ÎúÂÿGnåxý©ìg7r64`È	þ¯ê3Ð­²»9ý¯Ta
+Y¨
+²Ï¹øpó>ùÃÁ m0hÿG/ýU
+d
+
+-ÒÁÁ¿öÒ÷dÈÑ:"w
+
+Y²ß"r²þW
+-ÙüA~A!««²'ArVm@¿[
+ÀÃ
+-
+!& $G?-ÌçWa <H+ÇåBÊþ(
+
+-0ÜY
+û¿q>^! µë¿ áß5ä_?sµ  [Ä¿`?áÿÆâDÂÈ2þlyÆ¿ÿ5d ØÝ
+-"ì/Àc÷k%\b«®ÁtAæî¿(2/<NVÎpìo©çºÁÿ±DnØä¿Ãó=ð@kÌêÀãä³A®Æ_Ñmþ ä
+qÿãõ?5º¹º"-~² ïPÈÄYü 8Ôt\ÕÊR{p}ÃX]ë3îD0Ï¿ö±WÇÌPv³´©z8ª½P:õÁýèjÜóù»¬Àå\BÿÜ	WÞÐ÷³wv ZÝpjÄÑq¼
+-¥)º)Kâ³7/
+{¶«·
+-o»àÛ&¢û '@ñ!}
+-5âlN×>j1=ãbØø9a
+±«i¾ÁÄ-j8æR®#ò»×iLúðòòû¬þTÓ|µÞ¡ªPJRoUúAJ²ø,Õ7pf9Á
+ù²ä8Ê"§Pæ4KáëüöøA·&;MùÀZ/FÝ`$szVNYlfêçÁ{ØaÏYÊ(ÇTcr1v\# ÉíE'§`4t-ýÔ^«£~lÆ|,`¾5ùðÊòUF<¿Y²$Ddðs6ÖyÄöÙÇd 	¶
+-&½ÃÛÈcNîoýà
+-#ºDèùNËûá°ã
+-Ùt`QgÆ~ß^üÁY"Cv!DÚ<¬Û-6'vÆ_77]»½KIÜDFta!ÖP Oh^_}%MÛXì¥lÀ
+!>ãQMõÇJ¡Ñ×A-É"¼/&Oî=Õ9%¬Ûx Óóý¾yµë	?¹Zn½e&*âI
+¸y?îfGÎx:ðDøÃJ®Ü¿Iéç¹¶¯®c¾m7
+çÉ6@"º§ý7,
+-Fi:Mb
+¥½<èídIÞöTnúq~Bb=¬$6ÈR©hl_
+ 00
+°Rï8oÁríµm>ÿËgz)þd3ÐÙ|§IóØùºÜEî)eá¥¨ÀFF ³¨:n¸¡ÿS¼o"ÄxVMAü Ü(ö¶Í8iµäùû¦Q-D
+-?O.z-´Õ=âQ
+ô^¢)\»k
+|úÌc¤%ôÞKÖ]wôbÛì
+õÓ Vpã'«%g¡-DùÆ±s£ùFÚ
+-'ê·üü­ªZË`ÊÉ>8|Ó¤C{,Ý
+n¾í0¼«Ï4éht3NÓ[cgPÏ¯6Ò t?Éû«¡êÚóUÓ*æX-®ðãàÉ_zX±B
+¹ÛÎÁ9l'
+fiìÒ5ø]B¤ÙWÂªÌýu+·ÌÊB7	gÁ%!jåZCÓ1ô*¢ëgê¯·~Ó%º³@Ì<Oï
+ý6è&Ãú¸
+Á>ZB2óÀàuïÆ·o:~V_K!hÉ]g"èÔ
+Óåg²¥=Uëâ
+-ô
+-W&ïðäÛI
+-a
+-©Kîm9	Ò=
+-ItâIYu#¤8C6J*º3T|oNÎ Ò=¼ï®+¼P¥óÔ
+FÆ3g|$ Óüµ-d[VåJÛ
+µ¼!Ýc1¤ØFeHÙÛx)ìy
+G9x 7l ­Ò`ë£6^6§z{4f\ÓwÈsàþ.vÂ4¯õz¶EI+Of?]984XbE%Fµ`dÉß=~s±ÁÞ DCú¼a_z-ÑýC°;þ<
+ä6ÜoC Q¦P3AÐüD 9BÿKm[(ÊK§8,¸U-¤¯Wxfk	ÿ%vná]ï³3Û]°Is¢§öÎ%6ó}ÒÓ×åGö>øýx;°ç·e?óZY¯µ¬©1Ò$ÖA©]X)·î©
+ß<qÔ¤8¼«ù` H(ýá\Ö)D­Pl9¢Î¦³ã
+c¹ ~¤Ç8¸üñf|agæ9¬=È|ñ
+-sô³S3"Hrìæx+sHÈ;¸õus¶
+zý/}Vxg¨kG
+-käz
+yâ±;É7næ(z8²§éBrDKùîÐ¥tý
+-¬ªôØºSe$f<c\þ~>áSC2¹3)
+Q2Àø÷nËVãÎÐ¡¥ÆÏs>åxeA(ÇöLðïå»'9 Öù5ÍBò Í/7Ç»­Ê2ÌÎw¤ç8qQO­yÄ4{B¡øZáî=%º»£
+-¢qz s4íCz
+çKìwqÔ­®B
+ïÄLRvº6ÝhE
+q½bÈ¼Å©Ío 
+(ù²&ÅNtCÌ*3­½ä¥|AËE
+ô;u)cB¯Ftµw·Þ´ýìeêQx¼°SdÃRÙû¥«µ÷=?
+-u?ék_Øb7uôÂ'
+-\§5&7T}ùêø"oÏ_GÎ&`¤¨êÊE³mjÎÏsØÒ¾aºäpÌ/½ûÇÚr3ïáXhFßZrÉ4`òbÜR³gMÔM^!ôJ
+-	l¤ëÈÐIX_ö]:j>k2~{¨¸ ±#ç×²ëØ°Ô¹ª{ÈúqnÂUöæöÀ)¤
+%z`âë
+yPöRçKYUHW6obìGw:âcq
+¹´}I
+-MÀÙúE´ýyª
+ò}ÄÂK´ePFè¢¶|ã®»æÑ6nñÞfnY_,EÜÛè$ßíZÖÍVÃ¹¯«J¥á 5[êg¤Þ+®¹×J
+>,åOFB4 Å¬Ý{ëB)½y>54/zO«÷ø¶F<½G;ðàû¯Â¡ss$Þ3ÙÁµ°J¬ð÷k
+-²I­ï:®ºqåÛ<Sý@Oø¸F>ÍKíöÆ× PYl±mqãÇ°´WÊ|lÂX¥±`W½ÇA¼4
+w½Òànbâï³m~ßî")^ú¯{
+·R×(]JFíä)ãÏâÞ¶eÜõ¾ßþE?\~Å§ñ¢-¾?-ô~	ý0U4zÀubN%*æPcp¨vAâé×ÆÍ1vÅaÍWû¡þ+n¯J&ä©ú±	@àe³6vÞqÚÉ"1iÜ¹â:àã¹ÂÎfW|jöµâc&_.Åx¦ímG?Î^ kC¹ï9Ë¥y
+x8V4V;íWóÐ±[~åÅÎgNÄý!2<{¼g¿WÝ0âÅùû7WNx¤«q<3&ÒnbË¸ö2j7àGþTÎo/úch11á	¨^ÜFÁ±h¦ÇªÙ¾n=Ê×Ï;D)¾°áSËÍw¬¨tXö¯ÈÇ¢òzS+UÓ¬Ñ¹D¼Ý·*{¦³Ëä
+2óPµ¾uÁ¨*¿G ¡âÅÛ×UÀ>ó8¢ß4ñq!MðÓÇ
+-³A	ÎÎ5ì¥ßêVÒÜ]µflÆ¡ÂÐ
+DÓh¶¢Áì5ÔFbßº¶¥;2ÄØÇVÔilQÇ^õ&0[%8sÐøµóa³M~M°ë­Ucß
+4RëA]2lfñ^49¥ùÈ
+-=ºxÐ0§ßDÔ
+·¤>¾¯º|ºkþ\zkZ|"ÈþÔÂßCÿtÅ ìo&JÊcï!û¶S{.Ú~7Ó¾?£3¿gzµ|µ{1và¢_Khcü6¿$²ãÐpØ9ËpÖr¾ôu¨à$
+-Îü6pRÓºðÐ{G±z¨u7?¡µÖÊÍðÈkOEÙ¯
+ð´ùÁÉùôH5
+Ö(S[·øÓâdOvÚ_ d]l·[Öðüã¨B~y$N4 b'ÛÇã~ ÀeâÝLwÃl¹ôÍÌÙÒ
+-âµNúºÕ·+SO0#iÃ
+-ã&øªµmÎbWq~ÐëÏ:ßè¸ÿèµkaiüò;wËÏ¸
+Mu×¯(Î»ý=/æRíMpûåµ?MzSJñi¢Kq,=	X[$ù°ê-=Å=:öÎrn
+m¾]6VÅÅ¨
+o<`K§L¯&³SjÎrý{§dÐ×aq9þ³
+ÓòÊ;WÙ"³sñ÷%¼®²4Ýð¬0÷J;û¹QE}áþzÂGY³06
+-+ÿf½ü­Æ)Ð&ª Wé±sÌ¥ìæ14ñ,7@õ7Ìo|%VÇû
+S/»h§¨kî-s$ñ«%ò^x±8
+À%Ò
+-vEé-ºPKt:>~Ûd)ÖÌTj<^»&
+Ú_:öÖÁ¬z&`$¥ç-½øô0@Róêå½Nk(
+Í+
+-kcV)Eö¨®¡1ÇR/+ØzäÊ'@ÀYòF^ìSõÖ+³Â ÜNê8²}×>
+-	dÃE½Q
+kéDÜdkÛöT¬
+oGFGGF³'û5dè'@Û¼5íòèÏRdNGÎ®²/Ré :5¯u¶Ò#Ð­×JÉxÏî5½~¤èÒ¥8%nq7'KÐ
+-Ý'ÑÅüï¤ãÃì-.1×ètºa
+-
+ oÜÏ*øÊÂN~ëb z v<åÁ.ãw¢dË°=o­9L^[Ï¿òzÌºQcÉôÑ§°¾C6¾êÙzn»-WÁQ9çu¬°zlúh§¥öèNãÆzIRªÏAóYÒ{62@6B3rªü½¹Gs(Lì~Êz©ÒwrÄåm
+-ÖÒî¹:wRÖò:Üæ*Qv_ÂiÉJ,ëòÏSÚÙÐ«Ø.0î²,è2òÙêæX[d5=ÐÐhÃijÁspgn®¾_ý" Ò¬noðÐ×vó'w´MÔ^içDqpeWåD¥Ö)~3¸ÒfhW
+-å¨è6î	HóV°&_`m¨©3ÔÅí
+1Eß³«pÅEC,«¿
+[ÎmoÉNb)5V¿^3V¦±æKlZoW
+ôiñ
+Ô57Ê ÄçÄyÍ¨X:¢ütñÔJÚùÓk*µT{
+IQ²=¨gp@.
+ãbñ"OImAÛ¾á
+f£i
+ºÊ°Å^x<Ö>¹÷Ê´-ö6¶ÄLJRôMà=Ë'Èoe¾ª,
+·kË~ºØAý­kò;Úæ[ÁÜT
+²ý	÷OÝ×öºÏýÕùdiÌ¬HÏÇ¾*Ó85û.öRÈ.î%aÚ}£uñû!rt	Ø%F$±ÜÚk*âÒ¹ôú
+á îoàähfÕÁ	SFwnßF¸h ¤¼$kBÙ7­åÑº^ãu"ú©e]ëò ,ÍWýÅÉ7g÷_.ä=RDÝÎÓNdF P/Ü¼ÅÕì|<zE+þÆa·AüÇ'½ä
+÷Îoò/¤»UÛy
+¸ky¥¶1PÏ9>©éÌðR2
+ÏTLIî~
+ï®
+{ÂTÍÖæËéG=n´¹ý¢rû#þD'ùë#e
+-
+DEo*«ÞÞÐG6À2ª?
+-xmîKÄÔÏ¼Qrµ[7Àè#
+e
+-Kfö­mêÄz¼¬T¾¹ ºW¡áþeÕQ¼±
+-Àû:ýzi6nÖ¯:úìáK­
+xªp'|îèªl]Ó.É4¦Ãã-¬; í¾¾*ü·â~t'/køg?°-bë¤/^n¤?¡U
+·
+C/ëß)ì)Û& ÎÒ¯LÌ±X]00
+-¨ùZê¨ù}Î¿qêö44+1ßï9à¶ODûöCIû¶5»
+Ã_¡CwH°8"znÔª-5	µ;ÇVQÜîA$-Äaèhð
+øåL>Wh	K:>ûáX_Ö:bTÃ\DSLE@Ö#aPR?¯¹$¢³qXÏã
+Iá¦?¦¦ú2
+`1J¶!åP®;ÑÜÄÀJ·ñé7;vjÍæ	£|0ð0§}>¬ÈÊ2Ê5Ã8åâÎæLr¾N®Ð§-¬(
+-{8Ñç M º~ZÅùÎ.Q.2;z¼Qû(æ\\Î\'V«,Qà{7»Ü`7h;ãUü½¹Z ;ËY
+º4Æ·«A~\¢d:<}E_4@9Ò
+ïö¦kîÑ
+Øo¢E[tcßî¶ïUXìñKL]¥
+p 
+ 
+õ×NdÕ
+SªæÝiÉ2iÄ«­ìâ!Ü1CçSµòXoLõj*
+-ó
+-þ
+çpTùÂÿLTÊ6Å¯ì
+-pòª¯ù\ Ö\ñ³-Ï¡<´¸×¡¤qëü(îNîà)Ùz¤}.j11YÛLPØlõ.ñ1?¦rÂsÎJÏqßsx
+-Üó°H9GBQhc3láþØ¡}ÉV¡É/Q8W¦ìõ¸Çâ£«>dyS{9,YºùÉCóKv¤\,ñJKpU{3Ä£×b2B7^mE brÁüËÔw;;QÞ:[
+VqgÉ»a[à<w¦£üpN~d?p#[ëû×}Kâa¬ç4ÕR!
+-ùµ[y4
+Úl'RÌOÃz³Õ:×´Sòêçùgñ-äi
+Ø»i^*¶¬dÞgÆ{Á²©(5êÛ,nNÐë~ÍtE÷±FßôøÃì8É j@åðjµ#Ä+òáî9'æf£OîfâeAZ¯oÃX^`Í±ýN+ÔlRãùEÈãtCÈ¨^°û©­&å»0ÛLV;3ÛbÃô
+Ó=ÿûÑ|ßwiÍ	dÜ+±×µ2Ý§k
+5óßsÇÅñþñE¿eåÇïâ2©õãÌ{¦Þ^	sè ¾Ê%Ç9ÁT]ÙKÖþ2>q÷½IuoJý¯ÙöÙêÿÙj°öë÷_
+-½Êâ@	/9ká2=³glÛÉ}²°Ùãd,.<ô¥N·Í½ç(=c¨[
+iþ,nGÃ¾dôRK×¼¯(z;
+-Ìçª
+²Í¥sù¼Ñm­ÕúðP·´§ÀóýÎ>]¸N?Ö¹ÝdüzÇ­Þm{N&Ã|9$ÓúäÂ[¼µ.MÅkî¹Âüýw#{Î®¥¸od0dz@Ìo_
+$§Az#z[}L4l;<ÎºW+oË
+ò7¹á¤)¯8úká%&§,TX¤u­%ßÒ>o[ëÔSÔêAs
+ú/ qTÞî(+ë/¸IÔ¼kæElßl\+ìarn
+ù§$5(`$l¤\ªÀAÃÏ
+bÓTüS-RC|áóïºuµ½Öºý6ÿ]ËûºØræ Lª0f¾Yý´°0A{°'¹/Ldü0½ñâêýÉ
+§¬ tXeU12'Kúf42}
+-ÏÌ
+-ÎÝ¨És'?× øt«üRI×ÓDc-ªGÉü=«k7÷k×ç
+-ÕZåøûç¨UÏ»¥Í°
+eíX
+-µOÐ½eS¶ôpNè¤ÄÒZ²ø{¡F]{Ùúj924þìÆ'¥ü£ßr·	ô9neOx¸¢k5>W'gðM×¢5XêSVa	íëÈD6Å¹n ¡"íï	=­ª;
+
+Õól´1R¦Q¡ÍzU6LÙ ;zýÓò·G%W(
+¡Ã¯\¡«XÌæz>u 8Õà
+_;9·Úü3c)Db
+-qäÊ(á¢9ïÃ´tsT/ÊhrªØtcü_>ZßÆ
+ &Ãå>ärûìú\THF`Ãùp
+Mo²Tkz
+U¬lDVg\{¨8(³^ä4PÆÊI¯#gÐ@Á×¹¹t W{¡I>v¢}ÃTiïg§zÔG%¥r|{üùgß"ö=Iºã »½8í"qWQk ¥ÓºÐö5¥gP£Äs¯dÄç1aÈÒîÄrb!+ÜTÓõ¨<[dný
+-+@Í¯¦ú"0Ê;û@¤Àãç&ìÀa<¬û1yØÔ>ÜRÍ±K÷p<¢xçÓÙU«çJD+w^cjzùl­Ú´>(`Z8­£êßÜ2O÷¼tº°3é´#³¼JÞzX_¨éÂUSr(E·Ü!Ë~
+È:Ï$ºY\)$+(êÕ!hì
+­fr²8IùÐ^wå±F¼)o©ç/D/N¹&ÅfÄ»
+
+ºî´
+â½6U`ÆX9¬ÊýÒ1¡hæîuÀ·Mó¼>òÛ¡ÇÆ2PÖóa{,'Úõ£ªøma´{ØÄt/²ÂaC)´F}fØê(Å¥
+®®4D/?)]WÐÞòvt«YÇ%h´T7xÃÝØò
+-ù8<%í`ÒâÙè»ûñÒßçS´É«U 7O/CÏ±{Å7º
+-âÄØ0
+£\î1¦YÆðZ %1ïV
+Ñ'+GK&Uµ3î
+¦n[õI®aÀyÃ
+
+Y·ód)FÌ^ Þ®Ø¸B6WXæT})ã×q ô^ò>AÚtrx8:9#­rÍshi,^ó¢>"VcC
+C
+y j§;Ñèrô =I
+¥Øâ?n,Ga{.º÷É[¦Ì²Aóþ×cßg{ô
+D/Û³9Ð®©
+-É7ã²at1rt(\¿þÚ­À|ÒhRüó»jjéWUÖºÜÅä¬L²h{oUè!Îèk1ñzÇº [4xwµHAghè{}aM*;cÚ}ÎoyBEº×,ÅïØÊÛBû×5¦
+Àa),{M¢ØªûÒóßVË£°¶PÏ=,/
+%6ã°|ÁJ'0TU;nlãA¯
+\íæH¿ÙFsë5XLås8ú¬¹Ä}×ÿTÿÈ¬(LUS
+jÔ¦îÆ¾ó7{RqPÁ*G]b³¡É8Å²rh«ìuSÿföÈs:m«yí/xàùD×6
+-¸\TiFÌ'	ë=·;ÿ´Î3jCþµ ª9
+Ù{ð<fÜR]ªe¼ëÅO1 /¹é¤4;F2aAAM¹÷DÞ9Aµ÷
+Ö
+ë)õy¹SUÖ^hëêÏJ=yå4­z2'µÏgñ/YÉ
+-á>0NÝ5R´M´3þÜhrÀ¸!SÄØeûMëÁª[¨¿
+-Ü?Õ3êãàÕç´éD<´Ï}UYÕur\ÓL4oì
+x(n²n÷­{N
+-÷PÏ¬úBß¥¸â~§³,dËÉ;
+ö»ëéØ\#Aí?*å«~
+ßªJS]ljçÒÍÑÐ
+ó8û¸ÆÓ¦UjÒòsl$s¹Á__d[X54"D¹êµn8ñnV0ðÎ<Õ w(DV=
+tö{Ö
+òöQÁÎ>ñ.s=By¥jEeo!¢'å(//j×uÍÑjGùïB¸"@ø$)c«¹ì|Õ
+?Dóàsò&Ü¼R´m2T:2Ì<èçòßE£aVõâ×ùe>¯l³ö1t=ÂGçgrJT5
+-xÜem>SÉ¬uº	n%.ú¡¢ñ+
+-ý=±·ü+â¶Ë!¸¹n6÷\ºn2ÁViã vTÙ²8õÉ½¸,3|}L­
+-÷ËsJ]×fURfQF¦b@;ßyìVç®Æ)û£í¸ö 
+
+'²©Sã¾iþ½Oyö
+-èîFíô°T_û§j¯u¨Æ»/Æ^ÀéÅSÜÆ×
+=/8Ò]?ÂÙÏ[n®Ù
+Yr°õÕ|W$R"s§Ïc<
+vF¯2´kH-9Ê³	÷¸ fó;ìËqZfÜ%¾¨¯Èóß-§h
+-ArÌh:ø}k(g¨Ðû^GÚ:¤YlÞß
+ÕäL6VäÁÙk¹2VbûÞú¤qºBUZ½¥o§¦iª'·2XÌæÕ{×Ôyê²
+¥wÅß·nµB
+
+Tåý]¨òßeîqmâ
+ÏbÏÔîû¥}â¯8WåQfñ5ì0Üí£Ú¢³}þr(Cèåi](¨
+®eßâ.¸¥È@¾íl©¾
+3a'«wdK -ßºEêùhWgóªguÕã
+jÓôë÷»¹°²
+fR2ïõE8nY
+Ë»¬÷¹ ß×~¢ÿ0\êmÉ¾Û¤~.ùxù((ä
+- Hxüi¡Qÿ·cò»'ªÏl¿j0¦;äCo²è`gg Yef}7Cn¦²v1&
+-9ü<
+-üSÅ¯Íè´vf«¥JåÖôFpI8GêU\é
+
+/bÊ09v&ÄÒt
+2|¬
+-½äÁ×æjÔÓ8ÖëëäO#**8 9ÞLôRpZvÃü¢Gª/´fh¦ÆÝ¦ÐØc*d`<yïÚ)
+b~«ºà¢Y]Ü¿~õàì¼Èã¶6,W´Ñ­ðî3ÍËç_zw©Èf~ÁhérnÆM
+/¼Ps_Åmg´É÷|tØH.ùþyø,àpÎ{GÓòéíùqG"ø¾ø¡ÛúÏã×CÖÐÝDÉõ·ÕÉéëèZù	W¶ù1øàÎ/ý9`oü¾kóæqÞZ&Ö­xð¶[§ýc
+|
+-endstream
+-endobj
+-785 0 obj <<
+-/Type /FontDescriptor
+-/FontName /XGMSHV+CMSY10
+-/Flags 4
+-/FontBBox [-29 -960 1116 775]
+-/Ascent 750
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle -14
+-/StemV 40
+-/XHeight 431
+-/CharSet (/arrowright/asteriskmath/bar/bardbl/braceleft/braceright/bullet/element/equivalence/greaterequal/lessequal/mapsto/minus/multiply/nabla/periodcentered/plusminus)
+-/FontFile 784 0 R
+->> endobj
+-786 0 obj <<
+-/Length1 1477
+-/Length2 6737
+-/Length3 0
+-/Length 7741      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚuTkÛ.Râ"-%CHww#-
+-ÒÃ CÌÀÌÐÝ)Ý¥t	H·H" ! H7ÿ¨{ûßß9k³f­÷¹î¼ûºßyD¯­Ç%g
+-·<ÃP\|Ü¼â@M=cQ /¯ 7//?àÑ#}(Êò
+xdA ¡pøÿrP@@@(4¦B¡ý4á0 «#O È',Î'"ÎË
+äçåûÛ*Ü Ö@Mn 
+A
+)À=P[;ºÌß@V0OLLów8PÎ	A0 &eqBW
+zp0òüW
+-VI;ÊYÇÝÝää#l¥Ù8îP
+P Ü ÖÀ_O@N?Ì¸úvPä\nr! @4àC`Ht+Ì ¢õT5ZÎØg?À¿îÈÇÍ÷tEÿJ
+ýÁp'gÌ
+-³Ú@
+!@­ÇÜ('³þårDÂÑñ 7Ôd
+vøÝ9øXNBü
+:£ÜH¨ã/<¿Ò oY	f­ wrÀPHÀ¯þ¡}í<&ë »Ã¼ÿ:Ø@aÖ6¿HX»:óÀ .®UÅ¿\ÐàÌ
+-ñ	
+
+!.@ØçWz}OgÈo#ß/ÍÀ×Ûî
+´AøBm è7ä¢®_ïÿmø÷	ÀÇ´Q@+-ø';Øü9£z MyÑÚãòþúüçÉ
+-/k8ÌÑó÷ßóåQz¬ ¤ Âññlòòp 7 /KLHÈÇ'*úþ;Í.àoò¿Qmô¯æxÿÉ¨
+-³Åþp@_Þß<Üþë_+Ãüw
+'p´!@Ö¤oÆ+Ä
+Fñý/ÀïÿîeùIÿ¿zìêèøÛÌúÛþANPGÏ¿
+ÐRvE¡×B^Ø»Aþ¬²&ÄêêôßVU½
+r0[´Ä¹ø¹yÿàPäc¨ÄZÛýÒß£@×pÂ Úp$ô×
+ÅËû_6ôÖ
+Ðo$z`¿MôRý»®
+
+·þµ}üBÂ@òð¢EÆV7zM­!
+¿õ
+-äáÁQè £/Ð ü« Ds"
+ÐS°ûeüóóy
+Ñ
+!.®èÁü¢A'(ÌùpuDAÑíü	yPôþBþÕ-Ø@ïòoQ¡©ü}þýâ@< `Àì
+,bÿ:¤å´FÚëÛ0î¯mñÆ½B(æéÞv·3'\äYW>LÓ)
+-ò¡fÿq:âaÖ
+¸ªò
+¡Ô»"¿Ç7pvÐi
+yh
+-§²
+I\!ÚMÐ¡%|fmÊd4u*Ò%°^µVxÕ\7Û:_
+ß§O¥F=ËmÛÂ6¦gúú`lv?aîª¯j0z
+
+-=o¡<ó\1Íø°°ð>»¯7M`?_½»Z¸2ÔK>w0±,![­Á,/t¬PÏ@YäÆ¼êí5kêØD(³o?ßM8|Üø
+[Ú´mfBËÚ×j¯÷õÖ
+@b¾<pâùÂ®Ú&kî7Y@p¬Ï falËÁ !Mt¿!
+A
+Äç¡&æN{ÝV9[ëY.Fÿ2ñòÊùØ¬H/¹î7Ú#\Â°hÝ§ý°ê|"fêæO é´ÙvûÚ!JÜ{G&ÜO=ÊR
+-Ã5$]hÀî1Ý
+lOåÈîó­9:µXl-_!£^Yyì^©£¢ý _ðqqEgbßF+óËoÃ}ÅfR1Mn
+öYE±?­
+¦
+ÞMêãù:É`RÏ"tFþðs
+o7
+ÅðR
+-¿Ìw¯±î»!Iû¯ê­][<<à9I¦éSÅ¢ÂaK7Ðµ¬qôÒg~ÎM·8Ýµþ¶]rÄÅmá¬ò¸ÙOP^Ï1_'öñ½CòUºì	Ñ1ÿøÙXá
+dÏß+-)ú³ÿhâÃ;
+-µ_,éêN6©ëÂ¾ÿàþ`0À=+
+eÌBÅÎ­Åa*mºîÁò`ûcvjbÙ¾WaXÎÌÊ¬ÛNQk"Ù³8¦ANôRÉ1Ò[àú( CÃÝÏûªfÖU
+^^É d~ñÑ)¦Õ­íDÁ^Yn¬V½
+:óú !'
+©!h 7ø§]ba¯¹D³]ûÑu
+õFëó3§L¡H¯âíûT
+â_)EFÃ¸ñvå
+[Ét>FP\ÎbJ^¸|¥é¼Å{BòÕÉÿu£'¯-SÝ÷@	÷ÜgDìRy'8²øLYäÝ1EmðÍ-}ÄI#
+-ø@
+ç¬"Ãä\w¤£
+Ð#@g{iÈ
+-Ù×~(.©yÙ~[,ôB!¿ÂÿX^n;Ä{U!¸£|ÀÔ÷d8Þ@Âã ¤
+§«>ù"ï]@ÞÖÉ1
+»M¡2\Ï¨_ü;òÏ)eªöÂAðz³¡òJß-â |µÏDµîë?abÙìöHlSÉ{
+ô£6Xy:®gÞ9j¾eIx~yÄ³9ô%ëÎåë!e¸BÃ®ÒÐî[¦¶²vCBn³¦%@úN±®0â®É|ãeÿàWß¹~÷!½d8»'¹¹üLÞAÞ§[°\LÚOérÁxsÅ%õ
+q_KÝî¨dò±ÇavÆ#¾]
+/°}Å²h5
+iO!Þ!03vúi¬+SäÙI¯
+²~H´­>wd5uS|ÔðÚKS|DªÞh~ÙÐîQ©Ay÷°
+ûd²!fÀ$°Ðk
+ÏôDBp5ÐÙb£áÉ®óE¼"e&òtåyøâp?ÑÓÄ³çõ>
+kÊØ:)}Úõ¯jz¨#Ú-â[7ÆÓ£¤n|
+-L²=wGú¤«m´²Y:º3Ò}ÛÍ3LÐ'ª>¦°!¼í}µ²Â
+·ü
+-ê\©¡ ôèÊ­º$»¡ZÇö'ßEèÝ;ÉÔ?`
+n&®8kå]M¢º²-¬×4ÿöÈÖ¤­$Ýøå§°2À2VQöÛÁþ/û/K§9_ÛÑ÷ÍFÆÌQí¸ÜX kq Ô
+-êr+E8~"?ö¦Ê§xàM
+`k*ò
+Ó\¬RyÖÀ3ÞçÐÇ1(® %H÷2»X03 fHfÚ1!_29åh&ûù³ÀÕíÕ¥°4Ýã@ºêª½·N{Ìq¯_÷o
+¿=è¬	1·Üf¸ºNØ<V®:¾à}u23^küó1SßÌÀ\Uî¾"¹´û¬îe`I8è].é7ÑNmdÉ8Ûi
+ÃK%áaaÆ·î]%¶-~§¹L¾sÂªHê§^Qýõ
+&\¶Ä¥®`Öë»Æ{8î²ËÝmv¦=É}M­wÃÚCñã­À ¶6zî%ÚfªOãF¡Ï¾FGpÒä»°Üe
+ü¨$£0VÄUjuá6È®¥'âøïÍM©f¿Ñ]íoçxß­n#~'yZ«MjÔXÀº"µ4!L>Ï|
+-ÉV	£d9Ö¹ÿÀ^Ì¬ËÝeúÅ¢cÇ«Ç.÷ÄP5PÆn<÷,ñÃ|6Ýn&¾ÜÁ¯/ªBªÒÄ»º^M¬×¬u¼õjxÌ@3×Ì@^Ä2n(ÀõÝªwÒÎÅ1vÍù³Î<$:5bu[ÏMû!3¿c!MÔ¾39¿*9­úU<Ë»rpUø³FD²jÊÚ!iÜéÅ²
+-ûO¬?<1q­È U©Ú]ãN}¬»¯Ó$ -9æ(Ñì5z¦ðÍN\Üç"&c/ÔjçÄ?*ªå:Ö`]îäVkö³b¯ïM
+H)ã5©ÕôÝZ$çë°Hrç6ÉÌI|èéRNªÖ
+ÖÑ×y
+ÇÑ.ÖÔ:"g`·C<óï·k£>´¶[êOÇ
+ÂKCw¦£
+-jü?½²f½»pñMÅtéSÔòyû0Á|ùà
+ù
+Cu,Cú,<ýÊ®5ÇàPã7¯î«b]DG8¾ùîÉ
+ÉgòÍ¸Zà<$ÌºeKXal5±Êääü«Ø¤¥,¥±ôKJ
+lZÜü4­yÑìê²¸
+ÒËçez6\¯µXH
+0kRgé^~°6º¬ª;¢§ÎÝ
+=æùALé×çâÇXò´«ÍU9§éùêË]èOlÎN(3üi½ØO4ÒïX'
+?ùdaç»`Oè$
+W¥aùõ~i;:±ýéº
+- ;îX¢zôÙMveE8þ"í~Åam¢­Ùãa2MÆª<Qª
+¿Q£ND}{É©­+¹«u÷hÕ}Ö1i¥ôsnáÕ-»Û±ä
+pFS&ÒN«çqR·ô¤ËgV
+-£
+	&~þØbÉÈn*³¼¾§2,¼pi[yùJÿ¼ð¡ïêøN¸çP¢ã
+-<º(1^r9º±Cu©`N*C>2^êc]¢tÞµÍ³ÂXanûlÐWö¥6/N\@~ðmüÊQÛø+LqàQìØjÃÔk.Åü³aÌÚYu{ôß§í´i¦
+­7Â7CSñt^·Ø(ÙM¯´EÄ×æêäÅÇa]Ï{J_¾	QiOÌ,<6
+á&5cÕõcÏUø!¸'2dk
+Î[j5
+H>q¼´=ø~l_·f«¡Ñà
+3
+7ûRâUcÇ
+m4h[¦¯
+|H koþÃ»
+T¨+5$ðN`Ø4
+S:ÊJ¶°ÃäÜ¹T
+Ä0ÓÃ(¯
+¥ÍÝ÷Ún[0T®0wç+zåGÍ8M]1
+ZzX }_ü+@ÊÆrR.¥OñrEÔõ#d¾²YÌûh°®
+-òÓMÃ:9ÿTz-¥]âiðâ]ÏV7²v+ÛC.¯QM¥òw7½/N¯§ÖõÕvý¡(î÷I
+Æ(«üG¨C'ï5À¤Qêâ«lf»{	øÚx±qôEIGrwÐíBJþlæQìË À
+[ÓÄ{·ñõ$ÛU&daàMìØ|pãUÖÛªVØ×o´E±G·¨¿L÷ö
+ëË;OnøáHO]!JE¢ñ#u-ÑóªG;fV}-{Û83O!wé]ÝÊ©Þe$ÈºÔèªYã§}¥
+Êk¶Dvi#êä
+c$&ñ3|âà¥m Í¾Ûv"Q8}§»¾*Iè>ÑòÂÁ­C÷Jgp}FâtÝ|âñí´MÃMÕ*ÔS'YuÏçëzeÞ¦×¿tc¢k^Áê¡82-Yý¢2a<Feæ¥}Æ
+-m
+NdmL¹ÊùÿÔ)BZû´w{ùÀÍ
+@mÞs9bý)Ð½j
+Ï4q¸§ûqÂ¸µWwÃ:aúA¦çÍd'$4Ðó+7cyÚ§SÛOìsÝz
+ðÅCõWæ
+1ïÝGë½÷#Xøl,P=¯½åC¶¤¿¢¤Úß Â\´mÂ
+-
+±µ?Úâ9Xû¦x¯HÆwÔçNý±toªkePð[[Î;+MMÎ½T\µÜC
+-D
+-^_ó_~xOÖVøºî«äÕ,
+Ö'-¦æÅ
+0
+-5kÀI
+
+bGÁ$Éd­A²Z	L¸óµ9Õí\Î»}CÛUije¤@âu%z¼º
+AãôÏ£,\f2·lRc6	Nìñ
+Ý½SJµGIà
+-^ÙyÁX9æ#Ù>Î®ã«HüûÄ£
+ õ;*B½ùerßOSæVQît,f¥¾Ô?ë ½ î@«Àí¦Ú
+Y¼ðGÑ@©Ë¼ÄÄ!1QAÃwÝûåÏ#
+ã]éB]Ï.,ùu¯/Aç$K¼²]¶§¬¼ì=cT¯6ÛóÎ£B®ÍFÁÄ§ïÅqfÈù£ÂºkR·¾æÊQùªc'>ÁÑhmIsLÙeÓ7+Ø|ëÝ,¼3`
+-z»ÚssÆ=Ö	¥!ãÐ­ì0ïÎGZJ'+añÎGprpÄ tÛ½½û¾8Øåd.mDÎo®
+hHÄýwbûßë)
+-ÞBtàýø®¯ÂÂÊTë=d»«~*
+'¦ÊÕ×ÀîxÙÃ¯_s
+-ª¥@90þ<¼ÿè@ÈI^Ótd6å<N¬BÌf¸)ÁuSù±?å
+J.iÑµnu_K¥¿&h
+*¾à­iÿ¨ÞZÉrÄ,Ì¡Ìº èñ¾LÏ%µ F[Êt®¸íO¼ÓxéH¢R5×ÛNKùtC?*Cü¹ËE(­k/ÕAÙ=¦½Z6ÂìFÂÚ§tw8ÔÄ¹	æÌOâ¢Ù­Ê"Þ×'
+-ñd+Ø
+{SÅÉ8 N+£wq¿¡:Z>3	¿ý|b²-ß*f
+ý8}ÀwWcä
+yj²£ñªmU"ÜóãsÊcº0;"Gï¹;Üµnë0 Ì@åGvúÍ7ä+Ò$
+G^QÊ¯
+×´½³4ú/hÁ´µø ¡v'«R¾E^~L@N	ZUvÌ;q+¦¸mþÑ¯®'I
+}H
+ÚnÞ«Ù;Ï6ÿðc©î½é§~dôÉ<
+8OoñE8SãÇÄ\
+Fæì
+->ºµOT8n³ÔÀ]=æUaWLÀ[.>üÀ-LèÅ´g£g}?á[ÐÂ¨Òrátàå[C<YP£b8|x
+°qê¥ý0ÎÉMÏá8­;þ~
+È
+-çÑ
+-HÛ
+×¹¹H{Ò%=K_uÐWx°máWÄÝÓRw¼}Rà®3m¤D®¨æ=z3Ub%×
+i°ÒÌT@/Ëé«ËHXåÝ¾@æÍéÐªÑÍß\¿«vl¨iÄCpKmU.ÎÆVüj±<Ùû
+ån$N
+¥âÄ'÷~ Ø´âËjÓ
+ÊTð¦
+ö³æ) û;%·«IGõ­	ÕIÎ¼	Å~ò2²ìíÉE@ðtVCNîtâé«¼±µðê.
+ó³¥Ai
+äN#?<Ù7c5OcÞÝü~#Éì]×ê%õ<ù IÙ@L÷
+;rò£»ë(ºÂu¹_<ò÷ßÛÅ
+-ÅO	n¬ËªÏÑKÓue¸?½+ëÎîæxc¨®GíAôtÄ ¶áÎ@£ùÆ½gìï;éNæø§]õôv
+§çM5ô·ð
+o[
++¼8d]ögX1¢R°>ìmÊ°8å²@P8Jî½íéÑ"ÁÖíê,®ñSËdn?ñJÏ5ÌoÕc%;ùÉ0ø¶<¢®Üª>	bPbÌùzJ]IU,¹RÞ|;Ç}?Mt6Äh»=GÁÜî,1VEFÄuù?B°êý`äë?ÄUX©{C7: u$Úy«FË2"ÍØ#xÒB(©ÿ0
+à*Ás¹)=TÒ[B@ÉA&ùOUï7H[ôUl¦sDÜ¿Æ
+«Å?âÄñ),fÃ[ë
+±2ìzWÿ]U£ÇUy[¼+Ñ;_P0uMÒûÉ7+Ã«áGÆÔ5^Ô÷dü í
+ÝÍÛVr-
+-Å¸we¶2À½kë_w\ô	èi-Í
+Úw-Ü7]R:¤I¯#¬òvw'=¿ûê()v£¿äOï®ó}yô¯¶CÀ÷göä¾ØÜ3jè¹ÔöÌO,î´Z +·e#¤ITáW]7×©`	þ`(`¬©rØó(|ó²anZËòó'ö·7Öõ;k~
+÷n.÷ÿ¤dgâãÁzâ«ôìL
+CIxÊèxòmÈåµÇ&ßÄu*ºYóçûª¾ÕÃóðyo{rzÝµÙÔÛ¯k0oÐÑÐáÆ­÷ªúìc|ÒÌ£}Öðø÷&Fõë;òÎ1±¯êQ$m
+÷B×÷r]N§ÁPÛéùòNäBÓ0ÆûOO|¨"Sá=
++çàW®÷Ét
+oÑ
+µ²ï4ú³Ìk'á
+<
+WÑ ÷½2£"t-ßÇ0
+ÝãÊºôb³®ð¨Á«T&fóðøc`ÚÍIæ
+8REÍbÚz±êÔ;Ø4WUëóå©¶R¸·U1\ÇC ¸#±ÁøXö4}_JXßéÛ³Õd¦JPGhÏ¾Z¥}ÓóÉý[í¹Uë8¦Õgø®å4~
+ôëQÝ+ýk+x@ËELÅ6ùòµWã|_¡@FÜ>G­Â¯Ì ¦RóZ¯Ô8.
+p
+&3éÞ%bµ×MÝjÉ<jë~#iAIòý©¹¸v´9·z±!
+-OÇ¼3
+V I³ÿÌÿ4­6
+í}2mBVº¹àíÀ3¯¾c}u ªZµØUñ(øéTI<ký%)Çê¾
+í5]fy×³Kdòjô9máÜj4³£]\æ9
+{og¼×ÄÎ
+7Õ»ß¼0{P)Ê3û,Íüæ(¡ã_	ú &¥Ó«ÌóÝI
+
+ô!njü
+g9
+-{[8S5<£
+-SOò	J«äk
+-é"ÏùO#õÛäÈ
+-/V·xJ#m_õ(8 °
+AbH|s¹2ìaÌT°hÿ@gbLDy¾²~Ç4k( Dô	¦ëè}"£QÂZæJ8$^øÝYSÎ<í[
+÷Çtâ9%Ú
+_­5ëãÇªÚ:ò>éxñýwHéy±Ð£êÊ{Þp/*2³éÍ´M¦ðFs­lRI¦Û å~®«$ñrì/àå
+-¶>p¹Ã^Âho¹Ö¦bºûíDÜäÎe ©lAÊ§°
+
+-·uâf!{ÁÒ(Úâµµù%YÊþªJÇiËMûíöîbó_ü8¯&ðÚwSzó;Ë²IZåð4ÂÖwR³a;<o}
+÷ïs<ÔÂrÀ,±ºH/ÎüÉA¤ 9ÿ|O\î±ä­Ì|þ/êÇ'ûÊæ>phLìà¾M±ó!ø
+]$Yê'Zð¦]:(Y0@Ï8-r³ß
+µ-eð\
+ÝâDVô\dêmBnãû·Sðfu±ÈååÞõPiÂÒNs|úYSZ¯v­óÁúfº"Û<|D?;ÈXÔS¸¤4êrihø9r¼î¤Mh¦]Ü^ê®¾£§ß^\Ç½û$¹?gÙÜ¿EË·ÃCÓõZØ§@ñò(óf»É7õd
+-h8ÜËôui÷K­Í¬®xÝ
+v«ÐØãfKòëRÇáÝÃÏw9ù,)qóî*<QR1·RÕ=|	¬¢Ed|2ÆÖ3âß¨û¤£÷>ac'|)Òëû]J
+- {Ï>Eí¸t=)÷ZÚ
+FøNÞ&)Ö´õ+¬é`¾ 5Uß
+
+-<ÒlÁ¡²
+ËV8Jæp0ï
+Û+O
+D7]Uj¿´`8çÑìËßrryÀ
+óë	üL`4ç4=DJk	c[l{2åJ
+ßIÔ:÷)òfy4@®Uá:	
+-1_dÛde½¹S(èC,s6¶öÉl|énRÔÉs²wA´Ô²8S9ª±Þª~ô¼kbÕXÒ)Ò¾[bVJ5ÓSg«õìÍV^k:¯9¬È'ÈÐpc½@ aelÉÿO 	
+-endstream
+-endobj
+-787 0 obj <<
+-/Type /FontDescriptor
+-/FontName /EFCECH+CMSY8
+-/Flags 4
+-/FontBBox [-30 -955 1185 779]
+-/Ascent 750
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle -14
+-/StemV 46
+-/XHeight 431
+-/CharSet (/asteriskmath/lessequal/minus/multiply/prime)
+-/FontFile 786 0 R
+->> endobj
+-788 0 obj <<
+-/Length1 2200
+-/Length2 18482
+-/Length3 0
+-/Length 19779     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚöP\ÛÖâîî4îîîî.Á¡Æ¥Ñà.ààwàî»% ¸ûeï#Ùç¯êÞ¢
+-Ö7æð9ÆZÐP¨k±HX9[ eÀ,
+¬ì )mv ;;+;;'
+-6ì ü
+FèærvüÐ
+ü&6¿)ª8;=
+ 
+\ ^A>Avv ';»ÀÝÒæ +
+-+@ÑÙ	èD#åìâã²±¿ÅùÏ#ÞÀ! ÀÇü·9@Âè²4w¨mo-Í
+ ZÎ  Øç\Ð
+ÛÁ.ll^^^¬æî¬În6¢
+Ì /Ø 	tºy­ 
+P5wþ»4V$¶-Èý_ZÎÖ`/s7 àMà ²:¹¿x8YÝ oÑZ
+-Ê 5 Ó¿ÿ¥À
+øws 
+¬
+ÿu÷oë¿
+þ66·´tvt1wò9Ù ¬A@¬2+ØÌ
+0w²úKÑÜÁÝùÍÞÜÓ
+ä`nñ¦ðwêæ Y	
+-ù[
+ÿ®ÏÝÒ
+-ävgu9üU#Û_nÞÚ,ãd%åìèt»#ý4È
+-hùÖw¶_®½³Óûÿ5ÈÉÊú¯2¬<\Øt@®
+@éë¼þÈl` ;;;?'? è
+- z[Ú²ý@ÛÇø÷!Ç_â·üß»8» ¬ßÊ ú¬oÞ»{`7 ÿû
+ü/!qp ¬@`ÐäôÇûhý/~»77à
+ûÛøq ØÿúùïñÛY9;9øüQÿûÙ¤ôTô%ôþ]ò%%½ïY¸x ,<ì Nn ßÛÿÿúùoþSýßRusÐ¿³ûG'kgÀ¿xëÞ
+-ñü÷dÐÿ{m ÿAÕùm ú?ãoÄÎÃnùöãÿóümòÿoöÿòòÿ:þÿ7#Y¿Ïéÿ¥ðÿsnîrðù·ÆÛ<{ßvCÅùmCþ¯ª
+ð_
+­´y8þßS°ùÛH8Ù¼Í9
+7+;÷¿ä wY7ÐJ
+¶´ý×,ýç2Þb8êÎî ¿Þ;oVììÿçìmõ,íßÞ-îoWö÷ðm³þ7®¥³Õ_+ÈÉÃ
+0ws3÷Az7â¼çxÛU+ ÷ß#`cur¿ ÞjôX;»!ýu±¼< 6¿Dÿ"^ äâ{¸?Ä`þC 6ÿMîqØäÿMáqØÿÐ[<å?ôOå½ÅSýCoñÔþKüì 6õ?ôOó½ÅÓúCoñ´ÿÐ[½ÿÀÿ¡·xè-åçíÌÒÙáíþ#áæþKâèøÇþ¯Ûc³ú¾õøÇÃ[¥ÿ?
+-oi[ÿÁ7uë ÷_úÃ)ÿÙßª´ù¾©ÛþIîíRm}\lNÿÐxýÓþ-»à[+ìÿoõ:üßáøLß
+-ýç¿2wþ¾eêò'·8.oÛîüÎ¼}SÙ\ÿLÒ_ätÿ{þè¼äö|ËÞýøæõO'ßv
+-ìõÏÞªñø¾Uãù|«Æë}³öþ¾Uãó'ý7S_ Û¿|ÿÏâYz¸¹½}þ~C¾måøï!è
+-´DZ^p¶
+-³«ë¸« öbù9ÅÉ:ts
+ ÷CÐs_#DJøþëKìDÏÜ^ìýÖgék½>
+»½É¦_F¬ Þrc¬µÅ.³ß7,#weÎ=¥înC3.'+¼ÓVÍ¯+ñY|f×óóYrÂ´­Õ·U¶§ðtÍ¿YQ ¦âbá	øù¹P Â:%²:«%ë$fçº¨Ý/Ä§Ieî3Ç9yvVÊ!AÛÄ¨.JWY¢~õñ)}ÌÒüè!xL ¹ê
+¦·pÐ£ÊVøñíBþâG¦M«üðô`:´ÔVåÙ¢D®·Ýc·té×åTí"_.
+ºò¾
+-9lYDä%DÙßaõ¬¹J~Êu£3I&Úî©Ù³EÌãØÍêZï9f,ÇcCÝâAÌ¤»¡9qðv¦ë!Óà:Â~tyd
+-ôóG²#ªÝB?Þé	9P>núÄ#[
+[ÛVÛDÝ	áp¿ÕCóÇåÐÞx¬©\ÔÀR_tN9§2¥9´ÖCKi	AÍ~s¤?ø¢}[ü=!mjÙ7Ùël³h¤P¿ÕwÌõìsÛ.Éx¤ñkX0TïSÝoÐkfCö^úk8©NÝub
+r
+ÿt¾k%s¸xeêû¨qÞ¾ÓM±E­îúòÏkê+P%õy½Ú¤Ïä¹ºËbGë¿8!.**¹xË=
+-!KÇ§Ìü±ê=¾Ôw@ìUí~I¸îþÙ_G5©"R
+-oÍju1;R±KØ*G6ÒrTöûGpþ
+¥ùb¬Üò
+¹Bjc×¯3¼ÕcFh
+¡9n"8
+
+,BvCzê©y}O"F½îqGê0/ËNÕ¶ú/:BDE¬æä|úÃßy ÞÀ«døîË!wko£§^Û§á<n3AW¶­ª.~T ãùcgàwqh»ö%ÔïÐ5¯Ï~«úT¶w¿íÿ²ÆÑð¦´þ¼² j[CÃ~j¶)]õs)2Þõä|Å	E(íüF¿)¯4Kâ+¡U-ë´O76cg
+Í5Eóö$ÞlIî]®÷ô;mó0+
+-£ÈbóMòs.:oÒE.Y	#ñû¼øïä[ß­Ø *sl.C8Ço
+
+£i6¦õèCqx<ð6i¿oX}Q@,´Ö«í W§ßÃv
+rq_CY\
+åÀê¢A5Íh©]U7¡þ¢M1{>°ÝÒw lØ¥ÙGO
+L§±=i~m×åãÃª¶¥ÊK¥"Î×É£À(KAÙdÏ}ÕÔ|æ*XõW±ô7ë»HK,|Î+«1b³qr3^ðn ÌáÛù'~¤¾Ïý1:Ü}cUöMwÛ¸º¹ìA©ècÉ$î©L¨q[3Ab
+-Ï
+ûæð`Õ­´Ê6ª"HiÆsêáò,¬
+£|@©D¡
+Æ{Êl
+-	¯+¶óbP
+óBú×Ï_ yyyãÅ´0Ü¨8[®! Ã1ã.»Ç<ñ*#ê?l
+-
+-ô¾è£è áóLLýØÃ¬^ÜqGRÂñì
+^âu·	Ù-í*¾0Ý-µ9gSÄî0ø$±c#Ì
+æ¾ÎØ¨:è
+-É#¯=Ðâ<ÏØQ³&Ü'bK­â~¿³rûÙcïÛÇ2)MdBINÿ¸^îT&V^³úà^á.
+F ®æ&ã!W"¹»{rµ,*(Ñ-úÔrä¿1< ¾:®@÷¢)c»öuú¤=ÒÂåä?¨½û«<]ah
+çÃ5ZZ7BýÚ´Crg ¦*ùå];ñøg÷
+rçD¯ÒàÇóJ¤ASéþËl*ËÆÖÇípúËÖ_X
+d§ü ý d	
+¡TôZ6Î~îÁçíel&é³Vº(ïÌG1
+}ZåSØ?zdÿÀ
+-ªû¦Õ²êüÍÀ
+Îg¬ü@Ð¨6Ä=× ÅM®"µÍ P7ïÖo
+iý«Ñ¼ÉÆ·¼zÓpúµx1?rAe®æ~³ÌúUã¹mã ÄÒd§¯±,®ÂR~·ïjÃ¯=å)?J)Z/É½¬ÁÎ¢jöj.ZKÏpn
+-Aa¥O^WLNRsÝ7
+`gÁtófTr#xBþNeûÏúÞ³éé¼ |«ñ
+ìÐÄ>b§118iúsÄ"¢=3ÑAË¾ùª<OQXD
+(hß/Ç©9Ù(!Ðq.­KryóÉi4iÆ,ÖùíÊòByáÈ
+Oq3\Æe4X¤ÈQ'ÝÓZæ^¥«.*CD4¹ðGq¬D)
+V§âÚU¢4êá¦RÙtç­¶«!Öû^$÷× pkîõiCÎOCÖH®]²%®K°mÛÊ ýÌz°µý¿0/nLÑ
+k1uìKõ8ähÆílu
+©ËLµmJ=a®,}ÄNMg}êè
+*ó9ëÖ¯&Xîøªð1®'ÝªJh5RÙßueÎH¨çXÏëï5{ÅÚî2öÎtDN
+ÖhÆZégz´Å	C3&YqPÍ9aX½'@æáòU/·TRq,f6"DøðÕÖë
+HÚÉõ2røÀLPg1YbäY^wòÄhAWßä
+ÜúC¨ò÷ §¹Ê?zïp:ùmìHAYÒ?-I"ùíIXïN
+kúÐý
+ü01QÊØ*îÖ>
+ÑeÐsª
+#n;ÝÎÖÍÝ!9
+-H=-m	~IÝþEçÇ2ë
+â»À	Ü
+.I!b>ÊDOOÖs­¤£¤Þ
+-°ð¤:-
+ò¬ýÈHa@
+|rifâØ:îveRjû<µ¥ÈÙtøÝÇã
+aXð}Â¨ôK¥,Hò1Ø¦gshè,cÈ¡[
+-×^}#¬¯Dì¡	­L»q2^Z4(9Ç
+-ù&~BÝ#{À6èðã¥û]
+ÀXëÆ½ªf[X;
+-»ÑÖé0ënGüo
+þí
+©÷1Ìê¸
+ÇÈ04H]C
+XK_1¯LBt0V}ÛJsXßo×»ïãAtÓeÈ¼äh9Ç,¥
+õ?¢_ºíö
+-¹@ÕOç¸  
+£Ý¦{vép]ºæ·õ% í·
+,È8ïÏÚ
+åí¢9ü]Û+LÕ9ñüÖÍùDOØ×«oßp;ß
+íGbü&ÙùxQä9yqY1º¹:É§Ãó®Ítí¹wáà
+-'â8¶ý0"øúÜÊ1aÑ
+*],ðï?.k	½Ð]Å~k¹ßòÃ©@s-´Gá&Ê¥Ñ¤%6áËã
+-LnÐ²r½x^b^Q5²uyã·
+3DÁO<´ççGx
+-zÓÔ/Ý*êÓ
+=F'=S^Å7ílâv­"S¯[¦Ê©âE·å^ýªß[áÂüe×¬ô
+ÚÇbN¼b÷N§h¾«Zöç
+±[X*1áffrºnTX[cjÄaôÁÂP"9ýÂQF_tf óÛGF¨4aÔÃ.H1¯/-Êvn>Ù&EKMAw8á$dh¤b?à2-5ßvÙ¼|ÉB~~
+-;ì¢¨·iD
+-¢³îsmðj/f)Î?o¯iag ò
+© v
+>1û~ºôýÖ
+
+¿W\CÃAZ1×\Û¡Géâ1ýHq¼2×tã(ÝÜu{zªÅ¤G6ÉnA7o¿j°GÄN*±NßÏw£ÛH6<RÎoÜJ[ßQlmøÅ&i,"Aï
+->'Ów#¾é(Ãs÷$³
+ÌK¶¯PG¶!Ùe;#h[@¿¼I05Ö ËkîMõ=$OFÑ>e¦Ö-À´<Y5ÜlºúøAúÍ³ÓµÙR×p¨>^Îø.go9u³}ò¾0Ñ¯Dóë=Ô³2$ò/ü!c
+O)	Û_ÔCèô<ù>¢üGüüÎè
+ãw
+hµå#ÑÑùZcj#(bb±é)yíóP»mºöî"Ó_ ¡øGýêGú:MiÞ}/m¥¥õ%QÇÍº®EÓ{ÐíÔz éHÄê~aZM¢
+öOBé¸»~ú
+-±VöC0
+3l9cÄfÈÝ´·
+¬)x&aý >á;
+-²ÆTêh`roÏöÍãt?-}i>äfê=ìêþ)(*áèò Í¶°ÜJ«ÿ?7Z´¿ª
+Ï,®
+.äUür[6G{R[î;Ò1[²
+7}è
+¿E^·O²ñ
+>»6ÿq/o6oFvÃ=ù4
+»
+%¿,gÅFFÐ{Õ{{Úò áa´'xRÝ
+k¤«ñ_i¡ÊfDXCZà{Ùdó{h*ÒçÌ
+-×Ãë¡ðHÿMl?2J§­",®5WÝi¯ÎoMXÑ&*Vñë²*|ðS3H­i{¿[©ÛUt4:}ny4fqé¸NYK§OVd!zjè7º4<gS
+-gªZ½ Õ}½&H_]¼j¤#ñÔ
+k%,n?Ö¸^}´­&¤·1Åã
+~Rq<Mk
+-½t*F-.Õy
+{õ+äßl[«´ÌäÙ&É+T KÜILkêL
+-Î Ø
+-qÖäÏhä§¬£M±P(Ã·!xd¾}ÇâÔ
+h
+Ùj<Wk{Ñ0]={zñ
+Âæ^$RøL|«S{È¤ºk¾Ä	Ê$
++¼ç¬âÓÎM±°O÷ÕÏ'íÈ|zïgw7ª]ëÕvü
+Ýº%Ü¢_ä<º~ÎbGÆä!P­w1$­KDLvw"sIó¥Â$`ëáþ¤ã¨¡¡Ìwt½Ü~!	pY
+È7þV´Ðu'ßÿû1Pæàw+7ø·%f¯¾LÈv­§óï~ÆÙ¼©¡¸#Mç_Ñdü÷q5O
+- {ÎÆ¾óÍúðÙhÞ Yó$í}8^WÅQÌN·Äñ
+_ò	Ëýö
+íà^ëõ+àécÌòMëtV]öÂjÒ]@­ÉTzÈÈ*M[½Â® ´;ýÎ_O.Ü.¿1
+8:÷ÀAÈùsùR÷O¯$ÆÖ}Ñ~ØPõ}%È0
+5²¡]sÇ8º
+÷Õj
+®¥û\Âê¨!äÉe;BÏT*¼î/Ã9¨;Öc6Ã®»;1ûöp/àMº@	z«f6eã*ésR= !ÄC{½è |Øõ»E¿wÐDÛV"°ïe7.}­åMMTÑ|äu`ÙÖ©(Èæ_Á­p§¬eãAe=Ó ¯hïBÒ÷(>RWë(R~±ßºª1ZÚ3êvSù°í{S
+-d¿*
+iq\t~ú¡h.Ðä»®×ãþe<eÚJºA_þ+ËÈj5;É®+Ë{ÆéÎ Ñ
+¨¤VòPã¨c´®ÀãÂU
+àýf#n°Êó#h¦Oày§u±%}´±Æ_
+í)ºf%ü¦Í5Mb´/y
+-Jú(ºí[U²Üá¢g×þÍ×Ø¥²m¤$
+²(>U¬o"i¦fmÍaíÃ:mÖ>V´fÀG=/I/WI·NÆCüL
+-<^ÆòØkõB:ÃÈ¯B·>¨ô®Ábµq_dFL¯3®Ã
+-\¼7Ìþ­ÃûÑIfr]ä¹öCÛÞà9éá_áê^ÒSÊ¬±S+[#¦Ù%çhÛ}·Ú"ú#æâótdêýÍZ_9á£
+¦Æm¡8zÎ
+o5põ`¹í+^ÃP*øBÏÐkè¤ÅQBu¢#Hyûj·
+-úÙpÞ`FyUí¼¸ðÖG±R#¤G
+ZX¸ÃN
+-Q¬æ!ZÖ	ùkÓ;¸ÁÄ|ÓBûTl§='W²£tØ¨
+-$[IÞÓ»¶ï³¢b!õ
+-IjáÜÎ(W;j¥g·
+7
+-/ûqnés³ÒÐÑÃüdöm/bÚ0'ÌÅû
+-ma
+-2°]´n
+xcµjZCBs®²#TwÅé_2º¬
+-ØÒÆ»1c?oØ.Õkâ(
+DçäÊe?.î¾¢:(Xê;0³"y
+2hw
+-d
+Ó/aâX5åv_'%"õåaÃ
+z¤~HJBéuðe3jTQhïÆG{ÜøaTdIë9¡Û¥á4×].Ô®6ÎÕQî
+
+&Ø¥k07 ²´Ø,\ÍÁ¥k ý4Á`ÚPõ0ÉÇÄÖ_ä6Üä3õÜl½úÐLßü¬-ÂÞçÛN¡ÈäG
+ó¾sbÎôã7&«ÊcÆïÔ
+¥dT
+-)2k
+M·I©Ù`4k{ZMÏ.RB
+-kÏ¹¸dP^Áè[û~J¤¥5áLV³F,7ú
+¯-Â¶üxõä>23x=ØC
+{Ó
+®*nP·Å/¹ù<¸Æj~F/E±´	)mÑ{@2	'SæM´lGsÜ:cp<Øwª¤÷Äq·¶Ïf`ïÊcä¹¸÷î× @ ³XjAú½døs¢@Ôxè~°,
+è¯"¤¢aï½ª<<rÏ lnân¯, îsL~E¦~?°RGL`2ñ#'SM~öP¶Ër`EUWêlc
+-D~à<s¶ÖJP5]cÅ/Á¢d¨bKæ(s+ç¢3w³g*ÔNôÃ
+-lJÛÜQ_m´-õÚEüb]îEla,êgöúDòybTÖ}_î¶Yze.ûýßoyx
+Â.çÏyðg-M\>t¯ÅÞì4áÚ©¢\Yì¸¾Â
+ÙÅséíõhâÃ<^½Èä¡Y[£1¼7koÒ¶Æ
+
+\¼	¦wÉÏJâ5
+KvÎ/²oxH ÂQÉ(![v¹gLí9?·¦*pÏlã¡!dj¬3J þÏ
+7ÜZé9º«K¼yÈË¿qT`ñWöÃ%®éÈú$Zh±ÚýXÆ
+wÚt |düÂý	ó°ÇE¯
+-3îIdê´½ÒÙ7ÆqVgêöý=êRÛ1ÑnEÊ^Ðw¡
+@iIÞtBO<ÏÇy2
+$Ð5!·0ç¥o¡(rAïÑ/
+-×?/ÿÒ¥ïÁþÒ
+£¡ðÀ|	c2zß
+	éfùZ¦X4]ù3g%e¶<~ÒX.ßM¢]ÿ'±·ÖpZD6Iác¡ eæ©
+Ñ¢-^£×ÄâÐÃØuæ÷g<*wyQæ^<ë
+-
+Â;Qß¾DW¬á×]rÏû%\Ýßß5$³ª%á¸¨4RnÙy3ÃÞê
+-¬¸0+ÄlÑOMõb«+(IçBÕá×f~PTõÓ´hoÚÀPmX7;Ð+J÷´Ë:Äð¬ÊÚS`úí=êV;~s³$©¬/|í­ Íùc!ä¼¶@Q:YîÛÈYÃÝt'ý¯ñuìóù<(á÷Xqòû5cù÷N§M[)ià~9Û3È@¬ó¯^ÕáyU8óÌ1ë!YÃf9ÖïÖÎ÷±G$Ö!:[ã=¸
+ÜÚ
+KwdæoívÿeÓÆ-
+Cxª1æg­À>«R¿ÆJt
+X^Ö¨VnQ
+ÓuvzöÄõP+ ¹xÚs
+\
+¡¦BÔ.2´säX¨ `ÇuQI3@ó
+
+E¥°8»I^
+kÊ4ùÈmåÇe
+-Ek
+=Æ©Æ
+-&Ò#g,±dK ´ù;·QÄ`H¶ÅYE%>k{zeäo½L:¿)ÚVöÏÕ
+ñÍýN%Ù $ îç¦ý{ªwy_C8ã2\T;KAÙGñ0pæmNDnms2,,|@þ«
+-2Ñwî  nîÐªmí VìÈNvzÎZÝÅ 3ü(nJ>æáðZAggûû£@W\ovdÃäû}
+ ì!_¶zjL2z¸{"ùú³'DúîÝòuóußSv:³êíâñOHÕ0Ñl3«4{{ß8ãý^åTýöjâ>÷»8Î-Ú@Í
+!#@?+rïý^¯(m
+-ô]£Ø¾û.ðË´æÛöÜÐïÐ,È}úõ5e^lT#GãÒ±!Ù°ÉÙ½1
+-Á£¼Ïöä
+-Î<Q÷59QgV±³bÄÅll±¿­?fBqúßý
+ÁÞ4	Ö¹Ù
+@:põ½;9WH[rÐ 
+-%²Ü¾?5
+9W:Ó}EÙfÆj_Ò_Y(/v;
+-È¸Äªx!!Ø£bþ§â¿ÚÙgóZ¸ö¸ë
+ç`©4Iío
+  
+
+-ÝÈ¡{ÓýÔþÄ!u;æ¸î!x¶^9SæÆåKº/¸Çb«e¥ñNîÕÞ¹j0_WÊxjÏç4FÙYÞA¼NS3zÕ½Aß¬KQú@ÖT«wO6.k°Cîá6#;¼Á+~Ü¼Ô±å×¥ùÔ¨=w<¤<¢pM
+-îòPLÅOn
+p¸þRÈ¡°\
+
+Ãs¼¦çäô«Xä_se7;LÐ%yªiö¼Î/|TÓÚ8:ÜRðÒío
+-RÇ,;òÑÛ¥"¢(×²HÐd¦Íû&<ëÈ³B
+Xä¦·Qg
+ÒfQ7çå~)ª598¦÷Ø[ãå¹«UVêOú
+×§c¨¤Ä»ìÿð{rz0"ôW>I7ápû.¯ÍÅ³6ÚùéøcÈËwÁ>ápWñÃGñtúùómçÁ°LnPâ
+D¼
+Ä¹W¬fm°B(®·¢Äk¨ÕaT¾ã@ÿâJ
+-.ó
+¤ÝØoö«EåK?vË­0/
+-á_~c³8ðýä\Þ*úëÌîãr3%¯eß
+-ÍÅ$M6§SïdímÍÖÛèLHu©¡~æTyc¦µaºÂaR;dü¼H ö-«bGsßæç¤ò¯
+V3z¡MF
+-Ò:(ïí¼`
+|*µo.Ðq[bû¾­Mi£áGEb:®ErXªq\ÅaÌIT<#l¦
+wùg=eÐ«(Ù%ÚæHí 7£:ÒÇ]º/®døÌ
+-mõL<öN|N?©¨PÌ·â_6~
+ÿP¥ËIÑsÝ^ùûé6³qg3NÒ4ø7fEPä
+ÙÛ½HÜÌ¨ÈÝ<´â.3XÞá	¥ÐÿfÇzðøòì«$\>ól¤M`ÙäæZPMþÃQaI_^§RiÊ"Þ¸)
+-R7¤,àÖ°
+YÿÙºÂ<×w
+3+-;»(çø
+õÄ Îþ7ðgM­ù7ô¯O:ÈlQX.8Ð°[¾ÔY¹ZË2%eù§mÏp*ö< :ì {ò@¨,âXGÏæ²ê\~­gêiu!¶lï"Ìðs\Éþ
+
+sÜ!EîÎÂôÄãvN_ú<Ý»ÆTwå
+NT
+ñ(þaµËÕ½%§
+-iç.á£ùg·®ÜGÒ~Bv ßÏÇl°ÁYMÚál´j"|ÿ®ÂsaïgþnÌÁy^æØ÷§Qa«Ö<ÆÉ.Ù¬Ó)AøîXµ@±)=G³++=ÕñáM"ÈèXdõµ3n·
+Ï0yu¦/Ú
+±Û#ÓáÇµ2ôÙèW9áøõ
+*]Û l*K*TuÅÊ.Z#
+ßgöÍö
+§êc×jü±î;Ä¤ïÝ
+.6r
+gÝ*pÆ­~Ó]@¯ÎK¸© m´é
+NÞÁSÛÁÏU
+-mø:ËÅ
+·(Ì­0-ö5O.l¢/urAÄ½¨ãEÜìiêI#T7ß±
+ìÈJ*ÀÛ
+-Ý>,»7
+x¼·ÌêöhÃ½:Ã§Q¯/OÞWÞÞ´YDË
+ÝÀlÈÑ¶@+m{%D{öCòÈñØ9$ÙÑë\¸ç=D/~Þ×¢5tÃ½fý8'Ç(°ì÷Ð¨Ö+rCô=íaê¸15ð3u`ERV<I+R²[V[O£ñyY×7DéA¼Û¤Z°GÉcBþ·ÔuËl
+-
+-;ú¹ò$]¯ÄZ	ËÙ©0>ÂÆ±,t(YEæ4ÙéyUwA__gù8
+-¢ûéú|;3ÍûmîêÏìÝ*ÐëbÒñWYqw:·c\®2Ùwc!7ª³îyæ­t$[Ü\K>L!µg§ôÒÐil`JwR<ªÍb^6æ
+¶å Ò#l<§Û¶D6¹4·T?ç@)¾l´<è]õÕ­.HûØ$Ë¾ó¨%¬if¡È	|iXGÃ¾>§{°ïÞO´} r æòJ¨ÀLøÁàQ8¦~B	¼ëðÂ,ÁJå¹<WÉÞxûøå^ÿ *sü+^yÃi6àQK%øÑC"¤<ðÈ¨îcÍÅ1¿òÝ²>:3I4e9ROäX¦ÔWªä/{­ý Eîg=² ºeÉ½¶t»mÙ2IÓµ
+ÊÇÑÄcõïAz;_FtEÀ2_þq|§Ü÷V0áµ
+-d±\k©<÷íyh®¬ºæ¾Þ×ú?ýwÖu¬|Bny$#ÃR±bÓ­6§£¯ëT¤$Ç©1î
+Hr9Ìãc`ýªx-³"!ôG2¼»¿C»xEùè(Z
+-~
+al µü¹µüôq.x
+&òyû¢ÆN[¶G®ü¤ñÜ(¿÷°"×Á'xòp¿$¦±¶²öËdßo%¬ÙnÇxE?/Ü+ÚÃroÆ²`æ)NN;-ù
+L}~r::ú¡l]^ãKÕôweÆp£AÂ±%%´¦±õÄJë[²Æ­!a@¢I¬
+1ñU¾ÉbÞÏÑ³Ôç³&zWf|?ÀïùZOL=FsPøxßÍ3©ÄP§*)_xs²BÛÌÏoÈCçì
+·sq *¼o¾ïWP¿»|Þ*5ÿ½`»ªUJÜÀ¶\ïx`o½&rðUfv\·yß
+?XxM/{B3i<ÏÍÍ-éhÂBdSÜ"¸¢{
+í$S6-éØ0÷%+À·©ê+@¶& Ò»xiç¾Ìq÷ _d ùãÒbo~Pß4Ì!ôoJÏÔ*d!·[ôKDHbïÅ¤_¦¦Ã-Ë.Í²
+-¼út2ÑäèÙnã°Þ%ËõTôqDÞø9eí:°ÏEI"WCÒÆ¨ö|}Ýðg HÚ°#ÙÞô¦÷oq
+)ØBx®ö3WÇÔ¸/ÔÚ?
+-ÎhÛáøJ+âfCà¹ÄÀ¤î¬ñRë#@Û®Ô®'µÅ¹
+û¹+áN± 
+=î¢YòáT-G*%Àe.WÛnfULWe¡PQ4ÂLDÂôÇ;®\_¡b.+|sÈþT{ÛnäZÜ<âM¥z~Ê`ÿL{éáHæxþí{¿Ë<øÈÕDjÇÖ½´ïU5ÃA}Ýä[­¢=Æ9=©(`)iùàbÛE
+BGüzüàD04-;ißÒeTÛÎÉöFWÔeÚÇ|Ö¯²X£
+õ[ÚÂ)Â,°Ñ
+Zn@zî×ô »
+-ø`y~M«Wk
+-ãý#´±$º	ÏOJp|´rA$r½ÇLX§ã}ÍðbÎn:'Ã¼
+þb¬)ãçÕ(mÂIL WwãepÄ'8L¸B/;íê©IæU
+-/<²9ïNÉîÉØ9zT¿8»úI$Fm§qÇî´¼HÓ´1)î&N4C¾·Ü
+<èá 
+H/{Â$òRúìÛ|úuÞ7wÊè>sw©Tí4Íü98Á*­ÌÀþ:cèåà
+24ù«è<¼¼§Ê	ä
+;
+îQ%¹CÍ ´½±aßÞ··äïÜ.×È^æ×" Ry6{lµ¬^ÙÎ¬ ø çx3uÝØpÐÛ£Ê8dE$§`D^|ã:.:Ñ¨:é¢q»â3@½ñø"wÙí6¼+5t=EPÐ	­WËöÓ`ÄcÄdÆÅ+Î2céçäPÅ>µ0R`ö ÃîÂpoÞkÚÏö¹Xº6*K;Û3tòäYý;G:
+î
+¤Êª_10ï\b÷S,û¨Ór;¡~ö÷±ó÷:zÀ3
+-"ã!çswMäo
+G4¤õ¨iÇ
+-N°o@&ÃÕW
+=Ý{wÐ36~®h
+¢@»EM'Ð´Ý­÷vy:þ^{©¾I¦â
+Ê
+-ÎåGsh¶Ã[X
+-b{Ó í{Î-AÕ5t·[*w×óÎÓ²S¹kHyîÊàY.
+°VÞzøF£Mø
+¾Ñ| ç!R¨Eú³mMs|p2xî§*C¸_
+rê$à8IÛ®´h¬]æL3¤ûÉ<
+k `µ~»È OF¶Ì#
+ï9ã¨crAD_ÍnÍ®0QÌ3·è£æ£×8\'*j¡ïº2i¢J
+Ü4Úì
+è}5£XVÑÉæÅB<< ÙGHý)7ReFÿÝrU,R÷ºù`3î*HÄùF},Wtà¯|:eü' |ñò>V8&J6ã
+ÕyRDqõ7pVWºìÎ6±-Ú­%§ôuê¿ÄyºÍÅð­4Ä´
+-g?Õ¤Ú_§£iq|þ,b¿øJ@¦
+>U?øP
+8Qµø>xÅa]}1ßË»ù.ÆÀ|ÖÛA	i«ñA·Ê¨éçnÑh­ðM5 ¨þºîÑlï/_J,üsÜ
+ÌZzùÉ¾¥ÖzûQöA¬*´Üu3ÖÛèbèD;ïë$OQlúhb(ªàWiyLªXô-#gã,HÉ{C'_íPPzÆX¯Õ}]ôÈØæD$\ñµ¸ä²
+ÚÝìâÝbØá|%~¿¡±Pºp¾W¥Ù
+-n¡ªÒ¬X>¥®\ä^	ìWD]"vÞ^F<¾ÔÑ<²|[°Zõ×b¬±¯-r$-&ÇªÄÙ86k§¢S¡k¬~õ¯Äê×vÆá
+
+þ$$¦çnÊ.³9"Bú
+\$£'&Mý~XÄæ{4ì62ÅãWynü¹ß½áûf«OØjZÜìab°@bÎá;¯<öêe²÷B¯Öè[ÈºÃ
+4`G?Ê2eiöó'wªÎ8Ö	ûª{bãeo~.[27°4r¬TìírÛºGÒJóçÜ^~pÂ gC­6v
+^ÿÈ¿?ÐÁQöì¥5;Ó2	QÓ¹ÿðsÐÛfuVs|=îWKùúÑ»¦NwÉ¥bayÛ£îÆ^²N2¢6ºþ=1!
+ÏòÀ8ZÓ:A¦2üý'·o_(D
+éH?þ<
+]9wÓ<ðUÐXðïÛÝì]½@ÛÜ´9µû;saP»ÌWntUig¨r{ió M²Ó)¾#ß5ÒÈ3Îæ/
+-ÏÈbÎ¯c+h^îÕöT«Ñ{Wèò¤cfûï?)7Äç×d­ùHGÒu-B~súx`TÏðo'<)ãñØXªCôâÛìÞmµ)S&øs¢;HÎ¬ o$&	/Ñ'Öw=lü1±
+-¬Xù;£
+?ÇVû?d%æìãâüv(× sM¯ùÈMß£Ù×ø¸ÿO_
+ Fáøßh'TR"õ:
+q¦÷¡fNÁW-SFóõ&EÙlÞÑkÁ³E&íeÏa¸»iÃ¾È£ÂBYMjaös/FÀ
+*û![¹to¿^`0Â&c²
+¸«ùpq<@Ø-
+Ó²lÞ}z¹±jò» ª½ÝÃcª«
+æO>'é\ÉI¤"
+KYkaÚ¶zöýÝNcæ^Ä¼?<BÔ^ðu¥nß	¹)ËL´ZD
++?)£®¥fG¦Ð9+¬øËRã4K7ë?÷ûgOUpn¾AP§éz¸qnp,ãphå¬*,ènÉõ3
+*0WÔzï
+ÐÐ#|Î
+©×B½¹
+2¶#ò[ÖÍ]­hWq¡-cÍÜ!{7Ä*ürÐ¥¦FËO¡¼ºàO}Æ&K¼ñµÎ¤[áÞ$©Ãª9MCÞi¼0'
+CJ5¢}åÚâu
+[^°p®á7×.ï§Z
+ìçL] ¡'û
+-óu
+-3)h>
+ÞP=~êÕ
+-X`NCT§¤ïÈß
+H_ÚtMý(Ö+YÛã'$qjEÊÍ'ù]ý!ï]`çE}À(.M¨¸e;ÌkëÃñ¥¿
+Ü×8±åej³^Ðû
+-~å(&w"$l+î1íyò(nf-­5â{IÌn3~õ®WúH<ìÍj;:@¯ E{÷ÎÜytä¨nG.
+ÌèBWÌÄí£õ«î^?ÀzÛ»i}	kû¼0³<Ö·û-aQÇóÅ¤ª+À;(~0ê
+òÕp
+¤°ftÂC{ªÐÎ2B»§=´<¼6YÃ:r¾·ÈxÒ^¾ýñ°rn¬LÐ­MQËÃèö±á;Y­tÿì§»[¨@³çI#Zx¢B¶µ$2óÔÏyô
+-e~#+Øj¾r
+-n/YÛðMçR²2D`É°>©±
+o´YÙ±i£Cc+ÆÚ&
+-vì¬ 6æ(²a
+ê9ÆbæÞ
+YÁ|Úh7Ð²¸ÚèérÍ«v )|
+=	¡ ÁO¼+?ò$ÅÍe¢ºÚ­ZÍ´b¥qot
+-­#lf×¢á¢0/uæn
+S%k×
+Îo¸¬hLýBzJYb­Ü¨ ê°#
+-Ñ_
+Xéã¢&u¡þ2L^ÎëÃ"Q´%JHËÄÚU$Å]+ä È9!'EÞcHÞWÝ0ß
+ãÄ2C«M,¯¾Çbjú®ð5n^/9á	Ë.%-A<ÍOE{v!dµéüô3·cÆú
+¤.¿V×ö.j)6.uÑ.!µtp"äÚç ûÐÉôk¢v^Æn>mÃÌQ(
+-ÉKgO¹xÃ
+¥.B}LQÉÚÞq©"
+ÇÄN)ë9GÔö±Î¥WÐìGÃKBÆÒ_.âÖ>{0qÝFÌkòaK
+Å¦þScfFà\K&Ìr@"IËq²¶ÄRÛ*UN«¿H)Ì cÔÉ¼@1Ø*=¸åJ-Å²<écvÒÌ1·ZËc
+´t[nNU{XªVKdõ
+ßþoÕËüNFÊim DIDÐ¤ºÛ2ã`¼X+©åêµ­½öÅøs vÒ®"h2,¬Té7ßæ¨þò üi$­Ï¸ç7EÐ¼ÏÐ¿ãÅÛBWÐTI¶WÜ~
+þ"pé³{oßÚÉ6êlh'cþJàüöÐ»¸ç4áèËj7¶&¾­â%º%ÌO&÷-×Éê=B
+Ï.ª83F³ÅÝ+aÓ,i8q»§ïí
+-í1î[áßÅgcôïnPéÛÛéß¿¬ÒL®«W¨|pYÁî½H¦mè³×åµw}D.NBã[¡ÏµûI2*³sîSð,á92½ç{3õøþ
+Ý¼ Î´TC
+Ï h
+@]ÉdëÐxÜÏ
+¯!Ñò+ø3
+
+t^ÅkOF4+Åô/?_ÉV¨&øg6®#òÇ4×zNä<á%é«¨úl
+óc-u®·Q¨x[EïPPC°åâó©Oós¦6u&úw~PåoVJ÷
+-®BôÆ8ÅO@¦È¼4UÞ©úÌ
+îJ¦÷~
+-æ±0§ÿ
+­âKÌ«Q2»"xâü´c¹i]xÝuÁj³/e¦«zæLçÝ»ÿe3xV¦Dº]@´LêJxà
+¬Z¿×)XgÈ>ùj+¿tØßA4`,ª¼¤.	µó=iþ¹4>í?éRÓðù¢ÈR¥/aO`&|©U'H¢pû#)Ó>¨r_
+-=#;ÌKrïÅý
+ÿ³ï<àNh&Ô¸n*¼ú
+x*[ùÃü¡sa_~j#²­ªCä<×^çCÖüZ¨úµáWTáVæ¨VúH>ÂRê@kW2ÒhÎ^¬I~ÖuýLx´
+3¨Ô¢gïÍt(¶bTå
+-6Â¾8ÝJ~1Øí{Û	Ì[Bô_R¨õN
+?¦|MÊ´0Ñbëx\dB±ñ9rñÝ´×Y-ò/0hÖAS!ðÍ>+5>j
+÷¢	²Ðaê¼æDId§ÕirºoL§ì{ð{hiø¹ðù3o3Ó7ìMs5
+¯JÛâÕeE@E
+"gãïâ\N¨ ò H{úÅ¸û4<T[m'nfú
+-ª#å¨Xö¨ÛµY|]b¥NF;y;úMò
+-V²n
+Æ* ÇâSìþ¤ú=ïµ_í\~ÕØo)ð0Ë
+-k)}(A^dðä9þªHù7²ÜþÏÖF9ÔpÚ$Ó?oa[ñ8Sì¹9îXÍ]XÚ¥ã°<ñ¦ ËñÀçTEî%_+N=áæwm9§
+òg ÝT(uðb@`j[@U¤YõH÷Ô
+-zi¦{¹,
+Acyï½ÃÔEà±v¯{dâA8ÓzèdÓÎ?î|îR*?)"ÈÃR0ÊÆ´ÁÁS5vÄÁGa®Q°fHv]EÖ÷5Wôªð;÷±H£yç¤ë¦,¿ÎnÐùàuÐ¯É*
+1}|ªçâ½
+Eëù?/g.ïí?]7MJh	U7NÎå1â0h~«R²tÜ9='x7±æëû¤ð¹ñ~XÄéÅA+×
+t
+We)ÒÜëÂ¡öU+á]²ßÉô¬Á£ðQFæáe7+ý
+-¾^ð±gMá<ts¶VªÙ`q®åâ1æë
+þ¨¤jÔ¥`\Uäð4z7Úë:Q+òâû`_°*Ú;@|áS"Vßêè
+%bm¶5®Ý,Zí¸K¹%Û)5xUÏ©ª°&'ò®õªêÆ
+/J»`*Ä´}ô:ì,yK[ þ=m-uE
+mSb$¶áz3§R/®k÷ÝëX`Ãö¦¤t Úó}	kNUv
+Re©:
+a34LªI¿=­ºÅ]ÇÛwÛWo¯X¸§Tø/¡B;®t¤·ÛÓdØ±<=5Ê[QâÍB·d¯ýe<Òï¨lDiB ­ðC\%÷ã±ç,3D*wçÔØæbsäÍ.ú÷+zº¦N1Ù
+-þ¢·.®4¦Q
+ÓcGÖ9¾ü.W,OkìªæÒÒL}rÖ²üùÎTa'-N¶Û<$3=
+Kd²¾JÜ³¤RÉâÀæP
+;=iwÁ¤|9ßTAõ-O`3Ö
+®2SiZ!*¯ÛË,½ëñF¦	×â­Â÷ÛË~w=\j*t¯	¹ú­bxôEà»ÍaË ?Ëþ¯ü)¸éÉx<õ¢ÜVjÿ­»Z²@Ü3bFçË§úFUÏ¡eÜuª½j­Üþ^]QÕxbò(ñ¢9Ö¸ãCaöê
+ÎOUbúóÚårbóUµ%Ûpªy7f­xÃï»èóèmÅµ6
+ãÞEo[ÖµáÈÇtmr®
+f3øõ©´æõcò¸¸úÈ
+zv»Áô°-XàHÂ?MÞízz.*OêÙê»2«®Ú50Ë  ~Âç§ö& ð¶øm¼}0»¸0m¼¡ãÚëÑ.\Ø|dãb[ =UKGg
+SMh-íD=?Ö$;öÂ@?Ä@Ïz¡yØ-Æ»P/]Ù
+-´{<±ÚGKi¹ûmÖqCÞ
+-íVí
+-	Q+$
+îâ^Óµ'cÕ`«º¸"
+¤jäWò
+US öa®õÛ¶_ì£ÅO~
+3FÓÜ°à/
+-ÆÞ!ö"¸²pàCò©
+d}{ÿ2Þ<NËð
+-B
+qô&
+q:ðË³Ç{W®ªR²Ýyz&öw¸ë#TOÃGÊåÒMþÏÂGzBFQyÞMGÕåý
+-E$é­¬®ä¥©.ÈÀ:o@»
+¸/Mï¤ø\ÙÄªþÓêT¨!Aòuø!ÿ 9àSïKµß·hctÕÍb ¨vU­Ç£<ÿ6§ååO9ÐÊÊd&û¡Ôâ¼Ù(öÚ5hxËÛ·±°Éåq¯EªÐËa!¾@ìf¶®I]G[¬)þ¹|1
+-+À¿SÞÖ]L	Ã]ÏsÕD¼¼M1¹
+-6*?7ÿ.óio4ÚÁOï­Á©«®!8R¾`~´,kÎµÖ¿#ÆÍâJ¿ÜÏâ¯
+ÝÆÖ 3:ò[äp``ùüÐ[Å¸­­Ø`4ÁèÕEòSKÌø©®Ëh¬6!
+u ÈËÂé¡Ç[®HÊñ®n*23
+ôjB:ü5µÓ;.~
+L#Ä
+HªÌÕðâsK´uö- ñ-i-µál²ÈÌ])äÂ¨¬¯èLRØ
+ì×Q5Ò*B6\Të©289oMÓ\ò5Z	íø%à
+´${«ÚH®Jû#Ðy§(tfþpÔbÌõ2¡St¹ªUÕS¤hFG´b	y½
+½PÒJÊÐdíÐ	È®N×Ó?ùâS´zwØÂ±yhõ2,Ç^tWL@uÉ\C²ãm¼Öz&Ùê[Tû!ãáb¥>^_ Ûï	·HmQqF3T.Û+ZÏW¹ZGHqw18£ý6Ä
+5õ¡( bþ\*
+[*©*ÅÜÆÝLÍýÙF>'µ&Î rdt´Æ
+>wZÈv1Õ	 ºØZ©9¬B$f>äZe Ýf:<Óõá:/~6Ã]Ù5Û
+!¼(ò¶ÓÃx
+Tjú
+5ò)ÇDôâbû¢¯â§lÂòå²ë	gC@8òÌ´O79±\Gâ{
+-Ú¹`áÆ²94höNT"cBÇoË*°5äÉ5&ü-÷Èðª/ùµ'Ëì£k
+-%i÷­hØïë5'òì]ÌG©öñ
+ôûÆÍiîªº±÷*§I©=
+4 OD Åe
+J0ä=_}k
+*¼ÍÃ+'æO¹0ìn_ò§ùû;n}.'O¬è^¯ÌAÂó¨³ÚÞa
+-½-/à­n~ß*ºd-{Ù?Ú®ÿRÿÞ©
+-¸êí)éÖn­èK«ÜÝ
+ç0m¢r_Ì]kwLùü3Âø!`@æ"¨ÍKllY²¾§ó­GÞC©
+k6Ý}Ù
+ÕýÊ+/Â«ÌV«pAÏmbgÐ¾v£®­çô9)Hº^
+!¾n ÿã 
+-]T¨W§,õÿ'³
+Lô¼ÿ\5ö=J¿¬@
+1£ýn¥
+Ñy¾oDoAÓõyê}è},«²AD³¤ynp~ rêYÆ
+(F¹ñL^.¯ßsÑJ ©fM¼¿þ´GêN¨oÓ%T«ÜEz0\nxÙ9ã7ÍÝÑÅ]^Ýx:AÎú¨+ò
+É))ò
+-Ô#ïìéj"n³þÁ
+-ãMwÖZBà(þS}'gÓ
+PÌTX6hZ¥µEû2¤dõOÉþæA5RHô[fÏTU8Æ$Cmz0daUô
+-ÓáSR¦¥&ÊfFõJ&­ÂB±æ»Y ¤.ÑJÏ
+-l±I"¤»ô^o¿´X§Å)üíq
+-J
+=;Û,3ñÑ%÷Òòçl=iÒeöÙ´±:¸>g_ï¦ºx@n_#%ª¢IZ*ëL~`
+$ù¼¥EZåJ	¯íAE"Õs2ÏÁE²¢1ªT¿.¯Ý¥Zc}
+-<'t2õ|Ù<pW"¾2Â $þ:@ò:b\cç©êb=?¹þËCùÆJ~#bÀdyº.
+M¾Àr·
+L~G¦àáÞ
+ZY-µøµ_:Ó ÃJ)«~"e3
+Bçv´}F*om5ý
+¬deÝe=¨>;7ÍÁ¿Z¬m¥rüS²pôo;Q!e`[½uÚ®{6] µS|z4Sû±Zr8rÅU¿ú}øÖãÏJ?SxçÒêÛ¤UM~Äöæ-/Ä~Cøp[ä¶eîù#[xµê¸ `He^vï ÿBPÔÏ^8óÊ³
+-ÕÓZ8¹ü¶­7(WPIÝsäÚxÔlþ@Ü;òsúãZ7Î­%ëÆ;QûÁvÔ;¸C
+'D²&
+-¼Û`Ü4U+¦ó¤Þ§ÔÉE?`eeõt¢?FHc${¢BtIobz§-mLB^
+V
+yZR#gD9'á<P0þ%D#Éè5^ÂCîöBß¯a_TáýÞïÐ¿¹Ïã<+¦Ãþ±Ý
+'²qË8Z¶½ _fÚ#µrß¡­É1Yª»d+>$,õÀÅµÝG
+@«Çn,í­·b½cÿ/Åý
+-Ë[ñÙ®
+õýÍè·ìñ³F2Æ}.lKhIVÈ·:AÊÙ6¸k­¦¶[u"©a=Igþ#âxøÒYY¯Z×»«XäÌÌìlê{%W+
+|gÃþ¤¼ÐwÝ¯Îfte=qî¤¿:õrÐøßC¢×â
+-ªðeÄCjÖÐqsÀFEþ4Ç·¦fCëÛûÈõf+¿ÊØ.T°ÅUo
+|¤ùÍAÇÃj:  ¿eýÁh.ÐâCÃÎ£>ñLW¦?GÔÔa4)Gl®Ejbl8ÁO¨;³ Ä îÝKlð®Iq
+-RÒ,GLÖ¼GëèN©-ãÍén3#´©Ë¤-Tìo¯ÑÊónaæõî¢×XIþßöCË¾,]'G{#øÄÖPB7$;.tKÌ9Ávß«ÙJHÁ@YmJÑÎÚ¢
+?g²ª£.¼Åðc2í8Y
+ôç¾
+)ß`Jº'÷$ç¯,7;BÎ$LS¶â;ÇE 
+
+-µí4A5Ê´:ÀÙ_¼2¤²À`a¹Qì1ÍìyjÇØß6<É/±Ë)¦Ênr¿b!Ã²h¿	fJnöj°¦Øó5Ò«ÉÀÏY3³ÂÊä%,GD\
+ÎC
+=÷þ[»$ø»
+â>
+²ÞûÅ.î+~=×é¸wJÓàáØî°Y¢×n¦sñ¢ 
+uRC.1
+h
+
+½<Â
+|þÁÕ
+dDRæµÁoºí5ç~Ù&Õª²éÁØ\3õGákLsçD
+Áó²'ÊÊc,kò<öZv6
+$ÿ/ÔõOÝ§ãU&ÒÇ9¸ÒBoí³fN±)pgé7¶òi	Òè$&Oñàtþ
+mÌQbt¿Mó¾2¢©hRLÉñ¦lÍ¼-dØda<á×©ÿu?!¯º«E¦Ø¬½-8v.Ùf¸T¾Ê´ÜwôªqjìYåD·Up%*Èùð 1»¾?)la«
+OãQÏËÈ}ïeàk(ýB}U:)<%Ø§ääÚSU"Ís¹á
+-ì hÌ]A
+u2QºÛ*
+-3Zÿ¾ð¾,£Fº
+$E»x\ay\AÄ¤×ñúäC5-
+|NÑhí9û<&dß½½ã<?æ¸~¶
+­o¸Å¿ð(/Î±À&Á
+-¶vïDÎ¼0`È
+sP§GÏ
+¼=ù¯à
+-ë
+-
+8
+À6»cÿÊ /TÙÎ4áÙ¯ôhKêàiþ°¼¡>Öª=_YïÊ;©÷ÙCa^×·wceHè¼Y
+-;¾gcßíþ"ê³	8@
+-û¹Ùû#¥ëç
+pl^e¸Å#
+	¦79A)aV%á¥;»@PL;ÔçYbv^/
+WÝÜðÈ¡[ë*áÌÏÀøIK1?#jWûiëbVñ~!Ë  P8­M5°£w3êÕÀnbp!öÿÆ<:Ã¿ü5
+-1ºÇ6i
+£$'¶KòcX~ØUY-fF
+-XÛG¿OæÁóÛô#ðâ_jÂýM¦JòH$@@Ò/0Q[ÙªÎè¬´co<´µõ
+¿iOGt\
+Û /ÃdsxéÂVGÒxm*·è5»uJTþ¾T,V`¼j´ôÇ}°a«nq%b0ce÷T?uG^Göø´mÂ~Ä¨gb
+-!éù.Æô0É
+ã/S,K æ 
+þÍpZlNÂÒ²~÷xn>²SF=ì¾Ãüþ°¾Ø5-
+.¸Ýu;HÅöZÊÛF¿¬p Bè«°VX_×\
+HäæâÎâ×
+-óbï°ÉUù±Ý<$*BE=ä" n½}jfµï¤KÖOß¢Ð
+RþEüºI¢@¹¯5Õ3¤C%oer!P"XIJªjg_#÷yÌº çÄÐé½eº¦?ÏzÐªvwµ8ð.	Çu
+±ùóÝºRIÐ#é%KÄm#^!ê	IØ.GÉ×¢v9E>â¸×k=gé÷ø¦RÆóÚ
+áÕ?çäÏä»¬ï¡I
+ <±IäQc·iög+ØFOuç;ýxjÜpqrµ¢ldÀ-1e3¿áÅ«)ág
+ºìu²Zxh´d'Âõõù+Ñë{èåq"Å­¯Ùöº*ñõÓÀ=×+(Zå
+ÎOú_O+/|PþW¦å2)ÒçãÕzpÆªPE.ù÷ôýãÝP$.w>¼g°£4'¦
+-
+³Eñc
+Ïx´¿ õÀáKßËÏ~P±zÛå~K¿mðëòk¾W"@{®æGñ´þï¢[Y¿%MK®üô2«rù7CDé#
+U[xµf®D®§l-ö
+ÌÅ±
++áéøDs¯
+F$£hJ§õ©y¾eØ+Q,Þß/þì¦¾£
+[Ð
+ÇÒòñó
+Ùv©n¾-í@ùËºå½øÔbà(Ðm
+
+lyÏ8ø|%ìÇ§FýÈÊ³Ñc¼þhü#qBl9)j[
+ ÞÈçÔdäCÒ°
+-«YB@Ñø&Ù"<ß¢Ýçg+²²§4-5¢Dv
+}iÉ%#ñTÀ
+-endstream
+-endobj
+-789 0 obj <<
+-/Type /FontDescriptor
+-/FontName /CWMXAW+CMTI10
+-/Flags 4
+-/FontBBox [-35 -250 1124 750]
+-/Ascent 694
+-/CapHeight 683
+-/Descent -194
+-/ItalicAngle -14
+-/StemV 68
+-/XHeight 431
+-/CharSet (/A/B/C/D/E/G/H/I/J/L/M/N/O/P/R/S/T/W/a/b/c/colon/comma/d/e/eight/f/ff/ffi/fi/g/h/hyphen/i/j/k/l/m/n/o/p/period/q/question/r/s/t/two/u/v/w/x/y/zero)
+-/FontFile 788 0 R
+->> endobj
+-790 0 obj <<
+-/Length1 2754
+-/Length2 19522
+-/Length3 0
+-/Length 21091     
+-/Filter /FlateDecode
+->>
+-stream
+-xÚ÷PÛÒ
+-ãààîîî,@Ðapw
+-îÁÝ%w	îîîÁ	Á]îì}öÙÉùþ¿êÞ¢j§»Ww?-ë}TYAÄØÖ$ikãÄÀÂÈÌ
+SPSca03³123³"QP¨;Yþ+G¢Ð 98ÛÚðþa!æ 2tËÄ
+-À
+-¶6 Yg+ 
+
+
+ÀÊÌÌó_C[^¸¡¹1@ kkrD¢³µsw075sÇùïW 5ÀÂÃÃEÿ÷q5ÈÁ
+hhP0t2Y#
+-­ ª¶@sûÿ¸ æ7sr²ãebruue4´vd´u0¤¡¸;>
+A. cÀ_Ö ¨1"Q ÔÌÌ
+ÿ£Pµ5qr5t À+s ÈÆ|ÄÙÆä  G¨ÊÈì@6ÿ1ÿ=àâ XYþu÷Ïé¿
+Ûü}Ø´µ¶3´q7·1[ JòNnNô Cã¿
+
+-­
+mÁç
+-]
+Í­
+À§nQþÃÏè`nçäÈèhnõG¦¿ÜË,ac,fkm
+-²qrDú+?qs\ww¦kicëjãù_dbnclò
+-cg;&us{gø?6`Òo)È	ÀÁÌÌÌÍÆ
+- Ù@n@3¦¿¨¹ÛþV²ü%sðö´³µi¼ÍM@àH. 3ÈÛóOÅÿ"$±9Ð	`25·Aúí
+,üûï`îÐa
+ù¯¿¿é'ÌØÖÆÊý·ùß-fÐPü ©B÷å¢¢¶n Ov +
+ÀÉÃ	ðþ_/ÿòÿ/÷¿¥Êæÿäö?[ Ï(k÷_.ÿÌõ?KCøß¶ài¨ÿ'ff øåÿó
+-ü}äÿßäÿååÿuøÿoFÎVVë©ÿcðÿ£7´6·rÿÇ<ÍÎNàÍP°ïÍÿ5Õýg@ÆæÎÖÿW+ãdÞS«
+iî(iî2V6wý=1ÿmØ»¹
+-HÙÖÑü¯ûÀÀÂÌütàZïGp³þVÀõ¿%l¶Æ­
++'ÀÐÁÁÐ
+<_¬
+
+ OðÜþ
+m £­ø ÌÎ`bëôWK99 L"þ8L¢¿Iì7â0ÿF<à)üq1$# ÔoÄ
+-`þØ L2¿8üo§ðã)þFàxJÿ"np<åß
+áÃo ú±Ô~#0[õß
+]ã7G×üÀÑ?þFàèZÿ"
+ptíß|Îð_ÄÎÅÐ<>æ¿MÀÎ~#°!ÐÒÑÊÐÑì_)
++8o#C È
+-dâôãñ6é_',ÿ[þÇí_ùÿ9 ¦ üq3ÚZ§îßÄÙÿX[ÿ¦ò×82ÿ
+ÙÀÕ2¶µ²2tøÃè·S°èrþ¥·w¯õ¿^ÀùÇÑÊÐú/àüö¶01wùÃí_j[ç?ÃMLëMÿzþ4Óù]\vpÍÜíÌ@6Xeæ@pò@pW-ÿàzý&Á	.Õ_[ù[®îÀ2ÓïPlàH6ÎÖF]¦d ~:0ÙþÎìüþðÌËî·ìÒü·ùv³³ü#ýßfo~&;øQý)çß2sÛß-e×ÑÎÊù
+à×
+&ûß<ÿBÎ Ç¿¯§}³ÿ%´uYýq,ý£ü,`Ê¿Ýr©9¬Íÿwâ8þ²¹üÑ°GðÃðßüÀ4þÏ°Yüæ~ 099þp\mÿ8 öáü{
+À1ÿ~ïqÚ:üYkp]þà]ÿØA°S·? 8ªûÜ'ß9=y
+þÁÿ\Õ@gp£þ~ïñÿâ¿_@ 7iiÞÈhQØzW%BèÊ°;.0C±«BÃà¹äÐæü
+-HSá¿áp#8Ô¾º#A}-¼LòìyÜTÒ
+¯Òòèõ¤ûaj·iq§"ÿX¤¶ï
+"ð×³½%td,E½37ªr
+Ök¯[m_ÉÊhðü®Ê^%§
+òSÉ4C¤úO~
+³¹FsxdpN
+ïh1ÏÜÐf¯of0³'^Idcé¼O"Ù¾yjo²FÝÏy¬©±:vâãkã½¾Æ
+¢ô=HÅ]ð,*ø²!°ÅLÃ±1ÚGâ5ÒAúWG^ÙÊaGjÜ»¥ÉïcÏÄ]U;Ú»cÔ<:WWI©<¥Æ^½½ÁÄÛP:chxEwÏ½­%k­ãk¹ã5:
+Ã:&ÛHÛoWD×ÄCì½±à®ö¸;½ò-ÒÉ«={,&NìfÜöÜTÛúK%NQàóSÑÐ±òÓ¾sQ
+Å^Wc±B¬äi1@üÔE£3¿,©¾Âh¾÷Âþ3wT;
+[îÑÃÕ¨ÞÝ*a¢@Ã³ÄûSûmjj8}<WvþüP\5ïÝ{aÙã
+-á©ÉÈ1
+ýÛ.ýÜGc÷¦t5Ç
+-Çá0³Ú!>
+-ÉDá×ØáÒ
+ZLË;üÚ5ýùù¹!}ñ8cßtFÆ)s"e»ÙænoP¾üKBÃ3³³4iUÔ)Ï À}¾¨ì2ý*W\«6Ã¯:£ìßØù]öMàºd[g¨'~I·êýçQí.íE÷a·ÁÊ/5!Õ~â:±3éõ»Ís|d<D-AÊÞ÷Þí±
+=S×óúÏã9Ë#Ò$õk6{zGwý®ÑC3
+-
+-3´nÖs8{ZÉØ£'«(»Xe1v&Ìâ^Â¥ûÙ|ºGLíf^w
+D`Öªäf¡­3¬nôV)5W}q#Ö<òÎ­%{	Ö~¾Ë¬Kî \K
+bû,üKGKdUáQI5/j-æô0yðÇê,>ï¸»,ì=>­×
+Î¥$­_9ZìVbDeZ
+¶rÃU8OÅ9\v*mìÌ@HéÔÙ9ö3gW­¶¤´¬ÝLÖV
+§Éé¡á¤å¯_ê2Ì®RÃ2¶^hÞAû"÷3'(½	JãõC'óÏ9/¦*öRúÕ_|üÅî¾K¼>ßé}Ö8¹»0G ,=cì²Õð{þ©WÅ±¹ðk2Î6Ö 
+->äTèÄ¤}(úê¤äaõmLKÄÿtÃZ0ÊT/.
+~Ï×I½BI
+Ýö8ðz¤_ hYL]o÷Y;sÙ
+-r²Ù:K·?Uqy¬z
+M±
+Ò50n¦]úEH¸ùkQ5Ü
+qJ}l,ÚY·ÛæàæØ1®,o"îFØ|²etC2Â»Ükx£F Ìç¯
+EÄï
+<PtØå>ò(SSyGÏÕ º¾¨î©Ò©¸Å_ÏG¦·kY'Æ;÷¼o%Ë}Eçlg"cbéÁt%jdÃ!/½R%Æ£B*yNI¦õn¥kú=ÞMðq¬eä+[ÌÒåh,
+{¬
+-Kâà°é©¡"e+» QTUít
+ÅêÞ~ø^"öM
+F¯ãçýÈÏ-:¡ÑcòýÕ#á¸ÞBjMª=zèÑ>©7ø
+q£j¹Ás8Zæ¾0h¢ôÐEûè>ã¥déÎç-KZÅ¿1¦ô
+!ê¨Ëg¨à¬SÞ!ËQ¡ÉmÏ P	fcdHl*+Òó*
+x«²I±~@æü½)Äp6§ó1ÊwåàÚGÑÞ,¥öV0ûâÑÊß°¤ÈutI±BÝn¬Ð ¼üj;M§î>¶¬é´+évòÑVÇ^¿aµérñNh#ÿ!^M{R]óþ\×x×übø/T»ÝfzpÝoÔÔ¢eJm¤Ã@V?¾ça´Å]DÝöä`®ÝÌïø¥øÞ,¬¨íB7P©`JµXönJÃrÔ;¦ÊN
+`Õ(
+(O<©ñäúxÅNÌÇäxò:Ü¤û°\¶%fÙÝô9Cw£sÂÓzé¯²
+-·­8¨FÖìé¤oJñUÜ}[6·Ú½R°ðöÎcÄ
+-Õó
+-	PíW]¦³ÆLÐPð¶??Óö¶%an5·£
+-w°íîFêXNk¼mÑ|å N¨~yL:*ì¼3`¼ÉªñÆG÷Â¼ÈÀÀ,Ò^.¤~\fépÉVüø´(bCªs`É!pÔO®{bN¼äz<â
+[ì"V¡
+òØ©^<4
+Ø
+W"í,}ñèÏ
+èù*ÁHÃýU$ÃÉ.yÜöhé(¡¢
+Å7ÀÛ`ÔëÅ§Ü¶bÌx_
+9ÑIÈÌ>vá%:ÇþÔ·¹Ú·Rp?Pñí:b[?É`ô&Z¯/Ów
+6¯È3fèË&»þÅÇEnøDÍ"{qù¾¶Ö(ÏÕ5ØñÆ®	^
+(R²¯
+L
+-ÒTíÚäaK©
+-ãùÜùQÑýÚè£¡Qùü\òvë=·4X[Ã«l'©j¶ùOb6Þì
+-Ú¯U-¸]êÚ¯<%Ùó³R[Î±ì<Ë¶øöícLþù[QÝ¶¢U¼2LxHÊ:?3:ºHI<1ºjò=¥ÚÒw"â~·´«÷ç1A05}¢´:ô*¥l%ôÆCU4¤ý:K~ö®ÃåýêwÁ.õà¡ÏXÏwøRª(ìFE´ÉÔq/iûëý¥/ðEK¯«oSáèx^ÑØ¹0"Ü¥Ð¨§º_66PüPº;ÃÉÊ=·Qmºõ¼ÊÚ/D
+¢ù{Â
+-Ú¾"$kí÷Â_AnI»FB1ûdão!_àµ:~fÌã
+ªÖYÁ`-Eò¨?K
+ÉV
+-aêØév#/ÃÛ}YìÊï+:Vâö÷ÈÝ_oªõ}Ç}â%à«¸~ÈÕ|¥ýx
+-C¾Âk4Äc·S'©g&:N</ûSAö';iFä»Bý354r9BåÏa¬Re÷ý&±¾jd&D_È`@·É/
+)ã>´÷J
+
+#ë±Êû
+÷BpÂ¼92£á¦
+}Ë$jnpOÛÌ
+ZæÞ ÀßýÒ£eüm÷£&ÿÅ®ù6çþ3y;{5²ª®°_,¿Kï2«æ¬r`ÛÄ»v!pîý®^¢n¤zGuxd1¾£2eÙø'"àýå°
+Ü_¯²..fÛPýyÎÈÄ§Äfhú²A¡ôÌx¿
+#ÑìñÁ§n¯Õ©¬õµ_ø¥ß ÙôoÁYC7*ÝH>Ãaç°
+-ñn¾ÝÂhJÚEÇqzOÜ³#DÑ4uh®ÚÒñHËAy7ÌhÄOÞ@[0<!ö(rº\{8çÇ Fô!»Õû×
+
+V0)
+:÷PPeNà0£ñ£ô1üPXTTa¯ ðvµÈO
+hò»Ë¯§zñxaÃqN;1tï>`êNJÊT¨Yº¥[eIÇ#0Ró"umÿ*Í bü2	LogßQr%ãS&¨wèáF¿ì©7ÔuHßæ´­h®oºÎ
+\/sW[{X $*ñMÚoûérßc»76ÚÊ; øz
+-t~/#§HÞõyÓ^PÜÓF b><8;æá¤A*z ¿·¤>úsH}
+óYìnÌX#ÞÍaBïè9zPu
+òîNjÔ¤
+-²ãÑ!=Cp8oÈ«]<ÇK¾
+ä.ÒÚjÀ±iÄð|ªfðCk½{@ÈrzöV~:Ipê}W(ëVÈ½08óhe÷ç°óÚ«ÎÛPBúÂ+Ã&¶®Ðè§ ®îOs6þÁ²$õG/©Ï9åe5Èµ°íJ
+ÉmË{tuð ¹IÇb
+9ä»¤Ë®MøÙs-ótîºN®g8ã÷²ò,8BX
+-uBXd}éF
+£*]¨D¿ÚL
+-3ÙumÈü¦V#%ÇrhUÊMø©îë
+#	æûêÃsÌI;nú?^¯¾í?bºØnµÔ ZsÞ3ýáð1îMÅn8°+|_Ù¡¯$³ÑÄ
+>Áä£ãáÎ`ì0çbBÛ6JòÉ%»15~¸0Óy[§Y¼CM@èáßtlTÿmh©lð¹ßb9·º»ç®`ÌpGf¦4E- 1âC	ù
+ý7bÿ¢¦Qüm?J8î®ÚÔ'DWõÛöäÅå^úMó-&ZÐ¢®]¤ýBl>mCæçfÂNÕfþuw?õ=±Iáàd­¯ÁÙâºÍ#ÖÎÁãÞJøjFõÚsMÓ0ôÙÂ5òêNñsàêÙ?
+E¿ÃÉ¯¬?:ÛBEE)¶
+-MÒì¢ìxÛä¥©M}x4)-8$¼2Îe¬Ôóuo8Ð^3"Ø0ö¿rµ
+7×Þ
+L8ÅýpaÛGQælJ?G¤ÙÜÃ§øðûòÄF³o»è+Ml¨¸ß=
+-WâHÌSñ½{	bÁìg
+ûPá_j÷¬öfÊn¸îÉrÇ|Õ¦
+ÈT\íÆ-ÒßÆÏ}d¹­å£º.­Ó+°Gã þuéóÐÅ!Õ
+âF×1
+×C&$ÑG4N¦³*U#ó$6ç¬ÒwqÐPZÁÉ
+F1KÚÏö/1
+Ø0eJukÉ­RúÙ?£Î*ta*v­âWýÞÉ[K^NÇÿ¾/¾}æV$å×åQxeKsþ[M5ÈÝøüÍcP§q¥Ð8åþ4«Ñè5OÚOÌjÈcÄ¢Ë»99oj`íð_¾ÈÕ%|¬«FY^¿O0TÛ4ôÃthe_Æ¿7n/IîJØw©äÀ®
+:jÎà ½í7ù@× P6zu,]ùËýî%mvÒÚ:Â7m
+O¢¼Rþ¨W7CÚ«\5¾»ª:¤ðþz°¾£ðìnä]]áî~UgK?ZÕ>êu
+-á}ê`ð¶è"Pç>|ï
+ÚÕAÊé ª¥f·
+Wí£«f2
+ê]:eò6}Ö4» eöåìc>SK.+È<ªçFÑÝ¯
+`ÀBUNli2­ÊHq²êÂ]cZ}+Å¸ÑFXC!ÅØP®mÎú}
+ÐxDÌxlßô;¬{ 6|TÎ¯jM®¶óÎ©daòZ¶
+°ì-JÎSi£Ófjè²¾ç`L½tÈÛn)æ¤Lã·võêár¨Á¼º§à
+-¹uxùÎ¿N]j*¥×Ý[Wû¹ÒMùNÏWn{}·kSëA+H|$ì®1
+[È¤8y9mÃ£)îãÈÛÐ}¶§
+ªm:µ ×õçl·;
+Éö¸y¸áx@"¶3Òè¯ó
+3$
+E'
+üwqA<þ-ÎæÀ=Ç±²¾®H@m¯ï]Ø°äb:SÄæá
+ ³ äi²[ÇÍö~>6/XÉ--öMøEU"éáÙ­Â¬CÏ¯Ø
+F:
+JB=ç}|o³?¸l4
+-Hs|"ËÒÜõòå«á<JøEõÉ8ü@îþÊÑõ
+¾§+ìüÇÍ¨·ælÎ_>`²A©¥ÛsÄy>~ã?d}ìäÂ7ñòËN%ø&ÿqVsÿ	
+-Êdbö¼
+-ª®£.¶¸òí9·éHòk)úÄ×Qwo©£
+Üa!`Ü*ìúeRÚ+×
+2)·èp[äãê(Ûkâ	ú9çP$¹@U¡1fmþw­
+-zY¶P[ó¿Pø?äPô>l6øÒ!¢¶oò[K5¹Dº2óÖ³
+üüT/ùþFÕcHTF­áËÜ¬Ëæè >ñC¥¹W¹ùí	³½ÝYÄíôJhmªÇù~z_À(té=Ú h`TltÒ,TªAUièvöøM7íÖâ@.dËç
+]1±«¼°kæi24BÇôqU±=(îi÷á7:³³zü¤
+,äU
+ò	ë
+-2
+/8s	2§,!Æï30eyN)Se¢¡ÞW&úL£6¾i[D1 éÊß®JjÚ+xO|ÐrN5Rnð/wIÛ
+-é*XrhÛöÚ®aÿ *Ê®
+-6É	þ»ñSª[pöi±þx,>=§,eÇÔrHJ«A:%{ÑÀ0TÉÀ®m|ûÕ
+ºèÁiI§WxÇO¬`B×Ðsgîã5J f#=T«XD8ÎMÊIAÑ¾¬¾hå&±Yá¬ýù!÷R¾!ÆÂÚÞy
+Û²_ûéF
+	
+-røÉF¶ré2{6Sê¶®s¦ï.Øâºæ"½b?´Û¿Â8+¥z(FÛT}·×øÔ
+¿¢k>¯f:©£¿¡]¯bLTñõ%#¿²JÛM!N×å
+Rø0Y tãLÉ¯b­xÃ7
+¾	­7QµÖon«ÇûA¿~9nÛ
+Ò÷hÛ
+¿ë)JgÛëþ
+¥þVmÚ¿hûXð¶ @~òá¾á5»þeµì¶2
+-z[hQÂVàoÂ¤WÏË&&Ã§>ìBÆï3X+"Ä#Ð1b77èýð 0ÒþýÒ[~ÏÆ9³ÀïûJ¶Îè&
+c~ÑQ¹ÓMi
+Ëãwï¡ù.àÔS¥çR~þtÛÕÆ
+-Qù«þä1ó¤ÁÉ¯k<£pëxõ~dFþNßSSÈÝ'Kæs5N ºIxÝóÓ³_×v¡³0®}HóEã4ißi
+-õ§+e
+©úù"
+3×
+úÎFã6ûÏw6ÃíªVs'Þ2xs
+ù#Ìöã,1t¥Óâ6ÊUD{²
+6§lh÷Õþ¯ÀwP¥B@&°IÁäÜ!ÁnÎã1ßáØ0ÂV¼­!!¦rïFAÜ¥Ç¬± K<Ðt©uW72qIoÊ¿'¢¤
+¯@úÞ*¥ãoô³÷-e|±r§[c
+¥
+&^Zêëq~´¹ 5ÚHrÎ¯¿7 üèAp
+fJ·.w_ÆÊ¥Â]ùjéÉøË1´¿F³Çë¾)3à7¤ÊÃoT¹O0=3cQç2µÊdÙ-ß:6Q;Ð¥;¥=ìqÑÒlXSFÈkªÌ¢ìÈsÅÓ×Þø6ø/\ÆÅ~'c
+íl}5¢K¤?Ón#¡Uá*
+ßøórU^[X§§@¿)!­§*éÀfkrÃî%ä×q þ(
+9
+-ËÁ?¶YÓKul
+âÍÖKVðìáïkÀ"åZÝqâ_Ö|\«é¸ÈçÝî·÷YwBQäyêó¯¨ÁGÉNË×©©Q6û¾PfOÐº£ÐÃFýîgqIü¦,ãxÖ*%Rð%Ý±a×» ôDÚo$
+	6ãÏÑô²Å-XpOBRò´:~Ô&o.)¤d¾!OvÑ©6-QIÄÈt¦-hSÍÍh¬/··)ØÁåî]O+Fà­}­CNö1ù*
+ÅHºÌïl¼
+ÈØ?í¸ÁÊ|*éw¢Ö»ÙK c2? W¦BnÐ?@Ë ãF0PØ±pkª`ã@õhR	¯¼±ð@W`GpÔiðuqÀ
+ÒBM
+÷0¦Ä*¨BáIÐj+Å½Ix{Ã*òè¸Iú@­NÊGd°ÇÅt58ÕÇrý{·³
+Rk
+ÍÐy&ÑJÀK×Ûdã$»Â9Ï¢ßhüwUxÅ3uÍeö¸JØÃi­ªRv/äB>x¬¢¯aÃ[;ÞA
+¾Úo#*ÌtöU­1ó-æúÛÞ¡
+[;Ð&+=@m¬S­½Ë[&ö'ÌÎl§±~ÓÃÐbO­Ø3
+"2sn Rað©©Þå*Çk1&Äcf¢äÙÆÀ:WÓ+ðÝÕ·ú¶ê9%¾8	2²
+>%æÐý½º ðLª(/{¿ì/1[óêÜ¶åÒË÷ÖºÕ(íè±ÒÆ5cà³¦&uÑü­UÎÄ^;T¡83FA!÷
+*ÞÈèlà÷$oS MáÈ~ûÊaÿæU3
+î«Þ§
+A=MKè»Ð±æ8 7ý@û§*
+\ï¾°ìGGã 
+-}9Æ1êæ¬½ÌÊ{,qMtýv}Ù*íªëûý	¼EQr¹.hb
+-ÞZ2N-|Ý@ÐoN
+-øJoµÞÀí¿Y·CE¨\TûA3Iúí¥HÍ?°¹§B×ª×°ókÝ
+z	Yÿå¾|
++Â¦ñæ3ûI¬(LþÏîÏÅ¢MªñxXLÅ,ÄÔnIÉA­ùáYÖ)§ºSC³Ï
+*¶4?ä±rx¥pò °õ°ÎV4y²ni!¥çxRo	~
+>¥Û_Æ©¼iÃ¾tÓ?ý^±=s!¤ªxa$ðÀtÇLg¡monó|$¡vßÏå@ÄóúùAÄz­ònäëVXMÖu.ß{ó¹(£ßoxvçÂ.Õ;}OF$ò¦øu¾F
+õÞKI:¸PfÈz'tièé­
+-u­Ån#ZM²10ã<
+ìù	ÎNK2ð´õ8%8×ïùÝp3üwÎ:ï£	Ñ<Zq®Ê"0p²Õ
+ÂÌÂ&ÒX¬ÅáÅÊÑ|hÊÑ0>5è
+->:h!¯ÕÈO¨¥=½ã¢ ³°?Xâÿ8A·¡¹êð¡Záó{Ê-Í-{jò«9Ö+)n$¡ù´
+-a^Í
+CÉèó¤©ó|\o«&Ë~¢[¿µ<é¼£>ú 
+ÀÂ ^RJ\ÓÜÞTN$|6£qÉ§ùÉù¹ÂõÀ»rúçÃZ0òí[8~P=ÐÒ ö»ûâ}§ Ã¦±Üõàu¾ö$?L"gÅ»ý)
+_ñ1ì°2,©º2Aµ-tlÚèá
+Æ¨(v|=BM÷ÖýêFÞ
+x\$rK°8iU)®5ú		_ *ÏïLÆâ+>âË(Ä·
+-­lÇfÏ¯Ïp ¾&lí?C ÿ0­0¾ó¥q{mAScÕù
+-MÕ°¸~1qïIVWV*!oÕ æ@¯%±(<y+®â%gAÿ5~
+«bâ°`á	¡ðÍõbÓÓÜi^×ùæòèÓ¢ß»ZçtQ¤Á
+"&dxµÐlv%
+-EÎ÷ñÊèT>s=}sÕÍ¥_goex¸¼WZ
+'`ñä¿Mkd³÷¨$oïP",G¢¹Å|¤¼åÚ$áYåZÕ+WÂ¢uó£Ç;.b0 qßÀB¼NqÎÁ6Úãi·Ê¾ÇôèÓfú6ïý
+¬ÞéÕ
+[³Y4íöd qñ/'­ÃsáC­
+-¹ªÑ§°ðosì@ÆÇgBÍ×<õ\kyr/hÚØ&hÅõ¯hXýÓ~3}wk3ÈûMJ×&²49/z6µa|´û¼nð¤Yóm6(ã?ûxW7¸Ä-HvõgBÅîPivVânË£}Jn<ã¨éõ5Ç§KÌÎæDê½àÞ¿=5myüSH\²âh} 
+-Ñ}«ûm²#~
+ûûûVyG
+;ö¼VvP»NZ-ãù1pÂ}ôÊî"GØsI¶T@ Õø[£Pm­5÷FòúÏ¤ºÚz
+5|ªO°"þÉ=u¸Ë³Êb«_M
+ùw®ò>Ðç65%«NÀºFØ×D" Î'4ß¬
+Ò|ýå³Ib¢LÍ@Û~Ð¯1GñÞ°ozÃYGÀ¯ÀD]|-J
+eÄ
+{MxzÿÚÿë"´Êðê&G`þò¹ä=ZÐòçº^Á·EÞ?9
+ån/´².ì¿Ô£ø1cuúºÉ¶Qcµ`]ix9·½ï ë@ÉÇäó}§¡|SÎ`C¾f¤ÌS|T QeÓÅvni`âòÀ Ö°Dqq¬Ì[¥á¨òXÕ¹"rX
+£xb}kaë­Æ×ÓiáÏ]]²àÞ´teÖÎ{C_lÀEjqÿÙ[?Ð¡o ²bõ+(õÊÅ =Wø£°ùÕê-¹zZ%z\wåf(+.U0ð
+k)ÁýU ÚïKWI
+4å¾Ñ¹çõ¬Ë:
+ñå[R!ïïe
+à.¢-þYXø
+ÃG_Ï`:Çßl
+-F,(èã,4+´Ý¶C|ûA@ç¯÷^Í7	ékÆO	qÏk4*ú¶Îì1Ðq/æ®lµ¿&#·OþÈULy.ÎÒ%Kì>Ê
+yTÓ
+HdWKsÙËô\I´xGrË¸&;!kêä®.Ïüòªç!äBO ñúÄì3-¥ÎÞ
+#ßioiDU
+µò³^ÈNjT7Y Á
+-³;ÛeB¸Á²½Ö5Ökohw¾¹v¦mQ
+á
+øm!
+ØÔRSÕ>­qû]{m-ÔE
+F\³º
+O¨xúìFËá>Ö]Êí
+Ú^B©´û:åMªoÊ8äúye°Ã\öÍyÈñÏáV ´Jê2ÿÒ5êU³ uÌ uBÉ&VÌ¼
+é)2hñræ½SKlÝü¯¿ã&
+{#2-ÏÇÕT,XVüáA¦H²M¡üX£×/»°?;NVBJïi¾
+£ÝÕÉ
+1
+"Û½!--Ð)¾TèVYÇ®¿iiëÍ¥$ú~Ø É¾µËEZé*E	ÒYîÛn¢FûCßq5Yã
+1úUDjT)R®¾ pP¬ZqùBð¥ÈLê
+Õ£mï|1¯`ÞÿJô¤Ð"f3ÙèÛøì£Ú$ú±æáÐò[<«°s×ôëö%uXÁ5rÂÞò"+	Ë §TPF&
+VÔ7í'cÙÊîiyÎ,+ýQW¶ÐOP¤d=åÎ^-uÒµ¹%ëñ5°jg-oT
+
+¾ëæ§
+R0]Ü
+­hm}J#³J¶Ðí
+vÇRÎÍwÙÎD
+Èñ
+Æg×uUSLÊk±ØõçmhhxÚº7jÌÄ¨
+±pðûÔãÙÖÜãª5e=cZ"{ca(¥i¿ï¸³ôéÒÇ	Þ¦ÖHCk¥H H_LÝ
+1Z/FÔ§¬~¼nv
+ëðÊ¿"¢RüË¨7ÏQÌ+ÈZG ^¡Þ9¥ÊäªûB( ]nC$HÙ×iªQb¾µR9y"¦g²BÜcáÁ¹k
+-âzþe¤èGÔ3¡ýÊ@×C®\¢I¯äÅµé¥·Â!
+-O¸b
+-yÄ@µI·¼§Ó'³A¤«]ÈqåìËÖS³ìÜ°6²x8OEý2¤ÜËº¹5"¶ÄÂ2fúäíÉRG
+5-ÃM_
+-èîË¦w2\Èpôö%²æri6ò#©â&­D~qH¯]ØrKç;Sl!E iÙ»Cj%üÞa×:´óÄªGÞÌ)¢¿k'Ø;WÝ@ï~ñ&nBïì"by».ï{0yÓ¯çî&àPöy4é
+ÔÝC»á÷!ôxØ
+ú:
+½z
+2ºîÙÉÞh!lí
+-[DkÞÃ2ug'fô0àý¬§%l¡|ÒÆ'CØ7Àô$ß2¯8±
+-±06DóÏ¢fÚk®ý#PÔ%ÚÜÅ5nâÀî
+-ÖÁ/â±Qük¡öØ¡¿YöR·£=lÚÏÊâ+¹©ASÌñ¡øt®:ôÙ¡Y?7
+éÐ&)îÔh8(«ÁÑ#`ýô»º0)u´KíZ»ÏX±YãæRã4Qª\ÞïäJ
+­~'{ý«øãMl
+--ú
+ÔÊÁÑÄ¦X!ÿø,
+Íî|q1ÞAåi!0¹ç3öXe:
+K Ð
+-
+.<{vo¾!Ùdt5É~ÔZtð<âv>ÏU<moêz¤ÙwæUéùï÷kxa>\úi?&^`±"¼¼»¸ hD)ïærÜà-
+?.´AH¼z4õ_?A
+-d\."ÜB
+K#W]cxYäÆw`ºû"²wøÑùÜAg+÷âûb Uôçà¬º7Q7ÍÔËts#suXQ`¾¼*8
+-ä×Û×Ö|KÂð¬#]§7ÉòêÁSPRÆ\
+-«Ì1QK|)ãíà¥×Åã[\0`£°:¯
+-ÿMBKØy­Veî+ÅXfüs( &	°øtÿcm)}ýù±Aç¸äáüøó*,7N$eµªaUÖ·w'ÖÆC
+ªjcJg*Eã(LÚ
+-
+H¢ëë
+´Ý0ª}­øz
+Lô¿huåñ@mk¡õ¿+jHg;ZrDª|ÆrWã9SB-¿µ[}{s>pÉy<½6` äXNöÊkM!£Ï#É#(ß_Þ9!u>Y3á7¹¯eyÆoÆ®G;­uèÚR	O3vr/°Vlab³.ocð
+
+fö ãÂlº4vsCøE(-à¹¥þîÔ¨H0$¶¹¸
+¸Þ
+ÒÜÍ'MnbK×lõOUÇ9/¸.ª¤ÑÄGúV+pnpÁ¼ùñ
+CÔøªËÑô²$Fù¾JÕ57­tY:{·A§­¡Ó«µþC@@Ã©J¦í°1ÿ~«
+\ëç¶ÜQ"h:(¡'¤ZX©1úcâ^5Ê
+-ù2È2U LÌ·j¦Å
+-ÇÉÆ6â|
+-­wg3ÖÐ§
+-JÚÃ
+|ö ºxaå²cú°D]ÖtMjÆÏîMþ¯zb£¥¤V$Ó
+-è¸VÝ¸+³42zI(«Yª¯°óJpô;û¼½¿¿
+ÜÐ:¾Ð½=Q¸ÕÑp?AÏ:P­"sÊGS¥oÆd¹nêEº`ã:Þ´p*ßU÷Iùõ<ÒCå¦Ì$¹Û¡W'&Ï¶m¦ÍÓÒÝôæAÊnÅÊ!Ó;âÁièèþ*Ñ»hÃ]
+)óg(ÜòY!n²[~WÓ\ ×±à<Ù&ýØÏÒ¹K¾cµIÀ·ëÕk2ÖÌ¶~"8ÌV§%6
+ 5ºðê(¡9úÍ×m{§±jØf£
+#fÄô(Â÷Ó¯j.*%¶¨õ\ê5×¶||üÊ/ðR
+JðâQ¶/ëÇI ÑsB	¹K¼÷N±ïÑì¤Pé"ÛÙòØ¢S9ÕµËÚ-ó±µ}äUaºO_ B·.*Tj8ìÑ?SÓôÒR
+á¦ÏnqÙÅ6úªÊüâ
+-ô7¾­rQOU«19½§ñqM÷
+-!Z÷¯òïÅèªO*6âBÙq-¨âS+g	ûj¿UÛFFá
+jw8èºÈS­8Âæ!!©
+_kÓéÕÆÂ
+¾åpTR¢;ûbÿ&²»v¥ñt¶
+-¯"·Ö$íEªEub-<^¤¢×ò¸ñõèjn8SÅE>¦-ë
+µò<P/Õ¹R¥/«K±4*ý%Ü·²tÊ_Ý.»»¢jwsÔø(yª¾vÆgo!!$^MLÿtgF{4ï lD;ÕçÛoSF¨(W ÉE¹äd)AÁÆ
+±ÅØý
+p&}'ÜCáÞõ
+zB1#)b>Wôv2 ¸o¦äÇ
+ôÛùcO04ÌºL'Ñ B7XtÜ4
+-#?0û
+-~/Llz >B#wGX§ÎÁ
+ìÏipmïô:YüC_\Íü:`;,°Ý
+íAÓyÑ)Gc¦´IvßYV
+Ô(u'_TâCØ¨
+
+ÏÃpÞznçQ0ÔP)-¶©¡+oWfrÂwìc®7ÃVâ3Òæ2ó5ÖX#Æ}F0Èé@
+6¥]}b C- B­Jö:@D®f^ÏK xË:'vvN
+î©uÓ|;éè×R4A$;à]`hùÙ
+DÞóÒ!ÚwcîU	/ËPâqìý
+ÁWr¯0WÄ÷­ÜË}«9ï0í{çÕôè(Ûd¬êÖ¯çÐn£úî¦ÅäjÖ!«só%¡ &VC§eÖ}ÚÖEêpHü¯8ÆÒì
+ô.sÄk®uÒò¨S
+-ëAî
+/qäÎ¶!Þ1²O½¯rN\7Ä?ë®àêX5åZÖ Í¶$¾¯6*_Y¹C´¶õêQâ´ï¯hFe¾©gõ
+-Té¶Üð@»Îù
+ ~ÂG¡¥s¤K­üéc^qdvÏ+ËçÉWÈ-h .½7ÕR»CåXZ!0ð	ÝÁ­]¾½g
+¢æ¼g{ha
+N¨«¯e29XÁ.5wgæ^}?Ã;cÈ´bù
+p^å]ïßDo£R#vNS^7j¿zu£&ï®vÂÄcBh!{/¿.Ô]µ;
+Â)
+¹·÷
+-¹ÇX½äñßúK¯eu¹ïè)|ê|Y¬¢0$xï9<ãªfØJÍy{/UKIt
+h
+~©z0¢NyI;o¹
+-Æ#/$ì#¯)Hç(ö+/}Zbwû9x
+¿q
+-×¿ù*ÆèR2´ðwRfð19âËz?Ü~:ß·ÿKõKÊ^b¸í×FvÙqG/®T0_LløÅ
+-O°à&½&¨'?baÉ[Hp1LßðÈ0_û\äÀÃtÇ{ßÔÂ¨(ªÀ­bxuGÇµTßîùnêF;e,hÖ¬1¹ª®7ó¡;3Íw@¬Ë¶#<|&°4ñ4& Æß¼}Di@jNRMÜÞlé×RÒZþY`luYÚIýåT
+-îÊÞ2¥^ìö½÷Qø>³iÁãóþJ_îN~MeOn·µ®Î¨Ì yG·Æ%øZÁlGÓ÷vÏz4
+-ç#3ÃõÉC#ø\ôöo8xL·4RßÒ·À/7
+ÊMÉÈ¦åDÆÆdO²
+Zq Ü©ã:¼Ê.`ËÜ9îQWl|ùN2`÷`7ËKÚåï-é¿«¬Hº/2ÃïfÞ
+DµÁîøkÉ¨éºë×ì(ÅóÖ(»µ# pÉ ±n j® ªµæú¾­FÍA
+¤îÕEôxßâP½nÀ[ÛÌ;¯
+-ýü¯"È¸;X>Þ\µ¾å
+Â9eò
+i¥<Íqºî§8Ô¸ýÔãÓ'têZ1<>äµ}*
+ÊÒÅþÉÚ÷m
+Ve
+f¤#ÆÒî  ð=R»+×Ü^XÒêûÌÑ¡ái½n cspÔàÈ1»lÅ×ºj`ëÖÑÈeºî=¢©Ì9Ù²õ¥J^Åw
+2Û\Ö¨YÃÌÌê=<?6æs/¶dîNR6´8¿`ð¬<
+-P°´À«´
+Õï´Q<u±Ùisâ9w×úhc::ÒÏ
+=g|øºÐõÍÑ9ÜÔµ·DÉ
+âÃ.Ìp÷âÇu¡ÀÁ
+E;bï½¶¶©{0ñØ¢<Äý°<^ù
+:dÝó§@ÐÀÜÎÄw!n¢atñOl¤O}²
+ÉËÀÇl<¾o£ß&Qä®7^¸
+f¼ôn'ÇædÃ¥Í
+ÈÐDÇ\¯ß¬Ø5¾[¹&oi
+uÛD=ráEr¯kª,;	
+µá:±¬Ð¥oIÙÛZ)±ò»¤ÃGÙ
+-¢[ÛÏ=©Ô
+¬Â°TÍkð6Ë=
+èJítå=,¹Mdg(Ò¾
+-Ý%H!)dUcE¢ð-%ZG°
+;
+~hv\Ö7·âEÑñ!òìVÄÊøüka»ü
+ç
+"³Ä>
+È&ö&)<¤?kû eiCóö×¹Í3 ÉàÜíci²XESÉÍ1¾ßhµüÉÝÈ¸i¾
+-ÙAß×N#ë±ëûÄD>¡Nÿª¸jÜÝwKè¾V]cqåôíMÛ§M~Qy1ç
+i¸÷#Ç´6W¬í4z		cÐ'sA Ö Ü2Å«òØl"×.ÍHùi4É$ù/	t$8±ÕY3
+øÅÖê(NuR;$r# 'ívF&4_Ü[å»&è&ç®ÆëBjq×ÚkÛæIÏM§MbÖþÅi&räôqHXþÖÇ6]66$ÓmUXdÍÈ÷áz
+éÅÁi_äñõIkOx\¸ósÃ½8õ+>SÊ¸(
+A½n¬Øìq®¿¡Pj¢Sñhû]oË&ô>mc¿µú! ÷m(úZ(ïÿéOBhqÎw±÷}OTÑ¬;DchÍGÜ:ù2Ç¬Á|¤7Ü.u
+8{/§\¼¦]"]lö;×óÑTYO%ÐZ£Ç.W¼P×MYÐZx´+â
+äß]ÍdaÔz?/drkÁ
+_ïRÓìl4á£|¼
+-
+9ÞégÌTi3õ7
+UÆÍ<RtGûáR4ro6ÈÛ/Q³nfÔ;
+
+_KÖÜv'Q-tÕqß£<s59ÊÈsp6¾Ü·)´zyÞ;B¦¥kMk%&ûB^gqÏwôñ.'	ÂJBâiÎ
+"Î»vs´FíÍ\¥¢eÿ÷9k×ÝO¹½Ìüò,xísÉÕg\2è]=MÿíFx&9rlÐW¨X9×W`rDPûLó/
+ûµSåålx>À0úàºúíÙ Æ
+-þdóo«,ã¹~#Kr¦FaÚ
+¤_b¬êJ\á»üºÃØkBoCñKÛvZ~9sDâ¼
+Y}qÏ^_¹ÔO^
+Of8=1§s2,:ûÂÓÞþylÄ
+¨)ï;úôóYN²µÇÈIZv©³Û~ÙVÖñ8^î2Û,u¹eãF\({åÁïadºæi3	jN²LM.Ôõ>s²{Ýdl°±T/
+«(8W·®êfJòC¶.ö&ÈÒ¹jÄß*2¶(¥lò2ä|äòþ0Ä±+
+-Ù¢ùZÛ<ªy	Ø(ðÄ¨Ëöa{¬*doqÈ3¤G~Þ[í±!¹-Õepj3k
+ÿ SÝeáñÔªÜÁ×í±õ²:sDÉäÏ,(GéºMEó*µËSæòÊ¢ ØMÚûX¤Ô<©òm%Urz©£®²-yb[ÆùãV¦PÂÞ¸»òÀ¡¼If4¡}3
+»	¢S$g;½LN
+¬ï
+KÝVÑ _#0C.ªm>}ð°ÕÙhÆ`²  ¹)íûH	T¹rÃëVÐ
+ÎÓ¹2
+£3
+{J8Ñ´ÿ°¤ÎÇ"0óG±°ÿ)sÞF;{ÒC©Ü
+WÞ¤|6±3Ä{_V·RD$;.zcÏ`k
+j|?*IpûKÔgRÌÂ!bðj·ìì%R\\í'Î·¶-Z9YÀ»A |ç¬ç.
+-°ØU¶^ÒÏnVn±
+/É¸mHzØ6Â°d*gæSð	½½NJGUf Õ"ã(¢±ð!<:½ãp½_*
+-òë­B¨EáÓøú§ôÎ 1æ¾úqZ/ÝqL[??»0Ã±Úð(ùZ­úf
+£
+VID¡aïì^òRû¤jAnsæÍàa°MÀ]Ú9Suº£À|õêuÌY¡{Reb¡Ê¬V×[Ù ÞWºöwöÓ$Ôç7© Þ
+-'%é©<h%b}M6fÔáø%GnäyºÅ9!GóXôx´n%_ÙQüþV
+½0Ö8¨Tc¶j
+Áãð
+K´lcËX
+½÷³²õnû¸¼Ú(»=çh´´'ÕGÐ
+eBÉvPþ¬ðôÜCÂOw¸Xá5GîëXÇr-
+-o|
+JÌñ½Ô&{[¡9sÿã\£=ã	æ?ÿöGmt*ôpc1À¢YY4^Å¹¸[Ï¸ÜuT]àQVwvBrkR3
+-[piwÇgöîÞclú
+|+!b± Ït ÄV3E»0Ep/'S¼Ì>Y´¦&v)©Gd¨ÅièåjÁ½©|½:ïígóó(ÞÉv£çÈíBðþBÑî²3Ó¹¯7&ù¶
+-ýÃ{Z³º¡â÷eOìÏÃ9
+-)+Smª@¤¶©°¹434¬n2ÉÐÃr3Å¼87± w,è^H¥h'ITvCr:©ÒÏf¨{¸Úð8¶é7î=iWMíftÛ
+
+-5oñÓr
+Uzx&vëaQª½s®»!µ{ª2ßN,Ó«!T­.X*×æÂà¦ÐßÐhslÖÇíî-Å÷«!]_¤*¿`o
+À_Ýå ²¹³§fù~Ëf¶Ò:Å32ø!ÐMúç}8(^~IC6.	ö@u~fv7Æ²´9DTºÒZFååS&ót
+Çs³°î
+ÚT³kç{X¥iKH«ÔNºd ö¹ò ÿwç*1Æèu¾eìçt[{­o1ÅÉü2IËN@Ã ¡­ú<Ñäk³è
+ó¶ÒÏÍHC»·[çªëWj3Èp¾5Îv¹Ý¨rÌç½S¬|ïSÅàÃKgx
+¸yÏrT)ãQûA½?]ö"2f
+é³Ú­-¸«
+µ
+ä`­-B³ïnJ%väÈþºññRj
+
+-ÜE<1}¨wÐÊa7yOñ(.ZgãmGoÆâÈ®LtùnÞÀûy_
+-êk¦©Eµ"jeÓ^
+8
+-íü1Çûs¡ÒXÇ<¿Í§ýÔìD=$rëóéS4©0GòZ³eÙ
+YoëÍËÚ41
+kqA´urS¾DðùÄ÷ÙgE$ÉlßÈiCºì"vç	Hà¡§Ib¹ÖP/¦¤Ù«êaëü þ1m?¤c=¯ÈL*	Ù®Øg~}ô
+D]÷^1.`s¥¨ªm¸ÙZi%8Õ!
+ñç»6¾Zu¹·ÍTKÀo%5ãàF»ÂV2R`!ìõê4ãb9°çBñæX8Æ.æ¶Â¸¾]ÿ²	ûj¢Gná%M'JO¬]Eº)ÓæÌ«@	+F'iNp5«Ú1É°k<pÿa.ciQ äStý¨zNÙbVöô>iA{/'Ò7¨
+7B=!¾½#ü.â¸-ã¹Ê¥¬IÕ'<sÈÆ
+uvºÆôQ?
+1õüý©*âyùÇÊZoÔv¦
+<|ÝJ2©©)»®þ vï&zÒDÇh;pVîa¥«DøK`tPn
+-WúêBp´ mÐçbKÎ/d
+o¬DfÈ
+-~ loaV$Ö^"Z´Ìf`«>ÞõÜ«· Äÿ-rJ ôñà,ÁIë~Õ¶¿LëD
+-Øûªeà»o·àÜzðüseÕ½¶^×ÔÆ(§xdéÃª£è
+½Õi[½äÞjo]¿kB´>J°hTïkm¡N:Eè®
+ê5_à©TE>¥³õ(À×®FHÞAu¬ká³EeµiE |ýFååÄt!X4ÇhÎ®nH§äT¬_l[É²·¼íêCèùO ÏÉ÷Ñ4q­ä¥:áz
+-ZZxbÌÁ0
+-dNÎ´4pÉ)®Ê§vå+ÞJ,&Z÷LpYtÿ	O(,t«nëq¶(Ó£`å2ÒÑçÆ:ãÝ(¡ý®°&¾µ±.«©§Ã%êøøØ<"ÄFLôFFA)ê·Íøª¶(Ò3kXO¹± Ôëaa6ØÅe¦
+IÙ:QÿWÉÀßó \Û7°ô0¦'t¨=b7#H¼HVÛ
+æzÙr©~wõC+P
+41%È²Y°¹ò¶Îí]<oR¢/PëE·
+£ÈÙ
+-Z:e¦95/Â8Mè
+ÙMóBídgD£mZ¤}p«jèÑÿWÃ´]Q
+-Kn)í:CT:·@2%E÷5_Ìò[¾÷Ü LÓ_k	á
+ûø_ð%÷3\Ly¦PÏG
+µm3Y~ÙJ
+èö
+k ÃãÈ6Ê 5êP |£¥¶:
+¨1«".=Û¦%¡ßòc^ræyé(
++?`Sâ4ß[æ¹
+-Ô×ÚhÂ¿FØc"oH~È{ÞfÐæÀÇlWÈ*IâHSîÊËï}ïãïfVz4rD·*ä
+é¡Õ
+ïµ:AâìË¶=z£ðìVtÙa;>ÏT
+-ÒNÉc[EÒVèB|?[£C8
+Á¬¼C<(+µË÷Faµ+¶#´©
+-Ñz2uIÝ
+-½Ì
+(¾Zª´ª¢%BY 6¢BxPëh	uêï4eò-½2y²»&Ç[;HEZí­ÿ§¥RäÇD>\eãØ=,!LãË¸óº8;ã§H¯x¿qeÀee îVºrhûÂÖ;ý4}g]æýe1d¶·¼ å;vÐ51ìÚv«7Þ]ü¸9e6ª]^
+ýÔÍöÿÛPt­kþÓJ°ÈÈ1¾rBçà^2KàÓr·I×)÷Ô´ûÇ·D|p¼vìÃW§ºhk|bû­\îÚïgü#
+b)Ü²Ö¥¹þ\Ò9ou&8@%é\SAÓ#´YØ¡d SÍÚÕÖ}'}ÌÇÚúÃûëýFrZ£Z²$Ç·¦ÉÌNë$¾÷·wúâ`*ßÖÖ¦Õ
+Ì63
+ ìCL¸Ô¬@F1ø´Þ§¿÷(K>¬¸		é
+tâ	¹EhV5¶î|aÆÉÇñâ=$Ë-JºdÇÁ#%X¾ÏÕÜÖ3ÆìÔ
+r"Éx1ª®T·Yâ./Øîx·é´iCCÖQ²`ô¨ÊÂàÝ+
+
+Ý±ëA¼ì.FÊQ7[Ð¿$Dð­ÁµÖÿËlöénA&Â@¿@b}'a/:åðÜ4$í9È1
+-ÃH÷H¶
+±E%QYó¦L
+,ßAûþFìb` jÈqð
+ô~ïîE,¹	¨C5öÉ"DN3úOñmùrÇHÎ"!º£cDÖ©»0ô~Oè%£Â´øZè
+Ös7HÛ"	zõ½
+øZ¼xò_~
+ªä 	4ðÜä½FÓßµ§Â¯Ã¾¤ñºÏÞúÉ«»öI<z³4­0¯JóîF5p(üqX5Ñí®=´Èái±ÇHåæ]>æMîú?3@¥PZ_2=
+\µÂmããÛ¯¤âr 9xðîf
+Îô?êkâ0ÐeÃÑSÜ¥r o@¸9Kä k
+
+rßÍ×¼
+¶,Á
+I*±s-¸..Éñd7]±¼Ö`Ë÷Ño£ GX&/Ðr@úµÿ+qiVÖ¸n+¸ÁOò
+1P Ï}Ó¯@ùÝ¢Gï´¾wÆaÎh¡-¡ð|çx}ÜÖz
+-È¥K©ÿÞîä§a@m$FôNg¯
+s:Eª÷¸ÝÌ¡öÒe>'ÏmDÍ?â-)7Ê=ì¸¯"Xkä=HY\å
+-Ékúg0ÀùE¶Ñ4ö
+-)H¼&]k4Ö
+/¢s5ºÏêÄ	Á½Y=õ%K7â59#RïJéØn4ÅWÃ®¡2qo(
+¨v@«L«Â
+-ÜS¹Ü5Ä
+%0¾KÀ
+ï¥
+Bº(¶VÝb
+3öf^Uv\°{¿ÙëdN#WCîzMgÝ_ê(
+õì¥ÞbP wCÙ$q
+çý&BTÿ©AÂÝ
+aQ.U
+-3+dÿ¿¶IáfÒC4 {Y=ÉÎ$èkKª"ó¸ÑX:9o£hÅÊ´ÜÇÝÜ2õr~Ý9VÞæË³àMÎ·²/m
+ i*ÕÀ¾ªéO"6=-HwÉÁH¼çÑý%IãÚ´Iwf«®¦ø'lH]
+-m¤>Rcçü~6´MËÂØ(q»§+\ç%âf¬çª§HWâ_¦yVµ©ýíÖ¬µ´Ðq«øÿð!üÚÞµ?!&òwàøÈ[<¯~¯L,ïchõù¸ &OE	§~¹|ræÖN-_z*yÛÝãa~\÷mt5çHØÆ/ô
+óWZÜ#QàeãÊBÎ³ûÃÙA¡ &MaÌ¿)wc.;=`Æ÷À4öêÚE%Gý¸~ö[±6Ü·vQåpuÂßôùÓ³ê'¼àí}7ÉðÌX£ÅýËëº5&ãÈû*Ùo¸Ë+¢§áU¸Ý9Ù»¢;ÆäWKÔä¯9?Þõ^Z+°¦áÜïuwÒÞDf*i1%µha M¯31{mõ²Æxçc`?·²¯ïßõ ÓR$
+CüÚ}	¯mçdñã¨ÄYÿè0AV°V8"unS Y2\º	
+%ÙÜ6ÿ,Æw'_¨s~¦£çìUÏÃ
+-+K§¥Lª `6[9eüÖ­Ss
+F8§ªìpe
+/¹ýï:I­Ûß~G©"Éëô¿j7Dîø¹
+±ÏÕ'Åx
+øïjÙ7ò
+ÃÞ@¤"«¨{*¾E èèÊY³´uÿç
+p:
+=
+RíÌR^ü©5§à^¦ÎÍ
+èP«uIsÕf¬uÓy
+-p-Â7­rJq!¡g¬ÚQ½ê£OHvÅ ªHÍü@ (·³|¾À«×ÊçA/A¹ozÅèv2RØs|Ø[Fµà¦	A¾³¦¶Å{cjèEïdÃ¡F
+tÅc4Á
+³Ä§ Ë~ L_§¤­Ô9¶².*|õÒ'¤­Gb½ÅòYTùg[\â[s23µlü\àÒ$gØU¡ááRr^zàâ}3WâÞsÞ:µÏ¸,\»TJ¹#h{
+ÆÔ#àBØö,Ó*ú-ÓÎ_©ïyg¤2Á Ð`énæ©Þ|é_HHG¬mÏ
+þ¤òü?0
+cG§	vÓnû
+W7Þó
+í
+GU
+ÝÔw#tuü4áDý!ç
+A=8@f¤õbÀ[!Èz`°½ëóiMv'3r
+Ôéc¥ù®Iùë¤ØÓ1¯ÔTïRKBôýÜ/
+¨üöîãÏø0@¦q¤e*¥ÀK³¿c±Js© Cx5ÉT$Ùå)õ'dìyÊ{ 0àÊ2
+-!±ÙØ¤÷;n¥äËÁZÞKÏ
+-z 
+-$BJ±*.¼¶äÅ>&{
+¬6X±Æ.¬æ¼·ªÈwßtäÁ¡cÇZi.uð%®fÅ=
+1i÷M©k
+
+x°Å½9ªM²9bÍÏîZédî}ÜªØ-Qg×¤ÇÄOÕÁ$U¢jçåUj?!²Ï&kã °{ê koc¨
+ö036Ô· øbc)§#]{ëÈ!2¦ÙöZM;æA¢ù5sÖ
+&üìF£rØ
+tº\ÛvÀ60
+-
+zâ®Ï²;©5&¯ÞCúÑ}kk¯6}÷^`ËÆûw±Â¹xb
+ßãë¢aw?¶W´1?ùb÷ 
+Ö2ôelvþ7t;D·øªAº}4t¦FÏ:÷eÇ9r £dÜî¸ñ
+(YQªz·6SþKMÏX(¨¿¥E·òF^w&uQ­×»lø|Nâ¦ß5´¾·×4gA¾V½òÓÁì¡+ÞùmwÉG®Õpÿ4ò¾
+-6+×àBå
+- iCÛ·M×7?$òH$
+-Í#6T]
+',²ßnNuò:_^çN)/ssÂ¢ý%éüâ\7vZ"ì<½åÜ(æ/ãRÅOs
+-3\ÿuÆ§ËYr>[F,èYÑ©øEãb>3B³0øÍRPzaô QúÍvÅÃÃYÚ­WG9
+Lm#ÊÙèïØZÐ®Hx=«0ÃáäI> ·0¼ÓOt`EN¯4ðh8v£ü(uBÍÍÖÃaT6:î
+-Gà>q zeåUrIc
+B
+WX#ÏaáòÚ¡¥à¹q
+²ShïÐ8tn j
+Â2»©ÀÕþÅ1­üMú¶?r
+Ñ>
+-é
+-H·Ø¬o}	CyMñãw`3%¾ØÁ³åP\öâ
+-óý]òsÌç/ºâÛøë©9¾q ²×¾Â4H·æ!Û¤`5jcÑÂAûãk
+Øt@.§Ò¬|ù¼ÌmUX×ê%+´·!|«vïZr²ÿ/za4Ð?`ÆqÆ,çÚ¼6tÃðzHj ¾z³)ÛHò
+-ÙDà®==(v
+úGFd ù/	ìcîüyÖ*ûA¿|¬Ãí}ÏY¡¡~6Dª¾D
+=ª:ð)_¼ü9~5AÌweöE\qo³cþ,	Û¯Êá°
+¤
+-Ç	¹·
+h	)ó~`¹jº¯	Î GËC¹s^Hl³XÖqäsÒp(
+-endstream
+-endobj
+-791 0 obj <<
+-/Type /FontDescriptor
+-/FontName /EVNRWQ+CMTT10
+-/Flags 4
+-/FontBBox [-4 -233 537 696]
+-/Ascent 611
+-/CapHeight 611
+-/Descent -222
+-/ItalicAngle 0
+-/StemV 69
+-/XHeight 431
+-/CharSet (/A/B/C/D/E/F/G/H/I/L/M/N/O/P/R/S/T/U/V/W/X/Y/Z/a/asterisk/b/backslash/braceleft/braceright/bracketleft/bracketright/c/colon/comma/d/dollar/e/eight/equal/exclam/f/five/four/g/greater/h/hyphen/i/j/k/l/less/m/n/numbersign/o/one/p/parenleft/parenright/percent/period/plus/q/question/quotedbl/r/s/semicolon/seven/six/slash/t/three/two/u/underscore/v/w/x/y/z/zero)
+-/FontFile 790 0 R
+->> endobj
+-792 0 obj <<
+-/Length1 1618
+-/Length2 3556
+-/Length3 0
+-/Length 4561      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚt<Ôü¡B$YùÈ
+·ìÌl²W878ÎÝ¹;{Ë¨ÈÈQ¡)$¡²CÑ&Êò;Úßÿÿñøý
+÷xÜÝó5ßÏ×ûùz
+ñÔx
+GÁÀP%@ÓÈÂ&@¡Ò`(TQHÈCÆ¢~Ù
+¬PDSú+B©6-8hÇúÞX &
+-Àä`òJP( 
+*þ
+-Ä -¸	}<EbÒÄüW72µÏ¯¿(B
+)*ÊKî¦ê("ÇFp²ÊÚÇæxEöÿ§¨LP@|}}ÁpOOt=%&	øbÈn"ú ÀeÀîúI
+-Ì(X¸aH?
+æx4ÙNDT@áHÔo
+E¨Ýs=CÀÂý6ü 	ü
+ Ã~û½SÛM#xO
+çÁ¹h
+èÉ~dI CîÂ±$<5îÇ`á.ÔÝ£Ã
+õ³ Êð'?!I`»Ã²S:fm
+RïéÂI;çÓÂQêÜý!?/×÷ÅþBh
+Þ¡ô&@,q/oÖÏªñÍEd¡P¨´4òP~7ÈN
+j×	Û1S9ð M¥
+-Æ QÔÆ@ÜÞ¨àÀ¿
+ÿ"F
+@bdÀåÁ1þ©N5£Ð?0õþ?À
+J
+î|~ÿ;GUÃúÿ	ß½bµ
+¹ÄOÊ¿x? @RÒ2¬
+ §(
+ÿ[å7ÿ_Üw­¦pÌÏ³AÿÔÓÃ¡ñâ
+-ÔÙý¢áóS¢?F
+ø·1ªf úGüPY(úû?¯ÀnÊÿOù;UþWñÿ÷D:ÞXì®_ôGÀÿã{b°þ?#¨jö&S7ÃOÝÜC­Q?ÖÙ
+Äx{þ×«GS7D
+çý=H
+IãBbÈ·]Åüºju,2Å0;ï
+- A¡ÿñQWáA}SHÔËÚu¡¨õoGm
+ÜY=)Y9 N$Âý¡T}IÉÊ0ê"Q~»Ò `
+LM¨ì4È¸s¥ò ¾cúâ7Ú9ùÔ_P¸þeæ/¨ @°AjeÏ?F­û
+R+ãÿR ðÊÈQU*ø¿£6#ý©!ä¿ µï(Emæ·
+ÿ
+ÂH¤¾*»ê¦ÎõÞ}ÂP(?±·
+Pt/¬þZªÎë
+{#%ÃÜ²tBo=ªÍí3q6BSe}Y:?¶G½þÃxìúg¶©ÛÛ
+6
+PÇOA±J
+½åÕûÐ.#AïØT7fHÞRãuuvÎÒ8¤+Ç|Ù
+_Êé1NI¯Å±Îì©3*ÂUÅk÷ÝæTÌhÞ\=À¥  ÍDY£]S¬ñ@½ãC­ iéô/ÉÇu¦Ö3_JÉ·ôÝÜÊäf&P²§OeL6Êñ8¿:Fµ¹6E#(Õá¢.¤W¦
+2<h¥ÊBoáÄª/e£ºoïI´«Q,Ìfå#Å]íÆÀ,}ôÅORô¦¢Õ*¶ í
+ïB4\_¯ª	ØN_Ó
+´©[9ñ¦«Ûò¨t0,ü¬Ç³NßLþEÊÜÒ}â6z6®NçèyX1ÒÆ²LÝß¥%ú¶¡kEÛý÷¹Øf@Ñó|	6k7n
+\ØÎÞ´)wèXRa½äÇ¥óæØ¬025§+ÂKxR<ÃÄW5ÎIåR;¬é îoãgÔ³UËâøåæ3w\¬ÏÊñIê_ì
+¾G!¾t¬v,êªºÏü8` Bû\ß;É_="©ZßlÅO©3õñ<x¬?M9\{aßµb#g¸ôªM	oÌ[®~¯4· /;÷Â#y5½iLÞßrcoqøÌB^¬SÑÌâ¥']NgÏ¥w}ªT@]Ð fº|¸
+Îô:Ö¸pÃü£â$ÝªÈÕÇ·:½G|bg¨5ZôrË¸20æMßÅc§hî
+Ì[$Ê 
+O¬
+3L§û(*¨
+-Kã|Ã-Ì÷Üx?'Éí×ÝîÖ.×áþ
+3¥t9'q£¿DÙÏ«%}eC?Õ`ôõ}":3z²BåhñútÈz
+¡yøZ¸ßó1õæÔÐùt+/ks¢
+?)Ê<h
+ÿR£¡S©ùlºñºPºý[DýUñ¯Èì1È d%B
+_¤.§åî|ÏøÚ/Kò	áÝfy)zµ>	5ê·î/y½âßf¢²ô±d ^ÁwZ®qP¤5Êôð/
+-
+-^ÕL[r3 ¤©5ÄîÕRÕµ{
+n6²ÁÆwu®rúÒ²Â»F´¬Ê#f«È²ºQcêÃ\üÞn/ér¯Ó¾NèÍMxq, y6ïÙSû>9î):kèÓ)N=îmAÓ£cÆÍñ²hÏñì£e÷¸Ã°rA{Í:ú3Aõ
+j,å¥F&Eñ
+-Â%Y9¥Îî:ÜB9Õ_27!ÏW·Æ<^wn¢èö
+×,¤»÷ÜGÛ3Ø¦[ü|LÕ^ÃÓà¦¡«aqIà©KõQNº
+îûÐ:,;Úo?ð¼r¦äÜc
+â6ÖÅ²õñQ+§ï+¤!fcùº
+ÒW­®±Ý	/¦)S×*ujJI
+}eªë=¯^sªéIküZV¼S,{¢Eé3osûßÙ*?f¯¼ÎxbÃ*F
+n¶XÞ
+ù~©6ìèPµÙ©úø°Ú>
+-ú
+ûA±,³ ,g®Ê÷Iåa­ôyE
+ÒU¾Z}ìpqÿTú¥
+8îÕ?Dúñ]­e|RÚ19qø
+«2ÔI+B÷HHóäÏ¯VÃh@¢oòÕ
+ÞjyqbÀÀ¡E2zÌuj>z&@7F(-bkd»H,{µHã[îwÐ´ÛHYí?x¿ºG(sÛ]ÅÙêEÝla«y¯ò¹ö8«ÄzÎ·{3MÊî;FÏ§ùÄËnW
+-ðÏ°mYÚ8Òµ=
+ýàí;èèûG¶öÖ´Ç,éÊ>3ä<ÕÅ7í£{u2W"ÇJÄvk¯zÑd®
+K©Hßóôflô³Z"h|¨×É¾v¦<£pT¨%3uq®<QiÑC¥ ¥HÞrÉ­Ý<É3UÚG[$îv
+-èXN¶ÊPzj¡Ó ëû-3ñ+¥õT¤*ý
+åt¥¢ózß^Å8|[_b4ÊN:Yýbã²Ø¥ZÚµ¹O,ò¯²2
+¢ mFDºdÌúéiü¡=Ç¹9"Ô32ÆÜt6f¤í}.ö¾í0í&
+-9Kí±>ºô~	Î.9B+uªv*[j_J%T[â²Z-CÓýL|^$pX·Î±'K¯èõÝ¾èÔwÙ%®èßt
+é®~àízý{@fï¾º(ã;]UÏóN¸Î'_ÒPpé?7bJÜ££u6ÀÂÐ®eâSJïteNhÉlD+¤¾ÞHb>^¤w±»üB{kuÝ¦Òd
+·<Ã´öï¾ÉcÝßq¸¿d
+-dÏ¥i	Yhë¾f.ôh·ÝÏ«é
+í­@¿îÓk]-|g'²åQr|@M,ý»ïÕÅbòl9S¦TnùLÑßô§ÅO±a
+´ùÖX+Á9^ØnC¿{ËI2chÎ¥½SóCá#[
+g@oÓÝOjLKÕ¹¾µ-èâ4ì1¨¶HÈ8)C{/£Ât¤ªçh¢XÚÓºíPJ¦¤ï®AÇÇg³Î£ì^¥]Zd°^Y
+
+-Ú.´ò¹$µkò5¼ÔÂt!åN¯WLÝ_9ü6 åÿÆg¡¦ëò'¡*ïøòWÝñ¸ó*äçño{Ê(±úÑºõUõDQ3³ JÓdÚ~×ÈGÍS,5ç§êM]©õæ×Ü^´QgàºñÖ¤+ZÂ©¯ë
+xaúô«ÉZ|HÐuMskP r*¥ìÉ½5Mí×ÎíÜºL£[è|¨¡+_¤Ô
+¾Fóµ
+ø¢p¶Î1>ö:Ú<EÎÃBµ¼W9 9ø¤Iç³;UmU¦½U¦îGEeËç2Õ²åb-ç%"
+h´W.æ½Ñcâ {86K|Zn
+exàfcm¥IòÌ
+­å²iMçÖ`N­áJ1êØ6jüºàHÊosÕ5
+-8Pó¬
+Ój&T},³yÉz3jLP¦½ü}(Ö«l_xlHêÚfûÕ.JüNs ù}éúuewë#Ö]ÂßT.W.$jéÍÊÏåOqÞ¶þ
+²Ñ@i¢
+z<8I6sfpç°|r{\fü%qâ·hä8Éù³&E|K¸ûú
+xÌÇ¡ô-³¡
+4ËQ ±V/\ÃÚJ<¤Ñò­BÆ*ØFÙmãcA}pbyÄ»¢>YÒ0Át
+=Ðãoÿt¡^íùkW
+¡³Ø´Àè¾")BEÐiXn¸=a>¤]nf!ò@Ã§ñÜUMnÕáÐÏq½Lëìjj~Z':ÙïrLèE¨M·ýsHïz
+kÃ¢é
+-
+;¦/&¹çÒ%ëE
+-Ê¯û<4±7îb:¾<{b¼yÁóJµëÀÈbNþÂô¥·$¦Í{*$B2CjeÃÃ
+-ò*Ç|æÃDy>KéÜÄ»Æ)æ}gù³Ãv»IÒÌvM»¬#A¾Æ­¬í
+-ºÛ{´s
+-
+]KäïÔxÍõè
+-çÙÂDð7ÛºÑ²h¡öÉ ãÜñÎqÊUs?ÝÚ
+èÆ£³U·Ä¾,lÍß¦èÁ·
+åÅ`VÇîo¹4x{»:åzydUB®}	ÎªÓàw³»ç(X`ÓBù;æÀÖ^Û
+OÂ©ÎÃl4Nßr·rN*îá¶Ë
+ªö+n;L«ÏÂ¦xmØéµ´¬¬tÖ;ð\¿bù4+a^UZfák«p©_FL»6ïs>Å@yÅÉ9õÚq2Lvÿ«J÷ÍUÜ+Ó
+Cô[ÎLãÝl×öqgn
+-
+¿I÷vcj_0Æd 
+àà-£2Þû¹Ý~ñýñx^Ð§
+-ÓåÇ sã
+-wGGèå`=-M$_x6Z³Âgût°)¥ÑëÆfùïhd,°ÙZµ}
+<è%BT_Ü¨æÓ	¼ÿñST~pKíÕ»ðËû¯TÛ:ºG×1¯Üayö°õê>7t^h6Ù:,çjD±:@¸Æ.©'
+,TrÂÚþ¡ GÔXÑ³V»©±qJ/N_uKüyïâ-®<PxûÁ	­éONa·cµtãúº"¾
+ñ¼)ÏÂ%i3÷ÔÜëÚ³"ÅÉÝiöÀ¬rº6HC¹*´P÷òÜ;Ñ+,¯4ñ@Ðñ©Ø]­Å²9ÙmÏå/ßkVéã'³ë¼-ìì®Û¦¤ÎÄ½®¨¶
+ó(_;ZÃ
+-2èM=Ä+~Øôq7ÇÐÃ¾P¹Íå¯#M]?Ò
+-½O¢ÜÃ3ÉítZ®Üâ°O^l½àµÃ³ù¼3Ös<÷µëFu³¡ê¼Ïï¸<®¯ÈI©g?n/·é
+:ÏrV«j´´¶pÆ×`ê½4pTïÂ%Wù'Z½+nÒ¡Èjý|´ÊZ\}<ëÛÒ>³ì
+è~Úç'¾r¶Ýw0½°õðÎAóÙ¨s}öÌ¶ ÜVûÿ xÿì
+-endstream
+-endobj
+-793 0 obj <<
+-/Type /FontDescriptor
+-/FontName /BXWTMS+CMTT12
+-/Flags 4
+-/FontBBox [-1 -234 524 695]
+-/Ascent 611
+-/CapHeight 611
+-/Descent -222
+-/ItalicAngle 0
+-/StemV 65
+-/XHeight 431
+-/CharSet (/a/c/d/e/g/i/l/m/n/o/p/period/s/t/w/x)
+-/FontFile 792 0 R
+->> endobj
+-794 0 obj <<
+-/Length1 1328
+-/Length2 1345
+-/Length3 0
+-/Length 2190      
+-/Filter /FlateDecode
+->>
+-stream
+-xÚS
+8Tû?q:î9=Eéryyåk<Æ»4HJeÙc63{=Æ$Êót*RJ]½UR$B¥¢$
+ÂíH(ép*îÇÝ3
+=Îý¾{¿ù¾=ÿÿZ¿µÖÿ·Öo/ðô2eó±@¡¸)B³
+^v
+t ÑA26öFp<n'¯
+¥2C­¾@ØKa'l®b(p 	èæVôåV4`Ðhã@Lj
+ 0<(ÀCaÉØ
+(¥H·G@æ-tKËå&êpÀÃR¡ÀÂ
+°¨ÈDÀ
+ã!0®ü*ÙFã+*U¡PP ±Il 
+ÁÒ0TÁ*H
+Q£·:¼0®¤0 
+"£2"Dòa) ª/w°Z££`÷Q	k SèéÆ¢UT
+
+ñxX¡J
+-DÕ
+w
+-
+ å«HñP @ ~:8ì5 "ññ¤QdHÅªJC´ÙåÛcb1â2ê}æ}WRÇb
+-4bü&@P¾@E/P}P$T»8aé³-ÆÆ¤[Z0 
+
+-àpª*à­Àj']e&8DFH0	4àHD ¤\*##¾t|}#Ñéðp!(ésvÂ
+
+FïÄü¥H8Ø@#äG4Õoâ´PCEÊÏpõ©k
+¼}íQpÚÙaá ÂÅ¦f
+B§L3&°$_çèÀ8{µÕBÆ^÷EFTå£$î	Sylm¯+¬Â=ÃüYþþ4G|èÿ÷¨CþöUYþ§ü¿}G.©ýäQÀßü)Gr,ýà
+®±ÌGäâo½.8Dl
+-M´qpïà<á¨xÔvØ¯c
+Q
+ÆW-e ©RhBÄ#èÄñápµ8b8$r<0)I5b~T®ÊDú*-O.;£
+Qsü®^Py¤¦GÏ:.8?®äãE¶Â´£a¦[ñ>©_Û÷
+ã°®51ö6úÇ°¯7v&úcÚkFöHQÈºY´MÏ¶f$[Íj*(,l7ÙZ7mÅàk»ÑévíÚú &Êõ¶{GÑ¿²aÉlÐÞ¯l~)Îýp^øVkqaEG£&%YKÏÂ©£WÊÎ,ÍµËc74¹,½_Yó&u
+çÕ§Û÷¬çOÏLBÚ2
+º»u%nýÝ¶^ë»ÔãåzC»É1ý%qÑä@Yµ×
+-§?C/]{y³Iþp°!:´=°éÄ°^ÌÉ?WÝó«
+W­eË
+mYlöD«yÝ¶àÔ³ëgTÔøéiq
+-H{¼kÛt{,òØ^q(ç0{Ï%ÎÈ­&C·igPYÚycµ>Óµ)8©­îîGÁ¼´}ïöp^¶¶ÈÏ£õ5Í-	îoYÍÙë4Iå!ÎMÛ
+å}¥gÚ®T6Ýºj·S}ïD
+¾doçê(ç§Ïþò
+-ÐÄ±9×?úg5nÄÊ}¢=,ûO×ô
+
+½C:öd$£ÇM?×Úåíüý~VFa/k(çU±öeJÔúù	
+[O{WÙo¯h=ñÎÕ^dv*¬(Cë¬pýj¦ÜÚþ=o=vªtê"VÃwÚ66éùwfe
+ï¿º*ÄN²J
+éÃ[ó\Ç,aöLõÌÔ´
+üÝó'#SWoTh$=h
+-Ð|Ï]ÊI\ã²%ï3H¯:x×¥CM8×9òqpoL/¯²©SÖ~q­nK&õD^ÊM³_÷?tù»÷õå>ï{¥
+¼sÿ6c¹5%U3î5·òÔË¶
+1Mã\[µBùðy]îë
+&:Oê­·e8N6úÀ>å_ÇÊzç*µ?z¦®ç%ìÖç-½4/±¤W1ÉÜ/w³§iÔã­o&v7ZCR_oÐàfò$fsçûW¥ìh¥v£2é²Y¤¤C+¾±´]`èï7çÀ9æÆuÕââÖù²¨Î
+×GÞ
+NÚctð¶wu5ò\½Ã`ÛL×á?zêSÁð=ëÄÌß]3ÃÍçuñ ´£ÞVN+¿ºárfw-)×ÀâXlÔüÐh·®á±aßý§ÓÚ¶Úü±ôî½û
+Î¸Ïß
+i»kåýûÂjº¹
+*Ñpäýñ
+C3·H`ÄûtMKë»¾qi³gÑ»È«|ÉûSÛ'½£¥¾·O·f9mÊ«üçóGa¿¦×»Ã¶YÛí=/
+á¯$[¸yû.hy<ùð«Æ³]©ç>i=ôh¹<Cs,Û´Ú»¶M
+-öÉÕí®Ý&mÙ`T¿*IuôMím7{#qÀ§GºþÌÒÁ£siømÖ6rlb©uâ¾Rw©W(Ö÷´
+-ïG4
+zæÆÆæ¿
+o^Tv(æ¾?~±ëõ5àQzÅ÷¿I8Rr
+ ýfÓ]ÃC<¾²
+AÍ7{Ì¹[gçå9Òj-×Í:c"M?$i¯îýípö£0»LW§V¼4hÒgÃªÈ7KjpÄUûýäÚëý;»~q­|8gLvR½níÐ?ðóAÿÃèØV9oô´hè;PÍÿþx¬åìêµ¡¬JkýÁÌÌ«5{÷n9>³¸-ßQ,ñ!»~jÒ&?P¶sð´GQÒÙûK>@m×iùkSQoÖÝ[ÿ`ù`æ
+-endstream
+-endobj
+-795 0 obj <<
+-/Type /FontDescriptor
+-/FontName /QDTWCG+MSBM10
+-/Flags 4
+-/FontBBox [-55 -420 2343 920]
+-/Ascent 464
+-/CapHeight 689
+-/Descent 0
+-/ItalicAngle 0
+-/StemV 40
+-/XHeight 463
+-/CharSet (/R)
+-/FontFile 794 0 R
+->> endobj
+-279 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /JDNQLR+CMBSY10
+-/FontDescriptor 753 0 R
+-/FirstChar 0
+-/LastChar 33
+-/Widths 739 0 R
+->> endobj
+-194 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /UPNDUM+CMBX10
+-/FontDescriptor 755 0 R
+-/FirstChar 11
+-/LastChar 123
+-/Widths 747 0 R
+->> endobj
+-190 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /YHSZZF+CMBX12
+-/FontDescriptor 757 0 R
+-/FirstChar 11
+-/LastChar 122
+-/Widths 751 0 R
+->> endobj
+-309 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /GHEUOG+CMEX10
+-/FontDescriptor 759 0 R
+-/FirstChar 0
+-/LastChar 113
+-/Widths 735 0 R
+->> endobj
+-270 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /JBQPQB+CMMI10
+-/FontDescriptor 761 0 R
+-/FirstChar 16
+-/LastChar 122
+-/Widths 742 0 R
+->> endobj
+-461 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /EWOGKR+CMMI6
+-/FontDescriptor 763 0 R
+-/FirstChar 107
+-/LastChar 107
+-/Widths 732 0 R
+->> endobj
+-371 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /QKLGGW+CMMI8
+-/FontDescriptor 765 0 R
+-/FirstChar 58
+-/LastChar 122
+-/Widths 733 0 R
+->> endobj
+-295 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /PGRSID+CMMIB10
+-/FontDescriptor 767 0 R
+-/FirstChar 60
+-/LastChar 62
+-/Widths 737 0 R
+->> endobj
+-193 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /LUAKBT+CMR10
+-/FontDescriptor 769 0 R
+-/FirstChar 11
+-/LastChar 126
+-/Widths 748 0 R
+->> endobj
+-192 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /VCDOVK+CMR12
+-/FontDescriptor 771 0 R
+-/FirstChar 11
+-/LastChar 117
+-/Widths 749 0 R
+->> endobj
+-195 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /YPSQTS+CMR6
+-/FontDescriptor 773 0 R
+-/FirstChar 49
+-/LastChar 51
+-/Widths 746 0 R
+->> endobj
+-191 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /OUENHS+CMR8
+-/FontDescriptor 775 0 R
+-/FirstChar 40
+-/LastChar 61
+-/Widths 750 0 R
+->> endobj
+-197 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /PSNPPF+CMR9
+-/FontDescriptor 777 0 R
+-/FirstChar 12
+-/LastChar 127
+-/Widths 745 0 R
+->> endobj
+-231 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /HDQIKI+CMSL10
+-/FontDescriptor 779 0 R
+-/FirstChar 11
+-/LastChar 122
+-/Widths 744 0 R
+->> endobj
+-272 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /GEZGXO+CMSS10
+-/FontDescriptor 781 0 R
+-/FirstChar 11
+-/LastChar 122
+-/Widths 740 0 R
+->> endobj
+-310 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /GCITMB+CMSS8
+-/FontDescriptor 783 0 R
+-/FirstChar 121
+-/LastChar 121
+-/Widths 734 0 R
+->> endobj
+-294 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /XGMSHV+CMSY10
+-/FontDescriptor 785 0 R
+-/FirstChar 0
+-/LastChar 114
+-/Widths 738 0 R
+->> endobj
+-308 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /EFCECH+CMSY8
+-/FontDescriptor 787 0 R
+-/FirstChar 0
+-/LastChar 48
+-/Widths 736 0 R
+->> endobj
+-271 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /CWMXAW+CMTI10
+-/FontDescriptor 789 0 R
+-/FirstChar 11
+-/LastChar 121
+-/Widths 741 0 R
+->> endobj
+-256 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /EVNRWQ+CMTT10
+-/FontDescriptor 791 0 R
+-/FirstChar 33
+-/LastChar 125
+-/Widths 743 0 R
+->> endobj
+-695 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /BXWTMS+CMTT12
+-/FontDescriptor 793 0 R
+-/FirstChar 46
+-/LastChar 120
+-/Widths 730 0 R
+->> endobj
+-610 0 obj <<
+-/Type /Font
+-/Subtype /Type1
+-/BaseFont /QDTWCG+MSBM10
+-/FontDescriptor 795 0 R
+-/FirstChar 82
+-/LastChar 82
+-/Widths 731 0 R
+->> endobj
+-200 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 796 0 R
+-/Kids [182 0 R 228 0 R 253 0 R 267 0 R 276 0 R 285 0 R]
+->> endobj
+-296 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 796 0 R
+-/Kids [291 0 R 299 0 R 305 0 R 315 0 R 322 0 R 326 0 R]
+->> endobj
+-347 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 796 0 R
+-/Kids [343 0 R 349 0 R 353 0 R 357 0 R 362 0 R 368 0 R]
+->> endobj
+-376 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 796 0 R
+-/Kids [373 0 R 378 0 R 383 0 R 394 0 R 405 0 R 413 0 R]
+->> endobj
+-425 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 796 0 R
+-/Kids [420 0 R 428 0 R 436 0 R 446 0 R 457 0 R 465 0 R]
+->> endobj
+-474 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 796 0 R
+-/Kids [471 0 R 477 0 R 483 0 R 487 0 R 496 0 R 504 0 R]
+->> endobj
+-512 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 797 0 R
+-/Kids [509 0 R 514 0 R 524 0 R 530 0 R 535 0 R 540 0 R]
+->> endobj
+-554 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 797 0 R
+-/Kids [551 0 R 556 0 R 565 0 R 580 0 R 586 0 R 592 0 R]
+->> endobj
+-602 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 797 0 R
+-/Kids [598 0 R 607 0 R 614 0 R 618 0 R 623 0 R 629 0 R]
+->> endobj
+-637 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 797 0 R
+-/Kids [634 0 R 640 0 R 644 0 R 651 0 R 673 0 R 680 0 R]
+->> endobj
+-690 0 obj <<
+-/Type /Pages
+-/Count 6
+-/Parent 797 0 R
+-/Kids [685 0 R 692 0 R 697 0 R 701 0 R 705 0 R 710 0 R]
+->> endobj
+-717 0 obj <<
+-/Type /Pages
+-/Count 3
+-/Parent 797 0 R
+-/Kids [714 0 R 720 0 R 725 0 R]
+->> endobj
+-796 0 obj <<
+-/Type /Pages
+-/Count 36
+-/Parent 798 0 R
+-/Kids [200 0 R 296 0 R 347 0 R 376 0 R 425 0 R 474 0 R]
+->> endobj
+-797 0 obj <<
+-/Type /Pages
+-/Count 33
+-/Parent 798 0 R
+-/Kids [512 0 R 554 0 R 602 0 R 637 0 R 690 0 R 717 0 R]
+->> endobj
+-798 0 obj <<
+-/Type /Pages
+-/Count 69
+-/Kids [796 0 R 797 0 R]
+->> endobj
+-799 0 obj <<
+-/Type /Outlines
+-/First 3 0 R
+-/Last 163 0 R
+-/Count 9
+->> endobj
+-179 0 obj <<
+-/Title 180 0 R
+-/A 177 0 R
+-/Parent 163 0 R
+-/Prev 175 0 R
+->> endobj
+-175 0 obj <<
+-/Title 176 0 R
+-/A 173 0 R
+-/Parent 163 0 R
+-/Prev 171 0 R
+-/Next 179 0 R
+->> endobj
+-171 0 obj <<
+-/Title 172 0 R
+-/A 169 0 R
+-/Parent 163 0 R
+-/Prev 167 0 R
+-/Next 175 0 R
+->> endobj
+-167 0 obj <<
+-/Title 168 0 R
+-/A 165 0 R
+-/Parent 163 0 R
+-/Next 171 0 R
+->> endobj
+-163 0 obj <<
+-/Title 164 0 R
+-/A 161 0 R
+-/Parent 799 0 R
+-/Prev 139 0 R
+-/First 167 0 R
+-/Last 179 0 R
+-/Count -4
+->> endobj
+-159 0 obj <<
+-/Title 160 0 R
+-/A 157 0 R
+-/Parent 139 0 R
+-/Prev 155 0 R
+->> endobj
+-155 0 obj <<
+-/Title 156 0 R
+-/A 153 0 R
+-/Parent 139 0 R
+-/Prev 151 0 R
+-/Next 159 0 R
+->> endobj
+-151 0 obj <<
+-/Title 152 0 R
+-/A 149 0 R
+-/Parent 139 0 R
+-/Prev 147 0 R
+-/Next 155 0 R
+->> endobj
+-147 0 obj <<
+-/Title 148 0 R
+-/A 145 0 R
+-/Parent 139 0 R
+-/Prev 143 0 R
+-/Next 151 0 R
+->> endobj
+-143 0 obj <<
+-/Title 144 0 R
+-/A 141 0 R
+-/Parent 139 0 R
+-/Next 147 0 R
+->> endobj
+-139 0 obj <<
+-/Title 140 0 R
+-/A 137 0 R
+-/Parent 799 0 R
+-/Prev 123 0 R
+-/Next 163 0 R
+-/First 143 0 R
+-/Last 159 0 R
+-/Count -5
+->> endobj
+-135 0 obj <<
+-/Title 136 0 R
+-/A 133 0 R
+-/Parent 123 0 R
+-/Prev 131 0 R
+->> endobj
+-131 0 obj <<
+-/Title 132 0 R
+-/A 129 0 R
+-/Parent 123 0 R
+-/Prev 127 0 R
+-/Next 135 0 R
+->> endobj
+-127 0 obj <<
+-/Title 128 0 R
+-/A 125 0 R
+-/Parent 123 0 R
+-/Next 131 0 R
+->> endobj
+-123 0 obj <<
+-/Title 124 0 R
+-/A 121 0 R
+-/Parent 799 0 R
+-/Prev 103 0 R
+-/Next 139 0 R
+-/First 127 0 R
+-/Last 135 0 R
+-/Count -3
+->> endobj
+-119 0 obj <<
+-/Title 120 0 R
+-/A 117 0 R
+-/Parent 103 0 R
+-/Prev 115 0 R
+->> endobj
+-115 0 obj <<
+-/Title 116 0 R
+-/A 113 0 R
+-/Parent 103 0 R
+-/Prev 111 0 R
+-/Next 119 0 R
+->> endobj
+-111 0 obj <<
+-/Title 112 0 R
+-/A 109 0 R
+-/Parent 103 0 R
+-/Prev 107 0 R
+-/Next 115 0 R
+->> endobj
+-107 0 obj <<
+-/Title 108 0 R
+-/A 105 0 R
+-/Parent 103 0 R
+-/Next 111 0 R
+->> endobj
+-103 0 obj <<
+-/Title 104 0 R
+-/A 101 0 R
+-/Parent 799 0 R
+-/Prev 87 0 R
+-/Next 123 0 R
+-/First 107 0 R
+-/Last 119 0 R
+-/Count -4
+->> endobj
+-99 0 obj <<
+-/Title 100 0 R
+-/A 97 0 R
+-/Parent 87 0 R
+-/Prev 95 0 R
+->> endobj
+-95 0 obj <<
+-/Title 96 0 R
+-/A 93 0 R
+-/Parent 87 0 R
+-/Prev 91 0 R
+-/Next 99 0 R
+->> endobj
+-91 0 obj <<
+-/Title 92 0 R
+-/A 89 0 R
+-/Parent 87 0 R
+-/Next 95 0 R
+->> endobj
+-87 0 obj <<
+-/Title 88 0 R
+-/A 85 0 R
+-/Parent 799 0 R
+-/Prev 83 0 R
+-/Next 103 0 R
+-/First 91 0 R
+-/Last 99 0 R
+-/Count -3
+->> endobj
+-83 0 obj <<
+-/Title 84 0 R
+-/A 81 0 R
+-/Parent 799 0 R
+-/Prev 59 0 R
+-/Next 87 0 R
+->> endobj
+-79 0 obj <<
+-/Title 80 0 R
+-/A 77 0 R
+-/Parent 59 0 R
+-/Prev 75 0 R
+->> endobj
+-75 0 obj <<
+-/Title 76 0 R
+-/A 73 0 R
+-/Parent 59 0 R
+-/Prev 71 0 R
+-/Next 79 0 R
+->> endobj
+-71 0 obj <<
+-/Title 72 0 R
+-/A 69 0 R
+-/Parent 59 0 R
+-/Prev 67 0 R
+-/Next 75 0 R
+->> endobj
+-67 0 obj <<
+-/Title 68 0 R
+-/A 65 0 R
+-/Parent 59 0 R
+-/Prev 63 0 R
+-/Next 71 0 R
+->> endobj
+-63 0 obj <<
+-/Title 64 0 R
+-/A 61 0 R
+-/Parent 59 0 R
+-/Next 67 0 R
+->> endobj
+-59 0 obj <<
+-/Title 60 0 R
+-/A 57 0 R
+-/Parent 799 0 R
+-/Prev 43 0 R
+-/Next 83 0 R
+-/First 63 0 R
+-/Last 79 0 R
+-/Count -5
+->> endobj
+-55 0 obj <<
+-/Title 56 0 R
+-/A 53 0 R
+-/Parent 43 0 R
+-/Prev 51 0 R
+->> endobj
+-51 0 obj <<
+-/Title 52 0 R
+-/A 49 0 R
+-/Parent 43 0 R
+-/Prev 47 0 R
+-/Next 55 0 R
+->> endobj
+-47 0 obj <<
+-/Title 48 0 R
+-/A 45 0 R
+-/Parent 43 0 R
+-/Next 51 0 R
+->> endobj
+-43 0 obj <<
+-/Title 44 0 R
+-/A 41 0 R
+-/Parent 799 0 R
+-/Prev 3 0 R
+-/Next 59 0 R
+-/First 47 0 R
+-/Last 55 0 R
+-/Count -3
+->> endobj
+-39 0 obj <<
+-/Title 40 0 R
+-/A 37 0 R
+-/Parent 3 0 R
+-/Prev 35 0 R
+->> endobj
+-35 0 obj <<
+-/Title 36 0 R
+-/A 33 0 R
+-/Parent 3 0 R
+-/Prev 31 0 R
+-/Next 39 0 R
+->> endobj
+-31 0 obj <<
+-/Title 32 0 R
+-/A 29 0 R
+-/Parent 3 0 R
+-/Prev 27 0 R
+-/Next 35 0 R
+->> endobj
+-27 0 obj <<
+-/Title 28 0 R
+-/A 25 0 R
+-/Parent 3 0 R
+-/Prev 23 0 R
+-/Next 31 0 R
+->> endobj
+-23 0 obj <<
+-/Title 24 0 R
+-/A 21 0 R
+-/Parent 3 0 R
+-/Prev 19 0 R
+-/Next 27 0 R
+->> endobj
+-19 0 obj <<
+-/Title 20 0 R
+-/A 17 0 R
+-/Parent 3 0 R
+-/Prev 15 0 R
+-/Next 23 0 R
+->> endobj
+-15 0 obj <<
+-/Title 16 0 R
+-/A 13 0 R
+-/Parent 3 0 R
+-/Prev 11 0 R
+-/Next 19 0 R
+->> endobj
+-11 0 obj <<
+-/Title 12 0 R
+-/A 9 0 R
+-/Parent 3 0 R
+-/Prev 7 0 R
+-/Next 15 0 R
+->> endobj
+-7 0 obj <<
+-/Title 8 0 R
+-/A 5 0 R
+-/Parent 3 0 R
+-/Next 11 0 R
+->> endobj
+-3 0 obj <<
+-/Title 4 0 R
+-/A 1 0 R
+-/Parent 799 0 R
+-/Next 43 0 R
+-/First 7 0 R
+-/Last 39 0 R
+-/Count -9
+->> endobj
+-800 0 obj <<
+-/Names [(Doc-Start) 189 0 R (Hfootnote.1) 196 0 R (Hfootnote.2) 198 0 R (Hfootnote.3) 199 0 R (Item.1) 329 0 R (Item.2) 330 0 R]
+-/Limits [(Doc-Start) (Item.2)]
+->> endobj
+-801 0 obj <<
+-/Names [(Item.3) 331 0 R (Item.4) 332 0 R (Item.5) 346 0 R (Item.6) 688 0 R (Item.7) 689 0 R (cite.BeKh96) 544 0 R]
+-/Limits [(Item.3) (cite.BeKh96)]
+->> endobj
+-802 0 obj <<
+-/Names [(cite.Chri91a) 500 0 R (cite.GeMaPo05) 409 0 R (cite.GePoTaWa06) 449 0 R (cite.GePoWa08) 450 0 R (cite.GeTaMaPo07) 410 0 R (cite.GrWa00) 729 0 R]
+-/Limits [(cite.Chri91a) (cite.GrWa00)]
+->> endobj
+-803 0 obj <<
+-/Names [(cite.GrWa08) 273 0 R (cite.Griewank97) 462 0 R (cite.HW) 718 0 R (cite.Knuth73) 468 0 R (cite.Wa05a) 440 0 R (equation.3.1) 397 0 R]
+-/Limits [(cite.GrWa08) (equation.3.1)]
+->> endobj
+-804 0 obj <<
+-/Names [(equation.3.2) 460 0 R (equation.3.3) 480 0 R (equation.4.4) 490 0 R (equation.4.5) 491 0 R (equation.4.6) 492 0 R (equation.4.7) 493 0 R]
+-/Limits [(equation.3.2) (equation.4.7)]
+->> endobj
+-805 0 obj <<
+-/Names [(equation.4.8) 499 0 R (equation.5.9) 543 0 R (equation.6.10) 589 0 R (equation.6.11) 590 0 R (figure.1) 288 0 R (figure.2) 297 0 R]
+-/Limits [(equation.4.8) (figure.2)]
+->> endobj
+-806 0 obj <<
+-/Names [(figure.3) 319 0 R (figure.4) 568 0 R (figure.5) 601 0 R (figure.6) 612 0 R (figure.7) 627 0 R (figure.8) 638 0 R]
+-/Limits [(figure.3) (figure.8)]
+->> endobj
+-807 0 obj <<
+-/Names [(page.1) 188 0 R (page.10) 317 0 R (page.11) 324 0 R (page.12) 328 0 R (page.13) 345 0 R (page.14) 351 0 R]
+-/Limits [(page.1) (page.14)]
+->> endobj
+-808 0 obj <<
+-/Names [(page.15) 355 0 R (page.16) 359 0 R (page.17) 364 0 R (page.18) 370 0 R (page.19) 375 0 R (page.2) 230 0 R]
+-/Limits [(page.15) (page.2)]
+->> endobj
+-809 0 obj <<
+-/Names [(page.20) 380 0 R (page.21) 385 0 R (page.22) 396 0 R (page.23) 407 0 R (page.24) 415 0 R (page.25) 422 0 R]
+-/Limits [(page.20) (page.25)]
+->> endobj
+-810 0 obj <<
+-/Names [(page.26) 430 0 R (page.27) 438 0 R (page.28) 448 0 R (page.29) 459 0 R (page.3) 255 0 R (page.30) 467 0 R]
+-/Limits [(page.26) (page.30)]
+->> endobj
+-811 0 obj <<
+-/Names [(page.31) 473 0 R (page.32) 479 0 R (page.33) 485 0 R (page.34) 489 0 R (page.35) 498 0 R (page.36) 506 0 R]
+-/Limits [(page.31) (page.36)]
+->> endobj
+-812 0 obj <<
+-/Names [(page.37) 511 0 R (page.38) 516 0 R (page.39) 526 0 R (page.4) 269 0 R (page.40) 532 0 R (page.41) 537 0 R]
+-/Limits [(page.37) (page.41)]
+->> endobj
+-813 0 obj <<
+-/Names [(page.42) 542 0 R (page.43) 553 0 R (page.44) 558 0 R (page.45) 567 0 R (page.46) 582 0 R (page.47) 588 0 R]
+-/Limits [(page.42) (page.47)]
+->> endobj
+-814 0 obj <<
+-/Names [(page.48) 594 0 R (page.49) 600 0 R (page.5) 278 0 R (page.50) 609 0 R (page.51) 616 0 R (page.52) 620 0 R]
+-/Limits [(page.48) (page.52)]
+->> endobj
+-815 0 obj <<
+-/Names [(page.53) 625 0 R (page.54) 631 0 R (page.55) 636 0 R (page.56) 642 0 R (page.57) 646 0 R (page.58) 653 0 R]
+-/Limits [(page.53) (page.58)]
+->> endobj
+-816 0 obj <<
+-/Names [(page.59) 675 0 R (page.6) 287 0 R (page.60) 682 0 R (page.61) 687 0 R (page.62) 694 0 R (page.63) 699 0 R]
+-/Limits [(page.59) (page.63)]
+->> endobj
+-817 0 obj <<
+-/Names [(page.64) 703 0 R (page.65) 707 0 R (page.66) 712 0 R (page.67) 716 0 R (page.68) 722 0 R (page.69) 727 0 R]
+-/Limits [(page.64) (page.69)]
+->> endobj
+-818 0 obj <<
+-/Names [(page.7) 293 0 R (page.8) 301 0 R (page.9) 307 0 R (section*.1) 232 0 R (section*.2) 408 0 R (section*.3) 424 0 R]
+-/Limits [(page.7) (section*.3)]
+->> endobj
+-819 0 obj <<
+-/Names [(section*.4) 439 0 R (section*.5) 611 0 R (section*.6) 626 0 R (section*.7) 723 0 R (section*.8) 728 0 R (section.1) 2 0 R]
+-/Limits [(section*.4) (section.1)]
+->> endobj
+-820 0 obj <<
+-/Names [(section.2) 42 0 R (section.3) 58 0 R (section.4) 82 0 R (section.5) 86 0 R (section.6) 102 0 R (section.7) 122 0 R]
+-/Limits [(section.2) (section.7)]
+->> endobj
+-821 0 obj <<
+-/Names [(section.8) 138 0 R (section.9) 162 0 R (subsection.1.1) 6 0 R (subsection.1.2) 10 0 R (subsection.1.3) 14 0 R (subsection.1.4) 18 0 R]
+-/Limits [(section.8) (subsection.1.4)]
+->> endobj
+-822 0 obj <<
+-/Names [(subsection.1.5) 22 0 R (subsection.1.6) 26 0 R (subsection.1.7) 30 0 R (subsection.1.8) 34 0 R (subsection.1.9) 38 0 R (subsection.2.1) 46 0 R]
+-/Limits [(subsection.1.5) (subsection.2.1)]
+->> endobj
+-823 0 obj <<
+-/Names [(subsection.2.2) 50 0 R (subsection.2.3) 54 0 R (subsection.3.1) 62 0 R (subsection.3.2) 66 0 R (subsection.3.3) 70 0 R (subsection.3.4) 74 0 R]
+-/Limits [(subsection.2.2) (subsection.3.4)]
+->> endobj
+-824 0 obj <<
+-/Names [(subsection.3.5) 78 0 R (subsection.5.1) 90 0 R (subsection.5.2) 94 0 R (subsection.5.3) 98 0 R (subsection.6.1) 106 0 R (subsection.6.2) 110 0 R]
+-/Limits [(subsection.3.5) (subsection.6.2)]
+->> endobj
+-825 0 obj <<
+-/Names [(subsection.6.3) 114 0 R (subsection.6.4) 118 0 R (subsection.7.1) 126 0 R (subsection.7.2) 130 0 R (subsection.7.3) 134 0 R (subsection.8.1) 142 0 R]
+-/Limits [(subsection.6.3) (subsection.8.1)]
+->> endobj
+-826 0 obj <<
+-/Names [(subsection.8.2) 146 0 R (subsection.8.3) 150 0 R (subsection.8.4) 154 0 R (subsection.8.5) 158 0 R (subsection.9.1) 166 0 R (subsection.9.2) 170 0 R]
+-/Limits [(subsection.8.2) (subsection.9.2)]
+->> endobj
+-827 0 obj <<
+-/Names [(subsection.9.3) 174 0 R (subsection.9.4) 178 0 R (table.1) 318 0 R (table.2) 416 0 R (table.3) 423 0 R (table.4) 431 0 R]
+-/Limits [(subsection.9.3) (table.4)]
+->> endobj
+-828 0 obj <<
+-/Names [(table.5) 676 0 R (table.6) 677 0 R (table.7) 678 0 R]
+-/Limits [(table.5) (table.7)]
+->> endobj
+-829 0 obj <<
+-/Kids [800 0 R 801 0 R 802 0 R 803 0 R 804 0 R 805 0 R]
+-/Limits [(Doc-Start) (figure.2)]
+->> endobj
+-830 0 obj <<
+-/Kids [806 0 R 807 0 R 808 0 R 809 0 R 810 0 R 811 0 R]
+-/Limits [(figure.3) (page.36)]
+->> endobj
+-831 0 obj <<
+-/Kids [812 0 R 813 0 R 814 0 R 815 0 R 816 0 R 817 0 R]
+-/Limits [(page.37) (page.69)]
+->> endobj
+-832 0 obj <<
+-/Kids [818 0 R 819 0 R 820 0 R 821 0 R 822 0 R 823 0 R]
+-/Limits [(page.7) (subsection.3.4)]
+->> endobj
+-833 0 obj <<
+-/Kids [824 0 R 825 0 R 826 0 R 827 0 R 828 0 R]
+-/Limits [(subsection.3.5) (table.7)]
+->> endobj
+-834 0 obj <<
+-/Kids [829 0 R 830 0 R 831 0 R 832 0 R 833 0 R]
+-/Limits [(Doc-Start) (table.7)]
+->> endobj
+-835 0 obj <<
+-/Dests 834 0 R
+->> endobj
+-836 0 obj <<
+-/Type /Catalog
+-/Pages 798 0 R
+-/Outlines 799 0 R
+-/Names 835 0 R
+-/PageMode/UseOutlines
+-/OpenAction 181 0 R
+->> endobj
+-837 0 obj <<
+-/Author()/Title()/Subject()/Creator(LaTeX with hyperref package)/Producer(pdfTeX-1.40.10)/Keywords()
+-/CreationDate (D:20101110102700+01'00')
+-/ModDate (D:20101110102700+01'00')
+-/Trapped /False
+-/PTEX.Fullbanner (This is pdfTeX using libpoppler, Version 3.1415926-1.40.10-2.2 (TeX Live 2009/openSUSE) kpathsea version 5.0.0)
+->> endobj
+-xref
+-0 838
+-0000000000 65535 f 
+-0000000015 00000 n 
+-0000023132 00000 n 
+-0000570150 00000 n 
+-0000000060 00000 n 
+-0000000134 00000 n 
+-0000023191 00000 n 
+-0000570080 00000 n 
+-0000000184 00000 n 
+-0000000214 00000 n 
+-0000023250 00000 n 
+-0000569996 00000 n 
+-0000000264 00000 n 
+-0000000309 00000 n 
+-0000027366 00000 n 
+-0000569910 00000 n 
+-0000000360 00000 n 
+-0000000402 00000 n 
+-0000030883 00000 n 
+-0000569824 00000 n 
+-0000000453 00000 n 
+-0000000517 00000 n 
+-0000030943 00000 n 
+-0000569738 00000 n 
+-0000000568 00000 n 
+-0000000620 00000 n 
+-0000034243 00000 n 
+-0000569652 00000 n 
+-0000000671 00000 n 
+-0000000724 00000 n 
+-0000044959 00000 n 
+-0000569566 00000 n 
+-0000000775 00000 n 
+-0000000837 00000 n 
+-0000048259 00000 n 
+-0000569480 00000 n 
+-0000000888 00000 n 
+-0000000930 00000 n 
+-0000063092 00000 n 
+-0000569407 00000 n 
+-0000000981 00000 n 
+-0000001035 00000 n 
+-0000067869 00000 n 
+-0000569283 00000 n 
+-0000001081 00000 n 
+-0000001146 00000 n 
+-0000071855 00000 n 
+-0000569209 00000 n 
+-0000001197 00000 n 
+-0000001271 00000 n 
+-0000075383 00000 n 
+-0000569122 00000 n 
+-0000001322 00000 n 
+-0000001359 00000 n 
+-0000079020 00000 n 
+-0000569048 00000 n 
+-0000001410 00000 n 
+-0000001477 00000 n 
+-0000086559 00000 n 
+-0000568923 00000 n 
+-0000001523 00000 n 
+-0000001561 00000 n 
+-0000086619 00000 n 
+-0000568849 00000 n 
+-0000001612 00000 n 
+-0000001679 00000 n 
+-0000094035 00000 n 
+-0000568762 00000 n 
+-0000001730 00000 n 
+-0000001792 00000 n 
+-0000102129 00000 n 
+-0000568675 00000 n 
+-0000001843 00000 n 
+-0000001910 00000 n 
+-0000125971 00000 n 
+-0000568588 00000 n 
+-0000001961 00000 n 
+-0000002005 00000 n 
+-0000133947 00000 n 
+-0000568514 00000 n 
+-0000002056 00000 n 
+-0000002120 00000 n 
+-0000142120 00000 n 
+-0000568426 00000 n 
+-0000002166 00000 n 
+-0000002231 00000 n 
+-0000163047 00000 n 
+-0000568300 00000 n 
+-0000002277 00000 n 
+-0000002332 00000 n 
+-0000163107 00000 n 
+-0000568226 00000 n 
+-0000002383 00000 n 
+-0000002417 00000 n 
+-0000166639 00000 n 
+-0000568139 00000 n 
+-0000002468 00000 n 
+-0000002502 00000 n 
+-0000174289 00000 n 
+-0000568064 00000 n 
+-0000002553 00000 n 
+-0000002592 00000 n 
+-0000180883 00000 n 
+-0000567933 00000 n 
+-0000002639 00000 n 
+-0000002704 00000 n 
+-0000180944 00000 n 
+-0000567854 00000 n 
+-0000002756 00000 n 
+-0000002809 00000 n 
+-0000191580 00000 n 
+-0000567761 00000 n 
+-0000002861 00000 n 
+-0000002946 00000 n 
+-0000198248 00000 n 
+-0000567668 00000 n 
+-0000002998 00000 n 
+-0000003079 00000 n 
+-0000206495 00000 n 
+-0000567589 00000 n 
+-0000003131 00000 n 
+-0000003214 00000 n 
+-0000209994 00000 n 
+-0000567457 00000 n 
+-0000003261 00000 n 
+-0000003323 00000 n 
+-0000210055 00000 n 
+-0000567378 00000 n 
+-0000003375 00000 n 
+-0000003420 00000 n 
+-0000222507 00000 n 
+-0000567285 00000 n 
+-0000003472 00000 n 
+-0000003529 00000 n 
+-0000222568 00000 n 
+-0000567206 00000 n 
+-0000003581 00000 n 
+-0000003657 00000 n 
+-0000227257 00000 n 
+-0000567074 00000 n 
+-0000003704 00000 n 
+-0000003751 00000 n 
+-0000227318 00000 n 
+-0000566995 00000 n 
+-0000003803 00000 n 
+-0000003852 00000 n 
+-0000231231 00000 n 
+-0000566902 00000 n 
+-0000003904 00000 n 
+-0000003966 00000 n 
+-0000235704 00000 n 
+-0000566809 00000 n 
+-0000004018 00000 n 
+-0000004075 00000 n 
+-0000240415 00000 n 
+-0000566716 00000 n 
+-0000004127 00000 n 
+-0000004183 00000 n 
+-0000240476 00000 n 
+-0000566637 00000 n 
+-0000004235 00000 n 
+-0000004294 00000 n 
+-0000245597 00000 n 
+-0000566519 00000 n 
+-0000004341 00000 n 
+-0000004374 00000 n 
+-0000245658 00000 n 
+-0000566440 00000 n 
+-0000004426 00000 n 
+-0000004489 00000 n 
+-0000247555 00000 n 
+-0000566347 00000 n 
+-0000004541 00000 n 
+-0000004590 00000 n 
+-0000251510 00000 n 
+-0000566254 00000 n 
+-0000004642 00000 n 
+-0000004697 00000 n 
+-0000255835 00000 n 
+-0000566175 00000 n 
+-0000004749 00000 n 
+-0000004822 00000 n 
+-0000007096 00000 n 
+-0000007244 00000 n 
+-0000007398 00000 n 
+-0000007551 00000 n 
+-0000008011 00000 n 
+-0000004874 00000 n 
+-0000007704 00000 n 
+-0000007765 00000 n 
+-0000561551 00000 n 
+-0000562840 00000 n 
+-0000562556 00000 n 
+-0000562413 00000 n 
+-0000561407 00000 n 
+-0000562699 00000 n 
+-0000007826 00000 n 
+-0000562981 00000 n 
+-0000007888 00000 n 
+-0000007950 00000 n 
+-0000564414 00000 n 
+-0000009801 00000 n 
+-0000009952 00000 n 
+-0000010109 00000 n 
+-0000010266 00000 n 
+-0000010423 00000 n 
+-0000010578 00000 n 
+-0000010735 00000 n 
+-0000010892 00000 n 
+-0000011049 00000 n 
+-0000011206 00000 n 
+-0000011363 00000 n 
+-0000011514 00000 n 
+-0000011671 00000 n 
+-0000011828 00000 n 
+-0000011984 00000 n 
+-0000012134 00000 n 
+-0000012291 00000 n 
+-0000012447 00000 n 
+-0000012603 00000 n 
+-0000012760 00000 n 
+-0000012916 00000 n 
+-0000013067 00000 n 
+-0000013218 00000 n 
+-0000013374 00000 n 
+-0000013529 00000 n 
+-0000015314 00000 n 
+-0000013806 00000 n 
+-0000009477 00000 n 
+-0000008161 00000 n 
+-0000013684 00000 n 
+-0000563123 00000 n 
+-0000013745 00000 n 
+-0000015465 00000 n 
+-0000015621 00000 n 
+-0000015777 00000 n 
+-0000015934 00000 n 
+-0000016091 00000 n 
+-0000016242 00000 n 
+-0000016399 00000 n 
+-0000016556 00000 n 
+-0000016713 00000 n 
+-0000016864 00000 n 
+-0000017021 00000 n 
+-0000017178 00000 n 
+-0000017335 00000 n 
+-0000017492 00000 n 
+-0000017649 00000 n 
+-0000017800 00000 n 
+-0000017957 00000 n 
+-0000018114 00000 n 
+-0000018270 00000 n 
+-0000018488 00000 n 
+-0000015030 00000 n 
+-0000013917 00000 n 
+-0000018427 00000 n 
+-0000563983 00000 n 
+-0000021704 00000 n 
+-0000021858 00000 n 
+-0000022009 00000 n 
+-0000022160 00000 n 
+-0000022311 00000 n 
+-0000022463 00000 n 
+-0000022615 00000 n 
+-0000022767 00000 n 
+-0000022919 00000 n 
+-0000023310 00000 n 
+-0000021508 00000 n 
+-0000018599 00000 n 
+-0000023071 00000 n 
+-0000561838 00000 n 
+-0000563839 00000 n 
+-0000563267 00000 n 
+-0000260797 00000 n 
+-0000027156 00000 n 
+-0000027426 00000 n 
+-0000027024 00000 n 
+-0000023473 00000 n 
+-0000027305 00000 n 
+-0000561264 00000 n 
+-0000030518 00000 n 
+-0000030667 00000 n 
+-0000033820 00000 n 
+-0000033971 00000 n 
+-0000031003 00000 n 
+-0000030378 00000 n 
+-0000027589 00000 n 
+-0000030822 00000 n 
+-0000034182 00000 n 
+-0000036780 00000 n 
+-0000034303 00000 n 
+-0000033680 00000 n 
+-0000031166 00000 n 
+-0000034121 00000 n 
+-0000563555 00000 n 
+-0000562269 00000 n 
+-0000564531 00000 n 
+-0000036992 00000 n 
+-0000037054 00000 n 
+-0000036648 00000 n 
+-0000034440 00000 n 
+-0000036931 00000 n 
+-0000041135 00000 n 
+-0000044441 00000 n 
+-0000041353 00000 n 
+-0000041003 00000 n 
+-0000037204 00000 n 
+-0000041292 00000 n 
+-0000563698 00000 n 
+-0000561695 00000 n 
+-0000563411 00000 n 
+-0000044598 00000 n 
+-0000050795 00000 n 
+-0000044747 00000 n 
+-0000045019 00000 n 
+-0000044293 00000 n 
+-0000041542 00000 n 
+-0000044898 00000 n 
+-0000048197 00000 n 
+-0000063030 00000 n 
+-0000062813 00000 n 
+-0000048319 00000 n 
+-0000048024 00000 n 
+-0000045143 00000 n 
+-0000048136 00000 n 
+-0000063396 00000 n 
+-0000050663 00000 n 
+-0000048443 00000 n 
+-0000062969 00000 n 
+-0000063152 00000 n 
+-0000063213 00000 n 
+-0000063274 00000 n 
+-0000063335 00000 n 
+-0000060090 00000 n 
+-0000060340 00000 n 
+-0000060387 00000 n 
+-0000060756 00000 n 
+-0000061045 00000 n 
+-0000067133 00000 n 
+-0000067287 00000 n 
+-0000067443 00000 n 
+-0000067595 00000 n 
+-0000067929 00000 n 
+-0000066977 00000 n 
+-0000063587 00000 n 
+-0000067747 00000 n 
+-0000067808 00000 n 
+-0000564648 00000 n 
+-0000071913 00000 n 
+-0000071682 00000 n 
+-0000068040 00000 n 
+-0000071794 00000 n 
+-0000075443 00000 n 
+-0000075210 00000 n 
+-0000072102 00000 n 
+-0000075322 00000 n 
+-0000079080 00000 n 
+-0000078847 00000 n 
+-0000075619 00000 n 
+-0000078959 00000 n 
+-0000086033 00000 n 
+-0000082932 00000 n 
+-0000082759 00000 n 
+-0000079191 00000 n 
+-0000082871 00000 n 
+-0000086185 00000 n 
+-0000086342 00000 n 
+-0000086679 00000 n 
+-0000085885 00000 n 
+-0000083069 00000 n 
+-0000086498 00000 n 
+-0000562126 00000 n 
+-0000088800 00000 n 
+-0000088627 00000 n 
+-0000086842 00000 n 
+-0000088739 00000 n 
+-0000564765 00000 n 
+-0000090720 00000 n 
+-0000090547 00000 n 
+-0000088950 00000 n 
+-0000090659 00000 n 
+-0000093817 00000 n 
+-0000094095 00000 n 
+-0000093685 00000 n 
+-0000090883 00000 n 
+-0000093974 00000 n 
+-0000097435 00000 n 
+-0000097587 00000 n 
+-0000097738 00000 n 
+-0000097893 00000 n 
+-0000098048 00000 n 
+-0000098200 00000 n 
+-0000100978 00000 n 
+-0000098475 00000 n 
+-0000097263 00000 n 
+-0000094271 00000 n 
+-0000098352 00000 n 
+-0000098413 00000 n 
+-0000101135 00000 n 
+-0000101291 00000 n 
+-0000101447 00000 n 
+-0000101605 00000 n 
+-0000101761 00000 n 
+-0000101918 00000 n 
+-0000102250 00000 n 
+-0000100798 00000 n 
+-0000098638 00000 n 
+-0000102068 00000 n 
+-0000102189 00000 n 
+-0000260553 00000 n 
+-0000260736 00000 n 
+-0000106305 00000 n 
+-0000106516 00000 n 
+-0000106173 00000 n 
+-0000102413 00000 n 
+-0000106455 00000 n 
+-0000109446 00000 n 
+-0000109079 00000 n 
+-0000109228 00000 n 
+-0000109631 00000 n 
+-0000108939 00000 n 
+-0000106627 00000 n 
+-0000109385 00000 n 
+-0000109508 00000 n 
+-0000109570 00000 n 
+-0000564882 00000 n 
+-0000113349 00000 n 
+-0000113620 00000 n 
+-0000113217 00000 n 
+-0000109755 00000 n 
+-0000113498 00000 n 
+-0000113559 00000 n 
+-0000116857 00000 n 
+-0000117014 00000 n 
+-0000117167 00000 n 
+-0000117446 00000 n 
+-0000116709 00000 n 
+-0000113770 00000 n 
+-0000117324 00000 n 
+-0000117385 00000 n 
+-0000261102 00000 n 
+-0000120916 00000 n 
+-0000121072 00000 n 
+-0000121227 00000 n 
+-0000125289 00000 n 
+-0000121442 00000 n 
+-0000120768 00000 n 
+-0000117609 00000 n 
+-0000121381 00000 n 
+-0000260614 00000 n 
+-0000260675 00000 n 
+-0000125442 00000 n 
+-0000125597 00000 n 
+-0000125752 00000 n 
+-0000130090 00000 n 
+-0000130243 00000 n 
+-0000126093 00000 n 
+-0000125133 00000 n 
+-0000121566 00000 n 
+-0000125910 00000 n 
+-0000126031 00000 n 
+-0000561982 00000 n 
+-0000260858 00000 n 
+-0000133575 00000 n 
+-0000130459 00000 n 
+-0000129950 00000 n 
+-0000126308 00000 n 
+-0000130398 00000 n 
+-0000261041 00000 n 
+-0000133730 00000 n 
+-0000134007 00000 n 
+-0000133435 00000 n 
+-0000130635 00000 n 
+-0000133886 00000 n 
+-0000564999 00000 n 
+-0000138025 00000 n 
+-0000138303 00000 n 
+-0000137893 00000 n 
+-0000134222 00000 n 
+-0000138181 00000 n 
+-0000138242 00000 n 
+-0000141902 00000 n 
+-0000142180 00000 n 
+-0000141770 00000 n 
+-0000138492 00000 n 
+-0000142059 00000 n 
+-0000146072 00000 n 
+-0000145653 00000 n 
+-0000142369 00000 n 
+-0000145765 00000 n 
+-0000145826 00000 n 
+-0000145888 00000 n 
+-0000145949 00000 n 
+-0000146011 00000 n 
+-0000149543 00000 n 
+-0000149821 00000 n 
+-0000149411 00000 n 
+-0000146235 00000 n 
+-0000149698 00000 n 
+-0000149759 00000 n 
+-0000260492 00000 n 
+-0000152120 00000 n 
+-0000155533 00000 n 
+-0000152334 00000 n 
+-0000151988 00000 n 
+-0000149984 00000 n 
+-0000152273 00000 n 
+-0000155688 00000 n 
+-0000155901 00000 n 
+-0000155393 00000 n 
+-0000152536 00000 n 
+-0000155840 00000 n 
+-0000565116 00000 n 
+-0000158908 00000 n 
+-0000158735 00000 n 
+-0000156090 00000 n 
+-0000158847 00000 n 
+-0000162067 00000 n 
+-0000162218 00000 n 
+-0000162375 00000 n 
+-0000162527 00000 n 
+-0000162681 00000 n 
+-0000162836 00000 n 
+-0000163166 00000 n 
+-0000161895 00000 n 
+-0000159071 00000 n 
+-0000162986 00000 n 
+-0000166276 00000 n 
+-0000166428 00000 n 
+-0000166699 00000 n 
+-0000166136 00000 n 
+-0000163355 00000 n 
+-0000166578 00000 n 
+-0000169541 00000 n 
+-0000169759 00000 n 
+-0000169409 00000 n 
+-0000166875 00000 n 
+-0000169698 00000 n 
+-0000174075 00000 n 
+-0000174411 00000 n 
+-0000173943 00000 n 
+-0000169896 00000 n 
+-0000174228 00000 n 
+-0000174349 00000 n 
+-0000260431 00000 n 
+-0000177302 00000 n 
+-0000177457 00000 n 
+-0000177614 00000 n 
+-0000177769 00000 n 
+-0000177919 00000 n 
+-0000178134 00000 n 
+-0000177138 00000 n 
+-0000174600 00000 n 
+-0000178073 00000 n 
+-0000565233 00000 n 
+-0000181004 00000 n 
+-0000180710 00000 n 
+-0000178297 00000 n 
+-0000180822 00000 n 
+-0000191068 00000 n 
+-0000183977 00000 n 
+-0000187843 00000 n 
+-0000191218 00000 n 
+-0000191369 00000 n 
+-0000191703 00000 n 
+-0000183829 00000 n 
+-0000181154 00000 n 
+-0000191519 00000 n 
+-0000191641 00000 n 
+-0000184925 00000 n 
+-0000185183 00000 n 
+-0000185230 00000 n 
+-0000185603 00000 n 
+-0000185879 00000 n 
+-0000188669 00000 n 
+-0000188925 00000 n 
+-0000188972 00000 n 
+-0000189333 00000 n 
+-0000189598 00000 n 
+-0000194788 00000 n 
+-0000194615 00000 n 
+-0000191933 00000 n 
+-0000194727 00000 n 
+-0000197875 00000 n 
+-0000198031 00000 n 
+-0000198429 00000 n 
+-0000197735 00000 n 
+-0000194925 00000 n 
+-0000198187 00000 n 
+-0000198309 00000 n 
+-0000198369 00000 n 
+-0000202060 00000 n 
+-0000201887 00000 n 
+-0000198618 00000 n 
+-0000201999 00000 n 
+-0000206283 00000 n 
+-0000204725 00000 n 
+-0000206618 00000 n 
+-0000204593 00000 n 
+-0000202223 00000 n 
+-0000206434 00000 n 
+-0000206556 00000 n 
+-0000565350 00000 n 
+-0000205975 00000 n 
+-0000206236 00000 n 
+-0000209784 00000 n 
+-0000210177 00000 n 
+-0000209652 00000 n 
+-0000206783 00000 n 
+-0000209933 00000 n 
+-0000564271 00000 n 
+-0000210116 00000 n 
+-0000212754 00000 n 
+-0000212816 00000 n 
+-0000212581 00000 n 
+-0000210379 00000 n 
+-0000212693 00000 n 
+-0000215014 00000 n 
+-0000214841 00000 n 
+-0000212966 00000 n 
+-0000214953 00000 n 
+-0000217355 00000 n 
+-0000217626 00000 n 
+-0000217223 00000 n 
+-0000215151 00000 n 
+-0000217504 00000 n 
+-0000217565 00000 n 
+-0000219651 00000 n 
+-0000219713 00000 n 
+-0000219478 00000 n 
+-0000217776 00000 n 
+-0000219590 00000 n 
+-0000222295 00000 n 
+-0000222629 00000 n 
+-0000222163 00000 n 
+-0000219863 00000 n 
+-0000222446 00000 n 
+-0000565467 00000 n 
+-0000224457 00000 n 
+-0000224518 00000 n 
+-0000224284 00000 n 
+-0000222766 00000 n 
+-0000224396 00000 n 
+-0000227379 00000 n 
+-0000227084 00000 n 
+-0000224668 00000 n 
+-0000227196 00000 n 
+-0000230549 00000 n 
+-0000230861 00000 n 
+-0000231018 00000 n 
+-0000231292 00000 n 
+-0000230393 00000 n 
+-0000227542 00000 n 
+-0000231170 00000 n 
+-0000230705 00000 n 
+-0000234415 00000 n 
+-0000234565 00000 n 
+-0000234722 00000 n 
+-0000234879 00000 n 
+-0000235028 00000 n 
+-0000235178 00000 n 
+-0000235329 00000 n 
+-0000235486 00000 n 
+-0000238885 00000 n 
+-0000239037 00000 n 
+-0000239193 00000 n 
+-0000239350 00000 n 
+-0000239507 00000 n 
+-0000239664 00000 n 
+-0000239821 00000 n 
+-0000239978 00000 n 
+-0000240135 00000 n 
+-0000235889 00000 n 
+-0000234227 00000 n 
+-0000231416 00000 n 
+-0000235643 00000 n 
+-0000235765 00000 n 
+-0000235827 00000 n 
+-0000240353 00000 n 
+-0000240537 00000 n 
+-0000238689 00000 n 
+-0000236052 00000 n 
+-0000240292 00000 n 
+-0000243457 00000 n 
+-0000243796 00000 n 
+-0000243325 00000 n 
+-0000240752 00000 n 
+-0000243614 00000 n 
+-0000243675 00000 n 
+-0000243735 00000 n 
+-0000565584 00000 n 
+-0000245719 00000 n 
+-0000245424 00000 n 
+-0000243920 00000 n 
+-0000245536 00000 n 
+-0000564127 00000 n 
+-0000247616 00000 n 
+-0000247382 00000 n 
+-0000245921 00000 n 
+-0000247494 00000 n 
+-0000249441 00000 n 
+-0000249268 00000 n 
+-0000247779 00000 n 
+-0000249380 00000 n 
+-0000251571 00000 n 
+-0000251337 00000 n 
+-0000249552 00000 n 
+-0000251449 00000 n 
+-0000255624 00000 n 
+-0000253508 00000 n 
+-0000253335 00000 n 
+-0000251708 00000 n 
+-0000253447 00000 n 
+-0000255896 00000 n 
+-0000255492 00000 n 
+-0000253619 00000 n 
+-0000255774 00000 n 
+-0000565701 00000 n 
+-0000260980 00000 n 
+-0000257736 00000 n 
+-0000257502 00000 n 
+-0000256085 00000 n 
+-0000257614 00000 n 
+-0000257675 00000 n 
+-0000261163 00000 n 
+-0000260198 00000 n 
+-0000257873 00000 n 
+-0000260310 00000 n 
+-0000260371 00000 n 
+-0000260919 00000 n 
+-0000261274 00000 n 
+-0000261743 00000 n 
+-0000261768 00000 n 
+-0000261793 00000 n 
+-0000262200 00000 n 
+-0000262225 00000 n 
+-0000262926 00000 n 
+-0000263252 00000 n 
+-0000263287 00000 n 
+-0000263945 00000 n 
+-0000264155 00000 n 
+-0000264796 00000 n 
+-0000265459 00000 n 
+-0000266068 00000 n 
+-0000266459 00000 n 
+-0000267084 00000 n 
+-0000267768 00000 n 
+-0000267805 00000 n 
+-0000268448 00000 n 
+-0000269088 00000 n 
+-0000269670 00000 n 
+-0000269821 00000 n 
+-0000270468 00000 n 
+-0000279363 00000 n 
+-0000279622 00000 n 
+-0000299793 00000 n 
+-0000300211 00000 n 
+-0000319724 00000 n 
+-0000320166 00000 n 
+-0000329674 00000 n 
+-0000330120 00000 n 
+-0000348581 00000 n 
+-0000348949 00000 n 
+-0000356115 00000 n 
+-0000356335 00000 n 
+-0000368089 00000 n 
+-0000368366 00000 n 
+-0000375421 00000 n 
+-0000375656 00000 n 
+-0000400921 00000 n 
+-0000401501 00000 n 
+-0000412874 00000 n 
+-0000413146 00000 n 
+-0000420508 00000 n 
+-0000420738 00000 n 
+-0000429141 00000 n 
+-0000429418 00000 n 
+-0000448023 00000 n 
+-0000448401 00000 n 
+-0000470061 00000 n 
+-0000470473 00000 n 
+-0000486149 00000 n 
+-0000486660 00000 n 
+-0000493686 00000 n 
+-0000493905 00000 n 
+-0000503249 00000 n 
+-0000503628 00000 n 
+-0000511489 00000 n 
+-0000511752 00000 n 
+-0000531652 00000 n 
+-0000532018 00000 n 
+-0000553230 00000 n 
+-0000553803 00000 n 
+-0000558484 00000 n 
+-0000558737 00000 n 
+-0000561047 00000 n 
+-0000565794 00000 n 
+-0000565912 00000 n 
+-0000566030 00000 n 
+-0000566100 00000 n 
+-0000570258 00000 n 
+-0000570441 00000 n 
+-0000570613 00000 n 
+-0000570829 00000 n 
+-0000571033 00000 n 
+-0000571243 00000 n 
+-0000571443 00000 n 
+-0000571621 00000 n 
+-0000571789 00000 n 
+-0000571957 00000 n 
+-0000572127 00000 n 
+-0000572296 00000 n 
+-0000572466 00000 n 
+-0000572635 00000 n 
+-0000572805 00000 n 
+-0000572974 00000 n 
+-0000573144 00000 n 
+-0000573313 00000 n 
+-0000573483 00000 n 
+-0000573661 00000 n 
+-0000573851 00000 n 
+-0000574033 00000 n 
+-0000574239 00000 n 
+-0000574459 00000 n 
+-0000574679 00000 n 
+-0000574901 00000 n 
+-0000575127 00000 n 
+-0000575353 00000 n 
+-0000575544 00000 n 
+-0000575660 00000 n 
+-0000575772 00000 n 
+-0000575882 00000 n 
+-0000575991 00000 n 
+-0000576106 00000 n 
+-0000576214 00000 n 
+-0000576317 00000 n 
+-0000576355 00000 n 
+-0000576483 00000 n 
+-trailer
+-<< /Size 838
+-/Root 836 0 R
+-/Info 837 0 R
+-/ID [<97BD174C11E27135F4DDA4E0C82B0C7C> <97BD174C11E27135F4DDA4E0C82B0C7C>] >>
+-startxref
+-576828
+-%%EOF
Index: /issm/oecreview/Archive/12678-13393/ISSM-13184-13185.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13184-13185.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13184-13185.diff	(revision 13394)
@@ -0,0 +1,237 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13184)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13185)
+@@ -4,6 +4,7 @@
+ 
+ #include "../issm.h"
+ #include "../include/globals.h"
++#include "../shared/Numerics/adolc_edf.h"
+ 
+ int main(int argc,char **argv){
+ 
+@@ -118,6 +119,9 @@
+ 	
+ 	/*If running AD, then initialize the tape: */
+ 	#ifdef _HAVE_ADOLC_
++	GenericParam<Adolc_edf> *theAdolcEDF_p=new GenericParam<Adolc_edf>(AdolcParamEnum);
++	theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p=reg_ext_fct(EDF_for_solverx);
++	femmodel->parameters->AddObject(theAdolcEDF_p);
+ 	if(autodiff) trace_on(1);
+ 	#endif
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/adolc_edf.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/adolc_edf.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/adolc_edf.h	(revision 13185)
+@@ -0,0 +1,28 @@
++/*
++ * adolc_edf.h
++ *
++ *  Created on: Jun 26, 2012
++ *      Author: utke
++ */
++
++#ifndef _ADOLC_EDF_H_
++#define _ADOLC_EDF_H_
++
++#include "../../include/include.h"
++
++#ifdef _HAVE_ADOLC_
++
++struct Adolc_edf {
++    ext_diff_fct *myEDF_for_solverx_p;
++    Adolc_edf() : myEDF_for_solverx_p(0) {}
++    inline friend std::ostream& operator << ( ostream&, const Adolc_edf& );
++};
++
++std::ostream& operator << ( std::ostream& out, const Adolc_edf& a) {
++    out << a.myEDF_for_solverx_p;
++    return out;
++}
++
++#endif
++
++#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13184)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13185)
+@@ -26,5 +26,9 @@
+ void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n);
+ void SolverxSeq(double** pX,double* A,double* B,int n);
+ 
++#ifdef _HAVE_ADOLC_
++ADOLC_ext_fct EDF_for_solverx;
++#endif
++
+ #endif  /* _SOLVERX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13184)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13185)
+@@ -44,6 +44,13 @@
+ 
+ }/*}}}*/
+ #ifdef _HAVE_ADOLC_
++
++int EDF_for_solverx(int n, IssmPDouble *x, int m, IssmPDouble *y) {
++    if(m*(m+1)!=n)_error_("Stiffness matrix should be square!");
++    SolverxSeq(&y,x, x+m*m, m);
++    return 0;
++}
++
+ void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){//{{{
+ 	/* if we use Adol-C then the IssmDouble will be an adouble
+ 	   and the calls to gsl_... will not work. 
+@@ -60,8 +67,8 @@
+ 	IssmPDouble* pdoubleX=NULL;
+ 
+ 	/*First, transfer from IssmDouble to double all our matrices and vectors: */
+-	pdoubleA=xNew<double>(n*n);
+-	pdoubleB=xNew<double>(n);
++	pdoubleA=xNew<IssmPDouble>(n*n);
++	pdoubleB=xNew<IssmPDouble>(n);
+ 	for(i=0;i<n*n;i++)pdoubleA[i]=reCast<IssmPDouble>(A[i]);
+ 	for(i=0;i<n;i++)pdoubleB[i]=reCast<IssmPDouble>(B[i]);
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13184)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13185)
+@@ -135,6 +135,7 @@
+ 					./classes/matrix/Vector.h\
+ 					./classes/matrix/Vector.cpp\
+ 					./classes/objects/Params/Param.h\
++					./classes/objects/Params/GenericParam.h\
+ 					./classes/objects/Params/BoolParam.cpp\
+ 					./classes/objects/Params/BoolParam.h\
+ 					./classes/objects/Params/IntParam.cpp\
+@@ -195,6 +196,7 @@
+ 					./shared/MemOps/xMemCpy.h\
+ 					./shared/Matrix/matrix.h\
+ 					./shared/Matrix/MatrixUtils.cpp\
++					./shared/Numerics/adolc_edf.h\
+ 					./shared/Numerics/numerics.h\
+ 					./shared/Numerics/Verbosity.h\
+ 					./shared/Numerics/Verbosity.cpp\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 13184)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 13185)
+@@ -111,6 +111,7 @@
+ #include "./Materials/Matpar.h"
+ 
+ /*Params: */
++#include "./Params/GenericParam.h"
+ #include "./Params/BoolParam.h"
+ #include "./Params/DoubleMatParam.h"
+ #include "./Params/DoubleTransientMatParam.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/GenericParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/GenericParam.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/GenericParam.h	(revision 13185)
+@@ -0,0 +1,102 @@
++/*
++ * GenericParam.h
++ *
++ *  Created on: Aug 29, 2012
++ *      Author: utke
++ */
++
++#ifndef GENERICPARAM_H_
++#define GENERICPARAM_H_
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++        #include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./Param.h"
++#include "../../../include/include.h"
++#include "../../../shared/shared.h"
++/*}}}*/
++
++/**
++ * here we have a class that holds an instance of P
++ * but because it should live side by side with
++ * the other instances derived from Param it - unfortunately -
++ * inherits all the accessors that are useless in this context
++ */
++template <class P> class GenericParam: public Param{
++
++        private:
++                P myP;
++                int myEnumVal;
++
++        public:
++                /*GenericParam constructors, destructors: {{{*/
++                GenericParam(int enumVal) : myEnumVal(enumVal){};
++                ~GenericParam(){};
++                /*}}}*/
++                /*Object virtual functions definitions:{{{ */
++                // unfortunately having such a printer method implies
++                // that P must provide the friend <<  operator
++                void  DeepEcho() {
++                  _printLine_("GenericParam:");
++                  _printLine_("   enum:  " << myEnumVal << " (" << EnumToStringx(myEnumVal) << ")");
++                  _printLine_("   value: " << myP);;
++                }
++                 void  Echo() {DeepEcho();};
++                int   Id(){ return -1; };
++                int   MyRank() { extern int my_rank; return my_rank;} ;
++                int   ObjectEnum() {return AdolcParamEnum;};
++
++                // the "copy"  has to implement the base class abstract function
++                // but I would prefer to drop this not to hide a "new" in here because
++                // it does not clarify  ownership of the newed up instance...
++                // use the default copy constructor instead
++                Object* copy() { return new GenericParam<P>(*this); };
++                /*}}}*/
++                /*Param vritual function definitions: {{{*/
++                int   InstanceEnum(){return myEnumVal;}
++                void GetParameterName(char**pname) {EnumToStringx(pname,this->myEnumVal);}
++
++                P& GetParameterValue() { return myP;}
++                const P& GetParameterValue()const { return myP;};
++
++                // none of these apply ...
++                void  GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a bool");}
++                void  GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return an integer");}
++                void  GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return an array of integers");}
++                void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return an array of integers");}
++                void  GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble");}
++                void  GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble for a given time");}
++                void  GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a string");}
++                void  GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a string array");}
++                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble array");}
++                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble array");}
++                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a matrix array");}
++                void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Vec");}
++                void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Mat");}
++                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a FILE");}
++
++                void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a bool");}
++                void  SetValue(int integer){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an integer");}
++                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an int array");}
++                void  SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an int array");}
++                void  SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an IssmDouble");}
++                void  SetValue(char* string){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a string");}
++                void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a string array");}
++                void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a IssmDouble array");}
++                void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a IssmDouble array");}
++                void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Vec");}
++                void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Mat");}
++                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a FILE");}
++                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an array of matrices");}
++                void  UnitConversion(int direction_enum) {/* nothing useful here either */};
++
++                /*}}}*/
++};
++
++
++#endif /* GENERICPARAM_H_ */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13185-13186.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13185-13186.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13185-13186.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/GenericParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/GenericParam.h	(revision 13185)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/GenericParam.h	(revision 13186)
+@@ -39,8 +39,8 @@
+                 ~GenericParam(){};
+                 /*}}}*/
+                 /*Object virtual functions definitions:{{{ */
+-                // unfortunately having such a printer method implies
+-                // that P must provide the friend <<  operator
++                // unfortunately,  having to implement such a printer method implies
++                // that any structured P must provide the friend << operator
+                 void  DeepEcho() {
+                   _printLine_("GenericParam:");
+                   _printLine_("   enum:  " << myEnumVal << " (" << EnumToStringx(myEnumVal) << ")");
Index: /issm/oecreview/Archive/12678-13393/ISSM-13186-13187.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13186-13187.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13186-13187.diff	(revision 13394)
@@ -0,0 +1,23 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13186)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13187)
+@@ -3,7 +3,7 @@
+ #AUTOCONF
+ AC_INIT([ISSM],[4.2.1],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
+ AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
+-AC_CONFIG_MACRO_DIR([externalpackages/libtool/install/share/aclocal])                 #m4 macros are located in m4
++AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
+ m4_include([m4/issm_options.m4])
+ AC_CANONICAL_TARGET                       #Determine the system type
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am	(revision 13186)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/Makefile.am	(revision 13187)
+@@ -2,3 +2,5 @@
+ SUBDIRS = src
+ bin_SCRIPTS=config.h startup.m README.rtf
+ 
++ACLOCAL_AMFLAGS = -I m4
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-13187-13188.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13187-13188.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13187-13188.diff	(revision 13394)
@@ -0,0 +1,24 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh	(revision 13187)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh	(revision 13188)
+@@ -1,7 +1,6 @@
+ #!/bin/bash
++#you need hdf5 compiled
+ 
+-#you need hdf5 compiled, as well as doxygen for the documentation
+-
+ #Some cleanup
+ rm -rf src install netcdf-4.2
+ mkdir install src
+@@ -19,7 +18,9 @@
+ 
+ #Configure and compile
+ cd src
+-./configure  --prefix="$ISSM_DIR/externalpackages/netcdf/install"  
++./configure \
++ --prefix="$ISSM_DIR/externalpackages/netcdf/install"  \
++ --disable-doxygen
+ if [ -z $1 ]; then
+ 	make
+ else
Index: /issm/oecreview/Archive/12678-13393/ISSM-13188-13189.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13188-13189.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13188-13189.diff	(revision 13394)
@@ -0,0 +1,30 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 13188)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 13189)
+@@ -42,7 +42,7 @@
+ 				file=os.path.splitext(file)[0]
+ 				#__import__(file)
+ 				
+-sys.path.append(ISSM_DIR + '/src/modules/python')
++sys.path.append(ISSM_DIR + '/lib')
+ 
+ #Deal with scipy import: 
+ import scipy 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13188)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13189)
+@@ -200,10 +200,10 @@
+ 
+ PYTHON_DIR="$ISSM_DIR/externalpackages/python/install"
+ if [ -d "$PYTHON_DIR" ]; then
+-	export PYTHONPATH="$PYTHONPATH:$ISSM_DIR/src/modules/python"
++	export PYTHONPATH="$PYTHONPATH:$ISSM_DIR/lib"
+ 	export PYTHONSTARTUP="$ISSM_DIR/startup.py"
+ 	pathprepend    "$PYTHON_DIR/bin"
+-	libpathprepend "$ISSM_DIR/src/modules/python"
++	libpathprepend "$ISSM_DIR/lib"
+ 	libpathprepend "$PYTHON_DIR/lib"
+ fi
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13189-13190.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13189-13190.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13189-13190.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 13189)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 13190)
+@@ -57,7 +57,7 @@
+ from constants import *
+ from surfaceforcings import *
+ from basalforcings import *
+-from materials import *
++from matice import *
+ from friction import *
+ from flowequation import *
+ from fielddisplay import *
Index: /issm/oecreview/Archive/12678-13393/ISSM-13190-13191.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13190-13191.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13190-13191.diff	(revision 13394)
@@ -0,0 +1,8 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/Makefile
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/Makefile	(revision 13190)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/Makefile	(revision 13191)
+@@ -1,2 +1,2 @@
+ clean: 
+-	rm -rf *.tar.gz *.bin *.errlog *.outlog  *.outbin *.petsc *.queue *.run valgrind.log* *.bat *.lock
++	rm -rf *.tar.gz *.bin *.errlog *.outlog  *.outbin *.petsc *.queue *.run valgrind.log* *.bat *.lock qmu*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13191-13192.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13191-13192.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13191-13192.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13191)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/WriteData.py	(revision 13192)
+@@ -24,7 +24,7 @@
+ 		#This is an object field, construct enum and data
+ 		obj       = options.getfieldvalue('object')
+ 		fieldname = options.getfieldvalue('fieldname')
+-		classname = str(type(obj)).rsplit('.')[-1].split("'")[0]
++		classname = options.getfieldvalue('class',str(type(obj)).rsplit('.')[-1].split("'")[0])
+ 
+ 		enum      = BuildEnum(classname+'_'+fieldname)
+ 		data      = getattr(obj,fieldname)
Index: /issm/oecreview/Archive/12678-13393/ISSM-13192-13193.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13192-13193.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13192-13193.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 13192)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 13193)
+@@ -84,6 +84,7 @@
+ from private import *
+ from triangle import *
+ from setmask import *
++from runme import runme
+ 
+ #}}}
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13193-13194.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13193-13194.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13193-13194.diff	(revision 13394)
@@ -0,0 +1,32 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test999.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test999.py	(revision 13193)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test999.py	(revision 13194)
+@@ -1,27 +0,0 @@
+-#md=model()
+-#md=triangle(md,'../Exp/Square.exp',50000)
+-#md=setmask(md,'all','')
+-#md=parameterize(md,'../Par/SquareShelfConstrained.py')
+-
+-md1=[11,12,13]
+-md2=[21,22,23]
+-md3=[34,32,33]
+-md4=[41,44,43]
+-md5=[51,52,53]
+-md6=[61,62,63]
+-md7=[71,72,73]
+-
+-#Fields and tolerances to track changes
+-field_names     =['Vx','Vy','Vel','Pressure',\
+-	'StressTensorxx','StressTensoryy','StressTensorxy']
+-field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
+-	1e-13,1e-13,1e-13]
+-field_values=[\
+-	[md1],\
+-	[md2],\
+-	[md3],\
+-	[md4],\
+-	[md5],\
+-	[md6],\
+-	[md7],\
+-	]
Index: /issm/oecreview/Archive/12678-13393/ISSM-13194-13195.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13194-13195.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13194-13195.diff	(revision 13394)
@@ -0,0 +1,117 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 13194)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 13195)
+@@ -40,7 +40,7 @@
+ 			break;}
+ 		#endif
+ 		case SeqMatType:{
+-			SolverxSeq(&uf->svector,Kff->smatrix,pf->svector);
++			SolverxSeq(&uf->svector,Kff->smatrix,pf->svector,parameters);
+ 			break;}
+ 		default:
+ 			  _error_("Matrix type: " << Kff->type << " not supported yet!");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13194)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13195)
+@@ -22,11 +22,11 @@
+ void  DofTypesToIndexSet(IS* pisv, IS* pisp, Vec df,int typeenum);
+ #endif
+ 
+-void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf);
+-void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n);
+-void SolverxSeq(double** pX,double* A,double* B,int n);
++void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf,Parameters* parameters);
++void SolverxSeq(IssmPDouble** pX,IssmPDouble* A,IssmPDouble* B,int n);
+ 
+ #ifdef _HAVE_ADOLC_
++void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n, Parameters* parameters);
+ ADOLC_ext_fct EDF_for_solverx;
+ #endif
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13194)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13195)
+@@ -18,8 +18,12 @@
+ #include <gsl/gsl_linalg.h>
+ #endif
+ 
+-void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf){/*{{{*/
++#ifdef _HAVE_ADOLC_
++#include "../../shared/Numerics/adolc_edf.h"
++#endif
+ 
++void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf, Parameters* parameters){/*{{{*/
++
+ 	#ifdef _HAVE_GSL_
+ 	/*Intermediary: */
+ 	int M,N,N2,s;
+@@ -32,7 +36,11 @@
+ 	if(N!=N2)_error_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
+ 	if(M!=N)_error_("Stiffness matrix should be square!");
+ 
++#ifdef _HAVE_ADOLC_
++	SolverxSeq(&x,Kff->matrix,pf->vector,N,parameters);
++#else
+ 	SolverxSeq(&x,Kff->matrix,pf->vector,N);
++#endif
+ 	uf=new SeqVec(x,N);
+ 
+ 	/*Assign output pointers:*/
+@@ -51,40 +59,20 @@
+     return 0;
+ }
+ 
+-void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){//{{{
+-	/* if we use Adol-C then the IssmDouble will be an adouble
+-	   and the calls to gsl_... will not work. 
+-	   We therefore call a wrapped solver instead. 
+-	*/
+-
+-	/*Output: */
+-	IssmDouble* X=NULL;
+-
+-	/*Intermediary: */
+-	int     i;
+-	IssmPDouble* pdoubleA=NULL;
+-	IssmPDouble* pdoubleB=NULL;
+-	IssmPDouble* pdoubleX=NULL;
+-
+-	/*First, transfer from IssmDouble to double all our matrices and vectors: */
+-	pdoubleA=xNew<IssmPDouble>(n*n);
+-	pdoubleB=xNew<IssmPDouble>(n);
+-	for(i=0;i<n*n;i++)pdoubleA[i]=reCast<IssmPDouble>(A[i]);
+-	for(i=0;i<n;i++)pdoubleB[i]=reCast<IssmPDouble>(B[i]);
+-	
+-	/*Call wrapped solver: */
+-	SolverxSeq(&pdoubleX,pdoubleA, pdoubleB, n);
+-
+-	/*Transfer solution vector from double to IssmDouble: */
+-	X = xNew<IssmDouble>(n);
+-	for(i=0;i<n;i++)X[i]=reCast<IssmDouble>(pdoubleX[i]);
+-
+-	/*Free ressources:*/
+-	xDelete<IssmPDouble>(pdoubleA);
+-	xDelete<IssmPDouble>(pdoubleB);
+-
+-	/*Assign output pointers: */
+-	*pX=X;
++void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n, Parameters* parameters){//{{{
++	// pack inputs to conform to the EDF-prescribed interface
++        IssmDouble*  adoubleEDF_X=xNew<IssmDouble>(n*(n+1)); // packed inputs, i.e. matrix and right hand side
++        for(int i=0; i<n*n;i++)adoubleEDF_X[i]    =A[i]; // pack matrix
++        for(int i=0; i<n;  i++)adoubleEDF_X[i+n*n]=B[i]; // pack the right hand side
++        IssmPDouble* pdoubleEDF_X=xNew<IssmPDouble>(n*(n+1)); // provide space to transfer inputs during call_ext_fct
++	IssmPDouble* pdoubleEDF_Y=xNew<IssmPDouble>(n);       // provide space to transfer outputs during call_ext_fct
++	// call the wrapped solver through the registry entry we retrieve from parameters
++	call_ext_fct(dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p,
++	             n*(n+1), pdoubleEDF_X, adoubleEDF_X,
++	             n, pdoubleEDF_Y, B);
++	xDelete(adoubleEDF_X);
++	xDelete(pdoubleEDF_X);
++	xDelete(pdoubleEDF_Y);
+ }
+ /*}}}*/
+ #endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-13195-13196.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13195-13196.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13195-13196.diff	(revision 13394)
@@ -0,0 +1,115 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13195)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13196)
+@@ -23,10 +23,10 @@
+ #endif
+ 
+ void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf,Parameters* parameters);
+-void SolverxSeq(IssmPDouble** pX,IssmPDouble* A,IssmPDouble* B,int n);
++void SolverxSeq(IssmPDouble *X, IssmPDouble *A, IssmPDouble *B,int n);
+ 
+ #ifdef _HAVE_ADOLC_
+-void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n, Parameters* parameters);
++void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters);
+ ADOLC_ext_fct EDF_for_solverx;
+ #endif
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13195)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13196)
+@@ -28,20 +28,20 @@
+ 	/*Intermediary: */
+ 	int M,N,N2,s;
+ 	SeqVec *uf = NULL;
+-	IssmDouble *x  = NULL;
+ 
+ 	Kff->GetSize(&M,&N);
+ 	pf->GetSize(&N2);
+ 
+ 	if(N!=N2)_error_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
+ 	if(M!=N)_error_("Stiffness matrix should be square!");
+-
++        IssmDouble *x  = xNew<IssmDouble>(N);
+ #ifdef _HAVE_ADOLC_
+-	SolverxSeq(&x,Kff->matrix,pf->vector,N,parameters);
++	SolverxSeq(x,Kff->matrix,pf->vector,N,parameters);
+ #else
+-	SolverxSeq(&x,Kff->matrix,pf->vector,N);
++	SolverxSeq(x,Kff->matrix,pf->vector,N);
+ #endif
+-	uf=new SeqVec(x,N);
++	uf=new SeqVec(x,N);	
++	xDelete(x);
+ 
+ 	/*Assign output pointers:*/
+ 	*puf=uf;
+@@ -55,28 +55,28 @@
+ 
+ int EDF_for_solverx(int n, IssmPDouble *x, int m, IssmPDouble *y) {
+     if(m*(m+1)!=n)_error_("Stiffness matrix should be square!");
+-    SolverxSeq(&y,x, x+m*m, m);
++    SolverxSeq(y,x, x+m*m, m);
+     return 0;
+ }
+ 
+-void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n, Parameters* parameters){//{{{
++void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){//{{{
+ 	// pack inputs to conform to the EDF-prescribed interface
+-        IssmDouble*  adoubleEDF_X=xNew<IssmDouble>(n*(n+1)); // packed inputs, i.e. matrix and right hand side
+-        for(int i=0; i<n*n;i++)adoubleEDF_X[i]    =A[i]; // pack matrix
+-        for(int i=0; i<n;  i++)adoubleEDF_X[i+n*n]=B[i]; // pack the right hand side
+-        IssmPDouble* pdoubleEDF_X=xNew<IssmPDouble>(n*(n+1)); // provide space to transfer inputs during call_ext_fct
+-	IssmPDouble* pdoubleEDF_Y=xNew<IssmPDouble>(n);       // provide space to transfer outputs during call_ext_fct
++        IssmDouble*  adoubleEDFin=xNew<IssmDouble>(n*(n+1)); // packed inputs, i.e. matrix and right hand side
++        for(int i=0; i<n*n;i++)adoubleEDFin[i]    =A[i]; // pack matrix
++        for(int i=0; i<n;  i++)adoubleEDFin[i+n*n]=B[i]; // pack the right hand side
++        IssmPDouble* pdoubleEDFin=xNew<IssmPDouble>(n*(n+1)); // provide space to transfer inputs during call_ext_fct
++	IssmPDouble* pdoubleEDFout=xNew<IssmPDouble>(n);       // provide space to transfer outputs during call_ext_fct
+ 	// call the wrapped solver through the registry entry we retrieve from parameters
+ 	call_ext_fct(dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p,
+-	             n*(n+1), pdoubleEDF_X, adoubleEDF_X,
+-	             n, pdoubleEDF_Y, B);
+-	xDelete(adoubleEDF_X);
+-	xDelete(pdoubleEDF_X);
+-	xDelete(pdoubleEDF_Y);
++	             n*(n+1), pdoubleEDFin, adoubleEDFin,
++	             n, pdoubleEDFout,X);
++	xDelete(adoubleEDFin);
++	xDelete(pdoubleEDFin);
++	xDelete(pdoubleEDFout);
+ }
+ /*}}}*/
+ #endif
+-void SolverxSeq(IssmPDouble** pX,IssmPDouble* A,IssmPDouble* B,int n){ //{{{
++void SolverxSeq(IssmPDouble * X, IssmPDouble * A, IssmPDouble * B,int n){ //{{{
+ 	#ifdef _HAVE_GSL_
+ 	/*GSL Matrices and vectors: */
+ 	int              s;
+@@ -86,7 +86,7 @@
+ 	gsl_permutation *p = NULL;
+ 	/*A will be modified by LU decomposition. Use copy*/
+ 	double* Acopy = xNew<double>(n*n);
+-	xMemCpy<double>(Acopy,A,n*n);
++	xMemCpy(Acopy,A,n*n);
+ 
+ 	/*Initialize gsl matrices and vectors: */
+ 	a = gsl_matrix_view_array (Acopy,n,n);
+@@ -102,14 +102,12 @@
+ 	//gsl_vector_fprintf (stdout, x, "%g");
+ 
+ 	/*Copy result*/
+-	double* X = xNew<double>(n);
+-	memcpy(X,gsl_vector_ptr(x,0),n*sizeof(double));
++	xMemCpy(X,gsl_vector_ptr(x,0),n);
+ 
+ 	/*Clean up and assign output pointer*/
+-	xDelete<double>(Acopy);
++	xDelete(Acopy);
+ 	gsl_permutation_free(p);
+ 	gsl_vector_free(x);
+-	*pX=X;
+ 	#endif
+ }
+ /*}}}*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-13196-13197.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13196-13197.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13196-13197.diff	(revision 13394)
@@ -0,0 +1,62 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13196)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13197)
+@@ -6,24 +6,26 @@
+ #----------------------------#
+ 
+ #process info.log
+-TODAY=`     cat info.log | grep "today"           | awk '{printf("%s %s",$2,$3);}'`
+-USER=`      cat info.log | grep "user"            | awk '{print $2}'`
+-HOST_NAME=` cat info.log | grep "host"            | awk '{print $2}'`
+-OS=`        cat info.log | grep "OS"              | awk '{print $2}'`
+-RELEASE=`   cat info.log | grep "release"         | awk '{print $2}'`
+-EL_INSTALL=`cat info.log | grep "elapsed_install" | awk '{print $2}'`
+-EL_RUN=`    cat info.log | grep "elapsed_run"     | awk '{print $2}'`
+-EL_TOTAL=`  cat info.log | grep "elapsed_total"   | awk '{print $2}'`
+-CRASH=`     cat info.log | grep "matlab_crash:"   | awk '{print $2}'`
++TODAY=$(       cat info.log | grep "today"           | awk '{printf("%s %s",$2,$3);}')
++USER=$(        cat info.log | grep "user"            | awk '{print $2}')
++HOST_NAME=$(   cat info.log | grep "host"            | awk '{print $2}')
++OS=$(          cat info.log | grep "OS"              | awk '{print $2}')
++RELEASE=$(     cat info.log | grep "release"         | awk '{print $2}')
++EL_INSTALL=$(  cat info.log | grep "elapsed_install" | awk '{print $2}')
++EL_MATLAB=$(   cat info.log | grep "elapsed_matlab"  | awk '{print $2}')
++EL_PYTHON=$(   cat info.log | grep "elapsed_python"  | awk '{print $2}')
++EL_TOTAL=$(    cat info.log | grep "elapsed_total"   | awk '{print $2}')
++CRASH_MATLAB=$(cat info.log | grep "matlab_crash:"   | awk '{print $2}')
++CRASH_PYTHON=$(cat info.log | grep "python_crash:"   | awk '{print $2}')
+ 
+ #Process matlab_log.log
+ cat matlab_log.log        | egrep 'ERROR|SUCCESS|FAILURE' | grep -v "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > matlab.log
+ cat matlab.log        | grep -v "SUCCESS" > matlab_short.log
+ cat matlab_log.log        | grep "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > petscerror.log
+-NUM_TOT=`wc -l matlab.log | awk '{print $1}'`
+-NUM_ERR=`cat matlab.log | grep 'ERROR'   | grep -v "PETSC" | wc -l`
+-NUM_SUC=`cat matlab.log | grep 'SUCCESS' | wc -l`
+-NUM_FAI=`cat matlab.log | grep 'FAILURE' | wc -l`
++NUM_TOT=$(wc -l matlab.log | awk '{print $1}')
++NUM_ERR=$(cat matlab.log | grep 'ERROR'   | grep -v "PETSC" | wc -l)
++NUM_SUC=$(cat matlab.log | grep 'SUCCESS' | wc -l)
++NUM_FAI=$(cat matlab.log | grep 'FAILURE' | wc -l)
+ 
+ #style
+ H1_STYLE='width="1000px" cellpadding="20"'
+@@ -98,7 +100,7 @@
+ </tr>
+ <tr>
+ <td $TABLE_FONT>number of <a href="#FAILURE">failures</a>: $NUM_FAI/$NUM_TOT
+-<td $TABLE_FONT>execution elapsed time: $EL_RUN</td>
++<td $TABLE_FONT>execution elapsed time: $EL_MATLAB</td>
+ </tr>
+ </table>
+ <br><hr width="1000px">
+@@ -107,7 +109,7 @@
+ #update status
+ if [ $IS_INSTALL -eq 1 ];
+ then
+-	if [ $CRASH -eq 0 ];
++	if [ $CRASH_MATLAB -eq 0 ];
+ 	then
+ 		cat summary.html | sed -e "s/STATUS/<span style=\"color:#008000\">all test desks have been run<\/span>/g" > summary2.html
+ 	else
Index: /issm/oecreview/Archive/12678-13393/ISSM-13197-13198.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13197-13198.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13197-13198.diff	(revision 13394)
@@ -0,0 +1,362 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13197)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13198)
+@@ -1,78 +1,56 @@
+ #!/bin/bash
+ #generate html report from info.log output file
+ 
+-#----------------------------#
+-# Initialize local variables #
+-#----------------------------#
++#style
++#{{{
++H1_STYLE='width="900px" cellpadding="20"'
++H1_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:30px;" align="center"'
++H2_STYLE='width="800px" cellpadding="20"'
++H2_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:25px; font-weight: bold;" align="left"'
++TABLE_STYLE='width="700px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"'
++TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px; font-weight: normal;" align="left"'
++MATLAB_STYLE='width="9000px" rules=none'
++MATLAB_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="left"'
++BODY_STYLE='width="700px"'
++BODY_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px;"'
++BODY_FONTC=$(echo $BODY_FONT | sed -e "s/style=\"/style=\"text-align:center; /g")
++BODY_FONTL=$(echo $BODY_FONT | sed -e "s/style=\"/style=\"text-align:left; /g")
++FOOTER_STYLE='width="700px"  cellpadding="10"'
++FOOTER_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="center"'
++#}}}
+ 
+ #process info.log
++#{{{
++if [ ! -f info.log ]; then
++	echo "File info.log not found!" >&2   # Error message to stderr.
++	exit 1
++fi 
+ TODAY=$(       cat info.log | grep "today"           | awk '{printf("%s %s",$2,$3);}')
+ USER=$(        cat info.log | grep "user"            | awk '{print $2}')
+ HOST_NAME=$(   cat info.log | grep "host"            | awk '{print $2}')
+ OS=$(          cat info.log | grep "OS"              | awk '{print $2}')
+ RELEASE=$(     cat info.log | grep "release"         | awk '{print $2}')
+ EL_INSTALL=$(  cat info.log | grep "elapsed_install" | awk '{print $2}')
++EL_TOTAL=$(    cat info.log | grep "elapsed_total"   | awk '{print $2}')
++IS_MATLAB=$(   cat info.log | grep "is_matlab"       | awk '{print $2}')
++IS_PYTHON=$(   cat info.log | grep "is_python"       | awk '{print $2}')
+ EL_MATLAB=$(   cat info.log | grep "elapsed_matlab"  | awk '{print $2}')
+ EL_PYTHON=$(   cat info.log | grep "elapsed_python"  | awk '{print $2}')
+-EL_TOTAL=$(    cat info.log | grep "elapsed_total"   | awk '{print $2}')
+ CRASH_MATLAB=$(cat info.log | grep "matlab_crash:"   | awk '{print $2}')
+ CRASH_PYTHON=$(cat info.log | grep "python_crash:"   | awk '{print $2}')
+ 
+-#Process matlab_log.log
+-cat matlab_log.log        | egrep 'ERROR|SUCCESS|FAILURE' | grep -v "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > matlab.log
+-cat matlab.log        | grep -v "SUCCESS" > matlab_short.log
+-cat matlab_log.log        | grep "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > petscerror.log
+-NUM_TOT=$(wc -l matlab.log | awk '{print $1}')
+-NUM_ERR=$(cat matlab.log | grep 'ERROR'   | grep -v "PETSC" | wc -l)
+-NUM_SUC=$(cat matlab.log | grep 'SUCCESS' | wc -l)
+-NUM_FAI=$(cat matlab.log | grep 'FAILURE' | wc -l)
+-
+-#style
+-H1_STYLE='width="1000px" cellpadding="20"'
+-H1_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:35px;" align="center"'
+-
+-H2_STYLE='width="900px" cellpadding="20"'
+-H2_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:28px; font-weight: bold;" align="left"'
+-
+-TABLE_STYLE='width="800px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"'
+-TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px; font-weight: normal;" align="left"'
+-
+-MATLAB_STYLE='width="1000px" rules=none'
+-MATLAB_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="left"'
+-
+-BODY_STYLE='width="800px"'
+-BODY_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px;"'
+-
+-FOOTER_STYLE='width="800px"  cellpadding="10"'
+-FOOTER_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="center"'
+-
+-#style 2
+-BODY_FONTC=`echo $BODY_FONT | sed -e "s/style=\"/style=\"text-align:center; /g"`
+-BODY_FONTL=`echo $BODY_FONT | sed -e "s/style=\"/style=\"text-align:left; /g"`
+-
+ #Did installation work?
+ if [ $(ls -1 $ISSM_DIR/bin | wc -l) -le 20 ]; then
+ 	IS_INSTALL=0
+ else
+ 	IS_INSTALL=1
+ fi
++#}}}
+ 
+-#display table ONLY if installation worked and there has been at leat one FAILURE or ERROR
+-IS_TABLE=0
+-if [ $IS_INSTALL -eq 1 ]; then
+-	if [ $NUM_TOT -gt 1 ]; then
+-		if [ $NUM_SUC -ne $NUM_TOT  ]; then
+-			IS_TABLE=1
+-		fi
+-	fi
+-fi
+-
+-#-------------------#
+-# build report.html #
+-#-------------------#
+-
+-#first: summary
+-cat << END > summary.html
++#1. summary table 
++#{{{
++rm report.html
++cat << END >> report.html
+ <div align="center">
+ <table $H1_STYLE><tr><td $H1_FONT>ISSM Nightly run report</td></tr></table>
+ 
+@@ -82,49 +60,98 @@
+ <td $TABLE_FONT>date: $TODAY</td>
+ </tr>
+ <tr>
+-<td $TABLE_FONT>OS: $OS</td>
+ <td $TABLE_FONT>user: $USER</td>
+-</tr>
+-<tr>
+-<td $TABLE_FONT>status: STATUS</td>
+ <td $TABLE_FONT>release: $RELEASE</td>
+ </tr>
+ <tr>
+-<td $TABLE_FONT>number of successes: $NUM_SUC/$NUM_TOT
+ <td $TABLE_FONT>total elapsed time: $EL_TOTAL</td>
+-</tr>
+-<tr>
+-<td $TABLE_FONT>number of <a href="#ERROR">errors</a>: $NUM_ERR/$NUM_TOT
+-
+ <td $TABLE_FONT>installation elapsed time: $EL_INSTALL</td>
+ </tr>
+-<tr>
+-<td $TABLE_FONT>number of <a href="#FAILURE">failures</a>: $NUM_FAI/$NUM_TOT
+-<td $TABLE_FONT>execution elapsed time: $EL_MATLAB</td>
+-</tr>
+ </table>
+-<br><hr width="1000px">
++<br><hr width="900px">
+ END
++# }}}
+ 
+-#update status
+-if [ $IS_INSTALL -eq 1 ];
+-then
+-	if [ $CRASH_MATLAB -eq 0 ];
+-	then
+-		cat summary.html | sed -e "s/STATUS/<span style=\"color:#008000\">all test desks have been run<\/span>/g" > summary2.html
+-	else
+-		cat summary.html | sed -e "s/STATUS/<span style=\"color:#ff0000\">installation successful but Matlab crashed<\/span>/g" > summary2.html
+-	fi
++#stop if did not install
++#{{{
++if [ $IS_INSTALL -eq 0 ]; then
++	cat << END >> report.html
++	<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
++	<tr><td $BODY_FONT>status: <span style=\"color:#ff0000\">Installation failed<\/span></td></tr>
++	</table>
++	<table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table>
++	</div>
++END
++exit 0
++fi
++#}}}
++
++#2. matlab report
++if [ $IS_MATLAB -eq 1 ]; then
++#Process matlab_log.log {{{
++cat matlab_log.log        | egrep 'ERROR|SUCCESS|FAILURE' | grep -v "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > matlab.log
++cat matlab.log        | grep -v "SUCCESS" > matlab_short.log
++cat matlab_log.log        | grep "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > petscerror.log
++NUM_MATLAB_TOT=$(wc -l matlab.log | awk '{print $1}')
++NUM_MATLAB_ERR=$(cat matlab.log | grep 'ERROR'   | grep -v "PETSC" | wc -l)
++NUM_MATLAB_SUC=$(cat matlab.log | grep 'SUCCESS' | wc -l)
++NUM_MATLAB_FAI=$(cat matlab.log | grep 'FAILURE' | wc -l)
++#}}}
++#write report {{{
++cat << END >> report.html
++<table $H2_STYLE><tr><td $H2_FONT>Matlab tests</td></tr></table>
++<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
++$(if [ $CRASH_MATLAB -eq 0 ]; then
++echo "<tr><td $BODY_FONT>status: <span style=\"color:#008000\">all test desks have been run</span></td></tr>"
+ else
+-	cat summary.html | sed -e "s/STATUS/<span style=\"color:#ff0000\">installation failed<\/span>/g" > summary2.html
++	echo "<tr><td $BODY_FONT>status: <span style=\"color:#ff0000\">Matlab crashed</span></td></tr>"
++fi)
++<tr><td $BODY_FONT>Total execution time: $EL_PYTHON</td></tr>
++<tr><td $BODY_FONT>Number of successes: $NUM_MATLAB_SUC/$NUM_MATLAB_TOT</td></tr>
++<tr><td $BODY_FONT>Number of errors: $NUM_MATLAB_ERR/$NUM_MATLAB_TOT</td></tr>
++<tr><td $BODY_FONT>Number of failures: $NUM_MATLAB_FAI/$NUM_MATLAB_TOT</td></tr>
++</table>
++END
++#}}}
+ fi
+-mv summary2.html summary.html
+ 
+-#report table
+-if [ $IS_TABLE -eq 1 ];
++#2. python report
++if [ $IS_PYTHON -eq 1 ]; then
++#Process python_log.log {{{
++cat python_log.log        | egrep 'ERROR|SUCCESS|FAILURE' | grep -v "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > python.log
++cat python.log        | grep -v "SUCCESS" > python_short.log
++cat python_log.log        | grep "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > petscerror.log
++NUM_PYTHON_TOT=$(wc -l python.log | awk '{print $1}')
++NUM_PYTHON_ERR=$(cat python.log | grep 'ERROR'   | grep -v "PETSC" | wc -l)
++NUM_PYTHON_SUC=$(cat python.log | grep 'SUCCESS' | wc -l)
++NUM_PYTHON_FAI=$(cat python.log | grep 'FAILURE' | wc -l)
++#}}}
++#write report {{{
++cat << END >> report.html
++<table $H2_STYLE><tr><td $H2_FONT>Python tests</td></tr></table>
++<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
++$(if [ $CRASH_PYTHON -eq 0 ]; then
++	echo "<tr><td $BODY_FONT>status: <span style=\"color:#008000\">all test desks have been run</span></td></tr>"
++else
++	echo "<tr><td $BODY_FONT>status: <span style=\"color:#ff0000\">Python crashed</span></td></tr>"
++fi)
++<tr><td $BODY_FONT>Total execution time: $EL_PYTHON</td></tr>
++<tr><td $BODY_FONT>Number of successes: $NUM_PYTHON_SUC/$NUM_PYTHON_TOT</td></tr>
++<tr><td $BODY_FONT>Number of errors: $NUM_PYTHON_ERR/$NUM_PYTHON_TOT</td></tr>
++<tr><td $BODY_FONT>Number of failures: $NUM_PYTHON_FAI/$NUM_PYTHON_TOT</td></tr>
++</table>
++END
++#}}}
++fi
++
++#3. Matlab and python tables
++if [ $IS_MATLAB -eq 1 ]; then
++#Matlab{{{
++#display table ONLY if installation worked and there has been at leat one FAILURE or ERROR
++if [ $IS_INSTALL -eq 1 ] && [ $NUM_MATLAB_TOT -gt 1 ] && [ $NUM_MATLAB_SUC -ne $NUM_MATLAB_TOT ]
+ then
+-	cat << END > content.html
+-<table $(echo $H2_STYLE)><tr><td $(echo $H2_FONT)>List of tests</td></tr></table>
++	cat << END >> report.html
++<table $(echo $H2_STYLE)><tr><td $(echo $H2_FONT)>List of Matlab tests</td></tr></table>
+ <table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+ <tr> 
+ <th $(echo $BODY_FONT)>Result</th> 
+@@ -174,14 +201,73 @@
+ </table>
+ <br>
+ END
+-else
+-	mktemp content.html
+ fi
++#}}}
++fi
++if [ $IS_PYTHON -eq 1 ]; then
++#python{{{
++#display table ONLY if installation worked and there has been at leat one FAILURE or ERROR
++if [ $IS_INSTALL -eq 1 ] && [ $NUM_PYTHON_TOT -gt 1 ] && [ $NUM_PYTHON_SUC -ne $NUM_PYTHON_TOT ]
++then
++	cat << END >> report.html
++	<table $(echo $H2_STYLE)><tr><td $(echo $H2_FONT)>List of Python tests</td></tr></table>
++	<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
++	<tr> 
++	<th $(echo $BODY_FONT)>Result</th> 
++	<th $(echo $BODY_FONT)>Tolerance</th> 
++	<th $(echo $BODY_FONT)>Test id</th>  
++	<th $(echo $BODY_FONT)>Test name</th> 
++	<th $(echo $BODY_FONT)>Field checked</th>
++	</tr>
++	$(cat matlab_short.log | while read line
++do
++	echo "<tr>"
+ 
+-#Matlab error report
+-if [ -e matlaberror.log ]
+-then
+-	cat << END > matlaberror.html
++	#get status
++	STATUS=`echo $line | awk '{print $1}'`
++
++	#FAILURE
++	if [ "$STATUS" = "FAILURE" ]
++	then
++
++		FONTC=$(echo "$BODY_FONTC bgcolor=#ffff00");
++		FONTL=$(echo "$BODY_FONTL bgcolor=#ffff00");
++		echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" '
++		{ printf("<td %s id=FAILURE>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n\n",FONTL,$1,FONTC,$3,FONTC,$6,FONTL,$9,FONTL,$11);}
++		'; 
++
++	else
++
++		#SUCCESS
++		if [ "$STATUS" = "SUCCESS" ]
++		then
++			FONTC=$(echo "$BODY_FONTC bgcolor=#ddffdd")
++			FONTL=$(echo "$BODY_FONTL bgcolor=#ddffdd")
++			#do not write anything
++			#ERROR
++		else
++			FONTC=$(echo "$BODY_FONTC bgcolor=#ffdddd id=ERROR")
++			FONTL=$(echo "$BODY_FONTL bgcolor=#ffdddd")
++			echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" '
++			{ printf("<td %s>%s</td>\n<td %s>%s%s%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n\n",FONTL,$1,FONTL,$3,$4,$5,FONTC,$8,FONTL,$11,FONTL,$13);}
++			'; 
++		fi
++
++	fi
++	echo "</tr>"
++done
++)
++</table>
++<br>
++END
++fi
++#}}}
++fi
++
++#4. Error report
++if [ $IS_MATLAB -eq 1 ]; then
++#Matlab {{{
++cat << END >> report.html
+ <table $H2_STYLE><tr><td $H2_FONT>Matlab errors</td></tr></table>
+ <table $MATLAB_STYLE><tr><td $MATLAB_FONT>
+ <pre style="
+@@ -193,14 +279,12 @@
+ ">$(cat matlaberror.log)</pre>
+ </td></tr></table>
+ END
+-else
+-	mktemp matlaberror.html
++#}}}
+ fi
+-
+-#Matlab error report
+ if test -s petscerror.log
+ then
+-	cat << END > petscerror.html
++	#PETSc{{{
++cat << END >> report.html
+ <table $H2_STYLE><tr><td $H2_FONT>PETSc errors</td></tr></table>
+ <table $MATLAB_STYLE><tr><td $MATLAB_FONT>
+ <pre style="
+@@ -212,17 +296,14 @@
+ ">$(cat petscerror.log)</pre>
+ </td></tr></table>
+ END
+-else
+-	mktemp petscerror.html
++#}}}
+ fi
+ 
+-#last footer
+-cat << END > footer.html
++#last: footer
++#{{{
++cat << END >> report.html
+ <br>
+ <table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table>
+ </div>
+ END
+-
+-#concatenate files
+-cat summary.html content.html matlaberror.html petscerror.html footer.html > report.html
+-rm  summary.html content.html footer.html matlaberror.html petscerror.html matlab.log
++#}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13198-13199.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13198-13199.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13198-13199.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13198)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13199)
+@@ -362,9 +362,9 @@
+ 		#connectivity
+ 		md.mesh.elementconnectivity=numpy.tile(md.mesh.elementconnectivity,(numlayers-1,1))
+ 		md.mesh.elementconnectivity[numpy.nonzero(md.mesh.elementconnectivity==0)]=float('NaN')
+-		for i in xrange(1,numlayers):
+-			md.mesh.elementconnectivity[i*md.mesh.numberofelements2d+1:(i+1)*md.mesh.numberofelements2d,:] \
+-				=md.mesh.elementconnectivity[i*md.mesh.numberofelements2d+1:(i+1)*md.mesh.numberofelements2d,:]+md.mesh.numberofelements2d
++		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(numpy.isnan(md.mesh.elementconnectivity))]=0
+ 
+ 		#materials
Index: /issm/oecreview/Archive/12678-13393/ISSM-13199-13200.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13199-13200.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13199-13200.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13199)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13200)
+@@ -9,7 +9,7 @@
+ H2_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:25px; font-weight: bold;" align="left"'
+ TABLE_STYLE='width="700px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"'
+ TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px; font-weight: normal;" align="left"'
+-MATLAB_STYLE='width="9000px" rules=none'
++MATLAB_STYLE='width="900px" rules=none'
+ MATLAB_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="left"'
+ BODY_STYLE='width="700px"'
+ BODY_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px;"'
Index: /issm/oecreview/Archive/12678-13393/ISSM-13200-13201.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13200-13201.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13200-13201.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13200)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13201)
+@@ -106,7 +106,7 @@
+ else
+ 	echo "<tr><td $BODY_FONT>status: <span style=\"color:#ff0000\">Matlab crashed</span></td></tr>"
+ fi)
+-<tr><td $BODY_FONT>Total execution time: $EL_PYTHON</td></tr>
++<tr><td $BODY_FONT>Total execution time: $EL_MATLAB</td></tr>
+ <tr><td $BODY_FONT>Number of successes: $NUM_MATLAB_SUC/$NUM_MATLAB_TOT</td></tr>
+ <tr><td $BODY_FONT>Number of errors: $NUM_MATLAB_ERR/$NUM_MATLAB_TOT</td></tr>
+ <tr><td $BODY_FONT>Number of failures: $NUM_MATLAB_FAI/$NUM_MATLAB_TOT</td></tr>
Index: /issm/oecreview/Archive/12678-13393/ISSM-13201-13202.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13201-13202.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13201-13202.diff	(revision 13394)
@@ -0,0 +1,31 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13201)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13202)
+@@ -3,13 +3,13 @@
+ 
+ #style
+ #{{{
+-H1_STYLE='width="900px" cellpadding="20"'
++H1_STYLE='width="700px" cellpadding="5"'
+ H1_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:30px;" align="center"'
+-H2_STYLE='width="800px" cellpadding="20"'
++H2_STYLE='width="700px" cellpadding="5"'
+ H2_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:25px; font-weight: bold;" align="left"'
+-TABLE_STYLE='width="700px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"'
++TABLE_STYLE='width="680px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"'
+ TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px; font-weight: normal;" align="left"'
+-MATLAB_STYLE='width="900px" rules=none'
++MATLAB_STYLE='width="700px" rules=none'
+ MATLAB_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="left"'
+ BODY_STYLE='width="700px"'
+ BODY_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px;"'
+@@ -68,7 +68,7 @@
+ <td $TABLE_FONT>installation elapsed time: $EL_INSTALL</td>
+ </tr>
+ </table>
+-<br><hr width="900px">
++<br><hr width="700px">
+ END
+ # }}}
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13202-13203.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13202-13203.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13202-13203.diff	(revision 13394)
@@ -0,0 +1,23 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13202)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13203)
+@@ -265,7 +265,7 @@
+ fi
+ 
+ #4. Error report
+-if [ $IS_MATLAB -eq 1 ]; then
++if [ $IS_MATLAB -eq 1 ] && [ -s matlaberror.log ]; then
+ #Matlab {{{
+ cat << END >> report.html
+ <table $H2_STYLE><tr><td $H2_FONT>Matlab errors</td></tr></table>
+@@ -281,8 +281,7 @@
+ END
+ #}}}
+ fi
+-if test -s petscerror.log
+-then
++if [ -s petscerror.log ]; then
+ 	#PETSc{{{
+ cat << END >> report.html
+ <table $H2_STYLE><tr><td $H2_FONT>PETSc errors</td></tr></table>
Index: /issm/oecreview/Archive/12678-13393/ISSM-13203-13204.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13203-13204.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13203-13204.diff	(revision 13394)
@@ -0,0 +1,84 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-pleiades.sh	(revision 13203)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-pleiades.sh	(revision 13204)
+@@ -5,9 +5,9 @@
+ 
+ #Some cleanup
+ rm -rf Dakota
+-rm -rf src 
+-rm -rf install 
+-mkdir src install 
++rm -rf src
++rm -rf install
++mkdir src install
+ 
+ #Download from ISSM server
+ $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
+@@ -30,13 +30,13 @@
+ 
+ #Configure dakota
+ cd src
+-./configure \ 
+-	--prefix="$ISSM_DIR/externalpackages/dakota/install" \
+-	--without-graphics  \
+-	--with-pic \
+-	--disable-mpi \
+-	--with-blas="-L/nasa/intel/mkl/10.0.011/lib/64/ -lmkl -lmkl_lapack -liomp5 -lpthread" \
+-	--with-lapack="-L/nasa/intel/mkl/10.0.011/lib/64/ -lmkl -lmkl_lapack -liomp5 -lpthread" 
++./configure \
++--prefix="$ISSM_DIR/externalpackages/dakota/install/" \
++--without-graphics  \
++--with-pic \
++--disable-mpi \
++--with-blas="-L/nasa/intel/mkl/10.0.011/lib/64/ -lmkl -lmkl_lapack -liomp5 -lpthread" \
++--with-lapack="-L/nasa/intel/mkl/10.0.011/lib/64/ -lmkl -lmkl_lapack -liomp5 -lpthread"
+ cd ..
+ 
+ #Before compiling, if running on 64 bits, we need to active fPIC compilation. Some packages 
+@@ -52,19 +52,19 @@
+ mv temp ./src/methods/hopspack/src-nappspack/Makefile
+ 
+ cat ./src/methods/hopspack/src-cddlib/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
+-mv temp  ./src/methods/hopspack/src-cddlib/Makefile 
++mv temp  ./src/methods/hopspack/src-cddlib/Makefile
+ 
+ cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
+-mv temp  ./src/methods/hopspack/src-shared/Makefile 
++mv temp  ./src/methods/hopspack/src-shared/Makefile
+ 
+ cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
+-mv temp  ./src/methods/hopspack/src-shared/Makefile 
++mv temp  ./src/methods/hopspack/src-shared/Makefile
+ 
+ cat ./src/methods/hopspack/src-conveyor/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
+-mv temp  ./src/methods/hopspack/src-conveyor/Makefile 
++mv temp  ./src/methods/hopspack/src-conveyor/Makefile
+ 
+ cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
+-mv temp ./src/methods/hopspack/src-appspack/Makefile 
++mv temp ./src/methods/hopspack/src-appspack/Makefile
+ 
+ cat ./src/methods/acro/packages/colin/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
+ mv temp ./src/methods/acro/packages/colin/src/Makefile
+@@ -73,16 +73,16 @@
+ mv temp ./src/methods/acro/packages/coliny/src/Makefile
+ 
+ cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CFLAGS = -O2/CFLAGS = -O2 -fPIC/g' > temp
+-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile 
++mv temp  ./src/methods/acro/packages/tpl/3po/Makefile
+ 
+ cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CFLAGS = -O2 -fpermissive -fPIC/g' > temp
+-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile 
++mv temp  ./src/methods/acro/packages/tpl/3po/Makefile
+ 
+ cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
+-mv temp  ./src/packages/ampl/Makefile 
++mv temp  ./src/packages/ampl/Makefile
+ 
+ #Compile and install dakota
+-cd src 
++cd src
+ if [ -z $NUMCPUS ];
+ then
+ 	make
Index: /issm/oecreview/Archive/12678-13393/ISSM-13204-13205.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13204-13205.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13204-13205.diff	(revision 13394)
@@ -0,0 +1,23 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh	(revision 13204)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh	(revision 13205)
+@@ -17,15 +17,15 @@
+ ./config/configure.py \
+   --prefix="$ISSM_DIR/externalpackages/petsc/install" \
+   --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+-  --PETSC_ARCH=macosx-gnu \
++  --PETSC_ARCH="macosx-gnu" \
+   --with-mpi-dir="$ISSM_DIR/externalpackages/mpich2/install" \
+   --with-debugging=0 \
+-  --with-shared-libraries=0 \
++  --with-shared-libraries=1 \
+   --download-mumps=yes \
+   --download-scalapack=yes \
+   --download-blacs=yes \
+   --download-blas=yes \
+-  --download-plapack=yes  \
++  --download-plapack=no  \
+   --download-parmetis=yes \
+   --download-f-blas-lapack=yes 
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13205-13206.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13205-13206.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13205-13206.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-macosx64.sh	(revision 13205)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-macosx64.sh	(revision 13206)
+@@ -36,7 +36,7 @@
+    --with-pic \
+    --disable-mpi \
+    --with-blas="-L$ISSM_DIR/externalpackages/petsc/install/lib -lfblas " \
+-   --with-lapack="-L$ISSM_DIR/externalpackages/petsc/install/lib -lflapack -lPLAPACK "
++   --with-lapack="-L$ISSM_DIR/externalpackages/petsc/install/lib -lflapack "
+ cd ..
+ 
+ #Before compiling, if running on 64 bits, we need to active fPIC compilation. Some packages 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13206-13207.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13206-13207.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13206-13207.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-nicole.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-nicole.sh	(revision 13206)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-nicole.sh	(revision 13207)
+@@ -14,12 +14,9 @@
+ 	--with-petsc-arch=$ISSM_ARCH \
+ 	--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+ 	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+-	--with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install -lPLAPACK" \
+-	--with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
+ 	--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+-	--with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
+ 	--with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
+ 	--with-fortran-lib="/usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2/libgfortran.a" \
+ 	--with-math-lib="/usr/lib/libm.dylib" \
Index: /issm/oecreview/Archive/12678-13393/ISSM-13207-13208.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13207-13208.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13207-13208.diff	(revision 13394)
@@ -0,0 +1,32 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13207)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13208)
+@@ -27,19 +27,19 @@
+ 	fi
+ } #}}}
+ dylibpathprepend(){ #{{{
+-	if [ -d "$1" ] && [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
+-		export LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH"
++	if [ -d "$1" ] && [[ ":$DYLD_LIBRARY_PATH:" != *":$1:"* ]]; then
++		export DYLD_LIBRARY_PATH="$1:$DYLD_LIBRARY_PATH"
+ 	fi
+-	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
+-		export LD_RUN_PATH="$1:$LD_RUN_PATH"
++	if [ -d "$1" ] && [[ ":$DYLD_RUN_PATH:" != *":$1:"* ]]; then
++		export DYLD_RUN_PATH="$1:$DYLD_RUN_PATH"
+ 	fi
+ } #}}}
+ dylibpathappend(){ #{{{
+-	if [ -d "$1" ] && [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
+-		export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$1"
++	if [ -d "$1" ] && [[ ":$DYLD_LIBRARY_PATH:" != *":$1:"* ]]; then
++		export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$1"
+ 	fi
+-	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
+-		export LD_RUN_PATH="$LD_RUN_PATH:$1"
++	if [ -d "$1" ] && [[ ":$DYLD_RUN_PATH:" != *":$1:"* ]]; then
++		export DYLD_RUN_PATH="$DYLD_RUN_PATH:$1"
+ 	fi
+ } #}}}
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13208-13209.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13208-13209.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13208-13209.diff	(revision 13394)
@@ -0,0 +1,25 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13208)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13209)
+@@ -30,16 +30,16 @@
+ 	if [ -d "$1" ] && [[ ":$DYLD_LIBRARY_PATH:" != *":$1:"* ]]; then
+ 		export DYLD_LIBRARY_PATH="$1:$DYLD_LIBRARY_PATH"
+ 	fi
+-	if [ -d "$1" ] && [[ ":$DYLD_RUN_PATH:" != *":$1:"* ]]; then
+-		export DYLD_RUN_PATH="$1:$DYLD_RUN_PATH"
++	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
++		export LD_RUN_PATH="$1:$LD_RUN_PATH"
+ 	fi
+ } #}}}
+ dylibpathappend(){ #{{{
+ 	if [ -d "$1" ] && [[ ":$DYLD_LIBRARY_PATH:" != *":$1:"* ]]; then
+ 		export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$1"
+ 	fi
+-	if [ -d "$1" ] && [[ ":$DYLD_RUN_PATH:" != *":$1:"* ]]; then
+-		export DYLD_RUN_PATH="$DYLD_RUN_PATH:$1"
++	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
++		export LD_RUN_PATH="$LD_RUN_PATH:$1"
+ 	fi
+ } #}}}
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13209-13210.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13209-13210.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13209-13210.diff	(revision 13394)
@@ -0,0 +1,114 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13209)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13210)
+@@ -77,7 +77,7 @@
+ if [ $IS_INSTALL -eq 0 ]; then
+ 	cat << END >> report.html
+ 	<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+-	<tr><td $BODY_FONT>status: <span style=\"color:#ff0000\">Installation failed<\/span></td></tr>
++	<tr><td $BODY_FONTC>status: <span style=\"color:#ff0000\">Installation failed<\/span></td></tr>
+ 	</table>
+ 	<table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table>
+ 	</div>
+@@ -102,14 +102,14 @@
+ <table $H2_STYLE><tr><td $H2_FONT>Matlab tests</td></tr></table>
+ <table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+ $(if [ $CRASH_MATLAB -eq 0 ]; then
+-echo "<tr><td $BODY_FONT>status: <span style=\"color:#008000\">all test desks have been run</span></td></tr>"
++echo "<tr><td $BODY_FONTL>status: <span style=\"color:#008000\">all test desks have been run</span></td></tr>"
+ else
+-	echo "<tr><td $BODY_FONT>status: <span style=\"color:#ff0000\">Matlab crashed</span></td></tr>"
++	echo "<tr><td $BODY_FONTL>status: <span style=\"color:#ff0000\">Matlab crashed</span></td></tr>"
+ fi)
+-<tr><td $BODY_FONT>Total execution time: $EL_MATLAB</td></tr>
+-<tr><td $BODY_FONT>Number of successes: $NUM_MATLAB_SUC/$NUM_MATLAB_TOT</td></tr>
+-<tr><td $BODY_FONT>Number of errors: $NUM_MATLAB_ERR/$NUM_MATLAB_TOT</td></tr>
+-<tr><td $BODY_FONT>Number of failures: $NUM_MATLAB_FAI/$NUM_MATLAB_TOT</td></tr>
++<tr><td $BODY_FONTL>Total execution time: $EL_MATLAB</td></tr>
++<tr><td $BODY_FONTL>Number of successes: $NUM_MATLAB_SUC/$NUM_MATLAB_TOT</td></tr>
++<tr><td $BODY_FONTL>Number of errors: $NUM_MATLAB_ERR/$NUM_MATLAB_TOT</td></tr>
++<tr><td $BODY_FONTL>Number of failures: $NUM_MATLAB_FAI/$NUM_MATLAB_TOT</td></tr>
+ </table>
+ END
+ #}}}
+@@ -131,14 +131,14 @@
+ <table $H2_STYLE><tr><td $H2_FONT>Python tests</td></tr></table>
+ <table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+ $(if [ $CRASH_PYTHON -eq 0 ]; then
+-	echo "<tr><td $BODY_FONT>status: <span style=\"color:#008000\">all test desks have been run</span></td></tr>"
++	echo "<tr><td $BODY_FONTL>status: <span style=\"color:#008000\">all test desks have been run</span></td></tr>"
+ else
+-	echo "<tr><td $BODY_FONT>status: <span style=\"color:#ff0000\">Python crashed</span></td></tr>"
++	echo "<tr><td $BODY_FONTL>status: <span style=\"color:#ff0000\">Python crashed</span></td></tr>"
+ fi)
+-<tr><td $BODY_FONT>Total execution time: $EL_PYTHON</td></tr>
+-<tr><td $BODY_FONT>Number of successes: $NUM_PYTHON_SUC/$NUM_PYTHON_TOT</td></tr>
+-<tr><td $BODY_FONT>Number of errors: $NUM_PYTHON_ERR/$NUM_PYTHON_TOT</td></tr>
+-<tr><td $BODY_FONT>Number of failures: $NUM_PYTHON_FAI/$NUM_PYTHON_TOT</td></tr>
++<tr><td $BODY_FONTL>Total execution time: $EL_PYTHON</td></tr>
++<tr><td $BODY_FONTL>Number of successes: $NUM_PYTHON_SUC/$NUM_PYTHON_TOT</td></tr>
++<tr><td $BODY_FONTL>Number of errors: $NUM_PYTHON_ERR/$NUM_PYTHON_TOT</td></tr>
++<tr><td $BODY_FONTL>Number of failures: $NUM_PYTHON_FAI/$NUM_PYTHON_TOT</td></tr>
+ </table>
+ END
+ #}}}
+@@ -151,34 +151,28 @@
+ if [ $IS_INSTALL -eq 1 ] && [ $NUM_MATLAB_TOT -gt 1 ] && [ $NUM_MATLAB_SUC -ne $NUM_MATLAB_TOT ]
+ then
+ 	cat << END >> report.html
+-<table $(echo $H2_STYLE)><tr><td $(echo $H2_FONT)>List of Matlab tests</td></tr></table>
+-<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
++<table $H2_STYLE><tr><td $(echo $H2_FONT)>List of Matlab tests</td></tr></table>
++<table $BODY_STYLE style="border-collapse:collapse;">
+ <tr> 
+-<th $(echo $BODY_FONT)>Result</th> 
+-<th $(echo $BODY_FONT)>Tolerance</th> 
+-<th $(echo $BODY_FONT)>Test id</th>  
+-<th $(echo $BODY_FONT)>Test name</th> 
+-<th $(echo $BODY_FONT)>Field checked</th>
++<th $BODY_FONT>Result</th> 
++<th $BODY_FONT>Tolerance</th> 
++<th $BODY_FONT>Test id</th>  
++<th $BODY_FONT>Test name</th> 
++<th $BODY_FONT>Field checked</th>
+ </tr>
+ $(cat matlab_short.log | while read line
+   do
+ 	  echo "<tr>"
+-
+-	  #get status
+ 	  STATUS=`echo $line | awk '{print $1}'`
+-
+ 	  #FAILURE
+ 	  if [ "$STATUS" = "FAILURE" ]
+ 	  then
+-
+ 		  FONTC=$(echo "$BODY_FONTC bgcolor=#ffff00");
+ 		  FONTL=$(echo "$BODY_FONTL bgcolor=#ffff00");
+ 		  echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" '
+ 		  { printf("<td %s id=FAILURE>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n\n",FONTL,$1,FONTC,$3,FONTC,$6,FONTL,$9,FONTL,$11);}
+ 		  '; 
+-
+ 	  else
+-
+ 		  #SUCCESS
+ 		  if [ "$STATUS" = "SUCCESS" ]
+ 		  then
+@@ -213,11 +207,11 @@
+ 	<table $(echo $H2_STYLE)><tr><td $(echo $H2_FONT)>List of Python tests</td></tr></table>
+ 	<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+ 	<tr> 
+-	<th $(echo $BODY_FONT)>Result</th> 
+-	<th $(echo $BODY_FONT)>Tolerance</th> 
+-	<th $(echo $BODY_FONT)>Test id</th>  
+-	<th $(echo $BODY_FONT)>Test name</th> 
+-	<th $(echo $BODY_FONT)>Field checked</th>
++	<th $BODY_FONT>Result</th> 
++	<th $BODY_FONT>Tolerance</th> 
++	<th $BODY_FONT>Test id</th>  
++	<th $BODY_FONT>Test name</th> 
++	<th $BODY_FONT>Field checked</th>
+ 	</tr>
+ 	$(cat matlab_short.log | while read line
+ do
Index: /issm/oecreview/Archive/12678-13393/ISSM-13210-13211.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13210-13211.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13210-13211.diff	(revision 13394)
@@ -0,0 +1,639 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _SCOTCH_H
+ #define _SCOTCH_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void GmapUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h	(revision 13211)
+@@ -8,7 +8,7 @@
+ #ifdef HAVE_CONFIG_H
+ 	#include <config.h>
+ #else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+ /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _BAMGCONVERTMESH_H
+ #define _BAMGCONVERTMESH_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void BamgConvertMeshUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _KMLOVERLAY_H
+ #define _KMLOVERLAY_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void KMLOverlayUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13211)
+@@ -1,12 +1,16 @@
+-
+ /*
+ 	ContourToNodes.h
+ */
+ 
+-
+ #ifndef _CONTOURTONODES_H
+ #define _CONTOURTONODES_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void ContourToNodesUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h	(revision 13211)
+@@ -1,12 +1,16 @@
+-
+ /*
+ 	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
++
+ /* local prototypes: */
+ void HoleFillerUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h	(revision 13211)
+@@ -1,12 +1,16 @@
+-
+ /*
+ 	MeshProfileIntersection.h
+ */
+ 
+-
+ #ifndef _MESHPROFILEINTERSECTION_H
+ #define _MESHPROFILEINTERSECTION_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void MeshProfileIntersectionUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _INTERPFROMMESH3D_H
+ #define _INTERPFROMMESH3D_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void InterpFromMeshToMesh3dUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _LL2XY_H
+ #define _LL2XY_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void Ll2xyUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _BAMG_MESHER_H_
+ #define _BAMG_MESHER_H_
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void BamgMesherUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _InterpFromGridToMesh_H
+ #define _InterpFromGridToMesh_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void InterpFromGridToMeshUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h	(revision 13211)
+@@ -1,12 +1,16 @@
+-
+ /*
+ 	InterpFromMeshToGrid.h
+ */
+ 
+-
+ #ifndef _INTERPFROMMESHTOGRID_H
+ #define _INTERPFROMMESHTOGRID_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void InterpFromMeshToGridUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _KMLFILEREAD_H
+ #define _KMLFILEREAD_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void KMLFileReadUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _SHP2KML_H
+ #define _SHP2KML_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void Shp2KmlUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h	(revision 13211)
+@@ -1,12 +1,16 @@
+-
+ /*
+ 	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
++
+ /* local prototypes: */
+ void AverageFilterUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h	(revision 13211)
+@@ -5,6 +5,13 @@
+ #ifndef _TRIMESH_PROCESSRIFTS_H_
+ #define _TRIMESH_PROCESSRIFTS_H_
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++
+ #include "mex.h"
+ #include "triangle.h"
+ #include "string.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _EXP2KML_H
+ #define _EXP2KML_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void Exp2KmlUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _KML2EXP_H
+ #define _KML2EXP_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void Kml2ExpUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h	(revision 13211)
+@@ -1,12 +1,16 @@
+-
+ /*
+ 	PointCloudFindNeighbors.h
+ */
+ 
+-
+ #ifndef _POINTCLOUDFINDNEIGHBORS_H
+ #define _POINTCLOUDFINDNEIGHBORS_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void PointCloudFindNeighborsUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h	(revision 13211)
+@@ -1,12 +1,16 @@
+-
+ /*
+ 	PropagateFlagsFromConnectivity.h
+ */
+ 
+-
+ #ifndef _PROPAGATEFLAGSFROMCONNECTIVITY_H
+ #define _PROPAGATEFLAGSFROMCONNECTIVITY_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void PropagateFlagsFromConnectivityUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h	(revision 13211)
+@@ -4,6 +4,12 @@
+ #ifndef _TRIASEARCH_H
+ #define _TRIASEARCH_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void TriaSearchUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h	(revision 13211)
+@@ -1,12 +1,16 @@
+-
+ /*
+ 	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
++
+ /* local prototypes: */
+ void InternalFrontUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h	(revision 13211)
+@@ -1,12 +1,16 @@
+-
+ /*
+ 	MeshPartition.h
+ */
+ 
+-
+ #ifndef _MESHPARTITION_H
+ #define _MESHPARTITION_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void MeshPartitionUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _INTERPFROMMESH2D_H
+ #define _INTERPFROMMESH2D_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void InterpFromMesh2dUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h	(revision 13211)
+@@ -8,7 +8,7 @@
+ #ifdef HAVE_CONFIG_H
+ 	#include <config.h>
+ #else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+ /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _KRIGING_H_
+ #define _KRIGING_H_
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void KrigingUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h	(revision 13211)
+@@ -6,9 +6,9 @@
+ #define _ENUMTOSTRING_H
+ 
+ #ifdef HAVE_CONFIG_H
+-#include <config.h>
++	#include <config.h>
+ #else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+ /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h	(revision 13211)
+@@ -6,9 +6,9 @@
+ #define _STRINGTOENUM_H
+ 
+ #ifdef HAVE_CONFIG_H
+-#include <config.h>
++	#include <config.h>
+ #else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+ /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _BAMGTRIANGULATE_H
+ #define _BAMGTRIANGULATE_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void BamgTriangulateUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h	(revision 13211)
+@@ -8,7 +8,7 @@
+ #ifdef HAVE_CONFIG_H
+ 	#include <config.h>
+ #else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+ /* local prototypes: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13211)
+@@ -1,17 +1,14 @@
+-
+ /*
+ 	ContourToMesh.h
+ */
+ 
+-
+ #ifndef _CONTOURTOMESH_H
+ #define _CONTOURTOMESH_H
+ 
+-
+ #ifdef HAVE_CONFIG_H
+ 	#include <config.h>
+ #else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+ /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h	(revision 13211)
+@@ -5,6 +5,13 @@
+ #ifndef _XY2LL_H
+ #define _XY2LL_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++
+ /* local prototypes: */
+ void Xy2llUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _KMLMESHWRITE_H
+ #define _KMLMESHWRITE_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void KMLMeshWriteUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 13211)
+@@ -8,7 +8,7 @@
+ #ifdef HAVE_CONFIG_H
+ 	#include <config.h>
+ #else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+ /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h	(revision 13210)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h	(revision 13211)
+@@ -5,6 +5,12 @@
+ #ifndef _CHACO_H
+ #define _CHACO_H
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
+ /* local prototypes: */
+ void ChacoUsage(void);
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13211-13212.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13211-13212.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13211-13212.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4	(revision 13211)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4	(revision 13212)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4
+___________________________________________________________________
+Modified: svn:ignore
+## -1 +1,5 ##
+-
++ltsugar.m4
++libtool.m4
++ltversion.m4
++lt~obsolete.m4
++ltoptions.m4
Index: /issm/oecreview/Archive/12678-13393/ISSM-13212-13213.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13212-13213.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13212-13213.diff	(revision 13394)
@@ -0,0 +1,555 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void GmapUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h	(revision 13213)
+@@ -11,7 +11,7 @@
+ 	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-/*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
++/*For python modules: needs to come before header files inclusion*/
+ #ifdef _HAVE_PYTHON_
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void BamgConvertMeshUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void KMLOverlayUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void ContourToNodesUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void HoleFillerUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void MeshProfileIntersectionUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void InterpFromMeshToMesh3dUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void Ll2xyUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void BamgMesherUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void InterpFromGridToMeshUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void InterpFromMeshToGridUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void KMLFileReadUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void Shp2KmlUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void AverageFilterUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h	(revision 13213)
+@@ -11,6 +11,10 @@
+ 	#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 "mex.h"
+ #include "triangle.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void Exp2KmlUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void Kml2ExpUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void PointCloudFindNeighborsUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void PropagateFlagsFromConnectivityUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h	(revision 13213)
+@@ -10,6 +10,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void TriaSearchUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void InternalFrontUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void MeshPartitionUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void InterpFromMesh2dUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h	(revision 13213)
+@@ -11,7 +11,7 @@
+ 	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-/*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
++/*For python modules: needs to come before header files inclusion*/
+ #ifdef _HAVE_PYTHON_
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void KrigingUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h	(revision 13213)
+@@ -11,7 +11,7 @@
+ 	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-/*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
++/*For python modules: needs to come before header files inclusion*/
+ #ifdef _HAVE_PYTHON_
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h	(revision 13213)
+@@ -11,7 +11,7 @@
+ 	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-/*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
++/*For python modules: needs to come before header files inclusion*/
+ #ifdef _HAVE_PYTHON_
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void BamgTriangulateUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h	(revision 13213)
+@@ -11,14 +11,14 @@
+ 	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-/* local prototypes: */
+-void InterpFromMeshToMesh2dUsage(void);
+-
+-/*If python: this macro needs to come before header files inclusion*/
++/*For python modules: needs to come before header files inclusion*/
+ #ifdef _HAVE_PYTHON_
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
++/* local prototypes: */
++void InterpFromMeshToMesh2dUsage(void);
++
+ /*Header files: */
+ #include "../../c/include/globals.h"
+ #include "../../c/toolkits/toolkits.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13213)
+@@ -11,7 +11,7 @@
+ 	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-/*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
++/*For python modules: needs to come before header files inclusion*/
+ #ifdef _HAVE_PYTHON_
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h	(revision 13213)
+@@ -11,6 +11,10 @@
+ 	#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
+ 
+ /* local prototypes: */
+ void Xy2llUsage(void);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h	(revision 13213)
+@@ -11,6 +11,11 @@
+ 	#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
++
+ /* local prototypes: */
+ void KMLMeshWriteUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 13213)
+@@ -11,7 +11,7 @@
+ 	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-/*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
++/*For python modules: needs to come before header files inclusion*/
+ #ifdef _HAVE_PYTHON_
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h	(revision 13212)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h	(revision 13213)
+@@ -11,13 +11,18 @@
+ 	#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
++
+ /* local prototypes: */
+ void ChacoUsage(void);
+ 
++/*headers*/
+ #include <stdio.h>
+ #include <string.h>    /*  strcasecmp  */
+ #include <time.h>      /*  clock,time,difftime  */
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
Index: /issm/oecreview/Archive/12678-13393/ISSM-13213-13214.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13213-13214.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13213-13214.diff	(revision 13394)
@@ -0,0 +1,831 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h	(revision 13214)
+@@ -5,17 +5,6 @@
+ #ifndef _SCOTCH_H
+ #define _SCOTCH_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
+-
+ /* local prototypes: */
+ void GmapUsage(void);
+ 
+@@ -34,18 +23,17 @@
+ 
+ /*  Scotch structures and prototypes  */
+ #ifdef MATLAB
+-		#include "mat.h"
+-		#include "mex.h"
+-		#include "matrix.h"
++#include "mat.h"
++#include "mex.h"
++#include "matrix.h"
+ 
+-		#define printf mexPrintf
+-		#define fprintf(file,...) (file == stdout || file == stderr ? mexPrintf(__VA_ARGS__) : fprintf(file,__VA_ARGS__))
+-		#define malloc mxMalloc
+-		#define calloc mxCalloc
+-		#define realloc mxRealloc
+-		#define free mxFree
+-		#define exit(status) mexErrMsgTxt("exit=" #status)
++#define printf mexPrintf
++#define fprintf(file,...) (file == stdout || file == stderr ? mexPrintf(__VA_ARGS__) : fprintf(file,__VA_ARGS__))
++#define malloc mxMalloc
++#define calloc mxCalloc
++#define realloc mxRealloc
++#define free mxFree
++#define exit(status) mexErrMsgTxt("exit=" #status)
+ #endif
+ 
+-
+ #endif  /* _SCOTCH_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13214)
+@@ -28,7 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "BamgConvertMesh"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define INDEXHANDLE prhs[0]
+ #define XHANDLE prhs[1]
+@@ -37,6 +37,7 @@
+ /* serial output macros: */
+ #define BAMGMESHOUT    (mxArray**)&plhs[0]
+ #define BAMGGEOMOUT    (mxArray**)&plhs[1]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h	(revision 13214)
+@@ -28,12 +28,13 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "KMLOverlay"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define FILENAME      prhs[0]
+ 
+ /* serial output macros: */
+ #define ERRORFLAG (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NRHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13214)
+@@ -28,11 +28,7 @@
+ #undef __FUNCT__
+ #define __FUNCT__ "ContourToNodes"
+ 
+-
+-#ifndef ALL
+-#define ALL 0
+-#endif
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* input macros: */
+ #define XHANDLE prhs[0]
+ #define YHANDLE prhs[1]
+@@ -41,6 +37,7 @@
+ 
+ /* serial output macros: */
+ #define FLAGS (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+@@ -48,6 +45,5 @@
+ #undef NRHS
+ #define NRHS 4
+ 
+-
+ #endif  /* _CONTOURTONODES_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h	(revision 13214)
+@@ -28,13 +28,14 @@
+ #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 &plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h	(revision 13214)
+@@ -28,6 +28,7 @@
+ #undef __FUNCT__
+ #define __FUNCT__ "MeshProfileIntersection"
+ 
++#ifdef _HAVE_MATLAB_MODULES_
+ /* input macros: */
+ #define INDEX prhs[0]
+ #define X prhs[1]
+@@ -36,6 +37,7 @@
+ 
+ /* serial output macros: */
+ #define SEGMENTS (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h	(revision 13214)
+@@ -28,10 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "InterpFromMeshToMesh3d"
+ 
+-#undef CLEANUP
+-#define CLEANUP InterpFromMeshToMesh3dLocalCleanup();
+-
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define INDEXHANDLE prhs[0]
+ #define XHANDLE prhs[1]
+@@ -45,6 +42,7 @@
+ 
+ /* serial output macros: */
+ #define DATAPRIME (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h	(revision 13214)
+@@ -28,7 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "Ll2xy"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define LAT_IN    prhs[0]
+ #define LON_IN    prhs[1]
+@@ -37,6 +37,7 @@
+ /* serial output macros: */
+ #define X_OUT    (mxArray**)&plhs[0]
+ #define Y_OUT    (mxArray**)&plhs[1]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NRHS
+@@ -45,4 +46,3 @@
+ #define NLHS  2
+ 
+ #endif
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h	(revision 13214)
+@@ -27,7 +27,8 @@
+ 
+ #undef __FUNCT__ 
+ #define __FUNCT__  "BamgMesher"
+-    
++
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define BAMGMESHIN  (mxArray*)prhs[0]
+ #define BAMGGEOMIN  (mxArray*)prhs[1]
+@@ -36,6 +37,7 @@
+ /* serial output macros: */
+ #define BAMGMESHOUT    (mxArray**)&plhs[0]
+ #define BAMGGEOMOUT    (mxArray**)&plhs[1]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+@@ -44,4 +46,3 @@
+ #define NRHS  3
+ 
+ #endif  /* _BAMG_MESHER_H_ */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 13214)
+@@ -28,10 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "InterpFromGridToMesh"
+ 
+-#undef CLEANUP
+-#define CLEANUP InterpFromGridToMeshLocalCleanup();
+-
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define XHANDLE prhs[0]
+ #define YHANDLE prhs[1]
+@@ -43,6 +40,7 @@
+ 
+ /* serial output macros: */
+ #define DATAMESH (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h	(revision 13214)
+@@ -28,6 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "InterpFromMeshToGrid"
+ 
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define INDEX (mxArray*)prhs[0]
+ #define X (mxArray*)prhs[1]
+@@ -45,6 +46,7 @@
+ #define XM (mxArray**)&plhs[0]
+ #define YM (mxArray**)&plhs[1]
+ #define GRIDDATA (mxArray**)&plhs[2]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h	(revision 13214)
+@@ -28,12 +28,13 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "KMLFileRead"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define FILENAME      prhs[0]
+ 
+ /* serial output macros: */
+ #define ERRORFLAG (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NRHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h	(revision 13214)
+@@ -28,7 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "Shp2Kml"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define SHP_IN    prhs[0]
+ #define KML_IN    prhs[1]
+@@ -36,6 +36,7 @@
+ 
+ /* serial output macros: */
+ #define RET_OUT    (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NRHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h	(revision 13214)
+@@ -28,13 +28,14 @@
+ #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 &plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h	(revision 13214)
+@@ -5,17 +5,6 @@
+ #ifndef _TRIMESH_PROCESSRIFTS_H_
+ #define _TRIMESH_PROCESSRIFTS_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 "mex.h"
+ #include "triangle.h"
+ #include "string.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h	(revision 13214)
+@@ -28,7 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "Exp2Kml"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define EXP_IN    prhs[0]
+ #define KML_IN    prhs[1]
+@@ -36,6 +36,7 @@
+ 
+ /* serial output macros: */
+ #define RET_OUT    (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NRHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h	(revision 13214)
+@@ -28,7 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "Kml2Exp"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define KML_IN    prhs[0]
+ #define EXP_IN    prhs[1]
+@@ -36,6 +36,7 @@
+ 
+ /* serial output macros: */
+ #define RET_OUT    (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NRHS
+@@ -44,4 +45,3 @@
+ #define NLHS  1
+ 
+ #endif
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h	(revision 13214)
+@@ -28,11 +28,7 @@
+ #undef __FUNCT__
+ #define __FUNCT__ "PointCloudFindNeighbors"
+ 
+-
+-#ifndef ALL
+-#define ALL 0
+-#endif
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* input macros: */
+ #define XHANDLE prhs[0]
+ #define YHANDLE prhs[1]
+@@ -41,6 +37,7 @@
+ 
+ /* serial output macros: */
+ #define FLAGS (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+@@ -48,6 +45,4 @@
+ #undef NRHS
+ #define NRHS 4
+ 
+-
+ #endif  /* _POINTCLOUDFINDNEIGHBORS_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h	(revision 13214)
+@@ -28,6 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "PropagateFlagsFromConnectivity"
+ 
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define CONNECTIVITY (mxArray*)prhs[0]
+ #define POOL (mxArray*)prhs[1]
+@@ -36,6 +37,7 @@
+ 
+ /* serial output macros: */
+ #define POOLOUT (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+@@ -43,7 +45,4 @@
+ #undef NRHS
+ #define NRHS  4
+ 
+-
+ #endif  /* _PROPAGATEFLAGSFROMCONNECTIVITY_H */
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h	(revision 13214)
+@@ -27,7 +27,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "TriaSearch"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define INDEXHANDLE prhs[0]
+ #define XHANDLE prhs[1]
+@@ -37,11 +37,11 @@
+ 
+ /* serial output macros: */
+ #define TRIA (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+-
+ #undef NRHS
+ #define NRHS  5
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h	(revision 13214)
+@@ -27,11 +27,13 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "InternalFront"
+ 
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define MODEL (mxArray*)prhs[0]
+ 
+ /* serial output macros: */
+ #define FRONT (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h	(revision 13214)
+@@ -31,6 +31,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "MeshPartition"
+ 
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define MODEL (mxArray*)prhs[0]
+ #define NUMAREAS (mxArray*)prhs[1]
+@@ -38,6 +39,7 @@
+ /* serial output macros: */
+ #define ELEMENTPARTITIONING (mxArray**)&plhs[0]
+ #define NODEPARTITIONING (mxArray**)&plhs[1]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h	(revision 13214)
+@@ -28,9 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "InterpFromMesh2d"
+ 
+-#undef CLEANUP
+-#define CLEANUP InterpFromMesh2dLocalCleanup();
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define INDEXHANDLE prhs[0]
+ #define XHANDLE prhs[1]
+@@ -43,6 +41,7 @@
+ 
+ /* serial output macros: */
+ #define DATAPRIME (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h	(revision 13214)
+@@ -27,6 +27,9 @@
+ #include "../../c/io/io.h"
+ #include "../../c/EnumDefinitions/EnumDefinitions.h"
+ 
++#undef __FUNCT__ 
++#define __FUNCT__  "ElementConnectivity"
++
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ /* serial input macros: */
+@@ -45,9 +48,6 @@
+ #define ELEMENTCONNECTIVITY output,0
+ #endif
+ 
+-#undef __FUNCT__ 
+-#define __FUNCT__  "ElementConnectivity"
+-
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h	(revision 13214)
+@@ -26,7 +26,8 @@
+ 
+ #undef __FUNCT__ 
+ #define __FUNCT__  "Kriging"
+-    
++
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define X            (mxArray *)prhs[0]
+ #define Y            (mxArray *)prhs[1]
+@@ -37,6 +38,7 @@
+ /* serial output macros: */
+ #define PREDICTIONS (mxArray**)&plhs[0]
+ #define ERROR       (mxArray**)&plhs[1]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.cpp	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.cpp	(revision 13214)
+@@ -28,8 +28,7 @@
+ 	MODULEEND();
+ }
+ 
+-void EnumToStringUsage(void)
+-{
++void EnumToStringUsage(void){
+ 	_pprintLine_("");
+ 	_pprintLine_("   usage: " << __FUNCT__ << "string = EnumToString(enum);");
+ 	_pprintLine_("");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h	(revision 13214)
+@@ -22,7 +22,10 @@
+ #include "../../c/Container/Container.h"
+ #include "../../c/shared/shared.h"
+ #include "../../c/issm-binding.h"
+-    
++
++#undef __FUNCT__ 
++#define __FUNCT__  "EnumToString"
++ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define ENUMIN (mxArray*)prhs[0]
+@@ -43,9 +46,6 @@
+ #undef NRHS
+ #define NRHS  1
+ 
+-#undef __FUNCT__ 
+-#define __FUNCT__  "EnumToString"
+-
+ /* local prototypes: */
+ void EnumToStringUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h	(revision 13214)
+@@ -22,6 +22,9 @@
+ #include "../../c/Container/Container.h"
+ #include "../../c/shared/shared.h"
+ #include "../../c/issm-binding.h"
++
++#undef __FUNCT__ 
++#define __FUNCT__  "StringToEnum"
+     
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+@@ -43,9 +46,6 @@
+ #undef NRHS
+ #define NRHS  1
+ 
+-#undef __FUNCT__ 
+-#define __FUNCT__  "StringToEnum"
+-
+ /* local prototypes: */
+ void StringToEnumUsage(void);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h	(revision 13214)
+@@ -28,13 +28,14 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "BamgTriangulate"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define XHANDLE prhs[0]
+ #define YHANDLE prhs[1]
+ 
+ /* serial output macros: */
+ #define INDEX (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13214)
+@@ -27,6 +27,9 @@
+ #include "../../c/io/io.h"
+ #include "../../c/EnumDefinitions/EnumDefinitions.h"
+ 
++#undef __FUNCT__
++#define __FUNCT__ "ContourToMesh"
++
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define INDEX (mxArray *)prhs[0]
+@@ -53,9 +56,6 @@
+ #define PLHS1 output,1
+ #endif
+ 
+-#undef __FUNCT__
+-#define __FUNCT__ "ContourToMesh"
+-
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h	(revision 13214)
+@@ -28,7 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "Xy2ll"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define X_IN      prhs[0]
+ #define Y_IN      prhs[1]
+@@ -37,6 +37,7 @@
+ /* serial output macros: */
+ #define LAT_OUT    (mxArray**)&plhs[0]
+ #define LON_OUT    (mxArray**)&plhs[1]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NRHS
+@@ -45,4 +46,3 @@
+ #define NLHS  2
+ 
+ #endif
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h	(revision 13214)
+@@ -28,7 +28,7 @@
+ #undef __FUNCT__ 
+ #define __FUNCT__  "KMLMeshWrite"
+ 
+-
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define NAME          prhs[0]
+ #define NOTES         prhs[1]
+@@ -43,6 +43,7 @@
+ 
+ /* serial output macros: */
+ #define ERRORFLAG (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NRHS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 13214)
+@@ -27,6 +27,9 @@
+ #include "../../c/io/io.h"
+ #include "../../c/EnumDefinitions/EnumDefinitions.h"
+ 
++#undef __FUNCT__ 
++#define __FUNCT__  "TriMesh"
++
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define DOMAINOUTLINE  (mxArray *)prhs[0]
+@@ -53,9 +56,6 @@
+ #define SEGMENTMARKERLIST output,4
+ #endif
+ 
+-#undef __FUNCT__ 
+-#define __FUNCT__  "TriMesh"
+-
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  5
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h	(revision 13213)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h	(revision 13214)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void ChacoUsage(void);
+-
+ /*headers*/
+ #include <stdio.h>
+ #include <string.h>    /*  strcasecmp  */
+@@ -28,7 +25,14 @@
+ #include "../../c/Container/Container.h"
+ #include "../../c/shared/shared.h"
+ #include "../../c/issm-binding.h"
+-    
++
++/* local prototypes: */
++void ChacoUsage(void);
++
++#undef __FUNCT__ 
++#define __FUNCT__  "Chaco"
++
++#ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define A_IN (mxArray*)prhs[0]
+ #define VWGTS_IN (mxArray*)prhs[1]
+@@ -42,6 +46,7 @@
+ 
+ /* serial output macros: */
+ #define ASSGN_OUT (mxArray**)&plhs[0]
++#endif
+ 
+ /* serial arg counts: */
+ #undef NLHS
+@@ -49,7 +54,4 @@
+ #undef NRHS
+ #define NRHS  9
+ 
+-#undef __FUNCT__ 
+-#define __FUNCT__  "Chaco"
+-
+ #endif  /* _CHACO_H */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13214-13215.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13214-13215.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13214-13215.diff	(revision 13394)
@@ -0,0 +1,66 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13214)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13215)
+@@ -503,6 +503,7 @@
+ 	/*}}}*/
+ 	/*Options{{{1*/
+ 	OptionEnum,
++	GenericOptionEnum,
+ 	OptionCellEnum,
+ 	OptionCharEnum,
+ 	OptionStructEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13214)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13215)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=465;
++macro=466;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/GenericOptionEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/GenericOptionEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/GenericOptionEnum.m	(revision 13215)
+@@ -0,0 +1,11 @@
++function macro=GenericOptionEnum()
++%GENERICOPTIONENUM - Enum of GenericOption
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=GenericOptionEnum()
++
++macro=StringToEnum('GenericOption');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13214)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13215)
+@@ -4588,6 +4588,16 @@
+ 
+ 	return StringToEnum('Option')[0]
+ 
++def GenericOptionEnum():
++	"""
++	GENERICOPTIONENUM - Enum of GenericOption
++
++	   Usage:
++	      macro=GenericOptionEnum()
++	"""
++
++	return StringToEnum('GenericOption')[0]
++
+ def OptionCellEnum():
+ 	"""
+ 	OPTIONCELLENUM - Enum of OptionCell
+@@ -4666,5 +4676,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 465
++	return 466
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13215-13216.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13215-13216.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13215-13216.diff	(revision 13394)
@@ -0,0 +1,9067 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/convergence.cpp	(revision 13216)
+@@ -7,17 +7,17 @@
+ #include "../io/io.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ 
+-void convergence(bool* pconverged, Matrix* Kff,Vector* pf,Vector* uf,Vector* old_uf,Parameters* parameters){
++void convergence(bool* pconverged, Matrix<IssmDouble>* Kff,Vector<IssmDouble>* pf,Vector<IssmDouble>* uf,Vector<IssmDouble>* old_uf,Parameters* parameters){
+ 
+ 	/*output*/
+ 	bool converged=false;
+ 
+ 	/*intermediary*/
+-	Vector* KU=NULL;
+-	Vector* KUF=NULL;
+-	Vector* KUold=NULL;
+-	Vector* KUoldF=NULL;
+-	Vector* duf=NULL;
++	Vector<IssmDouble>* KU=NULL;
++	Vector<IssmDouble>* KUF=NULL;
++	Vector<IssmDouble>* KUold=NULL;
++	Vector<IssmDouble>* KUoldF=NULL;
++	Vector<IssmDouble>* duf=NULL;
+ 	IssmDouble ndu,nduinf,nu;
+ 	IssmDouble nKUF;
+ 	IssmDouble nKUoldF;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/solutions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/solutions.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/solutions.h	(revision 13216)
+@@ -32,7 +32,7 @@
+ IssmDouble objectivefunction(IssmDouble search_scalar,OptArgs* optargs);
+ 
+ //convergence:
+-void convergence(bool* pconverged, Matrix* K_ff,Vector* p_f,Vector* u_f,Vector* u_f_old,Parameters* parameters);
++void convergence(bool* pconverged, Matrix<IssmDouble>* K_ff,Vector<IssmDouble>* p_f,Vector<IssmDouble>* u_f,Vector<IssmDouble>* u_f_old,Parameters* parameters);
+ bool controlconvergence(IssmDouble J,IssmDouble tol_cm);
+ bool steadystateconvergence(FemModel* femmodel);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 13216)
+@@ -17,9 +17,9 @@
+ 	/*Intermediaries*/
+ 	IssmDouble  norm_inf;
+ 	IssmDouble *norm_list    = NULL;
+-	Vector*     new_gradient = NULL;
+-	Vector*     gradient     = NULL;
+-	Vector*     old_gradient = NULL;
++	Vector<IssmDouble>*     new_gradient = NULL;
++	Vector<IssmDouble>*     gradient     = NULL;
++	Vector<IssmDouble>*     old_gradient = NULL;
+ 
+ 	/*Compute gradient*/
+ 	if(VerboseControl()) _pprintLine_("   compute cost function gradient");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ResetBoundaryConditions.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ResetBoundaryConditions.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ResetBoundaryConditions.cpp	(revision 13216)
+@@ -10,7 +10,7 @@
+ void ResetBoundaryConditions(FemModel* femmodel, int analysis_type){
+ 	
+ 	/*variables: */
+-	Vector*    yg    = NULL;
++	Vector<IssmDouble>*    yg    = NULL;
+ 	Nodes *nodes = NULL;
+ 	int    i;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToSeqMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToSeqMat.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToSeqMat.cpp	(revision 13216)
+@@ -18,11 +18,11 @@
+ 
+ /*}}}*/
+ 
+-SeqMat* MatlabMatrixToSeqMat(const mxArray* dataref){
++SeqMat<double>* MatlabMatrixToSeqMat(const mxArray* dataref){
+ 
+-	SeqMat* output=NULL;
++	SeqMat<double>* output=NULL;
+ 
+-	output=new SeqMat();
++	output=new SeqMat<double>();
+ 	MatlabMatrixToDoubleMatrix(&output->matrix,&output->M,&output->N,dataref);
+ 	return output;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 13216)
+@@ -14,13 +14,12 @@
+ #include "../../include/include.h"
+ #include "./matlabio.h"
+ 
+-/*FUNCTION OptionDoubleParse {{{*/
+-OptionDouble* OptionDoubleParse( char* name, const mxArray* prhs[]){
++GenericOption<double*>* OptionDoubleParse( char* name, const mxArray* prhs[]){ /*{{{*/
+ 
+-	OptionDouble *odouble = NULL;
++	GenericOption<double*> *odouble = NULL;
+ 
+ 	/*check and parse the name  */
+-	odouble=new OptionDouble;
++	odouble=new GenericOption<double*>();
+ 	odouble->name =xNew<char>(strlen(name)+1);
+ 	memcpy(odouble->name,name,(strlen(name)+1)*sizeof(char));
+ 
+@@ -28,17 +27,16 @@
+ 	if (!mxIsClass(prhs[0],"double")){
+ 		_error_("Value of option \"" << odouble->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+-	FetchData(&odouble->values,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]);
++	FetchData(&odouble->value,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]);
+ 
+ 	return(odouble);
+ }/*}}}*/
+-/*FUNCTION OptionLogicalParse {{{*/
+-OptionLogical* OptionLogicalParse( char* name, const mxArray* prhs[]){
++GenericOption<bool*>* OptionLogicalParse( char* name, const mxArray* prhs[]){ /*{{{*/
+ 
+-	OptionLogical *ological = NULL;
++	GenericOption<bool*> *ological = NULL;
+ 
+ 	/*check and parse the name  */
+-	ological=new OptionLogical;
++	ological=new GenericOption<bool*>();
+ 	ological->name =xNew<char>(strlen(name)+1);
+ 	memcpy(ological->name,name,(strlen(name)+1)*sizeof(char));
+ 
+@@ -46,17 +44,16 @@
+ 	if (!mxIsClass(prhs[0],"logical")){
+ 		_error_("Value of option \"" << ological->name  << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+-	FetchData(&ological->values,&ological->numel,&ological->ndims,&ological->size,prhs[0]);
++	FetchData(&ological->value,&ological->numel,&ological->ndims,&ological->size,prhs[0]);
+ 
+ 	return(ological);
+ }/*}}}*/
+-/*FUNCTION OptionCharParse {{{*/
+-OptionChar* OptionCharParse( char* name, const mxArray* prhs[]){
++GenericOption<char*>* OptionCharParse( char* name, const mxArray* prhs[]){ /*{{{*/
+ 
+-	OptionChar  *ochar = NULL;
++	GenericOption<char*>  *ochar = NULL;
+ 
+ 	/*check and parse the name  */
+-	ochar=new OptionChar();
++	ochar=new GenericOption<char*>();
+ 	ochar->name =xNew<char>(strlen(name)+1);
+ 	memcpy(ochar->name,name,(strlen(name)+1)*sizeof(char));
+ 
+@@ -64,23 +61,22 @@
+ 	if (!mxIsClass(prhs[0],"char")){
+ 		_error_("Value of option \"" << ochar->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+ 	}
+-	FetchData(&ochar->values,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]);
++	FetchData(&ochar->value,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]);
+ 
+ 	return(ochar);
+ }/*}}}*/
+-/*FUNCTION OptionStructParse {{{*/
+-OptionStruct* OptionStructParse( char* name, const mxArray* prhs[]){
++GenericOption<Options**>* OptionStructParse( char* name, const mxArray* prhs[]){ /*{{{*/
+ 
+ 	int            i;
+ 	char           namei[161];
+-	OptionStruct  *ostruct    = NULL;
+-	Option        *option     = NULL;
++	Option*                   option      = NULL;
++	GenericOption<Options**>  *ostruct    = NULL;
+ 	const mwSize  *ipt        = NULL;
+ 	const mxArray *structi;
+ 	mwIndex        sindex;
+ 
+ 	/*check and parse the name  */
+-	ostruct=new OptionStruct;
++	ostruct=new GenericOption<Options**>();
+ 	ostruct->name =xNew<char>(strlen(name)+1);
+ 	memcpy(ostruct->name,name,(strlen(name)+1)*sizeof(char));
+ 
+@@ -93,11 +89,11 @@
+ 	ipt           =mxGetDimensions(prhs[0]);
+ 	ostruct->size =xNew<int>(ostruct->ndims);
+ 	for (i=0; i<ostruct->ndims; i++) ostruct->size[i]=(int)ipt[i];
+-	if (ostruct->numel) ostruct->values=xNew<Options*>(ostruct->numel);
++	if (ostruct->numel) ostruct->value=xNew<Options*>(ostruct->numel);
+ 
+ 	/*loop through and process each element of the struct array  */
+ 	for (sindex=0; sindex<ostruct->numel; sindex++) {
+-		ostruct->values[sindex]=new Options;
++		ostruct->value[sindex]=new Options;
+ 
+ 		/*loop through and process each field for the element  */
+ 		for (i=0; i<mxGetNumberOfFields(prhs[0]); i++) {
+@@ -105,28 +101,27 @@
+ 			structi=mxGetFieldByNumber(prhs[0],sindex,i);
+ 
+ 			option=(Option*)OptionParse(namei,&structi);
+-			ostruct->values[sindex]->AddObject((Object*)option);
++			ostruct->value[sindex]->AddObject((Object*)option);
+ 			option=NULL;
+ 		}
+ 	}
+ 
+ 	return(ostruct);
+ }/*}}}*/
+-/*FUNCTION OptionCellParse {{{*/
+-OptionCell* OptionCellParse( char* name, const mxArray* prhs[]){
++GenericOption<Options*>* OptionCellParse( char* name, const mxArray* prhs[]){ /*{{{*/
+ 
+ 	int            i;
+ 	int           *dims;
+ 	char           namei[161];
+ 	char           cstr[81];
+-	OptionCell    *ocell      = NULL;
++	GenericOption<Options*> *ocell      = NULL;
+ 	Option        *option     = NULL;
+ 	const mwSize  *ipt        = NULL;
+ 	const mxArray *celli;
+ 	mwIndex        cindex;
+ 
+ 	/*check and parse the name  */
+-	ocell=new OptionCell;
++	ocell=new GenericOption<Options*>();
+ 	ocell->name =xNew<char>(strlen(name)+1);
+ 	memcpy(ocell->name,name,(strlen(name)+1)*sizeof(char));
+ 
+@@ -140,7 +135,7 @@
+ 	ipt         =mxGetDimensions(prhs[0]);
+ 	ocell->size =xNew<int>(ocell->ndims);
+ 	for (i=0; i<ocell->ndims; i++) ocell->size[i]=(int)ipt[i];
+-	ocell->values=new Options;
++	ocell->value=new Options;
+ 
+ 	/*loop through and process each element of the cell array  */
+ 	dims=xNew<int>(ocell->ndims);
+@@ -155,15 +150,14 @@
+ 		celli=mxGetCell(prhs[0],cindex);
+ 
+ 		option=(Option*)OptionParse(namei,&celli);
+-		ocell->values->AddObject((Object*)option);
++		ocell->value->AddObject((Object*)option);
+ 		option=NULL;
+ 	}
+ 	xDelete<int>(dims);
+ 
+ 	return(ocell);
+ }/*}}}*/
+-/*FUNCTION OptionParse{{{*/
+-Option* OptionParse(char* name, const mxArray* prhs[]){
++Option* OptionParse(char* name, const mxArray* prhs[]){ /*{{{*/
+ 
+ 	Option *option = NULL;
+ 	mxArray       *lhs[1];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13216)
+@@ -480,10 +480,10 @@
+ /*}}}*/
+ 
+ /*ISSM objects*/
+-/*FUNCTION FetchData(Matrix** pmatrix,const mxArray* dataref){{{*/
+-void FetchData(Matrix** pmatrix,const mxArray* dataref){
++/*FUNCTION FetchData(Matrix<double>** pmatrix,const mxArray* dataref){{{*/
++void FetchData(Matrix<double>** pmatrix,const mxArray* dataref){
+ 
+-	Matrix* outmatrix=NULL;
++	Matrix<double>* outmatrix=NULL;
+ 	int dummy=0;
+ 
+ 	if (mxIsClass(dataref,"double") ){
+@@ -501,15 +501,15 @@
+ 	*pmatrix=outmatrix;
+ }
+ /*}}}*/
+-/*FUNCTION FetchData(Vector** pvector,const mxArray* dataref){{{*/
+-void FetchData(Vector** pvector,const mxArray* dataref){
++/*FUNCTION FetchData(Vector<double>** pvector,const mxArray* dataref){{{*/
++void FetchData(Vector<double>** pvector,const mxArray* dataref){
+ 
+-	Vector* vector=NULL;
++	Vector<double>* vector=NULL;
+ 	int dummy;
+ 
+ 	if(mxIsEmpty(dataref)){
+ 		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+-		vector=new Vector(0);
++		vector=new Vector<double>(0);
+ 	}
+ 	else if (mxIsClass(dataref,"double") ){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 13216)
+@@ -216,7 +216,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION WriteData(mxArray** pdataref,Matrix* matrix){{{*/
+-void WriteData(mxArray** pdataref,Matrix* matrix){
++void WriteData(mxArray** pdataref,Matrix<double>* matrix){
+ 		
+ 	int      i,j;
+ 	int      rows,cols;
+@@ -254,8 +254,8 @@
+ 	*pdataref=dataref;
+ }
+ /*}}}*/
+-/*FUNCTION WriteData(mxArray** pdataref,Vector* vector){{{*/
+-void WriteData(mxArray** pdataref,Vector* vector){
++/*FUNCTION WriteData(mxArray** pdataref,Vector<double>* vector){{{*/
++void WriteData(mxArray** pdataref,Vector<double>* vector){
+ 	
+ 	mxArray* dataref=NULL;
+ 	double*  vector_ptr=NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp	(revision 13216)
+@@ -21,13 +21,13 @@
+ 	
+ /*}}}*/
+ 
+-Vector* MatlabVectorToVector(const mxArray* mxvector){
++Vector<double>* MatlabVectorToVector(const mxArray* mxvector){
+ 
+ 	int dummy;
+-	Vector* vector=NULL;
++	Vector<double>* vector=NULL;
+ 
+ 	/*allocate vector object: */
+-	vector=new Vector();
++	vector=new Vector<double>();
+ 
+ 	#ifdef _HAVE_PETSC_
+ 	vector->pvector=MatlabVectorToPetscVec(mxvector);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp	(revision 13216)
+@@ -21,13 +21,13 @@
+ 	
+ /*}}}*/
+ 
+-Matrix* MatlabMatrixToMatrix(const mxArray* mxmatrix){
++Matrix<double>* MatlabMatrixToMatrix(const mxArray* mxmatrix){
+ 
+ 	int dummy;
+-	Matrix* matrix=NULL;
++	Matrix<double>* matrix=NULL;
+ 
+ 	/*allocate matrix object: */
+-	matrix=new Matrix();
++	matrix=new Matrix<double>();
+ 
+ 	#ifdef _HAVE_PETSC_
+ 	matrix->pmatrix=MatlabMatrixToPetscMat(mxmatrix);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToSeqVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToSeqVec.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabVectorToSeqVec.cpp	(revision 13216)
+@@ -18,11 +18,11 @@
+ 
+ /*}}}*/
+ 
+-SeqVec* MatlabVectorToSeqVec(const mxArray* dataref){
++SeqVec<double>* MatlabVectorToSeqVec(const mxArray* dataref){
+ 
+-	SeqVec* output=NULL;
++	SeqVec<double>* output=NULL;
+ 
+-	output=new SeqVec();
++	output=new SeqVec<double>();
+ 	MatlabVectorToDoubleVector(&output->vector,&output->M,dataref);
+ 	return output;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 13216)
+@@ -17,10 +17,10 @@
+ 
+ #include <mex.h>
+ 
+-void WriteData(mxArray** pdataref,Matrix* matrix);
++void WriteData(mxArray** pdataref,Matrix<double>* matrix);
+ void WriteData(mxArray** pdataref,double* matrix, int M,int N);
+ void WriteData(mxArray** pdataref,int*    matrix, int M,int N);
+-void WriteData(mxArray** pdataref,Vector* vector);
++void WriteData(mxArray** pdataref,Vector<double>* vector);
+ void WriteData(mxArray** pdataref,double* vector, int M);
+ void WriteData(mxArray** pdataref,int integer);
+ void WriteData(mxArray** pdataref,bool boolean);
+@@ -34,12 +34,12 @@
+ void FetchData(int** pmatrix,int* pM,int *pN,const mxArray* dataref);
+ void FetchData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref);
+ void FetchData(bool** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref);
+-void FetchData(Matrix** pmatrix,const mxArray* dataref);
++void FetchData(Matrix<double>** pmatrix,const mxArray* dataref);
+ void FetchData(int** pvector,int* pM,const mxArray* dataref);
+ void FetchData(float** pvector,int* pM,const mxArray* dataref);
+ void FetchData(double** pvector,int* pM,const mxArray* dataref);
+ void FetchData(bool** pvector,int* pM,const mxArray* dataref);
+-void FetchData(Vector** pvector,const mxArray* dataref);
++void FetchData(Vector<double>** pvector,const mxArray* dataref);
+ void FetchData(char** pstring,const mxArray* dataref);
+ void FetchData(char** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref);
+ void FetchData(double* pscalar,const mxArray* dataref);
+@@ -51,19 +51,19 @@
+ void FetchData(Options** poptions,int istart, int nrhs,const mxArray** pdataref);
+ 
+ Option* OptionParse(char* name, const mxArray* prhs[]);
+-OptionDouble*   OptionDoubleParse( char* name, const mxArray* prhs[]);
+-OptionLogical*  OptionLogicalParse( char* name, const mxArray* prhs[]);
+-OptionChar*     OptionCharParse( char* name, const mxArray* prhs[]);
+-OptionStruct*   OptionStructParse( char* name, const mxArray* prhs[]);
+-OptionCell*     OptionCellParse( char* name, const mxArray* prhs[]);
++GenericOption<double*>*   OptionDoubleParse( char* name, const mxArray* prhs[]);
++GenericOption<bool*>*     OptionLogicalParse( char* name, const mxArray* prhs[]);
++GenericOption<char*>*     OptionCharParse( char* name, const mxArray* prhs[]);
++GenericOption<Options**>* OptionStructParse( char* name, const mxArray* prhs[]);
++GenericOption<Options*>*  OptionCellParse( char* name, const mxArray* prhs[]);
+ 
+ mxArray* mxGetAssignedField(const mxArray* pmxa_array,int number, const char* field);
+ void SetStructureField(mxArray* dataref,const char* fieldname,int fieldrows,int fieldcols,double* fieldpointer);
+ int CheckNumMatlabArguments(int nlhs,int NLHS, int nrhs,int NRHS, const char* THISFUNCTION, void (*function)( void ));
+ 
+ /*Matlab to Matrix routines: */
+-Matrix* MatlabMatrixToMatrix(const mxArray* mxmatrix);
+-Vector* MatlabVectorToVector(const mxArray* mxvector);
++Matrix<double>* MatlabMatrixToMatrix(const mxArray* mxmatrix);
++Vector<double>* MatlabVectorToVector(const mxArray* mxvector);
+ 
+ /*Matlab to double* routines: */
+ int MatlabVectorToDoubleVector(double** pvector,int* pvector_rows,const mxArray* mxvector);
+@@ -73,8 +73,8 @@
+ int MatlabNArrayToNArray(char** pmatrix,int* pmatrix_numel,int* pmatrix_ndims,int** pmatrix_size,const mxArray* mxmatrix);
+ 
+ /*Matlab to SeqMat routines: */
+-SeqMat* MatlabMatrixToSeqMat(const mxArray* dataref);
+-SeqVec* MatlabVectorToSeqVec(const mxArray* dataref);
++SeqMat<double>* MatlabMatrixToSeqMat(const mxArray* dataref);
++SeqVec<double>* MatlabVectorToSeqVec(const mxArray* dataref);
+ 
+ /*Matlab to Petsc routines: */
+ #ifdef _HAVE_PETSC_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.h	(revision 13216)
+@@ -5,6 +5,8 @@
+ #ifndef _CONTAINER_OPTIONS_H_
+ #define _CONTAINER_OPTIONS_H_
+ 
++#include "../classes/objects/Options/GenericOption.h"
++
+ /*forward declarations */
+ class Option;
+ 
+@@ -19,16 +21,81 @@
+ 		/*numerics*/
+ 		int  AddOption(Option* in_oobject);
+ 		Option* GetOption(const char* name);
+-		void Get(IssmDouble*  pvalue,const char* name);
+-		void Get(IssmDouble*  pvalue,const char* name,IssmDouble default_value);
+-		void Get(int*  pvalue,const char* name);
+-		void Get(int*  pvalue,const char* name,int default_value);
+-		void Get(bool*    pvalue,const char* name);
+-		void Get(bool*    pvalue,const char* name,bool default_value);
+-		void Get(char**   pvalue,const char* name);
+-		void Get(char**   pvalue,const char* name,const char* default_value);
+-		void Get(char***  pvalue,int* numel,const char* name);
+-		void Get(IssmDouble** pvalue,int* numel,const char* name);
++		
++		
++		template <class OptionType> void Get(OptionType* pvalue,const char* name){ /*{{{*/
++
++			vector<Object*>::iterator object;
++			GenericOption<OptionType>* genericoption=NULL;
++
++			/*Get option*/
++			genericoption=(GenericOption<OptionType>*)GetOption(name);
++
++			/*If the pointer is not NULL, the option has been found*/
++			if(genericoption){
++				genericoption->Get(pvalue);
++			}
++			/*Else, the Option does not exist, no default provided*/
++			else{
++				_error_("option of name \"" << name << "\" not found, and no default value has been provided");
++			}
++		}
++		/*}}}*/
++		template <class OptionType> void Get(OptionType* pvalue,int* pnumel, const char* name){ /*{{{*/
++
++			vector<Object*>::iterator object;
++			GenericOption<OptionType>* genericoption=NULL;
++
++			/*Get option*/
++			genericoption=(GenericOption<OptionType>*)GetOption(name);
++
++			/*If the pointer is not NULL, the option has been found*/
++			if(genericoption){
++				genericoption->Get(pvalue);
++				*pnumel=genericoption->NumEl();
++			}
++			/*Else, the Option does not exist, no default provided*/
++			else{
++				_error_("option of name \"" << name << "\" not found, and no default value has been provided");
++			}
++		}
++		/*}}}*/
++		template <class OptionType> void Get(OptionType* pvalue,const char* name,OptionType default_value){ /*{{{*/
++
++			vector<Object*>::iterator object;
++			GenericOption<OptionType>* genericoption=NULL;
++
++			/*Get option*/
++			genericoption=(GenericOption<OptionType>*)GetOption(name);
++
++			/*If the pointer is not NULL, the option has been found*/
++			if(genericoption){
++				genericoption->Get(pvalue);
++			}
++			else{
++				*pvalue=default_value;
++			}
++		}
++		/*}}}*/
++		template <class OptionType> void Get(OptionType* pvalue,int* pnumel, const char* name,OptionType default_value){ /*{{{*/
++
++			vector<Object*>::iterator object;
++			GenericOption<OptionType>* genericoption=NULL;
++
++			/*Get option*/
++			genericoption=(GenericOption<OptionType>*)GetOption(name);
++
++			/*If the pointer is not NULL, the option has been found*/
++			if(genericoption){
++				genericoption->Get(pvalue);
++				*pnumel=genericoption->NumEl();
++			}
++			else{
++				*pvalue=default_value;
++			}
++		}
++		/*}}}*/
++
+ };
+ 
+ #endif //ifndef _INPUTS_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.cpp	(revision 13216)
+@@ -243,8 +243,8 @@
+ 	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(Vector** pvec,int enum_type){{{*/
+-void Parameters::FindParam(Vector** pvec,int enum_type){ _assert_(this);
++/*FUNCTION Parameters::FindParam(Vector<IssmDouble>** pvec,int enum_type){{{*/
++void Parameters::FindParam(Vector<IssmDouble>** pvec,int enum_type){ _assert_(this);
+ 	
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -261,8 +261,8 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(Matrix** pmat,int enum_type){{{*/
+-void Parameters::FindParam(Matrix** pmat,int enum_type){ _assert_(this);
++/*FUNCTION Parameters::FindParam(Matrix<IssmDouble>** pmat,int enum_type){{{*/
++void Parameters::FindParam(Matrix<IssmDouble>** pmat,int enum_type){ _assert_(this);
+ 	
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -405,8 +405,8 @@
+ 	else this->AddObject(new IntMatParam(enum_type,intarray,M,N)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(Vector* vector,int enum_type);{{{*/
+-void   Parameters::SetParam(Vector* vector,int enum_type){
++/*FUNCTION Parameters::SetParam(Vector<IssmDouble>* vector,int enum_type);{{{*/
++void   Parameters::SetParam(Vector<IssmDouble>* vector,int enum_type){
+ 
+ 	Param* param=NULL;
+ 	
+@@ -417,8 +417,8 @@
+ 	else this->AddObject(new VectorParam(enum_type,vector)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(Matrix* matrix,int enum_type);{{{*/
+-void   Parameters::SetParam(Matrix* matrix,int enum_type){
++/*FUNCTION Parameters::SetParam(Matrix<IssmDouble>* matrix,int enum_type);{{{*/
++void   Parameters::SetParam(Matrix<IssmDouble>* matrix,int enum_type){
+ 
+ 	Param* param=NULL;
+ 	
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Parameters.h	(revision 13216)
+@@ -7,8 +7,8 @@
+ #include <stdio.h>
+ 
+ /*forward declarations */
+-class Matrix;
+-class Vector;
++template <class doublematrix> class Matrix;
++template <class doubletype> class Vector;
+ class Materials;
+ class Parameters;
+ class Elements;
+@@ -40,8 +40,8 @@
+ 		void  FindParam(IssmDouble** pIssmDoublearray,int* pM,int enum_type);
+ 		void  FindParam(IssmDouble** pIssmDoublearray,int* pM,int* pN,int enum_type);
+ 		void  FindParam(IssmDouble*** parray,int* pM, int** pmdims_array,int** pndims_array,int enum_type);
+-		void  FindParam(Vector** pvec,int enum_type);
+-		void  FindParam(Matrix** pmat,int enum_type);
++		void  FindParam(Vector<IssmDouble>** pvec,int enum_type);
++		void  FindParam(Matrix<IssmDouble>** pmat,int enum_type);
+ 		void  FindParam(FILE** pfid,int enum_type);
+ 		
+ 		void  SetParam(bool boolean,int enum_type);
+@@ -53,8 +53,8 @@
+ 		void  SetParam(IssmDouble* IssmDoublearray,int M,int N,int enum_type);
+ 		void  SetParam(int* intarray,int M,int enum_type);
+ 		void  SetParam(int* intarray,int M,int N,int enum_type);
+-		void  SetParam(Vector* vec,int enum_type);
+-		void  SetParam(Matrix* mat,int enum_type);
++		void  SetParam(Vector<IssmDouble>* vec,int enum_type);
++		void  SetParam(Matrix<IssmDouble>* mat,int enum_type);
+ 		void  SetParam(FILE* fid,int enum_type);
+ 		void  UnitConversion(int direction_enum);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13216)
+@@ -174,7 +174,7 @@
+ 	int    *resultssteps  = NULL;
+ 	IssmDouble *resultstimes = NULL;
+ 	IssmDouble *vector_serial= NULL;
+-	Vector*     vector       = NULL;
++	Vector<IssmDouble>*     vector       = NULL;
+ 	bool   io_gather;
+ 	bool   results_as_patches;
+ 	int    numberofvertices,numberofelements;
+@@ -232,7 +232,7 @@
+ 			if(resultssizes[i]==P1Enum)      vectorsize=numberofvertices;
+ 			else if(resultssizes[i]==P0Enum) vectorsize=numberofelements;
+ 			else _error_("Unkown result size: " << EnumToStringx(resultssizes[i]));
+-			vector=new Vector(vectorsize);
++			vector=new Vector<IssmDouble>(vectorsize);
+ 
+ 			for(int j=0;j<this->Size();j++){
+ 				Element* element=(Element*)this->GetObjectByOffset(j);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13216)
+@@ -18,6 +18,8 @@
+ #include "./DataSet.h"
+ #include "./Observations.h"
+ #include "../shared/shared.h"
++#include "../Container/Container.h"
++#include "../classes/classes.h"
+ #include "../include/include.h"
+ #include "../modules/modules.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.h	(revision 13216)
+@@ -6,6 +6,7 @@
+ #define  _CONTAINER_OBSERVATIONS_H_
+ 
+ #include "../include/include.h"
++#include "../classes/objects/Options/GenericOption.h"
+ 
+ class Quadtree;
+ class Variogram;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.cpp	(revision 13216)
+@@ -18,6 +18,7 @@
+ #include "../shared/shared.h"
+ #include "../io/io.h"
+ #include "../include/include.h"
++#include "../classes/classes.h"
+ #include "../shared/shared.h"
+ #include "../EnumDefinitions/EnumDefinitions.h"
+ #include "../io/io.h"
+@@ -39,6 +40,8 @@
+ /*FUNCTION Options::AddOption{{{*/
+ int  Options::AddOption(Option* in_option){
+ 
++	char* name=NULL;
++	
+ 	vector<Object*>::iterator object;
+ 	Option* option=NULL;
+ 
+@@ -46,17 +49,19 @@
+ 	_assert_(in_option);
+ 
+ 	/*Also, check the option name*/
+-	if(!in_option->name) _error_("input option has an empty name");
+-	if(strchr(in_option->name,'.')) _error_("Option \"" << in_option->name << "\" has a protected character \".\"");
+-	if(strchr(in_option->name,'[')) _error_("Option \"" << in_option->name << "\" has a protected character \"[\"");
+-	if(strchr(in_option->name,']')) _error_("Option \"" << in_option->name << "\" has a protected character \"]\"");
++	name=in_option->Name();
+ 
++	if(!name) _error_("input option has an empty name");
++	if(strchr(name,'.')) _error_("Option \"" << name << "\" has a protected character \".\"");
++	if(strchr(name,'[')) _error_("Option \"" << name << "\" has a protected character \"[\"");
++	if(strchr(name,']')) _error_("Option \"" << name << "\" has a protected character \"]\"");
++
+ 	/*Finally, check that no option of the same name already exists in the dataset*/
+ 	for(object=objects.begin();object<objects.end();object++){
+ 
+ 		option=(Option*)(*object); 
+-		if (!strcmp(option->name,in_option->name)){
+-			_error_("Options \"" << in_option->name << "\" found multiple times");
++		if (!strcmp(option->Name(),name)){
++			_error_("Options \"" << name << "\" found multiple times");
+ 			break;
+ 		}
+ 	}
+@@ -67,232 +72,6 @@
+ 	return 1;
+ }
+ /*}}}*/
+-/*FUNCTION Options::Get(int* pvalue, char* name){{{*/
+-void Options::Get(int* pvalue,const char* name){
+-
+-	vector<Object*>::iterator object;
+-	Option* option=NULL;
+-
+-	/*Get option*/
+-	option=GetOption(name);
+-
+-	/*If the pointer is not NULL, the option has been found*/
+-	if(option){
+-		option->Get(pvalue);
+-	}
+-	/*Else, the Option does not exist, no default provided*/
+-	else{
+-		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Options::Get(int* pvalue, char* name,int default_value){{{*/
+-void Options::Get(int* pvalue,const char* name,int default_value){
+-
+-	vector<Object*>::iterator object;
+-	Option* option=NULL;
+-
+-	/*Get option*/
+-	option=GetOption(name);
+-
+-	/*If the pointer is not NULL, the option has been found*/
+-	if(option){
+-		option->Get(pvalue);
+-	}
+-	/*Else, the Option does not exist, a default is provided here*/
+-	else{
+-		*pvalue=default_value;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Options::Get(IssmDouble* pvalue, char* name){{{*/
+-void Options::Get(IssmDouble* pvalue,const char* name){
+-
+-	vector<Object*>::iterator object;
+-	Option* option=NULL;
+-
+-	/*Get option*/
+-	option=GetOption(name);
+-
+-	/*If the pointer is not NULL, the option has been found*/
+-	if(option){
+-		option->Get(pvalue);
+-	}
+-	/*Else, the Option does not exist, no default provided*/
+-	else{
+-		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Options::Get(IssmDouble* pvalue, char* name,IssmDouble default_value){{{*/
+-void Options::Get(IssmDouble* pvalue,const char* name,IssmDouble default_value){
+-
+-	vector<Object*>::iterator object;
+-	Option* option=NULL;
+-
+-	/*Get option*/
+-	option=GetOption(name);
+-
+-	/*If the pointer is not NULL, the option has been found*/
+-	if(option){
+-		option->Get(pvalue);
+-	}
+-	/*Else, the Option does not exist, a default is provided here*/
+-	else{
+-		*pvalue=default_value;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Options::Get(bool* pvalue, char* name){{{*/
+-void Options::Get(bool* pvalue,const char* name){
+-
+-	vector<Object*>::iterator object;
+-	Option* option=NULL;
+-
+-	/*Get option*/
+-	option=GetOption(name);
+-
+-	/*If the pointer is not NULL, the option has been found*/
+-	if(option){
+-		option->Get(pvalue);
+-	}
+-	/*Else, the Option does not exist, no default provided*/
+-	else{
+-		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Options::Get(bool* pvalue, char* name,bool default_value){{{*/
+-void Options::Get(bool* pvalue,const char* name,bool default_value){
+-
+-	vector<Object*>::iterator object;
+-	Option* option=NULL;
+-
+-	/*Get option*/
+-	option=GetOption(name);
+-
+-	/*If the pointer is not NULL, the option has been found*/
+-	if(option){
+-		option->Get(pvalue);
+-	}
+-	/*Else, the Option does not exist, a default is provided here*/
+-	else{
+-		*pvalue=default_value;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Options::Get(char** pvalue, char* name){{{*/
+-void Options::Get(char** pvalue,const char* name){
+-
+-	vector<Object*>::iterator object;
+-	Option* option=NULL;
+-	char* outstring=NULL;
+-	int   stringsize;
+-
+-	/*Get option*/
+-	option=GetOption(name);
+-
+-	/*If the pointer is not NULL, the option has been found*/
+-	if(option){
+-		option->Get(pvalue);
+-	}
+-	/*Else, the Option does not exist, no default provided*/
+-	else{
+-		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Options::Get(char** pvalue, char* name,char* default_value){{{*/
+-void Options::Get(char** pvalue,const char* name,const char* default_value){
+-
+-	vector<Object*>::iterator object;
+-	Option* option=NULL;
+-	char* outstring=NULL;
+-	int   stringsize;
+-
+-	/*Get option*/
+-	option=GetOption(name);
+-
+-	/*If the pointer is not NULL, the option has been found*/
+-	if(option){
+-		option->Get(pvalue);
+-	}
+-	/*Else, the Option does not exist, a default is provided here*/
+-	else{
+-		stringsize=strlen(default_value)+1;
+-		outstring=xNew<char>(stringsize);
+-		xMemCpy<char>(outstring,default_value,stringsize);
+-		*pvalue=outstring;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Options::Get(char*** ppvalue,int* numel,char* name){{{*/
+-void Options::Get(char*** ppvalue,int* numel,const char* name){
+-
+-	vector<Object*>::iterator object;
+-	Option* option=NULL;
+-	Option* option2=NULL;
+-	Options* options=NULL;
+-	int   i;
+-
+-	/*Get option*/
+-	option=GetOption(name);
+-
+-	/*If the pointer is not NULL, the option has been found*/
+-	if(option){
+-		/*If the object is a Cell, copy the strings from its options dataset*/ 
+-		if(option->ObjectEnum()==OptionCellEnum){
+-			if (option->NumEl()) {
+-				*ppvalue=xNew<char*>(option->NumEl());
+-				if (numel) *numel=option->NumEl();
+-				option->Get(&options);
+-				for (i=0; i<option->NumEl(); i++) {
+-					option2=((Option *)options->GetObjectByOffset(i));
+-					if(option2->ObjectEnum()==OptionCharEnum)
+-						option2->Get(&((*ppvalue)[i]));
+-					else
+-						((*ppvalue)[i])=NULL;
+-				}
+-			}
+-		}
+-		/*If the object is a Char, copy the strings from its concatenation*/ 
+-		else if(option->ObjectEnum()==OptionCharEnum){
+-			option->Get(ppvalue,numel);
+-		}
+-		/*Else: not supported*/
+-		else{
+-			_error_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
+-		}
+-	}
+-	/*Else, the Option does not exist, no default provided*/
+-	else{
+-		*ppvalue=NULL;
+-		if (numel) *numel=0;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION Options::Get(IssmDouble** pvalue,int* numel,const char* name){{{*/
+-void Options::Get(IssmDouble** pvalue,int* numel,const char* name){
+-
+-	vector<Object*>::iterator object;
+-	Option* option=NULL;
+-
+-	/*Get option*/
+-	option=GetOption(name);
+-
+-	/*If the pointer is not NULL, the option has been found*/
+-	if(option){
+-		option->Get(pvalue,numel);
+-	}
+-	/*Else, the Option does not exist, no default provided*/
+-	else{
+-		_error_("option of name \"" << name << "\" not found, and no default value has been provided");
+-	}
+-}
+-/*}}}*/
+ /*FUNCTION Options::GetOption{{{*/
+ Option* Options::GetOption(const char* name){
+ 
+@@ -303,22 +82,24 @@
+ 	for ( object=objects.begin() ; object < objects.end(); object++ ){
+ 
+ 		option=(Option*)(*object); 
+-		if (!strncmp(name,option->name,strlen(option->name))){
++		if (!strncmp(name,option->Name(),strlen(option->Name()))){
+ 
+ 			/*OK, now do we have a complete name? If not, it is a cell or a structure, we need to go further*/
+-			if(!strcmp(name,option->name)){
++			if(!strcmp(name,option->Name())){
+ 				return option;
+ 			}
+ 			else{
+ 				/*If the object is a Cell, recursive call to its options*/ 
+ 				if(option->ObjectEnum()==OptionCellEnum){
+-					return ((OptionCell*)option)->values->GetOption(name);
++					GenericOption<Options*>* celloption=(GenericOption<Options*>*)option;
++					return celloption->value->GetOption(name);
+ 				}
+ 				/*If the object is a Struct loop over its size and recursive call*/
+ 				else if(option->ObjectEnum()==OptionStructEnum){
+-					for(int i=0;i<option->numel;i++){
+-						_assert_(((OptionStruct*)option)->values[i]);
+-						return ((OptionStruct*)option)->values[i]->GetOption(name);
++					for(int i=0;i<option->NumEl();i++){
++						GenericOption<Options**>* structoption=(GenericOption<Options**>*)option;
++						_assert_(structoption->value[i]);
++						return structoption->value[i]->GetOption(name);
+ 					}
+ 				}
+ 				/*Else: not supported*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 13216)
+@@ -3,7 +3,6 @@
+ #include "../../include/include.h"
+ #include "./GaussPoints.h"
+ #include "../Alloc/alloc.h"
+-#include "../../io/io.h"
+ #include "../Exceptions/exceptions.h"
+ #include <math.h>
+ #include <float.h>
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.h	(revision 13216)
+@@ -4,13 +4,18 @@
+ 
+ #ifndef _ALLOC_H_
+ #define _ALLOC_H_
+-class Matrix;
+-class Vector;
++
++#include "../../include/include.h"
++
++template <class doubletype> class Matrix;
++template <class doubletype> class Vector;
+ void* xmalloc(int size);
+ void* xcalloc(int n,int size);
+ void  xfree(void** pvptr);
+ void* xrealloc ( void* pv, int size);
+-void xdelete(Matrix** pvptr);
+-void xdelete(Vector** pvptr);
++void xdelete(Matrix<IssmDouble>** pvptr);
++void xdelete(Vector<IssmDouble>** pvptr);
+ 
++#include "./xNewDelete.h"
++
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13216)
+@@ -61,7 +61,7 @@
+ 	}
+ }
+ 
+-void xdelete(Matrix** pv){
++void xdelete(Matrix<IssmDouble>** pv){
+ 	
+ 	if (pv && *pv){
+ 		/*There is no mxDelete in the Matlab API -> using delete trips up Matlab. So we 
+@@ -72,7 +72,7 @@
+ 	}
+ }
+ 
+-void xdelete(Vector** pv){
++void xdelete(Vector<IssmDouble>** pv){
+ 
+ 	if (pv && *pv){
+ 		/*There is no mxDelete in the Matlab API -> using delete trips up Matlab. So we 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13216)
+@@ -9,8 +9,8 @@
+ #include "../../classes/objects/objects.h"
+ #include "../../toolkits/toolkits.h"
+ 
+-int IsInPoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
+-int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
++int IsInPoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
++int IsOutsidePoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
+ int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
+ int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname);
+ int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/IsInPoly.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/IsInPoly.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/IsInPoly.cpp	(revision 13216)
+@@ -14,7 +14,7 @@
+ #endif
+ 
+ /*IsInPoly {{{*/
+-int IsInPoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
++int IsInPoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
+ 
+ 	int i;
+ 	double x0,y0;
+@@ -55,7 +55,7 @@
+ 	 return 1;
+ }/*}}}*/
+ /*IsOutsidePoly {{{*/
+-int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
++int IsOutsidePoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
+ 
+ 	int i,j;
+ 	double x0,y0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/diskio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/diskio.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/io/Disk/diskio.h	(revision 13216)
+@@ -5,9 +5,7 @@
+ #ifndef _DISK_IO_H_
+ #define _DISK_IO_H_
+ 
+-#include "../../classes/objects/objects.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
++#include <stdio.h>
+ 
+ FILE* pfopen(char* filename,const char* format);
+ void  pfclose(FILE* fid,char* filename);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp	(revision 13216)
+@@ -12,7 +12,7 @@
+ int UpdateVertexPositionsx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters){
+ 
+ 	int     i;
+-	Vector*     vz        = NULL;
++	Vector<IssmDouble>*     vz        = NULL;
+ 	Vertex *vertex    = NULL;
+ 	IssmDouble *thickness = NULL;
+ 	IssmDouble *bed       = NULL;
+@@ -22,7 +22,7 @@
+ 	GetVectorFromInputsx(&bed      ,elements,nodes, vertices, loads, materials, parameters, BedEnum,      VertexEnum);
+ 
+ 	/*Allocate vector*/
+-	vz=new Vector(vertices->NumberOfVertices());
++	vz=new Vector<IssmDouble>(vertices->NumberOfVertices());
+ 
+ 	/*Update verices new geometry: */
+ 	for (i=0;i<vertices->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13216)
+@@ -9,11 +9,11 @@
+ #include "../../classes/objects/objects.h"
+ #include "../modules.h"
+ 
+-int InterpFromMesh2dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
++int InterpFromMesh2dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
+ 		double* default_values,int num_default_values,Contour** contours,int numcontours){
+ 	
+ 	/*Output*/
+-	Vector* data_prime=NULL;
++	Vector<IssmDouble>* data_prime=NULL;
+ 
+ 	/*Intermediary*/
+ 	int i,j;
+@@ -26,7 +26,7 @@
+ 	double ymin,ymax;
+ 
+ 	/*contours: */
+-	Vector*    vec_incontour=NULL;
++	Vector<IssmDouble>*    vec_incontour=NULL;
+ 	double*    incontour=NULL;
+ 
+ 	/*threading: */
+@@ -70,7 +70,7 @@
+ 	}
+ 
+ 	/*Initialize output*/
+-	data_prime=new Vector(nods_prime,false,SeqVecType);
++	data_prime=new Vector<IssmDouble>(nods_prime,false,SeqVecType);
+ 	if(num_default_values){
+ 		if(num_default_values==1)for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[0],INS_VAL);
+ 		else for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[i],INS_VAL);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp	(revision 13216)
+@@ -31,7 +31,7 @@
+ 	double  ymin               = gate->ymin;
+ 	double  ymax               = gate->ymax;
+ 	int     nods_prime         = gate->nods_prime;
+-	Vector *data_prime         = gate->data_prime;
++	Vector<IssmDouble>* data_prime         = gate->data_prime;
+ 	double *x_prime            = gate->x_prime;
+ 	double *y_prime            = gate->y_prime;
+ 	double *default_values     = gate->default_values;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h	(revision 13216)
+@@ -22,7 +22,7 @@
+ 	double xmin,xmax;
+ 	double ymin,ymax;
+ 	int    nods_prime;
+-	Vector*    data_prime;
++	Vector<IssmDouble>*    data_prime;
+ 	double* x_prime;
+ 	double* y_prime;
+ 	double* default_values;
+@@ -32,7 +32,7 @@
+ 
+ } InterpFromMesh2dxThreadStruct;
+ 
+-int InterpFromMesh2dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
++int InterpFromMesh2dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
+ 		double* default_values,int num_default_values,Contour** contours,int numcontours);
+ 
+ void* InterpFromMesh2dxt(void* vInterpFromMesh2dxThreadStruct);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp	(revision 13216)
+@@ -29,7 +29,7 @@
+ 	xDelete<int>(control_type);
+ 
+ }
+-void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* gradient){
++void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* gradient){
+ 
+ 	/*Serialize gradient*/
+ 	IssmDouble* serial_gradient=NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h	(revision 13216)
+@@ -8,6 +8,6 @@
+ #include "../../Container/Container.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,Vector* gradient);
++void	ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* gradient);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13216)
+@@ -257,13 +257,14 @@
+ 	      else if (strcmp(name,"Parameters")==0) return ParametersEnum;
+ 	      else if (strcmp(name,"Vertices")==0) return VerticesEnum;
+ 	      else if (strcmp(name,"Results")==0) return ResultsEnum;
++	      else if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
+ 	      else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
+ 	      else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
+-	      else if (strcmp(name,"Contour")==0) return ContourEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
++	      if (strcmp(name,"Contour")==0) return ContourEnum;
++	      else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
+ 	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
+ 	      else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
+ 	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
+@@ -382,11 +383,11 @@
+ 	      else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
+ 	      else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
+ 	      else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
+-	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
++	      if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
++	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+ 	      else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
+ 	      else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
+ 	      else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
+@@ -483,6 +484,7 @@
+ 	      else if (strcmp(name,"XY")==0) return XYEnum;
+ 	      else if (strcmp(name,"XYZP")==0) return XYZPEnum;
+ 	      else if (strcmp(name,"Option")==0) return OptionEnum;
++	      else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum;
+ 	      else if (strcmp(name,"OptionCell")==0) return OptionCellEnum;
+ 	      else if (strcmp(name,"OptionChar")==0) return OptionCharEnum;
+ 	      else if (strcmp(name,"OptionStruct")==0) return OptionStructEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13216)
+@@ -253,6 +253,7 @@
+ 		case ParametersEnum : return "Parameters";
+ 		case VerticesEnum : return "Vertices";
+ 		case ResultsEnum : return "Results";
++		case AdolcParamEnum : return "AdolcParam";
+ 		case BoolInputEnum : return "BoolInput";
+ 		case BoolParamEnum : return "BoolParam";
+ 		case ContourEnum : return "Contour";
+@@ -473,6 +474,7 @@
+ 		case XYEnum : return "XY";
+ 		case XYZPEnum : return "XYZP";
+ 		case OptionEnum : return "Option";
++		case GenericOptionEnum : return "GenericOption";
+ 		case OptionCellEnum : return "OptionCell";
+ 		case OptionCharEnum : return "OptionChar";
+ 		case OptionStructEnum : return "OptionStruct";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp	(revision 13216)
+@@ -28,9 +28,9 @@
+ 	int     numberofvertices;
+ 
+ 	/*output: */
+-	Vector* partition_contributions=NULL;
+-	Vector* partition_areas=NULL;
+-	Vector* vec_average=NULL;
++	Vector<IssmDouble>* partition_contributions=NULL;
++	Vector<IssmDouble>* partition_areas=NULL;
++	Vector<IssmDouble>* vec_average=NULL;
+ 	double* average=NULL;
+ 
+ 	/*First, recover qmu partition of vertices: */
+@@ -43,9 +43,9 @@
+ 	/*average onto the separate areas. The result will be a npart sized vector. */
+ 
+ 	/*allocate: */
+-	partition_contributions=new Vector(npart);
+-	partition_areas=new Vector(npart);
+-	vec_average=new Vector(npart);
++	partition_contributions=new Vector<IssmDouble>(npart);
++	partition_areas=new Vector<IssmDouble>(npart);
++	vec_average=new Vector<IssmDouble>(npart);
+ 
+ 	/*loop on each element, and add contribution of the element to the partition (surface weighted average): */
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp	(revision 13216)
+@@ -8,7 +8,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector, int name, int type){
++void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector, int name, int type){
+ 
+ 	IssmDouble* serial_vector=NULL;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void	InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* vector, int name,int type);
++void	InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* vector, int name,int type);
+ void	InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,IssmDouble* vector, int name,int type);
+ void	InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int* vector, int name,int type);
+ void	InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,bool* vector, int name,int type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp	(revision 13216)
+@@ -5,10 +5,10 @@
+ 
+ #include "./Reducevectorgtofx.h"
+  
+-void Reducevectorgtofx(Vector** puf, Vector* ug, Nodes* nodes,Parameters* parameters){
++void Reducevectorgtofx(Vector<IssmDouble>** puf, Vector<IssmDouble>* ug, Nodes* nodes,Parameters* parameters){
+ 
+ 	/*output: */
+-	Vector* uf=NULL;
++	Vector<IssmDouble>* uf=NULL;
+ 
+ 	/*variables: */
+ 	int i;
+@@ -25,7 +25,7 @@
+ 	}
+ 	else{
+ 		/*allocate: */
+-		uf=new Vector(fsize);
++		uf=new Vector<IssmDouble>(fsize);
+ 
+ 		if(nodes->NumberOfNodes(configuration_type)){ 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void Reducevectorgtofx(Vector** puf, Vector* ug, Nodes* nodes,Parameters* parameters);
++void Reducevectorgtofx(Vector<IssmDouble>** puf, Vector<IssmDouble>* ug, Nodes* nodes,Parameters* parameters);
+ 
+ #endif  /* _REDUCEVECTORGTOFX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 13216)
+@@ -16,7 +16,7 @@
+ 	IssmDouble*  vertices_potentially_ungrounding = NULL;
+ 	IssmDouble*  vertices_ungrounding             = NULL;
+ 	IssmDouble*  old_floatingice                  = NULL;
+-	Vector*      vec_old_floatingice              = NULL;
++	Vector<IssmDouble>*      vec_old_floatingice              = NULL;
+ 	Element* element                          = NULL;
+ 	
+ 	if(VerboseModule()) _pprintLine_("   Migrating grounding line");
+@@ -54,15 +54,15 @@
+ }
+ 
+ /*FUNCTION CreateNodesOnFloatingIce {{{*/
+-Vector* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){ 
++Vector<IssmDouble>* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){ 
+ 
+ 	int     i,numnods;
+-	Vector*   vec_nodes_on_floatingice = NULL;
++	Vector<IssmDouble>*   vec_nodes_on_floatingice = NULL;
+ 	Node *node                     = NULL;
+ 
+ 	/*First, initialize nodes_on_floatingice, which will track which nodes have changed status: */
+ 	numnods=nodes->NumberOfNodes(configuration_type);
+-	vec_nodes_on_floatingice=new Vector(numnods);
++	vec_nodes_on_floatingice=new Vector<IssmDouble>(numnods);
+ 
+ 	/*Loop through nodes, and fill vec_nodes_on_floatingice: */
+ 	for(i=0;i<nodes->Size();i++){
+@@ -85,12 +85,12 @@
+ 
+ 	int      i,numberofvertices;
+ 	IssmDouble*  vertices_potentially_ungrounding      = NULL;
+-	Vector*      vec_vertices_potentially_ungrounding  = NULL;
++	Vector<IssmDouble>*      vec_vertices_potentially_ungrounding  = NULL;
+ 	Element* element                               = NULL;
+ 
+ 	/*Initialize vector with number of vertices*/
+ 	numberofvertices=vertices->NumberOfVertices();
+-	vec_vertices_potentially_ungrounding=new Vector(numberofvertices); //grounded vertex that could start floating
++	vec_vertices_potentially_ungrounding=new Vector<IssmDouble>(numberofvertices); //grounded vertex that could start floating
+ 
+ 	/*Fill vector vertices_potentially_floating: */
+ 	for(i=0;i<elements->Size();i++){
+@@ -115,8 +115,8 @@
+ 	int      nflipped,local_nflipped;
+ 	IssmDouble*  nodes_on_floatingice                  = NULL;
+ 	IssmDouble*  elements_neighboring_floatingce      = NULL;
+-	Vector*      vec_elements_neighboring_floatingice = NULL;
+-	Vector*      vec_nodes_on_floatingice              = NULL;
++	Vector<IssmDouble>*      vec_elements_neighboring_floatingice = NULL;
++	Vector<IssmDouble>*      vec_nodes_on_floatingice              = NULL;
+ 	Node*    node                                  = NULL;
+ 	Element* element                               = NULL;
+ 
+@@ -133,7 +133,7 @@
+ 	while(nflipped){
+ 		
+ 		/*Vector of size number of elements*/
+-		vec_elements_neighboring_floatingice=new Vector(elements->NumberOfElements(),true);
++		vec_elements_neighboring_floatingice=new Vector<IssmDouble>(elements->NumberOfElements(),true);
+ 
+ 		/*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/
+ 		for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h	(revision 13216)
+@@ -13,7 +13,7 @@
+ /* local prototypes: */
+ void       GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
+ 
+-Vector*        CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);
++Vector<IssmDouble>*        CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);
+ IssmDouble*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);
+ IssmDouble*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding);
+ #endif  /* _GROUNDINGLINEMIGRATIONX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	(revision 13216)
+@@ -8,18 +8,18 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void GetVectorFromControlInputsx(Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){
++void GetVectorFromControlInputsx(Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){
+ 
+ 	int  num_controls;
+ 	int *control_type = NULL;
+-	Vector*  vector=NULL;
++	Vector<IssmDouble>*  vector=NULL;
+ 
+ 	/*Retrieve some parameters*/
+ 	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+ 	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+ 
+ 	/*Allocate and populate gradient*/
+-	vector=new Vector(num_controls*vertices->NumberOfVertices());
++	vector=new Vector<IssmDouble>(num_controls*vertices->NumberOfVertices());
+ 
+ 	for(int i=0;i<num_controls;i++){
+ 		for(int j=0;j<elements->Size();j++){
+@@ -41,7 +41,7 @@
+ 	IssmDouble* vector=NULL;
+ 	
+ 	/*intermediary: */
+-	Vector* vec_vector=NULL;
++	Vector<IssmDouble>* vec_vector=NULL;
+ 
+ 	GetVectorFromControlInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters,data);
+ 	vector=vec_vector->ToMPISerial();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	(revision 13216)
+@@ -8,7 +8,7 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void	GetVectorFromControlInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
++void	GetVectorFromControlInputsx( Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
+ void	GetVectorFromControlInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
+ 
+ #endif  /* _GETVECTORFROMCONTROLINPUTSXX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void GetSolutionFromInputsx( Vector** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
++void GetSolutionFromInputsx( Vector<IssmDouble>** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
+ 
+ #endif  /* _GETSOLUTIONFROMINPUTSXX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 13216)
+@@ -8,7 +8,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void	GetSolutionFromInputsx( Vector** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters){
++void	GetSolutionFromInputsx( Vector<IssmDouble>** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters){
+ 
+ 	/*intermediary: */
+ 	int gsize;
+@@ -18,7 +18,7 @@
+ 	int configuration_type;
+ 
+ 	/*output: */
+-	Vector* solution=NULL;
++	Vector<IssmDouble>* solution=NULL;
+ 
+ 	/*retrive parameters: */
+ 	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+@@ -28,7 +28,7 @@
+ 	if (gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));
+ 	
+ 	/*Initialize solution: */
+-	solution=new Vector(gsize);
++	solution=new Vector<IssmDouble>(gsize);
+ 	
+ 	/*Go through elements and plug solution: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.cpp	(revision 13216)
+@@ -11,11 +11,11 @@
+ #include "./Reduceloadx.h"
+ #include "../../io/io.h"
+ 
+-void	Reduceloadx( Vector* pf, Matrix* Kfs, Vector* y_s,bool flag_ys0){
++void	Reduceloadx( Vector<IssmDouble>* pf, Matrix<IssmDouble>* Kfs, Vector<IssmDouble>* y_s,bool flag_ys0){
+ 
+ 	/*intermediary*/
+-	Vector*     y_s0   = NULL;
+-	Vector*     Kfsy_s = NULL;
++	Vector<IssmDouble>*     y_s0   = NULL;
++	Vector<IssmDouble>*     Kfsy_s = NULL;
+ 	int         Kfsm,Kfsn;
+ 	int         global_m,global_n;
+ 	bool        fromlocalsize = true;
+@@ -31,7 +31,7 @@
+ 
+ 		/*pf = pf - Kfs * y_s;*/
+ 		Kfs->GetLocalSize(&Kfsm,&Kfsn);
+-		Kfsy_s=new Vector(Kfsm,fromlocalsize);
++		Kfsy_s=new Vector<IssmDouble>(Kfsm,fromlocalsize);
+ 		if (flag_ys0){
+ 
+ 			/*Create y_s0, full of 0: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.h	(revision 13216)
+@@ -8,6 +8,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void	Reduceloadx( Vector* pf, Matrix* Kfs, Vector* ys,bool flag_ys0=false);
++void	Reduceloadx( Vector<IssmDouble>* pf, Matrix<IssmDouble>* Kfs, Vector<IssmDouble>* ys,bool flag_ys0=false);
+ 
+ #endif  /* _REDUCELOADX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void	ComputeStrainRatex( Vector** peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
++void	ComputeStrainRatex( Vector<IssmDouble>** peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
+ 
+ 	/*Intermediary*/
+ 	int i;
+@@ -18,13 +18,13 @@
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	Vector* eps=NULL;
++	Vector<IssmDouble>* eps=NULL;
+ 
+ 	/*Recover numberofelements: */
+ 	parameters->FindParam(&numberofelements,MeshNumberofelementsEnum);
+ 
+ 	/*Allocate eps on numberofelements (only 1 dof): */
+-	eps=new Vector(numberofelements);
++	eps=new Vector<IssmDouble>(numberofelements);
+ 
+ 	/*Compute basal stress for each element: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void	ComputeStrainRatex(Vector** eps_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
++void	ComputeStrainRatex(Vector<IssmDouble>** eps_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
+ 
+ #endif  /* _COMPUTESTRAINRATEX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void	ComputeBasalStressx( Vector** pp_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
++void	ComputeBasalStressx( Vector<IssmDouble>** pp_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
+ 
+ #endif  /* _COMPUTEBASALSTRESSX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void	ComputeBasalStressx( Vector** psigma,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
++void	ComputeBasalStressx( Vector<IssmDouble>** psigma,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
+ 
+ 	/*Intermediary*/
+ 	int i;
+@@ -18,13 +18,13 @@
+ 	Element* element=NULL;
+ 
+ 	/*output: */
+-	Vector* sigma=NULL;
++	Vector<IssmDouble>* sigma=NULL;
+ 
+ 	/*Recover numberofelements: */
+ 	parameters->FindParam(&numberofelements,MeshNumberofelementsEnum);
+ 
+ 	/*Allocate sigma on numberofelements: */
+-	sigma=new Vector(reCast<int>(numberofelements));
++	sigma=new Vector<IssmDouble>(reCast<int>(numberofelements));
+ 
+ 	/*Compute basal stress for each element: */
+ 	for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h	(revision 13216)
+@@ -9,11 +9,11 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void		InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* solution);
++void		InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* solution);
+ void        InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* solution);
+ 
+ //with timestep
+-void		InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* solution,int timestep);
++void		InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* solution,int timestep);
+ void        InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* solution, int timestep);
+ 
+ #endif  /* _UPDATEINPUTSFROMSOLUTIONXX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp	(revision 13216)
+@@ -8,7 +8,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* solution){
++void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* solution){
+ 
+ 	IssmDouble* serial_solution=NULL;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h	(revision 13216)
+@@ -10,8 +10,8 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
+-int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
++int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
++int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
+ 
+ #endif /* _CONTOURTONODESX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp	(revision 13216)
+@@ -3,7 +3,7 @@
+ 
+ #include "./ContourToNodesx.h"
+ 
+-int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){
++int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){
+ 
+ 	int i;
+ 	int m,n;
+@@ -16,9 +16,9 @@
+ 	double   value;
+ 
+ 	/*output: */
+-	Vector* flags=NULL;
++	Vector<IssmDouble>* flags=NULL;
+ 
+-	flags=new Vector(nods);
++	flags=new Vector<IssmDouble>(nods);
+ 
+ 	/*Loop through all contours: */
+ 	for (i=0;i<numcontours;i++){
+@@ -38,7 +38,7 @@
+ 	return 1;
+ }
+ 
+-int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
++int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
+ 
+ 	int i;
+ 	int m,n;
+@@ -51,9 +51,9 @@
+ 	double   value;
+ 
+ 	/*output: */
+-	Vector* flags=NULL;
++	Vector<IssmDouble>* flags=NULL;
+ 
+-	flags=new Vector(nods);
++	flags=new Vector<IssmDouble>(nods);
+ 
+ 	/*Loop through all contours: */
+ 	if(contours){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp	(revision 13216)
+@@ -5,10 +5,10 @@
+ 
+ #include "./Reducevectorgtosx.h"
+ 
+-void Reducevectorgtosx(Vector** pys, Vector* yg, Nodes* nodes,Parameters* parameters){
++void Reducevectorgtosx(Vector<IssmDouble>** pys, Vector<IssmDouble>* yg, Nodes* nodes,Parameters* parameters){
+ 
+ 	/*output: */
+-	Vector* ys=NULL;
++	Vector<IssmDouble>* ys=NULL;
+ 
+ 	/*variables: */
+ 	int i;
+@@ -25,7 +25,7 @@
+ 	}
+ 	else{
+ 		/*allocate: */
+-		ys=new Vector(ssize);
++		ys=new Vector<IssmDouble>(ssize);
+ 
+ 		if(nodes->NumberOfNodes(configuration_type)){ 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void Reducevectorgtosx(Vector** pys, Vector* yg, Nodes* nodes,Parameters* parameters);
++void Reducevectorgtosx(Vector<IssmDouble>** pys, Vector<IssmDouble>* yg, Nodes* nodes,Parameters* parameters);
+ 
+ #endif  /* _REDUCEVECTORGTOSX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 13216)
+@@ -8,15 +8,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void GetVectorFromInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){
++void GetVectorFromInputsx( Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){
+ 
+ 	int i;
+-	Vector* vector=NULL;
++	Vector<IssmDouble>* vector=NULL;
+ 
+ 	if(type==VertexEnum){
+ 
+ 		/*Allocate vector*/
+-		vector=new Vector(vertices->NumberOfVertices());
++		vector=new Vector<IssmDouble>(vertices->NumberOfVertices());
+ 
+ 		/*Look up in elements*/
+ 		for(i=0;i<elements->Size();i++){
+@@ -46,7 +46,7 @@
+ 	IssmDouble* vector=NULL;
+ 	
+ 	/*intermediary: */
+-	Vector* vec_vector=NULL;
++	Vector<IssmDouble>* vec_vector=NULL;
+ 
+ 	GetVectorFromInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters, name, type);
+ 	vector=vec_vector->ToMPISerial();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h	(revision 13216)
+@@ -8,7 +8,7 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void	GetVectorFromInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,int type);
++void	GetVectorFromInputsx( Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,int type);
+ void	GetVectorFromInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,int type);
+ 
+ #endif  /* _GETVECTORFROMINPUTSXX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 13216)
+@@ -47,7 +47,7 @@
+ 	error       =xNewZeroInit<double>(n_interp);
+ 
+ 	/*Get output*/
+-	options->Get(&output,"output","prediction");
++	options->Get(&output,"output",(char*)"prediction");
+ 
+ 	if(strcmp(output,"quadtree")==0){
+ 		observations->QuadtreeColoring(predictions,x_interp,y_interp,n_interp);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13216)
+@@ -40,7 +40,7 @@
+ 	error       =xNewZeroInit<double>(n_interp);
+ 
+ 	/*Get output*/
+-	options->Get(&output,"output","prediction");
++	options->Get(&output,"output",(char*)"prediction");
+ 
+ 	if(strcmp(output,"quadtree")==0){
+ 		observations->QuadtreeColoring(predictions,x_interp,y_interp,n_interp);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp	(revision 13216)
+@@ -8,7 +8,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector, int name, int type){
++void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector, int name, int type){
+ 
+ 	double* serial_vector=NULL;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void	InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* vector, int name,int type);
++void	InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* vector, int name,int type);
+ void	InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* vector, int name,int type);
+ void	InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int* vector, int name,int type);
+ void	InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,bool* vector, int name,int type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 13216)
+@@ -10,6 +10,8 @@
+ class DataSet;
+ class IoModel;
+ class Parameters;
++class DofIndexing;
++
+ #include "../../io/io.h"
+ 
+ void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters, FILE* iomodel_handle,const int solution_type,const int nummodels,const int* analysis_type_list);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	(revision 13216)
+@@ -27,7 +27,7 @@
+ 	xDelete<int>(control_type);
+ }
+ 
+-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector){
++void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector){
+ 	
+ 	IssmDouble* serial_vector=NULL;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	(revision 13216)
+@@ -8,7 +8,7 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* vector);
++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);
+ 
+ #endif 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13216)
+@@ -6,10 +6,10 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ 
+-int InterpFromMeshToMesh3dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value) {
++int InterpFromMeshToMesh3dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value) {
+ 
+ 	/*Output*/
+-	Vector* data_prime=NULL;
++	Vector<IssmDouble>* data_prime=NULL;
+ 
+ 	/*Intermediary*/
+ 	int i,j;
+@@ -53,7 +53,7 @@
+ 	}
+ 
+ 	/*Initialize output*/
+-	data_prime=new Vector(nods_prime);
++	data_prime=new Vector<IssmDouble>(nods_prime);
+ 	for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_value,INS_VAL);
+ 
+ 	/*Loop over the elements*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h	(revision 13216)
+@@ -8,7 +8,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../classes/objects/objects.h"
+ 
+-int InterpFromMeshToMesh3dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
++int InterpFromMeshToMesh3dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
+ 
+ #endif /* _INTERPFROMMESHTOMESH3DX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 13216)
+@@ -13,20 +13,20 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-void	Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters){
++void	Solverx(Vector<IssmDouble>** puf, Matrix<IssmDouble>* Kff, Vector<IssmDouble>* pf, Vector<IssmDouble>* uf0,Vector<IssmDouble>* df, Parameters* parameters){
+ 
+ 	/*Intermediary: */
+ 	int analysis_type;
+ 
+ 	/*output: */
+-	Vector *uf=NULL;
++	Vector<IssmDouble> *uf=NULL;
+ 
+ 	/*In debugging mode, check that stiffness matrix and load vectors are not NULL (they can be empty)*/
+ 	_assert_(Kff);
+ 	_assert_(pf);
+ 
+ 	/*Initialize vector: */
+-	uf=new Vector();
++	uf=new Vector<IssmDouble>();
+ 
+ 	/*According to matrix type, use specific solvers: */
+ 	switch(Kff->type){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13216)
+@@ -14,7 +14,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void	Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters);
++void	Solverx(Vector<IssmDouble>** puf, Matrix<IssmDouble>* Kff, Vector<IssmDouble>* pf, Vector<IssmDouble>* uf0,Vector<IssmDouble>* df, Parameters* parameters);
+ 
+ #ifdef _HAVE_PETSC_
+ void	SolverxPetsc(PetscVec** puf, PetscMat* Kff, PetscVec* pf, PetscVec* uf0,PetscVec* df, Parameters* parameters);
+@@ -22,7 +22,7 @@
+ void  DofTypesToIndexSet(IS* pisv, IS* pisp, Vec df,int typeenum);
+ #endif
+ 
+-void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf,Parameters* parameters);
++void SolverxSeq(SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf,Parameters* parameters);
+ void SolverxSeq(IssmPDouble *X, IssmPDouble *A, IssmPDouble *B,int n);
+ 
+ #ifdef _HAVE_ADOLC_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13216)
+@@ -22,12 +22,12 @@
+ #include "../../shared/Numerics/adolc_edf.h"
+ #endif
+ 
+-void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf, Parameters* parameters){/*{{{*/
++void SolverxSeq(SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf, Parameters* parameters){/*{{{*/
+ 
+ 	#ifdef _HAVE_GSL_
+ 	/*Intermediary: */
+ 	int M,N,N2,s;
+-	SeqVec *uf = NULL;
++	SeqVec<IssmDouble> *uf = NULL;
+ 
+ 	Kff->GetSize(&M,&N);
+ 	pf->GetSize(&N2);
+@@ -40,7 +40,7 @@
+ #else
+ 	SolverxSeq(x,Kff->matrix,pf->vector,N);
+ #endif
+-	uf=new SeqVec(x,N);	
++	uf=new SeqVec<IssmDouble>(x,N);
+ 	xDelete(x);
+ 
+ 	/*Assign output pointers:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13216)
+@@ -16,10 +16,10 @@
+ /*}}}*/
+ 
+ /*InterpFromGridToMeshx{{{*/
+-int InterpFromGridToMeshx( Vector** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
++int InterpFromGridToMeshx( Vector<IssmDouble>** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
+ 
+ 	/*output: */
+-	Vector* data_mesh=NULL;
++	Vector<IssmDouble>* data_mesh=NULL;
+ 	
+ 	/*Intermediary*/
+ 	double* x=NULL;
+@@ -46,7 +46,7 @@
+ 	}
+ 
+ 	/*Allocate output vector: */
+-	data_mesh=new Vector(nods);
++	data_mesh=new Vector<IssmDouble>(nods);
+ 
+ 	/*Find out what kind of coordinates (x_in,y_in) have been given is input*/
+ 	if(N==(x_rows-1) && M==(y_rows-1)){
+@@ -126,7 +126,7 @@
+ 	double *x             = gate->x;
+ 	double *y             = gate->y;
+ 	int     nods          = gate->nods;
+-	Vector *data_mesh     = gate->data_mesh;
++	Vector<IssmDouble>*data_mesh     = gate->data_mesh;
+ 	double *data          = gate->data;
+ 	double  default_value = gate->default_value;
+ 	int     interpenum    = gate->interp;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h	(revision 13216)
+@@ -23,10 +23,10 @@
+ 	int     nods;
+ 	double* x_mesh;
+ 	double* y_mesh;
+-	Vector*     data_mesh;
++	Vector<IssmDouble>*     data_mesh;
+ } InterpFromGridToMeshxThreadStruct;
+ 
+-int    InterpFromGridToMeshx( Vector** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
++int    InterpFromGridToMeshx( Vector<IssmDouble>** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
+ void*  InterpFromGridToMeshxt(void* vInterpFromGridToMeshxThreadStruct);
+ bool   findindices(int* pn,int* pm,double* x,int x_rows, double* y,int y_rows, double xgrid,double ygrid);
+ double triangleinterp(double x1,double x2,double y1,double y2,double Q11,double Q12,double Q21,double Q22,double x,double y);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.cpp	(revision 13216)
+@@ -4,10 +4,10 @@
+ 
+ #include "./Orthx.h"
+ 
+-void	Orthx( Vector** pnewgradj, Vector* gradj, Vector* oldgradj){
++void	Orthx( Vector<IssmDouble>** pnewgradj, Vector<IssmDouble>* gradj, Vector<IssmDouble>* oldgradj){
+ 	
+ 	/*output: */
+-	Vector* newgradj=NULL;
++	Vector<IssmDouble>* newgradj=NULL;
+ 
+ 	/*intermediary:*/
+ 	IssmDouble norm_new,norm_old,dot_product;;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Orthx/Orthx.h	(revision 13216)
+@@ -10,7 +10,7 @@
+ #include "../../shared/shared.h"
+ 
+ /* local prototypes: */
+-void	Orthx( Vector** pnewgradj, Vector* gradj, Vector* oldgradj);
++void	Orthx( Vector<IssmDouble>** pnewgradj, Vector<IssmDouble>* gradj, Vector<IssmDouble>* oldgradj);
+ 
+ #endif  /* _ORTHX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void SystemMatricesx(Matrix** pKff, Matrix** pKfs, Vector** ppf, Vector** pdf, IssmDouble* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool kflag,bool pflag,bool penalty_kflag,bool penalty_pflag){
++void SystemMatricesx(Matrix<IssmDouble>** pKff, Matrix<IssmDouble>** pKfs, Vector<IssmDouble>** ppf, Vector<IssmDouble>** pdf, IssmDouble* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool kflag,bool pflag,bool penalty_kflag,bool penalty_pflag){
+ 	
+ 	/*intermediary: */
+ 	int      i,j;
+@@ -20,10 +20,10 @@
+ 	Load    *load    = NULL;
+ 	
+ 	/*output: */
+-	Matrix*    Kff  = NULL;
+-	Matrix*    Kfs  = NULL;
+-	Vector*    pf   = NULL;
+-	Vector*    df=NULL;
++	Matrix<IssmDouble>*    Kff  = NULL;
++	Matrix<IssmDouble>*    Kfs  = NULL;
++	Vector<IssmDouble>*    pf   = NULL;
++	Vector<IssmDouble>*    df=NULL;
+ 	IssmDouble kmax = 0;
+ 
+ 	/*Display message*/
+@@ -48,9 +48,9 @@
+ 	/*Compute penalty free mstiffness matrix and load vector*/
+ 	if(kflag){
+ 
+-		Kff=new Matrix(fsize,fsize,connectivity,numberofdofspernode);
+-		Kfs=new Matrix(fsize,ssize,connectivity,numberofdofspernode);
+-		df=new Vector(fsize);
++		Kff=new Matrix<IssmDouble>(fsize,fsize,connectivity,numberofdofspernode);
++		Kfs=new Matrix<IssmDouble>(fsize,ssize,connectivity,numberofdofspernode);
++		df=new Vector<IssmDouble>(fsize);
+ 
+ 		/*Fill stiffness matrix from elements: */
+ 		for (i=0;i<elements->Size();i++){
+@@ -72,7 +72,7 @@
+ 	
+ 	if(pflag){
+ 
+-		pf=new Vector(fsize);
++		pf=new Vector<IssmDouble>(fsize);
+ 
+ 		/*Fill right hand side vector, from elements: */
+ 		for (i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.h	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void SystemMatricesx(Matrix** pKff, Matrix** pKfs, Vector** ppf, Vector** pdf, IssmDouble* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,
++void SystemMatricesx(Matrix<IssmDouble>** pKff, Matrix<IssmDouble>** pKfs, Vector<IssmDouble>** ppf, Vector<IssmDouble>** pdf, IssmDouble* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,
+ 			bool kflag=true,bool pflag=true,bool penalty_kflag=true,bool penalty_pflag=true);
+ 
+ #endif  /* _SYSTEMMATRICESX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp	(revision 13216)
+@@ -9,14 +9,14 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void CreateJacobianMatrixx(Matrix** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax){
++void CreateJacobianMatrixx(Matrix<IssmDouble>** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax){
+ 	
+ 	int      i,connectivity;
+ 	int      numberofdofspernode;
+ 	int      fsize,configuration_type;
+ 	Element *element = NULL;
+ 	Load    *load    = NULL;
+-	Matrix*  Jff     = NULL;
++	Matrix<IssmDouble>*  Jff     = NULL;
+ 
+ 	/*Checks*/
+ 	_assert_(nodes && elements);
+@@ -28,7 +28,7 @@
+ 	numberofdofspernode=nodes->MaxNumDofs(configuration_type,GsetEnum);
+ 
+ 	/*Initialize Jacobian Matrix*/
+-	Jff=new Matrix(fsize,fsize,connectivity,numberofdofspernode);
++	Jff=new Matrix<IssmDouble>(fsize,fsize,connectivity,numberofdofspernode);
+ 	
+ 	/*Create and assemble matrix*/
+ 	for(i=0;i<elements->Size();i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h	(revision 13216)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void CreateJacobianMatrixx(Matrix** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax);
++void CreateJacobianMatrixx(Matrix<IssmDouble>** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax);
+ 
+ #endif  /* _CREATEJACOBIANMATRIXX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 13216)
+@@ -9,15 +9,15 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void Gradjx(Vector** pgradient,IssmDouble** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
++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;
+ 	IssmDouble   norm_inf;
+ 	IssmDouble  *norm_list     = NULL;
+ 	int     *control_type  = NULL;
+-	Vector  *gradient      = NULL;
+-	Vector **gradient_list = NULL;
++	Vector<IssmDouble>  *gradient      = NULL;
++	Vector<IssmDouble> **gradient_list = NULL;
+ 	
+ 	/*retrieve some parameters: */
+ 	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);   _assert_(num_controls);
+@@ -25,12 +25,12 @@
+ 	numberofvertices=vertices->NumberOfVertices();
+ 
+ 	/*Allocate gradient_list */
+-	gradient_list = xNew<Vector*>(num_controls);
++	gradient_list = xNew<Vector<IssmDouble>*>(num_controls);
+ 	norm_list = xNew<IssmDouble>(num_controls);
+ 	for(i=0;i<num_controls;i++){
+-		gradient_list[i]=new Vector(num_controls*numberofvertices);
++		gradient_list[i]=new Vector<IssmDouble>(num_controls*numberofvertices);
+ 	}
+-	gradient=new Vector(num_controls*numberofvertices);
++	gradient=new Vector<IssmDouble>(num_controls*numberofvertices);
+ 
+ 	/*Compute all gradient_list*/
+ 	for(i=0;i<num_controls;i++){
+@@ -64,6 +64,6 @@
+ 		xDelete<IssmDouble>(norm_list);
+ 	}
+ 	if(pgradient)  *pgradient=gradient;
+-	xDelete<Vector*>(gradient_list);
++	xDelete<Vector<IssmDouble>*>(gradient_list);
+ 	xDelete<int>(control_type);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Gradjx/Gradjx.h	(revision 13216)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void Gradjx(Vector** pgrad_g,IssmDouble** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
++void Gradjx(Vector<IssmDouble>** pgrad_g,IssmDouble** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
+ 
+ #endif  /* _GRADJX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VecMergex/VecMergex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VecMergex/VecMergex.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VecMergex/VecMergex.cpp	(revision 13216)
+@@ -8,9 +8,8 @@
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
++void VecMergex(Vector<IssmDouble>* ug, Vector<IssmDouble>* uf, Nodes* nodes, Parameters* parameters, int SetEnum){
+ 
+-void VecMergex(Vector* ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum){
+-
+ 	/*variables: */
+ 	int i;
+ 	int configuration_type;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VecMergex/VecMergex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VecMergex/VecMergex.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/VecMergex/VecMergex.h	(revision 13216)
+@@ -9,6 +9,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void VecMergex(Vector* ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum);
++void VecMergex(Vector<IssmDouble>* ug, Vector<IssmDouble>* uf, Nodes* nodes, Parameters* parameters, int SetEnum);
+ 
+ #endif  /* _VECMERGEX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp	(revision 13216)
+@@ -6,10 +6,10 @@
+ #include "../../io/io.h"
+ #include "./Mergesolutionfromftogx.h"
+ 
+-void	Mergesolutionfromftogx( Vector** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){
++void	Mergesolutionfromftogx( Vector<IssmDouble>** pug, Vector<IssmDouble>* uf, Vector<IssmDouble>* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){
+ 
+ 	/*output: */
+-	Vector* ug=NULL;
++	Vector<IssmDouble>* ug=NULL;
+ 
+ 	/*intermediary: */
+ 	int configuration_type;
+@@ -33,7 +33,7 @@
+ 	}
+ 
+ 	/*initialize ug: */
+-	ug=new Vector(gsize);
++	ug=new Vector<IssmDouble>(gsize);
+ 
+ 	/*Merge f set back into g set: */
+ 	if(fsize){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h	(revision 13216)
+@@ -8,7 +8,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void	Mergesolutionfromftogx( Vector** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false);
++void	Mergesolutionfromftogx( Vector<IssmDouble>** pug, Vector<IssmDouble>* uf, Vector<IssmDouble>* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false);
+ 
+ #endif  /* _MERGESOLUTIONFROMFTOGX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp	(revision 13216)
+@@ -10,7 +10,7 @@
+ 
+ #include "./ContourToMeshx.h"
+ 
+-int ContourToMeshx( Vector** pin_nod,Vector** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
++int ContourToMeshx( Vector<IssmDouble>** pin_nod,Vector<IssmDouble>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
+ 
+ 	int noerr=1;
+ 	int i;
+@@ -29,11 +29,11 @@
+ 
+ 
+ 	/*output: */
+-	Vector* in_nod=NULL;
+-	Vector* in_elem=NULL;
++	Vector<IssmDouble>* in_nod=NULL;
++	Vector<IssmDouble>* in_elem=NULL;
+ 
+-	in_nod=new Vector(nods);
+-	in_elem=new Vector(nel);
++	in_nod=new Vector<IssmDouble>(nods);
++	in_elem=new Vector<IssmDouble>(nel);
+ 
+ 	/*initialize thread parameters: */
+ 	gate.contours=contours;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp	(revision 13216)
+@@ -32,7 +32,7 @@
+ 	int edgevalue;
+ 	double* x=NULL;
+ 	double* y=NULL;
+-	Vector* in_nod=NULL;
++	Vector<IssmDouble>* in_nod=NULL;
+ 
+ 
+ 	/*recover handle and gate: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h	(revision 13216)
+@@ -15,7 +15,7 @@
+ 	DataSet* contours;
+ 	int nods;
+ 	int edgevalue;
+-	Vector* in_nod;
++	Vector<IssmDouble>* in_nod;
+ 	double* x;
+ 	double* y;
+ 
+@@ -23,7 +23,7 @@
+ 
+ 
+ /* local prototypes: */
+-int ContourToMeshx( Vector** pin_nods,Vector** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
++int ContourToMeshx( Vector<IssmDouble>** pin_nods,Vector<IssmDouble>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
+ 
+ void* ContourToMeshxt(void* vContourToMeshxThreadStruct);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void CreateNodalConstraintsx( Vector** pys, Nodes* nodes,int configuration_type){
++void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes,int configuration_type){
+ 
+ 	int i;
+ 	
+@@ -17,13 +17,13 @@
+ 	int  numberofdofs;
+ 
+ 	/*output: */
+-	Vector* ys=NULL;
++	Vector<IssmDouble>* ys=NULL;
+ 
+ 	/*figure out how many dofs we have: */
+ 	numberofdofs=nodes->NumberOfDofs(configuration_type,SsetEnum);
+ 
+ 	/*allocate:*/
+-	ys=new Vector(numberofdofs);
++	ys=new Vector<IssmDouble>(numberofdofs);
+ 
+ 	/*go through all nodes, and for the ones corresponding to this configuration_type, fill the 
+ 	 * constraints vector with the constraint values: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h	(revision 13216)
+@@ -8,6 +8,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void CreateNodalConstraintsx( Vector** pys, Nodes* nodes,int configuration_type);
++void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes,int configuration_type);
+ 
+ #endif  /* _CREATENODALCONSTRAINTSX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 13216)
+@@ -19,18 +19,18 @@
+ #endif
+ /*}}}*/
+ 
+-void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
++void TriMeshx(Matrix<IssmDouble>** pindex,Vector<IssmDouble>** px,Vector<IssmDouble>** py,Matrix<IssmDouble>** psegments,Vector<IssmDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
+ 
+ 	/*indexing: */
+ 	int i,j;
+ 
+ 	/*output: */
+ 	double* index=NULL;
+-	Matrix* index_matrix=NULL;
++	Matrix<IssmDouble>* index_matrix=NULL;
+ 	double* x=NULL;
+ 	double* y=NULL;
+ 	double* segments=NULL;
+-	Matrix* segments_matrix=NULL;
++	Matrix<IssmDouble>* segments_matrix=NULL;
+ 	double* segmentmarkerlist=NULL;
+ 
+ 	/*intermediary: */
+@@ -191,13 +191,13 @@
+ 	OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
+ 
+ 	/*Output : */
+-	index_matrix=new Matrix(index,out.numberoftriangles,3,1,SeqMatType);
++	index_matrix=new Matrix<IssmDouble>(index,out.numberoftriangles,3,1,SeqMatType);
+ 	*pindex=index_matrix;
+ 	
+-	segments_matrix=new Matrix(segments,out.numberofsegments,3,1,SeqMatType);
++	segments_matrix=new Matrix<IssmDouble>(segments,out.numberofsegments,3,1,SeqMatType);
+ 	*psegments=segments_matrix;
+ 
+-	*px=new Vector(x,out.numberofpoints,SeqMatType);
+-	*py=new Vector(y,out.numberofpoints,SeqMatType);
+-	*psegmentmarkerlist=new Vector(segmentmarkerlist,out.numberofsegments,SeqMatType);
++	*px=new Vector<IssmDouble>(x,out.numberofpoints,SeqMatType);
++	*py=new Vector<IssmDouble>(y,out.numberofpoints,SeqMatType);
++	*psegmentmarkerlist=new Vector<IssmDouble>(segmentmarkerlist,out.numberofsegments,SeqMatType);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h	(revision 13216)
+@@ -10,6 +10,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
++void TriMeshx(Matrix<IssmDouble>** pindex,Vector<IssmDouble>** px,Vector<IssmDouble>** py,Matrix<IssmDouble>** psegments,Vector<IssmDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
+ 
+ #endif  /* _TRIMESHX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp	(revision 13216)
+@@ -8,19 +8,19 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void ControlInputGetGradientx( Vector** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
++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*  gradient=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(num_controls*vertices->NumberOfVertices());
++	gradient=new Vector<IssmDouble>(num_controls*vertices->NumberOfVertices());
+ 
+ 	for(int i=0;i<num_controls;i++){
+ 		for(int j=0;j<elements->Size();j++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h	(revision 13216)
+@@ -7,6 +7,6 @@
+ #include "../../classes/objects/objects.h"
+ #include "../../Container/Container.h"
+ 
+-void	ControlInputGetGradientx( Vector** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
++void	ControlInputGetGradientx( Vector<IssmDouble>** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
+ 
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp	(revision 13216)
+@@ -9,7 +9,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector* yg){
++void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector<IssmDouble>* yg){
+ 	
+ 	int configuration_type;
+ 	IssmDouble* yg_serial=NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h	(revision 13216)
+@@ -8,6 +8,6 @@
+ #include "../../Container/Container.h"
+ #include "../../classes/objects/objects.h"
+ 
+-void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector* yg);
++void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector<IssmDouble>* yg);
+ 
+ #endif  /* _UPDATESPCSX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp	(revision 13216)
+@@ -16,7 +16,7 @@
+ 	double* y;
+ 	int     nods;
+ 	double  mindistance;
+-	Vector*     flags;
++	Vector<IssmDouble>*     flags;
+ 
+ 	/*recover handle and gate: */
+ 	handle=(pthread_handle*)vpthread_handle;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h	(revision 13216)
+@@ -10,7 +10,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-int PointCloudFindNeighborsx( Vector** pflags,double* x, double* y, int nods, double mindistance,double multithread);
++int PointCloudFindNeighborsx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread);
+ 
+ /*threading: */
+ typedef struct{
+@@ -19,7 +19,7 @@
+ 	double* y;
+ 	int nods;
+ 	double mindistance;
+-	Vector* flags;
++	Vector<IssmDouble>* flags;
+ 
+ 
+ } PointCloudFindNeighborsThreadStruct;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp	(revision 13216)
+@@ -3,11 +3,11 @@
+ 
+ #include "./PointCloudFindNeighborsx.h"
+ 
+-int PointCloudFindNeighborsx( Vector** pflags,double* x, double* y, int nods, double mindistance,double multithread){
++int PointCloudFindNeighborsx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread){
+ 
+ 	/*output: */
+-	Vector* flags=NULL;
+-	flags=new Vector(nods);
++	Vector<IssmDouble>* flags=NULL;
++	flags=new Vector<IssmDouble>(nods);
+ 
+ 	/*threading: */
+ 	PointCloudFindNeighborsThreadStruct gate;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.h	(revision 13216)
+@@ -1,5 +1,5 @@
+ /*!\file:  SeqMat.h
+- * \brief wrapper to SeqMat objects, which are just wrappers to a simple IssmDouble* buffer.
++ * \brief wrapper to SeqMat objects, which are just wrappers to a simple IssmDouble or IssmPDouble* buffer.
+  */ 
+ 
+ #ifndef _SEQMAT_H_
+@@ -13,39 +13,219 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../toolkitsenums.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../shared/MemOps/xMemCpy.h"
++#include "../../shared/Alloc/alloc.h"
++#include "../../include/macros.h"
++#include "./SeqVec.h"
+ 
+ /*}}}*/
+-class SeqVec;
+ 
++/*We need to template this class, in case we want to create Matrices that hold IssmDouble* matrix or IssmPDouble* matrix. 
++  Such matrices would be useful for use without or with the matlab or python interface (which do not care for IssmDouble types, 
++  but only rely on IssmPDouble types)*/
++
++template <class doubletype> 
+ class SeqMat{
+ 
+ 	public:
+ 	
+ 		int M,N; 
+-		IssmDouble* matrix; 
++		doubletype* matrix;  /*here, doubletype is either IssmDouble or IssmPDouble*/
+ 
+-		/*SeqMat constructors, destructors {{{*/
+-		SeqMat();
+-		SeqMat(int M,int N);
+-		SeqMat(int M,int N,IssmDouble sparsity);
+-		SeqMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity);
+-		SeqMat(int M,int N,int connectivity,int numberofdofspernode);
+-		~SeqMat();
++		/*SeqMat constructors, destructors*/
++		/*FUNCTION SeqMat(){{{*/
++		SeqMat(){
++
++			this->M=0;
++			this->N=0;
++			this->matrix=NULL;
++		}
+ 		/*}}}*/
+-		/*SeqMat specific routines {{{*/
+-		void Echo(void);
+-		void Assemble(void);
+-		IssmDouble Norm(NormMode norm_type);
+-		void GetSize(int* pM,int* pN);
+-		void GetLocalSize(int* pM,int* pN);
+-		void MatMult(SeqVec* X,SeqVec* AX);
+-		SeqMat* Duplicate(void);
+-		IssmDouble* ToSerial(void);
+-		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode);
+-		void Convert(MatrixType type);
++		/*FUNCTION SeqMat(int M,int N){{{*/
++		SeqMat(int pM,int pN){
++
++			this->M=pM;
++			this->N=pN;
++			this->matrix=NULL;
++			if(M*N) this->matrix=xNewZeroInit<doubletype>(pM*pN);
++		}
+ 		/*}}}*/
++		/*FUNCTION SeqMat(int M,int N, doubletype sparsity){{{*/
++		SeqMat(int pM,int pN, doubletype sparsity){
+ 
++			this->M=pM;
++			this->N=pN;
++			this->matrix=NULL;
++			if(M*N) this->matrix=xNewZeroInit<doubletype>(pM*pN);
++		}
++		/*}}}*/
++		/*FUNCTION SeqMat(doubletype* serial_mat,int M,int N,doubletype sparsity){{{*/
++		SeqMat(doubletype* serial_mat,int pM,int pN,doubletype sparsity){
++
++			int i,j;
++
++			this->M=pM;
++			this->N=pN;
++			this->matrix=NULL;
++			if(M*N){
++				this->matrix=xNewZeroInit<doubletype>(pM*pN);
++				xMemCpy<doubletype>(this->matrix,serial_mat,pM*pN);
++			}
++
++		}
++		/*}}}*/
++		/*FUNCTION SeqMat(int M,int N, int connectivity, int numberofdofspernode){{{*/
++		SeqMat(int pM,int pN, int connectivity,int numberofdofspernode){
++
++			this->M=pM;
++			this->N=pN;
++			this->matrix=NULL;
++			if(M*N) this->matrix=xNewZeroInit<doubletype>(pM*pN);
++		}
++		/*}}}*/
++		/*FUNCTION ~SeqMat(){{{*/
++		~SeqMat(){
++
++			xDelete<doubletype>(this->matrix);
++			M=0;
++			N=0;
++		}
++		/*}}}*/
++
++		/*SeqMat specific routines */
++		/*FUNCTION Echo{{{*/
++		void Echo(void){
++
++			int i,j;
++			_printLine_("SeqMat size " << this->M << "-" << this->N);
++			for(i=0;i<M;i++){
++				for(j=0;j<N;j++){
++					_printString_(this->matrix[N*i+j] << " ");
++				}
++				_printLine_("");
++			}
++		}
++		/*}}}*/
++		/*FUNCTION Assemble{{{*/
++		void Assemble(void){
++
++			/*do nothing*/
++
++		}
++		/*}}}*/
++		/*FUNCTION Norm{{{*/
++		doubletype Norm(NormMode mode){
++
++			doubletype norm;
++			doubletype absolute;
++			int i,j;
++
++			switch(mode){
++				case NORM_INF:
++					norm=0;
++					for(i=0;i<this->M;i++){
++						absolute=0;
++						for(j=0;j<this->N;j++){
++							absolute+=fabs(this->matrix[N*i+j]);
++						}
++						norm=max(norm,absolute);
++					}
++					return norm;
++					break; 
++				default:
++					_error_("unknown norm !");
++					break;
++			}
++		}
++		/*}}}*/
++		/*FUNCTION GetSize{{{*/
++		void GetSize(int* pM,int* pN){
++
++			*pM=this->M;
++			*pN=this->N;
++
++		}
++		/*}}}*/
++		/*FUNCTION GetLocalSize{{{*/
++		void GetLocalSize(int* pM,int* pN){
++
++			*pM=this->M;
++			*pN=this->N;
++
++		}
++		/*}}}*/
++		/*FUNCTION MatMult{{{*/
++		void MatMult(SeqVec<doubletype>* X,SeqVec<doubletype>* AX){
++
++			int i,j;
++			int XM,AXM;
++			doubletype dummy;
++
++			X->GetSize(&XM);
++			AX->GetSize(&AXM);
++
++			if(M!=AXM)_error_("A and AX should have the same number of rows!");
++			if(N!=XM)_error_("A and X should have the same number of columns!");
++
++			for(i=0;i<M;i++){
++				dummy=0;
++				for(j=0;j<N;j++){
++					dummy+= this->matrix[N*i+j]*X->vector[j];
++				}
++				AX->vector[i]=dummy;
++			}
++
++		}
++		/*}}}*/
++		/*FUNCTION Duplicate{{{*/
++		SeqMat* Duplicate(void){
++
++			doubletype dummy=0;
++
++			return new SeqMat(this->matrix,this->M,this->N,dummy);
++
++		}
++		/*}}}*/
++		/*FUNCTION ToSerial{{{*/
++		doubletype* ToSerial(void){
++
++			doubletype* buffer=NULL;
++
++			if(this->M*this->N){
++				buffer=xNew<doubletype>(this->M*this->N);
++				xMemCpy<doubletype>(buffer,this->matrix,this->M*this->N);
++			}
++			return buffer;
++
++		}
++		/*}}}*/
++		/*FUNCTION SetValues{{{*/
++		void SetValues(int m,int* idxm,int n,int* idxn,doubletype* values,InsMode mode){
++
++			int i,j;
++			switch(mode){
++				case ADD_VAL:
++					for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]+=values[n*i+j];
++					break;
++				case INS_VAL:
++					for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]=values[n*i+j];
++					break;
++				default:
++					_error_("unknown insert mode!");
++					break;
++			}
++
++		}
++		/*}}}*/
++		/*FUNCTION Convert{{{*/
++		void Convert(MatrixType type){
++
++			/*do nothing*/
++
++		}
++		/*}}}*/		
++
+ };
+-		
++
+ #endif //#ifndef _SEQMAT_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/issmtoolkit.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/issmtoolkit.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/issmtoolkit.h	(revision 13216)
+@@ -5,8 +5,6 @@
+ #ifndef _ISSM_TOOLKIT_H_
+ #define _ISSM_TOOLKIT_H_
+ 
+-#include "../../include/include.h"
+-
+ #include "./SeqMat.h"
+ #include "./SeqVec.h"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.h	(revision 13216)
+@@ -13,42 +13,240 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#include "../toolkitsenums.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../shared/MemOps/xMemCpy.h"
++#include "../../shared/Alloc/alloc.h"
++#include "../../include/macros.h"
+ 
+ /*}}}*/
+ 
++/*We need to template this class, in case we want to create vectors that hold IssmDouble* matrix or IssmPDouble* matrix. 
++  Such vectors would be useful for use without or with the matlab or python interface (which do not care for IssmDouble types, 
++  but only rely on IssmPDouble types)*/
++
++template <class doubletype> 
+ class SeqVec{
+ 
+ 	public:
+ 	
+-		IssmDouble* vector;
++		doubletype* vector;
+ 		int M;
+ 
+-		/*SeqVec constructors, destructors {{{*/
+-		SeqVec();
+-		SeqVec(int M,bool fromlocalsize=false);
+-		SeqVec(IssmDouble* buffer, int M);
+-		~SeqVec();
++		/*SeqVec constructors, destructors*/
++		/*FUNCTION SeqVec(){{{*/
++		SeqVec(){
++
++			this->M=0;
++			this->vector=NULL;
++		}
+ 		/*}}}*/
+-		/*SeqVec specific routines {{{*/
+-		void Echo(void);
+-		void Assemble(void);
+-		void SetValues(int ssize, int* list, IssmDouble* values, InsMode mode);
+-		void SetValue(int dof, IssmDouble value, InsMode  mode);
+-		void GetValue(IssmDouble* pvalue, int dof);
+-		void GetSize(int* pM);
+-		void GetLocalSize(int* pM);
+-		SeqVec* Duplicate(void);
+-		void Set(IssmDouble value);
+-		void AXPY(SeqVec* X, IssmDouble a);
+-		void AYPX(SeqVec* X, IssmDouble a);
+-		IssmDouble* ToMPISerial(void);
+-		void Copy(SeqVec* to);
+-		IssmDouble Norm(NormMode norm_type);
+-		void Scale(IssmDouble scale_factor);
+-		void PointwiseDivide(SeqVec* x,SeqVec* y);
+-		IssmDouble Dot(SeqVec* vector);
++		/*FUNCTION SeqVec(int M,bool fromlocalsize){{{*/
++		SeqVec(int pM,bool fromlocalsize){
++
++			this->M=pM;
++			this->vector=NULL;
++			if(this->M) this->vector=xNewZeroInit<doubletype>(pM);
++		}
+ 		/*}}}*/
++		/*FUNCTION SeqVec(doubletype* serial_vec,int M){{{*/
++		SeqVec(doubletype* buffer,int pM){
++
++			int i,j;
++
++			this->M=pM;
++			this->vector=NULL;
++			if(this->M){
++				this->vector=xNew<doubletype>(pM);
++				xMemCpy<doubletype>(this->vector,buffer,pM);
++			}
++		}
++		/*}}}*/
++		/*FUNCTION ~SeqVec(){{{*/
++		~SeqVec(){
++			xDelete<doubletype>(this->vector);
++			M=0;
++		}
++		/*}}}*/
++
++		/*SeqVec specific routines*/
++		/*FUNCTION Echo{{{*/
++		void Echo(void){
++
++			int i;
++			_printLine_("SeqVec size " << this->M);
++			for(i=0;i<M;i++){
++				_printString_(vector[i] << "\n ");
++			}
++		}
++		/*}}}*/
++		/*FUNCTION Assemble{{{*/
++		void Assemble(void){
++
++			/*do nothing*/
++
++		}
++		/*}}}*/
++		/*FUNCTION SetValues{{{*/
++		void SetValues(int ssize, int* list, doubletype* values, InsMode mode){
++
++			int i;
++			switch(mode){
++				case ADD_VAL:
++					for(i=0;i<ssize;i++) this->vector[list[i]]+=values[i];
++					break;
++				case INS_VAL:
++					for(i=0;i<ssize;i++) this->vector[list[i]]=values[i];
++					break;
++				default:
++					_error_("unknown insert mode!");
++					break;
++			}
++
++		}
++		/*}}}*/
++		/*FUNCTION SetValue{{{*/
++		void SetValue(int dof, doubletype value, InsMode mode){
++
++			switch(mode){
++				case ADD_VAL:
++					this->vector[dof]+=value;
++					break;
++				case INS_VAL:
++					this->vector[dof]=value;
++					break;
++				default:
++					_error_("unknown insert mode!");
++					break;
++			}
++		}
++		/*}}}*/
++		/*FUNCTION GetValue{{{*/
++		void GetValue(doubletype* pvalue,int dof){
++
++			*pvalue=this->vector[dof];
++
++		}
++		/*}}}*/
++		/*FUNCTION GetSize{{{*/
++		void GetSize(int* pM){
++
++			*pM=this->M;
++
++		}
++		/*}}}*/
++		/*FUNCTION GetLocalSize{{{*/
++		void GetLocalSize(int* pM){
++
++			*pM=this->M;
++
++		}
++		/*}}}*/
++		/*FUNCTION Duplicate{{{*/
++		SeqVec* Duplicate(void){
++
++			return new SeqVec(this->vector,this->M);
++
++		}
++		/*}}}*/
++		/*FUNCTION Set{{{*/
++		void Set(doubletype value){
++
++			int i;
++			for(i=0;i<this->M;i++)this->vector[i]=value;
++
++		}
++		/*}}}*/
++		/*FUNCTION AXPY{{{*/
++		void AXPY(SeqVec* X, doubletype a){
++
++			int i;
++
++			/*y=a*x+y where this->vector is y*/
++			for(i=0;i<this->M;i++)this->vector[i]=a*X->vector[i]+this->vector[i];
++
++		}
++		/*}}}*/
++		/*FUNCTION AYPX{{{*/
++		void AYPX(SeqVec* X, doubletype a){
++
++			int i;
++
++			/*y=x+a*y where this->vector is y*/
++			for(i=0;i<this->M;i++)this->vector[i]=X->vector[i]+a*this->vector[i];
++
++		}
++		/*}}}*/
++		/*FUNCTION ToMPISerial{{{*/
++		doubletype* ToMPISerial(void){
++
++			doubletype* buffer=NULL;
++
++			if(this->M){
++				buffer=xNew<doubletype>(this->M);
++				xMemCpy<doubletype>(buffer,this->vector,this->M);
++			}
++			return buffer;
++
++		}
++		/*}}}*/
++		/*FUNCTION Copy{{{*/
++		void Copy(SeqVec* to){
++
++			int i;
++
++			to->M=this->M;
++			for(i=0;i<this->M;i++)to->vector[i]=this->vector[i];
++
++		}
++		/*}}}*/
++		/*FUNCTION Norm{{{*/
++		doubletype Norm(NormMode mode){
++
++			doubletype norm;
++			int i;
++
++			switch(mode){
++				case NORM_INF:
++					norm=0; for(i=0;i<this->M;i++)norm=max(norm,fabs(this->vector[i]));
++					return norm;
++					break;
++				case NORM_TWO:
++					norm=0; 
++					for(i=0;i<this->M;i++)norm+=pow(this->vector[i],2);
++					return sqrt(norm);
++					break;
++				default:
++					_error_("unknown norm !");
++					break;
++			}
++		}
++		/*}}}*/
++		/*FUNCTION Scale{{{*/
++		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(SeqVec* input){
++
++			int i;
++
++			doubletype dot=0;
++			for(i=0;i<this->M;i++)dot+=this->vector[i]*input->vector[i];
++			return dot;
++
++		}
++		/*}}}*/
++		/*FUNCTION PointwiseDivide{{{*/
++		void PointwiseDivide(SeqVec* x,SeqVec* y){
++
++			int i;
++			/*pointwise w=x/y where this->vector is w: */
++			for(i=0;i<this->M;i++)this->vector[i]=x->vector[i]/y->vector[i];
++		}
++		/*}}}*/
+ };
+-
+ #endif //#ifndef _SEQVEC_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13216)
+@@ -131,9 +131,7 @@
+ 					./classes/matrix/ElementVector.h\
+ 					./classes/matrix/ElementVector.cpp\
+ 					./classes/matrix/Matrix.h\
+-					./classes/matrix/Matrix.cpp\
+ 					./classes/matrix/Vector.h\
+-					./classes/matrix/Vector.cpp\
+ 					./classes/objects/Params/Param.h\
+ 					./classes/objects/Params/GenericParam.h\
+ 					./classes/objects/Params/BoolParam.cpp\
+@@ -236,9 +234,7 @@
+ 					./toolkits/metis/metisincludes.h\
+ 					./toolkits/issm/issmtoolkit.h\
+ 					./toolkits/issm/SeqVec.h\
+-					./toolkits/issm/SeqVec.cpp\
+ 					./toolkits/issm/SeqMat.h\
+-					./toolkits/issm/SeqMat.cpp\
+ 					./toolkits/triangle/triangleincludes.h\
+ 					./toolkitsenums.h\
+ 					./toolkits.h\
+@@ -359,20 +355,10 @@
+ 					./solvers/solver_linear.cpp\
+ 					./solvers/solver_nonlinear.cpp\
+ 					./solvers/solver_newton.cpp\
+-					./classes/objects/Options/Option.cpp\
+ 					./classes/objects/Options/Option.h\
+-					./classes/objects/Options/OptionDouble.cpp\
+-					./classes/objects/Options/OptionDouble.h\
+-					./classes/objects/Options/OptionChar.cpp\
+-					./classes/objects/Options/OptionChar.h\
++					./classes/objects/Options/GenericOption.h\
+ 					./classes/objects/Options/OptionUtilities.cpp\
+-					./classes/objects/Options/OptionUtilities.h\
+-					./classes/objects/Options/OptionLogical.cpp\
+-					./classes/objects/Options/OptionLogical.h\
+-					./classes/objects/Options/OptionStruct.cpp\
+-					./classes/objects/Options/OptionStruct.h\
+-					./classes/objects/Options/OptionCell.cpp\
+-					./classes/objects/Options/OptionCell.h
++					./classes/objects/Options/OptionUtilities.h
+ 
+ #}}}
+ #DAKOTA sources  {{{
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 13216)
+@@ -69,11 +69,7 @@
+ 
+ /*Option parsing objects: */
+ #include "./Options/Option.h"
+-#include "./Options/OptionDouble.h"
+-#include "./Options/OptionLogical.h"
+-#include "./Options/OptionChar.h"
+-#include "./Options/OptionStruct.h"
+-#include "./Options/OptionCell.h"
++#include "./Options/GenericOption.h"
+ #include "./Options/OptionUtilities.h"
+ 
+ /*Inputs: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp	(revision 13216)
+@@ -192,7 +192,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Matdamageice::GetVectorFromInputs{{{*/
+-void  Matdamageice::GetVectorFromInputs(Vector* vector,int input_enum){
++void  Matdamageice::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){
+ 
+ 	/*Intermediaries*/
+ 	Element *element= NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.cpp	(revision 13216)
+@@ -172,7 +172,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Matice::GetVectorFromInputs{{{*/
+-void  Matice::GetVectorFromInputs(Vector* vector,int input_enum){
++void  Matice::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){
+ 
+ 	/*Intermediaries*/
+ 	Element *element= NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Material.h	(revision 13216)
+@@ -23,7 +23,7 @@
+ 		/*Numerics*/
+ 		virtual void       InputDuplicate(int original_enum,int new_enum)=0;
+ 		virtual void       Configure(Elements* elements)=0;
+-		virtual void       GetVectorFromInputs(Vector* vector,int input_enum)=0;
++		virtual void       GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum)=0;
+ 		virtual void       GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon)=0;
+ 		virtual void       GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon)=0;
+ 		virtual void       GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon)=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matdamageice.h	(revision 13216)
+@@ -48,7 +48,7 @@
+ 		/*Material virtual functions resolution: {{{*/
+ 		void   InputDuplicate(int original_enum,int new_enum);
+ 		void   Configure(Elements* elements);
+-		void   GetVectorFromInputs(Vector* vector,int input_enum);
++		void   GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum);
+ 		void   SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
+ 		void   GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
+ 		void   GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matice.h	(revision 13216)
+@@ -48,7 +48,7 @@
+ 		/*Material virtual functions resolution: {{{*/
+ 		void   InputDuplicate(int original_enum,int new_enum);
+ 		void   Configure(Elements* elements);
+-		void   GetVectorFromInputs(Vector* vector,int input_enum);
++		void   GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum);
+ 		void       SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+ 		void       GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
+ 		void       GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Materials/Matpar.h	(revision 13216)
+@@ -66,7 +66,7 @@
+ 		/*Material virtual functions resolution: {{{*/
+ 		void   InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");};
+ 		void   Configure(Elements* elements);
+-		void   GetVectorFromInputs(Vector* vector,int input_enum){return;}
++		void   GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){return;}
+ 		void       GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon){_error_("not supported");};
+ 		void       GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon){_error_("not supported");};
+ 		void       GetViscosity3dStokes(IssmDouble* pviscosity3d, IssmDouble* epsilon){_error_("not supported");};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 13216)
+@@ -76,7 +76,7 @@
+ 		IssmDouble MinAbs(void);
+ 		void Extrude(void){_error_("not supported yet");};
+ 		void VerticallyIntegrate(Input* thickness_input);
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp	(revision 13216)
+@@ -146,7 +146,7 @@
+ 	//gradient->Extrude();
+ }/*}}}*/
+ /*FUNCTION ControlInput::GetGradient{{{*/
+-void ControlInput::GetGradient(Vector* gradient_vec,int* doflist){
++void ControlInput::GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist){
+ 	if(gradient) gradient->GetVectorFromInputs(gradient_vec,doflist);
+ }/*}}}*/
+ /*FUNCTION ControlInput::ScaleGradient{{{*/
+@@ -197,12 +197,12 @@
+ 	_assert_(gradient);
+ 	return gradient->SpawnResult(step,time);
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){{{*/
+-void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){
++/*FUNCTION ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){{{*/
++void ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
+ 	values->GetVectorFromInputs(vector,doflist);
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){{{*/
+-void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){
++/*FUNCTION 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);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/Input.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/Input.h	(revision 13216)
+@@ -57,7 +57,7 @@
+ 		virtual void   Constrain(IssmDouble cm_min, IssmDouble cm_max)=0;
+ 		virtual void   VerticallyIntegrate(Input* thickness_input)=0;
+ 		virtual void   Extrude()=0;
+-		virtual void   GetVectorFromInputs(Vector* vector,int* doflist)=0;
++		virtual void   GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist)=0;
+ 		virtual void   GetValuesPtr(IssmDouble** pvalues,int* pnum_values)=0;
+ 		
+ 		virtual Input* SpawnTriaInput(int* indices)=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 13216)
+@@ -83,11 +83,11 @@
+ 		IssmDouble MinAbs(void){_error_("not implemented yet");};
+ 		void Extrude(void);
+ 		void VerticallyIntegrate(Input* thickness_input);
+-		void GetVectorFromInputs(Vector* vector,int* doflist,const char* data);
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist,const char* data);
++		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");};
+ 		ElementResult* SpawnGradient(int step, IssmDouble time);
+-		void GetGradient(Vector* gradient_vec,int* doflist);
++		void GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist);
+ 		void ScaleGradient(IssmDouble scale);
+ 		void SetGradient(Input* gradient_in);
+ 		void UpdateValue(IssmDouble scalar);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 13216)
+@@ -78,10 +78,10 @@
+ 		IssmDouble MinAbs(void){_error_("not implemented yet");};
+ 		void Extrude(void){_error_("not implemented yet");};
+ 		void VerticallyIntegrate(Input* thickness_input){_error_("not implemented yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist){_error_("not implemented yet");};
++		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){_error_("not implemented yet");};
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");};
+ 		ElementResult* SpawnGradient(int step, IssmDouble time){_error_("not implemented yet");};
+-		void GetGradient(Vector* gradient_vec,int* doflist){_error_("not implemented yet");};
++		void GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist){_error_("not implemented yet");};
+ 		void ScaleGradient(IssmDouble scale){_error_("not implemented yet");};
+ 		void SetGradient(Input* gradient_in){_error_("not implemented yet");};
+ 		void UpdateValue(IssmDouble scalar){_error_("not implemented yet");};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp	(revision 13216)
+@@ -179,7 +179,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION IntInput::GetVectorFromInputs{{{*/
+-void IntInput::GetVectorFromInputs(Vector* vector,int* doflist){
++void IntInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
+ 
+ 	_error_("not supporte yet!");
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp	(revision 13216)
+@@ -173,7 +173,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION BoolInput::GetVectorFromInputs{{{*/
+-void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){
++void BoolInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
+ 
+ 	_error_("not supporte yet!");
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 13216)
+@@ -77,7 +77,7 @@
+ 		IssmDouble MinAbs(void){_error_("Min not implemented for integers");};
+ 		void Extrude(void){_error_("not supported yet");};
+ 		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 13216)
+@@ -77,7 +77,7 @@
+ 		void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error_("Constrain not implemented for booleans");};
+ 		void Extrude(void);
+ 		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp	(revision 13216)
+@@ -339,7 +339,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION TriaP1Input::GetVectorFromInputs{{{*/
+-void TriaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
++void TriaP1Input::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
+ 
+ 	const int numvertices=3;
+ 	vector->SetValues(numvertices,doflist,this->values,INS_VAL);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 13216)
+@@ -78,7 +78,7 @@
+ 		IssmDouble MinAbs(void);
+ 		void Extrude(void){_error_("not supported yet");};
+ 		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 13216)
+@@ -412,7 +412,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION TransientInput::GetVectorFromInputs{{{*/
+-void TransientInput::GetVectorFromInputs(Vector* vector,int* doflist){
++void TransientInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
+ 
+ 	IssmDouble time;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp	(revision 13216)
+@@ -608,7 +608,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION PentaP1Input::GetVectorFromInputs{{{*/
+-void PentaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
++void PentaP1Input::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
+ 
+ 	const int numvertices=6;
+ 	vector->SetValues(numvertices,doflist,this->values,INS_VAL);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp	(revision 13216)
+@@ -250,7 +250,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION DoubleInput::GetVectorFromInputs{{{*/
+-void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){
++void DoubleInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
+ 
+ 	_error_("not supporte yet!");
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 13216)
+@@ -80,7 +80,7 @@
+ 		IssmDouble MinAbs(void);
+ 		void Extrude(void);
+ 		void VerticallyIntegrate(Input* thickness_forcing){_error_("not supported yet");};
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not supported yet");};
+       void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");};
+ 		Input* GetTimeInput(IssmDouble time);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 13216)
+@@ -78,7 +78,7 @@
+ 		IssmDouble MinAbs(void);
+ 		void Extrude(void);
+ 		void VerticallyIntegrate(Input* thickness_input);
+-		void GetVectorFromInputs(Vector* vector,int* doflist);
++		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
+ 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
+ 		/*}}}*/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h	(revision 13216)
+@@ -53,8 +53,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+@@ -66,8 +66,8 @@
+ 		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
+ 		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
+ 		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h	(revision 13216)
+@@ -54,8 +54,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN);
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+@@ -67,8 +67,8 @@
+ 		void  SetValue(IssmDouble* IssmDoublearray,int M,int N);
+ 		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}
+ 		void  SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/GenericParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/GenericParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/GenericParam.h	(revision 13216)
+@@ -46,7 +46,7 @@
+                   _printLine_("   enum:  " << myEnumVal << " (" << EnumToStringx(myEnumVal) << ")");
+                   _printLine_("   value: " << myP);;
+                 }
+-                 void  Echo() {DeepEcho();};
++                void  Echo() {DeepEcho();};
+                 int   Id(){ return -1; };
+                 int   MyRank() { extern int my_rank; return my_rank;} ;
+                 int   ObjectEnum() {return AdolcParamEnum;};
+@@ -76,8 +76,8 @@
+                 void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble array");}
+                 void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble array");}
+                 void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a matrix array");}
+-                void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Vec");}
+-                void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Mat");}
++                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Vec");}
++                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Mat");}
+                 void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a FILE");}
+ 
+                 void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a bool");}
+@@ -89,8 +89,8 @@
+                 void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a string array");}
+                 void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a IssmDouble array");}
+                 void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a IssmDouble array");}
+-                void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Vec");}
+-                void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Mat");}
++                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Vec");}
++                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Mat");}
+                 void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a FILE");}
+                 void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an array of matrices");}
+                 void  UnitConversion(int direction_enum) {/* nothing useful here either */};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/Param.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/Param.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/Param.h	(revision 13216)
+@@ -37,8 +37,8 @@
+ 		virtual void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM)=0;
+ 		virtual void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN)=0;
+ 		virtual void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims)=0;
+-		virtual void  GetParameterValue(Vector** pvec)=0;
+-		virtual void  GetParameterValue(Matrix** pmat)=0;
++		virtual void  GetParameterValue(Vector<IssmDouble>** pvec)=0;
++		virtual void  GetParameterValue(Matrix<IssmDouble>** pmat)=0;
+ 		virtual void  GetParameterValue(FILE** pfid)=0;
+ 		
+ 		virtual void  SetValue(bool boolean)=0;
+@@ -50,8 +50,8 @@
+ 		virtual void  SetValue(IssmDouble* pIssmDoublearray,int M,int N)=0;
+ 		virtual void  SetValue(int* intarray,int M)=0;
+ 		virtual void  SetValue(int* pintarray,int M,int N)=0;
+-		virtual void  SetValue(Vector* vec)=0;
+-		virtual void  SetValue(Matrix* mat)=0;
++		virtual void  SetValue(Vector<IssmDouble>* vec)=0;
++		virtual void  SetValue(Matrix<IssmDouble>* mat)=0;
+ 		virtual void  SetValue(FILE* fid)=0;
+ 		virtual void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array)=0;
+ 		virtual void  UnitConversion(int direction_enum)=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/FileParam.h	(revision 13216)
+@@ -52,8 +52,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){*pfid=value;};
+ 
+ 		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
+@@ -65,8 +65,8 @@
+ 		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+ 		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+ 		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntParam.h	(revision 13216)
+@@ -53,8 +53,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a bool");}
+@@ -66,8 +66,8 @@
+ 		void  SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
+ 		void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+ 		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.h	(revision 13216)
+@@ -24,12 +24,12 @@
+ 	private: 
+ 		/*just hold 3 values for 3 vertices: */
+ 		int enum_type;
+-		Vector* value;
++		Vector<IssmDouble>* value;
+ 
+ 	public:
+ 		/*VectorParam constructors, destructors: {{{*/
+ 		VectorParam();
+-		VectorParam(int enum_type,Vector* value);
++		VectorParam(int enum_type,Vector<IssmDouble>* value);
+ 		~VectorParam();
+ 		/*}}}*/
+ 		/*Object virtual functions definitions:{{{ */
+@@ -53,8 +53,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+-		void  GetParameterValue(Vector** poutput);
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** poutput);
+ 		void  GetParameterValue(FILE** pfid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}
+@@ -66,8 +66,8 @@
+ 		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}
+ 		void  SetValue(int* intarray,int M){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+ 		void  SetValue(int* pintarray,int M,int N){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
+-		void  SetValue(Vector* vec);
+-		void  SetValue(Matrix* mat){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec);
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.h	(revision 13216)
+@@ -24,12 +24,12 @@
+ 	private: 
+ 		/*just hold 3 values for 3 vertices: */
+ 		int enum_type;
+-		Matrix* value;
++		Matrix<IssmDouble>* value;
+ 
+ 	public:
+ 		/*MatrixParam constructors, destructors: {{{*/
+ 		MatrixParam();
+-		MatrixParam(int enum_type,Matrix* value);
++		MatrixParam(int enum_type,Matrix<IssmDouble>* value);
+ 		~MatrixParam();
+ 		/*}}}*/
+ 		/*Object virtual functions definitions:{{{ */
+@@ -53,8 +53,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");}
+-		void  GetParameterValue(Matrix** poutput);
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** poutput);
+ 		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+@@ -66,8 +66,8 @@
+ 		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+ 		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+ 		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat);
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat);
+ 		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h	(revision 13216)
+@@ -55,8 +55,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Vec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+@@ -68,8 +68,8 @@
+ 		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+ 		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+ 		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/TransientParam.h	(revision 13216)
+@@ -54,8 +54,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a boolean");}
+@@ -67,8 +67,8 @@
+ 		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+ 		void  SetValue(int* intarray,int M){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");}
+ 		void  SetValue(int* intarray,int M,int N){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int mat array");};
+-		void  SetValue(Vector* vec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleParam.h	(revision 13216)
+@@ -53,8 +53,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){this->value=(IssmDouble)boolean;}
+@@ -66,8 +66,8 @@
+ 		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+ 		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+ 		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h	(revision 13216)
+@@ -55,8 +55,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims);
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a boolean");}
+@@ -68,8 +68,8 @@
+ 		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble mat array");}
+ 		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");}
+ 		void  SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array);
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntVecParam.h	(revision 13216)
+@@ -54,8 +54,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array (maybe in serial?)");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+@@ -67,8 +67,8 @@
+ 		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}
+ 		void  SetValue(int* intarray,int M);
+ 		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/BoolParam.h	(revision 13216)
+@@ -52,8 +52,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){this->value=boolean;}
+@@ -65,8 +65,8 @@
+ 		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+ 		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+ 		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/IntMatParam.h	(revision 13216)
+@@ -54,8 +54,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");};
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+@@ -67,8 +67,8 @@
+ 		void  SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");};
+ 		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");};
+ 		void  SetValue(int* intarray,int M,int N);
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp	(revision 13216)
+@@ -26,7 +26,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION VectorParam::VectorParam(int enum_type,IssmVector value){{{*/
+-VectorParam::VectorParam(int in_enum_type,Vector* in_value){
++VectorParam::VectorParam(int in_enum_type,Vector<IssmDouble>* in_value){
+ 
+ 	enum_type=in_enum_type;
+ 
+@@ -88,8 +88,8 @@
+ 
+ /*VectorParam virtual functions definitions: */
+ /*FUNCTION VectorParam::GetParameterValue{{{*/
+-void  VectorParam::GetParameterValue(Vector** poutput){
+-	Vector*  output=NULL;
++void  VectorParam::GetParameterValue(Vector<IssmDouble>** poutput){
++	Vector<IssmDouble>*  output=NULL;
+ 
+ 	if(value){
+ 		output=value->Duplicate();
+@@ -104,7 +104,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION VectorParam::SetValue{{{*/
+-void  VectorParam::SetValue(Vector* vector){
++void  VectorParam::SetValue(Vector<IssmDouble>* vector){
+ 
+ 	/*avoid leak: */
+ 	xdelete(&value);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp	(revision 13216)
+@@ -25,8 +25,8 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION MatrixParam::MatrixParam(int enum_type,Matrix* value){{{*/
+-MatrixParam::MatrixParam(int in_enum_type,Matrix* in_value){
++/*FUNCTION MatrixParam::MatrixParam(int enum_type,Matrix<IssmDouble>* value){{{*/
++MatrixParam::MatrixParam(int in_enum_type,Matrix<IssmDouble>* in_value){
+ 
+ 	enum_type=in_enum_type;
+ 	value=NULL;
+@@ -86,8 +86,8 @@
+ 
+ /*MatrixParam virtual functions definitions: */
+ /*FUNCTION MatrixParam::GetParameterValue{{{*/
+-void  MatrixParam::GetParameterValue(Matrix** poutput){
+-	Matrix* output=NULL;
++void  MatrixParam::GetParameterValue(Matrix<IssmDouble>** poutput){
++	Matrix<IssmDouble>* output=NULL;
+ 
+ 	if(value){
+ 		output=value->Duplicate();
+@@ -101,7 +101,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION MatrixParam::SetValue{{{*/
+-void  MatrixParam::SetValue(Matrix* matrix){
++void  MatrixParam::SetValue(Matrix<IssmDouble>* matrix){
+ 	
+ 	/*avoid leak: */
+ 	xdelete(&value);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Params/StringParam.h	(revision 13216)
+@@ -53,8 +53,8 @@
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
+ 		void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
+-		void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
+-		void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
++		void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
++		void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
+ 		void  GetParameterValue(FILE** pfid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
+ 
+ 		void  SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}
+@@ -66,8 +66,8 @@
+ 		void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
+ 		void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+ 		void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
+-		void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
+-		void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
++		void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
++		void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
+ 		void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
+ 		void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
+ 		void  UnitConversion(int direction_enum);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.h	(revision 13216)
+@@ -1,52 +0,0 @@
+-/*! \file OptionStruct.h 
+- *  \brief: header file for optionstruct object
+- */
+-
+-#ifndef _OPTIONSTRUCT_H_
+-#define _OPTIONSTRUCT_H_
+-
+-/*Headers:{{{*/
+-#include "../../../include/include.h"
+-#include "../../../shared/Exceptions/exceptions.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-class OptionStruct: public Option {
+-
+-	public:
+-
+-		Options** values;
+-
+-		/*OptionStruct constructors, destructors {{{*/
+-		OptionStruct();
+-		~OptionStruct();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(char* indent);
+-		int   Id(){_error_("Not implemented yet");};
+-		int   MyRank(){_error_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionStructEnum;};
+-		Object* copy(){_error_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		char* Name();
+-		int   NumEl();
+-		int   NDims();
+-		int*  Size();
+-		void  Get(int* pvalue){_error_("An OptionStruct object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error_("An OptionStruct object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue){  _error_("An OptionStruct object cannot return a bool");};
+-		void  Get(char** pvalue){ _error_("An OptionStruct object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionStruct object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionStruct object cannot return a IssmDouble vec");};
+-		void  Get(Options** pvalue);
+-		void  Get(Options*** ppvalue,int *pnumel);
+-
+-};
+-#endif  /* _OPTIONSTRUCT_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp	(revision 13216)
+@@ -1,162 +0,0 @@
+-/*!\file OptionDouble.cpp
+- * \brief: implementation of the optionsIssmDouble object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../shared/shared.h"
+-#include "../../../io/io.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION OptionDouble::OptionDouble(){{{*/
+-OptionDouble::OptionDouble(){
+-
+-	values    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::~OptionDouble(){{{*/
+-OptionDouble::~OptionDouble(){
+-
+-	if (values) xDelete<IssmDouble>(values);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION OptionDouble::Echo {{{*/
+-void  OptionDouble::Echo(){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("OptionDouble Echo:");
+-	Option::Echo();
+-
+-	if (values && size) {
+-		if(numel == 1) if(flag) _pprintLine_("        values: " << values[0]);
+-		else {
+-			StringFromSize(cstr,size,ndims);
+-			if(flag) _pprintLine_("        values: " << cstr << " " << "IssmDouble");
+-		}
+-	}
+-	else if(flag) _pprintLine_("        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::DeepEcho() {{{*/
+-void  OptionDouble::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	OptionDouble::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::DeepEcho(char* indent) {{{*/
+-void  OptionDouble::DeepEcho(char* indent){
+-
+-	int   i;
+-	int*  dims;
+-	char  indent2[81];
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "OptionDouble DeepEcho:");
+-	Option::DeepEcho(indent);
+-
+-	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
+-	strcat(indent2,"  ");
+-
+-	if (values) {
+-		dims=xNew<int>(ndims);
+-		if(numel==1) if(flag) _pprintLine_(indent << "        values: " << values[0]);
+-		else{
+-			for (i=0; i<numel; i++) {
+-				RowWiseDimsFromIndex(dims,i,size,ndims);
+-				StringFromDims(cstr,dims,ndims);
+-				if(flag) _pprintLine_(indent << "        values" << cstr << ": " << values[i]);
+-			}
+-		}
+-		xDelete<int>(dims);
+-	}
+-	else if(flag) _pprintLine_(indent << "        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::Name {{{*/
+-char* OptionDouble::Name(){
+-
+-	return(Option::Name());
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::NumEl {{{*/
+-int   OptionDouble::NumEl(){
+-
+-	return(Option::NumEl());
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::NDims {{{*/
+-int   OptionDouble::NDims(){
+-
+-	return(Option::NDims());
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::Size {{{*/
+-int*  OptionDouble::Size(){
+-
+-	return(Option::Size());
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::Get(int* pvalue) {{{*/
+-void OptionDouble::Get(int* pvalue){
+-
+-	/*We should first check that the size is one*/
+-	if(this->NumEl()!=1){
+-		_error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single int");
+-	}
+-
+-	/*Assign output pointer*/
+-	*pvalue=reCast<int>(values[0]);
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::Get(IssmDouble* pvalue) {{{*/
+-void OptionDouble::Get(IssmDouble* pvalue){
+-
+-	/*We should first check that the size is one*/
+-	if(this->NumEl()!=1){
+-		_error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single IssmDouble");
+-	}
+-
+-	/*Assign output pointer*/
+-	*pvalue=this->values[0];
+-}
+-/*}}}*/
+-/*FUNCTION OptionDouble::Get(IssmDouble** pvalue,int* numel) {{{*/
+-void OptionDouble::Get(IssmDouble** pvalue,int* numel){
+-
+-	/*We should first check that the size is at least one*/
+-	if(this->NumEl()<=0){
+-		_error_("option \"" << this->name << "\" is empty and cannot return a IssmDouble vector");
+-	}
+-
+-	/*Copy vector*/
+-	IssmDouble* outvalue=xNew<IssmDouble>(this->NumEl());
+-	for(int i=0;i<this->NumEl();i++) outvalue[i]=this->values[i];
+-
+-	/*Assign output pointer*/
+-	*pvalue=outvalue;
+-	if(numel) *numel=this->NumEl();
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp	(revision 13216)
+@@ -1,133 +0,0 @@
+-/*!\file OptionLogical.cpp
+- * \brief: implementation of the optionslogical object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../shared/shared.h"
+-#include "../../../io/io.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION OptionLogical::OptionLogical(){{{*/
+-OptionLogical::OptionLogical(){
+-
+-	values    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::~OptionLogical(){{{*/
+-OptionLogical::~OptionLogical(){
+-
+-	if (values) xDelete<bool>(values);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION OptionLogical::Echo {{{*/
+-void  OptionLogical::Echo(){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("OptionLogical Echo:");
+-	Option::Echo();
+-
+-	if (values && size) {
+-		if(numel == 1) if(flag) _pprintLine_("        values: " << (values[0] ? "true" : "false"));
+-		else{
+-			StringFromSize(cstr,size,ndims);
+-			if(flag) _pprintLine_("        values: " << cstr << " " << "logical");
+-		}
+-	}
+-	else if(flag) _pprintLine_("        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::DeepEcho() {{{*/
+-void  OptionLogical::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	OptionLogical::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::DeepEcho(char* indent) {{{*/
+-void  OptionLogical::DeepEcho(char* indent){
+-
+-	int   i;
+-	int*  dims;
+-	char  indent2[81];
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "OptionLogical DeepEcho:");
+-	Option::DeepEcho(indent);
+-
+-	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
+-	strcat(indent2,"  ");
+-
+-	if (values) {
+-		if(numel==1) if(flag) _pprintLine_(indent << "        values: " << (values[0] ? "true" : "false"));
+-		else{
+-			dims=xNew<int>(ndims);
+-			for (i=0; i<numel; i++) {
+-				RowWiseDimsFromIndex(dims,i,size,ndims);
+-				StringFromDims(cstr,dims,ndims);
+-				if(flag) _pprintLine_(indent << "        values" << cstr << ": " << (values[i] ? "true" : "false"));
+-			}
+-			xDelete<int>(dims);
+-		}
+-	}
+-	else if(flag) _pprintLine_(indent << "        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::Name {{{*/
+-char* OptionLogical::Name(){
+-
+-	return(Option::Name());
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::NumEl {{{*/
+-int   OptionLogical::NumEl(){
+-
+-	return(Option::NumEl());
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::NDims {{{*/
+-int   OptionLogical::NDims(){
+-
+-	return(Option::NDims());
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::Size {{{*/
+-int*  OptionLogical::Size(){
+-
+-	return(Option::Size());
+-}
+-/*}}}*/
+-/*FUNCTION OptionLogical::Get(bool* pvalue) {{{*/
+-void OptionLogical::Get(bool* pvalue){
+-
+-	/*We should first check that the size is one*/
+-	if(this->NumEl()!=1){
+-		_error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single bool");
+-	}
+-
+-	/*Assign output pointer*/
+-	*pvalue=this->values[0];
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp	(revision 13216)
+@@ -1,176 +0,0 @@
+-/*!\file OptionChar.cpp
+- * \brief: implementation of the optionschar object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../shared/shared.h"
+-#include "../../../io/io.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION OptionChar::OptionChar(){{{*/
+-OptionChar::OptionChar(){
+-
+-	values    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::~OptionChar(){{{*/
+-OptionChar::~OptionChar(){
+-
+-	if (values) xDelete<char>(values);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION OptionChar::Echo {{{*/
+-void  OptionChar::Echo(){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("OptionChar Echo:");
+-	Option::Echo();
+-
+-	if (values && size) {
+-//		if (numel == 1) {
+-		if (1) {
+-//			if(flag) _pprintLine_("        values: \"" << values[0] << "\"");
+-			if(flag) _pprintLine_("        values: \"" << values << "\"");
+-		}
+-		else {
+-			StringFromSize(cstr,size,ndims);
+-			if(flag) _pprintLine_("        values: " << cstr << " " << "char");
+-		}
+-	}
+-	else if(flag) _pprintLine_("        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::DeepEcho() {{{*/
+-void  OptionChar::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	OptionChar::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::DeepEcho(char* indent) {{{*/
+-void  OptionChar::DeepEcho(char* indent){
+-
+-	int   i,nstr,ipt=0;
+-	int*  dims;
+-	char  indent2[81];
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "OptionChar DeepEcho:");
+-	Option::DeepEcho(indent);
+-
+-	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
+-	strcat(indent2,"  ");
+-
+-	if (values) {
+-		if (ndims == 2 && size[0] == 1) {
+-			if(flag) _pprintLine_(indent << "        values: \"" << values << "\"");
+-		}
+-		else {
+-			nstr=size[0];
+-			for (i=2; i<ndims; i++) nstr*=size[i];
+-
+-			dims=xNew<int>(ndims);
+-			for (i=0; i<nstr; i++) {
+-				RowWiseDimsFromIndex(dims,ipt,size,ndims);
+-				StringFromDims(cstr,dims,ndims);
+-				if(flag) _pprintLine_(indent << "        values" << cstr << ": \"" << size[1] << "*s\"");
+-				ipt+=size[1];
+-			}
+-			xDelete<int>(dims);
+-		}
+-	}
+-	else if(flag) _pprintLine_(indent << "        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::Name {{{*/
+-char* OptionChar::Name(){
+-
+-	return(Option::Name());
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::NumEl {{{*/
+-int   OptionChar::NumEl(){
+-
+-	return(Option::NumEl());
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::NDims {{{*/
+-int   OptionChar::NDims(){
+-
+-	return(Option::NDims());
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::Size {{{*/
+-int*  OptionChar::Size(){
+-
+-	return(Option::Size());
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::Get(char** pvalue) {{{*/
+-void OptionChar::Get(char** pvalue){
+-
+-	char* outstring=NULL;
+-	int   stringsize;
+-
+-	stringsize=strlen(this->values)+1;
+-
+-	outstring=xNew<char>(stringsize);
+-	xMemCpy<char>(outstring,this->values,stringsize);
+-
+-	*pvalue=outstring;
+-}
+-/*}}}*/
+-/*FUNCTION OptionChar::Get(char*** ppvalue,int *pnumel) {{{*/
+-void OptionChar::Get(char*** ppvalue,int *pnumel){
+-
+-	char* outstring=NULL;
+-	int   stringsize;
+-	int   i,nstr,ipt=0;
+-
+-	/*We should first check that the size is at least one*/
+-	if(this->NumEl()<=0){
+-		_error_("option \"" << this->name << "\" is empty and cannot return a string vector");
+-	}
+-
+-	/*Calculate the size and number of strings*/
+-	stringsize=this->size[1]+1;
+-	nstr=this->size[0];
+-	for (i=2; i<this->ndims; i++) nstr*=this->size[i];
+-
+-	/*Break concatenated string into individual strings*/
+-	*ppvalue=xNew<char*>(nstr);
+-	for (i=0; i<nstr; i++) {
+-		outstring=xNew<char>(stringsize);
+-		xMemCpy<char>(outstring,&(this->values[ipt]),(stringsize-1));
+-		outstring[stringsize-1]='\0';
+-		(*ppvalue)[i]=outstring;
+-		ipt+=stringsize-1;
+-	}
+-
+-	/*Assign output pointer*/
+-	if(numel) *pnumel=nstr;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.cpp	(revision 13216)
+@@ -1,116 +0,0 @@
+-/*!\file Option.cpp
+- * \brief: implementation of the optionsobject abstract object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../shared/shared.h"
+-#include "../../../Container/Container.h"
+-#include "../../../io/io.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION Option::Option(){{{*/
+-Option::Option(){
+-
+-	name  =NULL;
+-	numel =0;
+-	ndims =0;
+-	size  =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Option::~Option(){{{*/
+-Option::~Option(){
+-
+-	if(size) xDelete<int>(size);
+-	if(name) xDelete<char>(name);
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION Option::Echo {{{*/
+-void  Option::Echo(){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("          name: \"" << name << "\"");
+-	if(flag) _pprintLine_("         numel: " << numel);
+-	if(flag) _pprintLine_("         ndims: " << ndims);
+-	if(size){
+-		StringFromSize(cstr,size,ndims);
+-		if(flag) _pprintLine_("          size: " << cstr);
+-	}
+-	else if(flag) _pprintLine_("          size: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION Option::DeepEcho() {{{*/
+-void  Option::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	Option::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION Option::DeepEcho(char* indent) {{{*/
+-void  Option::DeepEcho(char* indent){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "          name: \"" << name << "\"");
+-	if(flag) _pprintLine_(indent << "         numel: " << numel);
+-	if(flag) _pprintLine_(indent << "         ndims: " << ndims);
+-	if(size){
+-		StringFromSize(cstr,size,ndims);
+-		if(flag) _pprintLine_(indent << "          size: " << cstr);
+-	}
+-	else if(flag) _pprintLine_(indent << "          size: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION Option::Name {{{*/
+-char* Option::Name(){
+-
+-	return(name);
+-}
+-/*}}}*/
+-/*FUNCTION Option::NumEl {{{*/
+-int   Option::NumEl(){
+-
+-	return(numel);
+-}
+-/*}}}*/
+-/*FUNCTION Option::NDims {{{*/
+-int   Option::NDims(){
+-
+-	return(ndims);
+-}
+-/*}}}*/
+-/*FUNCTION Option::Size {{{*/
+-int*  Option::Size(){
+-
+-	return(size);
+-}
+-/*}}}*/
+-/*FUNCTION Option::Get {{{*/
+-//void* Option::Get(){
+-
+-//	;
+-
+-//	return;
+-//}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp	(revision 13216)
+@@ -1,127 +0,0 @@
+-/*!\file OptionCell.cpp
+- * \brief: implementation of the optionscell object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../shared/shared.h"
+-#include "../../../io/io.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION OptionCell::OptionCell(){{{*/
+-OptionCell::OptionCell(){
+-
+-	values    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::~OptionCell(){{{*/
+-OptionCell::~OptionCell(){
+-
+-	if (values){
+-		delete values;
+-		values    =NULL;
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION OptionCell::Echo {{{*/
+-void  OptionCell::Echo(){
+-
+-	char cstr[81];
+-	bool flag     = true;
+-
+-	if(flag) _pprintLine_("OptionCell Echo:");
+-	Option::Echo();
+-
+-	if (values && size) {
+-		StringFromSize(cstr,size,ndims);
+-		if(flag) _pprintLine_("        values: " << cstr << " " << "cell");
+-	}
+-	else if(flag) _pprintLine_("        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::DeepEcho() {{{*/
+-void  OptionCell::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	OptionCell::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::DeepEcho(char* indent) {{{*/
+-void  OptionCell::DeepEcho(char* indent){
+-
+-	int   i;
+-	int*  dims;
+-	char  indent2[81];
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "OptionCell DeepEcho:");
+-	Option::DeepEcho(indent);
+-
+-	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
+-	strcat(indent2,"  ");
+-
+-	if (values->Size()) {
+-		dims=xNew<int>(ndims);
+-		for (i=0; i<values->Size(); i++) {
+-			ColumnWiseDimsFromIndex(dims,i,size,ndims);
+-			StringFromDims(cstr,dims,ndims);
+-			if(flag) _pprintLine_(indent << "        values: -------- begin " << cstr << " --------");
+-			((Option *)values->GetObjectByOffset(i))->DeepEcho(indent2);
+-			if(flag) _pprintLine_(indent << "        values: --------  end  " << cstr << " --------");
+-		}
+-		xDelete<int>(dims);
+-	}
+-	else if(flag) _pprintLine_(indent << "        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::Name {{{*/
+-char* OptionCell::Name(){
+-
+-	return(Option::Name());
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::NumEl {{{*/
+-int   OptionCell::NumEl(){
+-
+-	return(Option::NumEl());
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::NDims {{{*/
+-int   OptionCell::NDims(){
+-
+-	return(Option::NDims());
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::Size {{{*/
+-int*  OptionCell::Size(){
+-
+-	return(Option::Size());
+-}
+-/*}}}*/
+-/*FUNCTION OptionCell::Get(Options** pvalue) {{{*/
+-void OptionCell::Get(Options** pvalue){
+-
+-	/*Assign output pointer*/
+-	*pvalue=this->values;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionDouble.h	(revision 13216)
+@@ -1,52 +0,0 @@
+-/*! \file OptionDouble.h 
+- *  \brief: header file for optionIssmDouble object
+- */
+-
+-#ifndef _OPTIONDOUBLE_H_
+-#define _OPTIONDOUBLE_H_
+-
+-/*Headers:{{{*/
+-#include "../../../include/include.h"
+-#include "../../../shared/Exceptions/exceptions.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-class OptionDouble: public Option {
+-
+-	public:
+-
+-		IssmDouble* values;
+-
+-		/*OptionDouble constructors, destructors {{{*/
+-		OptionDouble();
+-		~OptionDouble();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(char* indent);
+-		int   Id(){_error_("Not implemented yet");};
+-		int   MyRank(){_error_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionDoubleEnum;};
+-		Object* copy(){_error_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		char* Name();
+-		int   NumEl();
+-		int   NDims();
+-		int*  Size();
+-		void  Get(int* pvalue);
+-		void  Get(IssmDouble* pvalue);
+-		void  Get(bool* pvalue){  _error_("An OptionDouble object cannot return a bool");};
+-		void  Get(char** pvalue){ _error_("An OptionDouble object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionDouble object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int* pnumel);
+-		void  Get(Options** pvalue){ _error_("An OptionDouble object cannot return an Options DataSet");};
+-		void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionDouble object cannot return an Options DataSet vec");};
+-
+-};
+-#endif  /* _OPTIONDOUBLE_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionLogical.h	(revision 13216)
+@@ -1,52 +0,0 @@
+-/*! \file OptionLogical.h 
+- *  \brief: header file for optionlogical object
+- */
+-
+-#ifndef _OPTIONLOGICAL_H_
+-#define _OPTIONLOGICAL_H_
+-
+-/*Headers:{{{*/
+-#include "../../../include/include.h"
+-#include "../../../shared/Exceptions/exceptions.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-class OptionLogical: public Option {
+-
+-	public:
+-
+-		bool* values;
+-
+-		/*OptionLogical constructors, destructors {{{*/
+-		OptionLogical();
+-		~OptionLogical();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(char* indent);
+-		int   Id(){_error_("Not implemented yet");};
+-		int   MyRank(){_error_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionLogicalEnum;};
+-		Object* copy(){_error_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		char* Name();
+-		int   NumEl();
+-		int   NDims();
+-		int*  Size();
+-		void  Get(int* pvalue){_error_("An OptionLogical object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error_("An OptionLogical object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue);
+-		void  Get(char** pvalue){ _error_("An OptionLogical object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionLogical object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionLogical object cannot return a IssmDouble vec");};
+-		void  Get(Options** pvalue){ _error_("An OptionLogical object cannot return an Options DataSet");};
+-		void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionLogical object cannot return an Options DataSet vec");};
+-
+-};
+-#endif  /* _OPTIONLOGICAL_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionChar.h	(revision 13216)
+@@ -1,52 +0,0 @@
+-/*! \file OptionChar.h 
+- *  \brief: header file for optionchar object
+- */
+-
+-#ifndef _OPTIONCHAR_H_
+-#define _OPTIONCHAR_H_
+-
+-/*Headers:{{{*/
+-#include "../../../include/include.h"
+-#include "../../../shared/Exceptions/exceptions.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-class OptionChar: public Option {
+-
+-	public:
+-
+-		char* values;
+-
+-		/*OptionChar constructors, destructors {{{*/
+-		OptionChar();
+-		~OptionChar();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(char* indent);
+-		int   Id(){_error_("Not implemented yet");};
+-		int   MyRank(){_error_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionCharEnum;};
+-		Object* copy(){_error_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		char* Name();
+-		int   NumEl();
+-		int   NDims();
+-		int*  Size();
+-		void  Get(int* pvalue){_error_("An OptionChar object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error_("An OptionChar object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue){  _error_("An OptionChar object cannot return a bool");};
+-		void  Get(char** pvalue);
+-		void  Get(char*** ppvalue,int *pnumel);
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionChar object cannot return a IssmDouble vec");};
+-		void  Get(Options** pvalue){ _error_("An OptionChar object cannot return an Options DataSet");};
+-		void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionChar object cannot return an Options DataSet vec");};
+-
+-};
+-#endif  /* _OPTIONCHAR_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionCell.h	(revision 13216)
+@@ -1,52 +0,0 @@
+-/*! \file OptionCell.h 
+- *  \brief: header file for optioncell object
+- */
+-
+-#ifndef _OPTIONCELL_H_
+-#define _OPTIONCELL_H_
+-
+-/*Headers:{{{*/
+-#include "../../../include/include.h"
+-#include "../../../shared/Exceptions/exceptions.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-
+-#include "./Option.h"
+-/*}}}*/
+-
+-class OptionCell: public Option {
+-
+-	public:
+-
+-		Options* values;
+-
+-		/*OptionCell constructors, destructors {{{*/
+-		OptionCell();
+-		~OptionCell();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{*/
+-		void  Echo();
+-		void  DeepEcho();
+-		void  DeepEcho(char* indent);
+-		int   Id(){_error_("Not implemented yet");};
+-		int   MyRank(){_error_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionCellEnum;};
+-		Object* copy(){_error_("Not implemented yet");};
+-		/*}}}*/
+-
+-		/*virtual functions: */
+-		char* Name();
+-		int   NumEl();
+-		int   NDims();
+-		int*  Size();
+-		void  Get(int* pvalue){_error_("An OptionCell object cannot return a int");};
+-		void  Get(IssmDouble* pvalue){_error_("An OptionCell object cannot return a IssmDouble");};
+-		void  Get(bool* pvalue){  _error_("An OptionCell object cannot return a bool");};
+-		void  Get(char** pvalue){ _error_("An OptionCell object cannot return a string");};
+-		void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionCell object cannot return a string vec");};
+-		void  Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionCell object cannot return a IssmDouble vec");};
+-		void  Get(Options** pvalue);
+-		void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionCell object cannot return an Options DataSet vec");};
+-
+-};
+-#endif  /* _OPTIONCELL_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp	(revision 13216)
+@@ -1,153 +0,0 @@
+-/*!\file OptionStruct.cpp
+- * \brief: implementation of the optionsstruct object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../shared/shared.h"
+-#include "../../../io/io.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*Constructors/destructor/copy*/
+-/*FUNCTION OptionStruct::OptionStruct(){{{*/
+-OptionStruct::OptionStruct(){
+-
+-	values    =NULL;
+-
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::~OptionStruct(){{{*/
+-OptionStruct::~OptionStruct(){
+-
+-	int   i;
+-
+-	if(values){
+-		for(i=0; i<numel; i++) {
+-			delete values[i];
+-			values[i] =NULL;
+-		}
+-		xDelete<Options*>(values);
+-	}
+-
+-}
+-/*}}}*/
+-
+-/*Other*/
+-/*FUNCTION OptionStruct::Echo {{{*/
+-void  OptionStruct::Echo(){
+-
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_("OptionStruct Echo:");
+-	Option::Echo();
+-
+-	if (values && size) {
+-		StringFromSize(cstr,size,ndims);
+-		if(flag) _pprintLine_("        values: " << cstr << " " << "struct");
+-	}
+-	else if(flag) _pprintLine_("        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::DeepEcho() {{{*/
+-void  OptionStruct::DeepEcho(){
+-
+-	char  indent[81]="";
+-
+-	OptionStruct::DeepEcho(indent);
+-
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::DeepEcho(char* indent) {{{*/
+-void  OptionStruct::DeepEcho(char* indent){
+-
+-	int   i,j;
+-	int*  dims;
+-	char  indent2[81];
+-	char  cstr[81];
+-	bool  flag=true;
+-
+-	if(flag) _pprintLine_(indent << "OptionStruct DeepEcho:");
+-	Option::DeepEcho(indent);
+-
+-	xMemCpy<char>(indent2,indent,(strlen(indent)+1));
+-	strcat(indent2,"  ");
+-
+-	if (values) {
+-		dims=xNew<int>(ndims);
+-		for (i=0; i<numel; i++) {
+-			ColumnWiseDimsFromIndex(dims,i,size,ndims);
+-			StringFromDims(cstr,dims,ndims);
+-			if (values[i]->Size()){
+-				if(flag) _pprintLine_(indent << "        values: -------- begin " << cstr << " --------");
+-				for (j=0; j<values[i]->Size(); j++) ((Option *)values[i]->GetObjectByOffset(j))->DeepEcho(indent2);
+-				if(flag) _pprintLine_(indent << "        values: --------  end  " << cstr << " --------");
+-			}
+-			else if(flag) _pprintLine_(indent << "        values: " << cstr << " [empty]");
+-		}
+-		xDelete<int>(dims);
+-	}
+-	else if(flag) _pprintLine_(indent << "        values: [empty]");
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::Name {{{*/
+-char* OptionStruct::Name(){
+-
+-	return(Option::Name());
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::NumEl {{{*/
+-int   OptionStruct::NumEl(){
+-
+-	return(Option::NumEl());
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::NDims {{{*/
+-int   OptionStruct::NDims(){
+-
+-	return(Option::NDims());
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::Size {{{*/
+-int*  OptionStruct::Size(){
+-
+-	return(Option::Size());
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::Get(Options** pvalue) {{{*/
+-void OptionStruct::Get(Options** pvalue){
+-
+-	/*We should first check that the size is one*/
+-	if(this->NumEl()!=1){
+-		_error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single options dataset");
+-	}
+-
+-	/*Assign output pointer*/
+-	*pvalue=this->values[0];
+-}
+-/*}}}*/
+-/*FUNCTION OptionStruct::Get(Options*** ppvalue,int* numel) {{{*/
+-void OptionStruct::Get(Options*** ppvalue,int* numel){
+-
+-	/*We should first check that the size is at least one*/
+-	if(this->NumEl()<=0){
+-		_error_("option \"" << this->name << "\" is empty and cannot return an options dataset vector");
+-	}
+-
+-	/*Assign output pointer*/
+-	*ppvalue=this->values;
+-	if(numel) *numel=this->NumEl();
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/GenericOption.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/GenericOption.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/GenericOption.h	(revision 13216)
+@@ -0,0 +1,129 @@
++/*! \file GenericOption.h 
++ *  \brief: header file for generic option object
++ */
++
++#ifndef _GENERIC_OPTION_
++#define _GENERIC_OPTION_
++
++/*Headers:{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../io/io.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "./OptionUtilities.h"
++
++#include "../Object.h"
++/*}}}*/
++
++template <class OptionType> 
++class GenericOption: public Option {
++
++	public:
++
++		char* name;
++		OptionType value;
++
++		int   numel; //in case OptionType is an array
++		int   ndims; //in case OptionType is a multi-dimensional array: */
++		int*  size;
++
++		/*GenericOption constructors, destructors*/
++		GenericOption(){ /*{{{*/
++
++			name  =NULL;
++			numel =0;
++			ndims =0;
++			size  =NULL;
++
++
++		} /*}}}*/
++		~GenericOption(){ /*{{{*/
++
++			if(size) xDelete<int>(size);
++			if(name) xDelete<char>(name);
++
++		} /*}}}*/
++
++		/*Object virtual functions definitions:*/
++		void Echo(){ /*{{{*/
++
++			this->DeepEcho();
++
++		} /*}}}*/
++		void DeepEcho(){ /*{{{*/
++
++			char  indent[81]="";
++			this->DeepEcho(indent);
++
++		} /*}}}*/
++		void DeepEcho(char* indent){ /*{{{*/
++
++			char  cstr[81];
++			bool  flag=true;
++
++			if(flag) _pprintLine_(indent << "         name: \"" << name << "\"");
++			if(flag) _pprintLine_(indent << "         numel: " << numel);
++			if(flag) _pprintLine_(indent << "         ndims: " << ndims);
++			if(size){
++				StringFromSize(cstr,size,ndims);
++				if(flag) _pprintLine_(indent << "          size: " << cstr);
++			}
++			else if(flag) _pprintLine_(indent << "          size: [empty]");
++			_printLine_(indent << "         value: " << value);;
++		} /*}}}*/
++		int   Id(){_error_("Not implemented yet");};
++		int   MyRank(){_error_("Not implemented yet");};
++		int   ObjectEnum(){return GenericOptionEnum;};
++		Object* copy(){_error_("Not implemented yet");};
++		
++		/*GenericOption functions: */
++		char* Name(){return name;};
++		int   NumEl(){return numel;};
++		int   NDims(){return ndims;};
++		int*  Size(){return size;};
++		void  Get(OptionType* pvalue){ *pvalue=value; };
++};
++
++#ifdef _HAVE_ADOLC_ //We hook off this specific specialization when not running ADOLC, otherwise we get a redeclaration with the next specialization. 
++template <> inline void GenericOption<IssmPDouble*>::Get(IssmPDouble** pvalue){ /*{{{*/
++
++	/*Copy vector*/
++	IssmPDouble* outvalue=xNew<IssmPDouble>(this->NumEl());
++	for(int i=0;i<this->NumEl();i++) outvalue[i]=this->value[i];
++
++	/*Assign output pointer*/
++	*pvalue=outvalue;
++} /*}}}*/
++#endif
++template <> inline void GenericOption<IssmDouble*>::Get(IssmDouble** pvalue){ /*{{{*/
++
++	/*Copy vector*/
++	IssmDouble* outvalue=xNew<IssmDouble>(this->NumEl());
++	for(int i=0;i<this->NumEl();i++) outvalue[i]=this->value[i];
++
++	/*Assign output pointer*/
++	*pvalue=outvalue;
++} /*}}}*/
++template <> inline void GenericOption<char*>::Get(char** pvalue){ /*{{{*/
++
++	char* outstring=NULL;
++	int   stringsize;
++
++	stringsize=strlen(this->value)+1;
++	outstring=xNew<char>(stringsize);
++	xMemCpy<char>(outstring,this->value,stringsize);
++
++	*pvalue=outstring;
++} 
++/*}}}*/
++
++
++
++#endif  /* _OPTIONOBJECT_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h	(revision 13216)
+@@ -17,19 +17,16 @@
+ 
+ 	public:
+ 
+-		char* name;
+-		int   numel;
+-		int   ndims;
+-		int*  size;
+-
++		
+ 		/*Option constructors, destructors {{{*/
+-		Option();
+-		~Option();
++		Option(){};
++		~Option(){};
+ 		/*}}}*/
++		
+ 		/*Object virtual functions definitions:{{{*/
+-		virtual void  Echo();
+-		virtual void  DeepEcho();
+-		virtual void  DeepEcho(char* indent);
++		virtual void  Echo()=0;
++		virtual void  DeepEcho()=0;
++		virtual void  DeepEcho(char* indent)=0;
+ 		int   Id(){_error_("Not implemented yet");};
+ 		int   MyRank(){_error_("Not implemented yet");};
+ 		int   ObjectEnum(){return OptionEnum;};
+@@ -41,14 +38,6 @@
+ 		virtual int   NumEl()=0;
+ 		virtual int   NDims()=0;
+ 		virtual int*  Size()=0;
+-		virtual void  Get(int* pvalue)=0;
+-		virtual void  Get(IssmDouble* pvalue)=0;
+-		virtual void  Get(bool* pvalue)=0;
+-		virtual void  Get(char** pvalue)=0;
+-		virtual void  Get(char*** ppvalue,int *pnumel)=0;
+-		virtual void  Get(IssmDouble** pvalue,int *pnumel)=0;
+-		virtual void  Get(Options** pvalue)=0;
+-		virtual void  Get(Options*** ppvalue,int *pnumel)=0;
+ 
+ };
+ #endif  /* _OPTIONOBJECT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.cpp	(revision 13216)
+@@ -198,7 +198,7 @@
+ int    Vertex::Sid(void){ return sid; }
+ /*}}}*/
+ /*FUNCTION Vertex::UpdateVertexPosition {{{*/
+-void  Vertex::UpdatePosition(Vector* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed){
++void  Vertex::UpdatePosition(Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed){
+ 
+ 	IssmDouble oldz,newz;
+ 	IssmDouble dt,velz;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.h	(revision 13216)
+@@ -68,12 +68,12 @@
+ 		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+-		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff);
+-		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+-		void  PenaltyCreatePVector(Vector*  pf, IssmDouble kmax);
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax);
++		void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
++		void  CreatePVector(Vector<IssmDouble>* pf);
++		void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
++		void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
++		void  PenaltyCreatePVector(Vector<IssmDouble>*  pf, IssmDouble kmax);
++		void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax);
+ 		bool  InAnalysis(int analysis_type);
+ 		/*}}}*/
+ 		/*Load management: {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp	(revision 13216)
+@@ -250,7 +250,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Numericalflux::CreateKMatrix {{{*/
+-void  Numericalflux::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
++void  Numericalflux::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
+ 
+ 	/*recover some parameters*/
+ 	ElementMatrix* Ke=NULL;
+@@ -281,7 +281,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Numericalflux::CreatePVector {{{*/
+-void  Numericalflux::CreatePVector(Vector* pf){
++void  Numericalflux::CreatePVector(Vector<IssmDouble>* pf){
+ 
+ 	/*recover some parameters*/
+ 	ElementVector* pe=NULL;
+@@ -311,7 +311,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{*/
+-void  Numericalflux::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
++void  Numericalflux::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
+ 
+ 	/*No stiffness loads applied, do nothing: */
+ 	return;
+@@ -319,7 +319,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Numericalflux::PenaltyCreatePVector{{{*/
+-void  Numericalflux::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
++void  Numericalflux::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
+ 
+ 	/*No penalty loads applied, do nothing: */
+ 	return;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp	(revision 13216)
+@@ -135,7 +135,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penpair::CreateKMatrix {{{*/
+-void  Penpair::CreateKMatrix(Matrix* Kff, Matrix* 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;
+@@ -143,7 +143,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penpair::CreatePVector {{{*/
+-void  Penpair::CreatePVector(Vector* pf){
++void  Penpair::CreatePVector(Vector<IssmDouble>* pf){
+ 
+ 	/*No loads applied, do nothing: */
+ 	return;
+@@ -151,12 +151,12 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penpair::CreateJacobianMatrix{{{*/
+-void  Penpair::CreateJacobianMatrix(Matrix* Jff){
++void  Penpair::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){
+ 	this->CreateKMatrix(Jff,NULL);
+ }
+ /*}}}*/
+ /*FUNCTION Penpair::PenaltyCreateKMatrix {{{*/
+-void  Penpair::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
++void  Penpair::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
+ 
+ 	/*Retrieve parameters: */
+ 	ElementMatrix* Ke=NULL;
+@@ -182,13 +182,13 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penpair::PenaltyCreatePVector {{{*/
+-void  Penpair::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
++void  Penpair::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
+ 	/*No loads applied, do nothing: */
+ 	return;
+ }
+ /*}}}*/
+ /*FUNCTION Penpair::PenaltyCreateJacobianMatrix{{{*/
+-void  Penpair::PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){
++void  Penpair::PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){
+ 	this->PenaltyCreateKMatrix(Jff,NULL,kmax);
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.h	(revision 13216)
+@@ -76,12 +76,12 @@
+ 		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+-		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");};
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");};
+-		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+-		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
++		void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
++		void  CreatePVector(Vector<IssmDouble>* pf);
++		void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
++		void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
++		void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
++		void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
+ 		bool  InAnalysis(int analysis_type);
+ 		/*}}}*/
+ 		/*Riftfront specific routines: {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h	(revision 13216)
+@@ -64,12 +64,12 @@
+ 		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+-		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");};
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");};
+-		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+-		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
++		void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
++		void  CreatePVector(Vector<IssmDouble>* pf);
++		void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
++		void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
++		void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
++		void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
+ 		bool  InAnalysis(int analysis_type);
+ 		/*}}}*/
+ 		/*Numericalflux management:{{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Penpair.h	(revision 13216)
+@@ -56,12 +56,12 @@
+ 			/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+-		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff);
+-		void  PenaltyCreateKMatrix(Matrix* Kff,Matrix* Kfs,IssmDouble kmax);
+-		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax);
++		void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
++		void  CreatePVector(Vector<IssmDouble>* pf);
++		void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
++		void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff,Matrix<IssmDouble>* Kfs,IssmDouble kmax);
++		void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
++		void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax);
+ 		bool  InAnalysis(int analysis_type);
+ 		/*}}}*/
+ 			/*Penpair management: {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Load.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Load.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Load.h	(revision 13216)
+@@ -11,8 +11,8 @@
+ /*Headers:*/
+ /*{{{*/
+ class Object;
+-class Matrix;
+-class Vector;
++template <class doublematrix> class Matrix;
++template <class doubletype> class Vector;
+ 
+ #include "../Object.h"
+ #include "../../../toolkits/toolkits.h"
+@@ -28,12 +28,12 @@
+ 		/*Virtual functions: {{{*/
+ 		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,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
+-		virtual void  CreateKMatrix(Matrix* Kff, Matrix* Kfs)=0;
+-		virtual void  CreatePVector(Vector* pf)=0;
+-		virtual void  CreateJacobianMatrix(Matrix* Jff)=0;
+-		virtual void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax)=0;
+-		virtual void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, IssmDouble kmax)=0;
+-		virtual void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax)=0;
++		virtual void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs)=0;
++		virtual void  CreatePVector(Vector<IssmDouble>* pf)=0;
++		virtual void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff)=0;
++		virtual void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax)=0;
++		virtual void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs, IssmDouble kmax)=0;
++		virtual void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax)=0;
+ 		virtual bool  InAnalysis(int analysis_type)=0;
+ 		/*}}}*/
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp	(revision 13216)
+@@ -200,7 +200,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Pengrid::CreateKMatrix {{{*/
+-void  Pengrid::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
++void  Pengrid::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
+ 
+ 	/*No loads applied, do nothing: */
+ 	return;
+@@ -208,7 +208,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Pengrid::CreatePVector {{{*/
+-void  Pengrid::CreatePVector(Vector* pf){
++void  Pengrid::CreatePVector(Vector<IssmDouble>* pf){
+ 
+ 	/*No loads applied, do nothing: */
+ 	return;
+@@ -216,7 +216,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Pengrid::PenaltyCreateMatrix {{{*/
+-void  Pengrid::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
++void  Pengrid::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
+ 
+ 	/*Retrieve parameters: */
+ 	ElementMatrix* Ke=NULL;
+@@ -249,7 +249,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Pengrid::PenaltyCreatePVector {{{*/
+-void  Pengrid::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
++void  Pengrid::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
+ 
+ 	/*Retrieve parameters: */
+ 	ElementVector* pe=NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp	(revision 13216)
+@@ -227,7 +227,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Icefront::CreateKMatrix {{{*/
+-void  Icefront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
++void  Icefront::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
+ 
+ 	/*No stiffness loads applied, do nothing: */
+ 	return;
+@@ -235,7 +235,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Icefront::CreatePVector {{{*/
+-void  Icefront::CreatePVector(Vector* pf){
++void  Icefront::CreatePVector(Vector<IssmDouble>* pf){
+ 
+ 	/*Checks in debugging mode*/
+ 	/*{{{*/
+@@ -273,24 +273,24 @@
+ }
+ /*}}}*/
+ /*FUNCTION Icefront::CreateJacobianMatrix{{{*/
+-void  Icefront::CreateJacobianMatrix(Matrix* Jff){
++void  Icefront::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){
+ 	this->CreateKMatrix(Jff,NULL);
+ }
+ /*}}}*/
+ /*FUNCTION Icefront::PenaltyCreateKMatrix {{{*/
+-void  Icefront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, IssmDouble kmax){
++void  Icefront::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs, IssmDouble kmax){
+ 	/*do nothing: */
+ 	return;
+ }
+ /*}}}*/
+ /*FUNCTION Icefront::PenaltyCreatePVector{{{*/
+-void  Icefront::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
++void  Icefront::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
+ 	/*do nothing: */
+ 	return;
+ }
+ /*}}}*/
+ /*FUNCTION Icefront::PenaltyCreateJacobianMatrix{{{*/
+-void  Icefront::PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){
++void  Icefront::PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){
+ 	this->PenaltyCreateKMatrix(Jff,NULL,kmax);
+ }
+ /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Pengrid.h	(revision 13216)
+@@ -69,12 +69,12 @@
+ 		/*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  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
+-		void  CreatePVector(Vector* pf);
+-		void  CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");};
+-		void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");};
+-		void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
+-		void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
++		void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
++		void  CreatePVector(Vector<IssmDouble>* pf);
++		void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
++		void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
++		void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
++		void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
+ 		bool  InAnalysis(int analysis_type);
+ 		/*}}}*/
+ 		/*Pengrid management {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp	(revision 13216)
+@@ -308,7 +308,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Riftfront::PenaltyCreateKMatrix {{{*/
+-void  Riftfront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
++void  Riftfront::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
+ 
+ 	/*Retrieve parameters: */
+ 	ElementMatrix* Ke=NULL;
+@@ -334,7 +334,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Riftfront::PenaltyCreatePVector {{{*/
+-void  Riftfront::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
++void  Riftfront::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
+ 
+ 	/*Retrieve parameters: */
+ 	ElementVector* pe=NULL;
+@@ -360,13 +360,13 @@
+ }
+ /*}}}*/
+ /*FUNCTION Riftfront::CreateKMatrix {{{*/
+-void  Riftfront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
++void  Riftfront::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
+ 	/*do nothing: */
+ 	return;
+ }
+ /*}}}*/
+ /*FUNCTION Riftfront::CreatePVector {{{*/
+-void  Riftfront::CreatePVector(Vector* pf){
++void  Riftfront::CreatePVector(Vector<IssmDouble>* pf){
+ 	/*do nothing: */
+ 	return;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Vertex.h	(revision 13216)
+@@ -9,7 +9,7 @@
+ /*{{{*/
+ #include "../classes.h"
+ class IoModel;
+-class Vector;
++template <class doubletype> class Vector;
+ class Parameters;
+ #include "../../shared/Exceptions/exceptions.h"
+ #include "../../toolkits/toolkits.h"
+@@ -59,7 +59,7 @@
+ 		/*Vertex management: {{{*/
+ 		int   Sid(void); 
+ 		int   Connectivity(void); 
+-		void  UpdatePosition(Vector* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
++		void  UpdatePosition(Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
+ 		/*}}}*/
+ };
+ #endif  /* _VERTEX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h	(revision 13216)
+@@ -27,14 +27,14 @@
+ 	private: 
+ 		int id;
+ 		int enum_type;
+-		Vector* value;
++		Vector<IssmDouble>* value;
+ 		int step;
+ 		IssmDouble time;
+ 
+ 	public:
+ 		/*PetscVecExternalResult constructors, destructors: {{{*/
+ 		PetscVecExternalResult();
+-		PetscVecExternalResult(int id,int enum_type,Vector* value, int step, IssmDouble time);
++		PetscVecExternalResult(int id,int enum_type,Vector<IssmDouble>* value, int step, IssmDouble time);
+ 		~PetscVecExternalResult();
+ 		/*}}}*/
+ 		/*Object virtual functions definitions:{{{ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 13216)
+@@ -486,7 +486,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Node::CreateVecSets {{{*/
+-void  Node::CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s){
++void  Node::CreateVecSets(Vector<IssmDouble>* pv_g,Vector<IssmDouble>* pv_f,Vector<IssmDouble>* pv_s){
+ 
+ 	IssmDouble gvalue=1.0; //all nodes are in the g set;
+ 	IssmDouble value;
+@@ -512,7 +512,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Node::CreateNodalConstraints{{{*/
+-void  Node::CreateNodalConstraints(Vector* ys){
++void  Node::CreateNodalConstraints(Vector<IssmDouble>* ys){
+ 
+ 	int i;
+ 	IssmDouble* values=NULL;
+@@ -793,7 +793,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Node::VecMerge {{{*/
+-void   Node::VecMerge(Vector* ug, IssmDouble* vector_serial,int setenum){
++void   Node::VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum){
+ 
+ 	IssmDouble* values=NULL;
+ 	int*    indices=NULL;
+@@ -844,7 +844,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Node::VecReduce {{{*/
+-void   Node::VecReduce(Vector* vector, IssmDouble* ug_serial,int setenum){
++void   Node::VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setenum){
+ 
+ 	IssmDouble* values=NULL;
+ 	int     count=0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.h	(revision 13216)
+@@ -15,8 +15,8 @@
+ class  IoModel;
+ class  DataSet;
+ class  Vertices;
+-class  Vector;
+-class  Matrix;
++template <class doubletype> class  Vector;
++template <class doubletype> class  Matrix;
+ #include "../Update.h"
+ /*}}}*/
+ 
+@@ -63,7 +63,7 @@
+ 		/*}}}*/
+ 		/*Node numerical routines {{{*/
+ 		void   Configure(DataSet* nodes,Vertices* vertices);
+-		void   CreateNodalConstraints(Vector* ys);
++		void   CreateNodalConstraints(Vector<IssmDouble>* ys);
+ 		void   SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
+ 		int    Sid(void); 
+ 		int    GetVertexDof(void);
+@@ -81,7 +81,7 @@
+ 		void   DofInSSet(int dof);
+ 		void   DofInFSet(int dof);
+ 		int    GetDof(int dofindex,int setenum);
+-		void   CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s);
++		void   CreateVecSets(Vector<IssmDouble>* pv_g,Vector<IssmDouble>* pv_f,Vector<IssmDouble>* pv_s);
+ 		int    GetConnectivity();
+ 		void   GetDofList(int* poutdoflist,int approximation_enum,int setenum);
+ 		void   GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
+@@ -97,8 +97,8 @@
+ 		int    IsFloating();
+ 		int    IsGrounded();
+ 		void   UpdateSpcs(IssmDouble* ys);
+-		void   VecMerge(Vector* ug, IssmDouble* vector_serial,int setenum);
+-		void   VecReduce(Vector* vector, IssmDouble* ug_serial,int setnum);
++		void   VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum);
++		void   VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setnum);
+ 		
+ 		/*}}}*/
+ 		/*Dof Object routines {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h	(revision 13216)
+@@ -45,8 +45,8 @@
+ 		/*}}}*/
+ 		/*TriaP1ElementResult management: {{{*/
+ 		int   InstanceEnum();
+-		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
+-		void GetElementVectorFromResults(Vector* vector,int dof);
++		void GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs);
++		void GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof);
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp	(revision 13216)
+@@ -137,7 +137,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION PentaP1ElementResult::GetVectorFromResults{{{*/
+-void PentaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
++void PentaP1ElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){
+ 
+ 	IssmDouble data[6];
+ 
+@@ -147,7 +147,7 @@
+ 
+ } /*}}}*/
+ /*FUNCTION PentaP1ElementResult::GetElementVectorFromResults{{{*/
+-void PentaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
++void PentaP1ElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){
+ 
+ 	_error_("Result " << EnumToStringx(enum_type) << " is a PentaP1ElementResult and should not write vector of size numberofelemenrs");
+ } /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp	(revision 13216)
+@@ -126,12 +126,12 @@
+ }
+ /*}}}*/
+ /*FUNCTION DoubleElementResult::GetVectorFromResults{{{1*/
+-void DoubleElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
++void DoubleElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){
+ 
+ 	_error_("cannot return vector on vertices");
+ } /*}}}*/
+ /*FUNCTION DoubleElementResult::GetElementVectorFromResults{{{1*/
+-void DoubleElementResult::GetElementVectorFromResults(Vector* vector,int dof){
++void DoubleElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){
+ 
+ 	vector->SetValue(dof,value,INS_VAL);
+ } /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp	(revision 13216)
+@@ -125,12 +125,12 @@
+ }
+ /*}}}*/
+ /*FUNCTION BoolElementResult::GetVectorFromResults{{{*/
+-void BoolElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
++void BoolElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){
+ 
+ 	_error_("cannot return vector on vertices");
+ } /*}}}*/
+ /*FUNCTION BoolElementResult::GetElementVectorFromResults{{{*/
+-void BoolElementResult::GetElementVectorFromResults(Vector* vector,int dof){
++void BoolElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){
+ 
+ 	vector->SetValue(dof,value,INS_VAL);
+ } /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h	(revision 13216)
+@@ -46,8 +46,8 @@
+ 		/*}}}*/
+ 		/*PentaP1ElementResult management: {{{*/
+ 		int   InstanceEnum();
+-		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
+-		void GetElementVectorFromResults(Vector* vector,int dof);
++		void GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs);
++		void GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof);
+ 		/*}}}*/
+ 
+ };
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h	(revision 13216)
+@@ -47,8 +47,8 @@
+ 		/*}}}*/
+ 		/*DoubleElementResult management: {{{*/
+ 		int   InstanceEnum();
+-		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
+-		void GetElementVectorFromResults(Vector* vector,int dof);
++		void GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs);
++		void GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof);
+ 		/*}}}*/
+ };
+ #endif  /* _DOUBLEELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h	(revision 13216)
+@@ -47,8 +47,8 @@
+ 		/*}}}*/
+ 		/*BoolElementResult management: {{{*/
+ 		int   InstanceEnum();
+-		void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
+-		void GetElementVectorFromResults(Vector* vector,int dof);
++		void GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs);
++		void GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof);
+ 		/*}}}*/
+ };
+ #endif  /* _BOOLELEMENTRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp	(revision 13216)
+@@ -125,7 +125,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION TriaP1ElementResult::GetVectorFromResults{{{*/
+-void TriaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
++void TriaP1ElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){
+ 
+ 	IssmDouble data[3];
+ 
+@@ -135,6 +135,6 @@
+ 
+ } /*}}}*/
+ /*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{*/
+-void TriaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
++void TriaP1ElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){
+ 	_error_("Result " << EnumToStringx(enum_type) << " is a TriaP1ElementResult and should not write vector of size numberofelemenrs");
+ } /*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/ElementResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/ElementResult.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ElementResults/ElementResult.h	(revision 13216)
+@@ -24,8 +24,8 @@
+ 		virtual int     NumberOfNodalValues(void)=0;
+ 		virtual void    PatchFill(int row, Patch* patch)=0;
+ 		virtual int     InstanceEnum()=0;
+-		virtual void    GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdof)=0;
+-		virtual void    GetElementVectorFromResults(Vector* vector,int dof)=0;
++		virtual void    GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdof)=0;
++		virtual void    GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof)=0;
+ 
+ };
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 13216)
+@@ -15,8 +15,8 @@
+ class DataSet;
+ class Parameters;
+ class Patch;
+-class Matrix;
+-class Vector;
++template <class doublematrix> class Matrix;
++template <class doubletype> class Vector;
+ 
+ #include "../../../toolkits/toolkits.h"
+ /*}}}*/
+@@ -29,10 +29,10 @@
+ 	
+ 		virtual void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
+ 		virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
+-		virtual void   CreateKMatrix(Matrix* Kff, Matrix*  Kfs,Vector* df)=0;
+-		virtual void   CreatePVector(Vector* pf)=0;
+-		virtual void   CreateJacobianMatrix(Matrix* Jff)=0;
+-		virtual void   GetSolutionFromInputs(Vector* solution)=0;
++		virtual void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>*  Kfs,Vector<IssmDouble>* df)=0;
++		virtual void   CreatePVector(Vector<IssmDouble>* pf)=0;
++		virtual void   CreateJacobianMatrix(Matrix<IssmDouble>* Jff)=0;
++		virtual void   GetSolutionFromInputs(Vector<IssmDouble>* solution)=0;
+ 		virtual int    GetNodeIndex(Node* node)=0;
+ 		virtual int    Sid()=0;
+ 		virtual bool   IsFloating()=0; 
+@@ -45,8 +45,8 @@
+ 		
+ 		virtual IssmDouble SurfaceArea(void)=0;
+ 		virtual void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum)=0;
+-		virtual void   ComputeBasalStress(Vector* sigma_b)=0;
+-		virtual void   ComputeStrainRate(Vector* eps)=0;
++		virtual void   ComputeBasalStress(Vector<IssmDouble>* sigma_b)=0;
++		virtual void   ComputeStrainRate(Vector<IssmDouble>* eps)=0;
+ 		virtual void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes)=0;
+ 		virtual void   PatchFill(int* pcount, Patch* patch)=0;
+ 		virtual void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results)=0;
+@@ -61,21 +61,21 @@
+ 		
+ 		virtual int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units)=0;
+ 		virtual void   InputScale(int enum_type,IssmDouble scale_factor)=0;
+-		virtual void   GetVectorFromInputs(Vector* vector, int name_enum)=0;
+-		virtual void   GetVectorFromResults(Vector* vector,int id,int enum_in,int interp)=0;
++		virtual void   GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum)=0;
++		virtual void   GetVectorFromResults(Vector<IssmDouble>* vector,int id,int enum_in,int interp)=0;
+ 		virtual void   InputArtificialNoise(int enum_type,IssmDouble min,IssmDouble max)=0;
+ 		virtual bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums)=0;
+-		virtual void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
++		virtual void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
+ 		virtual int*   GetHorizontalNeighboorSids(void)=0;
+ 		virtual IssmDouble TimeAdapt()=0;
+ 		virtual void   MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding)=0;
+-		virtual void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding)=0;
++		virtual void   PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding)=0;
+ 		virtual void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm)=0;
+ 		virtual void   Delta18oParameterization(void)=0;
+ 		virtual void   SmbGradients()=0;
+-		virtual int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
++		virtual int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
+ 		virtual void   ResetCoordinateSystem()=0;
+-		virtual void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius)=0;
++		virtual void   SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius)=0;
+ 
+ 		#ifdef _HAVE_RESPONSES_
+ 		virtual void   MinVel(IssmDouble* pminvel, bool process_units)=0;
+@@ -96,7 +96,7 @@
+ 		#endif
+ 
+ 		#ifdef _HAVE_CONTROL_
+-		virtual void   Gradj(Vector* gradient,int control_type,int control_index)=0;
++		virtual void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index)=0;
+ 		virtual IssmDouble ThicknessAbsMisfit(bool process_units  ,int weight_index)=0;
+ 		virtual IssmDouble SurfaceAbsVelMisfit(bool process_units ,int weight_index)=0;
+ 		virtual IssmDouble SurfaceRelVelMisfit(bool process_units ,int weight_index)=0;
+@@ -108,10 +108,10 @@
+ 		virtual IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index)=0;
+ 		virtual IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index)=0;
+ 		virtual IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index)=0;
+-		virtual void   ControlInputGetGradient(Vector* gradient,int enum_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;
+-		virtual void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data)=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;
+ 		virtual void   InputControlUpdate(IssmDouble scalar,bool save_parameter)=0;
+ 		#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 13216)
+@@ -124,7 +124,7 @@
+ 
+ /*Other*/
+ /*FUNCTION Tria::AverageOntoPartition {{{*/
+-void  Tria::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
++void  Tria::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
+ 
+ 	bool      already=false;
+ 	int       i,j;
+@@ -164,7 +164,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::CreateKMatrix {{{*/
+-void  Tria::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){
++void  Tria::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df){
+ 
+ 	/*retreive parameters: */
+ 	ElementMatrix* Ke=NULL;
+@@ -516,7 +516,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::CreatePVector {{{*/
+-void  Tria::CreatePVector(Vector* pf){
++void  Tria::CreatePVector(Vector<IssmDouble>* pf){
+ 
+ 	/*retrive parameters: */
+ 	ElementVector* pe=NULL;
+@@ -739,7 +739,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::CreateJacobianMatrix{{{*/
+-void  Tria::CreateJacobianMatrix(Matrix* Jff){
++void  Tria::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){
+ 
+ 	/*retrieve parameters: */
+ 	ElementMatrix* Ke=NULL;
+@@ -772,12 +772,12 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::ComputeBasalStress {{{*/
+-void  Tria::ComputeBasalStress(Vector* eps){
++void  Tria::ComputeBasalStress(Vector<IssmDouble>* eps){
+ 	_error_("Not Implemented yet");
+ }
+ /*}}}*/
+ /*FUNCTION Tria::ComputeStrainRate {{{*/
+-void  Tria::ComputeStrainRate(Vector* eps){
++void  Tria::ComputeStrainRate(Vector<IssmDouble>* eps){
+ 	_error_("Not Implemented yet");
+ }
+ /*}}}*/
+@@ -1190,7 +1190,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GetSolutionFromInputs{{{*/
+-void  Tria::GetSolutionFromInputs(Vector* solution){
++void  Tria::GetSolutionFromInputs(Vector<IssmDouble>* solution){
+ 
+ 	/*retrive parameters: */
+ 	int analysis_type;
+@@ -1240,7 +1240,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GetVectorFromInputs{{{*/
+-void  Tria::GetVectorFromInputs(Vector* vector,int input_enum){
++void  Tria::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){
+ 
+ 	int doflist1[NUMVERTICES];
+ 
+@@ -1259,7 +1259,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GetVectorFromResults{{{*/
+-void  Tria::GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp){
++void  Tria::GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int enum_in,int interp){
+ 
+ 	/*Get result*/
+ 	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
+@@ -2130,7 +2130,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::PotentialSheetUngrounding{{{*/
+-void  Tria::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){
++void  Tria::PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){
+ 
+ 	int     i;
+ 	IssmDouble  h[NUMVERTICES],ba[NUMVERTICES];
+@@ -2250,7 +2250,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::SmearFunction {{{*/
+-void  Tria::SmearFunction(Vector*  smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
++void  Tria::SmearFunction(Vector<IssmDouble>*  smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
+ 	_error_("not implemented yet");
+ 
+ }
+@@ -2523,7 +2523,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::UpdatePotentialSheetUngrounding{{{*/
+-int Tria::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
++int Tria::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
+ 
+ 	int i;
+ 	int nflipped=0;
+@@ -3191,7 +3191,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GetSolutionFromInputsDiagnosticHoriz{{{*/
+-void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){
++void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solution){
+ 
+ 	const int    numdof=NDOF2*NUMVERTICES;
+ 
+@@ -3230,7 +3230,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GetSolutionFromInputsDiagnosticHutter{{{*/
+-void  Tria::GetSolutionFromInputsDiagnosticHutter(Vector* solution){
++void  Tria::GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solution){
+ 
+ 	const int    numdof=NDOF2*NUMVERTICES;
+ 
+@@ -3429,7 +3429,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::ControlInputGetGradient{{{*/
+-void Tria::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){
++void Tria::ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){
+ 
+ 	int doflist1[NUMVERTICES];
+ 	Input* input=NULL;
+@@ -3488,7 +3488,7 @@
+ 
+ }/*}}}*/
+ /*FUNCTION Tria::Gradj {{{*/
+-void  Tria::Gradj(Vector* gradient,int control_type,int control_index){
++void  Tria::Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){
+ 	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
+ 
+ 	/*If on water, grad = 0: */
+@@ -3552,7 +3552,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GradjBGradient{{{*/
+-void  Tria::GradjBGradient(Vector* gradient,int weight_index,int control_index){
++void  Tria::GradjBGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index){
+ 
+ 	int        i,ig;
+ 	int        doflist1[NUMVERTICES];
+@@ -3592,7 +3592,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GradjZGradient{{{*/
+-void  Tria::GradjZGradient(Vector* gradient,int weight_index,int control_index){
++void  Tria::GradjZGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index){
+ 
+ 	int        i,ig;
+ 	int        doflist1[NUMVERTICES];
+@@ -3632,7 +3632,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GradjBMacAyeal{{{*/
+-void  Tria::GradjBMacAyeal(Vector* gradient,int control_index){
++void  Tria::GradjBMacAyeal(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	/*Intermediaries*/
+ 	int        i,ig;
+@@ -3689,7 +3689,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GradjZMacAyeal{{{*/
+-void  Tria::GradjZMacAyeal(Vector* gradient,int control_index){
++void  Tria::GradjZMacAyeal(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	/*Intermediaries*/
+ 	int        i,ig;
+@@ -3746,7 +3746,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GradjDragMacAyeal {{{*/
+-void  Tria::GradjDragMacAyeal(Vector* gradient,int control_index){
++void  Tria::GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	int        i,ig;
+ 	int        analysis_type;
+@@ -3834,7 +3834,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GradjDragGradient{{{*/
+-void  Tria::GradjDragGradient(Vector* gradient, int weight_index,int control_index){
++void  Tria::GradjDragGradient(Vector<IssmDouble>* gradient, int weight_index,int control_index){
+ 
+ 	int        i,ig;
+ 	int        doflist1[NUMVERTICES];
+@@ -3878,7 +3878,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GradjDhDtBalancedthickness{{{*/
+-void  Tria::GradjDhDtBalancedthickness(Vector* gradient,int control_index){
++void  Tria::GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	/*Intermediaries*/
+ 	int    doflist1[NUMVERTICES];
+@@ -3894,7 +3894,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GradjVxBalancedthickness{{{*/
+-void  Tria::GradjVxBalancedthickness(Vector* gradient,int control_index){
++void  Tria::GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	/*Intermediaries*/
+ 	int        i,ig;
+@@ -3937,7 +3937,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GradjVyBalancedthickness{{{*/
+-void  Tria::GradjVyBalancedthickness(Vector* gradient,int control_index){
++void  Tria::GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	/*Intermediaries*/
+ 	int        i,ig;
+@@ -5202,7 +5202,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GetVectorFromControlInputs{{{*/
+-void  Tria::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){
++void  Tria::GetVectorFromControlInputs(Vector<IssmDouble>* vector,int control_enum,int control_index,const char* data){
+ 
+ 	int doflist1[NUMVERTICES];
+ 	Input *input=NULL;
+@@ -5475,7 +5475,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Tria::GetSolutionFromInputsHydrology{{{*/
+-void  Tria::GetSolutionFromInputsHydrology(Vector* solution){
++void  Tria::GetSolutionFromInputsHydrology(Vector<IssmDouble>* solution){
+ 
+ 	const int    numdof=NDOF1*NUMVERTICES;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 13216)
+@@ -70,15 +70,15 @@
+ 		void  InputUpdateFromIoModel(int index, IoModel* iomodel);
+ 		/*}}}*/
+ 		/*Element virtual functions definitions: {{{*/
+-		void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
+-		void   ComputeBasalStress(Vector* sigma_b);
+-		void   ComputeStrainRate(Vector* eps);
++		void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
++		void   ComputeBasalStress(Vector<IssmDouble>* sigma_b);
++		void   ComputeStrainRate(Vector<IssmDouble>* eps);
+ 		void   ComputeStressTensor();
+ 		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+ 		void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+-		void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
+-		void   CreatePVector(Vector* pf);
+-		void   CreateJacobianMatrix(Matrix* Jff);
++		void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df);
++		void   CreatePVector(Vector<IssmDouble>* pf);
++		void   CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
+ 		void   Delta18oParameterization(void);
+ 		int    GetNodeIndex(Node* node);
+ 		int    Sid();
+@@ -87,9 +87,9 @@
+ 		bool   IsNodeOnShelf(); 
+ 		bool   IsNodeOnShelfFromFlags(IssmDouble* flags);
+ 		bool   IsOnWater(); 
+-		void   GetSolutionFromInputs(Vector* solution);
+-		void   GetVectorFromInputs(Vector* vector, int name_enum);
+-		void   GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp);
++		void   GetSolutionFromInputs(Vector<IssmDouble>* solution);
++		void   GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum);
++		void   GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int enum_in,int interp);
+ 		void   InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max);
+ 		bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums);
+ 		void   InputCreate(IssmDouble scalar,int name,int code);
+@@ -102,7 +102,7 @@
+ 		void   MaterialUpdateFromTemperature(void){_error_("not implemented yet");};
+ 		void   MigrateGroundingLine(IssmDouble* oldfloating,IssmDouble* sheet_ungrounding);
+ 		int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
+-		void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
++		void   PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
+ 		void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm);
+ 		void   RequestedOutput(int output_enum,int step,IssmDouble time);
+ 		void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results);
+@@ -113,10 +113,10 @@
+ 		void	 SmbGradients();
+ 		IssmDouble SurfaceArea(void);
+ 		void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
+-		int    UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
++		int    UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
+ 		IssmDouble TimeAdapt();
+ 		int*   GetHorizontalNeighboorSids(void);
+-		void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
++		void   SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
+ 
+ 		#ifdef _HAVE_RESPONSES_
+ 		IssmDouble IceVolume(void);
+@@ -140,20 +140,20 @@
+ 		#ifdef _HAVE_CONTROL_
+ 		IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index);
+ 		void   GradientIndexing(int* indexing,int control_index);
+-		void   Gradj(Vector* gradient,int control_type,int control_index);
+-		void   GradjBGradient(Vector* gradient,int weight_index,int control_index);
+-		void   GradjZGradient(Vector* gradient,int weight_index,int control_index);
+-		void   GradjBMacAyeal(Vector* gradient,int control_index);
+-		void   GradjZMacAyeal(Vector* gradient,int control_index);
+-		void   GradjDragMacAyeal(Vector* gradient,int control_index);
+-		void   GradjDragStokes(Vector* gradient,int control_index);
+-		void   GradjDragGradient(Vector* gradient,int weight_index,int control_index);
+-		void   GradjDhDtBalancedthickness(Vector* gradient,int control_index);
+-		void   GradjVxBalancedthickness(Vector* gradient,int control_index);
+-		void   GradjVyBalancedthickness(Vector* gradient,int control_index);
+-		void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
++		void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
++		void   GradjBGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index);
++		void   GradjZGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index);
++		void   GradjBMacAyeal(Vector<IssmDouble>* gradient,int control_index);
++		void   GradjZMacAyeal(Vector<IssmDouble>* gradient,int control_index);
++		void   GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index);
++		void   GradjDragStokes(Vector<IssmDouble>* gradient,int control_index);
++		void   GradjDragGradient(Vector<IssmDouble>* gradient,int weight_index,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   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* gradient,int enum_type,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);
+ 		IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index);
+@@ -211,8 +211,8 @@
+ 		ElementVector* CreatePVectorDiagnosticMacAyeal(void);
+ 		ElementVector* CreatePVectorDiagnosticHutter(void);
+ 		ElementMatrix* CreateJacobianDiagnosticMacayeal(void);
+-		void	  GetSolutionFromInputsDiagnosticHoriz(Vector* solution);
+-		void	  GetSolutionFromInputsDiagnosticHutter(Vector* solution);
++		void	  GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solution);
++		void	  GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solution);
+ 		void	  InputUpdateFromSolutionDiagnosticHoriz( IssmDouble* solution);
+ 		void	  InputUpdateFromSolutionDiagnosticHutter( IssmDouble* solution);
+ 		#endif
+@@ -231,7 +231,7 @@
+ 		ElementMatrix* CreateKMatrixHydrology(void);
+ 		ElementVector* CreatePVectorHydrology(void);
+ 		void      CreateHydrologyWaterVelocityInput(void);
+-		void	  GetSolutionFromInputsHydrology(Vector* solution);
++		void	  GetSolutionFromInputsHydrology(Vector<IssmDouble>* solution);
+ 		void	  InputUpdateFromSolutionHydrology(IssmDouble* solution);
+ 		#endif
+ 		#ifdef _HAVE_BALANCED_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 13216)
+@@ -144,7 +144,7 @@
+ 
+ /*Other*/
+ /*FUNCTION Penta::AverageOntoPartition {{{*/
+-void  Penta::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
++void  Penta::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
+ 	_error_("Not supported yet!");
+ }
+ /*}}}*/
+@@ -225,7 +225,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::ComputeBasalStress {{{*/
+-void  Penta::ComputeBasalStress(Vector* sigma_b){
++void  Penta::ComputeBasalStress(Vector<IssmDouble>* sigma_b){
+ 
+ 	int         i,j,ig;
+ 	int         dofv[3]={0,1,2};
+@@ -315,7 +315,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::ComputeStrainRate {{{*/
+-void  Penta::ComputeStrainRate(Vector* eps){
++void  Penta::ComputeStrainRate(Vector<IssmDouble>* eps){
+ 
+ 	_error_("Not implemented yet");
+ 
+@@ -409,7 +409,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::CreateKMatrix {{{*/
+-void  Penta::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){
++void  Penta::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df){
+ 
+ 	/*retrieve parameters: */
+ 	ElementMatrix* Ke=NULL;
+@@ -513,7 +513,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::CreatePVector {{{*/
+-void  Penta::CreatePVector(Vector* pf){
++void  Penta::CreatePVector(Vector<IssmDouble>* pf){
+ 
+ 	/*retrive parameters: */
+ 	ElementVector* pe=NULL;
+@@ -615,7 +615,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::CreateJacobianMatrix{{{*/
+-void  Penta::CreateJacobianMatrix(Matrix* Jff){
++void  Penta::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){
+ 
+ 	/*retrieve parameters: */
+ 	ElementMatrix* Ke=NULL;
+@@ -1005,7 +1005,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetSolutionFromInputs{{{*/
+-void  Penta::GetSolutionFromInputs(Vector* solution){
++void  Penta::GetSolutionFromInputs(Vector<IssmDouble>* solution){
+ 
+ 	int analysis_type;
+ 
+@@ -1132,7 +1132,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetVectorFromInputs{{{*/
+-void  Penta::GetVectorFromInputs(Vector* vector,int input_enum){
++void  Penta::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){
+ 
+ 	int doflist1[NUMVERTICES];
+ 
+@@ -1151,7 +1151,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetVectorFromResults{{{*/
+-void  Penta::GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp){
++void  Penta::GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int enum_in,int interp){
+ 
+ 	/*Get result*/
+ 	ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset);
+@@ -2389,7 +2389,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::PotentialSheetUngrounding{{{*/
+-void  Penta::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){
++void  Penta::PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){
+ 
+ 	int     i;
+ 	IssmDouble  h[NUMVERTICES],ba[NUMVERTICES];
+@@ -2964,7 +2964,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::UpdatePotentialSheetUngrounding{{{*/
+-int Penta::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
++int Penta::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
+ 
+ 	int i;
+ 	int nflipped=0;
+@@ -3032,7 +3032,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::SmearFunction {{{*/
+-void  Penta::SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
++void  Penta::SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
+ 	_error_("not implemented yet");
+ }
+ /*}}}*/
+@@ -4246,7 +4246,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetSolutionFromInputsThermal{{{*/
+-void  Penta::GetSolutionFromInputsThermal(Vector* solution){
++void  Penta::GetSolutionFromInputsThermal(Vector<IssmDouble>* solution){
+ 
+ 	const int    numdof=NDOF1*NUMVERTICES;
+ 
+@@ -4277,7 +4277,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetSolutionFromInputsEnthalpy{{{*/
+-void  Penta::GetSolutionFromInputsEnthalpy(Vector* solution){
++void  Penta::GetSolutionFromInputsEnthalpy(Vector<IssmDouble>* solution){
+ 
+ 	const int    numdof=NDOF1*NUMVERTICES;
+ 
+@@ -4460,7 +4460,7 @@
+ 
+ #ifdef _HAVE_CONTROL_
+ /*FUNCTION Penta::ControlInputGetGradient{{{*/
+-void Penta::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){
++void Penta::ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){
+ 
+ 	int doflist1[NUMVERTICES];
+ 	Input* input=NULL;
+@@ -4807,7 +4807,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::Gradj {{{*/
+-void  Penta::Gradj(Vector* gradient,int control_type,int control_index){
++void  Penta::Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){
+ 	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
+ 
+ 	int              i,approximation;
+@@ -4898,7 +4898,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GradjDragMacAyeal {{{*/
+-void  Penta::GradjDragMacAyeal(Vector* gradient,int control_index){
++void  Penta::GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	/*Gradient is 0 if on shelf or not on bed*/
+ 	if(IsFloating() || !IsOnBed()) return;
+@@ -4910,7 +4910,7 @@
+ 
+ } /*}}}*/
+ /*FUNCTION Penta::GradjDragPattyn {{{*/
+-void  Penta::GradjDragPattyn(Vector* gradient,int control_index){
++void  Penta::GradjDragPattyn(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	int        i,j,ig;
+ 	int        analysis_type;
+@@ -4981,7 +4981,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GradjDragStokes {{{*/
+-void  Penta::GradjDragStokes(Vector* gradient,int control_index){
++void  Penta::GradjDragStokes(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	int        i,j,ig;
+ 	int        analysis_type;
+@@ -5073,7 +5073,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GradjBbarMacAyeal {{{*/
+-void  Penta::GradjBbarMacAyeal(Vector* gradient,int control_index){
++void  Penta::GradjBbarMacAyeal(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	/*This element should be collapsed into a tria element at its base*/
+ 	if (!IsOnBed()) return; 
+@@ -5091,7 +5091,7 @@
+ 
+ } /*}}}*/
+ /*FUNCTION Penta::GradjBbarPattyn {{{*/
+-void  Penta::GradjBbarPattyn(Vector* gradient,int control_index){
++void  Penta::GradjBbarPattyn(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	/*Gradient is computed on bed only (Bbar)*/
+ 	if (!IsOnBed()) return;
+@@ -5108,7 +5108,7 @@
+ 	this->material->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+ } /*}}}*/
+ /*FUNCTION Penta::GradjBbarStokes {{{*/
+-void  Penta::GradjBbarStokes(Vector* gradient,int control_index){
++void  Penta::GradjBbarStokes(Vector<IssmDouble>* gradient,int control_index){
+ 
+ 	/*Gradient is computed on bed only (Bbar)*/
+ 	if (!IsOnBed()) return;
+@@ -5491,7 +5491,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetVectorFromControlInputs{{{*/
+-void  Penta::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){
++void  Penta::GetVectorFromControlInputs(Vector<IssmDouble>* vector,int control_enum,int control_index,const char* data){
+ 
+ 	int doflist1[NUMVERTICES];
+ 
+@@ -8074,7 +8074,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetSolutionFromInputsDiagnosticHoriz{{{*/
+-void  Penta::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){
++void  Penta::GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solution){
+ 
+ 	const int    numdof=NDOF2*NUMVERTICES;
+ 
+@@ -8116,7 +8116,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetSolutionFromInputsDiagnosticHutter{{{*/
+-void  Penta::GetSolutionFromInputsDiagnosticHutter(Vector* solution){
++void  Penta::GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solution){
+ 
+ 	const int    numdof=NDOF2*NUMVERTICES;
+ 
+@@ -8152,7 +8152,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetSolutionFromInputsDiagnosticVert{{{*/
+-void  Penta::GetSolutionFromInputsDiagnosticVert(Vector* solution){
++void  Penta::GetSolutionFromInputsDiagnosticVert(Vector<IssmDouble>* solution){
+ 
+ 	const int    numdof=NDOF1*NUMVERTICES;
+ 
+@@ -8185,7 +8185,7 @@
+ }
+ /*}}}*/
+ /*FUNCTION Penta::GetSolutionFromInputsDiagnosticStokes{{{*/
+-void  Penta::GetSolutionFromInputsDiagnosticStokes(Vector* solution){
++void  Penta::GetSolutionFromInputsDiagnosticStokes(Vector<IssmDouble>* solution){
+ 
+ 	const int    numdof=NDOF4*NUMVERTICES;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 13216)
+@@ -73,23 +73,23 @@
+ 		void  InputUpdateFromIoModel(int index, IoModel* iomodel);
+ 		/*}}}*/
+ 		/*Element virtual functions definitions: {{{*/
+-		void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
++		void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
+ 		void   BasalFrictionCreateInput(void);
+-		void   ComputeBasalStress(Vector* sigma_b);
+-		void   ComputeStrainRate(Vector* eps);
++		void   ComputeBasalStress(Vector<IssmDouble>* sigma_b);
++		void   ComputeStrainRate(Vector<IssmDouble>* eps);
+ 		void   ComputeStressTensor();
+ 		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+ 		void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+-		void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
+-		void   CreatePVector(Vector* pf);
+-		void   CreateJacobianMatrix(Matrix* Jff);
++		void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df);
++		void   CreatePVector(Vector<IssmDouble>* pf);
++		void   CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
+ 		void   Delta18oParameterization(void);
+ 		void   DeleteResults(void);
+ 		int    GetNodeIndex(Node* node);
+-		void   GetSolutionFromInputs(Vector* solution);
++		void   GetSolutionFromInputs(Vector<IssmDouble>* solution);
+ 		IssmDouble GetZcoord(GaussPenta* gauss);
+-		void   GetVectorFromInputs(Vector* vector,int name_enum);
+-		void   GetVectorFromResults(Vector* vector,int offset,int name_enum,int interp);
++		void   GetVectorFromInputs(Vector<IssmDouble>* vector,int name_enum);
++		void   GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int name_enum,int interp);
+ 		
+ 		int    Sid();
+ 		void   InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max);
+@@ -102,7 +102,7 @@
+ 		
+ 		void   InputToResult(int enum_type,int step,IssmDouble time);
+ 		void   MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding);
+-		void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
++		void   PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
+ 		void   RequestedOutput(int output_enum,int step,IssmDouble time);
+ 		void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results);
+ 		void   PatchFill(int* pcount, Patch* patch);
+@@ -113,12 +113,12 @@
+ 		void   SmbGradients();
+ 		IssmDouble SurfaceArea(void);
+ 		void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
+-		int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
++		int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
+ 		int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
+ 		IssmDouble TimeAdapt();
+ 		int*   GetHorizontalNeighboorSids(void);
+ 		void   ViscousHeatingCreateInput(void);
+-		void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
++		void   SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
+ 
+ 		 #ifdef _HAVE_RESPONSES_
+ 		IssmDouble IceVolume(void);
+@@ -141,16 +141,16 @@
+ 		#ifdef _HAVE_CONTROL_
+ 		IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index);
+ 		void   GradientIndexing(int* indexing,int control_index);
+-		void   Gradj(Vector* gradient,int control_type,int control_index);
+-		void   GradjDragMacAyeal(Vector* gradient,int control_index);
+-		void   GradjDragPattyn(Vector* gradient,int control_index);
+-		void   GradjDragStokes(Vector* gradient,int control_index);
+-		void   GradjBbarMacAyeal(Vector* gradient,int control_index);
+-		void   GradjBbarPattyn(Vector* gradient,int control_index);
+-		void   GradjBbarStokes(Vector* gradient,int control_index);
+-		void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
++		void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
++		void   GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index);
++		void   GradjDragPattyn(Vector<IssmDouble>* gradient,int control_index);
++		void   GradjDragStokes(Vector<IssmDouble>* gradient,int control_index);
++		void   GradjBbarMacAyeal(Vector<IssmDouble>* gradient,int control_index);
++		void   GradjBbarPattyn(Vector<IssmDouble>* gradient,int control_index);
++		void   GradjBbarStokes(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* gradient,int enum_type,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);
+ 		IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index);
+@@ -182,7 +182,7 @@
+ 		void    GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue);
+ 		void    GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
+ 		void	  GetPhi(IssmDouble* phi, IssmDouble*  epsilon, IssmDouble viscosity);
+-		void	  GetSolutionFromInputsEnthalpy(Vector* solutiong);
++		void	  GetSolutionFromInputsEnthalpy(Vector<IssmDouble>* solutiong);
+ 		IssmDouble  GetStabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa);
+ 		void    GetStrainRate3dPattyn(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input);
+ 		void    GetStrainRate3d(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input, Input* vz_input);
+@@ -253,10 +253,10 @@
+ 		void           InputUpdateFromSolutionDiagnosticHutter( IssmDouble* solutiong);
+ 		void           InputUpdateFromSolutionDiagnosticVert( IssmDouble* solutiong);
+ 		void           InputUpdateFromSolutionDiagnosticStokes( IssmDouble* solutiong);
+-		void	         GetSolutionFromInputsDiagnosticHoriz(Vector* solutiong);
+-		void	         GetSolutionFromInputsDiagnosticHutter(Vector* solutiong);
+-		void	         GetSolutionFromInputsDiagnosticStokes(Vector* solutiong);
+-		void	         GetSolutionFromInputsDiagnosticVert(Vector* solutiong);
++		void	         GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solutiong);
++		void	         GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solutiong);
++		void	         GetSolutionFromInputsDiagnosticStokes(Vector<IssmDouble>* solutiong);
++		void	         GetSolutionFromInputsDiagnosticVert(Vector<IssmDouble>* solutiong);
+ 		ElementVector* CreatePVectorCouplingMacAyealStokes(void);
+ 		ElementVector* CreatePVectorCouplingMacAyealStokesViscous(void);
+ 		ElementVector* CreatePVectorCouplingMacAyealStokesFriction(void);
+@@ -312,7 +312,7 @@
+ 		ElementVector* CreatePVectorThermalVolume(void);
+ 		ElementVector* CreatePVectorThermalShelf(void);
+ 		ElementVector* CreatePVectorThermalSheet(void);
+-		void	       GetSolutionFromInputsThermal(Vector* solutiong);
++		void	       GetSolutionFromInputsThermal(Vector<IssmDouble>* solutiong);
+ 		void           InputUpdateFromSolutionThermal( IssmDouble* solutiong);
+ 		void           InputUpdateFromSolutionEnthalpy( IssmDouble* solutiong);
+ 		#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.cpp	(revision 13216)
+@@ -1,447 +0,0 @@
+-/*!\file Vector.cpp
+- * \brief: implementation of the Vector object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../classes.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-#include "../../toolkits/toolkits.h"
+-#include "./Vector.h"
+-/*}}}*/
+-
+-/*Vector constructors and destructor*/
+-/*FUNCTION Vector::Vector(){{{*/
+-Vector::Vector(){
+-
+-	#ifdef _HAVE_PETSC_
+-	this->pvector=NULL;
+-	#endif
+-	this->svector=NULL;
+-	
+-	type=PetscVecType; //default
+-	#ifndef _HAVE_PETSC_
+-	type=SeqVecType;
+-	#endif
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Vector(int M,bool fromlocalsize,int type){{{*/
+-Vector::Vector(int M,bool fromlocalsize,int in_type){
+-	
+-	#ifdef _HAVE_PETSC_
+-	pvector=NULL;
+-	#endif
+-	svector=NULL;
+-	type=in_type;
+-
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector=new PetscVec(M,fromlocalsize);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector=new SeqVec(M,fromlocalsize);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-#ifdef _HAVE_PETSC_
+-/*FUNCTION Vector::Vector(Vec petsc_vector){{{*/
+-Vector::Vector(Vec petsc_vector){
+-
+-	this->type=PetscVecType;
+-	this->svector=NULL;
+-	this->pvector=new PetscVec(petsc_vector);
+-
+-}
+-/*}}}*/
+-#endif
+-/*FUNCTION Vector::Vector(IssmDouble* serial_vec,int M,int type){{{*/
+-Vector::Vector(IssmDouble* serial_vec,int M,int in_type){
+-
+-	#ifdef _HAVE_PETSC_
+-	pvector=NULL;
+-	#endif
+-
+-	svector=NULL;
+-	type=in_type;
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector=new PetscVec(serial_vec,M);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector=new SeqVec(serial_vec,M);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::~Vector(){{{*/
+-Vector::~Vector(){
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		delete this->pvector;
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		delete this->svector;
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-}
+-/*}}}*/
+-
+-/*Vector specific routines: */
+-/*FUNCTION Vector::Echo{{{*/
+-void Vector::Echo(void){
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->Echo();
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->Echo();
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Assemble{{{*/
+-void Vector::Assemble(void){
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->Assemble();
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->Assemble();
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::SetValues{{{*/
+-void Vector::SetValues(int ssize, int* list, IssmDouble* values, InsMode mode){
+-		
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->SetValues(ssize,list,values,mode);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->SetValues(ssize,list,values,mode);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-		
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::SetValue{{{*/
+-void Vector::SetValue(int dof, IssmDouble value, InsMode mode){
+-	
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->SetValue(dof,value,mode);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->SetValue(dof,value,mode);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::GetValue{{{*/
+-void Vector::GetValue(IssmDouble* pvalue,int dof){
+-		
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->GetValue(pvalue,dof);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->GetValue(pvalue,dof);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::GetSize{{{*/
+-void Vector::GetSize(int* pM){
+-	
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->GetSize(pM);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->GetSize(pM);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::IsEmpty{{{*/
+-bool Vector::IsEmpty(void){
+-
+-	int M;
+-
+-	this->GetSize(&M);
+-
+-	if(M==0) 
+-	 return true;
+-	else
+-	 return false;
+-}
+-/*}}}*/
+-/*FUNCTION Vector::GetLocalSize{{{*/
+-void Vector::GetLocalSize(int* pM){
+-		
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->GetLocalSize(pM);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->GetLocalSize(pM);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Duplicate{{{*/
+-Vector* Vector::Duplicate(void){
+-	
+-	Vector* output=NULL;
+-
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		output=new Vector();
+-		output->pvector=this->pvector->Duplicate();
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		output=new Vector();
+-		output->svector=this->svector->Duplicate();
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-	return output;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Set{{{*/
+-void Vector::Set(IssmDouble value){
+-	
+-	
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->Set(value);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->Set(value);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::AXPY{{{*/
+-void Vector::AXPY(Vector* X, IssmDouble a){
+-	
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->AXPY(X->pvector,a);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->AXPY(X->svector,a);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::AYPX{{{*/
+-void Vector::AYPX(Vector* X, IssmDouble a){
+-	
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->AYPX(X->pvector,a);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->AYPX(X->svector,a);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::ToMPISerial{{{*/
+-IssmDouble* Vector::ToMPISerial(void){
+-
+-	IssmDouble* vec_serial=NULL;
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		vec_serial=this->pvector->ToMPISerial();
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		vec_serial=this->svector->ToMPISerial();
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-	return vec_serial;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Copy{{{*/
+-void Vector::Copy(Vector* to){
+-
+-	
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->Copy(to->pvector);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->Copy(to->svector);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Norm{{{*/
+-IssmDouble Vector::Norm(NormMode norm_type){
+-	
+-	IssmDouble norm=0;
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		norm=this->pvector->Norm(norm_type);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		norm=this->svector->Norm(norm_type);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-	return norm;
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Scale{{{*/
+-void Vector::Scale(IssmDouble scale_factor){
+-	
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->Scale(scale_factor);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->Scale(scale_factor);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Vector::Dot{{{*/
+-IssmDouble Vector::Dot(Vector* vector){
+-
+-	IssmDouble dot;
+-	
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		dot=this->pvector->Dot(vector->pvector);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		dot=this->svector->Dot(vector->svector);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-	return dot;
+-}
+-/*}}}*/
+-/*FUNCTION Vector::PointwiseDivide{{{*/
+-void Vector::PointwiseDivide(Vector* x,Vector* y){
+-
+-
+-	if(type==PetscVecType){
+-		#ifdef _HAVE_PETSC_
+-		this->pvector->PointwiseDivide(x->pvector,y->pvector);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqVecType){
+-		this->svector->PointwiseDivide(x->svector,y->svector);
+-	}
+-	else _error_("Vector type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 13216)
+@@ -1,314 +0,0 @@
+-/*!\file Matrix.cpp
+- * \brief: implementation of the Matrix object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../classes.h"
+-#include "../../shared/shared.h"
+-#include "../../Container/Container.h"
+-#include "../../include/include.h"
+-#include "../../toolkits/toolkits.h"
+-#include "./Matrix.h"
+-	
+-/*}}}*/
+-
+-/*Matrix constructors and destructor*/
+-/*FUNCTION Matrix::Matrix(){{{*/
+-Matrix::Matrix(){
+-
+-	#ifdef _HAVE_PETSC_
+-	pmatrix=NULL;
+-	#endif
+-	smatrix=NULL;
+-
+-	type=PetscMatType; //default
+-	#ifndef _HAVE_PETSC_
+-	type=SeqMatType;
+-	#endif
+-	
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Matrix(int M,int N,int type){{{*/
+-Matrix::Matrix(int M,int N,int in_type){
+-
+-	#ifdef _HAVE_PETSC_
+-	pmatrix=NULL;
+-	#endif
+-	smatrix=NULL;
+-	type=in_type;
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix=new PetscMat(M,N);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix=new SeqMat(M,N);
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Matrix(int M,int N,IssmDouble sparsity,int type){{{*/
+-Matrix::Matrix(int M,int N,IssmDouble sparsity,int in_type){
+-
+-	#ifdef _HAVE_PETSC_
+-	pmatrix=NULL;
+-	#endif
+-	smatrix=NULL;
+-	type=in_type;
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix=new PetscMat(M,N,sparsity);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix=new SeqMat(M,N,sparsity);
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int type){{{*/
+-Matrix::Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int in_type){
+-
+-	#ifdef _HAVE_PETSC_
+-	pmatrix=NULL;
+-	#endif
+-	smatrix=NULL;
+-	type=in_type;
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix=new PetscMat(serial_mat,M,N,sparsity);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix=new SeqMat(serial_mat,M,N,sparsity);
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-	
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode,int type){{{*/
+-Matrix::Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type){
+-
+-	#ifdef _HAVE_PETSC_
+-	pmatrix=NULL;
+-	#endif
+-	smatrix=NULL;
+-	type=in_type;
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix=new PetscMat(M,N,connectivity,numberofdofspernode);
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix=new SeqMat(M,N,connectivity,numberofdofspernode);
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-	
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::~Matrix(){{{*/
+-Matrix::~Matrix(){
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		delete this->pmatrix;
+-		#else
+-		_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		delete this->smatrix;
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-
+-/*Matrix specific routines: */
+-/*FUNCTION Matrix::Echo{{{*/
+-void Matrix::Echo(void){
+-	_assert_(this);
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix->Echo();
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix->Echo();
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Assemble{{{*/
+-void Matrix::Assemble(void){
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix->Assemble();
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix->Assemble();
+-	}
+-	else{
+-		_error_("Matrix type: " << type << " not supported yet!");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Norm{{{*/
+-IssmDouble Matrix::Norm(NormMode norm_type){
+-	
+-	IssmDouble norm=0;
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		norm=this->pmatrix->Norm(norm_type);
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		norm=this->smatrix->Norm(norm_type);
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-
+-	return norm;
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::GetSize{{{*/
+-void Matrix::GetSize(int* pM,int* pN){
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix->GetSize(pM,pN);
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix->GetSize(pM,pN);
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-	
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::GetLocalSize{{{*/
+-void Matrix::GetLocalSize(int* pM,int* pN){
+-	
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix->GetLocalSize(pM,pN);
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix->GetLocalSize(pM,pN);
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::MatMult{{{*/
+-void Matrix::MatMult(Vector* X,Vector* AX){
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix->MatMult(X->pvector,AX->pvector);
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix->MatMult(X->svector,AX->svector);
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Duplicate{{{*/
+-Matrix* Matrix::Duplicate(void){
+-
+-	Matrix* output=NULL;
+-
+-	output=new Matrix();
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		output->pmatrix=this->pmatrix->Duplicate();
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		output->smatrix=this->smatrix->Duplicate();
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-	
+-	return output;
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::ToSerial{{{*/
+-IssmDouble* Matrix::ToSerial(void){
+-
+-	IssmDouble* output=NULL;
+-	
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		output=this->pmatrix->ToSerial();
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		output=this->smatrix->ToSerial();
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-
+-
+-	return output;
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::SetValues{{{*/
+-void Matrix::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){
+-		
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix->SetValues(m,idxm,n,idxn,values,mode);
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix->SetValues(m,idxm,n,idxn,values,mode);
+-	}
+-	else _error_("Matrix type: " << type << " not supported yet!");
+-}
+-/*}}}*/
+-/*FUNCTION Matrix::Convert{{{*/
+-void Matrix::Convert(MatrixType newtype){
+-
+-	if(type==PetscMatType){
+-		#ifdef _HAVE_PETSC_
+-		this->pmatrix->Convert(newtype);
+-		#endif
+-	}
+-	else if(type==SeqMatType){
+-		this->smatrix->Convert(newtype);
+-	}
+-	else{
+-		_error_("Matrix type: " << type << " not supported yet!");
+-	}
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 13216)
+@@ -244,8 +244,8 @@
+ /*}}}*/
+ 
+ /*ElementMatrix specific routines: */
+-/*FUNCTION ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){{{*/
+-void ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){
++/*FUNCTION 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 +299,8 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::AddToGlobal(Matrix* Jff){{{*/
+-void ElementMatrix::AddToGlobal(Matrix* Jff){
++/*FUNCTION ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){{{*/
++void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){
+ 
+ 	int i,j;
+ 	IssmDouble* localvalues=NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 13216)
+@@ -14,7 +14,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ class Node;
+-class Vector;
++template <class doubletype> class Vector;
+ class Parameters;
+ /*}}}*/
+ 
+@@ -41,8 +41,8 @@
+ 		~ElementVector();
+ 		/*}}}*/
+ 		/*ElementVector specific routines {{{*/
+-		void AddToGlobal(Vector* pf);
+-		void InsertIntoGlobal(Vector* pf);
++		void AddToGlobal(Vector<IssmDouble>* pf);
++		void InsertIntoGlobal(Vector<IssmDouble>* pf);
+ 		void Echo(void);
+ 		void CheckConsistency(void);
+ 		void Init(ElementVector* pe);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 13216)
+@@ -14,7 +14,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ class Node;
+-class Matrix;
++template <class doublematrix> class Matrix;
+ class Parameters;
+ /*}}}*/
+ 
+@@ -59,8 +59,8 @@
+ 		~ElementMatrix();
+ 		/*}}}*/
+ 		/*ElementMatrix specific routines {{{*/
+-		void AddToGlobal(Matrix* Kff, Matrix* Kfs);
+-		void AddToGlobal(Matrix* Jff);
++		void AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
++		void AddToGlobal(Matrix<IssmDouble>* Jff);
+ 		void Echo(void);
+ 		void CheckConsistency(void);
+ 		void Transpose(void);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 13216)
+@@ -20,6 +20,7 @@
+ 
+ enum vectortype { PetscVecType, SeqVecType };
+ 
++template <class doubletype> 
+ class Vector{
+ 
+ 	public:
+@@ -27,44 +28,442 @@
+ 		#ifdef _HAVE_PETSC_
+ 		PetscVec* pvector;
+ 		#endif
+-		SeqVec* svector; 
++		SeqVec<doubletype>* svector; 
+ 		int     type;
+ 	
+ 
+-		/*Vector constructors, destructors {{{*/
+-		Vector();
++		/*Vector constructors, destructors */
++		/*FUNCTION Vector(){{{*/
++		Vector(){
++
++			#ifdef _HAVE_PETSC_
++			this->pvector=NULL;
++			#endif
++			this->svector=NULL;
++
++			type=PetscVecType; //default
++			#ifndef _HAVE_PETSC_
++			type=SeqVecType;
++			#endif
++
++		}
++		/*}}}*/
++		/*FUNCTION Vector(int M,bool fromlocalsize,int in_type){{{*/
+ 		#ifdef _HAVE_PETSC_
+-		Vector(Vec petsc_vector);
+-		Vector(int M,bool fromlocalsize=false,int type=PetscVecType);
+-		Vector(IssmDouble* serial_vec,int pM,int type=PetscVecType);
++		Vector(int M,bool fromlocalsize=false,int in_type=PetscVecType){
+ 		#else
+-		Vector(int M,bool fromlocalsize=false,int type=SeqVecType);
+-		Vector(IssmDouble* serial_vec,int pM,int type=SeqVecType);
++		Vector(int M,bool fromlocalsize=false,int in_type=SeqVecType){
+ 		#endif
+ 
+-		~Vector();
++			#ifdef _HAVE_PETSC_
++			pvector=NULL;
++			#endif
++			svector=NULL;
++			type=in_type;
++
++
++			if(type==PetscVecType){
++			#ifdef _HAVE_PETSC_
++				this->pvector=new PetscVec(M,fromlocalsize);
++			 #else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++			 #endif
++			}
++			else if(type==SeqVecType){
++				this->svector=new SeqVec<doubletype>(M,fromlocalsize);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
+ 		/*}}}*/
+-		/*Vector specific routines {{{*/
+-		void    Echo(void);
+-		void    AXPY(Vector *X, IssmDouble a);
+-		void    AYPX(Vector *X, IssmDouble a);
+-		void    Assemble(void);
+-		void    Copy(Vector *to);
+-		IssmDouble  Dot(Vector *vector);
+-		Vector *Duplicate(void);
+-		void    GetValue(IssmDouble *pvalue, int dof);
+-		void    GetSize(int *pM);
+-		void    GetLocalSize(int *pM);
+-		bool    IsEmpty(void);
+-		IssmDouble  Norm(NormMode norm_type);
+-		void    PointwiseDivide(Vector  *x,Vector*y);
+-		void    Scale(IssmDouble scale_factor);
+-		void    Set(IssmDouble value);
+-		void    SetValues(int ssize, int *list, IssmDouble*values, InsMode mode);
+-		void    SetValue(int dof, IssmDouble value, InsMode mode);
+-		IssmDouble *ToMPISerial(void);
++		/*FUNCTION Vector(doubletype* serial_vec,int M,int in_type){{{*/
++		#ifdef _HAVE_PETSC_
++		Vector(doubletype* serial_vec,int M,int in_type=PetscVecType){
++		#else
++		Vector(doubletype* serial_vec,int M,int in_type=SeqVecType){
++		#endif
++
++			#ifdef _HAVE_PETSC_
++			pvector=NULL;
++			#endif
++
++			svector=NULL;
++			type=in_type;
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector=new PetscVec(serial_vec,M);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector=new SeqVec<doubletype>(serial_vec,M);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
+ 		/*}}}*/
+-};
++		/*FUNCTION ~Vector(){{{*/
++		~Vector(){
+ 
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				delete this->pvector;
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				delete this->svector;
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++		}
++		/*}}}*/
++		#ifdef _HAVE_PETSC_
++		/*FUNCTION Vector(Vec petsc_vector){{{*/
++		Vector(Vec petsc_vector){
+ 
++			this->type=PetscVecType;
++			this->svector=NULL;
++			this->pvector=new PetscVec(petsc_vector);
++
++		}
++		/*}}}*/
++		#endif
++
++		/*Vector specific routines*/
++		/*FUNCTION Echo{{{*/
++		void Echo(void){
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->Echo();
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->Echo();
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION Assemble{{{*/
++		void Assemble(void){
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->Assemble();
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->Assemble();
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION SetValues{{{*/
++		void SetValues(int ssize, int* list, doubletype* values, InsMode mode){
++
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->SetValues(ssize,list,values,mode);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->SetValues(ssize,list,values,mode);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++
++
++		}
++		/*}}}*/
++		/*FUNCTION SetValue{{{*/
++		void SetValue(int dof, doubletype value, InsMode mode){
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->SetValue(dof,value,mode);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->SetValue(dof,value,mode);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION GetValue{{{*/
++		void GetValue(doubletype* pvalue,int dof){
++
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->GetValue(pvalue,dof);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->GetValue(pvalue,dof);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION GetSize{{{*/
++		void GetSize(int* pM){
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->GetSize(pM);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->GetSize(pM);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION IsEmpty{{{*/
++		bool IsEmpty(void){
++
++			int M;
++
++			this->GetSize(&M);
++
++			if(M==0) 
++				return true;
++			else
++				return false;
++		}
++		/*}}}*/
++		/*FUNCTION GetLocalSize{{{*/
++		void GetLocalSize(int* pM){
++
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->GetLocalSize(pM);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->GetLocalSize(pM);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION Duplicate{{{*/
++		Vector* Duplicate(void){
++
++			Vector* output=NULL;
++
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				output=new Vector();
++				output->pvector=this->pvector->Duplicate();
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				output=new Vector();
++				output->svector=this->svector->Duplicate();
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++			return output;
++
++		}
++		/*}}}*/
++		/*FUNCTION Set{{{*/
++		void Set(doubletype value){
++
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->Set(value);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->Set(value);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION AXPY{{{*/
++		void AXPY(Vector* X, doubletype a){
++
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->AXPY(X->pvector,a);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->AXPY(X->svector,a);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION AYPX{{{*/
++		void AYPX(Vector* X, doubletype a){
++
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->AYPX(X->pvector,a);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->AYPX(X->svector,a);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++
++		}
++		/*}}}*/
++		/*FUNCTION ToMPISerial{{{*/
++		doubletype* ToMPISerial(void){
++
++			doubletype* vec_serial=NULL;
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				vec_serial=this->pvector->ToMPISerial();
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				vec_serial=this->svector->ToMPISerial();
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++			return vec_serial;
++
++		}
++		/*}}}*/
++		/*FUNCTION Copy{{{*/
++		void Copy(Vector* to){
++
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->Copy(to->pvector);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->Copy(to->svector);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++
++		}
++		/*}}}*/
++		/*FUNCTION Norm{{{*/
++		doubletype Norm(NormMode norm_type){
++
++			doubletype norm=0;
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				norm=this->pvector->Norm(norm_type);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				norm=this->svector->Norm(norm_type);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++			return norm;
++		}
++		/*}}}*/
++		/*FUNCTION Scale{{{*/
++		void Scale(doubletype scale_factor){
++
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->Scale(scale_factor);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->Scale(scale_factor);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION Dot{{{*/
++		doubletype Dot(Vector* vector){
++
++			doubletype dot;
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				dot=this->pvector->Dot(vector->pvector);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				dot=this->svector->Dot(vector->svector);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++			return dot;
++		}
++		/*}}}*/
++		/*FUNCTION PointwiseDivide{{{*/
++		void PointwiseDivide(Vector* x,Vector* y){
++
++
++			if(type==PetscVecType){
++				#ifdef _HAVE_PETSC_
++				this->pvector->PointwiseDivide(x->pvector,y->pvector);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqVecType){
++				this->svector->PointwiseDivide(x->svector,y->svector);
++			}
++			else _error_("Vector type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++};
+ #endif //#ifndef _VECTOR_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 13216)
+@@ -16,9 +16,12 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ /*}}}*/
+-class Vector;
+-enum matrixtype{PetscMatType, SeqMatType};
+ 
++enum matrixtype { PetscMatType, SeqMatType };
++
++template <class doubletype> class Vector;
++
++template <class doubletype> 
+ class Matrix{
+ 
+ 	public:
+@@ -26,36 +29,317 @@
+ 		#ifdef _HAVE_PETSC_
+ 		PetscMat *pmatrix;
+ 		#endif
+-		SeqMat   *smatrix;
++		SeqMat<doubletype>   *smatrix;
+ 		int       type;
+ 
+-		/*Matrix constructors, destructors {{{*/
+-		Matrix();
++		/*Matrix constructors, destructors*/
++		/*FUNCTION Matrix(){{{*/
++		Matrix(){
++
++			#ifdef _HAVE_PETSC_
++			pmatrix=NULL;
++			#endif
++			smatrix=NULL;
++
++			type=PetscMatType; //default
++			#ifndef _HAVE_PETSC_
++			type=SeqMatType;
++			#endif
++
++		}
++		/*}}}*/
++		/*FUNCTION Matrix(int M,int N,int in_type){{{*/
+ 		#ifdef _HAVE_PETSC_
+-		Matrix(int M,int N,int type=PetscMatType);
+-		Matrix(int M,int N,IssmDouble sparsity,int type=PetscMatType);
+-		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=PetscMatType);
+-		Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=PetscMatType);
++		Matrix(int M,int N,int in_type=PetscMatType){
+ 		#else
+-		Matrix(int M,int N,int type=SeqMatType);
+-		Matrix(int M,int N,IssmDouble sparsity,int type=SeqMatType);
+-		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=SeqMatType);
+-		Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=SeqMatType);
++		Matrix(int M,int N,int in_type=SeqMatType){
+ 		#endif
+-		~Matrix();
++
++			#ifdef _HAVE_PETSC_
++			pmatrix=NULL;
++			#endif
++			smatrix=NULL;
++			type=in_type;
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix=new PetscMat(M,N);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix=new SeqMat<doubletype>(M,N);
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++		}
+ 		/*}}}*/
+-		/*Matrix specific routines {{{*/
+-		void        Echo(void);
+-		void        Assemble(void);
+-		IssmDouble  Norm(NormMode norm_type);
+-		void        GetSize(int *pM,int*pN);
+-		void        GetLocalSize(int *pM,int*pN);
+-		void        MatMult(Vector *X,Vector*AX);
+-		Matrix     *Duplicate(void);
+-		IssmDouble *ToSerial(void);
+-		void        SetValues(int m,int *idxm,int n,int*idxn,IssmDouble*values,InsMode mode);
+-		void        Convert(MatrixType newtype);
++		/*FUNCTION Matrix(int M,int N,IssmDouble sparsity,int in_type){{{*/
++		#ifdef _HAVE_PETSC_
++		Matrix(int M,int N,IssmDouble sparsity,int in_type=PetscMatType){
++		#else
++		Matrix(int M,int N,IssmDouble sparsity,int in_type=SeqMatType){
++		#endif
++
++			#ifdef _HAVE_PETSC_
++			pmatrix=NULL;
++			#endif
++
++			smatrix=NULL;
++			type=in_type;
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix=new PetscMat(M,N,sparsity);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix=new SeqMat<doubletype>(M,N,sparsity);
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++		}
+ 		/*}}}*/
++		/*FUNCTION Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int in_type){{{*/
++		#ifdef _HAVE_PETSC_
++		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int in_type=PetscMatType){
++		#else
++		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int in_type=SeqMatType){
++		#endif
++
++			#ifdef _HAVE_PETSC_
++			pmatrix=NULL;
++			#endif
++			smatrix=NULL;
++			type=in_type;
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix=new PetscMat(serial_mat,M,N,sparsity);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix=new SeqMat<doubletype>(serial_mat,M,N,sparsity);
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type){{{*/
++		#ifdef _HAVE_PETSC_
++		Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type=PetscMatType){
++		#else
++		Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type=SeqMatType){
++		#endif
++
++			#ifdef _HAVE_PETSC_
++			pmatrix=NULL;
++			#endif
++			smatrix=NULL;
++			type=in_type;
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix=new PetscMat(M,N,connectivity,numberofdofspernode);
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix=new SeqMat<doubletype>(M,N,connectivity,numberofdofspernode);
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION ~Matrix(){{{*/
++		~Matrix(){
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				delete this->pmatrix;
++				#else
++				_error_("Petsc matrix format not usable, as Petsc has not been compiled!");
++				#endif
++			}
++			else if(type==SeqMatType){
++				delete this->smatrix;
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++
++		/*Matrix specific routines:*/
++		/*FUNCTION Echo{{{*/
++		void Echo(void){
++			_assert_(this);
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix->Echo();
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix->Echo();
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION Assemble{{{*/
++		void Assemble(void){
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix->Assemble();
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix->Assemble();
++			}
++			else{
++				_error_("Matrix type: " << type << " not supported yet!");
++			}
++		}
++		/*}}}*/
++		/*FUNCTION Norm{{{*/
++		IssmDouble Norm(NormMode norm_type){
++
++			IssmDouble norm=0;
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				norm=this->pmatrix->Norm(norm_type);
++				#endif
++			}
++			else if(type==SeqMatType){
++				norm=this->smatrix->Norm(norm_type);
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++			return norm;
++		}
++		/*}}}*/
++		/*FUNCTION GetSize{{{*/
++		void GetSize(int* pM,int* pN){
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix->GetSize(pM,pN);
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix->GetSize(pM,pN);
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION GetLocalSize{{{*/
++		void GetLocalSize(int* pM,int* pN){
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix->GetLocalSize(pM,pN);
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix->GetLocalSize(pM,pN);
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION MatMult{{{*/
++		void MatMult(Vector<doubletype>* X,Vector<doubletype>* AX){
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix->MatMult(X->pvector,AX->pvector);
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix->MatMult(X->svector,AX->svector);
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++		}
++		/*}}}*/
++		/*FUNCTION Duplicate{{{*/
++		Matrix* Duplicate(void){
++
++			Matrix* output=NULL;
++
++			output=new Matrix();
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				output->pmatrix=this->pmatrix->Duplicate();
++				#endif
++			}
++			else if(type==SeqMatType){
++				output->smatrix=this->smatrix->Duplicate();
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++			return output;
++		}
++		/*}}}*/
++		/*FUNCTION ToSerial{{{*/
++		doubletype* ToSerial(void){
++
++			doubletype* output=NULL;
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				output=this->pmatrix->ToSerial();
++				#endif
++			}
++			else if(type==SeqMatType){
++				output=this->smatrix->ToSerial();
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++
++
++			return output;
++		}
++		/*}}}*/
++		/*FUNCTION SetValues{{{*/
++		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix->SetValues(m,idxm,n,idxn,values,mode);
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix->SetValues(m,idxm,n,idxn,values,mode);
++			}
++			else _error_("Matrix type: " << type << " not supported yet!");
++		}
++		/*}}}*/
++		/*FUNCTION Convert{{{*/
++		void Convert(MatrixType newtype){
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				this->pmatrix->Convert(newtype);
++				#endif
++			}
++			else if(type==SeqMatType){
++				this->smatrix->Convert(newtype);
++			}
++			else{
++				_error_("Matrix type: " << type << " not supported yet!");
++			}
++
++		}
++		/*}}}*/
+ };
+ 
+ #endif //#ifndef _MATRIX_H_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 13216)
+@@ -159,8 +159,8 @@
+ /*}}}*/
+ 
+ /*ElementVector specific routines: */
+-/*FUNCTION ElementVector::AddToGlobal(Vector* pf){{{*/
+-void ElementVector::AddToGlobal(Vector* pf){
++/*FUNCTION ElementVector::AddToGlobal(Vector<IssmDouble>* pf){{{*/
++void ElementVector::AddToGlobal(Vector<IssmDouble>* pf){
+ 
+ 	int i;
+ 	IssmDouble* localvalues=NULL;
+@@ -183,8 +183,8 @@
+ 	
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::InsertIntoGlobal(Vector* pf){{{*/
+-void ElementVector::InsertIntoGlobal(Vector* pf){
++/*FUNCTION ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){{{*/
++void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){
+ 
+ 	int i;
+ 	IssmDouble* localvalues=NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13216)
+@@ -878,7 +878,6 @@
+ 
+ 	/*output: */
+ 	int     code;
+-	Option *option      = NULL;
+ 	char   *name        = NULL;
+ 
+ 	/*First get option name*/
+@@ -888,34 +887,37 @@
+ 	fid=this->SetFilePointerToData(&code,NULL,index+1);
+ 	switch(code){
+ 		case 3: {//IssmDouble
+-			  IssmDouble *value = NULL;
+-			  value=xNew<IssmDouble>(1);
+-			  FetchData(value,index+1);
+-			  option = new OptionDouble();
+-			  ((OptionDouble*)option)->values = value;
+-			  option->name  = name;
+-			  option->numel = 1;
+-			  option->ndims = 1;
+-			  option->size  = NULL;
+-			  break;
+-			  }
++					GenericOption<IssmDouble*>* option;
++					IssmDouble *value = NULL;
++					value=xNew<IssmDouble>(1);
++					FetchData(value,index+1);
++					option = new GenericOption<IssmDouble*>();
++					option->value = value;
++					option->name  = name;
++					option->numel = 1;
++					option->ndims = 1;
++					option->size  = NULL;
++					/*Assign output pointers: */
++					*poption=option;
++					break;
++				}
+ 		case 4: {//char
+-			  char* value = NULL;
+-			  FetchData(&value,index+1);
+-			  option = new OptionChar();
+-			  ((OptionChar*)option)->values = value;
+-			  option->name  = name;
+-			  option->numel = 1;
+-			  option->ndims = 1;
+-			  option->size  = NULL;
+-			  break;
+-			  }
++					GenericOption<char*>* option;
++					char* value = NULL;
++					FetchData(&value,index+1);
++					option = new GenericOption<char*>();
++					option->value = value;
++					option->name  = name;
++					option->numel = 1;
++					option->ndims = 1;
++					option->size  = NULL;
++					*poption=option;
++					break;
++				}
+ 		default:
+ 			  _error_("Option of format " << code << " not supported yet");
+ 	}
+ 
+-	/*Assign output pointers: */
+-	*poption=option;
+ }
+ /*}}}*/
+ /*FUNCTION IoModel::FetchData(int num,...){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_nonlinear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_nonlinear.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_nonlinear.cpp	(revision 13216)
+@@ -13,15 +13,15 @@
+ void solver_nonlinear(FemModel* femmodel,bool conserve_loads){
+ 
+ 	/*intermediary: */
+-	Matrix* Kff = NULL;
+-	Matrix* Kfs = NULL;
+-	Vector* ug  = NULL;
+-	Vector* old_ug = NULL;
+-	Vector* uf  = NULL;
+-	Vector* old_uf = NULL;
+-	Vector* pf  = NULL;
+-	Vector* df  = NULL;
+-	Vector* ys  = NULL;
++	Matrix<IssmDouble>* Kff = NULL;
++	Matrix<IssmDouble>* Kfs = NULL;
++	Vector<IssmDouble>* ug  = NULL;
++	Vector<IssmDouble>* old_ug = NULL;
++	Vector<IssmDouble>* uf  = NULL;
++	Vector<IssmDouble>* old_uf = NULL;
++	Vector<IssmDouble>* pf  = NULL;
++	Vector<IssmDouble>* df  = NULL;
++	Vector<IssmDouble>* ys  = NULL;
+ 	
+ 	Loads* loads=NULL;
+ 	bool converged;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_linear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_linear.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_linear.cpp	(revision 13216)
+@@ -10,13 +10,13 @@
+ void solver_linear(FemModel* femmodel){
+ 
+ 	/*intermediary: */
+-	Matrix*  Kff = NULL;
+-	Matrix*  Kfs = NULL;
+-	Vector*  ug  = NULL;
+-	Vector*  uf  = NULL;
+-	Vector*  pf  = NULL;
+-	Vector*  df  = NULL;
+-	Vector*  ys  = NULL;
++	Matrix<IssmDouble>*  Kff = NULL;
++	Matrix<IssmDouble>*  Kfs = NULL;
++	Vector<IssmDouble>*  ug  = NULL;
++	Vector<IssmDouble>*  uf  = NULL;
++	Vector<IssmDouble>*  pf  = NULL;
++	Vector<IssmDouble>*  df  = NULL;
++	Vector<IssmDouble>*  ys  = NULL;
+ 	int  configuration_type;
+ 
+ 	/*Recover parameters: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_newton.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_newton.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_newton.cpp	(revision 13216)
+@@ -17,18 +17,18 @@
+ 	int    num_unstable_constraints;
+ 	int    count;
+ 	IssmDouble kmax;
+-	Matrix* Kff = NULL;
+-	Matrix* Kfs    = NULL;
+-	Matrix* Jff = NULL;
+-	Vector* ug  = NULL;
+-	Vector* old_ug = NULL;
+-	Vector* uf  = NULL;
+-	Vector* old_uf = NULL;
+-	Vector* duf = NULL;
+-	Vector* pf  = NULL;
+-	Vector* pJf    = NULL;
+-	Vector* df  = NULL;
+-	Vector* ys  = NULL;
++	Matrix<IssmDouble>* Kff = NULL;
++	Matrix<IssmDouble>* Kfs    = NULL;
++	Matrix<IssmDouble>* Jff = NULL;
++	Vector<IssmDouble>* ug  = NULL;
++	Vector<IssmDouble>* old_ug = NULL;
++	Vector<IssmDouble>* uf  = NULL;
++	Vector<IssmDouble>* old_uf = NULL;
++	Vector<IssmDouble>* duf = NULL;
++	Vector<IssmDouble>* pf  = NULL;
++	Vector<IssmDouble>* pJf    = NULL;
++	Vector<IssmDouble>* df  = NULL;
++	Vector<IssmDouble>* ys  = NULL;
+ 
+ 	/*parameters:*/
+ 	int max_nonlinear_iterations;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_stokescoupling_nonlinear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_stokescoupling_nonlinear.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_stokescoupling_nonlinear.cpp	(revision 13216)
+@@ -13,20 +13,20 @@
+ void solver_stokescoupling_nonlinear(FemModel* femmodel,bool conserve_loads){
+ 
+ 	/*intermediary: */
+-	Matrix*  Kff_horiz = NULL;
+-	Matrix* Kfs_horiz   = NULL;
+-	Vector*  ug_horiz  = NULL;
+-	Vector*  uf_horiz  = NULL;
+-	Vector*  old_uf_horiz = NULL;
+-	Vector*  pf_horiz  = NULL;
+-	Vector*  df_horiz  = NULL;
+-	Matrix*  Kff_vert  = NULL;
+-	Matrix*  Kfs_vert  = NULL;
+-	Vector*  ug_vert   = NULL;
+-	Vector*  uf_vert   = NULL;
+-	Vector*  pf_vert   = NULL;
+-	Vector*  df_vert   = NULL;
+-	Vector*  ys   = NULL;
++	Matrix<IssmDouble>*  Kff_horiz = NULL;
++	Matrix<IssmDouble>* Kfs_horiz   = NULL;
++	Vector<IssmDouble>*  ug_horiz  = NULL;
++	Vector<IssmDouble>*  uf_horiz  = NULL;
++	Vector<IssmDouble>*  old_uf_horiz = NULL;
++	Vector<IssmDouble>*  pf_horiz  = NULL;
++	Vector<IssmDouble>*  df_horiz  = NULL;
++	Matrix<IssmDouble>*  Kff_vert  = NULL;
++	Matrix<IssmDouble>*  Kfs_vert  = NULL;
++	Vector<IssmDouble>*  ug_vert   = NULL;
++	Vector<IssmDouble>*  uf_vert   = NULL;
++	Vector<IssmDouble>*  pf_vert   = NULL;
++	Vector<IssmDouble>*  df_vert   = NULL;
++	Vector<IssmDouble>*  ys   = NULL;
+ 	bool converged;
+ 	int  constraints_converged;
+ 	int  num_unstable_constraints;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_thermal_nonlinear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_thermal_nonlinear.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_thermal_nonlinear.cpp	(revision 13216)
+@@ -11,17 +11,17 @@
+ void solver_thermal_nonlinear(FemModel* femmodel){
+ 
+ 	/*solution : */
+-	Vector* tg=NULL; 
+-	Vector* tf=NULL; 
+-	Vector* tf_old=NULL; 
+-	Vector* ys=NULL; 
++	Vector<IssmDouble>* tg=NULL; 
++	Vector<IssmDouble>* tf=NULL; 
++	Vector<IssmDouble>* tf_old=NULL; 
++	Vector<IssmDouble>* ys=NULL; 
+ 	IssmDouble melting_offset;
+ 
+ 	/*intermediary: */
+-	Matrix* Kff=NULL;
+-	Matrix* Kfs=NULL;
+-	Vector* pf=NULL;
+-	Vector* df=NULL;
++	Matrix<IssmDouble>* Kff=NULL;
++	Matrix<IssmDouble>* Kfs=NULL;
++	Vector<IssmDouble>* pf=NULL;
++	Vector<IssmDouble>* df=NULL;
+ 
+ 	bool converged;
+ 	int constraints_converged;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_adjoint_linear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_adjoint_linear.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_adjoint_linear.cpp	(revision 13216)
+@@ -12,13 +12,13 @@
+ 	 * use the flag "true" so that all spc are taken as 0*/
+ 
+ 	/*intermediary: */
+-	Matrix*  Kff = NULL;
+-	Matrix*  Kfs = NULL;
+-	Vector*  ug  = NULL;
+-	Vector*  uf  = NULL;
+-	Vector*  pf  = NULL;
+-	Vector*  df  = NULL;
+-	Vector*  ys  = NULL;
++	Matrix<IssmDouble>*  Kff = NULL;
++	Matrix<IssmDouble>*  Kfs = NULL;
++	Vector<IssmDouble>*  ug  = NULL;
++	Vector<IssmDouble>*  uf  = NULL;
++	Vector<IssmDouble>*  pf  = NULL;
++	Vector<IssmDouble>*  df  = NULL;
++	Vector<IssmDouble>*  ys  = NULL;
+ 	int  configuration_type;
+ 
+ 	/*Recover parameters: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp	(revision 13216)
+@@ -40,13 +40,13 @@
+ 	FetchData(&filkml,FILENAME);
+ 	FetchData(&options,NRHS,nrhs,prhs);
+ 
+-	options->Get(&lataxis ,&nlat ,"lataxis" );
++	options->Get(&lataxis ,&nlat ,(char*)"lataxis");
+ 	if (verbose && lataxis) for (i=0; i<nlat; i++) _printLine_("  lataxis [" << i << "]=" << lataxis[i]);
+-	options->Get(&longaxis,&nlong,"longaxis");
++	options->Get(&longaxis,&nlong,(char*)"longaxis");
+ 	if (verbose && longaxis) for (i=0; i<nlong; i++) _printLine_("  longaxis[" << i << "]=" << longaxis[i]);
+-	options->Get(&pimages,&nimages,"images");
++	options->Get(&pimages,&nimages,(char*)"images");
+ 	if (verbose && pimages) for (i=0; i<nimages; i++) _printLine_("  pimages[" << i << "]=\"" << pimages[i] << "\"");
+-	options->Get(&dzip,"zip",0.);
++	options->Get(&dzip,(char*)"zip",0.);
+ 	if (verbose) _printLine_("  dzip=" << dzip);
+ 
+ 	/*some checks*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13216)
+@@ -34,7 +34,7 @@
+ 	char*   interptype=NULL;
+ 
+ 	/* output: */
+-	Vector*  flags=NULL;
++	Vector<double>*  flags=NULL;
+ 	int  nods;
+ 
+ 	//contours
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 13216)
+@@ -54,7 +54,7 @@
+ 	int nods_prime;
+ 
+ 	/* output: */
+-	Vector*  data_prime=NULL;
++	Vector<double>*  data_prime=NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 13216)
+@@ -36,7 +36,7 @@
+ 	int     interpolationenum;
+ 
+ 	/* output: */
+-	Vector*  data_mesh=NULL;
++	Vector<double>*  data_mesh=NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp	(revision 13216)
+@@ -55,9 +55,9 @@
+ 	FetchData(&options,NRHS,nrhs,prhs);
+ 	FetchData(&options,NRHS,nrhs,prhs);
+ 
+-	options->Get(&echo    ,"echo"    ,"off");
+-	options->Get(&deepecho,"deepecho","off");
+-	options->Get(&write   ,"write"   ,"off");
++	options->Get(&echo    ,"echo"    ,(char*)"off");
++	options->Get(&deepecho,"deepecho",(char*)"off");
++	options->Get(&write   ,"write"   ,(char*)"off");
+ 
+ 	/*some checks*/
+ 	if (!strlen(filnam)) strcpy(filnam,"stdout");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp	(revision 13216)
+@@ -36,7 +36,7 @@
+ 	FetchData(&sgn,SGN_IN);
+ 	FetchData(&options,NRHS,nrhs,prhs);
+ 
+-	options->Get(&choles,"holes","no");
++	options->Get(&choles,"holes",(char*)"no");
+ 	if (!strncmp(choles,"y",1) || !strncmp(choles,"on",2)) holes=true;
+ 
+ 	/*  defaults are in Xy2lldef, so don't duplicate them here, and only use user values if both have been specified  */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp	(revision 13216)
+@@ -16,7 +16,7 @@
+ 	double  multithread;
+ 
+ 	/* output: */
+-	Vector*  flags=NULL;
++	Vector<double>*  flags=NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13216)
+@@ -60,7 +60,7 @@
+ 	int nods_prime;
+ 
+ 	/* output: */
+-	Vector*  data_prime=NULL;
++	Vector<double>*  data_prime=NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13216)
+@@ -36,8 +36,8 @@
+ 	DataSet* contours  = NULL;
+ 
+ 	/* output: */
+-	Vector *in_nod  = NULL;
+-	Vector *in_elem = NULL;
++	Vector<double> *in_nod  = NULL;
++	Vector<double> *in_elem = NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 13215)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 13216)
+@@ -16,11 +16,11 @@
+ 	DataSet *rifts  = NULL;
+ 
+ 	/* output: */
+-	Matrix *index             = NULL;
+-	Vector *x                 = NULL;
+-	Vector *y                 = NULL;
+-	Matrix *segments          = NULL;
+-	Vector *segmentmarkerlist = NULL;
++	Matrix<double> *index             = NULL;
++	Vector<double> *x                 = NULL;
++	Vector<double> *y                 = NULL;
++	Matrix<double> *segments          = NULL;
++	Vector<double> *segmentmarkerlist = NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
Index: /issm/oecreview/Archive/12678-13393/ISSM-13216-13217.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13216-13217.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13216-13217.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/GenericOption.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/GenericOption.h	(revision 13216)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/GenericOption.h	(revision 13217)
+@@ -123,7 +123,4 @@
+ } 
+ /*}}}*/
+ 
+-
+-
+ #endif  /* _OPTIONOBJECT_H */
+-
Index: /issm/oecreview/Archive/12678-13393/ISSM-13217-13218.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13217-13218.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13217-13218.diff	(revision 13394)
@@ -0,0 +1,114 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13217)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13218)
+@@ -3,10 +3,10 @@
+ 
+ #style
+ #{{{
+-H1_STYLE='width="700px" cellpadding="5"'
+-H1_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:30px;" align="center"'
+-H2_STYLE='width="700px" cellpadding="5"'
+-H2_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:25px; font-weight: bold;" align="left"'
++TITLE_STYLE='width="700px" cellpadding="10"'
++TITLE_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:25px;" align="center"'
++SECTION_STYLE='width="700px" cellpadding="5"'
++SECTION_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:20px; font-weight: bold;" align="left"'
+ TABLE_STYLE='width="680px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"'
+ TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px; font-weight: normal;" align="left"'
+ MATLAB_STYLE='width="700px" rules=none'
+@@ -52,7 +52,7 @@
+ rm report.html
+ cat << END >> report.html
+ <div align="center">
+-<table $H1_STYLE><tr><td $H1_FONT>ISSM Nightly run report</td></tr></table>
++<table $TITLE_STYLE><tr><td $TITLE_FONT>ISSM Nightly run report</td></tr></table>
+ 
+ <table $TABLE_STYLE>
+ <tr> 
+@@ -77,7 +77,7 @@
+ if [ $IS_INSTALL -eq 0 ]; then
+ 	cat << END >> report.html
+ 	<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+-	<tr><td $BODY_FONTC>status: <span style=\"color:#ff0000\">Installation failed<\/span></td></tr>
++	<tr><td $BODY_FONTC>Status: <span style=\"color:#ff0000\">Installation failed<\/span></td></tr>
+ 	</table>
+ 	<table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table>
+ 	</div>
+@@ -99,12 +99,12 @@
+ #}}}
+ #write report {{{
+ cat << END >> report.html
+-<table $H2_STYLE><tr><td $H2_FONT>Matlab tests</td></tr></table>
++<table $SECTION_STYLE><tr><td $SECTION_FONT>Matlab tests</td></tr></table>
+ <table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+ $(if [ $CRASH_MATLAB -eq 0 ]; then
+-echo "<tr><td $BODY_FONTL>status: <span style=\"color:#008000\">all test desks have been run</span></td></tr>"
++echo "<tr><td $BODY_FONTL>Status: <span style=\"color:#008000\">all test desks have been run</span></td></tr>"
+ else
+-	echo "<tr><td $BODY_FONTL>status: <span style=\"color:#ff0000\">Matlab crashed</span></td></tr>"
++	echo "<tr><td $BODY_FONTL>Status: <span style=\"color:#ff0000\">Matlab crashed</span></td></tr>"
+ fi)
+ <tr><td $BODY_FONTL>Total execution time: $EL_MATLAB</td></tr>
+ <tr><td $BODY_FONTL>Number of successes: $NUM_MATLAB_SUC/$NUM_MATLAB_TOT</td></tr>
+@@ -128,12 +128,12 @@
+ #}}}
+ #write report {{{
+ cat << END >> report.html
+-<table $H2_STYLE><tr><td $H2_FONT>Python tests</td></tr></table>
++<table $SECTION_STYLE><tr><td $SECTION_FONT>Python tests</td></tr></table>
+ <table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+ $(if [ $CRASH_PYTHON -eq 0 ]; then
+-	echo "<tr><td $BODY_FONTL>status: <span style=\"color:#008000\">all test desks have been run</span></td></tr>"
++	echo "<tr><td $BODY_FONTL>Status: <span style=\"color:#008000\">all test desks have been run</span></td></tr>"
+ else
+-	echo "<tr><td $BODY_FONTL>status: <span style=\"color:#ff0000\">Python crashed</span></td></tr>"
++	echo "<tr><td $BODY_FONTL>Status: <span style=\"color:#ff0000\">Python crashed</span></td></tr>"
+ fi)
+ <tr><td $BODY_FONTL>Total execution time: $EL_PYTHON</td></tr>
+ <tr><td $BODY_FONTL>Number of successes: $NUM_PYTHON_SUC/$NUM_PYTHON_TOT</td></tr>
+@@ -151,7 +151,7 @@
+ if [ $IS_INSTALL -eq 1 ] && [ $NUM_MATLAB_TOT -gt 1 ] && [ $NUM_MATLAB_SUC -ne $NUM_MATLAB_TOT ]
+ then
+ 	cat << END >> report.html
+-<table $H2_STYLE><tr><td $(echo $H2_FONT)>List of Matlab tests</td></tr></table>
++<table $SECTION_STYLE><tr><td $(echo $SECTION_FONT)>List of Matlab tests</td></tr></table>
+ <table $BODY_STYLE style="border-collapse:collapse;">
+ <tr> 
+ <th $BODY_FONT>Result</th> 
+@@ -204,7 +204,7 @@
+ if [ $IS_INSTALL -eq 1 ] && [ $NUM_PYTHON_TOT -gt 1 ] && [ $NUM_PYTHON_SUC -ne $NUM_PYTHON_TOT ]
+ then
+ 	cat << END >> report.html
+-	<table $(echo $H2_STYLE)><tr><td $(echo $H2_FONT)>List of Python tests</td></tr></table>
++	<table $(echo $SECTION_STYLE)><tr><td $(echo $SECTION_FONT)>List of Python tests</td></tr></table>
+ 	<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+ 	<tr> 
+ 	<th $BODY_FONT>Result</th> 
+@@ -216,8 +216,6 @@
+ 	$(cat matlab_short.log | while read line
+ do
+ 	echo "<tr>"
+-
+-	#get status
+ 	STATUS=`echo $line | awk '{print $1}'`
+ 
+ 	#FAILURE
+@@ -262,7 +260,7 @@
+ if [ $IS_MATLAB -eq 1 ] && [ -s matlaberror.log ]; then
+ #Matlab {{{
+ cat << END >> report.html
+-<table $H2_STYLE><tr><td $H2_FONT>Matlab errors</td></tr></table>
++<table $SECTION_STYLE><tr><td $SECTION_FONT>Matlab errors</td></tr></table>
+ <table $MATLAB_STYLE><tr><td $MATLAB_FONT>
+ <pre style="
+ white-space: -moz-pre-wrap;
+@@ -278,7 +276,7 @@
+ if [ -s petscerror.log ]; then
+ 	#PETSc{{{
+ cat << END >> report.html
+-<table $H2_STYLE><tr><td $H2_FONT>PETSc errors</td></tr></table>
++<table $SECTION_STYLE><tr><td $SECTION_FONT>PETSc errors</td></tr></table>
+ <table $MATLAB_STYLE><tr><td $MATLAB_FONT>
+ <pre style="
+ white-space: -moz-pre-wrap;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13218-13219.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13218-13219.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13218-13219.diff	(revision 13394)
@@ -0,0 +1,84 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13218)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13219)
+@@ -1150,6 +1150,21 @@
+ 	dnl }}}
+ 
+ 	dnl Capabilities
++	dnl with-kml{{{
++	AC_ARG_WITH([kml],
++		AS_HELP_STRING([--with-kml = YES],[compile with kml capabilities (default is yes)]),
++		[KML=$withval],[KML=yes]) 
++	AC_MSG_CHECKING(for kml capability compilation)
++
++	if test "x$KML" = "xyes"; then
++		HAVE_KML=yes
++		AC_DEFINE([_HAVE_KML_],[1],[with kml capability])
++	else
++		HAVE_KML=no
++	fi
++	AM_CONDITIONAL([KML], [test x$HAVE_KML = xyes])
++	AC_MSG_RESULT($HAVE_KML)
++	dnl }}}
+ 	dnl with-kriging{{{
+ 	AC_ARG_WITH([kriging],
+ 		AS_HELP_STRING([--with-kriging = YES],[compile with kriging capabilities (default is yes)]),
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13218)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13219)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @ADOLCINCL@
+ 
+ EXEEXT=$(MATLABWRAPPEREXT)
+ 
+@@ -12,7 +12,6 @@
+ 				   ContourToNodes.la\
+ 				   ElementConnectivity.la\
+ 				   EnumToString.la\
+-				   Exp2Kml.la\
+ 				   HoleFiller.la\
+ 				   InternalFront.la\
+ 				   InterpFromGridToMesh.la\
+@@ -20,18 +19,12 @@
+ 				   InterpFromMeshToMesh3d.la\
+ 				   InterpFromMeshToGrid.la\
+ 				   InterpFromMesh2d.la\
+-				   KMLFileRead.la\
+-				   KMLMeshWrite.la\
+-				   KMLOverlay.la\
+-				   Kml2Exp.la\
+-				   Kriging.la\
+ 				   Ll2xy.la\
+ 				   NodeConnectivity.la\
+ 				   MeshPartition.la\
+ 				   MeshProfileIntersection.la\
+ 				   PointCloudFindNeighbors.la\
+ 				   PropagateFlagsFromConnectivity.la\
+-				   Shp2Kml.la\
+ 				   StringToEnum.la\
+ 				   TriaSearch.la\
+ 				   TriMesh.la\
+@@ -39,7 +32,20 @@
+ 				   Scotch.la\
+ 				   Xy2ll.la\
+                    Chaco.la
++
++if KRIGING
++lib_LTLIBRARIES +=  Kriging.la
++endif
++if KML
++lib_LTLIBRARIES +=  KMLFileRead.la\
++				   KMLMeshWrite.la\
++				   KMLOverlay.la\
++				   Shp2Kml.la\
++				   Exp2Kml.la\
++				   Kml2Exp.la
++endif
+ endif 
++
+ #}}}
+ #Flags and libraries {{{1
+ if SHAREDLIBS
Index: /issm/oecreview/Archive/12678-13393/ISSM-13219-13220.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13219-13220.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13219-13220.diff	(revision 13394)
@@ -0,0 +1,2033 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 13220)
+@@ -1,153 +0,0 @@
+-/*!\file:  DomainOutlineRead.cpp
+- * \brief DomainOutlineRead.c: read the vertex coordinates defined in a domain 
+- * outline from Argus (.exp file). The first contour in the file is for 
+- * the outside domain outline. The following contours represent holes in
+- * the domain.
+- */
+-
+-#include <stdio.h>
+-#include <cstring> 
+-#include "../Alloc/alloc.h"
+-#include "../../include/include.h"
+-#include "../../classes/classes.h"
+-#include "../Exceptions/exceptions.h"
+-#include "../../Container/DataSet.h"
+-
+-int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname){
+-	
+-	/*indexing: */
+-	int i,counter;
+-
+-	/*I/O: */
+-	FILE   *fid = NULL;
+-	char    chardummy[256];
+-	double  ddummy;
+-
+-	/*output: */
+-	int      nprof;                //number of profiles in the domainname file
+-	int     *profnvertices = NULL; //array holding the number of vertices for the nprof profiles
+-	double **pprofx        = NULL; //array of profiles x coordinates
+-	double **pprofy        = NULL; //array of profiles y coordinates
+-	bool    *closed        = NULL; //array holding closed flags for the nprof profiles
+-
+-	/*For each profile: */
+-	int     n;
+-	double *x  = NULL;
+-	double *y  = NULL;
+-	bool    cl;
+-
+-	/*open domain outline file for reading: */
+-	if ((fid=fopen(domainname,"r"))==NULL){
+-		_error_("could not find domain file " << domainname); 
+-	}
+-
+-	/*Do a first pass through the domainname file, to figure out how many profiles 
+-	 *we need to read: */
+-	nprof=1;
+-	for(;;){
+-		fscanf(fid,"%256s %256s\n",chardummy,chardummy);
+-		fscanf(fid,"%256s %256s\n",chardummy,chardummy);
+-		fscanf(fid,"%256s %256s %256s %256s\n",chardummy,chardummy,chardummy,chardummy);
+-		fscanf(fid,"%20u %256s\n",&n,chardummy);
+-		fscanf(fid,"%256s %256s %256s %256s %256s\n",chardummy,chardummy,chardummy,chardummy,chardummy);
+-		for (i=0;i<n;i++){
+-			fscanf(fid,"%20lf %20lf\n",&ddummy,&ddummy);
+-		}
+-		/*Ok, we have faked one profile reading, check whether we are at the end of the file, otherwise, keep fake reading next profile:*/
+-		if (feof(fid)){
+-			break;
+-		}
+-		nprof++;
+-	}
+-	
+-	/*Allocate and initialize all the profiles: */
+-	profnvertices=xNew<int>(nprof);
+-	pprofx=xNew<double*>(nprof);
+-	pprofy=xNew<double*>(nprof);
+-	for (i=0;i<nprof;i++){
+-		pprofx[i]=NULL;
+-		pprofy[i]=NULL;
+-	}
+-	closed=xNew<bool>(nprof);
+-
+-	/*Reaset file pointer to beginning of file: */
+-	fseek(fid,0,SEEK_SET);
+-
+-	/*Start reading profiles: */
+-	for(counter=0;counter<nprof;counter++){
+-
+-		/*Skip header: */
+-		fscanf(fid,"%256s %256s\n",chardummy,chardummy);
+-		fscanf(fid,"%256s %256s\n",chardummy,chardummy);
+-		fscanf(fid,"%256s %256s %256s %256s\n",chardummy,chardummy,chardummy,chardummy);
+-		
+-		/*Get number of profile vertices: */
+-		fscanf(fid,"%20u %256s\n",&n,chardummy);
+-	
+-		/*Skip next line: */
+-		fscanf(fid,"%256s %256s %256s %256s %256s\n",chardummy,chardummy,chardummy,chardummy,chardummy);
+-
+-		/*Allocate vertices: */
+-		x=xNew<double>(n);
+-		y=xNew<double>(n);
+-		
+-		/*Read vertices: */
+-		for (i=0;i<n;i++){
+-			fscanf(fid,"%20lf %20lf\n",&x[i],&y[i]);
+-		}
+-
+-		/*Now check that we are dealing with open contours: */
+-		cl=false;
+-		if((x[0]==x[n-1]) && (y[0]==y[n-1])){
+-			cl=true;
+-		}
+-
+-		/*Assign pointers: */
+-		profnvertices[counter]=n;
+-		pprofx[counter]=x;
+-		pprofy[counter]=y;
+-		closed[counter]=cl;
+-	}
+-
+-	/*close domain outline file: */
+-	fclose(fid);
+-
+-	/*Assign output pointers: */
+-	*pnprof=nprof;
+-	*pprofnvertices=profnvertices;
+-	*ppprofx=pprofx;
+-	*ppprofy=pprofy;
+-	if(pclosed)
+-	 *pclosed=closed;
+-	else
+-	 xDelete<bool>(closed);
+-}
+-
+-DataSet* DomainOutlineRead(char* domainname){
+-
+-	/*intermediary: */
+-	int       nprof;
+-	int      *profnvertices = NULL;
+-	double  **pprofx        = NULL;
+-	double  **pprofy        = NULL;
+-	Contour  *contour       = NULL;
+-
+-	/*output: */
+-	DataSet* domain=NULL;
+-
+-	/*If domainname is an empty string, return empty dataset*/
+-	if (strcmp(domainname,"")==0){
+-		nprof=0;
+-	}
+-	else{
+-		DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname);
+-	}
+-
+-	/*now create dataset of contours: */
+-	domain=new DataSet(0);
+-
+-	for(int i=0;i<nprof;i++){
+-		domain->AddObject(new Contour(i,profnvertices[i],pprofx[i],pprofy[i],1));
+-	}
+-	return domain;
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13220)
+@@ -6,17 +6,244 @@
+ #ifndef _EXP_H_
+ #define _EXP_H_
+ 
+-#include "../../classes/objects/objects.h"
+-#include "../../toolkits/toolkits.h"
++#include "../../classes/objects/Contour.h"
++#include "../../shared/Numerics/recast.h"
++#include "../../Container/Container.h"
+ 
+-int IsInPoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
+-int IsOutsidePoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
+ int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
+ int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname);
+ int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
+ 
+-int      DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname);
+-DataSet* DomainOutlineRead(char* domainname);
+ 
++/*IsInPoly {{{*/
++template <class doubletype>
++int IsInPoly(Vector<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
+ 
++	int i;
++	double x0,y0;
++	doubletype value;
++	double xmin=xc[0];
++	double xmax=xc[0];
++	double ymin=yc[0];
++	double ymax=yc[0];
++
++	/*Get extrema*/
++	for (i=1;i<numvertices;i++){
++		if(xc[i]<xmin) xmin=xc[i];
++		if(xc[i]>xmax) xmax=xc[i];
++		if(yc[i]<ymin) ymin=yc[i];
++		if(yc[i]>ymax) ymax=yc[i];
++	}
++
++	/*Go through all vertices of the mesh:*/
++	for (i=i0;i<i1;i++){
++
++		//Get current value of value[i] -> do not change it if != 0
++		in->GetValue(&value,i);
++		if (reCast<bool,doubletype>(value)){
++			/*this vertex already is inside one of the contours, continue*/
++			continue;
++		}
++
++		/*pick up vertex (x[i],y[i]) and figure out if located inside contour (xc,yc)*/
++		x0=x[i]; y0=y[i];
++		if(x0<xmin || x0>xmax || y0<ymin || y0>ymax){
++			value=0;
++		}
++		else{
++			value=pnpoly(numvertices,xc,yc,x0,y0,edgevalue);
++		}
++		in->SetValue(i,value,INS_VAL);
++	}
++	 return 1;
++}/*}}}*/
++/*IsOutsidePoly {{{*/
++template <class doubletype>
++int IsOutsidePoly(Vector<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
++
++	int i,j;
++	double x0,y0;
++	doubletype value;
++	double xmin=xc[0];
++	double xmax=xc[0];
++	double ymin=yc[0];
++	double ymax=yc[0];
++
++	/*Get extrema*/
++	for (i=1;i<numvertices;i++){
++		if(xc[i]<xmin) xmin=xc[i];
++		if(xc[i]>xmax) xmax=xc[i];
++		if(yc[i]<ymin) ymin=yc[i];
++		if(yc[i]>ymax) ymax=yc[i];
++	}
++
++	/*Go through all vertices of the mesh:*/
++	for (i=i0;i<i1;i++){
++
++		//Get current value of value[i] -> do not change it if != 0
++		in->GetValue(&value,i);
++		if (reCast<bool,doubletype>(value)){
++			/*this vertex already is inside one of the contours, continue*/
++			continue;
++		}
++
++		/*pick up vertex (x[i],y[i]) and figure out if located inside contour (xc,yc)*/
++		x0=x[i]; y0=y[i];
++		if(x0<xmin || x0>xmax || y0<ymin || y0>ymax){
++			value=1;
++		}
++		else{
++			value=1-pnpoly(numvertices,xc,yc,x0,y0,edgevalue);
++		}
++		in->SetValue(i,value,INS_VAL);
++	}
++	return 1;
++}/*}}}*/
++/*DomainOutlineRead{{{*/
++template <class doubletype>
++int DomainOutlineRead(int* pnprof,int** pprofnvertices,doubletype*** ppprofx,doubletype*** ppprofy,bool** pclosed,char* domainname){
++	
++	/*indexing: */
++	int i,counter;
++
++	/*I/O: */
++	FILE   *fid = NULL;
++	char    chardummy[256];
++	double  ddummy;
++
++	/*output: */
++	int      nprof;                //number of profiles in the domainname file
++	int     *profnvertices = NULL; //array holding the number of vertices for the nprof profiles
++	doubletype **pprofx        = NULL; //array of profiles x coordinates
++	doubletype **pprofy        = NULL; //array of profiles y coordinates
++	bool    *closed        = NULL; //array holding closed flags for the nprof profiles
++
++	/*For each profile: */
++	int     n;
++	doubletype *x  = NULL;
++	doubletype *y  = NULL;
++	double  xi,yi;
++	bool    cl;
++
++	/*open domain outline file for reading: */
++	if ((fid=fopen(domainname,"r"))==NULL){
++		_error_("could not find domain file " << domainname); 
++	}
++
++	/*Do a first pass through the domainname file, to figure out how many profiles 
++	 *we need to read: */
++	nprof=1;
++	for(;;){
++		fscanf(fid,"%256s %256s\n",chardummy,chardummy);
++		fscanf(fid,"%256s %256s\n",chardummy,chardummy);
++		fscanf(fid,"%256s %256s %256s %256s\n",chardummy,chardummy,chardummy,chardummy);
++		fscanf(fid,"%20u %256s\n",&n,chardummy);
++		fscanf(fid,"%256s %256s %256s %256s %256s\n",chardummy,chardummy,chardummy,chardummy,chardummy);
++		for (i=0;i<n;i++){
++			fscanf(fid,"%20lf %20lf\n",&ddummy,&ddummy);
++		}
++		/*Ok, we have faked one profile reading, check whether we are at the end of the file, otherwise, keep fake reading next profile:*/
++		if (feof(fid)){
++			break;
++		}
++		nprof++;
++	}
++	
++	/*Allocate and initialize all the profiles: */
++	profnvertices=xNew<int>(nprof);
++	pprofx=xNew<doubletype*>(nprof);
++	pprofy=xNew<doubletype*>(nprof);
++	for (i=0;i<nprof;i++){
++		pprofx[i]=NULL;
++		pprofy[i]=NULL;
++	}
++	closed=xNew<bool>(nprof);
++
++	/*Reaset file pointer to beginning of file: */
++	fseek(fid,0,SEEK_SET);
++
++	/*Start reading profiles: */
++	for(counter=0;counter<nprof;counter++){
++
++		/*Skip header: */
++		fscanf(fid,"%256s %256s\n",chardummy,chardummy);
++		fscanf(fid,"%256s %256s\n",chardummy,chardummy);
++		fscanf(fid,"%256s %256s %256s %256s\n",chardummy,chardummy,chardummy,chardummy);
++		
++		/*Get number of profile vertices: */
++		fscanf(fid,"%20u %256s\n",&n,chardummy);
++	
++		/*Skip next line: */
++		fscanf(fid,"%256s %256s %256s %256s %256s\n",chardummy,chardummy,chardummy,chardummy,chardummy);
++
++		/*Allocate vertices: */
++		x=xNew<doubletype>(n);
++		y=xNew<doubletype>(n);
++		
++		/*Read vertices: */
++		for (i=0;i<n;i++){
++			fscanf(fid,"%20lf %20lf\n",&xi,&yi);
++			x[i]=xi; y[i]=yi;
++		}
++
++		/*Now check that we are dealing with open contours: */
++		cl=false;
++		if((x[0]==x[n-1]) && (y[0]==y[n-1])){
++			cl=true;
++		}
++
++		/*Assign pointers: */
++		profnvertices[counter]=n;
++		pprofx[counter]=x;
++		pprofy[counter]=y;
++		closed[counter]=cl;
++	}
++
++	/*close domain outline file: */
++	fclose(fid);
++
++	/*Assign output pointers: */
++	*pnprof=nprof;
++	*pprofnvertices=profnvertices;
++	*ppprofx=pprofx;
++	*ppprofy=pprofy;
++	if(pclosed)
++	 *pclosed=closed;
++	else
++	 xDelete<bool>(closed);
++} /*}}}*/
++/*DataSet* DomainOutlineRead(char* domainname){{{*/
++template <class doubletype>
++DataSet* DomainOutlineRead(char* domainname){
++
++	/*intermediary: */
++	int       nprof;
++	int      *profnvertices = NULL;
++	doubletype  **pprofx        = NULL;
++	doubletype  **pprofy        = NULL;
++	Contour<doubletype>* contour       = NULL;
++
++	/*output: */
++	DataSet* domain=NULL;
++
++	/*If domainname is an empty string, return empty dataset*/
++	if (strcmp(domainname,"")==0){
++		nprof=0;
++	}
++	else{
++		DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname);
++	}
++
++	/*now create dataset of contours: */
++	domain=new DataSet(0);
++
++	for(int i=0;i<nprof;i++){
++		domain->AddObject(new Contour<doubletype>(i,profnvertices[i],pprofx[i],pprofy[i],1));
++	}
++	return domain;
++} /*}}}*/
++
++
++
++
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/IsInPoly.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/IsInPoly.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/IsInPoly.cpp	(revision 13220)
+@@ -13,88 +13,6 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-/*IsInPoly {{{*/
+-int IsInPoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
+-
+-	int i;
+-	double x0,y0;
+-	double value;
+-	double xmin=xc[0];
+-	double xmax=xc[0];
+-	double ymin=yc[0];
+-	double ymax=yc[0];
+-
+-	/*Get extrema*/
+-	for (i=1;i<numvertices;i++){
+-		if(xc[i]<xmin) xmin=xc[i];
+-		if(xc[i]>xmax) xmax=xc[i];
+-		if(yc[i]<ymin) ymin=yc[i];
+-		if(yc[i]>ymax) ymax=yc[i];
+-	}
+-
+-	/*Go through all vertices of the mesh:*/
+-	for (i=i0;i<i1;i++){
+-
+-		//Get current value of value[i] -> do not change it if != 0
+-		in->GetValue(&value,i);
+-		if (value){
+-			/*this vertex already is inside one of the contours, continue*/
+-			continue;
+-		}
+-
+-		/*pick up vertex (x[i],y[i]) and figure out if located inside contour (xc,yc)*/
+-		x0=x[i]; y0=y[i];
+-		if(x0<xmin || x0>xmax || y0<ymin || y0>ymax){
+-			value=0;
+-		}
+-		else{
+-			value=pnpoly(numvertices,xc,yc,x0,y0,edgevalue);
+-		}
+-		in->SetValue(i,value,INS_VAL);
+-	}
+-	 return 1;
+-}/*}}}*/
+-/*IsOutsidePoly {{{*/
+-int IsOutsidePoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
+-
+-	int i,j;
+-	double x0,y0;
+-	double value;
+-	double xmin=xc[0];
+-	double xmax=xc[0];
+-	double ymin=yc[0];
+-	double ymax=yc[0];
+-
+-	/*Get extrema*/
+-	for (i=1;i<numvertices;i++){
+-		if(xc[i]<xmin) xmin=xc[i];
+-		if(xc[i]>xmax) xmax=xc[i];
+-		if(yc[i]<ymin) ymin=yc[i];
+-		if(yc[i]>ymax) ymax=yc[i];
+-	}
+-
+-	/*Go through all vertices of the mesh:*/
+-	for (i=i0;i<i1;i++){
+-
+-		//Get current value of value[i] -> do not change it if != 0
+-		in->GetValue(&value,i);
+-		if (value){
+-			/*this vertex already is inside one of the contours, continue*/
+-			continue;
+-		}
+-
+-		/*pick up vertex (x[i],y[i]) and figure out if located inside contour (xc,yc)*/
+-		x0=x[i]; y0=y[i];
+-		if(x0<xmin || x0>xmax || y0<ymin || y0>ymax){
+-			value=1;
+-		}
+-		else{
+-			value=1-pnpoly(numvertices,xc,yc,x0,y0,edgevalue);
+-		}
+-		in->SetValue(i,value,INS_VAL);
+-	}
+-	return 1;
+-}/*}}}*/
+ /*pnpoly{{{*/
+ int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue) {
+ 	int i, j, c = 0;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13220)
+@@ -9,11 +9,11 @@
+ #include "../../classes/objects/objects.h"
+ #include "../modules.h"
+ 
+-int InterpFromMesh2dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
+-		double* default_values,int num_default_values,Contour** contours,int numcontours){
++int InterpFromMesh2dx( Vector<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
++		double* default_values,int num_default_values,Contour<IssmPDouble>** contours,int numcontours){
+ 	
+ 	/*Output*/
+-	Vector<IssmDouble>* data_prime=NULL;
++	Vector<IssmPDouble>* data_prime=NULL;
+ 
+ 	/*Intermediary*/
+ 	int i,j;
+@@ -26,7 +26,7 @@
+ 	double ymin,ymax;
+ 
+ 	/*contours: */
+-	Vector<IssmDouble>*    vec_incontour=NULL;
++	Vector<IssmPDouble>*    vec_incontour=NULL;
+ 	double*    incontour=NULL;
+ 
+ 	/*threading: */
+@@ -70,7 +70,7 @@
+ 	}
+ 
+ 	/*Initialize output*/
+-	data_prime=new Vector<IssmDouble>(nods_prime,false,SeqVecType);
++	data_prime=new Vector<IssmPDouble>(nods_prime,false,SeqVecType);
+ 	if(num_default_values){
+ 		if(num_default_values==1)for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[0],INS_VAL);
+ 		else for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[i],INS_VAL);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp	(revision 13220)
+@@ -31,7 +31,7 @@
+ 	double  ymin               = gate->ymin;
+ 	double  ymax               = gate->ymax;
+ 	int     nods_prime         = gate->nods_prime;
+-	Vector<IssmDouble>* data_prime         = gate->data_prime;
++	Vector<IssmPDouble>* data_prime         = gate->data_prime;
+ 	double *x_prime            = gate->x_prime;
+ 	double *y_prime            = gate->y_prime;
+ 	double *default_values     = gate->default_values;
+@@ -86,7 +86,7 @@
+ 						/*element interpolation*/
+ 						data_value=data[i];
+ 					}
+-					if (xIsNan<IssmDouble>(data_value)){
++					if (xIsNan<IssmPDouble>(data_value)){
+ 						if(num_default_values==1) data_value=default_values[0];
+ 						else data_value=default_values[j];
+ 					}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h	(revision 13220)
+@@ -22,7 +22,7 @@
+ 	double xmin,xmax;
+ 	double ymin,ymax;
+ 	int    nods_prime;
+-	Vector<IssmDouble>*    data_prime;
++	Vector<IssmPDouble>*    data_prime;
+ 	double* x_prime;
+ 	double* y_prime;
+ 	double* default_values;
+@@ -32,8 +32,8 @@
+ 
+ } InterpFromMesh2dxThreadStruct;
+ 
+-int InterpFromMesh2dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
+-		double* default_values,int num_default_values,Contour** contours,int numcontours);
++int InterpFromMesh2dx( Vector<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
++		double* default_values,int num_default_values,Contour<IssmPDouble>** contours,int numcontours);
+ 
+ void* InterpFromMesh2dxt(void* vInterpFromMesh2dxThreadStruct);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h	(revision 13220)
+@@ -10,7 +10,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void MeshProfileIntersectionx( double** psegments, int* pnumseg, int* index, double* x, double* y, int nel, int nods,  Contour** contours,int numcontours);
++void MeshProfileIntersectionx( double** psegments, int* pnumseg, int* index, double* x, double* y, int nel, int nods,  Contour<IssmPDouble>** contours,int numcontours);
+ void MeshSegmentsIntersection(double** psegments, int* pnumsegs,int* index, double* x, double* y, int nel, int nods, double* xc, double* yc, int numnodes);
+ void ElementSegmentsIntersection(DataSet* segments_dataset,int el, double* xnodes,double* ynodes,double* xc,double* yc,int numnodes);
+ void ElementSegment(DataSet* segments_dataset,int el,double* xnodes,double* ynodes,double* xsegment,double* ysegment);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshSegmentsIntersection.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshSegmentsIntersection.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshSegmentsIntersection.cpp	(revision 13220)
+@@ -9,7 +9,7 @@
+ 
+ 	/*output: */
+ 	double*  segments=NULL;
+-	Segment* segment=NULL;
++	Segment<double>* segment=NULL;
+ 	int     numsegs;
+ 	
+ 	/*intermediary: */
+@@ -33,7 +33,7 @@
+ 	numsegs=segments_dataset->Size();
+ 	segments=xNew<double>(5*numsegs);
+ 	for(i=0;i<numsegs;i++){
+-		Segment* segment=(Segment*)segments_dataset->GetObjectByOffset(i);
++		Segment<double>* segment=(Segment<double>*)segments_dataset->GetObjectByOffset(i);
+ 		
+ 		/*x1,y1,x2,y2 then element_id: */
+ 		*(segments+5*i+0)=segment->x1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp	(revision 13220)
+@@ -54,7 +54,7 @@
+ 			yfinal[0]=ysegment[0]+coord1*(ysegment[1]-ysegment[0]);
+ 			yfinal[1]=ysegment[0]+coord2*(ysegment[1]-ysegment[0]);
+ 
+-			segments_dataset->AddObject(new  Segment(el+1,xfinal[0],yfinal[0],xfinal[1],yfinal[1]));
++			segments_dataset->AddObject(new  Segment<double>(el+1,xfinal[0],yfinal[0],xfinal[1],yfinal[1]));
+ 		}
+ 		else{
+ 			/*the segment intersected at the vertex, do not bother with this "0" length segment!:*/
+@@ -82,12 +82,12 @@
+ 		yfinal[0]=ysegment[0]+coord1*(ysegment[1]-ysegment[0]);
+ 		yfinal[1]=ysegment[0]+coord2*(ysegment[1]-ysegment[0]);
+ 
+-		segments_dataset->AddObject(new  Segment(el+1,xfinal[0],yfinal[0],xfinal[1],yfinal[1]));
++		segments_dataset->AddObject(new  Segment<double>(el+1,xfinal[0],yfinal[0],xfinal[1],yfinal[1]));
+ 	}
+ 	else{
+ 		/*No interesections, but the segment might be entirely inside this triangle!: */
+ 		if ( (NodeInElement(xnodes,ynodes,xsegment[0],ysegment[0])) && (NodeInElement(xnodes,ynodes,xsegment[1],ysegment[1])) ){
+-			segments_dataset->AddObject(new  Segment(el+1,xsegment[0],ysegment[0],xsegment[1],ysegment[1]));
++			segments_dataset->AddObject(new  Segment<double>(el+1,xsegment[0],ysegment[0],xsegment[1],ysegment[1]));
+ 		}
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp	(revision 13220)
+@@ -3,13 +3,13 @@
+ 
+ #include "./MeshProfileIntersectionx.h"
+ 
+-void MeshProfileIntersectionx( double** psegments, int* pnumsegs, int* index, double* x, double* y, int nel, int nods,  Contour** contours,int numcontours){
++void MeshProfileIntersectionx( double** psegments, int* pnumsegs, int* index, double* x, double* y, int nel, int nods,  Contour<IssmPDouble>** contours,int numcontours){
+ 
+ 	int i,j,k;
+ 	int m,n;
+ 
+ 	/*Contour:*/
+-	Contour* contouri=NULL;
++	Contour<IssmPDouble>* contouri=NULL;
+ 	int      numnodes;
+ 	double*  xc=NULL;
+ 	double*  yc=NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h	(revision 13220)
+@@ -10,8 +10,8 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
+-int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
++int ContourToNodesx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue);
++int ContourToNodesx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
+ 
+ #endif /* _CONTOURTONODESX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp	(revision 13220)
+@@ -3,22 +3,22 @@
+ 
+ #include "./ContourToNodesx.h"
+ 
+-int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){
++int ContourToNodesx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){
+ 
+ 	int i;
+ 	int m,n;
+ 
+ 	/*Contour:*/
+-	Contour* contouri=NULL;
++	Contour<IssmPDouble>* contouri=NULL;
+ 	int      numnodes;
+ 	double*  xc=NULL;
+ 	double*  yc=NULL;
+ 	double   value;
+ 
+ 	/*output: */
+-	Vector<IssmDouble>* flags=NULL;
++	Vector<IssmPDouble>* flags=NULL;
+ 
+-	flags=new Vector<IssmDouble>(nods);
++	flags=new Vector<IssmPDouble>(nods);
+ 
+ 	/*Loop through all contours: */
+ 	for (i=0;i<numcontours;i++){
+@@ -38,27 +38,27 @@
+ 	return 1;
+ }
+ 
+-int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
++int ContourToNodesx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
+ 
+ 	int i;
+ 	int m,n;
+ 
+ 	/*Contour:*/
+-	Contour* contouri=NULL;
++	Contour<IssmPDouble>* contouri=NULL;
+ 	int      numnodes;
+ 	double*  xc=NULL;
+ 	double*  yc=NULL;
+ 	double   value;
+ 
+ 	/*output: */
+-	Vector<IssmDouble>* flags=NULL;
++	Vector<IssmPDouble>* flags=NULL;
+ 
+-	flags=new Vector<IssmDouble>(nods);
++	flags=new Vector<IssmPDouble>(nods);
+ 
+ 	/*Loop through all contours: */
+ 	if(contours){
+ 		for (i=0;i<contours->Size();i++){
+-			Contour* contour=(Contour*)contours->GetObjectByOffset(i);
++			Contour<IssmPDouble>* contour=(Contour<IssmPDouble>*)contours->GetObjectByOffset(i);
+ 			IsInPoly(flags,contour->x,contour->y,contour->nods,x,y,0,nods,edgevalue);
+ 		}
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 13220)
+@@ -1,115 +0,0 @@
+-/*!\file:  MeshPartition.cpp
+- * \brief partition elements and nodes across a cluster of size numprocs. 
+- */
+-
+-#include "./MeshPartitionx.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-#include "../../toolkits/toolkits.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-
+-int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberofnodes,IssmDouble* elements,
+-		int numberofelements2d,int numberofnodes2d,IssmDouble* elements2d,int numlayers,int elements_width, int dim,int num_procs){
+-
+-	int noerr=1;
+-	int i,j;
+-
+-	/*Metis partitioning: */
+-	int* epart=NULL;
+-	int* npart=NULL;
+-	int* index=NULL;
+-
+-	int* epart2d=NULL;
+-	int* npart2d=NULL;
+-	int* index2d=NULL;
+-	int  count=0;
+-
+-	int  etype=1; //tria mesh see metis/Programs/Io.c
+-	int  etype2d=1; //tria mesh see metis/Programs/Io.c
+-	int  numflag=0;
+-	int  edgecut=1;
+-
+-	if(dim==2){
+-		epart=xNew<int>(numberofelements);
+-		npart=xNew<int>(numberofnodes);
+-		index=xNew<int>(elements_width*numberofelements);
+-		for (i=0;i<numberofelements;i++){
+-			for (j=0;j<elements_width;j++){
+-				*(index+elements_width*i+j)=reCast<int>(*(elements+elements_width*i+j))-1; //-1 for C indexing in Metis
+-			}
+-		}
+-
+-		/*Partition using Metis:*/
+-		if (num_procs>1){
+-			#ifdef _HAVE_METIS_
+-			METIS_PartMeshNodalPatch(&numberofelements,&numberofnodes, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
+-			#endif
+-		}
+-		else if (num_procs==1){
+-			/*METIS does not know how to deal with one cpu only!*/
+-			for (i=0;i<numberofelements;i++) epart[i]=0;
+-			for (i=0;i<numberofnodes;i++)    npart[i]=0;
+-		}
+-		else _error_("At least one processor is required");
+-	}
+-	else{
+-		/*We have a 3d mesh, made of a regularly extruded 2d mesh. We first partition the 2d mesh, then we extrude the partition: */
+-
+-		/*First build concatenated 2d mesh  from 2d_coll and 2d_noncoll: */
+-		epart2d=xNew<int>(numberofelements2d);
+-		npart2d=xNew<int>(numberofnodes2d); 
+-		index2d=xNew<int>(3*numberofelements2d);
+-
+-		for (i=0;i<numberofelements2d;i++){
+-			for (j=0;j<3;j++){
+-				*(index2d+3*i+j)=reCast<int>(*(elements2d+3*i+j))-1; //-1 for C indexing in Metis
+-			}
+-		}
+-
+-		/*Partition using Metis:*/
+-		if (num_procs>1){
+-			#ifdef _HAVE_METIS_
+-			METIS_PartMeshNodalPatch(&numberofelements2d,&numberofnodes2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
+-			#endif
+-		}
+-		else if (num_procs==1){
+-			/*METIS does not know how to deal with one cpu only!*/
+-			for (i=0;i<numberofelements2d;i++) epart2d[i]=0;
+-			for (i=0;i<numberofnodes2d;i++)    npart2d[i]=0;
+-		}
+-		else _error_("At least one processor is required");
+-
+-		/*Extrude epart2d to epart, using numlayers: */
+-		epart=xNew<int>(numberofelements);
+-		
+-		count=0;
+-		for(i=0;i<(numlayers-1);i++){
+-			for(j=0;j<numberofelements2d;j++){
+-				epart[count]=epart2d[j];
+-				count++;
+-			}
+-		}
+-
+-		/*Extrude npart2d to npart, using numlayers: */
+-		npart=xNew<int>(numberofnodes);
+-		
+-		count=0;
+-		for(i=0;i<(numlayers);i++){
+-			for(j=0;j<numberofnodes2d;j++){
+-				npart[count]=npart2d[j];
+-				count++;
+-			}
+-		}
+-	}
+-	
+-	/*Assign output pointer:*/
+-	*pepart=epart;
+-	*pnpart=npart;
+-
+-	/*Free ressources: */
+-	xDelete<int>(index);
+-	xDelete<int>(epart2d);
+-	xDelete<int>(npart2d);
+-	xDelete<int>(index2d);
+-	return noerr;
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 13220)
+@@ -6,10 +6,115 @@
+ #define _MESHPARTITIONX_H
+ 
+ #include "../../include/include.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
+ 
++
+ /* local prototypes: */
+-int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberofnodes,IssmDouble* elements,
+-		int numberofelements2d,int numberofnodes2d,IssmDouble* elements2d,int numlayers,int elements_width, int dim,int numareas);
++template <class doubletype> 
++int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberofnodes,doubletype* elements,
++		int numberofelements2d,int numberofnodes2d,doubletype* elements2d,int numlayers,int elements_width, int dim,int num_procs){
++
++	int noerr=1;
++	int i,j;
++
++	/*Metis partitioning: */
++	int* epart=NULL;
++	int* npart=NULL;
++	int* index=NULL;
++
++	int* epart2d=NULL;
++	int* npart2d=NULL;
++	int* index2d=NULL;
++	int  count=0;
++
++	int  etype=1; //tria mesh see metis/Programs/Io.c
++	int  etype2d=1; //tria mesh see metis/Programs/Io.c
++	int  numflag=0;
++	int  edgecut=1;
++
++	if(dim==2){
++		epart=xNew<int>(numberofelements);
++		npart=xNew<int>(numberofnodes);
++		index=xNew<int>(elements_width*numberofelements);
++		for (i=0;i<numberofelements;i++){
++			for (j=0;j<elements_width;j++){
++				*(index+elements_width*i+j)=reCast<int>(*(elements+elements_width*i+j))-1; //-1 for C indexing in Metis
++			}
++		}
++
++		/*Partition using Metis:*/
++		if (num_procs>1){
++			#ifdef _HAVE_METIS_
++			METIS_PartMeshNodalPatch(&numberofelements,&numberofnodes, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
++			#endif
++		}
++		else if (num_procs==1){
++			/*METIS does not know how to deal with one cpu only!*/
++			for (i=0;i<numberofelements;i++) epart[i]=0;
++			for (i=0;i<numberofnodes;i++)    npart[i]=0;
++		}
++		else _error_("At least one processor is required");
++	}
++	else{
++		/*We have a 3d mesh, made of a regularly extruded 2d mesh. We first partition the 2d mesh, then we extrude the partition: */
++
++		/*First build concatenated 2d mesh  from 2d_coll and 2d_noncoll: */
++		epart2d=xNew<int>(numberofelements2d);
++		npart2d=xNew<int>(numberofnodes2d); 
++		index2d=xNew<int>(3*numberofelements2d);
++
++		for (i=0;i<numberofelements2d;i++){
++			for (j=0;j<3;j++){
++				*(index2d+3*i+j)=reCast<int>(*(elements2d+3*i+j))-1; //-1 for C indexing in Metis
++			}
++		}
++
++		/*Partition using Metis:*/
++		if (num_procs>1){
++			#ifdef _HAVE_METIS_
++			METIS_PartMeshNodalPatch(&numberofelements2d,&numberofnodes2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
++			#endif
++		}
++		else if (num_procs==1){
++			/*METIS does not know how to deal with one cpu only!*/
++			for (i=0;i<numberofelements2d;i++) epart2d[i]=0;
++			for (i=0;i<numberofnodes2d;i++)    npart2d[i]=0;
++		}
++		else _error_("At least one processor is required");
++
++		/*Extrude epart2d to epart, using numlayers: */
++		epart=xNew<int>(numberofelements);
++		
++		count=0;
++		for(i=0;i<(numlayers-1);i++){
++			for(j=0;j<numberofelements2d;j++){
++				epart[count]=epart2d[j];
++				count++;
++			}
++		}
++
++		/*Extrude npart2d to npart, using numlayers: */
++		npart=xNew<int>(numberofnodes);
++		
++		count=0;
++		for(i=0;i<(numlayers);i++){
++			for(j=0;j<numberofnodes2d;j++){
++				npart[count]=npart2d[j];
++				count++;
++			}
++		}
++	}
+ 	
++	/*Assign output pointer:*/
++	*pepart=epart;
++	*pnpart=npart;
++
++	/*Free ressources: */
++	xDelete<int>(index);
++	xDelete<int>(epart2d);
++	xDelete<int>(npart2d);
++	xDelete<int>(index2d);
++	return noerr;
++}	
+ #endif /* _MESHPARTITIONX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp	(revision 13220)
+@@ -14,7 +14,7 @@
+ 	int i;
+ 	int configuration_type;
+ 	int ssize;
+-	double* yg_serial=NULL;
++	IssmDouble* yg_serial=NULL;
+ 
+ 	/*first figure out ssize: */
+ 	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+@@ -50,7 +50,7 @@
+ 	}
+ 
+ 	/*Free ressources:*/
+-	xDelete<double>(yg_serial);
++	xDelete<IssmDouble>(yg_serial);
+ 
+ 	/*Assign output pointers:*/
+ 	*pys=ys;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp	(revision 13220)
+@@ -8,11 +8,11 @@
+ #include "../../io/io.h"
+ #include "../../classes/objects/objects.h"
+ 		
+-void AddExternalResultx( DataSet* results, int enumtype, double value){
++void AddExternalResultx( DataSet* results, int enumtype, IssmDouble value){
+ 	/* Add new result in into results*/
+ 	results->AddObject(new DoubleExternalResult(results->Size()+1,enumtype,value,1,0));
+ }
+-void AddExternalResultx( DataSet* results, int enumtype, double* value, int nraws){
++void AddExternalResultx( DataSet* results, int enumtype, IssmDouble* value, int nraws){
+ 	/* Add new result in into results*/
+ 	results->AddObject(new DoubleVecExternalResult(results->Size()+1,enumtype,value,nraws,1,0));
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.h	(revision 13220)
+@@ -8,7 +8,7 @@
+ #include "../../Container/Container.h"
+ 
+ /* local prototypes: */
+-void AddExternalResultx(DataSet* results, int type, double value);
+-void AddExternalResultx(DataSet* results, int type, double* value, int nraws);
++void AddExternalResultx(DataSet* results, int type, IssmDouble value);
++void AddExternalResultx(DataSet* results, int type, IssmDouble* value, int nraws);
+ 
+ #endif  /* _ADDEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13220)
+@@ -6,10 +6,10 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ 
+-int InterpFromMeshToMesh3dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value) {
++int InterpFromMeshToMesh3dx( Vector<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value) {
+ 
+ 	/*Output*/
+-	Vector<IssmDouble>* data_prime=NULL;
++	Vector<IssmPDouble>* data_prime=NULL;
+ 
+ 	/*Intermediary*/
+ 	int i,j;
+@@ -53,7 +53,7 @@
+ 	}
+ 
+ 	/*Initialize output*/
+-	data_prime=new Vector<IssmDouble>(nods_prime);
++	data_prime=new Vector<IssmPDouble>(nods_prime);
+ 	for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_value,INS_VAL);
+ 
+ 	/*Loop over the elements*/
+@@ -123,7 +123,7 @@
+ 						/*element interpolation*/
+ 						data_value=data[i];
+ 					}
+-					if (xIsNan<IssmDouble>(data_value)) data_value=default_value;
++					if (xIsNan<IssmPDouble>(data_value)) data_value=default_value;
+ 
+ 					/*insert value and go to the next point*/
+ 					data_prime->SetValue(j,data_value,INS_VAL);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h	(revision 13220)
+@@ -8,7 +8,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../classes/objects/objects.h"
+ 
+-int InterpFromMeshToMesh3dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
++int InterpFromMeshToMesh3dx( Vector<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
+ 
+ #endif /* _INTERPFROMMESHTOMESH3DX_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13220)
+@@ -16,10 +16,10 @@
+ /*}}}*/
+ 
+ /*InterpFromGridToMeshx{{{*/
+-int InterpFromGridToMeshx( Vector<IssmDouble>** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
++int InterpFromGridToMeshx( Vector<IssmPDouble>** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
+ 
+ 	/*output: */
+-	Vector<IssmDouble>* data_mesh=NULL;
++	Vector<IssmPDouble>* data_mesh=NULL;
+ 	
+ 	/*Intermediary*/
+ 	double* x=NULL;
+@@ -46,7 +46,7 @@
+ 	}
+ 
+ 	/*Allocate output vector: */
+-	data_mesh=new Vector<IssmDouble>(nods);
++	data_mesh=new Vector<IssmPDouble>(nods);
+ 
+ 	/*Find out what kind of coordinates (x_in,y_in) have been given is input*/
+ 	if(N==(x_rows-1) && M==(y_rows-1)){
+@@ -126,7 +126,7 @@
+ 	double *x             = gate->x;
+ 	double *y             = gate->y;
+ 	int     nods          = gate->nods;
+-	Vector<IssmDouble>*data_mesh     = gate->data_mesh;
++	Vector<IssmPDouble>*data_mesh     = gate->data_mesh;
+ 	double *data          = gate->data;
+ 	double  default_value = gate->default_value;
+ 	int     interpenum    = gate->interp;
+@@ -180,7 +180,7 @@
+ 					_printLine_("Interpolation " << EnumToStringx(interpenum) << " not supported yet");
+ 					return NULL; /*WARNING: no error because it would blow up the multithreading!*/
+ 			}
+-			if(xIsNan<IssmDouble>(data_value)) data_value=default_value;
++			if(xIsNan<IssmPDouble>(data_value)) data_value=default_value;
+ 		}
+ 		else{
+ 			data_value=default_value;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h	(revision 13220)
+@@ -23,10 +23,10 @@
+ 	int     nods;
+ 	double* x_mesh;
+ 	double* y_mesh;
+-	Vector<IssmDouble>*     data_mesh;
++	Vector<IssmPDouble>*     data_mesh;
+ } InterpFromGridToMeshxThreadStruct;
+ 
+-int    InterpFromGridToMeshx( Vector<IssmDouble>** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
++int    InterpFromGridToMeshx( Vector<IssmPDouble>** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
+ void*  InterpFromGridToMeshxt(void* vInterpFromGridToMeshxThreadStruct);
+ bool   findindices(int* pn,int* pm,double* x,int x_rows, double* y,int y_rows, double xgrid,double ygrid);
+ double triangleinterp(double x1,double x2,double y1,double y2,double Q11,double Q12,double Q21,double Q22,double x,double y);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp	(revision 13220)
+@@ -10,7 +10,7 @@
+ 
+ #include "./ContourToMeshx.h"
+ 
+-int ContourToMeshx( Vector<IssmDouble>** pin_nod,Vector<IssmDouble>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
++int ContourToMeshx( Vector<double>** pin_nod,Vector<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
+ 
+ 	int noerr=1;
+ 	int i;
+@@ -29,11 +29,11 @@
+ 
+ 
+ 	/*output: */
+-	Vector<IssmDouble>* in_nod=NULL;
+-	Vector<IssmDouble>* in_elem=NULL;
++	Vector<double>* in_nod=NULL;
++	Vector<double>* in_elem=NULL;
+ 
+-	in_nod=new Vector<IssmDouble>(nods);
+-	in_elem=new Vector<IssmDouble>(nel);
++	in_nod=new Vector<double>(nods);
++	in_elem=new Vector<double>(nel);
+ 
+ 	/*initialize thread parameters: */
+ 	gate.contours=contours;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp	(revision 13220)
+@@ -32,7 +32,7 @@
+ 	int edgevalue;
+ 	double* x=NULL;
+ 	double* y=NULL;
+-	Vector<IssmDouble>* in_nod=NULL;
++	Vector<double>* in_nod=NULL;
+ 
+ 
+ 	/*recover handle and gate: */
+@@ -54,7 +54,7 @@
+ 
+ 	/*Loop through all contours: */
+ 	for (i=0;i<contours->Size();i++){
+-		Contour* contour=(Contour*)contours->GetObjectByOffset(i);
++		Contour<double>* contour=(Contour<double>*)contours->GetObjectByOffset(i);
+ 		IsInPoly(in_nod,contour->x,contour->y,contour->nods,x,y,i0,i1,edgevalue);
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h	(revision 13220)
+@@ -15,7 +15,7 @@
+ 	DataSet* contours;
+ 	int nods;
+ 	int edgevalue;
+-	Vector<IssmDouble>* in_nod;
++	Vector<double>* in_nod;
+ 	double* x;
+ 	double* y;
+ 
+@@ -23,7 +23,7 @@
+ 
+ 
+ /* local prototypes: */
+-int ContourToMeshx( Vector<IssmDouble>** pin_nods,Vector<IssmDouble>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
++int ContourToMeshx( Vector<double>** pin_nods,Vector<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
+ 
+ void* ContourToMeshxt(void* vContourToMeshxThreadStruct);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 13220)
+@@ -19,23 +19,23 @@
+ #endif
+ /*}}}*/
+ 
+-void TriMeshx(Matrix<IssmDouble>** pindex,Vector<IssmDouble>** px,Vector<IssmDouble>** py,Matrix<IssmDouble>** psegments,Vector<IssmDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
++void TriMeshx(Matrix<IssmPDouble>** pindex,Vector<IssmPDouble>** px,Vector<IssmPDouble>** py,Matrix<IssmPDouble>** psegments,Vector<IssmPDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
+ 
+ 	/*indexing: */
+ 	int i,j;
+ 
+ 	/*output: */
+-	double* index=NULL;
+-	Matrix<IssmDouble>* index_matrix=NULL;
++	IssmPDouble* index=NULL;
++	Matrix<IssmPDouble>* index_matrix=NULL;
+ 	double* x=NULL;
+ 	double* y=NULL;
+ 	double* segments=NULL;
+-	Matrix<IssmDouble>* segments_matrix=NULL;
++	Matrix<IssmPDouble>* segments_matrix=NULL;
+ 	double* segmentmarkerlist=NULL;
+ 
+ 	/*intermediary: */
+ 	int      counter,counter2,backcounter;
+-	Contour* contour=NULL;
++	Contour<IssmPDouble>* contour=NULL;
+ 
+ 	/* Triangle structures needed to call Triangle library routines: */
+ 	struct triangulateio in,out;
+@@ -44,11 +44,11 @@
+ 	/*Create initial triangulation to call triangulate(). First number of points:*/
+ 	in.numberofpoints=0;
+ 	for (i=0;i<domain->Size();i++){
+-		contour=(Contour*)domain->GetObjectByOffset(i);
++		contour=(Contour<IssmPDouble>*)domain->GetObjectByOffset(i);
+ 		in.numberofpoints+=contour->nods-1;
+ 	}
+ 	for (i=0;i<rifts->Size();i++){
+-		contour=(Contour*)rifts->GetObjectByOffset(i);
++		contour=(Contour<IssmPDouble>*)rifts->GetObjectByOffset(i);
+ 		in.numberofpoints+=contour->nods;
+ 	}
+ 
+@@ -60,7 +60,7 @@
+ 
+ 	counter=0;
+ 	for (i=0;i<domain->Size();i++){
+-		contour=(Contour*)domain->GetObjectByOffset(i);
++		contour=(Contour<IssmPDouble>*)domain->GetObjectByOffset(i);
+ 		for (j=0;j<contour->nods-1;j++){
+ 			in.pointlist[2*counter+0]=contour->x[j];
+ 			in.pointlist[2*counter+1]=contour->y[j];
+@@ -68,7 +68,7 @@
+ 		}
+ 	}
+ 	for (i=0;i<rifts->Size();i++){
+-		contour=(Contour*)rifts->GetObjectByOffset(i);
++		contour=(Contour<IssmPDouble>*)rifts->GetObjectByOffset(i);
+ 		for (j=0;j<contour->nods;j++){
+ 			in.pointlist[2*counter+0]=contour->x[j];
+ 			in.pointlist[2*counter+1]=contour->y[j];
+@@ -87,11 +87,11 @@
+ 	/*Build segments. First figure out number of segments: holes and closed outlines have as many segments as vertices: */
+ 	in.numberofsegments=0;
+ 	for (i=0;i<domain->Size();i++){
+-		contour=(Contour*)domain->GetObjectByOffset(i);
++		contour=(Contour<IssmPDouble>*)domain->GetObjectByOffset(i);
+ 		in.numberofsegments+=contour->nods-1;
+ 	}
+ 	for(i=0;i<rifts->Size();i++){
+-		contour=(Contour*)rifts->GetObjectByOffset(i);
++		contour=(Contour<IssmPDouble>*)rifts->GetObjectByOffset(i);
+ 		/*for rifts, we have one less segment as we have vertices*/
+ 		in.numberofsegments+=contour->nods-1;
+ 	}
+@@ -101,7 +101,7 @@
+ 	counter=0;
+ 	backcounter=0;
+ 	for (i=0;i<domain->Size();i++){
+-		contour=(Contour*)domain->GetObjectByOffset(i);
++		contour=(Contour<IssmPDouble>*)domain->GetObjectByOffset(i);
+ 		for (j=0;j<contour->nods-2;j++){
+ 			in.segmentlist[2*counter+0]=counter;
+ 			in.segmentlist[2*counter+1]=counter+1;
+@@ -117,7 +117,7 @@
+ 	}
+ 	counter2=counter;
+ 	for (i=0;i<rifts->Size();i++){
+-		contour=(Contour*)rifts->GetObjectByOffset(i);
++		contour=(Contour<IssmPDouble>*)rifts->GetObjectByOffset(i);
+ 		for (j=0;j<(contour->nods-1);j++){
+ 			in.segmentlist[2*counter2+0]=counter;
+ 			in.segmentlist[2*counter2+1]=counter+1;
+@@ -136,7 +136,7 @@
+ 	if(in.numberofholes){
+ 		in.holelist = xNew<REAL>(in.numberofholes*2);
+ 		for (i=0;i<domain->Size()-1;i++){
+-			contour=(Contour*)domain->GetObjectByOffset(i+1);
++			contour=(Contour<IssmPDouble>*)domain->GetObjectByOffset(i+1);
+ 			GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],contour->nods-1,contour->x,contour->y);
+ 		}
+ 	}
+@@ -191,13 +191,13 @@
+ 	OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
+ 
+ 	/*Output : */
+-	index_matrix=new Matrix<IssmDouble>(index,out.numberoftriangles,3,1,SeqMatType);
++	index_matrix=new Matrix<IssmPDouble>(index,out.numberoftriangles,3,1.0,SeqMatType);
+ 	*pindex=index_matrix;
+ 	
+-	segments_matrix=new Matrix<IssmDouble>(segments,out.numberofsegments,3,1,SeqMatType);
++	segments_matrix=new Matrix<IssmPDouble>(segments,out.numberofsegments,3,1.0,SeqMatType);
+ 	*psegments=segments_matrix;
+ 
+-	*px=new Vector<IssmDouble>(x,out.numberofpoints,SeqMatType);
+-	*py=new Vector<IssmDouble>(y,out.numberofpoints,SeqMatType);
+-	*psegmentmarkerlist=new Vector<IssmDouble>(segmentmarkerlist,out.numberofsegments,SeqMatType);
++	*px=new Vector<IssmPDouble>(x,out.numberofpoints,SeqMatType);
++	*py=new Vector<IssmPDouble>(y,out.numberofpoints,SeqMatType);
++	*psegmentmarkerlist=new Vector<IssmPDouble>(segmentmarkerlist,out.numberofsegments,SeqMatType);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h	(revision 13220)
+@@ -10,6 +10,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void TriMeshx(Matrix<IssmDouble>** pindex,Vector<IssmDouble>** px,Vector<IssmDouble>** py,Matrix<IssmDouble>** psegments,Vector<IssmDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
++void TriMeshx(Matrix<IssmPDouble>** pindex,Vector<IssmPDouble>** px,Vector<IssmPDouble>** py,Matrix<IssmPDouble>** psegments,Vector<IssmPDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
+ 
+ #endif  /* _TRIMESHX_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp	(revision 13220)
+@@ -16,7 +16,7 @@
+ 	double* y;
+ 	int     nods;
+ 	double  mindistance;
+-	Vector<IssmDouble>*     flags;
++	Vector<IssmPDouble>*     flags;
+ 
+ 	/*recover handle and gate: */
+ 	handle=(pthread_handle*)vpthread_handle;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h	(revision 13220)
+@@ -10,7 +10,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-int PointCloudFindNeighborsx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread);
++int PointCloudFindNeighborsx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread);
+ 
+ /*threading: */
+ typedef struct{
+@@ -19,7 +19,7 @@
+ 	double* y;
+ 	int nods;
+ 	double mindistance;
+-	Vector<IssmDouble>* flags;
++	Vector<IssmPDouble>* flags;
+ 
+ 
+ } PointCloudFindNeighborsThreadStruct;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp	(revision 13220)
+@@ -3,11 +3,11 @@
+ 
+ #include "./PointCloudFindNeighborsx.h"
+ 
+-int PointCloudFindNeighborsx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread){
++int PointCloudFindNeighborsx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread){
+ 
+ 	/*output: */
+-	Vector<IssmDouble>* flags=NULL;
+-	flags=new Vector<IssmDouble>(nods);
++	Vector<IssmPDouble>* flags=NULL;
++	flags=new Vector<IssmPDouble>(nods);
+ 
+ 	/*threading: */
+ 	PointCloudFindNeighborsThreadStruct gate;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13220)
+@@ -45,7 +45,6 @@
+ 					./classes/objects/Material.h\
+ 					./classes/objects/Load.h\
+ 					./classes/objects/Contour.h\
+-					./classes/objects/Contour.cpp\
+ 					./classes/objects/OptArgs.h\
+ 					./classes/objects/OptPars.h\
+ 					./classes/objects/Loads/Friction.h\
+@@ -61,7 +60,6 @@
+ 					./classes/objects/Node.h\
+ 					./classes/objects/Node.cpp\
+ 					./classes/objects/Segment.h\
+-					./classes/objects/Segment.cpp\
+ 					./classes/objects/Vertex.h\
+ 					./classes/objects/Vertex.cpp\
+ 					./classes/Hook.h\
+@@ -310,7 +308,6 @@
+ 					./modules/SmbGradientsx/SmbGradientsx.cpp\
+ 					./modules/UpdateConstraintsx/UpdateConstraintsx.h\
+ 					./modules/UpdateConstraintsx/UpdateConstraintsx.cpp\
+-					./modules/MeshPartitionx/MeshPartitionx.cpp\
+ 					./modules/MeshPartitionx/MeshPartitionx.h\
+ 					./modules/Reducevectorgtofx/Reducevectorgtofx.cpp\
+ 					./modules/Reducevectorgtofx/Reducevectorgtofx.h\
+@@ -843,7 +840,6 @@
+ 			./shared/Exp/exp.h\
+ 			./shared/Exp/IsInPoly.cpp\
+ 			./shared/Exp/IsInPolySerial.cpp\
+-			./shared/Exp/DomainOutlineRead.cpp\
+ 			./shared/Exp/DomainOutlineWrite.cpp\
+ 			./shared/TriMesh/trimesh.h\
+ 			./shared/TriMesh/AssociateSegmentToElement.cpp\
+@@ -1013,8 +1009,12 @@
+ if MODULES
+ libISSMModules_a_SOURCES = $(module_sources)
+ libISSMModules_a_SOURCES += $(bamg_sources)
++if KRIGING
+ libISSMModules_a_SOURCES += $(kriging_sources)
++endif
++if KML
+ libISSMModules_a_SOURCES += $(kml_sources)
++endif
+ libISSMModules_a_CXXFLAGS = $(ALLCXXFLAGS)
+ libISSMModules_a_LIBADD = ./libISSMCore.a
+ if SHAREDLIBS
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.cpp	(revision 13220)
+@@ -1,86 +0,0 @@
+-/*!\file Segment.c
+- * \brief: implementation of the Segment object
+- */
+-
+-/*Include files: {{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "./objects.h"
+-#include "../../Container/Container.h"
+-#include "../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../shared/shared.h"
+-#include "../../include/include.h"
+-/*}}}*/
+-
+-/*Segment constructors and destructors:*/
+-/*FUNCTION Segment::Segment() default constructor {{{*/
+-Segment::Segment(){
+-	this->eid=UNDEF;
+-	this->x1=UNDEF;
+-	this->y1=UNDEF;
+-	this->x2=UNDEF;
+-	this->y2=UNDEF;
+-}
+-/*}}}*/
+-/*FUNCTION Segment::Segment(int eid, IssmDouble x1,IssmDouble y1,IssmDouble x2, IssmDouble y2){{{*/
+-Segment::Segment(int segment_eid, IssmDouble segment_x1,IssmDouble segment_y1,IssmDouble segment_x2, IssmDouble segment_y2){
+-
+-	this->eid=segment_eid;
+-	this->x1=segment_x1;
+-	this->y1=segment_y1;
+-	this->x2=segment_x2;
+-	this->y2=segment_y2;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Segment::~Segment(){{{*/
+-Segment::~Segment(){
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION Segment::Echo{{{*/
+-void Segment::Echo(void){
+-
+-	_printLine_("Segment:");
+-	_printLine_("   eid: " << eid);
+-	_printLine_("   node 1: " << this->x1 << "|" << this->y1);
+-	_printLine_("   node 2: " << this->x2 << "|" << this->y2);
+-
+-}
+-/*}}}*/
+-/*FUNCTION Segment::DeepEcho{{{*/
+-void Segment::DeepEcho(void){
+-	this->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION Segment::Id{{{*/
+-int    Segment::Id(void){ return eid; }
+-/*}}}*/
+-/*FUNCTION Segment::MyRank{{{*/
+-int    Segment::MyRank(void){ 
+-	extern int my_rank;
+-
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Segment::ObjectEnum{{{*/
+-int Segment::ObjectEnum(void){
+-
+-	return SegmentEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Segment::copy {{{*/
+-Object* Segment::copy() {
+-	return new Segment(this->eid,this->x1,this->y1,this->x2,this->y2);
+-
+-}
+-
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.cpp	(revision 13220)
+@@ -1,95 +0,0 @@
+-/*! \file Contour.c
+- *  \sa Contour.h
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <string.h>
+-#include "./objects.h"
+-#include "../../include/include.h"
+-#include "../../io/io.h"
+-
+-/*Contour constructors and destructors:*/
+-/*FUNCTION Contour::Contour() default constructor {{{*/
+-Contour::Contour(){
+-	this->id=0;
+-	this->nods=0;
+-	this->x=NULL;
+-	this->y=NULL;
+-	this->closed=false;
+-}
+-/*}}}*/
+-/*FUNCTION Contour::Contour(int pid, int nods, IssmDouble* x, IssmDouble* y,bool closed) {{{*/
+-Contour::Contour(int pid,int pnods, IssmDouble* px, IssmDouble* py,bool pclosed){
+-	
+-	this->id=pid;
+-	this->nods=pnods;
+-	this->closed=pclosed;
+-	if(nods){
+-		this->x=xNew<IssmDouble>(nods);
+-		xMemCpy<IssmDouble>(this->x,px,nods);
+-		this->y=xNew<IssmDouble>(nods);
+-		xMemCpy<IssmDouble>(this->y,py,nods);
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Contour::Contour() default constructor {{{*/
+-Contour::~Contour(){
+-	xDelete<IssmDouble>(this->x);
+-	xDelete<IssmDouble>(this->y);
+-}
+-/*}}}*/
+-
+-
+-/*Object virtual function resolutoin: */
+-/*FUNCTION Contour::Echo(){{{*/
+-void Contour::Echo(void){
+-
+-	int i;
+-
+-	_printLine_("Contour: " << id);
+-	_printLine_("   nods: " << nods);
+-	_printLine_("   closed: " << (closed?"true":"false"));
+-	if(nods){
+-	        _printLine_("   x,y:");
+-		for(i=0;i<nods;i++){
+-		        _printLine_(i << ": " << x[i] << "|" << y[i]);
+-		}
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION Contour::DeepEcho(){{{*/
+-void Contour::DeepEcho(void){
+-	this->Echo();
+-}
+-/*}}}*/
+-/*FUNCTION Contour::Id(){{{*/
+-int Contour::Id(void){
+-	return id;
+-}
+-/*}}}*/
+-/*FUNCTION Contour::MyRank{{{*/
+-int    Contour::MyRank(void){ 
+-	extern int my_rank;
+-
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION Contour::ObjectEnum{{{*/
+-int Contour::ObjectEnum(void){
+-
+-	return ContourEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION Contour::copy {{{*/
+-Object* Contour::copy() {
+-
+-	return new Contour(*this); 
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Contour.h	(revision 13220)
+@@ -7,37 +7,106 @@
+ 
+ /*Headers:*/
+ /*{{{*/
++#include "../../include/include.h"
++#include "../../shared/Exceptions/exceptions.h"
++#include "../../shared/Alloc/xNewDelete.h"
++#include "../../shared/MemOps/xMemCpy.h"
++#include "../../io/io.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
+ #include "./Object.h"
+-#include "../../shared/Exceptions/exceptions.h"
+-#include "../../toolkits/toolkits.h"
+-#include "../../include/include.h"
+ /*}}}*/
+ 
++template <class doubletype>
+ class Contour: public Object{
+ 
+ 	public: 
+ 
+ 		int     id;
+ 		int	  nods;  //number of vertices in the contour
+-		IssmDouble* x;
+-		IssmDouble* y;
++		doubletype* x;
++		doubletype* y;
+ 		bool    closed; //is this contour closed?
+ 
+-		/*Contour constructors, destructors {{{*/
+-		Contour();
+-		Contour(int id, int nods, IssmDouble* x, IssmDouble* y,bool closed);
+-		~Contour();
++		/*Contour constructors, destructors :*/
++		/*FUNCTION Contour() default constructor {{{*/
++		Contour(){
++			this->id=0;
++			this->nods=0;
++			this->x=NULL;
++			this->y=NULL;
++			this->closed=false;
++		}
+ 		/*}}}*/
+-		/*Object virtual functions{{{*/
+-		void  Echo(void);
+-		void  DeepEcho(void);
+-		int   Id(void);
+-		int   MyRank(void);
+-		int   ObjectEnum(void);
+-		Object* copy(void);
++		/*FUNCTION Contour(int pid, int nods, doubletype* x, doubletype* y,bool closed) {{{*/
++		Contour(int pid,int pnods, doubletype* px, doubletype* py,bool pclosed){
++
++			this->id=pid;
++			this->nods=pnods;
++			this->closed=pclosed;
++			if(nods){
++				this->x=xNew<doubletype>(nods);
++				xMemCpy<doubletype>(this->x,px,nods);
++				this->y=xNew<doubletype>(nods);
++				xMemCpy<doubletype>(this->y,py,nods);
++			}
++		}
+ 		/*}}}*/
++		/*FUNCTION Contour() default constructor {{{*/
++		~Contour(){
++			xDelete<doubletype>(this->x);
++			xDelete<doubletype>(this->y);
++		}
++		/*}}}*/
+ 
+ 
++		/*Object virtual function resolutoin: */
++		/*FUNCTION Echo(){{{*/
++		void Echo(void){
++
++			int i;
++
++			_printLine_("Contour: " << id);
++			_printLine_("   nods: " << nods);
++			_printLine_("   closed: " << (closed?"true":"false"));
++			if(nods){
++				_printLine_("   x,y:");
++				for(i=0;i<nods;i++){
++					_printLine_(i << ": " << x[i] << "|" << y[i]);
++				}
++			}
++		}
++		/*}}}*/
++		/*FUNCTION DeepEcho(){{{*/
++		void DeepEcho(void){
++			this->Echo();
++		}
++		/*}}}*/
++		/*FUNCTION Id(){{{*/
++		int Id(void){
++			return id;
++		}
++		/*}}}*/
++		/*FUNCTION MyRank{{{*/
++		int    MyRank(void){ 
++			extern int my_rank;
++
++			return my_rank; 
++		}
++		/*}}}*/
++		/*FUNCTION ObjectEnum{{{*/
++		int ObjectEnum(void){
++
++			return ContourEnum;
++
++		}
++		/*}}}*/
++		/*FUNCTION copy {{{*/
++		Object* copy() {
++
++			return new Contour(*this); 
++
++		}
++		/*}}}*/
+ };
+ 
+ #endif  /* _CONTOUR_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Segment.h	(revision 13220)
+@@ -10,28 +10,84 @@
+ #include "./Object.h"
+ /*}}}*/
+ 
++template <class doubletype> 
+ class Segment: public Object{
+ 
+ 	public:
+ 		int eid;
+-		IssmDouble x1;
+-		IssmDouble y1;
+-		IssmDouble x2;
+-		IssmDouble y2;
++		doubletype x1;
++		doubletype y1;
++		doubletype x2;
++		doubletype y2;
+ 
+-		/*Segment constructors, destructors {{{*/
+-		Segment();
+-		Segment(int eid,IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2);
+-		~Segment();
++
++		/*Segment constructors, destructors :*/
++		/*FUNCTION Segment() default constructor {{{*/
++		Segment(){
++			this->eid=UNDEF;
++			this->x1=UNDEF;
++			this->y1=UNDEF;
++			this->x2=UNDEF;
++			this->y2=UNDEF;
++		}
+ 		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
++		/*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){
++
++			this->eid=segment_eid;
++			this->x1=segment_x1;
++			this->y1=segment_y1;
++			this->x2=segment_x2;
++			this->y2=segment_y2;
++
++		}
+ 		/*}}}*/
++		/*FUNCTION ~Segment(){{{*/
++		~Segment(){
++		}
++		/*}}}*/
++
++		/*Object virtual functions definitions:*/
++		/*FUNCTION Echo{{{*/
++		void Echo(void){
++
++			_printLine_("Segment:");
++			_printLine_("   eid: " << eid);
++			_printLine_("   node 1: " << this->x1 << "|" << this->y1);
++			_printLine_("   node 2: " << this->x2 << "|" << this->y2);
++
++		}
++		/*}}}*/
++		/*FUNCTION DeepEcho{{{*/
++		void DeepEcho(void){
++			this->Echo();
++		}
++		/*}}}*/
++		/*FUNCTION Id{{{*/
++		int    Id(void){ return eid; }
++		/*}}}*/
++		/*FUNCTION MyRank{{{*/
++		int    MyRank(void){ 
++			extern int my_rank;
++
++			return my_rank; 
++		}
++		/*}}}*/
++		/*FUNCTION ObjectEnum{{{*/
++		int ObjectEnum(void){
++
++			return SegmentEnum;
++
++		}
++		/*}}}*/
++		/*FUNCTION copy {{{*/
++		Object* copy() {
++			return new Segment(this->eid,this->x1,this->y1,this->x2,this->y2);
++
++		}
++
++		/*}}}*/
++
+ };
+ 
+ #endif  /* _SEGMENT_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 13220)
+@@ -77,9 +77,9 @@
+ 		/*}}}*/
+ 		/*FUNCTION Matrix(int M,int N,IssmDouble sparsity,int in_type){{{*/
+ 		#ifdef _HAVE_PETSC_
+-		Matrix(int M,int N,IssmDouble sparsity,int in_type=PetscMatType){
++		Matrix(int M,int N,double sparsity,int in_type=PetscMatType){
+ 		#else
+-		Matrix(int M,int N,IssmDouble sparsity,int in_type=SeqMatType){
++		Matrix(int M,int N,double sparsity,int in_type=SeqMatType){
+ 		#endif
+ 
+ 			#ifdef _HAVE_PETSC_
+@@ -104,9 +104,9 @@
+ 		/*}}}*/
+ 		/*FUNCTION Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int in_type){{{*/
+ 		#ifdef _HAVE_PETSC_
+-		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int in_type=PetscMatType){
++		Matrix(IssmPDouble* serial_mat,int M,int N,IssmPDouble sparsity,int in_type=PetscMatType){
+ 		#else
+-		Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int in_type=SeqMatType){
++		Matrix(IssmPDouble* serial_mat,int M,int N,IssmPDouble sparsity,int in_type=SeqMatType){
+ 		#endif
+ 
+ 			#ifdef _HAVE_PETSC_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13220)
+@@ -40,8 +40,8 @@
+ 	//contours
+ 	mxArray*  matlabstructure=NULL;
+ 	int numcontours;
+-	Contour** contours=NULL;
+-	Contour*  contouri=NULL;
++	Contour<double>** contours=NULL;
++	Contour<double>*  contouri=NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+@@ -67,10 +67,10 @@
+ 	}
+ 
+ 	numcontours=mxGetNumberOfElements(matlabstructure);
+-	contours=xNew<Contour*>(numcontours);
++	contours=xNew<Contour<double>*>(numcontours);
+ 	for(i=0;i<numcontours;i++){
+ 		//allocate
+-		contouri=xNew<Contour>(1);
++		contouri=xNew<Contour<double> >(1);
+ 		//retrieve dimension of this contour.
+ 		contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods"));
+ 		//set pointers.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp	(revision 13220)
+@@ -33,9 +33,9 @@
+ 	
+ 	//contours
+ 	mxArray*  matlabstructure=NULL;
+-	Contour** contours=NULL;
++	Contour<double>** contours=NULL;
+ 	int       numcontours;
+-	Contour*  contouri=NULL;
++	Contour<double>*  contouri=NULL;
+ 
+ 	/* output: */
+ 	double* segments=NULL;
+@@ -66,10 +66,10 @@
+ 
+ 	//contours
+ 	numcontours=mxGetNumberOfElements(matlabstructure);
+-	contours=xNew<Contour*>(numcontours);
++	contours=xNew<Contour<double>*>(numcontours);
+ 	for(i=0;i<numcontours;i++){
+ 		//allocate
+-		contouri=xNew<Contour>(1);
++		contouri=xNew<Contour<double> >(1);
+ 		//retrieve dimension of this contour.
+ 		contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods"));
+ 		//set pointers.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13220)
+@@ -49,9 +49,9 @@
+ 
+ 	//contours
+ 	mxArray*  matlabstructure=NULL;
+-	Contour** contours=NULL;
++	Contour<double>** contours=NULL;
+ 	int       numcontours;
+-	Contour*  contouri=NULL;
++	Contour<double>*  contouri=NULL;
+ 	int       i;
+ 
+ 	/*Intermediary*/
+@@ -99,10 +99,10 @@
+ 
+ 		/*contours: */
+ 		numcontours=mxGetNumberOfElements(matlabstructure);
+-		contours=xNew<Contour*>(numcontours);
++		contours=xNew<Contour<double> *>(numcontours);
+ 		for(i=0;i<numcontours;i++){
+ 			//allocate
+-			contouri=xNew<Contour>(1);
++			contouri=xNew<Contour<double> >(1);
+ 			//retrieve dimension of this contour.
+ 			contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods"));
+ 			//set pointers.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13220)
+@@ -62,7 +62,7 @@
+ 	FetchData(&y,NULL,NULL,Y);
+ 	FetchData(&edgevalue,EDGEVALUE);
+ 	FetchData(&contourname,CONTOURNAME);
+-	contours=DomainOutlineRead(contourname);
++	contours=DomainOutlineRead<double>(contourname);
+ 
+ 	/*Fetch  interptype: */
+ 	FetchData(&interptype,INTERPTYPE);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 13219)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 13220)
+@@ -34,8 +34,8 @@
+ 	FetchData(&area,AREA);
+ 
+ 	/*Read domain outline: */
+-	domain = DomainOutlineRead(domainname);
+-	rifts  = DomainOutlineRead(riftsname);
++	domain = DomainOutlineRead<double>(domainname);
++	rifts  = DomainOutlineRead<double>(riftsname);
+ 
+ 	/*call x core: */
+ 	TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain,rifts,area);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13220-13221.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13220-13221.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13220-13221.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh	(revision 13220)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-larour-ad.sh	(revision 13221)
+@@ -2,7 +2,10 @@
+ 
+ ./configure \
+ 	--prefix=$ISSM_DIR \
+-	--without-modules \
+ 	--without-kriging  \
++	--without-kml  \
+ 	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
+-	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install
++	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install \
++	--with-matlab-dir=$MATLAB_DIR \
++	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-13221-13222.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13221-13222.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13221-13222.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13221)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13222)
+@@ -697,9 +697,9 @@
+ 		#ifdef _HAVE_MPI_
+ 		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+ 		#endif
+-	        *pmatrix=xNew<IssmDouble>(M*N);
+-	        for (int i=0;i<M*N;++i) (*pmatrix)[i]=matrix[i];
+-	        xDelete<IssmPDouble>(matrix);
++		*pmatrix=xNew<IssmDouble>(M*N);
++		for (int i=0;i<M*N;++i) (*pmatrix)[i]=matrix[i];
++		xDelete<IssmPDouble>(matrix);
+ 	}
+ 	else
+ 	  *pmatrix=NULL;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13222-13223.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13222-13223.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13222-13223.diff	(revision 13394)
@@ -0,0 +1,49 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install-murdo.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install-murdo.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install-murdo.sh	(revision 13223)
+@@ -0,0 +1,38 @@
++#!/bin/bash
++
++#Some cleanup
++rm -rf src
++rm -rf install
++rm -rf gdal-1.6.0
++mkdir src install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/gdal-1.6.0.tar.gz' 'gdal-1.6.0.tar.gz'
++
++#Untar 
++tar -zxvf  gdal-1.6.0.tar.gz
++
++#Move gdal into src directory
++mv gdal-1.6.0/* src
++rm -rf gdal-1.6.0
++
++#Configure gdal
++cd src
++./configure --prefix="$ISSM_DIR/externalpackages/gdal/install" \
++	--without-python \
++	--without-png \
++	--with-netcdf=no \
++	--with-jasper=no \
++	--without-ld-shared \
++	--with-unix-stdio-64=no 
++
++#Patch GDALmake.opt
++patch GDALmake.opt ../GDALmake.opt.patch
++
++#Compile and install gdal
++if [ -z $1 ]; then
++	make
++else
++	make -j $1
++fi
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install-murdo.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13223-13224.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13223-13224.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13223-13224.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh	(revision 13223)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh	(revision 13224)
+@@ -16,6 +16,7 @@
+ 
+ #Configure mpich2
+ cd src
++export -n F90 
+ export CFLAGS="$CFLAGS -fPIC"
+ export FFLAGS="$FFLAGS -fPIC"
+ ./configure \
Index: /issm/oecreview/Archive/12678-13393/ISSM-13224-13225.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13224-13225.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13224-13225.diff	(revision 13394)
@@ -0,0 +1,173 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 13224)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 13225)
+@@ -4,25 +4,23 @@
+ 
+ #include "./TriMeshProcessRifts.h"
+ 
+-void mexFunction(	int nlhs, mxArray* plhs[],
+-					int nrhs, const mxArray* prhs[] ) {
++void mexFunction(	int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[] ){
+ 
+-
+ 	/*Matlab arrays: */
+-	mxArray* pmxa_array=NULL;
+-	mxArray* pmxa_array2=NULL;
+-	mxArray* pmxa_array3=NULL;
++	mxArray *pmxa_array  = NULL;
++	mxArray *pmxa_array2 = NULL;
++	mxArray *pmxa_array3 = NULL;
+ 	int i,j,k,counter;
+ 	
+ 	/* returned quantities: */
+ 	int      out_numrifts;
+-	int*     out_riftsnumsegments=NULL;
+-	double** out_riftssegments=NULL; 
+-	int*     out_riftsnumpairs=NULL;
+-	double** out_riftspairs=NULL;
+-	double*  out_riftstips=NULL;
+-	double** out_riftspenaltypairs=NULL;
+-	int*     out_riftsnumpenaltypairs=NULL;
++	int     *out_riftsnumsegments     = NULL;
++	double **out_riftssegments        = NULL;
++	int     *out_riftsnumpairs        = NULL;
++	double **out_riftspairs           = NULL;
++	double  *out_riftstips            = NULL;
++	double **out_riftspenaltypairs    = NULL;
++	int     *out_riftsnumpenaltypairs = NULL;
+ 
+ 	/*empty rifts structure: */
+ 	double* pNaN=NULL;
+@@ -33,22 +31,21 @@
+ 
+ 	
+ 	/* input: */
+-	double* tindex_in=NULL;
+-	double* index_in=NULL;
++	double *tindex_in = NULL;
++	double *index_in  = NULL;
+ 	int     nel;
+-	double* x_inm=NULL; //matlab vector
+-	double* x_in=NULL; //copy of matlab vector
++	double *x_inm = NULL; //matlab vector
++	double *x_in  = NULL; //copy of matlab vector
+ 	int     nods;
+-	double* y_inm=NULL;//matlab vector
+-	double* y_in=NULL;//copy of matlab vector
+-	double* tsegments_in=NULL;
+-	double* segments_in=NULL;
+-	double* tsegmentmarkers_in=NULL;
+-	double* segmentmarkers_in=NULL;
++	double *y_inm              = NULL; //matlab vector
++	double *y_in               = NULL; //copy of matlab vector
++	double *tsegments_in       = NULL;
++	double *segments_in        = NULL;
++	double *tsegmentmarkers_in = NULL;
++	double *segmentmarkers_in  = NULL;
+ 
+ 	/* state: */
+-	double* state=NULL;
+-
++	double *state = NULL;
+ 	int     num_seg;
+ 
+ 	/*rifts: */
+@@ -56,7 +53,7 @@
+ 	int     numrifts;
+ 
+ 	/* verify correct usage: */
+-	if (nlhs==0 && nrhs==0) {
++	if (nlhs==0 && nrhs==0){
+ 		/* special case: */
+ 		TriMeshProcessRiftsUsage();
+ 		return;
+@@ -168,43 +165,13 @@
+ 
+ 	/*Output : */
+ 	WriteData(&plhs[0],index_in,nel,3);
+-	//pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+-	//mxSetM(pmxa_array,3);
+-	//mxSetN(pmxa_array,nel);
+-	//mxSetPr(pmxa_array,index_in);
+-	//mexCallMATLAB( 1, &plhs[0], 1, &pmxa_array, "transpose");
+-
+ 	WriteData(&plhs[1],x_in,nods,1);
+-	//pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+-	//mxSetM(pmxa_array,1);
+-	//mxSetN(pmxa_array,nods);
+-	//mxSetPr(pmxa_array,x_in);
+-	//mexCallMATLAB( 1, &plhs[1], 1, &pmxa_array, "transpose");
+-
+ 	WriteData(&plhs[2],y_in,nods,1);
+-	//pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+-	//mxSetM(pmxa_array,1);
+-	//mxSetN(pmxa_array,nods);
+-	//mxSetPr(pmxa_array,y_in);
+-	//mexCallMATLAB( 1, &plhs[2], 1, &pmxa_array, "transpose");
+-
+ 	WriteData(&plhs[3],segments_in,num_seg,3);
+-//pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+-//mxSetM(pmxa_array,3);
+-//mxSetN(pmxa_array,num_seg);
+-//mxSetPr(pmxa_array,segments_in);
+-//mexCallMATLAB( 1, &plhs[3], 1, &pmxa_array, "transpose");
+-
+ 	WriteData(&plhs[4],segmentmarkers_in,num_seg,1);
+-	//pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+-	//mxSetM(pmxa_array,1);
+-	//mxSetN(pmxa_array,num_seg);
+-	//mxSetPr(pmxa_array,segmentmarkers_in);
+-	//mexCallMATLAB( 1, &plhs[4], 1, &pmxa_array, "transpose");
+ 
+ 	if(riftflag){
+ 		/*Create a structure rifts where if i is a rift number, we have the following fields rifts(i).segments and rifts(i).numsegs: */
+-
+ 		fnames[0] = "numsegs";
+ 		fnames[1] = "segments";
+ 		fnames[2] = "pairs";
+@@ -224,21 +191,11 @@
+ 
+ 			/*Segments: */
+ 			WriteData(&pmxa_array3,out_riftssegments[i],out_riftsnumsegments[i],3);
+-			//pmxa_array2= mxCreateDoubleMatrix(0,0,mxREAL);
+-			//mxSetM(pmxa_array2,3);
+-			//mxSetN(pmxa_array2,out_riftsnumsegments[i]);
+-			//mxSetPr(pmxa_array2,out_riftssegments[i]);
+-			//mexCallMATLAB( 1, &pmxa_array3, 1, &pmxa_array2, "transpose");
+ 			mxSetField(pmxa_array,i,"segments",pmxa_array3);
+ 			mxSetField(pmxa_array,i,"numsegs",mxCreateDoubleScalar((double)out_riftsnumsegments[i]));
+ 
+ 			/*Element pairs: */
+ 			WriteData(&pmxa_array3,out_riftspairs[i],out_riftsnumpairs[i],2);
+-			//pmxa_array2= mxCreateDoubleMatrix(0,0,mxREAL);
+-			//mxSetM(pmxa_array2,2);
+-			//mxSetN(pmxa_array2,out_riftsnumpairs[i]);
+-			//mxSetPr(pmxa_array2,out_riftspairs[i]);
+-			//mexCallMATLAB( 1, &pmxa_array3, 1, &pmxa_array2, "transpose");
+ 			mxSetField(pmxa_array,i,"pairs",pmxa_array3);
+ 
+ 			/*Tips: */
+@@ -253,11 +210,6 @@
+ 
+ 			/*Penalty pairs: */
+ 			WriteData(&pmxa_array3,out_riftspenaltypairs[i],out_riftsnumpenaltypairs[i],7);
+-			//pmxa_array2= mxCreateDoubleMatrix(0,0,mxREAL);
+-			//mxSetM(pmxa_array2,7);
+-			//mxSetN(pmxa_array2,out_riftsnumpenaltypairs[i]);
+-			//mxSetPr(pmxa_array2,out_riftspenaltypairs[i]);
+-			//mexCallMATLAB( 1, &pmxa_array3, 1, &pmxa_array2, "transpose");
+ 			mxSetField(pmxa_array,i,"penaltypairs",pmxa_array3);
+ 
+ 			/*Friction fraction, fractionincrement  and fill: */
+@@ -293,9 +245,7 @@
+ 	return;
+ }
+ 
+-
+-void TriMeshProcessRiftsUsage(void)
+-{
++void TriMeshProcessRiftsUsage(void){
+ 	_printLine_("");
+ 	_printLine_("   usage: [index2,x2,y2,segments2,segmentmarkers2,rifts2]=TriMeshProcessrifts(index1,x1,y1,segments1,segmentmarkers1) ");
+ 	_printLine_("      where: (index1,x1,y1,segments1,segmentmarkers1) is an initial triangulation.");
Index: /issm/oecreview/Archive/12678-13393/ISSM-13225-13226.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13225-13226.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13225-13226.diff	(revision 13394)
@@ -0,0 +1,45 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13225)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13226)
+@@ -29,10 +29,9 @@
+ void WriteData(PyObject* py_tuple, int index, double* matrix, int M,int N);
+ void WriteData(PyObject* py_tuple, int index, int integer);
+ void WriteData(PyObject* py_tuple, int index, char* string);
+-void WriteData(PyObject* py_tuple, int index, Matrix* matrix);
+-void WriteData(PyObject* py_tuple, int index, Vector* vector);
++void WriteData(PyObject* py_tuple, int index, SeqMat<double>* matrix);
++void WriteData(PyObject* py_tuple, int index, SeqVec<double>* vector);
+ 
+-
+ //void FetchData(DataSet** pdataset,PyObject* py_ref);
+ //void FetchData(double** pmatrix,int* pnumel,int* pndims,int** psize,PyObject* py_ref);
+ //void FetchData(int** pmatrix,int* pM,int *pN,PyObject* py_ref);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13225)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13226)
+@@ -32,8 +32,8 @@
+ 	PyTuple_SetItem(py_tuple, index, PyUnicode_FromString(string));
+ 
+ }/*}}}*/
+-/*FUNCTION WriteData(PyObject* tuple,int index,Matrix* matrix){{{*/
+-void WriteData(PyObject* tuple,int index,Matrix* matrix){
++/*FUNCTION WriteData(PyObject* tuple,int index,SeqMat<double>* matrix){{{*/
++void WriteData(PyObject* tuple,int index,SeqMat<double>* matrix){
+ 	
+ 	int M,N;
+ 	double* buffer=NULL;
+@@ -48,10 +48,9 @@
+ 	
+ 	PyTuple_SetItem(tuple, index, array);
+ 
+-
+ }/*}}}*/
+-/*FUNCTION WriteData(PyObject* py_tuple,int index,Vector* vector){{{*/
+-void WriteData(PyObject* tuple,int index,Vector* vector){
++/*FUNCTION WriteData(PyObject* py_tuple,int index,SeqVec<double>* vector){{{*/
++void WriteData(PyObject* tuple,int index,SeqVec<double>* vector){
+ 	
+ 	int M;
+ 	double* buffer=NULL;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13226-13227.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13226-13227.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13226-13227.diff	(revision 13394)
@@ -0,0 +1,126 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 13226)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 13227)
+@@ -215,8 +215,8 @@
+ 	*pdataref=dataref;
+ }
+ /*}}}*/
+-/*FUNCTION WriteData(mxArray** pdataref,Matrix* matrix){{{*/
+-void WriteData(mxArray** pdataref,Matrix<double>* matrix){
++/*FUNCTION WriteData(mxArray** pdataref,SeqMat<double>* matrix){{{*/
++void WriteData(mxArray** pdataref,SeqMat<double>* matrix){
+ 		
+ 	int      i,j;
+ 	int      rows,cols;
+@@ -245,7 +245,6 @@
+ 
+ 		/*Free ressources:*/
+ 		xDelete<double>(matrix_ptr);
+-
+ 	}
+ 	else{
+ 		dataref = mxCreateDoubleMatrix(0,0,mxREAL);
+@@ -254,8 +253,8 @@
+ 	*pdataref=dataref;
+ }
+ /*}}}*/
+-/*FUNCTION WriteData(mxArray** pdataref,Vector<double>* vector){{{*/
+-void WriteData(mxArray** pdataref,Vector<double>* vector){
++/*FUNCTION WriteData(mxArray** pdataref,SeqVec<double>* vector){{{*/
++void WriteData(mxArray** pdataref,SeqVec<double>* vector){
+ 	
+ 	mxArray* dataref=NULL;
+ 	double*  vector_ptr=NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 13226)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 13227)
+@@ -17,10 +17,10 @@
+ 
+ #include <mex.h>
+ 
+-void WriteData(mxArray** pdataref,Matrix<double>* matrix);
++void WriteData(mxArray** pdataref,SeqMat<double>* matrix);
+ void WriteData(mxArray** pdataref,double* matrix, int M,int N);
+ void WriteData(mxArray** pdataref,int*    matrix, int M,int N);
+-void WriteData(mxArray** pdataref,Vector<double>* vector);
++void WriteData(mxArray** pdataref,SeqVec<double>* vector);
+ void WriteData(mxArray** pdataref,double* vector, int M);
+ void WriteData(mxArray** pdataref,int integer);
+ void WriteData(mxArray** pdataref,bool boolean);
+@@ -84,5 +84,4 @@
+ PetscVec* MatlabVectorToPetscVec(const mxArray* mxvector);
+ #endif
+ 
+-
+ #endif	/* _IO_H_ */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 13226)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 13227)
+@@ -19,23 +19,23 @@
+ #endif
+ /*}}}*/
+ 
+-void TriMeshx(Matrix<IssmPDouble>** pindex,Vector<IssmPDouble>** px,Vector<IssmPDouble>** py,Matrix<IssmPDouble>** psegments,Vector<IssmPDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
++void TriMeshx(SeqMat<IssmPDouble>** pindex,SeqVec<IssmPDouble>** px,SeqVec<IssmPDouble>** py,SeqMat<IssmPDouble>** psegments,SeqVec<IssmPDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
+ 
+ 	/*indexing: */
+ 	int i,j;
+ 
+ 	/*output: */
+-	IssmPDouble* index=NULL;
+-	Matrix<IssmPDouble>* index_matrix=NULL;
+-	double* x=NULL;
+-	double* y=NULL;
+-	double* segments=NULL;
+-	Matrix<IssmPDouble>* segments_matrix=NULL;
+-	double* segmentmarkerlist=NULL;
++	IssmPDouble         *index             = NULL;
++	SeqMat<IssmPDouble> *index_matrix      = NULL;
++	double              *x                 = NULL;
++	double              *y                 = NULL;
++	double              *segments          = NULL;
++	SeqMat<IssmPDouble> *segments_matrix   = NULL;
++	double              *segmentmarkerlist = NULL;
+ 
+ 	/*intermediary: */
+-	int      counter,counter2,backcounter;
+-	Contour<IssmPDouble>* contour=NULL;
++	int counter,counter2,backcounter;
++	Contour<IssmPDouble> *contour = NULL;
+ 
+ 	/* Triangle structures needed to call Triangle library routines: */
+ 	struct triangulateio in,out;
+@@ -191,13 +191,13 @@
+ 	OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
+ 
+ 	/*Output : */
+-	index_matrix=new Matrix<IssmPDouble>(index,out.numberoftriangles,3,1.0,SeqMatType);
++	index_matrix=new SeqMat<IssmPDouble>(index,out.numberoftriangles,3,1.0);
+ 	*pindex=index_matrix;
+ 	
+-	segments_matrix=new Matrix<IssmPDouble>(segments,out.numberofsegments,3,1.0,SeqMatType);
++	segments_matrix=new SeqMat<IssmPDouble>(segments,out.numberofsegments,3,1.0);
+ 	*psegments=segments_matrix;
+ 
+-	*px=new Vector<IssmPDouble>(x,out.numberofpoints,SeqMatType);
+-	*py=new Vector<IssmPDouble>(y,out.numberofpoints,SeqMatType);
+-	*psegmentmarkerlist=new Vector<IssmPDouble>(segmentmarkerlist,out.numberofsegments,SeqMatType);
++	*px=new SeqVec<IssmPDouble>(x,out.numberofpoints);
++	*py=new SeqVec<IssmPDouble>(y,out.numberofpoints);
++	*psegmentmarkerlist=new SeqVec<IssmPDouble>(segmentmarkerlist,out.numberofsegments);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h	(revision 13226)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h	(revision 13227)
+@@ -10,6 +10,6 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-void TriMeshx(Matrix<IssmPDouble>** pindex,Vector<IssmPDouble>** px,Vector<IssmPDouble>** py,Matrix<IssmPDouble>** psegments,Vector<IssmPDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
++void TriMeshx(SeqMat<IssmPDouble>** pindex,SeqVec<IssmPDouble>** px,SeqVec<IssmPDouble>** py,SeqMat<IssmPDouble>** psegments,SeqVec<IssmPDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
+ 
+ #endif  /* _TRIMESHX_H */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13227-13228.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13227-13228.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13227-13228.diff	(revision 13394)
@@ -0,0 +1,21 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 13227)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 13228)
+@@ -16,11 +16,11 @@
+ 	DataSet *rifts  = NULL;
+ 
+ 	/* output: */
+-	Matrix<double> *index             = NULL;
+-	Vector<double> *x                 = NULL;
+-	Vector<double> *y                 = NULL;
+-	Matrix<double> *segments          = NULL;
+-	Vector<double> *segmentmarkerlist = NULL;
++	SeqMat<double> *index             = NULL;
++	SeqVec<double> *x                 = NULL;
++	SeqVec<double> *y                 = NULL;
++	SeqMat<double> *segments          = NULL;
++	SeqVec<double> *segmentmarkerlist = NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
Index: /issm/oecreview/Archive/12678-13393/ISSM-13228-13229.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13228-13229.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13228-13229.diff	(revision 13394)
@@ -0,0 +1,1322 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13229)
+@@ -2,7 +2,6 @@
+  * \brief: header file for contour (argus type, files in .exp extension) operations
+  */
+ 
+-
+ #ifndef _EXP_H_
+ #define _EXP_H_
+ 
+@@ -14,10 +13,9 @@
+ int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname);
+ int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
+ 
+-
+ /*IsInPoly {{{*/
+ template <class doubletype>
+-int IsInPoly(Vector<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
++int IsInPoly(SeqVec<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
+ 
+ 	int i;
+ 	double x0,y0;
+@@ -57,48 +55,6 @@
+ 	}
+ 	 return 1;
+ }/*}}}*/
+-/*IsOutsidePoly {{{*/
+-template <class doubletype>
+-int IsOutsidePoly(Vector<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
+-
+-	int i,j;
+-	double x0,y0;
+-	doubletype value;
+-	double xmin=xc[0];
+-	double xmax=xc[0];
+-	double ymin=yc[0];
+-	double ymax=yc[0];
+-
+-	/*Get extrema*/
+-	for (i=1;i<numvertices;i++){
+-		if(xc[i]<xmin) xmin=xc[i];
+-		if(xc[i]>xmax) xmax=xc[i];
+-		if(yc[i]<ymin) ymin=yc[i];
+-		if(yc[i]>ymax) ymax=yc[i];
+-	}
+-
+-	/*Go through all vertices of the mesh:*/
+-	for (i=i0;i<i1;i++){
+-
+-		//Get current value of value[i] -> do not change it if != 0
+-		in->GetValue(&value,i);
+-		if (reCast<bool,doubletype>(value)){
+-			/*this vertex already is inside one of the contours, continue*/
+-			continue;
+-		}
+-
+-		/*pick up vertex (x[i],y[i]) and figure out if located inside contour (xc,yc)*/
+-		x0=x[i]; y0=y[i];
+-		if(x0<xmin || x0>xmax || y0<ymin || y0>ymax){
+-			value=1;
+-		}
+-		else{
+-			value=1-pnpoly(numvertices,xc,yc,x0,y0,edgevalue);
+-		}
+-		in->SetValue(i,value,INS_VAL);
+-	}
+-	return 1;
+-}/*}}}*/
+ /*DomainOutlineRead{{{*/
+ template <class doubletype>
+ int DomainOutlineRead(int* pnprof,int** pprofnvertices,doubletype*** ppprofx,doubletype*** ppprofy,bool** pclosed,char* domainname){
+@@ -243,7 +199,4 @@
+ 	return domain;
+ } /*}}}*/
+ 
+-
+-
+-
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 13229)
+@@ -9,16 +9,18 @@
+ #include "../../classes/objects/objects.h"
+ #include "../modules.h"
+ 
+-int InterpFromMesh2dx( Vector<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
+-		double* default_values,int num_default_values,Contour<IssmPDouble>** contours,int numcontours){
++int InterpFromMesh2dx(SeqVec<IssmPDouble>** pdata_prime,
++			double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length,
++			double* x_prime, double* y_prime, int nods_prime,
++			double* default_values,int num_default_values,Contour<IssmPDouble>** contours,int numcontours){
+ 	
+ 	/*Output*/
+-	Vector<IssmPDouble>* data_prime=NULL;
++	SeqVec<IssmPDouble>* data_prime=NULL;
+ 
+ 	/*Intermediary*/
+-	int i,j;
+-	int interpolation_type;
+-	bool debug;
++	int    i,j;
++	int    interpolation_type;
++	bool   debug;
+ 	double area;
+ 	double area_1,area_2,area_3;
+ 	double data_value;
+@@ -26,8 +28,8 @@
+ 	double ymin,ymax;
+ 
+ 	/*contours: */
+-	Vector<IssmPDouble>*    vec_incontour=NULL;
+-	double*    incontour=NULL;
++	SeqVec<IssmPDouble> *vec_incontour = NULL;
++	double              *incontour     = NULL;
+ 
+ 	/*threading: */
+ 	InterpFromMesh2dxThreadStruct gate;
+@@ -70,7 +72,7 @@
+ 	}
+ 
+ 	/*Initialize output*/
+-	data_prime=new Vector<IssmPDouble>(nods_prime,false,SeqVecType);
++	data_prime=new SeqVec<IssmPDouble>(nods_prime);
+ 	if(num_default_values){
+ 		if(num_default_values==1)for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[0],INS_VAL);
+ 		else for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[i],INS_VAL);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp	(revision 13229)
+@@ -19,24 +19,24 @@
+ 	int                            num_threads = handle->num;
+ 	
+ 	/*recover parameters :*/
+-	int     interpolation_type = gate->interpolation_type;
+-	bool    debug              = gate->debug;
+-	int     nels_data          = gate->nels_data;
+-	double *index_data         = gate->index_data;
+-	double *x_data             = gate->x_data;
+-	double *y_data             = gate->y_data;
+-	double *data               = gate->data;
+-	double  xmin               = gate->xmin;
+-	double  xmax               = gate->xmax;
+-	double  ymin               = gate->ymin;
+-	double  ymax               = gate->ymax;
+-	int     nods_prime         = gate->nods_prime;
+-	Vector<IssmPDouble>* data_prime         = gate->data_prime;
+-	double *x_prime            = gate->x_prime;
+-	double *y_prime            = gate->y_prime;
+-	double *default_values     = gate->default_values;
+-	int     num_default_values = gate->num_default_values;
+-	double *incontour          = gate->incontour;
++	int     interpolation_type      = gate->interpolation_type;
++	bool    debug                   = gate->debug;
++	int     nels_data               = gate->nels_data;
++	double *index_data              = gate->index_data;
++	double *x_data                  = gate->x_data;
++	double *y_data                  = gate->y_data;
++	double *data                    = gate->data;
++	double  xmin                    = gate->xmin;
++	double  xmax                    = gate->xmax;
++	double  ymin                    = gate->ymin;
++	double  ymax                    = gate->ymax;
++	int     nods_prime              = gate->nods_prime;
++	SeqVec<IssmPDouble>* data_prime = gate->data_prime;
++	double *x_prime                 = gate->x_prime;
++	double *y_prime                 = gate->y_prime;
++	double *default_values          = gate->default_values;
++	int     num_default_values      = gate->num_default_values;
++	double *incontour               = gate->incontour;
+ 
+ 	/*partition loop across threads: */
+ 	PartitionRange(&i0,&i1,nels_data,num_threads,my_thread);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h	(revision 13229)
+@@ -8,34 +8,32 @@
+ #include "../../classes/objects/objects.h"
+ #include "../../toolkits/toolkits.h"
+ 
+-
+ /*threading: */
+ typedef struct{
+ 
+-	int interpolation_type;
+-	bool debug;
+-	int  nels_data;
+-	double* index_data;
+-	double* x_data;
+-	double* y_data;
+-	double* data;
+-	double xmin,xmax;
+-	double ymin,ymax;
+-	int    nods_prime;
+-	Vector<IssmPDouble>*    data_prime;
+-	double* x_prime;
+-	double* y_prime;
+-	double* default_values;
+-	int     num_default_values;
+-	double*    incontour;
++	int                 interpolation_type;
++	bool                debug;
++	int                 nels_data;
++	double              *index_data;
++	double              *x_data;
++	double              *y_data;
++	double              *data;
++	double              xmin,xmax;
++	double              ymin,ymax;
++	int                 nods_prime;
++	SeqVec<IssmPDouble> *data_prime;
++	double              *x_prime;
++	double              *y_prime;
++	double              *default_values;
++	int                 num_default_values;
++	double              *incontour;
+ 
+ 
+ } InterpFromMesh2dxThreadStruct;
+ 
+-int InterpFromMesh2dx( Vector<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
++int InterpFromMesh2dx(SeqVec<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
+ 		double* default_values,int num_default_values,Contour<IssmPDouble>** contours,int numcontours);
+ 
+ void* InterpFromMesh2dxt(void* vInterpFromMesh2dxThreadStruct);
+ 
+ #endif /* _INTERPFROMMESH2DX_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h	(revision 13229)
+@@ -2,7 +2,6 @@
+ 	ContourToNodesx.h
+ */
+ 
+-
+ #ifndef _CONTOURTONODESX_H
+ #define _CONTOURTONODESX_H
+ 
+@@ -10,8 +9,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-int ContourToNodesx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue);
+-int ContourToNodesx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
++int ContourToNodesx(SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue);
++int ContourToNodesx(SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
+ 
+ #endif /* _CONTOURTONODESX_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp	(revision 13229)
+@@ -3,7 +3,7 @@
+ 
+ #include "./ContourToNodesx.h"
+ 
+-int ContourToNodesx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){
++int ContourToNodesx(SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){
+ 
+ 	int i;
+ 	int m,n;
+@@ -16,10 +16,9 @@
+ 	double   value;
+ 
+ 	/*output: */
+-	Vector<IssmPDouble>* flags=NULL;
++	SeqVec<IssmPDouble>* flags=NULL;
++	flags=new SeqVec<IssmPDouble>(nods);
+ 
+-	flags=new Vector<IssmPDouble>(nods);
+-
+ 	/*Loop through all contours: */
+ 	for (i=0;i<numcontours;i++){
+ 		contouri=*(contours+i);
+@@ -38,7 +37,7 @@
+ 	return 1;
+ }
+ 
+-int ContourToNodesx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
++int ContourToNodesx(SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
+ 
+ 	int i;
+ 	int m,n;
+@@ -51,10 +50,9 @@
+ 	double   value;
+ 
+ 	/*output: */
+-	Vector<IssmPDouble>* flags=NULL;
++	SeqVec<IssmPDouble>* flags=NULL;
++	flags=new SeqVec<IssmPDouble>(nods);
+ 
+-	flags=new Vector<IssmPDouble>(nods);
+-
+ 	/*Loop through all contours: */
+ 	if(contours){
+ 		for (i=0;i<contours->Size();i++){
+@@ -68,6 +66,5 @@
+ 
+ 	/*Assign output pointers: */
+ 	*pflags=flags;
+-	
+ 	return 1;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 13229)
+@@ -6,10 +6,10 @@
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+ 
+-int InterpFromMeshToMesh3dx( Vector<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value) {
++int InterpFromMeshToMesh3dx( SeqVec<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value) {
+ 
+ 	/*Output*/
+-	Vector<IssmPDouble>* data_prime=NULL;
++	SeqVec<IssmPDouble>* data_prime=NULL;
+ 
+ 	/*Intermediary*/
+ 	int i,j;
+@@ -53,7 +53,7 @@
+ 	}
+ 
+ 	/*Initialize output*/
+-	data_prime=new Vector<IssmPDouble>(nods_prime);
++	data_prime=new SeqVec<IssmPDouble>(nods_prime);
+ 	for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_value,INS_VAL);
+ 
+ 	/*Loop over the elements*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h	(revision 13229)
+@@ -8,7 +8,6 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../../classes/objects/objects.h"
+ 
+-int InterpFromMeshToMesh3dx( Vector<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
++int InterpFromMeshToMesh3dx(SeqVec<IssmPDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
+ 
+ #endif /* _INTERPFROMMESHTOMESH3DX_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 13229)
+@@ -16,10 +16,10 @@
+ /*}}}*/
+ 
+ /*InterpFromGridToMeshx{{{*/
+-int InterpFromGridToMeshx( Vector<IssmPDouble>** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
++int InterpFromGridToMeshx(SeqVec<IssmPDouble>** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
+ 
+ 	/*output: */
+-	Vector<IssmPDouble>* data_mesh=NULL;
++	SeqVec<IssmPDouble>* data_mesh=NULL;
+ 	
+ 	/*Intermediary*/
+ 	double* x=NULL;
+@@ -46,7 +46,7 @@
+ 	}
+ 
+ 	/*Allocate output vector: */
+-	data_mesh=new Vector<IssmPDouble>(nods);
++	data_mesh=new SeqVec<IssmPDouble>(nods);
+ 
+ 	/*Find out what kind of coordinates (x_in,y_in) have been given is input*/
+ 	if(N==(x_rows-1) && M==(y_rows-1)){
+@@ -119,19 +119,19 @@
+ 	num_threads=handle->num;
+ 
+ 	/*recover parameters :*/
+-	double *x_mesh        = gate->x_mesh;
+-	double *y_mesh        = gate->y_mesh;
+-	int     x_rows        = gate->x_rows;
+-	int     y_rows        = gate->y_rows;
+-	double *x             = gate->x;
+-	double *y             = gate->y;
+-	int     nods          = gate->nods;
+-	Vector<IssmPDouble>*data_mesh     = gate->data_mesh;
+-	double *data          = gate->data;
+-	double  default_value = gate->default_value;
+-	int     interpenum    = gate->interp;
+-	int     M             = gate->M;
+-	int     N             = gate->N;
++	double *x_mesh                = gate->x_mesh;
++	double *y_mesh                = gate->y_mesh;
++	int     x_rows                = gate->x_rows;
++	int     y_rows                = gate->y_rows;
++	double *x                     = gate->x;
++	double *y                     = gate->y;
++	int     nods                  = gate->nods;
++	SeqVec<IssmPDouble>*data_mesh = gate->data_mesh;
++	double *data                  = gate->data;
++	double  default_value         = gate->default_value;
++	int     interpenum            = gate->interp;
++	int     M                     = gate->M;
++	int     N                     = gate->N;
+ 
+ 	bool debug = M*N>1? true:false;
+ 	debug = true;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h	(revision 13229)
+@@ -11,22 +11,22 @@
+ 
+ /*threading: */
+ typedef struct{
+-	double* x;
+-	int     x_rows;
+-	double* y;
+-	int     y_rows;
+-	double* data;
+-	double  default_value;
+-	int     interp;
+-	int     M;
+-	int     N;
+-	int     nods;
+-	double* x_mesh;
+-	double* y_mesh;
+-	Vector<IssmPDouble>*     data_mesh;
++	double*             x;
++	int                 x_rows;
++	double*             y;
++	int                 y_rows;
++	double*             data;
++	double              default_value;
++	int                 interp;
++	int                 M;
++	int                 N;
++	int                 nods;
++	double*             x_mesh;
++	double*             y_mesh;
++	SeqVec<IssmPDouble>* data_mesh;
+ } InterpFromGridToMeshxThreadStruct;
+ 
+-int    InterpFromGridToMeshx( Vector<IssmPDouble>** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
++int    InterpFromGridToMeshx(SeqVec<IssmPDouble>** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
+ void*  InterpFromGridToMeshxt(void* vInterpFromGridToMeshxThreadStruct);
+ bool   findindices(int* pn,int* pm,double* x,int x_rows, double* y,int y_rows, double xgrid,double ygrid);
+ double triangleinterp(double x1,double x2,double y1,double y2,double Q11,double Q12,double Q21,double Q22,double x,double y);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp	(revision 13229)
+@@ -10,7 +10,7 @@
+ 
+ #include "./ContourToMeshx.h"
+ 
+-int ContourToMeshx( Vector<double>** pin_nod,Vector<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
++int ContourToMeshx(SeqVec<double>** pin_nod,SeqVec<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
+ 
+ 	int noerr=1;
+ 	int i;
+@@ -29,12 +29,11 @@
+ 
+ 
+ 	/*output: */
+-	Vector<double>* in_nod=NULL;
+-	Vector<double>* in_elem=NULL;
++	SeqVec<double>* in_nod=NULL;
++	SeqVec<double>* in_elem=NULL;
++	in_nod  = new SeqVec<double>(nods);
++	in_elem = new SeqVec<double>(nel);
+ 
+-	in_nod=new Vector<double>(nods);
+-	in_elem=new Vector<double>(nel);
+-
+ 	/*initialize thread parameters: */
+ 	gate.contours=contours;
+ 	gate.nods=nods;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp	(revision 13229)
+@@ -32,9 +32,8 @@
+ 	int edgevalue;
+ 	double* x=NULL;
+ 	double* y=NULL;
+-	Vector<double>* in_nod=NULL;
++	SeqVec<double>* in_nod=NULL;
+ 
+-
+ 	/*recover handle and gate: */
+ 	handle=(pthread_handle*)vpthread_handle;
+ 	gate=(ContourToMeshxThreadStruct*)handle->gate;
+@@ -59,5 +58,4 @@
+ 	}
+ 
+ 	return NULL;
+-
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h	(revision 13229)
+@@ -12,21 +12,19 @@
+ /*threading: */
+ typedef struct{
+ 
+-	DataSet* contours;
+-	int nods;
+-	int edgevalue;
+-	Vector<double>* in_nod;
+-	double* x;
+-	double* y;
++	DataSet *contours;
++	int    nods;
++	int    edgevalue;
++	SeqVec<double> *in_nod;
++	double *x;
++	double *y;
+ 
+ } ContourToMeshxThreadStruct;
+ 
+ 
+ /* local prototypes: */
+-int ContourToMeshx( Vector<double>** pin_nods,Vector<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
++int ContourToMeshx(SeqVec<double>** pin_nods,SeqVec<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
+ 
+ void* ContourToMeshxt(void* vContourToMeshxThreadStruct);
+ 
+-
+ #endif /* _CONTOURTOMESHX_H */
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp	(revision 13229)
+@@ -16,7 +16,7 @@
+ 	double* y;
+ 	int     nods;
+ 	double  mindistance;
+-	Vector<IssmPDouble>*     flags;
++	SeqVec<IssmPDouble>*     flags;
+ 
+ 	/*recover handle and gate: */
+ 	handle=(pthread_handle*)vpthread_handle;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h	(revision 13229)
+@@ -10,7 +10,7 @@
+ #include "../../classes/objects/objects.h"
+ 
+ /* local prototypes: */
+-int PointCloudFindNeighborsx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread);
++int PointCloudFindNeighborsx(SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread);
+ 
+ /*threading: */
+ typedef struct{
+@@ -19,9 +19,8 @@
+ 	double* y;
+ 	int nods;
+ 	double mindistance;
+-	Vector<IssmPDouble>* flags;
++	SeqVec<IssmPDouble>* flags;
+ 
+-
+ } PointCloudFindNeighborsThreadStruct;
+ 
+ void* PointCloudFindNeighborsxt(void* vPointCloudFindNeighborsThreadStruct);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp	(revision 13229)
+@@ -3,11 +3,11 @@
+ 
+ #include "./PointCloudFindNeighborsx.h"
+ 
+-int PointCloudFindNeighborsx( Vector<IssmPDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread){
++int PointCloudFindNeighborsx(SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread){
+ 
+ 	/*output: */
+-	Vector<IssmPDouble>* flags=NULL;
+-	flags=new Vector<IssmPDouble>(nods);
++	SeqVec<IssmPDouble>* flags=NULL;
++	flags=new SeqVec<IssmPDouble>(nods);
+ 
+ 	/*threading: */
+ 	PointCloudFindNeighborsThreadStruct gate;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 13229)
+@@ -1,237 +0,0 @@
+-/*!\file SeqVec.cpp
+- * \brief: implementation of the SeqVec object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../toolkits.h"
+-#include "../../shared/shared.h"
+-
+-/*}}}*/
+-
+-/*SeqVec constructors and destructor*/
+-/*FUNCTION SeqVec::SeqVec(){{{*/
+-SeqVec::SeqVec(){
+-
+-	this->M=0;
+-	this->vector=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::SeqVec(int M,bool fromlocalsize){{{*/
+-SeqVec::SeqVec(int pM,bool fromlocalsize){
+-
+-	this->M=pM;
+-	this->vector=NULL;
+-	if(this->M) this->vector=xNewZeroInit<IssmDouble>(pM);
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::SeqVec(IssmDouble* serial_vec,int M){{{*/
+-SeqVec::SeqVec(IssmDouble* buffer,int pM){
+-
+-	int i,j;
+-
+-	this->M=pM;
+-	this->vector=NULL;
+-	if(this->M){
+-		this->vector=xNew<IssmDouble>(pM);
+-		xMemCpy<IssmDouble>(this->vector,buffer,pM);
+-	}
+-}
+-/*}}}*/
+-		/*FUNCTION SeqVec::~SeqVec(){{{*/
+-SeqVec::~SeqVec(){
+-	xDelete<IssmDouble>(this->vector);
+-	M=0;
+-}
+-/*}}}*/
+-
+-/*SeqVec specific routines: */
+-/*FUNCTION SeqVec::Echo{{{*/
+-void SeqVec::Echo(void){
+-
+-	int i;
+-	_printLine_("SeqVec size " << this->M);
+-	for(i=0;i<M;i++){
+-		_printString_(vector[i] << "\n ");
+-	}
+-}
+-/*}}}*/
+-
+-/*FUNCTION SeqVec::Assemble{{{*/
+-void SeqVec::Assemble(void){
+-		
+-	/*do nothing*/
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::SetValues{{{*/
+-void SeqVec::SetValues(int ssize, int* list, IssmDouble* values, InsMode mode){
+-	
+-	int i;
+-	switch(mode){
+-		case ADD_VAL:
+-			for(i=0;i<ssize;i++) this->vector[list[i]]+=values[i];
+-			break;
+-		case INS_VAL:
+-			for(i=0;i<ssize;i++) this->vector[list[i]]=values[i];
+-			break;
+-		default:
+-			_error_("unknown insert mode!");
+-			break;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::SetValue{{{*/
+-void SeqVec::SetValue(int dof, IssmDouble value, InsMode mode){
+-
+-	switch(mode){
+-		case ADD_VAL:
+-			this->vector[dof]+=value;
+-			break;
+-		case INS_VAL:
+-			this->vector[dof]=value;
+-			break;
+-		default:
+-			_error_("unknown insert mode!");
+-			break;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::GetValue{{{*/
+-void SeqVec::GetValue(IssmDouble* pvalue,int dof){
+-
+-	*pvalue=this->vector[dof];
+-
+-}
+-/*}}}*/
+-		
+-/*FUNCTION SeqVec::GetSize{{{*/
+-void SeqVec::GetSize(int* pM){
+-
+-	*pM=this->M;
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::GetLocalSize{{{*/
+-void SeqVec::GetLocalSize(int* pM){
+-	
+-	*pM=this->M;
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::Duplicate{{{*/
+-SeqVec* SeqVec::Duplicate(void){
+-	
+-	return new SeqVec(this->vector,this->M);
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::Set{{{*/
+-void SeqVec::Set(IssmDouble value){
+-
+-	int i;
+-	for(i=0;i<this->M;i++)this->vector[i]=value;
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::AXPY{{{*/
+-void SeqVec::AXPY(SeqVec* X, IssmDouble a){
+-
+-	int i;
+-
+-	/*y=a*x+y where this->vector is y*/
+-	for(i=0;i<this->M;i++)this->vector[i]=a*X->vector[i]+this->vector[i];
+-	
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::AYPX{{{*/
+-void SeqVec::AYPX(SeqVec* X, IssmDouble a){
+-	
+-	int i;
+-
+-	/*y=x+a*y where this->vector is y*/
+-	for(i=0;i<this->M;i++)this->vector[i]=X->vector[i]+a*this->vector[i];
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::ToMPISerial{{{*/
+-IssmDouble* SeqVec::ToMPISerial(void){
+-
+-	IssmDouble* buffer=NULL;
+-
+-	if(this->M){
+-		buffer=xNew<IssmDouble>(this->M);
+-		xMemCpy<IssmDouble>(buffer,this->vector,this->M);
+-	}
+-	return buffer;
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::Copy{{{*/
+-void SeqVec::Copy(SeqVec* to){
+-
+-	int i;
+-
+-	to->M=this->M;
+-	for(i=0;i<this->M;i++)to->vector[i]=this->vector[i];
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::Norm{{{*/
+-IssmDouble SeqVec::Norm(NormMode mode){
+-
+-	IssmDouble norm;
+-	int i;
+-
+-	switch(mode){
+-		case NORM_INF:
+-			norm=0; for(i=0;i<this->M;i++)norm=max(norm,fabs(this->vector[i]));
+-			return norm;
+-			break;
+-		case NORM_TWO:
+-			norm=0; 
+-			for(i=0;i<this->M;i++)norm+=pow(this->vector[i],2);
+-			return sqrt(norm);
+-			break;
+-		default:
+-			_error_("unknown norm !");
+-			break;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::Scale{{{*/
+-void SeqVec::Scale(IssmDouble scale_factor){
+-
+-	int i;
+-	for(i=0;i<this->M;i++)this->vector[i]=scale_factor*this->vector[i];
+-	
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::Dot{{{*/
+-IssmDouble SeqVec::Dot(SeqVec* input){
+-
+-	int i;
+-
+-	IssmDouble dot=0;
+-	for(i=0;i<this->M;i++)dot+=this->vector[i]*input->vector[i];
+-	return dot;
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqVec::PointwiseDivide{{{*/
+-void SeqVec::PointwiseDivide(SeqVec* x,SeqVec* y){
+-
+-	int i;
+-	/*pointwise w=x/y where this->vector is w: */
+-	for(i=0;i<this->M;i++)this->vector[i]=x->vector[i]/y->vector[i];
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 13229)
+@@ -1,211 +0,0 @@
+-/*!\file SeqMat.cpp
+- * \brief: implementation of the SeqMat object
+- */
+-
+-/*Headers:*/
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../toolkits.h"
+-#include "../../shared/shared.h"
+-
+-/*}}}*/
+-
+-/*SeqMat constructors and destructor*/
+-/*FUNCTION SeqMat::SeqMat(){{{*/
+-SeqMat::SeqMat(){
+-
+-	this->M=0;
+-	this->N=0;
+-	this->matrix=NULL;
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::SeqMat(int M,int N){{{*/
+-SeqMat::SeqMat(int pM,int pN){
+-
+-	this->M=pM;
+-	this->N=pN;
+-	this->matrix=NULL;
+-	if(M*N) this->matrix=xNewZeroInit<IssmDouble>(pM*pN);
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::SeqMat(int M,int N, IssmDouble sparsity){{{*/
+-SeqMat::SeqMat(int pM,int pN, IssmDouble sparsity){
+-
+-	this->M=pM;
+-	this->N=pN;
+-	this->matrix=NULL;
+-	if(M*N) this->matrix=xNewZeroInit<IssmDouble>(pM*pN);
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::SeqMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){{{*/
+-SeqMat::SeqMat(IssmDouble* serial_mat,int pM,int pN,IssmDouble sparsity){
+-
+-	int i,j;
+-
+-	this->M=pM;
+-	this->N=pN;
+-	this->matrix=NULL;
+-	if(M*N){
+-		this->matrix=xNewZeroInit<IssmDouble>(pM*pN);
+-		xMemCpy<IssmDouble>(this->matrix,serial_mat,pM*pN);
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::SeqMat(int M,int N, int connectivity, int numberofdofspernode){{{*/
+-SeqMat::SeqMat(int pM,int pN, int connectivity,int numberofdofspernode){
+-
+-	this->M=pM;
+-	this->N=pN;
+-	this->matrix=NULL;
+-	if(M*N) this->matrix=xNewZeroInit<IssmDouble>(pM*pN);
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::~SeqMat(){{{*/
+-SeqMat::~SeqMat(){
+-
+-	xDelete<IssmDouble>(this->matrix);
+-	M=0;
+-	N=0;
+-}
+-/*}}}*/
+-
+-/*SeqMat specific routines: */
+-/*FUNCTION SeqMat::Echo{{{*/
+-void SeqMat::Echo(void){
+-
+-	int i,j;
+-	_printLine_("SeqMat size " << this->M << "-" << this->N);
+-	for(i=0;i<M;i++){
+-		for(j=0;j<N;j++){
+-			_printString_(this->matrix[N*i+j] << " ");
+-		}
+-		_printLine_("");
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::Assemble{{{*/
+-void SeqMat::Assemble(void){
+-		
+-	/*do nothing*/
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::Norm{{{*/
+-IssmDouble SeqMat::Norm(NormMode mode){
+-
+-	IssmDouble norm;
+-	IssmDouble absolute;
+-	int i,j;
+-
+-	switch(mode){
+-		case NORM_INF:
+-			norm=0;
+-			for(i=0;i<this->M;i++){
+-				absolute=0;
+-				for(j=0;j<this->N;j++){
+-					absolute+=fabs(this->matrix[N*i+j]);
+-				}
+-				norm=max(norm,absolute);
+-			}
+-			return norm;
+-			break;
+-		default:
+-			_error_("unknown norm !");
+-			break;
+-	}
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::GetSize{{{*/
+-void SeqMat::GetSize(int* pM,int* pN){
+-
+-	*pM=this->M;
+-	*pN=this->N;
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::GetLocalSize{{{*/
+-void SeqMat::GetLocalSize(int* pM,int* pN){
+-	
+-	*pM=this->M;
+-	*pN=this->N;
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::MatMult{{{*/
+-void SeqMat::MatMult(SeqVec* X,SeqVec* AX){
+-
+-	int i,j;
+-	int XM,AXM;
+-	IssmDouble dummy;
+-
+-	X->GetSize(&XM);
+-	AX->GetSize(&AXM);
+-
+-	if(M!=AXM)_error_("A and AX should have the same number of rows!");
+-	if(N!=XM)_error_("A and X should have the same number of columns!");
+-
+-	for(i=0;i<M;i++){
+-		dummy=0;
+-		for(j=0;j<N;j++){
+-			dummy+= this->matrix[N*i+j]*X->vector[j];
+-		}
+-		AX->vector[i]=dummy;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::Duplicate{{{*/
+-SeqMat* SeqMat::Duplicate(void){
+-
+-	IssmDouble dummy=0;
+-
+-	return new SeqMat(this->matrix,this->M,this->N,dummy);
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::ToSerial{{{*/
+-IssmDouble* SeqMat::ToSerial(void){
+-
+-	IssmDouble* buffer=NULL;
+-
+-	if(this->M*this->N){
+-		buffer=xNew<IssmDouble>(this->M*this->N);
+-		xMemCpy<IssmDouble>(buffer,this->matrix,this->M*this->N);
+-	}
+-	return buffer;
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::SetValues{{{*/
+-void SeqMat::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){
+-	
+-	int i,j;
+-	switch(mode){
+-		case ADD_VAL:
+-			for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]+=values[n*i+j];
+-			break;
+-		case INS_VAL:
+-			for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]=values[n*i+j];
+-			break;
+-		default:
+-			_error_("unknown insert mode!");
+-			break;
+-	}
+-
+-}
+-/*}}}*/
+-/*FUNCTION SeqMat::Convert{{{*/
+-void SeqMat::Convert(MatrixType type){
+-
+-	/*do nothing*/
+-
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.h	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/toolkits/issm/SeqVec.h	(revision 13229)
+@@ -40,6 +40,14 @@
+ 			this->vector=NULL;
+ 		}
+ 		/*}}}*/
++		/*FUNCTION SeqVec(int M){{{*/
++		SeqVec(int pM){
++
++			this->M=pM;
++			this->vector=NULL;
++			if(this->M) this->vector=xNewZeroInit<doubletype>(pM);
++		}
++		/*}}}*/
+ 		/*FUNCTION SeqVec(int M,bool fromlocalsize){{{*/
+ 		SeqVec(int pM,bool fromlocalsize){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/matrix/Vector.h	(revision 13229)
+@@ -25,12 +25,11 @@
+ 
+ 	public:
+ 
++		int  type;
+ 		#ifdef _HAVE_PETSC_
+ 		PetscVec* pvector;
+ 		#endif
+ 		SeqVec<doubletype>* svector; 
+-		int     type;
+-	
+ 
+ 		/*Vector constructors, destructors */
+ 		/*FUNCTION Vector(){{{*/
+@@ -81,6 +80,7 @@
+ 		Vector(doubletype* serial_vec,int M,int in_type=PetscVecType){
+ 		#else
+ 		Vector(doubletype* serial_vec,int M,int in_type=SeqVecType){
++			//} for vim
+ 		#endif
+ 
+ 			#ifdef _HAVE_PETSC_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13229)
+@@ -28,38 +28,36 @@
+ 	int i,j;
+ 
+ 	/* required input: */
+-	double* x=NULL;
+-	double* y=NULL;
+ 	int     edgevalue;
+-	char*   interptype=NULL;
++	double *x          = NULL;
++	double *y          = NULL;
++	char   *interptype = NULL;
+ 
+ 	/* output: */
+-	Vector<double>*  flags=NULL;
++	SeqVec<double> *flags = NULL;
+ 	int  nods;
+ 
+-	//contours
+-	mxArray*  matlabstructure=NULL;
++	/*contours*/
+ 	int numcontours;
+-	Contour<double>** contours=NULL;
+-	Contour<double>*  contouri=NULL;
++	mxArray         *matlabstructure = NULL;
++	Contour<double> **contours       = NULL;
++	Contour<double> *contouri        = NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+ 
+ 	/*checks on arguments on the matlab side: */
+ 	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ContourToNodesUsage);
+-
+ 	
+ 	/*Fetch inputs: */
+ 	FetchData(&x,&nods,NULL,XHANDLE);
+ 	FetchData(&y,NULL,NULL,YHANDLE);
+ 	FetchData(&edgevalue,EDGEVALUEHANDLE);
+ 
+-	//Fetch contours
+-
++	/*Fetch contours*/
+ 	if(mxIsChar(FILENAME)){
+ 		/*Call expread on filename to build a contour array in the matlab workspace: */
+-		mexCallMATLAB( 1, &matlabstructure, 1, (mxArray**)&FILENAME, "expread");
++		mexCallMATLAB(1,&matlabstructure,1,(mxArray**)&FILENAME,"expread");
+ 	}
+ 	else{
+ 		/*FILENAME is actually a structure, coming directly from expread: */
+@@ -79,17 +77,6 @@
+ 		*(contours+i)=contouri;
+ 	}
+ 
+-	/* Debugging of contours :{{{1*/
+-	/*for(i=0;i<numcontours;i++){
+-		_printLine_("\nContour echo: contour number  " << i+1 << " / " << numcontours);
+-		contouri=*(contours+i);
+-		_printLine_("   Number of nodes " << contouri->nods);
+-		for (j=0;j<contouri->nods;j++){
+-			_printLine_("   " << *(contouri->x+j) << "f " << *(contouri->y+j) << "f");
+-		}
+-	}*/
+-	/*}}}*/
+-
+ 	/*Run interpolation routine: */
+ 	ContourToNodesx(&flags,x,y,nods,contours,numcontours,edgevalue);
+ 
+@@ -98,7 +85,6 @@
+ 
+ 	/*end module: */
+ 	MODULEEND();
+-
+ }
+ 
+ void ContourToNodesUsage(void){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 13229)
+@@ -54,7 +54,7 @@
+ 	int nods_prime;
+ 
+ 	/* output: */
+-	Vector<double>*  data_prime=NULL;
++	SeqVec<double>*  data_prime=NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+@@ -95,8 +95,7 @@
+ 	MODULEEND();
+ }
+ 
+-void InterpFromMeshToMesh3dUsage(void)
+-{
++void InterpFromMeshToMesh3dUsage(void){
+ 	_pprintLine_("INTERPFROMMESHTOMESH3D - interpolation from a 3d hexahedron mesh onto a list of point");
+ 	_pprintLine_("");
+ 	_pprintLine_("   This function is a multi-threaded mex file that interpolates a field");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 13229)
+@@ -24,25 +24,24 @@
+ 	int i,j;
+ 
+ 	/*input: */
+-	double* x=NULL;
+-	double* y=NULL;
++	double *x = NULL;
++	double *y = NULL;
+ 	int     x_rows,y_rows;
+-	double* data=NULL; 
++	double *data  = NULL;
+ 	int     data_rows,data_cols;
+-	double* x_mesh=NULL;
+-	double* y_mesh=NULL;
++	double *x_mesh = NULL;
++	double *y_mesh = NULL;
+ 	int     x_mesh_rows,y_mesh_rows;
+ 	double  default_value;
+ 	int     interpolationenum;
+ 
+ 	/* output: */
+-	Vector<double>*  data_mesh=NULL;
++	SeqVec<double>*  data_mesh=NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+ 
+ 	/*checks on arguments on the matlab side: */
+-	//CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InterpFromGridToMeshUsage);
+ 	if((nlhs!=NLHS) || (nrhs!=6 && nrhs!=7)){
+ 		InterpFromGridToMeshUsage();
+ 		_error_("usage. See above");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp	(revision 13229)
+@@ -9,14 +9,14 @@
+ 	int i,j;
+ 
+ 	/* required input: */
+-	double* x=NULL;
+-	double* y=NULL;
++	double *x = NULL;
++	double *y = NULL;
+ 	int     nods;
+ 	double  mindistance;
+ 	double  multithread;
+ 
+ 	/* output: */
+-	Vector<double>*  flags=NULL;
++	SeqVec<double> *flags = NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13229)
+@@ -1,21 +1,5 @@
+ /*!\file InterpFromMesh2d.c
+  * \brief: data interpolation from a list of (x,y,values) into mesh vertices
+- 
+-	InterpFromMesh2d.c
+-
+-	usage:
+-	data_mesh=InterpFromMesh2d(index,x,y,data,x_mesh,y_mesh);
+-	
+-	where:
+-
+-		input:
+-		x,y: coordinates of matrix data
+-		data - matrix holding the data to be interpolated onto the mesh.
+-		x_mesh,y_mesh: coordinates of the mesh vertices onto which we interpolate.
+-		
+-		output: 
+-		data_mesh:  vector of mesh interpolated data.
+-
+ */
+ 	
+ #include "./InterpFromMesh2d.h"
+@@ -47,12 +31,12 @@
+ 	double* default_values=NULL;
+ 	int     num_default_values=0;
+ 
+-	//contours
+-	mxArray*  matlabstructure=NULL;
+-	Contour<double>** contours=NULL;
+-	int       numcontours;
+-	Contour<double>*  contouri=NULL;
+-	int       i;
++	/*contours*/
++	int i;
++	mxArray *matlabstructure = NULL;
++	Contour<double> **contours=NULL;
++	int numcontours;
++	Contour<double> *contouri=NULL;
+ 
+ 	/*Intermediary*/
+ 	int nods_data;
+@@ -60,7 +44,7 @@
+ 	int nods_prime;
+ 
+ 	/* output: */
+-	Vector<double>*  data_prime=NULL;
++	SeqVec<double> *data_prime = NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13228)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13229)
+@@ -36,8 +36,8 @@
+ 	DataSet* contours  = NULL;
+ 
+ 	/* output: */
+-	Vector<double> *in_nod  = NULL;
+-	Vector<double> *in_elem = NULL;
++	SeqVec<double> *in_nod  = NULL;
++	SeqVec<double> *in_elem = NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
Index: /issm/oecreview/Archive/12678-13393/ISSM-13229-13230.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13229-13230.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13229-13230.diff	(revision 13394)
@@ -0,0 +1,52 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13229)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13230)
+@@ -26,16 +26,16 @@
+ void controltao_core(FemModel* femmodel){
+ 
+ 	/*TAO*/
+-	int        ierr;
+-	int        num_controls,solution_type;
+-	int        nsteps,maxiter;
+-	AppCtx     user;
+-	TaoSolver  tao = 0;
+-	IssmDouble    *dummy          = NULL;
+-	int       *control_list   = NULL;
+-	Vector    *X              = NULL;
+-	Vector    *XL             = NULL;
+-	Vector    *XU             = NULL;
++	int                 ierr;
++	int                 num_controls,solution_type;
++	int                 nsteps,maxiter;
++	AppCtx              user;
++	TaoSolver           tao = 0;
++	IssmDouble         *dummy        = NULL;
++	int                *control_list = NULL;
++	Vector<IssmDouble> *X            = NULL;
++	Vector<IssmDouble> *XL           = NULL;
++	Vector<IssmDouble> *XU           = NULL;
+ 
+ 	/*Initialize TAO*/
+ 	int argc; char **args=NULL;
+@@ -105,13 +105,13 @@
+ int FormFunctionGradient(TaoSolver tao, Vec Xpetsc, IssmDouble *fcn,Vec G,void *userCtx){
+ 
+ 	/*Retreive arguments*/
+-	int       solution_type,num_cost_functions;
+-	AppCtx   *user           = (AppCtx *)userCtx;
+-	FemModel *femmodel       = user->femmodel;
+-	int      *cost_functions = NULL;
+-	IssmDouble   *cost_functionsd= NULL;
+-	Vector   *gradient       = NULL;
+-	Vector   *X              = NULL;
++	int                  solution_type,num_cost_functions;
++	AppCtx              *user            = (AppCtx *)userCtx;
++	FemModel            *femmodel        = user->femmodel;
++	int                 *cost_functions  = NULL;
++	IssmDouble          *cost_functionsd = NULL;
++	Vector<IssmDouble>  *gradient        = NULL;
++	Vector<IssmDouble>  *X               = NULL;
+ 
+ 	/*Convert input to Vec*/
+ 	X=new Vector(Xpetsc);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13230-13231.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13230-13231.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13230-13231.diff	(revision 13394)
@@ -0,0 +1,45 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/include/matlab_macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/include/matlab_macros.h	(revision 13230)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/include/matlab_macros.h	(revision 13231)
+@@ -18,13 +18,10 @@
+ 
+ /*The following macros hide the error exception handling in a matlab module. Just put 
+  * MODULEBOOT(); and MODULEEND(); at the beginning and end of a module, and c++ exceptions 
+- * will be trapped. Really nifty!*/
+-//exception.Report(); 
++ * will be trapped*/
++#define MODULEBOOT(); try{ 
+ 
+-#define MODULEBOOT(); ModuleBoot(); \
+-	try{
+-
+-#define MODULEEND(); ModuleEnd(); }\
++#define MODULEEND(); }\
+ 	catch(ErrorException &exception){\
+ 		mexErrMsgTxt("ISSM Error"); \
+ 	}\
+@@ -34,10 +31,9 @@
+ 	catch(...){\
+ 		mexErrMsgTxt("An unexpected error occurred");\
+ 	}
+-//}}}
++/*}}}*/
+ /* WRAPPER {{{*/
+ #define WRAPPER(modulename,...) void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) 
+-
+ /*}}}*/
+ /* CHECKARGUMENTS {{{*/
+ #define CHECKARGUMENTS(NLHS,NRHS,functionpointer) CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,functionpointer)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Wrapper/ModuleBoot.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Wrapper/ModuleBoot.cpp	(revision 13230)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Wrapper/ModuleBoot.cpp	(revision 13231)
+@@ -11,7 +11,6 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-
+ int ModuleBoot(void){
+ 	
+ 	/*Some test for MPI_Init crash with mpich2 1.4 on larsen, just ignore*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-13231-13232.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13231-13232.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13231-13232.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13231)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13232)
+@@ -114,7 +114,7 @@
+ 	Vector<IssmDouble>  *X               = NULL;
+ 
+ 	/*Convert input to Vec*/
+-	X=new Vector(Xpetsc);
++	X=new Vector<IssmDouble>(Xpetsc);
+ 
+ 	/*Set new variable*/
+ 	//VecView(X,PETSC_VIEWER_STDOUT_WORLD);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13232-13233.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13232-13233.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13232-13233.diff	(revision 13394)
@@ -0,0 +1,120 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/79North.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/79North.par	(revision 13232)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/79North.par	(revision 13233)
+@@ -1,7 +1,13 @@
+ %Start defining model parameters here
+ 
+ %Geometry and observation
+-load('../Data/79North.data','-mat');
++x=transpose(ncread('../Data/79North.nc','x'));
++y=transpose(ncread('../Data/79North.nc','y'));
++vx=transpose(ncread('../Data/79North.nc','vx'));
++vy=transpose(ncread('../Data/79North.nc','vy'));
++index=transpose(ncread('../Data/79North.nc','index'));
++surface=transpose(ncread('../Data/79North.nc','surface'));
++thickness=transpose(ncread('../Data/79North.nc','thickness'));
+ 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);
+ md.geometry.surface  =InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetShelf.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetShelf.par	(revision 13232)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetShelf.par	(revision 13233)
+@@ -13,7 +13,11 @@
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+ %Initial velocity 
+-load('../Data/SquareSheetShelf.data','-mat');
++x=transpose(ncread('../Data/SquareSheetShelf.nc','x'));
++y=transpose(ncread('../Data/SquareSheetShelf.nc','y'));
++vx=transpose(ncread('../Data/SquareSheetShelf.nc','vx'));
++vy=transpose(ncread('../Data/SquareSheetShelf.nc','vy'));
++index=transpose(ncread('../Data/SquareSheetShelf.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;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par	(revision 13232)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par	(revision 13233)
+@@ -10,7 +10,11 @@
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+ %Initial velocity 
+-load('../Data/SquareShelfConstrained.data','-mat');
++x=transpose(ncread('../Data/SquareShelfConstrained.nc','x'));
++y=transpose(ncread('../Data/SquareShelfConstrained.nc','y'));
++vx=transpose(ncread('../Data/SquareShelfConstrained.nc','vx'));
++vy=transpose(ncread('../Data/SquareShelfConstrained.nc','vy'));
++index=transpose(ncread('../Data/SquareShelfConstrained.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;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/Pig.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/Pig.par	(revision 13232)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/Pig.par	(revision 13233)
+@@ -1,7 +1,13 @@
+ %Start defining model parameters here
+ 
+ %Geometry and observation
+-load('../Data/Pig.data','-mat');
++x=transpose(ncread('../Data/Pig.nc','x'));
++y=transpose(ncread('../Data/Pig.nc','y'));
++vx_obs=transpose(ncread('../Data/Pig.nc','vx_obs'));
++vy_obs=transpose(ncread('../Data/Pig.nc','vy_obs'));
++index=transpose(ncread('../Data/Pig.nc','index'));
++surface=transpose(ncread('../Data/Pig.nc','surface'));
++thickness=transpose(ncread('../Data/Pig.nc','thickness'));
+ md.inversion.vx_obs   =InterpFromMeshToMesh2d(index,x,y,vx_obs,md.mesh.x,md.mesh.y);
+ md.inversion.vy_obs   =InterpFromMeshToMesh2d(index,x,y,vy_obs,md.mesh.x,md.mesh.y);
+ md.geometry.surface  =InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelf.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelf.par	(revision 13232)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelf.par	(revision 13233)
+@@ -10,7 +10,11 @@
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+ %Initial velocity and pressure
+-load('../Data/SquareShelf.data','-mat');
++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;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetConstrained.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetConstrained.par	(revision 13232)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetConstrained.par	(revision 13233)
+@@ -10,7 +10,11 @@
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+ %Initial velocity 
+-load('../Data/SquareSheetConstrained.data','-mat');
++x=transpose(ncread('../Data/SquareSheetConstrained.nc','x'));
++y=transpose(ncread('../Data/SquareSheetConstrained.nc','y'));
++vx=transpose(ncread('../Data/SquareSheetConstrained.nc','vx'));
++vy=transpose(ncread('../Data/SquareSheetConstrained.nc','vy'));
++index=transpose(ncread('../Data/SquareSheetConstrained.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;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPE.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPE.par	(revision 13232)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/ISMIPE.par	(revision 13233)
+@@ -1,8 +1,7 @@
+ %Ok, start defining model parameters here
+ 
+ disp('      creating thickness');
+-data=load('../Data/ISMIPE.data','-mat');
+-data=data.data;
++data=transpose(ncread('../Data/ISMIPE.nc','data'));
+ md.geometry.surface=zeros(md.mesh.numberofvertices,1);
+ md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+ for i=1:md.mesh.numberofvertices
Index: /issm/oecreview/Archive/12678-13393/ISSM-13233-13234.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13233-13234.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13233-13234.diff	(revision 13394)
@@ -0,0 +1,109 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetShelf.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetShelf.par	(revision 13233)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetShelf.par	(revision 13234)
+@@ -13,11 +13,11 @@
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+ %Initial velocity 
+-x=transpose(ncread('../Data/SquareSheetShelf.nc','x'));
+-y=transpose(ncread('../Data/SquareSheetShelf.nc','y'));
+-vx=transpose(ncread('../Data/SquareSheetShelf.nc','vx'));
+-vy=transpose(ncread('../Data/SquareSheetShelf.nc','vy'));
+-index=transpose(ncread('../Data/SquareSheetShelf.nc','index'));
++x     = transpose(ncread('../Data/SquareSheetShelf.nc','x'));
++y     = transpose(ncread('../Data/SquareSheetShelf.nc','y'));
++vx    = transpose(ncread('../Data/SquareSheetShelf.nc','vx'));
++vy    = transpose(ncread('../Data/SquareSheetShelf.nc','vy'));
++index = transpose(ncread('../Data/SquareSheetShelf.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;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par	(revision 13233)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.par	(revision 13234)
+@@ -10,11 +10,11 @@
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+ %Initial velocity 
+-x=transpose(ncread('../Data/SquareShelfConstrained.nc','x'));
+-y=transpose(ncread('../Data/SquareShelfConstrained.nc','y'));
+-vx=transpose(ncread('../Data/SquareShelfConstrained.nc','vx'));
+-vy=transpose(ncread('../Data/SquareShelfConstrained.nc','vy'));
+-index=transpose(ncread('../Data/SquareShelfConstrained.nc','index'));
++x     = transpose(ncread('../Data/SquareShelfConstrained.nc','x'));
++y     = transpose(ncread('../Data/SquareShelfConstrained.nc','y'));
++vx    = transpose(ncread('../Data/SquareShelfConstrained.nc','vx'));
++vy    = transpose(ncread('../Data/SquareShelfConstrained.nc','vy'));
++index = transpose(ncread('../Data/SquareShelfConstrained.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;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/Pig.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/Pig.par	(revision 13233)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/Pig.par	(revision 13234)
+@@ -1,13 +1,13 @@
+ %Start defining model parameters here
+ 
+ %Geometry and observation
+-x=transpose(ncread('../Data/Pig.nc','x'));
+-y=transpose(ncread('../Data/Pig.nc','y'));
+-vx_obs=transpose(ncread('../Data/Pig.nc','vx_obs'));
+-vy_obs=transpose(ncread('../Data/Pig.nc','vy_obs'));
+-index=transpose(ncread('../Data/Pig.nc','index'));
+-surface=transpose(ncread('../Data/Pig.nc','surface'));
+-thickness=transpose(ncread('../Data/Pig.nc','thickness'));
++x         = transpose(ncread('../Data/Pig.nc','x'));
++y         = transpose(ncread('../Data/Pig.nc','y'));
++vx_obs    = transpose(ncread('../Data/Pig.nc','vx_obs'));
++vy_obs    = transpose(ncread('../Data/Pig.nc','vy_obs'));
++index     = transpose(ncread('../Data/Pig.nc','index'));
++surface   = transpose(ncread('../Data/Pig.nc','surface'));
++thickness = transpose(ncread('../Data/Pig.nc','thickness'));
+ md.inversion.vx_obs   =InterpFromMeshToMesh2d(index,x,y,vx_obs,md.mesh.x,md.mesh.y);
+ md.inversion.vy_obs   =InterpFromMeshToMesh2d(index,x,y,vy_obs,md.mesh.x,md.mesh.y);
+ md.geometry.surface  =InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelf.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelf.par	(revision 13233)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelf.par	(revision 13234)
+@@ -10,11 +10,11 @@
+ md.geometry.surface=md.geometry.bed+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'));
++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;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetConstrained.par
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetConstrained.par	(revision 13233)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareSheetConstrained.par	(revision 13234)
+@@ -10,11 +10,11 @@
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+ %Initial velocity 
+-x=transpose(ncread('../Data/SquareSheetConstrained.nc','x'));
+-y=transpose(ncread('../Data/SquareSheetConstrained.nc','y'));
+-vx=transpose(ncread('../Data/SquareSheetConstrained.nc','vx'));
+-vy=transpose(ncread('../Data/SquareSheetConstrained.nc','vy'));
+-index=transpose(ncread('../Data/SquareSheetConstrained.nc','index'));
++x     = transpose(ncread('../Data/SquareSheetConstrained.nc','x'));
++y     = transpose(ncread('../Data/SquareSheetConstrained.nc','y'));
++vx    = transpose(ncread('../Data/SquareSheetConstrained.nc','vx'));
++vy    = transpose(ncread('../Data/SquareSheetConstrained.nc','vy'));
++index = transpose(ncread('../Data/SquareSheetConstrained.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;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13234-13235.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13234-13235.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13234-13235.diff	(revision 13394)
@@ -0,0 +1,1019 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h	(revision 13235)
+@@ -29,8 +29,8 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define ELEMENTS (mxArray*)prhs[0]
+-#define NUMNODES (mxArray*)prhs[1]
++#define ELEMENTS prhs[0]
++#define NUMNODES prhs[1]
+ /* serial output macros: */
+ #define CONNECTIVITY (mxArray**)&plhs[0]
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13235)
+@@ -31,14 +31,23 @@
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define INDEXHANDLE prhs[0]
+-#define XHANDLE prhs[1]
+-#define YHANDLE prhs[2]
+-
++#define XHANDLE     prhs[1]
++#define YHANDLE     prhs[2]
+ /* serial output macros: */
+ #define BAMGMESHOUT    (mxArray**)&plhs[0]
+ #define BAMGGEOMOUT    (mxArray**)&plhs[1]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define INDEXHANDLE PyTuple_GetItem(args,0)
++#define XHANDLE     PyTuple_GetItem(args,1)
++#define YHANDLE     PyTuple_GetItem(args,2)
++/* serial output macros: */
++#define BAMGMESHOUT    output,0
++#define BAMGGEOMOUT    output,1
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h	(revision 13235)
+@@ -30,12 +30,18 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define FILENAME      prhs[0]
+-
++#define FILENAME  prhs[0]
+ /* serial output macros: */
+ #define ERRORFLAG (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define FILENAME  PyTuple_GetItem(args,0)
++/* serial output macros: */
++#define ERRORFLAG output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NRHS
+ #define NRHS  1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13235)
+@@ -30,15 +30,26 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* input macros: */
+-#define XHANDLE prhs[0]
+-#define YHANDLE prhs[1]
+-#define FILENAME prhs[2]
++#define XHANDLE         prhs[0]
++#define YHANDLE         prhs[1]
++#define FILENAME        prhs[2]
+ #define EDGEVALUEHANDLE prhs[3]
+ 
+ /* serial output macros: */
+ #define FLAGS (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* input macros: */
++#define XHANDLE         PyTuple_GetItem(args,0)
++#define YHANDLE         PyTuple_GetItem(args,1)
++#define FILENAME        PyTuple_GetItem(args,2)
++#define EDGEVALUEHANDLE PyTuple_GetItem(args,3)
++
++/* serial output macros: */
++#define FLAGS output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS 1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h	(revision 13235)
+@@ -31,10 +31,17 @@
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define IMAGEIN prhs[0]
+-#define SMOOTH prhs[1]
++#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 &plhs[0]
++#define IMAGEOUT output,0
+ #endif
+ 
+ /* serial arg counts: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h	(revision 13235)
+@@ -30,15 +30,24 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* input macros: */
+-#define INDEX prhs[0]
+-#define X prhs[1]
+-#define Y prhs[2]
++#define INDEX    prhs[0]
++#define X        prhs[1]
++#define Y        prhs[2]
+ #define FILENAME prhs[3]
+-
+ /* serial output macros: */
+ #define SEGMENTS (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* input macros: */
++#define INDEX    PyTuple_GetItem(args,0)
++#define X        PyTuple_GetItem(args,1)
++#define Y        PyTuple_GetItem(args,2)
++#define FILENAME PyTuple_GetItem(args,3)
++/* serial output macros: */
++#define SEGMENTS output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS 1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h	(revision 13235)
+@@ -30,20 +30,34 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define INDEXHANDLE prhs[0]
+-#define XHANDLE prhs[1]
+-#define YHANDLE prhs[2]
+-#define ZHANDLE prhs[3]
+-#define DATAHANDLE prhs[4]
+-#define XPRIMEHANDLE prhs[5]
+-#define YPRIMEHANDLE prhs[6]
+-#define ZPRIMEHANDLE prhs[7]
++#define INDEXHANDLE   prhs[0]
++#define XHANDLE       prhs[1]
++#define YHANDLE       prhs[2]
++#define ZHANDLE       prhs[3]
++#define DATAHANDLE    prhs[4]
++#define XPRIMEHANDLE  prhs[5]
++#define YPRIMEHANDLE  prhs[6]
++#define ZPRIMEHANDLE  prhs[7]
+ #define DEFAULTHANDLE prhs[8]
+-
+ /* serial output macros: */
+ #define DATAPRIME (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define INDEXHANDLE   PyTuple_GetItem(args,0)
++#define XHANDLE       PyTuple_GetItem(args,1)
++#define YHANDLE       PyTuple_GetItem(args,2)
++#define ZHANDLE       PyTuple_GetItem(args,3)
++#define DATAHANDLE    PyTuple_GetItem(args,4)
++#define XPRIMEHANDLE  PyTuple_GetItem(args,5)
++#define YPRIMEHANDLE  PyTuple_GetItem(args,6)
++#define ZPRIMEHANDLE  PyTuple_GetItem(args,7)
++#define DEFAULTHANDLE PyTuple_GetItem(args,8)
++/* serial output macros: */
++#define DATAPRIME output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h	(revision 13235)
+@@ -30,13 +30,22 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define LAT_IN    prhs[0]
+-#define LON_IN    prhs[1]
+-#define SGN_IN    prhs[2]
++#define LAT_IN prhs[0]
++#define LON_IN prhs[1]
++#define SGN_IN prhs[2]
++/* serial output macros: */
++#define X_OUT (mxArray**)&plhs[0]
++#define Y_OUT (mxArray**)&plhs[1]
++#endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define LAT_IN PyTuple_GetItem(args,0)
++#define LON_IN PyTuple_GetItem(args,1)
++#define SGN_IN PyTuple_GetItem(args,2)
+ /* serial output macros: */
+-#define X_OUT    (mxArray**)&plhs[0]
+-#define Y_OUT    (mxArray**)&plhs[1]
++#define X_OUT output,0
++#define Y_OUT output,1
+ #endif
+ 
+ /* serial arg counts: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h	(revision 13235)
+@@ -30,13 +30,22 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define BAMGMESHIN  (mxArray*)prhs[0]
+-#define BAMGGEOMIN  (mxArray*)prhs[1]
+-#define BAMGOPTIONS (mxArray*)prhs[2]
++#define BAMGMESHIN  prhs[0]
++#define BAMGGEOMIN  prhs[1]
++#define BAMGOPTIONS prhs[2]
++/* serial output macros: */
++#define BAMGMESHOUT (mxArray**)&plhs[0]
++#define BAMGGEOMOUT (mxArray**)&plhs[1]
++#endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define BAMGMESHIN  PyTuple_GetItem(args,0)
++#define BAMGGEOMIN  PyTuple_GetItem(args,1)
++#define BAMGOPTIONS PyTuple_GetItem(args,2)
+ /* serial output macros: */
+-#define BAMGMESHOUT    (mxArray**)&plhs[0]
+-#define BAMGGEOMOUT    (mxArray**)&plhs[1]
++#define BAMGMESHOUT output,0
++#define BAMGGEOMOUT output,1
+ #endif
+ 
+ /* serial arg counts: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 13235)
+@@ -30,18 +30,30 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define XHANDLE prhs[0]
+-#define YHANDLE prhs[1]
+-#define DATAHANDLE prhs[2]
+-#define XMESHHANDLE prhs[3]
+-#define YMESHHANDLE prhs[4]
++#define XHANDLE       prhs[0]
++#define YHANDLE       prhs[1]
++#define DATAHANDLE    prhs[2]
++#define XMESHHANDLE   prhs[3]
++#define YMESHHANDLE   prhs[4]
+ #define DEFAULTHANDLE prhs[5]
+-#define INTERPENUM prhs[6]
+-
++#define INTERPENUM    prhs[6]
+ /* serial output macros: */
+ #define DATAMESH (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define XHANDLE       PyTuple_GetItem(args,0)
++#define YHANDLE       PyTuple_GetItem(args,1)
++#define DATAHANDLE    PyTuple_GetItem(args,2)
++#define XMESHHANDLE   PyTuple_GetItem(args,3)
++#define YMESHHANDLE   PyTuple_GetItem(args,4)
++#define DEFAULTHANDLE PyTuple_GetItem(args,5)
++#define INTERPENUM    PyTuple_GetItem(args,6)
++/* serial output macros: */
++#define DATAMESH output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h	(revision 13235)
+@@ -30,24 +30,42 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define INDEX (mxArray*)prhs[0]
+-#define X (mxArray*)prhs[1]
+-#define Y (mxArray*)prhs[2]
+-#define MESHDATA (mxArray*)prhs[3]
+-#define XMIN (mxArray*)prhs[4]
+-#define YMAX (mxArray*)prhs[5]
+-#define XPOSTING (mxArray*)prhs[6]
+-#define YPOSTING (mxArray*)prhs[7]
+-#define NLINES (mxArray*)prhs[8]
+-#define NCOLS (mxArray*)prhs[9]
+-#define DEFAULTVALUE (mxArray*)prhs[10]
+-
++#define INDEX        prhs[0]
++#define X            prhs[1]
++#define Y            prhs[2]
++#define MESHDATA     prhs[3]
++#define XMIN         prhs[4]
++#define YMAX         prhs[5]
++#define XPOSTING     prhs[6]
++#define YPOSTING     prhs[7]
++#define NLINES       prhs[8]
++#define NCOLS        prhs[9]
++#define DEFAULTVALUE prhs[10]
+ /* serial output macros: */
+ #define XM (mxArray**)&plhs[0]
+ #define YM (mxArray**)&plhs[1]
+ #define GRIDDATA (mxArray**)&plhs[2]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define INDEX        PyTuple_GetItem(args,0)
++#define X            PyTuple_GetItem(args,1)
++#define Y            PyTuple_GetItem(args,2)
++#define MESHDATA     PyTuple_GetItem(args,3)
++#define XMIN         PyTuple_GetItem(args,4)
++#define YMAX         PyTuple_GetItem(args,5)
++#define XPOSTING     PyTuple_GetItem(args,6)
++#define YPOSTING     PyTuple_GetItem(args,7)
++#define NLINES       PyTuple_GetItem(args,8)
++#define NCOLS        PyTuple_GetItem(args,9)
++#define DEFAULTVALUE PyTuple_GetItem(args,10)
++/* serial output macros: */
++#define XM output,0
++#define YM output,1
++#define GRIDDATA output,2
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  3
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h	(revision 13235)
+@@ -30,12 +30,18 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define FILENAME      prhs[0]
+-
++#define FILENAME prhs[0]
+ /* serial output macros: */
+ #define ERRORFLAG (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define FILENAME PyTuple_GetItem(args,0)
++/* serial output macros: */
++#define ERRORFLAG output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NRHS
+ #define NRHS  1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h	(revision 13235)
+@@ -30,12 +30,20 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define SHP_IN    prhs[0]
+-#define KML_IN    prhs[1]
+-#define SGN_IN    prhs[2]
++#define SHP_IN  prhs[0]
++#define KML_IN  prhs[1]
++#define SGN_IN  prhs[2]
++/* serial output macros: */
++#define RET_OUT (mxArray**)&plhs[0]
++#endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define SHP_IN PyTuple_GetItem(args,0)
++#define KML_IN PyTuple_GetItem(args,1)
++#define SGN_IN PyTuple_GetItem(args,2)
+ /* serial output macros: */
+-#define RET_OUT    (mxArray**)&plhs[0]
++#define RET_OUT output,0
+ #endif
+ 
+ /* serial arg counts: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h	(revision 13235)
+@@ -31,10 +31,17 @@
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define IMAGEIN prhs[0]
+-#define SMOOTH prhs[1]
++#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 &plhs[0]
++#define IMAGEOUT output,0
+ #endif
+ 
+ /* serial arg counts: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h	(revision 13235)
+@@ -30,14 +30,22 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define EXP_IN    prhs[0]
+-#define KML_IN    prhs[1]
+-#define SGN_IN    prhs[2]
+-
++#define EXP_IN prhs[0]
++#define KML_IN prhs[1]
++#define SGN_IN prhs[2]
+ /* serial output macros: */
+ #define RET_OUT    (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define EXP_IN PyTuple_GetItem(args,0)
++#define KML_IN PyTuple_GetItem(args,1)
++#define SGN_IN PyTuple_GetItem(args,2)
++/* serial output macros: */
++#define RET_OUT    output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NRHS
+ #define NRHS  3
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h	(revision 13235)
+@@ -30,14 +30,22 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define KML_IN    prhs[0]
+-#define EXP_IN    prhs[1]
+-#define SGN_IN    prhs[2]
+-
++#define KML_IN prhs[0]
++#define EXP_IN prhs[1]
++#define SGN_IN prhs[2]
+ /* serial output macros: */
+ #define RET_OUT    (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define KML_IN PyTuple_GetItem(args,0)
++#define EXP_IN PyTuple_GetItem(args,1)
++#define SGN_IN PyTuple_GetItem(args,2)
++/* serial output macros: */
++#define RET_OUT    output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NRHS
+ #define NRHS  3
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h	(revision 13235)
+@@ -30,15 +30,24 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* input macros: */
+-#define XHANDLE prhs[0]
+-#define YHANDLE prhs[1]
++#define XHANDLE     prhs[0]
++#define YHANDLE     prhs[1]
+ #define MINDISTANCE prhs[2]
+ #define MULTITHREAD prhs[3]
+-
+ /* serial output macros: */
+ #define FLAGS (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* input macros: */
++#define XHANDLE     PyTuple_GetItem(args,0)
++#define YHANDLE     PyTuple_GetItem(args,1)
++#define MINDISTANCE PyTuple_GetItem(args,2)
++#define MULTITHREAD PyTuple_GetItem(args,3)
++/* serial output macros: */
++#define FLAGS output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS 1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h	(revision 13235)
+@@ -30,15 +30,24 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define CONNECTIVITY (mxArray*)prhs[0]
+-#define POOL (mxArray*)prhs[1]
+-#define INDEX (mxArray*)prhs[2]
+-#define FLAGS (mxArray*)prhs[3]
+-
++#define CONNECTIVITY prhs[0]
++#define POOL         prhs[1]
++#define INDEX        prhs[2]
++#define FLAGS        prhs[3]
+ /* serial output macros: */
+ #define POOLOUT (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define CONNECTIVITY PyTuple_GetItem(args,0)
++#define POOL         PyTuple_GetItem(args,1)
++#define INDEX        PyTuple_GetItem(args,2)
++#define FLAGS        PyTuple_GetItem(args,3)
++/* serial output macros: */
++#define POOLOUT output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h	(revision 13235)
+@@ -30,15 +30,27 @@
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+ #define INDEXHANDLE prhs[0]
+-#define XHANDLE prhs[1]
+-#define YHANDLE prhs[2]
+-#define X0HANDLE prhs[3]
+-#define Y0HANDLE prhs[4]
++#define XHANDLE     prhs[1]
++#define YHANDLE     prhs[2]
++#define X0HANDLE    prhs[3]
++#define Y0HANDLE    prhs[4]
+ 
+ /* serial output macros: */
+ #define TRIA (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define INDEXHANDLE PyTuple _GetItem(args,0)
++#define XHANDLE     PyTuple _GetItem(args,1)
++#define YHANDLE     PyTuple _GetItem(args,2)
++#define X0HANDLE    PyTuple _GetItem(args,3)
++#define Y0HANDLE    PyTuple _GetItem(args,4)
++
++/* serial output macros: */
++#define TRIA output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h	(revision 13235)
+@@ -29,12 +29,18 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define MODEL (mxArray*)prhs[0]
+-
++#define MODEL prhs[0]
+ /* serial output macros: */
+ #define FRONT (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define MODEL PyTuple_GetItem(args,0)
++/* serial output macros: */
++#define FRONT output,0]
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h	(revision 13235)
+@@ -33,14 +33,22 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define MODEL (mxArray*)prhs[0]
+-#define NUMAREAS (mxArray*)prhs[1]
+-
++#define MODEL    prhs[0]
++#define NUMAREAS prhs[1]
+ /* serial output macros: */
+ #define ELEMENTPARTITIONING (mxArray**)&plhs[0]
+ #define NODEPARTITIONING (mxArray**)&plhs[1]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define MODEL    PyTuple_GetItem(args,0)
++#define NUMAREAS PyTuple_GetItem(args,1)
++/* serial output macros: */
++#define ELEMENTPARTITIONING output,0
++#define NODEPARTITIONING output,1
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h	(revision 13235)
+@@ -30,19 +30,32 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define INDEXHANDLE prhs[0]
+-#define XHANDLE prhs[1]
+-#define YHANDLE prhs[2]
+-#define DATAHANDLE prhs[3]
+-#define XPRIMEHANDLE prhs[4]
+-#define YPRIMEHANDLE prhs[5]
++#define INDEXHANDLE   prhs[0]
++#define XHANDLE       prhs[1]
++#define YHANDLE       prhs[2]
++#define DATAHANDLE    prhs[3]
++#define XPRIMEHANDLE  prhs[4]
++#define YPRIMEHANDLE  prhs[5]
+ #define DEFAULTHANDLE prhs[6]
+-#define FILENAME prhs[7]
+-
++#define FILENAME      prhs[7]
+ /* serial output macros: */
+ #define DATAPRIME (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define INDEXHANDLE   PyTuple_GetItem(args,0)
++#define XHANDLE       PyTuple_GetItem(args,1)
++#define YHANDLE       PyTuple_GetItem(args,2)
++#define DATAHANDLE    PyTuple_GetItem(args,3)
++#define XPRIMEHANDLE  PyTuple_GetItem(args,4)
++#define YPRIMEHANDLE  PyTuple_GetItem(args,5)
++#define DEFAULTHANDLE PyTuple_GetItem(args,6)
++#define FILENAME      PyTuple_GetItem(args,7)
++/* serial output macros: */
++#define DATAPRIME output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h	(revision 13235)
+@@ -32,17 +32,15 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-/* serial input macros: */
+-#define ELEMENTS (mxArray*)prhs[0]
+-#define NODECONNECTIVITY (mxArray*)prhs[1]
++#define ELEMENTS         prhs[0]
++#define NODECONNECTIVITY prhs[1]
+ /* serial output macros: */
+ #define ELEMENTCONNECTIVITY (mxArray**)&plhs[0]
+ #endif
+ 
+ #ifdef _HAVE_PYTHON_MODULES_
+ /* serial input macros: */
+-/* serial input macros: */
+-#define ELEMENTS PyTuple_GetItem(args,0)
++#define ELEMENTS         PyTuple_GetItem(args,0)
+ #define NODECONNECTIVITY PyTuple_GetItem(args,1)
+ /* serial output macros: */
+ #define ELEMENTCONNECTIVITY output,0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h	(revision 13235)
+@@ -29,17 +29,30 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define X            (mxArray *)prhs[0]
+-#define Y            (mxArray *)prhs[1]
+-#define OBSERVATIONS (mxArray *)prhs[2]
+-#define XINTERP      (mxArray *)prhs[3]
+-#define YINTERP      (mxArray *)prhs[4]
++#define X            prhs[0]
++#define Y            prhs[1]
++#define OBSERVATIONS prhs[2]
++#define XINTERP      prhs[3]
++#define YINTERP      prhs[4]
+ 
+ /* serial output macros: */
+ #define PREDICTIONS (mxArray**)&plhs[0]
+ #define ERROR       (mxArray**)&plhs[1]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define X            PyTuple_GetItem(args,0)
++#define Y            PyTuple_GetItem(args,1)
++#define OBSERVATIONS PyTuple_GetItem(args,2)
++#define XINTERP      PyTuple_GetItem(args,3)
++#define YINTERP      PyTuple_GetItem(args,4)
++
++/* serial output macros: */
++#define PREDICTIONS output,0
++#define ERROR       output,1
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h	(revision 13235)
+@@ -37,6 +37,15 @@
+ #define INDEX (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define XHANDLE PyTuple_GetItem(args,0)
++#define YHANDLE PyTuple_GetItem(args,1)
++
++/* serial output macros: */
++#define INDEX output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h	(revision 13235)
+@@ -35,28 +35,26 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define INDEX prhs[0]
+-#define X prhs[1]
+-#define Y prhs[2]
+-#define DATA prhs[3]
+-#define XINTERP prhs[4]
+-#define YINTERP prhs[5]
+-#define ARGUMENTS prhs
+-
++#define INDEX     prhs[0]
++#define X         prhs[1]
++#define Y         prhs[2]
++#define DATA      prhs[3]
++#define XINTERP   prhs[4]
++#define YINTERP   prhs[5]
++#define ARGUMENTS prhs 
+ /* serial output macros: */
+ #define DATAINTERP (mxArray**)&plhs[0]
+ #endif
+ 
+ #ifdef _HAVE_PYTHON_MODULES_
+ /* serial input macros: */
+-#define INDEX PyTuple_GetItem(args,0)
+-#define X PyTuple_GetItem(args,1)
+-#define Y PyTuple_GetItem(args,2)
+-#define DATA PyTuple_GetItem(args,3)
+-#define XINTERP PyTuple_GetItem(args,4)
+-#define YINTERP PyTuple_GetItem(args,5)
++#define INDEX          PyTuple_GetItem(args,0)
++#define X              PyTuple_GetItem(args,1)
++#define Y              PyTuple_GetItem(args,2)
++#define DATA           PyTuple_GetItem(args,3)
++#define XINTERP        PyTuple_GetItem(args,4)
++#define YINTERP        PyTuple_GetItem(args,5)
+ #define ARGUMENTS args
+-
+ /* serial output macros: */
+ #define DATAINTERP output,0
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13235)
+@@ -32,12 +32,12 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define INDEX (mxArray *)prhs[0]
+-#define X (mxArray *)prhs[1]
+-#define Y (mxArray *)prhs[2]
+-#define CONTOURNAME (mxArray *)prhs[3]
+-#define INTERPTYPE (mxArray *)prhs[4]
+-#define EDGEVALUE (mxArray *)prhs[5]
++#define INDEX       prhs[0]
++#define X           prhs[1]
++#define Y           prhs[2]
++#define CONTOURNAME prhs[3]
++#define INTERPTYPE  prhs[4]
++#define EDGEVALUE   prhs[5]
+ /* serial output macros: */
+ #define PLHS0 (mxArray**)&plhs[0]
+ #define PLHS1 (mxArray**)&plhs[1]
+@@ -45,12 +45,12 @@
+ 
+ #ifdef _HAVE_PYTHON_MODULES_
+ /* serial input macros: */
+-#define INDEX PyTuple_GetItem(args,0)
+-#define X PyTuple_GetItem(args,1)
+-#define Y PyTuple_GetItem(args,2)
++#define INDEX       PyTuple_GetItem(args,0)
++#define X           PyTuple_GetItem(args,1)
++#define Y           PyTuple_GetItem(args,2)
+ #define CONTOURNAME PyTuple_GetItem(args,3)
+-#define INTERPTYPE PyTuple_GetItem(args,4)
+-#define EDGEVALUE PyTuple_GetItem(args,5)
++#define INTERPTYPE  PyTuple_GetItem(args,4)
++#define EDGEVALUE   PyTuple_GetItem(args,5)
+ /* serial output macros: */
+ #define PLHS0 output,0
+ #define PLHS1 output,1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h	(revision 13235)
+@@ -30,13 +30,22 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define X_IN      prhs[0]
+-#define Y_IN      prhs[1]
+-#define SGN_IN    prhs[2]
++#define X_IN   prhs[0]
++#define Y_IN   prhs[1]
++#define SGN_IN prhs[2]
++/* serial output macros: */
++#define LAT_OUT (mxArray**)&plhs[0]
++#define LON_OUT (mxArray**)&plhs[1]
++#endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define X_IN   PyTuple_GetItem(args,0)
++#define Y_IN   PyTuple_GetItem(args,1)
++#define SGN_IN PyTuple_GetItem(args,2)
+ /* serial output macros: */
+-#define LAT_OUT    (mxArray**)&plhs[0]
+-#define LON_OUT    (mxArray**)&plhs[1]
++#define LAT_OUT output,0
++#define LON_OUT output,1
+ #endif
+ 
+ /* serial arg counts: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h	(revision 13235)
+@@ -40,11 +40,26 @@
+ #define DATAHANDLE    prhs[7]
+ #define CMAPHANDLE    prhs[8]
+ #define FILENAME      prhs[9]
+-
+ /* serial output macros: */
+ #define ERRORFLAG (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define NAME          PyTuple_GetItem(args,0)
++#define NOTES         PyTuple_GetItem(args,1)
++#define ELEMHANDLE    PyTuple_GetItem(args,2)
++#define NODECONHANDLE PyTuple_GetItem(args,3)
++#define LATHANDLE     PyTuple_GetItem(args,4)
++#define LNGHANDLE     PyTuple_GetItem(args,5)
++#define PARTHANDLE    PyTuple_GetItem(args,6)
++#define DATAHANDLE    PyTuple_GetItem(args,7)
++#define CMAPHANDLE    PyTuple_GetItem(args,8)
++#define FILENAME      PyTuple_GetItem(args,9)
++/* serial output macros: */
++#define ERRORFLAG output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NRHS
+ #define NRHS 10
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 13235)
+@@ -32,9 +32,9 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define DOMAINOUTLINE  (mxArray *)prhs[0]
+-#define RIFTSOUTLINE   (mxArray *)prhs[1]
+-#define AREA           (mxArray *)prhs[2]
++#define DOMAINOUTLINE  prhs[0]
++#define RIFTSOUTLINE   prhs[1]
++#define AREA           prhs[2]
+ /* serial output macros: */
+ #define INDEX             (mxArray**)&plhs[0]
+ #define X                 (mxArray**)&plhs[1]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h	(revision 13234)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h	(revision 13235)
+@@ -34,20 +34,34 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* serial input macros: */
+-#define A_IN (mxArray*)prhs[0]
+-#define VWGTS_IN (mxArray*)prhs[1]
+-#define EWGTS_IN (mxArray*)prhs[2]
+-#define X_IN (mxArray*)prhs[3]
+-#define Y_IN (mxArray*)prhs[4]
+-#define Z_IN (mxArray*)prhs[5]
+-#define OPTNS_IN (mxArray*)prhs[6]
+-#define NPARTS_IN (mxArray*)prhs[7]
+-#define GOAL_IN (mxArray*)prhs[8]
+-
++#define A_IN      prhs[0]
++#define VWGTS_IN  prhs[1]
++#define EWGTS_IN  prhs[2]
++#define X_IN      prhs[3]
++#define Y_IN      prhs[4]
++#define Z_IN      prhs[5]
++#define OPTNS_IN  prhs[6]
++#define NPARTS_IN prhs[7]
++#define GOAL_IN   prhs[8]
+ /* serial output macros: */
+ #define ASSGN_OUT (mxArray**)&plhs[0]
+ #endif
+ 
++#ifdef _HAVE_PYTHON_MODULES_
++/* serial input macros: */
++#define A_IN      PyTuple_GetItem(args,0)
++#define VWGTS_IN  PyTuple_GetItem(args,1)
++#define EWGTS_IN  PyTuple_GetItem(args,2)
++#define X_IN      PyTuple_GetItem(args,3)
++#define Y_IN      PyTuple_GetItem(args,4)
++#define Z_IN      PyTuple_GetItem(args,5)
++#define OPTNS_IN  PyTuple_GetItem(args,6)
++#define NPARTS_IN PyTuple_GetItem(args,7)
++#define GOAL_IN   PyTuple_GetItem(args,8)
++/* serial output macros: */
++#define ASSGN_OUT output,0
++#endif
++
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
Index: /issm/oecreview/Archive/12678-13393/ISSM-13235-13236.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13235-13236.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13235-13236.diff	(revision 13394)
@@ -0,0 +1,2248 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.cpp	(revision 13236)
+@@ -7,23 +7,17 @@
+ #else
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+-
+-
+ #include "./Scotch.h"
+ 
+-/******************************/
+-/*                            */
+-/* This is the main function. */
+-/*                            */
+-/******************************/
++void GmapUsage(void){/*{{{*/
++	mexPrintf("\n");
++	mexPrintf("Usage: [maptab]=Scotch(adjmat,vertlb,vertwt,edgewt,archtyp,archpar,\n");
++	mexPrintf("                         Scotch-specific parameters);\n");
++	mexPrintf("\n");
++}/*}}}*/
++void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]){
+ 
+-void mexFunction( int nlhs,
+-				  mxArray *plhs[],
+-				  int nrhs,
+-				  const mxArray *prhs[] )
+-{
+-
+-#ifndef _HAVE_SCOTCH_ //only works if scotch library has been compiled in.
++	#ifndef _HAVE_SCOTCH_ //only works if scotch library has been compiled in.
+ 	_error_("Scotch not available! Cannot carry out Scotch partitioning!");
+ 	#else
+ 
+@@ -41,7 +35,7 @@
+ 
+ 	/* Check for proper number of arguments */
+    
+-	if      (nrhs == 0 && nlhs == 0) {
++	if (nrhs == 0 && nlhs == 0) {
+ 		GmapUsage();
+ 		return;
+ 	}
+@@ -253,15 +247,3 @@
+ 	return;
+ #endif //#ifndef _HAVE_SCOTCH_
+ }
+-
+-void GmapUsage( void )
+-{
+-
+-    mexPrintf("\n");
+-    mexPrintf("Usage: [maptab]=Scotch(adjmat,vertlb,vertwt,edgewt,archtyp,archpar,\n");
+-    mexPrintf("                         Scotch-specific parameters);\n");
+-    mexPrintf("\n");
+-
+-    return;
+-}
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Scotch/Scotch.h	(revision 13236)
+@@ -5,13 +5,9 @@
+ #ifndef _SCOTCH_H
+ #define _SCOTCH_H
+ 
+-/* local prototypes: */
+-void GmapUsage(void);
+-
+ #include <stdio.h>
+ #include <string.h>    /*  strcasecmp  */
+ #include <time.h>      /*  clock,time,difftime  */
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.cpp	(revision 13236)
+@@ -4,6 +4,11 @@
+ 
+ #include "./NodeConnectivity.h"
+ 
++void NodeConnectivityUsage(void){/*{{{*/
++	_pprintLine_("");
++	_pprintLine_("   usage: connectivity = " << __FUNCT__ << "(elements, numnodes);");
++	_pprintLine_("");
++}/*}}}*/
+ WRAPPER(NodeConnectivity){
+ 
+ 	/*inputs: */
+@@ -34,9 +39,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void NodeConnectivityUsage(void) {
+-	_pprintLine_("");
+-	_pprintLine_("   usage: connectivity = " << __FUNCT__ << "(elements, numnodes);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h	(revision 13236)
+@@ -16,6 +16,9 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
++#undef __FUNCT__ 
++#define __FUNCT__  "NodeConnectivity"
++
+ /*Header files: */
+ #include "../../c/include/globals.h"
+ #include "../../c/toolkits/toolkits.h"
+@@ -43,16 +46,10 @@
+ #define CONNECTIVITY output,0
+ #endif
+ 
+-#undef __FUNCT__ 
+-#define __FUNCT__  "NodeConnectivity"
+-
+ /* serial arg counts: */
+ #undef NLHS
+ #define NLHS  1
+ #undef NRHS
+ #define NRHS  2
+ 
+-/* local prototypes: */
+-void NodeConnectivityUsage(void);
+-
+ #endif  /* _NODECONNECTIVITY_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp	(revision 13236)
+@@ -3,7 +3,16 @@
+  */
+ #include "./BamgConvertMesh.h"
+ 
+-void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void BamgConvertMeshUsage(void){/*{{{*/
++	_pprintString_("BAMGCONVERTMESH - convert [x y index] to a bamg geom and mesh geom");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      [bamggeom bamgmesh]=BamgConvertMesh(index,x,y);");
++	_pprintLine_("      index: index of the mesh");
++	_pprintLine_("      x,y: coordinates of the nodes");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(BamgConvertMesh){
+ 
+ 	/*input: */
+ 	int    *index      = NULL;
+@@ -52,13 +61,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void BamgConvertMeshUsage(void){
+-	_pprintString_("BAMGCONVERTMESH - convert [x y index] to a bamg geom and mesh geom");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      [bamggeom bamgmesh]=BamgConvertMesh(index,x,y);");
+-	_pprintLine_("      index: index of the mesh");
+-	_pprintLine_("      x,y: coordinates of the nodes");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void BamgConvertMeshUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp	(revision 13236)
+@@ -3,7 +3,28 @@
+  */
+ #include "./KMLOverlay.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void KMLOverlayUsage(void){/*{{{*/
++	_pprintLine_("KMLOverlay - KML file overlay module:");
++	_pprintLine_("");
++	_pprintLine_("   This module reads a list of image files and writes a KML or KMZ overlay file.");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      ierror=KMLOverlay(kmlfile,'param name',param,...);");
++	_pprintLine_("");
++	_pprintLine_("      kmlfile     KML or KMZ file name (string)");
++	_pprintLine_("");
++	_pprintLine_("      lataxis     latitude axis (double vector [south north], required)");
++	_pprintLine_("      longaxis    longitude axis (double vector [west east], required)");
++	_pprintLine_("      images      relative or http image file names (string or array of strings or cell array of strings, required)");
++	_pprintLine_("      zip         flag to zip the doc.kml and image files into kmzfile (double, non-zero for kmz)");
++	_pprintLine_("");
++	_pprintLine_("      ierror     error flag (double, non-zero for error)");
++	_pprintLine_("");
++	_pprintLine_("   Example:");
++	_pprintLine_("      KMLOverlay(kmlfile,'lataxis',[south north],'longaxis',[west east],'images',{'file1.png','http://issm/file2.png'},'zip',1);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(KMLOverlay){
+ 
+ 	int i,verbose=1;
+ 
+@@ -110,25 +131,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void KMLOverlayUsage(void){
+-	_pprintLine_("KMLOverlay - KML file overlay module:");
+-	_pprintLine_("");
+-	_pprintLine_("   This module reads a list of image files and writes a KML or KMZ overlay file.");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      ierror=KMLOverlay(kmlfile,'param name',param,...);");
+-	_pprintLine_("");
+-	_pprintLine_("      kmlfile     KML or KMZ file name (string)");
+-	_pprintLine_("");
+-	_pprintLine_("      lataxis     latitude axis (double vector [south north], required)");
+-	_pprintLine_("      longaxis    longitude axis (double vector [west east], required)");
+-	_pprintLine_("      images      relative or http image file names (string or array of strings or cell array of strings, required)");
+-	_pprintLine_("      zip         flag to zip the doc.kml and image files into kmzfile (double, non-zero for kmz)");
+-	_pprintLine_("");
+-	_pprintLine_("      ierror     error flag (double, non-zero for error)");
+-	_pprintLine_("");
+-	_pprintLine_("   Example:");
+-	_pprintLine_("      KMLOverlay(kmlfile,'lataxis',[south north],'longaxis',[west east],'images',{'file1.png','http://issm/file2.png'},'zip',1);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void KMLOverlayUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13236)
+@@ -1,29 +1,21 @@
+ /*! \file  ContourtoNodes
+     \brief: takes a  contour file, and figures out which nodes  (x,y list)
+-    are inside this contour. 
+-
+-	usage:
+-	[flags]=ContourToNodes(x,y,contours,interptype,edgevalue);
+-	
+-	where:
+-
+-	input:
+-
+-		x,y: node cooredinates
+-		
+-		contours: structure holding sets of vertices making open contours. 
+-		
+-		interptype: string definining type of interpolation ('element', or 'node', or 'element and node');
+-
+-		edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons
+-
+-	output:
+-		flags: vector of flags (0 or 1), of size nods 
+ */
+ 	
+ #include "./ContourToNodes.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
++void ContourToNodesUsage(void){/*{{{*/
++	_printLine_("   usage:");
++	_printLine_("   [flags]=ContourToNodes(x,y,contourname,edgevalue);\n");
++	_printLine_("   where:");
++	_printLine_("      x,y: list of nodes.");
++	_printLine_("      contourname: name of .exp file containing the contours, or resulting structure from call to expread.");
++	_printLine_("      interptype: string definining type of interpolation ('element', or 'node').");
++	_printLine_("      edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.");
++	_printLine_("      flags: vector of flags (0 or 1), of size nods.");
++	_printLine_("");
++}/*}}}*/
++WRAPPER(ContourToNodes){
+ 
+ 	int i,j;
+ 
+@@ -86,15 +78,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void ContourToNodesUsage(void){
+-	_printLine_("   usage:");
+-	_printLine_("   [flags]=ContourToNodes(x,y,contourname,edgevalue);\n");
+-	_printLine_("   where:");
+-	_printLine_("      x,y: list of nodes.");
+-	_printLine_("      contourname: name of .exp file containing the contours, or resulting structure from call to expread.");
+-	_printLine_("      interptype: string definining type of interpolation ('element', or 'node').");
+-	_printLine_("      edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.");
+-	_printLine_("      flags: vector of flags (0 or 1), of size nods.");
+-	_printLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void ContourToNodesUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.cpp	(revision 13236)
+@@ -9,12 +9,18 @@
+ 	using double arrays found in the workspace, and loaded directly into memory.
+ */
+ 
+-
+ #include "./HoleFiller.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[],
+-				  int nrhs, const mxArray* prhs[])
+-{
++void HoleFillerUsage(void){/*{{{*/
++	_printLine_("   HoleFiller usage:");
++	_printLine_("   [image_out]=HoleFiller(image_in,smooth);\n");
++	_printLine_("   where:");
++	_printLine_("      image_in in double format");
++	_printLine_("      smooth: 1 to smooth with a box filer, 0 to leave data raw");
++	_printLine_("      image_out in double format");
++	_printLine_("");
++}/*}}}*/
++WRAPPER(HoleFiller){
+ 
+ 	int i,j;
+ 
+@@ -55,15 +61,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-
+-void HoleFillerUsage(void)
+-{
+-	_printLine_("   HoleFiller usage:");
+-	_printLine_("   [image_out]=HoleFiller(image_in,smooth);\n");
+-	_printLine_("   where:");
+-	_printLine_("      image_in in double format");
+-	_printLine_("      smooth: 1 to smooth with a box filer, 0 to leave data raw");
+-	_printLine_("      image_out in double format");
+-	_printLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/HoleFiller/HoleFiller.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void HoleFillerUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp	(revision 13236)
+@@ -17,7 +17,19 @@
+ 	
+ #include "./MeshProfileIntersection.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
++void MeshProfileIntersectionUsage(void){/*{{{*/
++	_printLine_("   usage:");
++	_printLine_("   [segments]=MeshProfileIntersection(index,x,y,filename);");
++	_printLine_("   where:");
++	_printLine_("   input:");
++	_printLine_("        index,x,y is a triangulation");
++	_printLine_("        filename: name of Argus style .exp file containing the segments (can be groups of disconnected segments)");
++	_printLine_("   output:");
++	_printLine_("        segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremitis for a segment ");
++	_printLine_("        belonging to the elemnt_id element. there are as many lines in segments as there are segments intersecting the ");
++	_printLine_("        mesh.");
++}/*}}}*/
++WRAPPER(MeshProfileIntersection){
+ 
+ 	int i,j;
+ 
+@@ -99,16 +111,3 @@
+ 	MODULEEND();
+ 
+ }
+-
+-void MeshProfileIntersectionUsage(void){
+-	_printLine_("   usage:");
+-	_printLine_("   [segments]=MeshProfileIntersection(index,x,y,filename);");
+-	_printLine_("   where:");
+-	_printLine_("   input:");
+-	_printLine_("        index,x,y is a triangulation");
+-	_printLine_("        filename: name of Argus style .exp file containing the segments (can be groups of disconnected segments)");
+-	_printLine_("   output:");
+-	_printLine_("        segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremitis for a segment ");
+-	_printLine_("        belonging to the elemnt_id element. there are as many lines in segments as there are segments intersecting the ");
+-	_printLine_("        mesh.");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void MeshProfileIntersectionUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void InterpFromMeshToMesh3dUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 13236)
+@@ -1,26 +1,31 @@
+ /*!\file InterpFromMeshToMesh3d.c
+  * \brief: data interpolation from a list of (x,y,values) into mesh vertices
+- 
+-	InterpFromMeshToMesh3d.c
+-
+-	usage:
+-	data_mesh=InterpFromMeshToMesh3d(index,x,y,z,data,x_mesh,y_mesh,z_mesh);
+-	
+-	where:
+-
+-		input:
+-		x,y,z: coordinates of matrix data
+-		data - matrix holding the data to be interpolated onto the mesh.
+-		x_mesh,y_mesh,z_mesh: coordinates of the mesh vertices onto which we interpolate.
+-		
+-		output: 
+-		data_mesh:  vector of mesh interpolated data.
+-
+ */
+ 	
+ #include "./InterpFromMeshToMesh3d.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
++void InterpFromMeshToMesh3dUsage(void){/*{{{*/
++	_pprintLine_("INTERPFROMMESHTOMESH3D - interpolation from a 3d hexahedron mesh onto a list of point");
++	_pprintLine_("");
++	_pprintLine_("   This function is a multi-threaded mex file that interpolates a field");
++	_pprintLine_("   defined on a triangular mesh onto a list of point");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      data_prime=InterpFromMeshToMesh3d(index,x,y,z,data,x_prime,y_prime,z_prime,default_value);");
++	_pprintLine_("");
++	_pprintLine_("      index: index of the mesh where data is defined");
++	_pprintLine_("      x,y,z: coordinates of the nodes where data is defined");
++	_pprintLine_("      data: matrix holding the data to be interpolated onto the mesh.");
++	_pprintLine_("      x_prime,y_prime,z_prime: coordinates of the points onto which we interpolate.");
++	_pprintLine_("      default_value: default value if no data is found (holes).");
++	_pprintLine_("      data_prime: vector of mesh interpolated data.");
++	_pprintLine_("");
++	_pprintLine_("   Example:");
++	_pprintLine_("      load('temperature.mat');");
++	_pprintLine_("      md.initialization.temperature=InterpFromMeshToMesh3d(index,x,y,z,temperature,md.mesh.x,md.mesh.y,md.mesh.z,253);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(InterpFromMeshToMesh3d){
+ 
+ 	/*input: */
+ 	double* index_data=NULL;
+@@ -94,25 +99,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void InterpFromMeshToMesh3dUsage(void){
+-	_pprintLine_("INTERPFROMMESHTOMESH3D - interpolation from a 3d hexahedron mesh onto a list of point");
+-	_pprintLine_("");
+-	_pprintLine_("   This function is a multi-threaded mex file that interpolates a field");
+-	_pprintLine_("   defined on a triangular mesh onto a list of point");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      data_prime=InterpFromMeshToMesh3d(index,x,y,z,data,x_prime,y_prime,z_prime,default_value);");
+-	_pprintLine_("");
+-	_pprintLine_("      index: index of the mesh where data is defined");
+-	_pprintLine_("      x,y,z: coordinates of the nodes where data is defined");
+-	_pprintLine_("      data: matrix holding the data to be interpolated onto the mesh.");
+-	_pprintLine_("      x_prime,y_prime,z_prime: coordinates of the points onto which we interpolate.");
+-	_pprintLine_("      default_value: default value if no data is found (holes).");
+-	_pprintLine_("      data_prime: vector of mesh interpolated data.");
+-	_pprintLine_("");
+-	_pprintLine_("   Example:");
+-	_pprintLine_("      load('temperature.mat');");
+-	_pprintLine_("      md.initialization.temperature=InterpFromMeshToMesh3d(index,x,y,z,temperature,md.mesh.x,md.mesh.y,md.mesh.z,253);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void Ll2xyUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp	(revision 13236)
+@@ -3,7 +3,31 @@
+  */
+ #include "./Ll2xy.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void Ll2xyUsage(void){/*{{{*/
++	_pprintLine_("Ll2xy - lat/long to x/y coordinate transformation module:");
++	_pprintLine_("");
++	_pprintLine_("   This module transforms lat/long to x/y coordinates.");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      [x,y]=Ll2xy(lat,lon,sgn,'param name',param,...);");
++	_pprintLine_("");
++	_pprintLine_("      lat         latitude coordinates (double vector)");
++	_pprintLine_("      lon         longitude coordinates (double vector)");
++	_pprintLine_("      sgn         sign for hemisphere (double, +1 (north) or -1 (south))");
++	_pprintLine_("");
++	_pprintLine_("      central_meridian     central meridian (double, optional, but must specify with sp)");
++	_pprintLine_("      standard_parallel    standard parallel (double, optional, but must specify with cm)");
++	_pprintLine_("");
++	_pprintLine_("      x           x coordinates (double vector)");
++	_pprintLine_("      y           y coordinates (double vector)");
++	_pprintLine_("");
++	_pprintLine_("   Examples:");
++	_pprintLine_("      [x,y]=Ll2xy(lat,lon, 1);");
++	_pprintLine_("      [x,y]=Ll2xy(lat,lon, 1,'central_meridian',45,'standard_parallel',70);");
++	_pprintLine_("      [x,y]=Ll2xy(lat,lon,-1,'central_meridian', 0,'standard_parallel',71);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(Ll2xy){
+ 
+ 	int i,verbose=1;
+ 
+@@ -71,28 +95,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void Ll2xyUsage(void){
+-	_pprintLine_("Ll2xy - lat/long to x/y coordinate transformation module:");
+-	_pprintLine_("");
+-	_pprintLine_("   This module transforms lat/long to x/y coordinates.");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      [x,y]=Ll2xy(lat,lon,sgn,'param name',param,...);");
+-	_pprintLine_("");
+-	_pprintLine_("      lat         latitude coordinates (double vector)");
+-	_pprintLine_("      lon         longitude coordinates (double vector)");
+-	_pprintLine_("      sgn         sign for hemisphere (double, +1 (north) or -1 (south))");
+-	_pprintLine_("");
+-	_pprintLine_("      central_meridian     central meridian (double, optional, but must specify with sp)");
+-	_pprintLine_("      standard_parallel    standard parallel (double, optional, but must specify with cm)");
+-	_pprintLine_("");
+-	_pprintLine_("      x           x coordinates (double vector)");
+-	_pprintLine_("      y           y coordinates (double vector)");
+-	_pprintLine_("");
+-	_pprintLine_("   Examples:");
+-	_pprintLine_("      [x,y]=Ll2xy(lat,lon, 1);");
+-	_pprintLine_("      [x,y]=Ll2xy(lat,lon, 1,'central_meridian',45,'standard_parallel',70);");
+-	_pprintLine_("      [x,y]=Ll2xy(lat,lon,-1,'central_meridian', 0,'standard_parallel',71);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void BamgMesherUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp	(revision 13236)
+@@ -3,7 +3,12 @@
+  */
+ #include "./BamgMesher.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void BamgMesherUsage(void){/*{{{*/
++	_pprintLine_("");
++	_pprintLine_("   usage: [bamgmesh,bamggeom]=" << __FUNCT__ << "(bamgmesh,bamggeom,bamgoptions);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(BamgMesher){
+ 
+ 	/*Outputs*/
+ 	mxArray* bamgmesh_mat=NULL;
+@@ -48,9 +53,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void BamgMesherUsage(void){
+-	_pprintLine_("");
+-	_pprintLine_("   usage: [bamgmesh,bamggeom]=" << __FUNCT__ << "(bamgmesh,bamggeom,bamgoptions);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void InterpFromGridToMeshUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 13236)
+@@ -1,25 +1,30 @@
+ /*!\file InterpFromGridToMesh.c
+  * \brief: data interpolation from a list of (x,y,values) into mesh vertices
+- 
+-	InterpFromGridToMesh.c
+-
+-	usage:
+-	data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh);
+-	
+-	where:
+-
+-		input:
+-		x,y: coordinates of matrix data
+-		data - matrix holding the data to be interpolated onto the mesh.
+-		x_mesh,y_mesh: coordinates of the mesh vertices onto which we interpolate.
+-		
+-		output: 
+-		data_mesh:  vector of mesh interpolated data.
+ */
+ 	
+ #include "./InterpFromGridToMesh.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
++void InterpFromGridToMeshUsage(void){/*{{{*/
++	_pprintLine_("INTERPFROMGRIDTOMESH - interpolation from a grid onto a list of points");
++	_pprintLine_("");
++	_pprintLine_("   This function is a multi-threaded mex file that interpolates a field");
++	_pprintLine_("   defined on a grid onto a list of points");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,default_value);");
++	_pprintLine_("");
++	_pprintLine_("      data: matrix holding the data to be interpolated onto the mesh.");
++	_pprintLine_("      x,y: coordinates of matrix data. (x and y must be in increasing order)");
++	_pprintLine_("      x_mesh,y_mesh: coordinates of the points onto which we interpolate.");
++	_pprintLine_("      default_value: default value if no data is found (holes).");
++	_pprintLine_("      data_mesh: vector of mesh interpolated data.");
++	_pprintLine_("");
++	_pprintLine_("   Example:");
++	_pprintLine_("      load('velocities.mat');");
++	_pprintLine_("      md.inversion.vx_obs=InterpFromGridToMesh(x_n,y_m,vx,md.mesh.x,md.mesh.y,0);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(InterpFromGridToMesh){
+ 
+ 	int i,j;
+ 
+@@ -70,25 +75,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void InterpFromGridToMeshUsage(void)
+-{
+-	_pprintLine_("INTERPFROMGRIDTOMESH - interpolation from a grid onto a list of points");
+-	_pprintLine_("");
+-	_pprintLine_("   This function is a multi-threaded mex file that interpolates a field");
+-	_pprintLine_("   defined on a grid onto a list of points");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,default_value);");
+-	_pprintLine_("");
+-	_pprintLine_("      data: matrix holding the data to be interpolated onto the mesh.");
+-	_pprintLine_("      x,y: coordinates of matrix data. (x and y must be in increasing order)");
+-	_pprintLine_("      x_mesh,y_mesh: coordinates of the points onto which we interpolate.");
+-	_pprintLine_("      default_value: default value if no data is found (holes).");
+-	_pprintLine_("      data_mesh: vector of mesh interpolated data.");
+-	_pprintLine_("");
+-	_pprintLine_("   Example:");
+-	_pprintLine_("      load('velocities.mat');");
+-	_pprintLine_("      md.inversion.vx_obs=InterpFromGridToMesh(x_n,y_m,vx,md.mesh.x,md.mesh.y,0);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void InterpFromMeshToGridUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp	(revision 13236)
+@@ -4,7 +4,22 @@
+ 
+ #include "./InterpFromMeshToGrid.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void InterpFromMeshToGridUsage(void){/*{{{*/
++	_pprintLine_("INTERPFROMMESHTOGRID - interpolation of a data defined on a mesh onto a grid");
++	_pprintLine_("");
++	_pprintLine_("   This function is a multi-threaded mex file that interpolates a field");
++	_pprintLine_("   defined on a triangular mesh onto a regular grid");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      [x_m,y_m,griddata]=InterpFromMeshToGrid(index,x,y,data,xmin,ymax,xposting,yposting,nlines,ncols,default_value)");
++	_pprintLine_("");
++	_pprintLine_("      index,x,y: delaunay triangulation defining the mesh.");
++	_pprintLine_("      meshdata: vertex values of data to be interpolated.");
++	_pprintLine_("      xmin,ymax,posting,nlines,ncols: parameters that define the grid");
++	_pprintLine_("      default_value: value of points located out of the mesh.");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(InterpFromMeshToGrid){
+ 
+ 	/*input datasets: */
+ 	double* index=NULL;
+@@ -60,20 +75,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void InterpFromMeshToGridUsage(void)
+-{
+-	_pprintLine_("INTERPFROMMESHTOGRID - interpolation of a data defined on a mesh onto a grid");
+-	_pprintLine_("");
+-	_pprintLine_("   This function is a multi-threaded mex file that interpolates a field");
+-	_pprintLine_("   defined on a triangular mesh onto a regular grid");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      [x_m,y_m,griddata]=InterpFromMeshToGrid(index,x,y,data,xmin,ymax,xposting,yposting,nlines,ncols,default_value)");
+-	_pprintLine_("");
+-	_pprintLine_("      index,x,y: delaunay triangulation defining the mesh.");
+-	_pprintLine_("      meshdata: vertex values of data to be interpolated.");
+-	_pprintLine_("      xmin,ymax,posting,nlines,ncols: parameters that define the grid");
+-	_pprintLine_("      default_value: value of points located out of the mesh.");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp	(revision 13236)
+@@ -3,7 +3,28 @@
+  */
+ #include "./KMLFileRead.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void KMLFileReadUsage(void){/*{{{*/
++	_pprintLine_("KMLFileRead - KML file reader module:");
++	_pprintLine_("");
++	_pprintLine_("   This module reads a KML file.");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      [ierror]=KMLFileRead(kmlfile,'param name',param,...);");
++	_pprintLine_("");
++	_pprintLine_("      kmlfile      file name of kml file to be read (char)");
++	_pprintLine_("");
++	_pprintLine_("      echo         echo command (char, optional, 'off'/'on')");
++	_pprintLine_("      deepecho     deep echo command (char, optional, 'off'/'on')");
++	_pprintLine_("      write        write command (char, optional, 'off'/'stdout'/kmlfile)");
++	_pprintLine_("");
++	_pprintLine_("      ierror       return code (non-zero for error)");
++	_pprintLine_("");
++	_pprintLine_("   Examples:");
++	_pprintLine_("      [ierror]=KMLFileRead('file.kml','deepecho','on');");
++	_pprintLine_("      [ierror]=KMLFileRead('filin.kml','echo','on','write','filout.kml');");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(KMLFileRead){
+ 
+ 	int i,j,nnodes=0,verbose=1;
+ 	KML_Object* kobj;
+@@ -104,26 +125,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void KMLFileReadUsage(void){
+-	_pprintLine_("KMLFileRead - KML file reader module:");
+-	_pprintLine_("");
+-	_pprintLine_("   This module reads a KML file.");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      [ierror]=KMLFileRead(kmlfile,'param name',param,...);");
+-	_pprintLine_("");
+-	_pprintLine_("      kmlfile      file name of kml file to be read (char)");
+-	_pprintLine_("");
+-	_pprintLine_("      echo         echo command (char, optional, 'off'/'on')");
+-	_pprintLine_("      deepecho     deep echo command (char, optional, 'off'/'on')");
+-	_pprintLine_("      write        write command (char, optional, 'off'/'stdout'/kmlfile)");
+-	_pprintLine_("");
+-	_pprintLine_("      ierror       return code (non-zero for error)");
+-	_pprintLine_("");
+-	_pprintLine_("   Examples:");
+-	_pprintLine_("      [ierror]=KMLFileRead('file.kml','deepecho','on');");
+-	_pprintLine_("      [ierror]=KMLFileRead('filin.kml','echo','on','write','filout.kml');");
+-	_pprintLine_("");
+-}
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void KMLFileReadUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp	(revision 13236)
+@@ -10,7 +10,30 @@
+ 
+ #include "./Shp2Kml.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void Shp2KmlUsage(void){/*{{{*/
++	_pprintLine_("Shp2Kml - shp to kml file conversion module:");
++	_pprintLine_("");
++	_pprintLine_("   This module converts a file from shp to kml format.");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      [ret]=Shp2Kml(filshp,filkml,sgn,'param name',param,...);");
++	_pprintLine_("");
++	_pprintLine_("      filshp      file name of shp file to be read (char, extension optional)");
++	_pprintLine_("      filkml      file name of kml file to be written (char)");
++	_pprintLine_("      sgn         sign for hemisphere (double, +1 (north); -1 (south); or 0 (no translation))");
++	_pprintLine_("");
++	_pprintLine_("      central_meridian     central meridian (double, optional, but must specify with sp)");
++	_pprintLine_("      standard_parallel    standard parallel (double, optional, but must specify with cm)");
++	_pprintLine_("");
++	_pprintLine_("      ret         return code (non-zero for warning)");
++	_pprintLine_("");
++	_pprintLine_("   Examples:");
++	_pprintLine_("      [ret]=Shp2Kml('file.shp','file.kml', 0);");
++	_pprintLine_("      [ret]=Shp2Kml('file.shp','file.kml', 1,'central_meridian',45,'standard_parallel',70);");
++	_pprintLine_("      [ret]=Shp2Kml('file.shp','file.kml',-1,'central_meridian', 0,'standard_parallel',71);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(Shp2Kml){
+ 
+ 	int i,verbose=1;
+ 
+@@ -74,27 +97,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void Shp2KmlUsage(void){
+-	_pprintLine_("Shp2Kml - shp to kml file conversion module:");
+-	_pprintLine_("");
+-	_pprintLine_("   This module converts a file from shp to kml format.");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      [ret]=Shp2Kml(filshp,filkml,sgn,'param name',param,...);");
+-	_pprintLine_("");
+-	_pprintLine_("      filshp      file name of shp file to be read (char, extension optional)");
+-	_pprintLine_("      filkml      file name of kml file to be written (char)");
+-	_pprintLine_("      sgn         sign for hemisphere (double, +1 (north); -1 (south); or 0 (no translation))");
+-	_pprintLine_("");
+-	_pprintLine_("      central_meridian     central meridian (double, optional, but must specify with sp)");
+-	_pprintLine_("      standard_parallel    standard parallel (double, optional, but must specify with cm)");
+-	_pprintLine_("");
+-	_pprintLine_("      ret         return code (non-zero for warning)");
+-	_pprintLine_("");
+-	_pprintLine_("   Examples:");
+-	_pprintLine_("      [ret]=Shp2Kml('file.shp','file.kml', 0);");
+-	_pprintLine_("      [ret]=Shp2Kml('file.shp','file.kml', 1,'central_meridian',45,'standard_parallel',70);");
+-	_pprintLine_("      [ret]=Shp2Kml('file.shp','file.kml',-1,'central_meridian', 0,'standard_parallel',71);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void Shp2KmlUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.cpp	(revision 13236)
+@@ -9,12 +9,18 @@
+ 	using double arrays found in the workspace, and loaded directly into memory.
+ */
+ 
+-
+ #include "./AverageFilter.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[],
+-				  int nrhs, const mxArray* prhs[])
+-{
++void AverageFilterUsage(void){/*{{{*/
++	_printLine_("   AverageFilter usage:");
++	_printLine_("   [image_out]=AverageFilter(image_in,pixels);\n");
++	_printLine_("   where:");
++	_printLine_("      image_in in double format");
++	_printLine_("      pixels: characteristic size of smoothing");
++	_printLine_("      image_out in double format");
++	_printLine_("");
++}/*}}}*/
++WRAPPER(AverageFilter){
+ 
+ 	int i,j;
+ 
+@@ -48,15 +54,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-
+-void AverageFilterUsage(void)
+-{
+-	_printLine_("   AverageFilter usage:");
+-	_printLine_("   [image_out]=AverageFilter(image_in,pixels);\n");
+-	_printLine_("   where:");
+-	_printLine_("      image_in in double format");
+-	_printLine_("      pixels: characteristic size of smoothing");
+-	_printLine_("      image_out in double format");
+-	_printLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/AverageFilter/AverageFilter.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void AverageFilterUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 13236)
+@@ -4,7 +4,13 @@
+ 
+ #include "./TriMeshProcessRifts.h"
+ 
+-void mexFunction(	int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[] ){
++void TriMeshProcessRiftsUsage(void){/*{{{*/
++	_printLine_("");
++	_printLine_("   usage: [index2,x2,y2,segments2,segmentmarkers2,rifts2]=TriMeshProcessrifts(index1,x1,y1,segments1,segmentmarkers1) ");
++	_printLine_("      where: (index1,x1,y1,segments1,segmentmarkers1) is an initial triangulation.");
++	_printLine_("      index2,x2,y2,segments2,segmentmarkers2,rifts2 is the resulting triangulation where rifts have been processed.");
++}/*}}}*/
++WRAPPER(TriMeshProcessRifts){
+ 
+ 	/*Matlab arrays: */
+ 	mxArray *pmxa_array  = NULL;
+@@ -244,10 +250,3 @@
+ 
+ 	return;
+ }
+-
+-void TriMeshProcessRiftsUsage(void){
+-	_printLine_("");
+-	_printLine_("   usage: [index2,x2,y2,segments2,segmentmarkers2,rifts2]=TriMeshProcessrifts(index1,x1,y1,segments1,segmentmarkers1) ");
+-	_printLine_("      where: (index1,x1,y1,segments1,segmentmarkers1) is an initial triangulation.");
+-	_printLine_("      index2,x2,y2,segments2,segmentmarkers2,rifts2 is the resulting triangulation where rifts have been processed.");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h	(revision 13236)
+@@ -8,7 +8,6 @@
+ #include "mex.h"
+ #include "triangle.h"
+ #include "string.h"
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+@@ -16,7 +15,6 @@
+ #include "../../c/issm-binding.h"
+ #include "../../c/EnumDefinitions/EnumDefinitions.h"
+ 
+-void TriMeshProcessRiftsUsage(void);
+ #undef __FUNCT__ 
+ #define __FUNCT__ "TriMeshProcessRifts"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp	(revision 13236)
+@@ -3,7 +3,31 @@
+  */
+ #include "./Exp2Kml.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void Exp2KmlUsage(void){/*{{{*/
++	_pprintLine_("Exp2Kml - exp to kml file conversion module:");
++	_pprintLine_("");
++	_pprintLine_("   This module converts a file from exp to kml format.");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      [ret]=Exp2Kml(filexp,filkml,sgn,'param name',param,...);");
++	_pprintLine_("");
++	_pprintLine_("      filexp      file name of exp file to be read (char)");
++	_pprintLine_("      filkml      file name of kml file to be written (char)");
++	_pprintLine_("      sgn         sign for hemisphere (double, +1 (north) or -1 (south))");
++	_pprintLine_("");
++	_pprintLine_("      central_meridian     central meridian (double, optional, but must specify with sp)");
++	_pprintLine_("      standard_parallel    standard parallel (double, optional, but must specify with cm)");
++	_pprintLine_("      holes       flag for treatment of multiple profiles (char, optional, 'yes' for holes))");
++	_pprintLine_("");
++	_pprintLine_("      ret         return code (non-zero for warning)");
++	_pprintLine_("");
++	_pprintLine_("   Examples:");
++	_pprintLine_("      [ret]=Exp2Kml('file.exp','file.kml', 1);");
++	_pprintLine_("      [ret]=Exp2Kml('file.exp','file.kml', 1,'central_meridian',45,'standard_parallel',70,'holes','yes');");
++	_pprintLine_("      [ret]=Exp2Kml('file.exp','file.kml',-1,'central_meridian', 0,'standard_parallel',71,'holes','yes');");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(Exp2Kml){
+ 
+ 	int i,verbose=1;
+ 
+@@ -70,29 +94,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void Exp2KmlUsage(void){
+-	_pprintLine_("Exp2Kml - exp to kml file conversion module:");
+-	_pprintLine_("");
+-	_pprintLine_("   This module converts a file from exp to kml format.");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      [ret]=Exp2Kml(filexp,filkml,sgn,'param name',param,...);");
+-	_pprintLine_("");
+-	_pprintLine_("      filexp      file name of exp file to be read (char)");
+-	_pprintLine_("      filkml      file name of kml file to be written (char)");
+-	_pprintLine_("      sgn         sign for hemisphere (double, +1 (north) or -1 (south))");
+-	_pprintLine_("");
+-	_pprintLine_("      central_meridian     central meridian (double, optional, but must specify with sp)");
+-	_pprintLine_("      standard_parallel    standard parallel (double, optional, but must specify with cm)");
+-	_pprintLine_("      holes       flag for treatment of multiple profiles (char, optional, 'yes' for holes))");
+-	_pprintLine_("");
+-	_pprintLine_("      ret         return code (non-zero for warning)");
+-	_pprintLine_("");
+-	_pprintLine_("   Examples:");
+-	_pprintLine_("      [ret]=Exp2Kml('file.exp','file.kml', 1);");
+-	_pprintLine_("      [ret]=Exp2Kml('file.exp','file.kml', 1,'central_meridian',45,'standard_parallel',70,'holes','yes');");
+-	_pprintLine_("      [ret]=Exp2Kml('file.exp','file.kml',-1,'central_meridian', 0,'standard_parallel',71,'holes','yes');");
+-	_pprintLine_("");
+-}
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void Exp2KmlUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp	(revision 13236)
+@@ -3,7 +3,30 @@
+  */
+ #include "./Kml2Exp.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void Kml2ExpUsage(void){/*{{{*/
++	_pprintLine_("Kml2Exp - kml to exp file conversion module:");
++	_pprintLine_("");
++	_pprintLine_("   This module converts a file from kml to exp format.");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      [ret]=Kml2Exp(filexp,filkml,sgn,'param name',param,...);");
++	_pprintLine_("");
++	_pprintLine_("      filkml      file name of kml file to be read (char)");
++	_pprintLine_("      filexp      file name of exp file to be written (char)");
++	_pprintLine_("      sgn         sign for hemisphere (double, +1 (north) or -1 (south))");
++	_pprintLine_("");
++	_pprintLine_("      central_meridian     central meridian (double, optional, but must specify with sp)");
++	_pprintLine_("      standard_parallel    standard parallel (double, optional, but must specify with cm)");
++	_pprintLine_("");
++	_pprintLine_("      ret         return code (non-zero for warning)");
++	_pprintLine_("");
++	_pprintLine_("   Examples:");
++	_pprintLine_("      [ret]=Kml2Exp('file.kml','file.exp', 1);");
++	_pprintLine_("      [ret]=Kml2Exp('file.kml','file.exp', 1,'central_meridian',45,'standard_parallel',70);");
++	_pprintLine_("      [ret]=Kml2Exp('file.kml','file.exp',-1,'central_meridian', 0,'standard_parallel',71);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(Kml2Exp){
+ 
+ 	int i,verbose=1;
+ 
+@@ -63,28 +86,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void Kml2ExpUsage(void){
+-	_pprintLine_("Kml2Exp - kml to exp file conversion module:");
+-	_pprintLine_("");
+-	_pprintLine_("   This module converts a file from kml to exp format.");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      [ret]=Kml2Exp(filexp,filkml,sgn,'param name',param,...);");
+-	_pprintLine_("");
+-	_pprintLine_("      filkml      file name of kml file to be read (char)");
+-	_pprintLine_("      filexp      file name of exp file to be written (char)");
+-	_pprintLine_("      sgn         sign for hemisphere (double, +1 (north) or -1 (south))");
+-	_pprintLine_("");
+-	_pprintLine_("      central_meridian     central meridian (double, optional, but must specify with sp)");
+-	_pprintLine_("      standard_parallel    standard parallel (double, optional, but must specify with cm)");
+-	_pprintLine_("");
+-	_pprintLine_("      ret         return code (non-zero for warning)");
+-	_pprintLine_("");
+-	_pprintLine_("   Examples:");
+-	_pprintLine_("      [ret]=Kml2Exp('file.kml','file.exp', 1);");
+-	_pprintLine_("      [ret]=Kml2Exp('file.kml','file.exp', 1,'central_meridian',45,'standard_parallel',70);");
+-	_pprintLine_("      [ret]=Kml2Exp('file.kml','file.exp',-1,'central_meridian', 0,'standard_parallel',71);");
+-	_pprintLine_("");
+-}
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void Kml2ExpUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp	(revision 13236)
+@@ -4,7 +4,17 @@
+ 	
+ #include "./PointCloudFindNeighbors.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
++void PointCloudFindNeighborsUsage(void){/*{{{*/
++	_printLine_("   usage:");
++	_printLine_("   [flags]=PointCloudFindNeighbors(x,y,mindistance,multithread);\n");
++	_printLine_("   where:");
++	_printLine_("      x,y: list of points.");
++	_printLine_("      mindistance: minimum distance that should exist between points in the cloud.");
++	_printLine_("      multithread: run multithreaded or not. with multithreads, flags can get 1 and 2 values in duplicates.");
++	_printLine_("      flags: array of flags (flag==1 means point is within mindistance of another point)");
++	_printLine_("");
++}/*}}}*/
++WRAPPER(PointCloudFindNeighbors){
+ 
+ 	int i,j;
+ 
+@@ -39,14 +49,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void PointCloudFindNeighborsUsage(void){
+-	_printLine_("   usage:");
+-	_printLine_("   [flags]=PointCloudFindNeighbors(x,y,mindistance,multithread);\n");
+-	_printLine_("   where:");
+-	_printLine_("      x,y: list of points.");
+-	_printLine_("      mindistance: minimum distance that should exist between points in the cloud.");
+-	_printLine_("      multithread: run multithreaded or not. with multithreads, flags can get 1 and 2 values in duplicates.");
+-	_printLine_("      flags: array of flags (flag==1 means point is within mindistance of another point)");
+-	_printLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void PointCloudFindNeighborsUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp	(revision 13236)
+@@ -4,7 +4,12 @@
+ 
+ #include "./PropagateFlagsFromConnectivity.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void PropagateFlagsFromConnectivityUsage(void) {/*{{{*/
++	_printLine_("");
++	_printLine_("   usage: [pool] = " << __FUNCT__ << "(connectivity,pool,index,flags);");;
++	_printLine_("");
++}/*}}}*/
++WRAPPER(PropagateFlagsFromConnectivity){
+ 
+ 	/*input/output datasets: */
+ 	double* connectivity=NULL;
+@@ -39,9 +44,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void PropagateFlagsFromConnectivityUsage(void) {
+-	_printLine_("");
+-	_printLine_("   usage: [pool] = " << __FUNCT__ << "(connectivity,pool,index,flags);");;
+-	_printLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void PropagateFlagsFromConnectivityUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.cpp	(revision 13236)
+@@ -3,7 +3,17 @@
+  */
+ #include "./TriaSearch.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void TriaSearchUsage(void){/*{{{*/
++	_pprintLine_("TriaSearch- find triangle holding a point (x0,y0) in a mesh");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("         tria=TriaSearch(index,x,y,x0,y0);");
++	_pprintLine_("      index,x,y: mesh triangulatrion");
++	_pprintLine_("      x0,y0: coordinates of the point for which we are trying to find a triangle");
++	_pprintLine_("      x0,y0 can be an array of points");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(TriaSearch){
+ 
+ 	int i;
+ 
+@@ -48,14 +58,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void TriaSearchUsage(void){
+-	_pprintLine_("TriaSearch- find triangle holding a point (x0,y0) in a mesh");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("         tria=TriaSearch(index,x,y,x0,y0);");
+-	_pprintLine_("      index,x,y: mesh triangulatrion");
+-	_pprintLine_("      x0,y0: coordinates of the point for which we are trying to find a triangle");
+-	_pprintLine_("      x0,y0 can be an array of points");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriaSearch/TriaSearch.h	(revision 13236)
+@@ -15,9 +15,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void TriaSearchUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp	(revision 13236)
+@@ -4,7 +4,12 @@
+ 
+ #include "./InternalFront.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void InternalFrontUsage(void) {/*{{{*/
++	_pprintLine_("");
++	_pprintLine_("   usage: icefront = " << __FUNCT__ << "(md);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(InternalFront){
+ 
+ 	bool*   elementonwater=NULL;
+ 	int*    elements=NULL;
+@@ -91,9 +96,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void InternalFrontUsage(void) {
+-	_pprintLine_("");
+-	_pprintLine_("   usage: icefront = " << __FUNCT__ << "(md);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void InternalFrontUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/shared/shared.h"
+ #include "../../c/issm-binding.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.cpp	(revision 13236)
+@@ -1,30 +1,19 @@
+ /*!\file:  MeshPartition.cpp
+  * \brief: partition mesh according to number of areas, using Metis library.
+-
+-	usage:
+-	[element_partitioning,node_partitioning]=MeshPartition(model,numareas)
+-	
+-	%Info needed from model are the following: 
+-	%mesh info: 
+-	numberofelements,numberofvertices,elements,elements_width
+-	%Non-extruded 2d mesh info
+-	nel2d,nods2d,elements2d,
+-	%Extruded 2d mesh info
+-	nel2d_ext,nods2d_ext,elements2d_ext,
+-	%Diverse
+-	numberoflayers,dim)
+-
+-	output:
+-	vector of partitioning area numbers, for every element.
+-	vector of partitioning area numbers, for every node.
+ */
+ 	
+ #include "./MeshPartition.h"
+ 
++void MeshPartitionUsage(void){/*{{{*/
++	_printLine_("   usage:");
++	_printString_("   [element_partitioning,node_partitioning]=MeshPartition(md.mesh,numpartitions)");
++	_printLine_("   where:");
++	_printLine_("      element_partitioning is a vector of partitioning area numbers, for every element.");
++	_printLine_("      node_partitioning is a vector of partitioning area numbers, for every node.");
++	_printLine_("");
++}/*}}}*/
++WRAPPER(MeshPartition){
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
+-
+-
+ 	/*Indexing: */
+ 	int i,j;
+ 
+@@ -93,12 +82,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void MeshPartitionUsage(void){
+-	_printLine_("   usage:");
+-	_printString_("   [element_partitioning,node_partitioning]=MeshPartition(md.mesh,numpartitions)");
+-	_printLine_("   where:");
+-	_printLine_("      element_partitioning is a vector of partitioning area numbers, for every element.");
+-	_printLine_("      node_partitioning is a vector of partitioning area numbers, for every node.");
+-	_printLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/MeshPartition/MeshPartition.h	(revision 13236)
+@@ -16,18 +16,12 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void MeshPartitionUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+ #include "../../c/shared/shared.h"
+ #include "../../c/issm-binding.h"
+ 
+-#undef CLEANUP
+-#define CLEANUP MeshPartitionLocalCleanup();
+-
+ #undef __FUNCT__ 
+ #define __FUNCT__  "MeshPartition"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp	(revision 13236)
+@@ -4,7 +4,22 @@
+ 	
+ #include "./InterpFromMesh2d.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
++void InterpFromMesh2dUsage(void){/*{{{*/
++	_pprintLine_("   usage:");
++	_pprintLine_("         data_prime=InterpFromMesh2d(index,x,y,data,x_prime,y_prime);\n");
++	_pprintLine_("      or data_prime=InterpFromMesh2d(index,x,y,data,x_prime,y_prime,default_value);\n");
++	_pprintLine_("      or data_prime=InterpFromMesh2d(index,x,y,data,x_prime,y_prime,default_value,contourname);\n");
++	_pprintLine_("   where:");
++	_pprintLine_("      x,y: coordinates of the nodes where data is defined");
++	_pprintLine_("      index: index of the mesh where data is defined");
++	_pprintLine_("      data - vector holding the data to be interpolated onto the points.");
++	_pprintLine_("      x_prime,y_prime: coordinates of the mesh vertices onto which we interpolate.");
++	_pprintLine_("      default_value: a scalar or vector of size length(x_prime).");
++	_pprintLine_("      contourname: linear interpolation will happen on all x_interp,y_interp inside the contour, default value will be adopted on the rest of the mesh.");
++	_pprintLine_("      data_prime:  vector of prime interpolated data.");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(InterpFromMesh2d){
+ 
+ 	/*input: */
+ 	double* index_data=NULL;
+@@ -134,20 +149,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void InterpFromMesh2dUsage(void)
+-{
+-	_pprintLine_("   usage:");
+-	_pprintLine_("         data_prime=InterpFromMesh2d(index,x,y,data,x_prime,y_prime);\n");
+-	_pprintLine_("      or data_prime=InterpFromMesh2d(index,x,y,data,x_prime,y_prime,default_value);\n");
+-	_pprintLine_("      or data_prime=InterpFromMesh2d(index,x,y,data,x_prime,y_prime,default_value,contourname);\n");
+-	_pprintLine_("   where:");
+-	_pprintLine_("      x,y: coordinates of the nodes where data is defined");
+-	_pprintLine_("      index: index of the mesh where data is defined");
+-	_pprintLine_("      data - vector holding the data to be interpolated onto the points.");
+-	_pprintLine_("      x_prime,y_prime: coordinates of the mesh vertices onto which we interpolate.");
+-	_pprintLine_("      default_value: a scalar or vector of size length(x_prime).");
+-	_pprintLine_("      contourname: linear interpolation will happen on all x_interp,y_interp inside the contour, default value will be adopted on the rest of the mesh.");
+-	_pprintLine_("      data_prime:  vector of prime interpolated data.");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void InterpFromMesh2dUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.cpp	(revision 13236)
+@@ -4,6 +4,11 @@
+ 
+ #include "./ElementConnectivity.h"
+ 
++void ElementConnectivityUsage(void) {/*{{{*/
++	_pprintLine_("");
++	_pprintLine_("   usage: elementconnectivity = " << __FUNCT__ << "(elements, nodeconnectivity);");
++	_pprintLine_("");
++}/*}}}*/
+ WRAPPER(ElementConnectivity){
+ 
+ 	/*inputs: */
+@@ -34,9 +39,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void ElementConnectivityUsage(void) {
+-	_pprintLine_("");
+-	_pprintLine_("   usage: elementconnectivity = " << __FUNCT__ << "(elements, nodeconnectivity);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h	(revision 13236)
+@@ -52,7 +52,4 @@
+ #undef NRHS
+ #define NRHS  2
+ 
+-/* local prototypes: */
+-void ElementConnectivityUsage(void);
+-
+ #endif  /* _ELEMENTCONNECTIVITY_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.h	(revision 13236)
+@@ -1,5 +1,5 @@
+ /*
+-	KrigingUsage.h
++	Kriging.h
+ */
+ 
+ #ifndef _KRIGING_H_
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void KrigingUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/shared/shared.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.cpp	(revision 13236)
+@@ -3,7 +3,26 @@
+  */
+ #include "./Kriging.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void KrigingUsage(void){/*{{{*/
++	_pprintLine_("");
++	_pprintLine_("   usage: predictions=" << __FUNCT__ << "(x,y,observations,x_interp,y_interp,'options');");
++	_pprintLine_("   available options:");
++	_pprintLine_("      -'model': Available variogram models 'gaussian' (default),'spherical','power','exponential'");
++	_pprintLine_("         -'nugget': nugget effect (default 0.2)");
++	_pprintLine_("         -'range':  for gaussian, spherical and exponential models (default sqrt(3))");
++	_pprintLine_("         -'sill':   for gaussian, spherical and exponential models (default 1)");
++	_pprintLine_("         -'slope':  for power model (default 1)");
++	_pprintLine_("         -'power':  for power model (default 1)");
++	_pprintLine_("      -'searchradius': search radius for each prediction (default is observations span)");
++	_pprintLine_("      -'boxlength':    minimum length of quadtree boxes (useful to decrease the number of observations)");
++	_pprintLine_("      -'maxdata':      minimum number of observations for a prediction (default is 50)");
++	_pprintLine_("      -'mindata':      maximum number of observations for a prediction (default is 1)");
++	_pprintLine_("      -'maxtrimming':  maximum trimming value (default is -1.e+21)");
++	_pprintLine_("      -'mintrimming':  minimum trimming value (default is +1.e+21)");
++	_pprintLine_("      -'minspacing':   minimum distance between observation (default is 0.01)");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(Kriging){
+ 
+ 	/*Outputs*/
+ 	double  *x            = NULL;
+@@ -51,23 +70,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void KrigingUsage(void){
+-	_pprintLine_("");
+-	_pprintLine_("   usage: predictions=" << __FUNCT__ << "(x,y,observations,x_interp,y_interp,'options');");
+-	_pprintLine_("   available options:");
+-	_pprintLine_("      -'model': Available variogram models 'gaussian' (default),'spherical','power','exponential'");
+-	_pprintLine_("         -'nugget': nugget effect (default 0.2)");
+-	_pprintLine_("         -'range':  for gaussian, spherical and exponential models (default sqrt(3))");
+-	_pprintLine_("         -'sill':   for gaussian, spherical and exponential models (default 1)");
+-	_pprintLine_("         -'slope':  for power model (default 1)");
+-	_pprintLine_("         -'power':  for power model (default 1)");
+-	_pprintLine_("      -'searchradius': search radius for each prediction (default is observations span)");
+-	_pprintLine_("      -'boxlength':    minimum length of quadtree boxes (useful to decrease the number of observations)");
+-	_pprintLine_("      -'maxdata':      minimum number of observations for a prediction (default is 50)");
+-	_pprintLine_("      -'mindata':      maximum number of observations for a prediction (default is 1)");
+-	_pprintLine_("      -'maxtrimming':  maximum trimming value (default is -1.e+21)");
+-	_pprintLine_("      -'mintrimming':  minimum trimming value (default is +1.e+21)");
+-	_pprintLine_("      -'minspacing':   minimum distance between observation (default is 0.01)");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.cpp	(revision 13236)
+@@ -4,6 +4,11 @@
+ 
+ #include "./EnumToString.h"
+ 
++void EnumToStringUsage(void){/*{{{*/
++	_pprintLine_("");
++	_pprintLine_("   usage: " << __FUNCT__ << "string = EnumToString(enum);");
++	_pprintLine_("");
++}/*}}}*/
+ WRAPPER(EnumToString){
+ 
+ 	char    *name    = NULL;
+@@ -27,9 +32,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void EnumToStringUsage(void){
+-	_pprintLine_("");
+-	_pprintLine_("   usage: " << __FUNCT__ << "string = EnumToString(enum);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/EnumToString/EnumToString.h	(revision 13236)
+@@ -46,7 +46,4 @@
+ #undef NRHS
+ #define NRHS  1
+ 
+-/* local prototypes: */
+-void EnumToStringUsage(void);
+-
+ #endif  /* _TEST_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.cpp	(revision 13236)
+@@ -4,6 +4,11 @@
+ 
+ #include "./StringToEnum.h"
+ 
++void StringToEnumUsage(void){/*{{{*/
++	_pprintLine_("");
++	_pprintLine_("   usage: " << __FUNCT__ << "enum = StringToEnum(string);");
++	_pprintLine_("");
++}/*}}}*/
+ WRAPPER(StringToEnum){
+ 
+ 	char    *name    = NULL;
+@@ -27,10 +32,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void StringToEnumUsage(void)
+-{
+-	_pprintLine_("");
+-	_pprintLine_("   usage: " << __FUNCT__ << "enum = StringToEnum(string);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/StringToEnum/StringToEnum.h	(revision 13236)
+@@ -46,7 +46,4 @@
+ #undef NRHS
+ #define NRHS  1
+ 
+-/* local prototypes: */
+-void StringToEnumUsage(void);
+-
+ #endif  /* _TEST_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.cpp	(revision 13236)
+@@ -3,7 +3,16 @@
+  */
+ #include "./BamgTriangulate.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void BamgTriangulateUsage(void){/*{{{*/
++	_pprintString_("BAMGTRIANGULATE - Delaunay Triangulation of a list of points");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      index=BamgTriangulate(x,y);");
++	_pprintLine_("      index: index of the triangulation");
++	_pprintLine_("      x,y: coordinates of the nodes");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(BamgTriangulate){
+ 
+ 	/*input: */
+ 	double* x=NULL;
+@@ -45,14 +54,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void BamgTriangulateUsage(void)
+-{
+-	_pprintString_("BAMGTRIANGULATE - Delaunay Triangulation of a list of points");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      index=BamgTriangulate(x,y);");
+-	_pprintLine_("      index: index of the triangulation");
+-	_pprintLine_("      x,y: coordinates of the nodes");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void BamgTriangulateUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp	(revision 13236)
+@@ -3,7 +3,30 @@
+  */
+ #include "./InterpFromMeshToMesh2d.h"
+ 
+-
++void InterpFromMeshToMesh2dUsage(void){/*{{{*/
++	_pprintLine_("INTERFROMMESHTOMESH2D - interpolation from a 2d triangular mesh onto a list of point");
++	_pprintLine_("");
++	_pprintLine_("   This function is a multi-threaded mex file that interpolates a field");
++	_pprintLine_("   defined on a Delaunay triangulation onto a list of point");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("         data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp);");
++	_pprintLine_("      or data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp,OPTIONS);");
++	_pprintLine_("");
++	_pprintLine_("      index             : index of the mesh where data is defined");
++	_pprintLine_("      x,y               : coordinates of the nodes where data is defined");
++	_pprintLine_("      data              : matrix holding the data to be interpolated onto the mesh. (one column per field)");
++	_pprintLine_("      x_interp,y_interp : coordinates of the points onto which we interpolate.");
++	_pprintLine_("      data_interp       : vector of mesh interpolated data.");
++	_pprintLine_("      Available options :");
++	_pprintLine_("         - 'default' : default value if point is outsite of triangulation (instead of linear interolation)");
++	_pprintLine_("");
++	_pprintLine_("   Example:");
++	_pprintLine_("      load('temperature.mat');");
++	_pprintLine_("      md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y);");
++	_pprintLine_("      md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y,'default',253);");
++	_pprintLine_("");
++}/*}}}*/
+ WRAPPER(InterpFromMeshToMesh2d){
+ 
+ 	/*Intermediaties*/
+@@ -54,29 +77,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void InterpFromMeshToMesh2dUsage(void){ /*{{{*/
+-	_pprintLine_("INTERFROMMESHTOMESH2D - interpolation from a 2d triangular mesh onto a list of point");
+-	_pprintLine_("");
+-	_pprintLine_("   This function is a multi-threaded mex file that interpolates a field");
+-	_pprintLine_("   defined on a Delaunay triangulation onto a list of point");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("         data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp);");
+-	_pprintLine_("      or data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp,OPTIONS);");
+-	_pprintLine_("");
+-	_pprintLine_("      index             : index of the mesh where data is defined");
+-	_pprintLine_("      x,y               : coordinates of the nodes where data is defined");
+-	_pprintLine_("      data              : matrix holding the data to be interpolated onto the mesh. (one column per field)");
+-	_pprintLine_("      x_interp,y_interp : coordinates of the points onto which we interpolate.");
+-	_pprintLine_("      data_interp       : vector of mesh interpolated data.");
+-	_pprintLine_("      Available options :");
+-	_pprintLine_("         - 'default' : default value if point is outsite of triangulation (instead of linear interolation)");
+-	_pprintLine_("");
+-	_pprintLine_("   Example:");
+-	_pprintLine_("      load('temperature.mat');");
+-	_pprintLine_("      md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y);");
+-	_pprintLine_("      md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y,'default',253);");
+-	_pprintLine_("");
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void InterpFromMeshToMesh2dUsage(void);
+-
+ /*Header files: */
+ #include "../../c/include/globals.h"
+ #include "../../c/toolkits/toolkits.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13236)
+@@ -62,8 +62,5 @@
+ #undef NRHS
+ #define NRHS 6
+ 
+-/* local prototypes: */
+-void ContourToMeshUsage(void);
+-
+ #endif  /* _CONTOURTOMESH_H */
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13236)
+@@ -1,25 +1,31 @@
+ /*! \file  ContourtoMesh
+     \brief: takes an  contour file, and figures out which nodes or elements from the mesh  
+     are inside this contour. 
+-	usage:
+-	[in_nod,in_elem]=ContourToMesh(index,x,y,contours,interptype,edgevalue);
+-	
+-	input:
+-
+-		index,x,y: delaunay triangulation.
+-		contours: structure holding sets of vertices making open contours. 
+-		interptype: string definining type of interpolation ('element', or 'node', or 'element and node');
+-		edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons
+-
+-	output:
+-		in_nod: vector of flags (0 or 1), of size nods if interptype is set to 'node' or 'element and node', 
+-				or of size 0 otherwise.
+-		in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node', 
+-				or of size 0 otherwise.
+ */
+ 	
+ #include "./ContourToMesh.h"
+ 
++void ContourToMeshUsage(void){/*{{{*/
++	_printLine_("CONTOURTOMESH - Flag the elements or nodes inside a contour");
++	_printLine_("");
++	_printLine_("      Usage: ");
++	_printLine_("         [in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)\n");
++	_printLine_("");
++	_printLine_("         index,x,y: mesh triangulation.");
++	_printLine_("         contourname: name of .exp file containing the contours.");
++	_printLine_("         interptype: string definining type of interpolation ('element', or 'node').");
++	_printLine_("         edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.");
++	_printLine_("         in_nod: vector of flags (0 or 1), of size nods if interptype is set to 'node' or 'element and node', ");
++	_printLine_("            or of size 0 otherwise.");
++	_printLine_("         in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node', ");
++	_printLine_("            or of size 0 otherwise.");
++	_printLine_("");
++	_printLine_("      Example: ");
++	_printLine_("         in_nod=ContourToMesh(md.elements,md.x,md.y,'Contour.exp','node',1)");
++	_printLine_("         in_elements=ContourToMesh(md.elements,md.x,md.y,'Contour.exp','element',0)");
++	_printLine_("         [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,'Contour.exp','element and node',0)");
++	_printLine_("");
++}/*}}}*/
+ WRAPPER(ContourToMesh){
+ 
+ 	int i,j;
+@@ -55,7 +61,6 @@
+ 		_error_("usage. See above");
+ 	}
+ 
+-
+ 	/*Fetch inputs: */
+ 	FetchData(&index,&nel,NULL,INDEX);
+ 	FetchData(&x,&nods,NULL,X);
+@@ -87,27 +92,3 @@
+ 	MODULEEND();
+ 	
+ }
+-
+-void ContourToMeshUsage(void)//{{{1
+-{
+-	_printLine_("CONTOURTOMESH - Flag the elements or nodes inside a contour");
+-	_printLine_("");
+-	_printLine_("      Usage: ");
+-	_printLine_("         [in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)\n");
+-	_printLine_("");
+-	_printLine_("         index,x,y: mesh triangulation.");
+-	_printLine_("         contourname: name of .exp file containing the contours.");
+-	_printLine_("         interptype: string definining type of interpolation ('element', or 'node').");
+-	_printLine_("         edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.");
+-	_printLine_("         in_nod: vector of flags (0 or 1), of size nods if interptype is set to 'node' or 'element and node', ");
+-	_printLine_("            or of size 0 otherwise.");
+-	_printLine_("         in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node', ");
+-	_printLine_("            or of size 0 otherwise.");
+-	_printLine_("");
+-	_printLine_("      Example: ");
+-	_printLine_("         in_nod=ContourToMesh(md.elements,md.x,md.y,'Contour.exp','node',1)");
+-	_printLine_("         in_elements=ContourToMesh(md.elements,md.x,md.y,'Contour.exp','element',0)");
+-	_printLine_("         [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,'Contour.exp','element and node',0)");
+-	_printLine_("");
+-}
+-//}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void Xy2llUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp	(revision 13236)
+@@ -3,7 +3,31 @@
+  */
+ #include "./Xy2ll.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void Xy2llUsage(void){/*{{{*/
++	_pprintLine_("Xy2ll - x/y to lat/long coordinate transformation module:");
++	_pprintLine_("");
++	_pprintLine_("   This module transforms x/y to lat/long coordinates.");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      [lat,lon]=Xy2ll(x,y,sgn,'param name',param,...);");
++	_pprintLine_("");
++	_pprintLine_("      x           x coordinates (double vector)");
++	_pprintLine_("      y           y coordinates (double vector)");
++	_pprintLine_("      sgn         sign for hemisphere (double, +1 (north) or -1 (south))");
++	_pprintLine_("");
++	_pprintLine_("      central_meridian     central meridian (double, optional, but must specify with sp)");
++	_pprintLine_("      standard_parallel    standard parallel (double, optional, but must specify with cm)");
++	_pprintLine_("");
++	_pprintLine_("      lat         latitude coordinates (double vector)");
++	_pprintLine_("      lon         longitude coordinates (double vector)");
++	_pprintLine_("");
++	_pprintLine_("   Examples:");
++	_pprintLine_("      [lat,lon]=Xy2ll(x,y, 1);");
++	_pprintLine_("      [lat,lon]=Xy2ll(x,y, 1,'central_meridian',45,'standard_parallel',70);");
++	_pprintLine_("      [lat,lon]=Xy2ll(x,y,-1,'central_meridian', 0,'standard_parallel',71);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(Xy2ll){
+ 
+ 	int i,verbose=1;
+ 
+@@ -70,29 +94,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void Xy2llUsage(void){
+-	_pprintLine_("Xy2ll - x/y to lat/long coordinate transformation module:");
+-	_pprintLine_("");
+-	_pprintLine_("   This module transforms x/y to lat/long coordinates.");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      [lat,lon]=Xy2ll(x,y,sgn,'param name',param,...);");
+-	_pprintLine_("");
+-	_pprintLine_("      x           x coordinates (double vector)");
+-	_pprintLine_("      y           y coordinates (double vector)");
+-	_pprintLine_("      sgn         sign for hemisphere (double, +1 (north) or -1 (south))");
+-	_pprintLine_("");
+-	_pprintLine_("      central_meridian     central meridian (double, optional, but must specify with sp)");
+-	_pprintLine_("      standard_parallel    standard parallel (double, optional, but must specify with cm)");
+-	_pprintLine_("");
+-	_pprintLine_("      lat         latitude coordinates (double vector)");
+-	_pprintLine_("      lon         longitude coordinates (double vector)");
+-	_pprintLine_("");
+-	_pprintLine_("   Examples:");
+-	_pprintLine_("      [lat,lon]=Xy2ll(x,y, 1);");
+-	_pprintLine_("      [lat,lon]=Xy2ll(x,y, 1,'central_meridian',45,'standard_parallel',70);");
+-	_pprintLine_("      [lat,lon]=Xy2ll(x,y,-1,'central_meridian', 0,'standard_parallel',71);");
+-	_pprintLine_("");
+-}
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h	(revision 13236)
+@@ -16,9 +16,6 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-/* local prototypes: */
+-void KMLMeshWriteUsage(void);
+-
+ #include "../../c/include/globals.h"
+ #include "../../c/modules/modules.h"
+ #include "../../c/Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 13236)
+@@ -3,7 +3,32 @@
+  */
+ #include "./KMLMeshWrite.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void KMLMeshWriteUsage(void){/*{{{*/
++	_pprintLine_("KMLMeshWrite - KML mesh writer module:");
++	_pprintLine_("");
++	_pprintLine_("   This module writes the mesh of a model as KML polygons into the specified KML file.");
++	_pprintLine_("");
++	_pprintLine_("   Usage:");
++	_pprintLine_("      ierror=KMLMeshWrite(name,notes,elem,nodecon,lat,long,part,data,cmap,kmlfile);");
++	_pprintLine_("");
++	_pprintLine_("      name       model name (string, may be empty)");
++	_pprintLine_("      notes      model notes (string or cell array of strings, may be empty)");
++	_pprintLine_("      elem       elements (double array)");
++	_pprintLine_("      nodecon    nodal connectivity array (double array, may be empty)");
++	_pprintLine_("      lat        nodal latititudes (double vector)");
++	_pprintLine_("      long       nodal longitudes (double vector)");
++	_pprintLine_("      part       nodal partitions (double vector, may be empty)");
++	_pprintLine_("      data       nodal or element data (double vector, may be empty)");
++	_pprintLine_("      cmap       color map (double nx3 array, may be empty)");
++	_pprintLine_("      kmlfile    KML file name (string)");
++	_pprintLine_("");
++	_pprintLine_("      ierror     error flag (double, non-zero for error)");
++	_pprintLine_("");
++	_pprintLine_("   Example:");
++	_pprintLine_("      KMLMeshWrite(md.name,md.notes,md.elements,md.nodeconnectivity,md.lat,md.long,md.part,md.fm_criterion,options.cmap,filekml);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(KMLMeshWrite){
+ 
+ 	int i,j,nnodes=0,verbose=1;
+ 
+@@ -121,29 +146,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void KMLMeshWriteUsage(void){
+-	_pprintLine_("KMLMeshWrite - KML mesh writer module:");
+-	_pprintLine_("");
+-	_pprintLine_("   This module writes the mesh of a model as KML polygons into the specified KML file.");
+-	_pprintLine_("");
+-	_pprintLine_("   Usage:");
+-	_pprintLine_("      ierror=KMLMeshWrite(name,notes,elem,nodecon,lat,long,part,data,cmap,kmlfile);");
+-	_pprintLine_("");
+-	_pprintLine_("      name       model name (string, may be empty)");
+-	_pprintLine_("      notes      model notes (string or cell array of strings, may be empty)");
+-	_pprintLine_("      elem       elements (double array)");
+-	_pprintLine_("      nodecon    nodal connectivity array (double array, may be empty)");
+-	_pprintLine_("      lat        nodal latititudes (double vector)");
+-	_pprintLine_("      long       nodal longitudes (double vector)");
+-	_pprintLine_("      part       nodal partitions (double vector, may be empty)");
+-	_pprintLine_("      data       nodal or element data (double vector, may be empty)");
+-	_pprintLine_("      cmap       color map (double nx3 array, may be empty)");
+-	_pprintLine_("      kmlfile    KML file name (string)");
+-	_pprintLine_("");
+-	_pprintLine_("      ierror     error flag (double, non-zero for error)");
+-	_pprintLine_("");
+-	_pprintLine_("   Example:");
+-	_pprintLine_("      KMLMeshWrite(md.name,md.notes,md.elements,md.nodeconnectivity,md.lat,md.long,md.part,md.fm_criterion,options.cmap,filekml);");
+-	_pprintLine_("");
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 13236)
+@@ -62,7 +62,4 @@
+ #undef NRHS
+ #define NRHS  3
+ 
+-/* local prototypes: */
+-void TriMeshUsage(void);
+-
+ #endif  /* _TRIMESH_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 13236)
+@@ -4,6 +4,15 @@
+ 
+ #include "./TriMesh.h"
+ 
++void TriMeshUsage(void){/*{{{*/
++	_printLine_("");
++	_printLine_("   usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,rifts,area) ");
++	_printLine_("      where: index,x,y defines a triangulation, segments is an array made ");
++	_printLine_("      of exterior segments to the mesh domain outline, segmentmarkers is an array flagging each segment, ");
++	_printLine_("      outlinefilename an Argus domain outline file, ");
++	_printLine_("      area is the maximum area desired for any element of the resulting mesh, ");
++	_printLine_("");
++}/*}}}*/
+ WRAPPER(TriMesh){
+ 	
+ 	/* input: */
+@@ -59,15 +68,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void TriMeshUsage(void) //{{{1
+-{
+-	_printLine_("");
+-	_printLine_("   usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,rifts,area) ");
+-	_printLine_("      where: index,x,y defines a triangulation, segments is an array made ");
+-	_printLine_("      of exterior segments to the mesh domain outline, segmentmarkers is an array flagging each segment, ");
+-	_printLine_("      outlinefilename an Argus domain outline file, ");
+-	_printLine_("      area is the maximum area desired for any element of the resulting mesh, ");
+-	_printLine_("");
+-}
+-//}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.h	(revision 13236)
+@@ -26,9 +26,6 @@
+ #include "../../c/shared/shared.h"
+ #include "../../c/issm-binding.h"
+ 
+-/* local prototypes: */
+-void ChacoUsage(void);
+-
+ #undef __FUNCT__ 
+ #define __FUNCT__  "Chaco"
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp	(revision 13235)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp	(revision 13236)
+@@ -8,10 +8,14 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-
+ #include "./Chaco.h"
+ 
+-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
++void ChacoUsage(void){/*{{{*/
++	_pprintLine_("");
++	_pprintLine_("Usage: [assgn] = Chaco(A,vwgts,ewgts,x,y,z,options,nparts,goal);");
++	_pprintLine_("");
++}/*}}}*/
++WRAPPER(Chaco){
+    
+ 	int i;
+ 	int nterms;
+@@ -129,9 +133,3 @@
+ 	/*end module: */
+ 	MODULEEND();
+ }
+-
+-void ChacoUsage(void){
+-	_pprintLine_("");
+-	_pprintLine_("Usage: [assgn] = Chaco(A,vwgts,ewgts,x,y,z,options,nparts,goal);");
+-	_pprintLine_("");
+-}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13236-13237.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13236-13237.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13236-13237.diff	(revision 13394)
@@ -0,0 +1,35 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumToModelField.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumToModelField.cpp	(revision 13236)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumToModelField.cpp	(revision 13237)
+@@ -1,30 +0,0 @@
+-/*\file EnumToModelField.cpp:
+-* \brief: output string associated with enum, that corresponds  to a model field
+-* for example: ThicknessEnum corresponds to model field thickness
+-*              FrictionCoefficientEnum corresponds to model field drag
+-*/
+-
+-#include "../shared/shared.h"
+-#include "../include/include.h"
+-#include "./EnumDefinitions.h"
+-
+-const char* EnumToModelField(int en){
+-
+-	switch(en){
+-
+-		case ThicknessEnum : return "thickness";
+-		case FrictionCoefficientEnum : return "drag_coefficient";
+-		case MaterialsRheologyBEnum : return "rheology_B";
+-		case MaterialsRheologyBbarEnum : return "rheology_B";
+-		case MaterialsRheologyZEnum : return "rheology_Z";
+-		case MaterialsRheologyZbarEnum : return "rheology_Z";
+-		case BalancethicknessThickeningRateEnum: return "dhdt";
+-		case VxEnum : return "vx";
+-		case InversionVxObsEnum : return "vx_obs";
+-		case VyEnum : return "vy";
+-		case InversionVyObsEnum : return "vy_obs";
+-		case BasalforcingsMeltingRateEnum : return "basal_melting_rate";
+-		case SurfaceforcingsMassBalanceEnum : return "surface_mass_balance";
+-		default : _error_("No model field is associated to enum %s",EnumToStringx(en));
+-	}
+-}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13237-13238.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13237-13238.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13237-13238.diff	(revision 13394)
@@ -0,0 +1,48 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py	(revision 13237)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Par/SquareShelfConstrained.py	(revision 13238)
+@@ -1,11 +1,11 @@
++import os.path
++import inspect
++import netCDF4
+ from numpy import *
+ from verbose import *
+-import scipy.io as matio
+ from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
+-from paterson import  *
++from paterson import *
+ from SetIceShelfBC import *
+-import inspect
+-import os.path
+ 
+ #Start defining model parameters here
+ #Geometry
+@@ -15,19 +15,20 @@
+ ymax = max(md.mesh.y)
+ 
+ md.geometry.thickness = hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)
+-md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
++md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
+ md.geometry.surface = md.geometry.bed+md.geometry.thickness
+ 
+ #Initial velocity 
+-mat=matio.loadmat('../Data/SquareShelfConstrained.data')
++f = netCDF4.Dataset('../Data/SquareShelfConstrained.nc','r')
+ #Reshape as Rank-1 arrays
+-x=reshape(mat['x'],(-1))
+-y=reshape(mat['y'],(-1))
+-vx=mat['vx']
+-vy=mat['vy']
++x=reshape(f.variables['x'][:],(-1))
++y=reshape(f.variables['y'][:],(-1))
++vx=f.variables['vx'][:]
++vy=f.variables['vy'][:]
+ #deal with 'F' oriented matlab matrices!
+-index=mat['index'].astype(float)
++index=f.variables['index'][:].astype(float)
+ index=reshape(index.T,(len(index),3),order='F')
++f.close()
+ 
+ [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)
Index: /issm/oecreview/Archive/12678-13393/ISSM-13238-13239.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13238-13239.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13238-13239.diff	(revision 13394)
@@ -0,0 +1,51 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/oldclasses/materials.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/oldclasses/materials.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/oldclasses/materials.m	(revision 13239)
+@@ -0,0 +1,20 @@
++%OLD materials class definition
++
++classdef materials
++	properties (SetAccess=public) 
++		rho_ice                    = 0.;
++		rho_water                  = 0.;
++		rho_freshwater             = 0.;
++		mu_water                   = 0.;
++		heatcapacity               = 0.;
++		latentheat                 = 0.;
++		thermalconductivity        = 0.;
++		meltingpoint               = 0.;
++		beta                       = 0.;
++		mixed_layer_capacity       = 0.;
++		thermal_exchange_velocity  = 0.;
++		rheology_B   = NaN;
++		rheology_n   = NaN;
++		rheology_law = '';
++	end
++end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/oldclasses/README
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/oldclasses/README	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/oldclasses/README	(revision 13239)
+@@ -0,0 +1,3 @@
++We put here all old classes so that matlab can still load old models
++When an object is renamed or deleted, matlab is not able to load it
++anymore. We keep it here so that matlab can load the object
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13238)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13239)
+@@ -71,6 +71,13 @@
+ 				 disp('Recovering model object from a previous version');
+ 				 md = structtomodel(model,md);
+ 			 end
++
++			 %2012 August 4th
++			 if isa(md.materials,'materials'),
++				 disp('Recovering old materials');
++				 md.materials=matice(md.materials);
++			 end
++
+ 		 end% }}}
+ 	 end
+ 	 methods
Index: /issm/oecreview/Archive/12678-13393/ISSM-13239-13240.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13239-13240.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13239-13240.diff	(revision 13394)
@@ -0,0 +1,21 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.m	(revision 13239)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.m	(revision 13240)
+@@ -25,6 +25,16 @@
+ 			switch nargin
+ 				case 0
+ 					obj=setdefaultparameters(obj);
++				case 1
++					inputstruct=varargin{1};
++					list = properties('matice');
++					list2 = fieldnames(inputstruct);
++					for i=list1
++						fieldname = list1{i};
++						if ismember(fieldname,list2),
++							obj.(filename) = inputstruct.(filename);
++						end
++					end
+ 				otherwise
+ 					error('constructor not supported');
+ 			end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13240-13241.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13240-13241.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13240-13241.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/sensitivities.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/sensitivities.m	(revision 13240)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/qmu/sensitivities.m	(revision 13241)
+@@ -41,7 +41,10 @@
+ if IsScaled(variablename),
+ 
+ 	%ipick up the variable in the model
+-	variable=md.(EnumToModelField(StringToEnum(variablename)));
++	switch variablename,
++		case 'thickness', variable = md.geometry.thickness; 
++		otherwise, error(['scaled variable ' variablename  ' not associated to any model field']);
++	end
+ 
+ 	%average it onto the partition
+ 	average_variable=AreaAverageOntoPartition(md,variable);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13241-13242.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13241-13242.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13241-13242.diff	(revision 13394)
@@ -0,0 +1,168 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 13241)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 13242)
+@@ -8,13 +8,11 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
++#include <mex.h>
+ #include "../../include/include.h"
+ #include "../../shared/shared.h"
+ #include "./matlabio.h"
+ 
+-#include <mex.h>
+-
+-
+ /*Primitive data types*/
+ /*FUNCTION WriteData(mxArray** pdataref,double* matrix, int M,int N){{{*/
+ void WriteData(mxArray** pdataref,double* matrix, int M,int N){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 13241)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 13242)
+@@ -11,12 +11,11 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif 
+ 
++#include <mex.h>
+ #include "../../classes/classes.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+ 
+-#include <mex.h>
+-
+ void WriteData(mxArray** pdataref,SeqMat<double>* matrix);
+ void WriteData(mxArray** pdataref,double* matrix, int M,int N);
+ void WriteData(mxArray** pdataref,int*    matrix, int M,int N);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13241)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13242)
+@@ -11,39 +11,18 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif 
+ 
+-
+ #include "../../classes/classes.h"
+ #include "../../Container/Container.h"
+ #include "../../include/include.h"
+ 
+-class DataSet;
+-class Parameters;
++void WriteData(PyObject* py_tuple,int index, double* matrix, int M,int N);
++void WriteData(PyObject* py_tuple,int index, int integer);
++void WriteData(PyObject* py_tuple,int index, char* string);
++void WriteData(PyObject* py_tuple,int index, SeqMat<double>* matrix);
++void WriteData(PyObject* py_tuple,int index, SeqVec<double>* vector);
++void WriteData(PyObject* py_tuple,int index, BamgGeom* bamggeom);
++void WriteData(PyObject* py_tuple,int index, BamgMesh* bamgmesh);
+ 
+-//void WriteData(PyObject* py_tuple,DataSet* dataset);
+-//void WriteData(PyObject* py_tuple,int*    matrix, int M,int N);
+-//void WriteData(PyObject* py_tuple,double* vector, int M);
+-//void WriteData(PyObject* py_tuple,int integer);
+-//void WriteData(PyObject* py_tuple,bool boolean);
+-//void WriteData(PyObject* py_tuple,double scalar);
+-//void WriteData(DataHandle* py_tuple,Parameters* parameters);
+-void WriteData(PyObject* py_tuple, int index, double* matrix, int M,int N);
+-void WriteData(PyObject* py_tuple, int index, int integer);
+-void WriteData(PyObject* py_tuple, int index, char* string);
+-void WriteData(PyObject* py_tuple, int index, SeqMat<double>* matrix);
+-void WriteData(PyObject* py_tuple, int index, SeqVec<double>* vector);
+-
+-//void FetchData(DataSet** pdataset,PyObject* py_ref);
+-//void FetchData(double** pmatrix,int* pnumel,int* pndims,int** psize,PyObject* py_ref);
+-//void FetchData(int** pmatrix,int* pM,int *pN,PyObject* py_ref);
+-//void FetchData(bool** pmatrix,int* pM,int *pN,PyObject* py_ref);
+-//void FetchData(bool** pmatrix,int* pnumel,int* pndims,int** psize,PyObject* py_ref);
+-//void FetchData(Matrix** pmatrix,PyObject* py_ref);
+-//void FetchData(int** pvector,int* pM,PyObject* py_ref);
+-//void FetchData(float** pvector,int* pM,PyObject* py_ref);
+-//void FetchData(bool** pvector,int* pM,PyObject* py_ref);
+-//void FetchData(Vector** pvector,PyObject* py_ref);
+-//void FetchData(char** pmatrix,int* pnumel,int* pndims,int** psize,PyObject* py_ref);
+-//void FetchData(Parameters** pparameters, DataHandle py_ref);
+ void FetchData(double** pvector,int* pM,PyObject* py_ref);
+ void FetchData(double** pmatrix,int* pM,int *pN,PyObject* py_array);
+ void FetchData(int** pmatrix,int* pM,int *pN,PyObject* py_matrix);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13241)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13242)
+@@ -19,7 +19,7 @@
+ #include "../../io/io.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ 
+-
++/*Primitive data types*/
+ /*FUNCTION WriteData(PyObject* py_tuple,int index,int integer){{{*/
+ void WriteData(PyObject* py_tuple, int index, int integer){
+ 	
+@@ -32,8 +32,34 @@
+ 	PyTuple_SetItem(py_tuple, index, PyUnicode_FromString(string));
+ 
+ }/*}}}*/
+-/*FUNCTION WriteData(PyObject* tuple,int index,SeqMat<double>* matrix){{{*/
+-void WriteData(PyObject* tuple,int index,SeqMat<double>* matrix){
++/*FUNCTION WriteData(PyObject* py_tuple,int index, double* matrix, int M, int N){{{*/
++void WriteData(PyObject* tuple, int index, double* matrix, int M,int N){
++
++	npy_intp dims[2]={0,0};
++	PyObject* array=NULL;
++
++	dims[0]=(npy_intp)M;
++	dims[1]=(npy_intp)N;
++	array=PyArray_SimpleNewFromData(2,dims,NPY_DOUBLE,matrix);
++
++	PyTuple_SetItem(tuple, index, array);
++}/*}}}*/
++
++/*ISSM objects*/
++/*FUNCTION WriteData(PyObject* py_tuple,int index,BamgGeom* bamggeom){{{*/
++void WriteData(PyObject* py_tuple,int index,BamgGeom* bamggeom){
++
++	_error_("not implemented yes, see ../../matlab/io/WriteMatlabData.cpp");
++}
++/*}}}*/
++/*FUNCTION WriteData(PyObject* py_tuple,int index,BamgMesh* bamgmesh){{{*/
++void WriteData(PyObject* py_tuple,int index,BamgMesh* bamgmesh){
++
++	_error_("not implemented yes, see ../../matlab/io/WriteMatlabData.cpp");
++}
++/*}}}*/
++/*FUNCTION WriteData(PyObject* py_tuple,int index,SeqMat<double>* matrix){{{*/
++void WriteData(PyObject* py_tuple,int index,SeqMat<double>* matrix){
+ 	
+ 	int M,N;
+ 	double* buffer=NULL;
+@@ -46,7 +72,7 @@
+ 	dims[1]=(npy_intp)N;
+ 	array=PyArray_SimpleNewFromData(2,dims,NPY_DOUBLE,buffer);
+ 	
+-	PyTuple_SetItem(tuple, index, array);
++	PyTuple_SetItem(py_tuple, index, array);
+ 
+ }/*}}}*/
+ /*FUNCTION WriteData(PyObject* py_tuple,int index,SeqVec<double>* vector){{{*/
+@@ -63,20 +89,5 @@
+ 	array=PyArray_SimpleNewFromData(1,&dim,NPY_DOUBLE,buffer);
+ 	
+ 	PyTuple_SetItem(tuple, index, array);
+-
+-
+ }
+ /*}}}*/
+-/*FUNCTION WriteData(PyObject* py_tuple,int index, double* matrix, int M, int N){{{*/
+-void WriteData(PyObject* tuple, int index, double* matrix, int M,int N){
+-	
+-	npy_intp dims[2]={0,0};
+-	PyObject* array=NULL;
+-	
+-	dims[0]=(npy_intp)M;
+-	dims[1]=(npy_intp)N;
+-	array=PyArray_SimpleNewFromData(2,dims,NPY_DOUBLE,matrix);
+-	
+-	PyTuple_SetItem(tuple, index, array);
+-
+-}/*}}}*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-13242-13243.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13242-13243.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13242-13243.diff	(revision 13394)
@@ -0,0 +1,390 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13242)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13243)
+@@ -2,17 +2,18 @@
+ 
+ EXEEXT=$(PYTHONWRAPPEREXT)
+ 
+-#Modules {{{1
++#Modules {{{
+ if MODULES
+-lib_LTLIBRARIES = ElementConnectivity.la\
+-			   EnumToString.la\
+-			   InterpFromMeshToMesh2d.la\
+-			   NodeConnectivity.la\
+-			   StringToEnum.la\
+-			   TriMesh.la
++lib_LTLIBRARIES = BamgConvertMesh.la\
++						ElementConnectivity.la\
++						EnumToString.la\
++						InterpFromMeshToMesh2d.la\
++						NodeConnectivity.la\
++						StringToEnum.la\
++						TriMesh.la
+ endif 
+ #}}}
+-#Flags and libraries {{{1
++#Flags and libraries {{{
+ if SHAREDLIBS
+ deps = ../../c/libISSMCore.la ../../c/libISSMModules.la
+ else
+@@ -52,17 +53,21 @@
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS) 
+ #}}}
+-#Bin sources {{{1
++#Bin sources {{{
++BamgConvertMesh_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
++									  ../BamgConvertMesh/BamgConvertMesh.h
++BamgConvertMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++
+ ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+-			  ../ElementConnectivity/ElementConnectivity.h
++											../ElementConnectivity/ElementConnectivity.h
+ ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\
+-			  ../EnumToString/EnumToString.h
++								  ../EnumToString/EnumToString.h
+ EnumToString_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
+-							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
++												../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+ InterpFromMeshToMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+ NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
+@@ -70,10 +75,10 @@
+ NodeConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\
+-			  ../StringToEnum/StringToEnum.h
++								  ../StringToEnum/StringToEnum.h
+ StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
+-			  ../TriMesh/TriMesh.h
++							../TriMesh/TriMesh.h
+ TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB)
+ #}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp	(revision 13242)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp	(revision 13243)
+@@ -21,16 +21,14 @@
+ 	int     nods,nels,test1,test2;
+ 
+ 	/*Output*/
+-	BamgMesh *bamgmesh     = NULL;
+-	BamgGeom *bamggeom     = NULL;
+-	mxArray  *bamgmesh_mat = NULL;
+-	mxArray  *bamggeom_mat = NULL;
++	BamgMesh *bamgmesh = NULL;
++	BamgGeom *bamggeom = NULL;
+ 
+ 	/*Boot module: */
+ 	MODULEBOOT();
+ 
+ 	/*checks on arguments on the matlab side: */
+-	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&BamgConvertMeshUsage);
++	CHECKARGUMENTS(NLHS,NRHS,&BamgConvertMeshUsage);
+ 
+ 	/*Initialize Bamg outputs*/
+ 	bamggeom=new BamgGeom();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13242)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h	(revision 13243)
+@@ -21,6 +21,7 @@
+ #include "../../c/Container/Container.h"
+ #include "../../c/shared/shared.h"
+ #include "../../c/issm-binding.h"
++#include "../../c/io/io.h"
+ 
+ #undef __FUNCT__ 
+ #define __FUNCT__  "BamgConvertMesh"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp	(revision 13242)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp	(revision 13243)
+@@ -10,18 +10,14 @@
+ }/*}}}*/
+ WRAPPER(BamgMesher){
+ 
+-	/*Outputs*/
+-	mxArray* bamgmesh_mat=NULL;
+-	mxArray* bamggeom_mat=NULL;
+-
+-	/*diverse: */
++	/*Intermediary*/
+ 	BamgOpts *bamgopts=NULL;
+ 	BamgMesh *bamgmesh_in=NULL;
+ 	BamgGeom *bamggeom_in=NULL;
+ 	BamgMesh *bamgmesh_out=NULL;
+ 	BamgGeom *bamggeom_out=NULL;
+ 
+-	/*Boot module: */
++	/*Boot module*/
+ 	MODULEBOOT();
+ 
+ 	/*checks on arguments on the matlab side: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13242)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13243)
+@@ -2,36 +2,36 @@
+ 
+ EXEEXT=$(MATLABWRAPPEREXT)
+ 
+-#Modules {{{1
++#Modules {{{
+ if MODULES
+ lib_LTLIBRARIES =  AverageFilter.la\
+-			       BamgMesher.la\
+-				   BamgConvertMesh.la\
+-				   BamgTriangulate.la\
+-				   ContourToMesh.la\
+-				   ContourToNodes.la\
+-				   ElementConnectivity.la\
+-				   EnumToString.la\
+-				   HoleFiller.la\
+-				   InternalFront.la\
+-				   InterpFromGridToMesh.la\
+-				   InterpFromMeshToMesh2d.la\
+-				   InterpFromMeshToMesh3d.la\
+-				   InterpFromMeshToGrid.la\
+-				   InterpFromMesh2d.la\
+-				   Ll2xy.la\
+-				   NodeConnectivity.la\
+-				   MeshPartition.la\
+-				   MeshProfileIntersection.la\
+-				   PointCloudFindNeighbors.la\
+-				   PropagateFlagsFromConnectivity.la\
+-				   StringToEnum.la\
+-				   TriaSearch.la\
+-				   TriMesh.la\
+-				   TriMeshProcessRifts.la\
+-				   Scotch.la\
+-				   Xy2ll.la\
+-                   Chaco.la
++						 BamgMesher.la\
++						 BamgConvertMesh.la\
++						 BamgTriangulate.la\
++						 ContourToMesh.la\
++						 ContourToNodes.la\
++						 ElementConnectivity.la\
++						 EnumToString.la\
++						 HoleFiller.la\
++						 InternalFront.la\
++						 InterpFromGridToMesh.la\
++						 InterpFromMeshToMesh2d.la\
++						 InterpFromMeshToMesh3d.la\
++						 InterpFromMeshToGrid.la\
++						 InterpFromMesh2d.la\
++						 Ll2xy.la\
++						 NodeConnectivity.la\
++						 MeshPartition.la\
++						 MeshProfileIntersection.la\
++						 PointCloudFindNeighbors.la\
++						 PropagateFlagsFromConnectivity.la\
++						 StringToEnum.la\
++						 TriaSearch.la\
++						 TriMesh.la\
++						 TriMeshProcessRifts.la\
++						 Scotch.la\
++						 Xy2ll.la\
++						 Chaco.la
+ 
+ if KRIGING
+ lib_LTLIBRARIES +=  Kriging.la
+@@ -47,7 +47,7 @@
+ endif 
+ 
+ #}}}
+-#Flags and libraries {{{1
++#Flags and libraries {{{
+ if SHAREDLIBS
+ deps = ../../c/libISSMCore.la ../../c/libISSMModules.la
+ else
+@@ -94,114 +94,113 @@
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS) 
+ #}}}
+-
+-#Bin sources {{{1
++#Bin sources {{{
+ AverageFilter_la_SOURCES = ../AverageFilter/AverageFilter.cpp\
+-			  ../AverageFilter/AverageFilter.h
++									../AverageFilter/AverageFilter.h
+ AverageFilter_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\
+-					../BamgMesher/BamgMesher.h
++								../BamgMesher/BamgMesher.h
+ BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ BamgConvertMesh_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\
+-					../BamgConvertMesh/BamgConvertMesh.h
++									  ../BamgConvertMesh/BamgConvertMesh.h
+ BamgConvertMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ BamgTriangulate_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\
+-								  ../BamgTriangulate/BamgTriangulate.h
++									  ../BamgTriangulate/BamgTriangulate.h
+ BamgTriangulate_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ Chaco_la_SOURCES = ../Chaco/Chaco.cpp\
+-					../Chaco/Chaco.h
++						 ../Chaco/Chaco.h
+ Chaco_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(CHACOLIB)
+ 
+ ContourToMesh_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
+-			               ../ContourToMesh/ContourToMesh.h
++									../ContourToMesh/ContourToMesh.h
+ ContourToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+ ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
+-			  ../ContourToNodes/ContourToNodes.h
++									 ../ContourToNodes/ContourToNodes.h
+ ContourToNodes_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+-			  ../ElementConnectivity/ElementConnectivity.h
++											../ElementConnectivity/ElementConnectivity.h
+ ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\
+-			  ../EnumToString/EnumToString.h
++								  ../EnumToString/EnumToString.h
+ EnumToString_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\
+-			  ../StringToEnum/StringToEnum.h
++								  ../StringToEnum/StringToEnum.h
+ StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ HoleFiller_la_SOURCES = ../HoleFiller/HoleFiller.cpp\
+-			  ../HoleFiller/HoleFiller.h
++								../HoleFiller/HoleFiller.h
+ HoleFiller_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 
+ 
+ InternalFront_la_SOURCES = ../InternalFront/InternalFront.cpp\
+-										 ../InternalFront/InternalFront.h
++									../InternalFront/InternalFront.h
+ InternalFront_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ InterpFromGridToMesh_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
+-			  ../InterpFromGridToMesh/InterpFromGridToMesh.h
++											 ../InterpFromGridToMesh/InterpFromGridToMesh.h
+ InterpFromGridToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+ InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\
+-							../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
++												../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
+ InterpFromMeshToMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+ InterpFromMeshToMesh3d_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\
+-									../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
++												../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h
+ InterpFromMeshToMesh3d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ InterpFromMeshToGrid_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\
+-									../InterpFromMeshToGrid/InterpFromMeshToGrid.h
++											 ../InterpFromMeshToGrid/InterpFromMeshToGrid.h
+ InterpFromMeshToGrid_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ InterpFromMesh2d_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\
+-									../InterpFromMesh2d/InterpFromMesh2d.h
++										../InterpFromMesh2d/InterpFromMesh2d.h
+ InterpFromMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+ KMLFileRead_la_SOURCES = ../KMLFileRead/KMLFileRead.cpp\
+-			  ../KMLFileRead/KMLFileRead.h
++								 ../KMLFileRead/KMLFileRead.h
+ KMLFileRead_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ KMLMeshWrite_la_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\
+-			  ../KMLMeshWrite/KMLMeshWrite.h
++								  ../KMLMeshWrite/KMLMeshWrite.h
+ KMLMeshWrite_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ KMLOverlay_la_SOURCES = ../KMLOverlay/KMLOverlay.cpp\
+-			  ../KMLOverlay/KMLOverlay.h
++								../KMLOverlay/KMLOverlay.h
+ KMLOverlay_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ Xy2ll_la_SOURCES = ../Xy2ll/Xy2ll.cpp\
+-			  ../Xy2ll/Xy2ll.h
++						 ../Xy2ll/Xy2ll.h
+ Xy2ll_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ Ll2xy_la_SOURCES = ../Ll2xy/Ll2xy.cpp\
+-			  ../Ll2xy/Ll2xy.h
++						 ../Ll2xy/Ll2xy.h
+ Ll2xy_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ Exp2Kml_la_SOURCES = ../Exp2Kml/Exp2Kml.cpp\
+-			  ../Exp2Kml/Exp2Kml.h
++							../Exp2Kml/Exp2Kml.h
+ Exp2Kml_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ Kml2Exp_la_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
+-			  ../Kml2Exp/Kml2Exp.h
++							../Kml2Exp/Kml2Exp.h
+ Kml2Exp_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ Kriging_la_SOURCES = ../Kriging/Kriging.cpp\
+-						../Kriging/Kriging.h
++							../Kriging/Kriging.h
+ Kriging_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB) $(MULTITHREADINGLIB)
+ 
+ MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\
+-			  ../MeshPartition/MeshPartition.h
++									../MeshPartition/MeshPartition.h
+ MeshPartition_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(METISLIB)
+ 
+ MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
+-			  ../MeshProfileIntersection/MeshProfileIntersection.h
++												 ../MeshProfileIntersection/MeshProfileIntersection.h
+ MeshProfileIntersection_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
+@@ -209,30 +208,30 @@
+ NodeConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ PointCloudFindNeighbors_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\
+-			  ../PointCloudFindNeighbors/PointCloudFindNeighbors.h
++												 ../PointCloudFindNeighbors/PointCloudFindNeighbors.h
+ PointCloudFindNeighbors_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
+ 
+ PropagateFlagsFromConnectivity_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\
+-			  ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
++														  ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h
+ PropagateFlagsFromConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ Scotch_la_SOURCES = ../Scotch/Scotch.cpp\
+-                    ../Scotch/Scotch.h
++						  ../Scotch/Scotch.h
+ Scotch_la_LIBADD = ${deps} $(SCOTCHLIB)
+ 
+ Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp\
+-                     ../Shp2Kml/Shp2Kml.h
++							../Shp2Kml/Shp2Kml.h
+ Shp2Kml_la_LIBADD = ${deps} $(SHAPELIBLIB) $(MPILIB) $(PETSCLIB)
+ 
+ TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp\
+-			  ../TriaSearch/TriaSearch.h
++								../TriaSearch/TriaSearch.h
+ TriaSearch_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
+ TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
+-                     ../TriMesh/TriMesh.h
++							../TriMesh/TriMesh.h
+ TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB)
+ 
+ TriMeshProcessRifts_la_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
+-			  ../TriMeshProcessRifts/TriMeshProcessRifts.h
++											../TriMeshProcessRifts/TriMeshProcessRifts.h
+ TriMeshProcessRifts_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ #}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13243-13244.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13243-13244.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13243-13244.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13243)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 13244)
+@@ -90,9 +90,9 @@
+ 	#First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
+ 	if any(stokesflag):
+ #		fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
+-		fullspcnodes=numpy.logical_or(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx))+ \
+-		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvy))+ \
+-		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvz))==3, \
++		fullspcnodes=numpy.logical_or(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx)).astype(int)+ \
++		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvy)).astype(int)+ \
++		                              numpy.logical_not(numpy.isnan(md.diagnostic.spcvz)).astype(int)==3, \
+ 		                              numpy.logical_and(nodeonpattyn,nodeonstokes)).astype(int)    #find all the nodes on the boundary of the domain without icefront
+ #		fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
+ 		fullspcelems=(numpy.sum(fullspcnodes[md.mesh.elements.astype(int)-1],axis=1)==6).astype(int)    #find all the nodes on the boundary of the domain without icefront
Index: /issm/oecreview/Archive/12678-13393/ISSM-13244-13245.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13244-13245.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13244-13245.diff	(revision 13394)
@@ -0,0 +1,32 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test104.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test104.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test104.py	(revision 13245)
+@@ -0,0 +1,27 @@
++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',180000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md.extrude(3,2)
++md=setflowequation(md,'stokes','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,DiagnosticSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Vx','Vy','Vz','Vel','Pressure']
++field_tolerances=[1e-08,1e-08,1e-07,1e-08,1e-08]
++field_values=[\
++	md.results['DiagnosticSolution'][1]['Vx'],\
++	md.results['DiagnosticSolution'][1]['Vy'],\
++	md.results['DiagnosticSolution'][1]['Vz'],\
++	md.results['DiagnosticSolution'][1]['Vel'],\
++	md.results['DiagnosticSolution'][1]['Pressure'],\
++	]
Index: /issm/oecreview/Archive/12678-13393/ISSM-13245-13246.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13245-13246.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13245-13246.diff	(revision 13394)
@@ -0,0 +1,1679 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cppcheck/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cppcheck/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cppcheck/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Erase install
+ rm -rf install  src cppcheck-1.48
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cmake/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cmake/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cmake/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu 
+ 
+ #Some cleanup
+ rm -rf install cmake-2.8.5
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-sdk/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-sdk/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-sdk/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu 
+ 
+ # This installs the Android SDK (Software Development Kit)
+ # which is needed for the compilation of the Java project. 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-ndk/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-ndk/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/android/android-ndk/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ # This installs the Android NDK (Native Development Kit)
+ # which is needed for the compilation of C/C++ code into the 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src
+@@ -31,6 +32,7 @@
+ 	make -j $1
+ fi
+ make install
++cd ..
+ 
+ cd install/bin
+ ln -s python3.2 python 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas/install-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas/install-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu 
+ 
+ #Some cleanup
+ rm -rf src install BLAS blas.tgz
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Get number of cpus
+ NUMCPUS=$1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.4
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.0.2p1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.0.2p1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.4
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.0.2p1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.0.2p1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.4
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/freetype/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/freetype/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/freetype/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gmake/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gmake/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gmake/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src make-3.82
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/shapelib/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/shapelib/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/shapelib/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ # Some cleanup
+ rm -rf shapelib-1.2.10
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ PYVERSION=2.7
+ PYTHON=python${PYVERSION}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-lion.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-lion.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #1: install numpy
+ #2 install scipy
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/windows/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/windows/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/windows/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Download from ISSM server
+ $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/win7.sdk7.1.exe' 'win7.sdk7.1.exe'
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/satstress/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/satstress/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/satstress/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install SatStress-0.1.2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/install-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/install-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install lapack-3.4.1 lapack-3.4.1.tgz
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdaltokmz/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdaltokmz/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdaltokmz/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Download from ISSM server
+ $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/gdaltokmz-1.0.tar.gz' 'gdaltokmz-1.0.tar.gz'
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adic/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adic/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adic/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Erase install
+ rm -rf source build install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/m2html/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/m2html/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/m2html/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install m2html
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #Install Python nose module
+ 
+ pythonversion=2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/openanalysis/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/openanalysis/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/openanalysis/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf openanalysis
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-win32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-win32.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-win32.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install valgrind-3.8.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install valgrind-3.8.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install valgrind-3.8.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-altix64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-altix64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-altix64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install valgrind-3.8.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx32.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/valgrind/install-macosx32.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install valgrind-3.8.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install-macosx64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install-macosx64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/rose/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/rose/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/rose/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf source build install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/colpack/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/colpack/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/colpack/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Erase install
+ rm -rf install  src ColPack
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/chaco/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/chaco/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/chaco/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ # Some cleanup
+ rm -rf Chaco-2.2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/doxygen/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/doxygen/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/doxygen/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/distribute/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/distribute/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/distribute/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Download from ISSM server
+ $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://python-distribute.org/distribute_setup.py' 'distribute_setup.py'
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pysvn/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-cosmos.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-cosmos.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-cosmos.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install metis-4.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-greenplanet.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-greenplanet.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-greenplanet.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install metis-4.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-macosx64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-macosx64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install metis-4.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-win7.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-win7.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-win7.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install metis-4.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-pleiades.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-pleiades.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install metis-4.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install metis-4.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-5.0.1-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-5.0.1-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-5.0.1-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #metis 5.0 should be used: srand48 and drand48 are being redefined in conflict to the stdlib equivalent functions.
+ 
+ #Some cleanup
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-altix64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-altix64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-altix64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install metis-4.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-discover.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-discover.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-discover.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install metis-4.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-macosx32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-macosx32.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-macosx32.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install metis-4.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-win32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-win32.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis/install-4.0-win32.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install metis-4.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ sudochoice=0;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install git-1.7.10.2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/kml/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/kml/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/kml/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Download from ISSM server
+ $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/kml_shapefile.zip' 'kml_shapefile.zip'
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mercurial/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mercurial/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mercurial/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install mercurial-1.7.3
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/xaifbooster/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/xaifbooster/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/xaifbooster/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf xaifBooster
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/appscan/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/appscan/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/appscan/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #AppScan install directory. Just symlink to your existing AppScan software
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/angel/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/angel/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/angel/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf angel
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/hdf5/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/hdf5/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/hdf5/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install hdf5-1.8.9
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/xerces/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/xerces/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/xerces/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install xerces-c-src_2_8_0 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pcre/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pcre/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pcre/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Cleaning
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu 
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dace/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dace/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dace/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install dace
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Erase symlink
+ rm -rf install
+@@ -12,7 +13,7 @@
+ 
+ # Macintosh (OSX) simlink 
+ #ln -s /Applications/MATLAB_R2008a/ install
+-#ln -s /Applications/MATLAB_R2009a.app/ install
++ln -s /Applications/MATLAB_R2009a.app/ install
+ #ln -s /Applications/MATLAB_R2010a.app/ install
+ #ln -s /Applications/MATLAB_R2012a.app/ install
+ #ln -s /Applications/MATLAB_R2011a.app/ install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modelE/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modelE/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modelE/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #modelE  downloaded from the gis repository of the GISS (Goddard Institute for Space Studies)
+ #at  http://www.giss.nasa.gov/tools/modelE/
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/polygonclipper/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/polygonclipper/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/polygonclipper/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/rats/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/rats/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/rats/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Erase install
+ rm -rf install  src rats-2.3
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mitgcm/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mitgcm/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mitgcm/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Do these commands once:
+ # cvs -d:pserver:cvsanon@mitgcm.org:/u/gcmpack login
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #some issues on macosx64 with ISSM's autoconf. you might want to run native to mac on this.
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13246)
+@@ -19,4 +19,4 @@
+ else
+ 	make -j $1
+ fi
+-make install
+\ No newline at end of file
++make install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/h5py/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/h5py/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/h5py/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #needed further along
+ export HDF5_DIR=$ISSM_DIR/externalpackages/hdf5/install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/graphviz/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/graphviz/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/graphviz/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/bbftp/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/bbftp/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/bbftp/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install bbftp-client-3.2.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gslib/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gslib/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gslib/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-macosx64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-macosx64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Get number of cpus
+ NUMCPUS=$1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-pleiades.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-pleiades.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Get number of cpus
+ NUMCPUS=$1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-altix64-cosmos.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-altix64-cosmos.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-altix64-cosmos.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Get number of cpus
+ NUMCPUS=$1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-astrid.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-astrid.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-astrid.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Get number of cpus
+ NUMCPUS=$1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-murdo.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-murdo.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-murdo.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Get number of cpus
+ NUMCPUS=$1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-discover.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-discover.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-discover.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Get number of cpus
+ NUMCPUS=$1;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cccl/install-win7.orig.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cccl/install-win7.orig.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cccl/install-win7.orig.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install cccl-0.03
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cccl/install-win7.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cccl/install-win7.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cccl/install-win7.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src cccl-0.03
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libermate/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libermate/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libermate/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/oofem/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/oofem/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/oofem/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/slepc/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/slepc/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/slepc/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install slepc-2.3.2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install-murdo.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install-murdo.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install-murdo.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/latex2rtf/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/latex2rtf/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/latex2rtf/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf latex2rtf-2.0.0 cfg install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-dev-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-dev-pleiades.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-dev-pleiades.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #Step 0: download
+ #Step 1: install and write script
+ STEP=0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-cosmos.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-cosmos.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-cosmos.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.1-p7 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-cosmos.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-cosmos.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-cosmos.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-2.3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-greenplanet.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-greenplanet.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-greenplanet.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-macosx64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-macosx64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-2.3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-macosx64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-macosx64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.3-p2 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-macosx32-ogive.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-macosx32-ogive.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-macosx32-ogive.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.1-p7 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-ogive.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-ogive.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-ogive.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-2.3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.3-p2 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-discover.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-discover.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-discover.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-eric.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-eric.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-eric.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #Step 1: unzip and install
+ #Step 2: After MUMPS Crashes
+ STEP=0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-win32-eric.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-win32-eric.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-win32-eric.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-2.3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-altix64-castor.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-altix64-castor.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-altix64-castor.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #Step 1: unzip and install
+ #Step 2: After Plapack implodes
+ STEP=0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-win7.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-win7.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-win7.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.1-p7 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-win7.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-win7.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-win7.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-2.3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-altix64-castor.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-altix64-castor.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-altix64-castor.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #Step 1: unzip and install
+ #Step 2: After Plapack implodes
+ STEP=0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-pleiades.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-pleiades.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #Step 1: unzip and install
+ #Step 2: After Plapack implodes
+ STEP=0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-dev-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-dev-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-dev-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ STEP=2
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-pleiades.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-pleiades.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #Step 1: unzip and install
+ #Step 2: After Plapack implodes
+ STEP=0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #Step 1: unzip and install
+ #Step 2: After Plapack implodes
+ STEP=1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-macosx32-mathieu.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-macosx32-mathieu.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-macosx32-mathieu.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.1-p7 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-ubuntu64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-ubuntu64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-ubuntu64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.1-p7 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-linux64-astrid.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-linux64-astrid.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.1-linux64-astrid.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-3.1-p7 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-linux64-astrid.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-linux64-astrid.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-2.3.2-linux64-astrid.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install petsc-2.3.2-p3 src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ sudochoice=0;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/bsdtar/install-win7.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/bsdtar/install-win7.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/bsdtar/install-win7.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src libarchive-3.0.3
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/aspell/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/aspell/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/aspell/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #0: cleanup
+ #1:  install aspell
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install octave-3.6.2 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf-python/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf-python/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf-python/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install netCDF4-1.0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/geos5/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/geos5/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/geos5/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf  GEOSagcm
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pyclips/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pyclips/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pyclips/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/readline/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/readline/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/readline/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scotch/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scotch/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scotch/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ # Some cleanup
+ rm -rf scotch_5.1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.0.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.0.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.0.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #http://www.mcs.anl.gov/research/projects/tao/download/index.html
+ 
+ #Compatible with PETSc 3.2
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.1.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.1.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tao/install-2.1.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #http://www.mcs.anl.gov/research/projects/tao/download/index.html
+ 
+ #compatible with PETSc 3.3
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-macosx64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-macosx64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install gsl-1.15
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-pleiades.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-pleiades.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install gsl-1.15
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install gsl-1.15
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ source $ANDROID_DIR/android_aux.sh
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/qhull/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/qhull/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/qhull/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install qhull-2003.1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/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 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/flaim/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/flaim/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/flaim/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Erase symlink
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/esmf/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/esmf/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/esmf/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #0: cleanup
+ #1: install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ncview/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ncview/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ncview/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/findbugs/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/findbugs/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/findbugs/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Erase install
+ rm -rf install  findbugs-1.3.9
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ #you need hdf5 compiled
+ 
+ #Some cleanup
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.0.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.0.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.0.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src install netcdf-4.0.1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-win32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-win32.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-win32.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup 
+ rm -rf install triangle
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-macosx64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-macosx64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup 
+ rm -rf install triangle
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-win7.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-win7.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-win7.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup 
+ rm -rf install triangle
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-pleiades.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-pleiades.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+-#!/bin/bash
++##!/bin/bash
++set -eu
+ 
+ #Some cleanup 
+ rm -rf install triangle
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-linux64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup 
+ rm -rf install triangle
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-altix64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-altix64.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-altix64.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup 
+ rm -rf install triangle
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-discover.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-discover.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-discover.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup 
+ rm -rf install triangle
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-macosx32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-macosx32.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-macosx32.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup 
+ rm -rf install triangle
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-android.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-android.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-android.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup 
+ rm -rf install triangle
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #/bin/bash
++set -eu
+ pythonversion=2.7
+ PYTHON=python${pythonversion}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #/bin/bash
++set -eu
+ pythonversion=2.7
+ PYTHON=python${pythonversion}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/googleearthtoolbox/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/googleearthtoolbox/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/googleearthtoolbox/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install  
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tex2im/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tex2im/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tex2im/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/yams/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/yams/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/yams/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libpng/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libpng/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libpng/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Some cleanup
+ rm -rf src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/packagemaker/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/packagemaker/install.sh	(revision 13245)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/packagemaker/install.sh	(revision 13246)
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -eu
+ 
+ #Erase symlink
+ rm -rf install
Index: /issm/oecreview/Archive/12678-13393/ISSM-13246-13247.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13246-13247.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13246-13247.diff	(revision 13394)
@@ -0,0 +1,23 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 13246)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh	(revision 13247)
+@@ -13,7 +13,7 @@
+ 
+ # Macintosh (OSX) simlink 
+ #ln -s /Applications/MATLAB_R2008a/ install
+-ln -s /Applications/MATLAB_R2009a.app/ install
++#ln -s /Applications/MATLAB_R2009a.app/ install
+ #ln -s /Applications/MATLAB_R2010a.app/ install
+ #ln -s /Applications/MATLAB_R2012a.app/ install
+ #ln -s /Applications/MATLAB_R2011a.app/ install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-pleiades.sh	(revision 13246)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/triangle/install-pleiades.sh	(revision 13247)
+@@ -1,4 +1,4 @@
+-##!/bin/bash
++#!/bin/bash
+ set -eu
+ 
+ #Some cleanup 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13247-13248.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13247-13248.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13247-13248.diff	(revision 13394)
@@ -0,0 +1,213 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.h	(revision 13247)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.h	(revision 13248)
+@@ -9,13 +9,9 @@
+ 
+ template <class doubletype> class Matrix;
+ template <class doubletype> class Vector;
+-void* xmalloc(int size);
+-void* xcalloc(int n,int size);
+-void  xfree(void** pvptr);
+-void* xrealloc ( void* pv, int size);
++void xfree(void** pvptr);
+ void xdelete(Matrix<IssmDouble>** pvptr);
+ void xdelete(Vector<IssmDouble>** pvptr);
+ 
+ #include "./xNewDelete.h"
+-
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h	(revision 13247)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h	(revision 13248)
+@@ -60,36 +60,36 @@
+ template <class T> 
+ T* xReNew(T* old, unsigned int old_size, unsigned int size) {
+ #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
+-  T* aT_p=0;
+-  if (!old) { // no old memory
+-    if (size)  
+-      aT_p=xNew<T>(size); // according to realloc behavior in manual page 
+-  }
+-  else { // have old memory
+-    if (!size)  // but 0 size
+-      xDelete<T>(old); // according to realloc behavior in manual page
+-    else { // non-zero size
+-      assert(old_size); // have old memory - need to have old_size set or this call is bad
+-      // allocate new, delete old; ; even for the case when size is 
+-      // less than old_size we can't just keep the memory unchanged 
+-      // because otherwise classes that have ctors/dtors with side-effects 
+-      // may misbehave, for example classes with static instance/operations counters. 
+-      aT_p=xNew<T>(size);
+-      unsigned int iMax=(old_size<size)?old_size:size;
+-      for (unsigned int i=0; i<iMax;++i) { 
+-	// we need to copy the items by explicit assignments
+-	aT_p[i]=old[i];
+-      }
+-      xDelete<T>(old);
+-    }
+-  }
+-  return aT_p;
++	T* aT_p=0;
++	if (!old) { // no old memory
++		if (size)  
++		 aT_p=xNew<T>(size); // according to realloc behavior in manual page 
++	}
++	else { // have old memory
++		if (!size)  // but 0 size
++		 xDelete<T>(old); // according to realloc behavior in manual page
++		else { // non-zero size
++			assert(old_size); // have old memory - need to have old_size set or this call is bad
++			// allocate new, delete old; ; even for the case when size is 
++			// less than old_size we can't just keep the memory unchanged 
++			// because otherwise classes that have ctors/dtors with side-effects 
++			// may misbehave, for example classes with static instance/operations counters. 
++			aT_p=xNew<T>(size);
++			unsigned int iMax=(old_size<size)?old_size:size;
++			for (unsigned int i=0; i<iMax;++i) { 
++				// we need to copy the items by explicit assignments
++				aT_p[i]=old[i];
++			}
++			xDelete<T>(old);
++		}
++	}
++	return aT_p;
+ #else
+-  T* aT_p=0;
+-  aT_p=(T*)realloc((void*)old,size*sizeof(T));
+-  if (size) 
+-    assert(aT_p); // according to realloc behavior in manual page
+-  return aT_p;
++	T* aT_p=0;
++	aT_p=(T*)realloc((void*)old,size*sizeof(T));
++	if (size) 
++	 assert(aT_p); // according to realloc behavior in manual page
++	return aT_p;
+ #endif 
+ }
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13247)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13248)
+@@ -26,32 +26,6 @@
+ #include "../../include/include.h"
+ #include "../../classes/objects/objects.h"
+ 
+-void* xmalloc(int size){
+-
+-	void* memptr=NULL;
+-
+-	if(!size)_error_("attempting to 0 size allocation!");
+-
+-	/* Use the c library to do the allocation: */
+-	memptr=malloc(size);
+-	if(!memptr) _error_("memory allocation failed!");
+-
+-	return memptr;
+-}
+-
+-void* xcalloc(int n,int size){
+-
+-	void* memptr=NULL;
+-	
+-	if(!size)_error_("attempting to 0 size allocation!");
+-
+-	/* Use the c library to do the allocation: */
+-	memptr=calloc(n,size);
+-	if(!memptr) _error_("memory allocation failed!");
+-
+-	return memptr;
+-}
+-
+ void xfree(void* *pv){
+ 
+ 	if (pv && *pv){
+@@ -82,16 +56,3 @@
+ 		*pv=NULL;
+ 	}
+ }
+-
+-void* xrealloc( void* pv, int size){
+-	
+-	register void* value=NULL;
+-	
+-	if(!size)_error_("attempting to realloc to zero");
+-	value = (void*)realloc(pv,size);
+-
+-	if (value == NULL) {
+-		_error_("virtual memory exhausted");
+-	}
+-	return value;
+-}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/SplitMeshForRifts.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/SplitMeshForRifts.cpp	(revision 13247)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/SplitMeshForRifts.cpp	(revision 13248)
+@@ -75,15 +75,16 @@
+ 				 elements, we clone node into another node, and we swap all
+ 				 instances of node in the triangulation *for those elements, to the
+ 				 new node.*/
+-				
+-				//augment number of nodes 
+-				nods=nods+1;
++
+ 				//create new node
+-				x=(double*)xrealloc(x,nods*sizeof(double));
+-				y=(double*)xrealloc(y,nods*sizeof(double));
+-				x[nods-1]=x[node-1]; //matlab indexing
+-				y[nods-1]=y[node-1]; //matlab indexing
++				x=xReNew<double>(x,nods,nods+1);
++				y=xReNew<double>(y,nods,nods+1);
++				x[nods]=x[node-1]; //matlab indexing
++				y[nods]=y[node-1]; //matlab indexing
+ 
++				//augment number of nodes 
++				nods++;
++
+ 				//change elements owning this node
+ 				for (k=0;k<NumGridElementListOnOneSideOfRift;k++){
+ 					el=GridElementListOnOneSideOfRift[k];
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp	(revision 13247)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp	(revision 13248)
+@@ -264,8 +264,8 @@
+ 	nsegs=*pnsegs;
+ 
+ 	/*Reallocate segments: */
+-	segments=(double*)xrealloc(segments,(nsegs+nriftsegs)*3*sizeof(double));
+-	segmentmarkerlist=(double*)xrealloc(segmentmarkerlist,(nsegs+nriftsegs)*sizeof(double));
++	segments         =xReNew<double>(segments,         nsegs*3,(nsegs+nriftsegs)*3);
++	segmentmarkerlist=xReNew<double>(segmentmarkerlist,nsegs*3,(nsegs+nriftsegs)*3);
+ 
+ 	/*First, update the existing segments to the new nodes :*/
+ 	for (i=0;i<nriftsegs;i++){
+@@ -661,8 +661,8 @@
+ 	}
+ 
+ 	/*Reallocate x and y: */
+-	xreal=(double*)xrealloc(x,newnods*sizeof(double));
+-	yreal=(double*)xrealloc(y,newnods*sizeof(double));
++	xreal=xReNew<double>(x,nods,newnods);
++	yreal=xReNew<double>(y,nods,newnods);
+ 	counter1=0;
+ 	counter2=0;
+ 	for (i=0;i<nods;i++){
+@@ -1092,12 +1092,11 @@
+ 				}
+ 				if(triple==1){
+ 					/*el is a corner element: we need to split it in 3 triangles: */
+-					x=(double*)xrealloc(x,(nods+1)*sizeof(double));
+-					y=(double*)xrealloc(y,(nods+1)*sizeof(double));
++					x=xReNew<double>(x,nods,nods+1);
++					y=xReNew<double>(y,nods,nods+1);
+ 					x[nods]=(x[(int)node1-1]+x[(int)node2-1]+x[(int)node3-1])/3;
+ 					y[nods]=(y[(int)node1-1]+y[(int)node2-1]+y[(int)node3-1])/3;
+-
+-					index=(double*)xrealloc(index,(nel+2)*3*sizeof(double));
++					index=xReNew<double>(index,nel*3,(nel+2*3));
+ 					/*First, reassign element el: */
+ 					*(index+3*el+0)=node1;
+ 					*(index+3*el+1)=node2;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13248-13249.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13248-13249.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13248-13249.diff	(revision 13394)
@@ -0,0 +1,905 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cppcheck/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cppcheck/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cppcheck/install.sh	(revision 13249)
+@@ -14,7 +14,7 @@
+ 
+ #compile
+ cd src
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make 
+ else 
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cmake/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cmake/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/cmake/install.sh	(revision 13249)
+@@ -18,7 +18,7 @@
+ #Compile cmake
+ cd install 
+ ./bootstrap --prefix=$ISSM_DIR/externalpackages/cmake/install
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else 
+ 	make -j $1; 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh	(revision 13249)
+@@ -26,7 +26,7 @@
+  --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
+ 
+ #make
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh	(revision 13249)
+@@ -25,7 +25,7 @@
+ ./configure --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
+ 
+ #make
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh	(revision 13249)
+@@ -23,7 +23,7 @@
+  --prefix="$ISSM_DIR/externalpackages/python/install" \
+  --enable-shared
+ 
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh	(revision 13249)
+@@ -26,7 +26,7 @@
+ #./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-framework="$ISSM_DIR/externalpackages/python/install"
+ 
+ #make
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh	(revision 13249)
+@@ -23,7 +23,7 @@
+  --prefix="$ISSM_DIR/externalpackages/python/install" \
+  --enable-shared
+ 
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 13249)
+@@ -21,7 +21,7 @@
+ cd src 
+ ./configure \
+  --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr/install.sh	(revision 13249)
+@@ -22,7 +22,7 @@
+ ./configure  --prefix="$ISSM_DIR/externalpackages/apr/install" 
+ 
+ #Compile and install apr
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh	(revision 13249)
+@@ -1,9 +1,6 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Get number of cpus
+-NUMCPUS=$1;
+-
+ #version of mpich2
+ #version=1.0.2p1
+ version=1.3.1
+@@ -40,11 +37,11 @@
+ fi
+ 
+ #Compile mpich2
+-if [ -z $NUMCPUS ];
++if [ $# -eq 0 ];
+ then
+ 	make
+ else
+-	make -j $NUMCPUS
++	make -j $1
+ fi
+ make install 
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh	(revision 13249)
+@@ -29,7 +29,7 @@
+ 	--enable-fc
+ 
+ #Compile mpich2
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh	(revision 13249)
+@@ -31,7 +31,7 @@
+ patch -R ./src/include/mpicxx.h ../configs/1.0.2/linux64/mpicxx.h.patch
+ 
+ #Compile mpich2
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh	(revision 13249)
+@@ -31,7 +31,7 @@
+ patch -R ./src/include/mpicxx.h ../configs/1.0.2/altix64/mpicxx.h.patch
+ 
+ #Compile mpich2
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh	(revision 13249)
+@@ -27,7 +27,7 @@
+ 	--enable-f91=gfortran 
+ 
+ #Compile mpich2
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh	(revision 13249)
+@@ -30,7 +30,7 @@
+ patch -R ./src/include/mpicxx.h ../configs/1.0.2/macosx32/mpicxx.h.patch
+ 
+ #Compile mpich2
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh	(revision 13249)
+@@ -28,7 +28,7 @@
+ patch -R ./src/include/mpicxx.h ../configs/1.0.2/win32/mpicxx.h.patch
+ 
+ #Compile mpich2
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh	(revision 13249)
+@@ -29,7 +29,7 @@
+ 	--enable-fc
+ 
+ #Compile mpich2
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/freetype/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/freetype/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/freetype/install.sh	(revision 13249)
+@@ -22,7 +22,7 @@
+ sudo ./configure 
+ 
+ #Compile and install freetype
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	sudo make
+ else
+ 	sudo make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gmake/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gmake/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gmake/install.sh	(revision 13249)
+@@ -21,7 +21,7 @@
+ #Configure and compile: 
+ ./configure --prefix=$ISSM_DIR/externalpackages/gmake/install
+ 
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ 	make install
+ else 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/shapelib/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/shapelib/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/shapelib/install.sh	(revision 13249)
+@@ -25,7 +25,7 @@
+ 
+ # Build shapelib and run self-tests
+ cd src
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/install-linux64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/install-linux64.sh	(revision 13249)
+@@ -20,7 +20,7 @@
+ cp ../configs/linux64/make.inc ./
+ 
+ #Compile and install lapack
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make lib
+ else
+ 	make -j $1 lib
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adic/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adic/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adic/install.sh	(revision 13249)
+@@ -26,7 +26,7 @@
+ 	--with-xaifbooster=$ISSM_DIR/externalpackages/xaifbooster/xaifBooster \
+ 	--with-colpack=$ISSM_DIR/externalpackages/colpack/install\
+ 	--prefix=$ISSM_DIR/externalpackages/adic/install 
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install-macosx64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/modules/install-macosx64.sh	(revision 13249)
+@@ -31,7 +31,7 @@
+ 	--disable-dependency-tracking
+ 
+ #Compile and install modules
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/rose/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/rose/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/rose/install.sh	(revision 13249)
+@@ -22,7 +22,7 @@
+ 	--with-boost=$ISSM_DIR/externalpackages/boost/install\
+ 	--srcdir=$ISSM_DIR/externalpackages/rose/source
+ 
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/colpack/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/colpack/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/colpack/install.sh	(revision 13249)
+@@ -15,7 +15,7 @@
+ 
+ #compile
+ cd src
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/chaco/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/chaco/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/chaco/install.sh	(revision 13249)
+@@ -23,7 +23,7 @@
+ 
+ # Build chaco
+ cd src/code
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/doxygen/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/doxygen/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/doxygen/install.sh	(revision 13249)
+@@ -9,7 +9,7 @@
+ 
+ #Configure doxygen
+ cd install && ./configure --prefix "$ISSM_DIR/externalpackages/doxygen/install"
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tcl/install.sh	(revision 13249)
+@@ -28,7 +28,7 @@
+ if [[ $sudochoice == "0" ]]; 
+ then 
+ 	./configure --prefix=$ISSM_DIR/externalpackages/tcl/install
+-	if [ -z $1 ]; then
++	if [ $# -eq 0 ]; then
+ 		make
+ 	else
+ 		make -j $1
+@@ -40,7 +40,7 @@
+ if [[ $sudochoice == "1" ]]; 
+ then
+ 	sudo ./configure 
+-	if [ -z $1 ]; then
++	if [ $# -eq 0 ]; then
+ 		sudo make
+ 	else
+ 		sudo make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/hdf5/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/hdf5/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/hdf5/install.sh	(revision 13249)
+@@ -19,7 +19,7 @@
+ #Configure and compile
+ cd src
+ ./configure  --prefix="$ISSM_DIR/externalpackages/hdf5/install" 
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/sqlite/install.sh	(revision 13249)
+@@ -22,7 +22,7 @@
+ ./configure  --prefix="$ISSM_DIR/externalpackages/sqlite/install" 
+ 
+ #Compile and install sqlite-autoconf
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh	(revision 13249)
+@@ -29,7 +29,7 @@
+  --with-python="$ISSM_DIR/externalpackages/python/install/bin/python"
+ 
+ #Compile and install gdal
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install.sh	(revision 13249)
+@@ -19,7 +19,6 @@
+ mv ADOL-C-2.2.0/* src
+ rm -rf ADOL-C-2.2.0
+ 
+-
+ #Compile ADOL-C
+ cd src 
+ 
+@@ -35,7 +34,7 @@
+ 	--enable-addexa \
+ 	--disable-shave
+ 
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+@@ -53,11 +52,9 @@
+ done
+ 
+ #remake: 
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+ fi
+ make install
+-
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/graphviz/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/graphviz/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/graphviz/install.sh	(revision 13249)
+@@ -22,7 +22,7 @@
+ 
+ #Compile and install
+ cd src
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/apr-util/install.sh	(revision 13249)
+@@ -22,7 +22,7 @@
+ ./configure  --prefix="$ISSM_DIR/externalpackages/apr-util/install" --with-apr="$ISSM_DIR/externalpackages/apr/install"
+ 
+ #Compile and install apr-util
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-macosx64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-macosx64.sh	(revision 13249)
+@@ -1,9 +1,6 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Get number of cpus
+-NUMCPUS=$1;
+-
+ #Some cleanup
+ rm -rf Dakota
+ rm -rf src 
+@@ -84,13 +81,13 @@
+ 
+ #Compile and install dakota
+ cd src 
+-if [ -z $NUMCPUS ];
++if [ $# -eq 0 ];
+ then
+ 	make
+ 	make install
+ else
+-	make -j $NUMCPUS
+-	make -j $NUMCPUS install
++	make -j $1
++	make -j $1 install
+ fi
+ cd ..
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-pleiades.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-pleiades.sh	(revision 13249)
+@@ -1,9 +1,6 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Get number of cpus
+-NUMCPUS=$1;
+-
+ #Some cleanup
+ rm -rf Dakota
+ rm -rf src
+@@ -84,13 +81,13 @@
+ 
+ #Compile and install dakota
+ cd src
+-if [ -z $NUMCPUS ];
++if [ $# -eq 0 ];
+ then
+ 	make
+ 	make install
+ else
+-	make -j $NUMCPUS
+-	make -j $NUMCPUS install
++	make -j $1
++	make -j $1 install
+ fi
+ cd ..
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-altix64-cosmos.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-altix64-cosmos.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-altix64-cosmos.sh	(revision 13249)
+@@ -1,9 +1,6 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Get number of cpus
+-NUMCPUS=$1;
+-
+ #Some cleanup
+ rm -rf Dakota
+ rm -rf src 
+@@ -84,13 +81,13 @@
+ 
+ #Compile and install dakota
+ cd src 
+-if [ -z $NUMCPUS ];
++if [ $# -eq 0 ];
+ then
+ 	make
+ 	make install
+ else
+-	make -j $NUMCPUS
+-	make -j $NUMCPUS install
++	make -j $1
++	make -j $1 install
+ fi
+ cd ..
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-astrid.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-astrid.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-astrid.sh	(revision 13249)
+@@ -1,9 +1,6 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Get number of cpus
+-NUMCPUS=$1;
+-
+ #Some cleanup
+ rm -rf Dakota
+ rm -rf src 
+@@ -84,13 +81,13 @@
+ 
+ #Compile and install dakota
+ cd src 
+-if [ -z $NUMCPUS ];
++if [ $# -eq 0 ];
+ then
+ 	make
+ 	make install
+ else
+-	make -j $NUMCPUS
+-	make -j $NUMCPUS install
++	make -j $1
++	make -j $1 install
+ fi
+ cd ..
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-murdo.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-murdo.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-linux64-murdo.sh	(revision 13249)
+@@ -1,9 +1,6 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Get number of cpus
+-NUMCPUS=$1;
+-
+ #Some cleanup
+ rm -rf Dakota
+ rm -rf src 
+@@ -84,13 +81,13 @@
+ 
+ #Compile and install dakota
+ cd src 
+-if [ -z $NUMCPUS ];
++if [ $# -eq 0 ];
+ then
+ 	make
+ 	make install
+ else
+-	make -j $NUMCPUS
+-	make -j $NUMCPUS install
++	make -j $1
++	make -j $1 install
+ fi
+ cd ..
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-discover.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-discover.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/dakota/install-discover.sh	(revision 13249)
+@@ -1,9 +1,6 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Get number of cpus
+-NUMCPUS=$1;
+-
+ #Some cleanup
+ rm -rf Dakota
+ rm -rf src
+@@ -84,13 +81,13 @@
+ 
+ #Compile and install dakota
+ cd src
+-if [ -z $NUMCPUS ];
++if [ $# -eq 0 ];
+ then
+ 	make
+ 	make install
+ else
+-	make -j $NUMCPUS
+-	make -j $NUMCPUS install
++	make -j $1
++	make -j $1 install
+ fi
+ cd ..
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/oofem/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/oofem/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/oofem/install.sh	(revision 13249)
+@@ -23,7 +23,7 @@
+ 
+ #Compile oofem 
+ cd targets/oofem-2.0
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/slepc/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/slepc/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/slepc/install.sh	(revision 13249)
+@@ -18,7 +18,7 @@
+ #Make slepc
+ cd install
+ ./config/configure.py
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/svn/install.sh	(revision 13249)
+@@ -25,7 +25,7 @@
+ 	--with-sqlite="$ISSM_DIR/externalpackages/sqlite/install"
+ 
+ #Compile and install subversion
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install.sh	(revision 13249)
+@@ -33,7 +33,7 @@
+ patch GDALmake.opt ../GDALmake.opt.patch
+ 
+ #Compile and install gdal
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install-murdo.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install-murdo.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gdal/install-murdo.sh	(revision 13249)
+@@ -31,7 +31,7 @@
+ patch GDALmake.opt ../GDALmake.opt.patch
+ 
+ #Compile and install gdal
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tk/install.sh	(revision 13249)
+@@ -25,7 +25,7 @@
+ if [[ $sudochoice == "0" ]]; 
+ then 
+ 	./configure --prefix=$ISSM_DIR/externalpackages/tk/install
+-	if [ -z $1 ]; then
++	if [ $# -eq 0 ]; then
+ 		make
+ 	else
+ 		make -j $1
+@@ -37,7 +37,7 @@
+ if [[ $sudochoice == "1" ]]; 
+ then
+ 	sudo ./configure 
+-	if [ -z $1 ]; then
++	if [ $# -eq 0 ]; then
+ 		sudo make
+ 	else
+ 		sudo make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/octave/install.sh	(revision 13249)
+@@ -21,11 +21,11 @@
+  --prefix=$ISSM_DIR/externalpackages/octave/install \
+  --disable-readline
+ 
+-if [ -z $NUMCPUS ];
++if [ $# -eq 0 ];
+ then
+ 	make
+ 	make install
+ else
+-	make -j $NUMCPUS
+-	make -j $NUMCPUS install
++	make -j $1
++	make -j $1 install
+ fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-macosx64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-macosx64.sh	(revision 13249)
+@@ -24,7 +24,7 @@
+ 	--prefix="$ISSM_DIR/externalpackages/gsl/install" 
+ 
+ #Compile gsl
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-pleiades.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-pleiades.sh	(revision 13249)
+@@ -22,7 +22,7 @@
+ 	--prefix="$ISSM_DIR/externalpackages/gsl/install" 
+ 
+ #Compile gsl
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-linux64.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-linux64.sh	(revision 13249)
+@@ -22,7 +22,7 @@
+ 	--prefix="$ISSM_DIR/externalpackages/gsl/install" 
+ 
+ #Compile gsl
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/gsl/install-android.sh	(revision 13249)
+@@ -35,7 +35,7 @@
+ 
+ #Compile gsl
+ if [[ $step == "3" || $step == "0" ]]; then
+-    if [ -z $1 ]; then
++    if [ $# -eq 0 ]; then
+ 	    make $j 
+     else
+ 	    make -j $j 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/esmf/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/esmf/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/esmf/install.sh	(revision 13249)
+@@ -32,7 +32,7 @@
+ 
+ 
+ 	#Compile and install esmf
+-	if [ -z $1 ]; then
++	if [ $# -eq 0 ]; then
+ 		make
+ 		make install
+ 	else
+@@ -43,7 +43,7 @@
+ 
+ if [[ $install == "2" ]]; then
+ 	cd esmf
+-	if [ -z $1 ]; then
++	if [ $# -eq 0 ]; then
+ 		make all_tests
+ 	else
+ 		make -j $1 all_tests
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.2.sh	(revision 13249)
+@@ -22,7 +22,7 @@
+ ./configure \
+  --prefix="$ISSM_DIR/externalpackages/netcdf/install"  \
+  --disable-doxygen
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.0.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.0.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/netcdf/install-4.0.sh	(revision 13249)
+@@ -19,7 +19,7 @@
+ #Configure and compile
+ cd src
+ ./configure  --prefix="$ISSM_DIR/externalpackages/netcdf/install"  
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/tclx/install.sh	(revision 13249)
+@@ -24,7 +24,7 @@
+ 	        --with-tcl=$ISSM_DIR/externalpackages/tcl/install/Library/Frameworks/Tcl.framework
+ 
+ #Compile and install tclx
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	make
+ else
+ 	make -j $1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libpng/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libpng/install.sh	(revision 13248)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libpng/install.sh	(revision 13249)
+@@ -22,7 +22,7 @@
+ sudo ./configure 
+ 
+ #Compile and install libpng
+-if [ -z $1 ]; then
++if [ $# -eq 0 ]; then
+ 	sudo make
+ else
+ 	sudo make -j $1
Index: /issm/oecreview/Archive/12678-13393/ISSM-13249-13250.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13249-13250.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13249-13250.diff	(revision 13394)
@@ -0,0 +1,200 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp	(revision 13249)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp	(revision 13250)
+@@ -111,8 +111,8 @@
+ 		if (verbose) _printLine_(czip);
+ 
+ 		if (mexEvalString(czip)) _error_("Error zipping file \"" << filkmz << "\".");
+-		xfree((void**)&czip);
+-		xfree((void**)&filkmz);
++		xDelete<char>(czip);
++		xDelete<char>(filkmz);
+ 	}
+ 
+ 	/*Write data: */
+@@ -120,13 +120,13 @@
+ 
+ 	/*Clean-up*/
+ 	if (pimages) {
+-		for (i=nimages; i>0; i--) xfree((void**)&(pimages[i-1]));
+-		xfree((void**)&pimages);
++		for (i=nimages; i>0; i--) xDelete<char>(pimages[i-1]);
++		xDelete<char*>(pimages);
+ 	}
+-	xfree((void**)&longaxis);
+-	xfree((void**)&lataxis);
++	xDelete<double>(longaxis);
++	xDelete<double>(lataxis);
++	xDelete<char>(filkml);
+ 	delete options;
+-	xfree((void**)&filkml);
+ 
+ 	/*end module: */
+ 	MODULEEND();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp	(revision 13249)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp	(revision 13250)
+@@ -117,9 +117,9 @@
+ 	WriteData(ERRORFLAG,ierror);
+ 
+ 	/*Clean-up*/
+-	xfree((void**)&write);
+-	xfree((void**)&deepecho);
+-	xfree((void**)&echo);
++	xDelete<char>(write);
++	xDelete<char>(deepecho);
++	xDelete<char>(echo);
+ 	delete options;
+ 
+ 	/*end module: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp	(revision 13249)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp	(revision 13250)
+@@ -91,8 +91,8 @@
+ 
+ 	/*Clean-up*/
+ 	delete options;
+-	xfree((void**)&filkml);
+-	xfree((void**)&filshp);
++	xDelete<char>(filkml);
++	xDelete<char>(filshp);
+ 
+ 	/*end module: */
+ 	MODULEEND();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp	(revision 13249)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp	(revision 13250)
+@@ -86,10 +86,10 @@
+ 	WriteData(RET_OUT,iret);
+ 
+ 	/*Clean-up*/
+-	xfree((void**)&choles);
++	xDelete<char>(choles);
++	xDelete<char>(filkml);
++	xDelete<char>(filexp);
+ 	delete options;
+-	xfree((void**)&filkml);
+-	xfree((void**)&filexp);
+ 
+ 	/*end module: */
+ 	MODULEEND();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp	(revision 13249)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp	(revision 13250)
+@@ -79,9 +79,9 @@
+ 	WriteData(RET_OUT,iret);
+ 
+ 	/*Clean-up*/
++	xDelete<char>(filexp);
++	xDelete<char>(filkml);
+ 	delete options;
+-	xfree((void**)&filexp);
+-	xfree((void**)&filkml);
+ 
+ 	/*end module: */
+ 	MODULEEND();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp	(revision 13249)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp	(revision 13250)
+@@ -38,8 +38,8 @@
+ 	WriteData(POOLOUT,pool,nel);
+ 
+ 	/*Free ressources: */
+-	xfree((void**)&connectivity);
+-	xfree((void**)&flags);
++	xDelete<double>(connectivity);
++	xDelete<double>(flags);
+ 
+ 	/*end module: */
+ 	MODULEEND();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp	(revision 13249)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/InternalFront/InternalFront.cpp	(revision 13250)
+@@ -88,7 +88,7 @@
+ 		front2=xNew<double>(4*numberofsegments);
+ 		for(i=0;i<4*numberofsegments;i++) front2[i]=(double)front[i];
+ 	}
+-	xfree((void**)&front);
++	xDelete<int>(front);
+ 
+ 	/*write output datasets: */
+ 	WriteData(FRONT,front2,numberofsegments,4);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.cpp	(revision 13249)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Kriging/Kriging.cpp	(revision 13250)
+@@ -59,13 +59,14 @@
+ 	if(nlhs==2) WriteData(ERROR,error,M_interp,N_interp);
+ 
+ 	/*Free ressources: */
+-	xfree((void**)&x);
+-	xfree((void**)&y);
+-	xfree((void**)&observations);
+-	xfree((void**)&x_interp);
+-	xfree((void**)&y_interp);
+-	xfree((void**)&predictions);
+-	xfree((void**)&error);
++	xDelete<double>(x);
++	xDelete<double>(y);
++	xDelete<double>(observations);
++	xDelete<double>(x_interp);
++	xDelete<double>(y_interp);
++	xDelete<double>(predictions);
++	xDelete<double>(error);
++	delete options;
+ 
+ 	/*end module: */
+ 	MODULEEND();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 13249)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 13250)
+@@ -141,7 +141,7 @@
+ 
+ 	/*Clean-up*/
+ 	delete options;
+-	if (mxIsCell(NOTES) && notes) xfree((void**)&notes);
++	if (mxIsCell(NOTES) && notes) xDelete<char>(notes);
+ 
+ 	/*end module: */
+ 	MODULEEND();
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp	(revision 13249)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/Chaco/Chaco.cpp	(revision 13250)
+@@ -118,17 +118,17 @@
+ 	WriteData(ASSGN_OUT,doubleassignment,nvtxs);
+ 
+ 	/*Free ressources:*/
+-	xfree((void**)&assignment); 
+-	xfree((void**)&goal);
+-	xfree((void**)&nparts);
+-	xfree((void**)&z);
+-	xfree((void**)&y);
+-	xfree((void**)&x);
+-	xfree((void**)&ewgts);
+-	xfree((void**)&vwgts);
+-	xfree((void**)&adjacency);
+-	xfree((void**)&start);
+-	xfree((void**)&doubleassignment);
++	xDelete<short>(assignment); 
++	xDelete<double>(goal);
++	xDelete<int>(nparts);
++	xDelete<float>(z);
++	xDelete<float>(y);
++	xDelete<float>(x);
++	xDelete<float>(ewgts);
++	xDelete<int>(vwgts);
++	xDelete<int>(adjacency);
++	xDelete<int>(start);
++	xDelete<double>(doubleassignment);
+ 
+ 	/*end module: */
+ 	MODULEEND();
Index: /issm/oecreview/Archive/12678-13393/ISSM-13250-13251.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13250-13251.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13250-13251.diff	(revision 13394)
@@ -0,0 +1,38 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.h	(revision 13250)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.h	(revision 13251)
+@@ -6,12 +6,10 @@
+ #define _ALLOC_H_
+ 
+ #include "../../include/include.h"
++#include "./xNewDelete.h"
+ 
+ template <class doubletype> class Matrix;
+ template <class doubletype> class Vector;
+-void xfree(void** pvptr);
+ void xdelete(Matrix<IssmDouble>** pvptr);
+ void xdelete(Vector<IssmDouble>** pvptr);
+-
+-#include "./xNewDelete.h"
+ #endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13250)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 13251)
+@@ -26,15 +26,6 @@
+ #include "../../include/include.h"
+ #include "../../classes/objects/objects.h"
+ 
+-void xfree(void* *pv){
+-
+-	if (pv && *pv){
+-		free(*pv);
+-
+-		*pv=NULL;
+-	}
+-}
+-
+ void xdelete(Matrix<IssmDouble>** pv){
+ 	
+ 	if (pv && *pv){
Index: /issm/oecreview/Archive/12678-13393/ISSM-13251-13252.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13251-13252.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13251-13252.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh	(revision 13251)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh	(revision 13252)
+@@ -38,4 +38,4 @@
+ 
+ #Patch pyport.h:
+ cd include
+-patch pyport.h ../patch/pyport.h.patch
++patch pyport.h $ISSM_DIR/externalpackages/python/patches/pyport.h.patch
Index: /issm/oecreview/Archive/12678-13393/ISSM-13252-13253.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13252-13253.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13252-13253.diff	(revision 13394)
@@ -0,0 +1,79 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas/install-macosx64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas/install-macosx64.sh	(revision 13253)
+@@ -0,0 +1,29 @@
++#!/bin/bash
++set -eu 
++
++#Some cleanup
++rm -rf src install BLAS blas.tgz
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/blas.tgz' 'blas.tgz'
++
++#Untar 
++tar -zxvf  blas.tgz
++
++#Move blas into install directory
++mv BLAS/* src
++rm -rf BLAS
++
++#install
++cd src 
++cp ../configs/macosx64/make.inc ./
++make 
++
++#Compile 
++cd ../install
++mkdir lib
++cd lib
++cp ../../src/*.a .
++ln -s blas_LINUX.a blas.a
++ln -s blas_LINUX.a libblas.a
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas/install-macosx64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas/configs/macosx64/make.inc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas/configs/macosx64/make.inc	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/blas/configs/macosx64/make.inc	(revision 13253)
+@@ -0,0 +1,34 @@
++####################################################################
++#  BLAS make include file.                                         #
++#  March 2007                                                      #
++####################################################################
++#
++SHELL = /bin/sh
++#
++#  The machine (platform) identifier to append to the library names
++#
++PLAT = _LINUX
++#  
++#  Modify the FORTRAN and OPTS definitions to refer to the
++#  compiler and desired compiler options for your machine.  NOOPT
++#  refers to the compiler options desired when NO OPTIMIZATION is
++#  selected.  Define LOADER and LOADOPTS to refer to the loader and 
++#  desired load options for your machine.
++#
++FORTRAN  = gfortran
++OPTS     = -fPIC -O3
++DRVOPTS  = $(OPTS)
++NOOPT    =
++LOADER   = gfortran
++LOADOPTS =
++#
++#  The archiver and the flag(s) to use when building archive (library)
++#  If you system has no ranlib, set RANLIB = echo.
++#
++ARCH     = ar
++ARCHFLAGS= cr
++RANLIB   = ranlib
++#
++#  The location and name of the Reference BLAS library.
++#
++BLASLIB      = blas$(PLAT).a
Index: /issm/oecreview/Archive/12678-13393/ISSM-13253-13254.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13253-13254.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13253-13254.diff	(revision 13394)
@@ -0,0 +1,20 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.m	(revision 13253)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matice.m	(revision 13254)
+@@ -27,12 +27,12 @@
+ 					obj=setdefaultparameters(obj);
+ 				case 1
+ 					inputstruct=varargin{1};
+-					list = properties('matice');
++					list1 = properties('matice');
+ 					list2 = fieldnames(inputstruct);
+-					for i=list1
++					for i=1:length(list1)
+ 						fieldname = list1{i};
+ 						if ismember(fieldname,list2),
+-							obj.(filename) = inputstruct.(filename);
++							obj.(fieldname) = inputstruct.(fieldname);
+ 						end
+ 					end
+ 				otherwise
Index: /issm/oecreview/Archive/12678-13393/ISSM-13254-13255.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13254-13255.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13254-13255.diff	(revision 13394)
@@ -0,0 +1,44 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Bamgx/Bamgx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Bamgx/Bamgx.cpp	(revision 13254)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Bamgx/Bamgx.cpp	(revision 13255)
+@@ -118,7 +118,7 @@
+ 		if(bamgopts->hVertices && bamgopts->hVerticesSize[0]==BTh.nbv){
+ 			if (verbosity>1) _printLine_("   Merging Metric with hVertices...");
+ 			for (i=0;i<BTh.nbv;i++){
+-				if (!xIsNan<IssmDouble>(bamgopts->hVertices[i])){
++				if (!xIsNan<IssmPDouble>(bamgopts->hVertices[i])){
+ 					BTh[i].m=Metric((float)bamgopts->hVertices[i]);
+ 				}
+ 			}
+@@ -128,7 +128,7 @@
+ 		if (bamgopts->hminVertices){
+ 			if (verbosity>1) _printLine_("   Merging Metric with hminVertices...");
+ 			for (i=0;i<BTh.nbv;i++){
+-				if (!xIsNan<IssmDouble>(bamgopts->hminVertices[i])){
++				if (!xIsNan<IssmPDouble>(bamgopts->hminVertices[i])){
+ 					Metric M=BTh.vertices[i].m;
+ 					EigenMetric Vp(M/coef);
+ 					Vp.Minh(bamgopts->hminVertices[i]);
+@@ -141,7 +141,7 @@
+ 		if (bamgopts->hmaxVertices){
+ 			if (verbosity>1) _printLine_("   Merging Metric with hmaxVertices...");
+ 			for (i=0;i<BTh.nbv;i++){
+-				if (!xIsNan<IssmDouble>(bamgopts->hmaxVertices[i])){
++				if (!xIsNan<IssmPDouble>(bamgopts->hmaxVertices[i])){
+ 					Metric M=BTh.vertices[i].m;
+ 					EigenMetric Vp(M/coef);
+ 					Vp.Maxh(bamgopts->hmaxVertices[i]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp	(revision 13254)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp	(revision 13255)
+@@ -182,7 +182,7 @@
+ 		if(bamgopts->hVertices && bamgopts->hVerticesSize[0]==nbv){
+ 			if(verbose>5) _printLine_("      processing hVertices");
+ 			for (i=0;i< nbv;i++){
+-				if (!xIsNan<IssmDouble>(bamgopts->hVertices[i])){
++				if (!xIsNan<IssmPDouble>(bamgopts->hVertices[i])){
+ 					vertices[i].m=Metric((double)bamgopts->hVertices[i]);
+ 				}
+ 			}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13255-13256.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13255-13256.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13255-13256.diff	(revision 13394)
@@ -0,0 +1,85 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13255)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/matlab/Makefile.am	(revision 13256)
+@@ -88,8 +88,11 @@
+ if SHAREDLIBS
+ deps +=
+ else
+-deps += ../../c/libISSMModules.a ../../c/libISSMCore.a
++deps += ../../c/libISSMModules.a ../../c/libISSMCore.a  
++if ADOLC
++deps += $(ADOLCLIB)
+ endif
++endif
+ 
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS) 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-ad.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-ad.sh	(revision 13255)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-ad.sh	(revision 13256)
+@@ -17,4 +17,4 @@
+ 	--without-3d \
+ 	--without-groundingline \
+ 	--without-kriging  \
+-	--with-adolc-dir=$ADOLC_DIR 
++	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-ad.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-ad.sh	(revision 13255)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-ad.sh	(revision 13256)
+@@ -1,36 +1,10 @@
+ #!/bin/sh
+ 
+ ./configure \
+- --prefix=$ISSM_DIR \
+- --with-serial=no\
+- --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
+- --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+- --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
+- --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" \
+- --with-petsc-arch=$ISSM_ARCH \
+- --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+- --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+- --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
+- --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+- --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+- --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+- --with-graphics-lib=/usr/lib64/libX11.so \
+- --with-cxxoptflags="-march=opteron -O2" \
+- --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" \
+- --with-rose-dir=$ISSM_DIR/externalpackages/rose/install/ \
+- --with-adic2-dir=$ISSM_DIR/externalpackages/adic/install/ \
+- --with-numthreads=24 \
+- --without-thermal \
+- --without-control \
+- --without-hydrology \
+- --without-diagnostic \
+- --without-balanced \
+- --without-responses \
+- --without-slope \
+- --without-rifts \
+- --without-steadystate \
+- --without-transient \
+- --without-3d \
+- --without-groundingline
+- 
+-#--without-prognostic \
++	--prefix=$ISSM_DIR \
++	--without-kriging  \
++	--without-kml  \
++	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
++	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install \
++	--with-matlab-dir=$MATLAB_DIR \
++	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/lib
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/lib	(revision 13255)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/lib	(revision 13256)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/lib
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1 ##
++*.mexa64
Index: /issm/oecreview/Archive/12678-13393/ISSM-13256-13257.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13256-13257.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13256-13257.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc	(revision 13256)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc	(revision 13257)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++adolc_v220_issm
+ trunk
+ *.gz
+ install*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13257-13258.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13257-13258.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13257-13258.diff	(revision 13394)
@@ -0,0 +1,458 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3001.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3001.m	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3001.m	(revision 13258)
+@@ -4,7 +4,7 @@
+ md=setflowequation(md,'macayeal','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.diagnostic.requested_outputs=StressTensorEnum;
+-md.autodiff.isautodiff=false;
++md.autodiff.isautodiff=true;
+ md=solve(md,DiagnosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3005.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3005.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3005.m	(revision 13258)
+@@ -0,0 +1,14 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.autodiff.isautodiff=true;
++md=solve(md,PrognosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.PrognosticSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3009.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3009.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3009.m	(revision 13258)
+@@ -0,0 +1,20 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.isdiagnostic=0;
++md.transient.isprognostic=0;
++md.transient.isthermal=1;
++md.transient.isgroundingline=0;
++md.autodiff.isautodiff=true;
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Temperature),...
++	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3010.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3010.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3010.m	(revision 13258)
+@@ -0,0 +1,41 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs=IceVolumeEnum();
++
++md.autodiff.isautodiff=true;
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Volume3'};
++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};
++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).Bed),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).IceVolume),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Bed),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).IceVolume),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Bed),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).IceVolume),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m	(revision 13258)
+@@ -16,6 +16,7 @@
+ %                      'eismint': validation of eismint tests
+ %                      'thermal': validation of thermal tests
+ %                      'mesh'   : validation of mesh tests
++%                      'adolc'   : validation of adolc tests
+ %                      ...
+ %      'procedure'     'check' : run the test (default)
+ %                      'update': update the archive
+@@ -46,7 +47,7 @@
+ %Process options
+ %GET benchmark {{{1
+ benchmark=getfieldvalue(options,'benchmark','nightly');
+-if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing'})
++if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc'})
+ 	disp('runme warning: benchmark not supported, defaulting to test ''nightly''')
+ 	benchmark='nightly';
+ end
+@@ -103,6 +104,8 @@
+ 	test_ids=intersect(test_ids,[1301:1399]);
+ elseif strcmpi(benchmark,'mesh'),
+ 	test_ids=intersect(test_ids,[1401:1499]);
++elseif strcmpi(benchmark,'adolc'),
++	test_ids=intersect(test_ids,[3001:3010]);
+ elseif strcmpi(benchmark,'validation'),
+ 	test_ids=intersect(test_ids,[1001:1999]);
+ elseif strcmpi(benchmark,'tranforcing'),
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3002.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3002.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3002.m	(revision 13258)
+@@ -0,0 +1,19 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,2);
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.autodiff.isautodiff=true;
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3006.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3006.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3006.m	(revision 13258)
+@@ -0,0 +1,17 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=meshconvert(md);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.prognostic.stabilization=3;
++md.prognostic.spcthickness=md.geometry.thickness;
++md.autodiff.isautodiff=true;
++md=solve(md,PrognosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.PrognosticSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.m	(revision 13258)
+@@ -186,5 +186,15 @@
+ 	case 1601, name='SquareShelfM2dRotation';
+ 	case 1602, name='SquareSheetShelfP3dRotation';
+ 	case 3001, name='SquareShelfConstrainedDiagM2dAdolc';
++	case 3002, name='SquareShelfConstrainedDiagM3dAdolc';
++	case 3003, name='SquareShelfConstrainedDiagP3dAdolc';
++	case 3004, name='SquareShelfConstrainedDiagS3dAdolc';
++	case 3005, name='SquareShelfConstrainedProg2dAdolc';
++	case 3006, name='SquareShelfConstrainedProg2dDGAdolc';
++	case 3007, name='SquareShelfConstrainedProg3dAdolc';
++	case 3008, name='SquareShelfConstrainedTherSteaAdolc';
++	case 3009, name='SquareShelfConstrainedTherTranAdolc';
++	case 3010, name='SquareShelfConstrainedTranM2dAdolc';
++
+ 	otherwise, name='N/A';
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3003.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3003.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3003.m	(revision 13258)
+@@ -0,0 +1,28 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,2);
++md=setflowequation(md,'pattyn','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.diagnostic.requested_outputs=StressTensorEnum;
++md.autodiff.isautodiff=true;
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure',...
++	'StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,...
++	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	(md.results.DiagnosticSolution.StressTensorxx),...
++	(md.results.DiagnosticSolution.StressTensoryy),...
++	(md.results.DiagnosticSolution.StressTensorzz),...
++	(md.results.DiagnosticSolution.StressTensorxy),...
++	(md.results.DiagnosticSolution.StressTensorxz),...
++	(md.results.DiagnosticSolution.StressTensoryz),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3007.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3007.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3007.m	(revision 13258)
+@@ -0,0 +1,15 @@
++md=triangle(model,'../Exp/Square.exp',150000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md=extrude(md,5,3);
++md.cluster=generic('name',oshostname(),'np',3);
++md.autodiff.isautodiff=true;
++md=solve(md,PrognosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.PrognosticSolution.Thickness),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3004.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3004.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3004.m	(revision 13258)
+@@ -0,0 +1,19 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,2);
++md=setflowequation(md,'stokes','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.autodiff.isautodiff=true;
++md=solve(md,DiagnosticSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={1e-08,1e-08,1e-07,1e-08,1e-08};
++field_values={...
++	(md.results.DiagnosticSolution.Vx),...
++	(md.results.DiagnosticSolution.Vy),...
++	(md.results.DiagnosticSolution.Vz),...
++	(md.results.DiagnosticSolution.Vel),...
++	(md.results.DiagnosticSolution.Pressure),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3008.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3008.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test3008.m	(revision 13258)
+@@ -0,0 +1,17 @@
++md=triangle(model,'../Exp/Square.exp',180000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=extrude(md,3,1);
++md=setflowequation(md,'macayeal','all');
++md.timestepping.time_step=0;
++md.cluster=generic('name',oshostname(),'np',3);
++md.autodiff.isautodiff=true;
++md=solve(md,ThermalSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_tolerances={1e-13,1e-13};
++field_values={...
++	(md.results.ThermalSolution.Temperature),...
++	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++	};
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/IdToName.py	(revision 13258)
+@@ -187,6 +187,15 @@
+ 		1601 : 'SquareShelfM2dRotation',
+ 		1602 : 'SquareSheetShelfP3dRotation', 
+ 		3001 : 'SquareShelfConstrainedDiagM2dAdolc',
++		3002 : 'SquareShelfConstrainedDiagM3dAdolc',
++		3003 : 'SquareShelfConstrainedDiagP3dAdolc',
++		3004 : 'SquareShelfConstrainedDiagS3dAdolc',
++		3005 : 'SquareShelfConstrainedProg2dAdolc',
++		3006 : 'SquareShelfConstrainedProg2dDGAdolc',
++		3007 : 'SquareShelfConstrainedProg3dAdolc',
++		3008 : 'SquareShelfConstrainedTherSteaAdolc',
++		3009 : 'SquareShelfConstrainedTherTranAdolc',
++		3010 : 'SquareShelfConstrainedTranM2dAdolc',
+ 	}
+ 
+ 	if not id == 0:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3002.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3002.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3002.nc	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3002.nc	(revision 13258)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3002.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3005.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3005.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3005.nc	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3005.nc	(revision 13258)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3005.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3008.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3008.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3008.nc	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3008.nc	(revision 13258)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3008.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3003.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3003.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3003.nc	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3003.nc	(revision 13258)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3003.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3006.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3006.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3006.nc	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3006.nc	(revision 13258)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3006.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3001.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3001.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3001.nc	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3001.nc	(revision 13258)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3001.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3009.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3009.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3009.nc	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3009.nc	(revision 13258)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3009.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3010.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3010.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3010.nc	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3010.nc	(revision 13258)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3010.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3004.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3004.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3004.nc	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3004.nc	(revision 13258)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3004.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3007.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3007.nc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3007.nc	(revision 13257)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3007.nc	(revision 13258)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Archives/Archive3007.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-13258-13259.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13258-13259.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13258-13259.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13258)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13259)
+@@ -77,7 +77,7 @@
+ if [ $IS_INSTALL -eq 0 ]; then
+ 	cat << END >> report.html
+ 	<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+-	<tr><td $BODY_FONTC>Status: <span style=\"color:#ff0000\">Installation failed<\/span></td></tr>
++	<tr><td $BODY_FONTC>Status: <span style=\"color:#ff0000\">Installation failed</span></td></tr>
+ 	</table>
+ 	<table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table>
+ 	</div>
Index: /issm/oecreview/Archive/12678-13393/ISSM-13259-13260.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13259-13260.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13259-13260.diff	(revision 13394)
@@ -0,0 +1,80 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh	(revision 13259)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh	(revision 13260)
+@@ -1,5 +1,4 @@
+ #!/bin/bash
+-set -eu
+ 
+ #version of mpich2
+ #version=1.0.2p1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh	(revision 13259)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh	(revision 13260)
+@@ -1,5 +1,4 @@
+ #!/bin/bash
+-set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.4
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh	(revision 13259)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh	(revision 13260)
+@@ -1,5 +1,4 @@
+ #!/bin/bash
+-set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.0.2p1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh	(revision 13259)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh	(revision 13260)
+@@ -1,5 +1,4 @@
+ #!/bin/bash
+-set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.0.2p1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh	(revision 13259)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh	(revision 13260)
+@@ -1,5 +1,4 @@
+ #!/bin/bash
+-set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.4
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh	(revision 13259)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh	(revision 13260)
+@@ -1,5 +1,4 @@
+ #!/bin/bash
+-set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.0.2p1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh	(revision 13259)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh	(revision 13260)
+@@ -1,5 +1,4 @@
+ #!/bin/bash
+-set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.0.2p1
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh	(revision 13259)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh	(revision 13260)
+@@ -1,5 +1,4 @@
+ #!/bin/bash
+-set -eu
+ 
+ #Some cleanup
+ rm -rf src install mpich2-1.4
Index: /issm/oecreview/Archive/12678-13393/ISSM-13260-13261.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13260-13261.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13260-13261.diff	(revision 13394)
@@ -0,0 +1,367 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13260)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13261)
+@@ -35,14 +35,14 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Observations::Observations(IssmDouble* observations_list,IssmDouble* x,IssmDouble* y,int n,Options* options){{{*/
+-Observations::Observations(IssmDouble* observations_list,IssmDouble* x,IssmDouble* y,int n,Options* options){
++/*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){
+ 
+ 	/*Intermediaries*/
+ 	int          i,j,maxdepth,level,counter,index;
+ 	int          xi,yi;
+-	IssmDouble       xmin,xmax,ymin,ymax;
+-	IssmDouble       offset,minlength,minspacing,mintrimming,maxtrimming;
++	IssmPDouble       xmin,xmax,ymin,ymax;
++	IssmPDouble       offset,minlength,minspacing,mintrimming,maxtrimming;
+ 	Observation *observation = NULL;
+ 
+ 	/*Get extrema*/
+@@ -65,11 +65,11 @@
+ 	if(options->GetOption("boxlength")){
+ 		options->Get(&minlength,"boxlength");
+ 		if(minlength<=0)_error_("boxlength should be a positive number");
+-		maxdepth=reCast<int,IssmDouble>(log(max(xmax-xmin,ymax-ymin)/minlength +1)/log(2.0));
++		maxdepth=reCast<int,IssmPDouble>(log(max(xmax-xmin,ymax-ymin)/minlength +1)/log(2.0));
+ 	}
+ 	else{
+ 		maxdepth = 30;
+-		minlength=max(xmax-xmin,ymax-ymin)/IssmDouble((1L<<maxdepth)-1);
++		minlength=max(xmax-xmin,ymax-ymin)/IssmPDouble((1L<<maxdepth)-1);
+ 	}
+ 
+ 	/*Initialize Quadtree*/
+@@ -117,12 +117,12 @@
+ 
+ /*Methods*/
+ /*FUNCTION Observations::ClosestObservation{{{*/
+-void Observations::ClosestObservation(IssmDouble *px,IssmDouble *py,IssmDouble *pobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius){
++void Observations::ClosestObservation(IssmPDouble *px,IssmPDouble *py,IssmPDouble *pobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius){
+ 
+ 	/*Output and Intermediaries*/
+ 	bool         stop;
+ 	int          nobs,i,index;
+-	IssmDouble       h2,hmin2,radius2;
++	IssmPDouble  h2,hmin2,radius2;
+ 	int         *indices      = NULL;
+ 	Observation *observation  = NULL;
+ 
+@@ -165,19 +165,19 @@
+ 	xDelete<int>(indices);
+ 
+ }/*}}}*/
+-/*FUNCTION Observations::ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int maxdata){{{*/
+-void Observations::ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int maxdata){
++/*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){
+ 
+ 	/*Output and Intermediaries*/
+ 	bool         stop;
+ 	int          nobs,tempnobs,i,j,k,n,counter;
+-	IssmDouble       h2,radius2;
++	IssmPDouble  h2,radius2;
+ 	int         *indices      = NULL;
+ 	int         *tempindices  = NULL;
+-	IssmDouble      *dists        = NULL;
+-	IssmDouble      *x            = NULL;
+-	IssmDouble      *y            = NULL;
+-	IssmDouble      *obs          = NULL;
++	IssmPDouble *dists        = NULL;
++	IssmPDouble *x            = NULL;
++	IssmPDouble *y            = NULL;
++	IssmPDouble *obs          = NULL;
+ 	Observation *observation  = NULL;
+ 
+ 	/*If radius is not provided or is 0, return all observations*/
+@@ -190,7 +190,7 @@
+ 	this->quadtree->RangeSearch(&tempindices,&tempnobs,x_interp,y_interp,radius);
+ 	if(tempnobs){
+ 		indices = xNew<int>(tempnobs);
+-		dists   = xNew<IssmDouble>(tempnobs);
++		dists   = xNew<IssmPDouble>(tempnobs);
+ 	}
+ 	nobs = 0;
+ 	for (i=0;i<tempnobs;i++){
+@@ -225,14 +225,14 @@
+ 			if(stop) break;
+ 		}
+ 	}  
+-	xDelete<IssmDouble>(dists);
++	xDelete<IssmPDouble>(dists);
+ 	xDelete<int>(tempindices);
+ 
+ 	if(nobs){
+ 		/*Allocate vectors*/
+-		x   = xNew<IssmDouble>(nobs);
+-		y   = xNew<IssmDouble>(nobs);
+-		obs = xNew<IssmDouble>(nobs);
++		x   = xNew<IssmPDouble>(nobs);
++		y   = xNew<IssmPDouble>(nobs);
++		obs = xNew<IssmPDouble>(nobs);
+ 
+ 		/*Loop over all observations and fill in x, y and obs*/
+ 		for (i=0;i<nobs;i++){
+@@ -248,22 +248,22 @@
+ 	*pobs=obs;
+ 	*pnobs=nobs;
+ }/*}}}*/
+-/*FUNCTION Observations::ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs){{{*/
+-void Observations::ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs){
++/*FUNCTION 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;
+-	IssmDouble      *x            = NULL;
+-	IssmDouble      *y            = NULL;
+-	IssmDouble      *obs          = NULL;
++	IssmPDouble *x            = NULL;
++	IssmPDouble *y            = NULL;
++	IssmPDouble *obs          = NULL;
+ 	Observation *observation  = NULL;
+ 
+ 	nobs = this->Size();
+ 
+ 	if(nobs){
+-		x   = xNew<IssmDouble>(nobs);
+-		y   = xNew<IssmDouble>(nobs);
+-		obs = xNew<IssmDouble>(nobs);
++		x   = xNew<IssmPDouble>(nobs);
++		y   = xNew<IssmPDouble>(nobs);
++		obs = xNew<IssmPDouble>(nobs);
+ 		for(int i=0;i<this->Size();i++){
+ 			observation=(Observation*)this->GetObjectByOffset(i);
+ 			observation->WriteXYObs(&x[i],&y[i],&obs[i]);
+@@ -277,15 +277,15 @@
+ 	*pnobs=nobs;
+ }/*}}}*/
+ /*FUNCTION Observations::InterpolationIDW{{{*/
+-void Observations::InterpolationIDW(IssmDouble *pprediction,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int mindata,int maxdata,IssmDouble 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;
+-	IssmDouble prediction;
+-	IssmDouble numerator,denominator,h,weight;
+-	IssmDouble *x   = NULL;
+-	IssmDouble *y   = NULL;
+-	IssmDouble *obs = NULL;
++	int         i,n_obs;
++	IssmPDouble prediction;
++	IssmPDouble numerator,denominator,h,weight;
++	IssmPDouble *x   = NULL;
++	IssmPDouble *y   = NULL;
++	IssmPDouble *obs = NULL;
+ 
+ 	/*Some checks*/
+ 	_assert_(maxdata>0);
+@@ -321,26 +321,26 @@
+ 
+ 	/*clean-up*/
+ 	*pprediction = prediction;
+-	xDelete<IssmDouble>(x);
+-	xDelete<IssmDouble>(y);
+-	xDelete<IssmDouble>(obs);
++	xDelete<IssmPDouble>(x);
++	xDelete<IssmPDouble>(y);
++	xDelete<IssmPDouble>(obs);
+ }/*}}}*/
+ /*FUNCTION Observations::InterpolationKriging{{{*/
+-void Observations::InterpolationKriging(IssmDouble *pprediction,IssmDouble *perror,IssmDouble x_interp,IssmDouble y_interp,IssmDouble 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;
+-	IssmDouble        prediction,error;
+-	IssmDouble        numerator,denominator,ratio;
+-	IssmDouble       *x            = NULL;
+-	IssmDouble       *y            = NULL;
+-	IssmDouble       *obs          = NULL;
+-	IssmDouble       *Gamma        = NULL;
+-	IssmDouble       *GinvG0       = NULL;
+-	IssmDouble       *Ginv1        = NULL;
+-	IssmDouble       *GinvZ        = NULL;
+-	IssmDouble       *gamma0       = NULL;
+-	IssmDouble       *ones         = NULL;
++	IssmPDouble   prediction,error;
++	IssmPDouble   numerator,denominator,ratio;
++	IssmPDouble  *x            = NULL;
++	IssmPDouble  *y            = NULL;
++	IssmPDouble  *obs          = NULL;
++	IssmPDouble  *Gamma        = NULL;
++	IssmPDouble  *GinvG0       = NULL;
++	IssmPDouble  *Ginv1        = NULL;
++	IssmPDouble  *GinvZ        = NULL;
++	IssmPDouble  *gamma0       = NULL;
++	IssmPDouble  *ones         = NULL;
+ 
+ 	/*Some checks*/
+ 	_assert_(mindata>0 && maxdata>0);
+@@ -360,9 +360,9 @@
+ 	}
+ 
+ 	/*Allocate intermediary matrix and vectors*/
+-	Gamma  = xNew<IssmDouble>(n_obs*n_obs);
+-	gamma0 = xNew<IssmDouble>(n_obs);
+-	ones   = xNew<IssmDouble>(n_obs);
++	Gamma  = xNew<IssmPDouble>(n_obs*n_obs);
++	gamma0 = xNew<IssmPDouble>(n_obs);
++	ones   = xNew<IssmPDouble>(n_obs);
+ 
+ 	/*First: Create semivariogram matrix for observations*/
+ 	for(i=0;i<n_obs;i++){
+@@ -401,22 +401,22 @@
+ 	/*clean-up*/
+ 	*pprediction = prediction;
+ 	*perror = error;
+-	xDelete<IssmDouble>(x);
+-	xDelete<IssmDouble>(y);
+-	xDelete<IssmDouble>(obs);
+-	xDelete<IssmDouble>(Gamma);
+-	xDelete<IssmDouble>(gamma0);
+-	xDelete<IssmDouble>(ones);
+-	xDelete<IssmDouble>(GinvG0);
+-	xDelete<IssmDouble>(Ginv1);
+-	xDelete<IssmDouble>(GinvZ);
++	xDelete<IssmPDouble>(x);
++	xDelete<IssmPDouble>(y);
++	xDelete<IssmPDouble>(obs);
++	xDelete<IssmPDouble>(Gamma);
++	xDelete<IssmPDouble>(gamma0);
++	xDelete<IssmPDouble>(ones);
++	xDelete<IssmPDouble>(GinvG0);
++	xDelete<IssmPDouble>(Ginv1);
++	xDelete<IssmPDouble>(GinvZ);
+ 
+ }/*}}}*/
+ /*FUNCTION Observations::InterpolationNearestNeighbor{{{*/
+-void Observations::InterpolationNearestNeighbor(IssmDouble *pprediction,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius){
++void Observations::InterpolationNearestNeighbor(IssmPDouble *pprediction,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius){
+ 
+ 	/*Intermediaries*/
+-	IssmDouble        x,y,obs;
++	IssmPDouble x,y,obs;
+ 
+ 	/*Get clostest observation*/
+ 	this->ClosestObservation(&x,&y,&obs,x_interp,y_interp,radius);
+@@ -425,27 +425,27 @@
+ 	*pprediction = obs;
+ }/*}}}*/
+ /*FUNCTION Observations::QuadtreeColoring{{{*/
+-void Observations::QuadtreeColoring(IssmDouble* A,IssmDouble *x,IssmDouble *y,int n){
++void Observations::QuadtreeColoring(IssmPDouble* A,IssmPDouble *x,IssmPDouble *y,int n){
+ 
+ 	int xi,yi,level;
+ 
+ 	for(int i=0;i<n;i++){
+ 		this->quadtree->IntergerCoordinates(&xi,&yi,x[i],y[i]);
+ 		this->quadtree->QuadtreeDepth(&level,xi,yi);
+-		A[i]=(IssmDouble)level;
++		A[i]=(IssmPDouble)level;
+ 	}
+ 
+ }/*}}}*/
+ /*FUNCTION Observations::Variomap{{{*/
+-void Observations::Variomap(IssmDouble* gamma,IssmDouble *x,int n){
++void Observations::Variomap(IssmPDouble* gamma,IssmPDouble *x,int n){
+ 
+ 	/*Output and Intermediaries*/
+ 	int          i,j,k;
+-	IssmDouble       distance;
++	IssmPDouble  distance;
+ 	Observation *observation1 = NULL;
+ 	Observation *observation2 = NULL;
+ 
+-	IssmDouble *counter = xNew<IssmDouble>(n);
++	IssmPDouble *counter = xNew<IssmPDouble>(n);
+ 	for(j=0;j<n;j++) counter[j] = 0.0;
+ 	for(j=0;j<n;j++) gamma[j]   = 0.0;
+ 
+@@ -474,5 +474,5 @@
+ 	}
+ 
+ 	/*Assign output pointer*/
+-	xDelete<IssmDouble>(counter);
++	xDelete<IssmPDouble>(counter);
+ }/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13260)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13261)
+@@ -23,6 +23,7 @@
+ #endif
+ 
+ void SolverxSeq(SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf,Parameters* parameters);
++void SolverxSeq(IssmPDouble **pX, IssmPDouble *A, IssmPDouble *B,int n);
+ void SolverxSeq(IssmPDouble *X, IssmPDouble *A, IssmPDouble *B,int n);
+ 
+ #ifdef _HAVE_ADOLC_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13260)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13261)
+@@ -51,21 +51,32 @@
+ 	#endif
+ 
+ }/*}}}*/
++void SolverxSeq(IssmPDouble **pX, IssmPDouble *A, IssmPDouble *B,int n){ /*{{{*/
++
++	/*Allocate output*/
++	double* X = xNew<double>(n); 
++
++	/*Solve*/
++	SolverxSeq(X,A,B,n);
++
++	/*Assign output pointer*/
++	*pX=X;
++}
++/*}}}*/
++
+ #ifdef _HAVE_ADOLC_
+-
+-int EDF_for_solverx(int n, IssmPDouble *x, int m, IssmPDouble *y) {
++int EDF_for_solverx(int n, IssmPDouble *x, int m, IssmPDouble *y){/*{{{*/
+     if(m*(m+1)!=n)_error_("Stiffness matrix should be square!");
+     SolverxSeq(y,x, x+m*m, m);
+     return 0;
+-}
+-
+-void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){//{{{
++}/*}}}*/
++void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
+ 	// pack inputs to conform to the EDF-prescribed interface
+-        IssmDouble*  adoubleEDFin=xNew<IssmDouble>(n*(n+1)); // packed inputs, i.e. matrix and right hand side
+-        for(int i=0; i<n*n;i++)adoubleEDFin[i]    =A[i]; // pack matrix
+-        for(int i=0; i<n;  i++)adoubleEDFin[i+n*n]=B[i]; // pack the right hand side
++        IssmDouble*  adoubleEDFin=xNew<IssmDouble>(n*(n+1));  // packed inputs, i.e. matrix and right hand side
++        for(int i=0; i<n*n;i++)adoubleEDFin[i]    =A[i];      // pack matrix
++        for(int i=0; i<n;  i++)adoubleEDFin[i+n*n]=B[i];      // pack the right hand side
+         IssmPDouble* pdoubleEDFin=xNew<IssmPDouble>(n*(n+1)); // provide space to transfer inputs during call_ext_fct
+-	IssmPDouble* pdoubleEDFout=xNew<IssmPDouble>(n);       // provide space to transfer outputs during call_ext_fct
++	IssmPDouble* pdoubleEDFout=xNew<IssmPDouble>(n);           // provide space to transfer outputs during call_ext_fct
+ 	// call the wrapped solver through the registry entry we retrieve from parameters
+ 	call_ext_fct(dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p,
+ 	             n*(n+1), pdoubleEDFin, adoubleEDFin,
+@@ -76,8 +87,8 @@
+ }
+ /*}}}*/
+ #endif
+-void SolverxSeq(IssmPDouble * X, IssmPDouble * A, IssmPDouble * B,int n){ //{{{
+-	#ifdef _HAVE_GSL_
++void SolverxSeq(IssmPDouble *X, IssmPDouble *A, IssmPDouble *B,int n){ /*{{{*/
++#ifdef _HAVE_GSL_
+ 	/*GSL Matrices and vectors: */
+ 	int              s;
+ 	gsl_matrix_view  a;
+@@ -108,6 +119,6 @@
+ 	xDelete(Acopy);
+ 	gsl_permutation_free(p);
+ 	gsl_vector_free(x);
+-	#endif
++#endif
+ }
+ /*}}}*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-13261-13262.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13261-13262.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13261-13262.diff	(revision 13394)
@@ -0,0 +1,120 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/install-macosx64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/install-macosx64.sh	(revision 13262)
+@@ -0,0 +1,33 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf src install lapack-3.4.1 lapack-3.4.1.tgz
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/lapack-3.4.1.tgz' 'lapack-3.4.1.tgz'
++
++#Untar 
++tar -zxvf  lapack-3.4.1.tgz
++
++#Move lapack into install directory
++mv lapack-3.4.1/* src
++rm -rf lapack-3.4.1
++
++#install
++cd src 
++cp ../configs/macosx64/make.inc ./
++
++#Compile and install lapack
++if [ $# -eq 0 ]; then
++	make lib
++else
++	make -j $1 lib
++fi
++
++#Compile 
++cd ../install
++mkdir lib
++cd lib
++cp ../../src/liblapack.a .
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/install-macosx64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/configs/macosx64/make.inc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/configs/macosx64/make.inc	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/lapack/configs/macosx64/make.inc	(revision 13262)
+@@ -0,0 +1,71 @@
++####################################################################
++#  LAPACK make include file.                                       #
++#  LAPACK, Version 3.4.0                                           #
++#  April 2012                                                   #
++####################################################################
++#
++SHELL = /bin/sh
++#  
++#  Modify the FORTRAN and OPTS definitions to refer to the
++#  compiler and desired compiler options for your machine.  NOOPT
++#  refers to the compiler options desired when NO OPTIMIZATION is
++#  selected.  Define LOADER and LOADOPTS to refer to the loader and 
++#  desired load options for your machine.
++#
++FORTRAN  = gfortran 
++OPTS     = -fPIC -O2
++DRVOPTS  = $(OPTS)
++NOOPT    = -fPIC -O0
++LOADER   = gfortran
++LOADOPTS =
++#
++# Timer for the SECOND and DSECND routines
++#
++# Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME
++#TIMER    = EXT_ETIME
++# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_
++# TIMER    = EXT_ETIME_
++# For gfortran compiler: SECOND and DSECND will use a call to the INTERNAL FUNCTION ETIME
++TIMER    = INT_ETIME
++# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc...)
++# SECOND and DSECND will use a call to the INTERNAL FUNCTION CPU_TIME
++# TIMER    = INT_CPU_TIME
++# If neither of this works...you can use the NONE value... In that case, SECOND and DSECND will always return 0
++# TIMER     = NONE
++#
++#  Configuration LAPACKE: Native C interface to LAPACK
++#  To generate LAPACKE library: type 'make lapackelib'
++#  Configuration file: turned off (default)
++#  Complex types: C99 (default)
++#  Name pattern: mixed case (default)
++#  (64-bit) Data model: LP64 (default)
++#
++# CC is the C compiler, normally invoked with options CFLAGS.
++#
++CC = gcc
++CFLAGS = -O3
++#
++#  The archiver and the flag(s) to use when building archive (library)
++#  If you system has no ranlib, set RANLIB = echo.
++#
++ARCH     = ar
++ARCHFLAGS= cr
++RANLIB   = ranlib
++#
++#  Location of the extended-precision BLAS (XBLAS) Fortran library
++#  used for building and testing extended-precision routines.  The
++#  relevant routines will be compiled and XBLAS will be linked only if
++#  USEXBLAS is defined.
++#
++# USEXBLAS    = Yes
++XBLASLIB     =
++# XBLASLIB    = -lxblas
++#
++#  The location of the libraries to which you will link.  (The 
++#  machine-specific, optimized BLAS library should be used whenever
++#  possible.)
++#
++BLASLIB      = ../../librefblas.a
++LAPACKLIB    = liblapack.a
++TMGLIB       = libtmglib.a
++LAPACKELIB   = liblapacke.a
Index: /issm/oecreview/Archive/12678-13393/ISSM-13262-13263.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13262-13263.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13262-13263.diff	(revision 13394)
@@ -0,0 +1,163 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64sh	(revision 13262)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64sh	(revision 13263)
+@@ -1,29 +0,0 @@
+-#!/bin/bash
+-#Install Python nose module
+-
+-pythonversion=2
+-	
+-rm -rf src 
+-
+-if [[ $pythonversion == "3" ]];then
+-
+-	svn checkout http://python-nose.googlecode.com/svn/branches/py3k
+-	mv py3k src
+-
+-	cd src
+-	python ./setup.py build
+-	python ./setup.py install
+-fi
+-
+-if [[ $pythonversion == "2" ]];then
+-
+-	#Download from ISSM server
+-	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/nose-1.1.2.tar.gz' 'nose-1.1.2.tar.gz'
+-	tar -zxvf  nose-1.1.2.tar.gz
+-	mv nose-1.1.2 src
+-	rm -rf nose-1.1.2
+-
+-	cd src
+-	python ./setup.py build
+-	python ./setup.py install
+-fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64.sh	(revision 13262)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64.sh	(revision 13263)
+@@ -1,30 +0,0 @@
+-#!/bin/bash
+-set -eu
+-#Install Python nose module
+-
+-pythonversion=2
+-	
+-rm -rf src 
+-
+-if [[ $pythonversion == "3" ]];then
+-
+-	svn checkout http://python-nose.googlecode.com/svn/branches/py3k
+-	mv py3k src
+-
+-	cd src
+-	python ./setup.py build
+-	python ./setup.py install
+-fi
+-
+-if [[ $pythonversion == "2" ]];then
+-
+-	#Download from ISSM server
+-	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/nose-1.1.2.tar.gz' 'nose-1.1.2.tar.gz'
+-	tar -zxvf  nose-1.1.2.tar.gz
+-	mv nose-1.1.2 src
+-	rm -rf nose-1.1.2
+-
+-	cd src
+-	python ./setup.py build
+-	python ./setup.py install
+-fi
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64-python2.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64-python2.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64-python2.sh	(revision 13263)
+@@ -0,0 +1,14 @@
++#!/bin/bash
++#Install Python nose module
++
++rm -rf src 
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/nose-1.1.2.tar.gz' 'nose-1.1.2.tar.gz'
++tar -zxvf  nose-1.1.2.tar.gz
++mv nose-1.1.2 src
++rm -rf nose-1.1.2
++
++cd src
++python ./setup.py build
++python ./setup.py install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64-python2.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64-python3.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64-python3.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64-python3.sh	(revision 13263)
+@@ -0,0 +1,11 @@
++#!/bin/bash
++#Install Python nose module
++
++rm -rf src 
++
++svn checkout http://python-nose.googlecode.com/svn/branches/py3k
++mv py3k src
++
++cd src
++python ./setup.py build
++python ./setup.py install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-macosx64-python3.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64-python2.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64-python2.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64-python2.sh	(revision 13263)
+@@ -0,0 +1,14 @@
++#!/bin/bash
++#Install Python nose module
++
++rm -rf src 
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/nose-1.1.2.tar.gz' 'nose-1.1.2.tar.gz'
++tar -zxvf  nose-1.1.2.tar.gz
++mv nose-1.1.2 src
++rm -rf nose-1.1.2
++
++cd src
++python ./setup.py build
++python ./setup.py install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64-python2.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64-python3.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64-python3.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64-python3.sh	(revision 13263)
+@@ -0,0 +1,11 @@
++#!/bin/bash
++#Install Python nose module
++
++rm -rf src 
++
++svn checkout http://python-nose.googlecode.com/svn/branches/py3k
++mv py3k src
++
++cd src
++python ./setup.py build
++python ./setup.py install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/nose/install-linux64-python3.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13263-13264.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13263-13264.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13263-13264.diff	(revision 13394)
@@ -0,0 +1,254 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh	(revision 13263)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh	(revision 13264)
+@@ -3,44 +3,18 @@
+ PYVERSION=2.7
+ PYTHON=python${PYVERSION}
+ 
+-#1: install numpy
+-#2 install scipy
+-#3 erase
+-install=2
+-
+ # gfortran 4.6 (see ISSM_DIR/externalpackages/gfortran) is necessary for ISSM compilation.
+ # On OSX 10.6, this recommended version gets installed in /usr/local/gfortran 
+ export CC=/usr/local/gfortran/bin/gcc
+ export CXX=/usr/local/gfortran/bin/g++
+ 
+-if [[ $install == "1" ]];then 
++#download scipy
++git clone https://github.com/scipy/scipy.git
+ 
+-	#download numpy first
+-	git clone https://github.com/numpy/numpy.git
+-
+-	#install numpy
+-	cd numpy
+-	python setup.py build
+-	python setup.py install
+-	cd ..
+-	${PYTHON} -c "import numpy; print 'Installed NumPy', numpy.__version__"
+-	${PYTHON} -c "import numpy; numpy.test()"
+-	
+-elif [[ $install == "2" ]];then 
+-	
+-	#download scipy
+-	git clone https://github.com/scipy/scipy.git
+-
+-	#install scipy
+-	cd scipy
+-	python setup.py build
+-	python setup.py install
+-	cd ..
+-	${PYTHON} -c "import scipy; print 'Installed SciPy', scipy.__version__"
+-	${PYTHON} -c "import scipy; scipy.test()"
+-
+-elif [[ $install == "3" ]];then 
+-	rm -rf numpy scipy
+-else 
+-	echo "Choice not covered"
+-fi
++#install scipy
++cd scipy
++python setup.py build
++python setup.py install
++cd ..
++${PYTHON} -c "import scipy; print 'Installed SciPy', scipy.__version__"
++${PYTHON} -c "import scipy; scipy.test()"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh	(revision 13263)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh	(revision 13264)
+@@ -10,20 +10,8 @@
+ export FFLAGS=-ff2c
+ 
+ #clean up
+-rm -rf numpy scipy
++rm -rf scipy
+ 
+-#download numpy first
+-export GIT_SSL_NO_VERIFY=true 
+-git clone https://github.com/numpy/numpy.git
+-
+-#install numpy
+-cd numpy
+-python setup.py build
+-python setup.py install
+-cd ..
+-${PYTHON} -c "import numpy; print 'Installed NumPy', numpy.__version__"
+-${PYTHON} -c "import numpy; numpy.test()"
+-
+ #download scipy
+ export GIT_SSL_NO_VERIFY=true 
+ git clone https://github.com/scipy/scipy.git
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-lion.sh	(revision 13263)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-lion.sh	(revision 13264)
+@@ -1,40 +1,14 @@
+ #!/bin/bash
+ set -eu
+ 
+-#1: install numpy
+-#2 install scipy
+-#3 erase
+-install=2
+-
+-
+ export CC=gcc
+ export CXX=g++
+ export FFLAGS=-ff2c
+-
+-
+-if [[ $install == "1" ]];then 
+-
+-	#download numpy first
+-	git clone https://github.com/numpy/numpy.git
+-
+-	#install numpy
+-	cd numpy
+-	python setup.py build
+-	python setup.py install
+-
+ 	
+-elif [[ $install == "2" ]];then 
+-	
+-	#download scipy
+-	git clone https://github.com/scipy/scipy.git
++#download scipy
++git clone https://github.com/scipy/scipy.git
+ 
+-	#install scipy
+-	cd scipy
+-	python setup.py build
+-	python setup.py install
+-
+-elif [[ $install == "3" ]];then 
+-	rm -rf numpy scipy
+-else 
+-	echo "Choice not covered"
+-fi
++#install scipy
++cd scipy
++python setup.py build
++python setup.py install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh	(revision 13264)
+@@ -0,0 +1,20 @@
++#!/bin/bash
++set -eu
++PYVERSION=2.7
++PYTHON=python${PYVERSION}
++
++# gfortran 4.6 (see ISSM_DIR/externalpackages/gfortran) is necessary for ISSM compilation.
++# On OSX 10.6, this recommended version gets installed in /usr/local/gfortran 
++export CC=/usr/local/gfortran/bin/gcc
++export CXX=/usr/local/gfortran/bin/g++
++
++#download numpy first
++git clone https://github.com/numpy/numpy.git
++
++#install numpy
++cd numpy
++python setup.py build
++python setup.py install
++cd ..
++${PYTHON} -c "import numpy; print 'Installed NumPy', numpy.__version__"
++${PYTHON} -c "import numpy; numpy.test()"
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-linux64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-linux64.sh	(revision 13264)
+@@ -0,0 +1,25 @@
++#!/bin/bash
++set -eu
++PYVERSION=2.7
++PYTHON=python${PYVERSION}
++
++export CC="gcc -fPIC"
++export CXX="g++ -fPIC"
++export F77="gfortran -fPIC"
++export FC="gfortran -fPIC"
++export FFLAGS=-ff2c
++
++#clean up
++rm -rf numpy
++
++#download numpy first
++export GIT_SSL_NO_VERIFY=true 
++git clone https://github.com/numpy/numpy.git
++
++#install numpy
++cd numpy
++python setup.py build
++python setup.py install
++cd ..
++${PYTHON} -c "import numpy; print 'Installed NumPy', numpy.__version__"
++${PYTHON} -c "import numpy; numpy.test()"
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-linux64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-lion.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-lion.sh	(revision 13264)
+@@ -0,0 +1,14 @@
++#!/bin/bash
++set -eu
++
++export CC=gcc
++export CXX=g++
++export FFLAGS=-ff2c
++
++#download numpy first
++git clone https://github.com/numpy/numpy.git
++
++#install numpy
++cd numpy
++python setup.py build
++python setup.py install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-lion.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/README
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/README	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/README	(revision 13264)
+@@ -0,0 +1,9 @@
++For OSX 10.7 (Lion), the instructions here can be followed:  
++http://www.scipy.org/Installing_SciPy/Mac_OS_X
++
++For OSX 10.6 (Snow Leopard), the scipy folks recommend gcc and g++ version 4.0.
++However, ISSM needs the gfortran version recommended in $ISSM_DIR/externalpackages/gfortran.
++On the webpage listed above, make sure the "export CC" and "export CXX" commands point to the 
++binaries associated with this gfortran version (likely in /usr/local/gfortran/bin by default).
++Once this gfortran is installed, the install script in this directory for Snow Leopard should
++work.
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy	(revision 13263)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy	(revision 13264)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,4 ##
++scipy
++scipy-*
++numpy
++numpy-*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13264-13265.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13264-13265.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13264-13265.diff	(revision 13394)
@@ -0,0 +1,28 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/79North.data
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetShelf.data
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelfConstrained.data
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/Pig.data
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareShelf.data
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/SquareSheetConstrained.data
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/Data/ISMIPE.data
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/12678-13393/ISSM-13265-13266.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13265-13266.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13265-13266.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh	(revision 13265)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh	(revision 13266)
+@@ -1,5 +1,4 @@
+ #!/bin/bash
+-set -eu
+ PYVERSION=2.7
+ PYTHON=python${PYVERSION}
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13266-13267.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13266-13267.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13266-13267.diff	(revision 13394)
@@ -0,0 +1,160 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13266)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13267)
+@@ -22,13 +22,13 @@
+ 	char *outbinfilename = NULL;
+ 
+ 	/*Input*/
+-	int      ninterp,nobs;
+-	IssmDouble  *x        = NULL;
+-	IssmDouble  *y        = NULL;
+-	IssmDouble  *data     = NULL;
+-	IssmDouble  *x_interp = NULL;
+-	IssmDouble  *y_interp = NULL;
+-	Options *options  = NULL;
++	int         ninterp,nobs;
++	IssmDouble *x        = NULL;
++	IssmDouble *y        = NULL;
++	IssmDouble *data     = NULL;
++	IssmDouble *x_interp = NULL;
++	IssmDouble *y_interp = NULL;
++	Options    *options  = NULL;
+ 
+ 	/*Output*/
+ 	IssmDouble *predictions = NULL;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 13266)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 13267)
+@@ -14,8 +14,23 @@
+ #include "../../include/include.h"
+ #include "./matlabio.h"
+ 
+-GenericOption<double*>* OptionDoubleParse( char* name, const mxArray* prhs[]){ /*{{{*/
++GenericOption<double>* OptionDoubleParse( char* name, const mxArray* prhs[]){ /*{{{*/
+ 
++	GenericOption<double> *odouble = NULL;
++
++	/*check and parse the name  */
++	odouble=new GenericOption<double>();
++	odouble->name =xNew<char>(strlen(name)+1);
++	memcpy(odouble->name,name,(strlen(name)+1)*sizeof(char));
++	FetchData(&odouble->value,prhs[0]);
++	odouble->numel=1;
++	odouble->ndims=1;
++	odouble->size=NULL;
++
++	return(odouble);
++}/*}}}*/
++GenericOption<double*>* OptionDoubleArrayParse( char* name, const mxArray* prhs[]){ /*{{{*/
++
+ 	GenericOption<double*> *odouble = NULL;
+ 
+ 	/*check and parse the name  */
+@@ -159,15 +174,22 @@
+ }/*}}}*/
+ Option* OptionParse(char* name, const mxArray* prhs[]){ /*{{{*/
+ 
+-	Option *option = NULL;
+-	mxArray       *lhs[1];
++	Option  *option = NULL;
++	mxArray *lhs[1];
+ 
+ 	/*parse the value according to the matlab data type  */
+-	if     (mxIsClass(prhs[0],"double"))  option=(Option*)OptionDoubleParse(name,prhs);
+-	else if(mxIsClass(prhs[0],"logical")) option=(Option*)OptionLogicalParse(name,prhs);
+-	else if(mxIsClass(prhs[0],"char"))    option=(Option*)OptionCharParse(name,prhs);
+-	else if(mxIsClass(prhs[0],"struct"))  option=(Option*)OptionStructParse(name,prhs);
+-	else if(mxIsClass(prhs[0],"cell"))    option=(Option*)OptionCellParse(name,prhs);
++	if     (mxIsClass(prhs[0],"double")  && (mxGetNumberOfElements(prhs[0])==1))
++	 option=(Option*)OptionDoubleParse(name,prhs);
++	else if(mxIsClass(prhs[0],"double")  && (mxGetNumberOfElements(prhs[0])!=1))
++	 option=(Option*)OptionDoubleArrayParse(name,prhs);
++	else if(mxIsClass(prhs[0],"logical"))
++	 option=(Option*)OptionLogicalParse(name,prhs);
++	else if(mxIsClass(prhs[0],"char"))
++	 option=(Option*)OptionCharParse(name,prhs);
++	else if(mxIsClass(prhs[0],"struct"))
++	 option=(Option*)OptionStructParse(name,prhs);
++	else if(mxIsClass(prhs[0],"cell"))
++	 option=(Option*)OptionCellParse(name,prhs);
+ 	else {
+ 		_pprintLine_("  Converting value of option \"" << name << "\" from unrecognized class \"" << mxGetClassName(prhs[0]) << "\" to class \"" << "struct" << "\".");
+ 		if (!mexCallMATLAB(1,lhs,1,(mxArray**)prhs,"struct")) {
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 13266)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 13267)
+@@ -50,7 +50,8 @@
+ void FetchData(Options** poptions,int istart, int nrhs,const mxArray** pdataref);
+ 
+ Option* OptionParse(char* name, const mxArray* prhs[]);
+-GenericOption<double*>*   OptionDoubleParse( char* name, const mxArray* prhs[]);
++GenericOption<double>*    OptionDoubleParse( char* name, const mxArray* prhs[]);
++GenericOption<double*>*   OptionDoubleArrayParse( char* name, const mxArray* prhs[]);
+ GenericOption<bool*>*     OptionLogicalParse( char* name, const mxArray* prhs[]);
+ GenericOption<char*>*     OptionCharParse( char* name, const mxArray* prhs[]);
+ GenericOption<Options**>* OptionStructParse( char* name, const mxArray* prhs[]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13266)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Observations.cpp	(revision 13267)
+@@ -41,8 +41,8 @@
+ 	/*Intermediaries*/
+ 	int          i,j,maxdepth,level,counter,index;
+ 	int          xi,yi;
+-	IssmPDouble       xmin,xmax,ymin,ymax;
+-	IssmPDouble       offset,minlength,minspacing,mintrimming,maxtrimming;
++	IssmPDouble  xmin,xmax,ymin,ymax;
++	IssmPDouble  offset,minlength,minspacing,mintrimming,maxtrimming;
+ 	Observation *observation = NULL;
+ 
+ 	/*Get extrema*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h	(revision 13266)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/Option.h	(revision 13267)
+@@ -22,15 +22,14 @@
+ 		Option(){};
+ 		~Option(){};
+ 		/*}}}*/
+-		
+ 		/*Object virtual functions definitions:{{{*/
+-		virtual void  Echo()=0;
+-		virtual void  DeepEcho()=0;
+-		virtual void  DeepEcho(char* indent)=0;
+-		int   Id(){_error_("Not implemented yet");};
+-		int   MyRank(){_error_("Not implemented yet");};
+-		int   ObjectEnum(){return OptionEnum;};
+-		Object* copy(){_error_("Not implemented yet");};
++		virtual void  Echo()= 0;
++		virtual void  DeepEcho()= 0;
++		virtual void  DeepEcho(char  *indent)=0;
++		int           Id(){_error_("Not implemented yet"); };
++		int           MyRank(){_error_("Not implemented yet"); };
++		int           ObjectEnum(){return OptionEnum;              };
++		Object       *copy(){_error_("Not implemented yet"); };
+ 		/*}}}*/
+ 
+ 		/*virtual functions: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13266)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13267)
+@@ -887,11 +887,10 @@
+ 	fid=this->SetFilePointerToData(&code,NULL,index+1);
+ 	switch(code){
+ 		case 3: {//IssmDouble
+-					GenericOption<IssmDouble*>* option;
+-					IssmDouble *value = NULL;
+-					value=xNew<IssmDouble>(1);
+-					FetchData(value,index+1);
+-					option = new GenericOption<IssmDouble*>();
++					GenericOption<IssmDouble>* option;
++					IssmPDouble value;
++					FetchData(&value,index+1);
++					option = new GenericOption<IssmDouble>();
+ 					option->value = value;
+ 					option->name  = name;
+ 					option->numel = 1;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13267-13268.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13267-13268.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13267-13268.diff	(revision 13394)
@@ -0,0 +1,422 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13268)
+@@ -123,6 +123,8 @@
+ 	theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p=reg_ext_fct(EDF_for_solverx);
+ 	femmodel->parameters->AddObject(theAdolcEDF_p);
+ 	if(autodiff) trace_on(1);
++	#else
++	if(autodiff) _error_("ISSM was not compiled with ADOLC support, cannot carry out autodiff analysis!");
+ 	#endif
+ 
+ 	_pprintLine_("call computational core:");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13268)
+@@ -12,6 +12,10 @@
+ enum definitions{
+ 	/*Model fields {{{1*/
+ 	AutodiffIsautodiffEnum, 
++	AutodiffDependentsEnum,
++	AutodiffNumDependentsEnum,
++	AutodiffIndependentsEnum,
++	AutodiffNumIndependentsEnum,
+ 	BalancethicknessSpcthicknessEnum,
+ 	BalancethicknessStabilizationEnum,
+ 	BalancethicknessThickeningRateEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13268)
+@@ -18,6 +18,10 @@
+ 
+    if(stage==1){
+ 	      if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum;
++	      else if (strcmp(name,"AutodiffDependents")==0) return AutodiffDependentsEnum;
++	      else if (strcmp(name,"AutodiffNumDependents")==0) return AutodiffNumDependentsEnum;
++	      else if (strcmp(name,"AutodiffIndependents")==0) return AutodiffIndependentsEnum;
++	      else if (strcmp(name,"AutodiffNumIndependents")==0) return AutodiffNumIndependentsEnum;
+ 	      else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum;
+ 	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
+ 	      else if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
+@@ -133,14 +137,14 @@
+ 	      else if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
+ 	      else if (strcmp(name,"MeshX")==0) return MeshXEnum;
+ 	      else if (strcmp(name,"MeshY")==0) return MeshYEnum;
+-	      else if (strcmp(name,"MeshZ")==0) return MeshZEnum;
++         else stage=2;
++   }
++   if(stage==2){
++	      if (strcmp(name,"MeshZ")==0) return MeshZEnum;
+ 	      else if (strcmp(name,"MiscellaneousName")==0) return MiscellaneousNameEnum;
+ 	      else if (strcmp(name,"PrognosticHydrostaticAdjustment")==0) return PrognosticHydrostaticAdjustmentEnum;
+ 	      else if (strcmp(name,"PrognosticMinThickness")==0) return PrognosticMinThicknessEnum;
+-         else stage=2;
+-   }
+-   if(stage==2){
+-	      if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum;
++	      else if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum;
+ 	      else if (strcmp(name,"PrognosticSpcthickness")==0) return PrognosticSpcthicknessEnum;
+ 	      else if (strcmp(name,"PrognosticStabilization")==0) return PrognosticStabilizationEnum;
+ 	      else if (strcmp(name,"PrognosticVertexPairing")==0) return PrognosticVertexPairingEnum;
+@@ -256,14 +260,14 @@
+ 	      else if (strcmp(name,"Nodes")==0) return NodesEnum;
+ 	      else if (strcmp(name,"Parameters")==0) return ParametersEnum;
+ 	      else if (strcmp(name,"Vertices")==0) return VerticesEnum;
+-	      else if (strcmp(name,"Results")==0) return ResultsEnum;
++         else stage=3;
++   }
++   if(stage==3){
++	      if (strcmp(name,"Results")==0) return ResultsEnum;
+ 	      else if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
+ 	      else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
+ 	      else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
+-         else stage=3;
+-   }
+-   if(stage==3){
+-	      if (strcmp(name,"Contour")==0) return ContourEnum;
++	      else if (strcmp(name,"Contour")==0) return ContourEnum;
+ 	      else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
+ 	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
+ 	      else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
+@@ -379,14 +383,14 @@
+ 	      else if (strcmp(name,"VzPattyn")==0) return VzPattynEnum;
+ 	      else if (strcmp(name,"VzPicard")==0) return VzPicardEnum;
+ 	      else if (strcmp(name,"VzStokes")==0) return VzStokesEnum;
+-	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
++         else stage=4;
++   }
++   if(stage==4){
++	      if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+ 	      else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
+ 	      else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
+ 	      else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
+-         else stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
++	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
+ 	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+ 	      else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
+ 	      else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13268)
+@@ -17,6 +17,10 @@
+ 	switch(en){
+ 
+ 		case AutodiffIsautodiffEnum : return "AutodiffIsautodiff";
++		case AutodiffDependentsEnum : return "AutodiffDependents";
++		case AutodiffNumDependentsEnum : return "AutodiffNumDependents";
++		case AutodiffIndependentsEnum : return "AutodiffIndependents";
++		case AutodiffNumIndependentsEnum : return "AutodiffNumIndependents";
+ 		case BalancethicknessSpcthicknessEnum : return "BalancethicknessSpcthickness";
+ 		case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization";
+ 		case BalancethicknessThickeningRateEnum : return "BalancethicknessThickeningRate";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 13268)
+@@ -0,0 +1,46 @@
++/*!\file: CreateParametersAutodiff.cpp
++ * \brief driver for creating parameters dataset, for autodiff analysis.
++ */ 
++
++#include "../../../Container/Container.h"
++#include "../../../toolkits/toolkits.h"
++#include "../../../io/io.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "../../../classes/objects/objects.h"
++#include "../../../shared/shared.h"
++#include "../../../include/include.h"
++#include "../ModelProcessorx.h"
++
++void CreateParametersAutodiff(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type){
++	
++	int         i;
++	Parameters *parameters       = NULL;
++	bool        autodiff_analysis;
++	int*        dependents       = NULL;
++	int         num_dependents;
++	int*        independents       = NULL;
++	int         num_independents;
++	
++	/*Get parameters: */
++	parameters=*pparameters;
++
++	/*retrieve some parameters: */
++	iomodel->Constant(&autodiff_analysis,AutodiffIsautodiffEnum);
++
++	if(autodiff_analysis){
++
++		/*recover dependents: */
++		parameters->AddObject(iomodel->CopyConstantObject(AutodiffNumDependentsEnum));
++		iomodel->FetchData(&dependents,NULL,&num_dependents,AutodiffDependentsEnum);
++		parameters->AddObject(new IntVecParam(AutodiffDependentsEnum,dependents,num_dependents));
++	
++		/*recover independents: */
++		parameters->AddObject(iomodel->CopyConstantObject(AutodiffNumIndependentsEnum));
++		iomodel->FetchData(&independents,NULL,&num_independents,AutodiffIndependentsEnum);
++		parameters->AddObject(new IntVecParam(AutodiffIndependentsEnum,independents,num_independents));
++
++	}
++
++	/*Assign output pointer: */
++	*pparameters=parameters;
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 13268)
+@@ -91,6 +91,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIspddEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIsdelta18oEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIssmbgradientsEnum));
++	parameters->AddObject(iomodel->CopyConstantObject(AutodiffIsautodiffEnum));
+ 
+ 	iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
+ 	if(isdelta18o){
+@@ -144,6 +145,10 @@
+ 	CreateParametersDakota(&parameters,iomodel,solution_type,analysis_type);
+ 	#endif
+ 
++ 	#ifdef _HAVE_ADOLC_
++	CreateParametersAutodiff(&parameters,iomodel,solution_type,analysis_type);
++	#endif
++
+ 	/*Go through all parameters, and convert units to SI: */
+ 	parameters->UnitConversion(ExtToIuEnum);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 13268)
+@@ -22,6 +22,7 @@
+ void  CreateParameters(Parameters** pparameters,IoModel* iomodel,const int solution_type,int analysis_type,int analysis_counter);
+ void  CreateParametersControl(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type);
+ void  CreateParametersDakota(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type);
++void  CreateParametersAutodiff(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type);
+ void  UpdateElementsAndMaterialsControl(Elements* elements,Materials* materials, IoModel* iomodel);
+ 
+ /*Creation of fem datasets: specialised drivers: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13268)
+@@ -428,6 +428,7 @@
+ 					  ./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h\
+ 					  ./modules/ModelProcessorx/Control/CreateParametersControl.cpp\
+ 					  ./modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp\
++					  ./modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp\
+ 					  ./modules/InputControlUpdatex/InputControlUpdatex.h\
+ 					  ./modules/InputControlUpdatex/InputControlUpdatex.cpp\
+ 					  ./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13268)
+@@ -888,7 +888,7 @@
+ 	switch(code){
+ 		case 3: {//IssmDouble
+ 					GenericOption<IssmDouble>* option;
+-					IssmPDouble value;
++					IssmDouble value;
+ 					FetchData(&value,index+1);
+ 					option = new GenericOption<IssmDouble>();
+ 					option->value = value;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h	(revision 13268)
+@@ -63,6 +63,9 @@
+ 		void        FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,IssmDouble default_value=0);
+ 		void        LastIndex(int *pindex);
+ 		FILE*       SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);
++		#ifdef _HAVE_ADOLC_
++		void        FetchIndependentVariable(IssmDouble**  pscalarmatrix,int* pM,int* pN,int data_enum);
++		#endif
+ };
+ 
+ #endif  /* _IOMODEL_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m	(revision 13268)
+@@ -6,6 +6,8 @@
+ classdef autodiff
+ 	properties (SetAccess=public) 
+ 		isautodiff = false;
++		dependents = {''};
++		independents = {''};
+ 	end
+ 	methods
+ 		function obj = autodiff(varargin) % {{{
+@@ -24,12 +26,31 @@
+ 		end % }}}
+ 		function disp(obj) % {{{
+ 			disp(sprintf('   automatic differentiation parameters:'));
+-
+ 			fielddisplay(obj,'isautodiff','indicates if the automatic differentiation is activated');
+-
++			fielddisplay(obj,'dependents','list of dependent variables ; ex: {''Thickness'',''FrictionCoefficient''}');
++			fielddisplay(obj,'independents','list of independent variables ; ex: {''IceVolume'',''MassFlux''}');
+ 		end % }}}
+ 		function marshall(obj,fid) % {{{
+ 			WriteData(fid,'object',obj,'fieldname','isautodiff','format','Boolean');
++			
++			%process dependent variables
++			num_dependents=numel(obj.dependents);
++			data=zeros(1,num_dependents);
++			for i=1:num_dependents,
++				data(i)=StringToEnum(obj.dependents{i});
++			end
++			WriteData(fid,'data',data,'enum',AutodiffDependentsEnum(),'format','DoubleMat','mattype',3);
++			WriteData(fid,'data',num_dependents,'enum',AutodiffNumDependentsEnum(),'format','Integer');
++			
++			%process independent variables
++			num_independents=numel(obj.independents);
++			data=zeros(1,num_independents);
++			for i=1:num_independents,
++				data(i)=StringToEnum(obj.independents{i});
++			end
++			WriteData(fid,'data',data,'enum',AutodiffIndependentsEnum(),'format','DoubleMat','mattype',3);
++			WriteData(fid,'data',num_independents,'enum',AutodiffNumIndependentsEnum(),'format','Integer');
++
+ 		end % }}}
+ 	end
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13268)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=466;
++macro=470;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffDependentsEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffDependentsEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffDependentsEnum.m	(revision 13268)
+@@ -0,0 +1,11 @@
++function macro=AutodiffDependentsEnum()
++%AUTODIFFDEPENDENTSENUM - Enum of AutodiffDependents
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=AutodiffDependentsEnum()
++
++macro=StringToEnum('AutodiffDependents');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffNumDependentsEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffNumDependentsEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffNumDependentsEnum.m	(revision 13268)
+@@ -0,0 +1,11 @@
++function macro=AutodiffNumDependentsEnum()
++%AUTODIFFNUMDEPENDENTSENUM - Enum of AutodiffNumDependents
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=AutodiffNumDependentsEnum()
++
++macro=StringToEnum('AutodiffNumDependents');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffIndependentsEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffIndependentsEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffIndependentsEnum.m	(revision 13268)
+@@ -0,0 +1,11 @@
++function macro=AutodiffIndependentsEnum()
++%AUTODIFFINDEPENDENTSENUM - Enum of AutodiffIndependents
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=AutodiffIndependentsEnum()
++
++macro=StringToEnum('AutodiffIndependents');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13267)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13268)
+@@ -18,6 +18,46 @@
+ 
+ 	return StringToEnum('AutodiffIsautodiff')[0]
+ 
++def AutodiffDependentsEnum():
++	"""
++	AUTODIFFDEPENDENTSENUM - Enum of AutodiffDependents
++
++	   Usage:
++	      macro=AutodiffDependentsEnum()
++	"""
++
++	return StringToEnum('AutodiffDependents')[0]
++
++def AutodiffNumDependentsEnum():
++	"""
++	AUTODIFFNUMDEPENDENTSENUM - Enum of AutodiffNumDependents
++
++	   Usage:
++	      macro=AutodiffNumDependentsEnum()
++	"""
++
++	return StringToEnum('AutodiffNumDependents')[0]
++
++def AutodiffIndependentsEnum():
++	"""
++	AUTODIFFINDEPENDENTSENUM - Enum of AutodiffIndependents
++
++	   Usage:
++	      macro=AutodiffIndependentsEnum()
++	"""
++
++	return StringToEnum('AutodiffIndependents')[0]
++
++def AutodiffNumIndependentsEnum():
++	"""
++	AUTODIFFNUMINDEPENDENTSENUM - Enum of AutodiffNumIndependents
++
++	   Usage:
++	      macro=AutodiffNumIndependentsEnum()
++	"""
++
++	return StringToEnum('AutodiffNumIndependents')[0]
++
+ def BalancethicknessSpcthicknessEnum():
+ 	"""
+ 	BALANCETHICKNESSSPCTHICKNESSENUM - Enum of BalancethicknessSpcthickness
+@@ -4676,5 +4716,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 466
++	return 470
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffNumIndependentsEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffNumIndependentsEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffNumIndependentsEnum.m	(revision 13268)
+@@ -0,0 +1,11 @@
++function macro=AutodiffNumIndependentsEnum()
++%AUTODIFFNUMINDEPENDENTSENUM - Enum of AutodiffNumIndependents
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=AutodiffNumIndependentsEnum()
++
++macro=StringToEnum('AutodiffNumIndependents');
Index: /issm/oecreview/Archive/12678-13393/ISSM-13268-13269.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13268-13269.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13268-13269.diff	(revision 13394)
@@ -0,0 +1,79 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13268)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13269)
+@@ -18,6 +18,7 @@
+ #include "../../shared/shared.h"
+ #include "../../io/io.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
++PyObject* PyArrayFromCopiedData(int dims[2],double* data);
+ 
+ /*Primitive data types*/
+ /*FUNCTION WriteData(PyObject* py_tuple,int index,int integer){{{*/
+@@ -49,15 +50,64 @@
+ /*FUNCTION WriteData(PyObject* py_tuple,int index,BamgGeom* bamggeom){{{*/
+ void WriteData(PyObject* py_tuple,int index,BamgGeom* bamggeom){
+ 
+-	_error_("not implemented yes, see ../../matlab/io/WriteMatlabData.cpp");
++	PyObject* dict=NULL;
++
++	dict=PyDict_New();
++
++	PyDict_SetItemString(dict,"Vertices",PyArrayFromCopiedData(bamggeom->VerticesSize,bamggeom->Vertices));
++	PyDict_SetItemString(dict,"Edges",PyArrayFromCopiedData(bamggeom->EdgesSize,bamggeom->Edges));
++	PyDict_SetItemString(dict,"TangentAtEdges",PyArrayFromCopiedData(bamggeom->TangentAtEdgesSize,bamggeom->TangentAtEdges));
++	PyDict_SetItemString(dict,"RequiredVertices",PyArrayFromCopiedData(bamggeom->RequiredVerticesSize,bamggeom->RequiredVertices));
++	PyDict_SetItemString(dict,"RequiredEdges",PyArrayFromCopiedData(bamggeom->RequiredEdgesSize,bamggeom->RequiredEdges));
++	PyDict_SetItemString(dict,"CrackedEdges",PyArrayFromCopiedData(bamggeom->CrackedEdgesSize,bamggeom->CrackedEdges));
++	PyDict_SetItemString(dict,"SubDomains",PyArrayFromCopiedData(bamggeom->SubDomainsSize,bamggeom->SubDomains));
++
++	PyTuple_SetItem(py_tuple, index, dict);
+ }
+ /*}}}*/
+ /*FUNCTION WriteData(PyObject* py_tuple,int index,BamgMesh* bamgmesh){{{*/
+ void WriteData(PyObject* py_tuple,int index,BamgMesh* bamgmesh){
+ 
+-	_error_("not implemented yes, see ../../matlab/io/WriteMatlabData.cpp");
++	PyObject* dict=NULL;
++
++	dict=PyDict_New();
++
++	PyDict_SetItemString(dict,"Triangles",PyArrayFromCopiedData(bamgmesh->TrianglesSize,bamgmesh->Triangles));
++	PyDict_SetItemString(dict,"Vertices",PyArrayFromCopiedData(bamgmesh->VerticesSize,bamgmesh->Vertices));
++	PyDict_SetItemString(dict,"Edges",PyArrayFromCopiedData(bamgmesh->EdgesSize,bamgmesh->Edges));
++	PyDict_SetItemString(dict,"IssmSegments",PyArrayFromCopiedData(bamgmesh->IssmSegmentsSize,bamgmesh->IssmSegments));
++	PyDict_SetItemString(dict,"IssmEdges",PyArrayFromCopiedData(bamgmesh->IssmEdgesSize,bamgmesh->IssmEdges));
++	PyDict_SetItemString(dict,"Quadrilaterals",PyArrayFromCopiedData(bamgmesh->QuadrilateralsSize,bamgmesh->Quadrilaterals));
++	PyDict_SetItemString(dict,"VerticesOnGeomVertex",PyArrayFromCopiedData(bamgmesh->VerticesOnGeomVertexSize,bamgmesh->VerticesOnGeomVertex));
++	PyDict_SetItemString(dict,"VerticesOnGeomEdge",PyArrayFromCopiedData(bamgmesh->VerticesOnGeomEdgeSize,bamgmesh->VerticesOnGeomEdge));
++	PyDict_SetItemString(dict,"EdgesOnGeomEdge",PyArrayFromCopiedData(bamgmesh->EdgesOnGeomEdgeSize,bamgmesh->EdgesOnGeomEdge));
++	PyDict_SetItemString(dict,"SubDomains",PyArrayFromCopiedData(bamgmesh->SubDomainsSize,bamgmesh->SubDomains));
++	PyDict_SetItemString(dict,"SubDomainsFromGeom",PyArrayFromCopiedData(bamgmesh->SubDomainsFromGeomSize,bamgmesh->SubDomainsFromGeom));
++	PyDict_SetItemString(dict,"ElementConnectivity",PyArrayFromCopiedData(bamgmesh->ElementConnectivitySize,bamgmesh->ElementConnectivity));
++	PyDict_SetItemString(dict,"NodalConnectivity",PyArrayFromCopiedData(bamgmesh->NodalConnectivitySize,bamgmesh->NodalConnectivity));
++	PyDict_SetItemString(dict,"NodalElementConnectivity",PyArrayFromCopiedData(bamgmesh->NodalElementConnectivitySize,bamgmesh->NodalElementConnectivity));
++	PyDict_SetItemString(dict,"CrackedVertices",PyArrayFromCopiedData(bamgmesh->CrackedVerticesSize,bamgmesh->CrackedVertices));
++	PyDict_SetItemString(dict,"CrackedEdges",PyArrayFromCopiedData(bamgmesh->CrackedEdgesSize,bamgmesh->CrackedEdges));
++
++	PyTuple_SetItem(py_tuple, index, dict);
+ }
+ /*}}}*/
++/*FUNCTION PyArrayFromCopiedData(int dims[2],double* data){{{*/
++PyObject* PyArrayFromCopiedData(int dims[2],double* data){
++
++	double* pydata;
++	npy_intp pydims[2]={0,0};
++
++	/*  note that PyArray_SimpleNewFromData does not copy the data, so that when the original
++	object (e.g. bamggeom,bamgmesh) is deleted, the data is gone.  */
++
++	pydims[0]=(npy_intp)dims[0];
++	pydims[1]=(npy_intp)dims[1];
++	pydata=xNew<IssmDouble>(dims[0]*dims[1]);
++	memcpy(pydata,data,dims[0]*dims[1]*sizeof(double));
++	return PyArray_SimpleNewFromData(2,pydims,NPY_DOUBLE,pydata);
++}
++/*}}}*/
+ /*FUNCTION WriteData(PyObject* py_tuple,int index,SeqMat<double>* matrix){{{*/
+ void WriteData(PyObject* py_tuple,int index,SeqMat<double>* matrix){
+ 	
Index: /issm/oecreview/Archive/12678-13393/ISSM-13269-13270.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13269-13270.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13269-13270.diff	(revision 13394)
@@ -0,0 +1,178 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshconvert.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshconvert.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshconvert.py	(revision 13270)
+@@ -0,0 +1,57 @@
++import numpy
++from collections import OrderedDict
++from BamgConvertMesh import *
++from bamgmesh import *
++from bamggeom import *
++
++def meshconvert(md,*args):
++	"""
++	CONVERTMESH - convert mesh to bamg mesh
++
++	   Usage:
++	      md=meshconvert(md);
++	      md=meshconvert(md,index,x,y);
++	"""
++
++	if not len(args)==0 and not len(args)==3:
++		raise TypeError("meshconvert error message: bad usage")
++
++	if not len(args):
++		x=md.mesh.x
++		y=md.mesh.y
++		index=md.mesh.elements
++	else:
++		x=args[0]
++		y=args[1]
++		index=args[2]
++
++	#call Bamg
++	bamgmesh_out,bamggeom_out=BamgConvertMesh(index,x,y)
++
++	# plug results onto model
++	md.private.bamg=OrderedDict()
++	md.private.bamg['mesh']=bamgmesh(bamgmesh_out)
++	md.private.bamg['geometry']=bamggeom(bamggeom_out)
++	md.mesh.x=bamgmesh_out['Vertices'][:,0]
++	md.mesh.y=bamgmesh_out['Vertices'][:,1]
++	md.mesh.elements=bamgmesh_out['Triangles'][:,0:3]
++	md.mesh.edges=bamgmesh_out['IssmEdges']
++	md.mesh.segments=bamgmesh_out['IssmSegments'][:,0:3]
++	md.mesh.segmentmarkers=bamgmesh_out['IssmSegments'][:,3]
++
++	#Fill in rest of fields:
++	md.mesh.dimension=2
++	md.mesh.numberofelements=numpy.size(md.mesh.elements,axis=0)
++	md.mesh.numberofvertices=numpy.size(md.mesh.x)
++	md.mesh.numberofedges=numpy.size(md.mesh.edges,axis=0)
++	md.mesh.z=numpy.zeros(md.mesh.numberofvertices)
++	md.mesh.vertexonbed=numpy.ones(md.mesh.numberofvertices)
++	md.mask.vertexonwater=numpy.zeros(md.mesh.numberofvertices)
++	md.mesh.vertexonsurface=numpy.ones(md.mesh.numberofvertices)
++	md.mesh.elementonbed=numpy.ones(md.mesh.numberofelements)
++	md.mesh.elementonsurface=numpy.ones(md.mesh.numberofelements)
++	md.mesh.vertexonboundary=numpy.zeros(md.mesh.numberofvertices)
++	md.mesh.vertexonboundary[md.mesh.segments[:,0:1].astype(int)-1]=1
++
++	return md
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/bamggeom.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/bamggeom.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/bamggeom.py	(revision 13270)
+@@ -0,0 +1,45 @@
++class bamggeom(object):
++	"""
++	BAMGGEOM class definition
++
++	   Usage:
++	      bamggeom(varargin)
++	"""
++
++	def __init__(self,*args):    # {{{
++		self.Vertices=[]
++		self.Edges=[]
++		self.TangentAtEdges=[]
++		self.Corners=[]
++		self.RequiredVertices=[]
++		self.RequiredEdges=[]
++		self.CrackedEdges=[]
++		self.SubDomains=[]
++
++		if not len(args):
++			# if no input arguments, create a default object
++			pass
++
++		elif len(args) == 1:
++			object=args[0]
++			for field in object.iterkeys():
++				if field in vars(self):
++					setattr(self,field,object[field])
++
++		else:
++			raise TypeError("bamggeom constructor error message: unknown type of constructor call")
++	# }}}
++
++	def __repr__(self):    # {{{
++		s ="class '%s' object '%s' = \n" % (type(self),'self')
++		s+="    Vertices: %s\n" % str(self.Vertices)
++		s+="    Edges: %s\n" % str(self.Edges)
++		s+="    TangentAtEdges: %s\n" % str(self.TangentAtEdges)
++		s+="    Corners: %s\n" % str(self.Corners)
++		s+="    RequiredVertices: %s\n" % str(self.RequiredVertices)
++		s+="    RequiredEdges: %s\n" % str(self.RequiredEdges)
++		s+="    CrackedEdges: %s\n" % str(self.CrackedEdges)
++		s+="    SubDomains: %s\n" % str(self.SubDomains)
++		return s
++	# }}}
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/bamgmesh.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/bamgmesh.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/bamgmesh.py	(revision 13270)
+@@ -0,0 +1,61 @@
++class bamgmesh(object):
++	"""
++	BAMGMESH class definition
++
++	   Usage:
++	      bamgmesh(varargin)
++	"""
++
++	def __init__(self,*args):    # {{{
++		self.Vertices=[]
++		self.Edges=[]
++		self.Triangles=[]
++		self.Quadrilaterals=[]
++		self.IssmEdges=[]
++		self.IssmSegments=[]
++		self.VerticesOnGeomVertex=[]
++		self.VerticesOnGeomEdge=[]
++		self.EdgesOnGeomEdge=[]
++		self.SubDomains=[]
++		self.SubDomainsFromGeom=[]
++		self.ElementConnectivity=[]
++		self.NodalConnectivity=[]
++		self.NodalElementConnectivity=[]
++		self.CrackedVertices=[]
++		self.CrackedEdges=[]
++
++		if not len(args):
++			# if no input arguments, create a default object
++			pass
++
++		elif len(args) == 1:
++			object=args[0]
++			for field in object.iterkeys():
++				if field in vars(self):
++					setattr(self,field,object[field])
++
++		else:
++			raise TypeError("bamgmesh constructor error message: unknown type of constructor call")
++	# }}}
++
++	def __repr__(self):    # {{{
++		s ="class '%s' object '%s' = \n" % (type(self),'self')
++		s+="    Vertices: %s\n" % str(self.Vertices)
++		s+="    Edges: %s\n" % str(self.Edges)
++		s+="    Triangles: %s\n" % str(self.Triangles)
++		s+="    Quadrilaterals: %s\n" % str(self.Quadrilaterals)
++		s+="    IssmEdges: %s\n" % str(self.IssmEdges)
++		s+="    IssmSegments: %s\n" % str(self.IssmSegments)
++		s+="    VerticesOnGeomVertex: %s\n" % str(self.VerticesOnGeomVertex)
++		s+="    VerticesOnGeomEdge: %s\n" % str(self.VerticesOnGeomEdge)
++		s+="    EdgesOnGeomEdge: %s\n" % str(self.EdgesOnGeomEdge)
++		s+="    SubDomains: %s\n" % str(self.SubDomains)
++		s+="    SubDomainsFromGeom: %s\n" % str(self.SubDomainsFromGeom)
++		s+="    ElementConnectivity: %s\n" % str(self.ElementConnectivity)
++		s+="    NodalConnectivity: %s\n" % str(self.NodalConnectivity)
++		s+="    NodalElementConnectivity: %s\n" % str(self.NodalElementConnectivity)
++		s+="    CrackedVertices: %s\n" % str(self.CrackedVertices)
++		s+="    CrackedEdges: %s\n" % str(self.CrackedEdges)
++		return s
++	# }}}
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-13270-13271.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13270-13271.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13270-13271.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m	(revision 13270)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m	(revision 13271)
+@@ -31,8 +31,12 @@
+ 			fielddisplay(obj,'independents','list of independent variables ; ex: {''IceVolume'',''MassFlux''}');
+ 		end % }}}
+ 		function marshall(obj,fid) % {{{
++
+ 			WriteData(fid,'object',obj,'fieldname','isautodiff','format','Boolean');
+ 			
++			%early return
++			if ~obj.isautodiff, return; end
++
+ 			%process dependent variables
+ 			num_dependents=numel(obj.dependents);
+ 			data=zeros(1,num_dependents);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13271-13272.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13271-13272.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13271-13272.diff	(revision 13394)
@@ -0,0 +1,21 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13271)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13272)
+@@ -25,6 +25,7 @@
+ 	echo "File info.log not found!" >&2   # Error message to stderr.
+ 	exit 1
+ fi 
++NRNAME=$(      cat info.log | grep "name:"           | awk '{$1=""}1')
+ TODAY=$(       cat info.log | grep "today"           | awk '{printf("%s %s",$2,$3);}')
+ USER=$(        cat info.log | grep "user"            | awk '{print $2}')
+ HOST_NAME=$(   cat info.log | grep "host"            | awk '{print $2}')
+@@ -52,7 +53,7 @@
+ rm report.html
+ cat << END >> report.html
+ <div align="center">
+-<table $TITLE_STYLE><tr><td $TITLE_FONT>ISSM Nightly run report</td></tr></table>
++<table $TITLE_STYLE><tr><td $TITLE_FONT>== $NRNAME ==</td></tr></table>
+ 
+ <table $TABLE_STYLE>
+ <tr> 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13272-13273.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13272-13273.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13272-13273.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13272)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13273)
+@@ -53,7 +53,7 @@
+ rm report.html
+ cat << END >> report.html
+ <div align="center">
+-<table $TITLE_STYLE><tr><td $TITLE_FONT>== $NRNAME ==</td></tr></table>
++<table $TITLE_STYLE><tr><td $TITLE_FONT>$NRNAME</td></tr></table>
+ 
+ <table $TABLE_STYLE>
+ <tr> 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13273-13274.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13273-13274.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13273-13274.diff	(revision 13394)
@@ -0,0 +1,14 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13273)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13274)
+@@ -675,6 +675,9 @@
+ 
+ 	AC_MSG_CHECKING(for petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH)
+ 	
++	dnl To ge PETSc's libraries:
++	dnl cd externalpackages/petsc/src
++	dnl make getlinklibs
+ 	if test -d "$PETSC_ROOT"; then
+ 
+ 		PETSCINCL="-I$PETSC_ROOT/$PETSC_ARCH/include -I$PETSC_ROOT/include/$PETSC_ARCH/ -I$PETSC_ROOT/include -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
Index: /issm/oecreview/Archive/12678-13393/ISSM-13274-13275.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13274-13275.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13274-13275.diff	(revision 13394)
@@ -0,0 +1,30 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processdata.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processdata.m	(revision 13274)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/plot/processdata.m	(revision 13275)
+@@ -17,7 +17,7 @@
+ end
+ 
+ %needed later on
+-if isfield(md.mesh,'numberofvertices2d'), 
++if isprop(md.mesh,'numberofvertices2d'), 
+ 	numberofvertices2d=md.mesh.numberofvertices2d; 
+ 	numberofelements2d=md.mesh.numberofelements2d; 
+ else 
+@@ -27,7 +27,7 @@
+ 
+ %Process Patch
+ if isstruct(data) 
+-	if (isfield(data,'index') & isfield(data,'value')),
++	if (isprop(data,'index') & isprop(data,'value')),
+ 		if data.interpolation(1)==P1Enum(),
+ 			data=data.value;
+ 			data=data';
+@@ -70,7 +70,6 @@
+ 	end
+ 
+ 	%check length
+-	
+ 	if datasize(1)~=md.mesh.numberofvertices & datasize(1)~=md.mesh.numberofelements & datasize(1)~=md.mesh.numberofvertices*6 & (md.mesh.dimension==3 & ~(datasize(1)==numberofelements2d | datasize(1)==numberofvertices2d))
+ 		error('plotmodel error message: data not supported yet');
+ 	end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13275-13276.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13275-13276.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13275-13276.diff	(revision 13394)
@@ -0,0 +1,48 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 13275)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 13276)
+@@ -13,12 +13,22 @@
+ #include "../../include/include.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
+ #include "../../toolkits/toolkits.h"
++#include "./Responsex.h"
+ #include "../modules.h"
+ 
+ void Responsex(IssmDouble* responses,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,const char* response_descriptor,bool process_units,int weight_index){
+ 
+-	switch (StringToEnumx(response_descriptor)){
++	int response_descriptor_enum;
+ 
++	response_descriptor_enum=StringToEnumx(response_descriptor);
++	Responsex(responses, elements, nodes,  vertices, loads, materials,  parameters,response_descriptor_enum, process_units, weight_index);
++
++}
++
++void Responsex(IssmDouble* responses,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,int response_descriptor_enum,bool process_units,int weight_index){
++
++	switch (response_descriptor_enum){
++
+ 		#ifdef _HAVE_RESPONSES_
+ 		case IceVolumeEnum:              IceVolumex(               responses, elements,nodes, vertices, loads, materials, parameters,process_units); break;
+ 		case MinVelEnum:                 MinVelx(                  responses, elements,nodes, vertices, loads, materials, parameters,process_units); break;
+@@ -48,7 +58,7 @@
+ 		case MaterialsRheologyBbarEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,MaterialsRheologyBbarEnum,process_units); break;
+ 		case VelEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,VelEnum,process_units); break;
+ 		case FrictionCoefficientEnum:NodalValuex(responses, FrictionCoefficientEnum,elements,nodes, vertices, loads, materials, parameters,process_units); break;
+-		default: _error_("response descriptor \"" << response_descriptor << "\" not supported yet!"); break;
++		default: _error_("response descriptor \"" << EnumToStringx(response_descriptor_enum) << "\" not supported yet!"); break;
+ 		#else
+ 		default: _error_("ISSM was not compiled with responses capabilities, exiting!");
+ 		#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.h	(revision 13275)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Responsex/Responsex.h	(revision 13276)
+@@ -9,5 +9,6 @@
+ #include "../../Container/Container.h"
+ 
+ void Responsex(IssmDouble* presponse,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,const char* response_descriptor,bool process_units,int weight_index);
++void Responsex(IssmDouble* presponse,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,int response_descriptor_enum,bool process_units,int weight_index);
+ 
+ #endif  /* _RESPONSESXX_H */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13276-13277.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13276-13277.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13276-13277.diff	(revision 13394)
@@ -0,0 +1,359 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/solutions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/solutions.h	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/solutions.h	(revision 13277)
+@@ -40,7 +40,7 @@
+ int GradJSearch(IssmDouble* search_vector,FemModel* femmodel,int step);
+ 
+ //diverse
+-void ProcessArguments(int* solution,char** pbinname,char** poutbinname,char** ppetscname,char** plockname,int argc,char **argv);
++void ProcessArguments(int* solution,char** pbinname,char** poutbinname,char** ppetscname,char** plockname,char** prootpath,int argc,char **argv);
+ void WriteLockFile(char* filename);
+ void controlrestart(FemModel* femmodel,IssmDouble* J);
+ void ResetBoundaryConditions(FemModel* femmodel, int analysis_type);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 13277)
+@@ -8,26 +8,47 @@
+ #include "../shared/shared.h"
+ #include "../include/include.h"
+ 
+-void ProcessArguments(int* solution_type,char** pbinfilename,char** poutbinfilename,char** ppetscfilename,char** plockfilename,int argc,char **argv){
++void ProcessArguments(int* solution_type,char** pbinfilename,char** poutbinfilename,char** ppetscfilename,char** plockfilename,char** prootpath, int argc,char **argv){
+ 
+ 	char *modelname      = NULL;
+ 	char *binfilename    = NULL;
+ 	char *outbinfilename = NULL;
+ 	char *petscfilename  = NULL;
+ 	char *lockfilename   = NULL;
++	char *rootpath       = NULL;
++	char *rootpatharg    = NULL;
+ 
+ 	if(argc<2)_error_("Usage error: no solution requested");
+ 	*solution_type=StringToEnumx(argv[1]);
+ 	if(argc<3)_error_("Usage error: missing model name");
++
++	rootpatharg=argv[2];
++	if(strcmp(strstr(rootpatharg,"/"),"/")!=0){ 
++		rootpath       = xNew<char>(strlen(rootpatharg)+2); sprintf(rootpath,"%s/",rootpatharg);
++	}
++	else{
++		rootpath       = xNew<char>(strlen(rootpatharg)+1); sprintf(rootpath,"%s",rootpatharg);
++	}
++
+ 	modelname=argv[3];
+-	binfilename    = xNew<char>(strlen(modelname)+strlen(".bin")   +1); sprintf(binfilename,   "%s%s",modelname,".bin");
+-	outbinfilename = xNew<char>(strlen(modelname)+strlen(".outbin")+1); sprintf(outbinfilename,"%s%s",modelname,".outbin");
+-	petscfilename  = xNew<char>(strlen(modelname)+strlen(".petsc") +1); sprintf(petscfilename, "%s%s",modelname,".petsc");
+-	lockfilename   = xNew<char>(strlen(modelname)+strlen(".lock")  +1); sprintf(lockfilename,  "%s%s",modelname,".lock");
++	if(strstr(modelname,rootpath)==NULL){
++		binfilename    = xNew<char>(strlen(rootpath)+strlen(modelname)+strlen(".bin")   +1); sprintf(binfilename,   "%s%s%s",rootpath,modelname,".bin");
++		outbinfilename = xNew<char>(strlen(rootpath)+strlen(modelname)+strlen(".outbin")+1); sprintf(outbinfilename,"%s%s%s",rootpath,modelname,".outbin");
++		petscfilename  = xNew<char>(strlen(rootpath)+strlen(modelname)+strlen(".petsc") +1); sprintf(petscfilename, "%s%s%s",rootpath,modelname,".petsc");
++		lockfilename   = xNew<char>(strlen(rootpath)+strlen(modelname)+strlen(".lock")  +1); sprintf(lockfilename,  "%s%s%s",rootpath,modelname,".lock");
++	}
++	else{
++		binfilename    = xNew<char>(strlen(modelname)+strlen(".bin")   +1); sprintf(binfilename,   "%s%s",modelname,".bin");
++		outbinfilename = xNew<char>(strlen(modelname)+strlen(".outbin")+1); sprintf(outbinfilename,"%s%s",modelname,".outbin");
++		petscfilename  = xNew<char>(strlen(modelname)+strlen(".petsc") +1); sprintf(petscfilename, "%s%s",modelname,".petsc");
++		lockfilename   = xNew<char>(strlen(modelname)+strlen(".lock")  +1); sprintf(lockfilename,  "%s%s",modelname,".lock");
++	}
+ 
+ 	/*Clean up and assign output pointer*/
+ 	*pbinfilename=binfilename;
+ 	*poutbinfilename=outbinfilename;
+ 	*ppetscfilename=petscfilename;
+ 	*plockfilename=lockfilename;
++	*prootpath=rootpath;
++
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13277)
+@@ -36,6 +36,7 @@
+ 	char *binfilename    = NULL;
+ 	char *outbinfilename = NULL;
+ 	char *petscfilename  = NULL;
++	char *rootpath       = NULL;
+ 
+ 	/*time*/
+ 	IssmPDouble   start, finish;
+@@ -78,7 +79,7 @@
+ 	_pprintLine_("Ice Sheet System Model (" << PACKAGE_NAME << ") version " << PACKAGE_VERSION);
+ 	_pprintLine_("(website: " << PACKAGE_URL << " contact: " << PACKAGE_BUGREPORT << ")");
+ 	_pprintLine_("");
+-	ProcessArguments(&solution_type,&binfilename,&outbinfilename,&petscfilename,&lockfilename,argc,argv);
++	ProcessArguments(&solution_type,&binfilename,&outbinfilename,&petscfilename,&lockfilename,&rootpath,argc,argv);
+ 
+ 	/*out of solution_type, figure out types of analyses needed in the femmodel: */
+ 	AnalysisConfiguration(&analyses,&numanalyses,solution_type);
+@@ -89,7 +90,7 @@
+ 	#else
+ 	start_init=(IssmPDouble)clock();
+ 	#endif
+-	femmodel=new FemModel(binfilename,outbinfilename,solution_type,analyses,numanalyses);
++	femmodel=new FemModel(rootpath,binfilename,outbinfilename,solution_type,analyses,numanalyses);
+ 	
+ 	/*get type of solution we are going to run: */
+ 	CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type);
+@@ -202,6 +203,7 @@
+ 	xDelete<char>(binfilename);
+ 	xDelete<char>(outbinfilename);
+ 	xDelete<char>(petscfilename);
++	xDelete<char>(rootpath);
+ 	delete femmodel;
+ 
+ 	/*Get finish time and close*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13277)
+@@ -6,7 +6,7 @@
+ #include "../include/globals.h"
+ 
+ /*Local prototypes*/
+-void ProcessArguments2(char** pbinfilename,char** poutbinfilename,char** plockfilename,int argc,char **argv);
++void ProcessArguments2(char** pbinfilename,char** poutbinfilename,char** plockfilename,char** prootpath,int argc,char **argv);
+ void ProcessInputfile(IssmDouble **px,IssmDouble **py,IssmDouble **pdata,int *pnobs,IssmDouble **px_interp,IssmDouble **py_interp,int *pninterp,Options **poptions,FILE* fid);
+ 
+ int main(int argc,char **argv){
+@@ -20,6 +20,7 @@
+ 	char *lockfilename   = NULL;
+ 	char *binfilename    = NULL;
+ 	char *outbinfilename = NULL;
++	char *rootpath       = NULL;
+ 
+ 	/*Input*/
+ 	int         ninterp,nobs;
+@@ -57,7 +58,7 @@
+ 	_pprintLine_("Ice Sheet System Model (" << PACKAGE_NAME << ") version " << PACKAGE_VERSION);
+ 	_pprintLine_("(website: " << PACKAGE_URL << " contact: " << PACKAGE_BUGREPORT << ")");
+ 	_pprintLine_("");
+-	ProcessArguments2(&binfilename,&outbinfilename,&lockfilename,argc,argv);
++	ProcessArguments2(&binfilename,&outbinfilename,&lockfilename,&rootpath,argc,argv);
+ 
+ 	/*Process input files*/
+ 	input_fid=pfopen(binfilename,"rb");
+@@ -88,6 +89,7 @@
+ 	xDelete<char>(lockfilename);
+ 	xDelete<char>(binfilename);
+ 	xDelete<char>(outbinfilename);
++	xDelete<char>(rootpath);
+ 	xDelete<IssmDouble>(x);
+ 	xDelete<IssmDouble>(y);
+ 	xDelete<IssmDouble>(data);
+@@ -114,23 +116,44 @@
+ 	return 0; //unix success return;
+ }
+ 
+-void ProcessArguments2(char** pbinfilename,char** poutbinfilename,char** plockfilename,int argc,char **argv){
++void ProcessArguments2(char** pbinfilename,char** poutbinfilename,char** plockfilename,char** prootpath,int argc,char **argv){
+ 
+ 	char *modelname      = NULL;
+ 	char *binfilename    = NULL;
+ 	char *outbinfilename = NULL;
+ 	char *lockfilename   = NULL;
++	char *rootpatharg    = NULL;
++	char *rootpath       = NULL;
+ 
++	if(argc<1)_error_("Usage error: no execution path provided");
+ 	if(argc<2)_error_("Usage error: missing model name");
++
++	rootpatharg=argv[1];
++	if(strcmp(strstr(rootpatharg,"/"),"/")!=0){ 
++		rootpath       = xNew<char>(strlen(rootpatharg)+2); sprintf(rootpath,"%s/",rootpatharg);
++	}  
++	else{
++		rootpath       = xNew<char>(strlen(rootpatharg)+1); sprintf(rootpath,"%s",rootpatharg);
++	} 
++
+ 	modelname=argv[2];
+-	binfilename    = xNew<char>((strlen(modelname)+strlen(".bin")   +1)); sprintf(binfilename,   "%s%s",modelname,".bin");
+-	outbinfilename = xNew<char>((strlen(modelname)+strlen(".outbin")+1)); sprintf(outbinfilename,"%s%s",modelname,".outbin");
+-	lockfilename   = xNew<char>((strlen(modelname)+strlen(".lock")  +1)); sprintf(lockfilename,  "%s%s",modelname,".lock");
++	if(strstr(modelname,rootpath)==NULL){
++		binfilename    = xNew<char>(strlen(rootpath)+strlen(modelname)+strlen(".bin")   +1); sprintf(binfilename,   "%s%s%s",rootpath,modelname,".bin");
++		outbinfilename = xNew<char>(strlen(rootpath)+strlen(modelname)+strlen(".outbin")+1); sprintf(outbinfilename,"%s%s%s",rootpath,modelname,".outbin");
++		lockfilename   = xNew<char>(strlen(rootpath)+strlen(modelname)+strlen(".lock")  +1); sprintf(lockfilename,  "%s%s%s",rootpath,modelname,".lock");
++	}
++	else{
++		binfilename    = xNew<char>(strlen(modelname)+strlen(".bin")   +1); sprintf(binfilename,   "%s%s",modelname,".bin");
++		outbinfilename = xNew<char>(strlen(modelname)+strlen(".outbin")+1); sprintf(outbinfilename,"%s%s",modelname,".outbin");
++		lockfilename   = xNew<char>(strlen(modelname)+strlen(".lock")  +1); sprintf(lockfilename,  "%s%s",modelname,".lock");
++	}
+ 
+ 	/*Clean up and assign output pointer*/
+ 	*pbinfilename=binfilename;
+ 	*poutbinfilename=outbinfilename;
+ 	*plockfilename=lockfilename;
++	*prootpath=rootpath;
++
+ }
+ 
+ void ProcessInputfile(IssmDouble **px,IssmDouble **py,IssmDouble **pdata,int *pnobs,IssmDouble **px_interp,IssmDouble **py_interp,int *pninterp,Options **poptions,FILE* fid){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 13277)
+@@ -12,7 +12,7 @@
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../ModelProcessorx.h"
+ 
+-void CreateParametersDakota(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type){
++void CreateParametersDakota(Parameters** pparameters,IoModel* iomodel,char* rootpath,int solution_type,int analysis_type){
+ 
+ 	/*variable declarations: {{{*/
+ 	int i,j,k;
+@@ -73,16 +73,16 @@
+ 		iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
+ 
+ 		/*name of qmu input, error and output files:{{{*/
+-		qmuinname=xNew<char>((strlen(name)+strlen(".qmu.in")+1));
+-		sprintf(qmuinname,"%s%s",name,".qmu.in");
++		qmuinname=xNew<char>((strlen(rootpath)+strlen(name)+strlen(".qmu.in")+1));
++		sprintf(qmuinname,"%s%s%s",rootpath,name,".qmu.in");
+ 		parameters->AddObject(new   StringParam(QmuInNameEnum,qmuinname));
+ 
+-		qmuoutname=xNew<char>((strlen(name)+strlen(".qmu.out")+1));
+-		sprintf(qmuoutname,"%s%s",name,".qmu.out");
++		qmuoutname=xNew<char>((strlen(rootpath)+strlen(name)+strlen(".qmu.out")+1));
++		sprintf(qmuoutname,"%s%s%s",rootpath,name,".qmu.out");
+ 		parameters->AddObject(new   StringParam(QmuOutNameEnum,qmuoutname));
+ 
+-		qmuerrname=xNew<char>((strlen(name)+strlen(".qmu.err")+1));
+-		sprintf(qmuerrname,"%s%s",name,".qmu.err");
++		qmuerrname=xNew<char>((strlen(rootpath)+strlen(name)+strlen(".qmu.err")+1));
++		sprintf(qmuerrname,"%s%s%s",rootpath,name,".qmu.err");
+ 		parameters->AddObject(new   StringParam(QmuErrNameEnum,qmuerrname));
+ 		/*}}}*/
+ 		/*Fetch variable descriptors: {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 13277)
+@@ -18,7 +18,7 @@
+ #include "../../io/io.h"
+ #include "./ModelProcessorx.h"
+ 
+-void CreateParameters(Parameters** pparameters,IoModel* iomodel,const int solution_type,int analysis_type,int analysis_counter){
++void CreateParameters(Parameters** pparameters,IoModel* iomodel,char* rootpath,const int solution_type,int analysis_type,int analysis_counter){
+ 	
+ 	int         i;
+ 	int         numoutputs;
+@@ -142,7 +142,7 @@
+ 	#endif
+ 
+ 	#ifdef _HAVE_DAKOTA_
+-	CreateParametersDakota(&parameters,iomodel,solution_type,analysis_type);
++	CreateParametersDakota(&parameters,iomodel,rootpath,solution_type,analysis_type);
+ 	#endif
+ 
+  	#ifdef _HAVE_ADOLC_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 13277)
+@@ -16,7 +16,7 @@
+ #include "../../include/include.h"
+ #include "../../modules/modules.h"
+ 
+-void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters, FILE* IOMODEL,const int solution_type,const int nummodels,const int* analysis_type_list){
++void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters, FILE* IOMODEL,char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_list){
+ 
+ 	int   i,analysis_type,dim,verbose;
+ 	bool  isthermal,isprognostic,isdiagnostic,isgroundingline,isenthalpy;
+@@ -68,10 +68,10 @@
+ 		if(solution_type==SteadystateSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue;
+ 	
+ 		if(VerboseMProcessor()) _pprintLine_("   creating datasets for analysis " << EnumToStringx(analysis_type));
+-		CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,&parameters,iomodel,solution_type,analysis_type,nummodels,i);
++		CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,&parameters,iomodel,rootpath,solution_type,analysis_type,nummodels,i);
+ 	}
+ 
+-	/*Free ressources:*/
++	/*Free resources:*/
+ 	delete iomodel;
+ 
+ 	/*Assign output pointers:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 13277)
+@@ -15,7 +15,7 @@
+ #include "./ModelProcessorx.h"
+ 
+ 
+-void CreateDataSets(Elements** pelements,Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads,Parameters** pparameters,IoModel* iomodel,const int solution_type,const int analysis_type,const int nummodels,int analysis_counter){
++void CreateDataSets(Elements** pelements,Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads,Parameters** pparameters,IoModel* iomodel,char* rootpath,const int solution_type,const int analysis_type,const int nummodels,int analysis_counter){
+ 
+ 	bool        continuous = true;
+ 	Elements   *elements   = NULL;
+@@ -132,7 +132,7 @@
+ 	#endif
+ 
+ 	/*Generate objects that are not dependent on any analysis_type: */
+-	CreateParameters(pparameters,iomodel,solution_type,analysis_type,analysis_counter);
++	CreateParameters(pparameters,iomodel,rootpath,solution_type,analysis_type,analysis_counter);
+ 
+ 	/*Update Elements in case we are running a transient solution: */
+ 	#ifdef _HAVE_TRANSIENT_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 13277)
+@@ -14,14 +14,14 @@
+ 
+ #include "../../io/io.h"
+ 
+-void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters, FILE* iomodel_handle,const int solution_type,const int nummodels,const int* analysis_type_list);
++void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters, FILE* iomodel_handle,char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_listh);
+ 
+ /*Creation of fem datasets: general drivers*/
+-void  CreateDataSets(Elements** pelements,Nodes** pnodes,Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads,Parameters** pparameters,IoModel* iomodel,const int solution_type,int analysis_type,const int nummodels,int analysis_counter);
++void  CreateDataSets(Elements** pelements,Nodes** pnodes,Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads,Parameters** pparameters,IoModel* iomodel,char* rootpath,const int solution_type,int analysis_type,const int nummodels,int analysis_counter);
+ void  CreateElementsVerticesAndMaterials(Elements** pelements,Vertices** pvertices,Materials** pmaterials, IoModel* iomodel,const int nummodels);
+-void  CreateParameters(Parameters** pparameters,IoModel* iomodel,const int solution_type,int analysis_type,int analysis_counter);
++void  CreateParameters(Parameters** pparameters,IoModel* iomodel,char* rootpath,const int solution_type,int analysis_type,int analysis_counter);
+ void  CreateParametersControl(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type);
+-void  CreateParametersDakota(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type);
++void  CreateParametersDakota(Parameters** pparameters,IoModel* iomodel,char* rootpath,int solution_type,int analysis_type);
+ void  CreateParametersAutodiff(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type);
+ void  UpdateElementsAndMaterialsControl(Elements* elements,Materials* materials, IoModel* iomodel);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.cpp	(revision 13277)
+@@ -20,7 +20,7 @@
+ 
+ /*Object constructors and destructor*/
+ /*FUNCTION FemModel::constructor {{{*/
+-FemModel::FemModel(char* inputfilename, char* outputfilename, const int in_solution_type,const int* analyses,const int nummodels){
++FemModel::FemModel(char* rootpath, char* inputfilename, char* outputfilename, const int in_solution_type,const int* analyses,const int nummodels){
+ 
+ 	/*intermediary*/
+ 	int         i;
+@@ -44,7 +44,7 @@
+ 	for(i=0;i<nummodels;i++)analysis_type_list[i]=analyses[i];
+ 
+ 	/*create datasets for all analyses*/
+-	ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,IOMODEL,this->solution_type,nummodels,analyses);
++	ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,IOMODEL,rootpath,this->solution_type,nummodels,analyses);
+ 
+ 	/*do the post-processing of the datasets to get an FemModel that can actually run analyses: */
+ 	for(i=0;i<nummodels;i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.h	(revision 13276)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/FemModel.h	(revision 13277)
+@@ -42,7 +42,7 @@
+ 		Results*            results; //results that cannot be fit into the elements (such as one time constants, arrays, strings, etc ...)
+ 
+ 		/*constructors, destructors: */
+-		FemModel(char* inputfilename, char* outputfilename, const int solution_type,const int* analyses,const int nummodels);
++		FemModel(char* rootpath, char* inputfilename, char* outputfilename, const int solution_type,const int* analyses,const int nummodels);
+ 		~FemModel();
+ 
+ 		/*Methods: */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13277-13278.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13277-13278.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13277-13278.diff	(revision 13394)
@@ -0,0 +1,258 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/greenplanet.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/greenplanet.m	(revision 13277)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/greenplanet.m	(revision 13278)
+@@ -81,7 +81,7 @@
+ 			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+ 			 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+ 			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 			 if ~io_gather, %concatenate the output files:
+ 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+ 			 end
+@@ -90,7 +90,7 @@
+ 			 %in interactive mode, create a run file, and errlog and outlog file
+ 			 if cluster.interactive,
+ 				 fid=fopen([modelname '.run'],'w');
+-				 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++				 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 				 if ~io_gather, %concatenate the output files:
+ 					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+ 				 end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/gemini.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/gemini.m	(revision 13277)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/gemini.m	(revision 13278)
+@@ -62,10 +62,10 @@
+ 			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+ 			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+ 
+-			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
++			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+ 			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+ 			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
+-			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 			 fclose(fid);
+ 
+ 		 end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 13277)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 13278)
+@@ -124,8 +124,8 @@
+ 			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+ 			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+ 			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd $PBS_O_WORKDIR\n\n');
+-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname '/' modelname]);
++			 fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
++			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 			 if ~io_gather, %concatenate the output files:
+ 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+ 			 end
+@@ -135,9 +135,9 @@
+ 			 if cluster.interactive,
+ 				 fid=fopen([modelname '.run'],'w');
+ 				 if ~isvalgrind,
+-					 fprintf(fid,'mpiexec -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
++					 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 				 else
+-					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
++					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 				 end
+ 				 if ~io_gather, %concatenate the output files:
+ 					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+@@ -175,8 +175,8 @@
+ 			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+ 			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+ 			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+-			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname '/' modelname]); %FIXME
++			 fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,modelname);
++			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname); %FIXME
+ 			 if ~io_gather, %concatenate the output files:
+ 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+ 			 end
+@@ -186,9 +186,9 @@
+ 			 if cluster.interactive,
+ 				 fid=fopen([modelname '.run'],'w');
+ 				 if ~isvalgrind,
+-					 fprintf(fid,'mpiexec -np %i %s/kriging.exe $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname '/' modelname]);
++					 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+ 				 else
+-					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/kriging.exe $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,modelname);
++					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+ 				 end
+ 				 if ~io_gather, %concatenate the output files:
+ 					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/castor.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/castor.m	(revision 13277)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/castor.m	(revision 13278)
+@@ -61,10 +61,10 @@
+ 			 end
+ 			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+ 			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+-			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
++			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+ 			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+ 			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
+-			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 			 fclose(fid);
+ 
+ 		 end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 13277)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 13278)
+@@ -67,9 +67,9 @@
+ 				fprintf(fid,'#!/bin/sh\n');
+ 				if ~isvalgrind,
+ 					if cluster.interactive
+-						fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++						fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 					else
+-						fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++						fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
+ 					end
+ 				elseif isgprof,
+ 					fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
+@@ -78,10 +78,10 @@
+ 					fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+ 					if ismac, 
+ 						fprintf(fid,'mpiexec -np %i %s --leak-check=full --dsymutil=yes --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
+-						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname], modelname,modelname,modelname);
+ 					else
+ 						fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
+-						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
+ 					end
+ 				end
+ 				if ~io_gather, %concatenate the output files:
+@@ -94,10 +94,10 @@
+ 				fid=fopen([modelname '.bat'],'w');
+ 				fprintf(fid,'@echo off\n');
+ 				if cluster.interactive
+-					fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++					fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 				else
+ 					fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
+-						cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++						cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
+ 				end
+ 				fclose(fid);
+ 			end
+@@ -118,9 +118,9 @@
+ 				fprintf(fid,'#!/bin/sh\n');
+ 				if ~isvalgrind,
+ 					if cluster.interactive
+-						fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s ',cluster.np,cluster.codepath,cluster.executionpath,modelname);
++						fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s ',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+ 					else
+-						fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
++						fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname,modelname,modelname);
+ 					end
+ 				elseif isgprof,
+ 					fprintf(fid,'\n gprof %s/kriging.exe gmon.out > %s.performance',cluster.codepath,modelname);
+@@ -128,7 +128,7 @@
+ 					%Add --gen-suppressions=all to get suppression lines
+ 					fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+ 					fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',...
+-						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
++						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,[cluster.executionpath '/' modelname],modelname,modelname,modelname);
+ 				end
+ 				if ~io_gather, %concatenate the output files:
+ 					fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
+@@ -140,10 +140,10 @@
+ 				fid=fopen([modelname '.bat'],'w');
+ 				fprintf(fid,'@echo off\n');
+ 				if cluster.interactive
+-					fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++					fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),[cluster.executionpath '/' modelname],modelname);
+ 				else
+ 					fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
+-						cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++						cluster.codepath,EnumToString(solution),[cluster.executionpath '/' modelname],modelname,modelname,modelname);
+ 				end
+ 				fclose(fid);
+ 			end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/discover.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/discover.m	(revision 13277)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/discover.m	(revision 13278)
+@@ -110,8 +110,8 @@
+ 			 fprintf(fid,'module load lib/mkl-10.1.2.024\n\n');
+ 			 fprintf(fid,'export PATH="$PATH:."\n\n');
+ 			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+-			 fprintf(fid,'cd $PBS_O_WORKDIR\n\n');
+-			 fprintf(fid,'mpirun -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
++			 fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
++			 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 			 if ~io_gather, %concatenate the output files:
+ 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+ 			 end
+@@ -121,9 +121,9 @@
+ 			 if cluster.interactive,
+ 				 fid=fopen([modelname '.run'],'w');
+ 				 if ~isvalgrind,
+-					 fprintf(fid,'mpirun -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
++					 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 				 else
+-					 fprintf(fid,'mpirun -np %i valgrind --leak-check=full %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
++					 fprintf(fid,'mpirun -np %i valgrind --leak-check=full %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 				 end
+ 				 if ~io_gather, %concatenate the output files:
+ 					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m	(revision 13277)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/acenet.m	(revision 13278)
+@@ -73,7 +73,7 @@
+           fprintf(fid,'module load issm\n');
+           fprintf(fid,'\n');
+           fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
+-                   cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
++                   cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
+ 			 fclose(fid);
+ 
+ 		 end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/cosmos.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/cosmos.m	(revision 13277)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/cosmos.m	(revision 13278)
+@@ -59,12 +59,12 @@
+ 			 fprintf(fid,'#PBS -q %s\n',queue);
+ 			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+ 			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+-			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
++			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+ 			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+ 			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
+ 			 fprintf(fid,'ulimit -s unlimited\n');
+ 			 fprintf(fid,'ulimit -c 0\n');
+-			 fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpiexec -np %i %s/issm.exe %s %s %s',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++			 fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpiexec -np %i %s/issm.exe %s %s %s',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 			 fclose(fid);
+ 
+ 		 end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pollux.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pollux.m	(revision 13277)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pollux.m	(revision 13278)
+@@ -61,10 +61,10 @@
+ 			 end
+ 			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+ 			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+-			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
++			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+ 			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+ 			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
+-			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
++			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+ 			 fclose(fid);
+ 
+ 		 end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13278-13279.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13278-13279.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13278-13279.diff	(revision 13394)
@@ -0,0 +1,54 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test106.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test106.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test106.py	(revision 13279)
+@@ -0,0 +1,26 @@
++from model import *
++from triangle import *
++from meshconvert 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=meshconvert(md)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md.prognostic.stabilization=3
++md.prognostic.spcthickness=md.geometry.thickness
++md=solve(md,PrognosticSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Thickness']
++field_tolerances=[1e-13]
++field_values=[\
++	md.results['PrognosticSolution'][1]['Thickness'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshconvert.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshconvert.py	(revision 13278)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/meshconvert.py	(revision 13279)
+@@ -32,12 +32,12 @@
+ 	md.private.bamg=OrderedDict()
+ 	md.private.bamg['mesh']=bamgmesh(bamgmesh_out)
+ 	md.private.bamg['geometry']=bamggeom(bamggeom_out)
+-	md.mesh.x=bamgmesh_out['Vertices'][:,0]
+-	md.mesh.y=bamgmesh_out['Vertices'][:,1]
+-	md.mesh.elements=bamgmesh_out['Triangles'][:,0:3]
+-	md.mesh.edges=bamgmesh_out['IssmEdges']
+-	md.mesh.segments=bamgmesh_out['IssmSegments'][:,0:3]
+-	md.mesh.segmentmarkers=bamgmesh_out['IssmSegments'][:,3]
++	md.mesh.x=bamgmesh_out['Vertices'][:,0].copy()
++	md.mesh.y=bamgmesh_out['Vertices'][:,1].copy()
++	md.mesh.elements=bamgmesh_out['Triangles'][:,0:3].copy()
++	md.mesh.edges=bamgmesh_out['IssmEdges'].copy()
++	md.mesh.segments=bamgmesh_out['IssmSegments'][:,0:3].copy()
++	md.mesh.segmentmarkers=bamgmesh_out['IssmSegments'][:,3].copy()
+ 
+ 	#Fill in rest of fields:
+ 	md.mesh.dimension=2
Index: /issm/oecreview/Archive/12678-13393/ISSM-13279-13280.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13279-13280.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13279-13280.diff	(revision 13394)
@@ -0,0 +1,308 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test115.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test115.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test115.py	(revision 13280)
+@@ -0,0 +1,24 @@
++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/SquareShelfConstrained.py')
++md.extrude(5,1)
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,BedSlopeSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['BedSlopeX','BedSlopeY']
++field_tolerances=[1e-13,1e-13]
++field_values=[\
++	md.results['BedSlopeSolution'][1]['BedSlopeX'],\
++	md.results['BedSlopeSolution'][1]['BedSlopeY'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test118.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test118.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test118.py	(revision 13280)
+@@ -0,0 +1,26 @@
++from model import *
++from triangle import *
++from meshconvert 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=meshconvert(md)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md.balancethickness.stabilization=3
++md.initialization.vy=md.initialization.vy+400.
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,BalancethicknessSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Thickness']
++field_tolerances=[1e-13]
++field_values=[\
++	md.results['BalancethicknessSolution'][1]['Thickness'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test113.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test113.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test113.py	(revision 13280)
+@@ -0,0 +1,24 @@
++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/SquareShelfConstrained.py')
++md.extrude(5,1)
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,SurfaceSlopeSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['SurfaceSlopeX','SurfaceSlopeY']
++field_tolerances=[1e-13,1e-13]
++field_values=[\
++	md.results['SurfaceSlopeSolution'][1]['SurfaceSlopeX'],\
++	md.results['SurfaceSlopeSolution'][1]['SurfaceSlopeY'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test116.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test116.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test116.py	(revision 13280)
+@@ -0,0 +1,26 @@
++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/SquareShelfConstrained.py')
++#Add boundary conditions on thickness on the border
++pos=numpy.nonzero(md.mesh.vertexonboundary)
++md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,BalancethicknessSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Thickness']
++field_tolerances=[1e-13]
++field_values=[\
++	md.results['BalancethicknessSolution'][1]['Thickness'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test111.py	(revision 13280)
+@@ -0,0 +1,62 @@
++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',200000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md.extrude(3,1)
++md=setflowequation(md,'pattyn','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md.transient.requested_outputs=IceVolumeEnum()
++md=solve(md,TransientSolutionEnum())
++
++#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']
++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-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,2e-12,\
++	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-11]
++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]['Bed'],\
++	md.results['TransientSolution'][1]['Surface'],\
++	md.results['TransientSolution'][1]['Thickness'],\
++	md.results['TransientSolution'][1]['Temperature'],\
++	md.results['TransientSolution'][1]['BasalforcingsMeltingRate'],\
++	md.results['TransientSolution'][1]['IceVolume'],\
++	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]['Bed'],\
++	md.results['TransientSolution'][2]['Surface'],\
++	md.results['TransientSolution'][2]['Thickness'],\
++	md.results['TransientSolution'][2]['Temperature'],\
++	md.results['TransientSolution'][2]['BasalforcingsMeltingRate'],\
++	md.results['TransientSolution'][2]['IceVolume'],\
++	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]['Bed'],\
++	md.results['TransientSolution'][3]['Surface'],\
++	md.results['TransientSolution'][3]['Thickness'],\
++	md.results['TransientSolution'][3]['Temperature'],\
++	md.results['TransientSolution'][3]['BasalforcingsMeltingRate'],\
++	md.results['TransientSolution'][3]['IceVolume'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test120.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test120.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test120.py	(revision 13280)
+@@ -0,0 +1,28 @@
++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',180000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md.extrude(3,1)
++md=setflowequation(md,'macayeal','all')
++md.timestepping.time_step=0
++md.cluster=generic('name',oshostname(),'np',3)
++md.initialization.waterfraction=numpy.zeros(md.mesh.numberofvertices)
++md=solve(md,EnthalpySolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Enthalpy','Waterfraction','Temperature']
++field_tolerances=[1e-13,1e-10,1e-13]
++field_values=[\
++	md.results['EnthalpySolution'][1]['Enthalpy'],\
++	md.results['EnthalpySolution'][1]['Waterfraction'],\
++	md.results['EnthalpySolution'][1]['Temperature'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test114.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test114.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test114.py	(revision 13280)
+@@ -0,0 +1,23 @@
++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/SquareShelfConstrained.py')
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,BedSlopeSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['BedSlopeX','BedSlopeY']
++field_tolerances=[1e-13,1e-13]
++field_values=[\
++	md.results['BedSlopeSolution'][1]['BedSlopeX'],\
++	md.results['BedSlopeSolution'][1]['BedSlopeY'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test117.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test117.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test117.py	(revision 13280)
+@@ -0,0 +1,27 @@
++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/SquareShelfConstrained.py')
++md.extrude(5,1)
++#Add boundary conditions on thickness on the border
++pos=numpy.nonzero(md.mesh.vertexonboundary)
++md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,BalancethicknessSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Thickness']
++field_tolerances=[1e-13]
++field_values=[\
++	md.results['BalancethicknessSolution'][1]['Thickness'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test112.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test112.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test112.py	(revision 13280)
+@@ -0,0 +1,23 @@
++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/SquareShelfConstrained.py')
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,SurfaceSlopeSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['SurfaceSlopeX','SurfaceSlopeY']
++field_tolerances=[1e-13,1e-13]
++field_values=[\
++	md.results['SurfaceSlopeSolution'][1]['SurfaceSlopeX'],\
++	md.results['SurfaceSlopeSolution'][1]['SurfaceSlopeY'],\
++	]
Index: /issm/oecreview/Archive/12678-13393/ISSM-13280-13281.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13280-13281.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13280-13281.diff	(revision 13394)
@@ -0,0 +1,74 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13280)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13281)
+@@ -79,16 +79,16 @@
+ 			fid.write('#!/bin/sh\n')
+ 			if not isvalgrind:
+ 				if self.interactive:
+-					fid.write('mpiexec -np %i %s/issm.exe %s %s %s ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,modelname))
++					fid.write('mpiexec -np %i %s/issm.exe %s %s/%s %s ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname))
+ 				else:
+-					fid.write('mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname))
++					fid.write('mpiexec -np %i %s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
+ 			elif isgprof:
+ 				fid.write('\n gprof %s/issm.exe gmon.out > %s.performance' % (self.codepath,modelname))
+ 			else:
+ 				#Add --gen-suppressions=all to get suppression lines
+ 				fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
+-				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % \
+-					(self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname))
++				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % \
++					(self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
+ 			if not io_gather:    #concatenate the output files:
+ 				fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname))
+ 			fid.close()
+@@ -98,10 +98,10 @@
+ 			fid=open(modelname+'.bat','w')
+ 			fid.write('@echo off\n')
+ 			if self.interactive:
+-				fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,modelname))
++				fid.write('"%s/issm.exe" %s "%s/%s" %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname))
+ 			else:
+-				fid.write('"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog' % \
+-					(self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname))
++				fid.write('"%s/issm.exe" %s "%s/%s" %s 2> %s.errlog >%s.outlog' % \
++					(self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
+ 			fid.close()
+ 
+ 		#in interactive mode, create a run file, and errlog and outlog file
+@@ -121,16 +121,16 @@
+ 			fid.write('#!/bin/sh\n')
+ 			if not isvalgrind:
+ 				if self.interactive:
+-					fid.write('mpiexec -np %i %s/kriging.exe %s %s ' % (self.np,self.codepath,self.executionpath,modelname))
++					fid.write('mpiexec -np %i %s/kriging.exe %s/%s %s ' % (self.np,self.codepath,self.executionpath,modelname,modelname))
+ 				else:
+-					fid.write('mpiexec -np %i %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,self.executionpath,modelname,modelname,modelname))
++					fid.write('mpiexec -np %i %s/kriging.exe %s/%s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,self.executionpath,modelname,modelname,modelname,modelname))
+ 			elif isgprof:
+ 				fid.write('\n gprof %s/kriging.exe gmon.out > %s.performance' & (self.codepath,modelname))
+ 			else:
+ 				#Add --gen-suppressions=all to get suppression lines
+ 				fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
+-				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ' % \
+-					(self.np,self.valgrind,self.valgrindsup,self.codepath,self.executionpath,modelname,modelname,modelname))
++				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/kriging.exe %s/%s %s 2> %s.errlog >%s.outlog ' % \
++					(self.np,self.valgrind,self.valgrindsup,self.codepath,self.executionpath,modelname,modelname,modelname,modelname))
+ 			if not io_gather:    #concatenate the output files:
+ 				fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname))
+ 			fid.close()
+@@ -140,10 +140,10 @@
+ 			fid=open(modelname+'.bat','w')
+ 			fid.write('@echo off\n')
+ 			if self.interactive:
+-				fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,modelname))
++				fid.write('"%s/issm.exe" %s "%s/%s" %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname))
+ 			else:
+-				fid.write('"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog' % \
+-					(self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname))
++				fid.write('"%s/issm.exe" %s "%s/%s" %s 2> %s.errlog >%s.outlog' % \
++					(self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname,modelname))
+ 			fid.close()
+ 
+ 		#in interactive mode, create a run file, and errlog and outlog file
Index: /issm/oecreview/Archive/12678-13393/ISSM-13281-13282.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13281-13282.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13281-13282.diff	(revision 13394)
@@ -0,0 +1,11 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/execution
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/execution	(revision 13281)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/execution	(revision 13282)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/execution
+___________________________________________________________________
+Modified: svn:ignore
+## -1 +1,2 ##
+ test*
++ad*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13282-13283.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13282-13283.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13282-13283.diff	(revision 13394)
@@ -0,0 +1,1092 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13283)
+@@ -83,7 +83,12 @@
+ 
+ 	/*out of solution_type, figure out types of analyses needed in the femmodel: */
+ 	AnalysisConfiguration(&analyses,&numanalyses,solution_type);
+-	
++
++	/*before we create the model, start the trace on for AD mode: */
++	#ifdef _HAVE_ADOLC_
++	trace_on(1);
++	#endif
++
+ 	/*Create femmodel, using input file: */
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Barrier(MPI_COMM_WORLD); start_init=MPI_Wtime();
+@@ -123,7 +128,6 @@
+ 	GenericParam<Adolc_edf> *theAdolcEDF_p=new GenericParam<Adolc_edf>(AdolcParamEnum);
+ 	theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p=reg_ext_fct(EDF_for_solverx);
+ 	femmodel->parameters->AddObject(theAdolcEDF_p);
+-	if(autodiff) trace_on(1);
+ 	#else
+ 	if(autodiff) _error_("ISSM was not compiled with ADOLC support, cannot carry out autodiff analysis!");
+ 	#endif
+@@ -165,20 +169,24 @@
+ 		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, ProfilingCurrentFlopsEnum, Current_flops, 1, 0));
+ 	}
+ 
++	if(autodiff){
++		trace_off();
++		AutodiffDriversx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results);
++	}
+ 
++
+ 	#ifdef _HAVE_MPI_
+ 	MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
+ 	#else
+ 	finish_core=(IssmPDouble)clock();
+ 	#endif
+-
++	
+ 	_pprintLine_("write results to disk:");
+ 	OutputResultsx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results);
+ 	
+ 	/*If running AD, close our tape, print statistics: {{{*/
+ 	#ifdef _HAVE_ADOLC_
+ 	if(autodiff){
+-		trace_off();
+ 		tapestats(1,tape_stats); //reading of tape statistics
+ 		_pprintLine_("   ADOLC statistics: ");
+ 		_pprintLine_("   "<<setw(45)<<left<<"Number of independents: " <<tape_stats[0]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp	(revision 13283)
+@@ -151,6 +151,8 @@
+ 		}
+ 	}
+ 
++	RequestedDependentsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
++	
+ 	/*Free ressources:*/
+ 	xDelete<int>(requested_outputs);
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13283)
+@@ -16,6 +16,8 @@
+ 	AutodiffNumDependentsEnum,
+ 	AutodiffIndependentsEnum,
+ 	AutodiffNumIndependentsEnum,
++	AutodiffJacobianEnum,
++	AutodiffXpEnum,
+ 	BalancethicknessSpcthicknessEnum,
+ 	BalancethicknessStabilizationEnum,
+ 	BalancethicknessThickeningRateEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13283)
+@@ -22,6 +22,8 @@
+ 	      else if (strcmp(name,"AutodiffNumDependents")==0) return AutodiffNumDependentsEnum;
+ 	      else if (strcmp(name,"AutodiffIndependents")==0) return AutodiffIndependentsEnum;
+ 	      else if (strcmp(name,"AutodiffNumIndependents")==0) return AutodiffNumIndependentsEnum;
++	      else if (strcmp(name,"AutodiffJacobian")==0) return AutodiffJacobianEnum;
++	      else if (strcmp(name,"AutodiffXp")==0) return AutodiffXpEnum;
+ 	      else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum;
+ 	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
+ 	      else if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
+@@ -135,12 +137,12 @@
+ 	      else if (strcmp(name,"MeshUpperelements")==0) return MeshUpperelementsEnum;
+ 	      else if (strcmp(name,"MeshVertexonbed")==0) return MeshVertexonbedEnum;
+ 	      else if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
+-	      else if (strcmp(name,"MeshX")==0) return MeshXEnum;
+-	      else if (strcmp(name,"MeshY")==0) return MeshYEnum;
+          else stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"MeshZ")==0) return MeshZEnum;
++	      if (strcmp(name,"MeshX")==0) return MeshXEnum;
++	      else if (strcmp(name,"MeshY")==0) return MeshYEnum;
++	      else if (strcmp(name,"MeshZ")==0) return MeshZEnum;
+ 	      else if (strcmp(name,"MiscellaneousName")==0) return MiscellaneousNameEnum;
+ 	      else if (strcmp(name,"PrognosticHydrostaticAdjustment")==0) return PrognosticHydrostaticAdjustmentEnum;
+ 	      else if (strcmp(name,"PrognosticMinThickness")==0) return PrognosticMinThicknessEnum;
+@@ -258,12 +260,12 @@
+ 	      else if (strcmp(name,"Loads")==0) return LoadsEnum;
+ 	      else if (strcmp(name,"Materials")==0) return MaterialsEnum;
+ 	      else if (strcmp(name,"Nodes")==0) return NodesEnum;
+-	      else if (strcmp(name,"Parameters")==0) return ParametersEnum;
+-	      else if (strcmp(name,"Vertices")==0) return VerticesEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"Results")==0) return ResultsEnum;
++	      if (strcmp(name,"Parameters")==0) return ParametersEnum;
++	      else if (strcmp(name,"Vertices")==0) return VerticesEnum;
++	      else if (strcmp(name,"Results")==0) return ResultsEnum;
+ 	      else if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
+ 	      else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
+ 	      else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
+@@ -381,12 +383,12 @@
+ 	      else if (strcmp(name,"Vz")==0) return VzEnum;
+ 	      else if (strcmp(name,"VzMacAyeal")==0) return VzMacAyealEnum;
+ 	      else if (strcmp(name,"VzPattyn")==0) return VzPattynEnum;
+-	      else if (strcmp(name,"VzPicard")==0) return VzPicardEnum;
+-	      else if (strcmp(name,"VzStokes")==0) return VzStokesEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
++	      if (strcmp(name,"VzPicard")==0) return VzPicardEnum;
++	      else if (strcmp(name,"VzStokes")==0) return VzStokesEnum;
++	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+ 	      else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
+ 	      else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
+ 	      else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13283)
+@@ -21,6 +21,8 @@
+ 		case AutodiffNumDependentsEnum : return "AutodiffNumDependents";
+ 		case AutodiffIndependentsEnum : return "AutodiffIndependents";
+ 		case AutodiffNumIndependentsEnum : return "AutodiffNumIndependents";
++		case AutodiffJacobianEnum : return "AutodiffJacobian";
++		case AutodiffXpEnum : return "AutodiffXp";
+ 		case BalancethicknessSpcthicknessEnum : return "BalancethicknessSpcthickness";
+ 		case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization";
+ 		case BalancethicknessThickeningRateEnum : return "BalancethicknessThickeningRate";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13283)
+@@ -0,0 +1,71 @@
++/*!\file AutodiffDriversx
++ * \brief: compute outputs from the AD mode,  using our dependents and independents, and drivers available in Adolc.
++ */
++
++#include "../../modules/modules.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../toolkits/toolkits.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++void AutodiffDriversx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,Results* results){
++
++
++
++
++
++	int          i,j;
++	bool         isautodiff       = false;
++
++	int          num_dependents;
++	int          num_independents;
++	int          numberofvertices;
++
++	/*outputs: */
++	IssmDouble  *matJ             = NULL;
++	IssmDouble  *axp                = NULL;
++
++	double     **J                = NULL;
++	double      *xp                = NULL;
++
++
++	/*AD mode on?: */
++	parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
++
++	if(isautodiff){
++		parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
++		parameters->FindParam(&axp,&num_independents,AutodiffXpEnum);
++		parameters->FindParam(&numberofvertices,MeshNumberofverticesEnum);
++
++		if(!num_dependents*num_independents)return;
++
++		/*allocate driver results: */
++		J=xNew<double*>(num_independents);
++		xp=xNew<double>(num_independents); 
++
++		for(i=0;i<num_independents;i++){
++			J[i]=xNew<double>(num_dependents);
++			xp[i]=reCast<double,IssmDouble>(axp[i]);
++		}
++
++		/*Call AD driver: */
++		jacobian(1,num_dependents,num_independents,xp,J);
++
++		/*Add jacobian matrix to results: */
++		matJ=xNew<IssmDouble>(num_dependents*num_independents);
++		for (i=0;i<num_independents;++i){
++			double* rowi=J[i];
++			for (j=0;j<num_dependents;++j){
++				*(matJ+num_dependents*i+j)=rowi[j];
++			}
++		}
++					
++		results->AddObject(new DoubleMatExternalResult(results->Size()+1,AutodiffJacobianEnum,matJ,num_independents,num_dependents,1,0.0));
++
++		/*Free ressources: */
++		xDelete<double*>(J);
++		xDelete<double>(xp);
++		xDelete<IssmDouble>(matJ);
++		xDelete<IssmDouble>(axp);
++	}
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.h	(revision 13283)
+@@ -0,0 +1,14 @@
++/*!\file:  AutodiffDriversx.h
++ * \brief header file for  requesting AD results (gradient, jacobian, etc ...)
++ */ 
++
++#ifndef _AUTODIFF_DRIVERSX_H_
++#define _AUTODIFF_DRIVERSX_H_
++
++#include "../../Container/Container.h"
++
++/* local prototypes: */
++void AutodiffDriversx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,Results* results);
++
++#endif  /* _INPUTTORESULTX_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.cpp	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.cpp	(revision 13283)
+@@ -0,0 +1,41 @@
++/*!\file RequestedDependentsx
++ * \brief: compute outputs that were requested specifically for this solution, such as BasalStress, StrainHeating, etc ...
++ */
++
++#include "../../modules/modules.h"
++#include "../../shared/shared.h"
++#include "../../include/include.h"
++#include "../../toolkits/toolkits.h"
++#include "../../EnumDefinitions/EnumDefinitions.h"
++
++void RequestedDependentsx(Results* results,Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters){
++
++
++
++	int         i;
++	int         output_enum;
++	bool        isautodiff      = false;
++	IssmDouble  output_value;
++	Element    *element         = NULL;
++	int        *dependent_enums = NULL;
++
++	int         num_dependents;
++	IssmPDouble *dependents;
++
++	/*AD mode on?: */
++	parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
++
++	if(isautodiff){
++		parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
++		if(num_dependents){
++			dependents=xNew<IssmPDouble>(num_dependents);
++			parameters->FindParam(&dependent_enums,&num_dependents,AutodiffDependentsEnum);
++
++			/*Go through our dependent variables, and compute the response:*/
++			for(i=0;i<num_dependents;i++){
++				Responsex(&output_value,elements,nodes,vertices,loads,materials,parameters,dependent_enums[i],false,0);
++				output_value>>=dependents[i];
++			}
++		}
++	}
++}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.h	(revision 13283)
+@@ -0,0 +1,14 @@
++/*!\file:  RequestedDependentsx.h
++ * \brief header file for  requesting AD dependents
++ */ 
++
++#ifndef _REQUESTED_DEPENDENTSX_H_
++#define _REQUESTED_DEPENDENTSX_H_
++
++#include "../../Container/Container.h"
++
++/* local prototypes: */
++void RequestedDependentsx(Results* results,Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters);
++
++#endif  /* _INPUTTORESULTX_H */
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h	(revision 13283)
+@@ -7,6 +7,7 @@
+ 
+ /*Modules: */
+ #include "./AddExternalResultx/AddExternalResultx.h"
++#include "./AutodiffDriversx/AutodiffDriversx.h"
+ #include "./AverageFilterx/AverageFilterx.h"
+ #include "./AverageOntoPartitionx/AverageOntoPartitionx.h"
+ #include "./Bamgx/Bamgx.h"
+@@ -102,6 +103,7 @@
+ #include "./Reducevectorgtosx/Reducevectorgtosx.h"
+ #include "./Reducevectorgtofx/Reducevectorgtofx.h"
+ #include "./RequestedOutputsx/RequestedOutputsx.h"
++#include "./RequestedDependentsx/RequestedDependentsx.h"
+ #include "./ResetConstraintsx/ResetConstraintsx.h"
+ #include "./ResetCoordinateSystemx/ResetCoordinateSystemx.h"
+ #include "./Responsex/Responsex.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 13283)
+@@ -63,10 +63,10 @@
+ 		parameters->AddObject(new DoubleVecParam(InversionMaxiterPerStepEnum,maxiter,nsteps));
+ 
+ 		xDelete<int>(control_type);
+-		xDelete<IssmDouble>(cm_responses);
+-		xDelete<IssmDouble>(cm_jump);
+-		xDelete<IssmDouble>(optscal);
+-		xDelete<IssmDouble>(maxiter);
++		iomodel->DeleteData(cm_responses,InversionCostFunctionsEnum);
++		iomodel->DeleteData(cm_jump,InversionStepThresholdEnum);
++		iomodel->DeleteData(optscal,InversionGradientScalingEnum);
++		iomodel->DeleteData(maxiter,InversionMaxiterPerStepEnum);
+ 	}
+ 
+ 	/*Assign output pointer: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 13283)
+@@ -109,7 +109,7 @@
+ 	}
+ 
+ 	/*Free ressources:*/
+-	xDelete<IssmDouble>(spcvector);
++	iomodel->DeleteData(spcvector,ThermalSpctemperatureEnum);
+ 	xDelete<IssmDouble>(times);
+ 	xDelete<IssmDouble>(values);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 13283)
+@@ -89,8 +89,8 @@
+ 	}
+ 
+ 	/*free ressources: */
+-	xDelete<IssmDouble>(vertex_pairing);
+-	xDelete<IssmDouble>(nodeonbed);
++	iomodel->DeleteData(vertex_pairing,PrognosticVertexPairingEnum);
++	iomodel->DeleteData(nodeonbed,MeshVertexonbedEnum);
+ 
+ 	/*Assign output pointer: */
+ 	*ploads=loads;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 13283)
+@@ -128,9 +128,10 @@
+ 
+ 	/*Free data: */
+ 	iomodel->DeleteData(3,DiagnosticIcefrontEnum,ThicknessEnum,BedEnum);
+-	xDelete<IssmDouble>(elements_type);
+-	xDelete<IssmDouble>(pressureload);
++	iomodel->DeleteData(elements_type,FlowequationElementEquationEnum);
++	iomodel->DeleteData(pressureload,DiagnosticIcefrontEnum);
+ 
++
+ 	/*Create Penpair for penalties: */
+ 	iomodel->FetchData(&penalties,&numpenalties,NULL,DiagnosticVertexPairingEnum);
+ 	
+@@ -152,7 +153,7 @@
+ 	}
+ 
+ 	/*free ressources: */
+-	xDelete<IssmDouble>(penalties);
++	iomodel->DeleteData(penalties,DiagnosticVertexPairingEnum);
+ 
+ 	/*Create Riffront loads for rifts: */
+ 	if(numrifts){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 13283)
+@@ -325,17 +325,17 @@
+ 	}
+ 	  
+ 	/*Free data: */
+-	xDelete<IssmDouble>(spcvx);
+-	xDelete<IssmDouble>(spcvy);
+-	xDelete<IssmDouble>(spcvz);
+-	xDelete<IssmDouble>(nodeonmacayeal);
+-	xDelete<IssmDouble>(nodeonpattyn);
+-	xDelete<IssmDouble>(nodeonstokes);
+-	xDelete<IssmDouble>(nodeonicesheet);
+-	xDelete<IssmDouble>(nodeonbed);
+-	xDelete<IssmDouble>(vertices_type);
+-	xDelete<IssmDouble>(surface);
+-	xDelete<IssmDouble>(z);
++	iomodel->DeleteData(spcvx,DiagnosticSpcvxEnum);
++	iomodel->DeleteData(spcvy,DiagnosticSpcvyEnum);
++	iomodel->DeleteData(spcvz,DiagnosticSpcvzEnum);
++	iomodel->DeleteData(nodeonmacayeal,FlowequationBordermacayealEnum);
++	if(dim==3)iomodel->DeleteData(nodeonpattyn,FlowequationBorderpattynEnum);
++	if(dim==3)iomodel->DeleteData(nodeonstokes,FlowequationBorderstokesEnum);
++	if(dim==3)iomodel->DeleteData(nodeonbed,MeshVertexonbedEnum);
++	if(dim==3)iomodel->DeleteData(nodeonicesheet,MaskVertexongroundediceEnum);
++	iomodel->DeleteData(vertices_type,FlowequationVertexEquationEnum);
++	iomodel->DeleteData(surface,SurfaceEnum);
++	iomodel->DeleteData(z,MeshZEnum);
+ 
+ 	/*Free resources:*/
+ 	xDelete<IssmDouble>(timesx);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 13283)
+@@ -13,34 +13,53 @@
+ 
+ void CreateParametersAutodiff(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type){
+ 	
+-	int         i;
++	int         i,j;
+ 	Parameters *parameters       = NULL;
+ 	bool        autodiff_analysis;
+ 	int*        dependents       = NULL;
+ 	int         num_dependents;
+ 	int*        independents       = NULL;
+ 	int         num_independents;
++	int         numberofvertices;
++	IssmDouble* xp=NULL;
+ 	
+ 	/*Get parameters: */
+ 	parameters=*pparameters;
+ 
+ 	/*retrieve some parameters: */
+ 	iomodel->Constant(&autodiff_analysis,AutodiffIsautodiffEnum);
+-
++	
+ 	if(autodiff_analysis){
+ 
++		iomodel->Constant(&num_independents,AutodiffNumIndependentsEnum);
++		iomodel->Constant(&num_dependents,AutodiffNumDependentsEnum);
++		iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
++
+ 		/*recover dependents: */
+ 		parameters->AddObject(iomodel->CopyConstantObject(AutodiffNumDependentsEnum));
+-		iomodel->FetchData(&dependents,NULL,&num_dependents,AutodiffDependentsEnum);
+-		parameters->AddObject(new IntVecParam(AutodiffDependentsEnum,dependents,num_dependents));
+-	
++		if(num_dependents){
++			iomodel->FetchData(&dependents,NULL,&num_dependents,AutodiffDependentsEnum);
++			parameters->AddObject(new IntVecParam(AutodiffDependentsEnum,dependents,num_dependents));
++		}
++
+ 		/*recover independents: */
+ 		parameters->AddObject(iomodel->CopyConstantObject(AutodiffNumIndependentsEnum));
+-		iomodel->FetchData(&independents,NULL,&num_independents,AutodiffIndependentsEnum);
+-		parameters->AddObject(new IntVecParam(AutodiffIndependentsEnum,independents,num_independents));
++		if(num_independents){
++			iomodel->FetchData(&independents,NULL,&num_independents,AutodiffIndependentsEnum);
++			parameters->AddObject(new IntVecParam(AutodiffIndependentsEnum,independents,num_independents));
+ 
++			/*Build state vector, value at which we compute our gradients of dependent variables in adolc: the xp vector  */
++			xp=xNew<IssmDouble>(num_independents*numberofvertices);
++			for(i=0;i<num_independents;i++){
++				IssmDouble* values=iomodel->data[independents[i]];
++				for(j=0;j<numberofvertices;j++){
++					xp[i*numberofvertices+j]=values[j];
++				}
++			}
++			parameters->AddObject(new DoubleVecParam(AutodiffXpEnum,xp,num_independents*numberofvertices));
++		}
++
++		/*Assign output pointer: */
++		*pparameters=parameters;
+ 	}
+-
+-	/*Assign output pointer: */
+-	*pparameters=parameters;
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 13283)
+@@ -91,7 +91,6 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIspddEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIsdelta18oEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIssmbgradientsEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject(AutodiffIsautodiffEnum));
+ 
+ 	iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum);
+ 	if(isdelta18o){
+@@ -104,12 +103,12 @@
+ 		iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oEnum); _assert_(N==2);
+ 		for(i=0;i<M;i++) temp[M+i]=yts*temp[M+i];
+ 		parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oEnum,&temp[0],&temp[M],M));
+-		xDelete<IssmDouble>(temp);
++		iomodel->DeleteData(temp,SurfaceforcingsDelta18oEnum);
+ 
+ 		iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oSurfaceEnum); _assert_(N==2);
+ 		for(i=0;i<M;i++) temp[M+i]=yts*temp[M+i];
+ 		parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oSurfaceEnum,&temp[0],&temp[M],M));
+-		xDelete<IssmDouble>(temp);
++		iomodel->DeleteData(temp,SurfaceforcingsDelta18oSurfaceEnum);
+ 	}
+ 
+ 	/*some parameters that did not come with the iomodel: */
+@@ -126,15 +125,15 @@
+ 	iomodel->FetchData(&requestedoutputs,&numoutputs,NULL,DiagnosticRequestedOutputsEnum);
+ 	parameters->AddObject(new IntParam(DiagnosticNumRequestedOutputsEnum,numoutputs));
+ 	if(numoutputs)parameters->AddObject(new IntVecParam(DiagnosticRequestedOutputsEnum,requestedoutputs,numoutputs));
+-	xDelete<IssmDouble>(requestedoutputs);
++	iomodel->DeleteData(requestedoutputs,DiagnosticRequestedOutputsEnum);
+ 	iomodel->FetchData(&requestedoutputs,&numoutputs,NULL,TransientRequestedOutputsEnum);
+ 	parameters->AddObject(new IntParam(TransientNumRequestedOutputsEnum,numoutputs));
+ 	if(numoutputs)parameters->AddObject(new IntVecParam(TransientRequestedOutputsEnum,requestedoutputs,numoutputs));
+-	xDelete<IssmDouble>(requestedoutputs);
++	iomodel->DeleteData(requestedoutputs,TransientRequestedOutputsEnum);
+ 	iomodel->FetchData(&requestedoutputs,&numoutputs,NULL,SteadystateRequestedOutputsEnum);
+ 	parameters->AddObject(new IntParam(SteadystateNumRequestedOutputsEnum,numoutputs));
+ 	if(numoutputs)parameters->AddObject(new IntVecParam(SteadystateRequestedOutputsEnum,requestedoutputs,numoutputs));
+-	xDelete<IssmDouble>(requestedoutputs);
++	iomodel->DeleteData(requestedoutputs,SteadystateRequestedOutputsEnum);
+ 	
+ 	/*Before returning, create parameters in case we are running Qmu or control types runs: */
+ 	#ifdef _HAVE_CONTROL_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 13283)
+@@ -19,7 +19,7 @@
+ void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters, FILE* IOMODEL,char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_list){
+ 
+ 	int   i,analysis_type,dim,verbose;
+-	bool  isthermal,isprognostic,isdiagnostic,isgroundingline,isenthalpy;
++	bool  isthermal,isprognostic,isdiagnostic,isgroundingline,isenthalpy,autodiff;
+ 	
+ 	/*output: */
+ 	Elements    *elements    = NULL;
+@@ -42,7 +42,13 @@
+ 	iomodel->Constant(&isprognostic,TransientIsprognosticEnum);
+ 	iomodel->Constant(&isdiagnostic,TransientIsdiagnosticEnum);
+ 	iomodel->Constant(&isgroundingline,TransientIsgroundinglineEnum);
+-	
++	iomodel->Constant(&autodiff,AutodiffIsautodiffEnum);
++
++	/*If we are running in AD mode, we need to declare our independent variables now, before 
++	 *and prevent them from being erased during successive calls to iomodel->FetchData and 
++	 iomodel->DeleteData:*/
++	if(autodiff)iomodel->DeclareIndependents();
++
+ 	SetVerbosityLevel(verbose);
+ 
+ 	for(i=0;i<nummodels;i++){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 13283)
+@@ -75,8 +75,8 @@
+ 	MeshPartitionx(&epart, &npart,numberofelements,numberofvertices,elements, numberofelements2d,numberofvertices2d,elements2d,numlayers,elements_width, dim,num_procs);
+ 
+ 	/*Free elements and elements2d: */
+-	xDelete<IssmDouble>(elements);
+-	xDelete<IssmDouble>(elements2d);
++	iomodel->DeleteData(elements,MeshElementsEnum);
++	iomodel->DeleteData(elements2d,MeshElements2dEnum);
+ 
+ 	/*Deal with rifts, they have to be included into one partition only, not several: */
+ 	if(numrifts){
+@@ -86,7 +86,7 @@
+ 			el2=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+3))-1; //matlab indexing to c indexing
+ 			epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding vertices;
+ 		}
+-		xDelete<IssmDouble>(riftinfo); 
++		iomodel->DeleteData(riftinfo,RiftsRiftstructEnum);
+ 	}
+ 
+ 	/*Used later on: */
+@@ -118,7 +118,7 @@
+ 		}
+ 	}//for (i=0;i<numberofelements;i++)
+ 	/*Free data : */
+-	xDelete<IssmDouble>(elements);
++	iomodel->DeleteData(elements,MeshElementsEnum);
+ 
+ 	/*We might have vertex_pairing in which case, some vertices have to be cloned:
+ 	 * penpair has 2 nodes that are poointing toward 2 vertices.
+@@ -129,14 +129,14 @@
+ 			my_vertices[reCast<int>(vertex_pairing[2*i+1])-1]=2; //to know that these elements are not on the partition
+ 		}
+ 	}
+-	xDelete<IssmDouble>(vertex_pairing);
++	iomodel->DeleteData(vertex_pairing,DiagnosticVertexPairingEnum);
+ 	iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,PrognosticVertexPairingEnum);
+ 	for(i=0;i<numvertex_pairing;i++){
+ 		if(my_vertices[reCast<int>(vertex_pairing[2*i+0])-1] && !my_vertices[reCast<int>(vertex_pairing[2*i+1])-1]){
+ 			my_vertices[reCast<int>(vertex_pairing[2*i+1])-1]=2; //to know that these elements are not on the partition
+ 		}
+ 	}
+-	xDelete<IssmDouble>(vertex_pairing);
++	iomodel->DeleteData(vertex_pairing,PrognosticVertexPairingEnum);
+ 
+ 	/*Free ressources:*/
+ 	xDelete<int>(npart);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13283)
+@@ -328,6 +328,10 @@
+ 					./modules/Responsex/Responsex.cpp\
+ 					./modules/RequestedOutputsx/RequestedOutputsx.h\
+ 					./modules/RequestedOutputsx/RequestedOutputsx.cpp\
++					./modules/RequestedDependentsx/RequestedDependentsx.h\
++					./modules/RequestedDependentsx/RequestedDependentsx.cpp\
++					./modules/AutodiffDriversx/AutodiffDriversx.h\
++					./modules/AutodiffDriversx/AutodiffDriversx.cpp\
+ 					./modules/ResetConstraintsx/ResetConstraintsx.h\
+ 					./modules/ResetConstraintsx/ResetConstraintsx.cpp\
+ 					./modules/ResetCoordinateSystemx/ResetCoordinateSystemx.h\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13283)
+@@ -25,6 +25,7 @@
+ IoModel::IoModel(){
+ 	this->fid=NULL;
+ 	this->data=NULL;
++	this->independents=NULL;
+ 	this->constants=NULL;
+ 	
+ 	this->my_elements=NULL;
+@@ -54,6 +55,10 @@
+ 	/*Initialize data: */
+ 	this->data=xNew<IssmDouble*>(MaximumNumberOfEnums);
+ 	for(int i=0;i<MaximumNumberOfEnums;i++) this->data[i]=NULL;
++
++	/*Initialize array detecting whether data[i] is an independent AD mode variable: */
++	this->independents=xNew<bool>(MaximumNumberOfEnums);
++	for(int i=0;i<MaximumNumberOfEnums;i++) this->independents[i]=false;
+ 	
+ 	/*Initialize permanent data: */
+ 	this->my_elements=NULL;
+@@ -84,6 +89,7 @@
+ 	#endif
+ 
+ 	xDelete<IssmDouble*>(this->data);
++	xDelete<bool>(this->independents);
+ 	xDelete<bool>(this->my_elements);
+ 	xDelete<bool>(this->my_nodes);
+ 	xDelete<int>(this->my_vertices);
+@@ -190,7 +196,7 @@
+ 	return this->data[data_enum];
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::DeleteData{{{*/
++/*FUNCTION IoModel::DeleteData(int num,...){{{*/
+ void  IoModel::DeleteData(int num,...){
+ 
+ 	va_list ap;
+@@ -204,10 +210,19 @@
+ 	for(i = 0; i <num; i++){
+ 		dataenum=va_arg(ap, int);
+ 		_assert_(dataenum<MaximumNumberOfEnums);
+-		xDelete<IssmDouble>(this->data[dataenum]);
++		
++		/*do not erase independent variables for the AD mode computations!: */
++		if (!this->independents[dataenum]) xDelete<IssmDouble>(this->data[dataenum]);
+ 	}
+ 	va_end(ap);
+ } /*}}}*/
++/*FUNCTION IoModel::DeleteData(IssmDouble* {{{*/
++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::FetchConstants{{{*/
+ void  IoModel::FetchConstants(void){
+ 
+@@ -507,7 +522,7 @@
+ 	/*output: */
+ 	IssmPDouble   scalar;
+ 	int      code;
+-	
++
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+ 	
+@@ -537,7 +552,7 @@
+ 	char* string=NULL;
+ 	int   string_size;
+ 	int code=0;
+-	
++
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
+ 	
+@@ -590,8 +605,8 @@
+ 	int*    integer_matrix=NULL;
+ 	int code=0;
+ 	int vector_type=0;
+-	
+-	
++
++
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
+ 
+@@ -663,7 +678,7 @@
+ 	IssmPDouble* matrix=NULL;
+ 	int code=0;
+ 	int vector_type=0;
+-	
++
+ 	/*Set file pointer to beginning of the data: */
+ 	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
+ 	if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
+@@ -697,8 +712,16 @@
+ 		#ifdef _HAVE_MPI_
+ 		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+ 		#endif
+-		*pmatrix=xNew<IssmDouble>(M*N);
+-		for (int i=0;i<M*N;++i) (*pmatrix)[i]=matrix[i];
++
++		if (this->independents[data_enum]){
++			/*this data has already been checked out! So cancel all that we've done here, and return 
++			 * the data[data_enum] directly: */
++			*pmatrix=this->data[data_enum];
++		}
++		else{
++			*pmatrix=xNew<IssmDouble>(M*N);
++			for (int i=0;i<M*N;++i) (*pmatrix)[i]=matrix[i];
++		}
+ 		xDelete<IssmPDouble>(matrix);
+ 	}
+ 	else
+@@ -935,6 +958,11 @@
+ 	for(i=0; i<num; i++){
+ 		
+ 		dataenum=va_arg(ap, int);
++		
++		if (this->independents[dataenum]){
++			/*this data has already been checked out! Continue: */
++			continue;
++		}
+ 
+ 		/*Some checks in debugging mode*/
+ 		/*{{{*/
+@@ -1145,10 +1173,11 @@
+ 			break;
+ 			/*}}}*/
+ 	}
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(IssmDoublevector);
++	/*Free ressources. Pay attention to not freeing an AD mode independent variable though!:*/
++	if (!this->independents[vector_enum] && !this->independents[default_vector_enum]) xDelete<IssmDouble>(IssmDoublevector);
+ 	xDelete<char>(string);
+ }
++/*}}}*/
+ /*FUNCTION IoModel::LastIndex{{{*/
+ void IoModel::LastIndex(int *pindex){
+ 
+@@ -1184,6 +1213,7 @@
+ 	/*Assign output pointers:*/
+ 	*pindex=lastindex;
+ }
++/*}}}*/
+ /*FUNCTION IoModel::SetFilePointerToData{{{*/
+ FILE* IoModel::SetFilePointerToData(int* pcode,int* pvector_type, int data_enum){
+ 
+@@ -1249,3 +1279,96 @@
+ 	return fid;
+ }
+ /*}}}*/
++/*FUNCTION IoModel::DeclareIndependents{{{*/
++void IoModel::DeclareIndependents(void){
++
++	bool autodiff=false;
++	int  dummy;
++	int i;
++	int  num_independents;
++	int* independents=NULL;
++
++	#ifdef _HAVE_ADOLC_
++	/*recover independent enums: */
++	this->Constant(&num_independents,AutodiffNumIndependentsEnum);
++	if(num_independents){
++		this->FetchData(&independents,&dummy,&dummy,AutodiffIndependentsEnum);
++
++		/*now go fetch the independent variables for each independent enum: */
++		for(i=0;i<num_independents;i++){
++			this->FetchIndependent(independents[i]);
++		}
++		xDelete<int>(independents);
++	}
++	#else
++	/*if we asked for AD computations, we have a problem!: */
++	this->Constant(&autodiff,AutodiffIsautodiffEnum);
++	if(autodiff)_error_("Cannot carry out AD mode computations without support of ADOLC compiled in!");
++	#endif
++
++}
++/*}}}*/
++/*FUNCTION IoModel::FetchIndependent{{{*/
++void IoModel::FetchIndependent(int independent_enum){
++
++	#ifdef _HAVE_ADOLC_ //cannot come here unless you are running AD mode, from DeclaredIndependents:
++	extern int my_rank;
++	extern int num_procs;
++
++	/*output: */
++	int M,N;
++	IssmPDouble* buffer=NULL; //a buffer to read the data from disk
++	IssmDouble* matrix=NULL; //our independent variable
++	int code=0;
++	int vector_type=0;
++	
++	/*Set file pointer to beginning of the data: */
++	fid=this->SetFilePointerToData(&code,&vector_type,independent_enum);
++	if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(independent_enum));
++	
++	/*Now fetch: */
++
++	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
++	/*numberofelements: */
++	if(my_rank==0){  
++		if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
++	}
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
++	#endif
++
++	if(my_rank==0){  
++		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
++	}
++	#ifdef _HAVE_MPI_
++	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
++	#endif
++
++	/*Now allocate matrix: */
++	if(M*N){
++		buffer=xNew<IssmPDouble>(M*N);
++		matrix=xNew<IssmDouble>(M*N);
++
++		/*Read matrix on node 0, then broadcast: */
++		if(my_rank==0){  
++			if(fread(buffer,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
++			
++			/*Now, before we even broadcast this to other nodes, declare the whole matrix as a independent variable!: */
++			for (int i=0;i<M*N;++i) matrix[i]<<=buffer[i];  /*we use the <<= ADOLC overloaded operator to declare the independency*/
++		}
++		#ifdef _HAVE_MPI_
++		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
++		#endif
++		
++		xDelete<IssmPDouble>(buffer);
++	}
++	else _error_("cannot declare the independent variable " << EnumToStringx(independent_enum) <<  "if it's empty!");
++
++	/*Ok, we are almost done. Matrix is now a independent matrix. We don't want this matrix to be fetched again in the 
++	 *future, which would effectively write over the independency in the ADOLC tape! So we are going to keep track of this 
++	 independent matrix inthe iomodel->data[independent_enum] data slot: */
++	this->data[independent_enum]=matrix;
++	this->independents[independent_enum]=true;
++ 	#endif
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h	(revision 13283)
+@@ -18,10 +18,11 @@
+ class IoModel {
+ 
+ 	private: 
+-		IssmDouble **data;        //this dataset holds temporary data, memory intensive.
+ 		Parameters  *constants;   //this dataset holds all IssmDouble, int, bool and char *parameters read in from the input file.*
+-
++	
+ 	public:
++		IssmDouble **data;        //this dataset holds temporary data, memory intensive.
++		
+ 		/*This data needs to stay memory resident at all time, even if it's memory intensive: */
+ 		FILE *fid;         //pointer to input file
+ 		bool *my_elements;
+@@ -30,10 +31,14 @@
+ 		int  *singlenodetoelementconnectivity;
+ 		int  *numbernodetoelementconnectivity;
+ 
++
+ 		/*Data to synchronize through low level object drivers: */
+ 		int nodecounter;         //keep track of how many nodes are being created in each analysis type
+ 		int loadcounter;         //keep track of how many loads are being created in each analysis type
+ 		int constraintcounter;   //keep track of how many constraints are being created in each analysis type
++		
++		/*for AD mode: to keep track of our independent variables we fetch:*/
++		bool* independents;
+ 
+ 		/*Methods*/
+ 		~IoModel();
+@@ -49,6 +54,7 @@
+ 		Param      *CopyConstantObject(int constant_enum);
+ 		IssmDouble *Data(int dataenum);
+ 		void        DeleteData(int num,...);
++		void        DeleteData(IssmDouble* vector, int dataenum);
+ 		void        FetchConstants(void);
+ 		void        FetchData(bool* pboolean,int data_enum);
+ 		void        FetchData(int* pinteger,int data_enum);
+@@ -63,9 +69,8 @@
+ 		void        FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,IssmDouble default_value=0);
+ 		void        LastIndex(int *pindex);
+ 		FILE*       SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);
+-		#ifdef _HAVE_ADOLC_
+-		void        FetchIndependentVariable(IssmDouble**  pscalarmatrix,int* pM,int* pN,int data_enum);
+-		#endif
++		void        DeclareIndependents(void);
++		void        FetchIndependent(int dependent_enum);
+ };
+ 
+ #endif  /* _IOMODEL_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m	(revision 13283)
+@@ -6,8 +6,8 @@
+ classdef autodiff
+ 	properties (SetAccess=public) 
+ 		isautodiff = false;
+-		dependents = {''};
+-		independents = {''};
++		dependents = {};
++		independents = {};
+ 	end
+ 	methods
+ 		function obj = autodiff(varargin) % {{{
+@@ -23,6 +23,10 @@
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
++		%Early return 
++		if ~obj.isautodiff, return; end
++
++
+ 		end % }}}
+ 		function disp(obj) % {{{
+ 			disp(sprintf('   automatic differentiation parameters:'));
+@@ -39,21 +43,27 @@
+ 
+ 			%process dependent variables
+ 			num_dependents=numel(obj.dependents);
+-			data=zeros(1,num_dependents);
+-			for i=1:num_dependents,
+-				data(i)=StringToEnum(obj.dependents{i});
+-			end
+-			WriteData(fid,'data',data,'enum',AutodiffDependentsEnum(),'format','DoubleMat','mattype',3);
+ 			WriteData(fid,'data',num_dependents,'enum',AutodiffNumDependentsEnum(),'format','Integer');
+ 			
++			if(num_dependents),
++				data=zeros(1,num_dependents);
++				for i=1:num_dependents,
++					data(i)=StringToEnum(obj.dependents{i});
++				end
++				WriteData(fid,'data',data,'enum',AutodiffDependentsEnum(),'format','DoubleMat','mattype',3);
++			end
++			
+ 			%process independent variables
+ 			num_independents=numel(obj.independents);
+-			data=zeros(1,num_independents);
+-			for i=1:num_independents,
+-				data(i)=StringToEnum(obj.independents{i});
++			WriteData(fid,'data',num_independents,'enum',AutodiffNumIndependentsEnum(),'format','Integer');
++			
++			if(num_independents)
++				data=zeros(1,num_independents);
++				for i=1:num_independents,
++					data(i)=StringToEnum(obj.independents{i});
++				end
++				WriteData(fid,'data',data,'enum',AutodiffIndependentsEnum(),'format','DoubleMat','mattype',3);
+ 			end
+-			WriteData(fid,'data',data,'enum',AutodiffIndependentsEnum(),'format','DoubleMat','mattype',3);
+-			WriteData(fid,'data',num_independents,'enum',AutodiffNumIndependentsEnum(),'format','Integer');
+ 
+ 		end % }}}
+ 	end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13283)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=470;
++macro=472;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffXpEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffXpEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffXpEnum.m	(revision 13283)
+@@ -0,0 +1,11 @@
++function macro=AutodiffXpEnum()
++%AUTODIFFXPENUM - Enum of AutodiffXp
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=AutodiffXpEnum()
++
++macro=StringToEnum('AutodiffXp');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffJacobianEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffJacobianEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffJacobianEnum.m	(revision 13283)
+@@ -0,0 +1,11 @@
++function macro=AutodiffJacobianEnum()
++%AUTODIFFJACOBIANENUM - Enum of AutodiffJacobian
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=AutodiffJacobianEnum()
++
++macro=StringToEnum('AutodiffJacobian');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13282)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13283)
+@@ -58,6 +58,26 @@
+ 
+ 	return StringToEnum('AutodiffNumIndependents')[0]
+ 
++def AutodiffJacobianEnum():
++	"""
++	AUTODIFFJACOBIANENUM - Enum of AutodiffJacobian
++
++	   Usage:
++	      macro=AutodiffJacobianEnum()
++	"""
++
++	return StringToEnum('AutodiffJacobian')[0]
++
++def AutodiffXpEnum():
++	"""
++	AUTODIFFXPENUM - Enum of AutodiffXp
++
++	   Usage:
++	      macro=AutodiffXpEnum()
++	"""
++
++	return StringToEnum('AutodiffXp')[0]
++
+ def BalancethicknessSpcthicknessEnum():
+ 	"""
+ 	BALANCETHICKNESSSPCTHICKNESSENUM - Enum of BalancethicknessSpcthickness
+@@ -4716,5 +4736,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 470
++	return 472
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13283-13284.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13283-13284.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13283-13284.diff	(revision 13394)
@@ -0,0 +1,31 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/ad.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/ad.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/ad.m	(revision 13284)
+@@ -0,0 +1,26 @@
++md=triangle(model,'../Exp/Square.exp',50000);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'macayeal','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.diagnostic.requested_outputs=StressTensorEnum;
++md.autodiff.isautodiff=true;
++md.autodiff.independents={'Thickness','Surface'};
++md.autodiff.dependents={'IceVolume'};
++%md=solve(md,DiagnosticSolutionEnum);
++md=solve(md,TransientSolutionEnum);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure',...
++	'StressTensorxx','StressTensoryy','StressTensorxy'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,...
++	1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution.Vx),...
++	(md.results.TransientSolution.Vy),...
++	(md.results.TransientSolution.Vel),...
++	(md.results.TransientSolution.Pressure),...
++	(md.results.TransientSolution.StressTensorxx),...
++	(md.results.TransientSolution.StressTensoryy),...
++	(md.results.TransientSolution.StressTensorxy),...
++	};
Index: /issm/oecreview/Archive/12678-13393/ISSM-13284-13285.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13284-13285.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13284-13285.diff	(revision 13394)
@@ -0,0 +1,42 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13284)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13285)
+@@ -33,6 +33,7 @@
+ 	parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
+ 
+ 	if(isautodiff){
++		#ifdef _HAVE_ADOLC_
+ 		parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
+ 		parameters->FindParam(&axp,&num_independents,AutodiffXpEnum);
+ 		parameters->FindParam(&numberofvertices,MeshNumberofverticesEnum);
+@@ -67,5 +68,8 @@
+ 		xDelete<double>(xp);
+ 		xDelete<IssmDouble>(matJ);
+ 		xDelete<IssmDouble>(axp);
++		#else
++		_error_("Should not be requesting AD drivers when an AD library is not available!");
++		#endif
+ 	}
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.cpp	(revision 13284)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.cpp	(revision 13285)
+@@ -26,6 +26,7 @@
+ 	parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
+ 
+ 	if(isautodiff){
++		#ifdef _HAVE_ADOLC_
+ 		parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
+ 		if(num_dependents){
+ 			dependents=xNew<IssmPDouble>(num_dependents);
+@@ -37,5 +38,8 @@
+ 				output_value>>=dependents[i];
+ 			}
+ 		}
++		#else
++		_error_("Should not be requesting dependents when an AD library is not available!");
++		#endif
+ 	}
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-13285-13286.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13285-13286.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13285-13286.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13285)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13286)
+@@ -169,10 +169,12 @@
+ 		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, ProfilingCurrentFlopsEnum, Current_flops, 1, 0));
+ 	}
+ 
++	#ifdef _HAVE_ADOLC_
+ 	if(autodiff){
+ 		trace_off();
+ 		AutodiffDriversx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results);
+ 	}
++	#endif
+ 
+ 
+ 	#ifdef _HAVE_MPI_
Index: /issm/oecreview/Archive/12678-13393/ISSM-13286-13287.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13286-13287.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13286-13287.diff	(revision 13394)
@@ -0,0 +1,76 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13286)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13287)
+@@ -30,6 +30,9 @@
+ void FetchData(double* pscalar,PyObject* py_float);
+ void FetchData(int* pinteger,PyObject* py_long);
+ void FetchData(bool* pbool,PyObject* py_boolean);
++void FetchData(BamgGeom** bamggeom,PyObject* py_ref);
++void FetchData(BamgMesh** bamgmesh,PyObject* py_ref);
++void FetchData(BamgOpts** bamgopts,PyObject* py_ref);
+ void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments);
+ 
+ int CheckNumPythonArguments(PyObject* inputs,int NRHS, void (*function)( void ));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13286)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13287)
+@@ -136,6 +136,21 @@
+ 	if(pvector)*pvector=vector;
+ }
+ /*}}}*/
++/*FUNCTION FetchData(BamgGeom** bamggeom,PyObject* py_ref) {{{*/
++void FetchData(BamgGeom** bamggeom,PyObject* py_ref){
++	 _error_("not implemented yet (good luck John!)");
++}
++/*}}}*/
++/*FUNCTION FetchData(BamgMesh** bamggeom,PyObject* py_ref) {{{*/
++void FetchData(BamgMesh** bamggeom,PyObject* py_ref){
++	_error_("not implemented yet (good luck John!)");
++}
++/*}}}*/
++/*FUNCTION FetchData(BamgOpts** bamggeom,PyObject* py_ref) {{{*/
++void FetchData(BamgOpts** bamggeom,PyObject* py_ref){
++	 _error_("not implemented yet (good luck John!)");
++}
++/*}}}*/
+ /*FUNCTION FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments){{{*/
+ void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments){
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13286)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13287)
+@@ -5,6 +5,7 @@
+ #Modules {{{
+ if MODULES
+ lib_LTLIBRARIES = BamgConvertMesh.la\
++						BamgMesher.la\
+ 						ElementConnectivity.la\
+ 						EnumToString.la\
+ 						InterpFromMeshToMesh2d.la\
+@@ -58,6 +59,10 @@
+ 									  ../BamgConvertMesh/BamgConvertMesh.h
+ BamgConvertMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
++BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\
++								../BamgMesher/BamgMesher.h
++BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++
+ ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+ 											../ElementConnectivity/ElementConnectivity.h
+ ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp	(revision 13286)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp	(revision 13287)
+@@ -21,7 +21,7 @@
+ 	MODULEBOOT();
+ 
+ 	/*checks on arguments on the matlab side: */
+-	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&BamgMesherUsage);
++	CHECKARGUMENTS(NLHS,NRHS,&BamgMesherUsage);
+ 
+ 	/*Initialize outputs*/
+ 	bamggeom_out=new BamgGeom();
Index: /issm/oecreview/Archive/12678-13393/ISSM-13287-13288.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13287-13288.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13287-13288.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 13287)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/startup.py	(revision 13288)
+@@ -84,8 +84,6 @@
+ from private import *
+ from triangle import *
+ from setmask import *
+-from runme import runme
+-
+ #}}}
+ 
+ print("\n  To get started with ISSM, type issmdoc at the command prompt.\n\n")
Index: /issm/oecreview/Archive/12678-13393/ISSM-13288-13289.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13288-13289.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13288-13289.diff	(revision 13394)
@@ -0,0 +1,31 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid.sh	(revision 13288)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid.sh	(revision 13289)
+@@ -6,16 +6,19 @@
+ 
+ ./configure \
+  --prefix=$ISSM_DIR \
+- --with-matlab-dir=$MATLAB_DIR \
++ --with-matlab-dir=$ISSM_DIR/externalpackages/matlab/install \
+  --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+  --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
+  --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
++ --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-python-version=2.7\
+  --with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
++ --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+  --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
+  --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich -lmpl " \
+  --with-petsc-arch=$ISSM_ARCH \
+  --with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
+- --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+  --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+  --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+  --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
+@@ -30,4 +33,3 @@
+  --with-cxxoptflags="-march=opteron -O2" \
+  --with-numthreads=16 \
+  --enable-debugging
+- #--with-serial=no \
Index: /issm/oecreview/Archive/12678-13393/ISSM-13289-13290.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13289-13290.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13289-13290.diff	(revision 13394)
@@ -0,0 +1,79 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13289)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13290)
+@@ -10,25 +10,18 @@
+ 
+ void AutodiffDriversx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,Results* results){
+ 
++	int  i                  ,j;
++	bool isautodiff       = false;
++	int  num_dependents;
++	int  num_independents;
++	int  numberofvertices;
+ 
+-
+-
+-
+-	int          i,j;
+-	bool         isautodiff       = false;
+-
+-	int          num_dependents;
+-	int          num_independents;
+-	int          numberofvertices;
+-
+ 	/*outputs: */
+-	IssmDouble  *matJ             = NULL;
+-	IssmDouble  *axp                = NULL;
++	IssmDouble  *matJ = NULL;
++	IssmDouble  *axp  = NULL;
++	double     **J    = NULL;
++	double      *xp   = NULL;
+ 
+-	double     **J                = NULL;
+-	double      *xp                = NULL;
+-
+-
+ 	/*AD mode on?: */
+ 	parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
+ 
+@@ -38,7 +31,7 @@
+ 		parameters->FindParam(&axp,&num_independents,AutodiffXpEnum);
+ 		parameters->FindParam(&numberofvertices,MeshNumberofverticesEnum);
+ 
+-		if(!num_dependents*num_independents)return;
++		if(!num_dependents*num_independents) return;
+ 
+ 		/*allocate driver results: */
+ 		J=xNew<double*>(num_independents);
+@@ -60,7 +53,6 @@
+ 				*(matJ+num_dependents*i+j)=rowi[j];
+ 			}
+ 		}
+-					
+ 		results->AddObject(new DoubleMatExternalResult(results->Size()+1,AutodiffJacobianEnum,matJ,num_independents,num_dependents,1,0.0));
+ 
+ 		/*Free ressources: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.h	(revision 13289)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.h	(revision 13290)
+@@ -10,5 +10,4 @@
+ /* local prototypes: */
+ void AutodiffDriversx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,Results* results);
+ 
+-#endif  /* _INPUTTORESULTX_H */
+-
++#endif  /* _AUTODIFF_DRIVERSX_H_*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h	(revision 13289)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.h	(revision 13290)
+@@ -31,7 +31,6 @@
+ 		int  *singlenodetoelementconnectivity;
+ 		int  *numbernodetoelementconnectivity;
+ 
+-
+ 		/*Data to synchronize through low level object drivers: */
+ 		int nodecounter;         //keep track of how many nodes are being created in each analysis type
+ 		int loadcounter;         //keep track of how many loads are being created in each analysis type
Index: /issm/oecreview/Archive/12678-13393/ISSM-13290-13291.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13290-13291.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13290-13291.diff	(revision 13394)
@@ -0,0 +1,23 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m	(revision 13290)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/autodiff.m	(revision 13291)
+@@ -5,8 +5,8 @@
+ 
+ classdef autodiff
+ 	properties (SetAccess=public) 
+-		isautodiff = false;
+-		dependents = {};
++		isautodiff   = false;
++		dependents   = {};
+ 		independents = {};
+ 	end
+ 	methods
+@@ -26,7 +26,6 @@
+ 		%Early return 
+ 		if ~obj.isautodiff, return; end
+ 
+-
+ 		end % }}}
+ 		function disp(obj) % {{{
+ 			disp(sprintf('   automatic differentiation parameters:'));
Index: /issm/oecreview/Archive/12678-13393/ISSM-13291-13292.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13291-13292.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13291-13292.diff	(revision 13394)
@@ -0,0 +1,20 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13291)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13292)
+@@ -251,6 +251,7 @@
+ 					./modules/ModelProcessorx/UpdateCounters.cpp\
+ 					./modules/ModelProcessorx/CreateDataSets.cpp\
+ 					./modules/ModelProcessorx/CreateParameters.cpp\
++					./modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp\
+ 					./modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp\
+ 					./modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp\
+ 					./modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp\
+@@ -432,7 +433,6 @@
+ 					  ./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h\
+ 					  ./modules/ModelProcessorx/Control/CreateParametersControl.cpp\
+ 					  ./modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp\
+-					  ./modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp\
+ 					  ./modules/InputControlUpdatex/InputControlUpdatex.h\
+ 					  ./modules/InputControlUpdatex/InputControlUpdatex.cpp\
+ 					  ./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h\
Index: /issm/oecreview/Archive/12678-13393/ISSM-13292-13293.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13292-13293.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13292-13293.diff	(revision 13394)
@@ -0,0 +1,25 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13292)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13293)
+@@ -5,6 +5,7 @@
+ #ifndef _EXP_H_
+ #define _EXP_H_
+ 
++#include <cstring>
+ #include "../../classes/objects/Contour.h"
+ #include "../../shared/Numerics/recast.h"
+ #include "../../Container/Container.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/GenericOption.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/GenericOption.h	(revision 13292)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Options/GenericOption.h	(revision 13293)
+@@ -12,6 +12,8 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
++#include <cstring>
++
+ #include "../../../include/include.h"
+ #include "../../../shared/Exceptions/exceptions.h"
+ #include "../../../io/io.h"
Index: /issm/oecreview/Archive/12678-13393/ISSM-13293-13294.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13293-13294.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13293-13294.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13293)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/Solverx.h	(revision 13294)
+@@ -28,7 +28,12 @@
+ 
+ #ifdef _HAVE_ADOLC_
+ void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters);
++// call back functions:
+ ADOLC_ext_fct EDF_for_solverx;
++ADOLC_ext_fct_fos_forward EDF_fos_forward_for_solverx;
++ADOLC_ext_fct_fos_reverse EDF_fos_reverse_for_solverx;
++ADOLC_ext_fct_fov_forward EDF_fov_forward_for_solverx;
++ADOLC_ext_fct_fov_reverse EDF_fov_reverse_for_solverx;
+ #endif
+ 
+ #endif  /* _SOLVERX_H */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13294-13295.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13294-13295.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13294-13295.diff	(revision 13394)
@@ -0,0 +1,61 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13294)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13295)
+@@ -65,11 +65,52 @@
+ /*}}}*/
+ 
+ #ifdef _HAVE_ADOLC_
+-int EDF_for_solverx(int n, IssmPDouble *x, int m, IssmPDouble *y){/*{{{*/
+-    if(m*(m+1)!=n)_error_("Stiffness matrix should be square!");
+-    SolverxSeq(y,x, x+m*m, m);
++int EDF_for_solverx(int n, IssmPDouble *x, int m, IssmPDouble *y){ /*{{{*/
++    SolverxSeq(y,x, x+m*m, m); // x is where the matrix starts, x+m*m is where the right-hand side starts
+     return 0;
+-}/*}}}*/
++}
++/*}}}*/
++
++int EDF_fos_forward_for_solverx(int n, IssmPDouble *inVal, IssmPDouble *inDeriv, int m, IssmPDouble *outVal, IssmPDouble *outDeriv) { /*{{{*/
++#ifdef _HAVE_GSL_
++  // the matrix will be modified by LU decomposition. Use gsl_A copy
++  double* Acopy = xNew<double>(m*m);
++  xMemCpy(Acopy,inVal,m*m);
++  /*Initialize gsl matrices and vectors: */
++  gsl_matrix_view gsl_A = gsl_matrix_view_array (Acopy,m,m);
++  gsl_vector_view gsl_b = gsl_vector_view_array (inVal+m*m,m); // the right hand side starts at address inVal+m*m
++  gsl_permutation *perm_p = gsl_permutation_alloc (m);
++  int  signPerm;
++  // factorize
++  gsl_linalg_LU_decomp (&gsl_A.matrix, perm_p, &signPerm);
++  gsl_vector *gsl_x_p = gsl_vector_alloc (m);
++  // solve for the value
++  gsl_linalg_LU_solve (&gsl_A.matrix, perm_p, &gsl_b.vector, gsl_x_p);
++  /*Copy result*/
++  xMemCpy(outVal,gsl_vector_ptr(gsl_x_p,0),m);
++  gsl_vector_free(gsl_x_p);
++  // solve for the derivatives acc. to A * dx = r  with r=db - dA * x
++  // compute the RHS
++  double* r=xNew<double>(m);
++  for (int i=0; i<m; i++) {
++    r[i]=inDeriv[m*m+i]; // this is db[i]
++    for (int j=0;j<m; j++) {
++      r[i]-=inDeriv[i*n+j]*outVal[j]; // this is dA[i][j]*x[j]
++    }
++  }
++  gsl_vector_view gsl_r=gsl_vector_view_array(r,m);
++  gsl_vector *gsl_dx_p = gsl_vector_alloc(m);
++  gsl_linalg_LU_solve (&gsl_A.matrix, perm_p, &gsl_r.vector, gsl_dx_p);
++  xMemCpy(outDeriv,gsl_vector_ptr(gsl_dx_p,0),m);
++  gsl_vector_free(gsl_dx_p);
++  xDelete(r);
++  gsl_permutation_free(perm_p);
++  xDelete(Acopy);
++  #endif
++  return 0;
++}
++/*}}}*/
++
+ void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
+ 	// pack inputs to conform to the EDF-prescribed interface
+         IssmDouble*  adoubleEDFin=xNew<IssmDouble>(n*(n+1));  // packed inputs, i.e. matrix and right hand side
Index: /issm/oecreview/Archive/12678-13393/ISSM-13295-13296.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13295-13296.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13295-13296.diff	(revision 13394)
@@ -0,0 +1,57 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h	(revision 13295)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h	(revision 13296)
+@@ -33,6 +33,29 @@
+ }
+ 
+ template <class T> 
++T** xNew(unsigned int dim1, unsigned int dim2) {
++#ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
++  T* buf=new T[dim1*dim2];
++  T** aT_pp =new T*[dim1];
++  for (unsigned int i=0;i<dim1;++i) {
++    aT_pp [i]=buf;
++    buf+=dim2;
++  }
++  assert(aT_pp );
++  return aT_pp ;
++#else
++  T* buf=(T*)malloc(dim1*dim2*sizeof(T));
++  T** aT_pp =(T**)malloc(dim1*sizeof(T*));
++  for (unsigned int i=0;i<dim1;++i) {
++    aT_pp [i]=buf;
++    buf+=dim2;
++  }
++  assert(aT_pp );
++  return aT_pp ;
++#endif
++}
++
++template <class T>
+ T* xNewZeroInit(unsigned int size) {
+ #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
+   T* aT_p=xNew<T>(size);
+@@ -47,7 +70,21 @@
+ }
+ 
+ template <class T>
+-void xDelete(T*& aT_p) { 
++void xDelete(T**& aT_pp, unsigned int dim1) {
++  if (aT_pp) {
++#ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
++    delete [](*aT_pp);
++    delete [](aT_pp);
++#else
++    free((void*)*aT_pp)
++    free((void**)aT_pp);
++#endif
++  }
++  aT_pp=0;
++}
++
++template <class T>
++void xDelete(T*& aT_p) {
+   if (aT_p) 
+ #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
+     delete []aT_p;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13296-13297.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13296-13297.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13296-13297.diff	(revision 13394)
@@ -0,0 +1,57 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13296)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13297)
+@@ -111,6 +111,52 @@
+ }
+ /*}}}*/
+ 
++int EDF_fov_forward_for_solverx(int n, IssmPDouble *inVal, int directionCount, IssmPDouble **inDeriv, int m, IssmPDouble *outVal, IssmPDouble **outDeriv) { /*{{{*/
++#ifdef _HAVE_GSL_
++  // the matrix will be modified by LU decomposition. Use gsl_A copy
++  double* Acopy = xNew<double>(m*m);
++  xMemCpy(Acopy,inVal,m*m);
++  /*Initialize gsl matrices and vectors: */
++  gsl_matrix_view gsl_A = gsl_matrix_view_array (Acopy,m,m);
++  gsl_vector_view gsl_b = gsl_vector_view_array (inVal+m*m,m); // the right hand side starts at address inVal+m*m
++  gsl_permutation *perm_p = gsl_permutation_alloc (m);
++  int  signPerm;
++  // factorize
++  gsl_linalg_LU_decomp (&gsl_A.matrix, perm_p, &signPerm);
++  gsl_vector *gsl_x_p = gsl_vector_alloc (m);
++  // solve for the value
++  gsl_linalg_LU_solve (&gsl_A.matrix, perm_p, &gsl_b.vector, gsl_x_p);
++  /*Copy result*/
++  xMemCpy(outVal,gsl_vector_ptr(gsl_x_p,0),m);
++  gsl_vector_free(gsl_x_p);
++  // solve for the derivatives acc. to A * dx = r  with r=db - dA * x
++  double* r=xNew<double>(m);
++  gsl_vector *gsl_dx_p = gsl_vector_alloc(m);
++  for (int dir=0;dir<directionCount;++dir) {
++    // compute the RHS
++    for (int i=0; i<m; i++) {
++      r[i]=inDeriv[m*m+i][dir]; // this is db[i]
++      for (int j=0;j<m; j++) {
++        r[i]-=inDeriv[i*n+j][dir]*outVal[j]; // this is dA[i][j]*x[j]
++      }
++    }
++    gsl_vector_view gsl_r=gsl_vector_view_array(r,m);
++    gsl_linalg_LU_solve (&gsl_A.matrix, perm_p, &gsl_r.vector, gsl_dx_p);
++    // reuse r
++    xMemCpy(r,gsl_vector_ptr(gsl_dx_p,0),m);
++    for (int i=0; i<m; i++) {
++      outDeriv[i][dir]=r[i];
++    }
++  }
++  gsl_vector_free(gsl_dx_p);
++  xDelete(r);
++  gsl_permutation_free(perm_p);
++  xDelete(Acopy);
++  #endif
++  return 0;
++}
++/*}}}*/
++
+ void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
+ 	// pack inputs to conform to the EDF-prescribed interface
+         IssmDouble*  adoubleEDFin=xNew<IssmDouble>(n*(n+1));  // packed inputs, i.e. matrix and right hand side
Index: /issm/oecreview/Archive/12678-13393/ISSM-13297-13298.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13297-13298.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13297-13298.diff	(revision 13394)
@@ -0,0 +1,49 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13297)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13298)
+@@ -7,7 +7,9 @@
+ #include "../../include/include.h"
+ #include "../../toolkits/toolkits.h"
+ #include "../../EnumDefinitions/EnumDefinitions.h"
++#include "../../shared/Numerics/adolc_edf.h"
+ 
++
+ void AutodiffDriversx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,Results* results){
+ 
+ 	int  i                  ,j;
+@@ -42,9 +44,32 @@
+ 			xp[i]=reCast<double,IssmDouble>(axp[i]);
+ 		}
+ 
+-		/*Call AD driver: */
++		// get the dimension for the solverx arguments
++		int configuration_type;
++		parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
++		int solveSize=nodes->NumberOfDofs(configuration_type,FsetEnum);
++                int edf_n=solveSize*(solveSize+1), edf_m=solveSize;
++		// get the EDF pointer:
++		ext_diff_fct *anEDF_for_solverx_p=dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p;
++		// set the forward method function pointers
++		anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx;
++                anEDF_for_solverx_p->fov_forward=EDF_fov_forward_for_solverx;
++                // allocate the space for the parameters to invoke the forward methods
++		anEDF_for_solverx_p->dp_x=xNew<double>(edf_n);
++                anEDF_for_solverx_p->dp_X=xNew<double>(edf_n);
++                anEDF_for_solverx_p->dpp_X=xNew<double>(edf_n, num_independents);
++                anEDF_for_solverx_p->dp_y=xNew<double>(edf_m);
++                anEDF_for_solverx_p->dp_Y=xNew<double>(edf_m);
++                anEDF_for_solverx_p->dpp_Y=xNew<double>(edf_m, num_independents);
++		// Call AD driver:
+ 		jacobian(1,num_dependents,num_independents,xp,J);
+-
++		// delete the allocated space for the parameters
++		xDelete(anEDF_for_solverx_p->dp_x);
++                xDelete(anEDF_for_solverx_p->dp_X);
++                xDelete(anEDF_for_solverx_p->dpp_X,edf_n);
++                xDelete(anEDF_for_solverx_p->dp_y);
++                xDelete(anEDF_for_solverx_p->dp_Y);
++                xDelete(anEDF_for_solverx_p->dpp_Y,edf_m);
+ 		/*Add jacobian matrix to results: */
+ 		matJ=xNew<IssmDouble>(num_dependents*num_independents);
+ 		for (i=0;i<num_independents;++i){
Index: /issm/oecreview/Archive/12678-13393/ISSM-13298-13299.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13298-13299.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13298-13299.diff	(revision 13394)
@@ -0,0 +1,19 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13298)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13299)
+@@ -30,10 +30,13 @@
+ 	if(isautodiff){
+ 		#ifdef _HAVE_ADOLC_
+ 		parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
+-		parameters->FindParam(&axp,&num_independents,AutodiffXpEnum);
++		parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum);
+ 		parameters->FindParam(&numberofvertices,MeshNumberofverticesEnum);
+ 
+ 		if(!num_dependents*num_independents) return;
++		
++		/*retrieve state variable: */
++		parameters->FindParam(&axp,&num_independents,AutodiffXpEnum);
+ 
+ 		/*allocate driver results: */
+ 		J=xNew<double*>(num_independents);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13299-13300.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13299-13300.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13299-13300.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13299)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13300)
+@@ -33,7 +33,7 @@
+ 		parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum);
+ 		parameters->FindParam(&numberofvertices,MeshNumberofverticesEnum);
+ 
+-		if(!num_dependents*num_independents) return;
++		if(!(num_dependents*num_independents)) return;
+ 		
+ 		/*retrieve state variable: */
+ 		parameters->FindParam(&axp,&num_independents,AutodiffXpEnum);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13300-13301.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13300-13301.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13300-13301.diff	(revision 13394)
@@ -0,0 +1,74 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13300)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13301)
+@@ -23,6 +23,11 @@
+ 	IssmDouble  *axp  = NULL;
+ 	double     **J    = NULL;
+ 	double      *xp   = NULL;
++		
++	/*diverse: */
++	int configuration_type;
++	int solveSize;
++	int edf_n,edf_m;
+ 
+ 	/*AD mode on?: */
+ 	parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
+@@ -47,32 +52,37 @@
+ 			xp[i]=reCast<double,IssmDouble>(axp[i]);
+ 		}
+ 
+-		// get the dimension for the solverx arguments
+-		int configuration_type;
++		/* get the dimension for the solverx arguments*/
+ 		parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+-		int solveSize=nodes->NumberOfDofs(configuration_type,FsetEnum);
+-                int edf_n=solveSize*(solveSize+1), edf_m=solveSize;
+-		// get the EDF pointer:
++		solveSize=nodes->NumberOfDofs(configuration_type,FsetEnum);
++		edf_n=solveSize*(solveSize+1), edf_m=solveSize;
++
++		/*get the EDF pointer:*/
+ 		ext_diff_fct *anEDF_for_solverx_p=dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p;
+-		// set the forward method function pointers
++		
++		/*set the forward method function pointers: */
+ 		anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx;
+-                anEDF_for_solverx_p->fov_forward=EDF_fov_forward_for_solverx;
+-                // allocate the space for the parameters to invoke the forward methods
++		anEDF_for_solverx_p->fov_forward=EDF_fov_forward_for_solverx;
++
++		/*allocate the space for the parameters to invoke the forward methods:*/
+ 		anEDF_for_solverx_p->dp_x=xNew<double>(edf_n);
+-                anEDF_for_solverx_p->dp_X=xNew<double>(edf_n);
+-                anEDF_for_solverx_p->dpp_X=xNew<double>(edf_n, num_independents);
+-                anEDF_for_solverx_p->dp_y=xNew<double>(edf_m);
+-                anEDF_for_solverx_p->dp_Y=xNew<double>(edf_m);
+-                anEDF_for_solverx_p->dpp_Y=xNew<double>(edf_m, num_independents);
+-		// Call AD driver:
++		anEDF_for_solverx_p->dp_X=xNew<double>(edf_n);
++		anEDF_for_solverx_p->dpp_X=xNew<double>(edf_n, num_independents);
++		anEDF_for_solverx_p->dp_y=xNew<double>(edf_m);
++		anEDF_for_solverx_p->dp_Y=xNew<double>(edf_m);
++		anEDF_for_solverx_p->dpp_Y=xNew<double>(edf_m, num_independents);
++
++		/* Call AD driver:*/
+ 		jacobian(1,num_dependents,num_independents,xp,J);
+-		// delete the allocated space for the parameters
++
++		/* delete the allocated space for the parameters:*/
+ 		xDelete(anEDF_for_solverx_p->dp_x);
+-                xDelete(anEDF_for_solverx_p->dp_X);
+-                xDelete(anEDF_for_solverx_p->dpp_X,edf_n);
+-                xDelete(anEDF_for_solverx_p->dp_y);
+-                xDelete(anEDF_for_solverx_p->dp_Y);
+-                xDelete(anEDF_for_solverx_p->dpp_Y,edf_m);
++		xDelete(anEDF_for_solverx_p->dp_X);
++		xDelete(anEDF_for_solverx_p->dpp_X,edf_n);
++		xDelete(anEDF_for_solverx_p->dp_y);
++		xDelete(anEDF_for_solverx_p->dp_Y);
++		xDelete(anEDF_for_solverx_p->dpp_Y,edf_m);
++		
+ 		/*Add jacobian matrix to results: */
+ 		matJ=xNew<IssmDouble>(num_dependents*num_independents);
+ 		for (i=0;i<num_independents;++i){
Index: /issm/oecreview/Archive/12678-13393/ISSM-13301-13302.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13301-13302.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13301-13302.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/ad.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/ad.m	(revision 13301)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/ad.m	(revision 13302)
+@@ -7,7 +7,6 @@
+ md.autodiff.isautodiff=true;
+ md.autodiff.independents={'Thickness','Surface'};
+ md.autodiff.dependents={'IceVolume'};
+-%md=solve(md,DiagnosticSolutionEnum);
+ md=solve(md,TransientSolutionEnum);
+ 
+ %Fields and tolerances to track changes
Index: /issm/oecreview/Archive/12678-13393/ISSM-13302-13303.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13302-13303.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13302-13303.diff	(revision 13394)
@@ -0,0 +1,80 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismpi.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismpi.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismpi.py	(revision 13303)
+@@ -0,0 +1,37 @@
++import os
++from issmdir import *
++from MatlabFuncs import *
++
++def ismpi():
++	"""
++	ISMPI - figure out if MPI package was compiled with ISSM
++ 
++	   Usage:
++	      flag=ismpi();
++	"""
++
++	configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
++	if not os.path.exists(configfile):
++		raise RuntimeError("File '%s' not found. ISSM has not been configured yet!" % configfile)
++
++	#go through the file, and recover the line we want
++	flag=2
++	try:
++		fid=open(configfile,'r')
++	except IOError as e:
++		raise IOError("could not open file: '%s'" % configfile)
++
++	for tline in fid:
++		if strncmp(tline,'/* #undef _HAVE_MPI_ */',23):
++			flag=0
++			break
++		if  strncmp(tline,'#define _HAVE_MPI_',18):
++			flag=1
++			break
++
++	fid.close()
++	if flag==2:
++		raise RuntimeError("could not determine whether MPI was or was not compiled.")
++
++	return flag
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismpi.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismpi.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/os/ismpi.m	(revision 13303)
+@@ -0,0 +1,33 @@
++function flag=ismpi()
++%ISMPI - figure out if MPI package was compiled with ISSM
++%
++%   Usage:
++%       flag=ismpi();
++
++
++configfile=[issmdir() '/bin/config.h']; %should find it in the install target
++if ~exist(configfile,'file'),
++	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
++end
++
++%go through the file, and recover the line we want
++flag=2;
++fid=fopen(configfile,'r');
++if(fid==-1), error(['could not open file: ' configfile]); end
++
++while(true),
++	tline=fgets(fid);
++	if ~ischar(tline), break, end
++	if strncmp(tline,'/* #undef _HAVE_MPI_ */',23),
++		flag=0;
++		break;
++	end
++	if  strncmp(tline,'#define _HAVE_MPI_',18),
++		flag=1;
++		break;
++	end
++end
++fclose(fid);
++if flag==2,
++	error('could not determine whether MPI was or was not compiled');
++end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13303-13304.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13303-13304.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13303-13304.diff	(revision 13394)
@@ -0,0 +1,50 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 13303)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 13304)
+@@ -67,9 +67,17 @@
+ 				fprintf(fid,'#!/bin/sh\n');
+ 				if ~isvalgrind,
+ 					if cluster.interactive
+-						fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
++						if ismpi,
++							fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
++						else
++							fprintf(fid,'%s/issm.exe %s %s %s ',cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
++						end
+ 					else
+-						fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
++						if ismpi,
++							fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
++						else
++							fprintf(fid,'%s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
++						end
+ 					end
+ 				elseif isgprof,
+ 					fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
+@@ -77,11 +85,21 @@
+ 					%Add --gen-suppressions=all to get suppression lines
+ 					fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+ 					if ismac, 
+-						fprintf(fid,'mpiexec -np %i %s --leak-check=full --dsymutil=yes --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
+-						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname], modelname,modelname,modelname);
++						if ismpi,
++							fprintf(fid,'mpiexec -np %i %s --leak-check=full --dsymutil=yes --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
++							cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname], modelname,modelname,modelname);
++						else
++							fprintf(fid,'%s --leak-check=full --dsymutil=yes --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
++							cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname], modelname,modelname,modelname);
++						end
+ 					else
+-						fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
+-						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
++						if ismpi,
++							fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
++							cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
++						else
++							fprintf(fid,'%s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
++							cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
++						end
+ 					end
+ 				end
+ 				if ~io_gather, %concatenate the output files:
Index: /issm/oecreview/Archive/12678-13393/ISSM-13304-13305.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13304-13305.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13304-13305.diff	(revision 13394)
@@ -0,0 +1,38 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13304)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13305)
+@@ -78,17 +78,28 @@
+ 			fid=open(modelname+'.queue','w')
+ 			fid.write('#!/bin/sh\n')
+ 			if not isvalgrind:
+-				if self.interactive:
+-					fid.write('mpiexec -np %i %s/issm.exe %s %s/%s %s ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname))
++				if self.interactive: 
++					if ismpi():
++						fid.write('mpiexec -np %i %s/issm.exe %s %s/%s %s ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname))
++					else:
++						fid.write('%s/issm.exe %s %s/%s %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname))
+ 				else:
+-					fid.write('mpiexec -np %i %s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
++					if ismpi():
++						fid.write('mpiexec -np %i %s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
++					else:
++						fid.write('%s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % (self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
+ 			elif isgprof:
+ 				fid.write('\n gprof %s/issm.exe gmon.out > %s.performance' % (self.codepath,modelname))
+ 			else:
+ 				#Add --gen-suppressions=all to get suppression lines
+ 				fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
+-				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % \
+-					(self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
++				if ismpi():
++					fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % \
++							(self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
++				else:	
++					fid.write('%s --leak-check=full --suppressions=%s %s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % \
++							(self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
++
+ 			if not io_gather:    #concatenate the output files:
+ 				fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname))
+ 			fid.close()
Index: /issm/oecreview/Archive/12678-13393/ISSM-13305-13306.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13305-13306.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13305-13306.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 13305)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 13306)
+@@ -18,9 +18,10 @@
+ 	char *rootpath       = NULL;
+ 	char *rootpatharg    = NULL;
+ 
++	*solution_type=StringToEnumx(argv[1]);
+ 	if(argc<2)_error_("Usage error: no solution requested");
+-	*solution_type=StringToEnumx(argv[1]);
+-	if(argc<3)_error_("Usage error: missing model name");
++	if(argc<3)_error_("Usage error: missing execution directory");
++	if(argc<4)_error_("Usage error: missing model name");
+ 
+ 	rootpatharg=argv[2];
+ 	if(strcmp(strstr(rootpatharg,"/"),"/")!=0){ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13306-13307.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13306-13307.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13306-13307.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13306)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 13307)
+@@ -5,6 +5,7 @@
+ from EnumToString import EnumToString
+ from issmdir import *
+ from pairoptions import *
++from ismpi import *
+ from issmssh import *
+ from issmscpin import *
+ from issmscpout import *
Index: /issm/oecreview/Archive/12678-13393/ISSM-13307-13308.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13307-13308.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13307-13308.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/yams/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/yams/install.sh	(revision 13307)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/yams/install.sh	(revision 13308)
+@@ -1,5 +1,4 @@
+ #!/bin/bash
+-set -eu
+ 
+ #Some cleanup
+ rm -rf install
Index: /issm/oecreview/Archive/12678-13393/ISSM-13308-13309.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13308-13309.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13308-13309.diff	(revision 13394)
@@ -0,0 +1,73 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh	(revision 13308)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh	(revision 13309)
+@@ -1,37 +0,0 @@
+-#!/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" \
+-	--with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
+-	--with-clanguage=C++ \
+-	--PETSC_ARCH=linux-gnu-amd64 \
+-	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+-	--with-debugging=0 \
+-	--with-shared-libraries=1 \
+-	--download-mumps=yes \
+-	--download-scalapack=yes \
+-	--download-blacs=yes \
+-	--download-blas=yes \
+-	--download-f-blas-lapack=yes \
+-	--download-plapack=yes \
+-	--download-parmetis=yes \
+-	--with-pic=1
+-
+-#Compile petsc and install it
+-make
+-make install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh	(revision 13308)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh	(revision 13309)
+@@ -2,7 +2,7 @@
+ set -eu
+ #Step 1: unzip and install
+ #Step 2: After Plapack implodes
+-STEP=1
++STEP=2
+ 
+ if [ $STEP -eq 1 ]; then
+ 	#Some cleanup
+@@ -25,7 +25,7 @@
+ 		--PETSC_ARCH="$ISSM_ARCH" \
+ 		--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+ 		--with-debugging=0 \
+-		--with-shared-libraries=0 \
++		--with-shared-libraries=1 \
+ 		--with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+ 		--known-mpi-shared-libraries=1 \
+ 		--with-mpi-lib=/nasa/sgi/mpt/1.25/lib/libmpi.so \
+@@ -52,7 +52,7 @@
+ 	 --PETSC_ARCH="$ISSM_ARCH" \
+ 	 --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+ 	 --with-debugging=0 \
+-	 --with-shared-libraries=0 \
++	 --with-shared-libraries=1 \
+ 	 --with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+ 	 --with-mpi-lib=/nasa/sgi/mpt/1.25/lib/libmpi.so \
+ 	 --with-mpi-include=/nasa/sgi/mpt/1.25/include  \
Index: /issm/oecreview/Archive/12678-13393/ISSM-13309-13310.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13309-13310.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13309-13310.diff	(revision 13394)
@@ -0,0 +1,120 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13309)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13310)
+@@ -30,9 +30,9 @@
+ void FetchData(double* pscalar,PyObject* py_float);
+ void FetchData(int* pinteger,PyObject* py_long);
+ void FetchData(bool* pbool,PyObject* py_boolean);
+-void FetchData(BamgGeom** bamggeom,PyObject* py_ref);
+-void FetchData(BamgMesh** bamgmesh,PyObject* py_ref);
+-void FetchData(BamgOpts** bamgopts,PyObject* py_ref);
++void FetchData(BamgGeom** bamggeom,PyObject* py_dict);
++void FetchData(BamgMesh** bamgmesh,PyObject* py_dict);
++void FetchData(BamgOpts** bamgopts,PyObject* py_dict);
+ void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments);
+ 
+ int CheckNumPythonArguments(PyObject* inputs,int NRHS, void (*function)( void ));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13309)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13310)
+@@ -136,19 +136,89 @@
+ 	if(pvector)*pvector=vector;
+ }
+ /*}}}*/
+-/*FUNCTION FetchData(BamgGeom** bamggeom,PyObject* py_ref) {{{*/
+-void FetchData(BamgGeom** bamggeom,PyObject* py_ref){
+-	 _error_("not implemented yet (good luck John!)");
++
++/*ISSM objects*/
++/*FUNCTION FetchData(BamgGeom** pbamggeom,PyObject* py_dict){{{*/
++void FetchData(BamgGeom** pbamggeom,PyObject* py_dict){
++
++	/*Initialize output*/
++	BamgGeom* bamggeom=new BamgGeom();
++
++	/*Fetch all fields*/
++	FetchData(&bamggeom->Vertices,&bamggeom->VerticesSize[0],&bamggeom->VerticesSize[1],PyDict_GetItemString(py_dict,"Vertices"));
++	FetchData(&bamggeom->Edges, &bamggeom->EdgesSize[0], &bamggeom->EdgesSize[1], PyDict_GetItemString(py_dict,"Edges"));
++	FetchData(&bamggeom->Corners, &bamggeom->CornersSize[0], &bamggeom->CornersSize[1], PyDict_GetItemString(py_dict,"Corners"));
++	FetchData(&bamggeom->RequiredVertices,&bamggeom->RequiredVerticesSize[0],&bamggeom->RequiredVerticesSize[1],PyDict_GetItemString(py_dict,"RequiredVertices"));
++	FetchData(&bamggeom->RequiredEdges, &bamggeom->RequiredEdgesSize[0], &bamggeom->RequiredEdgesSize[1], PyDict_GetItemString(py_dict,"RequiredEdges"));
++	FetchData(&bamggeom->CrackedEdges,&bamggeom->CrackedEdgesSize[0],&bamggeom->CrackedEdgesSize[1],PyDict_GetItemString(py_dict,"CrackedEdges"));
++	FetchData(&bamggeom->SubDomains,&bamggeom->SubDomainsSize[0],&bamggeom->SubDomainsSize[1],PyDict_GetItemString(py_dict,"SubDomains"));
++
++	/*Assign output pointers:*/
++	*pbamggeom=bamggeom;
+ }
+ /*}}}*/
+-/*FUNCTION FetchData(BamgMesh** bamggeom,PyObject* py_ref) {{{*/
+-void FetchData(BamgMesh** bamggeom,PyObject* py_ref){
+-	_error_("not implemented yet (good luck John!)");
++/*FUNCTION FetchData(BamgMesh** pbamgmesh,PyObject* py_dict){{{*/
++void FetchData(BamgMesh** pbamgmesh,PyObject* py_dict){
++
++	/*Initialize output*/
++	BamgMesh* bamgmesh=new BamgMesh();
++
++	/*Fetch all fields*/
++	FetchData(&bamgmesh->Vertices,&bamgmesh->VerticesSize[0],&bamgmesh->VerticesSize[1],PyDict_GetItemString(py_dict,"Vertices"));
++	FetchData(&bamgmesh->Edges, &bamgmesh->EdgesSize[0], &bamgmesh->EdgesSize[1], PyDict_GetItemString(py_dict,"Edges"));
++	FetchData(&bamgmesh->Triangles, &bamgmesh->TrianglesSize[0], &bamgmesh->TrianglesSize[1], PyDict_GetItemString(py_dict,"Triangles"));
++	FetchData(&bamgmesh->CrackedEdges,&bamgmesh->CrackedEdgesSize[0],&bamgmesh->CrackedEdgesSize[1],PyDict_GetItemString(py_dict,"CrackedEdges"));
++	FetchData(&bamgmesh->VerticesOnGeomEdge,&bamgmesh->VerticesOnGeomEdgeSize[0],&bamgmesh->VerticesOnGeomEdgeSize[1],PyDict_GetItemString(py_dict,"VerticesOnGeomEdge"));
++	FetchData(&bamgmesh->VerticesOnGeomVertex,&bamgmesh->VerticesOnGeomVertexSize[0],&bamgmesh->VerticesOnGeomVertexSize[1],PyDict_GetItemString(py_dict,"VerticesOnGeomVertex"));
++	FetchData(&bamgmesh->EdgesOnGeomEdge, &bamgmesh->EdgesOnGeomEdgeSize[0], &bamgmesh->EdgesOnGeomEdgeSize[1], PyDict_GetItemString(py_dict,"EdgesOnGeomEdge"));
++	FetchData(&bamgmesh->IssmSegments,&bamgmesh->IssmSegmentsSize[0],&bamgmesh->IssmSegmentsSize[1],PyDict_GetItemString(py_dict,"IssmSegments"));
++
++	/*Assign output pointers:*/
++	*pbamgmesh=bamgmesh;
+ }
+ /*}}}*/
+-/*FUNCTION FetchData(BamgOpts** bamggeom,PyObject* py_ref) {{{*/
+-void FetchData(BamgOpts** bamggeom,PyObject* py_ref){
+-	 _error_("not implemented yet (good luck John!)");
++/*FUNCTION FetchData(BamgOpts** pbamgopts,PyObject* py_dict){{{*/
++void FetchData(BamgOpts** pbamgopts,PyObject* py_dict){
++
++	/*Initialize output*/
++	BamgOpts* bamgopts=new BamgOpts();
++
++	/*Fetch all fields*/
++	FetchData(&bamgopts->anisomax,PyDict_GetItemString(py_dict,"anisomax"));
++	FetchData(&bamgopts->cutoff,PyDict_GetItemString(py_dict,"cutoff"));
++	FetchData(&bamgopts->coeff,PyDict_GetItemString(py_dict,"coeff"));
++	FetchData(&bamgopts->errg,PyDict_GetItemString(py_dict,"errg"));
++	FetchData(&bamgopts->gradation,PyDict_GetItemString(py_dict,"gradation"));
++	FetchData(&bamgopts->Hessiantype,PyDict_GetItemString(py_dict,"Hessiantype"));
++	FetchData(&bamgopts->MaxCornerAngle,PyDict_GetItemString(py_dict,"MaxCornerAngle"));
++	FetchData(&bamgopts->maxnbv,PyDict_GetItemString(py_dict,"maxnbv"));
++	FetchData(&bamgopts->maxsubdiv,PyDict_GetItemString(py_dict,"maxsubdiv"));
++	FetchData(&bamgopts->Metrictype,PyDict_GetItemString(py_dict,"Metrictype"));
++	FetchData(&bamgopts->nbjacobi,PyDict_GetItemString(py_dict,"nbjacobi"));
++	FetchData(&bamgopts->nbsmooth,PyDict_GetItemString(py_dict,"nbsmooth"));
++	FetchData(&bamgopts->omega,PyDict_GetItemString(py_dict,"omega"));
++	FetchData(&bamgopts->power,PyDict_GetItemString(py_dict,"power"));
++	FetchData(&bamgopts->verbose,PyDict_GetItemString(py_dict,"verbose"));
++
++	FetchData(&bamgopts->Crack,PyDict_GetItemString(py_dict,"Crack"));
++	FetchData(&bamgopts->geometricalmetric,PyDict_GetItemString(py_dict,"geometricalmetric"));
++	FetchData(&bamgopts->KeepVertices,PyDict_GetItemString(py_dict,"KeepVertices"));
++	FetchData(&bamgopts->splitcorners,PyDict_GetItemString(py_dict,"splitcorners"));
++
++	FetchData(&bamgopts->hmin,PyDict_GetItemString(py_dict,"hmin"));
++	FetchData(&bamgopts->hmax,PyDict_GetItemString(py_dict,"hmax"));
++	FetchData(&bamgopts->hminVertices,&bamgopts->hminVerticesSize[0],&bamgopts->hminVerticesSize[1],PyDict_GetItemString(py_dict,"hminVertices"));
++	FetchData(&bamgopts->hmaxVertices,&bamgopts->hmaxVerticesSize[0],&bamgopts->hmaxVerticesSize[1],PyDict_GetItemString(py_dict,"hmaxVertices"));
++	FetchData(&bamgopts->hVertices,&bamgopts->hVerticesSize[0],&bamgopts->hVerticesSize[1],PyDict_GetItemString(py_dict,"hVertices"));
++	FetchData(&bamgopts->metric,&bamgopts->metricSize[0],&bamgopts->metricSize[1],PyDict_GetItemString(py_dict,"metric"));
++	FetchData(&bamgopts->field,&bamgopts->fieldSize[0],&bamgopts->fieldSize[1],PyDict_GetItemString(py_dict,"field"));
++	FetchData(&bamgopts->err,&bamgopts->errSize[0],&bamgopts->errSize[1],PyDict_GetItemString(py_dict,"err"));
++
++	/*Additional checks*/
++	bamgopts->Check();
++
++	/*Assign output pointers:*/
++	*pbamgopts=bamgopts;
+ }
+ /*}}}*/
+ /*FUNCTION FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments){{{*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-13310-13311.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13310-13311.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13310-13311.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 13310)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 13311)
+@@ -135,9 +135,9 @@
+ 			 if cluster.interactive,
+ 				 fid=fopen([modelname '.run'],'w');
+ 				 if ~isvalgrind,
+-					 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
++					 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/Interactive' num2str(cluster.interactive)],modelname);
+ 				 else
+-					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
++					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/Interactive' num2str(cluster.interactive)],modelname);
+ 				 end
+ 				 if ~io_gather, %concatenate the output files:
+ 					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13311-13312.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13311-13312.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13311-13312.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h	(revision 13311)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h	(revision 13312)
+@@ -70,7 +70,7 @@
+ }
+ 
+ template <class T>
+-void xDelete(T**& aT_pp, unsigned int dim1) {
++void xDelete(T**& aT_pp) {
+   if (aT_pp) {
+ #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
+     delete [](*aT_pp);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13312-13313.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13312-13313.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13312-13313.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13312)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13313)
+@@ -157,6 +157,11 @@
+ }
+ /*}}}*/
+ 
++int EDF_fos_reverse_for_solverx(int m, double *dp_U, int n, double *dp_Z) { /*{{{*/
++  return 0;
++}
++/*}}}*/
++
+ void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
+ 	// pack inputs to conform to the EDF-prescribed interface
+         IssmDouble*  adoubleEDFin=xNew<IssmDouble>(n*(n+1));  // packed inputs, i.e. matrix and right hand side
Index: /issm/oecreview/Archive/12678-13393/ISSM-13313-13314.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13313-13314.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13313-13314.diff	(revision 13394)
@@ -0,0 +1,155 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13313)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13314)
+@@ -11,59 +11,41 @@
+ 
+ 
+ void AutodiffDriversx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,Results* results){
+-
+-	int  i                  ,j;
+ 	bool isautodiff       = false;
+-	int  num_dependents;
+-	int  num_independents;
+-	int  numberofvertices;
+-
+-	/*outputs: */
+-	IssmDouble  *matJ = NULL;
+-	IssmDouble  *axp  = NULL;
+-	double     **J    = NULL;
+-	double      *xp   = NULL;
+-		
+-	/*diverse: */
+-	int configuration_type;
+-	int solveSize;
+-	int edf_n,edf_m;
+-
+ 	/*AD mode on?: */
+ 	parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
+-
+ 	if(isautodiff){
+-		#ifdef _HAVE_ADOLC_
+-		parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
+-		parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum);
+-		parameters->FindParam(&numberofvertices,MeshNumberofverticesEnum);
+-
+-		if(!(num_dependents*num_independents)) return;
+-		
++                #ifdef _HAVE_ADOLC_
++	        int  num_dependents;
++                parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
++	        int  num_independents;
++                parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum);
++                if(!(num_dependents*num_independents)) return;
++	        int  numberofvertices;
++                parameters->FindParam(&numberofvertices,MeshNumberofverticesEnum);
+ 		/*retrieve state variable: */
++                IssmDouble  *axp  = NULL;
+ 		parameters->FindParam(&axp,&num_independents,AutodiffXpEnum);
+-
+-		/*allocate driver results: */
+-		J=xNew<double*>(num_independents);
+-		xp=xNew<double>(num_independents); 
+-
+-		for(i=0;i<num_independents;i++){
+-			J[i]=xNew<double>(num_dependents);
++		/* driver argument */
++		double *xp=xNew<double>(num_independents);
++		for(int i=0;i<num_independents;i++){
+ 			xp[i]=reCast<double,IssmDouble>(axp[i]);
+ 		}
+-
+ 		/* get the dimension for the solverx arguments*/
++                int configuration_type;
+ 		parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+-		solveSize=nodes->NumberOfDofs(configuration_type,FsetEnum);
+-		edf_n=solveSize*(solveSize+1), edf_m=solveSize;
++		int solveSize=nodes->NumberOfDofs(configuration_type,FsetEnum);
++		int edf_n=solveSize*(solveSize+1), edf_m=solveSize;
+ 
+ 		/*get the EDF pointer:*/
+ 		ext_diff_fct *anEDF_for_solverx_p=dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p;
+ 		
+ 		/*set the forward method function pointers: */
++		anEDF_for_solverx_p->zos_forward=EDF_for_solverx;
+ 		anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx;
+ 		anEDF_for_solverx_p->fov_forward=EDF_fov_forward_for_solverx;
+-
++                anEDF_for_solverx_p->fos_reverse=EDF_fos_reverse_for_solverx;
++                // anEDF_for_solverx_p->fov_reverse=EDF_fov_reverse_for_solverx;
+ 		/*allocate the space for the parameters to invoke the forward methods:*/
+ 		anEDF_for_solverx_p->dp_x=xNew<double>(edf_n);
+ 		anEDF_for_solverx_p->dp_X=xNew<double>(edf_n);
+@@ -71,33 +53,49 @@
+ 		anEDF_for_solverx_p->dp_y=xNew<double>(edf_m);
+ 		anEDF_for_solverx_p->dp_Y=xNew<double>(edf_m);
+ 		anEDF_for_solverx_p->dpp_Y=xNew<double>(edf_m, num_independents);
++		anEDF_for_solverx_p->dp_U=xNew<double>(edf_m);
++		anEDF_for_solverx_p->dpp_U=xNew<double>(num_dependents,edf_m);
++                anEDF_for_solverx_p->dp_Z=xNew<double>(edf_n);
++                anEDF_for_solverx_p->dpp_Z=xNew<double>(num_dependents,edf_n);
++		/* Call AD driver:*/
++                // single direction:
++                double *tangentDir=xNewZeroInit<double>(num_independents);
++                unsigned int anIndepNum=55; // <---------- make this selectable via config
++                tangentDir[anIndepNum]=1.0;
++                double *theJacVecProduct=xNew<double>(num_dependents);
++                double *theOutput=xNew<double>(num_dependents);
++                if (fos_forward(1,num_dependents,num_independents, 0, xp, tangentDir, theOutput, theJacVecProduct ))
++                  _error_("fos_forward returned non-zero error code");
++                IssmDouble *theJacVecProductA=xNew<IssmDouble>(num_dependents);
++                for (int i=0;i<num_dependents;++i)
++                  theJacVecProductA[i]=theJacVecProduct[i];
++                results->AddObject(new DoubleVecExternalResult(results->Size()+1,AutodiffJacobianEnum,theJacVecProductA,num_dependents,1,0.0));
+ 
+-		/* Call AD driver:*/
++#if 0
++                double **J=xNew<double>(num_dependents,num_independents);
+ 		jacobian(1,num_dependents,num_independents,xp,J);
++		IssmDouble *matJ=xNew<IssmDouble>(num_dependents*num_independents);
++                for (int i=0;i<num_dependents*num_independents;++i)
++                  matJ[i]=J[i];
++                results->AddObject(new DoubleMatExternalResult(results->Size()+1,AutodiffJacobianEnum,matJ,num_independents,num_dependents,1,0.0));
++                xDelete(matJ);
++                xDelete(J);
++#endif
+ 
+-		/* delete the allocated space for the parameters:*/
+-		xDelete(anEDF_for_solverx_p->dp_x);
+-		xDelete(anEDF_for_solverx_p->dp_X);
+-		xDelete(anEDF_for_solverx_p->dpp_X,edf_n);
+-		xDelete(anEDF_for_solverx_p->dp_y);
+-		xDelete(anEDF_for_solverx_p->dp_Y);
+-		xDelete(anEDF_for_solverx_p->dpp_Y,edf_m);
+-		
+-		/*Add jacobian matrix to results: */
+-		matJ=xNew<IssmDouble>(num_dependents*num_independents);
+-		for (i=0;i<num_independents;++i){
+-			double* rowi=J[i];
+-			for (j=0;j<num_dependents;++j){
+-				*(matJ+num_dependents*i+j)=rowi[j];
+-			}
+-		}
+-		results->AddObject(new DoubleMatExternalResult(results->Size()+1,AutodiffJacobianEnum,matJ,num_independents,num_dependents,1,0.0));
+-
++                /* delete the allocated space for the parameters:*/
++                xDelete(anEDF_for_solverx_p->dp_x);
++                xDelete(anEDF_for_solverx_p->dp_X);
++                xDelete(anEDF_for_solverx_p->dpp_X);
++                xDelete(anEDF_for_solverx_p->dp_y);
++                xDelete(anEDF_for_solverx_p->dp_Y);
++                xDelete(anEDF_for_solverx_p->dpp_Y);
++                xDelete(anEDF_for_solverx_p->dp_U);
++                xDelete(anEDF_for_solverx_p->dpp_U);
++                xDelete(anEDF_for_solverx_p->dp_Z);
++                xDelete(anEDF_for_solverx_p->dpp_Z);
+ 		/*Free ressources: */
+-		xDelete<double*>(J);
+-		xDelete<double>(xp);
+-		xDelete<IssmDouble>(matJ);
+-		xDelete<IssmDouble>(axp);
++		xDelete(xp);
++		xDelete(axp); // did we allocate this?
+ 		#else
+ 		_error_("Should not be requesting AD drivers when an AD library is not available!");
+ 		#endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-13314-13315.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13314-13315.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13314-13315.diff	(revision 13394)
@@ -0,0 +1,34 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 13314)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Node.cpp	(revision 13315)
+@@ -206,17 +206,15 @@
+ /*FUNCTION Node::Configure {{{*/
+ void  Node::Configure(DataSet* nodesin,Vertices* verticesin){
+ 
+-	int i;
+-
+ 	/*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 off_sets hidden in hooks: */
+ 	hvertex->configure(verticesin);
+ 
+-}
++}/*}}}*/
+ /*FUNCTION Node::SetCurrentConfiguration {{{*/
+ void  Node::SetCurrentConfiguration(DataSet* nodesin,Vertices* verticesin){
+ 
+-}
++}/*}}}*/
+ /*FUNCTION Node::GetDof {{{*/
+ int   Node::GetDof(int dofindex,int setenum){
+ 
+@@ -234,8 +232,7 @@
+ 	}
+ 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 
+-}
+-/*}}}*/
++} /*}}}*/
+ /*FUNCTION Node::GetDofList1{{{*/
+ int  Node::GetDofList1(void){
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13315-13316.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13315-13316.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13315-13316.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 13315)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 13316)
+@@ -46,6 +46,8 @@
+ 		if (num_procs>1){
+ 			#ifdef _HAVE_METIS_
+ 			METIS_PartMeshNodalPatch(&numberofelements,&numberofnodes, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
++			#else
++			_error_("metis has not beed installed. Cannot run with more than 1 cpu");
+ 			#endif
+ 		}
+ 		else if (num_procs==1){
Index: /issm/oecreview/Archive/12678-13393/ISSM-13316-13317.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13316-13317.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13316-13317.diff	(revision 13394)
@@ -0,0 +1,18 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 13316)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 13317)
+@@ -75,6 +75,8 @@
+ 		if (num_procs>1){
+ 			#ifdef _HAVE_METIS_
+ 			METIS_PartMeshNodalPatch(&numberofelements2d,&numberofnodes2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
++			#else
++			_error_("metis has not beed installed. Cannot run with more than 1 cpu");
+ 			#endif
+ 		}
+ 		else if (num_procs==1){
+@@ -119,4 +121,3 @@
+ 	return noerr;
+ }	
+ #endif /* _MESHPARTITIONX_H */
+-
Index: /issm/oecreview/Archive/12678-13393/ISSM-13317-13318.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13317-13318.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13317-13318.diff	(revision 13394)
@@ -0,0 +1,132 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13317)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13318)
+@@ -18,6 +18,7 @@
+ 	AutodiffNumIndependentsEnum,
+ 	AutodiffJacobianEnum,
+ 	AutodiffXpEnum,
++	AutodiffFosForwardOutputEnum,
+ 	BalancethicknessSpcthicknessEnum,
+ 	BalancethicknessStabilizationEnum,
+ 	BalancethicknessThickeningRateEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13317)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13318)
+@@ -24,6 +24,7 @@
+ 	      else if (strcmp(name,"AutodiffNumIndependents")==0) return AutodiffNumIndependentsEnum;
+ 	      else if (strcmp(name,"AutodiffJacobian")==0) return AutodiffJacobianEnum;
+ 	      else if (strcmp(name,"AutodiffXp")==0) return AutodiffXpEnum;
++	      else if (strcmp(name,"AutodiffFosForwardOutput")==0) return AutodiffFosForwardOutputEnum;
+ 	      else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum;
+ 	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
+ 	      else if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
+@@ -136,11 +137,11 @@
+ 	      else if (strcmp(name,"MeshNumberofvertices")==0) return MeshNumberofverticesEnum;
+ 	      else if (strcmp(name,"MeshUpperelements")==0) return MeshUpperelementsEnum;
+ 	      else if (strcmp(name,"MeshVertexonbed")==0) return MeshVertexonbedEnum;
+-	      else if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
+          else stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"MeshX")==0) return MeshXEnum;
++	      if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
++	      else if (strcmp(name,"MeshX")==0) return MeshXEnum;
+ 	      else if (strcmp(name,"MeshY")==0) return MeshYEnum;
+ 	      else if (strcmp(name,"MeshZ")==0) return MeshZEnum;
+ 	      else if (strcmp(name,"MiscellaneousName")==0) return MiscellaneousNameEnum;
+@@ -259,11 +260,11 @@
+ 	      else if (strcmp(name,"Constraints")==0) return ConstraintsEnum;
+ 	      else if (strcmp(name,"Loads")==0) return LoadsEnum;
+ 	      else if (strcmp(name,"Materials")==0) return MaterialsEnum;
+-	      else if (strcmp(name,"Nodes")==0) return NodesEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"Parameters")==0) return ParametersEnum;
++	      if (strcmp(name,"Nodes")==0) return NodesEnum;
++	      else if (strcmp(name,"Parameters")==0) return ParametersEnum;
+ 	      else if (strcmp(name,"Vertices")==0) return VerticesEnum;
+ 	      else if (strcmp(name,"Results")==0) return ResultsEnum;
+ 	      else if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
+@@ -382,11 +383,11 @@
+ 	      else if (strcmp(name,"VyPicard")==0) return VyPicardEnum;
+ 	      else if (strcmp(name,"Vz")==0) return VzEnum;
+ 	      else if (strcmp(name,"VzMacAyeal")==0) return VzMacAyealEnum;
+-	      else if (strcmp(name,"VzPattyn")==0) return VzPattynEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"VzPicard")==0) return VzPicardEnum;
++	      if (strcmp(name,"VzPattyn")==0) return VzPattynEnum;
++	      else if (strcmp(name,"VzPicard")==0) return VzPicardEnum;
+ 	      else if (strcmp(name,"VzStokes")==0) return VzStokesEnum;
+ 	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+ 	      else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13317)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13318)
+@@ -23,6 +23,7 @@
+ 		case AutodiffNumIndependentsEnum : return "AutodiffNumIndependents";
+ 		case AutodiffJacobianEnum : return "AutodiffJacobian";
+ 		case AutodiffXpEnum : return "AutodiffXp";
++		case AutodiffFosForwardOutputEnum : return "AutodiffFosForwardOutput";
+ 		case BalancethicknessSpcthicknessEnum : return "BalancethicknessSpcthickness";
+ 		case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization";
+ 		case BalancethicknessThickeningRateEnum : return "BalancethicknessThickeningRate";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffFosForwardOutputEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffFosForwardOutputEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/AutodiffFosForwardOutputEnum.m	(revision 13318)
+@@ -0,0 +1,11 @@
++function macro=AutodiffFosForwardOutputEnum()
++%AUTODIFFFOSFORWARDOUTPUTENUM - Enum of AutodiffFosForwardOutput
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=AutodiffFosForwardOutputEnum()
++
++macro=StringToEnum('AutodiffFosForwardOutput');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13317)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13318)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=472;
++macro=473;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13317)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13318)
+@@ -78,6 +78,16 @@
+ 
+ 	return StringToEnum('AutodiffXp')[0]
+ 
++def AutodiffFosForwardOutputEnum():
++	"""
++	AUTODIFFFOSFORWARDOUTPUTENUM - Enum of AutodiffFosForwardOutput
++
++	   Usage:
++	      macro=AutodiffFosForwardOutputEnum()
++	"""
++
++	return StringToEnum('AutodiffFosForwardOutput')[0]
++
+ def BalancethicknessSpcthicknessEnum():
+ 	"""
+ 	BALANCETHICKNESSSPCTHICKNESSENUM - Enum of BalancethicknessSpcthickness
+@@ -4736,5 +4746,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 472
++	return 473
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13318-13319.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13318-13319.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13318-13319.diff	(revision 13394)
@@ -0,0 +1,214 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 13318)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 13319)
+@@ -1,149 +0,0 @@
+-/*!\file PetscVecExternalResult.c
+- * \brief: implementation of the PetscVecExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../shared/shared.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*PetscVecExternalResult constructors and destructor*/
+-/*FUNCTION PetscVecExternalResult::PetscVecExternalResult(){{{*/
+-PetscVecExternalResult::PetscVecExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::PetscVecExternalResult(int enum_type,IssmPetscVec value){{{*/
+-PetscVecExternalResult::PetscVecExternalResult(int in_id, int in_enum_type,Vector* in_value,int in_step, IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-
+-	value=NULL;
+-
+-	if(in_value){
+-		value=in_value->Duplicate();
+-		in_value->Copy(value);
+-	}
+-	else value=NULL;
+-
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::~PetscVecExternalResult(){{{*/
+-PetscVecExternalResult::~PetscVecExternalResult(){
+-	VecFree(&value);
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION PetscVecExternalResult::Echo {{{*/
+-void PetscVecExternalResult::Echo(void){
+-
+-	_printLine_("PetscVecExternalResult:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::DeepEcho{{{*/
+-void PetscVecExternalResult::DeepEcho(void){
+-
+-	int i;
+-	_printLine_("PetscVecExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-	VecView(value,PETSC_VIEWER_STDOUT_WORLD);
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::Id{{{*/
+-int    PetscVecExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::MyRank{{{*/
+-int    PetscVecExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::ObjectEnum{{{*/
+-int PetscVecExternalResult::ObjectEnum(void){
+-
+-	return PetscVecExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::copy{{{*/
+-Object* PetscVecExternalResult::copy() {
+-	
+-	return new PetscVecExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*PetscVecExternalResult management: */
+-/*FUNCTION PetscVecExternalResult::WriteData{{{*/
+-void   PetscVecExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     size;
+-	char   *name      = NULL;
+-	IssmPDouble *serialvec = NULL;
+-	extern int my_rank;
+-	IssmPDouble passiveDouble;
+-
+-	/*serialize: */
+-	VecGetSize(this->value,&size);
+-	VecToMPISerial(&serialvec,this->value);
+-
+-	/*now, exit if we are not on cpu 0: */
+-	if(my_rank)return;
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-        passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmDouble, type is 1, size is 1: */
+-	type=1;
+-	
+-	fwrite(&type,sizeof(int),1,fid);
+-	fwrite(&size,sizeof(int),1,fid);
+-	fwrite(serialvec,size*sizeof(IssmPDouble),1,fid);
+-
+-	/*Free ressources:*/
+-	xDelete<IssmPDouble>(serialvec);
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::GetResultName{{{*/
+-void PetscVecExternalResult::GetResultName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION PetscVecExternalResult::GetStep{{{*/
+-int PetscVecExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h	(revision 13318)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h	(revision 13319)
+@@ -1,55 +0,0 @@
+-/*! \file PetscVecExternalResult.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _PETSCVECEXTERNALRESULT_H_
+-#define _PETSCVECEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../../include/include.h"
+-#include "../../../shared/shared.h"
+-#include "../../../include/include.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-class PetscVecExternalResult: public ExternalResult{
+-
+-	private: 
+-		int id;
+-		int enum_type;
+-		Vector<IssmDouble>* value;
+-		int step;
+-		IssmDouble time;
+-
+-	public:
+-		/*PetscVecExternalResult constructors, destructors: {{{*/
+-		PetscVecExternalResult();
+-		PetscVecExternalResult(int id,int enum_type,Vector<IssmDouble>* value, int step, IssmDouble time);
+-		~PetscVecExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult management: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _PETSCVECEXTERNALRESULT_H */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13319-13320.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13319-13320.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13319-13320.diff	(revision 13394)
@@ -0,0 +1,26 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13319)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13320)
+@@ -74,6 +74,10 @@
+ int EDF_fos_forward_for_solverx(int n, IssmPDouble *inVal, IssmPDouble *inDeriv, int m, IssmPDouble *outVal, IssmPDouble *outDeriv) { /*{{{*/
+ #ifdef _HAVE_GSL_
+   // the matrix will be modified by LU decomposition. Use gsl_A copy
++  for (int i=0; i<m*m; ++i)
++    std::cout << "EDF_fos_forward_for_solverx A["<< i << "]=" << inVal[i] << std::endl;
++  for (int i=0; i<m; ++i)
++    std::cout << "EDF_fos_forward_for_solverx b["<< i << "]=" << inVal[i+m*m] << std::endl;
+   double* Acopy = xNew<double>(m*m);
+   xMemCpy(Acopy,inVal,m*m);
+   /*Initialize gsl matrices and vectors: */
+@@ -188,6 +192,10 @@
+ 	gsl_vector      *x = NULL;
+ 	gsl_permutation *p = NULL;
+ 	/*A will be modified by LU decomposition. Use copy*/
++	for (int i=0; i<n*n; ++i)
++	  std::cout << "SolverxSeq A["<< i << "]=" << A[i] << std::endl;
++	for (int i=0; i<n; ++i)
++	  std::cout << "SolverxSeq b["<< i << "]=" << B[i] << std::endl;
+ 	double* Acopy = xNew<double>(n*n);
+ 	xMemCpy(Acopy,A,n*n);
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13320-13321.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13320-13321.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13320-13321.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 13320)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 13321)
+@@ -97,7 +97,6 @@
+ #include "./ExternalResults/DoubleVecExternalResult.h"
+ #include "./ExternalResults/DoubleMatExternalResult.h"
+ #include "./ExternalResults/IntExternalResult.h"
+-#include "./ExternalResults/PetscVecExternalResult.h"
+ #include "./ExternalResults/StringExternalResult.h"
+ 
+ /*Materials: */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13321-13322.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13321-13322.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13321-13322.diff	(revision 13394)
@@ -0,0 +1,80 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 13321)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 13322)
+@@ -131,6 +131,7 @@
+ 	fnames[i++] = "Vertices";
+ 	fnames[i++] = "Edges";
+ 	fnames[i++] = "TangentAtEdges";
++	fnames[i++] = "Corners";
+ 	fnames[i++] = "RequiredVertices";
+ 	fnames[i++] = "RequiredEdges";
+ 	fnames[i++] = "CrackedEdges";
+@@ -145,6 +146,7 @@
+ 	i++; SetStructureField(dataref,"Vertices",        bamggeom->VerticesSize[0],        bamggeom->VerticesSize[1],        bamggeom->Vertices);
+ 	i++; SetStructureField(dataref,"Edges",           bamggeom->EdgesSize[0],           bamggeom->EdgesSize[1],           bamggeom->Edges);
+ 	i++; SetStructureField(dataref,"TangentAtEdges",  bamggeom->TangentAtEdgesSize[0],  bamggeom->TangentAtEdgesSize[1],  bamggeom->TangentAtEdges);
++	i++; SetStructureField(dataref,"Corners",         bamggeom->CornersSize[0],         bamggeom->CornersSize[1],         bamggeom->Corners);
+ 	i++; SetStructureField(dataref,"RequiredVertices",bamggeom->RequiredVerticesSize[0],bamggeom->RequiredVerticesSize[1],bamggeom->RequiredVertices);
+ 	i++; SetStructureField(dataref,"RequiredEdges",   bamggeom->RequiredEdgesSize[0],   bamggeom->RequiredEdgesSize[1],   bamggeom->RequiredEdges);
+ 	i++; SetStructureField(dataref,"CrackedEdges",    bamggeom->CrackedEdgesSize[0],    bamggeom->CrackedEdgesSize[1],    bamggeom->CrackedEdges);
+@@ -168,12 +170,12 @@
+ 
+ 	/*Initialize field names*/
+ 	i=0;
+-	fnames[i++] = "Triangles";
+ 	fnames[i++] = "Vertices";
+ 	fnames[i++] = "Edges";
++	fnames[i++] = "Triangles";
++	fnames[i++] = "Quadrilaterals";
++	fnames[i++] = "IssmEdges";
+ 	fnames[i++] = "IssmSegments";
+-	fnames[i++] = "IssmEdges";
+-	fnames[i++] = "Quadrilaterals";
+ 	fnames[i++] = "VerticesOnGeomVertex";
+ 	fnames[i++] = "VerticesOnGeomEdge";
+ 	fnames[i++] = "EdgesOnGeomEdge";
+@@ -191,12 +193,12 @@
+ 
+ 	/*set each matlab each field*/
+ 	i=0;
+-	i++; SetStructureField(dataref,"Triangles", bamgmesh->TrianglesSize[0],bamgmesh->TrianglesSize[1], bamgmesh->Triangles);
+ 	i++; SetStructureField(dataref,"Vertices",bamgmesh->VerticesSize[0], bamgmesh->VerticesSize[1],bamgmesh->Vertices);
+ 	i++; SetStructureField(dataref,"Edges", bamgmesh->EdgesSize[0],bamgmesh->EdgesSize[1], bamgmesh->Edges);
++	i++; SetStructureField(dataref,"Triangles", bamgmesh->TrianglesSize[0],bamgmesh->TrianglesSize[1], bamgmesh->Triangles);
++	i++; SetStructureField(dataref,"Quadrilaterals",bamgmesh->QuadrilateralsSize[0], bamgmesh->QuadrilateralsSize[1],bamgmesh->Quadrilaterals);
++	i++; SetStructureField(dataref,"IssmEdges", bamgmesh->IssmEdgesSize[0],bamgmesh->IssmEdgesSize[1], bamgmesh->IssmEdges);
+ 	i++; SetStructureField(dataref,"IssmSegments",bamgmesh->IssmSegmentsSize[0], bamgmesh->IssmSegmentsSize[1],bamgmesh->IssmSegments);
+-	i++; SetStructureField(dataref,"IssmEdges", bamgmesh->IssmEdgesSize[0],bamgmesh->IssmEdgesSize[1], bamgmesh->IssmEdges);
+-	i++; SetStructureField(dataref,"Quadrilaterals",bamgmesh->QuadrilateralsSize[0], bamgmesh->QuadrilateralsSize[1],bamgmesh->Quadrilaterals);
+ 	i++; SetStructureField(dataref,"VerticesOnGeomVertex",bamgmesh->VerticesOnGeomVertexSize[0],bamgmesh->VerticesOnGeomVertexSize[1], bamgmesh->VerticesOnGeomVertex);
+ 	i++; SetStructureField(dataref,"VerticesOnGeomEdge",bamgmesh->VerticesOnGeomEdgeSize[0],bamgmesh->VerticesOnGeomEdgeSize[1], bamgmesh->VerticesOnGeomEdge);
+ 	i++; SetStructureField(dataref,"EdgesOnGeomEdge", bamgmesh->EdgesOnGeomEdgeSize[0], bamgmesh->EdgesOnGeomEdgeSize[1],bamgmesh->EdgesOnGeomEdge);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13321)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/WritePythonData.cpp	(revision 13322)
+@@ -57,6 +57,7 @@
+ 	PyDict_SetItemString(dict,"Vertices",PyArrayFromCopiedData(bamggeom->VerticesSize,bamggeom->Vertices));
+ 	PyDict_SetItemString(dict,"Edges",PyArrayFromCopiedData(bamggeom->EdgesSize,bamggeom->Edges));
+ 	PyDict_SetItemString(dict,"TangentAtEdges",PyArrayFromCopiedData(bamggeom->TangentAtEdgesSize,bamggeom->TangentAtEdges));
++	PyDict_SetItemString(dict,"Corners",PyArrayFromCopiedData(bamggeom->CornersSize,bamggeom->Corners));
+ 	PyDict_SetItemString(dict,"RequiredVertices",PyArrayFromCopiedData(bamggeom->RequiredVerticesSize,bamggeom->RequiredVertices));
+ 	PyDict_SetItemString(dict,"RequiredEdges",PyArrayFromCopiedData(bamggeom->RequiredEdgesSize,bamggeom->RequiredEdges));
+ 	PyDict_SetItemString(dict,"CrackedEdges",PyArrayFromCopiedData(bamggeom->CrackedEdgesSize,bamggeom->CrackedEdges));
+@@ -72,12 +73,12 @@
+ 
+ 	dict=PyDict_New();
+ 
+-	PyDict_SetItemString(dict,"Triangles",PyArrayFromCopiedData(bamgmesh->TrianglesSize,bamgmesh->Triangles));
+ 	PyDict_SetItemString(dict,"Vertices",PyArrayFromCopiedData(bamgmesh->VerticesSize,bamgmesh->Vertices));
+ 	PyDict_SetItemString(dict,"Edges",PyArrayFromCopiedData(bamgmesh->EdgesSize,bamgmesh->Edges));
++	PyDict_SetItemString(dict,"Triangles",PyArrayFromCopiedData(bamgmesh->TrianglesSize,bamgmesh->Triangles));
++	PyDict_SetItemString(dict,"Quadrilaterals",PyArrayFromCopiedData(bamgmesh->QuadrilateralsSize,bamgmesh->Quadrilaterals));
++	PyDict_SetItemString(dict,"IssmEdges",PyArrayFromCopiedData(bamgmesh->IssmEdgesSize,bamgmesh->IssmEdges));
+ 	PyDict_SetItemString(dict,"IssmSegments",PyArrayFromCopiedData(bamgmesh->IssmSegmentsSize,bamgmesh->IssmSegments));
+-	PyDict_SetItemString(dict,"IssmEdges",PyArrayFromCopiedData(bamgmesh->IssmEdgesSize,bamgmesh->IssmEdges));
+-	PyDict_SetItemString(dict,"Quadrilaterals",PyArrayFromCopiedData(bamgmesh->QuadrilateralsSize,bamgmesh->Quadrilaterals));
+ 	PyDict_SetItemString(dict,"VerticesOnGeomVertex",PyArrayFromCopiedData(bamgmesh->VerticesOnGeomVertexSize,bamgmesh->VerticesOnGeomVertex));
+ 	PyDict_SetItemString(dict,"VerticesOnGeomEdge",PyArrayFromCopiedData(bamgmesh->VerticesOnGeomEdgeSize,bamgmesh->VerticesOnGeomEdge));
+ 	PyDict_SetItemString(dict,"EdgesOnGeomEdge",PyArrayFromCopiedData(bamgmesh->EdgesOnGeomEdgeSize,bamgmesh->EdgesOnGeomEdge));
Index: /issm/oecreview/Archive/12678-13393/ISSM-13322-13323.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13322-13323.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13322-13323.diff	(revision 13394)
@@ -0,0 +1,52 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 13322)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 13323)
+@@ -45,7 +45,7 @@
+ /*}}}*/
+ /*FUNCTION TransientInput::~TransientInput{{{*/
+ TransientInput::~TransientInput(){
+-	xDelete<IssmDouble>(this->timesteps);
++	xDelete(this->timesteps);
+ 	this->timesteps=NULL;
+ 	this->numtimesteps=0;
+ 	parameters=NULL;
+@@ -100,7 +100,7 @@
+ 	output->enum_type=this->enum_type;
+ 	output->numtimesteps=this->numtimesteps;
+ 	output->timesteps=xNew<IssmDouble>(this->numtimesteps);
+-   memcpy(output->timesteps,this->timesteps,this->numtimesteps*sizeof(IssmDouble));
++        xMemCpy(output->timesteps,this->timesteps,this->numtimesteps);
+ 	output->inputs=(Inputs*)this->inputs->Copy();
+ 	output->parameters=this->parameters;
+ 
+@@ -128,7 +128,7 @@
+ 	outinput->enum_type=this->enum_type;
+ 	outinput->numtimesteps=this->numtimesteps;
+ 	outinput->timesteps=xNew<IssmDouble>(this->numtimesteps);
+-	memcpy(outinput->timesteps,this->timesteps,this->numtimesteps*sizeof(IssmDouble));
++	xMemCpy(outinput->timesteps,this->timesteps,this->numtimesteps);
+ 	outinput->inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices);
+ 	outinput->parameters=this->parameters;
+ 
+@@ -265,16 +265,16 @@
+ 
+ 	if (this->numtimesteps > 0){
+ 		old_timesteps=xNew<IssmDouble>(this->numtimesteps);
+-		memcpy(old_timesteps,this->timesteps,this->numtimesteps*sizeof(IssmDouble));
+-		xDelete<IssmDouble>(this->timesteps); 
++		xMemCpy(old_timesteps,this->timesteps,this->numtimesteps);
++		xDelete(this->timesteps);
+ 	}
+ 
+ 	this->numtimesteps=this->numtimesteps+1;
+ 	this->timesteps=xNew<IssmDouble>(this->numtimesteps);
+ 
+ 	if (this->numtimesteps > 1){
+-		memcpy(this->timesteps,old_timesteps,(this->numtimesteps-1)*sizeof(IssmDouble));
+-		xDelete<IssmDouble>(old_timesteps);
++		xMemCpy(this->timesteps,old_timesteps,this->numtimesteps-1);
++		xDelete(old_timesteps);
+ 	}
+ 
+ 	/*go ahead and plug: */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13323-13324.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13323-13324.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13323-13324.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 13323)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp	(revision 13324)
+@@ -121,7 +121,7 @@
+ 	/*Intermediary*/
+ 	int         i;
+ 	mxArray    *dataref           = NULL;
+-	const int   numfields         = 7;
++	const int   numfields         = 8;
+ 	const char *fnames[numfields];
+ 	mwSize      ndim              = 2;
+ 	mwSize      dimensions[2]     = {1,1};
Index: /issm/oecreview/Archive/12678-13393/ISSM-13324-13325.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13324-13325.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13324-13325.diff	(revision 13394)
@@ -0,0 +1,1904 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/ad.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/ad.m	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/ad.m	(revision 13325)
+@@ -7,7 +7,8 @@
+ md.autodiff.isautodiff=true;
+ md.autodiff.independents={'Thickness','Surface'};
+ md.autodiff.dependents={'IceVolume'};
+-md=solve(md,TransientSolutionEnum);
++%md=solve(md,TransientSolutionEnum);
++md=solve(md,PrognosticSolutionEnum);
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Vx','Vy','Vel','Pressure',...
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git/install.sh	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git/install.sh	(revision 13325)
+@@ -17,7 +17,7 @@
+ 
+ #install
+ cd src 
+-./configure  --prefix="$ISSM_DIR/externalpackages/git/install"
++./configure  --prefix="$ISSM_DIR/externalpackages/git/install" --with-python="$ISSM_DIR/externalpackages/python/install/bin/python"
+ 	
+ #Compile
+ make install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13325)
+@@ -164,9 +164,9 @@
+ 
+ 	if(profiling){
+ 		ProfilingEnd(&Solution_time,&Memory_use,&Current_flops,Time_start,Flops_start);
+-		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, ProfilingSolutionTimeEnum, Solution_time, 1, 0));
+-		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, ProfilingCurrentMemEnum, Memory_use, 1, 0));
+-		femmodel->results->AddObject(new DoubleExternalResult(femmodel->results->Size()+1, ProfilingCurrentFlopsEnum, Current_flops, 1, 0));
++		femmodel->results->AddObject(new GenericExternalResult<double>(femmodel->results->Size()+1, ProfilingSolutionTimeEnum, Solution_time, 1, 0));
++		femmodel->results->AddObject(new GenericExternalResult<double>(femmodel->results->Size()+1, ProfilingCurrentMemEnum, Memory_use, 1, 0));
++		femmodel->results->AddObject(new GenericExternalResult<double>(femmodel->results->Size()+1, ProfilingCurrentFlopsEnum, Current_flops, 1, 0));
+ 	}
+ 
+ 	#ifdef _HAVE_ADOLC_
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controlrestart.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controlrestart.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controlrestart.cpp	(revision 13325)
+@@ -24,8 +24,15 @@
+ 	if(!dakota_analysis){
+ 		/*we essentially want J and the parameter: */
+ 		for(int i=0;i<num_controls;i++) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,control_type[i]);
+-		femmodel->results->AddObject(new DoubleVecExternalResult(femmodel->results->Size()+1,JEnum,J,nsteps,1,0));
+-		//femmodel->results->AddObject(new StringExternalResult(femmodel->results->Size()+1,InversionControlParametersEnum,EnumToStringx(control_type),1,0));
++		#ifdef _HAVE_ADOLC_
++		IssmPDouble* J_passive=xNew<IssmPDouble>(nsteps);
++		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
++		femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,J,nsteps,1,1,0));
++		#endif
++		//femmodel->results->AddObject(new GenericExternalResult<char*>(femmodel->results->Size()+1,InversionControlParametersEnum,EnumToStringx(control_type),1,0));
+ 
+ 		/*write to disk: */
+ 		OutputResultsx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/control_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/control_core.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/control_core.cpp	(revision 13325)
+@@ -114,7 +114,15 @@
+ 	/*some results not computed by steadystate_core or diagnostic_core: */
+ 	if(!dakota_analysis){ //do not save this if we are running the control core from a qmu run!
+ 		for(i=0;i<num_controls;i++) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,control_type[i]);
+-		femmodel->results->AddObject(new DoubleVecExternalResult(femmodel->results->Size()+1,JEnum,J,nsteps,1,0));
++
++		#ifdef _HAVE_ADOLC_
++		IssmPDouble* J_passive=xNew<IssmPDouble>(nsteps);
++		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
++		femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,J,nsteps,1,1,0));
++		#endif
+ 	}
+ 
+ 	cleanup_and_return:
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13325)
+@@ -72,8 +72,8 @@
+ 	Results *results = new Results();
+ 	if(my_rank==0){
+ 		output_fid=pfopen(outbinfilename,"wb");
+-		results->AddObject(new DoubleVecExternalResult(results->Size()+1,0,predictions,ninterp,1,0));
+-		results->AddObject(new DoubleVecExternalResult(results->Size()+1,1,error,ninterp,1,0));
++		results->AddObject(new GenericExternalResult<double*>(results->Size()+1,0,predictions,ninterp,1,1,0));
++		results->AddObject(new GenericExternalResult<double*>(results->Size()+1,1,error,ninterp,1,1,0));
+ 		for(int i=0;i<results->Size();i++){
+ 			ExternalResult* result=(ExternalResult*)results->GetObjectByOffset(i);
+ 			result->WriteData(output_fid,1);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 13325)
+@@ -87,7 +87,7 @@
+ 	for(int i=0;i<num_controls;i++){
+ 		InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,control_list[i]);
+ 	}
+-	femmodel->results->AddObject(new DoubleVecExternalResult(femmodel->results->Size()+1,JEnum,user.J,maxiter+3,1,0));
++	femmodel->results->AddObject(new GenericExternalResult<double*>(femmodel->results->Size()+1,JEnum,user.J,maxiter+3,1,1,0));
+ 
+ 	/*Finalize*/
+ 	if(VerboseControl()) _pprintLine_("   preparing final solution");
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13325)
+@@ -165,6 +165,8 @@
+ /*FUNCTION Elements::ToResults{{{*/
+ void Elements::ToResults(Results* results,Parameters* parameters){
+ 
++	int i;
++	
+ 	extern int my_rank;
+ 	extern int num_procs;
+ 
+@@ -244,7 +246,14 @@
+ 			vector_serial=vector->ToMPISerial();
+ 			if(my_rank==0){
+ 				/*No need to add this vector for all cpus*/
+-				results->AddObject(new DoubleVecExternalResult(results->Size()+1,resultsenums[i],vector_serial,vectorsize,resultssteps[i],resultstimes[i]));
++				#ifdef _HAVE_ADOLC_
++				IssmPDouble* vector_serial_passive=xNew<IssmPDouble>(vectorsize);
++				for(i=0;i<vectorsize;i++)vector_serial_passive[i]=reCast<IssmPDouble>(vector_serial[i]);
++				results->AddObject(new GenericExternalResult<double*>(results->Size()+1,resultsenums[i],vector_serial_passive,vectorsize,1,resultssteps[i],resultstimes[i]));
++				xDelete<IssmPDouble>(vector_serial_passive);
++				#else
++				results->AddObject(new GenericExternalResult<double*>(results->Size()+1,resultsenums[i],vector_serial,vectorsize,1,resultssteps[i],resultstimes[i]));
++				#endif
+ 			}
+ 
+ 			/*clean up*/
+@@ -261,9 +270,16 @@
+ 
+ 		/*create result object and add to results dataset:*/
+ 		if (patch->maxvertices && patch->maxnodes){
+-			results->AddObject(new IntExternalResult(results->Size()+1,PatchVerticesEnum,patch->maxvertices,1,0));
+-			results->AddObject(new IntExternalResult(results->Size()+1,PatchNodesEnum,   patch->maxnodes,1,0));
+-			results->AddObject(new DoubleMatExternalResult(results->Size()+1,PatchEnum,  patch->values,patch->numrows,patch->numcols,1,0));
++			results->AddObject(new GenericExternalResult<int>(results->Size()+1,PatchVerticesEnum,patch->maxvertices,1,0));
++			results->AddObject(new GenericExternalResult<int>(results->Size()+1,PatchNodesEnum,   patch->maxnodes,1,0));
++			#ifdef _HAVE_ADOLC_
++			IssmPDouble* values_passive=xNew<IssmPDouble>(patch->numrows);
++			for(i=0;i<patch->numrows;i++)values_passive[i]=reCast<IssmPDouble>(patch->values[i]);
++			results->AddObject(new GenericExternalResult<double*>(results->Size()+1,PatchEnum,  values_passive,patch->numrows,patch->numcols,1,0));
++			xDelete<IssmPDouble>(values_passive);
++			#else
++			results->AddObject(new GenericExternalResult<double*>(results->Size()+1,PatchEnum,  patch->values,patch->numrows,patch->numcols,1,0));
++			#endif
+ 		}
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13325)
+@@ -66,19 +66,16 @@
+                 double *theOutput=xNew<double>(num_dependents);
+                 if (fos_forward(1,num_dependents,num_independents, 0, xp, tangentDir, theOutput, theJacVecProduct ))
+                   _error_("fos_forward returned non-zero error code");
+-                IssmDouble *theJacVecProductA=xNew<IssmDouble>(num_dependents);
+-                for (int i=0;i<num_dependents;++i)
+-                  theJacVecProductA[i]=theJacVecProduct[i];
+-                results->AddObject(new DoubleVecExternalResult(results->Size()+1,AutodiffJacobianEnum,theJacVecProductA,num_dependents,1,0.0));
++                results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,theJacVecProduct,num_dependents,1,1,0.0));
+ 
+ #if 0
+                 double **J=xNew<double>(num_dependents,num_independents);
+ 		jacobian(1,num_dependents,num_independents,xp,J);
+-		IssmDouble *matJ=xNew<IssmDouble>(num_dependents*num_independents);
++		IssmPDouble *matJ=xNew<IssmPDouble>(num_dependents*num_independents);
+                 for (int i=0;i<num_dependents*num_independents;++i)
+                   matJ[i]=J[i];
+-                results->AddObject(new DoubleMatExternalResult(results->Size()+1,AutodiffJacobianEnum,matJ,num_independents,num_dependents,1,0.0));
+-                xDelete(matJ);
++                results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,matJ,num_independents,num_dependents,1,1,0.0));
++                xDelete<IssmPDouble>(matJ);
+                 xDelete(J);
+ #endif
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 13325)
+@@ -44,7 +44,7 @@
+ 	if(my_rank==0){
+ 		parameters->FindParam(&solutiontype,SolutionTypeEnum);
+ 		EnumToStringx(&solutiontypestring,solutiontype);
+-		results->AddObject(new StringExternalResult(results->Size()+1,SolutionTypeEnum,solutiontypestring,1,0));
++		results->AddObject(new GenericExternalResult<char*>(results->Size()+1,SolutionTypeEnum,solutiontypestring,1,0));
+ 		xDelete<char>(solutiontypestring);
+ 	}
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp	(revision 13325)
+@@ -10,9 +10,16 @@
+ 		
+ void AddExternalResultx( DataSet* results, int enumtype, IssmDouble value){
+ 	/* Add new result in into results*/
+-	results->AddObject(new DoubleExternalResult(results->Size()+1,enumtype,value,1,0));
++	results->AddObject(new GenericExternalResult<double>(results->Size()+1,enumtype,reCast<IssmPDouble>(value),1,0));
+ }
+ void AddExternalResultx( DataSet* results, int enumtype, IssmDouble* value, int nraws){
+ 	/* Add new result in into results*/
+-	results->AddObject(new DoubleVecExternalResult(results->Size()+1,enumtype,value,nraws,1,0));
++	#ifdef _HAVE_ADOLC_
++	IssmPDouble* value_passive=xNew<IssmPDouble>(nraws);
++	for(int i=0;i<nraws;i++)value_passive[i]=reCast<IssmPDouble>(value[i]);
++	results->AddObject(new GenericExternalResult<double*>(results->Size()+1,enumtype,value_passive,nraws,1,1,0));
++	xDelete<IssmPDouble>(value_passive);
++	#else
++	results->AddObject(new GenericExternalResult<double*>(results->Size()+1,enumtype,value,nraws,1,1,0));
++	#endif
+ }
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp	(revision 13325)
+@@ -29,11 +29,11 @@
+ 
+ 				case IceVolumeEnum:
+ 					Responsex(&output_value,elements,nodes,vertices,loads,materials,parameters,"IceVolume",false,0);
+-					results->AddObject(new DoubleExternalResult(results->Size()+1,IceVolumeEnum,output_value,step,time));
++					results->AddObject(new GenericExternalResult<double>(results->Size()+1,IceVolumeEnum,reCast<IssmPDouble>(output_value),step,time));
+ 					break;
+ 				case TotalSmbEnum:
+ 					Responsex(&output_value,elements,nodes,vertices,loads,materials,parameters,"TotalSmb",false,0);
+-					results->AddObject(new DoubleExternalResult(results->Size()+1,TotalSmbEnum,output_value,step,time));
++					results->AddObject(new GenericExternalResult<double>(results->Size()+1,TotalSmbEnum,reCast<IssmPDouble>(output_value),step,time));
+ 					break;
+ 				default:
+ 					/*create this output in the element inputs, and then transfer to results:*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am	(revision 13325)
+@@ -74,18 +74,7 @@
+ 					./classes/objects/ElementResults/BoolElementResult.h\
+ 					./classes/objects/ElementResults/BoolElementResult.cpp\
+ 					./classes/objects/ExternalResults/ExternalResult.h\
+-					./classes/objects/ExternalResults/BoolExternalResult.h\
+-					./classes/objects/ExternalResults/BoolExternalResult.cpp\
+-					./classes/objects/ExternalResults/DoubleExternalResult.h\
+-					./classes/objects/ExternalResults/DoubleExternalResult.cpp\
+-					./classes/objects/ExternalResults/DoubleVecExternalResult.h\
+-					./classes/objects/ExternalResults/DoubleVecExternalResult.cpp\
+-					./classes/objects/ExternalResults/DoubleMatExternalResult.h\
+-					./classes/objects/ExternalResults/DoubleMatExternalResult.cpp\
+-					./classes/objects/ExternalResults/IntExternalResult.h\
+-					./classes/objects/ExternalResults/IntExternalResult.cpp\
+-					./classes/objects/ExternalResults/StringExternalResult.h\
+-					./classes/objects/ExternalResults/StringExternalResult.cpp\
++					./classes/objects/ExternalResults/GenericExternalResult.h\
+ 					./classes/objects/Elements/Tria.h\
+ 					./classes/objects/Elements/Tria.cpp\
+ 					./classes/objects/Elements/TriaHook.h\
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/objects.h	(revision 13325)
+@@ -92,12 +92,7 @@
+ 
+ /*ExternalResults: */
+ #include "./ExternalResults/ExternalResult.h"
+-#include "./ExternalResults/BoolExternalResult.h"
+-#include "./ExternalResults/DoubleExternalResult.h"
+-#include "./ExternalResults/DoubleVecExternalResult.h"
+-#include "./ExternalResults/DoubleMatExternalResult.h"
+-#include "./ExternalResults/IntExternalResult.h"
+-#include "./ExternalResults/StringExternalResult.h"
++#include "./ExternalResults/GenericExternalResult.h"
+ 
+ /*Materials: */
+ #include "./Materials/Material.h"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 13325)
+@@ -1,166 +0,0 @@
+-/*!\file DoubleMatExternalResult.c
+- * \brief: implementation of the DoubleMatExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../shared/shared.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*DoubleMatExternalResult constructors and destructor*/
+-/*FUNCTION DoubleMatExternalResult::DoubleMatExternalResult(){{{*/
+-DoubleMatExternalResult::DoubleMatExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::DoubleMatExternalResult(int in_id, int enum_type,IssmDoubleMat values,int M,int N,int in_step,IssmDouble in_time){{{*/
+-DoubleMatExternalResult::DoubleMatExternalResult(int in_id, int in_enum_type,IssmDouble* in_values, int in_M,int in_N,int in_step,IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	M=in_M;
+-	N=in_N;
+-
+-	/*Copy result in values*/
+-	if(M*N){
+-		values=xNew<IssmDouble>(M*N);
+-		xMemCpy<IssmDouble>(values,in_values,M*N);
+-	}
+-	else values=NULL;
+-
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::~DoubleMatExternalResult(){{{*/
+-DoubleMatExternalResult::~DoubleMatExternalResult(){
+-
+-	xDelete<IssmDouble>(this->values);
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleMatExternalResult::Echo {{{*/
+-void DoubleMatExternalResult::Echo(void){
+-
+-	_printLine_("DoubleMatExternalResult:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-	_printLine_("   matrix size: " << this->M << "-" << this->N);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::DeepEcho{{{*/
+-void DoubleMatExternalResult::DeepEcho(void){
+-
+-	int i,j;
+-	
+-	_printLine_("DoubleMatExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-	_printLine_("   matrix size: " << this->M << "-" << this->N);
+-	for (i=0;i<this->M;i++){  
+-		_printString_("   [ ");
+-		for (j=0;j<this->N;j++){
+-			_printString_( " " << setw(11) << setprecision (5) << this->values[i*this->N+j]);
+-		}  
+-		_printLine_(" ]");
+-	}  
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::Id{{{*/
+-int    DoubleMatExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::MyRank{{{*/
+-int    DoubleMatExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::ObjectEnum{{{*/
+-int DoubleMatExternalResult::ObjectEnum(void){
+-
+-	return DoubleMatExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::copy{{{*/
+-Object* DoubleMatExternalResult::copy() {
+-	
+-	return new DoubleMatExternalResult(this->id,this->enum_type,this->values,this->M,this->N,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*DoubleMatExternalResult management: */
+-/*FUNCTION DoubleMatExternalResult::WriteData{{{*/
+-void   DoubleMatExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     rows,cols;
+-	char   *name    = NULL;
+-	extern  int my_rank;
+-	IssmPDouble *passiveDouble_p=NULL;
+-	IssmPDouble passiveDouble;
+-
+-	if(io_gather){
+-		/*we are gathering the data on cpu 0, don't write on other cpus: */
+-		if(my_rank) return;
+-	}
+-
+-	passiveDouble_p=xNew<IssmPDouble>(M*N);
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-	passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmDouble array, type is 3:*/
+-	type=3;
+-	fwrite(&type,sizeof(int),1,fid);
+-	rows=this->M;
+-	fwrite(&rows,sizeof(int),1,fid);
+-	cols=this->N;
+-	fwrite(&cols,sizeof(int),1,fid);
+-	for (int i=0; i<N*M; ++i) passiveDouble_p[i]=reCast<IssmPDouble>(values[i]);
+-	fwrite(passiveDouble_p,cols*rows*sizeof(IssmPDouble),1,fid);
+-	xDelete(passiveDouble_p);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::GetResultName{{{*/
+-void DoubleMatExternalResult::GetResultName(char** pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleMatExternalResult::GetStep{{{*/
+-int DoubleMatExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h	(revision 13325)
+@@ -1,55 +0,0 @@
+-/*! \file DoubleVecExternalResult.h 
+- */
+-
+-
+-#ifndef _DOUBLEVECEXTERNALRESULT_H_
+-#define _DOUBLEVECEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../../include/include.h"
+-#include "../../../shared/shared.h"
+-#include "../../../include/include.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-class DoubleVecExternalResult: public ExternalResult{
+-
+-	private: 
+-		int id;
+-		int enum_type;
+-		IssmDouble* values;
+-		int M;
+-		int step;
+-		IssmDouble time;
+-
+-	public:
+-		/*DoubleVecExternalResult constructors, destructors: {{{*/
+-		DoubleVecExternalResult();
+-		DoubleVecExternalResult(int id,int enum_type,IssmDouble* values,int M,int step, IssmDouble time);
+-		~DoubleVecExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult management: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEVECEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h	(revision 13325)
+@@ -1,56 +0,0 @@
+-/*! \file DoubleExternalResult.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _DOUBLEEXTERNALRESULT_H_
+-#define _DOUBLEEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-
+-#include "./ExternalResult.h"
+-#include "../../../include/include.h"
+-#include "../../../shared/shared.h"
+-#include "../../../include/include.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-class DoubleExternalResult: public ExternalResult{
+-
+-	public:
+-		int    id;
+-		int    enum_type;
+-		IssmDouble value;
+-		int    step;
+-		IssmDouble time;
+-
+-
+-		/*DoubleExternalResult constructors, destructors: {{{*/
+-		DoubleExternalResult();
+-		DoubleExternalResult(int id,int enum_type,IssmDouble value,int step,IssmDouble time);
+-		~DoubleExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult management: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h	(revision 13325)
+@@ -1,54 +0,0 @@
+-/*! \file IntExternalResult.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _INTEXTERNALRESULT_H_
+-#define _INTEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../../include/include.h"
+-#include "../../../shared/shared.h"
+-/*}}}*/
+-
+-class IntExternalResult: public ExternalResult{
+-
+-	public:
+-		int    id;
+-		int    enum_type;
+-		int    value;
+-		int    step;
+-		IssmDouble time;
+-
+-
+-		/*IntExternalResult constructors, destructors: {{{*/
+-		IntExternalResult();
+-		IntExternalResult(int id,int enum_type,int value,int step,IssmDouble time);
+-		~IntExternalResult();
+-
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult managemnet: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _INTEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h	(revision 13325)
+@@ -1,54 +0,0 @@
+-/*! \file BoolExternalResult.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _BOOLEXTERNALRESULT_H_
+-#define _BOOLEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../../include/include.h"
+-#include "../../../shared/shared.h"
+-#include "../../../include/include.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-class BoolExternalResult: public ExternalResult{
+-
+-	public:
+-		int    id;
+-		int    enum_type;
+-		bool   value;
+-		int    step;
+-		IssmDouble time;
+-
+-		/*BoolExternalResult constructors, destructors: {{{*/
+-		BoolExternalResult();
+-		BoolExternalResult(int id, int enum_type,bool value,int step,IssmDouble time);
+-		~BoolExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult management: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h	(revision 13325)
+@@ -1,56 +0,0 @@
+-/*! \file DoubleMatExternalResult.h 
+- */
+-
+-
+-#ifndef _DOUBLEMATEXTERNALRESULT_H_
+-#define _DOUBLEMATEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../../include/include.h"
+-#include "../../../shared/shared.h"
+-#include "../../../include/include.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-class DoubleMatExternalResult: public ExternalResult{
+-
+-	private: 
+-		int id;
+-		int enum_type;
+-		IssmDouble* values;
+-		int M;
+-		int N;
+-		int step;
+-		IssmDouble time;
+-
+-	public:
+-		/*DoubleMatExternalResult constructors, destructors: {{{*/
+-		DoubleMatExternalResult();
+-		DoubleMatExternalResult(int id,int enum_type,IssmDouble* values,int M,int N,int step, IssmDouble time);
+-		~DoubleMatExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult managemnet: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _DOUBLEMATEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp	(revision 13325)
+@@ -1,132 +0,0 @@
+-/*!\file StringExternalResult.c
+- * \brief: implementation of the StringExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../shared/shared.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*StringExternalResult constructors and destructor*/
+-/*FUNCTION StringExternalResult::StringExternalResult(){{{*/
+-StringExternalResult::StringExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::StringExternalResult(int enum_type,IssmString value){{{*/
+-StringExternalResult::StringExternalResult(int in_id, int in_enum_type,char* in_value,int in_step, IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	value=xNew<char>(strlen(in_value)+1);
+-	xMemCpy<char>(value,in_value,(strlen(in_value)+1));
+-	step=in_step;
+-	time=in_time;
+-	
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::~StringExternalResult(){{{*/
+-StringExternalResult::~StringExternalResult(){
+-	xDelete<char>(value);
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION StringExternalResult::Echo {{{*/
+-void StringExternalResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::DeepEcho{{{*/
+-void StringExternalResult::DeepEcho(void){
+-
+-	_printLine_("StringExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::Id{{{*/
+-int    StringExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION StringExternalResult::MyRank{{{*/
+-int    StringExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::ObjectEnum{{{*/
+-int StringExternalResult::ObjectEnum(void){
+-
+-	return StringExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::copy{{{*/
+-Object* StringExternalResult::copy() {
+-	
+-	return new StringExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*StringExternalResult management: */
+-/*FUNCTION StringExternalResult::WriteData{{{*/
+-void   StringExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	char   *name      = NULL;
+-	extern  int my_rank;
+-        IssmPDouble passiveDouble;
+-
+-	/*return if now on cpu 0: */
+-	if(my_rank)return;
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-        passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a string, type is 2: */
+-	type=2;
+-	fwrite(&type,sizeof(int),1,fid);
+-	
+-	length=(strlen(this->value)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(this->value,length,1,fid);
+-
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::GetResultName{{{*/
+-void StringExternalResult::GetResultName(char**pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION StringExternalResult::GetStep{{{*/
+-int StringExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 13325)
+@@ -1,152 +0,0 @@
+-/*!\file DoubleVecExternalResult.c
+- * \brief: implementation of the DoubleVecExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../shared/shared.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*DoubleVecExternalResult constructors and destructor*/
+-/*FUNCTION DoubleVecExternalResult::DoubleVecExternalResult(){{{*/
+-DoubleVecExternalResult::DoubleVecExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::DoubleVecExternalResult(int enum_type,IssmDoubleVec values,int M,int in_step,IssmDouble in_time){{{*/
+-DoubleVecExternalResult::DoubleVecExternalResult(int in_id, int in_enum_type,IssmDouble* in_values, int in_M,int in_step,IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	M=in_M;
+-
+-	if(M){
+-		values=xNew<IssmDouble>(M);
+-		xMemCpy<IssmDouble>(values,in_values,M);
+-	}
+-	else values=NULL;
+-
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::~DoubleVecExternalResult(){{{*/
+-DoubleVecExternalResult::~DoubleVecExternalResult(){
+-	xDelete<IssmDouble>(values);
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleVecExternalResult::Echo {{{*/
+-void DoubleVecExternalResult::Echo(void){
+-
+-	_printLine_("DoubleVecExternalResult:");
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   vector size: " << this->M);
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::DeepEcho{{{*/
+-void DoubleVecExternalResult::DeepEcho(void){
+-
+-	int i;
+-	
+-	_printLine_("DoubleVecExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   vector size: " << this->M);
+-	for(i=0;i<this->M;i++){
+-		_printLine_(i << " " << this->values[i]);
+-	}
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::Id{{{*/
+-int    DoubleVecExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::MyRank{{{*/
+-int    DoubleVecExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::ObjectEnum{{{*/
+-int DoubleVecExternalResult::ObjectEnum(void){
+-
+-	return DoubleVecExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::copy{{{*/
+-Object* DoubleVecExternalResult::copy() {
+-	
+-	return new DoubleVecExternalResult(this->id,this->enum_type,this->values,this->M,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*DoubleVecExternalResult management: */
+-/*FUNCTION DoubleVecExternalResult::WriteData{{{*/
+-void   DoubleVecExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     size;
+-	char   *name    = NULL;
+-	extern  int my_rank;
+-	IssmPDouble *passiveDouble_p=NULL;
+-	IssmPDouble passiveDouble;
+-
+-	/*return if now on cpu 0: */
+-	if(my_rank)return;
+-
+-	passiveDouble_p=xNew<IssmPDouble>(M);
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-        passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmDouble, type is 1, size is 1: */
+-	type=1;
+-	size=this->M;
+-	fwrite(&type,sizeof(int),1,fid);
+-	fwrite(&size,sizeof(int),1,fid);
+-        for (int i=0; i<M; ++i) passiveDouble_p[i]=reCast<IssmPDouble>(values[i]);
+-	fwrite(passiveDouble_p,size*sizeof(IssmPDouble),1,fid);
+-        xDelete(passiveDouble_p);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::GetResultName{{{*/
+-void DoubleVecExternalResult::GetResultName(char** pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleVecExternalResult::GetStep{{{*/
+-int DoubleVecExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp	(revision 13325)
+@@ -1,131 +0,0 @@
+-/*!\file DoubleExternalResult.c
+- * \brief: implementation of the DoubleExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../shared/shared.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*DoubleExternalResult constructors and destructor*/
+-/*FUNCTION DoubleExternalResult::DoubleExternalResult(){{{*/
+-DoubleExternalResult::DoubleExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::DoubleExternalResult(int enum_type,IssmDouble value){{{*/
+-DoubleExternalResult::DoubleExternalResult(int in_id, int in_enum_type,IssmDouble in_value,int in_step, IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	value=in_value;
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::~DoubleExternalResult(){{{*/
+-DoubleExternalResult::~DoubleExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION DoubleExternalResult::Echo {{{*/
+-void DoubleExternalResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::DeepEcho{{{*/
+-void DoubleExternalResult::DeepEcho(void){
+-
+-	_printLine_("DoubleExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::Id{{{*/
+-int    DoubleExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::MyRank{{{*/
+-int    DoubleExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::ObjectEnum{{{*/
+-int DoubleExternalResult::ObjectEnum(void){
+-
+-	return DoubleExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::copy{{{*/
+-Object* DoubleExternalResult::copy() {
+-	
+-	return new DoubleExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*DoubleExternalResult management: */
+-/*FUNCTION DoubleExternalResult::WriteData{{{*/
+-void   DoubleExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     size;
+-	char   *name    = NULL;
+-	extern  int my_rank;
+-	IssmPDouble passiveDouble;
+-
+-	/*return if now on cpu 0: */
+-	if(my_rank)return;
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-	passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmDouble, type is 1, size is 1: */
+-	type=1;
+-	size=1;
+-	fwrite(&type,sizeof(int),1,fid);
+-	fwrite(&size,sizeof(int),1,fid);
+-        passiveDouble=reCast<IssmPDouble>(this->value);
+-	fwrite(&passiveDouble,size*sizeof(IssmPDouble),1,fid);
+-
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::GetResultName{{{*/
+-void DoubleExternalResult::GetResultName(char** pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION DoubleExternalResult::GetStep{{{*/
+-int DoubleExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp	(revision 13325)
+@@ -1,132 +0,0 @@
+-/*!\file IntExternalResult.c
+- * \brief: implementation of the IntExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../shared/shared.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*IntExternalResult constructors and destructor*/
+-/*FUNCTION IntExternalResult::IntExternalResult(){{{*/
+-IntExternalResult::IntExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::IntExternalResult(int in_id, int in_enum_type,int in_value,int in_step, IssmDouble in_time){{{*/
+-IntExternalResult::IntExternalResult(int in_id, int in_enum_type,int in_value,int in_step, IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	value=in_value;
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::~IntExternalResult(){{{*/
+-IntExternalResult::~IntExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION IntExternalResult::Echo {{{*/
+-void IntExternalResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::DeepEcho{{{*/
+-void IntExternalResult::DeepEcho(void){
+-
+-	_printLine_("IntExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " << this->value);
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::Id{{{*/
+-int    IntExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION IntExternalResult::MyRank{{{*/
+-int    IntExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::ObjectEnum{{{*/
+-int IntExternalResult::ObjectEnum(void){
+-
+-	return IntExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::copy{{{*/
+-Object* IntExternalResult::copy() {
+-	
+-	return new IntExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*IntExternalResult management: */
+-/*FUNCTION IntExternalResult::WriteData{{{*/
+-void   IntExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     size;
+-	char   *name    = NULL;
+-	IssmPDouble  passiveDouble;
+-	extern  int my_rank;
+-
+-	/*return if now on cpu 0: */
+-	if(my_rank)return;
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-        passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmPDouble, type is 1, size is 1: */
+-	type=1;
+-	size=1;
+-	fwrite(&type,sizeof(int),1,fid);
+-	fwrite(&size,sizeof(int),1,fid);
+-        /*cast to a IssmPDouble: */
+-        passiveDouble=reCast<IssmPDouble>(value);
+-	fwrite(&passiveDouble,size*sizeof(IssmPDouble),1,fid);
+-
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::GetResultName{{{*/
+-void IntExternalResult::GetResultName(char** pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION IntExternalResult::GetStep{{{*/
+-int IntExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp	(revision 13325)
+@@ -1,132 +0,0 @@
+-/*!\file BoolExternalResult.c
+- * \brief: implementation of the BoolExternalResult object
+- */
+-
+-/*header files: */
+-/*{{{*/
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include <stdio.h>
+-#include <string.h>
+-#include "../objects.h"
+-#include "../../../EnumDefinitions/EnumDefinitions.h"
+-#include "../../../shared/shared.h"
+-#include "../../../Container/Container.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-/*BoolExternalResult constructors and destructor*/
+-/*FUNCTION BoolExternalResult::BoolExternalResult(){{{*/
+-BoolExternalResult::BoolExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::BoolExternalResult(int enum_type,bool value){{{*/
+-BoolExternalResult::BoolExternalResult(int in_id, int in_enum_type,bool in_value,int in_step, IssmDouble in_time){
+-
+-	id=in_id;
+-	enum_type=in_enum_type;
+-	value=in_value;
+-	step=in_step;
+-	time=in_time;
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::~BoolExternalResult(){{{*/
+-BoolExternalResult::~BoolExternalResult(){
+-	return;
+-}
+-/*}}}*/
+-
+-/*Object virtual functions definitions:*/
+-/*FUNCTION BoolExternalResult::Echo {{{*/
+-void BoolExternalResult::Echo(void){
+-	this->DeepEcho();
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::DeepEcho{{{*/
+-void BoolExternalResult::DeepEcho(void){
+-
+-	_printLine_("BoolExternalResult:");
+-	_printLine_("   id: " << this->id);
+-	_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
+-	_printLine_("   value: " <<(this->value?"true":"false"));
+-	_printLine_("   step: " << this->step);
+-	_printLine_("   time: " << this->time);
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::Id{{{*/
+-int    BoolExternalResult::Id(void){ return -1; }
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::MyRank{{{*/
+-int    BoolExternalResult::MyRank(void){ 
+-	extern int my_rank;
+-	return my_rank; 
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::ObjectEnum{{{*/
+-int BoolExternalResult::ObjectEnum(void){
+-
+-	return BoolExternalResultEnum;
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::copy{{{*/
+-Object* BoolExternalResult::copy() {
+-	
+-	return new BoolExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+-
+-}
+-/*}}}*/
+-
+-/*BoolExternalResult management: */
+-/*FUNCTION BoolExternalResult::WriteData{{{*/
+-void   BoolExternalResult::WriteData(FILE* fid,bool io_gather){
+-
+-	int     length;
+-	int     type;
+-	int     size;
+-	IssmPDouble  passiveDouble;
+-	extern  int my_rank;
+-	char*   name = NULL;
+-
+-	/*return if now on cpu 0: */
+-	if(my_rank)return;
+-
+-	/*First write enum: */
+-	EnumToStringx(&name,this->enum_type);
+-	length=(strlen(name)+1)*sizeof(char);
+-	fwrite(&length,sizeof(int),1,fid);
+-	fwrite(name,length,1,fid);
+-	xDelete<char>(name);
+-
+-	/*Now write time and step: */
+-	passiveDouble=reCast<IssmPDouble>(time);
+-	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+-	fwrite(&step,sizeof(int),1,fid);
+-
+-	/*writing a IssmDouble, type is 1, size is 1: */
+-	type=1;
+-	size=1;
+-	fwrite(&type,sizeof(int),1,fid);
+-	fwrite(&size,sizeof(int),1,fid);
+-        /*Now write bool, after casting it: */
+-        passiveDouble=reCast<IssmPDouble>(this->value);
+-        fwrite(&passiveDouble,size*sizeof(IssmPDouble),1,fid);
+-
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::GetResultName{{{*/
+-void BoolExternalResult::GetResultName(char** pname){
+-	EnumToStringx(pname,this->enum_type);
+-}
+-/*}}}*/
+-/*FUNCTION BoolExternalResult::GetStep{{{*/
+-int BoolExternalResult::GetStep(void){
+-
+-	return this->step;
+-}
+-/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h	(revision 13325)
+@@ -1,55 +0,0 @@
+-/*! \file StringExternalResult.h 
+- *  \brief: header file for triavertexinput object
+- */
+-
+-
+-#ifndef _STRINGEXTERNALRESULT_H_
+-#define _STRINGEXTERNALRESULT_H_
+-
+-/*Headers:*/
+-/*{{{*/
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "./ExternalResult.h"
+-#include "../../../include/include.h"
+-#include "../../../shared/shared.h"
+-#include "../../../include/include.h"
+-#include "../../../include/include.h"
+-/*}}}*/
+-
+-class StringExternalResult: public ExternalResult{
+-
+-	private: 
+-		int    id;
+-		int    enum_type;
+-		char*  value;
+-		int    step;
+-		IssmDouble time;
+-
+-	public:
+-		/*StringExternalResult constructors, destructors: {{{*/
+-		StringExternalResult();
+-		StringExternalResult(int id,int enum_type,char* value,int step, IssmDouble time);
+-		~StringExternalResult();
+-		/*}}}*/
+-		/*Object virtual functions definitions:{{{ */
+-		void  Echo();
+-		void  DeepEcho();
+-		int   Id(); 
+-		int   MyRank();
+-		int   ObjectEnum();
+-		Object* copy();
+-		/*}}}*/
+-		/*ExternalResult management: {{{*/
+-		int   InstanceEnum(){return enum_type;}
+-		void  WriteData(FILE* fid,bool io_gather);
+-		void  GetResultName(char**);
+-		int   GetStep(void);
+-		/*}}}*/
+-};
+-#endif  /* _STRINGEXTERNALRESULT_H */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/GenericExternalResult.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/GenericExternalResult.h	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/GenericExternalResult.h	(revision 13325)
+@@ -0,0 +1,326 @@
++/*! \file GenericExternalResult.h 
++ *  \brief: header file for generic external result object
++ */
++
++#ifndef _GENERIC_EXTERNAL_RESULT_
++#define _GENERIC_EXTERNAL_RESULT_
++
++/*Headers:{{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include <cstring>
++
++#include "../../../include/include.h"
++#include "../../../shared/Exceptions/exceptions.h"
++#include "../../../shared/Numerics/recast.h"
++#include "../../../io/io.h"
++#include "../../../EnumDefinitions/EnumDefinitions.h"
++#include "./ExternalResult.h"
++/*}}}*/
++
++template <class ResultType> 
++class GenericExternalResult: public ExternalResult {
++
++	private: 
++		int id;
++		int enum_type;
++		ResultType value;
++		int M;
++		int N;
++		int step;
++		IssmDouble time;
++	
++	public:
++		/*Diverse: must be in front, as it is used in what follows*/
++		void GenericEcho(void){/*{{{*/
++			_printLine_("   id: " << this->id);
++			_printLine_("   enum:  " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
++			_printLine_("   step: " << this->step);
++			_printLine_("   time: " << this->time);
++		}
++		/*}}}*/
++		void GenericWriteData(FILE* fid){/*{{{*/ 
++
++			int     length;
++			IssmPDouble  passiveDouble;
++			char*   name = NULL;
++
++			/*First write enum: */
++			EnumToStringx(&name,this->enum_type);
++			length=(strlen(name)+1)*sizeof(char);
++			fwrite(&length,sizeof(int),1,fid);
++			fwrite(name,length,1,fid);
++			xDelete<char>(name);
++
++			/*Now write time and step: */
++			passiveDouble=reCast<IssmPDouble>(time);
++			fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
++			fwrite(&step,sizeof(int),1,fid);
++		} /*}}}*/
++
++		/*GenericExternalResult constructors and  destructors*/
++		GenericExternalResult(){ /*{{{*/
++			id  = 0;
++			enum_type = NoneEnum;
++			M=0;
++			N=0;
++			step=0;
++			time=0;
++		} /*}}}*/
++		GenericExternalResult(int in_id, int in_enum_type,ResultType in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
++			_error_("template GenericExternalResult(int in_id, int in_enum_type,double* in_values, int in_M,int in_N,int in_step,IssmDouble in_time) not implemented for this ResultType\n");
++		}
++/*}}}*/
++		GenericExternalResult(int in_id, int in_enum_type,ResultType in_value,int in_step, IssmDouble in_time){ /*{{{*/
++			id=in_id;
++			enum_type=in_enum_type;
++			value=in_value;
++			step=in_step;
++			time=in_time;
++		}
++		/*}}}*/
++		~GenericExternalResult(){ /*{{{*/
++		} /*}}}*/
++
++		/*Object virtual functions definitions:*/
++		void Echo(void){ /*{{{*/
++			this->DeepEcho();
++		}
++		/*}}}*/
++		void DeepEcho(void){ /*{{{*/
++			_error_("template DeepEcho not implemented for this ResultType\n");
++		}
++		/*}}}*/
++		int Id(void){ /*{{{*/ 
++			return -1; 
++		} /*}}}*/
++		int MyRank(void){ /*{{{*/
++			extern int my_rank;
++			return my_rank; 
++		} /*}}}*/
++		int ObjectEnum(void){ /*{{{*/
++			_error_("template ObjectEnum not implemented for this ResultType\n");
++		} /*}}}*/
++		Object* copy(void) { /*{{{*/
++			return new GenericExternalResult<ResultType>(this->id,this->enum_type,this->value,this->step,this->time);
++		} /*}}}*/
++
++		/*GenericExternalResult management: */
++void WriteData(FILE* fid,bool io_gather){ /*{{{*/
++			
++	extern  int my_rank;
++	int     type;
++	int     size;
++	IssmPDouble  passiveDouble;
++	
++	/*return if now on cpu 0: */
++	if(my_rank)return;
++
++	/*use generic part, same for all ResultTypes: */
++	this->GenericWriteData(fid);
++
++	/*writing a IssmPDouble for Matlab or Python to post-process, type is 1, size is 1: */
++	type=1;
++	size=1;
++	fwrite(&type,sizeof(int),1,fid);
++	fwrite(&size,sizeof(int),1,fid);
++
++	/*cast to a IssmPDouble: */
++	passiveDouble=reCast<IssmPDouble>(value);
++	fwrite(&passiveDouble,size*sizeof(IssmPDouble),1,fid);
++
++} /*}}}*/
++void GetResultName(char** pname){ /*{{{*/
++	EnumToStringx(pname,this->enum_type);
++} /*}}}*/
++int GetStep(void){ /*{{{*/
++	return this->step;
++} /*}}}*/
++int InstanceEnum(void){ /*{{{*/
++	return this->enum_type;
++} /*}}}*/
++};
++
++/*Specific instantiations for bool: */
++template <> inline void GenericExternalResult<bool>::DeepEcho(void){ /*{{{*/
++
++	_printLine_("GenericExternalResult<bool>:");
++	this->GenericEcho();
++	_printLine_("   value: " <<(this->value?"true":"false"));
++
++} /*}}}*/
++template <> inline int GenericExternalResult<bool>::ObjectEnum(void){ /*{{{*/
++	return BoolExternalResultEnum;
++} /*}}}*/
++
++/*Specific instantiations for int: */
++template <> inline void GenericExternalResult<int>::DeepEcho(void){ /*{{{*/
++
++	_printLine_("GenericExternalResult<int>:");
++	this->GenericEcho();
++	_printLine_("   value: " << this->value);
++
++} /*}}}*/
++template <> inline int GenericExternalResult<int>::ObjectEnum(void){ /*{{{*/
++	return IntExternalResultEnum;
++} /*}}}*/
++
++/*Specific instantiations for double: */
++template <> inline void GenericExternalResult<double>::DeepEcho(void){ /*{{{*/
++
++	_printLine_("GenericExternalResult<double>:");
++	this->GenericEcho();
++	_printLine_("   value: " << this->value);
++
++} /*}}}*/
++template <> inline int GenericExternalResult<double>::ObjectEnum(void){ /*{{{*/
++	return DoubleExternalResultEnum;
++} /*}}}*/
++
++/*Specific instantiations for char*: */
++template <> inline GenericExternalResult<char*>::GenericExternalResult(int in_id, int in_enum_type,char* in_value,int in_step, IssmDouble in_time){ /*{{{*/
++
++	id=in_id;
++	enum_type=in_enum_type;
++	value=xNew<char>(strlen(in_value)+1);
++	xMemCpy<char>(value,in_value,(strlen(in_value)+1));
++	step=in_step;
++	time=in_time;
++
++} /*}}}*/
++template <> inline GenericExternalResult<char*>::~GenericExternalResult(){ /*{{{*/
++	xDelete<char>(value);
++} /*}}}*/
++template <> inline void GenericExternalResult<char*>::DeepEcho(void){ /*{{{*/
++
++	_printLine_("GenericExternalResult<char*>:");
++	this->GenericEcho();
++	_printLine_("   value: " << this->value);
++
++} /*}}}*/
++template <> inline void GenericExternalResult<char*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
++
++	extern  int my_rank;
++	int     type;
++	int     length;
++
++	/*return if now on cpu 0: */
++	if(my_rank)return;
++
++	/*use generic part, same for all ResultTypes: */
++	this->GenericWriteData(fid);
++
++	/*writing a string, type is 2: */
++	type=2;
++	fwrite(&type,sizeof(int),1,fid);
++
++	length=(strlen(this->value)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(this->value,length,1,fid);
++}
++/*}}}*/
++template <> inline int GenericExternalResult<char*>::ObjectEnum(void){ /*{{{*/
++	return StringExternalResultEnum;
++} /*}}}*/
++
++/*Specific instantiations for IssmPDouble*: */
++template <> inline GenericExternalResult<IssmPDouble*>::GenericExternalResult(int in_id, int in_enum_type,IssmPDouble* in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
++
++	id=in_id;
++	enum_type=in_enum_type;
++	M=in_M;
++	N=in_N;
++	
++	step=in_step;
++	time=in_time;
++
++	/*Copy result in values*/
++	if(M*N){
++		value=xNew<IssmPDouble>(M*N);
++		xMemCpy<IssmPDouble>(value,in_values,M*N);
++	}
++	else value=NULL;
++}
++/*}}}*/
++template <> inline GenericExternalResult<IssmPDouble*>::GenericExternalResult(int in_id, int in_enum_type,IssmPDouble* in_value,int in_step, IssmDouble in_time){ /*{{{*/
++	_error_("you cannot initialize a GenericExternalResult<IssmPDouble*> without providing the dimensions of the matrix! Please use a more appropriate constructor!");
++} /*}}}*/
++template <> inline GenericExternalResult<IssmPDouble*>::~GenericExternalResult(){ /*{{{*/
++	xDelete<IssmPDouble>(value);
++} /*}}}*/
++template <> inline void GenericExternalResult<IssmPDouble*>::Echo(void){ /*{{{*/
++	
++	int i,j;
++
++	_printLine_("GenericExternalResult<IssmPDouble*>:");
++	this->GenericEcho();
++	_printLine_("   matrix size: " << this->M << "-" << this->N);
++
++} /*}}}*/
++template <> inline void GenericExternalResult<IssmPDouble*>::DeepEcho(void){ /*{{{*/
++	
++	int i,j;
++
++	_printLine_("GenericExternalResult<IssmPDouble*>:");
++	this->GenericEcho();
++	
++	_printLine_("   matrix size: " << this->M << "-" << this->N);
++	for (i=0;i<this->M;i++){  
++		_printString_("   [ ");
++		for (j=0;j<this->N;j++){
++			_printString_( " " << setw(11) << setprecision (5) << this->value[i*this->N+j]);
++		}  
++		_printLine_(" ]");
++	}  
++
++} /*}}}*/
++template <> inline Object* GenericExternalResult<IssmPDouble*>::copy(void){ /*{{{*/
++	return new GenericExternalResult<IssmPDouble*>(this->id,this->enum_type,this->value,this->M,this->N,this->step,this->time);
++} /*}}}*/
++template <> inline void GenericExternalResult<IssmPDouble*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
++	
++	extern  int my_rank;
++	int     length;
++	int     type;
++	int     rows,cols;
++	char   *name    = NULL;
++	extern  int my_rank;
++	IssmPDouble passiveDouble;
++
++	if(io_gather){
++		/*we are gathering the data on cpu 0, don't write on other cpus: */
++		if(my_rank) return;
++	}
++
++	/*First write enum: */
++	EnumToStringx(&name,this->enum_type);
++	length=(strlen(name)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(name,length,1,fid);
++	xDelete<char>(name);
++
++	/*Now write time and step: */
++	passiveDouble=reCast<IssmPDouble>(time);
++	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
++	fwrite(&step,sizeof(int),1,fid);
++
++	/*writing a IssmDouble array, type is 3:*/
++	type=3;
++	fwrite(&type,sizeof(int),1,fid);
++	rows=this->M;
++	fwrite(&rows,sizeof(int),1,fid);
++	cols=this->N;
++	fwrite(&cols,sizeof(int),1,fid);
++	fwrite(value,cols*rows*sizeof(IssmPDouble),1,fid);
++
++}
++/*}}}*/
++template <> inline int GenericExternalResult<IssmPDouble*>::ObjectEnum(void){ /*{{{*/
++	return DoubleMatExternalResultEnum;
++} /*}}}*/
++
++#endif  /* _EXTERNAL_RESULTOBJECT_H */
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/ExternalResults/GenericExternalResult.h
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_nonlinear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_nonlinear.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_nonlinear.cpp	(revision 13325)
+@@ -88,7 +88,7 @@
+ 			bool max_iteration_state=false;
+ 			int tempStep=1;
+ 			IssmDouble tempTime=1.0;
+-			femmodel->results->AddObject(new BoolExternalResult(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
++			femmodel->results->AddObject(new GenericExternalResult<bool>(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
+ 			break;
+ 		}
+ 		if(count>=max_nonlinear_iterations){
+@@ -99,7 +99,7 @@
+ 			bool max_iteration_state=true;
+ 			int tempStep=1;
+ 			IssmDouble tempTime=1.0;
+-			femmodel->results->AddObject(new BoolExternalResult(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
++			femmodel->results->AddObject(new GenericExternalResult<bool>(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
+ 			break;
+ 		}
+ 	}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_newton.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_newton.cpp	(revision 13324)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_newton.cpp	(revision 13325)
+@@ -70,7 +70,7 @@
+ 			bool max_iteration_state=false;
+ 			int tempStep=1;
+ 			IssmDouble tempTime=1.0;
+-			femmodel->results->AddObject(new BoolExternalResult(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
++			femmodel->results->AddObject(new GenericExternalResult<bool>(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
+ 			break;
+ 		}
+ 		if(count>=max_nonlinear_iterations){
+@@ -78,7 +78,7 @@
+ 			bool max_iteration_state=true;
+ 			int tempStep=1;
+ 			IssmDouble tempTime=1.0;
+-			femmodel->results->AddObject(new BoolExternalResult(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
++			femmodel->results->AddObject(new GenericExternalResult<bool>(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
+ 			break;
+ 		}
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13325-13326.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13325-13326.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13325-13326.diff	(revision 13394)
@@ -0,0 +1,17 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13325)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13326)
+@@ -71,11 +71,7 @@
+ #if 0
+                 double **J=xNew<double>(num_dependents,num_independents);
+ 		jacobian(1,num_dependents,num_independents,xp,J);
+-		IssmPDouble *matJ=xNew<IssmPDouble>(num_dependents*num_independents);
+-                for (int i=0;i<num_dependents*num_independents;++i)
+-                  matJ[i]=J[i];
+-                results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,matJ,num_independents,num_dependents,1,1,0.0));
+-                xDelete<IssmPDouble>(matJ);
++                results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,*J,num_independents,num_dependents,1,1,0.0));
+                 xDelete(J);
+ #endif
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13326-13327.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13326-13327.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13326-13327.diff	(revision 13394)
@@ -0,0 +1,30 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h	(revision 13326)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/xNewDelete.h	(revision 13327)
+@@ -36,21 +36,23 @@
+ T** xNew(unsigned int dim1, unsigned int dim2) {
+ #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
+   T* buf=new T[dim1*dim2];
++  assert(buf );
+   T** aT_pp =new T*[dim1];
++  assert(aT_pp );
+   for (unsigned int i=0;i<dim1;++i) {
+     aT_pp [i]=buf;
+     buf+=dim2;
+   }
+-  assert(aT_pp );
+   return aT_pp ;
+ #else
+   T* buf=(T*)malloc(dim1*dim2*sizeof(T));
++  assert(buf );
+   T** aT_pp =(T**)malloc(dim1*sizeof(T*));
++  assert(aT_pp );
+   for (unsigned int i=0;i<dim1;++i) {
+     aT_pp [i]=buf;
+     buf+=dim2;
+   }
+-  assert(aT_pp );
+   return aT_pp ;
+ #endif
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-13327-13328.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13327-13328.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13327-13328.diff	(revision 13394)
@@ -0,0 +1,22 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13327)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13328)
+@@ -2,6 +2,7 @@
+  * \brief: compute outputs from the AD mode,  using our dependents and independents, and drivers available in Adolc.
+  */
+ 
++#include <iostream>
+ #include "../../modules/modules.h"
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+@@ -64,6 +65,9 @@
+                 tangentDir[anIndepNum]=1.0;
+                 double *theJacVecProduct=xNew<double>(num_dependents);
+                 double *theOutput=xNew<double>(num_dependents);
++                for (int i=0; i<num_independents; ++i) {
++                  std::cout << "fos_forward xp[" << i << "]=" << xp[i] << std::endl;
++                }
+                 if (fos_forward(1,num_dependents,num_independents, 0, xp, tangentDir, theOutput, theJacVecProduct ))
+                   _error_("fos_forward returned non-zero error code");
+                 results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,theJacVecProduct,num_dependents,1,1,0.0));
Index: /issm/oecreview/Archive/12678-13393/ISSM-13328-13329.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13328-13329.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13328-13329.diff	(revision 13394)
@@ -0,0 +1,53 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/bamg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/bamg.m	(revision 13328)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/bamg.m	(revision 13329)
+@@ -63,9 +63,12 @@
+ 	%Check that file exists
+ 	domainfile=getfieldvalue(options,'domain');
+ 	if ~exist(domainfile,'file') error(['bamg error message: file ' domainfile ' not found ']); end
++	domain=expread(domainfile);
+ 
++	%Write temporary file, with only the domain outline (exclude holes)
++	expwrite(domain(1),[domainfile '_TEMPouterboundary.exp']);
++
+ 	%Build geometry 
+-	domain=expread(domainfile);
+ 	count=0;
+ 	for i=1:length(domain),
+ 
+@@ -76,7 +79,7 @@
+ 
+ 		%Checks that all holes are INSIDE the principle domain outline
+ 		if i>1,
+-			flags=ContourToNodes(domain(i).x,domain(i).y,domain(1),0);
++			flags=ContourToNodes(domain(i).x,domain(i).y,[domainfile '_TEMPouterboundary.exp'],0);
+ 			if any(~flags),
+ 				error('bamg error message: All holes should be stricly inside the principal domain');
+ 			end
+@@ -105,7 +108,7 @@
+ 		for i=1:length(rift),
+ 
+ 			%detect wether all points of the rift are inside the domain
+-			flags=ContourToNodes(rift(i).x,rift(i).y,domain(1),0);
++			flags=ContourToNodes(rift(i).x,rift(i).y,[domainfile '_TEMPouterboundary.exp'],0);
+ 			if ~flags,
+ 				error('one Rift has all his points outside of the domain outline'),
+ 
+@@ -237,7 +240,7 @@
+ 		if(size(requiredvertices,2)==2), requiredvertices=[requiredvertices 4*ones(size(requiredvertices,1),1)]; end
+ 	
+ 		%only keep those inside
+-		flags=ContourToNodes(requiredvertices(:,1),requiredvertices(:,2),domain(1),0);
++		flags=ContourToNodes(requiredvertices(:,1),requiredvertices(:,2),[domainfile '_TEMPouterboundary.exp'],0);
+ 		requiredvertices=requiredvertices(find(flags),:);
+ 
+ 		%Add all points to bamg_geometry
+@@ -251,6 +254,7 @@
+ 
+ 	%process geom
+ 	%bamg_geometry=processgeometry(bamg_geometry,getfieldvalue(options,'tol',NaN),domain(1));
++	delete([domainfile '_TEMPouterboundary.exp']);
+ 
+ elseif isstruct(md.private.bamg) & isfield(md.private.bamg,'geometry'),
+ 	bamg_geometry=bamggeom(md.private.bamg.geometry); 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13329-13330.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13329-13330.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13329-13330.diff	(revision 13394)
@@ -0,0 +1,167 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13329)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/python/Makefile.am	(revision 13330)
+@@ -6,6 +6,7 @@
+ if MODULES
+ lib_LTLIBRARIES = BamgConvertMesh.la\
+ 						BamgMesher.la\
++						ContourToNodes.la\
+ 						ElementConnectivity.la\
+ 						EnumToString.la\
+ 						InterpFromMeshToMesh2d.la\
+@@ -63,6 +64,10 @@
+ 								../BamgMesher/BamgMesher.h
+ BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+ 
++ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
++									 ../ContourToNodes/ContourToNodes.h
++ContourToNodes_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
++
+ ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
+ 											../ElementConnectivity/ElementConnectivity.h
+ ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13329)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13330)
+@@ -10,68 +10,38 @@
+ 	_printLine_("   where:");
+ 	_printLine_("      x,y: list of nodes.");
+ 	_printLine_("      contourname: name of .exp file containing the contours, or resulting structure from call to expread.");
+-	_printLine_("      interptype: string definining type of interpolation ('element', or 'node').");
+ 	_printLine_("      edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.");
+ 	_printLine_("      flags: vector of flags (0 or 1), of size nods.");
+ 	_printLine_("");
+ }/*}}}*/
+ WRAPPER(ContourToNodes){
+ 
+-	int i,j;
++	/* input: */
++	int      edgevalue,nods;
++	double  *x           = NULL;
++	double  *y           = NULL;
++	char    *contourname = NULL;
++	DataSet *contours    = NULL;
+ 
+-	/* required input: */
+-	int     edgevalue;
+-	double *x          = NULL;
+-	double *y          = NULL;
+-	char   *interptype = NULL;
+-
+ 	/* output: */
+ 	SeqVec<double> *flags = NULL;
+-	int  nods;
+ 
+-	/*contours*/
+-	int numcontours;
+-	mxArray         *matlabstructure = NULL;
+-	Contour<double> **contours       = NULL;
+-	Contour<double> *contouri        = NULL;
+-
+ 	/*Boot module: */
+ 	MODULEBOOT();
+ 
+ 	/*checks on arguments on the matlab side: */
+-	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ContourToNodesUsage);
++	CHECKARGUMENTS(NLHS,NRHS,&ContourToNodesUsage);
+ 	
+ 	/*Fetch inputs: */
+ 	FetchData(&x,&nods,NULL,XHANDLE);
+ 	FetchData(&y,NULL,NULL,YHANDLE);
+ 	FetchData(&edgevalue,EDGEVALUEHANDLE);
++	FetchData(&contourname,CONTOURNAME);
++	contours=DomainOutlineRead<double>(contourname);
+ 
+-	/*Fetch contours*/
+-	if(mxIsChar(FILENAME)){
+-		/*Call expread on filename to build a contour array in the matlab workspace: */
+-		mexCallMATLAB(1,&matlabstructure,1,(mxArray**)&FILENAME,"expread");
+-	}
+-	else{
+-		/*FILENAME is actually a structure, coming directly from expread: */
+-		matlabstructure=(mxArray*)FILENAME;
+-	}
++	/*Run x layer */
++	ContourToNodesx(&flags,x,y,nods,contours,edgevalue);
+ 
+-	numcontours=mxGetNumberOfElements(matlabstructure);
+-	contours=xNew<Contour<double>*>(numcontours);
+-	for(i=0;i<numcontours;i++){
+-		//allocate
+-		contouri=xNew<Contour<double> >(1);
+-		//retrieve dimension of this contour.
+-		contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods"));
+-		//set pointers.
+-		contouri->x=mxGetPr(mxGetField(matlabstructure,i,"x"));
+-		contouri->y=mxGetPr(mxGetField(matlabstructure,i,"y"));
+-		*(contours+i)=contouri;
+-	}
+-
+-	/*Run interpolation routine: */
+-	ContourToNodesx(&flags,x,y,nods,contours,numcontours,edgevalue);
+-
+ 	/* output: */
+ 	WriteData(FLAGS,flags);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13329)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13330)
+@@ -29,7 +29,7 @@
+ /* input macros: */
+ #define XHANDLE         prhs[0]
+ #define YHANDLE         prhs[1]
+-#define FILENAME        prhs[2]
++#define CONTOURNAME     prhs[2]
+ #define EDGEVALUEHANDLE prhs[3]
+ 
+ /* serial output macros: */
+@@ -40,7 +40,7 @@
+ /* input macros: */
+ #define XHANDLE         PyTuple_GetItem(args,0)
+ #define YHANDLE         PyTuple_GetItem(args,1)
+-#define FILENAME        PyTuple_GetItem(args,2)
++#define CONTOURNAME     PyTuple_GetItem(args,2)
+ #define EDGEVALUEHANDLE PyTuple_GetItem(args,3)
+ 
+ /* serial output macros: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13329)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13330)
+@@ -28,18 +28,16 @@
+ }/*}}}*/
+ WRAPPER(ContourToMesh){
+ 
+-	int i,j;
+-
+ 	/* required input: */
+-	int     edgevalue;
+-	double *index      = NULL;
+-	int     nel;
+-	double *x          = NULL;
+-	int     nods;
+-	double *y          = NULL;
+-	char   *interptype = NULL;
+-	char* contourname  = NULL;
+-	DataSet* contours  = NULL;
++	int      edgevalue;
++	double  *index       = NULL;
++	int      nel;
++	double  *x           = NULL;
++	int      nods;
++	double  *y           = NULL;
++	char    *interptype  = NULL;
++	char    *contourname = NULL;
++	DataSet *contours    = NULL;
+ 
+ 	/* output: */
+ 	SeqVec<double> *in_nod  = NULL;
+@@ -90,5 +88,4 @@
+ 
+ 	/*end module: */
+ 	MODULEEND();
+-	
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-13330-13331.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13330-13331.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13330-13331.diff	(revision 13394)
@@ -0,0 +1,28 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython/install.sh	(revision 13330)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/ipython/install.sh	(revision 13331)
+@@ -3,18 +3,18 @@
+ 
+ #Some cleanup
+ rm -rf src
+-rm -rf ipython-0.12
++rm -rf ipython-0.13
+ mkdir src 
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/ipython-0.12.tar.gz' 'ipython-0.12.tar.gz'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/ipython-0.13.tar.gz' 'ipython-0.13.tar.gz'
+ 
+ #Untar 
+-tar -zxvf  ipython-0.12.tar.gz
++tar -zxvf  ipython-0.13.tar.gz
+ 
+ #Move ipython into src directory
+-mv ipython-0.12/* src
+-rm -rf ipython-0.12
++mv ipython-0.13/* src
++rm -rf ipython-0.13
+ 
+ #install  ipython
+ cd src
Index: /issm/oecreview/Archive/12678-13393/ISSM-13331-13332.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13331-13332.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13331-13332.diff	(revision 13394)
@@ -0,0 +1,146 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.py	(revision 13332)
+@@ -0,0 +1,101 @@
++import os.path
++import numpy
++from MatlabFuncs import *
++
++def expread(filename):
++	"""
++	EXPREAD - read a file exp and build a Structure
++
++	   This routine reads a file .exp and build a Structure containing the 
++	   fields x and y corresponding to the coordinates, one for the filename of
++	   the exp file, for the density, for the nodes, and a field closed to 
++	   indicate if the domain is closed. 
++	   The first argument is the .exp file to be read and the second one (optional) 
++	   indicate if the last point shall be read (1 to read it, 0 not to).
++
++	   Usage:
++	      Struct=expread(filename)
++
++	   Example:
++	      Struct=expread('domainoutline.exp')
++	      Struct=expread('domainoutline.exp')
++
++	   See also EXPDOC, EXPWRITEASVERTICES
++	"""
++
++	#some checks
++	if not os.path.exists(filename):
++		raise OSError("expread error message: file '%s' not found!" % filename)
++
++	#initialize number of profile
++	Structs=[]
++
++	#open file
++	fid=open(filename,'r')
++
++	#loop over the number of profiles
++	while True:
++
++		#update number of profiles
++		Struct={}
++
++		#Get file name
++		A=fid.readline().split(None,1)
++		if not A:
++			break
++		A=A[0]+A[1]
++		if not strncmp(A,'##Name:',7):
++			break
++		if len(A)>7: 
++			Struct['name']=A[7:-1]
++		else:
++			Struct['name']=''
++
++		#Get Icon
++		A=fid.readline().split(None,1)
++		A=A[0]+A[1]
++		if not strncmp(A,'##Icon:',6):
++			break
++
++		#Get Info
++		A=fid.readline().split(None,3)
++		A=A[0]+A[1]+A[2]+A[3]
++		if not strncmp(A,'#Points',7):
++			break
++
++		#Get number of nodes and density
++		A=fid.readline().split()
++		Struct['nods']   =float(A[0])
++		Struct['density']=float(A[1])
++
++		#Get Info
++		A=fid.readline().split(None,4)
++		A=A[0]+A[1]+A[2]+A[3]+A[4]
++		if not strncmp(A,'#XposYpos',9):
++			break
++
++		#Get Coordinates
++		Struct['x']=numpy.empty(Struct['nods'])
++		Struct['y']=numpy.empty(Struct['nods'])
++		for i in xrange(int(Struct['nods'])):
++			A=fid.readline().split()
++			Struct['x'][i]=float(A[0])
++			Struct['y'][i]=float(A[1])
++
++#		if(Struct['nods']~=length(Struct['x']))error(['Profile ' num2str ' reports incorrect length']); end;
++
++		#Check if closed
++		if (Struct['nods'] > 1) and \
++		   (Struct['x'][-1] == Struct['x'][0]) and \
++		   (Struct['y'][-1] == Struct['y'][0]):
++			Struct['closed']=True
++		else:
++			Struct['closed']=False
++
++		Structs.append(Struct)
++
++	#close file
++	fid.close()
++
++	return Structs
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.m	(revision 13331)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.m	(revision 13332)
+@@ -10,7 +10,7 @@
+ %
+ %   Usage:
+ %      Struct=expread(filename)
+-%  
++%
+ %   Example:
+ %      Struct=expread('domainoutline.exp')
+ %      Struct=expread('domainoutline.exp')
+@@ -32,9 +32,9 @@
+ while (~feof(fid)),
+ 
+ 	%update number of profiles
+-   count=count+1;
++	count=count+1;
+ 
+-   %Get file name
++	%Get file name
+ 	A=fscanf(fid,'%s %s',2);
+ 	if ~strncmp(A,'##Name:',7), break; end
+ 	if length(A)>7, 
+@@ -51,10 +51,10 @@
+ 	A=fscanf(fid,'%s %s %s %s',4);
+ 	if ~strncmp(A,'#Points',7), break; end
+ 
+-	%Get number of nods and density
+-   A=fscanf(fid,'%f %f',[1 2]);
+-   Struct(count).nods=A(1);
+-   Struct(count).density=A(2);
++	%Get number of nodes and density
++	A=fscanf(fid,'%f %f',[1 2]);
++	Struct(count).nods=A(1);
++	Struct(count).density=A(2);
+ 
+ 	%Get Info
+ 	A=fscanf(fid,'%s %s %s %s',5);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13332-13333.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13332-13333.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13332-13333.diff	(revision 13394)
@@ -0,0 +1,163 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13332)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13333)
+@@ -16,85 +16,85 @@
+ 	/*AD mode on?: */
+ 	parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
+ 	if(isautodiff){
+-                #ifdef _HAVE_ADOLC_
+-	        int  num_dependents;
+-                parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
+-	        int  num_independents;
+-                parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum);
+-                if(!(num_dependents*num_independents)) return;
+-	        int  numberofvertices;
+-                parameters->FindParam(&numberofvertices,MeshNumberofverticesEnum);
+-		/*retrieve state variable: */
+-                IssmDouble  *axp  = NULL;
+-		parameters->FindParam(&axp,&num_independents,AutodiffXpEnum);
+-		/* driver argument */
+-		double *xp=xNew<double>(num_independents);
+-		for(int i=0;i<num_independents;i++){
+-			xp[i]=reCast<double,IssmDouble>(axp[i]);
+-		}
+-		/* get the dimension for the solverx arguments*/
+-                int configuration_type;
+-		parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+-		int solveSize=nodes->NumberOfDofs(configuration_type,FsetEnum);
+-		int edf_n=solveSize*(solveSize+1), edf_m=solveSize;
++		#ifdef _HAVE_ADOLC_
++			int  num_dependents;
++			parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
++			int  num_independents;
++			parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum);
++			if(!(num_dependents*num_independents)) return;
++			int  numberofvertices;
++			parameters->FindParam(&numberofvertices,MeshNumberofverticesEnum);
++			/*retrieve state variable: */
++			IssmDouble  *axp  = NULL;
++			parameters->FindParam(&axp,&num_independents,AutodiffXpEnum);
++			/* driver argument */
++			double *xp=xNew<double>(num_independents);
++			for(int i=0;i<num_independents;i++){
++				xp[i]=reCast<double,IssmDouble>(axp[i]);
++			}
++			/* get the dimension for the solverx arguments*/
++			int configuration_type;
++			parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
++			int solveSize=nodes->NumberOfDofs(configuration_type,FsetEnum);
++			int edf_n=solveSize*(solveSize+1), edf_m=solveSize;
+ 
+-		/*get the EDF pointer:*/
+-		ext_diff_fct *anEDF_for_solverx_p=dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p;
+-		
+-		/*set the forward method function pointers: */
+-		anEDF_for_solverx_p->zos_forward=EDF_for_solverx;
+-		anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx;
+-		anEDF_for_solverx_p->fov_forward=EDF_fov_forward_for_solverx;
+-                anEDF_for_solverx_p->fos_reverse=EDF_fos_reverse_for_solverx;
+-                // anEDF_for_solverx_p->fov_reverse=EDF_fov_reverse_for_solverx;
+-		/*allocate the space for the parameters to invoke the forward methods:*/
+-		anEDF_for_solverx_p->dp_x=xNew<double>(edf_n);
+-		anEDF_for_solverx_p->dp_X=xNew<double>(edf_n);
+-		anEDF_for_solverx_p->dpp_X=xNew<double>(edf_n, num_independents);
+-		anEDF_for_solverx_p->dp_y=xNew<double>(edf_m);
+-		anEDF_for_solverx_p->dp_Y=xNew<double>(edf_m);
+-		anEDF_for_solverx_p->dpp_Y=xNew<double>(edf_m, num_independents);
+-		anEDF_for_solverx_p->dp_U=xNew<double>(edf_m);
+-		anEDF_for_solverx_p->dpp_U=xNew<double>(num_dependents,edf_m);
+-                anEDF_for_solverx_p->dp_Z=xNew<double>(edf_n);
+-                anEDF_for_solverx_p->dpp_Z=xNew<double>(num_dependents,edf_n);
+-		/* Call AD driver:*/
+-                // single direction:
+-                double *tangentDir=xNewZeroInit<double>(num_independents);
+-                unsigned int anIndepNum=55; // <---------- make this selectable via config
+-                tangentDir[anIndepNum]=1.0;
+-                double *theJacVecProduct=xNew<double>(num_dependents);
+-                double *theOutput=xNew<double>(num_dependents);
+-                for (int i=0; i<num_independents; ++i) {
+-                  std::cout << "fos_forward xp[" << i << "]=" << xp[i] << std::endl;
+-                }
+-                if (fos_forward(1,num_dependents,num_independents, 0, xp, tangentDir, theOutput, theJacVecProduct ))
+-                  _error_("fos_forward returned non-zero error code");
+-                results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,theJacVecProduct,num_dependents,1,1,0.0));
++			/*get the EDF pointer:*/
++			ext_diff_fct *anEDF_for_solverx_p=dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p;
+ 
++			/*set the forward method function pointers: */
++			anEDF_for_solverx_p->zos_forward=EDF_for_solverx;
++			anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx;
++			anEDF_for_solverx_p->fov_forward=EDF_fov_forward_for_solverx;
++			anEDF_for_solverx_p->fos_reverse=EDF_fos_reverse_for_solverx;
++			// anEDF_for_solverx_p->fov_reverse=EDF_fov_reverse_for_solverx;
++			/*allocate the space for the parameters to invoke the forward methods:*/
++			anEDF_for_solverx_p->dp_x=xNew<double>(edf_n);
++			anEDF_for_solverx_p->dp_X=xNew<double>(edf_n);
++			anEDF_for_solverx_p->dpp_X=xNew<double>(edf_n, num_independents);
++			anEDF_for_solverx_p->dp_y=xNew<double>(edf_m);
++			anEDF_for_solverx_p->dp_Y=xNew<double>(edf_m);
++			anEDF_for_solverx_p->dpp_Y=xNew<double>(edf_m, num_independents);
++			anEDF_for_solverx_p->dp_U=xNew<double>(edf_m);
++			anEDF_for_solverx_p->dpp_U=xNew<double>(num_dependents,edf_m);
++			anEDF_for_solverx_p->dp_Z=xNew<double>(edf_n);
++			anEDF_for_solverx_p->dpp_Z=xNew<double>(num_dependents,edf_n);
++			/* Call AD driver:*/
++			// single direction:
++			double *tangentDir=xNewZeroInit<double>(num_independents);
++			unsigned int anIndepNum=55; // <---------- make this selectable via config
++			tangentDir[anIndepNum]=1.0;
++			double *theJacVecProduct=xNew<double>(num_dependents);
++			double *theOutput=xNew<double>(num_dependents);
++			for (int i=0; i<num_independents; ++i) {
++				std::cout << "fos_forward xp[" << i << "]=" << xp[i] << std::endl;
++			}
++			if (fos_forward(1,num_dependents,num_independents, 0, xp, tangentDir, theOutput, theJacVecProduct ))
++				_error_("fos_forward returned non-zero error code");
++			results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,theJacVecProduct,num_dependents,1,1,0.0));
++
+ #if 0
+-                double **J=xNew<double>(num_dependents,num_independents);
+-		jacobian(1,num_dependents,num_independents,xp,J);
+-                results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,*J,num_independents,num_dependents,1,1,0.0));
+-                xDelete(J);
++			double **J=xNew<double>(num_dependents,num_independents);
++			jacobian(1,num_dependents,num_independents,xp,J);
++			results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,*J,num_independents,num_dependents,1,1,0.0));
++			xDelete(J);
+ #endif
+ 
+-                /* delete the allocated space for the parameters:*/
+-                xDelete(anEDF_for_solverx_p->dp_x);
+-                xDelete(anEDF_for_solverx_p->dp_X);
+-                xDelete(anEDF_for_solverx_p->dpp_X);
+-                xDelete(anEDF_for_solverx_p->dp_y);
+-                xDelete(anEDF_for_solverx_p->dp_Y);
+-                xDelete(anEDF_for_solverx_p->dpp_Y);
+-                xDelete(anEDF_for_solverx_p->dp_U);
+-                xDelete(anEDF_for_solverx_p->dpp_U);
+-                xDelete(anEDF_for_solverx_p->dp_Z);
+-                xDelete(anEDF_for_solverx_p->dpp_Z);
+-		/*Free ressources: */
+-		xDelete(xp);
+-		xDelete(axp); // did we allocate this?
++			/* delete the allocated space for the parameters:*/
++			xDelete(anEDF_for_solverx_p->dp_x);
++			xDelete(anEDF_for_solverx_p->dp_X);
++			xDelete(anEDF_for_solverx_p->dpp_X);
++			xDelete(anEDF_for_solverx_p->dp_y);
++			xDelete(anEDF_for_solverx_p->dp_Y);
++			xDelete(anEDF_for_solverx_p->dpp_Y);
++			xDelete(anEDF_for_solverx_p->dp_U);
++			xDelete(anEDF_for_solverx_p->dpp_U);
++			xDelete(anEDF_for_solverx_p->dp_Z);
++			xDelete(anEDF_for_solverx_p->dpp_Z);
++			/*Free ressources: */
++			xDelete(xp);
++			xDelete(axp); // did we allocate this?
+ 		#else
+-		_error_("Should not be requesting AD drivers when an AD library is not available!");
++			_error_("Should not be requesting AD drivers when an AD library is not available!");
+ 		#endif
+ 	}
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-13333-13334.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13333-13334.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13333-13334.diff	(revision 13394)
@@ -0,0 +1,39 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13333)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13334)
+@@ -68,9 +68,7 @@
+ int EDF_for_solverx(int n, IssmPDouble *x, int m, IssmPDouble *y){ /*{{{*/
+     SolverxSeq(y,x, x+m*m, m); // x is where the matrix starts, x+m*m is where the right-hand side starts
+     return 0;
+-}
+-/*}}}*/
+-
++} /*}}}*/
+ int EDF_fos_forward_for_solverx(int n, IssmPDouble *inVal, IssmPDouble *inDeriv, int m, IssmPDouble *outVal, IssmPDouble *outDeriv) { /*{{{*/
+ #ifdef _HAVE_GSL_
+   // the matrix will be modified by LU decomposition. Use gsl_A copy
+@@ -112,9 +110,7 @@
+   xDelete(Acopy);
+   #endif
+   return 0;
+-}
+-/*}}}*/
+-
++} /*}}}*/
+ int EDF_fov_forward_for_solverx(int n, IssmPDouble *inVal, int directionCount, IssmPDouble **inDeriv, int m, IssmPDouble *outVal, IssmPDouble **outDeriv) { /*{{{*/
+ #ifdef _HAVE_GSL_
+   // the matrix will be modified by LU decomposition. Use gsl_A copy
+@@ -160,12 +156,10 @@
+   return 0;
+ }
+ /*}}}*/
+-
+ int EDF_fos_reverse_for_solverx(int m, double *dp_U, int n, double *dp_Z) { /*{{{*/
+   return 0;
+ }
+ /*}}}*/
+-
+ void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
+ 	// pack inputs to conform to the EDF-prescribed interface
+         IssmDouble*  adoubleEDFin=xNew<IssmDouble>(n*(n+1));  // packed inputs, i.e. matrix and right hand side
Index: /issm/oecreview/Archive/12678-13393/ISSM-13334-13335.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13334-13335.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13334-13335.diff	(revision 13394)
@@ -0,0 +1,112 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test121.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test121.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test121.py	(revision 13335)
+@@ -0,0 +1,39 @@
++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',180000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md.extrude(3,1)
++md=setflowequation(md,'macayeal','all')
++md.cluster=generic('name',oshostname(),'np',3);
++md.initialization.waterfraction=numpy.zeros(md.mesh.numberofvertices)
++md.transient.isdiagnostic=0
++md.transient.isprognostic=0
++md.transient.isthermal=1
++md.transient.isgroundingline=0
++md.thermal.isenthalpy=1
++md=solve(md,TransientSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Enthalpy1','Waterfraction1','Temperature1',\
++	'Enthalpy2','Waterfraction2','Temperature2',\
++	'Enthalpy3','Waterfraction3','Temperature3']
++field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-10,1e-13]
++field_values=[\
++	md.results['TransientSolution'][1]['Enthalpy'],\
++	md.results['TransientSolution'][1]['Waterfraction'],\
++	md.results['TransientSolution'][1]['Temperature'],\
++	md.results['TransientSolution'][2]['Enthalpy'],\
++	md.results['TransientSolution'][2]['Waterfraction'],\
++	md.results['TransientSolution'][2]['Temperature'],\
++	md.results['TransientSolution'][3]['Enthalpy'],\
++	md.results['TransientSolution'][3]['Waterfraction'],\
++	md.results['TransientSolution'][3]['Temperature'],\
++	]
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test122.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test122.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test122.py	(revision 13335)
+@@ -0,0 +1,63 @@
++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',200000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelfConstrained.py')
++md.extrude(3,1)
++md=setflowequation(md,'pattyn','all')
++md.initialization.waterfraction=numpy.zeros(md.mesh.numberofvertices)
++md.thermal.isenthalpy=1
++md.thermal.stabilization=2
++md.cluster=generic('name',oshostname(),'np',3)
++md=solve(md,TransientSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','Enthalpy1','Waterfraction1',\
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2',\
++					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3']
++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-09,1e-08,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-09,1e-09]
++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]['Bed'],\
++	md.results['TransientSolution'][1]['Surface'],\
++	md.results['TransientSolution'][1]['Thickness'],\
++	md.results['TransientSolution'][1]['Temperature'],\
++	md.results['TransientSolution'][1]['Enthalpy'],\
++	md.results['TransientSolution'][1]['Waterfraction'],\
++	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]['Bed'],\
++	md.results['TransientSolution'][2]['Surface'],\
++	md.results['TransientSolution'][2]['Thickness'],\
++	md.results['TransientSolution'][2]['Temperature'],\
++	md.results['TransientSolution'][2]['Enthalpy'],\
++	md.results['TransientSolution'][2]['Waterfraction'],\
++	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]['Bed'],\
++	md.results['TransientSolution'][3]['Surface'],\
++	md.results['TransientSolution'][3]['Thickness'],\
++	md.results['TransientSolution'][3]['Temperature'],\
++	md.results['TransientSolution'][3]['Enthalpy'],\
++	md.results['TransientSolution'][3]['Waterfraction'],\
++	]
Index: /issm/oecreview/Archive/12678-13393/ISSM-13335-13336.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13335-13336.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13335-13336.diff	(revision 13394)
@@ -0,0 +1,188 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m	(revision 13335)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.m	(revision 13336)
+@@ -34,7 +34,7 @@
+ ISSM_DIR=issmdir();
+ 
+ %Check inputs
+-% {{{1
++% {{{
+ if nargout>1
+ 	help runme
+ 	error('runme error message: bad usage');
+@@ -45,33 +45,33 @@
+ % }}}
+ 
+ %Process options
+-%GET benchmark {{{1
++%GET benchmark {{{
+ benchmark=getfieldvalue(options,'benchmark','nightly');
+ if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc'})
+ 	disp('runme warning: benchmark not supported, defaulting to test ''nightly''')
+ 	benchmark='nightly';
+ end
+ % }}}
+-%GET procedure {{{1
++%GET procedure {{{
+ procedure=getfieldvalue(options,'procedure','check');
+ if ~ismember(procedure,{'check','update'})
+ 	disp('runme warning: procedure not supported, defaulting to test ''check''')
+ 	procedure='check';
+ end
+ % }}}
+-%GET output {{{1
++%GET output {{{
+ output=getfieldvalue(options,'output','none');
+ if ~ismember(output,{'nightly','daily','none'})
+ 	disp('runme warning: output not supported, defaulting to test ''none''')
+ 	output='none';
+ end
+ % }}}
+-%GET RANK and NUMPROCS for mutlithreaded runs  {{{1
++%GET RANK and NUMPROCS for mutlithreaded runs  {{{
+ rank=getfieldvalue(options,'rank',1);
+ numprocs=getfieldvalue(options,'numprocs',1);
+ if (numprocs<rank), numprocs=1; end
+ % }}}
+-%GET ids  {{{1
++%GET ids  {{{
+ flist=dir;%use dir, as it seems to act OS independent
+ list_ids=[];
+ for i=1:numel(flist),
+@@ -87,13 +87,13 @@
+ test_ids=getfieldvalue(options,'id',list_ids);
+ test_ids=intersect(test_ids,list_ids);
+ % }}}
+-%GET exclude {{{1
++%GET exclude {{{
+ exclude_ids=getfieldvalue(options,'exclude',[]);
+ exclude_ids=[exclude_ids];
+ pos=find(ismember(test_ids,exclude_ids));
+ test_ids(pos)=[];
+ % }}}
+-%Process Ids according to benchmarks{{{1
++%Process Ids according to benchmarks{{{
+ if strcmpi(benchmark,'nightly'),
+ 	test_ids=intersect(test_ids,[1:999]);
+ elseif strcmpi(benchmark,'ismip'),
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py	(revision 13335)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/runme.py	(revision 13336)
+@@ -41,49 +41,40 @@
+ 
+ 	from parallelrange import parallelrange
+ 	from IdToName import IdToName
+-	from MatlabFuncs import *
++	from MatlabFuncs import strcmpi
++	from MatlabFuncs import ismember
+ 
+ 	#Get ISSM_DIR variable
+ 	ISSM_DIR=os.environ['ISSM_DIR']
+-	print 'ISSM_DIR =',ISSM_DIR
+ 
+ 	#Process options
+-	#GET benchmark {{{1
++	#GET benchmark {{{
+ 	if not ismember(benchmark,['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing']):
+ 		print "runme warning: benchmark '%s' not supported, defaulting to test 'nightly'." % benchmark
+ 		benchmark='nightly'
+ 	# }}}
+-	#GET procedure {{{1
++	#GET procedure {{{
+ 	if not ismember(procedure,['check','update']):
+ 		print "runme warning: procedure '%s' not supported, defaulting to test 'check'." % procedure
+ 		procedure='check'
+ 	# }}}
+-	#GET output {{{1
++	#GET output {{{
+ 	if not ismember(output,['nightly','daily','none']):
+ 		print "runme warning: output '%s' not supported, defaulting to test 'none'." % output
+ 		output='none'
+ 	# }}}
+-	#GET RANK and NUMPROCS for multithreaded runs {{{1
++	#GET RANK and NUMPROCS for multithreaded runs {{{
+ 	if (numprocs<rank):
+ 		numprocs=1
+ 	# }}}
+-
+-	print 'id =',id
+-	print 'exclude =',exclude
+-	print 'benchmark =',benchmark
+-	print 'procedure =',procedure
+-	print 'output =',output
+-	print 'rank =',rank
+-	print 'numprocs =',numprocs
+-
+-	#GET ids  {{{1
++	#GET ids  {{{
+ 	flist=glob.glob('test*.py')    #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
+ 	list_ids=[int(file[4:-3]) for file in flist if not file == 'test.py']    #Keep test id only (skip 'test' and '.py')
+-	print 'list_ids =',list_ids
++	#print 'list_ids =',list_ids
+ 
+ 	i1,i2=parallelrange(rank,numprocs,len(list_ids))    #Get tests for this cpu only
+ 	list_ids=list_ids[i1:i2+1]
+-	print 'list_ids after parallelrange =',list_ids
++	#print 'list_ids after parallelrange =',list_ids
+ 
+ 	if id:
+ 		if isinstance(id,list):
+@@ -93,10 +84,9 @@
+ 		test_ids=set(test_ids).intersection(set(list_ids))
+ 	else:
+ 		test_ids=set(list_ids)
+-#	print 'test_ids after list =',test_ids
++	#print 'test_ids after list =',test_ids
+ 	# }}}
+-
+-	#GET exclude {{{1
++	#GET exclude {{{
+ 	if exclude:
+ 		if isinstance(exclude,list):
+ 			exclude_ids=exclude
+@@ -105,8 +95,7 @@
+ 		test_ids=test_ids.difference(set(exclude_ids))
+ #	print 'test_ids after exclude =',test_ids
+ 	# }}}
+-
+-	#Process Ids according to benchmarks {{{1
++	#Process Ids according to benchmarks {{{
+ 	if   strcmpi(benchmark,'nightly'):
+ 		test_ids=test_ids.intersection(set(range(1,1000)))
+ 	elif strcmpi(benchmark,'ismip'):
+@@ -121,10 +110,10 @@
+ 		test_ids=test_ids.intersection(set(range(1001,2000)))
+ 	elif strcmpi(benchmark,'tranforcing'):
+ 		test_ids=test_ids.intersection(set(range(1501,1503)))
+-#	print 'test_ids after benchmark =',test_ids
++	#print 'test_ids after benchmark =',test_ids
+ 	test_ids=list(test_ids)
+ 	test_ids.sort()
+-	print 'test_ids after sort =',test_ids
++	#print 'test_ids after sort =',test_ids
+ 	# }}}
+ 
+ 	#Loop over tests and launch sequence
+@@ -247,10 +236,11 @@
+ 
+ 	return
+ 
++import argparse
+ if __name__ == '__main__':
+ 	if 'PYTHONSTARTUP' in os.environ:
+ 		PYTHONSTARTUP=os.environ['PYTHONSTARTUP']
+-		print 'PYTHONSTARTUP =',PYTHONSTARTUP
++		#print 'PYTHONSTARTUP =',PYTHONSTARTUP
+ 		if os.path.exists(PYTHONSTARTUP):
+ 			try:
+ 				execfile(PYTHONSTARTUP)
+@@ -259,7 +249,6 @@
+ 		else:
+ 			print "PYTHONSTARTUP file '%s' does not exist." % PYTHONSTARTUP
+ 
+-	import argparse
+ 	parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs')
+ 	parser.add_argument('-i','--id', nargs='*', type=int, help='followed by the list of ids requested', default=[])
+ 	parser.add_argument('-e','--exclude', nargs='*', type=int, help='ids to be excluded from the test', default=[])
Index: /issm/oecreview/Archive/12678-13393/ISSM-13336-13337.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13336-13337.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13336-13337.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13336)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13337)
+@@ -57,7 +57,7 @@
+ 
+ <table $TABLE_STYLE>
+ <tr> 
+-<td $TABLE_FONT>host: $HOST_NAME</td>
++<td $TABLE_FONT>host: $HOST_NAME ($OS)</td>
+ <td $TABLE_FONT>date: $TODAY</td>
+ </tr>
+ <tr>
Index: /issm/oecreview/Archive/12678-13393/ISSM-13337-13338.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13337-13338.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13337-13338.diff	(revision 13394)
@@ -0,0 +1,79 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.py	(revision 13337)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.py	(revision 13338)
+@@ -1,5 +1,6 @@
+ import os.path
+ import numpy
++from collections import OrderedDict
+ from MatlabFuncs import *
+ 
+ def expread(filename):
+@@ -37,30 +38,30 @@
+ 	while True:
+ 
+ 		#update number of profiles
+-		Struct={}
++		Struct=OrderedDict()
+ 
+ 		#Get file name
+-		A=fid.readline().split(None,1)
++		A=fid.readline()
++		while A=='\n':
++			A=fid.readline()
+ 		if not A:
+ 			break
+-		A=A[0]+A[1]
+-		if not strncmp(A,'##Name:',7):
++		A=A.split(None,1)
++		if not (len(A) == 2 and strcmp(A[0],'##') and strncmp(A[1],'Name:',5)):
+ 			break
+-		if len(A)>7: 
+-			Struct['name']=A[7:-1]
++		if len(A[1])>5: 
++			Struct['name']=A[1][5:-1]
+ 		else:
+ 			Struct['name']=''
+ 
+ 		#Get Icon
+ 		A=fid.readline().split(None,1)
+-		A=A[0]+A[1]
+-		if not strncmp(A,'##Icon:',6):
++		if not (len(A) == 2 and strcmp(A[0],'##') and strncmp(A[1],'Icon:',5)):
+ 			break
+ 
+ 		#Get Info
+-		A=fid.readline().split(None,3)
+-		A=A[0]+A[1]+A[2]+A[3]
+-		if not strncmp(A,'#Points',7):
++		A=fid.readline().split()
++		if not (len(A) == 4 and strcmp(A[0],'#') and strcmp(A[1],'Points')):
+ 			break
+ 
+ 		#Get number of nodes and density
+@@ -69,9 +70,9 @@
+ 		Struct['density']=float(A[1])
+ 
+ 		#Get Info
+-		A=fid.readline().split(None,4)
+-		A=A[0]+A[1]+A[2]+A[3]+A[4]
+-		if not strncmp(A,'#XposYpos',9):
++		A=fid.readline().split()
++		if not (len(A) == 5 and strcmp(A[0],'#') and strcmp(A[1],'X') and strcmp(A[2],'pos') \
++		                                         and strcmp(A[3],'Y') and strcmp(A[4],'pos')):
+ 			break
+ 
+ 		#Get Coordinates
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.m	(revision 13337)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.m	(revision 13338)
+@@ -45,7 +45,7 @@
+ 
+ 	%Get Icon
+ 	A=fscanf(fid,'%s %s',2);
+-	if ~strncmp(A,'##Icon:',6), break; end
++	if ~strncmp(A,'##Icon:',7), break; end
+ 
+ 	%Get Info
+ 	A=fscanf(fid,'%s %s %s %s',4);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13338-13339.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13338-13339.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13338-13339.diff	(revision 13394)
@@ -0,0 +1,179 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/BinRead.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/BinRead.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/BinRead.py	(revision 13339)
+@@ -0,0 +1,168 @@
++#! /usr/bin/env python
++
++import os
++import sys
++import numpy
++import math
++import struct
++
++def BinRead(filin,filout=''):
++
++	from MatlabFuncs import *
++	from EnumDefinitions import *
++	from EnumToString import EnumToString
++
++	print "reading binary file."
++	f=open(filin,'rb')
++
++	if filout:
++		sys.stdout=open(filout,'w')
++
++	while True:
++		try:
++			#Step 1: read the enum to identify this record uniquely
++			enum=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++		except struct.error as e:
++			print "probable EOF: %s" % e
++			break
++		print "\nenum = %d (%s)" % (enum,EnumToString(enum)[0])
++
++		#Step 2: read the data itself.
++		#first read length of record
++		reclen=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++		print "reclen = %d" % reclen
++
++		#read data code: 
++		code=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++		print "code = %d" % code
++
++		if   code == FormatToCode('Boolean'):
++#			bval=struct.unpack('b',f.read(reclen-struct.calcsize('i')))[0]
++			bval=struct.unpack('i',f.read(reclen-struct.calcsize('i')))[0]
++			print "bval = %d" % bval
++
++		elif code == FormatToCode('Integer'):
++			ival=struct.unpack('i',f.read(reclen-struct.calcsize('i')))[0]
++			print "ival = %d" % ival
++
++		elif code == FormatToCode('Double'):
++			dval=struct.unpack('d',f.read(reclen-struct.calcsize('i')))[0]
++			print "dval = %f" % dval
++
++		elif code == FormatToCode('String'):
++			strlen=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++			print "strlen = %d" % strlen
++			sval=struct.unpack('%ds' % strlen,f.read(strlen))[0]
++			print "sval = '%s'" % sval
++
++		elif code == FormatToCode('BooleanMat'):
++			#read matrix type: 
++			mattype=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++			print "mattype = %d" % mattype
++
++			#now read matrix
++			s=[0,0]
++			s[0]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++			s[1]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++			print "s = [%dx%d]" % (s[0],s[1])
++			data=numpy.zeros((s[0],s[1]))
++			for i in xrange(s[0]):
++				for j in xrange(s[1]):
++					data[i][j]=struct.unpack('d',f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
++					print "data[%d,%d] = %f" % (i,j,data[i][j])
++
++		elif code == FormatToCode('IntMat'):
++			#read matrix type: 
++			mattype=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++			print "mattype = %d" % mattype
++
++			#now read matrix
++			s=[0,0]
++			s[0]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++			s[1]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++			print "s = [%dx%d]" % (s[0],s[1])
++			data=numpy.zeros((s[0],s[1]))
++			for i in xrange(s[0]):
++				for j in xrange(s[1]):
++					data[i][j]=struct.unpack('d',f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
++					print "data[%d,%d] = %f" % (i,j,data[i][j])
++
++		elif code == FormatToCode('DoubleMat'):
++			#read matrix type: 
++			mattype=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++			print "mattype = %d" % mattype
++
++			#now read matrix
++			s=[0,0]
++			s[0]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++			s[1]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
++			print "s = [%dx%d]" % (s[0],s[1])
++			data=numpy.zeros((s[0],s[1]))
++			for i in xrange(s[0]):
++				for j in xrange(s[1]):
++					data[i][j]=struct.unpack('d',f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
++					print "data[%d,%d] = %f" % (i,j,data[i][j])
++
++		elif code == FormatToCode('MatArray'):
++			fid.seek(reclen-4,1)
++			print "skipping %d bytes for code %d." % (code, reclen-4)
++
++		elif code == FormatToCode('StringArray'):
++			fid.seek(reclen-4,1)
++			print "skipping %d bytes for code %d." % (code, reclen-4)
++
++		else:
++			raise TypeError('BinRead error message: data type: %d not supported yet! (%s)' % (code,EnumToString(enum)[0]))
++
++	f.close()
++
++def FormatToCode(format): # {{{
++	"""
++	This routine takes the format string, and hardcodes it into an integer, which 
++	is passed along the record, in order to identify the nature of the dataset being 
++	sent.
++	"""
++
++	if   strcmpi(format,'Boolean'):
++		code=1
++	elif strcmpi(format,'Integer'):
++		code=2
++	elif strcmpi(format,'Double'):
++		code=3
++	elif strcmpi(format,'String'):
++		code=4
++	elif strcmpi(format,'BooleanMat'):
++		code=5
++	elif strcmpi(format,'IntMat'):
++		code=6
++	elif strcmpi(format,'DoubleMat'):
++		code=7
++	elif strcmpi(format,'MatArray'):
++		code=8
++	elif strcmpi(format,'StringArray'):
++		code=9
++	else:
++		raise InputError('FormatToCode error message: data type not supported yet!')
++
++	return code
++# }}}
++
++if __name__ == '__main__':
++	if 'PYTHONSTARTUP' in os.environ:
++		PYTHONSTARTUP=os.environ['PYTHONSTARTUP']
++		print 'PYTHONSTARTUP =',PYTHONSTARTUP
++		if os.path.exists(PYTHONSTARTUP):
++			try:
++				execfile(PYTHONSTARTUP)
++			except Exception as e:
++				print "PYTHONSTARTUP error: ",e
++		else:
++			print "PYTHONSTARTUP file '%s' does not exist." % PYTHONSTARTUP
++
++	import argparse
++	parser = argparse.ArgumentParser(description='BinRead - function to read binary input file.')
++	parser.add_argument('-f','--filin', help='name of binary input file', default='')
++	args = parser.parse_args()
++
++	BinRead(args.filin)
++
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/miscellaneous/BinRead.py
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13339-13340.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13339-13340.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13339-13340.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test421.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test421.m	(revision 13339)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test421.m	(revision 13340)
+@@ -8,7 +8,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-08,1e-09,2e-05,1e-09,1e-09};
++field_tolerances={1e-08,2e-09,2e-05,1e-09,2e-09};
+ field_values={...
+ 	(md.results.DiagnosticSolution.Vx),...
+ 	(md.results.DiagnosticSolution.Vy),...
Index: /issm/oecreview/Archive/12678-13393/ISSM-13340-13341.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13340-13341.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13340-13341.diff	(revision 13394)
@@ -0,0 +1,190 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.py	(revision 13340)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expread.py	(revision 13341)
+@@ -15,11 +15,11 @@
+ 	   indicate if the last point shall be read (1 to read it, 0 not to).
+ 
+ 	   Usage:
+-	      Struct=expread(filename)
++	      contours=expread(filename)
+ 
+ 	   Example:
+-	      Struct=expread('domainoutline.exp')
+-	      Struct=expread('domainoutline.exp')
++	      contours=expread('domainoutline.exp')
++	      contours=expread('domainoutline.exp')
+ 
+ 	   See also EXPDOC, EXPWRITEASVERTICES
+ 	"""
+@@ -29,7 +29,7 @@
+ 		raise OSError("expread error message: file '%s' not found!" % filename)
+ 
+ 	#initialize number of profile
+-	Structs=[]
++	contours=[]
+ 
+ 	#open file
+ 	fid=open(filename,'r')
+@@ -38,7 +38,7 @@
+ 	while True:
+ 
+ 		#update number of profiles
+-		Struct=OrderedDict()
++		contour=OrderedDict()
+ 
+ 		#Get file name
+ 		A=fid.readline()
+@@ -50,9 +50,9 @@
+ 		if not (len(A) == 2 and strcmp(A[0],'##') and strncmp(A[1],'Name:',5)):
+ 			break
+ 		if len(A[1])>5: 
+-			Struct['name']=A[1][5:-1]
++			contour['name']=A[1][5:-1]
+ 		else:
+-			Struct['name']=''
++			contour['name']=''
+ 
+ 		#Get Icon
+ 		A=fid.readline().split(None,1)
+@@ -66,8 +66,8 @@
+ 
+ 		#Get number of nodes and density
+ 		A=fid.readline().split()
+-		Struct['nods']   =float(A[0])
+-		Struct['density']=float(A[1])
++		contour['nods']   =float(A[0])
++		contour['density']=float(A[1])
+ 
+ 		#Get Info
+ 		A=fid.readline().split()
+@@ -76,27 +76,25 @@
+ 			break
+ 
+ 		#Get Coordinates
+-		Struct['x']=numpy.empty(Struct['nods'])
+-		Struct['y']=numpy.empty(Struct['nods'])
+-		for i in xrange(int(Struct['nods'])):
++		contour['x']=numpy.empty(contour['nods'])
++		contour['y']=numpy.empty(contour['nods'])
++		for i in xrange(int(contour['nods'])):
+ 			A=fid.readline().split()
+-			Struct['x'][i]=float(A[0])
+-			Struct['y'][i]=float(A[1])
++			contour['x'][i]=float(A[0])
++			contour['y'][i]=float(A[1])
+ 
+-#		if(Struct['nods']~=length(Struct['x']))error(['Profile ' num2str ' reports incorrect length']); end;
+-
+ 		#Check if closed
+-		if (Struct['nods'] > 1) and \
+-		   (Struct['x'][-1] == Struct['x'][0]) and \
+-		   (Struct['y'][-1] == Struct['y'][0]):
+-			Struct['closed']=True
++		if (contour['nods'] > 1) and \
++		   (contour['x'][-1] == contour['x'][0]) and \
++		   (contour['y'][-1] == contour['y'][0]):
++			contour['closed']=True
+ 		else:
+-			Struct['closed']=False
++			contour['closed']=False
+ 
+-		Structs.append(Struct)
++		contours.append(contour)
+ 
+ 	#close file
+ 	fid.close()
+ 
+-	return Structs
++	return contours
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.py	(revision 13341)
+@@ -0,0 +1,43 @@
++import numpy
++
++def expwrite(contours,filename):
++	"""
++	EXPWRITE - write an Argus file from a structure given in input
++
++	   This routine write an Argus file form a structure containing the fields:
++	   x and y of the coordinates of the points.
++	   The first argument is the structure containing the points coordinates 
++	   and the second one the file to be write.
++
++	   Usage:
++	      expwrite(contours,filename)
++
++	   Example:
++	      expwrite(coordstruct,'domainoutline.exp')
++
++	   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
++	"""
++
++	fid=open(filename,'w')
++	for contour in contours:
++		if numpy.size(contour['x'])!=numpy.size(contour['y']):
++			raise RuntimeError("contours x and y coordinates must be of identical size")
++   
++		if 'name' in contour:
++			if contour['name']:
++				fid.write("%s%s\n" % ('## Name:',contour['name']))
++			else:
++				fid.write("%s\n" % '## Name:')
++		else:
++			fid.write("%s\n" % '## Name:')
++   
++		fid.write("%s\n" % '## Icon:0')
++		fid.write("%s\n" % '# Points Count Value')
++		fid.write("%i %f\n" % (numpy.size(contour['x']),contour['density']))
++		fid.write("%s\n" % '# X pos Y pos')
++		for x,y in zip(contour['x'],contour['y']):
++			fid.write("%10.10f %10.10f\n" % (x,y))
++		fid.write("\n")
++
++	fid.close()
++
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.m	(revision 13340)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/exp/expwrite.m	(revision 13341)
+@@ -20,22 +20,22 @@
+ 		error('contours x and y coordinates must be of identical size');
+ 	end
+    
+-   if isfield(a,'name'),
+-	   if ~isempty(a(n).name),
+-		   fprintf(fid,'%s%s\n','## Name:',a(n).name);
+-	   else
+-		   fprintf(fid,'%s\n','## Name:');
+-	   end
+-   else
+-	   fprintf(fid,'%s\n','## Name:');
+-   end
++	if isfield(a,'name'),
++		if ~isempty(a(n).name),
++			fprintf(fid,'%s%s\n','## Name:',a(n).name);
++		else
++			fprintf(fid,'%s\n','## Name:');
++		end
++	else
++		fprintf(fid,'%s\n','## Name:');
++	end
+    
+-   fprintf(fid,'%s\n','## Icon:0');
+-   fprintf(fid,'%s\n','# Points Count Value');
+-   fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
+-   fprintf(fid,'%s\n','# X pos Y pos');
++	fprintf(fid,'%s\n','## Icon:0');
++	fprintf(fid,'%s\n','# Points Count Value');
++	fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
++	fprintf(fid,'%s\n','# X pos Y pos');
+ 	fprintf(fid,'%10.10f %10.10f\n',[a(n).x a(n).y]');
+-	fprintf(fid,'\n','');
+-   
++	fprintf(fid,'\n');
++
+ end
+ fclose(fid);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13341-13342.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13341-13342.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13341-13342.diff	(revision 13394)
@@ -0,0 +1,23 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13341)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13342)
+@@ -73,11 +73,16 @@
+ 			 end
+ 
+ 			 %2012 August 4th
+-			 if isa(md.materials,'materials'),
+-				 disp('Recovering old materials');
++			 if isa(md.materials,'matice'),
++				 disp('Recovering old matice');
+ 				 md.materials=matice(md.materials);
+ 			 end
+ 
++			 if isa(md.materials,'matdamageice'),
++				 disp('Recovering old matdamageice');
++				 md.materials=matdamageice(md.materials);
++			 end
++
+ 		 end% }}}
+ 	 end
+ 	 methods
Index: /issm/oecreview/Archive/12678-13393/ISSM-13342-13343.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13342-13343.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13342-13343.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh	(revision 13342)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/swig/install.sh	(revision 13343)
+@@ -18,7 +18,7 @@
+ cd install 
+ #cp $ISSM_DIR/externalpackages/pcre/install/pcre.h  ./Source/Include/
+ #cp $ISSM_DIR/externalpackages/pcre/install/.libs/*  ./Source/Include/
+-export CFLAGS="$CFLAGS -I$ISSM_DIR/externalpackages/pcre/install"
++export CFLAGS="-I$ISSM_DIR/externalpackages/pcre/install"
+ export LDFLAGS="-L$ISSM_DIR/externalpackages/pcre/install/.libs/"
+ export LIBS="-lpcre"
+ #Configure swig
Index: /issm/oecreview/Archive/12678-13393/ISSM-13343-13344.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13343-13344.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13343-13344.diff	(revision 13394)
@@ -0,0 +1,239 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python	(revision 13343)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python	(revision 13344)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++*.txt
+ install-*
+ install
+ install-python*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/freetype
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/freetype	(revision 13343)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/freetype	(revision 13344)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/freetype
+___________________________________________________________________
+Modified: svn:ignore
+## -1,2 +1,3 ##
++*.gz
+ install
+ src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-lion.sh	(revision 13343)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-lion.sh	(revision 13344)
+@@ -10,5 +10,11 @@
+ 
+ #install scipy
+ cd scipy
++export  BLAS_SRC=$ISSM_DIR/externalpackages/blas/install/lib
++export  BLAS=$ISSM_DIR/externalpackages/blas/install/lib
++export  LAPACK_SRC=$ISSM_DIR/externalpackages/lapack/install/lib
++export  LAPACK=$ISSM_DIR/externalpackages/lapack/install/lib
++
++#install scipy
+ python setup.py build
+ python setup.py install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis	(revision 13343)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis	(revision 13344)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/metis
+___________________________________________________________________
+Modified: svn:ignore
+## -1,2 +1,3 ##
++*.gz
+ install
+ src
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/latex2rtf
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/latex2rtf	(revision 13343)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/latex2rtf	(revision 13344)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/latex2rtf
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,5 ##
++*.gz
++install
+ cfg
+ latex2rtf-2.0.0
+ .ignore.txt
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pyclips
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pyclips	(revision 13343)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pyclips	(revision 13344)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/pyclips
+___________________________________________________________________
+Modified: svn:ignore
+## -1 +1,2 ##
++*.gz
+ install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost/install-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost/install-macosx-snowleopard.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost/install-macosx-snowleopard.sh	(revision 13344)
+@@ -0,0 +1,35 @@
++#!/bin/bash
++
++#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=python2.7 \
++	--with-python-root="$ISSM_DIR/externalpackages/python/install" 
++
++#Compile boost
++#./b2 address-model=32 architecture=x86 cxxflags="-arch i386" variant=release threading=multi install
++./b2 toolset=darwin address-model=32 architecture=x86 variant=release threading=multi install
++
++#put bjam into install also: 
++mkdir ../install/bin
++cp bjam ../install/bin
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost/install-macosx-snowleopard.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost	(revision 13343)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost	(revision 13344)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/boost
+___________________________________________________________________
+Modified: svn:ignore
+## -1,3 +1,4 ##
++*.gz
+ install
+ src
+ .ignore.txt
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vimrc
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vimrc	(revision 13343)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vimrc	(revision 13344)
+@@ -98,7 +98,11 @@
+ " save & "make" the current file in all modes
+ map <F8> :w <Enter> :make <Enter><Enter>
+ map! <F8>  <ESC> :w <Enter> :make <Enter><Enter>
++" make update: nice for longer documents
++map <F7> :w <Enter> :make update <Enter><Enter>
++map! <F7> <ESC> :w <Enter> :make update <Enter><Enter>
+ 
++
+ "use paste P: re-indent and re-format at the same time
+ :nnoremap <Esc>P P'[v']=
+ :nnoremap <Esc>p p'[v']=
+@@ -189,39 +193,41 @@
+ 
+ " Abbreviations {{{1
+ " ----------------------------------------------------------------------
+-func Eatchar(pat)
+-	let c = nr2char(getchar())
+-	return (c =~ a:pat) ? '' : c
+-endfunc
+-au BufRead,BufNewFile *.html     iabbr <silent> H1 <h1></h1><Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.html     iabbr <silent> H2 <h2></h2><Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.html     iabbr <silent> H3 <h3></h3><Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.html     iabbr <silent> CO <code></code><Left><Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.html     iabbr <silent> PP <p></p><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.m        iabbr <silent> p1  disp('');<Left><Left><Left><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.m        iab <expr> p0  "disp('-------------- file: ".expand('%')." line: ".line(".")."');"
+-au BufRead,BufNewFile *.c*       iabbr <silent> p1  printf("\n");<Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.c*,*.h   iabbr <silent> ER  _error_("");<Left><Left><Left><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.py       iabbr <silent> ER  raise NameError('')<Left><Left><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.m        iabbr <silent> ER  error('');<Left><Left><Left><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.c*       ab VV VecView(ug,PETSC_VIEWER_STDOUT_WORLD);
+-au BufRead,BufNewFile *.c*       ab AS _assert_();
+-au BufRead,BufNewFile *.c*       iab <expr> p0  "printf(\"-------------- file: ".expand('%')." line: %i\\n\",__LINE__);"
+-au BufRead,BufNewFile *.c*       iab <expr> pp0 "PetscSynchronizedPrintf(MPI_COMM_WORLD,\"-------------- file: ".expand('%')." line: %i\\n\",__LINE__);\nPetscSynchronizedFlush(MPI_COMM_WORLD);"
+-"tex
+-au BufRead,BufNewFile *.tex iab EQ 
+-			\\begin{equation}
+-			\<CR>\end{equation}<up><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.tex iab IT 
+-			\\begin{itemize}
+-			\<CR>\item 
+-			\<CR>\end{itemize}<up><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.tex iab EN 
+-			\\begin{enumerate}
+-			\<CR>\item 
+-			\<CR>\end{enumerate}<up><C-R>=Eatchar('\s')<CR>
+-au BufRead,BufNewFile *.tex ab (()) \left( \right)
++"func Eatchar(pat)
++"	let c = nr2char(getchar())
++"	return (c =~ a:pat) ? '' : c
++"endfunc
++"au BufRead,BufNewFile *.html     iabbr <silent> H1 <h1></h1><Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.html     iabbr <silent> H2 <h2></h2><Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.html     iabbr <silent> H3 <h3></h3><Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.html     iabbr <silent> CO <code></code><Left><Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.html     iabbr <silent> PP <p></p><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.m        iabbr <silent> p1  disp('');<Left><Left><Left><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.m        iab <expr> p0  "disp('-------------- file: ".expand('%')." line: ".line(".")."');"
++"au BufRead,BufNewFile *.c*       iabbr <silent> p1  printf("\n");<Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.c*,*.h   iabbr <silent> ER  _error_("");<Left><Left><Left><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.c*       ab VV VecView(ug,PETSC_VIEWER_STDOUT_WORLD);
++"au BufRead,BufNewFile *.c*       ab AS _assert_();
++"au BufRead,BufNewFile *.c*       iab <expr> p0  "printf(\"-------------- file: ".expand('%')." line: %i\\n\",__LINE__);"
++"au BufRead,BufNewFile *.c*       iab <expr> pp0 "PetscSynchronizedPrintf(MPI_COMM_WORLD,\"-------------- file: ".expand('%')." line: %i\\n\",__LINE__);\nPetscSynchronizedFlush(MPI_COMM_WORLD);"
++""tex
++"au BufRead,BufNewFile *.tex iab EQ 
++"			\\begin{equation}
++"			\<CR>\end{equation}<up><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.tex iab IT 
++"			\\begin{itemize}
++"			\<CR>\item 
++"			\<CR>\end{itemize}<up><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.tex iab EN 
++"			\\begin{enumerate}
++"			\<CR>\item 
++"			\<CR>\end{enumerate}<up><C-R>=Eatchar('\s')<CR>
++"au BufRead,BufNewFile *.tex ab (()) \left( \right)
+ "}}}
+ " Skeletons {{{1
+ au BufNewFile letter.tex   0r ~/.vim/xtr/skeleton/letter.tex
+ "}}}
++" Copy and Paste{{{
++"vmap <C-c> y:call system("pbcopy", getreg("\""))<CR>
++"nmap <C-v> :call setreg("\"",system("pbpaste"))<CR>p
++"}}}
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libpng
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libpng	(revision 13343)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libpng	(revision 13344)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/libpng
+___________________________________________________________________
+Modified: svn:ignore
+## -1,2 +1,3 ##
++*.gz
+ src
+ install
Index: /issm/oecreview/Archive/12678-13393/ISSM-13344-13345.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13344-13345.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13344-13345.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin	(revision 13344)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin	(revision 13345)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/bin
+___________________________________________________________________
+Modified: svn:ignore
+## -11,3 +11,4 ##
+ *.bat
+ *.rtf
+ *.py
++*.mexmaci64
Index: /issm/oecreview/Archive/12678-13393/ISSM-13345-13346.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13345-13346.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13345-13346.diff	(revision 13394)
@@ -0,0 +1,11 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13345)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13346)
+@@ -262,3 +262,6 @@
+ 
+ YAMS_DIR="$ISSM_DIR/externalpackages/yams/install"
+ pathappend   "$YAMS_DIR"
++
++SWIG_DIR="$ISSM_DIR/externalpackages/swig/install"
++pathappend   "$SWIG_DIR"
Index: /issm/oecreview/Archive/12678-13393/ISSM-13346-13347.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13346-13347.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13346-13347.diff	(revision 13394)
@@ -0,0 +1,61 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matdamageice.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matdamageice.m	(revision 13346)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/matdamageice.m	(revision 13347)
+@@ -26,6 +26,16 @@
+ 			switch nargin
+ 				case 0
+ 					obj=setdefaultparameters(obj);
++				case 1
++					inputstruct=varargin{1};
++					list1 = properties('matdamageice');
++					list2 = fieldnames(inputstruct);
++					for i=1:length(list1)
++						fieldname = list1{i};
++						if ismember(fieldname,list2),
++							obj.(fieldname) = inputstruct.(fieldname);
++						end
++					end
+ 				otherwise
+ 					error('constructor not supported');
+ 			end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/oldclasses/materials.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/oldclasses/materials.m	(revision 13346)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/oldclasses/materials.m	(revision 13347)
+@@ -15,6 +15,7 @@
+ 		thermal_exchange_velocity  = 0.;
+ 		rheology_B   = NaN;
+ 		rheology_n   = NaN;
++		rheology_Z   = NaN;
+ 		rheology_law = '';
+ 	end
+ end
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13346)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.m	(revision 13347)
+@@ -73,16 +73,15 @@
+ 			 end
+ 
+ 			 %2012 August 4th
+-			 if isa(md.materials,'matice'),
+-				 disp('Recovering old matice');
+-				 md.materials=matice(md.materials);
++			 if isa(md.materials,'materials'),
++				 disp('Recovering old materials');
++				 if numel(md.materials.rheology_Z)==1 & isnan(md.materials.rheology_Z),
++					 md.materials=matice(md.materials);
++				 else
++					 md.materials=matdamageice(md.materials);
++				 end
+ 			 end
+ 
+-			 if isa(md.materials,'matdamageice'),
+-				 disp('Recovering old matdamageice');
+-				 md.materials=matdamageice(md.materials);
+-			 end
+-
+ 		 end% }}}
+ 	 end
+ 	 methods
Index: /issm/oecreview/Archive/12678-13393/ISSM-13347-13348.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13347-13348.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13347-13348.diff	(revision 13394)
@@ -0,0 +1,36 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-petscdev.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-petscdev.sh	(revision 13347)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-petscdev.sh	(revision 13348)
+@@ -1,7 +1,5 @@
+ #!/bin/sh
+ 
+-#External packages versions:
+-#petsc Dev: FH trying out
+ #mpich 1.4
+ 
+ ./configure \
+@@ -16,22 +14,16 @@
+  --with-petsc-arch=$ISSM_ARCH \
+  --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+  --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+- --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+- --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
+  --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+  --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+  --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+  --with-spai-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+  --with-hypre-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+- --with-prometheus-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+  --with-superlu-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+- --with-spooles-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+- --with-pastix-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+- --with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
+  --with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
+  --with-shapelib-dir="$ISSM_DIR/externalpackages/shapelib/install" \
+  --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" \
+  --with-graphics-lib=/usr/lib64/libX11.so \
+- --with-cxxoptflags="-march=opteron -O2" \
++ --with-cxxoptflags="-march=opteron -O3" \
+  --with-numthreads=32 \
+  --enable-debugging
Index: /issm/oecreview/Archive/12678-13393/ISSM-13348-13349.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13348-13349.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13348-13349.diff	(revision 13394)
@@ -0,0 +1,104 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13348)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13349)
+@@ -263,6 +263,7 @@
+ 	ResultsEnum,
+ 	/*}}}*/
+ 	/*Objects {{{1*/
++	GenericParamEnum,
+ 	AdolcParamEnum,
+ 	BoolInputEnum,
+ 	BoolParamEnum,
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13348)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13349)
+@@ -267,6 +267,7 @@
+ 	      else if (strcmp(name,"Parameters")==0) return ParametersEnum;
+ 	      else if (strcmp(name,"Vertices")==0) return VerticesEnum;
+ 	      else if (strcmp(name,"Results")==0) return ResultsEnum;
++	      else if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
+ 	      else if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
+ 	      else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
+ 	      else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
+@@ -382,11 +383,11 @@
+ 	      else if (strcmp(name,"Vy")==0) return VyEnum;
+ 	      else if (strcmp(name,"VyPicard")==0) return VyPicardEnum;
+ 	      else if (strcmp(name,"Vz")==0) return VzEnum;
+-	      else if (strcmp(name,"VzMacAyeal")==0) return VzMacAyealEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"VzPattyn")==0) return VzPattynEnum;
++	      if (strcmp(name,"VzMacAyeal")==0) return VzMacAyealEnum;
++	      else if (strcmp(name,"VzPattyn")==0) return VzPattynEnum;
+ 	      else if (strcmp(name,"VzPicard")==0) return VzPicardEnum;
+ 	      else if (strcmp(name,"VzStokes")==0) return VzStokesEnum;
+ 	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13348)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13349)
+@@ -260,6 +260,7 @@
+ 		case ParametersEnum : return "Parameters";
+ 		case VerticesEnum : return "Vertices";
+ 		case ResultsEnum : return "Results";
++		case GenericParamEnum : return "GenericParam";
+ 		case AdolcParamEnum : return "AdolcParam";
+ 		case BoolInputEnum : return "BoolInput";
+ 		case BoolParamEnum : return "BoolParam";
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/GenericParamEnum.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/GenericParamEnum.m	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/GenericParamEnum.m	(revision 13349)
+@@ -0,0 +1,11 @@
++function macro=GenericParamEnum()
++%GENERICPARAMENUM - Enum of GenericParam
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
++%            Please read src/c/EnumDefinitions/README for more information
++%
++%   Usage:
++%      macro=GenericParamEnum()
++
++macro=StringToEnum('GenericParam');
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13348)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13349)
+@@ -8,4 +8,4 @@
+ %   Usage:
+ %      macro=MaximumNumberOfEnums()
+ 
+-macro=473;
++macro=474;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13348)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13349)
+@@ -2448,6 +2448,16 @@
+ 
+ 	return StringToEnum('Results')[0]
+ 
++def GenericParamEnum():
++	"""
++	GENERICPARAMENUM - Enum of GenericParam
++
++	   Usage:
++	      macro=GenericParamEnum()
++	"""
++
++	return StringToEnum('GenericParam')[0]
++
+ def AdolcParamEnum():
+ 	"""
+ 	ADOLCPARAMENUM - Enum of AdolcParam
+@@ -4746,5 +4756,5 @@
+ 	      macro=MaximumNumberOfEnums()
+ 	"""
+ 
+-	return 473
++	return 474
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13349-13350.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13349-13350.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13349-13350.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13349)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/scripts/report.sh	(revision 13350)
+@@ -78,7 +78,7 @@
+ if [ $IS_INSTALL -eq 0 ]; then
+ 	cat << END >> report.html
+ 	<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
+-	<tr><td $BODY_FONTC>Status: <span style=\"color:#ff0000\">Installation failed</span></td></tr>
++	<tr><td $BODY_FONTC>Status: <span style="color:#ff0000">Installation failed</span></td></tr>
+ 	</table>
+ 	<table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table>
+ 	</div>
Index: /issm/oecreview/Archive/12678-13393/ISSM-13350-13351.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13350-13351.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13350-13351.diff	(revision 13394)
@@ -0,0 +1,103 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.m	(revision 13350)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.m	(revision 13351)
+@@ -1,4 +1,4 @@
+-function bool=SegIntersect(seg1,seg2)
++function bval=SegIntersect(seg1,seg2)
+ %SEGINTERSECT - test of segments intersection
+ %
+ %   return 1 if the two segments intersect
+@@ -6,28 +6,28 @@
+ %   seg2=[x1 y1; x2 y2]
+ %
+ %   Usage:
+-%      bool=SegIntersect(seg1,seg2)
++%      bval=SegIntersect(seg1,seg2)
+ 
+-bool=1;
++bval=1;
+ 
+ xA=seg1(1,1); yA=seg1(1,2);
+ xB=seg1(2,1); yB=seg1(2,2);
+ xC=seg2(1,1); yC=seg2(1,2);
+ xD=seg2(2,1); yD=seg2(2,2);
+ 
+-O2A=[xA;yA]-[xD/2+xC/2;yD/2+yC/2];
+-O2B=[xB;yB]-[xD/2+xC/2;yD/2+yC/2];
+-O1C=[xC;yC]-[xA/2+xB/2;yB/2+yA/2];
+-O1D=[xD;yD]-[xA/2+xB/2;yB/2+yA/2];
++O2A=[xA;yA]-[xD/2.+xC/2.;yD/2.+yC/2.];
++O2B=[xB;yB]-[xD/2.+xC/2.;yD/2.+yC/2.];
++O1C=[xC;yC]-[xA/2.+xB/2.;yB/2.+yA/2.];
++O1D=[xD;yD]-[xA/2.+xB/2.;yB/2.+yA/2.];
+ 
+ n1=[yA-yB;xB-xA]; %normal vector to segA
+-n2=[yC-yD;xD-xC]; %normal vectot to segB
++n2=[yC-yD;xD-xC]; %normal vector to segB
+ 
+ test1=n2'*O2A;
+ test2=n2'*O2B;
+ 
+ if test1*test2>0
+-	bool=0;
++	bval=0;
+ 	return;
+ end
+ 
+@@ -35,7 +35,7 @@
+ test4=n1'*O1D;
+ 
+ if test3*test4>0
+-	bool=0;
++	bval=0;
+ 	return;
+ end
+ 
+@@ -43,37 +43,37 @@
+ if test1*test2==0 & test3*test4==0 & det([n1 n2])==0
+ 
+ 	%projection on the axis O1O2
+-	O2O1=[xA/2+xB/2;yB/2+yA/2]-[xD/2+xC/2;yD/2+yC/2];
++	O2O1=[xA/2.+xB/2.;yB/2.+yA/2.]-[xD/2.+xC/2.;yD/2.+yC/2.];
+ 	O1A=O2O1'*(O2A-O2O1);
+ 	O1B=O2O1'*(O2B-O2O1);
+ 	O1C=O2O1'*O1C;
+ 	O1D=O2O1'*O1D;
+ 	
+-	%test if one point is included in the other segment (->bool=1)
++	%test if one point is included in the other segment (->bval=1)
+ 	if (O1C-O1A)*(O1D-O1A)<0
+-		bool=1;
++		bval=1;
+ 		return;
+ 	end
+ 	if (O1C-O1B)*(O1D-O1B)<0
+-		bool=1;
++		bval=1;
+ 		return;
+ 	end
+ 	if (O1A-O1C)*(O1B-O1C)<0
+-		bool=1;
++		bval=1;
+ 		return;
+ 	end
+ 	if (O1A-O1D)*(O1B-O1D)<0
+-		bool=1;
++		bval=1;
+ 		return;
+ 	end
+ 
+-	 %test if the 2 segments have the same middle (->bool=1)
++	 %test if the 2 segments have the same middle (->bval=1)
+ 	if O2O1==0
+-		bool=1;
++		bval=1;
+ 		return;
+ 	end
+ 
+ 	%else
+-	bool=0;
++	bval=0;
+ 	return;
+ end
Index: /issm/oecreview/Archive/12678-13393/ISSM-13351-13352.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13351-13352.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13351-13352.diff	(revision 13394)
@@ -0,0 +1,88 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.py	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/geometry/SegIntersect.py	(revision 13352)
+@@ -0,0 +1,83 @@
++import numpy
++from MatlabFuncs import *
++
++def SegIntersect(seg1,seg2):
++	"""
++	SEGINTERSECT - test of segments intersection
++
++	   return 1 if the two segments intersect
++	   seg1=[x1 y1; x2 y2]
++	   seg2=[x1 y1; x2 y2]
++
++	   Usage:
++	      bval=SegIntersect(seg1,seg2)
++	"""
++
++	bval=1
++
++	xA=seg1[0,0]
++	yA=seg1[0,1]
++	xB=seg1[1,0]
++	yB=seg1[1,1]
++	xC=seg2[0,0]
++	yC=seg2[0,1]
++	xD=seg2[1,0]
++	yD=seg2[1,1]
++
++	O2A=numpy.array([xA,yA])-numpy.array([xD/2.+xC/2.,yD/2.+yC/2.])
++	O2B=numpy.array([xB,yB])-numpy.array([xD/2.+xC/2.,yD/2.+yC/2.])
++	O1C=numpy.array([xC,yC])-numpy.array([xA/2.+xB/2.,yB/2.+yA/2.])
++	O1D=numpy.array([xD,yD])-numpy.array([xA/2.+xB/2.,yB/2.+yA/2.])
++
++	n1=numpy.array([yA-yB,xB-xA])    #normal vector to segA
++	n2=numpy.array([yC-yD,xD-xC])    #normal vector to segB
++
++	test1=numpy.dot(n2,O2A)
++	test2=numpy.dot(n2,O2B)
++
++	if test1*test2>0:
++		bval=0
++		return bval
++
++	test3=numpy.dot(n1,O1C)
++	test4=numpy.dot(n1,O1D)
++
++	if test3*test4>0:
++		bval=0
++		return bval
++
++	#if colinear
++	if test1*test2==0 and test3*test4==0 and det(numpy.hstack((n1.reshape((-1,1)),n2.reshape(-1,1))))==0:
++
++		#projection on the axis O1O2
++		O2O1=numpy.array([xA/2.+xB/2.,yB/2.+yA/2.])-numpy.array([xD/2.+xC/2.,yD/2.+yC/2.])
++		O1A=numpy.dot(O2O1,(O2A-O2O1))
++		O1B=numpy.dot(O2O1,(O2B-O2O1))
++		O1C=numpy.dot(O2O1,O1C)
++		O1D=numpy.dot(O2O1,O1D)
++
++		#test if one point is included in the other segment (->bval=1)
++		if (O1C-O1A)*(O1D-O1A)<0:
++			bval=1
++			return bval
++		if (O1C-O1B)*(O1D-O1B)<0:
++			bval=1
++			return bval
++		if (O1A-O1C)*(O1B-O1C)<0:
++			bval=1
++			return bval
++		if (O1A-O1D)*(O1B-O1D)<0:
++			bval=1
++			return bval
++
++		#test if the 2 segments have the same middle (->bval=1)
++		if O2O1==0:
++			bval=1
++			return bval
++
++		#else
++		bval=0
++		return bval
++
++	return bval
++
Index: /issm/oecreview/Archive/12678-13393/ISSM-13352-13353.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13352-13353.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13352-13353.diff	(revision 13394)
@@ -0,0 +1,247 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13352)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13353)
+@@ -608,7 +608,7 @@
+ 	*pbamgopts=bamgopts;
+ }
+ /*}}}*/
+-/*FUNCTION FetchData(Options** poptions,const mxArray* dataref){{{*/
++/*FUNCTION FetchData(Options** poptions,const mxArray** pdataref){{{*/
+ void FetchData(Options** poptions,int istart, int nrhs,const mxArray** pdataref){
+ 
+ 	char   *name   = NULL;
+@@ -633,3 +633,50 @@
+ 	*poptions=options;
+ }
+ /*}}}*/
++/*FUNCTION FetchData(DataSet** pcontours,const mxArray* dataref){{{*/
++void FetchData(DataSet** pcontours,const mxArray* dataref){
++
++	int              numcontours,index,test1,test2;
++	char            *contourname = NULL;
++	DataSet         *contours    = NULL;
++	Contour<double> *contouri    = NULL;
++
++	if (mxIsClass(dataref,"char")){
++		FetchData(&contourname,dataref);
++		contours=DomainOutlineRead<double>(contourname);
++	}
++	else if(mxIsClass(dataref,"struct")){
++
++		contours=new DataSet(0);
++		numcontours=mxGetNumberOfElements(dataref);
++
++		for(int i=0;i<numcontours;i++){
++
++			contouri=xNew<Contour<double> >(1);
++
++			index = mxGetFieldNumber(dataref,"nods");
++			if(index==-1) _error_("input structure does not have a 'nods' field");
++			FetchData(&contouri->nods,mxGetFieldByNumber(dataref,i,index));
++
++			index = mxGetFieldNumber(dataref,"x");
++			if(index==-1) _error_("input structure does not have a 'x' field");
++			FetchData(&contouri->x,&test1,&test2,mxGetFieldByNumber(dataref,i,index));
++			if(test1!=contouri->nods || test2!=1) _error_("field x should be of size ["<<contouri->nods<<" 1]");
++
++			index = mxGetFieldNumber(dataref,"y");
++			if(index==-1) _error_("input structure does not have a 'y' field");
++			FetchData(&contouri->y,&test1,&test2,mxGetFieldByNumber(dataref,i,index));
++			if(test1!=contouri->nods || test2!=1) _error_("field y should be of size ["<<contouri->nods<<" 1]");
++
++			contours->AddObject(contouri);
++		}
++	}
++	else{
++		_error_("Contour is neither a string nor a structure and cannot be loaded ("<<mxGetClassName(dataref)<<" not supported)");
++	}
++
++	/*clean-up and assign output pointer*/
++	xDelete<char>(contourname);
++	*pcontours=contours;
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 13352)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/matlabio.h	(revision 13353)
+@@ -48,6 +48,7 @@
+ void FetchData(BamgMesh** bamgmesh,const mxArray* dataref);
+ void FetchData(BamgOpts** bamgopts,const mxArray* dataref);
+ void FetchData(Options** poptions,int istart, int nrhs,const mxArray** pdataref);
++void FetchData(DataSet** pcontours,const mxArray* dataref);
+ 
+ Option* OptionParse(char* name, const mxArray* prhs[]);
+ GenericOption<double>*    OptionDoubleParse( char* name, const mxArray* prhs[]);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13352)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13353)
+@@ -34,6 +34,7 @@
+ void FetchData(BamgMesh** bamgmesh,PyObject* py_dict);
+ void FetchData(BamgOpts** bamgopts,PyObject* py_dict);
+ void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments);
++void FetchData(DataSet** pcontours,PyObject* py_dict);
+ 
+ int CheckNumPythonArguments(PyObject* inputs,int NRHS, void (*function)( void ));
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13352)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13353)
+@@ -234,7 +234,13 @@
+ 
+ }
+ /*}}}*/
++/*FUNCTION FetchData(DataSet** pcontours,PyObject* py_dict){{{*/
++void FetchData(DataSet** pcontours,PyObject* py_dict){
+ 
++	_error_("not supported yet");
++}
++/*}}}*/
++
+ /*Python version dependent: */
+ #if _PYTHON_MAJOR_ >= 3 
+ /*FUNCTION FetchData(char** pstring,PyObject* py_unicode){{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13352)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13353)
+@@ -174,14 +174,14 @@
+ DataSet* DomainOutlineRead(char* domainname){
+ 
+ 	/*intermediary: */
+-	int       nprof;
+-	int      *profnvertices = NULL;
+-	doubletype  **pprofx        = NULL;
+-	doubletype  **pprofy        = NULL;
+-	Contour<doubletype>* contour       = NULL;
++	int                  nprof;
++	int                 *profnvertices = NULL;
++	doubletype         **pprofx        = NULL;
++	doubletype         **pprofy        = NULL;
++	Contour<doubletype> *contour       = NULL;
+ 
+ 	/*output: */
+-	DataSet* domain=NULL;
++	DataSet *domain = NULL;
+ 
+ 	/*If domainname is an empty string, return empty dataset*/
+ 	if (strcmp(domainname,"")==0){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 13352)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 13353)
+@@ -11,7 +11,6 @@
+ #include "../Exceptions/exceptions.h"
+ 
+ int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname){
+-
+ 	
+ 	/*Error management: */
+ 	int noerr=1;
+@@ -55,4 +54,3 @@
+ 	cleanupandreturn: 
+ 	return noerr;
+ }
+-
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13352)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13353)
+@@ -35,9 +35,8 @@
+ 	/*Fetch inputs: */
+ 	FetchData(&x,&nods,NULL,XHANDLE);
+ 	FetchData(&y,NULL,NULL,YHANDLE);
+-	FetchData(&edgevalue,EDGEVALUEHANDLE);
+-	FetchData(&contourname,CONTOURNAME);
+-	contours=DomainOutlineRead<double>(contourname);
++	FetchData(&edgevalue,EDGEVALUE);
++	FetchData(&contours,CONTOUR);
+ 
+ 	/*Run x layer */
+ 	ContourToNodesx(&flags,x,y,nods,contours,edgevalue);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13352)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13353)
+@@ -27,10 +27,10 @@
+ 
+ #ifdef _HAVE_MATLAB_MODULES_
+ /* input macros: */
+-#define XHANDLE         prhs[0]
+-#define YHANDLE         prhs[1]
+-#define CONTOURNAME     prhs[2]
+-#define EDGEVALUEHANDLE prhs[3]
++#define XHANDLE   prhs[0]
++#define YHANDLE   prhs[1]
++#define CONTOUR   prhs[2]
++#define EDGEVALUE prhs[3]
+ 
+ /* serial output macros: */
+ #define FLAGS (mxArray**)&plhs[0]
+@@ -38,10 +38,10 @@
+ 
+ #ifdef _HAVE_PYTHON_MODULES_
+ /* input macros: */
+-#define XHANDLE         PyTuple_GetItem(args,0)
+-#define YHANDLE         PyTuple_GetItem(args,1)
+-#define CONTOURNAME     PyTuple_GetItem(args,2)
+-#define EDGEVALUEHANDLE PyTuple_GetItem(args,3)
++#define XHANDLE   PyTuple_GetItem(args,0)
++#define YHANDLE   PyTuple_GetItem(args,1)
++#define CONTOUR   PyTuple_GetItem(args,2)
++#define EDGEVALUE PyTuple_GetItem(args,3)
+ 
+ /* serial output macros: */
+ #define FLAGS output,0
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/bamg.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/bamg.m	(revision 13352)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/mesh/bamg.m	(revision 13353)
+@@ -65,9 +65,6 @@
+ 	if ~exist(domainfile,'file') error(['bamg error message: file ' domainfile ' not found ']); end
+ 	domain=expread(domainfile);
+ 
+-	%Write temporary file, with only the domain outline (exclude holes)
+-	expwrite(domain(1),[domainfile '_TEMPouterboundary.exp']);
+-
+ 	%Build geometry 
+ 	count=0;
+ 	for i=1:length(domain),
+@@ -79,7 +76,7 @@
+ 
+ 		%Checks that all holes are INSIDE the principle domain outline
+ 		if i>1,
+-			flags=ContourToNodes(domain(i).x,domain(i).y,[domainfile '_TEMPouterboundary.exp'],0);
++			flags=ContourToNodes(domain(i).x,domain(i).y,domain(1),0);
+ 			if any(~flags),
+ 				error('bamg error message: All holes should be stricly inside the principal domain');
+ 			end
+@@ -108,7 +105,7 @@
+ 		for i=1:length(rift),
+ 
+ 			%detect wether all points of the rift are inside the domain
+-			flags=ContourToNodes(rift(i).x,rift(i).y,[domainfile '_TEMPouterboundary.exp'],0);
++			flags=ContourToNodes(rift(i).x,rift(i).y,domain(1),0);
+ 			if ~flags,
+ 				error('one Rift has all his points outside of the domain outline'),
+ 
+@@ -240,7 +237,7 @@
+ 		if(size(requiredvertices,2)==2), requiredvertices=[requiredvertices 4*ones(size(requiredvertices,1),1)]; end
+ 	
+ 		%only keep those inside
+-		flags=ContourToNodes(requiredvertices(:,1),requiredvertices(:,2),[domainfile '_TEMPouterboundary.exp'],0);
++		flags=ContourToNodes(requiredvertices(:,1),requiredvertices(:,2),domain(1),0);
+ 		requiredvertices=requiredvertices(find(flags),:);
+ 
+ 		%Add all points to bamg_geometry
+@@ -254,7 +251,6 @@
+ 
+ 	%process geom
+ 	%bamg_geometry=processgeometry(bamg_geometry,getfieldvalue(options,'tol',NaN),domain(1));
+-	delete([domainfile '_TEMPouterboundary.exp']);
+ 
+ elseif isstruct(md.private.bamg) & isfield(md.private.bamg,'geometry'),
+ 	bamg_geometry=bamggeom(md.private.bamg.geometry); 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13353-13354.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13353-13354.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13353-13354.diff	(revision 13394)
@@ -0,0 +1,43 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh	(revision 13353)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh	(revision 13354)
+@@ -3,18 +3,30 @@
+ pythonversion=2.7
+ PYTHON=python${pythonversion}
+ 
++export C_INCLUDE_PATH="$C_INCLUDE_PATH:/usr/include/c++/4.2.1"
+ export GIT_SSL_NO_VERIFY=true 
+-export CC="gcc -fPIC"
+-export CXX="g++ -fPIC"
+-export F77="gfortran -fPIC"
+-export FC="gfortran -fPIC"
+-export FFLAGS=-ff2c
++export CC="gcc -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
++export CXX="g++ -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
++export F77="gfortran -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
++export FC="gfortran -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
++export FFLAGS="-ff2c -arch x86_64 -I/usr/include/c++/4.2.1"
++export ARCHFLAGS="-arch x86_64 -I/usr/include/c++/4.2.1"
+ 
+ 
++
+ git clone https://github.com/matplotlib/matplotlib
+ mv matplotlib src
+ mkdir deps
+ cd src
+-exit
+-make -f make.osx PREFIX=$ISSM_DIR/externalpackages/matplotlib/deps PYVERSION=$pythonversion fetch deps mpl_install_std
+-${PYTHON} -c "import matplotlib; print 'Installed matplotlib', matplotlib.__version__, matplotlib.__file__"
++
++#only try this if the classic python setup.py build approach does not work. The approach in the next 3 lines can 
++#trigger issues of permissions with freetype. Sometimes it is better to independently install freetype2 (from the 
++#issm externalpackages) as sudo (or root), so that the python script can detect its existence automatically.
++#sudo make -f make.osx PREFIX=$ISSM_DIR/externalpackages/matplotlib/deps PYVERSION=$pythonversion fetch deps mpl_install_std
++#sudo make -f make.osx PREFIX=$ISSM_DIR/externalpackages/matplotlib/deps PYVERSION=$pythonversion mpl_install_std
++#${PYTHON} -c "import matplotlib; print 'Installed matplotlib', matplotlib.__version__, matplotlib.__file__"
++
++
++#to be tried:  first get freetype and  zlib and libpng installed in sudo mode
++python setup.py build
++python setup.py install
Index: /issm/oecreview/Archive/12678-13393/ISSM-13354-13355.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13354-13355.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13354-13355.diff	(revision 13394)
@@ -0,0 +1,81 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13354)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h	(revision 13355)
+@@ -35,7 +35,7 @@
+ #define INDEX       prhs[0]
+ #define X           prhs[1]
+ #define Y           prhs[2]
+-#define CONTOURNAME prhs[3]
++#define CONTOUR     prhs[3]
+ #define INTERPTYPE  prhs[4]
+ #define EDGEVALUE   prhs[5]
+ /* serial output macros: */
+@@ -48,7 +48,7 @@
+ #define INDEX       PyTuple_GetItem(args,0)
+ #define X           PyTuple_GetItem(args,1)
+ #define Y           PyTuple_GetItem(args,2)
+-#define CONTOURNAME PyTuple_GetItem(args,3)
++#define CONTOUR     PyTuple_GetItem(args,3)
+ #define INTERPTYPE  PyTuple_GetItem(args,4)
+ #define EDGEVALUE   PyTuple_GetItem(args,5)
+ /* serial output macros: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13354)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13355)
+@@ -36,7 +36,6 @@
+ 	int      nods;
+ 	double  *y           = NULL;
+ 	char    *interptype  = NULL;
+-	char    *contourname = NULL;
+ 	DataSet *contours    = NULL;
+ 
+ 	/* output: */
+@@ -64,10 +63,7 @@
+ 	FetchData(&x,&nods,NULL,X);
+ 	FetchData(&y,NULL,NULL,Y);
+ 	FetchData(&edgevalue,EDGEVALUE);
+-	FetchData(&contourname,CONTOURNAME);
+-	contours=DomainOutlineRead<double>(contourname);
+-
+-	/*Fetch  interptype: */
++	FetchData(&contours,CONTOUR);
+ 	FetchData(&interptype,INTERPTYPE);
+ 
+ 	/*Run interpolation routine: */
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 13354)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 13355)
+@@ -15,12 +15,8 @@
+ }/*}}}*/
+ WRAPPER(TriMesh){
+ 	
+-	/* input: */
+-	char   *domainname = NULL;
+-	char   *riftsname  = NULL;
++	/*intermediary: */
+ 	double  area;
+-
+-	/*intermediary: */
+ 	DataSet *domain = NULL;
+ 	DataSet *rifts  = NULL;
+ 
+@@ -38,14 +34,10 @@
+ 	CHECKARGUMENTS(NLHS,NRHS,&TriMeshUsage);
+ 	
+ 	/*Fetch data needed for meshing: */
+-	FetchData(&domainname,DOMAINOUTLINE);
+-	FetchData(&riftsname,RIFTSOUTLINE);
++	FetchData(&domain,DOMAINOUTLINE);
++	FetchData(&rifts,RIFTSOUTLINE);
+ 	FetchData(&area,AREA);
+ 
+-	/*Read domain outline: */
+-	domain = DomainOutlineRead<double>(domainname);
+-	rifts  = DomainOutlineRead<double>(riftsname);
+-
+ 	/*call x core: */
+ 	TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain,rifts,area);
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13355-13356.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13355-13356.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13355-13356.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13355)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/m4/issm_options.m4	(revision 13356)
+@@ -392,7 +392,7 @@
+ 	if test -d "$PYTHON_NUMPY_ROOT"; then
+ 		dnl defaults
+ 		HAVE_PYTHON_NUMPY=yes
+-		PYTHON_NUMPYINCL=-I$PYTHON_NUMPY_ROOT
++		PYTHON_NUMPYINCL="-I$PYTHON_NUMPY_ROOT -I$PYTHON_NUMPY_ROOT/core/include/numpy"
+ 
+ 		AC_DEFINE([_HAVE_PYTHON_NUMPY_],[1],[with Python-Numpy in ISSM src])
+ 		AC_SUBST([PYTHON_NUMPYINCL])
Index: /issm/oecreview/Archive/12678-13393/ISSM-13356-13357.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13356-13357.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13356-13357.diff	(revision 13394)
@@ -0,0 +1,92 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13356)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/exp.h	(revision 13357)
+@@ -69,26 +69,24 @@
+ 	double  ddummy;
+ 
+ 	/*output: */
+-	int      nprof;                //number of profiles in the domainname file
+-	int     *profnvertices = NULL; //array holding the number of vertices for the nprof profiles
++	int          nprof;                //number of profiles in the domainname file
++	int         *profnvertices = NULL; //array holding the number of vertices for the nprof profiles
+ 	doubletype **pprofx        = NULL; //array of profiles x coordinates
+ 	doubletype **pprofy        = NULL; //array of profiles y coordinates
+-	bool    *closed        = NULL; //array holding closed flags for the nprof profiles
++	bool        *closed        = NULL; //array holding closed flags for the nprof profiles
+ 
+ 	/*For each profile: */
+-	int     n;
++	int         n;
+ 	doubletype *x  = NULL;
+ 	doubletype *y  = NULL;
+-	double  xi,yi;
+-	bool    cl;
++	bool        cl;
+ 
+ 	/*open domain outline file for reading: */
+ 	if ((fid=fopen(domainname,"r"))==NULL){
+ 		_error_("could not find domain file " << domainname); 
+ 	}
+ 
+-	/*Do a first pass through the domainname file, to figure out how many profiles 
+-	 *we need to read: */
++	/*Do a first pass through the domainname file, to figure out how many profiles we need to read: */
+ 	nprof=1;
+ 	for(;;){
+ 		fscanf(fid,"%256s %256s\n",chardummy,chardummy);
+@@ -96,23 +94,19 @@
+ 		fscanf(fid,"%256s %256s %256s %256s\n",chardummy,chardummy,chardummy,chardummy);
+ 		fscanf(fid,"%20u %256s\n",&n,chardummy);
+ 		fscanf(fid,"%256s %256s %256s %256s %256s\n",chardummy,chardummy,chardummy,chardummy,chardummy);
+-		for (i=0;i<n;i++){
+-			fscanf(fid,"%20lf %20lf\n",&ddummy,&ddummy);
+-		}
+-		/*Ok, we have faked one profile reading, check whether we are at the end of the file, otherwise, keep fake reading next profile:*/
+-		if (feof(fid)){
+-			break;
+-		}
++		for (i=0;i<n;i++) fscanf(fid,"%20lf %20lf\n",&ddummy,&ddummy);
++		/*check whether we are at the end of the file, otherwise, keep reading next profile:*/
++		if (feof(fid)) break;
+ 		nprof++;
+ 	}
+ 	
+ 	/*Allocate and initialize all the profiles: */
+-	profnvertices=xNew<int>(nprof);
+-	pprofx=xNew<doubletype*>(nprof);
+-	pprofy=xNew<doubletype*>(nprof);
++	profnvertices = xNew<int>(nprof);
++	pprofx        = xNew<doubletype*>(nprof);
++	pprofy        = xNew<doubletype*>(nprof);
+ 	for (i=0;i<nprof;i++){
+-		pprofx[i]=NULL;
+-		pprofy[i]=NULL;
++		pprofx[i] = NULL;
++		pprofy[i] = NULL;
+ 	}
+ 	closed=xNew<bool>(nprof);
+ 
+@@ -139,8 +133,7 @@
+ 		
+ 		/*Read vertices: */
+ 		for (i=0;i<n;i++){
+-			fscanf(fid,"%20lf %20lf\n",&xi,&yi);
+-			x[i]=xi; y[i]=yi;
++			fscanf(fid,"%20lf %20lf\n",&x[i],&y[i]);
+ 		}
+ 
+ 		/*Now check that we are dealing with open contours: */
+@@ -164,10 +157,8 @@
+ 	*pprofnvertices=profnvertices;
+ 	*ppprofx=pprofx;
+ 	*ppprofy=pprofy;
+-	if(pclosed)
+-	 *pclosed=closed;
+-	else
+-	 xDelete<bool>(closed);
++	if(pclosed) *pclosed=closed;
++	else         xDelete<bool>(closed);
+ } /*}}}*/
+ /*DataSet* DomainOutlineRead(char* domainname){{{*/
+ template <class doubletype>
Index: /issm/oecreview/Archive/12678-13393/ISSM-13357-13358.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13357-13358.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13357-13358.diff	(revision 13394)
@@ -0,0 +1,89 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-chris-bothapis.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-chris-bothapis.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-chris-bothapis.sh	(revision 13358)
+@@ -0,0 +1,33 @@
++#!/bin/sh
++
++#petsc 3.2
++#mpich 1.4
++
++pythonversion=2.7
++
++./configure \
++	--prefix=$ISSM_DIR \
++	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
++	--with-matlab-dir=$MATLAB_DIR \
++	--with-python-dir=$ISSM_DIR/externalpackages/python/install\
++	--with-python-version=$pythonversion \
++	--with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy\
++	--with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
++	--with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
++	--with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
++	--with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install \
++	--with-fortran-lib="/usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2/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-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--with-numthreads=8
++	#--with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
++	#--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
++	#--with-boost-dir=$ISSM_DIR/externalpackages/boost/install/ \
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-chris-bothapis.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-chris-python.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-chris-python.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-chris-python.sh	(revision 13358)
+@@ -0,0 +1,34 @@
++#!/bin/sh
++
++#petsc 3.2
++#mpich 1.4
++
++pythonversion=2.7
++
++./configure \
++	--prefix=$ISSM_DIR \
++	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
++	--with-python-dir=$ISSM_DIR/externalpackages/python/install\
++	--with-python-version=$pythonversion \
++	--with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/lib/python$pythonversion/site-packages/numpy/core/include/numpy\
++	--with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
++	--with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
++	--with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
++	--with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install \
++	--with-fortran-lib="/usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2/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-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
++	--with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
++	--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--with-numthreads=8
++	#--with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
++	#--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
++	#--with-boost-dir=$ISSM_DIR/externalpackages/boost/install/ \
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-chris-python.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13358-13359.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13358-13359.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13358-13359.diff	(revision 13394)
@@ -0,0 +1,11 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/lib
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/lib	(revision 13358)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/lib	(revision 13359)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/lib
+___________________________________________________________________
+Modified: svn:ignore
+## -1 +1,2 ##
+ *.mexa64
++*.mexmaci64
Index: /issm/oecreview/Archive/12678-13393/ISSM-13359-13360.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13359-13360.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13359-13360.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13359)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py	(revision 13360)
+@@ -140,7 +140,7 @@
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("timestepping","[%s,%s]" % ("1x1",obj.timestepping.__class__.__name__),"time stepping for transient models"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("initialization","[%s,%s]" % ("1x1",obj.initialization.__class__.__name__),"initial guess/state"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("rifts","[%s,%s]" % ("1x1",obj.rifts.__class__.__name__),"rifts properties"))
+-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("debug","[%s,%s]" % ("1x1",obj.debug.__class__.__name__),"debugging tools (valgrind, gprof"))
++		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("debug","[%s,%s]" % ("1x1",obj.debug.__class__.__name__),"debugging tools (valgrind, gprof)"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("verbose","[%s,%s]" % ("1x1",obj.verbose.__class__.__name__),"verbosity level in solve"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("settings","[%s,%s]" % ("1x1",obj.settings.__class__.__name__),"settings properties"))
+ 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("solver","[%s,%s]" % ("1x1",obj.solver.__class__.__name__),"PETSc options for each solution"))
Index: /issm/oecreview/Archive/12678-13393/ISSM-13360-13361.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13360-13361.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13360-13361.diff	(revision 13394)
@@ -0,0 +1,26 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13360)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13361)
+@@ -72,10 +72,6 @@
+ int EDF_fos_forward_for_solverx(int n, IssmPDouble *inVal, IssmPDouble *inDeriv, int m, IssmPDouble *outVal, IssmPDouble *outDeriv) { /*{{{*/
+ #ifdef _HAVE_GSL_
+   // the matrix will be modified by LU decomposition. Use gsl_A copy
+-  for (int i=0; i<m*m; ++i)
+-    std::cout << "EDF_fos_forward_for_solverx A["<< i << "]=" << inVal[i] << std::endl;
+-  for (int i=0; i<m; ++i)
+-    std::cout << "EDF_fos_forward_for_solverx b["<< i << "]=" << inVal[i+m*m] << std::endl;
+   double* Acopy = xNew<double>(m*m);
+   xMemCpy(Acopy,inVal,m*m);
+   /*Initialize gsl matrices and vectors: */
+@@ -186,10 +182,6 @@
+ 	gsl_vector      *x = NULL;
+ 	gsl_permutation *p = NULL;
+ 	/*A will be modified by LU decomposition. Use copy*/
+-	for (int i=0; i<n*n; ++i)
+-	  std::cout << "SolverxSeq A["<< i << "]=" << A[i] << std::endl;
+-	for (int i=0; i<n; ++i)
+-	  std::cout << "SolverxSeq b["<< i << "]=" << B[i] << std::endl;
+ 	double* Acopy = xNew<double>(n*n);
+ 	xMemCpy(Acopy,A,n*n);
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13361-13362.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13361-13362.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13361-13362.diff	(revision 13394)
@@ -0,0 +1,22 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13361)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13362)
+@@ -2,7 +2,6 @@
+  * \brief: compute outputs from the AD mode,  using our dependents and independents, and drivers available in Adolc.
+  */
+ 
+-#include <iostream>
+ #include "../../modules/modules.h"
+ #include "../../shared/shared.h"
+ #include "../../include/include.h"
+@@ -65,9 +64,6 @@
+ 			tangentDir[anIndepNum]=1.0;
+ 			double *theJacVecProduct=xNew<double>(num_dependents);
+ 			double *theOutput=xNew<double>(num_dependents);
+-			for (int i=0; i<num_independents; ++i) {
+-				std::cout << "fos_forward xp[" << i << "]=" << xp[i] << std::endl;
+-			}
+ 			if (fos_forward(1,num_dependents,num_independents, 0, xp, tangentDir, theOutput, theJacVecProduct ))
+ 				_error_("fos_forward returned non-zero error code");
+ 			results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,theJacVecProduct,num_dependents,1,1,0.0));
Index: /issm/oecreview/Archive/12678-13393/ISSM-13362-13363.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13362-13363.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13362-13363.diff	(revision 13394)
@@ -0,0 +1,86 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/include/python_macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/include/python_macros.h	(revision 13362)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/include/python_macros.h	(revision 13363)
+@@ -19,14 +19,24 @@
+ 
+ /*The following macros hide the error exception handling in a matlab module. Just put 
+  * MODULEBOOT(); and MODULEEND(); at the beginning and end of a module, and c++ exceptions 
+- * will be trapped. Really nifty!*/
++ * will be trapped*/
++#define MODULEBOOT(); \
++	PyObject *output = PyTuple_New(NLHS);        \
++	int       nrhs   = (int)PyTuple_Size(args);  \
++	if(!output) return NULL;\
++	 try{ \
+ 
+-#define MODULEBOOT(); ModuleBoot();  \
+-	PyObject* output = PyTuple_New(NLHS); if (!output) return NULL;\
+-			int nrhs = (int)PyTuple_Size(args);
+-
+-#define MODULEEND();  ModuleEnd(); \
+-						 return output;
++#define MODULEEND(); }\
++  catch(ErrorException &exception){\
++	  PyErr_SetString(PyExc_TypeError,"ISSM Error"); \
++  } \
++	catch (exception &e){\
++		PyErr_SetString(PyExc_TypeError,exprintf("Standard exception: %s\n",e.what()));\
++	}\
++	catch(...){\
++		PyErr_SetString(PyExc_TypeError,"An unexpected error occurred");\
++	}\
++	return output;
+ //}}}
+ #if _PYTHON_MAJOR_ >=3
+ /* WRAPPER 3.2 {{{*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 13362)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 13363)
+@@ -38,7 +38,7 @@
+ 	return what_str.c_str();
+ }
+ 
+-void ErrorException::Report(){
++void ErrorException::Report() const{
+ 	extern int my_rank;
+ 	extern int num_procs;
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exceptions/exceptions.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exceptions/exceptions.h	(revision 13362)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exceptions/exceptions.h	(revision 13363)
+@@ -26,7 +26,7 @@
+ 	ErrorException(const string&  what_file,const string& what_function,int what_line,const string& what_arg);//UNIX
+ 	~ErrorException() throw();
+ 	virtual const char *what() const throw();
+-	void Report();
++	void Report() const;
+ 
+ };
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp	(revision 13362)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp	(revision 13363)
+@@ -254,14 +254,14 @@
+ 	int i,j,k;
+ 	int el1,el2;
+ 
+-	double* segments=NULL;
+-	double*    segmentmarkerlist=NULL;
++	double *segments          = NULL;
++	double *segmentmarkerlist = NULL;
+ 	int     nsegs;
+ 
+ 	/*Recover input: */
+-	segments=*psegments;
+-	segmentmarkerlist=*psegmentmarkerlist;
+-	nsegs=*pnsegs;
++	segments          = *psegments;
++	segmentmarkerlist = *psegmentmarkerlist;
++	nsegs             = *pnsegs;
+ 
+ 	/*Reallocate segments: */
+ 	segments         =xReNew<double>(segments,         nsegs*3,(nsegs+nriftsegs)*3);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13363-13364.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13363-13364.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13363-13364.diff	(revision 13394)
@@ -0,0 +1,22 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13363)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13364)
+@@ -93,7 +93,7 @@
+   for (int i=0; i<m; i++) {
+     r[i]=inDeriv[m*m+i]; // this is db[i]
+     for (int j=0;j<m; j++) {
+-      r[i]-=inDeriv[i*n+j]*outVal[j]; // this is dA[i][j]*x[j]
++      r[i]-=inDeriv[i*m+j]*outVal[j]; // this is dA[i][j]*x[j]
+     }
+   }
+   gsl_vector_view gsl_r=gsl_vector_view_array(r,m);
+@@ -133,7 +133,7 @@
+     for (int i=0; i<m; i++) {
+       r[i]=inDeriv[m*m+i][dir]; // this is db[i]
+       for (int j=0;j<m; j++) {
+-        r[i]-=inDeriv[i*n+j][dir]*outVal[j]; // this is dA[i][j]*x[j]
++        r[i]-=inDeriv[i*m+j][dir]*outVal[j]; // this is dA[i][j]*x[j]
+       }
+     }
+     gsl_vector_view gsl_r=gsl_vector_view_array(r,m);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13364-13365.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13364-13365.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13364-13365.diff	(revision 13394)
@@ -0,0 +1,20 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/include/python_macros.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/include/python_macros.h	(revision 13364)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/include/python_macros.h	(revision 13365)
+@@ -29,12 +29,15 @@
+ #define MODULEEND(); }\
+   catch(ErrorException &exception){\
+ 	  PyErr_SetString(PyExc_TypeError,"ISSM Error"); \
++	  return NULL;\
+   } \
+ 	catch (exception &e){\
+ 		PyErr_SetString(PyExc_TypeError,exprintf("Standard exception: %s\n",e.what()));\
++		return NULL;\
+ 	}\
+ 	catch(...){\
+ 		PyErr_SetString(PyExc_TypeError,"An unexpected error occurred");\
++		return NULL;\
+ 	}\
+ 	return output;
+ //}}}
Index: /issm/oecreview/Archive/12678-13393/ISSM-13365-13366.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13365-13366.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13365-13366.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/GridInsideHole.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/GridInsideHole.cpp	(revision 13365)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/GridInsideHole.cpp	(revision 13366)
+@@ -13,7 +13,7 @@
+ 
+ int GridInsideHole(double* px0,double* py0,int n,double* x,double* y){
+ 
+-	double flag;
++	double flag=0.;
+ 	double xA,xB,xC,xD,xE;
+ 	double yA,yB,yC,yD,yE;
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13366-13367.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13366-13367.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13366-13367.diff	(revision 13394)
@@ -0,0 +1,50 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/GridInsideHole.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/GridInsideHole.cpp	(revision 13366)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/TriMesh/GridInsideHole.cpp	(revision 13367)
+@@ -13,7 +13,7 @@
+ 
+ int GridInsideHole(double* px0,double* py0,int n,double* x,double* y){
+ 
+-	double flag=0.;
++	double flag=0.0;
+ 	double xA,xB,xC,xD,xE;
+ 	double yA,yB,yC,yD,yE;
+ 
+@@ -29,17 +29,15 @@
+ 
+ 	/*D and E are on each side of segment [A B], on the median line between segment [A  B], 
+ 	 *at an angle of 10 degree (less than the minimum 30 enforced by the quality of the mesh: */
+-
+-
+ 	xD=xC+tan(10./180.*M_PI)*(yC-yA);
+ 	yD=yC+tan(10./180.*M_PI)*(xA-xC);
+-
+ 	xE=xC-tan(10./180.*M_PI)*(yC-yA);
+ 	yE=yC-tan(10./180.*M_PI)*(xA-xC);
+ 
+ 	/*Either E or D is inside profile (x,y): */
+ 	IsInPolySerial(&flag,&xD,&yD,1,x,y,n,2);
+-	if (flag){
++	/*FIXME: used to be 'flag' and not '!flag', check*/
++	if(!flag){
+ 		/*D is inside the poly: */
+ 		*px0=xD;
+ 		*py0=yD;
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/IsInPolySerial.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/IsInPolySerial.cpp	(revision 13366)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Exp/IsInPolySerial.cpp	(revision 13367)
+@@ -23,10 +23,10 @@
+ 		x0=x[i];
+ 		y0=y[i];
+ 		if (pnpoly(numvertices,xc,yc,x0,y0,edgevalue)){
+-			in[i]=1;
++			in[i]=1.;
+ 		}
+ 		else{
+-			in[i]=0;
++			in[i]=0.;
+ 		}
+ 	}
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13367-13368.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13367-13368.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13367-13368.diff	(revision 13394)
@@ -0,0 +1,82 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13367)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13368)
+@@ -34,7 +34,7 @@
+ void FetchData(BamgMesh** bamgmesh,PyObject* py_dict);
+ void FetchData(BamgOpts** bamgopts,PyObject* py_dict);
+ void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments);
+-void FetchData(DataSet** pcontours,PyObject* py_dict);
++void FetchData(DataSet** pcontours,PyObject* py_list);
+ 
+ int CheckNumPythonArguments(PyObject* inputs,int NRHS, void (*function)( void ));
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13367)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13368)
+@@ -15,6 +15,7 @@
+ #include "../../include/include.h"
+ #include "../../shared/shared.h"
+ #include "../../io/io.h"
++void FetchData(char** pstring,PyObject* py_string);
+ 
+ /*Primitive data types*/
+ /*FUNCTION FetchData(double* pscalar,PyObject* py_float){{{*/
+@@ -234,10 +235,53 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION FetchData(DataSet** pcontours,PyObject* py_dict){{{*/
+-void FetchData(DataSet** pcontours,PyObject* py_dict){
++/*FUNCTION FetchData(DataSet** pcontours,PyObject* py_list){{{*/
++void FetchData(DataSet** pcontours,PyObject* py_list){
+ 
+-	_error_("not supported yet");
++	int              numcontours,test1,test2;
++	char            *contourname = NULL;
++	DataSet         *contours    = NULL;
++	Contour<double> *contouri    = NULL;
++	PyObject        *py_dicti    = NULL;
++	PyObject        *py_item     = NULL;
++
++	if (PyString_Check(py_list)){
++		FetchData(&contourname,py_list);
++		contours=DomainOutlineRead<double>(contourname);
++	}
++	else if(PyList_Check(py_list)){
++
++		contours=new DataSet(0);
++		numcontours=(int)PyList_Size(py_list);
++
++		for(int i=0;i<numcontours;i++){
++
++			contouri=xNew<Contour<double> >(1);
++			py_dicti=PyList_GetItem(py_list,(Py_ssize_t)i);
++
++			py_item = PyDict_GetItemString(py_dicti,"nods");
++			if(!py_item) _error_("input structure does not have a 'nods' field");
++			FetchData(&contouri->nods,py_item);
++
++			py_item = PyDict_GetItemString(py_dicti,"x");
++			if(!py_item) _error_("input structure does not have a 'x' field");
++			FetchData(&contouri->x,&test1,&test2,py_item);
++			if(test1!=contouri->nods || test2!=1) _error_("field x should be of size ["<<contouri->nods<<" 1]");
++
++			py_item = PyDict_GetItemString(py_dicti,"y");
++			if(!py_item) _error_("input structure does not have a 'y' field");
++			FetchData(&contouri->y,&test1,&test2,py_item);
++			if(test1!=contouri->nods || test2!=1) _error_("field y should be of size ["<<contouri->nods<<" 1]");
++
++			contours->AddObject(contouri);
++		}
++	}
++	else{
++		_error_("Contour is neither a string nor a structure and cannot be loaded");
++	}
++
++	/*clean-up and assign output pointer*/
++	*pcontours=contours;
+ }
+ /*}}}*/
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13368-13369.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13368-13369.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13368-13369.diff	(revision 13394)
@@ -0,0 +1,15 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test211.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test211.m	(revision 13368)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test/NightlyRun/test211.m	(revision 13369)
+@@ -14,8 +14,8 @@
+ 	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
+ field_tolerances={...
+ 	1e-08,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,...
+-	1e-08,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06,...
+-	1e-07,1e-07,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06};
++	2e-08,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06,...
++	1e-07,1e-07,1e-06,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+ 	(md.results.TransientSolution(1).Vy),...
Index: /issm/oecreview/Archive/12678-13393/ISSM-13369-13370.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13369-13370.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13369-13370.diff	(revision 13394)
@@ -0,0 +1,281 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh	(revision 13369)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh	(revision 13370)
+@@ -1,41 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-#Some cleanup
+-rm -rf install src
+-rm -rf Python-2.7.2
+-mkdir install src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.2.tgz Python-2.7.2.tgz
+-
+-#exports
+-export CC
+-export MACOSX_DEPLOYMENT_TARGET=10.6
+-
+-#Untar and move python into install directory
+-tar -zxvf  Python-2.7.2.tgz
+-mv Python-2.7.2/* src
+-rm -rf Python-2.7.2
+-
+-#Configure doxygen
+-cd src 
+-# --enable-framework needs to have the form "$SOME_PATH/Library/Frameworks" to avoid installing components in /Applications directory
+-# --prefix is recognized as $SOME_PATH as long as this form is taken, so it's not necessary to include
+-./configure --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
+-
+-#make
+-if [ $# -eq 0 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make install
+-
+-cd ../install
+-ln -s Library/Frameworks/Python.framework/Headers include
+-ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
+-
+-#Patch pyport.h:
+-cd include
+-patch pyport.h $ISSM_DIR/externalpackages/python/patches/pyport.h.patch
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh	(revision 13369)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh	(revision 13370)
+@@ -1,36 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-#Some cleanup
+-rm -rf install src
+-rm -rf Python-2.7.2
+-mkdir install src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.2.tgz Python-2.7.2.tgz
+-
+-#exports
+-export CC
+-
+-#Untar and move python into install directory
+-tar -zxvf  Python-2.7.2.tgz
+-mv Python-2.7.2/* src
+-rm -rf Python-2.7.2
+-
+-#Configure python
+-cd src 
+-./configure \
+- --prefix="$ISSM_DIR/externalpackages/python/install" \
+- --enable-shared
+-
+-if [ $# -eq 0 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make install
+-
+-cd ../install/include
+-cp python2.7/* ./
+-cd ../lib
+-ln -s  libpython2.7.so.1.0 libpython.so
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 13369)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh	(revision 13370)
+@@ -1,43 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-#Some cleanup
+-rm -rf install src
+-rm -rf Python-2.7.2
+-mkdir install src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.2.tgz Python-2.7.2.tgz
+-
+-#exports
+-export CC
+-
+-#Untar and move python into install directory
+-tar -zxvf  Python-2.7.2.tgz
+-mv Python-2.7.2/* src
+-rm -rf Python-2.7.2
+-
+-#Configure and compile
+-cd src 
+-./configure \
+- --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
+-if [ $# -eq 0 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make install
+-
+-cd ../install
+-
+-#get rid of bin, because it's just a copy of
+-#Library/Frameworks/Python.framework/Versions/2.7/bin, and will not reflect
+-#new changes being made
+-rm -rf bin
+-ln -s Library/Frameworks/Python.framework/Headers include
+-ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
+-ln -s Library/Frameworks/Python.framework/Versions/2.7/bin bin
+-
+-#Patch pyport.h:
+-cd include
+-patch pyport.h $ISSM_DIR/externalpackages/python/patches/pyport.h.patch
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-macosx-snowleopard.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-macosx-snowleopard.sh	(revision 13370)
+@@ -0,0 +1,40 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install src
++rm -rf Python-2.7.3
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz
++
++#exports
++export MACOSX_DEPLOYMENT_TARGET=10.6
++
++#Untar and move python into install directory
++tar -zxvf  Python-2.7.3.tgz
++mv Python-2.7.3/* src
++rm -rf Python-2.7.3
++
++#Configure doxygen
++cd src 
++# --enable-framework needs to have the form "$SOME_PATH/Library/Frameworks" to avoid installing components in /Applications directory
++# --prefix is recognized as $SOME_PATH as long as this form is taken, so it's not necessary to include
++./configure --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
++
++#make
++if [ $# -eq 0 ]; then
++	make
++else
++	make -j $1
++fi
++make install
++
++cd ../install
++ln -s Library/Frameworks/Python.framework/Headers include
++ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
++
++#Patch pyport.h:
++cd include
++patch pyport.h $ISSM_DIR/externalpackages/python/patches/pyport.h.patch
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-macosx-snowleopard.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-linux64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-linux64.sh	(revision 13370)
+@@ -0,0 +1,33 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install src
++rm -rf Python-2.7.3
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz
++
++#Untar and move python into install directory
++tar -zxvf  Python-2.7.3.tgz
++mv Python-2.7.3/* src
++rm -rf Python-2.7.3
++
++#Configure python
++cd src 
++./configure \
++ --prefix="$ISSM_DIR/externalpackages/python/install" \
++ --enable-shared
++
++if [ $# -eq 0 ]; then
++	make
++else
++	make -j $1
++fi
++make install
++
++cd ../install/include
++cp python2.7/* ./
++cd ../lib
++ln -s  libpython2.7.so.1.0 libpython.so
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-linux64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-macosx-lion.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-macosx-lion.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-macosx-lion.sh	(revision 13370)
+@@ -0,0 +1,40 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install src
++rm -rf Python-2.7.3
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz
++
++#Untar and move python into install directory
++tar -zxvf  Python-2.7.3.tgz
++mv Python-2.7.3/* src
++rm -rf Python-2.7.3
++
++#Configure and compile
++cd src 
++./configure \
++ --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
++if [ $# -eq 0 ]; then
++	make
++else
++	make -j $1
++fi
++make install
++
++cd ../install
++
++#get rid of bin, because it's just a copy of
++#Library/Frameworks/Python.framework/Versions/2.7/bin, and will not reflect
++#new changes being made
++rm -rf bin
++ln -s Library/Frameworks/Python.framework/Headers include
++ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
++ln -s Library/Frameworks/Python.framework/Versions/2.7/bin bin
++
++#Patch pyport.h:
++cd include
++patch pyport.h $ISSM_DIR/externalpackages/python/patches/pyport.h.patch
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/python/install-2.7.3-macosx-lion.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13370-13371.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13370-13371.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13370-13371.diff	(revision 13394)
@@ -0,0 +1,219 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh	(revision 13370)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh	(revision 13371)
+@@ -1,12 +1,9 @@
+ #!/bin/bash
+ set -eu
+-PYVERSION=2.7
+-PYTHON=python${PYVERSION}
+ 
+-# gfortran 4.6 (see ISSM_DIR/externalpackages/gfortran) is necessary for ISSM compilation.
+-# On OSX 10.6, this recommended version gets installed in /usr/local/gfortran 
+-export CC=/usr/local/gfortran/bin/gcc
+-export CXX=/usr/local/gfortran/bin/g++
++# On OSX 10.6, fgortran gets installed in /usr/local/gfortran 
++export CC="/usr/local/gfortran/bin/gcc"
++export CXX="/usr/local/gfortran/bin/g++"
+ 
+ #download scipy
+ git clone https://github.com/scipy/scipy.git
+@@ -16,5 +13,5 @@
+ python setup.py build
+ python setup.py install
+ cd ..
+-${PYTHON} -c "import scipy; print 'Installed SciPy', scipy.__version__"
+-${PYTHON} -c "import scipy; scipy.test()"
++python -c "import scipy; print 'Installed SciPy', scipy.__version__"
++python -c "import scipy; scipy.test()"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh	(revision 13370)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/scipy/install-linux64.sh	(revision 13371)
+@@ -1,7 +1,5 @@
+ #!/bin/bash
+ set -eu
+-PYVERSION=2.7
+-PYTHON=python${PYVERSION}
+ 
+ export CC="gcc -fPIC"
+ export CXX="g++ -fPIC"
+@@ -26,5 +24,5 @@
+ python setup.py build
+ python setup.py install
+ cd ..
+-${PYTHON} -c "import scipy; print 'Installed SciPy', scipy.__version__"
+-##${PYTHON} -c "import scipy; scipy.test()"
++python -c "import scipy; print 'Installed SciPy', scipy.__version__"
++#python -c "import scipy; scipy.test()"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh	(revision 13370)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh	(revision 13371)
+@@ -1,11 +1,9 @@
+ #!/bin/bash
+-PYVERSION=2.7
+-PYTHON=python${PYVERSION}
++set -eu
+ 
+-# gfortran 4.6 (see ISSM_DIR/externalpackages/gfortran) is necessary for ISSM compilation.
+-# On OSX 10.6, this recommended version gets installed in /usr/local/gfortran 
+-export CC=/usr/local/gfortran/bin/gcc
+-export CXX=/usr/local/gfortran/bin/g++
++# On OSX 10.6, gfortran gets installed in /usr/local/gfortran 
++export CC="/usr/local/gfortran/bin/gcc"
++export CXX="/usr/local/gfortran/bin/g++"
+ 
+ #download numpy first
+ git clone https://github.com/numpy/numpy.git
+@@ -15,5 +13,5 @@
+ python setup.py build
+ python setup.py install
+ cd ..
+-${PYTHON} -c "import numpy; print 'Installed NumPy', numpy.__version__"
+-${PYTHON} -c "import numpy; numpy.test()"
++python -c "import numpy; print 'Installed NumPy', numpy.__version__"
++python -c "import numpy; numpy.test()"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-linux64.sh	(revision 13370)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/numpy/install-linux64.sh	(revision 13371)
+@@ -1,7 +1,5 @@
+ #!/bin/bash
+ set -eu
+-PYVERSION=2.7
+-PYTHON=python${PYVERSION}
+ 
+ export CC="gcc -fPIC"
+ export CXX="g++ -fPIC"
+@@ -21,5 +19,5 @@
+ python setup.py build
+ python setup.py install
+ cd ..
+-${PYTHON} -c "import numpy; print 'Installed NumPy', numpy.__version__"
+-${PYTHON} -c "import numpy; numpy.test()"
++python -c "import numpy; print 'Installed NumPy', numpy.__version__"
++python -c "import numpy; numpy.test()"
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install.sh	(revision 13370)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install.sh	(revision 13371)
+@@ -1,18 +0,0 @@
+-#/bin/bash
+-set -eu
+-pythonversion=2.7
+-PYTHON=python${pythonversion}
+-
+-export GIT_SSL_NO_VERIFY=true 
+-export CC="gcc -fPIC "
+-export CXX="g++ -fPIC -L$ISSM_DIR/externalpackages/tcl/install/lib"
+-export F77="gfortran -fPIC"
+-export FC="gfortran -fPIC"
+-export FFLAGS=-ff2c
+-
+-
+-git clone https://github.com/matplotlib/matplotlib
+-mv matplotlib src
+-cd src
+-python setup.py build 
+-python setup.py install 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh	(revision 13370)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-osx.sh	(revision 13371)
+@@ -1,32 +0,0 @@
+-#/bin/bash
+-set -eu
+-pythonversion=2.7
+-PYTHON=python${pythonversion}
+-
+-export C_INCLUDE_PATH="$C_INCLUDE_PATH:/usr/include/c++/4.2.1"
+-export GIT_SSL_NO_VERIFY=true 
+-export CC="gcc -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
+-export CXX="g++ -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
+-export F77="gfortran -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
+-export FC="gfortran -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
+-export FFLAGS="-ff2c -arch x86_64 -I/usr/include/c++/4.2.1"
+-export ARCHFLAGS="-arch x86_64 -I/usr/include/c++/4.2.1"
+-
+-
+-
+-git clone https://github.com/matplotlib/matplotlib
+-mv matplotlib src
+-mkdir deps
+-cd src
+-
+-#only try this if the classic python setup.py build approach does not work. The approach in the next 3 lines can 
+-#trigger issues of permissions with freetype. Sometimes it is better to independently install freetype2 (from the 
+-#issm externalpackages) as sudo (or root), so that the python script can detect its existence automatically.
+-#sudo make -f make.osx PREFIX=$ISSM_DIR/externalpackages/matplotlib/deps PYVERSION=$pythonversion fetch deps mpl_install_std
+-#sudo make -f make.osx PREFIX=$ISSM_DIR/externalpackages/matplotlib/deps PYVERSION=$pythonversion mpl_install_std
+-#${PYTHON} -c "import matplotlib; print 'Installed matplotlib', matplotlib.__version__, matplotlib.__file__"
+-
+-
+-#to be tried:  first get freetype and  zlib and libpng installed in sudo mode
+-python setup.py build
+-python setup.py install
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-macosx64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-macosx64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-macosx64.sh	(revision 13371)
+@@ -0,0 +1,27 @@
++#/bin/bash
++set -eu
++
++export C_INCLUDE_PATH="$C_INCLUDE_PATH:/usr/include/c++/4.2.1"
++export GIT_SSL_NO_VERIFY=true 
++export CC="gcc -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
++export CXX="g++ -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
++export F77="gfortran -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
++export FC="gfortran -fPIC -arch x86_64 -I/usr/include/c++/4.2.1"
++export FFLAGS="-ff2c -arch x86_64 -I/usr/include/c++/4.2.1"
++export ARCHFLAGS="-arch x86_64 -I/usr/include/c++/4.2.1"
++
++git clone https://github.com/matplotlib/matplotlib
++mv matplotlib src
++mkdir deps
++cd src
++
++#only try this if the classic python setup.py build approach does not work. The approach in the next 3 lines can 
++#trigger issues of permissions with freetype. Sometimes it is better to independently install freetype2 (from the 
++#issm externalpackages) as sudo (or root), so that the python script can detect its existence automatically.
++#sudo make -f make.osx PREFIX=$ISSM_DIR/externalpackages/matplotlib/deps PYVERSION=$pythonversion fetch deps mpl_install_std
++#sudo make -f make.osx PREFIX=$ISSM_DIR/externalpackages/matplotlib/deps PYVERSION=$pythonversion mpl_install_std
++#python -c "import matplotlib; print 'Installed matplotlib', matplotlib.__version__, matplotlib.__file__"
++
++#to be tried:  first get freetype and zlib and libpng installed in sudo mode
++python setup.py build
++python setup.py install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-macosx64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-linux64.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-linux64.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-linux64.sh	(revision 13371)
+@@ -0,0 +1,14 @@
++#/bin/bash
++set -eu
++export GIT_SSL_NO_VERIFY=true 
++export CC="gcc -fPIC "
++export CXX="g++ -fPIC -L$ISSM_DIR/externalpackages/tcl/install/lib"
++export F77="gfortran -fPIC"
++export FC="gfortran -fPIC"
++export FFLAGS=-ff2c
++
++git clone https://github.com/matplotlib/matplotlib
++mv matplotlib src
++cd src
++python setup.py build 
++python setup.py install 
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matplotlib/install-linux64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13371-13372.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13371-13372.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13371-13372.diff	(revision 13394)
@@ -0,0 +1,85 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13371)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13372)
+@@ -62,9 +62,10 @@
+ void FetchData(double** pmatrix,int* pM,int *pN,PyObject* py_matrix){
+ 
+ 	/*output: */
++	double* dmatrix=NULL;
+ 	double* matrix=NULL;
+ 	int M,N;
+-	int ndim;
++	int i,ndim;
+ 	npy_intp*  dims=NULL;
+ 
+ 	/*retrive dimensions: */
+@@ -74,8 +75,12 @@
+ 	M=dims[0]; N=dims[1];
+ 	
+ 	/*retrieve internal value: */
+-	matrix=(double*)PyArray_DATA((PyArrayObject*)py_matrix);
++	dmatrix=(double*)PyArray_DATA((PyArrayObject*)py_matrix);
+ 
++	/*copy matrix: */
++	matrix=xNew<double>(M*N);
++	for(i=0;i<M*N;i++)matrix[i]=dmatrix[i];
++
+ 	/*output: */
+ 	if(pM)*pM=M;
+ 	if(pN)*pN=N;
+@@ -118,9 +123,10 @@
+ void FetchData(double** pvector,int* pM,PyObject* py_vector){
+ 
+ 	/*output: */
++	double* dvector=NULL;
+ 	double* vector=NULL;
+ 	int M;
+-	int ndim;
++	int i,ndim;
+ 	npy_intp*  dims=NULL;
+ 
+ 	/*retrive dimensions: */
+@@ -130,8 +136,12 @@
+ 	M=dims[0]; 
+ 	
+ 	/*retrieve internal value: */
+-	vector=(double*)PyArray_DATA((PyArrayObject*)py_vector);
++	dvector=(double*)PyArray_DATA((PyArrayObject*)py_vector);
+ 
++	/*copy vector: */
++	vector=xNew<double>(M);
++	for(i=0;i<M;i++)vector[i]=dvector[i];
++
+ 	/*output: */
+ 	if(pM)*pM=M;
+ 	if(pvector)*pvector=vector;
+@@ -281,6 +291,7 @@
+ 	}
+ 
+ 	/*clean-up and assign output pointer*/
++	xDelete<char>(contourname);
+ 	*pcontours=contours;
+ }
+ /*}}}*/
+@@ -293,7 +304,6 @@
+ 	PyObject* py_bytes;
+ 	char* string=NULL;
+ 
+-	
+ 	/*convert to bytes format: */
+ 	PyUnicode_FSConverter(py_unicode,&py_bytes);
+ 
+@@ -311,8 +321,10 @@
+ 
+ 	/*extract internal string: */
+ 	string=PyString_AsString(py_string);
+-	
+-	*pstring=string;
++
++	/*copy string (note strlen does not include trailing NULL): */
++	*pstring=xNew<char>(strlen(string)+1);
++	memcpy(*pstring,string,(strlen(string)+1)*sizeof(char));
+ }
+ /*}}}*/
+ #endif
Index: /issm/oecreview/Archive/12678-13393/ISSM-13372-13373.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13372-13373.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13372-13373.diff	(revision 13394)
@@ -0,0 +1,90 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13372)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/pythonio.h	(revision 13373)
+@@ -33,7 +33,7 @@
+ void FetchData(BamgGeom** bamggeom,PyObject* py_dict);
+ void FetchData(BamgMesh** bamgmesh,PyObject* py_dict);
+ void FetchData(BamgOpts** bamgopts,PyObject* py_dict);
+-void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments);
++void FetchData(Options** poptions,int istart, int nrhs,PyObject* py_tuple);
+ void FetchData(DataSet** pcontours,PyObject* py_list);
+ 
+ int CheckNumPythonArguments(PyObject* inputs,int NRHS, void (*function)( void ));
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13372)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13373)
+@@ -65,7 +65,7 @@
+ 	double* dmatrix=NULL;
+ 	double* matrix=NULL;
+ 	int M,N;
+-	int i,ndim;
++	int ndim;
+ 	npy_intp*  dims=NULL;
+ 
+ 	/*retrive dimensions: */
+@@ -79,7 +79,7 @@
+ 
+ 	/*copy matrix: */
+ 	matrix=xNew<double>(M*N);
+-	for(i=0;i<M*N;i++)matrix[i]=dmatrix[i];
++	memcpy(matrix,dmatrix,(M*N)*sizeof(double));
+ 
+ 	/*output: */
+ 	if(pM)*pM=M;
+@@ -126,7 +126,7 @@
+ 	double* dvector=NULL;
+ 	double* vector=NULL;
+ 	int M;
+-	int i,ndim;
++	int ndim;
+ 	npy_intp*  dims=NULL;
+ 
+ 	/*retrive dimensions: */
+@@ -140,7 +140,7 @@
+ 
+ 	/*copy vector: */
+ 	vector=xNew<double>(M);
+-	for(i=0;i<M;i++)vector[i]=dvector[i];
++	memcpy(vector,dvector,(M)*sizeof(double));
+ 
+ 	/*output: */
+ 	if(pM)*pM=M;
+@@ -232,17 +232,32 @@
+ 	*pbamgopts=bamgopts;
+ }
+ /*}}}*/
+-/*FUNCTION FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments){{{*/
+-void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments){
++/*FUNCTION FetchData(Options** poptions,int istart, int nrhs,PyObject* py_args){{{*/
++void FetchData(Options** poptions,int istart, int nrhs,PyObject* py_tuple){
+ 
++	char   *name   = NULL;
++	Option *option = NULL;
++
+ 	/*Initialize output*/
+ 	Options* options=new Options();
+ 
+-	_pprintLine_("FetchData for Options not implemented yet, ignoring them!");
++	/*Fetch all options*/
++	for (int i=istart; i<nrhs; i=i+2){
++		if (!PyString_Check(PyTuple_GetItem(py_tuple,(Py_ssize_t)i))) _error_("Argument " << i+1 << " must be name of option");
+ 
++		FetchData(&name,PyTuple_GetItem(py_tuple,(Py_ssize_t)i));
++		if(i+1 == nrhs) _error_("Argument " << i+2 << " must exist and be value of option \"" << name << "\".");
++
++//		_pprintLine_("FetchData for Options not implemented yet, ignoring them!");
++		_printf_(1,"FetchData for Options not implemented yet, ignoring option '%s'!",name);
++
++//		option=(Option*)OptionParse(name,&PyTuple_GetItem(py_tuple,(Py_ssize_t)(i+1)));
++//		options->AddOption(option);
++//		option=NULL;
++	}
++
+ 	/*Assign output pointers:*/
+ 	*poptions=options;
+-
+ }
+ /*}}}*/
+ /*FUNCTION FetchData(DataSet** pcontours,PyObject* py_list){{{*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-13373-13374.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13373-13374.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13373-13374.diff	(revision 13394)
@@ -0,0 +1,23 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13373)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 13374)
+@@ -232,7 +232,7 @@
+ 	*pbamgopts=bamgopts;
+ }
+ /*}}}*/
+-/*FUNCTION FetchData(Options** poptions,int istart, int nrhs,PyObject* py_args){{{*/
++/*FUNCTION FetchData(Options** poptions,int istart, int nrhs,PyObject* py_tuple){{{*/
+ void FetchData(Options** poptions,int istart, int nrhs,PyObject* py_tuple){
+ 
+ 	char   *name   = NULL;
+@@ -248,8 +248,7 @@
+ 		FetchData(&name,PyTuple_GetItem(py_tuple,(Py_ssize_t)i));
+ 		if(i+1 == nrhs) _error_("Argument " << i+2 << " must exist and be value of option \"" << name << "\".");
+ 
+-//		_pprintLine_("FetchData for Options not implemented yet, ignoring them!");
+-		_printf_(1,"FetchData for Options not implemented yet, ignoring option '%s'!",name);
++		_pprintLine_("FetchData for Options not implemented yet, ignoring option \"" << name << "\"!");
+ 
+ //		option=(Option*)OptionParse(name,&PyTuple_GetItem(py_tuple,(Py_ssize_t)(i+1)));
+ //		options->AddOption(option);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13374-13375.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13374-13375.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13374-13375.diff	(revision 13394)
@@ -0,0 +1,93 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13374)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13375)
+@@ -71,7 +71,11 @@
+ 		outmatrix_size =NULL;
+ 		outmatrix=NULL;
+ 	}
+-	else if (mxIsClass(dataref,"double") ){
++	else if( mxIsClass(dataref,"double") || 
++				mxIsClass(dataref,"single") || 
++				mxIsClass(dataref,"int16") || 
++				mxIsClass(dataref,"int8") || 
++				mxIsClass(dataref,"uint8")){
+ 
+ 		/*Check dataref is not pointing to NaN: */
+ 		if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetNumberOfElements(dataref)==1) ){
+@@ -81,7 +85,9 @@
+ 			outmatrix=NULL;
+ 		}
+ 		else{
+-
++			if(!mxIsClass(dataref,"double") && !mxIsClass(dataref,"single")){
++				_printLine_("Warning: converting matlab data from '" << mxGetClassName(dataref) << "' to 'double'");
++			}
+ 			/*Convert matlab n-dim array to double* matrix: */
+ 			MatlabNArrayToNArray(&outmatrix,&outmatrix_numel,&outmatrix_ndims,&outmatrix_size,dataref);
+ 		}
+@@ -113,7 +119,11 @@
+ 		outmatrix_cols=0;
+ 		outmatrix=NULL;
+ 	}
+-	else if (mxIsClass(dataref,"double") ){
++	else if( mxIsClass(dataref,"double") || 
++				mxIsClass(dataref,"single") || 
++				mxIsClass(dataref,"int16") || 
++				mxIsClass(dataref,"int8") || 
++				mxIsClass(dataref,"uint8")){
+ 
+ 		/*Check dataref is not pointing to NaN: */
+ 		if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){
+@@ -122,7 +132,9 @@
+ 			outmatrix=NULL;
+ 		}
+ 		else{
+-
++			if(!mxIsClass(dataref,"double") && !mxIsClass(dataref,"single")){
++				_printLine_("Warning: converting matlab data from '" << mxGetClassName(dataref) << "' to 'double'");
++			}
+ 			/*Convert matlab matrix to double* matrix: */
+ 			MatlabMatrixToDoubleMatrix(&doublematrix,&outmatrix_rows,&outmatrix_cols,dataref);
+ 
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13374)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13375)
+@@ -24,7 +24,7 @@
+ 
+ void SolverxSeq(SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf, Parameters* parameters){/*{{{*/
+ 
+-	#ifdef _HAVE_GSL_
++#ifdef _HAVE_GSL_
+ 	/*Intermediary: */
+ 	int M,N,N2,s;
+ 	SeqVec<IssmDouble> *uf = NULL;
+@@ -34,21 +34,23 @@
+ 
+ 	if(N!=N2)_error_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
+ 	if(M!=N)_error_("Stiffness matrix should be square!");
+-        IssmDouble *x  = xNew<IssmDouble>(N);
++	IssmDouble *x  = xNew<IssmDouble>(N);
++
+ #ifdef _HAVE_ADOLC_
+ 	SolverxSeq(x,Kff->matrix,pf->vector,N,parameters);
+ #else
+ 	SolverxSeq(x,Kff->matrix,pf->vector,N);
+ #endif
++
+ 	uf=new SeqVec<IssmDouble>(x,N);
+ 	xDelete(x);
+ 
+ 	/*Assign output pointers:*/
+ 	*puf=uf;
+ 
+-	#else
+-		_error_("GSL support not compiled in!");
+-	#endif
++#else
++	_error_("GSL support not compiled in!");
++#endif
+ 
+ }/*}}}*/
+ void SolverxSeq(IssmPDouble **pX, IssmPDouble *A, IssmPDouble *B,int n){ /*{{{*/
Index: /issm/oecreview/Archive/12678-13393/ISSM-13375-13376.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13375-13376.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13375-13376.diff	(revision 13394)
@@ -0,0 +1,83 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13375)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/kriging.cpp	(revision 13376)
+@@ -117,7 +117,6 @@
+ }
+ 
+ void ProcessArguments2(char** pbinfilename,char** poutbinfilename,char** plockfilename,char** prootpath,int argc,char **argv){
+-
+ 	char *modelname      = NULL;
+ 	char *binfilename    = NULL;
+ 	char *outbinfilename = NULL;
+@@ -153,7 +152,6 @@
+ 	*poutbinfilename=outbinfilename;
+ 	*plockfilename=lockfilename;
+ 	*prootpath=rootpath;
+-
+ }
+ 
+ void ProcessInputfile(IssmDouble **px,IssmDouble **py,IssmDouble **pdata,int *pnobs,IssmDouble **px_interp,IssmDouble **py_interp,int *pninterp,Options **poptions,FILE* fid){
+@@ -171,6 +169,7 @@
+ 	IoModel* iomodel = new IoModel();
+ 	iomodel->fid=fid;
+ 	iomodel->CheckEnumSync();
++	iomodel->independents=xNew<bool>(MaximumNumberOfEnums); for(int i=0;i<MaximumNumberOfEnums;i++) iomodel->independents[i]=false;
+ 	iomodel->FetchData(&x,&M,&N,0);        nobs=M*N;
+ 	iomodel->FetchData(&y,&M,&N,1);        _assert_(M*N==nobs);
+ 	iomodel->FetchData(&data,&M,&N,2);     _assert_(M*N==nobs);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13375)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13376)
+@@ -55,10 +55,10 @@
+ 
+ 		/*partition loop across threads: */
+ 		for(int idx=my_rank;idx<n_interp;idx+=num_procs){
+-			_pprintString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
++			_pprintLine_("      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
+ 			observations->InterpolationKriging(&predictions[idx],&error[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,variogram);
+ 		}
+-		_pprintLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
++		_pprintLine_("      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
+ 
+ #ifdef _HAVE_MPI_
+ 		double *sumpredictions =xNew<double>(n_interp);
+@@ -73,10 +73,10 @@
+ 
+ 		/*partition loop across threads: */
+ 		for(int idx=my_rank;idx<n_interp;idx+=num_procs){
+-			_pprintString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
++			_pprintLine_("      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
+ 			observations->InterpolationNearestNeighbor(&predictions[idx],x_interp[idx],y_interp[idx],radius);
+ 		}
+-		_pprintLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
++		_pprintLine_("      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
+ 
+ #ifdef _HAVE_MPI_
+ 		double *sumpredictions =xNew<double>(n_interp);
+@@ -90,10 +90,10 @@
+ 
+ 		/*partition loop across threads: */
+ 		for(int idx=my_rank;idx<n_interp;idx+=num_procs){
+-			_pprintString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
++			_pprintLine_("      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
+ 			observations->InterpolationIDW(&predictions[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,power);
+ 		}
+-		_pprintLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
++		_pprintLine_("      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
+ 
+ #ifdef _HAVE_MPI_
+ 		double *sumpredictions =xNew<double>(n_interp);
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13375)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/IoModel.cpp	(revision 13376)
+@@ -713,6 +713,7 @@
+ 		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+ 		#endif
+ 
++		_assert_(this->independents);
+ 		if (this->independents[data_enum]){
+ 			/*this data has already been checked out! So cancel all that we've done here, and return 
+ 			 * the data[data_enum] directly: */
Index: /issm/oecreview/Archive/12678-13393/ISSM-13376-13377.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13376-13377.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13376-13377.diff	(revision 13394)
@@ -0,0 +1,77 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-helene.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-helene.sh	(revision 13376)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-helene.sh	(revision 13377)
+@@ -1,27 +0,0 @@
+-#!/bin/sh
+-
+-#petsc 3.2
+-#mpich 1.4
+-
+-./configure \
+-	--prefix=$ISSM_DIR \
+-	--with-matlab-dir=$MATLAB_DIR \
+-	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+-	--with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
+-	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
+-	--with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
+-	--with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a" \
+-	--with-petsc-arch=$ISSM_ARCH \
+-	--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+-	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+-	--with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+-	--with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
+-	--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+-	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+-	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+-	--with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
+-	--with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
+-	--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
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-lion-helene.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-lion-helene.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-lion-helene.sh	(revision 13377)
+@@ -0,0 +1,34 @@
++#!/bin/sh
++
++#petsc 3.2
++#mpich 1.4
++
++pythonversion=2.7
++
++./configure \
++	--prefix=$ISSM_DIR \
++	--with-matlab-dir=$MATLAB_DIR \
++	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
++	--with-python-dir=$ISSM_DIR/externalpackages/python/install\
++	--with-python-version=$pythonversion \
++	--with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/lib/python$pythonversion/site-packages/numpy/core/include/numpy\
++	--with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
++	--with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
++	--with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
++	--with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install \
++	--with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
++	--with-math-lib="/usr/lib/libm.dylib" \
++	--with-graphics-lib="-L/usr/X11R6/lib -lX11" \
++	--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-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
++	--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++	--with-numthreads=8
++	#--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
++	#--with-boost-dir=$ISSM_DIR/externalpackages/boost/install/ \
++	#--with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-macosx64-lion-helene.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13377-13378.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13377-13378.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13377-13378.diff	(revision 13394)
@@ -0,0 +1,256 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13377)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 13378)
+@@ -60,16 +60,16 @@
+ /*FUNCTION FetchData(double** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref){{{*/
+ void FetchData(double** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref){
+ 
+-	double*  outmatrix=NULL;
+-	int      outmatrix_numel,outmatrix_ndims;
+-	int*     outmatrix_size=NULL;
++	int     outmatrix_numel,outmatrix_ndims;
++	double *outmatrix       = NULL;
++	int    *outmatrix_size  = NULL;
+ 
+ 	if(mxIsEmpty(dataref) ){
+ 		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+-		outmatrix_numel=0;
+-		outmatrix_ndims=0;
+-		outmatrix_size =NULL;
+-		outmatrix=NULL;
++		outmatrix_numel = 0;
++		outmatrix_ndims = 0;
++		outmatrix_size  = NULL;
++		outmatrix       = NULL;
+ 	}
+ 	else if( mxIsClass(dataref,"double") || 
+ 				mxIsClass(dataref,"single") || 
+@@ -78,11 +78,11 @@
+ 				mxIsClass(dataref,"uint8")){
+ 
+ 		/*Check dataref is not pointing to NaN: */
+-		if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetNumberOfElements(dataref)==1) ){
+-			outmatrix_numel=0;
+-			outmatrix_ndims=0;
+-			outmatrix_size =NULL;
+-			outmatrix=NULL;
++		if (mxIsNaN(*(mxGetPr(dataref))) && (mxGetNumberOfElements(dataref)==1)){
++			outmatrix_numel = 0;
++			outmatrix_ndims = 0;
++			outmatrix_size  = NULL;
++			outmatrix       = NULL;
+ 		}
+ 		else{
+ 			if(!mxIsClass(dataref,"double") && !mxIsClass(dataref,"single")){
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabNArrayToNArray.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabNArrayToNArray.cpp	(revision 13377)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/matlab/io/MatlabNArrayToNArray.cpp	(revision 13378)
+@@ -27,12 +27,10 @@
+ 	double* matrix=NULL;
+ 
+ 	/*matlab indices: */
+-	mwIndex*    ir=NULL;
+-	mwIndex*    jc=NULL;
+-	double* pr=NULL;
+-	int     count;
+-	int     nnz;
+-	int     nz;
++	mwIndex *ir    = NULL;
++	mwIndex *jc    = NULL;
++	double  *pr    = NULL;
++	int      count;
+ 
+ 	/*get Matlab matrix information: */
+ 	numel=mxGetNumberOfElements(mxmatrix);
+@@ -45,17 +43,15 @@
+ 	if (mxIsSparse(mxmatrix)){
+ 
+ 		/*Dealing with sparse matrix: recover size first: */
+-		rows=mxGetM(mxmatrix);
+-		cols=mxGetN(mxmatrix);
+-		nnz=mxGetNzmax(mxmatrix);
+-		nz=(int)((double)nnz/(double)rows);
++		rows = mxGetM(mxmatrix);
++		cols = mxGetN(mxmatrix);
+ 
+ 		matrix=xNewZeroInit<double>(rows*cols);
+ 
+ 		/*Now, get ir,jc and pr: */
+-		ir=mxGetIr(mxmatrix);
+-		jc=mxGetJc(mxmatrix);
+-		pr=mxGetPr(mxmatrix);
++		ir = mxGetIr(mxmatrix);
++		jc = mxGetJc(mxmatrix);
++		pr = mxGetPr(mxmatrix);
+ 
+ 		/*Now, start inserting data into double* matrix: */
+ 		count=0;
+@@ -78,18 +74,17 @@
+ 		dims=xNew<int>(ndims);
+ 		for(i=0;i<numel;i++){
+ 			ColumnWiseDimsFromIndex(dims,i,size,ndims);
+-			j=IndexFromRowWiseDims(dims,size,ndims);
+-			*(matrix+j)=*(mxmatrix_ptr+i);
++			j = IndexFromRowWiseDims(dims,size,ndims);
++			matrix[j]=(double)mxmatrix_ptr[i];
+ 		}
+ 		xDelete<int>(dims);
+-		
+ 	}
+ 
+ 	/*Assign output pointer: */
+-	*pmatrix=matrix;
+-	*pmatrix_numel=numel;
+-	*pmatrix_ndims=ndims;
+-	*pmatrix_size=size;
++	*pmatrix       = matrix;
++	*pmatrix_numel = numel;
++	*pmatrix_ndims = ndims;
++	*pmatrix_size  = size;
+ 
+ 	return 1;
+ }
+@@ -107,18 +102,16 @@
+ 	bool* matrix=NULL;
+ 
+ 	/*matlab indices: */
+-	mwIndex*    ir=NULL;
+-	mwIndex*    jc=NULL;
+-	bool*   pm=NULL;
+-	int     count;
+-	int     nnz;
+-	int     nz;
++	mwIndex *ir    = NULL;
++	mwIndex *jc    = NULL;
++	bool    *pm    = NULL;
++	int      count;
+ 
+ 	/*get Matlab matrix information: */
+-	numel=mxGetNumberOfElements(mxmatrix);
+-	ndims=mxGetNumberOfDimensions(mxmatrix);
+-	ipt  =mxGetDimensions(mxmatrix);
+-	size =xNew<int>(ndims);
++	numel = mxGetNumberOfElements(mxmatrix);
++	ndims = mxGetNumberOfDimensions(mxmatrix);
++	ipt   = mxGetDimensions(mxmatrix);
++	size  = xNew<int>(ndims);
+ 	for (i=0;i<ndims;i++) size[i]=(int)ipt[i];
+ 
+ 	/*Ok, first check if we are dealing with a sparse or full matrix: */
+@@ -127,9 +120,6 @@
+ 		/*Dealing with sparse matrix: recover size first: */
+ 		rows=mxGetM(mxmatrix);
+ 		cols=mxGetN(mxmatrix);
+-		nnz=mxGetNzmax(mxmatrix);
+-		nz=(int)((double)nnz/(double)rows);
+-
+ 		matrix=xNewZeroInit<bool>(rows*cols);
+ 
+ 		/*Now, get ir,jc and pm: */
+@@ -141,11 +131,10 @@
+ 		count=0;
+ 		for(i=0;i<cols;i++){
+ 			for(j=0;j<(jc[i+1]-jc[i]);j++){
+-				*(matrix+rows*ir[count]+i)=pm[count];
++				matrix[rows*ir[count]+i]=pm[count];
+ 				count++;
+ 			}
+ 		}
+-
+ 	}
+ 	else{
+ 
+@@ -158,16 +147,16 @@
+ 		for(i=0;i<numel;i++){
+ 			ColumnWiseDimsFromIndex(dims,i,size,ndims);
+ 			j=IndexFromRowWiseDims(dims,size,ndims);
+-			*(matrix+j)=(bool)*(mxmatrix_ptr+i);
++			matrix[j]=(bool)mxmatrix_ptr[i];
+ 		}
+ 		xDelete<int>(dims);
+ 	}
+ 
+ 	/*Assign output pointer: */
+-	*pmatrix=matrix;
+-	*pmatrix_numel=numel;
+-	*pmatrix_ndims=ndims;
+-	*pmatrix_size=size;
++	*pmatrix       = matrix;
++	*pmatrix_numel = numel;
++	*pmatrix_ndims = ndims;
++	*pmatrix_size  = size;
+ 
+ 	return 1;
+ }
+@@ -189,44 +178,37 @@
+ 	mwIndex *jc    = NULL;
+ 	char    *pm    = NULL;
+ 	int      count;
+-	int      nnz;
+-	int      nz;
+ 
+ 	/*get Matlab matrix information: */
+-	numel=mxGetNumberOfElements(mxmatrix);
+-	ndims=mxGetNumberOfDimensions(mxmatrix);
+-	ipt  =mxGetDimensions(mxmatrix);
+-	size =xNew<int>(ndims);
++	numel = mxGetNumberOfElements(mxmatrix);
++	ndims = mxGetNumberOfDimensions(mxmatrix);
++	ipt   = mxGetDimensions(mxmatrix);
++	size  = xNew<int>(ndims);
+ 	for (i=0;i<ndims;i++) size[i]=(int)ipt[i];
+ 
+ 	/*Ok, first check if we are dealing with a sparse or full matrix: */
+ 	if (mxIsSparse(mxmatrix)){
+ 
+ 		/*Dealing with sparse matrix: recover size first: */
+-		rows=mxGetM(mxmatrix);
+-		cols=mxGetN(mxmatrix);
+-		nnz=mxGetNzmax(mxmatrix);
+-		nz=(int)((double)nnz/(double)rows);
+-
++		rows = mxGetM(mxmatrix);
++		cols = mxGetN(mxmatrix);
+ 		matrix=xNew<char>(rows*cols);
+ 
+ 		/*Now, get ir,jc and pm: */
+-		ir=mxGetIr(mxmatrix);
+-		jc=mxGetJc(mxmatrix);
+-		pm=(char*)mxGetData(mxmatrix);
++		ir = mxGetIr(mxmatrix);
++		jc = mxGetJc(mxmatrix);
++		pm = (char*)mxGetData(mxmatrix);
+ 
+ 		/*Now, start inserting data into char* matrix: */
+ 		count=0;
+ 		for(i=0;i<cols;i++){
+ 			for(j=0;j<(jc[i+1]-jc[i]);j++){
+-				*(matrix+rows*ir[count]+i)=(char)pm[count];
++				matrix[rows*ir[count]+i]=(char)pm[count];
+ 				count++;
+ 			}
+ 		}
+-
+ 	}
+ 	else{
+-
+ 		/*Dealing with dense matrix: recover pointer and size: */
+ 		mxmatrix_ptr=mxGetChars(mxmatrix);
+ 		
+@@ -260,10 +242,10 @@
+ 	}
+ 
+ 	/*Assign output pointer: */
+-	*pmatrix=matrix;
+-	*pmatrix_numel=numel;
+-	*pmatrix_ndims=ndims;
+-	*pmatrix_size=size;
++	*pmatrix       = matrix;
++	*pmatrix_numel = numel;
++	*pmatrix_ndims = ndims;
++	*pmatrix_size  = size;
+ 
+ 	return 1;
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-13378-13379.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13378-13379.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13378-13379.diff	(revision 13394)
@@ -0,0 +1,32 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13378)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13379)
+@@ -212,6 +212,7 @@
+ 		MPI_Bcast(&numberofresults,1,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
+ 		#endif
+ 
++
+ 		/*Get out if there is no results. Otherwise broadcast info*/
+ 		if(!numberofresults) return;
+ 		#ifdef _HAVE_MPI_
+@@ -248,7 +249,7 @@
+ 				/*No need to add this vector for all cpus*/
+ 				#ifdef _HAVE_ADOLC_
+ 				IssmPDouble* vector_serial_passive=xNew<IssmPDouble>(vectorsize);
+-				for(i=0;i<vectorsize;i++)vector_serial_passive[i]=reCast<IssmPDouble>(vector_serial[i]);
++				for(int k=0;k<vectorsize;k++)vector_serial_passive[k]=reCast<IssmPDouble>(vector_serial[k]);
+ 				results->AddObject(new GenericExternalResult<double*>(results->Size()+1,resultsenums[i],vector_serial_passive,vectorsize,1,resultssteps[i],resultstimes[i]));
+ 				xDelete<IssmPDouble>(vector_serial_passive);
+ 				#else
+@@ -273,8 +274,8 @@
+ 			results->AddObject(new GenericExternalResult<int>(results->Size()+1,PatchVerticesEnum,patch->maxvertices,1,0));
+ 			results->AddObject(new GenericExternalResult<int>(results->Size()+1,PatchNodesEnum,   patch->maxnodes,1,0));
+ 			#ifdef _HAVE_ADOLC_
+-			IssmPDouble* values_passive=xNew<IssmPDouble>(patch->numrows);
+-			for(i=0;i<patch->numrows;i++)values_passive[i]=reCast<IssmPDouble>(patch->values[i]);
++			IssmPDouble* values_passive=xNew<IssmPDouble>(patch->numrows*patch->numcols);
++			for(int k=0;k<(patch->numrows*patch->numcols);k++)values_passive[k]=reCast<IssmPDouble>(patch->values[k]);
+ 			results->AddObject(new GenericExternalResult<double*>(results->Size()+1,PatchEnum,  values_passive,patch->numrows,patch->numcols,1,0));
+ 			xDelete<IssmPDouble>(values_passive);
+ 			#else
Index: /issm/oecreview/Archive/12678-13393/ISSM-13379-13380.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13379-13380.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13379-13380.diff	(revision 13394)
@@ -0,0 +1,24 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp	(revision 13379)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp	(revision 13380)
+@@ -12,14 +12,14 @@
+ 	/* Add new result in into results*/
+ 	results->AddObject(new GenericExternalResult<double>(results->Size()+1,enumtype,reCast<IssmPDouble>(value),1,0));
+ }
+-void AddExternalResultx( DataSet* results, int enumtype, IssmDouble* value, int nraws){
++void AddExternalResultx( DataSet* results, int enumtype, IssmDouble* value, int nrows){
+ 	/* Add new result in into results*/
+ 	#ifdef _HAVE_ADOLC_
+-	IssmPDouble* value_passive=xNew<IssmPDouble>(nraws);
+-	for(int i=0;i<nraws;i++)value_passive[i]=reCast<IssmPDouble>(value[i]);
+-	results->AddObject(new GenericExternalResult<double*>(results->Size()+1,enumtype,value_passive,nraws,1,1,0));
++	IssmPDouble* value_passive=xNew<IssmPDouble>(nrows);
++	for(int i=0;i<nrows;i++)value_passive[i]=reCast<IssmPDouble>(value[i]);
++	results->AddObject(new GenericExternalResult<double*>(results->Size()+1,enumtype,value_passive,nrows,1,1,0));
+ 	xDelete<IssmPDouble>(value_passive);
+ 	#else
+-	results->AddObject(new GenericExternalResult<double*>(results->Size()+1,enumtype,value,nraws,1,1,0));
++	results->AddObject(new GenericExternalResult<double*>(results->Size()+1,enumtype,value,nrows,1,1,0));
+ 	#endif
+ }
Index: /issm/oecreview/Archive/12678-13393/ISSM-13380-13381.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13380-13381.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13380-13381.diff	(revision 13394)
@@ -0,0 +1,12 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13380)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Elements.cpp	(revision 13381)
+@@ -212,7 +212,6 @@
+ 		MPI_Bcast(&numberofresults,1,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
+ 		#endif
+ 
+-
+ 		/*Get out if there is no results. Otherwise broadcast info*/
+ 		if(!numberofresults) return;
+ 		#ifdef _HAVE_MPI_
Index: /issm/oecreview/Archive/12678-13393/ISSM-13381-13382.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13381-13382.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13381-13382.diff	(revision 13394)
@@ -0,0 +1,21 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13381)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13382)
+@@ -4,7 +4,7 @@
+ #Some cleanup
+ rm -rf install adolc_v220_issm
+ 
+-git clone -b 2.2.0_ISSM  git://gitorious.org/~utke/adol-c/adolc_v220_issm.git 
++git clone -b 2.3.x_ISSM  git://gitorious.org/~utke/adol-c/adolc_v220_issm.git 
+ 
+ #Compile ADOL-C
+ cd adolc_v220_issm
+@@ -13,6 +13,7 @@
+ ./configure --prefix=$ISSM_DIR/externalpackages/adolc/install \
+ 	--enable-docexa \
+ 	--enable-addexa \
++	--enable-stdczero 
+ 
+ if [ $# -eq 0 ]; then
+ 	make
Index: /issm/oecreview/Archive/12678-13393/ISSM-13382-13383.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13382-13383.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13382-13383.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.m	(revision 13382)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/solve/solve.m	(revision 13383)
+@@ -69,7 +69,7 @@
+ 
+ %we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+ if ~ispetsc(),
+-	disp('PETSC support not included, running on 1 cpu only!');
++	disp('PETSc support not included, running on 1 cpu only!');
+ 	cluster.np=1;
+ end
+ 
Index: /issm/oecreview/Archive/12678-13393/ISSM-13383-13384.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13383-13384.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13383-13384.diff	(revision 13394)
@@ -0,0 +1,34 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git/install-nopython.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git/install-nopython.sh	(revision 0)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git/install-nopython.sh	(revision 13384)
+@@ -0,0 +1,23 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf src install git-1.7.10.2
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/git-1.7.10.2.tar.gz' 'git-1.7.10.2.tar.gz'
++
++#Untar 
++tar -zxvf  git-1.7.10.2.tar.gz
++
++#Move git into install directory
++mv git-1.7.10.2/* src
++rm -rf git-1.7.10.2
++
++#install
++cd src 
++./configure  --prefix="$ISSM_DIR/externalpackages/git/install"
++	
++#Compile
++make install
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/git/install-nopython.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
Index: /issm/oecreview/Archive/12678-13393/ISSM-13384-13385.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13384-13385.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13384-13385.diff	(revision 13394)
@@ -0,0 +1,46 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.h
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.h	(revision 13384)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Container/Options.h	(revision 13385)
+@@ -99,3 +99,28 @@
+ };
+ 
+ #endif //ifndef _INPUTS_H_
++
++template <> inline void Options::Get(char** pvalue,const char* name,char* default_value){ /*{{{*/
++
++	vector<Object*>::iterator object;
++	GenericOption<char*>* genericoption=NULL;
++
++	/*Get option*/
++	genericoption=(GenericOption<char*>*)GetOption(name);
++
++	/*If the pointer is not NULL, the option has been found*/
++	if(genericoption){
++		genericoption->Get(pvalue);
++	}
++	else{
++		/*Make a copy*/
++		char* outstring=NULL;
++		int   stringsize;
++
++		stringsize=strlen(default_value)+1;
++		outstring=xNew<char>(stringsize);
++		xMemCpy<char>(outstring,default_value,stringsize);
++		*pvalue=outstring;
++	}
++}
++/*}}}*/
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp	(revision 13384)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/bamg/Geometry.cpp	(revision 13385)
+@@ -528,6 +528,8 @@
+ 			if( v && Norme1(v->r - vertices[i].r) < eps ){
+ 				_printLine_("reference numbers: " << v->ReferenceNumber << " " << vertices[i].ReferenceNumber);
+ 				_printLine_("Id: " << i+1);
++				_printLine_("Coords: ["<<v->r.x<<" "<<v->r.y<<"] ["<<vertices[i].r.x<<" "<<vertices[i].r.y<<"]");
++
+ 				delete [] next_p;
+ 				delete [] head_v;
+ 				delete [] eangle;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13385-13386.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13385-13386.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13385-13386.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13385)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/issm.cpp	(revision 13386)
+@@ -16,11 +16,7 @@
+ 
+ 	/*AD: */
+ 	bool autodiff=false;
+-	#if _ADOLC_VERSION_ == 2
+-	int      tape_stats[11];
+-	#else
+ 	size_t   tape_stats[11];
+-	#endif
+ 
+ 	/*FemModel: */
+ 	FemModel *femmodel = NULL;
Index: /issm/oecreview/Archive/12678-13393/ISSM-13386-13387.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13386-13387.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13386-13387.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_linear.cpp
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_linear.cpp	(revision 13386)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solvers/solver_linear.cpp	(revision 13387)
+@@ -28,6 +28,11 @@
+ 	Reduceloadx(pf, Kfs, ys); xdelete(&Kfs);
+ 	Solverx(&uf, Kff, pf, NULL, df, femmodel->parameters); 
+ 	xdelete(&Kff); xdelete(&pf); xdelete(&df);
++//#ifdef  _HAVE_ADOLC_
++//        for (int i =0; i<uf->svector->M; ++i) {
++//          ADOLC_DUMP_MACRO(uf->svector->vector[i]);
++//        }
++//#endif
+ 	Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);xdelete(&uf); xdelete(&ys);
+ 	InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug); 
+ 	xdelete(&ug);  xdelete(&uf);
Index: /issm/oecreview/Archive/12678-13393/ISSM-13387-13388.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13387-13388.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13387-13388.diff	(revision 13394)
@@ -0,0 +1,16 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13387)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/adolc/install-dev.sh	(revision 13388)
+@@ -10,10 +10,7 @@
+ cd adolc_v220_issm
+ 
+ autoreconf -f -i 
+-./configure --prefix=$ISSM_DIR/externalpackages/adolc/install \
+-	--enable-docexa \
+-	--enable-addexa \
+-	--enable-stdczero 
++./configure --prefix=$ISSM_DIR/externalpackages/adolc/install 
+ 
+ if [ $# -eq 0 ]; then
+ 	make
Index: /issm/oecreview/Archive/12678-13393/ISSM-13388-13389.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13388-13389.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13388-13389.diff	(revision 13394)
@@ -0,0 +1,11 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-ad.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-ad.sh	(revision 13388)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configs/config-linux64-astrid-ad.sh	(revision 13389)
+@@ -6,5 +6,6 @@
+ 	--without-kml  \
+ 	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
+ 	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install \
++	--with-adolc-version=3 \
+ 	--with-matlab-dir=$MATLAB_DIR \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
Index: /issm/oecreview/Archive/12678-13393/ISSM-13389-13390.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13389-13390.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13389-13390.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13389)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/etc/environment.sh	(revision 13390)
+@@ -220,7 +220,7 @@
+ libpathappend "$TCLX_DIR"
+ 
+ ASPELL_DIR="$ISSM_DIR/externalpackages/aspell/install"
+-pathappend "$ASPELL_DIR/bin:$PATH"
++pathappend "$ASPELL_DIR/bin"
+ 
+ HDF5_DIR="$ISSM_DIR/externalpackages/hdf5/install"
+ if [ -d "$HDF5_DIR" ]; then
Index: /issm/oecreview/Archive/12678-13393/ISSM-13390-13391.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13390-13391.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13390-13391.diff	(revision 13394)
@@ -0,0 +1,10 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects	(revision 13390)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects	(revision 13391)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1 ##
++Params.new
Index: /issm/oecreview/Archive/12678-13393/ISSM-13391-13392.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13391-13392.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13391-13392.diff	(revision 13394)
@@ -0,0 +1,13 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13391)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/configure.ac	(revision 13392)
+@@ -1,7 +1,7 @@
+ # Process this file with autoconf to produce a configure script.
+ 
+ #AUTOCONF
+-AC_INIT([ISSM],[4.2.1],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
++AC_INIT([ISSM],[4.2.2],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
+ AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
+ AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
+ m4_include([m4/issm_options.m4])
Index: /issm/oecreview/Archive/12678-13393/ISSM-13392-13393.diff
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-13392-13393.diff	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-13392-13393.diff	(revision 13394)
@@ -0,0 +1,27 @@
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test	(revision 13392)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test	(revision 13393)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/test
+___________________________________________________________________
+Modified: svn:mergeinfo
+   Merged /issm/trunk/test:r12711-13392
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src	(revision 13392)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src	(revision 13393)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src
+___________________________________________________________________
+Modified: svn:mergeinfo
+   Merged /issm/trunk/src:r12711-13392
+Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl
+===================================================================
+--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl	(revision 13392)
++++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl	(revision 13393)
+
+Property changes on: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl
+___________________________________________________________________
+Modified: svn:mergeinfo
+   Merged /issm/trunk:r12711-13392
Index: /issm/oecreview/Archive/12678-13393/ISSM-DocReview-12678-13393.tex
===================================================================
--- /issm/oecreview/Archive/12678-13393/ISSM-DocReview-12678-13393.tex	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/ISSM-DocReview-12678-13393.tex	(revision 13394)
@@ -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.eps}
+
+\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/12678-13393/LogNumber.tex
===================================================================
--- /issm/oecreview/Archive/12678-13393/LogNumber.tex	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/LogNumber.tex	(revision 13394)
@@ -0,0 +1,1 @@
+12678-13393
Index: /issm/oecreview/Archive/12678-13393/Makefile
===================================================================
--- /issm/oecreview/Archive/12678-13393/Makefile	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/Makefile	(revision 13394)
@@ -0,0 +1,11 @@
+name=ISSM-DocReview-12678-13393
+
+
+all: 
+	latex $(name).tex
+	dvips $(name).dvi
+	ps2pdf $(name).ps  $(name).pdf
+	rm -rf *.dvi *.log *.aux *.ps
+
+clean:
+	rm -rf *.dvi *.log *.aux
Index: /issm/oecreview/Archive/12678-13393/log.tex
===================================================================
--- /issm/oecreview/Archive/12678-13393/log.tex	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/log.tex	(revision 13394)
@@ -0,0 +1,4802 @@
+\noindent \textbf{Change \#1} with diff file ISSM-12682-12683.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/android/doc\\
+Export determination: 6. \\
+Rationale: Removed Android Project documenation. Now resides in JPL trunk.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#2} with diff file ISSM-12683-12684.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/Synchronize.sh\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#3} with diff file ISSM-12684-12685.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#4} with diff file ISSM-12685-12686.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/enum/EnumDefinitions.py A /issm/trunk-jpl/src/m/enum/SurfaceforcingsANegEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsAPosEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsBNegEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsBPosEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsHcEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsIssmbgradientsEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsSmbPosMaxEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsSmbPosMinEnum.m\\
+Export determination: 6. \\
+Rationale: Synchronized Enums (Added missing files for NR)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#5} with diff file ISSM-12686-12687.diff: \\
+Function name: \\
+M /issm/trunk-jpl/startup.py\\
+Export determination: 6. \\
+Rationale: removed print statement\\
+\vspace{3em}
+
+\noindent \textbf{Change \#6} with diff file ISSM-12687-12688.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh M /issm/trunk-jpl/etc/environment\_variables.sh\\
+Export determination: 6. \\
+Rationale: ncview, tclx, aspell and hdf hookups.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#7} with diff file ISSM-12688-12689.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/ad/todo\\
+Export determination: 6. \\
+Rationale: AD todo\\
+\vspace{3em}
+
+\noindent \textbf{Change \#8} with diff file ISSM-12689-12690.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-macosx64-larour-ad.sh\\
+Export determination: 6. \\
+Rationale: More efficient config-macosx64-larour-ad.sh file.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#9} with diff file ISSM-12690-12691.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/utils/Kml/exp2kml.m\\
+Export determination: 6. \\
+Rationale: Fixed bug\\
+\vspace{3em}
+
+\noindent \textbf{Change \#10} with diff file ISSM-12691-12692.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/utils/Exp/expcontract.m\\
+Export determination: 6. \\
+Rationale: New expread interface. Updated.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#11} with diff file ISSM-12692-12693.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/utils/Basins/isbasin.m M /issm/trunk-jpl/src/m/utils/Basins/showbasins.m\\
+Export determination: 6. \\
+Rationale: New path to basins\\
+\vspace{3em}
+
+\noindent \textbf{Change \#12} with diff file ISSM-12693-12694.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/modules A /issm/trunk-jpl/externalpackages/modules/install.sh\\
+Export determination: 6. \\
+Rationale: Added modules package\\
+\vspace{3em}
+
+\noindent \textbf{Change \#13} with diff file ISSM-12694-12695.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/c/shared/Sys\\
+Export determination: 6. \\
+Rationale: System routines: profiling, time, etc ...\\
+\vspace{3em}
+
+\noindent \textbf{Change \#14} with diff file ISSM-12695-12696.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/modules/install.sh\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#15} with diff file ISSM-12696-12697.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp A /issm/trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp A /issm/trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp A /issm/trunk-jpl/src/c/shared/Sys/sys.h M /issm/trunk-jpl/src/c/shared/shared.h M /issm/trunk-jpl/src/c/solutions/issm.cpp M /issm/trunk-jpl/src/m/classes/debug.m D /issm/trunk-jpl/src/m/enum/DebugPetscProfilingEnum.m A /issm/trunk-jpl/src/m/enum/DebugProfilingEnum.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py D /issm/trunk-jpl/src/m/enum/PetscProfilingCurrentFlopsEnum.m D /issm/trunk-jpl/src/m/enum/PetscProfilingCurrentMemEnum.m D /issm/trunk-jpl/src/m/enum/PetscProfilingSolutionTimeEnum.m A /issm/trunk-jpl/src/m/enum/ProfilingCurrentFlopsEnum.m A /issm/trunk-jpl/src/m/enum/ProfilingCurrentMemEnum.m A /issm/trunk-jpl/src/m/enum/ProfilingSolutionTimeEnum.m\\
+Export determination: 6. \\
+Rationale: Generalized profiling in issm.cpp to be applicable even when Petsc is not available. Concentrated all profiling stuff in two routines, ProfilingStart and ProfilingEnd.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#16} with diff file ISSM-12697-12698.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/automakererun.sh\\
+Export determination: 6. \\
+Rationale: Removed exit 0 statement, which was too restrictive.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#17} with diff file ISSM-12698-12699.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m A /issm/trunk-jpl/test/NightlyRun/test356.m\\
+Export determination: 6. \\
+Rationale: NightlyRun test for SMB Gradients\\
+\vspace{3em}
+
+\noindent \textbf{Change \#18} with diff file ISSM-12699-12700.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test356.m\\
+Export determination: 6. \\
+Rationale: error repaired in NightlyRun SMB Gradients\\
+\vspace{3em}
+
+\noindent \textbf{Change \#19} with diff file ISSM-12700-12701.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m A /issm/trunk-jpl/test/NightlyRun/test358.m\\
+Export determination: 6. \\
+Rationale: NightlyRun test for SMB Gradients in 3d mode\\
+\vspace{3em}
+
+\noindent \textbf{Change \#20} with diff file ISSM-12701-12702.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp\\
+Export determination: 6. \\
+Rationale: Fixed compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#21} with diff file ISSM-12702-12703.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive356.mat A /issm/trunk-jpl/test/Archives/Archive358.mat\\
+Export determination: 6. \\
+Rationale: added archives for smbgradients nightly runs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#22} with diff file ISSM-12703-12704.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac\\
+Export determination: 6. \\
+Rationale: update version number\\
+\vspace{3em}
+
+\noindent \textbf{Change \#23} with diff file ISSM-12704-12705.diff: \\
+Function name: \\
+M /issm/trunk-jpl M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim M /issm/trunk-jpl/src/c/Container/Elements.cpp M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp M /issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp M /issm/trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.cpp M /issm/trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h M /issm/trunk-jpl/src/c/objects/Elements/Element.h M /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/objects/Elements/Penta.h M /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/objects/Elements/Tria.h M /issm/trunk-jpl/src/c/objects/Inputs/BoolInput.h M /issm/trunk-jpl/src/c/objects/Inputs/ControlInput.h M /issm/trunk-jpl/src/c/objects/Inputs/DatasetInput.h M /issm/trunk-jpl/src/c/objects/Inputs/DoubleInput.h M /issm/trunk-jpl/src/c/objects/Inputs/Input.h M /issm/trunk-jpl/src/c/objects/Inputs/IntInput.h M /issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.h M /issm/trunk-jpl/src/c/objects/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/objects/Inputs/TransientInput.h M /issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.h A /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp (from /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalance.cpp:12703) M /issm/trunk-jpl/src/c/shared/Elements/elements.h M /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp M /issm/trunk-jpl/src/m/model/extrude.m\\
+Export determination: 6. \\
+Rationale: merged trunk and trunk-jpl\\
+\vspace{3em}
+
+\noindent \textbf{Change \#24} with diff file ISSM-12705-12706.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/objects/Inputs/TransientInput.h M /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#25} with diff file ISSM-12710-12711.diff: \\
+Function name: \\
+M /issm/trunk-jpl\\
+Export determination: 6. \\
+Rationale: Block revision 12709 from being merged into trunk-jpl\\
+\vspace{3em}
+
+\noindent \textbf{Change \#26} with diff file ISSM-12711-12712.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/modules/install-macosx64.sh\\
+Export determination: 6. \\
+Rationale: Macosx64 version of modules, using tcl and tclx\\
+\vspace{3em}
+
+\noindent \textbf{Change \#27} with diff file ISSM-12712-12713.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/tclx A /issm/trunk-jpl/externalpackages/tclx/install.sh\\
+Export determination: 6. \\
+Rationale: tclx package\\
+\vspace{3em}
+
+\noindent \textbf{Change \#28} with diff file ISSM-12713-12714.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/esmf\\
+Export determination: 6. \\
+Rationale: esmf package\\
+\vspace{3em}
+
+\noindent \textbf{Change \#29} with diff file ISSM-12714-12715.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/automake M /issm/trunk-jpl/externalpackages/ncview M /issm/trunk-jpl/externalpackages/netcdf\\
+Export determination: 6. \\
+Rationale: Ignore some packages\\
+\vspace{3em}
+
+\noindent \textbf{Change \#30} with diff file ISSM-12715-12716.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/octave M /issm/trunk-jpl/externalpackages/octave/install.sh\\
+Export determination: 6. \\
+Rationale: Ignore some files in svn. Some bug fixing in the install.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#31} with diff file ISSM-12716-12717.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/gsl M /issm/trunk-jpl/externalpackages/netcdf-python\\
+Export determination: 6. \\
+Rationale: Ignore some files for svn\\
+\vspace{3em}
+
+\noindent \textbf{Change \#32} with diff file ISSM-12717-12718.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/aspell M /issm/trunk-jpl/externalpackages/aspell/install.sh\\
+Export determination: 6. \\
+Rationale: Ignore some files for svn. Change default step.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#33} with diff file ISSM-12718-12719.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/gdal M /issm/trunk-jpl/externalpackages/gdal/install.sh\\
+Export determination: 6. \\
+Rationale: Ignore some files under svn. Change install defaults.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#34} with diff file ISSM-12719-12720.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/tcl A /issm/trunk-jpl/externalpackages/tcl/install.sh\\
+Export determination: 6. \\
+Rationale: New tcl package\\
+\vspace{3em}
+
+\noindent \textbf{Change \#35} with diff file ISSM-12720-12721.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/python M /issm/trunk-jpl/externalpackages/python/install-macosx-lion.sh M /issm/trunk-jpl/externalpackages/python/install-macosx-snowleopard.sh\\
+Export determination: 6. \\
+Rationale: Updated patching of pyport.h + ignore some files under svn\\
+\vspace{3em}
+
+\noindent \textbf{Change \#36} with diff file ISSM-12721-12722.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/android M /issm/trunk-jpl/externalpackages/android/android-emulators M /issm/trunk-jpl/externalpackages/android/android-ndk\\
+Export determination: 6. \\
+Rationale: Ignore some files under svn\\
+\vspace{3em}
+
+\noindent \textbf{Change \#37} with diff file ISSM-12722-12723.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages M /issm/trunk-jpl/externalpackages/adolc M /issm/trunk-jpl/externalpackages/autoconf M /issm/trunk-jpl/externalpackages/h5py M /issm/trunk-jpl/externalpackages/hdf5 M /issm/trunk-jpl/externalpackages/libtool M /issm/trunk-jpl/externalpackages/modules M /issm/trunk-jpl/externalpackages/pcre M /issm/trunk-jpl/externalpackages/tcl\\
+Export determination: 6. \\
+Rationale: Ignore some svn file under svn\\
+\vspace{3em}
+
+\noindent \textbf{Change \#38} with diff file ISSM-12723-12724.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh\\
+Export determination: 6. \\
+Rationale: Added install-3.3-linux64.sh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#39} with diff file ISSM-12724-12725.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/tao/install-2.0.sh (from /issm/trunk-jpl/externalpackages/tao/install.sh:12722) A /issm/trunk-jpl/externalpackages/tao/install-2.1.sh D /issm/trunk-jpl/externalpackages/tao/install.sh\\
+Export determination: 6. \\
+Rationale: Added tao 2.1 for petsc 3.3 and petsc dev\\
+\vspace{3em}
+
+\noindent \textbf{Change \#40} with diff file ISSM-12725-12726.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/objects/Bamg/Mesh.cpp\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#41} with diff file ISSM-12726-12727.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Container/DataSet.h M /issm/trunk-jpl/src/c/Container/Observations.cpp\\
+Export determination: 6. \\
+Rationale: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#42} with diff file ISSM-12727-12728.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp M /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.h\\
+Export determination: 6. \\
+Rationale: Added power as an option\\
+\vspace{3em}
+
+\noindent \textbf{Change \#43} with diff file ISSM-12728-12729.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp\\
+Export determination: 6. \\
+Rationale: Faster interpolation module\\
+\vspace{3em}
+
+\noindent \textbf{Change \#44} with diff file ISSM-12729-12730.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp\\
+Export determination: 6. \\
+Rationale: Added support for PETSC 3.3\\
+\vspace{3em}
+
+\noindent \textbf{Change \#45} with diff file ISSM-12730-12731.diff: \\
+Function name: \\
+A /issm/trunk-jpl/configs/config-linux64-astrid-petsc3.3.sh\\
+Export determination: 6. \\
+Rationale: Added config file for petsc 3.3\\
+\vspace{3em}
+
+\noindent \textbf{Change \#46} with diff file ISSM-12731-12732.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS\_PartMeshNodalPatch.cpp\\
+Export determination: 6. \\
+Rationale: Fixed leak for METIS 5\\
+\vspace{3em}
+
+\noindent \textbf{Change \#47} with diff file ISSM-12732-12733.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/plot/plot\_gridded.m\\
+Export determination: 6. \\
+Rationale: use subplotmodel instead of subplot in plot\_gridded\\
+\vspace{3em}
+
+\noindent \textbf{Change \#48} with diff file ISSM-12733-12734.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/MatlabProcessPatch.m A /issm/trunk-jpl/src/m/model/MatlabProcessPatch.py A /issm/trunk-jpl/src/m/model/loadresultsfromcluster.py A /issm/trunk-jpl/src/m/model/loadresultsfromdisk.py M /issm/trunk-jpl/src/m/model/marshall.py M /issm/trunk-jpl/src/m/model/parseresultsfromdisk.m A /issm/trunk-jpl/src/m/model/parseresultsfromdisk.py A /issm/trunk-jpl/src/m/utils/OS/ispetsc.py A /issm/trunk-jpl/src/m/utils/Shell/issmdir.py\\
+Export determination: 6. \\
+Rationale: Preliminary python versions of loadresultsfromcluster and supporting functions (in preparation for solve).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#49} with diff file ISSM-12734-12735.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/python/install-macosx-lion.sh D /issm/trunk-jpl/externalpackages/python/patch A /issm/trunk-jpl/externalpackages/python/patches A /issm/trunk-jpl/externalpackages/python/patches/pyport.h.patch A /issm/trunk-jpl/externalpackages/python/patches/pyport.h.patch.bugreport\\
+Export determination: 6. \\
+Rationale: Weird stuff going on with patch directory\\
+\vspace{3em}
+
+\noindent \textbf{Change \#50} with diff file ISSM-12735-12736.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh (from /issm/trunk-jpl/externalpackages/python/install-linux64-astrid.sh:12734) A /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh (from /issm/trunk-jpl/externalpackages/python/install-macosx-lion.sh:12734) A /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh (from /issm/trunk-jpl/externalpackages/python/install-macosx-snowleopard.sh:12734) A /issm/trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh A /issm/trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh A /issm/trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh D /issm/trunk-jpl/externalpackages/python/install-linux64-astrid.sh D /issm/trunk-jpl/externalpackages/python/install-macosx-lion.sh D /issm/trunk-jpl/externalpackages/python/install-macosx-snowleopard.sh\\
+Export determination: 6. \\
+Rationale: Make separate installation scripts for different versions (same as other packages like petsc, mpich2, etc)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#51} with diff file ISSM-12736-12737.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/netcdf/install-4.0.sh (from /issm/trunk-jpl/externalpackages/netcdf/install.sh:12735) A /issm/trunk-jpl/externalpackages/netcdf/install-4.2.sh D /issm/trunk-jpl/externalpackages/netcdf/install.sh\\
+Export determination: 6. \\
+Rationale: Make separate installation scripts for different versions (same as other packages like petsc, mpich2, etc)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#52} with diff file ISSM-12737-12738.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/octave/install.sh\\
+Export determination: 6. \\
+Rationale: only one version for now\\
+\vspace{3em}
+
+\noindent \textbf{Change \#53} with diff file ISSM-12738-12739.diff: \\
+Function name: \\
+M /issm/trunk-jpl/Makefile.am M /issm/trunk-jpl/configs/config-arm-linux.sh M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/etc/environment\_variables.sh M /issm/trunk-jpl/externalpackages/android/android-ndk/install.sh M /issm/trunk-jpl/externalpackages/android/android-sdk/install.sh A /issm/trunk-jpl/externalpackages/android/android\_aux.sh (from /issm/trunk-jpl/externalpackages/android/android\_variables.sh:12722) D /issm/trunk-jpl/externalpackages/android/android\_variables.sh M /issm/trunk-jpl/externalpackages/gsl/install-android.sh M /issm/trunk-jpl/externalpackages/triangle/install-android.sh M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/m4/libtool.m4 M /issm/trunk-jpl/m4/ltoptions.m4 M /issm/trunk-jpl/m4/ltversion.m4 M /issm/trunk-jpl/m4/lt~obsolete.m4 M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: Changes to Autotools related files and Android scripts.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#54} with diff file ISSM-12739-12740.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: minor output\\
+\vspace{3em}
+
+\noindent \textbf{Change \#55} with diff file ISSM-12740-12741.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: Minor change to src/c/Makefile.am\\
+\vspace{3em}
+
+\noindent \textbf{Change \#56} with diff file ISSM-12741-12742.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: Minor change to src/c/Makefile.am... again\\
+\vspace{3em}
+
+\noindent \textbf{Change \#57} with diff file ISSM-12742-12743.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac\\
+Export determination: 6. \\
+Rationale: Minor change to configure.ac\\
+\vspace{3em}
+
+\noindent \textbf{Change \#58} with diff file ISSM-12743-12744.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/utils/OS/ispetsc.py M /issm/trunk-jpl/src/m/utils/OS/issmscpin.m A /issm/trunk-jpl/src/m/utils/OS/issmscpin.py M /issm/trunk-jpl/src/m/utils/OS/issmscpout.m A /issm/trunk-jpl/src/m/utils/OS/issmscpout.py M /issm/trunk-jpl/src/m/utils/OS/issmssh.m A /issm/trunk-jpl/src/m/utils/OS/issmssh.py\\
+Export determination: 6. \\
+Rationale: Preliminary python versions of issmssh, issmscpin, and issmscpout (in preparation for class generic).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#59} with diff file ISSM-12744-12745.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/c/objects/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/objects/Params/BoolParam.h M /issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h M /issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.h M /issm/trunk-jpl/src/c/objects/Params/DoubleParam.h M /issm/trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.cpp M /issm/trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.h M /issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.h M /issm/trunk-jpl/src/c/objects/Params/FileParam.h M /issm/trunk-jpl/src/c/objects/Params/IntMatParam.h M /issm/trunk-jpl/src/c/objects/Params/IntParam.h M /issm/trunk-jpl/src/c/objects/Params/IntVecParam.h M /issm/trunk-jpl/src/c/objects/Params/MatrixParam.h M /issm/trunk-jpl/src/c/objects/Params/Param.h M /issm/trunk-jpl/src/c/objects/Params/StringArrayParam.h M /issm/trunk-jpl/src/c/objects/Params/StringParam.h A /issm/trunk-jpl/src/c/objects/Params/TransientParam.cpp A /issm/trunk-jpl/src/c/objects/Params/TransientParam.h M /issm/trunk-jpl/src/c/objects/Params/VectorParam.h M /issm/trunk-jpl/src/c/objects/objects.h\\
+Export determination: 6. \\
+Rationale: Added TransientParam\\
+\vspace{3em}
+
+\noindent \textbf{Change \#60} with diff file ISSM-12745-12746.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m A /issm/trunk-jpl/src/m/enum/TransientParamEnum.m\\
+Export determination: 6. \\
+Rationale: Added TransientParam\\
+\vspace{3em}
+
+\noindent \textbf{Change \#61} with diff file ISSM-12746-12747.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Container/Parameters.cpp M /issm/trunk-jpl/src/c/Container/Parameters.h\\
+Export determination: 6. \\
+Rationale: Added method for TransientInput\\
+\vspace{3em}
+
+\noindent \textbf{Change \#62} with diff file ISSM-12747-12748.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/objects/Params/TransientParam.h\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#63} with diff file ISSM-12748-12749.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/matlab/install.sh M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/Makefile.am A /issm/trunk-jpl/src/c/modules/Delta18oParameterizationx A /issm/trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp A /issm/trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/c/modules/modules.h M /issm/trunk-jpl/src/c/objects/Elements/Element.h M /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/objects/Elements/Penta.h M /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/objects/Elements/Tria.h A /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp M /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp M /issm/trunk-jpl/src/c/shared/Elements/elements.h M /issm/trunk-jpl/src/c/solutions/prognostic\_core.cpp M /issm/trunk-jpl/src/c/solutions/transient\_core.cpp M /issm/trunk-jpl/src/m/classes/surfaceforcings.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsDelta18oEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsDelta18oSurfaceEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsIsdelta18oEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsPrecipitationsPresentdayEnum.m\\
+Export determination: 6. \\
+Rationale: addind delta18o temperature and precipitation methode\\
+\vspace{3em}
+
+\noindent \textbf{Change \#64} with diff file ISSM-12749-12750.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/matlab/install.sh\\
+Export determination: 6. \\
+Rationale: reverting back to normal\\
+\vspace{3em}
+
+\noindent \textbf{Change \#65} with diff file ISSM-12750-12751.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: Added check to avoid segfault\\
+\vspace{3em}
+
+\noindent \textbf{Change \#66} with diff file ISSM-12751-12752.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp\\
+Export determination: 6. \\
+Rationale: Added fetch elements\\
+\vspace{3em}
+
+\noindent \textbf{Change \#67} with diff file ISSM-12752-12753.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: Fixed some leaks\\
+\vspace{3em}
+
+\noindent \textbf{Change \#68} with diff file ISSM-12753-12754.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.m M /issm/trunk-jpl/src/m/classes/clusters/generic.py\\
+Export determination: 6. \\
+Rationale: Preliminary python version of class generic.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#69} with diff file ISSM-12754-12755.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py\\
+Export determination: 6. \\
+Rationale: Fixed a couple errors.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#70} with diff file ISSM-12755-12756.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/ismodelselfconsistent.m A /issm/trunk-jpl/src/m/model/ismodelselfconsistent.py A /issm/trunk-jpl/src/m/model/solve.py\\
+Export determination: 6. \\
+Rationale: Preliminary python versions of ismodelselfconsistent and solve.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#71} with diff file ISSM-12756-12757.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.m\\
+Export determination: 6. \\
+Rationale: Fixed what probably is an ancient typo.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#72} with diff file ISSM-12757-12758.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/ismodelselfconsistent.py\\
+Export determination: 6. \\
+Rationale: Fixed typo.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#73} with diff file ISSM-12758-12759.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/utils/OS/ismumps.py\\
+Export determination: 6. \\
+Rationale: Python version of ismumps.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#74} with diff file ISSM-12759-12760.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp M /issm/trunk-jpl/src/c/solutions/prognostic\_core.cpp M /issm/trunk-jpl/src/c/solutions/transient\_core.cpp\\
+Export determination: 6. \\
+Rationale: move ispdd back to prognostic (instead of transient)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#75} with diff file ISSM-12760-12761.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp M /issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.h M /issm/trunk-jpl/src/c/objects/Params/TransientParam.cpp M /issm/trunk-jpl/src/c/objects/Params/TransientParam.h\\
+Export determination: 6. \\
+Rationale: removed GetPointer not used anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#76} with diff file ISSM-12761-12762.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#77} with diff file ISSM-12762-12763.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/model.py A /issm/trunk-jpl/src/m/model/petscversion.py M /issm/trunk-jpl/src/m/utils/OS/ismumps.py M /issm/trunk-jpl/src/m/utils/OS/ispetsc.py\\
+Export determination: 6. \\
+Rationale: Python version of petscversion plus other minor changes.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#78} with diff file ISSM-12763-12764.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m\\
+Export determination: 6. \\
+Rationale: changed IdToName to remove all Serial tests that don't exist anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#79} with diff file ISSM-12764-12765.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#80} with diff file ISSM-12765-12766.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/py/model/petscversion.2.py D /issm/trunk-jpl/src/py/utils/OS/ismumps.py D /issm/trunk-jpl/src/py/utils/Shell/issmtier.py\\
+Export determination: 6. \\
+Rationale: Deleted some non-functional python scripts.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#81} with diff file ISSM-12766-12767.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/petscversion.py\\
+Export determination: 6. \\
+Rationale: Fixed typos.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#82} with diff file ISSM-12767-12768.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: Removed SUCCESSES from report\\
+\vspace{3em}
+
+\noindent \textbf{Change \#83} with diff file ISSM-12768-12769.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#84} with diff file ISSM-12769-12770.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#85} with diff file ISSM-12770-12771.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/Makefile.am\\
+Export determination: 6. \\
+Rationale: Do not install py anymore as everything is in src/m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#86} with diff file ISSM-12771-12772.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp M /issm/trunk-jpl/src/c/shared/Elements/elements.h M /issm/trunk-jpl/src/c/solutions/prognostic\_core.cpp M /issm/trunk-jpl/src/m/classes/surfaceforcings.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py D /issm/trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m D /issm/trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m M /issm/trunk-jpl/src/m/model/extrude.m M /issm/trunk-jpl/test/NightlyRun/IdToName.m\\
+Export determination: 6. \\
+Rationale: some minor modification for delta18o methode\\
+\vspace{3em}
+
+\noindent \textbf{Change \#87} with diff file ISSM-12772-12773.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m\\
+Export determination: 6. \\
+Rationale: removing the nightly run for delta018 methode\\
+\vspace{3em}
+
+\noindent \textbf{Change \#88} with diff file ISSM-12773-12774.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/matlab/install.sh M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp M /issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp A /issm/trunk-jpl/src/c/modules/TotalSmbx A /issm/trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.cpp A /issm/trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h M /issm/trunk-jpl/src/c/modules/modules.h M /issm/trunk-jpl/src/c/objects/Elements/Element.h M /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/objects/Elements/Penta.h M /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/objects/Elements/Tria.h M /issm/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m A /issm/trunk-jpl/src/m/enum/TotalSmbEnum.m\\
+Export determination: 6. \\
+Rationale: added an optional output: TotalSmb\\
+\vspace{3em}
+
+\noindent \textbf{Change \#89} with diff file ISSM-12774-12775.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/matlab/install.sh\\
+Export determination: 6. \\
+Rationale: back to normal\\
+\vspace{3em}
+
+\noindent \textbf{Change \#90} with diff file ISSM-12775-12776.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/include/macros.h\\
+Export determination: 6. \\
+Rationale: Updated comments for printf macros\\
+\vspace{3em}
+
+\noindent \textbf{Change \#91} with diff file ISSM-12776-12777.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h\\
+Export determination: 6. \\
+Rationale: Extended I/O capability\\
+\vspace{3em}
+
+\noindent \textbf{Change \#92} with diff file ISSM-12777-12778.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp\\
+Export determination: 6. \\
+Rationale: Cosmetic.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#93} with diff file ISSM-12778-12779.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h\\
+Export determination: 6. \\
+Rationale: Can take options in Python, but not processed.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#94} with diff file ISSM-12779-12780.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment\_variables.sh\\
+Export determination: 6. \\
+Rationale: Added Python Version macro\\
+\vspace{3em}
+
+\noindent \textbf{Change \#95} with diff file ISSM-12780-12781.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-macosx64-larour-python.sh\\
+Export determination: 6. \\
+Rationale: Quicked python config flag\\
+\vspace{3em}
+
+\noindent \textbf{Change \#96} with diff file ISSM-12781-12782.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test356.m M /issm/trunk-jpl/test/NightlyRun/test358.m\\
+Export determination: 6. \\
+Rationale: Added TotalSmb to Nightlyruns\\
+\vspace{3em}
+
+\noindent \textbf{Change \#97} with diff file ISSM-12782-12783.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive356.mat M /issm/trunk-jpl/test/Archives/Archive358.mat\\
+Export determination: 6. \\
+Rationale: Archives 356 and 358 to add TotalSMB\\
+\vspace{3em}
+
+\noindent \textbf{Change \#98} with diff file ISSM-12783-12784.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp\\
+Export determination: 6. \\
+Rationale: fixed bug in Penta.cpp concering TotalSmb\\
+\vspace{3em}
+
+\noindent \textbf{Change \#99} with diff file ISSM-12784-12785.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removed duplicate lines and added a dot to make sure 0 is treated as a double\\
+\vspace{3em}
+
+\noindent \textbf{Change \#100} with diff file ISSM-12785-12786.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: Fixed bug in which python version came in too late to pick up the right python library.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#101} with diff file ISSM-12786-12787.diff: \\
+Function name: \\
+M /issm/trunk-jpl/startup.py\\
+Export determination: 6. \\
+Rationale: No need for issmtier anymore.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#102} with diff file ISSM-12787-12788.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.py\\
+Export determination: 6. \\
+Rationale: IdToName for python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#103} with diff file ISSM-12788-12789.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m M /issm/trunk-jpl/test/NightlyRun/IdToName.py A /issm/trunk-jpl/test/NightlyRun/test101.m (from /issm/trunk-jpl/test/NightlyRun/test102.m:12786) A /issm/trunk-jpl/test/NightlyRun/test101.py (from /issm/trunk-jpl/test/NightlyRun/test102.py:12786) R /issm/trunk-jpl/test/NightlyRun/test102.m (from /issm/trunk-jpl/test/NightlyRun/test104.m:12786) D /issm/trunk-jpl/test/NightlyRun/test102.py A /issm/trunk-jpl/test/NightlyRun/test103.m (from /issm/trunk-jpl/test/NightlyRun/test106.m:12786) R /issm/trunk-jpl/test/NightlyRun/test104.m (from /issm/trunk-jpl/test/NightlyRun/test108.m:12786) A /issm/trunk-jpl/test/NightlyRun/test105.m (from /issm/trunk-jpl/test/NightlyRun/test110.m:12786) R /issm/trunk-jpl/test/NightlyRun/test106.m (from /issm/trunk-jpl/test/NightlyRun/test112.m:12786) A /issm/trunk-jpl/test/NightlyRun/test107.m (from /issm/trunk-jpl/test/NightlyRun/test114.m:12786) R /issm/trunk-jpl/test/NightlyRun/test108.m (from /issm/trunk-jpl/test/NightlyRun/test116.m:12786) A /issm/trunk-jpl/test/NightlyRun/test109.m (from /issm/trunk-jpl/test/NightlyRun/test118.m:12786) R /issm/trunk-jpl/test/NightlyRun/test110.m (from /issm/trunk-jpl/test/NightlyRun/test120.m:12786) A /issm/trunk-jpl/test/NightlyRun/test111.m (from /issm/trunk-jpl/test/NightlyRun/test122.m:12786) R /issm/trunk-jpl/test/NightlyRun/test112.m (from /issm/trunk-jpl/test/NightlyRun/test124.m:12786) A /issm/trunk-jpl/test/NightlyRun/test113.m (from /issm/trunk-jpl/test/NightlyRun/test126.m:12786) R /issm/trunk-jpl/test/NightlyRun/test114.m (from /issm/trunk-jpl/test/NightlyRun/test128.m:12786) A /issm/trunk-jpl/test/NightlyRun/test115.m (from /issm/trunk-jpl/test/NightlyRun/test130.m:12786) R /issm/trunk-jpl/test/NightlyRun/test116.m (from /issm/trunk-jpl/test/NightlyRun/test132.m:12786) A /issm/trunk-jpl/test/NightlyRun/test117.m (from /issm/trunk-jpl/test/NightlyRun/test134.m:12786) R /issm/trunk-jpl/test/NightlyRun/test118.m (from /issm/trunk-jpl/test/NightlyRun/test136.m:12786) A /issm/trunk-jpl/test/NightlyRun/test119.m (from /issm/trunk-jpl/test/NightlyRun/test137.m:12786) R /issm/trunk-jpl/test/NightlyRun/test120.m (from /issm/trunk-jpl/test/NightlyRun/test140.m:12786) A /issm/trunk-jpl/test/NightlyRun/test121.m (from /issm/trunk-jpl/test/NightlyRun/test142.m:12786) R /issm/trunk-jpl/test/NightlyRun/test122.m (from /issm/trunk-jpl/test/NightlyRun/test144.m:12786) D /issm/trunk-jpl/test/NightlyRun/test124.m D /issm/trunk-jpl/test/NightlyRun/test126.m D /issm/trunk-jpl/test/NightlyRun/test128.m D /issm/trunk-jpl/test/NightlyRun/test130.m D /issm/trunk-jpl/test/NightlyRun/test132.m D /issm/trunk-jpl/test/NightlyRun/test134.m D /issm/trunk-jpl/test/NightlyRun/test136.m D /issm/trunk-jpl/test/NightlyRun/test137.m D /issm/trunk-jpl/test/NightlyRun/test140.m D /issm/trunk-jpl/test/NightlyRun/test142.m D /issm/trunk-jpl/test/NightlyRun/test144.m\\
+Export determination: 6. \\
+Rationale: changing nightly run numbers\\
+\vspace{3em}
+
+\noindent \textbf{Change \#104} with diff file ISSM-12789-12790.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive101.mat M /issm/trunk-jpl/test/Archives/Archive102.mat M /issm/trunk-jpl/test/Archives/Archive103.mat M /issm/trunk-jpl/test/Archives/Archive104.mat M /issm/trunk-jpl/test/Archives/Archive105.mat M /issm/trunk-jpl/test/Archives/Archive106.mat M /issm/trunk-jpl/test/Archives/Archive107.mat M /issm/trunk-jpl/test/Archives/Archive108.mat M /issm/trunk-jpl/test/Archives/Archive109.mat M /issm/trunk-jpl/test/Archives/Archive110.mat M /issm/trunk-jpl/test/Archives/Archive111.mat M /issm/trunk-jpl/test/Archives/Archive112.mat M /issm/trunk-jpl/test/Archives/Archive113.mat M /issm/trunk-jpl/test/Archives/Archive114.mat M /issm/trunk-jpl/test/Archives/Archive115.mat M /issm/trunk-jpl/test/Archives/Archive116.mat M /issm/trunk-jpl/test/Archives/Archive117.mat M /issm/trunk-jpl/test/Archives/Archive118.mat M /issm/trunk-jpl/test/Archives/Archive119.mat M /issm/trunk-jpl/test/Archives/Archive120.mat M /issm/trunk-jpl/test/Archives/Archive121.mat M /issm/trunk-jpl/test/Archives/Archive122.mat D /issm/trunk-jpl/test/Archives/Archive123.mat D /issm/trunk-jpl/test/Archives/Archive124.mat D /issm/trunk-jpl/test/Archives/Archive125.mat D /issm/trunk-jpl/test/Archives/Archive126.mat D /issm/trunk-jpl/test/Archives/Archive127.mat D /issm/trunk-jpl/test/Archives/Archive128.mat D /issm/trunk-jpl/test/Archives/Archive129.mat D /issm/trunk-jpl/test/Archives/Archive130.mat D /issm/trunk-jpl/test/Archives/Archive131.mat D /issm/trunk-jpl/test/Archives/Archive132.mat D /issm/trunk-jpl/test/Archives/Archive133.mat D /issm/trunk-jpl/test/Archives/Archive134.mat D /issm/trunk-jpl/test/Archives/Archive135.mat D /issm/trunk-jpl/test/Archives/Archive136.mat D /issm/trunk-jpl/test/Archives/Archive137.mat D /issm/trunk-jpl/test/Archives/Archive139.mat D /issm/trunk-jpl/test/Archives/Archive140.mat D /issm/trunk-jpl/test/Archives/Archive141.mat D /issm/trunk-jpl/test/Archives/Archive142.mat D /issm/trunk-jpl/test/Archives/Archive143.mat D /issm/trunk-jpl/test/Archives/Archive144.mat\\
+Export determination: 6. \\
+Rationale: archives 1XX\\
+\vspace{3em}
+
+\noindent \textbf{Change \#105} with diff file ISSM-12790-12791.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive101.mat M /issm/trunk-jpl/test/Archives/Archive102.mat M /issm/trunk-jpl/test/Archives/Archive103.mat M /issm/trunk-jpl/test/Archives/Archive104.mat M /issm/trunk-jpl/test/Archives/Archive105.mat M /issm/trunk-jpl/test/Archives/Archive106.mat M /issm/trunk-jpl/test/Archives/Archive107.mat M /issm/trunk-jpl/test/Archives/Archive108.mat M /issm/trunk-jpl/test/Archives/Archive109.mat M /issm/trunk-jpl/test/Archives/Archive110.mat M /issm/trunk-jpl/test/Archives/Archive111.mat M /issm/trunk-jpl/test/Archives/Archive112.mat M /issm/trunk-jpl/test/Archives/Archive113.mat M /issm/trunk-jpl/test/Archives/Archive114.mat M /issm/trunk-jpl/test/Archives/Archive115.mat M /issm/trunk-jpl/test/Archives/Archive116.mat M /issm/trunk-jpl/test/Archives/Archive117.mat M /issm/trunk-jpl/test/Archives/Archive118.mat M /issm/trunk-jpl/test/Archives/Archive119.mat M /issm/trunk-jpl/test/Archives/Archive120.mat M /issm/trunk-jpl/test/Archives/Archive121.mat M /issm/trunk-jpl/test/Archives/Archive122.mat\\
+Export determination: 6. \\
+Rationale: archives with the right matlab !\\
+\vspace{3em}
+
+\noindent \textbf{Change \#106} with diff file ISSM-12791-12792.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m A /issm/trunk-jpl/test/NightlyRun/test201.m (from /issm/trunk-jpl/test/NightlyRun/test202.m:12789) R /issm/trunk-jpl/test/NightlyRun/test202.m (from /issm/trunk-jpl/test/NightlyRun/test204.m:12789) A /issm/trunk-jpl/test/NightlyRun/test203.m (from /issm/trunk-jpl/test/NightlyRun/test206.m:12789) R /issm/trunk-jpl/test/NightlyRun/test204.m (from /issm/trunk-jpl/test/NightlyRun/test208.m:12789) A /issm/trunk-jpl/test/NightlyRun/test205.m (from /issm/trunk-jpl/test/NightlyRun/test210.m:12789) R /issm/trunk-jpl/test/NightlyRun/test206.m (from /issm/trunk-jpl/test/NightlyRun/test212.m:12789) A /issm/trunk-jpl/test/NightlyRun/test207.m (from /issm/trunk-jpl/test/NightlyRun/test214.m:12789) R /issm/trunk-jpl/test/NightlyRun/test208.m (from /issm/trunk-jpl/test/NightlyRun/test216.m:12789) A /issm/trunk-jpl/test/NightlyRun/test209.m (from /issm/trunk-jpl/test/NightlyRun/test218.m:12789) R /issm/trunk-jpl/test/NightlyRun/test210.m (from /issm/trunk-jpl/test/NightlyRun/test220.m:12789) A /issm/trunk-jpl/test/NightlyRun/test211.m (from /issm/trunk-jpl/test/NightlyRun/test222.m:12789) R /issm/trunk-jpl/test/NightlyRun/test212.m (from /issm/trunk-jpl/test/NightlyRun/test224.m:12789) A /issm/trunk-jpl/test/NightlyRun/test213.m (from /issm/trunk-jpl/test/NightlyRun/test226.m:12789) R /issm/trunk-jpl/test/NightlyRun/test214.m (from /issm/trunk-jpl/test/NightlyRun/test228.m:12789) A /issm/trunk-jpl/test/NightlyRun/test215.m (from /issm/trunk-jpl/test/NightlyRun/test230.m:12789) R /issm/trunk-jpl/test/NightlyRun/test216.m (from /issm/trunk-jpl/test/NightlyRun/test232.m:12789) A /issm/trunk-jpl/test/NightlyRun/test217.m (from /issm/trunk-jpl/test/NightlyRun/test234.m:12789) R /issm/trunk-jpl/test/NightlyRun/test218.m (from /issm/trunk-jpl/test/NightlyRun/test236.m:12789) A /issm/trunk-jpl/test/NightlyRun/test219.m (from /issm/trunk-jpl/test/NightlyRun/test238.m:12789) R /issm/trunk-jpl/test/NightlyRun/test220.m (from /issm/trunk-jpl/test/NightlyRun/test240.m:12789) A /issm/trunk-jpl/test/NightlyRun/test221.m (from /issm/trunk-jpl/test/NightlyRun/test242.m:12789) R /issm/trunk-jpl/test/NightlyRun/test222.m (from /issm/trunk-jpl/test/NightlyRun/test244.m:12789) A /issm/trunk-jpl/test/NightlyRun/test223.m (from /issm/trunk-jpl/test/NightlyRun/test246.m:12789) R /issm/trunk-jpl/test/NightlyRun/test224.m (from /issm/trunk-jpl/test/NightlyRun/test248.m:12789) A /issm/trunk-jpl/test/NightlyRun/test225.m (from /issm/trunk-jpl/test/NightlyRun/test250.m:12789) R /issm/trunk-jpl/test/NightlyRun/test226.m (from /issm/trunk-jpl/test/NightlyRun/test252.m:12789) A /issm/trunk-jpl/test/NightlyRun/test227.m (from /issm/trunk-jpl/test/NightlyRun/test254.m:12789) R /issm/trunk-jpl/test/NightlyRun/test228.m (from /issm/trunk-jpl/test/NightlyRun/test256.m:12789) A /issm/trunk-jpl/test/NightlyRun/test229.m (from /issm/trunk-jpl/test/NightlyRun/test258.m:12789) R /issm/trunk-jpl/test/NightlyRun/test230.m (from /issm/trunk-jpl/test/NightlyRun/test260.m:12789) A /issm/trunk-jpl/test/NightlyRun/test231.m (from /issm/trunk-jpl/test/NightlyRun/test262.m:12789) R /issm/trunk-jpl/test/NightlyRun/test232.m (from /issm/trunk-jpl/test/NightlyRun/test264.m:12789) A /issm/trunk-jpl/test/NightlyRun/test233.m (from /issm/trunk-jpl/test/NightlyRun/test266.m:12789) R /issm/trunk-jpl/test/NightlyRun/test234.m (from /issm/trunk-jpl/test/NightlyRun/test268.m:12789) A /issm/trunk-jpl/test/NightlyRun/test235.m (from /issm/trunk-jpl/test/NightlyRun/test270.m:12789) D /issm/trunk-jpl/test/NightlyRun/test236.m D /issm/trunk-jpl/test/NightlyRun/test238.m D /issm/trunk-jpl/test/NightlyRun/test240.m D /issm/trunk-jpl/test/NightlyRun/test242.m D /issm/trunk-jpl/test/NightlyRun/test244.m D /issm/trunk-jpl/test/NightlyRun/test246.m D /issm/trunk-jpl/test/NightlyRun/test248.m D /issm/trunk-jpl/test/NightlyRun/test250.m D /issm/trunk-jpl/test/NightlyRun/test252.m D /issm/trunk-jpl/test/NightlyRun/test254.m D /issm/trunk-jpl/test/NightlyRun/test256.m D /issm/trunk-jpl/test/NightlyRun/test258.m D /issm/trunk-jpl/test/NightlyRun/test260.m D /issm/trunk-jpl/test/NightlyRun/test262.m D /issm/trunk-jpl/test/NightlyRun/test264.m D /issm/trunk-jpl/test/NightlyRun/test266.m D /issm/trunk-jpl/test/NightlyRun/test268.m D /issm/trunk-jpl/test/NightlyRun/test270.m\\
+Export determination: 6. \\
+Rationale: starting to change 2XX\\
+\vspace{3em}
+
+\noindent \textbf{Change \#107} with diff file ISSM-12792-12793.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive201.mat M /issm/trunk-jpl/test/Archives/Archive202.mat M /issm/trunk-jpl/test/Archives/Archive203.mat M /issm/trunk-jpl/test/Archives/Archive204.mat M /issm/trunk-jpl/test/Archives/Archive205.mat M /issm/trunk-jpl/test/Archives/Archive206.mat M /issm/trunk-jpl/test/Archives/Archive207.mat M /issm/trunk-jpl/test/Archives/Archive208.mat M /issm/trunk-jpl/test/Archives/Archive209.mat M /issm/trunk-jpl/test/Archives/Archive210.mat M /issm/trunk-jpl/test/Archives/Archive211.mat M /issm/trunk-jpl/test/Archives/Archive212.mat M /issm/trunk-jpl/test/Archives/Archive213.mat M /issm/trunk-jpl/test/Archives/Archive214.mat M /issm/trunk-jpl/test/Archives/Archive215.mat M /issm/trunk-jpl/test/Archives/Archive216.mat M /issm/trunk-jpl/test/Archives/Archive217.mat M /issm/trunk-jpl/test/Archives/Archive218.mat M /issm/trunk-jpl/test/Archives/Archive219.mat M /issm/trunk-jpl/test/Archives/Archive220.mat M /issm/trunk-jpl/test/Archives/Archive221.mat M /issm/trunk-jpl/test/Archives/Archive222.mat M /issm/trunk-jpl/test/Archives/Archive223.mat M /issm/trunk-jpl/test/Archives/Archive224.mat M /issm/trunk-jpl/test/Archives/Archive225.mat M /issm/trunk-jpl/test/Archives/Archive226.mat M /issm/trunk-jpl/test/Archives/Archive227.mat M /issm/trunk-jpl/test/Archives/Archive228.mat M /issm/trunk-jpl/test/Archives/Archive229.mat M /issm/trunk-jpl/test/Archives/Archive230.mat M /issm/trunk-jpl/test/Archives/Archive232.mat M /issm/trunk-jpl/test/Archives/Archive233.mat M /issm/trunk-jpl/test/Archives/Archive234.mat M /issm/trunk-jpl/test/Archives/Archive235.mat\\
+Export determination: 6. \\
+Rationale: archives 2XX\\
+\vspace{3em}
+
+\noindent \textbf{Change \#108} with diff file ISSM-12793-12794.diff: \\
+Function name: \\
+D /issm/trunk-jpl/test/Archives/Archive236.mat D /issm/trunk-jpl/test/Archives/Archive237.mat D /issm/trunk-jpl/test/Archives/Archive238.mat D /issm/trunk-jpl/test/Archives/Archive239.mat D /issm/trunk-jpl/test/Archives/Archive240.mat D /issm/trunk-jpl/test/Archives/Archive241.mat D /issm/trunk-jpl/test/Archives/Archive242.mat D /issm/trunk-jpl/test/Archives/Archive243.mat D /issm/trunk-jpl/test/Archives/Archive244.mat D /issm/trunk-jpl/test/Archives/Archive245.mat D /issm/trunk-jpl/test/Archives/Archive246.mat D /issm/trunk-jpl/test/Archives/Archive247.mat D /issm/trunk-jpl/test/Archives/Archive248.mat D /issm/trunk-jpl/test/Archives/Archive249.mat D /issm/trunk-jpl/test/Archives/Archive250.mat D /issm/trunk-jpl/test/Archives/Archive251.mat D /issm/trunk-jpl/test/Archives/Archive252.mat D /issm/trunk-jpl/test/Archives/Archive253.mat D /issm/trunk-jpl/test/Archives/Archive254.mat D /issm/trunk-jpl/test/Archives/Archive255.mat D /issm/trunk-jpl/test/Archives/Archive256.mat D /issm/trunk-jpl/test/Archives/Archive257.mat D /issm/trunk-jpl/test/Archives/Archive258.mat D /issm/trunk-jpl/test/Archives/Archive259.mat D /issm/trunk-jpl/test/Archives/Archive260.mat D /issm/trunk-jpl/test/Archives/Archive261.mat D /issm/trunk-jpl/test/Archives/Archive262.mat D /issm/trunk-jpl/test/Archives/Archive263.mat D /issm/trunk-jpl/test/Archives/Archive264.mat D /issm/trunk-jpl/test/Archives/Archive265.mat D /issm/trunk-jpl/test/Archives/Archive266.mat D /issm/trunk-jpl/test/Archives/Archive267.mat D /issm/trunk-jpl/test/Archives/Archive268.mat D /issm/trunk-jpl/test/Archives/Archive270.mat\\
+Export determination: 6. \\
+Rationale: removing useless archives\\
+\vspace{3em}
+
+\noindent \textbf{Change \#109} with diff file ISSM-12794-12795.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.py\\
+Export determination: 6. \\
+Rationale: IdToName in python for 2XX\\
+\vspace{3em}
+
+\noindent \textbf{Change \#110} with diff file ISSM-12795-12796.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: Point to petsc dynamic library.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#111} with diff file ISSM-12796-12797.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-linux64-astrid-python.sh\\
+Export determination: 6. \\
+Rationale: Lighter config-linux64-astrid-python.sh file.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#112} with diff file ISSM-12797-12798.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/triangle M /issm/trunk-jpl/externalpackages/triangle/install-linux64.sh\\
+Export determination: 6. \\
+Rationale: Added flag to unplug matlab.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#113} with diff file ISSM-12798-12799.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/lapack M /issm/trunk-jpl/externalpackages/lapack/configs/linux64/make.inc\\
+Export determination: 6. \\
+Rationale: Ignore some svn files and add fPIC flag to compile.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#114} with diff file ISSM-12799-12800.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc M /issm/trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh\\
+Export determination: 6. \\
+Rationale: Ignore some svn files Enable shared memory compilation, cannot hurt right ?\\
+\vspace{3em}
+
+\noindent \textbf{Change \#115} with diff file ISSM-12800-12801.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/blas M /issm/trunk-jpl/externalpackages/git M /issm/trunk-jpl/externalpackages/ipython M /issm/trunk-jpl/externalpackages/mpich2 M /issm/trunk-jpl/externalpackages/nose M /issm/trunk-jpl/externalpackages/petsc M /issm/trunk-jpl/externalpackages/python\\
+Export determination: 6. \\
+Rationale: Ignore some svn files.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#116} with diff file ISSM-12801-12802.diff: \\
+Function name: \\
+M /issm/trunk-jpl/bin M /issm/trunk-jpl/src/modules/matlab M /issm/trunk-jpl/src/modules/python M /issm/trunk-jpl/src/py M /issm/trunk-jpl/src/py/model\\
+Export determination: 6. \\
+Rationale: Ignore some svn files.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#117} with diff file ISSM-12802-12803.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/triangle/install-linux64-matlab.sh A /issm/trunk-jpl/externalpackages/triangle/install-linux64-python.sh M /issm/trunk-jpl/externalpackages/triangle/install-linux64.sh\\
+Export determination: 6. \\
+Rationale: one script per machine, per version, per install if needed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#118} with diff file ISSM-12803-12804.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive301.mat M /issm/trunk-jpl/test/Archives/Archive302.mat M /issm/trunk-jpl/test/Archives/Archive303.mat M /issm/trunk-jpl/test/Archives/Archive304.mat M /issm/trunk-jpl/test/Archives/Archive305.mat M /issm/trunk-jpl/test/Archives/Archive306.mat M /issm/trunk-jpl/test/Archives/Archive307.mat M /issm/trunk-jpl/test/Archives/Archive308.mat M /issm/trunk-jpl/test/Archives/Archive309.mat M /issm/trunk-jpl/test/Archives/Archive310.mat M /issm/trunk-jpl/test/Archives/Archive311.mat M /issm/trunk-jpl/test/Archives/Archive312.mat M /issm/trunk-jpl/test/Archives/Archive313.mat M /issm/trunk-jpl/test/Archives/Archive314.mat M /issm/trunk-jpl/test/Archives/Archive315.mat M /issm/trunk-jpl/test/Archives/Archive316.mat M /issm/trunk-jpl/test/Archives/Archive317.mat M /issm/trunk-jpl/test/Archives/Archive318.mat M /issm/trunk-jpl/test/Archives/Archive319.mat M /issm/trunk-jpl/test/Archives/Archive320.mat M /issm/trunk-jpl/test/Archives/Archive321.mat M /issm/trunk-jpl/test/Archives/Archive322.mat M /issm/trunk-jpl/test/Archives/Archive323.mat M /issm/trunk-jpl/test/Archives/Archive324.mat M /issm/trunk-jpl/test/Archives/Archive325.mat M /issm/trunk-jpl/test/Archives/Archive326.mat M /issm/trunk-jpl/test/Archives/Archive327.mat M /issm/trunk-jpl/test/Archives/Archive328.mat M /issm/trunk-jpl/test/Archives/Archive329.mat D /issm/trunk-jpl/test/Archives/Archive330.mat D /issm/trunk-jpl/test/Archives/Archive331.mat D /issm/trunk-jpl/test/Archives/Archive332.mat D /issm/trunk-jpl/test/Archives/Archive333.mat D /issm/trunk-jpl/test/Archives/Archive334.mat D /issm/trunk-jpl/test/Archives/Archive335.mat D /issm/trunk-jpl/test/Archives/Archive336.mat D /issm/trunk-jpl/test/Archives/Archive337.mat D /issm/trunk-jpl/test/Archives/Archive338.mat D /issm/trunk-jpl/test/Archives/Archive339.mat D /issm/trunk-jpl/test/Archives/Archive340.mat D /issm/trunk-jpl/test/Archives/Archive341.mat D /issm/trunk-jpl/test/Archives/Archive342.mat D /issm/trunk-jpl/test/Archives/Archive343.mat D /issm/trunk-jpl/test/Archives/Archive344.mat D /issm/trunk-jpl/test/Archives/Archive345.mat D /issm/trunk-jpl/test/Archives/Archive346.mat D /issm/trunk-jpl/test/Archives/Archive347.mat D /issm/trunk-jpl/test/Archives/Archive348.mat D /issm/trunk-jpl/test/Archives/Archive349.mat D /issm/trunk-jpl/test/Archives/Archive350.mat D /issm/trunk-jpl/test/Archives/Archive351.mat D /issm/trunk-jpl/test/Archives/Archive352.mat D /issm/trunk-jpl/test/Archives/Archive353.mat D /issm/trunk-jpl/test/Archives/Archive354.mat D /issm/trunk-jpl/test/Archives/Archive356.mat D /issm/trunk-jpl/test/Archives/Archive358.mat M /issm/trunk-jpl/test/NightlyRun/IdToName.m M /issm/trunk-jpl/test/NightlyRun/IdToName.py A /issm/trunk-jpl/test/NightlyRun/test301.m (from /issm/trunk-jpl/test/NightlyRun/test302.m:12794) R /issm/trunk-jpl/test/NightlyRun/test302.m (from /issm/trunk-jpl/test/NightlyRun/test304.m:12794) A /issm/trunk-jpl/test/NightlyRun/test303.m (from /issm/trunk-jpl/test/NightlyRun/test306.m:12794) R /issm/trunk-jpl/test/NightlyRun/test304.m (from /issm/trunk-jpl/test/NightlyRun/test308.m:12794) A /issm/trunk-jpl/test/NightlyRun/test305.m (from /issm/trunk-jpl/test/NightlyRun/test310.m:12794) R /issm/trunk-jpl/test/NightlyRun/test306.m (from /issm/trunk-jpl/test/NightlyRun/test312.m:12794) A /issm/trunk-jpl/test/NightlyRun/test307.m (from /issm/trunk-jpl/test/NightlyRun/test314.m:12794) R /issm/trunk-jpl/test/NightlyRun/test308.m (from /issm/trunk-jpl/test/NightlyRun/test316.m:12794) A /issm/trunk-jpl/test/NightlyRun/test309.m (from /issm/trunk-jpl/test/NightlyRun/test318.m:12794) R /issm/trunk-jpl/test/NightlyRun/test310.m (from /issm/trunk-jpl/test/NightlyRun/test320.m:12794) A /issm/trunk-jpl/test/NightlyRun/test311.m (from /issm/trunk-jpl/test/NightlyRun/test322.m:12794) R /issm/trunk-jpl/test/NightlyRun/test312.m (from /issm/trunk-jpl/test/NightlyRun/test324.m:12794) A /issm/trunk-jpl/test/NightlyRun/test313.m (from /issm/trunk-jpl/test/NightlyRun/test326.m:12794) R /issm/trunk-jpl/test/NightlyRun/test314.m (from /issm/trunk-jpl/test/NightlyRun/test328.m:12794) A /issm/trunk-jpl/test/NightlyRun/test315.m (from /issm/trunk-jpl/test/NightlyRun/test330.m:12794) R /issm/trunk-jpl/test/NightlyRun/test316.m (from /issm/trunk-jpl/test/NightlyRun/test332.m:12794) A /issm/trunk-jpl/test/NightlyRun/test317.m (from /issm/trunk-jpl/test/NightlyRun/test334.m:12794) R /issm/trunk-jpl/test/NightlyRun/test318.m (from /issm/trunk-jpl/test/NightlyRun/test336.m:12794) A /issm/trunk-jpl/test/NightlyRun/test319.m (from /issm/trunk-jpl/test/NightlyRun/test338.m:12794) R /issm/trunk-jpl/test/NightlyRun/test320.m (from /issm/trunk-jpl/test/NightlyRun/test340.m:12794) A /issm/trunk-jpl/test/NightlyRun/test321.m (from /issm/trunk-jpl/test/NightlyRun/test342.m:12794) R /issm/trunk-jpl/test/NightlyRun/test322.m (from /issm/trunk-jpl/test/NightlyRun/test344.m:12794) A /issm/trunk-jpl/test/NightlyRun/test323.m (from /issm/trunk-jpl/test/NightlyRun/test346.m:12794) R /issm/trunk-jpl/test/NightlyRun/test324.m (from /issm/trunk-jpl/test/NightlyRun/test348.m:12794) A /issm/trunk-jpl/test/NightlyRun/test325.m (from /issm/trunk-jpl/test/NightlyRun/test350.m:12794) R /issm/trunk-jpl/test/NightlyRun/test326.m (from /issm/trunk-jpl/test/NightlyRun/test352.m:12794) A /issm/trunk-jpl/test/NightlyRun/test327.m (from /issm/trunk-jpl/test/NightlyRun/test354.m:12794) R /issm/trunk-jpl/test/NightlyRun/test328.m (from /issm/trunk-jpl/test/NightlyRun/test356.m:12794) A /issm/trunk-jpl/test/NightlyRun/test329.m (from /issm/trunk-jpl/test/NightlyRun/test358.m:12794) D /issm/trunk-jpl/test/NightlyRun/test330.m D /issm/trunk-jpl/test/NightlyRun/test332.m D /issm/trunk-jpl/test/NightlyRun/test334.m D /issm/trunk-jpl/test/NightlyRun/test336.m D /issm/trunk-jpl/test/NightlyRun/test338.m D /issm/trunk-jpl/test/NightlyRun/test340.m D /issm/trunk-jpl/test/NightlyRun/test342.m D /issm/trunk-jpl/test/NightlyRun/test344.m D /issm/trunk-jpl/test/NightlyRun/test346.m D /issm/trunk-jpl/test/NightlyRun/test348.m D /issm/trunk-jpl/test/NightlyRun/test350.m D /issm/trunk-jpl/test/NightlyRun/test352.m D /issm/trunk-jpl/test/NightlyRun/test354.m D /issm/trunk-jpl/test/NightlyRun/test356.m D /issm/trunk-jpl/test/NightlyRun/test358.m\\
+Export determination: 6. \\
+Rationale: changed 3XX nightly runs and archives\\
+\vspace{3em}
+
+\noindent \textbf{Change \#119} with diff file ISSM-12804-12805.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive401.mat M /issm/trunk-jpl/test/Archives/Archive402.mat M /issm/trunk-jpl/test/Archives/Archive403.mat M /issm/trunk-jpl/test/Archives/Archive404.mat M /issm/trunk-jpl/test/Archives/Archive405.mat M /issm/trunk-jpl/test/Archives/Archive406.mat M /issm/trunk-jpl/test/Archives/Archive407.mat M /issm/trunk-jpl/test/Archives/Archive408.mat M /issm/trunk-jpl/test/Archives/Archive409.mat M /issm/trunk-jpl/test/Archives/Archive410.mat M /issm/trunk-jpl/test/Archives/Archive411.mat M /issm/trunk-jpl/test/Archives/Archive412.mat M /issm/trunk-jpl/test/Archives/Archive413.mat M /issm/trunk-jpl/test/Archives/Archive414.mat M /issm/trunk-jpl/test/Archives/Archive415.mat M /issm/trunk-jpl/test/Archives/Archive416.mat M /issm/trunk-jpl/test/Archives/Archive417.mat M /issm/trunk-jpl/test/Archives/Archive418.mat M /issm/trunk-jpl/test/Archives/Archive419.mat M /issm/trunk-jpl/test/Archives/Archive420.mat M /issm/trunk-jpl/test/Archives/Archive421.mat M /issm/trunk-jpl/test/Archives/Archive422.mat M /issm/trunk-jpl/test/Archives/Archive423.mat M /issm/trunk-jpl/test/Archives/Archive424.mat M /issm/trunk-jpl/test/Archives/Archive425.mat M /issm/trunk-jpl/test/Archives/Archive426.mat M /issm/trunk-jpl/test/Archives/Archive427.mat M /issm/trunk-jpl/test/Archives/Archive428.mat M /issm/trunk-jpl/test/Archives/Archive429.mat M /issm/trunk-jpl/test/Archives/Archive430.mat M /issm/trunk-jpl/test/Archives/Archive431.mat M /issm/trunk-jpl/test/Archives/Archive432.mat D /issm/trunk-jpl/test/Archives/Archive434.mat D /issm/trunk-jpl/test/Archives/Archive435.mat D /issm/trunk-jpl/test/Archives/Archive436.mat D /issm/trunk-jpl/test/Archives/Archive437.mat D /issm/trunk-jpl/test/Archives/Archive438.mat D /issm/trunk-jpl/test/Archives/Archive439.mat D /issm/trunk-jpl/test/Archives/Archive440.mat D /issm/trunk-jpl/test/Archives/Archive441.mat D /issm/trunk-jpl/test/Archives/Archive442.mat D /issm/trunk-jpl/test/Archives/Archive443.mat D /issm/trunk-jpl/test/Archives/Archive444.mat D /issm/trunk-jpl/test/Archives/Archive445.mat D /issm/trunk-jpl/test/Archives/Archive446.mat D /issm/trunk-jpl/test/Archives/Archive447.mat D /issm/trunk-jpl/test/Archives/Archive448.mat D /issm/trunk-jpl/test/Archives/Archive449.mat D /issm/trunk-jpl/test/Archives/Archive450.mat D /issm/trunk-jpl/test/Archives/Archive451.mat D /issm/trunk-jpl/test/Archives/Archive452.mat D /issm/trunk-jpl/test/Archives/Archive453.mat D /issm/trunk-jpl/test/Archives/Archive454.mat D /issm/trunk-jpl/test/Archives/Archive455.mat D /issm/trunk-jpl/test/Archives/Archive456.mat D /issm/trunk-jpl/test/Archives/Archive457.mat D /issm/trunk-jpl/test/Archives/Archive458.mat D /issm/trunk-jpl/test/Archives/Archive459.mat D /issm/trunk-jpl/test/Archives/Archive460.mat D /issm/trunk-jpl/test/Archives/Archive461.mat D /issm/trunk-jpl/test/Archives/Archive462.mat D /issm/trunk-jpl/test/Archives/Archive463.mat D /issm/trunk-jpl/test/Archives/Archive464.mat M /issm/trunk-jpl/test/NightlyRun/IdToName.m M /issm/trunk-jpl/test/NightlyRun/IdToName.py A /issm/trunk-jpl/test/NightlyRun/test401.m (from /issm/trunk-jpl/test/NightlyRun/test402.m:12794) R /issm/trunk-jpl/test/NightlyRun/test402.m (from /issm/trunk-jpl/test/NightlyRun/test404.m:12794) A /issm/trunk-jpl/test/NightlyRun/test403.m (from /issm/trunk-jpl/test/NightlyRun/test406.m:12794) R /issm/trunk-jpl/test/NightlyRun/test404.m (from /issm/trunk-jpl/test/NightlyRun/test408.m:12794) A /issm/trunk-jpl/test/NightlyRun/test405.m (from /issm/trunk-jpl/test/NightlyRun/test410.m:12794) R /issm/trunk-jpl/test/NightlyRun/test406.m (from /issm/trunk-jpl/test/NightlyRun/test412.m:12794) A /issm/trunk-jpl/test/NightlyRun/test407.m (from /issm/trunk-jpl/test/NightlyRun/test414.m:12794) R /issm/trunk-jpl/test/NightlyRun/test408.m (from /issm/trunk-jpl/test/NightlyRun/test416.m:12794) A /issm/trunk-jpl/test/NightlyRun/test409.m (from /issm/trunk-jpl/test/NightlyRun/test418.m:12794) R /issm/trunk-jpl/test/NightlyRun/test410.m (from /issm/trunk-jpl/test/NightlyRun/test420.m:12794) A /issm/trunk-jpl/test/NightlyRun/test411.m (from /issm/trunk-jpl/test/NightlyRun/test422.m:12794) R /issm/trunk-jpl/test/NightlyRun/test412.m (from /issm/trunk-jpl/test/NightlyRun/test424.m:12794) A /issm/trunk-jpl/test/NightlyRun/test413.m (from /issm/trunk-jpl/test/NightlyRun/test426.m:12794) R /issm/trunk-jpl/test/NightlyRun/test414.m (from /issm/trunk-jpl/test/NightlyRun/test428.m:12794) A /issm/trunk-jpl/test/NightlyRun/test415.m (from /issm/trunk-jpl/test/NightlyRun/test430.m:12794) R /issm/trunk-jpl/test/NightlyRun/test416.m (from /issm/trunk-jpl/test/NightlyRun/test432.m:12794) A /issm/trunk-jpl/test/NightlyRun/test417.m (from /issm/trunk-jpl/test/NightlyRun/test434.m:12794) R /issm/trunk-jpl/test/NightlyRun/test418.m (from /issm/trunk-jpl/test/NightlyRun/test436.m:12794) A /issm/trunk-jpl/test/NightlyRun/test419.m (from /issm/trunk-jpl/test/NightlyRun/test438.m:12794) R /issm/trunk-jpl/test/NightlyRun/test420.m (from /issm/trunk-jpl/test/NightlyRun/test440.m:12794) A /issm/trunk-jpl/test/NightlyRun/test421.m (from /issm/trunk-jpl/test/NightlyRun/test442.m:12794) R /issm/trunk-jpl/test/NightlyRun/test422.m (from /issm/trunk-jpl/test/NightlyRun/test444.m:12794) A /issm/trunk-jpl/test/NightlyRun/test423.m (from /issm/trunk-jpl/test/NightlyRun/test446.m:12794) R /issm/trunk-jpl/test/NightlyRun/test424.m (from /issm/trunk-jpl/test/NightlyRun/test448.m:12794) A /issm/trunk-jpl/test/NightlyRun/test425.m (from /issm/trunk-jpl/test/NightlyRun/test450.m:12794) R /issm/trunk-jpl/test/NightlyRun/test426.m (from /issm/trunk-jpl/test/NightlyRun/test452.m:12794) A /issm/trunk-jpl/test/NightlyRun/test427.m (from /issm/trunk-jpl/test/NightlyRun/test454.m:12794) R /issm/trunk-jpl/test/NightlyRun/test428.m (from /issm/trunk-jpl/test/NightlyRun/test456.m:12794) A /issm/trunk-jpl/test/NightlyRun/test429.m (from /issm/trunk-jpl/test/NightlyRun/test458.m:12794) R /issm/trunk-jpl/test/NightlyRun/test430.m (from /issm/trunk-jpl/test/NightlyRun/test460.m:12794) A /issm/trunk-jpl/test/NightlyRun/test431.m (from /issm/trunk-jpl/test/NightlyRun/test462.m:12794) R /issm/trunk-jpl/test/NightlyRun/test432.m (from /issm/trunk-jpl/test/NightlyRun/test464.m:12794) D /issm/trunk-jpl/test/NightlyRun/test434.m D /issm/trunk-jpl/test/NightlyRun/test436.m D /issm/trunk-jpl/test/NightlyRun/test438.m D /issm/trunk-jpl/test/NightlyRun/test440.m D /issm/trunk-jpl/test/NightlyRun/test442.m D /issm/trunk-jpl/test/NightlyRun/test444.m D /issm/trunk-jpl/test/NightlyRun/test446.m D /issm/trunk-jpl/test/NightlyRun/test448.m D /issm/trunk-jpl/test/NightlyRun/test450.m D /issm/trunk-jpl/test/NightlyRun/test452.m D /issm/trunk-jpl/test/NightlyRun/test454.m D /issm/trunk-jpl/test/NightlyRun/test456.m D /issm/trunk-jpl/test/NightlyRun/test458.m D /issm/trunk-jpl/test/NightlyRun/test460.m D /issm/trunk-jpl/test/NightlyRun/test462.m D /issm/trunk-jpl/test/NightlyRun/test464.m\\
+Export determination: 6. \\
+Rationale: Nightly runs 4XX\\
+\vspace{3em}
+
+\noindent \textbf{Change \#120} with diff file ISSM-12805-12806.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive501.mat M /issm/trunk-jpl/test/Archives/Archive502.mat M /issm/trunk-jpl/test/Archives/Archive503.mat M /issm/trunk-jpl/test/Archives/Archive504.mat M /issm/trunk-jpl/test/Archives/Archive505.mat M /issm/trunk-jpl/test/Archives/Archive506.mat M /issm/trunk-jpl/test/Archives/Archive507.mat M /issm/trunk-jpl/test/Archives/Archive508.mat M /issm/trunk-jpl/test/Archives/Archive509.mat M /issm/trunk-jpl/test/Archives/Archive510.mat M /issm/trunk-jpl/test/Archives/Archive511.mat M /issm/trunk-jpl/test/Archives/Archive512.mat M /issm/trunk-jpl/test/Archives/Archive513.mat M /issm/trunk-jpl/test/Archives/Archive514.mat M /issm/trunk-jpl/test/Archives/Archive515.mat M /issm/trunk-jpl/test/Archives/Archive516.mat D /issm/trunk-jpl/test/Archives/Archive517.mat D /issm/trunk-jpl/test/Archives/Archive518.mat D /issm/trunk-jpl/test/Archives/Archive519.mat D /issm/trunk-jpl/test/Archives/Archive520.mat D /issm/trunk-jpl/test/Archives/Archive521.mat D /issm/trunk-jpl/test/Archives/Archive522.mat D /issm/trunk-jpl/test/Archives/Archive523.mat D /issm/trunk-jpl/test/Archives/Archive524.mat D /issm/trunk-jpl/test/Archives/Archive525.mat D /issm/trunk-jpl/test/Archives/Archive526.mat D /issm/trunk-jpl/test/Archives/Archive527.mat D /issm/trunk-jpl/test/Archives/Archive529.mat D /issm/trunk-jpl/test/Archives/Archive530.mat D /issm/trunk-jpl/test/Archives/Archive531.mat D /issm/trunk-jpl/test/Archives/Archive532.mat M /issm/trunk-jpl/test/NightlyRun/IdToName.m M /issm/trunk-jpl/test/NightlyRun/IdToName.py A /issm/trunk-jpl/test/NightlyRun/test501.m (from /issm/trunk-jpl/test/NightlyRun/test502.m:12794) R /issm/trunk-jpl/test/NightlyRun/test502.m (from /issm/trunk-jpl/test/NightlyRun/test504.m:12794) A /issm/trunk-jpl/test/NightlyRun/test503.m (from /issm/trunk-jpl/test/NightlyRun/test506.m:12794) R /issm/trunk-jpl/test/NightlyRun/test504.m (from /issm/trunk-jpl/test/NightlyRun/test508.m:12794) A /issm/trunk-jpl/test/NightlyRun/test505.m (from /issm/trunk-jpl/test/NightlyRun/test510.m:12794) R /issm/trunk-jpl/test/NightlyRun/test506.m (from /issm/trunk-jpl/test/NightlyRun/test512.m:12794) A /issm/trunk-jpl/test/NightlyRun/test507.m (from /issm/trunk-jpl/test/NightlyRun/test514.m:12794) R /issm/trunk-jpl/test/NightlyRun/test508.m (from /issm/trunk-jpl/test/NightlyRun/test516.m:12794) A /issm/trunk-jpl/test/NightlyRun/test509.m (from /issm/trunk-jpl/test/NightlyRun/test518.m:12794) R /issm/trunk-jpl/test/NightlyRun/test510.m (from /issm/trunk-jpl/test/NightlyRun/test520.m:12794) A /issm/trunk-jpl/test/NightlyRun/test511.m (from /issm/trunk-jpl/test/NightlyRun/test522.m:12794) R /issm/trunk-jpl/test/NightlyRun/test512.m (from /issm/trunk-jpl/test/NightlyRun/test524.m:12794) A /issm/trunk-jpl/test/NightlyRun/test513.m (from /issm/trunk-jpl/test/NightlyRun/test526.m:12794) R /issm/trunk-jpl/test/NightlyRun/test514.m (from /issm/trunk-jpl/test/NightlyRun/test527.m:12794) A /issm/trunk-jpl/test/NightlyRun/test515.m (from /issm/trunk-jpl/test/NightlyRun/test530.m:12794) R /issm/trunk-jpl/test/NightlyRun/test516.m (from /issm/trunk-jpl/test/NightlyRun/test532.m:12794) D /issm/trunk-jpl/test/NightlyRun/test518.m D /issm/trunk-jpl/test/NightlyRun/test520.m D /issm/trunk-jpl/test/NightlyRun/test522.m D /issm/trunk-jpl/test/NightlyRun/test524.m D /issm/trunk-jpl/test/NightlyRun/test526.m D /issm/trunk-jpl/test/NightlyRun/test527.m D /issm/trunk-jpl/test/NightlyRun/test530.m D /issm/trunk-jpl/test/NightlyRun/test532.m\\
+Export determination: 6. \\
+Rationale: Nightly Runs 5XX\\
+\vspace{3em}
+
+\noindent \textbf{Change \#121} with diff file ISSM-12806-12807.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive601.mat M /issm/trunk-jpl/test/Archives/Archive602.mat M /issm/trunk-jpl/test/Archives/Archive603.mat M /issm/trunk-jpl/test/Archives/Archive604.mat M /issm/trunk-jpl/test/Archives/Archive605.mat M /issm/trunk-jpl/test/Archives/Archive606.mat M /issm/trunk-jpl/test/Archives/Archive607.mat M /issm/trunk-jpl/test/Archives/Archive608.mat M /issm/trunk-jpl/test/Archives/Archive609.mat M /issm/trunk-jpl/test/Archives/Archive610.mat M /issm/trunk-jpl/test/Archives/Archive611.mat M /issm/trunk-jpl/test/Archives/Archive612.mat M /issm/trunk-jpl/test/Archives/Archive613.mat D /issm/trunk-jpl/test/Archives/Archive614.mat D /issm/trunk-jpl/test/Archives/Archive615.mat D /issm/trunk-jpl/test/Archives/Archive616.mat D /issm/trunk-jpl/test/Archives/Archive617.mat D /issm/trunk-jpl/test/Archives/Archive618.mat D /issm/trunk-jpl/test/Archives/Archive619.mat D /issm/trunk-jpl/test/Archives/Archive620.mat D /issm/trunk-jpl/test/Archives/Archive621.mat D /issm/trunk-jpl/test/Archives/Archive622.mat D /issm/trunk-jpl/test/Archives/Archive623.mat D /issm/trunk-jpl/test/Archives/Archive624.mat D /issm/trunk-jpl/test/Archives/Archive625.mat D /issm/trunk-jpl/test/Archives/Archive626.mat M /issm/trunk-jpl/test/NightlyRun/IdToName.m M /issm/trunk-jpl/test/NightlyRun/IdToName.py A /issm/trunk-jpl/test/NightlyRun/test601.m (from /issm/trunk-jpl/test/NightlyRun/test602.m:12794) R /issm/trunk-jpl/test/NightlyRun/test602.m (from /issm/trunk-jpl/test/NightlyRun/test604.m:12794) A /issm/trunk-jpl/test/NightlyRun/test603.m (from /issm/trunk-jpl/test/NightlyRun/test606.m:12794) R /issm/trunk-jpl/test/NightlyRun/test604.m (from /issm/trunk-jpl/test/NightlyRun/test608.m:12794) A /issm/trunk-jpl/test/NightlyRun/test605.m (from /issm/trunk-jpl/test/NightlyRun/test610.m:12794) R /issm/trunk-jpl/test/NightlyRun/test606.m (from /issm/trunk-jpl/test/NightlyRun/test612.m:12794) A /issm/trunk-jpl/test/NightlyRun/test607.m (from /issm/trunk-jpl/test/NightlyRun/test614.m:12794) R /issm/trunk-jpl/test/NightlyRun/test608.m (from /issm/trunk-jpl/test/NightlyRun/test616.m:12794) A /issm/trunk-jpl/test/NightlyRun/test609.m (from /issm/trunk-jpl/test/NightlyRun/test618.m:12794) R /issm/trunk-jpl/test/NightlyRun/test610.m (from /issm/trunk-jpl/test/NightlyRun/test620.m:12794) A /issm/trunk-jpl/test/NightlyRun/test611.m (from /issm/trunk-jpl/test/NightlyRun/test622.m:12794) R /issm/trunk-jpl/test/NightlyRun/test612.m (from /issm/trunk-jpl/test/NightlyRun/test624.m:12794) A /issm/trunk-jpl/test/NightlyRun/test613.m (from /issm/trunk-jpl/test/NightlyRun/test626.m:12794) D /issm/trunk-jpl/test/NightlyRun/test614.m D /issm/trunk-jpl/test/NightlyRun/test616.m D /issm/trunk-jpl/test/NightlyRun/test618.m D /issm/trunk-jpl/test/NightlyRun/test620.m D /issm/trunk-jpl/test/NightlyRun/test622.m D /issm/trunk-jpl/test/NightlyRun/test624.m D /issm/trunk-jpl/test/NightlyRun/test626.m\\
+Export determination: 6. \\
+Rationale: Nightly Runs 6XX\\
+\vspace{3em}
+
+\noindent \textbf{Change \#122} with diff file ISSM-12807-12808.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive231.mat\\
+Export determination: 6. \\
+Rationale: missing archive\\
+\vspace{3em}
+
+\noindent \textbf{Change \#123} with diff file ISSM-12808-12809.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive110.mat M /issm/trunk-jpl/test/Archives/Archive111.mat M /issm/trunk-jpl/test/NightlyRun/test110.m M /issm/trunk-jpl/test/NightlyRun/test111.m\\
+Export determination: 6. \\
+Rationale: NEW: added IceVolume checks in NR\\
+\vspace{3em}
+
+\noindent \textbf{Change \#124} with diff file ISSM-12809-12810.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/enum/SurfaceforcingsTemperaturesLgmEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsTemperaturesPresentdayEnum.m\\
+Export determination: 6. \\
+Rationale: enum for delta18o\\
+\vspace{3em}
+
+\noindent \textbf{Change \#125} with diff file ISSM-12810-12811.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test111.m\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#126} with diff file ISSM-12811-12812.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test1107.m M /issm/trunk-jpl/test/NightlyRun/test1108.m M /issm/trunk-jpl/test/NightlyRun/test307.m\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#127} with diff file ISSM-12812-12813.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp\\
+Export determination: 6. \\
+Rationale: convert time from years to seconds\\
+\vspace{3em}
+
+\noindent \textbf{Change \#128} with diff file ISSM-12813-12814.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh\\
+Export determination: 6. \\
+Rationale: Reverting install-3.2-linux64.sh to shared=0, because of Matlab bug which does not like sharing blacs, blas and lapack with petsc! Now, for python install, we do need shared libraries in Petsc, so created a new file install-3.2-linux64-python.sh for this particular compile.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#129} with diff file ISSM-12814-12815.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh\\
+Export determination: 6. \\
+Rationale: Reactivating shared libraries by default. Will test whether this creates problems for Matlab mex. Will revert if so. This is to help compilation of Python modules, which are dynamic in nature, and cannot resolve Petsc symbols when Petsc is compiled in static mode.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#130} with diff file ISSM-12815-12816.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/triangle/install-linux64-matlab.sh D /issm/trunk-jpl/externalpackages/triangle/install-linux64-python.sh M /issm/trunk-jpl/externalpackages/triangle/install-linux64.sh M /issm/trunk-jpl/externalpackages/triangle/triangle.c.patch D /issm/trunk-jpl/externalpackages/triangle/triangle.c.patch.matlab D /issm/trunk-jpl/externalpackages/triangle/triangle.c.patch.python\\
+Export determination: 6. \\
+Rationale: CHG: use common patch for matlab and python. Do not use mxFree and mxMalloc. Matlab's API is used by WriteData\\
+\vspace{3em}
+
+\noindent \textbf{Change \#131} with diff file ISSM-12816-12817.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh A /issm/trunk-jpl/externalpackages/petsc/install-3.3-macosx64.sh\\
+Export determination: 6. \\
+Rationale: Added install-3.3-macosx64.sh and use shared libraries for compatibility with Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#132} with diff file ISSM-12817-12818.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/triangle/install-linux64.sh\\
+Export determination: 6. \\
+Rationale: Linux64 compile with matlab or python support.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#133} with diff file ISSM-12818-12819.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/triangle/install-linux64.sh\\
+Export determination: 6. \\
+Rationale: Reverting\\
+\vspace{3em}
+
+\noindent \textbf{Change \#134} with diff file ISSM-12819-12820.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.py\\
+Export determination: 6. \\
+Rationale: Fix newly introduced errors in IdToName.py.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#135} with diff file ISSM-12820-12821.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/c/classes\\
+Export determination: 6. \\
+Rationale: New classes directory, where all our C++ objects will end up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#136} with diff file ISSM-12821-12822.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/c/classes/DofIndexing.cpp (from /issm/trunk-jpl/src/c/objects/DofIndexing.cpp:12820) A /issm/trunk-jpl/src/c/classes/DofIndexing.h (from /issm/trunk-jpl/src/c/objects/DofIndexing.h:12820) A /issm/trunk-jpl/src/c/classes/FemModel.cpp (from /issm/trunk-jpl/src/c/objects/FemModel.cpp:12820) A /issm/trunk-jpl/src/c/classes/FemModel.h (from /issm/trunk-jpl/src/c/objects/FemModel.h:12820) A /issm/trunk-jpl/src/c/classes/Hook.cpp (from /issm/trunk-jpl/src/c/objects/Hook.cpp:12820) A /issm/trunk-jpl/src/c/classes/Hook.h (from /issm/trunk-jpl/src/c/objects/Hook.h:12820) A /issm/trunk-jpl/src/c/classes/Patch.cpp (from /issm/trunk-jpl/src/c/objects/Patch.cpp:12820) A /issm/trunk-jpl/src/c/classes/Patch.h (from /issm/trunk-jpl/src/c/objects/Patch.h:12820) A /issm/trunk-jpl/src/c/classes/Update.h (from /issm/trunk-jpl/src/c/objects/Update.h:12820) A /issm/trunk-jpl/src/c/classes/bamg A /issm/trunk-jpl/src/c/classes/bamg/AdjacentTriangle.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/AdjacentTriangle.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/AdjacentTriangle.h (from /issm/trunk-jpl/src/c/objects/Bamg/AdjacentTriangle.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/BamgGeom.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/BamgGeom.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/BamgGeom.h (from /issm/trunk-jpl/src/c/objects/Bamg/BamgGeom.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/BamgMesh.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/BamgMesh.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/BamgMesh.h (from /issm/trunk-jpl/src/c/objects/Bamg/BamgMesh.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/BamgOpts.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/BamgOpts.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/BamgOpts.h (from /issm/trunk-jpl/src/c/objects/Bamg/BamgOpts.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/BamgQuadtree.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/BamgQuadtree.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/BamgQuadtree.h (from /issm/trunk-jpl/src/c/objects/Bamg/BamgQuadtree.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/BamgVertex.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/BamgVertex.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/BamgVertex.h (from /issm/trunk-jpl/src/c/objects/Bamg/BamgVertex.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/CrackedEdge.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/CrackedEdge.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/CrackedEdge.h (from /issm/trunk-jpl/src/c/objects/Bamg/CrackedEdge.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/Curve.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/Curve.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/Curve.h (from /issm/trunk-jpl/src/c/objects/Bamg/Curve.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/Direction.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/Direction.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/Direction.h (from /issm/trunk-jpl/src/c/objects/Bamg/Direction.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/DoubleAndInt.h (from /issm/trunk-jpl/src/c/objects/Bamg/DoubleAndInt.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/Edge.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/Edge.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/Edge.h (from /issm/trunk-jpl/src/c/objects/Bamg/Edge.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/EigenMetric.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/EigenMetric.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/GeomEdge.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/GeomEdge.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/GeomEdge.h (from /issm/trunk-jpl/src/c/objects/Bamg/GeomEdge.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/GeomSubDomain.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/GeomSubDomain.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/GeomSubDomain.h (from /issm/trunk-jpl/src/c/objects/Bamg/GeomSubDomain.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/GeomVertex.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/GeomVertex.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/GeomVertex.h (from /issm/trunk-jpl/src/c/objects/Bamg/GeomVertex.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/Geometry.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/Geometry.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/Geometry.h (from /issm/trunk-jpl/src/c/objects/Bamg/Geometry.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.h (from /issm/trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/Mesh.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/Mesh.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/Mesh.h (from /issm/trunk-jpl/src/c/objects/Bamg/Mesh.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/Metric.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/Metric.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/Metric.h (from /issm/trunk-jpl/src/c/objects/Bamg/Metric.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/R2.h (from /issm/trunk-jpl/src/c/objects/Bamg/R2.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/SetOfE4.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/SetOfE4.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/SetOfE4.h (from /issm/trunk-jpl/src/c/objects/Bamg/SetOfE4.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/SubDomain.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/SubDomain.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/SubDomain.h (from /issm/trunk-jpl/src/c/objects/Bamg/SubDomain.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/Triangle.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/Triangle.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/Triangle.h (from /issm/trunk-jpl/src/c/objects/Bamg/Triangle.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/VertexOnEdge.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/VertexOnEdge.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/VertexOnEdge.h (from /issm/trunk-jpl/src/c/objects/Bamg/VertexOnEdge.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/VertexOnGeom.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/VertexOnGeom.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/VertexOnGeom.h (from /issm/trunk-jpl/src/c/objects/Bamg/VertexOnGeom.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/VertexOnVertex.cpp (from /issm/trunk-jpl/src/c/objects/Bamg/VertexOnVertex.cpp:12820) A /issm/trunk-jpl/src/c/classes/bamg/VertexOnVertex.h (from /issm/trunk-jpl/src/c/objects/Bamg/VertexOnVertex.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/include.h (from /issm/trunk-jpl/src/c/objects/Bamg/include.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/macros.h (from /issm/trunk-jpl/src/c/objects/Bamg/macros.h:12820) A /issm/trunk-jpl/src/c/classes/bamg/typedefs.h (from /issm/trunk-jpl/src/c/objects/Bamg/typedefs.h:12820) A /issm/trunk-jpl/src/c/classes/dakota A /issm/trunk-jpl/src/c/classes/dakota/DakotaPlugin.cpp (from /issm/trunk-jpl/src/c/objects/DakotaPlugin.cpp:12820) A /issm/trunk-jpl/src/c/classes/dakota/DakotaPlugin.h (from /issm/trunk-jpl/src/c/objects/DakotaPlugin.h:12820) A /issm/trunk-jpl/src/c/classes/kriging A /issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp (from /issm/trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.cpp:12820) A /issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h (from /issm/trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.h:12820) A /issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp (from /issm/trunk-jpl/src/c/objects/Kriging/GaussianVariogram.cpp:12820) A /issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.h (from /issm/trunk-jpl/src/c/objects/Kriging/GaussianVariogram.h:12820) A /issm/trunk-jpl/src/c/classes/kriging/Observation.cpp (from /issm/trunk-jpl/src/c/objects/Kriging/Observation.cpp:12820) A /issm/trunk-jpl/src/c/classes/kriging/Observation.h (from /issm/trunk-jpl/src/c/objects/Kriging/Observation.h:12820) A /issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp (from /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.cpp:12820) A /issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.h (from /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.h:12820) A /issm/trunk-jpl/src/c/classes/kriging/Quadtree.cpp (from /issm/trunk-jpl/src/c/objects/Kriging/Quadtree.cpp:12820) A /issm/trunk-jpl/src/c/classes/kriging/Quadtree.h (from /issm/trunk-jpl/src/c/objects/Kriging/Quadtree.h:12820) A /issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp (from /issm/trunk-jpl/src/c/objects/Kriging/SphericalVariogram.cpp:12820) A /issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.h (from /issm/trunk-jpl/src/c/objects/Kriging/SphericalVariogram.h:12820) A /issm/trunk-jpl/src/c/classes/kriging/Variogram.h (from /issm/trunk-jpl/src/c/objects/Kriging/Variogram.h:12820) A /issm/trunk-jpl/src/c/classes/matrix A /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp (from /issm/trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp:12820) A /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h (from /issm/trunk-jpl/src/c/objects/Numerics/ElementMatrix.h:12820) A /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp (from /issm/trunk-jpl/src/c/objects/Numerics/ElementVector.cpp:12820) A /issm/trunk-jpl/src/c/classes/matrix/ElementVector.h (from /issm/trunk-jpl/src/c/objects/Numerics/ElementVector.h:12820) A /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp (from /issm/trunk-jpl/src/c/objects/Numerics/Matrix.cpp:12820) A /issm/trunk-jpl/src/c/classes/matrix/Matrix.h (from /issm/trunk-jpl/src/c/objects/Numerics/Matrix.h:12820) A /issm/trunk-jpl/src/c/classes/matrix/Vector.cpp (from /issm/trunk-jpl/src/c/objects/Numerics/Vector.cpp:12820) A /issm/trunk-jpl/src/c/classes/matrix/Vector.h (from /issm/trunk-jpl/src/c/objects/Numerics/Vector.h:12820) A /issm/trunk-jpl/src/c/classes/objects A /issm/trunk-jpl/src/c/classes/objects/Contour.cpp (from /issm/trunk-jpl/src/c/objects/Contour.cpp:12820) A /issm/trunk-jpl/src/c/classes/objects/Contour.h (from /issm/trunk-jpl/src/c/objects/Contour.h:12820) A /issm/trunk-jpl/src/c/classes/objects/Node.cpp (from /issm/trunk-jpl/src/c/objects/Node.cpp:12820) A /issm/trunk-jpl/src/c/classes/objects/Node.h (from /issm/trunk-jpl/src/c/objects/Node.h:12820) A /issm/trunk-jpl/src/c/classes/objects/Object.h (from /issm/trunk-jpl/src/c/objects/Object.h:12820) A /issm/trunk-jpl/src/c/classes/objects/Segment.cpp (from /issm/trunk-jpl/src/c/objects/Segment.cpp:12820) A /issm/trunk-jpl/src/c/classes/objects/Segment.h (from /issm/trunk-jpl/src/c/objects/Segment.h:12820) A /issm/trunk-jpl/src/c/classes/objects/Vertex.cpp (from /issm/trunk-jpl/src/c/objects/Vertex.cpp:12820) A /issm/trunk-jpl/src/c/classes/objects/Vertex.h (from /issm/trunk-jpl/src/c/objects/Vertex.h:12820) A /issm/trunk-jpl/src/c/classes/objects.h (from /issm/trunk-jpl/src/c/objects/objects.h:12820) D /issm/trunk-jpl/src/c/objects/Bamg D /issm/trunk-jpl/src/c/objects/Contour.cpp D /issm/trunk-jpl/src/c/objects/Contour.h D /issm/trunk-jpl/src/c/objects/DakotaPlugin.cpp D /issm/trunk-jpl/src/c/objects/DakotaPlugin.h D /issm/trunk-jpl/src/c/objects/DofIndexing.cpp D /issm/trunk-jpl/src/c/objects/DofIndexing.h D /issm/trunk-jpl/src/c/objects/FemModel.cpp D /issm/trunk-jpl/src/c/objects/FemModel.h D /issm/trunk-jpl/src/c/objects/Hook.cpp D /issm/trunk-jpl/src/c/objects/Hook.h D /issm/trunk-jpl/src/c/objects/Kriging D /issm/trunk-jpl/src/c/objects/Node.cpp D /issm/trunk-jpl/src/c/objects/Node.h D /issm/trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp D /issm/trunk-jpl/src/c/objects/Numerics/ElementMatrix.h D /issm/trunk-jpl/src/c/objects/Numerics/ElementVector.cpp D /issm/trunk-jpl/src/c/objects/Numerics/ElementVector.h D /issm/trunk-jpl/src/c/objects/Numerics/Matrix.cpp D /issm/trunk-jpl/src/c/objects/Numerics/Matrix.h D /issm/trunk-jpl/src/c/objects/Numerics/Vector.cpp D /issm/trunk-jpl/src/c/objects/Numerics/Vector.h D /issm/trunk-jpl/src/c/objects/Object.h D /issm/trunk-jpl/src/c/objects/Patch.cpp D /issm/trunk-jpl/src/c/objects/Patch.h D /issm/trunk-jpl/src/c/objects/Segment.cpp D /issm/trunk-jpl/src/c/objects/Segment.h D /issm/trunk-jpl/src/c/objects/Update.h D /issm/trunk-jpl/src/c/objects/Vertex.cpp D /issm/trunk-jpl/src/c/objects/Vertex.h D /issm/trunk-jpl/src/c/objects/objects.h\\
+Export determination: 6. \\
+Rationale: Started migration from objects to classes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#137} with diff file ISSM-12822-12823.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/c/classes/IoModel.cpp (from /issm/trunk-jpl/src/c/objects/IoModel.cpp:12820) A /issm/trunk-jpl/src/c/classes/IoModel.h (from /issm/trunk-jpl/src/c/objects/IoModel.h:12820) A /issm/trunk-jpl/src/c/classes/OptArgs.h (from /issm/trunk-jpl/src/c/objects/OptArgs.h:12820) A /issm/trunk-jpl/src/c/classes/OptPars.h (from /issm/trunk-jpl/src/c/objects/OptPars.h:12820) A /issm/trunk-jpl/src/c/classes/gauss A /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp (from /issm/trunk-jpl/src/c/objects/Gauss/GaussPenta.cpp:12820) A /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.h (from /issm/trunk-jpl/src/c/objects/Gauss/GaussPenta.h:12820) A /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp (from /issm/trunk-jpl/src/c/objects/Gauss/GaussTria.cpp:12820) A /issm/trunk-jpl/src/c/classes/gauss/GaussTria.h (from /issm/trunk-jpl/src/c/objects/Gauss/GaussTria.h:12820) A /issm/trunk-jpl/src/c/classes/objects/Constraints (from /issm/trunk-jpl/src/c/objects/Constraints:12820) A /issm/trunk-jpl/src/c/classes/objects/ElementResults (from /issm/trunk-jpl/src/c/objects/ElementResults:12820) A /issm/trunk-jpl/src/c/classes/objects/Elements (from /issm/trunk-jpl/src/c/objects/Elements:12820) A /issm/trunk-jpl/src/c/classes/objects/ExternalResults (from /issm/trunk-jpl/src/c/objects/ExternalResults:12820) A /issm/trunk-jpl/src/c/classes/objects/Inputs (from /issm/trunk-jpl/src/c/objects/Inputs:12820) A /issm/trunk-jpl/src/c/classes/objects/KML (from /issm/trunk-jpl/src/c/objects/KML:12820) A /issm/trunk-jpl/src/c/classes/objects/Loads (from /issm/trunk-jpl/src/c/objects/Loads:12820) A /issm/trunk-jpl/src/c/classes/objects/Materials (from /issm/trunk-jpl/src/c/objects/Materials:12820) A /issm/trunk-jpl/src/c/classes/objects/Options (from /issm/trunk-jpl/src/c/objects/Options:12820) A /issm/trunk-jpl/src/c/classes/objects/Params (from /issm/trunk-jpl/src/c/objects/Params:12820) D /issm/trunk-jpl/src/c/objects/Constraints D /issm/trunk-jpl/src/c/objects/ElementResults D /issm/trunk-jpl/src/c/objects/Elements D /issm/trunk-jpl/src/c/objects/ExternalResults D /issm/trunk-jpl/src/c/objects/Gauss/GaussPenta.cpp D /issm/trunk-jpl/src/c/objects/Gauss/GaussPenta.h D /issm/trunk-jpl/src/c/objects/Gauss/GaussTria.cpp D /issm/trunk-jpl/src/c/objects/Gauss/GaussTria.h D /issm/trunk-jpl/src/c/objects/Inputs D /issm/trunk-jpl/src/c/objects/IoModel.cpp D /issm/trunk-jpl/src/c/objects/IoModel.h D /issm/trunk-jpl/src/c/objects/KML D /issm/trunk-jpl/src/c/objects/Loads D /issm/trunk-jpl/src/c/objects/Materials D /issm/trunk-jpl/src/c/objects/OptArgs.h D /issm/trunk-jpl/src/c/objects/OptPars.h D /issm/trunk-jpl/src/c/objects/Options D /issm/trunk-jpl/src/c/objects/Params\\
+Export determination: 6. \\
+Rationale: More migration from objects to classes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#138} with diff file ISSM-12823-12824.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/triangle/install-macosx64.sh\\
+Export determination: 6. \\
+Rationale: updated macosx64 install script\\
+\vspace{3em}
+
+\noindent \textbf{Change \#139} with diff file ISSM-12824-12825.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh\\
+Export determination: 6. \\
+Rationale: fixed path for patches at end of install\\
+\vspace{3em}
+
+\noindent \textbf{Change \#140} with diff file ISSM-12825-12826.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/scipy/install-linux64.sh\\
+Export determination: 6. \\
+Rationale: added test runs to confirm scipy/numpy installation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#141} with diff file ISSM-12826-12827.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/nose/install-linux64.sh\\
+Export determination: 6. \\
+Rationale: added nose install script for linux64\\
+\vspace{3em}
+
+\noindent \textbf{Change \#142} with diff file ISSM-12827-12828.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py M /issm/trunk-jpl/src/m/classes/pairoptions.py M /issm/trunk-jpl/src/m/model/MatlabProcessPatch.py M /issm/trunk-jpl/src/m/model/WriteData.py M /issm/trunk-jpl/src/m/model/ismodelselfconsistent.py M /issm/trunk-jpl/src/m/model/loadresultsfromcluster.py M /issm/trunk-jpl/src/m/model/loadresultsfromdisk.py M /issm/trunk-jpl/src/m/model/marshall.py M /issm/trunk-jpl/src/m/model/petscversion.py M /issm/trunk-jpl/src/m/model/process\_solve\_options.py M /issm/trunk-jpl/src/m/model/solve.py M /issm/trunk-jpl/src/m/model/waitonlock.py M /issm/trunk-jpl/src/m/utils/Cluster/parallelrange.py M /issm/trunk-jpl/src/m/utils/OS/ismumps.py M /issm/trunk-jpl/src/m/utils/OS/ispetsc.py M /issm/trunk-jpl/src/m/utils/OS/issmscpin.py M /issm/trunk-jpl/src/m/utils/OS/issmscpout.py M /issm/trunk-jpl/src/m/utils/OS/issmssh.py M /issm/trunk-jpl/src/m/utils/Shell/issmdir.py\\
+Export determination: 6. \\
+Rationale: Fixed docstrings so that ipython could use them.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#143} with diff file ISSM-12828-12829.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdFromString.py M /issm/trunk-jpl/test/NightlyRun/IdToName.py M /issm/trunk-jpl/test/NightlyRun/runme.py\\
+Export determination: 6. \\
+Rationale: Fixed docstrings so that ipython could use them.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#144} with diff file ISSM-12829-12830.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/transient.m\\
+Export determination: 6. \\
+Rationale: check size of requested\_outputs in transient class\\
+\vspace{3em}
+
+\noindent \textbf{Change \#145} with diff file ISSM-12830-12831.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h\\
+Export determination: 6. \\
+Rationale: some fix\\
+\vspace{3em}
+
+\noindent \textbf{Change \#146} with diff file ISSM-12831-12832.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: Display table only if installation worked\\
+\vspace{3em}
+
+\noindent \textbf{Change \#147} with diff file ISSM-12832-12833.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/ipython/install.sh M /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh M /issm/trunk-jpl/externalpackages/python/patches/pyport.h.patch M /issm/trunk-jpl/src/c/Container/DataSet.cpp M /issm/trunk-jpl/src/c/Container/DataSet.h M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/DofIndexing.cpp 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/IoModel.cpp M /issm/trunk-jpl/src/c/classes/Patch.cpp M /issm/trunk-jpl/src/c/classes/bamg/BamgQuadtree.h A /issm/trunk-jpl/src/c/classes/bamg/bamgobjects.h A /issm/trunk-jpl/src/c/classes/classes.h M /issm/trunk-jpl/src/c/classes/dakota/DakotaPlugin.h M /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp A /issm/trunk-jpl/src/c/classes/gauss/gaussobjects.h M /issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.h M /issm/trunk-jpl/src/c/classes/kriging/Observation.h M /issm/trunk-jpl/src/c/classes/kriging/Variogram.h A /issm/trunk-jpl/src/c/classes/kriging/krigingobjects.h M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.h M /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/Vector.cpp A /issm/trunk-jpl/src/c/classes/matrix/matrixobjects.h M /issm/trunk-jpl/src/c/classes/objects/Constraints/Constraint.h M /issm/trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.cpp M /issm/trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.cpp M /issm/trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp M /issm/trunk-jpl/src/c/classes/objects/Contour.cpp M /issm/trunk-jpl/src/c/classes/objects/Contour.h M /issm/trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h M /issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h M /issm/trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h M /issm/trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Element.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Attribute.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_ColorStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Comment.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Container.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Document.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Feature.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_File.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Folder.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Geometry.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_GroundOverlay.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Icon.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LatLonBox.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineString.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LinearRing.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_MultiGeometry.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Object.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Overlay.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Placemark.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Point.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_PolyStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Polygon.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Style.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_StyleSelector.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_SubStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Unknown.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Load.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Material.h M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp M /issm/trunk-jpl/src/c/classes/objects/Node.cpp M /issm/trunk-jpl/src/c/classes/objects/Node.h M /issm/trunk-jpl/src/c/classes/objects/Options/Option.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/Option.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/OptionCell.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/OptionChar.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/OptionDouble.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/OptionLogical.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/OptionStruct.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/OptionUtilities.h M /issm/trunk-jpl/src/c/classes/objects/Params/BoolParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/BoolParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleTransientMatParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/FileParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/FileParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/IntMatParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/IntMatParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/IntParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/IntParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/IntVecParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/IntVecParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/MatrixParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/StringArrayParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/StringParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/StringParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/TransientParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/VectorParam.h M /issm/trunk-jpl/src/c/classes/objects/Segment.cpp M /issm/trunk-jpl/src/c/classes/objects/Vertex.cpp M /issm/trunk-jpl/src/c/classes/objects/Vertex.h A /issm/trunk-jpl/src/c/classes/objects/objects.h M /issm/trunk-jpl/src/c/io/Disk/diskio.h M /issm/trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp M /issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.h M /issm/trunk-jpl/src/c/modules/BamgConvertMeshx/BamgConvertMeshx.cpp M /issm/trunk-jpl/src/c/modules/BamgConvertMeshx/BamgConvertMeshx.h M /issm/trunk-jpl/src/c/modules/BamgTriangulatex/BamgTriangulatex.cpp M /issm/trunk-jpl/src/c/modules/BamgTriangulatex/BamgTriangulatex.h M /issm/trunk-jpl/src/c/modules/Bamgx/Bamgx.cpp M /issm/trunk-jpl/src/c/modules/Bamgx/Bamgx.h M /issm/trunk-jpl/src/c/modules/Chacox/Chacox.h M /issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h M /issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h M /issm/trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h M /issm/trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStatex.h M /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h M /issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h M /issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h M /issm/trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h M /issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h M /issm/trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.h M /issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h M /issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h M /issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.h M /issm/trunk-jpl/src/c/modules/Dakotax/Dakotax.h M /issm/trunk-jpl/src/c/modules/Dakotax/SpawnCore.cpp M /issm/trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp M /issm/trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h M /issm/trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h M /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.h M /issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.h M /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h M /issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h M /issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.h M /issm/trunk-jpl/src/c/modules/IceVolumex/IceVolumex.h M /issm/trunk-jpl/src/c/modules/InputArtificialNoisex/InputArtificialNoisex.h M /issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h M /issm/trunk-jpl/src/c/modules/InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.h M /issm/trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h M /issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h M /issm/trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h M /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h M /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.h M /issm/trunk-jpl/src/c/modules/KMLFileReadx/KMLFileReadx.h M /issm/trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.h M /issm/trunk-jpl/src/c/modules/KMLOverlayx/KMLOverlayx.h M /issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.h M /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp M /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.h M /issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp M /issm/trunk-jpl/src/c/modules/MassFluxx/MassFluxx.h M /issm/trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.h M /issm/trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.h M /issm/trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.h M /issm/trunk-jpl/src/c/modules/MaxVelx/MaxVelx.h M /issm/trunk-jpl/src/c/modules/MaxVxx/MaxVxx.h M /issm/trunk-jpl/src/c/modules/MaxVyx/MaxVyx.h M /issm/trunk-jpl/src/c/modules/MaxVzx/MaxVzx.h M /issm/trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h M /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h M /issm/trunk-jpl/src/c/modules/MinVelx/MinVelx.h M /issm/trunk-jpl/src/c/modules/MinVxx/MinVxx.h M /issm/trunk-jpl/src/c/modules/MinVyx/MinVyx.h M /issm/trunk-jpl/src/c/modules/MinVzx/MinVzx.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateConstraintsBedSlope.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateLoadsBedSlope.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateLoadsDiagnosticVert.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateLoadsEnthalpy.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateConstraintsHydrology.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateLoadsHydrology.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateConstraintsMelting.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/SortDataSets.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateConstraintsSurfaceSlope.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateLoadsSurfaceSlope.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/UpdateCounters.cpp M /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.h M /issm/trunk-jpl/src/c/modules/NodesDofx/NodesDofx.h M /issm/trunk-jpl/src/c/modules/Orthx/Orthx.h M /issm/trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp M /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.h M /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h M /issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h M /issm/trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.h M /issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h M /issm/trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h M /issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.h M /issm/trunk-jpl/src/c/modules/ResetCoordinateSystemx/ResetCoordinateSystemx.h M /issm/trunk-jpl/src/c/modules/Responsex/Responsex.h M /issm/trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h M /issm/trunk-jpl/src/c/modules/Scotchx/Scotchx.h M /issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h M /issm/trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.h M /issm/trunk-jpl/src/c/modules/SmbGradientsx/SmbGradientsx.h M /issm/trunk-jpl/src/c/modules/SmearFunctionx/SmearFunctionx.h M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.h M /issm/trunk-jpl/src/c/modules/SpcNodesx/SpcNodesx.h M /issm/trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h M /issm/trunk-jpl/src/c/modules/SurfaceAreax/SurfaceAreax.h M /issm/trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h M /issm/trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h M /issm/trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h M /issm/trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h M /issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.h M /issm/trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h M /issm/trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h M /issm/trunk-jpl/src/c/modules/TimeAdaptx/TimeAdaptx.h M /issm/trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h M /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h M /issm/trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.cpp M /issm/trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.h M /issm/trunk-jpl/src/c/modules/UpdateConstraintsx/UpdateConstraintsx.h M /issm/trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h M /issm/trunk-jpl/src/c/modules/VecMergex/VecMergex.h M /issm/trunk-jpl/src/c/modules/VerticesDofx/VerticesDofx.h M /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp M /issm/trunk-jpl/src/c/shared/Alloc/alloc\_module.cpp M /issm/trunk-jpl/src/c/shared/Bamg/OppositeAngle.h M /issm/trunk-jpl/src/c/shared/Bamg/det.h M /issm/trunk-jpl/src/c/shared/Elements/elements.h M /issm/trunk-jpl/src/c/shared/Exp/exp.h M /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp M /issm/trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp M /issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp M /issm/trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp M /issm/trunk-jpl/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp M /issm/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp M /issm/trunk-jpl/src/c/shared/Wrapper/wrappershared.h M /issm/trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp M /issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/solutions/ResetBoundaryConditions.cpp M /issm/trunk-jpl/src/c/solutions/adjointbalancethickness\_core.cpp M /issm/trunk-jpl/src/c/solutions/adjointdiagnostic\_core.cpp M /issm/trunk-jpl/src/c/solutions/balancethickness\_core.cpp M /issm/trunk-jpl/src/c/solutions/bedslope\_core.cpp M /issm/trunk-jpl/src/c/solutions/control\_core.cpp M /issm/trunk-jpl/src/c/solutions/controlconvergence.cpp M /issm/trunk-jpl/src/c/solutions/controltao\_core.cpp M /issm/trunk-jpl/src/c/solutions/convergence.cpp M /issm/trunk-jpl/src/c/solutions/diagnostic\_core.cpp M /issm/trunk-jpl/src/c/solutions/enthalpy\_core.cpp M /issm/trunk-jpl/src/c/solutions/gradient\_core.cpp M /issm/trunk-jpl/src/c/solutions/hydrology\_core.cpp M /issm/trunk-jpl/src/c/solutions/hydrology\_core\_step.cpp M /issm/trunk-jpl/src/c/solutions/objectivefunction.cpp M /issm/trunk-jpl/src/c/solutions/prognostic\_core.cpp M /issm/trunk-jpl/src/c/solutions/solutions.h M /issm/trunk-jpl/src/c/solutions/steadystate\_core.cpp M /issm/trunk-jpl/src/c/solutions/steadystateconvergence.cpp M /issm/trunk-jpl/src/c/solutions/surfaceslope\_core.cpp M /issm/trunk-jpl/src/c/solutions/thermal\_core.cpp M /issm/trunk-jpl/src/c/solutions/transient\_core.cpp M /issm/trunk-jpl/src/c/solvers/solver\_adjoint\_linear.cpp M /issm/trunk-jpl/src/c/solvers/solver\_linear.cpp M /issm/trunk-jpl/src/c/solvers/solver\_newton.cpp M /issm/trunk-jpl/src/c/solvers/solver\_nonlinear.cpp M /issm/trunk-jpl/src/c/solvers/solver\_stokescoupling\_nonlinear.cpp M /issm/trunk-jpl/src/c/solvers/solver\_thermal\_nonlinear.cpp M /issm/trunk-jpl/src/c/solvers/solvers.h\\
+Export determination: 6. \\
+Rationale: Almost done migrating objects to classes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#148} with diff file ISSM-12833-12834.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh\\
+Export determination: 6. \\
+Rationale: One script per version, as usual\\
+\vspace{3em}
+
+\noindent \textbf{Change \#149} with diff file ISSM-12834-12835.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h\\
+Export determination: 6. \\
+Rationale: BUG: compilation issue with new classes directory\\
+\vspace{3em}
+
+\noindent \textbf{Change \#150} with diff file ISSM-12835-12836.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/IoModel.h M /issm/trunk-jpl/src/c/classes/bamg/BamgQuadtree.h M /issm/trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Attribute.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_ColorStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Comment.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Container.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Document.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Feature.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_File.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Folder.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Geometry.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_GroundOverlay.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Icon.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LatLonBox.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineString.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LinearRing.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_MultiGeometry.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Object.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Overlay.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Placemark.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Point.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_PolyStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Polygon.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Style.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_StyleSelector.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_SubStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Unknown.cpp M /issm/trunk-jpl/src/c/classes/objects/objects.h M /issm/trunk-jpl/src/c/classes/objects.h M /issm/trunk-jpl/src/c/issm.h M /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp M /issm/trunk-jpl/src/c/matlab/io/matlabio.h A /issm/trunk-jpl/src/c/shared/Elements/PrintArrays.cpp M /issm/trunk-jpl/src/c/shared/Elements/elements.h M /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp\\
+Export determination: 6. \\
+Rationale: FIX: fixed compilation with new classes directory\\
+\vspace{3em}
+
+\noindent \textbf{Change \#151} with diff file ISSM-12836-12837.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/dakota/DakotaPlugin.h\\
+Export determination: 6. \\
+Rationale: FIX: Dakota compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#152} with diff file ISSM-12837-12838.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/dakota/DakotaPlugin.cpp M /issm/trunk-jpl/src/c/modules/Dakotax/Dakotax.cpp\\
+Export determination: 6. \\
+Rationale: CHG: dakota compilation still some undefined symbols\\
+\vspace{3em}
+
+\noindent \textbf{Change \#153} with diff file ISSM-12838-12839.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-macosx64-larour.sh M /issm/trunk-jpl/src/modules/matlab/Makefile.am M /issm/trunk-jpl/src/modules/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: added dakota include path to mex and python compile\\
+\vspace{3em}
+
+\noindent \textbf{Change \#154} with diff file ISSM-12839-12840.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/dakota\\
+Export determination: 6. \\
+Rationale: CHG: ignore some files for svn\\
+\vspace{3em}
+
+\noindent \textbf{Change \#155} with diff file ISSM-12840-12841.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/classes.h\\
+Export determination: 6. \\
+Rationale: CHG: un-included dakotaobjects.h from classes.h, to reduce dakota useless warnings at compilation time.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#156} with diff file ISSM-12841-12842.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test111.m\\
+Export determination: 6. \\
+Rationale: CHG: minor tolerance\\
+\vspace{3em}
+
+\noindent \textbf{Change \#157} with diff file ISSM-12842-12843.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/MatlabFuncs.py M /issm/trunk-jpl/src/m/utils/consistency/checkfield.m A /issm/trunk-jpl/src/m/utils/consistency/checkfield.py\\
+Export determination: 6. \\
+Rationale: Preliminary python version of checkfield.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#158} with diff file ISSM-12843-12844.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-greenplanet.sh\\
+Export determination: 6. \\
+Rationale: BUG: use shell script instead of csh (does not work)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#159} with diff file ISSM-12844-12845.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/acenet.m M /issm/trunk-jpl/src/m/classes/clusters/castor.m M /issm/trunk-jpl/src/m/classes/clusters/cosmos.m M /issm/trunk-jpl/src/m/classes/clusters/discover.m M /issm/trunk-jpl/src/m/classes/clusters/gemini.m M /issm/trunk-jpl/src/m/classes/clusters/generic.m M /issm/trunk-jpl/src/m/classes/clusters/generic.py M /issm/trunk-jpl/src/m/classes/clusters/greenplanet.m M /issm/trunk-jpl/src/m/classes/clusters/pfe.m M /issm/trunk-jpl/src/m/classes/clusters/pollux.m\\
+Export determination: 6. \\
+Rationale: added dirname in cluster for BuildQueueScript\\
+\vspace{3em}
+
+\noindent \textbf{Change \#160} with diff file ISSM-12845-12846.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/solve.m M /issm/trunk-jpl/src/m/model/solve.py\\
+Export determination: 6. \\
+Rationale: CHG: added runtimename in solve for BuildQueueScript\\
+\vspace{3em}
+
+\noindent \textbf{Change \#161} with diff file ISSM-12846-12847.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/android/android\_aux.sh M /issm/trunk-jpl/externalpackages/gsl/install-android.sh M /issm/trunk-jpl/externalpackages/libtool/install.sh M /issm/trunk-jpl/externalpackages/triangle/configs/android/configure.make M /issm/trunk-jpl/scripts/DownloadExternalPackage.py\\
+Export determination: 6. \\
+Rationale: Major changes to the DownloadExternalPackage.py script.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#162} with diff file ISSM-12847-12848.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/pythonio.h\\
+Export determination: 6. \\
+Rationale: objects to classes change\\
+\vspace{3em}
+
+\noindent \textbf{Change \#163} with diff file ISSM-12848-12849.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Par/SquareShelfConstrained.py\\
+Export determination: 6. \\
+Rationale: reshaped x and y arrays to rank-1 for InterpFromMeshToMesh2d\\
+\vspace{3em}
+
+\noindent \textbf{Change \#164} with diff file ISSM-12849-12850.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/pythonio.h\\
+Export determination: 6. \\
+Rationale: cleanup, removed commented line\\
+\vspace{3em}
+
+\noindent \textbf{Change \#165} with diff file ISSM-12850-12851.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/Matrix.h M /issm/trunk-jpl/src/c/classes/matrix/Vector.cpp M /issm/trunk-jpl/src/c/classes/matrix/Vector.h M /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp A /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToPetscMat.cpp (from /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToPetscMatrix.cpp:12849) D /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToPetscMatrix.cpp A /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToPetscVec.cpp (from /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToPetscVector.cpp:12849) D /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToPetscVector.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp M /issm/trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp M /issm/trunk-jpl/src/c/matlab/io/matlabio.h M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.h D /issm/trunk-jpl/src/c/modules/Solverx/SolverxGsl.cpp M /issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp A /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp (from /issm/trunk-jpl/src/c/modules/Solverx/SolverxGsl.cpp:12849) M /issm/trunk-jpl/src/c/shared/Alloc/alloc\_module.cpp A /issm/trunk-jpl/src/c/toolkits/petsc/objects A /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp A /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h A /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp A /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h A /issm/trunk-jpl/src/c/toolkits/petsc/objects/petscobjects.h M /issm/trunk-jpl/src/c/toolkits/petsc/petscincludes.h\\
+Export determination: 6. \\
+Rationale: CHG: homoegeization of the matrix class. Is now split into a pector (petsc vector) and svector (sequential vector). New objects PetscMat and PetscVec in the toolkits allow for this homoegeization. Things are not perfect yet, as we reference the matrix and vector internals across the code, which could create some serious issues.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#166} with diff file ISSM-12851-12852.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp\\
+Export determination: 6. \\
+Rationale: CHG: convert Enums to int otherwise compiler complains that: ' comparison between ‘enum MatrixType’ and ‘enum matrixtype’ '\\
+\vspace{3em}
+
+\noindent \textbf{Change \#167} with diff file ISSM-12852-12853.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Alloc/alloc\_module.cpp\\
+Export determination: 6. \\
+Rationale: BUG: reverting to previous memory managenet in xdelete\_module. This is a bug due to Matlab C++ memory management deficiencies (to say the least).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#168} with diff file ISSM-12853-12854.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.py M /issm/trunk-jpl/test/Par/SquareShelfConstrained.par M /issm/trunk-jpl/test/Par/SquareShelfConstrained.py\\
+Export determination: 6. \\
+Rationale: Minor changes for test101.py.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#169} with diff file ISSM-12854-12855.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/utils/BC/SetIceShelfBC.py\\
+Export determination: 6. \\
+Rationale: Revised python version of SetIceShelfBC.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#170} with diff file ISSM-12855-12856.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed issue with segfault in SolverxPetsc.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#171} with diff file ISSM-12856-12857.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/addnote.py\\
+Export determination: 6. \\
+Rationale: Revised python version of addnote.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#172} with diff file ISSM-12857-12858.diff: \\
+Function name: \\
+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: BUG: fixed segfault.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#173} with diff file ISSM-12858-12859.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/plot/colormaps/getcolormap.m\\
+Export determination: 6. \\
+Rationale: make jet the colormap default\\
+\vspace{3em}
+
+\noindent \textbf{Change \#174} with diff file ISSM-12859-12860.diff: \\
+Function name: \\
+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: BUG: fixed segfault in PetscMat and PetscVec constructors.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#175} with diff file ISSM-12860-12861.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/Matrix.h M /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp M /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp\\
+Export determination: 6. \\
+Rationale: TriMesh matrices should be sequential by default\\
+\vspace{3em}
+
+\noindent \textbf{Change \#176} with diff file ISSM-12861-12862.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp\\
+Export determination: 6. \\
+Rationale: delete objects\\
+\vspace{3em}
+
+\noindent \textbf{Change \#177} with diff file ISSM-12862-12863.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am D /issm/trunk-jpl/src/c/shared/Alloc/alloc\_module.cpp D /issm/trunk-jpl/src/c/shared/Alloc/alloc\_module.h M /issm/trunk-jpl/src/c/shared/shared.h\\
+Export determination: 6. \\
+Rationale: CHG: xalloc\_modules not needed anymore, use regular destructor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#178} with diff file ISSM-12863-12864.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/issm/SeqVec.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#179} with diff file ISSM-12864-12865.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp\\
+Export determination: 6. \\
+Rationale: CHG: use SeqMat and not PETScMat for interpolation module\\
+\vspace{3em}
+
+\noindent \textbf{Change \#180} with diff file ISSM-12865-12866.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp\\
+Export determination: 6. \\
+Rationale: BUG: Petsc vector cannot be NULL even if it is of size 0\\
+\vspace{3em}
+
+\noindent \textbf{Change \#181} with diff file ISSM-12866-12867.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: delta18o update\\
+\vspace{3em}
+
+\noindent \textbf{Change \#182} with diff file ISSM-12867-12868.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp M /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp\\
+Export determination: 6. \\
+Rationale: delta18o update\\
+\vspace{3em}
+
+\noindent \textbf{Change \#183} with diff file ISSM-12868-12869.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/c/objects\\
+Export determination: 6. \\
+Rationale: CHG: removing empty directory\\
+\vspace{3em}
+
+\noindent \textbf{Change \#184} with diff file ISSM-12869-12870.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test421.m\\
+Export determination: 6. \\
+Rationale: CHG: tolerance test421\\
+\vspace{3em}
+
+\noindent \textbf{Change \#185} with diff file ISSM-12870-12871.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/solutions/transient\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: Delta18O was not using the right array for temp and precip\\
+\vspace{3em}
+
+\noindent \textbf{Change \#186} with diff file ISSM-12871-12872.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutions/transient\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: reverted back\\
+\vspace{3em}
+
+\noindent \textbf{Change \#187} with diff file ISSM-12873-12874.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/parameterization/parameterize.m M /issm/trunk-jpl/src/m/model/parameterization/parameterize.py\\
+Export determination: 6. \\
+Rationale: Revised python version of parameterize.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#188} with diff file ISSM-12874-12875.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/parameterization/parameterize.py\\
+Export determination: 6. \\
+Rationale: Forgot an import in parameterize.py.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#189} with diff file ISSM-12875-12876.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/bamg/typedefs.h\\
+Export determination: 6. \\
+Rationale: BUG: on some machine LONG\_BIT might not be defined, causing I2 to have different typedefs resulting in undefined symbols\\
+\vspace{3em}
+
+\noindent \textbf{Change \#190} with diff file ISSM-12876-12877.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/bamg/Mesh.cpp M /issm/trunk-jpl/src/c/classes/bamg/typedefs.h\\
+Export determination: 6. \\
+Rationale: BUG: changed Icoor2 from double to long\\
+\vspace{3em}
+
+\noindent \textbf{Change \#191} with diff file ISSM-12877-12878.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/bamg/macros.h\\
+Export determination: 6. \\
+Rationale: CHG: Getting rid of LONG\_BIT for good\\
+\vspace{3em}
+
+\noindent \textbf{Change \#192} with diff file ISSM-12881-12882.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/gsl/install-android.sh M /issm/trunk-jpl/externalpackages/libtool/install.sh M /issm/trunk-jpl/externalpackages/triangle/install-android.sh M /issm/trunk-jpl/scripts/DownloadExternalPackage.py\\
+Export determination: 6. \\
+Rationale: Modified DownloadExternalPackage.py to output usage examples when fed no arguments.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#193} with diff file ISSM-12882-12883.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h\\
+Export determination: 6. \\
+Rationale: Added support for extrusion of TransientInputs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#194} with diff file ISSM-12883-12884.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Data/delta18o.data M /issm/trunk-jpl/test/NightlyRun/IdToName.m A /issm/trunk-jpl/test/NightlyRun/test236.m\\
+Export determination: 6. \\
+Rationale: 2d nightly run for ispdd and isdelta18o method\\
+\vspace{3em}
+
+\noindent \textbf{Change \#195} with diff file ISSM-12884-12885.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutions/transient\_core.cpp\\
+Export determination: 6. \\
+Rationale: add temperature and precipitation calculated with isdelta18o in matlab outputs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#196} with diff file ISSM-12885-12886.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: isdelta18o update\\
+\vspace{3em}
+
+\noindent \textbf{Change \#197} with diff file ISSM-12886-12887.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp\\
+Export determination: 6. \\
+Rationale: isdelta18o update 2\\
+\vspace{3em}
+
+\noindent \textbf{Change \#198} with diff file ISSM-12887-12888.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive236.mat M /issm/trunk-jpl/test/NightlyRun/IdToName.py\\
+Export determination: 6. \\
+Rationale: NEW: archive for pdd nightly run\\
+\vspace{3em}
+
+\noindent \textbf{Change \#199} with diff file ISSM-12888-12889.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/recover\_areas.m A /issm/trunk-jpl/src/m/model/recover\_areas.py M /issm/trunk-jpl/src/m/model/setflowequation.m A /issm/trunk-jpl/src/m/model/setflowequation.py M /issm/trunk-jpl/src/m/utils/Geometry/FlagElements.py\\
+Export determination: 6. \\
+Rationale: Running python versions of setflowequation (and more).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#200} with diff file ISSM-12889-12890.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/model/AnalysisConfiguration.py M /issm/trunk-jpl/src/m/model/MatlabFuncs.py M /issm/trunk-jpl/src/m/model/ismodelselfconsistent.py M /issm/trunk-jpl/src/m/model/marshall.py M /issm/trunk-jpl/src/m/model/process\_solve\_options.py M /issm/trunk-jpl/src/m/model/solve.py M /issm/trunk-jpl/test/NightlyRun/test101.py\\
+Export determination: 6. \\
+Rationale: Python fixes.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#201} with diff file ISSM-12890-12891.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh\\
+Export determination: 6. \\
+Rationale: adding my configure file for mpich2\\
+\vspace{3em}
+
+\noindent \textbf{Change \#202} with diff file ISSM-12891-12892.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/test237.m\\
+Export determination: 6. \\
+Rationale: 3d nightly run for ispdd method\\
+\vspace{3em}
+
+\noindent \textbf{Change \#203} with diff file ISSM-12892-12893.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/m/utils/BC/SetIceSheetBC.m M /issm/trunk-jpl/src/m/utils/BC/SetIceShelfBC.m M /issm/trunk-jpl/src/m/utils/BC/SetMarineIceSheetBC.m\\
+Export determination: 6. \\
+Rationale: update for ispdd method\\
+\vspace{3em}
+
+\noindent \textbf{Change \#204} with diff file ISSM-12893-12894.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: update for ispdd method\\
+\vspace{3em}
+
+\noindent \textbf{Change \#205} with diff file ISSM-12894-12895.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/tk A /issm/trunk-jpl/externalpackages/tk/install.sh\\
+Export determination: 6. \\
+Rationale: NEW: tk install package\\
+\vspace{3em}
+
+\noindent \textbf{Change \#206} with diff file ISSM-12895-12896.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/matplotlib/install-osx.sh M /issm/trunk-jpl/externalpackages/matplotlib/install.sh M /issm/trunk-jpl/externalpackages/tcl/install.sh M /issm/trunk-jpl/externalpackages/tk\\
+Export determination: 6. \\
+Rationale: CHG: tk: ignore some svn files. tcl: do sudo install. matplotlib: link against tcl and tk from the OS.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#207} with diff file ISSM-12896-12897.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive237.mat\\
+Export determination: 6. \\
+Rationale: NEW: archive for 2nd pdd nightly run\\
+\vspace{3em}
+
+\noindent \textbf{Change \#208} with diff file ISSM-12898-12899.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: BUG: added tcl and tk in the LD\_LIBRARY\_PATH, so that Python Matplotlib finds it.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#209} with diff file ISSM-12899-12900.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.h M /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/Vector.cpp\\
+Export determination: 6. \\
+Rationale: BUG: forward declaration of Parameters.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#210} with diff file ISSM-12900-12901.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: checkign for existence of Petsc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#211} with diff file ISSM-12902-12903.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/src/c/Container/Observations.cpp M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/bamg/macros.h M /issm/trunk-jpl/src/c/classes/bamg/typedefs.h\\
+Export determination: 6. \\
+Rationale: CHG: Refactored SolverxGsl to current SolverxSeq.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#212} with diff file ISSM-12903-12904.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp\\
+Export determination: 6. \\
+Rationale: use switch instead of elseif\\
+\vspace{3em}
+
+\noindent \textbf{Change \#213} with diff file ISSM-12904-12905.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: do not use libtool for now (NR crashes)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#214} with diff file ISSM-12905-12906.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp\\
+Export determination: 6. \\
+Rationale: BUG: crosses initialization requires brackets around case\\
+\vspace{3em}
+
+\noindent \textbf{Change \#215} with diff file ISSM-12906-12907.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/bamg/typedefs.h\\
+Export determination: 6. \\
+Rationale: BUG: Icoor2 must be long (and not unsigned long), otherwise matlab crashes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#216} with diff file ISSM-12907-12908.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/bamg/macros.h\\
+Export determination: 6. \\
+Rationale: BUG: back to previous definition of MaxICoor22\\
+\vspace{3em}
+
+\noindent \textbf{Change \#217} with diff file ISSM-12908-12909.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/bamg/macros.h\\
+Export determination: 6. \\
+Rationale: BUG: parenthesis\\
+\vspace{3em}
+
+\noindent \textbf{Change \#218} with diff file ISSM-12909-12910.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#219} with diff file ISSM-12910-12911.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/matrix/Vector.cpp M /issm/trunk-jpl/src/c/classes/matrix/Vector.h M /issm/trunk-jpl/src/c/solutions/controltao\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed tao for new Vector and Matrices objects\\
+\vspace{3em}
+
+\noindent \textbf{Change \#220} with diff file ISSM-12911-12912.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim\\
+Export determination: 6. \\
+Rationale: updated synchronization script\\
+\vspace{3em}
+
+\noindent \textbf{Change \#221} with diff file ISSM-12912-12913.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LinearRing.cpp\\
+Export determination: 6. \\
+Rationale: Removed doubly dimensioned arrays from KML classes.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#222} with diff file ISSM-12913-12914.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/planetmesh.m A /issm/trunk-jpl/src/m/model/mesh/planet A /issm/trunk-jpl/src/m/model/mesh/planet/mesh\_refine\_tri4.m (from /issm/trunk-jpl/src/m/planet/mesh\_refine\_tri4.m:12898) A /issm/trunk-jpl/src/m/model/mesh/planet/planetmesher.m A /issm/trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m (from /issm/trunk-jpl/src/m/planet/planetmixedmesh.m:12898) A /issm/trunk-jpl/src/m/model/mesh/planet/planettrimesh.m (from /issm/trunk-jpl/src/m/planet/planettrimesh.m:12898) A /issm/trunk-jpl/src/m/model/mesh/planet/runme.m (from /issm/trunk-jpl/src/m/planet/runme.m:12898) A /issm/trunk-jpl/src/m/model/mesh/planet/sphere\_project.m (from /issm/trunk-jpl/src/m/planet/sphere\_project.m:12898) A /issm/trunk-jpl/src/m/model/mesh/planet/sphere\_tri.m (from /issm/trunk-jpl/src/m/planet/sphere\_tri.m:12898) D /issm/trunk-jpl/src/m/planet\\
+Export determination: 6. \\
+Rationale: NEW: new implementation of the planet models. @planet now has a @planetmesh instead of a @mesh object. Also moved around the planet meshers we have. Starting to homogeneize things.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#223} with diff file ISSM-12914-12915.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/Makefile.am\\
+Export determination: 6. \\
+Rationale: no more planet directory in matlab\\
+\vspace{3em}
+
+\noindent \textbf{Change \#224} with diff file ISSM-12915-12916.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Attribute.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Comment.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Container.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Document.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_File.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Folder.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_GroundOverlay.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Icon.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LatLonBox.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineString.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LinearRing.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_MultiGeometry.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Object.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Overlay.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Placemark.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Point.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_PolyStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Polygon.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Style.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Unknown.cpp\\
+Export determination: 6. \\
+Rationale: Implementation of xNew and xDelete in KML classes.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#225} with diff file ISSM-12916-12917.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp\\
+Export determination: 6. \\
+Rationale: A couple more changes for the xNew and xDelete in the KML classes.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#226} with diff file ISSM-12920-12921.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-arm-linux.sh M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Revisions the shared option of issm\_options.m4, configure.ac, and src/c/Makefile.am\\
+\vspace{3em}
+
+\noindent \textbf{Change \#227} with diff file ISSM-12921-12922.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/libtool/install.sh\\
+Export determination: 6. \\
+Rationale: Fixed installation script\\
+\vspace{3em}
+
+\noindent \textbf{Change \#228} with diff file ISSM-12922-12923.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: do not use libtool for now (crashing NR)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#229} with diff file ISSM-12923-12924.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp\\
+Export determination: 6. \\
+Rationale: minor deltao18 update\\
+\vspace{3em}
+
+\noindent \textbf{Change \#230} with diff file ISSM-12924-12925.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/acenet.m\\
+Export determination: 6. \\
+Rationale: BUG: no interactive property\\
+\vspace{3em}
+
+\noindent \textbf{Change \#231} with diff file ISSM-12925-12926.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/acenet.m\\
+Export determination: 6. \\
+Rationale: acenet cluster update\\
+\vspace{3em}
+
+\noindent \textbf{Change \#232} with diff file ISSM-12926-12927.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive236.mat M /issm/trunk-jpl/test/Archives/Archive237.mat\\
+Export determination: 6. \\
+Rationale: CHG: updated ispdd archives\\
+\vspace{3em}
+
+\noindent \textbf{Change \#233} with diff file ISSM-12927-12928.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/objects/Elements/Element.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp A /issm/trunk-jpl/src/c/modules/ThicknessAcrossGradientx A /issm/trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp A /issm/trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h A /issm/trunk-jpl/src/c/modules/ThicknessAlongGradientx A /issm/trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp A /issm/trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h M /issm/trunk-jpl/src/c/modules/modules.h\\
+Export determination: 6. \\
+Rationale: NEW: added 2 new cost functions for balance thickness (ThicknessAcrossGradient and ThicknessAlongGradient)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#234} with diff file ISSM-12928-12929.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m A /issm/trunk-jpl/src/m/enum/ThicknessAcrossGradientEnum.m A /issm/trunk-jpl/src/m/enum/ThicknessAlongGradientEnum.m\\
+Export determination: 6. \\
+Rationale: CHG: sync\\
+\vspace{3em}
+
+\noindent \textbf{Change \#235} with diff file ISSM-12929-12930.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/model/solvers/asmoptions.py (from /issm/trunk-jpl/src/py/model/solvers/asmoptions.py:12911) A /issm/trunk-jpl/src/m/model/solvers/iluasmoptions.py (from /issm/trunk-jpl/src/py/model/solvers/iluasmoptions.py:12911) A /issm/trunk-jpl/src/m/model/solvers/jacobiasmoptions.py (from /issm/trunk-jpl/src/py/model/solvers/jacobiasmoptions.py:12911) A /issm/trunk-jpl/src/m/model/solvers/jacobicgoptions.py (from /issm/trunk-jpl/src/py/model/solvers/jacobicgoptions.py:12911) A /issm/trunk-jpl/src/m/model/solvers/matlaboptions.py (from /issm/trunk-jpl/src/py/model/solvers/matlaboptions.py:12911) A /issm/trunk-jpl/src/m/model/solvers/mumpsoptions.py (from /issm/trunk-jpl/src/py/model/solvers/mumpsoptions.py:12911) A /issm/trunk-jpl/src/m/model/solvers/soroptions.py (from /issm/trunk-jpl/src/py/model/solvers/soroptions.py:12911) A /issm/trunk-jpl/src/m/model/solvers/stokesoptions.py (from /issm/trunk-jpl/src/py/model/solvers/stokesoptions.py:12911)\\
+Export determination: 6. \\
+Rationale: New python versions of iluasmoptions and mumpsoptions (and others moved).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#236} with diff file ISSM-12930-12931.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/py/model/solvers/asmoptions.py D /issm/trunk-jpl/src/py/model/solvers/iluasmoptions.py D /issm/trunk-jpl/src/py/model/solvers/jacobiasmoptions.py D /issm/trunk-jpl/src/py/model/solvers/jacobicgoptions.py D /issm/trunk-jpl/src/py/model/solvers/matlaboptions.py D /issm/trunk-jpl/src/py/model/solvers/mumpsoptions.py D /issm/trunk-jpl/src/py/model/solvers/soroptions.py D /issm/trunk-jpl/src/py/model/solvers/stokesoptions.py\\
+Export determination: 6. \\
+Rationale: New python versions of iluasmoptions and mumpsoptions (and others moved).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#237} with diff file ISSM-12931-12932.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp\\
+Export determination: 6. \\
+Rationale: CHG: enable new responses\\
+\vspace{3em}
+
+\noindent \textbf{Change \#238} with diff file ISSM-12932-12933.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/solvers/iluasmoptions.m M /issm/trunk-jpl/src/m/model/solvers/iluasmoptions.py\\
+Export determination: 6. \\
+Rationale: CHG: Fixed some typos, according to Mathieu.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#239} with diff file ISSM-12933-12934.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp\\
+Export determination: 6. \\
+Rationale: BUG: Need to include QmuVzEnum as input for Penta\\
+\vspace{3em}
+
+\noindent \textbf{Change \#240} with diff file ISSM-12934-12935.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/bamg/Mesh.cpp M /issm/trunk-jpl/src/c/classes/bamg/Mesh.h M /issm/trunk-jpl/src/c/classes/bamg/macros.h\\
+Export determination: 6. \\
+Rationale: CHG: removed MaxICoor22, which was only used by CloseBoundaryEdgeV2, which is in turn never used\\
+\vspace{3em}
+
+\noindent \textbf{Change \#241} with diff file ISSM-12935-12936.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: NEW: enabling libtool\\
+\vspace{3em}
+
+\noindent \textbf{Change \#242} with diff file ISSM-12937-12938.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh\\
+Export determination: 6. \\
+Rationale: BUG: do not remove *.so in install/lib. This is needed by libtool\\
+\vspace{3em}
+
+\noindent \textbf{Change \#243} with diff file ISSM-12938-12939.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/model.py M /issm/trunk-jpl/src/m/classes/verbose.m M /issm/trunk-jpl/src/m/classes/verbose.py\\
+Export determination: 6. \\
+Rationale: NEW: New python version of verbose and some other minor updates.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#244} with diff file ISSM-12939-12940.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/verbose.m\\
+Export determination: 6. \\
+Rationale: CHG: Clean up BinaryToVerbose.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#245} with diff file ISSM-12940-12941.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: reverting back - do not use libtool yet, mex modules do not compile\\
+\vspace{3em}
+
+\noindent \textbf{Change \#246} with diff file ISSM-12941-12942.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac\\
+Export determination: 6. \\
+Rationale: BUG: forgot to add AC\_PROG\_RANLIB back\\
+\vspace{3em}
+
+\noindent \textbf{Change \#247} with diff file ISSM-12942-12943.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: get mex compilation and linking flag from mex -v instead (might need to add -ldl to PETSC\_LIB)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#248} with diff file ISSM-12943-12944.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/mesh.m M /issm/trunk-jpl/src/m/classes/mesh.py M /issm/trunk-jpl/src/m/classes/private.m M /issm/trunk-jpl/src/m/classes/private.py M /issm/trunk-jpl/src/m/model/WriteData.py M /issm/trunk-jpl/src/m/model/ismodelselfconsistent.py M /issm/trunk-jpl/src/m/model/marshall.py M /issm/trunk-jpl/src/m/utils/consistency/checkfield.py\\
+Export determination: 6. \\
+Rationale: NEW: Python checkconsistency and marshall methods for mesh sub-class (plus other changes to make them work).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#249} with diff file ISSM-12944-12945.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py M /issm/trunk-jpl/src/m/classes/pairoptions.py M /issm/trunk-jpl/src/m/model/AnalysisConfiguration.py M /issm/trunk-jpl/src/m/model/MatlabProcessPatch.py M /issm/trunk-jpl/src/m/model/WriteData.py M /issm/trunk-jpl/src/m/model/addnote.py M /issm/trunk-jpl/src/m/model/ismodelselfconsistent.py M /issm/trunk-jpl/src/m/model/loadresultsfromcluster.py M /issm/trunk-jpl/src/m/model/loadresultsfromdisk.py M /issm/trunk-jpl/src/m/model/marshall.py M /issm/trunk-jpl/src/m/model/parameterization/parameterize.py M /issm/trunk-jpl/src/m/model/parseresultsfromdisk.py M /issm/trunk-jpl/src/m/model/petscversion.py M /issm/trunk-jpl/src/m/model/process\_solve\_options.py M /issm/trunk-jpl/src/m/model/recover\_areas.py M /issm/trunk-jpl/src/m/model/setflowequation.py M /issm/trunk-jpl/src/m/model/solve.py M /issm/trunk-jpl/src/m/model/waitonlock.py M /issm/trunk-jpl/src/m/utils/BC/SetIceShelfBC.py M /issm/trunk-jpl/src/m/utils/Cluster/parallelrange.py M /issm/trunk-jpl/src/m/utils/Geometry/FlagElements.py M /issm/trunk-jpl/src/m/utils/OS/ismumps.py M /issm/trunk-jpl/src/m/utils/OS/ispetsc.py M /issm/trunk-jpl/src/m/utils/OS/issmscpin.py M /issm/trunk-jpl/src/m/utils/OS/issmscpout.py M /issm/trunk-jpl/src/m/utils/OS/issmssh.py M /issm/trunk-jpl/src/m/utils/Shell/issmdir.py\\
+Export determination: 6. \\
+Rationale: CHG: Made python docstrings have consistent indentation.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#250} with diff file ISSM-12945-12946.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/diagnostic.m\\
+Export determination: 6. \\
+Rationale: BUG: added check for diagnostic.restol: not NaN allowed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#251} with diff file ISSM-12948-12949.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: load environment variables only if the external package has been installed (and corresponding install directory exists\\
+\vspace{3em}
+
+\noindent \textbf{Change \#252} with diff file ISSM-12949-12950.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/basalforcings.py M /issm/trunk-jpl/src/m/classes/constants.py 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/friction.py M /issm/trunk-jpl/src/m/classes/geometry.py M /issm/trunk-jpl/src/m/classes/initialization.m M /issm/trunk-jpl/src/m/classes/initialization.py M /issm/trunk-jpl/src/m/classes/mask.py M /issm/trunk-jpl/src/m/classes/materials.py M /issm/trunk-jpl/src/m/classes/mesh.py M /issm/trunk-jpl/src/m/classes/private.py M /issm/trunk-jpl/src/m/classes/surfaceforcings.m M /issm/trunk-jpl/src/m/classes/surfaceforcings.py M /issm/trunk-jpl/src/m/classes/timestepping.py M /issm/trunk-jpl/src/m/model/setflowequation.m M /issm/trunk-jpl/src/m/model/solve.py\\
+Export determination: 6. \\
+Rationale: NEW: A bunch more python checkconsistency and marshall methods for sub-classes (plus other minor changes).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#253} with diff file ISSM-12950-12951.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/setflowequation.m\\
+Export determination: 6. \\
+Rationale: BUG: Oops -- fixed typos in last commit.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#254} with diff file ISSM-12951-12952.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: BUG: fixing environment.sh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#255} with diff file ISSM-12952-12953.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.py\\
+Export determination: 6. \\
+Rationale: CHG: Take advantage of MatlabFuncs.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#256} with diff file ISSM-12953-12954.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim\\
+Export determination: 6. \\
+Rationale: CHG: updating vim C syntax\\
+\vspace{3em}
+
+\noindent \textbf{Change \#257} with diff file ISSM-12954-12955.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim M /issm/trunk-jpl/externalpackages/vim/addons/vimrc\\
+Export determination: 6. \\
+Rationale: CHG: added some vim maps\\
+\vspace{3em}
+
+\noindent \textbf{Change \#258} with diff file ISSM-12955-12956.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutions/controltao\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: enable tao for PETSc 3.3\\
+\vspace{3em}
+
+\noindent \textbf{Change \#259} with diff file ISSM-12956-12957.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/Synchronize.sh M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim\\
+Export determination: 6. \\
+Rationale: BUG: readded Enums in c.vim\\
+\vspace{3em}
+
+\noindent \textbf{Change \#260} with diff file ISSM-12957-12958.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim\\
+Export determination: 6. \\
+Rationale: CHG: readded C stuff\\
+\vspace{3em}
+
+\noindent \textbf{Change \#261} with diff file ISSM-12958-12959.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/autodiff.py M /issm/trunk-jpl/src/m/classes/balancethickness.py M /issm/trunk-jpl/src/m/classes/basalforcings.py M /issm/trunk-jpl/src/m/classes/constants.py M /issm/trunk-jpl/src/m/classes/debug.py M /issm/trunk-jpl/src/m/classes/diagnostic.py M /issm/trunk-jpl/src/m/classes/flaim.py M /issm/trunk-jpl/src/m/classes/flowequation.py M /issm/trunk-jpl/src/m/classes/friction.py M /issm/trunk-jpl/src/m/classes/geometry.py M /issm/trunk-jpl/src/m/classes/groundingline.py M /issm/trunk-jpl/src/m/classes/hydrology.py M /issm/trunk-jpl/src/m/classes/initialization.py M /issm/trunk-jpl/src/m/classes/inversion.py M /issm/trunk-jpl/src/m/classes/mask.py M /issm/trunk-jpl/src/m/classes/materials.py M /issm/trunk-jpl/src/m/classes/mesh.py M /issm/trunk-jpl/src/m/classes/miscellaneous.py M /issm/trunk-jpl/src/m/classes/private.py M /issm/trunk-jpl/src/m/classes/prognostic.py M /issm/trunk-jpl/src/m/classes/qmu.py M /issm/trunk-jpl/src/m/classes/radaroverlay.py M /issm/trunk-jpl/src/m/classes/rifts.py M /issm/trunk-jpl/src/m/classes/settings.py M /issm/trunk-jpl/src/m/classes/solver.py M /issm/trunk-jpl/src/m/classes/steadystate.py M /issm/trunk-jpl/src/m/classes/surfaceforcings.py M /issm/trunk-jpl/src/m/classes/thermal.py M /issm/trunk-jpl/src/m/classes/timestepping.py M /issm/trunk-jpl/src/m/classes/transient.py M /issm/trunk-jpl/src/m/classes/verbose.py A /issm/trunk-jpl/src/m/utils/Math/isnans.py\\
+Export determination: 6. \\
+Rationale: NEW: Another bunch more python checkconsistency and marshall methods for sub-classes (plus other minor changes).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#262} with diff file ISSM-12959-12960.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/setflowequation.m M /issm/trunk-jpl/test/NightlyRun/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: Change variable name list in matlab scripts to keep consistent with python, where it is very bad.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#263} with diff file ISSM-12960-12961.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/mesh.m M /issm/trunk-jpl/src/m/utils/consistency/checkfield.m\\
+Export determination: 6. \\
+Rationale: CHG: check that mesh.z is within bed and surface\\
+\vspace{3em}
+
+\noindent \textbf{Change \#264} with diff file ISSM-12961-12962.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/utils/Exp/expdisp.m\\
+Export determination: 6. \\
+Rationale: CHG: allow exp linestyle color to also be passed as numeric\\
+\vspace{3em}
+
+\noindent \textbf{Change \#265} with diff file ISSM-12962-12963.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/plot/applyoptions.m\\
+Export determination: 6. \\
+Rationale: NEW: allows us to specifically dictate the cbYTickLabels or round existing tick labels\\
+\vspace{3em}
+
+\noindent \textbf{Change \#266} with diff file ISSM-12963-12964.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/pysvn A /issm/trunk-jpl/externalpackages/pysvn/install.sh A /issm/trunk-jpl/externalpackages/pysvn/pysvn-1.7.6.tar.gz\\
+Export determination: 6. \\
+Rationale: Python bindings for svn\\
+\vspace{3em}
+
+\noindent \textbf{Change \#267} with diff file ISSM-12964-12965.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/pysvn/pysvn-1.7.6.tar.gz\\
+Export determination: 6. \\
+Rationale: CHG: archive not needed (available on ISSM website)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#268} with diff file ISSM-12965-12966.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/svn A /issm/trunk-jpl/externalpackages/svn/install.sh\\
+Export determination: 6. \\
+Rationale: NEW: svn package\\
+\vspace{3em}
+
+\noindent \textbf{Change \#269} with diff file ISSM-12966-12967.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: NEW: settings for svn package.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#270} with diff file ISSM-12967-12968.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/apr A /issm/trunk-jpl/externalpackages/apr/install.sh\\
+Export determination: 6. \\
+Rationale: NEW: apr package.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#271} with diff file ISSM-12968-12969.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: NEW: apr package\\
+\vspace{3em}
+
+\noindent \textbf{Change \#272} with diff file ISSM-12969-12970.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/apr-util A /issm/trunk-jpl/externalpackages/apr-util/install.sh\\
+Export determination: 6. \\
+Rationale: NEW: apr-util package.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#273} with diff file ISSM-12970-12971.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: NEW: apr-util package configuration\\
+\vspace{3em}
+
+\noindent \textbf{Change \#274} with diff file ISSM-12971-12972.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: NEW: sqlite configuration\\
+\vspace{3em}
+
+\noindent \textbf{Change \#275} with diff file ISSM-12972-12973.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/sqlite A /issm/trunk-jpl/externalpackages/sqlite/install.sh\\
+Export determination: 6. \\
+Rationale: NEW: package sqlite\\
+\vspace{3em}
+
+\noindent \textbf{Change \#276} with diff file ISSM-12973-12974.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/svn/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: no need for sudo on linux machines\\
+\vspace{3em}
+
+\noindent \textbf{Change \#277} with diff file ISSM-12974-12975.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.csh M /issm/trunk-jpl/etc/environment.sh D /issm/trunk-jpl/etc/environment\_variables.csh D /issm/trunk-jpl/etc/environment\_variables.sh\\
+Export determination: 6. \\
+Rationale: CHG: adopted same philosophy for environment\_variables.csh: load environment variables only if directory exists\\
+\vspace{3em}
+
+\noindent \textbf{Change \#278} with diff file ISSM-12975-12976.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: BUG: fixed path for libpetsc.so\\
+\vspace{3em}
+
+\noindent \textbf{Change \#279} with diff file ISSM-12976-12977.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: normalize velocity\\
+\vspace{3em}
+
+\noindent \textbf{Change \#280} with diff file ISSM-12977-12978.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive225.mat M /issm/trunk-jpl/test/NightlyRun/test225.m\\
+Export determination: 6. \\
+Rationale: CHG: Archive225 and test225: change in bed position was done after extrusion\\
+\vspace{3em}
+
+\noindent \textbf{Change \#281} with diff file ISSM-12978-12979.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/mesh.m\\
+Export determination: 6. \\
+Rationale: BUG: allow 10$^-10$ tolerance for mesh.z compared to bed and surface\\
+\vspace{3em}
+
+\noindent \textbf{Change \#282} with diff file ISSM-12979-12980.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/plot/applyoptions.m M /issm/trunk-jpl/src/m/model/plot/processdata.m M /issm/trunk-jpl/src/m/model/plot/processmesh.m\\
+Export determination: 6. \\
+Rationale: CHG: adapted plotting routines to @planet class, where the @model.mesh object is a @planetmesh, which does not have all the fields that a more classic @mesh class object.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#283} with diff file ISSM-12980-12981.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/planet.m M /issm/trunk-jpl/src/m/classes/planetmesh.m\\
+Export determination: 6. \\
+Rationale: NEW: implemented a new planetmesh object, simplified mesh object and plugged it into the @planet.mesh field.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#284} with diff file ISSM-12981-12982.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/model/mesh/planet/planetmesher.m M /issm/trunk-jpl/src/m/model/mesh/planet/planetmixedmesh.m M /issm/trunk-jpl/src/m/model/mesh/planet/planettrimesh.m D /issm/trunk-jpl/src/m/model/mesh/planet/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: changing routine names. Getting rid of runme.m file, which is not needed anymore.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#285} with diff file ISSM-12982-12983.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/planet.m\\
+Export determination: 6. \\
+Rationale: CHG: forgot to get rid of top level fields such as r, theta and fi, which have been pushed down to the @planetmesh level.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#286} with diff file ISSM-12983-12984.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.m\\
+Export determination: 6. \\
+Rationale: BUG: added flag for valgrind use on MacOSX platforms.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#287} with diff file ISSM-12984-12985.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/svn M /issm/trunk-jpl/externalpackages/svn/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: added PYTHON and swyg bindings. Ignore some files for svn.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#288} with diff file ISSM-12985-12986.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/swig M /issm/trunk-jpl/externalpackages/swig/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: include python bindings + ignore some files for svn.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#289} with diff file ISSM-12986-12987.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages M /issm/trunk-jpl/externalpackages/apr M /issm/trunk-jpl/externalpackages/apr-util M /issm/trunk-jpl/externalpackages/distribute M /issm/trunk-jpl/externalpackages/pysvn M /issm/trunk-jpl/externalpackages/pysvn/install.sh M /issm/trunk-jpl/externalpackages/readline M /issm/trunk-jpl/externalpackages/sqlite\\
+Export determination: 6. \\
+Rationale: CHG: ignore some files for svn.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#290} with diff file ISSM-12987-12988.diff: \\
+Function name: \\
+M /issm/trunk-jpl M /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/Matrix.h M /issm/trunk-jpl/src/c/classes/matrix/Vector.h\\
+Export determination: 6. \\
+Rationale: CHG: changed the default constructor, according to which library is available. This way, if Petsc is not available, Matrix and Vector constructors default to SeqMat and SeqVec structures.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#291} with diff file ISSM-12988-12989.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-macosx64-larour-ad.sh M /issm/trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.h M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp M /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp M /issm/trunk-jpl/src/c/solutions/issm.cpp M /issm/trunk-jpl/src/m/model/solve.m\\
+Export determination: 6. \\
+Rationale: NEW: created wrapper to SolverxSeq solver, so that when running with Adolc support, we can go from solving for a IssmDouble* vector solution to solving a double* vector solution, and come back to an IssmDouble* vector. In addition, added tape start phase and tape statistics at the beginning and end of issm.cpp respectively. Also fixed a bug (reCast type) in PddSurfaceMassBalance. Fixed a bug in solve.m, where cluster.np was set to 1 too late for Adolc runs. config-macosx64-larour-ad.sh now defaults to using adolc.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#292} with diff file ISSM-12989-12990.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/modules/matlab/Makefile.am M /issm/trunk-jpl/src/modules/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Changed deprecated 'INCLUDES' to 'AM\_CPPFLAGS'.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#293} with diff file ISSM-12990-12991.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Minor correction to /home/glperez/issm/issm-uci/trunk-jpl/src/c/Makefile.am\\
+\vspace{3em}
+
+\noindent \textbf{Change \#294} with diff file ISSM-12991-12992.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: homogenized externalpackages DIR path (should end by install)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#295} with diff file ISSM-12992-12993.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: BUG: during installation some packages are not in the PATH because they were not installed when environment.sh was sources\\
+\vspace{3em}
+
+\noindent \textbf{Change \#296} with diff file ISSM-12993-12994.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp\\
+Export determination: 6. \\
+Rationale: CHG: moving \_error\_ to \_error2\_\\
+\vspace{3em}
+
+\noindent \textbf{Change \#297} with diff file ISSM-12994-12995.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: moving \_error\_ to \_error2\_\\
+\vspace{3em}
+
+\noindent \textbf{Change \#298} with diff file ISSM-12995-12996.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/qmu/lclist\_write.m (from /issm/trunk-jpl/src/m/utils/qmu/lclist\_write.m:12992) A /issm/trunk-jpl/src/m/qmu/param\_write.m (from /issm/trunk-jpl/src/m/utils/qmu/param\_write.m:12992) A /issm/trunk-jpl/src/m/qmu/rlev\_write.m (from /issm/trunk-jpl/src/m/utils/qmu/rlev\_write.m:12992) A /issm/trunk-jpl/src/m/qmu/rlist\_write.m (from /issm/trunk-jpl/src/m/utils/qmu/rlist\_write.m:12992) A /issm/trunk-jpl/src/m/qmu/vector\_write.m (from /issm/trunk-jpl/src/m/utils/qmu/vector\_write.m:12992) A /issm/trunk-jpl/src/m/qmu/vlist\_write.m (from /issm/trunk-jpl/src/m/utils/qmu/vlist\_write.m:12992) D /issm/trunk-jpl/src/m/utils/qmu\\
+Export determination: 6. \\
+Rationale: CHG: moved utils/qmu in qmu\\
+\vspace{3em}
+
+\noindent \textbf{Change \#299} with diff file ISSM-12996-12997.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/Array (from /issm/trunk-jpl/src/m/utils/Array:12992) A /issm/trunk-jpl/src/m/BC (from /issm/trunk-jpl/src/m/utils/BC:12992) A /issm/trunk-jpl/src/m/Basins (from /issm/trunk-jpl/src/m/utils/Basins:12992) A /issm/trunk-jpl/src/m/Cluster (from /issm/trunk-jpl/src/m/utils/Cluster:12992) A /issm/trunk-jpl/src/m/DataProcessing (from /issm/trunk-jpl/src/m/utils/DataProcessing:12992) A /issm/trunk-jpl/src/m/Ecco3 (from /issm/trunk-jpl/src/m/utils/Ecco3:12992) A /issm/trunk-jpl/src/m/Exp (from /issm/trunk-jpl/src/m/utils/Exp:12992) A /issm/trunk-jpl/src/m/Geometry (from /issm/trunk-jpl/src/m/utils/Geometry:12992) A /issm/trunk-jpl/src/m/ImageProcessing (from /issm/trunk-jpl/src/m/utils/ImageProcessing:12992) A /issm/trunk-jpl/src/m/Interp (from /issm/trunk-jpl/src/m/utils/Interp:12992) A /issm/trunk-jpl/src/m/Kml (from /issm/trunk-jpl/src/m/utils/Kml:12992) A /issm/trunk-jpl/src/m/LatLong (from /issm/trunk-jpl/src/m/utils/LatLong:12992) A /issm/trunk-jpl/src/m/Math (from /issm/trunk-jpl/src/m/utils/Math:12992) A /issm/trunk-jpl/src/m/Meca (from /issm/trunk-jpl/src/m/utils/Meca:12992) A /issm/trunk-jpl/src/m/Mesh (from /issm/trunk-jpl/src/m/utils/Mesh:12992) A /issm/trunk-jpl/src/m/Miscellaneous (from /issm/trunk-jpl/src/m/utils/Miscellaneous:12992) A /issm/trunk-jpl/src/m/Model (from /issm/trunk-jpl/src/m/utils/Model:12992) A /issm/trunk-jpl/src/m/Numerics (from /issm/trunk-jpl/src/m/utils/Numerics:12992) A /issm/trunk-jpl/src/m/OS (from /issm/trunk-jpl/src/m/utils/OS:12992) A /issm/trunk-jpl/src/m/Plot (from /issm/trunk-jpl/src/m/utils/Plot:12992) A /issm/trunk-jpl/src/m/Shell (from /issm/trunk-jpl/src/m/utils/Shell:12992) A /issm/trunk-jpl/src/m/String (from /issm/trunk-jpl/src/m/utils/String:12992) A /issm/trunk-jpl/src/m/consistency (from /issm/trunk-jpl/src/m/utils/consistency:12992) A /issm/trunk-jpl/src/m/recursivepath.m (from /issm/trunk-jpl/src/m/utils/recursivepath.m:12992) D /issm/trunk-jpl/src/m/utils\\
+Export determination: 6. \\
+Rationale: CHG: moved src/m/utils/ to src/m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#300} with diff file ISSM-12997-12998.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/Array D /issm/trunk-jpl/src/m/BC D /issm/trunk-jpl/src/m/Basins D /issm/trunk-jpl/src/m/Cluster D /issm/trunk-jpl/src/m/DataProcessing D /issm/trunk-jpl/src/m/Ecco3 D /issm/trunk-jpl/src/m/Exp D /issm/trunk-jpl/src/m/Geometry D /issm/trunk-jpl/src/m/ImageProcessing D /issm/trunk-jpl/src/m/Interp D /issm/trunk-jpl/src/m/Kml D /issm/trunk-jpl/src/m/LatLong D /issm/trunk-jpl/src/m/Math D /issm/trunk-jpl/src/m/Meca D /issm/trunk-jpl/src/m/Mesh D /issm/trunk-jpl/src/m/Miscellaneous D /issm/trunk-jpl/src/m/Model D /issm/trunk-jpl/src/m/Numerics D /issm/trunk-jpl/src/m/OS D /issm/trunk-jpl/src/m/Plot D /issm/trunk-jpl/src/m/Shell D /issm/trunk-jpl/src/m/String A /issm/trunk-jpl/src/m/array (from /issm/trunk-jpl/src/m/Array:12996) A /issm/trunk-jpl/src/m/basins (from /issm/trunk-jpl/src/m/Basins:12996) A /issm/trunk-jpl/src/m/boundaryconditions (from /issm/trunk-jpl/src/m/BC:12996) A /issm/trunk-jpl/src/m/cluster (from /issm/trunk-jpl/src/m/Cluster:12996) A /issm/trunk-jpl/src/m/dataprocessing (from /issm/trunk-jpl/src/m/DataProcessing:12996) A /issm/trunk-jpl/src/m/ecco3 (from /issm/trunk-jpl/src/m/Ecco3:12996) A /issm/trunk-jpl/src/m/exp (from /issm/trunk-jpl/src/m/Exp:12996) A /issm/trunk-jpl/src/m/geometry (from /issm/trunk-jpl/src/m/Geometry:12996) A /issm/trunk-jpl/src/m/interp (from /issm/trunk-jpl/src/m/Interp:12996) A /issm/trunk-jpl/src/m/kml/exp2kml.m (from /issm/trunk-jpl/src/m/Kml/exp2kml.m:12996) A /issm/trunk-jpl/src/m/kml/kml2exp.m (from /issm/trunk-jpl/src/m/Kml/kml2exp.m:12996) A /issm/trunk-jpl/src/m/kml/kml2expg.m (from /issm/trunk-jpl/src/m/Kml/kml2expg.m:12996) A /issm/trunk-jpl/src/m/latlong (from /issm/trunk-jpl/src/m/LatLong:12996) A /issm/trunk-jpl/src/m/math (from /issm/trunk-jpl/src/m/Math:12996) A /issm/trunk-jpl/src/m/meca (from /issm/trunk-jpl/src/m/Meca:12996) A /issm/trunk-jpl/src/m/mesh (from /issm/trunk-jpl/src/m/Mesh:12996) A /issm/trunk-jpl/src/m/miscellaneous (from /issm/trunk-jpl/src/m/Miscellaneous:12996) A /issm/trunk-jpl/src/m/model/loadmodel.m (from /issm/trunk-jpl/src/m/Model/loadmodel.m:12996) A /issm/trunk-jpl/src/m/model/loadmodellist.m (from /issm/trunk-jpl/src/m/Model/loadmodellist.m:12996) A /issm/trunk-jpl/src/m/numerics (from /issm/trunk-jpl/src/m/Numerics:12996) A /issm/trunk-jpl/src/m/os (from /issm/trunk-jpl/src/m/OS:12996) A /issm/trunk-jpl/src/m/plot (from /issm/trunk-jpl/src/m/Plot:12996) A /issm/trunk-jpl/src/m/shell (from /issm/trunk-jpl/src/m/Shell:12996) A /issm/trunk-jpl/src/m/string (from /issm/trunk-jpl/src/m/String:12996)\\
+Export determination: 6. \\
+Rationale: CHG: moved directories to lower case\\
+\vspace{3em}
+
+\noindent \textbf{Change \#301} with diff file ISSM-12998-12999.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/math/cfl\_step.m (from /issm/trunk-jpl/src/m/numerics/cfl\_step.m:12997) D /issm/trunk-jpl/src/m/numerics\\
+Export determination: 6. \\
+Rationale: CHG: moved numerics to math\\
+\vspace{3em}
+
+\noindent \textbf{Change \#302} with diff file ISSM-12999-13000.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/os/flaimdir.m (from /issm/trunk-jpl/src/m/shell/flaimdir.m:12997) A /issm/trunk-jpl/src/m/os/issmdir.m (from /issm/trunk-jpl/src/m/shell/issmdir.m:12997) A /issm/trunk-jpl/src/m/os/issmdir.py (from /issm/trunk-jpl/src/m/shell/issmdir.py:12997) A /issm/trunk-jpl/src/m/os/jplsvn.m (from /issm/trunk-jpl/src/m/shell/jplsvn.m:12997) A /issm/trunk-jpl/src/m/os/shell (from /issm/trunk-jpl/src/m/shell:12997) D /issm/trunk-jpl/src/m/os/shell/flaimdir.m D /issm/trunk-jpl/src/m/os/shell/issmdir.m D /issm/trunk-jpl/src/m/os/shell/issmdir.py D /issm/trunk-jpl/src/m/os/shell/jplsvn.m D /issm/trunk-jpl/src/m/os/shell/ucisvn.m A /issm/trunk-jpl/src/m/os/ucisvn.m (from /issm/trunk-jpl/src/m/shell/ucisvn.m:12997) D /issm/trunk-jpl/src/m/shell\\
+Export determination: 6. \\
+Rationale: CHG: moved shell to os\\
+\vspace{3em}
+
+\noindent \textbf{Change \#303} with diff file ISSM-13000-13001.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/os/shell\\
+Export determination: 6. \\
+Rationale: CHG: moved shell to os\\
+\vspace{3em}
+
+\noindent \textbf{Change \#304} with diff file ISSM-13001-13002.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/os/recursivepath.m (from /issm/trunk-jpl/src/m/recursivepath.m:12996) D /issm/trunk-jpl/src/m/recursivepath.m\\
+Export determination: 6. \\
+Rationale: CHG:moved recursivepath to os\\
+\vspace{3em}
+
+\noindent \textbf{Change \#305} with diff file ISSM-13002-13003.diff: \\
+Function name: \\
+M /issm/trunk-jpl/startup.m\\
+Export determination: 6. \\
+Rationale: CHG:moved recursivepath to os\\
+\vspace{3em}
+
+\noindent \textbf{Change \#306} with diff file ISSM-13003-13004.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/model/solve\\
+Export determination: 6. \\
+Rationale: CHG: added solve\\
+\vspace{3em}
+
+\noindent \textbf{Change \#307} with diff file ISSM-13004-13005.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/model/WriteData.m D /issm/trunk-jpl/src/m/model/WriteData.py D /issm/trunk-jpl/src/m/model/ismodelselfconsistent.m D /issm/trunk-jpl/src/m/model/ismodelselfconsistent.py D /issm/trunk-jpl/src/m/model/loadmultipleresultsfromcluster.m D /issm/trunk-jpl/src/m/model/loadresultsfromcluster.m D /issm/trunk-jpl/src/m/model/loadresultsfromcluster.py D /issm/trunk-jpl/src/m/model/loadresultsfromdisk.m D /issm/trunk-jpl/src/m/model/loadresultsfromdisk.py D /issm/trunk-jpl/src/m/model/marshall.m D /issm/trunk-jpl/src/m/model/marshall.py D /issm/trunk-jpl/src/m/model/petscversion.m D /issm/trunk-jpl/src/m/model/petscversion.py D /issm/trunk-jpl/src/m/model/process\_solve\_options.m D /issm/trunk-jpl/src/m/model/process\_solve\_options.py A /issm/trunk-jpl/src/m/model/solve/WriteData.m (from /issm/trunk-jpl/src/m/model/WriteData.m:12996) A /issm/trunk-jpl/src/m/model/solve/WriteData.py (from /issm/trunk-jpl/src/m/model/WriteData.py:12996) A /issm/trunk-jpl/src/m/model/solve/ismodelselfconsistent.m (from /issm/trunk-jpl/src/m/model/ismodelselfconsistent.m:12996) A /issm/trunk-jpl/src/m/model/solve/ismodelselfconsistent.py (from /issm/trunk-jpl/src/m/model/ismodelselfconsistent.py:12996) A /issm/trunk-jpl/src/m/model/solve/loadmultipleresultsfromcluster.m (from /issm/trunk-jpl/src/m/model/loadmultipleresultsfromcluster.m:12996) A /issm/trunk-jpl/src/m/model/solve/loadresultsfromcluster.m (from /issm/trunk-jpl/src/m/model/loadresultsfromcluster.m:12996) A /issm/trunk-jpl/src/m/model/solve/loadresultsfromcluster.py (from /issm/trunk-jpl/src/m/model/loadresultsfromcluster.py:12996) A /issm/trunk-jpl/src/m/model/solve/loadresultsfromdisk.m (from /issm/trunk-jpl/src/m/model/loadresultsfromdisk.m:12996) A /issm/trunk-jpl/src/m/model/solve/loadresultsfromdisk.py (from /issm/trunk-jpl/src/m/model/loadresultsfromdisk.py:12996) A /issm/trunk-jpl/src/m/model/solve/marshall.m (from /issm/trunk-jpl/src/m/model/marshall.m:12996) A /issm/trunk-jpl/src/m/model/solve/marshall.py (from /issm/trunk-jpl/src/m/model/marshall.py:12996) A /issm/trunk-jpl/src/m/model/solve/process\_solve\_options.m (from /issm/trunk-jpl/src/m/model/process\_solve\_options.m:12996) A /issm/trunk-jpl/src/m/model/solve/process\_solve\_options.py (from /issm/trunk-jpl/src/m/model/process\_solve\_options.py:12996) A /issm/trunk-jpl/src/m/model/solve/solve.m (from /issm/trunk-jpl/src/m/model/solve.m:12996) A /issm/trunk-jpl/src/m/model/solve/solve.py (from /issm/trunk-jpl/src/m/model/solve.py:12996) D /issm/trunk-jpl/src/m/model/solve.m D /issm/trunk-jpl/src/m/model/solve.py A /issm/trunk-jpl/src/m/os/petscversion.m (from /issm/trunk-jpl/src/m/model/petscversion.m:12996) A /issm/trunk-jpl/src/m/os/petscversion.py (from /issm/trunk-jpl/src/m/model/petscversion.py:12996)\\
+Export determination: 6. \\
+Rationale: CHG: moving stuff around\\
+\vspace{3em}
+
+\noindent \textbf{Change \#308} with diff file ISSM-13005-13006.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/model.m A /issm/trunk-jpl/src/m/interp/averaging.m (from /issm/trunk-jpl/src/m/model/averaging.m:12996) A /issm/trunk-jpl/src/m/meca/basalstress.m (from /issm/trunk-jpl/src/m/model/basalstress.m:12996) A /issm/trunk-jpl/src/m/meca/mechanicalproperties.m (from /issm/trunk-jpl/src/m/model/mechanicalproperties.m:12996) D /issm/trunk-jpl/src/m/model/AnalysisConfiguration.m D /issm/trunk-jpl/src/m/model/AnalysisConfiguration.py D /issm/trunk-jpl/src/m/model/BasinConstrain.m D /issm/trunk-jpl/src/m/model/BasinConstrainShelf.m D /issm/trunk-jpl/src/m/model/addnote.m D /issm/trunk-jpl/src/m/model/addnote.py D /issm/trunk-jpl/src/m/model/averageconnectivity.m D /issm/trunk-jpl/src/m/model/averaging.m D /issm/trunk-jpl/src/m/model/basalstress.m D /issm/trunk-jpl/src/m/model/basevert.m D /issm/trunk-jpl/src/m/model/bedslope.m D /issm/trunk-jpl/src/m/model/collapse.m D /issm/trunk-jpl/src/m/model/extrude.m D /issm/trunk-jpl/src/m/model/mechanicalproperties.m D /issm/trunk-jpl/src/m/model/modelextract.m A /issm/trunk-jpl/src/m/model/regional A /issm/trunk-jpl/src/m/model/regional/BasinConstrain.m (from /issm/trunk-jpl/src/m/model/BasinConstrain.m:12996) A /issm/trunk-jpl/src/m/model/regional/BasinConstrainShelf.m (from /issm/trunk-jpl/src/m/model/BasinConstrainShelf.m:12996) M /issm/trunk-jpl/src/m/model/solve/ismodelselfconsistent.m M /issm/trunk-jpl/src/m/model/solve/ismodelselfconsistent.py\\
+Export determination: 6. \\
+Rationale: CHG: moved modelextract to extract, extrude and collapse are now methods of model\\
+\vspace{3em}
+
+\noindent \textbf{Change \#309} with diff file ISSM-13006-13007.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/contrib A /issm/trunk-jpl/src/m/contrib/ecco A /issm/trunk-jpl/src/m/contrib/massbalance A /issm/trunk-jpl/src/m/contrib/massbalance/contourmassbalance.m (from /issm/trunk-jpl/src/m/model/contourmassbalance.m:12996) D /issm/trunk-jpl/src/m/model/contourenvelope.m D /issm/trunk-jpl/src/m/model/contourmassbalance.m A /issm/trunk-jpl/src/m/model/inversions A /issm/trunk-jpl/src/m/model/inversions/parametercontrolB.m (from /issm/trunk-jpl/src/m/model/parameterization/parametercontrolB.m:12996) A /issm/trunk-jpl/src/m/model/inversions/parametercontroldrag.m (from /issm/trunk-jpl/src/m/model/parameterization/parametercontroldrag.m:12996) D /issm/trunk-jpl/src/m/model/parametercontroloptimization.m A /issm/trunk-jpl/src/m/model/parameterization/contourenvelope.m (from /issm/trunk-jpl/src/m/model/contourenvelope.m:12996) D /issm/trunk-jpl/src/m/model/parameterization/parametercontrolB.m D /issm/trunk-jpl/src/m/model/parameterization/parametercontroldrag.m A /issm/trunk-jpl/src/m/model/parameterization/setflowequation.m (from /issm/trunk-jpl/src/m/model/setflowequation.m:12996) A /issm/trunk-jpl/src/m/model/parameterization/setflowequation.py (from /issm/trunk-jpl/src/m/model/setflowequation.py:12996) A /issm/trunk-jpl/src/m/model/parameterization/setmask.m (from /issm/trunk-jpl/src/m/model/setmask.m:12996) A /issm/trunk-jpl/src/m/model/parameterization/setmask.py (from /issm/trunk-jpl/src/m/model/setmask.py:12996) A /issm/trunk-jpl/src/m/model/parameterization/setmask2.m (from /issm/trunk-jpl/src/m/model/setmask2.m:12996) D /issm/trunk-jpl/src/m/model/parseresultsfromdisk.m D /issm/trunk-jpl/src/m/model/parseresultsfromdisk.py A /issm/trunk-jpl/src/m/model/print A /issm/trunk-jpl/src/m/model/print/printmodel.m (from /issm/trunk-jpl/src/m/model/printmodel.m:12996) D /issm/trunk-jpl/src/m/model/printmodel.m D /issm/trunk-jpl/src/m/model/qpr.m D /issm/trunk-jpl/src/m/model/setflowequation.m D /issm/trunk-jpl/src/m/model/setflowequation.py D /issm/trunk-jpl/src/m/model/setmask.m D /issm/trunk-jpl/src/m/model/setmask.py D /issm/trunk-jpl/src/m/model/setmask2.m A /issm/trunk-jpl/src/m/model/solve/parseresultsfromdisk.m (from /issm/trunk-jpl/src/m/model/parseresultsfromdisk.m:12996) A /issm/trunk-jpl/src/m/model/solve/parseresultsfromdisk.py (from /issm/trunk-jpl/src/m/model/parseresultsfromdisk.py:12996) A /issm/trunk-jpl/src/m/model/solve/waitonlock.m (from /issm/trunk-jpl/src/m/model/waitonlock.m:12996) A /issm/trunk-jpl/src/m/model/solve/waitonlock.py (from /issm/trunk-jpl/src/m/model/waitonlock.py:12996) D /issm/trunk-jpl/src/m/model/waitonlock.m D /issm/trunk-jpl/src/m/model/waitonlock.py\\
+Export determination: 6. \\
+Rationale: CHG: moved some stuff to contrib\\
+\vspace{3em}
+
+\noindent \textbf{Change \#310} with diff file ISSM-13007-13008.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/contrib/hydrology A /issm/trunk-jpl/src/m/contrib/hydrology/effectivepressure.m (from /issm/trunk-jpl/src/m/model/effectivepressure.m:12996) A /issm/trunk-jpl/src/m/contrib/massbalance/divergence.m (from /issm/trunk-jpl/src/m/model/divergence.m:12996) A /issm/trunk-jpl/src/m/kml/kmlimagesc.m (from /issm/trunk-jpl/src/m/model/kmlimagesc.m:12996) A /issm/trunk-jpl/src/m/meca/drivingstress.m (from /issm/trunk-jpl/src/m/model/drivingstress.m:12996) A /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py (from /issm/trunk-jpl/src/m/model/MatlabFuncs.py:12996) D /issm/trunk-jpl/src/m/model/DepthAverage.m D /issm/trunk-jpl/src/m/model/EnumToModelField.m D /issm/trunk-jpl/src/m/model/MatlabFuncs.py D /issm/trunk-jpl/src/m/model/MatlabProcessPatch.m D /issm/trunk-jpl/src/m/model/MatlabProcessPatch.py D /issm/trunk-jpl/src/m/model/divergence.m D /issm/trunk-jpl/src/m/model/drivingstress.m D /issm/trunk-jpl/src/m/model/effectivepressure.m A /issm/trunk-jpl/src/m/model/extrusion A /issm/trunk-jpl/src/m/model/extrusion/DepthAverage.m (from /issm/trunk-jpl/src/m/model/DepthAverage.m:12996) A /issm/trunk-jpl/src/m/model/extrusion/project2d.m (from /issm/trunk-jpl/src/m/model/project2d.m:12996) A /issm/trunk-jpl/src/m/model/extrusion/project3d.m (from /issm/trunk-jpl/src/m/model/project3d.m:12996) D /issm/trunk-jpl/src/m/model/graddetection.m A /issm/trunk-jpl/src/m/model/io A /issm/trunk-jpl/src/m/model/io/loadmodel.m (from /issm/trunk-jpl/src/m/model/loadmodel.m:12997) A /issm/trunk-jpl/src/m/model/io/loadmodellist.m (from /issm/trunk-jpl/src/m/model/loadmodellist.m:12997) D /issm/trunk-jpl/src/m/model/kmlimagesc.m D /issm/trunk-jpl/src/m/model/loadmodel.m D /issm/trunk-jpl/src/m/model/loadmodellist.m D /issm/trunk-jpl/src/m/model/project2d.m D /issm/trunk-jpl/src/m/model/project3d.m A /issm/trunk-jpl/src/m/model/solve/MatlabProcessPatch.m (from /issm/trunk-jpl/src/m/model/MatlabProcessPatch.m:12996) A /issm/trunk-jpl/src/m/model/solve/MatlabProcessPatch.py (from /issm/trunk-jpl/src/m/model/MatlabProcessPatch.py:12996) M /issm/trunk-jpl/src/m/model/tres.m\\
+Export determination: 6. \\
+Rationale: CHG: moving stuff around\\
+\vspace{3em}
+
+\noindent \textbf{Change \#311} with diff file ISSM-13008-13009.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/modellist.m A /issm/trunk-jpl/src/m/contrib/ecco/MeltingGroundingLines.m (from /issm/trunk-jpl/src/m/model/MeltingGroundingLines.m:12996) A /issm/trunk-jpl/src/m/contrib/ecco/PropagateFlagsUntilDistance.m (from /issm/trunk-jpl/src/m/model/PropagateFlagsUntilDistance.m:12996) A /issm/trunk-jpl/src/m/contrib/hack A /issm/trunk-jpl/src/m/contrib/hack/thicknessevolution.m (from /issm/trunk-jpl/src/m/model/thicknessevolution.m:12996) A /issm/trunk-jpl/src/m/contrib/hack/tres.m (from /issm/trunk-jpl/src/m/model/tres.m:13007) A /issm/trunk-jpl/src/m/contrib/massbalance/outflow.m (from /issm/trunk-jpl/src/m/model/outflow.m:12996) A /issm/trunk-jpl/src/m/geometry/ThicknessCorrection.m (from /issm/trunk-jpl/src/m/model/ThicknessCorrection.m:12996) A /issm/trunk-jpl/src/m/geometry/recover\_areas.m (from /issm/trunk-jpl/src/m/model/recover\_areas.m:12996) A /issm/trunk-jpl/src/m/geometry/recover\_areas.py (from /issm/trunk-jpl/src/m/model/recover\_areas.py:12996) A /issm/trunk-jpl/src/m/geometry/slope.m (from /issm/trunk-jpl/src/m/model/slope.m:12996) A /issm/trunk-jpl/src/m/interp/ProfileValues.m (from /issm/trunk-jpl/src/m/model/ProfileValues.m:12996) A /issm/trunk-jpl/src/m/interp/SectionValues.m (from /issm/trunk-jpl/src/m/model/SectionValues.m:12996) A /issm/trunk-jpl/src/m/meca/shear2d.m (from /issm/trunk-jpl/src/m/model/shear2d.m:12996) D /issm/trunk-jpl/src/m/model/MeltingGroundingLines.m D /issm/trunk-jpl/src/m/model/ProfileValues.m D /issm/trunk-jpl/src/m/model/PropagateFlagsUntilDistance.m D /issm/trunk-jpl/src/m/model/README D /issm/trunk-jpl/src/m/model/SectionValues.m D /issm/trunk-jpl/src/m/model/ThicknessCorrection.m A /issm/trunk-jpl/src/m/model/inversions/misfit.m (from /issm/trunk-jpl/src/m/model/misfit.m:12996) M /issm/trunk-jpl/src/m/model/mesh/bamg.m D /issm/trunk-jpl/src/m/model/misfit.m D /issm/trunk-jpl/src/m/model/modelsextract.m D /issm/trunk-jpl/src/m/model/modelsextractfromdomains.m D /issm/trunk-jpl/src/m/model/modis.m D /issm/trunk-jpl/src/m/model/outflow.m A /issm/trunk-jpl/src/m/model/plot/radarpower.m (from /issm/trunk-jpl/src/m/model/radarpower.m:12996) D /issm/trunk-jpl/src/m/model/processgeometry.m D /issm/trunk-jpl/src/m/model/qstat.m D /issm/trunk-jpl/src/m/model/radarpower.m D /issm/trunk-jpl/src/m/model/recover\_areas.m D /issm/trunk-jpl/src/m/model/recover\_areas.py A /issm/trunk-jpl/src/m/model/regional/regionaltransient2d.m (from /issm/trunk-jpl/src/m/model/regionaltransient2d.m:12996) D /issm/trunk-jpl/src/m/model/regionaltransient2d.m D /issm/trunk-jpl/src/m/model/shear2d.m D /issm/trunk-jpl/src/m/model/sia.m D /issm/trunk-jpl/src/m/model/slope.m D /issm/trunk-jpl/src/m/model/thicknessevolution.m D /issm/trunk-jpl/src/m/model/tres.m\\
+Export determination: 6. \\
+Rationale: CHG: moved stuff around\\
+\vspace{3em}
+
+\noindent \textbf{Change \#312} with diff file ISSM-13009-13010.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/contrib/hack/sia.m (from /issm/trunk-jpl/src/m/model/sia.m:13000) A /issm/trunk-jpl/src/m/display (from /issm/trunk-jpl/src/m/model/display:13008) A /issm/trunk-jpl/src/m/extrusion (from /issm/trunk-jpl/src/m/model/extrusion:13008) A /issm/trunk-jpl/src/m/inversions (from /issm/trunk-jpl/src/m/model/inversions:13008) A /issm/trunk-jpl/src/m/io (from /issm/trunk-jpl/src/m/model/io:13008) A /issm/trunk-jpl/src/m/mesh/bamg.m (from /issm/trunk-jpl/src/m/model/mesh/bamg.m:13008) A /issm/trunk-jpl/src/m/mesh/findsegments.m (from /issm/trunk-jpl/src/m/model/mesh/findsegments.m:13008) A /issm/trunk-jpl/src/m/mesh/meshconvert.m (from /issm/trunk-jpl/src/m/model/mesh/meshconvert.m:13008) A /issm/trunk-jpl/src/m/mesh/planet (from /issm/trunk-jpl/src/m/model/mesh/planet:13008) A /issm/trunk-jpl/src/m/mesh/rifts (from /issm/trunk-jpl/src/m/model/mesh/rifts:13008) A /issm/trunk-jpl/src/m/mesh/triangle.m (from /issm/trunk-jpl/src/m/model/mesh/triangle.m:13008) A /issm/trunk-jpl/src/m/mesh/triangle.py (from /issm/trunk-jpl/src/m/model/mesh/triangle.py:13008) A /issm/trunk-jpl/src/m/mesh/yams.m (from /issm/trunk-jpl/src/m/model/mesh/yams.m:13008) D /issm/trunk-jpl/src/m/model A /issm/trunk-jpl/src/m/multiplequeue (from /issm/trunk-jpl/src/m/model/multiplequeue:13008) A /issm/trunk-jpl/src/m/parameterization (from /issm/trunk-jpl/src/m/model/parameterization:13008) A /issm/trunk-jpl/src/m/partition (from /issm/trunk-jpl/src/m/model/partition:13008) A /issm/trunk-jpl/src/m/plot/applyoptions.m (from /issm/trunk-jpl/src/m/model/plot/applyoptions.m:13008) A /issm/trunk-jpl/src/m/plot/arrow.m (from /issm/trunk-jpl/src/m/model/plot/arrow.m:13008) A /issm/trunk-jpl/src/m/plot/checkplotoptions.m (from /issm/trunk-jpl/src/m/model/plot/checkplotoptions.m:13008) A /issm/trunk-jpl/src/m/plot/colormaps (from /issm/trunk-jpl/src/m/model/plot/colormaps:13008) A /issm/trunk-jpl/src/m/plot/imagescnan.m (from /issm/trunk-jpl/src/m/model/plot/imagescnan.m:13008) A /issm/trunk-jpl/src/m/plot/kmlgroundoverlay.m (from /issm/trunk-jpl/src/m/model/plot/kmlgroundoverlay.m:13008) A /issm/trunk-jpl/src/m/plot/latlonoverlay.m (from /issm/trunk-jpl/src/m/model/plot/latlonoverlay.m:13008) A /issm/trunk-jpl/src/m/plot/northarrow.m (from /issm/trunk-jpl/src/m/model/plot/northarrow.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_BC.m (from /issm/trunk-jpl/src/m/model/plot/plot\_BC.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_basaldrag.m (from /issm/trunk-jpl/src/m/model/plot/plot\_basaldrag.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_boundaries.m (from /issm/trunk-jpl/src/m/model/plot/plot\_boundaries.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_contour.m (from /issm/trunk-jpl/src/m/model/plot/plot\_contour.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_drivingstress.m (from /issm/trunk-jpl/src/m/model/plot/plot\_drivingstress.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_edges.m (from /issm/trunk-jpl/src/m/model/plot/plot\_edges.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_elementnumbering.m (from /issm/trunk-jpl/src/m/model/plot/plot\_elementnumbering.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_elementstype.m (from /issm/trunk-jpl/src/m/model/plot/plot\_elementstype.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_gridded.m (from /issm/trunk-jpl/src/m/model/plot/plot\_gridded.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_highlightelements.m (from /issm/trunk-jpl/src/m/model/plot/plot\_highlightelements.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_highlightvertices.m (from /issm/trunk-jpl/src/m/model/plot/plot\_highlightvertices.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_icefront.m (from /issm/trunk-jpl/src/m/model/plot/plot\_icefront.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_importancefactors.m (from /issm/trunk-jpl/src/m/model/plot/plot\_importancefactors.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_manager.m (from /issm/trunk-jpl/src/m/model/plot/plot\_manager.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_mesh.m (from /issm/trunk-jpl/src/m/model/plot/plot\_mesh.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_none.m (from /issm/trunk-jpl/src/m/model/plot/plot\_none.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_overlay.m (from /issm/trunk-jpl/src/m/model/plot/plot\_overlay.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_parthist.m (from /issm/trunk-jpl/src/m/model/plot/plot\_parthist.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_parthistn.m (from /issm/trunk-jpl/src/m/model/plot/plot\_parthistn.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_parthistw.m (from /issm/trunk-jpl/src/m/model/plot/plot\_parthistw.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_penalties.m (from /issm/trunk-jpl/src/m/model/plot/plot\_penalties.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_profile.m (from /issm/trunk-jpl/src/m/model/plot/plot\_profile.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_qmu\_mass\_flux\_segments.m (from /issm/trunk-jpl/src/m/model/plot/plot\_qmu\_mass\_flux\_segments.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_qmuhistnorm.m (from /issm/trunk-jpl/src/m/model/plot/plot\_qmuhistnorm.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_qmumean.m (from /issm/trunk-jpl/src/m/model/plot/plot\_qmumean.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_qmunormplot.m (from /issm/trunk-jpl/src/m/model/plot/plot\_qmunormplot.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_qmustddev.m (from /issm/trunk-jpl/src/m/model/plot/plot\_qmustddev.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_quiver.m (from /issm/trunk-jpl/src/m/model/plot/plot\_quiver.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_quiver3.m (from /issm/trunk-jpl/src/m/model/plot/plot\_quiver3.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_referential.m (from /issm/trunk-jpl/src/m/model/plot/plot\_referential.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_riftfraction.m (from /issm/trunk-jpl/src/m/model/plot/plot\_riftfraction.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_riftnumbering.m (from /issm/trunk-jpl/src/m/model/plot/plot\_riftnumbering.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_riftpenetration.m (from /issm/trunk-jpl/src/m/model/plot/plot\_riftpenetration.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_riftrelvel.m (from /issm/trunk-jpl/src/m/model/plot/plot\_riftrelvel.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_rifts.m (from /issm/trunk-jpl/src/m/model/plot/plot\_rifts.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_riftvel.m (from /issm/trunk-jpl/src/m/model/plot/plot\_riftvel.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_sarpwr.m (from /issm/trunk-jpl/src/m/model/plot/plot\_sarpwr.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_scatter.m (from /issm/trunk-jpl/src/m/model/plot/plot\_scatter.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_section.m (from /issm/trunk-jpl/src/m/model/plot/plot\_section.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_segments.m (from /issm/trunk-jpl/src/m/model/plot/plot\_segments.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_streamlines.m (from /issm/trunk-jpl/src/m/model/plot/plot\_streamlines.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_tensor.m (from /issm/trunk-jpl/src/m/model/plot/plot\_tensor.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_tensor\_components.m (from /issm/trunk-jpl/src/m/model/plot/plot\_tensor\_components.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_tensor\_principal.m (from /issm/trunk-jpl/src/m/model/plot/plot\_tensor\_principal.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_tensor\_principalaxis.m (from /issm/trunk-jpl/src/m/model/plot/plot\_tensor\_principalaxis.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_thermaltransient\_results.m (from /issm/trunk-jpl/src/m/model/plot/plot\_thermaltransient\_results.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_transient\_field.m (from /issm/trunk-jpl/src/m/model/plot/plot\_transient\_field.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_transient\_movie.m (from /issm/trunk-jpl/src/m/model/plot/plot\_transient\_movie.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_transient\_results.m (from /issm/trunk-jpl/src/m/model/plot/plot\_transient\_results.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_unit.m (from /issm/trunk-jpl/src/m/model/plot/plot\_unit.m:13008) A /issm/trunk-jpl/src/m/plot/plot\_vertexnumbering.m (from /issm/trunk-jpl/src/m/model/plot/plot\_vertexnumbering.m:13008) A /issm/trunk-jpl/src/m/plot/plotdoc.m (from /issm/trunk-jpl/src/m/model/plot/plotdoc.m:13008) A /issm/trunk-jpl/src/m/plot/plotmodel.m (from /issm/trunk-jpl/src/m/model/plot/plotmodel.m:13008) A /issm/trunk-jpl/src/m/plot/processdata.m (from /issm/trunk-jpl/src/m/model/plot/processdata.m:13008) A /issm/trunk-jpl/src/m/plot/processmesh.m (from /issm/trunk-jpl/src/m/model/plot/processmesh.m:13008) A /issm/trunk-jpl/src/m/plot/quiver\_colorbar.m (from /issm/trunk-jpl/src/m/model/plot/quiver\_colorbar.m:13008) A /issm/trunk-jpl/src/m/plot/quiver\_process.m (from /issm/trunk-jpl/src/m/model/plot/quiver\_process.m:13008) A /issm/trunk-jpl/src/m/plot/radarpower.m (from /issm/trunk-jpl/src/m/model/plot/radarpower.m:13008) A /issm/trunk-jpl/src/m/plot/scaleruler.m (from /issm/trunk-jpl/src/m/model/plot/scaleruler.m:13008) A /issm/trunk-jpl/src/m/plot/showregion.m (from /issm/trunk-jpl/src/m/model/plot/showregion.m:13008) A /issm/trunk-jpl/src/m/plot/subplotmodel.m (from /issm/trunk-jpl/src/m/model/plot/subplotmodel.m:13008) A /issm/trunk-jpl/src/m/print (from /issm/trunk-jpl/src/m/model/print:13008) A /issm/trunk-jpl/src/m/regional (from /issm/trunk-jpl/src/m/model/regional:13008) A /issm/trunk-jpl/src/m/solve (from /issm/trunk-jpl/src/m/model/solve:13008) A /issm/trunk-jpl/src/m/solvers (from /issm/trunk-jpl/src/m/model/solvers:13008)\\
+Export determination: 6. \\
+Rationale: CHG: moved mode/* to src/m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#313} with diff file ISSM-13010-13011.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/basins D /issm/trunk-jpl/src/m/cluster A /issm/trunk-jpl/src/m/consistency/QueueRequirements.m (from /issm/trunk-jpl/src/m/cluster/QueueRequirements.m:12997) A /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m (from /issm/trunk-jpl/src/m/solve/ismodelselfconsistent.m:13009) A /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py (from /issm/trunk-jpl/src/m/solve/ismodelselfconsistent.py:13009) A /issm/trunk-jpl/src/m/contrib/ecco/ecco32issm.m (from /issm/trunk-jpl/src/m/ecco3/ecco32issm.m:12997) A /issm/trunk-jpl/src/m/contrib/ecco/issm2ecco3.m (from /issm/trunk-jpl/src/m/ecco3/issm2ecco3.m:12997) A /issm/trunk-jpl/src/m/contrib/gslib A /issm/trunk-jpl/src/m/contrib/gslib/gamv.m (from /issm/trunk-jpl/src/m/dataprocessing/gamv.m:12997) A /issm/trunk-jpl/src/m/contrib/gslib/gslib.m (from /issm/trunk-jpl/src/m/dataprocessing/gslib.m:12997) A /issm/trunk-jpl/src/m/contrib/gslib/pkriging.m (from /issm/trunk-jpl/src/m/dataprocessing/pkriging.m:12997) A /issm/trunk-jpl/src/m/contrib/gslib/varmap.m (from /issm/trunk-jpl/src/m/dataprocessing/varmap.m:12997) A /issm/trunk-jpl/src/m/contrib/uci A /issm/trunk-jpl/src/m/contrib/uci/expremovestraightsegments.m (from /issm/trunk-jpl/src/m/exp/expremovestraightsegments.m:12997) A /issm/trunk-jpl/src/m/contrib/uci/expsplit.m (from /issm/trunk-jpl/src/m/exp/expsplit.m:12997) A /issm/trunk-jpl/src/m/contrib/uci/pargenerate.m (from /issm/trunk-jpl/src/m/latlong/pargenerate.m:12997) D /issm/trunk-jpl/src/m/dataprocessing D /issm/trunk-jpl/src/m/display D /issm/trunk-jpl/src/m/ecco3 M /issm/trunk-jpl/src/m/exp/expbox.m D /issm/trunk-jpl/src/m/exp/expboxgen.m A /issm/trunk-jpl/src/m/exp/expcircle.m (from /issm/trunk-jpl/src/m/exp/expcreatecircle.m:12997) D /issm/trunk-jpl/src/m/exp/expcreatecircle.m M /issm/trunk-jpl/src/m/exp/expcreatecontour.m M /issm/trunk-jpl/src/m/exp/expcreateprofile.m D /issm/trunk-jpl/src/m/exp/expdoc.m M /issm/trunk-jpl/src/m/exp/expexcludeoutliers.m D /issm/trunk-jpl/src/m/exp/expgen.m M /issm/trunk-jpl/src/m/exp/explink.m D /issm/trunk-jpl/src/m/exp/expmaster.m D /issm/trunk-jpl/src/m/exp/exporientation.m A /issm/trunk-jpl/src/m/exp/expread.m (from /issm/trunk-jpl/src/m/exp/readwrite/expread.m:12997) D /issm/trunk-jpl/src/m/exp/expremovestraightsegments.m D /issm/trunk-jpl/src/m/exp/expsplit.m M /issm/trunk-jpl/src/m/exp/expsquare.m A /issm/trunk-jpl/src/m/exp/expwrite.m (from /issm/trunk-jpl/src/m/exp/readwrite/expwrite.m:12997) D /issm/trunk-jpl/src/m/exp/ginputquick.m D /issm/trunk-jpl/src/m/exp/readwrite M /issm/trunk-jpl/src/m/geometry/SegIntersect.m D /issm/trunk-jpl/src/m/interp/FieldFindVarNames.m D /issm/trunk-jpl/src/m/interp/FillHole.m M /issm/trunk-jpl/src/m/interp/InterpFromFile.m D /issm/trunk-jpl/src/m/interp/VelFindVarNames.m M /issm/trunk-jpl/src/m/interp/plugvelocities.m A /issm/trunk-jpl/src/m/inversions/MisfitDeinterlace.m (from /issm/trunk-jpl/src/m/dataprocessing/MisfitDeinterlace.m:12997) D /issm/trunk-jpl/src/m/latlong/pargenerate.m M /issm/trunk-jpl/src/m/mesh/roundmesh.m A /issm/trunk-jpl/src/m/miscellaneous/fielddisplay.m (from /issm/trunk-jpl/src/m/display/fielddisplay.m:13009) A /issm/trunk-jpl/src/m/miscellaneous/parallelrange.m (from /issm/trunk-jpl/src/m/cluster/parallelrange.m:12997) A /issm/trunk-jpl/src/m/miscellaneous/parallelrange.py (from /issm/trunk-jpl/src/m/cluster/parallelrange.py:12997) A /issm/trunk-jpl/src/m/regional/basinzoom.m (from /issm/trunk-jpl/src/m/basins/basinzoom.m:12997) A /issm/trunk-jpl/src/m/regional/isbasin.m (from /issm/trunk-jpl/src/m/basins/isbasin.m:12997) A /issm/trunk-jpl/src/m/regional/plotbasins.m (from /issm/trunk-jpl/src/m/basins/plotbasins.m:12997) A /issm/trunk-jpl/src/m/regional/showbasins.m (from /issm/trunk-jpl/src/m/basins/showbasins.m:12997) D /issm/trunk-jpl/src/m/solve/ismodelselfconsistent.m D /issm/trunk-jpl/src/m/solve/ismodelselfconsistent.py\\
+Export determination: 6. \\
+Rationale: CHG: moving stuff around\\
+\vspace{3em}
+
+\noindent \textbf{Change \#314} with diff file ISSM-13011-13012.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/contrib/oasis A /issm/trunk-jpl/src/m/contrib/oasis/carter.m (from /issm/trunk-jpl/src/m/meca/carter.m:12997) A /issm/trunk-jpl/src/m/materials A /issm/trunk-jpl/src/m/materials/paterson.m (from /issm/trunk-jpl/src/m/meca/paterson.m:12997) A /issm/trunk-jpl/src/m/materials/paterson.py (from /issm/trunk-jpl/src/m/meca/paterson.py:12997) D /issm/trunk-jpl/src/m/math D /issm/trunk-jpl/src/m/meca/carter.m A /issm/trunk-jpl/src/m/meca/cfl\_step.m (from /issm/trunk-jpl/src/m/math/cfl\_step.m:12998) D /issm/trunk-jpl/src/m/meca/lithostaticpressure.m D /issm/trunk-jpl/src/m/meca/paterson.m D /issm/trunk-jpl/src/m/meca/paterson.py A /issm/trunk-jpl/src/m/miscellaneous/isnans.m (from /issm/trunk-jpl/src/m/math/isnans.m:12997) A /issm/trunk-jpl/src/m/miscellaneous/isnans.py (from /issm/trunk-jpl/src/m/math/isnans.py:12997) A /issm/trunk-jpl/src/m/miscellaneous/round\_ice.m (from /issm/trunk-jpl/src/m/math/round\_ice.m:12997)\\
+Export determination: 6. \\
+Rationale: CHG: moved stuff around\\
+\vspace{3em}
+
+\noindent \textbf{Change \#315} with diff file ISSM-13012-13013.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/modellist.m A /issm/trunk-jpl/src/m/contrib/bamg A /issm/trunk-jpl/src/m/contrib/bamg/BamgCall.m (from /issm/trunk-jpl/src/m/mesh/BamgCall.m:13010) A /issm/trunk-jpl/src/m/contrib/bamg/BamgCallFromMetric.m (from /issm/trunk-jpl/src/m/mesh/BamgCallFromMetric.m:13010) A /issm/trunk-jpl/src/m/contrib/bamg/YamsCall.m (from /issm/trunk-jpl/src/m/mesh/YamsCall.m:13010) A /issm/trunk-jpl/src/m/contrib/bamg/meshread.m (from /issm/trunk-jpl/src/m/mesh/meshread.m:13010) A /issm/trunk-jpl/src/m/contrib/bamg/yams.m (from /issm/trunk-jpl/src/m/mesh/yams.m:13010) A /issm/trunk-jpl/src/m/geometry/GetAreas.m (from /issm/trunk-jpl/src/m/mesh/GetAreas.m:13010) D /issm/trunk-jpl/src/m/mesh/BamgCall.m D /issm/trunk-jpl/src/m/mesh/BamgCallFromMetric.m M /issm/trunk-jpl/src/m/mesh/FixMesh.m D /issm/trunk-jpl/src/m/mesh/GetAreas.m D /issm/trunk-jpl/src/m/mesh/GetCharacteristicLength.m M /issm/trunk-jpl/src/m/mesh/NodeInElement.m D /issm/trunk-jpl/src/m/mesh/YamsCall.m D /issm/trunk-jpl/src/m/mesh/isconnected.m D /issm/trunk-jpl/src/m/mesh/meshread.m M /issm/trunk-jpl/src/m/mesh/rifts/meshprocessoutsiderifts.m A /issm/trunk-jpl/src/m/mesh/rifts/rifttipsonmesh.m (from /issm/trunk-jpl/src/m/mesh/rifttipsonmesh.m:13010) D /issm/trunk-jpl/src/m/mesh/rifttipsonmesh.m D /issm/trunk-jpl/src/m/mesh/yams.m D /issm/trunk-jpl/src/m/miscellaneous/create\_region.m D /issm/trunk-jpl/src/m/miscellaneous/findarg.m D /issm/trunk-jpl/src/m/miscellaneous/netcdf.m M /issm/trunk-jpl/src/m/miscellaneous/netcdf2struct.m D /issm/trunk-jpl/src/m/multiplequeue\\
+Export determination: 6. \\
+Rationale: CHG: moving stuff around\\
+\vspace{3em}
+
+\noindent \textbf{Change \#316} with diff file ISSM-13013-13014.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/Makefile.am D /issm/trunk-jpl/src/m/os/ucisvn.m D /issm/trunk-jpl/src/m/plot/imagescnan.m D /issm/trunk-jpl/src/m/plot/plot2patch.m D /issm/trunk-jpl/src/m/string/ddeblank.m D /issm/trunk-jpl/src/m/string/logoutput.m\\
+Export determination: 6. \\
+Rationale: CHG: moving stuff around and updating Makefile.am\\
+\vspace{3em}
+
+\noindent \textbf{Change \#317} with diff file ISSM-13014-13015.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: BUG: do include automake\\
+\vspace{3em}
+
+\noindent \textbf{Change \#318} with diff file ISSM-13015-13016.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/py/model/display/fielddisplay.py\\
+Export determination: 6. \\
+Rationale: CHG: Integrated last of src/py into src/m.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#319} with diff file ISSM-13016-13017.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/py/model D /issm/trunk-jpl/src/py/utils\\
+Export determination: 6. \\
+Rationale: CHG: Integrated last of src/py into src/m.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#320} with diff file ISSM-13017-13018.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: nothing to do in contrib (just sub-directories)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#321} with diff file ISSM-13018-13019.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m M /issm/trunk-jpl/src/m/parameterization/parameterize.m\\
+Export determination: 6. \\
+Rationale: BUG: not more addnotes function\\
+\vspace{3em}
+
+\noindent \textbf{Change \#322} with diff file ISSM-13019-13020.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/miscellaneous/fielddisplay.py\\
+Export determination: 6. \\
+Rationale: CHG: Integrated last of src/py into src/m (made more difficult by all the other stuff being moved...).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#323} with diff file ISSM-13020-13021.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/balancethickness.m M /issm/trunk-jpl/src/m/classes/balancethickness.py 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/diagnostic.m M /issm/trunk-jpl/src/m/classes/diagnostic.py M /issm/trunk-jpl/src/m/classes/flaim.m 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/friction.m M /issm/trunk-jpl/src/m/classes/friction.py M /issm/trunk-jpl/src/m/classes/geometry.m M /issm/trunk-jpl/src/m/classes/geometry.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/hydrology.m M /issm/trunk-jpl/src/m/classes/hydrology.py M /issm/trunk-jpl/src/m/classes/initialization.m M /issm/trunk-jpl/src/m/classes/initialization.py M /issm/trunk-jpl/src/m/classes/inversion.m M /issm/trunk-jpl/src/m/classes/materials.m M /issm/trunk-jpl/src/m/classes/materials.py M /issm/trunk-jpl/src/m/classes/mesh.m M /issm/trunk-jpl/src/m/classes/mesh.py M /issm/trunk-jpl/src/m/classes/model/model.m M /issm/trunk-jpl/src/m/classes/prognostic.m M /issm/trunk-jpl/src/m/classes/prognostic.py M /issm/trunk-jpl/src/m/classes/rifts.m M /issm/trunk-jpl/src/m/classes/rifts.py M /issm/trunk-jpl/src/m/classes/solver.m M /issm/trunk-jpl/src/m/classes/solver.py M /issm/trunk-jpl/src/m/classes/steadystate.m M /issm/trunk-jpl/src/m/classes/surfaceforcings.m M /issm/trunk-jpl/src/m/classes/surfaceforcings.py M /issm/trunk-jpl/src/m/classes/thermal.m M /issm/trunk-jpl/src/m/classes/transient.m M /issm/trunk-jpl/src/m/classes/verbose.m M /issm/trunk-jpl/src/m/classes/verbose.py\\
+Export determination: 6. \\
+Rationale: NEW: Still another bunch more python checkconsistency and marshall methods for sub-classes (plus other minor changes).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#324} with diff file ISSM-13021-13022.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/hack/tres.m M /issm/trunk-jpl/src/m/exp/expwrite.m M /issm/trunk-jpl/src/m/mesh/roundmesh.m M /issm/trunk-jpl/test/NightlyRun/test218.m M /issm/trunk-jpl/test/NightlyRun/test234.m M /issm/trunk-jpl/test/NightlyRun/test235.m M /issm/trunk-jpl/test/NightlyRun/test412.m M /issm/trunk-jpl/test/NightlyRun/test413.m M /issm/trunk-jpl/test/NightlyRun/test414.m M /issm/trunk-jpl/test/NightlyRun/test417.m M /issm/trunk-jpl/test/NightlyRun/test420.m M /issm/trunk-jpl/test/NightlyRun/test511.m M /issm/trunk-jpl/test/NightlyRun/test613.m\\
+Export determination: 6. \\
+Rationale: BUG: fixed NR problems caused by src/m reorganization\\
+\vspace{3em}
+
+\noindent \textbf{Change \#325} with diff file ISSM-13022-13023.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive423.mat\\
+Export determination: 6. \\
+Rationale: CHG: updated archive test423 (wrong number of elements as we now use expwrite)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#326} with diff file ISSM-13023-13024.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/autodiff.py M /issm/trunk-jpl/src/m/classes/clusters/generic.py M /issm/trunk-jpl/src/m/classes/diagnostic.py M /issm/trunk-jpl/src/m/classes/flaim.py M /issm/trunk-jpl/src/m/classes/friction.py M /issm/trunk-jpl/src/m/classes/hydrology.py M /issm/trunk-jpl/src/m/classes/inversion.m M /issm/trunk-jpl/src/m/classes/inversion.py M /issm/trunk-jpl/src/m/classes/pairoptions.py M /issm/trunk-jpl/src/m/classes/prognostic.py M /issm/trunk-jpl/src/m/classes/steadystate.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/classes/transient.py M /issm/trunk-jpl/src/m/consistency/checkfield.py M /issm/trunk-jpl/src/m/os/issmdir.py M /issm/trunk-jpl/src/m/solve/MatlabProcessPatch.py M /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py M /issm/trunk-jpl/src/m/solve/process\_solve\_options.py\\
+Export determination: 6. \\
+Rationale: NEW: Yet another bunch more python checkconsistency and marshall methods for sub-classes (plus other minor changes).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#327} with diff file ISSM-13024-13025.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/src/Makefile.am D /issm/trunk-jpl/src/py/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: removed all Makefiles in src/py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#328} with diff file ISSM-13025-13026.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/inversion.m\\
+Export determination: 6. \\
+Rationale: NEW: added support for across and along flow thickness gradient misfits\\
+\vspace{3em}
+
+\noindent \textbf{Change \#329} with diff file ISSM-13026-13027.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/exp/exptool.m A /issm/trunk-jpl/src/m/exp/manipulation/orientprofile.m\\
+Export determination: 6. \\
+Rationale: NEW: added profile reorientation capability to exptool\\
+\vspace{3em}
+
+\noindent \textbf{Change \#330} with diff file ISSM-13027-13028.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/geometry/recover\_areas.m D /issm/trunk-jpl/src/m/geometry/recover\_areas.py M /issm/trunk-jpl/src/m/parameterization/setflowequation.m M /issm/trunk-jpl/src/m/parameterization/setflowequation.py\\
+Export determination: 6. \\
+Rationale: CHG: recover\_areas is now a subfunction of setflowequations\\
+\vspace{3em}
+
+\noindent \textbf{Change \#331} with diff file ISSM-13028-13029.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: removed recover\_area, totally useless actually\\
+\vspace{3em}
+
+\noindent \textbf{Change \#332} with diff file ISSM-13029-13030.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/inversion.py\\
+Export determination: 6. \\
+Rationale: CHG: updated python inversion.py class to reflect changes in inversion.m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#333} with diff file ISSM-13030-13031.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py M /issm/trunk-jpl/src/m/classes/diagnostic.py M /issm/trunk-jpl/src/m/classes/inversion.py M /issm/trunk-jpl/src/m/classes/miscellaneous.m M /issm/trunk-jpl/src/m/classes/miscellaneous.py M /issm/trunk-jpl/src/m/classes/model/model.py M /issm/trunk-jpl/src/m/classes/private.py M /issm/trunk-jpl/src/m/classes/qmu.m M /issm/trunk-jpl/src/m/classes/qmu.py M /issm/trunk-jpl/src/m/classes/radaroverlay.py M /issm/trunk-jpl/src/m/consistency/checkfield.py M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py M /issm/trunk-jpl/src/m/parameterization/parameterize.py M /issm/trunk-jpl/src/m/parameterization/setflowequation.py\\
+Export determination: 6. \\
+Rationale: NEW: Last bunch more python checkconsistency and marshall methods for sub-classes (plus other minor changes and fixes to keep up with Matlab changes).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#334} with diff file ISSM-13031-13032.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/parameterization/setflowequation.py\\
+Export determination: 6. \\
+Rationale: CHG: Fix syntax errors from [13028].\\
+\vspace{3em}
+
+\noindent \textbf{Change \#335} with diff file ISSM-13032-13033.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py M /issm/trunk-jpl/src/m/classes/diagnostic.py M /issm/trunk-jpl/src/m/classes/flaim.py M /issm/trunk-jpl/src/m/classes/flowequation.py M /issm/trunk-jpl/src/m/classes/groundingline.py M /issm/trunk-jpl/src/m/classes/initialization.py M /issm/trunk-jpl/src/m/classes/mesh.py M /issm/trunk-jpl/src/m/parameterization/setflowequation.py\\
+Export determination: 6. \\
+Rationale: CHG: Python any/all vs. numpy.any/numpy.all modifications (and more).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#336} with diff file ISSM-13033-13034.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/WritePythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h M /issm/trunk-jpl/src/modules/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: NEW: Python versions of EnumToString and StringToEnum (along with necessary io).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#337} with diff file ISSM-13034-13035.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/EnumToString/EnumToString.cpp M /issm/trunk-jpl/src/modules/EnumToString/EnumToString.h M /issm/trunk-jpl/src/modules/StringToEnum/StringToEnum.cpp M /issm/trunk-jpl/src/modules/StringToEnum/StringToEnum.h\\
+Export determination: 6. \\
+Rationale: NEW: Python versions of EnumToString and StringToEnum (along with necessary io).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#338} with diff file ISSM-13035-13036.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/include/macros.h M /issm/trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp M /issm/trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp\\
+Export determination: 6. \\
+Rationale: CHG: getting rid of \_error\_, only use \_error2\_\\
+\vspace{3em}
+
+\noindent \textbf{Change \#339} with diff file ISSM-13036-13037.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Container/DataSet.cpp M /issm/trunk-jpl/src/c/Container/Elements.cpp M /issm/trunk-jpl/src/c/Container/Inputs.cpp M /issm/trunk-jpl/src/c/Container/Observations.cpp M /issm/trunk-jpl/src/c/Container/Options.cpp M /issm/trunk-jpl/src/c/Container/Parameters.cpp M /issm/trunk-jpl/src/c/classes/DofIndexing.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/IoModel.cpp M /issm/trunk-jpl/src/c/classes/bamg/BamgOpts.cpp M /issm/trunk-jpl/src/c/classes/bamg/BamgQuadtree.h M /issm/trunk-jpl/src/c/classes/bamg/BamgVertex.cpp M /issm/trunk-jpl/src/c/classes/bamg/Edge.cpp M /issm/trunk-jpl/src/c/classes/bamg/Geometry.cpp M /issm/trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.cpp M /issm/trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.h M /issm/trunk-jpl/src/c/classes/bamg/Mesh.cpp M /issm/trunk-jpl/src/c/classes/bamg/Metric.cpp M /issm/trunk-jpl/src/c/classes/bamg/SetOfE4.cpp M /issm/trunk-jpl/src/c/classes/bamg/SubDomain.cpp M /issm/trunk-jpl/src/c/classes/bamg/Triangle.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.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/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.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/classes/matrix/ElementMatrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp M /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/Vector.cpp M /issm/trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/PentaRef.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h M /issm/trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Attribute.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_ColorStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_ColorStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Comment.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Container.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Container.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Document.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Document.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Feature.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Feature.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_File.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_File.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Folder.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Folder.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Geometry.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Geometry.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_GroundOverlay.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_GroundOverlay.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Icon.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Icon.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LatLonBox.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LatLonBox.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineString.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineString.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LinearRing.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LinearRing.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_MultiGeometry.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_MultiGeometry.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Object.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Object.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Overlay.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Overlay.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Placemark.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Placemark.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Point.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Point.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_PolyStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_PolyStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Polygon.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Polygon.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Style.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Style.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_StyleSelector.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_StyleSelector.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_SubStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_SubStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Unknown.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Unknown.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.h M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h M /issm/trunk-jpl/src/c/classes/objects/Node.cpp M /issm/trunk-jpl/src/c/classes/objects/Node.h M /issm/trunk-jpl/src/c/classes/objects/Options/Option.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionCell.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/OptionChar.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/OptionDouble.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/OptionLogical.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/OptionStruct.h M /issm/trunk-jpl/src/c/classes/objects/Options/OptionUtilities.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/BoolParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/FileParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/IntMatParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/IntParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/IntVecParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/MatrixParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/StringParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/TransientParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/VectorParam.h M /issm/trunk-jpl/src/c/include/macros.h M /issm/trunk-jpl/src/c/io/Disk/pfclose.cpp M /issm/trunk-jpl/src/c/io/Disk/pfopen.cpp M /issm/trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp M /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp M /issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp M /issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp M /issm/trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp M /issm/trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp M /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp M /issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp M /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp M /issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp M /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp M /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp M /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp M /issm/trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp M /issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.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/modules/Ll2xyx/Ll2xyx.cpp M /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp M /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp M /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp M /issm/trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp M /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp M /issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp M /issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp M /issm/trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp M /issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp M /issm/trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp M /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp M /issm/trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp M /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp M /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp M /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp M /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp M /issm/trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp M /issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp M /issm/trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp M /issm/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp M /issm/trunk-jpl/src/c/shared/Numerics/Verbosity.cpp M /issm/trunk-jpl/src/c/shared/String/DescriptorIndex.cpp M /issm/trunk-jpl/src/c/shared/Sys/ProfilingEnd.cpp M /issm/trunk-jpl/src/c/shared/Sys/ProfilingStart.cpp M /issm/trunk-jpl/src/c/shared/Threads/LaunchThread.cpp M /issm/trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp M /issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/solutions/ProcessArguments.cpp M /issm/trunk-jpl/src/c/solutions/WriteLockFile.cpp M /issm/trunk-jpl/src/c/solutions/controltao\_core.cpp M /issm/trunk-jpl/src/c/solutions/convergence.cpp M /issm/trunk-jpl/src/c/solutions/gradient\_core.cpp M /issm/trunk-jpl/src/c/solutions/issm.cpp M /issm/trunk-jpl/src/c/solutions/kriging.cpp M /issm/trunk-jpl/src/c/solutions/objectivefunction.cpp M /issm/trunk-jpl/src/c/solutions/steadystate\_core.cpp M /issm/trunk-jpl/src/c/solutions/transient\_core.cpp M /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp M /issm/trunk-jpl/src/c/toolkits/issm/SeqVec.cpp M /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS\_PartMeshNodalPatch.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp M /issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp M /issm/trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp M /issm/trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.cpp M /issm/trunk-jpl/src/modules/Chaco/Chaco.cpp M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp M /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp M /issm/trunk-jpl/src/modules/InternalFront/InternalFront.cpp M /issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp M /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp M /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp M /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp M /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp M /issm/trunk-jpl/src/modules/Kriging/Kriging.cpp M /issm/trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp M /issm/trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp M /issm/trunk-jpl/src/modules/Scotch/Scotch.cpp M /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp M /issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp M /issm/trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp\\
+Export determination: 6. \\
+Rationale: CHG: renaming \_error2\_ \_error\_\\
+\vspace{3em}
+
+\noindent \textbf{Change \#340} with diff file ISSM-13037-13038.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutions/controltao\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: getting rid of xcalloc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#341} with diff file ISSM-13038-13039.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/Chaco/Chaco.cpp M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp M /issm/trunk-jpl/src/modules/InternalFront/InternalFront.cpp M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp M /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp M /issm/trunk-jpl/src/modules/MeshPartition/MeshPartition.cpp M /issm/trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp M /issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp\\
+Export determination: 6. \\
+Rationale: CHG: getting rid of xmalloc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#342} with diff file ISSM-13039-13040.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/Synchronize.sh\\
+Export determination: 6. \\
+Rationale: CHG: Added import for python.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#343} with diff file ISSM-13040-13041.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/diagnostic.m M /issm/trunk-jpl/src/m/classes/diagnostic.py 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/inversion.m M /issm/trunk-jpl/src/m/classes/inversion.py M /issm/trunk-jpl/src/m/classes/rifts.py M /issm/trunk-jpl/src/m/classes/settings.m M /issm/trunk-jpl/src/m/classes/settings.py M /issm/trunk-jpl/src/m/classes/surfaceforcings.m M /issm/trunk-jpl/src/m/classes/surfaceforcings.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/classes/timestepping.m M /issm/trunk-jpl/src/m/classes/timestepping.py M /issm/trunk-jpl/src/m/classes/transient.m M /issm/trunk-jpl/src/m/classes/transient.py\\
+Export determination: 6. \\
+Rationale: CHG: Changed numerous integer 1 to list [1] for python (and similarly for matlab).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#344} with diff file ISSM-13041-13042.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/Synchronize.sh\\
+Export determination: 6. \\
+Rationale: NEW: Python StringToEnum returns tuple, not integer, so calls must be modified.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#345} with diff file ISSM-13042-13043.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#346} with diff file ISSM-13043-13044.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py M /issm/trunk-jpl/src/m/classes/diagnostic.py M /issm/trunk-jpl/src/m/classes/geometry.py M /issm/trunk-jpl/src/m/classes/groundingline.py M /issm/trunk-jpl/src/m/classes/inversion.py M /issm/trunk-jpl/src/m/classes/materials.py M /issm/trunk-jpl/src/m/classes/model/model.m M /issm/trunk-jpl/src/m/classes/model/model.py M /issm/trunk-jpl/src/m/classes/model/planet.m M /issm/trunk-jpl/src/m/classes/planetmesh.m M /issm/trunk-jpl/src/m/classes/prognostic.py M /issm/trunk-jpl/src/m/classes/rifts.py M /issm/trunk-jpl/src/m/classes/solver.m M /issm/trunk-jpl/src/m/classes/solver.py M /issm/trunk-jpl/src/m/classes/verbose.py M /issm/trunk-jpl/src/m/consistency/checkfield.py M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/miscellaneous/issmdoc.m M /issm/trunk-jpl/src/m/os/flaimdir.m M /issm/trunk-jpl/src/m/os/issmscpout.py M /issm/trunk-jpl/src/m/solve/MatlabProcessPatch.m M /issm/trunk-jpl/src/m/solve/WriteData.py M /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py M /issm/trunk-jpl/src/m/solve/marshall.py M /issm/trunk-jpl/src/m/solve/process\_solve\_options.m M /issm/trunk-jpl/src/m/solve/process\_solve\_options.py M /issm/trunk-jpl/src/m/solve/solve.m M /issm/trunk-jpl/src/m/solve/solve.py\\
+Export determination: 6. \\
+Rationale: NEW: Bunches of changes to get Python checkconsistency and marshall running (plus corresponding Matlab changes).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#347} with diff file ISSM-13044-13045.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.csh M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: Tao is now shared (same as PETSc) and requires to be in LD\_LIBRARY\_PATH\\
+\vspace{3em}
+
+\noindent \textbf{Change \#348} with diff file ISSM-13045-13046.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp\\
+Export determination: 6. \\
+Rationale: BUG: Echo was not displaying ncols but nrows\\
+\vspace{3em}
+
+\noindent \textbf{Change \#349} with diff file ISSM-13046-13047.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/modules/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Major modification to '/home/glperez/issm/issm-uci/trunk-jpl/src/modules/matlab/Makefile.am' and '/home/glperez/issm/issm-uci/trunk-jpl/src/c/Makefile.am' to allow for Libtool generated MEX modules. Added an m4 macro to '/home/glperez/issm/issm-uci/trunk-jpl/m4/issm\_options.m4' to allow for the toggling of shared library versioning.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#350} with diff file ISSM-13047-13048.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py A /issm/trunk-jpl/src/m/enum/FlowequationIsl1l2Enum.m A /issm/trunk-jpl/src/m/enum/L1L2ApproximationEnum.m A /issm/trunk-jpl/src/m/enum/L1L2IceFrontEnum.m M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m\\
+Export determination: 6. \\
+Rationale: NEW: added new Enums to support l1l2 equations (still under development)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#351} with diff file ISSM-13048-13049.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/parameterization/setflowequation.m\\
+Export determination: 6. \\
+Rationale: NEW: added support l1l2 equations (still under development)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#352} with diff file ISSM-13049-13050.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: added support l1l2 equations (still under development)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#353} with diff file ISSM-13050-13051.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/c/shared/Numerics/cubic.cpp M /issm/trunk-jpl/src/c/shared/Numerics/numerics.h\\
+Export determination: 6. \\
+Rationale: NEW: Added routine to find roots of cubic equations\\
+\vspace{3em}
+
+\noindent \textbf{Change \#354} with diff file ISSM-13051-13052.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.h M /issm/trunk-jpl/src/c/classes/objects/Node.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp M /issm/trunk-jpl/src/c/solutions/convergence.cpp M /issm/trunk-jpl/src/c/solutions/diagnostic\_core.cpp\\
+Export determination: 6. \\
+Rationale: NEW: added support l1l2 equations (still under development)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#355} with diff file ISSM-13052-13053.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/parameterization/setflowequation.py\\
+Export determination: 6. \\
+Rationale: BUG: Echo was not displaying ncols but nrows\\
+\vspace{3em}
+
+\noindent \textbf{Change \#356} with diff file ISSM-13053-13054.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: no more \_error2\_\\
+\vspace{3em}
+
+\noindent \textbf{Change \#357} with diff file ISSM-13054-13055.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/Synchronize.sh\\
+Export determination: 6. \\
+Rationale: CHG: no more \_error2\_\\
+\vspace{3em}
+
+\noindent \textbf{Change \#358} with diff file ISSM-13055-13056.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Container/DataSet.cpp M /issm/trunk-jpl/src/c/Container/Elements.cpp M /issm/trunk-jpl/src/c/Container/Inputs.cpp M /issm/trunk-jpl/src/c/Container/Observations.cpp M /issm/trunk-jpl/src/c/Container/Options.cpp M /issm/trunk-jpl/src/c/Container/Parameters.cpp M /issm/trunk-jpl/src/c/EnumDefinitions/Synchronize.sh M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/DofIndexing.cpp M /issm/trunk-jpl/src/c/classes/Hook.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h M /issm/trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Attribute.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_ColorStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_ColorStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Container.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Document.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Feature.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Feature.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_File.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Folder.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Geometry.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Geometry.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_GroundOverlay.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Icon.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Icon.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LatLonBox.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LatLonBox.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineString.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LinearRing.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LinearRing.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_MultiGeometry.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Object.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Overlay.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Placemark.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Placemark.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Point.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Point.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_PolyStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_PolyStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Polygon.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Style.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_StyleSelector.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_StyleSelector.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_SubStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Unknown.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h M /issm/trunk-jpl/src/c/include/macros.h M /issm/trunk-jpl/src/c/io/Disk/pfclose.cpp M /issm/trunk-jpl/src/c/io/Disk/pfopen.cpp M /issm/trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp M /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp M /issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp M /issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp M /issm/trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp M /issm/trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp M /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp M /issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp M /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp M /issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp M /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp M /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp M /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp M /issm/trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp M /issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.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/modules/Ll2xyx/Ll2xyx.cpp M /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp M /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp M /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp M /issm/trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp M /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp M /issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp M /issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp M /issm/trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp M /issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp M /issm/trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp M /issm/trunk-jpl/src/c/python/io/WritePythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h M /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp M /issm/trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp M /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp M /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp M /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp M /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp M /issm/trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp M /issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp M /issm/trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp M /issm/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp M /issm/trunk-jpl/src/c/shared/Numerics/Verbosity.cpp M /issm/trunk-jpl/src/c/shared/String/DescriptorIndex.cpp M /issm/trunk-jpl/src/c/shared/Threads/LaunchThread.cpp M /issm/trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp M /issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/solutions/ProcessArguments.cpp M /issm/trunk-jpl/src/c/solutions/WriteLockFile.cpp M /issm/trunk-jpl/src/c/solutions/controltao\_core.cpp M /issm/trunk-jpl/src/c/solutions/convergence.cpp M /issm/trunk-jpl/src/c/solutions/gradient\_core.cpp M /issm/trunk-jpl/src/c/solutions/issm.cpp M /issm/trunk-jpl/src/c/solutions/kriging.cpp M /issm/trunk-jpl/src/c/solutions/objectivefunction.cpp M /issm/trunk-jpl/src/c/solutions/steadystate\_core.cpp M /issm/trunk-jpl/src/c/solutions/transient\_core.cpp M /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp M /issm/trunk-jpl/src/c/toolkits/issm/SeqVec.cpp M /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS\_PartMeshNodalPatch.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp M /issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp M /issm/trunk-jpl/src/modules/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: Reverted back. Chaco module not compiling...\\
+\vspace{3em}
+
+\noindent \textbf{Change \#359} with diff file ISSM-13056-13057.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Container/DataSet.cpp M /issm/trunk-jpl/src/c/Container/Elements.cpp M /issm/trunk-jpl/src/c/Container/Inputs.cpp M /issm/trunk-jpl/src/c/Container/Observations.cpp M /issm/trunk-jpl/src/c/Container/Options.cpp M /issm/trunk-jpl/src/c/Container/Parameters.cpp M /issm/trunk-jpl/src/c/EnumDefinitions/Synchronize.sh M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/DofIndexing.cpp M /issm/trunk-jpl/src/c/classes/Hook.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h M /issm/trunk-jpl/src/c/classes/objects/KML/KMLFileReadUtils.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Attribute.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_ColorStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_ColorStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Container.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Document.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Feature.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Feature.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_File.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Folder.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Geometry.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Geometry.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_GroundOverlay.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Icon.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Icon.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LatLonBox.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LatLonBox.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineString.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LineStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LinearRing.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_LinearRing.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_MultiGeometry.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Object.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Overlay.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Placemark.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Placemark.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Point.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Point.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_PolyStyle.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_PolyStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Polygon.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Style.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_StyleSelector.cpp M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_StyleSelector.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_SubStyle.h M /issm/trunk-jpl/src/c/classes/objects/KML/KML\_Unknown.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h M /issm/trunk-jpl/src/c/include/macros.h M /issm/trunk-jpl/src/c/io/Disk/pfclose.cpp M /issm/trunk-jpl/src/c/io/Disk/pfopen.cpp M /issm/trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp M /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp M /issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp M /issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp M /issm/trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp M /issm/trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp M /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp M /issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp M /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp M /issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp M /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp M /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp M /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp M /issm/trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp M /issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.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/modules/Ll2xyx/Ll2xyx.cpp M /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp M /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp M /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp M /issm/trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp M /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp M /issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp M /issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp M /issm/trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp M /issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp M /issm/trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp M /issm/trunk-jpl/src/c/python/io/WritePythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h M /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp M /issm/trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp M /issm/trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp M /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp M /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp M /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp M /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp M /issm/trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp M /issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp M /issm/trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp M /issm/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp M /issm/trunk-jpl/src/c/shared/Numerics/Verbosity.cpp M /issm/trunk-jpl/src/c/shared/String/DescriptorIndex.cpp M /issm/trunk-jpl/src/c/shared/Threads/LaunchThread.cpp M /issm/trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp M /issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/solutions/ProcessArguments.cpp M /issm/trunk-jpl/src/c/solutions/WriteLockFile.cpp M /issm/trunk-jpl/src/c/solutions/controltao\_core.cpp M /issm/trunk-jpl/src/c/solutions/convergence.cpp M /issm/trunk-jpl/src/c/solutions/gradient\_core.cpp M /issm/trunk-jpl/src/c/solutions/issm.cpp M /issm/trunk-jpl/src/c/solutions/kriging.cpp M /issm/trunk-jpl/src/c/solutions/objectivefunction.cpp M /issm/trunk-jpl/src/c/solutions/steadystate\_core.cpp M /issm/trunk-jpl/src/c/solutions/transient\_core.cpp M /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp M /issm/trunk-jpl/src/c/toolkits/issm/SeqVec.cpp M /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS\_PartMeshNodalPatch.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp M /issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Correction from the 13046 revision\\
+\vspace{3em}
+
+\noindent \textbf{Change \#360} with diff file ISSM-13057-13058.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: Mismatched 'if' corrected.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#361} with diff file ISSM-13058-13059.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: moved isnodeonhutter to fix NR\\
+\vspace{3em}
+
+\noindent \textbf{Change \#362} with diff file ISSM-13059-13060.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/inversion.m M /issm/trunk-jpl/src/m/classes/inversion.py\\
+Export determination: 6. \\
+Rationale: CHG: deconnecting cost\_functions from Enums\\
+\vspace{3em}
+
+\noindent \textbf{Change \#363} with diff file ISSM-13060-13061.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/historyISSM.m\\
+Export determination: 6. \\
+Rationale: CHG: simplified historyISSM.m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#364} with diff file ISSM-13061-13062.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Numerics/cubic.cpp M /issm/trunk-jpl/src/c/shared/Numerics/numerics.h\\
+Export determination: 6. \\
+Rationale: CHG: ISSMized cubic.cpp\\
+\vspace{3em}
+
+\noindent \textbf{Change \#365} with diff file ISSM-13062-13063.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/ad/todo M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: CHG: used IssmPDouble instead of double for Solver prototype -> simplified code layout\\
+\vspace{3em}
+
+\noindent \textbf{Change \#366} with diff file ISSM-13063-13064.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Numerics/cubic.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed problem with cubic root\\
+\vspace{3em}
+
+\noindent \textbf{Change \#367} with diff file ISSM-13064-13065.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on L1L2, almost there\\
+\vspace{3em}
+
+\noindent \textbf{Change \#368} with diff file ISSM-13065-13066.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp\\
+Export determination: 6. \\
+Rationale: CHG: simpler way of computing root of cubic equation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#369} with diff file ISSM-13066-13067.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp\\
+Export determination: 6. \\
+Rationale: BUG: added loads for L1L2 approximation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#370} with diff file ISSM-13067-13068.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutions/issm.cpp\\
+Export determination: 6. \\
+Rationale: int to size\_t\\
+\vspace{3em}
+
+\noindent \textbf{Change \#371} with diff file ISSM-13068-13069.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: Removed references to avoid-version flag.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#372} with diff file ISSM-13069-13070.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/adolc M /issm/trunk-jpl/externalpackages/adolc/install-macosx64.sh\\
+Export determination: 6. \\
+Rationale: NEW: added svn repository to ADOL-C, if we want to work with the dvpt version of this code\\
+\vspace{3em}
+
+\noindent \textbf{Change \#373} with diff file ISSM-13070-13071.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test101.py M /issm/trunk-jpl/test/Par/SquareShelfConstrained.py\\
+Export determination: 6. \\
+Rationale: CHG: Test updates for python.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#374} with diff file ISSM-13071-13072.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/os/issmscpin.m M /issm/trunk-jpl/src/m/os/issmscpin.py M /issm/trunk-jpl/src/m/os/issmscpout.m M /issm/trunk-jpl/src/m/os/issmscpout.py M /issm/trunk-jpl/src/m/parameterization/parameterize.m M /issm/trunk-jpl/src/m/solve/WriteData.py M /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py M /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py M /issm/trunk-jpl/src/m/solve/solve.py M /issm/trunk-jpl/src/m/solve/waitonlock.m M /issm/trunk-jpl/src/m/solve/waitonlock.py\\
+Export determination: 6. \\
+Rationale: NEW: More changes for python marshalling and running (plus corresponding matlab changes).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#375} with diff file ISSM-13072-13073.diff: \\
+Function name: \\
+M /issm/trunk-jpl/Makefile.am D /issm/trunk-jpl/bin/Makefile.am M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/modules/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Trying for Libtool again.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#376} with diff file ISSM-13073-13074.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-macosx64-larour-ad.sh M /issm/trunk-jpl/src/c/Container/Observations.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussTria.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/objects/Node.cpp M /issm/trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp M /issm/trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h M /issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp M /issm/trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.cpp M /issm/trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.h M /issm/trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp M /issm/trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h M /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp M /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.h M /issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp M /issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.h M /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp M /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h M /issm/trunk-jpl/src/c/modules/IceVolumex/IceVolumex.cpp M /issm/trunk-jpl/src/c/modules/IceVolumex/IceVolumex.h M /issm/trunk-jpl/src/c/modules/InputControlUpdatex/InputControlUpdatex.cpp M /issm/trunk-jpl/src/c/modules/InputControlUpdatex/InputControlUpdatex.h M /issm/trunk-jpl/src/c/modules/MassFluxx/MassFluxx.cpp M /issm/trunk-jpl/src/c/modules/MassFluxx/MassFluxx.h M /issm/trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp M /issm/trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.h M /issm/trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp M /issm/trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.h M /issm/trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp M /issm/trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.h M /issm/trunk-jpl/src/c/modules/MaxVelx/MaxVelx.cpp M /issm/trunk-jpl/src/c/modules/MaxVelx/MaxVelx.h M /issm/trunk-jpl/src/c/modules/MaxVxx/MaxVxx.cpp M /issm/trunk-jpl/src/c/modules/MaxVxx/MaxVxx.h M /issm/trunk-jpl/src/c/modules/MaxVyx/MaxVyx.cpp M /issm/trunk-jpl/src/c/modules/MaxVyx/MaxVyx.h M /issm/trunk-jpl/src/c/modules/MaxVzx/MaxVzx.cpp M /issm/trunk-jpl/src/c/modules/MaxVzx/MaxVzx.h M /issm/trunk-jpl/src/c/modules/MinVelx/MinVelx.cpp M /issm/trunk-jpl/src/c/modules/MinVelx/MinVelx.h M /issm/trunk-jpl/src/c/modules/MinVxx/MinVxx.cpp M /issm/trunk-jpl/src/c/modules/MinVxx/MinVxx.h M /issm/trunk-jpl/src/c/modules/MinVyx/MinVyx.cpp M /issm/trunk-jpl/src/c/modules/MinVyx/MinVyx.h M /issm/trunk-jpl/src/c/modules/MinVzx/MinVzx.cpp M /issm/trunk-jpl/src/c/modules/MinVzx/MinVzx.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp M /issm/trunk-jpl/src/c/modules/Orthx/Orthx.cpp M /issm/trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp M /issm/trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h 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/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h M /issm/trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h M /issm/trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h M /issm/trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h M /issm/trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h M /issm/trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp M /issm/trunk-jpl/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h M /issm/trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp M /issm/trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h M /issm/trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp M /issm/trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h M /issm/trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp M /issm/trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h M /issm/trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.cpp M /issm/trunk-jpl/src/c/modules/TotalSmbx/TotalSmbx.h M /issm/trunk-jpl/src/c/solutions/control\_core.cpp M /issm/trunk-jpl/src/c/solutions/hydrology\_core.cpp M /issm/trunk-jpl/src/c/solutions/issm.cpp\\
+Export determination: 6. \\
+Rationale: CHG: extended rest of the code (except for kriging code) to use IssmDouble and IssmPDouble active and passive types, for use with AD type constructs (using ADOLC or ADIC in the future).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#377} with diff file ISSM-13074-13075.diff: \\
+Function name: \\
+M /issm/trunk-jpl/startup.m\\
+Export determination: 6. \\
+Rationale: BUG: mex modules are installed in trunk/lib instead of bin. Quick fix: add lib/ to matlab's path\\
+\vspace{3em}
+
+\noindent \textbf{Change \#378} with diff file ISSM-13075-13076.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/valgrind\\
+Export determination: 6. \\
+Rationale: CHG: ignore some files within the svn repository.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#379} with diff file ISSM-13076-13077.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m M /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m M /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py M /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m\\
+Export determination: 6. \\
+Rationale: BUG: Fix Matlab changeset [12892] and apply corresponding Python change.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#380} with diff file ISSM-13077-13078.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/automakererun.sh\\
+Export determination: 6. \\
+Rationale: CHG: In order to avoid issues with 'autoreconf', the '--force' flag is being added to the script.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#381} with diff file ISSM-13078-13079.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/adolc/install-dev.sh\\
+Export determination: 6. \\
+Rationale: NEW: dvpt branch of adolc install\\
+\vspace{3em}
+
+\noindent \textbf{Change \#382} with diff file ISSM-13079-13080.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/adolc M /issm/trunk-jpl/externalpackages/adolc/install-dev.sh D /issm/trunk-jpl/externalpackages/adolc/install-macosx64.sh M /issm/trunk-jpl/externalpackages/adolc/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: new dev install file + do not move trunk/ into src/* as it breaks the compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#383} with diff file ISSM-13080-13081.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/solutions/issm.cpp\\
+Export determination: 6. \\
+Rationale: CHG: need ADOLC\_VERSION for compile with old versions of adolc or new dvpt versions. Also shielded tape\_stats routine using the new ADOLC\_VERSION version number.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#384} with diff file ISSM-13081-13082.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cleaning up Tria (pow can use integers as exponents)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#385} with diff file ISSM-13082-13083.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/libtool/install.sh D /issm/trunk-jpl/m4/libtool.m4 D /issm/trunk-jpl/m4/ltoptions.m4 D /issm/trunk-jpl/m4/ltsugar.m4 D /issm/trunk-jpl/m4/ltversion.m4 D /issm/trunk-jpl/m4/lt~obsolete.m4\\
+Export determination: 6. \\
+Rationale: CHG: In order to prevent issues with 'm4' macros, 'libtool.m4' and 'lt*.m4' have been removed from SVN control and the Libtool install script now copies the m4 files into the m4 directory.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#386} with diff file ISSM-13083-13084.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/c/solutions/issm.cpp M /issm/trunk-jpl/src/m/classes/autodiff.m M /issm/trunk-jpl/src/m/classes/autodiff.py D /issm/trunk-jpl/src/m/enum/AutodiffForwardEnum.m D /issm/trunk-jpl/src/m/enum/AutodiffReverseEnum.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m\\
+Export determination: 6. \\
+Rationale: CHG: introduced autodiff bool to hook off and on the ADOLC at run time.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#387} with diff file ISSM-13084-13085.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4\\
+Export determination: 6. \\
+Rationale: CHG: ignore some files in svn repository.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#388} with diff file ISSM-13085-13086.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/processmesh.m\\
+Export determination: 6. \\
+Rationale: BUG: fixed processmesh when using 'layer', use isprop instead of isfields as model is not a structure\\
+\vspace{3em}
+
+\noindent \textbf{Change \#389} with diff file ISSM-13086-13087.diff: \\
+Function name: \\
+M /issm/trunk-jpl/Makefile.am M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/ltmain.sh M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/modules/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Streamlined m4 macros and /home/glperez/issm/issm-uci/trunk-jpl/src/c/Makefile.am\\
+\vspace{3em}
+
+\noindent \textbf{Change \#390} with diff file ISSM-13087-13088.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4 D /issm/trunk-jpl/m4/ar-lib.m4\\
+Export determination: 6. \\
+Rationale: CHG: removed ar-lib.m4, not needed anymore, and do not ignore other files anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#391} with diff file ISSM-13088-13089.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Reverted changes made to src/modules/matlab/Makefile.am.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#392} with diff file ISSM-13089-13090.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/automakererun.sh\\
+Export determination: 6. \\
+Rationale: BUG: 'automakererun.sh' now points to the right location.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#393} with diff file ISSM-13090-13091.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/automakererun.sh\\
+Export determination: 6. \\
+Rationale: CHG: don't override the aclocal macros\\
+\vspace{3em}
+
+\noindent \textbf{Change \#394} with diff file ISSM-13091-13092.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/libtool/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: Stopped copying libtool macros into m4 directory.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#395} with diff file ISSM-13092-13093.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h\\
+Export determination: 6. \\
+Rationale: CHG: renaming CreateKMatrixSlope CreateMassMatrix, since this is a standrard L2 projection\\
+\vspace{3em}
+
+\noindent \textbf{Change \#396} with diff file ISSM-13093-13094.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/inversion.py\\
+Export determination: 6. \\
+Rationale: CHG: Added call to setdefaultparameters in inversion subclass.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#397} with diff file ISSM-13094-13095.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/materials.m M /issm/trunk-jpl/src/m/classes/materials.py\\
+Export determination: 6. \\
+Rationale: BUG: Changed material constants from integer to float in materials subclass.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#398} with diff file ISSM-13095-13096.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.py\\
+Export determination: 6. \\
+Rationale: BUG: Fixed typos introduced in [12887].\\
+\vspace{3em}
+
+\noindent \textbf{Change \#399} with diff file ISSM-13096-13097.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive1205.mat M /issm/trunk-jpl/test/Archives/Archive1206.mat M /issm/trunk-jpl/test/Archives/Archive1207.mat\\
+Export determination: 6. \\
+Rationale: BUG: archives for test that now use expwrite instead of expgen\\
+\vspace{3em}
+
+\noindent \textbf{Change \#400} with diff file ISSM-13097-13098.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/os/issmscpin.py M /issm/trunk-jpl/src/m/solve/WriteData.py M /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py M /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py M /issm/trunk-jpl/src/m/solve/marshall.py\\
+Export determination: 6. \\
+Rationale: CHG: Changes for first successful python run (including very important missing 'else').\\
+\vspace{3em}
+
+\noindent \textbf{Change \#401} with diff file ISSM-13098-13099.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/pairoptions.py M /issm/trunk-jpl/src/m/classes/solver.py M /issm/trunk-jpl/src/m/classes/verbose.py M /issm/trunk-jpl/src/m/geometry/FlagElements.py M /issm/trunk-jpl/src/m/miscellaneous/fielddisplay.py M /issm/trunk-jpl/src/m/solve/WriteData.py M /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py\\
+Export determination: 6. \\
+Rationale: CHG: Broaden isinstance criteria for python to consistently include unicode and long.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#402} with diff file ISSM-13099-13100.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/matlab/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: changing matlab version for nightly runs (switch from 7.6 to 7.12 as isprop does not work on the old version)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#403} with diff file ISSM-13100-13101.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc/install-dev-pleiades.sh\\
+Export determination: 6. \\
+Rationale: CHG:Removed a step (Lapack install correctly now), Updated SuperLU download location\\
+\vspace{3em}
+
+\noindent \textbf{Change \#404} with diff file ISSM-13107-13108.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/model.py M /issm/trunk-jpl/src/m/solve/marshall.py M /issm/trunk-jpl/src/m/solvers/iluasmoptions.py M /issm/trunk-jpl/src/m/solvers/mumpsoptions.py\\
+Export determination: 6. \\
+Rationale: CHG: Change some python dicts to OrderedDicts.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#405} with diff file ISSM-13108-13109.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.py A /issm/trunk-jpl/test/NightlyRun/runme2.m (from /issm/trunk-jpl/test/NightlyRun/runme.m:13103) M /issm/trunk-jpl/test/NightlyRun/test101.py\\
+Export determination: 6. \\
+Rationale: NEW: netcdf version of runme.m (called runme2.m), runme.py, and test101.py.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#406} with diff file ISSM-13109-13110.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.m D /issm/trunk-jpl/test/NightlyRun/runme2.m\\
+Export determination: 6. \\
+Rationale: CHG: now use .nc archives for Nightly Runs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#407} with diff file ISSM-13110-13111.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive101.nc A /issm/trunk-jpl/test/Archives/Archive102.nc A /issm/trunk-jpl/test/Archives/Archive103.nc A /issm/trunk-jpl/test/Archives/Archive104.nc A /issm/trunk-jpl/test/Archives/Archive105.nc A /issm/trunk-jpl/test/Archives/Archive106.nc A /issm/trunk-jpl/test/Archives/Archive107.nc A /issm/trunk-jpl/test/Archives/Archive108.nc A /issm/trunk-jpl/test/Archives/Archive109.nc A /issm/trunk-jpl/test/Archives/Archive110.nc A /issm/trunk-jpl/test/Archives/Archive111.nc A /issm/trunk-jpl/test/Archives/Archive112.nc A /issm/trunk-jpl/test/Archives/Archive113.nc A /issm/trunk-jpl/test/Archives/Archive114.nc A /issm/trunk-jpl/test/Archives/Archive115.nc A /issm/trunk-jpl/test/Archives/Archive116.nc A /issm/trunk-jpl/test/Archives/Archive117.nc A /issm/trunk-jpl/test/Archives/Archive118.nc A /issm/trunk-jpl/test/Archives/Archive119.nc A /issm/trunk-jpl/test/Archives/Archive120.nc A /issm/trunk-jpl/test/Archives/Archive121.nc A /issm/trunk-jpl/test/Archives/Archive122.nc A /issm/trunk-jpl/test/Archives/Archive201.nc A /issm/trunk-jpl/test/Archives/Archive202.nc A /issm/trunk-jpl/test/Archives/Archive203.nc A /issm/trunk-jpl/test/Archives/Archive204.nc A /issm/trunk-jpl/test/Archives/Archive205.nc A /issm/trunk-jpl/test/Archives/Archive206.nc A /issm/trunk-jpl/test/Archives/Archive207.nc A /issm/trunk-jpl/test/Archives/Archive208.nc A /issm/trunk-jpl/test/Archives/Archive209.nc A /issm/trunk-jpl/test/Archives/Archive210.nc A /issm/trunk-jpl/test/Archives/Archive211.nc A /issm/trunk-jpl/test/Archives/Archive212.nc A /issm/trunk-jpl/test/Archives/Archive213.nc A /issm/trunk-jpl/test/Archives/Archive214.nc A /issm/trunk-jpl/test/Archives/Archive215.nc A /issm/trunk-jpl/test/Archives/Archive216.nc A /issm/trunk-jpl/test/Archives/Archive217.nc A /issm/trunk-jpl/test/Archives/Archive218.nc A /issm/trunk-jpl/test/Archives/Archive219.nc A /issm/trunk-jpl/test/Archives/Archive220.nc A /issm/trunk-jpl/test/Archives/Archive221.nc A /issm/trunk-jpl/test/Archives/Archive222.nc A /issm/trunk-jpl/test/Archives/Archive223.nc A /issm/trunk-jpl/test/Archives/Archive224.nc A /issm/trunk-jpl/test/Archives/Archive225.nc A /issm/trunk-jpl/test/Archives/Archive226.nc A /issm/trunk-jpl/test/Archives/Archive227.nc A /issm/trunk-jpl/test/Archives/Archive228.nc A /issm/trunk-jpl/test/Archives/Archive229.nc A /issm/trunk-jpl/test/Archives/Archive230.nc A /issm/trunk-jpl/test/Archives/Archive231.nc A /issm/trunk-jpl/test/Archives/Archive232.nc A /issm/trunk-jpl/test/Archives/Archive233.nc A /issm/trunk-jpl/test/Archives/Archive234.nc A /issm/trunk-jpl/test/Archives/Archive235.nc A /issm/trunk-jpl/test/Archives/Archive236.nc A /issm/trunk-jpl/test/Archives/Archive237.nc A /issm/trunk-jpl/test/Archives/Archive301.nc A /issm/trunk-jpl/test/Archives/Archive302.nc A /issm/trunk-jpl/test/Archives/Archive303.nc A /issm/trunk-jpl/test/Archives/Archive304.nc A /issm/trunk-jpl/test/Archives/Archive305.nc A /issm/trunk-jpl/test/Archives/Archive306.nc A /issm/trunk-jpl/test/Archives/Archive307.nc A /issm/trunk-jpl/test/Archives/Archive308.nc A /issm/trunk-jpl/test/Archives/Archive309.nc A /issm/trunk-jpl/test/Archives/Archive310.nc A /issm/trunk-jpl/test/Archives/Archive311.nc A /issm/trunk-jpl/test/Archives/Archive312.nc A /issm/trunk-jpl/test/Archives/Archive313.nc A /issm/trunk-jpl/test/Archives/Archive314.nc A /issm/trunk-jpl/test/Archives/Archive315.nc A /issm/trunk-jpl/test/Archives/Archive316.nc A /issm/trunk-jpl/test/Archives/Archive317.nc A /issm/trunk-jpl/test/Archives/Archive318.nc A /issm/trunk-jpl/test/Archives/Archive319.nc A /issm/trunk-jpl/test/Archives/Archive320.nc A /issm/trunk-jpl/test/Archives/Archive321.nc A /issm/trunk-jpl/test/Archives/Archive322.nc A /issm/trunk-jpl/test/Archives/Archive323.nc A /issm/trunk-jpl/test/Archives/Archive324.nc A /issm/trunk-jpl/test/Archives/Archive325.nc A /issm/trunk-jpl/test/Archives/Archive326.nc A /issm/trunk-jpl/test/Archives/Archive327.nc A /issm/trunk-jpl/test/Archives/Archive328.nc A /issm/trunk-jpl/test/Archives/Archive329.nc A /issm/trunk-jpl/test/Archives/Archive401.nc A /issm/trunk-jpl/test/Archives/Archive402.nc A /issm/trunk-jpl/test/Archives/Archive403.nc A /issm/trunk-jpl/test/Archives/Archive404.nc A /issm/trunk-jpl/test/Archives/Archive405.nc A /issm/trunk-jpl/test/Archives/Archive406.nc A /issm/trunk-jpl/test/Archives/Archive407.nc A /issm/trunk-jpl/test/Archives/Archive408.nc A /issm/trunk-jpl/test/Archives/Archive409.nc A /issm/trunk-jpl/test/Archives/Archive410.nc A /issm/trunk-jpl/test/Archives/Archive411.nc A /issm/trunk-jpl/test/Archives/Archive412.nc A /issm/trunk-jpl/test/Archives/Archive413.nc A /issm/trunk-jpl/test/Archives/Archive414.nc A /issm/trunk-jpl/test/Archives/Archive415.nc A /issm/trunk-jpl/test/Archives/Archive416.nc A /issm/trunk-jpl/test/Archives/Archive417.nc A /issm/trunk-jpl/test/Archives/Archive418.nc A /issm/trunk-jpl/test/Archives/Archive419.nc A /issm/trunk-jpl/test/Archives/Archive420.nc A /issm/trunk-jpl/test/Archives/Archive421.nc A /issm/trunk-jpl/test/Archives/Archive422.nc A /issm/trunk-jpl/test/Archives/Archive423.nc A /issm/trunk-jpl/test/Archives/Archive424.nc A /issm/trunk-jpl/test/Archives/Archive425.nc A /issm/trunk-jpl/test/Archives/Archive426.nc A /issm/trunk-jpl/test/Archives/Archive427.nc A /issm/trunk-jpl/test/Archives/Archive428.nc A /issm/trunk-jpl/test/Archives/Archive429.nc A /issm/trunk-jpl/test/Archives/Archive430.nc A /issm/trunk-jpl/test/Archives/Archive431.nc A /issm/trunk-jpl/test/Archives/Archive432.nc A /issm/trunk-jpl/test/Archives/Archive501.nc A /issm/trunk-jpl/test/Archives/Archive502.nc A /issm/trunk-jpl/test/Archives/Archive503.nc A /issm/trunk-jpl/test/Archives/Archive504.nc A /issm/trunk-jpl/test/Archives/Archive505.nc A /issm/trunk-jpl/test/Archives/Archive506.nc A /issm/trunk-jpl/test/Archives/Archive507.nc A /issm/trunk-jpl/test/Archives/Archive508.nc A /issm/trunk-jpl/test/Archives/Archive509.nc A /issm/trunk-jpl/test/Archives/Archive510.nc A /issm/trunk-jpl/test/Archives/Archive511.nc A /issm/trunk-jpl/test/Archives/Archive512.nc A /issm/trunk-jpl/test/Archives/Archive513.nc A /issm/trunk-jpl/test/Archives/Archive514.nc A /issm/trunk-jpl/test/Archives/Archive515.nc A /issm/trunk-jpl/test/Archives/Archive516.nc A /issm/trunk-jpl/test/Archives/Archive601.nc A /issm/trunk-jpl/test/Archives/Archive602.nc A /issm/trunk-jpl/test/Archives/Archive603.nc A /issm/trunk-jpl/test/Archives/Archive604.nc A /issm/trunk-jpl/test/Archives/Archive605.nc A /issm/trunk-jpl/test/Archives/Archive606.nc A /issm/trunk-jpl/test/Archives/Archive607.nc A /issm/trunk-jpl/test/Archives/Archive608.nc A /issm/trunk-jpl/test/Archives/Archive609.nc A /issm/trunk-jpl/test/Archives/Archive610.nc A /issm/trunk-jpl/test/Archives/Archive611.nc A /issm/trunk-jpl/test/Archives/Archive612.nc A /issm/trunk-jpl/test/Archives/Archive613.nc\\
+Export determination: 6. \\
+Rationale: NEW: added .nc archives for Nightly Runs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#408} with diff file ISSM-13112-13113.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc/install-dev-linux64.sh\\
+Export determination: 6. \\
+Rationale: CHG: Added last libraries to petsc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#409} with diff file ISSM-13113-13114.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: GSLLIB required for Kriging\\
+\vspace{3em}
+
+\noindent \textbf{Change \#410} with diff file ISSM-13114-13115.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-macosx64-helene.sh\\
+Export determination: 6. \\
+Rationale: CHG: added tao\\
+\vspace{3em}
+
+\noindent \textbf{Change \#411} with diff file ISSM-13115-13116.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: added METISLIB to MeshPartition\\
+\vspace{3em}
+
+\noindent \textbf{Change \#412} with diff file ISSM-13116-13117.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/flaim.py M /issm/trunk-jpl/src/m/classes/miscellaneous.py M /issm/trunk-jpl/src/m/classes/model/model.py M /issm/trunk-jpl/src/m/classes/pairoptions.py M /issm/trunk-jpl/src/m/classes/private.py M /issm/trunk-jpl/src/m/classes/qmu.py M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py M /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py M /issm/trunk-jpl/src/m/solve/marshall.py M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py M /issm/trunk-jpl/src/m/solve/process\_solve\_options.py\\
+Export determination: 6. \\
+Rationale: CHG: Minor python modifications.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#413} with diff file ISSM-13119-13120.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h A /issm/trunk-jpl/src/c/EnumDefinitions/EnumToModelField.cpp (from /issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/EnumToModelField.cpp:13118) M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/initialization.m M /issm/trunk-jpl/src/m/classes/inversion.m M /issm/trunk-jpl/src/m/classes/materials.m M /issm/trunk-jpl/src/m/classes/model/model.m M /issm/trunk-jpl/src/m/contrib/hack/tres.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m A /issm/trunk-jpl/src/m/enum/TemperatureBasalEnum.m (from /issm/branches/trunk-jpl-damage/src/m/enum/TemperatureBasalEnum.m:13118) A /issm/trunk-jpl/src/m/enum/TemperatureSurfaceEnum.m (from /issm/branches/trunk-jpl-damage/src/m/enum/TemperatureSurfaceEnum.m:13118) M /issm/trunk-jpl/test A /issm/trunk-jpl/test/Archives/Archive270.mat (from /issm/branches/trunk-jpl-damage/test/Archives/Archive270.mat:13118) A /issm/trunk-jpl/test/Archives/Archive272.mat (from /issm/branches/trunk-jpl-damage/test/Archives/Archive272.mat:13118) A /issm/trunk-jpl/test/Archives/Archive274.mat (from /issm/branches/trunk-jpl-damage/test/Archives/Archive274.mat:13118) M /issm/trunk-jpl/test/NightlyRun/IdToName.m M /issm/trunk-jpl/test/NightlyRun/README A /issm/trunk-jpl/test/NightlyRun/test270.m (from /issm/branches/trunk-jpl-damage/test/NightlyRun/test270.m:13118) A /issm/trunk-jpl/test/NightlyRun/test272.m (from /issm/branches/trunk-jpl-damage/test/NightlyRun/test272.m:13118) A /issm/trunk-jpl/test/NightlyRun/test274.m (from /issm/branches/trunk-jpl-damage/test/NightlyRun/test274.m:13118) M /issm/trunk-jpl/test/Par/79North.par M /issm/trunk-jpl/test/Par/ISMIPA.par M /issm/trunk-jpl/test/Par/ISMIPB.par M /issm/trunk-jpl/test/Par/ISMIPC.par M /issm/trunk-jpl/test/Par/ISMIPD.par M /issm/trunk-jpl/test/Par/ISMIPE.par M /issm/trunk-jpl/test/Par/ISMIPF.par M /issm/trunk-jpl/test/Par/Pig.par M /issm/trunk-jpl/test/Par/RoundSheetEISMINT.par M /issm/trunk-jpl/test/Par/RoundSheetShelf.par M /issm/trunk-jpl/test/Par/RoundSheetStaticEISMINT.par M /issm/trunk-jpl/test/Par/SquareEISMINT.par M /issm/trunk-jpl/test/Par/SquareSheetConstrained.par M /issm/trunk-jpl/test/Par/SquareSheetShelf.par M /issm/trunk-jpl/test/Par/SquareShelf.par M /issm/trunk-jpl/test/Par/SquareShelfConstrained.par M /issm/trunk-jpl/test/Par/SquareThermal.par\\
+Export determination: 6. \\
+Rationale: NEW: damage inversion capability merged from branches/trunk-jpl-damage into trunk-jpl. This affects EVERYONE. You will need to initialize a new rheology parameter md.materials.rheology\_Z in all your model runs. Check the updated .par files in test/Par for syntax.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#414} with diff file ISSM-13120-13121.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive270.nc A /issm/trunk-jpl/test/Archives/Archive272.nc A /issm/trunk-jpl/test/Archives/Archive274.nc\\
+Export determination: 6. \\
+Rationale: NEW: archives for new damage nightly runs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#415} with diff file ISSM-13121-13122.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/enum/MaterialsRheologyZEnum.m A /issm/trunk-jpl/src/m/enum/MaterialsRheologyZbarEnum.m\\
+Export determination: 6. \\
+Rationale: NEW: forgot to add new enums\\
+\vspace{3em}
+
+\noindent \textbf{Change \#416} with diff file ISSM-13122-13123.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/meca/initialdamage.m A /issm/trunk-jpl/src/m/meca/steadystateiceshelftemp.m\\
+Export determination: 6. \\
+Rationale: NEW: functions for calculating damage and temperature for an ice shelf\\
+\vspace{3em}
+
+\noindent \textbf{Change \#417} with diff file ISSM-13123-13124.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.m\\
+Export determination: 6. \\
+Rationale: BUG: source environment.sh when launcing a job using the generic cluster class, result of using shared libraries\\
+\vspace{3em}
+
+\noindent \textbf{Change \#418} with diff file ISSM-13124-13125.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/meca/initialdamage.m D /issm/trunk-jpl/src/m/meca/steadystateiceshelftemp.m\\
+Export determination: 6. \\
+Rationale: CHG: reverting change committed in r13122\\
+\vspace{3em}
+
+\noindent \textbf{Change \#419} with diff file ISSM-13125-13126.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/miscellaneous/fielddisplay.m M /issm/trunk-jpl/src/m/miscellaneous/fielddisplay.py\\
+Export determination: 6. \\
+Rationale: CHG: Rewrite python version of fielddisplay and make corresponding changes in matlab version.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#420} with diff file ISSM-13126-13127.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/pfe.m\\
+Export determination: 6. \\
+Rationale: CHG: added grouplist as a property of pfe, and fixed queuing script so that environment.sh is now sourced and all libraries are found\\
+\vspace{3em}
+
+\noindent \textbf{Change \#421} with diff file ISSM-13127-13128.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/radarpower.m\\
+Export determination: 6. \\
+Rationale: NEW: use MOG geotif (500 or 100 m res) instead of jpeg\\
+\vspace{3em}
+
+\noindent \textbf{Change \#422} with diff file ISSM-13128-13129.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: fixed build of Shp2Kml, which needs to be linked to its libraries\\
+\vspace{3em}
+
+\noindent \textbf{Change \#423} with diff file ISSM-13129-13130.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/PentaHook.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/TriaHook.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Material.h M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.h M /issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h M /issm/trunk-jpl/src/c/classes/objects/Params/BoolParam.h M /issm/trunk-jpl/src/c/classes/objects/objects.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: NEW: tria->material is now an object-oriented that can either be Matice or Matdamageice\\
+\vspace{3em}
+
+\noindent \textbf{Change \#424} with diff file ISSM-13130-13131.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp A /issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.h\\
+Export determination: 6. \\
+Rationale: NEW: tria->material is now an object-oriented that can either be Matice or Matdamageice\\
+\vspace{3em}
+
+\noindent \textbf{Change \#425} with diff file ISSM-13131-13132.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/initialization.m D /issm/trunk-jpl/src/m/classes/materials.m A /issm/trunk-jpl/src/m/classes/matice.m (from /issm/trunk-jpl/src/m/classes/materials.m:13125) M /issm/trunk-jpl/src/m/classes/model/model.m\\
+Export determination: 6. \\
+Rationale: NEW: tria->material is now an object-oriented that can either be Matice or Matdamageice\\
+\vspace{3em}
+
+\noindent \textbf{Change \#426} with diff file ISSM-13132-13133.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/matdamageice.m\\
+Export determination: 6. \\
+Rationale: NEW: tria->material is now an object-oriented that can either be Matice or Matdamageice\\
+\vspace{3em}
+
+\noindent \textbf{Change \#427} with diff file ISSM-13133-13134.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/WriteData.m\\
+Export determination: 6. \\
+Rationale: NEW: tria->material is now an object-oriented that can either be Matice or Matdamageice\\
+\vspace{3em}
+
+\noindent \textbf{Change \#428} with diff file ISSM-13134-13135.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py A /issm/trunk-jpl/src/m/enum/MatdamageiceEnum.m M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m\\
+Export determination: 6. \\
+Rationale: CHG: syn enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#429} with diff file ISSM-13135-13136.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/exp/expcoarsen.m\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#430} with diff file ISSM-13136-13137.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test270.m M /issm/trunk-jpl/test/NightlyRun/test272.m M /issm/trunk-jpl/test/NightlyRun/test274.m\\
+Export determination: 6. \\
+Rationale: CHG: fixed damage tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#431} with diff file ISSM-13137-13138.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Par/79North.par M /issm/trunk-jpl/test/Par/ISMIPA.par M /issm/trunk-jpl/test/Par/ISMIPB.par M /issm/trunk-jpl/test/Par/ISMIPC.par M /issm/trunk-jpl/test/Par/ISMIPD.par M /issm/trunk-jpl/test/Par/ISMIPE.par M /issm/trunk-jpl/test/Par/ISMIPF.par M /issm/trunk-jpl/test/Par/Pig.par M /issm/trunk-jpl/test/Par/RoundSheetEISMINT.par M /issm/trunk-jpl/test/Par/RoundSheetShelf.par M /issm/trunk-jpl/test/Par/RoundSheetStaticEISMINT.par M /issm/trunk-jpl/test/Par/SquareEISMINT.par M /issm/trunk-jpl/test/Par/SquareSheetConstrained.par M /issm/trunk-jpl/test/Par/SquareSheetShelf.par M /issm/trunk-jpl/test/Par/SquareShelf.par M /issm/trunk-jpl/test/Par/SquareShelfConstrained.par M /issm/trunk-jpl/test/Par/SquareThermal.par\\
+Export determination: 6. \\
+Rationale: CHG: clean up as no damage is needed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#432} with diff file ISSM-13138-13139.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-linux64-astrid.sh\\
+Export determination: 6. \\
+Rationale: CHG: 32 threads is too large, changed to 16\\
+\vspace{3em}
+
+\noindent \textbf{Change \#433} with diff file ISSM-13139-13140.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/classes/materials.py A /issm/trunk-jpl/src/m/classes/matice.py (from /issm/trunk-jpl/src/m/classes/materials.py:13128) M /issm/trunk-jpl/src/m/classes/model/model.py\\
+Export determination: 6. \\
+Rationale: CHG: sync python with matlab code\\
+\vspace{3em}
+
+\noindent \textbf{Change \#434} with diff file ISSM-13140-13141.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/meca A /issm/trunk-jpl/src/m/mech (from /issm/trunk-jpl/src/m/meca:13138)\\
+Export determination: 6. \\
+Rationale: CHG: renamed src/m/meca to src/m/mech for clarity\\
+\vspace{3em}
+
+\noindent \textbf{Change \#435} with diff file ISSM-13141-13142.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/valgrind/install-altix64.sh M /issm/trunk-jpl/externalpackages/valgrind/install-linux64.sh M /issm/trunk-jpl/externalpackages/valgrind/install-macosx32.sh M /issm/trunk-jpl/externalpackages/valgrind/install-macosx64.sh M /issm/trunk-jpl/externalpackages/valgrind/install-win32.sh\\
+Export determination: 6. \\
+Rationale: CHG: upgraded to valgrind-3.8.0, which works better with libtool\\
+\vspace{3em}
+
+\noindent \textbf{Change \#436} with diff file ISSM-13142-13143.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#437} with diff file ISSM-13143-13144.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/README\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#438} with diff file ISSM-13144-13145.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: meca was renamed mech, updated Makefile.am accordingly (NR crash)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#439} with diff file ISSM-13145-13146.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.csh\\
+Export determination: 6. \\
+Rationale: CHG: added libtool to environment.csh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#440} with diff file ISSM-13146-13147.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive1101.nc A /issm/trunk-jpl/test/Archives/Archive1102.nc A /issm/trunk-jpl/test/Archives/Archive1103.nc A /issm/trunk-jpl/test/Archives/Archive1104.nc A /issm/trunk-jpl/test/Archives/Archive1105.nc A /issm/trunk-jpl/test/Archives/Archive1106.nc A /issm/trunk-jpl/test/Archives/Archive1107.nc A /issm/trunk-jpl/test/Archives/Archive1108.nc A /issm/trunk-jpl/test/Archives/Archive1109.nc A /issm/trunk-jpl/test/Archives/Archive1110.nc A /issm/trunk-jpl/test/Archives/Archive1201.nc A /issm/trunk-jpl/test/Archives/Archive1202.nc A /issm/trunk-jpl/test/Archives/Archive1203.nc A /issm/trunk-jpl/test/Archives/Archive1204.nc A /issm/trunk-jpl/test/Archives/Archive1205.nc A /issm/trunk-jpl/test/Archives/Archive1206.nc A /issm/trunk-jpl/test/Archives/Archive1207.nc A /issm/trunk-jpl/test/Archives/Archive1208.nc A /issm/trunk-jpl/test/Archives/Archive1301.nc A /issm/trunk-jpl/test/Archives/Archive1302.nc A /issm/trunk-jpl/test/Archives/Archive1303.nc A /issm/trunk-jpl/test/Archives/Archive1304.nc A /issm/trunk-jpl/test/Archives/Archive1401.nc A /issm/trunk-jpl/test/Archives/Archive1402.nc A /issm/trunk-jpl/test/Archives/Archive1501.nc A /issm/trunk-jpl/test/Archives/Archive1502.nc A /issm/trunk-jpl/test/Archives/Archive1601.nc A /issm/trunk-jpl/test/Archives/Archive1602.nc\\
+Export determination: 6. \\
+Rationale: NEW: added netcdf archives for validation tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#441} with diff file ISSM-13147-13148.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.csh M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: BUG: added yams path in enviromnent\\
+\vspace{3em}
+
+\noindent \textbf{Change \#442} with diff file ISSM-13148-13149.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/inversion.m\\
+Export determination: 6. \\
+Rationale: CHG: added md = in front of all checksoncistency\\
+\vspace{3em}
+
+\noindent \textbf{Change \#443} with diff file ISSM-13149-13150.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: added pathappend so that a directory is not added twice the PATH, same for libraries\\
+\vspace{3em}
+
+\noindent \textbf{Change \#444} with diff file ISSM-13150-13151.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/model.m M /issm/trunk-jpl/src/m/classes/model/model.py M /issm/trunk-jpl/src/m/extrusion/project3d.m M /issm/trunk-jpl/src/m/miscellaneous/fielddisplay.py\\
+Export determination: 6. \\
+Rationale: NEW: Python versions of model.extrude and project3d (and corresponding Matlab changes).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#445} with diff file ISSM-13151-13152.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/extrusion/project3d.py\\
+Export determination: 6. \\
+Rationale: NEW: Python versions of model.extrude and project3d (and corresponding Matlab changes).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#446} with diff file ISSM-13152-13153.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test101.py A /issm/trunk-jpl/test/NightlyRun/test102.py A /issm/trunk-jpl/test/NightlyRun/test103.py A /issm/trunk-jpl/test/NightlyRun/test105.py A /issm/trunk-jpl/test/NightlyRun/test107.py A /issm/trunk-jpl/test/NightlyRun/test108.py A /issm/trunk-jpl/test/NightlyRun/test109.py A /issm/trunk-jpl/test/NightlyRun/test110.py\\
+Export determination: 6. \\
+Rationale: NEW: More working python tests! Woo hoo!\\
+\vspace{3em}
+
+\noindent \textbf{Change \#447} with diff file ISSM-13153-13154.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/plot\_scatter.m\\
+Export determination: 6. \\
+Rationale: CHG: plot\_scatter takes options\\
+\vspace{3em}
+
+\noindent \textbf{Change \#448} with diff file ISSM-13154-13155.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/colormaps/getcolormap.m\\
+Export determination: 6. \\
+Rationale: CHG: use less colors by default\\
+\vspace{3em}
+
+\noindent \textbf{Change \#449} with diff file ISSM-13155-13156.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/adolc/install-dev.sh\\
+Export determination: 6. \\
+Rationale: for the time being use the branch held on gitorious\\
+\vspace{3em}
+
+\noindent \textbf{Change \#450} with diff file ISSM-13156-13157.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.csh M /issm/trunk-jpl/etc/environment.sh D /issm/trunk-jpl/externalpackages/autoconf D /issm/trunk-jpl/externalpackages/automake A /issm/trunk-jpl/externalpackages/autotools A /issm/trunk-jpl/externalpackages/autotools/install.sh D /issm/trunk-jpl/externalpackages/libtool M /issm/trunk-jpl/scripts/automakererun.sh\\
+Export determination: 6. \\
+Rationale: CHG: install all autotools packages in one single directory to avoid issues whith autoreconf. autotools now installs autoconf, automake and libtool\\
+\vspace{3em}
+
+\noindent \textbf{Change \#451} with diff file ISSM-13157-13158.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/autotools/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: do not recreate install directory several times\\
+\vspace{3em}
+
+\noindent \textbf{Change \#452} with diff file ISSM-13158-13159.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/autotools/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: forgot to cd back\\
+\vspace{3em}
+
+\noindent \textbf{Change \#453} with diff file ISSM-13159-13160.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/autotools/install.sh\\
+Export determination: 6. \\
+Rationale: error out when one of things fails\\
+\vspace{3em}
+
+\noindent \textbf{Change \#454} with diff file ISSM-13160-13161.diff: \\
+Function name: \\
+M /issm/trunk-jpl/Makefile.am\\
+Export determination: 6. \\
+Rationale: with libtool and aclocal colocated this is no longer needed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#455} with diff file ISSM-13161-13162.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: added netcdf in c include path\\
+\vspace{3em}
+
+\noindent \textbf{Change \#456} with diff file ISSM-13162-13163.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/autotools M /issm/trunk-jpl/externalpackages/autotools/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: fixed circular dependency on a certain version of autoconf.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#457} with diff file ISSM-13163-13164.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m M /issm/trunk-jpl/test/NightlyRun/IdToName.py A /issm/trunk-jpl/test/NightlyRun/test3001.m\\
+Export determination: 6. \\
+Rationale: CHG: added hook-ups to 3000 series of tests, for AD related things\\
+\vspace{3em}
+
+\noindent \textbf{Change \#458} with diff file ISSM-13164-13165.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/ad/todo\\
+Export determination: 6. \\
+Rationale: CHG: AD todo\\
+\vspace{3em}
+
+\noindent \textbf{Change \#459} with diff file ISSM-13165-13166.diff: \\
+Function name: \\
+D /issm/trunk-jpl/test/Archives/Archive101.mat D /issm/trunk-jpl/test/Archives/Archive102.mat D /issm/trunk-jpl/test/Archives/Archive103.mat D /issm/trunk-jpl/test/Archives/Archive104.mat D /issm/trunk-jpl/test/Archives/Archive105.mat D /issm/trunk-jpl/test/Archives/Archive106.mat D /issm/trunk-jpl/test/Archives/Archive107.mat D /issm/trunk-jpl/test/Archives/Archive108.mat D /issm/trunk-jpl/test/Archives/Archive109.mat D /issm/trunk-jpl/test/Archives/Archive110.mat D /issm/trunk-jpl/test/Archives/Archive1101.mat D /issm/trunk-jpl/test/Archives/Archive1102.mat D /issm/trunk-jpl/test/Archives/Archive1103.mat D /issm/trunk-jpl/test/Archives/Archive1104.mat D /issm/trunk-jpl/test/Archives/Archive1105.mat D /issm/trunk-jpl/test/Archives/Archive1106.mat D /issm/trunk-jpl/test/Archives/Archive1107.mat D /issm/trunk-jpl/test/Archives/Archive1108.mat D /issm/trunk-jpl/test/Archives/Archive1109.mat D /issm/trunk-jpl/test/Archives/Archive111.mat D /issm/trunk-jpl/test/Archives/Archive1110.mat D /issm/trunk-jpl/test/Archives/Archive112.mat D /issm/trunk-jpl/test/Archives/Archive113.mat D /issm/trunk-jpl/test/Archives/Archive114.mat D /issm/trunk-jpl/test/Archives/Archive115.mat D /issm/trunk-jpl/test/Archives/Archive116.mat D /issm/trunk-jpl/test/Archives/Archive117.mat D /issm/trunk-jpl/test/Archives/Archive118.mat D /issm/trunk-jpl/test/Archives/Archive119.mat D /issm/trunk-jpl/test/Archives/Archive120.mat D /issm/trunk-jpl/test/Archives/Archive1201.mat D /issm/trunk-jpl/test/Archives/Archive1202.mat D /issm/trunk-jpl/test/Archives/Archive1203.mat D /issm/trunk-jpl/test/Archives/Archive1204.mat D /issm/trunk-jpl/test/Archives/Archive1205.mat D /issm/trunk-jpl/test/Archives/Archive1206.mat D /issm/trunk-jpl/test/Archives/Archive1207.mat D /issm/trunk-jpl/test/Archives/Archive1208.mat D /issm/trunk-jpl/test/Archives/Archive121.mat D /issm/trunk-jpl/test/Archives/Archive122.mat D /issm/trunk-jpl/test/Archives/Archive1301.mat D /issm/trunk-jpl/test/Archives/Archive1302.mat D /issm/trunk-jpl/test/Archives/Archive1303.mat D /issm/trunk-jpl/test/Archives/Archive1304.mat D /issm/trunk-jpl/test/Archives/Archive1401.mat D /issm/trunk-jpl/test/Archives/Archive1402.mat D /issm/trunk-jpl/test/Archives/Archive1501.mat D /issm/trunk-jpl/test/Archives/Archive1502.mat D /issm/trunk-jpl/test/Archives/Archive1601.mat D /issm/trunk-jpl/test/Archives/Archive1602.mat D /issm/trunk-jpl/test/Archives/Archive201.mat D /issm/trunk-jpl/test/Archives/Archive202.mat D /issm/trunk-jpl/test/Archives/Archive203.mat D /issm/trunk-jpl/test/Archives/Archive204.mat D /issm/trunk-jpl/test/Archives/Archive205.mat D /issm/trunk-jpl/test/Archives/Archive206.mat D /issm/trunk-jpl/test/Archives/Archive207.mat D /issm/trunk-jpl/test/Archives/Archive208.mat D /issm/trunk-jpl/test/Archives/Archive209.mat D /issm/trunk-jpl/test/Archives/Archive210.mat D /issm/trunk-jpl/test/Archives/Archive211.mat D /issm/trunk-jpl/test/Archives/Archive212.mat D /issm/trunk-jpl/test/Archives/Archive213.mat D /issm/trunk-jpl/test/Archives/Archive214.mat D /issm/trunk-jpl/test/Archives/Archive215.mat D /issm/trunk-jpl/test/Archives/Archive216.mat D /issm/trunk-jpl/test/Archives/Archive217.mat D /issm/trunk-jpl/test/Archives/Archive218.mat D /issm/trunk-jpl/test/Archives/Archive219.mat D /issm/trunk-jpl/test/Archives/Archive220.mat D /issm/trunk-jpl/test/Archives/Archive221.mat D /issm/trunk-jpl/test/Archives/Archive222.mat D /issm/trunk-jpl/test/Archives/Archive223.mat D /issm/trunk-jpl/test/Archives/Archive224.mat D /issm/trunk-jpl/test/Archives/Archive225.mat D /issm/trunk-jpl/test/Archives/Archive226.mat D /issm/trunk-jpl/test/Archives/Archive227.mat D /issm/trunk-jpl/test/Archives/Archive228.mat D /issm/trunk-jpl/test/Archives/Archive229.mat D /issm/trunk-jpl/test/Archives/Archive230.mat D /issm/trunk-jpl/test/Archives/Archive231.mat D /issm/trunk-jpl/test/Archives/Archive232.mat D /issm/trunk-jpl/test/Archives/Archive233.mat D /issm/trunk-jpl/test/Archives/Archive234.mat D /issm/trunk-jpl/test/Archives/Archive235.mat D /issm/trunk-jpl/test/Archives/Archive236.mat D /issm/trunk-jpl/test/Archives/Archive237.mat D /issm/trunk-jpl/test/Archives/Archive270.mat D /issm/trunk-jpl/test/Archives/Archive272.mat D /issm/trunk-jpl/test/Archives/Archive274.mat D /issm/trunk-jpl/test/Archives/Archive301.mat D /issm/trunk-jpl/test/Archives/Archive302.mat D /issm/trunk-jpl/test/Archives/Archive303.mat D /issm/trunk-jpl/test/Archives/Archive304.mat D /issm/trunk-jpl/test/Archives/Archive305.mat D /issm/trunk-jpl/test/Archives/Archive306.mat D /issm/trunk-jpl/test/Archives/Archive307.mat D /issm/trunk-jpl/test/Archives/Archive308.mat D /issm/trunk-jpl/test/Archives/Archive309.mat D /issm/trunk-jpl/test/Archives/Archive310.mat D /issm/trunk-jpl/test/Archives/Archive311.mat D /issm/trunk-jpl/test/Archives/Archive312.mat D /issm/trunk-jpl/test/Archives/Archive313.mat D /issm/trunk-jpl/test/Archives/Archive314.mat D /issm/trunk-jpl/test/Archives/Archive315.mat D /issm/trunk-jpl/test/Archives/Archive316.mat D /issm/trunk-jpl/test/Archives/Archive317.mat D /issm/trunk-jpl/test/Archives/Archive318.mat D /issm/trunk-jpl/test/Archives/Archive319.mat D /issm/trunk-jpl/test/Archives/Archive320.mat D /issm/trunk-jpl/test/Archives/Archive321.mat D /issm/trunk-jpl/test/Archives/Archive322.mat D /issm/trunk-jpl/test/Archives/Archive323.mat D /issm/trunk-jpl/test/Archives/Archive324.mat D /issm/trunk-jpl/test/Archives/Archive325.mat D /issm/trunk-jpl/test/Archives/Archive326.mat D /issm/trunk-jpl/test/Archives/Archive327.mat D /issm/trunk-jpl/test/Archives/Archive328.mat D /issm/trunk-jpl/test/Archives/Archive329.mat D /issm/trunk-jpl/test/Archives/Archive401.mat D /issm/trunk-jpl/test/Archives/Archive402.mat D /issm/trunk-jpl/test/Archives/Archive403.mat D /issm/trunk-jpl/test/Archives/Archive404.mat D /issm/trunk-jpl/test/Archives/Archive405.mat D /issm/trunk-jpl/test/Archives/Archive406.mat D /issm/trunk-jpl/test/Archives/Archive407.mat D /issm/trunk-jpl/test/Archives/Archive408.mat D /issm/trunk-jpl/test/Archives/Archive409.mat D /issm/trunk-jpl/test/Archives/Archive410.mat D /issm/trunk-jpl/test/Archives/Archive411.mat D /issm/trunk-jpl/test/Archives/Archive412.mat D /issm/trunk-jpl/test/Archives/Archive413.mat D /issm/trunk-jpl/test/Archives/Archive414.mat D /issm/trunk-jpl/test/Archives/Archive415.mat D /issm/trunk-jpl/test/Archives/Archive416.mat D /issm/trunk-jpl/test/Archives/Archive417.mat D /issm/trunk-jpl/test/Archives/Archive418.mat D /issm/trunk-jpl/test/Archives/Archive419.mat D /issm/trunk-jpl/test/Archives/Archive420.mat D /issm/trunk-jpl/test/Archives/Archive421.mat D /issm/trunk-jpl/test/Archives/Archive422.mat D /issm/trunk-jpl/test/Archives/Archive423.mat D /issm/trunk-jpl/test/Archives/Archive424.mat D /issm/trunk-jpl/test/Archives/Archive425.mat D /issm/trunk-jpl/test/Archives/Archive426.mat D /issm/trunk-jpl/test/Archives/Archive427.mat D /issm/trunk-jpl/test/Archives/Archive428.mat D /issm/trunk-jpl/test/Archives/Archive429.mat D /issm/trunk-jpl/test/Archives/Archive430.mat D /issm/trunk-jpl/test/Archives/Archive431.mat D /issm/trunk-jpl/test/Archives/Archive432.mat D /issm/trunk-jpl/test/Archives/Archive501.mat D /issm/trunk-jpl/test/Archives/Archive502.mat D /issm/trunk-jpl/test/Archives/Archive503.mat D /issm/trunk-jpl/test/Archives/Archive504.mat D /issm/trunk-jpl/test/Archives/Archive505.mat D /issm/trunk-jpl/test/Archives/Archive506.mat D /issm/trunk-jpl/test/Archives/Archive507.mat D /issm/trunk-jpl/test/Archives/Archive508.mat D /issm/trunk-jpl/test/Archives/Archive509.mat D /issm/trunk-jpl/test/Archives/Archive510.mat D /issm/trunk-jpl/test/Archives/Archive511.mat D /issm/trunk-jpl/test/Archives/Archive512.mat D /issm/trunk-jpl/test/Archives/Archive513.mat D /issm/trunk-jpl/test/Archives/Archive514.mat D /issm/trunk-jpl/test/Archives/Archive515.mat D /issm/trunk-jpl/test/Archives/Archive516.mat D /issm/trunk-jpl/test/Archives/Archive601.mat D /issm/trunk-jpl/test/Archives/Archive602.mat D /issm/trunk-jpl/test/Archives/Archive603.mat D /issm/trunk-jpl/test/Archives/Archive604.mat D /issm/trunk-jpl/test/Archives/Archive605.mat D /issm/trunk-jpl/test/Archives/Archive606.mat D /issm/trunk-jpl/test/Archives/Archive607.mat D /issm/trunk-jpl/test/Archives/Archive608.mat D /issm/trunk-jpl/test/Archives/Archive609.mat D /issm/trunk-jpl/test/Archives/Archive610.mat D /issm/trunk-jpl/test/Archives/Archive611.mat D /issm/trunk-jpl/test/Archives/Archive612.mat D /issm/trunk-jpl/test/Archives/Archive613.mat\\
+Export determination: 6. \\
+Rationale: CHG: removed .mat archives, now use .nc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#460} with diff file ISSM-13166-13167.diff: \\
+Function name: \\
+M /issm/trunk-jpl/bin\\
+Export determination: 6. \\
+Rationale: CHG: updated ignored files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#461} with diff file ISSM-13167-13168.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/matlab\\
+Export determination: 6. \\
+Rationale: CHG: updated ignored files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#462} with diff file ISSM-13168-13169.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp\\
+Export determination: 6. \\
+Rationale: CHG: adapted code to compile using ADOLC\\
+\vspace{3em}
+
+\noindent \textbf{Change \#463} with diff file ISSM-13169-13170.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/matice.py\\
+Export determination: 6. \\
+Rationale: BUG: Fix new errors in python matice class.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#464} with diff file ISSM-13170-13171.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.m M /issm/trunk-jpl/src/m/classes/clusters/generic.py M /issm/trunk-jpl/src/m/contrib/bamg/YamsCall.m M /issm/trunk-jpl/src/m/contrib/gslib/pkriging.m M /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py M /issm/trunk-jpl/src/m/os/issmdir.m M /issm/trunk-jpl/src/m/os/issmdir.py M /issm/trunk-jpl/src/m/os/issmscpin.m M /issm/trunk-jpl/src/m/os/issmscpin.py M /issm/trunk-jpl/src/m/os/issmscpout.m M /issm/trunk-jpl/src/m/os/issmscpout.py M /issm/trunk-jpl/src/m/os/issmssh.m M /issm/trunk-jpl/src/m/os/issmssh.py M /issm/trunk-jpl/src/m/os/jplsvn.m M /issm/trunk-jpl/src/m/os/oshostname.m M /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.m M /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py\\
+Export determination: 6. \\
+Rationale: CHG: Implement ispc() function for Python (and clean up Matlab calls).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#465} with diff file ISSM-13171-13172.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/diagnostic.py M /issm/trunk-jpl/src/m/classes/flowequation.py M /issm/trunk-jpl/src/m/classes/inversion.py M /issm/trunk-jpl/src/m/parameterization/setflowequation.py\\
+Export determination: 6. \\
+Rationale: CHG: Change Python conditional list comprehensions to numpy.nonzero() for clarity where possible.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#466} with diff file ISSM-13172-13173.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/autotools/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: prepend autotools in PATH\\
+\vspace{3em}
+
+\noindent \textbf{Change \#467} with diff file ISSM-13173-13174.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Removed xrealloc from KMLMeshWrite.cpp.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#468} with diff file ISSM-13174-13175.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: using libtool to generate python modules\\
+\vspace{3em}
+
+\noindent \textbf{Change \#469} with diff file ISSM-13175-13176.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/discover.m\\
+Export determination: 6. \\
+Rationale: CHG: update modules\\
+\vspace{3em}
+
+\noindent \textbf{Change \#470} with diff file ISSM-13176-13177.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc/install-3.2-discover.sh\\
+Export determination: 6. \\
+Rationale: CHG: add shared libs and remove plapack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#471} with diff file ISSM-13177-13178.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-discover.sh\\
+Export determination: 6. \\
+Rationale: CHG: add tao, remove plapack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#472} with diff file ISSM-13178-13179.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m\\
+Export determination: 6. \\
+Rationale: NEW: added AdolcParamEnum.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#473} with diff file ISSM-13179-13180.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/scipy/install-linux64.sh\\
+Export determination: 6. \\
+Rationale: CHG: one step installation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#474} with diff file ISSM-13180-13181.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/enum/AdolcParamEnum.m\\
+Export determination: 6. \\
+Rationale: NEW: new AdolcParam enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#475} with diff file ISSM-13181-13182.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Data/79North.nc A /issm/trunk-jpl/test/Data/ISMIPE.nc A /issm/trunk-jpl/test/Data/Pig.nc A /issm/trunk-jpl/test/Data/SquareSheetConstrained.nc A /issm/trunk-jpl/test/Data/SquareSheetShelf.nc A /issm/trunk-jpl/test/Data/SquareShelf.nc A /issm/trunk-jpl/test/Data/SquareShelfConstrained.nc A /issm/trunk-jpl/test/Data/convertmattonc.m A /issm/trunk-jpl/test/Data/loadnc.m\\
+Export determination: 6. \\
+Rationale: NEW: Converted test/Data/*.data to netcdf *.nc (and included Matlab conversion and loading functions).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#476} with diff file ISSM-13182-13183.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: do not include MEXLIB to compile python modules\\
+\vspace{3em}
+
+\noindent \textbf{Change \#477} with diff file ISSM-13183-13184.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: fixed python module compilation (missing symbols from libISSMCore.so)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#478} with diff file ISSM-13184-13185.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/adolc/doc\\
+Export determination: 6. \\
+Rationale: there is updated documentation distributed with the tool\\
+\vspace{3em}
+
+\noindent \textbf{Change \#479} with diff file ISSM-13185-13186.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am A /issm/trunk-jpl/src/c/classes/objects/Params/GenericParam.h M /issm/trunk-jpl/src/c/classes/objects/objects.h M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.h M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp A /issm/trunk-jpl/src/c/shared/Numerics/adolc\_edf.h M /issm/trunk-jpl/src/c/solutions/issm.cpp\\
+Export determination: 6. \\
+Rationale: NEW : register externally differentiated function for ADOL-C ; introduce a generic parameter class to hold a structure of such registry items\\
+\vspace{3em}
+
+\noindent \textbf{Change \#480} with diff file ISSM-13186-13187.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Params/GenericParam.h\\
+Export determination: 6. \\
+Rationale: CHG clarify comment\\
+\vspace{3em}
+
+\noindent \textbf{Change \#481} with diff file ISSM-13187-13188.diff: \\
+Function name: \\
+M /issm/trunk-jpl/Makefile.am M /issm/trunk-jpl/configure.ac\\
+Export determination: 6. \\
+Rationale: CHG - the reference to the once separate install of libtool is obsolete now that libtool and aclocal are in one install directory under autotools but I followed the recommendation of the tools to still add the local m4 dir to the include path.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#482} with diff file ISSM-13188-13189.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/netcdf/install-4.2.sh\\
+Export determination: 6. \\
+Rationale: CHG: no need to compile doc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#483} with diff file ISSM-13189-13190.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh M /issm/trunk-jpl/startup.py\\
+Export determination: 6. \\
+Rationale: CHG: python modules are now in lib/\\
+\vspace{3em}
+
+\noindent \textbf{Change \#484} with diff file ISSM-13190-13191.diff: \\
+Function name: \\
+M /issm/trunk-jpl/startup.py\\
+Export determination: 6. \\
+Rationale: BUG: materials has been renamed matice\\
+\vspace{3em}
+
+\noindent \textbf{Change \#485} with diff file ISSM-13191-13192.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/Makefile\\
+Export determination: 6. \\
+Rationale: CHG: remove qmu dirs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#486} with diff file ISSM-13192-13193.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/WriteData.py\\
+Export determination: 6. \\
+Rationale: CHG: class name might be provided\\
+\vspace{3em}
+
+\noindent \textbf{Change \#487} with diff file ISSM-13193-13194.diff: \\
+Function name: \\
+M /issm/trunk-jpl/startup.py\\
+Export determination: 6. \\
+Rationale: CHG: Added runme to startup.py.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#488} with diff file ISSM-13194-13195.diff: \\
+Function name: \\
+D /issm/trunk-jpl/test/NightlyRun/test999.py\\
+Export determination: 6. \\
+Rationale: CHG: deleted test999 (not needed anymore)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#489} with diff file ISSM-13195-13196.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.h M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: NEW - to trace the solver call for ADOLC call the wrapped solver through the EDF interface\\
+\vspace{3em}
+
+\noindent \textbf{Change \#490} with diff file ISSM-13196-13197.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.h M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: CHG: streamline the allocation of the temporary vector for the solution (single owner allocates \& deletes)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#491} with diff file ISSM-13197-13198.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: NEW: separate matlab and python reports (tbc)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#492} with diff file ISSM-13198-13199.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: NEW: added python tests in NR report\\
+\vspace{3em}
+
+\noindent \textbf{Change \#493} with diff file ISSM-13199-13200.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/model.py\\
+Export determination: 6. \\
+Rationale: BUG: Fix model.extrude for Python.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#494} with diff file ISSM-13200-13201.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: CHG: matlab error width\\
+\vspace{3em}
+
+\noindent \textbf{Change \#495} with diff file ISSM-13201-13202.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: BUG: display matlab's elapsed time\\
+\vspace{3em}
+
+\noindent \textbf{Change \#496} with diff file ISSM-13202-13203.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: CHG: making report smaller in size\\
+\vspace{3em}
+
+\noindent \textbf{Change \#497} with diff file ISSM-13203-13204.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: CHG: do not display Matlab error if there is no error\\
+\vspace{3em}
+
+\noindent \textbf{Change \#498} with diff file ISSM-13204-13205.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/dakota/install-pleiades.sh\\
+Export determination: 6. \\
+Rationale: CHG: reformat so script would run on pfe\\
+\vspace{3em}
+
+\noindent \textbf{Change \#499} with diff file ISSM-13205-13206.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh\\
+Export determination: 6. \\
+Rationale: CHG: update, we don't need plapack amd we need shared libs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#500} with diff file ISSM-13206-13207.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/dakota/install-macosx64.sh\\
+Export determination: 6. \\
+Rationale: CHG: update, we don't need plapack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#501} with diff file ISSM-13207-13208.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-macosx64-nicole.sh\\
+Export determination: 6. \\
+Rationale: CHG: update, we don't need plapack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#502} with diff file ISSM-13208-13209.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: fixed DYLD library path pre and append routines\\
+\vspace{3em}
+
+\noindent \textbf{Change \#503} with diff file ISSM-13209-13210.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: no such thing as a DYLD\_RUN\_PATH environment variable on mac\\
+\vspace{3em}
+
+\noindent \textbf{Change \#504} with diff file ISSM-13210-13211.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: CHG: simplified font style and align left\\
+\vspace{3em}
+
+\noindent \textbf{Change \#505} with diff file ISSM-13211-13212.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/AverageFilter/AverageFilter.h M /issm/trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h M /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.h M /issm/trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h M /issm/trunk-jpl/src/modules/Chaco/Chaco.h M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h M /issm/trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h M /issm/trunk-jpl/src/modules/EnumToString/EnumToString.h M /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h M /issm/trunk-jpl/src/modules/HoleFiller/HoleFiller.h M /issm/trunk-jpl/src/modules/InternalFront/InternalFront.h M /issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h M /issm/trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h M /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h M /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h M /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h M /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h M /issm/trunk-jpl/src/modules/Kriging/Kriging.h M /issm/trunk-jpl/src/modules/Ll2xy/Ll2xy.h M /issm/trunk-jpl/src/modules/MeshPartition/MeshPartition.h M /issm/trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h M /issm/trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h M /issm/trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h M /issm/trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h M /issm/trunk-jpl/src/modules/Scotch/Scotch.h M /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h M /issm/trunk-jpl/src/modules/StringToEnum/StringToEnum.h M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.h M /issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h M /issm/trunk-jpl/src/modules/TriaSearch/TriaSearch.h M /issm/trunk-jpl/src/modules/Xy2ll/Xy2ll.h\\
+Export determination: 6. \\
+Rationale: CHG: preparing modules for python compatibility\\
+\vspace{3em}
+
+\noindent \textbf{Change \#506} with diff file ISSM-13212-13213.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4\\
+Export determination: 6. \\
+Rationale: CHG: get svn to ignore these files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#507} with diff file ISSM-13213-13214.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/AverageFilter/AverageFilter.h M /issm/trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h M /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.h M /issm/trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h M /issm/trunk-jpl/src/modules/Chaco/Chaco.h M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h M /issm/trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h M /issm/trunk-jpl/src/modules/EnumToString/EnumToString.h M /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h M /issm/trunk-jpl/src/modules/HoleFiller/HoleFiller.h M /issm/trunk-jpl/src/modules/InternalFront/InternalFront.h M /issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h M /issm/trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h M /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h M /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h M /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h M /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h M /issm/trunk-jpl/src/modules/Kriging/Kriging.h M /issm/trunk-jpl/src/modules/Ll2xy/Ll2xy.h M /issm/trunk-jpl/src/modules/MeshPartition/MeshPartition.h M /issm/trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h M /issm/trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h M /issm/trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h M /issm/trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h M /issm/trunk-jpl/src/modules/Scotch/Scotch.h M /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h M /issm/trunk-jpl/src/modules/StringToEnum/StringToEnum.h M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.h M /issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h M /issm/trunk-jpl/src/modules/TriaSearch/TriaSearch.h M /issm/trunk-jpl/src/modules/Xy2ll/Xy2ll.h\\
+Export determination: 6. \\
+Rationale: CHG: preparing mex module conversion to python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#508} with diff file ISSM-13214-13215.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/AverageFilter/AverageFilter.h M /issm/trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h M /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.h M /issm/trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h M /issm/trunk-jpl/src/modules/Chaco/Chaco.h M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h M /issm/trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h M /issm/trunk-jpl/src/modules/EnumToString/EnumToString.cpp M /issm/trunk-jpl/src/modules/EnumToString/EnumToString.h M /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h M /issm/trunk-jpl/src/modules/HoleFiller/HoleFiller.h M /issm/trunk-jpl/src/modules/InternalFront/InternalFront.h M /issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h M /issm/trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h M /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h M /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h M /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h M /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h M /issm/trunk-jpl/src/modules/Kriging/Kriging.h M /issm/trunk-jpl/src/modules/Ll2xy/Ll2xy.h M /issm/trunk-jpl/src/modules/MeshPartition/MeshPartition.h M /issm/trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h M /issm/trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h M /issm/trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h M /issm/trunk-jpl/src/modules/Scotch/Scotch.h M /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h M /issm/trunk-jpl/src/modules/StringToEnum/StringToEnum.h M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.h M /issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h M /issm/trunk-jpl/src/modules/TriaSearch/TriaSearch.h M /issm/trunk-jpl/src/modules/Xy2ll/Xy2ll.h\\
+Export determination: 6. \\
+Rationale: CHG: preparing mex module conversion to python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#509} with diff file ISSM-13215-13216.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py A /issm/trunk-jpl/src/m/enum/GenericOptionEnum.m M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m\\
+Export determination: 6. \\
+Rationale: CHG: new GenericOptionEnum for the GenericOption object, which replaces all the Option objects we used to have.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#510} with diff file ISSM-13216-13217.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Container/Elements.cpp M /issm/trunk-jpl/src/c/Container/Observations.cpp M /issm/trunk-jpl/src/c/Container/Observations.h M /issm/trunk-jpl/src/c/Container/Options.cpp M /issm/trunk-jpl/src/c/Container/Options.h M /issm/trunk-jpl/src/c/Container/Parameters.cpp M /issm/trunk-jpl/src/c/Container/Parameters.h M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.h D /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/Matrix.h D /issm/trunk-jpl/src/c/classes/matrix/Vector.cpp M /issm/trunk-jpl/src/c/classes/matrix/Vector.h M /issm/trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h M /issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h M /issm/trunk-jpl/src/c/classes/objects/ElementResults/ElementResult.h M /issm/trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h M /issm/trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp M /issm/trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Element.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/Input.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h M /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp M /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Load.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.h M /issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp M /issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.h M /issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.h M /issm/trunk-jpl/src/c/classes/objects/Materials/Material.h M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/objects/Materials/Matice.h M /issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h M /issm/trunk-jpl/src/c/classes/objects/Node.cpp M /issm/trunk-jpl/src/c/classes/objects/Node.h A /issm/trunk-jpl/src/c/classes/objects/Options/GenericOption.h D /issm/trunk-jpl/src/c/classes/objects/Options/Option.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/Option.h D /issm/trunk-jpl/src/c/classes/objects/Options/OptionCell.cpp D /issm/trunk-jpl/src/c/classes/objects/Options/OptionCell.h D /issm/trunk-jpl/src/c/classes/objects/Options/OptionChar.cpp D /issm/trunk-jpl/src/c/classes/objects/Options/OptionChar.h D /issm/trunk-jpl/src/c/classes/objects/Options/OptionDouble.cpp D /issm/trunk-jpl/src/c/classes/objects/Options/OptionDouble.h D /issm/trunk-jpl/src/c/classes/objects/Options/OptionLogical.cpp D /issm/trunk-jpl/src/c/classes/objects/Options/OptionLogical.h D /issm/trunk-jpl/src/c/classes/objects/Options/OptionStruct.cpp D /issm/trunk-jpl/src/c/classes/objects/Options/OptionStruct.h M /issm/trunk-jpl/src/c/classes/objects/Params/BoolParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/FileParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/GenericParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/IntMatParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/IntParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/IntVecParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/MatrixParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/Param.h M /issm/trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/StringParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/TransientParam.h M /issm/trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp M /issm/trunk-jpl/src/c/classes/objects/Params/VectorParam.h M /issm/trunk-jpl/src/c/classes/objects/Vertex.cpp M /issm/trunk-jpl/src/c/classes/objects/Vertex.h M /issm/trunk-jpl/src/c/classes/objects/objects.h M /issm/trunk-jpl/src/c/io/Disk/diskio.h M /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToSeqMat.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToSeqVec.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp M /issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp M /issm/trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp M /issm/trunk-jpl/src/c/matlab/io/matlabio.h M /issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp M /issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp M /issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h M /issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp M /issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h M /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp M /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h M /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp M /issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp M /issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h M /issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp M /issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h M /issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp M /issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h M /issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp M /issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h M /issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp M /issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp M /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h M /issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp M /issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h M /issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp M /issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.h M /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp M /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h M /issm/trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h M /issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h M /issm/trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h M /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h 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/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp M /issm/trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h M /issm/trunk-jpl/src/c/modules/Orthx/Orthx.cpp M /issm/trunk-jpl/src/c/modules/Orthx/Orthx.h M /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp M /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h M /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp M /issm/trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.cpp M /issm/trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.h M /issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp M /issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h M /issm/trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp M /issm/trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h 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/modules/Solverx/Solverx.cpp M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.h M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp M /issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.h M /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp M /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h M /issm/trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp M /issm/trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h M /issm/trunk-jpl/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp M /issm/trunk-jpl/src/c/modules/VecMergex/VecMergex.cpp M /issm/trunk-jpl/src/c/modules/VecMergex/VecMergex.h M /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp M /issm/trunk-jpl/src/c/shared/Alloc/alloc.h M /issm/trunk-jpl/src/c/shared/Exp/IsInPoly.cpp M /issm/trunk-jpl/src/c/shared/Exp/exp.h M /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp M /issm/trunk-jpl/src/c/solutions/ResetBoundaryConditions.cpp M /issm/trunk-jpl/src/c/solutions/convergence.cpp M /issm/trunk-jpl/src/c/solutions/gradient\_core.cpp M /issm/trunk-jpl/src/c/solutions/solutions.h M /issm/trunk-jpl/src/c/solvers/solver\_adjoint\_linear.cpp M /issm/trunk-jpl/src/c/solvers/solver\_linear.cpp M /issm/trunk-jpl/src/c/solvers/solver\_newton.cpp M /issm/trunk-jpl/src/c/solvers/solver\_nonlinear.cpp M /issm/trunk-jpl/src/c/solvers/solver\_stokescoupling\_nonlinear.cpp M /issm/trunk-jpl/src/c/solvers/solver\_thermal\_nonlinear.cpp M /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.h M /issm/trunk-jpl/src/c/toolkits/issm/SeqVec.h M /issm/trunk-jpl/src/c/toolkits/issm/issmtoolkit.h M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp M /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp M /issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp M /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp M /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp M /issm/trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp\\
+Export determination: 6. \\
+Rationale: NEW: large change to the code, to adapt to ADOLC requirements. This change relates to the introduction of template classes and functions for the Option.h abstract class. This is needed, because we want to make the Matlab API independent from the libCore objects, which are dependent on the IssmDouble* ADOLC type (adouble), when the Matlab API is dependent on the IssmPDouble* type (double). To make them independent, we need to be able to specify at run time Options, Matrix and Vector objects that hold either IssmDouble or IssmPDouble objects. The only way to do that is through the use of templated classes for Option.h, Matrix and Vector. The change gets rid of a lot of useless code (especially in the classes/objects/Options directory), by introducing template versions of the same code. The bulk of the changes to src/modules and src/mex modules is to adapt to this new runtime declaration of templated Matrix, Vector and Option objects.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#511} with diff file ISSM-13217-13218.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Options/GenericOption.h\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics: no more than ONE blank line please...\\
+\vspace{3em}
+
+\noindent \textbf{Change \#512} with diff file ISSM-13218-13219.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: CHG: minor style change\\
+\vspace{3em}
+
+\noindent \textbf{Change \#513} with diff file ISSM-13219-13220.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/modules/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: shielding krigging and kml modules from compile in adolc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#514} with diff file ISSM-13220-13221.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/matrix/Matrix.h D /issm/trunk-jpl/src/c/classes/objects/Contour.cpp M /issm/trunk-jpl/src/c/classes/objects/Contour.h D /issm/trunk-jpl/src/c/classes/objects/Segment.cpp M /issm/trunk-jpl/src/c/classes/objects/Segment.h M /issm/trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp M /issm/trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.h M /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp M /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h M /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp M /issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp M /issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h M /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h D /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp M /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h M /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp M /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp M /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h M /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshSegmentsIntersection.cpp M /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp M /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h M /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp M /issm/trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp M /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp M /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h D /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp M /issm/trunk-jpl/src/c/shared/Exp/IsInPoly.cpp M /issm/trunk-jpl/src/c/shared/Exp/exp.h M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp M /issm/trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp\\
+Export determination: 6. \\
+Rationale: CHG: adjustments to compile the Matlab and Python modules when ADOLC is on. Had to template MeshPartitionx, because it's used in both modules and the core code. Had to template Contour too, same reason. Had to default to ISSMPDouble type for modules such as InterpFromMesh2d* InterpFromGridToMeshx*, etc ..., which only show up in the Matlab modules.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#515} with diff file ISSM-13221-13222.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-macosx64-larour-ad.sh\\
+Export determination: 6. \\
+Rationale: CHG: new configuration to avoid trouble with KML and KRIGING modules in ADOLC mode\\
+\vspace{3em}
+
+\noindent \textbf{Change \#516} with diff file ISSM-13222-13223.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/IoModel.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetic\\
+\vspace{3em}
+
+\noindent \textbf{Change \#517} with diff file ISSM-13223-13224.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/gdal/install-murdo.sh\\
+Export determination: 6. \\
+Rationale: ADD: new murdo configuration\\
+\vspace{3em}
+
+\noindent \textbf{Change \#518} with diff file ISSM-13224-13225.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh\\
+Export determination: 6. \\
+Rationale: CHG: stop install from tripping if F90 or F90FLAGS is defined. Temporarily unset these variables\\
+\vspace{3em}
+
+\noindent \textbf{Change \#519} with diff file ISSM-13225-13226.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#520} with diff file ISSM-13226-13227.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/WritePythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h\\
+Export determination: 6. \\
+Rationale: CHG: fixed compilation as Matrix and Vectors are now templates\\
+\vspace{3em}
+
+\noindent \textbf{Change \#521} with diff file ISSM-13227-13228.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp M /issm/trunk-jpl/src/c/matlab/io/matlabio.h M /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp M /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h\\
+Export determination: 6. \\
+Rationale: CHG: make sure we are writing SeqMat and SeqVec for matlab in order to disconnect petsc from modules\\
+\vspace{3em}
+
+\noindent \textbf{Change \#522} with diff file ISSM-13228-13229.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp\\
+Export determination: 6. \\
+Rationale: CHG: make sure we are writing SeqMat and SeqVec for matlab in order to disconnect petsc from modules\\
+\vspace{3em}
+
+\noindent \textbf{Change \#523} with diff file ISSM-13229-13230.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/matrix/Vector.h M /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp M /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h M /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp M /issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp M /issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h M /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h M /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h M /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp M /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h M /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp M /issm/trunk-jpl/src/c/shared/Exp/exp.h D /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp D /issm/trunk-jpl/src/c/toolkits/issm/SeqVec.cpp M /issm/trunk-jpl/src/c/toolkits/issm/SeqVec.h M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp M /issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp M /issm/trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\\
+Export determination: 6. \\
+Rationale: CHG: make sure we are using SeqVec so that we can disconnect PETSc from matlab and python modules\\
+\vspace{3em}
+
+\noindent \textbf{Change \#524} with diff file ISSM-13230-13231.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutions/controltao\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed tao compilation with new template matrix\\
+\vspace{3em}
+
+\noindent \textbf{Change \#525} with diff file ISSM-13231-13232.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/matlab/include/matlab\_macros.h M /issm/trunk-jpl/src/c/shared/Wrapper/ModuleBoot.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removing PetscInitialize and PetscFinalize from matlab and python modules\\
+\vspace{3em}
+
+\noindent \textbf{Change \#526} with diff file ISSM-13232-13233.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutions/controltao\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: Vector is now a template (tao)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#527} with diff file ISSM-13233-13234.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Par/79North.par M /issm/trunk-jpl/test/Par/ISMIPE.par M /issm/trunk-jpl/test/Par/Pig.par M /issm/trunk-jpl/test/Par/SquareSheetConstrained.par M /issm/trunk-jpl/test/Par/SquareSheetShelf.par M /issm/trunk-jpl/test/Par/SquareShelf.par M /issm/trunk-jpl/test/Par/SquareShelfConstrained.par\\
+Export determination: 6. \\
+Rationale: CHG: matlab parameter files now use .nc data files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#528} with diff file ISSM-13234-13235.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Par/Pig.par M /issm/trunk-jpl/test/Par/SquareSheetConstrained.par M /issm/trunk-jpl/test/Par/SquareSheetShelf.par M /issm/trunk-jpl/test/Par/SquareShelf.par M /issm/trunk-jpl/test/Par/SquareShelfConstrained.par\\
+Export determination: 6. \\
+Rationale: CHG: minor alignment\\
+\vspace{3em}
+
+\noindent \textbf{Change \#529} with diff file ISSM-13235-13236.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/AverageFilter/AverageFilter.h M /issm/trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h M /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.h M /issm/trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h M /issm/trunk-jpl/src/modules/Chaco/Chaco.h M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h M /issm/trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h M /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h M /issm/trunk-jpl/src/modules/HoleFiller/HoleFiller.h M /issm/trunk-jpl/src/modules/InternalFront/InternalFront.h M /issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h M /issm/trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h M /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h M /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h M /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h M /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h M /issm/trunk-jpl/src/modules/Kriging/Kriging.h M /issm/trunk-jpl/src/modules/Ll2xy/Ll2xy.h M /issm/trunk-jpl/src/modules/MeshPartition/MeshPartition.h M /issm/trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h M /issm/trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h M /issm/trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h M /issm/trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h M /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.h M /issm/trunk-jpl/src/modules/TriaSearch/TriaSearch.h M /issm/trunk-jpl/src/modules/Xy2ll/Xy2ll.h\\
+Export determination: 6. \\
+Rationale: CHG: preparing header files for python inclusion\\
+\vspace{3em}
+
+\noindent \textbf{Change \#530} with diff file ISSM-13236-13237.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/AverageFilter/AverageFilter.cpp M /issm/trunk-jpl/src/modules/AverageFilter/AverageFilter.h M /issm/trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp M /issm/trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h M /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp M /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.h M /issm/trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.cpp M /issm/trunk-jpl/src/modules/BamgTriangulate/BamgTriangulate.h M /issm/trunk-jpl/src/modules/Chaco/Chaco.cpp M /issm/trunk-jpl/src/modules/Chaco/Chaco.h M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h M /issm/trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.cpp M /issm/trunk-jpl/src/modules/ElementConnectivity/ElementConnectivity.h M /issm/trunk-jpl/src/modules/EnumToString/EnumToString.cpp M /issm/trunk-jpl/src/modules/EnumToString/EnumToString.h M /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp M /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.h M /issm/trunk-jpl/src/modules/HoleFiller/HoleFiller.cpp M /issm/trunk-jpl/src/modules/HoleFiller/HoleFiller.h M /issm/trunk-jpl/src/modules/InternalFront/InternalFront.cpp M /issm/trunk-jpl/src/modules/InternalFront/InternalFront.h M /issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp M /issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.h M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp M /issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.h M /issm/trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp M /issm/trunk-jpl/src/modules/InterpFromMeshToGrid/InterpFromMeshToGrid.h M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp M /issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h M /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp M /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.h M /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp M /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.h M /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp M /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.h M /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp M /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.h M /issm/trunk-jpl/src/modules/Kriging/Kriging.cpp M /issm/trunk-jpl/src/modules/Kriging/Kriging.h M /issm/trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp M /issm/trunk-jpl/src/modules/Ll2xy/Ll2xy.h M /issm/trunk-jpl/src/modules/MeshPartition/MeshPartition.cpp M /issm/trunk-jpl/src/modules/MeshPartition/MeshPartition.h M /issm/trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp M /issm/trunk-jpl/src/modules/MeshProfileIntersection/MeshProfileIntersection.h M /issm/trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.cpp M /issm/trunk-jpl/src/modules/NodeConnectivity/NodeConnectivity.h M /issm/trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp M /issm/trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.h M /issm/trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp M /issm/trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h M /issm/trunk-jpl/src/modules/Scotch/Scotch.cpp M /issm/trunk-jpl/src/modules/Scotch/Scotch.h M /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp M /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.h M /issm/trunk-jpl/src/modules/StringToEnum/StringToEnum.cpp M /issm/trunk-jpl/src/modules/StringToEnum/StringToEnum.h M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.h M /issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp M /issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h M /issm/trunk-jpl/src/modules/TriaSearch/TriaSearch.cpp M /issm/trunk-jpl/src/modules/TriaSearch/TriaSearch.h M /issm/trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp M /issm/trunk-jpl/src/modules/Xy2ll/Xy2ll.h\\
+Export determination: 6. \\
+Rationale: CHG: preparing files for python inclusion\\
+\vspace{3em}
+
+\noindent \textbf{Change \#531} with diff file ISSM-13237-13238.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/c/EnumDefinitions/EnumToModelField.cpp\\
+Export determination: 6. \\
+Rationale: not needed anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#532} with diff file ISSM-13238-13239.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Par/SquareShelfConstrained.py\\
+Export determination: 6. \\
+Rationale: CHG: Changed python par file to use nc data file.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#533} with diff file ISSM-13239-13240.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/model.m A /issm/trunk-jpl/src/m/classes/oldclasses A /issm/trunk-jpl/src/m/classes/oldclasses/README A /issm/trunk-jpl/src/m/classes/oldclasses/materials.m\\
+Export determination: 6. \\
+Rationale: BUG: allow md.materials to be loaded even for old models\\
+\vspace{3em}
+
+\noindent \textbf{Change \#534} with diff file ISSM-13240-13241.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/matice.m\\
+Export determination: 6. \\
+Rationale: CHG: added constructor to materials, so that it can load old structures\\
+\vspace{3em}
+
+\noindent \textbf{Change \#535} with diff file ISSM-13241-13242.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/qmu/sensitivities.m\\
+Export determination: 6. \\
+Rationale: CHG: getting rid of EnumToModelField, which has not been working for almost a year\\
+\vspace{3em}
+
+\noindent \textbf{Change \#536} with diff file ISSM-13242-13243.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp M /issm/trunk-jpl/src/c/matlab/io/matlabio.h M /issm/trunk-jpl/src/c/python/io/WritePythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h\\
+Export determination: 6. \\
+Rationale: NEW: added support for writing BamgMesh and BamgGeom (to be completed)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#537} with diff file ISSM-13243-13244.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.cpp M /issm/trunk-jpl/src/modules/BamgConvertMesh/BamgConvertMesh.h M /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp M /issm/trunk-jpl/src/modules/matlab/Makefile.am M /issm/trunk-jpl/src/modules/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: NEW: compiling BamgConvertMesh in python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#538} with diff file ISSM-13244-13245.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/parameterization/setflowequation.py\\
+Export determination: 6. \\
+Rationale: BUG: Boolean must be converted to integer before adding in Python.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#539} with diff file ISSM-13245-13246.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/test104.py\\
+Export determination: 6. \\
+Rationale: NEW: Added working test104.py.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#540} with diff file ISSM-13246-13247.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/adic/install.sh M /issm/trunk-jpl/externalpackages/adolc/install-dev.sh M /issm/trunk-jpl/externalpackages/adolc/install.sh M /issm/trunk-jpl/externalpackages/android/android-ndk/install.sh M /issm/trunk-jpl/externalpackages/android/android-sdk/install.sh M /issm/trunk-jpl/externalpackages/angel/install.sh M /issm/trunk-jpl/externalpackages/appscan/install.sh M /issm/trunk-jpl/externalpackages/apr/install.sh M /issm/trunk-jpl/externalpackages/apr-util/install.sh M /issm/trunk-jpl/externalpackages/aspell/install.sh M /issm/trunk-jpl/externalpackages/bbftp/install.sh M /issm/trunk-jpl/externalpackages/blas/install-linux64.sh M /issm/trunk-jpl/externalpackages/boost/install.sh M /issm/trunk-jpl/externalpackages/bsdtar/install-win7.sh M /issm/trunk-jpl/externalpackages/cccl/install-win7.orig.sh M /issm/trunk-jpl/externalpackages/cccl/install-win7.sh M /issm/trunk-jpl/externalpackages/chaco/install.sh M /issm/trunk-jpl/externalpackages/cmake/install.sh M /issm/trunk-jpl/externalpackages/colpack/install.sh M /issm/trunk-jpl/externalpackages/cppcheck/install.sh M /issm/trunk-jpl/externalpackages/dace/install.sh M /issm/trunk-jpl/externalpackages/dakota/install-altix64-cosmos.sh M /issm/trunk-jpl/externalpackages/dakota/install-discover.sh M /issm/trunk-jpl/externalpackages/dakota/install-linux64-astrid.sh M /issm/trunk-jpl/externalpackages/dakota/install-linux64-murdo.sh M /issm/trunk-jpl/externalpackages/dakota/install-macosx64.sh M /issm/trunk-jpl/externalpackages/dakota/install-pleiades.sh M /issm/trunk-jpl/externalpackages/distribute/install.sh M /issm/trunk-jpl/externalpackages/doxygen/install.sh M /issm/trunk-jpl/externalpackages/esmf/install.sh M /issm/trunk-jpl/externalpackages/findbugs/install.sh M /issm/trunk-jpl/externalpackages/flaim/install.sh M /issm/trunk-jpl/externalpackages/freetype/install.sh M /issm/trunk-jpl/externalpackages/gdal/install-murdo.sh M /issm/trunk-jpl/externalpackages/gdal/install.sh M /issm/trunk-jpl/externalpackages/gdaltokmz/install.sh M /issm/trunk-jpl/externalpackages/geos5/install.sh M /issm/trunk-jpl/externalpackages/git/install.sh M /issm/trunk-jpl/externalpackages/gmake/install.sh M /issm/trunk-jpl/externalpackages/googleearthtoolbox/install.sh M /issm/trunk-jpl/externalpackages/graphviz/install.sh M /issm/trunk-jpl/externalpackages/gsl/install-android.sh M /issm/trunk-jpl/externalpackages/gsl/install-linux64.sh M /issm/trunk-jpl/externalpackages/gsl/install-macosx64.sh M /issm/trunk-jpl/externalpackages/gsl/install-pleiades.sh M /issm/trunk-jpl/externalpackages/gslib/install.sh M /issm/trunk-jpl/externalpackages/h5py/install.sh M /issm/trunk-jpl/externalpackages/hdf5/install.sh M /issm/trunk-jpl/externalpackages/ipython/install.sh M /issm/trunk-jpl/externalpackages/kml/install.sh M /issm/trunk-jpl/externalpackages/lapack/install-linux64.sh M /issm/trunk-jpl/externalpackages/latex2rtf/install.sh M /issm/trunk-jpl/externalpackages/libermate/install.sh M /issm/trunk-jpl/externalpackages/libpng/install.sh M /issm/trunk-jpl/externalpackages/m2html/install.sh M /issm/trunk-jpl/externalpackages/matlab/install.sh M /issm/trunk-jpl/externalpackages/matplotlib/install-osx.sh M /issm/trunk-jpl/externalpackages/matplotlib/install.sh M /issm/trunk-jpl/externalpackages/mercurial/install.sh M /issm/trunk-jpl/externalpackages/metis/install-4.0-altix64.sh M /issm/trunk-jpl/externalpackages/metis/install-4.0-cosmos.sh M /issm/trunk-jpl/externalpackages/metis/install-4.0-discover.sh M /issm/trunk-jpl/externalpackages/metis/install-4.0-greenplanet.sh M /issm/trunk-jpl/externalpackages/metis/install-4.0-linux64.sh M /issm/trunk-jpl/externalpackages/metis/install-4.0-macosx32.sh M /issm/trunk-jpl/externalpackages/metis/install-4.0-macosx64.sh M /issm/trunk-jpl/externalpackages/metis/install-4.0-pleiades.sh M /issm/trunk-jpl/externalpackages/metis/install-4.0-win32.sh M /issm/trunk-jpl/externalpackages/metis/install-4.0-win7.sh M /issm/trunk-jpl/externalpackages/metis/install-5.0.1-linux64.sh M /issm/trunk-jpl/externalpackages/mitgcm/install.sh M /issm/trunk-jpl/externalpackages/modelE/install.sh M /issm/trunk-jpl/externalpackages/modules/install-macosx64.sh M /issm/trunk-jpl/externalpackages/modules/install.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh M /issm/trunk-jpl/externalpackages/ncview/install.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.0.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.2.sh M /issm/trunk-jpl/externalpackages/netcdf-python/install.sh M /issm/trunk-jpl/externalpackages/nose/install-linux64.sh M /issm/trunk-jpl/externalpackages/octave/install.sh M /issm/trunk-jpl/externalpackages/oofem/install.sh M /issm/trunk-jpl/externalpackages/openanalysis/install.sh M /issm/trunk-jpl/externalpackages/packagemaker/install.sh M /issm/trunk-jpl/externalpackages/pcre/install.sh M /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-altix64-castor.sh M /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-cosmos.sh M /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-linux64-astrid.sh M /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-eric.sh M /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-ogive.sh M /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx64.sh M /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-pleiades.sh M /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-win32-eric.sh M /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-win7.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.1-altix64-castor.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.1-cosmos.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.1-linux64-astrid.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.1-macosx32-mathieu.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.1-macosx32-ogive.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.1-pleiades.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.1-ubuntu64.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.1-win7.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.2-discover.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.2-greenplanet.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.3-linux64.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.3-macosx64.sh M /issm/trunk-jpl/externalpackages/petsc/install-dev-linux64.sh M /issm/trunk-jpl/externalpackages/petsc/install-dev-pleiades.sh M /issm/trunk-jpl/externalpackages/polygonclipper/install.sh M /issm/trunk-jpl/externalpackages/pyclips/install.sh M /issm/trunk-jpl/externalpackages/pysvn/install.sh M /issm/trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh M /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh M /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh M /issm/trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh M /issm/trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh M /issm/trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh M /issm/trunk-jpl/externalpackages/qhull/install.sh M /issm/trunk-jpl/externalpackages/rats/install.sh M /issm/trunk-jpl/externalpackages/readline/install.sh M /issm/trunk-jpl/externalpackages/rose/install.sh M /issm/trunk-jpl/externalpackages/satstress/install.sh M /issm/trunk-jpl/externalpackages/scipy/install-macosx-lion.sh M /issm/trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh M /issm/trunk-jpl/externalpackages/scotch/install.sh M /issm/trunk-jpl/externalpackages/shapelib/install.sh M /issm/trunk-jpl/externalpackages/slepc/install.sh M /issm/trunk-jpl/externalpackages/sqlite/install.sh M /issm/trunk-jpl/externalpackages/svn/install.sh M /issm/trunk-jpl/externalpackages/swig/install.sh M /issm/trunk-jpl/externalpackages/tao/install-2.0.sh M /issm/trunk-jpl/externalpackages/tao/install-2.1.sh M /issm/trunk-jpl/externalpackages/tcl/install.sh M /issm/trunk-jpl/externalpackages/tclx/install.sh M /issm/trunk-jpl/externalpackages/tex2im/install.sh M /issm/trunk-jpl/externalpackages/tk/install.sh M /issm/trunk-jpl/externalpackages/triangle/install-altix64.sh M /issm/trunk-jpl/externalpackages/triangle/install-android.sh M /issm/trunk-jpl/externalpackages/triangle/install-discover.sh M /issm/trunk-jpl/externalpackages/triangle/install-linux64.sh M /issm/trunk-jpl/externalpackages/triangle/install-macosx32.sh M /issm/trunk-jpl/externalpackages/triangle/install-macosx64.sh M /issm/trunk-jpl/externalpackages/triangle/install-pleiades.sh M /issm/trunk-jpl/externalpackages/triangle/install-win32.sh M /issm/trunk-jpl/externalpackages/triangle/install-win7.sh M /issm/trunk-jpl/externalpackages/valgrind/install-altix64.sh M /issm/trunk-jpl/externalpackages/valgrind/install-linux64.sh M /issm/trunk-jpl/externalpackages/valgrind/install-macosx32.sh M /issm/trunk-jpl/externalpackages/valgrind/install-macosx64.sh M /issm/trunk-jpl/externalpackages/valgrind/install-win32.sh M /issm/trunk-jpl/externalpackages/vim/install.sh M /issm/trunk-jpl/externalpackages/windows/install.sh M /issm/trunk-jpl/externalpackages/xaifbooster/install.sh M /issm/trunk-jpl/externalpackages/xerces/install.sh M /issm/trunk-jpl/externalpackages/yams/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: added set -eu in all installation files to stop if an error occurs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#541} with diff file ISSM-13247-13248.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/matlab/install.sh M /issm/trunk-jpl/externalpackages/triangle/install-pleiades.sh\\
+Export determination: 6. \\
+Rationale: BUG: minor fixed small mistakes introduced\\
+\vspace{3em}
+
+\noindent \textbf{Change \#542} with diff file ISSM-13248-13249.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp M /issm/trunk-jpl/src/c/shared/Alloc/alloc.h M /issm/trunk-jpl/src/c/shared/Alloc/xNewDelete.h M /issm/trunk-jpl/src/c/shared/TriMesh/SplitMeshForRifts.cpp M /issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp\\
+Export determination: 6. \\
+Rationale: CHG: getting rid of xmalloc xcalloc and xrealloc. Use xNew xNewInit and xReNew\\
+\vspace{3em}
+
+\noindent \textbf{Change \#543} with diff file ISSM-13249-13250.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/adic/install.sh M /issm/trunk-jpl/externalpackages/adolc/install.sh M /issm/trunk-jpl/externalpackages/apr/install.sh M /issm/trunk-jpl/externalpackages/apr-util/install.sh M /issm/trunk-jpl/externalpackages/chaco/install.sh M /issm/trunk-jpl/externalpackages/cmake/install.sh M /issm/trunk-jpl/externalpackages/colpack/install.sh M /issm/trunk-jpl/externalpackages/cppcheck/install.sh M /issm/trunk-jpl/externalpackages/dakota/install-altix64-cosmos.sh M /issm/trunk-jpl/externalpackages/dakota/install-discover.sh M /issm/trunk-jpl/externalpackages/dakota/install-linux64-astrid.sh M /issm/trunk-jpl/externalpackages/dakota/install-linux64-murdo.sh M /issm/trunk-jpl/externalpackages/dakota/install-macosx64.sh M /issm/trunk-jpl/externalpackages/dakota/install-pleiades.sh M /issm/trunk-jpl/externalpackages/doxygen/install.sh M /issm/trunk-jpl/externalpackages/esmf/install.sh M /issm/trunk-jpl/externalpackages/freetype/install.sh M /issm/trunk-jpl/externalpackages/gdal/install-murdo.sh M /issm/trunk-jpl/externalpackages/gdal/install.sh M /issm/trunk-jpl/externalpackages/gmake/install.sh M /issm/trunk-jpl/externalpackages/graphviz/install.sh M /issm/trunk-jpl/externalpackages/gsl/install-android.sh M /issm/trunk-jpl/externalpackages/gsl/install-linux64.sh M /issm/trunk-jpl/externalpackages/gsl/install-macosx64.sh M /issm/trunk-jpl/externalpackages/gsl/install-pleiades.sh M /issm/trunk-jpl/externalpackages/hdf5/install.sh M /issm/trunk-jpl/externalpackages/lapack/install-linux64.sh M /issm/trunk-jpl/externalpackages/libpng/install.sh M /issm/trunk-jpl/externalpackages/modules/install-macosx64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.0.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.2.sh M /issm/trunk-jpl/externalpackages/octave/install.sh M /issm/trunk-jpl/externalpackages/oofem/install.sh M /issm/trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh M /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh M /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh M /issm/trunk-jpl/externalpackages/python/install-3.2.2-linux64.sh M /issm/trunk-jpl/externalpackages/python/install-3.2.2-macosx-lion.sh M /issm/trunk-jpl/externalpackages/python/install-3.2.2-macosx-snowleopard.sh M /issm/trunk-jpl/externalpackages/rose/install.sh M /issm/trunk-jpl/externalpackages/shapelib/install.sh M /issm/trunk-jpl/externalpackages/slepc/install.sh M /issm/trunk-jpl/externalpackages/sqlite/install.sh M /issm/trunk-jpl/externalpackages/svn/install.sh M /issm/trunk-jpl/externalpackages/swig/install.sh M /issm/trunk-jpl/externalpackages/tcl/install.sh M /issm/trunk-jpl/externalpackages/tclx/install.sh M /issm/trunk-jpl/externalpackages/tk/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: fixed installation scripts when checking for number of inputs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#544} with diff file ISSM-13250-13251.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/Chaco/Chaco.cpp M /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp M /issm/trunk-jpl/src/modules/InternalFront/InternalFront.cpp M /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp M /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp M /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp M /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp M /issm/trunk-jpl/src/modules/Kriging/Kriging.cpp M /issm/trunk-jpl/src/modules/PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp M /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp\\
+Export determination: 6. \\
+Rationale: CHG: getting rid of xfree\\
+\vspace{3em}
+
+\noindent \textbf{Change \#545} with diff file ISSM-13251-13252.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp M /issm/trunk-jpl/src/c/shared/Alloc/alloc.h\\
+Export determination: 6. \\
+Rationale: CHG: getting rid of xfree\\
+\vspace{3em}
+
+\noindent \textbf{Change \#546} with diff file ISSM-13252-13253.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh\\
+Export determination: 6. \\
+Rationale: BUG: fixed python patch for 2.7 snowleopard\\
+\vspace{3em}
+
+\noindent \textbf{Change \#547} with diff file ISSM-13253-13254.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/blas/configs/macosx64 (from /issm/trunk-jpl/externalpackages/blas/configs/linux64:13241) A /issm/trunk-jpl/externalpackages/blas/install-macosx64.sh\\
+Export determination: 6. \\
+Rationale: NEW: added macosx installation for blas\\
+\vspace{3em}
+
+\noindent \textbf{Change \#548} with diff file ISSM-13254-13255.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/matice.m\\
+Export determination: 6. \\
+Rationale: BUG: need to loop through num fields\\
+\vspace{3em}
+
+\noindent \textbf{Change \#549} with diff file ISSM-13255-13256.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/bamg/Geometry.cpp M /issm/trunk-jpl/src/c/modules/Bamgx/Bamgx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: ADOLC not needed in these files.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#550} with diff file ISSM-13256-13257.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-linux64-ad.sh M /issm/trunk-jpl/configs/config-linux64-astrid-ad.sh M /issm/trunk-jpl/lib M /issm/trunk-jpl/src/modules/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: missing Adolc libraries in matlab modules. Homogeneized configuration files for ad. In lib: get svn to ignore some files.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#551} with diff file ISSM-13257-13258.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/adolc\\
+Export determination: 6. \\
+Rationale: CHG: get svn to ignore some files.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#552} with diff file ISSM-13258-13259.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive3001.nc A /issm/trunk-jpl/test/Archives/Archive3002.nc A /issm/trunk-jpl/test/Archives/Archive3003.nc A /issm/trunk-jpl/test/Archives/Archive3004.nc A /issm/trunk-jpl/test/Archives/Archive3005.nc A /issm/trunk-jpl/test/Archives/Archive3006.nc A /issm/trunk-jpl/test/Archives/Archive3007.nc A /issm/trunk-jpl/test/Archives/Archive3008.nc A /issm/trunk-jpl/test/Archives/Archive3009.nc A /issm/trunk-jpl/test/Archives/Archive3010.nc M /issm/trunk-jpl/test/NightlyRun/IdToName.m M /issm/trunk-jpl/test/NightlyRun/IdToName.py M /issm/trunk-jpl/test/NightlyRun/runme.m M /issm/trunk-jpl/test/NightlyRun/test3001.m A /issm/trunk-jpl/test/NightlyRun/test3002.m A /issm/trunk-jpl/test/NightlyRun/test3003.m A /issm/trunk-jpl/test/NightlyRun/test3004.m A /issm/trunk-jpl/test/NightlyRun/test3005.m A /issm/trunk-jpl/test/NightlyRun/test3006.m A /issm/trunk-jpl/test/NightlyRun/test3007.m A /issm/trunk-jpl/test/NightlyRun/test3008.m A /issm/trunk-jpl/test/NightlyRun/test3009.m A /issm/trunk-jpl/test/NightlyRun/test3010.m\\
+Export determination: 6. \\
+Rationale: Added test3000 to test3010, for adolc benchmark + archives + mod to runme.m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#553} with diff file ISSM-13259-13260.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: CHG: typo in html report (</span)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#554} with diff file ISSM-13260-13261.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-altix64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-linux64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-macosx32.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.0.2-win32.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.3.1-linux64-berg.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-linux64.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh M /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx64.sh\\
+Export determination: 6. \\
+Rationale: CHG: removed set -eu in mpich2\\
+\vspace{3em}
+
+\noindent \textbf{Change \#555} with diff file ISSM-13261-13262.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Container/Observations.cpp M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.h M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed Kriging with new solver prototype\\
+\vspace{3em}
+
+\noindent \textbf{Change \#556} with diff file ISSM-13262-13263.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/lapack/configs/macosx64 A /issm/trunk-jpl/externalpackages/lapack/configs/macosx64/make.inc A /issm/trunk-jpl/externalpackages/lapack/install-macosx64.sh\\
+Export determination: 6. \\
+Rationale: NEW: added macosx64 installation for lapack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#557} with diff file ISSM-13263-13264.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/nose/install-linux64-python2.sh (from /issm/trunk-jpl/externalpackages/nose/install-linux64.sh:13262) A /issm/trunk-jpl/externalpackages/nose/install-linux64-python3.sh D /issm/trunk-jpl/externalpackages/nose/install-linux64.sh A /issm/trunk-jpl/externalpackages/nose/install-macosx64-python2.sh A /issm/trunk-jpl/externalpackages/nose/install-macosx64-python3.sh (from /issm/trunk-jpl/externalpackages/nose/install-macosx64sh:13262) D /issm/trunk-jpl/externalpackages/nose/install-macosx64sh\\
+Export determination: 6. \\
+Rationale: CHG: cleaned nose installation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#558} with diff file ISSM-13264-13265.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/numpy (from /issm/trunk-jpl/externalpackages/scipy:13241) M /issm/trunk-jpl/externalpackages/numpy/install-linux64.sh R /issm/trunk-jpl/externalpackages/numpy/install-macosx-lion.sh (from /issm/trunk-jpl/externalpackages/scipy/install-macosx-lion.sh:13246) R /issm/trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh (from /issm/trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh:13246) M /issm/trunk-jpl/externalpackages/scipy/install-linux64.sh M /issm/trunk-jpl/externalpackages/scipy/install-macosx-lion.sh M /issm/trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh\\
+Export determination: 6. \\
+Rationale: CHG: created numpy package separated from scipy\\
+\vspace{3em}
+
+\noindent \textbf{Change \#559} with diff file ISSM-13265-13266.diff: \\
+Function name: \\
+D /issm/trunk-jpl/test/Data/79North.data D /issm/trunk-jpl/test/Data/ISMIPE.data D /issm/trunk-jpl/test/Data/Pig.data D /issm/trunk-jpl/test/Data/SquareSheetConstrained.data D /issm/trunk-jpl/test/Data/SquareSheetShelf.data D /issm/trunk-jpl/test/Data/SquareShelf.data D /issm/trunk-jpl/test/Data/SquareShelfConstrained.data\\
+Export determination: 6. \\
+Rationale: CHG: now use .nc data in Nightly runs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#560} with diff file ISSM-13266-13267.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh\\
+Export determination: 6. \\
+Rationale: CHG: minor mac installation of python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#561} with diff file ISSM-13267-13268.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Container/Observations.cpp M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/classes/objects/Options/Option.h M /issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp M /issm/trunk-jpl/src/c/matlab/io/matlabio.h M /issm/trunk-jpl/src/c/solutions/kriging.cpp\\
+Export determination: 6. \\
+Rationale: NEW: enable Double option (not merged with DoubleArray options)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#562} with diff file ISSM-13268-13269.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/classes/IoModel.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp A /issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff A /issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/c/solutions/issm.cpp M /issm/trunk-jpl/src/m/classes/autodiff.m A /issm/trunk-jpl/src/m/enum/AutodiffDependentsEnum.m A /issm/trunk-jpl/src/m/enum/AutodiffIndependentsEnum.m A /issm/trunk-jpl/src/m/enum/AutodiffNumDependentsEnum.m A /issm/trunk-jpl/src/m/enum/AutodiffNumIndependentsEnum.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m\\
+Export determination: 6. \\
+Rationale: CHG: introducing the autodiff matlab API.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#563} with diff file ISSM-13269-13270.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/WritePythonData.cpp\\
+Export determination: 6. \\
+Rationale: NEW: Added python WriteData for bamg objects.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#564} with diff file ISSM-13270-13271.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/bamggeom.py A /issm/trunk-jpl/src/m/classes/bamgmesh.py A /issm/trunk-jpl/src/m/mesh/meshconvert.py\\
+Export determination: 6. \\
+Rationale: NEW: Added python bamggeom and bamgmesh classes and added python meshconvert function.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#565} with diff file ISSM-13271-13272.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/autodiff.m\\
+Export determination: 6. \\
+Rationale: BUG: do not marshal autodiff if not required\\
+\vspace{3em}
+
+\noindent \textbf{Change \#566} with diff file ISSM-13272-13273.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: NEW: Added NR name to report.sh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#567} with diff file ISSM-13273-13274.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: CHG: removed == around NR title\\
+\vspace{3em}
+
+\noindent \textbf{Change \#568} with diff file ISSM-13274-13275.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: notes on how to get PETSc's libraries\\
+\vspace{3em}
+
+\noindent \textbf{Change \#569} with diff file ISSM-13275-13276.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/processdata.m\\
+Export determination: 6. \\
+Rationale: BUG: now use isprop instead of isfield\\
+\vspace{3em}
+
+\noindent \textbf{Change \#570} with diff file ISSM-13276-13277.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp M /issm/trunk-jpl/src/c/modules/Responsex/Responsex.h\\
+Export determination: 6. \\
+Rationale: CHG: overloaded function prototype to access either string or enum as response descriptor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#571} with diff file ISSM-13277-13278.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/FemModel.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h M /issm/trunk-jpl/src/c/solutions/ProcessArguments.cpp M /issm/trunk-jpl/src/c/solutions/issm.cpp M /issm/trunk-jpl/src/c/solutions/kriging.cpp M /issm/trunk-jpl/src/c/solutions/solutions.h\\
+Export determination: 6. \\
+Rationale: CHG: Expect directory argument in issm execution to be full path to bin file, pass rootpath to dakota\\
+\vspace{3em}
+
+\noindent \textbf{Change \#572} with diff file ISSM-13278-13279.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/acenet.m M /issm/trunk-jpl/src/m/classes/clusters/castor.m M /issm/trunk-jpl/src/m/classes/clusters/cosmos.m M /issm/trunk-jpl/src/m/classes/clusters/discover.m M /issm/trunk-jpl/src/m/classes/clusters/gemini.m M /issm/trunk-jpl/src/m/classes/clusters/generic.m M /issm/trunk-jpl/src/m/classes/clusters/greenplanet.m M /issm/trunk-jpl/src/m/classes/clusters/pfe.m M /issm/trunk-jpl/src/m/classes/clusters/pollux.m\\
+Export determination: 6. \\
+Rationale: CHG: Clusters pass directory argument in issm execution to be full path to bin file.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#573} with diff file ISSM-13279-13280.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mesh/meshconvert.py A /issm/trunk-jpl/test/NightlyRun/test106.py\\
+Export determination: 6. \\
+Rationale: FIX: Python needs to explicitly copy vectors from BamgConvertMesh for InterpFromMeshToMesh2d.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#574} with diff file ISSM-13280-13281.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/test111.py A /issm/trunk-jpl/test/NightlyRun/test112.py A /issm/trunk-jpl/test/NightlyRun/test113.py A /issm/trunk-jpl/test/NightlyRun/test114.py A /issm/trunk-jpl/test/NightlyRun/test115.py A /issm/trunk-jpl/test/NightlyRun/test116.py A /issm/trunk-jpl/test/NightlyRun/test117.py A /issm/trunk-jpl/test/NightlyRun/test118.py A /issm/trunk-jpl/test/NightlyRun/test120.py\\
+Export determination: 6. \\
+Rationale: NEW: Nine more working python tests!\\
+\vspace{3em}
+
+\noindent \textbf{Change \#575} with diff file ISSM-13281-13282.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py\\
+Export determination: 6. \\
+Rationale: CHG: Python: cluster pass directory argument in issm execution to be full path to bin file.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#576} with diff file ISSM-13282-13283.diff: \\
+Function name: \\
+M /issm/trunk-jpl/execution\\
+Export determination: 6. \\
+Rationale: CHG: get svn to ignore other test files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#577} with diff file ISSM-13283-13284.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/classes/IoModel.h A /issm/trunk-jpl/src/c/modules/AutodiffDriversx A /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp A /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp A /issm/trunk-jpl/src/c/modules/RequestedDependentsx A /issm/trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.cpp A /issm/trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.h M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/c/modules/modules.h M /issm/trunk-jpl/src/c/solutions/issm.cpp M /issm/trunk-jpl/src/c/solutions/transient\_core.cpp M /issm/trunk-jpl/src/m/classes/autodiff.m A /issm/trunk-jpl/src/m/enum/AutodiffJacobianEnum.m A /issm/trunk-jpl/src/m/enum/AutodiffXpEnum.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m\\
+Export determination: 6. \\
+Rationale: CHG: finished raw implementation to call ADOLC drivers. The drivers are called in AutodiffDriversx. We added parameters in Autodiff/CreateParametersAutodiff, such as the state variable xp. Added a bunch of enums accordingly. Hooked up all of this in the transient\_core solutoin for now. Of course, also added new module RequestedDependentsx, to declare which dependents are going to be our diagnostics.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#578} with diff file ISSM-13284-13285.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/ad.m\\
+Export determination: 6. \\
+Rationale: NEW: ad script to test adolc capabilities\\
+\vspace{3em}
+
+\noindent \textbf{Change \#579} with diff file ISSM-13285-13286.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp M /issm/trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: shielding these modules when not in AD mode.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#580} with diff file ISSM-13286-13287.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutions/issm.cpp\\
+Export determination: 6. \\
+Rationale: CHG: shielding issm.cpp from ADOLC when no ADOLC is available.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#581} with diff file ISSM-13287-13288.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h M /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp M /issm/trunk-jpl/src/modules/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: NEW: added BamgMesher compilation for python (still some FetchData to implement)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#582} with diff file ISSM-13288-13289.diff: \\
+Function name: \\
+M /issm/trunk-jpl/startup.py\\
+Export determination: 6. \\
+Rationale: CHG: taking 'from runme import runme' out from startup.py, as this is for the NR only\\
+\vspace{3em}
+
+\noindent \textbf{Change \#583} with diff file ISSM-13289-13290.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-linux64-astrid.sh\\
+Export determination: 6. \\
+Rationale: NEW: added support for python by default in configuration script (not activated if python is not installed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#584} with diff file ISSM-13290-13291.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/IoModel.h M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.h\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics (no more than ONE blank line PLEASE)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#585} with diff file ISSM-13291-13292.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/autodiff.m\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#586} with diff file ISSM-13292-13293.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: fixed location of CreateParametersAutodiff.cpp\\
+\vspace{3em}
+
+\noindent \textbf{Change \#587} with diff file ISSM-13293-13294.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Options/GenericOption.h M /issm/trunk-jpl/src/c/shared/Exp/exp.h\\
+Export determination: 6. \\
+Rationale: missing string function prototypes acc to gcc 4.7.1\\
+\vspace{3em}
+
+\noindent \textbf{Change \#588} with diff file ISSM-13294-13295.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/Solverx.h\\
+Export determination: 6. \\
+Rationale: NEW: EDF prototypes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#589} with diff file ISSM-13295-13296.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: NEW: EDF fos forward implementaion for solverx\\
+\vspace{3em}
+
+\noindent \textbf{Change \#590} with diff file ISSM-13296-13297.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Alloc/xNewDelete.h\\
+Export determination: 6. \\
+Rationale: NEW: 2-dim allocate/delete template fcts.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#591} with diff file ISSM-13297-13298.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: NEW: EDF fov forward implementaion for solverx\\
+\vspace{3em}
+
+\noindent \textbf{Change \#592} with diff file ISSM-13298-13299.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp\\
+Export determination: 6. \\
+Rationale: NEW set the required EDF members to call jacobian\\
+\vspace{3em}
+
+\noindent \textbf{Change \#593} with diff file ISSM-13299-13300.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: wrong order fixed to check on number of independents\\
+\vspace{3em}
+
+\noindent \textbf{Change \#594} with diff file ISSM-13300-13301.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed bug. If no dependents and independents, do not run the Autodiff drivers\\
+\vspace{3em}
+
+\noindent \textbf{Change \#595} with diff file ISSM-13301-13302.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: some reformatting, minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#596} with diff file ISSM-13302-13303.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/ad.m\\
+Export determination: 6. \\
+Rationale: CHG: ad test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#597} with diff file ISSM-13303-13304.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/os/ismpi.m A /issm/trunk-jpl/src/m/os/ismpi.py\\
+Export determination: 6. \\
+Rationale: NEW: detect mpi compile\\
+\vspace{3em}
+
+\noindent \textbf{Change \#598} with diff file ISSM-13304-13305.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.m\\
+Export determination: 6. \\
+Rationale: CHG: allow generic to run even when mpiexe is not available\\
+\vspace{3em}
+
+\noindent \textbf{Change \#599} with diff file ISSM-13305-13306.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py\\
+Export determination: 6. \\
+Rationale: CHG: run even when mpi is not available\\
+\vspace{3em}
+
+\noindent \textbf{Change \#600} with diff file ISSM-13306-13307.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutions/ProcessArguments.cpp\\
+Export determination: 6. \\
+Rationale: CHG: add error message if one argument is missing\\
+\vspace{3em}
+
+\noindent \textbf{Change \#601} with diff file ISSM-13307-13308.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py\\
+Export determination: 6. \\
+Rationale: FIX: Added import for ismpi.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#602} with diff file ISSM-13308-13309.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/yams/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: removed set -eu which creates problems\\
+\vspace{3em}
+
+\noindent \textbf{Change \#603} with diff file ISSM-13309-13310.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/petsc/install-3.2-linux64-python.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh\\
+Export determination: 6. \\
+Rationale: CHG: removed install-3.2-linux64-python.sh that is identical to install-3.2-linux64.sh and updated install-3.2-pleiades.sh so that shared libaries are supported\\
+\vspace{3em}
+
+\noindent \textbf{Change \#604} with diff file ISSM-13310-13311.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h\\
+Export determination: 6. \\
+Rationale: NEW: Preliminary python FetchData for BamgGeom, BamgMesh, and BamgOpts.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#605} with diff file ISSM-13311-13312.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/pfe.m\\
+Export determination: 6. \\
+Rationale: BUG: fixed path for pleiades interactive jobs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#606} with diff file ISSM-13312-13313.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Alloc/xNewDelete.h\\
+Export determination: 6. \\
+Rationale: CHG parameter not needed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#607} with diff file ISSM-13313-13314.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: NEW placeholder\\
+\vspace{3em}
+
+\noindent \textbf{Change \#608} with diff file ISSM-13314-13315.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp\\
+Export determination: 6. \\
+Rationale: setup for fos\_forward\\
+\vspace{3em}
+
+\noindent \textbf{Change \#609} with diff file ISSM-13315-13316.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Node.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed vim folds\\
+\vspace{3em}
+
+\noindent \textbf{Change \#610} with diff file ISSM-13316-13317.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h\\
+Export determination: 6. \\
+Rationale: CHG: added check if metis is not installed and np>1\\
+\vspace{3em}
+
+\noindent \textbf{Change \#611} with diff file ISSM-13317-13318.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h\\
+Export determination: 6. \\
+Rationale: CHG: added check if metis is not installed and np>1\\
+\vspace{3em}
+
+\noindent \textbf{Change \#612} with diff file ISSM-13318-13319.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp A /issm/trunk-jpl/src/m/enum/AutodiffFosForwardOutputEnum.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m\\
+Export determination: 6. \\
+Rationale: NEW: Added AutodiffFosForwardOutputEnum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#613} with diff file ISSM-13319-13320.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.cpp D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h\\
+Export determination: 6. \\
+Rationale: CHG: these files have never been compiled. Not needed anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#614} with diff file ISSM-13320-13321.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: CHG add in temporary debug output\\
+\vspace{3em}
+
+\noindent \textbf{Change \#615} with diff file ISSM-13321-13322.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/objects.h\\
+Export determination: 6. \\
+Rationale: BUG: removed PETSCVec from externalResults\\
+\vspace{3em}
+
+\noindent \textbf{Change \#616} with diff file ISSM-13322-13323.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp M /issm/trunk-jpl/src/c/python/io/WritePythonData.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Changes to FetchData for BamgGeom and BamgMesh.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#617} with diff file ISSM-13323-13324.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp\\
+Export determination: 6. \\
+Rationale: CHG replace memcpy calls\\
+\vspace{3em}
+
+\noindent \textbf{Change \#618} with diff file ISSM-13324-13325.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed number of input fields\\
+\vspace{3em}
+
+\noindent \textbf{Change \#619} with diff file ISSM-13325-13326.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/git/install.sh M /issm/trunk-jpl/src/c/Container/Elements.cpp M /issm/trunk-jpl/src/c/Makefile.am D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.cpp D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/BoolExternalResult.h D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.cpp D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleExternalResult.h D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.cpp D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleMatExternalResult.h D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.cpp D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/DoubleVecExternalResult.h A /issm/trunk-jpl/src/c/classes/objects/ExternalResults/GenericExternalResult.h D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.cpp D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/IntExternalResult.h D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.cpp D /issm/trunk-jpl/src/c/classes/objects/ExternalResults/StringExternalResult.h M /issm/trunk-jpl/src/c/classes/objects/objects.h M /issm/trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp M /issm/trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp M /issm/trunk-jpl/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp M /issm/trunk-jpl/src/c/solutions/control\_core.cpp M /issm/trunk-jpl/src/c/solutions/controlrestart.cpp M /issm/trunk-jpl/src/c/solutions/controltao\_core.cpp M /issm/trunk-jpl/src/c/solutions/issm.cpp M /issm/trunk-jpl/src/c/solutions/kriging.cpp M /issm/trunk-jpl/src/c/solvers/solver\_newton.cpp M /issm/trunk-jpl/src/c/solvers/solver\_nonlinear.cpp M /issm/trunk-jpl/test/NightlyRun/ad.m\\
+Export determination: 6. \\
+Rationale: NEW: large change. Replaced all our instances of ExternalResult objects with one generic templated class. Much simpler, though it hit some of the code in the solutions in modules.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#620} with diff file ISSM-13326-13327.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: simplified dumping into external results\\
+\vspace{3em}
+
+\noindent \textbf{Change \#621} with diff file ISSM-13327-13328.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Alloc/xNewDelete.h\\
+Export determination: 6. \\
+Rationale: CHG fix up the assertions\\
+\vspace{3em}
+
+\noindent \textbf{Change \#622} with diff file ISSM-13328-13329.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp\\
+Export determination: 6. \\
+Rationale: CHG : temporary addition of debug output\\
+\vspace{3em}
+
+\noindent \textbf{Change \#623} with diff file ISSM-13329-13330.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mesh/bamg.m\\
+Export determination: 6. \\
+Rationale: CHG: ContourToNodes only takes contour names (no structure) so that the module is compatible with python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#624} with diff file ISSM-13330-13331.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h M /issm/trunk-jpl/src/modules/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: NEW: added python support for ContourToMesh (had to remove structs as arguments\\
+\vspace{3em}
+
+\noindent \textbf{Change \#625} with diff file ISSM-13331-13332.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/ipython/install.sh\\
+Export determination: 6. \\
+Rationale: NEW: upgraded to ipython 0.13\\
+\vspace{3em}
+
+\noindent \textbf{Change \#626} with diff file ISSM-13332-13333.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/exp/expread.m A /issm/trunk-jpl/src/m/exp/expread.py\\
+Export determination: 6. \\
+Rationale: NEW: Python version of expread.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#627} with diff file ISSM-13333-13334.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#628} with diff file ISSM-13334-13335.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#629} with diff file ISSM-13335-13336.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/test121.py A /issm/trunk-jpl/test/NightlyRun/test122.py\\
+Export determination: 6. \\
+Rationale: Add test121.py and test122.py. Working on test201.py and Par/SquareShelf.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#630} with diff file ISSM-13336-13337.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.m M /issm/trunk-jpl/test/NightlyRun/runme.py\\
+Export determination: 6. \\
+Rationale: CHG: removed from MatlabFuncs import *, which was producing the following error message: 'SyntaxWarning: import Archive Forms LastMerge oecreview.sh SyncBranches.sh TEMP Template only allowed at module level'\\
+\vspace{3em}
+
+\noindent \textbf{Change \#631} with diff file ISSM-13337-13338.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: NEW: add OS after machine name\\
+\vspace{3em}
+
+\noindent \textbf{Change \#632} with diff file ISSM-13338-13339.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/exp/expread.m M /issm/trunk-jpl/src/m/exp/expread.py\\
+Export determination: 6. \\
+Rationale: CHG: Revision for python.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#633} with diff file ISSM-13339-13340.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/miscellaneous/BinRead.py\\
+Export determination: 6. \\
+Rationale: NEW: Stand-alone python tool to read marshalled binary files.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#634} with diff file ISSM-13340-13341.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test421.m\\
+Export determination: 6. \\
+Rationale: CHG: minor tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#635} with diff file ISSM-13341-13342.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/exp/expread.py M /issm/trunk-jpl/src/m/exp/expwrite.m A /issm/trunk-jpl/src/m/exp/expwrite.py\\
+Export determination: 6. \\
+Rationale: NEW: Python version of expwrite (plus some cleanup).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#636} with diff file ISSM-13342-13343.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/model.m\\
+Export determination: 6. \\
+Rationale: BUG: distinguish between matice and matdamageice when loading a model object\\
+\vspace{3em}
+
+\noindent \textbf{Change \#637} with diff file ISSM-13343-13344.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/swig/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: fixed problem in redefining CFLAGS\\
+\vspace{3em}
+
+\noindent \textbf{Change \#638} with diff file ISSM-13344-13345.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/boost A /issm/trunk-jpl/externalpackages/boost/install-macosx-snowleopard.sh M /issm/trunk-jpl/externalpackages/freetype M /issm/trunk-jpl/externalpackages/latex2rtf M /issm/trunk-jpl/externalpackages/libpng M /issm/trunk-jpl/externalpackages/metis M /issm/trunk-jpl/externalpackages/pyclips M /issm/trunk-jpl/externalpackages/python M /issm/trunk-jpl/externalpackages/scipy/install-macosx-lion.sh M /issm/trunk-jpl/externalpackages/vim/addons/vimrc\\
+Export determination: 6. \\
+Rationale: CHG: get svn to ignore some files.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#639} with diff file ISSM-13345-13346.diff: \\
+Function name: \\
+M /issm/trunk-jpl/bin\\
+Export determination: 6. \\
+Rationale: CHG: get svn to ignore some files.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#640} with diff file ISSM-13346-13347.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: added swig to the path.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#641} with diff file ISSM-13347-13348.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/matdamageice.m M /issm/trunk-jpl/src/m/classes/model/model.m M /issm/trunk-jpl/src/m/classes/oldclasses/materials.m\\
+Export determination: 6. \\
+Rationale: NEW: enable to load old model with rheology\_Z (matdamageice)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#642} with diff file ISSM-13348-13349.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-linux64-astrid-petscdev.sh\\
+Export determination: 6. \\
+Rationale: CHG: Removed Spooles (no longer supported), and prometheus (to be dropped by petsc) and associated libs (i.e. Pastix, Scotch)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#643} with diff file ISSM-13349-13350.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h M /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp M /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py A /issm/trunk-jpl/src/m/enum/GenericParamEnum.m M /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m\\
+Export determination: 6. \\
+Rationale: CHG: new GenericParamEnum enum.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#644} with diff file ISSM-13350-13351.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/report.sh\\
+Export determination: 6. \\
+Rationale: BUG: fixed installation status failed color\\
+\vspace{3em}
+
+\noindent \textbf{Change \#645} with diff file ISSM-13351-13352.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/geometry/SegIntersect.m\\
+Export determination: 6. \\
+Rationale: NEW: Python version of SegIntersect.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#646} with diff file ISSM-13352-13353.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/geometry/SegIntersect.py\\
+Export determination: 6. \\
+Rationale: NEW: Python version of SegIntersect (would be good if I added the real file).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#647} with diff file ISSM-13353-13354.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp M /issm/trunk-jpl/src/c/matlab/io/matlabio.h M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h M /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp M /issm/trunk-jpl/src/c/shared/Exp/exp.h M /issm/trunk-jpl/src/m/mesh/bamg.m M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp M /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h\\
+Export determination: 6. \\
+Rationale: NEW: FtechData can now retrieve contours either from a file or from a matlab structure (python equivalent needs to be implemented\\
+\vspace{3em}
+
+\noindent \textbf{Change \#648} with diff file ISSM-13354-13355.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/matplotlib/install-osx.sh\\
+Export determination: 6. \\
+Rationale: CHG: debugged issues of permissions with freetype2 include files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#649} with diff file ISSM-13355-13356.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp M /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.h M /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp\\
+Export determination: 6. \\
+Rationale: CHG: do not use DomainOutlineRead anymore, use FetchDatadirectly\\
+\vspace{3em}
+
+\noindent \textbf{Change \#650} with diff file ISSM-13356-13357.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: missing include files for numpy, starting from the numpy root directory\\
+\vspace{3em}
+
+\noindent \textbf{Change \#651} with diff file ISSM-13357-13358.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Exp/exp.h\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#652} with diff file ISSM-13358-13359.diff: \\
+Function name: \\
+A /issm/trunk-jpl/configs/config-macosx64-chris-bothapis.sh A /issm/trunk-jpl/configs/config-macosx64-chris-python.sh\\
+Export determination: 6. \\
+Rationale: CHG: iMac-lion python and matlab install scripts\\
+\vspace{3em}
+
+\noindent \textbf{Change \#653} with diff file ISSM-13359-13360.diff: \\
+Function name: \\
+M /issm/trunk-jpl/lib\\
+Export determination: 6. \\
+Rationale: CHG: get svn to ignore some files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#654} with diff file ISSM-13360-13361.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model/model.py\\
+Export determination: 6. \\
+Rationale: CHG: minor, missing parenthesis in string output\\
+\vspace{3em}
+
+\noindent \textbf{Change \#655} with diff file ISSM-13361-13362.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: CH remove temporary debug output\\
+\vspace{3em}
+
+\noindent \textbf{Change \#656} with diff file ISSM-13362-13363.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp\\
+Export determination: 6. \\
+Rationale: CHG remove temporary debug output\\
+\vspace{3em}
+
+\noindent \textbf{Change \#657} with diff file ISSM-13363-13364.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/include/python\_macros.h M /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp M /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h M /issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp\\
+Export determination: 6. \\
+Rationale: NEW: improved error message handle in python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#658} with diff file ISSM-13364-13365.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: CHG wrong index\\
+\vspace{3em}
+
+\noindent \textbf{Change \#659} with diff file ISSM-13365-13366.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/include/python\_macros.h\\
+Export determination: 6. \\
+Rationale: BUG: added return NULL to avoid segfault\\
+\vspace{3em}
+
+\noindent \textbf{Change \#660} with diff file ISSM-13366-13367.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/TriMesh/GridInsideHole.cpp\\
+Export determination: 6. \\
+Rationale: BUG: need to initialize flag before calling IsInPolySerial\\
+\vspace{3em}
+
+\noindent \textbf{Change \#661} with diff file ISSM-13367-13368.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Exp/IsInPolySerial.cpp M /issm/trunk-jpl/src/c/shared/TriMesh/GridInsideHole.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed bug in trimesh with holes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#662} with diff file ISSM-13368-13369.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h\\
+Export determination: 6. \\
+Rationale: NEW: Python version of FetchData for contours (corresponding to [13353],[13355]).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#663} with diff file ISSM-13369-13370.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test211.m\\
+Export determination: 6. \\
+Rationale: HCG: minor tolerances test211\\
+\vspace{3em}
+
+\noindent \textbf{Change \#664} with diff file ISSM-13370-13371.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh D /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh D /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh A /issm/trunk-jpl/externalpackages/python/install-2.7.3-linux64.sh (from /issm/trunk-jpl/externalpackages/python/install-2.7.2-linux64.sh:13369) A /issm/trunk-jpl/externalpackages/python/install-2.7.3-macosx-lion.sh (from /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-lion.sh:13369) A /issm/trunk-jpl/externalpackages/python/install-2.7.3-macosx-snowleopard.sh (from /issm/trunk-jpl/externalpackages/python/install-2.7.2-macosx-snowleopard.sh:13369)\\
+Export determination: 6. \\
+Rationale: NEW: changed default python version to 2.7.3\\
+\vspace{3em}
+
+\noindent \textbf{Change \#665} with diff file ISSM-13371-13372.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/matplotlib/install-linux64.sh (from /issm/trunk-jpl/externalpackages/matplotlib/install.sh:13370) A /issm/trunk-jpl/externalpackages/matplotlib/install-macosx64.sh (from /issm/trunk-jpl/externalpackages/matplotlib/install-osx.sh:13370) D /issm/trunk-jpl/externalpackages/matplotlib/install-osx.sh D /issm/trunk-jpl/externalpackages/matplotlib/install.sh M /issm/trunk-jpl/externalpackages/numpy/install-linux64.sh M /issm/trunk-jpl/externalpackages/numpy/install-macosx-snowleopard.sh M /issm/trunk-jpl/externalpackages/scipy/install-linux64.sh M /issm/trunk-jpl/externalpackages/scipy/install-macosx-snowleopard.sh\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#666} with diff file ISSM-13372-13373.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Changed python FetchData for strings, vectors, and matrices to copy data out of python space.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#667} with diff file ISSM-13373-13374.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp M /issm/trunk-jpl/src/c/python/io/pythonio.h\\
+Export determination: 6. \\
+Rationale: CHG: Changed appropriate FetchData to memcpy and added more to FetchData for Options.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#668} with diff file ISSM-13374-13375.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Cosmetic changes to python FetchData.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#669} with diff file ISSM-13375-13376.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp M /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp\\
+Export determination: 6. \\
+Rationale: NEW: enable to Fetch matlab single vectors\\
+\vspace{3em}
+
+\noindent \textbf{Change \#670} with diff file ISSM-13376-13377.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp M /issm/trunk-jpl/src/c/solutions/kriging.cpp\\
+Export determination: 6. \\
+Rationale: BUG: Fixed parallel kriging with new iomodel->dependents\\
+\vspace{3em}
+
+\noindent \textbf{Change \#671} with diff file ISSM-13377-13378.diff: \\
+Function name: \\
+D /issm/trunk-jpl/configs/config-macosx64-helene.sh A /issm/trunk-jpl/configs/config-macosx64-lion-helene.sh\\
+Export determination: 6. \\
+Rationale: CHG: changed mac lion config to have both python and matlab\\
+\vspace{3em}
+
+\noindent \textbf{Change \#672} with diff file ISSM-13378-13379.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp M /issm/trunk-jpl/src/c/matlab/io/MatlabNArrayToNArray.cpp\\
+Export determination: 6. \\
+Rationale: CHG:cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#673} with diff file ISSM-13379-13380.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Container/Elements.cpp\\
+Export determination: 6. \\
+Rationale: CHG: bug fix. Nasty index issue\\
+\vspace{3em}
+
+\noindent \textbf{Change \#674} with diff file ISSM-13380-13381.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor. better name for nrows variable\\
+\vspace{3em}
+
+\noindent \textbf{Change \#675} with diff file ISSM-13381-13382.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Container/Elements.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics - no more than one blank line\\
+\vspace{3em}
+
+\noindent \textbf{Change \#676} with diff file ISSM-13382-13383.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/adolc/install-dev.sh\\
+Export determination: 6. \\
+Rationale: upgrade to newer version\\
+\vspace{3em}
+
+\noindent \textbf{Change \#677} with diff file ISSM-13383-13384.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/solve.m\\
+Export determination: 6. \\
+Rationale: CHG: avoid getting information output flagged by the nightly run\\
+\vspace{3em}
+
+\noindent \textbf{Change \#678} with diff file ISSM-13384-13385.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/git/install-nopython.sh\\
+Export determination: 6. \\
+Rationale: NEW: configure script when python is not available\\
+\vspace{3em}
+
+\noindent \textbf{Change \#679} with diff file ISSM-13385-13386.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Container/Options.h M /issm/trunk-jpl/src/c/classes/bamg/Geometry.cpp\\
+Export determination: 6. \\
+Rationale: CHG: special case to retrive string, need to return a copy of the default value otherwise delete will crash\\
+\vspace{3em}
+
+\noindent \textbf{Change \#680} with diff file ISSM-13386-13387.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutions/issm.cpp\\
+Export determination: 6. \\
+Rationale: CHG: with the forthcoming changes this will no longer work with the older versions anyway and the numbering is not consistently set\\
+\vspace{3em}
+
+\noindent \textbf{Change \#681} with diff file ISSM-13387-13388.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solvers/solver\_linear.cpp\\
+Export determination: 6. \\
+Rationale: CHG keep around commented out for now - to be removed later when we established regression testing\\
+\vspace{3em}
+
+\noindent \textbf{Change \#682} with diff file ISSM-13388-13389.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/adolc/install-dev.sh\\
+Export determination: 6. \\
+Rationale: CHG adjusted default behavior in configure script, examples not needed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#683} with diff file ISSM-13389-13390.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configs/config-linux64-astrid-ad.sh\\
+Export determination: 6. \\
+Rationale: CHG: use ADOLC devel version\\
+\vspace{3em}
+
+\noindent \textbf{Change \#684} with diff file ISSM-13390-13391.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: aspell path\\
+\vspace{3em}
+
+\noindent \textbf{Change \#685} with diff file ISSM-13391-13392.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/objects\\
+Export determination: 6. \\
+Rationale: Ignore Params.new\\
+\vspace{3em}
+
+\noindent \textbf{Change \#686} with diff file ISSM-13392-13393.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac\\
+Export determination: 6. \\
+Rationale: CHG: ISSM version number\\
+\vspace{3em}
+
Index: /issm/oecreview/Archive/12678-13393/r1.tex
===================================================================
--- /issm/oecreview/Archive/12678-13393/r1.tex	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/r1.tex	(revision 13394)
@@ -0,0 +1,1 @@
+12678
Index: /issm/oecreview/Archive/12678-13393/r2.tex
===================================================================
--- /issm/oecreview/Archive/12678-13393/r2.tex	(revision 13394)
+++ /issm/oecreview/Archive/12678-13393/r2.tex	(revision 13394)
@@ -0,0 +1,1 @@
+13393
